diff --git a/bash-5.1/builtins_rust/common/Cargo.toml b/bash-5.1/builtins_rust/common/Cargo.toml index a180848df16c907213f174d8b8b639b659d44cc3..374f067fa7a3dbe1753af1cb1e9385a325fa611b 100644 --- a/bash-5.1/builtins_rust/common/Cargo.toml +++ b/bash-5.1/builtins_rust/common/Cargo.toml @@ -8,8 +8,7 @@ edition = "2021" [dependencies] libc = "0.2" nix = "0.24" - - +unic-langid = "0.9.0" [lib] crate-type = ["staticlib","rlib"] name = "rcommon" diff --git a/bash-5.1/builtins_rust/common/src/lib.rs b/bash-5.1/builtins_rust/common/src/lib.rs index e01b6705d7f32b1349e8c6457e1130d6bddffe63..1e48063864edccc01012cb39dad7d68d6d0b07e6 100644 --- a/bash-5.1/builtins_rust/common/src/lib.rs +++ b/bash-5.1/builtins_rust/common/src/lib.rs @@ -6,7 +6,8 @@ use std::ffi::{CStr, CString}; use std::mem::size_of; use std::ptr::read_volatile; use nix::errno::errno; - +use std::env::var; +use unic_langid::LanguageIdentifier; include!(concat!("lib_readline_keymaps.rs")); include!(concat!("command.rs")); @@ -662,6 +663,7 @@ extern "C"{ fn builtin_help(); fn builtin_error(format:*const c_char,...); + } unsafe fn ISOPTION(s:* const c_char, c:c_char)->bool @@ -1730,7 +1732,7 @@ pub extern "C" fn r_builtin_bind_variable(name:*mut c_char,value:*mut c_char,fla /* Like check_unbind_variable, but for use by builtins (only matters for error messages). */ -pub extern "C" fn r_builtin_unbind_variable(vname:*const c_char)->i32{ + pub extern "C" fn r_builtin_unbind_variable(vname:*const c_char)->i32{ let v:*mut SHELL_VAR; unsafe{ @@ -1753,3 +1755,20 @@ pub extern "C" fn r_builtin_unbind_variable(vname:*const c_char)->i32{ } } +pub extern "C" fn get_local_str()-> Vec{ + + let lang : String; + match var("LANGUAGE") { + Ok(v) => lang = v , + Err(e) => + { + lang = String::from("en-US"); + println!("err is {e:?}") + }, + } + println!("now language is {:?}",lang); + //parse() 用于类型转换 + let langid : LanguageIdentifier = lang.parse().expect("wrong language"); + let locales = vec![langid.into()]; + return locales; + } \ No newline at end of file diff --git a/bash-5.1/builtins_rust/help/Cargo.toml b/bash-5.1/builtins_rust/help/Cargo.toml index 993d13e0d1533cd1e18757cb8589fb5f3952316e..1228246909ca100596ed04a5dc39014978b8690a 100644 --- a/bash-5.1/builtins_rust/help/Cargo.toml +++ b/bash-5.1/builtins_rust/help/Cargo.toml @@ -9,6 +9,9 @@ edition = "2018" libc = "0.2" nix = "0.24.1" rcommon = {path ="../common"} +fluent = "0.16.0" +fluent-bundle = "0.15.2" +fluent-resmgr = "0.0.5" [lib] crate-type = ["staticlib","rlib"] diff --git a/bash-5.1/builtins_rust/help/src/lib.rs b/bash-5.1/builtins_rust/help/src/lib.rs index 37ce387c6d3b529b16fb160e8fbc9f0056bfa39d..281fe0bc3d227cabebc447030810306bb9c810d9 100644 --- a/bash-5.1/builtins_rust/help/src/lib.rs +++ b/bash-5.1/builtins_rust/help/src/lib.rs @@ -3,8 +3,12 @@ extern crate nix; extern crate std; use libc::{c_char, c_void ,putchar, free}; use std::{ffi::{CString,CStr}, i32, io::{Read, stdout, Write}, mem, string, u32}; -use rcommon::{WordList, WordDesc, EX_USAGE, EXECUTION_SUCCESS, EXECUTION_FAILURE, EX_NOTFOUND, EX_NOEXEC, SUBSHELL_PAREN,r_builtin_usage}; +use rcommon::{WordList, WordDesc, EX_USAGE, EXECUTION_SUCCESS, + EXECUTION_FAILURE, EX_NOTFOUND, EX_NOEXEC, SUBSHELL_PAREN, + r_builtin_usage,get_local_str}; +use fluent_bundle::{FluentBundle, FluentResource, FluentValue, FluentArgs}; +use fluent_resmgr::resource_manager::ResourceManager; pub enum Option { None, Some(T), @@ -421,10 +425,12 @@ fn show_manpage (name : *mut c_char, i : i32){ let mut j :i32; let mut doc :*mut *mut libc::c_char; - let mut line :*mut libc::c_char = 0 as *mut libc::c_char;; + let mut line :*mut libc::c_char = 0 as *mut libc::c_char; let mut fd: i32; let mut usefile : bool; let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; + let mgr = ResourceManager::new("./resources/{locale}/{res_id}".into()); + let resources = vec![ "message.ftl".into()]; unsafe { doc = builtin1.long_doc; @@ -484,13 +490,16 @@ fn show_manpage (name : *mut c_char, i : i32){ /* DESCRIPTION */ println! ("DESCRIPTION\n"); if !usefile{ - let mut j = 0 ; - unsafe { - while (*((doc as usize + (8*j))as *mut *mut c_char)as *mut c_char) != std::ptr::null_mut() { - println! (" {:?}\n", unsafe{CStr::from_ptr(*((doc as usize + (8*j))as *mut *mut c_char)as *mut c_char)}); - j += 1; - } - } + let mut args = FluentArgs::new(); + let c_str: &CStr = unsafe { CStr::from_ptr(builtin1.name) }; + let msg: &str = c_str.to_str().unwrap(); + args.set("cmdName",msg); + let bundle = mgr.get_bundle(get_local_str(), resources); + let value = bundle.get_message("helplongdoc").unwrap(); + let pattern = value.value().expect("partern err"); + let mut errors = vec![]; + let msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!("{}", msg1); } else{ while doc != std::ptr::null_mut() && (((doc as usize + (8*j)))as * mut c_char) != std::ptr::null_mut() { @@ -665,3 +674,4 @@ unsafe { // } // len // } + diff --git a/bash-5.1/cargo/config.toml b/bash-5.1/cargo/config.toml new file mode 100644 index 0000000000000000000000000000000000000000..b00244ad75ee9251cbeb6b9079d55a82de8e8ef4 --- /dev/null +++ b/bash-5.1/cargo/config.toml @@ -0,0 +1,10 @@ +[source.crates-io] +replace-with = "vendored-sources" + +[source."https://github.com/shadowsocks/crypto"] +git = "https://github.com/shadowsocks/crypto" +branch = "master" +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" diff --git a/bash-5.1/resources/en-US/message.ftl b/bash-5.1/resources/en-US/message.ftl new file mode 100644 index 0000000000000000000000000000000000000000..19e8a7bd03f9cf14aebb99eed3f7a43ffcc6d4ba --- /dev/null +++ b/bash-5.1/resources/en-US/message.ftl @@ -0,0 +1,1327 @@ +helplongdoc ={ +$cmdName -> + [set] + Set or unset values of shell options and positional parameters. + + Change the value of shell attributes and positional parameters, or + display tmes and values of shell variables. + + Options: + -a Mark variables which are modified or created for export. + -b Notify of job termination immediately. + -e Exit immediately if a command exits with a non-zero status. + -f Disable file name generation (globbing). + -h Remember the location of commands as they are looked up. + -k All assignment arguments are placed in the environment for a + command, not just those that precede the command name. + -m Job control is enabled. + -n Read commands but do not execute them. + -o option-name + Set the variable corresponding to option-name: + allexport same as -a + braceexpand same as -B + emacs use an emacs-style line editing interface + errexit same as -e + errtrace same as -E + functrace same as -T + hashall same as -h + histexpand same as -H + history enable command history + ignoreeof the shell will not exit upon reading EOF + interactive-comments + allow comments to appear in interactive commands + keyword same as -k + monitor same as -m + noclobber same as -C + noexec same as -n + noglob same as -f + nolog currently accepted but ignored + notify same as -b + nounset same as -u + onecmd same as -t + physical same as -P + pipefail the return value of a pipeline is the status of + the last command to exit with a non-zero status, + or zero if no command exited with a non-zero status + posix change the behavior of bash where the default + operation differs from the Posix standard to + match the standard + privileged same as -p + verbose same as -v + vi use a vi-style line editing interface + xtrace same as -x + -p Turned on whenever the real and effective user ids do not match. + Disables processing of the $ENV file and importing of shell + functions. Turning this option off causes the effective uid and + gid to be set to the real uid and gid. + -t Exit after reading and executing one command. + -u Treat unset variables as an error when substituting. + -v Print shell input lines as they are read. + -x Print commands and their arguments as they are executed. + -B the shell will perform brace expansion + -C If set, disallow existing regular files to be overwritten + by redirection of output. + -E If set, the ERR trap is inherited by shell functions. + -H Enable ! style history substitution. This flag is on + by default when the shell is interactive. + -P If set, do not resolve symbolic links when executing commands + such as cd which change the current directory. + -T If set, the DEBUG and RETURN traps are inherited by shell functions. + -- Assign any remaining arguments to the positional parameters. + If there are no remaining arguments, the positional parameters + are unset. + - Assign any remaining arguments to the positional parameters. + The -x and -v options are turned off. + + Using + rather than - causes these flags to be turned off. + The flags can also be used upon invocation of the shell. + The current set of flags may be found in $-. + The remaining n ARGs are positional + parameters and are assigned, in order, to $1, $2, .. $n. If no + ARGs are given, all shell variables are printed. + + Exit Status: + Returns success unless an invalid option is given. + [read] Read a line from the standard input and split it into fields. + + Reads a single line from the standard input, or from file descriptor FD + if the -u option is supplied. The line is split into fields as with + word splitting, and the first word is assigned to the first NAME, the + second word to the second NAME, and so on, with any leftover words + assigned to the last NAME. Only the characters found in $IFS are recognized + as word delimiters. + + If no NAMEs are supplied, the line read is stored in the REPLY + variable. + + Options: + -a array assign the words read to sequential indices of the array + variable ARRAY, starting at zero + -d delim continue until the first character of DELIM is read, rather + than newline + -e use Readline to obtain the line + -i text use TEXT as the initial text for Readline + -n nchars return after reading NCHARS characters rather than waiting + for a newline, but honor a delimiter if fewer than + NCHARS characters are read before the delimiter + -N nchars return only after reading exactly NCHARS characters, + unless + EOF is encountered or read times out, ignoring any + delimiter + -p prompt output the string PROMPT without a trailing newline before + attempting to read + -r do not allow backslashes to escape any characters + -s do not echo input coming from a terminal + -t timeout time out and return failure if a complete line of + input is not read within TIMEOUT seconds. The value of the + TMOUT variable is the default timeout. TIMEOUT may be a + fractional number. If TIMEOUT is 0, read returns + immediately, without trying to read any data, returning + success only if input is available on the specified + file descriptor. The exit status is greater than 128 + if the timeout is exceeded + -u fd read from file descriptor FD instead of the standard input + + Exit Status: + The return code is zero, unless end-of-file is encountered, read times + out (in which case it's greater than 128), a variable assignment error + occurs, or an invalid file descriptor is supplied as the argument to -u. + + [type] Display information about command type. + + For each NAME, indicate how it would be interpreted if used as a + command name. + + Options: + -a display all locations containing an executable named NAME; + includes aliases, builtins, and functions, if and only if + the `-p' option is not also used + -f suppress shell function lookup + -P force a PATH search for each NAME, even if it is an alias, + builtin, or function, and returns the name of the disk file + that would be executed + -p returns either the name of the disk file that would be executed, + or nothing if `type -t NAME' would not return `file' + -t output a single word which is one of `alias', `keyword', + `function', `builtin', `file' or `', if NAME is an alias, + shell reserved word, shell function, shell builtin, disk file, + or not found, respectively + + Arguments: + NAME Command name to be interpreted. + + Exit Status: + Returns success if all of the NAMEs are found; fails if any are not + found. + + [trap] Trap signals and other events. + + Defines and activates handlers to be run when the shell receives + signals or other conditions. + + ARG is a command to be read and executed when the shell receives the + signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC + is supplied) or `-', each specified signal is reset to its original + value. If ARG is the null string each SIGNAL_SPEC is ignored by the + shell and by the commands it invokes. + + If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. + If a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. + If a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or + a script run by the . or source builtins finishes executing. A + SIGNAL_SPEC of ERR means to execute ARG each time a command's failure + would cause the shell to exit when the -e option is enabled. + + If no arguments are supplied, trap prints the list of commands + associated with each signal. + + Options: + -l print a list of signal names and their corresponding numbers + -p display the trap commands associated with each SIGNAL_SPEC + + Each SIGNAL_SPEC is either a signal name in or a signal + number. + Signal names are case insensitive and the SIG prefix is optional. A + signal may be sent to the shell with \kill -signal $$\. + + Exit Status: + Returns success unless a SIGSPEC is invalid or an invalid option is + given. + + [alias] Define or display aliases. + + Without arguments, `alias' prints the list of aliases in the reusable + form `alias NAME=VALUE' on standard output. + + Otherwise, an alias is defined for each NAME whose VALUE is given. + A trailing space in VALUE causes the next word to be checked for + alias substitution when the alias is expanded. + + Options: + -p print all defined aliases in a reusable format + + Exit Status: + alias returns true unless a NAME is supplied for which no alias has + been defined. + + [unalias] Remove each NAME from the list of defined aliases. + + Options: + -a remove all alias definitions + + Return success unless a NAME is not an existing alias. + + [break] Exit for, while, or until loops. + + Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing + loops. + + Exit Status: + The exit status is 0 unless N is not greater than or equal to 1. + + [continue] Resume for, while, or until loops. + + Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop. + If N is specified, resumes the Nth enclosing loop. + + Exit Status: + The exit status is 0 unless N is not greater than or equal to 1. + + [builtin] Execute shell builtins. + + Execute SHELL-BUILTIN with arguments ARGs without performing command + lookup. This is useful when you wish to reimplement a shell builtin + as a shell function, but need to execute the builtin within the + function. + + Exit Status: + Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is + not a shell builtin. + + [caller] Returns the context of the current subroutine call. + + Without EXPR, returns \$line $filename\. With EXPR, returns + \$line $subroutine $filename\; this extra information can be used to + provide a stack trace. + + The value of EXPR indicates how many call frames to go back before the + current one; the top frame is frame 0. + + [cd] Change the shell working directory. + + Change the current directory to DIR. The default DIR is the value of + the HOME shell variable. + + The variable CDPATH defines the search path for the directory + containing DIR. Alternative directory names in CDPATH are + separated by a colon (:). + A null directory name is the same as the current directory. If DIR + begins with a slash (/), then CDPATH is not used. + + If the directory is not found, and the shell option `cdable_vars' is + set,the word is assumed to be a variable name. If that variable has a + value,its value is used for DIR. + + Options: + -L force symbolic links to be followed: resolve symbolic + links in DIR after processing instances of `..' + -P use the physical directory structure without following + symbolic links: resolve symbolic links in DIR before + processing instances of `..' + -e if the -P option is supplied, and the current working + directory cannot be determined successfully, exit with + a non-zero status + -@ on systems that support it, present a file with extended + attributes as a directory containing the file attributes + + The default is to follow symbolic links, as if `-L' were specified. + `..' is processed by removing the immediately previous pathname + component back to a slash or the beginning of DIR. + + Exit Status: + Returns 0 if the directory is changed, and if $PWD is set successfully + when -P is used; non-zero otherwise. + + [pwd] Print the name of the current working directory. + + Options: + -L print the value of $PWD if it names the current working + directory + -P print the physical directory, without any symbolic links + + By default, `pwd' behaves as if `-L' were specified. + + Exit Status: + Returns 0 unless an invalid option is given or the current directory + cannot be read. + + [true] Null command. + + No effect; the command does nothing. + + Exit Status: + Always succeeds. + + [shopt] Set and unset shell options. + + Change the setting of each shell option OPTNAME. Without any option + arguments, list each supplied OPTNAME, or all shell options if no + OPTNAMEs are given, with an indication of whether or not each is set. + + Options: + -o restrict OPTNAMEs to those defined for use with `set -o' + -p print each shell option with an indication of its status + -q suppress output + -s enable (set) each OPTNAME + -u disable (unset) each OPTNAME + + Exit Status: + Returns success if OPTNAME is enabled; fails if an invalid option is + given or OPTNAME is disabled. + + [false] Return an unsuccessful result. + + Exit Status: + Always fails. + + [command] Execute a simple command or display information about commands. + + Runs COMMAND with ARGS suppressing shell function lookup, or display + information about the specified COMMANDs. Can be used to invoke + commands on disk when a function with the same name exists. + + Options: + -p use a default value for PATH that is guaranteed to find all of + the standard utilities + -v print a description of COMMAND similar to the `type' builtin + -V print a more verbose description of each COMMAND + + Exit Status: + Returns exit status of COMMAND, or failure if COMMAND is not found. + + [echo] Write arguments to the standard output. + + Display the ARGs, separated by a single space character and followed by + a newline, on the standard output. + + Options: + -n do not append a newline + -e enable interpretation of the following backslash escapes + -E explicitly suppress interpretation of backslash escapes + + `echo' interprets the following backslash-escaped characters: + \\a alert (bell) + \\b backspace + \\c suppress further output + \\e escape character + \\E escape character + \\f form feed + \ new line + \\r carriage return + \ horizontal tab + \\v vertical tab + \\\\ backslash + \\0nnn the character whose ASCII code is NNN (octal). NNN can be + 0 to 3 octal digits + \\xHH the eight-bit character whose value is HH (hexadecimal). HH + can be one or two hex digits + \\uHHHH the Unicode character whose value is the hexadecimal value + HHHH. + HHHH can be one to four hex digits. + \\UHHHHHHHH the Unicode character whose value is the hexadecimal + value + HHHHHHHH. HHHHHHHH can be one to eight hex digits. + + Exit Status: + Returns success unless a write error occurs. + + [enable] Enable and disable shell builtins. + + Enables and disables builtin shell commands. Disabling allows you to + execute a disk command which has the same name as a shell builtin + without using a full pathname. + + Options: + -a print a list of builtins showing whether or not each is enabled + -n disable each NAME or display a list of disabled builtins + -p print the list of builtins in a reusable format + -s print only the names of Posix `special' builtins + + Options controlling dynamic loading: + -f Load builtin NAME from shared object FILENAME + -d Remove a builtin loaded with -f + + Without options, each NAME is enabled. + + To use the `test' found in $PATH instead of the shell builtin + version, type `enable -n test'. + + Exit Status: + Returns success unless NAME is not a shell builtin or an error occurs. + + [getopts] Parse option arguments. + + Getopts is used by shell procedures to parse positional parameters + as options. + + OPTSTRING contains the option letters to be recognized; if a letter + is followed by a colon, the option is expected to have an argument, + which should be separated from it by white space. + + Each time it is invoked, getopts will place the next option in the + shell variable $name, initializing name if it does not exist, and + the index of the next argument to be processed into the shell + variable OPTIND. OPTIND is initialized to 1 each time the shell or + a shell script is invoked. When an option requires an argument, + getopts places that argument into the shell variable OPTARG. + + getopts reports errors in one of two ways. If the first character + of OPTSTRING is a colon, getopts uses silent error reporting. In + this mode, no error messages are printed. If an invalid option is + seen, getopts places the option character found into OPTARG. If a + required argument is not found, getopts places a ':' into NAME and + sets OPTARG to the option character found. If getopts is not in + silent mode, and an invalid option is seen, getopts places '?' into + NAME and unsets OPTARG. If a required argument is not found, a '?' + is placed in NAME, OPTARG is unset, and a diagnostic message is + printed. + + If the shell variable OPTERR has the value 0, getopts disables the + printing of error messages, even if the first character of + OPTSTRING is not a colon. OPTERR has the value 1 by default. + + Getopts normally parses the positional parameters, but if arguments + are supplied as ARG values, they are parsed instead. + + Exit Status: + Returns success if an option is found; fails if the end of options is + encountered or an error occurs. + + [exec] Replace the shell with the given command. + + Execute COMMAND, replacing this shell with the specified program. + ARGUMENTS become the arguments to COMMAND. If COMMAND is not + specified, + any redirections take effect in the current shell. + + Options: + -a name pass NAME as the zeroth argument to COMMAND + -c execute COMMAND with an empty environment + -l place a dash in the zeroth argument to COMMAND + + If the command cannot be executed, a non-interactive shell exits, + unless + the shell option `execfail' is set. + + Exit Status: + Returns success unless COMMAND is not found or a redirection error + occurs. + + [exit] Exit the shell. + + Exits the shell with a status of N. If N is omitted, the exit status + is that of the last command executed. + + [logout] Exit a login shell. + + Exits a login shell with exit status N. Returns an error if not + executed in a login shell. + + [fc] Display or execute commands from the history list. + + fc is used to list or edit and re-execute commands from the history + list. + FIRST and LAST can be numbers specifying the range, or FIRST can be a + string, which means the most recent command beginning with that + string. + + Options: + -e ENAME select which editor to use. Default is FCEDIT, then + EDITOR, + then vi + -l list lines instead of editing + -n omit line numbers when listing + -r reverse the order of the lines (newest listed first) + + With the `fc -s [pat=rep ...] [command]' format, COMMAND is + re-executed after the substitution OLD=NEW is performed. + + A useful alias to use with this is r='fc -s', so that typing `r cc' + runs the last command beginning with `cc' and typing `r' re-executes + the last command. + + Exit Status: + Returns success or status of executed command; non-zero if an error + occurs. + + [fg] Resume job in foreground. + + Equivalent to the JOB_SPEC argument to the `fg' command. Resume a + stopped or background job. JOB_SPEC can specify either a job name + or a job number. Following JOB_SPEC with a `&' places the job in + the background, as if the job specification had been supplied as an + argument to `bg'. + + Exit Status: + Returns the status of the resumed job. + + [bg] Move jobs to the background. + + Place the jobs identified by each JOB_SPEC in the background, as if + they had been started with `&'. If JOB_SPEC is not present, the shell's + notion of the current job is used. + + Exit Status: + Returns success unless job control is not enabled or an error occurs. + + [hash] Remember or display program locations. + + Determine and remember the full pathname of each command NAME. If + no arguments are given, information about remembered commands is + displayed. + + Options: + -d forget the remembered location of each NAME + -l display in a format that may be reused as input + -p pathname use PATHNAME as the full pathname of NAME + -r forget all remembered locations + -t print the remembered location of each NAME, preceding + each location with the corresponding NAME if multiple + NAMEs are given + Arguments: + NAME Each NAME is searched for in $PATH and added to the list + of remembered commands. + + + [help] Display information about builtin commands. + + Displays brief summaries of builtin commands. If PATTERN is + specified, gives detailed help on all commands matching PATTERN, + otherwise the list of help topics is printed. + + Options: + -d output short description for each topic + -m display usage in pseudo-manpage format + -s output only a short usage synopsis for each topic matching + PATTERN + + Arguments: + PATTERN Pattern specifying a help topic + + Exit Status: + Returns success unless PATTERN is not found or an invalid option is + given. + + [history] Display or manipulate the history list. + + Display the history list with line numbers, prefixing each modified + entry with a `*'. An argument of N lists only the last N entries. + + Options: + -c clear the history list by deleting all of the entries + -d offset delete the history entry at position OFFSET. Negative + offsets count back from the end of the history list + + -a append history lines from this session to the history file + -n read all history lines not already read from the history file + and append them to the history list + -r read the history file and append the contents to the history + list + -w write the current history to the history file + + -p perform history expansion on each ARG and display the result + without storing it in the history list + -s append the ARGs to the history list as a single entry + + If FILENAME is given, it is used as the history file. Otherwise, + if HISTFILE has a value, that is used, else ~/.bash_history. + + If the HISTTIMEFORMAT variable is set and not null, its value is used + as a format string for strftime(3) to print the time stamp associated + with each displayed history entry. No time stamps are printed + otherwise. + + Exit Status: + Returns success unless an invalid option is given or an error occurs. + + [jobs] Display status of jobs. + + Lists the active jobs. JOBSPEC restricts output to that job. + Without options, the status of all active jobs is displayed. + + Options: + -l lists process IDs in addition to the normal information + -n lists only processes that have changed status since the last + notification + -p lists process IDs only + -r restrict output to running jobs + -s restrict output to stopped jobs + + If -x is supplied, COMMAND is run after all job specifications that + appear in ARGS have been replaced with the process ID of that job's + process group leader. + + Exit Status: + Returns success unless an invalid option is given or an error occurs. + If -x is used, returns the exit status of COMMAND. + + [disown] Remove jobs from current shell. + + Removes each JOBSPEC argument from the table of active jobs. Without + any JOBSPECs, the shell uses its notion of the current job. + + Options: + -a remove all jobs if JOBSPEC is not supplied + -h mark each JOBSPEC so that SIGHUP is not sent to the job if the + shell receives a SIGHUP + -r remove only running jobs + + Exit Status: + Returns success unless an invalid option or JOBSPEC is given. + + [kill] Send a signal to a job. + + Send the processes identified by PID or JOBSPEC the signal named by + SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then + SIGTERM is assumed. + + Options: + -s sig SIG is a signal name + -n sig SIG is a signal number + -l list the signal names; if arguments follow `-l' they are + assumed to be signal numbers for which names should be listed + -L synonym for -l + + Kill is a shell builtin for two reasons: it allows job IDs to be used + instead of process IDs, and allows processes to be killed if the limit + on processes that you can create is reached. + + Exit Status: + Returns success unless an invalid option is given or an error occurs. + + [let] Evaluate arithmetic expressions. + + Evaluate each ARG as an arithmetic expression. Evaluation is done in + fixed-width integers with no check for overflow, though division by 0 + is trapped and flagged as an error. The following list of operators is + grouped into levels of equal-precedence operators. The levels are + listed in order of decreasing precedence. + + id++, id-- variable post-increment, post-decrement + ++id, --id variable pre-increment, pre-decrement + -, + unary minus, plus + !, ~ logical and bitwise negation + ** exponentiation + *, /, % multiplication, division, remainder + +, - addition, subtraction + <<, >> left and right bitwise shifts + <=, >=, <, > comparison + ==, != equality, inequality + & bitwise AND + ^ bitwise XOR + | bitwise OR + && logical AND + || logical OR + expr ? expr : expr + conditional operator + =, *=, /=, %=, + +=, -=, <<=, >>=, + &=, ^=, |= assignment + + Shell variables are allowed as operands. The name of the variable + is replaced by its value (coerced to a fixed-width integer) within + an expression. The variable need not have its integer attribute + turned on to be used in an expression. + + Operators are evaluated in order of precedence. Sub-expressions in + parentheses are evaluated first and may override the precedence + rules above. + + Exit Status: + If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise. + + [shift] Shift positional parameters. + + Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is + not given, it is assumed to be 1. + + Exit Status: + Returns success unless N is negative or greater than $#. + + [suspend] Suspend shell execution. + + Suspend the execution of this shell until it receives a SIGCONT signal. + Unless forced, login shells cannot be suspended. + + Options: + -f force the suspend, even if the shell is a login shell + + Exit Status: + Returns success unless job control is not enabled or an error occurs. + + [eval] Evaluate conditional expression. + + Exits with a status of 0 (true) or 1 (false) depending on + the evaluation of EXPR. Expressions may be unary or binary. Unary + expressions are often used to examine the status of a file. There + are string operators and numeric comparison operators as well. + + The behavior of test depends on the number of arguments. Read the + bash manual page for the complete specification. + + File operators: + + -a FILE True if file exists. + -b FILE True if file is block special. + -c FILE True if file is character special. + -d FILE True if file is a directory. + -e FILE True if file exists. + -f FILE True if file exists and is a regular file. + -g FILE True if file is set-group-id. + -h FILE True if file is a symbolic link. + -L FILE True if file is a symbolic link. + -k FILE True if file has its `sticky' bit set. + -p FILE True if file is a named pipe. + -r FILE True if file is readable by you. + -s FILE True if file exists and is not empty. + -S FILE True if file is a socket. + -t FD True if FD is opened on a terminal. + -u FILE True if the file is set-user-id. + -w FILE True if the file is writable by you. + -x FILE True if the file is executable by you. + -O FILE True if the file is effectively owned by you. + -G FILE True if the file is effectively owned by your group. + -N FILE True if the file has been modified since it was last + read. + + FILE1 -nt FILE2 True if file1 is newer than file2 (according to + modification date). + + FILE1 -ot FILE2 True if file1 is older than file2. + + FILE1 -ef FILE2 True if file1 is a hard link to file2. + + String operators: + + -z STRING True if string is empty. + + -n STRING + STRING True if string is not empty. + + STRING1 = STRING2 + True if the strings are equal. + STRING1 != STRING2 + True if the strings are not equal. + STRING1 < STRING2 + True if STRING1 sorts before STRING2 + lexicographically. + STRING1 > STRING2 + True if STRING1 sorts after STRING2 lexicographically. + + Other operators: + + -o OPTION True if the shell option OPTION is enabled. + -v VAR True if the shell variable VAR is set. + -R VAR True if the shell variable VAR is set and is a name + reference. + ! EXPR True if expr is false. + EXPR1 -a EXPR2 True if both expr1 AND expr2 are true. + EXPR1 -o EXPR2 True if either expr1 OR expr2 is true. + + arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne, + -lt, -le, -gt, or -ge. + + Arithmetic binary operators return true if ARG1 is equal, not-equal, + less-than, less-than-or-equal, greater-than, or greater-than-or-equal + than ARG2. + + Exit Status: + Returns success if EXPR evaluates to true; fails if EXPR evaluates to + false or an invalid argument is given. + + [times] Display process times. + + Prints the accumulated user and system times for the shell and all of + its child processes. + + Exit Status: + Always succeeds. + + [limit] Modify shell resource limits. + + Provides control over the resources available to the shell and + processes + it creates, on systems that allow such control. + + Options: + -S use the `soft' resource limit + -H use the `hard' resource limit + -a all current limits are reported + -b the socket buffer size + -c the maximum size of core files created + -d the maximum size of a process's data segment + -e the maximum scheduling priority (`nice') + -f the maximum size of files written by the shell and its children + -i the maximum number of pending signals + -k the maximum number of kqueues allocated for this process + -l the maximum size a process may lock into memory + -m the maximum resident set size + -n the maximum number of open file descriptors + -p the pipe buffer size + -q the maximum number of bytes in POSIX message queues + -r the maximum real-time scheduling priority + -s the maximum stack size + -t the maximum amount of cpu time in seconds + -u the maximum number of user processes + -v the size of virtual memory + -x the maximum number of file locks + -P the maximum number of pseudoterminals + -R the maximum time a real-time process can run before blocking + -T the maximum number of threads + + Not all options are available on all platforms. + + If LIMIT is given, it is the new value of the specified resource; the + special LIMIT values `soft', `hard', and `unlimited' stand for the + current soft limit, the current hard limit, and no limit, respectively. + Otherwise, the current value of the specified resource is printed. If + no option is given, then -f is assumed. + + Values are in 1024-byte increments, except for -t, which is in seconds, + -p, which is in increments of 512 bytes, and -u, which is an unscaled + number of processes. + + Exit Status: + Returns success unless an invalid option is supplied or an error occurs. + + [umask] Display or set file mode mask. + + Sets the user file-creation mask to MODE. If MODE is omitted, prints + the current value of the mask. + + If MODE begins with a digit, it is interpreted as an octal number; + otherwise it is a symbolic mode string like that accepted by chmod(1). + + Options: + -p if MODE is omitted, output in a form that may be reused as input + -S makes the output symbolic; otherwise an octal number is output + + Exit Status: + Returns success unless MODE is invalid or an invalid option is given. + + [return] Wait for job completion and return exit status. + + Waits for each process identified by an ID, which may be a process ID or + a job specification, and reports its termination status. If ID is not + given, waits for all currently active child processes, and the return + status is zero. If ID is a job specification, waits for all processes + in that job's pipeline. + + If the -n option is supplied, waits for a single job from the list of + IDs, + or, if no IDs are supplied, for the next job to complete and returns + its + exit status. + + If the -p option is supplied, the process or job identifier of the job + for which the exit status is returned is assigned to the variable VAR + named by the option argument. The variable will be unset initially, + before + any assignment. This is useful only when the -n option is supplied. + + If the -f option is supplied, and job control is enabled, waits for the + specified ID to terminate, instead of waiting for it to change status. + + Exit Status: + Returns the status of the last ID; fails if ID is invalid or an invalid + option is given, or if -n is supplied and the shell has no unwaited-for + children. + + [wait] Wait for process completion and return exit status. + + Waits for each process specified by a PID and reports its termination + status. + If PID is not given, waits for all currently active child processes, + and the return status is zero. PID must be a process ID. + + Exit Status: + Returns the status of the last PID; fails if PID is invalid or an + invalid + option is given. + + [for] Execute commands for each member in a list. + + The `for' loop executes a sequence of commands for each member in a + list of items. If `in WORDS ...;' is not present, then `in \$@\' is + assumed. For each element in WORDS, NAME is set to that element, and + the COMMANDS are executed. + + Exit Status: + Returns the status of the last command executed. + + [select] Select words from a list and execute commands. + + The WORDS are expanded, generating a list of words. The + set of expanded words is printed on the standard error, each + preceded by a number. If `in WORDS' is not present, `in \$@\' + is assumed. The PS3 prompt is then displayed and a line read + from the standard input. If the line consists of the number + corresponding to one of the displayed words, then NAME is set + to that word. If the line is empty, WORDS and the prompt are + redisplayed. If EOF is read, the command completes. Any other + value read causes NAME to be set to null. The line read is saved + in the variable REPLY. COMMANDS are executed after each selection + until a break command is executed. + + Exit Status: + Returns the status of the last command executed. + + [time] Report time consumed by pipeline's execution. + + Execute PIPELINE and print a summary of the real time, user CPU time, + and system CPU time spent executing PIPELINE when it terminates. + + Options: + -p print the timing summary in the portable Posix format + + The value of the TIMEFORMAT variable is used as the output format. + + Exit Status: + The return status is the return status of PIPELINE. + + [case] Execute commands based on pattern matching. + + Selectively execute COMMANDS based upon WORD matching PATTERN. The + `|' is used to separate multiple patterns. + + Exit Status: + Returns the status of the last command executed. + + [if] Execute commands based on conditional. + + The `if COMMANDS' list is executed. If its exit status is zero, then + the + `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list + is + executed in turn, and if its exit status is zero, the corresponding + `then COMMANDS' list is executed and the if command completes. + Otherwise, + the `else COMMANDS' list is executed, if present. The exit status of + the + entire construct is the exit status of the last command executed, or + zero + if no condition tested true. + + Exit Status: + Returns the status of the last command executed. + + [while] Execute commands as long as a test succeeds. + + Expand and execute COMMANDS as long as the final command in the + `while' COMMANDS has an exit status of zero. + + Exit Status: + Returns the status of the last command executed. + + [until] Execute commands as long as a test does not succeed. + + Expand and execute COMMANDS as long as the final command in the + `until' COMMANDS has an exit status which is not zero. + + Exit Status: + Returns the status of the last command executed. + + [coproc] Create a coprocess named NAME. + + Execute COMMAND asynchronously, with the standard output and standard + input of the command connected via a pipe to file descriptors assigned + to indices 0 and 1 of an array variable NAME in the executing shell. + The default NAME is \COPROC\. + + Exit Status: + The coproc command returns an exit status of 0. + + [function] Define shell function. + + Create a shell function named NAME. When invoked as a simple command, + NAME runs COMMANDs in the calling shell's context. When NAME is + invoked, + the arguments are passed to the function as $1...$n, and the function's + name is in $FUNCNAME. + + Exit Status: + Returns success unless NAME is readonly. + + [variables] Common shell variable names and usage. + + BASH_VERSION Version information for this Bash. + CDPATH A colon-separated list of directories to search + for directories given as arguments to `cd'. + GLOBIGNORE A colon-separated list of patterns describing filenames to + be ignored by pathname expansion. + HISTFILE The name of the file where your command history is stored. + HISTFILESIZE The maximum number of lines this file can contain. + HISTSIZE The maximum number of history lines that a running + shell can access. + HOME The complete pathname to your login directory. + HOSTNAME The name of the current host. + HOSTTYPE The type of CPU this version of Bash is running under. + IGNOREEOF Controls the action of the shell on receipt of an EOF + character as the sole input. If set, then the value + of it is the number of EOF characters that can be seen + in a row on an empty line before the shell will exit + (default 10). When unset, EOF signifies the end of input. + MACHTYPE A string describing the current system Bash is running on. + MAILCHECK How often, in seconds, Bash checks for new mail. + MAILPATH A colon-separated list of filenames which Bash checks + for new mail. + OSTYPE The version of Unix this version of Bash is running on. + PATH A colon-separated list of directories to search when + looking for commands. + PROMPT_COMMAND A command to be executed before the printing of each + primary prompt. + PS1 The primary prompt string. + PS2 The secondary prompt string. + PWD The full pathname of the current directory. + SHELLOPTS A colon-separated list of enabled shell options. + TERM The name of the current terminal type. + TIMEFORMAT The output format for timing statistics displayed by the + `time' reserved word. + auto_resume Non-null means a command word appearing on a line by + itself is first looked for in the list of currently + stopped jobs. If found there, that job is foregrounded. + A value of `exact' means that the command word must + exactly match a command in the list of stopped jobs. A + value of `substring' means that the command word must + match a substring of the job. Any other value means that + the command must be a prefix of a stopped job. + histchars Characters controlling history expansion and quick + substitution. The first character is the history + substitution character, usually `!'. The second is + the `quick substitution' character, usually `^'. The + third is the `history comment' character, usually `#'. + HISTIGNORE A colon-separated list of patterns used to decide which + commands should be saved on the history list. + + [pushd] Add directories to stack. + + Adds a directory to the top of the directory stack, or rotates + the stack, making the new top of the stack the current working + directory. With no arguments, exchanges the top two directories. + + Options: + -n Suppresses the normal change of directory when adding + directories to the stack, so only the stack is manipulated. + + Arguments: + +N Rotates the stack so that the Nth directory (counting + from the left of the list shown by `dirs', starting with + zero) is at the top. + + -N Rotates the stack so that the Nth directory (counting + from the right of the list shown by `dirs', starting with + zero) is at the top. + + dir Adds DIR to the directory stack at the top, making it the + new current working directory. + + The `dirs' builtin displays the directory stack. + + Exit Status: + Returns success unless an invalid argument is supplied or the directory + change fails. + + [popd] Removes entries from the directory stack. With no arguments, removes + the top directory from the stack, and changes to the new top directory. + + Options: + -n Suppresses the normal change of directory when removing + directories from the stack, so only the stack is manipulated. + + Arguments: + +N Removes the Nth entry counting from the left of the list + shown by `dirs', starting with zero. For example: `popd +0' + removes the first directory, `popd +1' the second. + + -N Removes the Nth entry counting from the right of the list + shown by `dirs', starting with zero. For example: `popd -0' + removes the last directory, `popd -1' the next to last. + + The `dirs' builtin displays the directory stack. + the stack, making the new top of the stack the current working + directory. With no arguments, exchanges the top two directories. + + [dirs] Display the list of currently remembered directories. Directories + find their way onto the list with the `pushd' command; you can get + back up through the list with the `popd' command. + + Options: + -c clear the directory stack by deleting all of the elements + -l do not print tilde-prefixed versions of directories relative + to your home directory + -p print the directory stack with one entry per line + -v print the directory stack with one entry per line prefixed + with its position in the stack + + Arguments: + +N Displays the Nth entry counting from the left of the list shown + by dirs when invoked without options, starting with zero. + + -N Displays the Nth entry counting from the right of the list shown + by dirs when invoked without options, starting with zero. + + + [printf] Formats and prints ARGUMENTS under control of the FORMAT. + + Options: + -v var assign the output to shell variable VAR rather than + display it on the standard output + + FORMAT is a character string which contains three types of objects: + plain + characters, which are simply copied to standard output; character + escape + sequences, which are converted and copied to the standard output; and + format specifications, each of which causes printing of the next + successive + argument. + + In addition to the standard format specifications described in + printf(1), + printf interprets: + + %b expand backslash escape sequences in the corresponding argument + %q quote the argument in a way that can be reused as shell input + %(fmt)T output the date-time string resulting from using FMT as a + format + string for strftime(3) + + The format is re-used as necessary to consume all of the arguments. If + there are fewer arguments than the format requires, extra format + specifications behave as if a zero value or null string, as + appropriate, + had been supplied. + + Exit Status: + Returns success unless an invalid option is given or a write or + assignment + error occurs. + + [complete] Specify how arguments are to be completed by Readline. + + For each NAME, specify how arguments are to be completed. If no + options are supplied, existing completion specifications are printed + in a way that allows them to be reused as input. + + Options: + -p print existing completion specifications in a reusable format + -r remove a completion specification for each NAME, or, if no + NAMEs are supplied, all completion specifications + -D apply the completions and actions as the default for commands + without any specific completion defined + -E apply the completions and actions to \empty\ commands -- + completion attempted on a blank line + -I apply the completions and actions to the initial (usually the + command) word + + When completion is attempted, the actions are applied in the order the + uppercase-letter options are listed above. If multiple options are + supplied, + the -D option takes precedence over -E, and both take precedence over - + I. + + Exit Status: + Returns success unless an invalid option is supplied or an error occurs. + + [compgen] Display possible completions depending on the options. + + Intended to be used from within a shell function generating possible + completions. If the optional WORD argument is supplied, matches + against WORD are generated. + + Exit Status: + Returns success unless an invalid option is supplied or an error occurs. + + [compopt] Modify or display completion options. + + Modify the completion options for each NAME, or, if no NAMEs are + supplied, + the completion currently being executed. If no OPTIONs are given, + print the completion options for each NAME or the current completion + specification. + + Options: + -o option Set completion option OPTION for each NAME + -D Change options for the \default\ command completion + -E Change options for the \empty\ command completion + -I Change options for completion on the initial word + + Using `+o' instead of `-o' turns off the specified option. + + Arguments: + + Each NAME refers to a command for which a completion specification must + have previously been defined using the `complete' builtin. If no NAMEs + are supplied, compopt must be called by a function currently generating + completions, and the options for that currently-executing completion + generator are modified. + + Exit Status: + Returns success unless an invalid option is supplied or NAME does not + have a completion specification defined. + + [mapfile] Read lines from the standard input into an indexed array variable. + + Read lines from the standard input into the indexed array variable + ARRAY, or from file descriptor FD if the -u option is supplied. The variable + MAPFILE is the default ARRAY. + + Options: + -d delim Use DELIM to terminate lines, instead of newline + -n count Copy at most COUNT lines. If COUNT is 0, all lines are + copied + -O origin Begin assigning to ARRAY at index ORIGIN. The default + index is 0 + -s count Discard the first COUNT lines read + -t Remove a trailing DELIM from each line read (default newline) + -u fd Read lines from file descriptor FD instead of the standard + input + -C callback Evaluate CALLBACK each time QUANTUM lines are read + -c quantum Specify the number of lines read between each call to + CALLBACK + + Arguments: + ARRAY Array variable name to use for file data + + If -C is supplied without -c, the default quantum is 5000. When + CALLBACK is evaluated, it is supplied the index of the next array + element to be assigned and the line to be assigned to that element + as additional arguments. + + If not supplied with an explicit origin, mapfile will clear ARRAY + before assigning to it. + + Exit Status: + Returns success unless an invalid option is given or ARRAY is readonly + or not an indexed array. + + [readarray] Read lines from a file into an array variable. + + A synonym for `mapfile'. + + [unset] Unset values and attributes of shell variables and functions. + + For each NAME, remove the corresponding variable or function. + + Options: + -f treat each NAME as a shell function + -v treat each NAME as a shell variable + -n treat each NAME as a name reference and unset the variable itself + rather than the variable it references + + Without options, unset first tries to unset a variable, and if that + fails, + tries to unset a function. + + Some variables cannot be unset; also see `readonly'. + + Exit Status: + Returns success unless an invalid option is given or a NAME is read-only. + + [local] Remember or display program locations. + + Determine and remember the full pathname of each command NAME. If + no arguments are given, information about remembered commands is + displayed. + + Options: + -d forget the remembered location of each NAME + -l display in a format that may be reused as input + -p pathname use PATHNAME as the full pathname of NAME + -r forget all remembered locations + -t print the remembered location of each NAME, preceding + each location with the corresponding NAME if multiple + NAMEs are given + Arguments: + NAME Each NAME is searched for in $PATH and added to the list + of remembered commands. + + Exit Status: + Returns success unless NAME is not found or an invalid option is given. + + [export] Set export attribute for shell variables. + + Marks each NAME for automatic export to the environment of subsequently + executed commands. If VALUE is supplied, assign VALUE before + exporting. + + Options: + -f refer to shell functions + -n remove the export property from each NAME + -p display a list of all exported variables and functions + + An argument of `--' disables further option processing. + + Exit Status: + Returns success unless an invalid option is given or NAME is invalid. + + [readonly] Mark shell variables as unchangeable. + + Mark each NAME as read-only; the values of these NAMEs may not be + changed by subsequent assignment. If VALUE is supplied, assign VALUE + before marking as read-only. + + Options: + -a refer to indexed array variables + -A refer to associative array variables + -f refer to shell functions + -p display a list of all readonly variables or functions, + depending on whether or not the -f option is given + + An argument of `--' disables further option processing. + + Exit Status: + Returns success unless an invalid option is given or NAME is invalid. + + *[other] show other command help info. + } diff --git a/bash-5.1/resources/zh-CN/message.ftl b/bash-5.1/resources/zh-CN/message.ftl new file mode 100644 index 0000000000000000000000000000000000000000..a60254cd8077ab529c7d39ce658de908477a90c8 --- /dev/null +++ b/bash-5.1/resources/zh-CN/message.ftl @@ -0,0 +1,1185 @@ +helplongdoc ={ +$cmdName -> +[set] + 设定或取消设定 shell 选项和位置参数的 + + 改变 shell 选项和位置参数的值,或者显示 shell 变量的 + 名称和值。 + + 选项: + -a 标记修改的或者创建的变量为导出。 + -b 立即通告任务终结。 + -e 如果一个命令以非零状态退出,则立即退出。 + -f 禁用文件名生成(模式匹配)。 + -h 当查询命令时记住它们的位置 + -k 所有的赋值参数被放在命令的环境中,而不仅仅是 + 命令名称之前的参数。 + -m 启用任务控制。 + -n 读取命令但不执行 + -o 选项名 + 设定与选项名对应的变量: + allexport 与 -a 相同 + braceexpand 与 -B 相同 + emacs 使用 emacs 风格的行编辑界面 + errexit 与 -e 相同 + errtrace 与 -E 相同 + functrace 与 -T 相同 + hashall 与 -h 相同 + histexpand 与 -H 相同 + history 启用命令历史 + ignoreeof shell 读取文件结束符时不会退出 + interactive-comments + 允许在交互式命令中显示注释 + keyword 与 -k 相同 + monitor 与 -m 相同 + noclobber 与 -C 相同 + noexec 与 -n 相同 + noglob 与 -f 相同 + nolog 目前可接受但是被忽略 + notify 与 -b 相同 + nounset 与 -u 相同 + onecmd 与 -t 相同 + physical 与 -P 相同 + pipefail 管道的返回值是最后一个非零返回值的命令的返回结果, + 或者当所有命令都返回零是也为零。 + posix 改变默认时和 Posix 标准不同的 bash 行为 + 以匹配标准 + privileged 与 -p 相同 + verbose 与 -v 相同 + vi 使用 vi 风格的行编辑界面 + xtrace 与 -x 相同 + -p 无论何时当真实的有效的用户身份不匹配时打开。 + 禁用对 $ENV 文件的处理以及导入 shell 函数。 + 关闭此选项会导致有效的用户编号和组编号设定 + 为真实的用户编号和组编号 + -t 读取并执行一个命令之后退出。 + -u 替换时将为设定的变量当作错误对待。 + -v 读取 shell 输入行时将它们打印。 + -x 执行命令时打印它们以及参数。 + -B shell 将执行花括号扩展。 + -C 设定之后禁止以重定向输出的方式覆盖常 + 规文件。 + -E 设定之后 ERR 陷阱会被 shell 函数继承。 + -H 启用 ! 风格的历史替换。当 shell 是交互式的 + 时候这个标识位默认打开。 + -P 设定之后类似 cd 的会改变当前目录的命令不 + 追踪符号链接。 + -T 设定之后 DEBUG 陷阱会被 shell 函数继承。 + -- 任何剩余的参数会被赋值给位置参数。如果没 + 有剩余的参数,位置参数不会被设置。 + - 任何剩余的参数会被赋值给位置参数。 + -x 和 -v 选项已关闭。 + + 使用 + 而不是 - 会使标志位被关闭。标志位也可以在 + shell 被启动时使用。当前的标志位设定可以在 $- 变 + 量中找到。剩余的 ARG 参数是位置参数并且是按照 + $1, $2, .. $n 的顺序被赋值的。如果没有给定 ARG + 参数,则打印所有的 shell 变量。 + + 退出状态: + 返回成功除非使用了无效的参数。 + [read] 从标准输入读取一行并将其分为不同的域。 + + 从标准输入读取单独的一行,或者如果使用了 -u 选项,从文件描述符 FD 中读 + 取。 + 该行被分割成域,如同词语分割一样,并且第一个词被赋值给第一个 NAME 变量, + 第二 + 个词被赋值给第二个 NAME 变量,如此继续,直到剩下所有的词被赋值给最后一个 + NAME + 变量。只有 $IFS 变量中的字符被认作是词语分隔符。 + + 如果没有提供 NAME 变量,则读取的行被存放在 REPLY 变量中。 + + 选项: + -a array\t将词语赋值给 ARRAY 数组变量的序列下标成员,从零开始 + -d delim\t持续读取直到读入 DELIM 变量中的第一个字符,而不是换行符 + -e\t使用 Readline 获取行 + -i text\t使用 TEXT 文本作为 Readline 的初始文字 + -n nchars\t读取 nchars 个字符之后返回,而不是等到读取换行符。 + \t\t但是分隔符仍然有效,如果遇到分隔符之前读取了不足 nchars 个字符。 + -N nchars\t在准确读取了 nchars 个字符之后返回,除非遇到文件结束符或者读 + 超时, + \t\t任何的分隔符都被忽略 + -p prompt\t在尝试读取之前输出 PROMPT 提示符并且不带 + \t\t换行符 + -r\t不允许反斜杠转义任何字符 + -s\t不回显终端的任何输入 + -t timeout\t如果在 TIMEOUT 秒内没有读取一个完整的行则超时并且返回失 + 败。 + \t\tTMOUT 变量的值是默认的超时时间。TIMEOUT 可以是小数。 + \t\t如果 TIMEOUT 是 0,那么仅当在指定的文件描述符上输入有效的时候, + \t\tread 才返回成功;否则它将立刻返回而不尝试读取任何数据。 + \t\t如果超过了超时时间,则返回状态码大于 128 + -u fd\t从文件描述符 FD 中读取,而不是标准输入 + + 退出状态: + 返回码为零,除非遇到了文件结束符、读超时(且返回码不大于128)、 + 出现了变量赋值错误或者无效的文件描述符作为参数传递给了 -u 选项。 + + [type] 显示命令类型的信息。 + + 对于每一个 NAME 名称,指示如果作为命令它将如何被解释。 + + 选项: + -a\t显示所有包含名称为 NAME 的可执行文件的位置; + \t\t包括别名、内建和函数。仅当 `-p' 选项没有使用时 + -f\t抑制 shell 函数查询 + -P\t为每个 NAME 名称惊醒 PATH 路径搜索,即使它是别名、 + \t\t内建或函数,并且返回将被执行的磁盘上文件的名称。 + -p\t返回将被执行的磁盘上文件的名称,或者当 `type -t NAME' + \t不返回 `file' 时,不返回任何值。 + -t\t返回下列词中的任何一个 `alias'、`keyword'、 + \t`function'、`builtin'、`file' 或者 `',相应地如果 NAME 是 + \t一个别名、shell 保留字、shell 函数、shell 内建、 + \t磁盘文件或没有找到。 + + 参数: + NAME\t将要解析的命令。 + + 退出状态: + 返回成功,除非使用了无效的选项或者 NAME 名称为只读。 + + [trap] 对信号和其他事件设陷阱。 + + 定义一个处理器,在 shell 接收到信号和其他条件下执行。 + + ARG 参数是当 shell 接收到 SIGNAL_SPEC 信号时读取和执行的命令。 + 如果没有指定 ARG 参数 (并且只给出一个 SIGNAL_SPEC 信号) 或者 + ARG 参数为 + `-',每一个指定的参数会被重置为原始值。如果 ARG 参数是一个空串,则每一 + 个 + SIGNAL_SPEC 信号会被 shell 和它启动的命令忽略。 + + 如果一个 SIGNAL_SPEC 信号是 EXIT (0) ,则 ARG 命令会在 shell 退出时被 + 执行。如果一个 SIGNAL_SPEC 信号是 DEBUG,则 ARG命令会在每一个简单命 + 令之前执行。 + + 如果不提供参数,trap 打印列表显示每一个与每一个信号相关联的命令。 + + 选项: + -l\t打印一个信号名称和它们对应的编号的列表 + -p\t打印与每个 SIGNAL_SPEC 信号相关联的陷阱命令 + + 每一个 SIGNAL_SPEC 信号可以是 中的信号名称或者信号编号。 + 信号名称大小写敏感且可以使用 SIG 前缀。信号可用 \kill -信号 $$\ + 发送给 shell。 + + 返回成功,除非使用了无效的选项或者 SIGSPEC。 + + [alias] 定义或显示别名。 + + 不带参数时,`alias' 以可重用的格式 + `alias 名称=值'在标准输出设备上打印别名列表。 + + 否则,对于每个给定值的名称定义一个别名。 + 值末尾的空格会使下一个词被检测作为别名替换展开。 + + 选项: + -p\t以可重用的格式打印所有的已定义的别名 + + 退出状态: + 除非一个没有定义的名字被作为参数提供,否则 alias + 返回值为真。 + + [unalias] 从别名定义列表中删除每一个“名字”。 + + 选项: + -a\t删除所有的别名定义 + + 返回成功,除非“名字”不是一个已存在的别名。 + + [break] 退出 for、while 或 until 循环 + + 退出一个 FOR、WHILE 或 UNTIL 循环。如果指定了N,则跳出N重 + 循环 + + 退出状态: + 退出状态为0除非 N 不大于或等于 1。 + + [continue] 继续 for、while 或 until 循环。 + + 继续当前 FOR、WHILE 或 UNTIL 循环的下一步。 + 如果指定了 N, 则继续当前的第 N 重循环。 + + 退出状态: + 退出状态为 0 除非 N 不大于或等于1。 + + [builtin] 执行 shell 内建。 + + 带参数 ARGs 执行 SHELL-BUILTIN 内建,并且不做命令查询 + 在希望以 shell 函数的形式来重新实现 shell 内建, + 并且希望在函数之内执行该 shell 内建的情况下有用处。 + + 退出状态: + 以 SHELL-BUILTIN 内建的退出状态为准,或者如果 SHELL-BUILTIN 不是一个 + shell 内建时为假。 + + [caller] 返回当前子调用的上下文。 + + 不带有 EXPR 时,返回 \$line $filename\。带有 EXPR 时,返回 + \$line $subroutine $filename\;这个额外的信息可以被用于提供 + 栈追踪。 + + EXPR 的值 显示了到当前调用帧需要回去多少个调用帧;顶部帧 + 是第 0 帧。 + + 退出状态: + 除非 shell 不在执行一个 shell 函数或者 EXPR 无效,否则返回结 + 果为0。 + + [cd]改变 shell 工作目录。 + + 改变当前目录至 DIR 目录。默认的 DIR 目录是 shell 变量 HOME + 的值。 + + 变量 CDPATH 定义了含有 DIR 的目录的搜索路径,其中不同的目录名称由冒号 (:) + 分隔。 + 一个空的目录名称表示当前目录。如果要切换到的 DIR 由斜杠 (/) 开头,则 + CDPATH + 不会用上变量。 + + 如果路径找不到,并且 shell 选项 `cdable_vars' 被设定,则参数词被假定为一 + 个 + 变量名。如果该变量有值,则它的值被当作 DIR 目录。 + + 选项: + -L\t强制跟随符号链接: 在处理 `..' 之后解析 DIR 中的符号链接。 + -P\t使用物理目录结构而不跟随符号链接: 在处理 `..' 之前解析 DIR 中的符 + 号链接。 + -e\t如果使用了 -P 参数,但不能成功确定当前工作目录时,返回非零的返回 + 值。 + -@\t在支持拓展属性的系统上,将一个有这些属性的文件当作有文件属性的目 + 录。 + + 默认情况下跟随符号链接,如同指定 `-L'。 + `..' 使用移除向前相邻目录名成员直到 DIR 开始或一个斜杠的方式处理。 + + 退出状态: + 如果目录改变,或在使用 -P 选项时 $PWD 修改成功时返回 0,否则非零。 + + [pwd]打印当前工作目录的名字。 + + 选项: + -L\t打印 $PWD 变量的值,如果它包含了当前的工作目录 + -P\t打印当前的物理路径,不带有任何的符号链接 + + 默认情况下,`pwd' 的行为和带 `-L' 选项一致 + + 退出状态: + 除非使用了无效选项或者当前目录不可读,否则返回状态为0。 + + [true]空的命令。 + + 没有效果; 此命令不做任何操作。 + + 退出状态: + 总是成功。 + [shopt] 设定和取消设定 shell 选项。 + + 改变每个 shell 选项 OPTNAME 的设定。不带参数时, + 列出每个提供的 OPTNAME,否则列出所有 shell 选项; + 同时标注每一个选项是否被设定。 + + 选项: + -o\t限制 OPTNAME 为定义用于`set -o' 的选项 + -p\t打印每个 shell 选项并标注它的状态。 + -q\t抑制输出 + -s\t启用(设定)每个 OPTNAME 选项 + -u\t禁用(取消设定)每个 OPTNAME 选项 + + 退出状态: + 如果 OPTNAME 选项被启用则返回成功;如果是 + 无效的选项或 OPTNAME 被禁用则失败。 + [false] 返回一个不成功的结果。 + + 退出状态: + 总是失败。 + + [command] 执行一个简单命令或者显示命令的相关信息。 + + 带 ARGS 参数运行 COMMAND 命令且抑制 shell 函数查询,或显示 + 指定的 COMMAND 命令的信息。可以在存在相同名称的函数定义的 + 情况下用于启动磁盘上的命令。 + + 选项: + -p\t使用 PATH 变量的一个默认值以确保所有的标准工具都能被找到。 + -v\t打印 COMMAND 命令的描述,和 `type' 内建相似 + -V\t打印每个 COMMAND 命令的详细描述 + + 退出状态 + 返回 COMMAND 命令的返回状态,或者当找不到 COMMAND 命令时失败。 + + [echo] 将参数写到标准输出。 + + 在标准输出上,显示用空格分割的 ARG 参数后跟一个换行。 + + 选项: + -n\t不要追加换行 + -e\t启用下列反斜杠转义的解释 + -E\t显式地抑制对于反斜杠转义的解释 + + `echo' 对下列反斜杠字符进行转义: + \a\t警告(响铃) + \\b\t退格 + \\c\t抑制更多的输出 + \\e\t转义字符 + \\f\t换页字符 + \\t换行 + \\r\t回车 + \\t\t横向制表符 + \\v\t纵向制表符 + \\\\\t反斜杠 + \\0nnn\t以 NNN(八进制)为 ASCII 码的字符。NNN 可以是 0 到 3 个八进制 + 位 + \\xHH\t以 HH(十六进制)为值的八比特字符。HH 可以是一个或两个十六进制 + 位 + \\uHHHH\t以 HHHH(十六进制)为值的 Unicode 字符。HHHH 可以是一个到 + \t\t四个十六进制位。 + \\UHHHHHHHH 以 HHHHHHHH(十六进制)为值的 Unicode 字符。 + \t\tHHHHHHHH 可以是一到八个十六进制位。 + + 退出状态: + 返回成功除非有写错误发生。 + + 写参数至标准输出设备。 + + 在标准输出设备上显示 ARGs 参数和一个换行。 + + 选项: + -n\t不附加换行 + + 退出状态: + 除非写错误发生,否则返回成功。 + + [enable] 启用和禁用 shell 内建。 + + 启用和禁用 shell 的内建命令。禁用使您能够执行一个和内建 + 命令同名的磁盘上的命令,而无须使用完整的路径名。 + + + 选项: + -a\t打印一个内建的列表,并显示其中每一个是否启用 + -n\t禁用每一个 NAME 内建或者显示一个被禁用的内建的列表 + -p\t以可重用的格式打印一个内建的列表 + -s\t仅打印Posix `special' 内建的名称 + + 控制动态加载的选项: + -f\t从共享对象 FILENAME 文件中加载 NAME 内建 + -d\t删除以 -f 选项加载的内建 + + 不带选项时,每一个 NAME 内建都被启用。 + + 如果要使用 $PATH 中找到的 `test' 而不是 shell 内建的版本, + 输入 `enable -n test'。 + + 退出状态: + 返回成功,除非 NAME 不是一个 shell 内建或者有错误发生。 + + [getopts] 解析选项参数。 + + getopts 被 shell 过程用于解析可定位的参数作为选项。 + + + OPTSTRING 字符串包含待识别的选项字母;如果一个字母后面跟 + 着分号,则该选项需要一个参数,而该参数应用空格与选项分开。 + + + 每次启动时,getopts 会将下一个选项放到 shell 变量 $name + 中,如果 name 变量不存在则先将其初始化,而下一个待处 + 理的参数序号放入 shell 变量 OPTIND 中。OPTIND 变量在每 + 次 shell 或者 shell 脚本启动时都被初始化为1。当一个选项要 + 求有一个参数时,getopts 将参数放入 shell 变量 OPTARG + 中。 + + getopts 有两种报告错误的方法。如果 OPTSTRING 变量的第 + 一个字符是冒号,getopts 使用沉默错误报告。在这种模式 + 下,不会打印错误消息。如果看到了一个无效的选项, + getopts 将找到的选项字符放至 OPTARG 变量中。如果一个必 + 须的选项没有找到,getopts 放一个 ':' 到 NAME 变量中并且设 + 置 OPTARG 变量为找到的选项字符。如果 getopts 不在沉默模 + 式中,并且遇到了一个无效的选项,getopts 放置一个 '?' 到 NAME + 变量中并且取消设定 OPTARG变量。如果必须的选项没有找到, + 一个'?'会被放入 NAME变量中,OPTARG 将被取消设定,并且会 + 打印一个诊断信息。 + + 如果 shell 变量 OPTERR 的值为0,getopts 禁用 + 错误信息的打印,即使 OPTSTRING 变量的第一个字符不是一 + 个冒号。OPTERR 的默认值为1. + + getopts 通常解析可定位的参数($0 - $9),不过如果提供了 + 更多的参数,它们反而会被解析。 + + 退出状态: + 如果一个选项被找到则返回成功;如果遇到了选项的结尾或者 + 有错误发生则返回失败。 + + [exec] 使用指定命令替换 shell。 + + 执行 COMMAND 命令,以指定的程序替换这个 shell。 + ARGUMENTS 参数成为 COMMAND命令的参数。如果 + 没有指定COMMAND 命令,则任何的重定向在当前 shell 中生效。 + + 选项: + -a 名称\t作为第0个参数传递给 COMMAND 命令 + -c\t\t在一个空环境中执行 COMMAND 命令 + -l\t\t在COMMAND 命令的第0个参数中加一个短线 + + 如果命令不能被执行,则退出一个非交互式的 shell,除非 + shell 选项`execfail' 已经设定。 + + 退出状态: + 返回成功除非 COMMAND 命令没有找到或者出现一个重定向错误。 + + [exit] 退出shell。 + + 以状态 N 退出 shell。 如果 N 被省略,则退出状态 + 为最后一个执行的命令的退出状态。 + + [logout] 退出一个登录 shell. + + 以状态 N 退出一个登录 shell。如果不在登录 shell 中执行,则 + 返回一个错误。 + + [fc] 从历史列表中显示或者执行命令。 + + fc 被用于从历史列表中列出或者重新编辑并执行命令。 + FIRST 和 LAST 变量可以是数字用于指定范围,或者 FIRST 可以是 + 字符串,意味着以这个字符串打头的最近的一个命令。 + + + 选项: + -e ENAME\t选择使用哪个编辑器。默认的是 FCEDIT, 然后是 EDITOR, + \t\t然后是 vi + -l \t列出行而不编辑 + -n\t列举时省略行号 + -r\t反转行的顺序(最新行在前) + + 用 `fc -s [模式=替换 ...] [命令]' 的格式,COMMAND 命令会在 OLD=NEW + 替换之后被重新执行。 + + r='fc -s' 是一个有用的别名,这样的话输入 `r cc'会执行最后一个以 `cc' + 开头的命令,输入 `r'会重新执行最后一个命令。 + + + 退出状态: + 返回成功,或者执行的命令的状态;如果错误发生则返回非零。 + + [fg] 将任务移至前台。 + + 将以 JOB_SPEC 标识的任务放至前台,使其成为 + 当前任务。如果 JOB_SPEC 不存在,shell 观念中的当前任务 + 将被使用。 + + 退出状态: + 放至前台的命令状态,或者当错误发生时为失败。 + + [bg] 移动任务至后台。 + + 将 JOB_SPEC 标识的任务放至后台,就像它们 + 是带 `&' 启动的一样。如果 JOB_SPEC 不存在,shell 观念中的 + 当前任务将会被使用。 + + 退出状态: + 返回成功除非任务管理没有启用或者错误发生。 + + [hash] 记住或显示程序位置。 + + 确定并记住每一个给定 NAME 名称的命令的完整路径。 + 如果不提供参数,则显示已经记住的命令的信息。 + + 选项: + -d\t\t忘记每一个已经记住的 NAME 的位置 + -l\t\t以可作为输入重用的格式显示 + -p pathname\t使用 pathname 路径作为 NAME 命令的全路径 + -r\t\t忘记所有记住的位置 + -t\t\t打印记住的每一个 NAME 名称的位置,如果指定了多个 + \t\tNAME 名称,则每个位置前面会加上相应的 NAME 名称 + \t\t + 参数: + NAME\t\t每个 NAME 名称会在 $PATH 路径变量中被搜索,并且添加到记住的命 + 令 + 列表中。 + + 退出状态: + 返回成功,除非 NAME 命令没有找到或者使用了无效的选项。 + + [help] 显示内建命令的相关信息。 + + 显示内建命令的简略信息。如果指定了 PATTERN 模式, + 给出所有匹配 PATTERN 模式的命令的详细帮助,否则打 + 印一个帮助主题列表 + + 选项: + -d\t输出每个主题的简短描述 + -m\t以伪 man 手册的格式显示使用方法 + -s\t为每一个匹配 PATTERN 模式的主题仅显示一个用法 + \t简介 + + 参数: + PATTERN\t指定帮助主题的模式 + + 退出状态: + 返回成功,除非未找到 PATTERN 模式没有找到或者使用了无效选项。 + + [history] 显示或操纵历史列表。 + + 带行号显示历史列表,将每个被修改的条目加上 `*' 前缀。 + 参数 N 会仅列出最后的 N 个条目。 + + 选项: + -c\t删除所有条目从而清空历史列表。 + -d 偏移量\t从指定位置删除历史列表。负偏移量将从历史条目末尾 + \t\t开始计数 + + -a\t将当前会话的历史行追加到历史文件中 + -n\t从历史文件中读取所有未被读取的行 + \t\t并且将它们附加到历史列表 + -r\t读取历史文件并将内容追加到历史列表中 + -w\t将当前历史写入到历史文件中 + + -p\t对每一个 ARG 参数展开历史并显示结果,而不存储到历史列表中 + -s\t以单条记录追加 ARG 到历史列表中 + + 如果给定了 FILENAME 文件名,则它将被作为历史文件。否则 + 如果 $HISTFILE 变量有值的话使用之,不然使用 ~/.bash_history 文件。 + + 如果 $HISTTIMEFORMAT 变量被设定并且不为空,它的值会被用于 + strftime(3) 的格式字符串来打印与每一个显示的历史条目想关联的 + 时间戳,否则不打印时间戳。 + + 退出状态: + 返回成功,除非使用了无效的选项或者发生错误。 + [jobs] 显示任务状态。 + + 列出活动的任务。JOBSPEC 限制仅输出指定的任务。 + 不带选项时,所有活动任务的状态都会显示。 + + 选项: + -l\t在正常信息基础上列出进程号 + -n\t仅列出上次通告之后改变了状态的进程 + -p\t仅列出进程号 + -r\t限制仅输出运行中的任务 + -s\t限制仅输出停止的任务 + + 如果使用了 -x 选项,ARG 参数中的所有任务声明会被替换为该任务 + 的进程组头领的进程号,然后执行 COMMAND 命令。 + + 退出状态: + 返回成功,除非使用了无效的选项或者有错误发生。 + 如果使用 -x 选项,则返回 COMMAND 命令的退出状态。 + + [disown] 从当前 shell 中删除任务。 + + 从活动任务表中删除每一个 JOBSPEC 参数。不带任何 + JOBSPEC 参数时,shell 使用观念中的当前任务。 + + 选项: + -a\t如果不提供 JOBSPEC 参数,则删除所有任务 + -h\t标识每个 JOBSPEC 任务,从而当 shell 接收到 SIGHUP + \t\t信号时不发送 SIGHUP 给指定任务 + -r\t仅删除运行中的任务 + + 退出状态: + 返回成功除非使用了无效的选项或者 JOBSPEC 声明。 + + [kill] 向一个任务发送一个信号。 + + 向以 PID 进程号或者 JOBSPEC 任务声明指定的进程发送一个以 + SIGSPEC 信号声明或 SIGNUM 信号编号命名的信号。如果没有指定 + SIGSPEC 或 SIGNUM,那么假定发送 SIGTERM 信号。 + + 选项: + -s sig\tSIG 是信号名称 + -n sig\tSIG 是信号编号 + -l\t列出信号名称;如果参数后跟 `-l'则被假设为信号编号, + \t\t而相应的信号名称会被列出 + + Kill 成为 shell 内建有两个理由:它允许使用任务编号而不是进程号, + 并且在可以创建的进程数上限达到是允许进程被杀死。 + + 退出状态: + 返回成功,除非使用了无效的选项或者有错误发生。 + [let] 估值算术表达式。 + + 将每个 ARG 参赛作为算术表达式来估值。估值的计算以定宽的整 + 数完成,不带溢出检测,不过除 0 是被置陷阱的并且会报一个错 + 误。下列操作符被按照相同的算术优先级组合。列表的顺序按照 + 优先级从高至低。 + + + \tid++, id--\t变量后置加,后置减 + \t++id, --id\t变量前置加,前置减 + \t-, +\t\t一元减法,一元加法 + \t!, ~\t\t逻辑和位取反 + \t**\t\t指数 + \t*, /, %\t\t乘法,除法,取余数 + \t+, -\t\t增加,减少 + \t<<, >>\t\t向左和向右按位移位 + \t<=, >=, <, >\t比较 + \t==, !=\t\t等于,不等于 + \t&\t\t按位与 + \t^\t\t按位异或 + \t|\t\t按位或 + \t&&\t\t逻辑与 + \t||\t\t逻辑或 + \texpr ? expr : expr + \t\t\t条件操作符 + \t=, *=, /=, %=, + \t+=, -=, <<=, >>=, + \t&=, ^=, |=\t赋值 + + Shell 变量允许作为操作数。表达式中的变量的名称会被取代以值 + (强制转换为定宽的整数)。表达式中的变量不需要打开整数属性。 + + 操作符按照优先级进行估值。括号中的子表达式将被先估值,并可取代上述表达式 + 规则。 + + [shift] 移位位置参数。 + + 重命名位置参数 $N+1、$N+2 ... 到 $1、$2 ... 如果没有给定 N, + 则假设为1. + + 退出状态: + 返回成功,除非 N 为负或者大于 $#。 + 返回 N,或者如果 shell 不在执行一个函数或引用脚本时,失败。 + + [suspend] 挂起 shell 执行。 + + 挂起 shell 的执行直到收到 SIGCONT 信号。 + 登录 shell 不可以被挂起,除非强制执行。 + + 选项: + -f\t强制挂起,即使是登录 shell。 + + 退出状态: + 返回成功,除非没有启用任务控制或者有错误发生。 + + [eval] 对条件表达式进行估值。 + + 根据 EXPR 表达式的估值以状态 0 (真) 或 1 (伪) 退出。 + 表达式可以是一元或者二元的。一元表达式通常用于检测 + 文件状态。同时还有字符串操作符和数字比较操作符。 + + 文件操作符: + + -a 文件 如果文件存在则为真。 + -b 文件 如果文件为块特殊文件则为真。 + -c 文件 如果文件为字符特殊文件则为真。 + -d 文件 如果文件为目录则为真。 + -e 文件 如果文件存在则为真。 + -f 文件 如果文件存在且为常规文件则为真。 + -g 文件 如果文件的组属性设置打开则为真。 + -h 文件 如果文件为符号链接则为真。 + -L 文件 如果文件为符号链接则为真。 + -k 文件 如果文件的粘滞 (sticky) 位设定则为真。 + -p 文件 如果文件为命名管道则为真。 + -r 文件 如果文件对于您是可读的则为真。 + -s 文件 如果文件存在且不为空则为真。 + -S 文件 如果文件是套接字则为真。 + -t 文件描述符 如果文件描述符在一个终端上打开则为真。 + -u 文件 如果文件的用户数行设置打开则为真。 + -w 文件 如果文件对您是可写的则为真 + -x 文件 如果文件对您是可执行的则为真。 + -O 文件 如果文件是被您所有的则为真。 + -G 文件 如果文件被您的组所有则为真。 + -N 文件 如果文件上次被读取之后修改过则为真。 + + FILE1 -nt FILE2 如果 file1 文件新于 file2 文件则为真(根据 + 修改日期)。 + + FILE1 -ot FILE2 如果 file1 文件旧于 file2 文件则为真。 + + FILE1 -ef FILE2 如果 file1 文件是 file2 文件的硬链接则为真。 + + 字符串操作符 + + -z 字符串 如果字符串为空则为真。 + + -n 字符串 + 字符串 如果字符串不为空则为真。 + + STRING1 = STRING2 + 如果 string1 和 string2 字符串相同则为真。 + STRING1 != STRING2 + 如果 string1 和 string2 字符串不相同则为真。 + STRING1 < STRING2 + 如果按字典排序 string1 在 string2 串之前则为真。 + STRING1 > STRING2 + 如果按字典排序 string1 在 string2 串之前则为真。 + + 其他操作符: + + -o 选项 如果指定 shell 选项启用则为真。 + -v VAR 如果指定 Shell 变量 VAR 已赋值则为真。 + -R VAR 如果指定 Shell 变量 VAR 已赋值且为名称引用则为真。 + ! EXPR 如果表达式 expr 为假则为真。 + EXPR1 -a EXPR2 如果 expr1 和 expr2 都为真则为真。 + EXPR1 -o EXPR2 如果 expr1 和 expr2 有一个为真则为真。 + + arg1 OP arg2 算术测试。OP操作符可以是 -eq、-ne、 + -lt、-le、-gt、或 -ge 中的一个。 + + 二元算术操作返回真,如果 ARG1 参数等于、不等于、 + 小于、小于等于、大于、或者大于等于 ARG2 参数。 + + 退出状态: + 如果 EXPR 表达式估值为真则返回成功;如果 EXPR 表达式估值 + 为假或者使用了无效的参数则返回失败。 + + [times] 显示进程时间 + + 打印 shell 及其所有子进程的累计用户空间和 + 系统空间执行时间。 + + 退出状态 + 总是成功。 + + [limit] 修改 shell 资源限制。 + + 在允许此类控制的系统上,提供对于 shell 及其创建的进程所可用的 + 资源的控制。 + + 选项: + -S\t使用软 (`soft') 资源限制 + -H\t使用硬 (`hard') 资源限制 + -a\t所有当前限制都被报告 + -b\t套接字缓存尺寸 + -c\t创建的核文件的最大尺寸 + -d\t一个进程的数据区的最大尺寸 + -e\t最高的调度优先级 (`nice') + -f\t有 shell 及其子进程可以写的最大文件尺寸 + -i\t最多的可以挂起的信号数 + -k\t分配给此进程的最大 kqueue 数量 + -l\t一个进程可以锁定的最大内存尺寸 + -m\t最大的内存进驻尺寸 + -n\t最多的打开的文件描述符个数 + -p\t管道缓冲区尺寸 + -q\tPOSIX 信息队列的最大字节数 + -r\t实时调度的最大优先级 + -s\t最大栈尺寸 + -t\t最大的CPU时间,以秒为单位 + -u\t最大用户进程数 + -v\t虚拟内存尺寸 + -x\t最大的文件锁数量 + -P\t最大伪终端数量 + -T\t最大线程数量 + + 并非所有选项在所有系统上可用。 + + 如果提供了 LIMIT 变量,则它为指定资源的新的值;特别的 LIMIT 值为 + `soft'、`hard'和`unlimited',分别表示当前的软限制,硬限制和无限制。 + 否则打印指定资源的当前限制值,不带选项则假定为 -f + + 取值都是 1024 字节为单位,除了 -t 以秒为单位,-p 以 512 字节递增, + -u 为无范围的进程数量。 + + 退出状态: + 返回成功,除非使用了无效的选项或者错误发生。 + + [umask] 显示或设定文件模式掩码。 + + 设定用户文件创建掩码为 MODE 模式。如果省略了 MODE,则 + 打印当前掩码的值。 + + 如果 MODE 模式以数字开头,则被当作八进制数解析;否则是一个 + chmod(1) 可接收的符号模式串。 + + 选项: + -p\t如果省略 MODE 模式,以可重用为输入的格式输入 + -S\t以符号形式输出,否则以八进制数格式输出 + + 退出状态: + 返回成功,除非使用了无效的 MODE 模式或者选项。 + + [return] 等待任务完成并返回退出状态。 + + 等待以 ID 编号识别的进程,其中 ID 可以是进程编号或者任务声明, + 并报告它的终止状态。如果 ID 没有给出,则等待所有的当前活跃子 + 进程,并且返回状态为零。如果 ID 是任务声明,等待任务管道中的 + 所有进程。 + + 若给定了 -n 选项,等待下一个任务完成并返回其状态。 + + 若给定了 -f 选项,且已启用了任务控制,则等待指定的 ID 终止 + 而非等待它改变状态。 + 退出状态: + 返回最后一个 ID 进程的状态;如果使用了无效的 ID 或者选项则失败。 + + [wait] 等待进程完成并且返回退出状态。 + + 等待指定进程并报告它的终止状态。如果没有提供 PID,则当前所有的活跃 + 子进程都会被等待,并且返回码为零。PID 必须为进程号。 + + 退出状态: + 返回进程 ID 的状态;如果 PID 是无效的进程号或者指定了无效的选项则失败。 + + [for] 为列表中的每个成员执行命令。 + + “for”循环为列表中的每个成员执行一系列的命令。如果没有 + “in <词语> ...;”则假定使用“in \$@\”。对于 <词语> 中的每 + 个元素,<名称> 变量被设定为该元素后执行 <命令>。 + + 退出状态: + 返回最后执行的命令的状态。 + + [select] 从列表中选取词并且执行命令。 + + <词语...> 被展开,生成一个词的列表。展开的词集合被打印 + 在标准错误输出设备上,每个以一个数字做前缀。如果没有 `in WORDS' + 则假定使用`in \$@\'。PS3提示符会被显示并且从标准输入读入一行 + 如果该行由被显示的词对应的数字组成,则 NAME 变量被设定为相应 + 的词。如果行为空,则 WORDS 变量和提示符被重新显示。如果读取了 + 文件结束符,则命令完成。读入任何其他的值会导致 NAME 变量被设定 + 为空。读入的行被存放在变量 REPLY 中。COMMANDS 命令在每次选择 + 之后执行直到执行一个 break 命令。 + + 退出状态: + 返回最后一个执行的命令的状态。 + + [time] 报告管道执行的消耗时间。 + + 执行 PIPELINE 并且打印 PIPELINE 终结时实际时间、用户 CPU 时间和系统 + CPU 时间的总结。 + + 选项: + -p\t用可迁移的 POSIX 格式打印用时总结。 + + TIMEFORMAT 变量的值被作为输出格式。 + + 退出状态: + 返回状态即PIPELINE 的返回状态。 + + [case] 基于模式匹配来执行命令。 + + 基于 PATTERN 模式匹配的词 WORD,有选择的执行 COMMANDS 命令。 + `|' 用于分隔多个模式。 + + 退出状态: + 返回最后一个执行的命令的状态。 + + [if] 根据条件执行命令。 + + `if COMMANDS'列表被执行。如果退出状态为零,则执行`then COMMANDS' + 列表。否则按顺序执行每个 `elif COMMANDS'列表,并且如果它的退出状态为 + 零,则执行对应的 `then COMMANDS' 列表并且 if 命令终止。否则如果存在的 + 情况下,执行 `else COMMANDS'列表。整个结构的退出状态是最后一个执行 + 的命令的状态,或者如果没有条件测试为真的话,为零。 + + 退出状态: + 返回最后一个执行的命令的状态。 + + [while] 只要测试成功即执行命令。 + + 只要在 `while' COMMANDS 中的最终命令返回结果为0,则 + 展开并执行 COMMANDS 命令。 + + 退出状态: + 返回最后一个执行的命令的状态。 + + [until] 当测试不同过时执行命令。 + + `until' COMMANDS 命令的最终命令返回状态不为 0 时, + 展开并执行 COMMANDS 命令。 + + 退出状态: + 返回最后一个执行的命令的状态。 + + [coproc] 创建一个以 NAME 为名的副进程。 + + 异步执行 COMMANDS 命令,在执行 shell 中的数组变量 NAME + 的 0 号和 1 号元素作为文件描述符,以一个管道连接命令 + 分别作为命令的标准输出和输入设备。 + 默认的 NAME 是 \COPROC\。 + + 退出状态: + 副进程会返回退出状态 0。 + + [variables] 常用 shell 变量名称和使用。 + + BASH_VERSION\t当前 Bash 的版本信息。 + CDPATH\t用于 `cd' 命令参数搜索的分号分隔的目录列表 + GLOBIGNORE\t路径扩展时忽略的文件名匹配模式列表, + \t\t以分号分隔。 + HISTFILE\t您的命令历史存放的文件名称。 + HISTFILESIZE\t历史文件最多可以保存的行数。 + HISTSIZE\t一个运行的 shell 最多可以访问的历史命令行数。 + HOME\t您的登录目录的完整路径。 + HOSTNAME\t当前主机的主机名。 + HOSTTYPE\t当前版本的 BASH 在其之上运行的 CPU 类型。 + IGNOREEOF\t控制 shell 收到文件结束符作为单一输入后的 + \t\t动作。如果设定这个变量,则它的值是 shell 退出之前在 + \t\t一个空行上可以连续看到的文件结束符数量(默认为10)。 + \t\t未设定时,文件结束符标志着输入的结束。 + MACHTYPE\t描述当前运行 Bash 的系统的字符串。 + MAILCHECK\tBash 检测新邮件的频率,以秒为单位。 + MAILPATH\tBash 从中检测新邮件的文件列表,以分号分隔。 + OSTYPE\t运行 Bash 的 Unix 版本。 + PATH\t当寻找命令时搜索的目录列表,以冒号分隔。 + PROMPT_COMMAND\t打印每一个主提示符之前执行的命 + \t\t令。 + PS1\t\t主提示符字符串。 + PS2\t\t从提示符字符串。 + PWD\t\t当前目录的完整路径。 + SHELLOPTS\t已启用的 shell 选项列表,以冒号分隔。 + TERM\t当前终端类型的名称。 + TIMEFORMAT\t以关键则 `time' 显示的时间统计信息的输出 + \t\t格式。 + auto_resume\t非空时,一个单独的命令词会首先被在当前 + \t\t停止的任务列表中搜索。如果找到则该任务被置于前台。 + \t\t如果值为 `exact' 则意味着命令词必须精确匹配停止任务 + \t\t列表中的命令。如果值为 `substring' 则意味着命令词必 + \t\t须匹配任务的一个子字符串。任何其他的值意味着命令词 + \t\t必须是停止任务的一个前缀。 + histchars\t控制历史展开和快速替换的字符。第一个字符是 + \t\t历史替换字符,通常是 `!'。第二个字符是快速替换字符, + \t\t通常是 `^'。第三个是历史注释字符,通常是 `#'。 + HISTIGNORE\t用于决定哪些命令被存入历史文件的模式 + \t\t列表,以冒号分隔。 + + [pushd] 将目录添加到栈中。 + + 将目录添加到目录栈顶,或着旋转栈直到当前工作目录成为 + 新的栈顶。不带参数时,交换栈顶的两个目录。 + + 选项: + -n\t抑制添加目录至栈时通常的改变目录操作,从而仅对栈 + \t进行操作。 + + 参数: + +N\t旋转栈从而第 N 个目录 (`dirs' 显示的列表中左起,从零开始) + \t将移动到栈顶。 + + -N\t旋转栈从而第 N 个目录 (`dirs' 显示的列表中右起,从零开始) + \t将移动到栈顶。 + + dir\t将 DIR 目录添加到栈顶,并且使其成为当前工作目录。 + + `dirs' 内建显示目录栈。 + + 退出状态: + + [popd] 从栈中删除目录。 + + 从目录栈中删除条目。不带参数时,删除栈顶目录,并改变至新的栈 + 顶目录。 + + 选项: + -n\t抑制从栈中删除目录时通常的目录变换操作,从而仅对栈 + \t进行操作。 + + 参数: + +N\t删除第 N 个目录 (`dirs' 显示的目录列表中左起,从零开始)。 + \t例如:`popd +0' 删除第一个目录,`popd +1' 删除第二个。 + + -N\t删除第 N 个目录 (`dirs' 显示的目录列表中右起,从零开始)。 + \t例如:`popd -0' 删除最后一个目录,,`popd -1' 删除倒数第二个。 + + `dirs' 内建显示目录栈。 + + 退出状态: + 返回成功,除非使用了无效的参数或者目录变换失败。 + + [dirs] 显示目录栈。 + + 显示当前记住的目录列表。通过 `pushd' 命令可以将目录存入列表 + 中;`popd' 命令可用于遍历弹出列表。 + + 选项: + -c\t删除所有元素以清空目录栈 + -l\t不打印与主目录相关的波浪号前缀的目录 + -p\t每行一个条目打印目录栈 + -v\t每行一个条目,以栈中位置为前缀打印目录栈 + + 参数: + +N\t显示 dirs 不带选项启动时显示的目录列表左起中第 + \tN 个目录,从零开始。 + + -N\t显示 dirs 不带选项启动时显示的目录列表右起中第 + \tN 个目录,从零开始。 + + 退出状态: + 返回成功,除非使用了无效的选项或者发生错误。 + + [printf] 在 FORMAT 的控制下格式化并打印 ARGUMENTS 参数。 + + 选项: + -v var\t将输出赋值给 shell 变量 VAR 而不显示在标准输出上 + + FORMAT 是包含三种对象的字符串:简单地被拷贝到标准输出的普通字符; + 被变换之后拷贝到标准输入的转义字符;以及每个都会影响到下个参数的打印的格 + 式化声明。 + + 在 printf(1) 中描述的标准控制声明之外,printf 解析: + + %b\t扩展对应参数中的反斜杠转义序列 + %q\t以可作为 shell 输入的格式引用参数 + %(fmt)T\t以 FMT 为供给 strftime(3) 的格式输出日期时间字符串 + + 退出状态: + 返回成功,除非使用了无效的选项或者写或赋值错误发生。 + + [complete] 指定 Readline 如何补全参数。 + + 声明对于每一个 NAME 名称如何补全参数。如果不带选项, + 现有的补全声明会以可以重用为输入的格式打印出来。 + + 选项: + -p\t以可重用的格式打印现有的补全声明。 + -r\t对于每个 NAME 名称删除补全声明,或者如果没有提供 NAME + \t名称,删除所有的补全声明。 + -D\t对于没有补全声明定义的命令,设定默认的补全动作 + -E\t对于 \empty\ 命令设定补全动作,—— 对于空行的补全。 + -I\t将补全和动作应用在首单词(通常是所给命令)上 + + 尝试补全时,按照上述大写字母选项的顺序进行动作。 + 如果给出了多个选项,-D 选项优先级高于 -E 选项,且 + 这两个选项优先级均高于 -I。 + + 退出状态: + 返回成功,除非使用了无效的选项或者错误发生。 + + [compgen] 依据选项显示可能的补全。 + + 意图在能产生可能的补全的 shell 函数内部使用。 + 如果提供了可选的 WORD 参数,则产生按照 WORD + 进行的匹配。 + + 退出状态: + 除非使用了无效选项或者错误发生,否则返回成功。 + + [compopt] 修改或显示补全选项。 + + 修改每个 NAME 名称的补全选项,或如果没有提供 NAME 名称,执行当前的补 + 全。 + 如果不带选项,打印每个 NAME 名称的补全选项或当前的补全声明。 + + 选项: + \t-o option\t为每个 NAME 名称设定补全选项 option + \t-D\t\t为 \default\ 命令补全改变选项 + \t-E\t\t为 \empty\ 命令补全改变选项 + \t-I\t\t为首单词的补全改变选项 + + 使用 `+o' 而不是 `-o' 可以关闭指定的选项。 + + 参数: + + 每个 NAME 名称都对应一个之前以通过 `complete' 内建定义了的补全声明的 + 命令。如果不提供 NAME 名称,当前生成补全的函数必须调用 compopt, + 并且当前执行的补全生成器选项会被修改。 + + 退出状态: + 返回成功,除非使用了无效的选项或者 NAME 名称没有定义补全声明。 + + [mapfile] + 从标准输入读取行到下标数组变量中。 + + 从标准输入读取行到下标数组变量 ARRAY 中,或者如果使用了 -u 选项, + 从文件描述符 FD 中读取。MAPFILE 变量是默认的 ARRAY 变量。 + + 选项: + -d delim\t使用 DELIM 而非换行符断行 + -n count\t最多拷贝 COUNT 行,如果 COUNT 为 0,则拷贝所有行。 + -O origin\t从下标 ORIGIN 开始 赋值给 ARRAY 变量。默认下标是0. + -s count \t丢弃最先读取的 COUNT 行。 + -t\t\t从读取的每行末尾删除一个换行符。 + -u fd\t\t从文件描述符 FD 中读取行而不是标准输入。 + -C callback\t每 QUANTUM 次读行之后对 CALLBACK 回调进行估值。 + -c quantum\t定义每次调用 CALLBACK 回调之间读取的行数。 + + 参数: + ARRAY\t\t存储数据使用的数组变量 + + 如果使用了 -C 而没有 -c,默认的量子是5000。当对 CALLBACK 估值时, + 下一个将被赋值的数组元素的下标作为额外参数被传递。 + + 如果没有显式指定起始下标,mapfile 将在赋值前清空 ARRAY 变量。 + + 退出状态: + 返回成功,除非使用了无效的选项,或者 ARRAY 变量只读或不是下标数组。 + + [readarray] 从一个文件中读取行到数组变量中。 + 一个 `mapfile'的同义词。 + + [unset] 取消设定 shell 变量和函数的值和属性。 + 对每一个 NAME 名称,删除对应的变量或函数。 + + 选项: + -f\t将每个 NAME 视为函数 + -v\t将每个 NAME 视为变量 + -n\t将每个 NAME 视为名称引用,只取消其本身而非其指向的变量 + + 不带选项时,unset 首先尝试取消设定一个变量,如果失败,再尝试取消设定一个 + 函数。 + + 某些变量不可以被取消设定;参见 `readonly'。 + + 退出状态: + 返回成功,除非使用了无效的选项或者 NAME 名称为只读。 + + [local] 记住或显示程序位置。 + + 确定并记住每一个给定 NAME 名称的命令的完整路径。 + 如果不提供参数,则显示已经记住的命令的信息。 + + 选项: + -d 忘记每一个已经记住的 NAME 的位置 + -l 以可作为输入重用的格式显示 + -p pathname 使用 pathname 路径作为 NAME 命令的全路径 + -r 忘记所有记住的位置 + -t 打印记住的每一个 NAME 名称的位置,如果指定了多个 + NAME 名称,则每个位置前面会加上相应的 NAME 名称 + + 参数: + NAME 每个 NAME 名称会在 $PATH 路径变量中被搜索,并且添加到记住的命 + 令 + 列表中。 + + 退出状态: + 返回成功,除非 NAME 命令没有找到或者使用了无效的选项。 + 返回成功,除非使用了无效的选项或者 NAME 名称为只读。 + + [export] 为 shell 变量设定导出属性。 + + 标记每个 NAME 名称为自动导出到后续命令执行的环境。如果提供了 VALUE + 则导出前将 VALUE 作为赋值。 + + 选项: + -f 指 shell 函数 + -n 删除每个 NAME 名称的导出属性 + -p 显示所有导出的变量和函数的列表 + + `--' 的参数禁用进一步的选项处理。 + + 退出状态: + 返回成功,除非使用了无效的选项或者 NAME 名称。 + + [readonly] 标记 shell 变量为不可改变。 + + 标记每一个 NAME 名称为只读;这些 NAME 变量的值将不可以被后续的赋值 + 操作所改变。如果提供了 VALUE,则在标记为只读之前将 VALUE 值赋给变量。 + + 选项: + -a 指下标数组变量 + -A 指关联数组标量 + -f 指 shell 函数 + -p 显示只读变量或函数列表,取决于是否提供了 -f 选项 + + `--' 的参数禁用进一步的选项处理。 + + 退出状态: + 返回成功,除非使用了无效的选项或者 NAME 名称。 + + + [function] 定义 shell 函数。 + + 创建一个以 NAME 为名的 shell 函数。当作为一个简单的命令启用时, + NAME 函数执行调用 shell 的上下文中的 COMMANDs 命令。当 NAME + 被启用时,参数作为 $1...$n 被传递给函数,函数的名字储存在变量 + $FUNCNAME 中。 + + 退出状态: + 返回成功除非 NAME 为只读。 + +*[other] 显示其他命令帮助信息 . + +} diff --git a/bash-5.1/resources/zh-HK/message.ftl b/bash-5.1/resources/zh-HK/message.ftl new file mode 100644 index 0000000000000000000000000000000000000000..60f1562c57ca4f6ca68ad534ebbd95ab24edcbc4 --- /dev/null +++ b/bash-5.1/resources/zh-HK/message.ftl @@ -0,0 +1,1121 @@ +helplongdoc ={ +$cmdName -> +[set] + 设定或取消设定 shell 选项和位置参数的 + + 改变 shell 选项和位置参数的值,或者显示 shell 变量的 + 名称和值。 + + 选项: + -a 标记修改的或者创建的变量为导出。 + -b 立即通告任务终结。 + -e 如果一个命令以非零状态退出,则立即退出。 + -f 禁用文件名生成(模式匹配)。 + -h 当查询命令时记住它们的位置 + -k 所有的赋值参数被放在命令的环境中,而不仅仅是 + 命令名称之前的参数。 + -m 启用任务控制。 + -n 读取命令但不执行 + -o 选项名 + 设定与选项名对应的变量: + allexport 与 -a 相同 + braceexpand 与 -B 相同 + emacs 使用 emacs 风格的行编辑界面 + errexit 与 -e 相同 + errtrace 与 -E 相同 + functrace 与 -T 相同 + hashall 与 -h 相同 + histexpand 与 -H 相同 + history 启用命令历史 + ignoreeof shell 读取文件结束符时不会退出 + interactive-comments + 允许在交互式命令中显示注释 + keyword 与 -k 相同 + monitor 与 -m 相同 + noclobber 与 -C 相同 + noexec 与 -n 相同 + noglob 与 -f 相同 + nolog 目前可接受但是被忽略 + notify 与 -b 相同 + nounset 与 -u 相同 + onecmd 与 -t 相同 + physical 与 -P 相同 + pipefail 管道的返回值是最后一个非零返回值的命令的返回结果, + 或者当所有命令都返回零是也为零。 + posix 改变默认时和 Posix 标准不同的 bash 行为 + 以匹配标准 + privileged 与 -p 相同 + verbose 与 -v 相同 + vi 使用 vi 风格的行编辑界面 + xtrace 与 -x 相同 + -p 无论何时当真实的有效的用户身份不匹配时打开。 + 禁用对 $ENV 文件的处理以及导入 shell 函数。 + 关闭此选项会导致有效的用户编号和组编号设定 + 为真实的用户编号和组编号 + -t 读取并执行一个命令之后退出。 + -u 替换时将为设定的变量当作错误对待。 + -v 读取 shell 输入行时将它们打印。 + -x 执行命令时打印它们以及参数。 + -B shell 将执行花括号扩展。 + -C 设定之后禁止以重定向输出的方式覆盖常 + 规文件。 + -E 设定之后 ERR 陷阱会被 shell 函数继承。 + -H 启用 ! 风格的历史替换。当 shell 是交互式的 + 时候这个标识位默认打开。 + -P 设定之后类似 cd 的会改变当前目录的命令不 + 追踪符号链接。 + -T 设定之后 DEBUG 陷阱会被 shell 函数继承。 + -- 任何剩余的参数会被赋值给位置参数。如果没 + 有剩余的参数,位置参数不会被设置。 + - 任何剩余的参数会被赋值给位置参数。 + -x 和 -v 选项已关闭。 + + 使用 + 而不是 - 会使标志位被关闭。标志位也可以在 + shell 被启动时使用。当前的标志位设定可以在 $- 变 + 量中找到。剩余的 ARG 参数是位置参数并且是按照 + $1, $2, .. $n 的顺序被赋值的。如果没有给定 ARG + 参数,则打印所有的 shell 变量。 + + 退出状态: + 返回成功除非使用了无效的参数。 + [read] 从标准输入读取一行并将其分为不同的域。 + + 从标准输入读取单独的一行,或者如果使用了 -u 选项,从文件描述符 FD 中读 + 取。 + 该行被分割成域,如同词语分割一样,并且第一个词被赋值给第一个 NAME 变量, + 第二 + 个词被赋值给第二个 NAME 变量,如此继续,直到剩下所有的词被赋值给最后一个 + NAME + 变量。只有 $IFS 变量中的字符被认作是词语分隔符。 + + 如果没有提供 NAME 变量,则读取的行被存放在 REPLY 变量中。 + + 选项: + -a array\t将词语赋值给 ARRAY 数组变量的序列下标成员,从零开始 + -d delim\t持续读取直到读入 DELIM 变量中的第一个字符,而不是换行符 + -e\t使用 Readline 获取行 + -i text\t使用 TEXT 文本作为 Readline 的初始文字 + -n nchars\t读取 nchars 个字符之后返回,而不是等到读取换行符。 + \t\t但是分隔符仍然有效,如果遇到分隔符之前读取了不足 nchars 个字符。 + -N nchars\t在准确读取了 nchars 个字符之后返回,除非遇到文件结束符或者读 + 超时, + \t\t任何的分隔符都被忽略 + -p prompt\t在尝试读取之前输出 PROMPT 提示符并且不带 + \t\t换行符 + -r\t不允许反斜杠转义任何字符 + -s\t不回显终端的任何输入 + -t timeout\t如果在 TIMEOUT 秒内没有读取一个完整的行则超时并且返回失 + 败。 + \t\tTMOUT 变量的值是默认的超时时间。TIMEOUT 可以是小数。 + \t\t如果 TIMEOUT 是 0,那么仅当在指定的文件描述符上输入有效的时候, + \t\tread 才返回成功;否则它将立刻返回而不尝试读取任何数据。 + \t\t如果超过了超时时间,则返回状态码大于 128 + -u fd\t从文件描述符 FD 中读取,而不是标准输入 + + 退出状态: + 返回码为零,除非遇到了文件结束符、读超时(且返回码不大于128)、 + 出现了变量赋值错误或者无效的文件描述符作为参数传递给了 -u 选项。 + + [type] 显示命令类型的信息。 + + 对于每一个 NAME 名称,指示如果作为命令它将如何被解释。 + + 选项: + -a\t显示所有包含名称为 NAME 的可执行文件的位置; + \t\t包括别名、内建和函数。仅当 `-p' 选项没有使用时 + -f\t抑制 shell 函数查询 + -P\t为每个 NAME 名称惊醒 PATH 路径搜索,即使它是别名、 + \t\t内建或函数,并且返回将被执行的磁盘上文件的名称。 + -p\t返回将被执行的磁盘上文件的名称,或者当 `type -t NAME' + \t不返回 `file' 时,不返回任何值。 + -t\t返回下列词中的任何一个 `alias'、`keyword'、 + \t`function'、`builtin'、`file' 或者 `',相应地如果 NAME 是 + \t一个别名、shell 保留字、shell 函数、shell 内建、 + \t磁盘文件或没有找到。 + + 参数: + NAME\t将要解析的命令。 + + 退出状态: + 返回成功,除非使用了无效的选项或者 NAME 名称为只读。 + + [trap] 对信号和其他事件设陷阱。 + + 定义一个处理器,在 shell 接收到信号和其他条件下执行。 + + ARG 参数是当 shell 接收到 SIGNAL_SPEC 信号时读取和执行的命令。 + 如果没有指定 ARG 参数 (并且只给出一个 SIGNAL_SPEC 信号) 或者 + ARG 参数为 + `-',每一个指定的参数会被重置为原始值。如果 ARG 参数是一个空串,则每一 + 个 + SIGNAL_SPEC 信号会被 shell 和它启动的命令忽略。 + + 如果一个 SIGNAL_SPEC 信号是 EXIT (0) ,则 ARG 命令会在 shell 退出时被 + 执行。如果一个 SIGNAL_SPEC 信号是 DEBUG,则 ARG命令会在每一个简单命 + 令之前执行。 + + 如果不提供参数,trap 打印列表显示每一个与每一个信号相关联的命令。 + + 选项: + -l\t打印一个信号名称和它们对应的编号的列表 + -p\t打印与每个 SIGNAL_SPEC 信号相关联的陷阱命令 + + 每一个 SIGNAL_SPEC 信号可以是 中的信号名称或者信号编号。 + 信号名称大小写敏感且可以使用 SIG 前缀。信号可用 \kill -信号 $$\ + 发送给 shell。 + + 返回成功,除非使用了无效的选项或者 SIGSPEC。 + + [alias] 定义或显示别名。 + + 不带参数时,`alias' 以可重用的格式 + `alias 名称=值'在标准输出设备上打印别名列表。 + + 否则,对于每个给定值的名称定义一个别名。 + 值末尾的空格会使下一个词被检测作为别名替换展开。 + + 选项: + -p\t以可重用的格式打印所有的已定义的别名 + + 退出状态: + 除非一个没有定义的名字被作为参数提供,否则 alias + 返回值为真。 + + [unalias] 从别名定义列表中删除每一个“名字”。 + + 选项: + -a\t删除所有的别名定义 + + 返回成功,除非“名字”不是一个已存在的别名。 + + [break] 退出 for、while 或 until 循环 + + 退出一个 FOR、WHILE 或 UNTIL 循环。如果指定了N,则跳出N重 + 循环 + + 退出状态: + 退出状态为0除非 N 不大于或等于 1。 + + [continue] 继续 for、while 或 until 循环。 + + 继续当前 FOR、WHILE 或 UNTIL 循环的下一步。 + 如果指定了 N, 则继续当前的第 N 重循环。 + + 退出状态: + 退出状态为 0 除非 N 不大于或等于1。 + + [builtin] 执行 shell 内建。 + + 带参数 ARGs 执行 SHELL-BUILTIN 内建,并且不做命令查询 + 在希望以 shell 函数的形式来重新实现 shell 内建, + 并且希望在函数之内执行该 shell 内建的情况下有用处。 + + 退出状态: + 以 SHELL-BUILTIN 内建的退出状态为准,或者如果 SHELL-BUILTIN 不是一个 + shell 内建时为假。 + + [caller] 返回当前子调用的上下文。 + + 不带有 EXPR 时,返回 \$line $filename\。带有 EXPR 时,返回 + \$line $subroutine $filename\;这个额外的信息可以被用于提供 + 栈追踪。 + + EXPR 的值 显示了到当前调用帧需要回去多少个调用帧;顶部帧 + 是第 0 帧。 + + 退出状态: + 除非 shell 不在执行一个 shell 函数或者 EXPR 无效,否则返回结 + 果为0。 + + [cd]改变 shell 工作目录。 + + 改变当前目录至 DIR 目录。默认的 DIR 目录是 shell 变量 HOME + 的值。 + + 变量 CDPATH 定义了含有 DIR 的目录的搜索路径,其中不同的目录名称由冒号 (:) + 分隔。 + 一个空的目录名称表示当前目录。如果要切换到的 DIR 由斜杠 (/) 开头,则 + CDPATH + 不会用上变量。 + + 如果路径找不到,并且 shell 选项 `cdable_vars' 被设定,则参数词被假定为一 + 个 + 变量名。如果该变量有值,则它的值被当作 DIR 目录。 + + 选项: + -L\t强制跟随符号链接: 在处理 `..' 之后解析 DIR 中的符号链接。 + -P\t使用物理目录结构而不跟随符号链接: 在处理 `..' 之前解析 DIR 中的符 + 号链接。 + -e\t如果使用了 -P 参数,但不能成功确定当前工作目录时,返回非零的返回 + 值。 + -@\t在支持拓展属性的系统上,将一个有这些属性的文件当作有文件属性的目 + 录。 + + 默认情况下跟随符号链接,如同指定 `-L'。 + `..' 使用移除向前相邻目录名成员直到 DIR 开始或一个斜杠的方式处理。 + + 退出状态: + 如果目录改变,或在使用 -P 选项时 $PWD 修改成功时返回 0,否则非零。 + + [pwd]打印当前工作目录的名字。 + + 选项: + -L\t打印 $PWD 变量的值,如果它包含了当前的工作目录 + -P\t打印当前的物理路径,不带有任何的符号链接 + + 默认情况下,`pwd' 的行为和带 `-L' 选项一致 + + 退出状态: + 除非使用了无效选项或者当前目录不可读,否则返回状态为0。 + + [true]空的命令。 + + 没有效果; 此命令不做任何操作。 + + 退出状态: + 总是成功。 + [shopt] 设定和取消设定 shell 选项。 + + 改变每个 shell 选项 OPTNAME 的设定。不带参数时, + 列出每个提供的 OPTNAME,否则列出所有 shell 选项; + 同时标注每一个选项是否被设定。 + + 选项: + -o\t限制 OPTNAME 为定义用于`set -o' 的选项 + -p\t打印每个 shell 选项并标注它的状态。 + -q\t抑制输出 + -s\t启用(设定)每个 OPTNAME 选项 + -u\t禁用(取消设定)每个 OPTNAME 选项 + + 退出状态: + 如果 OPTNAME 选项被启用则返回成功;如果是 + 无效的选项或 OPTNAME 被禁用则失败。 + [false] 返回一个不成功的结果。 + + 退出状态: + 总是失败。 + + [command] 执行一个简单命令或者显示命令的相关信息。 + + 带 ARGS 参数运行 COMMAND 命令且抑制 shell 函数查询,或显示 + 指定的 COMMAND 命令的信息。可以在存在相同名称的函数定义的 + 情况下用于启动磁盘上的命令。 + + 选项: + -p\t使用 PATH 变量的一个默认值以确保所有的标准工具都能被找到。 + -v\t打印 COMMAND 命令的描述,和 `type' 内建相似 + -V\t打印每个 COMMAND 命令的详细描述 + + 退出状态 + 返回 COMMAND 命令的返回状态,或者当找不到 COMMAND 命令时失败。 + + [echo] 将参数写到标准输出。 + + 在标准输出上,显示用空格分割的 ARG 参数后跟一个换行。 + + 选项: + -n\t不要追加换行 + -e\t启用下列反斜杠转义的解释 + -E\t显式地抑制对于反斜杠转义的解释 + + `echo' 对下列反斜杠字符进行转义: + \a\t警告(响铃) + \\b\t退格 + \\c\t抑制更多的输出 + \\e\t转义字符 + \\f\t换页字符 + \\t换行 + \\r\t回车 + \\t\t横向制表符 + \\v\t纵向制表符 + \\\\\t反斜杠 + \\0nnn\t以 NNN(八进制)为 ASCII 码的字符。NNN 可以是 0 到 3 个八进制 + 位 + \\xHH\t以 HH(十六进制)为值的八比特字符。HH 可以是一个或两个十六进制 + 位 + \\uHHHH\t以 HHHH(十六进制)为值的 Unicode 字符。HHHH 可以是一个到 + \t\t四个十六进制位。 + \\UHHHHHHHH 以 HHHHHHHH(十六进制)为值的 Unicode 字符。 + \t\tHHHHHHHH 可以是一到八个十六进制位。 + + 退出状态: + 返回成功除非有写错误发生。 + + 写参数至标准输出设备。 + + 在标准输出设备上显示 ARGs 参数和一个换行。 + + 选项: + -n\t不附加换行 + + 退出状态: + 除非写错误发生,否则返回成功。 + + [enable] 启用和禁用 shell 内建。 + + 启用和禁用 shell 的内建命令。禁用使您能够执行一个和内建 + 命令同名的磁盘上的命令,而无须使用完整的路径名。 + + + 选项: + -a\t打印一个内建的列表,并显示其中每一个是否启用 + -n\t禁用每一个 NAME 内建或者显示一个被禁用的内建的列表 + -p\t以可重用的格式打印一个内建的列表 + -s\t仅打印Posix `special' 内建的名称 + + 控制动态加载的选项: + -f\t从共享对象 FILENAME 文件中加载 NAME 内建 + -d\t删除以 -f 选项加载的内建 + + 不带选项时,每一个 NAME 内建都被启用。 + + 如果要使用 $PATH 中找到的 `test' 而不是 shell 内建的版本, + 输入 `enable -n test'。 + + 退出状态: + 返回成功,除非 NAME 不是一个 shell 内建或者有错误发生。 + + [getopts] 解析选项参数。 + + getopts 被 shell 过程用于解析可定位的参数作为选项。 + + + OPTSTRING 字符串包含待识别的选项字母;如果一个字母后面跟 + 着分号,则该选项需要一个参数,而该参数应用空格与选项分开。 + + + 每次启动时,getopts 会将下一个选项放到 shell 变量 $name + 中,如果 name 变量不存在则先将其初始化,而下一个待处 + 理的参数序号放入 shell 变量 OPTIND 中。OPTIND 变量在每 + 次 shell 或者 shell 脚本启动时都被初始化为1。当一个选项要 + 求有一个参数时,getopts 将参数放入 shell 变量 OPTARG + 中。 + + getopts 有两种报告错误的方法。如果 OPTSTRING 变量的第 + 一个字符是冒号,getopts 使用沉默错误报告。在这种模式 + 下,不会打印错误消息。如果看到了一个无效的选项, + getopts 将找到的选项字符放至 OPTARG 变量中。如果一个必 + 须的选项没有找到,getopts 放一个 ':' 到 NAME 变量中并且设 + 置 OPTARG 变量为找到的选项字符。如果 getopts 不在沉默模 + 式中,并且遇到了一个无效的选项,getopts 放置一个 '?' 到 NAME + 变量中并且取消设定 OPTARG变量。如果必须的选项没有找到, + 一个'?'会被放入 NAME变量中,OPTARG 将被取消设定,并且会 + 打印一个诊断信息。 + + 如果 shell 变量 OPTERR 的值为0,getopts 禁用 + 错误信息的打印,即使 OPTSTRING 变量的第一个字符不是一 + 个冒号。OPTERR 的默认值为1. + + getopts 通常解析可定位的参数($0 - $9),不过如果提供了 + 更多的参数,它们反而会被解析。 + + 退出状态: + 如果一个选项被找到则返回成功;如果遇到了选项的结尾或者 + 有错误发生则返回失败。 + + [exec] 使用指定命令替换 shell。 + + 执行 COMMAND 命令,以指定的程序替换这个 shell。 + ARGUMENTS 参数成为 COMMAND命令的参数。如果 + 没有指定COMMAND 命令,则任何的重定向在当前 shell 中生效。 + + 选项: + -a 名称\t作为第0个参数传递给 COMMAND 命令 + -c\t\t在一个空环境中执行 COMMAND 命令 + -l\t\t在COMMAND 命令的第0个参数中加一个短线 + + 如果命令不能被执行,则退出一个非交互式的 shell,除非 + shell 选项`execfail' 已经设定。 + + 退出状态: + 返回成功除非 COMMAND 命令没有找到或者出现一个重定向错误。 + + [exit] 退出shell。 + + 以状态 N 退出 shell。 如果 N 被省略,则退出状态 + 为最后一个执行的命令的退出状态。 + + [logout] 退出一个登录 shell. + + 以状态 N 退出一个登录 shell。如果不在登录 shell 中执行,则 + 返回一个错误。 + + [fc] 从历史列表中显示或者执行命令。 + + fc 被用于从历史列表中列出或者重新编辑并执行命令。 + FIRST 和 LAST 变量可以是数字用于指定范围,或者 FIRST 可以是 + 字符串,意味着以这个字符串打头的最近的一个命令。 + + + 选项: + -e ENAME\t选择使用哪个编辑器。默认的是 FCEDIT, 然后是 EDITOR, + \t\t然后是 vi + -l \t列出行而不编辑 + -n\t列举时省略行号 + -r\t反转行的顺序(最新行在前) + + 用 `fc -s [模式=替换 ...] [命令]' 的格式,COMMAND 命令会在 OLD=NEW + 替换之后被重新执行。 + + r='fc -s' 是一个有用的别名,这样的话输入 `r cc'会执行最后一个以 `cc' + 开头的命令,输入 `r'会重新执行最后一个命令。 + + + 退出状态: + 返回成功,或者执行的命令的状态;如果错误发生则返回非零。 + + [fg] 将任务移至前台。 + + 将以 JOB_SPEC 标识的任务放至前台,使其成为 + 当前任务。如果 JOB_SPEC 不存在,shell 观念中的当前任务 + 将被使用。 + + 退出状态: + 放至前台的命令状态,或者当错误发生时为失败。 + + [bg] 移动任务至后台。 + + 将 JOB_SPEC 标识的任务放至后台,就像它们 + 是带 `&' 启动的一样。如果 JOB_SPEC 不存在,shell 观念中的 + 当前任务将会被使用。 + + 退出状态: + 返回成功除非任务管理没有启用或者错误发生。 + + [hash] 记住或显示程序位置。 + + 确定并记住每一个给定 NAME 名称的命令的完整路径。 + 如果不提供参数,则显示已经记住的命令的信息。 + + 选项: + -d\t\t忘记每一个已经记住的 NAME 的位置 + -l\t\t以可作为输入重用的格式显示 + -p pathname\t使用 pathname 路径作为 NAME 命令的全路径 + -r\t\t忘记所有记住的位置 + -t\t\t打印记住的每一个 NAME 名称的位置,如果指定了多个 + \t\tNAME 名称,则每个位置前面会加上相应的 NAME 名称 + \t\t + 参数: + NAME\t\t每个 NAME 名称会在 $PATH 路径变量中被搜索,并且添加到记住的命 + 令 + 列表中。 + + 退出状态: + 返回成功,除非 NAME 命令没有找到或者使用了无效的选项。 + + [help] 显示内建命令的相关信息。 + + 显示内建命令的简略信息。如果指定了 PATTERN 模式, + 给出所有匹配 PATTERN 模式的命令的详细帮助,否则打 + 印一个帮助主题列表 + + 选项: + -d\t输出每个主题的简短描述 + -m\t以伪 man 手册的格式显示使用方法 + -s\t为每一个匹配 PATTERN 模式的主题仅显示一个用法 + \t简介 + + 参数: + PATTERN\t指定帮助主题的模式 + + 退出状态: + 返回成功,除非未找到 PATTERN 模式没有找到或者使用了无效选项。 + + [history] 显示或操纵历史列表。 + + 带行号显示历史列表,将每个被修改的条目加上 `*' 前缀。 + 参数 N 会仅列出最后的 N 个条目。 + + 选项: + -c\t删除所有条目从而清空历史列表。 + -d 偏移量\t从指定位置删除历史列表。负偏移量将从历史条目末尾 + \t\t开始计数 + + -a\t将当前会话的历史行追加到历史文件中 + -n\t从历史文件中读取所有未被读取的行 + \t\t并且将它们附加到历史列表 + -r\t读取历史文件并将内容追加到历史列表中 + -w\t将当前历史写入到历史文件中 + + -p\t对每一个 ARG 参数展开历史并显示结果,而不存储到历史列表中 + -s\t以单条记录追加 ARG 到历史列表中 + + 如果给定了 FILENAME 文件名,则它将被作为历史文件。否则 + 如果 $HISTFILE 变量有值的话使用之,不然使用 ~/.bash_history 文件。 + + 如果 $HISTTIMEFORMAT 变量被设定并且不为空,它的值会被用于 + strftime(3) 的格式字符串来打印与每一个显示的历史条目想关联的 + 时间戳,否则不打印时间戳。 + + 退出状态: + 返回成功,除非使用了无效的选项或者发生错误。 + [jobs] 显示任务状态。 + + 列出活动的任务。JOBSPEC 限制仅输出指定的任务。 + 不带选项时,所有活动任务的状态都会显示。 + + 选项: + -l\t在正常信息基础上列出进程号 + -n\t仅列出上次通告之后改变了状态的进程 + -p\t仅列出进程号 + -r\t限制仅输出运行中的任务 + -s\t限制仅输出停止的任务 + + 如果使用了 -x 选项,ARG 参数中的所有任务声明会被替换为该任务 + 的进程组头领的进程号,然后执行 COMMAND 命令。 + + 退出状态: + 返回成功,除非使用了无效的选项或者有错误发生。 + 如果使用 -x 选项,则返回 COMMAND 命令的退出状态。 + + [disown] 从当前 shell 中删除任务。 + + 从活动任务表中删除每一个 JOBSPEC 参数。不带任何 + JOBSPEC 参数时,shell 使用观念中的当前任务。 + + 选项: + -a\t如果不提供 JOBSPEC 参数,则删除所有任务 + -h\t标识每个 JOBSPEC 任务,从而当 shell 接收到 SIGHUP + \t\t信号时不发送 SIGHUP 给指定任务 + -r\t仅删除运行中的任务 + + 退出状态: + 返回成功除非使用了无效的选项或者 JOBSPEC 声明。 + + [kill] 向一个任务发送一个信号。 + + 向以 PID 进程号或者 JOBSPEC 任务声明指定的进程发送一个以 + SIGSPEC 信号声明或 SIGNUM 信号编号命名的信号。如果没有指定 + SIGSPEC 或 SIGNUM,那么假定发送 SIGTERM 信号。 + + 选项: + -s sig\tSIG 是信号名称 + -n sig\tSIG 是信号编号 + -l\t列出信号名称;如果参数后跟 `-l'则被假设为信号编号, + \t\t而相应的信号名称会被列出 + + Kill 成为 shell 内建有两个理由:它允许使用任务编号而不是进程号, + 并且在可以创建的进程数上限达到是允许进程被杀死。 + + 退出状态: + 返回成功,除非使用了无效的选项或者有错误发生。 + [let] 估值算术表达式。 + + 将每个 ARG 参赛作为算术表达式来估值。估值的计算以定宽的整 + 数完成,不带溢出检测,不过除 0 是被置陷阱的并且会报一个错 + 误。下列操作符被按照相同的算术优先级组合。列表的顺序按照 + 优先级从高至低。 + + + \tid++, id--\t变量后置加,后置减 + \t++id, --id\t变量前置加,前置减 + \t-, +\t\t一元减法,一元加法 + \t!, ~\t\t逻辑和位取反 + \t**\t\t指数 + \t*, /, %\t\t乘法,除法,取余数 + \t+, -\t\t增加,减少 + \t<<, >>\t\t向左和向右按位移位 + \t<=, >=, <, >\t比较 + \t==, !=\t\t等于,不等于 + \t&\t\t按位与 + \t^\t\t按位异或 + \t|\t\t按位或 + \t&&\t\t逻辑与 + \t||\t\t逻辑或 + \texpr ? expr : expr + \t\t\t条件操作符 + \t=, *=, /=, %=, + \t+=, -=, <<=, >>=, + \t&=, ^=, |=\t赋值 + + Shell 变量允许作为操作数。表达式中的变量的名称会被取代以值 + (强制转换为定宽的整数)。表达式中的变量不需要打开整数属性。 + + 操作符按照优先级进行估值。括号中的子表达式将被先估值,并可取代上述表达式 + 规则。 + + [shift] 移位位置参数。 + + 重命名位置参数 $N+1、$N+2 ... 到 $1、$2 ... 如果没有给定 N, + 则假设为1. + + 退出状态: + 返回成功,除非 N 为负或者大于 $#。 + 返回 N,或者如果 shell 不在执行一个函数或引用脚本时,失败。 + + [suspend] 挂起 shell 执行。 + + 挂起 shell 的执行直到收到 SIGCONT 信号。 + 登录 shell 不可以被挂起,除非强制执行。 + + 选项: + -f\t强制挂起,即使是登录 shell。 + + 退出状态: + 返回成功,除非没有启用任务控制或者有错误发生。 + + [eval] 对条件表达式进行估值。 + + 根据 EXPR 表达式的估值以状态 0 (真) 或 1 (伪) 退出。 + 表达式可以是一元或者二元的。一元表达式通常用于检测 + 文件状态。同时还有字符串操作符和数字比较操作符。 + + 文件操作符: + + -a 文件 如果文件存在则为真。 + -b 文件 如果文件为块特殊文件则为真。 + -c 文件 如果文件为字符特殊文件则为真。 + -d 文件 如果文件为目录则为真。 + -e 文件 如果文件存在则为真。 + -f 文件 如果文件存在且为常规文件则为真。 + -g 文件 如果文件的组属性设置打开则为真。 + -h 文件 如果文件为符号链接则为真。 + -L 文件 如果文件为符号链接则为真。 + -k 文件 如果文件的粘滞 (sticky) 位设定则为真。 + -p 文件 如果文件为命名管道则为真。 + -r 文件 如果文件对于您是可读的则为真。 + -s 文件 如果文件存在且不为空则为真。 + -S 文件 如果文件是套接字则为真。 + -t 文件描述符 如果文件描述符在一个终端上打开则为真。 + -u 文件 如果文件的用户数行设置打开则为真。 + -w 文件 如果文件对您是可写的则为真 + -x 文件 如果文件对您是可执行的则为真。 + -O 文件 如果文件是被您所有的则为真。 + -G 文件 如果文件被您的组所有则为真。 + -N 文件 如果文件上次被读取之后修改过则为真。 + + FILE1 -nt FILE2 如果 file1 文件新于 file2 文件则为真(根据 + 修改日期)。 + + FILE1 -ot FILE2 如果 file1 文件旧于 file2 文件则为真。 + + FILE1 -ef FILE2 如果 file1 文件是 file2 文件的硬链接则为真。 + + 字符串操作符 + + -z 字符串 如果字符串为空则为真。 + + -n 字符串 + 字符串 如果字符串不为空则为真。 + + STRING1 = STRING2 + 如果 string1 和 string2 字符串相同则为真。 + STRING1 != STRING2 + 如果 string1 和 string2 字符串不相同则为真。 + STRING1 < STRING2 + 如果按字典排序 string1 在 string2 串之前则为真。 + STRING1 > STRING2 + 如果按字典排序 string1 在 string2 串之前则为真。 + + 其他操作符: + + -o 选项 如果指定 shell 选项启用则为真。 + -v VAR 如果指定 Shell 变量 VAR 已赋值则为真。 + -R VAR 如果指定 Shell 变量 VAR 已赋值且为名称引用则为真。 + ! EXPR 如果表达式 expr 为假则为真。 + EXPR1 -a EXPR2 如果 expr1 和 expr2 都为真则为真。 + EXPR1 -o EXPR2 如果 expr1 和 expr2 有一个为真则为真。 + + arg1 OP arg2 算术测试。OP操作符可以是 -eq、-ne、 + -lt、-le、-gt、或 -ge 中的一个。 + + 二元算术操作返回真,如果 ARG1 参数等于、不等于、 + 小于、小于等于、大于、或者大于等于 ARG2 参数。 + + 退出状态: + 如果 EXPR 表达式估值为真则返回成功;如果 EXPR 表达式估值 + 为假或者使用了无效的参数则返回失败。 + + [times] 显示进程时间 + + 打印 shell 及其所有子进程的累计用户空间和 + 系统空间执行时间。 + + 退出状态 + 总是成功。 + + [limit] 修改 shell 资源限制。 + + 在允许此类控制的系统上,提供对于 shell 及其创建的进程所可用的 + 资源的控制。 + + 选项: + -S\t使用软 (`soft') 资源限制 + -H\t使用硬 (`hard') 资源限制 + -a\t所有当前限制都被报告 + -b\t套接字缓存尺寸 + -c\t创建的核文件的最大尺寸 + -d\t一个进程的数据区的最大尺寸 + -e\t最高的调度优先级 (`nice') + -f\t有 shell 及其子进程可以写的最大文件尺寸 + -i\t最多的可以挂起的信号数 + -k\t分配给此进程的最大 kqueue 数量 + -l\t一个进程可以锁定的最大内存尺寸 + -m\t最大的内存进驻尺寸 + -n\t最多的打开的文件描述符个数 + -p\t管道缓冲区尺寸 + -q\tPOSIX 信息队列的最大字节数 + -r\t实时调度的最大优先级 + -s\t最大栈尺寸 + -t\t最大的CPU时间,以秒为单位 + -u\t最大用户进程数 + -v\t虚拟内存尺寸 + -x\t最大的文件锁数量 + -P\t最大伪终端数量 + -T\t最大线程数量 + + 并非所有选项在所有系统上可用。 + + 如果提供了 LIMIT 变量,则它为指定资源的新的值;特别的 LIMIT 值为 + `soft'、`hard'和`unlimited',分别表示当前的软限制,硬限制和无限制。 + 否则打印指定资源的当前限制值,不带选项则假定为 -f + + 取值都是 1024 字节为单位,除了 -t 以秒为单位,-p 以 512 字节递增, + -u 为无范围的进程数量。 + + 退出状态: + 返回成功,除非使用了无效的选项或者错误发生。 + + [umask] 显示或设定文件模式掩码。 + + 设定用户文件创建掩码为 MODE 模式。如果省略了 MODE,则 + 打印当前掩码的值。 + + 如果 MODE 模式以数字开头,则被当作八进制数解析;否则是一个 + chmod(1) 可接收的符号模式串。 + + 选项: + -p\t如果省略 MODE 模式,以可重用为输入的格式输入 + -S\t以符号形式输出,否则以八进制数格式输出 + + 退出状态: + 返回成功,除非使用了无效的 MODE 模式或者选项。 + + [return] 等待任务完成并返回退出状态。 + + 等待以 ID 编号识别的进程,其中 ID 可以是进程编号或者任务声明, + 并报告它的终止状态。如果 ID 没有给出,则等待所有的当前活跃子 + 进程,并且返回状态为零。如果 ID 是任务声明,等待任务管道中的 + 所有进程。 + + 若给定了 -n 选项,等待下一个任务完成并返回其状态。 + + 若给定了 -f 选项,且已启用了任务控制,则等待指定的 ID 终止 + 而非等待它改变状态。 + 退出状态: + 返回最后一个 ID 进程的状态;如果使用了无效的 ID 或者选项则失败。 + + [wait] 等待进程完成并且返回退出状态。 + + 等待指定进程并报告它的终止状态。如果没有提供 PID,则当前所有的活跃 + 子进程都会被等待,并且返回码为零。PID 必须为进程号。 + + 退出状态: + 返回进程 ID 的状态;如果 PID 是无效的进程号或者指定了无效的选项则失败。 + + [for] 为列表中的每个成员执行命令。 + + “for”循环为列表中的每个成员执行一系列的命令。如果没有 + “in <词语> ...;”则假定使用“in \$@\”。对于 <词语> 中的每 + 个元素,<名称> 变量被设定为该元素后执行 <命令>。 + + 退出状态: + 返回最后执行的命令的状态。 + + [select] 从列表中选取词并且执行命令。 + + <词语...> 被展开,生成一个词的列表。展开的词集合被打印 + 在标准错误输出设备上,每个以一个数字做前缀。如果没有 `in WORDS' + 则假定使用`in \$@\'。PS3提示符会被显示并且从标准输入读入一行 + 如果该行由被显示的词对应的数字组成,则 NAME 变量被设定为相应 + 的词。如果行为空,则 WORDS 变量和提示符被重新显示。如果读取了 + 文件结束符,则命令完成。读入任何其他的值会导致 NAME 变量被设定 + 为空。读入的行被存放在变量 REPLY 中。COMMANDS 命令在每次选择 + 之后执行直到执行一个 break 命令。 + + 退出状态: + 返回最后一个执行的命令的状态。 + + [time] 报告管道执行的消耗时间。 + + 执行 PIPELINE 并且打印 PIPELINE 终结时实际时间、用户 CPU 时间和系统 + CPU 时间的总结。 + + 选项: + -p\t用可迁移的 POSIX 格式打印用时总结。 + + TIMEFORMAT 变量的值被作为输出格式。 + + 退出状态: + 返回状态即PIPELINE 的返回状态。 + + [case] 基于模式匹配来执行命令。 + + 基于 PATTERN 模式匹配的词 WORD,有选择的执行 COMMANDS 命令。 + `|' 用于分隔多个模式。 + + 退出状态: + 返回最后一个执行的命令的状态。 + + [if] 根据条件执行命令。 + + `if COMMANDS'列表被执行。如果退出状态为零,则执行`then COMMANDS' + 列表。否则按顺序执行每个 `elif COMMANDS'列表,并且如果它的退出状态为 + 零,则执行对应的 `then COMMANDS' 列表并且 if 命令终止。否则如果存在的 + 情况下,执行 `else COMMANDS'列表。整个结构的退出状态是最后一个执行 + 的命令的状态,或者如果没有条件测试为真的话,为零。 + + 退出状态: + 返回最后一个执行的命令的状态。 + + [while] 只要测试成功即执行命令。 + + 只要在 `while' COMMANDS 中的最终命令返回结果为0,则 + 展开并执行 COMMANDS 命令。 + + 退出状态: + 返回最后一个执行的命令的状态。 + + [until] 当测试不同过时执行命令。 + + `until' COMMANDS 命令的最终命令返回状态不为 0 时, + 展开并执行 COMMANDS 命令。 + + 退出状态: + 返回最后一个执行的命令的状态。 + + [coproc] 创建一个以 NAME 为名的副进程。 + + 异步执行 COMMANDS 命令,在执行 shell 中的数组变量 NAME + 的 0 号和 1 号元素作为文件描述符,以一个管道连接命令 + 分别作为命令的标准输出和输入设备。 + 默认的 NAME 是 \COPROC\。 + + 退出状态: + 副进程会返回退出状态 0。 + + [variables] 常用 shell 变量名称和使用。 + + BASH_VERSION\t当前 Bash 的版本信息。 + CDPATH\t用于 `cd' 命令参数搜索的分号分隔的目录列表 + GLOBIGNORE\t路径扩展时忽略的文件名匹配模式列表, + \t\t以分号分隔。 + HISTFILE\t您的命令历史存放的文件名称。 + HISTFILESIZE\t历史文件最多可以保存的行数。 + HISTSIZE\t一个运行的 shell 最多可以访问的历史命令行数。 + HOME\t您的登录目录的完整路径。 + HOSTNAME\t当前主机的主机名。 + HOSTTYPE\t当前版本的 BASH 在其之上运行的 CPU 类型。 + IGNOREEOF\t控制 shell 收到文件结束符作为单一输入后的 + \t\t动作。如果设定这个变量,则它的值是 shell 退出之前在 + \t\t一个空行上可以连续看到的文件结束符数量(默认为10)。 + \t\t未设定时,文件结束符标志着输入的结束。 + MACHTYPE\t描述当前运行 Bash 的系统的字符串。 + MAILCHECK\tBash 检测新邮件的频率,以秒为单位。 + MAILPATH\tBash 从中检测新邮件的文件列表,以分号分隔。 + OSTYPE\t运行 Bash 的 Unix 版本。 + PATH\t当寻找命令时搜索的目录列表,以冒号分隔。 + PROMPT_COMMAND\t打印每一个主提示符之前执行的命 + \t\t令。 + PS1\t\t主提示符字符串。 + PS2\t\t从提示符字符串。 + PWD\t\t当前目录的完整路径。 + SHELLOPTS\t已启用的 shell 选项列表,以冒号分隔。 + TERM\t当前终端类型的名称。 + TIMEFORMAT\t以关键则 `time' 显示的时间统计信息的输出 + \t\t格式。 + auto_resume\t非空时,一个单独的命令词会首先被在当前 + \t\t停止的任务列表中搜索。如果找到则该任务被置于前台。 + \t\t如果值为 `exact' 则意味着命令词必须精确匹配停止任务 + \t\t列表中的命令。如果值为 `substring' 则意味着命令词必 + \t\t须匹配任务的一个子字符串。任何其他的值意味着命令词 + \t\t必须是停止任务的一个前缀。 + histchars\t控制历史展开和快速替换的字符。第一个字符是 + \t\t历史替换字符,通常是 `!'。第二个字符是快速替换字符, + \t\t通常是 `^'。第三个是历史注释字符,通常是 `#'。 + HISTIGNORE\t用于决定哪些命令被存入历史文件的模式 + \t\t列表,以冒号分隔。 + + [pushd] 将目录添加到栈中。 + + 将目录添加到目录栈顶,或着旋转栈直到当前工作目录成为 + 新的栈顶。不带参数时,交换栈顶的两个目录。 + + 选项: + -n\t抑制添加目录至栈时通常的改变目录操作,从而仅对栈 + \t进行操作。 + + 参数: + +N\t旋转栈从而第 N 个目录 (`dirs' 显示的列表中左起,从零开始) + \t将移动到栈顶。 + + -N\t旋转栈从而第 N 个目录 (`dirs' 显示的列表中右起,从零开始) + \t将移动到栈顶。 + + dir\t将 DIR 目录添加到栈顶,并且使其成为当前工作目录。 + + `dirs' 内建显示目录栈。 + + 退出状态: + + [popd] 从栈中删除目录。 + + 从目录栈中删除条目。不带参数时,删除栈顶目录,并改变至新的栈 + 顶目录。 + + 选项: + -n\t抑制从栈中删除目录时通常的目录变换操作,从而仅对栈 + \t进行操作。 + + 参数: + +N\t删除第 N 个目录 (`dirs' 显示的目录列表中左起,从零开始)。 + \t例如:`popd +0' 删除第一个目录,`popd +1' 删除第二个。 + + -N\t删除第 N 个目录 (`dirs' 显示的目录列表中右起,从零开始)。 + \t例如:`popd -0' 删除最后一个目录,,`popd -1' 删除倒数第二个。 + + `dirs' 内建显示目录栈。 + + 退出状态: + 返回成功,除非使用了无效的参数或者目录变换失败。 + + [dirs] 显示目录栈。 + + 显示当前记住的目录列表。通过 `pushd' 命令可以将目录存入列表 + 中;`popd' 命令可用于遍历弹出列表。 + + 选项: + -c\t删除所有元素以清空目录栈 + -l\t不打印与主目录相关的波浪号前缀的目录 + -p\t每行一个条目打印目录栈 + -v\t每行一个条目,以栈中位置为前缀打印目录栈 + + 参数: + +N\t显示 dirs 不带选项启动时显示的目录列表左起中第 + \tN 个目录,从零开始。 + + -N\t显示 dirs 不带选项启动时显示的目录列表右起中第 + \tN 个目录,从零开始。 + + 退出状态: + 返回成功,除非使用了无效的选项或者发生错误。 + + [printf] 在 FORMAT 的控制下格式化并打印 ARGUMENTS 参数。 + + 选项: + -v var\t将输出赋值给 shell 变量 VAR 而不显示在标准输出上 + + FORMAT 是包含三种对象的字符串:简单地被拷贝到标准输出的普通字符; + 被变换之后拷贝到标准输入的转义字符;以及每个都会影响到下个参数的打印的格 + 式化声明。 + + 在 printf(1) 中描述的标准控制声明之外,printf 解析: + + %b\t扩展对应参数中的反斜杠转义序列 + %q\t以可作为 shell 输入的格式引用参数 + %(fmt)T\t以 FMT 为供给 strftime(3) 的格式输出日期时间字符串 + + 退出状态: + 返回成功,除非使用了无效的选项或者写或赋值错误发生。 + + [complete] 指定 Readline 如何补全参数。 + + 声明对于每一个 NAME 名称如何补全参数。如果不带选项, + 现有的补全声明会以可以重用为输入的格式打印出来。 + + 选项: + -p\t以可重用的格式打印现有的补全声明。 + -r\t对于每个 NAME 名称删除补全声明,或者如果没有提供 NAME + \t名称,删除所有的补全声明。 + -D\t对于没有补全声明定义的命令,设定默认的补全动作 + -E\t对于 \empty\ 命令设定补全动作,—— 对于空行的补全。 + -I\t将补全和动作应用在首单词(通常是所给命令)上 + + 尝试补全时,按照上述大写字母选项的顺序进行动作。 + 如果给出了多个选项,-D 选项优先级高于 -E 选项,且 + 这两个选项优先级均高于 -I。 + + 退出状态: + 返回成功,除非使用了无效的选项或者错误发生。 + + [compgen] 依据选项显示可能的补全。 + + 意图在能产生可能的补全的 shell 函数内部使用。 + 如果提供了可选的 WORD 参数,则产生按照 WORD + 进行的匹配。 + + 退出状态: + 除非使用了无效选项或者错误发生,否则返回成功。 + + [compopt] 修改或显示补全选项。 + + 修改每个 NAME 名称的补全选项,或如果没有提供 NAME 名称,执行当前的补 + 全。 + 如果不带选项,打印每个 NAME 名称的补全选项或当前的补全声明。 + + 选项: + \t-o option\t为每个 NAME 名称设定补全选项 option + \t-D\t\t为 \default\ 命令补全改变选项 + \t-E\t\t为 \empty\ 命令补全改变选项 + \t-I\t\t为首单词的补全改变选项 + + 使用 `+o' 而不是 `-o' 可以关闭指定的选项。 + + 参数: + + 每个 NAME 名称都对应一个之前以通过 `complete' 内建定义了的补全声明的 + 命令。如果不提供 NAME 名称,当前生成补全的函数必须调用 compopt, + 并且当前执行的补全生成器选项会被修改。 + + 退出状态: + 返回成功,除非使用了无效的选项或者 NAME 名称没有定义补全声明。 + + [mapfile] + 从标准输入读取行到下标数组变量中。 + + 从标准输入读取行到下标数组变量 ARRAY 中,或者如果使用了 -u 选项, + 从文件描述符 FD 中读取。MAPFILE 变量是默认的 ARRAY 变量。 + + 选项: + -d delim\t使用 DELIM 而非换行符断行 + -n count\t最多拷贝 COUNT 行,如果 COUNT 为 0,则拷贝所有行。 + -O origin\t从下标 ORIGIN 开始 赋值给 ARRAY 变量。默认下标是0. + -s count \t丢弃最先读取的 COUNT 行。 + -t\t\t从读取的每行末尾删除一个换行符。 + -u fd\t\t从文件描述符 FD 中读取行而不是标准输入。 + -C callback\t每 QUANTUM 次读行之后对 CALLBACK 回调进行估值。 + -c quantum\t定义每次调用 CALLBACK 回调之间读取的行数。 + + 参数: + ARRAY\t\t存储数据使用的数组变量 + + 如果使用了 -C 而没有 -c,默认的量子是5000。当对 CALLBACK 估值时, + 下一个将被赋值的数组元素的下标作为额外参数被传递。 + + 如果没有显式指定起始下标,mapfile 将在赋值前清空 ARRAY 变量。 + + 退出状态: + 返回成功,除非使用了无效的选项,或者 ARRAY 变量只读或不是下标数组。 + + [readarray] 从一个文件中读取行到数组变量中。 + 一个 `mapfile'的同义词。 + + [unset] 取消设定 shell 变量和函数的值和属性。 + 对每一个 NAME 名称,删除对应的变量或函数。 + + 选项: + -f\t将每个 NAME 视为函数 + -v\t将每个 NAME 视为变量 + -n\t将每个 NAME 视为名称引用,只取消其本身而非其指向的变量 + + 不带选项时,unset 首先尝试取消设定一个变量,如果失败,再尝试取消设定一个 + 函数。 + + 某些变量不可以被取消设定;参见 `readonly'。 + + 退出状态: + 返回成功,除非使用了无效的选项或者 NAME 名称为只读。 + +*[other] 显示其他命令帮助信息 . + +} diff --git a/bash-5.1/vendor/autocfg/.cargo-checksum.json b/bash-5.1/vendor/autocfg/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..e4cc3fc45aebccae43698aa41589a3969c409a04 --- /dev/null +++ b/bash-5.1/vendor/autocfg/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.lock":"3d91565ed13de572a9ebde408a0c98e33f931d6ab52f212b0830a60b4ab26b77","Cargo.toml":"39f627122dceaad42146634719fde802fca3baa1b3908753af723074ae2a6d69","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"27995d58ad5c1145c1a8cd86244ce844886958a35eb2b78c6b772748669999ac","README.md":"4c8f9b5016f2a0c3dbeca5bc41241f57db5568f803e58c1fa480ae2b3638d0a9","examples/integers.rs":"589ff4271566dfa322becddf3e2c7b592e6e0bc97b02892ce75619b7e452e930","examples/paths.rs":"1b30e466b824ce8df7ad0a55334424131d9d2573d6cf9f7d5d50c09c8901d526","examples/traits.rs":"cbee6a3e1f7db60b02ae25b714926517144a77cb492021f492774cf0e1865a9e","examples/versions.rs":"38535e6d9f5bfae0de474a3db79a40e8f5da8ba9334c5ff4c363de9bc99d4d12","src/error.rs":"12de7dafea4a35d1dc2f0fa79bfa038386bbbea72bf083979f4ddf227999eeda","src/lib.rs":"6fa01458e8f9258d84f83ead24fdb0cdf9aec10838b0262f1dfbdf79c530c537","src/tests.rs":"f0e6dc1ad9223c0336c02e215ea3940acb2af6c3bc8fd791e16cd4e786e6a608","src/version.rs":"175727d5f02f2fe2271ddc9b041db2a5b9c6fe0f95afd17c73a4d982612764a3","tests/rustflags.rs":"5c8169b88216055019db61b5d7baf4abdf675e3b14b54f5037bb1e3acd0a5d3f"},"package":"d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"} \ No newline at end of file diff --git a/bash-5.1/vendor/autocfg/Cargo.toml b/bash-5.1/vendor/autocfg/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..f8bd64c08b94f6de8d812070244e7f5cbedb2f77 --- /dev/null +++ b/bash-5.1/vendor/autocfg/Cargo.toml @@ -0,0 +1,24 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +name = "autocfg" +version = "1.1.0" +authors = ["Josh Stone "] +exclude = ["/.github/**", "/bors.toml"] +description = "Automatic cfg for Rust compiler features" +readme = "README.md" +keywords = ["rustc", "build", "autoconf"] +categories = ["development-tools::build-utils"] +license = "Apache-2.0 OR MIT" +repository = "https://github.com/cuviper/autocfg" + +[dependencies] diff --git a/bash-5.1/vendor/autocfg/LICENSE-APACHE b/bash-5.1/vendor/autocfg/LICENSE-APACHE new file mode 100644 index 0000000000000000000000000000000000000000..16fe87b06e802f094b3fbb0894b137bca2b16ef1 --- /dev/null +++ b/bash-5.1/vendor/autocfg/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/bash-5.1/vendor/autocfg/LICENSE-MIT b/bash-5.1/vendor/autocfg/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..44fbc4d8b90dbe07864fdf49939308839e5735b2 --- /dev/null +++ b/bash-5.1/vendor/autocfg/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2018 Josh Stone + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/bash-5.1/vendor/autocfg/README.md b/bash-5.1/vendor/autocfg/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8c95696cd5b326a7bc9e156c36108fe13c33ab5a --- /dev/null +++ b/bash-5.1/vendor/autocfg/README.md @@ -0,0 +1,95 @@ +autocfg +======= + +[![autocfg crate](https://img.shields.io/crates/v/autocfg.svg)](https://crates.io/crates/autocfg) +[![autocfg documentation](https://docs.rs/autocfg/badge.svg)](https://docs.rs/autocfg) +![minimum rustc 1.0](https://img.shields.io/badge/rustc-1.0+-red.svg) +![build status](https://github.com/cuviper/autocfg/workflows/master/badge.svg) + +A Rust library for build scripts to automatically configure code based on +compiler support. Code snippets are dynamically tested to see if the `rustc` +will accept them, rather than hard-coding specific version support. + + +## Usage + +Add this to your `Cargo.toml`: + +```toml +[build-dependencies] +autocfg = "1" +``` + +Then use it in your `build.rs` script to detect compiler features. For +example, to test for 128-bit integer support, it might look like: + +```rust +extern crate autocfg; + +fn main() { + let ac = autocfg::new(); + ac.emit_has_type("i128"); + + // (optional) We don't need to rerun for anything external. + autocfg::rerun_path("build.rs"); +} +``` + +If the type test succeeds, this will write a `cargo:rustc-cfg=has_i128` line +for Cargo, which translates to Rust arguments `--cfg has_i128`. Then in the +rest of your Rust code, you can add `#[cfg(has_i128)]` conditions on code that +should only be used when the compiler supports it. + + +## Release Notes + +- 1.1.0 (2022-02-07) + - Use `CARGO_ENCODED_RUSTFLAGS` when it is set. + +- 1.0.1 (2020-08-20) + - Apply `RUSTFLAGS` for more `--target` scenarios, by @adamreichold. + +- 1.0.0 (2020-01-08) + - 🎉 Release 1.0! 🎉 (no breaking changes) + - Add `probe_expression` and `emit_expression_cfg` to test arbitrary expressions. + - Add `probe_constant` and `emit_constant_cfg` to test arbitrary constant expressions. + +- 0.1.7 (2019-10-20) + - Apply `RUSTFLAGS` when probing `$TARGET != $HOST`, mainly for sysroot, by @roblabla. + +- 0.1.6 (2019-08-19) + - Add `probe`/`emit_sysroot_crate`, by @leo60228. + +- 0.1.5 (2019-07-16) + - Mask some warnings from newer rustc. + +- 0.1.4 (2019-05-22) + - Relax `std`/`no_std` probing to a warning instead of an error. + - Improve `rustc` bootstrap compatibility. + +- 0.1.3 (2019-05-21) + - Auto-detects if `#![no_std]` is needed for the `$TARGET`. + +- 0.1.2 (2019-01-16) + - Add `rerun_env(ENV)` to print `cargo:rerun-if-env-changed=ENV`. + - Add `rerun_path(PATH)` to print `cargo:rerun-if-changed=PATH`. + + +## Minimum Rust version policy + +This crate's minimum supported `rustc` version is `1.0.0`. Compatibility is +its entire reason for existence, so this crate will be extremely conservative +about raising this requirement. If this is ever deemed necessary, it will be +treated as a major breaking change for semver purposes. + + +## License + +This project is licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. diff --git a/bash-5.1/vendor/autocfg/examples/integers.rs b/bash-5.1/vendor/autocfg/examples/integers.rs new file mode 100644 index 0000000000000000000000000000000000000000..23d4cba6ee3e96e8ee90d701d035478a73841ecc --- /dev/null +++ b/bash-5.1/vendor/autocfg/examples/integers.rs @@ -0,0 +1,9 @@ +extern crate autocfg; + +fn main() { + // Normally, cargo will set `OUT_DIR` for build scripts. + let ac = autocfg::AutoCfg::with_dir("target").unwrap(); + for i in 3..8 { + ac.emit_has_type(&format!("i{}", 1 << i)); + } +} diff --git a/bash-5.1/vendor/autocfg/examples/paths.rs b/bash-5.1/vendor/autocfg/examples/paths.rs new file mode 100644 index 0000000000000000000000000000000000000000..b7a6ca7a25f7b35ae2e535ccc16cc1a53339f90f --- /dev/null +++ b/bash-5.1/vendor/autocfg/examples/paths.rs @@ -0,0 +1,22 @@ +extern crate autocfg; + +fn main() { + // Normally, cargo will set `OUT_DIR` for build scripts. + let ac = autocfg::AutoCfg::with_dir("target").unwrap(); + + // since ancient times... + ac.emit_has_path("std::vec::Vec"); + ac.emit_path_cfg("std::vec::Vec", "has_vec"); + + // rustc 1.10.0 + ac.emit_has_path("std::panic::PanicInfo"); + ac.emit_path_cfg("std::panic::PanicInfo", "has_panic_info"); + + // rustc 1.20.0 + ac.emit_has_path("std::mem::ManuallyDrop"); + ac.emit_path_cfg("std::mem::ManuallyDrop", "has_manually_drop"); + + // rustc 1.25.0 + ac.emit_has_path("std::ptr::NonNull"); + ac.emit_path_cfg("std::ptr::NonNull", "has_non_null"); +} diff --git a/bash-5.1/vendor/autocfg/examples/traits.rs b/bash-5.1/vendor/autocfg/examples/traits.rs new file mode 100644 index 0000000000000000000000000000000000000000..c1ca00385cd403b9fa0bcca1f8c746d419ed22ce --- /dev/null +++ b/bash-5.1/vendor/autocfg/examples/traits.rs @@ -0,0 +1,26 @@ +extern crate autocfg; + +fn main() { + // Normally, cargo will set `OUT_DIR` for build scripts. + let ac = autocfg::AutoCfg::with_dir("target").unwrap(); + + // since ancient times... + ac.emit_has_trait("std::ops::Add"); + ac.emit_trait_cfg("std::ops::Add", "has_ops"); + + // trait parameters have to be provided + ac.emit_has_trait("std::borrow::Borrow"); + ac.emit_trait_cfg("std::borrow::Borrow", "has_borrow"); + + // rustc 1.8.0 + ac.emit_has_trait("std::ops::AddAssign"); + ac.emit_trait_cfg("std::ops::AddAssign", "has_assign_ops"); + + // rustc 1.12.0 + ac.emit_has_trait("std::iter::Sum"); + ac.emit_trait_cfg("std::iter::Sum", "has_sum"); + + // rustc 1.28.0 + ac.emit_has_trait("std::alloc::GlobalAlloc"); + ac.emit_trait_cfg("std::alloc::GlobalAlloc", "has_global_alloc"); +} diff --git a/bash-5.1/vendor/autocfg/examples/versions.rs b/bash-5.1/vendor/autocfg/examples/versions.rs new file mode 100644 index 0000000000000000000000000000000000000000..992919b7c642806e52ae35db49a9b3e3dd787ace --- /dev/null +++ b/bash-5.1/vendor/autocfg/examples/versions.rs @@ -0,0 +1,9 @@ +extern crate autocfg; + +fn main() { + // Normally, cargo will set `OUT_DIR` for build scripts. + let ac = autocfg::AutoCfg::with_dir("target").unwrap(); + for i in 0..100 { + ac.emit_rustc_version(1, i); + } +} diff --git a/bash-5.1/vendor/autocfg/src/error.rs b/bash-5.1/vendor/autocfg/src/error.rs new file mode 100644 index 0000000000000000000000000000000000000000..4624835451b05ce906f295546fb198481042abd9 --- /dev/null +++ b/bash-5.1/vendor/autocfg/src/error.rs @@ -0,0 +1,69 @@ +use std::error; +use std::fmt; +use std::io; +use std::num; +use std::str; + +/// A common error type for the `autocfg` crate. +#[derive(Debug)] +pub struct Error { + kind: ErrorKind, +} + +impl error::Error for Error { + fn description(&self) -> &str { + "AutoCfg error" + } + + fn cause(&self) -> Option<&error::Error> { + match self.kind { + ErrorKind::Io(ref e) => Some(e), + ErrorKind::Num(ref e) => Some(e), + ErrorKind::Utf8(ref e) => Some(e), + ErrorKind::Other(_) => None, + } + } +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match self.kind { + ErrorKind::Io(ref e) => e.fmt(f), + ErrorKind::Num(ref e) => e.fmt(f), + ErrorKind::Utf8(ref e) => e.fmt(f), + ErrorKind::Other(s) => s.fmt(f), + } + } +} + +#[derive(Debug)] +enum ErrorKind { + Io(io::Error), + Num(num::ParseIntError), + Utf8(str::Utf8Error), + Other(&'static str), +} + +pub fn from_io(e: io::Error) -> Error { + Error { + kind: ErrorKind::Io(e), + } +} + +pub fn from_num(e: num::ParseIntError) -> Error { + Error { + kind: ErrorKind::Num(e), + } +} + +pub fn from_utf8(e: str::Utf8Error) -> Error { + Error { + kind: ErrorKind::Utf8(e), + } +} + +pub fn from_str(s: &'static str) -> Error { + Error { + kind: ErrorKind::Other(s), + } +} diff --git a/bash-5.1/vendor/autocfg/src/lib.rs b/bash-5.1/vendor/autocfg/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..cbe393a9b1ba71f3656a183544559cdac2255105 --- /dev/null +++ b/bash-5.1/vendor/autocfg/src/lib.rs @@ -0,0 +1,453 @@ +//! A Rust library for build scripts to automatically configure code based on +//! compiler support. Code snippets are dynamically tested to see if the `rustc` +//! will accept them, rather than hard-coding specific version support. +//! +//! +//! ## Usage +//! +//! Add this to your `Cargo.toml`: +//! +//! ```toml +//! [build-dependencies] +//! autocfg = "1" +//! ``` +//! +//! Then use it in your `build.rs` script to detect compiler features. For +//! example, to test for 128-bit integer support, it might look like: +//! +//! ```rust +//! extern crate autocfg; +//! +//! fn main() { +//! # // Normally, cargo will set `OUT_DIR` for build scripts. +//! # std::env::set_var("OUT_DIR", "target"); +//! let ac = autocfg::new(); +//! ac.emit_has_type("i128"); +//! +//! // (optional) We don't need to rerun for anything external. +//! autocfg::rerun_path("build.rs"); +//! } +//! ``` +//! +//! If the type test succeeds, this will write a `cargo:rustc-cfg=has_i128` line +//! for Cargo, which translates to Rust arguments `--cfg has_i128`. Then in the +//! rest of your Rust code, you can add `#[cfg(has_i128)]` conditions on code that +//! should only be used when the compiler supports it. +//! +//! ## Caution +//! +//! Many of the probing methods of `AutoCfg` document the particular template they +//! use, **subject to change**. The inputs are not validated to make sure they are +//! semantically correct for their expected use, so it's _possible_ to escape and +//! inject something unintended. However, such abuse is unsupported and will not +//! be considered when making changes to the templates. + +#![deny(missing_debug_implementations)] +#![deny(missing_docs)] +// allow future warnings that can't be fixed while keeping 1.0 compatibility +#![allow(unknown_lints)] +#![allow(bare_trait_objects)] +#![allow(ellipsis_inclusive_range_patterns)] + +/// Local macro to avoid `std::try!`, deprecated in Rust 1.39. +macro_rules! try { + ($result:expr) => { + match $result { + Ok(value) => value, + Err(error) => return Err(error), + } + }; +} + +use std::env; +use std::ffi::OsString; +use std::fs; +use std::io::{stderr, Write}; +use std::path::{Path, PathBuf}; +use std::process::{Command, Stdio}; +#[allow(deprecated)] +use std::sync::atomic::ATOMIC_USIZE_INIT; +use std::sync::atomic::{AtomicUsize, Ordering}; + +mod error; +pub use error::Error; + +mod version; +use version::Version; + +#[cfg(test)] +mod tests; + +/// Helper to detect compiler features for `cfg` output in build scripts. +#[derive(Clone, Debug)] +pub struct AutoCfg { + out_dir: PathBuf, + rustc: PathBuf, + rustc_version: Version, + target: Option, + no_std: bool, + rustflags: Vec, +} + +/// Writes a config flag for rustc on standard out. +/// +/// This looks like: `cargo:rustc-cfg=CFG` +/// +/// Cargo will use this in arguments to rustc, like `--cfg CFG`. +pub fn emit(cfg: &str) { + println!("cargo:rustc-cfg={}", cfg); +} + +/// Writes a line telling Cargo to rerun the build script if `path` changes. +/// +/// This looks like: `cargo:rerun-if-changed=PATH` +/// +/// This requires at least cargo 0.7.0, corresponding to rustc 1.6.0. Earlier +/// versions of cargo will simply ignore the directive. +pub fn rerun_path(path: &str) { + println!("cargo:rerun-if-changed={}", path); +} + +/// Writes a line telling Cargo to rerun the build script if the environment +/// variable `var` changes. +/// +/// This looks like: `cargo:rerun-if-env-changed=VAR` +/// +/// This requires at least cargo 0.21.0, corresponding to rustc 1.20.0. Earlier +/// versions of cargo will simply ignore the directive. +pub fn rerun_env(var: &str) { + println!("cargo:rerun-if-env-changed={}", var); +} + +/// Create a new `AutoCfg` instance. +/// +/// # Panics +/// +/// Panics if `AutoCfg::new()` returns an error. +pub fn new() -> AutoCfg { + AutoCfg::new().unwrap() +} + +impl AutoCfg { + /// Create a new `AutoCfg` instance. + /// + /// # Common errors + /// + /// - `rustc` can't be executed, from `RUSTC` or in the `PATH`. + /// - The version output from `rustc` can't be parsed. + /// - `OUT_DIR` is not set in the environment, or is not a writable directory. + /// + pub fn new() -> Result { + match env::var_os("OUT_DIR") { + Some(d) => Self::with_dir(d), + None => Err(error::from_str("no OUT_DIR specified!")), + } + } + + /// Create a new `AutoCfg` instance with the specified output directory. + /// + /// # Common errors + /// + /// - `rustc` can't be executed, from `RUSTC` or in the `PATH`. + /// - The version output from `rustc` can't be parsed. + /// - `dir` is not a writable directory. + /// + pub fn with_dir>(dir: T) -> Result { + let rustc = env::var_os("RUSTC").unwrap_or_else(|| "rustc".into()); + let rustc: PathBuf = rustc.into(); + let rustc_version = try!(Version::from_rustc(&rustc)); + + let target = env::var_os("TARGET"); + + // Sanity check the output directory + let dir = dir.into(); + let meta = try!(fs::metadata(&dir).map_err(error::from_io)); + if !meta.is_dir() || meta.permissions().readonly() { + return Err(error::from_str("output path is not a writable directory")); + } + + let mut ac = AutoCfg { + rustflags: rustflags(&target, &dir), + out_dir: dir, + rustc: rustc, + rustc_version: rustc_version, + target: target, + no_std: false, + }; + + // Sanity check with and without `std`. + if !ac.probe("").unwrap_or(false) { + ac.no_std = true; + if !ac.probe("").unwrap_or(false) { + // Neither worked, so assume nothing... + ac.no_std = false; + let warning = b"warning: autocfg could not probe for `std`\n"; + stderr().write_all(warning).ok(); + } + } + Ok(ac) + } + + /// Test whether the current `rustc` reports a version greater than + /// or equal to "`major`.`minor`". + pub fn probe_rustc_version(&self, major: usize, minor: usize) -> bool { + self.rustc_version >= Version::new(major, minor, 0) + } + + /// Sets a `cfg` value of the form `rustc_major_minor`, like `rustc_1_29`, + /// if the current `rustc` is at least that version. + pub fn emit_rustc_version(&self, major: usize, minor: usize) { + if self.probe_rustc_version(major, minor) { + emit(&format!("rustc_{}_{}", major, minor)); + } + } + + fn probe>(&self, code: T) -> Result { + #[allow(deprecated)] + static ID: AtomicUsize = ATOMIC_USIZE_INIT; + + let id = ID.fetch_add(1, Ordering::Relaxed); + let mut command = Command::new(&self.rustc); + command + .arg("--crate-name") + .arg(format!("probe{}", id)) + .arg("--crate-type=lib") + .arg("--out-dir") + .arg(&self.out_dir) + .arg("--emit=llvm-ir"); + + if let Some(target) = self.target.as_ref() { + command.arg("--target").arg(target); + } + + command.args(&self.rustflags); + + command.arg("-").stdin(Stdio::piped()); + let mut child = try!(command.spawn().map_err(error::from_io)); + let mut stdin = child.stdin.take().expect("rustc stdin"); + + if self.no_std { + try!(stdin.write_all(b"#![no_std]\n").map_err(error::from_io)); + } + try!(stdin.write_all(code.as_ref()).map_err(error::from_io)); + drop(stdin); + + let status = try!(child.wait().map_err(error::from_io)); + Ok(status.success()) + } + + /// Tests whether the given sysroot crate can be used. + /// + /// The test code is subject to change, but currently looks like: + /// + /// ```ignore + /// extern crate CRATE as probe; + /// ``` + pub fn probe_sysroot_crate(&self, name: &str) -> bool { + self.probe(format!("extern crate {} as probe;", name)) // `as _` wasn't stabilized until Rust 1.33 + .unwrap_or(false) + } + + /// Emits a config value `has_CRATE` if `probe_sysroot_crate` returns true. + pub fn emit_sysroot_crate(&self, name: &str) { + if self.probe_sysroot_crate(name) { + emit(&format!("has_{}", mangle(name))); + } + } + + /// Tests whether the given path can be used. + /// + /// The test code is subject to change, but currently looks like: + /// + /// ```ignore + /// pub use PATH; + /// ``` + pub fn probe_path(&self, path: &str) -> bool { + self.probe(format!("pub use {};", path)).unwrap_or(false) + } + + /// Emits a config value `has_PATH` if `probe_path` returns true. + /// + /// Any non-identifier characters in the `path` will be replaced with + /// `_` in the generated config value. + pub fn emit_has_path(&self, path: &str) { + if self.probe_path(path) { + emit(&format!("has_{}", mangle(path))); + } + } + + /// Emits the given `cfg` value if `probe_path` returns true. + pub fn emit_path_cfg(&self, path: &str, cfg: &str) { + if self.probe_path(path) { + emit(cfg); + } + } + + /// Tests whether the given trait can be used. + /// + /// The test code is subject to change, but currently looks like: + /// + /// ```ignore + /// pub trait Probe: TRAIT + Sized {} + /// ``` + pub fn probe_trait(&self, name: &str) -> bool { + self.probe(format!("pub trait Probe: {} + Sized {{}}", name)) + .unwrap_or(false) + } + + /// Emits a config value `has_TRAIT` if `probe_trait` returns true. + /// + /// Any non-identifier characters in the trait `name` will be replaced with + /// `_` in the generated config value. + pub fn emit_has_trait(&self, name: &str) { + if self.probe_trait(name) { + emit(&format!("has_{}", mangle(name))); + } + } + + /// Emits the given `cfg` value if `probe_trait` returns true. + pub fn emit_trait_cfg(&self, name: &str, cfg: &str) { + if self.probe_trait(name) { + emit(cfg); + } + } + + /// Tests whether the given type can be used. + /// + /// The test code is subject to change, but currently looks like: + /// + /// ```ignore + /// pub type Probe = TYPE; + /// ``` + pub fn probe_type(&self, name: &str) -> bool { + self.probe(format!("pub type Probe = {};", name)) + .unwrap_or(false) + } + + /// Emits a config value `has_TYPE` if `probe_type` returns true. + /// + /// Any non-identifier characters in the type `name` will be replaced with + /// `_` in the generated config value. + pub fn emit_has_type(&self, name: &str) { + if self.probe_type(name) { + emit(&format!("has_{}", mangle(name))); + } + } + + /// Emits the given `cfg` value if `probe_type` returns true. + pub fn emit_type_cfg(&self, name: &str, cfg: &str) { + if self.probe_type(name) { + emit(cfg); + } + } + + /// Tests whether the given expression can be used. + /// + /// The test code is subject to change, but currently looks like: + /// + /// ```ignore + /// pub fn probe() { let _ = EXPR; } + /// ``` + pub fn probe_expression(&self, expr: &str) -> bool { + self.probe(format!("pub fn probe() {{ let _ = {}; }}", expr)) + .unwrap_or(false) + } + + /// Emits the given `cfg` value if `probe_expression` returns true. + pub fn emit_expression_cfg(&self, expr: &str, cfg: &str) { + if self.probe_expression(expr) { + emit(cfg); + } + } + + /// Tests whether the given constant expression can be used. + /// + /// The test code is subject to change, but currently looks like: + /// + /// ```ignore + /// pub const PROBE: () = ((), EXPR).0; + /// ``` + pub fn probe_constant(&self, expr: &str) -> bool { + self.probe(format!("pub const PROBE: () = ((), {}).0;", expr)) + .unwrap_or(false) + } + + /// Emits the given `cfg` value if `probe_constant` returns true. + pub fn emit_constant_cfg(&self, expr: &str, cfg: &str) { + if self.probe_constant(expr) { + emit(cfg); + } + } +} + +fn mangle(s: &str) -> String { + s.chars() + .map(|c| match c { + 'A'...'Z' | 'a'...'z' | '0'...'9' => c, + _ => '_', + }) + .collect() +} + +fn dir_contains_target( + target: &Option, + dir: &Path, + cargo_target_dir: Option, +) -> bool { + target + .as_ref() + .and_then(|target| { + dir.to_str().and_then(|dir| { + let mut cargo_target_dir = cargo_target_dir + .map(PathBuf::from) + .unwrap_or_else(|| PathBuf::from("target")); + cargo_target_dir.push(target); + + cargo_target_dir + .to_str() + .map(|cargo_target_dir| dir.contains(&cargo_target_dir)) + }) + }) + .unwrap_or(false) +} + +fn rustflags(target: &Option, dir: &Path) -> Vec { + // Starting with rust-lang/cargo#9601, shipped in Rust 1.55, Cargo always sets + // CARGO_ENCODED_RUSTFLAGS for any host/target build script invocation. This + // includes any source of flags, whether from the environment, toml config, or + // whatever may come in the future. The value is either an empty string, or a + // list of arguments separated by the ASCII unit separator (US), 0x1f. + if let Ok(a) = env::var("CARGO_ENCODED_RUSTFLAGS") { + return if a.is_empty() { + Vec::new() + } else { + a.split('\x1f').map(str::to_string).collect() + }; + } + + // Otherwise, we have to take a more heuristic approach, and we don't + // support values from toml config at all. + // + // Cargo only applies RUSTFLAGS for building TARGET artifact in + // cross-compilation environment. Sadly, we don't have a way to detect + // when we're building HOST artifact in a cross-compilation environment, + // so for now we only apply RUSTFLAGS when cross-compiling an artifact. + // + // See https://github.com/cuviper/autocfg/pull/10#issuecomment-527575030. + if *target != env::var_os("HOST") + || dir_contains_target(target, dir, env::var_os("CARGO_TARGET_DIR")) + { + if let Ok(rustflags) = env::var("RUSTFLAGS") { + // This is meant to match how cargo handles the RUSTFLAGS environment variable. + // See https://github.com/rust-lang/cargo/blob/69aea5b6f69add7c51cca939a79644080c0b0ba0/src/cargo/core/compiler/build_context/target_info.rs#L434-L441 + return rustflags + .split(' ') + .map(str::trim) + .filter(|s| !s.is_empty()) + .map(str::to_string) + .collect(); + } + } + + Vec::new() +} diff --git a/bash-5.1/vendor/autocfg/src/tests.rs b/bash-5.1/vendor/autocfg/src/tests.rs new file mode 100644 index 0000000000000000000000000000000000000000..d3b1fbb9e9d330ddc4e785133bf1cbc939366a22 --- /dev/null +++ b/bash-5.1/vendor/autocfg/src/tests.rs @@ -0,0 +1,174 @@ +use super::AutoCfg; +use std::env; +use std::path::Path; + +impl AutoCfg { + fn core_std(&self, path: &str) -> String { + let krate = if self.no_std { "core" } else { "std" }; + format!("{}::{}", krate, path) + } + + fn assert_std(&self, probe_result: bool) { + assert_eq!(!self.no_std, probe_result); + } + + fn assert_min(&self, major: usize, minor: usize, probe_result: bool) { + assert_eq!(self.probe_rustc_version(major, minor), probe_result); + } + + fn for_test() -> Result { + match env::var_os("TESTS_TARGET_DIR") { + Some(d) => Self::with_dir(d), + None => Self::with_dir("target"), + } + } +} + +#[test] +fn autocfg_version() { + let ac = AutoCfg::for_test().unwrap(); + println!("version: {:?}", ac.rustc_version); + assert!(ac.probe_rustc_version(1, 0)); +} + +#[test] +fn version_cmp() { + use super::version::Version; + let v123 = Version::new(1, 2, 3); + + assert!(Version::new(1, 0, 0) < v123); + assert!(Version::new(1, 2, 2) < v123); + assert!(Version::new(1, 2, 3) == v123); + assert!(Version::new(1, 2, 4) > v123); + assert!(Version::new(1, 10, 0) > v123); + assert!(Version::new(2, 0, 0) > v123); +} + +#[test] +fn probe_add() { + let ac = AutoCfg::for_test().unwrap(); + let add = ac.core_std("ops::Add"); + let add_rhs = add.clone() + ""; + let add_rhs_output = add.clone() + ""; + let dyn_add_rhs_output = "dyn ".to_string() + &*add_rhs_output; + assert!(ac.probe_path(&add)); + assert!(ac.probe_trait(&add)); + assert!(ac.probe_trait(&add_rhs)); + assert!(ac.probe_trait(&add_rhs_output)); + ac.assert_min(1, 27, ac.probe_type(&dyn_add_rhs_output)); +} + +#[test] +fn probe_as_ref() { + let ac = AutoCfg::for_test().unwrap(); + let as_ref = ac.core_std("convert::AsRef"); + let as_ref_str = as_ref.clone() + ""; + let dyn_as_ref_str = "dyn ".to_string() + &*as_ref_str; + assert!(ac.probe_path(&as_ref)); + assert!(ac.probe_trait(&as_ref_str)); + assert!(ac.probe_type(&as_ref_str)); + ac.assert_min(1, 27, ac.probe_type(&dyn_as_ref_str)); +} + +#[test] +fn probe_i128() { + let ac = AutoCfg::for_test().unwrap(); + let i128_path = ac.core_std("i128"); + ac.assert_min(1, 26, ac.probe_path(&i128_path)); + ac.assert_min(1, 26, ac.probe_type("i128")); +} + +#[test] +fn probe_sum() { + let ac = AutoCfg::for_test().unwrap(); + let sum = ac.core_std("iter::Sum"); + let sum_i32 = sum.clone() + ""; + let dyn_sum_i32 = "dyn ".to_string() + &*sum_i32; + ac.assert_min(1, 12, ac.probe_path(&sum)); + ac.assert_min(1, 12, ac.probe_trait(&sum)); + ac.assert_min(1, 12, ac.probe_trait(&sum_i32)); + ac.assert_min(1, 12, ac.probe_type(&sum_i32)); + ac.assert_min(1, 27, ac.probe_type(&dyn_sum_i32)); +} + +#[test] +fn probe_std() { + let ac = AutoCfg::for_test().unwrap(); + ac.assert_std(ac.probe_sysroot_crate("std")); +} + +#[test] +fn probe_alloc() { + let ac = AutoCfg::for_test().unwrap(); + ac.assert_min(1, 36, ac.probe_sysroot_crate("alloc")); +} + +#[test] +fn probe_bad_sysroot_crate() { + let ac = AutoCfg::for_test().unwrap(); + assert!(!ac.probe_sysroot_crate("doesnt_exist")); +} + +#[test] +fn probe_no_std() { + let ac = AutoCfg::for_test().unwrap(); + assert!(ac.probe_type("i32")); + assert!(ac.probe_type("[i32]")); + ac.assert_std(ac.probe_type("Vec")); +} + +#[test] +fn probe_expression() { + let ac = AutoCfg::for_test().unwrap(); + assert!(ac.probe_expression(r#""test".trim_left()"#)); + ac.assert_min(1, 30, ac.probe_expression(r#""test".trim_start()"#)); + ac.assert_std(ac.probe_expression("[1, 2, 3].to_vec()")); +} + +#[test] +fn probe_constant() { + let ac = AutoCfg::for_test().unwrap(); + assert!(ac.probe_constant("1 + 2 + 3")); + ac.assert_min(1, 33, ac.probe_constant("{ let x = 1 + 2 + 3; x * x }")); + ac.assert_min(1, 39, ac.probe_constant(r#""test".len()"#)); +} + +#[test] +fn dir_does_not_contain_target() { + assert!(!super::dir_contains_target( + &Some("x86_64-unknown-linux-gnu".into()), + Path::new("/project/target/debug/build/project-ea75983148559682/out"), + None, + )); +} + +#[test] +fn dir_does_contain_target() { + assert!(super::dir_contains_target( + &Some("x86_64-unknown-linux-gnu".into()), + Path::new( + "/project/target/x86_64-unknown-linux-gnu/debug/build/project-0147aca016480b9d/out" + ), + None, + )); +} + +#[test] +fn dir_does_not_contain_target_with_custom_target_dir() { + assert!(!super::dir_contains_target( + &Some("x86_64-unknown-linux-gnu".into()), + Path::new("/project/custom/debug/build/project-ea75983148559682/out"), + Some("custom".into()), + )); +} + +#[test] +fn dir_does_contain_target_with_custom_target_dir() { + assert!(super::dir_contains_target( + &Some("x86_64-unknown-linux-gnu".into()), + Path::new( + "/project/custom/x86_64-unknown-linux-gnu/debug/build/project-0147aca016480b9d/out" + ), + Some("custom".into()), + )); +} diff --git a/bash-5.1/vendor/autocfg/src/version.rs b/bash-5.1/vendor/autocfg/src/version.rs new file mode 100644 index 0000000000000000000000000000000000000000..378c21e61e0cdc15253124e63d20503f599b679e --- /dev/null +++ b/bash-5.1/vendor/autocfg/src/version.rs @@ -0,0 +1,60 @@ +use std::path::Path; +use std::process::Command; +use std::str; + +use super::{error, Error}; + +/// A version structure for making relative comparisons. +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +pub struct Version { + major: usize, + minor: usize, + patch: usize, +} + +impl Version { + /// Creates a `Version` instance for a specific `major.minor.patch` version. + pub fn new(major: usize, minor: usize, patch: usize) -> Self { + Version { + major: major, + minor: minor, + patch: patch, + } + } + + pub fn from_rustc(rustc: &Path) -> Result { + // Get rustc's verbose version + let output = try!(Command::new(rustc) + .args(&["--version", "--verbose"]) + .output() + .map_err(error::from_io)); + if !output.status.success() { + return Err(error::from_str("could not execute rustc")); + } + let output = try!(str::from_utf8(&output.stdout).map_err(error::from_utf8)); + + // Find the release line in the verbose version output. + let release = match output.lines().find(|line| line.starts_with("release: ")) { + Some(line) => &line["release: ".len()..], + None => return Err(error::from_str("could not find rustc release")), + }; + + // Strip off any extra channel info, e.g. "-beta.N", "-nightly" + let version = match release.find('-') { + Some(i) => &release[..i], + None => release, + }; + + // Split the version into semver components. + let mut iter = version.splitn(3, '.'); + let major = try!(iter.next().ok_or(error::from_str("missing major version"))); + let minor = try!(iter.next().ok_or(error::from_str("missing minor version"))); + let patch = try!(iter.next().ok_or(error::from_str("missing patch version"))); + + Ok(Version::new( + try!(major.parse().map_err(error::from_num)), + try!(minor.parse().map_err(error::from_num)), + try!(patch.parse().map_err(error::from_num)), + )) + } +} diff --git a/bash-5.1/vendor/autocfg/tests/rustflags.rs b/bash-5.1/vendor/autocfg/tests/rustflags.rs new file mode 100644 index 0000000000000000000000000000000000000000..f0545466811854e323e604cdd923203167b88af1 --- /dev/null +++ b/bash-5.1/vendor/autocfg/tests/rustflags.rs @@ -0,0 +1,33 @@ +extern crate autocfg; + +use std::env; + +/// Tests that autocfg uses the RUSTFLAGS or CARGO_ENCODED_RUSTFLAGS +/// environment variables when running rustc. +#[test] +fn test_with_sysroot() { + // Use the same path as this test binary. + let dir = env::current_exe().unwrap().parent().unwrap().to_path_buf(); + env::set_var("OUT_DIR", &format!("{}", dir.display())); + + // If we have encoded rustflags, they take precedence, even if empty. + env::set_var("CARGO_ENCODED_RUSTFLAGS", ""); + env::set_var("RUSTFLAGS", &format!("-L {}", dir.display())); + let ac = autocfg::AutoCfg::new().unwrap(); + assert!(ac.probe_sysroot_crate("std")); + assert!(!ac.probe_sysroot_crate("autocfg")); + + // Now try again with useful encoded args. + env::set_var( + "CARGO_ENCODED_RUSTFLAGS", + &format!("-L\x1f{}", dir.display()), + ); + let ac = autocfg::AutoCfg::new().unwrap(); + assert!(ac.probe_sysroot_crate("autocfg")); + + // Try the old-style RUSTFLAGS, ensuring HOST != TARGET. + env::remove_var("CARGO_ENCODED_RUSTFLAGS"); + env::set_var("HOST", "lol"); + let ac = autocfg::AutoCfg::new().unwrap(); + assert!(ac.probe_sysroot_crate("autocfg")); +} diff --git a/bash-5.1/vendor/bitflags/.cargo-checksum.json b/bash-5.1/vendor/bitflags/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..7e8d470b53a37c400c9a9a9fc5e8acf076d0d950 --- /dev/null +++ b/bash-5.1/vendor/bitflags/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"d362fc1fccaaf4d421bcf0fe8b80ddb4f625dade0c1ee52d08bd0b95509a49d1","CODE_OF_CONDUCT.md":"42634d0f6d922f49857175af991802822f7f920487aefa2ee250a50d12251a66","Cargo.toml":"87aced7532a7974eb37ab5fe6037f0abafc36d6b2d74891ecd2bf2f14f50d11e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"baa8604f8afb34fd93b9c79729daafb884dedcaf34023e4af8ad037d916061fd","src/example_generated.rs":"e43eb59e90f317f38d436670a6067d2fd9eb35fb319fe716184e4a04e24ed1b2","src/lib.rs":"e6477688535ee326d27238aeedc9cb4320ac35b9d17a4deda09e0587b0ccdbd4","tests/basic.rs":"146f1cbf6279bc609242cd3349f29cb21b41294f5e4921875f5ec95bd83529a2","tests/compile-fail/impls/copy.rs":"b791371237ddc75a7c04d2130e03b462c9c00a80dca08bd45aa97433d9c0d13a","tests/compile-fail/impls/copy.stderr.beta":"77d83484ce221d4b6ff2f7de843929a452d779fcfff428122710dd8218c298e3","tests/compile-fail/impls/eq.rs":"0cee8b9e07d537890e0189710293b53972d0fab63c09366f33c391065afafa99","tests/compile-fail/impls/eq.stderr.beta":"381fc6143d45ce76d7cecc47aa59cb69fe5e79c0b60a4a85d5c6163b400b3cc7","tests/compile-fail/non_integer_base/all_defined.rs":"95e14cad9e94560262f2862c3c01865ac30369b69da1001b0e7285cb55e6cb75","tests/compile-fail/non_integer_base/all_defined.stderr.beta":"1760739a276690903bb03844025587d37939f5dfcbfab309db3c86f32bdbf748","tests/compile-fail/non_integer_base/all_missing.rs":"b3d9da619d23213731ba2581aa7999c796c3c79aaf4f0ee6b11ceec08a11537f","tests/compile-fail/non_integer_base/all_missing.stderr.beta":"37e102290d3867e175b21976be798939f294efb17580d5b51e7b17b590d55132","tests/compile-fail/visibility/private_field.rs":"38e4d3fe6471829360d12c8d09b097f6a21aa93fb51eac3b215d96bdae23316b","tests/compile-fail/visibility/private_field.stderr.beta":"5aa24a3ebb39326f31927721c5017b8beb66c3e501fb865a3fa814c9763bfa0f","tests/compile-fail/visibility/private_flags.rs":"2ce4235802aa4e9c96c4e77d9e31d8401ef58dcda4741325184f0764ab1fe393","tests/compile-fail/visibility/private_flags.stderr.beta":"f3eb9f7baf2689258f3519ff7ee5c6ec3c237264ebcfe63f40c40f2023e5022f","tests/compile-fail/visibility/pub_const.rs":"8f813a97ac518c5ea8ac65b184101912452384afaf7b8d6c5e62f8370eca3c0a","tests/compile-fail/visibility/pub_const.stderr.beta":"823976ae1794d7f5372e2ec9aabba497e7bb88004722904c38da342ed98e8962","tests/compile-pass/impls/convert.rs":"88fe80bfb9cd5779f0e1d92c9ec02a8b6bb67e334c07f2309e9c0ba5ef776eb0","tests/compile-pass/impls/default.rs":"c508f9a461691f44b45142fa5ad599f02326e1de4c0cbca6c0593f4652eba109","tests/compile-pass/impls/inherent_methods.rs":"ecc26388e9a394bfa7a5bb69a5d621ab3d4d1e53f28f657bb8e78fe79f437913","tests/compile-pass/redefinition/core.rs":"ff5b6e72f87acc6ebb12405d3c0f6e3fa62e669933656a454bb63b30ea44179c","tests/compile-pass/redefinition/stringify.rs":"1edbce42b900c14425d7ffa14e83e165ebe452d7dccd8c0a8a821bdec64f5c93","tests/compile-pass/repr/c.rs":"6fda17f7c2edfcd155314579e83d0fc8a16209e400f1f9a5ca77bd9a799041f2","tests/compile-pass/repr/transparent.rs":"6cdc87a2137d8a4e0c8ce9b6cba83c82255f8ea125951bf614418685600489ce","tests/compile-pass/visibility/bits_field.rs":"1f3e5ba5a047440066a9f6bf7b7af33f5b06f6b1da3dd9af6886168199a7ea0a","tests/compile-pass/visibility/pub_in.rs":"e95312ff60966d42ec4bc00225507895a9b8ec24056ce6a9edd9145be35d730f","tests/compile.rs":"f27c67a7dd183ca30efea1b6e0880e3469a6dd63b92b1fd711c082df182c9eec"},"package":"bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"} \ No newline at end of file diff --git a/bash-5.1/vendor/bitflags/CHANGELOG.md b/bash-5.1/vendor/bitflags/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..12fea1673ac30076443b5a2f1ea2aadfabb5aa20 --- /dev/null +++ b/bash-5.1/vendor/bitflags/CHANGELOG.md @@ -0,0 +1,206 @@ +# 1.3.2 + +- Allow `non_snake_case` in generated flags types ([#256]) + +[#252]: https://github.com/bitflags/bitflags/pull/256 + +# 1.3.1 + +- Revert unconditional `#[repr(transparent)]` ([#252]) + +[#252]: https://github.com/bitflags/bitflags/pull/252 + +# 1.3.0 (yanked) + +- Add `#[repr(transparent)]` ([#187]) + +- End `empty` doc comment with full stop ([#202]) + +- Fix typo in crate root docs ([#206]) + +- Document from_bits_unchecked unsafety ([#207]) + +- Let `is_all` ignore extra bits ([#211]) + +- Allows empty flag definition ([#225]) + +- Making crate accessible from std ([#227]) + +- Make `from_bits` a const fn ([#229]) + +- Allow multiple bitflags structs in one macro invocation ([#235]) + +- Add named functions to perform set operations ([#244]) + +- Fix typos in method docs ([#245]) + +- Modernization of the `bitflags` macro to take advantage of newer features and 2018 idioms ([#246]) + +- Fix regression (in an unreleased feature) and simplify tests ([#247]) + +- Use `Self` and fix bug when overriding `stringify!` ([#249]) + +[#187]: https://github.com/bitflags/bitflags/pull/187 +[#202]: https://github.com/bitflags/bitflags/pull/202 +[#206]: https://github.com/bitflags/bitflags/pull/206 +[#207]: https://github.com/bitflags/bitflags/pull/207 +[#211]: https://github.com/bitflags/bitflags/pull/211 +[#225]: https://github.com/bitflags/bitflags/pull/225 +[#227]: https://github.com/bitflags/bitflags/pull/227 +[#229]: https://github.com/bitflags/bitflags/pull/229 +[#235]: https://github.com/bitflags/bitflags/pull/235 +[#244]: https://github.com/bitflags/bitflags/pull/244 +[#245]: https://github.com/bitflags/bitflags/pull/245 +[#246]: https://github.com/bitflags/bitflags/pull/246 +[#247]: https://github.com/bitflags/bitflags/pull/247 +[#249]: https://github.com/bitflags/bitflags/pull/249 + +# 1.2.1 + +- Remove extraneous `#[inline]` attributes ([#194]) + +[#194]: https://github.com/bitflags/bitflags/pull/194 + +# 1.2.0 + +- Fix typo: {Lower, Upper}Exp - {Lower, Upper}Hex ([#183]) + +- Add support for "unknown" bits ([#188]) + +[#183]: https://github.com/rust-lang-nursery/bitflags/pull/183 +[#188]: https://github.com/rust-lang-nursery/bitflags/pull/188 + +# 1.1.0 + +This is a re-release of `1.0.5`, which was yanked due to a bug in the RLS. + +# 1.0.5 + +- Use compiletest_rs flags supported by stable toolchain ([#171]) + +- Put the user provided attributes first ([#173]) + +- Make bitflags methods `const` on newer compilers ([#175]) + +[#171]: https://github.com/rust-lang-nursery/bitflags/pull/171 +[#173]: https://github.com/rust-lang-nursery/bitflags/pull/173 +[#175]: https://github.com/rust-lang-nursery/bitflags/pull/175 + +# 1.0.4 + +- Support Rust 2018 style macro imports ([#165]) + + ```rust + use bitflags::bitflags; + ``` + +[#165]: https://github.com/rust-lang-nursery/bitflags/pull/165 + +# 1.0.3 + +- Improve zero value flag handling and documentation ([#157]) + +[#157]: https://github.com/rust-lang-nursery/bitflags/pull/157 + +# 1.0.2 + +- 30% improvement in compile time of bitflags crate ([#156]) + +- Documentation improvements ([#153]) + +- Implementation cleanup ([#149]) + +[#156]: https://github.com/rust-lang-nursery/bitflags/pull/156 +[#153]: https://github.com/rust-lang-nursery/bitflags/pull/153 +[#149]: https://github.com/rust-lang-nursery/bitflags/pull/149 + +# 1.0.1 +- Add support for `pub(restricted)` specifier on the bitflags struct ([#135]) +- Optimize performance of `all()` when called from a separate crate ([#136]) + +[#135]: https://github.com/rust-lang-nursery/bitflags/pull/135 +[#136]: https://github.com/rust-lang-nursery/bitflags/pull/136 + +# 1.0.0 +- **[breaking change]** Macro now generates [associated constants](https://doc.rust-lang.org/reference/items.html#associated-constants) ([#24]) + +- **[breaking change]** Minimum supported version is Rust **1.20**, due to usage of associated constants + +- After being broken in 0.9, the `#[deprecated]` attribute is now supported again ([#112]) + +- Other improvements to unit tests and documentation ([#106] and [#115]) + +[#24]: https://github.com/rust-lang-nursery/bitflags/pull/24 +[#106]: https://github.com/rust-lang-nursery/bitflags/pull/106 +[#112]: https://github.com/rust-lang-nursery/bitflags/pull/112 +[#115]: https://github.com/rust-lang-nursery/bitflags/pull/115 + +## How to update your code to use associated constants +Assuming the following structure definition: +```rust +bitflags! { + struct Something: u8 { + const FOO = 0b01, + const BAR = 0b10 + } +} +``` +In 0.9 and older you could do: +```rust +let x = FOO.bits | BAR.bits; +``` +Now you must use: +```rust +let x = Something::FOO.bits | Something::BAR.bits; +``` + +# 0.9.1 +- Fix the implementation of `Formatting` traits when other formatting traits were present in scope ([#105]) + +[#105]: https://github.com/rust-lang-nursery/bitflags/pull/105 + +# 0.9.0 +- **[breaking change]** Use struct keyword instead of flags to define bitflag types ([#84]) + +- **[breaking change]** Terminate const items with semicolons instead of commas ([#87]) + +- Implement the `Hex`, `Octal`, and `Binary` formatting traits ([#86]) + +- Printing an empty flag value with the `Debug` trait now prints "(empty)" instead of nothing ([#85]) + +- The `bitflags!` macro can now be used inside of a fn body, to define a type local to that function ([#74]) + +[#74]: https://github.com/rust-lang-nursery/bitflags/pull/74 +[#84]: https://github.com/rust-lang-nursery/bitflags/pull/84 +[#85]: https://github.com/rust-lang-nursery/bitflags/pull/85 +[#86]: https://github.com/rust-lang-nursery/bitflags/pull/86 +[#87]: https://github.com/rust-lang-nursery/bitflags/pull/87 + +# 0.8.2 +- Update feature flag used when building bitflags as a dependency of the Rust toolchain + +# 0.8.1 +- Allow bitflags to be used as a dependency of the Rust toolchain + +# 0.8.0 +- Add support for the experimental `i128` and `u128` integer types ([#57]) +- Add set method: `flags.set(SOME_FLAG, true)` or `flags.set(SOME_FLAG, false)` ([#55]) + This may break code that defines its own set method + +[#55]: https://github.com/rust-lang-nursery/bitflags/pull/55 +[#57]: https://github.com/rust-lang-nursery/bitflags/pull/57 + +# 0.7.1 +*(yanked)* + +# 0.7.0 +- Implement the Extend trait ([#49]) +- Allow definitions inside the `bitflags!` macro to refer to items imported from other modules ([#51]) + +[#49]: https://github.com/rust-lang-nursery/bitflags/pull/49 +[#51]: https://github.com/rust-lang-nursery/bitflags/pull/51 + +# 0.6.0 +- The `no_std` feature was removed as it is now the default +- The `assignment_operators` feature was remove as it is now enabled by default +- Some clippy suggestions have been applied diff --git a/bash-5.1/vendor/bitflags/CODE_OF_CONDUCT.md b/bash-5.1/vendor/bitflags/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000000000000000000000000000000..f7add90ae35556c9230005e0c83110abda5d4d53 --- /dev/null +++ b/bash-5.1/vendor/bitflags/CODE_OF_CONDUCT.md @@ -0,0 +1,73 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at coc@senaite.org. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org \ No newline at end of file diff --git a/bash-5.1/vendor/bitflags/Cargo.toml b/bash-5.1/vendor/bitflags/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..9d54c725a1c5d726c4ed42d666b670c9f5a757e5 --- /dev/null +++ b/bash-5.1/vendor/bitflags/Cargo.toml @@ -0,0 +1,58 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +edition = "2018" +name = "bitflags" +version = "1.3.2" +authors = ["The Rust Project Developers"] +exclude = ["bors.toml"] +description = "A macro to generate structures which behave like bitflags.\n" +homepage = "https://github.com/bitflags/bitflags" +documentation = "https://docs.rs/bitflags" +readme = "README.md" +keywords = ["bit", "bitmask", "bitflags", "flags"] +categories = ["no-std"] +license = "MIT/Apache-2.0" +repository = "https://github.com/bitflags/bitflags" +[package.metadata.docs.rs] +features = ["example_generated"] +[dependencies.compiler_builtins] +version = "0.1.2" +optional = true + +[dependencies.core] +version = "1.0.0" +optional = true +package = "rustc-std-workspace-core" +[dev-dependencies.rustversion] +version = "1.0" + +[dev-dependencies.serde] +version = "1.0" + +[dev-dependencies.serde_derive] +version = "1.0" + +[dev-dependencies.serde_json] +version = "1.0" + +[dev-dependencies.trybuild] +version = "1.0" + +[dev-dependencies.walkdir] +version = "2.3" + +[features] +default = [] +example_generated = [] +rustc-dep-of-std = ["core", "compiler_builtins"] diff --git a/bash-5.1/vendor/bitflags/LICENSE-APACHE b/bash-5.1/vendor/bitflags/LICENSE-APACHE new file mode 100644 index 0000000000000000000000000000000000000000..16fe87b06e802f094b3fbb0894b137bca2b16ef1 --- /dev/null +++ b/bash-5.1/vendor/bitflags/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/bash-5.1/vendor/bitflags/LICENSE-MIT b/bash-5.1/vendor/bitflags/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..39d4bdb5acd313c1a92dbeaa1c379aaf0596a315 --- /dev/null +++ b/bash-5.1/vendor/bitflags/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2014 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/bash-5.1/vendor/bitflags/README.md b/bash-5.1/vendor/bitflags/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0da0f853661b002e2a046fece8a017b01c7966a4 --- /dev/null +++ b/bash-5.1/vendor/bitflags/README.md @@ -0,0 +1,32 @@ +bitflags +======== + +[![Rust](https://github.com/bitflags/bitflags/workflows/Rust/badge.svg)](https://github.com/bitflags/bitflags/actions) +[![Join the chat at https://gitter.im/bitflags/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bitflags/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge) +[![Latest version](https://img.shields.io/crates/v/bitflags.svg)](https://crates.io/crates/bitflags) +[![Documentation](https://docs.rs/bitflags/badge.svg)](https://docs.rs/bitflags) +![License](https://img.shields.io/crates/l/bitflags.svg) + +A Rust macro to generate structures which behave like a set of bitflags + +- [Documentation](https://docs.rs/bitflags) +- [Release notes](https://github.com/bitflags/bitflags/releases) + +## Usage + +Add this to your `Cargo.toml`: + +```toml +[dependencies] +bitflags = "1.3" +``` + +and this to your source code: + +```rust +use bitflags::bitflags; +``` + +## Rust Version Support + +The minimum supported Rust version is 1.46 due to use of associated constants and const functions. diff --git a/bash-5.1/vendor/bitflags/src/example_generated.rs b/bash-5.1/vendor/bitflags/src/example_generated.rs new file mode 100644 index 0000000000000000000000000000000000000000..cf188d99cb4c6cf97eb6c830147199001e5cee9a --- /dev/null +++ b/bash-5.1/vendor/bitflags/src/example_generated.rs @@ -0,0 +1,14 @@ +//! This module shows an example of code generated by the macro. **IT MUST NOT BE USED OUTSIDE THIS +//! CRATE**. + +bitflags! { + /// This is the same `Flags` struct defined in the [crate level example](../index.html#example). + /// Note that this struct is just for documentation purposes only, it must not be used outside + /// this crate. + pub struct Flags: u32 { + const A = 0b00000001; + const B = 0b00000010; + const C = 0b00000100; + const ABC = Self::A.bits | Self::B.bits | Self::C.bits; + } +} diff --git a/bash-5.1/vendor/bitflags/src/lib.rs b/bash-5.1/vendor/bitflags/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..935e432f1701ecb8f462a1045e8c02df67c43b65 --- /dev/null +++ b/bash-5.1/vendor/bitflags/src/lib.rs @@ -0,0 +1,1729 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! A typesafe bitmask flag generator useful for sets of C-style bitmask flags. +//! It can be used for creating typesafe wrappers around C APIs. +//! +//! The `bitflags!` macro generates `struct`s that manage a set of flags. The +//! flags should only be defined for integer types, otherwise unexpected type +//! errors may occur at compile time. +//! +//! # Example +//! +//! ``` +//! use bitflags::bitflags; +//! +//! bitflags! { +//! struct Flags: u32 { +//! const A = 0b00000001; +//! const B = 0b00000010; +//! const C = 0b00000100; +//! const ABC = Self::A.bits | Self::B.bits | Self::C.bits; +//! } +//! } +//! +//! fn main() { +//! let e1 = Flags::A | Flags::C; +//! let e2 = Flags::B | Flags::C; +//! assert_eq!((e1 | e2), Flags::ABC); // union +//! assert_eq!((e1 & e2), Flags::C); // intersection +//! assert_eq!((e1 - e2), Flags::A); // set difference +//! assert_eq!(!e2, Flags::A); // set complement +//! } +//! ``` +//! +//! See [`example_generated::Flags`](./example_generated/struct.Flags.html) for documentation of code +//! generated by the above `bitflags!` expansion. +//! +//! The generated `struct`s can also be extended with type and trait +//! implementations: +//! +//! ``` +//! use std::fmt; +//! +//! use bitflags::bitflags; +//! +//! bitflags! { +//! struct Flags: u32 { +//! const A = 0b00000001; +//! const B = 0b00000010; +//! } +//! } +//! +//! impl Flags { +//! pub fn clear(&mut self) { +//! self.bits = 0; // The `bits` field can be accessed from within the +//! // same module where the `bitflags!` macro was invoked. +//! } +//! } +//! +//! impl fmt::Display for Flags { +//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +//! write!(f, "hi!") +//! } +//! } +//! +//! fn main() { +//! let mut flags = Flags::A | Flags::B; +//! flags.clear(); +//! assert!(flags.is_empty()); +//! assert_eq!(format!("{}", flags), "hi!"); +//! assert_eq!(format!("{:?}", Flags::A | Flags::B), "A | B"); +//! assert_eq!(format!("{:?}", Flags::B), "B"); +//! } +//! ``` +//! +//! # Visibility +//! +//! The generated structs and their associated flag constants are not exported +//! out of the current module by default. A definition can be exported out of +//! the current module by adding `pub` before `struct`: +//! +//! ``` +//! mod example { +//! use bitflags::bitflags; +//! +//! bitflags! { +//! pub struct Flags1: u32 { +//! const A = 0b00000001; +//! } +//! +//! # pub +//! struct Flags2: u32 { +//! const B = 0b00000010; +//! } +//! } +//! } +//! +//! fn main() { +//! let flag1 = example::Flags1::A; +//! let flag2 = example::Flags2::B; // error: const `B` is private +//! } +//! ``` +//! +//! # Attributes +//! +//! Attributes can be attached to the generated `struct`s by placing them +//! before the `struct` keyword. +//! +//! ## Representations +//! +//! It's valid to add a `#[repr(C)]` or `#[repr(transparent)]` attribute to a type +//! generated by `bitflags!`. In these cases, the type is guaranteed to be a newtype. +//! +//! ``` +//! use bitflags::bitflags; +//! +//! bitflags! { +//! #[repr(transparent)] +//! struct Flags: u32 { +//! const A = 0b00000001; +//! const B = 0b00000010; +//! const C = 0b00000100; +//! } +//! } +//! ``` +//! +//! # Trait implementations +//! +//! The `Copy`, `Clone`, `PartialEq`, `Eq`, `PartialOrd`, `Ord` and `Hash` +//! traits are automatically derived for the `struct`s using the `derive` attribute. +//! Additional traits can be derived by providing an explicit `derive` +//! attribute on `struct`. +//! +//! The `Extend` and `FromIterator` traits are implemented for the `struct`s, +//! too: `Extend` adds the union of the instances of the `struct` iterated over, +//! while `FromIterator` calculates the union. +//! +//! The `Binary`, `Debug`, `LowerHex`, `Octal` and `UpperHex` traits are also +//! implemented by displaying the bits value of the internal struct. +//! +//! ## Operators +//! +//! The following operator traits are implemented for the generated `struct`s: +//! +//! - `BitOr` and `BitOrAssign`: union +//! - `BitAnd` and `BitAndAssign`: intersection +//! - `BitXor` and `BitXorAssign`: toggle +//! - `Sub` and `SubAssign`: set difference +//! - `Not`: set complement +//! +//! # Methods +//! +//! The following methods are defined for the generated `struct`s: +//! +//! - `empty`: an empty set of flags +//! - `all`: the set of all defined flags +//! - `bits`: the raw value of the flags currently stored +//! - `from_bits`: convert from underlying bit representation, unless that +//! representation contains bits that do not correspond to a +//! defined flag +//! - `from_bits_truncate`: convert from underlying bit representation, dropping +//! any bits that do not correspond to defined flags +//! - `from_bits_unchecked`: convert from underlying bit representation, keeping +//! all bits (even those not corresponding to defined +//! flags) +//! - `is_empty`: `true` if no flags are currently stored +//! - `is_all`: `true` if currently set flags exactly equal all defined flags +//! - `intersects`: `true` if there are flags common to both `self` and `other` +//! - `contains`: `true` if all of the flags in `other` are contained within `self` +//! - `insert`: inserts the specified flags in-place +//! - `remove`: removes the specified flags in-place +//! - `toggle`: the specified flags will be inserted if not present, and removed +//! if they are. +//! - `set`: inserts or removes the specified flags depending on the passed value +//! - `intersection`: returns a new set of flags, containing only the flags present +//! in both `self` and `other` (the argument to the function). +//! - `union`: returns a new set of flags, containing any flags present in +//! either `self` or `other` (the argument to the function). +//! - `difference`: returns a new set of flags, containing all flags present in +//! `self` without any of the flags present in `other` (the +//! argument to the function). +//! - `symmetric_difference`: returns a new set of flags, containing all flags +//! present in either `self` or `other` (the argument +//! to the function), but not both. +//! - `complement`: returns a new set of flags, containing all flags which are +//! not set in `self`, but which are allowed for this type. +//! +//! ## Default +//! +//! The `Default` trait is not automatically implemented for the generated structs. +//! +//! If your default value is equal to `0` (which is the same value as calling `empty()` +//! on the generated struct), you can simply derive `Default`: +//! +//! ``` +//! use bitflags::bitflags; +//! +//! bitflags! { +//! // Results in default value with bits: 0 +//! #[derive(Default)] +//! struct Flags: u32 { +//! const A = 0b00000001; +//! const B = 0b00000010; +//! const C = 0b00000100; +//! } +//! } +//! +//! fn main() { +//! let derived_default: Flags = Default::default(); +//! assert_eq!(derived_default.bits(), 0); +//! } +//! ``` +//! +//! If your default value is not equal to `0` you need to implement `Default` yourself: +//! +//! ``` +//! use bitflags::bitflags; +//! +//! bitflags! { +//! struct Flags: u32 { +//! const A = 0b00000001; +//! const B = 0b00000010; +//! const C = 0b00000100; +//! } +//! } +//! +//! // explicit `Default` implementation +//! impl Default for Flags { +//! fn default() -> Flags { +//! Flags::A | Flags::C +//! } +//! } +//! +//! fn main() { +//! let implemented_default: Flags = Default::default(); +//! assert_eq!(implemented_default, (Flags::A | Flags::C)); +//! } +//! ``` +//! +//! # Zero Flags +//! +//! Flags with a value equal to zero will have some strange behavior that one should be aware of. +//! +//! ``` +//! use bitflags::bitflags; +//! +//! bitflags! { +//! struct Flags: u32 { +//! const NONE = 0b00000000; +//! const SOME = 0b00000001; +//! } +//! } +//! +//! fn main() { +//! let empty = Flags::empty(); +//! let none = Flags::NONE; +//! let some = Flags::SOME; +//! +//! // Zero flags are treated as always present +//! assert!(empty.contains(Flags::NONE)); +//! assert!(none.contains(Flags::NONE)); +//! assert!(some.contains(Flags::NONE)); +//! +//! // Zero flags will be ignored when testing for emptiness +//! assert!(none.is_empty()); +//! } +//! ``` +//! +//! Users should generally avoid defining a flag with a value of zero. + +#![cfg_attr(not(test), no_std)] +#![doc(html_root_url = "https://docs.rs/bitflags/1.3.2")] + +#[doc(hidden)] +pub extern crate core as _core; + +/// The macro used to generate the flag structures. +/// +/// See the [crate level docs](../bitflags/index.html) for complete documentation. +/// +/// # Example +/// +/// ``` +/// use bitflags::bitflags; +/// +/// bitflags! { +/// struct Flags: u32 { +/// const A = 0b00000001; +/// const B = 0b00000010; +/// const C = 0b00000100; +/// const ABC = Self::A.bits | Self::B.bits | Self::C.bits; +/// } +/// } +/// +/// fn main() { +/// let e1 = Flags::A | Flags::C; +/// let e2 = Flags::B | Flags::C; +/// assert_eq!((e1 | e2), Flags::ABC); // union +/// assert_eq!((e1 & e2), Flags::C); // intersection +/// assert_eq!((e1 - e2), Flags::A); // set difference +/// assert_eq!(!e2, Flags::A); // set complement +/// } +/// ``` +/// +/// The generated `struct`s can also be extended with type and trait +/// implementations: +/// +/// ``` +/// use std::fmt; +/// +/// use bitflags::bitflags; +/// +/// bitflags! { +/// struct Flags: u32 { +/// const A = 0b00000001; +/// const B = 0b00000010; +/// } +/// } +/// +/// impl Flags { +/// pub fn clear(&mut self) { +/// self.bits = 0; // The `bits` field can be accessed from within the +/// // same module where the `bitflags!` macro was invoked. +/// } +/// } +/// +/// impl fmt::Display for Flags { +/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +/// write!(f, "hi!") +/// } +/// } +/// +/// fn main() { +/// let mut flags = Flags::A | Flags::B; +/// flags.clear(); +/// assert!(flags.is_empty()); +/// assert_eq!(format!("{}", flags), "hi!"); +/// assert_eq!(format!("{:?}", Flags::A | Flags::B), "A | B"); +/// assert_eq!(format!("{:?}", Flags::B), "B"); +/// } +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! bitflags { + ( + $(#[$outer:meta])* + $vis:vis struct $BitFlags:ident: $T:ty { + $( + $(#[$inner:ident $($args:tt)*])* + const $Flag:ident = $value:expr; + )* + } + + $($t:tt)* + ) => { + $(#[$outer])* + #[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)] + $vis struct $BitFlags { + bits: $T, + } + + __impl_bitflags! { + $BitFlags: $T { + $( + $(#[$inner $($args)*])* + $Flag = $value; + )* + } + } + + bitflags! { + $($t)* + } + }; + () => {}; +} + +// A helper macro to implement the `all` function. +#[macro_export(local_inner_macros)] +#[doc(hidden)] +macro_rules! __impl_all_bitflags { + ( + $BitFlags:ident: $T:ty { + $( + $(#[$attr:ident $($args:tt)*])* + $Flag:ident = $value:expr; + )+ + } + ) => { + // See `Debug::fmt` for why this approach is taken. + #[allow(non_snake_case)] + trait __BitFlags { + $( + const $Flag: $T = 0; + )+ + } + #[allow(non_snake_case)] + impl __BitFlags for $BitFlags { + $( + __impl_bitflags! { + #[allow(deprecated)] + $(? #[$attr $($args)*])* + const $Flag: $T = Self::$Flag.bits; + } + )+ + } + Self { bits: $(::$Flag)|+ } + }; + ( + $BitFlags:ident: $T:ty { } + ) => { + Self { bits: 0 } + }; +} + +#[macro_export(local_inner_macros)] +#[doc(hidden)] +macro_rules! __impl_bitflags { + ( + $BitFlags:ident: $T:ty { + $( + $(#[$attr:ident $($args:tt)*])* + $Flag:ident = $value:expr; + )* + } + ) => { + impl $crate::_core::fmt::Debug for $BitFlags { + fn fmt(&self, f: &mut $crate::_core::fmt::Formatter) -> $crate::_core::fmt::Result { + // This convoluted approach is to handle #[cfg]-based flag + // omission correctly. For example it needs to support: + // + // #[cfg(unix)] const A: Flag = /* ... */; + // #[cfg(windows)] const B: Flag = /* ... */; + + // Unconditionally define a check for every flag, even disabled + // ones. + #[allow(non_snake_case)] + trait __BitFlags { + $( + #[inline] + fn $Flag(&self) -> bool { false } + )* + } + + // Conditionally override the check for just those flags that + // are not #[cfg]ed away. + #[allow(non_snake_case)] + impl __BitFlags for $BitFlags { + $( + __impl_bitflags! { + #[allow(deprecated)] + #[inline] + $(? #[$attr $($args)*])* + fn $Flag(&self) -> bool { + if Self::$Flag.bits == 0 && self.bits != 0 { + false + } else { + self.bits & Self::$Flag.bits == Self::$Flag.bits + } + } + } + )* + } + + let mut first = true; + $( + if ::$Flag(self) { + if !first { + f.write_str(" | ")?; + } + first = false; + f.write_str($crate::_core::stringify!($Flag))?; + } + )* + let extra_bits = self.bits & !Self::all().bits(); + if extra_bits != 0 { + if !first { + f.write_str(" | ")?; + } + first = false; + f.write_str("0x")?; + $crate::_core::fmt::LowerHex::fmt(&extra_bits, f)?; + } + if first { + f.write_str("(empty)")?; + } + Ok(()) + } + } + impl $crate::_core::fmt::Binary for $BitFlags { + fn fmt(&self, f: &mut $crate::_core::fmt::Formatter) -> $crate::_core::fmt::Result { + $crate::_core::fmt::Binary::fmt(&self.bits, f) + } + } + impl $crate::_core::fmt::Octal for $BitFlags { + fn fmt(&self, f: &mut $crate::_core::fmt::Formatter) -> $crate::_core::fmt::Result { + $crate::_core::fmt::Octal::fmt(&self.bits, f) + } + } + impl $crate::_core::fmt::LowerHex for $BitFlags { + fn fmt(&self, f: &mut $crate::_core::fmt::Formatter) -> $crate::_core::fmt::Result { + $crate::_core::fmt::LowerHex::fmt(&self.bits, f) + } + } + impl $crate::_core::fmt::UpperHex for $BitFlags { + fn fmt(&self, f: &mut $crate::_core::fmt::Formatter) -> $crate::_core::fmt::Result { + $crate::_core::fmt::UpperHex::fmt(&self.bits, f) + } + } + + #[allow(dead_code)] + impl $BitFlags { + $( + $(#[$attr $($args)*])* + pub const $Flag: Self = Self { bits: $value }; + )* + + /// Returns an empty set of flags. + #[inline] + pub const fn empty() -> Self { + Self { bits: 0 } + } + + /// Returns the set containing all flags. + #[inline] + pub const fn all() -> Self { + __impl_all_bitflags! { + $BitFlags: $T { + $( + $(#[$attr $($args)*])* + $Flag = $value; + )* + } + } + } + + /// Returns the raw value of the flags currently stored. + #[inline] + pub const fn bits(&self) -> $T { + self.bits + } + + /// Convert from underlying bit representation, unless that + /// representation contains bits that do not correspond to a flag. + #[inline] + pub const fn from_bits(bits: $T) -> $crate::_core::option::Option { + if (bits & !Self::all().bits()) == 0 { + $crate::_core::option::Option::Some(Self { bits }) + } else { + $crate::_core::option::Option::None + } + } + + /// Convert from underlying bit representation, dropping any bits + /// that do not correspond to flags. + #[inline] + pub const fn from_bits_truncate(bits: $T) -> Self { + Self { bits: bits & Self::all().bits } + } + + /// Convert from underlying bit representation, preserving all + /// bits (even those not corresponding to a defined flag). + /// + /// # Safety + /// + /// The caller of the `bitflags!` macro can chose to allow or + /// disallow extra bits for their bitflags type. + /// + /// The caller of `from_bits_unchecked()` has to ensure that + /// all bits correspond to a defined flag or that extra bits + /// are valid for this bitflags type. + #[inline] + pub const unsafe fn from_bits_unchecked(bits: $T) -> Self { + Self { bits } + } + + /// Returns `true` if no flags are currently stored. + #[inline] + pub const fn is_empty(&self) -> bool { + self.bits() == Self::empty().bits() + } + + /// Returns `true` if all flags are currently set. + #[inline] + pub const fn is_all(&self) -> bool { + Self::all().bits | self.bits == self.bits + } + + /// Returns `true` if there are flags common to both `self` and `other`. + #[inline] + pub const fn intersects(&self, other: Self) -> bool { + !(Self { bits: self.bits & other.bits}).is_empty() + } + + /// Returns `true` if all of the flags in `other` are contained within `self`. + #[inline] + pub const fn contains(&self, other: Self) -> bool { + (self.bits & other.bits) == other.bits + } + + /// Inserts the specified flags in-place. + #[inline] + pub fn insert(&mut self, other: Self) { + self.bits |= other.bits; + } + + /// Removes the specified flags in-place. + #[inline] + pub fn remove(&mut self, other: Self) { + self.bits &= !other.bits; + } + + /// Toggles the specified flags in-place. + #[inline] + pub fn toggle(&mut self, other: Self) { + self.bits ^= other.bits; + } + + /// Inserts or removes the specified flags depending on the passed value. + #[inline] + pub fn set(&mut self, other: Self, value: bool) { + if value { + self.insert(other); + } else { + self.remove(other); + } + } + + /// Returns the intersection between the flags in `self` and + /// `other`. + /// + /// Specifically, the returned set contains only the flags which are + /// present in *both* `self` *and* `other`. + /// + /// This is equivalent to using the `&` operator (e.g. + /// [`ops::BitAnd`]), as in `flags & other`. + /// + /// [`ops::BitAnd`]: https://doc.rust-lang.org/std/ops/trait.BitAnd.html + #[inline] + #[must_use] + pub const fn intersection(self, other: Self) -> Self { + Self { bits: self.bits & other.bits } + } + + /// Returns the union of between the flags in `self` and `other`. + /// + /// Specifically, the returned set contains all flags which are + /// present in *either* `self` *or* `other`, including any which are + /// present in both (see [`Self::symmetric_difference`] if that + /// is undesirable). + /// + /// This is equivalent to using the `|` operator (e.g. + /// [`ops::BitOr`]), as in `flags | other`. + /// + /// [`ops::BitOr`]: https://doc.rust-lang.org/std/ops/trait.BitOr.html + #[inline] + #[must_use] + pub const fn union(self, other: Self) -> Self { + Self { bits: self.bits | other.bits } + } + + /// Returns the difference between the flags in `self` and `other`. + /// + /// Specifically, the returned set contains all flags present in + /// `self`, except for the ones present in `other`. + /// + /// It is also conceptually equivalent to the "bit-clear" operation: + /// `flags & !other` (and this syntax is also supported). + /// + /// This is equivalent to using the `-` operator (e.g. + /// [`ops::Sub`]), as in `flags - other`. + /// + /// [`ops::Sub`]: https://doc.rust-lang.org/std/ops/trait.Sub.html + #[inline] + #[must_use] + pub const fn difference(self, other: Self) -> Self { + Self { bits: self.bits & !other.bits } + } + + /// Returns the [symmetric difference][sym-diff] between the flags + /// in `self` and `other`. + /// + /// Specifically, the returned set contains the flags present which + /// are present in `self` or `other`, but that are not present in + /// both. Equivalently, it contains the flags present in *exactly + /// one* of the sets `self` and `other`. + /// + /// This is equivalent to using the `^` operator (e.g. + /// [`ops::BitXor`]), as in `flags ^ other`. + /// + /// [sym-diff]: https://en.wikipedia.org/wiki/Symmetric_difference + /// [`ops::BitXor`]: https://doc.rust-lang.org/std/ops/trait.BitXor.html + #[inline] + #[must_use] + pub const fn symmetric_difference(self, other: Self) -> Self { + Self { bits: self.bits ^ other.bits } + } + + /// Returns the complement of this set of flags. + /// + /// Specifically, the returned set contains all the flags which are + /// not set in `self`, but which are allowed for this type. + /// + /// Alternatively, it can be thought of as the set difference + /// between [`Self::all()`] and `self` (e.g. `Self::all() - self`) + /// + /// This is equivalent to using the `!` operator (e.g. + /// [`ops::Not`]), as in `!flags`. + /// + /// [`Self::all()`]: Self::all + /// [`ops::Not`]: https://doc.rust-lang.org/std/ops/trait.Not.html + #[inline] + #[must_use] + pub const fn complement(self) -> Self { + Self::from_bits_truncate(!self.bits) + } + + } + + impl $crate::_core::ops::BitOr for $BitFlags { + type Output = Self; + + /// Returns the union of the two sets of flags. + #[inline] + fn bitor(self, other: $BitFlags) -> Self { + Self { bits: self.bits | other.bits } + } + } + + impl $crate::_core::ops::BitOrAssign for $BitFlags { + /// Adds the set of flags. + #[inline] + fn bitor_assign(&mut self, other: Self) { + self.bits |= other.bits; + } + } + + impl $crate::_core::ops::BitXor for $BitFlags { + type Output = Self; + + /// Returns the left flags, but with all the right flags toggled. + #[inline] + fn bitxor(self, other: Self) -> Self { + Self { bits: self.bits ^ other.bits } + } + } + + impl $crate::_core::ops::BitXorAssign for $BitFlags { + /// Toggles the set of flags. + #[inline] + fn bitxor_assign(&mut self, other: Self) { + self.bits ^= other.bits; + } + } + + impl $crate::_core::ops::BitAnd for $BitFlags { + type Output = Self; + + /// Returns the intersection between the two sets of flags. + #[inline] + fn bitand(self, other: Self) -> Self { + Self { bits: self.bits & other.bits } + } + } + + impl $crate::_core::ops::BitAndAssign for $BitFlags { + /// Disables all flags disabled in the set. + #[inline] + fn bitand_assign(&mut self, other: Self) { + self.bits &= other.bits; + } + } + + impl $crate::_core::ops::Sub for $BitFlags { + type Output = Self; + + /// Returns the set difference of the two sets of flags. + #[inline] + fn sub(self, other: Self) -> Self { + Self { bits: self.bits & !other.bits } + } + } + + impl $crate::_core::ops::SubAssign for $BitFlags { + /// Disables all flags enabled in the set. + #[inline] + fn sub_assign(&mut self, other: Self) { + self.bits &= !other.bits; + } + } + + impl $crate::_core::ops::Not for $BitFlags { + type Output = Self; + + /// Returns the complement of this set of flags. + #[inline] + fn not(self) -> Self { + Self { bits: !self.bits } & Self::all() + } + } + + impl $crate::_core::iter::Extend<$BitFlags> for $BitFlags { + fn extend>(&mut self, iterator: T) { + for item in iterator { + self.insert(item) + } + } + } + + impl $crate::_core::iter::FromIterator<$BitFlags> for $BitFlags { + fn from_iter>(iterator: T) -> Self { + let mut result = Self::empty(); + result.extend(iterator); + result + } + } + }; + + // Every attribute that the user writes on a const is applied to the + // corresponding const that we generate, but within the implementation of + // Debug and all() we want to ignore everything but #[cfg] attributes. In + // particular, including a #[deprecated] attribute on those items would fail + // to compile. + // https://github.com/bitflags/bitflags/issues/109 + // + // Input: + // + // ? #[cfg(feature = "advanced")] + // ? #[deprecated(note = "Use something else.")] + // ? #[doc = r"High quality documentation."] + // fn f() -> i32 { /* ... */ } + // + // Output: + // + // #[cfg(feature = "advanced")] + // fn f() -> i32 { /* ... */ } + ( + $(#[$filtered:meta])* + ? #[cfg $($cfgargs:tt)*] + $(? #[$rest:ident $($restargs:tt)*])* + fn $($item:tt)* + ) => { + __impl_bitflags! { + $(#[$filtered])* + #[cfg $($cfgargs)*] + $(? #[$rest $($restargs)*])* + fn $($item)* + } + }; + ( + $(#[$filtered:meta])* + // $next != `cfg` + ? #[$next:ident $($nextargs:tt)*] + $(? #[$rest:ident $($restargs:tt)*])* + fn $($item:tt)* + ) => { + __impl_bitflags! { + $(#[$filtered])* + // $next filtered out + $(? #[$rest $($restargs)*])* + fn $($item)* + } + }; + ( + $(#[$filtered:meta])* + fn $($item:tt)* + ) => { + $(#[$filtered])* + fn $($item)* + }; + + // Every attribute that the user writes on a const is applied to the + // corresponding const that we generate, but within the implementation of + // Debug and all() we want to ignore everything but #[cfg] attributes. In + // particular, including a #[deprecated] attribute on those items would fail + // to compile. + // https://github.com/bitflags/bitflags/issues/109 + // + // const version + // + // Input: + // + // ? #[cfg(feature = "advanced")] + // ? #[deprecated(note = "Use something else.")] + // ? #[doc = r"High quality documentation."] + // const f: i32 { /* ... */ } + // + // Output: + // + // #[cfg(feature = "advanced")] + // const f: i32 { /* ... */ } + ( + $(#[$filtered:meta])* + ? #[cfg $($cfgargs:tt)*] + $(? #[$rest:ident $($restargs:tt)*])* + const $($item:tt)* + ) => { + __impl_bitflags! { + $(#[$filtered])* + #[cfg $($cfgargs)*] + $(? #[$rest $($restargs)*])* + const $($item)* + } + }; + ( + $(#[$filtered:meta])* + // $next != `cfg` + ? #[$next:ident $($nextargs:tt)*] + $(? #[$rest:ident $($restargs:tt)*])* + const $($item:tt)* + ) => { + __impl_bitflags! { + $(#[$filtered])* + // $next filtered out + $(? #[$rest $($restargs)*])* + const $($item)* + } + }; + ( + $(#[$filtered:meta])* + const $($item:tt)* + ) => { + $(#[$filtered])* + const $($item)* + }; +} + +#[cfg(feature = "example_generated")] +pub mod example_generated; + +#[cfg(test)] +mod tests { + use std::collections::hash_map::DefaultHasher; + use std::hash::{Hash, Hasher}; + + bitflags! { + #[doc = "> The first principle is that you must not fool yourself — and"] + #[doc = "> you are the easiest person to fool."] + #[doc = "> "] + #[doc = "> - Richard Feynman"] + #[derive(Default)] + struct Flags: u32 { + const A = 0b00000001; + #[doc = " macros are way better at generating code than trans is"] + const B = 0b00000010; + const C = 0b00000100; + #[doc = "* cmr bed"] + #[doc = "* strcat table"] + #[doc = " wait what?"] + const ABC = Self::A.bits | Self::B.bits | Self::C.bits; + } + + struct _CfgFlags: u32 { + #[cfg(unix)] + const _CFG_A = 0b01; + #[cfg(windows)] + const _CFG_B = 0b01; + #[cfg(unix)] + const _CFG_C = Self::_CFG_A.bits | 0b10; + } + + struct AnotherSetOfFlags: i8 { + const ANOTHER_FLAG = -1_i8; + } + + struct LongFlags: u32 { + const LONG_A = 0b1111111111111111; + } + } + + bitflags! { + struct EmptyFlags: u32 { + } + } + + #[test] + fn test_bits() { + assert_eq!(Flags::empty().bits(), 0b00000000); + assert_eq!(Flags::A.bits(), 0b00000001); + assert_eq!(Flags::ABC.bits(), 0b00000111); + + assert_eq!(AnotherSetOfFlags::empty().bits(), 0b00); + assert_eq!(AnotherSetOfFlags::ANOTHER_FLAG.bits(), !0_i8); + + assert_eq!(EmptyFlags::empty().bits(), 0b00000000); + } + + #[test] + fn test_from_bits() { + assert_eq!(Flags::from_bits(0), Some(Flags::empty())); + assert_eq!(Flags::from_bits(0b1), Some(Flags::A)); + assert_eq!(Flags::from_bits(0b10), Some(Flags::B)); + assert_eq!(Flags::from_bits(0b11), Some(Flags::A | Flags::B)); + assert_eq!(Flags::from_bits(0b1000), None); + + assert_eq!( + AnotherSetOfFlags::from_bits(!0_i8), + Some(AnotherSetOfFlags::ANOTHER_FLAG) + ); + + assert_eq!(EmptyFlags::from_bits(0), Some(EmptyFlags::empty())); + assert_eq!(EmptyFlags::from_bits(0b1), None); + } + + #[test] + fn test_from_bits_truncate() { + assert_eq!(Flags::from_bits_truncate(0), Flags::empty()); + assert_eq!(Flags::from_bits_truncate(0b1), Flags::A); + assert_eq!(Flags::from_bits_truncate(0b10), Flags::B); + assert_eq!(Flags::from_bits_truncate(0b11), (Flags::A | Flags::B)); + assert_eq!(Flags::from_bits_truncate(0b1000), Flags::empty()); + assert_eq!(Flags::from_bits_truncate(0b1001), Flags::A); + + assert_eq!( + AnotherSetOfFlags::from_bits_truncate(0_i8), + AnotherSetOfFlags::empty() + ); + + assert_eq!(EmptyFlags::from_bits_truncate(0), EmptyFlags::empty()); + assert_eq!(EmptyFlags::from_bits_truncate(0b1), EmptyFlags::empty()); + } + + #[test] + fn test_from_bits_unchecked() { + let extra = unsafe { Flags::from_bits_unchecked(0b1000) }; + assert_eq!(unsafe { Flags::from_bits_unchecked(0) }, Flags::empty()); + assert_eq!(unsafe { Flags::from_bits_unchecked(0b1) }, Flags::A); + assert_eq!(unsafe { Flags::from_bits_unchecked(0b10) }, Flags::B); + + assert_eq!( + unsafe { Flags::from_bits_unchecked(0b11) }, + (Flags::A | Flags::B) + ); + assert_eq!( + unsafe { Flags::from_bits_unchecked(0b1000) }, + (extra | Flags::empty()) + ); + assert_eq!( + unsafe { Flags::from_bits_unchecked(0b1001) }, + (extra | Flags::A) + ); + + let extra = unsafe { EmptyFlags::from_bits_unchecked(0b1000) }; + assert_eq!( + unsafe { EmptyFlags::from_bits_unchecked(0b1000) }, + (extra | EmptyFlags::empty()) + ); + } + + #[test] + fn test_is_empty() { + assert!(Flags::empty().is_empty()); + assert!(!Flags::A.is_empty()); + assert!(!Flags::ABC.is_empty()); + + assert!(!AnotherSetOfFlags::ANOTHER_FLAG.is_empty()); + + assert!(EmptyFlags::empty().is_empty()); + assert!(EmptyFlags::all().is_empty()); + } + + #[test] + fn test_is_all() { + assert!(Flags::all().is_all()); + assert!(!Flags::A.is_all()); + assert!(Flags::ABC.is_all()); + + let extra = unsafe { Flags::from_bits_unchecked(0b1000) }; + assert!(!extra.is_all()); + assert!(!(Flags::A | extra).is_all()); + assert!((Flags::ABC | extra).is_all()); + + assert!(AnotherSetOfFlags::ANOTHER_FLAG.is_all()); + + assert!(EmptyFlags::all().is_all()); + assert!(EmptyFlags::empty().is_all()); + } + + #[test] + fn test_two_empties_do_not_intersect() { + let e1 = Flags::empty(); + let e2 = Flags::empty(); + assert!(!e1.intersects(e2)); + + assert!(AnotherSetOfFlags::ANOTHER_FLAG.intersects(AnotherSetOfFlags::ANOTHER_FLAG)); + } + + #[test] + fn test_empty_does_not_intersect_with_full() { + let e1 = Flags::empty(); + let e2 = Flags::ABC; + assert!(!e1.intersects(e2)); + } + + #[test] + fn test_disjoint_intersects() { + let e1 = Flags::A; + let e2 = Flags::B; + assert!(!e1.intersects(e2)); + } + + #[test] + fn test_overlapping_intersects() { + let e1 = Flags::A; + let e2 = Flags::A | Flags::B; + assert!(e1.intersects(e2)); + } + + #[test] + fn test_contains() { + let e1 = Flags::A; + let e2 = Flags::A | Flags::B; + assert!(!e1.contains(e2)); + assert!(e2.contains(e1)); + assert!(Flags::ABC.contains(e2)); + + assert!(AnotherSetOfFlags::ANOTHER_FLAG.contains(AnotherSetOfFlags::ANOTHER_FLAG)); + + assert!(EmptyFlags::empty().contains(EmptyFlags::empty())); + } + + #[test] + fn test_insert() { + let mut e1 = Flags::A; + let e2 = Flags::A | Flags::B; + e1.insert(e2); + assert_eq!(e1, e2); + + let mut e3 = AnotherSetOfFlags::empty(); + e3.insert(AnotherSetOfFlags::ANOTHER_FLAG); + assert_eq!(e3, AnotherSetOfFlags::ANOTHER_FLAG); + } + + #[test] + fn test_remove() { + let mut e1 = Flags::A | Flags::B; + let e2 = Flags::A | Flags::C; + e1.remove(e2); + assert_eq!(e1, Flags::B); + + let mut e3 = AnotherSetOfFlags::ANOTHER_FLAG; + e3.remove(AnotherSetOfFlags::ANOTHER_FLAG); + assert_eq!(e3, AnotherSetOfFlags::empty()); + } + + #[test] + fn test_operators() { + let e1 = Flags::A | Flags::C; + let e2 = Flags::B | Flags::C; + assert_eq!((e1 | e2), Flags::ABC); // union + assert_eq!((e1 & e2), Flags::C); // intersection + assert_eq!((e1 - e2), Flags::A); // set difference + assert_eq!(!e2, Flags::A); // set complement + assert_eq!(e1 ^ e2, Flags::A | Flags::B); // toggle + let mut e3 = e1; + e3.toggle(e2); + assert_eq!(e3, Flags::A | Flags::B); + + let mut m4 = AnotherSetOfFlags::empty(); + m4.toggle(AnotherSetOfFlags::empty()); + assert_eq!(m4, AnotherSetOfFlags::empty()); + } + + #[test] + fn test_operators_unchecked() { + let extra = unsafe { Flags::from_bits_unchecked(0b1000) }; + let e1 = Flags::A | Flags::C | extra; + let e2 = Flags::B | Flags::C; + assert_eq!((e1 | e2), (Flags::ABC | extra)); // union + assert_eq!((e1 & e2), Flags::C); // intersection + assert_eq!((e1 - e2), (Flags::A | extra)); // set difference + assert_eq!(!e2, Flags::A); // set complement + assert_eq!(!e1, Flags::B); // set complement + assert_eq!(e1 ^ e2, Flags::A | Flags::B | extra); // toggle + let mut e3 = e1; + e3.toggle(e2); + assert_eq!(e3, Flags::A | Flags::B | extra); + } + + #[test] + fn test_set_ops_basic() { + let ab = Flags::A.union(Flags::B); + let ac = Flags::A.union(Flags::C); + let bc = Flags::B.union(Flags::C); + assert_eq!(ab.bits, 0b011); + assert_eq!(bc.bits, 0b110); + assert_eq!(ac.bits, 0b101); + + assert_eq!(ab, Flags::B.union(Flags::A)); + assert_eq!(ac, Flags::C.union(Flags::A)); + assert_eq!(bc, Flags::C.union(Flags::B)); + + assert_eq!(ac, Flags::A | Flags::C); + assert_eq!(bc, Flags::B | Flags::C); + assert_eq!(ab.union(bc), Flags::ABC); + + assert_eq!(ac, Flags::A | Flags::C); + assert_eq!(bc, Flags::B | Flags::C); + + assert_eq!(ac.union(bc), ac | bc); + assert_eq!(ac.union(bc), Flags::ABC); + assert_eq!(bc.union(ac), Flags::ABC); + + assert_eq!(ac.intersection(bc), ac & bc); + assert_eq!(ac.intersection(bc), Flags::C); + assert_eq!(bc.intersection(ac), Flags::C); + + assert_eq!(ac.difference(bc), ac - bc); + assert_eq!(bc.difference(ac), bc - ac); + assert_eq!(ac.difference(bc), Flags::A); + assert_eq!(bc.difference(ac), Flags::B); + + assert_eq!(bc.complement(), !bc); + assert_eq!(bc.complement(), Flags::A); + assert_eq!(ac.symmetric_difference(bc), Flags::A.union(Flags::B)); + assert_eq!(bc.symmetric_difference(ac), Flags::A.union(Flags::B)); + } + + #[test] + fn test_set_ops_const() { + // These just test that these compile and don't cause use-site panics + // (would be possible if we had some sort of UB) + const INTERSECT: Flags = Flags::all().intersection(Flags::C); + const UNION: Flags = Flags::A.union(Flags::C); + const DIFFERENCE: Flags = Flags::all().difference(Flags::A); + const COMPLEMENT: Flags = Flags::C.complement(); + const SYM_DIFFERENCE: Flags = UNION.symmetric_difference(DIFFERENCE); + assert_eq!(INTERSECT, Flags::C); + assert_eq!(UNION, Flags::A | Flags::C); + assert_eq!(DIFFERENCE, Flags::all() - Flags::A); + assert_eq!(COMPLEMENT, !Flags::C); + assert_eq!(SYM_DIFFERENCE, (Flags::A | Flags::C) ^ (Flags::all() - Flags::A)); + } + + #[test] + fn test_set_ops_unchecked() { + let extra = unsafe { Flags::from_bits_unchecked(0b1000) }; + let e1 = Flags::A.union(Flags::C).union(extra); + let e2 = Flags::B.union(Flags::C); + assert_eq!(e1.bits, 0b1101); + assert_eq!(e1.union(e2), (Flags::ABC | extra)); + assert_eq!(e1.intersection(e2), Flags::C); + assert_eq!(e1.difference(e2), Flags::A | extra); + assert_eq!(e2.difference(e1), Flags::B); + assert_eq!(e2.complement(), Flags::A); + assert_eq!(e1.complement(), Flags::B); + assert_eq!(e1.symmetric_difference(e2), Flags::A | Flags::B | extra); // toggle + } + + #[test] + fn test_set_ops_exhaustive() { + // Define a flag that contains gaps to help exercise edge-cases, + // especially around "unknown" flags (e.g. ones outside of `all()` + // `from_bits_unchecked`). + // - when lhs and rhs both have different sets of unknown flags. + // - unknown flags at both ends, and in the middle + // - cases with "gaps". + bitflags! { + struct Test: u16 { + // Intentionally no `A` + const B = 0b000000010; + // Intentionally no `C` + const D = 0b000001000; + const E = 0b000010000; + const F = 0b000100000; + const G = 0b001000000; + // Intentionally no `H` + const I = 0b100000000; + } + } + let iter_test_flags = + || (0..=0b111_1111_1111).map(|bits| unsafe { Test::from_bits_unchecked(bits) }); + + for a in iter_test_flags() { + assert_eq!( + a.complement(), + Test::from_bits_truncate(!a.bits), + "wrong result: !({:?})", + a, + ); + assert_eq!(a.complement(), !a, "named != op: !({:?})", a); + for b in iter_test_flags() { + // Check that the named operations produce the expected bitwise + // values. + assert_eq!( + a.union(b).bits, + a.bits | b.bits, + "wrong result: `{:?}` | `{:?}`", + a, + b, + ); + assert_eq!( + a.intersection(b).bits, + a.bits & b.bits, + "wrong result: `{:?}` & `{:?}`", + a, + b, + ); + assert_eq!( + a.symmetric_difference(b).bits, + a.bits ^ b.bits, + "wrong result: `{:?}` ^ `{:?}`", + a, + b, + ); + assert_eq!( + a.difference(b).bits, + a.bits & !b.bits, + "wrong result: `{:?}` - `{:?}`", + a, + b, + ); + // Note: Difference is checked as both `a - b` and `b - a` + assert_eq!( + b.difference(a).bits, + b.bits & !a.bits, + "wrong result: `{:?}` - `{:?}`", + b, + a, + ); + // Check that the named set operations are equivalent to the + // bitwise equivalents + assert_eq!(a.union(b), a | b, "named != op: `{:?}` | `{:?}`", a, b,); + assert_eq!( + a.intersection(b), + a & b, + "named != op: `{:?}` & `{:?}`", + a, + b, + ); + assert_eq!( + a.symmetric_difference(b), + a ^ b, + "named != op: `{:?}` ^ `{:?}`", + a, + b, + ); + assert_eq!(a.difference(b), a - b, "named != op: `{:?}` - `{:?}`", a, b,); + // Note: Difference is checked as both `a - b` and `b - a` + assert_eq!(b.difference(a), b - a, "named != op: `{:?}` - `{:?}`", b, a,); + // Verify that the operations which should be symmetric are + // actually symmetric. + assert_eq!(a.union(b), b.union(a), "asymmetry: `{:?}` | `{:?}`", a, b,); + assert_eq!( + a.intersection(b), + b.intersection(a), + "asymmetry: `{:?}` & `{:?}`", + a, + b, + ); + assert_eq!( + a.symmetric_difference(b), + b.symmetric_difference(a), + "asymmetry: `{:?}` ^ `{:?}`", + a, + b, + ); + } + } + } + + #[test] + fn test_set() { + let mut e1 = Flags::A | Flags::C; + e1.set(Flags::B, true); + e1.set(Flags::C, false); + + assert_eq!(e1, Flags::A | Flags::B); + } + + #[test] + fn test_assignment_operators() { + let mut m1 = Flags::empty(); + let e1 = Flags::A | Flags::C; + // union + m1 |= Flags::A; + assert_eq!(m1, Flags::A); + // intersection + m1 &= e1; + assert_eq!(m1, Flags::A); + // set difference + m1 -= m1; + assert_eq!(m1, Flags::empty()); + // toggle + m1 ^= e1; + assert_eq!(m1, e1); + } + + #[test] + fn test_const_fn() { + const _M1: Flags = Flags::empty(); + + const M2: Flags = Flags::A; + assert_eq!(M2, Flags::A); + + const M3: Flags = Flags::C; + assert_eq!(M3, Flags::C); + } + + #[test] + fn test_extend() { + let mut flags; + + flags = Flags::empty(); + flags.extend([].iter().cloned()); + assert_eq!(flags, Flags::empty()); + + flags = Flags::empty(); + flags.extend([Flags::A, Flags::B].iter().cloned()); + assert_eq!(flags, Flags::A | Flags::B); + + flags = Flags::A; + flags.extend([Flags::A, Flags::B].iter().cloned()); + assert_eq!(flags, Flags::A | Flags::B); + + flags = Flags::B; + flags.extend([Flags::A, Flags::ABC].iter().cloned()); + assert_eq!(flags, Flags::ABC); + } + + #[test] + fn test_from_iterator() { + assert_eq!([].iter().cloned().collect::(), Flags::empty()); + assert_eq!( + [Flags::A, Flags::B].iter().cloned().collect::(), + Flags::A | Flags::B + ); + assert_eq!( + [Flags::A, Flags::ABC].iter().cloned().collect::(), + Flags::ABC + ); + } + + #[test] + fn test_lt() { + let mut a = Flags::empty(); + let mut b = Flags::empty(); + + assert!(!(a < b) && !(b < a)); + b = Flags::B; + assert!(a < b); + a = Flags::C; + assert!(!(a < b) && b < a); + b = Flags::C | Flags::B; + assert!(a < b); + } + + #[test] + fn test_ord() { + let mut a = Flags::empty(); + let mut b = Flags::empty(); + + assert!(a <= b && a >= b); + a = Flags::A; + assert!(a > b && a >= b); + assert!(b < a && b <= a); + b = Flags::B; + assert!(b > a && b >= a); + assert!(a < b && a <= b); + } + + fn hash(t: &T) -> u64 { + let mut s = DefaultHasher::new(); + t.hash(&mut s); + s.finish() + } + + #[test] + fn test_hash() { + let mut x = Flags::empty(); + let mut y = Flags::empty(); + assert_eq!(hash(&x), hash(&y)); + x = Flags::all(); + y = Flags::ABC; + assert_eq!(hash(&x), hash(&y)); + } + + #[test] + fn test_default() { + assert_eq!(Flags::empty(), Flags::default()); + } + + #[test] + fn test_debug() { + assert_eq!(format!("{:?}", Flags::A | Flags::B), "A | B"); + assert_eq!(format!("{:?}", Flags::empty()), "(empty)"); + assert_eq!(format!("{:?}", Flags::ABC), "A | B | C | ABC"); + let extra = unsafe { Flags::from_bits_unchecked(0xb8) }; + assert_eq!(format!("{:?}", extra), "0xb8"); + assert_eq!(format!("{:?}", Flags::A | extra), "A | 0xb8"); + + assert_eq!( + format!("{:?}", Flags::ABC | extra), + "A | B | C | ABC | 0xb8" + ); + + assert_eq!(format!("{:?}", EmptyFlags::empty()), "(empty)"); + } + + #[test] + fn test_binary() { + assert_eq!(format!("{:b}", Flags::ABC), "111"); + assert_eq!(format!("{:#b}", Flags::ABC), "0b111"); + let extra = unsafe { Flags::from_bits_unchecked(0b1010000) }; + assert_eq!(format!("{:b}", Flags::ABC | extra), "1010111"); + assert_eq!(format!("{:#b}", Flags::ABC | extra), "0b1010111"); + } + + #[test] + fn test_octal() { + assert_eq!(format!("{:o}", LongFlags::LONG_A), "177777"); + assert_eq!(format!("{:#o}", LongFlags::LONG_A), "0o177777"); + let extra = unsafe { LongFlags::from_bits_unchecked(0o5000000) }; + assert_eq!(format!("{:o}", LongFlags::LONG_A | extra), "5177777"); + assert_eq!(format!("{:#o}", LongFlags::LONG_A | extra), "0o5177777"); + } + + #[test] + fn test_lowerhex() { + assert_eq!(format!("{:x}", LongFlags::LONG_A), "ffff"); + assert_eq!(format!("{:#x}", LongFlags::LONG_A), "0xffff"); + let extra = unsafe { LongFlags::from_bits_unchecked(0xe00000) }; + assert_eq!(format!("{:x}", LongFlags::LONG_A | extra), "e0ffff"); + assert_eq!(format!("{:#x}", LongFlags::LONG_A | extra), "0xe0ffff"); + } + + #[test] + fn test_upperhex() { + assert_eq!(format!("{:X}", LongFlags::LONG_A), "FFFF"); + assert_eq!(format!("{:#X}", LongFlags::LONG_A), "0xFFFF"); + let extra = unsafe { LongFlags::from_bits_unchecked(0xe00000) }; + assert_eq!(format!("{:X}", LongFlags::LONG_A | extra), "E0FFFF"); + assert_eq!(format!("{:#X}", LongFlags::LONG_A | extra), "0xE0FFFF"); + } + + mod submodule { + bitflags! { + pub struct PublicFlags: i8 { + const X = 0; + } + + struct PrivateFlags: i8 { + const Y = 0; + } + } + + #[test] + fn test_private() { + let _ = PrivateFlags::Y; + } + } + + #[test] + fn test_public() { + let _ = submodule::PublicFlags::X; + } + + mod t1 { + mod foo { + pub type Bar = i32; + } + + bitflags! { + /// baz + struct Flags: foo::Bar { + const A = 0b00000001; + #[cfg(foo)] + const B = 0b00000010; + #[cfg(foo)] + const C = 0b00000010; + } + } + } + + #[test] + fn test_in_function() { + bitflags! { + struct Flags: u8 { + const A = 1; + #[cfg(any())] // false + const B = 2; + } + } + assert_eq!(Flags::all(), Flags::A); + assert_eq!(format!("{:?}", Flags::A), "A"); + } + + #[test] + fn test_deprecated() { + bitflags! { + pub struct TestFlags: u32 { + #[deprecated(note = "Use something else.")] + const ONE = 1; + } + } + } + + #[test] + fn test_pub_crate() { + mod module { + bitflags! { + pub (crate) struct Test: u8 { + const FOO = 1; + } + } + } + + assert_eq!(module::Test::FOO.bits(), 1); + } + + #[test] + fn test_pub_in_module() { + mod module { + mod submodule { + bitflags! { + // `pub (in super)` means only the module `module` will + // be able to access this. + pub (in super) struct Test: u8 { + const FOO = 1; + } + } + } + + mod test { + // Note: due to `pub (in super)`, + // this cannot be accessed directly by the testing code. + pub(super) fn value() -> u8 { + super::submodule::Test::FOO.bits() + } + } + + pub fn value() -> u8 { + test::value() + } + } + + assert_eq!(module::value(), 1) + } + + #[test] + fn test_zero_value_flags() { + bitflags! { + struct Flags: u32 { + const NONE = 0b0; + const SOME = 0b1; + } + } + + assert!(Flags::empty().contains(Flags::NONE)); + assert!(Flags::SOME.contains(Flags::NONE)); + assert!(Flags::NONE.is_empty()); + + assert_eq!(format!("{:?}", Flags::empty()), "NONE"); + assert_eq!(format!("{:?}", Flags::SOME), "SOME"); + } + + #[test] + fn test_empty_bitflags() { + bitflags! {} + } + + #[test] + fn test_u128_bitflags() { + bitflags! { + struct Flags128: u128 { + const A = 0x0000_0000_0000_0000_0000_0000_0000_0001; + const B = 0x0000_0000_0000_1000_0000_0000_0000_0000; + const C = 0x8000_0000_0000_0000_0000_0000_0000_0000; + const ABC = Self::A.bits | Self::B.bits | Self::C.bits; + } + } + + assert_eq!(Flags128::ABC, Flags128::A | Flags128::B | Flags128::C); + assert_eq!(Flags128::A.bits, 0x0000_0000_0000_0000_0000_0000_0000_0001); + assert_eq!(Flags128::B.bits, 0x0000_0000_0000_1000_0000_0000_0000_0000); + assert_eq!(Flags128::C.bits, 0x8000_0000_0000_0000_0000_0000_0000_0000); + assert_eq!( + Flags128::ABC.bits, + 0x8000_0000_0000_1000_0000_0000_0000_0001 + ); + assert_eq!(format!("{:?}", Flags128::A), "A"); + assert_eq!(format!("{:?}", Flags128::B), "B"); + assert_eq!(format!("{:?}", Flags128::C), "C"); + assert_eq!(format!("{:?}", Flags128::ABC), "A | B | C | ABC"); + } + + #[test] + fn test_serde_bitflags_serialize() { + let flags = SerdeFlags::A | SerdeFlags::B; + + let serialized = serde_json::to_string(&flags).unwrap(); + + assert_eq!(serialized, r#"{"bits":3}"#); + } + + #[test] + fn test_serde_bitflags_deserialize() { + let deserialized: SerdeFlags = serde_json::from_str(r#"{"bits":12}"#).unwrap(); + + let expected = SerdeFlags::C | SerdeFlags::D; + + assert_eq!(deserialized.bits, expected.bits); + } + + #[test] + fn test_serde_bitflags_roundtrip() { + let flags = SerdeFlags::A | SerdeFlags::B; + + let deserialized: SerdeFlags = serde_json::from_str(&serde_json::to_string(&flags).unwrap()).unwrap(); + + assert_eq!(deserialized.bits, flags.bits); + } + + bitflags! { + #[derive(serde::Serialize, serde::Deserialize)] + struct SerdeFlags: u32 { + const A = 1; + const B = 2; + const C = 4; + const D = 8; + } + } +} diff --git a/bash-5.1/vendor/bitflags/tests/basic.rs b/bash-5.1/vendor/bitflags/tests/basic.rs new file mode 100644 index 0000000000000000000000000000000000000000..73a52bec50b60d76ab62453c946cd715f02c7709 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/basic.rs @@ -0,0 +1,20 @@ +#![no_std] + +use bitflags::bitflags; + +bitflags! { + /// baz + struct Flags: u32 { + const A = 0b00000001; + #[doc = "bar"] + const B = 0b00000010; + const C = 0b00000100; + #[doc = "foo"] + const ABC = Flags::A.bits | Flags::B.bits | Flags::C.bits; + } +} + +#[test] +fn basic() { + assert_eq!(Flags::ABC, Flags::A | Flags::B | Flags::C); +} diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/impls/copy.rs b/bash-5.1/vendor/bitflags/tests/compile-fail/impls/copy.rs new file mode 100644 index 0000000000000000000000000000000000000000..38f4822f5a5f270601790200f4e0f5976d1d5dd5 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/impls/copy.rs @@ -0,0 +1,10 @@ +use bitflags::bitflags; + +bitflags! { + #[derive(Clone, Copy)] + struct Flags: u32 { + const A = 0b00000001; + } +} + +fn main() {} diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/impls/copy.stderr.beta b/bash-5.1/vendor/bitflags/tests/compile-fail/impls/copy.stderr.beta new file mode 100644 index 0000000000000000000000000000000000000000..0c13aa50241970a5e56bd36a8c4677e9f8c6e1df --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/impls/copy.stderr.beta @@ -0,0 +1,27 @@ +error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `Flags` + --> $DIR/copy.rs:3:1 + | +3 | / bitflags! { +4 | | #[derive(Clone, Copy)] + | | ----- first implementation here +5 | | struct Flags: u32 { +6 | | const A = 0b00000001; +7 | | } +8 | | } + | |_^ conflicting implementation for `Flags` + | + = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `Flags` + --> $DIR/copy.rs:3:1 + | +3 | / bitflags! { +4 | | #[derive(Clone, Copy)] + | | ---- first implementation here +5 | | struct Flags: u32 { +6 | | const A = 0b00000001; +7 | | } +8 | | } + | |_^ conflicting implementation for `Flags` + | + = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/impls/eq.rs b/bash-5.1/vendor/bitflags/tests/compile-fail/impls/eq.rs new file mode 100644 index 0000000000000000000000000000000000000000..4abbd630c6e127946a3f78678b6f895d0b6fa9b7 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/impls/eq.rs @@ -0,0 +1,10 @@ +use bitflags::bitflags; + +bitflags! { + #[derive(PartialEq, Eq)] + struct Flags: u32 { + const A = 0b00000001; + } +} + +fn main() {} diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/impls/eq.stderr.beta b/bash-5.1/vendor/bitflags/tests/compile-fail/impls/eq.stderr.beta new file mode 100644 index 0000000000000000000000000000000000000000..8a1a3b410a0e0a8101040deec4e717a86a7e6143 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/impls/eq.stderr.beta @@ -0,0 +1,55 @@ +error[E0119]: conflicting implementations of trait `std::cmp::PartialEq` for type `Flags` + --> $DIR/eq.rs:3:1 + | +3 | / bitflags! { +4 | | #[derive(PartialEq, Eq)] + | | --------- first implementation here +5 | | struct Flags: u32 { +6 | | const A = 0b00000001; +7 | | } +8 | | } + | |_^ conflicting implementation for `Flags` + | + = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0119]: conflicting implementations of trait `std::cmp::Eq` for type `Flags` + --> $DIR/eq.rs:3:1 + | +3 | / bitflags! { +4 | | #[derive(PartialEq, Eq)] + | | -- first implementation here +5 | | struct Flags: u32 { +6 | | const A = 0b00000001; +7 | | } +8 | | } + | |_^ conflicting implementation for `Flags` + | + = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0119]: conflicting implementations of trait `std::marker::StructuralPartialEq` for type `Flags` + --> $DIR/eq.rs:3:1 + | +3 | / bitflags! { +4 | | #[derive(PartialEq, Eq)] + | | --------- first implementation here +5 | | struct Flags: u32 { +6 | | const A = 0b00000001; +7 | | } +8 | | } + | |_^ conflicting implementation for `Flags` + | + = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0119]: conflicting implementations of trait `std::marker::StructuralEq` for type `Flags` + --> $DIR/eq.rs:3:1 + | +3 | / bitflags! { +4 | | #[derive(PartialEq, Eq)] + | | -- first implementation here +5 | | struct Flags: u32 { +6 | | const A = 0b00000001; +7 | | } +8 | | } + | |_^ conflicting implementation for `Flags` + | + = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_defined.rs b/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_defined.rs new file mode 100644 index 0000000000000000000000000000000000000000..c2856b10830d3421b05266b4e9a21ffa77627ba1 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_defined.rs @@ -0,0 +1,123 @@ +use std::{ + fmt::{ + self, + Debug, + Display, + LowerHex, + UpperHex, + Octal, + Binary, + }, + ops::{ + BitAnd, + BitOr, + BitXor, + BitAndAssign, + BitOrAssign, + BitXorAssign, + Not, + }, +}; + +use bitflags::bitflags; + +// Ideally we'd actually want this to work, but currently need something like `num`'s `Zero` +// With some design work it could be made possible +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +struct MyInt(u8); + +impl BitAnd for MyInt { + type Output = Self; + + fn bitand(self, other: Self) -> Self { + MyInt(self.0 & other.0) + } +} + +impl BitOr for MyInt { + type Output = Self; + + fn bitor(self, other: Self) -> Self { + MyInt(self.0 | other.0) + } +} + +impl BitXor for MyInt { + type Output = Self; + + fn bitxor(self, other: Self) -> Self { + MyInt(self.0 ^ other.0) + } +} + +impl BitAndAssign for MyInt { + fn bitand_assign(&mut self, other: Self) { + self.0 &= other.0 + } +} + +impl BitOrAssign for MyInt { + fn bitor_assign(&mut self, other: Self) { + self.0 |= other.0 + } +} + +impl BitXorAssign for MyInt { + fn bitxor_assign(&mut self, other: Self) { + self.0 ^= other.0 + } +} + +impl Debug for MyInt { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + Debug::fmt(&self.0, f) + } +} + +impl Display for MyInt { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + Display::fmt(&self.0, f) + } +} + +impl LowerHex for MyInt { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + LowerHex::fmt(&self.0, f) + } +} + +impl UpperHex for MyInt { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + UpperHex::fmt(&self.0, f) + } +} + +impl Octal for MyInt { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + Octal::fmt(&self.0, f) + } +} + +impl Binary for MyInt { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + Binary::fmt(&self.0, f) + } +} + +impl Not for MyInt { + type Output = MyInt; + + fn not(self) -> Self { + MyInt(!self.0) + } +} + +bitflags! { + struct Flags128: MyInt { + const A = MyInt(0b0000_0001u8); + const B = MyInt(0b0000_0010u8); + const C = MyInt(0b0000_0100u8); + } +} + +fn main() {} diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_defined.stderr.beta b/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_defined.stderr.beta new file mode 100644 index 0000000000000000000000000000000000000000..1f0fb5cf7ad0b1265cadff1530819db368dbf834 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_defined.stderr.beta @@ -0,0 +1,27 @@ +error[E0308]: mismatched types + --> $DIR/all_defined.rs:115:1 + | +115 | / bitflags! { +116 | | struct Flags128: MyInt { +117 | | const A = MyInt(0b0000_0001u8); +118 | | const B = MyInt(0b0000_0010u8); +119 | | const C = MyInt(0b0000_0100u8); +120 | | } +121 | | } + | |_^ expected struct `MyInt`, found integer + | + = note: this error originates in the macro `__impl_all_bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0308]: mismatched types + --> $DIR/all_defined.rs:115:1 + | +115 | / bitflags! { +116 | | struct Flags128: MyInt { +117 | | const A = MyInt(0b0000_0001u8); +118 | | const B = MyInt(0b0000_0010u8); +119 | | const C = MyInt(0b0000_0100u8); +120 | | } +121 | | } + | |_^ expected struct `MyInt`, found integer + | + = note: this error originates in the macro `__impl_bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_missing.rs b/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_missing.rs new file mode 100644 index 0000000000000000000000000000000000000000..fff6b2cc1306273d7d6a84db3d97dac5b7cfe6f3 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_missing.rs @@ -0,0 +1,13 @@ +use bitflags::bitflags; + +struct MyInt(u8); + +bitflags! { + struct Flags128: MyInt { + const A = MyInt(0b0000_0001); + const B = MyInt(0b0000_0010); + const C = MyInt(0b0000_0100); + } +} + +fn main() {} diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_missing.stderr.beta b/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_missing.stderr.beta new file mode 100644 index 0000000000000000000000000000000000000000..ee95f8365e33e31ef999b6116487999d932982e9 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/non_integer_base/all_missing.stderr.beta @@ -0,0 +1,13 @@ +error[E0204]: the trait `Copy` may not be implemented for this type + --> $DIR/all_missing.rs:5:1 + | +5 | / bitflags! { +6 | | struct Flags128: MyInt { +7 | | const A = MyInt(0b0000_0001); +8 | | const B = MyInt(0b0000_0010); +9 | | const C = MyInt(0b0000_0100); +10 | | } +11 | | } + | |_^ this field does not implement `Copy` + | + = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_field.rs b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_field.rs new file mode 100644 index 0000000000000000000000000000000000000000..a6a3912aea30a3618a0611cc47a35c0f4aaf7ba2 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_field.rs @@ -0,0 +1,13 @@ +mod example { + use bitflags::bitflags; + + bitflags! { + pub struct Flags1: u32 { + const FLAG_A = 0b00000001; + } + } +} + +fn main() { + let flag1 = example::Flags1::FLAG_A.bits; +} diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_field.stderr.beta b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_field.stderr.beta new file mode 100644 index 0000000000000000000000000000000000000000..58a04660166a809a0c07de96f7ee01d09bdd8ba2 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_field.stderr.beta @@ -0,0 +1,10 @@ +error[E0616]: field `bits` of struct `Flags1` is private + --> $DIR/private_field.rs:12:41 + | +12 | let flag1 = example::Flags1::FLAG_A.bits; + | ^^^^ private field + | +help: a method `bits` also exists, call it with parentheses + | +12 | let flag1 = example::Flags1::FLAG_A.bits(); + | ^^ diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_flags.rs b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_flags.rs new file mode 100644 index 0000000000000000000000000000000000000000..85a5b1863dd437743e49b68c63a28259f1432422 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_flags.rs @@ -0,0 +1,18 @@ +mod example { + use bitflags::bitflags; + + bitflags! { + pub struct Flags1: u32 { + const FLAG_A = 0b00000001; + } + + struct Flags2: u32 { + const FLAG_B = 0b00000010; + } + } +} + +fn main() { + let flag1 = example::Flags1::FLAG_A; + let flag2 = example::Flags2::FLAG_B; +} diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_flags.stderr.beta b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_flags.stderr.beta new file mode 100644 index 0000000000000000000000000000000000000000..d23f83209ba90a934fe0bcbd4b16a80a3eef9f14 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/private_flags.stderr.beta @@ -0,0 +1,18 @@ +error[E0603]: struct `Flags2` is private + --> $DIR/private_flags.rs:17:26 + | +17 | let flag2 = example::Flags2::FLAG_B; + | ^^^^^^ private struct + | +note: the struct `Flags2` is defined here + --> $DIR/private_flags.rs:4:5 + | +4 | / bitflags! { +5 | | pub struct Flags1: u32 { +6 | | const FLAG_A = 0b00000001; +7 | | } +... | +11 | | } +12 | | } + | |_____^ + = note: this error originates in the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/pub_const.rs b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/pub_const.rs new file mode 100644 index 0000000000000000000000000000000000000000..b90f0ce92d1e6f1c30b3f37272540964e47d7a55 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/pub_const.rs @@ -0,0 +1,9 @@ +use bitflags::bitflags; + +bitflags! { + pub struct Flags1: u32 { + pub const FLAG_A = 0b00000001; + } +} + +fn main() {} diff --git a/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/pub_const.stderr.beta b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/pub_const.stderr.beta new file mode 100644 index 0000000000000000000000000000000000000000..b01122c7ad8792ab2c482746bdf58e4583758d2a --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-fail/visibility/pub_const.stderr.beta @@ -0,0 +1,5 @@ +error: no rules expected the token `pub` + --> $DIR/pub_const.rs:5:9 + | +5 | pub const FLAG_A = 0b00000001; + | ^^^ no rules expected this token in macro call diff --git a/bash-5.1/vendor/bitflags/tests/compile-pass/impls/convert.rs b/bash-5.1/vendor/bitflags/tests/compile-pass/impls/convert.rs new file mode 100644 index 0000000000000000000000000000000000000000..1f02982a8fa24251889030085884084b9ecc0acc --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-pass/impls/convert.rs @@ -0,0 +1,17 @@ +use bitflags::bitflags; + +bitflags! { + struct Flags: u32 { + const A = 0b00000001; + } +} + +impl From for Flags { + fn from(v: u32) -> Flags { + Flags::from_bits_truncate(v) + } +} + +fn main() { + +} diff --git a/bash-5.1/vendor/bitflags/tests/compile-pass/impls/default.rs b/bash-5.1/vendor/bitflags/tests/compile-pass/impls/default.rs new file mode 100644 index 0000000000000000000000000000000000000000..a97b6536f2b582666b8ba86186c79c1fbbf04e60 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-pass/impls/default.rs @@ -0,0 +1,10 @@ +use bitflags::bitflags; + +bitflags! { + #[derive(Default)] + struct Flags: u32 { + const A = 0b00000001; + } +} + +fn main() {} diff --git a/bash-5.1/vendor/bitflags/tests/compile-pass/impls/inherent_methods.rs b/bash-5.1/vendor/bitflags/tests/compile-pass/impls/inherent_methods.rs new file mode 100644 index 0000000000000000000000000000000000000000..3052c460ec33ab49d68ffa68ed941703dd21f947 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-pass/impls/inherent_methods.rs @@ -0,0 +1,15 @@ +use bitflags::bitflags; + +bitflags! { + struct Flags: u32 { + const A = 0b00000001; + } +} + +impl Flags { + pub fn new() -> Flags { + Flags::A + } +} + +fn main() {} diff --git a/bash-5.1/vendor/bitflags/tests/compile-pass/redefinition/core.rs b/bash-5.1/vendor/bitflags/tests/compile-pass/redefinition/core.rs new file mode 100644 index 0000000000000000000000000000000000000000..47549215948d11c0097c67a691180b7c9f30f7b7 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-pass/redefinition/core.rs @@ -0,0 +1,14 @@ +use bitflags::bitflags; + +// Checks for possible errors caused by overriding names used by `bitflags!` internally. + +mod core {} +mod _core {} + +bitflags! { + struct Test: u8 { + const A = 1; + } +} + +fn main() {} diff --git a/bash-5.1/vendor/bitflags/tests/compile-pass/redefinition/stringify.rs b/bash-5.1/vendor/bitflags/tests/compile-pass/redefinition/stringify.rs new file mode 100644 index 0000000000000000000000000000000000000000..b04f2f6a493329ad0d01cd70af7004eafa865f25 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-pass/redefinition/stringify.rs @@ -0,0 +1,19 @@ +use bitflags::bitflags; + +// Checks for possible errors caused by overriding names used by `bitflags!` internally. + +#[allow(unused_macros)] +macro_rules! stringify { + ($($t:tt)*) => { "..." }; +} + +bitflags! { + struct Test: u8 { + const A = 1; + } +} + +fn main() { + // Just make sure we don't call the redefined `stringify` macro + assert_eq!(format!("{:?}", Test::A), "A"); +} diff --git a/bash-5.1/vendor/bitflags/tests/compile-pass/repr/c.rs b/bash-5.1/vendor/bitflags/tests/compile-pass/repr/c.rs new file mode 100644 index 0000000000000000000000000000000000000000..6feba36ed82c138dc35243e938f3ea6f2821f9fa --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-pass/repr/c.rs @@ -0,0 +1,10 @@ +use bitflags::bitflags; + +bitflags! { + #[repr(C)] + struct Flags: u32 { + const A = 0b00000001; + } +} + +fn main() {} diff --git a/bash-5.1/vendor/bitflags/tests/compile-pass/repr/transparent.rs b/bash-5.1/vendor/bitflags/tests/compile-pass/repr/transparent.rs new file mode 100644 index 0000000000000000000000000000000000000000..e38db4dd11b993b39e9f5c3498892efb8016478b --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-pass/repr/transparent.rs @@ -0,0 +1,10 @@ +use bitflags::bitflags; + +bitflags! { + #[repr(transparent)] + struct Flags: u32 { + const A = 0b00000001; + } +} + +fn main() {} diff --git a/bash-5.1/vendor/bitflags/tests/compile-pass/visibility/bits_field.rs b/bash-5.1/vendor/bitflags/tests/compile-pass/visibility/bits_field.rs new file mode 100644 index 0000000000000000000000000000000000000000..33a7967e629efd791cc0af29c64aa908a5892e55 --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-pass/visibility/bits_field.rs @@ -0,0 +1,11 @@ +use bitflags::bitflags; + +bitflags! { + pub struct Flags1: u32 { + const FLAG_A = 0b00000001; + } +} + +fn main() { + assert_eq!(0b00000001, Flags1::FLAG_A.bits); +} diff --git a/bash-5.1/vendor/bitflags/tests/compile-pass/visibility/pub_in.rs b/bash-5.1/vendor/bitflags/tests/compile-pass/visibility/pub_in.rs new file mode 100644 index 0000000000000000000000000000000000000000..c11050e3baf0cdf1d7b28d31999af5ea8d80a8fd --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile-pass/visibility/pub_in.rs @@ -0,0 +1,19 @@ +mod a { + mod b { + use bitflags::bitflags; + + bitflags! { + pub(in crate::a) struct Flags: u32 { + const FLAG_A = 0b00000001; + } + } + } + + pub fn flags() -> u32 { + b::Flags::FLAG_A.bits() + } +} + +fn main() { + assert_eq!(0b00000001, a::flags()); +} diff --git a/bash-5.1/vendor/bitflags/tests/compile.rs b/bash-5.1/vendor/bitflags/tests/compile.rs new file mode 100644 index 0000000000000000000000000000000000000000..ed02d01e9ca1b377bd7973d0d3950da87d9ecb8c --- /dev/null +++ b/bash-5.1/vendor/bitflags/tests/compile.rs @@ -0,0 +1,63 @@ +use std::{ + fs, + ffi::OsStr, + io, + path::Path, +}; + +use walkdir::WalkDir; + +#[test] +fn fail() { + prepare_stderr_files("tests/compile-fail").unwrap(); + + let t = trybuild::TestCases::new(); + t.compile_fail("tests/compile-fail/**/*.rs"); +} + +#[test] +fn pass() { + let t = trybuild::TestCases::new(); + t.pass("tests/compile-pass/**/*.rs"); +} + +// Compiler messages may change between versions +// We don't want to have to track these too closely for `bitflags`, but +// having some message to check makes sure user-facing errors are sensical. +// +// The approach we use is to run the test on all compilers, but only check stderr +// output on beta (which is the next stable release). We do this by default ignoring +// any `.stderr` files in the `compile-fail` directory, and copying `.stderr.beta` files +// when we happen to be running on a beta compiler. +fn prepare_stderr_files(path: impl AsRef) -> io::Result<()> { + for entry in WalkDir::new(path) { + let entry = entry?; + + if entry.path().extension().and_then(OsStr::to_str) == Some("beta") { + let renamed = entry.path().with_extension(""); + + // Unconditionally remove a corresponding `.stderr` file for a `.stderr.beta` + // file if it exists. On `beta` compilers, we'll recreate it. On other compilers, + // we don't want to end up checking it anyways. + if renamed.exists() { + fs::remove_file(&renamed)?; + } + + rename_beta_stderr(entry.path(), renamed)?; + } + } + + Ok(()) +} + +#[rustversion::beta] +fn rename_beta_stderr(from: impl AsRef, to: impl AsRef) -> io::Result<()> { + fs::copy(from, to)?; + + Ok(()) +} + +#[rustversion::not(beta)] +fn rename_beta_stderr(_: impl AsRef, _: impl AsRef) -> io::Result<()> { + Ok(()) +} diff --git a/bash-5.1/vendor/cc/.cargo-checksum.json b/bash-5.1/vendor/cc/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..a7f8f2fe7afe9a3b7ed9ea84dd65bea86bd47184 --- /dev/null +++ b/bash-5.1/vendor/cc/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.lock":"739aae86d1e7096fc84b9a6273cc49635503a4ee87b3a4b6601f569880866b29","Cargo.toml":"ccfa92dd53511178ef95aa87b2dcbdd45e23f9f8a8454e455d7da8e08feab4b5","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"1fd66e1fe6d618030b9452c667e89d7a31b27331ad831d83b41f9762fd6858d4","src/bin/gcc-shim.rs":"b77907875029494b6288841c3aed2e4939ed40708c7f597fca5c9e2570490ca6","src/com.rs":"bcdaf1c28b71e6ef889c6b08d1ce9d7c0761344a677f523bc4c3cd297957f804","src/lib.rs":"38970d678de0efb4b5e2978265daa8a613a1db35fc42e669621b03fc56d5b138","src/registry.rs":"3cc1b5a50879fa751572878ae1d0afbfc960c11665258492754b2c8bccb0ff5d","src/setup_config.rs":"7014103587d3382eac599cb76f016e2609b8140970861b2237982d1db24af265","src/vs_instances.rs":"2d3f8278a803b0e7052f4eeb1979b29f963dd0143f4458e2cb5f33c4e5f0963b","src/winapi.rs":"ea8b7edbb9ff87957254f465c2334e714c5d6b3b19a8d757c48ea7ca0881c50c","src/windows_registry.rs":"4645453198766c7486fc9b8782b06cfd0f94cbbcb3482413173e73234a447518","tests/cc_env.rs":"e02b3b0824ad039b47e4462c5ef6dbe6c824c28e7953af94a0f28f7b5158042e","tests/cflags.rs":"57f06eb5ce1557e5b4a032d0c4673e18fbe6f8d26c1deb153126e368b96b41b3","tests/cxxflags.rs":"c2c6c6d8a0d7146616fa1caed26876ee7bc9fcfffd525eb4743593cade5f3371","tests/support/mod.rs":"a3c8d116973bb16066bf6ec4de5143183f97de7aad085d85f8118a2eaac3e1e0","tests/test.rs":"65c073e0e2cf4aa0433066102788e9f57442719e6f32f5ad5248aa7132bb4597"},"package":"2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"} \ No newline at end of file diff --git a/bash-5.1/vendor/cc/Cargo.toml b/bash-5.1/vendor/cc/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..ad0ec2138568ece0829998668f6b22b8b67c2a2a --- /dev/null +++ b/bash-5.1/vendor/cc/Cargo.toml @@ -0,0 +1,33 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2018" +name = "cc" +version = "1.0.73" +authors = ["Alex Crichton "] +exclude = ["/.github", "/.travis.yml", "/appveyor.yml"] +description = "A build-time dependency for Cargo build scripts to assist in invoking the native\nC compiler to compile native C code into a static archive to be linked into Rust\ncode.\n" +homepage = "https://github.com/alexcrichton/cc-rs" +documentation = "https://docs.rs/cc" +readme = "README.md" +keywords = ["build-dependencies"] +categories = ["development-tools::build-utils"] +license = "MIT/Apache-2.0" +repository = "https://github.com/alexcrichton/cc-rs" +[dependencies.jobserver] +version = "0.1.16" +optional = true +[dev-dependencies.tempfile] +version = "3" + +[features] +parallel = ["jobserver"] diff --git a/bash-5.1/vendor/cc/LICENSE-APACHE b/bash-5.1/vendor/cc/LICENSE-APACHE new file mode 100644 index 0000000000000000000000000000000000000000..16fe87b06e802f094b3fbb0894b137bca2b16ef1 --- /dev/null +++ b/bash-5.1/vendor/cc/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/bash-5.1/vendor/cc/LICENSE-MIT b/bash-5.1/vendor/cc/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..39e0ed6602151f235148e6c08413aa7eda5b9038 --- /dev/null +++ b/bash-5.1/vendor/cc/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2014 Alex Crichton + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/bash-5.1/vendor/cc/README.md b/bash-5.1/vendor/cc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b52e095b940567b34f80d2f3205a2cc2920b9bac --- /dev/null +++ b/bash-5.1/vendor/cc/README.md @@ -0,0 +1,223 @@ +# cc-rs + +A library to compile C/C++/assembly into a Rust library/application. + +[Documentation](https://docs.rs/cc) + +A simple library meant to be used as a build dependency with Cargo packages in +order to build a set of C/C++ files into a static archive. This crate calls out +to the most relevant compiler for a platform, for example using `cl` on MSVC. + +## Using cc-rs + +First, you'll want to both add a build script for your crate (`build.rs`) and +also add this crate to your `Cargo.toml` via: + +```toml +[build-dependencies] +cc = "1.0" +``` + +Next up, you'll want to write a build script like so: + +```rust,no_run +// build.rs + +fn main() { + cc::Build::new() + .file("foo.c") + .file("bar.c") + .compile("foo"); +} +``` + +And that's it! Running `cargo build` should take care of the rest and your Rust +application will now have the C files `foo.c` and `bar.c` compiled into a file +named `libfoo.a`. If the C files contain + +```c +void foo_function(void) { ... } +``` + +and + +```c +int32_t bar_function(int32_t x) { ... } +``` + +you can call them from Rust by declaring them in +your Rust code like so: + +```rust,no_run +extern { + fn foo_function(); + fn bar_function(x: i32) -> i32; +} + +pub fn call() { + unsafe { + foo_function(); + bar_function(42); + } +} + +fn main() { + // ... +} +``` + +See [the Rustonomicon](https://doc.rust-lang.org/nomicon/ffi.html) for more details. + +## External configuration via environment variables + +To control the programs and flags used for building, the builder can set a +number of different environment variables. + +* `CFLAGS` - a series of space separated flags passed to compilers. Note that + individual flags cannot currently contain spaces, so doing + something like: `-L=foo\ bar` is not possible. +* `CC` - the actual C compiler used. Note that this is used as an exact + executable name, so (for example) no extra flags can be passed inside + this variable, and the builder must ensure that there aren't any + trailing spaces. This compiler must understand the `-c` flag. For + certain `TARGET`s, it also is assumed to know about other flags (most + common is `-fPIC`). +* `AR` - the `ar` (archiver) executable to use to build the static library. +* `CRATE_CC_NO_DEFAULTS` - the default compiler flags may cause conflicts in some cross compiling scenarios. Setting this variable will disable the generation of default compiler flags. +* `CXX...` - see [C++ Support](#c-support). + +Each of these variables can also be supplied with certain prefixes and suffixes, +in the following prioritized order: + +1. `_` - for example, `CC_x86_64-unknown-linux-gnu` +2. `_` - for example, `CC_x86_64_unknown_linux_gnu` +3. `_` - for example, `HOST_CC` or `TARGET_CFLAGS` +4. `` - a plain `CC`, `AR` as above. + +If none of these variables exist, cc-rs uses built-in defaults + +In addition to the above optional environment variables, `cc-rs` has some +functions with hard requirements on some variables supplied by [cargo's +build-script driver][cargo] that it has the `TARGET`, `OUT_DIR`, `OPT_LEVEL`, +and `HOST` variables. + +[cargo]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#inputs-to-the-build-script + +## Optional features + +### Parallel + +Currently cc-rs supports parallel compilation (think `make -jN`) but this +feature is turned off by default. To enable cc-rs to compile C/C++ in parallel, +you can change your dependency to: + +```toml +[build-dependencies] +cc = { version = "1.0", features = ["parallel"] } +``` + +By default cc-rs will limit parallelism to `$NUM_JOBS`, or if not present it +will limit it to the number of cpus on the machine. If you are using cargo, +use `-jN` option of `build`, `test` and `run` commands as `$NUM_JOBS` +is supplied by cargo. + +## Compile-time Requirements + +To work properly this crate needs access to a C compiler when the build script +is being run. This crate does not ship a C compiler with it. The compiler +required varies per platform, but there are three broad categories: + +* Unix platforms require `cc` to be the C compiler. This can be found by + installing cc/clang on Linux distributions and Xcode on macOS, for example. +* Windows platforms targeting MSVC (e.g. your target triple ends in `-msvc`) + require `cl.exe` to be available and in `PATH`. This is typically found in + standard Visual Studio installations and the `PATH` can be set up by running + the appropriate developer tools shell. +* Windows platforms targeting MinGW (e.g. your target triple ends in `-gnu`) + require `cc` to be available in `PATH`. We recommend the + [MinGW-w64](http://mingw-w64.org) distribution, which is using the + [Win-builds](http://win-builds.org) installation system. + You may also acquire it via + [MSYS2](https://www.msys2.org/), as explained [here][msys2-help]. Make sure + to install the appropriate architecture corresponding to your installation of + rustc. GCC from older [MinGW](http://www.mingw.org) project is compatible + only with 32-bit rust compiler. + +[msys2-help]: https://github.com/rust-lang/rust#building-on-windows + +## C++ support + +`cc-rs` supports C++ libraries compilation by using the `cpp` method on +`Build`: + +```rust,no_run +fn main() { + cc::Build::new() + .cpp(true) // Switch to C++ library compilation. + .file("foo.cpp") + .compile("libfoo.a"); +} +``` + +For C++ libraries, the `CXX` and `CXXFLAGS` environment variables are used instead of `CC` and `CFLAGS`. + +The C++ standard library may be linked to the crate target. By default it's `libc++` for macOS, FreeBSD, and OpenBSD, `libc++_shared` for Android, nothing for MSVC, and `libstdc++` for anything else. It can be changed in one of two ways: + +1. by using the `cpp_link_stdlib` method on `Build`: + ```rust,no-run + fn main() { + cc::Build::new() + .cpp(true) + .file("foo.cpp") + .cpp_link_stdlib("stdc++") // use libstdc++ + .compile("libfoo.a"); + } + ``` +2. by setting the `CXXSTDLIB` environment variable. + +In particular, for Android you may want to [use `c++_static` if you have at most one shared library](https://developer.android.com/ndk/guides/cpp-support). + +Remember that C++ does name mangling so `extern "C"` might be required to enable Rust linker to find your functions. + +## CUDA C++ support + +`cc-rs` also supports compiling CUDA C++ libraries by using the `cuda` method +on `Build` (currently for GNU/Clang toolchains only): + +```rust,no_run +fn main() { + cc::Build::new() + // Switch to CUDA C++ library compilation using NVCC. + .cuda(true) + .cudart("static") + // Generate code for Maxwell (GTX 970, 980, 980 Ti, Titan X). + .flag("-gencode").flag("arch=compute_52,code=sm_52") + // Generate code for Maxwell (Jetson TX1). + .flag("-gencode").flag("arch=compute_53,code=sm_53") + // Generate code for Pascal (GTX 1070, 1080, 1080 Ti, Titan Xp). + .flag("-gencode").flag("arch=compute_61,code=sm_61") + // Generate code for Pascal (Tesla P100). + .flag("-gencode").flag("arch=compute_60,code=sm_60") + // Generate code for Pascal (Jetson TX2). + .flag("-gencode").flag("arch=compute_62,code=sm_62") + .file("bar.cu") + .compile("libbar.a"); +} +``` + +## License + +This project is licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + https://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + https://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in cc-rs by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. diff --git a/bash-5.1/vendor/cc/src/bin/gcc-shim.rs b/bash-5.1/vendor/cc/src/bin/gcc-shim.rs new file mode 100644 index 0000000000000000000000000000000000000000..1731df82ea5cd9b951bfa83e304d458a5648ff85 --- /dev/null +++ b/bash-5.1/vendor/cc/src/bin/gcc-shim.rs @@ -0,0 +1,48 @@ +#![cfg_attr(test, allow(dead_code))] + +use std::env; +use std::fs::File; +use std::io::prelude::*; +use std::path::PathBuf; + +fn main() { + let mut args = env::args(); + let program = args.next().expect("Unexpected empty args"); + + let out_dir = PathBuf::from( + env::var_os("GCCTEST_OUT_DIR").expect(&format!("{}: GCCTEST_OUT_DIR not found", program)), + ); + + // Find the first nonexistent candidate file to which the program's args can be written. + for i in 0.. { + let candidate = &out_dir.join(format!("out{}", i)); + + // If the file exists, commands have already run. Try again. + if candidate.exists() { + continue; + } + + // Create a file and record the args passed to the command. + let mut f = File::create(candidate).expect(&format!( + "{}: can't create candidate: {}", + program, + candidate.to_string_lossy() + )); + for arg in args { + writeln!(f, "{}", arg).expect(&format!( + "{}: can't write to candidate: {}", + program, + candidate.to_string_lossy() + )); + } + break; + } + + // Create a file used by some tests. + let path = &out_dir.join("libfoo.a"); + File::create(path).expect(&format!( + "{}: can't create libfoo.a: {}", + program, + path.to_string_lossy() + )); +} diff --git a/bash-5.1/vendor/cc/src/com.rs b/bash-5.1/vendor/cc/src/com.rs new file mode 100644 index 0000000000000000000000000000000000000000..a5f2afedf4a2ffaae9a73d90a64a3fa3851defce --- /dev/null +++ b/bash-5.1/vendor/cc/src/com.rs @@ -0,0 +1,155 @@ +// Copyright © 2017 winapi-rs developers +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. + +#![allow(unused)] + +use crate::winapi::CoInitializeEx; +use crate::winapi::IUnknown; +use crate::winapi::Interface; +use crate::winapi::BSTR; +use crate::winapi::COINIT_MULTITHREADED; +use crate::winapi::{SysFreeString, SysStringLen}; +use crate::winapi::{HRESULT, S_FALSE, S_OK}; +use std::ffi::{OsStr, OsString}; +use std::mem::forget; +use std::ops::Deref; +use std::os::windows::ffi::{OsStrExt, OsStringExt}; +use std::ptr::null_mut; +use std::slice::from_raw_parts; + +pub fn initialize() -> Result<(), HRESULT> { + let err = unsafe { CoInitializeEx(null_mut(), COINIT_MULTITHREADED) }; + if err != S_OK && err != S_FALSE { + // S_FALSE just means COM is already initialized + return Err(err); + } + Ok(()) +} + +pub struct ComPtr(*mut T) +where + T: Interface; +impl ComPtr +where + T: Interface, +{ + /// Creates a `ComPtr` to wrap a raw pointer. + /// It takes ownership over the pointer which means it does __not__ call `AddRef`. + /// `T` __must__ be a COM interface that inherits from `IUnknown`. + pub unsafe fn from_raw(ptr: *mut T) -> ComPtr { + assert!(!ptr.is_null()); + ComPtr(ptr) + } + /// Casts up the inheritance chain + pub fn up(self) -> ComPtr + where + T: Deref, + U: Interface, + { + ComPtr(self.into_raw() as *mut U) + } + /// Extracts the raw pointer. + /// You are now responsible for releasing it yourself. + pub fn into_raw(self) -> *mut T { + let p = self.0; + forget(self); + p + } + /// For internal use only. + fn as_unknown(&self) -> &IUnknown { + unsafe { &*(self.0 as *mut IUnknown) } + } + /// Performs QueryInterface fun. + pub fn cast(&self) -> Result, i32> + where + U: Interface, + { + let mut obj = null_mut(); + let err = unsafe { self.as_unknown().QueryInterface(&U::uuidof(), &mut obj) }; + if err < 0 { + return Err(err); + } + Ok(unsafe { ComPtr::from_raw(obj as *mut U) }) + } +} +impl Deref for ComPtr +where + T: Interface, +{ + type Target = T; + fn deref(&self) -> &T { + unsafe { &*self.0 } + } +} +impl Clone for ComPtr +where + T: Interface, +{ + fn clone(&self) -> Self { + unsafe { + self.as_unknown().AddRef(); + ComPtr::from_raw(self.0) + } + } +} +impl Drop for ComPtr +where + T: Interface, +{ + fn drop(&mut self) { + unsafe { + self.as_unknown().Release(); + } + } +} +pub struct BStr(BSTR); +impl BStr { + pub unsafe fn from_raw(s: BSTR) -> BStr { + BStr(s) + } + pub fn to_osstring(&self) -> OsString { + let len = unsafe { SysStringLen(self.0) }; + let slice = unsafe { from_raw_parts(self.0, len as usize) }; + OsStringExt::from_wide(slice) + } +} +impl Drop for BStr { + fn drop(&mut self) { + unsafe { SysFreeString(self.0) }; + } +} + +pub trait ToWide { + fn to_wide(&self) -> Vec; + fn to_wide_null(&self) -> Vec; +} +impl ToWide for T +where + T: AsRef, +{ + fn to_wide(&self) -> Vec { + self.as_ref().encode_wide().collect() + } + fn to_wide_null(&self) -> Vec { + self.as_ref().encode_wide().chain(Some(0)).collect() + } +} +pub trait FromWide +where + Self: Sized, +{ + fn from_wide(wide: &[u16]) -> Self; + fn from_wide_null(wide: &[u16]) -> Self { + let len = wide.iter().take_while(|&&c| c != 0).count(); + Self::from_wide(&wide[..len]) + } +} +impl FromWide for OsString { + fn from_wide(wide: &[u16]) -> OsString { + OsStringExt::from_wide(wide) + } +} diff --git a/bash-5.1/vendor/cc/src/lib.rs b/bash-5.1/vendor/cc/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..e3a2b98b03e0d0f29ef61f136d3cad38a95813e9 --- /dev/null +++ b/bash-5.1/vendor/cc/src/lib.rs @@ -0,0 +1,3301 @@ +//! A library for build scripts to compile custom C code +//! +//! This library is intended to be used as a `build-dependencies` entry in +//! `Cargo.toml`: +//! +//! ```toml +//! [build-dependencies] +//! cc = "1.0" +//! ``` +//! +//! The purpose of this crate is to provide the utility functions necessary to +//! compile C code into a static archive which is then linked into a Rust crate. +//! Configuration is available through the `Build` struct. +//! +//! This crate will automatically detect situations such as cross compilation or +//! other environment variables set by Cargo and will build code appropriately. +//! +//! The crate is not limited to C code, it can accept any source code that can +//! be passed to a C or C++ compiler. As such, assembly files with extensions +//! `.s` (gcc/clang) and `.asm` (MSVC) can also be compiled. +//! +//! [`Build`]: struct.Build.html +//! +//! # Parallelism +//! +//! To parallelize computation, enable the `parallel` feature for the crate. +//! +//! ```toml +//! [build-dependencies] +//! cc = { version = "1.0", features = ["parallel"] } +//! ``` +//! To specify the max number of concurrent compilation jobs, set the `NUM_JOBS` +//! environment variable to the desired amount. +//! +//! Cargo will also set this environment variable when executed with the `-jN` flag. +//! +//! If `NUM_JOBS` is not set, the `RAYON_NUM_THREADS` environment variable can +//! also specify the build parallelism. +//! +//! # Examples +//! +//! Use the `Build` struct to compile `src/foo.c`: +//! +//! ```no_run +//! fn main() { +//! cc::Build::new() +//! .file("src/foo.c") +//! .define("FOO", Some("bar")) +//! .include("src") +//! .compile("foo"); +//! } +//! ``` + +#![doc(html_root_url = "https://docs.rs/cc/1.0")] +#![cfg_attr(test, deny(warnings))] +#![allow(deprecated)] +#![deny(missing_docs)] + +use std::collections::HashMap; +use std::env; +use std::ffi::{OsStr, OsString}; +use std::fmt::{self, Display}; +use std::fs; +use std::io::{self, BufRead, BufReader, Read, Write}; +use std::path::{Component, Path, PathBuf}; +use std::process::{Child, Command, Stdio}; +use std::sync::{Arc, Mutex}; +use std::thread::{self, JoinHandle}; + +// These modules are all glue to support reading the MSVC version from +// the registry and from COM interfaces +#[cfg(windows)] +mod registry; +#[cfg(windows)] +#[macro_use] +mod winapi; +#[cfg(windows)] +mod com; +#[cfg(windows)] +mod setup_config; +#[cfg(windows)] +mod vs_instances; + +pub mod windows_registry; + +/// A builder for compilation of a native library. +/// +/// A `Build` is the main type of the `cc` crate and is used to control all the +/// various configuration options and such of a compile. You'll find more +/// documentation on each method itself. +#[derive(Clone, Debug)] +pub struct Build { + include_directories: Vec, + definitions: Vec<(String, Option)>, + objects: Vec, + flags: Vec, + flags_supported: Vec, + known_flag_support_status: Arc>>, + ar_flags: Vec, + no_default_flags: bool, + files: Vec, + cpp: bool, + cpp_link_stdlib: Option>, + cpp_set_stdlib: Option, + cuda: bool, + cudart: Option, + target: Option, + host: Option, + out_dir: Option, + opt_level: Option, + debug: Option, + force_frame_pointer: Option, + env: Vec<(OsString, OsString)>, + compiler: Option, + archiver: Option, + cargo_metadata: bool, + pic: Option, + use_plt: Option, + static_crt: Option, + shared_flag: Option, + static_flag: Option, + warnings_into_errors: bool, + warnings: Option, + extra_warnings: Option, + env_cache: Arc>>>, + apple_sdk_root_cache: Arc>>, +} + +/// Represents the types of errors that may occur while using cc-rs. +#[derive(Clone, Debug)] +enum ErrorKind { + /// Error occurred while performing I/O. + IOError, + /// Invalid architecture supplied. + ArchitectureInvalid, + /// Environment variable not found, with the var in question as extra info. + EnvVarNotFound, + /// Error occurred while using external tools (ie: invocation of compiler). + ToolExecError, + /// Error occurred due to missing external tools. + ToolNotFound, + /// One of the function arguments failed validation. + InvalidArgument, +} + +/// Represents an internal error that occurred, with an explanation. +#[derive(Clone, Debug)] +pub struct Error { + /// Describes the kind of error that occurred. + kind: ErrorKind, + /// More explanation of error that occurred. + message: String, +} + +impl Error { + fn new(kind: ErrorKind, message: &str) -> Error { + Error { + kind: kind, + message: message.to_owned(), + } + } +} + +impl From for Error { + fn from(e: io::Error) -> Error { + Error::new(ErrorKind::IOError, &format!("{}", e)) + } +} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{:?}: {}", self.kind, self.message) + } +} + +impl std::error::Error for Error {} + +/// Configuration used to represent an invocation of a C compiler. +/// +/// This can be used to figure out what compiler is in use, what the arguments +/// to it are, and what the environment variables look like for the compiler. +/// This can be used to further configure other build systems (e.g. forward +/// along CC and/or CFLAGS) or the `to_command` method can be used to run the +/// compiler itself. +#[derive(Clone, Debug)] +pub struct Tool { + path: PathBuf, + cc_wrapper_path: Option, + cc_wrapper_args: Vec, + args: Vec, + env: Vec<(OsString, OsString)>, + family: ToolFamily, + cuda: bool, + removed_args: Vec, +} + +/// Represents the family of tools this tool belongs to. +/// +/// Each family of tools differs in how and what arguments they accept. +/// +/// Detection of a family is done on best-effort basis and may not accurately reflect the tool. +#[derive(Copy, Clone, Debug, PartialEq)] +enum ToolFamily { + /// Tool is GNU Compiler Collection-like. + Gnu, + /// Tool is Clang-like. It differs from the GCC in a sense that it accepts superset of flags + /// and its cross-compilation approach is different. + Clang, + /// Tool is the MSVC cl.exe. + Msvc { clang_cl: bool }, +} + +impl ToolFamily { + /// What the flag to request debug info for this family of tools look like + fn add_debug_flags(&self, cmd: &mut Tool) { + match *self { + ToolFamily::Msvc { .. } => { + cmd.push_cc_arg("-Z7".into()); + } + ToolFamily::Gnu | ToolFamily::Clang => { + cmd.push_cc_arg("-g".into()); + } + } + } + + /// What the flag to force frame pointers. + fn add_force_frame_pointer(&self, cmd: &mut Tool) { + match *self { + ToolFamily::Gnu | ToolFamily::Clang => { + cmd.push_cc_arg("-fno-omit-frame-pointer".into()); + } + _ => (), + } + } + + /// What the flags to enable all warnings + fn warnings_flags(&self) -> &'static str { + match *self { + ToolFamily::Msvc { .. } => "-W4", + ToolFamily::Gnu | ToolFamily::Clang => "-Wall", + } + } + + /// What the flags to enable extra warnings + fn extra_warnings_flags(&self) -> Option<&'static str> { + match *self { + ToolFamily::Msvc { .. } => None, + ToolFamily::Gnu | ToolFamily::Clang => Some("-Wextra"), + } + } + + /// What the flag to turn warning into errors + fn warnings_to_errors_flag(&self) -> &'static str { + match *self { + ToolFamily::Msvc { .. } => "-WX", + ToolFamily::Gnu | ToolFamily::Clang => "-Werror", + } + } + + fn verbose_stderr(&self) -> bool { + *self == ToolFamily::Clang + } +} + +/// Represents an object. +/// +/// This is a source file -> object file pair. +#[derive(Clone, Debug)] +struct Object { + src: PathBuf, + dst: PathBuf, +} + +impl Object { + /// Create a new source file -> object file pair. + fn new(src: PathBuf, dst: PathBuf) -> Object { + Object { src: src, dst: dst } + } +} + +impl Build { + /// Construct a new instance of a blank set of configuration. + /// + /// This builder is finished with the [`compile`] function. + /// + /// [`compile`]: struct.Build.html#method.compile + pub fn new() -> Build { + Build { + include_directories: Vec::new(), + definitions: Vec::new(), + objects: Vec::new(), + flags: Vec::new(), + flags_supported: Vec::new(), + known_flag_support_status: Arc::new(Mutex::new(HashMap::new())), + ar_flags: Vec::new(), + no_default_flags: false, + files: Vec::new(), + shared_flag: None, + static_flag: None, + cpp: false, + cpp_link_stdlib: None, + cpp_set_stdlib: None, + cuda: false, + cudart: None, + target: None, + host: None, + out_dir: None, + opt_level: None, + debug: None, + force_frame_pointer: None, + env: Vec::new(), + compiler: None, + archiver: None, + cargo_metadata: true, + pic: None, + use_plt: None, + static_crt: None, + warnings: None, + extra_warnings: None, + warnings_into_errors: false, + env_cache: Arc::new(Mutex::new(HashMap::new())), + apple_sdk_root_cache: Arc::new(Mutex::new(HashMap::new())), + } + } + + /// Add a directory to the `-I` or include path for headers + /// + /// # Example + /// + /// ```no_run + /// use std::path::Path; + /// + /// let library_path = Path::new("/path/to/library"); + /// + /// cc::Build::new() + /// .file("src/foo.c") + /// .include(library_path) + /// .include("src") + /// .compile("foo"); + /// ``` + pub fn include>(&mut self, dir: P) -> &mut Build { + self.include_directories.push(dir.as_ref().to_path_buf()); + self + } + + /// Add multiple directories to the `-I` include path. + /// + /// # Example + /// + /// ```no_run + /// # use std::path::Path; + /// # let condition = true; + /// # + /// let mut extra_dir = None; + /// if condition { + /// extra_dir = Some(Path::new("/path/to")); + /// } + /// + /// cc::Build::new() + /// .file("src/foo.c") + /// .includes(extra_dir) + /// .compile("foo"); + /// ``` + pub fn includes

(&mut self, dirs: P) -> &mut Build + where + P: IntoIterator, + P::Item: AsRef, + { + for dir in dirs { + self.include(dir); + } + self + } + + /// Specify a `-D` variable with an optional value. + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .define("FOO", "BAR") + /// .define("BAZ", None) + /// .compile("foo"); + /// ``` + pub fn define<'a, V: Into>>(&mut self, var: &str, val: V) -> &mut Build { + self.definitions + .push((var.to_string(), val.into().map(|s| s.to_string()))); + self + } + + /// Add an arbitrary object file to link in + pub fn object>(&mut self, obj: P) -> &mut Build { + self.objects.push(obj.as_ref().to_path_buf()); + self + } + + /// Add an arbitrary flag to the invocation of the compiler + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .flag("-ffunction-sections") + /// .compile("foo"); + /// ``` + pub fn flag(&mut self, flag: &str) -> &mut Build { + self.flags.push(flag.to_string()); + self + } + + /// Add a flag to the invocation of the ar + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .file("src/bar.c") + /// .ar_flag("/NODEFAULTLIB:libc.dll") + /// .compile("foo"); + /// ``` + pub fn ar_flag(&mut self, flag: &str) -> &mut Build { + self.ar_flags.push(flag.to_string()); + self + } + + fn ensure_check_file(&self) -> Result { + let out_dir = self.get_out_dir()?; + let src = if self.cuda { + assert!(self.cpp); + out_dir.join("flag_check.cu") + } else if self.cpp { + out_dir.join("flag_check.cpp") + } else { + out_dir.join("flag_check.c") + }; + + if !src.exists() { + let mut f = fs::File::create(&src)?; + write!(f, "int main(void) {{ return 0; }}")?; + } + + Ok(src) + } + + /// Run the compiler to test if it accepts the given flag. + /// + /// For a convenience method for setting flags conditionally, + /// see `flag_if_supported()`. + /// + /// It may return error if it's unable to run the compiler with a test file + /// (e.g. the compiler is missing or a write to the `out_dir` failed). + /// + /// Note: Once computed, the result of this call is stored in the + /// `known_flag_support` field. If `is_flag_supported(flag)` + /// is called again, the result will be read from the hash table. + pub fn is_flag_supported(&self, flag: &str) -> Result { + let mut known_status = self.known_flag_support_status.lock().unwrap(); + if let Some(is_supported) = known_status.get(flag).cloned() { + return Ok(is_supported); + } + + let out_dir = self.get_out_dir()?; + let src = self.ensure_check_file()?; + let obj = out_dir.join("flag_check"); + let target = self.get_target()?; + let host = self.get_host()?; + let mut cfg = Build::new(); + cfg.flag(flag) + .target(&target) + .opt_level(0) + .host(&host) + .debug(false) + .cpp(self.cpp) + .cuda(self.cuda); + let mut compiler = cfg.try_get_compiler()?; + + // Clang uses stderr for verbose output, which yields a false positive + // result if the CFLAGS/CXXFLAGS include -v to aid in debugging. + if compiler.family.verbose_stderr() { + compiler.remove_arg("-v".into()); + } + + let mut cmd = compiler.to_command(); + let is_arm = target.contains("aarch64") || target.contains("arm"); + let clang = compiler.family == ToolFamily::Clang; + command_add_output_file( + &mut cmd, + &obj, + self.cuda, + target.contains("msvc"), + clang, + false, + is_arm, + ); + + // We need to explicitly tell msvc not to link and create an exe + // in the root directory of the crate + if target.contains("msvc") && !self.cuda { + cmd.arg("-c"); + } + + cmd.arg(&src); + + let output = cmd.output()?; + let is_supported = output.stderr.is_empty(); + + known_status.insert(flag.to_owned(), is_supported); + Ok(is_supported) + } + + /// Add an arbitrary flag to the invocation of the compiler if it supports it + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .flag_if_supported("-Wlogical-op") // only supported by GCC + /// .flag_if_supported("-Wunreachable-code") // only supported by clang + /// .compile("foo"); + /// ``` + pub fn flag_if_supported(&mut self, flag: &str) -> &mut Build { + self.flags_supported.push(flag.to_string()); + self + } + + /// Set the `-shared` flag. + /// + /// When enabled, the compiler will produce a shared object which can + /// then be linked with other objects to form an executable. + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .shared_flag(true) + /// .compile("libfoo.so"); + /// ``` + pub fn shared_flag(&mut self, shared_flag: bool) -> &mut Build { + self.shared_flag = Some(shared_flag); + self + } + + /// Set the `-static` flag. + /// + /// When enabled on systems that support dynamic linking, this prevents + /// linking with the shared libraries. + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .shared_flag(true) + /// .static_flag(true) + /// .compile("foo"); + /// ``` + pub fn static_flag(&mut self, static_flag: bool) -> &mut Build { + self.static_flag = Some(static_flag); + self + } + + /// Disables the generation of default compiler flags. The default compiler + /// flags may cause conflicts in some cross compiling scenarios. + /// + /// Setting the `CRATE_CC_NO_DEFAULTS` environment variable has the same + /// effect as setting this to `true`. The presence of the environment + /// variable and the value of `no_default_flags` will be OR'd together. + pub fn no_default_flags(&mut self, no_default_flags: bool) -> &mut Build { + self.no_default_flags = no_default_flags; + self + } + + /// Add a file which will be compiled + pub fn file>(&mut self, p: P) -> &mut Build { + self.files.push(p.as_ref().to_path_buf()); + self + } + + /// Add files which will be compiled + pub fn files

(&mut self, p: P) -> &mut Build + where + P: IntoIterator, + P::Item: AsRef, + { + for file in p.into_iter() { + self.file(file); + } + self + } + + /// Set C++ support. + /// + /// The other `cpp_*` options will only become active if this is set to + /// `true`. + pub fn cpp(&mut self, cpp: bool) -> &mut Build { + self.cpp = cpp; + self + } + + /// Set CUDA C++ support. + /// + /// Enabling CUDA will pass the detected C/C++ toolchain as an argument to + /// the CUDA compiler, NVCC. NVCC itself accepts some limited GNU-like args; + /// any other arguments for the C/C++ toolchain will be redirected using + /// "-Xcompiler" flags. + /// + /// If enabled, this also implicitly enables C++ support. + pub fn cuda(&mut self, cuda: bool) -> &mut Build { + self.cuda = cuda; + if cuda { + self.cpp = true; + self.cudart = Some("static".to_string()); + } + self + } + + /// Link CUDA run-time. + /// + /// This option mimics the `--cudart` NVCC command-line option. Just like + /// the original it accepts `{none|shared|static}`, with default being + /// `static`. The method has to be invoked after `.cuda(true)`, or not + /// at all, if the default is right for the project. + pub fn cudart(&mut self, cudart: &str) -> &mut Build { + if self.cuda { + self.cudart = Some(cudart.to_string()); + } + self + } + + /// Set warnings into errors flag. + /// + /// Disabled by default. + /// + /// Warning: turning warnings into errors only make sense + /// if you are a developer of the crate using cc-rs. + /// Some warnings only appear on some architecture or + /// specific version of the compiler. Any user of this crate, + /// or any other crate depending on it, could fail during + /// compile time. + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .warnings_into_errors(true) + /// .compile("libfoo.a"); + /// ``` + pub fn warnings_into_errors(&mut self, warnings_into_errors: bool) -> &mut Build { + self.warnings_into_errors = warnings_into_errors; + self + } + + /// Set warnings flags. + /// + /// Adds some flags: + /// - "-Wall" for MSVC. + /// - "-Wall", "-Wextra" for GNU and Clang. + /// + /// Enabled by default. + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .warnings(false) + /// .compile("libfoo.a"); + /// ``` + pub fn warnings(&mut self, warnings: bool) -> &mut Build { + self.warnings = Some(warnings); + self.extra_warnings = Some(warnings); + self + } + + /// Set extra warnings flags. + /// + /// Adds some flags: + /// - nothing for MSVC. + /// - "-Wextra" for GNU and Clang. + /// + /// Enabled by default. + /// + /// # Example + /// + /// ```no_run + /// // Disables -Wextra, -Wall remains enabled: + /// cc::Build::new() + /// .file("src/foo.c") + /// .extra_warnings(false) + /// .compile("libfoo.a"); + /// ``` + pub fn extra_warnings(&mut self, warnings: bool) -> &mut Build { + self.extra_warnings = Some(warnings); + self + } + + /// Set the standard library to link against when compiling with C++ + /// support. + /// + /// See [`get_cpp_link_stdlib`](cc::Build::get_cpp_link_stdlib) documentation + /// for the default value. + /// If the `CXXSTDLIB` environment variable is set, its value will + /// override the default value, but not the value explicitly set by calling + /// this function. + /// + /// A value of `None` indicates that no automatic linking should happen, + /// otherwise cargo will link against the specified library. + /// + /// The given library name must not contain the `lib` prefix. + /// + /// Common values: + /// - `stdc++` for GNU + /// - `c++` for Clang + /// - `c++_shared` or `c++_static` for Android + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .shared_flag(true) + /// .cpp_link_stdlib("stdc++") + /// .compile("libfoo.so"); + /// ``` + pub fn cpp_link_stdlib<'a, V: Into>>( + &mut self, + cpp_link_stdlib: V, + ) -> &mut Build { + self.cpp_link_stdlib = Some(cpp_link_stdlib.into().map(|s| s.into())); + self + } + + /// Force the C++ compiler to use the specified standard library. + /// + /// Setting this option will automatically set `cpp_link_stdlib` to the same + /// value. + /// + /// The default value of this option is always `None`. + /// + /// This option has no effect when compiling for a Visual Studio based + /// target. + /// + /// This option sets the `-stdlib` flag, which is only supported by some + /// compilers (clang, icc) but not by others (gcc). The library will not + /// detect which compiler is used, as such it is the responsibility of the + /// caller to ensure that this option is only used in conjunction with a + /// compiler which supports the `-stdlib` flag. + /// + /// A value of `None` indicates that no specific C++ standard library should + /// be used, otherwise `-stdlib` is added to the compile invocation. + /// + /// The given library name must not contain the `lib` prefix. + /// + /// Common values: + /// - `stdc++` for GNU + /// - `c++` for Clang + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .cpp_set_stdlib("c++") + /// .compile("libfoo.a"); + /// ``` + pub fn cpp_set_stdlib<'a, V: Into>>( + &mut self, + cpp_set_stdlib: V, + ) -> &mut Build { + let cpp_set_stdlib = cpp_set_stdlib.into(); + self.cpp_set_stdlib = cpp_set_stdlib.map(|s| s.into()); + self.cpp_link_stdlib(cpp_set_stdlib); + self + } + + /// Configures the target this configuration will be compiling for. + /// + /// This option is automatically scraped from the `TARGET` environment + /// variable by build scripts, so it's not required to call this function. + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .target("aarch64-linux-android") + /// .compile("foo"); + /// ``` + pub fn target(&mut self, target: &str) -> &mut Build { + self.target = Some(target.to_string()); + self + } + + /// Configures the host assumed by this configuration. + /// + /// This option is automatically scraped from the `HOST` environment + /// variable by build scripts, so it's not required to call this function. + /// + /// # Example + /// + /// ```no_run + /// cc::Build::new() + /// .file("src/foo.c") + /// .host("arm-linux-gnueabihf") + /// .compile("foo"); + /// ``` + pub fn host(&mut self, host: &str) -> &mut Build { + self.host = Some(host.to_string()); + self + } + + /// Configures the optimization level of the generated object files. + /// + /// This option is automatically scraped from the `OPT_LEVEL` environment + /// variable by build scripts, so it's not required to call this function. + pub fn opt_level(&mut self, opt_level: u32) -> &mut Build { + self.opt_level = Some(opt_level.to_string()); + self + } + + /// Configures the optimization level of the generated object files. + /// + /// This option is automatically scraped from the `OPT_LEVEL` environment + /// variable by build scripts, so it's not required to call this function. + pub fn opt_level_str(&mut self, opt_level: &str) -> &mut Build { + self.opt_level = Some(opt_level.to_string()); + self + } + + /// Configures whether the compiler will emit debug information when + /// generating object files. + /// + /// This option is automatically scraped from the `DEBUG` environment + /// variable by build scripts, so it's not required to call this function. + pub fn debug(&mut self, debug: bool) -> &mut Build { + self.debug = Some(debug); + self + } + + /// Configures whether the compiler will emit instructions to store + /// frame pointers during codegen. + /// + /// This option is automatically enabled when debug information is emitted. + /// Otherwise the target platform compiler's default will be used. + /// You can use this option to force a specific setting. + pub fn force_frame_pointer(&mut self, force: bool) -> &mut Build { + self.force_frame_pointer = Some(force); + self + } + + /// Configures the output directory where all object files and static + /// libraries will be located. + /// + /// This option is automatically scraped from the `OUT_DIR` environment + /// variable by build scripts, so it's not required to call this function. + pub fn out_dir>(&mut self, out_dir: P) -> &mut Build { + self.out_dir = Some(out_dir.as_ref().to_owned()); + self + } + + /// Configures the compiler to be used to produce output. + /// + /// This option is automatically determined from the target platform or a + /// number of environment variables, so it's not required to call this + /// function. + pub fn compiler>(&mut self, compiler: P) -> &mut Build { + self.compiler = Some(compiler.as_ref().to_owned()); + self + } + + /// Configures the tool used to assemble archives. + /// + /// This option is automatically determined from the target platform or a + /// number of environment variables, so it's not required to call this + /// function. + pub fn archiver>(&mut self, archiver: P) -> &mut Build { + self.archiver = Some(archiver.as_ref().to_owned()); + self + } + /// Define whether metadata should be emitted for cargo allowing it to + /// automatically link the binary. Defaults to `true`. + /// + /// The emitted metadata is: + /// + /// - `rustc-link-lib=static=`*compiled lib* + /// - `rustc-link-search=native=`*target folder* + /// - When target is MSVC, the ATL-MFC libs are added via `rustc-link-search=native=` + /// - When C++ is enabled, the C++ stdlib is added via `rustc-link-lib` + /// + pub fn cargo_metadata(&mut self, cargo_metadata: bool) -> &mut Build { + self.cargo_metadata = cargo_metadata; + self + } + + /// Configures whether the compiler will emit position independent code. + /// + /// This option defaults to `false` for `windows-gnu` and bare metal targets and + /// to `true` for all other targets. + pub fn pic(&mut self, pic: bool) -> &mut Build { + self.pic = Some(pic); + self + } + + /// Configures whether the Procedure Linkage Table is used for indirect + /// calls into shared libraries. + /// + /// The PLT is used to provide features like lazy binding, but introduces + /// a small performance loss due to extra pointer indirection. Setting + /// `use_plt` to `false` can provide a small performance increase. + /// + /// Note that skipping the PLT requires a recent version of GCC/Clang. + /// + /// This only applies to ELF targets. It has no effect on other platforms. + pub fn use_plt(&mut self, use_plt: bool) -> &mut Build { + self.use_plt = Some(use_plt); + self + } + + /// Configures whether the /MT flag or the /MD flag will be passed to msvc build tools. + /// + /// This option defaults to `false`, and affect only msvc targets. + pub fn static_crt(&mut self, static_crt: bool) -> &mut Build { + self.static_crt = Some(static_crt); + self + } + + #[doc(hidden)] + pub fn __set_env(&mut self, a: A, b: B) -> &mut Build + where + A: AsRef, + B: AsRef, + { + self.env + .push((a.as_ref().to_owned(), b.as_ref().to_owned())); + self + } + + /// Run the compiler, generating the file `output` + /// + /// This will return a result instead of panicing; see compile() for the complete description. + pub fn try_compile(&self, output: &str) -> Result<(), Error> { + let mut output_components = Path::new(output).components(); + match (output_components.next(), output_components.next()) { + (Some(Component::Normal(_)), None) => {} + _ => { + return Err(Error::new( + ErrorKind::InvalidArgument, + "argument of `compile` must be a single normal path component", + )); + } + } + + let (lib_name, gnu_lib_name) = if output.starts_with("lib") && output.ends_with(".a") { + (&output[3..output.len() - 2], output.to_owned()) + } else { + let mut gnu = String::with_capacity(5 + output.len()); + gnu.push_str("lib"); + gnu.push_str(&output); + gnu.push_str(".a"); + (output, gnu) + }; + let dst = self.get_out_dir()?; + + let mut objects = Vec::new(); + for file in self.files.iter() { + let obj = dst.join(file).with_extension("o"); + let obj = if !obj.starts_with(&dst) { + dst.join(obj.file_name().ok_or_else(|| { + Error::new(ErrorKind::IOError, "Getting object file details failed.") + })?) + } else { + obj + }; + + match obj.parent() { + Some(s) => fs::create_dir_all(s)?, + None => { + return Err(Error::new( + ErrorKind::IOError, + "Getting object file details failed.", + )); + } + }; + + objects.push(Object::new(file.to_path_buf(), obj)); + } + self.compile_objects(&objects)?; + self.assemble(lib_name, &dst.join(gnu_lib_name), &objects)?; + + if self.get_target()?.contains("msvc") { + let compiler = self.get_base_compiler()?; + let atlmfc_lib = compiler + .env() + .iter() + .find(|&&(ref var, _)| var.as_os_str() == OsStr::new("LIB")) + .and_then(|&(_, ref lib_paths)| { + env::split_paths(lib_paths).find(|path| { + let sub = Path::new("atlmfc/lib"); + path.ends_with(sub) || path.parent().map_or(false, |p| p.ends_with(sub)) + }) + }); + + if let Some(atlmfc_lib) = atlmfc_lib { + self.print(&format!( + "cargo:rustc-link-search=native={}", + atlmfc_lib.display() + )); + } + } + + self.print(&format!("cargo:rustc-link-lib=static={}", lib_name)); + self.print(&format!("cargo:rustc-link-search=native={}", dst.display())); + + // Add specific C++ libraries, if enabled. + if self.cpp { + if let Some(stdlib) = self.get_cpp_link_stdlib()? { + self.print(&format!("cargo:rustc-link-lib={}", stdlib)); + } + } + + let cudart = match &self.cudart { + Some(opt) => opt.as_str(), // {none|shared|static} + None => "none", + }; + if cudart != "none" { + if let Some(nvcc) = which(&self.get_compiler().path) { + // Try to figure out the -L search path. If it fails, + // it's on user to specify one by passing it through + // RUSTFLAGS environment variable. + let mut libtst = false; + let mut libdir = nvcc; + libdir.pop(); // remove 'nvcc' + libdir.push(".."); + let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap(); + if cfg!(target_os = "linux") { + libdir.push("targets"); + libdir.push(target_arch.to_owned() + "-linux"); + libdir.push("lib"); + libtst = true; + } else if cfg!(target_env = "msvc") { + libdir.push("lib"); + match target_arch.as_str() { + "x86_64" => { + libdir.push("x64"); + libtst = true; + } + "x86" => { + libdir.push("Win32"); + libtst = true; + } + _ => libtst = false, + } + } + if libtst && libdir.is_dir() { + println!( + "cargo:rustc-link-search=native={}", + libdir.to_str().unwrap() + ); + } + + // And now the -l flag. + let lib = match cudart { + "shared" => "cudart", + "static" => "cudart_static", + bad => panic!("unsupported cudart option: {}", bad), + }; + println!("cargo:rustc-link-lib={}", lib); + } + } + + Ok(()) + } + + /// Run the compiler, generating the file `output` + /// + /// # Library name + /// + /// The `output` string argument determines the file name for the compiled + /// library. The Rust compiler will create an assembly named "lib"+output+".a". + /// MSVC will create a file named output+".lib". + /// + /// The choice of `output` is close to arbitrary, but: + /// + /// - must be nonempty, + /// - must not contain a path separator (`/`), + /// - must be unique across all `compile` invocations made by the same build + /// script. + /// + /// If your build script compiles a single source file, the base name of + /// that source file would usually be reasonable: + /// + /// ```no_run + /// cc::Build::new().file("blobstore.c").compile("blobstore"); + /// ``` + /// + /// Compiling multiple source files, some people use their crate's name, or + /// their crate's name + "-cc". + /// + /// Otherwise, please use your imagination. + /// + /// For backwards compatibility, if `output` starts with "lib" *and* ends + /// with ".a", a second "lib" prefix and ".a" suffix do not get added on, + /// but this usage is deprecated; please omit `lib` and `.a` in the argument + /// that you pass. + /// + /// # Panics + /// + /// Panics if `output` is not formatted correctly or if one of the underlying + /// compiler commands fails. It can also panic if it fails reading file names + /// or creating directories. + pub fn compile(&self, output: &str) { + if let Err(e) = self.try_compile(output) { + fail(&e.message); + } + } + + #[cfg(feature = "parallel")] + fn compile_objects<'me>(&'me self, objs: &[Object]) -> Result<(), Error> { + use std::sync::atomic::{AtomicBool, Ordering::SeqCst}; + use std::sync::Once; + + // Limit our parallelism globally with a jobserver. Start off by + // releasing our own token for this process so we can have a bit of an + // easier to write loop below. If this fails, though, then we're likely + // on Windows with the main implicit token, so we just have a bit extra + // parallelism for a bit and don't reacquire later. + let server = jobserver(); + let reacquire = server.release_raw().is_ok(); + + // When compiling objects in parallel we do a few dirty tricks to speed + // things up: + // + // * First is that we use the `jobserver` crate to limit the parallelism + // of this build script. The `jobserver` crate will use a jobserver + // configured by Cargo for build scripts to ensure that parallelism is + // coordinated across C compilations and Rust compilations. Before we + // compile anything we make sure to wait until we acquire a token. + // + // Note that this jobserver is cached globally so we only used one per + // process and only worry about creating it once. + // + // * Next we use a raw `thread::spawn` per thread to actually compile + // objects in parallel. We only actually spawn a thread after we've + // acquired a token to perform some work + // + // * Finally though we want to keep the dependencies of this crate + // pretty light, so we avoid using a safe abstraction like `rayon` and + // instead rely on some bits of `unsafe` code. We know that this stack + // frame persists while everything is compiling so we use all the + // stack-allocated objects without cloning/reallocating. We use a + // transmute to `State` with a `'static` lifetime to persist + // everything we need across the boundary, and the join-on-drop + // semantics of `JoinOnDrop` should ensure that our stack frame is + // alive while threads are alive. + // + // With all that in mind we compile all objects in a loop here, after we + // acquire the appropriate tokens, Once all objects have been compiled + // we join on all the threads and propagate the results of compilation. + // + // Note that as a slight optimization we try to break out as soon as + // possible as soon as any compilation fails to ensure that errors get + // out to the user as fast as possible. + let error = AtomicBool::new(false); + let mut threads = Vec::new(); + for obj in objs { + if error.load(SeqCst) { + break; + } + let token = server.acquire()?; + let state = State { + build: self, + obj, + error: &error, + }; + let state = unsafe { std::mem::transmute::>(state) }; + let thread = thread::spawn(|| { + let state: State<'me> = state; // erase the `'static` lifetime + let result = state.build.compile_object(state.obj); + if result.is_err() { + state.error.store(true, SeqCst); + } + drop(token); // make sure our jobserver token is released after the compile + return result; + }); + threads.push(JoinOnDrop(Some(thread))); + } + + for mut thread in threads { + if let Some(thread) = thread.0.take() { + thread.join().expect("thread should not panic")?; + } + } + + // Reacquire our process's token before we proceed, which we released + // before entering the loop above. + if reacquire { + server.acquire_raw()?; + } + + return Ok(()); + + /// Shared state from the parent thread to the child thread. This + /// package of pointers is temporarily transmuted to a `'static` + /// lifetime to cross the thread boundary and then once the thread is + /// running we erase the `'static` to go back to an anonymous lifetime. + struct State<'a> { + build: &'a Build, + obj: &'a Object, + error: &'a AtomicBool, + } + + /// Returns a suitable `jobserver::Client` used to coordinate + /// parallelism between build scripts. + fn jobserver() -> &'static jobserver::Client { + static INIT: Once = Once::new(); + static mut JOBSERVER: Option = None; + + fn _assert_sync() {} + _assert_sync::(); + + unsafe { + INIT.call_once(|| { + let server = default_jobserver(); + JOBSERVER = Some(server); + }); + JOBSERVER.as_ref().unwrap() + } + } + + unsafe fn default_jobserver() -> jobserver::Client { + // Try to use the environmental jobserver which Cargo typically + // initializes for us... + if let Some(client) = jobserver::Client::from_env() { + return client; + } + + // ... but if that fails for whatever reason select something + // reasonable and crate a new jobserver. Use `NUM_JOBS` if set (it's + // configured by Cargo) and otherwise just fall back to a + // semi-reasonable number. Note that we could use `num_cpus` here + // but it's an extra dependency that will almost never be used, so + // it's generally not too worth it. + let mut parallelism = 4; + if let Ok(amt) = env::var("NUM_JOBS") { + if let Ok(amt) = amt.parse() { + parallelism = amt; + } + } + + // If we create our own jobserver then be sure to reserve one token + // for ourselves. + let client = jobserver::Client::new(parallelism).expect("failed to create jobserver"); + client.acquire_raw().expect("failed to acquire initial"); + return client; + } + + struct JoinOnDrop(Option>>); + + impl Drop for JoinOnDrop { + fn drop(&mut self) { + if let Some(thread) = self.0.take() { + drop(thread.join()); + } + } + } + } + + #[cfg(not(feature = "parallel"))] + fn compile_objects(&self, objs: &[Object]) -> Result<(), Error> { + for obj in objs { + self.compile_object(obj)?; + } + Ok(()) + } + + fn compile_object(&self, obj: &Object) -> Result<(), Error> { + let is_asm = obj.src.extension().and_then(|s| s.to_str()) == Some("asm"); + let target = self.get_target()?; + let msvc = target.contains("msvc"); + let compiler = self.try_get_compiler()?; + let clang = compiler.family == ToolFamily::Clang; + let (mut cmd, name) = if msvc && is_asm { + self.msvc_macro_assembler()? + } else { + let mut cmd = compiler.to_command(); + for &(ref a, ref b) in self.env.iter() { + cmd.env(a, b); + } + ( + cmd, + compiler + .path + .file_name() + .ok_or_else(|| Error::new(ErrorKind::IOError, "Failed to get compiler path."))? + .to_string_lossy() + .into_owned(), + ) + }; + let is_arm = target.contains("aarch64") || target.contains("arm"); + command_add_output_file(&mut cmd, &obj.dst, self.cuda, msvc, clang, is_asm, is_arm); + // armasm and armasm64 don't requrie -c option + if !msvc || !is_asm || !is_arm { + cmd.arg("-c"); + } + if self.cuda && self.files.len() > 1 { + cmd.arg("--device-c"); + } + cmd.arg(&obj.src); + if cfg!(target_os = "macos") { + self.fix_env_for_apple_os(&mut cmd)?; + } + + run(&mut cmd, &name)?; + Ok(()) + } + + /// This will return a result instead of panicing; see expand() for the complete description. + pub fn try_expand(&self) -> Result, Error> { + let compiler = self.try_get_compiler()?; + let mut cmd = compiler.to_command(); + for &(ref a, ref b) in self.env.iter() { + cmd.env(a, b); + } + cmd.arg("-E"); + + assert!( + self.files.len() <= 1, + "Expand may only be called for a single file" + ); + + for file in self.files.iter() { + cmd.arg(file); + } + + let name = compiler + .path + .file_name() + .ok_or_else(|| Error::new(ErrorKind::IOError, "Failed to get compiler path."))? + .to_string_lossy() + .into_owned(); + + Ok(run_output(&mut cmd, &name)?) + } + + /// Run the compiler, returning the macro-expanded version of the input files. + /// + /// This is only relevant for C and C++ files. + /// + /// # Panics + /// Panics if more than one file is present in the config, or if compiler + /// path has an invalid file name. + /// + /// # Example + /// ```no_run + /// let out = cc::Build::new().file("src/foo.c").expand(); + /// ``` + pub fn expand(&self) -> Vec { + match self.try_expand() { + Err(e) => fail(&e.message), + Ok(v) => v, + } + } + + /// Get the compiler that's in use for this configuration. + /// + /// This function will return a `Tool` which represents the culmination + /// of this configuration at a snapshot in time. The returned compiler can + /// be inspected (e.g. the path, arguments, environment) to forward along to + /// other tools, or the `to_command` method can be used to invoke the + /// compiler itself. + /// + /// This method will take into account all configuration such as debug + /// information, optimization level, include directories, defines, etc. + /// Additionally, the compiler binary in use follows the standard + /// conventions for this path, e.g. looking at the explicitly set compiler, + /// environment variables (a number of which are inspected here), and then + /// falling back to the default configuration. + /// + /// # Panics + /// + /// Panics if an error occurred while determining the architecture. + pub fn get_compiler(&self) -> Tool { + match self.try_get_compiler() { + Ok(tool) => tool, + Err(e) => fail(&e.message), + } + } + + /// Get the compiler that's in use for this configuration. + /// + /// This will return a result instead of panicing; see get_compiler() for the complete description. + pub fn try_get_compiler(&self) -> Result { + let opt_level = self.get_opt_level()?; + let target = self.get_target()?; + + let mut cmd = self.get_base_compiler()?; + let envflags = self.envflags(if self.cpp { "CXXFLAGS" } else { "CFLAGS" }); + + // Disable default flag generation via `no_default_flags` or environment variable + let no_defaults = self.no_default_flags || self.getenv("CRATE_CC_NO_DEFAULTS").is_some(); + + if !no_defaults { + self.add_default_flags(&mut cmd, &target, &opt_level)?; + } else { + println!("Info: default compiler flags are disabled"); + } + + for arg in envflags { + cmd.push_cc_arg(arg.into()); + } + + for directory in self.include_directories.iter() { + cmd.args.push("-I".into()); + cmd.args.push(directory.into()); + } + + // If warnings and/or extra_warnings haven't been explicitly set, + // then we set them only if the environment doesn't already have + // CFLAGS/CXXFLAGS, since those variables presumably already contain + // the desired set of warnings flags. + + if self + .warnings + .unwrap_or(if self.has_flags() { false } else { true }) + { + let wflags = cmd.family.warnings_flags().into(); + cmd.push_cc_arg(wflags); + } + + if self + .extra_warnings + .unwrap_or(if self.has_flags() { false } else { true }) + { + if let Some(wflags) = cmd.family.extra_warnings_flags() { + cmd.push_cc_arg(wflags.into()); + } + } + + for flag in self.flags.iter() { + cmd.args.push(flag.into()); + } + + for flag in self.flags_supported.iter() { + if self.is_flag_supported(flag).unwrap_or(false) { + cmd.push_cc_arg(flag.into()); + } + } + + for &(ref key, ref value) in self.definitions.iter() { + if let Some(ref value) = *value { + cmd.args.push(format!("-D{}={}", key, value).into()); + } else { + cmd.args.push(format!("-D{}", key).into()); + } + } + + if self.warnings_into_errors { + let warnings_to_errors_flag = cmd.family.warnings_to_errors_flag().into(); + cmd.push_cc_arg(warnings_to_errors_flag); + } + + Ok(cmd) + } + + fn add_default_flags( + &self, + cmd: &mut Tool, + target: &str, + opt_level: &str, + ) -> Result<(), Error> { + // Non-target flags + // If the flag is not conditioned on target variable, it belongs here :) + match cmd.family { + ToolFamily::Msvc { .. } => { + cmd.push_cc_arg("-nologo".into()); + + let crt_flag = match self.static_crt { + Some(true) => "-MT", + Some(false) => "-MD", + None => { + let features = self + .getenv("CARGO_CFG_TARGET_FEATURE") + .unwrap_or(String::new()); + if features.contains("crt-static") { + "-MT" + } else { + "-MD" + } + } + }; + cmd.push_cc_arg(crt_flag.into()); + + match &opt_level[..] { + // Msvc uses /O1 to enable all optimizations that minimize code size. + "z" | "s" | "1" => cmd.push_opt_unless_duplicate("-O1".into()), + // -O3 is a valid value for gcc and clang compilers, but not msvc. Cap to /O2. + "2" | "3" => cmd.push_opt_unless_duplicate("-O2".into()), + _ => {} + } + } + ToolFamily::Gnu | ToolFamily::Clang => { + // arm-linux-androideabi-gcc 4.8 shipped with Android NDK does + // not support '-Oz' + if opt_level == "z" && cmd.family != ToolFamily::Clang { + cmd.push_opt_unless_duplicate("-Os".into()); + } else { + cmd.push_opt_unless_duplicate(format!("-O{}", opt_level).into()); + } + + if cmd.family == ToolFamily::Clang && target.contains("android") { + // For compatibility with code that doesn't use pre-defined `__ANDROID__` macro. + // If compiler used via ndk-build or cmake (officially supported build methods) + // this macros is defined. + // See https://android.googlesource.com/platform/ndk/+/refs/heads/ndk-release-r21/build/cmake/android.toolchain.cmake#456 + // https://android.googlesource.com/platform/ndk/+/refs/heads/ndk-release-r21/build/core/build-binary.mk#141 + cmd.push_opt_unless_duplicate("-DANDROID".into()); + } + + if !target.contains("apple-ios") { + cmd.push_cc_arg("-ffunction-sections".into()); + cmd.push_cc_arg("-fdata-sections".into()); + } + // Disable generation of PIC on bare-metal for now: rust-lld doesn't support this yet + if self.pic.unwrap_or( + !target.contains("windows") + && !target.contains("-none-") + && !target.contains("uefi"), + ) { + cmd.push_cc_arg("-fPIC".into()); + // PLT only applies if code is compiled with PIC support, + // and only for ELF targets. + if target.contains("linux") && !self.use_plt.unwrap_or(true) { + cmd.push_cc_arg("-fno-plt".into()); + } + } + } + } + + if self.get_debug() { + if self.cuda { + // NVCC debug flag + cmd.args.push("-G".into()); + } + let family = cmd.family; + family.add_debug_flags(cmd); + } + + if self.get_force_frame_pointer() { + let family = cmd.family; + family.add_force_frame_pointer(cmd); + } + + // Target flags + match cmd.family { + ToolFamily::Clang => { + if !(target.contains("android") + && android_clang_compiler_uses_target_arg_internally(&cmd.path)) + { + if target.contains("darwin") { + if let Some(arch) = + map_darwin_target_from_rust_to_compiler_architecture(target) + { + cmd.args + .push(format!("--target={}-apple-darwin", arch).into()); + } + } else if target.contains("macabi") { + if let Some(arch) = + map_darwin_target_from_rust_to_compiler_architecture(target) + { + cmd.args + .push(format!("--target={}-apple-ios13.0-macabi", arch).into()); + } + } else if target.contains("ios-sim") { + if let Some(arch) = + map_darwin_target_from_rust_to_compiler_architecture(target) + { + let deployment_target = env::var("IPHONEOS_DEPLOYMENT_TARGET") + .unwrap_or_else(|_| "7.0".into()); + cmd.args.push( + format!( + "--target={}-apple-ios{}-simulator", + arch, deployment_target + ) + .into(), + ); + } + } else if target.starts_with("riscv64gc-") { + cmd.args.push( + format!("--target={}", target.replace("riscv64gc", "riscv64")).into(), + ); + } else if target.starts_with("riscv32gc-") { + cmd.args.push( + format!("--target={}", target.replace("riscv32gc", "riscv32")).into(), + ); + } else if target.contains("uefi") { + if target.contains("x86_64") { + cmd.args.push("--target=x86_64-unknown-windows-gnu".into()); + } else if target.contains("i686") { + cmd.args.push("--target=i686-unknown-windows-gnu".into()) + } else if target.contains("aarch64") { + cmd.args.push("--target=aarch64-unknown-windows-gnu".into()) + } + } else { + cmd.args.push(format!("--target={}", target).into()); + } + } + } + ToolFamily::Msvc { clang_cl } => { + // This is an undocumented flag from MSVC but helps with making + // builds more reproducible by avoiding putting timestamps into + // files. + cmd.push_cc_arg("-Brepro".into()); + + if clang_cl { + if target.contains("x86_64") { + cmd.push_cc_arg("-m64".into()); + } else if target.contains("86") { + cmd.push_cc_arg("-m32".into()); + cmd.push_cc_arg("-arch:IA32".into()); + } else { + cmd.push_cc_arg(format!("--target={}", target).into()); + } + } else { + if target.contains("i586") { + cmd.push_cc_arg("-arch:IA32".into()); + } + } + + // There is a check in corecrt.h that will generate a + // compilation error if + // _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE is + // not defined to 1. The check was added in Windows + // 8 days because only store apps were allowed on ARM. + // This changed with the release of Windows 10 IoT Core. + // The check will be going away in future versions of + // the SDK, but for all released versions of the + // Windows SDK it is required. + if target.contains("arm") || target.contains("thumb") { + cmd.args + .push("-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1".into()); + } + } + ToolFamily::Gnu => { + if target.contains("i686") || target.contains("i586") { + cmd.args.push("-m32".into()); + } else if target == "x86_64-unknown-linux-gnux32" { + cmd.args.push("-mx32".into()); + } else if target.contains("x86_64") || target.contains("powerpc64") { + cmd.args.push("-m64".into()); + } + + if target.contains("darwin") { + if let Some(arch) = map_darwin_target_from_rust_to_compiler_architecture(target) + { + cmd.args.push("-arch".into()); + cmd.args.push(arch.into()); + } + } + + if target.contains("-kmc-solid_") { + cmd.args.push("-finput-charset=utf-8".into()); + } + + if self.static_flag.is_none() { + let features = self + .getenv("CARGO_CFG_TARGET_FEATURE") + .unwrap_or(String::new()); + if features.contains("crt-static") { + cmd.args.push("-static".into()); + } + } + + // armv7 targets get to use armv7 instructions + if (target.starts_with("armv7") || target.starts_with("thumbv7")) + && (target.contains("-linux-") || target.contains("-kmc-solid_")) + { + cmd.args.push("-march=armv7-a".into()); + + if target.ends_with("eabihf") { + // lowest common denominator FPU + cmd.args.push("-mfpu=vfpv3-d16".into()); + } + } + + // (x86 Android doesn't say "eabi") + if target.contains("-androideabi") && target.contains("v7") { + // -march=armv7-a handled above + cmd.args.push("-mthumb".into()); + if !target.contains("neon") { + // On android we can guarantee some extra float instructions + // (specified in the android spec online) + // NEON guarantees even more; see below. + cmd.args.push("-mfpu=vfpv3-d16".into()); + } + cmd.args.push("-mfloat-abi=softfp".into()); + } + + if target.contains("neon") { + cmd.args.push("-mfpu=neon-vfpv4".into()); + } + + if target.starts_with("armv4t-unknown-linux-") { + cmd.args.push("-march=armv4t".into()); + cmd.args.push("-marm".into()); + cmd.args.push("-mfloat-abi=soft".into()); + } + + if target.starts_with("armv5te-unknown-linux-") { + cmd.args.push("-march=armv5te".into()); + cmd.args.push("-marm".into()); + cmd.args.push("-mfloat-abi=soft".into()); + } + + // For us arm == armv6 by default + if target.starts_with("arm-unknown-linux-") { + cmd.args.push("-march=armv6".into()); + cmd.args.push("-marm".into()); + if target.ends_with("hf") { + cmd.args.push("-mfpu=vfp".into()); + } else { + cmd.args.push("-mfloat-abi=soft".into()); + } + } + + // We can guarantee some settings for FRC + if target.starts_with("arm-frc-") { + cmd.args.push("-march=armv7-a".into()); + cmd.args.push("-mcpu=cortex-a9".into()); + cmd.args.push("-mfpu=vfpv3".into()); + cmd.args.push("-mfloat-abi=softfp".into()); + cmd.args.push("-marm".into()); + } + + // Turn codegen down on i586 to avoid some instructions. + if target.starts_with("i586-unknown-linux-") { + cmd.args.push("-march=pentium".into()); + } + + // Set codegen level for i686 correctly + if target.starts_with("i686-unknown-linux-") { + cmd.args.push("-march=i686".into()); + } + + // Looks like `musl-gcc` makes it hard for `-m32` to make its way + // all the way to the linker, so we need to actually instruct the + // linker that we're generating 32-bit executables as well. This'll + // typically only be used for build scripts which transitively use + // these flags that try to compile executables. + if target == "i686-unknown-linux-musl" || target == "i586-unknown-linux-musl" { + cmd.args.push("-Wl,-melf_i386".into()); + } + + if target.starts_with("thumb") { + cmd.args.push("-mthumb".into()); + + if target.ends_with("eabihf") { + cmd.args.push("-mfloat-abi=hard".into()) + } + } + if target.starts_with("thumbv6m") { + cmd.args.push("-march=armv6s-m".into()); + } + if target.starts_with("thumbv7em") { + cmd.args.push("-march=armv7e-m".into()); + + if target.ends_with("eabihf") { + cmd.args.push("-mfpu=fpv4-sp-d16".into()) + } + } + if target.starts_with("thumbv7m") { + cmd.args.push("-march=armv7-m".into()); + } + if target.starts_with("thumbv8m.base") { + cmd.args.push("-march=armv8-m.base".into()); + } + if target.starts_with("thumbv8m.main") { + cmd.args.push("-march=armv8-m.main".into()); + + if target.ends_with("eabihf") { + cmd.args.push("-mfpu=fpv5-sp-d16".into()) + } + } + if target.starts_with("armebv7r") | target.starts_with("armv7r") { + if target.starts_with("armeb") { + cmd.args.push("-mbig-endian".into()); + } else { + cmd.args.push("-mlittle-endian".into()); + } + + // ARM mode + cmd.args.push("-marm".into()); + + // R Profile + cmd.args.push("-march=armv7-r".into()); + + if target.ends_with("eabihf") { + // Calling convention + cmd.args.push("-mfloat-abi=hard".into()); + + // lowest common denominator FPU + // (see Cortex-R4 technical reference manual) + cmd.args.push("-mfpu=vfpv3-d16".into()) + } else { + // Calling convention + cmd.args.push("-mfloat-abi=soft".into()); + } + } + if target.starts_with("armv7a") { + cmd.args.push("-march=armv7-a".into()); + + if target.ends_with("eabihf") { + // lowest common denominator FPU + cmd.args.push("-mfpu=vfpv3-d16".into()); + } + } + if target.starts_with("riscv32") || target.starts_with("riscv64") { + // get the 32i/32imac/32imc/64gc/64imac/... part + let mut parts = target.split('-'); + if let Some(arch) = parts.next() { + let arch = &arch[5..]; + if target.contains("linux") && arch.starts_with("64") { + cmd.args.push(("-march=rv64gc").into()); + cmd.args.push("-mabi=lp64d".into()); + } else if target.contains("freebsd") && arch.starts_with("64") { + cmd.args.push(("-march=rv64gc").into()); + cmd.args.push("-mabi=lp64d".into()); + } else if target.contains("openbsd") && arch.starts_with("64") { + cmd.args.push(("-march=rv64gc").into()); + cmd.args.push("-mabi=lp64d".into()); + } else if target.contains("linux") && arch.starts_with("32") { + cmd.args.push(("-march=rv32gc").into()); + cmd.args.push("-mabi=ilp32d".into()); + } else if arch.starts_with("64") { + cmd.args.push(("-march=rv".to_owned() + arch).into()); + cmd.args.push("-mabi=lp64".into()); + } else { + cmd.args.push(("-march=rv".to_owned() + arch).into()); + cmd.args.push("-mabi=ilp32".into()); + } + cmd.args.push("-mcmodel=medany".into()); + } + } + } + } + + if target.contains("apple-ios") { + self.ios_flags(cmd)?; + } + + if self.static_flag.unwrap_or(false) { + cmd.args.push("-static".into()); + } + if self.shared_flag.unwrap_or(false) { + cmd.args.push("-shared".into()); + } + + if self.cpp { + match (self.cpp_set_stdlib.as_ref(), cmd.family) { + (None, _) => {} + (Some(stdlib), ToolFamily::Gnu) | (Some(stdlib), ToolFamily::Clang) => { + cmd.push_cc_arg(format!("-stdlib=lib{}", stdlib).into()); + } + _ => { + println!( + "cargo:warning=cpp_set_stdlib is specified, but the {:?} compiler \ + does not support this option, ignored", + cmd.family + ); + } + } + } + + Ok(()) + } + + fn has_flags(&self) -> bool { + let flags_env_var_name = if self.cpp { "CXXFLAGS" } else { "CFLAGS" }; + let flags_env_var_value = self.get_var(flags_env_var_name); + if let Ok(_) = flags_env_var_value { + true + } else { + false + } + } + + fn msvc_macro_assembler(&self) -> Result<(Command, String), Error> { + let target = self.get_target()?; + let tool = if target.contains("x86_64") { + "ml64.exe" + } else if target.contains("arm") { + "armasm.exe" + } else if target.contains("aarch64") { + "armasm64.exe" + } else { + "ml.exe" + }; + let mut cmd = windows_registry::find(&target, tool).unwrap_or_else(|| self.cmd(tool)); + cmd.arg("-nologo"); // undocumented, yet working with armasm[64] + for directory in self.include_directories.iter() { + cmd.arg("-I").arg(directory); + } + if target.contains("aarch64") || target.contains("arm") { + println!("cargo:warning=The MSVC ARM assemblers do not support -D flags"); + } else { + for &(ref key, ref value) in self.definitions.iter() { + if let Some(ref value) = *value { + cmd.arg(&format!("-D{}={}", key, value)); + } else { + cmd.arg(&format!("-D{}", key)); + } + } + } + + if target.contains("i686") || target.contains("i586") { + cmd.arg("-safeseh"); + } + for flag in self.flags.iter() { + cmd.arg(flag); + } + + Ok((cmd, tool.to_string())) + } + + fn assemble(&self, lib_name: &str, dst: &Path, objs: &[Object]) -> Result<(), Error> { + // Delete the destination if it exists as we want to + // create on the first iteration instead of appending. + let _ = fs::remove_file(&dst); + + // Add objects to the archive in limited-length batches. This helps keep + // the length of the command line within a reasonable length to avoid + // blowing system limits on limiting platforms like Windows. + let objs: Vec<_> = objs + .iter() + .map(|o| o.dst.clone()) + .chain(self.objects.clone()) + .collect(); + for chunk in objs.chunks(100) { + self.assemble_progressive(dst, chunk)?; + } + + if self.cuda { + // Link the device-side code and add it to the target library, + // so that non-CUDA linker can link the final binary. + + let out_dir = self.get_out_dir()?; + let dlink = out_dir.join(lib_name.to_owned() + "_dlink.o"); + let mut nvcc = self.get_compiler().to_command(); + nvcc.arg("--device-link") + .arg("-o") + .arg(dlink.clone()) + .arg(dst); + run(&mut nvcc, "nvcc")?; + self.assemble_progressive(dst, &[dlink])?; + } + + let target = self.get_target()?; + if target.contains("msvc") { + // The Rust compiler will look for libfoo.a and foo.lib, but the + // MSVC linker will also be passed foo.lib, so be sure that both + // exist for now. + + let lib_dst = dst.with_file_name(format!("{}.lib", lib_name)); + let _ = fs::remove_file(&lib_dst); + match fs::hard_link(&dst, &lib_dst).or_else(|_| { + // if hard-link fails, just copy (ignoring the number of bytes written) + fs::copy(&dst, &lib_dst).map(|_| ()) + }) { + Ok(_) => (), + Err(_) => { + return Err(Error::new( + ErrorKind::IOError, + "Could not copy or create a hard-link to the generated lib file.", + )); + } + }; + } else { + // Non-msvc targets (those using `ar`) need a separate step to add + // the symbol table to archives since our construction command of + // `cq` doesn't add it for us. + let (mut ar, cmd) = self.get_ar()?; + run(ar.arg("s").arg(dst), &cmd)?; + } + + Ok(()) + } + + fn assemble_progressive(&self, dst: &Path, objs: &[PathBuf]) -> Result<(), Error> { + let target = self.get_target()?; + + if target.contains("msvc") { + let (mut cmd, program) = self.get_ar()?; + let mut out = OsString::from("-out:"); + out.push(dst); + cmd.arg(out).arg("-nologo"); + for flag in self.ar_flags.iter() { + cmd.arg(flag); + } + // If the library file already exists, add the library name + // as an argument to let lib.exe know we are appending the objs. + if dst.exists() { + cmd.arg(dst); + } + cmd.args(objs); + run(&mut cmd, &program)?; + } else { + let (mut ar, cmd) = self.get_ar()?; + + // Set an environment variable to tell the OSX archiver to ensure + // that all dates listed in the archive are zero, improving + // determinism of builds. AFAIK there's not really official + // documentation of this but there's a lot of references to it if + // you search google. + // + // You can reproduce this locally on a mac with: + // + // $ touch foo.c + // $ cc -c foo.c -o foo.o + // + // # Notice that these two checksums are different + // $ ar crus libfoo1.a foo.o && sleep 2 && ar crus libfoo2.a foo.o + // $ md5sum libfoo*.a + // + // # Notice that these two checksums are the same + // $ export ZERO_AR_DATE=1 + // $ ar crus libfoo1.a foo.o && sleep 2 && touch foo.o && ar crus libfoo2.a foo.o + // $ md5sum libfoo*.a + // + // In any case if this doesn't end up getting read, it shouldn't + // cause that many issues! + ar.env("ZERO_AR_DATE", "1"); + for flag in self.ar_flags.iter() { + ar.arg(flag); + } + run(ar.arg("cq").arg(dst).args(objs), &cmd)?; + } + + Ok(()) + } + + fn ios_flags(&self, cmd: &mut Tool) -> Result<(), Error> { + enum ArchSpec { + Device(&'static str), + Simulator(&'static str), + Catalyst(&'static str), + } + + let target = self.get_target()?; + let arch = target.split('-').nth(0).ok_or_else(|| { + Error::new( + ErrorKind::ArchitectureInvalid, + "Unknown architecture for iOS target.", + ) + })?; + + let is_catalyst = match target.split('-').nth(3) { + Some(v) => v == "macabi", + None => false, + }; + + let is_sim = match target.split('-').nth(3) { + Some(v) => v == "sim", + None => false, + }; + + let arch = if is_catalyst { + match arch { + "arm64e" => ArchSpec::Catalyst("arm64e"), + "arm64" | "aarch64" => ArchSpec::Catalyst("arm64"), + "x86_64" => ArchSpec::Catalyst("-m64"), + _ => { + return Err(Error::new( + ErrorKind::ArchitectureInvalid, + "Unknown architecture for iOS target.", + )); + } + } + } else if is_sim { + match arch { + "arm64" | "aarch64" => ArchSpec::Simulator("-arch arm64"), + _ => { + return Err(Error::new( + ErrorKind::ArchitectureInvalid, + "Unknown architecture for iOS simulator target.", + )); + } + } + } else { + match arch { + "arm" | "armv7" | "thumbv7" => ArchSpec::Device("armv7"), + "armv7s" | "thumbv7s" => ArchSpec::Device("armv7s"), + "arm64e" => ArchSpec::Device("arm64e"), + "arm64" | "aarch64" => ArchSpec::Device("arm64"), + "i386" | "i686" => ArchSpec::Simulator("-m32"), + "x86_64" => ArchSpec::Simulator("-m64"), + _ => { + return Err(Error::new( + ErrorKind::ArchitectureInvalid, + "Unknown architecture for iOS target.", + )); + } + } + }; + + let min_version = + std::env::var("IPHONEOS_DEPLOYMENT_TARGET").unwrap_or_else(|_| "7.0".into()); + + let sdk = match arch { + ArchSpec::Device(arch) => { + cmd.args.push("-arch".into()); + cmd.args.push(arch.into()); + cmd.args + .push(format!("-miphoneos-version-min={}", min_version).into()); + "iphoneos" + } + ArchSpec::Simulator(arch) => { + cmd.args.push(arch.into()); + cmd.args + .push(format!("-mios-simulator-version-min={}", min_version).into()); + "iphonesimulator" + } + ArchSpec::Catalyst(_) => "macosx", + }; + + self.print(&format!("Detecting iOS SDK path for {}", sdk)); + let sdk_path = self.apple_sdk_root(sdk)?; + cmd.args.push("-isysroot".into()); + cmd.args.push(sdk_path); + cmd.args.push("-fembed-bitcode".into()); + /* + * TODO we probably ultimately want the -fembed-bitcode-marker flag + * but can't have it now because of an issue in LLVM: + * https://github.com/alexcrichton/cc-rs/issues/301 + * https://github.com/rust-lang/rust/pull/48896#comment-372192660 + */ + /* + if self.get_opt_level()? == "0" { + cmd.args.push("-fembed-bitcode-marker".into()); + } + */ + + Ok(()) + } + + fn cmd>(&self, prog: P) -> Command { + let mut cmd = Command::new(prog); + for &(ref a, ref b) in self.env.iter() { + cmd.env(a, b); + } + cmd + } + + fn get_base_compiler(&self) -> Result { + if let Some(ref c) = self.compiler { + return Ok(Tool::new(c.clone())); + } + let host = self.get_host()?; + let target = self.get_target()?; + let (env, msvc, gnu, traditional, clang) = if self.cpp { + ("CXX", "cl.exe", "g++", "c++", "clang++") + } else { + ("CC", "cl.exe", "gcc", "cc", "clang") + }; + + // On historical Solaris systems, "cc" may have been Sun Studio, which + // is not flag-compatible with "gcc". This history casts a long shadow, + // and many modern illumos distributions today ship GCC as "gcc" without + // also making it available as "cc". + let default = if host.contains("solaris") || host.contains("illumos") { + gnu + } else { + traditional + }; + + let cl_exe = windows_registry::find_tool(&target, "cl.exe"); + + let tool_opt: Option = self + .env_tool(env) + .map(|(tool, wrapper, args)| { + // find the driver mode, if any + const DRIVER_MODE: &str = "--driver-mode="; + let driver_mode = args + .iter() + .find(|a| a.starts_with(DRIVER_MODE)) + .map(|a| &a[DRIVER_MODE.len()..]); + // Chop off leading/trailing whitespace to work around + // semi-buggy build scripts which are shared in + // makefiles/configure scripts (where spaces are far more + // lenient) + let mut t = Tool::with_clang_driver(PathBuf::from(tool.trim()), driver_mode); + if let Some(cc_wrapper) = wrapper { + t.cc_wrapper_path = Some(PathBuf::from(cc_wrapper)); + } + for arg in args { + t.cc_wrapper_args.push(arg.into()); + } + t + }) + .or_else(|| { + if target.contains("emscripten") { + let tool = if self.cpp { "em++" } else { "emcc" }; + // Windows uses bat file so we have to be a bit more specific + if cfg!(windows) { + let mut t = Tool::new(PathBuf::from("cmd")); + t.args.push("/c".into()); + t.args.push(format!("{}.bat", tool).into()); + Some(t) + } else { + Some(Tool::new(PathBuf::from(tool))) + } + } else { + None + } + }) + .or_else(|| cl_exe.clone()); + + let tool = match tool_opt { + Some(t) => t, + None => { + let compiler = if host.contains("windows") && target.contains("windows") { + if target.contains("msvc") { + msvc.to_string() + } else { + format!("{}.exe", gnu) + } + } else if target.contains("apple-ios") { + clang.to_string() + } else if target.contains("android") { + autodetect_android_compiler(&target, &host, gnu, clang) + } else if target.contains("cloudabi") { + format!("{}-{}", target, traditional) + } else if target == "wasm32-wasi" + || target == "wasm32-unknown-wasi" + || target == "wasm32-unknown-unknown" + { + "clang".to_string() + } else if target.contains("vxworks") { + if self.cpp { + "wr-c++".to_string() + } else { + "wr-cc".to_string() + } + } else if target.starts_with("armv7a-kmc-solid_") { + format!("arm-kmc-eabi-{}", gnu) + } else if target.starts_with("aarch64-kmc-solid_") { + format!("aarch64-kmc-elf-{}", gnu) + } else if self.get_host()? != target { + let prefix = self.prefix_for_target(&target); + match prefix { + Some(prefix) => format!("{}-{}", prefix, gnu), + None => default.to_string(), + } + } else { + default.to_string() + }; + + let mut t = Tool::new(PathBuf::from(compiler)); + if let Some(cc_wrapper) = Self::rustc_wrapper_fallback() { + t.cc_wrapper_path = Some(PathBuf::from(cc_wrapper)); + } + t + } + }; + + let mut tool = if self.cuda { + assert!( + tool.args.is_empty(), + "CUDA compilation currently assumes empty pre-existing args" + ); + let nvcc = match self.get_var("NVCC") { + Err(_) => "nvcc".into(), + Ok(nvcc) => nvcc, + }; + let mut nvcc_tool = Tool::with_features(PathBuf::from(nvcc), None, self.cuda); + nvcc_tool + .args + .push(format!("-ccbin={}", tool.path.display()).into()); + nvcc_tool.family = tool.family; + nvcc_tool + } else { + tool + }; + + // New "standalone" C/C++ cross-compiler executables from recent Android NDK + // are just shell scripts that call main clang binary (from Android NDK) with + // proper `--target` argument. + // + // For example, armv7a-linux-androideabi16-clang passes + // `--target=armv7a-linux-androideabi16` to clang. + // + // As the shell script calls the main clang binary, the command line limit length + // on Windows is restricted to around 8k characters instead of around 32k characters. + // To remove this limit, we call the main clang binary directly and construct the + // `--target=` ourselves. + if host.contains("windows") && android_clang_compiler_uses_target_arg_internally(&tool.path) + { + if let Some(path) = tool.path.file_name() { + let file_name = path.to_str().unwrap().to_owned(); + let (target, clang) = file_name.split_at(file_name.rfind("-").unwrap()); + + tool.path.set_file_name(clang.trim_start_matches("-")); + tool.path.set_extension("exe"); + tool.args.push(format!("--target={}", target).into()); + + // Additionally, shell scripts for target i686-linux-android versions 16 to 24 + // pass the `mstackrealign` option so we do that here as well. + if target.contains("i686-linux-android") { + let (_, version) = target.split_at(target.rfind("d").unwrap() + 1); + if let Ok(version) = version.parse::() { + if version > 15 && version < 25 { + tool.args.push("-mstackrealign".into()); + } + } + } + }; + } + + // If we found `cl.exe` in our environment, the tool we're returning is + // an MSVC-like tool, *and* no env vars were set then set env vars for + // the tool that we're returning. + // + // Env vars are needed for things like `link.exe` being put into PATH as + // well as header include paths sometimes. These paths are automatically + // included by default but if the `CC` or `CXX` env vars are set these + // won't be used. This'll ensure that when the env vars are used to + // configure for invocations like `clang-cl` we still get a "works out + // of the box" experience. + if let Some(cl_exe) = cl_exe { + if tool.family == (ToolFamily::Msvc { clang_cl: true }) + && tool.env.len() == 0 + && target.contains("msvc") + { + for &(ref k, ref v) in cl_exe.env.iter() { + tool.env.push((k.to_owned(), v.to_owned())); + } + } + } + + Ok(tool) + } + + fn get_var(&self, var_base: &str) -> Result { + let target = self.get_target()?; + let host = self.get_host()?; + let kind = if host == target { "HOST" } else { "TARGET" }; + let target_u = target.replace("-", "_"); + let res = self + .getenv(&format!("{}_{}", var_base, target)) + .or_else(|| self.getenv(&format!("{}_{}", var_base, target_u))) + .or_else(|| self.getenv(&format!("{}_{}", kind, var_base))) + .or_else(|| self.getenv(var_base)); + + match res { + Some(res) => Ok(res), + None => Err(Error::new( + ErrorKind::EnvVarNotFound, + &format!("Could not find environment variable {}.", var_base), + )), + } + } + + fn envflags(&self, name: &str) -> Vec { + self.get_var(name) + .unwrap_or(String::new()) + .split_ascii_whitespace() + .map(|slice| slice.to_string()) + .collect() + } + + /// Returns a fallback `cc_compiler_wrapper` by introspecting `RUSTC_WRAPPER` + fn rustc_wrapper_fallback() -> Option { + // No explicit CC wrapper was detected, but check if RUSTC_WRAPPER + // is defined and is a build accelerator that is compatible with + // C/C++ compilers (e.g. sccache) + const VALID_WRAPPERS: &[&'static str] = &["sccache", "cachepot"]; + + let rustc_wrapper = std::env::var_os("RUSTC_WRAPPER")?; + let wrapper_path = Path::new(&rustc_wrapper); + let wrapper_stem = wrapper_path.file_stem()?; + + if VALID_WRAPPERS.contains(&wrapper_stem.to_str()?) { + Some(rustc_wrapper.to_str()?.to_owned()) + } else { + None + } + } + + /// Returns compiler path, optional modifier name from whitelist, and arguments vec + fn env_tool(&self, name: &str) -> Option<(String, Option, Vec)> { + let tool = match self.get_var(name) { + Ok(tool) => tool, + Err(_) => return None, + }; + + // If this is an exact path on the filesystem we don't want to do any + // interpretation at all, just pass it on through. This'll hopefully get + // us to support spaces-in-paths. + if Path::new(&tool).exists() { + return Some((tool, None, Vec::new())); + } + + // Ok now we want to handle a couple of scenarios. We'll assume from + // here on out that spaces are splitting separate arguments. Two major + // features we want to support are: + // + // CC='sccache cc' + // + // aka using `sccache` or any other wrapper/caching-like-thing for + // compilations. We want to know what the actual compiler is still, + // though, because our `Tool` API support introspection of it to see + // what compiler is in use. + // + // additionally we want to support + // + // CC='cc -flag' + // + // where the CC env var is used to also pass default flags to the C + // compiler. + // + // It's true that everything here is a bit of a pain, but apparently if + // you're not literally make or bash then you get a lot of bug reports. + let known_wrappers = ["ccache", "distcc", "sccache", "icecc", "cachepot"]; + + let mut parts = tool.split_whitespace(); + let maybe_wrapper = match parts.next() { + Some(s) => s, + None => return None, + }; + + let file_stem = Path::new(maybe_wrapper) + .file_stem() + .unwrap() + .to_str() + .unwrap(); + if known_wrappers.contains(&file_stem) { + if let Some(compiler) = parts.next() { + return Some(( + compiler.to_string(), + Some(maybe_wrapper.to_string()), + parts.map(|s| s.to_string()).collect(), + )); + } + } + + Some(( + maybe_wrapper.to_string(), + Self::rustc_wrapper_fallback(), + parts.map(|s| s.to_string()).collect(), + )) + } + + /// Returns the C++ standard library: + /// 1. If [cpp_link_stdlib](cc::Build::cpp_link_stdlib) is set, uses its value. + /// 2. Else if the `CXXSTDLIB` environment variable is set, uses its value. + /// 3. Else the default is `libc++` for OS X and BSDs, `libc++_shared` for Android, + /// `None` for MSVC and `libstdc++` for anything else. + fn get_cpp_link_stdlib(&self) -> Result, Error> { + match self.cpp_link_stdlib.clone() { + Some(s) => Ok(s), + None => { + if let Ok(stdlib) = self.get_var("CXXSTDLIB") { + if stdlib.is_empty() { + Ok(None) + } else { + Ok(Some(stdlib)) + } + } else { + let target = self.get_target()?; + if target.contains("msvc") { + Ok(None) + } else if target.contains("apple") { + Ok(Some("c++".to_string())) + } else if target.contains("freebsd") { + Ok(Some("c++".to_string())) + } else if target.contains("openbsd") { + Ok(Some("c++".to_string())) + } else if target.contains("android") { + Ok(Some("c++_shared".to_string())) + } else { + Ok(Some("stdc++".to_string())) + } + } + } + } + } + + fn get_ar(&self) -> Result<(Command, String), Error> { + if let Some(ref p) = self.archiver { + let name = p.file_name().and_then(|s| s.to_str()).unwrap_or("ar"); + return Ok((self.cmd(p), name.to_string())); + } + if let Ok(p) = self.get_var("AR") { + return Ok((self.cmd(&p), p)); + } + let target = self.get_target()?; + let default_ar = "ar".to_string(); + let program = if target.contains("android") { + format!("{}-ar", target.replace("armv7", "arm")) + } else if target.contains("emscripten") { + // Windows use bat files so we have to be a bit more specific + if cfg!(windows) { + let mut cmd = self.cmd("cmd"); + cmd.arg("/c").arg("emar.bat"); + return Ok((cmd, "emar.bat".to_string())); + } + + "emar".to_string() + } else if target.contains("msvc") { + match windows_registry::find(&target, "lib.exe") { + Some(t) => return Ok((t, "lib.exe".to_string())), + None => "lib.exe".to_string(), + } + } else if target.contains("illumos") { + // The default 'ar' on illumos uses a non-standard flags, + // but the OS comes bundled with a GNU-compatible variant. + // + // Use the GNU-variant to match other Unix systems. + "gar".to_string() + } else if self.get_host()? != target { + match self.prefix_for_target(&target) { + Some(p) => { + let target_ar = format!("{}-ar", p); + if Command::new(&target_ar).output().is_ok() { + target_ar + } else { + default_ar + } + } + None => default_ar, + } + } else { + default_ar + }; + Ok((self.cmd(&program), program)) + } + + fn prefix_for_target(&self, target: &str) -> Option { + // CROSS_COMPILE is of the form: "arm-linux-gnueabi-" + let cc_env = self.getenv("CROSS_COMPILE"); + let cross_compile = cc_env + .as_ref() + .map(|s| s.trim_right_matches('-').to_owned()); + cross_compile.or(match &target[..] { + "aarch64-pc-windows-gnu" => Some("aarch64-w64-mingw32"), + "aarch64-uwp-windows-gnu" => Some("aarch64-w64-mingw32"), + "aarch64-unknown-linux-gnu" => Some("aarch64-linux-gnu"), + "aarch64-unknown-linux-musl" => Some("aarch64-linux-musl"), + "aarch64-unknown-netbsd" => Some("aarch64--netbsd"), + "arm-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"), + "armv4t-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"), + "armv5te-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"), + "armv5te-unknown-linux-musleabi" => Some("arm-linux-gnueabi"), + "arm-frc-linux-gnueabi" => Some("arm-frc-linux-gnueabi"), + "arm-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"), + "arm-unknown-linux-musleabi" => Some("arm-linux-musleabi"), + "arm-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"), + "arm-unknown-netbsd-eabi" => Some("arm--netbsdelf-eabi"), + "armv6-unknown-netbsd-eabihf" => Some("armv6--netbsdelf-eabihf"), + "armv7-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"), + "armv7-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"), + "armv7-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"), + "armv7neon-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"), + "armv7neon-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"), + "thumbv7-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"), + "thumbv7-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"), + "thumbv7neon-unknown-linux-gnueabihf" => Some("arm-linux-gnueabihf"), + "thumbv7neon-unknown-linux-musleabihf" => Some("arm-linux-musleabihf"), + "armv7-unknown-netbsd-eabihf" => Some("armv7--netbsdelf-eabihf"), + "hexagon-unknown-linux-musl" => Some("hexagon-linux-musl"), + "i586-unknown-linux-musl" => Some("musl"), + "i686-pc-windows-gnu" => Some("i686-w64-mingw32"), + "i686-uwp-windows-gnu" => Some("i686-w64-mingw32"), + "i686-unknown-linux-gnu" => self.find_working_gnu_prefix(&[ + "i686-linux-gnu", + "x86_64-linux-gnu", // transparently support gcc-multilib + ]), // explicit None if not found, so caller knows to fall back + "i686-unknown-linux-musl" => Some("musl"), + "i686-unknown-netbsd" => Some("i486--netbsdelf"), + "mips-unknown-linux-gnu" => Some("mips-linux-gnu"), + "mips-unknown-linux-musl" => Some("mips-linux-musl"), + "mipsel-unknown-linux-gnu" => Some("mipsel-linux-gnu"), + "mipsel-unknown-linux-musl" => Some("mipsel-linux-musl"), + "mips64-unknown-linux-gnuabi64" => Some("mips64-linux-gnuabi64"), + "mips64el-unknown-linux-gnuabi64" => Some("mips64el-linux-gnuabi64"), + "mipsisa32r6-unknown-linux-gnu" => Some("mipsisa32r6-linux-gnu"), + "mipsisa32r6el-unknown-linux-gnu" => Some("mipsisa32r6el-linux-gnu"), + "mipsisa64r6-unknown-linux-gnuabi64" => Some("mipsisa64r6-linux-gnuabi64"), + "mipsisa64r6el-unknown-linux-gnuabi64" => Some("mipsisa64r6el-linux-gnuabi64"), + "powerpc-unknown-linux-gnu" => Some("powerpc-linux-gnu"), + "powerpc-unknown-linux-gnuspe" => Some("powerpc-linux-gnuspe"), + "powerpc-unknown-netbsd" => Some("powerpc--netbsd"), + "powerpc64-unknown-linux-gnu" => Some("powerpc-linux-gnu"), + "powerpc64le-unknown-linux-gnu" => Some("powerpc64le-linux-gnu"), + "riscv32i-unknown-none-elf" => self.find_working_gnu_prefix(&[ + "riscv32-unknown-elf", + "riscv64-unknown-elf", + "riscv-none-embed", + ]), + "riscv32imac-unknown-none-elf" => self.find_working_gnu_prefix(&[ + "riscv32-unknown-elf", + "riscv64-unknown-elf", + "riscv-none-embed", + ]), + "riscv32imc-unknown-none-elf" => self.find_working_gnu_prefix(&[ + "riscv32-unknown-elf", + "riscv64-unknown-elf", + "riscv-none-embed", + ]), + "riscv64gc-unknown-none-elf" => self.find_working_gnu_prefix(&[ + "riscv64-unknown-elf", + "riscv32-unknown-elf", + "riscv-none-embed", + ]), + "riscv64imac-unknown-none-elf" => self.find_working_gnu_prefix(&[ + "riscv64-unknown-elf", + "riscv32-unknown-elf", + "riscv-none-embed", + ]), + "riscv64gc-unknown-linux-gnu" => Some("riscv64-linux-gnu"), + "riscv32gc-unknown-linux-gnu" => Some("riscv32-linux-gnu"), + "riscv64gc-unknown-linux-musl" => Some("riscv64-linux-musl"), + "riscv32gc-unknown-linux-musl" => Some("riscv32-linux-musl"), + "s390x-unknown-linux-gnu" => Some("s390x-linux-gnu"), + "sparc-unknown-linux-gnu" => Some("sparc-linux-gnu"), + "sparc64-unknown-linux-gnu" => Some("sparc64-linux-gnu"), + "sparc64-unknown-netbsd" => Some("sparc64--netbsd"), + "sparcv9-sun-solaris" => Some("sparcv9-sun-solaris"), + "armv7a-none-eabi" => Some("arm-none-eabi"), + "armv7a-none-eabihf" => Some("arm-none-eabi"), + "armebv7r-none-eabi" => Some("arm-none-eabi"), + "armebv7r-none-eabihf" => Some("arm-none-eabi"), + "armv7r-none-eabi" => Some("arm-none-eabi"), + "armv7r-none-eabihf" => Some("arm-none-eabi"), + "thumbv6m-none-eabi" => Some("arm-none-eabi"), + "thumbv7em-none-eabi" => Some("arm-none-eabi"), + "thumbv7em-none-eabihf" => Some("arm-none-eabi"), + "thumbv7m-none-eabi" => Some("arm-none-eabi"), + "thumbv8m.base-none-eabi" => Some("arm-none-eabi"), + "thumbv8m.main-none-eabi" => Some("arm-none-eabi"), + "thumbv8m.main-none-eabihf" => Some("arm-none-eabi"), + "x86_64-pc-windows-gnu" => Some("x86_64-w64-mingw32"), + "x86_64-uwp-windows-gnu" => Some("x86_64-w64-mingw32"), + "x86_64-rumprun-netbsd" => Some("x86_64-rumprun-netbsd"), + "x86_64-unknown-linux-gnu" => self.find_working_gnu_prefix(&[ + "x86_64-linux-gnu", // rustfmt wrap + ]), // explicit None if not found, so caller knows to fall back + "x86_64-unknown-linux-musl" => Some("musl"), + "x86_64-unknown-netbsd" => Some("x86_64--netbsd"), + _ => None, + } + .map(|x| x.to_owned())) + } + + /// Some platforms have multiple, compatible, canonical prefixes. Look through + /// each possible prefix for a compiler that exists and return it. The prefixes + /// should be ordered from most-likely to least-likely. + fn find_working_gnu_prefix(&self, prefixes: &[&'static str]) -> Option<&'static str> { + let suffix = if self.cpp { "-g++" } else { "-gcc" }; + let extension = std::env::consts::EXE_SUFFIX; + + // Loop through PATH entries searching for each toolchain. This ensures that we + // are more likely to discover the toolchain early on, because chances are good + // that the desired toolchain is in one of the higher-priority paths. + env::var_os("PATH") + .as_ref() + .and_then(|path_entries| { + env::split_paths(path_entries).find_map(|path_entry| { + for prefix in prefixes { + let target_compiler = format!("{}{}{}", prefix, suffix, extension); + if path_entry.join(&target_compiler).exists() { + return Some(prefix); + } + } + None + }) + }) + .map(|prefix| *prefix) + .or_else(|| + // If no toolchain was found, provide the first toolchain that was passed in. + // This toolchain has been shown not to exist, however it will appear in the + // error that is shown to the user which should make it easier to search for + // where it should be obtained. + prefixes.first().map(|prefix| *prefix)) + } + + fn get_target(&self) -> Result { + match self.target.clone() { + Some(t) => Ok(t), + None => Ok(self.getenv_unwrap("TARGET")?), + } + } + + fn get_host(&self) -> Result { + match self.host.clone() { + Some(h) => Ok(h), + None => Ok(self.getenv_unwrap("HOST")?), + } + } + + fn get_opt_level(&self) -> Result { + match self.opt_level.as_ref().cloned() { + Some(ol) => Ok(ol), + None => Ok(self.getenv_unwrap("OPT_LEVEL")?), + } + } + + fn get_debug(&self) -> bool { + self.debug.unwrap_or_else(|| match self.getenv("DEBUG") { + Some(s) => s != "false", + None => false, + }) + } + + fn get_force_frame_pointer(&self) -> bool { + self.force_frame_pointer.unwrap_or_else(|| self.get_debug()) + } + + fn get_out_dir(&self) -> Result { + match self.out_dir.clone() { + Some(p) => Ok(p), + None => Ok(env::var_os("OUT_DIR").map(PathBuf::from).ok_or_else(|| { + Error::new( + ErrorKind::EnvVarNotFound, + "Environment variable OUT_DIR not defined.", + ) + })?), + } + } + + fn getenv(&self, v: &str) -> Option { + let mut cache = self.env_cache.lock().unwrap(); + if let Some(val) = cache.get(v) { + return val.clone(); + } + let r = env::var(v).ok(); + self.print(&format!("{} = {:?}", v, r)); + cache.insert(v.to_string(), r.clone()); + r + } + + fn getenv_unwrap(&self, v: &str) -> Result { + match self.getenv(v) { + Some(s) => Ok(s), + None => Err(Error::new( + ErrorKind::EnvVarNotFound, + &format!("Environment variable {} not defined.", v.to_string()), + )), + } + } + + fn print(&self, s: &str) { + if self.cargo_metadata { + println!("{}", s); + } + } + + fn fix_env_for_apple_os(&self, cmd: &mut Command) -> Result<(), Error> { + let target = self.get_target()?; + let host = self.get_host()?; + if host.contains("apple-darwin") && target.contains("apple-darwin") { + // If, for example, `cargo` runs during the build of an XCode project, then `SDKROOT` environment variable + // would represent the current target, and this is the problem for us, if we want to compile something + // for the host, when host != target. + // We can not just remove `SDKROOT`, because, again, for example, XCode add to PATH + // /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + // and `cc` from this path can not find system include files, like `pthread.h`, if `SDKROOT` + // is not set + if let Ok(sdkroot) = env::var("SDKROOT") { + if !sdkroot.contains("MacOSX") { + let macos_sdk = self.apple_sdk_root("macosx")?; + cmd.env("SDKROOT", macos_sdk); + } + } + // Additionally, `IPHONEOS_DEPLOYMENT_TARGET` must not be set when using the Xcode linker at + // "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld", + // although this is apparently ignored when using the linker at "/usr/bin/ld". + cmd.env_remove("IPHONEOS_DEPLOYMENT_TARGET"); + } + Ok(()) + } + + fn apple_sdk_root(&self, sdk: &str) -> Result { + let mut cache = self + .apple_sdk_root_cache + .lock() + .expect("apple_sdk_root_cache lock failed"); + if let Some(ret) = cache.get(sdk) { + return Ok(ret.clone()); + } + + let sdk_path = run_output( + self.cmd("xcrun") + .arg("--show-sdk-path") + .arg("--sdk") + .arg(sdk), + "xcrun", + )?; + + let sdk_path = match String::from_utf8(sdk_path) { + Ok(p) => p, + Err(_) => { + return Err(Error::new( + ErrorKind::IOError, + "Unable to determine iOS SDK path.", + )); + } + }; + let ret: OsString = sdk_path.trim().into(); + cache.insert(sdk.into(), ret.clone()); + Ok(ret) + } +} + +impl Default for Build { + fn default() -> Build { + Build::new() + } +} + +impl Tool { + fn new(path: PathBuf) -> Self { + Tool::with_features(path, None, false) + } + + fn with_clang_driver(path: PathBuf, clang_driver: Option<&str>) -> Self { + Self::with_features(path, clang_driver, false) + } + + #[cfg(windows)] + /// Explicitly set the `ToolFamily`, skipping name-based detection. + fn with_family(path: PathBuf, family: ToolFamily) -> Self { + Self { + path: path, + cc_wrapper_path: None, + cc_wrapper_args: Vec::new(), + args: Vec::new(), + env: Vec::new(), + family: family, + cuda: false, + removed_args: Vec::new(), + } + } + + fn with_features(path: PathBuf, clang_driver: Option<&str>, cuda: bool) -> Self { + // Try to detect family of the tool from its name, falling back to Gnu. + let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { + if fname.contains("clang-cl") { + ToolFamily::Msvc { clang_cl: true } + } else if fname.ends_with("cl") || fname == "cl.exe" { + ToolFamily::Msvc { clang_cl: false } + } else if fname.contains("clang") { + match clang_driver { + Some("cl") => ToolFamily::Msvc { clang_cl: true }, + _ => ToolFamily::Clang, + } + } else { + ToolFamily::Gnu + } + } else { + ToolFamily::Gnu + }; + + Tool { + path: path, + cc_wrapper_path: None, + cc_wrapper_args: Vec::new(), + args: Vec::new(), + env: Vec::new(), + family: family, + cuda: cuda, + removed_args: Vec::new(), + } + } + + /// Add an argument to be stripped from the final command arguments. + fn remove_arg(&mut self, flag: OsString) { + self.removed_args.push(flag); + } + + /// Add a flag, and optionally prepend the NVCC wrapper flag "-Xcompiler". + /// + /// Currently this is only used for compiling CUDA sources, since NVCC only + /// accepts a limited set of GNU-like flags, and the rest must be prefixed + /// with a "-Xcompiler" flag to get passed to the underlying C++ compiler. + fn push_cc_arg(&mut self, flag: OsString) { + if self.cuda { + self.args.push("-Xcompiler".into()); + } + self.args.push(flag); + } + + fn is_duplicate_opt_arg(&self, flag: &OsString) -> bool { + let flag = flag.to_str().unwrap(); + let mut chars = flag.chars(); + + // Only duplicate check compiler flags + if self.is_like_msvc() { + if chars.next() != Some('/') { + return false; + } + } else if self.is_like_gnu() || self.is_like_clang() { + if chars.next() != Some('-') { + return false; + } + } + + // Check for existing optimization flags (-O, /O) + if chars.next() == Some('O') { + return self + .args() + .iter() + .any(|ref a| a.to_str().unwrap_or("").chars().nth(1) == Some('O')); + } + + // TODO Check for existing -m..., -m...=..., /arch:... flags + return false; + } + + /// Don't push optimization arg if it conflicts with existing args + fn push_opt_unless_duplicate(&mut self, flag: OsString) { + if self.is_duplicate_opt_arg(&flag) { + println!("Info: Ignoring duplicate arg {:?}", &flag); + } else { + self.push_cc_arg(flag); + } + } + + /// Converts this compiler into a `Command` that's ready to be run. + /// + /// This is useful for when the compiler needs to be executed and the + /// command returned will already have the initial arguments and environment + /// variables configured. + pub fn to_command(&self) -> Command { + let mut cmd = match self.cc_wrapper_path { + Some(ref cc_wrapper_path) => { + let mut cmd = Command::new(&cc_wrapper_path); + cmd.arg(&self.path); + cmd + } + None => Command::new(&self.path), + }; + cmd.args(&self.cc_wrapper_args); + + let value = self + .args + .iter() + .filter(|a| !self.removed_args.contains(a)) + .collect::>(); + cmd.args(&value); + + for &(ref k, ref v) in self.env.iter() { + cmd.env(k, v); + } + cmd + } + + /// Returns the path for this compiler. + /// + /// Note that this may not be a path to a file on the filesystem, e.g. "cc", + /// but rather something which will be resolved when a process is spawned. + pub fn path(&self) -> &Path { + &self.path + } + + /// Returns the default set of arguments to the compiler needed to produce + /// executables for the target this compiler generates. + pub fn args(&self) -> &[OsString] { + &self.args + } + + /// Returns the set of environment variables needed for this compiler to + /// operate. + /// + /// This is typically only used for MSVC compilers currently. + pub fn env(&self) -> &[(OsString, OsString)] { + &self.env + } + + /// Returns the compiler command in format of CC environment variable. + /// Or empty string if CC env was not present + /// + /// This is typically used by configure script + pub fn cc_env(&self) -> OsString { + match self.cc_wrapper_path { + Some(ref cc_wrapper_path) => { + let mut cc_env = cc_wrapper_path.as_os_str().to_owned(); + cc_env.push(" "); + cc_env.push(self.path.to_path_buf().into_os_string()); + for arg in self.cc_wrapper_args.iter() { + cc_env.push(" "); + cc_env.push(arg); + } + cc_env + } + None => OsString::from(""), + } + } + + /// Returns the compiler flags in format of CFLAGS environment variable. + /// Important here - this will not be CFLAGS from env, its internal gcc's flags to use as CFLAGS + /// This is typically used by configure script + pub fn cflags_env(&self) -> OsString { + let mut flags = OsString::new(); + for (i, arg) in self.args.iter().enumerate() { + if i > 0 { + flags.push(" "); + } + flags.push(arg); + } + flags + } + + /// Whether the tool is GNU Compiler Collection-like. + pub fn is_like_gnu(&self) -> bool { + self.family == ToolFamily::Gnu + } + + /// Whether the tool is Clang-like. + pub fn is_like_clang(&self) -> bool { + self.family == ToolFamily::Clang + } + + /// Whether the tool is MSVC-like. + pub fn is_like_msvc(&self) -> bool { + match self.family { + ToolFamily::Msvc { .. } => true, + _ => false, + } + } +} + +fn run(cmd: &mut Command, program: &str) -> Result<(), Error> { + let (mut child, print) = spawn(cmd, program)?; + let status = match child.wait() { + Ok(s) => s, + Err(_) => { + return Err(Error::new( + ErrorKind::ToolExecError, + &format!( + "Failed to wait on spawned child process, command {:?} with args {:?}.", + cmd, program + ), + )); + } + }; + print.join().unwrap(); + println!("{}", status); + + if status.success() { + Ok(()) + } else { + Err(Error::new( + ErrorKind::ToolExecError, + &format!( + "Command {:?} with args {:?} did not execute successfully (status code {}).", + cmd, program, status + ), + )) + } +} + +fn run_output(cmd: &mut Command, program: &str) -> Result, Error> { + cmd.stdout(Stdio::piped()); + let (mut child, print) = spawn(cmd, program)?; + let mut stdout = vec![]; + child + .stdout + .take() + .unwrap() + .read_to_end(&mut stdout) + .unwrap(); + let status = match child.wait() { + Ok(s) => s, + Err(_) => { + return Err(Error::new( + ErrorKind::ToolExecError, + &format!( + "Failed to wait on spawned child process, command {:?} with args {:?}.", + cmd, program + ), + )); + } + }; + print.join().unwrap(); + println!("{}", status); + + if status.success() { + Ok(stdout) + } else { + Err(Error::new( + ErrorKind::ToolExecError, + &format!( + "Command {:?} with args {:?} did not execute successfully (status code {}).", + cmd, program, status + ), + )) + } +} + +fn spawn(cmd: &mut Command, program: &str) -> Result<(Child, JoinHandle<()>), Error> { + println!("running: {:?}", cmd); + + // Capture the standard error coming from these programs, and write it out + // with cargo:warning= prefixes. Note that this is a bit wonky to avoid + // requiring the output to be UTF-8, we instead just ship bytes from one + // location to another. + match cmd.stderr(Stdio::piped()).spawn() { + Ok(mut child) => { + let stderr = BufReader::new(child.stderr.take().unwrap()); + let print = thread::spawn(move || { + for line in stderr.split(b'\n').filter_map(|l| l.ok()) { + print!("cargo:warning="); + std::io::stdout().write_all(&line).unwrap(); + println!(""); + } + }); + Ok((child, print)) + } + Err(ref e) if e.kind() == io::ErrorKind::NotFound => { + let extra = if cfg!(windows) { + " (see https://github.com/alexcrichton/cc-rs#compile-time-requirements \ + for help)" + } else { + "" + }; + Err(Error::new( + ErrorKind::ToolNotFound, + &format!("Failed to find tool. Is `{}` installed?{}", program, extra), + )) + } + Err(ref e) => Err(Error::new( + ErrorKind::ToolExecError, + &format!( + "Command {:?} with args {:?} failed to start: {:?}", + cmd, program, e + ), + )), + } +} + +fn fail(s: &str) -> ! { + eprintln!("\n\nerror occurred: {}\n\n", s); + std::process::exit(1); +} + +fn command_add_output_file( + cmd: &mut Command, + dst: &Path, + cuda: bool, + msvc: bool, + clang: bool, + is_asm: bool, + is_arm: bool, +) { + if msvc && !clang && !cuda && !(is_asm && is_arm) { + let mut s = OsString::from("-Fo"); + s.push(&dst); + cmd.arg(s); + } else { + cmd.arg("-o").arg(&dst); + } +} + +// Use by default minimum available API level +// See note about naming here +// https://android.googlesource.com/platform/ndk/+/refs/heads/ndk-release-r21/docs/BuildSystemMaintainers.md#Clang +static NEW_STANDALONE_ANDROID_COMPILERS: [&str; 4] = [ + "aarch64-linux-android21-clang", + "armv7a-linux-androideabi16-clang", + "i686-linux-android16-clang", + "x86_64-linux-android21-clang", +]; + +// New "standalone" C/C++ cross-compiler executables from recent Android NDK +// are just shell scripts that call main clang binary (from Android NDK) with +// proper `--target` argument. +// +// For example, armv7a-linux-androideabi16-clang passes +// `--target=armv7a-linux-androideabi16` to clang. +// So to construct proper command line check if +// `--target` argument would be passed or not to clang +fn android_clang_compiler_uses_target_arg_internally(clang_path: &Path) -> bool { + if let Some(filename) = clang_path.file_name() { + if let Some(filename_str) = filename.to_str() { + filename_str.contains("android") + } else { + false + } + } else { + false + } +} + +#[test] +fn test_android_clang_compiler_uses_target_arg_internally() { + for version in 16..21 { + assert!(android_clang_compiler_uses_target_arg_internally( + &PathBuf::from(format!("armv7a-linux-androideabi{}-clang", version)) + )); + assert!(android_clang_compiler_uses_target_arg_internally( + &PathBuf::from(format!("armv7a-linux-androideabi{}-clang++", version)) + )); + } + assert!(!android_clang_compiler_uses_target_arg_internally( + &PathBuf::from("clang") + )); + assert!(!android_clang_compiler_uses_target_arg_internally( + &PathBuf::from("clang++") + )); +} + +fn autodetect_android_compiler(target: &str, host: &str, gnu: &str, clang: &str) -> String { + let new_clang_key = match target { + "aarch64-linux-android" => Some("aarch64"), + "armv7-linux-androideabi" => Some("armv7a"), + "i686-linux-android" => Some("i686"), + "x86_64-linux-android" => Some("x86_64"), + _ => None, + }; + + let new_clang = new_clang_key + .map(|key| { + NEW_STANDALONE_ANDROID_COMPILERS + .iter() + .find(|x| x.starts_with(key)) + }) + .unwrap_or(None); + + if let Some(new_clang) = new_clang { + if Command::new(new_clang).output().is_ok() { + return (*new_clang).into(); + } + } + + let target = target + .replace("armv7neon", "arm") + .replace("armv7", "arm") + .replace("thumbv7neon", "arm") + .replace("thumbv7", "arm"); + let gnu_compiler = format!("{}-{}", target, gnu); + let clang_compiler = format!("{}-{}", target, clang); + + // On Windows, the Android clang compiler is provided as a `.cmd` file instead + // of a `.exe` file. `std::process::Command` won't run `.cmd` files unless the + // `.cmd` is explicitly appended to the command name, so we do that here. + let clang_compiler_cmd = format!("{}-{}.cmd", target, clang); + + // Check if gnu compiler is present + // if not, use clang + if Command::new(&gnu_compiler).output().is_ok() { + gnu_compiler + } else if host.contains("windows") && Command::new(&clang_compiler_cmd).output().is_ok() { + clang_compiler_cmd + } else { + clang_compiler + } +} + +// Rust and clang/cc don't agree on how to name the target. +fn map_darwin_target_from_rust_to_compiler_architecture(target: &str) -> Option<&'static str> { + if target.contains("x86_64") { + Some("x86_64") + } else if target.contains("arm64e") { + Some("arm64e") + } else if target.contains("aarch64") { + Some("arm64") + } else if target.contains("i686") { + Some("i386") + } else if target.contains("powerpc") { + Some("ppc") + } else if target.contains("powerpc64") { + Some("ppc64") + } else { + None + } +} + +fn which(tool: &Path) -> Option { + fn check_exe(exe: &mut PathBuf) -> bool { + let exe_ext = std::env::consts::EXE_EXTENSION; + exe.exists() || (!exe_ext.is_empty() && exe.set_extension(exe_ext) && exe.exists()) + } + + // If |tool| is not just one "word," assume it's an actual path... + if tool.components().count() > 1 { + let mut exe = PathBuf::from(tool); + return if check_exe(&mut exe) { Some(exe) } else { None }; + } + + // Loop through PATH entries searching for the |tool|. + let path_entries = env::var_os("PATH")?; + env::split_paths(&path_entries).find_map(|path_entry| { + let mut exe = path_entry.join(tool); + return if check_exe(&mut exe) { Some(exe) } else { None }; + }) +} diff --git a/bash-5.1/vendor/cc/src/registry.rs b/bash-5.1/vendor/cc/src/registry.rs new file mode 100644 index 0000000000000000000000000000000000000000..2ac2fa63ba8c067de9ce2e7bd66a3980c8ab4c4a --- /dev/null +++ b/bash-5.1/vendor/cc/src/registry.rs @@ -0,0 +1,204 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::ffi::{OsStr, OsString}; +use std::io; +use std::ops::RangeFrom; +use std::os::raw; +use std::os::windows::prelude::*; + +pub struct RegistryKey(Repr); + +type HKEY = *mut u8; +type DWORD = u32; +type LPDWORD = *mut DWORD; +type LPCWSTR = *const u16; +type LPWSTR = *mut u16; +type LONG = raw::c_long; +type PHKEY = *mut HKEY; +type PFILETIME = *mut u8; +type LPBYTE = *mut u8; +type REGSAM = u32; + +const ERROR_SUCCESS: DWORD = 0; +const ERROR_NO_MORE_ITEMS: DWORD = 259; +const HKEY_LOCAL_MACHINE: HKEY = 0x80000002 as HKEY; +const REG_SZ: DWORD = 1; +const KEY_READ: DWORD = 0x20019; +const KEY_WOW64_32KEY: DWORD = 0x200; + +#[link(name = "advapi32")] +extern "system" { + fn RegOpenKeyExW( + key: HKEY, + lpSubKey: LPCWSTR, + ulOptions: DWORD, + samDesired: REGSAM, + phkResult: PHKEY, + ) -> LONG; + fn RegEnumKeyExW( + key: HKEY, + dwIndex: DWORD, + lpName: LPWSTR, + lpcName: LPDWORD, + lpReserved: LPDWORD, + lpClass: LPWSTR, + lpcClass: LPDWORD, + lpftLastWriteTime: PFILETIME, + ) -> LONG; + fn RegQueryValueExW( + hKey: HKEY, + lpValueName: LPCWSTR, + lpReserved: LPDWORD, + lpType: LPDWORD, + lpData: LPBYTE, + lpcbData: LPDWORD, + ) -> LONG; + fn RegCloseKey(hKey: HKEY) -> LONG; +} + +struct OwnedKey(HKEY); + +enum Repr { + Const(HKEY), + Owned(OwnedKey), +} + +pub struct Iter<'a> { + idx: RangeFrom, + key: &'a RegistryKey, +} + +unsafe impl Sync for Repr {} +unsafe impl Send for Repr {} + +pub static LOCAL_MACHINE: RegistryKey = RegistryKey(Repr::Const(HKEY_LOCAL_MACHINE)); + +impl RegistryKey { + fn raw(&self) -> HKEY { + match self.0 { + Repr::Const(val) => val, + Repr::Owned(ref val) => val.0, + } + } + + pub fn open(&self, key: &OsStr) -> io::Result { + let key = key.encode_wide().chain(Some(0)).collect::>(); + let mut ret = 0 as *mut _; + let err = unsafe { + RegOpenKeyExW( + self.raw(), + key.as_ptr(), + 0, + KEY_READ | KEY_WOW64_32KEY, + &mut ret, + ) + }; + if err == ERROR_SUCCESS as LONG { + Ok(RegistryKey(Repr::Owned(OwnedKey(ret)))) + } else { + Err(io::Error::from_raw_os_error(err as i32)) + } + } + + pub fn iter(&self) -> Iter { + Iter { + idx: 0.., + key: self, + } + } + + pub fn query_str(&self, name: &str) -> io::Result { + let name: &OsStr = name.as_ref(); + let name = name.encode_wide().chain(Some(0)).collect::>(); + let mut len = 0; + let mut kind = 0; + unsafe { + let err = RegQueryValueExW( + self.raw(), + name.as_ptr(), + 0 as *mut _, + &mut kind, + 0 as *mut _, + &mut len, + ); + if err != ERROR_SUCCESS as LONG { + return Err(io::Error::from_raw_os_error(err as i32)); + } + if kind != REG_SZ { + return Err(io::Error::new( + io::ErrorKind::Other, + "registry key wasn't a string", + )); + } + + // The length here is the length in bytes, but we're using wide + // characters so we need to be sure to halve it for the capacity + // passed in. + let mut v = Vec::with_capacity(len as usize / 2); + let err = RegQueryValueExW( + self.raw(), + name.as_ptr(), + 0 as *mut _, + 0 as *mut _, + v.as_mut_ptr() as *mut _, + &mut len, + ); + if err != ERROR_SUCCESS as LONG { + return Err(io::Error::from_raw_os_error(err as i32)); + } + v.set_len(len as usize / 2); + + // Some registry keys may have a terminating nul character, but + // we're not interested in that, so chop it off if it's there. + if v[v.len() - 1] == 0 { + v.pop(); + } + Ok(OsString::from_wide(&v)) + } + } +} + +impl Drop for OwnedKey { + fn drop(&mut self) { + unsafe { + RegCloseKey(self.0); + } + } +} + +impl<'a> Iterator for Iter<'a> { + type Item = io::Result; + + fn next(&mut self) -> Option> { + self.idx.next().and_then(|i| unsafe { + let mut v = Vec::with_capacity(256); + let mut len = v.capacity() as DWORD; + let ret = RegEnumKeyExW( + self.key.raw(), + i, + v.as_mut_ptr(), + &mut len, + 0 as *mut _, + 0 as *mut _, + 0 as *mut _, + 0 as *mut _, + ); + if ret == ERROR_NO_MORE_ITEMS as LONG { + None + } else if ret != ERROR_SUCCESS as LONG { + Some(Err(io::Error::from_raw_os_error(ret as i32))) + } else { + v.set_len(len as usize); + Some(Ok(OsString::from_wide(&v))) + } + }) + } +} diff --git a/bash-5.1/vendor/cc/src/setup_config.rs b/bash-5.1/vendor/cc/src/setup_config.rs new file mode 100644 index 0000000000000000000000000000000000000000..bc2b1c2d30a3971b895b5f3b314ec767631909dc --- /dev/null +++ b/bash-5.1/vendor/cc/src/setup_config.rs @@ -0,0 +1,283 @@ +// Copyright © 2017 winapi-rs developers +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. + +#![allow(bad_style)] +#![allow(unused)] + +use crate::winapi::Interface; +use crate::winapi::BSTR; +use crate::winapi::LPCOLESTR; +use crate::winapi::LPSAFEARRAY; +use crate::winapi::S_FALSE; +use crate::winapi::{CoCreateInstance, CLSCTX_ALL}; +use crate::winapi::{IUnknown, IUnknownVtbl}; +use crate::winapi::{HRESULT, LCID, LPCWSTR, PULONGLONG}; +use crate::winapi::{LPFILETIME, ULONG}; +use std::ffi::OsString; +use std::ptr::null_mut; + +use crate::com::{BStr, ComPtr}; + +// Bindings to the Setup.Configuration stuff +pub type InstanceState = u32; + +pub const eNone: InstanceState = 0; +pub const eLocal: InstanceState = 1; +pub const eRegistered: InstanceState = 2; +pub const eNoRebootRequired: InstanceState = 4; +pub const eComplete: InstanceState = -1i32 as u32; + +RIDL! {#[uuid(0xb41463c3, 0x8866, 0x43b5, 0xbc, 0x33, 0x2b, 0x06, 0x76, 0xf7, 0xf4, 0x2e)] +interface ISetupInstance(ISetupInstanceVtbl): IUnknown(IUnknownVtbl) { + fn GetInstanceId( + pbstrInstanceId: *mut BSTR, + ) -> HRESULT, + fn GetInstallDate( + pInstallDate: LPFILETIME, + ) -> HRESULT, + fn GetInstallationName( + pbstrInstallationName: *mut BSTR, + ) -> HRESULT, + fn GetInstallationPath( + pbstrInstallationPath: *mut BSTR, + ) -> HRESULT, + fn GetInstallationVersion( + pbstrInstallationVersion: *mut BSTR, + ) -> HRESULT, + fn GetDisplayName( + lcid: LCID, + pbstrDisplayName: *mut BSTR, + ) -> HRESULT, + fn GetDescription( + lcid: LCID, + pbstrDescription: *mut BSTR, + ) -> HRESULT, + fn ResolvePath( + pwszRelativePath: LPCOLESTR, + pbstrAbsolutePath: *mut BSTR, + ) -> HRESULT, +}} + +RIDL! {#[uuid(0x89143c9a, 0x05af, 0x49b0, 0xb7, 0x17, 0x72, 0xe2, 0x18, 0xa2, 0x18, 0x5c)] +interface ISetupInstance2(ISetupInstance2Vtbl): ISetupInstance(ISetupInstanceVtbl) { + fn GetState( + pState: *mut InstanceState, + ) -> HRESULT, + fn GetPackages( + ppsaPackages: *mut LPSAFEARRAY, + ) -> HRESULT, + fn GetProduct( + ppPackage: *mut *mut ISetupPackageReference, + ) -> HRESULT, + fn GetProductPath( + pbstrProductPath: *mut BSTR, + ) -> HRESULT, +}} + +RIDL! {#[uuid(0x6380bcff, 0x41d3, 0x4b2e, 0x8b, 0x2e, 0xbf, 0x8a, 0x68, 0x10, 0xc8, 0x48)] +interface IEnumSetupInstances(IEnumSetupInstancesVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut *mut ISetupInstance, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumSetupInstances, + ) -> HRESULT, +}} + +RIDL! {#[uuid(0x42843719, 0xdb4c, 0x46c2, 0x8e, 0x7c, 0x64, 0xf1, 0x81, 0x6e, 0xfd, 0x5b)] +interface ISetupConfiguration(ISetupConfigurationVtbl): IUnknown(IUnknownVtbl) { + fn EnumInstances( + ppEnumInstances: *mut *mut IEnumSetupInstances, + ) -> HRESULT, + fn GetInstanceForCurrentProcess( + ppInstance: *mut *mut ISetupInstance, + ) -> HRESULT, + fn GetInstanceForPath( + wzPath: LPCWSTR, + ppInstance: *mut *mut ISetupInstance, + ) -> HRESULT, +}} + +RIDL! {#[uuid(0x26aab78c, 0x4a60, 0x49d6, 0xaf, 0x3b, 0x3c, 0x35, 0xbc, 0x93, 0x36, 0x5d)] +interface ISetupConfiguration2(ISetupConfiguration2Vtbl): + ISetupConfiguration(ISetupConfigurationVtbl) { + fn EnumAllInstances( + ppEnumInstances: *mut *mut IEnumSetupInstances, + ) -> HRESULT, +}} + +RIDL! {#[uuid(0xda8d8a16, 0xb2b6, 0x4487, 0xa2, 0xf1, 0x59, 0x4c, 0xcc, 0xcd, 0x6b, 0xf5)] +interface ISetupPackageReference(ISetupPackageReferenceVtbl): IUnknown(IUnknownVtbl) { + fn GetId( + pbstrId: *mut BSTR, + ) -> HRESULT, + fn GetVersion( + pbstrVersion: *mut BSTR, + ) -> HRESULT, + fn GetChip( + pbstrChip: *mut BSTR, + ) -> HRESULT, + fn GetLanguage( + pbstrLanguage: *mut BSTR, + ) -> HRESULT, + fn GetBranch( + pbstrBranch: *mut BSTR, + ) -> HRESULT, + fn GetType( + pbstrType: *mut BSTR, + ) -> HRESULT, + fn GetUniqueId( + pbstrUniqueId: *mut BSTR, + ) -> HRESULT, +}} + +RIDL! {#[uuid(0x42b21b78, 0x6192, 0x463e, 0x87, 0xbf, 0xd5, 0x77, 0x83, 0x8f, 0x1d, 0x5c)] +interface ISetupHelper(ISetupHelperVtbl): IUnknown(IUnknownVtbl) { + fn ParseVersion( + pwszVersion: LPCOLESTR, + pullVersion: PULONGLONG, + ) -> HRESULT, + fn ParseVersionRange( + pwszVersionRange: LPCOLESTR, + pullMinVersion: PULONGLONG, + pullMaxVersion: PULONGLONG, + ) -> HRESULT, +}} + +DEFINE_GUID! {CLSID_SetupConfiguration, +0x177f0c4a, 0x1cd3, 0x4de7, 0xa3, 0x2c, 0x71, 0xdb, 0xbb, 0x9f, 0xa3, 0x6d} + +// Safe wrapper around the COM interfaces +pub struct SetupConfiguration(ComPtr); + +impl SetupConfiguration { + pub fn new() -> Result { + let mut obj = null_mut(); + let err = unsafe { + CoCreateInstance( + &CLSID_SetupConfiguration, + null_mut(), + CLSCTX_ALL, + &ISetupConfiguration::uuidof(), + &mut obj, + ) + }; + if err < 0 { + return Err(err); + } + let obj = unsafe { ComPtr::from_raw(obj as *mut ISetupConfiguration) }; + Ok(SetupConfiguration(obj)) + } + pub fn get_instance_for_current_process(&self) -> Result { + let mut obj = null_mut(); + let err = unsafe { self.0.GetInstanceForCurrentProcess(&mut obj) }; + if err < 0 { + return Err(err); + } + Ok(unsafe { SetupInstance::from_raw(obj) }) + } + pub fn enum_instances(&self) -> Result { + let mut obj = null_mut(); + let err = unsafe { self.0.EnumInstances(&mut obj) }; + if err < 0 { + return Err(err); + } + Ok(unsafe { EnumSetupInstances::from_raw(obj) }) + } + pub fn enum_all_instances(&self) -> Result { + let mut obj = null_mut(); + let this = self.0.cast::()?; + let err = unsafe { this.EnumAllInstances(&mut obj) }; + if err < 0 { + return Err(err); + } + Ok(unsafe { EnumSetupInstances::from_raw(obj) }) + } +} + +pub struct SetupInstance(ComPtr); + +impl SetupInstance { + pub unsafe fn from_raw(obj: *mut ISetupInstance) -> SetupInstance { + SetupInstance(ComPtr::from_raw(obj)) + } + pub fn instance_id(&self) -> Result { + let mut s = null_mut(); + let err = unsafe { self.0.GetInstanceId(&mut s) }; + let bstr = unsafe { BStr::from_raw(s) }; + if err < 0 { + return Err(err); + } + Ok(bstr.to_osstring()) + } + pub fn installation_name(&self) -> Result { + let mut s = null_mut(); + let err = unsafe { self.0.GetInstallationName(&mut s) }; + let bstr = unsafe { BStr::from_raw(s) }; + if err < 0 { + return Err(err); + } + Ok(bstr.to_osstring()) + } + pub fn installation_path(&self) -> Result { + let mut s = null_mut(); + let err = unsafe { self.0.GetInstallationPath(&mut s) }; + let bstr = unsafe { BStr::from_raw(s) }; + if err < 0 { + return Err(err); + } + Ok(bstr.to_osstring()) + } + pub fn installation_version(&self) -> Result { + let mut s = null_mut(); + let err = unsafe { self.0.GetInstallationVersion(&mut s) }; + let bstr = unsafe { BStr::from_raw(s) }; + if err < 0 { + return Err(err); + } + Ok(bstr.to_osstring()) + } + pub fn product_path(&self) -> Result { + let mut s = null_mut(); + let this = self.0.cast::()?; + let err = unsafe { this.GetProductPath(&mut s) }; + let bstr = unsafe { BStr::from_raw(s) }; + if err < 0 { + return Err(err); + } + Ok(bstr.to_osstring()) + } +} + +pub struct EnumSetupInstances(ComPtr); + +impl EnumSetupInstances { + pub unsafe fn from_raw(obj: *mut IEnumSetupInstances) -> EnumSetupInstances { + EnumSetupInstances(ComPtr::from_raw(obj)) + } +} + +impl Iterator for EnumSetupInstances { + type Item = Result; + fn next(&mut self) -> Option> { + let mut obj = null_mut(); + let err = unsafe { self.0.Next(1, &mut obj, null_mut()) }; + if err < 0 { + return Some(Err(err)); + } + if err == S_FALSE { + return None; + } + Some(Ok(unsafe { SetupInstance::from_raw(obj) })) + } +} diff --git a/bash-5.1/vendor/cc/src/vs_instances.rs b/bash-5.1/vendor/cc/src/vs_instances.rs new file mode 100644 index 0000000000000000000000000000000000000000..31d3dd1470fa99ca8aa9ec7e0cff4bf05657cc36 --- /dev/null +++ b/bash-5.1/vendor/cc/src/vs_instances.rs @@ -0,0 +1,199 @@ +use std::borrow::Cow; +use std::collections::HashMap; +use std::convert::TryFrom; +use std::io::BufRead; +use std::path::PathBuf; + +use crate::setup_config::{EnumSetupInstances, SetupInstance}; + +pub enum VsInstance { + Com(SetupInstance), + Vswhere(VswhereInstance), +} + +impl VsInstance { + pub fn installation_name(&self) -> Option> { + match self { + VsInstance::Com(s) => s + .installation_name() + .ok() + .and_then(|s| s.into_string().ok()) + .map(Cow::from), + VsInstance::Vswhere(v) => v.map.get("installationName").map(Cow::from), + } + } + + pub fn installation_path(&self) -> Option { + match self { + VsInstance::Com(s) => s.installation_path().ok().map(PathBuf::from), + VsInstance::Vswhere(v) => v.map.get("installationPath").map(PathBuf::from), + } + } + + pub fn installation_version(&self) -> Option> { + match self { + VsInstance::Com(s) => s + .installation_version() + .ok() + .and_then(|s| s.into_string().ok()) + .map(Cow::from), + VsInstance::Vswhere(v) => v.map.get("installationVersion").map(Cow::from), + } + } +} + +pub enum VsInstances { + ComBased(EnumSetupInstances), + VswhereBased(VswhereInstance), +} + +impl IntoIterator for VsInstances { + type Item = VsInstance; + #[allow(bare_trait_objects)] + type IntoIter = Box>; + + fn into_iter(self) -> Self::IntoIter { + match self { + VsInstances::ComBased(e) => { + Box::new(e.into_iter().filter_map(Result::ok).map(VsInstance::Com)) + } + VsInstances::VswhereBased(v) => Box::new(std::iter::once(VsInstance::Vswhere(v))), + } + } +} + +#[derive(Debug)] +pub struct VswhereInstance { + map: HashMap, +} + +impl TryFrom<&Vec> for VswhereInstance { + type Error = &'static str; + + fn try_from(output: &Vec) -> Result { + let map: HashMap<_, _> = output + .lines() + .filter_map(Result::ok) + .filter_map(|s| { + let mut splitn = s.splitn(2, ": "); + Some((splitn.next()?.to_owned(), splitn.next()?.to_owned())) + }) + .collect(); + + if !map.contains_key("installationName") + || !map.contains_key("installationPath") + || !map.contains_key("installationVersion") + { + return Err("required properties not found"); + } + + Ok(Self { map }) + } +} + +#[cfg(test)] +mod tests_ { + use std::borrow::Cow; + use std::convert::TryFrom; + use std::path::PathBuf; + + #[test] + fn it_parses_vswhere_output_correctly() { + let output = br"instanceId: 58104422 +installDate: 21/02/2021 21:50:33 +installationName: VisualStudio/16.9.2+31112.23 +installationPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools +installationVersion: 16.9.31112.23 +productId: Microsoft.VisualStudio.Product.BuildTools +productPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\LaunchDevCmd.bat +state: 4294967295 +isComplete: 1 +isLaunchable: 1 +isPrerelease: 0 +isRebootRequired: 0 +displayName: Visual Studio Build Tools 2019 +description: The Visual Studio Build Tools allows you to build native and managed MSBuild-based applications without requiring the Visual Studio IDE. There are options to install the Visual C++ compilers and libraries, MFC, ATL, and C++/CLI support. +channelId: VisualStudio.16.Release +channelUri: https://aka.ms/vs/16/release/channel +enginePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service +releaseNotes: https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-v16.9#16.9.2 +thirdPartyNotices: https://go.microsoft.com/fwlink/?LinkId=660909 +updateDate: 2021-03-17T21:16:46.5963702Z +catalog_buildBranch: d16.9 +catalog_buildVersion: 16.9.31112.23 +catalog_id: VisualStudio/16.9.2+31112.23 +catalog_localBuild: build-lab +catalog_manifestName: VisualStudio +catalog_manifestType: installer +catalog_productDisplayVersion: 16.9.2 +catalog_productLine: Dev16 +catalog_productLineVersion: 2019 +catalog_productMilestone: RTW +catalog_productMilestoneIsPreRelease: False +catalog_productName: Visual Studio +catalog_productPatchVersion: 2 +catalog_productPreReleaseMilestoneSuffix: 1.0 +catalog_productSemanticVersion: 16.9.2+31112.23 +catalog_requiredEngineVersion: 2.9.3365.38425 +properties_campaignId: 156063665.1613940062 +properties_channelManifestId: VisualStudio.16.Release/16.9.2+31112.23 +properties_nickname: +properties_setupEngineFilePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installershell.exe +" + .to_vec(); + + let vswhere_instance = super::VswhereInstance::try_from(&output); + assert!(vswhere_instance.is_ok()); + + let vs_instance = super::VsInstance::Vswhere(vswhere_instance.unwrap()); + assert_eq!( + vs_instance.installation_name(), + Some(Cow::from("VisualStudio/16.9.2+31112.23")) + ); + assert_eq!( + vs_instance.installation_path(), + Some(PathBuf::from( + r"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" + )) + ); + assert_eq!( + vs_instance.installation_version(), + Some(Cow::from("16.9.31112.23")) + ); + } + + #[test] + fn it_returns_an_error_for_empty_output() { + let output = b"".to_vec(); + + let vswhere_instance = super::VswhereInstance::try_from(&output); + + assert!(vswhere_instance.is_err()); + } + + #[test] + fn it_returns_an_error_for_output_consisting_of_empty_lines() { + let output = br" + +" + .to_vec(); + + let vswhere_instance = super::VswhereInstance::try_from(&output); + + assert!(vswhere_instance.is_err()); + } + + #[test] + fn it_returns_an_error_for_output_without_required_properties() { + let output = br"instanceId: 58104422 +installDate: 21/02/2021 21:50:33 +productId: Microsoft.VisualStudio.Product.BuildTools +productPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\LaunchDevCmd.bat +" + .to_vec(); + + let vswhere_instance = super::VswhereInstance::try_from(&output); + + assert!(vswhere_instance.is_err()); + } +} diff --git a/bash-5.1/vendor/cc/src/winapi.rs b/bash-5.1/vendor/cc/src/winapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..c416325b5241a95c75c99f6506dea83ad717e634 --- /dev/null +++ b/bash-5.1/vendor/cc/src/winapi.rs @@ -0,0 +1,218 @@ +// Copyright © 2015-2017 winapi-rs developers +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. + +#![allow(bad_style)] + +use std::os::raw; + +pub type wchar_t = u16; + +pub type UINT = raw::c_uint; +pub type LPUNKNOWN = *mut IUnknown; +pub type REFIID = *const IID; +pub type IID = GUID; +pub type REFCLSID = *const IID; +pub type PVOID = *mut raw::c_void; +pub type USHORT = raw::c_ushort; +pub type ULONG = raw::c_ulong; +pub type LONG = raw::c_long; +pub type DWORD = u32; +pub type LPVOID = *mut raw::c_void; +pub type HRESULT = raw::c_long; +pub type LPFILETIME = *mut FILETIME; +pub type BSTR = *mut OLECHAR; +pub type OLECHAR = WCHAR; +pub type WCHAR = wchar_t; +pub type LPCOLESTR = *const OLECHAR; +pub type LCID = DWORD; +pub type LPCWSTR = *const WCHAR; +pub type PULONGLONG = *mut ULONGLONG; +pub type ULONGLONG = u64; + +pub const S_OK: HRESULT = 0; +pub const S_FALSE: HRESULT = 1; +pub const COINIT_MULTITHREADED: u32 = 0x0; + +pub type CLSCTX = u32; + +pub const CLSCTX_INPROC_SERVER: CLSCTX = 0x1; +pub const CLSCTX_INPROC_HANDLER: CLSCTX = 0x2; +pub const CLSCTX_LOCAL_SERVER: CLSCTX = 0x4; +pub const CLSCTX_REMOTE_SERVER: CLSCTX = 0x10; + +pub const CLSCTX_ALL: CLSCTX = + CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER; + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct GUID { + pub Data1: raw::c_ulong, + pub Data2: raw::c_ushort, + pub Data3: raw::c_ushort, + pub Data4: [raw::c_uchar; 8], +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct FILETIME { + pub dwLowDateTime: DWORD, + pub dwHighDateTime: DWORD, +} + +pub trait Interface { + fn uuidof() -> GUID; +} + +#[link(name = "ole32")] +#[link(name = "oleaut32")] +extern "C" {} + +extern "system" { + pub fn CoInitializeEx(pvReserved: LPVOID, dwCoInit: DWORD) -> HRESULT; + pub fn CoCreateInstance( + rclsid: REFCLSID, + pUnkOuter: LPUNKNOWN, + dwClsContext: DWORD, + riid: REFIID, + ppv: *mut LPVOID, + ) -> HRESULT; + pub fn SysFreeString(bstrString: BSTR); + pub fn SysStringLen(pbstr: BSTR) -> UINT; +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SAFEARRAYBOUND { + pub cElements: ULONG, + pub lLbound: LONG, +} + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct SAFEARRAY { + pub cDims: USHORT, + pub fFeatures: USHORT, + pub cbElements: ULONG, + pub cLocks: ULONG, + pub pvData: PVOID, + pub rgsabound: [SAFEARRAYBOUND; 1], +} + +pub type LPSAFEARRAY = *mut SAFEARRAY; + +macro_rules! DEFINE_GUID { + ( + $name:ident, $l:expr, $w1:expr, $w2:expr, + $b1:expr, $b2:expr, $b3:expr, $b4:expr, $b5:expr, $b6:expr, $b7:expr, $b8:expr + ) => { + pub const $name: $crate::winapi::GUID = $crate::winapi::GUID { + Data1: $l, + Data2: $w1, + Data3: $w2, + Data4: [$b1, $b2, $b3, $b4, $b5, $b6, $b7, $b8], + }; + }; +} + +macro_rules! RIDL { + (#[uuid($($uuid:expr),+)] + interface $interface:ident ($vtbl:ident) {$( + fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty, + )+}) => ( + #[repr(C)] + pub struct $vtbl { + $(pub $method: unsafe extern "system" fn( + This: *mut $interface, + $($p: $t),* + ) -> $rtr,)+ + } + #[repr(C)] + pub struct $interface { + pub lpVtbl: *const $vtbl, + } + RIDL!{@impl $interface {$(fn $method($($p: $t,)*) -> $rtr,)+}} + RIDL!{@uuid $interface $($uuid),+} + ); + (#[uuid($($uuid:expr),+)] + interface $interface:ident ($vtbl:ident) : $pinterface:ident ($pvtbl:ident) { + }) => ( + #[repr(C)] + pub struct $vtbl { + pub parent: $pvtbl, + } + #[repr(C)] + pub struct $interface { + pub lpVtbl: *const $vtbl, + } + RIDL!{@deref $interface $pinterface} + RIDL!{@uuid $interface $($uuid),+} + ); + (#[uuid($($uuid:expr),+)] + interface $interface:ident ($vtbl:ident) : $pinterface:ident ($pvtbl:ident) {$( + fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty, + )+}) => ( + #[repr(C)] + pub struct $vtbl { + pub parent: $pvtbl, + $(pub $method: unsafe extern "system" fn( + This: *mut $interface, + $($p: $t,)* + ) -> $rtr,)+ + } + #[repr(C)] + pub struct $interface { + pub lpVtbl: *const $vtbl, + } + RIDL!{@impl $interface {$(fn $method($($p: $t,)*) -> $rtr,)+}} + RIDL!{@deref $interface $pinterface} + RIDL!{@uuid $interface $($uuid),+} + ); + (@deref $interface:ident $pinterface:ident) => ( + impl ::std::ops::Deref for $interface { + type Target = $pinterface; + #[inline] + fn deref(&self) -> &$pinterface { + unsafe { &*(self as *const $interface as *const $pinterface) } + } + } + ); + (@impl $interface:ident {$( + fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty, + )+}) => ( + impl $interface { + $(#[inline] pub unsafe fn $method(&self, $($p: $t,)*) -> $rtr { + ((*self.lpVtbl).$method)(self as *const _ as *mut _, $($p,)*) + })+ + } + ); + (@uuid $interface:ident + $l:expr, $w1:expr, $w2:expr, + $b1:expr, $b2:expr, $b3:expr, $b4:expr, $b5:expr, $b6:expr, $b7:expr, $b8:expr + ) => ( + impl $crate::winapi::Interface for $interface { + #[inline] + fn uuidof() -> $crate::winapi::GUID { + $crate::winapi::GUID { + Data1: $l, + Data2: $w1, + Data3: $w2, + Data4: [$b1, $b2, $b3, $b4, $b5, $b6, $b7, $b8], + } + } + } + ); +} + +RIDL! {#[uuid(0x00000000, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IUnknown(IUnknownVtbl) { + fn QueryInterface( + riid: REFIID, + ppvObject: *mut *mut raw::c_void, + ) -> HRESULT, + fn AddRef() -> ULONG, + fn Release() -> ULONG, +}} diff --git a/bash-5.1/vendor/cc/src/windows_registry.rs b/bash-5.1/vendor/cc/src/windows_registry.rs new file mode 100644 index 0000000000000000000000000000000000000000..549082b30af22fdf9c236eab1770b8b6a14e93b0 --- /dev/null +++ b/bash-5.1/vendor/cc/src/windows_registry.rs @@ -0,0 +1,900 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! A helper module to probe the Windows Registry when looking for +//! windows-specific tools. + +use std::process::Command; + +use crate::Tool; +#[cfg(windows)] +use crate::ToolFamily; + +#[cfg(windows)] +const MSVC_FAMILY: ToolFamily = ToolFamily::Msvc { clang_cl: false }; + +/// Attempts to find a tool within an MSVC installation using the Windows +/// registry as a point to search from. +/// +/// The `target` argument is the target that the tool should work for (e.g. +/// compile or link for) and the `tool` argument is the tool to find (e.g. +/// `cl.exe` or `link.exe`). +/// +/// This function will return `None` if the tool could not be found, or it will +/// return `Some(cmd)` which represents a command that's ready to execute the +/// tool with the appropriate environment variables set. +/// +/// Note that this function always returns `None` for non-MSVC targets. +pub fn find(target: &str, tool: &str) -> Option { + find_tool(target, tool).map(|c| c.to_command()) +} + +/// Similar to the `find` function above, this function will attempt the same +/// operation (finding a MSVC tool in a local install) but instead returns a +/// `Tool` which may be introspected. +#[cfg(not(windows))] +pub fn find_tool(_target: &str, _tool: &str) -> Option { + None +} + +/// Documented above. +#[cfg(windows)] +pub fn find_tool(target: &str, tool: &str) -> Option { + // This logic is all tailored for MSVC, if we're not that then bail out + // early. + if !target.contains("msvc") { + return None; + } + + // Looks like msbuild isn't located in the same location as other tools like + // cl.exe and lib.exe. To handle this we probe for it manually with + // dedicated registry keys. + if tool.contains("msbuild") { + return impl_::find_msbuild(target); + } + + if tool.contains("devenv") { + return impl_::find_devenv(target); + } + + // Ok, if we're here, now comes the fun part of the probing. Default shells + // or shells like MSYS aren't really configured to execute `cl.exe` and the + // various compiler tools shipped as part of Visual Studio. Here we try to + // first find the relevant tool, then we also have to be sure to fill in + // environment variables like `LIB`, `INCLUDE`, and `PATH` to ensure that + // the tool is actually usable. + + return impl_::find_msvc_environment(tool, target) + .or_else(|| impl_::find_msvc_15plus(tool, target)) + .or_else(|| impl_::find_msvc_14(tool, target)) + .or_else(|| impl_::find_msvc_12(tool, target)) + .or_else(|| impl_::find_msvc_11(tool, target)); +} + +/// A version of Visual Studio +#[derive(Debug, PartialEq, Eq, Copy, Clone)] +pub enum VsVers { + /// Visual Studio 12 (2013) + Vs12, + /// Visual Studio 14 (2015) + Vs14, + /// Visual Studio 15 (2017) + Vs15, + /// Visual Studio 16 (2019) + Vs16, + /// Visual Studio 17 (2022) + Vs17, + + /// Hidden variant that should not be matched on. Callers that want to + /// handle an enumeration of `VsVers` instances should always have a default + /// case meaning that it's a VS version they don't understand. + #[doc(hidden)] + #[allow(bad_style)] + __Nonexhaustive_do_not_match_this_or_your_code_will_break, +} + +/// Find the most recent installed version of Visual Studio +/// +/// This is used by the cmake crate to figure out the correct +/// generator. +#[cfg(not(windows))] +pub fn find_vs_version() -> Result { + Err(format!("not windows")) +} + +/// Documented above +#[cfg(windows)] +pub fn find_vs_version() -> Result { + use std::env; + + match env::var("VisualStudioVersion") { + Ok(version) => match &version[..] { + "17.0" => Ok(VsVers::Vs17), + "16.0" => Ok(VsVers::Vs16), + "15.0" => Ok(VsVers::Vs15), + "14.0" => Ok(VsVers::Vs14), + "12.0" => Ok(VsVers::Vs12), + vers => Err(format!( + "\n\n\ + unsupported or unknown VisualStudio version: {}\n\ + if another version is installed consider running \ + the appropriate vcvars script before building this \ + crate\n\ + ", + vers + )), + }, + _ => { + // Check for the presence of a specific registry key + // that indicates visual studio is installed. + if impl_::has_msbuild_version("17.0") { + Ok(VsVers::Vs17) + } else if impl_::has_msbuild_version("16.0") { + Ok(VsVers::Vs16) + } else if impl_::has_msbuild_version("15.0") { + Ok(VsVers::Vs15) + } else if impl_::has_msbuild_version("14.0") { + Ok(VsVers::Vs14) + } else if impl_::has_msbuild_version("12.0") { + Ok(VsVers::Vs12) + } else { + Err(format!( + "\n\n\ + couldn't determine visual studio generator\n\ + if VisualStudio is installed, however, consider \ + running the appropriate vcvars script before building \ + this crate\n\ + " + )) + } + } + } +} + +#[cfg(windows)] +mod impl_ { + use crate::com; + use crate::registry::{RegistryKey, LOCAL_MACHINE}; + use crate::setup_config::SetupConfiguration; + use crate::vs_instances::{VsInstances, VswhereInstance}; + use std::convert::TryFrom; + use std::env; + use std::ffi::OsString; + use std::fs::File; + use std::io::Read; + use std::iter; + use std::mem; + use std::path::{Path, PathBuf}; + use std::process::Command; + use std::str::FromStr; + + use super::MSVC_FAMILY; + use crate::Tool; + + struct MsvcTool { + tool: PathBuf, + libs: Vec, + path: Vec, + include: Vec, + } + + impl MsvcTool { + fn new(tool: PathBuf) -> MsvcTool { + MsvcTool { + tool: tool, + libs: Vec::new(), + path: Vec::new(), + include: Vec::new(), + } + } + + fn into_tool(self) -> Tool { + let MsvcTool { + tool, + libs, + path, + include, + } = self; + let mut tool = Tool::with_family(tool.into(), MSVC_FAMILY); + add_env(&mut tool, "LIB", libs); + add_env(&mut tool, "PATH", path); + add_env(&mut tool, "INCLUDE", include); + tool + } + } + + /// Checks to see if the `VSCMD_ARG_TGT_ARCH` environment variable matches the + /// given target's arch. Returns `None` if the variable does not exist. + #[cfg(windows)] + fn is_vscmd_target(target: &str) -> Option { + let vscmd_arch = env::var("VSCMD_ARG_TGT_ARCH").ok()?; + // Convert the Rust target arch to its VS arch equivalent. + let arch = match target.split("-").next() { + Some("x86_64") => "x64", + Some("aarch64") => "arm64", + Some("i686") | Some("i586") => "x86", + Some("thumbv7a") => "arm", + // An unrecognized arch. + _ => return Some(false), + }; + Some(vscmd_arch == arch) + } + + /// Attempt to find the tool using environment variables set by vcvars. + pub fn find_msvc_environment(tool: &str, target: &str) -> Option { + // Early return if the environment doesn't contain a VC install. + if env::var_os("VCINSTALLDIR").is_none() { + return None; + } + let vs_install_dir = env::var_os("VSINSTALLDIR")?.into(); + + // If the vscmd target differs from the requested target then + // attempt to get the tool using the VS install directory. + if is_vscmd_target(target) == Some(false) { + // We will only get here with versions 15+. + tool_from_vs15plus_instance(tool, target, &vs_install_dir) + } else { + // Fallback to simply using the current environment. + env::var_os("PATH") + .and_then(|path| { + env::split_paths(&path) + .map(|p| p.join(tool)) + .find(|p| p.exists()) + }) + .map(|path| Tool::with_family(path.into(), MSVC_FAMILY)) + } + } + + fn find_msbuild_vs17(target: &str) -> Option { + find_tool_in_vs16plus_path(r"MSBuild\Current\Bin\MSBuild.exe", target, "17") + } + + #[allow(bare_trait_objects)] + fn vs16plus_instances(target: &str, version: &'static str) -> Box> { + let instances = if let Some(instances) = vs15plus_instances(target) { + instances + } else { + return Box::new(iter::empty()); + }; + Box::new(instances.into_iter().filter_map(move |instance| { + let installation_name = instance.installation_name()?; + if installation_name.starts_with(&format!("VisualStudio/{}.", version)) { + Some(instance.installation_path()?) + } else if installation_name.starts_with(&format!("VisualStudioPreview/{}.", version)) { + Some(instance.installation_path()?) + } else { + None + } + })) + } + + fn find_tool_in_vs16plus_path(tool: &str, target: &str, version: &'static str) -> Option { + vs16plus_instances(target, version) + .filter_map(|path| { + let path = path.join(tool); + if !path.is_file() { + return None; + } + let mut tool = Tool::with_family(path, MSVC_FAMILY); + if target.contains("x86_64") { + tool.env.push(("Platform".into(), "X64".into())); + } + if target.contains("aarch64") { + tool.env.push(("Platform".into(), "ARM64".into())); + } + Some(tool) + }) + .next() + } + + fn find_msbuild_vs16(target: &str) -> Option { + find_tool_in_vs16plus_path(r"MSBuild\Current\Bin\MSBuild.exe", target, "16") + } + + // In MSVC 15 (2017) MS once again changed the scheme for locating + // the tooling. Now we must go through some COM interfaces, which + // is super fun for Rust. + // + // Note that much of this logic can be found [online] wrt paths, COM, etc. + // + // [online]: https://blogs.msdn.microsoft.com/vcblog/2017/03/06/finding-the-visual-c-compiler-tools-in-visual-studio-2017/ + // + // Returns MSVC 15+ instances (15, 16 right now), the order should be consider undefined. + // + // However, on ARM64 this method doesn't work because VS Installer fails to register COM component on ARM64. + // Hence, as the last resort we try to use vswhere.exe to list available instances. + fn vs15plus_instances(target: &str) -> Option { + vs15plus_instances_using_com().or_else(|| vs15plus_instances_using_vswhere(target)) + } + + fn vs15plus_instances_using_com() -> Option { + com::initialize().ok()?; + + let config = SetupConfiguration::new().ok()?; + let enum_setup_instances = config.enum_all_instances().ok()?; + + Some(VsInstances::ComBased(enum_setup_instances)) + } + + fn vs15plus_instances_using_vswhere(target: &str) -> Option { + let program_files_path: PathBuf = env::var("ProgramFiles(x86)") + .or_else(|_| env::var("ProgramFiles")) + .ok()? + .into(); + + let vswhere_path = + program_files_path.join(r"Microsoft Visual Studio\Installer\vswhere.exe"); + + if !vswhere_path.exists() { + return None; + } + + let arch = target.split('-').next().unwrap(); + let tools_arch = match arch { + "i586" | "i686" | "x86_64" => Some("x86.x64"), + "arm" | "thumbv7a" => Some("ARM"), + "aarch64" => Some("ARM64"), + _ => None, + }; + + let vswhere_output = Command::new(vswhere_path) + .args(&[ + "-latest", + "-products", + "*", + "-requires", + &format!("Microsoft.VisualStudio.Component.VC.Tools.{}", tools_arch?), + "-format", + "text", + "-nologo", + ]) + .stderr(std::process::Stdio::inherit()) + .output() + .ok()?; + + let vs_instances = + VsInstances::VswhereBased(VswhereInstance::try_from(&vswhere_output.stdout).ok()?); + + Some(vs_instances) + } + + // Inspired from official microsoft/vswhere ParseVersionString + // i.e. at most four u16 numbers separated by '.' + fn parse_version(version: &str) -> Option> { + version + .split('.') + .map(|chunk| u16::from_str(chunk).ok()) + .collect() + } + + pub fn find_msvc_15plus(tool: &str, target: &str) -> Option { + let iter = vs15plus_instances(target)?; + iter.into_iter() + .filter_map(|instance| { + let version = parse_version(&instance.installation_version()?)?; + let instance_path = instance.installation_path()?; + let tool = tool_from_vs15plus_instance(tool, target, &instance_path)?; + Some((version, tool)) + }) + .max_by(|(a_version, _), (b_version, _)| a_version.cmp(b_version)) + .map(|(_version, tool)| tool) + } + + // While the paths to Visual Studio 2017's devenv and MSBuild could + // potentially be retrieved from the registry, finding them via + // SetupConfiguration has shown to be [more reliable], and is preferred + // according to Microsoft. To help head off potential regressions though, + // we keep the registry method as a fallback option. + // + // [more reliable]: https://github.com/alexcrichton/cc-rs/pull/331 + fn find_tool_in_vs15_path(tool: &str, target: &str) -> Option { + let mut path = match vs15plus_instances(target) { + Some(instances) => instances + .into_iter() + .filter_map(|instance| instance.installation_path()) + .map(|path| path.join(tool)) + .find(|ref path| path.is_file()), + None => None, + }; + + if path.is_none() { + let key = r"SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7"; + path = LOCAL_MACHINE + .open(key.as_ref()) + .ok() + .and_then(|key| key.query_str("15.0").ok()) + .map(|path| PathBuf::from(path).join(tool)) + .and_then(|path| if path.is_file() { Some(path) } else { None }); + } + + path.map(|path| { + let mut tool = Tool::with_family(path, MSVC_FAMILY); + if target.contains("x86_64") { + tool.env.push(("Platform".into(), "X64".into())); + } + if target.contains("aarch64") { + tool.env.push(("Platform".into(), "ARM64".into())); + } + tool + }) + } + + fn tool_from_vs15plus_instance( + tool: &str, + target: &str, + instance_path: &PathBuf, + ) -> Option { + let (bin_path, host_dylib_path, lib_path, include_path) = + vs15plus_vc_paths(target, instance_path)?; + let tool_path = bin_path.join(tool); + if !tool_path.exists() { + return None; + }; + + let mut tool = MsvcTool::new(tool_path); + tool.path.push(bin_path.clone()); + tool.path.push(host_dylib_path); + tool.libs.push(lib_path); + tool.include.push(include_path); + + if let Some((atl_lib_path, atl_include_path)) = atl_paths(target, &bin_path) { + tool.libs.push(atl_lib_path); + tool.include.push(atl_include_path); + } + + add_sdks(&mut tool, target)?; + + Some(tool.into_tool()) + } + + fn vs15plus_vc_paths( + target: &str, + instance_path: &PathBuf, + ) -> Option<(PathBuf, PathBuf, PathBuf, PathBuf)> { + let version_path = + instance_path.join(r"VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt"); + let mut version_file = File::open(version_path).ok()?; + let mut version = String::new(); + version_file.read_to_string(&mut version).ok()?; + let version = version.trim(); + let host = match host_arch() { + X86 => "X86", + X86_64 => "X64", + // There is no natively hosted compiler on ARM64. + // Instead, use the x86 toolchain under emulation (there is no x64 emulation). + AARCH64 => "X86", + _ => return None, + }; + let target = lib_subdir(target)?; + // The directory layout here is MSVC/bin/Host$host/$target/ + let path = instance_path.join(r"VC\Tools\MSVC").join(version); + // This is the path to the toolchain for a particular target, running + // on a given host + let bin_path = path + .join("bin") + .join(&format!("Host{}", host)) + .join(&target); + // But! we also need PATH to contain the target directory for the host + // architecture, because it contains dlls like mspdb140.dll compiled for + // the host architecture. + let host_dylib_path = path + .join("bin") + .join(&format!("Host{}", host)) + .join(&host.to_lowercase()); + let lib_path = path.join("lib").join(&target); + let include_path = path.join("include"); + Some((bin_path, host_dylib_path, lib_path, include_path)) + } + + fn atl_paths(target: &str, path: &Path) -> Option<(PathBuf, PathBuf)> { + let atl_path = path.join("atlmfc"); + let sub = lib_subdir(target)?; + if atl_path.exists() { + Some((atl_path.join("lib").join(sub), atl_path.join("include"))) + } else { + None + } + } + + // For MSVC 14 we need to find the Universal CRT as well as either + // the Windows 10 SDK or Windows 8.1 SDK. + pub fn find_msvc_14(tool: &str, target: &str) -> Option { + let vcdir = get_vc_dir("14.0")?; + let mut tool = get_tool(tool, &vcdir, target)?; + add_sdks(&mut tool, target)?; + Some(tool.into_tool()) + } + + fn add_sdks(tool: &mut MsvcTool, target: &str) -> Option<()> { + let sub = lib_subdir(target)?; + let (ucrt, ucrt_version) = get_ucrt_dir()?; + + let host = match host_arch() { + X86 => "x86", + X86_64 => "x64", + AARCH64 => "arm64", + _ => return None, + }; + + tool.path + .push(ucrt.join("bin").join(&ucrt_version).join(host)); + + let ucrt_include = ucrt.join("include").join(&ucrt_version); + tool.include.push(ucrt_include.join("ucrt")); + + let ucrt_lib = ucrt.join("lib").join(&ucrt_version); + tool.libs.push(ucrt_lib.join("ucrt").join(sub)); + + if let Some((sdk, version)) = get_sdk10_dir() { + tool.path.push(sdk.join("bin").join(host)); + let sdk_lib = sdk.join("lib").join(&version); + tool.libs.push(sdk_lib.join("um").join(sub)); + let sdk_include = sdk.join("include").join(&version); + tool.include.push(sdk_include.join("um")); + tool.include.push(sdk_include.join("cppwinrt")); + tool.include.push(sdk_include.join("winrt")); + tool.include.push(sdk_include.join("shared")); + } else if let Some(sdk) = get_sdk81_dir() { + tool.path.push(sdk.join("bin").join(host)); + let sdk_lib = sdk.join("lib").join("winv6.3"); + tool.libs.push(sdk_lib.join("um").join(sub)); + let sdk_include = sdk.join("include"); + tool.include.push(sdk_include.join("um")); + tool.include.push(sdk_include.join("winrt")); + tool.include.push(sdk_include.join("shared")); + } + + Some(()) + } + + // For MSVC 12 we need to find the Windows 8.1 SDK. + pub fn find_msvc_12(tool: &str, target: &str) -> Option { + let vcdir = get_vc_dir("12.0")?; + let mut tool = get_tool(tool, &vcdir, target)?; + let sub = lib_subdir(target)?; + let sdk81 = get_sdk81_dir()?; + tool.path.push(sdk81.join("bin").join(sub)); + let sdk_lib = sdk81.join("lib").join("winv6.3"); + tool.libs.push(sdk_lib.join("um").join(sub)); + let sdk_include = sdk81.join("include"); + tool.include.push(sdk_include.join("shared")); + tool.include.push(sdk_include.join("um")); + tool.include.push(sdk_include.join("winrt")); + Some(tool.into_tool()) + } + + // For MSVC 11 we need to find the Windows 8 SDK. + pub fn find_msvc_11(tool: &str, target: &str) -> Option { + let vcdir = get_vc_dir("11.0")?; + let mut tool = get_tool(tool, &vcdir, target)?; + let sub = lib_subdir(target)?; + let sdk8 = get_sdk8_dir()?; + tool.path.push(sdk8.join("bin").join(sub)); + let sdk_lib = sdk8.join("lib").join("win8"); + tool.libs.push(sdk_lib.join("um").join(sub)); + let sdk_include = sdk8.join("include"); + tool.include.push(sdk_include.join("shared")); + tool.include.push(sdk_include.join("um")); + tool.include.push(sdk_include.join("winrt")); + Some(tool.into_tool()) + } + + fn add_env(tool: &mut Tool, env: &str, paths: Vec) { + let prev = env::var_os(env).unwrap_or(OsString::new()); + let prev = env::split_paths(&prev); + let new = paths.into_iter().chain(prev); + tool.env + .push((env.to_string().into(), env::join_paths(new).unwrap())); + } + + // Given a possible MSVC installation directory, we look for the linker and + // then add the MSVC library path. + fn get_tool(tool: &str, path: &Path, target: &str) -> Option { + bin_subdir(target) + .into_iter() + .map(|(sub, host)| { + ( + path.join("bin").join(sub).join(tool), + path.join("bin").join(host), + ) + }) + .filter(|&(ref path, _)| path.is_file()) + .map(|(path, host)| { + let mut tool = MsvcTool::new(path); + tool.path.push(host); + tool + }) + .filter_map(|mut tool| { + let sub = vc_lib_subdir(target)?; + tool.libs.push(path.join("lib").join(sub)); + tool.include.push(path.join("include")); + let atlmfc_path = path.join("atlmfc"); + if atlmfc_path.exists() { + tool.libs.push(atlmfc_path.join("lib").join(sub)); + tool.include.push(atlmfc_path.join("include")); + } + Some(tool) + }) + .next() + } + + // To find MSVC we look in a specific registry key for the version we are + // trying to find. + fn get_vc_dir(ver: &str) -> Option { + let key = r"SOFTWARE\Microsoft\VisualStudio\SxS\VC7"; + let key = LOCAL_MACHINE.open(key.as_ref()).ok()?; + let path = key.query_str(ver).ok()?; + Some(path.into()) + } + + // To find the Universal CRT we look in a specific registry key for where + // all the Universal CRTs are located and then sort them asciibetically to + // find the newest version. While this sort of sorting isn't ideal, it is + // what vcvars does so that's good enough for us. + // + // Returns a pair of (root, version) for the ucrt dir if found + fn get_ucrt_dir() -> Option<(PathBuf, String)> { + let key = r"SOFTWARE\Microsoft\Windows Kits\Installed Roots"; + let key = LOCAL_MACHINE.open(key.as_ref()).ok()?; + let root = key.query_str("KitsRoot10").ok()?; + let readdir = Path::new(&root).join("lib").read_dir().ok()?; + let max_libdir = readdir + .filter_map(|dir| dir.ok()) + .map(|dir| dir.path()) + .filter(|dir| { + dir.components() + .last() + .and_then(|c| c.as_os_str().to_str()) + .map(|c| c.starts_with("10.") && dir.join("ucrt").is_dir()) + .unwrap_or(false) + }) + .max()?; + let version = max_libdir.components().last().unwrap(); + let version = version.as_os_str().to_str().unwrap().to_string(); + Some((root.into(), version)) + } + + // Vcvars finds the correct version of the Windows 10 SDK by looking + // for the include `um\Windows.h` because sometimes a given version will + // only have UCRT bits without the rest of the SDK. Since we only care about + // libraries and not includes, we instead look for `um\x64\kernel32.lib`. + // Since the 32-bit and 64-bit libraries are always installed together we + // only need to bother checking x64, making this code a tiny bit simpler. + // Like we do for the Universal CRT, we sort the possibilities + // asciibetically to find the newest one as that is what vcvars does. + // Before doing that, we check the "WindowsSdkDir" and "WindowsSDKVersion" + // environment variables set by vcvars to use the environment sdk version + // if one is already configured. + fn get_sdk10_dir() -> Option<(PathBuf, String)> { + if let (Ok(root), Ok(version)) = (env::var("WindowsSdkDir"), env::var("WindowsSDKVersion")) + { + return Some((root.into(), version.trim_end_matches('\\').to_string())); + } + + let key = r"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0"; + let key = LOCAL_MACHINE.open(key.as_ref()).ok()?; + let root = key.query_str("InstallationFolder").ok()?; + let readdir = Path::new(&root).join("lib").read_dir().ok()?; + let mut dirs = readdir + .filter_map(|dir| dir.ok()) + .map(|dir| dir.path()) + .collect::>(); + dirs.sort(); + let dir = dirs + .into_iter() + .rev() + .filter(|dir| dir.join("um").join("x64").join("kernel32.lib").is_file()) + .next()?; + let version = dir.components().last().unwrap(); + let version = version.as_os_str().to_str().unwrap().to_string(); + Some((root.into(), version)) + } + + // Interestingly there are several subdirectories, `win7` `win8` and + // `winv6.3`. Vcvars seems to only care about `winv6.3` though, so the same + // applies to us. Note that if we were targeting kernel mode drivers + // instead of user mode applications, we would care. + fn get_sdk81_dir() -> Option { + let key = r"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1"; + let key = LOCAL_MACHINE.open(key.as_ref()).ok()?; + let root = key.query_str("InstallationFolder").ok()?; + Some(root.into()) + } + + fn get_sdk8_dir() -> Option { + let key = r"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0"; + let key = LOCAL_MACHINE.open(key.as_ref()).ok()?; + let root = key.query_str("InstallationFolder").ok()?; + Some(root.into()) + } + + const PROCESSOR_ARCHITECTURE_INTEL: u16 = 0; + const PROCESSOR_ARCHITECTURE_AMD64: u16 = 9; + const PROCESSOR_ARCHITECTURE_ARM64: u16 = 12; + const X86: u16 = PROCESSOR_ARCHITECTURE_INTEL; + const X86_64: u16 = PROCESSOR_ARCHITECTURE_AMD64; + const AARCH64: u16 = PROCESSOR_ARCHITECTURE_ARM64; + + // When choosing the tool to use, we have to choose the one which matches + // the target architecture. Otherwise we end up in situations where someone + // on 32-bit Windows is trying to cross compile to 64-bit and it tries to + // invoke the native 64-bit compiler which won't work. + // + // For the return value of this function, the first member of the tuple is + // the folder of the tool we will be invoking, while the second member is + // the folder of the host toolchain for that tool which is essential when + // using a cross linker. We return a Vec since on x64 there are often two + // linkers that can target the architecture we desire. The 64-bit host + // linker is preferred, and hence first, due to 64-bit allowing it more + // address space to work with and potentially being faster. + fn bin_subdir(target: &str) -> Vec<(&'static str, &'static str)> { + let arch = target.split('-').next().unwrap(); + match (arch, host_arch()) { + ("i586", X86) | ("i686", X86) => vec![("", "")], + ("i586", X86_64) | ("i686", X86_64) => vec![("amd64_x86", "amd64"), ("", "")], + ("x86_64", X86) => vec![("x86_amd64", "")], + ("x86_64", X86_64) => vec![("amd64", "amd64"), ("x86_amd64", "")], + ("arm", X86) | ("thumbv7a", X86) => vec![("x86_arm", "")], + ("arm", X86_64) | ("thumbv7a", X86_64) => vec![("amd64_arm", "amd64"), ("x86_arm", "")], + _ => vec![], + } + } + + fn lib_subdir(target: &str) -> Option<&'static str> { + let arch = target.split('-').next().unwrap(); + match arch { + "i586" | "i686" => Some("x86"), + "x86_64" => Some("x64"), + "arm" | "thumbv7a" => Some("arm"), + "aarch64" => Some("arm64"), + _ => None, + } + } + + // MSVC's x86 libraries are not in a subfolder + fn vc_lib_subdir(target: &str) -> Option<&'static str> { + let arch = target.split('-').next().unwrap(); + match arch { + "i586" | "i686" => Some(""), + "x86_64" => Some("amd64"), + "arm" | "thumbv7a" => Some("arm"), + "aarch64" => Some("arm64"), + _ => None, + } + } + + #[allow(bad_style)] + fn host_arch() -> u16 { + type DWORD = u32; + type WORD = u16; + type LPVOID = *mut u8; + type DWORD_PTR = usize; + + #[repr(C)] + struct SYSTEM_INFO { + wProcessorArchitecture: WORD, + _wReserved: WORD, + _dwPageSize: DWORD, + _lpMinimumApplicationAddress: LPVOID, + _lpMaximumApplicationAddress: LPVOID, + _dwActiveProcessorMask: DWORD_PTR, + _dwNumberOfProcessors: DWORD, + _dwProcessorType: DWORD, + _dwAllocationGranularity: DWORD, + _wProcessorLevel: WORD, + _wProcessorRevision: WORD, + } + + extern "system" { + fn GetNativeSystemInfo(lpSystemInfo: *mut SYSTEM_INFO); + } + + unsafe { + let mut info = mem::zeroed(); + GetNativeSystemInfo(&mut info); + info.wProcessorArchitecture + } + } + + // Given a registry key, look at all the sub keys and find the one which has + // the maximal numeric value. + // + // Returns the name of the maximal key as well as the opened maximal key. + fn max_version(key: &RegistryKey) -> Option<(OsString, RegistryKey)> { + let mut max_vers = 0; + let mut max_key = None; + for subkey in key.iter().filter_map(|k| k.ok()) { + let val = subkey + .to_str() + .and_then(|s| s.trim_left_matches("v").replace(".", "").parse().ok()); + let val = match val { + Some(s) => s, + None => continue, + }; + if val > max_vers { + if let Ok(k) = key.open(&subkey) { + max_vers = val; + max_key = Some((subkey, k)); + } + } + } + max_key + } + + pub fn has_msbuild_version(version: &str) -> bool { + match version { + "17.0" => { + find_msbuild_vs17("x86_64-pc-windows-msvc").is_some() + || find_msbuild_vs17("i686-pc-windows-msvc").is_some() + || find_msbuild_vs17("aarch64-pc-windows-msvc").is_some() + } + "16.0" => { + find_msbuild_vs16("x86_64-pc-windows-msvc").is_some() + || find_msbuild_vs16("i686-pc-windows-msvc").is_some() + || find_msbuild_vs16("aarch64-pc-windows-msvc").is_some() + } + "15.0" => { + find_msbuild_vs15("x86_64-pc-windows-msvc").is_some() + || find_msbuild_vs15("i686-pc-windows-msvc").is_some() + || find_msbuild_vs15("aarch64-pc-windows-msvc").is_some() + } + "12.0" | "14.0" => LOCAL_MACHINE + .open(&OsString::from(format!( + "SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\{}", + version + ))) + .is_ok(), + _ => false, + } + } + + pub fn find_devenv(target: &str) -> Option { + find_devenv_vs15(&target) + } + + fn find_devenv_vs15(target: &str) -> Option { + find_tool_in_vs15_path(r"Common7\IDE\devenv.exe", target) + } + + // see http://stackoverflow.com/questions/328017/path-to-msbuild + pub fn find_msbuild(target: &str) -> Option { + // VS 15 (2017) changed how to locate msbuild + if let Some(r) = find_msbuild_vs16(target) { + return Some(r); + } else if let Some(r) = find_msbuild_vs15(target) { + return Some(r); + } else { + find_old_msbuild(target) + } + } + + fn find_msbuild_vs15(target: &str) -> Option { + find_tool_in_vs15_path(r"MSBuild\15.0\Bin\MSBuild.exe", target) + } + + fn find_old_msbuild(target: &str) -> Option { + let key = r"SOFTWARE\Microsoft\MSBuild\ToolsVersions"; + LOCAL_MACHINE + .open(key.as_ref()) + .ok() + .and_then(|key| { + max_version(&key).and_then(|(_vers, key)| key.query_str("MSBuildToolsPath").ok()) + }) + .map(|path| { + let mut path = PathBuf::from(path); + path.push("MSBuild.exe"); + let mut tool = Tool::with_family(path, MSVC_FAMILY); + if target.contains("x86_64") { + tool.env.push(("Platform".into(), "X64".into())); + } + tool + }) + } +} diff --git a/bash-5.1/vendor/cc/tests/cc_env.rs b/bash-5.1/vendor/cc/tests/cc_env.rs new file mode 100644 index 0000000000000000000000000000000000000000..43eb689f0fbfa8b70210b8632fce6936d5eb3ed2 --- /dev/null +++ b/bash-5.1/vendor/cc/tests/cc_env.rs @@ -0,0 +1,118 @@ +use std::env; +use std::ffi::OsString; +use std::path::Path; + +mod support; +use crate::support::Test; + +#[test] +fn main() { + ccache(); + distcc(); + ccache_spaces(); + ccache_env_flags(); + leading_spaces(); + extra_flags(); + path_to_ccache(); + more_spaces(); +} + +fn ccache() { + let test = Test::gnu(); + + env::set_var("CC", "ccache cc"); + let compiler = test.gcc().file("foo.c").get_compiler(); + + assert_eq!(compiler.path(), Path::new("cc")); +} + +fn ccache_spaces() { + let test = Test::gnu(); + test.shim("ccache"); + + env::set_var("CC", "ccache cc"); + let compiler = test.gcc().file("foo.c").get_compiler(); + assert_eq!(compiler.path(), Path::new("cc")); +} + +fn distcc() { + let test = Test::gnu(); + test.shim("distcc"); + + env::set_var("CC", "distcc cc"); + let compiler = test.gcc().file("foo.c").get_compiler(); + assert_eq!(compiler.path(), Path::new("cc")); +} + +fn ccache_env_flags() { + let test = Test::gnu(); + test.shim("ccache"); + + env::set_var("CC", "ccache lol-this-is-not-a-compiler"); + let compiler = test.gcc().file("foo.c").get_compiler(); + assert_eq!(compiler.path(), Path::new("lol-this-is-not-a-compiler")); + assert_eq!( + compiler.cc_env(), + OsString::from("ccache lol-this-is-not-a-compiler") + ); + assert!( + compiler + .cflags_env() + .into_string() + .unwrap() + .contains("ccache") + == false + ); + assert!( + compiler + .cflags_env() + .into_string() + .unwrap() + .contains(" lol-this-is-not-a-compiler") + == false + ); + + env::set_var("CC", ""); +} + +fn leading_spaces() { + let test = Test::gnu(); + test.shim("ccache"); + + env::set_var("CC", " test "); + let compiler = test.gcc().file("foo.c").get_compiler(); + assert_eq!(compiler.path(), Path::new("test")); + + env::set_var("CC", ""); +} + +fn extra_flags() { + let test = Test::gnu(); + test.shim("ccache"); + + env::set_var("CC", "ccache cc -m32"); + let compiler = test.gcc().file("foo.c").get_compiler(); + assert_eq!(compiler.path(), Path::new("cc")); +} + +fn path_to_ccache() { + let test = Test::gnu(); + test.shim("ccache"); + + env::set_var("CC", "/path/to/ccache.exe cc -m32"); + let compiler = test.gcc().file("foo.c").get_compiler(); + assert_eq!(compiler.path(), Path::new("cc")); + assert_eq!( + compiler.cc_env(), + OsString::from("/path/to/ccache.exe cc -m32"), + ); +} + +fn more_spaces() { + let test = Test::gnu(); + test.shim("ccache"); + + env::set_var("CC", "cc -m32"); + let compiler = test.gcc().file("foo.c").get_compiler(); + assert_eq!(compiler.path(), Path::new("cc")); +} diff --git a/bash-5.1/vendor/cc/tests/cflags.rs b/bash-5.1/vendor/cc/tests/cflags.rs new file mode 100644 index 0000000000000000000000000000000000000000..caec6ea4ed4cdac34b7f4f0378c0ac607a39d91a --- /dev/null +++ b/bash-5.1/vendor/cc/tests/cflags.rs @@ -0,0 +1,15 @@ +mod support; + +use crate::support::Test; +use std::env; + +/// This test is in its own module because it modifies the environment and would affect other tests +/// when run in parallel with them. +#[test] +fn gnu_no_warnings_if_cflags() { + env::set_var("CFLAGS", "-arbitrary"); + let test = Test::gnu(); + test.gcc().file("foo.c").compile("foo"); + + test.cmd(0).must_not_have("-Wall").must_not_have("-Wextra"); +} diff --git a/bash-5.1/vendor/cc/tests/cxxflags.rs b/bash-5.1/vendor/cc/tests/cxxflags.rs new file mode 100644 index 0000000000000000000000000000000000000000..c524c7da4e9f086c570942fbc651facb8de8b944 --- /dev/null +++ b/bash-5.1/vendor/cc/tests/cxxflags.rs @@ -0,0 +1,15 @@ +mod support; + +use crate::support::Test; +use std::env; + +/// This test is in its own module because it modifies the environment and would affect other tests +/// when run in parallel with them. +#[test] +fn gnu_no_warnings_if_cxxflags() { + env::set_var("CXXFLAGS", "-arbitrary"); + let test = Test::gnu(); + test.gcc().file("foo.cpp").cpp(true).compile("foo"); + + test.cmd(0).must_not_have("-Wall").must_not_have("-Wextra"); +} diff --git a/bash-5.1/vendor/cc/tests/support/mod.rs b/bash-5.1/vendor/cc/tests/support/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..f3c04405a3f769b096dc4469899b92ab080c3121 --- /dev/null +++ b/bash-5.1/vendor/cc/tests/support/mod.rs @@ -0,0 +1,172 @@ +#![allow(dead_code)] + +use std::env; +use std::ffi::{OsStr, OsString}; +use std::fs::{self, File}; +use std::io; +use std::io::prelude::*; +use std::path::{Path, PathBuf}; + +use cc; +use tempfile::{Builder, TempDir}; + +pub struct Test { + pub td: TempDir, + pub gcc: PathBuf, + pub msvc: bool, +} + +pub struct Execution { + args: Vec, +} + +impl Test { + pub fn new() -> Test { + // This is ugly: `sccache` needs to introspect the compiler it is + // executing, as it adjusts its behavior depending on the + // language/compiler. This crate's test driver uses mock compilers that + // are obviously not supported by sccache, so the tests fail if + // RUSTC_WRAPPER is set. rust doesn't build test dependencies with + // the `test` feature enabled, so we can't conditionally disable the + // usage of `sccache` if running in a test environment, at least not + // without setting an environment variable here and testing for it + // there. Explicitly deasserting RUSTC_WRAPPER here seems to be the + // lesser of the two evils. + env::remove_var("RUSTC_WRAPPER"); + + let mut gcc = PathBuf::from(env::current_exe().unwrap()); + gcc.pop(); + if gcc.ends_with("deps") { + gcc.pop(); + } + let td = Builder::new().prefix("gcc-test").tempdir_in(&gcc).unwrap(); + gcc.push(format!("gcc-shim{}", env::consts::EXE_SUFFIX)); + Test { + td: td, + gcc: gcc, + msvc: false, + } + } + + pub fn gnu() -> Test { + let t = Test::new(); + t.shim("cc").shim("c++").shim("ar"); + t + } + + pub fn msvc() -> Test { + let mut t = Test::new(); + t.shim("cl").shim("lib.exe"); + t.msvc = true; + t + } + + pub fn shim(&self, name: &str) -> &Test { + let name = if name.ends_with(env::consts::EXE_SUFFIX) { + name.to_string() + } else { + format!("{}{}", name, env::consts::EXE_SUFFIX) + }; + link_or_copy(&self.gcc, self.td.path().join(name)).unwrap(); + self + } + + pub fn gcc(&self) -> cc::Build { + let mut cfg = cc::Build::new(); + let target = if self.msvc { + "x86_64-pc-windows-msvc" + } else { + "x86_64-unknown-linux-gnu" + }; + + cfg.target(target) + .host(target) + .opt_level(2) + .debug(false) + .out_dir(self.td.path()) + .__set_env("PATH", self.path()) + .__set_env("GCCTEST_OUT_DIR", self.td.path()); + if self.msvc { + cfg.compiler(self.td.path().join("cl")); + cfg.archiver(self.td.path().join("lib.exe")); + } + cfg + } + + fn path(&self) -> OsString { + let mut path = env::split_paths(&env::var_os("PATH").unwrap()).collect::>(); + path.insert(0, self.td.path().to_owned()); + env::join_paths(path).unwrap() + } + + pub fn cmd(&self, i: u32) -> Execution { + let mut s = String::new(); + File::open(self.td.path().join(format!("out{}", i))) + .unwrap() + .read_to_string(&mut s) + .unwrap(); + Execution { + args: s.lines().map(|s| s.to_string()).collect(), + } + } +} + +impl Execution { + pub fn must_have>(&self, p: P) -> &Execution { + if !self.has(p.as_ref()) { + panic!("didn't find {:?} in {:?}", p.as_ref(), self.args); + } else { + self + } + } + + pub fn must_not_have>(&self, p: P) -> &Execution { + if self.has(p.as_ref()) { + panic!("found {:?}", p.as_ref()); + } else { + self + } + } + + pub fn has(&self, p: &OsStr) -> bool { + self.args.iter().any(|arg| OsStr::new(arg) == p) + } + + pub fn must_have_in_order(&self, before: &str, after: &str) -> &Execution { + let before_position = self + .args + .iter() + .rposition(|x| OsStr::new(x) == OsStr::new(before)); + let after_position = self + .args + .iter() + .rposition(|x| OsStr::new(x) == OsStr::new(after)); + match (before_position, after_position) { + (Some(b), Some(a)) if b < a => {} + (b, a) => panic!( + "{:?} (last position: {:?}) did not appear before {:?} (last position: {:?})", + before, b, after, a + ), + }; + self + } +} + +/// Hard link an executable or copy it if that fails. +/// +/// We first try to hard link an executable to save space. If that fails (as on Windows with +/// different mount points, issue #60), we copy. +#[cfg(not(target_os = "macos"))] +fn link_or_copy, Q: AsRef>(from: P, to: Q) -> io::Result<()> { + let from = from.as_ref(); + let to = to.as_ref(); + fs::hard_link(from, to).or_else(|_| fs::copy(from, to).map(|_| ())) +} + +/// Copy an executable. +/// +/// On macOS, hard linking the executable leads to strange failures (issue #419), so we just copy. +#[cfg(target_os = "macos")] +fn link_or_copy, Q: AsRef>(from: P, to: Q) -> io::Result<()> { + fs::copy(from, to).map(|_| ()) +} diff --git a/bash-5.1/vendor/cc/tests/test.rs b/bash-5.1/vendor/cc/tests/test.rs new file mode 100644 index 0000000000000000000000000000000000000000..3c9b4dc4983cccdbe2a57b3a3e2049bf07d1c79c --- /dev/null +++ b/bash-5.1/vendor/cc/tests/test.rs @@ -0,0 +1,413 @@ +use crate::support::Test; + +mod support; + +// Some tests check that a flag is *not* present. These tests might fail if the flag is set in the +// CFLAGS or CXXFLAGS environment variables. This function clears the CFLAGS and CXXFLAGS +// variables to make sure that the tests can run correctly. +fn reset_env() { + std::env::set_var("CFLAGS", ""); + std::env::set_var("CXXFLAGS", ""); +} + +#[test] +fn gnu_smoke() { + reset_env(); + + let test = Test::gnu(); + test.gcc().file("foo.c").compile("foo"); + + test.cmd(0) + .must_have("-O2") + .must_have("foo.c") + .must_not_have("-g") + .must_have("-c") + .must_have("-ffunction-sections") + .must_have("-fdata-sections"); + test.cmd(1).must_have(test.td.path().join("foo.o")); +} + +#[test] +fn gnu_opt_level_1() { + reset_env(); + + let test = Test::gnu(); + test.gcc().opt_level(1).file("foo.c").compile("foo"); + + test.cmd(0).must_have("-O1").must_not_have("-O2"); +} + +#[test] +fn gnu_opt_level_s() { + reset_env(); + + let test = Test::gnu(); + test.gcc().opt_level_str("s").file("foo.c").compile("foo"); + + test.cmd(0) + .must_have("-Os") + .must_not_have("-O1") + .must_not_have("-O2") + .must_not_have("-O3") + .must_not_have("-Oz"); +} + +#[test] +fn gnu_debug_fp_auto() { + let test = Test::gnu(); + test.gcc().debug(true).file("foo.c").compile("foo"); + test.cmd(0).must_have("-g"); + test.cmd(0).must_have("-fno-omit-frame-pointer"); +} + +#[test] +fn gnu_debug_fp() { + let test = Test::gnu(); + test.gcc().debug(true).file("foo.c").compile("foo"); + test.cmd(0).must_have("-g"); + test.cmd(0).must_have("-fno-omit-frame-pointer"); +} + +#[test] +fn gnu_debug_nofp() { + reset_env(); + + let test = Test::gnu(); + test.gcc() + .debug(true) + .force_frame_pointer(false) + .file("foo.c") + .compile("foo"); + test.cmd(0).must_have("-g"); + test.cmd(0).must_not_have("-fno-omit-frame-pointer"); + + let test = Test::gnu(); + test.gcc() + .force_frame_pointer(false) + .debug(true) + .file("foo.c") + .compile("foo"); + test.cmd(0).must_have("-g"); + test.cmd(0).must_not_have("-fno-omit-frame-pointer"); +} + +#[test] +fn gnu_warnings_into_errors() { + let test = Test::gnu(); + test.gcc() + .warnings_into_errors(true) + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_have("-Werror"); +} + +#[test] +fn gnu_warnings() { + let test = Test::gnu(); + test.gcc() + .warnings(true) + .flag("-Wno-missing-field-initializers") + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_have("-Wall").must_have("-Wextra"); +} + +#[test] +fn gnu_extra_warnings0() { + reset_env(); + + let test = Test::gnu(); + test.gcc() + .warnings(true) + .extra_warnings(false) + .flag("-Wno-missing-field-initializers") + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_have("-Wall").must_not_have("-Wextra"); +} + +#[test] +fn gnu_extra_warnings1() { + reset_env(); + + let test = Test::gnu(); + test.gcc() + .warnings(false) + .extra_warnings(true) + .flag("-Wno-missing-field-initializers") + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_not_have("-Wall").must_have("-Wextra"); +} + +#[test] +fn gnu_warnings_overridable() { + reset_env(); + + let test = Test::gnu(); + test.gcc() + .warnings(true) + .flag("-Wno-missing-field-initializers") + .file("foo.c") + .compile("foo"); + + test.cmd(0) + .must_have_in_order("-Wall", "-Wno-missing-field-initializers"); +} + +#[test] +fn gnu_x86_64() { + for vendor in &["unknown-linux-gnu", "apple-darwin"] { + let target = format!("x86_64-{}", vendor); + let test = Test::gnu(); + test.gcc() + .target(&target) + .host(&target) + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_have("-fPIC").must_have("-m64"); + } +} + +#[test] +fn gnu_x86_64_no_pic() { + reset_env(); + + for vendor in &["unknown-linux-gnu", "apple-darwin"] { + let target = format!("x86_64-{}", vendor); + let test = Test::gnu(); + test.gcc() + .pic(false) + .target(&target) + .host(&target) + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_not_have("-fPIC"); + } +} + +#[test] +fn gnu_i686() { + for vendor in &["unknown-linux-gnu", "apple-darwin"] { + let target = format!("i686-{}", vendor); + let test = Test::gnu(); + test.gcc() + .target(&target) + .host(&target) + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_have("-m32"); + } +} + +#[test] +fn gnu_i686_pic() { + for vendor in &["unknown-linux-gnu", "apple-darwin"] { + let target = format!("i686-{}", vendor); + let test = Test::gnu(); + test.gcc() + .pic(true) + .target(&target) + .host(&target) + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_have("-fPIC"); + } +} + +#[test] +fn gnu_x86_64_no_plt() { + let target = "x86_64-unknown-linux-gnu"; + let test = Test::gnu(); + test.gcc() + .pic(true) + .use_plt(false) + .target(&target) + .host(&target) + .file("foo.c") + .compile("foo"); + test.cmd(0).must_have("-fno-plt"); +} + +#[test] +fn gnu_set_stdlib() { + reset_env(); + + let test = Test::gnu(); + test.gcc() + .cpp_set_stdlib(Some("foo")) + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_not_have("-stdlib=foo"); +} + +#[test] +fn gnu_include() { + let test = Test::gnu(); + test.gcc().include("foo/bar").file("foo.c").compile("foo"); + + test.cmd(0).must_have("-I").must_have("foo/bar"); +} + +#[test] +fn gnu_define() { + let test = Test::gnu(); + test.gcc() + .define("FOO", "bar") + .define("BAR", None) + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_have("-DFOO=bar").must_have("-DBAR"); +} + +#[test] +fn gnu_compile_assembly() { + let test = Test::gnu(); + test.gcc().file("foo.S").compile("foo"); + test.cmd(0).must_have("foo.S"); +} + +#[test] +fn gnu_shared() { + reset_env(); + + let test = Test::gnu(); + test.gcc() + .file("foo.c") + .shared_flag(true) + .static_flag(false) + .compile("foo"); + + test.cmd(0).must_have("-shared").must_not_have("-static"); +} + +#[test] +fn gnu_flag_if_supported() { + reset_env(); + + if cfg!(windows) { + return; + } + let test = Test::gnu(); + test.gcc() + .file("foo.c") + .flag("-v") + .flag_if_supported("-Wall") + .flag_if_supported("-Wflag-does-not-exist") + .flag_if_supported("-std=c++11") + .compile("foo"); + + test.cmd(0) + .must_have("-v") + .must_have("-Wall") + .must_not_have("-Wflag-does-not-exist") + .must_not_have("-std=c++11"); +} + +#[test] +fn gnu_flag_if_supported_cpp() { + if cfg!(windows) { + return; + } + let test = Test::gnu(); + test.gcc() + .cpp(true) + .file("foo.cpp") + .flag_if_supported("-std=c++11") + .compile("foo"); + + test.cmd(0).must_have("-std=c++11"); +} + +#[test] +fn gnu_static() { + reset_env(); + + let test = Test::gnu(); + test.gcc() + .file("foo.c") + .shared_flag(false) + .static_flag(true) + .compile("foo"); + + test.cmd(0).must_have("-static").must_not_have("-shared"); +} + +#[test] +fn msvc_smoke() { + reset_env(); + + let test = Test::msvc(); + test.gcc().file("foo.c").compile("foo"); + + test.cmd(0) + .must_have("-O2") + .must_have("foo.c") + .must_not_have("-Z7") + .must_have("-c") + .must_have("-MD"); + test.cmd(1).must_have(test.td.path().join("foo.o")); +} + +#[test] +fn msvc_opt_level_0() { + reset_env(); + + let test = Test::msvc(); + test.gcc().opt_level(0).file("foo.c").compile("foo"); + + test.cmd(0).must_not_have("-O2"); +} + +#[test] +fn msvc_debug() { + let test = Test::msvc(); + test.gcc().debug(true).file("foo.c").compile("foo"); + test.cmd(0).must_have("-Z7"); +} + +#[test] +fn msvc_include() { + let test = Test::msvc(); + test.gcc().include("foo/bar").file("foo.c").compile("foo"); + + test.cmd(0).must_have("-I").must_have("foo/bar"); +} + +#[test] +fn msvc_define() { + let test = Test::msvc(); + test.gcc() + .define("FOO", "bar") + .define("BAR", None) + .file("foo.c") + .compile("foo"); + + test.cmd(0).must_have("-DFOO=bar").must_have("-DBAR"); +} + +#[test] +fn msvc_static_crt() { + let test = Test::msvc(); + test.gcc().static_crt(true).file("foo.c").compile("foo"); + + test.cmd(0).must_have("-MT"); +} + +#[test] +fn msvc_no_static_crt() { + let test = Test::msvc(); + test.gcc().static_crt(false).file("foo.c").compile("foo"); + + test.cmd(0).must_have("-MD"); +} diff --git a/bash-5.1/vendor/cfg-if/.cargo-checksum.json b/bash-5.1/vendor/cfg-if/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..93e07c191ba289b4cd0514755a47171bdefe3cf7 --- /dev/null +++ b/bash-5.1/vendor/cfg-if/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"5b2a8f6e5256957c029cf3a8912d51438e7faa5891c5c102c312f6d4599c1f00","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"2406e83ee174e30aa67f8ab266836fa78545012b196395aff37c152321e2c713","src/lib.rs":"54b0f108b0dc48a077c52c0bcd22b64ef4de083e5e2b7d405e50ae4d78224f1b","tests/xcrate.rs":"c0734dae6e63beafcd60bf53546115a2320735b51035c9e2387fdf9301580934"},"package":"baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"} \ No newline at end of file diff --git a/bash-5.1/vendor/cfg-if/Cargo.toml b/bash-5.1/vendor/cfg-if/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..13a32ba2048d4d34ccadf98e3c7e69c7661ce679 --- /dev/null +++ b/bash-5.1/vendor/cfg-if/Cargo.toml @@ -0,0 +1,36 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +edition = "2018" +name = "cfg-if" +version = "1.0.0" +authors = ["Alex Crichton "] +description = "A macro to ergonomically define an item depending on a large number of #[cfg]\nparameters. Structured like an if-else chain, the first matching branch is the\nitem that gets emitted.\n" +homepage = "https://github.com/alexcrichton/cfg-if" +documentation = "https://docs.rs/cfg-if" +readme = "README.md" +license = "MIT/Apache-2.0" +repository = "https://github.com/alexcrichton/cfg-if" +[dependencies.compiler_builtins] +version = "0.1.2" +optional = true + +[dependencies.core] +version = "1.0.0" +optional = true +package = "rustc-std-workspace-core" + +[features] +rustc-dep-of-std = ["core", "compiler_builtins"] +[badges.travis-ci] +repository = "alexcrichton/cfg-if" diff --git a/bash-5.1/vendor/cfg-if/LICENSE-APACHE b/bash-5.1/vendor/cfg-if/LICENSE-APACHE new file mode 100644 index 0000000000000000000000000000000000000000..16fe87b06e802f094b3fbb0894b137bca2b16ef1 --- /dev/null +++ b/bash-5.1/vendor/cfg-if/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/bash-5.1/vendor/cfg-if/LICENSE-MIT b/bash-5.1/vendor/cfg-if/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..39e0ed6602151f235148e6c08413aa7eda5b9038 --- /dev/null +++ b/bash-5.1/vendor/cfg-if/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2014 Alex Crichton + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/bash-5.1/vendor/cfg-if/README.md b/bash-5.1/vendor/cfg-if/README.md new file mode 100644 index 0000000000000000000000000000000000000000..50b5e3b2dc00fa2224dae2cf1a88ce61546173ff --- /dev/null +++ b/bash-5.1/vendor/cfg-if/README.md @@ -0,0 +1,47 @@ +# cfg-if + +[Documentation](https://docs.rs/cfg-if) + +A macro to ergonomically define an item depending on a large number of #[cfg] +parameters. Structured like an if-else chain, the first matching branch is the +item that gets emitted. + +```toml +[dependencies] +cfg-if = "0.1" +``` + +## Example + +```rust +cfg_if::cfg_if! { + if #[cfg(unix)] { + fn foo() { /* unix specific functionality */ } + } else if #[cfg(target_pointer_width = "32")] { + fn foo() { /* non-unix, 32-bit functionality */ } + } else { + fn foo() { /* fallback implementation */ } + } +} + +fn main() { + foo(); +} +``` + +# License + +This project is licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in `cfg-if` by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. diff --git a/bash-5.1/vendor/cfg-if/src/lib.rs b/bash-5.1/vendor/cfg-if/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..52bbbe0f375c75acd7d73724cac500a7f5c32106 --- /dev/null +++ b/bash-5.1/vendor/cfg-if/src/lib.rs @@ -0,0 +1,176 @@ +//! A macro for defining `#[cfg]` if-else statements. +//! +//! The macro provided by this crate, `cfg_if`, is similar to the `if/elif` C +//! preprocessor macro by allowing definition of a cascade of `#[cfg]` cases, +//! emitting the implementation which matches first. +//! +//! This allows you to conveniently provide a long list `#[cfg]`'d blocks of code +//! without having to rewrite each clause multiple times. +//! +//! # Example +//! +//! ``` +//! cfg_if::cfg_if! { +//! if #[cfg(unix)] { +//! fn foo() { /* unix specific functionality */ } +//! } else if #[cfg(target_pointer_width = "32")] { +//! fn foo() { /* non-unix, 32-bit functionality */ } +//! } else { +//! fn foo() { /* fallback implementation */ } +//! } +//! } +//! +//! # fn main() {} +//! ``` + +#![no_std] +#![doc(html_root_url = "https://docs.rs/cfg-if")] +#![deny(missing_docs)] +#![cfg_attr(test, deny(warnings))] + +/// The main macro provided by this crate. See crate documentation for more +/// information. +#[macro_export] +macro_rules! cfg_if { + // match if/else chains with a final `else` + ($( + if #[cfg($meta:meta)] { $($tokens:tt)* } + ) else * else { + $($tokens2:tt)* + }) => { + $crate::cfg_if! { + @__items + () ; + $( ( ($meta) ($($tokens)*) ), )* + ( () ($($tokens2)*) ), + } + }; + + // match if/else chains lacking a final `else` + ( + if #[cfg($i_met:meta)] { $($i_tokens:tt)* } + $( + else if #[cfg($e_met:meta)] { $($e_tokens:tt)* } + )* + ) => { + $crate::cfg_if! { + @__items + () ; + ( ($i_met) ($($i_tokens)*) ), + $( ( ($e_met) ($($e_tokens)*) ), )* + ( () () ), + } + }; + + // Internal and recursive macro to emit all the items + // + // Collects all the negated cfgs in a list at the beginning and after the + // semicolon is all the remaining items + (@__items ($($not:meta,)*) ; ) => {}; + (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($tokens:tt)*) ), $($rest:tt)*) => { + // Emit all items within one block, applying an appropriate #[cfg]. The + // #[cfg] will require all `$m` matchers specified and must also negate + // all previous matchers. + #[cfg(all($($m,)* not(any($($not),*))))] $crate::cfg_if! { @__identity $($tokens)* } + + // Recurse to emit all other items in `$rest`, and when we do so add all + // our `$m` matchers to the list of `$not` matchers as future emissions + // will have to negate everything we just matched as well. + $crate::cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* } + }; + + // Internal macro to make __apply work out right for different match types, + // because of how macros matching/expand stuff. + (@__identity $($tokens:tt)*) => { + $($tokens)* + }; +} + +#[cfg(test)] +mod tests { + cfg_if! { + if #[cfg(test)] { + use core::option::Option as Option2; + fn works1() -> Option2 { Some(1) } + } else { + fn works1() -> Option { None } + } + } + + cfg_if! { + if #[cfg(foo)] { + fn works2() -> bool { false } + } else if #[cfg(test)] { + fn works2() -> bool { true } + } else { + fn works2() -> bool { false } + } + } + + cfg_if! { + if #[cfg(foo)] { + fn works3() -> bool { false } + } else { + fn works3() -> bool { true } + } + } + + cfg_if! { + if #[cfg(test)] { + use core::option::Option as Option3; + fn works4() -> Option3 { Some(1) } + } + } + + cfg_if! { + if #[cfg(foo)] { + fn works5() -> bool { false } + } else if #[cfg(test)] { + fn works5() -> bool { true } + } + } + + #[test] + fn it_works() { + assert!(works1().is_some()); + assert!(works2()); + assert!(works3()); + assert!(works4().is_some()); + assert!(works5()); + } + + #[test] + #[allow(clippy::assertions_on_constants)] + fn test_usage_within_a_function() { + cfg_if! {if #[cfg(debug_assertions)] { + // we want to put more than one thing here to make sure that they + // all get configured properly. + assert!(cfg!(debug_assertions)); + assert_eq!(4, 2+2); + } else { + assert!(works1().is_some()); + assert_eq!(10, 5+5); + }} + } + + trait Trait { + fn blah(&self); + } + + #[allow(dead_code)] + struct Struct; + + impl Trait for Struct { + cfg_if! { + if #[cfg(feature = "blah")] { + fn blah(&self) { + unimplemented!(); + } + } else { + fn blah(&self) { + unimplemented!(); + } + } + } + } +} diff --git a/bash-5.1/vendor/cfg-if/tests/xcrate.rs b/bash-5.1/vendor/cfg-if/tests/xcrate.rs new file mode 100644 index 0000000000000000000000000000000000000000..e7b4a362adf91e7bc6faa8887ba4474637fc4e8f --- /dev/null +++ b/bash-5.1/vendor/cfg-if/tests/xcrate.rs @@ -0,0 +1,14 @@ +cfg_if::cfg_if! { + if #[cfg(foo)] { + fn works() -> bool { false } + } else if #[cfg(test)] { + fn works() -> bool { true } + } else { + fn works() -> bool { false } + } +} + +#[test] +fn smoke() { + assert!(works()); +} diff --git a/bash-5.1/vendor/lazy_static/.cargo-checksum.json b/bash-5.1/vendor/lazy_static/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..fa241ed8f5db242baf3cd2e26539f7b9a6852fe3 --- /dev/null +++ b/bash-5.1/vendor/lazy_static/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"05e37a4e63dc4a495998bb5133252a51d671c4e99061a6342089ed6eab43978a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0621878e61f0d0fda054bcbe02df75192c28bde1ecc8289cbd86aeba2dd72720","README.md":"e2effacb5bbd7c01523f9a9e4a6a59c0f9b8698753b210fec5742408498197df","src/core_lazy.rs":"6b9fb6a4f553058e240756125b6b9ca43a83ed1fb72964343038ea0ea2e1af10","src/inline_lazy.rs":"f6184afbca4b477616f270790edc180263be806aa92ef0a9de681b4aac9e88c4","src/lib.rs":"99096a5d3089c0d86646f0805d1455befe2cb09683704af29c5c9d99ecab2683","tests/no_std.rs":"d68b149ee51ef5ae2b2906c0c94f5a9812d3b02811b13365c5a35e2ef90d25cf","tests/test.rs":"b3f7d805375dc5af7a2aa4b869944ad2ab4fc982b35ad718ea58f6914dc0a698"},"package":"e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"} \ No newline at end of file diff --git a/bash-5.1/vendor/lazy_static/Cargo.toml b/bash-5.1/vendor/lazy_static/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..7f930c5e3d62af11f50b7087a3e53e04191aec69 --- /dev/null +++ b/bash-5.1/vendor/lazy_static/Cargo.toml @@ -0,0 +1,46 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +name = "lazy_static" +version = "1.4.0" +authors = ["Marvin Löbel "] +exclude = ["/.travis.yml", "/appveyor.yml"] +description = "A macro for declaring lazily evaluated statics in Rust." +documentation = "https://docs.rs/lazy_static" +readme = "README.md" +keywords = ["macro", "lazy", "static"] +categories = ["no-std", "rust-patterns", "memory-management"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-lang-nursery/lazy-static.rs" +[dependencies.spin] +version = "0.5.0" +optional = true +[dev-dependencies.doc-comment] +version = "0.3.1" + +[features] +spin_no_std = ["spin"] +[badges.appveyor] +repository = "rust-lang-nursery/lazy-static.rs" + +[badges.is-it-maintained-issue-resolution] +repository = "rust-lang-nursery/lazy-static.rs" + +[badges.is-it-maintained-open-issues] +repository = "rust-lang-nursery/lazy-static.rs" + +[badges.maintenance] +status = "passively-maintained" + +[badges.travis-ci] +repository = "rust-lang-nursery/lazy-static.rs" diff --git a/bash-5.1/vendor/lazy_static/LICENSE-APACHE b/bash-5.1/vendor/lazy_static/LICENSE-APACHE new file mode 100644 index 0000000000000000000000000000000000000000..16fe87b06e802f094b3fbb0894b137bca2b16ef1 --- /dev/null +++ b/bash-5.1/vendor/lazy_static/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/bash-5.1/vendor/lazy_static/LICENSE-MIT b/bash-5.1/vendor/lazy_static/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..25597d5838fa4cd7ff5c3c2bb1d1b4c3731eda7f --- /dev/null +++ b/bash-5.1/vendor/lazy_static/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2010 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/bash-5.1/vendor/lazy_static/README.md b/bash-5.1/vendor/lazy_static/README.md new file mode 100644 index 0000000000000000000000000000000000000000..aa9f8283243d4ba8970bfedeaa4bcb663ae71212 --- /dev/null +++ b/bash-5.1/vendor/lazy_static/README.md @@ -0,0 +1,79 @@ +lazy-static.rs +============== + +A macro for declaring lazily evaluated statics in Rust. + +Using this macro, it is possible to have `static`s that require code to be +executed at runtime in order to be initialized. +This includes anything requiring heap allocations, like vectors or hash maps, +as well as anything that requires non-const function calls to be computed. + +[![Travis-CI Status](https://travis-ci.com/rust-lang-nursery/lazy-static.rs.svg?branch=master)](https://travis-ci.com/rust-lang-nursery/lazy-static.rs) +[![Latest version](https://img.shields.io/crates/v/lazy_static.svg)](https://crates.io/crates/lazy_static) +[![Documentation](https://docs.rs/lazy_static/badge.svg)](https://docs.rs/lazy_static) +[![License](https://img.shields.io/crates/l/lazy_static.svg)](https://github.com/rust-lang-nursery/lazy-static.rs#license) + +## Minimum supported `rustc` + +`1.27.2+` + +This version is explicitly tested in CI and may only be bumped in new minor versions. Any changes to the supported minimum version will be called out in the release notes. + + +# Getting Started + +[lazy-static.rs is available on crates.io](https://crates.io/crates/lazy_static). +It is recommended to look there for the newest released version, as well as links to the newest builds of the docs. + +At the point of the last update of this README, the latest published version could be used like this: + +Add the following dependency to your Cargo manifest... + +```toml +[dependencies] +lazy_static = "1.4.0" +``` + +...and see the [docs](https://docs.rs/lazy_static) for how to use it. + +# Example + +```rust +#[macro_use] +extern crate lazy_static; + +use std::collections::HashMap; + +lazy_static! { + static ref HASHMAP: HashMap = { + let mut m = HashMap::new(); + m.insert(0, "foo"); + m.insert(1, "bar"); + m.insert(2, "baz"); + m + }; +} + +fn main() { + // First access to `HASHMAP` initializes it + println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap()); + + // Any further access to `HASHMAP` just returns the computed value + println!("The entry for `1` is \"{}\".", HASHMAP.get(&1).unwrap()); +} +``` + +## License + +Licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any +additional terms or conditions. diff --git a/bash-5.1/vendor/lazy_static/src/core_lazy.rs b/bash-5.1/vendor/lazy_static/src/core_lazy.rs new file mode 100644 index 0000000000000000000000000000000000000000..b66c3e0d0216f0d9ca37d4f4fe7133ae8bd112ec --- /dev/null +++ b/bash-5.1/vendor/lazy_static/src/core_lazy.rs @@ -0,0 +1,31 @@ +// Copyright 2016 lazy-static.rs Developers +// +// Licensed under the Apache License, Version 2.0, or the MIT license , at your option. This file may not be +// copied, modified, or distributed except according to those terms. + +extern crate spin; + +use self::spin::Once; + +pub struct Lazy(Once); + +impl Lazy { + pub const INIT: Self = Lazy(Once::INIT); + + #[inline(always)] + pub fn get(&'static self, builder: F) -> &T + where F: FnOnce() -> T + { + self.0.call_once(builder) + } +} + +#[macro_export] +#[doc(hidden)] +macro_rules! __lazy_static_create { + ($NAME:ident, $T:ty) => { + static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::INIT; + } +} diff --git a/bash-5.1/vendor/lazy_static/src/inline_lazy.rs b/bash-5.1/vendor/lazy_static/src/inline_lazy.rs new file mode 100644 index 0000000000000000000000000000000000000000..219ce9c60cb4bbcb7d7b2dfa30e379b8a7e9c49e --- /dev/null +++ b/bash-5.1/vendor/lazy_static/src/inline_lazy.rs @@ -0,0 +1,57 @@ +// Copyright 2016 lazy-static.rs Developers +// +// Licensed under the Apache License, Version 2.0, or the MIT license , at your option. This file may not be +// copied, modified, or distributed except according to those terms. + +extern crate core; +extern crate std; + +use self::std::prelude::v1::*; +use self::std::cell::Cell; +use self::std::hint::unreachable_unchecked; +use self::std::sync::Once; +#[allow(deprecated)] +pub use self::std::sync::ONCE_INIT; + +// FIXME: Replace Option with MaybeUninit (stable since 1.36.0) +pub struct Lazy(Cell>, Once); + +impl Lazy { + #[allow(deprecated)] + pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT); + + #[inline(always)] + pub fn get(&'static self, f: F) -> &T + where + F: FnOnce() -> T, + { + self.1.call_once(|| { + self.0.set(Some(f())); + }); + + // `self.0` is guaranteed to be `Some` by this point + // The `Once` will catch and propagate panics + unsafe { + match *self.0.as_ptr() { + Some(ref x) => x, + None => { + debug_assert!(false, "attempted to derefence an uninitialized lazy static. This is a bug"); + + unreachable_unchecked() + }, + } + } + } +} + +unsafe impl Sync for Lazy {} + +#[macro_export] +#[doc(hidden)] +macro_rules! __lazy_static_create { + ($NAME:ident, $T:ty) => { + static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::INIT; + }; +} diff --git a/bash-5.1/vendor/lazy_static/src/lib.rs b/bash-5.1/vendor/lazy_static/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..cada0dc6819b2d8aed32e0ffebc5f54ec7030aba --- /dev/null +++ b/bash-5.1/vendor/lazy_static/src/lib.rs @@ -0,0 +1,215 @@ +// Copyright 2016 lazy-static.rs Developers +// +// Licensed under the Apache License, Version 2.0, or the MIT license , at your option. This file may not be +// copied, modified, or distributed except according to those terms. + +/*! +A macro for declaring lazily evaluated statics. + +Using this macro, it is possible to have `static`s that require code to be +executed at runtime in order to be initialized. +This includes anything requiring heap allocations, like vectors or hash maps, +as well as anything that requires function calls to be computed. + +# Syntax + +```ignore +lazy_static! { + [pub] static ref NAME_1: TYPE_1 = EXPR_1; + [pub] static ref NAME_2: TYPE_2 = EXPR_2; + ... + [pub] static ref NAME_N: TYPE_N = EXPR_N; +} +``` + +Attributes (including doc comments) are supported as well: + +```rust +# #[macro_use] +# extern crate lazy_static; +# fn main() { +lazy_static! { + /// This is an example for using doc comment attributes + static ref EXAMPLE: u8 = 42; +} +# } +``` + +# Semantics + +For a given `static ref NAME: TYPE = EXPR;`, the macro generates a unique type that +implements `Deref` and stores it in a static with name `NAME`. (Attributes end up +attaching to this type.) + +On first deref, `EXPR` gets evaluated and stored internally, such that all further derefs +can return a reference to the same object. Note that this can lead to deadlocks +if you have multiple lazy statics that depend on each other in their initialization. + +Apart from the lazy initialization, the resulting "static ref" variables +have generally the same properties as regular "static" variables: + +- Any type in them needs to fulfill the `Sync` trait. +- If the type has a destructor, then it will not run when the process exits. + +# Example + +Using the macro: + +```rust +#[macro_use] +extern crate lazy_static; + +use std::collections::HashMap; + +lazy_static! { + static ref HASHMAP: HashMap = { + let mut m = HashMap::new(); + m.insert(0, "foo"); + m.insert(1, "bar"); + m.insert(2, "baz"); + m + }; + static ref COUNT: usize = HASHMAP.len(); + static ref NUMBER: u32 = times_two(21); +} + +fn times_two(n: u32) -> u32 { n * 2 } + +fn main() { + println!("The map has {} entries.", *COUNT); + println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap()); + println!("A expensive calculation on a static results in: {}.", *NUMBER); +} +``` + +# Implementation details + +The `Deref` implementation uses a hidden static variable that is guarded by an atomic check on each access. + +# Cargo features + +This crate provides one cargo feature: + +- `spin_no_std`: This allows using this crate in a no-std environment, by depending on the standalone `spin` crate. + +*/ + +#![doc(html_root_url = "https://docs.rs/lazy_static/1.4.0")] +#![no_std] + +#[cfg(not(feature = "spin_no_std"))] +#[path="inline_lazy.rs"] +#[doc(hidden)] +pub mod lazy; + +#[cfg(test)] +#[macro_use] +extern crate doc_comment; + +#[cfg(test)] +doctest!("../README.md"); + +#[cfg(feature = "spin_no_std")] +#[path="core_lazy.rs"] +#[doc(hidden)] +pub mod lazy; + +#[doc(hidden)] +pub use core::ops::Deref as __Deref; + +#[macro_export(local_inner_macros)] +#[doc(hidden)] +macro_rules! __lazy_static_internal { + // optional visibility restrictions are wrapped in `()` to allow for + // explicitly passing otherwise implicit information about private items + ($(#[$attr:meta])* ($($vis:tt)*) static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => { + __lazy_static_internal!(@MAKE TY, $(#[$attr])*, ($($vis)*), $N); + __lazy_static_internal!(@TAIL, $N : $T = $e); + lazy_static!($($t)*); + }; + (@TAIL, $N:ident : $T:ty = $e:expr) => { + impl $crate::__Deref for $N { + type Target = $T; + fn deref(&self) -> &$T { + #[inline(always)] + fn __static_ref_initialize() -> $T { $e } + + #[inline(always)] + fn __stability() -> &'static $T { + __lazy_static_create!(LAZY, $T); + LAZY.get(__static_ref_initialize) + } + __stability() + } + } + impl $crate::LazyStatic for $N { + fn initialize(lazy: &Self) { + let _ = &**lazy; + } + } + }; + // `vis` is wrapped in `()` to prevent parsing ambiguity + (@MAKE TY, $(#[$attr:meta])*, ($($vis:tt)*), $N:ident) => { + #[allow(missing_copy_implementations)] + #[allow(non_camel_case_types)] + #[allow(dead_code)] + $(#[$attr])* + $($vis)* struct $N {__private_field: ()} + #[doc(hidden)] + $($vis)* static $N: $N = $N {__private_field: ()}; + }; + () => () +} + +#[macro_export(local_inner_macros)] +macro_rules! lazy_static { + ($(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => { + // use `()` to explicitly forward the information about private items + __lazy_static_internal!($(#[$attr])* () static ref $N : $T = $e; $($t)*); + }; + ($(#[$attr:meta])* pub static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => { + __lazy_static_internal!($(#[$attr])* (pub) static ref $N : $T = $e; $($t)*); + }; + ($(#[$attr:meta])* pub ($($vis:tt)+) static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => { + __lazy_static_internal!($(#[$attr])* (pub ($($vis)+)) static ref $N : $T = $e; $($t)*); + }; + () => () +} + +/// Support trait for enabling a few common operation on lazy static values. +/// +/// This is implemented by each defined lazy static, and +/// used by the free functions in this crate. +pub trait LazyStatic { + #[doc(hidden)] + fn initialize(lazy: &Self); +} + +/// Takes a shared reference to a lazy static and initializes +/// it if it has not been already. +/// +/// This can be used to control the initialization point of a lazy static. +/// +/// Example: +/// +/// ```rust +/// #[macro_use] +/// extern crate lazy_static; +/// +/// lazy_static! { +/// static ref BUFFER: Vec = (0..255).collect(); +/// } +/// +/// fn main() { +/// lazy_static::initialize(&BUFFER); +/// +/// // ... +/// work_with_initialized_data(&BUFFER); +/// } +/// # fn work_with_initialized_data(_: &[u8]) {} +/// ``` +pub fn initialize(lazy: &T) { + LazyStatic::initialize(lazy); +} diff --git a/bash-5.1/vendor/lazy_static/tests/no_std.rs b/bash-5.1/vendor/lazy_static/tests/no_std.rs new file mode 100644 index 0000000000000000000000000000000000000000..f94a1aaa6dc081b242088a59feaceefa0c3ca0ae --- /dev/null +++ b/bash-5.1/vendor/lazy_static/tests/no_std.rs @@ -0,0 +1,20 @@ +#![cfg(feature="spin_no_std")] + +#![no_std] + +#[macro_use] +extern crate lazy_static; + +lazy_static! { + /// Documentation! + pub static ref NUMBER: u32 = times_two(3); +} + +fn times_two(n: u32) -> u32 { + n * 2 +} + +#[test] +fn test_basic() { + assert_eq!(*NUMBER, 6); +} diff --git a/bash-5.1/vendor/lazy_static/tests/test.rs b/bash-5.1/vendor/lazy_static/tests/test.rs new file mode 100644 index 0000000000000000000000000000000000000000..03d0ab683a00bff675245c8f05aa0bad44edc10a --- /dev/null +++ b/bash-5.1/vendor/lazy_static/tests/test.rs @@ -0,0 +1,164 @@ +#[macro_use] +extern crate lazy_static; +use std::collections::HashMap; + +lazy_static! { + /// Documentation! + pub static ref NUMBER: u32 = times_two(3); + + static ref ARRAY_BOXES: [Box; 3] = [Box::new(1), Box::new(2), Box::new(3)]; + + /// More documentation! + #[allow(unused_variables)] + #[derive(Copy, Clone, Debug)] + pub static ref STRING: String = "hello".to_string(); + + static ref HASHMAP: HashMap = { + let mut m = HashMap::new(); + m.insert(0, "abc"); + m.insert(1, "def"); + m.insert(2, "ghi"); + m + }; + + // This should not compile if the unsafe is removed. + static ref UNSAFE: u32 = unsafe { + std::mem::transmute::(-1) + }; +} + +lazy_static! { + static ref S1: &'static str = "a"; + static ref S2: &'static str = "b"; +} +lazy_static! { + static ref S3: String = [*S1, *S2].join(""); +} + +#[test] +fn s3() { + assert_eq!(&*S3, "ab"); +} + +fn times_two(n: u32) -> u32 { + n * 2 +} + +#[test] +fn test_basic() { + assert_eq!(&**STRING, "hello"); + assert_eq!(*NUMBER, 6); + assert!(HASHMAP.get(&1).is_some()); + assert!(HASHMAP.get(&3).is_none()); + assert_eq!(&*ARRAY_BOXES, &[Box::new(1), Box::new(2), Box::new(3)]); + assert_eq!(*UNSAFE, std::u32::MAX); +} + +#[test] +fn test_repeat() { + assert_eq!(*NUMBER, 6); + assert_eq!(*NUMBER, 6); + assert_eq!(*NUMBER, 6); +} + +#[test] +fn test_meta() { + // this would not compile if STRING were not marked #[derive(Copy, Clone)] + let copy_of_string = STRING; + // just to make sure it was copied + assert!(&STRING as *const _ != ©_of_string as *const _); + + // this would not compile if STRING were not marked #[derive(Debug)] + assert_eq!(format!("{:?}", STRING), "STRING { __private_field: () }".to_string()); +} + +mod visibility { + lazy_static! { + pub static ref FOO: Box = Box::new(0); + static ref BAR: Box = Box::new(98); + } + + pub mod inner { + lazy_static! { + pub(in visibility) static ref BAZ: Box = Box::new(42); + pub(crate) static ref BAG: Box = Box::new(37); + } + } + + #[test] + fn sub_test() { + assert_eq!(**FOO, 0); + assert_eq!(**BAR, 98); + assert_eq!(**inner::BAZ, 42); + assert_eq!(**inner::BAG, 37); + } +} + +#[test] +fn test_visibility() { + assert_eq!(*visibility::FOO, Box::new(0)); + assert_eq!(*visibility::inner::BAG, Box::new(37)); +} + +// This should not cause a warning about a missing Copy implementation +lazy_static! { + pub static ref VAR: i32 = { 0 }; +} + +#[derive(Copy, Clone, Debug, PartialEq)] +struct X; +struct Once(X); +const ONCE_INIT: Once = Once(X); +static DATA: X = X; +static ONCE: X = X; +fn require_sync() -> X { X } +fn transmute() -> X { X } +fn __static_ref_initialize() -> X { X } +fn test(_: Vec) -> X { X } + +// All these names should not be shadowed +lazy_static! { + static ref ITEM_NAME_TEST: X = { + test(vec![X, Once(X).0, ONCE_INIT.0, DATA, ONCE, + require_sync(), transmute(), + // Except this, which will sadly be shadowed by internals: + // __static_ref_initialize() + ]) + }; +} + +#[test] +fn item_name_shadowing() { + assert_eq!(*ITEM_NAME_TEST, X); +} + +use std::sync::atomic::AtomicBool; +#[allow(deprecated)] +use std::sync::atomic::ATOMIC_BOOL_INIT; +use std::sync::atomic::Ordering::SeqCst; + +#[allow(deprecated)] +static PRE_INIT_FLAG: AtomicBool = ATOMIC_BOOL_INIT; + +lazy_static! { + static ref PRE_INIT: () = { + PRE_INIT_FLAG.store(true, SeqCst); + () + }; +} + +#[test] +fn pre_init() { + assert_eq!(PRE_INIT_FLAG.load(SeqCst), false); + lazy_static::initialize(&PRE_INIT); + assert_eq!(PRE_INIT_FLAG.load(SeqCst), true); +} + +lazy_static! { + static ref LIFETIME_NAME: for<'a> fn(&'a u8) = { fn f(_: &u8) {} f }; +} + +#[test] +fn lifetime_name() { + let _ = LIFETIME_NAME; +} diff --git a/bash-5.1/vendor/libc/.cargo-checksum.json b/bash-5.1/vendor/libc/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..f16c56427587e7d18b473f77c92fbd647b0aae4f --- /dev/null +++ b/bash-5.1/vendor/libc/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CONTRIBUTING.md":"f480d10d2a506eecd23ae2e2dedb7a28b8bf6dae5f46f438dbb61be2003426fb","Cargo.toml":"1549dc2db0ecd74316f52b2d14b15144ae970a848bf3d54c048844ed7a35df2a","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"a8d47ff51ca256f56a8932dba07660672dbfe3004257ca8de708aac1415937a1","README.md":"776affa26b66843a2b4f1a1c8f88d92f6461b74568911450fea717e9db6f877b","build.rs":"1d0cbe878e98e970c3318cac0772215a9f44bd286d859d665da27872ba9d8818","rustfmt.toml":"eaa2ea84fc1ba0359b77680804903e07bb38d257ab11986b95b158e460f787b2","src/fixed_width_ints.rs":"7f986e5f5e68d25ef04d386fd2f640e8be8f15427a8d4a458ea01d26b8dca0ca","src/fuchsia/aarch64.rs":"378776a9e40766154a54c94c2a7b4675b5c302a38e6e42da99e67bfbaee60e56","src/fuchsia/align.rs":"ae1cf8f011a99737eabeb14ffff768e60f13b13363d7646744dbb0f443dab3d6","src/fuchsia/mod.rs":"94cbaad15021e287a1b9546a697b04c1e560f1204b52204ffaaea5975c5d03b9","src/fuchsia/no_align.rs":"303f3f1b255e0088b5715094353cf00476131d8e94e6aebb3f469557771c8b8a","src/fuchsia/x86_64.rs":"93a3632b5cf67d2a6bcb7dc0a558605252d5fe689e0f38d8aa2ec5852255ac87","src/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/hermit/mod.rs":"d3bfce41e4463d4be8020a2d063c9bfa8b665f45f1cc6cbf3163f5d01e7cb21f","src/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/lib.rs":"ce753ef318b300bbd441feabdd77d00322dfb6ce9eee8c78a38afe02b57aa4c0","src/macros.rs":"b457eb028b8e8ab3c24bb7292b874ad4e491edbb83594f6a3da024df5348c088","src/psp.rs":"dd31aabd46171d474ec5828372e28588935120e7355c90c105360d8fa9264c1c","src/sgx.rs":"16a95cdefc81c5ee00d8353a60db363c4cc3e0f75abcd5d0144723f2a306ed1b","src/solid/aarch64.rs":"a726e47f324adf73a4a0b67a2c183408d0cad105ae66acf36db37a42ab7f8707","src/solid/arm.rs":"e39a4f74ebbef3b97b8c95758ad741123d84ed3eb48d9cf4f1f4872097fc27fe","src/solid/mod.rs":"5f4151dca5132e4b4e4c23ab9737e12856dddbdc0ca3f7dbc004328ef3c8acde","src/switch.rs":"9da3dd39b3de45a7928789926e8572d00e1e11a39e6f7289a1349aadce90edba","src/unix/align.rs":"2cdc7c826ef7ae61f5171c5ae8c445a743d86f1a7f2d9d7e4ceeec56d6874f65","src/unix/bsd/apple/b32/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b32/mod.rs":"2546ad3eb6aecb95f916648bc63264117c92b4b4859532b34cb011e4c75a5a72","src/unix/bsd/apple/b64/aarch64/align.rs":"e8eb38d064b5fefec6f37d42873820a0483e7c758ed336cc59a7155455ca89c9","src/unix/bsd/apple/b64/aarch64/mod.rs":"a3f0dfff62d0f7f4f1b5f9a4e2b662acf233a46badbc5419d3cc2d735629a710","src/unix/bsd/apple/b64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/mod.rs":"f5e278a1af7fb358891d1c9be4eb7e815aaca0c5cb738d0c3604ba2208a856f7","src/unix/bsd/apple/b64/x86_64/align.rs":"ec833a747866fe19ca2d9b4d3c9ff0385faba5edf4bd0d15fa68884c40b0e26c","src/unix/bsd/apple/b64/x86_64/mod.rs":"8c87c5855038aae5d433c8f5eb3b29b0a175879a0245342b3bfd83bdf4cfd936","src/unix/bsd/apple/mod.rs":"56dc7604509f49b274770cade97a1874c8955c3b0a445fb857707ae0ca6df41b","src/unix/bsd/freebsdlike/dragonfly/errno.rs":"8295b8bb0dfd38d2cdb4d9192cdeeb534cc6c3b208170e64615fa3e0edb3e578","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"d0e8246063cae113806524a63a47c6c0628cc54a3ef03e938e89964f8b4f08b4","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"2a215bd6136b8617aacedf9be738ccee94da9d29b418e9a78101d6291c182352","src/unix/bsd/freebsdlike/freebsd/arm.rs":"59d6a670eea562fb87686e243e0a84603d29a2028a3d4b3f99ccc01bd04d2f47","src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs":"9808d152c1196aa647f1b0f0cf84dac8c930da7d7f897a44975545e3d9d17681","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"a6eee615e6ca5a6e04b526bb6b22d13b9356e87e51825cda33476c37a46cb0ef","src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"755dafaf3f0945e798c34ea94c48e8552804ce60e2a15a4f0649f9d1aceaf422","src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs":"cc65a73b0fa95a77044a4b3ee76d6eceb9773b55aea7d73bdf070e6f66e9ea38","src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs":"61cbe45f8499bedb168106b686d4f8239472f25c7553b069eec2afe197ff2df6","src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs":"0ed92eb93e78299cd7de0ae9daebb04a53b3c2d5e6a078e1fcd977f2a86bffc3","src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs":"2df36a7f122f6d6e5753cfb4d22e915cc80f6bc91c0161b3daae55a481bfd052","src/unix/bsd/freebsdlike/freebsd/mod.rs":"ec229cc7af2511cb510c078e87e90ee2625090bfe94f40eb35f73d79143533aa","src/unix/bsd/freebsdlike/freebsd/powerpc.rs":"9ca3f82f88974e6db5569f2d76a5a3749b248a31747a6c0da5820492bdfeca42","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"2dae3ecc87eac3b11657aa98915def55fc4b5c0de11fe26aae23329a54628a9a","src/unix/bsd/freebsdlike/freebsd/riscv64.rs":"8f591bd273464d684c4f64365f8ed56a8138175daa70d96008541393057a0dae","src/unix/bsd/freebsdlike/freebsd/x86.rs":"c5005e3249eb7c93cfbac72a9e9272320d80ce7983da990ceb05a447f59a02c5","src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs":"0e1f69a88fca1c32874b1daf5db3d446fefbe518dca497f096cc9168c39dde70","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"51e4dd0c8ae247bb652feda5adad9333ea3bb30c750c3a3935e0b0e47d7803eb","src/unix/bsd/freebsdlike/mod.rs":"1e35b4773384ea143810cdce4b96f47108b37446430da30c96a0d1651656d73d","src/unix/bsd/mod.rs":"817ca5719c36a74c84e52c6a56a5998b60d7f02351a405e034f08ebab079b63a","src/unix/bsd/netbsdlike/mod.rs":"b07a0e81085bd811fce7270f3b90fbfea29faf9593d9e39d9d2ebbb9a78bf25f","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"65dcb58d11e8d8028401a9d07ca3eb4cb4f053e04249cc877353449d84ccc4cb","src/unix/bsd/netbsdlike/netbsd/arm.rs":"58cdbb70b0d6f536551f0f3bb3725d2d75c4690db12c26c034e7d6ec4a924452","src/unix/bsd/netbsdlike/netbsd/mod.rs":"8f9613e50c2771b33d7cf817a735d536b389ec57f861b9486d870373c768276e","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"ee7ff5d89d0ed22f531237b5059aa669df93a3b5c489fa641465ace8d405bf41","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"9489f4b3e4566f43bb12dfb92238960613dac7f6a45cc13068a8d152b902d7d9","src/unix/bsd/netbsdlike/netbsd/x86.rs":"20692320e36bfe028d1a34d16fe12ca77aa909cb02bda167376f98f1a09aefe7","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"1afe5ef46b14397cdd68664b5b232e4f5b035b6db1d4cf411c899d51ebca9f30","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"dd91931d373b7ecaf6e2de25adadee10d16fa9b12c2cbacdff3eb291e1ba36af","src/unix/bsd/netbsdlike/openbsd/arm.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/mips64.rs":"8532a189ae10c7d668d9d4065da8b05d124e09bd39442c9f74a7f231c43eca48","src/unix/bsd/netbsdlike/openbsd/mod.rs":"228505fa48292e74b06acbed96196801595a4b822da2126a6d6c7fa773cff8bc","src/unix/bsd/netbsdlike/openbsd/powerpc.rs":"01580d261bc6447bb327a0d982181b7bdabfa066cee65a30373d3ced729ad307","src/unix/bsd/netbsdlike/openbsd/powerpc64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/riscv64.rs":"1dd5449dd1fd3d51e30ffdeeaece91d0aaf05c710e0ac699fecc5461cfa2c28e","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"d04fd287afbaa2c5df9d48c94e8374a532a3ba491b424ddf018270c7312f4085","src/unix/bsd/netbsdlike/openbsd/x86.rs":"6f7f5c4fde2a2259eb547890cbd86570cea04ef85347d7569e94e679448bec87","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"d31db31630289c85af3339dbe357998a21ca584cbae31607448fe2cf7675a4e1","src/unix/haiku/b32.rs":"a2efdbf7158a6da341e1db9176b0ab193ba88b449616239ed95dced11f54d87b","src/unix/haiku/b64.rs":"ff8115367d3d7d354f792d6176dfaaa26353f57056197b563bf4681f91ff7985","src/unix/haiku/mod.rs":"df7b6b7d8dd3441665bfe87f2abc942bddc65b8b10dfa9c83dd0422f68107891","src/unix/haiku/native.rs":"dbfcbf4954a79d1df2ff58e0590bbcb8c57dfc7a32392aa73ee4726b66bd6cc8","src/unix/haiku/x86_64.rs":"3ec3aeeb7ed208b8916f3e32d42bfd085ff5e16936a1a35d9a52789f043b7237","src/unix/hermit/aarch64.rs":"86048676e335944c37a63d0083d0f368ae10ceccefeed9debb3bbe08777fc682","src/unix/hermit/mod.rs":"859814f5df89e28fd4b345db399d181e11e7ed413841b6ff703a1fcbdbf013ae","src/unix/hermit/x86_64.rs":"ab832b7524e5fb15c49ff7431165ab1a37dc4667ae0b58e8306f4c539bfa110c","src/unix/linux_like/android/b32/arm.rs":"433c1530f602cc5ed26610c58055dde0c4ceea5e00150063b24ddc60768332a4","src/unix/linux_like/android/b32/mod.rs":"7c173e0375119bf06a3081652faede95e5bcd6858e7576b7533d037978737c8f","src/unix/linux_like/android/b32/x86/align.rs":"812914e4241df82e32b12375ca3374615dc3a4bdd4cf31f0423c5815320c0dab","src/unix/linux_like/android/b32/x86/mod.rs":"8388bd3a0fcb5636bf965eee6dc95ae6860b85a2b555b387c868aa4d4e01ec89","src/unix/linux_like/android/b64/aarch64/align.rs":"2179c3b1608fa4bf68840482bfc2b2fa3ee2faf6fcae3770f9e505cddca35c7b","src/unix/linux_like/android/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/android/b64/aarch64/mod.rs":"ef230d49fd0d182adf2dae6f8e10babf18d72259d65980bf1c4c2dc8a4f84501","src/unix/linux_like/android/b64/mod.rs":"71e4fcbe952bfa4a5f9022f3972e906917b38f729b9d8ef57cd5d179104894ac","src/unix/linux_like/android/b64/riscv64/align.rs":"0bf138f84e5327d8339bcd4adf071a6832b516445e597552c82bbd881095e3a8","src/unix/linux_like/android/b64/riscv64/mod.rs":"80e9f93fed838a48b4e2e8d77b95c72cfd7c0647bcce63851555c5ad16dad143","src/unix/linux_like/android/b64/x86_64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/android/b64/x86_64/mod.rs":"e10d19bea39f719723ab6666a5ddbd378b6958769441c5904629e1df173b1dc2","src/unix/linux_like/android/mod.rs":"962741303dc24a5b9653f2e9b0b4ad9eb42fc54daa0a70ca70a7ce175e75094b","src/unix/linux_like/emscripten/align.rs":"86c95cbed7a7161b1f23ee06843e7b0e2340ad92b2cb86fe2a8ef3e0e8c36216","src/unix/linux_like/emscripten/mod.rs":"c69c90606d4362f8de89b8816df0ded724ed64b53bf55d15681fde171b7bb361","src/unix/linux_like/emscripten/no_align.rs":"0128e4aa721a9902754828b61b5ec7d8a86619983ed1e0544a85d35b1051fad6","src/unix/linux_like/linux/align.rs":"d6c259942c8e843373accd180fc8f4f45f03544dfd21b93a8d02641ead3ef63e","src/unix/linux_like/linux/arch/generic/mod.rs":"e20013ed91edcfb7f84f3f9f5a9ef827fd5c406e24b65989d8438da332236ef6","src/unix/linux_like/linux/arch/mips/mod.rs":"2d166054a586bb4bf6e4a4ba35f7574907b217225eff8f1a43adc4277e142460","src/unix/linux_like/linux/arch/mod.rs":"466a29622e47c6c7f1500682b2eb17f5566dd81b322cd6348f0fdd355cec593a","src/unix/linux_like/linux/arch/powerpc/mod.rs":"3f6da7b0fa7b394c7d4eea2bb3caa7a7729ab0d6c1491fef02206a912c41b815","src/unix/linux_like/linux/arch/sparc/mod.rs":"91593ec0440f1dd8f8e612028f432c44c14089286e2aca50e10511ab942db8c3","src/unix/linux_like/linux/gnu/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/gnu/b32/arm/align.rs":"6ec0eb3ee93f7ae99fd714b4deabfb5e97fbcefd8c26f5a45fb8e7150899cdeb","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"92ea7edc0e24f79dfbf5e3efc2d7509bed230562036e6aa85ef4f2c8088ecc8f","src/unix/linux_like/linux/gnu/b32/m68k/align.rs":"8faa92f77a9232c035418d45331774e64a9a841d99c91791570a203bf2b45bcb","src/unix/linux_like/linux/gnu/b32/m68k/mod.rs":"a2a0a9400dae44086ebf579e0448e0676d4a3214d1ae7d13a024857251e23b6b","src/unix/linux_like/linux/gnu/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"0d7849eb2435ec1f49b6774872a0518f0129c50f37c9d38b37b1535722777a22","src/unix/linux_like/linux/gnu/b32/mod.rs":"8da281da578cdee972e952b118b903b370320897a7e335342a15e1359864bef2","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"049d6211ba4a9304bd4497c160bc21ae847c24e0528dd9d76263f16192e6aff5","src/unix/linux_like/linux/gnu/b32/riscv32/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"a4256148cec0bb672c8dfa605866930d9761af9655721de72ae41eeeb8fdbf6d","src/unix/linux_like/linux/gnu/b32/sparc/align.rs":"21adbed27df73e2d1ed934aaf733a643003d7baf2bde9c48ea440895bcca6d41","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"525618615aa0cb80c6c90860bf579dfed8db307fffd56b97dc235fb945419434","src/unix/linux_like/linux/gnu/b32/x86/align.rs":"e4bafdc4a519a7922a81b37a62bbfd1177a2f620890eef8f1fbc47162e9eb413","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"78b4038852986436888c63be9258037cf642124daee9d5fa5cef2bf8e412bf54","src/unix/linux_like/linux/gnu/b64/aarch64/align.rs":"5b32fcc0d60356c92ded4e0ba9bb32f0140a8bd75ba800486bf38294f61dbdbb","src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs":"21a21503ef2e095f4371044915d4bfb07a8578011cb5c713cd9f45947b0b5730","src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs":"e78c3cd197f44832338b414d1a9bc0d194f44c74db77bd7bf830c1fff62b2690","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"c72a08011c32f82919e930e0d89044d8feb65fd41bf80647436756c290344eb8","src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs":"387808d5398b24339e7e2bf7591150735011befc5b421fa713d7017c04a7b1da","src/unix/linux_like/linux/gnu/b64/mips64/align.rs":"7169d07a9fd4716f7512719aec9fda5d8bed306dc0720ffc1b21696c9951e3c6","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"17aad16329431d83e1909e3a08022f6e28f4bcba7dec4a967fe1a321a6a43b99","src/unix/linux_like/linux/gnu/b64/mod.rs":"3c6555f30a7a8852757b31a542ea73fb6a16a6e27e838397e819278ad56e57a4","src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"97e0ecf11ecce793a13fec39654fb513c5479edf7faa7a276fa714b61993d0fc","src/unix/linux_like/linux/gnu/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"b3fe290afe63d2d6e315d0cf1f775464e9c1f2a1906d243c1af74a137a4031cb","src/unix/linux_like/linux/gnu/b64/s390x.rs":"254f00266ecf9644a4b469457cb37c4dd6c055820926c1de0fb9035b6048e75c","src/unix/linux_like/linux/gnu/b64/sparc64/align.rs":"e29c4868bbecfa4a6cd8a2ad06193f3bbc78a468cc1dc9df83f002f1268130d9","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"87dd7f3d5bf3c09f4064ec738e306cc9cc41ad49b4a5df62c5983301c3bbf99a","src/unix/linux_like/linux/gnu/b64/x86_64/align.rs":"62e822478356db4a73b6bbd1b36d825b893939ab4b308ec11b0578bcc4b49769","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"f0db9914315d5a3d51bf5ec04a0ae6584f2e1688b9258ce132b617e67d9bd7a9","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"b88ef8a1eaa9ed73bf2acb8192afb73af987a92abb94140c6376fc83f2fa5553","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"79305936a60d342efdc10519ba89507d6b48e65f13f33090d3b04dc9655ceed0","src/unix/linux_like/linux/gnu/mod.rs":"fd62b48974dd2f97f6e8fa2a30624e8d69fdedc5d3b0ab2f3f09516e88a8769a","src/unix/linux_like/linux/gnu/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/mod.rs":"af94b1a6d844bed87bb4c93de0a12f160ca1f918f5234d7fe17511d4e424dedc","src/unix/linux_like/linux/musl/b32/arm/align.rs":"3e8ac052c1043764776b54c93ba4260e061df998631737a897d9d47d54f7b80c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"e5faee8efda8a225ea0b17d4d6f9e893a678e73773fa62c549a8e19c106b9f04","src/unix/linux_like/linux/musl/b32/hexagon.rs":"226a8b64ce9c75abbbee6d2dceb0b44f7b6c750c4102ebd4d015194afee6666e","src/unix/linux_like/linux/musl/b32/mips/align.rs":"429fb5e005cb7143602d430098b6ebfb7d360685b194f333dfd587472ae954ee","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"df8f8b529a6cc6b8a7326639e83303cf1320c6c50d76517c17d42bcf45f6240a","src/unix/linux_like/linux/musl/b32/mod.rs":"7b3d9dfd8605b00bb9b5fa1439abe5ebf60199c7fa033eee555e8d181e93ffa2","src/unix/linux_like/linux/musl/b32/powerpc.rs":"c957d99a4d4371d2411a5769be8cf344516bf9ddc1011f977501a4eb57cb4e82","src/unix/linux_like/linux/musl/b32/riscv32/align.rs":"efd2accf33b87de7c7547903359a5da896edc33cd6c719552c7474b60d4a5d48","src/unix/linux_like/linux/musl/b32/riscv32/mod.rs":"698f77bfcc838f82126c54f7387881fe3e89490117e5a4f333d1b4433823a672","src/unix/linux_like/linux/musl/b32/x86/align.rs":"08e77fbd7435d7dec2ff56932433bece3f02e47ce810f89004a275a86d39cbe1","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"199a91e90b454f9dc32770d5204cc4f6e5b8f144e0e34a1c91829949d6e804b3","src/unix/linux_like/linux/musl/b64/aarch64/align.rs":"6ba32725d24d7d8e6aa111f3b57aafa318f83b606abe96561329151829821133","src/unix/linux_like/linux/musl/b64/aarch64/int128.rs":"1735f6f5c56770d20dd426442f09724d9b2052b46a7cd82f23f3288a4a7276de","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"9c4878df0fea0e0affd85346e0bc191abdc5e41e74dc9199b5644ec33d29c300","src/unix/linux_like/linux/musl/b64/mips64.rs":"1fa4974fe412b22c3555d3e240dbf00cc04a5287c751035ddf08a0470d4a7c9a","src/unix/linux_like/linux/musl/b64/mod.rs":"8c10627bd582cb272514e7350ae4743a65d489356eae039d2e7e55cd533fbbc8","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"36694cbdcdc33879e00502d55cb95eaa0096d213538993dd39c3da800cdd06d1","src/unix/linux_like/linux/musl/b64/riscv64/align.rs":"d321491612be8d5c61b6ec2dc0111beb3a22e58803f99cd37543efe86621b119","src/unix/linux_like/linux/musl/b64/riscv64/mod.rs":"36621aca8ecf714f8dd42662dc2997833d95b9f129ef8c220503362e21efd695","src/unix/linux_like/linux/musl/b64/s390x.rs":"c7ebabc4e1bdbbd97e5065faa3a57f41f473570920582d979f9e9d4f77448546","src/unix/linux_like/linux/musl/b64/x86_64/align.rs":"77309276ad7a42cbe59ca381f23590b7a143aded05555b34a5b307b808cbca6e","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"238789097a26abc8b7cd578ed1a8e6cb8672083054303902781983902cd66854","src/unix/linux_like/linux/musl/mod.rs":"c3365480375bc258ffe267e7a299d7b3bb542a908bef8881f503ddc25ba8fc1f","src/unix/linux_like/linux/no_align.rs":"da2a8721becaaaa528781f97f5d9aae6a982ae5d4f5f6d2ffc0150bed72319b3","src/unix/linux_like/linux/non_exhaustive.rs":"181a05bf94fdb911db83ce793b993bd6548a4115b306a7ef3c10f745a8fea3e9","src/unix/linux_like/linux/uclibc/align.rs":"9ed16138d8e439bd90930845a65eafa7ebd67366e6bf633936d44014f6e4c959","src/unix/linux_like/linux/uclibc/arm/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/arm/mod.rs":"a056bbf718ddd775519058706bdb4909b56e6256985869e3c3132aa8ec5faca0","src/unix/linux_like/linux/uclibc/arm/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips32/align.rs":"e4a3c27fe20a57b8d612c34cb05bc70646edb5cec7251957315afa53a7b9f936","src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs":"b84def53a49587e87f884c2bc28b21b290463b00b52e1d0309f2ba233a5b4a99","src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs":"9cd223135de75315840ff9c3fd5441ba1cb632b96b5c85a76f8316c86653db25","src/unix/linux_like/linux/uclibc/mips/mips64/align.rs":"a7bdcb18a37a2d91e64d5fad83ea3edc78f5412adb28f77ab077dbb26dd08b2d","src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs":"256a428290a560163ef7dc7d18b27bd3c6ce9748a0f28d5dc7f82203ee228220","src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs":"4a18e3875698c85229599225ac3401a2a40da87e77b2ad4ef47c6fcd5a24ed30","src/unix/linux_like/linux/uclibc/mips/mod.rs":"367ec5483ad317e6ccba1ac0888da6cf088a8d32689214cc8d16129aa692260c","src/unix/linux_like/linux/uclibc/mod.rs":"1c3d25cddcfefa2bd17bdc81550826be31a08eef235e13f825f169a5029c8bca","src/unix/linux_like/linux/uclibc/no_align.rs":"3f28637046524618adaa1012e26cb7ffe94b9396e6b518cccdc69d59f274d709","src/unix/linux_like/linux/uclibc/x86_64/l4re.rs":"024eba5753e852dbdd212427351affe7e83f9916c1864bce414d7aa2618f192e","src/unix/linux_like/linux/uclibc/x86_64/mod.rs":"bf6985e901041a61e90ccee1296b35a4c62ef90aa528d31989e1d647f072e79a","src/unix/linux_like/linux/uclibc/x86_64/other.rs":"42c3f71e58cabba373f6a55a623f3c31b85049eb64824c09c2b082b3b2d6a0a8","src/unix/linux_like/mod.rs":"09fa012e027bfcdaabee221c1b676804a9c7e0e04a4b64fdd98a50c9b5c2f674","src/unix/mod.rs":"fbd5520d160a32a127608cd408905febe387773bbf05bfe199ef385fb5562e9c","src/unix/newlib/aarch64/mod.rs":"bac93836a9a57b2c710f32f852e92a4d11ad6759ab0fb6ad33e71d60e53278af","src/unix/newlib/align.rs":"28aaf87fafbc6b312622719d472d8cf65f9e5467d15339df5f73e66d8502b28a","src/unix/newlib/arm/mod.rs":"cbba6b3e957eceb496806e60de8725a23ff3fa0015983b4b4fa27b233732b526","src/unix/newlib/espidf/mod.rs":"816f235f4aa4baabba7f2606b31d0fdb03988c52194c966728de8690bf17299d","src/unix/newlib/generic.rs":"eab066d9f0a0f3eb53cc1073d01496bba0110989e1f6a59838afd19f870cd599","src/unix/newlib/horizon/mod.rs":"7cc5cc120437421db139bfa6a90b18168cd3070bdd0f5be96d40fe4c996f3ca1","src/unix/newlib/mod.rs":"54633d606e4e0413274af0b5beb5e697e6c061b63feaa0704b026554cc9d9c3e","src/unix/newlib/no_align.rs":"e0743b2179495a9514bc3a4d1781e492878c4ec834ee0085d0891dd1712e82fb","src/unix/newlib/powerpc/mod.rs":"0202ffd57caf75b6afa2c9717750ffb96e375ac33df0ae9609a3f831be393b67","src/unix/no_align.rs":"c06e95373b9088266e0b14bba0954eef95f93fb2b01d951855e382d22de78e53","src/unix/redox/mod.rs":"033768cb273daf2c8090d97252c2de9dba6809e6a5d2457f5727d724807695db","src/unix/solarish/compat.rs":"b07a5bfac925eb012003a459ba6bddbd3bfa9c44b3394da2ac5a602e54beae9c","src/unix/solarish/illumos.rs":"29387916ee7dc58f07478746024003215e631cd30953e8fa2a5c415f81839007","src/unix/solarish/mod.rs":"8914a68865af026c1f4fb1d5f02ba0053362ef34b813ad60cc4aa3a88aa4999e","src/unix/solarish/solaris.rs":"65b005453aefa9b9d4fc860fe77cfec80d8c97a51342b15daf55fc3e808bb384","src/unix/solarish/x86.rs":"e86e806df0caed72765040eaa2f3c883198d1aa91508540adf9b7008c77f522e","src/unix/solarish/x86_64.rs":"9074e813949f3c613afeac39d4118fb942c0b3c476232fc536489357cff5790f","src/unix/solarish/x86_common.rs":"ac869d9c3c95645c22460468391eb1982023c3a8e02b9e06a72e3aef3d5f1eac","src/vxworks/aarch64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/arm.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/mod.rs":"aea3da66f2140f2a82dfc9c58f6e6531d2dd9c15ea696e0f95a0d4a2a187b5b6","src/vxworks/powerpc.rs":"acb7968ce99fe3f4abdf39d98f8133d21a4fba435b8ef7084777cb181d788e88","src/vxworks/powerpc64.rs":"98f0afdc511cd02557e506c21fed6737585490a1dce7a9d4941d08c437762b99","src/vxworks/x86.rs":"552f007f38317620b23889cb7c49d1d115841252439060122f52f434fbc6e5ba","src/vxworks/x86_64.rs":"018d92be3ad628a129eff9f2f5dfbc0883d8b8e5f2fa917b900a7f98ed6b514a","src/wasi.rs":"4fae202af0327d768ed9e1b586b75816cce14fe2dc16947d2f3d381f209a54c1","src/windows/gnu/align.rs":"b2c13ec1b9f3b39a75c452c80c951dff9d0215e31d77e883b4502afb31794647","src/windows/gnu/mod.rs":"3c8c7edb7cdf5d0c44af936db2a94869585c69dfabeef30571b4f4e38375767a","src/windows/mod.rs":"090dd8fcd951d18f1905bca96188783c2e3f1433484926ecdcda144237ecec0f","src/windows/msvc/mod.rs":"c068271e00fca6b62bc4bf44bcf142cfc38caeded9b6c4e01d1ceef3ccf986f4","tests/const_fn.rs":"cb75a1f0864f926aebe79118fc34d51a0d1ade2c20a394e7774c7e545f21f1f4"},"package":"8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5"} \ No newline at end of file diff --git a/bash-5.1/vendor/libc/CONTRIBUTING.md b/bash-5.1/vendor/libc/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..3315ed3e84f7ea687393b11760cd14127ad9f7f2 --- /dev/null +++ b/bash-5.1/vendor/libc/CONTRIBUTING.md @@ -0,0 +1,93 @@ +# Contributing to `libc` + +Welcome! If you are reading this document, it means you are interested in contributing +to the `libc` crate. + +## Adding an API + +Want to use an API which currently isn't bound in `libc`? It's quite easy to add +one! + +The internal structure of this crate is designed to minimize the number of +`#[cfg]` attributes in order to easily be able to add new items which apply +to all platforms in the future. As a result, the crate is organized +hierarchically based on platform. Each module has a number of `#[cfg]`'d +children, but only one is ever actually compiled. Each module then reexports all +the contents of its children. + +This means that for each platform that libc supports, the path from a +leaf module to the root will contain all bindings for the platform in question. +Consequently, this indicates where an API should be added! Adding an API at a +particular level in the hierarchy means that it is supported on all the child +platforms of that level. For example, when adding a Unix API it should be added +to `src/unix/mod.rs`, but when adding a Linux-only API it should be added to +`src/unix/linux_like/linux/mod.rs`. + +If you're not 100% sure at what level of the hierarchy an API should be added +at, fear not! This crate has CI support which tests any binding against all +platforms supported, so you'll see failures if an API is added at the wrong +level or has different signatures across platforms. + +New symbol(s) (i.e. functions, constants etc.) should also be added to the +symbols list(s) found in the `libc-test/semver` directory. These lists keep +track of what symbols are public in the libc crate and ensures they remain +available between changes to the crate. If the new symbol(s) are available on +all supported Unixes it should be added to `unix.txt` list1, +otherwise they should be added to the OS specific list(s). + +With that in mind, the steps for adding a new API are: + +1. Determine where in the module hierarchy your API should be added. +2. Add the API, including adding new symbol(s) to the semver lists. +3. Send a PR to this repo. +4. Wait for CI to pass, fixing errors. +5. Wait for a merge! + +1: Note that this list has nothing to do with any Unix or Posix +standard, it's just a list shared between all OSs that declare `#[cfg(unix)]`. + +## Test before you commit + +We have two automated tests running on [GitHub Actions](https://github.com/rust-lang/libc/actions): + +1. [`libc-test`](https://github.com/gnzlbg/ctest) + - `cd libc-test && cargo test` + - Use the `skip_*()` functions in `build.rs` if you really need a workaround. +2. Style checker + - `rustc ci/style.rs && ./style src` + +## Breaking change policy + +Sometimes an upstream adds a breaking change to their API e.g. removing outdated items, +changing the type signature, etc. And we probably should follow that change to build the +`libc` crate successfully. It's annoying to do the equivalent of semver-major versioning +for each such change. Instead, we mark the item as deprecated and do the actual change +after a certain period. The steps are: + +1. Add `#[deprecated(since = "", note="")]` attribute to the item. + - The `since` field should have a next version of `libc` + (e.g., if the current version is `0.2.1`, it should be `0.2.2`). + - The `note` field should have a reason to deprecate and a tracking issue to call for comments + (e.g., "We consider removing this as the upstream removed it. + If you're using it, please comment on #XXX"). +2. If we don't see any concerns for a while, do the change actually. + +## Supported target policy + +When Rust removes a support for a target, the libc crate also may remove the support anytime. + +## Releasing your change to crates.io + +Now that you've done the amazing job of landing your new API or your new +platform in this crate, the next step is to get that sweet, sweet usage from +crates.io! The only next step is to bump the version of libc and then publish +it. If you'd like to get a release out ASAP you can follow these steps: + +1. Increment the patch version number in `Cargo.toml` and `libc-test/Cargo.toml`. +1. Send a PR to this repository. It should [look like this][example-pr], but it'd + also be nice to fill out the description with a small rationale for the + release (any rationale is ok though!) +1. Once merged, the release will be tagged and published by one of the libc crate + maintainers. + +[example-pr]: https://github.com/rust-lang/libc/pull/2120 diff --git a/bash-5.1/vendor/libc/Cargo.toml b/bash-5.1/vendor/libc/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..5b54eced6084468583f80a32da187b2f791cbbed --- /dev/null +++ b/bash-5.1/vendor/libc/Cargo.toml @@ -0,0 +1,64 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +name = "libc" +version = "0.2.132" +authors = ["The Rust Project Developers"] +build = "build.rs" +exclude = [ + "/ci/*", + "/.github/*", + "/.cirrus.yml", + "/triagebot.toml", +] +description = """ +Raw FFI bindings to platform libraries like libc. +""" +homepage = "https://github.com/rust-lang/libc" +documentation = "https://docs.rs/libc/" +readme = "README.md" +keywords = [ + "libc", + "ffi", + "bindings", + "operating", + "system", +] +categories = [ + "external-ffi-bindings", + "no-std", + "os", +] +license = "MIT OR Apache-2.0" +repository = "https://github.com/rust-lang/libc" + +[package.metadata.docs.rs] +features = [ + "const-extern-fn", + "extra_traits", +] + +[dependencies.rustc-std-workspace-core] +version = "1.0.0" +optional = true + +[features] +align = [] +const-extern-fn = [] +default = ["std"] +extra_traits = [] +rustc-dep-of-std = [ + "align", + "rustc-std-workspace-core", +] +std = [] +use_std = ["std"] diff --git a/bash-5.1/vendor/libc/LICENSE-APACHE b/bash-5.1/vendor/libc/LICENSE-APACHE new file mode 100644 index 0000000000000000000000000000000000000000..1b5ec8b78e237b5c3b3d812a7c0a6589d0f7161d --- /dev/null +++ b/bash-5.1/vendor/libc/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/bash-5.1/vendor/libc/LICENSE-MIT b/bash-5.1/vendor/libc/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..78061811c33c814721530338a9099bccbdd2aaf7 --- /dev/null +++ b/bash-5.1/vendor/libc/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2014-2020 The Rust Project Developers + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/bash-5.1/vendor/libc/README.md b/bash-5.1/vendor/libc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bc5ad18f6b1b85f05632b6a78a840e2a1e747d44 --- /dev/null +++ b/bash-5.1/vendor/libc/README.md @@ -0,0 +1,110 @@ +# libc - Raw FFI bindings to platforms' system libraries + +[![GHA Status]][GitHub Actions] [![Cirrus CI Status]][Cirrus CI] [![Latest Version]][crates.io] [![Documentation]][docs.rs] ![License] + +`libc` provides all of the definitions necessary to easily interoperate with C +code (or "C-like" code) on each of the platforms that Rust supports. This +includes type definitions (e.g. `c_int`), constants (e.g. `EINVAL`) as well as +function headers (e.g. `malloc`). + +This crate exports all underlying platform types, functions, and constants under +the crate root, so all items are accessible as `libc::foo`. The types and values +of all the exported APIs match the platform that libc is compiled for. + +More detailed information about the design of this library can be found in its +[associated RFC][rfc]. + +[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1291-promote-libc.md + +## Usage + +Add the following to your `Cargo.toml`: + +```toml +[dependencies] +libc = "0.2" +``` + +## Features + +* `std`: by default `libc` links to the standard library. Disable this + feature to remove this dependency and be able to use `libc` in `#![no_std]` + crates. + +* `extra_traits`: all `struct`s implemented in `libc` are `Copy` and `Clone`. + This feature derives `Debug`, `Eq`, `Hash`, and `PartialEq`. + +* `const-extern-fn`: Changes some `extern fn`s into `const extern fn`s. + If you use Rust >= 1.62, this feature is implicitly enabled. + Otherwise it requires a nightly rustc. + +* **deprecated**: `use_std` is deprecated, and is equivalent to `std`. + +## Rust version support + +The minimum supported Rust toolchain version is currently **Rust 1.13.0**. +(libc does not currently have any policy regarding changes to the minimum +supported Rust version; such policy is a work in progress.) APIs requiring +newer Rust features are only available on newer Rust toolchains: + +| Feature | Version | +|----------------------|---------| +| `union` | 1.19.0 | +| `const mem::size_of` | 1.24.0 | +| `repr(align)` | 1.25.0 | +| `extra_traits` | 1.25.0 | +| `core::ffi::c_void` | 1.30.0 | +| `repr(packed(N))` | 1.33.0 | +| `cfg(target_vendor)` | 1.33.0 | +| `const-extern-fn` | 1.62.0 | + +## Platform support + +[Platform-specific documentation (master branch)][docs.master]. + +See +[`ci/build.sh`](https://github.com/rust-lang/libc/blob/master/ci/build.sh) +for the platforms on which `libc` is guaranteed to build for each Rust +toolchain. The test-matrix at [GitHub Actions] and [Cirrus CI] show the +platforms in which `libc` tests are run. + +

+ +## License + +This project is licensed under either of + +* [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) + ([LICENSE-APACHE](https://github.com/rust-lang/libc/blob/master/LICENSE-APACHE)) + +* [MIT License](https://opensource.org/licenses/MIT) + ([LICENSE-MIT](https://github.com/rust-lang/libc/blob/master/LICENSE-MIT)) + +at your option. + +## Contributing + +We welcome all people who want to contribute. Please see the [contributing +instructions] for more information. + +[contributing instructions]: https://github.com/rust-lang/libc/blob/master/CONTRIBUTING.md + +Contributions in any form (issues, pull requests, etc.) to this project +must adhere to Rust's [Code of Conduct]. + +[Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in `libc` by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. + +[GitHub Actions]: https://github.com/rust-lang/libc/actions +[GHA Status]: https://github.com/rust-lang/libc/workflows/CI/badge.svg +[Cirrus CI]: https://cirrus-ci.com/github/rust-lang/libc +[Cirrus CI Status]: https://api.cirrus-ci.com/github/rust-lang/libc.svg +[crates.io]: https://crates.io/crates/libc +[Latest Version]: https://img.shields.io/crates/v/libc.svg +[Documentation]: https://docs.rs/libc/badge.svg +[docs.rs]: https://docs.rs/libc +[License]: https://img.shields.io/crates/l/libc.svg +[docs.master]: https://rust-lang.github.io/libc/#platform-specific-documentation diff --git a/bash-5.1/vendor/libc/build.rs b/bash-5.1/vendor/libc/build.rs new file mode 100644 index 0000000000000000000000000000000000000000..0a43b2a12ea968986fcc50a11ba21a11ae9b19b2 --- /dev/null +++ b/bash-5.1/vendor/libc/build.rs @@ -0,0 +1,174 @@ +use std::env; +use std::process::Command; +use std::str; + +fn main() { + // Avoid unnecessary re-building. + println!("cargo:rerun-if-changed=build.rs"); + + let (rustc_minor_ver, is_nightly) = rustc_minor_nightly().expect("Failed to get rustc version"); + let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok(); + let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok(); + let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok(); + let libc_ci = env::var("LIBC_CI").is_ok(); + + if env::var("CARGO_FEATURE_USE_STD").is_ok() { + println!( + "cargo:warning=\"libc's use_std cargo feature is deprecated since libc 0.2.55; \ + please consider using the `std` cargo feature instead\"" + ); + } + + // The ABI of libc used by libstd is backward compatible with FreeBSD 10. + // The ABI of libc from crates.io is backward compatible with FreeBSD 11. + // + // On CI, we detect the actual FreeBSD version and match its ABI exactly, + // running tests to ensure that the ABI is correct. + match which_freebsd() { + Some(10) if libc_ci || rustc_dep_of_std => { + println!("cargo:rustc-cfg=freebsd10") + } + Some(11) if libc_ci => println!("cargo:rustc-cfg=freebsd11"), + Some(12) if libc_ci => println!("cargo:rustc-cfg=freebsd12"), + Some(13) if libc_ci => println!("cargo:rustc-cfg=freebsd13"), + Some(14) if libc_ci => println!("cargo:rustc-cfg=freebsd14"), + Some(_) | None => println!("cargo:rustc-cfg=freebsd11"), + } + + // On CI: deny all warnings + if libc_ci { + println!("cargo:rustc-cfg=libc_deny_warnings"); + } + + // Rust >= 1.15 supports private module use: + if rustc_minor_ver >= 15 || rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_priv_mod_use"); + } + + // Rust >= 1.19 supports unions: + if rustc_minor_ver >= 19 || rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_union"); + } + + // Rust >= 1.24 supports const mem::size_of: + if rustc_minor_ver >= 24 || rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_const_size_of"); + } + + // Rust >= 1.25 supports repr(align): + if rustc_minor_ver >= 25 || rustc_dep_of_std || align_cargo_feature { + println!("cargo:rustc-cfg=libc_align"); + } + + // Rust >= 1.26 supports i128 and u128: + if rustc_minor_ver >= 26 || rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_int128"); + } + + // Rust >= 1.30 supports `core::ffi::c_void`, so libc can just re-export it. + // Otherwise, it defines an incompatible type to retaining + // backwards-compatibility. + if rustc_minor_ver >= 30 || rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_core_cvoid"); + } + + // Rust >= 1.33 supports repr(packed(N)) and cfg(target_vendor). + if rustc_minor_ver >= 33 || rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_packedN"); + println!("cargo:rustc-cfg=libc_cfg_target_vendor"); + } + + // Rust >= 1.40 supports #[non_exhaustive]. + if rustc_minor_ver >= 40 || rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_non_exhaustive"); + } + + if rustc_minor_ver >= 51 || rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_ptr_addr_of"); + } + + // Rust >= 1.37.0 allows underscores as anonymous constant names. + if rustc_minor_ver >= 37 || rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_underscore_const_names"); + } + + // #[thread_local] is currently unstable + if rustc_dep_of_std { + println!("cargo:rustc-cfg=libc_thread_local"); + } + + // Rust >= 1.62.0 allows to use `const_extern_fn` for "Rust" and "C". + if rustc_minor_ver >= 62 { + println!("cargo:rustc-cfg=libc_const_extern_fn"); + } else { + // Rust < 1.62.0 requires a crate feature and feature gate. + if const_extern_fn_cargo_feature { + if !is_nightly || rustc_minor_ver < 40 { + panic!("const-extern-fn requires a nightly compiler >= 1.40"); + } + println!("cargo:rustc-cfg=libc_const_extern_fn_unstable"); + println!("cargo:rustc-cfg=libc_const_extern_fn"); + } + } +} + +fn rustc_minor_nightly() -> Option<(u32, bool)> { + macro_rules! otry { + ($e:expr) => { + match $e { + Some(e) => e, + None => return None, + } + }; + } + + let rustc = otry!(env::var_os("RUSTC")); + let output = otry!(Command::new(rustc).arg("--version").output().ok()); + let version = otry!(str::from_utf8(&output.stdout).ok()); + let mut pieces = version.split('.'); + + if pieces.next() != Some("rustc 1") { + return None; + } + + let minor = pieces.next(); + + // If `rustc` was built from a tarball, its version string + // will have neither a git hash nor a commit date + // (e.g. "rustc 1.39.0"). Treat this case as non-nightly, + // since a nightly build should either come from CI + // or a git checkout + let nightly_raw = otry!(pieces.next()).split('-').nth(1); + let nightly = nightly_raw + .map(|raw| raw.starts_with("dev") || raw.starts_with("nightly")) + .unwrap_or(false); + let minor = otry!(otry!(minor).parse().ok()); + + Some((minor, nightly)) +} + +fn which_freebsd() -> Option { + let output = std::process::Command::new("freebsd-version").output().ok(); + if output.is_none() { + return None; + } + let output = output.unwrap(); + if !output.status.success() { + return None; + } + + let stdout = String::from_utf8(output.stdout).ok(); + if stdout.is_none() { + return None; + } + let stdout = stdout.unwrap(); + + match &stdout { + s if s.starts_with("10") => Some(10), + s if s.starts_with("11") => Some(11), + s if s.starts_with("12") => Some(12), + s if s.starts_with("13") => Some(13), + s if s.starts_with("14") => Some(14), + _ => None, + } +} diff --git a/bash-5.1/vendor/libc/rustfmt.toml b/bash-5.1/vendor/libc/rustfmt.toml new file mode 100644 index 0000000000000000000000000000000000000000..dc85c99467fcc63e60328d0c0ce5f8d833301fc2 --- /dev/null +++ b/bash-5.1/vendor/libc/rustfmt.toml @@ -0,0 +1 @@ +error_on_line_overflow = true diff --git a/bash-5.1/vendor/libc/src/fixed_width_ints.rs b/bash-5.1/vendor/libc/src/fixed_width_ints.rs new file mode 100644 index 0000000000000000000000000000000000000000..999de8f54f1943adb06b80848688e55eb1d0d943 --- /dev/null +++ b/bash-5.1/vendor/libc/src/fixed_width_ints.rs @@ -0,0 +1,99 @@ +//! This module contains type aliases for C's fixed-width integer types . +//! +//! These aliases are deprecated: use the Rust types instead. + +#[deprecated(since = "0.2.55", note = "Use i8 instead.")] +pub type int8_t = i8; +#[deprecated(since = "0.2.55", note = "Use i16 instead.")] +pub type int16_t = i16; +#[deprecated(since = "0.2.55", note = "Use i32 instead.")] +pub type int32_t = i32; +#[deprecated(since = "0.2.55", note = "Use i64 instead.")] +pub type int64_t = i64; +#[deprecated(since = "0.2.55", note = "Use u8 instead.")] +pub type uint8_t = u8; +#[deprecated(since = "0.2.55", note = "Use u16 instead.")] +pub type uint16_t = u16; +#[deprecated(since = "0.2.55", note = "Use u32 instead.")] +pub type uint32_t = u32; +#[deprecated(since = "0.2.55", note = "Use u64 instead.")] +pub type uint64_t = u64; + +cfg_if! { + if #[cfg(all(libc_int128, target_arch = "aarch64", not(target_os = "windows")))] { + // This introduces partial support for FFI with __int128 and + // equivalent types on platforms where Rust's definition is validated + // to match the standard C ABI of that platform. + // + // Rust does not guarantee u128/i128 are sound for FFI, and its + // definitions are in fact known to be incompatible. [0] + // + // However these problems aren't fundamental, and are just platform + // inconsistencies. Specifically at the time of this writing: + // + // * For x64 SysV ABIs (everything but Windows), the types are underaligned. + // * For all Windows ABIs, Microsoft doesn't actually officially define __int128, + // and as a result different implementations don't actually agree on its ABI. + // + // But on the other major aarch64 platforms (android, linux, ios, macos) we have + // validated that rustc has the right ABI for these types. This is important because + // aarch64 uses these types in some fundamental OS types like user_fpsimd_struct, + // which represents saved simd registers. + // + // Any API which uses these types will need to `#[ignore(improper_ctypes)]` + // until the upstream rust issue is resolved, but this at least lets us make + // progress on platforms where this type is important. + // + // The list of supported architectures and OSes is intentionally very restricted, + // as careful work needs to be done to verify that a particular platform + // has a conformant ABI. + // + // [0]: https://github.com/rust-lang/rust/issues/54341 + + /// C `__int128` (a GCC extension that's part of many ABIs) + pub type __int128 = i128; + /// C `unsigned __int128` (a GCC extension that's part of many ABIs) + pub type __uint128 = u128; + /// C __int128_t (alternate name for [__int128][]) + pub type __int128_t = i128; + /// C __uint128_t (alternate name for [__uint128][]) + pub type __uint128_t = u128; + + cfg_if! { + if #[cfg(libc_underscore_const_names)] { + macro_rules! static_assert_eq { + ($a:expr, $b:expr) => { + const _: [(); $a] = [(); $b]; + }; + } + + // NOTE: if you add more platforms to here, you may need to cfg + // these consts. They should always match the platform's values + // for `sizeof(__int128)` and `_Alignof(__int128)`. + const _SIZE_128: usize = 16; + const _ALIGN_128: usize = 16; + + // Since Rust doesn't officially guarantee that these types + // have compatible ABIs, we const assert that these values have the + // known size/align of the target platform's libc. If rustc ever + // tries to regress things, it will cause a compilation error. + // + // This isn't a bullet-proof solution because e.g. it doesn't + // catch the fact that llvm and gcc disagree on how x64 __int128 + // is actually *passed* on the stack (clang underaligns it for + // the same reason that rustc *never* properly aligns it). + static_assert_eq!(core::mem::size_of::<__int128>(), _SIZE_128); + static_assert_eq!(core::mem::align_of::<__int128>(), _ALIGN_128); + + static_assert_eq!(core::mem::size_of::<__uint128>(), _SIZE_128); + static_assert_eq!(core::mem::align_of::<__uint128>(), _ALIGN_128); + + static_assert_eq!(core::mem::size_of::<__int128_t>(), _SIZE_128); + static_assert_eq!(core::mem::align_of::<__int128_t>(), _ALIGN_128); + + static_assert_eq!(core::mem::size_of::<__uint128_t>(), _SIZE_128); + static_assert_eq!(core::mem::align_of::<__uint128_t>(), _ALIGN_128); + } + } + } +} diff --git a/bash-5.1/vendor/libc/src/fuchsia/aarch64.rs b/bash-5.1/vendor/libc/src/fuchsia/aarch64.rs new file mode 100644 index 0000000000000000000000000000000000000000..259893c0fa84d9e8d705490a9eebdc24d38edae7 --- /dev/null +++ b/bash-5.1/vendor/libc/src/fuchsia/aarch64.rs @@ -0,0 +1,66 @@ +pub type c_char = u8; +pub type __u64 = ::c_ulonglong; +pub type wchar_t = u32; +pub type nlink_t = ::c_ulong; +pub type blksize_t = ::c_long; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad0: ::c_ulong, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + __pad1: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_uint; 2], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad0: ::c_ulong, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + __pad1: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_uint; 2], + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong, + } +} + +pub const MINSIGSTKSZ: ::size_t = 6144; +pub const SIGSTKSZ: ::size_t = 12288; diff --git a/bash-5.1/vendor/libc/src/fuchsia/align.rs b/bash-5.1/vendor/libc/src/fuchsia/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..3409bf0c6195534cb6ed020153270851e32f458f --- /dev/null +++ b/bash-5.1/vendor/libc/src/fuchsia/align.rs @@ -0,0 +1,142 @@ +macro_rules! expand_align { + () => { + s! { + #[cfg_attr( + any( + target_pointer_width = "32", + target_arch = "x86_64" + ), + repr(align(4)))] + #[cfg_attr( + not(any( + target_pointer_width = "32", + target_arch = "x86_64" + )), + repr(align(8)))] + pub struct pthread_mutexattr_t { + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + #[cfg_attr(target_pointer_width = "32", + repr(align(4)))] + #[cfg_attr(target_pointer_width = "64", + repr(align(8)))] + pub struct pthread_rwlockattr_t { + size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T], + } + + #[repr(align(4))] + pub struct pthread_condattr_t { + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + } + + s_no_extra_traits! { + #[cfg_attr(all(target_pointer_width = "32", + any(target_arch = "arm", + target_arch = "x86_64")), + repr(align(4)))] + #[cfg_attr(any(target_pointer_width = "64", + not(any(target_arch = "arm", + target_arch = "x86_64"))), + repr(align(8)))] + pub struct pthread_mutex_t { + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + + #[cfg_attr(all(target_pointer_width = "32", + any(target_arch = "arm", + target_arch = "x86_64")), + repr(align(4)))] + #[cfg_attr(any(target_pointer_width = "64", + not(any(target_arch = "arm", + target_arch = "x86_64"))), + repr(align(8)))] + pub struct pthread_rwlock_t { + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + + #[cfg_attr(target_pointer_width = "32", + repr(align(4)))] + #[cfg_attr(target_pointer_width = "64", + repr(align(8)))] + #[cfg_attr(target_arch = "x86", + repr(align(4)))] + #[cfg_attr(not(target_arch = "x86"), + repr(align(8)))] + pub struct pthread_cond_t { + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for pthread_cond_t { + fn eq(&self, other: &pthread_cond_t) -> bool { + self.size + .iter() + .zip(other.size.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_cond_t {} + impl ::fmt::Debug for pthread_cond_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_cond_t") + // FIXME: .field("size", &self.size) + .finish() + } + } + impl ::hash::Hash for pthread_cond_t { + fn hash(&self, state: &mut H) { + self.size.hash(state); + } + } + + impl PartialEq for pthread_mutex_t { + fn eq(&self, other: &pthread_mutex_t) -> bool { + self.size + .iter() + .zip(other.size.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_mutex_t {} + impl ::fmt::Debug for pthread_mutex_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_mutex_t") + // FIXME: .field("size", &self.size) + .finish() + } + } + impl ::hash::Hash for pthread_mutex_t { + fn hash(&self, state: &mut H) { + self.size.hash(state); + } + } + + impl PartialEq for pthread_rwlock_t { + fn eq(&self, other: &pthread_rwlock_t) -> bool { + self.size + .iter() + .zip(other.size.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_rwlock_t {} + impl ::fmt::Debug for pthread_rwlock_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_rwlock_t") + // FIXME: .field("size", &self.size) + .finish() + } + } + impl ::hash::Hash for pthread_rwlock_t { + fn hash(&self, state: &mut H) { + self.size.hash(state); + } + } + } + } + }; +} diff --git a/bash-5.1/vendor/libc/src/fuchsia/mod.rs b/bash-5.1/vendor/libc/src/fuchsia/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..4a18a8daabc0c63187d9107d1eaa19abe776e0e6 --- /dev/null +++ b/bash-5.1/vendor/libc/src/fuchsia/mod.rs @@ -0,0 +1,4287 @@ +//! Definitions found commonly among almost all Unix derivatives +//! +//! More functions and definitions can be found in the more specific modules +//! according to the platform in question. + +// PUB_TYPE + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_float = f32; +pub type c_double = f64; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; + +pub type locale_t = *mut ::c_void; + +pub type size_t = usize; +pub type ptrdiff_t = isize; +pub type intptr_t = isize; +pub type uintptr_t = usize; +pub type ssize_t = isize; + +pub type pid_t = i32; +pub type uid_t = u32; +pub type gid_t = u32; +pub type in_addr_t = u32; +pub type in_port_t = u16; +pub type sighandler_t = ::size_t; +pub type cc_t = ::c_uchar; +pub type sa_family_t = u16; +pub type pthread_key_t = ::c_uint; +pub type speed_t = ::c_uint; +pub type tcflag_t = ::c_uint; +pub type clockid_t = ::c_int; +pub type key_t = ::c_int; +pub type id_t = ::c_uint; +pub type useconds_t = u32; +pub type dev_t = u64; +pub type socklen_t = u32; +pub type pthread_t = c_ulong; +pub type mode_t = u32; +pub type ino64_t = u64; +pub type off64_t = i64; +pub type blkcnt64_t = i64; +pub type rlim64_t = u64; +pub type mqd_t = ::c_int; +pub type nfds_t = ::c_ulong; +pub type nl_item = ::c_int; +pub type idtype_t = ::c_uint; +pub type loff_t = ::c_longlong; + +pub type __u8 = ::c_uchar; +pub type __u16 = ::c_ushort; +pub type __s16 = ::c_short; +pub type __u32 = ::c_uint; +pub type __s32 = ::c_int; + +pub type Elf32_Half = u16; +pub type Elf32_Word = u32; +pub type Elf32_Off = u32; +pub type Elf32_Addr = u32; + +pub type Elf64_Half = u16; +pub type Elf64_Word = u32; +pub type Elf64_Off = u64; +pub type Elf64_Addr = u64; +pub type Elf64_Xword = u64; + +pub type clock_t = c_long; +pub type time_t = c_long; +pub type suseconds_t = c_long; +pub type ino_t = u64; +pub type off_t = i64; +pub type blkcnt_t = i64; + +pub type shmatt_t = ::c_ulong; +pub type msgqnum_t = ::c_ulong; +pub type msglen_t = ::c_ulong; +pub type fsblkcnt_t = ::c_ulonglong; +pub type fsfilcnt_t = ::c_ulonglong; +pub type rlim_t = ::c_ulonglong; + +pub type c_long = i64; +pub type c_ulong = u64; + +// FIXME: why are these uninhabited types? that seems... wrong? +// Presumably these should be `()` or an `extern type` (when that stabilizes). +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { + *self + } +} +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum DIR {} +impl ::Copy for DIR {} +impl ::Clone for DIR { + fn clone(&self) -> DIR { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum fpos64_t {} // FIXME: fill this out with a struct +impl ::Copy for fpos64_t {} +impl ::Clone for fpos64_t { + fn clone(&self) -> fpos64_t { + *self + } +} + +// PUB_STRUCT + +s! { + pub struct group { + pub gr_name: *mut ::c_char, + pub gr_passwd: *mut ::c_char, + pub gr_gid: ::gid_t, + pub gr_mem: *mut *mut ::c_char, + } + + pub struct utimbuf { + pub actime: time_t, + pub modtime: time_t, + } + + pub struct timeval { + pub tv_sec: time_t, + pub tv_usec: suseconds_t, + } + + pub struct timespec { + pub tv_sec: time_t, + pub tv_nsec: ::c_long, + } + + // FIXME: the rlimit and rusage related functions and types don't exist + // within zircon. Are there reasons for keeping them around? + pub struct rlimit { + pub rlim_cur: rlim_t, + pub rlim_max: rlim_t, + } + + pub struct rusage { + pub ru_utime: timeval, + pub ru_stime: timeval, + pub ru_maxrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad1: u32, + pub ru_ixrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad2: u32, + pub ru_idrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad3: u32, + pub ru_isrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad4: u32, + pub ru_minflt: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad5: u32, + pub ru_majflt: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad6: u32, + pub ru_nswap: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad7: u32, + pub ru_inblock: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad8: u32, + pub ru_oublock: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad9: u32, + pub ru_msgsnd: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad10: u32, + pub ru_msgrcv: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad11: u32, + pub ru_nsignals: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad12: u32, + pub ru_nvcsw: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad13: u32, + pub ru_nivcsw: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad14: u32, + } + + pub struct in_addr { + pub s_addr: in_addr_t, + } + + pub struct in6_addr { + pub s6_addr: [u8; 16], + } + + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct ip_mreqn { + pub imr_multiaddr: in_addr, + pub imr_address: in_addr, + pub imr_ifindex: ::c_int, + } + + pub struct ipv6_mreq { + pub ipv6mr_multiaddr: in6_addr, + pub ipv6mr_interface: ::c_uint, + } + + pub struct hostent { + pub h_name: *mut ::c_char, + pub h_aliases: *mut *mut ::c_char, + pub h_addrtype: ::c_int, + pub h_length: ::c_int, + pub h_addr_list: *mut *mut ::c_char, + } + + pub struct iovec { + pub iov_base: *mut ::c_void, + pub iov_len: ::size_t, + } + + pub struct pollfd { + pub fd: ::c_int, + pub events: ::c_short, + pub revents: ::c_short, + } + + pub struct winsize { + pub ws_row: ::c_ushort, + pub ws_col: ::c_ushort, + pub ws_xpixel: ::c_ushort, + pub ws_ypixel: ::c_ushort, + } + + pub struct linger { + pub l_onoff: ::c_int, + pub l_linger: ::c_int, + } + + pub struct sigval { + // Actually a union of an int and a void* + pub sival_ptr: *mut ::c_void + } + + // + pub struct itimerval { + pub it_interval: ::timeval, + pub it_value: ::timeval, + } + + // + pub struct tms { + pub tms_utime: ::clock_t, + pub tms_stime: ::clock_t, + pub tms_cutime: ::clock_t, + pub tms_cstime: ::clock_t, + } + + pub struct servent { + pub s_name: *mut ::c_char, + pub s_aliases: *mut *mut ::c_char, + pub s_port: ::c_int, + pub s_proto: *mut ::c_char, + } + + pub struct protoent { + pub p_name: *mut ::c_char, + pub p_aliases: *mut *mut ::c_char, + pub p_proto: ::c_int, + } + + pub struct aiocb { + pub aio_fildes: ::c_int, + pub aio_lio_opcode: ::c_int, + pub aio_reqprio: ::c_int, + pub aio_buf: *mut ::c_void, + pub aio_nbytes: ::size_t, + pub aio_sigevent: ::sigevent, + __td: *mut ::c_void, + __lock: [::c_int; 2], + __err: ::c_int, + __ret: ::ssize_t, + pub aio_offset: off_t, + __next: *mut ::c_void, + __prev: *mut ::c_void, + #[cfg(target_pointer_width = "32")] + __dummy4: [::c_char; 24], + #[cfg(target_pointer_width = "64")] + __dummy4: [::c_char; 16], + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + pub __c_ispeed: ::speed_t, + pub __c_ospeed: ::speed_t, + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct ucred { + pub pid: ::pid_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + } + + pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in { + pub sin_family: sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [u8; 8], + } + + pub struct sockaddr_in6 { + pub sin6_family: sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + pub ai_addrlen: socklen_t, + + pub ai_addr: *mut ::sockaddr, + + pub ai_canonname: *mut c_char, + + pub ai_next: *mut addrinfo, + } + + pub struct sockaddr_ll { + pub sll_family: ::c_ushort, + pub sll_protocol: ::c_ushort, + pub sll_ifindex: ::c_int, + pub sll_hatype: ::c_ushort, + pub sll_pkttype: ::c_uchar, + pub sll_halen: ::c_uchar, + pub sll_addr: [::c_uchar; 8] + } + + pub struct fd_set { + fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE], + } + + pub struct tm { + pub tm_sec: ::c_int, + pub tm_min: ::c_int, + pub tm_hour: ::c_int, + pub tm_mday: ::c_int, + pub tm_mon: ::c_int, + pub tm_year: ::c_int, + pub tm_wday: ::c_int, + pub tm_yday: ::c_int, + pub tm_isdst: ::c_int, + pub tm_gmtoff: ::c_long, + pub tm_zone: *const ::c_char, + } + + pub struct sched_param { + pub sched_priority: ::c_int, + pub sched_ss_low_priority: ::c_int, + pub sched_ss_repl_period: ::timespec, + pub sched_ss_init_budget: ::timespec, + pub sched_ss_max_repl: ::c_int, + } + + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *mut ::c_void, + } + + pub struct epoll_event { + pub events: u32, + pub u64: u64, + } + + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } + + pub struct rlimit64 { + pub rlim_cur: rlim64_t, + pub rlim_max: rlim64_t, + } + + pub struct glob_t { + pub gl_pathc: ::size_t, + pub gl_pathv: *mut *mut c_char, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + + __unused1: *mut ::c_void, + __unused2: *mut ::c_void, + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + } + + pub struct ifaddrs { + pub ifa_next: *mut ifaddrs, + pub ifa_name: *mut c_char, + pub ifa_flags: ::c_uint, + pub ifa_addr: *mut ::sockaddr, + pub ifa_netmask: *mut ::sockaddr, + pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union + pub ifa_data: *mut ::c_void + } + + pub struct passwd { + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_gecos: *mut ::c_char, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char, + } + + pub struct spwd { + pub sp_namp: *mut ::c_char, + pub sp_pwdp: *mut ::c_char, + pub sp_lstchg: ::c_long, + pub sp_min: ::c_long, + pub sp_max: ::c_long, + pub sp_warn: ::c_long, + pub sp_inact: ::c_long, + pub sp_expire: ::c_long, + pub sp_flag: ::c_ulong, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + #[cfg(target_endian = "little")] + pub f_fsid: ::c_ulong, + #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))] + __f_unused: ::c_int, + #[cfg(target_endian = "big")] + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct dqblk { + pub dqb_bhardlimit: u64, + pub dqb_bsoftlimit: u64, + pub dqb_curspace: u64, + pub dqb_ihardlimit: u64, + pub dqb_isoftlimit: u64, + pub dqb_curinodes: u64, + pub dqb_btime: u64, + pub dqb_itime: u64, + pub dqb_valid: u32, + } + + pub struct signalfd_siginfo { + pub ssi_signo: u32, + pub ssi_errno: i32, + pub ssi_code: i32, + pub ssi_pid: u32, + pub ssi_uid: u32, + pub ssi_fd: i32, + pub ssi_tid: u32, + pub ssi_band: u32, + pub ssi_overrun: u32, + pub ssi_trapno: u32, + pub ssi_status: i32, + pub ssi_int: i32, + pub ssi_ptr: u64, + pub ssi_utime: u64, + pub ssi_stime: u64, + pub ssi_addr: u64, + pub ssi_addr_lsb: u16, + _pad2: u16, + pub ssi_syscall: i32, + pub ssi_call_addr: u64, + pub ssi_arch: u32, + _pad: [u8; 28], + } + + pub struct itimerspec { + pub it_interval: ::timespec, + pub it_value: ::timespec, + } + + pub struct fsid_t { + __val: [::c_int; 2], + } + + pub struct cpu_set_t { + #[cfg(all(target_pointer_width = "32", + not(target_arch = "x86_64")))] + bits: [u32; 32], + #[cfg(not(all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] + bits: [u64; 16], + } + + pub struct if_nameindex { + pub if_index: ::c_uint, + pub if_name: *mut ::c_char, + } + + // System V IPC + pub struct msginfo { + pub msgpool: ::c_int, + pub msgmap: ::c_int, + pub msgmax: ::c_int, + pub msgmnb: ::c_int, + pub msgmni: ::c_int, + pub msgssz: ::c_int, + pub msgtql: ::c_int, + pub msgseg: ::c_ushort, + } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::c_uint, + } + + pub struct sembuf { + pub sem_num: ::c_ushort, + pub sem_op: ::c_short, + pub sem_flg: ::c_short, + } + + pub struct input_event { + pub time: ::timeval, + pub type_: ::__u16, + pub code: ::__u16, + pub value: ::__s32, + } + + pub struct input_id { + pub bustype: ::__u16, + pub vendor: ::__u16, + pub product: ::__u16, + pub version: ::__u16, + } + + pub struct input_absinfo { + pub value: ::__s32, + pub minimum: ::__s32, + pub maximum: ::__s32, + pub fuzz: ::__s32, + pub flat: ::__s32, + pub resolution: ::__s32, + } + + pub struct input_keymap_entry { + pub flags: ::__u8, + pub len: ::__u8, + pub index: ::__u16, + pub keycode: ::__u32, + pub scancode: [::__u8; 32], + } + + pub struct input_mask { + pub type_: ::__u32, + pub codes_size: ::__u32, + pub codes_ptr: ::__u64, + } + + pub struct ff_replay { + pub length: ::__u16, + pub delay: ::__u16, + } + + pub struct ff_trigger { + pub button: ::__u16, + pub interval: ::__u16, + } + + pub struct ff_envelope { + pub attack_length: ::__u16, + pub attack_level: ::__u16, + pub fade_length: ::__u16, + pub fade_level: ::__u16, + } + + pub struct ff_constant_effect { + pub level: ::__s16, + pub envelope: ff_envelope, + } + + pub struct ff_ramp_effect { + pub start_level: ::__s16, + pub end_level: ::__s16, + pub envelope: ff_envelope, + } + + pub struct ff_condition_effect { + pub right_saturation: ::__u16, + pub left_saturation: ::__u16, + + pub right_coeff: ::__s16, + pub left_coeff: ::__s16, + + pub deadband: ::__u16, + pub center: ::__s16, + } + + pub struct ff_periodic_effect { + pub waveform: ::__u16, + pub period: ::__u16, + pub magnitude: ::__s16, + pub offset: ::__s16, + pub phase: ::__u16, + + pub envelope: ff_envelope, + + pub custom_len: ::__u32, + pub custom_data: *mut ::__s16, + } + + pub struct ff_rumble_effect { + pub strong_magnitude: ::__u16, + pub weak_magnitude: ::__u16, + } + + pub struct ff_effect { + pub type_: ::__u16, + pub id: ::__s16, + pub direction: ::__u16, + pub trigger: ff_trigger, + pub replay: ff_replay, + // FIXME this is actually a union + #[cfg(target_pointer_width = "64")] + pub u: [u64; 4], + #[cfg(target_pointer_width = "32")] + pub u: [u32; 7], + } + + pub struct dl_phdr_info { + #[cfg(target_pointer_width = "64")] + pub dlpi_addr: Elf64_Addr, + #[cfg(target_pointer_width = "32")] + pub dlpi_addr: Elf32_Addr, + + pub dlpi_name: *const ::c_char, + + #[cfg(target_pointer_width = "64")] + pub dlpi_phdr: *const Elf64_Phdr, + #[cfg(target_pointer_width = "32")] + pub dlpi_phdr: *const Elf32_Phdr, + + #[cfg(target_pointer_width = "64")] + pub dlpi_phnum: Elf64_Half, + #[cfg(target_pointer_width = "32")] + pub dlpi_phnum: Elf32_Half, + + pub dlpi_adds: ::c_ulonglong, + pub dlpi_subs: ::c_ulonglong, + pub dlpi_tls_modid: ::size_t, + pub dlpi_tls_data: *mut ::c_void, + } + + pub struct Elf32_Phdr { + pub p_type: Elf32_Word, + pub p_offset: Elf32_Off, + pub p_vaddr: Elf32_Addr, + pub p_paddr: Elf32_Addr, + pub p_filesz: Elf32_Word, + pub p_memsz: Elf32_Word, + pub p_flags: Elf32_Word, + pub p_align: Elf32_Word, + } + + pub struct Elf64_Phdr { + pub p_type: Elf64_Word, + pub p_flags: Elf64_Word, + pub p_offset: Elf64_Off, + pub p_vaddr: Elf64_Addr, + pub p_paddr: Elf64_Addr, + pub p_filesz: Elf64_Xword, + pub p_memsz: Elf64_Xword, + pub p_align: Elf64_Xword, + } + + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct pthread_attr_t { + __size: [u64; 7] + } + + pub struct sigset_t { + __val: [::c_ulong; 16], + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::c_ulong, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + pub msg_rtime: ::time_t, + pub msg_ctime: ::time_t, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct statfs { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::c_int, + __pad1: ::c_int, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::socklen_t, + __pad2: ::socklen_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: ::socklen_t, + pub __pad1: ::c_int, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct sem_t { + __val: [::c_int; 8], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } + + pub struct in6_pktinfo { + pub ipi6_addr: ::in6_addr, + pub ipi6_ifindex: ::c_uint, + } +} + +s_no_extra_traits! { + pub struct sysinfo { + pub uptime: ::c_ulong, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, + pub freeram: ::c_ulong, + pub sharedram: ::c_ulong, + pub bufferram: ::c_ulong, + pub totalswap: ::c_ulong, + pub freeswap: ::c_ulong, + pub procs: ::c_ushort, + pub pad: ::c_ushort, + pub totalhigh: ::c_ulong, + pub freehigh: ::c_ulong, + pub mem_unit: ::c_uint, + pub __reserved: [::c_char; 256], + } + + pub struct sockaddr_un { + pub sun_family: sa_family_t, + pub sun_path: [::c_char; 108] + } + + pub struct sockaddr_storage { + pub ss_family: sa_family_t, + __ss_align: ::size_t, + __ss_pad2: [u8; 128 - 2 * 8], + } + + pub struct utsname { + pub sysname: [::c_char; 65], + pub nodename: [::c_char; 65], + pub release: [::c_char; 65], + pub version: [::c_char; 65], + pub machine: [::c_char; 65], + pub domainname: [::c_char; 65] + } + + pub struct dirent { + pub d_ino: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + + pub struct dirent64 { + pub d_ino: ::ino64_t, + pub d_off: ::off64_t, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + + // x32 compatibility + // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279 + pub struct mq_attr { + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_flags: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_maxmsg: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_msgsize: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_curmsgs: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pad: [i64; 4], + + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub mq_flags: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub mq_maxmsg: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub mq_msgsize: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub mq_curmsgs: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pad: [::c_long; 4], + } + + pub struct sockaddr_nl { + pub nl_family: ::sa_family_t, + nl_pad: ::c_ushort, + pub nl_pid: u32, + pub nl_groups: u32 + } + + pub struct sigevent { + pub sigev_value: ::sigval, + pub sigev_signo: ::c_int, + pub sigev_notify: ::c_int, + pub sigev_notify_function: fn(::sigval), + pub sigev_notify_attributes: *mut pthread_attr_t, + pub __pad: [::c_char; 56 - 3 * 8 /* 8 == sizeof(long) */], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for sysinfo { + fn eq(&self, other: &sysinfo) -> bool { + self.uptime == other.uptime + && self.loads == other.loads + && self.totalram == other.totalram + && self.freeram == other.freeram + && self.sharedram == other.sharedram + && self.bufferram == other.bufferram + && self.totalswap == other.totalswap + && self.freeswap == other.freeswap + && self.procs == other.procs + && self.pad == other.pad + && self.totalhigh == other.totalhigh + && self.freehigh == other.freehigh + && self.mem_unit == other.mem_unit + && self + .__reserved + .iter() + .zip(other.__reserved.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sysinfo {} + impl ::fmt::Debug for sysinfo { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sysinfo") + .field("uptime", &self.uptime) + .field("loads", &self.loads) + .field("totalram", &self.totalram) + .field("freeram", &self.freeram) + .field("sharedram", &self.sharedram) + .field("bufferram", &self.bufferram) + .field("totalswap", &self.totalswap) + .field("freeswap", &self.freeswap) + .field("procs", &self.procs) + .field("pad", &self.pad) + .field("totalhigh", &self.totalhigh) + .field("freehigh", &self.freehigh) + .field("mem_unit", &self.mem_unit) + // FIXME: .field("__reserved", &self.__reserved) + .finish() + } + } + impl ::hash::Hash for sysinfo { + fn hash(&self, state: &mut H) { + self.uptime.hash(state); + self.loads.hash(state); + self.totalram.hash(state); + self.freeram.hash(state); + self.sharedram.hash(state); + self.bufferram.hash(state); + self.totalswap.hash(state); + self.freeswap.hash(state); + self.procs.hash(state); + self.pad.hash(state); + self.totalhigh.hash(state); + self.freehigh.hash(state); + self.mem_unit.hash(state); + self.__reserved.hash(state); + } + } + + impl PartialEq for sockaddr_un { + fn eq(&self, other: &sockaddr_un) -> bool { + self.sun_family == other.sun_family + && self + .sun_path + .iter() + .zip(other.sun_path.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sockaddr_un {} + impl ::fmt::Debug for sockaddr_un { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_un") + .field("sun_family", &self.sun_family) + // FIXME: .field("sun_path", &self.sun_path) + .finish() + } + } + impl ::hash::Hash for sockaddr_un { + fn hash(&self, state: &mut H) { + self.sun_family.hash(state); + self.sun_path.hash(state); + } + } + + impl PartialEq for sockaddr_storage { + fn eq(&self, other: &sockaddr_storage) -> bool { + self.ss_family == other.ss_family + && self.__ss_align == other.__ss_align + && self + .__ss_pad2 + .iter() + .zip(other.__ss_pad2.iter()) + .all(|(a, b)| a == b) + } + } + impl Eq for sockaddr_storage {} + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("ss_family", &self.ss_family) + .field("__ss_align", &self.__ss_align) + // FIXME: .field("__ss_pad2", &self.__ss_pad2) + .finish() + } + } + impl ::hash::Hash for sockaddr_storage { + fn hash(&self, state: &mut H) { + self.ss_family.hash(state); + self.__ss_align.hash(state); + self.__ss_pad2.hash(state); + } + } + + impl PartialEq for utsname { + fn eq(&self, other: &utsname) -> bool { + self.sysname + .iter() + .zip(other.sysname.iter()) + .all(|(a,b)| a == b) + && self + .nodename + .iter() + .zip(other.nodename.iter()) + .all(|(a,b)| a == b) + && self + .release + .iter() + .zip(other.release.iter()) + .all(|(a,b)| a == b) + && self + .version + .iter() + .zip(other.version.iter()) + .all(|(a,b)| a == b) + && self + .machine + .iter() + .zip(other.machine.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for utsname {} + impl ::fmt::Debug for utsname { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utsname") + // FIXME: .field("sysname", &self.sysname) + // FIXME: .field("nodename", &self.nodename) + // FIXME: .field("release", &self.release) + // FIXME: .field("version", &self.version) + // FIXME: .field("machine", &self.machine) + .finish() + } + } + impl ::hash::Hash for utsname { + fn hash(&self, state: &mut H) { + self.sysname.hash(state); + self.nodename.hash(state); + self.release.hash(state); + self.version.hash(state); + self.machine.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_ino == other.d_ino + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_ino", &self.d_ino) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for dirent64 { + fn eq(&self, other: &dirent64) -> bool { + self.d_ino == other.d_ino + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent64 {} + impl ::fmt::Debug for dirent64 { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent64") + .field("d_ino", &self.d_ino) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + impl ::hash::Hash for dirent64 { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for mq_attr { + fn eq(&self, other: &mq_attr) -> bool { + self.mq_flags == other.mq_flags && + self.mq_maxmsg == other.mq_maxmsg && + self.mq_msgsize == other.mq_msgsize && + self.mq_curmsgs == other.mq_curmsgs + } + } + impl Eq for mq_attr {} + impl ::fmt::Debug for mq_attr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mq_attr") + .field("mq_flags", &self.mq_flags) + .field("mq_maxmsg", &self.mq_maxmsg) + .field("mq_msgsize", &self.mq_msgsize) + .field("mq_curmsgs", &self.mq_curmsgs) + .finish() + } + } + impl ::hash::Hash for mq_attr { + fn hash(&self, state: &mut H) { + self.mq_flags.hash(state); + self.mq_maxmsg.hash(state); + self.mq_msgsize.hash(state); + self.mq_curmsgs.hash(state); + } + } + + impl PartialEq for sockaddr_nl { + fn eq(&self, other: &sockaddr_nl) -> bool { + self.nl_family == other.nl_family && + self.nl_pid == other.nl_pid && + self.nl_groups == other.nl_groups + } + } + impl Eq for sockaddr_nl {} + impl ::fmt::Debug for sockaddr_nl { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_nl") + .field("nl_family", &self.nl_family) + .field("nl_pid", &self.nl_pid) + .field("nl_groups", &self.nl_groups) + .finish() + } + } + impl ::hash::Hash for sockaddr_nl { + fn hash(&self, state: &mut H) { + self.nl_family.hash(state); + self.nl_pid.hash(state); + self.nl_groups.hash(state); + } + } + + impl PartialEq for sigevent { + fn eq(&self, other: &sigevent) -> bool { + self.sigev_value == other.sigev_value + && self.sigev_signo == other.sigev_signo + && self.sigev_notify == other.sigev_notify + && self.sigev_notify_function + == other.sigev_notify_function + && self.sigev_notify_attributes + == other.sigev_notify_attributes + } + } + impl Eq for sigevent {} + impl ::fmt::Debug for sigevent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigevent") + .field("sigev_value", &self.sigev_value) + .field("sigev_signo", &self.sigev_signo) + .field("sigev_notify", &self.sigev_notify) + .field("sigev_notify_function", &self.sigev_notify_function) + .field("sigev_notify_attributes", + &self.sigev_notify_attributes) + .finish() + } + } + impl ::hash::Hash for sigevent { + fn hash(&self, state: &mut H) { + self.sigev_value.hash(state); + self.sigev_signo.hash(state); + self.sigev_notify.hash(state); + self.sigev_notify_function.hash(state); + self.sigev_notify_attributes.hash(state); + } + } + } +} + +// PUB_CONST + +pub const INT_MIN: c_int = -2147483648; +pub const INT_MAX: c_int = 2147483647; + +pub const SIG_DFL: sighandler_t = 0 as sighandler_t; +pub const SIG_IGN: sighandler_t = 1 as sighandler_t; +pub const SIG_ERR: sighandler_t = !0 as sighandler_t; + +pub const DT_UNKNOWN: u8 = 0; +pub const DT_FIFO: u8 = 1; +pub const DT_CHR: u8 = 2; +pub const DT_DIR: u8 = 4; +pub const DT_BLK: u8 = 6; +pub const DT_REG: u8 = 8; +pub const DT_LNK: u8 = 10; +pub const DT_SOCK: u8 = 12; + +pub const FD_CLOEXEC: ::c_int = 0x1; + +pub const USRQUOTA: ::c_int = 0; +pub const GRPQUOTA: ::c_int = 1; + +pub const SIGIOT: ::c_int = 6; + +pub const S_ISUID: ::c_int = 0x800; +pub const S_ISGID: ::c_int = 0x400; +pub const S_ISVTX: ::c_int = 0x200; + +pub const IF_NAMESIZE: ::size_t = 16; +pub const IFNAMSIZ: ::size_t = IF_NAMESIZE; + +pub const LOG_EMERG: ::c_int = 0; +pub const LOG_ALERT: ::c_int = 1; +pub const LOG_CRIT: ::c_int = 2; +pub const LOG_ERR: ::c_int = 3; +pub const LOG_WARNING: ::c_int = 4; +pub const LOG_NOTICE: ::c_int = 5; +pub const LOG_INFO: ::c_int = 6; +pub const LOG_DEBUG: ::c_int = 7; + +pub const LOG_KERN: ::c_int = 0; +pub const LOG_USER: ::c_int = 1 << 3; +pub const LOG_MAIL: ::c_int = 2 << 3; +pub const LOG_DAEMON: ::c_int = 3 << 3; +pub const LOG_AUTH: ::c_int = 4 << 3; +pub const LOG_SYSLOG: ::c_int = 5 << 3; +pub const LOG_LPR: ::c_int = 6 << 3; +pub const LOG_NEWS: ::c_int = 7 << 3; +pub const LOG_UUCP: ::c_int = 8 << 3; +pub const LOG_LOCAL0: ::c_int = 16 << 3; +pub const LOG_LOCAL1: ::c_int = 17 << 3; +pub const LOG_LOCAL2: ::c_int = 18 << 3; +pub const LOG_LOCAL3: ::c_int = 19 << 3; +pub const LOG_LOCAL4: ::c_int = 20 << 3; +pub const LOG_LOCAL5: ::c_int = 21 << 3; +pub const LOG_LOCAL6: ::c_int = 22 << 3; +pub const LOG_LOCAL7: ::c_int = 23 << 3; + +pub const LOG_PID: ::c_int = 0x01; +pub const LOG_CONS: ::c_int = 0x02; +pub const LOG_ODELAY: ::c_int = 0x04; +pub const LOG_NDELAY: ::c_int = 0x08; +pub const LOG_NOWAIT: ::c_int = 0x10; + +pub const LOG_PRIMASK: ::c_int = 7; +pub const LOG_FACMASK: ::c_int = 0x3f8; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +pub const PRIO_MIN: ::c_int = -20; +pub const PRIO_MAX: ::c_int = 20; + +pub const IPPROTO_ICMP: ::c_int = 1; +pub const IPPROTO_ICMPV6: ::c_int = 58; +pub const IPPROTO_TCP: ::c_int = 6; +pub const IPPROTO_UDP: ::c_int = 17; +pub const IPPROTO_IP: ::c_int = 0; +pub const IPPROTO_IPV6: ::c_int = 41; + +pub const INADDR_LOOPBACK: in_addr_t = 2130706433; +pub const INADDR_ANY: in_addr_t = 0; +pub const INADDR_BROADCAST: in_addr_t = 4294967295; +pub const INADDR_NONE: in_addr_t = 4294967295; + +pub const EXIT_FAILURE: ::c_int = 1; +pub const EXIT_SUCCESS: ::c_int = 0; +pub const RAND_MAX: ::c_int = 2147483647; +pub const EOF: ::c_int = -1; +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; +pub const _IOFBF: ::c_int = 0; +pub const _IONBF: ::c_int = 2; +pub const _IOLBF: ::c_int = 1; + +pub const F_DUPFD: ::c_int = 0; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; + +// Linux-specific fcntls +pub const F_SETLEASE: ::c_int = 1024; +pub const F_GETLEASE: ::c_int = 1025; +pub const F_NOTIFY: ::c_int = 1026; +pub const F_CANCELLK: ::c_int = 1029; +pub const F_DUPFD_CLOEXEC: ::c_int = 1030; +pub const F_SETPIPE_SZ: ::c_int = 1031; +pub const F_GETPIPE_SZ: ::c_int = 1032; +pub const F_ADD_SEALS: ::c_int = 1033; +pub const F_GET_SEALS: ::c_int = 1034; + +pub const F_SEAL_SEAL: ::c_int = 0x0001; +pub const F_SEAL_SHRINK: ::c_int = 0x0002; +pub const F_SEAL_GROW: ::c_int = 0x0004; +pub const F_SEAL_WRITE: ::c_int = 0x0008; + +// FIXME(#235): Include file sealing fcntls once we have a way to verify them. + +pub const SIGTRAP: ::c_int = 5; + +pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; +pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; + +pub const CLOCK_REALTIME: ::clockid_t = 0; +pub const CLOCK_MONOTONIC: ::clockid_t = 1; +pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2; +pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3; +pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4; +pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5; +pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6; +pub const CLOCK_BOOTTIME: ::clockid_t = 7; +pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8; +pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9; +pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; +pub const CLOCK_TAI: ::clockid_t = 11; +pub const TIMER_ABSTIME: ::c_int = 1; + +pub const RLIMIT_CPU: ::c_int = 0; +pub const RLIMIT_FSIZE: ::c_int = 1; +pub const RLIMIT_DATA: ::c_int = 2; +pub const RLIMIT_STACK: ::c_int = 3; +pub const RLIMIT_CORE: ::c_int = 4; +pub const RLIMIT_LOCKS: ::c_int = 10; +pub const RLIMIT_SIGPENDING: ::c_int = 11; +pub const RLIMIT_MSGQUEUE: ::c_int = 12; +pub const RLIMIT_NICE: ::c_int = 13; +pub const RLIMIT_RTPRIO: ::c_int = 14; + +pub const RUSAGE_SELF: ::c_int = 0; + +pub const O_RDONLY: ::c_int = 0; +pub const O_WRONLY: ::c_int = 1; +pub const O_RDWR: ::c_int = 2; + +pub const S_IFIFO: ::mode_t = 4096; +pub const S_IFCHR: ::mode_t = 8192; +pub const S_IFBLK: ::mode_t = 24576; +pub const S_IFDIR: ::mode_t = 16384; +pub const S_IFREG: ::mode_t = 32768; +pub const S_IFLNK: ::mode_t = 40960; +pub const S_IFSOCK: ::mode_t = 49152; +pub const S_IFMT: ::mode_t = 61440; +pub const S_IRWXU: ::mode_t = 448; +pub const S_IXUSR: ::mode_t = 64; +pub const S_IWUSR: ::mode_t = 128; +pub const S_IRUSR: ::mode_t = 256; +pub const S_IRWXG: ::mode_t = 56; +pub const S_IXGRP: ::mode_t = 8; +pub const S_IWGRP: ::mode_t = 16; +pub const S_IRGRP: ::mode_t = 32; +pub const S_IRWXO: ::mode_t = 7; +pub const S_IXOTH: ::mode_t = 1; +pub const S_IWOTH: ::mode_t = 2; +pub const S_IROTH: ::mode_t = 4; +pub const F_OK: ::c_int = 0; +pub const R_OK: ::c_int = 4; +pub const W_OK: ::c_int = 2; +pub const X_OK: ::c_int = 1; +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGABRT: ::c_int = 6; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGSEGV: ::c_int = 11; +pub const SIGPIPE: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; + +pub const PROT_NONE: ::c_int = 0; +pub const PROT_READ: ::c_int = 1; +pub const PROT_WRITE: ::c_int = 2; +pub const PROT_EXEC: ::c_int = 4; + +pub const LC_CTYPE: ::c_int = 0; +pub const LC_NUMERIC: ::c_int = 1; +pub const LC_TIME: ::c_int = 2; +pub const LC_COLLATE: ::c_int = 3; +pub const LC_MONETARY: ::c_int = 4; +pub const LC_MESSAGES: ::c_int = 5; +pub const LC_ALL: ::c_int = 6; +pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE; +pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC; +pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME; +pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE; +pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY; +pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES; +// LC_ALL_MASK defined per platform + +pub const MAP_FILE: ::c_int = 0x0000; +pub const MAP_SHARED: ::c_int = 0x0001; +pub const MAP_PRIVATE: ::c_int = 0x0002; +pub const MAP_FIXED: ::c_int = 0x0010; + +pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; + +// MS_ flags for msync(2) +pub const MS_ASYNC: ::c_int = 0x0001; +pub const MS_INVALIDATE: ::c_int = 0x0002; +pub const MS_SYNC: ::c_int = 0x0004; + +// MS_ flags for mount(2) +pub const MS_RDONLY: ::c_ulong = 0x01; +pub const MS_NOSUID: ::c_ulong = 0x02; +pub const MS_NODEV: ::c_ulong = 0x04; +pub const MS_NOEXEC: ::c_ulong = 0x08; +pub const MS_SYNCHRONOUS: ::c_ulong = 0x10; +pub const MS_REMOUNT: ::c_ulong = 0x20; +pub const MS_MANDLOCK: ::c_ulong = 0x40; +pub const MS_DIRSYNC: ::c_ulong = 0x80; +pub const MS_NOATIME: ::c_ulong = 0x0400; +pub const MS_NODIRATIME: ::c_ulong = 0x0800; +pub const MS_BIND: ::c_ulong = 0x1000; +pub const MS_MOVE: ::c_ulong = 0x2000; +pub const MS_REC: ::c_ulong = 0x4000; +pub const MS_SILENT: ::c_ulong = 0x8000; +pub const MS_POSIXACL: ::c_ulong = 0x010000; +pub const MS_UNBINDABLE: ::c_ulong = 0x020000; +pub const MS_PRIVATE: ::c_ulong = 0x040000; +pub const MS_SLAVE: ::c_ulong = 0x080000; +pub const MS_SHARED: ::c_ulong = 0x100000; +pub const MS_RELATIME: ::c_ulong = 0x200000; +pub const MS_KERNMOUNT: ::c_ulong = 0x400000; +pub const MS_I_VERSION: ::c_ulong = 0x800000; +pub const MS_STRICTATIME: ::c_ulong = 0x1000000; +pub const MS_ACTIVE: ::c_ulong = 0x40000000; +pub const MS_NOUSER: ::c_ulong = 0x80000000; +pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000; +pub const MS_MGC_MSK: ::c_ulong = 0xffff0000; +pub const MS_RMT_MASK: ::c_ulong = 0x800051; + +pub const EPERM: ::c_int = 1; +pub const ENOENT: ::c_int = 2; +pub const ESRCH: ::c_int = 3; +pub const EINTR: ::c_int = 4; +pub const EIO: ::c_int = 5; +pub const ENXIO: ::c_int = 6; +pub const E2BIG: ::c_int = 7; +pub const ENOEXEC: ::c_int = 8; +pub const EBADF: ::c_int = 9; +pub const ECHILD: ::c_int = 10; +pub const EAGAIN: ::c_int = 11; +pub const ENOMEM: ::c_int = 12; +pub const EACCES: ::c_int = 13; +pub const EFAULT: ::c_int = 14; +pub const ENOTBLK: ::c_int = 15; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENFILE: ::c_int = 23; +pub const EMFILE: ::c_int = 24; +pub const ENOTTY: ::c_int = 25; +pub const ETXTBSY: ::c_int = 26; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDOM: ::c_int = 33; +pub const ERANGE: ::c_int = 34; +pub const EWOULDBLOCK: ::c_int = EAGAIN; + +pub const SCM_RIGHTS: ::c_int = 0x01; +pub const SCM_CREDENTIALS: ::c_int = 0x02; + +pub const PROT_GROWSDOWN: ::c_int = 0x1000000; +pub const PROT_GROWSUP: ::c_int = 0x2000000; + +pub const MAP_TYPE: ::c_int = 0x000f; + +pub const MADV_NORMAL: ::c_int = 0; +pub const MADV_RANDOM: ::c_int = 1; +pub const MADV_SEQUENTIAL: ::c_int = 2; +pub const MADV_WILLNEED: ::c_int = 3; +pub const MADV_DONTNEED: ::c_int = 4; +pub const MADV_FREE: ::c_int = 8; +pub const MADV_REMOVE: ::c_int = 9; +pub const MADV_DONTFORK: ::c_int = 10; +pub const MADV_DOFORK: ::c_int = 11; +pub const MADV_MERGEABLE: ::c_int = 12; +pub const MADV_UNMERGEABLE: ::c_int = 13; +pub const MADV_HUGEPAGE: ::c_int = 14; +pub const MADV_NOHUGEPAGE: ::c_int = 15; +pub const MADV_DONTDUMP: ::c_int = 16; +pub const MADV_DODUMP: ::c_int = 17; +pub const MADV_HWPOISON: ::c_int = 100; +pub const MADV_SOFT_OFFLINE: ::c_int = 101; + +pub const IFF_UP: ::c_int = 0x1; +pub const IFF_BROADCAST: ::c_int = 0x2; +pub const IFF_DEBUG: ::c_int = 0x4; +pub const IFF_LOOPBACK: ::c_int = 0x8; +pub const IFF_POINTOPOINT: ::c_int = 0x10; +pub const IFF_NOTRAILERS: ::c_int = 0x20; +pub const IFF_RUNNING: ::c_int = 0x40; +pub const IFF_NOARP: ::c_int = 0x80; +pub const IFF_PROMISC: ::c_int = 0x100; +pub const IFF_ALLMULTI: ::c_int = 0x200; +pub const IFF_MASTER: ::c_int = 0x400; +pub const IFF_SLAVE: ::c_int = 0x800; +pub const IFF_MULTICAST: ::c_int = 0x1000; +pub const IFF_PORTSEL: ::c_int = 0x2000; +pub const IFF_AUTOMEDIA: ::c_int = 0x4000; +pub const IFF_DYNAMIC: ::c_int = 0x8000; +pub const IFF_TUN: ::c_int = 0x0001; +pub const IFF_TAP: ::c_int = 0x0002; +pub const IFF_NO_PI: ::c_int = 0x1000; + +pub const SOL_IP: ::c_int = 0; +pub const SOL_TCP: ::c_int = 6; +pub const SOL_UDP: ::c_int = 17; +pub const SOL_IPV6: ::c_int = 41; +pub const SOL_ICMPV6: ::c_int = 58; +pub const SOL_RAW: ::c_int = 255; +pub const SOL_DECNET: ::c_int = 261; +pub const SOL_X25: ::c_int = 262; +pub const SOL_PACKET: ::c_int = 263; +pub const SOL_ATM: ::c_int = 264; +pub const SOL_AAL: ::c_int = 265; +pub const SOL_IRDA: ::c_int = 266; +pub const SOL_NETBEUI: ::c_int = 267; +pub const SOL_LLC: ::c_int = 268; +pub const SOL_DCCP: ::c_int = 269; +pub const SOL_NETLINK: ::c_int = 270; +pub const SOL_TIPC: ::c_int = 271; + +pub const AF_UNSPEC: ::c_int = 0; +pub const AF_UNIX: ::c_int = 1; +pub const AF_LOCAL: ::c_int = 1; +pub const AF_INET: ::c_int = 2; +pub const AF_AX25: ::c_int = 3; +pub const AF_IPX: ::c_int = 4; +pub const AF_APPLETALK: ::c_int = 5; +pub const AF_NETROM: ::c_int = 6; +pub const AF_BRIDGE: ::c_int = 7; +pub const AF_ATMPVC: ::c_int = 8; +pub const AF_X25: ::c_int = 9; +pub const AF_INET6: ::c_int = 10; +pub const AF_ROSE: ::c_int = 11; +pub const AF_DECnet: ::c_int = 12; +pub const AF_NETBEUI: ::c_int = 13; +pub const AF_SECURITY: ::c_int = 14; +pub const AF_KEY: ::c_int = 15; +pub const AF_NETLINK: ::c_int = 16; +pub const AF_ROUTE: ::c_int = AF_NETLINK; +pub const AF_PACKET: ::c_int = 17; +pub const AF_ASH: ::c_int = 18; +pub const AF_ECONET: ::c_int = 19; +pub const AF_ATMSVC: ::c_int = 20; +pub const AF_RDS: ::c_int = 21; +pub const AF_SNA: ::c_int = 22; +pub const AF_IRDA: ::c_int = 23; +pub const AF_PPPOX: ::c_int = 24; +pub const AF_WANPIPE: ::c_int = 25; +pub const AF_LLC: ::c_int = 26; +pub const AF_CAN: ::c_int = 29; +pub const AF_TIPC: ::c_int = 30; +pub const AF_BLUETOOTH: ::c_int = 31; +pub const AF_IUCV: ::c_int = 32; +pub const AF_RXRPC: ::c_int = 33; +pub const AF_ISDN: ::c_int = 34; +pub const AF_PHONET: ::c_int = 35; +pub const AF_IEEE802154: ::c_int = 36; +pub const AF_CAIF: ::c_int = 37; +pub const AF_ALG: ::c_int = 38; + +pub const PF_UNSPEC: ::c_int = AF_UNSPEC; +pub const PF_UNIX: ::c_int = AF_UNIX; +pub const PF_LOCAL: ::c_int = AF_LOCAL; +pub const PF_INET: ::c_int = AF_INET; +pub const PF_AX25: ::c_int = AF_AX25; +pub const PF_IPX: ::c_int = AF_IPX; +pub const PF_APPLETALK: ::c_int = AF_APPLETALK; +pub const PF_NETROM: ::c_int = AF_NETROM; +pub const PF_BRIDGE: ::c_int = AF_BRIDGE; +pub const PF_ATMPVC: ::c_int = AF_ATMPVC; +pub const PF_X25: ::c_int = AF_X25; +pub const PF_INET6: ::c_int = AF_INET6; +pub const PF_ROSE: ::c_int = AF_ROSE; +pub const PF_DECnet: ::c_int = AF_DECnet; +pub const PF_NETBEUI: ::c_int = AF_NETBEUI; +pub const PF_SECURITY: ::c_int = AF_SECURITY; +pub const PF_KEY: ::c_int = AF_KEY; +pub const PF_NETLINK: ::c_int = AF_NETLINK; +pub const PF_ROUTE: ::c_int = AF_ROUTE; +pub const PF_PACKET: ::c_int = AF_PACKET; +pub const PF_ASH: ::c_int = AF_ASH; +pub const PF_ECONET: ::c_int = AF_ECONET; +pub const PF_ATMSVC: ::c_int = AF_ATMSVC; +pub const PF_RDS: ::c_int = AF_RDS; +pub const PF_SNA: ::c_int = AF_SNA; +pub const PF_IRDA: ::c_int = AF_IRDA; +pub const PF_PPPOX: ::c_int = AF_PPPOX; +pub const PF_WANPIPE: ::c_int = AF_WANPIPE; +pub const PF_LLC: ::c_int = AF_LLC; +pub const PF_CAN: ::c_int = AF_CAN; +pub const PF_TIPC: ::c_int = AF_TIPC; +pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; +pub const PF_IUCV: ::c_int = AF_IUCV; +pub const PF_RXRPC: ::c_int = AF_RXRPC; +pub const PF_ISDN: ::c_int = AF_ISDN; +pub const PF_PHONET: ::c_int = AF_PHONET; +pub const PF_IEEE802154: ::c_int = AF_IEEE802154; +pub const PF_CAIF: ::c_int = AF_CAIF; +pub const PF_ALG: ::c_int = AF_ALG; + +pub const SOMAXCONN: ::c_int = 128; + +pub const MSG_OOB: ::c_int = 1; +pub const MSG_PEEK: ::c_int = 2; +pub const MSG_DONTROUTE: ::c_int = 4; +pub const MSG_CTRUNC: ::c_int = 8; +pub const MSG_TRUNC: ::c_int = 0x20; +pub const MSG_DONTWAIT: ::c_int = 0x40; +pub const MSG_EOR: ::c_int = 0x80; +pub const MSG_WAITALL: ::c_int = 0x100; +pub const MSG_FIN: ::c_int = 0x200; +pub const MSG_SYN: ::c_int = 0x400; +pub const MSG_CONFIRM: ::c_int = 0x800; +pub const MSG_RST: ::c_int = 0x1000; +pub const MSG_ERRQUEUE: ::c_int = 0x2000; +pub const MSG_NOSIGNAL: ::c_int = 0x4000; +pub const MSG_MORE: ::c_int = 0x8000; +pub const MSG_WAITFORONE: ::c_int = 0x10000; +pub const MSG_FASTOPEN: ::c_int = 0x20000000; +pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000; + +pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; + +pub const SOCK_RAW: ::c_int = 3; +pub const SOCK_RDM: ::c_int = 4; + +pub const IP_TOS: ::c_int = 1; +pub const IP_TTL: ::c_int = 2; +pub const IP_HDRINCL: ::c_int = 3; +pub const IP_RECVTOS: ::c_int = 13; +pub const IP_FREEBIND: ::c_int = 15; +pub const IP_TRANSPARENT: ::c_int = 19; +pub const IP_MULTICAST_IF: ::c_int = 32; +pub const IP_MULTICAST_TTL: ::c_int = 33; +pub const IP_MULTICAST_LOOP: ::c_int = 34; +pub const IP_ADD_MEMBERSHIP: ::c_int = 35; +pub const IP_DROP_MEMBERSHIP: ::c_int = 36; + +pub const IPV6_UNICAST_HOPS: ::c_int = 16; +pub const IPV6_MULTICAST_IF: ::c_int = 17; +pub const IPV6_MULTICAST_HOPS: ::c_int = 18; +pub const IPV6_MULTICAST_LOOP: ::c_int = 19; +pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20; +pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21; +pub const IPV6_V6ONLY: ::c_int = 26; +pub const IPV6_RECVPKTINFO: ::c_int = 49; +pub const IPV6_RECVTCLASS: ::c_int = 66; +pub const IPV6_TCLASS: ::c_int = 67; + +pub const TCP_NODELAY: ::c_int = 1; +pub const TCP_MAXSEG: ::c_int = 2; +pub const TCP_CORK: ::c_int = 3; +pub const TCP_KEEPIDLE: ::c_int = 4; +pub const TCP_KEEPINTVL: ::c_int = 5; +pub const TCP_KEEPCNT: ::c_int = 6; +pub const TCP_SYNCNT: ::c_int = 7; +pub const TCP_LINGER2: ::c_int = 8; +pub const TCP_DEFER_ACCEPT: ::c_int = 9; +pub const TCP_WINDOW_CLAMP: ::c_int = 10; +pub const TCP_INFO: ::c_int = 11; +pub const TCP_QUICKACK: ::c_int = 12; +pub const TCP_CONGESTION: ::c_int = 13; + +pub const SO_DEBUG: ::c_int = 1; + +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; + +pub const LOCK_SH: ::c_int = 1; +pub const LOCK_EX: ::c_int = 2; +pub const LOCK_NB: ::c_int = 4; +pub const LOCK_UN: ::c_int = 8; + +pub const SS_ONSTACK: ::c_int = 1; +pub const SS_DISABLE: ::c_int = 2; + +pub const PATH_MAX: ::c_int = 4096; + +pub const FD_SETSIZE: usize = 1024; + +pub const EPOLLIN: ::c_int = 0x1; +pub const EPOLLPRI: ::c_int = 0x2; +pub const EPOLLOUT: ::c_int = 0x4; +pub const EPOLLRDNORM: ::c_int = 0x40; +pub const EPOLLRDBAND: ::c_int = 0x80; +pub const EPOLLWRNORM: ::c_int = 0x100; +pub const EPOLLWRBAND: ::c_int = 0x200; +pub const EPOLLMSG: ::c_int = 0x400; +pub const EPOLLERR: ::c_int = 0x8; +pub const EPOLLHUP: ::c_int = 0x10; +pub const EPOLLET: ::c_int = 0x80000000; + +pub const EPOLL_CTL_ADD: ::c_int = 1; +pub const EPOLL_CTL_MOD: ::c_int = 3; +pub const EPOLL_CTL_DEL: ::c_int = 2; + +pub const MNT_DETACH: ::c_int = 0x2; +pub const MNT_EXPIRE: ::c_int = 0x4; + +pub const Q_GETFMT: ::c_int = 0x800004; +pub const Q_GETINFO: ::c_int = 0x800005; +pub const Q_SETINFO: ::c_int = 0x800006; +pub const QIF_BLIMITS: u32 = 1; +pub const QIF_SPACE: u32 = 2; +pub const QIF_ILIMITS: u32 = 4; +pub const QIF_INODES: u32 = 8; +pub const QIF_BTIME: u32 = 16; +pub const QIF_ITIME: u32 = 32; +pub const QIF_LIMITS: u32 = 5; +pub const QIF_USAGE: u32 = 10; +pub const QIF_TIMES: u32 = 48; +pub const QIF_ALL: u32 = 63; + +pub const MNT_FORCE: ::c_int = 0x1; + +pub const Q_SYNC: ::c_int = 0x800001; +pub const Q_QUOTAON: ::c_int = 0x800002; +pub const Q_QUOTAOFF: ::c_int = 0x800003; +pub const Q_GETQUOTA: ::c_int = 0x800007; +pub const Q_SETQUOTA: ::c_int = 0x800008; + +pub const TCIOFF: ::c_int = 2; +pub const TCION: ::c_int = 3; +pub const TCOOFF: ::c_int = 0; +pub const TCOON: ::c_int = 1; +pub const TCIFLUSH: ::c_int = 0; +pub const TCOFLUSH: ::c_int = 1; +pub const TCIOFLUSH: ::c_int = 2; +pub const NL0: ::c_int = 0x00000000; +pub const NL1: ::c_int = 0x00000100; +pub const TAB0: ::c_int = 0x00000000; +pub const CR0: ::c_int = 0x00000000; +pub const FF0: ::c_int = 0x00000000; +pub const BS0: ::c_int = 0x00000000; +pub const VT0: ::c_int = 0x00000000; +pub const VERASE: usize = 2; +pub const VKILL: usize = 3; +pub const VINTR: usize = 0; +pub const VQUIT: usize = 1; +pub const VLNEXT: usize = 15; +pub const IGNBRK: ::tcflag_t = 0x00000001; +pub const BRKINT: ::tcflag_t = 0x00000002; +pub const IGNPAR: ::tcflag_t = 0x00000004; +pub const PARMRK: ::tcflag_t = 0x00000008; +pub const INPCK: ::tcflag_t = 0x00000010; +pub const ISTRIP: ::tcflag_t = 0x00000020; +pub const INLCR: ::tcflag_t = 0x00000040; +pub const IGNCR: ::tcflag_t = 0x00000080; +pub const ICRNL: ::tcflag_t = 0x00000100; +pub const IXANY: ::tcflag_t = 0x00000800; +pub const IMAXBEL: ::tcflag_t = 0x00002000; +pub const OPOST: ::tcflag_t = 0x1; +pub const CS5: ::tcflag_t = 0x00000000; +pub const CRTSCTS: ::tcflag_t = 0x80000000; +pub const ECHO: ::tcflag_t = 0x00000008; +pub const OCRNL: ::tcflag_t = 0o000010; +pub const ONOCR: ::tcflag_t = 0o000020; +pub const ONLRET: ::tcflag_t = 0o000040; +pub const OFILL: ::tcflag_t = 0o000100; +pub const OFDEL: ::tcflag_t = 0o000200; + +pub const CLONE_VM: ::c_int = 0x100; +pub const CLONE_FS: ::c_int = 0x200; +pub const CLONE_FILES: ::c_int = 0x400; +pub const CLONE_SIGHAND: ::c_int = 0x800; +pub const CLONE_PTRACE: ::c_int = 0x2000; +pub const CLONE_VFORK: ::c_int = 0x4000; +pub const CLONE_PARENT: ::c_int = 0x8000; +pub const CLONE_THREAD: ::c_int = 0x10000; +pub const CLONE_NEWNS: ::c_int = 0x20000; +pub const CLONE_SYSVSEM: ::c_int = 0x40000; +pub const CLONE_SETTLS: ::c_int = 0x80000; +pub const CLONE_PARENT_SETTID: ::c_int = 0x100000; +pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000; +pub const CLONE_DETACHED: ::c_int = 0x400000; +pub const CLONE_UNTRACED: ::c_int = 0x800000; +pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000; +pub const CLONE_NEWUTS: ::c_int = 0x04000000; +pub const CLONE_NEWIPC: ::c_int = 0x08000000; +pub const CLONE_NEWUSER: ::c_int = 0x10000000; +pub const CLONE_NEWPID: ::c_int = 0x20000000; +pub const CLONE_NEWNET: ::c_int = 0x40000000; +pub const CLONE_IO: ::c_int = 0x80000000; +pub const CLONE_NEWCGROUP: ::c_int = 0x02000000; + +pub const WNOHANG: ::c_int = 0x00000001; +pub const WUNTRACED: ::c_int = 0x00000002; +pub const WSTOPPED: ::c_int = WUNTRACED; +pub const WEXITED: ::c_int = 0x00000004; +pub const WCONTINUED: ::c_int = 0x00000008; +pub const WNOWAIT: ::c_int = 0x01000000; + +// ::Options set using PTRACE_SETOPTIONS. +pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001; +pub const PTRACE_O_TRACEFORK: ::c_int = 0x00000002; +pub const PTRACE_O_TRACEVFORK: ::c_int = 0x00000004; +pub const PTRACE_O_TRACECLONE: ::c_int = 0x00000008; +pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010; +pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020; +pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040; +pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080; +pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000; +pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000; +pub const PTRACE_O_MASK: ::c_int = 0x003000ff; + +// Wait extended result codes for the above trace options. +pub const PTRACE_EVENT_FORK: ::c_int = 1; +pub const PTRACE_EVENT_VFORK: ::c_int = 2; +pub const PTRACE_EVENT_CLONE: ::c_int = 3; +pub const PTRACE_EVENT_EXEC: ::c_int = 4; +pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5; +pub const PTRACE_EVENT_EXIT: ::c_int = 6; +pub const PTRACE_EVENT_SECCOMP: ::c_int = 7; +// PTRACE_EVENT_STOP was added to glibc in 2.26 +// pub const PTRACE_EVENT_STOP: ::c_int = 128; + +pub const __WNOTHREAD: ::c_int = 0x20000000; +pub const __WALL: ::c_int = 0x40000000; +pub const __WCLONE: ::c_int = 0x80000000; + +pub const SPLICE_F_MOVE: ::c_uint = 0x01; +pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02; +pub const SPLICE_F_MORE: ::c_uint = 0x04; +pub const SPLICE_F_GIFT: ::c_uint = 0x08; + +pub const RTLD_LOCAL: ::c_int = 0; +pub const RTLD_LAZY: ::c_int = 1; + +pub const POSIX_FADV_NORMAL: ::c_int = 0; +pub const POSIX_FADV_RANDOM: ::c_int = 1; +pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_FADV_WILLNEED: ::c_int = 3; + +pub const AT_FDCWD: ::c_int = -100; +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100; +pub const AT_REMOVEDIR: ::c_int = 0x200; +pub const AT_EACCESS: ::c_int = 0x200; +pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; +pub const AT_NO_AUTOMOUNT: ::c_int = 0x800; +pub const AT_EMPTY_PATH: ::c_int = 0x1000; + +pub const LOG_CRON: ::c_int = 9 << 3; +pub const LOG_AUTHPRIV: ::c_int = 10 << 3; +pub const LOG_FTP: ::c_int = 11 << 3; +pub const LOG_PERROR: ::c_int = 0x20; + +pub const PIPE_BUF: usize = 4096; + +pub const SI_LOAD_SHIFT: ::c_uint = 16; + +pub const CLD_EXITED: ::c_int = 1; +pub const CLD_KILLED: ::c_int = 2; +pub const CLD_DUMPED: ::c_int = 3; +pub const CLD_TRAPPED: ::c_int = 4; +pub const CLD_STOPPED: ::c_int = 5; +pub const CLD_CONTINUED: ::c_int = 6; + +pub const SIGEV_SIGNAL: ::c_int = 0; +pub const SIGEV_NONE: ::c_int = 1; +pub const SIGEV_THREAD: ::c_int = 2; + +pub const P_ALL: idtype_t = 0; +pub const P_PID: idtype_t = 1; +pub const P_PGID: idtype_t = 2; + +pub const UTIME_OMIT: c_long = 1073741822; +pub const UTIME_NOW: c_long = 1073741823; + +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; +pub const POLLRDNORM: ::c_short = 0x040; +pub const POLLRDBAND: ::c_short = 0x080; + +pub const ABDAY_1: ::nl_item = 0x20000; +pub const ABDAY_2: ::nl_item = 0x20001; +pub const ABDAY_3: ::nl_item = 0x20002; +pub const ABDAY_4: ::nl_item = 0x20003; +pub const ABDAY_5: ::nl_item = 0x20004; +pub const ABDAY_6: ::nl_item = 0x20005; +pub const ABDAY_7: ::nl_item = 0x20006; + +pub const DAY_1: ::nl_item = 0x20007; +pub const DAY_2: ::nl_item = 0x20008; +pub const DAY_3: ::nl_item = 0x20009; +pub const DAY_4: ::nl_item = 0x2000A; +pub const DAY_5: ::nl_item = 0x2000B; +pub const DAY_6: ::nl_item = 0x2000C; +pub const DAY_7: ::nl_item = 0x2000D; + +pub const ABMON_1: ::nl_item = 0x2000E; +pub const ABMON_2: ::nl_item = 0x2000F; +pub const ABMON_3: ::nl_item = 0x20010; +pub const ABMON_4: ::nl_item = 0x20011; +pub const ABMON_5: ::nl_item = 0x20012; +pub const ABMON_6: ::nl_item = 0x20013; +pub const ABMON_7: ::nl_item = 0x20014; +pub const ABMON_8: ::nl_item = 0x20015; +pub const ABMON_9: ::nl_item = 0x20016; +pub const ABMON_10: ::nl_item = 0x20017; +pub const ABMON_11: ::nl_item = 0x20018; +pub const ABMON_12: ::nl_item = 0x20019; + +pub const MON_1: ::nl_item = 0x2001A; +pub const MON_2: ::nl_item = 0x2001B; +pub const MON_3: ::nl_item = 0x2001C; +pub const MON_4: ::nl_item = 0x2001D; +pub const MON_5: ::nl_item = 0x2001E; +pub const MON_6: ::nl_item = 0x2001F; +pub const MON_7: ::nl_item = 0x20020; +pub const MON_8: ::nl_item = 0x20021; +pub const MON_9: ::nl_item = 0x20022; +pub const MON_10: ::nl_item = 0x20023; +pub const MON_11: ::nl_item = 0x20024; +pub const MON_12: ::nl_item = 0x20025; + +pub const AM_STR: ::nl_item = 0x20026; +pub const PM_STR: ::nl_item = 0x20027; + +pub const D_T_FMT: ::nl_item = 0x20028; +pub const D_FMT: ::nl_item = 0x20029; +pub const T_FMT: ::nl_item = 0x2002A; +pub const T_FMT_AMPM: ::nl_item = 0x2002B; + +pub const ERA: ::nl_item = 0x2002C; +pub const ERA_D_FMT: ::nl_item = 0x2002E; +pub const ALT_DIGITS: ::nl_item = 0x2002F; +pub const ERA_D_T_FMT: ::nl_item = 0x20030; +pub const ERA_T_FMT: ::nl_item = 0x20031; + +pub const CODESET: ::nl_item = 14; + +pub const CRNCYSTR: ::nl_item = 0x4000F; + +pub const RUSAGE_THREAD: ::c_int = 1; +pub const RUSAGE_CHILDREN: ::c_int = -1; + +pub const RADIXCHAR: ::nl_item = 0x10000; +pub const THOUSEP: ::nl_item = 0x10001; + +pub const YESEXPR: ::nl_item = 0x50000; +pub const NOEXPR: ::nl_item = 0x50001; +pub const YESSTR: ::nl_item = 0x50002; +pub const NOSTR: ::nl_item = 0x50003; + +pub const FILENAME_MAX: ::c_uint = 4096; +pub const L_tmpnam: ::c_uint = 20; +pub const _PC_LINK_MAX: ::c_int = 0; +pub const _PC_MAX_CANON: ::c_int = 1; +pub const _PC_MAX_INPUT: ::c_int = 2; +pub const _PC_NAME_MAX: ::c_int = 3; +pub const _PC_PATH_MAX: ::c_int = 4; +pub const _PC_PIPE_BUF: ::c_int = 5; +pub const _PC_CHOWN_RESTRICTED: ::c_int = 6; +pub const _PC_NO_TRUNC: ::c_int = 7; +pub const _PC_VDISABLE: ::c_int = 8; +pub const _PC_SYNC_IO: ::c_int = 9; +pub const _PC_ASYNC_IO: ::c_int = 10; +pub const _PC_PRIO_IO: ::c_int = 11; +pub const _PC_SOCK_MAXBUF: ::c_int = 12; +pub const _PC_FILESIZEBITS: ::c_int = 13; +pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14; +pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15; +pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16; +pub const _PC_REC_XFER_ALIGN: ::c_int = 17; +pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18; +pub const _PC_SYMLINK_MAX: ::c_int = 19; +pub const _PC_2_SYMLINKS: ::c_int = 20; + +pub const _SC_ARG_MAX: ::c_int = 0; +pub const _SC_CHILD_MAX: ::c_int = 1; +pub const _SC_CLK_TCK: ::c_int = 2; +pub const _SC_NGROUPS_MAX: ::c_int = 3; +pub const _SC_OPEN_MAX: ::c_int = 4; +pub const _SC_STREAM_MAX: ::c_int = 5; +pub const _SC_TZNAME_MAX: ::c_int = 6; +pub const _SC_JOB_CONTROL: ::c_int = 7; +pub const _SC_SAVED_IDS: ::c_int = 8; +pub const _SC_REALTIME_SIGNALS: ::c_int = 9; +pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10; +pub const _SC_TIMERS: ::c_int = 11; +pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12; +pub const _SC_PRIORITIZED_IO: ::c_int = 13; +pub const _SC_SYNCHRONIZED_IO: ::c_int = 14; +pub const _SC_FSYNC: ::c_int = 15; +pub const _SC_MAPPED_FILES: ::c_int = 16; +pub const _SC_MEMLOCK: ::c_int = 17; +pub const _SC_MEMLOCK_RANGE: ::c_int = 18; +pub const _SC_MEMORY_PROTECTION: ::c_int = 19; +pub const _SC_MESSAGE_PASSING: ::c_int = 20; +pub const _SC_SEMAPHORES: ::c_int = 21; +pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22; +pub const _SC_AIO_LISTIO_MAX: ::c_int = 23; +pub const _SC_AIO_MAX: ::c_int = 24; +pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25; +pub const _SC_DELAYTIMER_MAX: ::c_int = 26; +pub const _SC_MQ_OPEN_MAX: ::c_int = 27; +pub const _SC_MQ_PRIO_MAX: ::c_int = 28; +pub const _SC_VERSION: ::c_int = 29; +pub const _SC_PAGESIZE: ::c_int = 30; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; +pub const _SC_RTSIG_MAX: ::c_int = 31; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 32; +pub const _SC_SEM_VALUE_MAX: ::c_int = 33; +pub const _SC_SIGQUEUE_MAX: ::c_int = 34; +pub const _SC_TIMER_MAX: ::c_int = 35; +pub const _SC_BC_BASE_MAX: ::c_int = 36; +pub const _SC_BC_DIM_MAX: ::c_int = 37; +pub const _SC_BC_SCALE_MAX: ::c_int = 38; +pub const _SC_BC_STRING_MAX: ::c_int = 39; +pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40; +pub const _SC_EXPR_NEST_MAX: ::c_int = 42; +pub const _SC_LINE_MAX: ::c_int = 43; +pub const _SC_RE_DUP_MAX: ::c_int = 44; +pub const _SC_2_VERSION: ::c_int = 46; +pub const _SC_2_C_BIND: ::c_int = 47; +pub const _SC_2_C_DEV: ::c_int = 48; +pub const _SC_2_FORT_DEV: ::c_int = 49; +pub const _SC_2_FORT_RUN: ::c_int = 50; +pub const _SC_2_SW_DEV: ::c_int = 51; +pub const _SC_2_LOCALEDEF: ::c_int = 52; +pub const _SC_UIO_MAXIOV: ::c_int = 60; +pub const _SC_IOV_MAX: ::c_int = 60; +pub const _SC_THREADS: ::c_int = 67; +pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70; +pub const _SC_LOGIN_NAME_MAX: ::c_int = 71; +pub const _SC_TTY_NAME_MAX: ::c_int = 72; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73; +pub const _SC_THREAD_KEYS_MAX: ::c_int = 74; +pub const _SC_THREAD_STACK_MIN: ::c_int = 75; +pub const _SC_THREAD_THREADS_MAX: ::c_int = 76; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79; +pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80; +pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82; +pub const _SC_NPROCESSORS_CONF: ::c_int = 83; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 84; +pub const _SC_PHYS_PAGES: ::c_int = 85; +pub const _SC_AVPHYS_PAGES: ::c_int = 86; +pub const _SC_ATEXIT_MAX: ::c_int = 87; +pub const _SC_PASS_MAX: ::c_int = 88; +pub const _SC_XOPEN_VERSION: ::c_int = 89; +pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90; +pub const _SC_XOPEN_UNIX: ::c_int = 91; +pub const _SC_XOPEN_CRYPT: ::c_int = 92; +pub const _SC_XOPEN_ENH_I18N: ::c_int = 93; +pub const _SC_XOPEN_SHM: ::c_int = 94; +pub const _SC_2_CHAR_TERM: ::c_int = 95; +pub const _SC_2_UPE: ::c_int = 97; +pub const _SC_XOPEN_XPG2: ::c_int = 98; +pub const _SC_XOPEN_XPG3: ::c_int = 99; +pub const _SC_XOPEN_XPG4: ::c_int = 100; +pub const _SC_NZERO: ::c_int = 109; +pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125; +pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126; +pub const _SC_XBS5_LP64_OFF64: ::c_int = 127; +pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128; +pub const _SC_XOPEN_LEGACY: ::c_int = 129; +pub const _SC_XOPEN_REALTIME: ::c_int = 130; +pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131; +pub const _SC_ADVISORY_INFO: ::c_int = 132; +pub const _SC_BARRIERS: ::c_int = 133; +pub const _SC_CLOCK_SELECTION: ::c_int = 137; +pub const _SC_CPUTIME: ::c_int = 138; +pub const _SC_THREAD_CPUTIME: ::c_int = 139; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 149; +pub const _SC_READER_WRITER_LOCKS: ::c_int = 153; +pub const _SC_SPIN_LOCKS: ::c_int = 154; +pub const _SC_REGEXP: ::c_int = 155; +pub const _SC_SHELL: ::c_int = 157; +pub const _SC_SPAWN: ::c_int = 159; +pub const _SC_SPORADIC_SERVER: ::c_int = 160; +pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161; +pub const _SC_TIMEOUTS: ::c_int = 164; +pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165; +pub const _SC_2_PBS: ::c_int = 168; +pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169; +pub const _SC_2_PBS_LOCATE: ::c_int = 170; +pub const _SC_2_PBS_MESSAGE: ::c_int = 171; +pub const _SC_2_PBS_TRACK: ::c_int = 172; +pub const _SC_SYMLOOP_MAX: ::c_int = 173; +pub const _SC_STREAMS: ::c_int = 174; +pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175; +pub const _SC_V6_ILP32_OFF32: ::c_int = 176; +pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177; +pub const _SC_V6_LP64_OFF64: ::c_int = 178; +pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179; +pub const _SC_HOST_NAME_MAX: ::c_int = 180; +pub const _SC_TRACE: ::c_int = 181; +pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182; +pub const _SC_TRACE_INHERIT: ::c_int = 183; +pub const _SC_TRACE_LOG: ::c_int = 184; +pub const _SC_IPV6: ::c_int = 235; +pub const _SC_RAW_SOCKETS: ::c_int = 236; +pub const _SC_V7_ILP32_OFF32: ::c_int = 237; +pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238; +pub const _SC_V7_LP64_OFF64: ::c_int = 239; +pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240; +pub const _SC_SS_REPL_MAX: ::c_int = 241; +pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242; +pub const _SC_TRACE_NAME_MAX: ::c_int = 243; +pub const _SC_TRACE_SYS_MAX: ::c_int = 244; +pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245; +pub const _SC_XOPEN_STREAMS: ::c_int = 246; +pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247; +pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248; + +pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY; +pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY; + +pub const GLOB_ERR: ::c_int = 1 << 0; +pub const GLOB_MARK: ::c_int = 1 << 1; +pub const GLOB_NOSORT: ::c_int = 1 << 2; +pub const GLOB_DOOFFS: ::c_int = 1 << 3; +pub const GLOB_NOCHECK: ::c_int = 1 << 4; +pub const GLOB_APPEND: ::c_int = 1 << 5; +pub const GLOB_NOESCAPE: ::c_int = 1 << 6; + +pub const GLOB_NOSPACE: ::c_int = 1; +pub const GLOB_ABORTED: ::c_int = 2; +pub const GLOB_NOMATCH: ::c_int = 3; + +pub const POSIX_MADV_NORMAL: ::c_int = 0; +pub const POSIX_MADV_RANDOM: ::c_int = 1; +pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_MADV_WILLNEED: ::c_int = 3; + +pub const S_IEXEC: mode_t = 64; +pub const S_IWRITE: mode_t = 128; +pub const S_IREAD: mode_t = 256; + +pub const F_LOCK: ::c_int = 1; +pub const F_TEST: ::c_int = 3; +pub const F_TLOCK: ::c_int = 2; +pub const F_ULOCK: ::c_int = 0; + +pub const IFF_LOWER_UP: ::c_int = 0x10000; +pub const IFF_DORMANT: ::c_int = 0x20000; +pub const IFF_ECHO: ::c_int = 0x40000; + +pub const ST_RDONLY: ::c_ulong = 1; +pub const ST_NOSUID: ::c_ulong = 2; +pub const ST_NODEV: ::c_ulong = 4; +pub const ST_NOEXEC: ::c_ulong = 8; +pub const ST_SYNCHRONOUS: ::c_ulong = 16; +pub const ST_MANDLOCK: ::c_ulong = 64; +pub const ST_WRITE: ::c_ulong = 128; +pub const ST_APPEND: ::c_ulong = 256; +pub const ST_IMMUTABLE: ::c_ulong = 512; +pub const ST_NOATIME: ::c_ulong = 1024; +pub const ST_NODIRATIME: ::c_ulong = 2048; + +pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void; +pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; +pub const RTLD_NODELETE: ::c_int = 0x1000; +pub const RTLD_NOW: ::c_int = 0x2; + +pub const TCP_MD5SIG: ::c_int = 14; + +align_const! { + pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + size: [0; __SIZEOF_PTHREAD_MUTEX_T], + }; + pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + size: [0; __SIZEOF_PTHREAD_COND_T], + }; + pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + size: [0; __SIZEOF_PTHREAD_RWLOCK_T], + }; +} +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; +pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0; +pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; +pub const __SIZEOF_PTHREAD_COND_T: usize = 48; + +pub const RENAME_NOREPLACE: ::c_int = 1; +pub const RENAME_EXCHANGE: ::c_int = 2; +pub const RENAME_WHITEOUT: ::c_int = 4; + +pub const SCHED_OTHER: ::c_int = 0; +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_RR: ::c_int = 2; +pub const SCHED_BATCH: ::c_int = 3; +pub const SCHED_IDLE: ::c_int = 5; + +// netinet/in.h +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// Hop-by-hop option header +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +// IPPROTO_UDP defined in src/unix/mod.rs +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// DCCP +pub const IPPROTO_DCCP: ::c_int = 33; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +pub const IPPROTO_MTP: ::c_int = 92; +pub const IPPROTO_BEETPH: ::c_int = 94; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// Protocol indep. multicast +pub const IPPROTO_PIM: ::c_int = 103; +/// IP Payload Comp. Protocol +pub const IPPROTO_COMP: ::c_int = 108; +/// SCTP +pub const IPPROTO_SCTP: ::c_int = 132; +pub const IPPROTO_MH: ::c_int = 135; +pub const IPPROTO_UDPLITE: ::c_int = 136; +pub const IPPROTO_MPLS: ::c_int = 137; +/// raw IP packet +pub const IPPROTO_RAW: ::c_int = 255; +pub const IPPROTO_MAX: ::c_int = 256; + +pub const AF_IB: ::c_int = 27; +pub const AF_MPLS: ::c_int = 28; +pub const AF_NFC: ::c_int = 39; +pub const AF_VSOCK: ::c_int = 40; +pub const PF_IB: ::c_int = AF_IB; +pub const PF_MPLS: ::c_int = AF_MPLS; +pub const PF_NFC: ::c_int = AF_NFC; +pub const PF_VSOCK: ::c_int = AF_VSOCK; + +// System V IPC +pub const IPC_PRIVATE: ::key_t = 0; + +pub const IPC_CREAT: ::c_int = 0o1000; +pub const IPC_EXCL: ::c_int = 0o2000; +pub const IPC_NOWAIT: ::c_int = 0o4000; + +pub const IPC_RMID: ::c_int = 0; +pub const IPC_SET: ::c_int = 1; +pub const IPC_STAT: ::c_int = 2; +pub const IPC_INFO: ::c_int = 3; +pub const MSG_STAT: ::c_int = 11; +pub const MSG_INFO: ::c_int = 12; + +pub const MSG_NOERROR: ::c_int = 0o10000; +pub const MSG_EXCEPT: ::c_int = 0o20000; +pub const MSG_COPY: ::c_int = 0o40000; + +pub const SHM_R: ::c_int = 0o400; +pub const SHM_W: ::c_int = 0o200; + +pub const SHM_RDONLY: ::c_int = 0o10000; +pub const SHM_RND: ::c_int = 0o20000; +pub const SHM_REMAP: ::c_int = 0o40000; +pub const SHM_EXEC: ::c_int = 0o100000; + +pub const SHM_LOCK: ::c_int = 11; +pub const SHM_UNLOCK: ::c_int = 12; + +pub const SHM_HUGETLB: ::c_int = 0o4000; +pub const SHM_NORESERVE: ::c_int = 0o10000; + +pub const EPOLLRDHUP: ::c_int = 0x2000; +pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000; +pub const EPOLLONESHOT: ::c_int = 0x40000000; + +pub const QFMT_VFS_OLD: ::c_int = 1; +pub const QFMT_VFS_V0: ::c_int = 2; +pub const QFMT_VFS_V1: ::c_int = 4; + +pub const EFD_SEMAPHORE: ::c_int = 0x1; + +pub const LOG_NFACILITIES: ::c_int = 24; + +pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t; + +pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32; +pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32; +pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32; +pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32; +pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32; +pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32; +pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32; + +pub const AI_PASSIVE: ::c_int = 0x0001; +pub const AI_CANONNAME: ::c_int = 0x0002; +pub const AI_NUMERICHOST: ::c_int = 0x0004; +pub const AI_V4MAPPED: ::c_int = 0x0008; +pub const AI_ALL: ::c_int = 0x0010; +pub const AI_ADDRCONFIG: ::c_int = 0x0020; + +pub const AI_NUMERICSERV: ::c_int = 0x0400; + +pub const EAI_BADFLAGS: ::c_int = -1; +pub const EAI_NONAME: ::c_int = -2; +pub const EAI_AGAIN: ::c_int = -3; +pub const EAI_FAIL: ::c_int = -4; +pub const EAI_FAMILY: ::c_int = -6; +pub const EAI_SOCKTYPE: ::c_int = -7; +pub const EAI_SERVICE: ::c_int = -8; +pub const EAI_MEMORY: ::c_int = -10; +pub const EAI_OVERFLOW: ::c_int = -12; + +pub const NI_NUMERICHOST: ::c_int = 1; +pub const NI_NUMERICSERV: ::c_int = 2; +pub const NI_NOFQDN: ::c_int = 4; +pub const NI_NAMEREQD: ::c_int = 8; +pub const NI_DGRAM: ::c_int = 16; + +pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1; +pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2; +pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4; + +pub const EAI_SYSTEM: ::c_int = -11; + +pub const AIO_CANCELED: ::c_int = 0; +pub const AIO_NOTCANCELED: ::c_int = 1; +pub const AIO_ALLDONE: ::c_int = 2; +pub const LIO_READ: ::c_int = 0; +pub const LIO_WRITE: ::c_int = 1; +pub const LIO_NOP: ::c_int = 2; +pub const LIO_WAIT: ::c_int = 0; +pub const LIO_NOWAIT: ::c_int = 1; + +pub const MREMAP_MAYMOVE: ::c_int = 1; +pub const MREMAP_FIXED: ::c_int = 2; + +pub const PR_SET_PDEATHSIG: ::c_int = 1; +pub const PR_GET_PDEATHSIG: ::c_int = 2; + +pub const PR_GET_DUMPABLE: ::c_int = 3; +pub const PR_SET_DUMPABLE: ::c_int = 4; + +pub const PR_GET_UNALIGN: ::c_int = 5; +pub const PR_SET_UNALIGN: ::c_int = 6; +pub const PR_UNALIGN_NOPRINT: ::c_int = 1; +pub const PR_UNALIGN_SIGBUS: ::c_int = 2; + +pub const PR_GET_KEEPCAPS: ::c_int = 7; +pub const PR_SET_KEEPCAPS: ::c_int = 8; + +pub const PR_GET_FPEMU: ::c_int = 9; +pub const PR_SET_FPEMU: ::c_int = 10; +pub const PR_FPEMU_NOPRINT: ::c_int = 1; +pub const PR_FPEMU_SIGFPE: ::c_int = 2; + +pub const PR_GET_FPEXC: ::c_int = 11; +pub const PR_SET_FPEXC: ::c_int = 12; +pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80; +pub const PR_FP_EXC_DIV: ::c_int = 0x010000; +pub const PR_FP_EXC_OVF: ::c_int = 0x020000; +pub const PR_FP_EXC_UND: ::c_int = 0x040000; +pub const PR_FP_EXC_RES: ::c_int = 0x080000; +pub const PR_FP_EXC_INV: ::c_int = 0x100000; +pub const PR_FP_EXC_DISABLED: ::c_int = 0; +pub const PR_FP_EXC_NONRECOV: ::c_int = 1; +pub const PR_FP_EXC_ASYNC: ::c_int = 2; +pub const PR_FP_EXC_PRECISE: ::c_int = 3; + +pub const PR_GET_TIMING: ::c_int = 13; +pub const PR_SET_TIMING: ::c_int = 14; +pub const PR_TIMING_STATISTICAL: ::c_int = 0; +pub const PR_TIMING_TIMESTAMP: ::c_int = 1; + +pub const PR_SET_NAME: ::c_int = 15; +pub const PR_GET_NAME: ::c_int = 16; + +pub const PR_GET_ENDIAN: ::c_int = 19; +pub const PR_SET_ENDIAN: ::c_int = 20; +pub const PR_ENDIAN_BIG: ::c_int = 0; +pub const PR_ENDIAN_LITTLE: ::c_int = 1; +pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2; + +pub const PR_GET_SECCOMP: ::c_int = 21; +pub const PR_SET_SECCOMP: ::c_int = 22; + +pub const PR_CAPBSET_READ: ::c_int = 23; +pub const PR_CAPBSET_DROP: ::c_int = 24; + +pub const PR_GET_TSC: ::c_int = 25; +pub const PR_SET_TSC: ::c_int = 26; +pub const PR_TSC_ENABLE: ::c_int = 1; +pub const PR_TSC_SIGSEGV: ::c_int = 2; + +pub const PR_GET_SECUREBITS: ::c_int = 27; +pub const PR_SET_SECUREBITS: ::c_int = 28; + +pub const PR_SET_TIMERSLACK: ::c_int = 29; +pub const PR_GET_TIMERSLACK: ::c_int = 30; + +pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31; +pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32; + +pub const PR_MCE_KILL: ::c_int = 33; +pub const PR_MCE_KILL_CLEAR: ::c_int = 0; +pub const PR_MCE_KILL_SET: ::c_int = 1; + +pub const PR_MCE_KILL_LATE: ::c_int = 0; +pub const PR_MCE_KILL_EARLY: ::c_int = 1; +pub const PR_MCE_KILL_DEFAULT: ::c_int = 2; + +pub const PR_MCE_KILL_GET: ::c_int = 34; + +pub const PR_SET_MM: ::c_int = 35; +pub const PR_SET_MM_START_CODE: ::c_int = 1; +pub const PR_SET_MM_END_CODE: ::c_int = 2; +pub const PR_SET_MM_START_DATA: ::c_int = 3; +pub const PR_SET_MM_END_DATA: ::c_int = 4; +pub const PR_SET_MM_START_STACK: ::c_int = 5; +pub const PR_SET_MM_START_BRK: ::c_int = 6; +pub const PR_SET_MM_BRK: ::c_int = 7; +pub const PR_SET_MM_ARG_START: ::c_int = 8; +pub const PR_SET_MM_ARG_END: ::c_int = 9; +pub const PR_SET_MM_ENV_START: ::c_int = 10; +pub const PR_SET_MM_ENV_END: ::c_int = 11; +pub const PR_SET_MM_AUXV: ::c_int = 12; +pub const PR_SET_MM_EXE_FILE: ::c_int = 13; +pub const PR_SET_MM_MAP: ::c_int = 14; +pub const PR_SET_MM_MAP_SIZE: ::c_int = 15; + +pub const PR_SET_PTRACER: ::c_int = 0x59616d61; + +pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36; +pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37; + +pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38; +pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39; + +pub const PR_GET_TID_ADDRESS: ::c_int = 40; + +pub const PR_SET_THP_DISABLE: ::c_int = 41; +pub const PR_GET_THP_DISABLE: ::c_int = 42; + +pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43; +pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44; + +pub const PR_SET_FP_MODE: ::c_int = 45; +pub const PR_GET_FP_MODE: ::c_int = 46; +pub const PR_FP_MODE_FR: ::c_int = 1 << 0; +pub const PR_FP_MODE_FRE: ::c_int = 1 << 1; + +pub const PR_CAP_AMBIENT: ::c_int = 47; +pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1; +pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2; +pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3; +pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4; + +pub const ITIMER_REAL: ::c_int = 0; +pub const ITIMER_VIRTUAL: ::c_int = 1; +pub const ITIMER_PROF: ::c_int = 2; + +pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC; +pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK; +pub const TFD_TIMER_ABSTIME: ::c_int = 1; + +pub const XATTR_CREATE: ::c_int = 0x1; +pub const XATTR_REPLACE: ::c_int = 0x2; + +pub const _POSIX_VDISABLE: ::cc_t = 0; + +pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01; +pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02; +pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08; +pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10; +pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20; +pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40; + +// On Linux, libc doesn't define this constant, libattr does instead. +// We still define it for Linux as it's defined by libc on other platforms, +// and it's mentioned in the man pages for getxattr and setxattr. +pub const ENOATTR: ::c_int = ::ENODATA; + +pub const SO_ORIGINAL_DST: ::c_int = 80; +pub const IUTF8: ::tcflag_t = 0x00004000; +pub const CMSPAR: ::tcflag_t = 0o10000000000; + +pub const MFD_CLOEXEC: ::c_uint = 0x0001; +pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002; + +// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has +// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32 +// so we can use that type here to avoid having to cast. +pub const PT_NULL: u32 = 0; +pub const PT_LOAD: u32 = 1; +pub const PT_DYNAMIC: u32 = 2; +pub const PT_INTERP: u32 = 3; +pub const PT_NOTE: u32 = 4; +pub const PT_SHLIB: u32 = 5; +pub const PT_PHDR: u32 = 6; +pub const PT_TLS: u32 = 7; +pub const PT_NUM: u32 = 8; +pub const PT_LOOS: u32 = 0x60000000; +pub const PT_GNU_EH_FRAME: u32 = 0x6474e550; +pub const PT_GNU_STACK: u32 = 0x6474e551; +pub const PT_GNU_RELRO: u32 = 0x6474e552; + +// Ethernet protocol IDs. +pub const ETH_P_IP: ::c_int = 0x0800; + +pub const SFD_CLOEXEC: ::c_int = 0x080000; + +pub const NCCS: usize = 32; + +pub const O_TRUNC: ::c_int = 0x00040000; +pub const O_NOATIME: ::c_int = 0x00002000; +pub const O_CLOEXEC: ::c_int = 0x00000100; +pub const O_TMPFILE: ::c_int = 0x00004000; + +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; + +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +pub const EFD_CLOEXEC: ::c_int = 0x80000; + +pub const BUFSIZ: ::c_uint = 1024; +pub const TMP_MAX: ::c_uint = 10000; +pub const FOPEN_MAX: ::c_uint = 1000; +pub const O_PATH: ::c_int = 0x00400000; +pub const O_EXEC: ::c_int = O_PATH; +pub const O_SEARCH: ::c_int = O_PATH; +pub const O_ACCMODE: ::c_int = 03 | O_SEARCH; +pub const O_NDELAY: ::c_int = O_NONBLOCK; +pub const NI_MAXHOST: ::socklen_t = 255; +pub const PTHREAD_STACK_MIN: ::size_t = 2048; +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +pub const POSIX_MADV_DONTNEED: ::c_int = 4; + +pub const RLIM_INFINITY: ::rlim_t = !0; +pub const RLIMIT_RTTIME: ::c_int = 15; +pub const RLIMIT_NLIMITS: ::c_int = 16; +pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS; + +pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; + +pub const SOCK_DCCP: ::c_int = 6; +pub const SOCK_PACKET: ::c_int = 10; + +pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15; +pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16; +pub const TCP_THIN_DUPACK: ::c_int = 17; +pub const TCP_USER_TIMEOUT: ::c_int = 18; +pub const TCP_REPAIR: ::c_int = 19; +pub const TCP_REPAIR_QUEUE: ::c_int = 20; +pub const TCP_QUEUE_SEQ: ::c_int = 21; +pub const TCP_REPAIR_OPTIONS: ::c_int = 22; +pub const TCP_FASTOPEN: ::c_int = 23; +pub const TCP_TIMESTAMP: ::c_int = 24; + +pub const SIGUNUSED: ::c_int = ::SIGSYS; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; + +pub const CPU_SETSIZE: ::c_int = 128; + +pub const PTRACE_TRACEME: ::c_int = 0; +pub const PTRACE_PEEKTEXT: ::c_int = 1; +pub const PTRACE_PEEKDATA: ::c_int = 2; +pub const PTRACE_PEEKUSER: ::c_int = 3; +pub const PTRACE_POKETEXT: ::c_int = 4; +pub const PTRACE_POKEDATA: ::c_int = 5; +pub const PTRACE_POKEUSER: ::c_int = 6; +pub const PTRACE_CONT: ::c_int = 7; +pub const PTRACE_KILL: ::c_int = 8; +pub const PTRACE_SINGLESTEP: ::c_int = 9; +pub const PTRACE_GETREGS: ::c_int = 12; +pub const PTRACE_SETREGS: ::c_int = 13; +pub const PTRACE_GETFPREGS: ::c_int = 14; +pub const PTRACE_SETFPREGS: ::c_int = 15; +pub const PTRACE_ATTACH: ::c_int = 16; +pub const PTRACE_DETACH: ::c_int = 17; +pub const PTRACE_GETFPXREGS: ::c_int = 18; +pub const PTRACE_SETFPXREGS: ::c_int = 19; +pub const PTRACE_SYSCALL: ::c_int = 24; +pub const PTRACE_SETOPTIONS: ::c_int = 0x4200; +pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201; +pub const PTRACE_GETSIGINFO: ::c_int = 0x4202; +pub const PTRACE_SETSIGINFO: ::c_int = 0x4203; +pub const PTRACE_GETREGSET: ::c_int = 0x4204; +pub const PTRACE_SETREGSET: ::c_int = 0x4205; +pub const PTRACE_SEIZE: ::c_int = 0x4206; +pub const PTRACE_INTERRUPT: ::c_int = 0x4207; +pub const PTRACE_LISTEN: ::c_int = 0x4208; +pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209; + +pub const EPOLLWAKEUP: ::c_int = 0x20000000; + +pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK; + +pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const TIOCINQ: ::c_int = ::FIONREAD; + +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::c_int = 0x00000800; +pub const TAB2: ::c_int = 0x00001000; +pub const TAB3: ::c_int = 0x00001800; +pub const CR1: ::c_int = 0x00000200; +pub const CR2: ::c_int = 0x00000400; +pub const CR3: ::c_int = 0x00000600; +pub const FF1: ::c_int = 0x00008000; +pub const BS1: ::c_int = 0x00002000; +pub const VT1: ::c_int = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const SO_BINDTODEVICE: ::c_int = 25; +pub const SO_TIMESTAMP: ::c_int = 29; +pub const SO_MARK: ::c_int = 36; +pub const SO_RXQ_OVFL: ::c_int = 40; +pub const SO_PEEK_OFF: ::c_int = 42; +pub const SO_BUSY_POLL: ::c_int = 46; + +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; + +pub const O_ASYNC: ::c_int = 0x00000400; + +pub const FIOCLEX: ::c_int = 0x5451; +pub const FIONBIO: ::c_int = 0x5421; + +pub const RLIMIT_RSS: ::c_int = 5; +pub const RLIMIT_NOFILE: ::c_int = 7; +pub const RLIMIT_AS: ::c_int = 9; +pub const RLIMIT_NPROC: ::c_int = 6; +pub const RLIMIT_MEMLOCK: ::c_int = 8; + +pub const O_APPEND: ::c_int = 0x00100000; +pub const O_CREAT: ::c_int = 0x00010000; +pub const O_EXCL: ::c_int = 0x00020000; +pub const O_NOCTTY: ::c_int = 0x00000200; +pub const O_NONBLOCK: ::c_int = 0x00000010; +pub const O_SYNC: ::c_int = 0x00000040 | O_DSYNC; +pub const O_RSYNC: ::c_int = O_SYNC; +pub const O_DSYNC: ::c_int = 0x00000020; + +pub const SOCK_CLOEXEC: ::c_int = 0o2000000; +pub const SOCK_NONBLOCK: ::c_int = 0o4000; + +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_SEQPACKET: ::c_int = 5; + +pub const SOL_SOCKET: ::c_int = 1; + +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EDEADLOCK: ::c_int = EDEADLK; +pub const EMULTIHOP: ::c_int = 72; +pub const EBADMSG: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const ERFKILL: ::c_int = 132; +pub const EHWPOISON: ::c_int = 133; + +pub const SO_REUSEADDR: ::c_int = 2; +pub const SO_TYPE: ::c_int = 3; +pub const SO_ERROR: ::c_int = 4; +pub const SO_DONTROUTE: ::c_int = 5; +pub const SO_BROADCAST: ::c_int = 6; +pub const SO_SNDBUF: ::c_int = 7; +pub const SO_RCVBUF: ::c_int = 8; +pub const SO_KEEPALIVE: ::c_int = 9; +pub const SO_OOBINLINE: ::c_int = 10; +pub const SO_NO_CHECK: ::c_int = 11; +pub const SO_PRIORITY: ::c_int = 12; +pub const SO_LINGER: ::c_int = 13; +pub const SO_BSDCOMPAT: ::c_int = 14; +pub const SO_REUSEPORT: ::c_int = 15; +pub const SO_PASSCRED: ::c_int = 16; +pub const SO_PEERCRED: ::c_int = 17; +pub const SO_RCVLOWAT: ::c_int = 18; +pub const SO_SNDLOWAT: ::c_int = 19; +pub const SO_RCVTIMEO: ::c_int = 20; +pub const SO_SNDTIMEO: ::c_int = 21; +pub const SO_ACCEPTCONN: ::c_int = 30; +pub const SO_SNDBUFFORCE: ::c_int = 32; +pub const SO_RCVBUFFORCE: ::c_int = 33; +pub const SO_PROTOCOL: ::c_int = 38; +pub const SO_DOMAIN: ::c_int = 39; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const EXTPROC: ::tcflag_t = 0x00010000; + +pub const MAP_HUGETLB: ::c_int = 0x040000; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_SETOWN: ::c_int = 8; + +pub const VEOF: usize = 4; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; + +pub const TCGETS: ::c_int = 0x5401; +pub const TCSETS: ::c_int = 0x5402; +pub const TCSETSW: ::c_int = 0x5403; +pub const TCSETSF: ::c_int = 0x5404; +pub const TCGETA: ::c_int = 0x5405; +pub const TCSETA: ::c_int = 0x5406; +pub const TCSETAW: ::c_int = 0x5407; +pub const TCSETAF: ::c_int = 0x5408; +pub const TCSBRK: ::c_int = 0x5409; +pub const TCXONC: ::c_int = 0x540A; +pub const TCFLSH: ::c_int = 0x540B; +pub const TIOCGSOFTCAR: ::c_int = 0x5419; +pub const TIOCSSOFTCAR: ::c_int = 0x541A; +pub const TIOCLINUX: ::c_int = 0x541C; +pub const TIOCGSERIAL: ::c_int = 0x541E; +pub const TIOCEXCL: ::c_int = 0x540C; +pub const TIOCNXCL: ::c_int = 0x540D; +pub const TIOCSCTTY: ::c_int = 0x540E; +pub const TIOCGPGRP: ::c_int = 0x540F; +pub const TIOCSPGRP: ::c_int = 0x5410; +pub const TIOCOUTQ: ::c_int = 0x5411; +pub const TIOCSTI: ::c_int = 0x5412; +pub const TIOCGWINSZ: ::c_int = 0x5413; +pub const TIOCSWINSZ: ::c_int = 0x5414; +pub const TIOCMGET: ::c_int = 0x5415; +pub const TIOCMBIS: ::c_int = 0x5416; +pub const TIOCMBIC: ::c_int = 0x5417; +pub const TIOCMSET: ::c_int = 0x5418; +pub const FIONREAD: ::c_int = 0x541B; +pub const TIOCCONS: ::c_int = 0x541D; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const TIOCM_LE: ::c_int = 0x001; +pub const TIOCM_DTR: ::c_int = 0x002; +pub const TIOCM_RTS: ::c_int = 0x004; +pub const TIOCM_ST: ::c_int = 0x008; +pub const TIOCM_SR: ::c_int = 0x010; +pub const TIOCM_CTS: ::c_int = 0x020; +pub const TIOCM_CAR: ::c_int = 0x040; +pub const TIOCM_RNG: ::c_int = 0x080; +pub const TIOCM_DSR: ::c_int = 0x100; +pub const TIOCM_CD: ::c_int = TIOCM_CAR; +pub const TIOCM_RI: ::c_int = TIOCM_RNG; + +pub const O_DIRECTORY: ::c_int = 0x00080000; +pub const O_DIRECT: ::c_int = 0x00000800; +pub const O_LARGEFILE: ::c_int = 0x00001000; +pub const O_NOFOLLOW: ::c_int = 0x00000080; + +// intentionally not public, only used for fd_set +cfg_if! { + if #[cfg(target_pointer_width = "32")] { + const ULONG_SIZE: usize = 32; + } else if #[cfg(target_pointer_width = "64")] { + const ULONG_SIZE: usize = 64; + } else { + // Unknown target_pointer_width + } +} + +// END_PUB_CONST + +f! { + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + (*set).fds_bits[fd / size] &= !(1 << (fd % size)); + return + } + + pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0 + } + + pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + (*set).fds_bits[fd / size] |= 1 << (fd % size); + return + } + + pub fn FD_ZERO(set: *mut fd_set) -> () { + for slot in (*set).fds_bits.iter_mut() { + *slot = 0; + } + } + + pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { + for slot in cpuset.bits.iter_mut() { + *slot = 0; + } + } + + pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let size_in_bits + = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + cpuset.bits[idx] |= 1 << offset; + () + } + + pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let size_in_bits + = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + cpuset.bits[idx] &= !(1 << offset); + () + } + + pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { + let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]); + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + 0 != (cpuset.bits[idx] & (1 << offset)) + } + + pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { + set1.bits == set2.bits + } + + pub fn major(dev: ::dev_t) -> ::c_uint { + let mut major = 0; + major |= (dev & 0x00000000000fff00) >> 8; + major |= (dev & 0xfffff00000000000) >> 32; + major as ::c_uint + } + + pub fn minor(dev: ::dev_t) -> ::c_uint { + let mut minor = 0; + minor |= (dev & 0x00000000000000ff) >> 0; + minor |= (dev & 0x00000ffffff00000) >> 12; + minor as ::c_uint + } + + pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t { + let major = major as ::dev_t; + let minor = minor as ::dev_t; + let mut dev = 0; + dev |= (major & 0x00000fff) << 8; + dev |= (major & 0xfffff000) << 32; + dev |= (minor & 0x000000ff) << 0; + dev |= (minor & 0xffffff00) << 12; + dev + } + + pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { + cmsg.offset(1) as *mut c_uchar + } + + pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) + -> *mut cmsghdr + { + if ((*cmsg).cmsg_len as ::size_t) < ::mem::size_of::() { + 0 as *mut cmsghdr + } else if __CMSG_NEXT(cmsg).add(::mem::size_of::()) + >= __MHDR_END(mhdr) { + 0 as *mut cmsghdr + } else { + __CMSG_NEXT(cmsg).cast() + } + } + + pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { + if (*mhdr).msg_controllen as ::size_t >= ::mem::size_of::() { + (*mhdr).msg_control.cast() + } else { + 0 as *mut cmsghdr + } + } + + pub {const} fn CMSG_ALIGN(len: ::size_t) -> ::size_t { + (len + ::mem::size_of::<::size_t>() - 1) + & !(::mem::size_of::<::size_t>() - 1) + } + + pub {const} fn CMSG_SPACE(len: ::c_uint) -> ::c_uint { + (CMSG_ALIGN(len as ::size_t) + CMSG_ALIGN(::mem::size_of::())) + as ::c_uint + } + + pub fn CMSG_LEN(len: ::c_uint) -> ::c_uint { + (CMSG_ALIGN(::mem::size_of::()) + len as ::size_t) as ::c_uint + } +} + +safe_f! { + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { + (status & 0xff) == 0x7f + } + + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { + (status >> 8) & 0xff + } + + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + status == 0xffff + } + + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + ((status & 0x7f) + 1) as i8 >= 2 + } + + pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int { + status & 0x7f + } + + pub {const} fn WIFEXITED(status: ::c_int) -> bool { + (status & 0x7f) == 0 + } + + pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int { + (status >> 8) & 0xff + } + + pub {const} fn WCOREDUMP(status: ::c_int) -> bool { + (status & 0x80) != 0 + } + + pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int { + (cmd << 8) | (type_ & 0x00ff) + } +} + +fn __CMSG_LEN(cmsg: *const cmsghdr) -> ::ssize_t { + ((unsafe { (*cmsg).cmsg_len as ::size_t } + ::mem::size_of::<::c_long>() - 1) + & !(::mem::size_of::<::c_long>() - 1)) as ::ssize_t +} + +fn __CMSG_NEXT(cmsg: *const cmsghdr) -> *mut c_uchar { + (unsafe { cmsg.offset(__CMSG_LEN(cmsg)) }) as *mut c_uchar +} + +fn __MHDR_END(mhdr: *const msghdr) -> *mut c_uchar { + unsafe { (*mhdr).msg_control.offset((*mhdr).msg_controllen as isize) }.cast() +} + +// EXTERN_FN + +#[link(name = "c")] +#[link(name = "fdio")] +extern "C" {} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum FILE {} +impl ::Copy for FILE {} +impl ::Clone for FILE { + fn clone(&self) -> FILE { + *self + } +} +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum fpos_t {} // FIXME: fill this out with a struct +impl ::Copy for fpos_t {} +impl ::Clone for fpos_t { + fn clone(&self) -> fpos_t { + *self + } +} + +extern "C" { + pub fn isalnum(c: c_int) -> c_int; + pub fn isalpha(c: c_int) -> c_int; + pub fn iscntrl(c: c_int) -> c_int; + pub fn isdigit(c: c_int) -> c_int; + pub fn isgraph(c: c_int) -> c_int; + pub fn islower(c: c_int) -> c_int; + pub fn isprint(c: c_int) -> c_int; + pub fn ispunct(c: c_int) -> c_int; + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; + pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; + pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; + pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE; + pub fn fflush(file: *mut FILE) -> c_int; + pub fn fclose(file: *mut FILE) -> c_int; + pub fn remove(filename: *const c_char) -> c_int; + pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; + pub fn tmpfile() -> *mut FILE; + pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int; + pub fn setbuf(stream: *mut FILE, buf: *mut c_char); + pub fn getchar() -> c_int; + pub fn putchar(c: c_int) -> c_int; + pub fn fgetc(stream: *mut FILE) -> c_int; + pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; + pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; + pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; + pub fn puts(s: *const c_char) -> c_int; + pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; + pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; + pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; + pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; + pub fn ftell(stream: *mut FILE) -> c_long; + pub fn rewind(stream: *mut FILE); + pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; + pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; + pub fn feof(stream: *mut FILE) -> c_int; + pub fn ferror(stream: *mut FILE) -> c_int; + pub fn perror(s: *const c_char); + pub fn atoi(s: *const c_char) -> c_int; + pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; + pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float; + pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long; + pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong; + pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; + pub fn malloc(size: size_t) -> *mut c_void; + pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; + pub fn free(p: *mut c_void); + pub fn abort() -> !; + pub fn exit(status: c_int) -> !; + pub fn _exit(status: c_int) -> !; + pub fn atexit(cb: extern "C" fn()) -> c_int; + pub fn system(s: *const c_char) -> c_int; + pub fn getenv(s: *const c_char) -> *mut c_char; + + pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; + pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; + pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; + pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; + pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; + pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; + pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; + pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strdup(cs: *const c_char) -> *mut c_char; + pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strlen(cs: *const c_char) -> size_t; + pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; + pub fn strerror(n: c_int) -> *mut c_char; + pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; + pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; + pub fn wcslen(buf: *const wchar_t) -> size_t; + pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t; + + pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; + pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; + pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; + pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; + pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; + pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; + + pub fn abs(i: c_int) -> c_int; + pub fn atof(s: *const c_char) -> c_double; + pub fn labs(i: c_long) -> c_long; + pub fn rand() -> c_int; + pub fn srand(seed: c_uint); + + pub fn getpwnam(name: *const ::c_char) -> *mut passwd; + pub fn getpwuid(uid: ::uid_t) -> *mut passwd; + + pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int; + pub fn printf(format: *const ::c_char, ...) -> ::c_int; + pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int; + pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int; + pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int; + pub fn scanf(format: *const ::c_char, ...) -> ::c_int; + pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int; + pub fn getchar_unlocked() -> ::c_int; + pub fn putchar_unlocked(c: ::c_int) -> ::c_int; + + pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int; + pub fn connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int; + pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int; + pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int; + pub fn getpeername( + socket: ::c_int, + address: *mut sockaddr, + address_len: *mut socklen_t, + ) -> ::c_int; + pub fn getsockname( + socket: ::c_int, + address: *mut sockaddr, + address_len: *mut socklen_t, + ) -> ::c_int; + pub fn setsockopt( + socket: ::c_int, + level: ::c_int, + name: ::c_int, + value: *const ::c_void, + option_len: socklen_t, + ) -> ::c_int; + pub fn socketpair( + domain: ::c_int, + type_: ::c_int, + protocol: ::c_int, + socket_vector: *mut ::c_int, + ) -> ::c_int; + pub fn sendto( + socket: ::c_int, + buf: *const ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *const sockaddr, + addrlen: socklen_t, + ) -> ::ssize_t; + pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int; + + pub fn chmod(path: *const c_char, mode: mode_t) -> ::c_int; + pub fn fchmod(fd: ::c_int, mode: mode_t) -> ::c_int; + + pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int; + + pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int; + + pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int; + + pub fn pclose(stream: *mut ::FILE) -> ::c_int; + pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE; + pub fn fileno(stream: *mut ::FILE) -> ::c_int; + + pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; + pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int; + pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int; + + pub fn opendir(dirname: *const c_char) -> *mut ::DIR; + pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent; + pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent) + -> ::c_int; + pub fn closedir(dirp: *mut ::DIR) -> ::c_int; + pub fn rewinddir(dirp: *mut ::DIR); + + pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int; + pub fn fchmodat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::mode_t, + flags: ::c_int, + ) -> ::c_int; + pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int; + pub fn fchownat( + dirfd: ::c_int, + pathname: *const ::c_char, + owner: ::uid_t, + group: ::gid_t, + flags: ::c_int, + ) -> ::c_int; + pub fn fstatat( + dirfd: ::c_int, + pathname: *const ::c_char, + buf: *mut stat, + flags: ::c_int, + ) -> ::c_int; + pub fn linkat( + olddirfd: ::c_int, + oldpath: *const ::c_char, + newdirfd: ::c_int, + newpath: *const ::c_char, + flags: ::c_int, + ) -> ::c_int; + pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; + pub fn readlinkat( + dirfd: ::c_int, + pathname: *const ::c_char, + buf: *mut ::c_char, + bufsiz: ::size_t, + ) -> ::ssize_t; + pub fn renameat( + olddirfd: ::c_int, + oldpath: *const ::c_char, + newdirfd: ::c_int, + newpath: *const ::c_char, + ) -> ::c_int; + pub fn symlinkat( + target: *const ::c_char, + newdirfd: ::c_int, + linkpath: *const ::c_char, + ) -> ::c_int; + pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int; + + pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int; + pub fn alarm(seconds: ::c_uint) -> ::c_uint; + pub fn chdir(dir: *const c_char) -> ::c_int; + pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; + pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; + pub fn close(fd: ::c_int) -> ::c_int; + pub fn dup(fd: ::c_int) -> ::c_int; + pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int; + pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int; + pub fn execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int; + pub fn execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int; + pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int; + pub fn execve( + prog: *const c_char, + argv: *const *const c_char, + envp: *const *const c_char, + ) -> ::c_int; + pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int; + pub fn fork() -> pid_t; + pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long; + pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char; + pub fn getegid() -> gid_t; + pub fn geteuid() -> uid_t; + pub fn getgid() -> gid_t; + pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int; + pub fn getlogin() -> *mut c_char; + pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int; + pub fn getpgid(pid: pid_t) -> pid_t; + pub fn getpgrp() -> pid_t; + pub fn getpid() -> pid_t; + pub fn getppid() -> pid_t; + pub fn getuid() -> uid_t; + pub fn isatty(fd: ::c_int) -> ::c_int; + pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int; + pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t; + pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long; + pub fn pause() -> ::c_int; + pub fn pipe(fds: *mut ::c_int) -> ::c_int; + pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int; + pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t; + pub fn rmdir(path: *const c_char) -> ::c_int; + pub fn seteuid(uid: uid_t) -> ::c_int; + pub fn setegid(gid: gid_t) -> ::c_int; + pub fn setgid(gid: gid_t) -> ::c_int; + pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int; + pub fn setsid() -> pid_t; + pub fn setuid(uid: uid_t) -> ::c_int; + pub fn sleep(secs: ::c_uint) -> ::c_uint; + pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::c_int; + pub fn tcgetpgrp(fd: ::c_int) -> pid_t; + pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int; + pub fn ttyname(fd: ::c_int) -> *mut c_char; + pub fn unlink(c: *const c_char) -> ::c_int; + pub fn wait(status: *mut ::c_int) -> pid_t; + pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t; + pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t; + pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t; + pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t; + pub fn umask(mask: mode_t) -> mode_t; + + pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int; + + pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int; + + pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn mlockall(flags: ::c_int) -> ::c_int; + pub fn munlockall() -> ::c_int; + + pub fn mmap( + addr: *mut ::c_void, + len: ::size_t, + prot: ::c_int, + flags: ::c_int, + fd: ::c_int, + offset: off_t, + ) -> *mut ::c_void; + pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int; + + pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint; + pub fn if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char; + + pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int; + + pub fn fsync(fd: ::c_int) -> ::c_int; + + pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int; + pub fn unsetenv(name: *const c_char) -> ::c_int; + + pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int; + + pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int; + + pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t; + + pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char; + + pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int; + + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn times(buf: *mut ::tms) -> ::clock_t; + + pub fn pthread_self() -> ::pthread_t; + pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int; + pub fn pthread_exit(value: *mut ::c_void) -> !; + pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int; + pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int; + pub fn pthread_detach(thread: ::pthread_t) -> ::c_int; + pub fn sched_yield() -> ::c_int; + pub fn pthread_key_create( + key: *mut pthread_key_t, + dtor: ::Option, + ) -> ::c_int; + pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int; + pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void; + pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int; + pub fn pthread_mutex_init( + lock: *mut pthread_mutex_t, + attr: *const pthread_mutexattr_t, + ) -> ::c_int; + pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int; + + pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int; + pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int; + pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int; + + pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t) + -> ::c_int; + pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_cond_timedwait( + cond: *mut pthread_cond_t, + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int; + pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int; + pub fn pthread_rwlock_init( + lock: *mut pthread_rwlock_t, + attr: *const pthread_rwlockattr_t, + ) -> ::c_int; + pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int; + pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int; + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + + pub fn getsockopt( + sockfd: ::c_int, + level: ::c_int, + optname: ::c_int, + optval: *mut ::c_void, + optlen: *mut ::socklen_t, + ) -> ::c_int; + pub fn raise(signum: ::c_int) -> ::c_int; + pub fn sigaction(signum: ::c_int, act: *const sigaction, oldact: *mut sigaction) -> ::c_int; + + pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int; + pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void; + pub fn dlerror() -> *mut ::c_char; + pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void; + pub fn dlclose(handle: *mut ::c_void) -> ::c_int; + pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int; + + pub fn getaddrinfo( + node: *const c_char, + service: *const c_char, + hints: *const addrinfo, + res: *mut *mut addrinfo, + ) -> ::c_int; + pub fn freeaddrinfo(res: *mut addrinfo); + pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char; + pub fn res_init() -> ::c_int; + + pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; + pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; + pub fn mktime(tm: *mut tm) -> time_t; + pub fn time(time: *mut time_t) -> time_t; + pub fn gmtime(time_p: *const time_t) -> *mut tm; + pub fn localtime(time_p: *const time_t) -> *mut tm; + + pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent; + pub fn getprotobyname(name: *const ::c_char) -> *mut protoent; + pub fn getprotobynumber(proto: ::c_int) -> *mut protoent; + pub fn usleep(secs: ::c_uint) -> ::c_int; + pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t; + pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t; + pub fn putenv(string: *mut c_char) -> ::c_int; + pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int; + pub fn select( + nfds: ::c_int, + readfs: *mut fd_set, + writefds: *mut fd_set, + errorfds: *mut fd_set, + timeout: *mut timeval, + ) -> ::c_int; + pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char; + pub fn localeconv() -> *mut lconv; + + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_wait(sem: *mut sem_t) -> ::c_int; + pub fn sem_trywait(sem: *mut sem_t) -> ::c_int; + pub fn sem_post(sem: *mut sem_t) -> ::c_int; + pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; + pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int; + pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int; + + pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t; + + pub fn sigemptyset(set: *mut sigset_t) -> ::c_int; + pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int; + pub fn sigfillset(set: *mut sigset_t) -> ::c_int; + pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int; + pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int; + + pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; + pub fn sigpending(set: *mut sigset_t) -> ::c_int; + + pub fn timegm(tm: *mut ::tm) -> time_t; + + pub fn getsid(pid: pid_t) -> pid_t; + + pub fn sysconf(name: ::c_int) -> ::c_long; + + pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int; + + pub fn pselect( + nfds: ::c_int, + readfs: *mut fd_set, + writefds: *mut fd_set, + errorfds: *mut fd_set, + timeout: *const timespec, + sigmask: *const sigset_t, + ) -> ::c_int; + pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int; + pub fn ftello(stream: *mut ::FILE) -> ::off_t; + pub fn tcdrain(fd: ::c_int) -> ::c_int; + pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t; + pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t; + pub fn cfmakeraw(termios: *mut ::termios); + pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int; + pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int; + pub fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int; + pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int; + pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int; + pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int; + pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int; + pub fn tcgetsid(fd: ::c_int) -> ::pid_t; + pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int; + pub fn mkstemp(template: *mut ::c_char) -> ::c_int; + pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char; + + pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char; + + pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int); + pub fn closelog(); + pub fn setlogmask(maskpri: ::c_int) -> ::c_int; + pub fn syslog(priority: ::c_int, message: *const ::c_char, ...); + + pub fn grantpt(fd: ::c_int) -> ::c_int; + pub fn posix_openpt(flags: ::c_int) -> ::c_int; + pub fn ptsname(fd: ::c_int) -> *mut ::c_char; + pub fn unlockpt(fd: ::c_int) -> ::c_int; + + pub fn fdatasync(fd: ::c_int) -> ::c_int; + pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + + pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_attr_getstack( + attr: *const ::pthread_attr_t, + stackaddr: *mut *mut ::c_void, + stacksize: *mut ::size_t, + ) -> ::c_int; + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; + pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void; + + pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + pub fn utimensat( + dirfd: ::c_int, + path: *const ::c_char, + times: *const ::timespec, + flag: ::c_int, + ) -> ::c_int; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t); + pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; + pub fn uselocale(loc: ::locale_t) -> ::locale_t; + + pub fn fdopendir(fd: ::c_int) -> *mut ::DIR; + + pub fn mknodat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::mode_t, + dev: dev_t, + ) -> ::c_int; + pub fn pthread_condattr_getclock( + attr: *const pthread_condattr_t, + clock_id: *mut clockid_t, + ) -> ::c_int; + pub fn pthread_condattr_setclock( + attr: *mut pthread_condattr_t, + clock_id: ::clockid_t, + ) -> ::c_int; + pub fn accept4( + fd: ::c_int, + addr: *mut ::sockaddr, + len: *mut ::socklen_t, + flg: ::c_int, + ) -> ::c_int; + pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int; + pub fn clearenv() -> ::c_int; + pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) + -> ::c_int; + pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int; + pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int; + pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int; + pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int; + pub fn acct(filename: *const ::c_char) -> ::c_int; + pub fn brk(addr: *mut ::c_void) -> ::c_int; + pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int; + pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int; + pub fn openpty( + amaster: *mut ::c_int, + aslave: *mut ::c_int, + name: *mut ::c_char, + termp: *const termios, + winp: *const ::winsize, + ) -> ::c_int; + pub fn execvpe( + file: *const ::c_char, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + pub fn fexecve( + fd: ::c_int, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + + pub fn setpwent(); + pub fn endpwent(); + pub fn getpwent() -> *mut passwd; + + pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int; + + // System V IPC + pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; + pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; + pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; + pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; + pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t; + pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int; + pub fn semop(semid: ::c_int, sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int; + pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int; + pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int; + pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int; + pub fn msgrcv( + msqid: ::c_int, + msgp: *mut ::c_void, + msgsz: ::size_t, + msgtyp: ::c_long, + msgflg: ::c_int, + ) -> ::ssize_t; + pub fn msgsnd( + msqid: ::c_int, + msgp: *const ::c_void, + msgsz: ::size_t, + msgflg: ::c_int, + ) -> ::c_int; + + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn __errno_location() -> *mut ::c_int; + + pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; + pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; + pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t; + pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int; + pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int; + pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int; + pub fn timerfd_settime( + fd: ::c_int, + flags: ::c_int, + new_value: *const itimerspec, + old_value: *mut itimerspec, + ) -> ::c_int; + pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) + -> ::ssize_t; + pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t; + pub fn quotactl( + cmd: ::c_int, + special: *const ::c_char, + id: ::c_int, + data: *mut ::c_char, + ) -> ::c_int; + pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int; + pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int; + pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int; + pub fn sigtimedwait( + set: *const sigset_t, + info: *mut siginfo_t, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int; + pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::socklen_t, + serv: *mut ::c_char, + sevlen: ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + pub fn reboot(how_to: ::c_int) -> ::c_int; + pub fn setfsgid(gid: ::gid_t) -> ::c_int; + pub fn setfsuid(uid: ::uid_t) -> ::c_int; + + // Not available now on Android + pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; + pub fn if_nameindex() -> *mut if_nameindex; + pub fn if_freenameindex(ptr: *mut if_nameindex); + pub fn sync_file_range( + fd: ::c_int, + offset: ::off64_t, + nbytes: ::off64_t, + flags: ::c_uint, + ) -> ::c_int; + pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int; + pub fn freeifaddrs(ifa: *mut ::ifaddrs); + + pub fn glob( + pattern: *const c_char, + flags: ::c_int, + errfunc: ::Option ::c_int>, + pglob: *mut ::glob_t, + ) -> ::c_int; + pub fn globfree(pglob: *mut ::glob_t); + + pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; + pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; + + pub fn recvfrom( + socket: ::c_int, + buf: *mut ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, + ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + + pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int; + + pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + + pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t; + pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; + pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn vhangup() -> ::c_int; + pub fn sendmmsg( + sockfd: ::c_int, + msgvec: *mut mmsghdr, + vlen: ::c_uint, + flags: ::c_int, + ) -> ::c_int; + pub fn recvmmsg( + sockfd: ::c_int, + msgvec: *mut mmsghdr, + vlen: ::c_uint, + flags: ::c_int, + timeout: *mut ::timespec, + ) -> ::c_int; + pub fn sync(); + pub fn syscall(num: ::c_long, ...) -> ::c_long; + pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t) + -> ::c_int; + pub fn sched_setaffinity( + pid: ::pid_t, + cpusetsize: ::size_t, + cpuset: *const cpu_set_t, + ) -> ::c_int; + pub fn umount(target: *const ::c_char) -> ::c_int; + pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; + pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t; + pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; + pub fn splice( + fd_in: ::c_int, + off_in: *mut ::loff_t, + fd_out: ::c_int, + off_out: *mut ::loff_t, + len: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int; + pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; + pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; + pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int; + pub fn swapoff(puath: *const ::c_char) -> ::c_int; + pub fn vmsplice( + fd: ::c_int, + iov: *const ::iovec, + nr_segs: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; + pub fn mount( + src: *const ::c_char, + target: *const ::c_char, + fstype: *const ::c_char, + flags: ::c_ulong, + data: *const ::c_void, + ) -> ::c_int; + pub fn personality(persona: ::c_ulong) -> ::c_int; + pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int; + pub fn ppoll( + fds: *mut ::pollfd, + nfds: nfds_t, + timeout: *const ::timespec, + sigmask: *const sigset_t, + ) -> ::c_int; + pub fn pthread_mutex_timedlock( + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + pub fn clone( + cb: extern "C" fn(*mut ::c_void) -> ::c_int, + child_stack: *mut ::c_void, + flags: ::c_int, + arg: *mut ::c_void, + ... + ) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + pub fn pthread_attr_getguardsize( + attr: *const ::pthread_attr_t, + guardsize: *mut ::size_t, + ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; + pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int; + pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int; + pub fn sched_setscheduler( + pid: ::pid_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; + pub fn getgrgid_r( + gid: ::gid_t, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; + pub fn getgrnam_r( + name: *const ::c_char, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; + pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + pub fn getpwnam_r( + name: *const ::c_char, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn getpwuid_r( + uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; + pub fn pthread_atfork( + prepare: ::Option, + parent: ::Option, + child: ::Option, + ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; + pub fn getgrouplist( + user: *const ::c_char, + group: ::gid_t, + groups: *mut ::gid_t, + ngroups: *mut ::c_int, + ) -> ::c_int; + pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn faccessat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::c_int, + flags: ::c_int, + ) -> ::c_int; + pub fn pthread_create( + native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + pub fn dl_iterate_phdr( + callback: ::Option< + unsafe extern "C" fn( + info: *mut ::dl_phdr_info, + size: ::size_t, + data: *mut ::c_void, + ) -> ::c_int, + >, + data: *mut ::c_void, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(any(target_arch = "x86_64"))] { + mod x86_64; + pub use self::x86_64::*; + } else { + // Unknown target_arch + } +} + +cfg_if! { + if #[cfg(libc_align)] { + #[macro_use] + mod align; + } else { + #[macro_use] + mod no_align; + } +} +expand_align!(); + +cfg_if! { + if #[cfg(libc_core_cvoid)] { + pub use ::ffi::c_void; + } else { + // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help + // enable more optimization opportunities around it recognizing things + // like malloc/free. + #[repr(u8)] + #[allow(missing_copy_implementations)] + #[allow(missing_debug_implementations)] + pub enum c_void { + // Two dummy variants so the #[repr] attribute can be used. + #[doc(hidden)] + __variant1, + #[doc(hidden)] + __variant2, + } + } +} diff --git a/bash-5.1/vendor/libc/src/fuchsia/no_align.rs b/bash-5.1/vendor/libc/src/fuchsia/no_align.rs new file mode 100644 index 0000000000000000000000000000000000000000..7ca90e0e48a39940e4222f8a65bbf969751e74b6 --- /dev/null +++ b/bash-5.1/vendor/libc/src/fuchsia/no_align.rs @@ -0,0 +1,129 @@ +macro_rules! expand_align { + () => { + s! { + pub struct pthread_mutexattr_t { + #[cfg(target_arch = "x86_64")] + __align: [::c_int; 0], + #[cfg(not(target_arch = "x86_64"))] + __align: [::c_long; 0], + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + pub struct pthread_rwlockattr_t { + __align: [::c_long; 0], + size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T], + } + + pub struct pthread_condattr_t { + __align: [::c_int; 0], + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + } + + s_no_extra_traits! { + pub struct pthread_mutex_t { + #[cfg(any(target_arch = "arm", + all(target_arch = "x86_64", + target_pointer_width = "32")))] + __align: [::c_long; 0], + #[cfg(not(any(target_arch = "arm", + all(target_arch = "x86_64", + target_pointer_width = "32"))))] + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + + pub struct pthread_rwlock_t { + __align: [::c_long; 0], + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + + pub struct pthread_cond_t { + __align: [*const ::c_void; 0], + #[cfg(not(target_env = "musl"))] + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for pthread_cond_t { + fn eq(&self, other: &pthread_cond_t) -> bool { + // Ignore __align field + self.size + .iter() + .zip(other.size.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_cond_t {} + impl ::fmt::Debug for pthread_cond_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_cond_t") + // Ignore __align field + // FIXME: .field("size", &self.size) + .finish() + } + } + impl ::hash::Hash for pthread_cond_t { + fn hash(&self, state: &mut H) { + // Ignore __align field + self.size.hash(state); + } + } + + impl PartialEq for pthread_mutex_t { + fn eq(&self, other: &pthread_mutex_t) -> bool { + // Ignore __align field + self.size + .iter() + .zip(other.size.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_mutex_t {} + impl ::fmt::Debug for pthread_mutex_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_mutex_t") + // Ignore __align field + // FIXME: .field("size", &self.size) + .finish() + } + } + impl ::hash::Hash for pthread_mutex_t { + fn hash(&self, state: &mut H) { + // Ignore __align field + self.size.hash(state); + } + } + + impl PartialEq for pthread_rwlock_t { + fn eq(&self, other: &pthread_rwlock_t) -> bool { + // Ignore __align field + self.size + .iter() + .zip(other.size.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_rwlock_t {} + impl ::fmt::Debug for pthread_rwlock_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_rwlock_t") + // Ignore __align field + // FIXME: .field("size", &self.size) + .finish() + } + } + impl ::hash::Hash for pthread_rwlock_t { + fn hash(&self, state: &mut H) { + // Ignore __align field + self.size.hash(state); + } + } + } + } + }; +} diff --git a/bash-5.1/vendor/libc/src/fuchsia/x86_64.rs b/bash-5.1/vendor/libc/src/fuchsia/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..dca3c247d8b8345825cef01304d93d02d2cf3072 --- /dev/null +++ b/bash-5.1/vendor/libc/src/fuchsia/x86_64.rs @@ -0,0 +1,152 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type nlink_t = u64; +pub type blksize_t = ::c_long; +pub type __u64 = ::c_ulonglong; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __reserved: [::c_long; 3], + } + + pub struct mcontext_t { + __private: [u64; 32], + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __unused1: ::c_long, + __unused2: ::c_long + } +} + +s_no_extra_traits! { + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask: ::sigset_t, + __private: [u8; 512], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for ucontext_t { + fn eq(&self, other: &ucontext_t) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_sigmask == other.uc_sigmask + && self + .__private + .iter() + .zip(other.__private.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for ucontext_t {} + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_flags) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field("uc_sigmask", &self.uc_sigmask) + // FIXME: .field("__private", &self.__private) + .finish() + } + } + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + self.uc_sigmask.hash(state); + self.__private.hash(state); + } + } + } +} + +// offsets in user_regs_structs, from sys/reg.h +pub const R15: ::c_int = 0; +pub const R14: ::c_int = 1; +pub const R13: ::c_int = 2; +pub const R12: ::c_int = 3; +pub const RBP: ::c_int = 4; +pub const RBX: ::c_int = 5; +pub const R11: ::c_int = 6; +pub const R10: ::c_int = 7; +pub const R9: ::c_int = 8; +pub const R8: ::c_int = 9; +pub const RAX: ::c_int = 10; +pub const RCX: ::c_int = 11; +pub const RDX: ::c_int = 12; +pub const RSI: ::c_int = 13; +pub const RDI: ::c_int = 14; +pub const ORIG_RAX: ::c_int = 15; +pub const RIP: ::c_int = 16; +pub const CS: ::c_int = 17; +pub const EFLAGS: ::c_int = 18; +pub const RSP: ::c_int = 19; +pub const SS: ::c_int = 20; +pub const FS_BASE: ::c_int = 21; +pub const GS_BASE: ::c_int = 22; +pub const DS: ::c_int = 23; +pub const ES: ::c_int = 24; +pub const FS: ::c_int = 25; +pub const GS: ::c_int = 26; + +pub const MAP_32BIT: ::c_int = 0x0040; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; diff --git a/bash-5.1/vendor/libc/src/hermit/aarch64.rs b/bash-5.1/vendor/libc/src/hermit/aarch64.rs new file mode 100644 index 0000000000000000000000000000000000000000..1a92e3b4fa3412169caf35628d91ccfae399d6e9 --- /dev/null +++ b/bash-5.1/vendor/libc/src/hermit/aarch64.rs @@ -0,0 +1,2 @@ +pub type c_char = u8; +pub type wchar_t = u32; diff --git a/bash-5.1/vendor/libc/src/hermit/mod.rs b/bash-5.1/vendor/libc/src/hermit/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..bffcefdd89ce405a5248f87ff1f266a18d6e759a --- /dev/null +++ b/bash-5.1/vendor/libc/src/hermit/mod.rs @@ -0,0 +1,64 @@ +// libc port for HermitCore (https://hermitcore.org) +// +// Ported by Colin Fink +// and Stefan Lankes + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_float = f32; +pub type c_double = f64; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; + +pub type size_t = usize; +pub type ptrdiff_t = isize; +pub type intptr_t = isize; +pub type uintptr_t = usize; +pub type ssize_t = isize; + +pub type c_long = i64; +pub type c_ulong = u64; + +pub type wint_t = u32; +pub type wctype_t = i64; + +pub type regoff_t = size_t; +pub type off_t = c_long; + +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else { + // Unknown target_arch + } +} + +cfg_if! { + if #[cfg(libc_core_cvoid)] { + pub use ::ffi::c_void; + } else { + // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help + // enable more optimization opportunities around it recognizing things + // like malloc/free. + #[repr(u8)] + #[allow(missing_copy_implementations)] + #[allow(missing_debug_implementations)] + pub enum c_void { + // Two dummy variants so the #[repr] attribute can be used. + #[doc(hidden)] + __variant1, + #[doc(hidden)] + __variant2, + } + } +} diff --git a/bash-5.1/vendor/libc/src/hermit/x86_64.rs b/bash-5.1/vendor/libc/src/hermit/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..76ec3ce823e8fedfc49c9e9118285af65b5d86fb --- /dev/null +++ b/bash-5.1/vendor/libc/src/hermit/x86_64.rs @@ -0,0 +1,2 @@ +pub type c_char = i8; +pub type wchar_t = i32; diff --git a/bash-5.1/vendor/libc/src/lib.rs b/bash-5.1/vendor/libc/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..acda0915920255a9d1b9eed440fa512775df8b12 --- /dev/null +++ b/bash-5.1/vendor/libc/src/lib.rs @@ -0,0 +1,157 @@ +//! libc - Raw FFI bindings to platforms' system libraries +//! +//! [Documentation for other platforms][pd]. +//! +//! [pd]: https://rust-lang.github.io/libc/#platform-specific-documentation +#![crate_name = "libc"] +#![crate_type = "rlib"] +#![allow( + renamed_and_removed_lints, // Keep this order. + unknown_lints, // Keep this order. + bad_style, + overflowing_literals, + improper_ctypes, + // This lint is renamed but we run CI for old stable rustc so should be here. + redundant_semicolon, + redundant_semicolons, + unused_macros, + unused_macro_rules, +)] +#![cfg_attr(libc_deny_warnings, deny(warnings))] +// Attributes needed when building as part of the standard library +#![cfg_attr(feature = "rustc-dep-of-std", feature(link_cfg, no_core))] +#![cfg_attr(libc_thread_local, feature(thread_local))] +// Enable extra lints: +#![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))] +#![deny(missing_copy_implementations, safe_packed_borrows)] +#![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)] +#![cfg_attr(feature = "rustc-dep-of-std", no_core)] +#![cfg_attr(libc_const_extern_fn_unstable, feature(const_extern_fn))] + +#[macro_use] +mod macros; + +cfg_if! { + if #[cfg(feature = "rustc-dep-of-std")] { + extern crate rustc_std_workspace_core as core; + #[allow(unused_imports)] + use core::iter; + #[allow(unused_imports)] + use core::ops; + #[allow(unused_imports)] + use core::option; + } +} + +cfg_if! { + if #[cfg(libc_priv_mod_use)] { + #[cfg(libc_core_cvoid)] + #[allow(unused_imports)] + use core::ffi; + #[allow(unused_imports)] + use core::fmt; + #[allow(unused_imports)] + use core::hash; + #[allow(unused_imports)] + use core::num; + #[allow(unused_imports)] + use core::mem; + #[doc(hidden)] + #[allow(unused_imports)] + use core::clone::Clone; + #[doc(hidden)] + #[allow(unused_imports)] + use core::marker::{Copy, Send, Sync}; + #[doc(hidden)] + #[allow(unused_imports)] + use core::option::Option; + } else { + #[doc(hidden)] + #[allow(unused_imports)] + pub use core::fmt; + #[doc(hidden)] + #[allow(unused_imports)] + pub use core::hash; + #[doc(hidden)] + #[allow(unused_imports)] + pub use core::num; + #[doc(hidden)] + #[allow(unused_imports)] + pub use core::mem; + #[doc(hidden)] + #[allow(unused_imports)] + pub use core::clone::Clone; + #[doc(hidden)] + #[allow(unused_imports)] + pub use core::marker::{Copy, Send, Sync}; + #[doc(hidden)] + #[allow(unused_imports)] + pub use core::option::Option; + } +} + +cfg_if! { + if #[cfg(windows)] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + + mod windows; + pub use windows::*; + } else if #[cfg(target_os = "fuchsia")] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + + mod fuchsia; + pub use fuchsia::*; + } else if #[cfg(target_os = "switch")] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + + mod switch; + pub use switch::*; + } else if #[cfg(target_os = "psp")] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + + mod psp; + pub use psp::*; + } else if #[cfg(target_os = "vxworks")] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + + mod vxworks; + pub use vxworks::*; + } else if #[cfg(target_os = "solid_asp3")] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + + mod solid; + pub use solid::*; + } else if #[cfg(unix)] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + + mod unix; + pub use unix::*; + } else if #[cfg(target_os = "hermit")] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + + mod hermit; + pub use hermit::*; + } else if #[cfg(all(target_env = "sgx", target_vendor = "fortanix"))] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + + mod sgx; + pub use sgx::*; + } else if #[cfg(any(target_env = "wasi", target_os = "wasi"))] { + mod fixed_width_ints; + pub use fixed_width_ints::*; + + mod wasi; + pub use wasi::*; + } else { + // non-supported targets: empty... + } +} diff --git a/bash-5.1/vendor/libc/src/macros.rs b/bash-5.1/vendor/libc/src/macros.rs new file mode 100644 index 0000000000000000000000000000000000000000..fd473702f72bd8054d207c5b1960ab67df833411 --- /dev/null +++ b/bash-5.1/vendor/libc/src/macros.rs @@ -0,0 +1,343 @@ +/// A macro for defining #[cfg] if-else statements. +/// +/// This is similar to the `if/elif` C preprocessor macro by allowing definition +/// of a cascade of `#[cfg]` cases, emitting the implementation which matches +/// first. +/// +/// This allows you to conveniently provide a long list #[cfg]'d blocks of code +/// without having to rewrite each clause multiple times. +macro_rules! cfg_if { + // match if/else chains with a final `else` + ($( + if #[cfg($($meta:meta),*)] { $($it:item)* } + ) else * else { + $($it2:item)* + }) => { + cfg_if! { + @__items + () ; + $( ( ($($meta),*) ($($it)*) ), )* + ( () ($($it2)*) ), + } + }; + + // match if/else chains lacking a final `else` + ( + if #[cfg($($i_met:meta),*)] { $($i_it:item)* } + $( + else if #[cfg($($e_met:meta),*)] { $($e_it:item)* } + )* + ) => { + cfg_if! { + @__items + () ; + ( ($($i_met),*) ($($i_it)*) ), + $( ( ($($e_met),*) ($($e_it)*) ), )* + ( () () ), + } + }; + + // Internal and recursive macro to emit all the items + // + // Collects all the negated `cfg`s in a list at the beginning and after the + // semicolon is all the remaining items + (@__items ($($not:meta,)*) ; ) => {}; + (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ), + $($rest:tt)*) => { + // Emit all items within one block, applying an appropriate #[cfg]. The + // #[cfg] will require all `$m` matchers specified and must also negate + // all previous matchers. + cfg_if! { @__apply cfg(all($($m,)* not(any($($not),*)))), $($it)* } + + // Recurse to emit all other items in `$rest`, and when we do so add all + // our `$m` matchers to the list of `$not` matchers as future emissions + // will have to negate everything we just matched as well. + cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* } + }; + + // Internal macro to Apply a cfg attribute to a list of items + (@__apply $m:meta, $($it:item)*) => { + $(#[$m] $it)* + }; +} + +macro_rules! s { + ($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($( + s!(it: $(#[$attr])* pub $t $i { $($field)* }); + )*); + (it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => ( + compile_error!("unions cannot derive extra traits, use s_no_extra_traits instead"); + ); + (it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => ( + __item! { + #[repr(C)] + #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] + #[allow(deprecated)] + $(#[$attr])* + pub struct $i { $($field)* } + } + #[allow(deprecated)] + impl ::Copy for $i {} + #[allow(deprecated)] + impl ::Clone for $i { + fn clone(&self) -> $i { *self } + } + ); +} + +macro_rules! s_no_extra_traits { + ($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($( + s_no_extra_traits!(it: $(#[$attr])* pub $t $i { $($field)* }); + )*); + (it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => ( + cfg_if! { + if #[cfg(libc_union)] { + __item! { + #[repr(C)] + $(#[$attr])* + pub union $i { $($field)* } + } + + impl ::Copy for $i {} + impl ::Clone for $i { + fn clone(&self) -> $i { *self } + } + } + } + ); + (it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => ( + __item! { + #[repr(C)] + $(#[$attr])* + pub struct $i { $($field)* } + } + #[allow(deprecated)] + impl ::Copy for $i {} + #[allow(deprecated)] + impl ::Clone for $i { + fn clone(&self) -> $i { *self } + } + ); +} + +macro_rules! e { + ($($(#[$attr:meta])* pub enum $i:ident { $($field:tt)* })*) => ($( + __item! { + #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] + $(#[$attr])* + pub enum $i { $($field)* } + } + impl ::Copy for $i {} + impl ::Clone for $i { + fn clone(&self) -> $i { *self } + } + )*); +} + +macro_rules! s_paren { + ($($(#[$attr:meta])* pub struct $i:ident ( $($field:tt)* ); )* ) => ($( + __item! { + #[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] + $(#[$attr])* + pub struct $i ( $($field)* ); + } + impl ::Copy for $i {} + impl ::Clone for $i { + fn clone(&self) -> $i { *self } + } + )*); +} + +// This is a pretty horrible hack to allow us to conditionally mark +// some functions as 'const', without requiring users of this macro +// to care about the "const-extern-fn" feature. +// +// When 'const-extern-fn' is enabled, we emit the captured 'const' keyword +// in the expanded function. +// +// When 'const-extern-fn' is disabled, we always emit a plain 'pub unsafe extern fn'. +// Note that the expression matched by the macro is exactly the same - this allows +// users of this macro to work whether or not 'const-extern-fn' is enabled +// +// Unfortunately, we need to duplicate most of this macro between the 'cfg_if' blocks. +// This is because 'const unsafe extern fn' won't even parse on older compilers, +// so we need to avoid emitting it at all of 'const-extern-fn'. +// +// Specifically, moving the 'cfg_if' into the macro body will *not* work. +// Doing so would cause the '#[cfg(feature = "const-extern-fn")]' to be emitted +// into user code. The 'cfg' gate will not stop Rust from trying to parse the +// 'pub const unsafe extern fn', so users would get a compiler error even when +// the 'const-extern-fn' feature is disabled +// +// Note that users of this macro need to place 'const' in a weird position +// (after the closing ')' for the arguments, but before the return type). +// This was the only way I could satisfy the following two requirements: +// 1. Avoid ambiguity errors from 'macro_rules!' (which happen when writing '$foo:ident fn' +// 2. Allow users of this macro to mix 'pub fn foo' and 'pub const fn bar' within the same +// 'f!' block +cfg_if! { + if #[cfg(libc_const_extern_fn)] { + macro_rules! f { + ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident( + $($arg:ident: $argty:ty),* + ) -> $ret:ty { + $($body:stmt);* + })*) => ($( + #[inline] + $(#[$attr])* + pub $($constness)* unsafe extern fn $i($($arg: $argty),* + ) -> $ret { + $($body);* + } + )*) + } + + macro_rules! safe_f { + ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident( + $($arg:ident: $argty:ty),* + ) -> $ret:ty { + $($body:stmt);* + })*) => ($( + #[inline] + $(#[$attr])* + pub $($constness)* extern fn $i($($arg: $argty),* + ) -> $ret { + $($body);* + } + )*) + } + + macro_rules! const_fn { + ($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident( + $($arg:ident: $argty:ty),* + ) -> $ret:ty { + $($body:stmt);* + })*) => ($( + #[inline] + $(#[$attr])* + $($constness)* fn $i($($arg: $argty),* + ) -> $ret { + $($body);* + } + )*) + } + + } else { + macro_rules! f { + ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident( + $($arg:ident: $argty:ty),* + ) -> $ret:ty { + $($body:stmt);* + })*) => ($( + #[inline] + $(#[$attr])* + pub unsafe extern fn $i($($arg: $argty),* + ) -> $ret { + $($body);* + } + )*) + } + + macro_rules! safe_f { + ($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident( + $($arg:ident: $argty:ty),* + ) -> $ret:ty { + $($body:stmt);* + })*) => ($( + #[inline] + $(#[$attr])* + pub extern fn $i($($arg: $argty),* + ) -> $ret { + $($body);* + } + )*) + } + + macro_rules! const_fn { + ($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident( + $($arg:ident: $argty:ty),* + ) -> $ret:ty { + $($body:stmt);* + })*) => ($( + #[inline] + $(#[$attr])* + fn $i($($arg: $argty),* + ) -> $ret { + $($body);* + } + )*) + } + } +} + +macro_rules! __item { + ($i:item) => { + $i + }; +} + +macro_rules! align_const { + ($($(#[$attr:meta])* + pub const $name:ident : $t1:ty + = $t2:ident { $($field:tt)* };)*) => ($( + #[cfg(libc_align)] + $(#[$attr])* + pub const $name : $t1 = $t2 { + $($field)* + }; + #[cfg(not(libc_align))] + $(#[$attr])* + pub const $name : $t1 = $t2 { + $($field)* + __align: [], + }; + )*) +} + +// This macro is used to deprecate items that should be accessed via the mach2 crate +macro_rules! deprecated_mach { + (pub const $id:ident: $ty:ty = $expr:expr;) => { + #[deprecated( + since = "0.2.55", + note = "Use the `mach2` crate instead", + )] + #[allow(deprecated)] + pub const $id: $ty = $expr; + }; + ($(pub const $id:ident: $ty:ty = $expr:expr;)*) => { + $( + deprecated_mach!( + pub const $id: $ty = $expr; + ); + )* + }; + (pub type $id:ident = $ty:ty;) => { + #[deprecated( + since = "0.2.55", + note = "Use the `mach2` crate instead", + )] + #[allow(deprecated)] + pub type $id = $ty; + }; + ($(pub type $id:ident = $ty:ty;)*) => { + $( + deprecated_mach!( + pub type $id = $ty; + ); + )* + } +} + +#[cfg(not(libc_ptr_addr_of))] +macro_rules! ptr_addr_of { + ($place:expr) => { + &$place + }; +} + +#[cfg(libc_ptr_addr_of)] +macro_rules! ptr_addr_of { + ($place:expr) => { + ::core::ptr::addr_of!($place) + }; +} diff --git a/bash-5.1/vendor/libc/src/psp.rs b/bash-5.1/vendor/libc/src/psp.rs new file mode 100644 index 0000000000000000000000000000000000000000..575232dad1f88b428b5b5ff6d23c1704f47cd96c --- /dev/null +++ b/bash-5.1/vendor/libc/src/psp.rs @@ -0,0 +1,4174 @@ +//! PSP C type definitions +//! +//! These type declarations are not enough, as they must be ultimately resolved +//! by the linker. Crates that use these definitions must, somewhere in the +//! crate graph, include a stub provider crate such as the `psp` crate. + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_float = f32; +pub type c_double = f64; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; + +pub type size_t = usize; +pub type ptrdiff_t = isize; +pub type intptr_t = isize; +pub type uintptr_t = usize; +pub type ssize_t = isize; + +pub type c_char = u8; +pub type c_long = i64; +pub type c_ulong = u64; + +cfg_if! { + if #[cfg(libc_core_cvoid)] { + pub use ::ffi::c_void; + } else { + // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help + // enable more optimization opportunities around it recognizing things + // like malloc/free. + #[repr(u8)] + #[allow(missing_copy_implementations)] + #[allow(missing_debug_implementations)] + pub enum c_void { + // Two dummy variants so the #[repr] attribute can be used. + #[doc(hidden)] + __variant1, + #[doc(hidden)] + __variant2, + } + } +} + +pub type SceKernelVTimerHandler = unsafe extern "C" fn( + uid: SceUid, + arg1: *mut SceKernelSysClock, + arg2: *mut SceKernelSysClock, + arg3: *mut c_void, +) -> u32; + +pub type SceKernelVTimerHandlerWide = + unsafe extern "C" fn(uid: SceUid, arg1: i64, arg2: i64, arg3: *mut c_void) -> u32; + +pub type SceKernelThreadEventHandler = + unsafe extern "C" fn(mask: i32, thid: SceUid, common: *mut c_void) -> i32; + +pub type SceKernelAlarmHandler = unsafe extern "C" fn(common: *mut c_void) -> u32; + +pub type SceKernelCallbackFunction = + unsafe extern "C" fn(arg1: i32, arg2: i32, arg: *mut c_void) -> i32; + +pub type SceKernelThreadEntry = unsafe extern "C" fn(args: usize, argp: *mut c_void) -> i32; + +pub type PowerCallback = extern "C" fn(unknown: i32, power_info: i32); + +pub type IoPermissions = i32; + +pub type UmdCallback = fn(unknown: i32, event: i32) -> i32; + +pub type SceMpegRingbufferCb = + ::Option i32>; + +pub type GuCallback = ::Option; +pub type GuSwapBuffersCallback = + ::Option; + +pub type SceNetAdhocctlHandler = + ::Option; + +pub type AdhocMatchingCallback = ::Option< + unsafe extern "C" fn( + matching_id: i32, + event: i32, + mac: *mut u8, + opt_len: i32, + opt_data: *mut c_void, + ), +>; + +pub type SceNetApctlHandler = ::Option< + unsafe extern "C" fn(oldState: i32, newState: i32, event: i32, error: i32, pArg: *mut c_void), +>; + +pub type HttpMallocFunction = ::Option *mut c_void>; +pub type HttpReallocFunction = + ::Option *mut c_void>; +pub type HttpFreeFunction = ::Option; +pub type HttpPasswordCB = ::Option< + unsafe extern "C" fn( + request: i32, + auth_type: HttpAuthType, + realm: *const u8, + username: *mut u8, + password: *mut u8, + need_entity: i32, + entity_body: *mut *mut u8, + entity_size: *mut usize, + save: *mut i32, + ) -> i32, +>; + +pub type socklen_t = u32; + +e! { + #[repr(u32)] + pub enum AudioFormat { + Stereo = 0, + Mono = 0x10, + } + + #[repr(u32)] + pub enum DisplayMode { + Lcd = 0, + } + + #[repr(u32)] + pub enum DisplayPixelFormat { + Psm5650 = 0, + Psm5551 = 1, + Psm4444 = 2, + Psm8888 = 3, + } + + #[repr(u32)] + pub enum DisplaySetBufSync { + Immediate = 0, + NextFrame = 1, + } + + #[repr(i32)] + pub enum AudioOutputFrequency { + Khz48 = 48000, + Khz44_1 = 44100, + Khz32 = 32000, + Khz24 = 24000, + Khz22_05 = 22050, + Khz16 = 16000, + Khz12 = 12000, + Khz11_025 = 11025, + Khz8 = 8000, + } + + #[repr(i32)] + pub enum AudioInputFrequency { + Khz44_1 = 44100, + Khz22_05 = 22050, + Khz11_025 = 11025, + } + + #[repr(u32)] + pub enum CtrlMode { + Digital = 0, + Analog, + } + + #[repr(i32)] + pub enum GeMatrixType { + Bone0 = 0, + Bone1, + Bone2, + Bone3, + Bone4, + Bone5, + Bone6, + Bone7, + World, + View, + Projection, + TexGen, + } + + #[repr(i32)] + pub enum GeListState { + Done = 0, + Queued, + DrawingDone, + StallReached, + CancelDone, + } + + #[repr(u8)] + pub enum GeCommand { + Nop = 0, + Vaddr = 0x1, + Iaddr = 0x2, + Prim = 0x4, + Bezier = 0x5, + Spline = 0x6, + BoundingBox = 0x7, + Jump = 0x8, + BJump = 0x9, + Call = 0xa, + Ret = 0xb, + End = 0xc, + Signal = 0xe, + Finish = 0xf, + Base = 0x10, + VertexType = 0x12, + OffsetAddr = 0x13, + Origin = 0x14, + Region1 = 0x15, + Region2 = 0x16, + LightingEnable = 0x17, + LightEnable0 = 0x18, + LightEnable1 = 0x19, + LightEnable2 = 0x1a, + LightEnable3 = 0x1b, + DepthClampEnable = 0x1c, + CullFaceEnable = 0x1d, + TextureMapEnable = 0x1e, + FogEnable = 0x1f, + DitherEnable = 0x20, + AlphaBlendEnable = 0x21, + AlphaTestEnable = 0x22, + ZTestEnable = 0x23, + StencilTestEnable = 0x24, + AntiAliasEnable = 0x25, + PatchCullEnable = 0x26, + ColorTestEnable = 0x27, + LogicOpEnable = 0x28, + BoneMatrixNumber = 0x2a, + BoneMatrixData = 0x2b, + MorphWeight0 = 0x2c, + MorphWeight1 = 0x2d, + MorphWeight2 = 0x2e, + MorphWeight3 = 0x2f, + MorphWeight4 = 0x30, + MorphWeight5 = 0x31, + MorphWeight6 = 0x32, + MorphWeight7 = 0x33, + PatchDivision = 0x36, + PatchPrimitive = 0x37, + PatchFacing = 0x38, + WorldMatrixNumber = 0x3a, + WorldMatrixData = 0x3b, + ViewMatrixNumber = 0x3c, + ViewMatrixData = 0x3d, + ProjMatrixNumber = 0x3e, + ProjMatrixData = 0x3f, + TGenMatrixNumber = 0x40, + TGenMatrixData = 0x41, + ViewportXScale = 0x42, + ViewportYScale = 0x43, + ViewportZScale = 0x44, + ViewportXCenter = 0x45, + ViewportYCenter = 0x46, + ViewportZCenter = 0x47, + TexScaleU = 0x48, + TexScaleV = 0x49, + TexOffsetU = 0x4a, + TexOffsetV = 0x4b, + OffsetX = 0x4c, + OffsetY = 0x4d, + ShadeMode = 0x50, + ReverseNormal = 0x51, + MaterialUpdate = 0x53, + MaterialEmissive = 0x54, + MaterialAmbient = 0x55, + MaterialDiffuse = 0x56, + MaterialSpecular = 0x57, + MaterialAlpha = 0x58, + MaterialSpecularCoef = 0x5b, + AmbientColor = 0x5c, + AmbientAlpha = 0x5d, + LightMode = 0x5e, + LightType0 = 0x5f, + LightType1 = 0x60, + LightType2 = 0x61, + LightType3 = 0x62, + Light0X = 0x63, + Light0Y, + Light0Z, + Light1X, + Light1Y, + Light1Z, + Light2X, + Light2Y, + Light2Z, + Light3X, + Light3Y, + Light3Z, + Light0DirectionX = 0x6f, + Light0DirectionY, + Light0DirectionZ, + Light1DirectionX, + Light1DirectionY, + Light1DirectionZ, + Light2DirectionX, + Light2DirectionY, + Light2DirectionZ, + Light3DirectionX, + Light3DirectionY, + Light3DirectionZ, + Light0ConstantAtten = 0x7b, + Light0LinearAtten, + Light0QuadtraticAtten, + Light1ConstantAtten, + Light1LinearAtten, + Light1QuadtraticAtten, + Light2ConstantAtten, + Light2LinearAtten, + Light2QuadtraticAtten, + Light3ConstantAtten, + Light3LinearAtten, + Light3QuadtraticAtten, + Light0ExponentAtten = 0x87, + Light1ExponentAtten, + Light2ExponentAtten, + Light3ExponentAtten, + Light0CutoffAtten = 0x8b, + Light1CutoffAtten, + Light2CutoffAtten, + Light3CutoffAtten, + Light0Ambient = 0x8f, + Light0Diffuse, + Light0Specular, + Light1Ambient, + Light1Diffuse, + Light1Specular, + Light2Ambient, + Light2Diffuse, + Light2Specular, + Light3Ambient, + Light3Diffuse, + Light3Specular, + Cull = 0x9b, + FrameBufPtr = 0x9c, + FrameBufWidth = 0x9d, + ZBufPtr = 0x9e, + ZBufWidth = 0x9f, + TexAddr0 = 0xa0, + TexAddr1, + TexAddr2, + TexAddr3, + TexAddr4, + TexAddr5, + TexAddr6, + TexAddr7, + TexBufWidth0 = 0xa8, + TexBufWidth1, + TexBufWidth2, + TexBufWidth3, + TexBufWidth4, + TexBufWidth5, + TexBufWidth6, + TexBufWidth7, + ClutAddr = 0xb0, + ClutAddrUpper = 0xb1, + TransferSrc, + TransferSrcW, + TransferDst, + TransferDstW, + TexSize0 = 0xb8, + TexSize1, + TexSize2, + TexSize3, + TexSize4, + TexSize5, + TexSize6, + TexSize7, + TexMapMode = 0xc0, + TexShadeLs = 0xc1, + TexMode = 0xc2, + TexFormat = 0xc3, + LoadClut = 0xc4, + ClutFormat = 0xc5, + TexFilter = 0xc6, + TexWrap = 0xc7, + TexLevel = 0xc8, + TexFunc = 0xc9, + TexEnvColor = 0xca, + TexFlush = 0xcb, + TexSync = 0xcc, + Fog1 = 0xcd, + Fog2 = 0xce, + FogColor = 0xcf, + TexLodSlope = 0xd0, + FramebufPixFormat = 0xd2, + ClearMode = 0xd3, + Scissor1 = 0xd4, + Scissor2 = 0xd5, + MinZ = 0xd6, + MaxZ = 0xd7, + ColorTest = 0xd8, + ColorRef = 0xd9, + ColorTestmask = 0xda, + AlphaTest = 0xdb, + StencilTest = 0xdc, + StencilOp = 0xdd, + ZTest = 0xde, + BlendMode = 0xdf, + BlendFixedA = 0xe0, + BlendFixedB = 0xe1, + Dith0 = 0xe2, + Dith1, + Dith2, + Dith3, + LogicOp = 0xe6, + ZWriteDisable = 0xe7, + MaskRgb = 0xe8, + MaskAlpha = 0xe9, + TransferStart = 0xea, + TransferSrcPos = 0xeb, + TransferDstPos = 0xec, + TransferSize = 0xee, + Vscx = 0xf0, + Vscy = 0xf1, + Vscz = 0xf2, + Vtcs = 0xf3, + Vtct = 0xf4, + Vtcq = 0xf5, + Vcv = 0xf6, + Vap = 0xf7, + Vfc = 0xf8, + Vscv = 0xf9, + + Unknown03 = 0x03, + Unknown0D = 0x0d, + Unknown11 = 0x11, + Unknown29 = 0x29, + Unknown34 = 0x34, + Unknown35 = 0x35, + Unknown39 = 0x39, + Unknown4E = 0x4e, + Unknown4F = 0x4f, + Unknown52 = 0x52, + Unknown59 = 0x59, + Unknown5A = 0x5a, + UnknownB6 = 0xb6, + UnknownB7 = 0xb7, + UnknownD1 = 0xd1, + UnknownED = 0xed, + UnknownEF = 0xef, + UnknownFA = 0xfa, + UnknownFB = 0xfb, + UnknownFC = 0xfc, + UnknownFD = 0xfd, + UnknownFE = 0xfe, + NopFF = 0xff, + } + + #[repr(i32)] + pub enum SceSysMemPartitionId { + SceKernelUnknownPartition = 0, + SceKernelPrimaryKernelPartition = 1, + SceKernelPrimaryUserPartition = 2, + SceKernelOtherKernelPartition1 = 3, + SceKernelOtherKernelPartition2 = 4, + SceKernelVshellPARTITION = 5, + SceKernelScUserPartition = 6, + SceKernelMeUserPartition = 7, + SceKernelExtendedScKernelPartition = 8, + SceKernelExtendedSc2KernelPartition = 9, + SceKernelExtendedMeKernelPartition = 10, + SceKernelVshellKernelPartition = 11, + SceKernelExtendedKernelPartition = 12, + } + + #[repr(i32)] + pub enum SceSysMemBlockTypes { + Low = 0, + High, + Addr, + } + + #[repr(u32)] + pub enum Interrupt { + Gpio = 4, + Ata = 5, + Umd = 6, + Mscm0 = 7, + Wlan = 8, + Audio = 10, + I2c = 12, + Sircs = 14, + Systimer0 = 15, + Systimer1 = 16, + Systimer2 = 17, + Systimer3 = 18, + Thread0 = 19, + Nand = 20, + Dmacplus = 21, + Dma0 = 22, + Dma1 = 23, + Memlmd = 24, + Ge = 25, + Vblank = 30, + Mecodec = 31, + Hpremote = 36, + Mscm1 = 60, + Mscm2 = 61, + Thread1 = 65, + Interrupt = 66, + } + + #[repr(u32)] + pub enum SubInterrupt { + Gpio = Interrupt::Gpio as u32, + Ata = Interrupt::Ata as u32, + Umd = Interrupt::Umd as u32, + Dmacplus = Interrupt::Dmacplus as u32, + Ge = Interrupt::Ge as u32, + Display = Interrupt::Vblank as u32, + } + + #[repr(u32)] + pub enum SceKernelIdListType { + Thread = 1, + Semaphore = 2, + EventFlag = 3, + Mbox = 4, + Vpl = 5, + Fpl = 6, + Mpipe = 7, + Callback = 8, + ThreadEventHandler = 9, + Alarm = 10, + VTimer = 11, + SleepThread = 64, + DelayThread = 65, + SuspendThread = 66, + DormantThread = 67, + } + + #[repr(i32)] + pub enum UsbCamResolution { + Px160_120 = 0, + Px176_144 = 1, + Px320_240 = 2, + Px352_288 = 3, + Px640_480 = 4, + Px1024_768 = 5, + Px1280_960 = 6, + Px480_272 = 7, + Px360_272 = 8, + } + + #[repr(i32)] + pub enum UsbCamResolutionEx { + Px160_120 = 0, + Px176_144 = 1, + Px320_240 = 2, + Px352_288 = 3, + Px360_272 = 4, + Px480_272 = 5, + Px640_480 = 6, + Px1024_768 = 7, + Px1280_960 = 8, + } + + #[repr(i32)] + pub enum UsbCamDelay { + NoDelay = 0, + Delay10Sec = 1, + Delay20Sec = 2, + Delay30Sec = 3, + } + + #[repr(i32)] + pub enum UsbCamFrameRate { + Fps3_75 = 0, + Fps5 = 1, + Fps7_5 = 2, + Fps10 = 3, + Fps15 = 4, + Fps20 = 5, + Fps30 = 6, + Fps60 = 7, + } + + #[repr(i32)] + pub enum UsbCamWb { + Auto = 0, + Daylight = 1, + Fluorescent = 2, + Incadescent = 3, + } + + #[repr(i32)] + pub enum UsbCamEffectMode { + Normal = 0, + Negative = 1, + Blackwhite = 2, + Sepia = 3, + Blue = 4, + Red = 5, + Green = 6, + } + + #[repr(i32)] + pub enum UsbCamEvLevel { + Pos2_0 = 0, + Pos1_7 = 1, + Pos1_5 = 2, + Pos1_3 = 3, + Pos1_0 = 4, + Pos0_7 = 5, + Pos0_5 = 6, + Pos0_3 = 7, + Zero = 8, + Neg0_3, + Neg0_5, + Neg0_7, + Neg1_0, + Neg1_3, + Neg1_5, + Neg1_7, + Neg2_0, + } + + #[repr(i32)] + pub enum RtcCheckValidError { + InvalidYear = -1, + InvalidMonth = -2, + InvalidDay = -3, + InvalidHour = -4, + InvalidMinutes = -5, + InvalidSeconds = -6, + InvalidMicroseconds = -7, + } + + #[repr(u32)] + pub enum PowerTick { + All = 0, + Suspend = 1, + Display = 6, + } + + #[repr(u32)] + pub enum IoAssignPerms { + RdWr = 0, + RdOnly = 1, + } + + #[repr(u32)] + pub enum IoWhence { + Set = 0, + Cur = 1, + End = 2, + } + + #[repr(u32)] + pub enum UmdType { + Game = 0x10, + Video = 0x20, + Audio = 0x40, + } + + #[repr(u32)] + pub enum GuPrimitive { + Points = 0, + Lines = 1, + LineStrip = 2, + Triangles = 3, + TriangleStrip = 4, + TriangleFan = 5, + Sprites = 6, + } + + #[repr(u32)] + pub enum PatchPrimitive { + Points = 0, + LineStrip = 2, + TriangleStrip = 4, + } + + #[repr(u32)] + pub enum GuState { + AlphaTest = 0, + DepthTest = 1, + ScissorTest = 2, + StencilTest = 3, + Blend = 4, + CullFace = 5, + Dither = 6, + Fog = 7, + ClipPlanes = 8, + Texture2D = 9, + Lighting = 10, + Light0 = 11, + Light1 = 12, + Light2 = 13, + Light3 = 14, + LineSmooth = 15, + PatchCullFace = 16, + ColorTest = 17, + ColorLogicOp = 18, + FaceNormalReverse = 19, + PatchFace = 20, + Fragment2X = 21, + } + + #[repr(u32)] + pub enum MatrixMode { + Projection = 0, + View = 1, + Model = 2, + Texture = 3, + } + + #[repr(u32)] + pub enum TexturePixelFormat { + Psm5650 = 0, + Psm5551 = 1, + Psm4444 = 2, + Psm8888 = 3, + PsmT4 = 4, + PsmT8 = 5, + PsmT16 = 6, + PsmT32 = 7, + PsmDxt1 = 8, + PsmDxt3 = 9, + PsmDxt5 = 10, + } + + #[repr(u32)] + pub enum SplineMode { + FillFill = 0, + OpenFill = 1, + FillOpen = 2, + OpenOpen = 3, + } + + #[repr(u32)] + pub enum ShadingModel { + Flat = 0, + Smooth = 1, + } + + #[repr(u32)] + pub enum LogicalOperation { + Clear = 0, + And = 1, + AndReverse = 2, + Copy = 3, + AndInverted = 4, + Noop = 5, + Xor = 6, + Or = 7, + Nor = 8, + Equiv = 9, + Inverted = 10, + OrReverse = 11, + CopyInverted = 12, + OrInverted = 13, + Nand = 14, + Set = 15, + } + + #[repr(u32)] + pub enum TextureFilter { + Nearest = 0, + Linear = 1, + NearestMipmapNearest = 4, + LinearMipmapNearest = 5, + NearestMipmapLinear = 6, + LinearMipmapLinear = 7, + } + + #[repr(u32)] + pub enum TextureMapMode { + TextureCoords = 0, + TextureMatrix = 1, + EnvironmentMap = 2, + } + + #[repr(u32)] + pub enum TextureLevelMode { + Auto = 0, + Const = 1, + Slope = 2, + } + + #[repr(u32)] + pub enum TextureProjectionMapMode { + Position = 0, + Uv = 1, + NormalizedNormal = 2, + Normal = 3, + } + + #[repr(u32)] + pub enum GuTexWrapMode { + Repeat = 0, + Clamp = 1, + } + + #[repr(u32)] + pub enum FrontFaceDirection { + Clockwise = 0, + CounterClockwise = 1, + } + + #[repr(u32)] + pub enum AlphaFunc { + Never = 0, + Always, + Equal, + NotEqual, + Less, + LessOrEqual, + Greater, + GreaterOrEqual, + } + + #[repr(u32)] + pub enum StencilFunc { + Never = 0, + Always, + Equal, + NotEqual, + Less, + LessOrEqual, + Greater, + GreaterOrEqual, + } + + #[repr(u32)] + pub enum ColorFunc { + Never = 0, + Always, + Equal, + NotEqual, + } + + #[repr(u32)] + pub enum DepthFunc { + Never = 0, + Always, + Equal, + NotEqual, + Less, + LessOrEqual, + Greater, + GreaterOrEqual, + } + + #[repr(u32)] + pub enum TextureEffect { + Modulate = 0, + Decal = 1, + Blend = 2, + Replace = 3, + Add = 4, + } + + #[repr(u32)] + pub enum TextureColorComponent { + Rgb = 0, + Rgba = 1, + } + + #[repr(u32)] + pub enum MipmapLevel { + None = 0, + Level1, + Level2, + Level3, + Level4, + Level5, + Level6, + Level7, + } + + #[repr(u32)] + pub enum BlendOp { + Add = 0, + Subtract = 1, + ReverseSubtract = 2, + Min = 3, + Max = 4, + Abs = 5, + } + + #[repr(u32)] + pub enum BlendSrc { + SrcColor = 0, + OneMinusSrcColor = 1, + SrcAlpha = 2, + OneMinusSrcAlpha = 3, + Fix = 10, + } + + #[repr(u32)] + pub enum BlendDst { + DstColor = 0, + OneMinusDstColor = 1, + DstAlpha = 4, + OneMinusDstAlpha = 5, + Fix = 10, + } + + #[repr(u32)] + pub enum StencilOperation { + Keep = 0, + Zero = 1, + Replace = 2, + Invert = 3, + Incr = 4, + Decr = 5, + } + + #[repr(u32)] + pub enum LightMode { + SingleColor = 0, + SeparateSpecularColor = 1, + } + + #[repr(u32)] + pub enum LightType { + Directional = 0, + Pointlight = 1, + Spotlight = 2, + } + + #[repr(u32)] + pub enum GuContextType { + Direct = 0, + Call = 1, + Send = 2, + } + + #[repr(u32)] + pub enum GuQueueMode { + Tail = 0, + Head = 1, + } + + #[repr(u32)] + pub enum GuSyncMode { + Finish = 0, + Signal = 1, + Done = 2, + List = 3, + Send = 4, + } + + #[repr(u32)] + pub enum GuSyncBehavior { + Wait = 0, + NoWait = 1, + } + + #[repr(u32)] + pub enum GuCallbackId { + Signal = 1, + Finish = 4, + } + + #[repr(u32)] + pub enum SignalBehavior { + Suspend = 1, + Continue = 2, + } + + #[repr(u32)] + pub enum ClutPixelFormat { + Psm5650 = 0, + Psm5551 = 1, + Psm4444 = 2, + Psm8888 = 3, + } + + #[repr(C)] + pub enum KeyType { + Directory = 1, + Integer = 2, + String = 3, + Bytes = 4, + } + + #[repr(u32)] + pub enum UtilityMsgDialogMode { + Error, + Text, + } + + #[repr(u32)] + pub enum UtilityMsgDialogPressed { + Unknown1, + Yes, + No, + Back, + } + + #[repr(u32)] + pub enum UtilityDialogButtonAccept { + Circle, + Cross, + } + + #[repr(u32)] + pub enum SceUtilityOskInputLanguage { + Default, + Japanese, + English, + French, + Spanish, + German, + Italian, + Dutch, + Portugese, + Russian, + Korean, + } + + #[repr(u32)] + pub enum SceUtilityOskInputType { + All, + LatinDigit, + LatinSymbol, + LatinLowercase = 4, + LatinUppercase = 8, + JapaneseDigit = 0x100, + JapaneseSymbol = 0x200, + JapaneseLowercase = 0x400, + JapaneseUppercase = 0x800, + JapaneseHiragana = 0x1000, + JapaneseHalfWidthKatakana = 0x2000, + JapaneseKatakana = 0x4000, + JapaneseKanji = 0x8000, + RussianLowercase = 0x10000, + RussianUppercase = 0x20000, + Korean = 0x40000, + Url = 0x80000, + } + + #[repr(u32)] + pub enum SceUtilityOskState { + None, + Initializing, + Initialized, + Visible, + Quit, + Finished, + } + + #[repr(u32)] + pub enum SceUtilityOskResult { + Unchanged, + Cancelled, + Changed, + } + + #[repr(u32)] + pub enum SystemParamLanguage { + Japanese, + English, + French, + Spanish, + German, + Italian, + Dutch, + Portugese, + Russian, + Korean, + ChineseTraditional, + ChineseSimplified, + } + + #[repr(u32)] + pub enum SystemParamId { + StringNickname = 1, + AdhocChannel, + WlanPowerSave, + DateFormat, + TimeFormat, + Timezone, + DaylightSavings, + Language, + Unknown, + } + + #[repr(u32)] + pub enum SystemParamAdhocChannel { + ChannelAutomatic = 0, + Channel1 = 1, + Channel6 = 6, + Channel11 = 11, + } + + #[repr(u32)] + pub enum SystemParamWlanPowerSaveState { + Off, + On, + } + + #[repr(u32)] + pub enum SystemParamDateFormat { + YYYYMMDD, + MMDDYYYY, + DDMMYYYY, + } + + #[repr(u32)] + pub enum SystemParamTimeFormat { + Hour24, + Hour12, + } + + #[repr(u32)] + pub enum SystemParamDaylightSavings { + Std, + Dst, + } + + #[repr(u32)] + pub enum AvModule { + AvCodec, + SasCore, + Atrac3Plus, + MpegBase, + Mp3, + Vaudio, + Aac, + G729, + } + + #[repr(u32)] + pub enum Module { + NetCommon = 0x100, + NetAdhoc, + NetInet, + NetParseUri, + NetHttp, + NetSsl, + + UsbPspCm = 0x200, + UsbMic, + UsbCam, + UsbGps, + + AvCodec = 0x300, + AvSascore, + AvAtrac3Plus, + AvMpegBase, + AvMp3, + AvVaudio, + AvAac, + AvG729, + + NpCommon = 0x400, + NpService, + NpMatching2, + NpDrm = 0x500, + + Irda = 0x600, + } + + #[repr(u32)] + pub enum NetModule { + NetCommon = 1, + NetAdhoc, + NetInet, + NetParseUri, + NetHttp, + NetSsl, + } + + #[repr(u32)] + pub enum UsbModule { + UsbPspCm = 1, + UsbAcc, + UsbMic, + UsbCam, + UsbGps, + } + + #[repr(u32)] + pub enum NetParam { + Name, + Ssid, + Secure, + WepKey, + IsStaticIp, + Ip, + NetMask, + Route, + ManualDns, + PrimaryDns, + SecondaryDns, + ProxyUser, + ProxyPass, + UseProxy, + ProxyServer, + ProxyPort, + Unknown1, + Unknown2, + } + + #[repr(u32)] + pub enum UtilityNetconfAction { + ConnectAP, + DisplayStatus, + ConnectAdhoc, + } + + #[repr(u32)] + pub enum UtilitySavedataMode { + AutoLoad, + AutoSave, + Load, + Save, + ListLoad, + ListSave, + ListDelete, + Delete, + } + + #[repr(u32)] + pub enum UtilitySavedataFocus { + Unknown1, + FirstList, + LastList, + Latest, + Oldest, + Unknown2, + Unknown3, + FirstEmpty, + LastEmpty, + } + + #[repr(u32)] + pub enum UtilityGameSharingMode { + Single = 1, + Multiple, + } + + #[repr(u32)] + pub enum UtilityGameSharingDataType { + File = 1, + Memory, + } + + #[repr(u32)] + pub enum UtilityHtmlViewerInterfaceMode { + Full, + Limited, + None, + } + + #[repr(u32)] + pub enum UtilityHtmlViewerCookieMode { + Disabled = 0, + Enabled, + Confirm, + Default, + } + + #[repr(u32)] + pub enum UtilityHtmlViewerTextSize { + Large, + Normal, + Small, + } + + #[repr(u32)] + pub enum UtilityHtmlViewerDisplayMode { + Normal, + Fit, + SmartFit, + } + + #[repr(u32)] + pub enum UtilityHtmlViewerConnectMode { + Last, + ManualOnce, + ManualAll, + } + + #[repr(u32)] + pub enum UtilityHtmlViewerDisconnectMode { + Enable, + Disable, + Confirm, + } + + #[repr(u32)] + pub enum ScePspnetAdhocPtpState { + Closed, + Listen, + SynSent, + SynReceived, + Established, + } + + #[repr(u32)] + pub enum AdhocMatchingMode { + Host = 1, + Client, + Ptp, + } + + #[repr(u32)] + pub enum ApctlState { + Disconnected, + Scanning, + Joining, + GettingIp, + GotIp, + EapAuth, + KeyExchange, + } + + #[repr(u32)] + pub enum ApctlEvent { + ConnectRequest, + ScanRequest, + ScanComplete, + Established, + GetIp, + DisconnectRequest, + Error, + Info, + EapAuth, + KeyExchange, + Reconnect, + } + + #[repr(u32)] + pub enum ApctlInfo { + ProfileName, + Bssid, + Ssid, + SsidLength, + SecurityType, + Strength, + Channel, + PowerSave, + Ip, + SubnetMask, + Gateway, + PrimaryDns, + SecondaryDns, + UseProxy, + ProxyUrl, + ProxyPort, + EapType, + StartBrowser, + Wifisp, + } + + #[repr(u32)] + pub enum ApctlInfoSecurityType { + None, + Wep, + Wpa, + } + + #[repr(u32)] + pub enum HttpMethod { + Get, + Post, + Head, + } + + #[repr(u32)] + pub enum HttpAuthType { + Basic, + Digest, + } +} + +s_paren! { + #[repr(transparent)] + pub struct SceUid(pub i32); + + #[repr(transparent)] + pub struct SceMpeg(*mut *mut c_void); + + #[repr(transparent)] + pub struct SceMpegStream(*mut c_void); + + #[repr(transparent)] + pub struct Mp3Handle(pub i32); + + #[repr(transparent)] + pub struct RegHandle(u32); +} + +s! { + pub struct sockaddr { + pub sa_len: u8, + pub sa_family: u8, + pub sa_data: [u8;14], + } + + pub struct in_addr { + pub s_addr: u32, + } + + pub struct AudioInputParams { + pub unknown1: i32, + pub gain: i32, + pub unknown2: i32, + pub unknown3: i32, + pub unknown4: i32, + pub unknown5: i32, + } + + pub struct Atrac3BufferInfo { + pub puc_write_position_first_buf: *mut u8, + pub ui_writable_byte_first_buf: u32, + pub ui_min_write_byte_first_buf: u32, + pub ui_read_position_first_buf: u32, + pub puc_write_position_second_buf: *mut u8, + pub ui_writable_byte_second_buf: u32, + pub ui_min_write_byte_second_buf: u32, + pub ui_read_position_second_buf: u32, + } + + pub struct SceCtrlData { + pub timestamp: u32, + pub buttons: i32, + pub lx: u8, + pub ly: u8, + pub rsrv: [u8; 6], + } + + pub struct SceCtrlLatch { + pub ui_make: u32, + pub ui_break: u32, + pub ui_press: u32, + pub ui_release: u32, + } + + pub struct GeStack { + pub stack: [u32; 8], + } + + pub struct GeCallbackData { + pub signal_func: ::Option, + pub signal_arg: *mut c_void, + pub finish_func: ::Option, + pub finish_arg: *mut c_void, + } + + pub struct GeListArgs { + pub size: u32, + pub context: *mut GeContext, + pub num_stacks: u32, + pub stacks: *mut GeStack, + } + + pub struct GeBreakParam { + pub buf: [u32; 4], + } + + pub struct SceKernelLoadExecParam { + pub size: usize, + pub args: usize, + pub argp: *mut c_void, + pub key: *const u8, + } + + pub struct timeval { + pub tv_sec: i32, + pub tv_usec: i32, + } + + pub struct timezone { + pub tz_minutes_west: i32, + pub tz_dst_time: i32, + } + + pub struct IntrHandlerOptionParam { + size: i32, + entry: u32, + common: u32, + gp: u32, + intr_code: u16, + sub_count: u16, + intr_level: u16, + enabled: u16, + calls: u32, + field_1c: u32, + total_clock_lo: u32, + total_clock_hi: u32, + min_clock_lo: u32, + min_clock_hi: u32, + max_clock_lo: u32, + max_clock_hi: u32, + } + + pub struct SceKernelLMOption { + pub size: usize, + pub m_pid_text: SceUid, + pub m_pid_data: SceUid, + pub flags: u32, + pub position: u8, + pub access: u8, + pub c_reserved: [u8; 2usize], + } + + pub struct SceKernelSMOption { + pub size: usize, + pub m_pid_stack: SceUid, + pub stack_size: usize, + pub priority: i32, + pub attribute: u32, + } + + pub struct SceKernelModuleInfo { + pub size: usize, + pub n_segment: u8, + pub reserved: [u8; 3usize], + pub segment_addr: [i32; 4usize], + pub segment_size: [i32; 4usize], + pub entry_addr: u32, + pub gp_value: u32, + pub text_addr: u32, + pub text_size: u32, + pub data_size: u32, + pub bss_size: u32, + pub attribute: u16, + pub version: [u8; 2usize], + pub name: [u8; 28usize], + } + + pub struct DebugProfilerRegs { + pub enable: u32, + pub systemck: u32, + pub cpuck: u32, + pub internal: u32, + pub memory: u32, + pub copz: u32, + pub vfpu: u32, + pub sleep: u32, + pub bus_access: u32, + pub uncached_load: u32, + pub uncached_store: u32, + pub cached_load: u32, + pub cached_store: u32, + pub i_miss: u32, + pub d_miss: u32, + pub d_writeback: u32, + pub cop0_inst: u32, + pub fpu_inst: u32, + pub vfpu_inst: u32, + pub local_bus: u32, + } + + pub struct SceKernelSysClock { + pub low: u32, + pub hi: u32, + } + + pub struct SceKernelThreadOptParam { + pub size: usize, + pub stack_mpid: SceUid, + } + + pub struct SceKernelThreadInfo { + pub size: usize, + pub name: [u8; 32], + pub attr: u32, + pub status: i32, + pub entry: SceKernelThreadEntry, + pub stack: *mut c_void, + pub stack_size: i32, + pub gp_reg: *mut c_void, + pub init_priority: i32, + pub current_priority: i32, + pub wait_type: i32, + pub wait_id: SceUid, + pub wakeup_count: i32, + pub exit_status: i32, + pub run_clocks: SceKernelSysClock, + pub intr_preempt_count: u32, + pub thread_preempt_count: u32, + pub release_count: u32, + } + + pub struct SceKernelThreadRunStatus { + pub size: usize, + pub status: i32, + pub current_priority: i32, + pub wait_type: i32, + pub wait_id: i32, + pub wakeup_count: i32, + pub run_clocks: SceKernelSysClock, + pub intr_preempt_count: u32, + pub thread_preempt_count: u32, + pub release_count: u32, + } + + pub struct SceKernelSemaOptParam { + pub size: usize, + } + + pub struct SceKernelSemaInfo { + pub size: usize, + pub name: [u8; 32], + pub attr: u32, + pub init_count: i32, + pub current_count: i32, + pub max_count: i32, + pub num_wait_threads: i32, + } + + pub struct SceKernelEventFlagInfo { + pub size: usize, + pub name: [u8; 32], + pub attr: u32, + pub init_pattern: u32, + pub current_pattern: u32, + pub num_wait_threads: i32, + } + + pub struct SceKernelEventFlagOptParam { + pub size: usize, + } + + pub struct SceKernelMbxOptParam { + pub size: usize, + } + + pub struct SceKernelMbxInfo { + pub size: usize, + pub name: [u8; 32usize], + pub attr: u32, + pub num_wait_threads: i32, + pub num_messages: i32, + pub first_message: *mut c_void, + } + + pub struct SceKernelVTimerInfo { + pub size: usize, + pub name: [u8; 32], + pub active: i32, + pub base: SceKernelSysClock, + pub current: SceKernelSysClock, + pub schedule: SceKernelSysClock, + pub handler: SceKernelVTimerHandler, + pub common: *mut c_void, + } + + pub struct SceKernelThreadEventHandlerInfo { + pub size: usize, + pub name: [u8; 32], + pub thread_id: SceUid, + pub mask: i32, + pub handler: SceKernelThreadEventHandler, + pub common: *mut c_void, + } + + pub struct SceKernelAlarmInfo { + pub size: usize, + pub schedule: SceKernelSysClock, + pub handler: SceKernelAlarmHandler, + pub common: *mut c_void, + } + + pub struct SceKernelSystemStatus { + pub size: usize, + pub status: u32, + pub idle_clocks: SceKernelSysClock, + pub comes_out_of_idle_count: u32, + pub thread_switch_count: u32, + pub vfpu_switch_count: u32, + } + + pub struct SceKernelMppInfo { + pub size: usize, + pub name: [u8; 32], + pub attr: u32, + pub buf_size: i32, + pub free_size: i32, + pub num_send_wait_threads: i32, + pub num_receive_wait_threads: i32, + } + + pub struct SceKernelVplOptParam { + pub size: usize, + } + + pub struct SceKernelVplInfo { + pub size: usize, + pub name: [u8; 32], + pub attr: u32, + pub pool_size: i32, + pub free_size: i32, + pub num_wait_threads: i32, + } + + pub struct SceKernelFplOptParam { + pub size: usize, + } + + pub struct SceKernelFplInfo { + pub size: usize, + pub name: [u8; 32usize], + pub attr: u32, + pub block_size: i32, + pub num_blocks: i32, + pub free_blocks: i32, + pub num_wait_threads: i32, + } + + pub struct SceKernelVTimerOptParam { + pub size: usize, + } + + pub struct SceKernelCallbackInfo { + pub size: usize, + pub name: [u8; 32usize], + pub thread_id: SceUid, + pub callback: SceKernelCallbackFunction, + pub common: *mut c_void, + pub notify_count: i32, + pub notify_arg: i32, + } + + pub struct UsbCamSetupStillParam { + pub size: i32, + pub resolution: UsbCamResolution, + pub jpeg_size: i32, + pub reverse_flags: i32, + pub delay: UsbCamDelay, + pub comp_level: i32, + } + + pub struct UsbCamSetupStillExParam { + pub size: i32, + pub unk: u32, + pub resolution: UsbCamResolutionEx, + pub jpeg_size: i32, + pub comp_level: i32, + pub unk2: u32, + pub unk3: u32, + pub flip: i32, + pub mirror: i32, + pub delay: UsbCamDelay, + pub unk4: [u32; 5usize], + } + + pub struct UsbCamSetupVideoParam { + pub size: i32, + pub resolution: UsbCamResolution, + pub framerate: UsbCamFrameRate, + pub white_balance: UsbCamWb, + pub saturation: i32, + pub brightness: i32, + pub contrast: i32, + pub sharpness: i32, + pub effect_mode: UsbCamEffectMode, + pub frame_size: i32, + pub unk: u32, + pub evl_evel: UsbCamEvLevel, + } + + pub struct UsbCamSetupVideoExParam { + pub size: i32, + pub unk: u32, + pub resolution: UsbCamResolutionEx, + pub framerate: UsbCamFrameRate, + pub unk2: u32, + pub unk3: u32, + pub white_balance: UsbCamWb, + pub saturation: i32, + pub brightness: i32, + pub contrast: i32, + pub sharpness: i32, + pub unk4: u32, + pub unk5: u32, + pub unk6: [u32; 3usize], + pub effect_mode: UsbCamEffectMode, + pub unk7: u32, + pub unk8: u32, + pub unk9: u32, + pub unk10: u32, + pub unk11: u32, + pub frame_size: i32, + pub unk12: u32, + pub ev_level: UsbCamEvLevel, + } + + pub struct ScePspDateTime { + pub year: u16, + pub month: u16, + pub day: u16, + pub hour: u16, + pub minutes: u16, + pub seconds: u16, + pub microseconds: u32, + } + + pub struct SceIoStat { + pub st_mode: i32, + pub st_attr: i32, + pub st_size: i64, + pub st_ctime: ScePspDateTime, + pub st_atime: ScePspDateTime, + pub st_mtime: ScePspDateTime, + pub st_private: [u32; 6usize], + } + + pub struct UmdInfo { + pub size: u32, + pub type_: UmdType, + } + + pub struct SceMpegRingbuffer { + pub packets: i32, + pub unk0: u32, + pub unk1: u32, + pub unk2: u32, + pub unk3: u32, + pub data: *mut c_void, + pub callback: SceMpegRingbufferCb, + pub cb_param: *mut c_void, + pub unk4: u32, + pub unk5: u32, + pub sce_mpeg: *mut c_void, + } + + pub struct SceMpegAu { + pub pts_msb: u32, + pub pts: u32, + pub dts_msb: u32, + pub dts: u32, + pub es_buffer: u32, + pub au_size: u32, + } + + pub struct SceMpegAvcMode { + pub unk0: i32, + pub pixel_format: super::DisplayPixelFormat, + } + + #[repr(align(64))] + pub struct SceMpegLLI { + pub src: *mut c_void, + pub dst: *mut c_void, + pub next: *mut c_void, + pub size: i32, + } + + #[repr(align(64))] + pub struct SceMpegYCrCbBuffer { + pub frame_buffer_height16: i32, + pub frame_buffer_width16: i32, + pub unknown: i32, + pub unknown2: i32, + pub y_buffer: *mut c_void, + pub y_buffer2: *mut c_void, + pub cr_buffer: *mut c_void, + pub cb_buffer: *mut c_void, + pub cr_buffer2: *mut c_void, + pub cb_buffer2: *mut c_void, + + pub frame_height: i32, + pub frame_width: i32, + pub frame_buffer_width: i32, + pub unknown3: [i32; 11usize], + } + + pub struct ScePspSRect { + pub x: i16, + pub y: i16, + pub w: i16, + pub h: i16, + } + + pub struct ScePspIRect { + pub x: i32, + pub y: i32, + pub w: i32, + pub h: i32, + } + + pub struct ScePspL64Rect { + pub x: u64, + pub y: u64, + pub w: u64, + pub h: u64, + } + + pub struct ScePspSVector2 { + pub x: i16, + pub y: i16, + } + + pub struct ScePspIVector2 { + pub x: i32, + pub y: i32, + } + + pub struct ScePspL64Vector2 { + pub x: u64, + pub y: u64, + } + + pub struct ScePspSVector3 { + pub x: i16, + pub y: i16, + pub z: i16, + } + + pub struct ScePspIVector3 { + pub x: i32, + pub y: i32, + pub z: i32, + } + + pub struct ScePspL64Vector3 { + pub x: u64, + pub y: u64, + pub z: u64, + } + + pub struct ScePspSVector4 { + pub x: i16, + pub y: i16, + pub z: i16, + pub w: i16, + } + + pub struct ScePspIVector4 { + pub x: i32, + pub y: i32, + pub z: i32, + pub w: i32, + } + + pub struct ScePspL64Vector4 { + pub x: u64, + pub y: u64, + pub z: u64, + pub w: u64, + } + + pub struct ScePspIMatrix2 { + pub x: ScePspIVector2, + pub y: ScePspIVector2, + } + + pub struct ScePspIMatrix3 { + pub x: ScePspIVector3, + pub y: ScePspIVector3, + pub z: ScePspIVector3, + } + + #[repr(align(16))] + pub struct ScePspIMatrix4 { + pub x: ScePspIVector4, + pub y: ScePspIVector4, + pub z: ScePspIVector4, + pub w: ScePspIVector4, + } + + pub struct ScePspIMatrix4Unaligned { + pub x: ScePspIVector4, + pub y: ScePspIVector4, + pub z: ScePspIVector4, + pub w: ScePspIVector4, + } + + pub struct SceMp3InitArg { + pub mp3_stream_start: u32, + pub unk1: u32, + pub mp3_stream_end: u32, + pub unk2: u32, + pub mp3_buf: *mut c_void, + pub mp3_buf_size: i32, + pub pcm_buf: *mut c_void, + pub pcm_buf_size: i32, + } + + pub struct OpenPSID { + pub data: [u8; 16usize], + } + + pub struct UtilityDialogCommon { + pub size: u32, + pub language: SystemParamLanguage, + pub button_accept: UtilityDialogButtonAccept, + pub graphics_thread: i32, + pub access_thread: i32, + pub font_thread: i32, + pub sound_thread: i32, + pub result: i32, + pub reserved: [i32; 4usize], + } + + pub struct UtilityNetconfAdhoc { + pub name: [u8; 8usize], + pub timeout: u32, + } + + pub struct UtilityNetconfData { + pub base: UtilityDialogCommon, + pub action: UtilityNetconfAction, + pub adhocparam: *mut UtilityNetconfAdhoc, + pub hotspot: i32, + pub hotspot_connected: i32, + pub wifisp: i32, + } + + pub struct UtilitySavedataFileData { + pub buf: *mut c_void, + pub buf_size: usize, + pub size: usize, + pub unknown: i32, + } + + pub struct UtilitySavedataListSaveNewData { + pub icon0: UtilitySavedataFileData, + pub title: *mut u8, + } + + pub struct UtilityGameSharingParams { + pub base: UtilityDialogCommon, + pub unknown1: i32, + pub unknown2: i32, + pub name: [u8; 8usize], + pub unknown3: i32, + pub unknown4: i32, + pub unknown5: i32, + pub result: i32, + pub filepath: *mut u8, + pub mode: UtilityGameSharingMode, + pub datatype: UtilityGameSharingDataType, + pub data: *mut c_void, + pub datasize: u32, + } + + pub struct UtilityHtmlViewerParam { + pub base: UtilityDialogCommon, + pub memaddr: *mut c_void, + pub memsize: u32, + pub unknown1: i32, + pub unknown2: i32, + pub initialurl: *mut u8, + pub numtabs: u32, + pub interfacemode: UtilityHtmlViewerInterfaceMode, + pub options: i32, + pub dldirname: *mut u8, + pub dlfilename: *mut u8, + pub uldirname: *mut u8, + pub ulfilename: *mut u8, + pub cookiemode: UtilityHtmlViewerCookieMode, + pub unknown3: u32, + pub homeurl: *mut u8, + pub textsize: UtilityHtmlViewerTextSize, + pub displaymode: UtilityHtmlViewerDisplayMode, + pub connectmode: UtilityHtmlViewerConnectMode, + pub disconnectmode: UtilityHtmlViewerDisconnectMode, + pub memused: u32, + pub unknown4: [i32; 10usize], + } + + pub struct SceUtilityOskData { + pub unk_00: i32, + pub unk_04: i32, + pub language: SceUtilityOskInputLanguage, + pub unk_12: i32, + pub inputtype: SceUtilityOskInputType, + pub lines: i32, + pub unk_24: i32, + pub desc: *mut u16, + pub intext: *mut u16, + pub outtextlength: i32, + pub outtext: *mut u16, + pub result: SceUtilityOskResult, + pub outtextlimit: i32, + } + + pub struct SceUtilityOskParams { + pub base: UtilityDialogCommon, + pub datacount: i32, + pub data: *mut SceUtilityOskData, + pub state: SceUtilityOskState, + pub unk_60: i32, + } + + pub struct SceNetMallocStat { + pub pool: i32, + pub maximum: i32, + pub free: i32, + } + + pub struct SceNetAdhocctlAdhocId { + pub unknown: i32, + pub adhoc_id: [u8; 9usize], + pub unk: [u8; 3usize], + } + + pub struct SceNetAdhocctlScanInfo { + pub next: *mut SceNetAdhocctlScanInfo, + pub channel: i32, + pub name: [u8; 8usize], + pub bssid: [u8; 6usize], + pub unknown: [u8; 2usize], + pub unknown2: i32, + } + + pub struct SceNetAdhocctlGameModeInfo { + pub count: i32, + pub macs: [[u8; 6usize]; 16usize], + } + + pub struct SceNetAdhocPtpStat { + pub next: *mut SceNetAdhocPtpStat, + pub ptp_id: i32, + pub mac: [u8; 6usize], + pub peermac: [u8; 6usize], + pub port: u16, + pub peerport: u16, + pub sent_data: u32, + pub rcvd_data: u32, + pub state: ScePspnetAdhocPtpState, + } + + pub struct SceNetAdhocPdpStat { + pub next: *mut SceNetAdhocPdpStat, + pub pdp_id: i32, + pub mac: [u8; 6usize], + pub port: u16, + pub rcvd_data: u32, + } + + pub struct AdhocPoolStat { + pub size: i32, + pub maxsize: i32, + pub freesize: i32, + } +} + +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + pub struct GeContext { + pub context: [u32; 512], + } + + #[allow(missing_debug_implementations)] + pub struct SceKernelUtilsSha1Context { + pub h: [u32; 5usize], + pub us_remains: u16, + pub us_computed: u16, + pub ull_total_len: u64, + pub buf: [u8; 64usize], + } + + #[allow(missing_debug_implementations)] + pub struct SceKernelUtilsMt19937Context { + pub count: u32, + pub state: [u32; 624usize], + } + + #[allow(missing_debug_implementations)] + pub struct SceKernelUtilsMd5Context { + pub h: [u32; 4usize], + pub pad: u32, + pub us_remains: u16, + pub us_computed: u16, + pub ull_total_len: u64, + pub buf: [u8; 64usize], + } + + #[allow(missing_debug_implementations)] + pub struct SceIoDirent { + pub d_stat: SceIoStat, + pub d_name: [u8; 256usize], + pub d_private: *mut c_void, + pub dummy: i32, + } + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub struct ScePspFRect { + pub x: f32, + pub y: f32, + pub w: f32, + pub h: f32, + } + + #[repr(align(16))] + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub struct ScePspFVector3 { + pub x: f32, + pub y: f32, + pub z: f32, + } + + #[repr(align(16))] + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub struct ScePspFVector4 { + pub x: f32, + pub y: f32, + pub z: f32, + pub w: f32, + } + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub struct ScePspFVector4Unaligned { + pub x: f32, + pub y: f32, + pub z: f32, + pub w: f32, + } + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub struct ScePspFVector2 { + pub x: f32, + pub y: f32, + } + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub struct ScePspFMatrix2 { + pub x: ScePspFVector2, + pub y: ScePspFVector2, + } + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + pub struct ScePspFMatrix3 { + pub x: ScePspFVector3, + pub y: ScePspFVector3, + pub z: ScePspFVector3, + } + + #[cfg_attr(feature = "extra_traits", derive(Debug))] + #[repr(align(16))] + pub struct ScePspFMatrix4 { + pub x: ScePspFVector4, + pub y: ScePspFVector4, + pub z: ScePspFVector4, + pub w: ScePspFVector4, + } + + #[allow(missing_debug_implementations)] + pub struct ScePspFMatrix4Unaligned { + pub x: ScePspFVector4, + pub y: ScePspFVector4, + pub z: ScePspFVector4, + pub w: ScePspFVector4, + } + + #[allow(missing_debug_implementations)] + pub union ScePspVector3 { + pub fv: ScePspFVector3, + pub iv: ScePspIVector3, + pub f: [f32; 3usize], + pub i: [i32; 3usize], + } + + #[allow(missing_debug_implementations)] + pub union ScePspVector4 { + pub fv: ScePspFVector4, + pub iv: ScePspIVector4, + pub qw: u128, + pub f: [f32; 4usize], + pub i: [i32; 4usize], + } + + #[allow(missing_debug_implementations)] + pub union ScePspMatrix2 { + pub fm: ScePspFMatrix2, + pub im: ScePspIMatrix2, + pub fv: [ScePspFVector2; 2usize], + pub iv: [ScePspIVector2; 2usize], + pub v: [ScePspVector2; 2usize], + pub f: [[f32; 2usize]; 2usize], + pub i: [[i32; 2usize]; 2usize], + } + + #[allow(missing_debug_implementations)] + pub union ScePspMatrix3 { + pub fm: ScePspFMatrix3, + pub im: ScePspIMatrix3, + pub fv: [ScePspFVector3; 3usize], + pub iv: [ScePspIVector3; 3usize], + pub v: [ScePspVector3; 3usize], + pub f: [[f32; 3usize]; 3usize], + pub i: [[i32; 3usize]; 3usize], + } + + #[allow(missing_debug_implementations)] + pub union ScePspVector2 { + pub fv: ScePspFVector2, + pub iv: ScePspIVector2, + pub f: [f32; 2usize], + pub i: [i32; 2usize], + } + + #[allow(missing_debug_implementations)] + pub union ScePspMatrix4 { + pub fm: ScePspFMatrix4, + pub im: ScePspIMatrix4, + pub fv: [ScePspFVector4; 4usize], + pub iv: [ScePspIVector4; 4usize], + pub v: [ScePspVector4; 4usize], + pub f: [[f32; 4usize]; 4usize], + pub i: [[i32; 4usize]; 4usize], + } + + #[allow(missing_debug_implementations)] + pub struct Key { + pub key_type: KeyType, + pub name: [u8; 256usize], + pub name_len: u32, + pub unk2: u32, + pub unk3: u32, + } + + #[allow(missing_debug_implementations)] + pub struct UtilityMsgDialogParams { + pub base: UtilityDialogCommon, + pub unknown: i32, + pub mode: UtilityMsgDialogMode, + pub error_value: u32, + pub message: [u8; 512usize], + pub options: i32, + pub button_pressed: UtilityMsgDialogPressed, + } + + #[allow(missing_debug_implementations)] + pub union UtilityNetData { + pub as_uint: u32, + pub as_string: [u8; 128usize], + } + + #[allow(missing_debug_implementations)] + pub struct UtilitySavedataSFOParam { + pub title: [u8; 128usize], + pub savedata_title: [u8; 128usize], + pub detail: [u8; 1024usize], + pub parental_level: u8, + pub unknown: [u8; 3usize], + } + + #[allow(missing_debug_implementations)] + pub struct SceUtilitySavedataParam { + pub base: UtilityDialogCommon, + pub mode: UtilitySavedataMode, + pub unknown1: i32, + pub overwrite: i32, + pub game_name: [u8; 13usize], + pub reserved: [u8; 3usize], + pub save_name: [u8; 20usize], + pub save_name_list: *mut [u8; 20usize], + pub file_name: [u8; 13usize], + pub reserved1: [u8; 3usize], + pub data_buf: *mut c_void, + pub data_buf_size: usize, + pub data_size: usize, + pub sfo_param: UtilitySavedataSFOParam, + pub icon0_file_data: UtilitySavedataFileData, + pub icon1_file_data: UtilitySavedataFileData, + pub pic1_file_data: UtilitySavedataFileData, + pub snd0_file_data: UtilitySavedataFileData, + pub new_data: *mut UtilitySavedataListSaveNewData, + pub focus: UtilitySavedataFocus, + pub unknown2: [i32; 4usize], + pub key: [u8; 16], + pub unknown3: [u8; 20], + } + + #[allow(missing_debug_implementations)] + pub struct SceNetAdhocctlPeerInfo { + pub next: *mut SceNetAdhocctlPeerInfo, + pub nickname: [u8; 128usize], + pub mac: [u8; 6usize], + pub unknown: [u8; 6usize], + pub timestamp: u32, + } + + #[allow(missing_debug_implementations)] + pub struct SceNetAdhocctlParams { + pub channel: i32, + pub name: [u8; 8usize], + pub bssid: [u8; 6usize], + pub nickname: [u8; 128usize], + } + + #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] + pub union SceNetApctlInfo { + pub name: [u8; 64usize], + pub bssid: [u8; 6usize], + pub ssid: [u8; 32usize], + pub ssid_length: u32, + pub security_type: u32, + pub strength: u8, + pub channel: u8, + pub power_save: u8, + pub ip: [u8; 16usize], + pub sub_net_mask: [u8; 16usize], + pub gateway: [u8; 16usize], + pub primary_dns: [u8; 16usize], + pub secondary_dns: [u8; 16usize], + pub use_proxy: u32, + pub proxy_url: [u8; 128usize], + pub proxy_port: u16, + pub eap_type: u32, + pub start_browser: u32, + pub wifisp: u32, + } +} + +pub const INT_MIN: c_int = -2147483648; +pub const INT_MAX: c_int = 2147483647; + +pub const AUDIO_VOLUME_MAX: u32 = 0x8000; +pub const AUDIO_CHANNEL_MAX: u32 = 8; +pub const AUDIO_NEXT_CHANNEL: i32 = -1; +pub const AUDIO_SAMPLE_MIN: u32 = 64; +pub const AUDIO_SAMPLE_MAX: u32 = 65472; + +pub const PSP_CTRL_SELECT: i32 = 0x000001; +pub const PSP_CTRL_START: i32 = 0x000008; +pub const PSP_CTRL_UP: i32 = 0x000010; +pub const PSP_CTRL_RIGHT: i32 = 0x000020; +pub const PSP_CTRL_DOWN: i32 = 0x000040; +pub const PSP_CTRL_LEFT: i32 = 0x000080; +pub const PSP_CTRL_LTRIGGER: i32 = 0x000100; +pub const PSP_CTRL_RTRIGGER: i32 = 0x000200; +pub const PSP_CTRL_TRIANGLE: i32 = 0x001000; +pub const PSP_CTRL_CIRCLE: i32 = 0x002000; +pub const PSP_CTRL_CROSS: i32 = 0x004000; +pub const PSP_CTRL_SQUARE: i32 = 0x008000; +pub const PSP_CTRL_HOME: i32 = 0x010000; +pub const PSP_CTRL_HOLD: i32 = 0x020000; +pub const PSP_CTRL_NOTE: i32 = 0x800000; +pub const PSP_CTRL_SCREEN: i32 = 0x400000; +pub const PSP_CTRL_VOLUP: i32 = 0x100000; +pub const PSP_CTRL_VOLDOWN: i32 = 0x200000; +pub const PSP_CTRL_WLAN_UP: i32 = 0x040000; +pub const PSP_CTRL_REMOTE: i32 = 0x080000; +pub const PSP_CTRL_DISC: i32 = 0x1000000; +pub const PSP_CTRL_MS: i32 = 0x2000000; + +pub const USB_CAM_PID: i32 = 0x282; +pub const USB_BUS_DRIVER_NAME: &str = "USBBusDriver"; +pub const USB_CAM_DRIVER_NAME: &str = "USBCamDriver"; +pub const USB_CAM_MIC_DRIVER_NAME: &str = "USBCamMicDriver"; +pub const USB_STOR_DRIVER_NAME: &str = "USBStor_Driver"; + +pub const ACTIVATED: i32 = 0x200; +pub const CONNECTED: i32 = 0x020; +pub const ESTABLISHED: i32 = 0x002; + +pub const USB_CAM_FLIP: i32 = 1; +pub const USB_CAM_MIRROR: i32 = 0x100; + +pub const THREAD_ATTR_VFPU: i32 = 0x00004000; +pub const THREAD_ATTR_USER: i32 = 0x80000000; +pub const THREAD_ATTR_USBWLAN: i32 = 0xa0000000; +pub const THREAD_ATTR_VSH: i32 = 0xc0000000; +pub const THREAD_ATTR_SCRATCH_SRAM: i32 = 0x00008000; +pub const THREAD_ATTR_NO_FILLSTACK: i32 = 0x00100000; +pub const THREAD_ATTR_CLEAR_STACK: i32 = 0x00200000; + +pub const EVENT_WAIT_MULTIPLE: i32 = 0x200; + +pub const EVENT_WAIT_AND: i32 = 0; +pub const EVENT_WAIT_OR: i32 = 1; +pub const EVENT_WAIT_CLEAR: i32 = 0x20; + +pub const POWER_INFO_POWER_SWITCH: i32 = 0x80000000; +pub const POWER_INFO_HOLD_SWITCH: i32 = 0x40000000; +pub const POWER_INFO_STANDBY: i32 = 0x00080000; +pub const POWER_INFO_RESUME_COMPLETE: i32 = 0x00040000; +pub const POWER_INFO_RESUMING: i32 = 0x00020000; +pub const POWER_INFO_SUSPENDING: i32 = 0x00010000; +pub const POWER_INFO_AC_POWER: i32 = 0x00001000; +pub const POWER_INFO_BATTERY_LOW: i32 = 0x00000100; +pub const POWER_INFO_BATTERY_EXIST: i32 = 0x00000080; +pub const POWER_INFO_BATTERY_POWER: i32 = 0x0000007; + +pub const FIO_S_IFLNK: i32 = 0x4000; +pub const FIO_S_IFDIR: i32 = 0x1000; +pub const FIO_S_IFREG: i32 = 0x2000; +pub const FIO_S_ISUID: i32 = 0x0800; +pub const FIO_S_ISGID: i32 = 0x0400; +pub const FIO_S_ISVTX: i32 = 0x0200; +pub const FIO_S_IRUSR: i32 = 0x0100; +pub const FIO_S_IWUSR: i32 = 0x0080; +pub const FIO_S_IXUSR: i32 = 0x0040; +pub const FIO_S_IRGRP: i32 = 0x0020; +pub const FIO_S_IWGRP: i32 = 0x0010; +pub const FIO_S_IXGRP: i32 = 0x0008; +pub const FIO_S_IROTH: i32 = 0x0004; +pub const FIO_S_IWOTH: i32 = 0x0002; +pub const FIO_S_IXOTH: i32 = 0x0001; + +pub const FIO_SO_IFLNK: i32 = 0x0008; +pub const FIO_SO_IFDIR: i32 = 0x0010; +pub const FIO_SO_IFREG: i32 = 0x0020; +pub const FIO_SO_IROTH: i32 = 0x0004; +pub const FIO_SO_IWOTH: i32 = 0x0002; +pub const FIO_SO_IXOTH: i32 = 0x0001; + +pub const PSP_O_RD_ONLY: i32 = 0x0001; +pub const PSP_O_WR_ONLY: i32 = 0x0002; +pub const PSP_O_RD_WR: i32 = 0x0003; +pub const PSP_O_NBLOCK: i32 = 0x0004; +pub const PSP_O_DIR: i32 = 0x0008; +pub const PSP_O_APPEND: i32 = 0x0100; +pub const PSP_O_CREAT: i32 = 0x0200; +pub const PSP_O_TRUNC: i32 = 0x0400; +pub const PSP_O_EXCL: i32 = 0x0800; +pub const PSP_O_NO_WAIT: i32 = 0x8000; + +pub const UMD_NOT_PRESENT: i32 = 0x01; +pub const UMD_PRESENT: i32 = 0x02; +pub const UMD_CHANGED: i32 = 0x04; +pub const UMD_INITING: i32 = 0x08; +pub const UMD_INITED: i32 = 0x10; +pub const UMD_READY: i32 = 0x20; + +pub const PLAY_PAUSE: i32 = 0x1; +pub const FORWARD: i32 = 0x4; +pub const BACK: i32 = 0x8; +pub const VOL_UP: i32 = 0x10; +pub const VOL_DOWN: i32 = 0x20; +pub const HOLD: i32 = 0x80; + +pub const GU_PI: f32 = 3.141593; + +pub const GU_TEXTURE_8BIT: i32 = 1; +pub const GU_TEXTURE_16BIT: i32 = 2; +pub const GU_TEXTURE_32BITF: i32 = 3; +pub const GU_COLOR_5650: i32 = 4 << 2; +pub const GU_COLOR_5551: i32 = 5 << 2; +pub const GU_COLOR_4444: i32 = 6 << 2; +pub const GU_COLOR_8888: i32 = 7 << 2; +pub const GU_NORMAL_8BIT: i32 = 1 << 5; +pub const GU_NORMAL_16BIT: i32 = 2 << 5; +pub const GU_NORMAL_32BITF: i32 = 3 << 5; +pub const GU_VERTEX_8BIT: i32 = 1 << 7; +pub const GU_VERTEX_16BIT: i32 = 2 << 7; +pub const GU_VERTEX_32BITF: i32 = 3 << 7; +pub const GU_WEIGHT_8BIT: i32 = 1 << 9; +pub const GU_WEIGHT_16BIT: i32 = 2 << 9; +pub const GU_WEIGHT_32BITF: i32 = 3 << 9; +pub const GU_INDEX_8BIT: i32 = 1 << 11; +pub const GU_INDEX_16BIT: i32 = 2 << 11; +pub const GU_WEIGHTS1: i32 = (((1 - 1) & 7) << 14) as i32; +pub const GU_WEIGHTS2: i32 = (((2 - 1) & 7) << 14) as i32; +pub const GU_WEIGHTS3: i32 = (((3 - 1) & 7) << 14) as i32; +pub const GU_WEIGHTS4: i32 = (((4 - 1) & 7) << 14) as i32; +pub const GU_WEIGHTS5: i32 = (((5 - 1) & 7) << 14) as i32; +pub const GU_WEIGHTS6: i32 = (((6 - 1) & 7) << 14) as i32; +pub const GU_WEIGHTS7: i32 = (((7 - 1) & 7) << 14) as i32; +pub const GU_WEIGHTS8: i32 = (((8 - 1) & 7) << 14) as i32; +pub const GU_VERTICES1: i32 = (((1 - 1) & 7) << 18) as i32; +pub const GU_VERTICES2: i32 = (((2 - 1) & 7) << 18) as i32; +pub const GU_VERTICES3: i32 = (((3 - 1) & 7) << 18) as i32; +pub const GU_VERTICES4: i32 = (((4 - 1) & 7) << 18) as i32; +pub const GU_VERTICES5: i32 = (((5 - 1) & 7) << 18) as i32; +pub const GU_VERTICES6: i32 = (((6 - 1) & 7) << 18) as i32; +pub const GU_VERTICES7: i32 = (((7 - 1) & 7) << 18) as i32; +pub const GU_VERTICES8: i32 = (((8 - 1) & 7) << 18) as i32; +pub const GU_TRANSFORM_2D: i32 = 1 << 23; +pub const GU_TRANSFORM_3D: i32 = 0; + +pub const GU_COLOR_BUFFER_BIT: i32 = 1; +pub const GU_STENCIL_BUFFER_BIT: i32 = 2; +pub const GU_DEPTH_BUFFER_BIT: i32 = 4; +pub const GU_FAST_CLEAR_BIT: i32 = 16; + +pub const GU_AMBIENT: i32 = 1; +pub const GU_DIFFUSE: i32 = 2; +pub const GU_SPECULAR: i32 = 4; +pub const GU_UNKNOWN_LIGHT_COMPONENT: i32 = 8; + +pub const SYSTEM_REGISTRY: [u8; 7] = *b"/system"; +pub const REG_KEYNAME_SIZE: u32 = 27; + +pub const UTILITY_MSGDIALOG_ERROR: i32 = 0; +pub const UTILITY_MSGDIALOG_TEXT: i32 = 1; +pub const UTILITY_MSGDIALOG_YES_NO_BUTTONS: i32 = 0x10; +pub const UTILITY_MSGDIALOG_DEFAULT_NO: i32 = 0x100; + +pub const UTILITY_HTMLVIEWER_OPEN_SCE_START_PAGE: i32 = 0x000001; +pub const UTILITY_HTMLVIEWER_DISABLE_STARTUP_LIMITS: i32 = 0x000002; +pub const UTILITY_HTMLVIEWER_DISABLE_EXIT_DIALOG: i32 = 0x000004; +pub const UTILITY_HTMLVIEWER_DISABLE_CURSOR: i32 = 0x000008; +pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_COMPLETE_DIALOG: i32 = 0x000010; +pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_START_DIALOG: i32 = 0x000020; +pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000040; +pub const UTILITY_HTMLVIEWER_LOCK_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000080; +pub const UTILITY_HTMLVIEWER_DISABLE_TAB_DISPLAY: i32 = 0x000100; +pub const UTILITY_HTMLVIEWER_ENABLE_ANALOG_HOLD: i32 = 0x000200; +pub const UTILITY_HTMLVIEWER_ENABLE_FLASH: i32 = 0x000400; +pub const UTILITY_HTMLVIEWER_DISABLE_LRTRIGGER: i32 = 0x000800; + +extern "C" { + pub fn sceAudioChReserve(channel: i32, sample_count: i32, format: AudioFormat) -> i32; + pub fn sceAudioChRelease(channel: i32) -> i32; + pub fn sceAudioOutput(channel: i32, vol: i32, buf: *mut c_void) -> i32; + pub fn sceAudioOutputBlocking(channel: i32, vol: i32, buf: *mut c_void) -> i32; + pub fn sceAudioOutputPanned( + channel: i32, + left_vol: i32, + right_vol: i32, + buf: *mut c_void, + ) -> i32; + pub fn sceAudioOutputPannedBlocking( + channel: i32, + left_vol: i32, + right_vol: i32, + buf: *mut c_void, + ) -> i32; + pub fn sceAudioGetChannelRestLen(channel: i32) -> i32; + pub fn sceAudioGetChannelRestLength(channel: i32) -> i32; + pub fn sceAudioSetChannelDataLen(channel: i32, sample_count: i32) -> i32; + pub fn sceAudioChangeChannelConfig(channel: i32, format: AudioFormat) -> i32; + pub fn sceAudioChangeChannelVolume(channel: i32, left_vol: i32, right_vol: i32) -> i32; + pub fn sceAudioOutput2Reserve(sample_count: i32) -> i32; + pub fn sceAudioOutput2Release() -> i32; + pub fn sceAudioOutput2ChangeLength(sample_count: i32) -> i32; + pub fn sceAudioOutput2OutputBlocking(vol: i32, buf: *mut c_void) -> i32; + pub fn sceAudioOutput2GetRestSample() -> i32; + pub fn sceAudioSRCChReserve( + sample_count: i32, + freq: AudioOutputFrequency, + channels: i32, + ) -> i32; + pub fn sceAudioSRCChRelease() -> i32; + pub fn sceAudioSRCOutputBlocking(vol: i32, buf: *mut c_void) -> i32; + pub fn sceAudioInputInit(unknown1: i32, gain: i32, unknown2: i32) -> i32; + pub fn sceAudioInputInitEx(params: *mut AudioInputParams) -> i32; + pub fn sceAudioInputBlocking(sample_count: i32, freq: AudioInputFrequency, buf: *mut c_void); + pub fn sceAudioInput(sample_count: i32, freq: AudioInputFrequency, buf: *mut c_void); + pub fn sceAudioGetInputLength() -> i32; + pub fn sceAudioWaitInputEnd() -> i32; + pub fn sceAudioPollInputEnd() -> i32; + + pub fn sceAtracGetAtracID(ui_codec_type: u32) -> i32; + pub fn sceAtracSetDataAndGetID(buf: *mut c_void, bufsize: usize) -> i32; + pub fn sceAtracDecodeData( + atrac_id: i32, + out_samples: *mut u16, + out_n: *mut i32, + out_end: *mut i32, + out_remain_frame: *mut i32, + ) -> i32; + pub fn sceAtracGetRemainFrame(atrac_id: i32, out_remain_frame: *mut i32) -> i32; + pub fn sceAtracGetStreamDataInfo( + atrac_id: i32, + write_pointer: *mut *mut u8, + available_bytes: *mut u32, + read_offset: *mut u32, + ) -> i32; + pub fn sceAtracAddStreamData(atrac_id: i32, bytes_to_add: u32) -> i32; + pub fn sceAtracGetBitrate(atrac_id: i32, out_bitrate: *mut i32) -> i32; + pub fn sceAtracSetLoopNum(atrac_id: i32, nloops: i32) -> i32; + pub fn sceAtracReleaseAtracID(atrac_id: i32) -> i32; + pub fn sceAtracGetNextSample(atrac_id: i32, out_n: *mut i32) -> i32; + pub fn sceAtracGetMaxSample(atrac_id: i32, out_max: *mut i32) -> i32; + pub fn sceAtracGetBufferInfoForReseting( + atrac_id: i32, + ui_sample: u32, + pbuffer_info: *mut Atrac3BufferInfo, + ) -> i32; + pub fn sceAtracGetChannel(atrac_id: i32, pui_channel: *mut u32) -> i32; + pub fn sceAtracGetInternalErrorInfo(atrac_id: i32, pi_result: *mut i32) -> i32; + pub fn sceAtracGetLoopStatus( + atrac_id: i32, + pi_loop_num: *mut i32, + pui_loop_status: *mut u32, + ) -> i32; + pub fn sceAtracGetNextDecodePosition(atrac_id: i32, pui_sample_position: *mut u32) -> i32; + pub fn sceAtracGetSecondBufferInfo( + atrac_id: i32, + pui_position: *mut u32, + pui_data_byte: *mut u32, + ) -> i32; + pub fn sceAtracGetSoundSample( + atrac_id: i32, + pi_end_sample: *mut i32, + pi_loop_start_sample: *mut i32, + pi_loop_end_sample: *mut i32, + ) -> i32; + pub fn sceAtracResetPlayPosition( + atrac_id: i32, + ui_sample: u32, + ui_write_byte_first_buf: u32, + ui_write_byte_second_buf: u32, + ) -> i32; + pub fn sceAtracSetData(atrac_id: i32, puc_buffer_addr: *mut u8, ui_buffer_byte: u32) -> i32; + pub fn sceAtracSetHalfwayBuffer( + atrac_id: i32, + puc_buffer_addr: *mut u8, + ui_read_byte: u32, + ui_buffer_byte: u32, + ) -> i32; + pub fn sceAtracSetHalfwayBufferAndGetID( + puc_buffer_addr: *mut u8, + ui_read_byte: u32, + ui_buffer_byte: u32, + ) -> i32; + pub fn sceAtracSetSecondBuffer( + atrac_id: i32, + puc_second_buffer_addr: *mut u8, + ui_second_buffer_byte: u32, + ) -> i32; + + pub fn sceCtrlSetSamplingCycle(cycle: i32) -> i32; + pub fn sceCtrlGetSamplingCycle(pcycle: *mut i32) -> i32; + pub fn sceCtrlSetSamplingMode(mode: CtrlMode) -> i32; + pub fn sceCtrlGetSamplingMode(pmode: *mut i32) -> i32; + pub fn sceCtrlPeekBufferPositive(pad_data: *mut SceCtrlData, count: i32) -> i32; + pub fn sceCtrlPeekBufferNegative(pad_data: *mut SceCtrlData, count: i32) -> i32; + pub fn sceCtrlReadBufferPositive(pad_data: *mut SceCtrlData, count: i32) -> i32; + pub fn sceCtrlReadBufferNegative(pad_data: *mut SceCtrlData, count: i32) -> i32; + pub fn sceCtrlPeekLatch(latch_data: *mut SceCtrlLatch) -> i32; + pub fn sceCtrlReadLatch(latch_data: *mut SceCtrlLatch) -> i32; + pub fn sceCtrlSetIdleCancelThreshold(idlereset: i32, idleback: i32) -> i32; + pub fn sceCtrlGetIdleCancelThreshold(idlereset: *mut i32, idleback: *mut i32) -> i32; + + pub fn sceDisplaySetMode(mode: DisplayMode, width: usize, height: usize) -> u32; + pub fn sceDisplayGetMode(pmode: *mut i32, pwidth: *mut i32, pheight: *mut i32) -> i32; + pub fn sceDisplaySetFrameBuf( + top_addr: *const u8, + buffer_width: usize, + pixel_format: DisplayPixelFormat, + sync: DisplaySetBufSync, + ) -> u32; + pub fn sceDisplayGetFrameBuf( + top_addr: *mut *mut c_void, + buffer_width: *mut usize, + pixel_format: *mut DisplayPixelFormat, + sync: DisplaySetBufSync, + ) -> i32; + pub fn sceDisplayGetVcount() -> u32; + pub fn sceDisplayWaitVblank() -> i32; + pub fn sceDisplayWaitVblankCB() -> i32; + pub fn sceDisplayWaitVblankStart() -> i32; + pub fn sceDisplayWaitVblankStartCB() -> i32; + pub fn sceDisplayGetAccumulatedHcount() -> i32; + pub fn sceDisplayGetCurrentHcount() -> i32; + pub fn sceDisplayGetFramePerSec() -> f32; + pub fn sceDisplayIsForeground() -> i32; + pub fn sceDisplayIsVblank() -> i32; + + pub fn sceGeEdramGetSize() -> u32; + pub fn sceGeEdramGetAddr() -> *mut u8; + pub fn sceGeEdramSetAddrTranslation(width: i32) -> i32; + pub fn sceGeGetCmd(cmd: i32) -> u32; + pub fn sceGeGetMtx(type_: GeMatrixType, matrix: *mut c_void) -> i32; + pub fn sceGeGetStack(stack_id: i32, stack: *mut GeStack) -> i32; + pub fn sceGeSaveContext(context: *mut GeContext) -> i32; + pub fn sceGeRestoreContext(context: *const GeContext) -> i32; + pub fn sceGeListEnQueue( + list: *const c_void, + stall: *mut c_void, + cbid: i32, + arg: *mut GeListArgs, + ) -> i32; + pub fn sceGeListEnQueueHead( + list: *const c_void, + stall: *mut c_void, + cbid: i32, + arg: *mut GeListArgs, + ) -> i32; + pub fn sceGeListDeQueue(qid: i32) -> i32; + pub fn sceGeListUpdateStallAddr(qid: i32, stall: *mut c_void) -> i32; + pub fn sceGeListSync(qid: i32, sync_type: i32) -> GeListState; + pub fn sceGeDrawSync(sync_type: i32) -> GeListState; + pub fn sceGeBreak(mode: i32, p_param: *mut GeBreakParam) -> i32; + pub fn sceGeContinue() -> i32; + pub fn sceGeSetCallback(cb: *mut GeCallbackData) -> i32; + pub fn sceGeUnsetCallback(cbid: i32) -> i32; + + pub fn sceKernelExitGame(); + pub fn sceKernelRegisterExitCallback(id: SceUid) -> i32; + pub fn sceKernelLoadExec(file: *const u8, param: *mut SceKernelLoadExecParam) -> i32; + + pub fn sceKernelAllocPartitionMemory( + partition: SceSysMemPartitionId, + name: *const u8, + type_: SceSysMemBlockTypes, + size: u32, + addr: *mut c_void, + ) -> SceUid; + pub fn sceKernelGetBlockHeadAddr(blockid: SceUid) -> *mut c_void; + pub fn sceKernelFreePartitionMemory(blockid: SceUid) -> i32; + pub fn sceKernelTotalFreeMemSize() -> usize; + pub fn sceKernelMaxFreeMemSize() -> usize; + pub fn sceKernelDevkitVersion() -> u32; + pub fn sceKernelSetCompiledSdkVersion(version: u32) -> i32; + pub fn sceKernelGetCompiledSdkVersion() -> u32; + + pub fn sceKernelLibcTime(t: *mut i32) -> i32; + pub fn sceKernelLibcClock() -> u32; + pub fn sceKernelLibcGettimeofday(tp: *mut timeval, tzp: *mut timezone) -> i32; + pub fn sceKernelDcacheWritebackAll(); + pub fn sceKernelDcacheWritebackInvalidateAll(); + pub fn sceKernelDcacheWritebackRange(p: *const c_void, size: u32); + pub fn sceKernelDcacheWritebackInvalidateRange(p: *const c_void, size: u32); + pub fn sceKernelDcacheInvalidateRange(p: *const c_void, size: u32); + pub fn sceKernelIcacheInvalidateAll(); + pub fn sceKernelIcacheInvalidateRange(p: *const c_void, size: u32); + pub fn sceKernelUtilsMt19937Init(ctx: *mut SceKernelUtilsMt19937Context, seed: u32) -> i32; + pub fn sceKernelUtilsMt19937UInt(ctx: *mut SceKernelUtilsMt19937Context) -> u32; + pub fn sceKernelUtilsMd5Digest(data: *mut u8, size: u32, digest: *mut u8) -> i32; + pub fn sceKernelUtilsMd5BlockInit(ctx: *mut SceKernelUtilsMd5Context) -> i32; + pub fn sceKernelUtilsMd5BlockUpdate( + ctx: *mut SceKernelUtilsMd5Context, + data: *mut u8, + size: u32, + ) -> i32; + pub fn sceKernelUtilsMd5BlockResult(ctx: *mut SceKernelUtilsMd5Context, digest: *mut u8) + -> i32; + pub fn sceKernelUtilsSha1Digest(data: *mut u8, size: u32, digest: *mut u8) -> i32; + pub fn sceKernelUtilsSha1BlockInit(ctx: *mut SceKernelUtilsSha1Context) -> i32; + pub fn sceKernelUtilsSha1BlockUpdate( + ctx: *mut SceKernelUtilsSha1Context, + data: *mut u8, + size: u32, + ) -> i32; + pub fn sceKernelUtilsSha1BlockResult( + ctx: *mut SceKernelUtilsSha1Context, + digest: *mut u8, + ) -> i32; + + pub fn sceKernelRegisterSubIntrHandler( + int_no: i32, + no: i32, + handler: *mut c_void, + arg: *mut c_void, + ) -> i32; + pub fn sceKernelReleaseSubIntrHandler(int_no: i32, no: i32) -> i32; + pub fn sceKernelEnableSubIntr(int_no: i32, no: i32) -> i32; + pub fn sceKernelDisableSubIntr(int_no: i32, no: i32) -> i32; + pub fn QueryIntrHandlerInfo( + intr_code: SceUid, + sub_intr_code: SceUid, + data: *mut IntrHandlerOptionParam, + ) -> i32; + + pub fn sceKernelCpuSuspendIntr() -> u32; + pub fn sceKernelCpuResumeIntr(flags: u32); + pub fn sceKernelCpuResumeIntrWithSync(flags: u32); + pub fn sceKernelIsCpuIntrSuspended(flags: u32) -> i32; + pub fn sceKernelIsCpuIntrEnable() -> i32; + + pub fn sceKernelLoadModule( + path: *const u8, + flags: i32, + option: *mut SceKernelLMOption, + ) -> SceUid; + pub fn sceKernelLoadModuleMs( + path: *const u8, + flags: i32, + option: *mut SceKernelLMOption, + ) -> SceUid; + pub fn sceKernelLoadModuleByID( + fid: SceUid, + flags: i32, + option: *mut SceKernelLMOption, + ) -> SceUid; + pub fn sceKernelLoadModuleBufferUsbWlan( + buf_size: usize, + buf: *mut c_void, + flags: i32, + option: *mut SceKernelLMOption, + ) -> SceUid; + pub fn sceKernelStartModule( + mod_id: SceUid, + arg_size: usize, + argp: *mut c_void, + status: *mut i32, + option: *mut SceKernelSMOption, + ) -> i32; + pub fn sceKernelStopModule( + mod_id: SceUid, + arg_size: usize, + argp: *mut c_void, + status: *mut i32, + option: *mut SceKernelSMOption, + ) -> i32; + pub fn sceKernelUnloadModule(mod_id: SceUid) -> i32; + pub fn sceKernelSelfStopUnloadModule(unknown: i32, arg_size: usize, argp: *mut c_void) -> i32; + pub fn sceKernelStopUnloadSelfModule( + arg_size: usize, + argp: *mut c_void, + status: *mut i32, + option: *mut SceKernelSMOption, + ) -> i32; + pub fn sceKernelQueryModuleInfo(mod_id: SceUid, info: *mut SceKernelModuleInfo) -> i32; + pub fn sceKernelGetModuleIdList( + read_buf: *mut SceUid, + read_buf_size: i32, + id_count: *mut i32, + ) -> i32; + + pub fn sceKernelVolatileMemLock(unk: i32, ptr: *mut *mut c_void, size: *mut i32) -> i32; + pub fn sceKernelVolatileMemTryLock(unk: i32, ptr: *mut *mut c_void, size: *mut i32) -> i32; + pub fn sceKernelVolatileMemUnlock(unk: i32) -> i32; + + pub fn sceKernelStdin() -> SceUid; + pub fn sceKernelStdout() -> SceUid; + pub fn sceKernelStderr() -> SceUid; + + pub fn sceKernelGetThreadmanIdType(uid: SceUid) -> SceKernelIdListType; + pub fn sceKernelCreateThread( + name: *const u8, + entry: SceKernelThreadEntry, + init_priority: i32, + stack_size: i32, + attr: i32, + option: *mut SceKernelThreadOptParam, + ) -> SceUid; + pub fn sceKernelDeleteThread(thid: SceUid) -> i32; + pub fn sceKernelStartThread(id: SceUid, arg_len: usize, arg_p: *mut c_void) -> i32; + pub fn sceKernelExitThread(status: i32) -> i32; + pub fn sceKernelExitDeleteThread(status: i32) -> i32; + pub fn sceKernelTerminateThread(thid: SceUid) -> i32; + pub fn sceKernelTerminateDeleteThread(thid: SceUid) -> i32; + pub fn sceKernelSuspendDispatchThread() -> i32; + pub fn sceKernelResumeDispatchThread(state: i32) -> i32; + pub fn sceKernelSleepThread() -> i32; + pub fn sceKernelSleepThreadCB() -> i32; + pub fn sceKernelWakeupThread(thid: SceUid) -> i32; + pub fn sceKernelCancelWakeupThread(thid: SceUid) -> i32; + pub fn sceKernelSuspendThread(thid: SceUid) -> i32; + pub fn sceKernelResumeThread(thid: SceUid) -> i32; + pub fn sceKernelWaitThreadEnd(thid: SceUid, timeout: *mut u32) -> i32; + pub fn sceKernelWaitThreadEndCB(thid: SceUid, timeout: *mut u32) -> i32; + pub fn sceKernelDelayThread(delay: u32) -> i32; + pub fn sceKernelDelayThreadCB(delay: u32) -> i32; + pub fn sceKernelDelaySysClockThread(delay: *mut SceKernelSysClock) -> i32; + pub fn sceKernelDelaySysClockThreadCB(delay: *mut SceKernelSysClock) -> i32; + pub fn sceKernelChangeCurrentThreadAttr(unknown: i32, attr: i32) -> i32; + pub fn sceKernelChangeThreadPriority(thid: SceUid, priority: i32) -> i32; + pub fn sceKernelRotateThreadReadyQueue(priority: i32) -> i32; + pub fn sceKernelReleaseWaitThread(thid: SceUid) -> i32; + pub fn sceKernelGetThreadId() -> i32; + pub fn sceKernelGetThreadCurrentPriority() -> i32; + pub fn sceKernelGetThreadExitStatus(thid: SceUid) -> i32; + pub fn sceKernelCheckThreadStack() -> i32; + pub fn sceKernelGetThreadStackFreeSize(thid: SceUid) -> i32; + pub fn sceKernelReferThreadStatus(thid: SceUid, info: *mut SceKernelThreadInfo) -> i32; + pub fn sceKernelReferThreadRunStatus( + thid: SceUid, + status: *mut SceKernelThreadRunStatus, + ) -> i32; + pub fn sceKernelCreateSema( + name: *const u8, + attr: u32, + init_val: i32, + max_val: i32, + option: *mut SceKernelSemaOptParam, + ) -> SceUid; + pub fn sceKernelDeleteSema(sema_id: SceUid) -> i32; + pub fn sceKernelSignalSema(sema_id: SceUid, signal: i32) -> i32; + pub fn sceKernelWaitSema(sema_id: SceUid, signal: i32, timeout: *mut u32) -> i32; + pub fn sceKernelWaitSemaCB(sema_id: SceUid, signal: i32, timeout: *mut u32) -> i32; + pub fn sceKernelPollSema(sema_id: SceUid, signal: i32) -> i32; + pub fn sceKernelReferSemaStatus(sema_id: SceUid, info: *mut SceKernelSemaInfo) -> i32; + pub fn sceKernelCreateEventFlag( + name: *const u8, + attr: i32, + bits: i32, + opt: *mut SceKernelEventFlagOptParam, + ) -> SceUid; + pub fn sceKernelSetEventFlag(ev_id: SceUid, bits: u32) -> i32; + pub fn sceKernelClearEventFlag(ev_id: SceUid, bits: u32) -> i32; + pub fn sceKernelPollEventFlag(ev_id: SceUid, bits: u32, wait: i32, out_bits: *mut u32) -> i32; + pub fn sceKernelWaitEventFlag( + ev_id: SceUid, + bits: u32, + wait: i32, + out_bits: *mut u32, + timeout: *mut u32, + ) -> i32; + pub fn sceKernelWaitEventFlagCB( + ev_id: SceUid, + bits: u32, + wait: i32, + out_bits: *mut u32, + timeout: *mut u32, + ) -> i32; + pub fn sceKernelDeleteEventFlag(ev_id: SceUid) -> i32; + pub fn sceKernelReferEventFlagStatus(event: SceUid, status: *mut SceKernelEventFlagInfo) + -> i32; + pub fn sceKernelCreateMbx( + name: *const u8, + attr: u32, + option: *mut SceKernelMbxOptParam, + ) -> SceUid; + pub fn sceKernelDeleteMbx(mbx_id: SceUid) -> i32; + pub fn sceKernelSendMbx(mbx_id: SceUid, message: *mut c_void) -> i32; + pub fn sceKernelReceiveMbx(mbx_id: SceUid, message: *mut *mut c_void, timeout: *mut u32) + -> i32; + pub fn sceKernelReceiveMbxCB( + mbx_id: SceUid, + message: *mut *mut c_void, + timeout: *mut u32, + ) -> i32; + pub fn sceKernelPollMbx(mbx_id: SceUid, pmessage: *mut *mut c_void) -> i32; + pub fn sceKernelCancelReceiveMbx(mbx_id: SceUid, num: *mut i32) -> i32; + pub fn sceKernelReferMbxStatus(mbx_id: SceUid, info: *mut SceKernelMbxInfo) -> i32; + pub fn sceKernelSetAlarm( + clock: u32, + handler: SceKernelAlarmHandler, + common: *mut c_void, + ) -> SceUid; + pub fn sceKernelSetSysClockAlarm( + clock: *mut SceKernelSysClock, + handler: *mut SceKernelAlarmHandler, + common: *mut c_void, + ) -> SceUid; + pub fn sceKernelCancelAlarm(alarm_id: SceUid) -> i32; + pub fn sceKernelReferAlarmStatus(alarm_id: SceUid, info: *mut SceKernelAlarmInfo) -> i32; + pub fn sceKernelCreateCallback( + name: *const u8, + func: SceKernelCallbackFunction, + arg: *mut c_void, + ) -> SceUid; + pub fn sceKernelReferCallbackStatus(cb: SceUid, status: *mut SceKernelCallbackInfo) -> i32; + pub fn sceKernelDeleteCallback(cb: SceUid) -> i32; + pub fn sceKernelNotifyCallback(cb: SceUid, arg2: i32) -> i32; + pub fn sceKernelCancelCallback(cb: SceUid) -> i32; + pub fn sceKernelGetCallbackCount(cb: SceUid) -> i32; + pub fn sceKernelCheckCallback() -> i32; + pub fn sceKernelGetThreadmanIdList( + type_: SceKernelIdListType, + read_buf: *mut SceUid, + read_buf_size: i32, + id_count: *mut i32, + ) -> i32; + pub fn sceKernelReferSystemStatus(status: *mut SceKernelSystemStatus) -> i32; + pub fn sceKernelCreateMsgPipe( + name: *const u8, + part: i32, + attr: i32, + unk1: *mut c_void, + opt: *mut c_void, + ) -> SceUid; + pub fn sceKernelDeleteMsgPipe(uid: SceUid) -> i32; + pub fn sceKernelSendMsgPipe( + uid: SceUid, + message: *mut c_void, + size: u32, + unk1: i32, + unk2: *mut c_void, + timeout: *mut u32, + ) -> i32; + pub fn sceKernelSendMsgPipeCB( + uid: SceUid, + message: *mut c_void, + size: u32, + unk1: i32, + unk2: *mut c_void, + timeout: *mut u32, + ) -> i32; + pub fn sceKernelTrySendMsgPipe( + uid: SceUid, + message: *mut c_void, + size: u32, + unk1: i32, + unk2: *mut c_void, + ) -> i32; + pub fn sceKernelReceiveMsgPipe( + uid: SceUid, + message: *mut c_void, + size: u32, + unk1: i32, + unk2: *mut c_void, + timeout: *mut u32, + ) -> i32; + pub fn sceKernelReceiveMsgPipeCB( + uid: SceUid, + message: *mut c_void, + size: u32, + unk1: i32, + unk2: *mut c_void, + timeout: *mut u32, + ) -> i32; + pub fn sceKernelTryReceiveMsgPipe( + uid: SceUid, + message: *mut c_void, + size: u32, + unk1: i32, + unk2: *mut c_void, + ) -> i32; + pub fn sceKernelCancelMsgPipe(uid: SceUid, send: *mut i32, recv: *mut i32) -> i32; + pub fn sceKernelReferMsgPipeStatus(uid: SceUid, info: *mut SceKernelMppInfo) -> i32; + pub fn sceKernelCreateVpl( + name: *const u8, + part: i32, + attr: i32, + size: u32, + opt: *mut SceKernelVplOptParam, + ) -> SceUid; + pub fn sceKernelDeleteVpl(uid: SceUid) -> i32; + pub fn sceKernelAllocateVpl( + uid: SceUid, + size: u32, + data: *mut *mut c_void, + timeout: *mut u32, + ) -> i32; + pub fn sceKernelAllocateVplCB( + uid: SceUid, + size: u32, + data: *mut *mut c_void, + timeout: *mut u32, + ) -> i32; + pub fn sceKernelTryAllocateVpl(uid: SceUid, size: u32, data: *mut *mut c_void) -> i32; + pub fn sceKernelFreeVpl(uid: SceUid, data: *mut c_void) -> i32; + pub fn sceKernelCancelVpl(uid: SceUid, num: *mut i32) -> i32; + pub fn sceKernelReferVplStatus(uid: SceUid, info: *mut SceKernelVplInfo) -> i32; + pub fn sceKernelCreateFpl( + name: *const u8, + part: i32, + attr: i32, + size: u32, + blocks: u32, + opt: *mut SceKernelFplOptParam, + ) -> i32; + pub fn sceKernelDeleteFpl(uid: SceUid) -> i32; + pub fn sceKernelAllocateFpl(uid: SceUid, data: *mut *mut c_void, timeout: *mut u32) -> i32; + pub fn sceKernelAllocateFplCB(uid: SceUid, data: *mut *mut c_void, timeout: *mut u32) -> i32; + pub fn sceKernelTryAllocateFpl(uid: SceUid, data: *mut *mut c_void) -> i32; + pub fn sceKernelFreeFpl(uid: SceUid, data: *mut c_void) -> i32; + pub fn sceKernelCancelFpl(uid: SceUid, pnum: *mut i32) -> i32; + pub fn sceKernelReferFplStatus(uid: SceUid, info: *mut SceKernelFplInfo) -> i32; + pub fn sceKernelUSec2SysClock(usec: u32, clock: *mut SceKernelSysClock) -> i32; + pub fn sceKernelUSec2SysClockWide(usec: u32) -> i64; + pub fn sceKernelSysClock2USec( + clock: *mut SceKernelSysClock, + low: *mut u32, + high: *mut u32, + ) -> i32; + pub fn sceKernelSysClock2USecWide(clock: i64, low: *mut u32, high: *mut u32) -> i32; + pub fn sceKernelGetSystemTime(time: *mut SceKernelSysClock) -> i32; + pub fn sceKernelGetSystemTimeWide() -> i64; + pub fn sceKernelGetSystemTimeLow() -> u32; + pub fn sceKernelCreateVTimer(name: *const u8, opt: *mut SceKernelVTimerOptParam) -> SceUid; + pub fn sceKernelDeleteVTimer(uid: SceUid) -> i32; + pub fn sceKernelGetVTimerBase(uid: SceUid, base: *mut SceKernelSysClock) -> i32; + pub fn sceKernelGetVTimerBaseWide(uid: SceUid) -> i64; + pub fn sceKernelGetVTimerTime(uid: SceUid, time: *mut SceKernelSysClock) -> i32; + pub fn sceKernelGetVTimerTimeWide(uid: SceUid) -> i64; + pub fn sceKernelSetVTimerTime(uid: SceUid, time: *mut SceKernelSysClock) -> i32; + pub fn sceKernelSetVTimerTimeWide(uid: SceUid, time: i64) -> i64; + pub fn sceKernelStartVTimer(uid: SceUid) -> i32; + pub fn sceKernelStopVTimer(uid: SceUid) -> i32; + pub fn sceKernelSetVTimerHandler( + uid: SceUid, + time: *mut SceKernelSysClock, + handler: SceKernelVTimerHandler, + common: *mut c_void, + ) -> i32; + pub fn sceKernelSetVTimerHandlerWide( + uid: SceUid, + time: i64, + handler: SceKernelVTimerHandlerWide, + common: *mut c_void, + ) -> i32; + pub fn sceKernelCancelVTimerHandler(uid: SceUid) -> i32; + pub fn sceKernelReferVTimerStatus(uid: SceUid, info: *mut SceKernelVTimerInfo) -> i32; + pub fn sceKernelRegisterThreadEventHandler( + name: *const u8, + thread_id: SceUid, + mask: i32, + handler: SceKernelThreadEventHandler, + common: *mut c_void, + ) -> SceUid; + pub fn sceKernelReleaseThreadEventHandler(uid: SceUid) -> i32; + pub fn sceKernelReferThreadEventHandlerStatus( + uid: SceUid, + info: *mut SceKernelThreadEventHandlerInfo, + ) -> i32; + pub fn sceKernelReferThreadProfiler() -> *mut DebugProfilerRegs; + pub fn sceKernelReferGlobalProfiler() -> *mut DebugProfilerRegs; + + pub fn sceUsbStart(driver_name: *const u8, size: i32, args: *mut c_void) -> i32; + pub fn sceUsbStop(driver_name: *const u8, size: i32, args: *mut c_void) -> i32; + pub fn sceUsbActivate(pid: u32) -> i32; + pub fn sceUsbDeactivate(pid: u32) -> i32; + pub fn sceUsbGetState() -> i32; + pub fn sceUsbGetDrvState(driver_name: *const u8) -> i32; +} + +extern "C" { + pub fn sceUsbCamSetupStill(param: *mut UsbCamSetupStillParam) -> i32; + pub fn sceUsbCamSetupStillEx(param: *mut UsbCamSetupStillExParam) -> i32; + pub fn sceUsbCamStillInputBlocking(buf: *mut u8, size: usize) -> i32; + pub fn sceUsbCamStillInput(buf: *mut u8, size: usize) -> i32; + pub fn sceUsbCamStillWaitInputEnd() -> i32; + pub fn sceUsbCamStillPollInputEnd() -> i32; + pub fn sceUsbCamStillCancelInput() -> i32; + pub fn sceUsbCamStillGetInputLength() -> i32; + pub fn sceUsbCamSetupVideo( + param: *mut UsbCamSetupVideoParam, + work_area: *mut c_void, + work_area_size: i32, + ) -> i32; + pub fn sceUsbCamSetupVideoEx( + param: *mut UsbCamSetupVideoExParam, + work_area: *mut c_void, + work_area_size: i32, + ) -> i32; + pub fn sceUsbCamStartVideo() -> i32; + pub fn sceUsbCamStopVideo() -> i32; + pub fn sceUsbCamReadVideoFrameBlocking(buf: *mut u8, size: usize) -> i32; + pub fn sceUsbCamReadVideoFrame(buf: *mut u8, size: usize) -> i32; + pub fn sceUsbCamWaitReadVideoFrameEnd() -> i32; + pub fn sceUsbCamPollReadVideoFrameEnd() -> i32; + pub fn sceUsbCamGetReadVideoFrameSize() -> i32; + pub fn sceUsbCamSetSaturation(saturation: i32) -> i32; + pub fn sceUsbCamSetBrightness(brightness: i32) -> i32; + pub fn sceUsbCamSetContrast(contrast: i32) -> i32; + pub fn sceUsbCamSetSharpness(sharpness: i32) -> i32; + pub fn sceUsbCamSetImageEffectMode(effect_mode: UsbCamEffectMode) -> i32; + pub fn sceUsbCamSetEvLevel(exposure_level: UsbCamEvLevel) -> i32; + pub fn sceUsbCamSetReverseMode(reverse_flags: i32) -> i32; + pub fn sceUsbCamSetZoom(zoom: i32) -> i32; + pub fn sceUsbCamGetSaturation(saturation: *mut i32) -> i32; + pub fn sceUsbCamGetBrightness(brightness: *mut i32) -> i32; + pub fn sceUsbCamGetContrast(contrast: *mut i32) -> i32; + pub fn sceUsbCamGetSharpness(sharpness: *mut i32) -> i32; + pub fn sceUsbCamGetImageEffectMode(effect_mode: *mut UsbCamEffectMode) -> i32; + pub fn sceUsbCamGetEvLevel(exposure_level: *mut UsbCamEvLevel) -> i32; + pub fn sceUsbCamGetReverseMode(reverse_flags: *mut i32) -> i32; + pub fn sceUsbCamGetZoom(zoom: *mut i32) -> i32; + pub fn sceUsbCamAutoImageReverseSW(on: i32) -> i32; + pub fn sceUsbCamGetAutoImageReverseState() -> i32; + pub fn sceUsbCamGetLensDirection() -> i32; + + pub fn sceUsbstorBootRegisterNotify(event_flag: SceUid) -> i32; + pub fn sceUsbstorBootUnregisterNotify(event_flag: u32) -> i32; + pub fn sceUsbstorBootSetCapacity(size: u32) -> i32; + + pub fn scePowerRegisterCallback(slot: i32, cbid: SceUid) -> i32; + pub fn scePowerUnregisterCallback(slot: i32) -> i32; + pub fn scePowerIsPowerOnline() -> i32; + pub fn scePowerIsBatteryExist() -> i32; + pub fn scePowerIsBatteryCharging() -> i32; + pub fn scePowerGetBatteryChargingStatus() -> i32; + pub fn scePowerIsLowBattery() -> i32; + pub fn scePowerGetBatteryLifePercent() -> i32; + pub fn scePowerGetBatteryLifeTime() -> i32; + pub fn scePowerGetBatteryTemp() -> i32; + pub fn scePowerGetBatteryElec() -> i32; + pub fn scePowerGetBatteryVolt() -> i32; + pub fn scePowerSetCpuClockFrequency(cpufreq: i32) -> i32; + pub fn scePowerSetBusClockFrequency(busfreq: i32) -> i32; + pub fn scePowerGetCpuClockFrequency() -> i32; + pub fn scePowerGetCpuClockFrequencyInt() -> i32; + pub fn scePowerGetCpuClockFrequencyFloat() -> f32; + pub fn scePowerGetBusClockFrequency() -> i32; + pub fn scePowerGetBusClockFrequencyInt() -> i32; + pub fn scePowerGetBusClockFrequencyFloat() -> f32; + pub fn scePowerSetClockFrequency(pllfreq: i32, cpufreq: i32, busfreq: i32) -> i32; + pub fn scePowerLock(unknown: i32) -> i32; + pub fn scePowerUnlock(unknown: i32) -> i32; + pub fn scePowerTick(t: PowerTick) -> i32; + pub fn scePowerGetIdleTimer() -> i32; + pub fn scePowerIdleTimerEnable(unknown: i32) -> i32; + pub fn scePowerIdleTimerDisable(unknown: i32) -> i32; + pub fn scePowerRequestStandby() -> i32; + pub fn scePowerRequestSuspend() -> i32; + + pub fn sceWlanDevIsPowerOn() -> i32; + pub fn sceWlanGetSwitchState() -> i32; + pub fn sceWlanGetEtherAddr(ether_addr: *mut u8) -> i32; + + pub fn sceWlanDevAttach() -> i32; + pub fn sceWlanDevDetach() -> i32; + + pub fn sceRtcGetTickResolution() -> u32; + pub fn sceRtcGetCurrentTick(tick: *mut u64) -> i32; + pub fn sceRtcGetCurrentClock(tm: *mut ScePspDateTime, tz: i32) -> i32; + pub fn sceRtcGetCurrentClockLocalTime(tm: *mut ScePspDateTime) -> i32; + pub fn sceRtcConvertUtcToLocalTime(tick_utc: *const u64, tick_local: *mut u64) -> i32; + pub fn sceRtcConvertLocalTimeToUTC(tick_local: *const u64, tick_utc: *mut u64) -> i32; + pub fn sceRtcIsLeapYear(year: i32) -> i32; + pub fn sceRtcGetDaysInMonth(year: i32, month: i32) -> i32; + pub fn sceRtcGetDayOfWeek(year: i32, month: i32, day: i32) -> i32; + pub fn sceRtcCheckValid(date: *const ScePspDateTime) -> i32; + pub fn sceRtcSetTick(date: *mut ScePspDateTime, tick: *const u64) -> i32; + pub fn sceRtcGetTick(date: *const ScePspDateTime, tick: *mut u64) -> i32; + pub fn sceRtcCompareTick(tick1: *const u64, tick2: *const u64) -> i32; + pub fn sceRtcTickAddTicks(dest_tick: *mut u64, src_tick: *const u64, num_ticks: u64) -> i32; + pub fn sceRtcTickAddMicroseconds(dest_tick: *mut u64, src_tick: *const u64, num_ms: u64) + -> i32; + pub fn sceRtcTickAddSeconds(dest_tick: *mut u64, src_tick: *const u64, num_seconds: u64) + -> i32; + pub fn sceRtcTickAddMinutes(dest_tick: *mut u64, src_tick: *const u64, num_minutes: u64) + -> i32; + pub fn sceRtcTickAddHours(dest_tick: *mut u64, src_tick: *const u64, num_hours: u64) -> i32; + pub fn sceRtcTickAddDays(dest_tick: *mut u64, src_tick: *const u64, num_days: u64) -> i32; + pub fn sceRtcTickAddWeeks(dest_tick: *mut u64, src_tick: *const u64, num_weeks: u64) -> i32; + pub fn sceRtcTickAddMonths(dest_tick: *mut u64, src_tick: *const u64, num_months: u64) -> i32; + pub fn sceRtcTickAddYears(dest_tick: *mut u64, src_tick: *const u64, num_years: u64) -> i32; + pub fn sceRtcSetTime_t(date: *mut ScePspDateTime, time: u32) -> i32; + pub fn sceRtcGetTime_t(date: *const ScePspDateTime, time: *mut u32) -> i32; + pub fn sceRtcSetTime64_t(date: *mut ScePspDateTime, time: u64) -> i32; + pub fn sceRtcGetTime64_t(date: *const ScePspDateTime, time: *mut u64) -> i32; + pub fn sceRtcSetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32; + pub fn sceRtcGetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32; + pub fn sceRtcSetWin32FileTime(date: *mut ScePspDateTime, time: *mut u64) -> i32; + pub fn sceRtcGetWin32FileTime(date: *mut ScePspDateTime, time: *mut u64) -> i32; + pub fn sceRtcParseDateTime(dest_tick: *mut u64, date_string: *const u8) -> i32; + pub fn sceRtcFormatRFC3339( + psz_date_time: *mut char, + p_utc: *const u64, + time_zone_minutes: i32, + ) -> i32; + pub fn sceRtcFormatRFC3339LocalTime(psz_date_time: *mut char, p_utc: *const u64) -> i32; + pub fn sceRtcParseRFC3339(p_utc: *mut u64, psz_date_time: *const u8) -> i32; + pub fn sceRtcFormatRFC2822( + psz_date_time: *mut char, + p_utc: *const u64, + time_zone_minutes: i32, + ) -> i32; + pub fn sceRtcFormatRFC2822LocalTime(psz_date_time: *mut char, p_utc: *const u64) -> i32; + + pub fn sceIoOpen(file: *const u8, flags: i32, permissions: IoPermissions) -> SceUid; + pub fn sceIoOpenAsync(file: *const u8, flags: i32, permissions: IoPermissions) -> SceUid; + pub fn sceIoClose(fd: SceUid) -> i32; + pub fn sceIoCloseAsync(fd: SceUid) -> i32; + pub fn sceIoRead(fd: SceUid, data: *mut c_void, size: u32) -> i32; + pub fn sceIoReadAsync(fd: SceUid, data: *mut c_void, size: u32) -> i32; + pub fn sceIoWrite(fd: SceUid, data: *const c_void, size: usize) -> i32; + pub fn sceIoWriteAsync(fd: SceUid, data: *const c_void, size: u32) -> i32; + pub fn sceIoLseek(fd: SceUid, offset: i64, whence: IoWhence) -> i64; + pub fn sceIoLseekAsync(fd: SceUid, offset: i64, whence: IoWhence) -> i32; + pub fn sceIoLseek32(fd: SceUid, offset: i32, whence: IoWhence) -> i32; + pub fn sceIoLseek32Async(fd: SceUid, offset: i32, whence: IoWhence) -> i32; + pub fn sceIoRemove(file: *const u8) -> i32; + pub fn sceIoMkdir(dir: *const u8, mode: IoPermissions) -> i32; + pub fn sceIoRmdir(path: *const u8) -> i32; + pub fn sceIoChdir(path: *const u8) -> i32; + pub fn sceIoRename(oldname: *const u8, newname: *const u8) -> i32; + pub fn sceIoDopen(dirname: *const u8) -> SceUid; + pub fn sceIoDread(fd: SceUid, dir: *mut SceIoDirent) -> i32; + pub fn sceIoDclose(fd: SceUid) -> i32; + pub fn sceIoDevctl( + dev: *const u8, + cmd: u32, + indata: *mut c_void, + inlen: i32, + outdata: *mut c_void, + outlen: i32, + ) -> i32; + pub fn sceIoAssign( + dev1: *const u8, + dev2: *const u8, + dev3: *const u8, + mode: IoAssignPerms, + unk1: *mut c_void, + unk2: i32, + ) -> i32; + pub fn sceIoUnassign(dev: *const u8) -> i32; + pub fn sceIoGetstat(file: *const u8, stat: *mut SceIoStat) -> i32; + pub fn sceIoChstat(file: *const u8, stat: *mut SceIoStat, bits: i32) -> i32; + pub fn sceIoIoctl( + fd: SceUid, + cmd: u32, + indata: *mut c_void, + inlen: i32, + outdata: *mut c_void, + outlen: i32, + ) -> i32; + pub fn sceIoIoctlAsync( + fd: SceUid, + cmd: u32, + indata: *mut c_void, + inlen: i32, + outdata: *mut c_void, + outlen: i32, + ) -> i32; + pub fn sceIoSync(device: *const u8, unk: u32) -> i32; + pub fn sceIoWaitAsync(fd: SceUid, res: *mut i64) -> i32; + pub fn sceIoWaitAsyncCB(fd: SceUid, res: *mut i64) -> i32; + pub fn sceIoPollAsync(fd: SceUid, res: *mut i64) -> i32; + pub fn sceIoGetAsyncStat(fd: SceUid, poll: i32, res: *mut i64) -> i32; + pub fn sceIoCancel(fd: SceUid) -> i32; + pub fn sceIoGetDevType(fd: SceUid) -> i32; + pub fn sceIoChangeAsyncPriority(fd: SceUid, pri: i32) -> i32; + pub fn sceIoSetAsyncCallback(fd: SceUid, cb: SceUid, argp: *mut c_void) -> i32; + + pub fn sceJpegInitMJpeg() -> i32; + pub fn sceJpegFinishMJpeg() -> i32; + pub fn sceJpegCreateMJpeg(width: i32, height: i32) -> i32; + pub fn sceJpegDeleteMJpeg() -> i32; + pub fn sceJpegDecodeMJpeg(jpeg_buf: *mut u8, size: usize, rgba: *mut c_void, unk: u32) -> i32; + + pub fn sceUmdCheckMedium() -> i32; + pub fn sceUmdGetDiscInfo(info: *mut UmdInfo) -> i32; + pub fn sceUmdActivate(unit: i32, drive: *const u8) -> i32; + pub fn sceUmdDeactivate(unit: i32, drive: *const u8) -> i32; + pub fn sceUmdWaitDriveStat(state: i32) -> i32; + pub fn sceUmdWaitDriveStatWithTimer(state: i32, timeout: u32) -> i32; + pub fn sceUmdWaitDriveStatCB(state: i32, timeout: u32) -> i32; + pub fn sceUmdCancelWaitDriveStat() -> i32; + pub fn sceUmdGetDriveStat() -> i32; + pub fn sceUmdGetErrorStat() -> i32; + pub fn sceUmdRegisterUMDCallBack(cbid: i32) -> i32; + pub fn sceUmdUnRegisterUMDCallBack(cbid: i32) -> i32; + pub fn sceUmdReplacePermit() -> i32; + pub fn sceUmdReplaceProhibit() -> i32; + + pub fn sceMpegInit() -> i32; + pub fn sceMpegFinish(); + pub fn sceMpegRingbufferQueryMemSize(packets: i32) -> i32; + pub fn sceMpegRingbufferConstruct( + ringbuffer: *mut SceMpegRingbuffer, + packets: i32, + data: *mut c_void, + size: i32, + callback: SceMpegRingbufferCb, + cb_param: *mut c_void, + ) -> i32; + pub fn sceMpegRingbufferDestruct(ringbuffer: *mut SceMpegRingbuffer); + pub fn sceMpegRingbufferAvailableSize(ringbuffer: *mut SceMpegRingbuffer) -> i32; + pub fn sceMpegRingbufferPut( + ringbuffer: *mut SceMpegRingbuffer, + num_packets: i32, + available: i32, + ) -> i32; + pub fn sceMpegQueryMemSize(unk: i32) -> i32; + pub fn sceMpegCreate( + handle: SceMpeg, + data: *mut c_void, + size: i32, + ringbuffer: *mut SceMpegRingbuffer, + frame_width: i32, + unk1: i32, + unk2: i32, + ) -> i32; + pub fn sceMpegDelete(handle: SceMpeg); + pub fn sceMpegQueryStreamOffset(handle: SceMpeg, buffer: *mut c_void, offset: *mut i32) -> i32; + pub fn sceMpegQueryStreamSize(buffer: *mut c_void, size: *mut i32) -> i32; + pub fn sceMpegRegistStream(handle: SceMpeg, stream_id: i32, unk: i32) -> SceMpegStream; + pub fn sceMpegUnRegistStream(handle: SceMpeg, stream: SceMpegStream); + pub fn sceMpegFlushAllStream(handle: SceMpeg) -> i32; + pub fn sceMpegMallocAvcEsBuf(handle: SceMpeg) -> *mut c_void; + pub fn sceMpegFreeAvcEsBuf(handle: SceMpeg, buf: *mut c_void); + pub fn sceMpegQueryAtracEsSize(handle: SceMpeg, es_size: *mut i32, out_size: *mut i32) -> i32; + pub fn sceMpegInitAu(handle: SceMpeg, es_buffer: *mut c_void, au: *mut SceMpegAu) -> i32; + pub fn sceMpegGetAvcAu( + handle: SceMpeg, + stream: SceMpegStream, + au: *mut SceMpegAu, + unk: *mut i32, + ) -> i32; + pub fn sceMpegAvcDecodeMode(handle: SceMpeg, mode: *mut SceMpegAvcMode) -> i32; + pub fn sceMpegAvcDecode( + handle: SceMpeg, + au: *mut SceMpegAu, + iframe_width: i32, + buffer: *mut c_void, + init: *mut i32, + ) -> i32; + pub fn sceMpegAvcDecodeStop( + handle: SceMpeg, + frame_width: i32, + buffer: *mut c_void, + status: *mut i32, + ) -> i32; + pub fn sceMpegGetAtracAu( + handle: SceMpeg, + stream: SceMpegStream, + au: *mut SceMpegAu, + unk: *mut c_void, + ) -> i32; + pub fn sceMpegAtracDecode( + handle: SceMpeg, + au: *mut SceMpegAu, + buffer: *mut c_void, + init: i32, + ) -> i32; + + pub fn sceMpegBaseYCrCbCopyVme(yuv_buffer: *mut c_void, buffer: *mut i32, type_: i32) -> i32; + pub fn sceMpegBaseCscInit(width: i32) -> i32; + pub fn sceMpegBaseCscVme( + rgb_buffer: *mut c_void, + rgb_buffer2: *mut c_void, + width: i32, + y_cr_cb_buffer: *mut SceMpegYCrCbBuffer, + ) -> i32; + pub fn sceMpegbase_BEA18F91(lli: *mut SceMpegLLI) -> i32; + + pub fn sceHprmPeekCurrentKey(key: *mut i32) -> i32; + pub fn sceHprmPeekLatch(latch: *mut [u32; 4]) -> i32; + pub fn sceHprmReadLatch(latch: *mut [u32; 4]) -> i32; + pub fn sceHprmIsHeadphoneExist() -> i32; + pub fn sceHprmIsRemoteExist() -> i32; + pub fn sceHprmIsMicrophoneExist() -> i32; + + pub fn sceGuDepthBuffer(zbp: *mut c_void, zbw: i32); + pub fn sceGuDispBuffer(width: i32, height: i32, dispbp: *mut c_void, dispbw: i32); + pub fn sceGuDrawBuffer(psm: DisplayPixelFormat, fbp: *mut c_void, fbw: i32); + pub fn sceGuDrawBufferList(psm: DisplayPixelFormat, fbp: *mut c_void, fbw: i32); + pub fn sceGuDisplay(state: bool) -> bool; + pub fn sceGuDepthFunc(function: DepthFunc); + pub fn sceGuDepthMask(mask: i32); + pub fn sceGuDepthOffset(offset: i32); + pub fn sceGuDepthRange(near: i32, far: i32); + pub fn sceGuFog(near: f32, far: f32, color: u32); + pub fn sceGuInit(); + pub fn sceGuTerm(); + pub fn sceGuBreak(mode: i32); + pub fn sceGuContinue(); + pub fn sceGuSetCallback(signal: GuCallbackId, callback: GuCallback) -> GuCallback; + pub fn sceGuSignal(behavior: SignalBehavior, signal: i32); + pub fn sceGuSendCommandf(cmd: GeCommand, argument: f32); + pub fn sceGuSendCommandi(cmd: GeCommand, argument: i32); + pub fn sceGuGetMemory(size: i32) -> *mut c_void; + pub fn sceGuStart(context_type: GuContextType, list: *mut c_void); + pub fn sceGuFinish() -> i32; + pub fn sceGuFinishId(id: u32) -> i32; + pub fn sceGuCallList(list: *const c_void); + pub fn sceGuCallMode(mode: i32); + pub fn sceGuCheckList() -> i32; + pub fn sceGuSendList(mode: GuQueueMode, list: *const c_void, context: *mut GeContext); + pub fn sceGuSwapBuffers() -> *mut c_void; + pub fn sceGuSync(mode: GuSyncMode, behavior: GuSyncBehavior) -> GeListState; + pub fn sceGuDrawArray( + prim: GuPrimitive, + vtype: i32, + count: i32, + indices: *const c_void, + vertices: *const c_void, + ); + pub fn sceGuBeginObject( + vtype: i32, + count: i32, + indices: *const c_void, + vertices: *const c_void, + ); + pub fn sceGuEndObject(); + pub fn sceGuSetStatus(state: GuState, status: i32); + pub fn sceGuGetStatus(state: GuState) -> bool; + pub fn sceGuSetAllStatus(status: i32); + pub fn sceGuGetAllStatus() -> i32; + pub fn sceGuEnable(state: GuState); + pub fn sceGuDisable(state: GuState); + pub fn sceGuLight(light: i32, type_: LightType, components: i32, position: &ScePspFVector3); + pub fn sceGuLightAtt(light: i32, atten0: f32, atten1: f32, atten2: f32); + pub fn sceGuLightColor(light: i32, component: i32, color: u32); + pub fn sceGuLightMode(mode: LightMode); + pub fn sceGuLightSpot(light: i32, direction: &ScePspFVector3, exponent: f32, cutoff: f32); + pub fn sceGuClear(flags: i32); + pub fn sceGuClearColor(color: u32); + pub fn sceGuClearDepth(depth: u32); + pub fn sceGuClearStencil(stencil: u32); + pub fn sceGuPixelMask(mask: u32); + pub fn sceGuColor(color: u32); + pub fn sceGuColorFunc(func: ColorFunc, color: u32, mask: u32); + pub fn sceGuColorMaterial(components: i32); + pub fn sceGuAlphaFunc(func: AlphaFunc, value: i32, mask: i32); + pub fn sceGuAmbient(color: u32); + pub fn sceGuAmbientColor(color: u32); + pub fn sceGuBlendFunc(op: BlendOp, src: BlendSrc, dest: BlendDst, src_fix: u32, dest_fix: u32); + pub fn sceGuMaterial(components: i32, color: u32); + pub fn sceGuModelColor(emissive: u32, ambient: u32, diffuse: u32, specular: u32); + pub fn sceGuStencilFunc(func: StencilFunc, ref_: i32, mask: i32); + pub fn sceGuStencilOp(fail: StencilOperation, zfail: StencilOperation, zpass: StencilOperation); + pub fn sceGuSpecular(power: f32); + pub fn sceGuFrontFace(order: FrontFaceDirection); + pub fn sceGuLogicalOp(op: LogicalOperation); + pub fn sceGuSetDither(matrix: &ScePspIMatrix4); + pub fn sceGuShadeModel(mode: ShadingModel); + pub fn sceGuCopyImage( + psm: DisplayPixelFormat, + sx: i32, + sy: i32, + width: i32, + height: i32, + srcw: i32, + src: *mut c_void, + dx: i32, + dy: i32, + destw: i32, + dest: *mut c_void, + ); + pub fn sceGuTexEnvColor(color: u32); + pub fn sceGuTexFilter(min: TextureFilter, mag: TextureFilter); + pub fn sceGuTexFlush(); + pub fn sceGuTexFunc(tfx: TextureEffect, tcc: TextureColorComponent); + pub fn sceGuTexImage( + mipmap: MipmapLevel, + width: i32, + height: i32, + tbw: i32, + tbp: *const c_void, + ); + pub fn sceGuTexLevelMode(mode: TextureLevelMode, bias: f32); + pub fn sceGuTexMapMode(mode: TextureMapMode, a1: u32, a2: u32); + pub fn sceGuTexMode(tpsm: TexturePixelFormat, maxmips: i32, a2: i32, swizzle: i32); + pub fn sceGuTexOffset(u: f32, v: f32); + pub fn sceGuTexProjMapMode(mode: TextureProjectionMapMode); + pub fn sceGuTexScale(u: f32, v: f32); + pub fn sceGuTexSlope(slope: f32); + pub fn sceGuTexSync(); + pub fn sceGuTexWrap(u: GuTexWrapMode, v: GuTexWrapMode); + pub fn sceGuClutLoad(num_blocks: i32, cbp: *const c_void); + pub fn sceGuClutMode(cpsm: ClutPixelFormat, shift: u32, mask: u32, a3: u32); + pub fn sceGuOffset(x: u32, y: u32); + pub fn sceGuScissor(x: i32, y: i32, w: i32, h: i32); + pub fn sceGuViewport(cx: i32, cy: i32, width: i32, height: i32); + pub fn sceGuDrawBezier( + v_type: i32, + u_count: i32, + v_count: i32, + indices: *const c_void, + vertices: *const c_void, + ); + pub fn sceGuPatchDivide(ulevel: u32, vlevel: u32); + pub fn sceGuPatchFrontFace(a0: u32); + pub fn sceGuPatchPrim(prim: PatchPrimitive); + pub fn sceGuDrawSpline( + v_type: i32, + u_count: i32, + v_count: i32, + u_edge: i32, + v_edge: i32, + indices: *const c_void, + vertices: *const c_void, + ); + pub fn sceGuSetMatrix(type_: MatrixMode, matrix: &ScePspFMatrix4); + pub fn sceGuBoneMatrix(index: u32, matrix: &ScePspFMatrix4); + pub fn sceGuMorphWeight(index: i32, weight: f32); + pub fn sceGuDrawArrayN( + primitive_type: GuPrimitive, + v_type: i32, + count: i32, + a3: i32, + indices: *const c_void, + vertices: *const c_void, + ); + + pub fn sceGumDrawArray( + prim: GuPrimitive, + v_type: i32, + count: i32, + indices: *const c_void, + vertices: *const c_void, + ); + pub fn sceGumDrawArrayN( + prim: GuPrimitive, + v_type: i32, + count: i32, + a3: i32, + indices: *const c_void, + vertices: *const c_void, + ); + pub fn sceGumDrawBezier( + v_type: i32, + u_count: i32, + v_count: i32, + indices: *const c_void, + vertices: *const c_void, + ); + pub fn sceGumDrawSpline( + v_type: i32, + u_count: i32, + v_count: i32, + u_edge: i32, + v_edge: i32, + indices: *const c_void, + vertices: *const c_void, + ); + pub fn sceGumFastInverse(); + pub fn sceGumFullInverse(); + pub fn sceGumLoadIdentity(); + pub fn sceGumLoadMatrix(m: &ScePspFMatrix4); + pub fn sceGumLookAt(eye: &ScePspFVector3, center: &ScePspFVector3, up: &ScePspFVector3); + pub fn sceGumMatrixMode(mode: MatrixMode); + pub fn sceGumMultMatrix(m: &ScePspFMatrix4); + pub fn sceGumOrtho(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32); + pub fn sceGumPerspective(fovy: f32, aspect: f32, near: f32, far: f32); + pub fn sceGumPopMatrix(); + pub fn sceGumPushMatrix(); + pub fn sceGumRotateX(angle: f32); + pub fn sceGumRotateY(angle: f32); + pub fn sceGumRotateZ(angle: f32); + pub fn sceGumRotateXYZ(v: &ScePspFVector3); + pub fn sceGumRotateZYX(v: &ScePspFVector3); + pub fn sceGumScale(v: &ScePspFVector3); + pub fn sceGumStoreMatrix(m: &mut ScePspFMatrix4); + pub fn sceGumTranslate(v: &ScePspFVector3); + pub fn sceGumUpdateMatrix(); + + pub fn sceMp3ReserveMp3Handle(args: *mut SceMp3InitArg) -> i32; + pub fn sceMp3ReleaseMp3Handle(handle: Mp3Handle) -> i32; + pub fn sceMp3InitResource() -> i32; + pub fn sceMp3TermResource() -> i32; + pub fn sceMp3Init(handle: Mp3Handle) -> i32; + pub fn sceMp3Decode(handle: Mp3Handle, dst: *mut *mut i16) -> i32; + pub fn sceMp3GetInfoToAddStreamData( + handle: Mp3Handle, + dst: *mut *mut u8, + to_write: *mut i32, + src_pos: *mut i32, + ) -> i32; + pub fn sceMp3NotifyAddStreamData(handle: Mp3Handle, size: i32) -> i32; + pub fn sceMp3CheckStreamDataNeeded(handle: Mp3Handle) -> i32; + pub fn sceMp3SetLoopNum(handle: Mp3Handle, loop_: i32) -> i32; + pub fn sceMp3GetLoopNum(handle: Mp3Handle) -> i32; + pub fn sceMp3GetSumDecodedSample(handle: Mp3Handle) -> i32; + pub fn sceMp3GetMaxOutputSample(handle: Mp3Handle) -> i32; + pub fn sceMp3GetSamplingRate(handle: Mp3Handle) -> i32; + pub fn sceMp3GetBitRate(handle: Mp3Handle) -> i32; + pub fn sceMp3GetMp3ChannelNum(handle: Mp3Handle) -> i32; + pub fn sceMp3ResetPlayPosition(handle: Mp3Handle) -> i32; + + pub fn sceRegOpenRegistry(reg: *mut Key, mode: i32, handle: *mut RegHandle) -> i32; + pub fn sceRegFlushRegistry(handle: RegHandle) -> i32; + pub fn sceRegCloseRegistry(handle: RegHandle) -> i32; + pub fn sceRegOpenCategory( + handle: RegHandle, + name: *const u8, + mode: i32, + dir_handle: *mut RegHandle, + ) -> i32; + pub fn sceRegRemoveCategory(handle: RegHandle, name: *const u8) -> i32; + pub fn sceRegCloseCategory(dir_handle: RegHandle) -> i32; + pub fn sceRegFlushCategory(dir_handle: RegHandle) -> i32; + pub fn sceRegGetKeyInfo( + dir_handle: RegHandle, + name: *const u8, + key_handle: *mut RegHandle, + type_: *mut KeyType, + size: *mut usize, + ) -> i32; + pub fn sceRegGetKeyInfoByName( + dir_handle: RegHandle, + name: *const u8, + type_: *mut KeyType, + size: *mut usize, + ) -> i32; + pub fn sceRegGetKeyValue( + dir_handle: RegHandle, + key_handle: RegHandle, + buf: *mut c_void, + size: usize, + ) -> i32; + pub fn sceRegGetKeyValueByName( + dir_handle: RegHandle, + name: *const u8, + buf: *mut c_void, + size: usize, + ) -> i32; + pub fn sceRegSetKeyValue( + dir_handle: RegHandle, + name: *const u8, + buf: *const c_void, + size: usize, + ) -> i32; + pub fn sceRegGetKeysNum(dir_handle: RegHandle, num: *mut i32) -> i32; + pub fn sceRegGetKeys(dir_handle: RegHandle, buf: *mut u8, num: i32) -> i32; + pub fn sceRegCreateKey(dir_handle: RegHandle, name: *const u8, type_: i32, size: usize) -> i32; + pub fn sceRegRemoveRegistry(key: *mut Key) -> i32; + + pub fn sceOpenPSIDGetOpenPSID(openpsid: *mut OpenPSID) -> i32; + + pub fn sceUtilityMsgDialogInitStart(params: *mut UtilityMsgDialogParams) -> i32; + pub fn sceUtilityMsgDialogShutdownStart(); + pub fn sceUtilityMsgDialogGetStatus() -> i32; + pub fn sceUtilityMsgDialogUpdate(n: i32); + pub fn sceUtilityMsgDialogAbort() -> i32; + pub fn sceUtilityNetconfInitStart(data: *mut UtilityNetconfData) -> i32; + pub fn sceUtilityNetconfShutdownStart() -> i32; + pub fn sceUtilityNetconfUpdate(unknown: i32) -> i32; + pub fn sceUtilityNetconfGetStatus() -> i32; + pub fn sceUtilityCheckNetParam(id: i32) -> i32; + pub fn sceUtilityGetNetParam(conf: i32, param: NetParam, data: *mut UtilityNetData) -> i32; + pub fn sceUtilitySavedataInitStart(params: *mut SceUtilitySavedataParam) -> i32; + pub fn sceUtilitySavedataGetStatus() -> i32; + pub fn sceUtilitySavedataShutdownStart() -> i32; + pub fn sceUtilitySavedataUpdate(unknown: i32); + pub fn sceUtilityGameSharingInitStart(params: *mut UtilityGameSharingParams) -> i32; + pub fn sceUtilityGameSharingShutdownStart(); + pub fn sceUtilityGameSharingGetStatus() -> i32; + pub fn sceUtilityGameSharingUpdate(n: i32); + pub fn sceUtilityHtmlViewerInitStart(params: *mut UtilityHtmlViewerParam) -> i32; + pub fn sceUtilityHtmlViewerShutdownStart() -> i32; + pub fn sceUtilityHtmlViewerUpdate(n: i32) -> i32; + pub fn sceUtilityHtmlViewerGetStatus() -> i32; + pub fn sceUtilitySetSystemParamInt(id: SystemParamId, value: i32) -> i32; + pub fn sceUtilitySetSystemParamString(id: SystemParamId, str: *const u8) -> i32; + pub fn sceUtilityGetSystemParamInt(id: SystemParamId, value: *mut i32) -> i32; + pub fn sceUtilityGetSystemParamString(id: SystemParamId, str: *mut u8, len: i32) -> i32; + pub fn sceUtilityOskInitStart(params: *mut SceUtilityOskParams) -> i32; + pub fn sceUtilityOskShutdownStart() -> i32; + pub fn sceUtilityOskUpdate(n: i32) -> i32; + pub fn sceUtilityOskGetStatus() -> i32; + pub fn sceUtilityLoadNetModule(module: NetModule) -> i32; + pub fn sceUtilityUnloadNetModule(module: NetModule) -> i32; + pub fn sceUtilityLoadAvModule(module: AvModule) -> i32; + pub fn sceUtilityUnloadAvModule(module: AvModule) -> i32; + pub fn sceUtilityLoadUsbModule(module: UsbModule) -> i32; + pub fn sceUtilityUnloadUsbModule(module: UsbModule) -> i32; + pub fn sceUtilityLoadModule(module: Module) -> i32; + pub fn sceUtilityUnloadModule(module: Module) -> i32; + pub fn sceUtilityCreateNetParam(conf: i32) -> i32; + pub fn sceUtilitySetNetParam(param: NetParam, val: *const c_void) -> i32; + pub fn sceUtilityCopyNetParam(src: i32, dest: i32) -> i32; + pub fn sceUtilityDeleteNetParam(conf: i32) -> i32; + + pub fn sceNetInit( + poolsize: i32, + calloutprio: i32, + calloutstack: i32, + netintrprio: i32, + netintrstack: i32, + ) -> i32; + pub fn sceNetTerm() -> i32; + pub fn sceNetFreeThreadinfo(thid: i32) -> i32; + pub fn sceNetThreadAbort(thid: i32) -> i32; + pub fn sceNetEtherStrton(name: *mut u8, mac: *mut u8); + pub fn sceNetEtherNtostr(mac: *mut u8, name: *mut u8); + pub fn sceNetGetLocalEtherAddr(mac: *mut u8) -> i32; + pub fn sceNetGetMallocStat(stat: *mut SceNetMallocStat) -> i32; + + pub fn sceNetAdhocctlInit( + stacksize: i32, + priority: i32, + adhoc_id: *mut SceNetAdhocctlAdhocId, + ) -> i32; + pub fn sceNetAdhocctlTerm() -> i32; + pub fn sceNetAdhocctlConnect(name: *const u8) -> i32; + pub fn sceNetAdhocctlDisconnect() -> i32; + pub fn sceNetAdhocctlGetState(event: *mut i32) -> i32; + pub fn sceNetAdhocctlCreate(name: *const u8) -> i32; + pub fn sceNetAdhocctlJoin(scaninfo: *mut SceNetAdhocctlScanInfo) -> i32; + pub fn sceNetAdhocctlGetAdhocId(id: *mut SceNetAdhocctlAdhocId) -> i32; + pub fn sceNetAdhocctlCreateEnterGameMode( + name: *const u8, + unknown: i32, + num: i32, + macs: *mut u8, + timeout: u32, + unknown2: i32, + ) -> i32; + pub fn sceNetAdhocctlJoinEnterGameMode( + name: *const u8, + hostmac: *mut u8, + timeout: u32, + unknown: i32, + ) -> i32; + pub fn sceNetAdhocctlGetGameModeInfo(gamemodeinfo: *mut SceNetAdhocctlGameModeInfo) -> i32; + pub fn sceNetAdhocctlExitGameMode() -> i32; + pub fn sceNetAdhocctlGetPeerList(length: *mut i32, buf: *mut c_void) -> i32; + pub fn sceNetAdhocctlGetPeerInfo( + mac: *mut u8, + size: i32, + peerinfo: *mut SceNetAdhocctlPeerInfo, + ) -> i32; + pub fn sceNetAdhocctlScan() -> i32; + pub fn sceNetAdhocctlGetScanInfo(length: *mut i32, buf: *mut c_void) -> i32; + pub fn sceNetAdhocctlAddHandler(handler: SceNetAdhocctlHandler, unknown: *mut c_void) -> i32; + pub fn sceNetAdhocctlDelHandler(id: i32) -> i32; + pub fn sceNetAdhocctlGetNameByAddr(mac: *mut u8, nickname: *mut u8) -> i32; + pub fn sceNetAdhocctlGetAddrByName( + nickname: *mut u8, + length: *mut i32, + buf: *mut c_void, + ) -> i32; + pub fn sceNetAdhocctlGetParameter(params: *mut SceNetAdhocctlParams) -> i32; + + pub fn sceNetAdhocInit() -> i32; + pub fn sceNetAdhocTerm() -> i32; + pub fn sceNetAdhocPdpCreate(mac: *mut u8, port: u16, buf_size: u32, unk1: i32) -> i32; + pub fn sceNetAdhocPdpDelete(id: i32, unk1: i32) -> i32; + pub fn sceNetAdhocPdpSend( + id: i32, + dest_mac_addr: *mut u8, + port: u16, + data: *mut c_void, + len: u32, + timeout: u32, + nonblock: i32, + ) -> i32; + pub fn sceNetAdhocPdpRecv( + id: i32, + src_mac_addr: *mut u8, + port: *mut u16, + data: *mut c_void, + data_length: *mut c_void, + timeout: u32, + nonblock: i32, + ) -> i32; + pub fn sceNetAdhocGetPdpStat(size: *mut i32, stat: *mut SceNetAdhocPdpStat) -> i32; + pub fn sceNetAdhocGameModeCreateMaster(data: *mut c_void, size: i32) -> i32; + pub fn sceNetAdhocGameModeCreateReplica(mac: *mut u8, data: *mut c_void, size: i32) -> i32; + pub fn sceNetAdhocGameModeUpdateMaster() -> i32; + pub fn sceNetAdhocGameModeUpdateReplica(id: i32, unk1: i32) -> i32; + pub fn sceNetAdhocGameModeDeleteMaster() -> i32; + pub fn sceNetAdhocGameModeDeleteReplica(id: i32) -> i32; + pub fn sceNetAdhocPtpOpen( + srcmac: *mut u8, + srcport: u16, + destmac: *mut u8, + destport: u16, + buf_size: u32, + delay: u32, + count: i32, + unk1: i32, + ) -> i32; + pub fn sceNetAdhocPtpConnect(id: i32, timeout: u32, nonblock: i32) -> i32; + pub fn sceNetAdhocPtpListen( + srcmac: *mut u8, + srcport: u16, + buf_size: u32, + delay: u32, + count: i32, + queue: i32, + unk1: i32, + ) -> i32; + pub fn sceNetAdhocPtpAccept( + id: i32, + mac: *mut u8, + port: *mut u16, + timeout: u32, + nonblock: i32, + ) -> i32; + pub fn sceNetAdhocPtpSend( + id: i32, + data: *mut c_void, + data_size: *mut i32, + timeout: u32, + nonblock: i32, + ) -> i32; + pub fn sceNetAdhocPtpRecv( + id: i32, + data: *mut c_void, + data_size: *mut i32, + timeout: u32, + nonblock: i32, + ) -> i32; + pub fn sceNetAdhocPtpFlush(id: i32, timeout: u32, nonblock: i32) -> i32; + pub fn sceNetAdhocPtpClose(id: i32, unk1: i32) -> i32; + pub fn sceNetAdhocGetPtpStat(size: *mut i32, stat: *mut SceNetAdhocPtpStat) -> i32; +} + +extern "C" { + pub fn sceNetAdhocMatchingInit(memsize: i32) -> i32; + pub fn sceNetAdhocMatchingTerm() -> i32; + pub fn sceNetAdhocMatchingCreate( + mode: AdhocMatchingMode, + max_peers: i32, + port: u16, + buf_size: i32, + hello_delay: u32, + ping_delay: u32, + init_count: i32, + msg_delay: u32, + callback: AdhocMatchingCallback, + ) -> i32; + pub fn sceNetAdhocMatchingDelete(matching_id: i32) -> i32; + pub fn sceNetAdhocMatchingStart( + matching_id: i32, + evth_pri: i32, + evth_stack: i32, + inth_pri: i32, + inth_stack: i32, + opt_len: i32, + opt_data: *mut c_void, + ) -> i32; + pub fn sceNetAdhocMatchingStop(matching_id: i32) -> i32; + pub fn sceNetAdhocMatchingSelectTarget( + matching_id: i32, + mac: *mut u8, + opt_len: i32, + opt_data: *mut c_void, + ) -> i32; + pub fn sceNetAdhocMatchingCancelTarget(matching_id: i32, mac: *mut u8) -> i32; + pub fn sceNetAdhocMatchingCancelTargetWithOpt( + matching_id: i32, + mac: *mut u8, + opt_len: i32, + opt_data: *mut c_void, + ) -> i32; + pub fn sceNetAdhocMatchingSendData( + matching_id: i32, + mac: *mut u8, + data_len: i32, + data: *mut c_void, + ) -> i32; + pub fn sceNetAdhocMatchingAbortSendData(matching_id: i32, mac: *mut u8) -> i32; + pub fn sceNetAdhocMatchingSetHelloOpt( + matching_id: i32, + opt_len: i32, + opt_data: *mut c_void, + ) -> i32; + pub fn sceNetAdhocMatchingGetHelloOpt( + matching_id: i32, + opt_len: *mut i32, + opt_data: *mut c_void, + ) -> i32; + pub fn sceNetAdhocMatchingGetMembers( + matching_id: i32, + length: *mut i32, + buf: *mut c_void, + ) -> i32; + pub fn sceNetAdhocMatchingGetPoolMaxAlloc() -> i32; + pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut AdhocPoolStat) -> i32; +} + +extern "C" { + pub fn sceNetApctlInit(stack_size: i32, init_priority: i32) -> i32; + pub fn sceNetApctlTerm() -> i32; + pub fn sceNetApctlGetInfo(code: ApctlInfo, pinfo: *mut SceNetApctlInfo) -> i32; + pub fn sceNetApctlAddHandler(handler: SceNetApctlHandler, parg: *mut c_void) -> i32; + pub fn sceNetApctlDelHandler(handler_id: i32) -> i32; + pub fn sceNetApctlConnect(conn_index: i32) -> i32; + pub fn sceNetApctlDisconnect() -> i32; + pub fn sceNetApctlGetState(pstate: *mut ApctlState) -> i32; + + pub fn sceNetInetInit() -> i32; + pub fn sceNetInetTerm() -> i32; + pub fn sceNetInetAccept(s: i32, addr: *mut sockaddr, addr_len: *mut socklen_t) -> i32; + pub fn sceNetInetBind(s: i32, my_addr: *const sockaddr, addr_len: socklen_t) -> i32; + pub fn sceNetInetConnect(s: i32, serv_addr: *const sockaddr, addr_len: socklen_t) -> i32; + pub fn sceNetInetGetsockopt( + s: i32, + level: i32, + opt_name: i32, + opt_val: *mut c_void, + optl_en: *mut socklen_t, + ) -> i32; + pub fn sceNetInetListen(s: i32, backlog: i32) -> i32; + pub fn sceNetInetRecv(s: i32, buf: *mut c_void, len: usize, flags: i32) -> usize; + pub fn sceNetInetRecvfrom( + s: i32, + buf: *mut c_void, + flags: usize, + arg1: i32, + from: *mut sockaddr, + from_len: *mut socklen_t, + ) -> usize; + pub fn sceNetInetSend(s: i32, buf: *const c_void, len: usize, flags: i32) -> usize; + pub fn sceNetInetSendto( + s: i32, + buf: *const c_void, + len: usize, + flags: i32, + to: *const sockaddr, + to_len: socklen_t, + ) -> usize; + pub fn sceNetInetSetsockopt( + s: i32, + level: i32, + opt_name: i32, + opt_val: *const c_void, + opt_len: socklen_t, + ) -> i32; + pub fn sceNetInetShutdown(s: i32, how: i32) -> i32; + pub fn sceNetInetSocket(domain: i32, type_: i32, protocol: i32) -> i32; + pub fn sceNetInetClose(s: i32) -> i32; + pub fn sceNetInetGetErrno() -> i32; + + pub fn sceSslInit(unknown1: i32) -> i32; + pub fn sceSslEnd() -> i32; + pub fn sceSslGetUsedMemoryMax(memory: *mut u32) -> i32; + pub fn sceSslGetUsedMemoryCurrent(memory: *mut u32) -> i32; + + pub fn sceHttpInit(unknown1: u32) -> i32; + pub fn sceHttpEnd() -> i32; + pub fn sceHttpCreateTemplate(agent: *mut u8, unknown1: i32, unknown2: i32) -> i32; + pub fn sceHttpDeleteTemplate(templateid: i32) -> i32; + pub fn sceHttpCreateConnection( + templateid: i32, + host: *mut u8, + unknown1: *mut u8, + port: u16, + unknown2: i32, + ) -> i32; + pub fn sceHttpCreateConnectionWithURL(templateid: i32, url: *const u8, unknown1: i32) -> i32; + pub fn sceHttpDeleteConnection(connection_id: i32) -> i32; + pub fn sceHttpCreateRequest( + connection_id: i32, + method: HttpMethod, + path: *mut u8, + content_length: u64, + ) -> i32; + pub fn sceHttpCreateRequestWithURL( + connection_id: i32, + method: HttpMethod, + url: *mut u8, + content_length: u64, + ) -> i32; + pub fn sceHttpDeleteRequest(request_id: i32) -> i32; + pub fn sceHttpSendRequest(request_id: i32, data: *mut c_void, data_size: u32) -> i32; + pub fn sceHttpAbortRequest(request_id: i32) -> i32; + pub fn sceHttpReadData(request_id: i32, data: *mut c_void, data_size: u32) -> i32; + pub fn sceHttpGetContentLength(request_id: i32, content_length: *mut u64) -> i32; + pub fn sceHttpGetStatusCode(request_id: i32, status_code: *mut i32) -> i32; + pub fn sceHttpSetResolveTimeOut(id: i32, timeout: u32) -> i32; + pub fn sceHttpSetResolveRetry(id: i32, count: i32) -> i32; + pub fn sceHttpSetConnectTimeOut(id: i32, timeout: u32) -> i32; + pub fn sceHttpSetSendTimeOut(id: i32, timeout: u32) -> i32; + pub fn sceHttpSetRecvTimeOut(id: i32, timeout: u32) -> i32; + pub fn sceHttpEnableKeepAlive(id: i32) -> i32; + pub fn sceHttpDisableKeepAlive(id: i32) -> i32; + pub fn sceHttpEnableRedirect(id: i32) -> i32; + pub fn sceHttpDisableRedirect(id: i32) -> i32; + pub fn sceHttpEnableCookie(id: i32) -> i32; + pub fn sceHttpDisableCookie(id: i32) -> i32; + pub fn sceHttpSaveSystemCookie() -> i32; + pub fn sceHttpLoadSystemCookie() -> i32; + pub fn sceHttpAddExtraHeader(id: i32, name: *mut u8, value: *mut u8, unknown1: i32) -> i32; + pub fn sceHttpDeleteHeader(id: i32, name: *const u8) -> i32; + pub fn sceHttpsInit(unknown1: i32, unknown2: i32, unknown3: i32, unknown4: i32) -> i32; + pub fn sceHttpsEnd() -> i32; + pub fn sceHttpsLoadDefaultCert(unknown1: i32, unknown2: i32) -> i32; + pub fn sceHttpDisableAuth(id: i32) -> i32; + pub fn sceHttpDisableCache(id: i32) -> i32; + pub fn sceHttpEnableAuth(id: i32) -> i32; + pub fn sceHttpEnableCache(id: i32) -> i32; + pub fn sceHttpEndCache() -> i32; + pub fn sceHttpGetAllHeader(request: i32, header: *mut *mut u8, header_size: *mut u32) -> i32; + pub fn sceHttpGetNetworkErrno(request: i32, err_num: *mut i32) -> i32; + pub fn sceHttpGetProxy( + id: i32, + activate_flag: *mut i32, + mode: *mut i32, + proxy_host: *mut u8, + len: usize, + proxy_port: *mut u16, + ) -> i32; + pub fn sceHttpInitCache(max_size: usize) -> i32; + pub fn sceHttpSetAuthInfoCB(id: i32, cbfunc: HttpPasswordCB) -> i32; + pub fn sceHttpSetProxy( + id: i32, + activate_flag: i32, + mode: i32, + new_proxy_host: *const u8, + new_proxy_port: u16, + ) -> i32; + pub fn sceHttpSetResHeaderMaxSize(id: i32, header_size: u32) -> i32; + pub fn sceHttpSetMallocFunction( + malloc_func: HttpMallocFunction, + free_func: HttpFreeFunction, + realloc_func: HttpReallocFunction, + ) -> i32; + + pub fn sceNetResolverInit() -> i32; + pub fn sceNetResolverCreate(rid: *mut i32, buf: *mut c_void, buf_length: u32) -> i32; + pub fn sceNetResolverDelete(rid: i32) -> i32; + pub fn sceNetResolverStartNtoA( + rid: i32, + hostname: *const u8, + addr: *mut in_addr, + timeout: u32, + retry: i32, + ) -> i32; + pub fn sceNetResolverStartAtoN( + rid: i32, + addr: *const in_addr, + hostname: *mut u8, + hostname_len: u32, + timeout: u32, + retry: i32, + ) -> i32; + pub fn sceNetResolverStop(rid: i32) -> i32; + pub fn sceNetResolverTerm() -> i32; +} diff --git a/bash-5.1/vendor/libc/src/sgx.rs b/bash-5.1/vendor/libc/src/sgx.rs new file mode 100644 index 0000000000000000000000000000000000000000..7da6269399d9e5d598fc91412932e9dd78e24057 --- /dev/null +++ b/bash-5.1/vendor/libc/src/sgx.rs @@ -0,0 +1,47 @@ +//! SGX C types definition + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_float = f32; +pub type c_double = f64; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; + +pub type size_t = usize; +pub type ptrdiff_t = isize; +pub type intptr_t = isize; +pub type uintptr_t = usize; +pub type ssize_t = isize; + +pub type c_char = i8; +pub type c_long = i64; +pub type c_ulong = u64; + +pub const INT_MIN: c_int = -2147483648; +pub const INT_MAX: c_int = 2147483647; + +cfg_if! { + if #[cfg(libc_core_cvoid)] { + pub use ::ffi::c_void; + } else { + // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help + // enable more optimization opportunities around it recognizing things + // like malloc/free. + #[repr(u8)] + #[allow(missing_copy_implementations)] + #[allow(missing_debug_implementations)] + pub enum c_void { + // Two dummy variants so the #[repr] attribute can be used. + #[doc(hidden)] + __variant1, + #[doc(hidden)] + __variant2, + } + } +} diff --git a/bash-5.1/vendor/libc/src/solid/aarch64.rs b/bash-5.1/vendor/libc/src/solid/aarch64.rs new file mode 100644 index 0000000000000000000000000000000000000000..ceabea397b804e0789baad4bdd923c728e5c44bf --- /dev/null +++ b/bash-5.1/vendor/libc/src/solid/aarch64.rs @@ -0,0 +1,4 @@ +pub type c_char = i8; +pub type wchar_t = u32; +pub type c_long = i64; +pub type c_ulong = u64; diff --git a/bash-5.1/vendor/libc/src/solid/arm.rs b/bash-5.1/vendor/libc/src/solid/arm.rs new file mode 100644 index 0000000000000000000000000000000000000000..04cc1542deaeb5c534f63499638dccc46076edaf --- /dev/null +++ b/bash-5.1/vendor/libc/src/solid/arm.rs @@ -0,0 +1,4 @@ +pub type c_char = i8; +pub type wchar_t = u32; +pub type c_long = i32; +pub type c_ulong = u32; diff --git a/bash-5.1/vendor/libc/src/solid/mod.rs b/bash-5.1/vendor/libc/src/solid/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..f0f2ae89bde90ab796db4f43db1b7905561be1b0 --- /dev/null +++ b/bash-5.1/vendor/libc/src/solid/mod.rs @@ -0,0 +1,904 @@ +//! Interface to the [SOLID] C library +//! +//! [SOLID]: https://solid.kmckk.com/ + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_float = f32; +pub type c_double = f64; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; + +pub type uintptr_t = usize; +pub type intptr_t = isize; +pub type ptrdiff_t = isize; +pub type size_t = ::uintptr_t; +pub type ssize_t = ::intptr_t; + +pub type clock_t = c_uint; +pub type time_t = i64; +pub type clockid_t = c_int; +pub type timer_t = c_int; +pub type suseconds_t = c_int; +pub type useconds_t = c_uint; + +pub type sighandler_t = size_t; + +// sys/ansi.h +pub type __caddr_t = *mut c_char; +pub type __gid_t = u32; +pub type __in_addr_t = u32; +pub type __in_port_t = u16; +pub type __mode_t = u32; +pub type __off_t = i64; +pub type __pid_t = i32; +pub type __sa_family_t = u8; +pub type __socklen_t = c_uint; +pub type __uid_t = u32; +pub type __fsblkcnt_t = u64; +pub type __fsfilcnt_t = u64; + +// locale.h +pub type locale_t = usize; + +// nl_types.h +pub type nl_item = c_long; + +// sys/types.h +pub type __va_list = *mut c_char; +pub type u_int8_t = u8; +pub type u_int16_t = u16; +pub type u_int32_t = u32; +pub type u_int64_t = u64; +pub type u_char = c_uchar; +pub type u_short = c_ushort; +pub type u_int = c_uint; +pub type u_long = c_ulong; +pub type unchar = c_uchar; +pub type ushort = c_ushort; +pub type uint = c_uint; +pub type ulong = c_ulong; +pub type u_quad_t = u64; +pub type quad_t = i64; +pub type qaddr_t = *mut quad_t; +pub type longlong_t = i64; +pub type u_longlong_t = u64; +pub type blkcnt_t = i64; +pub type blksize_t = i32; +pub type fsblkcnt_t = __fsblkcnt_t; +pub type fsfilcnt_t = __fsfilcnt_t; +pub type caddr_t = __caddr_t; +pub type daddr_t = i64; +pub type dev_t = u64; +pub type fixpt_t = u32; +pub type gid_t = __gid_t; +pub type idtype_t = c_int; +pub type id_t = u32; +pub type ino_t = u64; +pub type key_t = c_long; +pub type mode_t = __mode_t; +pub type nlink_t = u32; +pub type off_t = __off_t; +pub type pid_t = __pid_t; +pub type lwpid_t = i32; +pub type rlim_t = u64; +pub type segsz_t = i32; +pub type swblk_t = i32; +pub type mqd_t = c_int; +pub type cpuid_t = c_ulong; +pub type psetid_t = c_int; + +s! { + // stat.h + pub struct stat { + pub st_dev: dev_t, + pub st_ino: ino_t, + pub st_mode: c_short, + pub st_nlink: c_short, + pub st_uid: c_short, + pub st_gid: c_short, + pub st_rdev: dev_t, + pub st_size: off_t, + pub st_atime: time_t, + pub st_mtime: time_t, + pub st_ctime: time_t, + pub st_blksize: blksize_t, + } + + // time.h + pub struct tm { + pub tm_sec: c_int, + pub tm_min: c_int, + pub tm_hour: c_int, + pub tm_mday: c_int, + pub tm_mon: c_int, + pub tm_year: c_int, + pub tm_wday: c_int, + pub tm_yday: c_int, + pub tm_isdst: c_int, + pub tm_gmtoff: c_long, + pub tm_zone: *mut c_char, + } + + // stdlib.h + pub struct qdiv_t { + pub quot: quad_t, + pub rem: quad_t, + } + pub struct lldiv_t { + pub quot: c_longlong, + pub rem: c_longlong, + } + pub struct div_t { + pub quot: c_int, + pub rem: c_int, + } + pub struct ldiv_t { + pub quot: c_long, + pub rem: c_long, + } + + // locale.h + pub struct lconv { + pub decimal_point: *mut c_char, + pub thousands_sep: *mut c_char, + pub grouping: *mut c_char, + pub int_curr_symbol: *mut c_char, + pub currency_symbol: *mut c_char, + pub mon_decimal_point: *mut c_char, + pub mon_thousands_sep: *mut c_char, + pub mon_grouping: *mut c_char, + pub positive_sign: *mut c_char, + pub negative_sign: *mut c_char, + pub int_frac_digits: c_char, + pub frac_digits: c_char, + pub p_cs_precedes: c_char, + pub p_sep_by_space: c_char, + pub n_cs_precedes: c_char, + pub n_sep_by_space: c_char, + pub p_sign_posn: c_char, + pub n_sign_posn: c_char, + pub int_p_cs_precedes: c_char, + pub int_n_cs_precedes: c_char, + pub int_p_sep_by_space: c_char, + pub int_n_sep_by_space: c_char, + pub int_p_sign_posn: c_char, + pub int_n_sign_posn: c_char, + } + + pub struct iovec { + pub iov_base: *mut c_void, + pub iov_len: size_t, + } + + pub struct timeval { + pub tv_sec: c_long, + pub tv_usec: c_long, + } +} + +pub const INT_MIN: c_int = -2147483648; +pub const INT_MAX: c_int = 2147483647; + +pub const EXIT_FAILURE: c_int = 1; +pub const EXIT_SUCCESS: c_int = 0; +pub const RAND_MAX: c_int = 0x7fffffff; +pub const EOF: c_int = -1; +pub const SEEK_SET: c_int = 0; +pub const SEEK_CUR: c_int = 1; +pub const SEEK_END: c_int = 2; +pub const _IOFBF: c_int = 0; +pub const _IONBF: c_int = 2; +pub const _IOLBF: c_int = 1; +pub const BUFSIZ: c_uint = 1024; +pub const FOPEN_MAX: c_uint = 20; +pub const FILENAME_MAX: c_uint = 1024; + +pub const O_RDONLY: c_int = 1; +pub const O_WRONLY: c_int = 2; +pub const O_RDWR: c_int = 4; +pub const O_APPEND: c_int = 8; +pub const O_CREAT: c_int = 0x10; +pub const O_EXCL: c_int = 0x400; +pub const O_TEXT: c_int = 0x100; +pub const O_BINARY: c_int = 0x200; +pub const O_TRUNC: c_int = 0x20; +pub const S_IEXEC: c_short = 0x0040; +pub const S_IWRITE: c_short = 0x0080; +pub const S_IREAD: c_short = 0x0100; +pub const S_IFCHR: c_short = 0x2000; +pub const S_IFDIR: c_short = 0x4000; +pub const S_IFMT: c_short = 0o160000; +pub const S_IFIFO: c_short = 0o0010000; +pub const S_IFBLK: c_short = 0o0060000; +pub const S_IFREG: c_short = 0o0100000; + +pub const LC_ALL: c_int = 0; +pub const LC_COLLATE: c_int = 1; +pub const LC_CTYPE: c_int = 2; +pub const LC_MONETARY: c_int = 3; +pub const LC_NUMERIC: c_int = 4; +pub const LC_TIME: c_int = 5; +pub const LC_MESSAGES: c_int = 6; +pub const _LC_LAST: c_int = 7; + +pub const EPERM: c_int = 1; +pub const ENOENT: c_int = 2; +pub const ESRCH: c_int = 3; +pub const EINTR: c_int = 4; +pub const EIO: c_int = 5; +pub const ENXIO: c_int = 6; +pub const E2BIG: c_int = 7; +pub const ENOEXEC: c_int = 8; +pub const EBADF: c_int = 9; +pub const ECHILD: c_int = 10; +pub const EAGAIN: c_int = 11; +pub const ENOMEM: c_int = 12; +pub const EACCES: c_int = 13; +pub const EFAULT: c_int = 14; +pub const ENOTBLK: c_int = 15; +pub const EBUSY: c_int = 16; +pub const EEXIST: c_int = 17; +pub const EXDEV: c_int = 18; +pub const ENODEV: c_int = 19; +pub const ENOTDIR: c_int = 20; +pub const EISDIR: c_int = 21; +pub const EINVAL: c_int = 22; +pub const ENFILE: c_int = 23; +pub const EMFILE: c_int = 24; +pub const ENOTTY: c_int = 25; +pub const ETXTBSY: c_int = 26; +pub const EFBIG: c_int = 27; +pub const ENOSPC: c_int = 28; +pub const ESPIPE: c_int = 29; +pub const EROFS: c_int = 30; +pub const EMLINK: c_int = 31; +pub const EPIPE: c_int = 32; +pub const EDOM: c_int = 33; +pub const ERANGE: c_int = 34; + +pub const EDEADLK: c_int = 35; +pub const ENAMETOOLONG: c_int = 36; +pub const ENOLCK: c_int = 37; +pub const ENOSYS: c_int = 38; +pub const ENOTEMPTY: c_int = 39; +pub const ELOOP: c_int = 40; +pub const EWOULDBLOCK: c_int = EAGAIN; +pub const ENOMSG: c_int = 42; +pub const EIDRM: c_int = 43; +pub const ECHRNG: c_int = 44; +pub const EL2NSYNC: c_int = 45; +pub const EL3HLT: c_int = 46; +pub const EL3RST: c_int = 47; +pub const ELNRNG: c_int = 48; +pub const EUNATCH: c_int = 49; +pub const ENOCSI: c_int = 50; +pub const EL2HLT: c_int = 51; +pub const EBADE: c_int = 52; +pub const EBADR: c_int = 53; +pub const EXFULL: c_int = 54; +pub const ENOANO: c_int = 55; +pub const EBADRQC: c_int = 56; +pub const EBADSLT: c_int = 57; + +pub const EDEADLOCK: c_int = EDEADLK; + +pub const EBFONT: c_int = 59; +pub const ENOSTR: c_int = 60; +pub const ENODATA: c_int = 61; +pub const ETIME: c_int = 62; +pub const ENOSR: c_int = 63; +pub const ENONET: c_int = 64; +pub const ENOPKG: c_int = 65; +pub const EREMOTE: c_int = 66; +pub const ENOLINK: c_int = 67; +pub const EADV: c_int = 68; +pub const ESRMNT: c_int = 69; +pub const ECOMM: c_int = 70; +pub const EPROTO: c_int = 71; +pub const EMULTIHOP: c_int = 72; +pub const EDOTDOT: c_int = 73; +pub const EBADMSG: c_int = 74; +pub const EOVERFLOW: c_int = 75; +pub const ENOTUNIQ: c_int = 76; +pub const EBADFD: c_int = 77; +pub const EREMCHG: c_int = 78; +pub const ELIBACC: c_int = 79; +pub const ELIBBAD: c_int = 80; +pub const ELIBSCN: c_int = 81; +pub const ELIBMAX: c_int = 82; +pub const ELIBEXEC: c_int = 83; +pub const EILSEQ: c_int = 84; +pub const ERESTART: c_int = 85; +pub const ESTRPIPE: c_int = 86; +pub const EUSERS: c_int = 87; +pub const ENOTSOCK: c_int = 88; +pub const EDESTADDRREQ: c_int = 89; +pub const EMSGSIZE: c_int = 90; +pub const EPROTOTYPE: c_int = 91; +pub const ENOPROTOOPT: c_int = 92; +pub const EPROTONOSUPPORT: c_int = 93; +pub const ESOCKTNOSUPPORT: c_int = 94; +pub const EOPNOTSUPP: c_int = 95; +pub const EPFNOSUPPORT: c_int = 96; +pub const EAFNOSUPPORT: c_int = 97; +pub const EADDRINUSE: c_int = 98; +pub const EADDRNOTAVAIL: c_int = 99; +pub const ENETDOWN: c_int = 100; +pub const ENETUNREACH: c_int = 101; +pub const ENETRESET: c_int = 102; +pub const ECONNABORTED: c_int = 103; +pub const ECONNRESET: c_int = 104; +pub const ENOBUFS: c_int = 105; +pub const EISCONN: c_int = 106; +pub const ENOTCONN: c_int = 107; +pub const ESHUTDOWN: c_int = 108; +pub const ETOOMANYREFS: c_int = 109; +pub const ETIMEDOUT: c_int = 110; +pub const ECONNREFUSED: c_int = 111; +pub const EHOSTDOWN: c_int = 112; +pub const EHOSTUNREACH: c_int = 113; +pub const EALREADY: c_int = 114; +pub const EINPROGRESS: c_int = 115; +pub const ESTALE: c_int = 116; +pub const EUCLEAN: c_int = 117; +pub const ENOTNAM: c_int = 118; +pub const ENAVAIL: c_int = 119; +pub const EISNAM: c_int = 120; +pub const EREMOTEIO: c_int = 121; +pub const EDQUOT: c_int = 122; + +pub const ENOMEDIUM: c_int = 123; +pub const EMEDIUMTYPE: c_int = 124; +pub const ECANCELED: c_int = 125; +pub const ENOKEY: c_int = 126; +pub const EKEYEXPIRED: c_int = 127; +pub const EKEYREVOKED: c_int = 128; +pub const EKEYREJECTED: c_int = 129; + +pub const EOWNERDEAD: c_int = 130; +pub const ENOTRECOVERABLE: c_int = 131; + +pub const ENOTSUP: c_int = 132; +pub const EFTYPE: c_int = 133; + +// signal codes +pub const SIGHUP: c_int = 1; +pub const SIGINT: c_int = 2; +pub const SIGQUIT: c_int = 3; +pub const SIGILL: c_int = 4; +pub const SIGTRAP: c_int = 5; +pub const SIGABRT: c_int = 6; +pub const SIGIOT: c_int = SIGABRT; +pub const SIGEMT: c_int = 7; +pub const SIGFPE: c_int = 8; +pub const SIGKILL: c_int = 9; +pub const SIGBUS: c_int = 10; +pub const SIGSEGV: c_int = 11; +pub const SIGSYS: c_int = 12; +pub const SIGPIPE: c_int = 13; +pub const SIGALRM: c_int = 14; +pub const SIGTERM: c_int = 15; +pub const SIGURG: c_int = 16; +pub const SIGSTOP: c_int = 17; +pub const SIGTSTP: c_int = 18; +pub const SIGCONT: c_int = 19; +pub const SIGCHLD: c_int = 20; +pub const SIGTTIN: c_int = 21; +pub const SIGTTOU: c_int = 22; +pub const SIGIO: c_int = 23; +pub const SIGXCPU: c_int = 24; +pub const SIGXFSZ: c_int = 25; +pub const SIGVTALRM: c_int = 26; +pub const SIGPROF: c_int = 27; +pub const SIGWINCH: c_int = 28; +pub const SIGINFO: c_int = 29; +pub const SIGUSR1: c_int = 30; +pub const SIGUSR2: c_int = 31; +pub const SIGPWR: c_int = 32; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum FILE {} +impl ::Copy for FILE {} +impl ::Clone for FILE { + fn clone(&self) -> FILE { + *self + } +} +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum fpos_t {} +impl ::Copy for fpos_t {} +impl ::Clone for fpos_t { + fn clone(&self) -> fpos_t { + *self + } +} + +extern "C" { + // ctype.h + pub fn isalnum(c: c_int) -> c_int; + pub fn isalpha(c: c_int) -> c_int; + pub fn iscntrl(c: c_int) -> c_int; + pub fn isdigit(c: c_int) -> c_int; + pub fn isgraph(c: c_int) -> c_int; + pub fn islower(c: c_int) -> c_int; + pub fn isprint(c: c_int) -> c_int; + pub fn ispunct(c: c_int) -> c_int; + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; + pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; + + // stdio.h + pub fn __get_stdio_file(fileno: c_int) -> *mut FILE; + pub fn clearerr(arg1: *mut FILE); + pub fn fclose(arg1: *mut FILE) -> c_int; + pub fn feof(arg1: *mut FILE) -> c_int; + pub fn ferror(arg1: *mut FILE) -> c_int; + pub fn fflush(arg1: *mut FILE) -> c_int; + pub fn fgetc(arg1: *mut FILE) -> c_int; + pub fn fgets(arg1: *mut c_char, arg2: c_int, arg3: *mut FILE) -> *mut c_char; + pub fn fopen(arg1: *const c_char, arg2: *const c_char) -> *mut FILE; + pub fn fprintf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int; + pub fn fputc(arg1: c_int, arg2: *mut FILE) -> c_int; + pub fn fputs(arg1: *const c_char, arg2: *mut FILE) -> c_int; + pub fn fread(arg1: *mut c_void, arg2: size_t, arg3: size_t, arg4: *mut FILE) -> size_t; + pub fn freopen(arg1: *const c_char, arg2: *const c_char, arg3: *mut FILE) -> *mut FILE; + pub fn fscanf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int; + pub fn fseek(arg1: *mut FILE, arg2: c_long, arg3: c_int) -> c_int; + pub fn ftell(arg1: *mut FILE) -> c_long; + pub fn fwrite(arg1: *const c_void, arg2: size_t, arg3: size_t, arg4: *mut FILE) -> size_t; + pub fn getc(arg1: *mut FILE) -> c_int; + pub fn getchar() -> c_int; + pub fn perror(arg1: *const c_char); + pub fn printf(arg1: *const c_char, ...) -> c_int; + pub fn putc(arg1: c_int, arg2: *mut FILE) -> c_int; + pub fn putchar(arg1: c_int) -> c_int; + pub fn puts(arg1: *const c_char) -> c_int; + pub fn remove(arg1: *const c_char) -> c_int; + pub fn rewind(arg1: *mut FILE); + pub fn scanf(arg1: *const c_char, ...) -> c_int; + pub fn setbuf(arg1: *mut FILE, arg2: *mut c_char); + pub fn setvbuf(arg1: *mut FILE, arg2: *mut c_char, arg3: c_int, arg4: size_t) -> c_int; + pub fn sscanf(arg1: *const c_char, arg2: *const c_char, ...) -> c_int; + pub fn tmpfile() -> *mut FILE; + pub fn ungetc(arg1: c_int, arg2: *mut FILE) -> c_int; + pub fn vfprintf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int; + pub fn vprintf(arg1: *const c_char, arg2: __va_list) -> c_int; + pub fn gets(arg1: *mut c_char) -> *mut c_char; + pub fn sprintf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int; + pub fn tmpnam(arg1: *const c_char) -> *mut c_char; + pub fn vsprintf(arg1: *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int; + pub fn rename(arg1: *const c_char, arg2: *const c_char) -> c_int; + pub fn asiprintf(arg1: *mut *mut c_char, arg2: *const c_char, ...) -> c_int; + pub fn fiprintf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int; + pub fn fiscanf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int; + pub fn iprintf(arg1: *const c_char, ...) -> c_int; + pub fn iscanf(arg1: *const c_char, ...) -> c_int; + pub fn siprintf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int; + pub fn siscanf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int; + pub fn sniprintf(arg1: *mut c_char, arg2: size_t, arg3: *const c_char, ...) -> c_int; + pub fn vasiprintf(arg1: *mut *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int; + pub fn vfiprintf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int; + pub fn vfiscanf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int; + pub fn viprintf(arg1: *const c_char, arg2: __va_list) -> c_int; + pub fn viscanf(arg1: *const c_char, arg2: __va_list) -> c_int; + pub fn vsiprintf(arg1: *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int; + pub fn vsiscanf(arg1: *const c_char, arg2: *const c_char, arg3: __va_list) -> c_int; + pub fn vsniprintf( + arg1: *mut c_char, + arg2: size_t, + arg3: *const c_char, + arg4: __va_list, + ) -> c_int; + pub fn vdiprintf(arg1: c_int, arg2: *const c_char, arg3: __va_list) -> c_int; + pub fn diprintf(arg1: c_int, arg2: *const c_char, ...) -> c_int; + pub fn fgetpos(arg1: *mut FILE, arg2: *mut fpos_t) -> c_int; + pub fn fsetpos(arg1: *mut FILE, arg2: *const fpos_t) -> c_int; + pub fn fdopen(arg1: c_int, arg2: *const c_char) -> *mut FILE; + pub fn fileno(arg1: *mut FILE) -> c_int; + pub fn flockfile(arg1: *mut FILE); + pub fn ftrylockfile(arg1: *mut FILE) -> c_int; + pub fn funlockfile(arg1: *mut FILE); + pub fn getc_unlocked(arg1: *mut FILE) -> c_int; + pub fn getchar_unlocked() -> c_int; + pub fn putc_unlocked(arg1: c_int, arg2: *mut FILE) -> c_int; + pub fn putchar_unlocked(arg1: c_int) -> c_int; + pub fn snprintf(arg1: *mut c_char, arg2: size_t, arg3: *const c_char, ...) -> c_int; + pub fn vsnprintf( + arg1: *mut c_char, + arg2: size_t, + arg3: *const c_char, + arg4: __va_list, + ) -> c_int; + pub fn getw(arg1: *mut FILE) -> c_int; + pub fn putw(arg1: c_int, arg2: *mut FILE) -> c_int; + pub fn tempnam(arg1: *const c_char, arg2: *const c_char) -> *mut c_char; + pub fn fseeko(stream: *mut FILE, offset: off_t, whence: c_int) -> c_int; + pub fn ftello(stream: *mut FILE) -> off_t; + + // stdlib.h + pub fn atof(arg1: *const c_char) -> f64; + pub fn strtod(arg1: *const c_char, arg2: *mut *mut c_char) -> f64; + pub fn drand48() -> f64; + pub fn erand48(arg1: *mut c_ushort) -> f64; + pub fn strtof(arg1: *const c_char, arg2: *mut *mut c_char) -> f32; + pub fn strtold(arg1: *const c_char, arg2: *mut *mut c_char) -> f64; + pub fn strtod_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f64; + pub fn strtof_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f32; + pub fn strtold_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f64; + pub fn _Exit(arg1: c_int) -> !; + pub fn abort() -> !; + pub fn abs(arg1: c_int) -> c_int; + pub fn atexit(arg1: ::Option) -> c_int; + pub fn atoi(arg1: *const c_char) -> c_int; + pub fn atol(arg1: *const c_char) -> c_long; + pub fn itoa(arg1: c_int, arg2: *mut c_char, arg3: c_int) -> *mut c_char; + pub fn ltoa(arg1: c_long, arg2: *mut c_char, arg3: c_int) -> *mut c_char; + pub fn ultoa(arg1: c_ulong, arg2: *mut c_char, arg3: c_int) -> *mut c_char; + pub fn bsearch( + arg1: *const c_void, + arg2: *const c_void, + arg3: size_t, + arg4: size_t, + arg5: ::Option c_int>, + ) -> *mut c_void; + pub fn calloc(arg1: size_t, arg2: size_t) -> *mut c_void; + pub fn div(arg1: c_int, arg2: c_int) -> div_t; + pub fn exit(arg1: c_int) -> !; + pub fn free(arg1: *mut c_void); + pub fn getenv(arg1: *const c_char) -> *mut c_char; + pub fn labs(arg1: c_long) -> c_long; + pub fn ldiv(arg1: c_long, arg2: c_long) -> ldiv_t; + pub fn malloc(arg1: size_t) -> *mut c_void; + pub fn qsort( + arg1: *mut c_void, + arg2: size_t, + arg3: size_t, + arg4: ::Option c_int>, + ); + pub fn rand() -> c_int; + pub fn realloc(arg1: *mut c_void, arg2: size_t) -> *mut c_void; + pub fn srand(arg1: c_uint); + pub fn strtol(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_long; + pub fn strtoul(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulong; + pub fn mblen(arg1: *const c_char, arg2: size_t) -> c_int; + pub fn mbstowcs(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t) -> size_t; + pub fn wctomb(arg1: *mut c_char, arg2: wchar_t) -> c_int; + pub fn mbtowc(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t) -> c_int; + pub fn wcstombs(arg1: *mut c_char, arg2: *const wchar_t, arg3: size_t) -> size_t; + pub fn rand_r(arg1: *mut c_uint) -> c_int; + pub fn jrand48(arg1: *mut c_ushort) -> c_long; + pub fn lcong48(arg1: *mut c_ushort); + pub fn lrand48() -> c_long; + pub fn mrand48() -> c_long; + pub fn nrand48(arg1: *mut c_ushort) -> c_long; + pub fn seed48(arg1: *mut c_ushort) -> *mut c_ushort; + pub fn srand48(arg1: c_long); + pub fn putenv(arg1: *mut c_char) -> c_int; + pub fn a64l(arg1: *const c_char) -> c_long; + pub fn l64a(arg1: c_long) -> *mut c_char; + pub fn random() -> c_long; + pub fn setstate(arg1: *mut c_char) -> *mut c_char; + pub fn initstate(arg1: c_uint, arg2: *mut c_char, arg3: size_t) -> *mut c_char; + pub fn srandom(arg1: c_uint); + pub fn mkostemp(arg1: *mut c_char, arg2: c_int) -> c_int; + pub fn mkostemps(arg1: *mut c_char, arg2: c_int, arg3: c_int) -> c_int; + pub fn mkdtemp(arg1: *mut c_char) -> *mut c_char; + pub fn mkstemp(arg1: *mut c_char) -> c_int; + pub fn mktemp(arg1: *mut c_char) -> *mut c_char; + pub fn atoll(arg1: *const c_char) -> c_longlong; + pub fn llabs(arg1: c_longlong) -> c_longlong; + pub fn lldiv(arg1: c_longlong, arg2: c_longlong) -> lldiv_t; + pub fn strtoll(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_longlong; + pub fn strtoull(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulonglong; + pub fn aligned_alloc(arg1: size_t, arg2: size_t) -> *mut c_void; + pub fn at_quick_exit(arg1: ::Option) -> c_int; + pub fn quick_exit(arg1: c_int); + pub fn setenv(arg1: *const c_char, arg2: *const c_char, arg3: c_int) -> c_int; + pub fn unsetenv(arg1: *const c_char) -> c_int; + pub fn humanize_number( + arg1: *mut c_char, + arg2: size_t, + arg3: i64, + arg4: *const c_char, + arg5: c_int, + arg6: c_int, + ) -> c_int; + pub fn dehumanize_number(arg1: *const c_char, arg2: *mut i64) -> c_int; + pub fn getenv_r(arg1: *const c_char, arg2: *mut c_char, arg3: size_t) -> c_int; + pub fn heapsort( + arg1: *mut c_void, + arg2: size_t, + arg3: size_t, + arg4: ::Option c_int>, + ) -> c_int; + pub fn mergesort( + arg1: *mut c_void, + arg2: size_t, + arg3: size_t, + arg4: ::Option c_int>, + ) -> c_int; + pub fn radixsort( + arg1: *mut *const c_uchar, + arg2: c_int, + arg3: *const c_uchar, + arg4: c_uint, + ) -> c_int; + pub fn sradixsort( + arg1: *mut *const c_uchar, + arg2: c_int, + arg3: *const c_uchar, + arg4: c_uint, + ) -> c_int; + pub fn getprogname() -> *const c_char; + pub fn setprogname(arg1: *const c_char); + pub fn qabs(arg1: quad_t) -> quad_t; + pub fn strtoq(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> quad_t; + pub fn strtouq(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> u_quad_t; + pub fn strsuftoll( + arg1: *const c_char, + arg2: *const c_char, + arg3: c_longlong, + arg4: c_longlong, + ) -> c_longlong; + pub fn strsuftollx( + arg1: *const c_char, + arg2: *const c_char, + arg3: c_longlong, + arg4: c_longlong, + arg5: *mut c_char, + arg6: size_t, + ) -> c_longlong; + pub fn l64a_r(arg1: c_long, arg2: *mut c_char, arg3: c_int) -> c_int; + pub fn qdiv(arg1: quad_t, arg2: quad_t) -> qdiv_t; + pub fn strtol_l( + arg1: *const c_char, + arg2: *mut *mut c_char, + arg3: c_int, + arg4: locale_t, + ) -> c_long; + pub fn strtoul_l( + arg1: *const c_char, + arg2: *mut *mut c_char, + arg3: c_int, + arg4: locale_t, + ) -> c_ulong; + pub fn strtoll_l( + arg1: *const c_char, + arg2: *mut *mut c_char, + arg3: c_int, + arg4: locale_t, + ) -> c_longlong; + pub fn strtoull_l( + arg1: *const c_char, + arg2: *mut *mut c_char, + arg3: c_int, + arg4: locale_t, + ) -> c_ulonglong; + pub fn strtoq_l( + arg1: *const c_char, + arg2: *mut *mut c_char, + arg3: c_int, + arg4: locale_t, + ) -> quad_t; + pub fn strtouq_l( + arg1: *const c_char, + arg2: *mut *mut c_char, + arg3: c_int, + arg4: locale_t, + ) -> u_quad_t; + pub fn _mb_cur_max_l(arg1: locale_t) -> size_t; + pub fn mblen_l(arg1: *const c_char, arg2: size_t, arg3: locale_t) -> c_int; + pub fn mbstowcs_l( + arg1: *mut wchar_t, + arg2: *const c_char, + arg3: size_t, + arg4: locale_t, + ) -> size_t; + pub fn wctomb_l(arg1: *mut c_char, arg2: wchar_t, arg3: locale_t) -> c_int; + pub fn mbtowc_l(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t, arg4: locale_t) + -> c_int; + pub fn wcstombs_l( + arg1: *mut c_char, + arg2: *const wchar_t, + arg3: size_t, + arg4: locale_t, + ) -> size_t; + + // string.h + pub fn memchr(arg1: *const c_void, arg2: c_int, arg3: size_t) -> *mut c_void; + pub fn memcmp(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int; + pub fn memcpy(arg1: *mut c_void, arg2: *const c_void, arg3: size_t) -> *mut c_void; + pub fn memmove(arg1: *mut c_void, arg2: *const c_void, arg3: size_t) -> *mut c_void; + pub fn memset(arg1: *mut c_void, arg2: c_int, arg3: size_t) -> *mut c_void; + pub fn strcat(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char; + pub fn strchr(arg1: *const c_char, arg2: c_int) -> *mut c_char; + pub fn strcmp(arg1: *const c_char, arg2: *const c_char) -> c_int; + pub fn strcoll(arg1: *const c_char, arg2: *const c_char) -> c_int; + pub fn strcpy(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char; + pub fn strcspn(arg1: *const c_char, arg2: *const c_char) -> size_t; + pub fn strerror(arg1: c_int) -> *mut c_char; + pub fn strlen(arg1: *const c_char) -> size_t; + pub fn strncat(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char; + pub fn strncmp(arg1: *const c_char, arg2: *const c_char, arg3: size_t) -> c_int; + pub fn strncpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char; + pub fn strpbrk(arg1: *const c_char, arg2: *const c_char) -> *mut c_char; + pub fn strrchr(arg1: *const c_char, arg2: c_int) -> *mut c_char; + pub fn strspn(arg1: *const c_char, arg2: *const c_char) -> size_t; + pub fn strstr(arg1: *const c_char, arg2: *const c_char) -> *mut c_char; + pub fn strtok(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char; + pub fn strtok_r(arg1: *mut c_char, arg2: *const c_char, arg3: *mut *mut c_char) -> *mut c_char; + pub fn strerror_r(arg1: c_int, arg2: *mut c_char, arg3: size_t) -> c_int; + pub fn strxfrm(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t; + pub fn memccpy( + arg1: *mut c_void, + arg2: *const c_void, + arg3: c_int, + arg4: size_t, + ) -> *mut c_void; + pub fn strdup(arg1: *const c_char) -> *mut c_char; + pub fn stpcpy(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char; + pub fn stpncpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char; + pub fn strnlen(arg1: *const c_char, arg2: size_t) -> size_t; + pub fn memmem( + arg1: *const c_void, + arg2: size_t, + arg3: *const c_void, + arg4: size_t, + ) -> *mut c_void; + pub fn strcasestr(arg1: *const c_char, arg2: *const c_char) -> *mut c_char; + pub fn strlcat(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t; + pub fn strlcpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t; + pub fn strsep(arg1: *mut *mut c_char, arg2: *const c_char) -> *mut c_char; + pub fn stresep(arg1: *mut *mut c_char, arg2: *const c_char, arg3: c_int) -> *mut c_char; + pub fn strndup(arg1: *const c_char, arg2: size_t) -> *mut c_char; + pub fn memrchr(arg1: *const c_void, arg2: c_int, arg3: size_t) -> *mut c_void; + pub fn explicit_memset(arg1: *mut c_void, arg2: c_int, arg3: size_t) -> *mut c_void; + pub fn consttime_memequal(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int; + pub fn strcoll_l(arg1: *const c_char, arg2: *const c_char, arg3: locale_t) -> c_int; + pub fn strxfrm_l( + arg1: *mut c_char, + arg2: *const c_char, + arg3: size_t, + arg4: locale_t, + ) -> size_t; + pub fn strerror_l(arg1: c_int, arg2: locale_t) -> *mut c_char; + + // strings.h + pub fn bcmp(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int; + pub fn bcopy(arg1: *const c_void, arg2: *mut c_void, arg3: size_t); + pub fn bzero(arg1: *mut c_void, arg2: size_t); + pub fn ffs(arg1: c_int) -> c_int; + pub fn popcount(arg1: c_uint) -> c_uint; + pub fn popcountl(arg1: c_ulong) -> c_uint; + pub fn popcountll(arg1: c_ulonglong) -> c_uint; + pub fn popcount32(arg1: u32) -> c_uint; + pub fn popcount64(arg1: u64) -> c_uint; + pub fn rindex(arg1: *const c_char, arg2: c_int) -> *mut c_char; + pub fn strcasecmp(arg1: *const c_char, arg2: *const c_char) -> c_int; + pub fn strncasecmp(arg1: *const c_char, arg2: *const c_char, arg3: size_t) -> c_int; + + // signal.h + pub fn signal(arg1: c_int, arg2: sighandler_t) -> sighandler_t; + pub fn raise(arg1: c_int) -> c_int; + + // time.h + pub fn asctime(arg1: *const tm) -> *mut c_char; + pub fn clock() -> clock_t; + pub fn ctime(arg1: *const time_t) -> *mut c_char; + pub fn difftime(arg1: time_t, arg2: time_t) -> f64; + pub fn gmtime(arg1: *const time_t) -> *mut tm; + pub fn localtime(arg1: *const time_t) -> *mut tm; + pub fn time(arg1: *mut time_t) -> time_t; + pub fn mktime(arg1: *mut tm) -> time_t; + pub fn strftime( + arg1: *mut c_char, + arg2: size_t, + arg3: *const c_char, + arg4: *const tm, + ) -> size_t; + pub fn utime(arg1: *const c_char, arg2: *mut time_t) -> c_int; + pub fn asctime_r(arg1: *const tm, arg2: *mut c_char) -> *mut c_char; + pub fn ctime_r(arg1: *const time_t, arg2: *mut c_char) -> *mut c_char; + pub fn gmtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; + pub fn localtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; + + // sys/stat.h + pub fn stat(arg1: *const c_char, arg2: *mut stat) -> c_int; + pub fn lstat(arg1: *const c_char, arg2: *mut stat) -> c_int; + pub fn fstat(arg1: c_int, arg2: *mut stat) -> c_int; + pub fn chmod(arg1: *const c_char, arg2: __mode_t) -> c_int; + pub fn mkdir(arg1: *const c_char, arg2: __mode_t) -> c_int; + + // fcntl.h + pub fn open(arg1: *const c_char, arg2: c_int, ...) -> c_int; + pub fn creat(arg1: *const c_char, arg2: c_int) -> c_int; + pub fn close(arg1: c_int) -> c_int; + pub fn read(arg1: c_int, arg2: *mut c_void, arg3: c_int) -> c_int; + pub fn write(arg1: c_int, arg2: *const c_void, arg3: c_int) -> c_int; + pub fn unlink(arg1: *const c_char) -> c_int; + pub fn tell(arg1: c_int) -> c_long; + pub fn dup(arg1: c_int) -> c_int; + pub fn dup2(arg1: c_int, arg2: c_int) -> c_int; + pub fn access(arg1: *const c_char, arg2: c_int) -> c_int; + pub fn rmdir(arg1: *const c_char) -> c_int; + pub fn chdir(arg1: *const c_char) -> c_int; + pub fn _exit(arg1: c_int); + pub fn getwd(arg1: *mut c_char) -> *mut c_char; + pub fn getcwd(arg1: *mut c_char, arg2: size_t) -> *mut c_char; + pub static mut optarg: *mut c_char; + pub static mut opterr: c_int; + pub static mut optind: c_int; + pub static mut optopt: c_int; + pub static mut optreset: c_int; + pub fn getopt(arg1: c_int, arg2: *mut *mut c_char, arg3: *const c_char) -> c_int; + pub static mut suboptarg: *mut c_char; + pub fn getsubopt( + arg1: *mut *mut c_char, + arg2: *const *mut c_char, + arg3: *mut *mut c_char, + ) -> c_int; + pub fn fcntl(arg1: c_int, arg2: c_int, ...) -> c_int; + pub fn getpid() -> pid_t; + pub fn sleep(arg1: c_uint) -> c_uint; + pub fn usleep(arg1: useconds_t) -> c_int; + + // locale.h + pub fn localeconv() -> *mut lconv; + pub fn setlocale(arg1: c_int, arg2: *const c_char) -> *mut c_char; + pub fn duplocale(arg1: locale_t) -> locale_t; + pub fn freelocale(arg1: locale_t); + pub fn localeconv_l(arg1: locale_t) -> *mut lconv; + pub fn newlocale(arg1: c_int, arg2: *const c_char, arg3: locale_t) -> locale_t; + + // langinfo.h + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + pub fn nl_langinfo_l(item: ::nl_item, locale: locale_t) -> *mut ::c_char; + + // malloc.h + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + + // sys/types.h + pub fn lseek(arg1: c_int, arg2: __off_t, arg3: c_int) -> __off_t; +} + +cfg_if! { + if #[cfg(libc_core_cvoid)] { + pub use ::ffi::c_void; + } else { + // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help + // enable more optimization opportunities around it recognizing things + // like malloc/free. + #[repr(u8)] + #[allow(missing_copy_implementations)] + #[allow(missing_debug_implementations)] + pub enum c_void { + // Two dummy variants so the #[repr] attribute can be used. + #[doc(hidden)] + __variant1, + #[doc(hidden)] + __variant2, + } + } +} + +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(any(target_arch = "arm"))] { + mod arm; + pub use self::arm::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/switch.rs b/bash-5.1/vendor/libc/src/switch.rs new file mode 100644 index 0000000000000000000000000000000000000000..030ab20d7bd8e7e2b3d06f76619b57145f33e860 --- /dev/null +++ b/bash-5.1/vendor/libc/src/switch.rs @@ -0,0 +1,49 @@ +//! Switch C type definitions + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_float = f32; +pub type c_double = f64; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; + +pub type size_t = usize; +pub type ptrdiff_t = isize; +pub type intptr_t = isize; +pub type uintptr_t = usize; +pub type ssize_t = isize; + +pub type off_t = i64; +pub type c_char = u8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type wchar_t = u32; + +pub const INT_MIN: c_int = -2147483648; +pub const INT_MAX: c_int = 2147483647; + +cfg_if! { + if #[cfg(libc_core_cvoid)] { + pub use ::ffi::c_void; + } else { + // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help + // enable more optimization opportunities around it recognizing things + // like malloc/free. + #[repr(u8)] + #[allow(missing_copy_implementations)] + #[allow(missing_debug_implementations)] + pub enum c_void { + // Two dummy variants so the #[repr] attribute can be used. + #[doc(hidden)] + __variant1, + #[doc(hidden)] + __variant2, + } + } +} diff --git a/bash-5.1/vendor/libc/src/unix/align.rs b/bash-5.1/vendor/libc/src/unix/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..4fdba9a6aba6927d096c0cbc506b1f7ad94da0d0 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/align.rs @@ -0,0 +1,6 @@ +s! { + #[repr(align(4))] + pub struct in6_addr { + pub s6_addr: [u8; 16], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/b32/align.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/b32/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..ca1fe1ce299442531bef79be18ad7caada5b2503 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/b32/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 2] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/b32/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/b32/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..0f1722f975744c61df9c6efd58eef03a61a673b3 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/b32/mod.rs @@ -0,0 +1,119 @@ +//! 32-bit specific Apple (ios/darwin) definitions + +pub type c_long = i32; +pub type c_ulong = u32; +pub type boolean_t = ::c_int; + +s! { + pub struct if_data { + pub ifi_type: ::c_uchar, + pub ifi_typelen: ::c_uchar, + pub ifi_physical: ::c_uchar, + pub ifi_addrlen: ::c_uchar, + pub ifi_hdrlen: ::c_uchar, + pub ifi_recvquota: ::c_uchar, + pub ifi_xmitquota: ::c_uchar, + pub ifi_unused1: ::c_uchar, + pub ifi_mtu: u32, + pub ifi_metric: u32, + pub ifi_baudrate: u32, + pub ifi_ipackets: u32, + pub ifi_ierrors: u32, + pub ifi_opackets: u32, + pub ifi_oerrors: u32, + pub ifi_collisions: u32, + pub ifi_ibytes: u32, + pub ifi_obytes: u32, + pub ifi_imcasts: u32, + pub ifi_omcasts: u32, + pub ifi_iqdrops: u32, + pub ifi_noproto: u32, + pub ifi_recvtiming: u32, + pub ifi_xmittiming: u32, + pub ifi_lastchange: ::timeval, + pub ifi_unused2: u32, + pub ifi_hwassist: u32, + pub ifi_reserved1: u32, + pub ifi_reserved2: u32, + } + + pub struct bpf_hdr { + pub bh_tstamp: ::timeval, + pub bh_caplen: u32, + pub bh_datalen: u32, + pub bh_hdrlen: ::c_ushort, + } + + pub struct malloc_zone_t { + __private: [::uintptr_t; 18], // FIXME: keeping private for now + } +} + +s_no_extra_traits! { + pub struct pthread_attr_t { + __sig: c_long, + __opaque: [::c_char; 36] + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for pthread_attr_t { + fn eq(&self, other: &pthread_attr_t) -> bool { + self.__sig == other.__sig + && self.__opaque + .iter() + .zip(other.__opaque.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_attr_t {} + impl ::fmt::Debug for pthread_attr_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_attr_t") + .field("__sig", &self.__sig) + // FIXME: .field("__opaque", &self.__opaque) + .finish() + } + } + impl ::hash::Hash for pthread_attr_t { + fn hash(&self, state: &mut H) { + self.__sig.hash(state); + self.__opaque.hash(state); + } + } + } +} + +#[doc(hidden)] +#[deprecated(since = "0.2.55")] +pub const NET_RT_MAXID: ::c_int = 10; + +pub const __PTHREAD_MUTEX_SIZE__: usize = 40; +pub const __PTHREAD_COND_SIZE__: usize = 24; +pub const __PTHREAD_CONDATTR_SIZE__: usize = 4; +pub const __PTHREAD_RWLOCK_SIZE__: usize = 124; +pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 12; + +pub const TIOCTIMESTAMP: ::c_ulong = 0x40087459; +pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40087458; + +pub const BIOCSETF: ::c_ulong = 0x80084267; +pub const BIOCSRTIMEOUT: ::c_ulong = 0x8008426d; +pub const BIOCGRTIMEOUT: ::c_ulong = 0x4008426e; +pub const BIOCSETFNR: ::c_ulong = 0x8008427e; + +extern "C" { + pub fn exchangedata( + path1: *const ::c_char, + path2: *const ::c_char, + options: ::c_ulong, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..29db97ec7c473780180da5b7296ee8f605e4cb7b --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/aarch64/align.rs @@ -0,0 +1,56 @@ +pub type mcontext_t = *mut __darwin_mcontext64; + +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + pub struct max_align_t { + priv_: f64 + } +} + +s! { + pub struct ucontext_t { + pub uc_onstack: ::c_int, + pub uc_sigmask: ::sigset_t, + pub uc_stack: ::stack_t, + pub uc_link: *mut ::ucontext_t, + pub uc_mcsize: usize, + pub uc_mcontext: mcontext_t, + __mcontext_data: __darwin_mcontext64, + } + + pub struct __darwin_mcontext64 { + pub __es: __darwin_arm_exception_state64, + pub __ss: __darwin_arm_thread_state64, + pub __ns: __darwin_arm_neon_state64, + } + + pub struct __darwin_arm_exception_state64 { + pub __far: u64, + pub __esr: u32, + pub __exception: u32, + } + + pub struct __darwin_arm_thread_state64 { + pub __x: [u64; 29], + pub __fp: u64, + pub __lr: u64, + pub __sp: u64, + pub __pc: u64, + pub __cpsr: u32, + pub __pad: u32, + } + + // This type natively uses a uint128, but for a while we hacked + // it in with repr(align) and `[u64; 2]`. uint128 isn't available + // all the way back to our earliest supported versions so we + // preserver the old shim. + #[cfg_attr(not(libc_int128), repr(align(16)))] + pub struct __darwin_arm_neon_state64 { + #[cfg(libc_int128)] + pub __v: [::__uint128_t; 32], + #[cfg(not(libc_int128))] + pub __v: [[u64; 2]; 32], + pub __fpsr: u32, + pub __fpcr: u32, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..67f0f7032e9c029f744a4b512e8e34e0c66fd349 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/aarch64/mod.rs @@ -0,0 +1,16 @@ +pub type boolean_t = ::c_int; + +s! { + pub struct malloc_zone_t { + __private: [::uintptr_t; 18], // FIXME: needs arm64 auth pointers support + } +} + +pub const CLOCK_UPTIME_RAW: ::clockid_t = 8; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/align.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..ca1fe1ce299442531bef79be18ad7caada5b2503 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 2] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..48d94bcd6bfdca6ffe7d78b8bc852df4b6b69b1c --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/mod.rs @@ -0,0 +1,124 @@ +//! 64-bit specific Apple (ios/darwin) definitions + +pub type c_long = i64; +pub type c_ulong = u64; + +s! { + pub struct timeval32 { + pub tv_sec: i32, + pub tv_usec: i32, + } + + pub struct if_data { + pub ifi_type: ::c_uchar, + pub ifi_typelen: ::c_uchar, + pub ifi_physical: ::c_uchar, + pub ifi_addrlen: ::c_uchar, + pub ifi_hdrlen: ::c_uchar, + pub ifi_recvquota: ::c_uchar, + pub ifi_xmitquota: ::c_uchar, + pub ifi_unused1: ::c_uchar, + pub ifi_mtu: u32, + pub ifi_metric: u32, + pub ifi_baudrate: u32, + pub ifi_ipackets: u32, + pub ifi_ierrors: u32, + pub ifi_opackets: u32, + pub ifi_oerrors: u32, + pub ifi_collisions: u32, + pub ifi_ibytes: u32, + pub ifi_obytes: u32, + pub ifi_imcasts: u32, + pub ifi_omcasts: u32, + pub ifi_iqdrops: u32, + pub ifi_noproto: u32, + pub ifi_recvtiming: u32, + pub ifi_xmittiming: u32, + pub ifi_lastchange: timeval32, + pub ifi_unused2: u32, + pub ifi_hwassist: u32, + pub ifi_reserved1: u32, + pub ifi_reserved2: u32, + } + + pub struct bpf_hdr { + pub bh_tstamp: ::timeval32, + pub bh_caplen: u32, + pub bh_datalen: u32, + pub bh_hdrlen: ::c_ushort, + } +} + +s_no_extra_traits! { + pub struct pthread_attr_t { + __sig: c_long, + __opaque: [::c_char; 56] + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for pthread_attr_t { + fn eq(&self, other: &pthread_attr_t) -> bool { + self.__sig == other.__sig + && self.__opaque + .iter() + .zip(other.__opaque.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_attr_t {} + impl ::fmt::Debug for pthread_attr_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_attr_t") + .field("__sig", &self.__sig) + // FIXME: .field("__opaque", &self.__opaque) + .finish() + } + } + impl ::hash::Hash for pthread_attr_t { + fn hash(&self, state: &mut H) { + self.__sig.hash(state); + self.__opaque.hash(state); + } + } + } +} + +#[doc(hidden)] +#[deprecated(since = "0.2.55")] +pub const NET_RT_MAXID: ::c_int = 11; + +pub const __PTHREAD_MUTEX_SIZE__: usize = 56; +pub const __PTHREAD_COND_SIZE__: usize = 40; +pub const __PTHREAD_CONDATTR_SIZE__: usize = 8; +pub const __PTHREAD_RWLOCK_SIZE__: usize = 192; +pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 16; + +pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459; +pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458; + +pub const BIOCSETF: ::c_ulong = 0x80104267; +pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d; +pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e; +pub const BIOCSETFNR: ::c_ulong = 0x8010427e; + +extern "C" { + pub fn exchangedata( + path1: *const ::c_char, + path2: *const ::c_char, + options: ::c_uint, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..ca1fe1ce299442531bef79be18ad7caada5b2503 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/x86_64/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 2] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..653650c26289f9298c7102be41e8b6210426e24b --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/b64/x86_64/mod.rs @@ -0,0 +1,180 @@ +pub type boolean_t = ::c_uint; +pub type mcontext_t = *mut __darwin_mcontext64; + +s! { + pub struct ucontext_t { + pub uc_onstack: ::c_int, + pub uc_sigmask: ::sigset_t, + pub uc_stack: ::stack_t, + pub uc_link: *mut ::ucontext_t, + pub uc_mcsize: usize, + pub uc_mcontext: mcontext_t, + } + + pub struct __darwin_mcontext64 { + pub __es: __darwin_x86_exception_state64, + pub __ss: __darwin_x86_thread_state64, + pub __fs: __darwin_x86_float_state64, + } + + pub struct __darwin_x86_exception_state64 { + pub __trapno: u16, + pub __cpu: u16, + pub __err: u32, + pub __faultvaddr: u64, + } + + pub struct __darwin_x86_thread_state64 { + pub __rax: u64, + pub __rbx: u64, + pub __rcx: u64, + pub __rdx: u64, + pub __rdi: u64, + pub __rsi: u64, + pub __rbp: u64, + pub __rsp: u64, + pub __r8: u64, + pub __r9: u64, + pub __r10: u64, + pub __r11: u64, + pub __r12: u64, + pub __r13: u64, + pub __r14: u64, + pub __r15: u64, + pub __rip: u64, + pub __rflags: u64, + pub __cs: u64, + pub __fs: u64, + pub __gs: u64, + } + + pub struct __darwin_x86_float_state64 { + pub __fpu_reserved: [::c_int; 2], + __fpu_fcw: ::c_short, + __fpu_fsw: ::c_short, + pub __fpu_ftw: u8, + pub __fpu_rsrv1: u8, + pub __fpu_fop: u16, + pub __fpu_ip: u32, + pub __fpu_cs: u16, + pub __fpu_rsrv2: u16, + pub __fpu_dp: u32, + pub __fpu_ds: u16, + pub __fpu_rsrv3: u16, + pub __fpu_mxcsr: u32, + pub __fpu_mxcsrmask: u32, + pub __fpu_stmm0: __darwin_mmst_reg, + pub __fpu_stmm1: __darwin_mmst_reg, + pub __fpu_stmm2: __darwin_mmst_reg, + pub __fpu_stmm3: __darwin_mmst_reg, + pub __fpu_stmm4: __darwin_mmst_reg, + pub __fpu_stmm5: __darwin_mmst_reg, + pub __fpu_stmm6: __darwin_mmst_reg, + pub __fpu_stmm7: __darwin_mmst_reg, + pub __fpu_xmm0: __darwin_xmm_reg, + pub __fpu_xmm1: __darwin_xmm_reg, + pub __fpu_xmm2: __darwin_xmm_reg, + pub __fpu_xmm3: __darwin_xmm_reg, + pub __fpu_xmm4: __darwin_xmm_reg, + pub __fpu_xmm5: __darwin_xmm_reg, + pub __fpu_xmm6: __darwin_xmm_reg, + pub __fpu_xmm7: __darwin_xmm_reg, + pub __fpu_xmm8: __darwin_xmm_reg, + pub __fpu_xmm9: __darwin_xmm_reg, + pub __fpu_xmm10: __darwin_xmm_reg, + pub __fpu_xmm11: __darwin_xmm_reg, + pub __fpu_xmm12: __darwin_xmm_reg, + pub __fpu_xmm13: __darwin_xmm_reg, + pub __fpu_xmm14: __darwin_xmm_reg, + pub __fpu_xmm15: __darwin_xmm_reg, + // this field is actually [u8; 96], but defining it with a bigger type + // allows us to auto-implement traits for it since the length of the + // array is less than 32 + __fpu_rsrv4: [u32; 24], + pub __fpu_reserved1: ::c_int, + } + + pub struct __darwin_mmst_reg { + pub __mmst_reg: [::c_char; 10], + pub __mmst_rsrv: [::c_char; 6], + } + + pub struct __darwin_xmm_reg { + pub __xmm_reg: [::c_char; 16], + } + + pub struct malloc_introspection_t { + _private: [::uintptr_t; 16], // FIXME: keeping private for now + } + + pub struct malloc_zone_t { + _reserved1: *mut ::c_void, + _reserved2: *mut ::c_void, + pub size: ::Option ::size_t>, + pub malloc: ::Option *mut ::c_void>, + pub calloc: ::Option *mut ::c_void>, + pub valloc: ::Option *mut ::c_void>, + pub free: ::Option, + pub realloc: ::Option *mut ::c_void>, + pub destroy: ::Option, + pub zone_name: *const ::c_char, + pub batch_malloc: ::Option ::c_uint>, + pub batch_free: ::Option, + pub introspect: *mut malloc_introspection_t, + pub version: ::c_uint, + pub memalign: ::Option *mut ::c_void>, + pub free_definite_size: ::Option, + pub pressure_relief: ::Option ::size_t>, + pub claimed_address: ::Option ::boolean_t>, + } +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/apple/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/apple/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..a831ca850f4beed42e0c157dc8a305bb33783191 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/apple/mod.rs @@ -0,0 +1,5593 @@ +//! Apple (ios/darwin)-specific definitions +//! +//! This covers *-apple-* triples currently +pub type c_char = i8; +pub type wchar_t = i32; +pub type clock_t = c_ulong; +pub type time_t = c_long; +pub type suseconds_t = i32; +pub type dev_t = i32; +pub type ino_t = u64; +pub type mode_t = u16; +pub type nlink_t = u16; +pub type blksize_t = i32; +pub type rlim_t = u64; +pub type pthread_key_t = c_ulong; +pub type sigset_t = u32; +pub type clockid_t = ::c_uint; +pub type fsblkcnt_t = ::c_uint; +pub type fsfilcnt_t = ::c_uint; +pub type speed_t = ::c_ulong; +pub type tcflag_t = ::c_ulong; +pub type nl_item = ::c_int; +pub type id_t = ::c_uint; +pub type sem_t = ::c_int; +pub type idtype_t = ::c_uint; +pub type integer_t = ::c_int; +pub type cpu_type_t = integer_t; +pub type cpu_subtype_t = integer_t; +pub type natural_t = u32; +pub type mach_msg_type_number_t = natural_t; +pub type kern_return_t = ::c_int; +pub type uuid_t = [u8; 16]; +pub type task_info_t = *mut integer_t; +pub type host_info_t = *mut integer_t; +pub type task_flavor_t = natural_t; +pub type rusage_info_t = *mut ::c_void; +pub type vm_offset_t = ::uintptr_t; +pub type vm_size_t = ::uintptr_t; +pub type vm_address_t = vm_offset_t; + +pub type posix_spawnattr_t = *mut ::c_void; +pub type posix_spawn_file_actions_t = *mut ::c_void; +pub type key_t = ::c_int; +pub type shmatt_t = ::c_ushort; + +pub type sae_associd_t = u32; +pub type sae_connid_t = u32; + +pub type mach_port_t = ::c_uint; +pub type host_t = ::c_uint; +pub type host_flavor_t = integer_t; +pub type host_info64_t = *mut integer_t; +pub type processor_flavor_t = ::c_int; +pub type thread_flavor_t = natural_t; +pub type thread_inspect_t = ::mach_port_t; +pub type thread_act_t = ::mach_port_t; +pub type thread_act_array_t = *mut ::thread_act_t; +pub type policy_t = ::c_int; +pub type mach_vm_address_t = u64; +pub type mach_vm_offset_t = u64; +pub type mach_vm_size_t = u64; +pub type vm_map_t = ::mach_port_t; +pub type mem_entry_name_port_t = ::mach_port_t; +pub type memory_object_t = ::mach_port_t; +pub type memory_object_offset_t = ::c_ulonglong; +pub type vm_inherit_t = ::c_uint; +pub type vm_prot_t = ::c_int; + +pub type ledger_t = ::mach_port_t; +pub type ledger_array_t = *mut ::ledger_t; + +pub type iconv_t = *mut ::c_void; + +pub type processor_cpu_load_info_t = *mut processor_cpu_load_info; +pub type processor_cpu_load_info_data_t = processor_cpu_load_info; +pub type processor_basic_info_t = *mut processor_basic_info; +pub type processor_basic_info_data_t = processor_basic_info; +pub type processor_set_basic_info_data_t = processor_set_basic_info; +pub type processor_set_basic_info_t = *mut processor_set_basic_info; +pub type processor_set_load_info_data_t = processor_set_load_info; +pub type processor_set_load_info_t = *mut processor_set_load_info; +pub type processor_info_t = *mut integer_t; +pub type processor_info_array_t = *mut integer_t; + +pub type mach_task_basic_info_data_t = mach_task_basic_info; +pub type mach_task_basic_info_t = *mut mach_task_basic_info; +pub type task_thread_times_info_data_t = task_thread_times_info; +pub type task_thread_times_info_t = *mut task_thread_times_info; + +pub type thread_info_t = *mut integer_t; +pub type thread_basic_info_t = *mut thread_basic_info; +pub type thread_basic_info_data_t = thread_basic_info; +pub type thread_identifier_info_t = *mut thread_identifier_info; +pub type thread_identifier_info_data_t = thread_identifier_info; +pub type thread_extended_info_t = *mut thread_extended_info; +pub type thread_extended_info_data_t = thread_extended_info; + +pub type thread_t = ::mach_port_t; +pub type thread_policy_flavor_t = natural_t; +pub type thread_policy_t = *mut integer_t; +pub type thread_latency_qos_t = integer_t; +pub type thread_throughput_qos_t = integer_t; +pub type thread_standard_policy_data_t = thread_standard_policy; +pub type thread_standard_policy_t = *mut thread_standard_policy; +pub type thread_extended_policy_data_t = thread_extended_policy; +pub type thread_extended_policy_t = *mut thread_extended_policy; +pub type thread_time_constraint_policy_data_t = thread_time_constraint_policy; +pub type thread_time_constraint_policy_t = *mut thread_time_constraint_policy; +pub type thread_precedence_policy_data_t = thread_precedence_policy; +pub type thread_precedence_policy_t = *mut thread_precedence_policy; +pub type thread_affinity_policy_data_t = thread_affinity_policy; +pub type thread_affinity_policy_t = *mut thread_affinity_policy; +pub type thread_background_policy_data_t = thread_background_policy; +pub type thread_background_policy_t = *mut thread_background_policy; +pub type thread_latency_qos_policy_data_t = thread_latency_qos_policy; +pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy; +pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy; +pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy; + +pub type pthread_introspection_hook_t = + extern "C" fn(event: ::c_uint, thread: ::pthread_t, addr: *mut ::c_void, size: ::size_t); + +pub type vm_statistics_t = *mut vm_statistics; +pub type vm_statistics_data_t = vm_statistics; +pub type vm_statistics64_t = *mut vm_statistics64; +pub type vm_statistics64_data_t = vm_statistics64; + +pub type task_t = ::mach_port_t; +pub type task_inspect_t = ::mach_port_t; + +pub type sysdir_search_path_enumeration_state = ::c_uint; + +pub type CCStatus = i32; +pub type CCCryptorStatus = i32; +pub type CCRNGStatus = ::CCCryptorStatus; + +pub type copyfile_state_t = *mut ::c_void; +pub type copyfile_flags_t = u32; + +deprecated_mach! { + pub type mach_timebase_info_data_t = mach_timebase_info; +} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +#[repr(u32)] +pub enum qos_class_t { + QOS_CLASS_USER_INTERACTIVE = 0x21, + QOS_CLASS_USER_INITIATED = 0x19, + QOS_CLASS_DEFAULT = 0x15, + QOS_CLASS_UTILITY = 0x11, + QOS_CLASS_BACKGROUND = 0x09, + QOS_CLASS_UNSPECIFIED = 0x00, +} +impl ::Copy for qos_class_t {} +impl ::Clone for qos_class_t { + fn clone(&self) -> qos_class_t { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +#[repr(u32)] +pub enum sysdir_search_path_directory_t { + SYSDIR_DIRECTORY_APPLICATION = 1, + SYSDIR_DIRECTORY_DEMO_APPLICATION = 2, + SYSDIR_DIRECTORY_DEVELOPER_APPLICATION = 3, + SYSDIR_DIRECTORY_ADMIN_APPLICATION = 4, + SYSDIR_DIRECTORY_LIBRARY = 5, + SYSDIR_DIRECTORY_DEVELOPER = 6, + SYSDIR_DIRECTORY_USER = 7, + SYSDIR_DIRECTORY_DOCUMENTATION = 8, + SYSDIR_DIRECTORY_DOCUMENT = 9, + SYSDIR_DIRECTORY_CORESERVICE = 10, + SYSDIR_DIRECTORY_AUTOSAVED_INFORMATION = 11, + SYSDIR_DIRECTORY_DESKTOP = 12, + SYSDIR_DIRECTORY_CACHES = 13, + SYSDIR_DIRECTORY_APPLICATION_SUPPORT = 14, + SYSDIR_DIRECTORY_DOWNLOADS = 15, + SYSDIR_DIRECTORY_INPUT_METHODS = 16, + SYSDIR_DIRECTORY_MOVIES = 17, + SYSDIR_DIRECTORY_MUSIC = 18, + SYSDIR_DIRECTORY_PICTURES = 19, + SYSDIR_DIRECTORY_PRINTER_DESCRIPTION = 20, + SYSDIR_DIRECTORY_SHARED_PUBLIC = 21, + SYSDIR_DIRECTORY_PREFERENCE_PANES = 22, + SYSDIR_DIRECTORY_ALL_APPLICATIONS = 100, + SYSDIR_DIRECTORY_ALL_LIBRARIES = 101, +} +impl ::Copy for sysdir_search_path_directory_t {} +impl ::Clone for sysdir_search_path_directory_t { + fn clone(&self) -> sysdir_search_path_directory_t { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +#[repr(u32)] +pub enum sysdir_search_path_domain_mask_t { + SYSDIR_DOMAIN_MASK_USER = (1 << 0), + SYSDIR_DOMAIN_MASK_LOCAL = (1 << 1), + SYSDIR_DOMAIN_MASK_NETWORK = (1 << 2), + SYSDIR_DOMAIN_MASK_SYSTEM = (1 << 3), + SYSDIR_DOMAIN_MASK_ALL = 0x0ffff, +} +impl ::Copy for sysdir_search_path_domain_mask_t {} +impl ::Clone for sysdir_search_path_domain_mask_t { + fn clone(&self) -> sysdir_search_path_domain_mask_t { + *self + } +} + +s! { + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct ip_mreqn { + pub imr_multiaddr: in_addr, + pub imr_address: in_addr, + pub imr_ifindex: ::c_int, + } + + pub struct ip_mreq_source { + pub imr_multiaddr: in_addr, + pub imr_sourceaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct aiocb { + pub aio_fildes: ::c_int, + pub aio_offset: ::off_t, + pub aio_buf: *mut ::c_void, + pub aio_nbytes: ::size_t, + pub aio_reqprio: ::c_int, + pub aio_sigevent: sigevent, + pub aio_lio_opcode: ::c_int + } + + pub struct glob_t { + pub gl_pathc: ::size_t, + __unused1: ::c_int, + pub gl_offs: ::size_t, + __unused2: ::c_int, + pub gl_pathv: *mut *mut ::c_char, + + __unused3: *mut ::c_void, + + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + __unused6: *mut ::c_void, + __unused7: *mut ::c_void, + __unused8: *mut ::c_void, + } + + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + pub ai_addrlen: ::socklen_t, + pub ai_canonname: *mut ::c_char, + pub ai_addr: *mut ::sockaddr, + pub ai_next: *mut addrinfo, + } + + #[deprecated( + since = "0.2.55", + note = "Use the `mach2` crate instead", + )] + pub struct mach_timebase_info { + pub numer: u32, + pub denom: u32, + } + + pub struct stat { + pub st_dev: dev_t, + pub st_mode: mode_t, + pub st_nlink: nlink_t, + pub st_ino: ino_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: dev_t, + pub st_atime: time_t, + pub st_atime_nsec: c_long, + pub st_mtime: time_t, + pub st_mtime_nsec: c_long, + pub st_ctime: time_t, + pub st_ctime_nsec: c_long, + pub st_birthtime: time_t, + pub st_birthtime_nsec: c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: blksize_t, + pub st_flags: u32, + pub st_gen: u32, + pub st_lspare: i32, + pub st_qspare: [i64; 2], + } + + pub struct pthread_mutexattr_t { + __sig: ::c_long, + __opaque: [u8; 8], + } + + pub struct pthread_condattr_t { + __sig: ::c_long, + __opaque: [u8; __PTHREAD_CONDATTR_SIZE__], + } + + pub struct pthread_rwlockattr_t { + __sig: ::c_long, + __opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub si_pid: ::pid_t, + pub si_uid: ::uid_t, + pub si_status: ::c_int, + pub si_addr: *mut ::c_void, + //Requires it to be union for tests + //pub si_value: ::sigval, + _pad: [usize; 9], + } + + pub struct sigaction { + // FIXME: this field is actually a union + pub sa_sigaction: ::sighandler_t, + pub sa_mask: sigset_t, + pub sa_flags: ::c_int, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct fstore_t { + pub fst_flags: ::c_uint, + pub fst_posmode: ::c_int, + pub fst_offset: ::off_t, + pub fst_length: ::off_t, + pub fst_bytesalloc: ::off_t, + } + + pub struct radvisory { + pub ra_offset: ::off_t, + pub ra_count: ::c_int, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + } + + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *mut ::c_void, + } + + pub struct sockaddr_in { + pub sin_len: u8, + pub sin_family: ::sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [::c_char; 8], + } + + pub struct kevent64_s { + pub ident: u64, + pub filter: i16, + pub flags: u16, + pub fflags: u32, + pub data: i64, + pub udata: u64, + pub ext: [u64; 2], + } + + pub struct dqblk { + pub dqb_bhardlimit: u64, + pub dqb_bsoftlimit: u64, + pub dqb_curbytes: u64, + pub dqb_ihardlimit: u32, + pub dqb_isoftlimit: u32, + pub dqb_curinodes: u32, + pub dqb_btime: u32, + pub dqb_itime: u32, + pub dqb_id: u32, + pub dqb_spare: [u32; 4], + } + + pub struct if_msghdr { + pub ifm_msglen: ::c_ushort, + pub ifm_version: ::c_uchar, + pub ifm_type: ::c_uchar, + pub ifm_addrs: ::c_int, + pub ifm_flags: ::c_int, + pub ifm_index: ::c_ushort, + pub ifm_data: if_data, + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_cc: [::cc_t; ::NCCS], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } + + pub struct flock { + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + pub l_type: ::c_short, + pub l_whence: ::c_short, + } + + pub struct sf_hdtr { + pub headers: *mut ::iovec, + pub hdr_cnt: ::c_int, + pub trailers: *mut ::iovec, + pub trl_cnt: ::c_int, + } + + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } + + pub struct proc_taskinfo { + pub pti_virtual_size: u64, + pub pti_resident_size: u64, + pub pti_total_user: u64, + pub pti_total_system: u64, + pub pti_threads_user: u64, + pub pti_threads_system: u64, + pub pti_policy: i32, + pub pti_faults: i32, + pub pti_pageins: i32, + pub pti_cow_faults: i32, + pub pti_messages_sent: i32, + pub pti_messages_received: i32, + pub pti_syscalls_mach: i32, + pub pti_syscalls_unix: i32, + pub pti_csw: i32, + pub pti_threadnum: i32, + pub pti_numrunning: i32, + pub pti_priority: i32, + } + + pub struct proc_bsdinfo { + pub pbi_flags: u32, + pub pbi_status: u32, + pub pbi_xstatus: u32, + pub pbi_pid: u32, + pub pbi_ppid: u32, + pub pbi_uid: ::uid_t, + pub pbi_gid: ::gid_t, + pub pbi_ruid: ::uid_t, + pub pbi_rgid: ::gid_t, + pub pbi_svuid: ::uid_t, + pub pbi_svgid: ::gid_t, + pub rfu_1: u32, + pub pbi_comm: [::c_char; MAXCOMLEN], + pub pbi_name: [::c_char; 32], // MAXCOMLEN * 2, but macro isn't happy... + pub pbi_nfiles: u32, + pub pbi_pgid: u32, + pub pbi_pjobc: u32, + pub e_tdev: u32, + pub e_tpgid: u32, + pub pbi_nice: i32, + pub pbi_start_tvsec: u64, + pub pbi_start_tvusec: u64, + } + + pub struct proc_taskallinfo { + pub pbsd: proc_bsdinfo, + pub ptinfo: proc_taskinfo, + } + + pub struct xsw_usage { + pub xsu_total: u64, + pub xsu_avail: u64, + pub xsu_used: u64, + pub xsu_pagesize: u32, + pub xsu_encrypted: ::boolean_t, + } + + pub struct xucred { + pub cr_version: ::c_uint, + pub cr_uid: ::uid_t, + pub cr_ngroups: ::c_short, + pub cr_groups: [::gid_t;16] + } + + #[deprecated( + since = "0.2.55", + note = "Use the `mach2` crate instead", + )] + pub struct mach_header { + pub magic: u32, + pub cputype: cpu_type_t, + pub cpusubtype: cpu_subtype_t, + pub filetype: u32, + pub ncmds: u32, + pub sizeofcmds: u32, + pub flags: u32, + } + + #[deprecated( + since = "0.2.55", + note = "Use the `mach2` crate instead", + )] + pub struct mach_header_64 { + pub magic: u32, + pub cputype: cpu_type_t, + pub cpusubtype: cpu_subtype_t, + pub filetype: u32, + pub ncmds: u32, + pub sizeofcmds: u32, + pub flags: u32, + pub reserved: u32, + } + + pub struct segment_command { + pub cmd: u32, + pub cmdsize: u32, + pub segname: [::c_char; 16], + pub vmaddr: u32, + pub vmsize: u32, + pub fileoff: u32, + pub filesize: u32, + pub maxprot: vm_prot_t, + pub initprot: vm_prot_t, + pub nsects: u32, + pub flags: u32, + } + + pub struct segment_command_64 { + pub cmd: u32, + pub cmdsize: u32, + pub segname: [::c_char; 16], + pub vmaddr: u64, + pub vmsize: u64, + pub fileoff: u64, + pub filesize: u64, + pub maxprot: vm_prot_t, + pub initprot: vm_prot_t, + pub nsects: u32, + pub flags: u32, + } + + pub struct load_command { + pub cmd: u32, + pub cmdsize: u32, + } + + pub struct sockaddr_dl { + pub sdl_len: ::c_uchar, + pub sdl_family: ::c_uchar, + pub sdl_index: ::c_ushort, + pub sdl_type: ::c_uchar, + pub sdl_nlen: ::c_uchar, + pub sdl_alen: ::c_uchar, + pub sdl_slen: ::c_uchar, + pub sdl_data: [::c_char; 12], + } + + pub struct sockaddr_inarp { + pub sin_len: ::c_uchar, + pub sin_family: ::c_uchar, + pub sin_port: ::c_ushort, + pub sin_addr: ::in_addr, + pub sin_srcaddr: ::in_addr, + pub sin_tos: ::c_ushort, + pub sin_other: ::c_ushort, + } + + pub struct sockaddr_ctl { + pub sc_len: ::c_uchar, + pub sc_family: ::c_uchar, + pub ss_sysaddr: u16, + pub sc_id: u32, + pub sc_unit: u32, + pub sc_reserved: [u32; 5], + } + + pub struct in_pktinfo { + pub ipi_ifindex: ::c_uint, + pub ipi_spec_dst: ::in_addr, + pub ipi_addr: ::in_addr, + } + + pub struct in6_pktinfo { + pub ipi6_addr: ::in6_addr, + pub ipi6_ifindex: ::c_uint, + } + + // sys/ipc.h: + + pub struct ipc_perm { + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub _seq: ::c_ushort, + pub _key: ::key_t, + } + + // sys/sem.h + + pub struct sembuf { + pub sem_num: ::c_ushort, + pub sem_op: ::c_short, + pub sem_flg: ::c_short, + } + + // sys/shm.h + + pub struct arphdr { + pub ar_hrd: u16, + pub ar_pro: u16, + pub ar_hln: u8, + pub ar_pln: u8, + pub ar_op: u16, + } + + pub struct in_addr { + pub s_addr: ::in_addr_t, + } + + // net/ndrv.h + pub struct sockaddr_ndrv { + pub snd_len: ::c_uchar, + pub snd_family: ::c_uchar, + pub snd_name: [::c_uchar; 16] // IFNAMSIZ from if.h + } + + // sys/socket.h + + pub struct sa_endpoints_t { + pub sae_srcif: ::c_uint, // optional source interface + pub sae_srcaddr: *const ::sockaddr, // optional source address + pub sae_srcaddrlen: ::socklen_t, // size of source address + pub sae_dstaddr: *const ::sockaddr, // destination address + pub sae_dstaddrlen: ::socklen_t, // size of destination address + } + + pub struct timex { + pub modes: ::c_uint, + pub offset: ::c_long, + pub freq: ::c_long, + pub maxerror: ::c_long, + pub esterror: ::c_long, + pub status: ::c_int, + pub constant: ::c_long, + pub precision: ::c_long, + pub tolerance: ::c_long, + pub ppsfreq: ::c_long, + pub jitter: ::c_long, + pub shift: ::c_int, + pub stabil: ::c_long, + pub jitcnt: ::c_long, + pub calcnt: ::c_long, + pub errcnt: ::c_long, + pub stbcnt: ::c_long, + } + + pub struct ntptimeval { + pub time: ::timespec, + pub maxerror: ::c_long, + pub esterror: ::c_long, + pub tai: ::c_long, + pub time_state: ::c_int, + } + + pub struct thread_standard_policy { + pub no_data: natural_t, + } + + pub struct thread_extended_policy { + pub timeshare: boolean_t, + } + + pub struct thread_time_constraint_policy { + pub period: u32, + pub computation: u32, + pub constraint: u32, + pub preemptible: boolean_t, + } + + pub struct thread_precedence_policy { + pub importance: integer_t, + } + + pub struct thread_affinity_policy { + pub affinity_tag: integer_t, + } + + pub struct thread_background_policy { + pub priority: integer_t, + } + + pub struct thread_latency_qos_policy { + pub thread_latency_qos_tier: thread_latency_qos_t, + } + + pub struct thread_throughput_qos_policy { + pub thread_throughput_qos_tier: thread_throughput_qos_t, + } + + // malloc/malloc.h + pub struct malloc_statistics_t { + pub blocks_in_use: ::c_uint, + pub size_in_use: ::size_t, + pub max_size_in_use: ::size_t, + pub size_allocated: ::size_t, + } + + pub struct mstats { + pub bytes_total: ::size_t, + pub chunks_used: ::size_t, + pub bytes_used: ::size_t, + pub chunks_free: ::size_t, + pub bytes_free: ::size_t, + } + + pub struct vm_range_t { + pub address: ::vm_address_t, + pub size: ::vm_size_t, + } + + // sched.h + pub struct sched_param { + pub sched_priority: ::c_int, + __opaque: [::c_char; 4], + } + + pub struct vinfo_stat { + pub vst_dev: u32, + pub vst_mode: u16, + pub vst_nlink: u16, + pub vst_ino: u64, + pub vst_uid: ::uid_t, + pub vst_gid: ::gid_t, + pub vst_atime: i64, + pub vst_atimensec: i64, + pub vst_mtime: i64, + pub vst_mtimensec: i64, + pub vst_ctime: i64, + pub vst_ctimensec: i64, + pub vst_birthtime: i64, + pub vst_birthtimensec: i64, + pub vst_size: ::off_t, + pub vst_blocks: i64, + pub vst_blksize: i32, + pub vst_flags: u32, + pub vst_gen: u32, + pub vst_rdev: u32, + pub vst_qspare: [i64; 2], + } + + pub struct vnode_info { + pub vi_stat: vinfo_stat, + pub vi_type: ::c_int, + pub vi_pad: ::c_int, + pub vi_fsid: ::fsid_t, + } + + pub struct vnode_info_path { + pub vip_vi: vnode_info, + // Normally it's `vip_path: [::c_char; MAXPATHLEN]` but because libc supports an old rustc + // version, we go around this limitation like this. + pub vip_path: [[::c_char; 32]; 32], + } + + pub struct proc_vnodepathinfo { + pub pvi_cdir: vnode_info_path, + pub pvi_rdir: vnode_info_path, + } + + pub struct vm_statistics { + pub free_count: natural_t, + pub active_count: natural_t, + pub inactive_count: natural_t, + pub wire_count: natural_t, + pub zero_fill_count: natural_t, + pub reactivations: natural_t, + pub pageins: natural_t, + pub pageouts: natural_t, + pub faults: natural_t, + pub cow_faults: natural_t, + pub lookups: natural_t, + pub hits: natural_t, + pub purgeable_count: natural_t, + pub purges: natural_t, + pub speculative_count: natural_t, + } + + pub struct task_thread_times_info { + pub user_time: time_value_t, + pub system_time: time_value_t, + } + + pub struct rusage_info_v0 { + pub ri_uuid: [u8; 16], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, + } + + pub struct rusage_info_v1 { + pub ri_uuid: [u8; 16], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, + pub ri_child_user_time: u64, + pub ri_child_system_time: u64, + pub ri_child_pkg_idle_wkups: u64, + pub ri_child_interrupt_wkups: u64, + pub ri_child_pageins: u64, + pub ri_child_elapsed_abstime: u64, + } + + pub struct rusage_info_v2 { + pub ri_uuid: [u8; 16], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, + pub ri_child_user_time: u64, + pub ri_child_system_time: u64, + pub ri_child_pkg_idle_wkups: u64, + pub ri_child_interrupt_wkups: u64, + pub ri_child_pageins: u64, + pub ri_child_elapsed_abstime: u64, + pub ri_diskio_bytesread: u64, + pub ri_diskio_byteswritten: u64, + } + + pub struct rusage_info_v3 { + pub ri_uuid: [u8; 16], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, + pub ri_child_user_time: u64, + pub ri_child_system_time: u64, + pub ri_child_pkg_idle_wkups: u64, + pub ri_child_interrupt_wkups: u64, + pub ri_child_pageins: u64, + pub ri_child_elapsed_abstime: u64, + pub ri_diskio_bytesread: u64, + pub ri_diskio_byteswritten: u64, + pub ri_cpu_time_qos_default: u64, + pub ri_cpu_time_qos_maintenance: u64, + pub ri_cpu_time_qos_background: u64, + pub ri_cpu_time_qos_utility: u64, + pub ri_cpu_time_qos_legacy: u64, + pub ri_cpu_time_qos_user_initiated: u64, + pub ri_cpu_time_qos_user_interactive: u64, + pub ri_billed_system_time: u64, + pub ri_serviced_system_time: u64, + } + + pub struct rusage_info_v4 { + pub ri_uuid: [u8; 16], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, + pub ri_child_user_time: u64, + pub ri_child_system_time: u64, + pub ri_child_pkg_idle_wkups: u64, + pub ri_child_interrupt_wkups: u64, + pub ri_child_pageins: u64, + pub ri_child_elapsed_abstime: u64, + pub ri_diskio_bytesread: u64, + pub ri_diskio_byteswritten: u64, + pub ri_cpu_time_qos_default: u64, + pub ri_cpu_time_qos_maintenance: u64, + pub ri_cpu_time_qos_background: u64, + pub ri_cpu_time_qos_utility: u64, + pub ri_cpu_time_qos_legacy: u64, + pub ri_cpu_time_qos_user_initiated: u64, + pub ri_cpu_time_qos_user_interactive: u64, + pub ri_billed_system_time: u64, + pub ri_serviced_system_time: u64, + pub ri_logical_writes: u64, + pub ri_lifetime_max_phys_footprint: u64, + pub ri_instructions: u64, + pub ri_cycles: u64, + pub ri_billed_energy: u64, + pub ri_serviced_energy: u64, + pub ri_interval_max_phys_footprint: u64, + pub ri_runnable_time: u64, + } + + pub struct image_offset { + pub uuid: ::uuid_t, + pub offset: u32, + } +} + +s_no_extra_traits! { + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct kevent { + pub ident: ::uintptr_t, + pub filter: i16, + pub flags: u16, + pub fflags: u32, + pub data: ::intptr_t, + pub udata: *mut ::c_void, + } + + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct semid_ds { + // Note the manpage shows different types than the system header. + pub sem_perm: ipc_perm, + pub sem_base: i32, + pub sem_nsems: ::c_ushort, + pub sem_otime: ::time_t, + pub sem_pad1: i32, + pub sem_ctime: ::time_t, + pub sem_pad2: i32, + pub sem_pad3: [i32; 4], + } + + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct shmid_ds { + pub shm_perm: ipc_perm, + pub shm_segsz: ::size_t, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + pub shm_atime: ::time_t, // FIXME: 64-bit wrong align => wrong offset + pub shm_dtime: ::time_t, // FIXME: 64-bit wrong align => wrong offset + pub shm_ctime: ::time_t, // FIXME: 64-bit wrong align => wrong offset + // FIXME: 64-bit wrong align => wrong offset: + pub shm_internal: *mut ::c_void, + } + + pub struct proc_threadinfo { + pub pth_user_time: u64, + pub pth_system_time: u64, + pub pth_cpu_usage: i32, + pub pth_policy: i32, + pub pth_run_state: i32, + pub pth_flags: i32, + pub pth_sleep_time: i32, + pub pth_curpri: i32, + pub pth_priority: i32, + pub pth_maxpriority: i32, + pub pth_name: [::c_char; MAXTHREADNAMESIZE], + } + + pub struct statfs { + pub f_bsize: u32, + pub f_iosize: i32, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_owner: ::uid_t, + pub f_type: u32, + pub f_flags: u32, + pub f_fssubtype: u32, + pub f_fstypename: [::c_char; 16], + pub f_mntonname: [::c_char; 1024], + pub f_mntfromname: [::c_char; 1024], + pub f_flags_ext: u32, + pub f_reserved: [u32; 7], + } + + pub struct dirent { + pub d_ino: u64, + pub d_seekoff: u64, + pub d_reclen: u16, + pub d_namlen: u16, + pub d_type: u8, + pub d_name: [::c_char; 1024], + } + + pub struct pthread_rwlock_t { + __sig: ::c_long, + __opaque: [u8; __PTHREAD_RWLOCK_SIZE__], + } + + pub struct pthread_mutex_t { + __sig: ::c_long, + __opaque: [u8; __PTHREAD_MUTEX_SIZE__], + } + + pub struct pthread_cond_t { + __sig: ::c_long, + __opaque: [u8; __PTHREAD_COND_SIZE__], + } + + pub struct sockaddr_storage { + pub ss_len: u8, + pub ss_family: ::sa_family_t, + __ss_pad1: [u8; 6], + __ss_align: i64, + __ss_pad2: [u8; 112], + } + + pub struct utmpx { + pub ut_user: [::c_char; _UTX_USERSIZE], + pub ut_id: [::c_char; _UTX_IDSIZE], + pub ut_line: [::c_char; _UTX_LINESIZE], + pub ut_pid: ::pid_t, + pub ut_type: ::c_short, + pub ut_tv: ::timeval, + pub ut_host: [::c_char; _UTX_HOSTSIZE], + ut_pad: [u32; 16], + } + + pub struct sigevent { + pub sigev_notify: ::c_int, + pub sigev_signo: ::c_int, + pub sigev_value: ::sigval, + __unused1: *mut ::c_void, //actually a function pointer + pub sigev_notify_attributes: *mut ::pthread_attr_t + } + + pub struct processor_cpu_load_info { + pub cpu_ticks: [::c_uint; CPU_STATE_MAX as usize], + } + + pub struct processor_basic_info { + pub cpu_type: cpu_type_t, + pub cpu_subtype: cpu_subtype_t, + pub running: ::boolean_t, + pub slot_num: ::c_int, + pub is_master: ::boolean_t, + } + + pub struct processor_set_basic_info { + pub processor_count: ::c_int, + pub default_policy: ::c_int, + } + + pub struct processor_set_load_info { + pub task_count: ::c_int, + pub thread_count: ::c_int, + pub load_average: integer_t, + pub mach_factor: integer_t, + } + + pub struct time_value_t { + pub seconds: integer_t, + pub microseconds: integer_t, + } + + pub struct thread_basic_info { + pub user_time: time_value_t, + pub system_time: time_value_t, + pub cpu_usage: ::integer_t, + pub policy: ::policy_t, + pub run_state: ::integer_t, + pub flags: ::integer_t, + pub suspend_count: ::integer_t, + pub sleep_time: ::integer_t, + } + + pub struct thread_identifier_info { + pub thread_id: u64, + pub thread_handle: u64, + pub dispatch_qaddr: u64, + } + + pub struct thread_extended_info { + pub pth_user_time: u64, + pub pth_system_time: u64, + pub pth_cpu_usage: i32, + pub pth_policy: i32, + pub pth_run_state: i32, + pub pth_flags: i32, + pub pth_sleep_time: i32, + pub pth_curpri: i32, + pub pth_priority: i32, + pub pth_maxpriority: i32, + pub pth_name: [::c_char; MAXTHREADNAMESIZE], + } + + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct if_data64 { + pub ifi_type: ::c_uchar, + pub ifi_typelen: ::c_uchar, + pub ifi_physical: ::c_uchar, + pub ifi_addrlen: ::c_uchar, + pub ifi_hdrlen: ::c_uchar, + pub ifi_recvquota: ::c_uchar, + pub ifi_xmitquota: ::c_uchar, + pub ifi_unused1: ::c_uchar, + pub ifi_mtu: u32, + pub ifi_metric: u32, + pub ifi_baudrate: u64, + pub ifi_ipackets: u64, + pub ifi_ierrors: u64, + pub ifi_opackets: u64, + pub ifi_oerrors: u64, + pub ifi_collisions: u64, + pub ifi_ibytes: u64, + pub ifi_obytes: u64, + pub ifi_imcasts: u64, + pub ifi_omcasts: u64, + pub ifi_iqdrops: u64, + pub ifi_noproto: u64, + pub ifi_recvtiming: u32, + pub ifi_xmittiming: u32, + #[cfg(target_pointer_width = "32")] + pub ifi_lastchange: ::timeval, + #[cfg(not(target_pointer_width = "32"))] + pub ifi_lastchange: timeval32, + } + + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct if_msghdr2 { + pub ifm_msglen: ::c_ushort, + pub ifm_version: ::c_uchar, + pub ifm_type: ::c_uchar, + pub ifm_addrs: ::c_int, + pub ifm_flags: ::c_int, + pub ifm_index: ::c_ushort, + pub ifm_snd_len: ::c_int, + pub ifm_snd_maxlen: ::c_int, + pub ifm_snd_drops: ::c_int, + pub ifm_timer: ::c_int, + pub ifm_data: if_data64, + } + + #[cfg_attr(libc_packedN, repr(packed(8)))] + pub struct vm_statistics64 { + pub free_count: natural_t, + pub active_count: natural_t, + pub inactive_count: natural_t, + pub wire_count: natural_t, + pub zero_fill_count: u64, + pub reactivations: u64, + pub pageins: u64, + pub pageouts: u64, + pub faults: u64, + pub cow_faults: u64, + pub lookups: u64, + pub hits: u64, + pub purges: u64, + pub purgeable_count: natural_t, + pub speculative_count: natural_t, + pub decompressions: u64, + pub compressions: u64, + pub swapins: u64, + pub swapouts: u64, + pub compressor_page_count: natural_t, + pub throttled_count: natural_t, + pub external_page_count: natural_t, + pub internal_page_count: natural_t, + pub total_uncompressed_pages_in_compressor: u64, + } + + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct mach_task_basic_info { + pub virtual_size: mach_vm_size_t, + pub resident_size: mach_vm_size_t, + pub resident_size_max: mach_vm_size_t, + pub user_time: time_value_t, + pub system_time: time_value_t, + pub policy: ::policy_t, + pub suspend_count: integer_t, + } + + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct log2phys { + pub l2p_flags: ::c_uint, + pub l2p_contigbytes: ::off_t, + pub l2p_devoffset: ::off_t, + } +} + +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_void { + self.si_addr + } + + pub unsafe fn si_value(&self) -> ::sigval { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + _si_pid: ::pid_t, + _si_uid: ::uid_t, + _si_status: ::c_int, + _si_addr: *mut ::c_void, + si_value: ::sigval, + } + + (*(self as *const siginfo_t as *const siginfo_timer)).si_value + } + + pub unsafe fn si_pid(&self) -> ::pid_t { + self.si_pid + } + + pub unsafe fn si_uid(&self) -> ::uid_t { + self.si_uid + } + + pub unsafe fn si_status(&self) -> ::c_int { + self.si_status + } +} + +cfg_if! { + if #[cfg(libc_union)] { + s_no_extra_traits! { + pub union semun { + pub val: ::c_int, + pub buf: *mut semid_ds, + pub array: *mut ::c_ushort, + } + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for semun { + fn eq(&self, other: &semun) -> bool { + unsafe { self.val == other.val } + } + } + impl Eq for semun {} + impl ::fmt::Debug for semun { + fn fmt(&self, f: &mut ::fmt::Formatter) + -> ::fmt::Result { + f.debug_struct("semun") + .field("val", unsafe { &self.val }) + .finish() + } + } + impl ::hash::Hash for semun { + fn hash(&self, state: &mut H) { + unsafe { self.val.hash(state) }; + } + } + } + } + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for kevent { + fn eq(&self, other: &kevent) -> bool { + self.ident == other.ident + && self.filter == other.filter + && self.flags == other.flags + && self.fflags == other.fflags + && self.data == other.data + && self.udata == other.udata + } + } + impl Eq for kevent {} + impl ::fmt::Debug for kevent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let ident = self.ident; + let filter = self.filter; + let flags = self.flags; + let fflags = self.fflags; + let data = self.data; + let udata = self.udata; + f.debug_struct("kevent") + .field("ident", &ident) + .field("filter", &filter) + .field("flags", &flags) + .field("fflags", &fflags) + .field("data", &data) + .field("udata", &udata) + .finish() + } + } + impl ::hash::Hash for kevent { + fn hash(&self, state: &mut H) { + let ident = self.ident; + let filter = self.filter; + let flags = self.flags; + let fflags = self.fflags; + let data = self.data; + let udata = self.udata; + ident.hash(state); + filter.hash(state); + flags.hash(state); + fflags.hash(state); + data.hash(state); + udata.hash(state); + } + } + + impl PartialEq for semid_ds { + fn eq(&self, other: &semid_ds) -> bool { + let sem_perm = self.sem_perm; + let sem_pad3 = self.sem_pad3; + let other_sem_perm = other.sem_perm; + let other_sem_pad3 = other.sem_pad3; + sem_perm == other_sem_perm + && self.sem_base == other.sem_base + && self.sem_nsems == other.sem_nsems + && self.sem_otime == other.sem_otime + && self.sem_pad1 == other.sem_pad1 + && self.sem_ctime == other.sem_ctime + && self.sem_pad2 == other.sem_pad2 + && sem_pad3 == other_sem_pad3 + } + } + impl Eq for semid_ds {} + impl ::fmt::Debug for semid_ds { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let sem_perm = self.sem_perm; + let sem_base = self.sem_base; + let sem_nsems = self.sem_nsems; + let sem_otime = self.sem_otime; + let sem_pad1 = self.sem_pad1; + let sem_ctime = self.sem_ctime; + let sem_pad2 = self.sem_pad2; + let sem_pad3 = self.sem_pad3; + f.debug_struct("semid_ds") + .field("sem_perm", &sem_perm) + .field("sem_base", &sem_base) + .field("sem_nsems", &sem_nsems) + .field("sem_otime", &sem_otime) + .field("sem_pad1", &sem_pad1) + .field("sem_ctime", &sem_ctime) + .field("sem_pad2", &sem_pad2) + .field("sem_pad3", &sem_pad3) + .finish() + } + } + impl ::hash::Hash for semid_ds { + fn hash(&self, state: &mut H) { + let sem_perm = self.sem_perm; + let sem_base = self.sem_base; + let sem_nsems = self.sem_nsems; + let sem_otime = self.sem_otime; + let sem_pad1 = self.sem_pad1; + let sem_ctime = self.sem_ctime; + let sem_pad2 = self.sem_pad2; + let sem_pad3 = self.sem_pad3; + sem_perm.hash(state); + sem_base.hash(state); + sem_nsems.hash(state); + sem_otime.hash(state); + sem_pad1.hash(state); + sem_ctime.hash(state); + sem_pad2.hash(state); + sem_pad3.hash(state); + } + } + + impl PartialEq for shmid_ds { + fn eq(&self, other: &shmid_ds) -> bool { + let shm_perm = self.shm_perm; + let other_shm_perm = other.shm_perm; + shm_perm == other_shm_perm + && self.shm_segsz == other.shm_segsz + && self.shm_lpid == other.shm_lpid + && self.shm_cpid == other.shm_cpid + && self.shm_nattch == other.shm_nattch + && self.shm_atime == other.shm_atime + && self.shm_dtime == other.shm_dtime + && self.shm_ctime == other.shm_ctime + && self.shm_internal == other.shm_internal + } + } + impl Eq for shmid_ds {} + impl ::fmt::Debug for shmid_ds { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let shm_perm = self.shm_perm; + let shm_segsz = self.shm_segsz; + let shm_lpid = self.shm_lpid; + let shm_cpid = self.shm_cpid; + let shm_nattch = self.shm_nattch; + let shm_atime = self.shm_atime; + let shm_dtime = self.shm_dtime; + let shm_ctime = self.shm_ctime; + let shm_internal = self.shm_internal; + f.debug_struct("shmid_ds") + .field("shm_perm", &shm_perm) + .field("shm_segsz", &shm_segsz) + .field("shm_lpid", &shm_lpid) + .field("shm_cpid", &shm_cpid) + .field("shm_nattch", &shm_nattch) + .field("shm_atime", &shm_atime) + .field("shm_dtime", &shm_dtime) + .field("shm_ctime", &shm_ctime) + .field("shm_internal", &shm_internal) + .finish() + } + } + impl ::hash::Hash for shmid_ds { + fn hash(&self, state: &mut H) { + let shm_perm = self.shm_perm; + let shm_segsz = self.shm_segsz; + let shm_lpid = self.shm_lpid; + let shm_cpid = self.shm_cpid; + let shm_nattch = self.shm_nattch; + let shm_atime = self.shm_atime; + let shm_dtime = self.shm_dtime; + let shm_ctime = self.shm_ctime; + let shm_internal = self.shm_internal; + shm_perm.hash(state); + shm_segsz.hash(state); + shm_lpid.hash(state); + shm_cpid.hash(state); + shm_nattch.hash(state); + shm_atime.hash(state); + shm_dtime.hash(state); + shm_ctime.hash(state); + shm_internal.hash(state); + } + } + + impl PartialEq for proc_threadinfo { + fn eq(&self, other: &proc_threadinfo) -> bool { + self.pth_user_time == other.pth_user_time + && self.pth_system_time == other.pth_system_time + && self.pth_cpu_usage == other.pth_cpu_usage + && self.pth_policy == other.pth_policy + && self.pth_run_state == other.pth_run_state + && self.pth_flags == other.pth_flags + && self.pth_sleep_time == other.pth_sleep_time + && self.pth_curpri == other.pth_curpri + && self.pth_priority == other.pth_priority + && self.pth_maxpriority == other.pth_maxpriority + && self.pth_name + .iter() + .zip(other.pth_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for proc_threadinfo {} + impl ::fmt::Debug for proc_threadinfo { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("proc_threadinfo") + .field("pth_user_time", &self.pth_user_time) + .field("pth_system_time", &self.pth_system_time) + .field("pth_cpu_usage", &self.pth_cpu_usage) + .field("pth_policy", &self.pth_policy) + .field("pth_run_state", &self.pth_run_state) + .field("pth_flags", &self.pth_flags) + .field("pth_sleep_time", &self.pth_sleep_time) + .field("pth_curpri", &self.pth_curpri) + .field("pth_priority", &self.pth_priority) + .field("pth_maxpriority", &self.pth_maxpriority) + // FIXME: .field("pth_name", &self.pth_name) + .finish() + } + } + impl ::hash::Hash for proc_threadinfo { + fn hash(&self, state: &mut H) { + self.pth_user_time.hash(state); + self.pth_system_time.hash(state); + self.pth_cpu_usage.hash(state); + self.pth_policy.hash(state); + self.pth_run_state.hash(state); + self.pth_flags.hash(state); + self.pth_sleep_time.hash(state); + self.pth_curpri.hash(state); + self.pth_priority.hash(state); + self.pth_maxpriority.hash(state); + self.pth_name.hash(state); + } + } + + impl PartialEq for statfs { + fn eq(&self, other: &statfs) -> bool { + self.f_bsize == other.f_bsize + && self.f_iosize == other.f_iosize + && self.f_blocks == other.f_blocks + && self.f_bfree == other.f_bfree + && self.f_bavail == other.f_bavail + && self.f_files == other.f_files + && self.f_ffree == other.f_ffree + && self.f_fsid == other.f_fsid + && self.f_owner == other.f_owner + && self.f_flags == other.f_flags + && self.f_fssubtype == other.f_fssubtype + && self.f_fstypename == other.f_fstypename + && self.f_type == other.f_type + && self + .f_mntonname + .iter() + .zip(other.f_mntonname.iter()) + .all(|(a,b)| a == b) + && self + .f_mntfromname + .iter() + .zip(other.f_mntfromname.iter()) + .all(|(a,b)| a == b) + && self.f_reserved == other.f_reserved + } + } + + impl Eq for statfs {} + impl ::fmt::Debug for statfs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("statfs") + .field("f_bsize", &self.f_bsize) + .field("f_iosize", &self.f_iosize) + .field("f_blocks", &self.f_blocks) + .field("f_bfree", &self.f_bfree) + .field("f_bavail", &self.f_bavail) + .field("f_files", &self.f_files) + .field("f_ffree", &self.f_ffree) + .field("f_fsid", &self.f_fsid) + .field("f_owner", &self.f_owner) + .field("f_flags", &self.f_flags) + .field("f_fssubtype", &self.f_fssubtype) + .field("f_fstypename", &self.f_fstypename) + .field("f_type", &self.f_type) + // FIXME: .field("f_mntonname", &self.f_mntonname) + // FIXME: .field("f_mntfromname", &self.f_mntfromname) + .field("f_reserved", &self.f_reserved) + .finish() + } + } + + impl ::hash::Hash for statfs { + fn hash(&self, state: &mut H) { + self.f_bsize.hash(state); + self.f_iosize.hash(state); + self.f_blocks.hash(state); + self.f_bfree.hash(state); + self.f_bavail.hash(state); + self.f_files.hash(state); + self.f_ffree.hash(state); + self.f_fsid.hash(state); + self.f_owner.hash(state); + self.f_flags.hash(state); + self.f_fssubtype.hash(state); + self.f_fstypename.hash(state); + self.f_type.hash(state); + self.f_mntonname.hash(state); + self.f_mntfromname.hash(state); + self.f_reserved.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_ino == other.d_ino + && self.d_seekoff == other.d_seekoff + && self.d_reclen == other.d_reclen + && self.d_namlen == other.d_namlen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_ino", &self.d_ino) + .field("d_seekoff", &self.d_seekoff) + .field("d_reclen", &self.d_reclen) + .field("d_namlen", &self.d_namlen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_seekoff.hash(state); + self.d_reclen.hash(state); + self.d_namlen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + impl PartialEq for pthread_rwlock_t { + fn eq(&self, other: &pthread_rwlock_t) -> bool { + self.__sig == other.__sig + && self. + __opaque + .iter() + .zip(other.__opaque.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_rwlock_t {} + impl ::fmt::Debug for pthread_rwlock_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_rwlock_t") + .field("__sig", &self.__sig) + // FIXME: .field("__opaque", &self.__opaque) + .finish() + } + } + impl ::hash::Hash for pthread_rwlock_t { + fn hash(&self, state: &mut H) { + self.__sig.hash(state); + self.__opaque.hash(state); + } + } + + impl PartialEq for pthread_mutex_t { + fn eq(&self, other: &pthread_mutex_t) -> bool { + self.__sig == other.__sig + && self. + __opaque + .iter() + .zip(other.__opaque.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for pthread_mutex_t {} + + impl ::fmt::Debug for pthread_mutex_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_mutex_t") + .field("__sig", &self.__sig) + // FIXME: .field("__opaque", &self.__opaque) + .finish() + } + } + + impl ::hash::Hash for pthread_mutex_t { + fn hash(&self, state: &mut H) { + self.__sig.hash(state); + self.__opaque.hash(state); + } + } + + impl PartialEq for pthread_cond_t { + fn eq(&self, other: &pthread_cond_t) -> bool { + self.__sig == other.__sig + && self. + __opaque + .iter() + .zip(other.__opaque.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for pthread_cond_t {} + + impl ::fmt::Debug for pthread_cond_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_cond_t") + .field("__sig", &self.__sig) + // FIXME: .field("__opaque", &self.__opaque) + .finish() + } + } + + impl ::hash::Hash for pthread_cond_t { + fn hash(&self, state: &mut H) { + self.__sig.hash(state); + self.__opaque.hash(state); + } + } + + impl PartialEq for sockaddr_storage { + fn eq(&self, other: &sockaddr_storage) -> bool { + self.ss_len == other.ss_len + && self.ss_family == other.ss_family + && self + .__ss_pad1 + .iter() + .zip(other.__ss_pad1.iter()) + .all(|(a, b)| a == b) + && self.__ss_align == other.__ss_align + && self + .__ss_pad2 + .iter() + .zip(other.__ss_pad2.iter()) + .all(|(a, b)| a == b) + } + } + + impl Eq for sockaddr_storage {} + + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("ss_len", &self.ss_len) + .field("ss_family", &self.ss_family) + .field("__ss_pad1", &self.__ss_pad1) + .field("__ss_align", &self.__ss_align) + // FIXME: .field("__ss_pad2", &self.__ss_pad2) + .finish() + } + } + + impl ::hash::Hash for sockaddr_storage { + fn hash(&self, state: &mut H) { + self.ss_len.hash(state); + self.ss_family.hash(state); + self.__ss_pad1.hash(state); + self.__ss_align.hash(state); + self.__ss_pad2.hash(state); + } + } + + impl PartialEq for utmpx { + fn eq(&self, other: &utmpx) -> bool { + self.ut_user + .iter() + .zip(other.ut_user.iter()) + .all(|(a,b)| a == b) + && self.ut_id == other.ut_id + && self.ut_line == other.ut_line + && self.ut_pid == other.ut_pid + && self.ut_type == other.ut_type + && self.ut_tv == other.ut_tv + && self + .ut_host + .iter() + .zip(other.ut_host.iter()) + .all(|(a,b)| a == b) + && self.ut_pad == other.ut_pad + } + } + + impl Eq for utmpx {} + + impl ::fmt::Debug for utmpx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmpx") + // FIXME: .field("ut_user", &self.ut_user) + .field("ut_id", &self.ut_id) + .field("ut_line", &self.ut_line) + .field("ut_pid", &self.ut_pid) + .field("ut_type", &self.ut_type) + .field("ut_tv", &self.ut_tv) + // FIXME: .field("ut_host", &self.ut_host) + .field("ut_pad", &self.ut_pad) + .finish() + } + } + + impl ::hash::Hash for utmpx { + fn hash(&self, state: &mut H) { + self.ut_user.hash(state); + self.ut_id.hash(state); + self.ut_line.hash(state); + self.ut_pid.hash(state); + self.ut_type.hash(state); + self.ut_tv.hash(state); + self.ut_host.hash(state); + self.ut_pad.hash(state); + } + } + + impl PartialEq for sigevent { + fn eq(&self, other: &sigevent) -> bool { + self.sigev_notify == other.sigev_notify + && self.sigev_signo == other.sigev_signo + && self.sigev_value == other.sigev_value + && self.sigev_notify_attributes + == other.sigev_notify_attributes + } + } + + impl Eq for sigevent {} + + impl ::fmt::Debug for sigevent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigevent") + .field("sigev_notify", &self.sigev_notify) + .field("sigev_signo", &self.sigev_signo) + .field("sigev_value", &self.sigev_value) + .field("sigev_notify_attributes", + &self.sigev_notify_attributes) + .finish() + } + } + + impl ::hash::Hash for sigevent { + fn hash(&self, state: &mut H) { + self.sigev_notify.hash(state); + self.sigev_signo.hash(state); + self.sigev_value.hash(state); + self.sigev_notify_attributes.hash(state); + } + } + + impl PartialEq for processor_cpu_load_info { + fn eq(&self, other: &processor_cpu_load_info) -> bool { + self.cpu_ticks == other.cpu_ticks + } + } + impl Eq for processor_cpu_load_info {} + impl ::fmt::Debug for processor_cpu_load_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("processor_cpu_load_info") + .field("cpu_ticks", &self.cpu_ticks) + .finish() + } + } + impl ::hash::Hash for processor_cpu_load_info { + fn hash(&self, state: &mut H) { + self.cpu_ticks.hash(state); + } + } + + impl PartialEq for processor_basic_info { + fn eq(&self, other: &processor_basic_info) -> bool { + self.cpu_type == other.cpu_type + && self.cpu_subtype == other.cpu_subtype + && self.running == other.running + && self.slot_num == other.slot_num + && self.is_master == other.is_master + } + } + impl Eq for processor_basic_info {} + impl ::fmt::Debug for processor_basic_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("processor_basic_info") + .field("cpu_type", &self.cpu_type) + .field("cpu_subtype", &self.cpu_subtype) + .field("running", &self.running) + .field("slot_num", &self.slot_num) + .field("is_master", &self.is_master) + .finish() + } + } + impl ::hash::Hash for processor_basic_info { + fn hash(&self, state: &mut H) { + self.cpu_type.hash(state); + self.cpu_subtype.hash(state); + self.running.hash(state); + self.slot_num.hash(state); + self.is_master.hash(state); + } + } + + impl PartialEq for processor_set_basic_info { + fn eq(&self, other: &processor_set_basic_info) -> bool { + self.processor_count == other.processor_count + && self.default_policy == other.default_policy + } + } + impl Eq for processor_set_basic_info {} + impl ::fmt::Debug for processor_set_basic_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("processor_set_basic_info") + .field("processor_count", &self.processor_count) + .field("default_policy", &self.default_policy) + .finish() + } + } + impl ::hash::Hash for processor_set_basic_info { + fn hash(&self, state: &mut H) { + self.processor_count.hash(state); + self.default_policy.hash(state); + } + } + + impl PartialEq for processor_set_load_info { + fn eq(&self, other: &processor_set_load_info) -> bool { + self.task_count == other.task_count + && self.thread_count == other.thread_count + && self.load_average == other.load_average + && self.mach_factor == other.mach_factor + } + } + impl Eq for processor_set_load_info {} + impl ::fmt::Debug for processor_set_load_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("processor_set_load_info") + .field("task_count", &self.task_count) + .field("thread_count", &self.thread_count) + .field("load_average", &self.load_average) + .field("mach_factor", &self.mach_factor) + .finish() + } + } + impl ::hash::Hash for processor_set_load_info { + fn hash(&self, state: &mut H) { + self.task_count.hash(state); + self.thread_count.hash(state); + self.load_average.hash(state); + self.mach_factor.hash(state); + } + } + + impl PartialEq for time_value_t { + fn eq(&self, other: &time_value_t) -> bool { + self.seconds == other.seconds + && self.microseconds == other.microseconds + } + } + impl Eq for time_value_t {} + impl ::fmt::Debug for time_value_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("time_value_t") + .field("seconds", &self.seconds) + .field("microseconds", &self.microseconds) + .finish() + } + } + impl ::hash::Hash for time_value_t { + fn hash(&self, state: &mut H) { + self.seconds.hash(state); + self.microseconds.hash(state); + } + } + impl PartialEq for thread_basic_info { + fn eq(&self, other: &thread_basic_info) -> bool { + self.user_time == other.user_time + && self.system_time == other.system_time + && self.cpu_usage == other.cpu_usage + && self.policy == other.policy + && self.run_state == other.run_state + && self.flags == other.flags + && self.suspend_count == other.suspend_count + && self.sleep_time == other.sleep_time + } + } + impl Eq for thread_basic_info {} + impl ::fmt::Debug for thread_basic_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("thread_basic_info") + .field("user_time", &self.user_time) + .field("system_time", &self.system_time) + .field("cpu_usage", &self.cpu_usage) + .field("policy", &self.policy) + .field("run_state", &self.run_state) + .field("flags", &self.flags) + .field("suspend_count", &self.suspend_count) + .field("sleep_time", &self.sleep_time) + .finish() + } + } + impl ::hash::Hash for thread_basic_info { + fn hash(&self, state: &mut H) { + self.user_time.hash(state); + self.system_time.hash(state); + self.cpu_usage.hash(state); + self.policy.hash(state); + self.run_state.hash(state); + self.flags.hash(state); + self.suspend_count.hash(state); + self.sleep_time.hash(state); + } + } + impl PartialEq for thread_extended_info { + fn eq(&self, other: &thread_extended_info) -> bool { + self.pth_user_time == other.pth_user_time + && self.pth_system_time == other.pth_system_time + && self.pth_cpu_usage == other.pth_cpu_usage + && self.pth_policy == other.pth_policy + && self.pth_run_state == other.pth_run_state + && self.pth_flags == other.pth_flags + && self.pth_sleep_time == other.pth_sleep_time + && self.pth_curpri == other.pth_curpri + && self.pth_priority == other.pth_priority + && self.pth_maxpriority == other.pth_maxpriority + && self.pth_name + .iter() + .zip(other.pth_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for thread_extended_info {} + impl ::fmt::Debug for thread_extended_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("proc_threadinfo") + .field("pth_user_time", &self.pth_user_time) + .field("pth_system_time", &self.pth_system_time) + .field("pth_cpu_usage", &self.pth_cpu_usage) + .field("pth_policy", &self.pth_policy) + .field("pth_run_state", &self.pth_run_state) + .field("pth_flags", &self.pth_flags) + .field("pth_sleep_time", &self.pth_sleep_time) + .field("pth_curpri", &self.pth_curpri) + .field("pth_priority", &self.pth_priority) + .field("pth_maxpriority", &self.pth_maxpriority) + // FIXME: .field("pth_name", &self.pth_name) + .finish() + } + } + impl ::hash::Hash for thread_extended_info { + fn hash(&self, state: &mut H) { + self.pth_user_time.hash(state); + self.pth_system_time.hash(state); + self.pth_cpu_usage.hash(state); + self.pth_policy.hash(state); + self.pth_run_state.hash(state); + self.pth_flags.hash(state); + self.pth_sleep_time.hash(state); + self.pth_curpri.hash(state); + self.pth_priority.hash(state); + self.pth_maxpriority.hash(state); + self.pth_name.hash(state); + } + } + impl PartialEq for thread_identifier_info { + fn eq(&self, other: &thread_identifier_info) -> bool { + self.thread_id == other.thread_id + && self.thread_handle == other.thread_handle + && self.dispatch_qaddr == other.dispatch_qaddr + } + } + impl Eq for thread_identifier_info {} + impl ::fmt::Debug for thread_identifier_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("thread_identifier_info") + .field("thread_id", &self.thread_id) + .field("thread_handle", &self.thread_handle) + .field("dispatch_qaddr", &self.dispatch_qaddr) + .finish() + } + } + impl ::hash::Hash for thread_identifier_info { + fn hash(&self, state: &mut H) { + self.thread_id.hash(state); + self.thread_handle.hash(state); + self.dispatch_qaddr.hash(state); + } + } + impl PartialEq for if_data64 { + fn eq(&self, other: &if_data64) -> bool { + self.ifi_type == other.ifi_type && + self.ifi_typelen == other.ifi_typelen && + self.ifi_physical == other.ifi_physical && + self.ifi_addrlen == other.ifi_addrlen && + self.ifi_hdrlen == other.ifi_hdrlen && + self.ifi_recvquota == other.ifi_recvquota && + self.ifi_xmitquota == other.ifi_xmitquota && + self.ifi_unused1 == other.ifi_unused1 && + self.ifi_mtu == other.ifi_mtu && + self.ifi_metric == other.ifi_metric && + self.ifi_baudrate == other.ifi_baudrate && + self.ifi_ipackets == other.ifi_ipackets && + self.ifi_ierrors == other.ifi_ierrors && + self.ifi_opackets == other.ifi_opackets && + self.ifi_oerrors == other.ifi_oerrors && + self.ifi_collisions == other.ifi_collisions && + self.ifi_ibytes == other.ifi_ibytes && + self.ifi_obytes == other.ifi_obytes && + self.ifi_imcasts == other.ifi_imcasts && + self.ifi_omcasts == other.ifi_omcasts && + self.ifi_iqdrops == other.ifi_iqdrops && + self.ifi_noproto == other.ifi_noproto && + self.ifi_recvtiming == other.ifi_recvtiming && + self.ifi_xmittiming == other.ifi_xmittiming && + self.ifi_lastchange == other.ifi_lastchange + } + } + impl Eq for if_data64 {} + impl ::fmt::Debug for if_data64 { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let ifi_type = self.ifi_type; + let ifi_typelen = self.ifi_typelen; + let ifi_physical = self.ifi_physical; + let ifi_addrlen = self.ifi_addrlen; + let ifi_hdrlen = self.ifi_hdrlen; + let ifi_recvquota = self.ifi_recvquota; + let ifi_xmitquota = self.ifi_xmitquota; + let ifi_unused1 = self.ifi_unused1; + let ifi_mtu = self.ifi_mtu; + let ifi_metric = self.ifi_metric; + let ifi_baudrate = self.ifi_baudrate; + let ifi_ipackets = self.ifi_ipackets; + let ifi_ierrors = self.ifi_ierrors; + let ifi_opackets = self.ifi_opackets; + let ifi_oerrors = self.ifi_oerrors; + let ifi_collisions = self.ifi_collisions; + let ifi_ibytes = self.ifi_ibytes; + let ifi_obytes = self.ifi_obytes; + let ifi_imcasts = self.ifi_imcasts; + let ifi_omcasts = self.ifi_omcasts; + let ifi_iqdrops = self.ifi_iqdrops; + let ifi_noproto = self.ifi_noproto; + let ifi_recvtiming = self.ifi_recvtiming; + let ifi_xmittiming = self.ifi_xmittiming; + let ifi_lastchange = self.ifi_lastchange; + f.debug_struct("if_data64") + .field("ifi_type", &ifi_type) + .field("ifi_typelen", &ifi_typelen) + .field("ifi_physical", &ifi_physical) + .field("ifi_addrlen", &ifi_addrlen) + .field("ifi_hdrlen", &ifi_hdrlen) + .field("ifi_recvquota", &ifi_recvquota) + .field("ifi_xmitquota", &ifi_xmitquota) + .field("ifi_unused1", &ifi_unused1) + .field("ifi_mtu", &ifi_mtu) + .field("ifi_metric", &ifi_metric) + .field("ifi_baudrate", &ifi_baudrate) + .field("ifi_ipackets", &ifi_ipackets) + .field("ifi_ierrors", &ifi_ierrors) + .field("ifi_opackets", &ifi_opackets) + .field("ifi_oerrors", &ifi_oerrors) + .field("ifi_collisions", &ifi_collisions) + .field("ifi_ibytes", &ifi_ibytes) + .field("ifi_obytes", &ifi_obytes) + .field("ifi_imcasts", &ifi_imcasts) + .field("ifi_omcasts", &ifi_omcasts) + .field("ifi_iqdrops", &ifi_iqdrops) + .field("ifi_noproto", &ifi_noproto) + .field("ifi_recvtiming", &ifi_recvtiming) + .field("ifi_xmittiming", &ifi_xmittiming) + .field("ifi_lastchange", &ifi_lastchange) + .finish() + } + } + impl ::hash::Hash for if_data64 { + fn hash(&self, state: &mut H) { + let ifi_type = self.ifi_type; + let ifi_typelen = self.ifi_typelen; + let ifi_physical = self.ifi_physical; + let ifi_addrlen = self.ifi_addrlen; + let ifi_hdrlen = self.ifi_hdrlen; + let ifi_recvquota = self.ifi_recvquota; + let ifi_xmitquota = self.ifi_xmitquota; + let ifi_unused1 = self.ifi_unused1; + let ifi_mtu = self.ifi_mtu; + let ifi_metric = self.ifi_metric; + let ifi_baudrate = self.ifi_baudrate; + let ifi_ipackets = self.ifi_ipackets; + let ifi_ierrors = self.ifi_ierrors; + let ifi_opackets = self.ifi_opackets; + let ifi_oerrors = self.ifi_oerrors; + let ifi_collisions = self.ifi_collisions; + let ifi_ibytes = self.ifi_ibytes; + let ifi_obytes = self.ifi_obytes; + let ifi_imcasts = self.ifi_imcasts; + let ifi_omcasts = self.ifi_omcasts; + let ifi_iqdrops = self.ifi_iqdrops; + let ifi_noproto = self.ifi_noproto; + let ifi_recvtiming = self.ifi_recvtiming; + let ifi_xmittiming = self.ifi_xmittiming; + let ifi_lastchange = self.ifi_lastchange; + ifi_type.hash(state); + ifi_typelen.hash(state); + ifi_physical.hash(state); + ifi_addrlen.hash(state); + ifi_hdrlen.hash(state); + ifi_recvquota.hash(state); + ifi_xmitquota.hash(state); + ifi_unused1.hash(state); + ifi_mtu.hash(state); + ifi_metric.hash(state); + ifi_baudrate.hash(state); + ifi_ipackets.hash(state); + ifi_ierrors.hash(state); + ifi_opackets.hash(state); + ifi_oerrors.hash(state); + ifi_collisions.hash(state); + ifi_ibytes.hash(state); + ifi_obytes.hash(state); + ifi_imcasts.hash(state); + ifi_omcasts.hash(state); + ifi_iqdrops.hash(state); + ifi_noproto.hash(state); + ifi_recvtiming.hash(state); + ifi_xmittiming.hash(state); + ifi_lastchange.hash(state); + } + } + impl PartialEq for if_msghdr2 { + fn eq(&self, other: &if_msghdr2) -> bool { + self.ifm_msglen == other.ifm_msglen && + self.ifm_version == other.ifm_version && + self.ifm_type == other.ifm_type && + self.ifm_addrs == other.ifm_addrs && + self.ifm_flags == other.ifm_flags && + self.ifm_index == other.ifm_index && + self.ifm_snd_len == other.ifm_snd_len && + self.ifm_snd_maxlen == other.ifm_snd_maxlen && + self.ifm_snd_drops == other.ifm_snd_drops && + self.ifm_timer == other.ifm_timer && + self.ifm_data == other.ifm_data + } + } + impl Eq for if_msghdr2 {} + impl ::fmt::Debug for if_msghdr2 { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let ifm_msglen = self.ifm_msglen; + let ifm_version = self.ifm_version; + let ifm_type = self.ifm_type; + let ifm_addrs = self.ifm_addrs; + let ifm_flags = self.ifm_flags; + let ifm_index = self.ifm_index; + let ifm_snd_len = self.ifm_snd_len; + let ifm_snd_maxlen = self.ifm_snd_maxlen; + let ifm_snd_drops = self.ifm_snd_drops; + let ifm_timer = self.ifm_timer; + let ifm_data = self.ifm_data; + f.debug_struct("if_msghdr2") + .field("ifm_msglen", &ifm_msglen) + .field("ifm_version", &ifm_version) + .field("ifm_type", &ifm_type) + .field("ifm_addrs", &ifm_addrs) + .field("ifm_flags", &ifm_flags) + .field("ifm_index", &ifm_index) + .field("ifm_snd_len", &ifm_snd_len) + .field("ifm_snd_maxlen", &ifm_snd_maxlen) + .field("ifm_snd_drops", &ifm_snd_drops) + .field("ifm_timer", &ifm_timer) + .field("ifm_data", &ifm_data) + .finish() + } + } + impl ::hash::Hash for if_msghdr2 { + fn hash(&self, state: &mut H) { + let ifm_msglen = self.ifm_msglen; + let ifm_version = self.ifm_version; + let ifm_type = self.ifm_type; + let ifm_addrs = self.ifm_addrs; + let ifm_flags = self.ifm_flags; + let ifm_index = self.ifm_index; + let ifm_snd_len = self.ifm_snd_len; + let ifm_snd_maxlen = self.ifm_snd_maxlen; + let ifm_snd_drops = self.ifm_snd_drops; + let ifm_timer = self.ifm_timer; + let ifm_data = self.ifm_data; + ifm_msglen.hash(state); + ifm_version.hash(state); + ifm_type.hash(state); + ifm_addrs.hash(state); + ifm_flags.hash(state); + ifm_index.hash(state); + ifm_snd_len.hash(state); + ifm_snd_maxlen.hash(state); + ifm_snd_drops.hash(state); + ifm_timer.hash(state); + ifm_data.hash(state); + } + } + impl PartialEq for vm_statistics64 { + fn eq(&self, other: &vm_statistics64) -> bool { + // Otherwise rustfmt crashes... + let total_uncompressed = self.total_uncompressed_pages_in_compressor; + self.free_count == other.free_count && + self.active_count == other.active_count && + self.inactive_count == other.inactive_count && + self.wire_count == other.wire_count && + self.zero_fill_count == other.zero_fill_count && + self.reactivations == other.reactivations && + self.pageins == other.pageins && + self.pageouts == other.pageouts && + self.faults == other.faults && + self.cow_faults == other.cow_faults && + self.lookups == other.lookups && + self.hits == other.hits && + self.purges == other.purges && + self.purgeable_count == other.purgeable_count && + self.speculative_count == other.speculative_count && + self.decompressions == other.decompressions && + self.compressions == other.compressions && + self.swapins == other.swapins && + self.swapouts == other.swapouts && + self.compressor_page_count == other.compressor_page_count && + self.throttled_count == other.throttled_count && + self.external_page_count == other.external_page_count && + self.internal_page_count == other.internal_page_count && + total_uncompressed == other.total_uncompressed_pages_in_compressor + } + } + impl Eq for vm_statistics64 {} + impl ::fmt::Debug for vm_statistics64 { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let free_count = self.free_count; + let active_count = self.active_count; + let inactive_count = self.inactive_count; + let wire_count = self.wire_count; + let zero_fill_count = self.zero_fill_count; + let reactivations = self.reactivations; + let pageins = self.pageins; + let pageouts = self.pageouts; + let faults = self.faults; + let cow_faults = self.cow_faults; + let lookups = self.lookups; + let hits = self.hits; + let purges = self.purges; + let purgeable_count = self.purgeable_count; + let speculative_count = self.speculative_count; + let decompressions = self.decompressions; + let compressions = self.compressions; + let swapins = self.swapins; + let swapouts = self.swapouts; + let compressor_page_count = self.compressor_page_count; + let throttled_count = self.throttled_count; + let external_page_count = self.external_page_count; + let internal_page_count = self.internal_page_count; + // Otherwise rustfmt crashes... + let total_uncompressed = self.total_uncompressed_pages_in_compressor; + f.debug_struct("vm_statistics64") + .field("free_count", &free_count) + .field("active_count", &active_count) + .field("inactive_count", &inactive_count) + .field("wire_count", &wire_count) + .field("zero_fill_count", &zero_fill_count) + .field("reactivations", &reactivations) + .field("pageins", &pageins) + .field("pageouts", &pageouts) + .field("faults", &faults) + .field("cow_faults", &cow_faults) + .field("lookups", &lookups) + .field("hits", &hits) + .field("purges", &purges) + .field("purgeable_count", &purgeable_count) + .field("speculative_count", &speculative_count) + .field("decompressions", &decompressions) + .field("compressions", &compressions) + .field("swapins", &swapins) + .field("swapouts", &swapouts) + .field("compressor_page_count", &compressor_page_count) + .field("throttled_count", &throttled_count) + .field("external_page_count", &external_page_count) + .field("internal_page_count", &internal_page_count) + .field("total_uncompressed_pages_in_compressor", &total_uncompressed) + .finish() + } + } + impl ::hash::Hash for vm_statistics64 { + fn hash(&self, state: &mut H) { + let free_count = self.free_count; + let active_count = self.active_count; + let inactive_count = self.inactive_count; + let wire_count = self.wire_count; + let zero_fill_count = self.zero_fill_count; + let reactivations = self.reactivations; + let pageins = self.pageins; + let pageouts = self.pageouts; + let faults = self.faults; + let cow_faults = self.cow_faults; + let lookups = self.lookups; + let hits = self.hits; + let purges = self.purges; + let purgeable_count = self.purgeable_count; + let speculative_count = self.speculative_count; + let decompressions = self.decompressions; + let compressions = self.compressions; + let swapins = self.swapins; + let swapouts = self.swapouts; + let compressor_page_count = self.compressor_page_count; + let throttled_count = self.throttled_count; + let external_page_count = self.external_page_count; + let internal_page_count = self.internal_page_count; + // Otherwise rustfmt crashes... + let total_uncompressed = self.total_uncompressed_pages_in_compressor; + free_count.hash(state); + active_count.hash(state); + inactive_count.hash(state); + wire_count.hash(state); + zero_fill_count.hash(state); + reactivations.hash(state); + pageins.hash(state); + pageouts.hash(state); + faults.hash(state); + cow_faults.hash(state); + lookups.hash(state); + hits.hash(state); + purges.hash(state); + purgeable_count.hash(state); + speculative_count.hash(state); + decompressions.hash(state); + compressions.hash(state); + swapins.hash(state); + swapouts.hash(state); + compressor_page_count.hash(state); + throttled_count.hash(state); + external_page_count.hash(state); + internal_page_count.hash(state); + total_uncompressed.hash(state); + } + } + + impl PartialEq for mach_task_basic_info { + fn eq(&self, other: &mach_task_basic_info) -> bool { + self.virtual_size == other.virtual_size + && self.resident_size == other.resident_size + && self.resident_size_max == other.resident_size_max + && self.user_time == other.user_time + && self.system_time == other.system_time + && self.policy == other.policy + && self.suspend_count == other.suspend_count + } + } + impl Eq for mach_task_basic_info {} + impl ::fmt::Debug for mach_task_basic_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let virtual_size = self.virtual_size; + let resident_size = self.resident_size; + let resident_size_max = self.resident_size_max; + let user_time = self.user_time; + let system_time = self.system_time; + let policy = self.policy; + let suspend_count = self.suspend_count; + f.debug_struct("mach_task_basic_info") + .field("virtual_size", &virtual_size) + .field("resident_size", &resident_size) + .field("resident_size_max", &resident_size_max) + .field("user_time", &user_time) + .field("system_time", &system_time) + .field("policy", &policy) + .field("suspend_count", &suspend_count) + .finish() + } + } + impl ::hash::Hash for mach_task_basic_info { + fn hash(&self, state: &mut H) { + let virtual_size = self.virtual_size; + let resident_size = self.resident_size; + let resident_size_max = self.resident_size_max; + let user_time = self.user_time; + let system_time = self.system_time; + let policy = self.policy; + let suspend_count = self.suspend_count; + virtual_size.hash(state); + resident_size.hash(state); + resident_size_max.hash(state); + user_time.hash(state); + system_time.hash(state); + policy.hash(state); + suspend_count.hash(state); + } + } + + impl PartialEq for log2phys { + fn eq(&self, other: &log2phys) -> bool { + self.l2p_flags == other.l2p_flags + && self.l2p_contigbytes == other.l2p_contigbytes + && self.l2p_devoffset == other.l2p_devoffset + } + } + impl Eq for log2phys {} + impl ::fmt::Debug for log2phys { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let l2p_flags = self.l2p_flags; + let l2p_contigbytes = self.l2p_contigbytes; + let l2p_devoffset = self.l2p_devoffset; + f.debug_struct("log2phys") + .field("l2p_flags", &l2p_flags) + .field("l2p_contigbytes", &l2p_contigbytes) + .field("l2p_devoffset", &l2p_devoffset) + .finish() + } + } + impl ::hash::Hash for log2phys { + fn hash(&self, state: &mut H) { + let l2p_flags = self.l2p_flags; + let l2p_contigbytes = self.l2p_contigbytes; + let l2p_devoffset = self.l2p_devoffset; + l2p_flags.hash(state); + l2p_contigbytes.hash(state); + l2p_devoffset.hash(state); + } + } + } +} + +pub const _UTX_USERSIZE: usize = 256; +pub const _UTX_LINESIZE: usize = 32; +pub const _UTX_IDSIZE: usize = 4; +pub const _UTX_HOSTSIZE: usize = 256; + +pub const EMPTY: ::c_short = 0; +pub const RUN_LVL: ::c_short = 1; +pub const BOOT_TIME: ::c_short = 2; +pub const OLD_TIME: ::c_short = 3; +pub const NEW_TIME: ::c_short = 4; +pub const INIT_PROCESS: ::c_short = 5; +pub const LOGIN_PROCESS: ::c_short = 6; +pub const USER_PROCESS: ::c_short = 7; +pub const DEAD_PROCESS: ::c_short = 8; +pub const ACCOUNTING: ::c_short = 9; +pub const SIGNATURE: ::c_short = 10; +pub const SHUTDOWN_TIME: ::c_short = 11; + +pub const LC_COLLATE_MASK: ::c_int = 1 << 0; +pub const LC_CTYPE_MASK: ::c_int = 1 << 1; +pub const LC_MESSAGES_MASK: ::c_int = 1 << 2; +pub const LC_MONETARY_MASK: ::c_int = 1 << 3; +pub const LC_NUMERIC_MASK: ::c_int = 1 << 4; +pub const LC_TIME_MASK: ::c_int = 1 << 5; +pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK + | LC_CTYPE_MASK + | LC_MESSAGES_MASK + | LC_MONETARY_MASK + | LC_NUMERIC_MASK + | LC_TIME_MASK; + +pub const CODESET: ::nl_item = 0; +pub const D_T_FMT: ::nl_item = 1; +pub const D_FMT: ::nl_item = 2; +pub const T_FMT: ::nl_item = 3; +pub const T_FMT_AMPM: ::nl_item = 4; +pub const AM_STR: ::nl_item = 5; +pub const PM_STR: ::nl_item = 6; + +pub const DAY_1: ::nl_item = 7; +pub const DAY_2: ::nl_item = 8; +pub const DAY_3: ::nl_item = 9; +pub const DAY_4: ::nl_item = 10; +pub const DAY_5: ::nl_item = 11; +pub const DAY_6: ::nl_item = 12; +pub const DAY_7: ::nl_item = 13; + +pub const ABDAY_1: ::nl_item = 14; +pub const ABDAY_2: ::nl_item = 15; +pub const ABDAY_3: ::nl_item = 16; +pub const ABDAY_4: ::nl_item = 17; +pub const ABDAY_5: ::nl_item = 18; +pub const ABDAY_6: ::nl_item = 19; +pub const ABDAY_7: ::nl_item = 20; + +pub const MON_1: ::nl_item = 21; +pub const MON_2: ::nl_item = 22; +pub const MON_3: ::nl_item = 23; +pub const MON_4: ::nl_item = 24; +pub const MON_5: ::nl_item = 25; +pub const MON_6: ::nl_item = 26; +pub const MON_7: ::nl_item = 27; +pub const MON_8: ::nl_item = 28; +pub const MON_9: ::nl_item = 29; +pub const MON_10: ::nl_item = 30; +pub const MON_11: ::nl_item = 31; +pub const MON_12: ::nl_item = 32; + +pub const ABMON_1: ::nl_item = 33; +pub const ABMON_2: ::nl_item = 34; +pub const ABMON_3: ::nl_item = 35; +pub const ABMON_4: ::nl_item = 36; +pub const ABMON_5: ::nl_item = 37; +pub const ABMON_6: ::nl_item = 38; +pub const ABMON_7: ::nl_item = 39; +pub const ABMON_8: ::nl_item = 40; +pub const ABMON_9: ::nl_item = 41; +pub const ABMON_10: ::nl_item = 42; +pub const ABMON_11: ::nl_item = 43; +pub const ABMON_12: ::nl_item = 44; + +pub const CLOCK_REALTIME: ::clockid_t = 0; +pub const CLOCK_MONOTONIC: ::clockid_t = 6; +pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12; +pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16; + +pub const ERA: ::nl_item = 45; +pub const ERA_D_FMT: ::nl_item = 46; +pub const ERA_D_T_FMT: ::nl_item = 47; +pub const ERA_T_FMT: ::nl_item = 48; +pub const ALT_DIGITS: ::nl_item = 49; + +pub const RADIXCHAR: ::nl_item = 50; +pub const THOUSEP: ::nl_item = 51; + +pub const YESEXPR: ::nl_item = 52; +pub const NOEXPR: ::nl_item = 53; + +pub const YESSTR: ::nl_item = 54; +pub const NOSTR: ::nl_item = 55; + +pub const CRNCYSTR: ::nl_item = 56; + +pub const D_MD_ORDER: ::nl_item = 57; + +pub const EXIT_FAILURE: ::c_int = 1; +pub const EXIT_SUCCESS: ::c_int = 0; +pub const RAND_MAX: ::c_int = 2147483647; +pub const EOF: ::c_int = -1; +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; +pub const _IOFBF: ::c_int = 0; +pub const _IONBF: ::c_int = 2; +pub const _IOLBF: ::c_int = 1; +pub const BUFSIZ: ::c_uint = 1024; +pub const FOPEN_MAX: ::c_uint = 20; +pub const FILENAME_MAX: ::c_uint = 1024; +pub const L_tmpnam: ::c_uint = 1024; +pub const TMP_MAX: ::c_uint = 308915776; +pub const _PC_LINK_MAX: ::c_int = 1; +pub const _PC_MAX_CANON: ::c_int = 2; +pub const _PC_MAX_INPUT: ::c_int = 3; +pub const _PC_NAME_MAX: ::c_int = 4; +pub const _PC_PATH_MAX: ::c_int = 5; +pub const _PC_PIPE_BUF: ::c_int = 6; +pub const _PC_CHOWN_RESTRICTED: ::c_int = 7; +pub const _PC_NO_TRUNC: ::c_int = 8; +pub const _PC_VDISABLE: ::c_int = 9; +pub const O_DSYNC: ::c_int = 0x400000; +pub const O_NOCTTY: ::c_int = 0x20000; +pub const O_CLOEXEC: ::c_int = 0x1000000; +pub const O_DIRECTORY: ::c_int = 0x100000; +pub const O_SYMLINK: ::c_int = 0x200000; +pub const S_IFIFO: mode_t = 4096; +pub const S_IFCHR: mode_t = 8192; +pub const S_IFBLK: mode_t = 24576; +pub const S_IFDIR: mode_t = 16384; +pub const S_IFREG: mode_t = 32768; +pub const S_IFLNK: mode_t = 40960; +pub const S_IFSOCK: mode_t = 49152; +pub const S_IFMT: mode_t = 61440; +pub const S_IEXEC: mode_t = 64; +pub const S_IWRITE: mode_t = 128; +pub const S_IREAD: mode_t = 256; +pub const S_IRWXU: mode_t = 448; +pub const S_IXUSR: mode_t = 64; +pub const S_IWUSR: mode_t = 128; +pub const S_IRUSR: mode_t = 256; +pub const S_IRWXG: mode_t = 56; +pub const S_IXGRP: mode_t = 8; +pub const S_IWGRP: mode_t = 16; +pub const S_IRGRP: mode_t = 32; +pub const S_IRWXO: mode_t = 7; +pub const S_IXOTH: mode_t = 1; +pub const S_IWOTH: mode_t = 2; +pub const S_IROTH: mode_t = 4; +pub const F_OK: ::c_int = 0; +pub const R_OK: ::c_int = 4; +pub const W_OK: ::c_int = 2; +pub const X_OK: ::c_int = 1; +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; +pub const F_LOCK: ::c_int = 1; +pub const F_TEST: ::c_int = 3; +pub const F_TLOCK: ::c_int = 2; +pub const F_ULOCK: ::c_int = 0; +pub const F_GETLK: ::c_int = 7; +pub const F_SETLK: ::c_int = 8; +pub const F_SETLKW: ::c_int = 9; +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGABRT: ::c_int = 6; +pub const SIGEMT: ::c_int = 7; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGSEGV: ::c_int = 11; +pub const SIGPIPE: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; + +pub const PROT_NONE: ::c_int = 0; +pub const PROT_READ: ::c_int = 1; +pub const PROT_WRITE: ::c_int = 2; +pub const PROT_EXEC: ::c_int = 4; + +pub const PT_TRACE_ME: ::c_int = 0; +pub const PT_READ_I: ::c_int = 1; +pub const PT_READ_D: ::c_int = 2; +pub const PT_READ_U: ::c_int = 3; +pub const PT_WRITE_I: ::c_int = 4; +pub const PT_WRITE_D: ::c_int = 5; +pub const PT_WRITE_U: ::c_int = 6; +pub const PT_CONTINUE: ::c_int = 7; +pub const PT_KILL: ::c_int = 8; +pub const PT_STEP: ::c_int = 9; +pub const PT_ATTACH: ::c_int = 10; +pub const PT_DETACH: ::c_int = 11; +pub const PT_SIGEXC: ::c_int = 12; +pub const PT_THUPDATE: ::c_int = 13; +pub const PT_ATTACHEXC: ::c_int = 14; + +pub const PT_FORCEQUOTA: ::c_int = 30; +pub const PT_DENY_ATTACH: ::c_int = 31; +pub const PT_FIRSTMACH: ::c_int = 32; + +pub const MAP_FILE: ::c_int = 0x0000; +pub const MAP_SHARED: ::c_int = 0x0001; +pub const MAP_PRIVATE: ::c_int = 0x0002; +pub const MAP_FIXED: ::c_int = 0x0010; +pub const MAP_ANON: ::c_int = 0x1000; +pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; + +pub const CPU_STATE_USER: ::c_int = 0; +pub const CPU_STATE_SYSTEM: ::c_int = 1; +pub const CPU_STATE_IDLE: ::c_int = 2; +pub const CPU_STATE_NICE: ::c_int = 3; +pub const CPU_STATE_MAX: ::c_int = 4; + +pub const PROCESSOR_BASIC_INFO: ::c_int = 1; +pub const PROCESSOR_CPU_LOAD_INFO: ::c_int = 2; +pub const PROCESSOR_PM_REGS_INFO: ::c_int = 0x10000001; +pub const PROCESSOR_TEMPERATURE: ::c_int = 0x10000002; +pub const PROCESSOR_SET_LOAD_INFO: ::c_int = 4; +pub const PROCESSOR_SET_BASIC_INFO: ::c_int = 5; + +deprecated_mach! { + pub const VM_FLAGS_FIXED: ::c_int = 0x0000; + pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001; + pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002; + pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008; + pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010; + pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020; + pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040; + pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000; + pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000; + pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000; + pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000; + pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000; + pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401f; + pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401f; + pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | + VM_FLAGS_ANYWHERE | + VM_FLAGS_RANDOM_ADDR | + VM_FLAGS_OVERWRITE | + VM_FLAGS_RETURN_DATA_ADDR | + VM_FLAGS_RESILIENT_CODESIGN; + + pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16; + pub const SUPERPAGE_NONE: ::c_int = 0; + pub const SUPERPAGE_SIZE_ANY: ::c_int = 1; + pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE << + VM_FLAGS_SUPERPAGE_SHIFT; + pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY << + VM_FLAGS_SUPERPAGE_SHIFT; + pub const SUPERPAGE_SIZE_2MB: ::c_int = 2; + pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB << + VM_FLAGS_SUPERPAGE_SHIFT; + + pub const VM_MEMORY_MALLOC: ::c_int = 1; + pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2; + pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3; + pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4; + pub const VM_MEMORY_SBRK: ::c_int = 5; + pub const VM_MEMORY_REALLOC: ::c_int = 6; + pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7; + pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8; + pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9; + pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10; + pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11; + pub const VM_MEMORY_MACH_MSG: ::c_int = 20; + pub const VM_MEMORY_IOKIT: ::c_int = 21; + pub const VM_MEMORY_STACK: ::c_int = 30; + pub const VM_MEMORY_GUARD: ::c_int = 31; + pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32; + pub const VM_MEMORY_DYLIB: ::c_int = 33; + pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34; + pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35; + pub const VM_MEMORY_APPKIT: ::c_int = 40; + pub const VM_MEMORY_FOUNDATION: ::c_int = 41; + pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42; + pub const VM_MEMORY_CORESERVICES: ::c_int = 43; + pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES; + pub const VM_MEMORY_JAVA: ::c_int = 44; + pub const VM_MEMORY_COREDATA: ::c_int = 45; + pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46; + pub const VM_MEMORY_ATS: ::c_int = 50; + pub const VM_MEMORY_LAYERKIT: ::c_int = 51; + pub const VM_MEMORY_CGIMAGE: ::c_int = 52; + pub const VM_MEMORY_TCMALLOC: ::c_int = 53; + pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54; + pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55; + pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56; + pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57; + pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58; + pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS; + pub const VM_MEMORY_DYLD: ::c_int = 60; + pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61; + pub const VM_MEMORY_SQLITE: ::c_int = 62; + pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63; + pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64; + pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65; + pub const VM_MEMORY_GLSL: ::c_int = 66; + pub const VM_MEMORY_OPENCL: ::c_int = 67; + pub const VM_MEMORY_COREIMAGE: ::c_int = 68; + pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69; + pub const VM_MEMORY_IMAGEIO: ::c_int = 70; + pub const VM_MEMORY_COREPROFILE: ::c_int = 71; + pub const VM_MEMORY_ASSETSD: ::c_int = 72; + pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73; + pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74; + pub const VM_MEMORY_ACCELERATE: ::c_int = 75; + pub const VM_MEMORY_COREUI: ::c_int = 76; + pub const VM_MEMORY_COREUIFILE: ::c_int = 77; + pub const VM_MEMORY_GENEALOGY: ::c_int = 78; + pub const VM_MEMORY_RAWCAMERA: ::c_int = 79; + pub const VM_MEMORY_CORPSEINFO: ::c_int = 80; + pub const VM_MEMORY_ASL: ::c_int = 81; + pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82; + pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83; + pub const VM_MEMORY_DHMM: ::c_int = 84; + pub const VM_MEMORY_SCENEKIT: ::c_int = 86; + pub const VM_MEMORY_SKYWALK: ::c_int = 87; + pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240; + pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255; +} + +pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const MS_ASYNC: ::c_int = 0x0001; +pub const MS_INVALIDATE: ::c_int = 0x0002; +pub const MS_SYNC: ::c_int = 0x0010; + +pub const MS_KILLPAGES: ::c_int = 0x0004; +pub const MS_DEACTIVATE: ::c_int = 0x0008; + +pub const EPERM: ::c_int = 1; +pub const ENOENT: ::c_int = 2; +pub const ESRCH: ::c_int = 3; +pub const EINTR: ::c_int = 4; +pub const EIO: ::c_int = 5; +pub const ENXIO: ::c_int = 6; +pub const E2BIG: ::c_int = 7; +pub const ENOEXEC: ::c_int = 8; +pub const EBADF: ::c_int = 9; +pub const ECHILD: ::c_int = 10; +pub const EDEADLK: ::c_int = 11; +pub const ENOMEM: ::c_int = 12; +pub const EACCES: ::c_int = 13; +pub const EFAULT: ::c_int = 14; +pub const ENOTBLK: ::c_int = 15; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENFILE: ::c_int = 23; +pub const EMFILE: ::c_int = 24; +pub const ENOTTY: ::c_int = 25; +pub const ETXTBSY: ::c_int = 26; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDOM: ::c_int = 33; +pub const ERANGE: ::c_int = 34; +pub const EAGAIN: ::c_int = 35; +pub const EWOULDBLOCK: ::c_int = EAGAIN; +pub const EINPROGRESS: ::c_int = 36; +pub const EALREADY: ::c_int = 37; +pub const ENOTSOCK: ::c_int = 38; +pub const EDESTADDRREQ: ::c_int = 39; +pub const EMSGSIZE: ::c_int = 40; +pub const EPROTOTYPE: ::c_int = 41; +pub const ENOPROTOOPT: ::c_int = 42; +pub const EPROTONOSUPPORT: ::c_int = 43; +pub const ESOCKTNOSUPPORT: ::c_int = 44; +pub const ENOTSUP: ::c_int = 45; +pub const EPFNOSUPPORT: ::c_int = 46; +pub const EAFNOSUPPORT: ::c_int = 47; +pub const EADDRINUSE: ::c_int = 48; +pub const EADDRNOTAVAIL: ::c_int = 49; +pub const ENETDOWN: ::c_int = 50; +pub const ENETUNREACH: ::c_int = 51; +pub const ENETRESET: ::c_int = 52; +pub const ECONNABORTED: ::c_int = 53; +pub const ECONNRESET: ::c_int = 54; +pub const ENOBUFS: ::c_int = 55; +pub const EISCONN: ::c_int = 56; +pub const ENOTCONN: ::c_int = 57; +pub const ESHUTDOWN: ::c_int = 58; +pub const ETOOMANYREFS: ::c_int = 59; +pub const ETIMEDOUT: ::c_int = 60; +pub const ECONNREFUSED: ::c_int = 61; +pub const ELOOP: ::c_int = 62; +pub const ENAMETOOLONG: ::c_int = 63; +pub const EHOSTDOWN: ::c_int = 64; +pub const EHOSTUNREACH: ::c_int = 65; +pub const ENOTEMPTY: ::c_int = 66; +pub const EPROCLIM: ::c_int = 67; +pub const EUSERS: ::c_int = 68; +pub const EDQUOT: ::c_int = 69; +pub const ESTALE: ::c_int = 70; +pub const EREMOTE: ::c_int = 71; +pub const EBADRPC: ::c_int = 72; +pub const ERPCMISMATCH: ::c_int = 73; +pub const EPROGUNAVAIL: ::c_int = 74; +pub const EPROGMISMATCH: ::c_int = 75; +pub const EPROCUNAVAIL: ::c_int = 76; +pub const ENOLCK: ::c_int = 77; +pub const ENOSYS: ::c_int = 78; +pub const EFTYPE: ::c_int = 79; +pub const EAUTH: ::c_int = 80; +pub const ENEEDAUTH: ::c_int = 81; +pub const EPWROFF: ::c_int = 82; +pub const EDEVERR: ::c_int = 83; +pub const EOVERFLOW: ::c_int = 84; +pub const EBADEXEC: ::c_int = 85; +pub const EBADARCH: ::c_int = 86; +pub const ESHLIBVERS: ::c_int = 87; +pub const EBADMACHO: ::c_int = 88; +pub const ECANCELED: ::c_int = 89; +pub const EIDRM: ::c_int = 90; +pub const ENOMSG: ::c_int = 91; +pub const EILSEQ: ::c_int = 92; +pub const ENOATTR: ::c_int = 93; +pub const EBADMSG: ::c_int = 94; +pub const EMULTIHOP: ::c_int = 95; +pub const ENODATA: ::c_int = 96; +pub const ENOLINK: ::c_int = 97; +pub const ENOSR: ::c_int = 98; +pub const ENOSTR: ::c_int = 99; +pub const EPROTO: ::c_int = 100; +pub const ETIME: ::c_int = 101; +pub const EOPNOTSUPP: ::c_int = 102; +pub const ENOPOLICY: ::c_int = 103; +pub const ENOTRECOVERABLE: ::c_int = 104; +pub const EOWNERDEAD: ::c_int = 105; +pub const EQFULL: ::c_int = 106; +pub const ELAST: ::c_int = 106; + +pub const EAI_AGAIN: ::c_int = 2; +pub const EAI_BADFLAGS: ::c_int = 3; +pub const EAI_FAIL: ::c_int = 4; +pub const EAI_FAMILY: ::c_int = 5; +pub const EAI_MEMORY: ::c_int = 6; +pub const EAI_NODATA: ::c_int = 7; +pub const EAI_NONAME: ::c_int = 8; +pub const EAI_SERVICE: ::c_int = 9; +pub const EAI_SOCKTYPE: ::c_int = 10; +pub const EAI_SYSTEM: ::c_int = 11; +pub const EAI_OVERFLOW: ::c_int = 14; + +pub const F_DUPFD: ::c_int = 0; +pub const F_DUPFD_CLOEXEC: ::c_int = 67; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; +pub const F_PREALLOCATE: ::c_int = 42; +pub const F_RDADVISE: ::c_int = 44; +pub const F_RDAHEAD: ::c_int = 45; +pub const F_NOCACHE: ::c_int = 48; +pub const F_LOG2PHYS: ::c_int = 49; +pub const F_GETPATH: ::c_int = 50; +pub const F_FULLFSYNC: ::c_int = 51; +pub const F_FREEZE_FS: ::c_int = 53; +pub const F_THAW_FS: ::c_int = 54; +pub const F_GLOBAL_NOCACHE: ::c_int = 55; +pub const F_NODIRECT: ::c_int = 62; +pub const F_LOG2PHYS_EXT: ::c_int = 65; +pub const F_BARRIERFSYNC: ::c_int = 85; +pub const F_GETPATH_NOFIRMLINK: ::c_int = 102; + +pub const F_ALLOCATECONTIG: ::c_uint = 0x02; +pub const F_ALLOCATEALL: ::c_uint = 0x04; + +pub const F_PEOFPOSMODE: ::c_int = 3; +pub const F_VOLPOSMODE: ::c_int = 4; + +pub const AT_FDCWD: ::c_int = -2; +pub const AT_EACCESS: ::c_int = 0x0010; +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020; +pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040; +pub const AT_REMOVEDIR: ::c_int = 0x0080; + +pub const PTHREAD_INTROSPECTION_THREAD_CREATE: ::c_uint = 1; +pub const PTHREAD_INTROSPECTION_THREAD_START: ::c_uint = 2; +pub const PTHREAD_INTROSPECTION_THREAD_TERMINATE: ::c_uint = 3; +pub const PTHREAD_INTROSPECTION_THREAD_DESTROY: ::c_uint = 4; + +pub const TIOCMODG: ::c_ulong = 0x40047403; +pub const TIOCMODS: ::c_ulong = 0x80047404; +pub const TIOCM_LE: ::c_int = 0x1; +pub const TIOCM_DTR: ::c_int = 0x2; +pub const TIOCM_RTS: ::c_int = 0x4; +pub const TIOCM_ST: ::c_int = 0x8; +pub const TIOCM_SR: ::c_int = 0x10; +pub const TIOCM_CTS: ::c_int = 0x20; +pub const TIOCM_CAR: ::c_int = 0x40; +pub const TIOCM_CD: ::c_int = 0x40; +pub const TIOCM_RNG: ::c_int = 0x80; +pub const TIOCM_RI: ::c_int = 0x80; +pub const TIOCM_DSR: ::c_int = 0x100; +pub const TIOCEXCL: ::c_int = 0x2000740d; +pub const TIOCNXCL: ::c_int = 0x2000740e; +pub const TIOCFLUSH: ::c_ulong = 0x80047410; +pub const TIOCGETD: ::c_ulong = 0x4004741a; +pub const TIOCSETD: ::c_ulong = 0x8004741b; +pub const TIOCIXON: ::c_uint = 0x20007481; +pub const TIOCIXOFF: ::c_uint = 0x20007480; +pub const TIOCSDTR: ::c_uint = 0x20007479; +pub const TIOCCDTR: ::c_uint = 0x20007478; +pub const TIOCGPGRP: ::c_ulong = 0x40047477; +pub const TIOCSPGRP: ::c_ulong = 0x80047476; +pub const TIOCOUTQ: ::c_ulong = 0x40047473; +pub const TIOCSTI: ::c_ulong = 0x80017472; +pub const TIOCNOTTY: ::c_uint = 0x20007471; +pub const TIOCPKT: ::c_ulong = 0x80047470; +pub const TIOCPKT_DATA: ::c_int = 0x0; +pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1; +pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2; +pub const TIOCPKT_STOP: ::c_int = 0x4; +pub const TIOCPKT_START: ::c_int = 0x8; +pub const TIOCPKT_NOSTOP: ::c_int = 0x10; +pub const TIOCPKT_DOSTOP: ::c_int = 0x20; +pub const TIOCPKT_IOCTL: ::c_int = 0x40; +pub const TIOCSTOP: ::c_uint = 0x2000746f; +pub const TIOCSTART: ::c_uint = 0x2000746e; +pub const TIOCMSET: ::c_ulong = 0x8004746d; +pub const TIOCMBIS: ::c_ulong = 0x8004746c; +pub const TIOCMBIC: ::c_ulong = 0x8004746b; +pub const TIOCMGET: ::c_ulong = 0x4004746a; +pub const TIOCREMOTE: ::c_ulong = 0x80047469; +pub const TIOCGWINSZ: ::c_ulong = 0x40087468; +pub const TIOCSWINSZ: ::c_ulong = 0x80087467; +pub const TIOCUCNTL: ::c_ulong = 0x80047466; +pub const TIOCSTAT: ::c_uint = 0x20007465; +pub const TIOCSCONS: ::c_uint = 0x20007463; +pub const TIOCCONS: ::c_ulong = 0x80047462; +pub const TIOCSCTTY: ::c_uint = 0x20007461; +pub const TIOCEXT: ::c_ulong = 0x80047460; +pub const TIOCSIG: ::c_uint = 0x2000745f; +pub const TIOCDRAIN: ::c_uint = 0x2000745e; +pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b; +pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a; +pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457; +pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456; +pub const TIOCDSIMICROCODE: ::c_uint = 0x20007455; +pub const TIOCPTYGRANT: ::c_uint = 0x20007454; +pub const TIOCPTYGNAME: ::c_uint = 0x40807453; +pub const TIOCPTYUNLK: ::c_uint = 0x20007452; + +pub const BIOCGRSIG: ::c_ulong = 0x40044272; +pub const BIOCSRSIG: ::c_ulong = 0x80044273; +pub const BIOCSDLT: ::c_ulong = 0x80044278; +pub const BIOCGSEESENT: ::c_ulong = 0x40044276; +pub const BIOCSSEESENT: ::c_ulong = 0x80044277; +pub const BIOCGDLTLIST: ::c_ulong = 0xc00c4279; + +pub const FIODTYPE: ::c_ulong = 0x4004667a; + +pub const B0: speed_t = 0; +pub const B50: speed_t = 50; +pub const B75: speed_t = 75; +pub const B110: speed_t = 110; +pub const B134: speed_t = 134; +pub const B150: speed_t = 150; +pub const B200: speed_t = 200; +pub const B300: speed_t = 300; +pub const B600: speed_t = 600; +pub const B1200: speed_t = 1200; +pub const B1800: speed_t = 1800; +pub const B2400: speed_t = 2400; +pub const B4800: speed_t = 4800; +pub const B9600: speed_t = 9600; +pub const B19200: speed_t = 19200; +pub const B38400: speed_t = 38400; +pub const B7200: speed_t = 7200; +pub const B14400: speed_t = 14400; +pub const B28800: speed_t = 28800; +pub const B57600: speed_t = 57600; +pub const B76800: speed_t = 76800; +pub const B115200: speed_t = 115200; +pub const B230400: speed_t = 230400; +pub const EXTA: speed_t = 19200; +pub const EXTB: speed_t = 38400; + +pub const SIGTRAP: ::c_int = 5; + +pub const GLOB_APPEND: ::c_int = 0x0001; +pub const GLOB_DOOFFS: ::c_int = 0x0002; +pub const GLOB_ERR: ::c_int = 0x0004; +pub const GLOB_MARK: ::c_int = 0x0008; +pub const GLOB_NOCHECK: ::c_int = 0x0010; +pub const GLOB_NOSORT: ::c_int = 0x0020; +pub const GLOB_NOESCAPE: ::c_int = 0x2000; + +pub const GLOB_NOSPACE: ::c_int = -1; +pub const GLOB_ABORTED: ::c_int = -2; +pub const GLOB_NOMATCH: ::c_int = -3; + +pub const POSIX_MADV_NORMAL: ::c_int = 0; +pub const POSIX_MADV_RANDOM: ::c_int = 1; +pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_MADV_WILLNEED: ::c_int = 3; +pub const POSIX_MADV_DONTNEED: ::c_int = 4; + +pub const _SC_IOV_MAX: ::c_int = 56; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71; +pub const _SC_LOGIN_NAME_MAX: ::c_int = 73; +pub const _SC_MQ_PRIO_MAX: ::c_int = 75; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85; +pub const _SC_THREAD_KEYS_MAX: ::c_int = 86; +pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87; +pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90; +pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91; +pub const _SC_THREAD_STACK_MIN: ::c_int = 93; +pub const _SC_THREAD_THREADS_MAX: ::c_int = 94; +pub const _SC_THREADS: ::c_int = 96; +pub const _SC_TTY_NAME_MAX: ::c_int = 101; +pub const _SC_ATEXIT_MAX: ::c_int = 107; +pub const _SC_XOPEN_CRYPT: ::c_int = 108; +pub const _SC_XOPEN_ENH_I18N: ::c_int = 109; +pub const _SC_XOPEN_LEGACY: ::c_int = 110; +pub const _SC_XOPEN_REALTIME: ::c_int = 111; +pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112; +pub const _SC_XOPEN_SHM: ::c_int = 113; +pub const _SC_XOPEN_UNIX: ::c_int = 115; +pub const _SC_XOPEN_VERSION: ::c_int = 116; +pub const _SC_XOPEN_XCU_VERSION: ::c_int = 121; +pub const _SC_PHYS_PAGES: ::c_int = 200; + +pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2; +pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; +pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1; +pub const PTHREAD_CREATE_DETACHED: ::c_int = 2; +#[cfg(target_arch = "aarch64")] +pub const PTHREAD_STACK_MIN: ::size_t = 16384; +#[cfg(not(target_arch = "aarch64"))] +pub const PTHREAD_STACK_MIN: ::size_t = 8192; + +pub const RLIMIT_CPU: ::c_int = 0; +pub const RLIMIT_FSIZE: ::c_int = 1; +pub const RLIMIT_DATA: ::c_int = 2; +pub const RLIMIT_STACK: ::c_int = 3; +pub const RLIMIT_CORE: ::c_int = 4; +pub const RLIMIT_AS: ::c_int = 5; +pub const RLIMIT_RSS: ::c_int = RLIMIT_AS; +pub const RLIMIT_MEMLOCK: ::c_int = 6; +pub const RLIMIT_NPROC: ::c_int = 7; +pub const RLIMIT_NOFILE: ::c_int = 8; +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] +pub const RLIM_NLIMITS: ::c_int = 9; +pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000; + +pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; + +pub const RUSAGE_SELF: ::c_int = 0; +pub const RUSAGE_CHILDREN: ::c_int = -1; + +pub const MADV_NORMAL: ::c_int = 0; +pub const MADV_RANDOM: ::c_int = 1; +pub const MADV_SEQUENTIAL: ::c_int = 2; +pub const MADV_WILLNEED: ::c_int = 3; +pub const MADV_DONTNEED: ::c_int = 4; +pub const MADV_FREE: ::c_int = 5; +pub const MADV_ZERO_WIRED_PAGES: ::c_int = 6; +pub const MADV_FREE_REUSABLE: ::c_int = 7; +pub const MADV_FREE_REUSE: ::c_int = 8; +pub const MADV_CAN_REUSE: ::c_int = 9; + +pub const MINCORE_INCORE: ::c_int = 0x1; +pub const MINCORE_REFERENCED: ::c_int = 0x2; +pub const MINCORE_MODIFIED: ::c_int = 0x4; +pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8; +pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10; + +// +// sys/netinet/in.h +// Protocols (RFC 1700) +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// IP6 hop-by-hop options +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// gateway2 (deprecated) +pub const IPPROTO_GGP: ::c_int = 3; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// Stream protocol II. +pub const IPPROTO_ST: ::c_int = 7; +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// private interior gateway +pub const IPPROTO_PIGP: ::c_int = 9; +/// BBN RCC Monitoring +pub const IPPROTO_RCCMON: ::c_int = 10; +/// network voice protocol +pub const IPPROTO_NVPII: ::c_int = 11; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +/// Argus +pub const IPPROTO_ARGUS: ::c_int = 13; +/// EMCON +pub const IPPROTO_EMCON: ::c_int = 14; +/// Cross Net Debugger +pub const IPPROTO_XNET: ::c_int = 15; +/// Chaos +pub const IPPROTO_CHAOS: ::c_int = 16; +// IPPROTO_UDP defined in src/unix/mod.rs +/// Multiplexing +pub const IPPROTO_MUX: ::c_int = 18; +/// DCN Measurement Subsystems +pub const IPPROTO_MEAS: ::c_int = 19; +/// Host Monitoring +pub const IPPROTO_HMP: ::c_int = 20; +/// Packet Radio Measurement +pub const IPPROTO_PRM: ::c_int = 21; +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// Trunk-1 +pub const IPPROTO_TRUNK1: ::c_int = 23; +/// Trunk-2 +pub const IPPROTO_TRUNK2: ::c_int = 24; +/// Leaf-1 +pub const IPPROTO_LEAF1: ::c_int = 25; +/// Leaf-2 +pub const IPPROTO_LEAF2: ::c_int = 26; +/// Reliable Data +pub const IPPROTO_RDP: ::c_int = 27; +/// Reliable Transaction +pub const IPPROTO_IRTP: ::c_int = 28; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// Bulk Data Transfer +pub const IPPROTO_BLT: ::c_int = 30; +/// Network Services +pub const IPPROTO_NSP: ::c_int = 31; +/// Merit Internodal +pub const IPPROTO_INP: ::c_int = 32; +/// Sequential Exchange +pub const IPPROTO_SEP: ::c_int = 33; +/// Third Party Connect +pub const IPPROTO_3PC: ::c_int = 34; +/// InterDomain Policy Routing +pub const IPPROTO_IDPR: ::c_int = 35; +/// XTP +pub const IPPROTO_XTP: ::c_int = 36; +/// Datagram Delivery +pub const IPPROTO_DDP: ::c_int = 37; +/// Control Message Transport +pub const IPPROTO_CMTP: ::c_int = 38; +/// TP++ Transport +pub const IPPROTO_TPXX: ::c_int = 39; +/// IL transport protocol +pub const IPPROTO_IL: ::c_int = 40; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// Source Demand Routing +pub const IPPROTO_SDRP: ::c_int = 42; +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// InterDomain Routing +pub const IPPROTO_IDRP: ::c_int = 45; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// Mobile Host Routing +pub const IPPROTO_MHRP: ::c_int = 48; +/// BHA +pub const IPPROTO_BHA: ::c_int = 49; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +/// Integ. Net Layer Security +pub const IPPROTO_INLSP: ::c_int = 52; +/// IP with encryption +pub const IPPROTO_SWIPE: ::c_int = 53; +/// Next Hop Resolution +pub const IPPROTO_NHRP: ::c_int = 54; +/* 55-57: Unassigned */ +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +/// any host internal protocol +pub const IPPROTO_AHIP: ::c_int = 61; +/// CFTP +pub const IPPROTO_CFTP: ::c_int = 62; +/// "hello" routing protocol +pub const IPPROTO_HELLO: ::c_int = 63; +/// SATNET/Backroom EXPAK +pub const IPPROTO_SATEXPAK: ::c_int = 64; +/// Kryptolan +pub const IPPROTO_KRYPTOLAN: ::c_int = 65; +/// Remote Virtual Disk +pub const IPPROTO_RVD: ::c_int = 66; +/// Pluribus Packet Core +pub const IPPROTO_IPPC: ::c_int = 67; +/// Any distributed FS +pub const IPPROTO_ADFS: ::c_int = 68; +/// Satnet Monitoring +pub const IPPROTO_SATMON: ::c_int = 69; +/// VISA Protocol +pub const IPPROTO_VISA: ::c_int = 70; +/// Packet Core Utility +pub const IPPROTO_IPCV: ::c_int = 71; +/// Comp. Prot. Net. Executive +pub const IPPROTO_CPNX: ::c_int = 72; +/// Comp. Prot. HeartBeat +pub const IPPROTO_CPHB: ::c_int = 73; +/// Wang Span Network +pub const IPPROTO_WSN: ::c_int = 74; +/// Packet Video Protocol +pub const IPPROTO_PVP: ::c_int = 75; +/// BackRoom SATNET Monitoring +pub const IPPROTO_BRSATMON: ::c_int = 76; +/// Sun net disk proto (temp.) +pub const IPPROTO_ND: ::c_int = 77; +/// WIDEBAND Monitoring +pub const IPPROTO_WBMON: ::c_int = 78; +/// WIDEBAND EXPAK +pub const IPPROTO_WBEXPAK: ::c_int = 79; +/// ISO cnlp +pub const IPPROTO_EON: ::c_int = 80; +/// VMTP +pub const IPPROTO_VMTP: ::c_int = 81; +/// Secure VMTP +pub const IPPROTO_SVMTP: ::c_int = 82; +/// Banyon VINES +pub const IPPROTO_VINES: ::c_int = 83; +/// TTP +pub const IPPROTO_TTP: ::c_int = 84; +/// NSFNET-IGP +pub const IPPROTO_IGP: ::c_int = 85; +/// dissimilar gateway prot. +pub const IPPROTO_DGP: ::c_int = 86; +/// TCF +pub const IPPROTO_TCF: ::c_int = 87; +/// Cisco/GXS IGRP +pub const IPPROTO_IGRP: ::c_int = 88; +/// OSPFIGP +pub const IPPROTO_OSPFIGP: ::c_int = 89; +/// Strite RPC protocol +pub const IPPROTO_SRPC: ::c_int = 90; +/// Locus Address Resoloution +pub const IPPROTO_LARP: ::c_int = 91; +/// Multicast Transport +pub const IPPROTO_MTP: ::c_int = 92; +/// AX.25 Frames +pub const IPPROTO_AX25: ::c_int = 93; +/// IP encapsulated in IP +pub const IPPROTO_IPEIP: ::c_int = 94; +/// Mobile Int.ing control +pub const IPPROTO_MICP: ::c_int = 95; +/// Semaphore Comm. security +pub const IPPROTO_SCCSP: ::c_int = 96; +/// Ethernet IP encapsulation +pub const IPPROTO_ETHERIP: ::c_int = 97; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// any private encr. scheme +pub const IPPROTO_APES: ::c_int = 99; +/// GMTP +pub const IPPROTO_GMTP: ::c_int = 100; + +/* 101-254: Partly Unassigned */ +/// Protocol Independent Mcast +pub const IPPROTO_PIM: ::c_int = 103; +/// payload compression (IPComp) +pub const IPPROTO_IPCOMP: ::c_int = 108; +/// PGM +pub const IPPROTO_PGM: ::c_int = 113; +/// SCTP +pub const IPPROTO_SCTP: ::c_int = 132; + +/* 255: Reserved */ +/* BSD Private, local use, namespace incursion */ +/// divert pseudo-protocol +pub const IPPROTO_DIVERT: ::c_int = 254; +/// raw IP packet +pub const IPPROTO_RAW: ::c_int = 255; +pub const IPPROTO_MAX: ::c_int = 256; +/// last return value of *_input(), meaning "all job for this pkt is done". +pub const IPPROTO_DONE: ::c_int = 257; + +pub const AF_UNSPEC: ::c_int = 0; +pub const AF_LOCAL: ::c_int = 1; +pub const AF_UNIX: ::c_int = AF_LOCAL; +pub const AF_INET: ::c_int = 2; +pub const AF_IMPLINK: ::c_int = 3; +pub const AF_PUP: ::c_int = 4; +pub const AF_CHAOS: ::c_int = 5; +pub const AF_NS: ::c_int = 6; +pub const AF_ISO: ::c_int = 7; +pub const AF_OSI: ::c_int = AF_ISO; +pub const AF_ECMA: ::c_int = 8; +pub const AF_DATAKIT: ::c_int = 9; +pub const AF_CCITT: ::c_int = 10; +pub const AF_SNA: ::c_int = 11; +pub const AF_DECnet: ::c_int = 12; +pub const AF_DLI: ::c_int = 13; +pub const AF_LAT: ::c_int = 14; +pub const AF_HYLINK: ::c_int = 15; +pub const AF_APPLETALK: ::c_int = 16; +pub const AF_ROUTE: ::c_int = 17; +pub const AF_LINK: ::c_int = 18; +pub const pseudo_AF_XTP: ::c_int = 19; +pub const AF_COIP: ::c_int = 20; +pub const AF_CNT: ::c_int = 21; +pub const pseudo_AF_RTIP: ::c_int = 22; +pub const AF_IPX: ::c_int = 23; +pub const AF_SIP: ::c_int = 24; +pub const pseudo_AF_PIP: ::c_int = 25; +pub const AF_NDRV: ::c_int = 27; +pub const AF_ISDN: ::c_int = 28; +pub const AF_E164: ::c_int = AF_ISDN; +pub const pseudo_AF_KEY: ::c_int = 29; +pub const AF_INET6: ::c_int = 30; +pub const AF_NATM: ::c_int = 31; +pub const AF_SYSTEM: ::c_int = 32; +pub const AF_NETBIOS: ::c_int = 33; +pub const AF_PPP: ::c_int = 34; +pub const pseudo_AF_HDRCMPLT: ::c_int = 35; +pub const AF_SYS_CONTROL: ::c_int = 2; + +pub const SYSPROTO_EVENT: ::c_int = 1; +pub const SYSPROTO_CONTROL: ::c_int = 2; + +pub const PF_UNSPEC: ::c_int = AF_UNSPEC; +pub const PF_LOCAL: ::c_int = AF_LOCAL; +pub const PF_UNIX: ::c_int = PF_LOCAL; +pub const PF_INET: ::c_int = AF_INET; +pub const PF_IMPLINK: ::c_int = AF_IMPLINK; +pub const PF_PUP: ::c_int = AF_PUP; +pub const PF_CHAOS: ::c_int = AF_CHAOS; +pub const PF_NS: ::c_int = AF_NS; +pub const PF_ISO: ::c_int = AF_ISO; +pub const PF_OSI: ::c_int = AF_ISO; +pub const PF_ECMA: ::c_int = AF_ECMA; +pub const PF_DATAKIT: ::c_int = AF_DATAKIT; +pub const PF_CCITT: ::c_int = AF_CCITT; +pub const PF_SNA: ::c_int = AF_SNA; +pub const PF_DECnet: ::c_int = AF_DECnet; +pub const PF_DLI: ::c_int = AF_DLI; +pub const PF_LAT: ::c_int = AF_LAT; +pub const PF_HYLINK: ::c_int = AF_HYLINK; +pub const PF_APPLETALK: ::c_int = AF_APPLETALK; +pub const PF_ROUTE: ::c_int = AF_ROUTE; +pub const PF_LINK: ::c_int = AF_LINK; +pub const PF_XTP: ::c_int = pseudo_AF_XTP; +pub const PF_COIP: ::c_int = AF_COIP; +pub const PF_CNT: ::c_int = AF_CNT; +pub const PF_SIP: ::c_int = AF_SIP; +pub const PF_IPX: ::c_int = AF_IPX; +pub const PF_RTIP: ::c_int = pseudo_AF_RTIP; +pub const PF_PIP: ::c_int = pseudo_AF_PIP; +pub const PF_NDRV: ::c_int = AF_NDRV; +pub const PF_ISDN: ::c_int = AF_ISDN; +pub const PF_KEY: ::c_int = pseudo_AF_KEY; +pub const PF_INET6: ::c_int = AF_INET6; +pub const PF_NATM: ::c_int = AF_NATM; +pub const PF_SYSTEM: ::c_int = AF_SYSTEM; +pub const PF_NETBIOS: ::c_int = AF_NETBIOS; +pub const PF_PPP: ::c_int = AF_PPP; + +pub const NET_RT_DUMP: ::c_int = 1; +pub const NET_RT_FLAGS: ::c_int = 2; +pub const NET_RT_IFLIST: ::c_int = 3; + +pub const SOMAXCONN: ::c_int = 128; + +pub const SOCK_MAXADDRLEN: ::c_int = 255; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_RAW: ::c_int = 3; +pub const SOCK_RDM: ::c_int = 4; +pub const SOCK_SEQPACKET: ::c_int = 5; +pub const IP_TTL: ::c_int = 4; +pub const IP_HDRINCL: ::c_int = 2; +pub const IP_RECVDSTADDR: ::c_int = 7; +pub const IP_ADD_MEMBERSHIP: ::c_int = 12; +pub const IP_DROP_MEMBERSHIP: ::c_int = 13; +pub const IP_RECVIF: ::c_int = 20; +pub const IP_BOUND_IF: ::c_int = 25; +pub const IP_PKTINFO: ::c_int = 26; +pub const IP_RECVTOS: ::c_int = 27; +pub const IP_DONTFRAG: ::c_int = 28; +pub const IPV6_JOIN_GROUP: ::c_int = 12; +pub const IPV6_LEAVE_GROUP: ::c_int = 13; +pub const IPV6_CHECKSUM: ::c_int = 26; +pub const IPV6_RECVTCLASS: ::c_int = 35; +pub const IPV6_TCLASS: ::c_int = 36; +pub const IPV6_PKTINFO: ::c_int = 46; +pub const IPV6_HOPLIMIT: ::c_int = 47; +pub const IPV6_RECVPKTINFO: ::c_int = 61; +pub const IPV6_DONTFRAG: ::c_int = 62; +pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70; +pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71; +pub const IP_BLOCK_SOURCE: ::c_int = 72; +pub const IP_UNBLOCK_SOURCE: ::c_int = 73; +pub const IPV6_BOUND_IF: ::c_int = 125; + +pub const TCP_NOPUSH: ::c_int = 4; +pub const TCP_NOOPT: ::c_int = 8; +pub const TCP_KEEPALIVE: ::c_int = 0x10; +pub const TCP_KEEPINTVL: ::c_int = 0x101; +pub const TCP_KEEPCNT: ::c_int = 0x102; +/// Enable/Disable TCP Fastopen on this socket +pub const TCP_FASTOPEN: ::c_int = 0x105; + +pub const SOL_LOCAL: ::c_int = 0; + +pub const LOCAL_PEERCRED: ::c_int = 0x001; +pub const LOCAL_PEERPID: ::c_int = 0x002; +pub const LOCAL_PEEREPID: ::c_int = 0x003; +pub const LOCAL_PEERUUID: ::c_int = 0x004; +pub const LOCAL_PEEREUUID: ::c_int = 0x005; + +pub const SOL_SOCKET: ::c_int = 0xffff; + +pub const SO_DEBUG: ::c_int = 0x01; +pub const SO_ACCEPTCONN: ::c_int = 0x0002; +pub const SO_REUSEADDR: ::c_int = 0x0004; +pub const SO_KEEPALIVE: ::c_int = 0x0008; +pub const SO_DONTROUTE: ::c_int = 0x0010; +pub const SO_BROADCAST: ::c_int = 0x0020; +pub const SO_USELOOPBACK: ::c_int = 0x0040; +pub const SO_LINGER: ::c_int = 0x0080; +pub const SO_OOBINLINE: ::c_int = 0x0100; +pub const SO_REUSEPORT: ::c_int = 0x0200; +pub const SO_TIMESTAMP: ::c_int = 0x0400; +pub const SO_TIMESTAMP_MONOTONIC: ::c_int = 0x0800; +pub const SO_DONTTRUNC: ::c_int = 0x2000; +pub const SO_WANTMORE: ::c_int = 0x4000; +pub const SO_WANTOOBFLAG: ::c_int = 0x8000; +pub const SO_SNDBUF: ::c_int = 0x1001; +pub const SO_RCVBUF: ::c_int = 0x1002; +pub const SO_SNDLOWAT: ::c_int = 0x1003; +pub const SO_RCVLOWAT: ::c_int = 0x1004; +pub const SO_SNDTIMEO: ::c_int = 0x1005; +pub const SO_RCVTIMEO: ::c_int = 0x1006; +pub const SO_ERROR: ::c_int = 0x1007; +pub const SO_TYPE: ::c_int = 0x1008; +pub const SO_LABEL: ::c_int = 0x1010; +pub const SO_PEERLABEL: ::c_int = 0x1011; +pub const SO_NREAD: ::c_int = 0x1020; +pub const SO_NKE: ::c_int = 0x1021; +pub const SO_NOSIGPIPE: ::c_int = 0x1022; +pub const SO_NOADDRERR: ::c_int = 0x1023; +pub const SO_NWRITE: ::c_int = 0x1024; +pub const SO_REUSESHAREUID: ::c_int = 0x1025; +pub const SO_NOTIFYCONFLICT: ::c_int = 0x1026; +pub const SO_LINGER_SEC: ::c_int = 0x1080; +pub const SO_RANDOMPORT: ::c_int = 0x1082; +pub const SO_NP_EXTENSIONS: ::c_int = 0x1083; + +pub const MSG_OOB: ::c_int = 0x1; +pub const MSG_PEEK: ::c_int = 0x2; +pub const MSG_DONTROUTE: ::c_int = 0x4; +pub const MSG_EOR: ::c_int = 0x8; +pub const MSG_TRUNC: ::c_int = 0x10; +pub const MSG_CTRUNC: ::c_int = 0x20; +pub const MSG_WAITALL: ::c_int = 0x40; +pub const MSG_DONTWAIT: ::c_int = 0x80; +pub const MSG_EOF: ::c_int = 0x100; +pub const MSG_FLUSH: ::c_int = 0x400; +pub const MSG_HOLD: ::c_int = 0x800; +pub const MSG_SEND: ::c_int = 0x1000; +pub const MSG_HAVEMORE: ::c_int = 0x2000; +pub const MSG_RCVMORE: ::c_int = 0x4000; +// pub const MSG_COMPAT: ::c_int = 0x8000; + +pub const SCM_TIMESTAMP: ::c_int = 0x02; +pub const SCM_CREDS: ::c_int = 0x03; + +// https://github.com/aosm/xnu/blob/master/bsd/net/if.h#L140-L156 +pub const IFF_UP: ::c_int = 0x1; // interface is up +pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid +pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging +pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net +pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link +pub const IFF_NOTRAILERS: ::c_int = 0x20; // obsolete: avoid use of trailers +pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated +pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol +pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets +pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets +pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress +pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions +pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit +pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit +pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit +pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection +pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast + +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; + +pub const SAE_ASSOCID_ANY: ::sae_associd_t = 0; +/// ((sae_associd_t)(-1ULL)) +pub const SAE_ASSOCID_ALL: ::sae_associd_t = 0xffffffff; + +pub const SAE_CONNID_ANY: ::sae_connid_t = 0; +/// ((sae_connid_t)(-1ULL)) +pub const SAE_CONNID_ALL: ::sae_connid_t = 0xffffffff; + +// connectx() flag parameters + +/// resume connect() on read/write +pub const CONNECT_RESUME_ON_READ_WRITE: ::c_uint = 0x1; +/// data is idempotent +pub const CONNECT_DATA_IDEMPOTENT: ::c_uint = 0x2; +/// data includes security that replaces the TFO-cookie +pub const CONNECT_DATA_AUTHENTICATED: ::c_uint = 0x4; + +pub const LOCK_SH: ::c_int = 1; +pub const LOCK_EX: ::c_int = 2; +pub const LOCK_NB: ::c_int = 4; +pub const LOCK_UN: ::c_int = 8; + +pub const MAP_COPY: ::c_int = 0x0002; +pub const MAP_RENAME: ::c_int = 0x0020; +pub const MAP_NORESERVE: ::c_int = 0x0040; +pub const MAP_NOEXTEND: ::c_int = 0x0100; +pub const MAP_HASSEMAPHORE: ::c_int = 0x0200; +pub const MAP_NOCACHE: ::c_int = 0x0400; +pub const MAP_JIT: ::c_int = 0x0800; + +pub const _SC_ARG_MAX: ::c_int = 1; +pub const _SC_CHILD_MAX: ::c_int = 2; +pub const _SC_CLK_TCK: ::c_int = 3; +pub const _SC_NGROUPS_MAX: ::c_int = 4; +pub const _SC_OPEN_MAX: ::c_int = 5; +pub const _SC_JOB_CONTROL: ::c_int = 6; +pub const _SC_SAVED_IDS: ::c_int = 7; +pub const _SC_VERSION: ::c_int = 8; +pub const _SC_BC_BASE_MAX: ::c_int = 9; +pub const _SC_BC_DIM_MAX: ::c_int = 10; +pub const _SC_BC_SCALE_MAX: ::c_int = 11; +pub const _SC_BC_STRING_MAX: ::c_int = 12; +pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13; +pub const _SC_EXPR_NEST_MAX: ::c_int = 14; +pub const _SC_LINE_MAX: ::c_int = 15; +pub const _SC_RE_DUP_MAX: ::c_int = 16; +pub const _SC_2_VERSION: ::c_int = 17; +pub const _SC_2_C_BIND: ::c_int = 18; +pub const _SC_2_C_DEV: ::c_int = 19; +pub const _SC_2_CHAR_TERM: ::c_int = 20; +pub const _SC_2_FORT_DEV: ::c_int = 21; +pub const _SC_2_FORT_RUN: ::c_int = 22; +pub const _SC_2_LOCALEDEF: ::c_int = 23; +pub const _SC_2_SW_DEV: ::c_int = 24; +pub const _SC_2_UPE: ::c_int = 25; +pub const _SC_STREAM_MAX: ::c_int = 26; +pub const _SC_TZNAME_MAX: ::c_int = 27; +pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28; +pub const _SC_PAGESIZE: ::c_int = 29; +pub const _SC_MEMLOCK: ::c_int = 30; +pub const _SC_MEMLOCK_RANGE: ::c_int = 31; +pub const _SC_MEMORY_PROTECTION: ::c_int = 32; +pub const _SC_MESSAGE_PASSING: ::c_int = 33; +pub const _SC_PRIORITIZED_IO: ::c_int = 34; +pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35; +pub const _SC_REALTIME_SIGNALS: ::c_int = 36; +pub const _SC_SEMAPHORES: ::c_int = 37; +pub const _SC_FSYNC: ::c_int = 38; +pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39; +pub const _SC_SYNCHRONIZED_IO: ::c_int = 40; +pub const _SC_TIMERS: ::c_int = 41; +pub const _SC_AIO_LISTIO_MAX: ::c_int = 42; +pub const _SC_AIO_MAX: ::c_int = 43; +pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44; +pub const _SC_DELAYTIMER_MAX: ::c_int = 45; +pub const _SC_MQ_OPEN_MAX: ::c_int = 46; +pub const _SC_MAPPED_FILES: ::c_int = 47; +pub const _SC_RTSIG_MAX: ::c_int = 48; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 49; +pub const _SC_SEM_VALUE_MAX: ::c_int = 50; +pub const _SC_SIGQUEUE_MAX: ::c_int = 51; +pub const _SC_TIMER_MAX: ::c_int = 52; +pub const _SC_NPROCESSORS_CONF: ::c_int = 57; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 58; +pub const _SC_2_PBS: ::c_int = 59; +pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60; +pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61; +pub const _SC_2_PBS_LOCATE: ::c_int = 62; +pub const _SC_2_PBS_MESSAGE: ::c_int = 63; +pub const _SC_2_PBS_TRACK: ::c_int = 64; +pub const _SC_ADVISORY_INFO: ::c_int = 65; +pub const _SC_BARRIERS: ::c_int = 66; +pub const _SC_CLOCK_SELECTION: ::c_int = 67; +pub const _SC_CPUTIME: ::c_int = 68; +pub const _SC_FILE_LOCKING: ::c_int = 69; +pub const _SC_HOST_NAME_MAX: ::c_int = 72; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 74; +pub const _SC_READER_WRITER_LOCKS: ::c_int = 76; +pub const _SC_REGEXP: ::c_int = 77; +pub const _SC_SHELL: ::c_int = 78; +pub const _SC_SPAWN: ::c_int = 79; +pub const _SC_SPIN_LOCKS: ::c_int = 80; +pub const _SC_SPORADIC_SERVER: ::c_int = 81; +pub const _SC_THREAD_CPUTIME: ::c_int = 84; +pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92; +pub const _SC_TIMEOUTS: ::c_int = 95; +pub const _SC_TRACE: ::c_int = 97; +pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98; +pub const _SC_TRACE_INHERIT: ::c_int = 99; +pub const _SC_TRACE_LOG: ::c_int = 100; +pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102; +pub const _SC_V6_ILP32_OFF32: ::c_int = 103; +pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104; +pub const _SC_V6_LP64_OFF64: ::c_int = 105; +pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106; +pub const _SC_IPV6: ::c_int = 118; +pub const _SC_RAW_SOCKETS: ::c_int = 119; +pub const _SC_SYMLOOP_MAX: ::c_int = 120; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; +pub const _SC_XOPEN_STREAMS: ::c_int = 114; +pub const _SC_XBS5_ILP32_OFF32: ::c_int = 122; +pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 123; +pub const _SC_XBS5_LP64_OFF64: ::c_int = 124; +pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 125; +pub const _SC_SS_REPL_MAX: ::c_int = 126; +pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 127; +pub const _SC_TRACE_NAME_MAX: ::c_int = 128; +pub const _SC_TRACE_SYS_MAX: ::c_int = 129; +pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130; +pub const _SC_PASS_MAX: ::c_int = 131; + +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; +pub const _PTHREAD_MUTEX_SIG_init: ::c_long = 0x32AAABA7; +pub const _PTHREAD_COND_SIG_init: ::c_long = 0x3CB0B1BB; +pub const _PTHREAD_RWLOCK_SIG_init: ::c_long = 0x2DA8B3B4; +pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + __sig: _PTHREAD_MUTEX_SIG_init, + __opaque: [0; __PTHREAD_MUTEX_SIZE__], +}; +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + __sig: _PTHREAD_COND_SIG_init, + __opaque: [0; __PTHREAD_COND_SIZE__], +}; +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + __sig: _PTHREAD_RWLOCK_SIG_init, + __opaque: [0; __PTHREAD_RWLOCK_SIZE__], +}; + +pub const MINSIGSTKSZ: ::size_t = 32768; +pub const SIGSTKSZ: ::size_t = 131072; + +pub const FD_SETSIZE: usize = 1024; + +pub const ST_NOSUID: ::c_ulong = 2; + +pub const SCHED_OTHER: ::c_int = 1; +pub const SCHED_FIFO: ::c_int = 4; +pub const SCHED_RR: ::c_int = 2; + +pub const EVFILT_READ: i16 = -1; +pub const EVFILT_WRITE: i16 = -2; +pub const EVFILT_AIO: i16 = -3; +pub const EVFILT_VNODE: i16 = -4; +pub const EVFILT_PROC: i16 = -5; +pub const EVFILT_SIGNAL: i16 = -6; +pub const EVFILT_TIMER: i16 = -7; +pub const EVFILT_MACHPORT: i16 = -8; +pub const EVFILT_FS: i16 = -9; +pub const EVFILT_USER: i16 = -10; +pub const EVFILT_VM: i16 = -12; + +pub const EV_ADD: u16 = 0x1; +pub const EV_DELETE: u16 = 0x2; +pub const EV_ENABLE: u16 = 0x4; +pub const EV_DISABLE: u16 = 0x8; +pub const EV_ONESHOT: u16 = 0x10; +pub const EV_CLEAR: u16 = 0x20; +pub const EV_RECEIPT: u16 = 0x40; +pub const EV_DISPATCH: u16 = 0x80; +pub const EV_FLAG0: u16 = 0x1000; +pub const EV_POLL: u16 = 0x1000; +pub const EV_FLAG1: u16 = 0x2000; +pub const EV_OOBAND: u16 = 0x2000; +pub const EV_ERROR: u16 = 0x4000; +pub const EV_EOF: u16 = 0x8000; +pub const EV_SYSFLAGS: u16 = 0xf000; + +pub const NOTE_TRIGGER: u32 = 0x01000000; +pub const NOTE_FFNOP: u32 = 0x00000000; +pub const NOTE_FFAND: u32 = 0x40000000; +pub const NOTE_FFOR: u32 = 0x80000000; +pub const NOTE_FFCOPY: u32 = 0xc0000000; +pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; +pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; +pub const NOTE_LOWAT: u32 = 0x00000001; +pub const NOTE_DELETE: u32 = 0x00000001; +pub const NOTE_WRITE: u32 = 0x00000002; +pub const NOTE_EXTEND: u32 = 0x00000004; +pub const NOTE_ATTRIB: u32 = 0x00000008; +pub const NOTE_LINK: u32 = 0x00000010; +pub const NOTE_RENAME: u32 = 0x00000020; +pub const NOTE_REVOKE: u32 = 0x00000040; +pub const NOTE_NONE: u32 = 0x00000080; +pub const NOTE_EXIT: u32 = 0x80000000; +pub const NOTE_FORK: u32 = 0x40000000; +pub const NOTE_EXEC: u32 = 0x20000000; +#[doc(hidden)] +#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")] +pub const NOTE_REAP: u32 = 0x10000000; +pub const NOTE_SIGNAL: u32 = 0x08000000; +pub const NOTE_EXITSTATUS: u32 = 0x04000000; +pub const NOTE_EXIT_DETAIL: u32 = 0x02000000; +pub const NOTE_PDATAMASK: u32 = 0x000fffff; +pub const NOTE_PCTRLMASK: u32 = 0xfff00000; +#[doc(hidden)] +#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")] +pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000; +pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000; +pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000; +pub const NOTE_EXIT_MEMORY: u32 = 0x00020000; +pub const NOTE_EXIT_CSERROR: u32 = 0x00040000; +pub const NOTE_VM_PRESSURE: u32 = 0x80000000; +pub const NOTE_VM_PRESSURE_TERMINATE: u32 = 0x40000000; +pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: u32 = 0x20000000; +pub const NOTE_VM_ERROR: u32 = 0x10000000; +pub const NOTE_SECONDS: u32 = 0x00000001; +pub const NOTE_USECONDS: u32 = 0x00000002; +pub const NOTE_NSECONDS: u32 = 0x00000004; +pub const NOTE_ABSOLUTE: u32 = 0x00000008; +pub const NOTE_LEEWAY: u32 = 0x00000010; +pub const NOTE_CRITICAL: u32 = 0x00000020; +pub const NOTE_BACKGROUND: u32 = 0x00000040; +pub const NOTE_TRACK: u32 = 0x00000001; +pub const NOTE_TRACKERR: u32 = 0x00000002; +pub const NOTE_CHILD: u32 = 0x00000004; + +pub const OCRNL: ::tcflag_t = 0x00000010; +pub const ONOCR: ::tcflag_t = 0x00000020; +pub const ONLRET: ::tcflag_t = 0x00000040; +pub const OFILL: ::tcflag_t = 0x00000080; +pub const NLDLY: ::tcflag_t = 0x00000300; +pub const TABDLY: ::tcflag_t = 0x00000c04; +pub const CRDLY: ::tcflag_t = 0x00003000; +pub const FFDLY: ::tcflag_t = 0x00004000; +pub const BSDLY: ::tcflag_t = 0x00008000; +pub const VTDLY: ::tcflag_t = 0x00010000; +pub const OFDEL: ::tcflag_t = 0x00020000; + +pub const NL0: ::tcflag_t = 0x00000000; +pub const NL1: ::tcflag_t = 0x00000100; +pub const TAB0: ::tcflag_t = 0x00000000; +pub const TAB1: ::tcflag_t = 0x00000400; +pub const TAB2: ::tcflag_t = 0x00000800; +pub const CR0: ::tcflag_t = 0x00000000; +pub const CR1: ::tcflag_t = 0x00001000; +pub const CR2: ::tcflag_t = 0x00002000; +pub const CR3: ::tcflag_t = 0x00003000; +pub const FF0: ::tcflag_t = 0x00000000; +pub const FF1: ::tcflag_t = 0x00004000; +pub const BS0: ::tcflag_t = 0x00000000; +pub const BS1: ::tcflag_t = 0x00008000; +pub const TAB3: ::tcflag_t = 0x00000004; +pub const VT0: ::tcflag_t = 0x00000000; +pub const VT1: ::tcflag_t = 0x00010000; +pub const IUTF8: ::tcflag_t = 0x00004000; +pub const CRTSCTS: ::tcflag_t = 0x00030000; + +pub const NI_MAXHOST: ::socklen_t = 1025; +pub const NI_MAXSERV: ::socklen_t = 32; +pub const NI_NOFQDN: ::c_int = 0x00000001; +pub const NI_NUMERICHOST: ::c_int = 0x00000002; +pub const NI_NAMEREQD: ::c_int = 0x00000004; +pub const NI_NUMERICSERV: ::c_int = 0x00000008; +pub const NI_NUMERICSCOPE: ::c_int = 0x00000100; +pub const NI_DGRAM: ::c_int = 0x00000010; + +pub const Q_GETQUOTA: ::c_int = 0x300; +pub const Q_SETQUOTA: ::c_int = 0x400; + +pub const RENAME_SWAP: ::c_uint = 0x00000002; +pub const RENAME_EXCL: ::c_uint = 0x00000004; + +pub const RTLD_LOCAL: ::c_int = 0x4; +pub const RTLD_FIRST: ::c_int = 0x100; +pub const RTLD_NODELETE: ::c_int = 0x80; +pub const RTLD_NOLOAD: ::c_int = 0x10; +pub const RTLD_GLOBAL: ::c_int = 0x8; + +pub const _WSTOPPED: ::c_int = 0o177; + +pub const LOG_NETINFO: ::c_int = 12 << 3; +pub const LOG_REMOTEAUTH: ::c_int = 13 << 3; +pub const LOG_INSTALL: ::c_int = 14 << 3; +pub const LOG_RAS: ::c_int = 15 << 3; +pub const LOG_LAUNCHD: ::c_int = 24 << 3; +pub const LOG_NFACILITIES: ::c_int = 25; + +pub const CTLTYPE: ::c_int = 0xf; +pub const CTLTYPE_NODE: ::c_int = 1; +pub const CTLTYPE_INT: ::c_int = 2; +pub const CTLTYPE_STRING: ::c_int = 3; +pub const CTLTYPE_QUAD: ::c_int = 4; +pub const CTLTYPE_OPAQUE: ::c_int = 5; +pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE; +pub const CTLFLAG_RD: ::c_int = 0x80000000; +pub const CTLFLAG_WR: ::c_int = 0x40000000; +pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR; +pub const CTLFLAG_NOLOCK: ::c_int = 0x20000000; +pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000; +pub const CTLFLAG_SECURE: ::c_int = 0x08000000; +pub const CTLFLAG_MASKED: ::c_int = 0x04000000; +pub const CTLFLAG_NOAUTO: ::c_int = 0x02000000; +pub const CTLFLAG_KERN: ::c_int = 0x01000000; +pub const CTLFLAG_LOCKED: ::c_int = 0x00800000; +pub const CTLFLAG_OID2: ::c_int = 0x00400000; +pub const CTL_UNSPEC: ::c_int = 0; +pub const CTL_KERN: ::c_int = 1; +pub const CTL_VM: ::c_int = 2; +pub const CTL_VFS: ::c_int = 3; +pub const CTL_NET: ::c_int = 4; +pub const CTL_DEBUG: ::c_int = 5; +pub const CTL_HW: ::c_int = 6; +pub const CTL_MACHDEP: ::c_int = 7; +pub const CTL_USER: ::c_int = 8; +pub const CTL_MAXID: ::c_int = 9; +pub const KERN_OSTYPE: ::c_int = 1; +pub const KERN_OSRELEASE: ::c_int = 2; +pub const KERN_OSREV: ::c_int = 3; +pub const KERN_VERSION: ::c_int = 4; +pub const KERN_MAXVNODES: ::c_int = 5; +pub const KERN_MAXPROC: ::c_int = 6; +pub const KERN_MAXFILES: ::c_int = 7; +pub const KERN_ARGMAX: ::c_int = 8; +pub const KERN_SECURELVL: ::c_int = 9; +pub const KERN_HOSTNAME: ::c_int = 10; +pub const KERN_HOSTID: ::c_int = 11; +pub const KERN_CLOCKRATE: ::c_int = 12; +pub const KERN_VNODE: ::c_int = 13; +pub const KERN_PROC: ::c_int = 14; +pub const KERN_FILE: ::c_int = 15; +pub const KERN_PROF: ::c_int = 16; +pub const KERN_POSIX1: ::c_int = 17; +pub const KERN_NGROUPS: ::c_int = 18; +pub const KERN_JOB_CONTROL: ::c_int = 19; +pub const KERN_SAVED_IDS: ::c_int = 20; +pub const KERN_BOOTTIME: ::c_int = 21; +pub const KERN_NISDOMAINNAME: ::c_int = 22; +pub const KERN_DOMAINNAME: ::c_int = KERN_NISDOMAINNAME; +pub const KERN_MAXPARTITIONS: ::c_int = 23; +pub const KERN_KDEBUG: ::c_int = 24; +pub const KERN_UPDATEINTERVAL: ::c_int = 25; +pub const KERN_OSRELDATE: ::c_int = 26; +pub const KERN_NTP_PLL: ::c_int = 27; +pub const KERN_BOOTFILE: ::c_int = 28; +pub const KERN_MAXFILESPERPROC: ::c_int = 29; +pub const KERN_MAXPROCPERUID: ::c_int = 30; +pub const KERN_DUMPDEV: ::c_int = 31; +pub const KERN_IPC: ::c_int = 32; +pub const KERN_DUMMY: ::c_int = 33; +pub const KERN_PS_STRINGS: ::c_int = 34; +pub const KERN_USRSTACK32: ::c_int = 35; +pub const KERN_LOGSIGEXIT: ::c_int = 36; +pub const KERN_SYMFILE: ::c_int = 37; +pub const KERN_PROCARGS: ::c_int = 38; +pub const KERN_NETBOOT: ::c_int = 40; +pub const KERN_SYSV: ::c_int = 42; +pub const KERN_AFFINITY: ::c_int = 43; +pub const KERN_TRANSLATE: ::c_int = 44; +pub const KERN_CLASSIC: ::c_int = KERN_TRANSLATE; +pub const KERN_EXEC: ::c_int = 45; +pub const KERN_CLASSICHANDLER: ::c_int = KERN_EXEC; +pub const KERN_AIOMAX: ::c_int = 46; +pub const KERN_AIOPROCMAX: ::c_int = 47; +pub const KERN_AIOTHREADS: ::c_int = 48; +pub const KERN_COREFILE: ::c_int = 50; +pub const KERN_COREDUMP: ::c_int = 51; +pub const KERN_SUGID_COREDUMP: ::c_int = 52; +pub const KERN_PROCDELAYTERM: ::c_int = 53; +pub const KERN_SHREG_PRIVATIZABLE: ::c_int = 54; +pub const KERN_LOW_PRI_WINDOW: ::c_int = 56; +pub const KERN_LOW_PRI_DELAY: ::c_int = 57; +pub const KERN_POSIX: ::c_int = 58; +pub const KERN_USRSTACK64: ::c_int = 59; +pub const KERN_NX_PROTECTION: ::c_int = 60; +pub const KERN_TFP: ::c_int = 61; +pub const KERN_PROCNAME: ::c_int = 62; +pub const KERN_THALTSTACK: ::c_int = 63; +pub const KERN_SPECULATIVE_READS: ::c_int = 64; +pub const KERN_OSVERSION: ::c_int = 65; +pub const KERN_SAFEBOOT: ::c_int = 66; +pub const KERN_RAGEVNODE: ::c_int = 68; +pub const KERN_TTY: ::c_int = 69; +pub const KERN_CHECKOPENEVT: ::c_int = 70; +pub const KERN_THREADNAME: ::c_int = 71; +pub const KERN_MAXID: ::c_int = 72; +pub const KERN_RAGE_PROC: ::c_int = 1; +pub const KERN_RAGE_THREAD: ::c_int = 2; +pub const KERN_UNRAGE_PROC: ::c_int = 3; +pub const KERN_UNRAGE_THREAD: ::c_int = 4; +pub const KERN_OPENEVT_PROC: ::c_int = 1; +pub const KERN_UNOPENEVT_PROC: ::c_int = 2; +pub const KERN_TFP_POLICY: ::c_int = 1; +pub const KERN_TFP_POLICY_DENY: ::c_int = 0; +pub const KERN_TFP_POLICY_DEFAULT: ::c_int = 2; +pub const KERN_KDEFLAGS: ::c_int = 1; +pub const KERN_KDDFLAGS: ::c_int = 2; +pub const KERN_KDENABLE: ::c_int = 3; +pub const KERN_KDSETBUF: ::c_int = 4; +pub const KERN_KDGETBUF: ::c_int = 5; +pub const KERN_KDSETUP: ::c_int = 6; +pub const KERN_KDREMOVE: ::c_int = 7; +pub const KERN_KDSETREG: ::c_int = 8; +pub const KERN_KDGETREG: ::c_int = 9; +pub const KERN_KDREADTR: ::c_int = 10; +pub const KERN_KDPIDTR: ::c_int = 11; +pub const KERN_KDTHRMAP: ::c_int = 12; +pub const KERN_KDPIDEX: ::c_int = 14; +pub const KERN_KDSETRTCDEC: ::c_int = 15; +pub const KERN_KDGETENTROPY: ::c_int = 16; +pub const KERN_KDWRITETR: ::c_int = 17; +pub const KERN_KDWRITEMAP: ::c_int = 18; +#[doc(hidden)] +#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")] +pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19; +#[doc(hidden)] +#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")] +pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20; +pub const KERN_KDREADCURTHRMAP: ::c_int = 21; +pub const KERN_KDSET_TYPEFILTER: ::c_int = 22; +pub const KERN_KDBUFWAIT: ::c_int = 23; +pub const KERN_KDCPUMAP: ::c_int = 24; +pub const KERN_PROC_ALL: ::c_int = 0; +pub const KERN_PROC_PID: ::c_int = 1; +pub const KERN_PROC_PGRP: ::c_int = 2; +pub const KERN_PROC_SESSION: ::c_int = 3; +pub const KERN_PROC_TTY: ::c_int = 4; +pub const KERN_PROC_UID: ::c_int = 5; +pub const KERN_PROC_RUID: ::c_int = 6; +pub const KERN_PROC_LCID: ::c_int = 7; +pub const KERN_SUCCESS: ::c_int = 0; +pub const KERN_INVALID_ADDRESS: ::c_int = 1; +pub const KERN_PROTECTION_FAILURE: ::c_int = 2; +pub const KERN_NO_SPACE: ::c_int = 3; +pub const KERN_INVALID_ARGUMENT: ::c_int = 4; +pub const KERN_FAILURE: ::c_int = 5; +pub const KERN_RESOURCE_SHORTAGE: ::c_int = 6; +pub const KERN_NOT_RECEIVER: ::c_int = 7; +pub const KERN_NO_ACCESS: ::c_int = 8; +pub const KERN_MEMORY_FAILURE: ::c_int = 9; +pub const KERN_MEMORY_ERROR: ::c_int = 10; +pub const KERN_ALREADY_IN_SET: ::c_int = 11; +pub const KERN_NOT_IN_SET: ::c_int = 12; +pub const KERN_NAME_EXISTS: ::c_int = 13; +pub const KERN_ABORTED: ::c_int = 14; +pub const KERN_INVALID_NAME: ::c_int = 15; +pub const KERN_INVALID_TASK: ::c_int = 16; +pub const KERN_INVALID_RIGHT: ::c_int = 17; +pub const KERN_INVALID_VALUE: ::c_int = 18; +pub const KERN_UREFS_OVERFLOW: ::c_int = 19; +pub const KERN_INVALID_CAPABILITY: ::c_int = 20; +pub const KERN_RIGHT_EXISTS: ::c_int = 21; +pub const KERN_INVALID_HOST: ::c_int = 22; +pub const KERN_MEMORY_PRESENT: ::c_int = 23; +pub const KERN_MEMORY_DATA_MOVED: ::c_int = 24; +pub const KERN_MEMORY_RESTART_COPY: ::c_int = 25; +pub const KERN_INVALID_PROCESSOR_SET: ::c_int = 26; +pub const KERN_POLICY_LIMIT: ::c_int = 27; +pub const KERN_INVALID_POLICY: ::c_int = 28; +pub const KERN_INVALID_OBJECT: ::c_int = 29; +pub const KERN_ALREADY_WAITING: ::c_int = 30; +pub const KERN_DEFAULT_SET: ::c_int = 31; +pub const KERN_EXCEPTION_PROTECTED: ::c_int = 32; +pub const KERN_INVALID_LEDGER: ::c_int = 33; +pub const KERN_INVALID_MEMORY_CONTROL: ::c_int = 34; +pub const KERN_INVALID_SECURITY: ::c_int = 35; +pub const KERN_NOT_DEPRESSED: ::c_int = 36; +pub const KERN_TERMINATED: ::c_int = 37; +pub const KERN_LOCK_SET_DESTROYED: ::c_int = 38; +pub const KERN_LOCK_UNSTABLE: ::c_int = 39; +pub const KERN_LOCK_OWNED: ::c_int = 40; +pub const KERN_LOCK_OWNED_SELF: ::c_int = 41; +pub const KERN_SEMAPHORE_DESTROYED: ::c_int = 42; +pub const KERN_RPC_SERVER_TERMINATED: ::c_int = 43; +pub const KERN_RPC_TERMINATE_ORPHAN: ::c_int = 44; +pub const KERN_RPC_CONTINUE_ORPHAN: ::c_int = 45; +pub const KERN_NOT_SUPPORTED: ::c_int = 46; +pub const KERN_NODE_DOWN: ::c_int = 47; +pub const KERN_NOT_WAITING: ::c_int = 48; +pub const KERN_OPERATION_TIMED_OUT: ::c_int = 49; +pub const KERN_CODESIGN_ERROR: ::c_int = 50; +pub const KERN_POLICY_STATIC: ::c_int = 51; +pub const KERN_INSUFFICIENT_BUFFER_SIZE: ::c_int = 52; +pub const KIPC_MAXSOCKBUF: ::c_int = 1; +pub const KIPC_SOCKBUF_WASTE: ::c_int = 2; +pub const KIPC_SOMAXCONN: ::c_int = 3; +pub const KIPC_MAX_LINKHDR: ::c_int = 4; +pub const KIPC_MAX_PROTOHDR: ::c_int = 5; +pub const KIPC_MAX_HDR: ::c_int = 6; +pub const KIPC_MAX_DATALEN: ::c_int = 7; +pub const KIPC_MBSTAT: ::c_int = 8; +pub const KIPC_NMBCLUSTERS: ::c_int = 9; +pub const KIPC_SOQLIMITCOMPAT: ::c_int = 10; +pub const VM_METER: ::c_int = 1; +pub const VM_LOADAVG: ::c_int = 2; +pub const VM_MACHFACTOR: ::c_int = 4; +pub const VM_SWAPUSAGE: ::c_int = 5; +pub const VM_MAXID: ::c_int = 6; +pub const VM_PROT_NONE: ::vm_prot_t = 0x00; +pub const VM_PROT_READ: ::vm_prot_t = 0x01; +pub const VM_PROT_WRITE: ::vm_prot_t = 0x02; +pub const VM_PROT_EXECUTE: ::vm_prot_t = 0x04; +pub const MEMORY_OBJECT_NULL: ::memory_object_t = 0; +pub const HW_MACHINE: ::c_int = 1; +pub const HW_MODEL: ::c_int = 2; +pub const HW_NCPU: ::c_int = 3; +pub const HW_BYTEORDER: ::c_int = 4; +pub const HW_PHYSMEM: ::c_int = 5; +pub const HW_USERMEM: ::c_int = 6; +pub const HW_PAGESIZE: ::c_int = 7; +pub const HW_DISKNAMES: ::c_int = 8; +pub const HW_DISKSTATS: ::c_int = 9; +pub const HW_EPOCH: ::c_int = 10; +pub const HW_FLOATINGPT: ::c_int = 11; +pub const HW_MACHINE_ARCH: ::c_int = 12; +pub const HW_VECTORUNIT: ::c_int = 13; +pub const HW_BUS_FREQ: ::c_int = 14; +pub const HW_CPU_FREQ: ::c_int = 15; +pub const HW_CACHELINE: ::c_int = 16; +pub const HW_L1ICACHESIZE: ::c_int = 17; +pub const HW_L1DCACHESIZE: ::c_int = 18; +pub const HW_L2SETTINGS: ::c_int = 19; +pub const HW_L2CACHESIZE: ::c_int = 20; +pub const HW_L3SETTINGS: ::c_int = 21; +pub const HW_L3CACHESIZE: ::c_int = 22; +pub const HW_TB_FREQ: ::c_int = 23; +pub const HW_MEMSIZE: ::c_int = 24; +pub const HW_AVAILCPU: ::c_int = 25; +pub const HW_TARGET: ::c_int = 26; +pub const HW_PRODUCT: ::c_int = 27; +pub const HW_MAXID: ::c_int = 28; +pub const USER_CS_PATH: ::c_int = 1; +pub const USER_BC_BASE_MAX: ::c_int = 2; +pub const USER_BC_DIM_MAX: ::c_int = 3; +pub const USER_BC_SCALE_MAX: ::c_int = 4; +pub const USER_BC_STRING_MAX: ::c_int = 5; +pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6; +pub const USER_EXPR_NEST_MAX: ::c_int = 7; +pub const USER_LINE_MAX: ::c_int = 8; +pub const USER_RE_DUP_MAX: ::c_int = 9; +pub const USER_POSIX2_VERSION: ::c_int = 10; +pub const USER_POSIX2_C_BIND: ::c_int = 11; +pub const USER_POSIX2_C_DEV: ::c_int = 12; +pub const USER_POSIX2_CHAR_TERM: ::c_int = 13; +pub const USER_POSIX2_FORT_DEV: ::c_int = 14; +pub const USER_POSIX2_FORT_RUN: ::c_int = 15; +pub const USER_POSIX2_LOCALEDEF: ::c_int = 16; +pub const USER_POSIX2_SW_DEV: ::c_int = 17; +pub const USER_POSIX2_UPE: ::c_int = 18; +pub const USER_STREAM_MAX: ::c_int = 19; +pub const USER_TZNAME_MAX: ::c_int = 20; +pub const USER_MAXID: ::c_int = 21; +pub const CTL_DEBUG_NAME: ::c_int = 0; +pub const CTL_DEBUG_VALUE: ::c_int = 1; +pub const CTL_DEBUG_MAXID: ::c_int = 20; + +pub const PRIO_DARWIN_THREAD: ::c_int = 3; +pub const PRIO_DARWIN_PROCESS: ::c_int = 4; +pub const PRIO_DARWIN_BG: ::c_int = 0x1000; +pub const PRIO_DARWIN_NONUI: ::c_int = 0x1001; + +pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t; + +pub const AI_PASSIVE: ::c_int = 0x00000001; +pub const AI_CANONNAME: ::c_int = 0x00000002; +pub const AI_NUMERICHOST: ::c_int = 0x00000004; +pub const AI_NUMERICSERV: ::c_int = 0x00001000; +pub const AI_MASK: ::c_int = + AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG; +pub const AI_ALL: ::c_int = 0x00000100; +pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200; +pub const AI_ADDRCONFIG: ::c_int = 0x00000400; +pub const AI_V4MAPPED: ::c_int = 0x00000800; +pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG; +pub const AI_UNUSABLE: ::c_int = 0x10000000; + +pub const SIGEV_NONE: ::c_int = 0; +pub const SIGEV_SIGNAL: ::c_int = 1; +pub const SIGEV_THREAD: ::c_int = 3; + +pub const AIO_CANCELED: ::c_int = 2; +pub const AIO_NOTCANCELED: ::c_int = 4; +pub const AIO_ALLDONE: ::c_int = 1; +#[deprecated( + since = "0.2.64", + note = "Can vary at runtime. Use sysconf(3) instead" +)] +pub const AIO_LISTIO_MAX: ::c_int = 16; +pub const LIO_NOP: ::c_int = 0; +pub const LIO_WRITE: ::c_int = 2; +pub const LIO_READ: ::c_int = 1; +pub const LIO_WAIT: ::c_int = 2; +pub const LIO_NOWAIT: ::c_int = 1; + +pub const WEXITED: ::c_int = 0x00000004; +pub const WSTOPPED: ::c_int = 0x00000008; +pub const WCONTINUED: ::c_int = 0x00000010; +pub const WNOWAIT: ::c_int = 0x00000020; + +pub const P_ALL: idtype_t = 0; +pub const P_PID: idtype_t = 1; +pub const P_PGID: idtype_t = 2; + +pub const UTIME_OMIT: c_long = -2; +pub const UTIME_NOW: c_long = -1; + +pub const XATTR_NOFOLLOW: ::c_int = 0x0001; +pub const XATTR_CREATE: ::c_int = 0x0002; +pub const XATTR_REPLACE: ::c_int = 0x0004; +pub const XATTR_NOSECURITY: ::c_int = 0x0008; +pub const XATTR_NODEFAULT: ::c_int = 0x0010; +pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020; + +pub const NET_RT_IFLIST2: ::c_int = 0x0006; + +// net/route.h +pub const RTF_UP: ::c_int = 0x1; +pub const RTF_GATEWAY: ::c_int = 0x2; +pub const RTF_HOST: ::c_int = 0x4; +pub const RTF_REJECT: ::c_int = 0x8; +pub const RTF_DYNAMIC: ::c_int = 0x10; +pub const RTF_MODIFIED: ::c_int = 0x20; +pub const RTF_DONE: ::c_int = 0x40; +pub const RTF_DELCLONE: ::c_int = 0x80; +pub const RTF_CLONING: ::c_int = 0x100; +pub const RTF_XRESOLVE: ::c_int = 0x200; +pub const RTF_LLINFO: ::c_int = 0x400; +pub const RTF_STATIC: ::c_int = 0x800; +pub const RTF_BLACKHOLE: ::c_int = 0x1000; +pub const RTF_NOIFREF: ::c_int = 0x2000; +pub const RTF_PROTO2: ::c_int = 0x4000; +pub const RTF_PROTO1: ::c_int = 0x8000; +pub const RTF_PRCLONING: ::c_int = 0x10000; +pub const RTF_WASCLONED: ::c_int = 0x20000; +pub const RTF_PROTO3: ::c_int = 0x40000; +pub const RTF_PINNED: ::c_int = 0x100000; +pub const RTF_LOCAL: ::c_int = 0x200000; +pub const RTF_BROADCAST: ::c_int = 0x400000; +pub const RTF_MULTICAST: ::c_int = 0x800000; +pub const RTF_IFSCOPE: ::c_int = 0x1000000; +pub const RTF_CONDEMNED: ::c_int = 0x2000000; +pub const RTF_IFREF: ::c_int = 0x4000000; +pub const RTF_PROXY: ::c_int = 0x8000000; +pub const RTF_ROUTER: ::c_int = 0x10000000; +pub const RTF_DEAD: ::c_int = 0x20000000; +pub const RTF_GLOBAL: ::c_int = 0x40000000; + +pub const RTM_VERSION: ::c_int = 5; + +// Message types +pub const RTM_ADD: ::c_int = 0x1; +pub const RTM_DELETE: ::c_int = 0x2; +pub const RTM_CHANGE: ::c_int = 0x3; +pub const RTM_GET: ::c_int = 0x4; +pub const RTM_LOSING: ::c_int = 0x5; +pub const RTM_REDIRECT: ::c_int = 0x6; +pub const RTM_MISS: ::c_int = 0x7; +pub const RTM_LOCK: ::c_int = 0x8; +pub const RTM_OLDADD: ::c_int = 0x9; +pub const RTM_OLDDEL: ::c_int = 0xa; +pub const RTM_RESOLVE: ::c_int = 0xb; +pub const RTM_NEWADDR: ::c_int = 0xc; +pub const RTM_DELADDR: ::c_int = 0xd; +pub const RTM_IFINFO: ::c_int = 0xe; +pub const RTM_NEWMADDR: ::c_int = 0xf; +pub const RTM_DELMADDR: ::c_int = 0x10; +pub const RTM_IFINFO2: ::c_int = 0x12; +pub const RTM_NEWMADDR2: ::c_int = 0x13; +pub const RTM_GET2: ::c_int = 0x14; + +// Bitmask values for rtm_inits and rmx_locks. +pub const RTV_MTU: ::c_int = 0x1; +pub const RTV_HOPCOUNT: ::c_int = 0x2; +pub const RTV_EXPIRE: ::c_int = 0x4; +pub const RTV_RPIPE: ::c_int = 0x8; +pub const RTV_SPIPE: ::c_int = 0x10; +pub const RTV_SSTHRESH: ::c_int = 0x20; +pub const RTV_RTT: ::c_int = 0x40; +pub const RTV_RTTVAR: ::c_int = 0x80; + +// Bitmask values for rtm_addrs. +pub const RTA_DST: ::c_int = 0x1; +pub const RTA_GATEWAY: ::c_int = 0x2; +pub const RTA_NETMASK: ::c_int = 0x4; +pub const RTA_GENMASK: ::c_int = 0x8; +pub const RTA_IFP: ::c_int = 0x10; +pub const RTA_IFA: ::c_int = 0x20; +pub const RTA_AUTHOR: ::c_int = 0x40; +pub const RTA_BRD: ::c_int = 0x80; + +// Index offsets for sockaddr array for alternate internal encoding. +pub const RTAX_DST: ::c_int = 0; +pub const RTAX_GATEWAY: ::c_int = 1; +pub const RTAX_NETMASK: ::c_int = 2; +pub const RTAX_GENMASK: ::c_int = 3; +pub const RTAX_IFP: ::c_int = 4; +pub const RTAX_IFA: ::c_int = 5; +pub const RTAX_AUTHOR: ::c_int = 6; +pub const RTAX_BRD: ::c_int = 7; +pub const RTAX_MAX: ::c_int = 8; + +pub const KERN_PROCARGS2: ::c_int = 49; + +pub const PROC_PIDTASKALLINFO: ::c_int = 2; +pub const PROC_PIDTBSDINFO: ::c_int = 3; +pub const PROC_PIDTASKINFO: ::c_int = 4; +pub const PROC_PIDTHREADINFO: ::c_int = 5; +pub const PROC_PIDVNODEPATHINFO: ::c_int = 9; +pub const PROC_PIDPATHINFO_MAXSIZE: ::c_int = 4096; +pub const PROC_CSM_ALL: ::c_uint = 0x0001; +pub const PROC_CSM_NOSMT: ::c_uint = 0x0002; +pub const PROC_CSM_TECS: ::c_uint = 0x0004; +pub const MAXCOMLEN: usize = 16; +pub const MAXTHREADNAMESIZE: usize = 64; + +pub const XUCRED_VERSION: ::c_uint = 0; + +pub const LC_SEGMENT: u32 = 0x1; +pub const LC_SEGMENT_64: u32 = 0x19; + +pub const MH_MAGIC: u32 = 0xfeedface; +pub const MH_MAGIC_64: u32 = 0xfeedfacf; + +// net/if_utun.h +pub const UTUN_OPT_FLAGS: ::c_int = 1; +pub const UTUN_OPT_IFNAME: ::c_int = 2; + +// net/bpf.h +pub const DLT_NULL: ::c_uint = 0; // no link-layer encapsulation +pub const DLT_EN10MB: ::c_uint = 1; // Ethernet (10Mb) +pub const DLT_EN3MB: ::c_uint = 2; // Experimental Ethernet (3Mb) +pub const DLT_AX25: ::c_uint = 3; // Amateur Radio AX.25 +pub const DLT_PRONET: ::c_uint = 4; // Proteon ProNET Token Ring +pub const DLT_CHAOS: ::c_uint = 5; // Chaos +pub const DLT_IEEE802: ::c_uint = 6; // IEEE 802 Networks +pub const DLT_ARCNET: ::c_uint = 7; // ARCNET +pub const DLT_SLIP: ::c_uint = 8; // Serial Line IP +pub const DLT_PPP: ::c_uint = 9; // Point-to-point Protocol +pub const DLT_FDDI: ::c_uint = 10; // FDDI +pub const DLT_ATM_RFC1483: ::c_uint = 11; // LLC/SNAP encapsulated atm +pub const DLT_RAW: ::c_uint = 12; // raw IP +pub const DLT_LOOP: ::c_uint = 108; + +// https://github.com/apple/darwin-xnu/blob/master/bsd/net/bpf.h#L100 +// sizeof(i32) +pub const BPF_ALIGNMENT: ::c_int = 4; + +// sys/mount.h +pub const MNT_NODEV: ::c_int = 0x00000010; +pub const MNT_UNION: ::c_int = 0x00000020; +pub const MNT_CPROTECT: ::c_int = 0x00000080; + +// MAC labeled / "quarantined" flag +pub const MNT_QUARANTINE: ::c_int = 0x00000400; + +// Flags set by internal operations. +pub const MNT_LOCAL: ::c_int = 0x00001000; +pub const MNT_QUOTA: ::c_int = 0x00002000; +pub const MNT_ROOTFS: ::c_int = 0x00004000; +pub const MNT_DOVOLFS: ::c_int = 0x00008000; + +pub const MNT_DONTBROWSE: ::c_int = 0x00100000; +pub const MNT_IGNORE_OWNERSHIP: ::c_int = 0x00200000; +pub const MNT_AUTOMOUNTED: ::c_int = 0x00400000; +pub const MNT_JOURNALED: ::c_int = 0x00800000; +pub const MNT_NOUSERXATTR: ::c_int = 0x01000000; +pub const MNT_DEFWRITE: ::c_int = 0x02000000; +pub const MNT_MULTILABEL: ::c_int = 0x04000000; +pub const MNT_NOATIME: ::c_int = 0x10000000; +pub const MNT_SNAPSHOT: ::c_int = 0x40000000; + +// External filesystem command modifier flags. +pub const MNT_NOBLOCK: ::c_int = 0x00020000; + +// sys/spawn.h: +pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; +pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; +pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04; +pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08; +pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x40; +pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x80; +pub const POSIX_SPAWN_CLOEXEC_DEFAULT: ::c_int = 0x4000; + +// sys/ipc.h: +pub const IPC_CREAT: ::c_int = 0x200; +pub const IPC_EXCL: ::c_int = 0x400; +pub const IPC_NOWAIT: ::c_int = 0x800; +pub const IPC_PRIVATE: key_t = 0; + +pub const IPC_RMID: ::c_int = 0; +pub const IPC_SET: ::c_int = 1; +pub const IPC_STAT: ::c_int = 2; + +pub const IPC_R: ::c_int = 0x100; +pub const IPC_W: ::c_int = 0x80; +pub const IPC_M: ::c_int = 0x1000; + +// sys/sem.h +pub const SEM_UNDO: ::c_int = 0o10000; + +pub const GETNCNT: ::c_int = 3; +pub const GETPID: ::c_int = 4; +pub const GETVAL: ::c_int = 5; +pub const GETALL: ::c_int = 6; +pub const GETZCNT: ::c_int = 7; +pub const SETVAL: ::c_int = 8; +pub const SETALL: ::c_int = 9; + +// sys/shm.h +pub const SHM_RDONLY: ::c_int = 0x1000; +pub const SHM_RND: ::c_int = 0x2000; +#[cfg(target_arch = "aarch64")] +pub const SHMLBA: ::c_int = 16 * 1024; +#[cfg(not(target_arch = "aarch64"))] +pub const SHMLBA: ::c_int = 4096; +pub const SHM_R: ::c_int = IPC_R; +pub const SHM_W: ::c_int = IPC_W; + +// Flags for chflags(2) +pub const UF_SETTABLE: ::c_uint = 0x0000ffff; +pub const UF_NODUMP: ::c_uint = 0x00000001; +pub const UF_IMMUTABLE: ::c_uint = 0x00000002; +pub const UF_APPEND: ::c_uint = 0x00000004; +pub const UF_OPAQUE: ::c_uint = 0x00000008; +pub const UF_COMPRESSED: ::c_uint = 0x00000020; +pub const UF_TRACKED: ::c_uint = 0x00000040; +pub const SF_SETTABLE: ::c_uint = 0xffff0000; +pub const SF_ARCHIVED: ::c_uint = 0x00010000; +pub const SF_IMMUTABLE: ::c_uint = 0x00020000; +pub const SF_APPEND: ::c_uint = 0x00040000; +pub const UF_HIDDEN: ::c_uint = 0x00008000; + +// +pub const NTP_API: ::c_int = 4; +pub const MAXPHASE: ::c_long = 500000000; +pub const MAXFREQ: ::c_long = 500000; +pub const MINSEC: ::c_int = 256; +pub const MAXSEC: ::c_int = 2048; +pub const NANOSECOND: ::c_long = 1000000000; +pub const SCALE_PPM: ::c_int = 65; +pub const MAXTC: ::c_int = 10; +pub const MOD_OFFSET: ::c_uint = 0x0001; +pub const MOD_FREQUENCY: ::c_uint = 0x0002; +pub const MOD_MAXERROR: ::c_uint = 0x0004; +pub const MOD_ESTERROR: ::c_uint = 0x0008; +pub const MOD_STATUS: ::c_uint = 0x0010; +pub const MOD_TIMECONST: ::c_uint = 0x0020; +pub const MOD_PPSMAX: ::c_uint = 0x0040; +pub const MOD_TAI: ::c_uint = 0x0080; +pub const MOD_MICRO: ::c_uint = 0x1000; +pub const MOD_NANO: ::c_uint = 0x2000; +pub const MOD_CLKB: ::c_uint = 0x4000; +pub const MOD_CLKA: ::c_uint = 0x8000; +pub const STA_PLL: ::c_int = 0x0001; +pub const STA_PPSFREQ: ::c_int = 0x0002; +pub const STA_PPSTIME: ::c_int = 0x0004; +pub const STA_FLL: ::c_int = 0x0008; +pub const STA_INS: ::c_int = 0x0010; +pub const STA_DEL: ::c_int = 0x0020; +pub const STA_UNSYNC: ::c_int = 0x0040; +pub const STA_FREQHOLD: ::c_int = 0x0080; +pub const STA_PPSSIGNAL: ::c_int = 0x0100; +pub const STA_PPSJITTER: ::c_int = 0x0200; +pub const STA_PPSWANDER: ::c_int = 0x0400; +pub const STA_PPSERROR: ::c_int = 0x0800; +pub const STA_CLOCKERR: ::c_int = 0x1000; +pub const STA_NANO: ::c_int = 0x2000; +pub const STA_MODE: ::c_int = 0x4000; +pub const STA_CLK: ::c_int = 0x8000; +pub const STA_RONLY: ::c_int = STA_PPSSIGNAL + | STA_PPSJITTER + | STA_PPSWANDER + | STA_PPSERROR + | STA_CLOCKERR + | STA_NANO + | STA_MODE + | STA_CLK; +pub const TIME_OK: ::c_int = 0; +pub const TIME_INS: ::c_int = 1; +pub const TIME_DEL: ::c_int = 2; +pub const TIME_OOP: ::c_int = 3; +pub const TIME_WAIT: ::c_int = 4; +pub const TIME_ERROR: ::c_int = 5; + +// +pub const MNT_WAIT: ::c_int = 1; +pub const MNT_NOWAIT: ::c_int = 2; + +// +pub const THREAD_STANDARD_POLICY: ::c_int = 1; +pub const THREAD_STANDARD_POLICY_COUNT: ::c_int = 0; +pub const THREAD_EXTENDED_POLICY: ::c_int = 1; +pub const THREAD_TIME_CONSTRAINT_POLICY: ::c_int = 2; +pub const THREAD_PRECEDENCE_POLICY: ::c_int = 3; +pub const THREAD_AFFINITY_POLICY: ::c_int = 4; +pub const THREAD_AFFINITY_TAG_NULL: ::c_int = 0; +pub const THREAD_BACKGROUND_POLICY: ::c_int = 5; +pub const THREAD_BACKGROUND_POLICY_DARWIN_BG: ::c_int = 0x1000; +pub const THREAD_LATENCY_QOS_POLICY: ::c_int = 7; +pub const THREAD_THROUGHPUT_QOS_POLICY: ::c_int = 8; + +// +pub const TH_STATE_RUNNING: ::c_int = 1; +pub const TH_STATE_STOPPED: ::c_int = 2; +pub const TH_STATE_WAITING: ::c_int = 3; +pub const TH_STATE_UNINTERRUPTIBLE: ::c_int = 4; +pub const TH_STATE_HALTED: ::c_int = 5; +pub const TH_FLAGS_SWAPPED: ::c_int = 0x1; +pub const TH_FLAGS_IDLE: ::c_int = 0x2; +pub const TH_FLAGS_GLOBAL_FORCED_IDLE: ::c_int = 0x4; +pub const THREAD_BASIC_INFO: ::c_int = 3; +pub const THREAD_IDENTIFIER_INFO: ::c_int = 4; +pub const THREAD_EXTENDED_INFO: ::c_int = 5; + +// CommonCrypto/CommonCryptoError.h +pub const kCCSuccess: i32 = 0; +pub const kCCParamError: i32 = -4300; +pub const kCCBufferTooSmall: i32 = -4301; +pub const kCCMemoryFailure: i32 = -4302; +pub const kCCAlignmentError: i32 = -4303; +pub const kCCDecodeError: i32 = -4304; +pub const kCCUnimplemented: i32 = -4305; +pub const kCCOverflow: i32 = -4306; +pub const kCCRNGFailure: i32 = -4307; +pub const kCCUnspecifiedError: i32 = -4308; +pub const kCCCallSequenceError: i32 = -4309; +pub const kCCKeySizeError: i32 = -4310; +pub const kCCInvalidKey: i32 = -4311; + +// mach/host_info.h +pub const HOST_LOAD_INFO: i32 = 1; +pub const HOST_VM_INFO: i32 = 2; +pub const HOST_CPU_LOAD_INFO: i32 = 3; +pub const HOST_VM_INFO64: i32 = 4; +pub const HOST_EXTMOD_INFO64: i32 = 5; +pub const HOST_EXPIRED_TASK_INFO: i32 = 6; + +// mach/vm_statistics.h +pub const VM_PAGE_QUERY_PAGE_PRESENT: i32 = 0x1; +pub const VM_PAGE_QUERY_PAGE_FICTITIOUS: i32 = 0x2; +pub const VM_PAGE_QUERY_PAGE_REF: i32 = 0x4; +pub const VM_PAGE_QUERY_PAGE_DIRTY: i32 = 0x8; +pub const VM_PAGE_QUERY_PAGE_PAGED_OUT: i32 = 0x10; +pub const VM_PAGE_QUERY_PAGE_COPIED: i32 = 0x20; +pub const VM_PAGE_QUERY_PAGE_SPECULATIVE: i32 = 0x40; +pub const VM_PAGE_QUERY_PAGE_EXTERNAL: i32 = 0x80; +pub const VM_PAGE_QUERY_PAGE_CS_VALIDATED: i32 = 0x100; +pub const VM_PAGE_QUERY_PAGE_CS_TAINTED: i32 = 0x200; +pub const VM_PAGE_QUERY_PAGE_CS_NX: i32 = 0x400; + +// mach/task_info.h +pub const TASK_THREAD_TIMES_INFO: u32 = 3; +pub const HOST_CPU_LOAD_INFO_COUNT: u32 = 4; +pub const MACH_TASK_BASIC_INFO: u32 = 20; + +pub const MACH_PORT_NULL: i32 = 0; + +pub const RUSAGE_INFO_V0: ::c_int = 0; +pub const RUSAGE_INFO_V1: ::c_int = 1; +pub const RUSAGE_INFO_V2: ::c_int = 2; +pub const RUSAGE_INFO_V3: ::c_int = 3; +pub const RUSAGE_INFO_V4: ::c_int = 4; + +// copyfile.h +pub const COPYFILE_ACL: ::copyfile_flags_t = 1 << 0; +pub const COPYFILE_STAT: ::copyfile_flags_t = 1 << 1; +pub const COPYFILE_XATTR: ::copyfile_flags_t = 1 << 2; +pub const COPYFILE_DATA: ::copyfile_flags_t = 1 << 3; +pub const COPYFILE_SECURITY: ::copyfile_flags_t = COPYFILE_STAT | COPYFILE_ACL; +pub const COPYFILE_METADATA: ::copyfile_flags_t = COPYFILE_SECURITY | COPYFILE_XATTR; +pub const COPYFILE_RECURSIVE: ::copyfile_flags_t = 1 << 15; +pub const COPYFILE_CHECK: ::copyfile_flags_t = 1 << 16; +pub const COPYFILE_EXCL: ::copyfile_flags_t = 1 << 17; +pub const COPYFILE_NOFOLLOW_SRC: ::copyfile_flags_t = 1 << 18; +pub const COPYFILE_NOFOLLOW_DST: ::copyfile_flags_t = 1 << 19; +pub const COPYFILE_MOVE: ::copyfile_flags_t = 1 << 20; +pub const COPYFILE_UNLINK: ::copyfile_flags_t = 1 << 21; +pub const COPYFILE_NOFOLLOW: ::copyfile_flags_t = COPYFILE_NOFOLLOW_SRC | COPYFILE_NOFOLLOW_DST; +pub const COPYFILE_PACK: ::copyfile_flags_t = 1 << 22; +pub const COPYFILE_UNPACK: ::copyfile_flags_t = 1 << 23; +pub const COPYFILE_CLONE: ::copyfile_flags_t = 1 << 24; +pub const COPYFILE_CLONE_FORCE: ::copyfile_flags_t = 1 << 25; +pub const COPYFILE_RUN_IN_PLACE: ::copyfile_flags_t = 1 << 26; +pub const COPYFILE_DATA_SPARSE: ::copyfile_flags_t = 1 << 27; +pub const COPYFILE_PRESERVE_DST_TRACKED: ::copyfile_flags_t = 1 << 28; +pub const COPYFILE_VERBOSE: ::copyfile_flags_t = 1 << 30; +pub const COPYFILE_RECURSE_ERROR: ::c_int = 0; +pub const COPYFILE_RECURSE_FILE: ::c_int = 1; +pub const COPYFILE_RECURSE_DIR: ::c_int = 2; +pub const COPYFILE_RECURSE_DIR_CLEANUP: ::c_int = 3; +pub const COPYFILE_COPY_DATA: ::c_int = 4; +pub const COPYFILE_COPY_XATTR: ::c_int = 5; +pub const COPYFILE_START: ::c_int = 1; +pub const COPYFILE_FINISH: ::c_int = 2; +pub const COPYFILE_ERR: ::c_int = 3; +pub const COPYFILE_PROGRESS: ::c_int = 4; +pub const COPYFILE_CONTINUE: ::c_int = 0; +pub const COPYFILE_SKIP: ::c_int = 1; +pub const COPYFILE_QUIT: ::c_int = 2; + +cfg_if! { + if #[cfg(libc_const_extern_fn)] { + const fn __DARWIN_ALIGN32(p: usize) -> usize { + const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::() - 1; + p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 + } + } else if #[cfg(libc_const_size_of)] { + fn __DARWIN_ALIGN32(p: usize) -> usize { + const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::() - 1; + p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 + } + } else { + fn __DARWIN_ALIGN32(p: usize) -> usize { + let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::() - 1; + p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 + } + } +} + +cfg_if! { + if #[cfg(libc_const_size_of)] { + pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / ::mem::size_of::()) + as mach_msg_type_number_t; + pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / + ::mem::size_of::()) as mach_msg_type_number_t; + pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / ::mem::size_of::()) + as mach_msg_type_number_t; + pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / ::mem::size_of::()) + as mach_msg_type_number_t; + pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / ::mem::size_of::()) + as mach_msg_type_number_t; + pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / ::mem::size_of::()) + as mach_msg_type_number_t; + pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / + ::mem::size_of::()) as mach_msg_type_number_t; + pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / ::mem::size_of::()) + as mach_msg_type_number_t; + pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / ::mem::size_of::()) + as mach_msg_type_number_t; + pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / ::mem::size_of::()) + as mach_msg_type_number_t; + + pub const TASK_THREAD_TIMES_INFO_COUNT: u32 = + (::mem::size_of::() + / ::mem::size_of::()) as u32; + pub const MACH_TASK_BASIC_INFO_COUNT: u32 = (::mem::size_of::() + / ::mem::size_of::()) as u32; + pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t = + (::mem::size_of::() / ::mem::size_of::()) + as mach_msg_type_number_t; + } else { + pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 1; + pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 4; + pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 1; + pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = 1; + pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = 1; + pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = 1; + pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = 1; + pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = 10; + pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = 6; + pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t = 28; + pub const TASK_THREAD_TIMES_INFO_COUNT: u32 = 4; + pub const MACH_TASK_BASIC_INFO_COUNT: u32 = 12; + pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t = 38; + } +} + +f! { + pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, + cmsg: *const ::cmsghdr) -> *mut ::cmsghdr { + if cmsg.is_null() { + return ::CMSG_FIRSTHDR(mhdr); + }; + let cmsg_len = (*cmsg).cmsg_len as usize; + let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize); + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max { + 0 as *mut ::cmsghdr + } else { + next as *mut ::cmsghdr + } + } + + pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { + (cmsg as *mut ::c_uchar) + .offset(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) as isize) + } + + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + + __DARWIN_ALIGN32(length as usize)) + as ::c_uint + } + + pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize) + as ::c_uint + } + + pub {const} fn VM_MAKE_TAG(id: u8) -> u32 { + (id as u32) << 24u32 + } +} + +safe_f! { + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { + status >> 8 + } + + pub {const} fn _WSTATUS(status: ::c_int) -> ::c_int { + status & 0x7f + } + + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13 + } + + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0 + } + + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { + _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13 + } +} + +extern "C" { + pub fn setgrent(); + #[doc(hidden)] + #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")] + #[cfg_attr(not(target_arch = "aarch64"), link_name = "daemon$1050")] + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + #[doc(hidden)] + #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")] + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + #[doc(hidden)] + #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")] + pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; + pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; + pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "aio_suspend$UNIX2003" + )] + pub fn aio_suspend( + aiocb_list: *const *const aiocb, + nitems: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int; + pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int; + pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn lio_listio( + mode: ::c_int, + aiocb_list: *const *mut aiocb, + nitems: ::c_int, + sevp: *mut sigevent, + ) -> ::c_int; + + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn getutxent() -> *mut utmpx; + pub fn getutxid(ut: *const utmpx) -> *mut utmpx; + pub fn getutxline(ut: *const utmpx) -> *mut utmpx; + pub fn pututxline(ut: *const utmpx) -> *mut utmpx; + pub fn setutxent(); + pub fn endutxent(); + pub fn utmpxname(file: *const ::c_char) -> ::c_int; + + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::socklen_t, + serv: *mut ::c_char, + sevlen: ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int; + pub fn sysctlnametomib( + name: *const ::c_char, + mibp: *mut ::c_int, + sizep: *mut ::size_t, + ) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "mprotect$UNIX2003" + )] + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "semctl$UNIX2003" + )] + pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int; + pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int; + pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int; + pub fn ftok(pathname: *const c_char, proj_id: ::c_int) -> key_t; + pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; + pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "shmctl$UNIX2003" + )] + pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; + pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; + pub fn sysctl( + name: *mut ::c_int, + namelen: ::c_uint, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; + pub fn sysctlbyname( + name: *const ::c_char, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; + #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] + pub fn mach_absolute_time() -> u64; + #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] + #[allow(deprecated)] + pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int; + pub fn mach_host_self() -> mach_port_t; + pub fn mach_thread_self() -> mach_port_t; + pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int; + pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t; + pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t; + pub fn pthread_create_from_mach_thread( + thread: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void; + pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t; + pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_condattr_getpshared( + attr: *const pthread_condattr_t, + pshared: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_mutexattr_setpshared( + attr: *mut pthread_mutexattr_t, + pshared: ::c_int, + ) -> ::c_int; + pub fn pthread_mutexattr_getpshared( + attr: *const pthread_mutexattr_t, + pshared: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_rwlockattr_getpshared( + attr: *const pthread_rwlockattr_t, + val: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int; + pub fn pthread_threadid_np(thread: ::pthread_t, thread_id: *mut u64) -> ::c_int; + pub fn pthread_attr_set_qos_class_np( + attr: *mut pthread_attr_t, + class: qos_class_t, + priority: ::c_int, + ) -> ::c_int; + pub fn pthread_attr_get_qos_class_np( + attr: *mut pthread_attr_t, + class: *mut qos_class_t, + priority: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_set_qos_class_self_np(class: qos_class_t, priority: ::c_int) -> ::c_int; + pub fn pthread_get_qos_class_np( + thread: ::pthread_t, + class: *mut qos_class_t, + priority: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_attr_getschedparam( + attr: *const ::pthread_attr_t, + param: *mut sched_param, + ) -> ::c_int; + pub fn pthread_attr_setschedparam( + attr: *mut ::pthread_attr_t, + param: *const sched_param, + ) -> ::c_int; + pub fn pthread_getschedparam( + thread: ::pthread_t, + policy: *mut ::c_int, + param: *mut sched_param, + ) -> ::c_int; + pub fn pthread_setschedparam( + thread: ::pthread_t, + policy: ::c_int, + param: *const sched_param, + ) -> ::c_int; + + // Available from Big Sur + pub fn pthread_introspection_hook_install( + hook: ::pthread_introspection_hook_t, + ) -> ::pthread_introspection_hook_t; + pub fn pthread_introspection_setspecific_np( + thread: ::pthread_t, + key: ::pthread_key_t, + value: *const ::c_void, + ) -> ::c_int; + pub fn pthread_introspection_getspecific_np( + thread: ::pthread_t, + key: ::pthread_key_t, + ) -> *mut ::c_void; + pub fn pthread_jit_write_protect_np(enabled: ::c_int); + pub fn pthread_jit_write_protect_supported_np() -> ::c_int; + pub fn pthread_cpu_number_np(cpu_number_out: *mut ::size_t) -> ::c_int; + + pub fn thread_policy_set( + thread: thread_t, + flavor: thread_policy_flavor_t, + policy_info: thread_policy_t, + count: mach_msg_type_number_t, + ) -> kern_return_t; + pub fn thread_policy_get( + thread: thread_t, + flavor: thread_policy_flavor_t, + policy_info: thread_policy_t, + count: *mut mach_msg_type_number_t, + get_default: *mut boolean_t, + ) -> kern_return_t; + pub fn thread_info( + target_act: thread_inspect_t, + flavor: thread_flavor_t, + thread_info_out: thread_info_t, + thread_info_outCnt: *mut mach_msg_type_number_t, + ) -> kern_return_t; + #[cfg_attr(doc, doc(alias = "__errno_location"))] + #[cfg_attr(doc, doc(alias = "errno"))] + pub fn __error() -> *mut ::c_int; + pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; + pub fn backtrace_symbols(addrs: *const *mut ::c_void, sz: ::c_int) -> *mut *mut ::c_char; + pub fn backtrace_symbols_fd(addrs: *const *mut ::c_void, sz: ::c_int, fd: ::c_int); + pub fn backtrace_from_fp( + startfp: *mut ::c_void, + array: *mut *mut ::c_void, + size: ::c_int, + ) -> ::c_int; + pub fn backtrace_image_offsets( + array: *const *mut ::c_void, + image_offsets: *mut image_offset, + size: ::c_int, + ); + pub fn backtrace_async( + array: *mut *mut ::c_void, + length: ::size_t, + task_id: *mut u32, + ) -> ::size_t; + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "statfs$INODE64" + )] + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "fstatfs$INODE64" + )] + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; + pub fn kevent( + kq: ::c_int, + changelist: *const ::kevent, + nchanges: ::c_int, + eventlist: *mut ::kevent, + nevents: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn kevent64( + kq: ::c_int, + changelist: *const ::kevent64_s, + nchanges: ::c_int, + eventlist: *mut ::kevent64_s, + nevents: ::c_int, + flags: ::c_uint, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn mount( + src: *const ::c_char, + target: *const ::c_char, + flags: ::c_int, + data: *mut ::c_void, + ) -> ::c_int; + pub fn fmount( + src: *const ::c_char, + fd: ::c_int, + flags: ::c_int, + data: *mut ::c_void, + ) -> ::c_int; + pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int; + pub fn quotactl( + special: *const ::c_char, + cmd: ::c_int, + id: ::c_int, + data: *mut ::c_char, + ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int; + pub fn sendfile( + fd: ::c_int, + s: ::c_int, + offset: ::off_t, + len: *mut ::off_t, + hdtr: *mut ::sf_hdtr, + flags: ::c_int, + ) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + pub fn utimensat( + dirfd: ::c_int, + path: *const ::c_char, + times: *const ::timespec, + flag: ::c_int, + ) -> ::c_int; + pub fn openpty( + amaster: *mut ::c_int, + aslave: *mut ::c_int, + name: *mut ::c_char, + termp: *mut termios, + winp: *mut ::winsize, + ) -> ::c_int; + pub fn forkpty( + amaster: *mut ::c_int, + name: *mut ::c_char, + termp: *mut termios, + winp: *mut ::winsize, + ) -> ::pid_t; + pub fn login_tty(fd: ::c_int) -> ::c_int; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t) -> ::c_int; + pub fn localeconv_l(loc: ::locale_t) -> *mut lconv; + pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; + pub fn uselocale(loc: ::locale_t) -> ::locale_t; + pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char; + pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; + pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; + pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int; + pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t; + pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) + -> ::ssize_t; + pub fn getxattr( + path: *const ::c_char, + name: *const ::c_char, + value: *mut ::c_void, + size: ::size_t, + position: u32, + flags: ::c_int, + ) -> ::ssize_t; + pub fn fgetxattr( + filedes: ::c_int, + name: *const ::c_char, + value: *mut ::c_void, + size: ::size_t, + position: u32, + flags: ::c_int, + ) -> ::ssize_t; + pub fn setxattr( + path: *const ::c_char, + name: *const ::c_char, + value: *const ::c_void, + size: ::size_t, + position: u32, + flags: ::c_int, + ) -> ::c_int; + pub fn fsetxattr( + filedes: ::c_int, + name: *const ::c_char, + value: *const ::c_void, + size: ::size_t, + position: u32, + flags: ::c_int, + ) -> ::c_int; + pub fn listxattr( + path: *const ::c_char, + list: *mut ::c_char, + size: ::size_t, + flags: ::c_int, + ) -> ::ssize_t; + pub fn flistxattr( + filedes: ::c_int, + list: *mut ::c_char, + size: ::size_t, + flags: ::c_int, + ) -> ::ssize_t; + pub fn removexattr(path: *const ::c_char, name: *const ::c_char, flags: ::c_int) -> ::c_int; + pub fn renamex_np(from: *const ::c_char, to: *const ::c_char, flags: ::c_uint) -> ::c_int; + pub fn renameatx_np( + fromfd: ::c_int, + from: *const ::c_char, + tofd: ::c_int, + to: *const ::c_char, + flags: ::c_uint, + ) -> ::c_int; + pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char, flags: ::c_int) -> ::c_int; + + pub fn getgrouplist( + name: *const ::c_char, + basegid: ::c_int, + groups: *mut ::c_int, + ngroups: *mut ::c_int, + ) -> ::c_int; + pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "waitid$UNIX2003" + )] + pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) + -> ::c_int; + pub fn brk(addr: *const ::c_void) -> *mut ::c_void; + pub fn sbrk(increment: ::c_int) -> *mut ::c_void; + pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; + #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] + pub fn _dyld_image_count() -> u32; + #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] + #[allow(deprecated)] + pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header; + #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] + pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t; + #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] + pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char; + + pub fn posix_spawn( + pid: *mut ::pid_t, + path: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnp( + pid: *mut ::pid_t, + file: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_getsigdefault( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigdefault( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getsigmask( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigmask( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getflags( + attr: *const posix_spawnattr_t, + flags: *mut ::c_short, + ) -> ::c_int; + pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; + pub fn posix_spawnattr_getpgroup( + attr: *const posix_spawnattr_t, + flags: *mut ::pid_t, + ) -> ::c_int; + pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; + pub fn posix_spawnattr_setarchpref_np( + attr: *mut posix_spawnattr_t, + count: ::size_t, + pref: *mut ::cpu_type_t, + subpref: *mut ::cpu_subtype_t, + ocount: *mut ::size_t, + ) -> ::c_int; + pub fn posix_spawnattr_getarchpref_np( + attr: *const posix_spawnattr_t, + count: ::size_t, + pref: *mut ::cpu_type_t, + subpref: *mut ::cpu_subtype_t, + ocount: *mut ::size_t, + ) -> ::c_int; + + pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_addopen( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + path: *const ::c_char, + oflag: ::c_int, + mode: ::mode_t, + ) -> ::c_int; + pub fn posix_spawn_file_actions_addclose( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + ) -> ::c_int; + pub fn posix_spawn_file_actions_adddup2( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + newfd: ::c_int, + ) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + + pub fn connectx( + socket: ::c_int, + endpoints: *const sa_endpoints_t, + associd: sae_associd_t, + flags: ::c_uint, + iov: *const ::iovec, + iovcnt: ::c_uint, + len: *mut ::size_t, + connid: *mut sae_connid_t, + ) -> ::c_int; + pub fn disconnectx(socket: ::c_int, associd: sae_associd_t, connid: sae_connid_t) -> ::c_int; + + pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; + pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "getmntinfo$INODE64" + )] + pub fn getmntinfo(mntbufp: *mut *mut statfs, flags: ::c_int) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "getfsstat$INODE64" + )] + pub fn getfsstat(mntbufp: *mut statfs, bufsize: ::c_int, flags: ::c_int) -> ::c_int; + + // Copy-on-write functions. + // According to the man page `flags` is an `int` but in the header + // this is a `uint32_t`. + pub fn clonefile(src: *const ::c_char, dst: *const ::c_char, flags: u32) -> ::c_int; + pub fn clonefileat( + src_dirfd: ::c_int, + src: *const ::c_char, + dst_dirfd: ::c_int, + dst: *const ::c_char, + flags: u32, + ) -> ::c_int; + pub fn fclonefileat( + srcfd: ::c_int, + dst_dirfd: ::c_int, + dst: *const ::c_char, + flags: u32, + ) -> ::c_int; + + pub fn copyfile( + from: *const ::c_char, + to: *const ::c_char, + state: copyfile_state_t, + flags: copyfile_flags_t, + ) -> ::c_int; + pub fn fcopyfile( + from: ::c_int, + to: ::c_int, + state: copyfile_state_t, + flags: copyfile_flags_t, + ) -> ::c_int; + + // Added in macOS 10.13 + // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1 + pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int; + // Added in macOS 10.5 + pub fn memset_pattern4(b: *mut ::c_void, pattern4: *const ::c_void, len: ::size_t); + pub fn memset_pattern8(b: *mut ::c_void, pattern8: *const ::c_void, len: ::size_t); + pub fn memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t); + + // Inherited from BSD but available from Big Sur only + pub fn strtonum( + __numstr: *const ::c_char, + __minval: ::c_longlong, + __maxval: ::c_longlong, + errstrp: *mut *const ::c_char, + ) -> ::c_longlong; + + pub fn mstats() -> mstats; + pub fn malloc_printf(format: *const ::c_char, ...); + pub fn malloc_zone_check(zone: *mut ::malloc_zone_t) -> ::boolean_t; + pub fn malloc_zone_print(zone: *mut ::malloc_zone_t, verbose: ::boolean_t); + pub fn malloc_zone_statistics(zone: *mut ::malloc_zone_t, stats: *mut malloc_statistics_t); + pub fn malloc_zone_log(zone: *mut ::malloc_zone_t, address: *mut ::c_void); + pub fn malloc_zone_print_ptr_info(ptr: *mut ::c_void); + pub fn malloc_default_zone() -> *mut ::malloc_zone_t; + pub fn malloc_zone_from_ptr(ptr: *const ::c_void) -> *mut ::malloc_zone_t; + pub fn malloc_zone_malloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void; + pub fn malloc_zone_valloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void; + pub fn malloc_zone_calloc( + zone: *mut ::malloc_zone_t, + num_items: ::size_t, + size: ::size_t, + ) -> *mut ::c_void; + pub fn malloc_zone_realloc( + zone: *mut ::malloc_zone_t, + ptr: *mut ::c_void, + size: ::size_t, + ) -> *mut ::c_void; + pub fn malloc_zone_free(zone: *mut ::malloc_zone_t, ptr: *mut ::c_void); + + pub fn proc_listpids( + t: u32, + typeinfo: u32, + buffer: *mut ::c_void, + buffersize: ::c_int, + ) -> ::c_int; + pub fn proc_listallpids(buffer: *mut ::c_void, buffersize: ::c_int) -> ::c_int; + pub fn proc_listpgrppids( + pgrpid: ::pid_t, + buffer: *mut ::c_void, + buffersize: ::c_int, + ) -> ::c_int; + pub fn proc_listchildpids(ppid: ::pid_t, buffer: *mut ::c_void, buffersize: ::c_int) + -> ::c_int; + pub fn proc_pidinfo( + pid: ::c_int, + flavor: ::c_int, + arg: u64, + buffer: *mut ::c_void, + buffersize: ::c_int, + ) -> ::c_int; + pub fn proc_pidfdinfo( + pid: ::c_int, + fd: ::c_int, + flavor: ::c_int, + buffer: *mut ::c_void, + buffersize: ::c_int, + ) -> ::c_int; + pub fn proc_pidfileportinfo( + pid: ::c_int, + fileport: u32, + flavor: ::c_int, + buffer: *mut ::c_void, + buffersize: ::c_int, + ) -> ::c_int; + pub fn proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int; + pub fn proc_name(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int; + pub fn proc_regionfilename( + pid: ::c_int, + address: u64, + buffer: *mut ::c_void, + buffersize: u32, + ) -> ::c_int; + pub fn proc_kmsgbuf(buffer: *mut ::c_void, buffersize: u32) -> ::c_int; + pub fn proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int; + pub fn proc_pid_rusage(pid: ::c_int, flavor: ::c_int, buffer: *mut rusage_info_t) -> ::c_int; + + // Available from Big Sur + pub fn proc_set_no_smt() -> ::c_int; + pub fn proc_setthread_no_smt() -> ::c_int; + pub fn proc_set_csm(flags: u32) -> ::c_int; + pub fn proc_setthread_csm(flags: u32) -> ::c_int; + /// # Notes + /// + /// `id` is of type [`uuid_t`]. + pub fn gethostuuid(id: *mut u8, timeout: *const ::timespec) -> ::c_int; + + pub fn gethostid() -> ::c_long; + pub fn sethostid(hostid: ::c_long); + + pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus; + + pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int; + pub fn _NSGetEnviron() -> *mut *mut *mut ::c_char; + + pub fn mach_vm_map( + target_task: ::vm_map_t, + address: *mut ::mach_vm_address_t, + size: ::mach_vm_size_t, + mask: ::mach_vm_offset_t, + flags: ::c_int, + object: ::mem_entry_name_port_t, + offset: ::memory_object_offset_t, + copy: ::boolean_t, + cur_protection: ::vm_prot_t, + max_protection: ::vm_prot_t, + inheritance: ::vm_inherit_t, + ) -> ::kern_return_t; + + pub fn vm_deallocate( + target_task: vm_map_t, + address: vm_address_t, + size: vm_size_t, + ) -> ::kern_return_t; + + pub fn host_statistics64( + host_priv: host_t, + flavor: host_flavor_t, + host_info64_out: host_info64_t, + host_info64_outCnt: *mut mach_msg_type_number_t, + ) -> ::kern_return_t; + pub fn host_processor_info( + host: host_t, + flavor: processor_flavor_t, + out_processor_count: *mut natural_t, + out_processor_info: *mut processor_info_array_t, + out_processor_infoCnt: *mut mach_msg_type_number_t, + ) -> ::kern_return_t; + + pub static mut mach_task_self_: ::mach_port_t; + pub fn task_for_pid( + host: ::mach_port_t, + pid: ::pid_t, + task: *mut ::mach_port_t, + ) -> ::kern_return_t; + pub fn task_info( + host: ::mach_port_t, + flavor: task_flavor_t, + task_info_out: task_info_t, + task_info_count: *mut mach_msg_type_number_t, + ) -> ::kern_return_t; + pub fn task_create( + target_task: ::task_t, + ledgers: ::ledger_array_t, + ledgersCnt: ::mach_msg_type_number_t, + inherit_memory: ::boolean_t, + child_task: *mut ::task_t, + ) -> ::kern_return_t; + pub fn task_terminate(target_task: ::task_t) -> ::kern_return_t; + pub fn task_threads( + target_task: ::task_inspect_t, + act_list: *mut ::thread_act_array_t, + act_listCnt: *mut ::mach_msg_type_number_t, + ) -> ::kern_return_t; + pub fn host_statistics( + host_priv: host_t, + flavor: host_flavor_t, + host_info_out: host_info_t, + host_info_outCnt: *mut mach_msg_type_number_t, + ) -> ::kern_return_t; + + // sysdir.h + pub fn sysdir_start_search_path_enumeration( + dir: sysdir_search_path_directory_t, + domainMask: sysdir_search_path_domain_mask_t, + ) -> ::sysdir_search_path_enumeration_state; + pub fn sysdir_get_next_search_path_enumeration( + state: ::sysdir_search_path_enumeration_state, + path: *mut ::c_char, + ) -> ::sysdir_search_path_enumeration_state; + + pub static vm_page_size: vm_size_t; +} + +pub unsafe fn mach_task_self() -> ::mach_port_t { + mach_task_self_ +} + +cfg_if! { + if #[cfg(target_os = "macos")] { + extern "C" { + pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; + } + } +} +cfg_if! { + if #[cfg(any(target_os = "macos", target_os = "ios"))] { + extern "C" { + pub fn memmem( + haystack: *const ::c_void, + haystacklen: ::size_t, + needle: *const ::c_void, + needlelen: ::size_t, + ) -> *mut ::c_void; + pub fn task_set_info(target_task: ::task_t, + flavor: ::task_flavor_t, + task_info_in: ::task_info_t, + task_info_inCnt: ::mach_msg_type_number_t + ) -> ::kern_return_t; + } + } +} + +#[link(name = "iconv")] +extern "C" { + pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t; + pub fn iconv( + cd: iconv_t, + inbuf: *mut *mut ::c_char, + inbytesleft: *mut ::size_t, + outbuf: *mut *mut ::c_char, + outbytesleft: *mut ::size_t, + ) -> ::size_t; + pub fn iconv_close(cd: iconv_t) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_pointer_width = "32")] { + mod b32; + pub use self::b32::*; + } else if #[cfg(target_pointer_width = "64")] { + mod b64; + pub use self::b64::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs new file mode 100644 index 0000000000000000000000000000000000000000..5fe6bb89cf2e58b32bc358e5d98c3c4a836608d2 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/errno.rs @@ -0,0 +1,13 @@ +// DragonFlyBSD's __error function is declared with "static inline", so it must +// be implemented in the libc crate, as a pointer to a static thread_local. +f! { + #[deprecated(since = "0.2.77", note = "Use `__errno_location()` instead")] + pub fn __error() -> *mut ::c_int { + &mut errno + } +} + +extern "C" { + #[thread_local] + pub static mut errno: ::c_int; +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..df7719b4b9c698cfd93434304840a598d3e1f734 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -0,0 +1,1690 @@ +pub type dev_t = u32; +pub type c_char = i8; +pub type wchar_t = i32; +pub type clock_t = u64; +pub type ino_t = u64; +pub type lwpid_t = i32; +pub type nlink_t = u32; +pub type blksize_t = i64; +pub type clockid_t = ::c_ulong; + +pub type c_long = i64; +pub type c_ulong = u64; +pub type time_t = i64; +pub type suseconds_t = i64; + +pub type uuid_t = ::uuid; + +pub type fsblkcnt_t = u64; +pub type fsfilcnt_t = u64; +pub type idtype_t = ::c_uint; +pub type shmatt_t = ::c_uint; + +pub type mqd_t = ::c_int; +pub type sem_t = *mut sem; + +pub type cpuset_t = cpumask_t; +pub type cpu_set_t = cpumask_t; + +pub type register_t = ::c_long; +pub type umtx_t = ::c_int; +pub type pthread_barrierattr_t = ::c_int; +pub type pthread_barrier_t = ::uintptr_t; +pub type pthread_spinlock_t = ::uintptr_t; + +pub type segsz_t = usize; + +pub type vm_prot_t = u8; +pub type vm_maptype_t = u8; +pub type vm_inherit_t = i8; +pub type vm_subsys_t = ::c_int; +pub type vm_eflags_t = ::c_uint; + +pub type vm_map_t = *mut __c_anonymous_vm_map; +pub type vm_map_entry_t = *mut vm_map_entry; + +pub type pmap = __c_anonymous_pmap; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum sem {} +impl ::Copy for sem {} +impl ::Clone for sem { + fn clone(&self) -> sem { + *self + } +} + +e! { + #[repr(u32)] + pub enum lwpstat { + LSRUN = 1, + LSSTOP = 2, + LSSLEEP = 3, + } + + #[repr(u32)] + pub enum procstat { + SIDL = 1, + SACTIVE = 2, + SSTOP = 3, + SZOMB = 4, + SCORE = 5, + } +} + +s! { + pub struct kevent { + pub ident: ::uintptr_t, + pub filter: ::c_short, + pub flags: ::c_ushort, + pub fflags: ::c_uint, + pub data: ::intptr_t, + pub udata: *mut ::c_void, + } + + pub struct exit_status { + pub e_termination: u16, + pub e_exit: u16 + } + + pub struct aiocb { + pub aio_fildes: ::c_int, + pub aio_offset: ::off_t, + pub aio_buf: *mut ::c_void, + pub aio_nbytes: ::size_t, + pub aio_sigevent: sigevent, + pub aio_lio_opcode: ::c_int, + pub aio_reqprio: ::c_int, + _aio_val: ::c_int, + _aio_err: ::c_int + } + + pub struct uuid { + pub time_low: u32, + pub time_mid: u16, + pub time_hi_and_version: u16, + pub clock_seq_hi_and_reserved: u8, + pub clock_seq_low: u8, + pub node: [u8; 6], + } + + pub struct mq_attr { + pub mq_flags: ::c_long, + pub mq_maxmsg: ::c_long, + pub mq_msgsize: ::c_long, + pub mq_curmsgs: ::c_long, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + pub f_owner: ::uid_t, + pub f_type: ::c_uint, + pub f_syncreads: u64, + pub f_syncwrites: u64, + pub f_asyncreads: u64, + pub f_asyncwrites: u64, + pub f_fsid_uuid: ::uuid_t, + pub f_uid_uuid: ::uuid_t, + } + + pub struct stat { + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_dev: ::dev_t, + pub st_mode: ::mode_t, + pub st_padding1: u16, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: i64, + pub __old_st_blksize: u32, + pub st_flags: u32, + pub st_gen: u32, + pub st_lspare: i32, + pub st_blksize: i64, + pub st_qspare2: i64, + } + + pub struct if_data { + pub ifi_type: ::c_uchar, + pub ifi_physical: ::c_uchar, + pub ifi_addrlen: ::c_uchar, + pub ifi_hdrlen: ::c_uchar, + pub ifi_recvquota: ::c_uchar, + pub ifi_xmitquota: ::c_uchar, + pub ifi_mtu: ::c_ulong, + pub ifi_metric: ::c_ulong, + pub ifi_link_state: ::c_ulong, + pub ifi_baudrate: u64, + pub ifi_ipackets: ::c_ulong, + pub ifi_ierrors: ::c_ulong, + pub ifi_opackets: ::c_ulong, + pub ifi_oerrors: ::c_ulong, + pub ifi_collisions: ::c_ulong, + pub ifi_ibytes: ::c_ulong, + pub ifi_obytes: ::c_ulong, + pub ifi_imcasts: ::c_ulong, + pub ifi_omcasts: ::c_ulong, + pub ifi_iqdrops: ::c_ulong, + pub ifi_noproto: ::c_ulong, + pub ifi_hwassist: ::c_ulong, + pub ifi_oqdrops: ::c_ulong, + pub ifi_lastchange: ::timeval, + } + + pub struct if_msghdr { + pub ifm_msglen: ::c_ushort, + pub ifm_version: ::c_uchar, + pub ifm_type: ::c_uchar, + pub ifm_addrs: ::c_int, + pub ifm_flags: ::c_int, + pub ifm_index: ::c_ushort, + pub ifm_data: if_data, + } + + pub struct sockaddr_dl { + pub sdl_len: ::c_uchar, + pub sdl_family: ::c_uchar, + pub sdl_index: ::c_ushort, + pub sdl_type: ::c_uchar, + pub sdl_nlen: ::c_uchar, + pub sdl_alen: ::c_uchar, + pub sdl_slen: ::c_uchar, + pub sdl_data: [::c_char; 12], + pub sdl_rcf: ::c_ushort, + pub sdl_route: [::c_ushort; 16], + } + + pub struct xucred { + pub cr_version: ::c_uint, + pub cr_uid: ::uid_t, + pub cr_ngroups: ::c_short, + pub cr_groups: [::gid_t; 16], + __cr_unused1: *mut ::c_void, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct cpumask_t { + ary: [u64; 4], + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + shm_internal: *mut ::c_void, + } + + pub struct kinfo_file { + pub f_size: ::size_t, + pub f_pid: ::pid_t, + pub f_uid: ::uid_t, + pub f_fd: ::c_int, + pub f_file: *mut ::c_void, + pub f_type: ::c_short, + pub f_count: ::c_int, + pub f_msgcount: ::c_int, + pub f_offset: ::off_t, + pub f_data: *mut ::c_void, + pub f_flag: ::c_uint, + } + + pub struct kinfo_cputime { + pub cp_user: u64, + pub cp_nice: u64, + pub cp_sys: u64, + pub cp_intr: u64, + pub cp_idel: u64, + cp_unused01: u64, + cp_unused02: u64, + pub cp_sample_pc: u64, + pub cp_sample_sp: u64, + pub cp_msg: [::c_char; 32], + } + + pub struct kinfo_lwp { + pub kl_pid: ::pid_t, + pub kl_tid: ::lwpid_t, + pub kl_flags: ::c_int, + pub kl_stat: ::lwpstat, + pub kl_lock: ::c_int, + pub kl_tdflags: ::c_int, + pub kl_mpcount: ::c_int, + pub kl_prio: ::c_int, + pub kl_tdprio: ::c_int, + pub kl_rtprio: ::rtprio, + pub kl_uticks: u64, + pub kl_sticks: u64, + pub kl_iticks: u64, + pub kl_cpticks: u64, + pub kl_pctcpu: ::c_uint, + pub kl_slptime: ::c_uint, + pub kl_origcpu: ::c_int, + pub kl_estcpu: ::c_int, + pub kl_cpuid: ::c_int, + pub kl_ru: ::rusage, + pub kl_siglist: ::sigset_t, + pub kl_sigmask: ::sigset_t, + pub kl_wchan: ::uintptr_t, + pub kl_wmesg: [::c_char; 9], + pub kl_comm: [::c_char; MAXCOMLEN+1], + } + + pub struct kinfo_proc { + pub kp_paddr: ::uintptr_t, + pub kp_flags: ::c_int, + pub kp_stat: ::procstat, + pub kp_lock: ::c_int, + pub kp_acflag: ::c_int, + pub kp_traceflag: ::c_int, + pub kp_fd: ::uintptr_t, + pub kp_siglist: ::sigset_t, + pub kp_sigignore: ::sigset_t, + pub kp_sigcatch: ::sigset_t, + pub kp_sigflag: ::c_int, + pub kp_start: ::timeval, + pub kp_comm: [::c_char; MAXCOMLEN+1], + pub kp_uid: ::uid_t, + pub kp_ngroups: ::c_short, + pub kp_groups: [::gid_t; NGROUPS], + pub kp_ruid: ::uid_t, + pub kp_svuid: ::uid_t, + pub kp_rgid: ::gid_t, + pub kp_svgid: ::gid_t, + pub kp_pid: ::pid_t, + pub kp_ppid: ::pid_t, + pub kp_pgid: ::pid_t, + pub kp_jobc: ::c_int, + pub kp_sid: ::pid_t, + pub kp_login: [::c_char; 40], // MAXNAMELEN rounded up to the nearest sizeof(long) + pub kp_tdev: ::dev_t, + pub kp_tpgid: ::pid_t, + pub kp_tsid: ::pid_t, + pub kp_exitstat: ::c_ushort, + pub kp_nthreads: ::c_int, + pub kp_nice: ::c_int, + pub kp_swtime: ::c_uint, + pub kp_vm_map_size: ::size_t, + pub kp_vm_rssize: ::segsz_t, + pub kp_vm_swrss: ::segsz_t, + pub kp_vm_tsize: ::segsz_t, + pub kp_vm_dsize: ::segsz_t, + pub kp_vm_ssize: ::segsz_t, + pub kp_vm_prssize: ::c_uint, + pub kp_jailid: ::c_int, + pub kp_ru: ::rusage, + pub kp_cru: ::rusage, + pub kp_auxflags: ::c_int, + pub kp_lwp: ::kinfo_lwp, + pub kp_ktaddr: ::uintptr_t, + kp_spare: [::c_int; 2], + } + + pub struct __c_anonymous_vm_map { + _priv: [::uintptr_t; 36], + } + + pub struct vm_map_entry { + _priv: [::uintptr_t; 15], + pub eflags: ::vm_eflags_t, + pub maptype: ::vm_maptype_t, + pub protection: ::vm_prot_t, + pub max_protection: ::vm_prot_t, + pub inheritance: ::vm_inherit_t, + pub wired_count: ::c_int, + pub id: ::vm_subsys_t, + } + + pub struct __c_anonymous_pmap { + _priv1: [::uintptr_t; 32], + _priv2: [::uintptr_t; 32], + _priv3: [::uintptr_t; 32], + _priv4: [::uintptr_t; 32], + _priv5: [::uintptr_t; 8], + } + + pub struct vmspace { + vm_map: __c_anonymous_vm_map, + vm_pmap: __c_anonymous_pmap, + pub vm_flags: ::c_int, + pub vm_shm: *mut ::c_char, + pub vm_rssize: ::segsz_t, + pub vm_swrss: ::segsz_t, + pub vm_tsize: ::segsz_t, + pub vm_dsize: ::segsz_t, + pub vm_ssize: ::segsz_t, + pub vm_taddr: *mut ::c_char, + pub vm_daddr: *mut ::c_char, + pub vm_maxsaddr: *mut ::c_char, + pub vm_minsaddr: *mut ::c_char, + _unused1: ::c_int, + _unused2: ::c_int, + pub vm_pagesupply: ::c_int, + pub vm_holdcnt: ::c_uint, + pub vm_refcnt: ::c_uint, + } + + pub struct cpuctl_msr_args_t { + pub msr: ::c_int, + pub data: u64, + } + + pub struct cpuctl_cpuid_args_t { + pub level: ::c_int, + pub data: [u32; 4], + } + + pub struct cpuctl_cpuid_count_args_t { + pub level: ::c_int, + pub level_type: ::c_int, + pub data: [u32; 4], + } + + pub struct cpuctl_update_args_t { + pub data: *mut ::c_void, + pub size: ::size_t, + } +} + +s_no_extra_traits! { + pub struct utmpx { + pub ut_name: [::c_char; 32], + pub ut_id: [::c_char; 4], + + pub ut_line: [::c_char; 32], + pub ut_host: [::c_char; 256], + + pub ut_unused: [u8; 16], + pub ut_session: u16, + pub ut_type: u16, + pub ut_pid: ::pid_t, + ut_exit: exit_status, + ut_ss: ::sockaddr_storage, + pub ut_tv: ::timeval, + pub ut_unused2: [u8; 16], + } + + pub struct lastlogx { + pub ll_tv: ::timeval, + pub ll_line: [::c_char; _UTX_LINESIZE], + pub ll_host: [::c_char; _UTX_HOSTSIZE], + pub ll_ss: ::sockaddr_storage, + } + + pub struct dirent { + pub d_fileno: ::ino_t, + pub d_namlen: u16, + pub d_type: u8, + __unused1: u8, + __unused2: u32, + pub d_name: [::c_char; 256], + } + + pub struct statfs { + __spare2: ::c_long, + pub f_bsize: ::c_long, + pub f_iosize: ::c_long, + pub f_blocks: ::c_long, + pub f_bfree: ::c_long, + pub f_bavail: ::c_long, + pub f_files: ::c_long, + pub f_ffree: ::c_long, + pub f_fsid: ::fsid_t, + pub f_owner: ::uid_t, + pub f_type: ::c_int, + pub f_flags: ::c_int, + pub f_syncwrites: ::c_long, + pub f_asyncwrites: ::c_long, + pub f_fstypename: [::c_char; 16], + pub f_mntonname: [::c_char; 80], + pub f_syncreads: ::c_long, + pub f_asyncreads: ::c_long, + __spares1: ::c_short, + pub f_mntfromname: [::c_char; 80], + __spares2: ::c_short, + __spare: [::c_long; 2], + } + + pub struct sigevent { + pub sigev_notify: ::c_int, + // The union is 8-byte in size, so it is aligned at a 8-byte offset. + #[cfg(target_pointer_width = "64")] + __unused1: ::c_int, + pub sigev_signo: ::c_int, //actually a union + // pad the union + #[cfg(target_pointer_width = "64")] + __unused2: ::c_int, + pub sigev_value: ::sigval, + __unused3: *mut ::c_void //actually a function pointer + } + + pub struct mcontext_t { + pub mc_onstack: register_t, + pub mc_rdi: register_t, + pub mc_rsi: register_t, + pub mc_rdx: register_t, + pub mc_rcx: register_t, + pub mc_r8: register_t, + pub mc_r9: register_t, + pub mc_rax: register_t, + pub mc_rbx: register_t, + pub mc_rbp: register_t, + pub mc_r10: register_t, + pub mc_r11: register_t, + pub mc_r12: register_t, + pub mc_r13: register_t, + pub mc_r14: register_t, + pub mc_r15: register_t, + pub mc_xflags: register_t, + pub mc_trapno: register_t, + pub mc_addr: register_t, + pub mc_flags: register_t, + pub mc_err: register_t, + pub mc_rip: register_t, + pub mc_cs: register_t, + pub mc_rflags: register_t, + pub mc_rsp: register_t, + pub mc_ss: register_t, + pub mc_len: ::c_uint, + pub mc_fpformat: ::c_uint, + pub mc_ownedfp: ::c_uint, + __reserved: ::c_uint, + __unused: [::c_uint; 8], + pub mc_fpregs: [[::c_uint; 8]; 32], + } + + pub struct ucontext_t { + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: mcontext_t, + pub uc_link: *mut ucontext_t, + pub uc_stack: stack_t, + pub uc_cofunc: ::Option, + pub uc_arg: *mut ::c_void, + __pad: [::c_int; 4], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for utmpx { + fn eq(&self, other: &utmpx) -> bool { + self.ut_name == other.ut_name + && self.ut_id == other.ut_id + && self.ut_line == other.ut_line + && self + .ut_host + .iter() + .zip(other.ut_host.iter()) + .all(|(a,b)| a == b) + && self.ut_unused == other.ut_unused + && self.ut_session == other.ut_session + && self.ut_type == other.ut_type + && self.ut_pid == other.ut_pid + && self.ut_exit == other.ut_exit + && self.ut_ss == other.ut_ss + && self.ut_tv == other.ut_tv + && self.ut_unused2 == other.ut_unused2 + } + } + impl Eq for utmpx {} + impl ::fmt::Debug for utmpx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmpx") + .field("ut_name", &self.ut_name) + .field("ut_id", &self.ut_id) + .field("ut_line", &self.ut_line) + // FIXME: .field("ut_host", &self.ut_host) + .field("ut_unused", &self.ut_unused) + .field("ut_session", &self.ut_session) + .field("ut_type", &self.ut_type) + .field("ut_pid", &self.ut_pid) + .field("ut_exit", &self.ut_exit) + .field("ut_ss", &self.ut_ss) + .field("ut_tv", &self.ut_tv) + .field("ut_unused2", &self.ut_unused2) + .finish() + } + } + impl ::hash::Hash for utmpx { + fn hash(&self, state: &mut H) { + self.ut_name.hash(state); + self.ut_id.hash(state); + self.ut_line.hash(state); + self.ut_host.hash(state); + self.ut_unused.hash(state); + self.ut_session.hash(state); + self.ut_type.hash(state); + self.ut_pid.hash(state); + self.ut_exit.hash(state); + self.ut_ss.hash(state); + self.ut_tv.hash(state); + self.ut_unused2.hash(state); + } + } + impl PartialEq for lastlogx { + fn eq(&self, other: &lastlogx) -> bool { + self.ll_tv == other.ll_tv + && self.ll_line == other.ll_line + && self.ll_host == other.ll_host + && self.ll_ss == other.ll_ss + } + } + impl Eq for lastlogx {} + impl ::fmt::Debug for lastlogx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("lastlogx") + .field("ll_tv", &self.ll_tv) + .field("ll_line", &self.ll_line) + .field("ll_host", &self.ll_host) + .field("ll_ss", &self.ll_ss) + .finish() + } + } + impl ::hash::Hash for lastlogx { + fn hash(&self, state: &mut H) { + self.ll_tv.hash(state); + self.ll_line.hash(state); + self.ll_host.hash(state); + self.ll_ss.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_fileno == other.d_fileno + && self.d_namlen == other.d_namlen + && self.d_type == other.d_type + // Ignore __unused1 + // Ignore __unused2 + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_fileno", &self.d_fileno) + .field("d_namlen", &self.d_namlen) + .field("d_type", &self.d_type) + // Ignore __unused1 + // Ignore __unused2 + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_fileno.hash(state); + self.d_namlen.hash(state); + self.d_type.hash(state); + // Ignore __unused1 + // Ignore __unused2 + self.d_name.hash(state); + } + } + + impl PartialEq for statfs { + fn eq(&self, other: &statfs) -> bool { + self.f_bsize == other.f_bsize + && self.f_iosize == other.f_iosize + && self.f_blocks == other.f_blocks + && self.f_bfree == other.f_bfree + && self.f_bavail == other.f_bavail + && self.f_files == other.f_files + && self.f_ffree == other.f_ffree + && self.f_fsid == other.f_fsid + && self.f_owner == other.f_owner + && self.f_type == other.f_type + && self.f_flags == other.f_flags + && self.f_syncwrites == other.f_syncwrites + && self.f_asyncwrites == other.f_asyncwrites + && self.f_fstypename == other.f_fstypename + && self + .f_mntonname + .iter() + .zip(other.f_mntonname.iter()) + .all(|(a,b)| a == b) + && self.f_syncreads == other.f_syncreads + && self.f_asyncreads == other.f_asyncreads + && self + .f_mntfromname + .iter() + .zip(other.f_mntfromname.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for statfs {} + impl ::fmt::Debug for statfs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("statfs") + .field("f_bsize", &self.f_bsize) + .field("f_iosize", &self.f_iosize) + .field("f_blocks", &self.f_blocks) + .field("f_bfree", &self.f_bfree) + .field("f_bavail", &self.f_bavail) + .field("f_files", &self.f_files) + .field("f_ffree", &self.f_ffree) + .field("f_fsid", &self.f_fsid) + .field("f_owner", &self.f_owner) + .field("f_type", &self.f_type) + .field("f_flags", &self.f_flags) + .field("f_syncwrites", &self.f_syncwrites) + .field("f_asyncwrites", &self.f_asyncwrites) + // FIXME: .field("f_mntonname", &self.f_mntonname) + .field("f_syncreads", &self.f_syncreads) + .field("f_asyncreads", &self.f_asyncreads) + // FIXME: .field("f_mntfromname", &self.f_mntfromname) + .finish() + } + } + impl ::hash::Hash for statfs { + fn hash(&self, state: &mut H) { + self.f_bsize.hash(state); + self.f_iosize.hash(state); + self.f_blocks.hash(state); + self.f_bfree.hash(state); + self.f_bavail.hash(state); + self.f_files.hash(state); + self.f_ffree.hash(state); + self.f_fsid.hash(state); + self.f_owner.hash(state); + self.f_type.hash(state); + self.f_flags.hash(state); + self.f_syncwrites.hash(state); + self.f_asyncwrites.hash(state); + self.f_fstypename.hash(state); + self.f_mntonname.hash(state); + self.f_syncreads.hash(state); + self.f_asyncreads.hash(state); + self.f_mntfromname.hash(state); + } + } + + impl PartialEq for sigevent { + fn eq(&self, other: &sigevent) -> bool { + self.sigev_notify == other.sigev_notify + && self.sigev_signo == other.sigev_signo + && self.sigev_value == other.sigev_value + } + } + impl Eq for sigevent {} + impl ::fmt::Debug for sigevent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigevent") + .field("sigev_notify", &self.sigev_notify) + .field("sigev_signo", &self.sigev_signo) + .field("sigev_value", &self.sigev_value) + .finish() + } + } + impl ::hash::Hash for sigevent { + fn hash(&self, state: &mut H) { + self.sigev_notify.hash(state); + self.sigev_signo.hash(state); + self.sigev_value.hash(state); + } + } + impl PartialEq for mcontext_t { + fn eq(&self, other: &mcontext_t) -> bool { + self.mc_onstack == other.mc_onstack && + self.mc_rdi == other.mc_rdi && + self.mc_rsi == other.mc_rsi && + self.mc_rdx == other.mc_rdx && + self.mc_rcx == other.mc_rcx && + self.mc_r8 == other.mc_r8 && + self.mc_r9 == other.mc_r9 && + self.mc_rax == other.mc_rax && + self.mc_rbx == other.mc_rbx && + self.mc_rbp == other.mc_rbp && + self.mc_r10 == other.mc_r10 && + self.mc_r11 == other.mc_r11 && + self.mc_r12 == other.mc_r12 && + self.mc_r13 == other.mc_r13 && + self.mc_r14 == other.mc_r14 && + self.mc_r15 == other.mc_r15 && + self.mc_xflags == other.mc_xflags && + self.mc_trapno == other.mc_trapno && + self.mc_addr == other.mc_addr && + self.mc_flags == other.mc_flags && + self.mc_err == other.mc_err && + self.mc_rip == other.mc_rip && + self.mc_cs == other.mc_cs && + self.mc_rflags == other.mc_rflags && + self.mc_rsp == other.mc_rsp && + self.mc_ss == other.mc_ss && + self.mc_len == other.mc_len && + self.mc_fpformat == other.mc_fpformat && + self.mc_ownedfp == other.mc_ownedfp && + self.mc_fpregs.iter().zip(other.mc_fpregs.iter()). + all(|(a, b)| a == b) + } + } + impl Eq for mcontext_t {} + impl ::fmt::Debug for mcontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mcontext_t") + .field("mc_onstack", &self.mc_onstack) + .field("mc_rdi", &self.mc_rdi) + .field("mc_rsi", &self.mc_rsi) + .field("mc_rdx", &self.mc_rdx) + .field("mc_rcx", &self.mc_rcx) + .field("mc_r8", &self.mc_r8) + .field("mc_r9", &self.mc_r9) + .field("mc_rax", &self.mc_rax) + .field("mc_rbx", &self.mc_rbx) + .field("mc_rbp", &self.mc_rbp) + .field("mc_r10", &self.mc_r10) + .field("mc_r11", &self.mc_r11) + .field("mc_r12", &self.mc_r12) + .field("mc_r13", &self.mc_r13) + .field("mc_r14", &self.mc_r14) + .field("mc_r15", &self.mc_r15) + .field("mc_xflags", &self.mc_xflags) + .field("mc_trapno", &self.mc_trapno) + .field("mc_addr", &self.mc_addr) + .field("mc_flags", &self.mc_flags) + .field("mc_err", &self.mc_err) + .field("mc_rip", &self.mc_rip) + .field("mc_cs", &self.mc_cs) + .field("mc_rflags", &self.mc_rflags) + .field("mc_rsp", &self.mc_rsp) + .field("mc_ss", &self.mc_ss) + .field("mc_len", &self.mc_len) + .field("mc_fpformat", &self.mc_fpformat) + .field("mc_ownedfp", &self.mc_ownedfp) + .field("mc_fpregs", &self.mc_fpregs) + .finish() + } + } + impl ::hash::Hash for mcontext_t { + fn hash(&self, state: &mut H) { + self.mc_onstack.hash(state); + self.mc_rdi.hash(state); + self.mc_rsi.hash(state); + self.mc_rdx.hash(state); + self.mc_rcx.hash(state); + self.mc_r8.hash(state); + self.mc_r9.hash(state); + self.mc_rax.hash(state); + self.mc_rbx.hash(state); + self.mc_rbp.hash(state); + self.mc_r10.hash(state); + self.mc_r11.hash(state); + self.mc_r10.hash(state); + self.mc_r11.hash(state); + self.mc_r12.hash(state); + self.mc_r13.hash(state); + self.mc_r14.hash(state); + self.mc_r15.hash(state); + self.mc_xflags.hash(state); + self.mc_trapno.hash(state); + self.mc_addr.hash(state); + self.mc_flags.hash(state); + self.mc_err.hash(state); + self.mc_rip.hash(state); + self.mc_cs.hash(state); + self.mc_rflags.hash(state); + self.mc_rsp.hash(state); + self.mc_ss.hash(state); + self.mc_len.hash(state); + self.mc_fpformat.hash(state); + self.mc_ownedfp.hash(state); + self.mc_fpregs.hash(state); + } + } + impl PartialEq for ucontext_t { + fn eq(&self, other: &ucontext_t) -> bool { + self.uc_sigmask == other.uc_sigmask + && self.uc_mcontext == other.uc_mcontext + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_cofunc == other.uc_cofunc + && self.uc_arg == other.uc_arg + } + } + impl Eq for ucontext_t {} + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_sigmask", &self.uc_sigmask) + .field("uc_mcontext", &self.uc_mcontext) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_cofunc", &self.uc_cofunc) + .field("uc_arg", &self.uc_arg) + .finish() + } + } + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_sigmask.hash(state); + self.uc_mcontext.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_cofunc.hash(state); + self.uc_arg.hash(state); + } + } + } +} + +pub const RAND_MAX: ::c_int = 0x7fff_ffff; +pub const PTHREAD_STACK_MIN: ::size_t = 16384; +pub const SIGSTKSZ: ::size_t = 40960; +pub const SIGCKPT: ::c_int = 33; +pub const SIGCKPTEXIT: ::c_int = 34; +pub const CKPT_FREEZE: ::c_int = 0x1; +pub const CKPT_THAW: ::c_int = 0x2; +pub const MADV_INVAL: ::c_int = 10; +pub const MADV_SETMAP: ::c_int = 11; +pub const O_CLOEXEC: ::c_int = 0x00020000; +pub const O_DIRECTORY: ::c_int = 0x08000000; +pub const F_GETLK: ::c_int = 7; +pub const F_SETLK: ::c_int = 8; +pub const F_SETLKW: ::c_int = 9; +pub const F_GETPATH: ::c_int = 19; +pub const ENOMEDIUM: ::c_int = 93; +pub const ENOTRECOVERABLE: ::c_int = 94; +pub const EOWNERDEAD: ::c_int = 95; +pub const EASYNC: ::c_int = 99; +pub const ELAST: ::c_int = 99; +pub const RLIMIT_POSIXLOCKS: ::c_int = 11; +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] +pub const RLIM_NLIMITS: ::rlim_t = 12; + +pub const Q_GETQUOTA: ::c_int = 0x300; +pub const Q_SETQUOTA: ::c_int = 0x400; + +pub const CTL_UNSPEC: ::c_int = 0; +pub const CTL_KERN: ::c_int = 1; +pub const CTL_VM: ::c_int = 2; +pub const CTL_VFS: ::c_int = 3; +pub const CTL_NET: ::c_int = 4; +pub const CTL_DEBUG: ::c_int = 5; +pub const CTL_HW: ::c_int = 6; +pub const CTL_MACHDEP: ::c_int = 7; +pub const CTL_USER: ::c_int = 8; +pub const CTL_P1003_1B: ::c_int = 9; +pub const CTL_LWKT: ::c_int = 10; +pub const CTL_MAXID: ::c_int = 11; +pub const KERN_OSTYPE: ::c_int = 1; +pub const KERN_OSRELEASE: ::c_int = 2; +pub const KERN_OSREV: ::c_int = 3; +pub const KERN_VERSION: ::c_int = 4; +pub const KERN_MAXVNODES: ::c_int = 5; +pub const KERN_MAXPROC: ::c_int = 6; +pub const KERN_MAXFILES: ::c_int = 7; +pub const KERN_ARGMAX: ::c_int = 8; +pub const KERN_SECURELVL: ::c_int = 9; +pub const KERN_HOSTNAME: ::c_int = 10; +pub const KERN_HOSTID: ::c_int = 11; +pub const KERN_CLOCKRATE: ::c_int = 12; +pub const KERN_VNODE: ::c_int = 13; +pub const KERN_PROC: ::c_int = 14; +pub const KERN_FILE: ::c_int = 15; +pub const KERN_PROF: ::c_int = 16; +pub const KERN_POSIX1: ::c_int = 17; +pub const KERN_NGROUPS: ::c_int = 18; +pub const KERN_JOB_CONTROL: ::c_int = 19; +pub const KERN_SAVED_IDS: ::c_int = 20; +pub const KERN_BOOTTIME: ::c_int = 21; +pub const KERN_NISDOMAINNAME: ::c_int = 22; +pub const KERN_UPDATEINTERVAL: ::c_int = 23; +pub const KERN_OSRELDATE: ::c_int = 24; +pub const KERN_NTP_PLL: ::c_int = 25; +pub const KERN_BOOTFILE: ::c_int = 26; +pub const KERN_MAXFILESPERPROC: ::c_int = 27; +pub const KERN_MAXPROCPERUID: ::c_int = 28; +pub const KERN_DUMPDEV: ::c_int = 29; +pub const KERN_IPC: ::c_int = 30; +pub const KERN_DUMMY: ::c_int = 31; +pub const KERN_PS_STRINGS: ::c_int = 32; +pub const KERN_USRSTACK: ::c_int = 33; +pub const KERN_LOGSIGEXIT: ::c_int = 34; +pub const KERN_IOV_MAX: ::c_int = 35; +pub const KERN_MAXPOSIXLOCKSPERUID: ::c_int = 36; +pub const KERN_MAXID: ::c_int = 37; +pub const KERN_PROC_ALL: ::c_int = 0; +pub const KERN_PROC_PID: ::c_int = 1; +pub const KERN_PROC_PGRP: ::c_int = 2; +pub const KERN_PROC_SESSION: ::c_int = 3; +pub const KERN_PROC_TTY: ::c_int = 4; +pub const KERN_PROC_UID: ::c_int = 5; +pub const KERN_PROC_RUID: ::c_int = 6; +pub const KERN_PROC_ARGS: ::c_int = 7; +pub const KERN_PROC_CWD: ::c_int = 8; +pub const KERN_PROC_PATHNAME: ::c_int = 9; +pub const KERN_PROC_FLAGMASK: ::c_int = 0x10; +pub const KERN_PROC_FLAG_LWP: ::c_int = 0x10; +pub const KIPC_MAXSOCKBUF: ::c_int = 1; +pub const KIPC_SOCKBUF_WASTE: ::c_int = 2; +pub const KIPC_SOMAXCONN: ::c_int = 3; +pub const KIPC_MAX_LINKHDR: ::c_int = 4; +pub const KIPC_MAX_PROTOHDR: ::c_int = 5; +pub const KIPC_MAX_HDR: ::c_int = 6; +pub const KIPC_MAX_DATALEN: ::c_int = 7; +pub const KIPC_MBSTAT: ::c_int = 8; +pub const KIPC_NMBCLUSTERS: ::c_int = 9; +pub const HW_MACHINE: ::c_int = 1; +pub const HW_MODEL: ::c_int = 2; +pub const HW_NCPU: ::c_int = 3; +pub const HW_BYTEORDER: ::c_int = 4; +pub const HW_PHYSMEM: ::c_int = 5; +pub const HW_USERMEM: ::c_int = 6; +pub const HW_PAGESIZE: ::c_int = 7; +pub const HW_DISKNAMES: ::c_int = 8; +pub const HW_DISKSTATS: ::c_int = 9; +pub const HW_FLOATINGPT: ::c_int = 10; +pub const HW_MACHINE_ARCH: ::c_int = 11; +pub const HW_MACHINE_PLATFORM: ::c_int = 12; +pub const HW_SENSORS: ::c_int = 13; +pub const HW_MAXID: ::c_int = 14; +pub const USER_CS_PATH: ::c_int = 1; +pub const USER_BC_BASE_MAX: ::c_int = 2; +pub const USER_BC_DIM_MAX: ::c_int = 3; +pub const USER_BC_SCALE_MAX: ::c_int = 4; +pub const USER_BC_STRING_MAX: ::c_int = 5; +pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6; +pub const USER_EXPR_NEST_MAX: ::c_int = 7; +pub const USER_LINE_MAX: ::c_int = 8; +pub const USER_RE_DUP_MAX: ::c_int = 9; +pub const USER_POSIX2_VERSION: ::c_int = 10; +pub const USER_POSIX2_C_BIND: ::c_int = 11; +pub const USER_POSIX2_C_DEV: ::c_int = 12; +pub const USER_POSIX2_CHAR_TERM: ::c_int = 13; +pub const USER_POSIX2_FORT_DEV: ::c_int = 14; +pub const USER_POSIX2_FORT_RUN: ::c_int = 15; +pub const USER_POSIX2_LOCALEDEF: ::c_int = 16; +pub const USER_POSIX2_SW_DEV: ::c_int = 17; +pub const USER_POSIX2_UPE: ::c_int = 18; +pub const USER_STREAM_MAX: ::c_int = 19; +pub const USER_TZNAME_MAX: ::c_int = 20; +pub const USER_MAXID: ::c_int = 21; +pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1; +pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2; +pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3; +pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4; +pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5; +pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6; +pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7; +pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8; +pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9; +pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10; +pub const CTL_P1003_1B_FSYNC: ::c_int = 11; +pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12; +pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13; +pub const CTL_P1003_1B_TIMERS: ::c_int = 14; +pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15; +pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16; +pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17; +pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18; +pub const CTL_P1003_1B_UNUSED1: ::c_int = 19; +pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20; +pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21; +pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22; +pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23; +pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24; +pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25; +pub const CTL_P1003_1B_MAXID: ::c_int = 26; + +pub const CPUCTL_RSMSR: ::c_int = 0xc0106301; +pub const CPUCTL_WRMSR: ::c_int = 0xc0106302; +pub const CPUCTL_CPUID: ::c_int = 0xc0106303; +pub const CPUCTL_UPDATE: ::c_int = 0xc0106304; +pub const CPUCTL_MSRSBIT: ::c_int = 0xc0106305; +pub const CPUCTL_MSRCBIT: ::c_int = 0xc0106306; +pub const CPUCTL_CPUID_COUNT: ::c_int = 0xc0106307; + +pub const EVFILT_READ: i16 = -1; +pub const EVFILT_WRITE: i16 = -2; +pub const EVFILT_AIO: i16 = -3; +pub const EVFILT_VNODE: i16 = -4; +pub const EVFILT_PROC: i16 = -5; +pub const EVFILT_SIGNAL: i16 = -6; +pub const EVFILT_TIMER: i16 = -7; +pub const EVFILT_EXCEPT: i16 = -8; +pub const EVFILT_USER: i16 = -9; +pub const EVFILT_FS: i16 = -10; + +pub const EV_ADD: u16 = 0x1; +pub const EV_DELETE: u16 = 0x2; +pub const EV_ENABLE: u16 = 0x4; +pub const EV_DISABLE: u16 = 0x8; +pub const EV_ONESHOT: u16 = 0x10; +pub const EV_CLEAR: u16 = 0x20; +pub const EV_RECEIPT: u16 = 0x40; +pub const EV_DISPATCH: u16 = 0x80; +pub const EV_NODATA: u16 = 0x1000; +pub const EV_FLAG1: u16 = 0x2000; +pub const EV_ERROR: u16 = 0x4000; +pub const EV_EOF: u16 = 0x8000; +pub const EV_SYSFLAGS: u16 = 0xf000; + +pub const FIODNAME: ::c_ulong = 0x80106678; + +pub const NOTE_TRIGGER: u32 = 0x01000000; +pub const NOTE_FFNOP: u32 = 0x00000000; +pub const NOTE_FFAND: u32 = 0x40000000; +pub const NOTE_FFOR: u32 = 0x80000000; +pub const NOTE_FFCOPY: u32 = 0xc0000000; +pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; +pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; +pub const NOTE_LOWAT: u32 = 0x00000001; +pub const NOTE_OOB: u32 = 0x00000002; +pub const NOTE_DELETE: u32 = 0x00000001; +pub const NOTE_WRITE: u32 = 0x00000002; +pub const NOTE_EXTEND: u32 = 0x00000004; +pub const NOTE_ATTRIB: u32 = 0x00000008; +pub const NOTE_LINK: u32 = 0x00000010; +pub const NOTE_RENAME: u32 = 0x00000020; +pub const NOTE_REVOKE: u32 = 0x00000040; +pub const NOTE_EXIT: u32 = 0x80000000; +pub const NOTE_FORK: u32 = 0x40000000; +pub const NOTE_EXEC: u32 = 0x20000000; +pub const NOTE_PDATAMASK: u32 = 0x000fffff; +pub const NOTE_PCTRLMASK: u32 = 0xf0000000; +pub const NOTE_TRACK: u32 = 0x00000001; +pub const NOTE_TRACKERR: u32 = 0x00000002; +pub const NOTE_CHILD: u32 = 0x00000004; + +pub const SO_SNDSPACE: ::c_int = 0x100a; +pub const SO_CPUHINT: ::c_int = 0x1030; +pub const SO_PASSCRED: ::c_int = 0x4000; + +pub const PT_FIRSTMACH: ::c_int = 32; + +pub const PROC_REAP_ACQUIRE: ::c_int = 0x0001; +pub const PROC_REAP_RELEASE: ::c_int = 0x0002; +pub const PROC_REAP_STATUS: ::c_int = 0x0003; +pub const PROC_PDEATHSIG_CTL: ::c_int = 0x0004; +pub const PROC_PDEATHSIG_STATUS: ::c_int = 0x0005; + +// https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/net/if.h#L101 +pub const IFF_UP: ::c_int = 0x1; // interface is up +pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid +pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging +pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net +pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link +pub const IFF_SMART: ::c_int = 0x20; // interface manages own routes +pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated +pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol +pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets +pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets +pub const IFF_OACTIVE_COMPAT: ::c_int = 0x400; // was transmission in progress +pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions +pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit +pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit +pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit +pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection +pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast + // was interface is in polling mode +pub const IFF_POLLING_COMPAT: ::c_int = 0x10000; +pub const IFF_PPROMISC: ::c_int = 0x20000; // user-requested promisc mode +pub const IFF_MONITOR: ::c_int = 0x40000; // user-requested monitor mode +pub const IFF_STATICARP: ::c_int = 0x80000; // static ARP +pub const IFF_NPOLLING: ::c_int = 0x100000; // interface is in polling mode +pub const IFF_IDIRECT: ::c_int = 0x200000; // direct input + +// +// sys/netinet/in.h +// Protocols (RFC 1700) +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// IP6 hop-by-hop options +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// gateway^2 (deprecated) +pub const IPPROTO_GGP: ::c_int = 3; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// Stream protocol II. +pub const IPPROTO_ST: ::c_int = 7; +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// private interior gateway +pub const IPPROTO_PIGP: ::c_int = 9; +/// BBN RCC Monitoring +pub const IPPROTO_RCCMON: ::c_int = 10; +/// network voice protocol +pub const IPPROTO_NVPII: ::c_int = 11; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +/// Argus +pub const IPPROTO_ARGUS: ::c_int = 13; +/// EMCON +pub const IPPROTO_EMCON: ::c_int = 14; +/// Cross Net Debugger +pub const IPPROTO_XNET: ::c_int = 15; +/// Chaos +pub const IPPROTO_CHAOS: ::c_int = 16; +// IPPROTO_UDP defined in src/unix/mod.rs +/// Multiplexing +pub const IPPROTO_MUX: ::c_int = 18; +/// DCN Measurement Subsystems +pub const IPPROTO_MEAS: ::c_int = 19; +/// Host Monitoring +pub const IPPROTO_HMP: ::c_int = 20; +/// Packet Radio Measurement +pub const IPPROTO_PRM: ::c_int = 21; +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// Trunk-1 +pub const IPPROTO_TRUNK1: ::c_int = 23; +/// Trunk-2 +pub const IPPROTO_TRUNK2: ::c_int = 24; +/// Leaf-1 +pub const IPPROTO_LEAF1: ::c_int = 25; +/// Leaf-2 +pub const IPPROTO_LEAF2: ::c_int = 26; +/// Reliable Data +pub const IPPROTO_RDP: ::c_int = 27; +/// Reliable Transaction +pub const IPPROTO_IRTP: ::c_int = 28; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// Bulk Data Transfer +pub const IPPROTO_BLT: ::c_int = 30; +/// Network Services +pub const IPPROTO_NSP: ::c_int = 31; +/// Merit Internodal +pub const IPPROTO_INP: ::c_int = 32; +/// Sequential Exchange +pub const IPPROTO_SEP: ::c_int = 33; +/// Third Party Connect +pub const IPPROTO_3PC: ::c_int = 34; +/// InterDomain Policy Routing +pub const IPPROTO_IDPR: ::c_int = 35; +/// XTP +pub const IPPROTO_XTP: ::c_int = 36; +/// Datagram Delivery +pub const IPPROTO_DDP: ::c_int = 37; +/// Control Message Transport +pub const IPPROTO_CMTP: ::c_int = 38; +/// TP++ Transport +pub const IPPROTO_TPXX: ::c_int = 39; +/// IL transport protocol +pub const IPPROTO_IL: ::c_int = 40; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// Source Demand Routing +pub const IPPROTO_SDRP: ::c_int = 42; +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// InterDomain Routing +pub const IPPROTO_IDRP: ::c_int = 45; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// Mobile Host Routing +pub const IPPROTO_MHRP: ::c_int = 48; +/// BHA +pub const IPPROTO_BHA: ::c_int = 49; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +/// Integ. Net Layer Security +pub const IPPROTO_INLSP: ::c_int = 52; +/// IP with encryption +pub const IPPROTO_SWIPE: ::c_int = 53; +/// Next Hop Resolution +pub const IPPROTO_NHRP: ::c_int = 54; +/// IP Mobility +pub const IPPROTO_MOBILE: ::c_int = 55; +/// Transport Layer Security +pub const IPPROTO_TLSP: ::c_int = 56; +/// SKIP +pub const IPPROTO_SKIP: ::c_int = 57; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +/// any host internal protocol +pub const IPPROTO_AHIP: ::c_int = 61; +/// CFTP +pub const IPPROTO_CFTP: ::c_int = 62; +/// "hello" routing protocol +pub const IPPROTO_HELLO: ::c_int = 63; +/// SATNET/Backroom EXPAK +pub const IPPROTO_SATEXPAK: ::c_int = 64; +/// Kryptolan +pub const IPPROTO_KRYPTOLAN: ::c_int = 65; +/// Remote Virtual Disk +pub const IPPROTO_RVD: ::c_int = 66; +/// Pluribus Packet Core +pub const IPPROTO_IPPC: ::c_int = 67; +/// Any distributed FS +pub const IPPROTO_ADFS: ::c_int = 68; +/// Satnet Monitoring +pub const IPPROTO_SATMON: ::c_int = 69; +/// VISA Protocol +pub const IPPROTO_VISA: ::c_int = 70; +/// Packet Core Utility +pub const IPPROTO_IPCV: ::c_int = 71; +/// Comp. Prot. Net. Executive +pub const IPPROTO_CPNX: ::c_int = 72; +/// Comp. Prot. HeartBeat +pub const IPPROTO_CPHB: ::c_int = 73; +/// Wang Span Network +pub const IPPROTO_WSN: ::c_int = 74; +/// Packet Video Protocol +pub const IPPROTO_PVP: ::c_int = 75; +/// BackRoom SATNET Monitoring +pub const IPPROTO_BRSATMON: ::c_int = 76; +/// Sun net disk proto (temp.) +pub const IPPROTO_ND: ::c_int = 77; +/// WIDEBAND Monitoring +pub const IPPROTO_WBMON: ::c_int = 78; +/// WIDEBAND EXPAK +pub const IPPROTO_WBEXPAK: ::c_int = 79; +/// ISO cnlp +pub const IPPROTO_EON: ::c_int = 80; +/// VMTP +pub const IPPROTO_VMTP: ::c_int = 81; +/// Secure VMTP +pub const IPPROTO_SVMTP: ::c_int = 82; +/// Banyon VINES +pub const IPPROTO_VINES: ::c_int = 83; +/// TTP +pub const IPPROTO_TTP: ::c_int = 84; +/// NSFNET-IGP +pub const IPPROTO_IGP: ::c_int = 85; +/// dissimilar gateway prot. +pub const IPPROTO_DGP: ::c_int = 86; +/// TCF +pub const IPPROTO_TCF: ::c_int = 87; +/// Cisco/GXS IGRP +pub const IPPROTO_IGRP: ::c_int = 88; +/// OSPFIGP +pub const IPPROTO_OSPFIGP: ::c_int = 89; +/// Strite RPC protocol +pub const IPPROTO_SRPC: ::c_int = 90; +/// Locus Address Resoloution +pub const IPPROTO_LARP: ::c_int = 91; +/// Multicast Transport +pub const IPPROTO_MTP: ::c_int = 92; +/// AX.25 Frames +pub const IPPROTO_AX25: ::c_int = 93; +/// IP encapsulated in IP +pub const IPPROTO_IPEIP: ::c_int = 94; +/// Mobile Int.ing control +pub const IPPROTO_MICP: ::c_int = 95; +/// Semaphore Comm. security +pub const IPPROTO_SCCSP: ::c_int = 96; +/// Ethernet IP encapsulation +pub const IPPROTO_ETHERIP: ::c_int = 97; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// any private encr. scheme +pub const IPPROTO_APES: ::c_int = 99; +/// GMTP +pub const IPPROTO_GMTP: ::c_int = 100; +/// payload compression (IPComp) +pub const IPPROTO_IPCOMP: ::c_int = 108; + +/* 101-254: Partly Unassigned */ +/// Protocol Independent Mcast +pub const IPPROTO_PIM: ::c_int = 103; +/// CARP +pub const IPPROTO_CARP: ::c_int = 112; +/// PGM +pub const IPPROTO_PGM: ::c_int = 113; +/// PFSYNC +pub const IPPROTO_PFSYNC: ::c_int = 240; + +/* 255: Reserved */ +/* BSD Private, local use, namespace incursion, no longer used */ +/// divert pseudo-protocol +pub const IPPROTO_DIVERT: ::c_int = 254; +pub const IPPROTO_MAX: ::c_int = 256; +/// last return value of *_input(), meaning "all job for this pkt is done". +pub const IPPROTO_DONE: ::c_int = 257; + +/// Used by RSS: the layer3 protocol is unknown +pub const IPPROTO_UNKNOWN: ::c_int = 258; + +// sys/netinet/tcp.h +pub const TCP_SIGNATURE_ENABLE: ::c_int = 16; +pub const TCP_KEEPINIT: ::c_int = 32; +pub const TCP_FASTKEEP: ::c_int = 128; + +pub const AF_BLUETOOTH: ::c_int = 33; +pub const AF_MPLS: ::c_int = 34; +pub const AF_IEEE80211: ::c_int = 35; + +pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; + +pub const NET_RT_DUMP: ::c_int = 1; +pub const NET_RT_FLAGS: ::c_int = 2; +pub const NET_RT_IFLIST: ::c_int = 3; +pub const NET_RT_MAXID: ::c_int = 4; + +pub const SOMAXOPT_SIZE: ::c_int = 65536; + +pub const MSG_UNUSED09: ::c_int = 0x00000200; +pub const MSG_NOSIGNAL: ::c_int = 0x00000400; +pub const MSG_SYNC: ::c_int = 0x00000800; +pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00001000; +pub const MSG_FBLOCKING: ::c_int = 0x00010000; +pub const MSG_FNONBLOCKING: ::c_int = 0x00020000; +pub const MSG_FMASK: ::c_int = 0xFFFF0000; + +// utmpx entry types +pub const EMPTY: ::c_short = 0; +pub const RUN_LVL: ::c_short = 1; +pub const BOOT_TIME: ::c_short = 2; +pub const OLD_TIME: ::c_short = 3; +pub const NEW_TIME: ::c_short = 4; +pub const INIT_PROCESS: ::c_short = 5; +pub const LOGIN_PROCESS: ::c_short = 6; +pub const USER_PROCESS: ::c_short = 7; +pub const DEAD_PROCESS: ::c_short = 8; +pub const ACCOUNTING: ::c_short = 9; +pub const SIGNATURE: ::c_short = 10; +pub const DOWNTIME: ::c_short = 11; +// utmpx database types +pub const UTX_DB_UTMPX: ::c_uint = 0; +pub const UTX_DB_WTMPX: ::c_uint = 1; +pub const UTX_DB_LASTLOG: ::c_uint = 2; +pub const _UTX_LINESIZE: usize = 32; +pub const _UTX_USERSIZE: usize = 32; +pub const _UTX_IDSIZE: usize = 4; +pub const _UTX_HOSTSIZE: usize = 256; + +pub const LC_COLLATE_MASK: ::c_int = 1 << 0; +pub const LC_CTYPE_MASK: ::c_int = 1 << 1; +pub const LC_MONETARY_MASK: ::c_int = 1 << 2; +pub const LC_NUMERIC_MASK: ::c_int = 1 << 3; +pub const LC_TIME_MASK: ::c_int = 1 << 4; +pub const LC_MESSAGES_MASK: ::c_int = 1 << 5; +pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK + | LC_CTYPE_MASK + | LC_MESSAGES_MASK + | LC_MONETARY_MASK + | LC_NUMERIC_MASK + | LC_TIME_MASK; + +pub const TIOCSIG: ::c_ulong = 0x2000745f; +pub const BTUARTDISC: ::c_int = 0x7; +pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458; +pub const TIOCISPTMASTER: ::c_ulong = 0x20007455; +pub const TIOCMODG: ::c_ulong = 0x40047403; +pub const TIOCMODS: ::c_ulong = 0x80047404; +pub const TIOCREMOTE: ::c_ulong = 0x80047469; + +// Constants used by "at" family of system calls. +pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1; +pub const AT_REMOVEDIR: ::c_int = 2; +pub const AT_EACCESS: ::c_int = 4; +pub const AT_SYMLINK_FOLLOW: ::c_int = 8; + +pub const VCHECKPT: usize = 19; + +pub const _PC_2_SYMLINKS: ::c_int = 22; +pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 23; + +pub const _SC_V7_ILP32_OFF32: ::c_int = 122; +pub const _SC_V7_ILP32_OFFBIG: ::c_int = 123; +pub const _SC_V7_LP64_OFF64: ::c_int = 124; +pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 125; +pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 126; +pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127; + +pub const WCONTINUED: ::c_int = 0x4; +pub const WSTOPPED: ::c_int = 0x2; +pub const WNOWAIT: ::c_int = 0x8; +pub const WEXITED: ::c_int = 0x10; +pub const WTRAPPED: ::c_int = 0x20; + +// Similar to FreeBSD, only the standardized ones are exposed. +// There are more. +pub const P_PID: idtype_t = 0; +pub const P_PGID: idtype_t = 2; +pub const P_ALL: idtype_t = 7; + +// Values for struct rtprio (type_ field) +pub const RTP_PRIO_REALTIME: ::c_ushort = 0; +pub const RTP_PRIO_NORMAL: ::c_ushort = 1; +pub const RTP_PRIO_IDLE: ::c_ushort = 2; +pub const RTP_PRIO_THREAD: ::c_ushort = 3; + +// Flags for chflags(2) +pub const UF_NOHISTORY: ::c_ulong = 0x00000040; +pub const UF_CACHE: ::c_ulong = 0x00000080; +pub const UF_XLINK: ::c_ulong = 0x00000100; +pub const SF_NOHISTORY: ::c_ulong = 0x00400000; +pub const SF_CACHE: ::c_ulong = 0x00800000; +pub const SF_XLINK: ::c_ulong = 0x01000000; + +// timespec constants +pub const UTIME_OMIT: c_long = -2; +pub const UTIME_NOW: c_long = -1; + +pub const MINCORE_SUPER: ::c_int = 0x20; + +// kinfo_proc constants +pub const MAXCOMLEN: usize = 16; +pub const MAXLOGNAME: usize = 33; +pub const NGROUPS: usize = 16; + +const_fn! { + {const} fn _CMSG_ALIGN(n: usize) -> usize { + (n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1) + } +} + +f! { + pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { + (cmsg as *mut ::c_uchar) + .offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) + } + + pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + length as usize) + as ::c_uint + } + + pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr) + -> *mut ::cmsghdr + { + let next = cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize) + + _CMSG_ALIGN(::mem::size_of::<::cmsghdr>()); + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if next <= max { + (cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize)) + as *mut ::cmsghdr + } else { + 0 as *mut ::cmsghdr + } + } + + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + (_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + + _CMSG_ALIGN(length as usize)) as ::c_uint + } + + pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { + for slot in cpuset.ary.iter_mut() { + *slot = 0; + } + } + + pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let (idx, offset) = ((cpu >> 6) & 3, cpu & 63); + cpuset.ary[idx] |= 1 << offset; + () + } + + pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let (idx, offset) = ((cpu >> 6) & 3, cpu & 63); + cpuset.ary[idx] &= !(1 << offset); + () + } + + pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { + let (idx, offset) = ((cpu >> 6) & 3, cpu & 63); + 0 != cpuset.ary[idx] & (1 << offset) + } +} + +safe_f! { + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + (status & 0o177) != 0o177 && (status & 0o177) != 0 + } +} + +extern "C" { + pub fn __errno_location() -> *mut ::c_int; + pub fn setgrent(); + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + + pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int; + + pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::c_int; + + pub fn devname_r( + dev: ::dev_t, + mode: ::mode_t, + buf: *mut ::c_char, + len: ::size_t, + ) -> *mut ::c_char; + + pub fn waitid( + idtype: idtype_t, + id: ::id_t, + infop: *mut ::siginfo_t, + options: ::c_int, + ) -> ::c_int; + + pub fn freelocale(loc: ::locale_t); + + pub fn lwp_rtprio( + function: ::c_int, + pid: ::pid_t, + lwpid: lwpid_t, + rtp: *mut super::rtprio, + ) -> ::c_int; + + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + pub fn memmem( + haystack: *const ::c_void, + haystacklen: ::size_t, + needle: *const ::c_void, + needlelen: ::size_t, + ) -> *mut ::c_void; + pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int; + + pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *mut cpu_set_t) -> ::c_int; + pub fn sched_setaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *const cpu_set_t) + -> ::c_int; + pub fn sched_getcpu() -> ::c_int; + pub fn setproctitle(fmt: *const ::c_char, ...); + + pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; + pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; + pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; + pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; + pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int; + + pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int; + pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx; + pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int; + pub fn getutxuser(name: *const ::c_char) -> utmpx; + pub fn utmpxname(file: *const ::c_char) -> ::c_int; + + pub fn sys_checkpoint(tpe: ::c_int, fd: ::c_int, pid: ::pid_t, retval: ::c_int) -> ::c_int; + + pub fn umtx_sleep(ptr: *const ::c_int, value: ::c_int, timeout: ::c_int) -> ::c_int; + pub fn umtx_wakeup(ptr: *const ::c_int, count: ::c_int) -> ::c_int; +} + +#[link(name = "rt")] +extern "C" { + pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; + pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; + pub fn aio_suspend( + aiocb_list: *const *const aiocb, + nitems: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; + pub fn lio_listio( + mode: ::c_int, + aiocb_list: *const *mut aiocb, + nitems: ::c_int, + sevp: *mut sigevent, + ) -> ::c_int; + + pub fn reallocf(ptr: *mut ::c_void, size: ::size_t) -> *mut ::c_void; + pub fn freezero(ptr: *mut ::c_void, size: ::size_t); +} + +#[link(name = "kvm")] +extern "C" { + pub fn kvm_vm_map_entry_first( + kvm: *mut ::kvm_t, + map: vm_map_t, + entry: vm_map_entry_t, + ) -> vm_map_entry_t; + pub fn kvm_vm_map_entry_next( + kvm: *mut ::kvm_t, + map: vm_map_entry_t, + entry: vm_map_entry_t, + ) -> vm_map_entry_t; +} + +cfg_if! { + if #[cfg(libc_thread_local)] { + mod errno; + pub use self::errno::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs new file mode 100644 index 0000000000000000000000000000000000000000..d29a8d2c7f56cf92278643615e3dd82ac02d6518 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs @@ -0,0 +1,146 @@ +pub type c_char = u8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type wchar_t = u32; +pub type time_t = i64; +pub type suseconds_t = i64; +pub type register_t = i64; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +s_no_extra_traits! { + pub struct gpregs { + pub gp_x: [::register_t; 30], + pub gp_lr: ::register_t, + pub gp_sp: ::register_t, + pub gp_elr: ::register_t, + pub gp_spsr: u32, + pub gp_pad: ::c_int, + } + + pub struct fpregs { + pub fp_q: u128, + pub fp_sr: u32, + pub fp_cr: u32, + pub fp_flags: ::c_int, + pub fp_pad: ::c_int, + } + + pub struct mcontext_t { + pub mc_gpregs: gpregs, + pub mc_fpregs: fpregs, + pub mc_flags: ::c_int, + pub mc_pad: ::c_int, + pub mc_spare: [u64; 8], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for gpregs { + fn eq(&self, other: &gpregs) -> bool { + self.gp_x.iter().zip(other.gp_x.iter()).all(|(a, b)| a == b) && + self.gp_lr == other.gp_lr && + self.gp_sp == other.gp_sp && + self.gp_elr == other.gp_elr && + self.gp_spsr == other.gp_spsr && + self.gp_pad == other.gp_pad + } + } + impl Eq for gpregs {} + impl ::fmt::Debug for gpregs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("gpregs") + .field("gp_x", &self.gp_x) + .field("gp_lr", &self.gp_lr) + .field("gp_sp", &self.gp_sp) + .field("gp_elr", &self.gp_elr) + .field("gp_spsr", &self.gp_spsr) + .field("gp_pad", &self.gp_pad) + .finish() + } + } + impl ::hash::Hash for gpregs { + fn hash(&self, state: &mut H) { + self.gp_x.hash(state); + self.gp_lr.hash(state); + self.gp_sp.hash(state); + self.gp_elr.hash(state); + self.gp_spsr.hash(state); + self.gp_pad.hash(state); + } + } + impl PartialEq for fpregs { + fn eq(&self, other: &fpregs) -> bool { + self.fp_q == other.fp_q && + self.fp_sr == other.fp_sr && + self.fp_cr == other.fp_cr && + self.fp_flags == other.fp_flags && + self.fp_pad == other.fp_pad + } + } + impl Eq for fpregs {} + impl ::fmt::Debug for fpregs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fpregs") + .field("fp_q", &self.fp_q) + .field("fp_sr", &self.fp_sr) + .field("fp_cr", &self.fp_cr) + .field("fp_flags", &self.fp_flags) + .field("fp_pad", &self.fp_pad) + .finish() + } + } + impl ::hash::Hash for fpregs { + fn hash(&self, state: &mut H) { + self.fp_q.hash(state); + self.fp_sr.hash(state); + self.fp_cr.hash(state); + self.fp_flags.hash(state); + self.fp_pad.hash(state); + } + } + impl PartialEq for mcontext_t { + fn eq(&self, other: &mcontext_t) -> bool { + self.mc_gpregs == other.mc_gpregs && + self.mc_fpregs == other.mc_fpregs && + self.mc_flags == other.mc_flags && + self.mc_pad == other.mc_pad && + self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b) + } + } + impl Eq for mcontext_t {} + impl ::fmt::Debug for mcontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mcontext_t") + .field("mc_gpregs", &self.mc_gpregs) + .field("mc_fpregs", &self.mc_fpregs) + .field("mc_flags", &self.mc_flags) + .field("mc_pad", &self.mc_pad) + .field("mc_spare", &self.mc_spare) + .finish() + } + } + impl ::hash::Hash for mcontext_t { + fn hash(&self, state: &mut H) { + self.mc_gpregs.hash(state); + self.mc_fpregs.hash(state); + self.mc_flags.hash(state); + self.mc_pad.hash(state); + self.mc_spare.hash(state); + } + } + } +} + +pub const MAP_32BIT: ::c_int = 0x00080000; +pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4 diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs new file mode 100644 index 0000000000000000000000000000000000000000..300b3dd45ca9d336cb721c22caa70b4255dbe0fa --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/arm.rs @@ -0,0 +1,50 @@ +pub type c_char = u8; +pub type c_long = i32; +pub type c_ulong = u32; +pub type wchar_t = u32; +pub type time_t = i64; +pub type suseconds_t = i32; +pub type register_t = i32; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_atime_pad: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_mtime_pad: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_ctime_pad: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, + pub st_gen: u32, + pub st_lspare: i32, + pub st_birthtime: ::time_t, + pub st_birthtime_nsec: ::c_long, + pub st_birthtime_pad: ::c_long, + } +} + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 4 - 1; + } +} +pub const MAP_32BIT: ::c_int = 0x00080000; +pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4 diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs new file mode 100644 index 0000000000000000000000000000000000000000..f32128f7755747219a16ed8aa38bb6a2efc9e51c --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs @@ -0,0 +1,32 @@ +#[repr(C)] +#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, + pub st_gen: u32, + pub st_lspare: i32, + pub st_birthtime: ::time_t, + pub st_birthtime_nsec: ::c_long, +} + +impl ::Copy for ::stat {} +impl ::Clone for ::stat { + fn clone(&self) -> ::stat { + *self + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..1af555fa3655c520f2baa82017d4def23a2bfb5a --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs @@ -0,0 +1,467 @@ +// APIs that were changed after FreeBSD 11 + +// The type of `nlink_t` changed from `u16` to `u64` in FreeBSD 12: +pub type nlink_t = u16; +// Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12: +pub type dev_t = u32; +// Type of `ino_t` changed from `unsigned int` to `unsigned long` in FreeBSD 12: +pub type ino_t = u32; + +s! { + pub struct kevent { + pub ident: ::uintptr_t, + pub filter: ::c_short, + pub flags: ::c_ushort, + pub fflags: ::c_uint, + pub data: ::intptr_t, + pub udata: *mut ::c_void, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + // Type of shm_nattc changed from `int` to `shmatt_t` (aka `unsigned + // int`) in FreeBSD 12: + pub shm_nattch: ::c_int, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + } + + pub struct kinfo_proc { + /// Size of this structure. + pub ki_structsize: ::c_int, + /// Reserved: layout identifier. + pub ki_layout: ::c_int, + /// Address of command arguments. + pub ki_args: *mut ::pargs, + // This is normally "struct proc". + /// Address of proc. + pub ki_paddr: *mut ::c_void, + // This is normally "struct user". + /// Kernel virtual address of u-area. + pub ki_addr: *mut ::c_void, + // This is normally "struct vnode". + /// Pointer to trace file. + pub ki_tracep: *mut ::c_void, + // This is normally "struct vnode". + /// Pointer to executable file. + pub ki_textvp: *mut ::c_void, + // This is normally "struct filedesc". + /// Pointer to open file info. + pub ki_fd: *mut ::c_void, + // This is normally "struct vmspace". + /// Pointer to kernel vmspace struct. + pub ki_vmspace: *mut ::c_void, + /// Sleep address. + pub ki_wchan: *mut ::c_void, + /// Process identifier. + pub ki_pid: ::pid_t, + /// Parent process ID. + pub ki_ppid: ::pid_t, + /// Process group ID. + pub ki_pgid: ::pid_t, + /// tty process group ID. + pub ki_tpgid: ::pid_t, + /// Process session ID. + pub ki_sid: ::pid_t, + /// Terminal session ID. + pub ki_tsid: ::pid_t, + /// Job control counter. + pub ki_jobc: ::c_short, + /// Unused (just here for alignment). + pub ki_spare_short1: ::c_short, + /// Controlling tty dev. + pub ki_tdev: ::dev_t, + /// Signals arrived but not delivered. + pub ki_siglist: ::sigset_t, + /// Current signal mask. + pub ki_sigmask: ::sigset_t, + /// Signals being ignored. + pub ki_sigignore: ::sigset_t, + /// Signals being caught by user. + pub ki_sigcatch: ::sigset_t, + /// Effective user ID. + pub ki_uid: ::uid_t, + /// Real user ID. + pub ki_ruid: ::uid_t, + /// Saved effective user ID. + pub ki_svuid: ::uid_t, + /// Real group ID. + pub ki_rgid: ::gid_t, + /// Saved effective group ID. + pub ki_svgid: ::gid_t, + /// Number of groups. + pub ki_ngroups: ::c_short, + /// Unused (just here for alignment). + pub ki_spare_short2: ::c_short, + /// Groups. + pub ki_groups: [::gid_t; ::KI_NGROUPS], + /// Virtual size. + pub ki_size: ::vm_size_t, + /// Current resident set size in pages. + pub ki_rssize: ::segsz_t, + /// Resident set size before last swap. + pub ki_swrss: ::segsz_t, + /// Text size (pages) XXX. + pub ki_tsize: ::segsz_t, + /// Data size (pages) XXX. + pub ki_dsize: ::segsz_t, + /// Stack size (pages). + pub ki_ssize: ::segsz_t, + /// Exit status for wait & stop signal. + pub ki_xstat: ::u_short, + /// Accounting flags. + pub ki_acflag: ::u_short, + /// %cpu for process during `ki_swtime`. + pub ki_pctcpu: ::fixpt_t, + /// Time averaged value of `ki_cpticks`. + pub ki_estcpu: ::u_int, + /// Time since last blocked. + pub ki_slptime: ::u_int, + /// Time swapped in or out. + pub ki_swtime: ::u_int, + /// Number of copy-on-write faults. + pub ki_cow: ::u_int, + /// Real time in microsec. + pub ki_runtime: u64, + /// Starting time. + pub ki_start: ::timeval, + /// Time used by process children. + pub ki_childtime: ::timeval, + /// P_* flags. + pub ki_flag: ::c_long, + /// KI_* flags (below). + pub ki_kiflag: ::c_long, + /// Kernel trace points. + pub ki_traceflag: ::c_int, + /// S* process status. + pub ki_stat: ::c_char, + /// Process "nice" value. + pub ki_nice: i8, // signed char + /// Process lock (prevent swap) count. + pub ki_lock: ::c_char, + /// Run queue index. + pub ki_rqindex: ::c_char, + /// Which cpu we are on. + pub ki_oncpu_old: ::c_uchar, + /// Last cpu we were on. + pub ki_lastcpu_old: ::c_uchar, + /// Thread name. + pub ki_tdname: [::c_char; ::TDNAMLEN + 1], + /// Wchan message. + pub ki_wmesg: [::c_char; ::WMESGLEN + 1], + /// Setlogin name. + pub ki_login: [::c_char; ::LOGNAMELEN + 1], + /// Lock name. + pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1], + /// Command name. + pub ki_comm: [::c_char; ::COMMLEN + 1], + /// Emulation name. + pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1], + /// Login class. + pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1], + /// More thread name. + pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1], + /// Spare string space. + pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq + /// Spare room for growth. + pub ki_spareints: [::c_int; ::KI_NSPARE_INT], + /// Which cpu we are on. + pub ki_oncpu: ::c_int, + /// Last cpu we were on. + pub ki_lastcpu: ::c_int, + /// PID of tracing process. + pub ki_tracer: ::c_int, + /// P2_* flags. + pub ki_flag2: ::c_int, + /// Default FIB number. + pub ki_fibnum: ::c_int, + /// Credential flags. + pub ki_cr_flags: ::u_int, + /// Process jail ID. + pub ki_jid: ::c_int, + /// Number of threads in total. + pub ki_numthreads: ::c_int, + /// Thread ID. + pub ki_tid: ::lwpid_t, + /// Process priority. + pub ki_pri: ::priority, + /// Process rusage statistics. + pub ki_rusage: ::rusage, + /// rusage of children processes. + pub ki_rusage_ch: ::rusage, + // This is normally "struct pcb". + /// Kernel virtual addr of pcb. + pub ki_pcb: *mut ::c_void, + /// Kernel virtual addr of stack. + pub ki_kstack: *mut ::c_void, + /// User convenience pointer. + pub ki_udata: *mut ::c_void, + // This is normally "struct thread". + pub ki_tdaddr: *mut ::c_void, + pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR], + pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG], + /// PS_* flags. + pub ki_sflag: ::c_long, + /// kthread flag. + pub ki_tdflags: ::c_long, + } +} + +s_no_extra_traits! { + pub struct dirent { + pub d_fileno: ::ino_t, + pub d_reclen: u16, + pub d_type: u8, + // Type of `d_namlen` changed from `char` to `u16` in FreeBSD 12: + pub d_namlen: u8, + pub d_name: [::c_char; 256], + } + + pub struct statfs { + pub f_version: u32, + pub f_type: u32, + pub f_flags: u64, + pub f_bsize: u64, + pub f_iosize: u64, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: i64, + pub f_files: u64, + pub f_ffree: i64, + pub f_syncwrites: u64, + pub f_asyncwrites: u64, + pub f_syncreads: u64, + pub f_asyncreads: u64, + f_spare: [u64; 10], + pub f_namemax: u32, + pub f_owner: ::uid_t, + pub f_fsid: ::fsid_t, + f_charspare: [::c_char; 80], + pub f_fstypename: [::c_char; 16], + // Array length changed from 88 to 1024 in FreeBSD 12: + pub f_mntfromname: [::c_char; 88], + // Array length changed from 88 to 1024 in FreeBSD 12: + pub f_mntonname: [::c_char; 88], + } + + pub struct vnstat { + pub vn_fileid: u64, + pub vn_size: u64, + pub vn_mntdir: *mut ::c_char, + pub vn_dev: u32, + pub vn_fsid: u32, + pub vn_type: ::c_int, + pub vn_mode: u16, + pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for statfs { + fn eq(&self, other: &statfs) -> bool { + self.f_version == other.f_version + && self.f_type == other.f_type + && self.f_flags == other.f_flags + && self.f_bsize == other.f_bsize + && self.f_iosize == other.f_iosize + && self.f_blocks == other.f_blocks + && self.f_bfree == other.f_bfree + && self.f_bavail == other.f_bavail + && self.f_files == other.f_files + && self.f_ffree == other.f_ffree + && self.f_syncwrites == other.f_syncwrites + && self.f_asyncwrites == other.f_asyncwrites + && self.f_syncreads == other.f_syncreads + && self.f_asyncreads == other.f_asyncreads + && self.f_namemax == other.f_namemax + && self.f_owner == other.f_owner + && self.f_fsid == other.f_fsid + && self.f_fstypename == other.f_fstypename + && self + .f_mntfromname + .iter() + .zip(other.f_mntfromname.iter()) + .all(|(a,b)| a == b) + && self + .f_mntonname + .iter() + .zip(other.f_mntonname.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for statfs {} + impl ::fmt::Debug for statfs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("statfs") + .field("f_bsize", &self.f_bsize) + .field("f_iosize", &self.f_iosize) + .field("f_blocks", &self.f_blocks) + .field("f_bfree", &self.f_bfree) + .field("f_bavail", &self.f_bavail) + .field("f_files", &self.f_files) + .field("f_ffree", &self.f_ffree) + .field("f_syncwrites", &self.f_syncwrites) + .field("f_asyncwrites", &self.f_asyncwrites) + .field("f_syncreads", &self.f_syncreads) + .field("f_asyncreads", &self.f_asyncreads) + .field("f_namemax", &self.f_namemax) + .field("f_owner", &self.f_owner) + .field("f_fsid", &self.f_fsid) + .field("f_fstypename", &self.f_fstypename) + .field("f_mntfromname", &&self.f_mntfromname[..]) + .field("f_mntonname", &&self.f_mntonname[..]) + .finish() + } + } + impl ::hash::Hash for statfs { + fn hash(&self, state: &mut H) { + self.f_version.hash(state); + self.f_type.hash(state); + self.f_flags.hash(state); + self.f_bsize.hash(state); + self.f_iosize.hash(state); + self.f_blocks.hash(state); + self.f_bfree.hash(state); + self.f_bavail.hash(state); + self.f_files.hash(state); + self.f_ffree.hash(state); + self.f_syncwrites.hash(state); + self.f_asyncwrites.hash(state); + self.f_syncreads.hash(state); + self.f_asyncreads.hash(state); + self.f_namemax.hash(state); + self.f_owner.hash(state); + self.f_fsid.hash(state); + self.f_fstypename.hash(state); + self.f_mntfromname.hash(state); + self.f_mntonname.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_fileno == other.d_fileno + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self.d_namlen == other.d_namlen + && self + .d_name[..self.d_namlen as _] + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_fileno", &self.d_fileno) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + .field("d_namlen", &self.d_namlen) + .field("d_name", &&self.d_name[..self.d_namlen as _]) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_fileno.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_namlen.hash(state); + self.d_name[..self.d_namlen as _].hash(state); + } + } + + impl PartialEq for vnstat { + fn eq(&self, other: &vnstat) -> bool { + let self_vn_devname: &[::c_char] = &self.vn_devname; + let other_vn_devname: &[::c_char] = &other.vn_devname; + + self.vn_fileid == other.vn_fileid && + self.vn_size == other.vn_size && + self.vn_mntdir == other.vn_mntdir && + self.vn_dev == other.vn_dev && + self.vn_fsid == other.vn_fsid && + self.vn_type == other.vn_type && + self.vn_mode == other.vn_mode && + self_vn_devname == other_vn_devname + } + } + impl Eq for vnstat {} + impl ::fmt::Debug for vnstat { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let self_vn_devname: &[::c_char] = &self.vn_devname; + + f.debug_struct("vnstat") + .field("vn_fileid", &self.vn_fileid) + .field("vn_size", &self.vn_size) + .field("vn_mntdir", &self.vn_mntdir) + .field("vn_dev", &self.vn_dev) + .field("vn_fsid", &self.vn_fsid) + .field("vn_type", &self.vn_type) + .field("vn_mode", &self.vn_mode) + .field("vn_devname", &self_vn_devname) + .finish() + } + } + impl ::hash::Hash for vnstat { + fn hash(&self, state: &mut H) { + let self_vn_devname: &[::c_char] = &self.vn_devname; + + self.vn_fileid.hash(state); + self.vn_size.hash(state); + self.vn_mntdir.hash(state); + self.vn_dev.hash(state); + self.vn_fsid.hash(state); + self.vn_type.hash(state); + self.vn_mode.hash(state); + self_vn_devname.hash(state); + } + } + } +} + +pub const ELAST: ::c_int = 96; +pub const RAND_MAX: ::c_int = 0x7fff_fffd; +pub const KI_NSPARE_PTR: usize = 6; +pub const MINCORE_SUPER: ::c_int = 0x20; +/// max length of devicename +pub const SPECNAMELEN: ::c_int = 63; + +extern "C" { + // Return type ::c_int was removed in FreeBSD 12 + pub fn setgrent() -> ::c_int; + + // Type of `addr` argument changed from `const void*` to `void*` + // in FreeBSD 12 + pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + + // Return type ::c_int was removed in FreeBSD 12 + pub fn freelocale(loc: ::locale_t) -> ::c_int; + + // Return type ::c_int changed to ::ssize_t in FreeBSD 12: + pub fn msgrcv( + msqid: ::c_int, + msgp: *mut ::c_void, + msgsz: ::size_t, + msgtyp: ::c_long, + msgflg: ::c_int, + ) -> ::c_int; + + pub fn fdatasync(fd: ::c_int) -> ::c_int; +} + +cfg_if! { + if #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "riscv64"))] { + mod b64; + pub use self::b64::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs new file mode 100644 index 0000000000000000000000000000000000000000..80c6fa16845308f929843e6d493807c49754d27d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs @@ -0,0 +1,34 @@ +#[repr(C)] +#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + st_padding0: i16, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + st_padding1: i32, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_birthtime: ::time_t, + pub st_birthtime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, + pub st_gen: u64, + pub st_spare: [u64; 10], +} + +impl ::Copy for ::stat {} +impl ::Clone for ::stat { + fn clone(&self) -> ::stat { + *self + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..848db339935568ec136e2292c5c547759455219a --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs @@ -0,0 +1,493 @@ +// APIs in FreeBSD 12 that have changed since 11. + +pub type nlink_t = u64; +pub type dev_t = u64; +pub type ino_t = ::c_ulong; +pub type shmatt_t = ::c_uint; + +s! { + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + } + + pub struct kevent { + pub ident: ::uintptr_t, + pub filter: ::c_short, + pub flags: ::c_ushort, + pub fflags: ::c_uint, + pub data: i64, + pub udata: *mut ::c_void, + pub ext: [u64; 4], + } + + pub struct kvm_page { + pub version: ::c_uint, + pub paddr: ::c_ulong, + pub kmap_vaddr: ::c_ulong, + pub dmap_vaddr: ::c_ulong, + pub prot: ::vm_prot_t, + pub offset: ::u_long, + pub len: ::size_t, + } + + pub struct kinfo_proc { + /// Size of this structure. + pub ki_structsize: ::c_int, + /// Reserved: layout identifier. + pub ki_layout: ::c_int, + /// Address of command arguments. + pub ki_args: *mut ::pargs, + // This is normally "struct proc". + /// Address of proc. + pub ki_paddr: *mut ::c_void, + // This is normally "struct user". + /// Kernel virtual address of u-area. + pub ki_addr: *mut ::c_void, + // This is normally "struct vnode". + /// Pointer to trace file. + pub ki_tracep: *mut ::c_void, + // This is normally "struct vnode". + /// Pointer to executable file. + pub ki_textvp: *mut ::c_void, + // This is normally "struct filedesc". + /// Pointer to open file info. + pub ki_fd: *mut ::c_void, + // This is normally "struct vmspace". + /// Pointer to kernel vmspace struct. + pub ki_vmspace: *mut ::c_void, + /// Sleep address. + pub ki_wchan: *mut ::c_void, + /// Process identifier. + pub ki_pid: ::pid_t, + /// Parent process ID. + pub ki_ppid: ::pid_t, + /// Process group ID. + pub ki_pgid: ::pid_t, + /// tty process group ID. + pub ki_tpgid: ::pid_t, + /// Process session ID. + pub ki_sid: ::pid_t, + /// Terminal session ID. + pub ki_tsid: ::pid_t, + /// Job control counter. + pub ki_jobc: ::c_short, + /// Unused (just here for alignment). + pub ki_spare_short1: ::c_short, + /// Controlling tty dev. + pub ki_tdev_freebsd11: u32, + /// Signals arrived but not delivered. + pub ki_siglist: ::sigset_t, + /// Current signal mask. + pub ki_sigmask: ::sigset_t, + /// Signals being ignored. + pub ki_sigignore: ::sigset_t, + /// Signals being caught by user. + pub ki_sigcatch: ::sigset_t, + /// Effective user ID. + pub ki_uid: ::uid_t, + /// Real user ID. + pub ki_ruid: ::uid_t, + /// Saved effective user ID. + pub ki_svuid: ::uid_t, + /// Real group ID. + pub ki_rgid: ::gid_t, + /// Saved effective group ID. + pub ki_svgid: ::gid_t, + /// Number of groups. + pub ki_ngroups: ::c_short, + /// Unused (just here for alignment). + pub ki_spare_short2: ::c_short, + /// Groups. + pub ki_groups: [::gid_t; ::KI_NGROUPS], + /// Virtual size. + pub ki_size: ::vm_size_t, + /// Current resident set size in pages. + pub ki_rssize: ::segsz_t, + /// Resident set size before last swap. + pub ki_swrss: ::segsz_t, + /// Text size (pages) XXX. + pub ki_tsize: ::segsz_t, + /// Data size (pages) XXX. + pub ki_dsize: ::segsz_t, + /// Stack size (pages). + pub ki_ssize: ::segsz_t, + /// Exit status for wait & stop signal. + pub ki_xstat: ::u_short, + /// Accounting flags. + pub ki_acflag: ::u_short, + /// %cpu for process during `ki_swtime`. + pub ki_pctcpu: ::fixpt_t, + /// Time averaged value of `ki_cpticks`. + pub ki_estcpu: ::u_int, + /// Time since last blocked. + pub ki_slptime: ::u_int, + /// Time swapped in or out. + pub ki_swtime: ::u_int, + /// Number of copy-on-write faults. + pub ki_cow: ::u_int, + /// Real time in microsec. + pub ki_runtime: u64, + /// Starting time. + pub ki_start: ::timeval, + /// Time used by process children. + pub ki_childtime: ::timeval, + /// P_* flags. + pub ki_flag: ::c_long, + /// KI_* flags (below). + pub ki_kiflag: ::c_long, + /// Kernel trace points. + pub ki_traceflag: ::c_int, + /// S* process status. + pub ki_stat: ::c_char, + /// Process "nice" value. + pub ki_nice: i8, // signed char + /// Process lock (prevent swap) count. + pub ki_lock: ::c_char, + /// Run queue index. + pub ki_rqindex: ::c_char, + /// Which cpu we are on. + pub ki_oncpu_old: ::c_uchar, + /// Last cpu we were on. + pub ki_lastcpu_old: ::c_uchar, + /// Thread name. + pub ki_tdname: [::c_char; ::TDNAMLEN + 1], + /// Wchan message. + pub ki_wmesg: [::c_char; ::WMESGLEN + 1], + /// Setlogin name. + pub ki_login: [::c_char; ::LOGNAMELEN + 1], + /// Lock name. + pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1], + /// Command name. + pub ki_comm: [::c_char; ::COMMLEN + 1], + /// Emulation name. + pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1], + /// Login class. + pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1], + /// More thread name. + pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1], + /// Spare string space. + pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq + /// Spare room for growth. + pub ki_spareints: [::c_int; ::KI_NSPARE_INT], + /// Controlling tty dev. + pub ki_tdev: ::dev_t, + /// Which cpu we are on. + pub ki_oncpu: ::c_int, + /// Last cpu we were on. + pub ki_lastcpu: ::c_int, + /// PID of tracing process. + pub ki_tracer: ::c_int, + /// P2_* flags. + pub ki_flag2: ::c_int, + /// Default FIB number. + pub ki_fibnum: ::c_int, + /// Credential flags. + pub ki_cr_flags: ::u_int, + /// Process jail ID. + pub ki_jid: ::c_int, + /// Number of threads in total. + pub ki_numthreads: ::c_int, + /// Thread ID. + pub ki_tid: ::lwpid_t, + /// Process priority. + pub ki_pri: ::priority, + /// Process rusage statistics. + pub ki_rusage: ::rusage, + /// rusage of children processes. + pub ki_rusage_ch: ::rusage, + // This is normally "struct pcb". + /// Kernel virtual addr of pcb. + pub ki_pcb: *mut ::c_void, + /// Kernel virtual addr of stack. + pub ki_kstack: *mut ::c_void, + /// User convenience pointer. + pub ki_udata: *mut ::c_void, + // This is normally "struct thread". + pub ki_tdaddr: *mut ::c_void, + pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR], + pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG], + /// PS_* flags. + pub ki_sflag: ::c_long, + /// kthread flag. + pub ki_tdflags: ::c_long, + } +} + +s_no_extra_traits! { + pub struct dirent { + pub d_fileno: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: u16, + pub d_type: u8, + d_pad0: u8, + pub d_namlen: u16, + d_pad1: u16, + pub d_name: [::c_char; 256], + } + + pub struct statfs { + pub f_version: u32, + pub f_type: u32, + pub f_flags: u64, + pub f_bsize: u64, + pub f_iosize: u64, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: i64, + pub f_files: u64, + pub f_ffree: i64, + pub f_syncwrites: u64, + pub f_asyncwrites: u64, + pub f_syncreads: u64, + pub f_asyncreads: u64, + f_spare: [u64; 10], + pub f_namemax: u32, + pub f_owner: ::uid_t, + pub f_fsid: ::fsid_t, + f_charspare: [::c_char; 80], + pub f_fstypename: [::c_char; 16], + pub f_mntfromname: [::c_char; 1024], + pub f_mntonname: [::c_char; 1024], + } + + pub struct vnstat { + pub vn_fileid: u64, + pub vn_size: u64, + pub vn_dev: u64, + pub vn_fsid: u64, + pub vn_mntdir: *mut ::c_char, + pub vn_type: ::c_int, + pub vn_mode: u16, + pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for statfs { + fn eq(&self, other: &statfs) -> bool { + self.f_version == other.f_version + && self.f_type == other.f_type + && self.f_flags == other.f_flags + && self.f_bsize == other.f_bsize + && self.f_iosize == other.f_iosize + && self.f_blocks == other.f_blocks + && self.f_bfree == other.f_bfree + && self.f_bavail == other.f_bavail + && self.f_files == other.f_files + && self.f_ffree == other.f_ffree + && self.f_syncwrites == other.f_syncwrites + && self.f_asyncwrites == other.f_asyncwrites + && self.f_syncreads == other.f_syncreads + && self.f_asyncreads == other.f_asyncreads + && self.f_namemax == other.f_namemax + && self.f_owner == other.f_owner + && self.f_fsid == other.f_fsid + && self.f_fstypename == other.f_fstypename + && self + .f_mntfromname + .iter() + .zip(other.f_mntfromname.iter()) + .all(|(a,b)| a == b) + && self + .f_mntonname + .iter() + .zip(other.f_mntonname.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for statfs {} + impl ::fmt::Debug for statfs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("statfs") + .field("f_bsize", &self.f_bsize) + .field("f_iosize", &self.f_iosize) + .field("f_blocks", &self.f_blocks) + .field("f_bfree", &self.f_bfree) + .field("f_bavail", &self.f_bavail) + .field("f_files", &self.f_files) + .field("f_ffree", &self.f_ffree) + .field("f_syncwrites", &self.f_syncwrites) + .field("f_asyncwrites", &self.f_asyncwrites) + .field("f_syncreads", &self.f_syncreads) + .field("f_asyncreads", &self.f_asyncreads) + .field("f_namemax", &self.f_namemax) + .field("f_owner", &self.f_owner) + .field("f_fsid", &self.f_fsid) + .field("f_fstypename", &self.f_fstypename) + .field("f_mntfromname", &&self.f_mntfromname[..]) + .field("f_mntonname", &&self.f_mntonname[..]) + .finish() + } + } + impl ::hash::Hash for statfs { + fn hash(&self, state: &mut H) { + self.f_version.hash(state); + self.f_type.hash(state); + self.f_flags.hash(state); + self.f_bsize.hash(state); + self.f_iosize.hash(state); + self.f_blocks.hash(state); + self.f_bfree.hash(state); + self.f_bavail.hash(state); + self.f_files.hash(state); + self.f_ffree.hash(state); + self.f_syncwrites.hash(state); + self.f_asyncwrites.hash(state); + self.f_syncreads.hash(state); + self.f_asyncreads.hash(state); + self.f_namemax.hash(state); + self.f_owner.hash(state); + self.f_fsid.hash(state); + self.f_charspare.hash(state); + self.f_fstypename.hash(state); + self.f_mntfromname.hash(state); + self.f_mntonname.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_fileno == other.d_fileno + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self.d_namlen == other.d_namlen + && self + .d_name[..self.d_namlen as _] + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_fileno", &self.d_fileno) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + .field("d_namlen", &self.d_namlen) + .field("d_name", &&self.d_name[..self.d_namlen as _]) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_fileno.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_namlen.hash(state); + self.d_name[..self.d_namlen as _].hash(state); + } + } + + impl PartialEq for vnstat { + fn eq(&self, other: &vnstat) -> bool { + let self_vn_devname: &[::c_char] = &self.vn_devname; + let other_vn_devname: &[::c_char] = &other.vn_devname; + + self.vn_fileid == other.vn_fileid && + self.vn_size == other.vn_size && + self.vn_dev == other.vn_dev && + self.vn_fsid == other.vn_fsid && + self.vn_mntdir == other.vn_mntdir && + self.vn_type == other.vn_type && + self.vn_mode == other.vn_mode && + self_vn_devname == other_vn_devname + } + } + impl Eq for vnstat {} + impl ::fmt::Debug for vnstat { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let self_vn_devname: &[::c_char] = &self.vn_devname; + + f.debug_struct("vnstat") + .field("vn_fileid", &self.vn_fileid) + .field("vn_size", &self.vn_size) + .field("vn_dev", &self.vn_dev) + .field("vn_fsid", &self.vn_fsid) + .field("vn_mntdir", &self.vn_mntdir) + .field("vn_type", &self.vn_type) + .field("vn_mode", &self.vn_mode) + .field("vn_devname", &self_vn_devname) + .finish() + } + } + impl ::hash::Hash for vnstat { + fn hash(&self, state: &mut H) { + let self_vn_devname: &[::c_char] = &self.vn_devname; + + self.vn_fileid.hash(state); + self.vn_size.hash(state); + self.vn_dev.hash(state); + self.vn_fsid.hash(state); + self.vn_mntdir.hash(state); + self.vn_type.hash(state); + self.vn_mode.hash(state); + self_vn_devname.hash(state); + } + } + } +} + +pub const RAND_MAX: ::c_int = 0x7fff_fffd; +pub const ELAST: ::c_int = 97; + +/// max length of devicename +pub const SPECNAMELEN: ::c_int = 63; +pub const KI_NSPARE_PTR: usize = 6; + +pub const MINCORE_SUPER: ::c_int = 0x20; + +extern "C" { + pub fn setgrent(); + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn freelocale(loc: ::locale_t); + pub fn msgrcv( + msqid: ::c_int, + msgp: *mut ::c_void, + msgsz: ::size_t, + msgtyp: ::c_long, + msgflg: ::c_int, + ) -> ::ssize_t; + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + + pub fn fdatasync(fd: ::c_int) -> ::c_int; + + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; + pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int; + pub fn setproctitle_fast(fmt: *const ::c_char, ...); + pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; +} + +cfg_if! { + if #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "riscv64"))] { + mod b64; + pub use self::b64::*; + } +} + +cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..7bf2534455bf965cea56c1896e21649c425601fb --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs @@ -0,0 +1,5 @@ +pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN; +pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1; +pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2; +pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1; +pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs new file mode 100644 index 0000000000000000000000000000000000000000..80c6fa16845308f929843e6d493807c49754d27d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs @@ -0,0 +1,34 @@ +#[repr(C)] +#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + st_padding0: i16, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + st_padding1: i32, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_birthtime: ::time_t, + pub st_birthtime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, + pub st_gen: u64, + pub st_spare: [u64; 10], +} + +impl ::Copy for ::stat {} +impl ::Clone for ::stat { + fn clone(&self) -> ::stat { + *self + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..a929f9d290e63fd7281af9818527f93b88a1f664 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs @@ -0,0 +1,546 @@ +// APIs in FreeBSD 14 that have changed since 11. + +pub type nlink_t = u64; +pub type dev_t = u64; +pub type ino_t = ::c_ulong; +pub type shmatt_t = ::c_uint; +pub type kpaddr_t = u64; +pub type kssize_t = i64; +pub type domainset_t = __c_anonymous_domainset; + +s! { + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + } + + pub struct kevent { + pub ident: ::uintptr_t, + pub filter: ::c_short, + pub flags: ::c_ushort, + pub fflags: ::c_uint, + pub data: i64, + pub udata: *mut ::c_void, + pub ext: [u64; 4], + } + + pub struct kvm_page { + pub kp_version: ::u_int, + pub kp_paddr: ::kpaddr_t, + pub kp_kmap_vaddr: ::kvaddr_t, + pub kp_dmap_vaddr: ::kvaddr_t, + pub kp_prot: ::vm_prot_t, + pub kp_offset: ::off_t, + pub kp_len: ::size_t, + } + + pub struct __c_anonymous_domainset { + _priv: [::uintptr_t; 4], + } + + pub struct kinfo_proc { + /// Size of this structure. + pub ki_structsize: ::c_int, + /// Reserved: layout identifier. + pub ki_layout: ::c_int, + /// Address of command arguments. + pub ki_args: *mut ::pargs, + // This is normally "struct proc". + /// Address of proc. + pub ki_paddr: *mut ::c_void, + // This is normally "struct user". + /// Kernel virtual address of u-area. + pub ki_addr: *mut ::c_void, + // This is normally "struct vnode". + /// Pointer to trace file. + pub ki_tracep: *mut ::c_void, + // This is normally "struct vnode". + /// Pointer to executable file. + pub ki_textvp: *mut ::c_void, + // This is normally "struct filedesc". + /// Pointer to open file info. + pub ki_fd: *mut ::c_void, + // This is normally "struct vmspace". + /// Pointer to kernel vmspace struct. + pub ki_vmspace: *mut ::c_void, + /// Sleep address. + pub ki_wchan: *const ::c_void, + /// Process identifier. + pub ki_pid: ::pid_t, + /// Parent process ID. + pub ki_ppid: ::pid_t, + /// Process group ID. + pub ki_pgid: ::pid_t, + /// tty process group ID. + pub ki_tpgid: ::pid_t, + /// Process session ID. + pub ki_sid: ::pid_t, + /// Terminal session ID. + pub ki_tsid: ::pid_t, + /// Job control counter. + pub ki_jobc: ::c_short, + /// Unused (just here for alignment). + pub ki_spare_short1: ::c_short, + /// Controlling tty dev. + pub ki_tdev_freebsd11: u32, + /// Signals arrived but not delivered. + pub ki_siglist: ::sigset_t, + /// Current signal mask. + pub ki_sigmask: ::sigset_t, + /// Signals being ignored. + pub ki_sigignore: ::sigset_t, + /// Signals being caught by user. + pub ki_sigcatch: ::sigset_t, + /// Effective user ID. + pub ki_uid: ::uid_t, + /// Real user ID. + pub ki_ruid: ::uid_t, + /// Saved effective user ID. + pub ki_svuid: ::uid_t, + /// Real group ID. + pub ki_rgid: ::gid_t, + /// Saved effective group ID. + pub ki_svgid: ::gid_t, + /// Number of groups. + pub ki_ngroups: ::c_short, + /// Unused (just here for alignment). + pub ki_spare_short2: ::c_short, + /// Groups. + pub ki_groups: [::gid_t; ::KI_NGROUPS], + /// Virtual size. + pub ki_size: ::vm_size_t, + /// Current resident set size in pages. + pub ki_rssize: ::segsz_t, + /// Resident set size before last swap. + pub ki_swrss: ::segsz_t, + /// Text size (pages) XXX. + pub ki_tsize: ::segsz_t, + /// Data size (pages) XXX. + pub ki_dsize: ::segsz_t, + /// Stack size (pages). + pub ki_ssize: ::segsz_t, + /// Exit status for wait & stop signal. + pub ki_xstat: ::u_short, + /// Accounting flags. + pub ki_acflag: ::u_short, + /// %cpu for process during `ki_swtime`. + pub ki_pctcpu: ::fixpt_t, + /// Time averaged value of `ki_cpticks`. + pub ki_estcpu: ::u_int, + /// Time since last blocked. + pub ki_slptime: ::u_int, + /// Time swapped in or out. + pub ki_swtime: ::u_int, + /// Number of copy-on-write faults. + pub ki_cow: ::u_int, + /// Real time in microsec. + pub ki_runtime: u64, + /// Starting time. + pub ki_start: ::timeval, + /// Time used by process children. + pub ki_childtime: ::timeval, + /// P_* flags. + pub ki_flag: ::c_long, + /// KI_* flags (below). + pub ki_kiflag: ::c_long, + /// Kernel trace points. + pub ki_traceflag: ::c_int, + /// S* process status. + pub ki_stat: ::c_char, + /// Process "nice" value. + pub ki_nice: i8, // signed char + /// Process lock (prevent swap) count. + pub ki_lock: ::c_char, + /// Run queue index. + pub ki_rqindex: ::c_char, + /// Which cpu we are on. + pub ki_oncpu_old: ::c_uchar, + /// Last cpu we were on. + pub ki_lastcpu_old: ::c_uchar, + /// Thread name. + pub ki_tdname: [::c_char; ::TDNAMLEN + 1], + /// Wchan message. + pub ki_wmesg: [::c_char; ::WMESGLEN + 1], + /// Setlogin name. + pub ki_login: [::c_char; ::LOGNAMELEN + 1], + /// Lock name. + pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1], + /// Command name. + pub ki_comm: [::c_char; ::COMMLEN + 1], + /// Emulation name. + pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1], + /// Login class. + pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1], + /// More thread name. + pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1], + /// Spare string space. + pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq + /// Spare room for growth. + pub ki_spareints: [::c_int; ::KI_NSPARE_INT], + /// Controlling tty dev. + pub ki_tdev: u64, + /// Which cpu we are on. + pub ki_oncpu: ::c_int, + /// Last cpu we were on. + pub ki_lastcpu: ::c_int, + /// PID of tracing process. + pub ki_tracer: ::c_int, + /// P2_* flags. + pub ki_flag2: ::c_int, + /// Default FIB number. + pub ki_fibnum: ::c_int, + /// Credential flags. + pub ki_cr_flags: ::u_int, + /// Process jail ID. + pub ki_jid: ::c_int, + /// Number of threads in total. + pub ki_numthreads: ::c_int, + /// Thread ID. + pub ki_tid: ::lwpid_t, + /// Process priority. + pub ki_pri: ::priority, + /// Process rusage statistics. + pub ki_rusage: ::rusage, + /// rusage of children processes. + pub ki_rusage_ch: ::rusage, + // This is normally "struct pcb". + /// Kernel virtual addr of pcb. + pub ki_pcb: *mut ::c_void, + /// Kernel virtual addr of stack. + pub ki_kstack: *mut ::c_void, + /// User convenience pointer. + pub ki_udata: *mut ::c_void, + // This is normally "struct thread". + pub ki_tdaddr: *mut ::c_void, + // This is normally "struct pwddesc". + /// Pointer to process paths info. + pub ki_pd: *mut ::c_void, + pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR], + pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG], + /// PS_* flags. + pub ki_sflag: ::c_long, + /// kthread flag. + pub ki_tdflags: ::c_long, + } +} + +s_no_extra_traits! { + pub struct dirent { + pub d_fileno: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: u16, + pub d_type: u8, + d_pad0: u8, + pub d_namlen: u16, + d_pad1: u16, + pub d_name: [::c_char; 256], + } + + pub struct statfs { + pub f_version: u32, + pub f_type: u32, + pub f_flags: u64, + pub f_bsize: u64, + pub f_iosize: u64, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: i64, + pub f_files: u64, + pub f_ffree: i64, + pub f_syncwrites: u64, + pub f_asyncwrites: u64, + pub f_syncreads: u64, + pub f_asyncreads: u64, + f_spare: [u64; 10], + pub f_namemax: u32, + pub f_owner: ::uid_t, + pub f_fsid: ::fsid_t, + f_charspare: [::c_char; 80], + pub f_fstypename: [::c_char; 16], + pub f_mntfromname: [::c_char; 1024], + pub f_mntonname: [::c_char; 1024], + } + + pub struct vnstat { + pub vn_fileid: u64, + pub vn_size: u64, + pub vn_dev: u64, + pub vn_fsid: u64, + pub vn_mntdir: *mut ::c_char, + pub vn_type: ::c_int, + pub vn_mode: u16, + pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for statfs { + fn eq(&self, other: &statfs) -> bool { + self.f_version == other.f_version + && self.f_type == other.f_type + && self.f_flags == other.f_flags + && self.f_bsize == other.f_bsize + && self.f_iosize == other.f_iosize + && self.f_blocks == other.f_blocks + && self.f_bfree == other.f_bfree + && self.f_bavail == other.f_bavail + && self.f_files == other.f_files + && self.f_ffree == other.f_ffree + && self.f_syncwrites == other.f_syncwrites + && self.f_asyncwrites == other.f_asyncwrites + && self.f_syncreads == other.f_syncreads + && self.f_asyncreads == other.f_asyncreads + && self.f_namemax == other.f_namemax + && self.f_owner == other.f_owner + && self.f_fsid == other.f_fsid + && self.f_fstypename == other.f_fstypename + && self + .f_mntfromname + .iter() + .zip(other.f_mntfromname.iter()) + .all(|(a,b)| a == b) + && self + .f_mntonname + .iter() + .zip(other.f_mntonname.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for statfs {} + impl ::fmt::Debug for statfs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("statfs") + .field("f_bsize", &self.f_bsize) + .field("f_iosize", &self.f_iosize) + .field("f_blocks", &self.f_blocks) + .field("f_bfree", &self.f_bfree) + .field("f_bavail", &self.f_bavail) + .field("f_files", &self.f_files) + .field("f_ffree", &self.f_ffree) + .field("f_syncwrites", &self.f_syncwrites) + .field("f_asyncwrites", &self.f_asyncwrites) + .field("f_syncreads", &self.f_syncreads) + .field("f_asyncreads", &self.f_asyncreads) + .field("f_namemax", &self.f_namemax) + .field("f_owner", &self.f_owner) + .field("f_fsid", &self.f_fsid) + .field("f_fstypename", &self.f_fstypename) + .field("f_mntfromname", &&self.f_mntfromname[..]) + .field("f_mntonname", &&self.f_mntonname[..]) + .finish() + } + } + impl ::hash::Hash for statfs { + fn hash(&self, state: &mut H) { + self.f_version.hash(state); + self.f_type.hash(state); + self.f_flags.hash(state); + self.f_bsize.hash(state); + self.f_iosize.hash(state); + self.f_blocks.hash(state); + self.f_bfree.hash(state); + self.f_bavail.hash(state); + self.f_files.hash(state); + self.f_ffree.hash(state); + self.f_syncwrites.hash(state); + self.f_asyncwrites.hash(state); + self.f_syncreads.hash(state); + self.f_asyncreads.hash(state); + self.f_namemax.hash(state); + self.f_owner.hash(state); + self.f_fsid.hash(state); + self.f_charspare.hash(state); + self.f_fstypename.hash(state); + self.f_mntfromname.hash(state); + self.f_mntonname.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_fileno == other.d_fileno + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self.d_namlen == other.d_namlen + && self + .d_name[..self.d_namlen as _] + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_fileno", &self.d_fileno) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + .field("d_namlen", &self.d_namlen) + .field("d_name", &&self.d_name[..self.d_namlen as _]) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_fileno.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_namlen.hash(state); + self.d_name[..self.d_namlen as _].hash(state); + } + } + + impl PartialEq for vnstat { + fn eq(&self, other: &vnstat) -> bool { + let self_vn_devname: &[::c_char] = &self.vn_devname; + let other_vn_devname: &[::c_char] = &other.vn_devname; + + self.vn_fileid == other.vn_fileid && + self.vn_size == other.vn_size && + self.vn_dev == other.vn_dev && + self.vn_fsid == other.vn_fsid && + self.vn_mntdir == other.vn_mntdir && + self.vn_type == other.vn_type && + self.vn_mode == other.vn_mode && + self_vn_devname == other_vn_devname + } + } + impl Eq for vnstat {} + impl ::fmt::Debug for vnstat { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let self_vn_devname: &[::c_char] = &self.vn_devname; + + f.debug_struct("vnstat") + .field("vn_fileid", &self.vn_fileid) + .field("vn_size", &self.vn_size) + .field("vn_dev", &self.vn_dev) + .field("vn_fsid", &self.vn_fsid) + .field("vn_mntdir", &self.vn_mntdir) + .field("vn_type", &self.vn_type) + .field("vn_mode", &self.vn_mode) + .field("vn_devname", &self_vn_devname) + .finish() + } + } + impl ::hash::Hash for vnstat { + fn hash(&self, state: &mut H) { + let self_vn_devname: &[::c_char] = &self.vn_devname; + + self.vn_fileid.hash(state); + self.vn_size.hash(state); + self.vn_dev.hash(state); + self.vn_fsid.hash(state); + self.vn_mntdir.hash(state); + self.vn_type.hash(state); + self.vn_mode.hash(state); + self_vn_devname.hash(state); + } + } + } +} + +pub const RAND_MAX: ::c_int = 0x7fff_ffff; +pub const ELAST: ::c_int = 97; + +pub const KF_TYPE_EVENTFD: ::c_int = 13; + +/// max length of devicename +pub const SPECNAMELEN: ::c_int = 255; +pub const KI_NSPARE_PTR: usize = 5; + +/// domainset policies +pub const DOMAINSET_POLICY_INVALID: ::c_int = 0; +pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1; +pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2; +pub const DOMAINSET_POLICY_PREFER: ::c_int = 3; +pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4; + +pub const MINCORE_SUPER: ::c_int = 0x20; + +extern "C" { + pub fn setgrent(); + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn freelocale(loc: ::locale_t); + pub fn msgrcv( + msqid: ::c_int, + msgp: *mut ::c_void, + msgsz: ::size_t, + msgtyp: ::c_long, + msgflg: ::c_int, + ) -> ::ssize_t; + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + + pub fn fdatasync(fd: ::c_int) -> ::c_int; + + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; + pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; + pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int; + pub fn setproctitle_fast(fmt: *const ::c_char, ...); + pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; + + pub fn cpuset_getdomain( + level: ::cpulevel_t, + which: ::cpuwhich_t, + id: ::id_t, + setsize: ::size_t, + mask: *mut ::domainset_t, + policy: *mut ::c_int, + ) -> ::c_int; + pub fn cpuset_setdomain( + level: ::cpulevel_t, + which: ::cpuwhich_t, + id: ::id_t, + setsize: ::size_t, + mask: *const ::domainset_t, + policy: ::c_int, + ) -> ::c_int; + + pub fn copy_file_range( + infd: ::c_int, + inoffp: *mut ::off_t, + outfd: ::c_int, + outoffp: *mut ::off_t, + len: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; +} + +#[link(name = "kvm")] +extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; +} + +cfg_if! { + if #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "riscv64"))] { + mod b64; + pub use self::b64::*; + } +} + +cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..7bf2534455bf965cea56c1896e21649c425601fb --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs @@ -0,0 +1,5 @@ +pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN; +pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1; +pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2; +pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1; +pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs new file mode 100644 index 0000000000000000000000000000000000000000..80c6fa16845308f929843e6d493807c49754d27d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs @@ -0,0 +1,34 @@ +#[repr(C)] +#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + st_padding0: i16, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + st_padding1: i32, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_birthtime: ::time_t, + pub st_birthtime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, + pub st_gen: u64, + pub st_spare: [u64; 10], +} + +impl ::Copy for ::stat {} +impl ::Clone for ::stat { + fn clone(&self) -> ::stat { + *self + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..c655d555d9005c998c5d0694576ddf4869ef996c --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs @@ -0,0 +1,546 @@ +// APIs in FreeBSD 13 that have changed since 11. + +pub type nlink_t = u64; +pub type dev_t = u64; +pub type ino_t = ::c_ulong; +pub type shmatt_t = ::c_uint; +pub type kpaddr_t = u64; +pub type kssize_t = i64; +pub type domainset_t = __c_anonymous_domainset; + +s! { + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + } + + pub struct kevent { + pub ident: ::uintptr_t, + pub filter: ::c_short, + pub flags: ::c_ushort, + pub fflags: ::c_uint, + pub data: i64, + pub udata: *mut ::c_void, + pub ext: [u64; 4], + } + + pub struct kvm_page { + pub kp_version: ::u_int, + pub kp_paddr: ::kpaddr_t, + pub kp_kmap_vaddr: ::kvaddr_t, + pub kp_dmap_vaddr: ::kvaddr_t, + pub kp_prot: ::vm_prot_t, + pub kp_offset: ::off_t, + pub kp_len: ::size_t, + } + + pub struct __c_anonymous_domainset { + _priv: [::uintptr_t; 4], + } + + pub struct kinfo_proc { + /// Size of this structure. + pub ki_structsize: ::c_int, + /// Reserved: layout identifier. + pub ki_layout: ::c_int, + /// Address of command arguments. + pub ki_args: *mut ::pargs, + // This is normally "struct proc". + /// Address of proc. + pub ki_paddr: *mut ::c_void, + // This is normally "struct user". + /// Kernel virtual address of u-area. + pub ki_addr: *mut ::c_void, + // This is normally "struct vnode". + /// Pointer to trace file. + pub ki_tracep: *mut ::c_void, + // This is normally "struct vnode". + /// Pointer to executable file. + pub ki_textvp: *mut ::c_void, + // This is normally "struct filedesc". + /// Pointer to open file info. + pub ki_fd: *mut ::c_void, + // This is normally "struct vmspace". + /// Pointer to kernel vmspace struct. + pub ki_vmspace: *mut ::c_void, + /// Sleep address. + pub ki_wchan: *const ::c_void, + /// Process identifier. + pub ki_pid: ::pid_t, + /// Parent process ID. + pub ki_ppid: ::pid_t, + /// Process group ID. + pub ki_pgid: ::pid_t, + /// tty process group ID. + pub ki_tpgid: ::pid_t, + /// Process session ID. + pub ki_sid: ::pid_t, + /// Terminal session ID. + pub ki_tsid: ::pid_t, + /// Job control counter. + pub ki_jobc: ::c_short, + /// Unused (just here for alignment). + pub ki_spare_short1: ::c_short, + /// Controlling tty dev. + pub ki_tdev_freebsd11: u32, + /// Signals arrived but not delivered. + pub ki_siglist: ::sigset_t, + /// Current signal mask. + pub ki_sigmask: ::sigset_t, + /// Signals being ignored. + pub ki_sigignore: ::sigset_t, + /// Signals being caught by user. + pub ki_sigcatch: ::sigset_t, + /// Effective user ID. + pub ki_uid: ::uid_t, + /// Real user ID. + pub ki_ruid: ::uid_t, + /// Saved effective user ID. + pub ki_svuid: ::uid_t, + /// Real group ID. + pub ki_rgid: ::gid_t, + /// Saved effective group ID. + pub ki_svgid: ::gid_t, + /// Number of groups. + pub ki_ngroups: ::c_short, + /// Unused (just here for alignment). + pub ki_spare_short2: ::c_short, + /// Groups. + pub ki_groups: [::gid_t; ::KI_NGROUPS], + /// Virtual size. + pub ki_size: ::vm_size_t, + /// Current resident set size in pages. + pub ki_rssize: ::segsz_t, + /// Resident set size before last swap. + pub ki_swrss: ::segsz_t, + /// Text size (pages) XXX. + pub ki_tsize: ::segsz_t, + /// Data size (pages) XXX. + pub ki_dsize: ::segsz_t, + /// Stack size (pages). + pub ki_ssize: ::segsz_t, + /// Exit status for wait & stop signal. + pub ki_xstat: ::u_short, + /// Accounting flags. + pub ki_acflag: ::u_short, + /// %cpu for process during `ki_swtime`. + pub ki_pctcpu: ::fixpt_t, + /// Time averaged value of `ki_cpticks`. + pub ki_estcpu: ::u_int, + /// Time since last blocked. + pub ki_slptime: ::u_int, + /// Time swapped in or out. + pub ki_swtime: ::u_int, + /// Number of copy-on-write faults. + pub ki_cow: ::u_int, + /// Real time in microsec. + pub ki_runtime: u64, + /// Starting time. + pub ki_start: ::timeval, + /// Time used by process children. + pub ki_childtime: ::timeval, + /// P_* flags. + pub ki_flag: ::c_long, + /// KI_* flags (below). + pub ki_kiflag: ::c_long, + /// Kernel trace points. + pub ki_traceflag: ::c_int, + /// S* process status. + pub ki_stat: ::c_char, + /// Process "nice" value. + pub ki_nice: i8, // signed char + /// Process lock (prevent swap) count. + pub ki_lock: ::c_char, + /// Run queue index. + pub ki_rqindex: ::c_char, + /// Which cpu we are on. + pub ki_oncpu_old: ::c_uchar, + /// Last cpu we were on. + pub ki_lastcpu_old: ::c_uchar, + /// Thread name. + pub ki_tdname: [::c_char; ::TDNAMLEN + 1], + /// Wchan message. + pub ki_wmesg: [::c_char; ::WMESGLEN + 1], + /// Setlogin name. + pub ki_login: [::c_char; ::LOGNAMELEN + 1], + /// Lock name. + pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1], + /// Command name. + pub ki_comm: [::c_char; ::COMMLEN + 1], + /// Emulation name. + pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1], + /// Login class. + pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1], + /// More thread name. + pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1], + /// Spare string space. + pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq + /// Spare room for growth. + pub ki_spareints: [::c_int; ::KI_NSPARE_INT], + /// Controlling tty dev. + pub ki_tdev: u64, + /// Which cpu we are on. + pub ki_oncpu: ::c_int, + /// Last cpu we were on. + pub ki_lastcpu: ::c_int, + /// PID of tracing process. + pub ki_tracer: ::c_int, + /// P2_* flags. + pub ki_flag2: ::c_int, + /// Default FIB number. + pub ki_fibnum: ::c_int, + /// Credential flags. + pub ki_cr_flags: ::u_int, + /// Process jail ID. + pub ki_jid: ::c_int, + /// Number of threads in total. + pub ki_numthreads: ::c_int, + /// Thread ID. + pub ki_tid: ::lwpid_t, + /// Process priority. + pub ki_pri: ::priority, + /// Process rusage statistics. + pub ki_rusage: ::rusage, + /// rusage of children processes. + pub ki_rusage_ch: ::rusage, + // This is normally "struct pcb". + /// Kernel virtual addr of pcb. + pub ki_pcb: *mut ::c_void, + /// Kernel virtual addr of stack. + pub ki_kstack: *mut ::c_void, + /// User convenience pointer. + pub ki_udata: *mut ::c_void, + // This is normally "struct thread". + pub ki_tdaddr: *mut ::c_void, + // This is normally "struct pwddesc". + /// Pointer to process paths info. + pub ki_pd: *mut ::c_void, + pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR], + pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG], + /// PS_* flags. + pub ki_sflag: ::c_long, + /// kthread flag. + pub ki_tdflags: ::c_long, + } +} + +s_no_extra_traits! { + pub struct dirent { + pub d_fileno: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: u16, + pub d_type: u8, + d_pad0: u8, + pub d_namlen: u16, + d_pad1: u16, + pub d_name: [::c_char; 256], + } + + pub struct statfs { + pub f_version: u32, + pub f_type: u32, + pub f_flags: u64, + pub f_bsize: u64, + pub f_iosize: u64, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: i64, + pub f_files: u64, + pub f_ffree: i64, + pub f_syncwrites: u64, + pub f_asyncwrites: u64, + pub f_syncreads: u64, + pub f_asyncreads: u64, + f_spare: [u64; 10], + pub f_namemax: u32, + pub f_owner: ::uid_t, + pub f_fsid: ::fsid_t, + f_charspare: [::c_char; 80], + pub f_fstypename: [::c_char; 16], + pub f_mntfromname: [::c_char; 1024], + pub f_mntonname: [::c_char; 1024], + } + + pub struct vnstat { + pub vn_fileid: u64, + pub vn_size: u64, + pub vn_dev: u64, + pub vn_fsid: u64, + pub vn_mntdir: *mut ::c_char, + pub vn_type: ::c_int, + pub vn_mode: u16, + pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for statfs { + fn eq(&self, other: &statfs) -> bool { + self.f_version == other.f_version + && self.f_type == other.f_type + && self.f_flags == other.f_flags + && self.f_bsize == other.f_bsize + && self.f_iosize == other.f_iosize + && self.f_blocks == other.f_blocks + && self.f_bfree == other.f_bfree + && self.f_bavail == other.f_bavail + && self.f_files == other.f_files + && self.f_ffree == other.f_ffree + && self.f_syncwrites == other.f_syncwrites + && self.f_asyncwrites == other.f_asyncwrites + && self.f_syncreads == other.f_syncreads + && self.f_asyncreads == other.f_asyncreads + && self.f_namemax == other.f_namemax + && self.f_owner == other.f_owner + && self.f_fsid == other.f_fsid + && self.f_fstypename == other.f_fstypename + && self + .f_mntfromname + .iter() + .zip(other.f_mntfromname.iter()) + .all(|(a,b)| a == b) + && self + .f_mntonname + .iter() + .zip(other.f_mntonname.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for statfs {} + impl ::fmt::Debug for statfs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("statfs") + .field("f_bsize", &self.f_bsize) + .field("f_iosize", &self.f_iosize) + .field("f_blocks", &self.f_blocks) + .field("f_bfree", &self.f_bfree) + .field("f_bavail", &self.f_bavail) + .field("f_files", &self.f_files) + .field("f_ffree", &self.f_ffree) + .field("f_syncwrites", &self.f_syncwrites) + .field("f_asyncwrites", &self.f_asyncwrites) + .field("f_syncreads", &self.f_syncreads) + .field("f_asyncreads", &self.f_asyncreads) + .field("f_namemax", &self.f_namemax) + .field("f_owner", &self.f_owner) + .field("f_fsid", &self.f_fsid) + .field("f_fstypename", &self.f_fstypename) + .field("f_mntfromname", &&self.f_mntfromname[..]) + .field("f_mntonname", &&self.f_mntonname[..]) + .finish() + } + } + impl ::hash::Hash for statfs { + fn hash(&self, state: &mut H) { + self.f_version.hash(state); + self.f_type.hash(state); + self.f_flags.hash(state); + self.f_bsize.hash(state); + self.f_iosize.hash(state); + self.f_blocks.hash(state); + self.f_bfree.hash(state); + self.f_bavail.hash(state); + self.f_files.hash(state); + self.f_ffree.hash(state); + self.f_syncwrites.hash(state); + self.f_asyncwrites.hash(state); + self.f_syncreads.hash(state); + self.f_asyncreads.hash(state); + self.f_namemax.hash(state); + self.f_owner.hash(state); + self.f_fsid.hash(state); + self.f_charspare.hash(state); + self.f_fstypename.hash(state); + self.f_mntfromname.hash(state); + self.f_mntonname.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_fileno == other.d_fileno + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self.d_namlen == other.d_namlen + && self + .d_name[..self.d_namlen as _] + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_fileno", &self.d_fileno) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + .field("d_namlen", &self.d_namlen) + .field("d_name", &&self.d_name[..self.d_namlen as _]) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_fileno.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_namlen.hash(state); + self.d_name[..self.d_namlen as _].hash(state); + } + } + + impl PartialEq for vnstat { + fn eq(&self, other: &vnstat) -> bool { + let self_vn_devname: &[::c_char] = &self.vn_devname; + let other_vn_devname: &[::c_char] = &other.vn_devname; + + self.vn_fileid == other.vn_fileid && + self.vn_size == other.vn_size && + self.vn_dev == other.vn_dev && + self.vn_fsid == other.vn_fsid && + self.vn_mntdir == other.vn_mntdir && + self.vn_type == other.vn_type && + self.vn_mode == other.vn_mode && + self_vn_devname == other_vn_devname + } + } + impl Eq for vnstat {} + impl ::fmt::Debug for vnstat { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let self_vn_devname: &[::c_char] = &self.vn_devname; + + f.debug_struct("vnstat") + .field("vn_fileid", &self.vn_fileid) + .field("vn_size", &self.vn_size) + .field("vn_dev", &self.vn_dev) + .field("vn_fsid", &self.vn_fsid) + .field("vn_mntdir", &self.vn_mntdir) + .field("vn_type", &self.vn_type) + .field("vn_mode", &self.vn_mode) + .field("vn_devname", &self_vn_devname) + .finish() + } + } + impl ::hash::Hash for vnstat { + fn hash(&self, state: &mut H) { + let self_vn_devname: &[::c_char] = &self.vn_devname; + + self.vn_fileid.hash(state); + self.vn_size.hash(state); + self.vn_dev.hash(state); + self.vn_fsid.hash(state); + self.vn_mntdir.hash(state); + self.vn_type.hash(state); + self.vn_mode.hash(state); + self_vn_devname.hash(state); + } + } + } +} + +pub const RAND_MAX: ::c_int = 0x7fff_ffff; +pub const ELAST: ::c_int = 97; + +pub const KF_TYPE_EVENTFD: ::c_int = 13; + +/// max length of devicename +pub const SPECNAMELEN: ::c_int = 255; +pub const KI_NSPARE_PTR: usize = 5; + +/// domainset policies +pub const DOMAINSET_POLICY_INVALID: ::c_int = 0; +pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1; +pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2; +pub const DOMAINSET_POLICY_PREFER: ::c_int = 3; +pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4; + +pub const MINCORE_SUPER: ::c_int = 0x60; + +extern "C" { + pub fn setgrent(); + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn freelocale(loc: ::locale_t); + pub fn msgrcv( + msqid: ::c_int, + msgp: *mut ::c_void, + msgsz: ::size_t, + msgtyp: ::c_long, + msgflg: ::c_int, + ) -> ::ssize_t; + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + + pub fn fdatasync(fd: ::c_int) -> ::c_int; + + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; + pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; + pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int; + pub fn setproctitle_fast(fmt: *const ::c_char, ...); + pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; + + pub fn cpuset_getdomain( + level: ::cpulevel_t, + which: ::cpuwhich_t, + id: ::id_t, + setsize: ::size_t, + mask: *mut ::domainset_t, + policy: *mut ::c_int, + ) -> ::c_int; + pub fn cpuset_setdomain( + level: ::cpulevel_t, + which: ::cpuwhich_t, + id: ::id_t, + setsize: ::size_t, + mask: *const ::domainset_t, + policy: ::c_int, + ) -> ::c_int; + + pub fn copy_file_range( + infd: ::c_int, + inoffp: *mut ::off_t, + outfd: ::c_int, + outoffp: *mut ::off_t, + len: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; +} + +#[link(name = "kvm")] +extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; +} + +cfg_if! { + if #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "riscv64"))] { + mod b64; + pub use self::b64::*; + } +} + +cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..7bf2534455bf965cea56c1896e21649c425601fb --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs @@ -0,0 +1,5 @@ +pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN; +pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1; +pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2; +pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1; +pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..84e43b23e522912a710ab032f5b7f4ba51b9f4ef --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -0,0 +1,4538 @@ +pub type fflags_t = u32; +pub type clock_t = i32; + +pub type vm_prot_t = u_char; +pub type kvaddr_t = u64; +pub type segsz_t = isize; +pub type __fixpt_t = u32; +pub type fixpt_t = __fixpt_t; +pub type __lwpid_t = i32; +pub type lwpid_t = __lwpid_t; +pub type blksize_t = i32; +pub type clockid_t = ::c_int; +pub type sem_t = _sem; +pub type timer_t = *mut __c_anonymous__timer; + +pub type fsblkcnt_t = u64; +pub type fsfilcnt_t = u64; +pub type idtype_t = ::c_uint; + +pub type msglen_t = ::c_ulong; +pub type msgqnum_t = ::c_ulong; + +pub type cpulevel_t = ::c_int; +pub type cpuwhich_t = ::c_int; + +pub type mqd_t = *mut ::c_void; +pub type posix_spawnattr_t = *mut ::c_void; +pub type posix_spawn_file_actions_t = *mut ::c_void; + +pub type pthread_spinlock_t = *mut __c_anonymous_pthread_spinlock; +pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr; +pub type pthread_barrier_t = *mut __c_anonymous_pthread_barrier; + +pub type uuid_t = ::uuid; +pub type u_int = ::c_uint; +pub type u_char = ::c_uchar; +pub type u_long = ::c_ulong; +pub type u_short = ::c_ushort; + +pub type caddr_t = *mut ::c_char; + +pub type fhandle_t = fhandle; + +pub type au_id_t = ::uid_t; +pub type au_asid_t = ::pid_t; + +#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] +#[repr(u32)] +pub enum devstat_support_flags { + DEVSTAT_ALL_SUPPORTED = 0x00, + DEVSTAT_NO_BLOCKSIZE = 0x01, + DEVSTAT_NO_ORDERED_TAGS = 0x02, + DEVSTAT_BS_UNAVAILABLE = 0x04, +} +impl ::Copy for devstat_support_flags {} +impl ::Clone for devstat_support_flags { + fn clone(&self) -> devstat_support_flags { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] +#[repr(u32)] +pub enum devstat_trans_flags { + DEVSTAT_NO_DATA = 0x00, + DEVSTAT_READ = 0x01, + DEVSTAT_WRITE = 0x02, + DEVSTAT_FREE = 0x03, +} + +impl ::Copy for devstat_trans_flags {} +impl ::Clone for devstat_trans_flags { + fn clone(&self) -> devstat_trans_flags { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] +#[repr(u32)] +pub enum devstat_tag_type { + DEVSTAT_TAG_SIMPLE = 0x00, + DEVSTAT_TAG_HEAD = 0x01, + DEVSTAT_TAG_ORDERED = 0x02, + DEVSTAT_TAG_NONE = 0x03, +} +impl ::Copy for devstat_tag_type {} +impl ::Clone for devstat_tag_type { + fn clone(&self) -> devstat_tag_type { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] +#[repr(u32)] +pub enum devstat_match_flags { + DEVSTAT_MATCH_NONE = 0x00, + DEVSTAT_MATCH_TYPE = 0x01, + DEVSTAT_MATCH_IF = 0x02, + DEVSTAT_MATCH_PASS = 0x04, +} +impl ::Copy for devstat_match_flags {} +impl ::Clone for devstat_match_flags { + fn clone(&self) -> devstat_match_flags { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] +#[repr(u32)] +pub enum devstat_priority { + DEVSTAT_PRIORITY_MIN = 0x000, + DEVSTAT_PRIORITY_OTHER = 0x020, + DEVSTAT_PRIORITY_PASS = 0x030, + DEVSTAT_PRIORITY_FD = 0x040, + DEVSTAT_PRIORITY_WFD = 0x050, + DEVSTAT_PRIORITY_TAPE = 0x060, + DEVSTAT_PRIORITY_CD = 0x090, + DEVSTAT_PRIORITY_DISK = 0x110, + DEVSTAT_PRIORITY_ARRAY = 0x120, + DEVSTAT_PRIORITY_MAX = 0xfff, +} +impl ::Copy for devstat_priority {} +impl ::Clone for devstat_priority { + fn clone(&self) -> devstat_priority { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] +#[repr(u32)] +pub enum devstat_type_flags { + DEVSTAT_TYPE_DIRECT = 0x000, + DEVSTAT_TYPE_SEQUENTIAL = 0x001, + DEVSTAT_TYPE_PRINTER = 0x002, + DEVSTAT_TYPE_PROCESSOR = 0x003, + DEVSTAT_TYPE_WORM = 0x004, + DEVSTAT_TYPE_CDROM = 0x005, + DEVSTAT_TYPE_SCANNER = 0x006, + DEVSTAT_TYPE_OPTICAL = 0x007, + DEVSTAT_TYPE_CHANGER = 0x008, + DEVSTAT_TYPE_COMM = 0x009, + DEVSTAT_TYPE_ASC0 = 0x00a, + DEVSTAT_TYPE_ASC1 = 0x00b, + DEVSTAT_TYPE_STORARRAY = 0x00c, + DEVSTAT_TYPE_ENCLOSURE = 0x00d, + DEVSTAT_TYPE_FLOPPY = 0x00e, + DEVSTAT_TYPE_MASK = 0x00f, + DEVSTAT_TYPE_IF_SCSI = 0x010, + DEVSTAT_TYPE_IF_IDE = 0x020, + DEVSTAT_TYPE_IF_OTHER = 0x030, + DEVSTAT_TYPE_IF_MASK = 0x0f0, + DEVSTAT_TYPE_PASS = 0x100, +} +impl ::Copy for devstat_type_flags {} +impl ::Clone for devstat_type_flags { + fn clone(&self) -> devstat_type_flags { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] +#[repr(u32)] +pub enum devstat_metric { + DSM_NONE, + DSM_TOTAL_BYTES, + DSM_TOTAL_BYTES_READ, + DSM_TOTAL_BYTES_WRITE, + DSM_TOTAL_TRANSFERS, + DSM_TOTAL_TRANSFERS_READ, + DSM_TOTAL_TRANSFERS_WRITE, + DSM_TOTAL_TRANSFERS_OTHER, + DSM_TOTAL_BLOCKS, + DSM_TOTAL_BLOCKS_READ, + DSM_TOTAL_BLOCKS_WRITE, + DSM_KB_PER_TRANSFER, + DSM_KB_PER_TRANSFER_READ, + DSM_KB_PER_TRANSFER_WRITE, + DSM_TRANSFERS_PER_SECOND, + DSM_TRANSFERS_PER_SECOND_READ, + DSM_TRANSFERS_PER_SECOND_WRITE, + DSM_TRANSFERS_PER_SECOND_OTHER, + DSM_MB_PER_SECOND, + DSM_MB_PER_SECOND_READ, + DSM_MB_PER_SECOND_WRITE, + DSM_BLOCKS_PER_SECOND, + DSM_BLOCKS_PER_SECOND_READ, + DSM_BLOCKS_PER_SECOND_WRITE, + DSM_MS_PER_TRANSACTION, + DSM_MS_PER_TRANSACTION_READ, + DSM_MS_PER_TRANSACTION_WRITE, + DSM_SKIP, + DSM_TOTAL_BYTES_FREE, + DSM_TOTAL_TRANSFERS_FREE, + DSM_TOTAL_BLOCKS_FREE, + DSM_KB_PER_TRANSFER_FREE, + DSM_MB_PER_SECOND_FREE, + DSM_TRANSFERS_PER_SECOND_FREE, + DSM_BLOCKS_PER_SECOND_FREE, + DSM_MS_PER_TRANSACTION_OTHER, + DSM_MS_PER_TRANSACTION_FREE, + DSM_BUSY_PCT, + DSM_QUEUE_LENGTH, + DSM_TOTAL_DURATION, + DSM_TOTAL_DURATION_READ, + DSM_TOTAL_DURATION_WRITE, + DSM_TOTAL_DURATION_FREE, + DSM_TOTAL_DURATION_OTHER, + DSM_TOTAL_BUSY_TIME, + DSM_MAX, +} +impl ::Copy for devstat_metric {} +impl ::Clone for devstat_metric { + fn clone(&self) -> devstat_metric { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] +#[repr(u32)] +pub enum devstat_select_mode { + DS_SELECT_ADD, + DS_SELECT_ONLY, + DS_SELECT_REMOVE, + DS_SELECT_ADDONLY, +} +impl ::Copy for devstat_select_mode {} +impl ::Clone for devstat_select_mode { + fn clone(&self) -> devstat_select_mode { + *self + } +} + +s! { + pub struct aiocb { + pub aio_fildes: ::c_int, + pub aio_offset: ::off_t, + pub aio_buf: *mut ::c_void, + pub aio_nbytes: ::size_t, + __unused1: [::c_int; 2], + __unused2: *mut ::c_void, + pub aio_lio_opcode: ::c_int, + pub aio_reqprio: ::c_int, + // unused 3 through 5 are the __aiocb_private structure + __unused3: ::c_long, + __unused4: ::c_long, + __unused5: *mut ::c_void, + pub aio_sigevent: sigevent + } + + pub struct jail { + pub version: u32, + pub path: *mut ::c_char, + pub hostname: *mut ::c_char, + pub jailname: *mut ::c_char, + pub ip4s: ::c_uint, + pub ip6s: ::c_uint, + pub ip4: *mut ::in_addr, + pub ip6: *mut ::in6_addr, + } + + pub struct statvfs { + pub f_bavail: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_blocks: ::fsblkcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_bsize: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_fsid: ::c_ulong, + pub f_namemax: ::c_ulong, + } + + // internal structure has changed over time + pub struct _sem { + data: [u32; 4], + } + pub struct sembuf { + pub sem_num: ::c_ushort, + pub sem_op: ::c_short, + pub sem_flg: ::c_short, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + __unused1: *mut ::c_void, + __unused2: *mut ::c_void, + pub msg_cbytes: ::msglen_t, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + pub msg_stime: ::time_t, + pub msg_rtime: ::time_t, + pub msg_ctime: ::time_t, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::ssize_t, + } + + pub struct sockcred { + pub sc_uid: ::uid_t, + pub sc_euid: ::uid_t, + pub sc_gid: ::gid_t, + pub sc_egid: ::gid_t, + pub sc_ngroups: ::c_int, + pub sc_groups: [::gid_t; 1], + } + + pub struct ptrace_vm_entry { + pub pve_entry: ::c_int, + pub pve_timestamp: ::c_int, + pub pve_start: ::c_ulong, + pub pve_end: ::c_ulong, + pub pve_offset: ::c_ulong, + pub pve_prot: ::c_uint, + pub pve_pathlen: ::c_uint, + pub pve_fileid: ::c_long, + pub pve_fsid: u32, + pub pve_path: *mut ::c_char, + } + + pub struct ptrace_lwpinfo { + pub pl_lwpid: lwpid_t, + pub pl_event: ::c_int, + pub pl_flags: ::c_int, + pub pl_sigmask: ::sigset_t, + pub pl_siglist: ::sigset_t, + pub pl_siginfo: ::siginfo_t, + pub pl_tdname: [::c_char; ::MAXCOMLEN as usize + 1], + pub pl_child_pid: ::pid_t, + pub pl_syscall_code: ::c_uint, + pub pl_syscall_narg: ::c_uint, + } + + pub struct ptrace_sc_ret { + pub sr_retval: [::register_t; 2], + pub sr_error: ::c_int, + } + + pub struct ptrace_coredump { + pub pc_fd: ::c_int, + pub pc_flags: u32, + pub pc_limit: ::off_t, + } + + pub struct cpuset_t { + #[cfg(target_pointer_width = "64")] + __bits: [::c_long; 4], + #[cfg(target_pointer_width = "32")] + __bits: [::c_long; 8], + } + + pub struct cap_rights_t { + cr_rights: [u64; 2], + } + + pub struct umutex { + m_owner: ::lwpid_t, + m_flags: u32, + m_ceilings: [u32; 2], + m_rb_link: ::uintptr_t, + #[cfg(target_pointer_width = "32")] + m_pad: u32, + m_spare: [u32; 2], + + } + + pub struct ucond { + c_has_waiters: u32, + c_flags: u32, + c_clockid: u32, + c_spare: [u32; 1], + } + + pub struct uuid { + pub time_low: u32, + pub time_mid: u16, + pub time_hi_and_version: u16, + pub clock_seq_hi_and_reserved: u8, + pub clock_seq_low: u8, + pub node: [u8; _UUID_NODE_LEN], + } + + pub struct __c_anonymous_pthread_spinlock { + s_clock: umutex, + } + + pub struct __c_anonymous_pthread_barrierattr { + pshared: ::c_int, + } + + pub struct __c_anonymous_pthread_barrier { + b_lock: umutex, + b_cv: ucond, + b_cycle: i64, + b_count: ::c_int, + b_waiters: ::c_int, + b_refcount: ::c_int, + b_destroying: ::c_int, + } + + pub struct kinfo_vmentry { + pub kve_structsize: ::c_int, + pub kve_type: ::c_int, + pub kve_start: u64, + pub kve_end: u64, + pub kve_offset: u64, + pub kve_vn_fileid: u64, + #[cfg(not(freebsd11))] + pub kve_vn_fsid_freebsd11: u32, + #[cfg(freebsd11)] + pub kve_vn_fsid: u32, + pub kve_flags: ::c_int, + pub kve_resident: ::c_int, + pub kve_private_resident: ::c_int, + pub kve_protection: ::c_int, + pub kve_ref_count: ::c_int, + pub kve_shadow_count: ::c_int, + pub kve_vn_type: ::c_int, + pub kve_vn_size: u64, + #[cfg(not(freebsd11))] + pub kve_vn_rdev_freebsd11: u32, + #[cfg(freebsd11)] + pub kve_vn_rdev: u32, + pub kve_vn_mode: u16, + pub kve_status: u16, + #[cfg(not(freebsd11))] + pub kve_vn_fsid: u64, + #[cfg(not(freebsd11))] + pub kve_vn_rdev: u64, + #[cfg(not(freebsd11))] + _kve_is_spare: [::c_int; 8], + #[cfg(freebsd11)] + _kve_is_spare: [::c_int; 12], + pub kve_path: [[::c_char; 32]; 32], + } + + pub struct __c_anonymous_filestat { + pub stqe_next: *mut filestat, + } + + pub struct filestat { + pub fs_type: ::c_int, + pub fs_flags: ::c_int, + pub fs_fflags: ::c_int, + pub fs_uflags: ::c_int, + pub fs_fd: ::c_int, + pub fs_ref_count: ::c_int, + pub fs_offset: ::off_t, + pub fs_typedep: *mut ::c_void, + pub fs_path: *mut ::c_char, + pub next: __c_anonymous_filestat, + pub fs_cap_rights: cap_rights_t, + } + + pub struct filestat_list { + pub stqh_first: *mut filestat, + pub stqh_last: *mut *mut filestat, + } + + pub struct procstat { + pub tpe: ::c_int, + pub kd: ::uintptr_t, + pub vmentries: *mut ::c_void, + pub files: *mut ::c_void, + pub argv: *mut ::c_void, + pub envv: *mut ::c_void, + pub core: ::uintptr_t, + } + + pub struct itimerspec { + pub it_interval: ::timespec, + pub it_value: ::timespec, + } + + pub struct __c_anonymous__timer { + _priv: [::c_int; 3], + } + + /// Used to hold a copy of the command line, if it had a sane length. + pub struct pargs { + /// Reference count. + pub ar_ref: u_int, + /// Length. + pub ar_length: u_int, + /// Arguments. + pub ar_args: [::c_uchar; 1], + } + + pub struct priority { + /// Scheduling class. + pub pri_class: u_char, + /// Normal priority level. + pub pri_level: u_char, + /// Priority before propagation. + pub pri_native: u_char, + /// User priority based on p_cpu and p_nice. + pub pri_user: u_char, + } + + pub struct kvm_swap { + pub ksw_devname: [::c_char; 32], + pub ksw_used: u_int, + pub ksw_total: u_int, + pub ksw_flags: ::c_int, + pub ksw_reserved1: u_int, + pub ksw_reserved2: u_int, + } + + pub struct nlist { + /// symbol name (in memory) + pub n_name: *const ::c_char, + /// type defines + pub n_type: ::c_uchar, + /// "type" and binding information + pub n_other: ::c_char, + /// used by stab entries + pub n_desc: ::c_short, + pub n_value: ::c_ulong, + } + + pub struct kvm_nlist { + pub n_name: *const ::c_char, + pub n_type: ::c_uchar, + pub n_value: ::kvaddr_t, + } + + pub struct __c_anonymous_sem { + _priv: ::uintptr_t, + } + + pub struct semid_ds { + pub sem_perm: ::ipc_perm, + pub __sem_base: *mut __c_anonymous_sem, + pub sem_nsems: ::c_ushort, + pub sem_otime: ::time_t, + pub sem_ctime: ::time_t, + } + + pub struct vmtotal { + pub t_vm: u64, + pub t_avm: u64, + pub t_rm: u64, + pub t_arm: u64, + pub t_vmshr: u64, + pub t_avmshr: u64, + pub t_rmshr: u64, + pub t_armshr: u64, + pub t_free: u64, + pub t_rq: i16, + pub t_dw: i16, + pub t_pw: i16, + pub t_sl: i16, + pub t_sw: i16, + pub t_pad: [u16; 3], + } + + pub struct sockstat { + pub inp_ppcb: u64, + pub so_addr: u64, + pub so_pcb: u64, + pub unp_conn: u64, + pub dom_family: ::c_int, + pub proto: ::c_int, + pub so_rcv_sb_state: ::c_int, + pub so_snd_sb_state: ::c_int, + /// Socket address. + pub sa_local: ::sockaddr_storage, + /// Peer address. + pub sa_peer: ::sockaddr_storage, + pub type_: ::c_int, + pub dname: [::c_char; 32], + #[cfg(any(freebsd12, freebsd13, freebsd14))] + pub sendq: ::c_uint, + #[cfg(any(freebsd12, freebsd13, freebsd14))] + pub recvq: ::c_uint, + } + + pub struct shmstat { + pub size: u64, + pub mode: u16, + } + + pub struct spacectl_range { + pub r_offset: ::off_t, + pub r_len: ::off_t + } + + pub struct rusage_ext { + pub rux_runtime: u64, + pub rux_uticks: u64, + pub rux_sticks: u64, + pub rux_iticks: u64, + pub rux_uu: u64, + pub rux_su: u64, + pub rux_tu: u64, + } + + pub struct if_clonereq { + pub ifcr_total: ::c_int, + pub ifcr_count: ::c_int, + pub ifcr_buffer: *mut ::c_char, + } + + pub struct if_msghdr { + /// to skip over non-understood messages + pub ifm_msglen: ::c_ushort, + /// future binary compatibility + pub ifm_version: ::c_uchar, + /// message type + pub ifm_type: ::c_uchar, + /// like rtm_addrs + pub ifm_addrs: ::c_int, + /// value of if_flags + pub ifm_flags: ::c_int, + /// index for associated ifp + pub ifm_index: ::c_ushort, + pub _ifm_spare1: ::c_ushort, + /// statistics and other data about if + pub ifm_data: if_data, + } + + pub struct if_msghdrl { + /// to skip over non-understood messages + pub ifm_msglen: ::c_ushort, + /// future binary compatibility + pub ifm_version: ::c_uchar, + /// message type + pub ifm_type: ::c_uchar, + /// like rtm_addrs + pub ifm_addrs: ::c_int, + /// value of if_flags + pub ifm_flags: ::c_int, + /// index for associated ifp + pub ifm_index: ::c_ushort, + /// spare space to grow if_index, see if_var.h + pub _ifm_spare1: ::c_ushort, + /// length of if_msghdrl incl. if_data + pub ifm_len: ::c_ushort, + /// offset of if_data from beginning + pub ifm_data_off: ::c_ushort, + pub _ifm_spare2: ::c_int, + /// statistics and other data about if + pub ifm_data: if_data, + } + + pub struct ifa_msghdr { + /// to skip over non-understood messages + pub ifam_msglen: ::c_ushort, + /// future binary compatibility + pub ifam_version: ::c_uchar, + /// message type + pub ifam_type: ::c_uchar, + /// like rtm_addrs + pub ifam_addrs: ::c_int, + /// value of ifa_flags + pub ifam_flags: ::c_int, + /// index for associated ifp + pub ifam_index: ::c_ushort, + pub _ifam_spare1: ::c_ushort, + /// value of ifa_ifp->if_metric + pub ifam_metric: ::c_int, + } + + pub struct ifa_msghdrl { + /// to skip over non-understood messages + pub ifam_msglen: ::c_ushort, + /// future binary compatibility + pub ifam_version: ::c_uchar, + /// message type + pub ifam_type: ::c_uchar, + /// like rtm_addrs + pub ifam_addrs: ::c_int, + /// value of ifa_flags + pub ifam_flags: ::c_int, + /// index for associated ifp + pub ifam_index: ::c_ushort, + /// spare space to grow if_index, see if_var.h + pub _ifam_spare1: ::c_ushort, + /// length of ifa_msghdrl incl. if_data + pub ifam_len: ::c_ushort, + /// offset of if_data from beginning + pub ifam_data_off: ::c_ushort, + /// value of ifa_ifp->if_metric + pub ifam_metric: ::c_int, + /// statistics and other data about if or address + pub ifam_data: if_data, + } + + pub struct ifma_msghdr { + /// to skip over non-understood messages + pub ifmam_msglen: ::c_ushort, + /// future binary compatibility + pub ifmam_version: ::c_uchar, + /// message type + pub ifmam_type: ::c_uchar, + /// like rtm_addrs + pub ifmam_addrs: ::c_int, + /// value of ifa_flags + pub ifmam_flags: ::c_int, + /// index for associated ifp + pub ifmam_index: ::c_ushort, + pub _ifmam_spare1: ::c_ushort, + } + + pub struct if_announcemsghdr { + /// to skip over non-understood messages + pub ifan_msglen: ::c_ushort, + /// future binary compatibility + pub ifan_version: ::c_uchar, + /// message type + pub ifan_type: ::c_uchar, + /// index for associated ifp + pub ifan_index: ::c_ushort, + /// if name, e.g. "en0" + pub ifan_name: [::c_char; ::IFNAMSIZ as usize], + /// what type of announcement + pub ifan_what: ::c_ushort, + } + + pub struct ifreq_buffer { + pub length: ::size_t, + pub buffer: *mut ::c_void, + } + + pub struct ifaliasreq { + /// if name, e.g. "en0" + pub ifra_name: [::c_char; ::IFNAMSIZ as usize], + pub ifra_addr: ::sockaddr, + pub ifra_broadaddr: ::sockaddr, + pub ifra_mask: ::sockaddr, + pub ifra_vhid: ::c_int, + } + + /// 9.x compat + pub struct oifaliasreq { + /// if name, e.g. "en0" + pub ifra_name: [::c_char; ::IFNAMSIZ as usize], + pub ifra_addr: ::sockaddr, + pub ifra_broadaddr: ::sockaddr, + pub ifra_mask: ::sockaddr, + } + + pub struct ifmediareq { + /// if name, e.g. "en0" + pub ifm_name: [::c_char; ::IFNAMSIZ as usize], + /// current media options + pub ifm_current: ::c_int, + /// don't care mask + pub ifm_mask: ::c_int, + /// media status + pub ifm_status: ::c_int, + /// active options + pub ifm_active: ::c_int, + /// # entries in ifm_ulist array + pub ifm_count: ::c_int, + /// media words + pub ifm_ulist: *mut ::c_int, + } + + pub struct ifdrv { + /// if name, e.g. "en0" + pub ifd_name: [::c_char; ::IFNAMSIZ as usize], + pub ifd_cmd: ::c_ulong, + pub ifd_len: ::size_t, + pub ifd_data: *mut ::c_void, + } + + pub struct ifi2creq { + /// i2c address (0xA0, 0xA2) + pub dev_addr: u8, + /// read offset + pub offset: u8, + /// read length + pub len: u8, + pub spare0: u8, + pub spare1: u32, + /// read buffer + pub data: [u8; 8], + } + + pub struct ifrsshash { + /// if name, e.g. "en0" + pub ifrh_name: [::c_char; ::IFNAMSIZ as usize], + /// RSS_FUNC_ + pub ifrh_func: u8, + pub ifrh_spare0: u8, + pub ifrh_spare1: u16, + /// RSS_TYPE_ + pub ifrh_types: u32, + } + + pub struct ifmibdata { + /// name of interface + pub ifmd_name: [::c_char; ::IFNAMSIZ as usize], + /// number of promiscuous listeners + pub ifmd_pcount: ::c_int, + /// interface flags + pub ifmd_flags: ::c_int, + /// instantaneous length of send queue + pub ifmd_snd_len: ::c_int, + /// maximum length of send queue + pub ifmd_snd_maxlen: ::c_int, + /// number of drops in send queue + pub ifmd_snd_drops: ::c_int, + /// for future expansion + pub ifmd_filler: [::c_int; 4], + /// generic information and statistics + pub ifmd_data: if_data, + } + + pub struct ifmib_iso_8802_3 { + pub dot3StatsAlignmentErrors: u32, + pub dot3StatsFCSErrors: u32, + pub dot3StatsSingleCollisionFrames: u32, + pub dot3StatsMultipleCollisionFrames: u32, + pub dot3StatsSQETestErrors: u32, + pub dot3StatsDeferredTransmissions: u32, + pub dot3StatsLateCollisions: u32, + pub dot3StatsExcessiveCollisions: u32, + pub dot3StatsInternalMacTransmitErrors: u32, + pub dot3StatsCarrierSenseErrors: u32, + pub dot3StatsFrameTooLongs: u32, + pub dot3StatsInternalMacReceiveErrors: u32, + pub dot3StatsEtherChipSet: u32, + pub dot3StatsMissedFrames: u32, + pub dot3StatsCollFrequencies: [u32; 16], + pub dot3Compliance: u32, + } + + pub struct __c_anonymous_ph { + pub ph1: u64, + pub ph2: u64, + } + + pub struct fid { + pub fid_len: ::c_ushort, + pub fid_data0: ::c_ushort, + pub fid_data: [::c_char; ::MAXFIDSZ as usize], + } + + pub struct fhandle { + pub fh_fsid: ::fsid_t, + pub fh_fid: fid, + } + + pub struct bintime { + pub sec: ::time_t, + pub frac: u64, + } + + pub struct clockinfo { + /// clock frequency + pub hz: ::c_int, + /// micro-seconds per hz tick + pub tick: ::c_int, + pub spare: ::c_int, + /// statistics clock frequency + pub stathz: ::c_int, + /// profiling clock frequency + pub profhz: ::c_int, + } + + pub struct __c_anonymous_stailq_entry_devstat { + pub stqe_next: *mut devstat, + } + + pub struct devstat { + /// Update sequence + pub sequence0: ::u_int, + /// Allocated entry + pub allocated: ::c_int, + /// started ops + pub start_count: ::u_int, + /// completed ops + pub end_count: ::u_int, + /// busy time unaccounted for since this time + pub busy_from: bintime, + pub dev_links: __c_anonymous_stailq_entry_devstat, + /// Devstat device number. + pub device_number: u32, + pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize], + pub unit_number: ::c_int, + pub bytes: [u64; DEVSTAT_N_TRANS_FLAGS as usize], + pub operations: [u64; DEVSTAT_N_TRANS_FLAGS as usize], + pub duration: [bintime; DEVSTAT_N_TRANS_FLAGS as usize], + pub busy_time: bintime, + /// Time the device was created. + pub creation_time: bintime, + /// Block size, bytes + pub block_size: u32, + /// The number of simple, ordered, and head of queue tags sent. + pub tag_types: [u64; 3], + /// Which statistics are supported by a given device. + pub flags: devstat_support_flags, + /// Device type + pub device_type: devstat_type_flags, + /// Controls list pos. + pub priority: devstat_priority, + /// Identification for GEOM nodes + pub id: *const ::c_void, + /// Update sequence + pub sequence1: ::u_int, + } + + pub struct devstat_match { + pub match_fields: devstat_match_flags, + pub device_type: devstat_type_flags, + pub num_match_categories: ::c_int, + } + + pub struct devstat_match_table { + pub match_str: *const ::c_char, + pub type_: devstat_type_flags, + pub match_field: devstat_match_flags, + } + + pub struct device_selection { + pub device_number: u32, + pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize], + pub unit_number: ::c_int, + pub selected: ::c_int, + pub bytes: u64, + pub position: ::c_int, + } + + pub struct devinfo { + pub devices: *mut devstat, + pub mem_ptr: *mut u8, + pub generation: ::c_long, + pub numdevs: ::c_int, + } + + pub struct sockcred2 { + pub sc_version: ::c_int, + pub sc_pid: ::pid_t, + pub sc_uid: ::uid_t, + pub sc_euid: ::uid_t, + pub sc_gid: ::gid_t, + pub sc_egid: ::gid_t, + pub sc_ngroups: ::c_int, + pub sc_groups: [::gid_t; 1], + } + + pub struct ifconf { + pub ifc_len: ::c_int, + #[cfg(libc_union)] + pub ifc_ifcu: __c_anonymous_ifc_ifcu, + } + + pub struct au_mask_t { + pub am_success: ::c_uint, + pub am_failure: ::c_uint, + } + + pub struct au_tid_t { + pub port: u32, + pub machine: u32, + } + + pub struct auditinfo_t { + pub ai_auid: ::au_id_t, + pub ai_mask: ::au_mask_t, + pub ai_termid: au_tid_t, + pub ai_asid: ::au_asid_t, + } + + pub struct tcp_fastopen { + pub enable: ::c_int, + pub psk: [u8; ::TCP_FASTOPEN_PSK_LEN as usize], + } + + pub struct tcp_function_set { + pub function_set_name: [::c_char; ::TCP_FUNCTION_NAME_LEN_MAX as usize], + pub pcbcnt: u32, + } + + pub struct _umtx_time { + pub _timeout: ::timespec, + pub _flags: u32, + pub _clockid: u32, + } +} + +s_no_extra_traits! { + pub struct utmpx { + pub ut_type: ::c_short, + pub ut_tv: ::timeval, + pub ut_id: [::c_char; 8], + pub ut_pid: ::pid_t, + pub ut_user: [::c_char; 32], + pub ut_line: [::c_char; 16], + pub ut_host: [::c_char; 128], + pub __ut_spare: [::c_char; 64], + } + + #[cfg(libc_union)] + pub union __c_anonymous_cr_pid { + __cr_unused: *mut ::c_void, + pub cr_pid: ::pid_t, + } + + pub struct xucred { + pub cr_version: ::c_uint, + pub cr_uid: ::uid_t, + pub cr_ngroups: ::c_short, + pub cr_groups: [::gid_t; 16], + #[cfg(libc_union)] + pub cr_pid__c_anonymous_union: __c_anonymous_cr_pid, + #[cfg(not(libc_union))] + __cr_unused1: *mut ::c_void, + } + + pub struct sockaddr_dl { + pub sdl_len: ::c_uchar, + pub sdl_family: ::c_uchar, + pub sdl_index: ::c_ushort, + pub sdl_type: ::c_uchar, + pub sdl_nlen: ::c_uchar, + pub sdl_alen: ::c_uchar, + pub sdl_slen: ::c_uchar, + pub sdl_data: [::c_char; 46], + } + + pub struct mq_attr { + pub mq_flags: ::c_long, + pub mq_maxmsg: ::c_long, + pub mq_msgsize: ::c_long, + pub mq_curmsgs: ::c_long, + __reserved: [::c_long; 4] + } + + pub struct sigevent { + pub sigev_notify: ::c_int, + pub sigev_signo: ::c_int, + pub sigev_value: ::sigval, + //The rest of the structure is actually a union. We expose only + //sigev_notify_thread_id because it's the most useful union member. + pub sigev_notify_thread_id: ::lwpid_t, + #[cfg(target_pointer_width = "64")] + __unused1: ::c_int, + __unused2: [::c_long; 7] + } + + pub struct ptsstat { + #[cfg(any(freebsd12, freebsd13, freebsd14))] + pub dev: u64, + #[cfg(not(any(freebsd12, freebsd13, freebsd14)))] + pub dev: u32, + pub devname: [::c_char; SPECNAMELEN as usize + 1], + } + + #[cfg(libc_union)] + pub union __c_anonymous_elf32_auxv_union { + pub a_val: ::c_int, + } + + pub struct Elf32_Auxinfo { + pub a_type: ::c_int, + #[cfg(libc_union)] + pub a_un: __c_anonymous_elf32_auxv_union, + } + + #[cfg(libc_union)] + pub union __c_anonymous_ifi_epoch { + pub tt: ::time_t, + pub ph: u64, + } + + #[cfg(libc_union)] + pub union __c_anonymous_ifi_lastchange { + pub tv: ::timeval, + pub ph: __c_anonymous_ph, + } + + pub struct if_data { + /// ethernet, tokenring, etc + pub ifi_type: u8, + /// e.g., AUI, Thinnet, 10base-T, etc + pub ifi_physical: u8, + /// media address length + pub ifi_addrlen: u8, + /// media header length + pub ifi_hdrlen: u8, + /// current link state + pub ifi_link_state: u8, + /// carp vhid + pub ifi_vhid: u8, + /// length of this data struct + pub ifi_datalen: u16, + /// maximum transmission unit + pub ifi_mtu: u32, + /// routing metric (external only) + pub ifi_metric: u32, + /// linespeed + pub ifi_baudrate: u64, + /// packets received on interface + pub ifi_ipackets: u64, + /// input errors on interface + pub ifi_ierrors: u64, + /// packets sent on interface + pub ifi_opackets: u64, + /// output errors on interface + pub ifi_oerrors: u64, + /// collisions on csma interfaces + pub ifi_collisions: u64, + /// total number of octets received + pub ifi_ibytes: u64, + /// total number of octets sent + pub ifi_obytes: u64, + /// packets received via multicast + pub ifi_imcasts: u64, + /// packets sent via multicast + pub ifi_omcasts: u64, + /// dropped on input + pub ifi_iqdrops: u64, + /// dropped on output + pub ifi_oqdrops: u64, + /// destined for unsupported protocol + pub ifi_noproto: u64, + /// HW offload capabilities, see IFCAP + pub ifi_hwassist: u64, + /// uptime at attach or stat reset + #[cfg(libc_union)] + pub __ifi_epoch: __c_anonymous_ifi_epoch, + /// uptime at attach or stat reset + #[cfg(not(libc_union))] + pub __ifi_epoch: u64, + /// time of last administrative change + #[cfg(libc_union)] + pub __ifi_lastchange: __c_anonymous_ifi_lastchange, + /// time of last administrative change + #[cfg(not(libc_union))] + pub __ifi_lastchange: ::timeval, + } + + #[cfg(libc_union)] + pub union __c_anonymous_ifr_ifru { + pub ifru_addr: ::sockaddr, + pub ifru_dstaddr: ::sockaddr, + pub ifru_broadaddr: ::sockaddr, + pub ifru_buffer: ifreq_buffer, + pub ifru_flags: [::c_short; 2], + pub ifru_index: ::c_short, + pub ifru_jid: ::c_int, + pub ifru_metric: ::c_int, + pub ifru_mtu: ::c_int, + pub ifru_phys: ::c_int, + pub ifru_media: ::c_int, + pub ifru_data: ::caddr_t, + pub ifru_cap: [::c_int; 2], + pub ifru_fib: ::c_uint, + pub ifru_vlan_pcp: ::c_uchar, + } + + pub struct ifreq { + /// if name, e.g. "en0" + pub ifr_name: [::c_char; ::IFNAMSIZ], + #[cfg(libc_union)] + pub ifr_ifru: __c_anonymous_ifr_ifru, + #[cfg(not(libc_union))] + pub ifr_ifru: ::sockaddr, + } + + #[cfg(libc_union)] + pub union __c_anonymous_ifc_ifcu { + pub ifcu_buf: ::caddr_t, + pub ifcu_req: *mut ifreq, + } + + pub struct ifstat { + /// if name, e.g. "en0" + pub ifs_name: [::c_char; ::IFNAMSIZ as usize], + pub ascii: [::c_char; ::IFSTATMAX as usize + 1], + } + + pub struct ifrsskey { + /// if name, e.g. "en0" + pub ifrk_name: [::c_char; ::IFNAMSIZ as usize], + /// RSS_FUNC_ + pub ifrk_func: u8, + pub ifrk_spare0: u8, + pub ifrk_keylen: u16, + pub ifrk_key: [u8; ::RSS_KEYLEN as usize], + } + + pub struct ifdownreason { + pub ifdr_name: [::c_char; ::IFNAMSIZ as usize], + pub ifdr_reason: u32, + pub ifdr_vendor: u32, + pub ifdr_msg: [::c_char; ::IFDR_MSG_SIZE as usize], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for utmpx { + fn eq(&self, other: &utmpx) -> bool { + self.ut_type == other.ut_type + && self.ut_tv == other.ut_tv + && self.ut_id == other.ut_id + && self.ut_pid == other.ut_pid + && self.ut_user == other.ut_user + && self.ut_line == other.ut_line + && self + .ut_host + .iter() + .zip(other.ut_host.iter()) + .all(|(a,b)| a == b) + && self + .__ut_spare + .iter() + .zip(other.__ut_spare.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for utmpx {} + impl ::fmt::Debug for utmpx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmpx") + .field("ut_type", &self.ut_type) + .field("ut_tv", &self.ut_tv) + .field("ut_id", &self.ut_id) + .field("ut_pid", &self.ut_pid) + .field("ut_user", &self.ut_user) + .field("ut_line", &self.ut_line) + // FIXME: .field("ut_host", &self.ut_host) + // FIXME: .field("__ut_spare", &self.__ut_spare) + .finish() + } + } + impl ::hash::Hash for utmpx { + fn hash(&self, state: &mut H) { + self.ut_type.hash(state); + self.ut_tv.hash(state); + self.ut_id.hash(state); + self.ut_pid.hash(state); + self.ut_user.hash(state); + self.ut_line.hash(state); + self.ut_host.hash(state); + self.__ut_spare.hash(state); + } + } + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_cr_pid { + fn eq(&self, other: &__c_anonymous_cr_pid) -> bool { + unsafe { self.cr_pid == other.cr_pid} + } + } + #[cfg(libc_union)] + impl Eq for __c_anonymous_cr_pid {} + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_cr_pid { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("cr_pid") + .field("cr_pid", unsafe { &self.cr_pid }) + .finish() + } + } + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_cr_pid { + fn hash(&self, state: &mut H) { + unsafe { self.cr_pid.hash(state) }; + } + } + + impl PartialEq for xucred { + fn eq(&self, other: &xucred) -> bool { + #[cfg(libc_union)] + let equal_cr_pid = self.cr_pid__c_anonymous_union + == other.cr_pid__c_anonymous_union; + #[cfg(not(libc_union))] + let equal_cr_pid = self.__cr_unused1 == other.__cr_unused1; + + self.cr_version == other.cr_version + && self.cr_uid == other.cr_uid + && self.cr_ngroups == other.cr_ngroups + && self.cr_groups == other.cr_groups + && equal_cr_pid + } + } + impl Eq for xucred {} + impl ::fmt::Debug for xucred { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let mut struct_formatter = f.debug_struct("xucred"); + struct_formatter.field("cr_version", &self.cr_version); + struct_formatter.field("cr_uid", &self.cr_uid); + struct_formatter.field("cr_ngroups", &self.cr_ngroups); + struct_formatter.field("cr_groups", &self.cr_groups); + #[cfg(libc_union)] + struct_formatter.field( + "cr_pid__c_anonymous_union", + &self.cr_pid__c_anonymous_union + ); + struct_formatter.finish() + } + } + impl ::hash::Hash for xucred { + fn hash(&self, state: &mut H) { + self.cr_version.hash(state); + self.cr_uid.hash(state); + self.cr_ngroups.hash(state); + self.cr_groups.hash(state); + #[cfg(libc_union)] + self.cr_pid__c_anonymous_union.hash(state); + #[cfg(not(libc_union))] + self.__cr_unused1.hash(state); + } + } + + impl PartialEq for sockaddr_dl { + fn eq(&self, other: &sockaddr_dl) -> bool { + self.sdl_len == other.sdl_len + && self.sdl_family == other.sdl_family + && self.sdl_index == other.sdl_index + && self.sdl_type == other.sdl_type + && self.sdl_nlen == other.sdl_nlen + && self.sdl_alen == other.sdl_alen + && self.sdl_slen == other.sdl_slen + && self + .sdl_data + .iter() + .zip(other.sdl_data.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sockaddr_dl {} + impl ::fmt::Debug for sockaddr_dl { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_dl") + .field("sdl_len", &self.sdl_len) + .field("sdl_family", &self.sdl_family) + .field("sdl_index", &self.sdl_index) + .field("sdl_type", &self.sdl_type) + .field("sdl_nlen", &self.sdl_nlen) + .field("sdl_alen", &self.sdl_alen) + .field("sdl_slen", &self.sdl_slen) + // FIXME: .field("sdl_data", &self.sdl_data) + .finish() + } + } + impl ::hash::Hash for sockaddr_dl { + fn hash(&self, state: &mut H) { + self.sdl_len.hash(state); + self.sdl_family.hash(state); + self.sdl_index.hash(state); + self.sdl_type.hash(state); + self.sdl_nlen.hash(state); + self.sdl_alen.hash(state); + self.sdl_slen.hash(state); + self.sdl_data.hash(state); + } + } + + impl PartialEq for mq_attr { + fn eq(&self, other: &mq_attr) -> bool { + self.mq_flags == other.mq_flags && + self.mq_maxmsg == other.mq_maxmsg && + self.mq_msgsize == other.mq_msgsize && + self.mq_curmsgs == other.mq_curmsgs + } + } + impl Eq for mq_attr {} + impl ::fmt::Debug for mq_attr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mq_attr") + .field("mq_flags", &self.mq_flags) + .field("mq_maxmsg", &self.mq_maxmsg) + .field("mq_msgsize", &self.mq_msgsize) + .field("mq_curmsgs", &self.mq_curmsgs) + .finish() + } + } + impl ::hash::Hash for mq_attr { + fn hash(&self, state: &mut H) { + self.mq_flags.hash(state); + self.mq_maxmsg.hash(state); + self.mq_msgsize.hash(state); + self.mq_curmsgs.hash(state); + } + } + + impl PartialEq for sigevent { + fn eq(&self, other: &sigevent) -> bool { + self.sigev_notify == other.sigev_notify + && self.sigev_signo == other.sigev_signo + && self.sigev_value == other.sigev_value + && self.sigev_notify_thread_id + == other.sigev_notify_thread_id + } + } + impl Eq for sigevent {} + impl ::fmt::Debug for sigevent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigevent") + .field("sigev_notify", &self.sigev_notify) + .field("sigev_signo", &self.sigev_signo) + .field("sigev_value", &self.sigev_value) + .field("sigev_notify_thread_id", + &self.sigev_notify_thread_id) + .finish() + } + } + impl ::hash::Hash for sigevent { + fn hash(&self, state: &mut H) { + self.sigev_notify.hash(state); + self.sigev_signo.hash(state); + self.sigev_value.hash(state); + self.sigev_notify_thread_id.hash(state); + } + } + + impl PartialEq for ptsstat { + fn eq(&self, other: &ptsstat) -> bool { + let self_devname: &[::c_char] = &self.devname; + let other_devname: &[::c_char] = &other.devname; + + self.dev == other.dev && self_devname == other_devname + } + } + impl Eq for ptsstat {} + impl ::fmt::Debug for ptsstat { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let self_devname: &[::c_char] = &self.devname; + + f.debug_struct("ptsstat") + .field("dev", &self.dev) + .field("devname", &self_devname) + .finish() + } + } + impl ::hash::Hash for ptsstat { + fn hash(&self, state: &mut H) { + let self_devname: &[::c_char] = &self.devname; + + self.dev.hash(state); + self_devname.hash(state); + } + } + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_elf32_auxv_union { + fn eq(&self, other: &__c_anonymous_elf32_auxv_union) -> bool { + unsafe { self.a_val == other.a_val} + } + } + #[cfg(libc_union)] + impl Eq for __c_anonymous_elf32_auxv_union {} + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_elf32_auxv_union { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("a_val") + .field("a_val", unsafe { &self.a_val }) + .finish() + } + } + #[cfg(not(libc_union))] + impl PartialEq for Elf32_Auxinfo { + fn eq(&self, other: &Elf32_Auxinfo) -> bool { + self.a_type == other.a_type + } + } + #[cfg(libc_union)] + impl PartialEq for Elf32_Auxinfo { + fn eq(&self, other: &Elf32_Auxinfo) -> bool { + self.a_type == other.a_type + && self.a_un == other.a_un + } + } + impl Eq for Elf32_Auxinfo {} + #[cfg(not(libc_union))] + impl ::fmt::Debug for Elf32_Auxinfo { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("Elf32_Auxinfo") + .field("a_type", &self.a_type) + .finish() + } + } + #[cfg(libc_union)] + impl ::fmt::Debug for Elf32_Auxinfo { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("Elf32_Auxinfo") + .field("a_type", &self.a_type) + .field("a_un", &self.a_un) + .finish() + } + } + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_ifr_ifru { + fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool { + unsafe { + self.ifru_addr == other.ifru_addr && + self.ifru_dstaddr == other.ifru_dstaddr && + self.ifru_broadaddr == other.ifru_broadaddr && + self.ifru_buffer == other.ifru_buffer && + self.ifru_flags == other.ifru_flags && + self.ifru_index == other.ifru_index && + self.ifru_jid == other.ifru_jid && + self.ifru_metric == other.ifru_metric && + self.ifru_mtu == other.ifru_mtu && + self.ifru_phys == other.ifru_phys && + self.ifru_media == other.ifru_media && + self.ifru_data == other.ifru_data && + self.ifru_cap == other.ifru_cap && + self.ifru_fib == other.ifru_fib && + self.ifru_vlan_pcp == other.ifru_vlan_pcp + } + } + } + #[cfg(libc_union)] + impl Eq for __c_anonymous_ifr_ifru {} + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ifr_ifru { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifr_ifru") + .field("ifru_addr", unsafe { &self.ifru_addr }) + .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr }) + .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr }) + .field("ifru_buffer", unsafe { &self.ifru_buffer }) + .field("ifru_flags", unsafe { &self.ifru_flags }) + .field("ifru_index", unsafe { &self.ifru_index }) + .field("ifru_jid", unsafe { &self.ifru_jid }) + .field("ifru_metric", unsafe { &self.ifru_metric }) + .field("ifru_mtu", unsafe { &self.ifru_mtu }) + .field("ifru_phys", unsafe { &self.ifru_phys }) + .field("ifru_media", unsafe { &self.ifru_media }) + .field("ifru_data", unsafe { &self.ifru_data }) + .field("ifru_cap", unsafe { &self.ifru_cap }) + .field("ifru_fib", unsafe { &self.ifru_fib }) + .field("ifru_vlan_pcp", unsafe { &self.ifru_vlan_pcp }) + .finish() + } + } + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_ifr_ifru { + fn hash(&self, state: &mut H) { + unsafe { self.ifru_addr.hash(state) }; + unsafe { self.ifru_dstaddr.hash(state) }; + unsafe { self.ifru_broadaddr.hash(state) }; + unsafe { self.ifru_buffer.hash(state) }; + unsafe { self.ifru_flags.hash(state) }; + unsafe { self.ifru_index.hash(state) }; + unsafe { self.ifru_jid.hash(state) }; + unsafe { self.ifru_metric.hash(state) }; + unsafe { self.ifru_mtu.hash(state) }; + unsafe { self.ifru_phys.hash(state) }; + unsafe { self.ifru_media.hash(state) }; + unsafe { self.ifru_data.hash(state) }; + unsafe { self.ifru_cap.hash(state) }; + unsafe { self.ifru_fib.hash(state) }; + unsafe { self.ifru_vlan_pcp.hash(state) }; + } + } + + impl PartialEq for ifreq { + fn eq(&self, other: &ifreq) -> bool { + self.ifr_name == other.ifr_name && self.ifr_ifru == other.ifr_ifru + } + } + impl Eq for ifreq {} + impl ::fmt::Debug for ifreq { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifreq") + .field("ifr_name", &self.ifr_name) + .field("ifr_ifru", &self.ifr_ifru) + .finish() + } + } + impl ::hash::Hash for ifreq { + fn hash(&self, state: &mut H) { + self.ifr_name.hash(state); + self.ifr_ifru.hash(state); + } + } + + #[cfg(libc_union)] + impl Eq for __c_anonymous_ifc_ifcu {} + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_ifc_ifcu { + fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool { + unsafe { + self.ifcu_buf == other.ifcu_buf && + self.ifcu_req == other.ifcu_req + } + } + } + + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ifc_ifcu { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifc_ifcu") + .field("ifcu_buf", unsafe { &self.ifcu_buf }) + .field("ifcu_req", unsafe { &self.ifcu_req }) + .finish() + } + } + + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_ifc_ifcu { + fn hash(&self, state: &mut H) { + unsafe { self.ifcu_buf.hash(state) }; + unsafe { self.ifcu_req.hash(state) }; + } + } + + impl PartialEq for ifstat { + fn eq(&self, other: &ifstat) -> bool { + let self_ascii: &[::c_char] = &self.ascii; + let other_ascii: &[::c_char] = &other.ascii; + + self.ifs_name == other.ifs_name && self_ascii == other_ascii + } + } + impl Eq for ifstat {} + impl ::fmt::Debug for ifstat { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let ascii: &[::c_char] = &self.ascii; + + f.debug_struct("ifstat") + .field("ifs_name", &self.ifs_name) + .field("ascii", &ascii) + .finish() + } + } + impl ::hash::Hash for ifstat { + fn hash(&self, state: &mut H) { + self.ifs_name.hash(state); + self.ascii.hash(state); + } + } + + impl PartialEq for ifrsskey { + fn eq(&self, other: &ifrsskey) -> bool { + let self_ifrk_key: &[u8] = &self.ifrk_key; + let other_ifrk_key: &[u8] = &other.ifrk_key; + + self.ifrk_name == other.ifrk_name && + self.ifrk_func == other.ifrk_func && + self.ifrk_spare0 == other.ifrk_spare0 && + self.ifrk_keylen == other.ifrk_keylen && + self_ifrk_key == other_ifrk_key + } + } + impl Eq for ifrsskey {} + impl ::fmt::Debug for ifrsskey { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let ifrk_key: &[u8] = &self.ifrk_key; + + f.debug_struct("ifrsskey") + .field("ifrk_name", &self.ifrk_name) + .field("ifrk_func", &self.ifrk_func) + .field("ifrk_spare0", &self.ifrk_spare0) + .field("ifrk_keylen", &self.ifrk_keylen) + .field("ifrk_key", &ifrk_key) + .finish() + } + } + impl ::hash::Hash for ifrsskey { + fn hash(&self, state: &mut H) { + self.ifrk_name.hash(state); + self.ifrk_func.hash(state); + self.ifrk_spare0.hash(state); + self.ifrk_keylen.hash(state); + self.ifrk_key.hash(state); + } + } + + impl PartialEq for ifdownreason { + fn eq(&self, other: &ifdownreason) -> bool { + let self_ifdr_msg: &[::c_char] = &self.ifdr_msg; + let other_ifdr_msg: &[::c_char] = &other.ifdr_msg; + + self.ifdr_name == other.ifdr_name && + self.ifdr_reason == other.ifdr_reason && + self.ifdr_vendor == other.ifdr_vendor && + self_ifdr_msg == other_ifdr_msg + } + } + impl Eq for ifdownreason {} + impl ::fmt::Debug for ifdownreason { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let ifdr_msg: &[::c_char] = &self.ifdr_msg; + + f.debug_struct("ifdownreason") + .field("ifdr_name", &self.ifdr_name) + .field("ifdr_reason", &self.ifdr_reason) + .field("ifdr_vendor", &self.ifdr_vendor) + .field("ifdr_msg", &ifdr_msg) + .finish() + } + } + impl ::hash::Hash for ifdownreason { + fn hash(&self, state: &mut H) { + self.ifdr_name.hash(state); + self.ifdr_reason.hash(state); + self.ifdr_vendor.hash(state); + self.ifdr_msg.hash(state); + } + } + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_ifi_epoch { + fn eq(&self, other: &__c_anonymous_ifi_epoch) -> bool { + unsafe { + self.tt == other.tt && + self.ph == other.ph + } + } + } + #[cfg(libc_union)] + impl Eq for __c_anonymous_ifi_epoch {} + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ifi_epoch { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("__c_anonymous_ifi_epoch") + .field("tt", unsafe { &self.tt }) + .field("ph", unsafe { &self.ph }) + .finish() + } + } + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_ifi_epoch { + fn hash(&self, state: &mut H) { + unsafe { + self.tt.hash(state); + self.ph.hash(state); + } + } + } + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_ifi_lastchange { + fn eq(&self, other: &__c_anonymous_ifi_lastchange) -> bool { + unsafe { + self.tv == other.tv && + self.ph == other.ph + } + } + } + #[cfg(libc_union)] + impl Eq for __c_anonymous_ifi_lastchange {} + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ifi_lastchange { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("__c_anonymous_ifi_lastchange") + .field("tv", unsafe { &self.tv }) + .field("ph", unsafe { &self.ph }) + .finish() + } + } + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_ifi_lastchange { + fn hash(&self, state: &mut H) { + unsafe { + self.tv.hash(state); + self.ph.hash(state); + } + } + } + + impl PartialEq for if_data { + fn eq(&self, other: &if_data) -> bool { + self.ifi_type == other.ifi_type && + self.ifi_physical == other.ifi_physical && + self.ifi_addrlen == other.ifi_addrlen && + self.ifi_hdrlen == other.ifi_hdrlen && + self.ifi_link_state == other.ifi_link_state && + self.ifi_vhid == other.ifi_vhid && + self.ifi_datalen == other.ifi_datalen && + self.ifi_mtu == other.ifi_mtu && + self.ifi_metric == other.ifi_metric && + self.ifi_baudrate == other.ifi_baudrate && + self.ifi_ipackets == other.ifi_ipackets && + self.ifi_ierrors == other.ifi_ierrors && + self.ifi_opackets == other.ifi_opackets && + self.ifi_oerrors == other.ifi_oerrors && + self.ifi_collisions == other.ifi_collisions && + self.ifi_ibytes == other.ifi_ibytes && + self.ifi_obytes == other.ifi_obytes && + self.ifi_imcasts == other.ifi_imcasts && + self.ifi_omcasts == other.ifi_omcasts && + self.ifi_iqdrops == other.ifi_iqdrops && + self.ifi_oqdrops == other.ifi_oqdrops && + self.ifi_noproto == other.ifi_noproto && + self.ifi_hwassist == other.ifi_hwassist && + self.__ifi_epoch == other.__ifi_epoch && + self.__ifi_lastchange == other.__ifi_lastchange + } + } + impl Eq for if_data {} + impl ::fmt::Debug for if_data { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("if_data") + .field("ifi_type", &self.ifi_type) + .field("ifi_physical", &self.ifi_physical) + .field("ifi_addrlen", &self.ifi_addrlen) + .field("ifi_hdrlen", &self.ifi_hdrlen) + .field("ifi_link_state", &self.ifi_link_state) + .field("ifi_vhid", &self.ifi_vhid) + .field("ifi_datalen", &self.ifi_datalen) + .field("ifi_mtu", &self.ifi_mtu) + .field("ifi_metric", &self.ifi_metric) + .field("ifi_baudrate", &self.ifi_baudrate) + .field("ifi_ipackets", &self.ifi_ipackets) + .field("ifi_ierrors", &self.ifi_ierrors) + .field("ifi_opackets", &self.ifi_opackets) + .field("ifi_oerrors", &self.ifi_oerrors) + .field("ifi_collisions", &self.ifi_collisions) + .field("ifi_ibytes", &self.ifi_ibytes) + .field("ifi_obytes", &self.ifi_obytes) + .field("ifi_imcasts", &self.ifi_imcasts) + .field("ifi_omcasts", &self.ifi_omcasts) + .field("ifi_iqdrops", &self.ifi_iqdrops) + .field("ifi_oqdrops", &self.ifi_oqdrops) + .field("ifi_noproto", &self.ifi_noproto) + .field("ifi_hwassist", &self.ifi_hwassist) + .field("__ifi_epoch", &self.__ifi_epoch) + .field("__ifi_lastchange", &self.__ifi_lastchange) + .finish() + } + } + impl ::hash::Hash for if_data { + fn hash(&self, state: &mut H) { + self.ifi_type.hash(state); + self.ifi_physical.hash(state); + self.ifi_addrlen.hash(state); + self.ifi_hdrlen.hash(state); + self.ifi_link_state.hash(state); + self.ifi_vhid.hash(state); + self.ifi_datalen.hash(state); + self.ifi_mtu.hash(state); + self.ifi_metric.hash(state); + self.ifi_baudrate.hash(state); + self.ifi_ipackets.hash(state); + self.ifi_ierrors.hash(state); + self.ifi_opackets.hash(state); + self.ifi_oerrors.hash(state); + self.ifi_collisions.hash(state); + self.ifi_ibytes.hash(state); + self.ifi_obytes.hash(state); + self.ifi_imcasts.hash(state); + self.ifi_omcasts.hash(state); + self.ifi_iqdrops.hash(state); + self.ifi_oqdrops.hash(state); + self.ifi_noproto.hash(state); + self.ifi_hwassist.hash(state); + self.__ifi_epoch.hash(state); + self.__ifi_lastchange.hash(state); + } + } + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +#[repr(u32)] +pub enum dot3Vendors { + dot3VendorAMD = 1, + dot3VendorIntel = 2, + dot3VendorNational = 4, + dot3VendorFujitsu = 5, + dot3VendorDigital = 6, + dot3VendorWesternDigital = 7, +} +impl ::Copy for dot3Vendors {} +impl ::Clone for dot3Vendors { + fn clone(&self) -> dot3Vendors { + *self + } +} + +// aio.h +pub const LIO_VECTORED: ::c_int = 4; +pub const LIO_WRITEV: ::c_int = 5; +pub const LIO_READV: ::c_int = 6; + +// sys/devicestat.h +pub const DEVSTAT_N_TRANS_FLAGS: ::c_int = 4; +pub const DEVSTAT_NAME_LEN: ::c_int = 16; + +pub const SIGEV_THREAD_ID: ::c_int = 4; + +pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0; +pub const EXTATTR_NAMESPACE_USER: ::c_int = 1; +pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2; + +pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ; +pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4; +pub const PTHREAD_MUTEX_STALLED: ::c_int = 0; +pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1; +pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768; +pub const SF_NODISKIO: ::c_int = 0x00000001; +pub const SF_MNOWAIT: ::c_int = 0x00000002; +pub const SF_SYNC: ::c_int = 0x00000004; +pub const SF_USER_READAHEAD: ::c_int = 0x00000008; +pub const SF_NOCACHE: ::c_int = 0x00000010; +pub const O_CLOEXEC: ::c_int = 0x00100000; +pub const O_DIRECTORY: ::c_int = 0x00020000; +pub const O_EXEC: ::c_int = 0x00040000; +pub const O_TTY_INIT: ::c_int = 0x00080000; +pub const F_GETLK: ::c_int = 11; +pub const F_SETLK: ::c_int = 12; +pub const F_SETLKW: ::c_int = 13; +pub const ENOTCAPABLE: ::c_int = 93; +pub const ECAPMODE: ::c_int = 94; +pub const ENOTRECOVERABLE: ::c_int = 95; +pub const EOWNERDEAD: ::c_int = 96; +pub const EINTEGRITY: ::c_int = 97; +pub const RLIMIT_NPTS: ::c_int = 11; +pub const RLIMIT_SWAP: ::c_int = 12; +pub const RLIMIT_KQUEUES: ::c_int = 13; +pub const RLIMIT_UMTXP: ::c_int = 14; +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] +pub const RLIM_NLIMITS: ::rlim_t = 15; +pub const RLIM_SAVED_MAX: ::rlim_t = ::RLIM_INFINITY; +pub const RLIM_SAVED_CUR: ::rlim_t = ::RLIM_INFINITY; + +pub const CP_USER: ::c_int = 0; +pub const CP_NICE: ::c_int = 1; +pub const CP_SYS: ::c_int = 2; +pub const CP_INTR: ::c_int = 3; +pub const CP_IDLE: ::c_int = 4; +pub const CPUSTATES: ::c_int = 5; + +pub const NI_NOFQDN: ::c_int = 0x00000001; +pub const NI_NUMERICHOST: ::c_int = 0x00000002; +pub const NI_NAMEREQD: ::c_int = 0x00000004; +pub const NI_NUMERICSERV: ::c_int = 0x00000008; +pub const NI_DGRAM: ::c_int = 0x00000010; +pub const NI_NUMERICSCOPE: ::c_int = 0x00000020; + +pub const XU_NGROUPS: ::c_int = 16; + +pub const Q_GETQUOTA: ::c_int = 0x700; +pub const Q_SETQUOTA: ::c_int = 0x800; + +pub const MAP_GUARD: ::c_int = 0x00002000; +pub const MAP_EXCL: ::c_int = 0x00004000; +pub const MAP_PREFAULT_READ: ::c_int = 0x00040000; +pub const MAP_ALIGNED_SUPER: ::c_int = 1 << 24; + +pub const POSIX_FADV_NORMAL: ::c_int = 0; +pub const POSIX_FADV_RANDOM: ::c_int = 1; +pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_FADV_WILLNEED: ::c_int = 3; +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +pub const POLLINIGNEOF: ::c_short = 0x2000; + +pub const EVFILT_READ: i16 = -1; +pub const EVFILT_WRITE: i16 = -2; +pub const EVFILT_AIO: i16 = -3; +pub const EVFILT_VNODE: i16 = -4; +pub const EVFILT_PROC: i16 = -5; +pub const EVFILT_SIGNAL: i16 = -6; +pub const EVFILT_TIMER: i16 = -7; +pub const EVFILT_PROCDESC: i16 = -8; +pub const EVFILT_FS: i16 = -9; +pub const EVFILT_LIO: i16 = -10; +pub const EVFILT_USER: i16 = -11; +pub const EVFILT_SENDFILE: i16 = -12; +pub const EVFILT_EMPTY: i16 = -13; + +pub const EV_ADD: u16 = 0x1; +pub const EV_DELETE: u16 = 0x2; +pub const EV_ENABLE: u16 = 0x4; +pub const EV_DISABLE: u16 = 0x8; +pub const EV_ONESHOT: u16 = 0x10; +pub const EV_CLEAR: u16 = 0x20; +pub const EV_RECEIPT: u16 = 0x40; +pub const EV_DISPATCH: u16 = 0x80; +pub const EV_DROP: u16 = 0x1000; +pub const EV_FLAG1: u16 = 0x2000; +pub const EV_ERROR: u16 = 0x4000; +pub const EV_EOF: u16 = 0x8000; +pub const EV_SYSFLAGS: u16 = 0xf000; + +pub const NOTE_TRIGGER: u32 = 0x01000000; +pub const NOTE_FFNOP: u32 = 0x00000000; +pub const NOTE_FFAND: u32 = 0x40000000; +pub const NOTE_FFOR: u32 = 0x80000000; +pub const NOTE_FFCOPY: u32 = 0xc0000000; +pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; +pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; +pub const NOTE_LOWAT: u32 = 0x00000001; +pub const NOTE_DELETE: u32 = 0x00000001; +pub const NOTE_WRITE: u32 = 0x00000002; +pub const NOTE_EXTEND: u32 = 0x00000004; +pub const NOTE_ATTRIB: u32 = 0x00000008; +pub const NOTE_LINK: u32 = 0x00000010; +pub const NOTE_RENAME: u32 = 0x00000020; +pub const NOTE_REVOKE: u32 = 0x00000040; +pub const NOTE_EXIT: u32 = 0x80000000; +pub const NOTE_FORK: u32 = 0x40000000; +pub const NOTE_EXEC: u32 = 0x20000000; +pub const NOTE_PDATAMASK: u32 = 0x000fffff; +pub const NOTE_PCTRLMASK: u32 = 0xf0000000; +pub const NOTE_TRACK: u32 = 0x00000001; +pub const NOTE_TRACKERR: u32 = 0x00000002; +pub const NOTE_CHILD: u32 = 0x00000004; +pub const NOTE_SECONDS: u32 = 0x00000001; +pub const NOTE_MSECONDS: u32 = 0x00000002; +pub const NOTE_USECONDS: u32 = 0x00000004; +pub const NOTE_NSECONDS: u32 = 0x00000008; + +pub const MADV_PROTECT: ::c_int = 10; + +#[doc(hidden)] +#[deprecated( + since = "0.2.72", + note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead" +)] +pub const CTL_UNSPEC: ::c_int = 0; +pub const CTL_SYSCTL: ::c_int = 0; +pub const CTL_KERN: ::c_int = 1; +pub const CTL_VM: ::c_int = 2; +pub const CTL_VFS: ::c_int = 3; +pub const CTL_NET: ::c_int = 4; +pub const CTL_DEBUG: ::c_int = 5; +pub const CTL_HW: ::c_int = 6; +pub const CTL_MACHDEP: ::c_int = 7; +pub const CTL_USER: ::c_int = 8; +pub const CTL_P1003_1B: ::c_int = 9; + +// sys/sysctl.h +pub const CTL_MAXNAME: ::c_int = 24; + +pub const CTLTYPE: ::c_int = 0xf; +pub const CTLTYPE_NODE: ::c_int = 1; +pub const CTLTYPE_INT: ::c_int = 2; +pub const CTLTYPE_STRING: ::c_int = 3; +pub const CTLTYPE_S64: ::c_int = 4; +pub const CTLTYPE_OPAQUE: ::c_int = 5; +pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE; +pub const CTLTYPE_UINT: ::c_int = 6; +pub const CTLTYPE_LONG: ::c_int = 7; +pub const CTLTYPE_ULONG: ::c_int = 8; +pub const CTLTYPE_U64: ::c_int = 9; +pub const CTLTYPE_U8: ::c_int = 0xa; +pub const CTLTYPE_U16: ::c_int = 0xb; +pub const CTLTYPE_S8: ::c_int = 0xc; +pub const CTLTYPE_S16: ::c_int = 0xd; +pub const CTLTYPE_S32: ::c_int = 0xe; +pub const CTLTYPE_U32: ::c_int = 0xf; + +pub const CTLFLAG_RD: ::c_int = 0x80000000; +pub const CTLFLAG_WR: ::c_int = 0x40000000; +pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR; +pub const CTLFLAG_DORMANT: ::c_int = 0x20000000; +pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000; +pub const CTLFLAG_SECURE: ::c_int = 0x08000000; +pub const CTLFLAG_PRISON: ::c_int = 0x04000000; +pub const CTLFLAG_DYN: ::c_int = 0x02000000; +pub const CTLFLAG_SKIP: ::c_int = 0x01000000; +pub const CTLMASK_SECURE: ::c_int = 0x00F00000; +pub const CTLFLAG_TUN: ::c_int = 0x00080000; +pub const CTLFLAG_RDTUN: ::c_int = CTLFLAG_RD | CTLFLAG_TUN; +pub const CTLFLAG_RWTUN: ::c_int = CTLFLAG_RW | CTLFLAG_TUN; +pub const CTLFLAG_MPSAFE: ::c_int = 0x00040000; +pub const CTLFLAG_VNET: ::c_int = 0x00020000; +pub const CTLFLAG_DYING: ::c_int = 0x00010000; +pub const CTLFLAG_CAPRD: ::c_int = 0x00008000; +pub const CTLFLAG_CAPWR: ::c_int = 0x00004000; +pub const CTLFLAG_STATS: ::c_int = 0x00002000; +pub const CTLFLAG_NOFETCH: ::c_int = 0x00001000; +pub const CTLFLAG_CAPRW: ::c_int = CTLFLAG_CAPRD | CTLFLAG_CAPWR; +pub const CTLFLAG_NEEDGIANT: ::c_int = 0x00000800; + +pub const CTLSHIFT_SECURE: ::c_int = 20; +pub const CTLFLAG_SECURE1: ::c_int = CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE); +pub const CTLFLAG_SECURE2: ::c_int = CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE); +pub const CTLFLAG_SECURE3: ::c_int = CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE); + +pub const OID_AUTO: ::c_int = -1; + +pub const CTL_SYSCTL_DEBUG: ::c_int = 0; +pub const CTL_SYSCTL_NAME: ::c_int = 1; +pub const CTL_SYSCTL_NEXT: ::c_int = 2; +pub const CTL_SYSCTL_NAME2OID: ::c_int = 3; +pub const CTL_SYSCTL_OIDFMT: ::c_int = 4; +pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5; +pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6; +pub const CTL_SYSCTL_NEXTNOSKIP: ::c_int = 7; + +pub const KERN_OSTYPE: ::c_int = 1; +pub const KERN_OSRELEASE: ::c_int = 2; +pub const KERN_OSREV: ::c_int = 3; +pub const KERN_VERSION: ::c_int = 4; +pub const KERN_MAXVNODES: ::c_int = 5; +pub const KERN_MAXPROC: ::c_int = 6; +pub const KERN_MAXFILES: ::c_int = 7; +pub const KERN_ARGMAX: ::c_int = 8; +pub const KERN_SECURELVL: ::c_int = 9; +pub const KERN_HOSTNAME: ::c_int = 10; +pub const KERN_HOSTID: ::c_int = 11; +pub const KERN_CLOCKRATE: ::c_int = 12; +pub const KERN_VNODE: ::c_int = 13; +pub const KERN_PROC: ::c_int = 14; +pub const KERN_FILE: ::c_int = 15; +pub const KERN_PROF: ::c_int = 16; +pub const KERN_POSIX1: ::c_int = 17; +pub const KERN_NGROUPS: ::c_int = 18; +pub const KERN_JOB_CONTROL: ::c_int = 19; +pub const KERN_SAVED_IDS: ::c_int = 20; +pub const KERN_BOOTTIME: ::c_int = 21; +pub const KERN_NISDOMAINNAME: ::c_int = 22; +pub const KERN_UPDATEINTERVAL: ::c_int = 23; +pub const KERN_OSRELDATE: ::c_int = 24; +pub const KERN_NTP_PLL: ::c_int = 25; +pub const KERN_BOOTFILE: ::c_int = 26; +pub const KERN_MAXFILESPERPROC: ::c_int = 27; +pub const KERN_MAXPROCPERUID: ::c_int = 28; +pub const KERN_DUMPDEV: ::c_int = 29; +pub const KERN_IPC: ::c_int = 30; +pub const KERN_DUMMY: ::c_int = 31; +pub const KERN_PS_STRINGS: ::c_int = 32; +pub const KERN_USRSTACK: ::c_int = 33; +pub const KERN_LOGSIGEXIT: ::c_int = 34; +pub const KERN_IOV_MAX: ::c_int = 35; +pub const KERN_HOSTUUID: ::c_int = 36; +pub const KERN_ARND: ::c_int = 37; +pub const KERN_MAXPHYS: ::c_int = 38; + +pub const KERN_PROC_ALL: ::c_int = 0; +pub const KERN_PROC_PID: ::c_int = 1; +pub const KERN_PROC_PGRP: ::c_int = 2; +pub const KERN_PROC_SESSION: ::c_int = 3; +pub const KERN_PROC_TTY: ::c_int = 4; +pub const KERN_PROC_UID: ::c_int = 5; +pub const KERN_PROC_RUID: ::c_int = 6; +pub const KERN_PROC_ARGS: ::c_int = 7; +pub const KERN_PROC_PROC: ::c_int = 8; +pub const KERN_PROC_SV_NAME: ::c_int = 9; +pub const KERN_PROC_RGID: ::c_int = 10; +pub const KERN_PROC_GID: ::c_int = 11; +pub const KERN_PROC_PATHNAME: ::c_int = 12; +pub const KERN_PROC_OVMMAP: ::c_int = 13; +pub const KERN_PROC_OFILEDESC: ::c_int = 14; +pub const KERN_PROC_KSTACK: ::c_int = 15; +pub const KERN_PROC_INC_THREAD: ::c_int = 0x10; +pub const KERN_PROC_VMMAP: ::c_int = 32; +pub const KERN_PROC_FILEDESC: ::c_int = 33; +pub const KERN_PROC_GROUPS: ::c_int = 34; +pub const KERN_PROC_ENV: ::c_int = 35; +pub const KERN_PROC_AUXV: ::c_int = 36; +pub const KERN_PROC_RLIMIT: ::c_int = 37; +pub const KERN_PROC_PS_STRINGS: ::c_int = 38; +pub const KERN_PROC_UMASK: ::c_int = 39; +pub const KERN_PROC_OSREL: ::c_int = 40; +pub const KERN_PROC_SIGTRAMP: ::c_int = 41; +pub const KERN_PROC_CWD: ::c_int = 42; +pub const KERN_PROC_NFDS: ::c_int = 43; +pub const KERN_PROC_SIGFASTBLK: ::c_int = 44; + +pub const KIPC_MAXSOCKBUF: ::c_int = 1; +pub const KIPC_SOCKBUF_WASTE: ::c_int = 2; +pub const KIPC_SOMAXCONN: ::c_int = 3; +pub const KIPC_MAX_LINKHDR: ::c_int = 4; +pub const KIPC_MAX_PROTOHDR: ::c_int = 5; +pub const KIPC_MAX_HDR: ::c_int = 6; +pub const KIPC_MAX_DATALEN: ::c_int = 7; + +pub const HW_MACHINE: ::c_int = 1; +pub const HW_MODEL: ::c_int = 2; +pub const HW_NCPU: ::c_int = 3; +pub const HW_BYTEORDER: ::c_int = 4; +pub const HW_PHYSMEM: ::c_int = 5; +pub const HW_USERMEM: ::c_int = 6; +pub const HW_PAGESIZE: ::c_int = 7; +pub const HW_DISKNAMES: ::c_int = 8; +pub const HW_DISKSTATS: ::c_int = 9; +pub const HW_FLOATINGPT: ::c_int = 10; +pub const HW_MACHINE_ARCH: ::c_int = 11; +pub const HW_REALMEM: ::c_int = 12; + +pub const USER_CS_PATH: ::c_int = 1; +pub const USER_BC_BASE_MAX: ::c_int = 2; +pub const USER_BC_DIM_MAX: ::c_int = 3; +pub const USER_BC_SCALE_MAX: ::c_int = 4; +pub const USER_BC_STRING_MAX: ::c_int = 5; +pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6; +pub const USER_EXPR_NEST_MAX: ::c_int = 7; +pub const USER_LINE_MAX: ::c_int = 8; +pub const USER_RE_DUP_MAX: ::c_int = 9; +pub const USER_POSIX2_VERSION: ::c_int = 10; +pub const USER_POSIX2_C_BIND: ::c_int = 11; +pub const USER_POSIX2_C_DEV: ::c_int = 12; +pub const USER_POSIX2_CHAR_TERM: ::c_int = 13; +pub const USER_POSIX2_FORT_DEV: ::c_int = 14; +pub const USER_POSIX2_FORT_RUN: ::c_int = 15; +pub const USER_POSIX2_LOCALEDEF: ::c_int = 16; +pub const USER_POSIX2_SW_DEV: ::c_int = 17; +pub const USER_POSIX2_UPE: ::c_int = 18; +pub const USER_STREAM_MAX: ::c_int = 19; +pub const USER_TZNAME_MAX: ::c_int = 20; +pub const USER_LOCALBASE: ::c_int = 21; + +pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1; +pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2; +pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3; +pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4; +pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5; +pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6; +pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7; +pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8; +pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9; +pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10; +pub const CTL_P1003_1B_FSYNC: ::c_int = 11; +pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12; +pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13; +pub const CTL_P1003_1B_TIMERS: ::c_int = 14; +pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15; +pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16; +pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17; +pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18; +pub const CTL_P1003_1B_MQ_OPEN_MAX: ::c_int = 19; +pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20; +pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21; +pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22; +pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23; +pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24; +pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25; + +pub const TIOCGPTN: ::c_ulong = 0x4004740f; +pub const TIOCPTMASTER: ::c_ulong = 0x2000741c; +pub const TIOCSIG: ::c_ulong = 0x2004745f; +pub const TIOCM_DCD: ::c_int = 0x40; +pub const H4DISC: ::c_int = 0x7; + +pub const VM_TOTAL: ::c_int = 1; + +pub const BIOCSETFNR: ::c_ulong = 0x80104282; + +pub const FIODGNAME: ::c_ulong = 0x80106678; +pub const FIONWRITE: ::c_ulong = 0x40046677; +pub const FIONSPACE: ::c_ulong = 0x40046676; +pub const FIOSEEKDATA: ::c_ulong = 0xc0086661; +pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662; + +pub const JAIL_API_VERSION: u32 = 2; +pub const JAIL_CREATE: ::c_int = 0x01; +pub const JAIL_UPDATE: ::c_int = 0x02; +pub const JAIL_ATTACH: ::c_int = 0x04; +pub const JAIL_DYING: ::c_int = 0x08; +pub const JAIL_SET_MASK: ::c_int = 0x0f; +pub const JAIL_GET_MASK: ::c_int = 0x08; +pub const JAIL_SYS_DISABLE: ::c_int = 0; +pub const JAIL_SYS_NEW: ::c_int = 1; +pub const JAIL_SYS_INHERIT: ::c_int = 2; + +pub const MNT_ACLS: ::c_int = 0x08000000; +pub const MNT_BYFSID: ::c_int = 0x08000000; +pub const MNT_GJOURNAL: ::c_int = 0x02000000; +pub const MNT_MULTILABEL: ::c_int = 0x04000000; +pub const MNT_NFS4ACLS: ::c_int = 0x00000010; +pub const MNT_SNAPSHOT: ::c_int = 0x01000000; +pub const MNT_UNION: ::c_int = 0x00000020; +pub const MNT_EXPUBLIC: ::c_int = 0x20000000; +pub const MNT_NONBUSY: ::c_int = 0x04000000; + +pub const SCM_CREDS2: ::c_int = 0x08; + +pub const SO_BINTIME: ::c_int = 0x2000; +pub const SO_NO_OFFLOAD: ::c_int = 0x4000; +pub const SO_NO_DDP: ::c_int = 0x8000; +pub const SO_REUSEPORT_LB: ::c_int = 0x10000; +pub const SO_LABEL: ::c_int = 0x1009; +pub const SO_PEERLABEL: ::c_int = 0x1010; +pub const SO_LISTENQLIMIT: ::c_int = 0x1011; +pub const SO_LISTENQLEN: ::c_int = 0x1012; +pub const SO_LISTENINCQLEN: ::c_int = 0x1013; +pub const SO_SETFIB: ::c_int = 0x1014; +pub const SO_USER_COOKIE: ::c_int = 0x1015; +pub const SO_PROTOCOL: ::c_int = 0x1016; +pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL; +pub const SO_DOMAIN: ::c_int = 0x1019; +pub const SO_VENDOR: ::c_int = 0x80000000; + +pub const LOCAL_CREDS: ::c_int = 2; +pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3; +pub const LOCAL_CONNWAIT: ::c_int = 4; +pub const LOCAL_VENDOR: ::c_int = SO_VENDOR; + +pub const PL_EVENT_NONE: ::c_int = 0; +pub const PL_EVENT_SIGNAL: ::c_int = 1; +pub const PL_FLAG_SA: ::c_int = 0x01; +pub const PL_FLAG_BOUND: ::c_int = 0x02; +pub const PL_FLAG_SCE: ::c_int = 0x04; +pub const PL_FLAG_SCX: ::c_int = 0x08; +pub const PL_FLAG_EXEC: ::c_int = 0x10; +pub const PL_FLAG_SI: ::c_int = 0x20; +pub const PL_FLAG_FORKED: ::c_int = 0x40; +pub const PL_FLAG_CHILD: ::c_int = 0x80; +pub const PL_FLAG_BORN: ::c_int = 0x100; +pub const PL_FLAG_EXITED: ::c_int = 0x200; +pub const PL_FLAG_VFORKED: ::c_int = 0x400; +pub const PL_FLAG_VFORK_DONE: ::c_int = 0x800; + +pub const PT_LWPINFO: ::c_int = 13; +pub const PT_GETNUMLWPS: ::c_int = 14; +pub const PT_GETLWPLIST: ::c_int = 15; +pub const PT_CLEARSTEP: ::c_int = 16; +pub const PT_SETSTEP: ::c_int = 17; +pub const PT_SUSPEND: ::c_int = 18; +pub const PT_RESUME: ::c_int = 19; +pub const PT_TO_SCE: ::c_int = 20; +pub const PT_TO_SCX: ::c_int = 21; +pub const PT_SYSCALL: ::c_int = 22; +pub const PT_FOLLOW_FORK: ::c_int = 23; +pub const PT_LWP_EVENTS: ::c_int = 24; +pub const PT_GET_EVENT_MASK: ::c_int = 25; +pub const PT_SET_EVENT_MASK: ::c_int = 26; +pub const PT_GET_SC_ARGS: ::c_int = 27; +pub const PT_GET_SC_RET: ::c_int = 28; +pub const PT_COREDUMP: ::c_int = 29; +pub const PT_GETREGS: ::c_int = 33; +pub const PT_SETREGS: ::c_int = 34; +pub const PT_GETFPREGS: ::c_int = 35; +pub const PT_SETFPREGS: ::c_int = 36; +pub const PT_GETDBREGS: ::c_int = 37; +pub const PT_SETDBREGS: ::c_int = 38; +pub const PT_VM_TIMESTAMP: ::c_int = 40; +pub const PT_VM_ENTRY: ::c_int = 41; +pub const PT_GETREGSET: ::c_int = 42; +pub const PT_SETREGSET: ::c_int = 43; +pub const PT_FIRSTMACH: ::c_int = 64; + +pub const PTRACE_EXEC: ::c_int = 0x0001; +pub const PTRACE_SCE: ::c_int = 0x0002; +pub const PTRACE_SCX: ::c_int = 0x0004; +pub const PTRACE_SYSCALL: ::c_int = PTRACE_SCE | PTRACE_SCX; +pub const PTRACE_FORK: ::c_int = 0x0008; +pub const PTRACE_LWP: ::c_int = 0x0010; +pub const PTRACE_VFORK: ::c_int = 0x0020; +pub const PTRACE_DEFAULT: ::c_int = PTRACE_EXEC; + +pub const PC_COMPRESS: u32 = 0x00000001; +pub const PC_ALL: u32 = 0x00000002; + +pub const PROC_SPROTECT: ::c_int = 1; +pub const PROC_REAP_ACQUIRE: ::c_int = 2; +pub const PROC_REAP_RELEASE: ::c_int = 3; +pub const PROC_REAP_STATUS: ::c_int = 4; +pub const PROC_REAP_GETPIDS: ::c_int = 5; +pub const PROC_REAP_KILL: ::c_int = 6; +pub const PROC_TRACE_CTL: ::c_int = 7; +pub const PROC_TRACE_STATUS: ::c_int = 8; +pub const PROC_TRAPCAP_CTL: ::c_int = 9; +pub const PROC_TRAPCAP_STATUS: ::c_int = 10; +pub const PROC_PDEATHSIG_CTL: ::c_int = 11; +pub const PROC_PDEATHSIG_STATUS: ::c_int = 12; +pub const PROC_ASLR_CTL: ::c_int = 13; +pub const PROC_ASLR_STATUS: ::c_int = 14; +pub const PROC_PROTMAX_CTL: ::c_int = 15; +pub const PROC_PROTMAX_STATUS: ::c_int = 16; +pub const PROC_STACKGAP_CTL: ::c_int = 17; +pub const PROC_STACKGAP_STATUS: ::c_int = 18; +pub const PROC_PROCCTL_MD_MIN: ::c_int = 0x10000000; + +pub const PPROT_SET: ::c_int = 1; +pub const PPROT_CLEAR: ::c_int = 2; +pub const PPROT_DESCEND: ::c_int = 0x10; +pub const PPROT_INHERIT: ::c_int = 0x20; + +pub const PROC_TRACE_CTL_ENABLE: ::c_int = 1; +pub const PROC_TRACE_CTL_DISABLE: ::c_int = 2; +pub const PROC_TRACE_CTL_DISABLE_EXEC: ::c_int = 3; + +pub const PROC_TRAPCAP_CTL_ENABLE: ::c_int = 1; +pub const PROC_TRAPCAP_CTL_DISABLE: ::c_int = 2; + +pub const PROC_ASLR_FORCE_ENABLE: ::c_int = 1; +pub const PROC_ASLR_FORCE_DISABLE: ::c_int = 2; +pub const PROC_ASLR_NOFORCE: ::c_int = 3; +pub const PROC_ASLR_ACTIVE: ::c_int = 0x80000000; + +pub const PROC_PROTMAX_FORCE_ENABLE: ::c_int = 1; +pub const PROC_PROTMAX_FORCE_DISABLE: ::c_int = 2; +pub const PROC_PROTMAX_NOFORCE: ::c_int = 3; +pub const PROC_PROTMAX_ACTIVE: ::c_int = 0x80000000; + +pub const PROC_STACKGAP_ENABLE: ::c_int = 0x0001; +pub const PROC_STACKGAP_DISABLE: ::c_int = 0x0002; +pub const PROC_STACKGAP_ENABLE_EXEC: ::c_int = 0x0004; +pub const PROC_STACKGAP_DISABLE_EXEC: ::c_int = 0x0008; + +pub const AF_SLOW: ::c_int = 33; +pub const AF_SCLUSTER: ::c_int = 34; +pub const AF_ARP: ::c_int = 35; +pub const AF_BLUETOOTH: ::c_int = 36; +pub const AF_IEEE80211: ::c_int = 37; +pub const AF_INET_SDP: ::c_int = 40; +pub const AF_INET6_SDP: ::c_int = 42; + +// sys/net/if.h +pub const IF_MAXUNIT: ::c_int = 0x7fff; +/// (n) interface is up +pub const IFF_UP: ::c_int = 0x1; +/// (i) broadcast address valid +pub const IFF_BROADCAST: ::c_int = 0x2; +/// (n) turn on debugging +pub const IFF_DEBUG: ::c_int = 0x4; +/// (i) is a loopback net +pub const IFF_LOOPBACK: ::c_int = 0x8; +/// (i) is a point-to-point link +pub const IFF_POINTOPOINT: ::c_int = 0x10; +/// (i) calls if_input in net epoch +pub const IFF_KNOWSEPOCH: ::c_int = 0x20; +/// (d) resources allocated +pub const IFF_RUNNING: ::c_int = 0x40; +#[doc(hidden)] +#[deprecated( + since = "0.2.54", + note = "IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead" +)] +/// (d) resources allocate +pub const IFF_DRV_RUNNING: ::c_int = 0x40; +/// (n) no address resolution protocol +pub const IFF_NOARP: ::c_int = 0x80; +/// (n) receive all packets +pub const IFF_PROMISC: ::c_int = 0x100; +/// (n) receive all multicast packets +pub const IFF_ALLMULTI: ::c_int = 0x200; +/// (d) tx hardware queue is full +pub const IFF_OACTIVE: ::c_int = 0x400; +#[doc(hidden)] +#[deprecated(since = "0.2.54", note = "Use the portable `IFF_OACTIVE` instead")] +/// (d) tx hardware queue is full +pub const IFF_DRV_OACTIVE: ::c_int = 0x400; +/// (i) can't hear own transmissions +pub const IFF_SIMPLEX: ::c_int = 0x800; +/// per link layer defined bit +pub const IFF_LINK0: ::c_int = 0x1000; +/// per link layer defined bit +pub const IFF_LINK1: ::c_int = 0x2000; +/// per link layer defined bit +pub const IFF_LINK2: ::c_int = 0x4000; +/// use alternate physical connection +pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; +/// (i) supports multicast +pub const IFF_MULTICAST: ::c_int = 0x8000; +/// (i) unconfigurable using ioctl(2) +pub const IFF_CANTCONFIG: ::c_int = 0x10000; +/// (n) user-requested promisc mode +pub const IFF_PPROMISC: ::c_int = 0x20000; +/// (n) user-requested monitor mode +pub const IFF_MONITOR: ::c_int = 0x40000; +/// (n) static ARP +pub const IFF_STATICARP: ::c_int = 0x80000; +/// (n) interface is winding down +pub const IFF_DYING: ::c_int = 0x200000; +/// (n) interface is being renamed +pub const IFF_RENAMING: ::c_int = 0x400000; +/// interface is not part of any groups +pub const IFF_NOGROUP: ::c_int = 0x800000; + +/// link invalid/unknown +pub const LINK_STATE_UNKNOWN: ::c_int = 0; +/// link is down +pub const LINK_STATE_DOWN: ::c_int = 1; +/// link is up +pub const LINK_STATE_UP: ::c_int = 2; + +/// can offload checksum on RX +pub const IFCAP_RXCSUM: ::c_int = 0x00001; +/// can offload checksum on TX +pub const IFCAP_TXCSUM: ::c_int = 0x00002; +/// can be a network console +pub const IFCAP_NETCONS: ::c_int = 0x00004; +/// VLAN-compatible MTU +pub const IFCAP_VLAN_MTU: ::c_int = 0x00008; +/// hardware VLAN tag support +pub const IFCAP_VLAN_HWTAGGING: ::c_int = 0x00010; +/// 9000 byte MTU supported +pub const IFCAP_JUMBO_MTU: ::c_int = 0x00020; +/// driver supports polling +pub const IFCAP_POLLING: ::c_int = 0x00040; +/// can do IFCAP_HWCSUM on VLANs +pub const IFCAP_VLAN_HWCSUM: ::c_int = 0x00080; +/// can do TCP Segmentation Offload +pub const IFCAP_TSO4: ::c_int = 0x00100; +/// can do TCP6 Segmentation Offload +pub const IFCAP_TSO6: ::c_int = 0x00200; +/// can do Large Receive Offload +pub const IFCAP_LRO: ::c_int = 0x00400; +/// wake on any unicast frame +pub const IFCAP_WOL_UCAST: ::c_int = 0x00800; +/// wake on any multicast frame +pub const IFCAP_WOL_MCAST: ::c_int = 0x01000; +/// wake on any Magic Packet +pub const IFCAP_WOL_MAGIC: ::c_int = 0x02000; +/// interface can offload TCP +pub const IFCAP_TOE4: ::c_int = 0x04000; +/// interface can offload TCP6 +pub const IFCAP_TOE6: ::c_int = 0x08000; +/// interface hw can filter vlan tag +pub const IFCAP_VLAN_HWFILTER: ::c_int = 0x10000; +/// can do IFCAP_TSO on VLANs +pub const IFCAP_VLAN_HWTSO: ::c_int = 0x40000; +/// the runtime link state is dynamic +pub const IFCAP_LINKSTATE: ::c_int = 0x80000; +/// netmap mode supported/enabled +pub const IFCAP_NETMAP: ::c_int = 0x100000; +/// can offload checksum on IPv6 RX +pub const IFCAP_RXCSUM_IPV6: ::c_int = 0x200000; +/// can offload checksum on IPv6 TX +pub const IFCAP_TXCSUM_IPV6: ::c_int = 0x400000; +/// manages counters internally +pub const IFCAP_HWSTATS: ::c_int = 0x800000; +/// hardware supports TX rate limiting +pub const IFCAP_TXRTLMT: ::c_int = 0x1000000; +/// hardware rx timestamping +pub const IFCAP_HWRXTSTMP: ::c_int = 0x2000000; +/// understands M_EXTPG mbufs +pub const IFCAP_MEXTPG: ::c_int = 0x4000000; +/// can do TLS encryption and segmentation for TCP +pub const IFCAP_TXTLS4: ::c_int = 0x8000000; +/// can do TLS encryption and segmentation for TCP6 +pub const IFCAP_TXTLS6: ::c_int = 0x10000000; +/// can do IFCAN_HWCSUM on VXLANs +pub const IFCAP_VXLAN_HWCSUM: ::c_int = 0x20000000; +/// can do IFCAP_TSO on VXLANs +pub const IFCAP_VXLAN_HWTSO: ::c_int = 0x40000000; +/// can do TLS with rate limiting +pub const IFCAP_TXTLS_RTLMT: ::c_int = 0x80000000; + +pub const IFCAP_HWCSUM_IPV6: ::c_int = IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6; +pub const IFCAP_HWCSUM: ::c_int = IFCAP_RXCSUM | IFCAP_TXCSUM; +pub const IFCAP_TSO: ::c_int = IFCAP_TSO4 | IFCAP_TSO6; +pub const IFCAP_WOL: ::c_int = IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC; +pub const IFCAP_TOE: ::c_int = IFCAP_TOE4 | IFCAP_TOE6; +pub const IFCAP_TXTLS: ::c_int = IFCAP_TXTLS4 | IFCAP_TXTLS6; +pub const IFCAP_CANTCHANGE: ::c_int = IFCAP_NETMAP; + +pub const IFQ_MAXLEN: ::c_int = 50; +pub const IFNET_SLOWHZ: ::c_int = 1; + +pub const IFAN_ARRIVAL: ::c_int = 0; +pub const IFAN_DEPARTURE: ::c_int = 1; + +pub const IFSTATMAX: ::c_int = 800; + +pub const RSS_FUNC_NONE: ::c_int = 0; +pub const RSS_FUNC_PRIVATE: ::c_int = 1; +pub const RSS_FUNC_TOEPLITZ: ::c_int = 2; + +pub const RSS_TYPE_IPV4: ::c_int = 0x00000001; +pub const RSS_TYPE_TCP_IPV4: ::c_int = 0x00000002; +pub const RSS_TYPE_IPV6: ::c_int = 0x00000004; +pub const RSS_TYPE_IPV6_EX: ::c_int = 0x00000008; +pub const RSS_TYPE_TCP_IPV6: ::c_int = 0x00000010; +pub const RSS_TYPE_TCP_IPV6_EX: ::c_int = 0x00000020; +pub const RSS_TYPE_UDP_IPV4: ::c_int = 0x00000040; +pub const RSS_TYPE_UDP_IPV6: ::c_int = 0x00000080; +pub const RSS_TYPE_UDP_IPV6_EX: ::c_int = 0x00000100; +pub const RSS_KEYLEN: ::c_int = 128; + +pub const IFNET_PCP_NONE: ::c_int = 0xff; +pub const IFDR_MSG_SIZE: ::c_int = 64; +pub const IFDR_REASON_MSG: ::c_int = 1; +pub const IFDR_REASON_VENDOR: ::c_int = 2; + +// sys/net/if_mib.h + +/// non-interface-specific +pub const IFMIB_SYSTEM: ::c_int = 1; +/// per-interface data table +pub const IFMIB_IFDATA: ::c_int = 2; + +/// generic stats for all kinds of ifaces +pub const IFDATA_GENERAL: ::c_int = 1; +/// specific to the type of interface +pub const IFDATA_LINKSPECIFIC: ::c_int = 2; +/// driver name and unit +pub const IFDATA_DRIVERNAME: ::c_int = 3; + +/// number of interfaces configured +pub const IFMIB_IFCOUNT: ::c_int = 1; + +/// functions not specific to a type of iface +pub const NETLINK_GENERIC: ::c_int = 0; + +pub const DOT3COMPLIANCE_STATS: ::c_int = 1; +pub const DOT3COMPLIANCE_COLLS: ::c_int = 2; + +pub const dot3ChipSetAMD7990: ::c_int = 1; +pub const dot3ChipSetAMD79900: ::c_int = 2; +pub const dot3ChipSetAMD79C940: ::c_int = 3; + +pub const dot3ChipSetIntel82586: ::c_int = 1; +pub const dot3ChipSetIntel82596: ::c_int = 2; +pub const dot3ChipSetIntel82557: ::c_int = 3; + +pub const dot3ChipSetNational8390: ::c_int = 1; +pub const dot3ChipSetNationalSonic: ::c_int = 2; + +pub const dot3ChipSetFujitsu86950: ::c_int = 1; + +pub const dot3ChipSetDigitalDC21040: ::c_int = 1; +pub const dot3ChipSetDigitalDC21140: ::c_int = 2; +pub const dot3ChipSetDigitalDC21041: ::c_int = 3; +pub const dot3ChipSetDigitalDC21140A: ::c_int = 4; +pub const dot3ChipSetDigitalDC21142: ::c_int = 5; + +pub const dot3ChipSetWesternDigital83C690: ::c_int = 1; +pub const dot3ChipSetWesternDigital83C790: ::c_int = 2; + +// sys/netinet/in.h +// Protocols (RFC 1700) +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// IP6 hop-by-hop options +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// gateway^2 (deprecated) +pub const IPPROTO_GGP: ::c_int = 3; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// Stream protocol II. +pub const IPPROTO_ST: ::c_int = 7; +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// private interior gateway +pub const IPPROTO_PIGP: ::c_int = 9; +/// BBN RCC Monitoring +pub const IPPROTO_RCCMON: ::c_int = 10; +/// network voice protocol +pub const IPPROTO_NVPII: ::c_int = 11; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +/// Argus +pub const IPPROTO_ARGUS: ::c_int = 13; +/// EMCON +pub const IPPROTO_EMCON: ::c_int = 14; +/// Cross Net Debugger +pub const IPPROTO_XNET: ::c_int = 15; +/// Chaos +pub const IPPROTO_CHAOS: ::c_int = 16; +// IPPROTO_UDP defined in src/unix/mod.rs +/// Multiplexing +pub const IPPROTO_MUX: ::c_int = 18; +/// DCN Measurement Subsystems +pub const IPPROTO_MEAS: ::c_int = 19; +/// Host Monitoring +pub const IPPROTO_HMP: ::c_int = 20; +/// Packet Radio Measurement +pub const IPPROTO_PRM: ::c_int = 21; +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// Trunk-1 +pub const IPPROTO_TRUNK1: ::c_int = 23; +/// Trunk-2 +pub const IPPROTO_TRUNK2: ::c_int = 24; +/// Leaf-1 +pub const IPPROTO_LEAF1: ::c_int = 25; +/// Leaf-2 +pub const IPPROTO_LEAF2: ::c_int = 26; +/// Reliable Data +pub const IPPROTO_RDP: ::c_int = 27; +/// Reliable Transaction +pub const IPPROTO_IRTP: ::c_int = 28; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// Bulk Data Transfer +pub const IPPROTO_BLT: ::c_int = 30; +/// Network Services +pub const IPPROTO_NSP: ::c_int = 31; +/// Merit Internodal +pub const IPPROTO_INP: ::c_int = 32; +#[doc(hidden)] +#[deprecated( + since = "0.2.72", + note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead" +)] +pub const IPPROTO_SEP: ::c_int = 33; +/// Datagram Congestion Control Protocol +pub const IPPROTO_DCCP: ::c_int = 33; +/// Third Party Connect +pub const IPPROTO_3PC: ::c_int = 34; +/// InterDomain Policy Routing +pub const IPPROTO_IDPR: ::c_int = 35; +/// XTP +pub const IPPROTO_XTP: ::c_int = 36; +/// Datagram Delivery +pub const IPPROTO_DDP: ::c_int = 37; +/// Control Message Transport +pub const IPPROTO_CMTP: ::c_int = 38; +/// TP++ Transport +pub const IPPROTO_TPXX: ::c_int = 39; +/// IL transport protocol +pub const IPPROTO_IL: ::c_int = 40; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// Source Demand Routing +pub const IPPROTO_SDRP: ::c_int = 42; +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// InterDomain Routing +pub const IPPROTO_IDRP: ::c_int = 45; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// Mobile Host Routing +pub const IPPROTO_MHRP: ::c_int = 48; +/// BHA +pub const IPPROTO_BHA: ::c_int = 49; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +/// Integ. Net Layer Security +pub const IPPROTO_INLSP: ::c_int = 52; +/// IP with encryption +pub const IPPROTO_SWIPE: ::c_int = 53; +/// Next Hop Resolution +pub const IPPROTO_NHRP: ::c_int = 54; +/// IP Mobility +pub const IPPROTO_MOBILE: ::c_int = 55; +/// Transport Layer Security +pub const IPPROTO_TLSP: ::c_int = 56; +/// SKIP +pub const IPPROTO_SKIP: ::c_int = 57; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +/// any host internal protocol +pub const IPPROTO_AHIP: ::c_int = 61; +/// CFTP +pub const IPPROTO_CFTP: ::c_int = 62; +/// "hello" routing protocol +pub const IPPROTO_HELLO: ::c_int = 63; +/// SATNET/Backroom EXPAK +pub const IPPROTO_SATEXPAK: ::c_int = 64; +/// Kryptolan +pub const IPPROTO_KRYPTOLAN: ::c_int = 65; +/// Remote Virtual Disk +pub const IPPROTO_RVD: ::c_int = 66; +/// Pluribus Packet Core +pub const IPPROTO_IPPC: ::c_int = 67; +/// Any distributed FS +pub const IPPROTO_ADFS: ::c_int = 68; +/// Satnet Monitoring +pub const IPPROTO_SATMON: ::c_int = 69; +/// VISA Protocol +pub const IPPROTO_VISA: ::c_int = 70; +/// Packet Core Utility +pub const IPPROTO_IPCV: ::c_int = 71; +/// Comp. Prot. Net. Executive +pub const IPPROTO_CPNX: ::c_int = 72; +/// Comp. Prot. HeartBeat +pub const IPPROTO_CPHB: ::c_int = 73; +/// Wang Span Network +pub const IPPROTO_WSN: ::c_int = 74; +/// Packet Video Protocol +pub const IPPROTO_PVP: ::c_int = 75; +/// BackRoom SATNET Monitoring +pub const IPPROTO_BRSATMON: ::c_int = 76; +/// Sun net disk proto (temp.) +pub const IPPROTO_ND: ::c_int = 77; +/// WIDEBAND Monitoring +pub const IPPROTO_WBMON: ::c_int = 78; +/// WIDEBAND EXPAK +pub const IPPROTO_WBEXPAK: ::c_int = 79; +/// ISO cnlp +pub const IPPROTO_EON: ::c_int = 80; +/// VMTP +pub const IPPROTO_VMTP: ::c_int = 81; +/// Secure VMTP +pub const IPPROTO_SVMTP: ::c_int = 82; +/// Banyon VINES +pub const IPPROTO_VINES: ::c_int = 83; +/// TTP +pub const IPPROTO_TTP: ::c_int = 84; +/// NSFNET-IGP +pub const IPPROTO_IGP: ::c_int = 85; +/// dissimilar gateway prot. +pub const IPPROTO_DGP: ::c_int = 86; +/// TCF +pub const IPPROTO_TCF: ::c_int = 87; +/// Cisco/GXS IGRP +pub const IPPROTO_IGRP: ::c_int = 88; +/// OSPFIGP +pub const IPPROTO_OSPFIGP: ::c_int = 89; +/// Strite RPC protocol +pub const IPPROTO_SRPC: ::c_int = 90; +/// Locus Address Resoloution +pub const IPPROTO_LARP: ::c_int = 91; +/// Multicast Transport +pub const IPPROTO_MTP: ::c_int = 92; +/// AX.25 Frames +pub const IPPROTO_AX25: ::c_int = 93; +/// IP encapsulated in IP +pub const IPPROTO_IPEIP: ::c_int = 94; +/// Mobile Int.ing control +pub const IPPROTO_MICP: ::c_int = 95; +/// Semaphore Comm. security +pub const IPPROTO_SCCSP: ::c_int = 96; +/// Ethernet IP encapsulation +pub const IPPROTO_ETHERIP: ::c_int = 97; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// any private encr. scheme +pub const IPPROTO_APES: ::c_int = 99; +/// GMTP +pub const IPPROTO_GMTP: ::c_int = 100; +/// payload compression (IPComp) +pub const IPPROTO_IPCOMP: ::c_int = 108; +/// SCTP +pub const IPPROTO_SCTP: ::c_int = 132; +/// IPv6 Mobility Header +pub const IPPROTO_MH: ::c_int = 135; +/// UDP-Lite +pub const IPPROTO_UDPLITE: ::c_int = 136; +/// IP6 Host Identity Protocol +pub const IPPROTO_HIP: ::c_int = 139; +/// IP6 Shim6 Protocol +pub const IPPROTO_SHIM6: ::c_int = 140; + +/* 101-254: Partly Unassigned */ +/// Protocol Independent Mcast +pub const IPPROTO_PIM: ::c_int = 103; +/// CARP +pub const IPPROTO_CARP: ::c_int = 112; +/// PGM +pub const IPPROTO_PGM: ::c_int = 113; +/// MPLS-in-IP +pub const IPPROTO_MPLS: ::c_int = 137; +/// PFSYNC +pub const IPPROTO_PFSYNC: ::c_int = 240; + +/* 255: Reserved */ +/* BSD Private, local use, namespace incursion, no longer used */ +/// OLD divert pseudo-proto +pub const IPPROTO_OLD_DIVERT: ::c_int = 254; +pub const IPPROTO_MAX: ::c_int = 256; +/// last return value of *_input(), meaning "all job for this pkt is done". +pub const IPPROTO_DONE: ::c_int = 257; + +/* Only used internally, so can be outside the range of valid IP protocols. */ +/// divert pseudo-protocol +pub const IPPROTO_DIVERT: ::c_int = 258; +/// SeND pseudo-protocol +pub const IPPROTO_SEND: ::c_int = 259; + +// sys/netinet/TCP.h +pub const TCP_MD5SIG: ::c_int = 16; +pub const TCP_INFO: ::c_int = 32; +pub const TCP_CONGESTION: ::c_int = 64; +pub const TCP_CCALGOOPT: ::c_int = 65; +pub const TCP_MAXUNACKTIME: ::c_int = 68; +pub const TCP_MAXPEAKRATE: ::c_int = 69; +pub const TCP_IDLE_REDUCE: ::c_int = 70; +pub const TCP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 71; +pub const TCP_DELACK: ::c_int = 72; +pub const TCP_FIN_IS_RST: ::c_int = 73; +pub const TCP_LOG_LIMIT: ::c_int = 74; +pub const TCP_SHARED_CWND_ALLOWED: ::c_int = 75; +pub const TCP_PROC_ACCOUNTING: ::c_int = 76; +pub const TCP_USE_CMP_ACKS: ::c_int = 77; +pub const TCP_PERF_INFO: ::c_int = 78; +pub const TCP_LRD: ::c_int = 79; +pub const TCP_KEEPINIT: ::c_int = 128; +pub const TCP_FASTOPEN: ::c_int = 1025; +pub const TCP_PCAP_OUT: ::c_int = 2048; +pub const TCP_PCAP_IN: ::c_int = 4096; +pub const TCP_FASTOPEN_PSK_LEN: ::c_int = 16; +pub const TCP_FUNCTION_NAME_LEN_MAX: ::c_int = 32; + +pub const IP_BINDANY: ::c_int = 24; +pub const IP_BINDMULTI: ::c_int = 25; +pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26; +pub const IP_ORIGDSTADDR: ::c_int = 27; +pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR; + +pub const IP_DONTFRAG: ::c_int = 67; +pub const IP_RECVTOS: ::c_int = 68; + +pub const IPV6_BINDANY: ::c_int = 64; +pub const IPV6_ORIGDSTADDR: ::c_int = 72; +pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR; + +pub const PF_SLOW: ::c_int = AF_SLOW; +pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER; +pub const PF_ARP: ::c_int = AF_ARP; +pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; +pub const PF_IEEE80211: ::c_int = AF_IEEE80211; +pub const PF_INET_SDP: ::c_int = AF_INET_SDP; +pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP; + +pub const NET_RT_DUMP: ::c_int = 1; +pub const NET_RT_FLAGS: ::c_int = 2; +pub const NET_RT_IFLIST: ::c_int = 3; +pub const NET_RT_IFMALIST: ::c_int = 4; +pub const NET_RT_IFLISTL: ::c_int = 5; + +// System V IPC +pub const IPC_INFO: ::c_int = 3; +pub const MSG_NOERROR: ::c_int = 0o10000; +pub const SHM_LOCK: ::c_int = 11; +pub const SHM_UNLOCK: ::c_int = 12; +pub const SHM_STAT: ::c_int = 13; +pub const SHM_INFO: ::c_int = 14; +pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char; + +// The *_MAXID constants never should've been used outside of the +// FreeBSD base system. And with the exception of CTL_P1003_1B_MAXID, +// they were all removed in svn r262489. They remain here for backwards +// compatibility only, and are scheduled to be removed in libc 1.0.0. +#[doc(hidden)] +#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] +pub const CTL_MAXID: ::c_int = 10; +#[doc(hidden)] +#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] +pub const KERN_MAXID: ::c_int = 38; +#[doc(hidden)] +#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] +pub const HW_MAXID: ::c_int = 13; +#[doc(hidden)] +#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] +pub const USER_MAXID: ::c_int = 21; +#[doc(hidden)] +#[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")] +pub const CTL_P1003_1B_MAXID: ::c_int = 26; + +pub const MSG_NOTIFICATION: ::c_int = 0x00002000; +pub const MSG_NBIO: ::c_int = 0x00004000; +pub const MSG_COMPAT: ::c_int = 0x00008000; +pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000; +pub const MSG_NOSIGNAL: ::c_int = 0x20000; + +// utmpx entry types +pub const EMPTY: ::c_short = 0; +pub const BOOT_TIME: ::c_short = 1; +pub const OLD_TIME: ::c_short = 2; +pub const NEW_TIME: ::c_short = 3; +pub const USER_PROCESS: ::c_short = 4; +pub const INIT_PROCESS: ::c_short = 5; +pub const LOGIN_PROCESS: ::c_short = 6; +pub const DEAD_PROCESS: ::c_short = 7; +pub const SHUTDOWN_TIME: ::c_short = 8; +// utmp database types +pub const UTXDB_ACTIVE: ::c_int = 0; +pub const UTXDB_LASTLOGIN: ::c_int = 1; +pub const UTXDB_LOG: ::c_int = 2; + +pub const LC_COLLATE_MASK: ::c_int = 1 << 0; +pub const LC_CTYPE_MASK: ::c_int = 1 << 1; +pub const LC_MONETARY_MASK: ::c_int = 1 << 2; +pub const LC_NUMERIC_MASK: ::c_int = 1 << 3; +pub const LC_TIME_MASK: ::c_int = 1 << 4; +pub const LC_MESSAGES_MASK: ::c_int = 1 << 5; +pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK + | LC_CTYPE_MASK + | LC_MESSAGES_MASK + | LC_MONETARY_MASK + | LC_NUMERIC_MASK + | LC_TIME_MASK; + +pub const WSTOPPED: ::c_int = 2; // same as WUNTRACED +pub const WCONTINUED: ::c_int = 4; +pub const WNOWAIT: ::c_int = 8; +pub const WEXITED: ::c_int = 16; +pub const WTRAPPED: ::c_int = 32; + +// FreeBSD defines a great many more of these, we only expose the +// standardized ones. +pub const P_PID: idtype_t = 0; +pub const P_PGID: idtype_t = 2; +pub const P_ALL: idtype_t = 7; + +pub const UTIME_OMIT: c_long = -2; +pub const UTIME_NOW: c_long = -1; + +pub const B460800: ::speed_t = 460800; +pub const B921600: ::speed_t = 921600; + +pub const AT_FDCWD: ::c_int = -100; +pub const AT_EACCESS: ::c_int = 0x100; +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200; +pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; +pub const AT_REMOVEDIR: ::c_int = 0x800; + +pub const AT_NULL: ::c_int = 0; +pub const AT_IGNORE: ::c_int = 1; +pub const AT_EXECFD: ::c_int = 2; +pub const AT_PHDR: ::c_int = 3; +pub const AT_PHENT: ::c_int = 4; +pub const AT_PHNUM: ::c_int = 5; +pub const AT_PAGESZ: ::c_int = 6; +pub const AT_BASE: ::c_int = 7; +pub const AT_FLAGS: ::c_int = 8; +pub const AT_ENTRY: ::c_int = 9; +pub const AT_NOTELF: ::c_int = 10; +pub const AT_UID: ::c_int = 11; +pub const AT_EUID: ::c_int = 12; +pub const AT_GID: ::c_int = 13; +pub const AT_EGID: ::c_int = 14; +pub const AT_EXECPATH: ::c_int = 15; + +pub const TABDLY: ::tcflag_t = 0x00000004; +pub const TAB0: ::tcflag_t = 0x00000000; +pub const TAB3: ::tcflag_t = 0x00000004; + +pub const _PC_ACL_NFS4: ::c_int = 64; + +pub const _SC_CPUSET_SIZE: ::c_int = 122; + +pub const _UUID_NODE_LEN: usize = 6; + +// Flags which can be passed to pdfork(2) +pub const PD_DAEMON: ::c_int = 0x00000001; +pub const PD_CLOEXEC: ::c_int = 0x00000002; +pub const PD_ALLOWED_AT_FORK: ::c_int = PD_DAEMON | PD_CLOEXEC; + +// Values for struct rtprio (type_ field) +pub const RTP_PRIO_REALTIME: ::c_ushort = 2; +pub const RTP_PRIO_NORMAL: ::c_ushort = 3; +pub const RTP_PRIO_IDLE: ::c_ushort = 4; + +pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; +pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; +pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04; +pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08; +pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10; +pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20; + +// Flags for chflags(2) +pub const UF_SYSTEM: ::c_ulong = 0x00000080; +pub const UF_SPARSE: ::c_ulong = 0x00000100; +pub const UF_OFFLINE: ::c_ulong = 0x00000200; +pub const UF_REPARSE: ::c_ulong = 0x00000400; +pub const UF_ARCHIVE: ::c_ulong = 0x00000800; +pub const UF_READONLY: ::c_ulong = 0x00001000; +pub const UF_HIDDEN: ::c_ulong = 0x00008000; +pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; + +// fcntl commands +pub const F_ADD_SEALS: ::c_int = 19; +pub const F_GET_SEALS: ::c_int = 20; +pub const F_OGETLK: ::c_int = 7; +pub const F_OSETLK: ::c_int = 8; +pub const F_OSETLKW: ::c_int = 9; +pub const F_RDAHEAD: ::c_int = 16; +pub const F_READAHEAD: ::c_int = 15; +pub const F_SETLK_REMOTE: ::c_int = 14; +pub const F_KINFO: ::c_int = 22; + +// for use with F_ADD_SEALS +pub const F_SEAL_GROW: ::c_int = 4; +pub const F_SEAL_SEAL: ::c_int = 1; +pub const F_SEAL_SHRINK: ::c_int = 2; +pub const F_SEAL_WRITE: ::c_int = 8; + +// for use with fspacectl +pub const SPACECTL_DEALLOC: ::c_int = 1; + +// For getrandom() +pub const GRND_NONBLOCK: ::c_uint = 0x1; +pub const GRND_RANDOM: ::c_uint = 0x2; +pub const GRND_INSECURE: ::c_uint = 0x4; + +// For realhostname* api +pub const HOSTNAME_FOUND: ::c_int = 0; +pub const HOSTNAME_INCORRECTNAME: ::c_int = 1; +pub const HOSTNAME_INVALIDADDR: ::c_int = 2; +pub const HOSTNAME_INVALIDNAME: ::c_int = 3; + +// For rfork +pub const RFFDG: ::c_int = 4; +pub const RFPROC: ::c_int = 16; +pub const RFMEM: ::c_int = 32; +pub const RFNOWAIT: ::c_int = 64; +pub const RFCFDG: ::c_int = 4096; +pub const RFTHREAD: ::c_int = 8192; +pub const RFLINUXTHPN: ::c_int = 65536; +pub const RFTSIGZMB: ::c_int = 524288; +pub const RFSPAWN: ::c_int = 2147483648; + +// For eventfd +pub const EFD_SEMAPHORE: ::c_int = 0x1; +pub const EFD_NONBLOCK: ::c_int = 0x4; +pub const EFD_CLOEXEC: ::c_int = 0x100000; + +pub const MALLOCX_ZERO: ::c_int = 0x40; + +/// size of returned wchan message +pub const WMESGLEN: usize = 8; +/// size of returned lock name +pub const LOCKNAMELEN: usize = 8; +/// size of returned thread name +pub const TDNAMLEN: usize = 16; +/// size of returned ki_comm name +pub const COMMLEN: usize = 19; +/// size of returned ki_emul +pub const KI_EMULNAMELEN: usize = 16; +/// number of groups in ki_groups +pub const KI_NGROUPS: usize = 16; +cfg_if! { + if #[cfg(freebsd11)] { + pub const KI_NSPARE_INT: usize = 4; + } else { + pub const KI_NSPARE_INT: usize = 2; + } +} +pub const KI_NSPARE_LONG: usize = 12; +/// Flags for the process credential. +pub const KI_CRF_CAPABILITY_MODE: usize = 0x00000001; +/// Steal a bit from ki_cr_flags to indicate that the cred had more than +/// KI_NGROUPS groups. +pub const KI_CRF_GRP_OVERFLOW: usize = 0x80000000; +/// controlling tty vnode active +pub const KI_CTTY: usize = 0x00000001; +/// session leader +pub const KI_SLEADER: usize = 0x00000002; +/// proc blocked on lock ki_lockname +pub const KI_LOCKBLOCK: usize = 0x00000004; +/// size of returned ki_login +pub const LOGNAMELEN: usize = 17; +/// size of returned ki_loginclass +pub const LOGINCLASSLEN: usize = 17; + +pub const KF_ATTR_VALID: ::c_int = 0x0001; +pub const KF_TYPE_NONE: ::c_int = 0; +pub const KF_TYPE_VNODE: ::c_int = 1; +pub const KF_TYPE_SOCKET: ::c_int = 2; +pub const KF_TYPE_PIPE: ::c_int = 3; +pub const KF_TYPE_FIFO: ::c_int = 4; +pub const KF_TYPE_KQUEUE: ::c_int = 5; +pub const KF_TYPE_MQUEUE: ::c_int = 7; +pub const KF_TYPE_SHM: ::c_int = 8; +pub const KF_TYPE_SEM: ::c_int = 9; +pub const KF_TYPE_PTS: ::c_int = 10; +pub const KF_TYPE_PROCDESC: ::c_int = 11; +pub const KF_TYPE_DEV: ::c_int = 12; +pub const KF_TYPE_UNKNOWN: ::c_int = 255; + +pub const KF_VTYPE_VNON: ::c_int = 0; +pub const KF_VTYPE_VREG: ::c_int = 1; +pub const KF_VTYPE_VDIR: ::c_int = 2; +pub const KF_VTYPE_VBLK: ::c_int = 3; +pub const KF_VTYPE_VCHR: ::c_int = 4; +pub const KF_VTYPE_VLNK: ::c_int = 5; +pub const KF_VTYPE_VSOCK: ::c_int = 6; +pub const KF_VTYPE_VFIFO: ::c_int = 7; +pub const KF_VTYPE_VBAD: ::c_int = 8; +pub const KF_VTYPE_UNKNOWN: ::c_int = 255; + +/// Current working directory +pub const KF_FD_TYPE_CWD: ::c_int = -1; +/// Root directory +pub const KF_FD_TYPE_ROOT: ::c_int = -2; +/// Jail directory +pub const KF_FD_TYPE_JAIL: ::c_int = -3; +/// Ktrace vnode +pub const KF_FD_TYPE_TRACE: ::c_int = -4; +pub const KF_FD_TYPE_TEXT: ::c_int = -5; +/// Controlling terminal +pub const KF_FD_TYPE_CTTY: ::c_int = -6; +pub const KF_FLAG_READ: ::c_int = 0x00000001; +pub const KF_FLAG_WRITE: ::c_int = 0x00000002; +pub const KF_FLAG_APPEND: ::c_int = 0x00000004; +pub const KF_FLAG_ASYNC: ::c_int = 0x00000008; +pub const KF_FLAG_FSYNC: ::c_int = 0x00000010; +pub const KF_FLAG_NONBLOCK: ::c_int = 0x00000020; +pub const KF_FLAG_DIRECT: ::c_int = 0x00000040; +pub const KF_FLAG_HASLOCK: ::c_int = 0x00000080; +pub const KF_FLAG_SHLOCK: ::c_int = 0x00000100; +pub const KF_FLAG_EXLOCK: ::c_int = 0x00000200; +pub const KF_FLAG_NOFOLLOW: ::c_int = 0x00000400; +pub const KF_FLAG_CREAT: ::c_int = 0x00000800; +pub const KF_FLAG_TRUNC: ::c_int = 0x00001000; +pub const KF_FLAG_EXCL: ::c_int = 0x00002000; +pub const KF_FLAG_EXEC: ::c_int = 0x00004000; + +pub const KVME_TYPE_NONE: ::c_int = 0; +pub const KVME_TYPE_DEFAULT: ::c_int = 1; +pub const KVME_TYPE_VNODE: ::c_int = 2; +pub const KVME_TYPE_SWAP: ::c_int = 3; +pub const KVME_TYPE_DEVICE: ::c_int = 4; +pub const KVME_TYPE_PHYS: ::c_int = 5; +pub const KVME_TYPE_DEAD: ::c_int = 6; +pub const KVME_TYPE_SG: ::c_int = 7; +pub const KVME_TYPE_MGTDEVICE: ::c_int = 8; +// Present in `sys/user.h` but is undefined for whatever reason... +// pub const KVME_TYPE_GUARD: ::c_int = 9; +pub const KVME_TYPE_UNKNOWN: ::c_int = 255; +pub const KVME_PROT_READ: ::c_int = 0x00000001; +pub const KVME_PROT_WRITE: ::c_int = 0x00000002; +pub const KVME_PROT_EXEC: ::c_int = 0x00000004; +pub const KVME_FLAG_COW: ::c_int = 0x00000001; +pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002; +pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x00000004; +pub const KVME_FLAG_SUPER: ::c_int = 0x00000008; +pub const KVME_FLAG_GROWS_UP: ::c_int = 0x00000010; +pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x00000020; +pub const KVME_FLAG_USER_WIRED: ::c_int = 0x00000040; + +pub const KKST_MAXLEN: ::c_int = 1024; +/// Stack is valid. +pub const KKST_STATE_STACKOK: ::c_int = 0; +/// Stack swapped out. +pub const KKST_STATE_SWAPPED: ::c_int = 1; +pub const KKST_STATE_RUNNING: ::c_int = 2; + +// Constants about priority. +pub const PRI_MIN: ::c_int = 0; +pub const PRI_MAX: ::c_int = 255; +pub const PRI_MIN_ITHD: ::c_int = PRI_MIN; +pub const PRI_MAX_ITHD: ::c_int = PRI_MIN_REALTIME - 1; +pub const PI_REALTIME: ::c_int = PRI_MIN_ITHD + 0; +pub const PI_AV: ::c_int = PRI_MIN_ITHD + 4; +pub const PI_NET: ::c_int = PRI_MIN_ITHD + 8; +pub const PI_DISK: ::c_int = PRI_MIN_ITHD + 12; +pub const PI_TTY: ::c_int = PRI_MIN_ITHD + 16; +pub const PI_DULL: ::c_int = PRI_MIN_ITHD + 20; +pub const PI_SOFT: ::c_int = PRI_MIN_ITHD + 24; +pub const PRI_MIN_REALTIME: ::c_int = 48; +pub const PRI_MAX_REALTIME: ::c_int = PRI_MIN_KERN - 1; +pub const PRI_MIN_KERN: ::c_int = 80; +pub const PRI_MAX_KERN: ::c_int = PRI_MIN_TIMESHARE - 1; +pub const PSWP: ::c_int = PRI_MIN_KERN + 0; +pub const PVM: ::c_int = PRI_MIN_KERN + 4; +pub const PINOD: ::c_int = PRI_MIN_KERN + 8; +pub const PRIBIO: ::c_int = PRI_MIN_KERN + 12; +pub const PVFS: ::c_int = PRI_MIN_KERN + 16; +pub const PZERO: ::c_int = PRI_MIN_KERN + 20; +pub const PSOCK: ::c_int = PRI_MIN_KERN + 24; +pub const PWAIT: ::c_int = PRI_MIN_KERN + 28; +pub const PLOCK: ::c_int = PRI_MIN_KERN + 32; +pub const PPAUSE: ::c_int = PRI_MIN_KERN + 36; +pub const PRI_MIN_TIMESHARE: ::c_int = 120; +pub const PRI_MAX_TIMESHARE: ::c_int = PRI_MIN_IDLE - 1; +pub const PUSER: ::c_int = PRI_MIN_TIMESHARE; +pub const PRI_MIN_IDLE: ::c_int = 224; +pub const PRI_MAX_IDLE: ::c_int = PRI_MAX; + +pub const NZERO: ::c_int = 0; + +// Resource utilization information. +pub const RUSAGE_THREAD: ::c_int = 1; + +cfg_if! { + if #[cfg(any(freebsd11, target_pointer_width = "32"))] { + pub const ARG_MAX: ::c_int = 256 * 1024; + } else { + pub const ARG_MAX: ::c_int = 2 * 256 * 1024; + } +} +pub const CHILD_MAX: ::c_int = 40; +/// max command name remembered +pub const MAXCOMLEN: usize = 19; +/// max interpreter file name length +pub const MAXINTERP: ::c_int = ::PATH_MAX; +/// max login name length (incl. NUL) +pub const MAXLOGNAME: ::c_int = 33; +/// max simultaneous processes +pub const MAXUPRC: ::c_int = CHILD_MAX; +/// max bytes for an exec function +pub const NCARGS: ::c_int = ARG_MAX; +/// /* max number groups +pub const NGROUPS: ::c_int = NGROUPS_MAX + 1; +/// max open files per process +pub const NOFILE: ::c_int = OPEN_MAX; +/// marker for empty group set member +pub const NOGROUP: ::c_int = 65535; +/// max hostname size +pub const MAXHOSTNAMELEN: ::c_int = 256; +/// max bytes in term canon input line +pub const MAX_CANON: ::c_int = 255; +/// max bytes in terminal input +pub const MAX_INPUT: ::c_int = 255; +/// max bytes in a file name +pub const NAME_MAX: ::c_int = 255; +pub const MAXSYMLINKS: ::c_int = 32; +/// max supplemental group id's +pub const NGROUPS_MAX: ::c_int = 1023; +/// max open files per process +pub const OPEN_MAX: ::c_int = 64; + +pub const _POSIX_ARG_MAX: ::c_int = 4096; +pub const _POSIX_LINK_MAX: ::c_int = 8; +pub const _POSIX_MAX_CANON: ::c_int = 255; +pub const _POSIX_MAX_INPUT: ::c_int = 255; +pub const _POSIX_NAME_MAX: ::c_int = 14; +pub const _POSIX_PIPE_BUF: ::c_int = 512; +pub const _POSIX_SSIZE_MAX: ::c_int = 32767; +pub const _POSIX_STREAM_MAX: ::c_int = 8; + +/// max ibase/obase values in bc(1) +pub const BC_BASE_MAX: ::c_int = 99; +/// max array elements in bc(1) +pub const BC_DIM_MAX: ::c_int = 2048; +/// max scale value in bc(1) +pub const BC_SCALE_MAX: ::c_int = 99; +/// max const string length in bc(1) +pub const BC_STRING_MAX: ::c_int = 1000; +/// max character class name size +pub const CHARCLASS_NAME_MAX: ::c_int = 14; +/// max weights for order keyword +pub const COLL_WEIGHTS_MAX: ::c_int = 10; +/// max expressions nested in expr(1) +pub const EXPR_NEST_MAX: ::c_int = 32; +/// max bytes in an input line +pub const LINE_MAX: ::c_int = 2048; +/// max RE's in interval notation +pub const RE_DUP_MAX: ::c_int = 255; + +pub const _POSIX2_BC_BASE_MAX: ::c_int = 99; +pub const _POSIX2_BC_DIM_MAX: ::c_int = 2048; +pub const _POSIX2_BC_SCALE_MAX: ::c_int = 99; +pub const _POSIX2_BC_STRING_MAX: ::c_int = 1000; +pub const _POSIX2_CHARCLASS_NAME_MAX: ::c_int = 14; +pub const _POSIX2_COLL_WEIGHTS_MAX: ::c_int = 2; +pub const _POSIX2_EQUIV_CLASS_MAX: ::c_int = 2; +pub const _POSIX2_EXPR_NEST_MAX: ::c_int = 32; +pub const _POSIX2_LINE_MAX: ::c_int = 2048; +pub const _POSIX2_RE_DUP_MAX: ::c_int = 255; + +// sys/proc.h +pub const TDF_BORROWING: ::c_int = 0x00000001; +pub const TDF_INPANIC: ::c_int = 0x00000002; +pub const TDF_INMEM: ::c_int = 0x00000004; +pub const TDF_SINTR: ::c_int = 0x00000008; +pub const TDF_TIMEOUT: ::c_int = 0x00000010; +pub const TDF_IDLETD: ::c_int = 0x00000020; +pub const TDF_CANSWAP: ::c_int = 0x00000040; +pub const TDF_KTH_SUSP: ::c_int = 0x00000100; +pub const TDF_ALLPROCSUSP: ::c_int = 0x00000200; +pub const TDF_BOUNDARY: ::c_int = 0x00000400; +pub const TDF_ASTPENDING: ::c_int = 0x00000800; +pub const TDF_SBDRY: ::c_int = 0x00002000; +pub const TDF_UPIBLOCKED: ::c_int = 0x00004000; +pub const TDF_NEEDSUSPCHK: ::c_int = 0x00008000; +pub const TDF_NEEDRESCHED: ::c_int = 0x00010000; +pub const TDF_NEEDSIGCHK: ::c_int = 0x00020000; +pub const TDF_NOLOAD: ::c_int = 0x00040000; +pub const TDF_SERESTART: ::c_int = 0x00080000; +pub const TDF_THRWAKEUP: ::c_int = 0x00100000; +pub const TDF_SEINTR: ::c_int = 0x00200000; +pub const TDF_SWAPINREQ: ::c_int = 0x00400000; +pub const TDF_UNUSED23: ::c_int = 0x00800000; +pub const TDF_SCHED0: ::c_int = 0x01000000; +pub const TDF_SCHED1: ::c_int = 0x02000000; +pub const TDF_SCHED2: ::c_int = 0x04000000; +pub const TDF_SCHED3: ::c_int = 0x08000000; +pub const TDF_ALRMPEND: ::c_int = 0x10000000; +pub const TDF_PROFPEND: ::c_int = 0x20000000; +pub const TDF_MACPEND: ::c_int = 0x40000000; + +pub const TDB_SUSPEND: ::c_int = 0x00000001; +pub const TDB_XSIG: ::c_int = 0x00000002; +pub const TDB_USERWR: ::c_int = 0x00000004; +pub const TDB_SCE: ::c_int = 0x00000008; +pub const TDB_SCX: ::c_int = 0x00000010; +pub const TDB_EXEC: ::c_int = 0x00000020; +pub const TDB_FORK: ::c_int = 0x00000040; +pub const TDB_STOPATFORK: ::c_int = 0x00000080; +pub const TDB_CHILD: ::c_int = 0x00000100; +pub const TDB_BORN: ::c_int = 0x00000200; +pub const TDB_EXIT: ::c_int = 0x00000400; +pub const TDB_VFORK: ::c_int = 0x00000800; +pub const TDB_FSTP: ::c_int = 0x00001000; +pub const TDB_STEP: ::c_int = 0x00002000; + +pub const TDP_OLDMASK: ::c_int = 0x00000001; +pub const TDP_INKTR: ::c_int = 0x00000002; +pub const TDP_INKTRACE: ::c_int = 0x00000004; +pub const TDP_BUFNEED: ::c_int = 0x00000008; +pub const TDP_COWINPROGRESS: ::c_int = 0x00000010; +pub const TDP_ALTSTACK: ::c_int = 0x00000020; +pub const TDP_DEADLKTREAT: ::c_int = 0x00000040; +pub const TDP_NOFAULTING: ::c_int = 0x00000080; +pub const TDP_OWEUPC: ::c_int = 0x00000200; +pub const TDP_ITHREAD: ::c_int = 0x00000400; +pub const TDP_SYNCIO: ::c_int = 0x00000800; +pub const TDP_SCHED1: ::c_int = 0x00001000; +pub const TDP_SCHED2: ::c_int = 0x00002000; +pub const TDP_SCHED3: ::c_int = 0x00004000; +pub const TDP_SCHED4: ::c_int = 0x00008000; +pub const TDP_GEOM: ::c_int = 0x00010000; +pub const TDP_SOFTDEP: ::c_int = 0x00020000; +pub const TDP_NORUNNINGBUF: ::c_int = 0x00040000; +pub const TDP_WAKEUP: ::c_int = 0x00080000; +pub const TDP_INBDFLUSH: ::c_int = 0x00100000; +pub const TDP_KTHREAD: ::c_int = 0x00200000; +pub const TDP_CALLCHAIN: ::c_int = 0x00400000; +pub const TDP_IGNSUSP: ::c_int = 0x00800000; +pub const TDP_AUDITREC: ::c_int = 0x01000000; +pub const TDP_RFPPWAIT: ::c_int = 0x02000000; +pub const TDP_RESETSPUR: ::c_int = 0x04000000; +pub const TDP_NERRNO: ::c_int = 0x08000000; +pub const TDP_EXECVMSPC: ::c_int = 0x40000000; + +pub const TDI_SUSPENDED: ::c_int = 0x0001; +pub const TDI_SLEEPING: ::c_int = 0x0002; +pub const TDI_SWAPPED: ::c_int = 0x0004; +pub const TDI_LOCK: ::c_int = 0x0008; +pub const TDI_IWAIT: ::c_int = 0x0010; + +pub const P_ADVLOCK: ::c_int = 0x00000001; +pub const P_CONTROLT: ::c_int = 0x00000002; +pub const P_KPROC: ::c_int = 0x00000004; +pub const P_UNUSED3: ::c_int = 0x00000008; +pub const P_PPWAIT: ::c_int = 0x00000010; +pub const P_PROFIL: ::c_int = 0x00000020; +pub const P_STOPPROF: ::c_int = 0x00000040; +pub const P_HADTHREADS: ::c_int = 0x00000080; +pub const P_SUGID: ::c_int = 0x00000100; +pub const P_SYSTEM: ::c_int = 0x00000200; +pub const P_SINGLE_EXIT: ::c_int = 0x00000400; +pub const P_TRACED: ::c_int = 0x00000800; +pub const P_WAITED: ::c_int = 0x00001000; +pub const P_WEXIT: ::c_int = 0x00002000; +pub const P_EXEC: ::c_int = 0x00004000; +pub const P_WKILLED: ::c_int = 0x00008000; +pub const P_CONTINUED: ::c_int = 0x00010000; +pub const P_STOPPED_SIG: ::c_int = 0x00020000; +pub const P_STOPPED_TRACE: ::c_int = 0x00040000; +pub const P_STOPPED_SINGLE: ::c_int = 0x00080000; +pub const P_PROTECTED: ::c_int = 0x00100000; +pub const P_SIGEVENT: ::c_int = 0x00200000; +pub const P_SINGLE_BOUNDARY: ::c_int = 0x00400000; +pub const P_HWPMC: ::c_int = 0x00800000; +pub const P_JAILED: ::c_int = 0x01000000; +pub const P_TOTAL_STOP: ::c_int = 0x02000000; +pub const P_INEXEC: ::c_int = 0x04000000; +pub const P_STATCHILD: ::c_int = 0x08000000; +pub const P_INMEM: ::c_int = 0x10000000; +pub const P_SWAPPINGOUT: ::c_int = 0x20000000; +pub const P_SWAPPINGIN: ::c_int = 0x40000000; +pub const P_PPTRACE: ::c_int = 0x80000000; +pub const P_STOPPED: ::c_int = P_STOPPED_SIG | P_STOPPED_SINGLE | P_STOPPED_TRACE; + +pub const P2_INHERIT_PROTECTED: ::c_int = 0x00000001; +pub const P2_NOTRACE: ::c_int = 0x00000002; +pub const P2_NOTRACE_EXEC: ::c_int = 0x00000004; +pub const P2_AST_SU: ::c_int = 0x00000008; +pub const P2_PTRACE_FSTP: ::c_int = 0x00000010; +pub const P2_TRAPCAP: ::c_int = 0x00000020; +pub const P2_STKGAP_DISABLE: ::c_int = 0x00000800; +pub const P2_STKGAP_DISABLE_EXEC: ::c_int = 0x00001000; + +pub const P_TREE_ORPHANED: ::c_int = 0x00000001; +pub const P_TREE_FIRST_ORPHAN: ::c_int = 0x00000002; +pub const P_TREE_REAPER: ::c_int = 0x00000004; + +pub const SIDL: ::c_char = 1; +pub const SRUN: ::c_char = 2; +pub const SSLEEP: ::c_char = 3; +pub const SSTOP: ::c_char = 4; +pub const SZOMB: ::c_char = 5; +pub const SWAIT: ::c_char = 6; +pub const SLOCK: ::c_char = 7; + +pub const P_MAGIC: ::c_int = 0xbeefface; + +pub const TDP_SIGFASTBLOCK: ::c_int = 0x00000100; +pub const TDP_UIOHELD: ::c_int = 0x10000000; +pub const TDP_SIGFASTPENDING: ::c_int = 0x80000000; +pub const TDP2_COMPAT32RB: ::c_int = 0x00000002; +pub const P2_PROTMAX_ENABLE: ::c_int = 0x00000200; +pub const P2_PROTMAX_DISABLE: ::c_int = 0x00000400; +pub const TDP2_SBPAGES: ::c_int = 0x00000001; +pub const P2_ASLR_ENABLE: ::c_int = 0x00000040; +pub const P2_ASLR_DISABLE: ::c_int = 0x00000080; +pub const P2_ASLR_IGNSTART: ::c_int = 0x00000100; +pub const P_TREE_GRPEXITED: ::c_int = 0x00000008; + +// libprocstat.h +pub const PS_FST_VTYPE_VNON: ::c_int = 1; +pub const PS_FST_VTYPE_VREG: ::c_int = 2; +pub const PS_FST_VTYPE_VDIR: ::c_int = 3; +pub const PS_FST_VTYPE_VBLK: ::c_int = 4; +pub const PS_FST_VTYPE_VCHR: ::c_int = 5; +pub const PS_FST_VTYPE_VLNK: ::c_int = 6; +pub const PS_FST_VTYPE_VSOCK: ::c_int = 7; +pub const PS_FST_VTYPE_VFIFO: ::c_int = 8; +pub const PS_FST_VTYPE_VBAD: ::c_int = 9; +pub const PS_FST_VTYPE_UNKNOWN: ::c_int = 255; + +pub const PS_FST_TYPE_VNODE: ::c_int = 1; +pub const PS_FST_TYPE_FIFO: ::c_int = 2; +pub const PS_FST_TYPE_SOCKET: ::c_int = 3; +pub const PS_FST_TYPE_PIPE: ::c_int = 4; +pub const PS_FST_TYPE_PTS: ::c_int = 5; +pub const PS_FST_TYPE_KQUEUE: ::c_int = 6; +pub const PS_FST_TYPE_MQUEUE: ::c_int = 8; +pub const PS_FST_TYPE_SHM: ::c_int = 9; +pub const PS_FST_TYPE_SEM: ::c_int = 10; +pub const PS_FST_TYPE_UNKNOWN: ::c_int = 11; +pub const PS_FST_TYPE_NONE: ::c_int = 12; +pub const PS_FST_TYPE_PROCDESC: ::c_int = 13; +pub const PS_FST_TYPE_DEV: ::c_int = 14; +pub const PS_FST_TYPE_EVENTFD: ::c_int = 15; + +pub const PS_FST_UFLAG_RDIR: ::c_int = 0x0001; +pub const PS_FST_UFLAG_CDIR: ::c_int = 0x0002; +pub const PS_FST_UFLAG_JAIL: ::c_int = 0x0004; +pub const PS_FST_UFLAG_TRACE: ::c_int = 0x0008; +pub const PS_FST_UFLAG_TEXT: ::c_int = 0x0010; +pub const PS_FST_UFLAG_MMAP: ::c_int = 0x0020; +pub const PS_FST_UFLAG_CTTY: ::c_int = 0x0040; + +pub const PS_FST_FFLAG_READ: ::c_int = 0x0001; +pub const PS_FST_FFLAG_WRITE: ::c_int = 0x0002; +pub const PS_FST_FFLAG_NONBLOCK: ::c_int = 0x0004; +pub const PS_FST_FFLAG_APPEND: ::c_int = 0x0008; +pub const PS_FST_FFLAG_SHLOCK: ::c_int = 0x0010; +pub const PS_FST_FFLAG_EXLOCK: ::c_int = 0x0020; +pub const PS_FST_FFLAG_ASYNC: ::c_int = 0x0040; +pub const PS_FST_FFLAG_SYNC: ::c_int = 0x0080; +pub const PS_FST_FFLAG_NOFOLLOW: ::c_int = 0x0100; +pub const PS_FST_FFLAG_CREAT: ::c_int = 0x0200; +pub const PS_FST_FFLAG_TRUNC: ::c_int = 0x0400; +pub const PS_FST_FFLAG_EXCL: ::c_int = 0x0800; +pub const PS_FST_FFLAG_DIRECT: ::c_int = 0x1000; +pub const PS_FST_FFLAG_EXEC: ::c_int = 0x2000; +pub const PS_FST_FFLAG_HASLOCK: ::c_int = 0x4000; + +// sys/mount.h + +/// File identifier. +/// These are unique per filesystem on a single machine. +/// +/// Note that the offset of fid_data is 4 bytes, so care must be taken to avoid +/// undefined behavior accessing unaligned fields within an embedded struct. +pub const MAXFIDSZ: ::c_int = 16; +/// Length of type name including null. +pub const MFSNAMELEN: ::c_int = 16; +cfg_if! { + if #[cfg(any(freebsd10, freebsd11))] { + /// Size of on/from name bufs. + pub const MNAMELEN: ::c_int = 88; + } else { + /// Size of on/from name bufs. + pub const MNAMELEN: ::c_int = 1024; + } +} + +/// Using journaled soft updates. +pub const MNT_SUJ: u64 = 0x100000000; +/// Mounted by automountd(8). +pub const MNT_AUTOMOUNTED: u64 = 0x200000000; +/// Filesys metadata untrusted. +pub const MNT_UNTRUSTED: u64 = 0x800000000; + +/// Require TLS. +pub const MNT_EXTLS: u64 = 0x4000000000; +/// Require TLS with client cert. +pub const MNT_EXTLSCERT: u64 = 0x8000000000; +/// Require TLS with user cert. +pub const MNT_EXTLSCERTUSER: u64 = 0x10000000000; + +/// Filesystem is stored locally. +pub const MNT_LOCAL: u64 = 0x000001000; +/// Quotas are enabled on fs. +pub const MNT_QUOTA: u64 = 0x000002000; +/// Identifies the root fs. +pub const MNT_ROOTFS: u64 = 0x000004000; +/// Mounted by a user. +pub const MNT_USER: u64 = 0x000008000; +/// Do not show entry in df. +pub const MNT_IGNORE: u64 = 0x000800000; +/// Filesystem is verified. +pub const MNT_VERIFIED: u64 = 0x400000000; + +/// Do not cover a mount point. +pub const MNT_NOCOVER: u64 = 0x001000000000; +/// Only mount on empty dir. +pub const MNT_EMPTYDIR: u64 = 0x002000000000; +/// Recursively unmount uppers. +pub const MNT_RECURSE: u64 = 0x100000000000; +/// Unmount in async context. +pub const MNT_DEFERRED: u64 = 0x200000000000; + +/// Get configured filesystems. +pub const VFS_VFSCONF: ::c_int = 0; +/// Generic filesystem information. +pub const VFS_GENERIC: ::c_int = 0; + +/// int: highest defined filesystem type. +pub const VFS_MAXTYPENUM: ::c_int = 1; +/// struct: vfsconf for filesystem given as next argument. +pub const VFS_CONF: ::c_int = 2; + +/// Synchronously wait for I/O to complete. +pub const MNT_WAIT: ::c_int = 1; +/// Start all I/O, but do not wait for it. +pub const MNT_NOWAIT: ::c_int = 2; +/// Push data not written by filesystem syncer. +pub const MNT_LAZY: ::c_int = 3; +/// Suspend file system after sync. +pub const MNT_SUSPEND: ::c_int = 4; + +pub const MAXSECFLAVORS: ::c_int = 5; + +/// Statically compiled into kernel. +pub const VFCF_STATIC: ::c_int = 0x00010000; +/// May get data over the network. +pub const VFCF_NETWORK: ::c_int = 0x00020000; +/// Writes are not implemented. +pub const VFCF_READONLY: ::c_int = 0x00040000; +/// Data does not represent real files. +pub const VFCF_SYNTHETIC: ::c_int = 0x00080000; +/// Aliases some other mounted FS. +pub const VFCF_LOOPBACK: ::c_int = 0x00100000; +/// Stores file names as Unicode. +pub const VFCF_UNICODE: ::c_int = 0x00200000; +/// Can be mounted from within a jail. +pub const VFCF_JAIL: ::c_int = 0x00400000; +/// Supports delegated administration. +pub const VFCF_DELEGADMIN: ::c_int = 0x00800000; +/// Stop at Boundary: defer stop requests to kernel->user (AST) transition. +pub const VFCF_SBDRY: ::c_int = 0x01000000; + +// time.h + +/// not on dst +pub const DST_NONE: ::c_int = 0; +/// USA style dst +pub const DST_USA: ::c_int = 1; +/// Australian style dst +pub const DST_AUST: ::c_int = 2; +/// Western European dst +pub const DST_WET: ::c_int = 3; +/// Middle European dst +pub const DST_MET: ::c_int = 4; +/// Eastern European dst +pub const DST_EET: ::c_int = 5; +/// Canada +pub const DST_CAN: ::c_int = 6; + +pub const CPUCLOCK_WHICH_PID: ::c_int = 0; +pub const CPUCLOCK_WHICH_TID: ::c_int = 1; + +pub const MFD_CLOEXEC: ::c_uint = 0x00000001; +pub const MFD_ALLOW_SEALING: ::c_uint = 0x00000002; +pub const MFD_HUGETLB: ::c_uint = 0x00000004; +pub const MFD_HUGE_MASK: ::c_uint = 0xFC000000; +pub const MFD_HUGE_64KB: ::c_uint = 16 << 26; +pub const MFD_HUGE_512KB: ::c_uint = 19 << 26; +pub const MFD_HUGE_1MB: ::c_uint = 20 << 26; +pub const MFD_HUGE_2MB: ::c_uint = 21 << 26; +pub const MFD_HUGE_8MB: ::c_uint = 23 << 26; +pub const MFD_HUGE_16MB: ::c_uint = 24 << 26; +pub const MFD_HUGE_32MB: ::c_uint = 25 << 26; +pub const MFD_HUGE_256MB: ::c_uint = 28 << 26; +pub const MFD_HUGE_512MB: ::c_uint = 29 << 26; +pub const MFD_HUGE_1GB: ::c_uint = 30 << 26; +pub const MFD_HUGE_2GB: ::c_uint = 31 << 26; +pub const MFD_HUGE_16GB: ::c_uint = 34 << 26; + +pub const SHM_LARGEPAGE_ALLOC_DEFAULT: ::c_int = 0; +pub const SHM_LARGEPAGE_ALLOC_NOWAIT: ::c_int = 1; +pub const SHM_LARGEPAGE_ALLOC_HARD: ::c_int = 2; +pub const SHM_RENAME_NOREPLACE: ::c_int = 1 << 0; +pub const SHM_RENAME_EXCHANGE: ::c_int = 1 << 1; + +// sys/umtx.h + +pub const UMTX_OP_WAIT: ::c_int = 2; +pub const UMTX_OP_WAKE: ::c_int = 3; +pub const UMTX_OP_MUTEX_TRYLOCK: ::c_int = 4; +pub const UMTX_OP_MUTEX_LOCK: ::c_int = 5; +pub const UMTX_OP_MUTEX_UNLOCK: ::c_int = 6; +pub const UMTX_OP_SET_CEILING: ::c_int = 7; +pub const UMTX_OP_CV_WAIT: ::c_int = 8; +pub const UMTX_OP_CV_SIGNAL: ::c_int = 9; +pub const UMTX_OP_CV_BROADCAST: ::c_int = 10; +pub const UMTX_OP_WAIT_UINT: ::c_int = 11; +pub const UMTX_OP_RW_RDLOCK: ::c_int = 12; +pub const UMTX_OP_RW_WRLOCK: ::c_int = 13; +pub const UMTX_OP_RW_UNLOCK: ::c_int = 14; +pub const UMTX_OP_WAIT_UINT_PRIVATE: ::c_int = 15; +pub const UMTX_OP_WAKE_PRIVATE: ::c_int = 16; +pub const UMTX_OP_MUTEX_WAIT: ::c_int = 17; +pub const UMTX_OP_NWAKE_PRIVATE: ::c_int = 21; +pub const UMTX_OP_MUTEX_WAKE2: ::c_int = 22; +pub const UMTX_OP_SEM2_WAIT: ::c_int = 23; +pub const UMTX_OP_SEM2_WAKE: ::c_int = 24; +pub const UMTX_OP_SHM: ::c_int = 25; +pub const UMTX_OP_ROBUST_LISTS: ::c_int = 26; + +pub const UMTX_ABSTIME: u32 = 1; + +const_fn! { + {const} fn _ALIGN(p: usize) -> usize { + (p + _ALIGNBYTES) & !_ALIGNBYTES + } +} + +f! { + pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { + (cmsg as *mut ::c_uchar) + .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) + } + + pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length + } + + pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr) + -> *mut ::cmsghdr + { + if cmsg.is_null() { + return ::CMSG_FIRSTHDR(mhdr); + }; + let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + + _ALIGN(::mem::size_of::<::cmsghdr>()); + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if next > max { + 0 as *mut ::cmsghdr + } else { + (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)) + as *mut ::cmsghdr + } + } + + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize)) + as ::c_uint + } + + pub fn MALLOCX_ALIGN(lg: ::c_uint) -> ::c_int { + ffsl(lg as ::c_long - 1) + } + + pub {const} fn MALLOCX_TCACHE(tc: ::c_int) -> ::c_int { + (tc + 2) << 8 as ::c_int + } + + pub {const} fn MALLOCX_ARENA(a: ::c_int) -> ::c_int { + (a + 1) << 20 as ::c_int + } + + pub fn SOCKCREDSIZE(ngrps: usize) -> usize { + let ngrps = if ngrps > 0 { + ngrps - 1 + } else { + 0 + }; + ::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps + } + + pub fn uname(buf: *mut ::utsname) -> ::c_int { + __xuname(256, buf as *mut ::c_void) + } + + pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () { + for slot in cpuset.__bits.iter_mut() { + *slot = 0; + } + } + + pub fn CPU_FILL(cpuset: &mut cpuset_t) -> () { + for slot in cpuset.__bits.iter_mut() { + *slot = !0; + } + } + + pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () { + let bitset_bits = 8 * ::mem::size_of::<::c_long>(); + let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); + cpuset.__bits[idx] |= 1 << offset; + () + } + + pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () { + let bitset_bits = 8 * ::mem::size_of::<::c_long>(); + let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); + cpuset.__bits[idx] &= !(1 << offset); + () + } + + pub fn CPU_ISSET(cpu: usize, cpuset: &cpuset_t) -> bool { + let bitset_bits = 8 * ::mem::size_of::<::c_long>(); + let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); + 0 != cpuset.__bits[idx] & (1 << offset) + } + + pub fn CPU_COUNT(cpuset: &cpuset_t) -> ::c_int { + let mut s: u32 = 0; + let cpuset_size = ::mem::size_of::(); + let bitset_size = ::mem::size_of::<::c_long>(); + + for i in cpuset.__bits[..(cpuset_size / bitset_size)].iter() { + s += i.count_ones(); + }; + s as ::c_int + } + + pub fn SOCKCRED2SIZE(ngrps: usize) -> usize { + let ngrps = if ngrps > 0 { + ngrps - 1 + } else { + 0 + }; + ::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps + } +} + +safe_f! { + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + (status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13 + } +} + +cfg_if! { + if #[cfg(not(any(freebsd10, freebsd11)))] { + extern "C" { + pub fn fhlink(fhp: *mut fhandle_t, to: *const ::c_char) -> ::c_int; + pub fn fhlinkat(fhp: *mut fhandle_t, tofd: ::c_int, to: *const ::c_char) -> ::c_int; + pub fn fhreadlink( + fhp: *mut fhandle_t, + buf: *mut ::c_char, + bufsize: ::size_t, + ) -> ::c_int; + pub fn getfhat( + fd: ::c_int, + path: *mut ::c_char, + fhp: *mut fhandle, + flag: ::c_int, + ) -> ::c_int; + } + } +} + +extern "C" { + #[cfg_attr(doc, doc(alias = "__errno_location"))] + #[cfg_attr(doc, doc(alias = "errno"))] + pub fn __error() -> *mut ::c_int; + + pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; + pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_readv(aiocbp: *mut ::aiocb) -> ::c_int; + pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; + pub fn aio_suspend( + aiocb_list: *const *const aiocb, + nitems: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_writev(aiocbp: *mut ::aiocb) -> ::c_int; + + pub fn devname_r( + dev: ::dev_t, + mode: ::mode_t, + buf: *mut ::c_char, + len: ::c_int, + ) -> *mut ::c_char; + + pub fn extattr_delete_fd( + fd: ::c_int, + attrnamespace: ::c_int, + attrname: *const ::c_char, + ) -> ::c_int; + pub fn extattr_delete_file( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + ) -> ::c_int; + pub fn extattr_delete_link( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + ) -> ::c_int; + pub fn extattr_get_fd( + fd: ::c_int, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_get_file( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_get_link( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_list_fd( + fd: ::c_int, + attrnamespace: ::c_int, + data: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_list_file( + path: *const ::c_char, + attrnamespace: ::c_int, + data: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_list_link( + path: *const ::c_char, + attrnamespace: ::c_int, + data: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_set_fd( + fd: ::c_int, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *const ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_set_file( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *const ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_set_link( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *const ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + + pub fn fspacectl( + fd: ::c_int, + cmd: ::c_int, + rqsr: *const spacectl_range, + flags: ::c_int, + rmsr: *mut spacectl_range, + ) -> ::c_int; + + pub fn jail(jail: *mut ::jail) -> ::c_int; + pub fn jail_attach(jid: ::c_int) -> ::c_int; + pub fn jail_remove(jid: ::c_int) -> ::c_int; + pub fn jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int; + pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int; + + pub fn lio_listio( + mode: ::c_int, + aiocb_list: *const *mut aiocb, + nitems: ::c_int, + sevp: *mut sigevent, + ) -> ::c_int; + + pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int; + pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int; + + pub fn getutxuser(user: *const ::c_char) -> *mut utmpx; + pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int; + + pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t; + pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int; + + pub fn waitid( + idtype: idtype_t, + id: ::id_t, + infop: *mut ::siginfo_t, + options: ::c_int, + ) -> ::c_int; + + pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t; + pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; + pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; + pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; + pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; + pub fn semget(key: ::key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int; + pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int; + pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int; + pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int; + pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int; + pub fn msgsnd( + msqid: ::c_int, + msgp: *const ::c_void, + msgsz: ::size_t, + msgflg: ::c_int, + ) -> ::c_int; + pub fn cfmakesane(termios: *mut ::termios); + + pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t; + pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int; + pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int; + + pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int; + + pub fn posix_spawn( + pid: *mut ::pid_t, + path: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnp( + pid: *mut ::pid_t, + file: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_getsigdefault( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigdefault( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getsigmask( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigmask( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getflags( + attr: *const posix_spawnattr_t, + flags: *mut ::c_short, + ) -> ::c_int; + pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; + pub fn posix_spawnattr_getpgroup( + attr: *const posix_spawnattr_t, + flags: *mut ::pid_t, + ) -> ::c_int; + pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; + pub fn posix_spawnattr_getschedpolicy( + attr: *const posix_spawnattr_t, + flags: *mut ::c_int, + ) -> ::c_int; + pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int; + pub fn posix_spawnattr_getschedparam( + attr: *const posix_spawnattr_t, + param: *mut ::sched_param, + ) -> ::c_int; + pub fn posix_spawnattr_setschedparam( + attr: *mut posix_spawnattr_t, + param: *const ::sched_param, + ) -> ::c_int; + + pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_addopen( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + path: *const ::c_char, + oflag: ::c_int, + mode: ::mode_t, + ) -> ::c_int; + pub fn posix_spawn_file_actions_addclose( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + ) -> ::c_int; + pub fn posix_spawn_file_actions_adddup2( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + newfd: ::c_int, + ) -> ::c_int; + + pub fn uuidgen(store: *mut uuid, count: ::c_int) -> ::c_int; + + pub fn thr_kill(id: ::c_long, sig: ::c_int) -> ::c_int; + pub fn thr_kill2(pid: ::pid_t, id: ::c_long, sig: ::c_int) -> ::c_int; + pub fn thr_self(tid: *mut ::c_long) -> ::c_int; + pub fn pthread_getthreadid_np() -> ::c_int; + pub fn pthread_getaffinity_np( + td: ::pthread_t, + cpusetsize: ::size_t, + cpusetp: *mut cpuset_t, + ) -> ::c_int; + pub fn pthread_setaffinity_np( + td: ::pthread_t, + cpusetsize: ::size_t, + cpusetp: *const cpuset_t, + ) -> ::c_int; + + // sched.h linux compatibility api + pub fn sched_getaffinity(pid: ::pid_t, cpusetsz: ::size_t, cpuset: *mut ::cpuset_t) -> ::c_int; + pub fn sched_setaffinity( + pid: ::pid_t, + cpusetsz: ::size_t, + cpuset: *const ::cpuset_t, + ) -> ::c_int; + pub fn sched_getcpu() -> ::c_int; + + pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int; + + pub fn pthread_mutexattr_getrobust( + attr: *mut ::pthread_mutexattr_t, + robust: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_mutexattr_setrobust( + attr: *mut ::pthread_mutexattr_t, + robust: ::c_int, + ) -> ::c_int; + + pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int; + + #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "statfs@FBSD_1.0")] + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "fstatfs@FBSD_1.0")] + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; + + pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int; + + pub fn sendmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::size_t, + flags: ::c_int, + ) -> ::ssize_t; + pub fn recvmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::size_t, + flags: ::c_int, + timeout: *const ::timespec, + ) -> ::ssize_t; + pub fn memmem( + haystack: *const ::c_void, + haystacklen: ::size_t, + needle: *const ::c_void, + needlelen: ::size_t, + ) -> *mut ::c_void; + + pub fn fhopen(fhp: *const fhandle_t, flags: ::c_int) -> ::c_int; + pub fn fhstat(fhp: *const fhandle, buf: *mut ::stat) -> ::c_int; + pub fn fhstatfs(fhp: *const fhandle_t, buf: *mut ::statfs) -> ::c_int; + pub fn getfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int; + pub fn lgetfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int; + pub fn getfsstat(buf: *mut ::statfs, bufsize: ::c_long, mode: ::c_int) -> ::c_int; + #[cfg_attr( + all(target_os = "freebsd", freebsd11), + link_name = "getmntinfo@FBSD_1.0" + )] + pub fn getmntinfo(mntbufp: *mut *mut ::statfs, mode: ::c_int) -> ::c_int; + pub fn mount( + type_: *const ::c_char, + dir: *const ::c_char, + flags: ::c_int, + data: *mut ::c_void, + ) -> ::c_int; + pub fn nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int; + + pub fn setproctitle(fmt: *const ::c_char, ...); + pub fn rfork(flags: ::c_int) -> ::c_int; + pub fn cpuset_getaffinity( + level: cpulevel_t, + which: cpuwhich_t, + id: ::id_t, + setsize: ::size_t, + mask: *mut cpuset_t, + ) -> ::c_int; + pub fn cpuset_setaffinity( + level: cpulevel_t, + which: cpuwhich_t, + id: ::id_t, + setsize: ::size_t, + mask: *const cpuset_t, + ) -> ::c_int; + pub fn cap_enter() -> ::c_int; + pub fn cap_getmode(modep: *mut ::c_uint) -> ::c_int; + pub fn __cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...) + -> *mut cap_rights_t; + pub fn __cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t; + pub fn __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t; + pub fn __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool; + pub fn cap_rights_is_valid(rights: *const cap_rights_t) -> bool; + pub fn cap_rights_limit(fd: ::c_int, rights: *const cap_rights_t) -> ::c_int; + pub fn cap_rights_merge(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t; + pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t) + -> *mut cap_rights_t; + pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool; + + pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; + + pub fn ffs(value: ::c_int) -> ::c_int; + pub fn ffsl(value: ::c_long) -> ::c_int; + pub fn ffsll(value: ::c_longlong) -> ::c_int; + pub fn fls(value: ::c_int) -> ::c_int; + pub fn flsl(value: ::c_long) -> ::c_int; + pub fn flsll(value: ::c_longlong) -> ::c_int; + pub fn malloc_usable_size(ptr: *const ::c_void) -> ::size_t; + pub fn malloc_stats_print( + write_cb: unsafe extern "C" fn(*mut ::c_void, *const ::c_char), + cbopaque: *mut ::c_void, + opt: *const ::c_char, + ); + pub fn mallctl( + name: *const ::c_char, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; + pub fn mallctlnametomib( + name: *const ::c_char, + mibp: *mut ::size_t, + miplen: *mut ::size_t, + ) -> ::c_int; + pub fn mallctlbymib( + mib: *const ::size_t, + mible: ::size_t, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; + pub fn mallocx(size: ::size_t, flags: ::c_int) -> *mut ::c_void; + pub fn rallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int) -> *mut ::c_void; + pub fn xallocx(ptr: *mut ::c_void, size: ::size_t, extra: ::size_t, flags: ::c_int) + -> ::size_t; + pub fn sallocx(ptr: *const ::c_void, flags: ::c_int) -> ::size_t; + pub fn dallocx(ptr: *mut ::c_void, flags: ::c_int); + pub fn sdallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int); + pub fn nallocx(size: ::size_t, flags: ::c_int) -> ::size_t; + + pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int; + + pub fn getpagesize() -> ::c_int; + pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int; + + pub fn clock_getcpuclockid2(arg1: ::id_t, arg2: ::c_int, arg3: *mut clockid_t) -> ::c_int; + + pub fn shm_create_largepage( + path: *const ::c_char, + flags: ::c_int, + psind: ::c_int, + alloc_policy: ::c_int, + mode: ::mode_t, + ) -> ::c_int; + pub fn shm_rename( + path_from: *const ::c_char, + path_to: *const ::c_char, + flags: ::c_int, + ) -> ::c_int; + pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int; + pub fn setaudit(auditinfo: *const auditinfo_t) -> ::c_int; + + pub fn _umtx_op( + obj: *mut ::c_void, + op: ::c_int, + val: ::c_ulong, + uaddr: *mut ::c_void, + uaddr2: *mut ::c_void, + ) -> ::c_int; +} + +#[link(name = "kvm")] +extern "C" { + pub fn kvm_dpcpu_setcpu(kd: *mut ::kvm_t, cpu: ::c_uint) -> ::c_int; + pub fn kvm_getargv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int) + -> *mut *mut ::c_char; + pub fn kvm_getcptime(kd: *mut ::kvm_t, cp_time: *mut ::c_long) -> ::c_int; + pub fn kvm_getenvv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int) + -> *mut *mut ::c_char; + pub fn kvm_geterr(kd: *mut ::kvm_t) -> *mut ::c_char; + pub fn kvm_getmaxcpu(kd: *mut ::kvm_t) -> ::c_int; + pub fn kvm_getncpus(kd: *mut ::kvm_t) -> ::c_int; + pub fn kvm_getpcpu(kd: *mut ::kvm_t, cpu: ::c_int) -> *mut ::c_void; + pub fn kvm_counter_u64_fetch(kd: *mut ::kvm_t, base: ::c_ulong) -> u64; + pub fn kvm_getswapinfo( + kd: *mut ::kvm_t, + info: *mut kvm_swap, + maxswap: ::c_int, + flags: ::c_int, + ) -> ::c_int; + pub fn kvm_native(kd: *mut ::kvm_t) -> ::c_int; + pub fn kvm_nlist(kd: *mut ::kvm_t, nl: *mut nlist) -> ::c_int; + pub fn kvm_nlist2(kd: *mut ::kvm_t, nl: *mut kvm_nlist) -> ::c_int; + pub fn kvm_read_zpcpu( + kd: *mut ::kvm_t, + base: ::c_ulong, + buf: *mut ::c_void, + size: ::size_t, + cpu: ::c_int, + ) -> ::ssize_t; + pub fn kvm_read2( + kd: *mut ::kvm_t, + addr: kvaddr_t, + buf: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; +} + +#[link(name = "util")] +extern "C" { + pub fn extattr_namespace_to_string( + attrnamespace: ::c_int, + string: *mut *mut ::c_char, + ) -> ::c_int; + pub fn extattr_string_to_namespace( + string: *const ::c_char, + attrnamespace: *mut ::c_int, + ) -> ::c_int; + pub fn realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int; + pub fn realhostname_sa( + host: *mut ::c_char, + hsize: ::size_t, + addr: *mut ::sockaddr, + addrlen: ::c_int, + ) -> ::c_int; + + pub fn kld_isloaded(name: *const ::c_char) -> ::c_int; + pub fn kld_load(name: *const ::c_char) -> ::c_int; + + pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry; + + pub fn hexdump(ptr: *const ::c_void, length: ::c_int, hdr: *const ::c_char, flags: ::c_int); + pub fn humanize_number( + buf: *mut ::c_char, + len: ::size_t, + number: i64, + suffix: *const ::c_char, + scale: ::c_int, + flags: ::c_int, + ) -> ::c_int; + + pub fn flopen(path: *const ::c_char, flags: ::c_int, ...) -> ::c_int; + pub fn flopenat(fd: ::c_int, path: *const ::c_char, flags: ::c_int, ...) -> ::c_int; + + pub fn getlocalbase() -> *const ::c_char; +} + +#[link(name = "procstat")] +extern "C" { + pub fn procstat_open_sysctl() -> *mut procstat; + pub fn procstat_getfiles( + procstat: *mut procstat, + kp: *mut kinfo_proc, + mmapped: ::c_int, + ) -> *mut filestat_list; + pub fn procstat_freefiles(procstat: *mut procstat, head: *mut filestat_list); + pub fn procstat_getprocs( + procstat: *mut procstat, + what: ::c_int, + arg: ::c_int, + count: *mut ::c_uint, + ) -> *mut kinfo_proc; + pub fn procstat_freeprocs(procstat: *mut procstat, p: *mut kinfo_proc); + pub fn procstat_getvmmap( + procstat: *mut procstat, + kp: *mut kinfo_proc, + count: *mut ::c_uint, + ) -> *mut kinfo_vmentry; + pub fn procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry); + pub fn procstat_close(procstat: *mut procstat); + pub fn procstat_freeargv(procstat: *mut procstat); + pub fn procstat_freeenvv(procstat: *mut procstat); + pub fn procstat_freegroups(procstat: *mut procstat, groups: *mut ::gid_t); + pub fn procstat_freeptlwpinfo(procstat: *mut procstat, pl: *mut ptrace_lwpinfo); + pub fn procstat_getargv( + procstat: *mut procstat, + kp: *mut kinfo_proc, + nchr: ::size_t, + ) -> *mut *mut ::c_char; + pub fn procstat_getenvv( + procstat: *mut procstat, + kp: *mut kinfo_proc, + nchr: ::size_t, + ) -> *mut *mut ::c_char; + pub fn procstat_getgroups( + procstat: *mut procstat, + kp: *mut kinfo_proc, + count: *mut ::c_uint, + ) -> *mut ::gid_t; + pub fn procstat_getosrel( + procstat: *mut procstat, + kp: *mut kinfo_proc, + osrelp: *mut ::c_int, + ) -> ::c_int; + pub fn procstat_getpathname( + procstat: *mut procstat, + kp: *mut kinfo_proc, + pathname: *mut ::c_char, + maxlen: ::size_t, + ) -> ::c_int; + pub fn procstat_getrlimit( + procstat: *mut procstat, + kp: *mut kinfo_proc, + which: ::c_int, + rlimit: *mut ::rlimit, + ) -> ::c_int; + pub fn procstat_getumask( + procstat: *mut procstat, + kp: *mut kinfo_proc, + maskp: *mut ::c_ushort, + ) -> ::c_int; + pub fn procstat_open_core(filename: *const ::c_char) -> *mut procstat; + pub fn procstat_open_kvm(nlistf: *const ::c_char, memf: *const ::c_char) -> *mut procstat; + pub fn procstat_get_socket_info( + proc_: *mut procstat, + fst: *mut filestat, + sock: *mut sockstat, + errbuf: *mut ::c_char, + ) -> ::c_int; + pub fn procstat_get_vnode_info( + proc_: *mut procstat, + fst: *mut filestat, + vn: *mut vnstat, + errbuf: *mut ::c_char, + ) -> ::c_int; + pub fn procstat_get_pts_info( + proc_: *mut procstat, + fst: *mut filestat, + pts: *mut ptsstat, + errbuf: *mut ::c_char, + ) -> ::c_int; + pub fn procstat_get_shm_info( + proc_: *mut procstat, + fst: *mut filestat, + shm: *mut shmstat, + errbuf: *mut ::c_char, + ) -> ::c_int; +} + +#[link(name = "rt")] +extern "C" { + pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int; + pub fn timer_delete(timerid: timer_t) -> ::c_int; + pub fn timer_getoverrun(timerid: timer_t) -> ::c_int; + pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int; + pub fn timer_settime( + timerid: timer_t, + flags: ::c_int, + value: *const itimerspec, + ovalue: *mut itimerspec, + ) -> ::c_int; +} + +#[link(name = "devstat")] +extern "C" { + pub fn devstat_getnumdevs(kd: *mut ::kvm_t) -> ::c_int; + pub fn devstat_getgeneration(kd: *mut ::kvm_t) -> ::c_long; + pub fn devstat_getversion(kd: *mut ::kvm_t) -> ::c_int; + pub fn devstat_checkversion(kd: *mut ::kvm_t) -> ::c_int; + pub fn devstat_selectdevs( + dev_select: *mut *mut device_selection, + num_selected: *mut ::c_int, + num_selections: *mut ::c_int, + select_generation: *mut ::c_long, + current_generation: ::c_long, + devices: *mut devstat, + numdevs: ::c_int, + matches: *mut devstat_match, + num_matches: ::c_int, + dev_selections: *mut *mut ::c_char, + num_dev_selections: ::c_int, + select_mode: devstat_select_mode, + maxshowdevs: ::c_int, + perf_select: ::c_int, + ) -> ::c_int; + pub fn devstat_buildmatch( + match_str: *mut ::c_char, + matches: *mut *mut devstat_match, + num_matches: *mut ::c_int, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(freebsd14)] { + mod freebsd14; + pub use self::freebsd14::*; + } else if #[cfg(freebsd13)] { + mod freebsd13; + pub use self::freebsd13::*; + } else if #[cfg(freebsd12)] { + mod freebsd12; + pub use self::freebsd12::*; + } else if #[cfg(any(freebsd10, freebsd11))] { + mod freebsd11; + pub use self::freebsd11::*; + } else { + // Unknown freebsd version + } +} + +cfg_if! { + if #[cfg(target_arch = "x86")] { + mod x86; + pub use self::x86::*; + } else if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(target_arch = "arm")] { + mod arm; + pub use self::arm::*; + } else if #[cfg(target_arch = "powerpc64")] { + mod powerpc64; + pub use self::powerpc64::*; + } else if #[cfg(target_arch = "powerpc")] { + mod powerpc; + pub use self::powerpc::*; + } else if #[cfg(target_arch = "riscv64")] { + mod riscv64; + pub use self::riscv64::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs new file mode 100644 index 0000000000000000000000000000000000000000..a0120c337e0ad0381dca64e77213ef20d5840726 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc.rs @@ -0,0 +1,47 @@ +pub type c_char = u8; +pub type c_long = i32; +pub type c_ulong = u32; +pub type wchar_t = i32; +pub type time_t = i64; +pub type suseconds_t = i32; +pub type register_t = i32; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, + pub st_gen: u32, + pub st_lspare: i32, + pub st_birthtime: ::time_t, + pub st_birthtime_nsec: ::c_long, + } +} + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 4 - 1; + } +} + +pub const MAP_32BIT: ::c_int = 0x00080000; +pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4 diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs new file mode 100644 index 0000000000000000000000000000000000000000..7f5b9752264e3dc2fbac63ecffece8c72b2843a2 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs @@ -0,0 +1,47 @@ +pub type c_char = u8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type wchar_t = i32; +pub type time_t = i64; +pub type suseconds_t = i64; +pub type register_t = i64; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, + pub st_gen: u32, + pub st_lspare: i32, + pub st_birthtime: ::time_t, + pub st_birthtime_nsec: ::c_long, + } +} + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +pub const MAP_32BIT: ::c_int = 0x00080000; +pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4 diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs new file mode 100644 index 0000000000000000000000000000000000000000..c91a8dfb253f9820d7da4aa91934f42a218a838b --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/riscv64.rs @@ -0,0 +1,154 @@ +pub type c_char = u8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type wchar_t = ::c_int; +pub type time_t = i64; +pub type suseconds_t = ::c_long; +pub type register_t = i64; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +s_no_extra_traits! { + pub struct gpregs { + pub gp_ra: ::register_t, + pub gp_sp: ::register_t, + pub gp_gp: ::register_t, + pub gp_tp: ::register_t, + pub gp_t: [::register_t; 7], + pub gp_s: [::register_t; 12], + pub gp_a: [::register_t; 8], + pub gp_sepc: ::register_t, + pub gp_sstatus: ::register_t, + } + + pub struct fpregs { + pub fp_x: [[::register_t; 2]; 32], + pub fp_fcsr: ::register_t, + pub fp_flags: ::c_int, + pub fp_pad: ::c_int, + } + + pub struct mcontext_t { + pub mc_gpregs: gpregs, + pub mc_fpregs: fpregs, + pub mc_flags: ::c_int, + pub mc_pad: ::c_int, + pub mc_spare: [u64; 8], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for gpregs { + fn eq(&self, other: &gpregs) -> bool { + self.gp_ra == other.gp_ra && + self.gp_sp == other.gp_sp && + self.gp_gp == other.gp_gp && + self.gp_tp == other.gp_tp && + self.gp_t.iter().zip(other.gp_t.iter()).all(|(a, b)| a == b) && + self.gp_s.iter().zip(other.gp_s.iter()).all(|(a, b)| a == b) && + self.gp_a.iter().zip(other.gp_a.iter()).all(|(a, b)| a == b) && + self.gp_sepc == other.gp_sepc && + self.gp_sstatus == other.gp_sstatus + } + } + impl Eq for gpregs {} + impl ::fmt::Debug for gpregs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("gpregs") + .field("gp_ra", &self.gp_ra) + .field("gp_sp", &self.gp_sp) + .field("gp_gp", &self.gp_gp) + .field("gp_tp", &self.gp_tp) + .field("gp_t", &self.gp_t) + .field("gp_s", &self.gp_s) + .field("gp_a", &self.gp_a) + .field("gp_sepc", &self.gp_sepc) + .field("gp_sstatus", &self.gp_sstatus) + .finish() + } + } + impl ::hash::Hash for gpregs { + fn hash(&self, state: &mut H) { + self.gp_ra.hash(state); + self.gp_sp.hash(state); + self.gp_gp.hash(state); + self.gp_tp.hash(state); + self.gp_t.hash(state); + self.gp_s.hash(state); + self.gp_a.hash(state); + self.gp_sepc.hash(state); + self.gp_sstatus.hash(state); + } + } + impl PartialEq for fpregs { + fn eq(&self, other: &fpregs) -> bool { + self.fp_x == other.fp_x && + self.fp_fcsr == other.fp_fcsr && + self.fp_flags == other.fp_flags && + self.fp_pad == other.fp_pad + } + } + impl Eq for fpregs {} + impl ::fmt::Debug for fpregs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fpregs") + .field("fp_x", &self.fp_x) + .field("fp_fcsr", &self.fp_fcsr) + .field("fp_flags", &self.fp_flags) + .field("fp_pad", &self.fp_pad) + .finish() + } + } + impl ::hash::Hash for fpregs { + fn hash(&self, state: &mut H) { + self.fp_x.hash(state); + self.fp_fcsr.hash(state); + self.fp_flags.hash(state); + self.fp_pad.hash(state); + } + } + impl PartialEq for mcontext_t { + fn eq(&self, other: &mcontext_t) -> bool { + self.mc_gpregs == other.mc_gpregs && + self.mc_fpregs == other.mc_fpregs && + self.mc_flags == other.mc_flags && + self.mc_pad == other.mc_pad && + self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b) + } + } + impl Eq for mcontext_t {} + impl ::fmt::Debug for mcontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mcontext_t") + .field("mc_gpregs", &self.mc_gpregs) + .field("mc_fpregs", &self.mc_fpregs) + .field("mc_flags", &self.mc_flags) + .field("mc_pad", &self.mc_pad) + .field("mc_spare", &self.mc_spare) + .finish() + } + } + impl ::hash::Hash for mcontext_t { + fn hash(&self, state: &mut H) { + self.mc_gpregs.hash(state); + self.mc_fpregs.hash(state); + self.mc_flags.hash(state); + self.mc_pad.hash(state); + self.mc_spare.hash(state); + } + } + } +} + +pub const MAP_32BIT: ::c_int = 0x00080000; +pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4 diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs new file mode 100644 index 0000000000000000000000000000000000000000..d3a3f34b0f61f7c3fb68b6fa49ce965c53d00911 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs @@ -0,0 +1,46 @@ +pub type c_char = i8; +pub type c_long = i32; +pub type c_ulong = u32; +pub type wchar_t = i32; +pub type time_t = i32; +pub type suseconds_t = i32; +pub type register_t = i32; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, + pub st_gen: u32, + pub st_lspare: i32, + pub st_birthtime: ::time_t, + pub st_birthtime_nsec: ::c_long, + __unused: [u8; 8], + } +} + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 4 - 1; + } +} +pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4 diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..3a016a05198521da7f402896f0e86de678e04036 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs @@ -0,0 +1,197 @@ +use {c_long, register_t}; + +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 4] + } + + #[repr(align(16))] + pub struct mcontext_t { + pub mc_onstack: register_t, + pub mc_rdi: register_t, + pub mc_rsi: register_t, + pub mc_rdx: register_t, + pub mc_rcx: register_t, + pub mc_r8: register_t, + pub mc_r9: register_t, + pub mc_rax: register_t, + pub mc_rbx: register_t, + pub mc_rbp: register_t, + pub mc_r10: register_t, + pub mc_r11: register_t, + pub mc_r12: register_t, + pub mc_r13: register_t, + pub mc_r14: register_t, + pub mc_r15: register_t, + pub mc_trapno: u32, + pub mc_fs: u16, + pub mc_gs: u16, + pub mc_addr: register_t, + pub mc_flags: u32, + pub mc_es: u16, + pub mc_ds: u16, + pub mc_err: register_t, + pub mc_rip: register_t, + pub mc_cs: register_t, + pub mc_rflags: register_t, + pub mc_rsp: register_t, + pub mc_ss: register_t, + pub mc_len: c_long, + pub mc_fpformat: c_long, + pub mc_ownedfp: c_long, + pub mc_fpstate: [c_long; 64], + pub mc_fsbase: register_t, + pub mc_gsbase: register_t, + pub mc_xfpustate: register_t, + pub mc_xfpustate_len: register_t, + pub mc_spare: [c_long; 4], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for mcontext_t { + fn eq(&self, other: &mcontext_t) -> bool { + self.mc_onstack == other.mc_onstack && + self.mc_rdi == other.mc_rdi && + self.mc_rsi == other.mc_rsi && + self.mc_rdx == other.mc_rdx && + self.mc_rcx == other.mc_rcx && + self.mc_r8 == other.mc_r8 && + self.mc_r9 == other.mc_r9 && + self.mc_rax == other.mc_rax && + self.mc_rbx == other.mc_rbx && + self.mc_rbp == other.mc_rbp && + self.mc_r10 == other.mc_r10 && + self.mc_r11 == other.mc_r11 && + self.mc_r12 == other.mc_r12 && + self.mc_r13 == other.mc_r13 && + self.mc_r14 == other.mc_r14 && + self.mc_r15 == other.mc_r15 && + self.mc_trapno == other.mc_trapno && + self.mc_fs == other.mc_fs && + self.mc_gs == other.mc_gs && + self.mc_addr == other.mc_addr && + self.mc_flags == other.mc_flags && + self.mc_es == other.mc_es && + self.mc_ds == other.mc_ds && + self.mc_err == other.mc_err && + self.mc_rip == other.mc_rip && + self.mc_cs == other.mc_cs && + self.mc_rflags == other.mc_rflags && + self.mc_rsp == other.mc_rsp && + self.mc_ss == other.mc_ss && + self.mc_len == other.mc_len && + self.mc_fpformat == other.mc_fpformat && + self.mc_ownedfp == other.mc_ownedfp && + self.mc_fpstate.iter().zip(other.mc_fpstate.iter()) + .all(|(a, b)| a == b) && + self.mc_fsbase == other.mc_fsbase && + self.mc_gsbase == other.mc_gsbase && + self.mc_xfpustate == other.mc_xfpustate && + self.mc_xfpustate_len == other.mc_xfpustate_len && + self.mc_spare == other.mc_spare + } + } + impl Eq for mcontext_t {} + impl ::fmt::Debug for mcontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mcontext_t") + .field("mc_onstack", &self.mc_onstack) + .field("mc_rdi", &self.mc_rdi) + .field("mc_rsi", &self.mc_rsi) + .field("mc_rdx", &self.mc_rdx) + .field("mc_rcx", &self.mc_rcx) + .field("mc_r8", &self.mc_r8) + .field("mc_r9", &self.mc_r9) + .field("mc_rax", &self.mc_rax) + .field("mc_rbx", &self.mc_rbx) + .field("mc_rbp", &self.mc_rbp) + .field("mc_r10", &self.mc_r10) + .field("mc_r11", &self.mc_r11) + .field("mc_r12", &self.mc_r12) + .field("mc_r13", &self.mc_r13) + .field("mc_r14", &self.mc_r14) + .field("mc_r15", &self.mc_r15) + .field("mc_trapno", &self.mc_trapno) + .field("mc_fs", &self.mc_fs) + .field("mc_gs", &self.mc_gs) + .field("mc_addr", &self.mc_addr) + .field("mc_flags", &self.mc_flags) + .field("mc_es", &self.mc_es) + .field("mc_ds", &self.mc_ds) + .field("mc_err", &self.mc_err) + .field("mc_rip", &self.mc_rip) + .field("mc_cs", &self.mc_cs) + .field("mc_rflags", &self.mc_rflags) + .field("mc_rsp", &self.mc_rsp) + .field("mc_ss", &self.mc_ss) + .field("mc_len", &self.mc_len) + .field("mc_fpformat", &self.mc_fpformat) + .field("mc_ownedfp", &self.mc_ownedfp) + // FIXME: .field("mc_fpstate", &self.mc_fpstate) + .field("mc_fsbase", &self.mc_fsbase) + .field("mc_gsbase", &self.mc_gsbase) + .field("mc_xfpustate", &self.mc_xfpustate) + .field("mc_xfpustate_len", &self.mc_xfpustate_len) + .field("mc_spare", &self.mc_spare) + .finish() + } + } + impl ::hash::Hash for mcontext_t { + fn hash(&self, state: &mut H) { + self.mc_onstack.hash(state); + self.mc_rdi.hash(state); + self.mc_rsi.hash(state); + self.mc_rdx.hash(state); + self.mc_rcx.hash(state); + self.mc_r8.hash(state); + self.mc_r9.hash(state); + self.mc_rax.hash(state); + self.mc_rbx.hash(state); + self.mc_rbp.hash(state); + self.mc_r10.hash(state); + self.mc_r11.hash(state); + self.mc_r12.hash(state); + self.mc_r13.hash(state); + self.mc_r14.hash(state); + self.mc_r15.hash(state); + self.mc_trapno.hash(state); + self.mc_fs.hash(state); + self.mc_gs.hash(state); + self.mc_addr.hash(state); + self.mc_flags.hash(state); + self.mc_es.hash(state); + self.mc_ds.hash(state); + self.mc_err.hash(state); + self.mc_rip.hash(state); + self.mc_cs.hash(state); + self.mc_rflags.hash(state); + self.mc_rsp.hash(state); + self.mc_ss.hash(state); + self.mc_len.hash(state); + self.mc_fpformat.hash(state); + self.mc_ownedfp.hash(state); + self.mc_fpstate.hash(state); + self.mc_fsbase.hash(state); + self.mc_gsbase.hash(state); + self.mc_xfpustate.hash(state); + self.mc_xfpustate_len.hash(state); + self.mc_spare.hash(state); + } + } + } +} + +s! { + pub struct ucontext_t { + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: ::mcontext_t, + pub uc_link: *mut ::ucontext_t, + pub uc_stack: ::stack_t, + pub uc_flags: ::c_int, + __spare__: [::c_int; 4], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..ae1fcf781047a9030b6ac15be6d70a8102d24222 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs @@ -0,0 +1,334 @@ +pub type c_char = i8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type wchar_t = i32; +pub type time_t = i64; +pub type suseconds_t = i64; +pub type register_t = i64; + +s! { + pub struct reg32 { + pub r_fs: u32, + pub r_es: u32, + pub r_ds: u32, + pub r_edi: u32, + pub r_esi: u32, + pub r_ebp: u32, + pub r_isp: u32, + pub r_ebx: u32, + pub r_edx: u32, + pub r_ecx: u32, + pub r_eax: u32, + pub r_trapno: u32, + pub r_err: u32, + pub r_eip: u32, + pub r_cs: u32, + pub r_eflags: u32, + pub r_esp: u32, + pub r_ss: u32, + pub r_gs: u32, + } + + pub struct reg { + pub r_r15: i64, + pub r_r14: i64, + pub r_r13: i64, + pub r_r12: i64, + pub r_r11: i64, + pub r_r10: i64, + pub r_r9: i64, + pub r_r8: i64, + pub r_rdi: i64, + pub r_rsi: i64, + pub r_rbp: i64, + pub r_rbx: i64, + pub r_rdx: i64, + pub r_rcx: i64, + pub r_rax: i64, + pub r_trapno: u32, + pub r_fs: u16, + pub r_gs: u16, + pub r_err: u32, + pub r_es: u16, + pub r_ds: u16, + pub r_rip: i64, + pub r_cs: i64, + pub r_rflags: i64, + pub r_rsp: i64, + pub r_ss: i64, + } +} + +s_no_extra_traits! { + pub struct fpreg32 { + pub fpr_env: [u32; 7], + pub fpr_acc: [[u8; 10]; 8], + pub fpr_ex_sw: u32, + pub fpr_pad: [u8; 64], + } + + pub struct fpreg { + pub fpr_env: [u64; 4], + pub fpr_acc: [[u8; 16]; 8], + pub fpr_xacc: [[u8; 16]; 16], + pub fpr_spare: [u64; 12], + } + + pub struct xmmreg { + pub xmm_env: [u32; 8], + pub xmm_acc: [[u8; 16]; 8], + pub xmm_reg: [[u8; 16]; 8], + pub xmm_pad: [u8; 224], + } + + #[cfg(libc_union)] + pub union __c_anonymous_elf64_auxv_union { + pub a_val: ::c_long, + pub a_ptr: *mut ::c_void, + pub a_fcn: extern "C" fn(), + } + + pub struct Elf64_Auxinfo { + pub a_type: ::c_long, + #[cfg(libc_union)] + pub a_un: __c_anonymous_elf64_auxv_union, + } + + pub struct kinfo_file { + pub kf_structsize: ::c_int, + pub kf_type: ::c_int, + pub kf_fd: ::c_int, + pub kf_ref_count: ::c_int, + pub kf_flags: ::c_int, + _kf_pad0: ::c_int, + pub kf_offset: i64, + _priv: [::uintptr_t; 38], // FIXME if needed + pub kf_status: u16, + _kf_pad1: u16, + _kf_ispare0: ::c_int, + pub kf_cap_rights: ::cap_rights_t, + _kf_cap_spare: u64, + pub kf_path: [::c_char; ::PATH_MAX as usize], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for fpreg32 { + fn eq(&self, other: &fpreg32) -> bool { + self.fpr_env == other.fpr_env && + self.fpr_acc == other.fpr_acc && + self.fpr_ex_sw == other.fpr_ex_sw && + self.fpr_pad + .iter() + .zip(other.fpr_pad.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for fpreg32 {} + impl ::fmt::Debug for fpreg32 { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fpreg32") + .field("fpr_env", &&self.fpr_env[..]) + .field("fpr_acc", &self.fpr_acc) + .field("fpr_ex_sw", &self.fpr_ex_sw) + .field("fpr_pad", &&self.fpr_pad[..]) + .finish() + } + } + impl ::hash::Hash for fpreg32 { + fn hash(&self, state: &mut H) { + self.fpr_env.hash(state); + self.fpr_acc.hash(state); + self.fpr_ex_sw.hash(state); + self.fpr_pad.hash(state); + } + } + + impl PartialEq for fpreg { + fn eq(&self, other: &fpreg) -> bool { + self.fpr_env == other.fpr_env && + self.fpr_acc == other.fpr_acc && + self.fpr_xacc == other.fpr_xacc && + self.fpr_spare == other.fpr_spare + } + } + impl Eq for fpreg {} + impl ::fmt::Debug for fpreg { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fpreg") + .field("fpr_env", &self.fpr_env) + .field("fpr_acc", &self.fpr_acc) + .field("fpr_xacc", &self.fpr_xacc) + .field("fpr_spare", &self.fpr_spare) + .finish() + } + } + impl ::hash::Hash for fpreg { + fn hash(&self, state: &mut H) { + self.fpr_env.hash(state); + self.fpr_acc.hash(state); + self.fpr_xacc.hash(state); + self.fpr_spare.hash(state); + } + } + + impl PartialEq for xmmreg { + fn eq(&self, other: &xmmreg) -> bool { + self.xmm_env == other.xmm_env && + self.xmm_acc == other.xmm_acc && + self.xmm_reg == other.xmm_reg && + self.xmm_pad + .iter() + .zip(other.xmm_pad.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for xmmreg {} + impl ::fmt::Debug for xmmreg { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("xmmreg") + .field("xmm_env", &self.xmm_env) + .field("xmm_acc", &self.xmm_acc) + .field("xmm_reg", &self.xmm_reg) + .field("xmm_pad", &&self.xmm_pad[..]) + .finish() + } + } + impl ::hash::Hash for xmmreg { + fn hash(&self, state: &mut H) { + self.xmm_env.hash(state); + self.xmm_acc.hash(state); + self.xmm_reg.hash(state); + self.xmm_pad.hash(state); + } + } + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_elf64_auxv_union { + fn eq(&self, other: &__c_anonymous_elf64_auxv_union) -> bool { + unsafe { self.a_val == other.a_val + || self.a_ptr == other.a_ptr + || self.a_fcn == other.a_fcn } + } + } + #[cfg(libc_union)] + impl Eq for __c_anonymous_elf64_auxv_union {} + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_elf64_auxv_union { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("a_val") + .field("a_val", unsafe { &self.a_val }) + .finish() + } + } + #[cfg(not(libc_union))] + impl PartialEq for Elf64_Auxinfo { + fn eq(&self, other: &Elf64_Auxinfo) -> bool { + self.a_type == other.a_type + } + } + #[cfg(libc_union)] + impl PartialEq for Elf64_Auxinfo { + fn eq(&self, other: &Elf64_Auxinfo) -> bool { + self.a_type == other.a_type + && self.a_un == other.a_un + } + } + impl Eq for Elf64_Auxinfo {} + #[cfg(not(libc_union))] + impl ::fmt::Debug for Elf64_Auxinfo { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("Elf64_Auxinfo") + .field("a_type", &self.a_type) + .finish() + } + } + #[cfg(libc_union)] + impl ::fmt::Debug for Elf64_Auxinfo { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("Elf64_Auxinfo") + .field("a_type", &self.a_type) + .field("a_un", &self.a_un) + .finish() + } + } + + impl PartialEq for kinfo_file { + fn eq(&self, other: &kinfo_file) -> bool { + self.kf_structsize == other.kf_structsize && + self.kf_type == other.kf_type && + self.kf_fd == other.kf_fd && + self.kf_ref_count == other.kf_ref_count && + self.kf_flags == other.kf_flags && + self.kf_offset == other.kf_offset && + self.kf_status == other.kf_status && + self.kf_cap_rights == other.kf_cap_rights && + self.kf_path + .iter() + .zip(other.kf_path.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for kinfo_file {} + impl ::fmt::Debug for kinfo_file { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("kinfo_file") + .field("kf_structsize", &self.kf_structsize) + .field("kf_type", &self.kf_type) + .field("kf_fd", &self.kf_fd) + .field("kf_ref_count", &self.kf_ref_count) + .field("kf_flags", &self.kf_flags) + .field("kf_offset", &self.kf_offset) + .field("kf_status", &self.kf_status) + .field("kf_cap_rights", &self.kf_cap_rights) + .field("kf_path", &&self.kf_path[..]) + .finish() + } + } + impl ::hash::Hash for kinfo_file { + fn hash(&self, state: &mut H) { + self.kf_structsize.hash(state); + self.kf_type.hash(state); + self.kf_fd.hash(state); + self.kf_ref_count.hash(state); + self.kf_flags.hash(state); + self.kf_offset.hash(state); + self.kf_status.hash(state); + self.kf_cap_rights.hash(state); + self.kf_path.hash(state); + } + } + } +} + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} +pub const MAP_32BIT: ::c_int = 0x00080000; +pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4 + +pub const _MC_HASSEGS: u32 = 0x1; +pub const _MC_HASBASES: u32 = 0x2; +pub const _MC_HASFPXSTATE: u32 = 0x4; +pub const _MC_FLAG_MASK: u32 = _MC_HASSEGS | _MC_HASBASES | _MC_HASFPXSTATE; + +pub const _MC_FPFMT_NODEV: c_long = 0x10000; +pub const _MC_FPFMT_XMM: c_long = 0x10002; +pub const _MC_FPOWNED_NONE: c_long = 0x20000; +pub const _MC_FPOWNED_FPU: c_long = 0x20001; +pub const _MC_FPOWNED_PCB: c_long = 0x20002; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..b314b68568c84d54d19d98fc2fd23c014abae994 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/freebsdlike/mod.rs @@ -0,0 +1,1845 @@ +pub type mode_t = u16; +pub type pthread_attr_t = *mut ::c_void; +pub type rlim_t = i64; +pub type pthread_mutex_t = *mut ::c_void; +pub type pthread_mutexattr_t = *mut ::c_void; +pub type pthread_cond_t = *mut ::c_void; +pub type pthread_condattr_t = *mut ::c_void; +pub type pthread_rwlock_t = *mut ::c_void; +pub type pthread_rwlockattr_t = *mut ::c_void; +pub type pthread_key_t = ::c_int; +pub type tcflag_t = ::c_uint; +pub type speed_t = ::c_uint; +pub type nl_item = ::c_int; +pub type id_t = i64; +pub type vm_size_t = ::uintptr_t; +pub type key_t = ::c_long; + +// elf.h + +pub type Elf32_Addr = u32; +pub type Elf32_Half = u16; +pub type Elf32_Lword = u64; +pub type Elf32_Off = u32; +pub type Elf32_Sword = i32; +pub type Elf32_Word = u32; + +pub type Elf64_Addr = u64; +pub type Elf64_Half = u16; +pub type Elf64_Lword = u64; +pub type Elf64_Off = u64; +pub type Elf64_Sword = i32; +pub type Elf64_Sxword = i64; +pub type Elf64_Word = u32; +pub type Elf64_Xword = u64; + +pub type iconv_t = *mut ::c_void; + +// It's an alias over "struct __kvm_t". However, its fields aren't supposed to be used directly, +// making the type definition system dependent. Better not bind it exactly. +pub type kvm_t = ::c_void; + +cfg_if! { + if #[cfg(target_pointer_width = "64")] { + type Elf_Addr = Elf64_Addr; + type Elf_Half = Elf64_Half; + type Elf_Phdr = Elf64_Phdr; + } else if #[cfg(target_pointer_width = "32")] { + type Elf_Addr = Elf32_Addr; + type Elf_Half = Elf32_Half; + type Elf_Phdr = Elf32_Phdr; + } +} + +// link.h + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { + *self + } +} + +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_void { + self.si_addr + } + + pub unsafe fn si_value(&self) -> ::sigval { + self.si_value + } + + pub unsafe fn si_pid(&self) -> ::pid_t { + self.si_pid + } + + pub unsafe fn si_uid(&self) -> ::uid_t { + self.si_uid + } + + pub unsafe fn si_status(&self) -> ::c_int { + self.si_status + } +} + +s! { + pub struct in_addr { + pub s_addr: ::in_addr_t, + } + + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct ip_mreqn { + pub imr_multiaddr: in_addr, + pub imr_address: in_addr, + pub imr_ifindex: ::c_int, + } + + pub struct ip_mreq_source { + pub imr_multiaddr: in_addr, + pub imr_sourceaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct glob_t { + pub gl_pathc: ::size_t, + pub gl_matchc: ::size_t, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + pub gl_pathv: *mut *mut ::c_char, + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + __unused6: *mut ::c_void, + __unused7: *mut ::c_void, + __unused8: *mut ::c_void, + } + + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + pub ai_addrlen: ::socklen_t, + pub ai_canonname: *mut ::c_char, + pub ai_addr: *mut ::sockaddr, + pub ai_next: *mut addrinfo, + } + + pub struct sigset_t { + bits: [u32; 4], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub si_pid: ::pid_t, + pub si_uid: ::uid_t, + pub si_status: ::c_int, + pub si_addr: *mut ::c_void, + pub si_value: ::sigval, + _pad1: ::c_long, + _pad2: [::c_int; 7], + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_flags: ::c_int, + pub sa_mask: sigset_t, + } + + pub struct sched_param { + pub sched_priority: ::c_int, + } + + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *mut ::c_void, + } + + pub struct sockaddr_in { + pub sin_len: u8, + pub sin_family: ::sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [::c_char; 8], + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_cc: [::cc_t; ::NCCS], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } + + pub struct flock { + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + pub l_type: ::c_short, + pub l_whence: ::c_short, + #[cfg(not(target_os = "dragonfly"))] + pub l_sysid: ::c_int, + } + + pub struct sf_hdtr { + pub headers: *mut ::iovec, + pub hdr_cnt: ::c_int, + pub trailers: *mut ::iovec, + pub trl_cnt: ::c_int, + } + + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } + + pub struct cmsgcred { + pub cmcred_pid: ::pid_t, + pub cmcred_uid: ::uid_t, + pub cmcred_euid: ::uid_t, + pub cmcred_gid: ::gid_t, + pub cmcred_ngroups: ::c_short, + pub cmcred_groups: [::gid_t; CMGROUP_MAX], + } + + pub struct rtprio { + pub type_: ::c_ushort, + pub prio: ::c_ushort, + } + + pub struct in6_pktinfo { + pub ipi6_addr: ::in6_addr, + pub ipi6_ifindex: ::c_uint, + } + + pub struct arphdr { + pub ar_hrd: u16, + pub ar_pro: u16, + pub ar_hln: u8, + pub ar_pln: u8, + pub ar_op: u16, + } + + pub struct timex { + pub modes: ::c_uint, + pub offset: ::c_long, + pub freq: ::c_long, + pub maxerror: ::c_long, + pub esterror: ::c_long, + pub status: ::c_int, + pub constant: ::c_long, + pub precision: ::c_long, + pub tolerance: ::c_long, + pub ppsfreq: ::c_long, + pub jitter: ::c_long, + pub shift: ::c_int, + pub stabil: ::c_long, + pub jitcnt: ::c_long, + pub calcnt: ::c_long, + pub errcnt: ::c_long, + pub stbcnt: ::c_long, + } + + pub struct ntptimeval { + pub time: ::timespec, + pub maxerror: ::c_long, + pub esterror: ::c_long, + pub tai: ::c_long, + pub time_state: ::c_int, + } + + pub struct accept_filter_arg { + pub af_name: [::c_char; 16], + af_arg: [[::c_char; 10]; 24], + } + + pub struct ptrace_io_desc { + pub piod_op: ::c_int, + pub piod_offs: *mut ::c_void, + pub piod_addr: *mut ::c_void, + pub piod_len: ::size_t, + } + + // bpf.h + + pub struct bpf_program { + pub bf_len: ::c_uint, + pub bf_insns: *mut bpf_insn, + } + + pub struct bpf_stat { + pub bs_recv: ::c_uint, + pub bs_drop: ::c_uint, + } + + pub struct bpf_version { + pub bv_major: ::c_ushort, + pub bv_minor: ::c_ushort, + } + + pub struct bpf_hdr { + pub bh_tstamp: ::timeval, + pub bh_caplen: u32, + pub bh_datalen: u32, + pub bh_hdrlen: ::c_ushort, + } + + pub struct bpf_insn { + pub code: ::c_ushort, + pub jt: ::c_uchar, + pub jf: ::c_uchar, + pub k: u32, + } + + pub struct bpf_dltlist { + bfl_len: ::c_uint, + bfl_list: *mut ::c_uint, + } + + // elf.h + + pub struct Elf32_Phdr { + pub p_type: Elf32_Word, + pub p_offset: Elf32_Off, + pub p_vaddr: Elf32_Addr, + pub p_paddr: Elf32_Addr, + pub p_filesz: Elf32_Word, + pub p_memsz: Elf32_Word, + pub p_flags: Elf32_Word, + pub p_align: Elf32_Word, + } + + pub struct Elf64_Phdr { + pub p_type: Elf64_Word, + pub p_flags: Elf64_Word, + pub p_offset: Elf64_Off, + pub p_vaddr: Elf64_Addr, + pub p_paddr: Elf64_Addr, + pub p_filesz: Elf64_Xword, + pub p_memsz: Elf64_Xword, + pub p_align: Elf64_Xword, + } + + // link.h + + pub struct dl_phdr_info { + pub dlpi_addr: Elf_Addr, + pub dlpi_name: *const ::c_char, + pub dlpi_phdr: *const Elf_Phdr, + pub dlpi_phnum: Elf_Half, + pub dlpi_adds: ::c_ulonglong, + pub dlpi_subs: ::c_ulonglong, + pub dlpi_tls_modid: usize, + pub dlpi_tls_data: *mut ::c_void, + } + + pub struct ipc_perm { + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub mode: ::mode_t, + pub seq: ::c_ushort, + pub key: ::key_t, + } +} + +s_no_extra_traits! { + pub struct sockaddr_storage { + pub ss_len: u8, + pub ss_family: ::sa_family_t, + __ss_pad1: [u8; 6], + __ss_align: i64, + __ss_pad2: [u8; 112], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for sockaddr_storage { + fn eq(&self, other: &sockaddr_storage) -> bool { + self.ss_len == other.ss_len + && self.ss_family == other.ss_family + && self.__ss_pad1 == other.__ss_pad1 + && self.__ss_align == other.__ss_align + && self + .__ss_pad2 + .iter() + .zip(other.__ss_pad2.iter()) + .all(|(a, b)| a == b) + } + } + impl Eq for sockaddr_storage {} + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("ss_len", &self.ss_len) + .field("ss_family", &self.ss_family) + .field("__ss_pad1", &self.__ss_pad1) + .field("__ss_align", &self.__ss_align) + // FIXME: .field("__ss_pad2", &self.__ss_pad2) + .finish() + } + } + impl ::hash::Hash for sockaddr_storage { + fn hash(&self, state: &mut H) { + self.ss_len.hash(state); + self.ss_family.hash(state); + self.__ss_pad1.hash(state); + self.__ss_align.hash(state); + self.__ss_pad2.hash(state); + } + } + } +} + +// Non-public helper constant +cfg_if! { + if #[cfg(all(not(libc_const_size_of), target_pointer_width = "32"))] { + const SIZEOF_LONG: usize = 4; + } else if #[cfg(all(not(libc_const_size_of), target_pointer_width = "64"))] { + const SIZEOF_LONG: usize = 8; + } else if #[cfg(libc_const_size_of)] { + const SIZEOF_LONG: usize = ::mem::size_of::<::c_long>(); + } +} + +#[deprecated( + since = "0.2.64", + note = "Can vary at runtime. Use sysconf(3) instead" +)] +pub const AIO_LISTIO_MAX: ::c_int = 16; +pub const AIO_CANCELED: ::c_int = 1; +pub const AIO_NOTCANCELED: ::c_int = 2; +pub const AIO_ALLDONE: ::c_int = 3; +pub const LIO_NOP: ::c_int = 0; +pub const LIO_WRITE: ::c_int = 1; +pub const LIO_READ: ::c_int = 2; +pub const LIO_WAIT: ::c_int = 1; +pub const LIO_NOWAIT: ::c_int = 0; + +pub const SIGEV_NONE: ::c_int = 0; +pub const SIGEV_SIGNAL: ::c_int = 1; +pub const SIGEV_THREAD: ::c_int = 2; +pub const SIGEV_KEVENT: ::c_int = 3; + +pub const CODESET: ::nl_item = 0; +pub const D_T_FMT: ::nl_item = 1; +pub const D_FMT: ::nl_item = 2; +pub const T_FMT: ::nl_item = 3; +pub const T_FMT_AMPM: ::nl_item = 4; +pub const AM_STR: ::nl_item = 5; +pub const PM_STR: ::nl_item = 6; + +pub const DAY_1: ::nl_item = 7; +pub const DAY_2: ::nl_item = 8; +pub const DAY_3: ::nl_item = 9; +pub const DAY_4: ::nl_item = 10; +pub const DAY_5: ::nl_item = 11; +pub const DAY_6: ::nl_item = 12; +pub const DAY_7: ::nl_item = 13; + +pub const ABDAY_1: ::nl_item = 14; +pub const ABDAY_2: ::nl_item = 15; +pub const ABDAY_3: ::nl_item = 16; +pub const ABDAY_4: ::nl_item = 17; +pub const ABDAY_5: ::nl_item = 18; +pub const ABDAY_6: ::nl_item = 19; +pub const ABDAY_7: ::nl_item = 20; + +pub const MON_1: ::nl_item = 21; +pub const MON_2: ::nl_item = 22; +pub const MON_3: ::nl_item = 23; +pub const MON_4: ::nl_item = 24; +pub const MON_5: ::nl_item = 25; +pub const MON_6: ::nl_item = 26; +pub const MON_7: ::nl_item = 27; +pub const MON_8: ::nl_item = 28; +pub const MON_9: ::nl_item = 29; +pub const MON_10: ::nl_item = 30; +pub const MON_11: ::nl_item = 31; +pub const MON_12: ::nl_item = 32; + +pub const ABMON_1: ::nl_item = 33; +pub const ABMON_2: ::nl_item = 34; +pub const ABMON_3: ::nl_item = 35; +pub const ABMON_4: ::nl_item = 36; +pub const ABMON_5: ::nl_item = 37; +pub const ABMON_6: ::nl_item = 38; +pub const ABMON_7: ::nl_item = 39; +pub const ABMON_8: ::nl_item = 40; +pub const ABMON_9: ::nl_item = 41; +pub const ABMON_10: ::nl_item = 42; +pub const ABMON_11: ::nl_item = 43; +pub const ABMON_12: ::nl_item = 44; + +pub const ERA: ::nl_item = 45; +pub const ERA_D_FMT: ::nl_item = 46; +pub const ERA_D_T_FMT: ::nl_item = 47; +pub const ERA_T_FMT: ::nl_item = 48; +pub const ALT_DIGITS: ::nl_item = 49; + +pub const RADIXCHAR: ::nl_item = 50; +pub const THOUSEP: ::nl_item = 51; + +pub const YESEXPR: ::nl_item = 52; +pub const NOEXPR: ::nl_item = 53; + +pub const YESSTR: ::nl_item = 54; +pub const NOSTR: ::nl_item = 55; + +pub const CRNCYSTR: ::nl_item = 56; + +pub const D_MD_ORDER: ::nl_item = 57; + +pub const ALTMON_1: ::nl_item = 58; +pub const ALTMON_2: ::nl_item = 59; +pub const ALTMON_3: ::nl_item = 60; +pub const ALTMON_4: ::nl_item = 61; +pub const ALTMON_5: ::nl_item = 62; +pub const ALTMON_6: ::nl_item = 63; +pub const ALTMON_7: ::nl_item = 64; +pub const ALTMON_8: ::nl_item = 65; +pub const ALTMON_9: ::nl_item = 66; +pub const ALTMON_10: ::nl_item = 67; +pub const ALTMON_11: ::nl_item = 68; +pub const ALTMON_12: ::nl_item = 69; + +pub const EXIT_FAILURE: ::c_int = 1; +pub const EXIT_SUCCESS: ::c_int = 0; +pub const EOF: ::c_int = -1; +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; +pub const SEEK_DATA: ::c_int = 3; +pub const SEEK_HOLE: ::c_int = 4; +pub const _IOFBF: ::c_int = 0; +pub const _IONBF: ::c_int = 2; +pub const _IOLBF: ::c_int = 1; +pub const BUFSIZ: ::c_uint = 1024; +pub const FOPEN_MAX: ::c_uint = 20; +pub const FILENAME_MAX: ::c_uint = 1024; +pub const L_tmpnam: ::c_uint = 1024; +pub const TMP_MAX: ::c_uint = 308915776; + +pub const O_NOCTTY: ::c_int = 32768; +pub const O_DIRECT: ::c_int = 0x00010000; + +pub const S_IFIFO: mode_t = 4096; +pub const S_IFCHR: mode_t = 8192; +pub const S_IFBLK: mode_t = 24576; +pub const S_IFDIR: mode_t = 16384; +pub const S_IFREG: mode_t = 32768; +pub const S_IFLNK: mode_t = 40960; +pub const S_IFSOCK: mode_t = 49152; +pub const S_IFMT: mode_t = 61440; +pub const S_IEXEC: mode_t = 64; +pub const S_IWRITE: mode_t = 128; +pub const S_IREAD: mode_t = 256; +pub const S_IRWXU: mode_t = 448; +pub const S_IXUSR: mode_t = 64; +pub const S_IWUSR: mode_t = 128; +pub const S_IRUSR: mode_t = 256; +pub const S_IRWXG: mode_t = 56; +pub const S_IXGRP: mode_t = 8; +pub const S_IWGRP: mode_t = 16; +pub const S_IRGRP: mode_t = 32; +pub const S_IRWXO: mode_t = 7; +pub const S_IXOTH: mode_t = 1; +pub const S_IWOTH: mode_t = 2; +pub const S_IROTH: mode_t = 4; +pub const F_OK: ::c_int = 0; +pub const R_OK: ::c_int = 4; +pub const W_OK: ::c_int = 2; +pub const X_OK: ::c_int = 1; +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; +pub const F_LOCK: ::c_int = 1; +pub const F_TEST: ::c_int = 3; +pub const F_TLOCK: ::c_int = 2; +pub const F_ULOCK: ::c_int = 0; +pub const F_DUPFD_CLOEXEC: ::c_int = 17; +pub const F_DUP2FD: ::c_int = 10; +pub const F_DUP2FD_CLOEXEC: ::c_int = 18; +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGABRT: ::c_int = 6; +pub const SIGEMT: ::c_int = 7; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGSEGV: ::c_int = 11; +pub const SIGPIPE: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; + +pub const PROT_NONE: ::c_int = 0; +pub const PROT_READ: ::c_int = 1; +pub const PROT_WRITE: ::c_int = 2; +pub const PROT_EXEC: ::c_int = 4; + +pub const MAP_FILE: ::c_int = 0x0000; +pub const MAP_SHARED: ::c_int = 0x0001; +pub const MAP_PRIVATE: ::c_int = 0x0002; +pub const MAP_FIXED: ::c_int = 0x0010; +pub const MAP_ANON: ::c_int = 0x1000; +pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; + +pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const MNT_NOATIME: ::c_int = 0x10000000; +pub const MNT_NOCLUSTERR: ::c_int = 0x40000000; +pub const MNT_NOCLUSTERW: ::c_int = 0x80000000; +pub const MNT_NOSYMFOLLOW: ::c_int = 0x00400000; +pub const MNT_SOFTDEP: ::c_int = 0x00200000; +pub const MNT_SUIDDIR: ::c_int = 0x00100000; +pub const MNT_EXRDONLY: ::c_int = 0x00000080; +pub const MNT_DEFEXPORTED: ::c_int = 0x00000200; +pub const MNT_EXPORTANON: ::c_int = 0x00000400; +pub const MNT_EXKERB: ::c_int = 0x00000800; +pub const MNT_DELEXPORT: ::c_int = 0x00020000; + +pub const MS_SYNC: ::c_int = 0x0000; +pub const MS_ASYNC: ::c_int = 0x0001; +pub const MS_INVALIDATE: ::c_int = 0x0002; + +pub const EPERM: ::c_int = 1; +pub const ENOENT: ::c_int = 2; +pub const ESRCH: ::c_int = 3; +pub const EINTR: ::c_int = 4; +pub const EIO: ::c_int = 5; +pub const ENXIO: ::c_int = 6; +pub const E2BIG: ::c_int = 7; +pub const ENOEXEC: ::c_int = 8; +pub const EBADF: ::c_int = 9; +pub const ECHILD: ::c_int = 10; +pub const EDEADLK: ::c_int = 11; +pub const ENOMEM: ::c_int = 12; +pub const EACCES: ::c_int = 13; +pub const EFAULT: ::c_int = 14; +pub const ENOTBLK: ::c_int = 15; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENFILE: ::c_int = 23; +pub const EMFILE: ::c_int = 24; +pub const ENOTTY: ::c_int = 25; +pub const ETXTBSY: ::c_int = 26; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDOM: ::c_int = 33; +pub const ERANGE: ::c_int = 34; +pub const EAGAIN: ::c_int = 35; +pub const EWOULDBLOCK: ::c_int = 35; +pub const EINPROGRESS: ::c_int = 36; +pub const EALREADY: ::c_int = 37; +pub const ENOTSOCK: ::c_int = 38; +pub const EDESTADDRREQ: ::c_int = 39; +pub const EMSGSIZE: ::c_int = 40; +pub const EPROTOTYPE: ::c_int = 41; +pub const ENOPROTOOPT: ::c_int = 42; +pub const EPROTONOSUPPORT: ::c_int = 43; +pub const ESOCKTNOSUPPORT: ::c_int = 44; +pub const EOPNOTSUPP: ::c_int = 45; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 46; +pub const EAFNOSUPPORT: ::c_int = 47; +pub const EADDRINUSE: ::c_int = 48; +pub const EADDRNOTAVAIL: ::c_int = 49; +pub const ENETDOWN: ::c_int = 50; +pub const ENETUNREACH: ::c_int = 51; +pub const ENETRESET: ::c_int = 52; +pub const ECONNABORTED: ::c_int = 53; +pub const ECONNRESET: ::c_int = 54; +pub const ENOBUFS: ::c_int = 55; +pub const EISCONN: ::c_int = 56; +pub const ENOTCONN: ::c_int = 57; +pub const ESHUTDOWN: ::c_int = 58; +pub const ETOOMANYREFS: ::c_int = 59; +pub const ETIMEDOUT: ::c_int = 60; +pub const ECONNREFUSED: ::c_int = 61; +pub const ELOOP: ::c_int = 62; +pub const ENAMETOOLONG: ::c_int = 63; +pub const EHOSTDOWN: ::c_int = 64; +pub const EHOSTUNREACH: ::c_int = 65; +pub const ENOTEMPTY: ::c_int = 66; +pub const EPROCLIM: ::c_int = 67; +pub const EUSERS: ::c_int = 68; +pub const EDQUOT: ::c_int = 69; +pub const ESTALE: ::c_int = 70; +pub const EREMOTE: ::c_int = 71; +pub const EBADRPC: ::c_int = 72; +pub const ERPCMISMATCH: ::c_int = 73; +pub const EPROGUNAVAIL: ::c_int = 74; +pub const EPROGMISMATCH: ::c_int = 75; +pub const EPROCUNAVAIL: ::c_int = 76; +pub const ENOLCK: ::c_int = 77; +pub const ENOSYS: ::c_int = 78; +pub const EFTYPE: ::c_int = 79; +pub const EAUTH: ::c_int = 80; +pub const ENEEDAUTH: ::c_int = 81; +pub const EIDRM: ::c_int = 82; +pub const ENOMSG: ::c_int = 83; +pub const EOVERFLOW: ::c_int = 84; +pub const ECANCELED: ::c_int = 85; +pub const EILSEQ: ::c_int = 86; +pub const ENOATTR: ::c_int = 87; +pub const EDOOFUS: ::c_int = 88; +pub const EBADMSG: ::c_int = 89; +pub const EMULTIHOP: ::c_int = 90; +pub const ENOLINK: ::c_int = 91; +pub const EPROTO: ::c_int = 92; + +pub const POLLSTANDARD: ::c_short = ::POLLIN + | ::POLLPRI + | ::POLLOUT + | ::POLLRDNORM + | ::POLLRDBAND + | ::POLLWRBAND + | ::POLLERR + | ::POLLHUP + | ::POLLNVAL; + +pub const AI_PASSIVE: ::c_int = 0x00000001; +pub const AI_CANONNAME: ::c_int = 0x00000002; +pub const AI_NUMERICHOST: ::c_int = 0x00000004; +pub const AI_NUMERICSERV: ::c_int = 0x00000008; +pub const AI_ALL: ::c_int = 0x00000100; +pub const AI_ADDRCONFIG: ::c_int = 0x00000400; +pub const AI_V4MAPPED: ::c_int = 0x00000800; + +pub const EAI_AGAIN: ::c_int = 2; +pub const EAI_BADFLAGS: ::c_int = 3; +pub const EAI_FAIL: ::c_int = 4; +pub const EAI_FAMILY: ::c_int = 5; +pub const EAI_MEMORY: ::c_int = 6; +pub const EAI_NONAME: ::c_int = 8; +pub const EAI_SERVICE: ::c_int = 9; +pub const EAI_SOCKTYPE: ::c_int = 10; +pub const EAI_SYSTEM: ::c_int = 11; +pub const EAI_OVERFLOW: ::c_int = 14; + +pub const F_DUPFD: ::c_int = 0; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; + +pub const SIGTRAP: ::c_int = 5; + +pub const GLOB_APPEND: ::c_int = 0x0001; +pub const GLOB_DOOFFS: ::c_int = 0x0002; +pub const GLOB_ERR: ::c_int = 0x0004; +pub const GLOB_MARK: ::c_int = 0x0008; +pub const GLOB_NOCHECK: ::c_int = 0x0010; +pub const GLOB_NOSORT: ::c_int = 0x0020; +pub const GLOB_NOESCAPE: ::c_int = 0x2000; + +pub const GLOB_NOSPACE: ::c_int = -1; +pub const GLOB_ABORTED: ::c_int = -2; +pub const GLOB_NOMATCH: ::c_int = -3; + +pub const POSIX_MADV_NORMAL: ::c_int = 0; +pub const POSIX_MADV_RANDOM: ::c_int = 1; +pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_MADV_WILLNEED: ::c_int = 3; +pub const POSIX_MADV_DONTNEED: ::c_int = 4; + +pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0; +pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; +pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; +pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; + +pub const RLIMIT_CPU: ::c_int = 0; +pub const RLIMIT_FSIZE: ::c_int = 1; +pub const RLIMIT_DATA: ::c_int = 2; +pub const RLIMIT_STACK: ::c_int = 3; +pub const RLIMIT_CORE: ::c_int = 4; +pub const RLIMIT_RSS: ::c_int = 5; +pub const RLIMIT_MEMLOCK: ::c_int = 6; +pub const RLIMIT_NPROC: ::c_int = 7; +pub const RLIMIT_NOFILE: ::c_int = 8; +pub const RLIMIT_SBSIZE: ::c_int = 9; +pub const RLIMIT_VMEM: ::c_int = 10; +pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM; +pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; + +pub const RUSAGE_SELF: ::c_int = 0; +pub const RUSAGE_CHILDREN: ::c_int = -1; + +pub const CLOCK_REALTIME: ::clockid_t = 0; +pub const CLOCK_VIRTUAL: ::clockid_t = 1; +pub const CLOCK_PROF: ::clockid_t = 2; +pub const CLOCK_MONOTONIC: ::clockid_t = 4; +pub const CLOCK_UPTIME: ::clockid_t = 5; +pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7; +pub const CLOCK_UPTIME_FAST: ::clockid_t = 8; +pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9; +pub const CLOCK_REALTIME_FAST: ::clockid_t = 10; +pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11; +pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12; +pub const CLOCK_SECOND: ::clockid_t = 13; +pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14; +pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15; + +pub const MADV_NORMAL: ::c_int = 0; +pub const MADV_RANDOM: ::c_int = 1; +pub const MADV_SEQUENTIAL: ::c_int = 2; +pub const MADV_WILLNEED: ::c_int = 3; +pub const MADV_DONTNEED: ::c_int = 4; +pub const MADV_FREE: ::c_int = 5; +pub const MADV_NOSYNC: ::c_int = 6; +pub const MADV_AUTOSYNC: ::c_int = 7; +pub const MADV_NOCORE: ::c_int = 8; +pub const MADV_CORE: ::c_int = 9; + +pub const MINCORE_INCORE: ::c_int = 0x1; +pub const MINCORE_REFERENCED: ::c_int = 0x2; +pub const MINCORE_MODIFIED: ::c_int = 0x4; +pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8; +pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10; + +pub const AF_UNSPEC: ::c_int = 0; +pub const AF_LOCAL: ::c_int = 1; +pub const AF_UNIX: ::c_int = AF_LOCAL; +pub const AF_INET: ::c_int = 2; +pub const AF_IMPLINK: ::c_int = 3; +pub const AF_PUP: ::c_int = 4; +pub const AF_CHAOS: ::c_int = 5; +pub const AF_NETBIOS: ::c_int = 6; +pub const AF_ISO: ::c_int = 7; +pub const AF_OSI: ::c_int = AF_ISO; +pub const AF_ECMA: ::c_int = 8; +pub const AF_DATAKIT: ::c_int = 9; +pub const AF_CCITT: ::c_int = 10; +pub const AF_SNA: ::c_int = 11; +pub const AF_DECnet: ::c_int = 12; +pub const AF_DLI: ::c_int = 13; +pub const AF_LAT: ::c_int = 14; +pub const AF_HYLINK: ::c_int = 15; +pub const AF_APPLETALK: ::c_int = 16; +pub const AF_ROUTE: ::c_int = 17; +pub const AF_LINK: ::c_int = 18; +pub const pseudo_AF_XTP: ::c_int = 19; +pub const AF_COIP: ::c_int = 20; +pub const AF_CNT: ::c_int = 21; +pub const pseudo_AF_RTIP: ::c_int = 22; +pub const AF_IPX: ::c_int = 23; +pub const AF_SIP: ::c_int = 24; +pub const pseudo_AF_PIP: ::c_int = 25; +pub const AF_ISDN: ::c_int = 26; +pub const AF_E164: ::c_int = AF_ISDN; +pub const pseudo_AF_KEY: ::c_int = 27; +pub const AF_INET6: ::c_int = 28; +pub const AF_NATM: ::c_int = 29; +pub const AF_ATM: ::c_int = 30; +pub const pseudo_AF_HDRCMPLT: ::c_int = 31; +pub const AF_NETGRAPH: ::c_int = 32; + +pub const PF_UNSPEC: ::c_int = AF_UNSPEC; +pub const PF_LOCAL: ::c_int = AF_LOCAL; +pub const PF_UNIX: ::c_int = PF_LOCAL; +pub const PF_INET: ::c_int = AF_INET; +pub const PF_IMPLINK: ::c_int = AF_IMPLINK; +pub const PF_PUP: ::c_int = AF_PUP; +pub const PF_CHAOS: ::c_int = AF_CHAOS; +pub const PF_NETBIOS: ::c_int = AF_NETBIOS; +pub const PF_ISO: ::c_int = AF_ISO; +pub const PF_OSI: ::c_int = AF_ISO; +pub const PF_ECMA: ::c_int = AF_ECMA; +pub const PF_DATAKIT: ::c_int = AF_DATAKIT; +pub const PF_CCITT: ::c_int = AF_CCITT; +pub const PF_SNA: ::c_int = AF_SNA; +pub const PF_DECnet: ::c_int = AF_DECnet; +pub const PF_DLI: ::c_int = AF_DLI; +pub const PF_LAT: ::c_int = AF_LAT; +pub const PF_HYLINK: ::c_int = AF_HYLINK; +pub const PF_APPLETALK: ::c_int = AF_APPLETALK; +pub const PF_ROUTE: ::c_int = AF_ROUTE; +pub const PF_LINK: ::c_int = AF_LINK; +pub const PF_XTP: ::c_int = pseudo_AF_XTP; +pub const PF_COIP: ::c_int = AF_COIP; +pub const PF_CNT: ::c_int = AF_CNT; +pub const PF_SIP: ::c_int = AF_SIP; +pub const PF_IPX: ::c_int = AF_IPX; +pub const PF_RTIP: ::c_int = pseudo_AF_RTIP; +pub const PF_PIP: ::c_int = pseudo_AF_PIP; +pub const PF_ISDN: ::c_int = AF_ISDN; +pub const PF_KEY: ::c_int = pseudo_AF_KEY; +pub const PF_INET6: ::c_int = AF_INET6; +pub const PF_NATM: ::c_int = AF_NATM; +pub const PF_ATM: ::c_int = AF_ATM; +pub const PF_NETGRAPH: ::c_int = AF_NETGRAPH; + +pub const PIOD_READ_D: ::c_int = 1; +pub const PIOD_WRITE_D: ::c_int = 2; +pub const PIOD_READ_I: ::c_int = 3; +pub const PIOD_WRITE_I: ::c_int = 4; + +pub const PT_TRACE_ME: ::c_int = 0; +pub const PT_READ_I: ::c_int = 1; +pub const PT_READ_D: ::c_int = 2; +pub const PT_WRITE_I: ::c_int = 4; +pub const PT_WRITE_D: ::c_int = 5; +pub const PT_CONTINUE: ::c_int = 7; +pub const PT_KILL: ::c_int = 8; +pub const PT_STEP: ::c_int = 9; +pub const PT_ATTACH: ::c_int = 10; +pub const PT_DETACH: ::c_int = 11; +pub const PT_IO: ::c_int = 12; + +pub const SOMAXCONN: ::c_int = 128; + +pub const MSG_OOB: ::c_int = 0x00000001; +pub const MSG_PEEK: ::c_int = 0x00000002; +pub const MSG_DONTROUTE: ::c_int = 0x00000004; +pub const MSG_EOR: ::c_int = 0x00000008; +pub const MSG_TRUNC: ::c_int = 0x00000010; +pub const MSG_CTRUNC: ::c_int = 0x00000020; +pub const MSG_WAITALL: ::c_int = 0x00000040; +pub const MSG_DONTWAIT: ::c_int = 0x00000080; +pub const MSG_EOF: ::c_int = 0x00000100; + +pub const SCM_TIMESTAMP: ::c_int = 0x02; +pub const SCM_CREDS: ::c_int = 0x03; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_RAW: ::c_int = 3; +pub const SOCK_RDM: ::c_int = 4; +pub const SOCK_SEQPACKET: ::c_int = 5; +pub const SOCK_CLOEXEC: ::c_int = 0x10000000; +pub const SOCK_NONBLOCK: ::c_int = 0x20000000; +pub const SOCK_MAXADDRLEN: ::c_int = 255; +pub const IP_TTL: ::c_int = 4; +pub const IP_HDRINCL: ::c_int = 2; +pub const IP_RECVDSTADDR: ::c_int = 7; +pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR; +pub const IP_ADD_MEMBERSHIP: ::c_int = 12; +pub const IP_DROP_MEMBERSHIP: ::c_int = 13; +pub const IP_RECVIF: ::c_int = 20; +pub const IPV6_JOIN_GROUP: ::c_int = 12; +pub const IPV6_LEAVE_GROUP: ::c_int = 13; +pub const IPV6_CHECKSUM: ::c_int = 26; +pub const IPV6_RECVPKTINFO: ::c_int = 36; +pub const IPV6_PKTINFO: ::c_int = 46; +pub const IPV6_HOPLIMIT: ::c_int = 47; +pub const IPV6_RECVTCLASS: ::c_int = 57; +pub const IPV6_TCLASS: ::c_int = 61; +pub const IPV6_DONTFRAG: ::c_int = 62; +pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70; +pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71; +pub const IP_BLOCK_SOURCE: ::c_int = 72; +pub const IP_UNBLOCK_SOURCE: ::c_int = 73; + +pub const TCP_NOPUSH: ::c_int = 4; +pub const TCP_NOOPT: ::c_int = 8; +pub const TCP_KEEPIDLE: ::c_int = 256; +pub const TCP_KEEPINTVL: ::c_int = 512; +pub const TCP_KEEPCNT: ::c_int = 1024; + +pub const SOL_SOCKET: ::c_int = 0xffff; +pub const SO_DEBUG: ::c_int = 0x01; +pub const SO_ACCEPTCONN: ::c_int = 0x0002; +pub const SO_REUSEADDR: ::c_int = 0x0004; +pub const SO_KEEPALIVE: ::c_int = 0x0008; +pub const SO_DONTROUTE: ::c_int = 0x0010; +pub const SO_BROADCAST: ::c_int = 0x0020; +pub const SO_USELOOPBACK: ::c_int = 0x0040; +pub const SO_LINGER: ::c_int = 0x0080; +pub const SO_OOBINLINE: ::c_int = 0x0100; +pub const SO_REUSEPORT: ::c_int = 0x0200; +pub const SO_TIMESTAMP: ::c_int = 0x0400; +pub const SO_NOSIGPIPE: ::c_int = 0x0800; +pub const SO_ACCEPTFILTER: ::c_int = 0x1000; +pub const SO_SNDBUF: ::c_int = 0x1001; +pub const SO_RCVBUF: ::c_int = 0x1002; +pub const SO_SNDLOWAT: ::c_int = 0x1003; +pub const SO_RCVLOWAT: ::c_int = 0x1004; +pub const SO_SNDTIMEO: ::c_int = 0x1005; +pub const SO_RCVTIMEO: ::c_int = 0x1006; +pub const SO_ERROR: ::c_int = 0x1007; +pub const SO_TYPE: ::c_int = 0x1008; + +pub const LOCAL_PEERCRED: ::c_int = 1; + +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; + +pub const LOCK_SH: ::c_int = 1; +pub const LOCK_EX: ::c_int = 2; +pub const LOCK_NB: ::c_int = 4; +pub const LOCK_UN: ::c_int = 8; + +pub const MAP_COPY: ::c_int = 0x0002; +#[doc(hidden)] +#[deprecated( + since = "0.2.54", + note = "Removed in FreeBSD 11, unused in DragonFlyBSD" +)] +pub const MAP_RENAME: ::c_int = 0x0020; +#[doc(hidden)] +#[deprecated( + since = "0.2.54", + note = "Removed in FreeBSD 11, unused in DragonFlyBSD" +)] +pub const MAP_NORESERVE: ::c_int = 0x0040; +pub const MAP_HASSEMAPHORE: ::c_int = 0x0200; +pub const MAP_STACK: ::c_int = 0x0400; +pub const MAP_NOSYNC: ::c_int = 0x0800; +pub const MAP_NOCORE: ::c_int = 0x020000; + +pub const IPPROTO_RAW: ::c_int = 255; + +pub const _PC_LINK_MAX: ::c_int = 1; +pub const _PC_MAX_CANON: ::c_int = 2; +pub const _PC_MAX_INPUT: ::c_int = 3; +pub const _PC_NAME_MAX: ::c_int = 4; +pub const _PC_PATH_MAX: ::c_int = 5; +pub const _PC_PIPE_BUF: ::c_int = 6; +pub const _PC_CHOWN_RESTRICTED: ::c_int = 7; +pub const _PC_NO_TRUNC: ::c_int = 8; +pub const _PC_VDISABLE: ::c_int = 9; +pub const _PC_ALLOC_SIZE_MIN: ::c_int = 10; +pub const _PC_FILESIZEBITS: ::c_int = 12; +pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14; +pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15; +pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16; +pub const _PC_REC_XFER_ALIGN: ::c_int = 17; +pub const _PC_SYMLINK_MAX: ::c_int = 18; +pub const _PC_MIN_HOLE_SIZE: ::c_int = 21; +pub const _PC_ASYNC_IO: ::c_int = 53; +pub const _PC_PRIO_IO: ::c_int = 54; +pub const _PC_SYNC_IO: ::c_int = 55; +pub const _PC_ACL_EXTENDED: ::c_int = 59; +pub const _PC_ACL_PATH_MAX: ::c_int = 60; +pub const _PC_CAP_PRESENT: ::c_int = 61; +pub const _PC_INF_PRESENT: ::c_int = 62; +pub const _PC_MAC_PRESENT: ::c_int = 63; + +pub const _SC_ARG_MAX: ::c_int = 1; +pub const _SC_CHILD_MAX: ::c_int = 2; +pub const _SC_CLK_TCK: ::c_int = 3; +pub const _SC_NGROUPS_MAX: ::c_int = 4; +pub const _SC_OPEN_MAX: ::c_int = 5; +pub const _SC_JOB_CONTROL: ::c_int = 6; +pub const _SC_SAVED_IDS: ::c_int = 7; +pub const _SC_VERSION: ::c_int = 8; +pub const _SC_BC_BASE_MAX: ::c_int = 9; +pub const _SC_BC_DIM_MAX: ::c_int = 10; +pub const _SC_BC_SCALE_MAX: ::c_int = 11; +pub const _SC_BC_STRING_MAX: ::c_int = 12; +pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13; +pub const _SC_EXPR_NEST_MAX: ::c_int = 14; +pub const _SC_LINE_MAX: ::c_int = 15; +pub const _SC_RE_DUP_MAX: ::c_int = 16; +pub const _SC_2_VERSION: ::c_int = 17; +pub const _SC_2_C_BIND: ::c_int = 18; +pub const _SC_2_C_DEV: ::c_int = 19; +pub const _SC_2_CHAR_TERM: ::c_int = 20; +pub const _SC_2_FORT_DEV: ::c_int = 21; +pub const _SC_2_FORT_RUN: ::c_int = 22; +pub const _SC_2_LOCALEDEF: ::c_int = 23; +pub const _SC_2_SW_DEV: ::c_int = 24; +pub const _SC_2_UPE: ::c_int = 25; +pub const _SC_STREAM_MAX: ::c_int = 26; +pub const _SC_TZNAME_MAX: ::c_int = 27; +pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28; +pub const _SC_MAPPED_FILES: ::c_int = 29; +pub const _SC_MEMLOCK: ::c_int = 30; +pub const _SC_MEMLOCK_RANGE: ::c_int = 31; +pub const _SC_MEMORY_PROTECTION: ::c_int = 32; +pub const _SC_MESSAGE_PASSING: ::c_int = 33; +pub const _SC_PRIORITIZED_IO: ::c_int = 34; +pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35; +pub const _SC_REALTIME_SIGNALS: ::c_int = 36; +pub const _SC_SEMAPHORES: ::c_int = 37; +pub const _SC_FSYNC: ::c_int = 38; +pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39; +pub const _SC_SYNCHRONIZED_IO: ::c_int = 40; +pub const _SC_TIMERS: ::c_int = 41; +pub const _SC_AIO_LISTIO_MAX: ::c_int = 42; +pub const _SC_AIO_MAX: ::c_int = 43; +pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44; +pub const _SC_DELAYTIMER_MAX: ::c_int = 45; +pub const _SC_MQ_OPEN_MAX: ::c_int = 46; +pub const _SC_PAGESIZE: ::c_int = 47; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; +pub const _SC_RTSIG_MAX: ::c_int = 48; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 49; +pub const _SC_SEM_VALUE_MAX: ::c_int = 50; +pub const _SC_SIGQUEUE_MAX: ::c_int = 51; +pub const _SC_TIMER_MAX: ::c_int = 52; +pub const _SC_IOV_MAX: ::c_int = 56; +pub const _SC_NPROCESSORS_CONF: ::c_int = 57; +pub const _SC_2_PBS: ::c_int = 59; +pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60; +pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61; +pub const _SC_2_PBS_LOCATE: ::c_int = 62; +pub const _SC_2_PBS_MESSAGE: ::c_int = 63; +pub const _SC_2_PBS_TRACK: ::c_int = 64; +pub const _SC_ADVISORY_INFO: ::c_int = 65; +pub const _SC_BARRIERS: ::c_int = 66; +pub const _SC_CLOCK_SELECTION: ::c_int = 67; +pub const _SC_CPUTIME: ::c_int = 68; +pub const _SC_FILE_LOCKING: ::c_int = 69; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 58; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71; +pub const _SC_HOST_NAME_MAX: ::c_int = 72; +pub const _SC_LOGIN_NAME_MAX: ::c_int = 73; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 74; +pub const _SC_MQ_PRIO_MAX: ::c_int = 75; +pub const _SC_READER_WRITER_LOCKS: ::c_int = 76; +pub const _SC_REGEXP: ::c_int = 77; +pub const _SC_SHELL: ::c_int = 78; +pub const _SC_SPAWN: ::c_int = 79; +pub const _SC_SPIN_LOCKS: ::c_int = 80; +pub const _SC_SPORADIC_SERVER: ::c_int = 81; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85; +pub const _SC_THREAD_KEYS_MAX: ::c_int = 86; +pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87; +pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90; +pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91; +pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92; +pub const _SC_THREAD_STACK_MIN: ::c_int = 93; +pub const _SC_THREAD_THREADS_MAX: ::c_int = 94; +pub const _SC_TIMEOUTS: ::c_int = 95; +pub const _SC_THREADS: ::c_int = 96; +pub const _SC_TRACE: ::c_int = 97; +pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98; +pub const _SC_TRACE_INHERIT: ::c_int = 99; +pub const _SC_TRACE_LOG: ::c_int = 100; +pub const _SC_TTY_NAME_MAX: ::c_int = 101; +pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102; +pub const _SC_V6_ILP32_OFF32: ::c_int = 103; +pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104; +pub const _SC_V6_LP64_OFF64: ::c_int = 105; +pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106; +pub const _SC_ATEXIT_MAX: ::c_int = 107; +pub const _SC_XOPEN_CRYPT: ::c_int = 108; +pub const _SC_XOPEN_ENH_I18N: ::c_int = 109; +pub const _SC_XOPEN_LEGACY: ::c_int = 110; +pub const _SC_XOPEN_REALTIME: ::c_int = 111; +pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112; +pub const _SC_XOPEN_SHM: ::c_int = 113; +pub const _SC_XOPEN_STREAMS: ::c_int = 114; +pub const _SC_XOPEN_UNIX: ::c_int = 115; +pub const _SC_XOPEN_VERSION: ::c_int = 116; +pub const _SC_XOPEN_XCU_VERSION: ::c_int = 117; +pub const _SC_IPV6: ::c_int = 118; +pub const _SC_RAW_SOCKETS: ::c_int = 119; +pub const _SC_SYMLOOP_MAX: ::c_int = 120; +pub const _SC_PHYS_PAGES: ::c_int = 121; + +pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _; +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _; +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3; +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_ERRORCHECK; + +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_OTHER: ::c_int = 2; +pub const SCHED_RR: ::c_int = 3; + +pub const FD_SETSIZE: usize = 1024; + +pub const ST_NOSUID: ::c_ulong = 2; + +pub const NI_MAXHOST: ::size_t = 1025; + +pub const XUCRED_VERSION: ::c_uint = 0; + +pub const RTLD_LOCAL: ::c_int = 0; +pub const RTLD_NODELETE: ::c_int = 0x1000; +pub const RTLD_NOLOAD: ::c_int = 0x2000; +pub const RTLD_GLOBAL: ::c_int = 0x100; + +pub const LOG_NTP: ::c_int = 12 << 3; +pub const LOG_SECURITY: ::c_int = 13 << 3; +pub const LOG_CONSOLE: ::c_int = 14 << 3; +pub const LOG_NFACILITIES: ::c_int = 24; + +pub const TIOCEXCL: ::c_ulong = 0x2000740d; +pub const TIOCNXCL: ::c_ulong = 0x2000740e; +pub const TIOCFLUSH: ::c_ulong = 0x80047410; +pub const TIOCGETA: ::c_ulong = 0x402c7413; +pub const TIOCSETA: ::c_ulong = 0x802c7414; +pub const TIOCSETAW: ::c_ulong = 0x802c7415; +pub const TIOCSETAF: ::c_ulong = 0x802c7416; +pub const TIOCGETD: ::c_ulong = 0x4004741a; +pub const TIOCSETD: ::c_ulong = 0x8004741b; +pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456; +pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457; +pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459; +pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a; +pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b; +pub const TIOCDRAIN: ::c_ulong = 0x2000745e; +pub const TIOCEXT: ::c_ulong = 0x80047460; +pub const TIOCSCTTY: ::c_ulong = 0x20007461; +pub const TIOCCONS: ::c_ulong = 0x80047462; +pub const TIOCGSID: ::c_ulong = 0x40047463; +pub const TIOCSTAT: ::c_ulong = 0x20007465; +pub const TIOCUCNTL: ::c_ulong = 0x80047466; +pub const TIOCSWINSZ: ::c_ulong = 0x80087467; +pub const TIOCGWINSZ: ::c_ulong = 0x40087468; +pub const TIOCMGET: ::c_ulong = 0x4004746a; +pub const TIOCM_LE: ::c_int = 0x1; +pub const TIOCM_DTR: ::c_int = 0x2; +pub const TIOCM_RTS: ::c_int = 0x4; +pub const TIOCM_ST: ::c_int = 0x8; +pub const TIOCM_SR: ::c_int = 0x10; +pub const TIOCM_CTS: ::c_int = 0x20; +pub const TIOCM_RI: ::c_int = 0x80; +pub const TIOCM_DSR: ::c_int = 0x100; +pub const TIOCM_CD: ::c_int = 0x40; +pub const TIOCM_CAR: ::c_int = 0x40; +pub const TIOCM_RNG: ::c_int = 0x80; +pub const TIOCMBIC: ::c_ulong = 0x8004746b; +pub const TIOCMBIS: ::c_ulong = 0x8004746c; +pub const TIOCMSET: ::c_ulong = 0x8004746d; +pub const TIOCSTART: ::c_ulong = 0x2000746e; +pub const TIOCSTOP: ::c_ulong = 0x2000746f; +pub const TIOCPKT: ::c_ulong = 0x80047470; +pub const TIOCPKT_DATA: ::c_int = 0x0; +pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1; +pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2; +pub const TIOCPKT_STOP: ::c_int = 0x4; +pub const TIOCPKT_START: ::c_int = 0x8; +pub const TIOCPKT_NOSTOP: ::c_int = 0x10; +pub const TIOCPKT_DOSTOP: ::c_int = 0x20; +pub const TIOCPKT_IOCTL: ::c_int = 0x40; +pub const TIOCNOTTY: ::c_ulong = 0x20007471; +pub const TIOCSTI: ::c_ulong = 0x80017472; +pub const TIOCOUTQ: ::c_ulong = 0x40047473; +pub const TIOCSPGRP: ::c_ulong = 0x80047476; +pub const TIOCGPGRP: ::c_ulong = 0x40047477; +pub const TIOCCDTR: ::c_ulong = 0x20007478; +pub const TIOCSDTR: ::c_ulong = 0x20007479; +pub const TTYDISC: ::c_int = 0x0; +pub const SLIPDISC: ::c_int = 0x4; +pub const PPPDISC: ::c_int = 0x5; +pub const NETGRAPHDISC: ::c_int = 0x6; + +pub const BIOCGRSIG: ::c_ulong = 0x40044272; +pub const BIOCSRSIG: ::c_ulong = 0x80044273; +pub const BIOCSDLT: ::c_ulong = 0x80044278; +pub const BIOCGSEESENT: ::c_ulong = 0x40044276; +pub const BIOCSSEESENT: ::c_ulong = 0x80044277; +pub const BIOCSETF: ::c_ulong = 0x80104267; +pub const BIOCGDLTLIST: ::c_ulong = 0xc0104279; +pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d; +pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e; + +pub const FIODTYPE: ::c_ulong = 0x4004667a; +pub const FIOGETLBA: ::c_ulong = 0x40046679; + +pub const B0: speed_t = 0; +pub const B50: speed_t = 50; +pub const B75: speed_t = 75; +pub const B110: speed_t = 110; +pub const B134: speed_t = 134; +pub const B150: speed_t = 150; +pub const B200: speed_t = 200; +pub const B300: speed_t = 300; +pub const B600: speed_t = 600; +pub const B1200: speed_t = 1200; +pub const B1800: speed_t = 1800; +pub const B2400: speed_t = 2400; +pub const B4800: speed_t = 4800; +pub const B9600: speed_t = 9600; +pub const B19200: speed_t = 19200; +pub const B38400: speed_t = 38400; +pub const B7200: speed_t = 7200; +pub const B14400: speed_t = 14400; +pub const B28800: speed_t = 28800; +pub const B57600: speed_t = 57600; +pub const B76800: speed_t = 76800; +pub const B115200: speed_t = 115200; +pub const B230400: speed_t = 230400; +pub const EXTA: speed_t = 19200; +pub const EXTB: speed_t = 38400; + +pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; + +pub const CRTSCTS: ::tcflag_t = 0x00030000; +pub const CCTS_OFLOW: ::tcflag_t = 0x00010000; +pub const CRTS_IFLOW: ::tcflag_t = 0x00020000; +pub const CDTR_IFLOW: ::tcflag_t = 0x00040000; +pub const CDSR_OFLOW: ::tcflag_t = 0x00080000; +pub const CCAR_OFLOW: ::tcflag_t = 0x00100000; +pub const VERASE2: usize = 7; +pub const OCRNL: ::tcflag_t = 0x10; +pub const ONOCR: ::tcflag_t = 0x20; +pub const ONLRET: ::tcflag_t = 0x40; + +pub const CMGROUP_MAX: usize = 16; + +// https://github.com/freebsd/freebsd/blob/master/sys/net/bpf.h +pub const BPF_ALIGNMENT: usize = SIZEOF_LONG; + +// Values for rtprio struct (prio field) and syscall (function argument) +pub const RTP_PRIO_MIN: ::c_ushort = 0; +pub const RTP_PRIO_MAX: ::c_ushort = 31; +pub const RTP_LOOKUP: ::c_int = 0; +pub const RTP_SET: ::c_int = 1; + +// Flags for chflags(2) +pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; +pub const UF_NODUMP: ::c_ulong = 0x00000001; +pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; +pub const UF_APPEND: ::c_ulong = 0x00000004; +pub const UF_OPAQUE: ::c_ulong = 0x00000008; +pub const UF_NOUNLINK: ::c_ulong = 0x00000010; +pub const SF_SETTABLE: ::c_ulong = 0xffff0000; +pub const SF_ARCHIVED: ::c_ulong = 0x00010000; +pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; +pub const SF_APPEND: ::c_ulong = 0x00040000; +pub const SF_NOUNLINK: ::c_ulong = 0x00100000; + +pub const TIMER_ABSTIME: ::c_int = 1; + +// +pub const NTP_API: ::c_int = 4; +pub const MAXPHASE: ::c_long = 500000000; +pub const MAXFREQ: ::c_long = 500000; +pub const MINSEC: ::c_int = 256; +pub const MAXSEC: ::c_int = 2048; +pub const NANOSECOND: ::c_long = 1000000000; +pub const SCALE_PPM: ::c_int = 65; +pub const MAXTC: ::c_int = 10; +pub const MOD_OFFSET: ::c_uint = 0x0001; +pub const MOD_FREQUENCY: ::c_uint = 0x0002; +pub const MOD_MAXERROR: ::c_uint = 0x0004; +pub const MOD_ESTERROR: ::c_uint = 0x0008; +pub const MOD_STATUS: ::c_uint = 0x0010; +pub const MOD_TIMECONST: ::c_uint = 0x0020; +pub const MOD_PPSMAX: ::c_uint = 0x0040; +pub const MOD_TAI: ::c_uint = 0x0080; +pub const MOD_MICRO: ::c_uint = 0x1000; +pub const MOD_NANO: ::c_uint = 0x2000; +pub const MOD_CLKB: ::c_uint = 0x4000; +pub const MOD_CLKA: ::c_uint = 0x8000; +pub const STA_PLL: ::c_int = 0x0001; +pub const STA_PPSFREQ: ::c_int = 0x0002; +pub const STA_PPSTIME: ::c_int = 0x0004; +pub const STA_FLL: ::c_int = 0x0008; +pub const STA_INS: ::c_int = 0x0010; +pub const STA_DEL: ::c_int = 0x0020; +pub const STA_UNSYNC: ::c_int = 0x0040; +pub const STA_FREQHOLD: ::c_int = 0x0080; +pub const STA_PPSSIGNAL: ::c_int = 0x0100; +pub const STA_PPSJITTER: ::c_int = 0x0200; +pub const STA_PPSWANDER: ::c_int = 0x0400; +pub const STA_PPSERROR: ::c_int = 0x0800; +pub const STA_CLOCKERR: ::c_int = 0x1000; +pub const STA_NANO: ::c_int = 0x2000; +pub const STA_MODE: ::c_int = 0x4000; +pub const STA_CLK: ::c_int = 0x8000; +pub const STA_RONLY: ::c_int = STA_PPSSIGNAL + | STA_PPSJITTER + | STA_PPSWANDER + | STA_PPSERROR + | STA_CLOCKERR + | STA_NANO + | STA_MODE + | STA_CLK; +pub const TIME_OK: ::c_int = 0; +pub const TIME_INS: ::c_int = 1; +pub const TIME_DEL: ::c_int = 2; +pub const TIME_OOP: ::c_int = 3; +pub const TIME_WAIT: ::c_int = 4; +pub const TIME_ERROR: ::c_int = 5; + +pub const REG_ENOSYS: ::c_int = -1; +pub const REG_ILLSEQ: ::c_int = 17; + +pub const IPC_PRIVATE: ::key_t = 0; +pub const IPC_CREAT: ::c_int = 0o1000; +pub const IPC_EXCL: ::c_int = 0o2000; +pub const IPC_NOWAIT: ::c_int = 0o4000; +pub const IPC_RMID: ::c_int = 0; +pub const IPC_SET: ::c_int = 1; +pub const IPC_STAT: ::c_int = 2; +pub const IPC_R: ::c_int = 0o400; +pub const IPC_W: ::c_int = 0o200; +pub const IPC_M: ::c_int = 0o10000; + +pub const SHM_RDONLY: ::c_int = 0o10000; +pub const SHM_RND: ::c_int = 0o20000; +pub const SHM_R: ::c_int = 0o400; +pub const SHM_W: ::c_int = 0o200; + +safe_f! { + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + status == 0x13 + } + + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { + status >> 8 + } + + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { + (status & 0o177) == 0o177 + } +} + +extern "C" { + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; + + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; + pub fn accept4( + s: ::c_int, + addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; + pub fn chflagsat( + fd: ::c_int, + path: *const ::c_char, + flags: ::c_ulong, + atflag: ::c_int, + ) -> ::c_int; + + pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; + pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int; + + pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int; + + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn endutxent(); + pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int; + pub fn fexecve( + fd: ::c_int, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int; + pub fn getgrent_r( + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn getpwent_r( + pwd: *mut ::passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::passwd, + ) -> ::c_int; + pub fn getgrouplist( + name: *const ::c_char, + basegid: ::gid_t, + groups: *mut ::gid_t, + ngroups: *mut ::c_int, + ) -> ::c_int; + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::size_t, + serv: *mut ::c_char, + servlen: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int; + pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int; + pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int; + pub fn getutxent() -> *mut utmpx; + pub fn getutxid(ut: *const utmpx) -> *mut utmpx; + pub fn getutxline(ut: *const utmpx) -> *mut utmpx; + pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int; + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "kevent@FBSD_1.0" + )] + pub fn kevent( + kq: ::c_int, + changelist: *const ::kevent, + nchanges: ::c_int, + eventlist: *mut ::kevent, + nevents: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void; + pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "mknodat@FBSD_1.1" + )] + pub fn mknodat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::mode_t, + dev: dev_t, + ) -> ::c_int; + pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int; + pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; + pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; + pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; + pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int; + pub fn ppoll( + fds: *mut ::pollfd, + nfds: ::nfds_t, + timeout: *const ::timespec, + sigmask: *const sigset_t, + ) -> ::c_int; + pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t; + pub fn pthread_attr_get_np(tid: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_attr_getguardsize( + attr: *const ::pthread_attr_t, + guardsize: *mut ::size_t, + ) -> ::c_int; + pub fn pthread_attr_getstack( + attr: *const ::pthread_attr_t, + stackaddr: *mut *mut ::c_void, + stacksize: *mut ::size_t, + ) -> ::c_int; + pub fn pthread_condattr_getclock( + attr: *const pthread_condattr_t, + clock_id: *mut clockid_t, + ) -> ::c_int; + pub fn pthread_condattr_getpshared( + attr: *const pthread_condattr_t, + pshared: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_condattr_setclock( + attr: *mut pthread_condattr_t, + clock_id: ::clockid_t, + ) -> ::c_int; + pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_main_np() -> ::c_int; + pub fn pthread_mutex_timedlock( + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + pub fn pthread_mutexattr_getpshared( + attr: *const pthread_mutexattr_t, + pshared: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_mutexattr_setpshared( + attr: *mut pthread_mutexattr_t, + pshared: ::c_int, + ) -> ::c_int; + pub fn pthread_rwlockattr_getpshared( + attr: *const pthread_rwlockattr_t, + val: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int; + pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int; + pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int; + pub fn pthread_barrierattr_getpshared( + attr: *const ::pthread_barrierattr_t, + shared: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_barrierattr_setpshared( + attr: *mut ::pthread_barrierattr_t, + shared: ::c_int, + ) -> ::c_int; + pub fn pthread_barrier_init( + barrier: *mut pthread_barrier_t, + attr: *const ::pthread_barrierattr_t, + count: ::c_uint, + ) -> ::c_int; + pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int; + pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int; + pub fn pthread_get_name_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t); + pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char); + pub fn pthread_setschedparam( + native: ::pthread_t, + policy: ::c_int, + param: *const sched_param, + ) -> ::c_int; + pub fn pthread_getschedparam( + native: ::pthread_t, + policy: *mut ::c_int, + param: *mut sched_param, + ) -> ::c_int; + pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int; + pub fn utrace(addr: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn pututxline(ut: *const utmpx) -> *mut utmpx; + pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) + -> ::ssize_t; + pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char; + pub fn rtprio(function: ::c_int, pid: ::pid_t, rtp: *mut rtprio) -> ::c_int; + pub fn sched_rr_get_interval(pid: ::pid_t, t: *mut ::timespec) -> ::c_int; + pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int; + pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; + pub fn sched_setscheduler( + pid: ::pid_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; + pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; + pub fn sendfile( + fd: ::c_int, + s: ::c_int, + offset: ::off_t, + nbytes: ::size_t, + hdtr: *mut ::sf_hdtr, + sbytes: *mut ::off_t, + flags: ::c_int, + ) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int; + pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int; + pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int; + pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int; + pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; + pub fn setutxent(); + pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int; + pub fn sigtimedwait( + set: *const sigset_t, + info: *mut siginfo_t, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int; + pub fn sysctl( + name: *const ::c_int, + namelen: ::c_uint, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *const ::c_void, + newlen: ::size_t, + ) -> ::c_int; + pub fn sysctlbyname( + name: *const ::c_char, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *const ::c_void, + newlen: ::size_t, + ) -> ::c_int; + pub fn sysctlnametomib( + name: *const ::c_char, + mibp: *mut ::c_int, + sizep: *mut ::size_t, + ) -> ::c_int; + pub fn uselocale(loc: ::locale_t) -> ::locale_t; + pub fn utimensat( + dirfd: ::c_int, + path: *const ::c_char, + times: *const ::timespec, + flag: ::c_int, + ) -> ::c_int; + + pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; + pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; + + // #include + pub fn dl_iterate_phdr( + callback: ::Option< + unsafe extern "C" fn( + info: *mut dl_phdr_info, + size: usize, + data: *mut ::c_void, + ) -> ::c_int, + >, + data: *mut ::c_void, + ) -> ::c_int; + + pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t; + pub fn iconv( + cd: iconv_t, + inbuf: *mut *mut ::c_char, + inbytesleft: *mut ::size_t, + outbuf: *mut *mut ::c_char, + outbytesleft: *mut ::size_t, + ) -> ::size_t; + pub fn iconv_close(cd: iconv_t) -> ::c_int; + + // Added in `FreeBSD` 11.0 + // Added in `DragonFly BSD` 5.4 + pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t); + // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1 + pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int; + pub fn gethostid() -> ::c_long; + pub fn sethostid(hostid: ::c_long); +} + +#[link(name = "rt")] +extern "C" { + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; + pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int; + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_receive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + ) -> ::ssize_t; + pub fn mq_send( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + ) -> ::c_int; + pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int; + pub fn mq_timedreceive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::ssize_t; + pub fn mq_timedsend( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; +} + +#[link(name = "util")] +extern "C" { + pub fn openpty( + amaster: *mut ::c_int, + aslave: *mut ::c_int, + name: *mut ::c_char, + termp: *mut termios, + winp: *mut ::winsize, + ) -> ::c_int; + pub fn forkpty( + amaster: *mut ::c_int, + name: *mut ::c_char, + termp: *mut termios, + winp: *mut ::winsize, + ) -> ::pid_t; + pub fn login_tty(fd: ::c_int) -> ::c_int; + pub fn fparseln( + stream: *mut ::FILE, + len: *mut ::size_t, + lineno: *mut ::size_t, + delim: *const ::c_char, + flags: ::c_int, + ) -> *mut ::c_char; +} + +#[link(name = "execinfo")] +extern "C" { + pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t; + pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char; + pub fn backtrace_symbols_fd( + addrlist: *const *mut ::c_void, + len: ::size_t, + fd: ::c_int, + ) -> ::c_int; +} + +#[link(name = "kvm")] +extern "C" { + pub fn kvm_open( + execfile: *const ::c_char, + corefile: *const ::c_char, + swapfile: *const ::c_char, + flags: ::c_int, + errstr: *const ::c_char, + ) -> *mut ::kvm_t; + pub fn kvm_close(kd: *mut ::kvm_t) -> ::c_int; + pub fn kvm_getprocs( + kd: *mut ::kvm_t, + op: ::c_int, + arg: ::c_int, + cnt: *mut ::c_int, + ) -> *mut ::kinfo_proc; + pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; + pub fn kvm_openfiles( + execfile: *const ::c_char, + corefile: *const ::c_char, + swapfile: *const ::c_char, + flags: ::c_int, + errbuf: *mut ::c_char, + ) -> *mut ::kvm_t; + pub fn kvm_read( + kd: *mut ::kvm_t, + addr: ::c_ulong, + buf: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn kvm_write( + kd: *mut ::kvm_t, + addr: ::c_ulong, + buf: *const ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; +} + +cfg_if! { + if #[cfg(target_os = "freebsd")] { + mod freebsd; + pub use self::freebsd::*; + } else if #[cfg(target_os = "dragonfly")] { + mod dragonfly; + pub use self::dragonfly::*; + } else { + // ... + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..20e203bde37b04c4eb37432e31ee06ab653414ce --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/mod.rs @@ -0,0 +1,902 @@ +pub type off_t = i64; +pub type useconds_t = u32; +pub type blkcnt_t = i64; +pub type socklen_t = u32; +pub type sa_family_t = u8; +pub type pthread_t = ::uintptr_t; +pub type nfds_t = ::c_uint; +pub type regoff_t = off_t; + +s! { + pub struct sockaddr { + pub sa_len: u8, + pub sa_family: sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in6 { + pub sin6_len: u8, + pub sin6_family: sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct passwd { + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_change: ::time_t, + pub pw_class: *mut ::c_char, + pub pw_gecos: *mut ::c_char, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char, + pub pw_expire: ::time_t, + + #[cfg(not(any(target_os = "macos", + target_os = "ios", + target_os = "watchos", + target_os = "netbsd", + target_os = "openbsd")))] + pub pw_fields: ::c_int, + } + + pub struct ifaddrs { + pub ifa_next: *mut ifaddrs, + pub ifa_name: *mut ::c_char, + pub ifa_flags: ::c_uint, + pub ifa_addr: *mut ::sockaddr, + pub ifa_netmask: *mut ::sockaddr, + pub ifa_dstaddr: *mut ::sockaddr, + pub ifa_data: *mut ::c_void, + #[cfg(target_os = "netbsd")] + pub ifa_addrflags: ::c_uint + } + + pub struct fd_set { + #[cfg(all(target_pointer_width = "64", + any(target_os = "freebsd", target_os = "dragonfly")))] + fds_bits: [i64; FD_SETSIZE / 64], + #[cfg(not(all(target_pointer_width = "64", + any(target_os = "freebsd", target_os = "dragonfly"))))] + fds_bits: [i32; FD_SETSIZE / 32], + } + + pub struct tm { + pub tm_sec: ::c_int, + pub tm_min: ::c_int, + pub tm_hour: ::c_int, + pub tm_mday: ::c_int, + pub tm_mon: ::c_int, + pub tm_year: ::c_int, + pub tm_wday: ::c_int, + pub tm_yday: ::c_int, + pub tm_isdst: ::c_int, + pub tm_gmtoff: ::c_long, + pub tm_zone: *mut ::c_char, + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::c_int, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::socklen_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: ::socklen_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct fsid_t { + __fsid_val: [i32; 2], + } + + pub struct if_nameindex { + pub if_index: ::c_uint, + pub if_name: *mut ::c_char, + } + + pub struct regex_t { + __re_magic: ::c_int, + __re_nsub: ::size_t, + __re_endp: *const ::c_char, + __re_g: *mut ::c_void, + } + + pub struct regmatch_t { + pub rm_so: regoff_t, + pub rm_eo: regoff_t, + } +} + +s_no_extra_traits! { + pub struct sockaddr_un { + pub sun_len: u8, + pub sun_family: sa_family_t, + pub sun_path: [c_char; 104] + } + + pub struct utsname { + #[cfg(not(target_os = "dragonfly"))] + pub sysname: [::c_char; 256], + #[cfg(target_os = "dragonfly")] + pub sysname: [::c_char; 32], + #[cfg(not(target_os = "dragonfly"))] + pub nodename: [::c_char; 256], + #[cfg(target_os = "dragonfly")] + pub nodename: [::c_char; 32], + #[cfg(not(target_os = "dragonfly"))] + pub release: [::c_char; 256], + #[cfg(target_os = "dragonfly")] + pub release: [::c_char; 32], + #[cfg(not(target_os = "dragonfly"))] + pub version: [::c_char; 256], + #[cfg(target_os = "dragonfly")] + pub version: [::c_char; 32], + #[cfg(not(target_os = "dragonfly"))] + pub machine: [::c_char; 256], + #[cfg(target_os = "dragonfly")] + pub machine: [::c_char; 32], + } + +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for sockaddr_un { + fn eq(&self, other: &sockaddr_un) -> bool { + self.sun_len == other.sun_len + && self.sun_family == other.sun_family + && self + .sun_path + .iter() + .zip(other.sun_path.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for sockaddr_un {} + + impl ::fmt::Debug for sockaddr_un { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_un") + .field("sun_len", &self.sun_len) + .field("sun_family", &self.sun_family) + // FIXME: .field("sun_path", &self.sun_path) + .finish() + } + } + + impl ::hash::Hash for sockaddr_un { + fn hash(&self, state: &mut H) { + self.sun_len.hash(state); + self.sun_family.hash(state); + self.sun_path.hash(state); + } + } + + impl PartialEq for utsname { + fn eq(&self, other: &utsname) -> bool { + self.sysname + .iter() + .zip(other.sysname.iter()) + .all(|(a,b)| a == b) + && self + .nodename + .iter() + .zip(other.nodename.iter()) + .all(|(a,b)| a == b) + && self + .release + .iter() + .zip(other.release.iter()) + .all(|(a,b)| a == b) + && self + .version + .iter() + .zip(other.version.iter()) + .all(|(a,b)| a == b) + && self + .machine + .iter() + .zip(other.machine.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for utsname {} + + impl ::fmt::Debug for utsname { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utsname") + // FIXME: .field("sysname", &self.sysname) + // FIXME: .field("nodename", &self.nodename) + // FIXME: .field("release", &self.release) + // FIXME: .field("version", &self.version) + // FIXME: .field("machine", &self.machine) + .finish() + } + } + + impl ::hash::Hash for utsname { + fn hash(&self, state: &mut H) { + self.sysname.hash(state); + self.nodename.hash(state); + self.release.hash(state); + self.version.hash(state); + self.machine.hash(state); + } + } + } +} + +pub const LC_ALL: ::c_int = 0; +pub const LC_COLLATE: ::c_int = 1; +pub const LC_CTYPE: ::c_int = 2; +pub const LC_MONETARY: ::c_int = 3; +pub const LC_NUMERIC: ::c_int = 4; +pub const LC_TIME: ::c_int = 5; +pub const LC_MESSAGES: ::c_int = 6; + +pub const FIOCLEX: ::c_ulong = 0x20006601; +pub const FIONCLEX: ::c_ulong = 0x20006602; +pub const FIONREAD: ::c_ulong = 0x4004667f; +pub const FIONBIO: ::c_ulong = 0x8004667e; +pub const FIOASYNC: ::c_ulong = 0x8004667d; +pub const FIOSETOWN: ::c_ulong = 0x8004667c; +pub const FIOGETOWN: ::c_ulong = 0x4004667b; + +pub const PATH_MAX: ::c_int = 1024; +pub const MAXPATHLEN: ::c_int = PATH_MAX; + +pub const IOV_MAX: ::c_int = 1024; + +pub const SA_ONSTACK: ::c_int = 0x0001; +pub const SA_SIGINFO: ::c_int = 0x0040; +pub const SA_RESTART: ::c_int = 0x0002; +pub const SA_RESETHAND: ::c_int = 0x0004; +pub const SA_NOCLDSTOP: ::c_int = 0x0008; +pub const SA_NODEFER: ::c_int = 0x0010; +pub const SA_NOCLDWAIT: ::c_int = 0x0020; + +pub const SS_ONSTACK: ::c_int = 1; +pub const SS_DISABLE: ::c_int = 4; + +pub const SIGCHLD: ::c_int = 20; +pub const SIGBUS: ::c_int = 10; +pub const SIGUSR1: ::c_int = 30; +pub const SIGUSR2: ::c_int = 31; +pub const SIGCONT: ::c_int = 19; +pub const SIGSTOP: ::c_int = 17; +pub const SIGTSTP: ::c_int = 18; +pub const SIGURG: ::c_int = 16; +pub const SIGIO: ::c_int = 23; +pub const SIGSYS: ::c_int = 12; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGINFO: ::c_int = 29; + +pub const SIG_SETMASK: ::c_int = 3; +pub const SIG_BLOCK: ::c_int = 0x1; +pub const SIG_UNBLOCK: ::c_int = 0x2; + +pub const IP_TOS: ::c_int = 3; +pub const IP_MULTICAST_IF: ::c_int = 9; +pub const IP_MULTICAST_TTL: ::c_int = 10; +pub const IP_MULTICAST_LOOP: ::c_int = 11; + +pub const IPV6_UNICAST_HOPS: ::c_int = 4; +pub const IPV6_MULTICAST_IF: ::c_int = 9; +pub const IPV6_MULTICAST_HOPS: ::c_int = 10; +pub const IPV6_MULTICAST_LOOP: ::c_int = 11; +pub const IPV6_V6ONLY: ::c_int = 27; + +pub const IPTOS_ECN_NOTECT: u8 = 0x00; +pub const IPTOS_ECN_MASK: u8 = 0x03; +pub const IPTOS_ECN_ECT1: u8 = 0x01; +pub const IPTOS_ECN_ECT0: u8 = 0x02; +pub const IPTOS_ECN_CE: u8 = 0x03; + +pub const ST_RDONLY: ::c_ulong = 1; + +pub const SCM_RIGHTS: ::c_int = 0x01; + +pub const NCCS: usize = 20; + +pub const O_ACCMODE: ::c_int = 0x3; +pub const O_RDONLY: ::c_int = 0; +pub const O_WRONLY: ::c_int = 1; +pub const O_RDWR: ::c_int = 2; +pub const O_APPEND: ::c_int = 8; +pub const O_CREAT: ::c_int = 512; +pub const O_TRUNC: ::c_int = 1024; +pub const O_EXCL: ::c_int = 2048; +pub const O_ASYNC: ::c_int = 0x40; +pub const O_SYNC: ::c_int = 0x80; +pub const O_NONBLOCK: ::c_int = 0x4; +pub const O_NOFOLLOW: ::c_int = 0x100; +pub const O_SHLOCK: ::c_int = 0x10; +pub const O_EXLOCK: ::c_int = 0x20; +pub const O_FSYNC: ::c_int = O_SYNC; +pub const O_NDELAY: ::c_int = O_NONBLOCK; + +pub const F_GETOWN: ::c_int = 5; +pub const F_SETOWN: ::c_int = 6; + +pub const F_RDLCK: ::c_short = 1; +pub const F_UNLCK: ::c_short = 2; +pub const F_WRLCK: ::c_short = 3; + +pub const MNT_RDONLY: ::c_int = 0x00000001; +pub const MNT_SYNCHRONOUS: ::c_int = 0x00000002; +pub const MNT_NOEXEC: ::c_int = 0x00000004; +pub const MNT_NOSUID: ::c_int = 0x00000008; +pub const MNT_ASYNC: ::c_int = 0x00000040; +pub const MNT_EXPORTED: ::c_int = 0x00000100; +pub const MNT_UPDATE: ::c_int = 0x00010000; +pub const MNT_RELOAD: ::c_int = 0x00040000; +pub const MNT_FORCE: ::c_int = 0x00080000; + +pub const Q_SYNC: ::c_int = 0x600; +pub const Q_QUOTAON: ::c_int = 0x100; +pub const Q_QUOTAOFF: ::c_int = 0x200; + +pub const TCIOFF: ::c_int = 3; +pub const TCION: ::c_int = 4; +pub const TCOOFF: ::c_int = 1; +pub const TCOON: ::c_int = 2; +pub const TCIFLUSH: ::c_int = 1; +pub const TCOFLUSH: ::c_int = 2; +pub const TCIOFLUSH: ::c_int = 3; +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; +pub const VEOF: usize = 0; +pub const VEOL: usize = 1; +pub const VEOL2: usize = 2; +pub const VERASE: usize = 3; +pub const VWERASE: usize = 4; +pub const VKILL: usize = 5; +pub const VREPRINT: usize = 6; +pub const VINTR: usize = 8; +pub const VQUIT: usize = 9; +pub const VSUSP: usize = 10; +pub const VDSUSP: usize = 11; +pub const VSTART: usize = 12; +pub const VSTOP: usize = 13; +pub const VLNEXT: usize = 14; +pub const VDISCARD: usize = 15; +pub const VMIN: usize = 16; +pub const VTIME: usize = 17; +pub const VSTATUS: usize = 18; +pub const _POSIX_VDISABLE: ::cc_t = 0xff; +pub const IGNBRK: ::tcflag_t = 0x00000001; +pub const BRKINT: ::tcflag_t = 0x00000002; +pub const IGNPAR: ::tcflag_t = 0x00000004; +pub const PARMRK: ::tcflag_t = 0x00000008; +pub const INPCK: ::tcflag_t = 0x00000010; +pub const ISTRIP: ::tcflag_t = 0x00000020; +pub const INLCR: ::tcflag_t = 0x00000040; +pub const IGNCR: ::tcflag_t = 0x00000080; +pub const ICRNL: ::tcflag_t = 0x00000100; +pub const IXON: ::tcflag_t = 0x00000200; +pub const IXOFF: ::tcflag_t = 0x00000400; +pub const IXANY: ::tcflag_t = 0x00000800; +pub const IMAXBEL: ::tcflag_t = 0x00002000; +pub const OPOST: ::tcflag_t = 0x1; +pub const ONLCR: ::tcflag_t = 0x2; +pub const OXTABS: ::tcflag_t = 0x4; +pub const ONOEOT: ::tcflag_t = 0x8; +pub const CIGNORE: ::tcflag_t = 0x00000001; +pub const CSIZE: ::tcflag_t = 0x00000300; +pub const CS5: ::tcflag_t = 0x00000000; +pub const CS6: ::tcflag_t = 0x00000100; +pub const CS7: ::tcflag_t = 0x00000200; +pub const CS8: ::tcflag_t = 0x00000300; +pub const CSTOPB: ::tcflag_t = 0x00000400; +pub const CREAD: ::tcflag_t = 0x00000800; +pub const PARENB: ::tcflag_t = 0x00001000; +pub const PARODD: ::tcflag_t = 0x00002000; +pub const HUPCL: ::tcflag_t = 0x00004000; +pub const CLOCAL: ::tcflag_t = 0x00008000; +pub const ECHOKE: ::tcflag_t = 0x00000001; +pub const ECHOE: ::tcflag_t = 0x00000002; +pub const ECHOK: ::tcflag_t = 0x00000004; +pub const ECHO: ::tcflag_t = 0x00000008; +pub const ECHONL: ::tcflag_t = 0x00000010; +pub const ECHOPRT: ::tcflag_t = 0x00000020; +pub const ECHOCTL: ::tcflag_t = 0x00000040; +pub const ISIG: ::tcflag_t = 0x00000080; +pub const ICANON: ::tcflag_t = 0x00000100; +pub const ALTWERASE: ::tcflag_t = 0x00000200; +pub const IEXTEN: ::tcflag_t = 0x00000400; +pub const EXTPROC: ::tcflag_t = 0x00000800; +pub const TOSTOP: ::tcflag_t = 0x00400000; +pub const FLUSHO: ::tcflag_t = 0x00800000; +pub const NOKERNINFO: ::tcflag_t = 0x02000000; +pub const PENDIN: ::tcflag_t = 0x20000000; +pub const NOFLSH: ::tcflag_t = 0x80000000; +pub const MDMBUF: ::tcflag_t = 0x00100000; + +pub const WNOHANG: ::c_int = 0x00000001; +pub const WUNTRACED: ::c_int = 0x00000002; + +pub const RTLD_LAZY: ::c_int = 0x1; +pub const RTLD_NOW: ::c_int = 0x2; +pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void; +pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void; +pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void; + +pub const LOG_CRON: ::c_int = 9 << 3; +pub const LOG_AUTHPRIV: ::c_int = 10 << 3; +pub const LOG_FTP: ::c_int = 11 << 3; +pub const LOG_PERROR: ::c_int = 0x20; + +pub const TCP_NODELAY: ::c_int = 1; +pub const TCP_MAXSEG: ::c_int = 2; + +pub const PIPE_BUF: usize = 512; + +// si_code values for SIGBUS signal +pub const BUS_ADRALN: ::c_int = 1; +pub const BUS_ADRERR: ::c_int = 2; +pub const BUS_OBJERR: ::c_int = 3; + +// si_code values for SIGCHLD signal +pub const CLD_EXITED: ::c_int = 1; +pub const CLD_KILLED: ::c_int = 2; +pub const CLD_DUMPED: ::c_int = 3; +pub const CLD_TRAPPED: ::c_int = 4; +pub const CLD_STOPPED: ::c_int = 5; +pub const CLD_CONTINUED: ::c_int = 6; + +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; +pub const POLLRDNORM: ::c_short = 0x040; +pub const POLLWRNORM: ::c_short = 0x004; +pub const POLLRDBAND: ::c_short = 0x080; +pub const POLLWRBAND: ::c_short = 0x100; + +pub const BIOCGBLEN: ::c_ulong = 0x40044266; +pub const BIOCSBLEN: ::c_ulong = 0xc0044266; +pub const BIOCFLUSH: ::c_uint = 0x20004268; +pub const BIOCPROMISC: ::c_uint = 0x20004269; +pub const BIOCGDLT: ::c_ulong = 0x4004426a; +pub const BIOCGETIF: ::c_ulong = 0x4020426b; +pub const BIOCSETIF: ::c_ulong = 0x8020426c; +pub const BIOCGSTATS: ::c_ulong = 0x4008426f; +pub const BIOCIMMEDIATE: ::c_ulong = 0x80044270; +pub const BIOCVERSION: ::c_ulong = 0x40044271; +pub const BIOCGHDRCMPLT: ::c_ulong = 0x40044274; +pub const BIOCSHDRCMPLT: ::c_ulong = 0x80044275; +pub const SIOCGIFADDR: ::c_ulong = 0xc0206921; + +pub const REG_BASIC: ::c_int = 0o0000; +pub const REG_EXTENDED: ::c_int = 0o0001; +pub const REG_ICASE: ::c_int = 0o0002; +pub const REG_NOSUB: ::c_int = 0o0004; +pub const REG_NEWLINE: ::c_int = 0o0010; +pub const REG_NOSPEC: ::c_int = 0o0020; +pub const REG_PEND: ::c_int = 0o0040; +pub const REG_DUMP: ::c_int = 0o0200; + +pub const REG_NOMATCH: ::c_int = 1; +pub const REG_BADPAT: ::c_int = 2; +pub const REG_ECOLLATE: ::c_int = 3; +pub const REG_ECTYPE: ::c_int = 4; +pub const REG_EESCAPE: ::c_int = 5; +pub const REG_ESUBREG: ::c_int = 6; +pub const REG_EBRACK: ::c_int = 7; +pub const REG_EPAREN: ::c_int = 8; +pub const REG_EBRACE: ::c_int = 9; +pub const REG_BADBR: ::c_int = 10; +pub const REG_ERANGE: ::c_int = 11; +pub const REG_ESPACE: ::c_int = 12; +pub const REG_BADRPT: ::c_int = 13; +pub const REG_EMPTY: ::c_int = 14; +pub const REG_ASSERT: ::c_int = 15; +pub const REG_INVARG: ::c_int = 16; +pub const REG_ATOI: ::c_int = 255; +pub const REG_ITOA: ::c_int = 0o0400; + +pub const REG_NOTBOL: ::c_int = 0o00001; +pub const REG_NOTEOL: ::c_int = 0o00002; +pub const REG_STARTEND: ::c_int = 0o00004; +pub const REG_TRACE: ::c_int = 0o00400; +pub const REG_LARGE: ::c_int = 0o01000; +pub const REG_BACKR: ::c_int = 0o02000; + +pub const TIOCCBRK: ::c_uint = 0x2000747a; +pub const TIOCSBRK: ::c_uint = 0x2000747b; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +pub const ITIMER_REAL: ::c_int = 0; +pub const ITIMER_VIRTUAL: ::c_int = 1; +pub const ITIMER_PROF: ::c_int = 2; + +f! { + pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr { + if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() { + (*mhdr).msg_control as *mut ::cmsghdr + } else { + 0 as *mut ::cmsghdr + } + } + + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + let fd = fd as usize; + (*set).fds_bits[fd / bits] &= !(1 << (fd % bits)); + return + } + + pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + let fd = fd as usize; + return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0 + } + + pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + let fd = fd as usize; + (*set).fds_bits[fd / bits] |= 1 << (fd % bits); + return + } + + pub fn FD_ZERO(set: *mut fd_set) -> () { + for slot in (*set).fds_bits.iter_mut() { + *slot = 0; + } + } +} + +safe_f! { + pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int { + status & 0o177 + } + + pub {const} fn WIFEXITED(status: ::c_int) -> bool { + (status & 0o177) == 0 + } + + pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int { + status >> 8 + } + + pub {const} fn WCOREDUMP(status: ::c_int) -> bool { + (status & 0o200) != 0 + } + + pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int { + (cmd << 8) | (type_ & 0x00ff) + } +} + +extern "C" { + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "getrlimit$UNIX2003" + )] + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "setrlimit$UNIX2003" + )] + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; + pub fn labs(i: ::c_long) -> ::c_long; + #[cfg_attr( + all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)), + link_name = "rand@FBSD_1.0" + )] + pub fn rand() -> ::c_int; + #[cfg_attr( + all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)), + link_name = "srand@FBSD_1.0" + )] + pub fn srand(seed: ::c_uint); + + pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int; + pub fn freeifaddrs(ifa: *mut ::ifaddrs); + pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int; + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; + pub fn kqueue() -> ::c_int; + pub fn unmount(target: *const ::c_char, arg: ::c_int) -> ::c_int; + pub fn syscall(num: ::c_int, ...) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__getpwent50")] + pub fn getpwent() -> *mut passwd; + pub fn setpwent(); + pub fn endpwent(); + pub fn endgrent(); + pub fn getgrent() -> *mut ::group; + + pub fn getprogname() -> *const ::c_char; + pub fn setprogname(name: *const ::c_char); + pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; + pub fn if_nameindex() -> *mut if_nameindex; + pub fn if_freenameindex(ptr: *mut if_nameindex); + + pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "glob$INODE64" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__glob30")] + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "glob@FBSD_1.0" + )] + pub fn glob( + pattern: *const ::c_char, + flags: ::c_int, + errfunc: ::Option ::c_int>, + pglob: *mut ::glob_t, + ) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__globfree30")] + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "globfree@FBSD_1.0" + )] + pub fn globfree(pglob: *mut ::glob_t); + + pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86_64"), + link_name = "seekdir$INODE64" + )] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "seekdir$INODE64$UNIX2003" + )] + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86_64"), + link_name = "telldir$INODE64" + )] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "telldir$INODE64$UNIX2003" + )] + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; + pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "msync$UNIX2003" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__msync13")] + pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "recvfrom$UNIX2003" + )] + pub fn recvfrom( + socket: ::c_int, + buf: *mut ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, + ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__futimes50")] + pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "bind$UNIX2003" + )] + pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "writev$UNIX2003" + )] + pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "readv$UNIX2003" + )] + pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "sendmsg$UNIX2003" + )] + pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "recvmsg$UNIX2003" + )] + pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; + + pub fn sync(); + pub fn getgrgid_r( + gid: ::gid_t, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "sigaltstack$UNIX2003" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] + pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; + pub fn getgrnam_r( + name: *const ::c_char, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_sigmask$UNIX2003" + )] + pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_cancel$UNIX2003" + )] + pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; + pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")] + pub fn getpwnam_r( + name: *const ::c_char, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] + pub fn getpwuid_r( + uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "sigwait$UNIX2003" + )] + pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; + pub fn pthread_atfork( + prepare: ::Option, + parent: ::Option, + child: ::Option, + ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "popen$UNIX2003" + )] + pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn faccessat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::c_int, + flags: ::c_int, + ) -> ::c_int; + pub fn pthread_create( + native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + pub fn acct(filename: *const ::c_char) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "wait4$UNIX2003" + )] + #[cfg_attr( + all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)), + link_name = "wait4@FBSD_1.0" + )] + pub fn wait4( + pid: ::pid_t, + status: *mut ::c_int, + options: ::c_int, + rusage: *mut ::rusage, + ) -> ::pid_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "getitimer$UNIX2003" + )] + pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "setitimer$UNIX2003" + )] + pub fn setitimer( + which: ::c_int, + new_value: *const ::itimerval, + old_value: *mut ::itimerval, + ) -> ::c_int; + + pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int; + + pub fn regexec( + preg: *const regex_t, + input: *const ::c_char, + nmatch: ::size_t, + pmatch: *mut regmatch_t, + eflags: ::c_int, + ) -> ::c_int; + + pub fn regerror( + errcode: ::c_int, + preg: *const regex_t, + errbuf: *mut ::c_char, + errbuf_size: ::size_t, + ) -> ::size_t; + + pub fn regfree(preg: *mut regex_t); + + pub fn arc4random() -> u32; + pub fn arc4random_buf(buf: *mut ::c_void, size: ::size_t); + pub fn arc4random_uniform(l: u32) -> u32; + + pub fn drand48() -> ::c_double; + pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double; + pub fn lrand48() -> ::c_long; + pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long; + pub fn mrand48() -> ::c_long; + pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long; + pub fn srand48(seed: ::c_long); + pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort; + pub fn lcong48(p: *mut ::c_ushort); +} + +cfg_if! { + if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos"))] { + mod apple; + pub use self::apple::*; + } else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] { + mod netbsdlike; + pub use self::netbsdlike::*; + } else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] { + mod freebsdlike; + pub use self::freebsdlike::*; + } else { + // Unknown target_os + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..a7f35ef8597300cbf14f5893e86812cc0301efec --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/mod.rs @@ -0,0 +1,753 @@ +pub type wchar_t = i32; +pub type time_t = i64; +pub type mode_t = u32; +pub type nlink_t = u32; +pub type ino_t = u64; +pub type pthread_key_t = ::c_int; +pub type rlim_t = u64; +pub type speed_t = ::c_uint; +pub type tcflag_t = ::c_uint; +pub type nl_item = c_long; +pub type clockid_t = ::c_int; +pub type id_t = u32; +pub type sem_t = *mut sem; +pub type key_t = c_long; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { + *self + } +} +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum sem {} +impl ::Copy for sem {} +impl ::Clone for sem { + fn clone(&self) -> sem { + *self + } +} + +s! { + pub struct sched_param { + pub sched_priority: ::c_int, + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct in6_pktinfo { + pub ipi6_addr: ::in6_addr, + pub ipi6_ifindex: ::c_uint, + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_cc: [::cc_t; ::NCCS], + pub c_ispeed: ::c_int, + pub c_ospeed: ::c_int, + } + + pub struct flock { + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + pub l_type: ::c_short, + pub l_whence: ::c_short, + } + + pub struct ipc_perm { + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub mode: ::mode_t, + #[cfg(target_os = "openbsd")] + pub seq: ::c_ushort, + #[cfg(target_os = "netbsd")] + pub _seq: ::c_ushort, + #[cfg(target_os = "openbsd")] + pub key: ::key_t, + #[cfg(target_os = "netbsd")] + pub _key: ::key_t, + } + + pub struct ptrace_io_desc { + pub piod_op: ::c_int, + pub piod_offs: *mut ::c_void, + pub piod_addr: *mut ::c_void, + pub piod_len: ::size_t, + } +} + +pub const D_T_FMT: ::nl_item = 0; +pub const D_FMT: ::nl_item = 1; +pub const T_FMT: ::nl_item = 2; +pub const T_FMT_AMPM: ::nl_item = 3; +pub const AM_STR: ::nl_item = 4; +pub const PM_STR: ::nl_item = 5; + +pub const DAY_1: ::nl_item = 6; +pub const DAY_2: ::nl_item = 7; +pub const DAY_3: ::nl_item = 8; +pub const DAY_4: ::nl_item = 9; +pub const DAY_5: ::nl_item = 10; +pub const DAY_6: ::nl_item = 11; +pub const DAY_7: ::nl_item = 12; + +pub const ABDAY_1: ::nl_item = 13; +pub const ABDAY_2: ::nl_item = 14; +pub const ABDAY_3: ::nl_item = 15; +pub const ABDAY_4: ::nl_item = 16; +pub const ABDAY_5: ::nl_item = 17; +pub const ABDAY_6: ::nl_item = 18; +pub const ABDAY_7: ::nl_item = 19; + +pub const MON_1: ::nl_item = 20; +pub const MON_2: ::nl_item = 21; +pub const MON_3: ::nl_item = 22; +pub const MON_4: ::nl_item = 23; +pub const MON_5: ::nl_item = 24; +pub const MON_6: ::nl_item = 25; +pub const MON_7: ::nl_item = 26; +pub const MON_8: ::nl_item = 27; +pub const MON_9: ::nl_item = 28; +pub const MON_10: ::nl_item = 29; +pub const MON_11: ::nl_item = 30; +pub const MON_12: ::nl_item = 31; + +pub const ABMON_1: ::nl_item = 32; +pub const ABMON_2: ::nl_item = 33; +pub const ABMON_3: ::nl_item = 34; +pub const ABMON_4: ::nl_item = 35; +pub const ABMON_5: ::nl_item = 36; +pub const ABMON_6: ::nl_item = 37; +pub const ABMON_7: ::nl_item = 38; +pub const ABMON_8: ::nl_item = 39; +pub const ABMON_9: ::nl_item = 40; +pub const ABMON_10: ::nl_item = 41; +pub const ABMON_11: ::nl_item = 42; +pub const ABMON_12: ::nl_item = 43; + +pub const RADIXCHAR: ::nl_item = 44; +pub const THOUSEP: ::nl_item = 45; +pub const YESSTR: ::nl_item = 46; +pub const YESEXPR: ::nl_item = 47; +pub const NOSTR: ::nl_item = 48; +pub const NOEXPR: ::nl_item = 49; +pub const CRNCYSTR: ::nl_item = 50; + +pub const CODESET: ::nl_item = 51; + +pub const EXIT_FAILURE: ::c_int = 1; +pub const EXIT_SUCCESS: ::c_int = 0; +pub const RAND_MAX: ::c_int = 2147483647; +pub const EOF: ::c_int = -1; +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; +pub const _IOFBF: ::c_int = 0; +pub const _IONBF: ::c_int = 2; +pub const _IOLBF: ::c_int = 1; +pub const BUFSIZ: ::c_uint = 1024; +pub const FOPEN_MAX: ::c_uint = 20; +pub const FILENAME_MAX: ::c_uint = 1024; +pub const L_tmpnam: ::c_uint = 1024; +pub const O_NOCTTY: ::c_int = 32768; +pub const S_IFIFO: mode_t = 4096; +pub const S_IFCHR: mode_t = 8192; +pub const S_IFBLK: mode_t = 24576; +pub const S_IFDIR: mode_t = 16384; +pub const S_IFREG: mode_t = 32768; +pub const S_IFLNK: mode_t = 40960; +pub const S_IFSOCK: mode_t = 49152; +pub const S_IFMT: mode_t = 61440; +pub const S_IEXEC: mode_t = 64; +pub const S_IWRITE: mode_t = 128; +pub const S_IREAD: mode_t = 256; +pub const S_IRWXU: mode_t = 448; +pub const S_IXUSR: mode_t = 64; +pub const S_IWUSR: mode_t = 128; +pub const S_IRUSR: mode_t = 256; +pub const S_IRWXG: mode_t = 56; +pub const S_IXGRP: mode_t = 8; +pub const S_IWGRP: mode_t = 16; +pub const S_IRGRP: mode_t = 32; +pub const S_IRWXO: mode_t = 7; +pub const S_IXOTH: mode_t = 1; +pub const S_IWOTH: mode_t = 2; +pub const S_IROTH: mode_t = 4; +pub const F_OK: ::c_int = 0; +pub const R_OK: ::c_int = 4; +pub const W_OK: ::c_int = 2; +pub const X_OK: ::c_int = 1; +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; +pub const F_LOCK: ::c_int = 1; +pub const F_TEST: ::c_int = 3; +pub const F_TLOCK: ::c_int = 2; +pub const F_ULOCK: ::c_int = 0; +pub const F_GETLK: ::c_int = 7; +pub const F_SETLK: ::c_int = 8; +pub const F_SETLKW: ::c_int = 9; +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGABRT: ::c_int = 6; +pub const SIGEMT: ::c_int = 7; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGSEGV: ::c_int = 11; +pub const SIGPIPE: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; + +pub const PROT_NONE: ::c_int = 0; +pub const PROT_READ: ::c_int = 1; +pub const PROT_WRITE: ::c_int = 2; +pub const PROT_EXEC: ::c_int = 4; + +pub const MAP_FILE: ::c_int = 0x0000; +pub const MAP_SHARED: ::c_int = 0x0001; +pub const MAP_PRIVATE: ::c_int = 0x0002; +pub const MAP_FIXED: ::c_int = 0x0010; +pub const MAP_ANON: ::c_int = 0x1000; +pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; + +pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; + +pub const IPC_CREAT: ::c_int = 0o001000; +pub const IPC_EXCL: ::c_int = 0o002000; +pub const IPC_NOWAIT: ::c_int = 0o004000; + +pub const IPC_PRIVATE: ::key_t = 0; + +pub const IPC_RMID: ::c_int = 0; +pub const IPC_SET: ::c_int = 1; +pub const IPC_STAT: ::c_int = 2; + +pub const IPC_R: ::c_int = 0o000400; +pub const IPC_W: ::c_int = 0o000200; +pub const IPC_M: ::c_int = 0o010000; + +pub const SHM_R: ::c_int = IPC_R; +pub const SHM_W: ::c_int = IPC_W; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const MS_ASYNC: ::c_int = 0x0001; + +pub const EPERM: ::c_int = 1; +pub const ENOENT: ::c_int = 2; +pub const ESRCH: ::c_int = 3; +pub const EINTR: ::c_int = 4; +pub const EIO: ::c_int = 5; +pub const ENXIO: ::c_int = 6; +pub const E2BIG: ::c_int = 7; +pub const ENOEXEC: ::c_int = 8; +pub const EBADF: ::c_int = 9; +pub const ECHILD: ::c_int = 10; +pub const EDEADLK: ::c_int = 11; +pub const ENOMEM: ::c_int = 12; +pub const EACCES: ::c_int = 13; +pub const EFAULT: ::c_int = 14; +pub const ENOTBLK: ::c_int = 15; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENFILE: ::c_int = 23; +pub const EMFILE: ::c_int = 24; +pub const ENOTTY: ::c_int = 25; +pub const ETXTBSY: ::c_int = 26; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDOM: ::c_int = 33; +pub const ERANGE: ::c_int = 34; +pub const EAGAIN: ::c_int = 35; +pub const EWOULDBLOCK: ::c_int = 35; +pub const EINPROGRESS: ::c_int = 36; +pub const EALREADY: ::c_int = 37; +pub const ENOTSOCK: ::c_int = 38; +pub const EDESTADDRREQ: ::c_int = 39; +pub const EMSGSIZE: ::c_int = 40; +pub const EPROTOTYPE: ::c_int = 41; +pub const ENOPROTOOPT: ::c_int = 42; +pub const EPROTONOSUPPORT: ::c_int = 43; +pub const ESOCKTNOSUPPORT: ::c_int = 44; +pub const EOPNOTSUPP: ::c_int = 45; +pub const EPFNOSUPPORT: ::c_int = 46; +pub const EAFNOSUPPORT: ::c_int = 47; +pub const EADDRINUSE: ::c_int = 48; +pub const EADDRNOTAVAIL: ::c_int = 49; +pub const ENETDOWN: ::c_int = 50; +pub const ENETUNREACH: ::c_int = 51; +pub const ENETRESET: ::c_int = 52; +pub const ECONNABORTED: ::c_int = 53; +pub const ECONNRESET: ::c_int = 54; +pub const ENOBUFS: ::c_int = 55; +pub const EISCONN: ::c_int = 56; +pub const ENOTCONN: ::c_int = 57; +pub const ESHUTDOWN: ::c_int = 58; +pub const ETOOMANYREFS: ::c_int = 59; +pub const ETIMEDOUT: ::c_int = 60; +pub const ECONNREFUSED: ::c_int = 61; +pub const ELOOP: ::c_int = 62; +pub const ENAMETOOLONG: ::c_int = 63; +pub const EHOSTDOWN: ::c_int = 64; +pub const EHOSTUNREACH: ::c_int = 65; +pub const ENOTEMPTY: ::c_int = 66; +pub const EPROCLIM: ::c_int = 67; +pub const EUSERS: ::c_int = 68; +pub const EDQUOT: ::c_int = 69; +pub const ESTALE: ::c_int = 70; +pub const EREMOTE: ::c_int = 71; +pub const EBADRPC: ::c_int = 72; +pub const ERPCMISMATCH: ::c_int = 73; +pub const EPROGUNAVAIL: ::c_int = 74; +pub const EPROGMISMATCH: ::c_int = 75; +pub const EPROCUNAVAIL: ::c_int = 76; +pub const ENOLCK: ::c_int = 77; +pub const ENOSYS: ::c_int = 78; +pub const EFTYPE: ::c_int = 79; +pub const EAUTH: ::c_int = 80; +pub const ENEEDAUTH: ::c_int = 81; + +pub const F_DUPFD: ::c_int = 0; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; + +pub const SIGTRAP: ::c_int = 5; + +pub const GLOB_APPEND: ::c_int = 0x0001; +pub const GLOB_DOOFFS: ::c_int = 0x0002; +pub const GLOB_ERR: ::c_int = 0x0004; +pub const GLOB_MARK: ::c_int = 0x0008; +pub const GLOB_NOCHECK: ::c_int = 0x0010; +pub const GLOB_NOSORT: ::c_int = 0x0020; +pub const GLOB_NOESCAPE: ::c_int = 0x1000; + +pub const GLOB_NOSPACE: ::c_int = -1; +pub const GLOB_ABORTED: ::c_int = -2; +pub const GLOB_NOMATCH: ::c_int = -3; +pub const GLOB_NOSYS: ::c_int = -4; + +pub const POSIX_MADV_NORMAL: ::c_int = 0; +pub const POSIX_MADV_RANDOM: ::c_int = 1; +pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_MADV_WILLNEED: ::c_int = 3; +pub const POSIX_MADV_DONTNEED: ::c_int = 4; + +pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; +pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; + +pub const PIOD_READ_D: ::c_int = 1; +pub const PIOD_WRITE_D: ::c_int = 2; +pub const PIOD_READ_I: ::c_int = 3; +pub const PIOD_WRITE_I: ::c_int = 4; +pub const PIOD_READ_AUXV: ::c_int = 5; + +pub const PT_TRACE_ME: ::c_int = 0; +pub const PT_READ_I: ::c_int = 1; +pub const PT_READ_D: ::c_int = 2; +pub const PT_WRITE_I: ::c_int = 4; +pub const PT_WRITE_D: ::c_int = 5; +pub const PT_CONTINUE: ::c_int = 7; +pub const PT_KILL: ::c_int = 8; +pub const PT_ATTACH: ::c_int = 9; +pub const PT_DETACH: ::c_int = 10; +pub const PT_IO: ::c_int = 11; + +// http://man.openbsd.org/OpenBSD-current/man2/clock_getres.2 +// The man page says clock_gettime(3) can accept various values as clockid_t but +// http://fxr.watson.org/fxr/source/kern/kern_time.c?v=OPENBSD;im=excerpts#L161 +// the implementation rejects anything other than the below two +// +// http://netbsd.gw.com/cgi-bin/man-cgi?clock_gettime +// https://github.com/jsonn/src/blob/HEAD/sys/kern/subr_time.c#L222 +// Basically the same goes for NetBSD +pub const CLOCK_REALTIME: ::clockid_t = 0; +pub const CLOCK_MONOTONIC: ::clockid_t = 3; + +pub const RLIMIT_CPU: ::c_int = 0; +pub const RLIMIT_FSIZE: ::c_int = 1; +pub const RLIMIT_DATA: ::c_int = 2; +pub const RLIMIT_STACK: ::c_int = 3; +pub const RLIMIT_CORE: ::c_int = 4; +pub const RLIMIT_RSS: ::c_int = 5; +pub const RLIMIT_MEMLOCK: ::c_int = 6; +pub const RLIMIT_NPROC: ::c_int = 7; +pub const RLIMIT_NOFILE: ::c_int = 8; + +pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; +pub const RLIM_SAVED_MAX: rlim_t = RLIM_INFINITY; +pub const RLIM_SAVED_CUR: rlim_t = RLIM_INFINITY; + +pub const RUSAGE_SELF: ::c_int = 0; +pub const RUSAGE_CHILDREN: ::c_int = -1; + +pub const MADV_NORMAL: ::c_int = 0; +pub const MADV_RANDOM: ::c_int = 1; +pub const MADV_SEQUENTIAL: ::c_int = 2; +pub const MADV_WILLNEED: ::c_int = 3; +pub const MADV_DONTNEED: ::c_int = 4; +pub const MADV_FREE: ::c_int = 6; + +pub const AF_UNSPEC: ::c_int = 0; +pub const AF_LOCAL: ::c_int = 1; +pub const AF_UNIX: ::c_int = AF_LOCAL; +pub const AF_INET: ::c_int = 2; +pub const AF_IMPLINK: ::c_int = 3; +pub const AF_PUP: ::c_int = 4; +pub const AF_CHAOS: ::c_int = 5; +pub const AF_NS: ::c_int = 6; +pub const AF_ISO: ::c_int = 7; +pub const AF_OSI: ::c_int = AF_ISO; +pub const AF_DATAKIT: ::c_int = 9; +pub const AF_CCITT: ::c_int = 10; +pub const AF_SNA: ::c_int = 11; +pub const AF_DECnet: ::c_int = 12; +pub const AF_DLI: ::c_int = 13; +pub const AF_LAT: ::c_int = 14; +pub const AF_HYLINK: ::c_int = 15; +pub const AF_APPLETALK: ::c_int = 16; +pub const AF_LINK: ::c_int = 18; +pub const pseudo_AF_XTP: ::c_int = 19; +pub const AF_COIP: ::c_int = 20; +pub const AF_CNT: ::c_int = 21; +pub const pseudo_AF_RTIP: ::c_int = 22; +pub const AF_IPX: ::c_int = 23; +pub const AF_INET6: ::c_int = 24; +pub const pseudo_AF_PIP: ::c_int = 25; +pub const AF_ISDN: ::c_int = 26; +pub const AF_E164: ::c_int = AF_ISDN; +pub const AF_NATM: ::c_int = 27; + +pub const PF_UNSPEC: ::c_int = AF_UNSPEC; +pub const PF_LOCAL: ::c_int = AF_LOCAL; +pub const PF_UNIX: ::c_int = PF_LOCAL; +pub const PF_INET: ::c_int = AF_INET; +pub const PF_IMPLINK: ::c_int = AF_IMPLINK; +pub const PF_PUP: ::c_int = AF_PUP; +pub const PF_CHAOS: ::c_int = AF_CHAOS; +pub const PF_NS: ::c_int = AF_NS; +pub const PF_ISO: ::c_int = AF_ISO; +pub const PF_OSI: ::c_int = AF_ISO; +pub const PF_DATAKIT: ::c_int = AF_DATAKIT; +pub const PF_CCITT: ::c_int = AF_CCITT; +pub const PF_SNA: ::c_int = AF_SNA; +pub const PF_DECnet: ::c_int = AF_DECnet; +pub const PF_DLI: ::c_int = AF_DLI; +pub const PF_LAT: ::c_int = AF_LAT; +pub const PF_HYLINK: ::c_int = AF_HYLINK; +pub const PF_APPLETALK: ::c_int = AF_APPLETALK; +pub const PF_LINK: ::c_int = AF_LINK; +pub const PF_XTP: ::c_int = pseudo_AF_XTP; +pub const PF_COIP: ::c_int = AF_COIP; +pub const PF_CNT: ::c_int = AF_CNT; +pub const PF_IPX: ::c_int = AF_IPX; +pub const PF_INET6: ::c_int = AF_INET6; +pub const PF_RTIP: ::c_int = pseudo_AF_RTIP; +pub const PF_PIP: ::c_int = pseudo_AF_PIP; +pub const PF_ISDN: ::c_int = AF_ISDN; +pub const PF_NATM: ::c_int = AF_NATM; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_RAW: ::c_int = 3; +pub const SOCK_RDM: ::c_int = 4; +pub const SOCK_SEQPACKET: ::c_int = 5; +pub const IP_TTL: ::c_int = 4; +pub const IP_HDRINCL: ::c_int = 2; +pub const IP_ADD_MEMBERSHIP: ::c_int = 12; +pub const IP_DROP_MEMBERSHIP: ::c_int = 13; +pub const IPV6_RECVPKTINFO: ::c_int = 36; +pub const IPV6_PKTINFO: ::c_int = 46; +pub const IPV6_RECVTCLASS: ::c_int = 57; +pub const IPV6_TCLASS: ::c_int = 61; + +pub const SOL_SOCKET: ::c_int = 0xffff; +pub const SO_DEBUG: ::c_int = 0x01; +pub const SO_ACCEPTCONN: ::c_int = 0x0002; +pub const SO_REUSEADDR: ::c_int = 0x0004; +pub const SO_KEEPALIVE: ::c_int = 0x0008; +pub const SO_DONTROUTE: ::c_int = 0x0010; +pub const SO_BROADCAST: ::c_int = 0x0020; +pub const SO_USELOOPBACK: ::c_int = 0x0040; +pub const SO_LINGER: ::c_int = 0x0080; +pub const SO_OOBINLINE: ::c_int = 0x0100; +pub const SO_REUSEPORT: ::c_int = 0x0200; +pub const SO_SNDBUF: ::c_int = 0x1001; +pub const SO_RCVBUF: ::c_int = 0x1002; +pub const SO_SNDLOWAT: ::c_int = 0x1003; +pub const SO_RCVLOWAT: ::c_int = 0x1004; +pub const SO_ERROR: ::c_int = 0x1007; +pub const SO_TYPE: ::c_int = 0x1008; + +pub const SOMAXCONN: ::c_int = 128; + +pub const MSG_OOB: ::c_int = 0x1; +pub const MSG_PEEK: ::c_int = 0x2; +pub const MSG_DONTROUTE: ::c_int = 0x4; +pub const MSG_EOR: ::c_int = 0x8; +pub const MSG_TRUNC: ::c_int = 0x10; +pub const MSG_CTRUNC: ::c_int = 0x20; +pub const MSG_WAITALL: ::c_int = 0x40; +pub const MSG_DONTWAIT: ::c_int = 0x80; +pub const MSG_BCAST: ::c_int = 0x100; +pub const MSG_MCAST: ::c_int = 0x200; +pub const MSG_NOSIGNAL: ::c_int = 0x400; +pub const MSG_CMSG_CLOEXEC: ::c_int = 0x800; + +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; + +pub const LOCK_SH: ::c_int = 1; +pub const LOCK_EX: ::c_int = 2; +pub const LOCK_NB: ::c_int = 4; +pub const LOCK_UN: ::c_int = 8; + +pub const IPPROTO_RAW: ::c_int = 255; + +pub const _SC_ARG_MAX: ::c_int = 1; +pub const _SC_CHILD_MAX: ::c_int = 2; +pub const _SC_NGROUPS_MAX: ::c_int = 4; +pub const _SC_OPEN_MAX: ::c_int = 5; +pub const _SC_JOB_CONTROL: ::c_int = 6; +pub const _SC_SAVED_IDS: ::c_int = 7; +pub const _SC_VERSION: ::c_int = 8; +pub const _SC_BC_BASE_MAX: ::c_int = 9; +pub const _SC_BC_DIM_MAX: ::c_int = 10; +pub const _SC_BC_SCALE_MAX: ::c_int = 11; +pub const _SC_BC_STRING_MAX: ::c_int = 12; +pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13; +pub const _SC_EXPR_NEST_MAX: ::c_int = 14; +pub const _SC_LINE_MAX: ::c_int = 15; +pub const _SC_RE_DUP_MAX: ::c_int = 16; +pub const _SC_2_VERSION: ::c_int = 17; +pub const _SC_2_C_BIND: ::c_int = 18; +pub const _SC_2_C_DEV: ::c_int = 19; +pub const _SC_2_CHAR_TERM: ::c_int = 20; +pub const _SC_2_FORT_DEV: ::c_int = 21; +pub const _SC_2_FORT_RUN: ::c_int = 22; +pub const _SC_2_LOCALEDEF: ::c_int = 23; +pub const _SC_2_SW_DEV: ::c_int = 24; +pub const _SC_2_UPE: ::c_int = 25; +pub const _SC_STREAM_MAX: ::c_int = 26; +pub const _SC_TZNAME_MAX: ::c_int = 27; +pub const _SC_PAGESIZE: ::c_int = 28; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; +pub const _SC_FSYNC: ::c_int = 29; +pub const _SC_XOPEN_SHM: ::c_int = 30; + +pub const Q_GETQUOTA: ::c_int = 0x300; +pub const Q_SETQUOTA: ::c_int = 0x400; + +pub const RTLD_GLOBAL: ::c_int = 0x100; + +pub const LOG_NFACILITIES: ::c_int = 24; + +pub const HW_NCPU: ::c_int = 3; + +pub const B0: speed_t = 0; +pub const B50: speed_t = 50; +pub const B75: speed_t = 75; +pub const B110: speed_t = 110; +pub const B134: speed_t = 134; +pub const B150: speed_t = 150; +pub const B200: speed_t = 200; +pub const B300: speed_t = 300; +pub const B600: speed_t = 600; +pub const B1200: speed_t = 1200; +pub const B1800: speed_t = 1800; +pub const B2400: speed_t = 2400; +pub const B4800: speed_t = 4800; +pub const B9600: speed_t = 9600; +pub const B19200: speed_t = 19200; +pub const B38400: speed_t = 38400; +pub const B7200: speed_t = 7200; +pub const B14400: speed_t = 14400; +pub const B28800: speed_t = 28800; +pub const B57600: speed_t = 57600; +pub const B76800: speed_t = 76800; +pub const B115200: speed_t = 115200; +pub const B230400: speed_t = 230400; +pub const EXTA: speed_t = 19200; +pub const EXTB: speed_t = 38400; + +pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; + +pub const CRTSCTS: ::tcflag_t = 0x00010000; +pub const CRTS_IFLOW: ::tcflag_t = CRTSCTS; +pub const CCTS_OFLOW: ::tcflag_t = CRTSCTS; +pub const OCRNL: ::tcflag_t = 0x10; + +pub const TIOCEXCL: ::c_ulong = 0x2000740d; +pub const TIOCNXCL: ::c_ulong = 0x2000740e; +pub const TIOCFLUSH: ::c_ulong = 0x80047410; +pub const TIOCGETA: ::c_ulong = 0x402c7413; +pub const TIOCSETA: ::c_ulong = 0x802c7414; +pub const TIOCSETAW: ::c_ulong = 0x802c7415; +pub const TIOCSETAF: ::c_ulong = 0x802c7416; +pub const TIOCGETD: ::c_ulong = 0x4004741a; +pub const TIOCSETD: ::c_ulong = 0x8004741b; +pub const TIOCMGET: ::c_ulong = 0x4004746a; +pub const TIOCMBIC: ::c_ulong = 0x8004746b; +pub const TIOCMBIS: ::c_ulong = 0x8004746c; +pub const TIOCMSET: ::c_ulong = 0x8004746d; +pub const TIOCSTART: ::c_ulong = 0x2000746e; +pub const TIOCSTOP: ::c_ulong = 0x2000746f; +pub const TIOCSCTTY: ::c_ulong = 0x20007461; +pub const TIOCGWINSZ: ::c_ulong = 0x40087468; +pub const TIOCSWINSZ: ::c_ulong = 0x80087467; +pub const TIOCM_LE: ::c_int = 0o0001; +pub const TIOCM_DTR: ::c_int = 0o0002; +pub const TIOCM_RTS: ::c_int = 0o0004; +pub const TIOCM_ST: ::c_int = 0o0010; +pub const TIOCM_SR: ::c_int = 0o0020; +pub const TIOCM_CTS: ::c_int = 0o0040; +pub const TIOCM_CAR: ::c_int = 0o0100; +pub const TIOCM_RNG: ::c_int = 0o0200; +pub const TIOCM_DSR: ::c_int = 0o0400; +pub const TIOCM_CD: ::c_int = TIOCM_CAR; +pub const TIOCM_RI: ::c_int = TIOCM_RNG; + +pub const TIMER_ABSTIME: ::c_int = 1; + +#[link(name = "util")] +extern "C" { + pub fn setgrent(); + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; + + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + pub fn accept4( + s: ::c_int, + addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__clock_getres50")] + pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")] + pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__clock_settime50")] + pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; + pub fn __errno() -> *mut ::c_int; + pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int; + pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void; + pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int; + pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int; + pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) + -> ::ssize_t; + pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + pub fn utimensat( + dirfd: ::c_int, + path: *const ::c_char, + times: *const ::timespec, + flag: ::c_int, + ) -> ::c_int; + pub fn fdatasync(fd: ::c_int) -> ::c_int; + pub fn login_tty(fd: ::c_int) -> ::c_int; + pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; + pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; + + pub fn mknodat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::mode_t, + dev: dev_t, + ) -> ::c_int; + pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; + pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; + pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; + pub fn pthread_condattr_setclock( + attr: *mut pthread_condattr_t, + clock_id: ::clockid_t, + ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn pthread_mutex_timedlock( + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int; + pub fn pthread_setschedparam( + native: ::pthread_t, + policy: ::c_int, + param: *const sched_param, + ) -> ::c_int; + pub fn pthread_getschedparam( + native: ::pthread_t, + policy: *mut ::c_int, + param: *mut sched_param, + ) -> ::c_int; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; + + pub fn getgrouplist( + name: *const ::c_char, + basegid: ::gid_t, + groups: *mut ::gid_t, + ngroups: *mut ::c_int, + ) -> ::c_int; + pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int; + pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + + pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; + pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; + pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; + pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; +} + +extern "C" { + pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; + pub fn gethostid() -> ::c_long; + pub fn sethostid(hostid: ::c_long) -> ::c_int; + pub fn ftok(path: *const ::c_char, id: ::c_int) -> ::key_t; +} + +cfg_if! { + if #[cfg(target_os = "netbsd")] { + mod netbsd; + pub use self::netbsd::*; + } else if #[cfg(target_os = "openbsd")] { + mod openbsd; + pub use self::openbsd::*; + } else { + // Unknown target_os + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs new file mode 100644 index 0000000000000000000000000000000000000000..7b895f63238d09e96fb35831d74722cae14f214d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/aarch64.rs @@ -0,0 +1,103 @@ +use PT_FIRSTMACH; + +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = u8; +pub type greg_t = u64; +pub type __cpu_simple_lock_nv_t = ::c_uchar; + +s! { + pub struct __fregset { + #[cfg(libc_union)] + pub __qregs: [__c_anonymous__freg; 32], + pub __fpcr: u32, + pub __fpsr: u32, + } + + pub struct mcontext_t { + pub __gregs: [::greg_t; 32], + pub __fregs: __fregset, + __spare: [::greg_t; 8], + } + + pub struct ucontext_t { + pub uc_flags: ::c_uint, + pub uc_link: *mut ucontext_t, + pub uc_sigmask: ::sigset_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + } +} + +s_no_extra_traits! { + #[cfg(libc_union)] + #[repr(align(16))] + pub union __c_anonymous__freg { + pub __b8: [u8; 16], + pub __h16: [u16; 8], + pub __s32: [u32; 4], + pub __d64: [u64; 2], + pub __q128: [u128; 1], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + #[cfg(libc_union)] + impl PartialEq for __c_anonymous__freg { + fn eq(&self, other: &__c_anonymous__freg) -> bool { + unsafe { + self.__b8 == other.__b8 + || self.__h16 == other.__h16 + || self.__s32 == other.__s32 + || self.__d64 == other.__d64 + || self.__q128 == other.__q128 + } + } + } + #[cfg(libc_union)] + impl Eq for __c_anonymous__freg {} + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous__freg { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + unsafe { + f.debug_struct("__c_anonymous__freg") + .field("__b8", &self.__b8) + .field("__h16", &self.__h16) + .field("__s32", &self.__s32) + .field("__d64", &self.__d64) + .field("__q128", &self.__q128) + .finish() + } + } + } + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous__freg { + fn hash(&self, state: &mut H) { + unsafe { + self.__b8.hash(state); + self.__h16.hash(state); + self.__s32.hash(state); + self.__d64.hash(state); + self.__q128.hash(state); + } + } + } + } +} + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 4 - 1; + } +} + +pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0; +pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1; +pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2; +pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs new file mode 100644 index 0000000000000000000000000000000000000000..4bf3ccd02b2c4cdc091f4238df920cfa37c1c78d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/arm.rs @@ -0,0 +1,22 @@ +use PT_FIRSTMACH; + +pub type c_long = i32; +pub type c_ulong = u32; +pub type c_char = u8; +pub type __cpu_simple_lock_nv_t = ::c_int; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; +pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; +pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3; +pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..d12fd073019bee7fb4898686e42339c9500894f9 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -0,0 +1,2996 @@ +pub type clock_t = ::c_uint; +pub type suseconds_t = ::c_int; +pub type dev_t = u64; +pub type blksize_t = i32; +pub type fsblkcnt_t = u64; +pub type fsfilcnt_t = u64; +pub type idtype_t = ::c_int; +pub type mqd_t = ::c_int; +type __pthread_spin_t = __cpu_simple_lock_nv_t; +pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time +pub type lwpid_t = ::c_uint; +pub type shmatt_t = ::c_uint; +pub type cpuid_t = u64; +pub type cpuset_t = _cpuset; +pub type pthread_spin_t = ::c_uchar; +pub type timer_t = ::c_int; + +// elf.h + +pub type Elf32_Addr = u32; +pub type Elf32_Half = u16; +pub type Elf32_Lword = u64; +pub type Elf32_Off = u32; +pub type Elf32_Sword = i32; +pub type Elf32_Word = u32; + +pub type Elf64_Addr = u64; +pub type Elf64_Half = u16; +pub type Elf64_Lword = u64; +pub type Elf64_Off = u64; +pub type Elf64_Sword = i32; +pub type Elf64_Sxword = i64; +pub type Elf64_Word = u32; +pub type Elf64_Xword = u64; + +pub type iconv_t = *mut ::c_void; + +e! { + pub enum fae_action { + FAE_OPEN, + FAE_DUP2, + FAE_CLOSE, + } +} + +cfg_if! { + if #[cfg(target_pointer_width = "64")] { + type Elf_Addr = Elf64_Addr; + type Elf_Half = Elf64_Half; + type Elf_Phdr = Elf64_Phdr; + } else if #[cfg(target_pointer_width = "32")] { + type Elf_Addr = Elf32_Addr; + type Elf_Half = Elf32_Half; + type Elf_Phdr = Elf32_Phdr; + } +} + +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_void { + self.si_addr + } + + pub unsafe fn si_value(&self) -> ::sigval { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + __pad1: ::c_int, + _pid: ::pid_t, + _uid: ::uid_t, + value: ::sigval, + } + (*(self as *const siginfo_t as *const siginfo_timer)).value + } + + pub unsafe fn si_status(&self) -> ::c_int { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + __pad1: ::c_int, + _pid: ::pid_t, + _uid: ::uid_t, + _value: ::sigval, + _cpid: ::pid_t, + _cuid: ::uid_t, + status: ::c_int, + } + (*(self as *const siginfo_t as *const siginfo_timer)).status + } +} + +s! { + pub struct aiocb { + pub aio_offset: ::off_t, + pub aio_buf: *mut ::c_void, + pub aio_nbytes: ::size_t, + pub aio_fildes: ::c_int, + pub aio_lio_opcode: ::c_int, + pub aio_reqprio: ::c_int, + pub aio_sigevent: ::sigevent, + _state: ::c_int, + _errno: ::c_int, + _retval: ::ssize_t + } + + pub struct glob_t { + pub gl_pathc: ::size_t, + pub gl_matchc: ::size_t, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + pub gl_pathv: *mut *mut ::c_char, + + __unused3: *mut ::c_void, + + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + __unused6: *mut ::c_void, + __unused7: *mut ::c_void, + __unused8: *mut ::c_void, + } + + pub struct mq_attr { + pub mq_flags: ::c_long, + pub mq_maxmsg: ::c_long, + pub mq_msgsize: ::c_long, + pub mq_curmsgs: ::c_long, + } + + pub struct itimerspec { + pub it_interval: ::timespec, + pub it_value: ::timespec, + } + + pub struct sigset_t { + __bits: [u32; 4], + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_mode: ::mode_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atimensec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtimensec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctimensec: ::c_long, + pub st_birthtime: ::time_t, + pub st_birthtimensec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: u32, + pub st_gen: u32, + pub st_spare: [u32; 2], + } + + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + pub ai_addrlen: ::socklen_t, + pub ai_canonname: *mut ::c_char, + pub ai_addr: *mut ::sockaddr, + pub ai_next: *mut ::addrinfo, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_code: ::c_int, + pub si_errno: ::c_int, + __pad1: ::c_int, + pub si_addr: *mut ::c_void, + __pad2: [u64; 13], + } + + pub struct pthread_attr_t { + pta_magic: ::c_uint, + pta_flags: ::c_int, + pta_private: *mut ::c_void, + } + + pub struct pthread_mutex_t { + ptm_magic: ::c_uint, + ptm_errorcheck: __pthread_spin_t, + #[cfg(any(target_arch = "sparc", target_arch = "sparc64", + target_arch = "x86", target_arch = "x86_64"))] + ptm_pad1: [u8; 3], + // actually a union with a non-unused, 0-initialized field + ptm_unused: __pthread_spin_t, + #[cfg(any(target_arch = "sparc", target_arch = "sparc64", + target_arch = "x86", target_arch = "x86_64"))] + ptm_pad2: [u8; 3], + ptm_owner: ::pthread_t, + ptm_waiters: *mut u8, + ptm_recursed: ::c_uint, + ptm_spare2: *mut ::c_void, + } + + pub struct pthread_mutexattr_t { + ptma_magic: ::c_uint, + ptma_private: *mut ::c_void, + } + + pub struct pthread_rwlockattr_t { + ptra_magic: ::c_uint, + ptra_private: *mut ::c_void, + } + + pub struct pthread_cond_t { + ptc_magic: ::c_uint, + ptc_lock: __pthread_spin_t, + ptc_waiters_first: *mut u8, + ptc_waiters_last: *mut u8, + ptc_mutex: *mut ::pthread_mutex_t, + ptc_private: *mut ::c_void, + } + + pub struct pthread_condattr_t { + ptca_magic: ::c_uint, + ptca_private: *mut ::c_void, + } + + pub struct pthread_rwlock_t { + ptr_magic: ::c_uint, + ptr_interlock: __pthread_spin_t, + ptr_rblocked_first: *mut u8, + ptr_rblocked_last: *mut u8, + ptr_wblocked_first: *mut u8, + ptr_wblocked_last: *mut u8, + ptr_nreaders: ::c_uint, + ptr_owner: ::pthread_t, + ptr_private: *mut ::c_void, + } + + pub struct pthread_spinlock_t { + pts_magic: ::c_uint, + pts_spin: ::pthread_spin_t, + pts_flags: ::c_int, + } + + pub struct kevent { + pub ident: ::uintptr_t, + pub filter: u32, + pub flags: u32, + pub fflags: u32, + pub data: i64, + pub udata: ::intptr_t, /* FIXME: NetBSD 10.0 will finally have same layout as other BSD */ + } + + pub struct dqblk { + pub dqb_bhardlimit: u32, + pub dqb_bsoftlimit: u32, + pub dqb_curblocks: u32, + pub dqb_ihardlimit: u32, + pub dqb_isoftlimit: u32, + pub dqb_curinodes: u32, + pub dqb_btime: i32, + pub dqb_itime: i32, + } + + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *const ::c_void, + } + + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } + + pub struct if_data { + pub ifi_type: ::c_uchar, + pub ifi_addrlen: ::c_uchar, + pub ifi_hdrlen: ::c_uchar, + pub ifi_link_state: ::c_int, + pub ifi_mtu: u64, + pub ifi_metric: u64, + pub ifi_baudrate: u64, + pub ifi_ipackets: u64, + pub ifi_ierrors: u64, + pub ifi_opackets: u64, + pub ifi_oerrors: u64, + pub ifi_collisions: u64, + pub ifi_ibytes: u64, + pub ifi_obytes: u64, + pub ifi_imcasts: u64, + pub ifi_omcasts: u64, + pub ifi_iqdrops: u64, + pub ifi_noproto: u64, + pub ifi_lastchange: ::timespec, + } + + pub struct if_msghdr { + pub ifm_msglen: ::c_ushort, + pub ifm_version: ::c_uchar, + pub ifm_type: ::c_uchar, + pub ifm_addrs: ::c_int, + pub ifm_flags: ::c_int, + pub ifm_index: ::c_ushort, + pub ifm_data: if_data, + } + + pub struct sockcred { + pub sc_pid: ::pid_t, + pub sc_uid: ::uid_t, + pub sc_euid: ::uid_t, + pub sc_gid: ::gid_t, + pub sc_egid: ::gid_t, + pub sc_ngroups: ::c_int, + pub sc_groups: [::gid_t; 1], + } + + pub struct uucred { + pub cr_unused: ::c_ushort, + pub cr_uid: ::uid_t, + pub cr_gid: ::gid_t, + pub cr_ngroups: ::c_int, + pub cr_groups: [::gid_t; NGROUPS_MAX as usize], + } + + pub struct unpcbid { + pub unp_pid: ::pid_t, + pub unp_euid: ::uid_t, + pub unp_egid: ::gid_t, + } + + pub struct sockaddr_dl { + pub sdl_len: ::c_uchar, + pub sdl_family: ::c_uchar, + pub sdl_index: ::c_ushort, + pub sdl_type: u8, + pub sdl_nlen: u8, + pub sdl_alen: u8, + pub sdl_slen: u8, + pub sdl_data: [::c_char; 12], + } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::c_uint, + } + + pub struct __exit_status { + pub e_termination: u16, + pub e_exit: u16, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + _shm_internal: *mut ::c_void, + } + + pub struct utmp { + pub ut_line: [::c_char; UT_LINESIZE], + pub ut_name: [::c_char; UT_NAMESIZE], + pub ut_host: [::c_char; UT_HOSTSIZE], + pub ut_time: ::time_t + } + + pub struct lastlog { + pub ll_line: [::c_char; UT_LINESIZE], + pub ll_host: [::c_char; UT_HOSTSIZE], + pub ll_time: ::time_t + } + + pub struct timex { + pub modes: ::c_uint, + pub offset: ::c_long, + pub freq: ::c_long, + pub maxerror: ::c_long, + pub esterror: ::c_long, + pub status: ::c_int, + pub constant: ::c_long, + pub precision: ::c_long, + pub tolerance: ::c_long, + pub ppsfreq: ::c_long, + pub jitter: ::c_long, + pub shift: ::c_int, + pub stabil: ::c_long, + pub jitcnt: ::c_long, + pub calcnt: ::c_long, + pub errcnt: ::c_long, + pub stbcnt: ::c_long, + } + + pub struct ntptimeval { + pub time: ::timespec, + pub maxerror: ::c_long, + pub esterror: ::c_long, + pub tai: ::c_long, + pub time_state: ::c_int, + } + + // elf.h + + pub struct Elf32_Phdr { + pub p_type: Elf32_Word, + pub p_offset: Elf32_Off, + pub p_vaddr: Elf32_Addr, + pub p_paddr: Elf32_Addr, + pub p_filesz: Elf32_Word, + pub p_memsz: Elf32_Word, + pub p_flags: Elf32_Word, + pub p_align: Elf32_Word, + } + + pub struct Elf64_Phdr { + pub p_type: Elf64_Word, + pub p_flags: Elf64_Word, + pub p_offset: Elf64_Off, + pub p_vaddr: Elf64_Addr, + pub p_paddr: Elf64_Addr, + pub p_filesz: Elf64_Xword, + pub p_memsz: Elf64_Xword, + pub p_align: Elf64_Xword, + } + + pub struct Aux32Info { + pub a_type: Elf32_Word, + pub a_v: Elf32_Word, + } + + pub struct Aux64Info { + pub a_type: Elf64_Word, + pub a_v: Elf64_Xword, + } + + // link.h + + pub struct dl_phdr_info { + pub dlpi_addr: Elf_Addr, + pub dlpi_name: *const ::c_char, + pub dlpi_phdr: *const Elf_Phdr, + pub dlpi_phnum: Elf_Half, + pub dlpi_adds: ::c_ulonglong, + pub dlpi_subs: ::c_ulonglong, + pub dlpi_tls_modid: usize, + pub dlpi_tls_data: *mut ::c_void, + } + + pub struct _cpuset { + bits: [u32; 0] + } + + pub struct accept_filter_arg { + pub af_name: [::c_char; 16], + af_arg: [[::c_char; 10]; 24], + } + + pub struct ki_sigset_t { + pub __bits: [u32; 4], + } + + pub struct kinfo_proc2 { + pub p_forw: u64, + pub p_back: u64, + pub p_paddr: u64, + pub p_addr: u64, + pub p_fd: u64, + pub p_cwdi: u64, + pub p_stats: u64, + pub p_limit: u64, + pub p_vmspace: u64, + pub p_sigacts: u64, + pub p_sess: u64, + pub p_tsess: u64, + pub p_ru: u64, + pub p_eflag: i32, + pub p_exitsig: i32, + pub p_flag: i32, + pub p_pid: i32, + pub p_ppid: i32, + pub p_sid: i32, + pub p__pgid: i32, + pub p_tpgid: i32, + pub p_uid: u32, + pub p_ruid: u32, + pub p_gid: u32, + pub p_rgid: u32, + pub p_groups: [u32; KI_NGROUPS as usize], + pub p_ngroups: i16, + pub p_jobc: i16, + pub p_tdev: u32, + pub p_estcpu: u32, + pub p_rtime_sec: u32, + pub p_rtime_usec: u32, + pub p_cpticks: i32, + pub p_pctcpu: u32, + pub p_swtime: u32, + pub p_slptime: u32, + pub p_schedflags: i32, + pub p_uticks: u64, + pub p_sticks: u64, + pub p_iticks: u64, + pub p_tracep: u64, + pub p_traceflag: i32, + pub p_holdcnt: i32, + pub p_siglist: ki_sigset_t, + pub p_sigmask: ki_sigset_t, + pub p_sigignore: ki_sigset_t, + pub p_sigcatch: ki_sigset_t, + pub p_stat: i8, + pub p_priority: u8, + pub p_usrpri: u8, + pub p_nice: u8, + pub p_xstat: u16, + pub p_acflag: u16, + pub p_comm: [::c_char; KI_MAXCOMLEN as usize], + pub p_wmesg: [::c_char; KI_WMESGLEN as usize], + pub p_wchan: u64, + pub p_login: [::c_char; KI_MAXLOGNAME as usize], + pub p_vm_rssize: i32, + pub p_vm_tsize: i32, + pub p_vm_dsize: i32, + pub p_vm_ssize: i32, + pub p_uvalid: i64, + pub p_ustart_sec: u32, + pub p_ustart_usec: u32, + pub p_uutime_sec: u32, + pub p_uutime_usec: u32, + pub p_ustime_sec: u32, + pub p_ustime_usec: u32, + pub p_uru_maxrss: u64, + pub p_uru_ixrss: u64, + pub p_uru_idrss: u64, + pub p_uru_isrss: u64, + pub p_uru_minflt: u64, + pub p_uru_majflt: u64, + pub p_uru_nswap: u64, + pub p_uru_inblock: u64, + pub p_uru_oublock: u64, + pub p_uru_msgsnd: u64, + pub p_uru_msgrcv: u64, + pub p_uru_nsignals: u64, + pub p_uru_nvcsw: u64, + pub p_uru_nivcsw: u64, + pub p_uctime_sec: u32, + pub p_uctime_usec: u32, + pub p_cpuid: u64, + pub p_realflag: u64, + pub p_nlwps: u64, + pub p_nrlwps: u64, + pub p_realstat: u64, + pub p_svuid: u32, + pub p_svgid: u32, + pub p_ename: [::c_char; KI_MAXEMULLEN as usize], + pub p_vm_vsize: i64, + pub p_vm_msize: i64, + } + + pub struct kinfo_lwp { + pub l_forw: u64, + pub l_back: u64, + pub l_laddr: u64, + pub l_addr: u64, + pub l_lid: i32, + pub l_flag: i32, + pub l_swtime: u32, + pub l_slptime: u32, + pub l_schedflags: i32, + pub l_holdcnt: i32, + pub l_priority: u8, + pub l_usrpri: u8, + pub l_stat: i8, + l_pad1: i8, + l_pad2: i32, + pub l_wmesg: [::c_char; KI_WMESGLEN as usize], + pub l_wchan: u64, + pub l_cpuid: u64, + pub l_rtime_sec: u32, + pub l_rtime_usec: u32, + pub l_cpticks: u32, + pub l_pctcpu: u32, + pub l_pid: u32, + pub l_name: [::c_char; KI_LNAMELEN as usize], + } + + pub struct kinfo_vmentry { + pub kve_start: u64, + pub kve_end: u64, + pub kve_offset: u64, + pub kve_type: u32, + pub kve_flags: u32, + pub kve_count: u32, + pub kve_wired_count: u32, + pub kve_advice: u32, + pub kve_attributes: u32, + pub kve_protection: u32, + pub kve_max_protection: u32, + pub kve_ref_count: u32, + pub kve_inheritance: u32, + pub kve_vn_fileid: u64, + pub kve_vn_size: u64, + pub kve_vn_fsid: u64, + pub kve_vn_rdev: u64, + pub kve_vn_type: u32, + pub kve_vn_mode: u32, + pub kve_path: [[::c_char; 32]; 32], + } + + pub struct __c_anonymous_posix_spawn_fae_open { + pub path: *mut ::c_char, + pub oflag: ::c_int, + pub mode: ::mode_t, + } + + pub struct __c_anonymous_posix_spawn_fae_dup2 { + pub newfildes: ::c_int, + } + + pub struct posix_spawnattr_t { + pub sa_flags: ::c_short, + pub sa_pgroup: ::pid_t, + pub sa_schedparam: ::sched_param, + pub sa_schedpolicy: ::c_int, + pub sa_sigdefault: sigset_t, + pub sa_sigmask: sigset_t, + } + + pub struct posix_spawn_file_actions_entry_t { + pub fae_action: fae_action, + pub fae_fildes: ::c_int, + #[cfg(libc_union)] + pub fae_data: __c_anonymous_posix_spawn_fae, + } + + pub struct posix_spawn_file_actions_t { + pub size: ::c_uint, + pub len: ::c_uint, + #[cfg(libc_union)] + pub fae: *mut posix_spawn_file_actions_entry_t, + } + + pub struct ptrace_lwpinfo { + pub pl_lwpid: lwpid_t, + pub pl_event: ::c_int, + } + + pub struct ptrace_lwpstatus { + pub pl_lwpid: lwpid_t, + pub pl_sigpend: sigset_t, + pub pl_sigmask: sigset_t, + pub pl_name: [::c_char; 20], + pub pl_private: *mut ::c_void, + } + + pub struct ptrace_siginfo { + pub psi_siginfo: siginfo_t, + pub psi_lwpid: lwpid_t, + } + + pub struct ptrace_event { + pub pe_set_event: ::c_int, + } + + pub struct sysctldesc { + pub descr_num: i32, + pub descr_ver: u32, + pub descr_len: u32, + pub descr_str: [::c_char; 1], + } + + pub struct ifreq { + pub _priv: [[::c_char; 6]; 24], + } + + pub struct ifconf { + pub ifc_len: ::c_int, + #[cfg(libc_union)] + pub ifc_ifcu: __c_anonymous_ifc_ifcu, + } +} + +s_no_extra_traits! { + + pub struct utmpx { + pub ut_name: [::c_char; _UTX_USERSIZE], + pub ut_id: [::c_char; _UTX_IDSIZE], + pub ut_line: [::c_char; _UTX_LINESIZE], + pub ut_host: [::c_char; _UTX_HOSTSIZE], + pub ut_session: u16, + pub ut_type: u16, + pub ut_pid: ::pid_t, + pub ut_exit: __exit_status, // FIXME: when anonymous struct are supported + pub ut_ss: sockaddr_storage, + pub ut_tv: ::timeval, + pub ut_pad: [u8; _UTX_PADSIZE], + } + + pub struct lastlogx { + pub ll_tv: ::timeval, + pub ll_line: [::c_char; _UTX_LINESIZE], + pub ll_host: [::c_char; _UTX_HOSTSIZE], + pub ll_ss: sockaddr_storage, + } + + pub struct in_pktinfo { + pub ipi_addr: ::in_addr, + pub ipi_ifindex: ::c_uint, + } + + pub struct arphdr { + pub ar_hrd: u16, + pub ar_pro: u16, + pub ar_hln: u8, + pub ar_pln: u8, + pub ar_op: u16, + } + + pub struct in_addr { + pub s_addr: ::in_addr_t, + } + + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct sockaddr_in { + pub sin_len: u8, + pub sin_family: ::sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [i8; 8], + } + + pub struct dirent { + pub d_fileno: ::ino_t, + pub d_reclen: u16, + pub d_namlen: u16, + pub d_type: u8, + pub d_name: [::c_char; 512], + } + + pub struct statvfs { + pub f_flag: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_iosize: ::c_ulong, + + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_bresvd: ::fsblkcnt_t, + + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fresvd: ::fsfilcnt_t, + + pub f_syncreads: u64, + pub f_syncwrites: u64, + + pub f_asyncreads: u64, + pub f_asyncwrites: u64, + + pub f_fsidx: ::fsid_t, + pub f_fsid: ::c_ulong, + pub f_namemax: ::c_ulong, + pub f_owner: ::uid_t, + + pub f_spare: [u32; 4], + + pub f_fstypename: [::c_char; 32], + pub f_mntonname: [::c_char; 1024], + pub f_mntfromname: [::c_char; 1024], + } + + pub struct sockaddr_storage { + pub ss_len: u8, + pub ss_family: ::sa_family_t, + __ss_pad1: [u8; 6], + __ss_pad2: i64, + __ss_pad3: [u8; 112], + } + + pub struct sigevent { + pub sigev_notify: ::c_int, + pub sigev_signo: ::c_int, + pub sigev_value: ::sigval, + __unused1: *mut ::c_void, //actually a function pointer + pub sigev_notify_attributes: *mut ::c_void + } + + #[cfg(libc_union)] + pub union __c_anonymous_posix_spawn_fae { + pub open: __c_anonymous_posix_spawn_fae_open, + pub dup2: __c_anonymous_posix_spawn_fae_dup2, + } + + #[cfg(libc_union)] + pub union __c_anonymous_ifc_ifcu { + pub ifcu_buf: *mut ::c_void, + pub ifcu_req: *mut ifreq, + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for utmpx { + fn eq(&self, other: &utmpx) -> bool { + self.ut_type == other.ut_type + && self.ut_pid == other.ut_pid + && self.ut_name == other.ut_name + && self.ut_line == other.ut_line + && self.ut_id == other.ut_id + && self.ut_exit == other.ut_exit + && self.ut_session == other.ut_session + && self.ut_tv == other.ut_tv + && self.ut_ss == other.ut_ss + && self + .ut_pad + .iter() + .zip(other.ut_pad.iter()) + .all(|(a,b)| a == b) + && self + .ut_host + .iter() + .zip(other.ut_host.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for utmpx {} + + impl ::fmt::Debug for utmpx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmpx") + .field("ut_name", &self.ut_name) + .field("ut_id", &self.ut_id) + .field("ut_line", &self.ut_line) + // FIXME .field("ut_host", &self.ut_host) + .field("ut_session", &self.ut_session) + .field("ut_type", &self.ut_type) + .field("ut_pid", &self.ut_pid) + .field("ut_exit", &self.ut_exit) + .field("ut_ss", &self.ut_ss) + .field("ut_tv", &self.ut_tv) + // FIXME .field("ut_pad", &self.ut_pad) + .finish() + } + } + + impl ::hash::Hash for utmpx { + fn hash(&self, state: &mut H) { + self.ut_name.hash(state); + self.ut_type.hash(state); + self.ut_pid.hash(state); + self.ut_line.hash(state); + self.ut_id.hash(state); + self.ut_host.hash(state); + self.ut_exit.hash(state); + self.ut_session.hash(state); + self.ut_tv.hash(state); + self.ut_ss.hash(state); + self.ut_pad.hash(state); + } + } + + impl PartialEq for lastlogx { + fn eq(&self, other: &lastlogx) -> bool { + self.ll_tv == other.ll_tv + && self.ll_line == other.ll_line + && self.ll_ss == other.ll_ss + && self + .ll_host + .iter() + .zip(other.ll_host.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for lastlogx {} + + impl ::fmt::Debug for lastlogx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("lastlogx") + .field("ll_tv", &self.ll_tv) + .field("ll_line", &self.ll_line) + // FIXME.field("ll_host", &self.ll_host) + .field("ll_ss", &self.ll_ss) + .finish() + } + } + + impl ::hash::Hash for lastlogx { + fn hash(&self, state: &mut H) { + self.ll_tv.hash(state); + self.ll_line.hash(state); + self.ll_host.hash(state); + self.ll_ss.hash(state); + } + } + + impl PartialEq for in_pktinfo { + fn eq(&self, other: &in_pktinfo) -> bool { + self.ipi_addr == other.ipi_addr + && self.ipi_ifindex == other.ipi_ifindex + } + } + impl Eq for in_pktinfo {} + impl ::fmt::Debug for in_pktinfo { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("in_pktinfo") + .field("ipi_addr", &self.ipi_addr) + .field("ipi_ifindex", &self.ipi_ifindex) + .finish() + } + } + impl ::hash::Hash for in_pktinfo { + fn hash(&self, state: &mut H) { + self.ipi_addr.hash(state); + self.ipi_ifindex.hash(state); + } + } + + impl PartialEq for arphdr { + fn eq(&self, other: &arphdr) -> bool { + self.ar_hrd == other.ar_hrd + && self.ar_pro == other.ar_pro + && self.ar_hln == other.ar_hln + && self.ar_pln == other.ar_pln + && self.ar_op == other.ar_op + } + } + impl Eq for arphdr {} + impl ::fmt::Debug for arphdr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let ar_hrd = self.ar_hrd; + let ar_pro = self.ar_pro; + let ar_op = self.ar_op; + f.debug_struct("arphdr") + .field("ar_hrd", &ar_hrd) + .field("ar_pro", &ar_pro) + .field("ar_hln", &self.ar_hln) + .field("ar_pln", &self.ar_pln) + .field("ar_op", &ar_op) + .finish() + } + } + impl ::hash::Hash for arphdr { + fn hash(&self, state: &mut H) { + let ar_hrd = self.ar_hrd; + let ar_pro = self.ar_pro; + let ar_op = self.ar_op; + ar_hrd.hash(state); + ar_pro.hash(state); + self.ar_hln.hash(state); + self.ar_pln.hash(state); + ar_op.hash(state); + } + } + + impl PartialEq for in_addr { + fn eq(&self, other: &in_addr) -> bool { + self.s_addr == other.s_addr + } + } + impl Eq for in_addr {} + impl ::fmt::Debug for in_addr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let s_addr = self.s_addr; + f.debug_struct("in_addr") + .field("s_addr", &s_addr) + .finish() + } + } + impl ::hash::Hash for in_addr { + fn hash(&self, state: &mut H) { + let s_addr = self.s_addr; + s_addr.hash(state); + } + } + + impl PartialEq for ip_mreq { + fn eq(&self, other: &ip_mreq) -> bool { + self.imr_multiaddr == other.imr_multiaddr + && self.imr_interface == other.imr_interface + } + } + impl Eq for ip_mreq {} + impl ::fmt::Debug for ip_mreq { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ip_mreq") + .field("imr_multiaddr", &self.imr_multiaddr) + .field("imr_interface", &self.imr_interface) + .finish() + } + } + impl ::hash::Hash for ip_mreq { + fn hash(&self, state: &mut H) { + self.imr_multiaddr.hash(state); + self.imr_interface.hash(state); + } + } + + impl PartialEq for sockaddr_in { + fn eq(&self, other: &sockaddr_in) -> bool { + self.sin_len == other.sin_len + && self.sin_family == other.sin_family + && self.sin_port == other.sin_port + && self.sin_addr == other.sin_addr + && self.sin_zero == other.sin_zero + } + } + impl Eq for sockaddr_in {} + impl ::fmt::Debug for sockaddr_in { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_in") + .field("sin_len", &self.sin_len) + .field("sin_family", &self.sin_family) + .field("sin_port", &self.sin_port) + .field("sin_addr", &self.sin_addr) + .field("sin_zero", &self.sin_zero) + .finish() + } + } + impl ::hash::Hash for sockaddr_in { + fn hash(&self, state: &mut H) { + self.sin_len.hash(state); + self.sin_family.hash(state); + self.sin_port.hash(state); + self.sin_addr.hash(state); + self.sin_zero.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_fileno == other.d_fileno + && self.d_reclen == other.d_reclen + && self.d_namlen == other.d_namlen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_fileno", &self.d_fileno) + .field("d_reclen", &self.d_reclen) + .field("d_namlen", &self.d_namlen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_fileno.hash(state); + self.d_reclen.hash(state); + self.d_namlen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for statvfs { + fn eq(&self, other: &statvfs) -> bool { + self.f_flag == other.f_flag + && self.f_bsize == other.f_bsize + && self.f_frsize == other.f_frsize + && self.f_iosize == other.f_iosize + && self.f_blocks == other.f_blocks + && self.f_bfree == other.f_bfree + && self.f_bavail == other.f_bavail + && self.f_bresvd == other.f_bresvd + && self.f_files == other.f_files + && self.f_ffree == other.f_ffree + && self.f_favail == other.f_favail + && self.f_fresvd == other.f_fresvd + && self.f_syncreads == other.f_syncreads + && self.f_syncwrites == other.f_syncwrites + && self.f_asyncreads == other.f_asyncreads + && self.f_asyncwrites == other.f_asyncwrites + && self.f_fsidx == other.f_fsidx + && self.f_fsid == other.f_fsid + && self.f_namemax == other.f_namemax + && self.f_owner == other.f_owner + && self.f_spare == other.f_spare + && self.f_fstypename == other.f_fstypename + && self + .f_mntonname + .iter() + .zip(other.f_mntonname.iter()) + .all(|(a,b)| a == b) + && self + .f_mntfromname + .iter() + .zip(other.f_mntfromname.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for statvfs {} + impl ::fmt::Debug for statvfs { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("statvfs") + .field("f_flag", &self.f_flag) + .field("f_bsize", &self.f_bsize) + .field("f_frsize", &self.f_frsize) + .field("f_iosize", &self.f_iosize) + .field("f_blocks", &self.f_blocks) + .field("f_bfree", &self.f_bfree) + .field("f_bavail", &self.f_bavail) + .field("f_bresvd", &self.f_bresvd) + .field("f_files", &self.f_files) + .field("f_ffree", &self.f_ffree) + .field("f_favail", &self.f_favail) + .field("f_fresvd", &self.f_fresvd) + .field("f_syncreads", &self.f_syncreads) + .field("f_syncwrites", &self.f_syncwrites) + .field("f_asyncreads", &self.f_asyncreads) + .field("f_asyncwrites", &self.f_asyncwrites) + .field("f_fsidx", &self.f_fsidx) + .field("f_fsid", &self.f_fsid) + .field("f_namemax", &self.f_namemax) + .field("f_owner", &self.f_owner) + .field("f_spare", &self.f_spare) + .field("f_fstypename", &self.f_fstypename) + // FIXME: .field("f_mntonname", &self.f_mntonname) + // FIXME: .field("f_mntfromname", &self.f_mntfromname) + .finish() + } + } + impl ::hash::Hash for statvfs { + fn hash(&self, state: &mut H) { + self.f_flag.hash(state); + self.f_bsize.hash(state); + self.f_frsize.hash(state); + self.f_iosize.hash(state); + self.f_blocks.hash(state); + self.f_bfree.hash(state); + self.f_bavail.hash(state); + self.f_bresvd.hash(state); + self.f_files.hash(state); + self.f_ffree.hash(state); + self.f_favail.hash(state); + self.f_fresvd.hash(state); + self.f_syncreads.hash(state); + self.f_syncwrites.hash(state); + self.f_asyncreads.hash(state); + self.f_asyncwrites.hash(state); + self.f_fsidx.hash(state); + self.f_fsid.hash(state); + self.f_namemax.hash(state); + self.f_owner.hash(state); + self.f_spare.hash(state); + self.f_fstypename.hash(state); + self.f_mntonname.hash(state); + self.f_mntfromname.hash(state); + } + } + + impl PartialEq for sockaddr_storage { + fn eq(&self, other: &sockaddr_storage) -> bool { + self.ss_len == other.ss_len + && self.ss_family == other.ss_family + && self.__ss_pad1 == other.__ss_pad1 + && self.__ss_pad2 == other.__ss_pad2 + && self + .__ss_pad3 + .iter() + .zip(other.__ss_pad3.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sockaddr_storage {} + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("ss_len", &self.ss_len) + .field("ss_family", &self.ss_family) + .field("__ss_pad1", &self.__ss_pad1) + .field("__ss_pad2", &self.__ss_pad2) + // FIXME: .field("__ss_pad3", &self.__ss_pad3) + .finish() + } + } + impl ::hash::Hash for sockaddr_storage { + fn hash(&self, state: &mut H) { + self.ss_len.hash(state); + self.ss_family.hash(state); + self.__ss_pad1.hash(state); + self.__ss_pad2.hash(state); + self.__ss_pad3.hash(state); + } + } + + impl PartialEq for sigevent { + fn eq(&self, other: &sigevent) -> bool { + self.sigev_notify == other.sigev_notify + && self.sigev_signo == other.sigev_signo + && self.sigev_value == other.sigev_value + && self.sigev_notify_attributes + == other.sigev_notify_attributes + } + } + impl Eq for sigevent {} + impl ::fmt::Debug for sigevent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigevent") + .field("sigev_notify", &self.sigev_notify) + .field("sigev_signo", &self.sigev_signo) + .field("sigev_value", &self.sigev_value) + .field("sigev_notify_attributes", + &self.sigev_notify_attributes) + .finish() + } + } + impl ::hash::Hash for sigevent { + fn hash(&self, state: &mut H) { + self.sigev_notify.hash(state); + self.sigev_signo.hash(state); + self.sigev_value.hash(state); + self.sigev_notify_attributes.hash(state); + } + } + + #[cfg(libc_union)] + impl Eq for __c_anonymous_posix_spawn_fae {} + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_posix_spawn_fae { + fn eq(&self, other: &__c_anonymous_posix_spawn_fae) -> bool { + unsafe { + self.open == other.open + || self.dup2 == other.dup2 + } + } + } + + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_posix_spawn_fae { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + unsafe { + f.debug_struct("__c_anonymous_posix_fae") + .field("open", &self.open) + .field("dup2", &self.dup2) + .finish() + } + } + } + + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_posix_spawn_fae { + fn hash(&self, state: &mut H) { + unsafe { + self.open.hash(state); + self.dup2.hash(state); + } + } + } + + #[cfg(libc_union)] + impl Eq for __c_anonymous_ifc_ifcu {} + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_ifc_ifcu { + fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool { + unsafe { + self.ifcu_buf == other.ifcu_buf + || self.ifcu_req == other.ifcu_req + } + } + } + + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ifc_ifcu { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + unsafe { + f.debug_struct("__c_anonymous_ifc_ifcu") + .field("ifcu_buf", &self.ifcu_buf) + .field("ifcu_req", &self.ifcu_req) + .finish() + } + } + } + + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_ifc_ifcu { + fn hash(&self, state: &mut H) { + unsafe { + self.ifcu_buf.hash(state); + self.ifcu_req.hash(state); + } + } + } + } +} + +pub const AT_FDCWD: ::c_int = -100; +pub const AT_EACCESS: ::c_int = 0x100; +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200; +pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; +pub const AT_REMOVEDIR: ::c_int = 0x800; + +pub const AT_NULL: ::c_int = 0; +pub const AT_IGNORE: ::c_int = 1; +pub const AT_EXECFD: ::c_int = 2; +pub const AT_PHDR: ::c_int = 3; +pub const AT_PHENT: ::c_int = 4; +pub const AT_PHNUM: ::c_int = 5; +pub const AT_PAGESZ: ::c_int = 6; +pub const AT_BASE: ::c_int = 7; +pub const AT_FLAGS: ::c_int = 8; +pub const AT_ENTRY: ::c_int = 9; +pub const AT_DCACHEBSIZE: ::c_int = 10; +pub const AT_ICACHEBSIZE: ::c_int = 11; +pub const AT_UCACHEBSIZE: ::c_int = 12; +pub const AT_STACKBASE: ::c_int = 13; +pub const AT_EUID: ::c_int = 2000; +pub const AT_RUID: ::c_int = 2001; +pub const AT_EGID: ::c_int = 2002; +pub const AT_RGID: ::c_int = 2003; +pub const AT_SUN_LDELF: ::c_int = 2004; +pub const AT_SUN_LDSHDR: ::c_int = 2005; +pub const AT_SUN_LDNAME: ::c_int = 2006; +pub const AT_SUN_LDPGSIZE: ::c_int = 2007; +pub const AT_SUN_PLATFORM: ::c_int = 2008; +pub const AT_SUN_HWCAP: ::c_int = 2009; +pub const AT_SUN_IFLUSH: ::c_int = 2010; +pub const AT_SUN_CPU: ::c_int = 2011; +pub const AT_SUN_EMUL_ENTRY: ::c_int = 2012; +pub const AT_SUN_EMUL_EXECFD: ::c_int = 2013; +pub const AT_SUN_EXECNAME: ::c_int = 2014; + +pub const EXTATTR_NAMESPACE_USER: ::c_int = 1; +pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2; + +pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE; +pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE; +pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY; +pub const LC_NUMERIC_MASK: ::c_int = 1 << ::LC_NUMERIC; +pub const LC_TIME_MASK: ::c_int = 1 << ::LC_TIME; +pub const LC_MESSAGES_MASK: ::c_int = 1 << ::LC_MESSAGES; +pub const LC_ALL_MASK: ::c_int = !0; + +pub const ERA: ::nl_item = 52; +pub const ERA_D_FMT: ::nl_item = 53; +pub const ERA_D_T_FMT: ::nl_item = 54; +pub const ERA_T_FMT: ::nl_item = 55; +pub const ALT_DIGITS: ::nl_item = 56; + +pub const O_CLOEXEC: ::c_int = 0x400000; +pub const O_ALT_IO: ::c_int = 0x40000; +pub const O_NOSIGPIPE: ::c_int = 0x1000000; +pub const O_SEARCH: ::c_int = 0x800000; +pub const O_DIRECTORY: ::c_int = 0x200000; +pub const O_DIRECT: ::c_int = 0x00080000; +pub const O_RSYNC: ::c_int = 0x00020000; + +pub const MS_SYNC: ::c_int = 0x4; +pub const MS_INVALIDATE: ::c_int = 0x2; + +// Here because they are not present on OpenBSD +// (https://github.com/openbsd/src/blob/master/sys/sys/resource.h) +pub const RLIMIT_SBSIZE: ::c_int = 9; +pub const RLIMIT_AS: ::c_int = 10; +pub const RLIMIT_NTHR: ::c_int = 11; + +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] +pub const RLIM_NLIMITS: ::c_int = 12; + +pub const EIDRM: ::c_int = 82; +pub const ENOMSG: ::c_int = 83; +pub const EOVERFLOW: ::c_int = 84; +pub const EILSEQ: ::c_int = 85; +pub const ENOTSUP: ::c_int = 86; +pub const ECANCELED: ::c_int = 87; +pub const EBADMSG: ::c_int = 88; +pub const ENODATA: ::c_int = 89; +pub const ENOSR: ::c_int = 90; +pub const ENOSTR: ::c_int = 91; +pub const ETIME: ::c_int = 92; +pub const ENOATTR: ::c_int = 93; +pub const EMULTIHOP: ::c_int = 94; +pub const ENOLINK: ::c_int = 95; +pub const EPROTO: ::c_int = 96; +pub const ELAST: ::c_int = 96; + +pub const F_DUPFD_CLOEXEC: ::c_int = 12; +pub const F_CLOSEM: ::c_int = 10; +pub const F_GETNOSIGPIPE: ::c_int = 13; +pub const F_SETNOSIGPIPE: ::c_int = 14; +pub const F_MAXFD: ::c_int = 11; +pub const F_GETPATH: ::c_int = 15; + +pub const FUTEX_WAIT: ::c_int = 0; +pub const FUTEX_WAKE: ::c_int = 1; +pub const FUTEX_FD: ::c_int = 2; +pub const FUTEX_REQUEUE: ::c_int = 3; +pub const FUTEX_CMP_REQUEUE: ::c_int = 4; +pub const FUTEX_WAKE_OP: ::c_int = 5; +pub const FUTEX_LOCK_PI: ::c_int = 6; +pub const FUTEX_UNLOCK_PI: ::c_int = 7; +pub const FUTEX_TRYLOCK_PI: ::c_int = 8; +pub const FUTEX_WAIT_BITSET: ::c_int = 9; +pub const FUTEX_WAKE_BITSET: ::c_int = 10; +pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11; +pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12; +pub const FUTEX_PRIVATE_FLAG: ::c_int = 1 << 7; +pub const FUTEX_CLOCK_REALTIME: ::c_int = 1 << 8; +pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME); +pub const FUTEX_WAITERS: u32 = 1 << 31; +pub const FUTEX_OWNER_DIED: u32 = 1 << 30; +pub const FUTEX_SYNCOBJ_1: u32 = 1 << 29; +pub const FUTEX_SYNCOBJ_0: u32 = 1 << 28; +pub const FUTEX_TID_MASK: u32 = (1 << 28) - 1; +pub const FUTEX_BITSET_MATCH_ANY: u32 = !0; + +pub const IP_RECVDSTADDR: ::c_int = 7; +pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR; +pub const IP_RECVIF: ::c_int = 20; +pub const IP_PKTINFO: ::c_int = 25; +pub const IP_RECVPKTINFO: ::c_int = 26; +pub const IPV6_JOIN_GROUP: ::c_int = 12; +pub const IPV6_LEAVE_GROUP: ::c_int = 13; + +pub const TCP_KEEPIDLE: ::c_int = 3; +pub const TCP_KEEPINTVL: ::c_int = 5; +pub const TCP_KEEPCNT: ::c_int = 6; +pub const TCP_KEEPINIT: ::c_int = 7; +pub const TCP_INFO: ::c_int = 9; +pub const TCP_MD5SIG: ::c_int = 0x10; +pub const TCP_CONGCTL: ::c_int = 0x20; + +pub const SOCK_CONN_DGRAM: ::c_int = 6; +pub const SOCK_DCCP: ::c_int = SOCK_CONN_DGRAM; +pub const SOCK_NOSIGPIPE: ::c_int = 0x40000000; +pub const SOCK_FLAGS_MASK: ::c_int = 0xf0000000; + +pub const SO_SNDTIMEO: ::c_int = 0x100b; +pub const SO_RCVTIMEO: ::c_int = 0x100c; +pub const SO_ACCEPTFILTER: ::c_int = 0x1000; +pub const SO_TIMESTAMP: ::c_int = 0x2000; +pub const SO_OVERFLOWED: ::c_int = 0x1009; +pub const SO_NOHEADER: ::c_int = 0x100a; + +// http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/un.h?annotate +pub const LOCAL_OCREDS: ::c_int = 0x0001; // pass credentials to receiver +pub const LOCAL_CONNWAIT: ::c_int = 0x0002; // connects block until accepted +pub const LOCAL_PEEREID: ::c_int = 0x0003; // get peer identification +pub const LOCAL_CREDS: ::c_int = 0x0004; // pass credentials to receiver + +// https://github.com/NetBSD/src/blob/trunk/sys/net/if.h#L373 +pub const IFF_UP: ::c_int = 0x0001; // interface is up +pub const IFF_BROADCAST: ::c_int = 0x0002; // broadcast address valid +pub const IFF_DEBUG: ::c_int = 0x0004; // turn on debugging +pub const IFF_LOOPBACK: ::c_int = 0x0008; // is a loopback net +pub const IFF_POINTOPOINT: ::c_int = 0x0010; // interface is point-to-point link +pub const IFF_NOTRAILERS: ::c_int = 0x0020; // avoid use of trailers +pub const IFF_RUNNING: ::c_int = 0x0040; // resources allocated +pub const IFF_NOARP: ::c_int = 0x0080; // no address resolution protocol +pub const IFF_PROMISC: ::c_int = 0x0100; // receive all packets +pub const IFF_ALLMULTI: ::c_int = 0x0200; // receive all multicast packets +pub const IFF_OACTIVE: ::c_int = 0x0400; // transmission in progress +pub const IFF_SIMPLEX: ::c_int = 0x0800; // can't hear own transmissions +pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit +pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit +pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit +pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast + +// sys/netinet/in.h +// Protocols (RFC 1700) +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// Hop-by-hop option header +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// gateway^2 (deprecated) +pub const IPPROTO_GGP: ::c_int = 3; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +// IPPROTO_UDP defined in src/unix/mod.rs +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// DCCP +pub const IPPROTO_DCCP: ::c_int = 33; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +/// IP Mobility RFC 2004 +pub const IPPROTO_MOBILE: ::c_int = 55; +/// IPv6 ICMP +pub const IPPROTO_IPV6_ICMP: ::c_int = 58; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +/// ISO cnlp +pub const IPPROTO_EON: ::c_int = 80; +/// Ethernet-in-IP +pub const IPPROTO_ETHERIP: ::c_int = 97; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// Protocol indep. multicast +pub const IPPROTO_PIM: ::c_int = 103; +/// IP Payload Comp. Protocol +pub const IPPROTO_IPCOMP: ::c_int = 108; +/// VRRP RFC 2338 +pub const IPPROTO_VRRP: ::c_int = 112; +/// Common Address Resolution Protocol +pub const IPPROTO_CARP: ::c_int = 112; +/// L2TPv3 +pub const IPPROTO_L2TP: ::c_int = 115; +/// SCTP +pub const IPPROTO_SCTP: ::c_int = 132; +/// PFSYNC +pub const IPPROTO_PFSYNC: ::c_int = 240; +pub const IPPROTO_MAX: ::c_int = 256; + +/// last return value of *_input(), meaning "all job for this pkt is done". +pub const IPPROTO_DONE: ::c_int = 257; + +/// sysctl placeholder for (FAST_)IPSEC +pub const CTL_IPPROTO_IPSEC: ::c_int = 258; + +pub const AF_OROUTE: ::c_int = 17; +pub const AF_ARP: ::c_int = 28; +pub const pseudo_AF_KEY: ::c_int = 29; +pub const pseudo_AF_HDRCMPLT: ::c_int = 30; +pub const AF_BLUETOOTH: ::c_int = 31; +pub const AF_IEEE80211: ::c_int = 32; +pub const AF_MPLS: ::c_int = 33; +pub const AF_ROUTE: ::c_int = 34; +pub const NET_RT_DUMP: ::c_int = 1; +pub const NET_RT_FLAGS: ::c_int = 2; +pub const NET_RT_OOOIFLIST: ::c_int = 3; +pub const NET_RT_OOIFLIST: ::c_int = 4; +pub const NET_RT_OIFLIST: ::c_int = 5; +pub const NET_RT_IFLIST: ::c_int = 6; +pub const NET_RT_MAXID: ::c_int = 7; + +pub const PF_OROUTE: ::c_int = AF_OROUTE; +pub const PF_ARP: ::c_int = AF_ARP; +pub const PF_KEY: ::c_int = pseudo_AF_KEY; +pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; +pub const PF_MPLS: ::c_int = AF_MPLS; +pub const PF_ROUTE: ::c_int = AF_ROUTE; + +pub const MSG_NBIO: ::c_int = 0x1000; +pub const MSG_WAITFORONE: ::c_int = 0x2000; +pub const MSG_NOTIFICATION: ::c_int = 0x4000; + +pub const SCM_TIMESTAMP: ::c_int = 0x08; +pub const SCM_CREDS: ::c_int = 0x10; + +pub const O_DSYNC: ::c_int = 0x10000; + +pub const MAP_RENAME: ::c_int = 0x20; +pub const MAP_NORESERVE: ::c_int = 0x40; +pub const MAP_HASSEMAPHORE: ::c_int = 0x200; +pub const MAP_WIRED: ::c_int = 0x800; +pub const MAP_STACK: ::c_int = 0x2000; +// map alignment aliases for MAP_ALIGNED +pub const MAP_ALIGNMENT_SHIFT: ::c_int = 24; +pub const MAP_ALIGNMENT_MASK: ::c_int = 0xff << MAP_ALIGNMENT_SHIFT; +pub const MAP_ALIGNMENT_64KB: ::c_int = 16 << MAP_ALIGNMENT_SHIFT; +pub const MAP_ALIGNMENT_16MB: ::c_int = 24 << MAP_ALIGNMENT_SHIFT; +pub const MAP_ALIGNMENT_4GB: ::c_int = 32 << MAP_ALIGNMENT_SHIFT; +pub const MAP_ALIGNMENT_1TB: ::c_int = 40 << MAP_ALIGNMENT_SHIFT; +pub const MAP_ALIGNMENT_256TB: ::c_int = 48 << MAP_ALIGNMENT_SHIFT; +pub const MAP_ALIGNMENT_64PB: ::c_int = 56 << MAP_ALIGNMENT_SHIFT; +// mremap flag +pub const MAP_REMAPDUP: ::c_int = 0x004; + +pub const DCCP_TYPE_REQUEST: ::c_int = 0; +pub const DCCP_TYPE_RESPONSE: ::c_int = 1; +pub const DCCP_TYPE_DATA: ::c_int = 2; +pub const DCCP_TYPE_ACK: ::c_int = 3; +pub const DCCP_TYPE_DATAACK: ::c_int = 4; +pub const DCCP_TYPE_CLOSEREQ: ::c_int = 5; +pub const DCCP_TYPE_CLOSE: ::c_int = 6; +pub const DCCP_TYPE_RESET: ::c_int = 7; +pub const DCCP_TYPE_MOVE: ::c_int = 8; + +pub const DCCP_FEATURE_CC: ::c_int = 1; +pub const DCCP_FEATURE_ECN: ::c_int = 2; +pub const DCCP_FEATURE_ACKRATIO: ::c_int = 3; +pub const DCCP_FEATURE_ACKVECTOR: ::c_int = 4; +pub const DCCP_FEATURE_MOBILITY: ::c_int = 5; +pub const DCCP_FEATURE_LOSSWINDOW: ::c_int = 6; +pub const DCCP_FEATURE_CONN_NONCE: ::c_int = 8; +pub const DCCP_FEATURE_IDENTREG: ::c_int = 7; + +pub const DCCP_OPT_PADDING: ::c_int = 0; +pub const DCCP_OPT_DATA_DISCARD: ::c_int = 1; +pub const DCCP_OPT_SLOW_RECV: ::c_int = 2; +pub const DCCP_OPT_BUF_CLOSED: ::c_int = 3; +pub const DCCP_OPT_CHANGE_L: ::c_int = 32; +pub const DCCP_OPT_CONFIRM_L: ::c_int = 33; +pub const DCCP_OPT_CHANGE_R: ::c_int = 34; +pub const DCCP_OPT_CONFIRM_R: ::c_int = 35; +pub const DCCP_OPT_INIT_COOKIE: ::c_int = 36; +pub const DCCP_OPT_NDP_COUNT: ::c_int = 37; +pub const DCCP_OPT_ACK_VECTOR0: ::c_int = 38; +pub const DCCP_OPT_ACK_VECTOR1: ::c_int = 39; +pub const DCCP_OPT_RECV_BUF_DROPS: ::c_int = 40; +pub const DCCP_OPT_TIMESTAMP: ::c_int = 41; +pub const DCCP_OPT_TIMESTAMP_ECHO: ::c_int = 42; +pub const DCCP_OPT_ELAPSEDTIME: ::c_int = 43; +pub const DCCP_OPT_DATACHECKSUM: ::c_int = 44; + +pub const DCCP_REASON_UNSPEC: ::c_int = 0; +pub const DCCP_REASON_CLOSED: ::c_int = 1; +pub const DCCP_REASON_INVALID: ::c_int = 2; +pub const DCCP_REASON_OPTION_ERR: ::c_int = 3; +pub const DCCP_REASON_FEA_ERR: ::c_int = 4; +pub const DCCP_REASON_CONN_REF: ::c_int = 5; +pub const DCCP_REASON_BAD_SNAME: ::c_int = 6; +pub const DCCP_REASON_BAD_COOKIE: ::c_int = 7; +pub const DCCP_REASON_INV_MOVE: ::c_int = 8; +pub const DCCP_REASON_UNANSW_CH: ::c_int = 10; +pub const DCCP_REASON_FRUITLESS_NEG: ::c_int = 11; + +pub const DCCP_CCID: ::c_int = 1; +pub const DCCP_CSLEN: ::c_int = 2; +pub const DCCP_MAXSEG: ::c_int = 4; +pub const DCCP_SERVICE: ::c_int = 8; + +pub const DCCP_NDP_LIMIT: ::c_int = 16; +pub const DCCP_SEQ_NUM_LIMIT: ::c_int = 16777216; +pub const DCCP_MAX_OPTIONS: ::c_int = 32; +pub const DCCP_MAX_PKTS: ::c_int = 100; + +pub const _PC_LINK_MAX: ::c_int = 1; +pub const _PC_MAX_CANON: ::c_int = 2; +pub const _PC_MAX_INPUT: ::c_int = 3; +pub const _PC_NAME_MAX: ::c_int = 4; +pub const _PC_PATH_MAX: ::c_int = 5; +pub const _PC_PIPE_BUF: ::c_int = 6; +pub const _PC_CHOWN_RESTRICTED: ::c_int = 7; +pub const _PC_NO_TRUNC: ::c_int = 8; +pub const _PC_VDISABLE: ::c_int = 9; +pub const _PC_SYNC_IO: ::c_int = 10; +pub const _PC_FILESIZEBITS: ::c_int = 11; +pub const _PC_SYMLINK_MAX: ::c_int = 12; +pub const _PC_2_SYMLINKS: ::c_int = 13; +pub const _PC_ACL_EXTENDED: ::c_int = 14; +pub const _PC_MIN_HOLE_SIZE: ::c_int = 15; + +pub const _SC_SYNCHRONIZED_IO: ::c_int = 31; +pub const _SC_IOV_MAX: ::c_int = 32; +pub const _SC_MAPPED_FILES: ::c_int = 33; +pub const _SC_MEMLOCK: ::c_int = 34; +pub const _SC_MEMLOCK_RANGE: ::c_int = 35; +pub const _SC_MEMORY_PROTECTION: ::c_int = 36; +pub const _SC_LOGIN_NAME_MAX: ::c_int = 37; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 38; +pub const _SC_CLK_TCK: ::c_int = 39; +pub const _SC_ATEXIT_MAX: ::c_int = 40; +pub const _SC_THREADS: ::c_int = 41; +pub const _SC_SEMAPHORES: ::c_int = 42; +pub const _SC_BARRIERS: ::c_int = 43; +pub const _SC_TIMERS: ::c_int = 44; +pub const _SC_SPIN_LOCKS: ::c_int = 45; +pub const _SC_READER_WRITER_LOCKS: ::c_int = 46; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 47; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 48; +pub const _SC_CLOCK_SELECTION: ::c_int = 49; +pub const _SC_ASYNCHRONOUS_IO: ::c_int = 50; +pub const _SC_AIO_LISTIO_MAX: ::c_int = 51; +pub const _SC_AIO_MAX: ::c_int = 52; +pub const _SC_MESSAGE_PASSING: ::c_int = 53; +pub const _SC_MQ_OPEN_MAX: ::c_int = 54; +pub const _SC_MQ_PRIO_MAX: ::c_int = 55; +pub const _SC_PRIORITY_SCHEDULING: ::c_int = 56; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 57; +pub const _SC_THREAD_KEYS_MAX: ::c_int = 58; +pub const _SC_THREAD_STACK_MIN: ::c_int = 59; +pub const _SC_THREAD_THREADS_MAX: ::c_int = 60; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 61; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 62; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 63; +pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 64; +pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 65; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 66; +pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 67; +pub const _SC_TTY_NAME_MAX: ::c_int = 68; +pub const _SC_HOST_NAME_MAX: ::c_int = 69; +pub const _SC_PASS_MAX: ::c_int = 70; +pub const _SC_REGEXP: ::c_int = 71; +pub const _SC_SHELL: ::c_int = 72; +pub const _SC_SYMLOOP_MAX: ::c_int = 73; +pub const _SC_V6_ILP32_OFF32: ::c_int = 74; +pub const _SC_V6_ILP32_OFFBIG: ::c_int = 75; +pub const _SC_V6_LP64_OFF64: ::c_int = 76; +pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 77; +pub const _SC_2_PBS: ::c_int = 80; +pub const _SC_2_PBS_ACCOUNTING: ::c_int = 81; +pub const _SC_2_PBS_CHECKPOINT: ::c_int = 82; +pub const _SC_2_PBS_LOCATE: ::c_int = 83; +pub const _SC_2_PBS_MESSAGE: ::c_int = 84; +pub const _SC_2_PBS_TRACK: ::c_int = 85; +pub const _SC_SPAWN: ::c_int = 86; +pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 87; +pub const _SC_TIMER_MAX: ::c_int = 88; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 89; +pub const _SC_CPUTIME: ::c_int = 90; +pub const _SC_THREAD_CPUTIME: ::c_int = 91; +pub const _SC_DELAYTIMER_MAX: ::c_int = 92; +// These two variables will be supported in NetBSD 8.0 +// pub const _SC_SIGQUEUE_MAX : ::c_int = 93; +// pub const _SC_REALTIME_SIGNALS : ::c_int = 94; +pub const _SC_PHYS_PAGES: ::c_int = 121; +pub const _SC_NPROCESSORS_CONF: ::c_int = 1001; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 1002; +pub const _SC_SCHED_RT_TS: ::c_int = 2001; +pub const _SC_SCHED_PRI_MIN: ::c_int = 2002; +pub const _SC_SCHED_PRI_MAX: ::c_int = 2003; + +pub const FD_SETSIZE: usize = 0x100; + +pub const ST_NOSUID: ::c_ulong = 8; + +pub const BIOCGRSIG: ::c_ulong = 0x40044272; +pub const BIOCSRSIG: ::c_ulong = 0x80044273; +pub const BIOCSDLT: ::c_ulong = 0x80044278; +pub const BIOCGSEESENT: ::c_ulong = 0x40044276; +pub const BIOCSSEESENT: ::c_ulong = 0x80044277; + +// +pub const NTP_API: ::c_int = 4; +pub const MAXPHASE: ::c_long = 500000000; +pub const MAXFREQ: ::c_long = 500000; +pub const MINSEC: ::c_int = 256; +pub const MAXSEC: ::c_int = 2048; +pub const NANOSECOND: ::c_long = 1000000000; +pub const SCALE_PPM: ::c_int = 65; +pub const MAXTC: ::c_int = 10; +pub const MOD_OFFSET: ::c_uint = 0x0001; +pub const MOD_FREQUENCY: ::c_uint = 0x0002; +pub const MOD_MAXERROR: ::c_uint = 0x0004; +pub const MOD_ESTERROR: ::c_uint = 0x0008; +pub const MOD_STATUS: ::c_uint = 0x0010; +pub const MOD_TIMECONST: ::c_uint = 0x0020; +pub const MOD_PPSMAX: ::c_uint = 0x0040; +pub const MOD_TAI: ::c_uint = 0x0080; +pub const MOD_MICRO: ::c_uint = 0x1000; +pub const MOD_NANO: ::c_uint = 0x2000; +pub const MOD_CLKB: ::c_uint = 0x4000; +pub const MOD_CLKA: ::c_uint = 0x8000; +pub const STA_PLL: ::c_int = 0x0001; +pub const STA_PPSFREQ: ::c_int = 0x0002; +pub const STA_PPSTIME: ::c_int = 0x0004; +pub const STA_FLL: ::c_int = 0x0008; +pub const STA_INS: ::c_int = 0x0010; +pub const STA_DEL: ::c_int = 0x0020; +pub const STA_UNSYNC: ::c_int = 0x0040; +pub const STA_FREQHOLD: ::c_int = 0x0080; +pub const STA_PPSSIGNAL: ::c_int = 0x0100; +pub const STA_PPSJITTER: ::c_int = 0x0200; +pub const STA_PPSWANDER: ::c_int = 0x0400; +pub const STA_PPSERROR: ::c_int = 0x0800; +pub const STA_CLOCKERR: ::c_int = 0x1000; +pub const STA_NANO: ::c_int = 0x2000; +pub const STA_MODE: ::c_int = 0x4000; +pub const STA_CLK: ::c_int = 0x8000; +pub const STA_RONLY: ::c_int = STA_PPSSIGNAL + | STA_PPSJITTER + | STA_PPSWANDER + | STA_PPSERROR + | STA_CLOCKERR + | STA_NANO + | STA_MODE + | STA_CLK; +pub const TIME_OK: ::c_int = 0; +pub const TIME_INS: ::c_int = 1; +pub const TIME_DEL: ::c_int = 2; +pub const TIME_OOP: ::c_int = 3; +pub const TIME_WAIT: ::c_int = 4; +pub const TIME_ERROR: ::c_int = 5; + +pub const LITTLE_ENDIAN: ::c_int = 1234; +pub const BIG_ENDIAN: ::c_int = 4321; + +pub const PL_EVENT_NONE: ::c_int = 0; +pub const PL_EVENT_SIGNAL: ::c_int = 1; +pub const PL_EVENT_SUSPENDED: ::c_int = 2; + +cfg_if! { + if #[cfg(any(target_arch = "sparc", target_arch = "sparc64", + target_arch = "x86", target_arch = "x86_64"))] { + pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t + = pthread_mutex_t { + ptm_magic: 0x33330003, + ptm_errorcheck: 0, + ptm_pad1: [0; 3], + ptm_unused: 0, + ptm_pad2: [0; 3], + ptm_waiters: 0 as *mut _, + ptm_owner: 0, + ptm_recursed: 0, + ptm_spare2: 0 as *mut _, + }; + } else { + pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t + = pthread_mutex_t { + ptm_magic: 0x33330003, + ptm_errorcheck: 0, + ptm_unused: 0, + ptm_waiters: 0 as *mut _, + ptm_owner: 0, + ptm_recursed: 0, + ptm_spare2: 0 as *mut _, + }; + } +} + +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + ptc_magic: 0x55550005, + ptc_lock: 0, + ptc_waiters_first: 0 as *mut _, + ptc_waiters_last: 0 as *mut _, + ptc_mutex: 0 as *mut _, + ptc_private: 0 as *mut _, +}; +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + ptr_magic: 0x99990009, + ptr_interlock: 0, + ptr_rblocked_first: 0 as *mut _, + ptr_rblocked_last: 0 as *mut _, + ptr_wblocked_first: 0 as *mut _, + ptr_wblocked_last: 0 as *mut _, + ptr_nreaders: 0, + ptr_owner: 0, + ptr_private: 0 as *mut _, +}; +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; + +pub const SCHED_NONE: ::c_int = -1; +pub const SCHED_OTHER: ::c_int = 0; +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_RR: ::c_int = 2; + +pub const EVFILT_AIO: u32 = 2; +pub const EVFILT_PROC: u32 = 4; +pub const EVFILT_READ: u32 = 0; +pub const EVFILT_SIGNAL: u32 = 5; +pub const EVFILT_TIMER: u32 = 6; +pub const EVFILT_VNODE: u32 = 3; +pub const EVFILT_WRITE: u32 = 1; + +pub const EV_ADD: u32 = 0x1; +pub const EV_DELETE: u32 = 0x2; +pub const EV_ENABLE: u32 = 0x4; +pub const EV_DISABLE: u32 = 0x8; +pub const EV_ONESHOT: u32 = 0x10; +pub const EV_CLEAR: u32 = 0x20; +pub const EV_RECEIPT: u32 = 0x40; +pub const EV_DISPATCH: u32 = 0x80; +pub const EV_FLAG1: u32 = 0x2000; +pub const EV_ERROR: u32 = 0x4000; +pub const EV_EOF: u32 = 0x8000; +pub const EV_SYSFLAGS: u32 = 0xf000; + +pub const NOTE_LOWAT: u32 = 0x00000001; +pub const NOTE_DELETE: u32 = 0x00000001; +pub const NOTE_WRITE: u32 = 0x00000002; +pub const NOTE_EXTEND: u32 = 0x00000004; +pub const NOTE_ATTRIB: u32 = 0x00000008; +pub const NOTE_LINK: u32 = 0x00000010; +pub const NOTE_RENAME: u32 = 0x00000020; +pub const NOTE_REVOKE: u32 = 0x00000040; +pub const NOTE_EXIT: u32 = 0x80000000; +pub const NOTE_FORK: u32 = 0x40000000; +pub const NOTE_EXEC: u32 = 0x20000000; +pub const NOTE_PDATAMASK: u32 = 0x000fffff; +pub const NOTE_PCTRLMASK: u32 = 0xf0000000; +pub const NOTE_TRACK: u32 = 0x00000001; +pub const NOTE_TRACKERR: u32 = 0x00000002; +pub const NOTE_CHILD: u32 = 0x00000004; + +pub const TMP_MAX: ::c_uint = 308915776; + +pub const AI_PASSIVE: ::c_int = 0x00000001; +pub const AI_CANONNAME: ::c_int = 0x00000002; +pub const AI_NUMERICHOST: ::c_int = 0x00000004; +pub const AI_NUMERICSERV: ::c_int = 0x00000008; +pub const AI_ADDRCONFIG: ::c_int = 0x00000400; +pub const AI_SRV: ::c_int = 0x00000800; + +pub const NI_MAXHOST: ::socklen_t = 1025; +pub const NI_MAXSERV: ::socklen_t = 32; + +pub const NI_NOFQDN: ::c_int = 0x00000001; +pub const NI_NUMERICHOST: ::c_int = 0x000000002; +pub const NI_NAMEREQD: ::c_int = 0x000000004; +pub const NI_NUMERICSERV: ::c_int = 0x000000008; +pub const NI_DGRAM: ::c_int = 0x00000010; +pub const NI_WITHSCOPEID: ::c_int = 0x00000020; +pub const NI_NUMERICSCOPE: ::c_int = 0x00000040; + +pub const RTLD_NOLOAD: ::c_int = 0x2000; +pub const RTLD_LOCAL: ::c_int = 0x200; + +pub const CTL_MAXNAME: ::c_int = 12; +pub const SYSCTL_NAMELEN: ::c_int = 32; +pub const SYSCTL_DEFSIZE: ::c_int = 8; +pub const CTLTYPE_NODE: ::c_int = 1; +pub const CTLTYPE_INT: ::c_int = 2; +pub const CTLTYPE_STRING: ::c_int = 3; +pub const CTLTYPE_QUAD: ::c_int = 4; +pub const CTLTYPE_STRUCT: ::c_int = 5; +pub const CTLTYPE_BOOL: ::c_int = 6; +pub const CTLFLAG_READONLY: ::c_int = 0x00000000; +pub const CTLFLAG_READWRITE: ::c_int = 0x00000070; +pub const CTLFLAG_ANYWRITE: ::c_int = 0x00000080; +pub const CTLFLAG_PRIVATE: ::c_int = 0x00000100; +pub const CTLFLAG_PERMANENT: ::c_int = 0x00000200; +pub const CTLFLAG_OWNDATA: ::c_int = 0x00000400; +pub const CTLFLAG_IMMEDIATE: ::c_int = 0x00000800; +pub const CTLFLAG_HEX: ::c_int = 0x00001000; +pub const CTLFLAG_ROOT: ::c_int = 0x00002000; +pub const CTLFLAG_ANYNUMBER: ::c_int = 0x00004000; +pub const CTLFLAG_HIDDEN: ::c_int = 0x00008000; +pub const CTLFLAG_ALIAS: ::c_int = 0x00010000; +pub const CTLFLAG_MMAP: ::c_int = 0x00020000; +pub const CTLFLAG_OWNDESC: ::c_int = 0x00040000; +pub const CTLFLAG_UNSIGNED: ::c_int = 0x00080000; +pub const SYSCTL_VERS_MASK: ::c_int = 0xff000000; +pub const SYSCTL_VERS_0: ::c_int = 0x00000000; +pub const SYSCTL_VERS_1: ::c_int = 0x01000000; +pub const SYSCTL_VERSION: ::c_int = SYSCTL_VERS_1; +pub const CTL_EOL: ::c_int = -1; +pub const CTL_QUERY: ::c_int = -2; +pub const CTL_CREATE: ::c_int = -3; +pub const CTL_CREATESYM: ::c_int = -4; +pub const CTL_DESTROY: ::c_int = -5; +pub const CTL_MMAP: ::c_int = -6; +pub const CTL_DESCRIBE: ::c_int = -7; +pub const CTL_UNSPEC: ::c_int = 0; +pub const CTL_KERN: ::c_int = 1; +pub const CTL_VM: ::c_int = 2; +pub const CTL_VFS: ::c_int = 3; +pub const CTL_NET: ::c_int = 4; +pub const CTL_DEBUG: ::c_int = 5; +pub const CTL_HW: ::c_int = 6; +pub const CTL_MACHDEP: ::c_int = 7; +pub const CTL_USER: ::c_int = 8; +pub const CTL_DDB: ::c_int = 9; +pub const CTL_PROC: ::c_int = 10; +pub const CTL_VENDOR: ::c_int = 11; +pub const CTL_EMUL: ::c_int = 12; +pub const CTL_SECURITY: ::c_int = 13; +pub const CTL_MAXID: ::c_int = 14; +pub const KERN_OSTYPE: ::c_int = 1; +pub const KERN_OSRELEASE: ::c_int = 2; +pub const KERN_OSREV: ::c_int = 3; +pub const KERN_VERSION: ::c_int = 4; +pub const KERN_MAXVNODES: ::c_int = 5; +pub const KERN_MAXPROC: ::c_int = 6; +pub const KERN_MAXFILES: ::c_int = 7; +pub const KERN_ARGMAX: ::c_int = 8; +pub const KERN_SECURELVL: ::c_int = 9; +pub const KERN_HOSTNAME: ::c_int = 10; +pub const KERN_HOSTID: ::c_int = 11; +pub const KERN_CLOCKRATE: ::c_int = 12; +pub const KERN_VNODE: ::c_int = 13; +pub const KERN_PROC: ::c_int = 14; +pub const KERN_FILE: ::c_int = 15; +pub const KERN_PROF: ::c_int = 16; +pub const KERN_POSIX1: ::c_int = 17; +pub const KERN_NGROUPS: ::c_int = 18; +pub const KERN_JOB_CONTROL: ::c_int = 19; +pub const KERN_SAVED_IDS: ::c_int = 20; +pub const KERN_OBOOTTIME: ::c_int = 21; +pub const KERN_DOMAINNAME: ::c_int = 22; +pub const KERN_MAXPARTITIONS: ::c_int = 23; +pub const KERN_RAWPARTITION: ::c_int = 24; +pub const KERN_NTPTIME: ::c_int = 25; +pub const KERN_TIMEX: ::c_int = 26; +pub const KERN_AUTONICETIME: ::c_int = 27; +pub const KERN_AUTONICEVAL: ::c_int = 28; +pub const KERN_RTC_OFFSET: ::c_int = 29; +pub const KERN_ROOT_DEVICE: ::c_int = 30; +pub const KERN_MSGBUFSIZE: ::c_int = 31; +pub const KERN_FSYNC: ::c_int = 32; +pub const KERN_OLDSYSVMSG: ::c_int = 33; +pub const KERN_OLDSYSVSEM: ::c_int = 34; +pub const KERN_OLDSYSVSHM: ::c_int = 35; +pub const KERN_OLDSHORTCORENAME: ::c_int = 36; +pub const KERN_SYNCHRONIZED_IO: ::c_int = 37; +pub const KERN_IOV_MAX: ::c_int = 38; +pub const KERN_MBUF: ::c_int = 39; +pub const KERN_MAPPED_FILES: ::c_int = 40; +pub const KERN_MEMLOCK: ::c_int = 41; +pub const KERN_MEMLOCK_RANGE: ::c_int = 42; +pub const KERN_MEMORY_PROTECTION: ::c_int = 43; +pub const KERN_LOGIN_NAME_MAX: ::c_int = 44; +pub const KERN_DEFCORENAME: ::c_int = 45; +pub const KERN_LOGSIGEXIT: ::c_int = 46; +pub const KERN_PROC2: ::c_int = 47; +pub const KERN_PROC_ARGS: ::c_int = 48; +pub const KERN_FSCALE: ::c_int = 49; +pub const KERN_CCPU: ::c_int = 50; +pub const KERN_CP_TIME: ::c_int = 51; +pub const KERN_OLDSYSVIPC_INFO: ::c_int = 52; +pub const KERN_MSGBUF: ::c_int = 53; +pub const KERN_CONSDEV: ::c_int = 54; +pub const KERN_MAXPTYS: ::c_int = 55; +pub const KERN_PIPE: ::c_int = 56; +pub const KERN_MAXPHYS: ::c_int = 57; +pub const KERN_SBMAX: ::c_int = 58; +pub const KERN_TKSTAT: ::c_int = 59; +pub const KERN_MONOTONIC_CLOCK: ::c_int = 60; +pub const KERN_URND: ::c_int = 61; +pub const KERN_LABELSECTOR: ::c_int = 62; +pub const KERN_LABELOFFSET: ::c_int = 63; +pub const KERN_LWP: ::c_int = 64; +pub const KERN_FORKFSLEEP: ::c_int = 65; +pub const KERN_POSIX_THREADS: ::c_int = 66; +pub const KERN_POSIX_SEMAPHORES: ::c_int = 67; +pub const KERN_POSIX_BARRIERS: ::c_int = 68; +pub const KERN_POSIX_TIMERS: ::c_int = 69; +pub const KERN_POSIX_SPIN_LOCKS: ::c_int = 70; +pub const KERN_POSIX_READER_WRITER_LOCKS: ::c_int = 71; +pub const KERN_DUMP_ON_PANIC: ::c_int = 72; +pub const KERN_SOMAXKVA: ::c_int = 73; +pub const KERN_ROOT_PARTITION: ::c_int = 74; +pub const KERN_DRIVERS: ::c_int = 75; +pub const KERN_BUF: ::c_int = 76; +pub const KERN_FILE2: ::c_int = 77; +pub const KERN_VERIEXEC: ::c_int = 78; +pub const KERN_CP_ID: ::c_int = 79; +pub const KERN_HARDCLOCK_TICKS: ::c_int = 80; +pub const KERN_ARND: ::c_int = 81; +pub const KERN_SYSVIPC: ::c_int = 82; +pub const KERN_BOOTTIME: ::c_int = 83; +pub const KERN_EVCNT: ::c_int = 84; +pub const KERN_MAXID: ::c_int = 85; +pub const KERN_PROC_ALL: ::c_int = 0; +pub const KERN_PROC_PID: ::c_int = 1; +pub const KERN_PROC_PGRP: ::c_int = 2; +pub const KERN_PROC_SESSION: ::c_int = 3; +pub const KERN_PROC_TTY: ::c_int = 4; +pub const KERN_PROC_UID: ::c_int = 5; +pub const KERN_PROC_RUID: ::c_int = 6; +pub const KERN_PROC_GID: ::c_int = 7; +pub const KERN_PROC_RGID: ::c_int = 8; +pub const KERN_PROC_ARGV: ::c_int = 1; +pub const KERN_PROC_NARGV: ::c_int = 2; +pub const KERN_PROC_ENV: ::c_int = 3; +pub const KERN_PROC_NENV: ::c_int = 4; +pub const KERN_PROC_PATHNAME: ::c_int = 5; +pub const VM_PROC: ::c_int = 16; +pub const VM_PROC_MAP: ::c_int = 1; + +pub const EAI_AGAIN: ::c_int = 2; +pub const EAI_BADFLAGS: ::c_int = 3; +pub const EAI_FAIL: ::c_int = 4; +pub const EAI_FAMILY: ::c_int = 5; +pub const EAI_MEMORY: ::c_int = 6; +pub const EAI_NODATA: ::c_int = 7; +pub const EAI_NONAME: ::c_int = 8; +pub const EAI_SERVICE: ::c_int = 9; +pub const EAI_SOCKTYPE: ::c_int = 10; +pub const EAI_SYSTEM: ::c_int = 11; +pub const EAI_OVERFLOW: ::c_int = 14; + +pub const AIO_CANCELED: ::c_int = 1; +pub const AIO_NOTCANCELED: ::c_int = 2; +pub const AIO_ALLDONE: ::c_int = 3; +pub const LIO_NOP: ::c_int = 0; +pub const LIO_WRITE: ::c_int = 1; +pub const LIO_READ: ::c_int = 2; +pub const LIO_WAIT: ::c_int = 1; +pub const LIO_NOWAIT: ::c_int = 0; + +pub const SIGEV_NONE: ::c_int = 0; +pub const SIGEV_SIGNAL: ::c_int = 1; +pub const SIGEV_THREAD: ::c_int = 2; + +pub const WSTOPPED: ::c_int = 0x00000002; // same as WUNTRACED +pub const WCONTINUED: ::c_int = 0x00000010; +pub const WEXITED: ::c_int = 0x000000020; +pub const WNOWAIT: ::c_int = 0x00010000; + +pub const P_ALL: idtype_t = 0; +pub const P_PID: idtype_t = 1; +pub const P_PGID: idtype_t = 4; + +pub const UTIME_OMIT: c_long = 1073741822; +pub const UTIME_NOW: c_long = 1073741823; + +pub const B460800: ::speed_t = 460800; +pub const B921600: ::speed_t = 921600; + +pub const ONOCR: ::tcflag_t = 0x20; +pub const ONLRET: ::tcflag_t = 0x40; +pub const CDTRCTS: ::tcflag_t = 0x00020000; +pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::CDTRCTS; + +// pub const _PATH_UTMPX: &[::c_char; 14] = b"/var/run/utmpx"; +// pub const _PATH_WTMPX: &[::c_char; 14] = b"/var/log/wtmpx"; +// pub const _PATH_LASTLOGX: &[::c_char; 17] = b"/var/log/lastlogx"; +// pub const _PATH_UTMP_UPDATE: &[::c_char; 24] = b"/usr/libexec/utmp_update"; +pub const UT_NAMESIZE: usize = 8; +pub const UT_LINESIZE: usize = 8; +pub const UT_HOSTSIZE: usize = 16; +pub const _UTX_USERSIZE: usize = 32; +pub const _UTX_LINESIZE: usize = 32; +pub const _UTX_PADSIZE: usize = 40; +pub const _UTX_IDSIZE: usize = 4; +pub const _UTX_HOSTSIZE: usize = 256; +pub const EMPTY: u16 = 0; +pub const RUN_LVL: u16 = 1; +pub const BOOT_TIME: u16 = 2; +pub const OLD_TIME: u16 = 3; +pub const NEW_TIME: u16 = 4; +pub const INIT_PROCESS: u16 = 5; +pub const LOGIN_PROCESS: u16 = 6; +pub const USER_PROCESS: u16 = 7; +pub const DEAD_PROCESS: u16 = 8; +pub const ACCOUNTING: u16 = 9; +pub const SIGNATURE: u16 = 10; +pub const DOWN_TIME: u16 = 11; + +pub const SOCK_CLOEXEC: ::c_int = 0x10000000; +pub const SOCK_NONBLOCK: ::c_int = 0x20000000; + +// Uncomment on next NetBSD release +// pub const FIOSEEKDATA: ::c_ulong = 0xc0086661; +// pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662; +pub const OFIOGETBMAP: ::c_ulong = 0xc004667a; +pub const FIOGETBMAP: ::c_ulong = 0xc008667a; +pub const FIONWRITE: ::c_ulong = 0x40046679; +pub const FIONSPACE: ::c_ulong = 0x40046678; +pub const FIBMAP: ::c_ulong = 0xc008667a; + +pub const SIGSTKSZ: ::size_t = 40960; + +pub const REG_ENOSYS: ::c_int = 17; + +pub const PT_DUMPCORE: ::c_int = 12; +pub const PT_LWPINFO: ::c_int = 13; +pub const PT_SYSCALL: ::c_int = 14; +pub const PT_SYSCALLEMU: ::c_int = 15; +pub const PT_SET_EVENT_MASK: ::c_int = 16; +pub const PT_GET_EVENT_MASK: ::c_int = 17; +pub const PT_GET_PROCESS_STATE: ::c_int = 18; +pub const PT_SET_SIGINFO: ::c_int = 19; +pub const PT_GET_SIGINFO: ::c_int = 20; +pub const PT_RESUME: ::c_int = 21; +pub const PT_SUSPEND: ::c_int = 23; +pub const PT_STOP: ::c_int = 23; +pub const PT_LWPSTATUS: ::c_int = 24; +pub const PT_LWPNEXT: ::c_int = 25; +pub const PT_SET_SIGPASS: ::c_int = 26; +pub const PT_GET_SIGPASS: ::c_int = 27; +pub const PT_FIRSTMACH: ::c_int = 32; + +pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; +pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; +pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04; +pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08; +pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10; +pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20; +pub const POSIX_SPAWN_RETURNERROR: ::c_int = 0x40; + +// Flags for chflags(2) +pub const SF_APPEND: ::c_ulong = 0x00040000; +pub const SF_ARCHIVED: ::c_ulong = 0x00010000; +pub const SF_IMMUTABLE: ::c_ulong = 0x00020000; +pub const SF_LOG: ::c_ulong = 0x00400000; +pub const SF_SETTABLE: ::c_ulong = 0xffff0000; +pub const SF_SNAPINVAL: ::c_ulong = 0x00800000; +pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; +pub const UF_APPEND: ::c_ulong = 0x00000004; +pub const UF_IMMUTABLE: ::c_ulong = 0x00000002; +pub const UF_NODUMP: ::c_ulong = 0x00000001; +pub const UF_OPAQUE: ::c_ulong = 0x00000008; +pub const UF_SETTABLE: ::c_ulong = 0x0000ffff; + +// sys/sysctl.h +pub const KVME_PROT_READ: ::c_int = 0x00000001; +pub const KVME_PROT_WRITE: ::c_int = 0x00000002; +pub const KVME_PROT_EXEC: ::c_int = 0x00000004; + +pub const KVME_FLAG_COW: ::c_int = 0x00000001; +pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002; +pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x000000004; +pub const KVME_FLAG_PAGEABLE: ::c_int = 0x000000008; +pub const KVME_FLAG_GROWS_UP: ::c_int = 0x000000010; +pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x000000020; + +pub const NGROUPS_MAX: ::c_int = 16; + +pub const KI_NGROUPS: ::c_int = 16; +pub const KI_MAXCOMLEN: ::c_int = 24; +pub const KI_WMESGLEN: ::c_int = 8; +pub const KI_MAXLOGNAME: ::c_int = 24; +pub const KI_MAXEMULLEN: ::c_int = 16; +pub const KI_LNAMELEN: ::c_int = 20; + +// sys/lwp.h +pub const LSIDL: ::c_int = 1; +pub const LSRUN: ::c_int = 2; +pub const LSSLEEP: ::c_int = 3; +pub const LSSTOP: ::c_int = 4; +pub const LSZOMB: ::c_int = 5; +pub const LSONPROC: ::c_int = 7; +pub const LSSUSPENDED: ::c_int = 8; + +const_fn! { + {const} fn _ALIGN(p: usize) -> usize { + (p + _ALIGNBYTES) & !_ALIGNBYTES + } +} + +f! { + pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { + (cmsg as *mut ::c_uchar) + .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) + } + + pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length + } + + pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr) + -> *mut ::cmsghdr + { + if cmsg.is_null() { + return ::CMSG_FIRSTHDR(mhdr); + }; + let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + + _ALIGN(::mem::size_of::<::cmsghdr>()); + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if next > max { + 0 as *mut ::cmsghdr + } else { + (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)) + as *mut ::cmsghdr + } + } + + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize)) + as ::c_uint + } + + // dirfd() is a macro on netbsd to access + // the first field of the struct where dirp points to: + // http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36 + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int { + *(dirp as *const ::c_int) + } + + pub fn SOCKCREDSIZE(ngrps: usize) -> usize { + let ngrps = if ngrps > 0 { + ngrps - 1 + } else { + 0 + }; + ::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps + } + + pub fn PROT_MPROTECT(x: ::c_int) -> ::c_int { + x << 3 + } + + pub fn PROT_MPROTECT_EXTRACT(x: ::c_int) -> ::c_int { + (x >> 3) & 0x7 + } +} + +safe_f! { + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { + status >> 8 + } + + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + (status & 0o177) != 0o177 && (status & 0o177) != 0 + } + + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { + (status & 0o177) == 0o177 + } + + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + status == 0xffff + } +} + +extern "C" { + pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; + pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + + pub fn reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int; +} + +#[link(name = "rt")] +extern "C" { + pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; + pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; + #[link_name = "__aio_suspend50"] + pub fn aio_suspend( + aiocb_list: *const *const aiocb, + nitems: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn lio_listio( + mode: ::c_int, + aiocb_list: *const *mut aiocb, + nitems: ::c_int, + sevp: *mut sigevent, + ) -> ::c_int; +} + +extern "C" { + pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; + pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int; + pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int; + + pub fn execvpe( + file: *const ::c_char, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + + pub fn extattr_delete_fd( + fd: ::c_int, + attrnamespace: ::c_int, + attrname: *const ::c_char, + ) -> ::c_int; + pub fn extattr_delete_file( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + ) -> ::c_int; + pub fn extattr_delete_link( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + ) -> ::c_int; + pub fn extattr_get_fd( + fd: ::c_int, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_get_file( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_get_link( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *mut ::c_void, + nbytes: ::size_t, + ) -> ::ssize_t; + pub fn extattr_namespace_to_string( + attrnamespace: ::c_int, + string: *mut *mut ::c_char, + ) -> ::c_int; + pub fn extattr_set_fd( + fd: ::c_int, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *const ::c_void, + nbytes: ::size_t, + ) -> ::c_int; + pub fn extattr_set_file( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *const ::c_void, + nbytes: ::size_t, + ) -> ::c_int; + pub fn extattr_set_link( + path: *const ::c_char, + attrnamespace: ::c_int, + attrname: *const ::c_char, + data: *const ::c_void, + nbytes: ::size_t, + ) -> ::c_int; + pub fn extattr_string_to_namespace( + string: *const ::c_char, + attrnamespace: *mut ::c_int, + ) -> ::c_int; + + pub fn openpty( + amaster: *mut ::c_int, + aslave: *mut ::c_int, + name: *mut ::c_char, + termp: *mut ::termios, + winp: *mut ::winsize, + ) -> ::c_int; + pub fn forkpty( + amaster: *mut ::c_int, + name: *mut ::c_char, + termp: *mut ::termios, + winp: *mut ::winsize, + ) -> ::pid_t; + + #[link_name = "__lutimes50"] + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + #[link_name = "__gettimeofday50"] + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::socklen_t, + serv: *mut ::c_char, + sevlen: ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn sysctl( + name: *const ::c_int, + namelen: ::c_uint, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *const ::c_void, + newlen: ::size_t, + ) -> ::c_int; + pub fn sysctlbyname( + name: *const ::c_char, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *const ::c_void, + newlen: ::size_t, + ) -> ::c_int; + #[link_name = "__kevent50"] + pub fn kevent( + kq: ::c_int, + changelist: *const ::kevent, + nchanges: ::size_t, + eventlist: *mut ::kevent, + nevents: ::size_t, + timeout: *const ::timespec, + ) -> ::c_int; + #[link_name = "__mount50"] + pub fn mount( + src: *const ::c_char, + target: *const ::c_char, + flags: ::c_int, + data: *mut ::c_void, + size: ::size_t, + ) -> ::c_int; + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; + pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int; + pub fn mq_receive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + ) -> ::ssize_t; + pub fn mq_send( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + ) -> ::c_int; + pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int; + #[link_name = "__mq_timedreceive50"] + pub fn mq_timedreceive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::ssize_t; + #[link_name = "__mq_timedsend50"] + pub fn mq_timedsend( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; + pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_void, data: ::c_int) -> ::c_int; + pub fn utrace(label: *const ::c_char, addr: *mut ::c_void, len: ::size_t) -> ::c_int; + pub fn pthread_getname_np(t: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn pthread_setname_np( + t: ::pthread_t, + name: *const ::c_char, + arg: *const ::c_void, + ) -> ::c_int; + pub fn pthread_attr_get_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_attr_getguardsize( + attr: *const ::pthread_attr_t, + guardsize: *mut ::size_t, + ) -> ::c_int; + pub fn pthread_attr_getstack( + attr: *const ::pthread_attr_t, + stackaddr: *mut *mut ::c_void, + stacksize: *mut ::size_t, + ) -> ::c_int; + pub fn pthread_getaffinity_np( + thread: ::pthread_t, + size: ::size_t, + set: *mut cpuset_t, + ) -> ::c_int; + pub fn pthread_setaffinity_np( + thread: ::pthread_t, + size: ::size_t, + set: *mut cpuset_t, + ) -> ::c_int; + + pub fn _cpuset_create() -> *mut cpuset_t; + pub fn _cpuset_destroy(set: *mut cpuset_t); + pub fn _cpuset_clr(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int; + pub fn _cpuset_set(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int; + pub fn _cpuset_isset(cpu: cpuid_t, set: *const cpuset_t) -> ::c_int; + pub fn _cpuset_size(set: *const cpuset_t) -> ::size_t; + pub fn _cpuset_zero(set: *mut cpuset_t); + #[link_name = "__sigtimedwait50"] + pub fn sigtimedwait( + set: *const sigset_t, + info: *mut siginfo_t, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int; + pub fn waitid( + idtype: idtype_t, + id: ::id_t, + infop: *mut ::siginfo_t, + options: ::c_int, + ) -> ::c_int; + + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t); + pub fn localeconv_l(loc: ::locale_t) -> *mut lconv; + pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; + #[link_name = "__settimeofday50"] + pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int; + + pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + + pub fn kqueue1(flags: ::c_int) -> ::c_int; + + pub fn sendmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_int, + ) -> ::c_int; + pub fn recvmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_int, + timeout: *mut ::timespec, + ) -> ::c_int; + + pub fn _lwp_self() -> lwpid_t; + pub fn memmem( + haystack: *const ::c_void, + haystacklen: ::size_t, + needle: *const ::c_void, + needlelen: ::size_t, + ) -> *mut ::c_void; + + // link.h + + pub fn dl_iterate_phdr( + callback: ::Option< + unsafe extern "C" fn( + info: *mut dl_phdr_info, + size: usize, + data: *mut ::c_void, + ) -> ::c_int, + >, + data: *mut ::c_void, + ) -> ::c_int; + + // dlfcn.h + + pub fn _dlauxinfo() -> *mut ::c_void; + + pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t; + pub fn iconv( + cd: iconv_t, + inbuf: *mut *mut ::c_char, + inbytesleft: *mut ::size_t, + outbuf: *mut *mut ::c_char, + outbytesleft: *mut ::size_t, + ) -> ::size_t; + pub fn iconv_close(cd: iconv_t) -> ::c_int; + + pub fn timer_create( + clockid: ::clockid_t, + sevp: *mut ::sigevent, + timerid: *mut ::timer_t, + ) -> ::c_int; + pub fn timer_delete(timerid: ::timer_t) -> ::c_int; + pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int; + pub fn timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int; + pub fn timer_settime( + timerid: ::timer_t, + flags: ::c_int, + new_value: *const ::itimerspec, + old_value: *mut ::itimerspec, + ) -> ::c_int; + + // Added in `NetBSD` 7.0 + pub fn explicit_memset(b: *mut ::c_void, c: ::c_int, len: ::size_t); + pub fn consttime_memequal(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; + + pub fn setproctitle(fmt: *const ::c_char, ...); + pub fn mremap( + oldp: *mut ::c_void, + oldsize: ::size_t, + newp: *mut ::c_void, + newsize: ::size_t, + flags: ::c_int, + ) -> *mut ::c_void; + + pub fn sched_rr_get_interval(pid: ::pid_t, t: *mut ::timespec) -> ::c_int; + pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int; + pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; + pub fn sched_setscheduler( + pid: ::pid_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + + #[link_name = "__pollts50"] + pub fn pollts( + fds: *mut ::pollfd, + nfds: ::nfds_t, + ts: *const ::timespec, + sigmask: *const ::sigset_t, + ) -> ::c_int; + + pub fn posix_spawn( + pid: *mut ::pid_t, + path: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnp( + pid: *mut ::pid_t, + file: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_getsigdefault( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigdefault( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getsigmask( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigmask( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getflags( + attr: *const posix_spawnattr_t, + flags: *mut ::c_short, + ) -> ::c_int; + pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; + pub fn posix_spawnattr_getpgroup( + attr: *const posix_spawnattr_t, + flags: *mut ::pid_t, + ) -> ::c_int; + pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; + pub fn posix_spawnattr_getschedpolicy( + attr: *const posix_spawnattr_t, + flags: *mut ::c_int, + ) -> ::c_int; + pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int; + pub fn posix_spawnattr_getschedparam( + attr: *const posix_spawnattr_t, + param: *mut ::sched_param, + ) -> ::c_int; + pub fn posix_spawnattr_setschedparam( + attr: *mut posix_spawnattr_t, + param: *const ::sched_param, + ) -> ::c_int; + + pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_addopen( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + path: *const ::c_char, + oflag: ::c_int, + mode: ::mode_t, + ) -> ::c_int; + pub fn posix_spawn_file_actions_addclose( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + ) -> ::c_int; + pub fn posix_spawn_file_actions_adddup2( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + newfd: ::c_int, + ) -> ::c_int; +} + +#[link(name = "util")] +extern "C" { + #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")] + pub fn getpwent_r( + pwd: *mut ::passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::passwd, + ) -> ::c_int; + pub fn getgrent_r( + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + + pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int; + pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx; + pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int; + pub fn utmpxname(file: *const ::c_char) -> ::c_int; + pub fn getutxent() -> *mut utmpx; + pub fn getutxid(ut: *const utmpx) -> *mut utmpx; + pub fn getutxline(ut: *const utmpx) -> *mut utmpx; + pub fn pututxline(ut: *const utmpx) -> *mut utmpx; + pub fn setutxent(); + pub fn endutxent(); + + pub fn getutmp(ux: *const utmpx, u: *mut utmp); + pub fn getutmpx(u: *const utmp, ux: *mut utmpx); + + pub fn utpname(file: *const ::c_char) -> ::c_int; + pub fn setutent(); + pub fn endutent(); + pub fn getutent() -> *mut utmp; + + pub fn efopen(p: *const ::c_char, m: *const ::c_char) -> ::FILE; + pub fn emalloc(n: ::size_t) -> *mut ::c_void; + pub fn ecalloc(n: ::size_t, c: ::size_t) -> *mut ::c_void; + pub fn erealloc(p: *mut ::c_void, n: ::size_t) -> *mut ::c_void; + pub fn ereallocarr(p: *mut ::c_void, n: ::size_t, s: ::size_t); + pub fn estrdup(s: *const ::c_char) -> *mut ::c_char; + pub fn estrndup(s: *const ::c_char, len: ::size_t) -> *mut ::c_char; + pub fn estrlcpy(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t; + pub fn estrlcat(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t; + pub fn estrtoi( + nptr: *const ::c_char, + base: ::c_int, + lo: ::intmax_t, + hi: ::intmax_t, + ) -> ::intmax_t; + pub fn estrtou( + nptr: *const ::c_char, + base: ::c_int, + lo: ::uintmax_t, + hi: ::uintmax_t, + ) -> ::uintmax_t; + pub fn easprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int; + pub fn evasprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int; + pub fn esetfunc( + cb: ::Option, + ) -> ::Option; + pub fn secure_path(path: *const ::c_char) -> ::c_int; + pub fn snprintb( + buf: *mut ::c_char, + buflen: ::size_t, + fmt: *const ::c_char, + val: u64, + ) -> ::c_int; + pub fn snprintb_m( + buf: *mut ::c_char, + buflen: ::size_t, + fmt: *const ::c_char, + val: u64, + max: ::size_t, + ) -> ::c_int; + + pub fn getbootfile() -> *const ::c_char; + pub fn getbyteorder() -> ::c_int; + pub fn getdiskrawname( + buf: *mut ::c_char, + buflen: ::size_t, + name: *const ::c_char, + ) -> *const ::c_char; + pub fn getdiskcookedname( + buf: *mut ::c_char, + buflen: ::size_t, + name: *const ::c_char, + ) -> *const ::c_char; + pub fn getfsspecname( + buf: *mut ::c_char, + buflen: ::size_t, + spec: *const ::c_char, + ) -> *const ::c_char; + + pub fn strpct( + buf: *mut ::c_char, + bufsiz: ::size_t, + numerator: ::uintmax_t, + denominator: ::uintmax_t, + precision: ::size_t, + ) -> *mut ::c_char; + pub fn strspct( + buf: *mut ::c_char, + bufsiz: ::size_t, + numerator: ::intmax_t, + denominator: ::intmax_t, + precision: ::size_t, + ) -> *mut ::c_char; + #[link_name = "__login50"] + pub fn login(ut: *const utmp); + #[link_name = "__loginx50"] + pub fn loginx(ut: *const utmpx); + pub fn logout(line: *const ::c_char); + pub fn logoutx(line: *const ::c_char, status: ::c_int, tpe: ::c_int); + pub fn logwtmp(line: *const ::c_char, name: *const ::c_char, host: *const ::c_char); + pub fn logwtmpx( + line: *const ::c_char, + name: *const ::c_char, + host: *const ::c_char, + status: ::c_int, + tpe: ::c_int, + ); + + pub fn getxattr( + path: *const ::c_char, + name: *const ::c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn lgetxattr( + path: *const ::c_char, + name: *const ::c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn fgetxattr( + filedes: ::c_int, + name: *const ::c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn setxattr( + path: *const ::c_char, + name: *const ::c_char, + value: *const ::c_void, + size: ::size_t, + ) -> ::c_int; + pub fn lsetxattr( + path: *const ::c_char, + name: *const ::c_char, + value: *const ::c_void, + size: ::size_t, + ) -> ::c_int; + pub fn fsetxattr( + filedes: ::c_int, + name: *const ::c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn listxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t; + pub fn llistxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t; + pub fn flistxattr(filedes: ::c_int, list: *mut ::c_char, size: ::size_t) -> ::ssize_t; + pub fn removexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int; + pub fn lremovexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int; + pub fn fremovexattr(fd: ::c_int, path: *const ::c_char, name: *const ::c_char) -> ::c_int; + + pub fn string_to_flags( + string_p: *mut *mut ::c_char, + setp: *mut ::c_ulong, + clrp: *mut ::c_ulong, + ) -> ::c_int; + pub fn flags_to_string(flags: ::c_ulong, def: *const ::c_char) -> ::c_int; + + pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry; +} + +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(target_arch = "arm")] { + mod arm; + pub use self::arm::*; + } else if #[cfg(target_arch = "powerpc")] { + mod powerpc; + pub use self::powerpc::*; + } else if #[cfg(target_arch = "sparc64")] { + mod sparc64; + pub use self::sparc64::*; + } else if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(target_arch = "x86")] { + mod x86; + pub use self::x86::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs new file mode 100644 index 0000000000000000000000000000000000000000..e12fd5e11233279d7cec5debf4f939ea859b353e --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/powerpc.rs @@ -0,0 +1,21 @@ +use PT_FIRSTMACH; + +pub type c_long = i32; +pub type c_ulong = u32; +pub type c_char = u8; +pub type __cpu_simple_lock_nv_t = ::c_int; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0; +pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; +pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs new file mode 100644 index 0000000000000000000000000000000000000000..6a86759e07e76955017539c619678f46da29471a --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/sparc64.rs @@ -0,0 +1,8 @@ +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = i8; +pub type __cpu_simple_lock_nv_t = ::c_uchar; + +// should be pub(crate), but that requires Rust 1.18.0 +#[doc(hidden)] +pub const _ALIGNBYTES: usize = 0xf; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs new file mode 100644 index 0000000000000000000000000000000000000000..daa89a11a67cbc9c6fa363c0bc5055faa46cd8ed --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86.rs @@ -0,0 +1,15 @@ +pub type c_long = i32; +pub type c_ulong = u32; +pub type c_char = i8; +pub type __cpu_simple_lock_nv_t = ::c_uchar; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 4 - 1; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..2f6e4454577a0d93f3cab23ed28173f2e34e7d20 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/netbsd/x86_64.rs @@ -0,0 +1,40 @@ +use PT_FIRSTMACH; + +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = i8; +pub type c___greg_t = u64; +pub type __cpu_simple_lock_nv_t = ::c_uchar; + +s! { + pub struct mcontext_t { + pub __gregs: [c___greg_t; 26], + pub _mc_tlsbase: c___greg_t, + pub __fpregs: [[::c_char;32]; 16], + } + + pub struct ucontext_t { + pub uc_flags: ::c_uint, + pub uc_link: *mut ::ucontext_t, + pub uc_sigmask: ::sigset_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: ::mcontext_t, + } +} + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0; +pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; +pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; +pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3; +pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs new file mode 100644 index 0000000000000000000000000000000000000000..2bc82e486c596e11ef30bd8eb28179030d7164f0 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/aarch64.rs @@ -0,0 +1,30 @@ +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = u8; +pub type ucontext_t = sigcontext; + +s! { + pub struct sigcontext { + __sc_unused: ::c_int, + pub sc_mask: ::c_int, + pub sc_sp: ::c_ulong, + pub sc_lr: ::c_ulong, + pub sc_elr: ::c_ulong, + pub sc_spsr: ::c_ulong, + pub sc_x: [::c_ulong; 30], + pub sc_cookie: ::c_long, + } +} + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +pub const _MAX_PAGE_SHIFT: u32 = 12; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs new file mode 100644 index 0000000000000000000000000000000000000000..f1ab365d1cd1bbf546c4679bb019d32475545845 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/arm.rs @@ -0,0 +1,16 @@ +pub type c_long = i32; +pub type c_ulong = u32; +pub type c_char = u8; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +pub const _MAX_PAGE_SHIFT: u32 = 12; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs new file mode 100644 index 0000000000000000000000000000000000000000..15803ced09a087636f8aba536bc526e9bd143262 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mips64.rs @@ -0,0 +1,8 @@ +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = i8; + +#[doc(hidden)] +pub const _ALIGNBYTES: usize = 7; + +pub const _MAX_PAGE_SHIFT: u32 = 14; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..1910f24a46bf6a1dadfe1b06e06160ab7fbaf3f8 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -0,0 +1,1908 @@ +use unix::bsd::O_SYNC; + +pub type clock_t = i64; +pub type suseconds_t = ::c_long; +pub type dev_t = i32; +pub type sigset_t = ::c_uint; +pub type blksize_t = i32; +pub type fsblkcnt_t = u64; +pub type fsfilcnt_t = u64; +pub type pthread_attr_t = *mut ::c_void; +pub type pthread_mutex_t = *mut ::c_void; +pub type pthread_mutexattr_t = *mut ::c_void; +pub type pthread_cond_t = *mut ::c_void; +pub type pthread_condattr_t = *mut ::c_void; +pub type pthread_rwlock_t = *mut ::c_void; +pub type pthread_rwlockattr_t = *mut ::c_void; +pub type pthread_spinlock_t = ::uintptr_t; +pub type caddr_t = *mut ::c_char; + +// elf.h + +pub type Elf32_Addr = u32; +pub type Elf32_Half = u16; +pub type Elf32_Lword = u64; +pub type Elf32_Off = u32; +pub type Elf32_Sword = i32; +pub type Elf32_Word = u32; + +pub type Elf64_Addr = u64; +pub type Elf64_Half = u16; +pub type Elf64_Lword = u64; +pub type Elf64_Off = u64; +pub type Elf64_Sword = i32; +pub type Elf64_Sxword = i64; +pub type Elf64_Word = u32; +pub type Elf64_Xword = u64; + +// search.h + +pub type ENTRY = entry; +pub type ACTION = ::c_uint; + +cfg_if! { + if #[cfg(target_pointer_width = "64")] { + type Elf_Addr = Elf64_Addr; + type Elf_Half = Elf64_Half; + type Elf_Phdr = Elf64_Phdr; + } else if #[cfg(target_pointer_width = "32")] { + type Elf_Addr = Elf32_Addr; + type Elf_Half = Elf32_Half; + type Elf_Phdr = Elf32_Phdr; + } +} + +s! { + pub struct ip_mreqn { + pub imr_multiaddr: in_addr, + pub imr_address: in_addr, + pub imr_ifindex: ::c_int, + } + + pub struct glob_t { + pub gl_pathc: ::size_t, + pub gl_matchc: ::size_t, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + pub gl_pathv: *mut *mut ::c_char, + __unused1: *mut ::c_void, + __unused2: *mut ::c_void, + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + __unused6: *mut ::c_void, + __unused7: *mut ::c_void, + } + + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } + + pub struct ufs_args { + pub fspec: *mut ::c_char, + pub export_info: export_args, + } + + pub struct mfs_args { + pub fspec: *mut ::c_char, + pub export_info: export_args, + // https://github.com/openbsd/src/blob/master/sys/sys/types.h#L134 + pub base: *mut ::c_char, + pub size: ::c_ulong, + } + + pub struct iso_args { + pub fspec: *mut ::c_char, + pub export_info: export_args, + pub flags: ::c_int, + pub sess: ::c_int, + } + + pub struct nfs_args { + pub version: ::c_int, + pub addr: *mut ::sockaddr, + pub addrlen: ::c_int, + pub sotype: ::c_int, + pub proto: ::c_int, + pub fh: *mut ::c_uchar, + pub fhsize: ::c_int, + pub flags: ::c_int, + pub wsize: ::c_int, + pub rsize: ::c_int, + pub readdirsize: ::c_int, + pub timeo: ::c_int, + pub retrans: ::c_int, + pub maxgrouplist: ::c_int, + pub readahead: ::c_int, + pub leaseterm: ::c_int, + pub deadthresh: ::c_int, + pub hostname: *mut ::c_char, + pub acregmin: ::c_int, + pub acregmax: ::c_int, + pub acdirmin: ::c_int, + pub acdirmax: ::c_int, + } + + pub struct msdosfs_args { + pub fspec: *mut ::c_char, + pub export_info: export_args, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub mask: ::mode_t, + pub flags: ::c_int, + } + + pub struct ntfs_args { + pub fspec: *mut ::c_char, + pub export_info: export_args, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub mode: ::mode_t, + pub flag: ::c_ulong, + } + + pub struct udf_args { + pub fspec: *mut ::c_char, + pub lastblock: u32, + } + + pub struct tmpfs_args { + pub ta_version: ::c_int, + pub ta_nodes_max: ::ino_t, + pub ta_size_max: ::off_t, + pub ta_root_uid: ::uid_t, + pub ta_root_gid: ::gid_t, + pub ta_root_mode: ::mode_t, + } + + pub struct fusefs_args { + pub name: *mut ::c_char, + pub fd: ::c_int, + pub max_read: ::c_int, + pub allow_other: ::c_int, + } + + pub struct xucred { + pub cr_uid: ::uid_t, + pub cr_gid: ::gid_t, + pub cr_ngroups: ::c_short, + //https://github.com/openbsd/src/blob/master/sys/sys/syslimits.h#L44 + pub cr_groups: [::gid_t; 16], + } + + pub struct export_args { + pub ex_flags: ::c_int, + pub ex_root: ::uid_t, + pub ex_anon: xucred, + pub ex_addr: *mut ::sockaddr, + pub ex_addrlen: ::c_int, + pub ex_mask: *mut ::sockaddr, + pub ex_masklen: ::c_int, + } + + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct in_addr { + pub s_addr: ::in_addr_t, + } + + pub struct sockaddr_in { + pub sin_len: u8, + pub sin_family: ::sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [i8; 8], + } + + pub struct splice { + pub sp_fd: ::c_int, + pub sp_max: ::off_t, + pub sp_idle: ::timeval, + } + + pub struct kevent { + pub ident: ::uintptr_t, + pub filter: ::c_short, + pub flags: ::c_ushort, + pub fflags: ::c_uint, + pub data: i64, + pub udata: *mut ::c_void, + } + + pub struct stat { + pub st_mode: ::mode_t, + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: u32, + pub st_gen: u32, + pub st_birthtime: ::time_t, + pub st_birthtime_nsec: ::c_long, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + } + + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + pub ai_addrlen: ::socklen_t, + pub ai_addr: *mut ::sockaddr, + pub ai_canonname: *mut ::c_char, + pub ai_next: *mut ::addrinfo, + } + + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *mut ::c_void, + } + + pub struct if_data { + pub ifi_type: ::c_uchar, + pub ifi_addrlen: ::c_uchar, + pub ifi_hdrlen: ::c_uchar, + pub ifi_link_state: ::c_uchar, + pub ifi_mtu: u32, + pub ifi_metric: u32, + pub ifi_rdomain: u32, + pub ifi_baudrate: u64, + pub ifi_ipackets: u64, + pub ifi_ierrors: u64, + pub ifi_opackets: u64, + pub ifi_oerrors: u64, + pub ifi_collisions: u64, + pub ifi_ibytes: u64, + pub ifi_obytes: u64, + pub ifi_imcasts: u64, + pub ifi_omcasts: u64, + pub ifi_iqdrops: u64, + pub ifi_oqdrops: u64, + pub ifi_noproto: u64, + pub ifi_capabilities: u32, + pub ifi_lastchange: ::timeval, + } + + pub struct if_msghdr { + pub ifm_msglen: ::c_ushort, + pub ifm_version: ::c_uchar, + pub ifm_type: ::c_uchar, + pub ifm_hdrlen: ::c_ushort, + pub ifm_index: ::c_ushort, + pub ifm_tableid: ::c_ushort, + pub ifm_pad1: ::c_uchar, + pub ifm_pad2: ::c_uchar, + pub ifm_addrs: ::c_int, + pub ifm_flags: ::c_int, + pub ifm_xflags: ::c_int, + pub ifm_data: if_data, + } + + pub struct sockaddr_dl { + pub sdl_len: ::c_uchar, + pub sdl_family: ::c_uchar, + pub sdl_index: ::c_ushort, + pub sdl_type: ::c_uchar, + pub sdl_nlen: ::c_uchar, + pub sdl_alen: ::c_uchar, + pub sdl_slen: ::c_uchar, + pub sdl_data: [::c_char; 24], + } + + pub struct sockpeercred { + pub uid: ::uid_t, + pub gid: ::gid_t, + pub pid: ::pid_t, + } + + pub struct arphdr { + pub ar_hrd: u16, + pub ar_pro: u16, + pub ar_hln: u8, + pub ar_pln: u8, + pub ar_op: u16, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::c_int, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::c_short, + pub shm_atime: ::time_t, + __shm_atimensec: c_long, + pub shm_dtime: ::time_t, + __shm_dtimensec: c_long, + pub shm_ctime: ::time_t, + __shm_ctimensec: c_long, + pub shm_internal: *mut ::c_void, + } + + // elf.h + pub struct Elf32_Phdr { + pub p_type: Elf32_Word, + pub p_offset: Elf32_Off, + pub p_vaddr: Elf32_Addr, + pub p_paddr: Elf32_Addr, + pub p_filesz: Elf32_Word, + pub p_memsz: Elf32_Word, + pub p_flags: Elf32_Word, + pub p_align: Elf32_Word, + } + + pub struct Elf64_Phdr { + pub p_type: Elf64_Word, + pub p_flags: Elf64_Word, + pub p_offset: Elf64_Off, + pub p_vaddr: Elf64_Addr, + pub p_paddr: Elf64_Addr, + pub p_filesz: Elf64_Xword, + pub p_memsz: Elf64_Xword, + pub p_align: Elf64_Xword, + } + + // link.h + + pub struct dl_phdr_info { + pub dlpi_addr: Elf_Addr, + pub dlpi_name: *const ::c_char, + pub dlpi_phdr: *const Elf_Phdr, + pub dlpi_phnum: Elf_Half, + } + + // sys/sysctl.h + pub struct kinfo_proc { + pub p_forw: u64, + pub p_back: u64, + pub p_paddr: u64, + pub p_addr: u64, + pub p_fd: u64, + pub p_stats: u64, + pub p_limit: u64, + pub p_vmspace: u64, + pub p_sigacts: u64, + pub p_sess: u64, + pub p_tsess: u64, + pub p_ru: u64, + pub p_eflag: i32, + pub p_exitsig: i32, + pub p_flag: i32, + pub p_pid: i32, + pub p_ppid: i32, + pub p_sid: i32, + pub p__pgid: i32, + pub p_tpgid: i32, + pub p_uid: u32, + pub p_ruid: u32, + pub p_gid: u32, + pub p_rgid: u32, + pub p_groups: [u32; KI_NGROUPS as usize], + pub p_ngroups: i16, + pub p_jobc: i16, + pub p_tdev: u32, + pub p_estcpu: u32, + pub p_rtime_sec: u32, + pub p_rtime_usec: u32, + pub p_cpticks: i32, + pub p_pctcpu: u32, + pub p_swtime: u32, + pub p_slptime: u32, + pub p_schedflags: i32, + pub p_uticks: u64, + pub p_sticks: u64, + pub p_iticks: u64, + pub p_tracep: u64, + pub p_traceflag: i32, + pub p_holdcnt: i32, + pub p_siglist: i32, + pub p_sigmask: u32, + pub p_sigignore: u32, + pub p_sigcatch: u32, + pub p_stat: i8, + pub p_priority: u8, + pub p_usrpri: u8, + pub p_nice: u8, + pub p_xstat: u16, + pub p_spare: u16, + pub p_comm: [::c_char; KI_MAXCOMLEN as usize], + pub p_wmesg: [::c_char; KI_WMESGLEN as usize], + pub p_wchan: u64, + pub p_login: [::c_char; KI_MAXLOGNAME as usize], + pub p_vm_rssize: i32, + pub p_vm_tsize: i32, + pub p_vm_dsize: i32, + pub p_vm_ssize: i32, + pub p_uvalid: i64, + pub p_ustart_sec: u64, + pub p_ustart_usec: u32, + pub p_uutime_sec: u32, + pub p_uutime_usec: u32, + pub p_ustime_sec: u32, + pub p_ustime_usec: u32, + pub p_uru_maxrss: u64, + pub p_uru_ixrss: u64, + pub p_uru_idrss: u64, + pub p_uru_isrss: u64, + pub p_uru_minflt: u64, + pub p_uru_majflt: u64, + pub p_uru_nswap: u64, + pub p_uru_inblock: u64, + pub p_uru_oublock: u64, + pub p_uru_msgsnd: u64, + pub p_uru_msgrcv: u64, + pub p_uru_nsignals: u64, + pub p_uru_nvcsw: u64, + pub p_uru_nivcsw: u64, + pub p_uctime_sec: u32, + pub p_uctime_usec: u32, + pub p_psflags: u32, + pub p_acflag: u32, + pub p_svuid: u32, + pub p_svgid: u32, + pub p_emul: [::c_char; KI_EMULNAMELEN as usize], + pub p_rlim_rss_cur: u64, + pub p_cpuid: u64, + pub p_vm_map_size: u64, + pub p_tid: i32, + pub p_rtableid: u32, + pub p_pledge: u64, + } + + pub struct kinfo_vmentry { + pub kve_start: ::c_ulong, + pub kve_end: ::c_ulong, + pub kve_guard: ::c_ulong, + pub kve_fspace: ::c_ulong, + pub kve_fspace_augment: ::c_ulong, + pub kve_offset: u64, + pub kve_wired_count: ::c_int, + pub kve_etype: ::c_int, + pub kve_protection: ::c_int, + pub kve_max_protection: ::c_int, + pub kve_advice: ::c_int, + pub kve_inheritance: ::c_int, + pub kve_flags: u8, + } + + pub struct ptrace_state { + pub pe_report_event: ::c_int, + pub pe_other_pid: ::pid_t, + pub pe_tid: ::pid_t, + } + + pub struct ptrace_thread_state { + pub pts_tid: ::pid_t, + } + + // search.h + pub struct entry { + pub key: *mut ::c_char, + pub data: *mut ::c_void, + } +} + +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_char { + self.si_addr + } + + pub unsafe fn si_value(&self) -> ::sigval { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + _pid: ::pid_t, + _uid: ::uid_t, + value: ::sigval, + } + (*(self as *const siginfo_t as *const siginfo_timer)).value + } +} + +s_no_extra_traits! { + pub struct dirent { + pub d_fileno: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: u16, + pub d_type: u8, + pub d_namlen: u8, + __d_padding: [u8; 4], + pub d_name: [::c_char; 256], + } + + pub struct sockaddr_storage { + pub ss_len: u8, + pub ss_family: ::sa_family_t, + __ss_pad1: [u8; 6], + __ss_pad2: i64, + __ss_pad3: [u8; 240], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_code: ::c_int, + pub si_errno: ::c_int, + pub si_addr: *mut ::c_char, + #[cfg(target_pointer_width = "32")] + __pad: [u8; 112], + #[cfg(target_pointer_width = "64")] + __pad: [u8; 108], + } + + pub struct lastlog { + ll_time: ::time_t, + ll_line: [::c_char; UT_LINESIZE], + ll_host: [::c_char; UT_HOSTSIZE], + } + + pub struct utmp { + pub ut_line: [::c_char; UT_LINESIZE], + pub ut_name: [::c_char; UT_NAMESIZE], + pub ut_host: [::c_char; UT_HOSTSIZE], + pub ut_time: ::time_t, + } + + pub union mount_info { + pub ufs_args: ufs_args, + pub mfs_args: mfs_args, + pub nfs_args: nfs_args, + pub iso_args: iso_args, + pub msdosfs_args: msdosfs_args, + pub ntfs_args: ntfs_args, + pub tmpfs_args: tmpfs_args, + align: [::c_char; 160], + } + +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_fileno == other.d_fileno + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self.d_namlen == other.d_namlen + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for dirent {} + + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_fileno", &self.d_fileno) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + .field("d_namlen", &self.d_namlen) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_fileno.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_namlen.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for sockaddr_storage { + fn eq(&self, other: &sockaddr_storage) -> bool { + self.ss_len == other.ss_len + && self.ss_family == other.ss_family + } + } + + impl Eq for sockaddr_storage {} + + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("ss_len", &self.ss_len) + .field("ss_family", &self.ss_family) + .finish() + } + } + + impl ::hash::Hash for sockaddr_storage { + fn hash(&self, state: &mut H) { + self.ss_len.hash(state); + self.ss_family.hash(state); + } + } + + impl PartialEq for siginfo_t { + fn eq(&self, other: &siginfo_t) -> bool { + self.si_signo == other.si_signo + && self.si_code == other.si_code + && self.si_errno == other.si_errno + && self.si_addr == other.si_addr + } + } + + impl Eq for siginfo_t {} + + impl ::fmt::Debug for siginfo_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("siginfo_t") + .field("si_signo", &self.si_signo) + .field("si_code", &self.si_code) + .field("si_errno", &self.si_errno) + .field("si_addr", &self.si_addr) + .finish() + } + } + + impl ::hash::Hash for siginfo_t { + fn hash(&self, state: &mut H) { + self.si_signo.hash(state); + self.si_code.hash(state); + self.si_errno.hash(state); + self.si_addr.hash(state); + } + } + + impl PartialEq for lastlog { + fn eq(&self, other: &lastlog) -> bool { + self.ll_time == other.ll_time + && self + .ll_line + .iter() + .zip(other.ll_line.iter()) + .all(|(a,b)| a == b) + && self + .ll_host + .iter() + .zip(other.ll_host.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for lastlog {} + + impl ::fmt::Debug for lastlog { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("lastlog") + .field("ll_time", &self.ll_time) + // FIXME: .field("ll_line", &self.ll_line) + // FIXME: .field("ll_host", &self.ll_host) + .finish() + } + } + + impl ::hash::Hash for lastlog { + fn hash(&self, state: &mut H) { + self.ll_time.hash(state); + self.ll_line.hash(state); + self.ll_host.hash(state); + } + } + + impl PartialEq for utmp { + fn eq(&self, other: &utmp) -> bool { + self.ut_time == other.ut_time + && self + .ut_line + .iter() + .zip(other.ut_line.iter()) + .all(|(a,b)| a == b) + && self + .ut_name + .iter() + .zip(other.ut_name.iter()) + .all(|(a,b)| a == b) + && self + .ut_host + .iter() + .zip(other.ut_host.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for utmp {} + + impl ::fmt::Debug for utmp { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmp") + // FIXME: .field("ut_line", &self.ut_line) + // FIXME: .field("ut_name", &self.ut_name) + // FIXME: .field("ut_host", &self.ut_host) + .field("ut_time", &self.ut_time) + .finish() + } + } + + impl ::hash::Hash for utmp { + fn hash(&self, state: &mut H) { + self.ut_line.hash(state); + self.ut_name.hash(state); + self.ut_host.hash(state); + self.ut_time.hash(state); + } + } + + impl PartialEq for mount_info { + fn eq(&self, other: &mount_info) -> bool { + unsafe { + self.align + .iter() + .zip(other.align.iter()) + .all(|(a,b)| a == b) + } + } + } + + impl Eq for mount_info { } + + impl ::fmt::Debug for mount_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mount_info") + // FIXME: .field("align", &self.align) + .finish() + } + } + + impl ::hash::Hash for mount_info { + fn hash(&self, state: &mut H) { + unsafe { self.align.hash(state) }; + } + } + } +} + +cfg_if! { + if #[cfg(libc_union)] { + s_no_extra_traits! { + // This type uses the union mount_info: + pub struct statfs { + pub f_flags: u32, + pub f_bsize: u32, + pub f_iosize: u32, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: i64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: i64, + pub f_syncwrites: u64, + pub f_syncreads: u64, + pub f_asyncwrites: u64, + pub f_asyncreads: u64, + pub f_fsid: ::fsid_t, + pub f_namemax: u32, + pub f_owner: ::uid_t, + pub f_ctime: u64, + pub f_fstypename: [::c_char; 16], + pub f_mntonname: [::c_char; 90], + pub f_mntfromname: [::c_char; 90], + pub f_mntfromspec: [::c_char; 90], + pub mount_info: mount_info, + } + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for statfs { + fn eq(&self, other: &statfs) -> bool { + self.f_flags == other.f_flags + && self.f_bsize == other.f_bsize + && self.f_iosize == other.f_iosize + && self.f_blocks == other.f_blocks + && self.f_bfree == other.f_bfree + && self.f_bavail == other.f_bavail + && self.f_files == other.f_files + && self.f_ffree == other.f_ffree + && self.f_favail == other.f_favail + && self.f_syncwrites == other.f_syncwrites + && self.f_syncreads == other.f_syncreads + && self.f_asyncwrites == other.f_asyncwrites + && self.f_asyncreads == other.f_asyncreads + && self.f_fsid == other.f_fsid + && self.f_namemax == other.f_namemax + && self.f_owner == other.f_owner + && self.f_ctime == other.f_ctime + && self.f_fstypename + .iter() + .zip(other.f_fstypename.iter()) + .all(|(a,b)| a == b) + && self.f_mntonname + .iter() + .zip(other.f_mntonname.iter()) + .all(|(a,b)| a == b) + && self.f_mntfromname + .iter() + .zip(other.f_mntfromname.iter()) + .all(|(a,b)| a == b) + && self.f_mntfromspec + .iter() + .zip(other.f_mntfromspec.iter()) + .all(|(a,b)| a == b) + && self.mount_info == other.mount_info + } + } + + impl Eq for statfs { } + + impl ::fmt::Debug for statfs { + fn fmt(&self, f: &mut ::fmt::Formatter) + -> ::fmt::Result { + f.debug_struct("statfs") + .field("f_flags", &self.f_flags) + .field("f_bsize", &self.f_bsize) + .field("f_iosize", &self.f_iosize) + .field("f_blocks", &self.f_blocks) + .field("f_bfree", &self.f_bfree) + .field("f_bavail", &self.f_bavail) + .field("f_files", &self.f_files) + .field("f_ffree", &self.f_ffree) + .field("f_favail", &self.f_favail) + .field("f_syncwrites", &self.f_syncwrites) + .field("f_syncreads", &self.f_syncreads) + .field("f_asyncwrites", &self.f_asyncwrites) + .field("f_asyncreads", &self.f_asyncreads) + .field("f_fsid", &self.f_fsid) + .field("f_namemax", &self.f_namemax) + .field("f_owner", &self.f_owner) + .field("f_ctime", &self.f_ctime) + // FIXME: .field("f_fstypename", &self.f_fstypename) + // FIXME: .field("f_mntonname", &self.f_mntonname) + // FIXME: .field("f_mntfromname", &self.f_mntfromname) + // FIXME: .field("f_mntfromspec", &self.f_mntfromspec) + .field("mount_info", &self.mount_info) + .finish() + } + } + + impl ::hash::Hash for statfs { + fn hash(&self, state: &mut H) { + self.f_flags.hash(state); + self.f_bsize.hash(state); + self.f_iosize.hash(state); + self.f_blocks.hash(state); + self.f_bfree.hash(state); + self.f_bavail.hash(state); + self.f_files.hash(state); + self.f_ffree.hash(state); + self.f_favail.hash(state); + self.f_syncwrites.hash(state); + self.f_syncreads.hash(state); + self.f_asyncwrites.hash(state); + self.f_asyncreads.hash(state); + self.f_fsid.hash(state); + self.f_namemax.hash(state); + self.f_owner.hash(state); + self.f_ctime.hash(state); + self.f_fstypename.hash(state); + self.f_mntonname.hash(state); + self.f_mntfromname.hash(state); + self.f_mntfromspec.hash(state); + self.mount_info.hash(state); + } + } + } + } + } +} + +pub const UT_NAMESIZE: usize = 32; +pub const UT_LINESIZE: usize = 8; +pub const UT_HOSTSIZE: usize = 256; + +pub const O_CLOEXEC: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x20000; +pub const O_RSYNC: ::c_int = O_SYNC; + +pub const MS_SYNC: ::c_int = 0x0002; +pub const MS_INVALIDATE: ::c_int = 0x0004; + +pub const POLLNORM: ::c_short = ::POLLRDNORM; + +pub const ENOATTR: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const EOVERFLOW: ::c_int = 87; +pub const ECANCELED: ::c_int = 88; +pub const EIDRM: ::c_int = 89; +pub const ENOMSG: ::c_int = 90; +pub const ENOTSUP: ::c_int = 91; +pub const EBADMSG: ::c_int = 92; +pub const ENOTRECOVERABLE: ::c_int = 93; +pub const EOWNERDEAD: ::c_int = 94; +pub const EPROTO: ::c_int = 95; +pub const ELAST: ::c_int = 95; + +pub const F_DUPFD_CLOEXEC: ::c_int = 10; + +pub const UTIME_OMIT: c_long = -1; +pub const UTIME_NOW: c_long = -2; + +pub const AT_FDCWD: ::c_int = -100; +pub const AT_EACCESS: ::c_int = 0x01; +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x02; +pub const AT_SYMLINK_FOLLOW: ::c_int = 0x04; +pub const AT_REMOVEDIR: ::c_int = 0x08; + +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] +pub const RLIM_NLIMITS: ::c_int = 9; + +pub const SO_TIMESTAMP: ::c_int = 0x0800; +pub const SO_SNDTIMEO: ::c_int = 0x1005; +pub const SO_RCVTIMEO: ::c_int = 0x1006; +pub const SO_BINDANY: ::c_int = 0x1000; +pub const SO_NETPROC: ::c_int = 0x1020; +pub const SO_RTABLE: ::c_int = 0x1021; +pub const SO_PEERCRED: ::c_int = 0x1022; +pub const SO_SPLICE: ::c_int = 0x1023; + +// sys/netinet/in.h +// Protocols (RFC 1700) +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +// IPPROTO_IP defined in src/unix/mod.rs +/// Hop-by-hop option header +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// gateway^2 (deprecated) +pub const IPPROTO_GGP: ::c_int = 3; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +// IPPROTO_UDP defined in src/unix/mod.rs +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +/// IP Mobility RFC 2004 +pub const IPPROTO_MOBILE: ::c_int = 55; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +/// ISO cnlp +pub const IPPROTO_EON: ::c_int = 80; +/// Ethernet-in-IP +pub const IPPROTO_ETHERIP: ::c_int = 97; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// Protocol indep. multicast +pub const IPPROTO_PIM: ::c_int = 103; +/// IP Payload Comp. Protocol +pub const IPPROTO_IPCOMP: ::c_int = 108; +/// CARP +pub const IPPROTO_CARP: ::c_int = 112; +/// unicast MPLS packet +pub const IPPROTO_MPLS: ::c_int = 137; +/// PFSYNC +pub const IPPROTO_PFSYNC: ::c_int = 240; +pub const IPPROTO_MAX: ::c_int = 256; + +// Only used internally, so it can be outside the range of valid IP protocols +pub const IPPROTO_DIVERT: ::c_int = 258; + +pub const IP_RECVDSTADDR: ::c_int = 7; +pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR; +pub const IP_RECVIF: ::c_int = 30; + +// sys/netinet/in.h +pub const TCP_MD5SIG: ::c_int = 0x04; +pub const TCP_NOPUSH: ::c_int = 0x10; + +pub const AF_ECMA: ::c_int = 8; +pub const AF_ROUTE: ::c_int = 17; +pub const AF_ENCAP: ::c_int = 28; +pub const AF_SIP: ::c_int = 29; +pub const AF_KEY: ::c_int = 30; +pub const pseudo_AF_HDRCMPLT: ::c_int = 31; +pub const AF_BLUETOOTH: ::c_int = 32; +pub const AF_MPLS: ::c_int = 33; +pub const pseudo_AF_PFLOW: ::c_int = 34; +pub const pseudo_AF_PIPEX: ::c_int = 35; +pub const NET_RT_DUMP: ::c_int = 1; +pub const NET_RT_FLAGS: ::c_int = 2; +pub const NET_RT_IFLIST: ::c_int = 3; +pub const NET_RT_STATS: ::c_int = 4; +pub const NET_RT_TABLE: ::c_int = 5; +pub const NET_RT_IFNAMES: ::c_int = 6; +#[doc(hidden)] +#[deprecated( + since = "0.2.95", + note = "Possibly increasing over the releases and might not be so used in the field" +)] +pub const NET_RT_MAXID: ::c_int = 7; + +pub const IPV6_JOIN_GROUP: ::c_int = 12; +pub const IPV6_LEAVE_GROUP: ::c_int = 13; + +pub const PF_ROUTE: ::c_int = AF_ROUTE; +pub const PF_ECMA: ::c_int = AF_ECMA; +pub const PF_ENCAP: ::c_int = AF_ENCAP; +pub const PF_SIP: ::c_int = AF_SIP; +pub const PF_KEY: ::c_int = AF_KEY; +pub const PF_BPF: ::c_int = pseudo_AF_HDRCMPLT; +pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; +pub const PF_MPLS: ::c_int = AF_MPLS; +pub const PF_PFLOW: ::c_int = pseudo_AF_PFLOW; +pub const PF_PIPEX: ::c_int = pseudo_AF_PIPEX; + +pub const SCM_TIMESTAMP: ::c_int = 0x04; + +pub const O_DSYNC: ::c_int = 128; + +pub const MAP_RENAME: ::c_int = 0x0000; +pub const MAP_NORESERVE: ::c_int = 0x0000; +pub const MAP_HASSEMAPHORE: ::c_int = 0x0000; + +pub const EIPSEC: ::c_int = 82; +pub const ENOMEDIUM: ::c_int = 85; +pub const EMEDIUMTYPE: ::c_int = 86; + +pub const EAI_BADFLAGS: ::c_int = -1; +pub const EAI_NONAME: ::c_int = -2; +pub const EAI_AGAIN: ::c_int = -3; +pub const EAI_FAIL: ::c_int = -4; +pub const EAI_NODATA: ::c_int = -5; +pub const EAI_FAMILY: ::c_int = -6; +pub const EAI_SOCKTYPE: ::c_int = -7; +pub const EAI_SERVICE: ::c_int = -8; +pub const EAI_MEMORY: ::c_int = -10; +pub const EAI_SYSTEM: ::c_int = -11; +pub const EAI_OVERFLOW: ::c_int = -14; + +pub const RUSAGE_THREAD: ::c_int = 1; + +pub const MAP_COPY: ::c_int = 0x0002; +pub const MAP_NOEXTEND: ::c_int = 0x0000; + +pub const _PC_LINK_MAX: ::c_int = 1; +pub const _PC_MAX_CANON: ::c_int = 2; +pub const _PC_MAX_INPUT: ::c_int = 3; +pub const _PC_NAME_MAX: ::c_int = 4; +pub const _PC_PATH_MAX: ::c_int = 5; +pub const _PC_PIPE_BUF: ::c_int = 6; +pub const _PC_CHOWN_RESTRICTED: ::c_int = 7; +pub const _PC_NO_TRUNC: ::c_int = 8; +pub const _PC_VDISABLE: ::c_int = 9; +pub const _PC_2_SYMLINKS: ::c_int = 10; +pub const _PC_ALLOC_SIZE_MIN: ::c_int = 11; +pub const _PC_ASYNC_IO: ::c_int = 12; +pub const _PC_FILESIZEBITS: ::c_int = 13; +pub const _PC_PRIO_IO: ::c_int = 14; +pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 15; +pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 16; +pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 17; +pub const _PC_REC_XFER_ALIGN: ::c_int = 18; +pub const _PC_SYMLINK_MAX: ::c_int = 19; +pub const _PC_SYNC_IO: ::c_int = 20; +pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 21; + +pub const _SC_CLK_TCK: ::c_int = 3; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 31; +pub const _SC_SEM_VALUE_MAX: ::c_int = 32; +pub const _SC_HOST_NAME_MAX: ::c_int = 33; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 34; +pub const _SC_2_PBS: ::c_int = 35; +pub const _SC_2_PBS_ACCOUNTING: ::c_int = 36; +pub const _SC_2_PBS_CHECKPOINT: ::c_int = 37; +pub const _SC_2_PBS_LOCATE: ::c_int = 38; +pub const _SC_2_PBS_MESSAGE: ::c_int = 39; +pub const _SC_2_PBS_TRACK: ::c_int = 40; +pub const _SC_ADVISORY_INFO: ::c_int = 41; +pub const _SC_AIO_LISTIO_MAX: ::c_int = 42; +pub const _SC_AIO_MAX: ::c_int = 43; +pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44; +pub const _SC_ASYNCHRONOUS_IO: ::c_int = 45; +pub const _SC_ATEXIT_MAX: ::c_int = 46; +pub const _SC_BARRIERS: ::c_int = 47; +pub const _SC_CLOCK_SELECTION: ::c_int = 48; +pub const _SC_CPUTIME: ::c_int = 49; +pub const _SC_DELAYTIMER_MAX: ::c_int = 50; +pub const _SC_IOV_MAX: ::c_int = 51; +pub const _SC_IPV6: ::c_int = 52; +pub const _SC_MAPPED_FILES: ::c_int = 53; +pub const _SC_MEMLOCK: ::c_int = 54; +pub const _SC_MEMLOCK_RANGE: ::c_int = 55; +pub const _SC_MEMORY_PROTECTION: ::c_int = 56; +pub const _SC_MESSAGE_PASSING: ::c_int = 57; +pub const _SC_MQ_OPEN_MAX: ::c_int = 58; +pub const _SC_MQ_PRIO_MAX: ::c_int = 59; +pub const _SC_PRIORITIZED_IO: ::c_int = 60; +pub const _SC_PRIORITY_SCHEDULING: ::c_int = 61; +pub const _SC_RAW_SOCKETS: ::c_int = 62; +pub const _SC_READER_WRITER_LOCKS: ::c_int = 63; +pub const _SC_REALTIME_SIGNALS: ::c_int = 64; +pub const _SC_REGEXP: ::c_int = 65; +pub const _SC_RTSIG_MAX: ::c_int = 66; +pub const _SC_SEMAPHORES: ::c_int = 67; +pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 68; +pub const _SC_SHELL: ::c_int = 69; +pub const _SC_SIGQUEUE_MAX: ::c_int = 70; +pub const _SC_SPAWN: ::c_int = 71; +pub const _SC_SPIN_LOCKS: ::c_int = 72; +pub const _SC_SPORADIC_SERVER: ::c_int = 73; +pub const _SC_SS_REPL_MAX: ::c_int = 74; +pub const _SC_SYNCHRONIZED_IO: ::c_int = 75; +pub const _SC_SYMLOOP_MAX: ::c_int = 76; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78; +pub const _SC_THREAD_CPUTIME: ::c_int = 79; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 80; +pub const _SC_THREAD_KEYS_MAX: ::c_int = 81; +pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 82; +pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 83; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 84; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 85; +pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 86; +pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 87; +pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 88; +pub const _SC_THREAD_STACK_MIN: ::c_int = 89; +pub const _SC_THREAD_THREADS_MAX: ::c_int = 90; +pub const _SC_THREADS: ::c_int = 91; +pub const _SC_TIMEOUTS: ::c_int = 92; +pub const _SC_TIMER_MAX: ::c_int = 93; +pub const _SC_TIMERS: ::c_int = 94; +pub const _SC_TRACE: ::c_int = 95; +pub const _SC_TRACE_EVENT_FILTER: ::c_int = 96; +pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 97; +pub const _SC_TRACE_INHERIT: ::c_int = 98; +pub const _SC_TRACE_LOG: ::c_int = 99; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 100; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 101; +pub const _SC_LOGIN_NAME_MAX: ::c_int = 102; +pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 103; +pub const _SC_TRACE_NAME_MAX: ::c_int = 104; +pub const _SC_TRACE_SYS_MAX: ::c_int = 105; +pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 106; +pub const _SC_TTY_NAME_MAX: ::c_int = 107; +pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 108; +pub const _SC_V6_ILP32_OFF32: ::c_int = 109; +pub const _SC_V6_ILP32_OFFBIG: ::c_int = 110; +pub const _SC_V6_LP64_OFF64: ::c_int = 111; +pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 112; +pub const _SC_V7_ILP32_OFF32: ::c_int = 113; +pub const _SC_V7_ILP32_OFFBIG: ::c_int = 114; +pub const _SC_V7_LP64_OFF64: ::c_int = 115; +pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 116; +pub const _SC_XOPEN_CRYPT: ::c_int = 117; +pub const _SC_XOPEN_ENH_I18N: ::c_int = 118; +pub const _SC_XOPEN_LEGACY: ::c_int = 119; +pub const _SC_XOPEN_REALTIME: ::c_int = 120; +pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 121; +pub const _SC_XOPEN_STREAMS: ::c_int = 122; +pub const _SC_XOPEN_UNIX: ::c_int = 123; +pub const _SC_XOPEN_UUCP: ::c_int = 124; +pub const _SC_XOPEN_VERSION: ::c_int = 125; +pub const _SC_PHYS_PAGES: ::c_int = 500; +pub const _SC_AVPHYS_PAGES: ::c_int = 501; +pub const _SC_NPROCESSORS_CONF: ::c_int = 502; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 503; + +pub const FD_SETSIZE: usize = 1024; + +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_OTHER: ::c_int = 2; +pub const SCHED_RR: ::c_int = 3; + +pub const ST_NOSUID: ::c_ulong = 2; + +pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _; +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _; +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _; + +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3; +pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4; +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP; + +pub const EVFILT_AIO: i16 = -3; +pub const EVFILT_PROC: i16 = -5; +pub const EVFILT_READ: i16 = -1; +pub const EVFILT_SIGNAL: i16 = -6; +pub const EVFILT_TIMER: i16 = -7; +pub const EVFILT_VNODE: i16 = -4; +pub const EVFILT_WRITE: i16 = -2; + +pub const EV_ADD: u16 = 0x1; +pub const EV_DELETE: u16 = 0x2; +pub const EV_ENABLE: u16 = 0x4; +pub const EV_DISABLE: u16 = 0x8; +pub const EV_ONESHOT: u16 = 0x10; +pub const EV_CLEAR: u16 = 0x20; +pub const EV_RECEIPT: u16 = 0x40; +pub const EV_DISPATCH: u16 = 0x80; +pub const EV_FLAG1: u16 = 0x2000; +pub const EV_ERROR: u16 = 0x4000; +pub const EV_EOF: u16 = 0x8000; + +#[deprecated(since = "0.2.113", note = "Not stable across OS versions")] +pub const EV_SYSFLAGS: u16 = 0xf800; + +pub const NOTE_LOWAT: u32 = 0x00000001; +pub const NOTE_EOF: u32 = 0x00000002; +pub const NOTE_DELETE: u32 = 0x00000001; +pub const NOTE_WRITE: u32 = 0x00000002; +pub const NOTE_EXTEND: u32 = 0x00000004; +pub const NOTE_ATTRIB: u32 = 0x00000008; +pub const NOTE_LINK: u32 = 0x00000010; +pub const NOTE_RENAME: u32 = 0x00000020; +pub const NOTE_REVOKE: u32 = 0x00000040; +pub const NOTE_TRUNCATE: u32 = 0x00000080; +pub const NOTE_EXIT: u32 = 0x80000000; +pub const NOTE_FORK: u32 = 0x40000000; +pub const NOTE_EXEC: u32 = 0x20000000; +pub const NOTE_PDATAMASK: u32 = 0x000fffff; +pub const NOTE_PCTRLMASK: u32 = 0xf0000000; +pub const NOTE_TRACK: u32 = 0x00000001; +pub const NOTE_TRACKERR: u32 = 0x00000002; +pub const NOTE_CHILD: u32 = 0x00000004; + +pub const TMP_MAX: ::c_uint = 0x7fffffff; + +pub const AI_PASSIVE: ::c_int = 1; +pub const AI_CANONNAME: ::c_int = 2; +pub const AI_NUMERICHOST: ::c_int = 4; +pub const AI_EXT: ::c_int = 8; +pub const AI_NUMERICSERV: ::c_int = 16; +pub const AI_FQDN: ::c_int = 32; +pub const AI_ADDRCONFIG: ::c_int = 64; + +pub const NI_NUMERICHOST: ::c_int = 1; +pub const NI_NUMERICSERV: ::c_int = 2; +pub const NI_NOFQDN: ::c_int = 4; +pub const NI_NAMEREQD: ::c_int = 8; +pub const NI_DGRAM: ::c_int = 16; + +pub const NI_MAXHOST: ::size_t = 256; + +pub const RTLD_LOCAL: ::c_int = 0; + +pub const CTL_MAXNAME: ::c_int = 12; + +pub const CTLTYPE_NODE: ::c_int = 1; +pub const CTLTYPE_INT: ::c_int = 2; +pub const CTLTYPE_STRING: ::c_int = 3; +pub const CTLTYPE_QUAD: ::c_int = 4; +pub const CTLTYPE_STRUCT: ::c_int = 5; + +pub const CTL_UNSPEC: ::c_int = 0; +pub const CTL_KERN: ::c_int = 1; +pub const CTL_VM: ::c_int = 2; +pub const CTL_FS: ::c_int = 3; +pub const CTL_NET: ::c_int = 4; +pub const CTL_DEBUG: ::c_int = 5; +pub const CTL_HW: ::c_int = 6; +pub const CTL_MACHDEP: ::c_int = 7; +pub const CTL_DDB: ::c_int = 9; +pub const CTL_VFS: ::c_int = 10; +pub const CTL_MAXID: ::c_int = 11; + +pub const HW_NCPUONLINE: ::c_int = 25; + +pub const KERN_OSTYPE: ::c_int = 1; +pub const KERN_OSRELEASE: ::c_int = 2; +pub const KERN_OSREV: ::c_int = 3; +pub const KERN_VERSION: ::c_int = 4; +pub const KERN_MAXVNODES: ::c_int = 5; +pub const KERN_MAXPROC: ::c_int = 6; +pub const KERN_MAXFILES: ::c_int = 7; +pub const KERN_ARGMAX: ::c_int = 8; +pub const KERN_SECURELVL: ::c_int = 9; +pub const KERN_HOSTNAME: ::c_int = 10; +pub const KERN_HOSTID: ::c_int = 11; +pub const KERN_CLOCKRATE: ::c_int = 12; +pub const KERN_PROF: ::c_int = 16; +pub const KERN_POSIX1: ::c_int = 17; +pub const KERN_NGROUPS: ::c_int = 18; +pub const KERN_JOB_CONTROL: ::c_int = 19; +pub const KERN_SAVED_IDS: ::c_int = 20; +pub const KERN_BOOTTIME: ::c_int = 21; +pub const KERN_DOMAINNAME: ::c_int = 22; +pub const KERN_MAXPARTITIONS: ::c_int = 23; +pub const KERN_RAWPARTITION: ::c_int = 24; +pub const KERN_MAXTHREAD: ::c_int = 25; +pub const KERN_NTHREADS: ::c_int = 26; +pub const KERN_OSVERSION: ::c_int = 27; +pub const KERN_SOMAXCONN: ::c_int = 28; +pub const KERN_SOMINCONN: ::c_int = 29; +#[deprecated(since = "0.2.71", note = "Removed in OpenBSD 6.0")] +pub const KERN_USERMOUNT: ::c_int = 30; +pub const KERN_NOSUIDCOREDUMP: ::c_int = 32; +pub const KERN_FSYNC: ::c_int = 33; +pub const KERN_SYSVMSG: ::c_int = 34; +pub const KERN_SYSVSEM: ::c_int = 35; +pub const KERN_SYSVSHM: ::c_int = 36; +#[deprecated(since = "0.2.71", note = "Removed in OpenBSD 6.0")] +pub const KERN_ARND: ::c_int = 37; +pub const KERN_MSGBUFSIZE: ::c_int = 38; +pub const KERN_MALLOCSTATS: ::c_int = 39; +pub const KERN_CPTIME: ::c_int = 40; +pub const KERN_NCHSTATS: ::c_int = 41; +pub const KERN_FORKSTAT: ::c_int = 42; +pub const KERN_NSELCOLL: ::c_int = 43; +pub const KERN_TTY: ::c_int = 44; +pub const KERN_CCPU: ::c_int = 45; +pub const KERN_FSCALE: ::c_int = 46; +pub const KERN_NPROCS: ::c_int = 47; +pub const KERN_MSGBUF: ::c_int = 48; +pub const KERN_POOL: ::c_int = 49; +pub const KERN_STACKGAPRANDOM: ::c_int = 50; +pub const KERN_SYSVIPC_INFO: ::c_int = 51; +pub const KERN_SPLASSERT: ::c_int = 54; +pub const KERN_PROC_ARGS: ::c_int = 55; +pub const KERN_NFILES: ::c_int = 56; +pub const KERN_TTYCOUNT: ::c_int = 57; +pub const KERN_NUMVNODES: ::c_int = 58; +pub const KERN_MBSTAT: ::c_int = 59; +pub const KERN_SEMINFO: ::c_int = 61; +pub const KERN_SHMINFO: ::c_int = 62; +pub const KERN_INTRCNT: ::c_int = 63; +pub const KERN_WATCHDOG: ::c_int = 64; +pub const KERN_PROC: ::c_int = 66; +pub const KERN_MAXCLUSTERS: ::c_int = 67; +pub const KERN_EVCOUNT: ::c_int = 68; +pub const KERN_TIMECOUNTER: ::c_int = 69; +pub const KERN_MAXLOCKSPERUID: ::c_int = 70; +pub const KERN_CPTIME2: ::c_int = 71; +pub const KERN_CACHEPCT: ::c_int = 72; +pub const KERN_FILE: ::c_int = 73; +pub const KERN_CONSDEV: ::c_int = 75; +pub const KERN_NETLIVELOCKS: ::c_int = 76; +pub const KERN_POOL_DEBUG: ::c_int = 77; +pub const KERN_PROC_CWD: ::c_int = 78; +pub const KERN_PROC_NOBROADCASTKILL: ::c_int = 79; +pub const KERN_PROC_VMMAP: ::c_int = 80; +pub const KERN_GLOBAL_PTRACE: ::c_int = 81; +pub const KERN_CONSBUFSIZE: ::c_int = 82; +pub const KERN_CONSBUF: ::c_int = 83; +pub const KERN_AUDIO: ::c_int = 84; +pub const KERN_CPUSTATS: ::c_int = 85; +pub const KERN_PFSTATUS: ::c_int = 86; +pub const KERN_TIMEOUT_STATS: ::c_int = 87; +#[deprecated( + since = "0.2.95", + note = "Possibly increasing over the releases and might not be so used in the field" +)] +pub const KERN_MAXID: ::c_int = 88; + +pub const KERN_PROC_ALL: ::c_int = 0; +pub const KERN_PROC_PID: ::c_int = 1; +pub const KERN_PROC_PGRP: ::c_int = 2; +pub const KERN_PROC_SESSION: ::c_int = 3; +pub const KERN_PROC_TTY: ::c_int = 4; +pub const KERN_PROC_UID: ::c_int = 5; +pub const KERN_PROC_RUID: ::c_int = 6; +pub const KERN_PROC_KTHREAD: ::c_int = 7; +pub const KERN_PROC_SHOW_THREADS: ::c_int = 0x40000000; + +pub const KERN_SYSVIPC_MSG_INFO: ::c_int = 1; +pub const KERN_SYSVIPC_SEM_INFO: ::c_int = 2; +pub const KERN_SYSVIPC_SHM_INFO: ::c_int = 3; + +pub const KERN_PROC_ARGV: ::c_int = 1; +pub const KERN_PROC_NARGV: ::c_int = 2; +pub const KERN_PROC_ENV: ::c_int = 3; +pub const KERN_PROC_NENV: ::c_int = 4; + +pub const KI_NGROUPS: ::c_int = 16; +pub const KI_MAXCOMLEN: ::c_int = 24; +pub const KI_WMESGLEN: ::c_int = 8; +pub const KI_MAXLOGNAME: ::c_int = 32; +pub const KI_EMULNAMELEN: ::c_int = 8; + +pub const KVE_ET_OBJ: ::c_int = 0x00000001; +pub const KVE_ET_SUBMAP: ::c_int = 0x00000002; +pub const KVE_ET_COPYONWRITE: ::c_int = 0x00000004; +pub const KVE_ET_NEEDSCOPY: ::c_int = 0x00000008; +pub const KVE_ET_HOLE: ::c_int = 0x00000010; +pub const KVE_ET_NOFAULT: ::c_int = 0x00000020; +pub const KVE_ET_STACK: ::c_int = 0x00000040; +pub const KVE_ET_WC: ::c_int = 0x000000080; +pub const KVE_ET_CONCEAL: ::c_int = 0x000000100; +pub const KVE_ET_SYSCALL: ::c_int = 0x000000200; +pub const KVE_ET_FREEMAPPED: ::c_int = 0x000000800; + +pub const KVE_PROT_NONE: ::c_int = 0x00000000; +pub const KVE_PROT_READ: ::c_int = 0x00000001; +pub const KVE_PROT_WRITE: ::c_int = 0x00000002; +pub const KVE_PROT_EXEC: ::c_int = 0x00000004; + +pub const KVE_ADV_NORMAL: ::c_int = 0x00000000; +pub const KVE_ADV_RANDOM: ::c_int = 0x00000001; +pub const KVE_ADV_SEQUENTIAL: ::c_int = 0x00000002; + +pub const KVE_INH_SHARE: ::c_int = 0x00000000; +pub const KVE_INH_COPY: ::c_int = 0x00000010; +pub const KVE_INH_NONE: ::c_int = 0x00000020; +pub const KVE_INH_ZERO: ::c_int = 0x00000030; + +pub const KVE_F_STATIC: ::c_int = 0x1; +pub const KVE_F_KMEM: ::c_int = 0x2; + +pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS; +pub const OLCUC: ::tcflag_t = 0x20; +pub const ONOCR: ::tcflag_t = 0x40; +pub const ONLRET: ::tcflag_t = 0x80; + +//https://github.com/openbsd/src/blob/master/sys/sys/mount.h +pub const ISOFSMNT_NORRIP: ::c_int = 0x1; // disable Rock Ridge Ext +pub const ISOFSMNT_GENS: ::c_int = 0x2; // enable generation numbers +pub const ISOFSMNT_EXTATT: ::c_int = 0x4; // enable extended attr +pub const ISOFSMNT_NOJOLIET: ::c_int = 0x8; // disable Joliet Ext +pub const ISOFSMNT_SESS: ::c_int = 0x10; // use iso_args.sess + +pub const NFS_ARGSVERSION: ::c_int = 4; // change when nfs_args changes + +pub const NFSMNT_RESVPORT: ::c_int = 0; // always use reserved ports +pub const NFSMNT_SOFT: ::c_int = 0x1; // soft mount (hard is default) +pub const NFSMNT_WSIZE: ::c_int = 0x2; // set write size +pub const NFSMNT_RSIZE: ::c_int = 0x4; // set read size +pub const NFSMNT_TIMEO: ::c_int = 0x8; // set initial timeout +pub const NFSMNT_RETRANS: ::c_int = 0x10; // set number of request retries +pub const NFSMNT_MAXGRPS: ::c_int = 0x20; // set maximum grouplist size +pub const NFSMNT_INT: ::c_int = 0x40; // allow interrupts on hard mount +pub const NFSMNT_NOCONN: ::c_int = 0x80; // Don't Connect the socket +pub const NFSMNT_NQNFS: ::c_int = 0x100; // Use Nqnfs protocol +pub const NFSMNT_NFSV3: ::c_int = 0x200; // Use NFS Version 3 protocol +pub const NFSMNT_KERB: ::c_int = 0x400; // Use Kerberos authentication +pub const NFSMNT_DUMBTIMR: ::c_int = 0x800; // Don't estimate rtt dynamically +pub const NFSMNT_LEASETERM: ::c_int = 0x1000; // set lease term (nqnfs) +pub const NFSMNT_READAHEAD: ::c_int = 0x2000; // set read ahead +pub const NFSMNT_DEADTHRESH: ::c_int = 0x4000; // set dead server retry thresh +pub const NFSMNT_NOAC: ::c_int = 0x8000; // disable attribute cache +pub const NFSMNT_RDIRPLUS: ::c_int = 0x10000; // Use Readdirplus for V3 +pub const NFSMNT_READDIRSIZE: ::c_int = 0x20000; // Set readdir size + +/* Flags valid only in mount syscall arguments */ +pub const NFSMNT_ACREGMIN: ::c_int = 0x40000; // acregmin field valid +pub const NFSMNT_ACREGMAX: ::c_int = 0x80000; // acregmax field valid +pub const NFSMNT_ACDIRMIN: ::c_int = 0x100000; // acdirmin field valid +pub const NFSMNT_ACDIRMAX: ::c_int = 0x200000; // acdirmax field valid + +/* Flags valid only in kernel */ +pub const NFSMNT_INTERNAL: ::c_int = 0xfffc0000; // Bits set internally +pub const NFSMNT_HASWRITEVERF: ::c_int = 0x40000; // Has write verifier for V3 +pub const NFSMNT_GOTPATHCONF: ::c_int = 0x80000; // Got the V3 pathconf info +pub const NFSMNT_GOTFSINFO: ::c_int = 0x100000; // Got the V3 fsinfo +pub const NFSMNT_MNTD: ::c_int = 0x200000; // Mnt server for mnt point +pub const NFSMNT_DISMINPROG: ::c_int = 0x400000; // Dismount in progress +pub const NFSMNT_DISMNT: ::c_int = 0x800000; // Dismounted +pub const NFSMNT_SNDLOCK: ::c_int = 0x1000000; // Send socket lock +pub const NFSMNT_WANTSND: ::c_int = 0x2000000; // Want above +pub const NFSMNT_RCVLOCK: ::c_int = 0x4000000; // Rcv socket lock +pub const NFSMNT_WANTRCV: ::c_int = 0x8000000; // Want above +pub const NFSMNT_WAITAUTH: ::c_int = 0x10000000; // Wait for authentication +pub const NFSMNT_HASAUTH: ::c_int = 0x20000000; // Has authenticator +pub const NFSMNT_WANTAUTH: ::c_int = 0x40000000; // Wants an authenticator +pub const NFSMNT_AUTHERR: ::c_int = 0x80000000; // Authentication error + +pub const MSDOSFSMNT_SHORTNAME: ::c_int = 0x1; // Force old DOS short names only +pub const MSDOSFSMNT_LONGNAME: ::c_int = 0x2; // Force Win'95 long names +pub const MSDOSFSMNT_NOWIN95: ::c_int = 0x4; // Completely ignore Win95 entries + +pub const NTFS_MFLAG_CASEINS: ::c_int = 0x1; +pub const NTFS_MFLAG_ALLNAMES: ::c_int = 0x2; + +pub const TMPFS_ARGS_VERSION: ::c_int = 1; + +pub const MAP_STACK: ::c_int = 0x4000; +pub const MAP_CONCEAL: ::c_int = 0x8000; + +// https://github.com/openbsd/src/blob/master/sys/net/if.h#L187 +pub const IFF_UP: ::c_int = 0x1; // interface is up +pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid +pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging +pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net +pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link +pub const IFF_STATICARP: ::c_int = 0x20; // only static ARP +pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated +pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol +pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets +pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets +pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress +pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions +pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit +pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit +pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit +pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast + +pub const PTHREAD_STACK_MIN: ::size_t = 1_usize << _MAX_PAGE_SHIFT; +pub const MINSIGSTKSZ: ::size_t = 3_usize << _MAX_PAGE_SHIFT; +pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + (1_usize << _MAX_PAGE_SHIFT) * 4; + +pub const PT_SET_EVENT_MASK: ::c_int = 12; +pub const PT_GET_EVENT_MASK: ::c_int = 13; +pub const PT_GET_PROCESS_STATE: ::c_int = 14; +pub const PT_GET_THREAD_FIRST: ::c_int = 15; +pub const PT_GET_THREAD_NEXT: ::c_int = 16; +pub const PT_FIRSTMACH: ::c_int = 32; + +pub const SOCK_CLOEXEC: ::c_int = 0x8000; +pub const SOCK_NONBLOCK: ::c_int = 0x4000; +pub const SOCK_DNS: ::c_int = 0x1000; + +pub const BIOCGRSIG: ::c_ulong = 0x40044273; +pub const BIOCSRSIG: ::c_ulong = 0x80044272; +pub const BIOCSDLT: ::c_ulong = 0x8004427a; + +pub const PTRACE_FORK: ::c_int = 0x0002; + +pub const WCONTINUED: ::c_int = 8; + +// search.h +pub const FIND: ::ACTION = 0; +pub const ENTER: ::ACTION = 1; + +// futex.h +pub const FUTEX_WAIT: ::c_int = 1; +pub const FUTEX_WAKE: ::c_int = 2; +pub const FUTEX_REQUEUE: ::c_int = 3; +pub const FUTEX_PRIVATE_FLAG: ::c_int = 128; + +// sysctl.h, kinfo_proc p_eflag constants +pub const EPROC_CTTY: i32 = 0x01; // controlling tty vnode active +pub const EPROC_SLEADER: i32 = 0x02; // session leader +pub const EPROC_UNVEIL: i32 = 0x04; // has unveil settings +pub const EPROC_LKUNVEIL: i32 = 0x08; // unveil is locked + +// Flags for chflags(2) +pub const UF_SETTABLE: ::c_uint = 0x0000ffff; +pub const UF_NODUMP: ::c_uint = 0x00000001; +pub const UF_IMMUTABLE: ::c_uint = 0x00000002; +pub const UF_APPEND: ::c_uint = 0x00000004; +pub const UF_OPAQUE: ::c_uint = 0x00000008; +pub const SF_SETTABLE: ::c_uint = 0xffff0000; +pub const SF_ARCHIVED: ::c_uint = 0x00010000; +pub const SF_IMMUTABLE: ::c_uint = 0x00020000; +pub const SF_APPEND: ::c_uint = 0x00040000; + +const_fn! { + {const} fn _ALIGN(p: usize) -> usize { + (p + _ALIGNBYTES) & !_ALIGNBYTES + } +} + +f! { + pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { + (cmsg as *mut ::c_uchar) + .offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) + } + + pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + _ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length + } + + pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr) + -> *mut ::cmsghdr + { + if cmsg.is_null() { + return ::CMSG_FIRSTHDR(mhdr); + }; + let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + + _ALIGN(::mem::size_of::<::cmsghdr>()); + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if next > max { + 0 as *mut ::cmsghdr + } else { + (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)) + as *mut ::cmsghdr + } + } + + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + (_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize)) + as ::c_uint + } +} + +safe_f! { + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { + status >> 8 + } + + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + (status & 0o177) != 0o177 && (status & 0o177) != 0 + } + + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { + (status & 0xff) == 0o177 + } + + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + (status & 0o177777) == 0o177777 + } +} + +extern "C" { + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; + pub fn settimeofday(tp: *const ::timeval, tz: *const ::timezone) -> ::c_int; + pub fn execvpe( + file: *const ::c_char, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + pub fn pledge(promises: *const ::c_char, execpromises: *const ::c_char) -> ::c_int; + pub fn unveil(path: *const ::c_char, permissions: *const ::c_char) -> ::c_int; + pub fn strtonum( + nptr: *const ::c_char, + minval: ::c_longlong, + maxval: ::c_longlong, + errstr: *mut *const ::c_char, + ) -> ::c_longlong; + pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int; + pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int; + pub fn chflagsat( + fd: ::c_int, + path: *const ::c_char, + flags: ::c_uint, + atflag: ::c_int, + ) -> ::c_int; + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::size_t, + serv: *mut ::c_char, + servlen: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int; + pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int; + pub fn kevent( + kq: ::c_int, + changelist: *const ::kevent, + nchanges: ::c_int, + eventlist: *mut ::kevent, + nevents: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn getthrid() -> ::pid_t; + pub fn pthread_attr_getguardsize( + attr: *const ::pthread_attr_t, + guardsize: *mut ::size_t, + ) -> ::c_int; + pub fn pthread_attr_getstack( + attr: *const ::pthread_attr_t, + stackaddr: *mut *mut ::c_void, + stacksize: *mut ::size_t, + ) -> ::c_int; + pub fn pthread_main_np() -> ::c_int; + pub fn pthread_get_name_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t); + pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char); + pub fn pthread_stackseg_np(thread: ::pthread_t, sinfo: *mut ::stack_t) -> ::c_int; + + pub fn openpty( + amaster: *mut ::c_int, + aslave: *mut ::c_int, + name: *mut ::c_char, + termp: *const ::termios, + winp: *const ::winsize, + ) -> ::c_int; + pub fn forkpty( + amaster: *mut ::c_int, + name: *mut ::c_char, + termp: *const ::termios, + winp: *const ::winsize, + ) -> ::pid_t; + + pub fn sysctl( + name: *const ::c_int, + namelen: ::c_uint, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; + pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; + pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int; + pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int; + pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: caddr_t, data: ::c_int) -> ::c_int; + pub fn utrace(label: *const ::c_char, addr: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn memmem( + haystack: *const ::c_void, + haystacklen: ::size_t, + needle: *const ::c_void, + needlelen: ::size_t, + ) -> *mut ::c_void; + // #include + pub fn dl_iterate_phdr( + callback: ::Option< + unsafe extern "C" fn( + info: *mut dl_phdr_info, + size: usize, + data: *mut ::c_void, + ) -> ::c_int, + >, + data: *mut ::c_void, + ) -> ::c_int; + pub fn uselocale(loc: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t); + pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + + // Added in `OpenBSD` 5.5 + pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t); + + pub fn setproctitle(fmt: *const ::c_char, ...); + + pub fn freezero(ptr: *mut ::c_void, size: ::size_t); + pub fn malloc_conceal(size: ::size_t) -> *mut ::c_void; + pub fn calloc_conceal(nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; + + pub fn srand48_deterministic(seed: ::c_long); + pub fn seed48_deterministic(xseed: *mut ::c_ushort) -> *mut ::c_ushort; + pub fn lcong48_deterministic(p: *mut ::c_ushort); + + pub fn lsearch( + key: *const ::c_void, + base: *mut ::c_void, + nelp: *mut ::size_t, + width: ::size_t, + compar: ::Option ::c_int>, + ) -> *mut ::c_void; + pub fn lfind( + key: *const ::c_void, + base: *const ::c_void, + nelp: *mut ::size_t, + width: ::size_t, + compar: ::Option ::c_int>, + ) -> *mut ::c_void; + pub fn hcreate(nelt: ::size_t) -> ::c_int; + pub fn hdestroy(); + pub fn hsearch(entry: ::ENTRY, action: ::ACTION) -> *mut ::ENTRY; + + // futex.h + pub fn futex( + uaddr: *mut u32, + op: ::c_int, + val: ::c_int, + timeout: *const ::timespec, + uaddr2: *mut u32, + ) -> ::c_int; +} + +#[link(name = "execinfo")] +extern "C" { + pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t; + pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char; + pub fn backtrace_symbols_fd( + addrlist: *const *mut ::c_void, + len: ::size_t, + fd: ::c_int, + ) -> ::c_int; + pub fn backtrace_symbols_fmt( + addrlist: *const *mut ::c_void, + len: ::size_t, + fmt: *const ::c_char, + ) -> *mut *mut ::c_char; +} + +cfg_if! { + if #[cfg(libc_union)] { + extern { + // these functions use statfs which uses the union mount_info: + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; + } + } +} + +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(target_arch = "arm")] { + mod arm; + pub use self::arm::*; + } else if #[cfg(target_arch = "mips64")] { + mod mips64; + pub use self::mips64::*; + } else if #[cfg(target_arch = "powerpc")] { + mod powerpc; + pub use self::powerpc::*; + } else if #[cfg(target_arch = "powerpc64")] { + mod powerpc64; + pub use self::powerpc64::*; + } else if #[cfg(target_arch = "riscv64")] { + mod riscv64; + pub use self::riscv64::*; + } else if #[cfg(target_arch = "sparc64")] { + mod sparc64; + pub use self::sparc64::*; + } else if #[cfg(target_arch = "x86")] { + mod x86; + pub use self::x86::*; + } else if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs new file mode 100644 index 0000000000000000000000000000000000000000..f1ab365d1cd1bbf546c4679bb019d32475545845 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc.rs @@ -0,0 +1,16 @@ +pub type c_long = i32; +pub type c_ulong = u32; +pub type c_char = u8; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +pub const _MAX_PAGE_SHIFT: u32 = 12; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs new file mode 100644 index 0000000000000000000000000000000000000000..99350ec8dc3d464e360e5b8cab37425905f88e3f --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs @@ -0,0 +1,16 @@ +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = u8; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +pub const _MAX_PAGE_SHIFT: u32 = 12; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs new file mode 100644 index 0000000000000000000000000000000000000000..99350ec8dc3d464e360e5b8cab37425905f88e3f --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/riscv64.rs @@ -0,0 +1,16 @@ +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = u8; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +pub const _MAX_PAGE_SHIFT: u32 = 12; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs new file mode 100644 index 0000000000000000000000000000000000000000..070fc9385f6c9fb046b4ca60102303acb3fb2153 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/sparc64.rs @@ -0,0 +1,8 @@ +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = i8; + +#[doc(hidden)] +pub const _ALIGNBYTES: usize = 0xf; + +pub const _MAX_PAGE_SHIFT: u32 = 13; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs new file mode 100644 index 0000000000000000000000000000000000000000..e87d0ff1e7d5d20bf8fe916ed95b68ecc221cb7d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86.rs @@ -0,0 +1,16 @@ +pub type c_long = i32; +pub type c_ulong = u32; +pub type c_char = i8; + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 4 - 1; + } +} + +pub const _MAX_PAGE_SHIFT: u32 = 12; diff --git a/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..60dab004456fc2801f989f223ad8778b531c257a --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/bsd/netbsdlike/openbsd/x86_64.rs @@ -0,0 +1,130 @@ +use PT_FIRSTMACH; + +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = i8; +pub type ucontext_t = sigcontext; + +s! { + pub struct sigcontext { + pub sc_rdi: ::c_long, + pub sc_rsi: ::c_long, + pub sc_rdx: ::c_long, + pub sc_rcx: ::c_long, + pub sc_r8: ::c_long, + pub sc_r9: ::c_long, + pub sc_r10: ::c_long, + pub sc_r11: ::c_long, + pub sc_r12: ::c_long, + pub sc_r13: ::c_long, + pub sc_r14: ::c_long, + pub sc_r15: ::c_long, + pub sc_rbp: ::c_long, + pub sc_rbx: ::c_long, + pub sc_rax: ::c_long, + pub sc_gs: ::c_long, + pub sc_fs: ::c_long, + pub sc_es: ::c_long, + pub sc_ds: ::c_long, + pub sc_trapno: ::c_long, + pub sc_err: ::c_long, + pub sc_rip: ::c_long, + pub sc_cs: ::c_long, + pub sc_rflags: ::c_long, + pub sc_rsp: ::c_long, + pub sc_ss: ::c_long, + pub sc_fpstate: *mut fxsave64, + __sc_unused: ::c_int, + pub sc_mask: ::c_int, + pub sc_cookie: ::c_long, + } +} + +s_no_extra_traits! { + #[repr(packed)] + pub struct fxsave64 { + pub fx_fcw: u16, + pub fx_fsw: u16, + pub fx_ftw: u8, + __fx_unused1: u8, + pub fx_fop: u16, + pub fx_rip: u64, + pub fx_rdp: u64, + pub fx_mxcsr: u32, + pub fx_mxcsr_mask: u32, + pub fx_st: [[u64; 2]; 8], + pub fx_xmm: [[u64; 2]; 16], + __fx_unused3: [u8; 96], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + // `fxsave64` is packed, so field access is unaligned. + // use {x} to create temporary storage, copy field to it, and do aligned access. + impl PartialEq for fxsave64 { + fn eq(&self, other: &fxsave64) -> bool { + return {self.fx_fcw} == {other.fx_fcw} && + {self.fx_fsw} == {other.fx_fsw} && + {self.fx_ftw} == {other.fx_ftw} && + {self.fx_fop} == {other.fx_fop} && + {self.fx_rip} == {other.fx_rip} && + {self.fx_rdp} == {other.fx_rdp} && + {self.fx_mxcsr} == {other.fx_mxcsr} && + {self.fx_mxcsr_mask} == {other.fx_mxcsr_mask} && + {self.fx_st}.iter().zip({other.fx_st}.iter()).all(|(a,b)| a == b) && + {self.fx_xmm}.iter().zip({other.fx_xmm}.iter()).all(|(a,b)| a == b) + } + } + impl Eq for fxsave64 {} + impl ::fmt::Debug for fxsave64 { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fxsave64") + .field("fx_fcw", &{self.fx_fcw}) + .field("fx_fsw", &{self.fx_fsw}) + .field("fx_ftw", &{self.fx_ftw}) + .field("fx_fop", &{self.fx_fop}) + .field("fx_rip", &{self.fx_rip}) + .field("fx_rdp", &{self.fx_rdp}) + .field("fx_mxcsr", &{self.fx_mxcsr}) + .field("fx_mxcsr_mask", &{self.fx_mxcsr_mask}) + // FIXME: .field("fx_st", &{self.fx_st}) + // FIXME: .field("fx_xmm", &{self.fx_xmm}) + .finish() + } + } + impl ::hash::Hash for fxsave64 { + fn hash(&self, state: &mut H) { + {self.fx_fcw}.hash(state); + {self.fx_fsw}.hash(state); + {self.fx_ftw}.hash(state); + {self.fx_fop}.hash(state); + {self.fx_rip}.hash(state); + {self.fx_rdp}.hash(state); + {self.fx_mxcsr}.hash(state); + {self.fx_mxcsr_mask}.hash(state); + {self.fx_st}.hash(state); + {self.fx_xmm}.hash(state); + } + } + } +} + +// should be pub(crate), but that requires Rust 1.18.0 +cfg_if! { + if #[cfg(libc_const_size_of)] { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1; + } else { + #[doc(hidden)] + pub const _ALIGNBYTES: usize = 8 - 1; + } +} + +pub const _MAX_PAGE_SHIFT: u32 = 12; + +pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0; +pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1; +pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2; +pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3; +pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4; diff --git a/bash-5.1/vendor/libc/src/unix/haiku/b32.rs b/bash-5.1/vendor/libc/src/unix/haiku/b32.rs new file mode 100644 index 0000000000000000000000000000000000000000..073ae9d4b58e2216db13496ecf72c2758c1bb5c9 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/haiku/b32.rs @@ -0,0 +1,20 @@ +pub type c_long = i32; +pub type c_ulong = u32; +pub type time_t = i32; + +pub type Elf_Addr = ::Elf32_Addr; +pub type Elf_Half = ::Elf32_Half; +pub type Elf_Phdr = ::Elf32_Phdr; + +s! { + pub struct Elf32_Phdr { + pub p_type: ::Elf32_Word, + pub p_offset: ::Elf32_Off, + pub p_vaddr: ::Elf32_Addr, + pub p_paddr: ::Elf32_Addr, + pub p_filesz: ::Elf32_Word, + pub p_memsz: ::Elf32_Word, + pub p_flags: ::Elf32_Word, + pub p_align: ::Elf32_Word, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/haiku/b64.rs b/bash-5.1/vendor/libc/src/unix/haiku/b64.rs new file mode 100644 index 0000000000000000000000000000000000000000..456918052d289ad780d974d0c73704bbdcdeb72a --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/haiku/b64.rs @@ -0,0 +1,20 @@ +pub type c_ulong = u64; +pub type c_long = i64; +pub type time_t = i64; + +pub type Elf_Addr = ::Elf64_Addr; +pub type Elf_Half = ::Elf64_Half; +pub type Elf_Phdr = ::Elf64_Phdr; + +s! { + pub struct Elf64_Phdr { + pub p_type: ::Elf64_Word, + pub p_flags: ::Elf64_Word, + pub p_offset: ::Elf64_Off, + pub p_vaddr: ::Elf64_Addr, + pub p_paddr: ::Elf64_Addr, + pub p_filesz: ::Elf64_Xword, + pub p_memsz: ::Elf64_Xword, + pub p_align: ::Elf64_Xword, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/haiku/mod.rs b/bash-5.1/vendor/libc/src/unix/haiku/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..bb2e0351bf2cbf1c0a91f3c3217b34c6c6f56e62 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/haiku/mod.rs @@ -0,0 +1,2025 @@ +pub type rlim_t = ::uintptr_t; +pub type sa_family_t = u8; +pub type pthread_key_t = ::c_int; +pub type nfds_t = ::c_ulong; +pub type tcflag_t = ::c_uint; +pub type speed_t = ::c_uchar; +pub type c_char = i8; +pub type clock_t = i32; +pub type clockid_t = i32; +pub type suseconds_t = i32; +pub type wchar_t = i32; +pub type off_t = i64; +pub type ino_t = i64; +pub type blkcnt_t = i64; +pub type blksize_t = i32; +pub type dev_t = i32; +pub type mode_t = u32; +pub type nlink_t = i32; +pub type useconds_t = u32; +pub type socklen_t = u32; +pub type pthread_t = ::uintptr_t; +pub type pthread_condattr_t = ::uintptr_t; +pub type pthread_mutexattr_t = ::uintptr_t; +pub type pthread_rwlockattr_t = ::uintptr_t; +pub type sigset_t = u64; +pub type fsblkcnt_t = i64; +pub type fsfilcnt_t = i64; +pub type pthread_attr_t = *mut ::c_void; +pub type nl_item = ::c_int; +pub type id_t = i32; +pub type idtype_t = ::c_int; +pub type fd_mask = u32; +pub type regoff_t = ::c_int; +pub type key_t = i32; +pub type msgqnum_t = u32; +pub type msglen_t = u32; + +pub type Elf32_Addr = u32; +pub type Elf32_Half = u16; +pub type Elf32_Off = u32; +pub type Elf32_Sword = i32; +pub type Elf32_Word = u32; + +pub type Elf64_Addr = u64; +pub type Elf64_Half = u16; +pub type Elf64_Off = u64; +pub type Elf64_Sword = i32; +pub type Elf64_Sxword = i64; +pub type Elf64_Word = u32; +pub type Elf64_Xword = u64; + +pub type ENTRY = entry; +pub type ACTION = ::c_int; + +pub type posix_spawnattr_t = *mut ::c_void; +pub type posix_spawn_file_actions_t = *mut ::c_void; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { + *self + } +} + +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_void { + self.si_addr + } + + pub unsafe fn si_pid(&self) -> ::pid_t { + self.si_pid + } + + pub unsafe fn si_uid(&self) -> ::uid_t { + self.si_uid + } + + pub unsafe fn si_status(&self) -> ::c_int { + self.si_status + } +} + +s! { + pub struct in_addr { + pub s_addr: ::in_addr_t, + } + + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct sockaddr { + pub sa_len: u8, + pub sa_family: sa_family_t, + pub sa_data: [u8; 30], + } + + pub struct sockaddr_in { + pub sin_len: u8, + pub sin_family: sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [i8; 24], + } + + pub struct sockaddr_in6 { + pub sin6_len: u8, + pub sin6_family: u8, + pub sin6_port: u16, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + pub ai_addrlen: socklen_t, + pub ai_canonname: *mut c_char, + pub ai_addr: *mut ::sockaddr, + pub ai_next: *mut addrinfo, + } + + pub struct ifaddrs { + pub ifa_next: *mut ifaddrs, + pub ifa_name: *const ::c_char, + pub ifa_flags: ::c_uint, + pub ifa_addr: *mut ::sockaddr, + pub ifa_netmask: *mut ::sockaddr, + pub ifa_dstaddr: *mut ::sockaddr, + pub ifa_data: *mut ::c_void, + } + + pub struct fd_set { + // size for 1024 bits, and a fd_mask with size u32 + fds_bits: [fd_mask; 32], + } + + pub struct tm { + pub tm_sec: ::c_int, + pub tm_min: ::c_int, + pub tm_hour: ::c_int, + pub tm_mday: ::c_int, + pub tm_mon: ::c_int, + pub tm_year: ::c_int, + pub tm_wday: ::c_int, + pub tm_yday: ::c_int, + pub tm_isdst: ::c_int, + pub tm_gmtoff: ::c_int, + pub tm_zone: *mut ::c_char, + } + + pub struct utsname { + pub sysname: [::c_char; 32], + pub nodename: [::c_char; 32], + pub release: [::c_char; 32], + pub version: [::c_char; 32], + pub machine: [::c_char; 32], + } + + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::c_int, + pub msg_control: *mut ::c_void, + pub msg_controllen: socklen_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: ::socklen_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *mut ::c_void, + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::c_char, + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + pub c_cc: [::cc_t; ::NCCS], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct stat { + pub st_dev: dev_t, + pub st_ino: ino_t, + pub st_mode: mode_t, + pub st_nlink: nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_size: off_t, + pub st_rdev: dev_t, + pub st_blksize: blksize_t, + pub st_atime: time_t, + pub st_atime_nsec: c_long, + pub st_mtime: time_t, + pub st_mtime_nsec: c_long, + pub st_ctime: time_t, + pub st_ctime_nsec: c_long, + pub st_crtime: time_t, + pub st_crtime_nsec: c_long, + pub st_type: u32, + pub st_blocks: blkcnt_t, + } + + pub struct glob_t { + pub gl_pathc: ::size_t, + __unused1: ::size_t, + pub gl_offs: ::size_t, + __unused2: ::size_t, + pub gl_pathv: *mut *mut c_char, + + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + __unused6: *mut ::c_void, + __unused7: *mut ::c_void, + __unused8: *mut ::c_void, + } + + pub struct pthread_mutex_t { + flags: u32, + lock: i32, + unused: i32, + owner: i32, + owner_count: i32, + } + + pub struct pthread_cond_t { + flags: u32, + unused: i32, + mutex: *mut ::c_void, + waiter_count: i32, + lock: i32, + } + + pub struct pthread_rwlock_t { + flags: u32, + owner: i32, + lock_sem: i32, // this is actually a union + lock_count: i32, + reader_count: i32, + writer_count: i32, + waiters: [*mut ::c_void; 2], + } + + pub struct pthread_spinlock_t { + lock: u32, + } + + pub struct passwd { + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char, + pub pw_gecos: *mut ::c_char, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_code: ::c_int, + pub si_errno: ::c_int, + pub si_pid: ::pid_t, + pub si_uid: ::uid_t, + pub si_addr: *mut ::c_void, + pub si_status: ::c_int, + pub si_band: c_long, + pub sigval: *mut ::c_void, + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, //actually a union with sa_handler + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + sa_userdata: *mut ::c_void, + } + + pub struct sem_t { + pub type_: i32, + pub named_sem_id: i32, // actually a union with unnamed_sem (i32) + pub padding: [i32; 2], + } + + pub struct ucred { + pub pid: ::pid_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + } + + pub struct sockaddr_dl { + pub sdl_len: u8, + pub sdl_family: u8, + pub sdl_e_type: u16, + pub sdl_index: u32, + pub sdl_type: u8, + pub sdl_nlen: u8, + pub sdl_alen: u8, + pub sdl_slen: u8, + pub sdl_data: [u8; 46], + } + + pub struct spwd { + pub sp_namp: *mut ::c_char, + pub sp_pwdp: *mut ::c_char, + pub sp_lstchg: ::c_int, + pub sp_min: ::c_int, + pub sp_max: ::c_int, + pub sp_warn: ::c_int, + pub sp_inact: ::c_int, + pub sp_expire: ::c_int, + pub sp_flag: ::c_int, + } + + pub struct regex_t { + __buffer: *mut ::c_void, + __allocated: ::size_t, + __used: ::size_t, + __syntax: ::c_ulong, + __fastmap: *mut ::c_char, + __translate: *mut ::c_char, + __re_nsub: ::size_t, + __bitfield: u8, + } + + pub struct regmatch_t { + pub rm_so: regoff_t, + pub rm_eo: regoff_t, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + pub msg_stime: ::time_t, + pub msg_rtime: ::time_t, + pub msg_ctime: ::time_t, + } + + pub struct ipc_perm { + pub key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + } + + pub struct sembuf { + pub sem_num: ::c_ushort, + pub sem_op: ::c_short, + pub sem_flg: ::c_short, + } + + pub struct entry { + pub key: *mut ::c_char, + pub data: *mut ::c_void, + } +} + +s_no_extra_traits! { + pub struct sockaddr_un { + pub sun_len: u8, + pub sun_family: sa_family_t, + pub sun_path: [::c_char; 126] + } + pub struct sockaddr_storage { + pub ss_len: u8, + pub ss_family: sa_family_t, + __ss_pad1: [u8; 6], + __ss_pad2: u64, + __ss_pad3: [u8; 112], + } + pub struct dirent { + pub d_dev: dev_t, + pub d_pdev: dev_t, + pub d_ino: ino_t, + pub d_pino: i64, + pub d_reclen: ::c_ushort, + pub d_name: [::c_char; 1024], // Max length is _POSIX_PATH_MAX + } + + pub struct sigevent { + pub sigev_notify: ::c_int, + pub sigev_signo: ::c_int, + pub sigev_value: ::sigval, + __unused1: *mut ::c_void, // actually a function pointer + pub sigev_notify_attributes: *mut ::pthread_attr_t, + } + + pub struct utmpx { + pub ut_type: ::c_short, + pub ut_tv: ::timeval, + pub ut_id: [::c_char; 8], + pub ut_pid: ::pid_t, + pub ut_user: [::c_char; 32], + pub ut_line: [::c_char; 16], + pub ut_host: [::c_char; 128], + __ut_reserved: [::c_char; 64], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for utmpx { + fn eq(&self, other: &utmpx) -> bool { + self.ut_type == other.ut_type + && self.ut_tv == other.ut_tv + && self.ut_id == other.ut_id + && self.ut_pid == other.ut_pid + && self.ut_user == other.ut_user + && self.ut_line == other.ut_line + && self.ut_host.iter().zip(other.ut_host.iter()).all(|(a,b)| a == b) + && self.__ut_reserved == other.__ut_reserved + } + } + + impl Eq for utmpx {} + + impl ::fmt::Debug for utmpx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmpx") + .field("ut_type", &self.ut_type) + .field("ut_tv", &self.ut_tv) + .field("ut_id", &self.ut_id) + .field("ut_pid", &self.ut_pid) + .field("ut_user", &self.ut_user) + .field("ut_line", &self.ut_line) + .field("ut_host", &self.ut_host) + .field("__ut_reserved", &self.__ut_reserved) + .finish() + } + } + + impl ::hash::Hash for utmpx { + fn hash(&self, state: &mut H) { + self.ut_type.hash(state); + self.ut_tv.hash(state); + self.ut_id.hash(state); + self.ut_pid.hash(state); + self.ut_user.hash(state); + self.ut_line.hash(state); + self.ut_host.hash(state); + self.__ut_reserved.hash(state); + } + } + impl PartialEq for sockaddr_un { + fn eq(&self, other: &sockaddr_un) -> bool { + self.sun_len == other.sun_len + && self.sun_family == other.sun_family + && self + .sun_path + .iter() + .zip(other.sun_path.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sockaddr_un {} + impl ::fmt::Debug for sockaddr_un { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_un") + .field("sun_len", &self.sun_len) + .field("sun_family", &self.sun_family) + // FIXME: .field("sun_path", &self.sun_path) + .finish() + } + } + impl ::hash::Hash for sockaddr_un { + fn hash(&self, state: &mut H) { + self.sun_len.hash(state); + self.sun_family.hash(state); + self.sun_path.hash(state); + } + } + + impl PartialEq for sockaddr_storage { + fn eq(&self, other: &sockaddr_storage) -> bool { + self.ss_len == other.ss_len + && self.ss_family == other.ss_family + && self + .__ss_pad1 + .iter() + .zip(other.__ss_pad1.iter()) + .all(|(a, b)| a == b) + && self.__ss_pad2 == other.__ss_pad2 + && self + .__ss_pad3 + .iter() + .zip(other.__ss_pad3.iter()) + .all(|(a, b)| a == b) + } + } + impl Eq for sockaddr_storage {} + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("ss_len", &self.ss_len) + .field("ss_family", &self.ss_family) + .field("__ss_pad1", &self.__ss_pad1) + .field("__ss_pad2", &self.__ss_pad2) + // FIXME: .field("__ss_pad3", &self.__ss_pad3) + .finish() + } + } + impl ::hash::Hash for sockaddr_storage { + fn hash(&self, state: &mut H) { + self.ss_len.hash(state); + self.ss_family.hash(state); + self.__ss_pad1.hash(state); + self.__ss_pad2.hash(state); + self.__ss_pad3.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_dev == other.d_dev + && self.d_pdev == other.d_pdev + && self.d_ino == other.d_ino + && self.d_pino == other.d_pino + && self.d_reclen == other.d_reclen + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_dev", &self.d_dev) + .field("d_pdev", &self.d_pdev) + .field("d_ino", &self.d_ino) + .field("d_pino", &self.d_pino) + .field("d_reclen", &self.d_reclen) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_dev.hash(state); + self.d_pdev.hash(state); + self.d_ino.hash(state); + self.d_pino.hash(state); + self.d_reclen.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for sigevent { + fn eq(&self, other: &sigevent) -> bool { + self.sigev_notify == other.sigev_notify + && self.sigev_signo == other.sigev_signo + && self.sigev_value == other.sigev_value + && self.sigev_notify_attributes + == other.sigev_notify_attributes + } + } + impl Eq for sigevent {} + impl ::fmt::Debug for sigevent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigevent") + .field("sigev_notify", &self.sigev_notify) + .field("sigev_signo", &self.sigev_signo) + .field("sigev_value", &self.sigev_value) + .field("sigev_notify_attributes", + &self.sigev_notify_attributes) + .finish() + } + } + impl ::hash::Hash for sigevent { + fn hash(&self, state: &mut H) { + self.sigev_notify.hash(state); + self.sigev_signo.hash(state); + self.sigev_value.hash(state); + self.sigev_notify_attributes.hash(state); + } + } + } +} + +pub const EXIT_FAILURE: ::c_int = 1; +pub const EXIT_SUCCESS: ::c_int = 0; +pub const RAND_MAX: ::c_int = 2147483647; +pub const EOF: ::c_int = -1; +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; +pub const _IOFBF: ::c_int = 0; +pub const _IONBF: ::c_int = 2; +pub const _IOLBF: ::c_int = 1; + +pub const F_DUPFD: ::c_int = 0x0001; +pub const F_GETFD: ::c_int = 0x0002; +pub const F_SETFD: ::c_int = 0x0004; +pub const F_GETFL: ::c_int = 0x0008; +pub const F_SETFL: ::c_int = 0x0010; +pub const F_GETLK: ::c_int = 0x0020; +pub const F_SETLK: ::c_int = 0x0080; +pub const F_SETLKW: ::c_int = 0x0100; +pub const F_DUPFD_CLOEXEC: ::c_int = 0x0200; + +pub const F_RDLCK: ::c_int = 0x0040; +pub const F_UNLCK: ::c_int = 0x0200; +pub const F_WRLCK: ::c_int = 0x0400; + +pub const AT_FDCWD: ::c_int = -1; +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x01; +pub const AT_SYMLINK_FOLLOW: ::c_int = 0x02; +pub const AT_REMOVEDIR: ::c_int = 0x04; +pub const AT_EACCESS: ::c_int = 0x08; + +pub const POLLIN: ::c_short = 0x0001; +pub const POLLOUT: ::c_short = 0x0002; +pub const POLLRDNORM: ::c_short = POLLIN; +pub const POLLWRNORM: ::c_short = POLLOUT; +pub const POLLRDBAND: ::c_short = 0x0008; +pub const POLLWRBAND: ::c_short = 0x0010; +pub const POLLPRI: ::c_short = 0x0020; +pub const POLLERR: ::c_short = 0x0004; +pub const POLLHUP: ::c_short = 0x0080; +pub const POLLNVAL: ::c_short = 0x1000; + +pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; +pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; + +pub const CLOCK_REALTIME: ::c_int = -1; +pub const CLOCK_MONOTONIC: ::c_int = 0; +pub const CLOCK_PROCESS_CPUTIME_ID: ::c_int = -2; +pub const CLOCK_THREAD_CPUTIME_ID: ::c_int = -3; + +pub const RLIMIT_CORE: ::c_int = 0; +pub const RLIMIT_CPU: ::c_int = 1; +pub const RLIMIT_DATA: ::c_int = 2; +pub const RLIMIT_FSIZE: ::c_int = 3; +pub const RLIMIT_NOFILE: ::c_int = 4; +pub const RLIMIT_STACK: ::c_int = 5; +pub const RLIMIT_AS: ::c_int = 6; +pub const RLIM_INFINITY: ::rlim_t = 0xffffffff; +// Haiku specific +pub const RLIMIT_NOVMON: ::c_int = 7; +pub const RLIM_NLIMITS: ::c_int = 8; + +pub const RUSAGE_SELF: ::c_int = 0; + +pub const RTLD_LAZY: ::c_int = 0; + +pub const NCCS: usize = 11; + +pub const O_RDONLY: ::c_int = 0x0000; +pub const O_WRONLY: ::c_int = 0x0001; +pub const O_RDWR: ::c_int = 0x0002; +pub const O_ACCMODE: ::c_int = 0x0003; + +pub const O_EXCL: ::c_int = 0x0100; +pub const O_CREAT: ::c_int = 0x0200; +pub const O_TRUNC: ::c_int = 0x0400; +pub const O_NOCTTY: ::c_int = 0x1000; +pub const O_NOTRAVERSE: ::c_int = 0x2000; + +pub const O_CLOEXEC: ::c_int = 0x00000040; +pub const O_NONBLOCK: ::c_int = 0x00000080; +pub const O_APPEND: ::c_int = 0x00000800; +pub const O_SYNC: ::c_int = 0x00010000; +pub const O_RSYNC: ::c_int = 0x00020000; +pub const O_DSYNC: ::c_int = 0x00040000; +pub const O_NOFOLLOW: ::c_int = 0x00080000; +pub const O_NOCACHE: ::c_int = 0x00100000; +pub const O_DIRECTORY: ::c_int = 0x00200000; + +pub const S_IFIFO: ::mode_t = 4096; +pub const S_IFCHR: ::mode_t = 8192; +pub const S_IFBLK: ::mode_t = 24576; +pub const S_IFDIR: ::mode_t = 16384; +pub const S_IFREG: ::mode_t = 32768; +pub const S_IFLNK: ::mode_t = 40960; +pub const S_IFSOCK: ::mode_t = 49152; +pub const S_IFMT: ::mode_t = 61440; + +pub const S_IRWXU: ::mode_t = 0o00700; +pub const S_IRUSR: ::mode_t = 0o00400; +pub const S_IWUSR: ::mode_t = 0o00200; +pub const S_IXUSR: ::mode_t = 0o00100; +pub const S_IRWXG: ::mode_t = 0o00070; +pub const S_IRGRP: ::mode_t = 0o00040; +pub const S_IWGRP: ::mode_t = 0o00020; +pub const S_IXGRP: ::mode_t = 0o00010; +pub const S_IRWXO: ::mode_t = 0o00007; +pub const S_IROTH: ::mode_t = 0o00004; +pub const S_IWOTH: ::mode_t = 0o00002; +pub const S_IXOTH: ::mode_t = 0o00001; + +pub const F_OK: ::c_int = 0; +pub const R_OK: ::c_int = 4; +pub const W_OK: ::c_int = 2; +pub const X_OK: ::c_int = 1; +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; + +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGCHLD: ::c_int = 5; +pub const SIGABRT: ::c_int = 6; +pub const SIGPIPE: ::c_int = 7; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGSTOP: ::c_int = 10; +pub const SIGSEGV: ::c_int = 11; +pub const SIGCONT: ::c_int = 12; +pub const SIGTSTP: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; +pub const SIGTTIN: ::c_int = 16; +pub const SIGTTOU: ::c_int = 17; +pub const SIGUSR1: ::c_int = 18; +pub const SIGUSR2: ::c_int = 19; +pub const SIGWINCH: ::c_int = 20; +pub const SIGKILLTHR: ::c_int = 21; +pub const SIGTRAP: ::c_int = 22; +pub const SIGPOLL: ::c_int = 23; +pub const SIGPROF: ::c_int = 24; +pub const SIGSYS: ::c_int = 25; +pub const SIGURG: ::c_int = 26; +pub const SIGVTALRM: ::c_int = 27; +pub const SIGXCPU: ::c_int = 28; +pub const SIGXFSZ: ::c_int = 29; +pub const SIGBUS: ::c_int = 30; + +pub const SIG_BLOCK: ::c_int = 1; +pub const SIG_UNBLOCK: ::c_int = 2; +pub const SIG_SETMASK: ::c_int = 3; + +pub const SIGEV_NONE: ::c_int = 0; +pub const SIGEV_SIGNAL: ::c_int = 1; +pub const SIGEV_THREAD: ::c_int = 2; + +pub const EAI_AGAIN: ::c_int = 2; +pub const EAI_BADFLAGS: ::c_int = 3; +pub const EAI_FAIL: ::c_int = 4; +pub const EAI_FAMILY: ::c_int = 5; +pub const EAI_MEMORY: ::c_int = 6; +pub const EAI_NODATA: ::c_int = 7; +pub const EAI_NONAME: ::c_int = 8; +pub const EAI_SERVICE: ::c_int = 9; +pub const EAI_SOCKTYPE: ::c_int = 10; +pub const EAI_SYSTEM: ::c_int = 11; +pub const EAI_OVERFLOW: ::c_int = 14; + +pub const PROT_NONE: ::c_int = 0; +pub const PROT_READ: ::c_int = 1; +pub const PROT_WRITE: ::c_int = 2; +pub const PROT_EXEC: ::c_int = 4; + +pub const LC_ALL: ::c_int = 0; +pub const LC_COLLATE: ::c_int = 1; +pub const LC_CTYPE: ::c_int = 2; +pub const LC_MONETARY: ::c_int = 3; +pub const LC_NUMERIC: ::c_int = 4; +pub const LC_TIME: ::c_int = 5; +pub const LC_MESSAGES: ::c_int = 6; + +// FIXME: Haiku does not have MAP_FILE, but libstd/os.rs requires it +pub const MAP_FILE: ::c_int = 0x00; +pub const MAP_SHARED: ::c_int = 0x01; +pub const MAP_PRIVATE: ::c_int = 0x02; +pub const MAP_FIXED: ::c_int = 0x04; +pub const MAP_ANONYMOUS: ::c_int = 0x08; +pub const MAP_NORESERVE: ::c_int = 0x10; +pub const MAP_ANON: ::c_int = MAP_ANONYMOUS; + +pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; + +pub const MS_ASYNC: ::c_int = 0x01; +pub const MS_INVALIDATE: ::c_int = 0x04; +pub const MS_SYNC: ::c_int = 0x02; + +pub const E2BIG: ::c_int = -2147454975; +pub const ECHILD: ::c_int = -2147454974; +pub const EDEADLK: ::c_int = -2147454973; +pub const EFBIG: ::c_int = -2147454972; +pub const EMLINK: ::c_int = -2147454971; +pub const ENFILE: ::c_int = -2147454970; +pub const ENODEV: ::c_int = -2147454969; +pub const ENOLCK: ::c_int = -2147454968; +pub const ENOSYS: ::c_int = -2147454967; +pub const ENOTTY: ::c_int = -2147454966; +pub const ENXIO: ::c_int = -2147454965; +pub const ESPIPE: ::c_int = -2147454964; +pub const ESRCH: ::c_int = -2147454963; +pub const EFPOS: ::c_int = -2147454962; +pub const ESIGPARM: ::c_int = -2147454961; +pub const EDOM: ::c_int = -2147454960; +pub const ERANGE: ::c_int = -2147454959; +pub const EPROTOTYPE: ::c_int = -2147454958; +pub const EPROTONOSUPPORT: ::c_int = -2147454957; +pub const EPFNOSUPPORT: ::c_int = -2147454956; +pub const EAFNOSUPPORT: ::c_int = -2147454955; +pub const EADDRINUSE: ::c_int = -2147454954; +pub const EADDRNOTAVAIL: ::c_int = -2147454953; +pub const ENETDOWN: ::c_int = -2147454952; +pub const ENETUNREACH: ::c_int = -2147454951; +pub const ENETRESET: ::c_int = -2147454950; +pub const ECONNABORTED: ::c_int = -2147454949; +pub const ECONNRESET: ::c_int = -2147454948; +pub const EISCONN: ::c_int = -2147454947; +pub const ENOTCONN: ::c_int = -2147454946; +pub const ESHUTDOWN: ::c_int = -2147454945; +pub const ECONNREFUSED: ::c_int = -2147454944; +pub const EHOSTUNREACH: ::c_int = -2147454943; +pub const ENOPROTOOPT: ::c_int = -2147454942; +pub const ENOBUFS: ::c_int = -2147454941; +pub const EINPROGRESS: ::c_int = -2147454940; +pub const EALREADY: ::c_int = -2147454939; +pub const EILSEQ: ::c_int = -2147454938; +pub const ENOMSG: ::c_int = -2147454937; +pub const ESTALE: ::c_int = -2147454936; +pub const EOVERFLOW: ::c_int = -2147454935; +pub const EMSGSIZE: ::c_int = -2147454934; +pub const EOPNOTSUPP: ::c_int = -2147454933; +pub const ENOTSOCK: ::c_int = -2147454932; +pub const EHOSTDOWN: ::c_int = -2147454931; +pub const EBADMSG: ::c_int = -2147454930; +pub const ECANCELED: ::c_int = -2147454929; +pub const EDESTADDRREQ: ::c_int = -2147454928; +pub const EDQUOT: ::c_int = -2147454927; +pub const EIDRM: ::c_int = -2147454926; +pub const EMULTIHOP: ::c_int = -2147454925; +pub const ENODATA: ::c_int = -2147454924; +pub const ENOLINK: ::c_int = -2147454923; +pub const ENOSR: ::c_int = -2147454922; +pub const ENOSTR: ::c_int = -2147454921; +pub const ENOTSUP: ::c_int = -2147454920; +pub const EPROTO: ::c_int = -2147454919; +pub const ETIME: ::c_int = -2147454918; +pub const ETXTBSY: ::c_int = -2147454917; +pub const ENOATTR: ::c_int = -2147454916; + +// INT_MIN +pub const ENOMEM: ::c_int = -2147483648; + +// POSIX errors that can be mapped to BeOS error codes +pub const EACCES: ::c_int = -2147483646; +pub const EINTR: ::c_int = -2147483638; +pub const EIO: ::c_int = -2147483647; +pub const EBUSY: ::c_int = -2147483634; +pub const EFAULT: ::c_int = -2147478783; +pub const ETIMEDOUT: ::c_int = -2147483639; +pub const EAGAIN: ::c_int = -2147483637; +pub const EWOULDBLOCK: ::c_int = -2147483637; +pub const EBADF: ::c_int = -2147459072; +pub const EEXIST: ::c_int = -2147459070; +pub const EINVAL: ::c_int = -2147483643; +pub const ENAMETOOLONG: ::c_int = -2147459068; +pub const ENOENT: ::c_int = -2147459069; +pub const EPERM: ::c_int = -2147483633; +pub const ENOTDIR: ::c_int = -2147459067; +pub const EISDIR: ::c_int = -2147459063; +pub const ENOTEMPTY: ::c_int = -2147459066; +pub const ENOSPC: ::c_int = -2147459065; +pub const EROFS: ::c_int = -2147459064; +pub const EMFILE: ::c_int = -2147459062; +pub const EXDEV: ::c_int = -2147459061; +pub const ELOOP: ::c_int = -2147459060; +pub const ENOEXEC: ::c_int = -2147478782; +pub const EPIPE: ::c_int = -2147459059; + +pub const IPPROTO_RAW: ::c_int = 255; + +// These are prefixed with POSIX_ on Haiku +pub const MADV_NORMAL: ::c_int = 1; +pub const MADV_SEQUENTIAL: ::c_int = 2; +pub const MADV_RANDOM: ::c_int = 3; +pub const MADV_WILLNEED: ::c_int = 4; +pub const MADV_DONTNEED: ::c_int = 5; +pub const MADV_FREE: ::c_int = 6; + +// https://github.com/haiku/haiku/blob/master/headers/posix/net/if.h#L80 +pub const IFF_UP: ::c_int = 0x0001; +pub const IFF_BROADCAST: ::c_int = 0x0002; // valid broadcast address +pub const IFF_LOOPBACK: ::c_int = 0x0008; +pub const IFF_POINTOPOINT: ::c_int = 0x0010; // point-to-point link +pub const IFF_NOARP: ::c_int = 0x0040; // no address resolution +pub const IFF_AUTOUP: ::c_int = 0x0080; // auto dial +pub const IFF_PROMISC: ::c_int = 0x0100; // receive all packets +pub const IFF_ALLMULTI: ::c_int = 0x0200; // receive all multicast packets +pub const IFF_SIMPLEX: ::c_int = 0x0800; // doesn't receive own transmissions +pub const IFF_LINK: ::c_int = 0x1000; // has link +pub const IFF_AUTO_CONFIGURED: ::c_int = 0x2000; +pub const IFF_CONFIGURING: ::c_int = 0x4000; +pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast + +pub const AF_UNSPEC: ::c_int = 0; +pub const AF_INET: ::c_int = 1; +pub const AF_APPLETALK: ::c_int = 2; +pub const AF_ROUTE: ::c_int = 3; +pub const AF_LINK: ::c_int = 4; +pub const AF_INET6: ::c_int = 5; +pub const AF_DLI: ::c_int = 6; +pub const AF_IPX: ::c_int = 7; +pub const AF_NOTIFY: ::c_int = 8; +pub const AF_LOCAL: ::c_int = 9; +pub const AF_UNIX: ::c_int = AF_LOCAL; +pub const AF_BLUETOOTH: ::c_int = 10; + +pub const PF_UNSPEC: ::c_int = AF_UNSPEC; +pub const PF_INET: ::c_int = AF_INET; +pub const PF_ROUTE: ::c_int = AF_ROUTE; +pub const PF_LINK: ::c_int = AF_LINK; +pub const PF_INET6: ::c_int = AF_INET6; +pub const PF_LOCAL: ::c_int = AF_LOCAL; +pub const PF_UNIX: ::c_int = AF_UNIX; +pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; + +pub const IP_OPTIONS: ::c_int = 1; +pub const IP_HDRINCL: ::c_int = 2; +pub const IP_TOS: ::c_int = 3; +pub const IP_TTL: ::c_int = 4; +pub const IP_RECVOPTS: ::c_int = 5; +pub const IP_RECVRETOPTS: ::c_int = 6; +pub const IP_RECVDSTADDR: ::c_int = 7; +pub const IP_RETOPTS: ::c_int = 8; +pub const IP_MULTICAST_IF: ::c_int = 9; +pub const IP_MULTICAST_TTL: ::c_int = 10; +pub const IP_MULTICAST_LOOP: ::c_int = 11; +pub const IP_ADD_MEMBERSHIP: ::c_int = 12; +pub const IP_DROP_MEMBERSHIP: ::c_int = 13; +pub const IP_BLOCK_SOURCE: ::c_int = 14; +pub const IP_UNBLOCK_SOURCE: ::c_int = 15; +pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 16; +pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 17; + +pub const TCP_NODELAY: ::c_int = 0x01; +pub const TCP_MAXSEG: ::c_int = 0x02; +pub const TCP_NOPUSH: ::c_int = 0x04; +pub const TCP_NOOPT: ::c_int = 0x08; + +pub const IF_NAMESIZE: ::size_t = 32; +pub const IFNAMSIZ: ::size_t = IF_NAMESIZE; + +pub const IPV6_MULTICAST_IF: ::c_int = 24; +pub const IPV6_MULTICAST_HOPS: ::c_int = 25; +pub const IPV6_MULTICAST_LOOP: ::c_int = 26; +pub const IPV6_UNICAST_HOPS: ::c_int = 27; +pub const IPV6_JOIN_GROUP: ::c_int = 28; +pub const IPV6_LEAVE_GROUP: ::c_int = 29; +pub const IPV6_V6ONLY: ::c_int = 30; +pub const IPV6_PKTINFO: ::c_int = 31; +pub const IPV6_RECVPKTINFO: ::c_int = 32; +pub const IPV6_HOPLIMIT: ::c_int = 33; +pub const IPV6_RECVHOPLIMIT: ::c_int = 34; +pub const IPV6_HOPOPTS: ::c_int = 35; +pub const IPV6_DSTOPTS: ::c_int = 36; +pub const IPV6_RTHDR: ::c_int = 37; + +pub const MSG_OOB: ::c_int = 0x0001; +pub const MSG_PEEK: ::c_int = 0x0002; +pub const MSG_DONTROUTE: ::c_int = 0x0004; +pub const MSG_EOR: ::c_int = 0x0008; +pub const MSG_TRUNC: ::c_int = 0x0010; +pub const MSG_CTRUNC: ::c_int = 0x0020; +pub const MSG_WAITALL: ::c_int = 0x0040; +pub const MSG_DONTWAIT: ::c_int = 0x0080; +pub const MSG_BCAST: ::c_int = 0x0100; +pub const MSG_MCAST: ::c_int = 0x0200; +pub const MSG_EOF: ::c_int = 0x0400; +pub const MSG_NOSIGNAL: ::c_int = 0x0800; + +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; + +pub const LOCK_SH: ::c_int = 0x01; +pub const LOCK_EX: ::c_int = 0x02; +pub const LOCK_NB: ::c_int = 0x04; +pub const LOCK_UN: ::c_int = 0x08; + +pub const MINSIGSTKSZ: ::size_t = 8192; +pub const SIGSTKSZ: ::size_t = 16384; + +pub const IOV_MAX: ::c_int = 1024; +pub const PATH_MAX: ::c_int = 1024; + +pub const SA_NOCLDSTOP: ::c_int = 0x01; +pub const SA_NOCLDWAIT: ::c_int = 0x02; +pub const SA_RESETHAND: ::c_int = 0x04; +pub const SA_NODEFER: ::c_int = 0x08; +pub const SA_RESTART: ::c_int = 0x10; +pub const SA_ONSTACK: ::c_int = 0x20; +pub const SA_SIGINFO: ::c_int = 0x40; +pub const SA_NOMASK: ::c_int = SA_NODEFER; +pub const SA_STACK: ::c_int = SA_ONSTACK; +pub const SA_ONESHOT: ::c_int = SA_RESETHAND; + +pub const SS_ONSTACK: ::c_int = 0x1; +pub const SS_DISABLE: ::c_int = 0x2; + +pub const FD_SETSIZE: usize = 1024; + +pub const RTLD_LOCAL: ::c_int = 0x0; +pub const RTLD_NOW: ::c_int = 0x1; +pub const RTLD_GLOBAL: ::c_int = 0x2; +pub const RTLD_DEFAULT: *mut ::c_void = 0isize as *mut ::c_void; + +pub const BUFSIZ: ::c_uint = 8192; +pub const FILENAME_MAX: ::c_uint = 256; +pub const FOPEN_MAX: ::c_uint = 128; +pub const L_tmpnam: ::c_uint = 512; +pub const TMP_MAX: ::c_uint = 32768; + +pub const _PC_CHOWN_RESTRICTED: ::c_int = 1; +pub const _PC_MAX_CANON: ::c_int = 2; +pub const _PC_MAX_INPUT: ::c_int = 3; +pub const _PC_NAME_MAX: ::c_int = 4; +pub const _PC_NO_TRUNC: ::c_int = 5; +pub const _PC_PATH_MAX: ::c_int = 6; +pub const _PC_PIPE_BUF: ::c_int = 7; +pub const _PC_VDISABLE: ::c_int = 8; +pub const _PC_LINK_MAX: ::c_int = 25; +pub const _PC_SYNC_IO: ::c_int = 26; +pub const _PC_ASYNC_IO: ::c_int = 27; +pub const _PC_PRIO_IO: ::c_int = 28; +pub const _PC_SOCK_MAXBUF: ::c_int = 29; +pub const _PC_FILESIZEBITS: ::c_int = 30; +pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 31; +pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 32; +pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 33; +pub const _PC_REC_XFER_ALIGN: ::c_int = 34; +pub const _PC_ALLOC_SIZE_MIN: ::c_int = 35; +pub const _PC_SYMLINK_MAX: ::c_int = 36; +pub const _PC_2_SYMLINKS: ::c_int = 37; +pub const _PC_XATTR_EXISTS: ::c_int = 38; +pub const _PC_XATTR_ENABLED: ::c_int = 39; + +pub const FIONBIO: ::c_ulong = 0xbe000000; +pub const FIONREAD: ::c_ulong = 0xbe000001; +pub const FIOSEEKDATA: ::c_ulong = 0xbe000002; +pub const FIOSEEKHOLE: ::c_ulong = 0xbe000003; + +pub const _SC_ARG_MAX: ::c_int = 15; +pub const _SC_CHILD_MAX: ::c_int = 16; +pub const _SC_CLK_TCK: ::c_int = 17; +pub const _SC_JOB_CONTROL: ::c_int = 18; +pub const _SC_NGROUPS_MAX: ::c_int = 19; +pub const _SC_OPEN_MAX: ::c_int = 20; +pub const _SC_SAVED_IDS: ::c_int = 21; +pub const _SC_STREAM_MAX: ::c_int = 22; +pub const _SC_TZNAME_MAX: ::c_int = 23; +pub const _SC_VERSION: ::c_int = 24; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 25; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 26; +pub const _SC_PAGESIZE: ::c_int = 27; +pub const _SC_PAGE_SIZE: ::c_int = 27; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 28; +pub const _SC_SEM_VALUE_MAX: ::c_int = 29; +pub const _SC_SEMAPHORES: ::c_int = 30; +pub const _SC_THREADS: ::c_int = 31; +pub const _SC_IOV_MAX: ::c_int = 32; +pub const _SC_UIO_MAXIOV: ::c_int = 32; +pub const _SC_NPROCESSORS_CONF: ::c_int = 34; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 35; +pub const _SC_ATEXIT_MAX: ::c_int = 37; +pub const _SC_PASS_MAX: ::c_int = 39; +pub const _SC_PHYS_PAGES: ::c_int = 40; +pub const _SC_AVPHYS_PAGES: ::c_int = 41; +pub const _SC_PIPE: ::c_int = 42; +pub const _SC_SELECT: ::c_int = 43; +pub const _SC_POLL: ::c_int = 44; +pub const _SC_MAPPED_FILES: ::c_int = 45; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 46; +pub const _SC_THREAD_STACK_MIN: ::c_int = 47; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 48; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 49; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 50; +pub const _SC_REALTIME_SIGNALS: ::c_int = 51; +pub const _SC_MEMORY_PROTECTION: ::c_int = 52; +pub const _SC_SIGQUEUE_MAX: ::c_int = 53; +pub const _SC_RTSIG_MAX: ::c_int = 54; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 55; +pub const _SC_DELAYTIMER_MAX: ::c_int = 56; +pub const _SC_TIMER_MAX: ::c_int = 57; +pub const _SC_TIMERS: ::c_int = 58; +pub const _SC_CPUTIME: ::c_int = 59; +pub const _SC_THREAD_CPUTIME: ::c_int = 60; +pub const _SC_HOST_NAME_MAX: ::c_int = 61; +pub const _SC_REGEXP: ::c_int = 62; +pub const _SC_SYMLOOP_MAX: ::c_int = 63; +pub const _SC_SHELL: ::c_int = 64; +pub const _SC_TTY_NAME_MAX: ::c_int = 65; + +pub const PTHREAD_STACK_MIN: ::size_t = 8192; + +pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + flags: 0, + lock: 0, + unused: -42, + owner: -1, + owner_count: 0, +}; +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + flags: 0, + unused: -42, + mutex: 0 as *mut _, + waiter_count: 0, + lock: 0, +}; +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + flags: 0, + owner: -1, + lock_sem: 0, + lock_count: 0, + reader_count: 0, + writer_count: 0, + waiters: [0 as *mut _; 2], +}; + +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = 0; +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 3; + +pub const FIOCLEX: c_ulong = 0; // FIXME: does not exist on Haiku! + +pub const RUSAGE_CHILDREN: ::c_int = -1; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_RAW: ::c_int = 3; +pub const SOCK_SEQPACKET: ::c_int = 5; + +pub const SOL_SOCKET: ::c_int = -1; +pub const SO_ACCEPTCONN: ::c_int = 0x00000001; +pub const SO_BROADCAST: ::c_int = 0x00000002; +pub const SO_DEBUG: ::c_int = 0x00000004; +pub const SO_DONTROUTE: ::c_int = 0x00000008; +pub const SO_KEEPALIVE: ::c_int = 0x00000010; +pub const SO_OOBINLINE: ::c_int = 0x00000020; +pub const SO_REUSEADDR: ::c_int = 0x00000040; +pub const SO_REUSEPORT: ::c_int = 0x00000080; +pub const SO_USELOOPBACK: ::c_int = 0x00000100; +pub const SO_LINGER: ::c_int = 0x00000200; +pub const SO_SNDBUF: ::c_int = 0x40000001; +pub const SO_SNDLOWAT: ::c_int = 0x40000002; +pub const SO_SNDTIMEO: ::c_int = 0x40000003; +pub const SO_RCVBUF: ::c_int = 0x40000004; +pub const SO_RCVLOWAT: ::c_int = 0x40000005; +pub const SO_RCVTIMEO: ::c_int = 0x40000006; +pub const SO_ERROR: ::c_int = 0x40000007; +pub const SO_TYPE: ::c_int = 0x40000008; +pub const SO_NONBLOCK: ::c_int = 0x40000009; +pub const SO_BINDTODEVICE: ::c_int = 0x4000000a; +pub const SO_PEERCRED: ::c_int = 0x4000000b; + +pub const SCM_RIGHTS: ::c_int = 0x01; + +pub const SOMAXCONN: ::c_int = 32; + +pub const NI_MAXHOST: ::size_t = 1025; + +pub const WNOHANG: ::c_int = 0x01; +pub const WUNTRACED: ::c_int = 0x02; +pub const WCONTINUED: ::c_int = 0x04; +pub const WEXITED: ::c_int = 0x08; +pub const WSTOPPED: ::c_int = 0x10; +pub const WNOWAIT: ::c_int = 0x20; + +// si_code values for SIGBUS signal +pub const BUS_ADRALN: ::c_int = 40; +pub const BUS_ADRERR: ::c_int = 41; +pub const BUS_OBJERR: ::c_int = 42; + +// si_code values for SIGCHLD signal +pub const CLD_EXITED: ::c_int = 60; +pub const CLD_KILLED: ::c_int = 61; +pub const CLD_DUMPED: ::c_int = 62; +pub const CLD_TRAPPED: ::c_int = 63; +pub const CLD_STOPPED: ::c_int = 64; +pub const CLD_CONTINUED: ::c_int = 65; + +pub const P_ALL: idtype_t = 0; +pub const P_PID: idtype_t = 1; +pub const P_PGID: idtype_t = 2; + +pub const UTIME_OMIT: c_long = 1000000001; +pub const UTIME_NOW: c_long = 1000000000; + +pub const VINTR: usize = 0; +pub const VQUIT: usize = 1; +pub const VERASE: usize = 2; +pub const VKILL: usize = 3; +pub const VEOF: usize = 4; +pub const VEOL: usize = 5; +pub const VMIN: usize = 4; +pub const VTIME: usize = 5; +pub const VEOL2: usize = 6; +pub const VSWTCH: usize = 7; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VSUSP: usize = 10; + +pub const IGNBRK: ::tcflag_t = 0x01; +pub const BRKINT: ::tcflag_t = 0x02; +pub const IGNPAR: ::tcflag_t = 0x04; +pub const PARMRK: ::tcflag_t = 0x08; +pub const INPCK: ::tcflag_t = 0x10; +pub const ISTRIP: ::tcflag_t = 0x20; +pub const INLCR: ::tcflag_t = 0x40; +pub const IGNCR: ::tcflag_t = 0x80; +pub const ICRNL: ::tcflag_t = 0x100; +pub const IUCLC: ::tcflag_t = 0x200; +pub const IXON: ::tcflag_t = 0x400; +pub const IXANY: ::tcflag_t = 0x800; +pub const IXOFF: ::tcflag_t = 0x1000; + +pub const OPOST: ::tcflag_t = 0x00000001; +pub const OLCUC: ::tcflag_t = 0x00000002; +pub const ONLCR: ::tcflag_t = 0x00000004; +pub const OCRNL: ::tcflag_t = 0x00000008; +pub const ONOCR: ::tcflag_t = 0x00000010; +pub const ONLRET: ::tcflag_t = 0x00000020; +pub const OFILL: ::tcflag_t = 0x00000040; +pub const OFDEL: ::tcflag_t = 0x00000080; +pub const NLDLY: ::tcflag_t = 0x00000100; +pub const NL0: ::tcflag_t = 0x00000000; +pub const NL1: ::tcflag_t = 0x00000100; +pub const CRDLY: ::tcflag_t = 0x00000600; +pub const CR0: ::tcflag_t = 0x00000000; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const TABDLY: ::tcflag_t = 0x00001800; +pub const TAB0: ::tcflag_t = 0x00000000; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const BSDLY: ::tcflag_t = 0x00002000; +pub const BS0: ::tcflag_t = 0x00000000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VTDLY: ::tcflag_t = 0x00004000; +pub const VT0: ::tcflag_t = 0x00000000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const FFDLY: ::tcflag_t = 0x00008000; +pub const FF0: ::tcflag_t = 0x00000000; +pub const FF1: ::tcflag_t = 0x00008000; + +pub const CSIZE: ::tcflag_t = 0x00000020; +pub const CS5: ::tcflag_t = 0x00000000; +pub const CS6: ::tcflag_t = 0x00000000; +pub const CS7: ::tcflag_t = 0x00000000; +pub const CS8: ::tcflag_t = 0x00000020; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const XLOBLK: ::tcflag_t = 0x00001000; +pub const CTSFLOW: ::tcflag_t = 0x00002000; +pub const RTSFLOW: ::tcflag_t = 0x00004000; +pub const CRTSCTS: ::tcflag_t = RTSFLOW | CTSFLOW; + +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const XCASE: ::tcflag_t = 0x00000004; +pub const ECHO: ::tcflag_t = 0x00000008; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const IEXTEN: ::tcflag_t = 0x00000200; +pub const ECHOCTL: ::tcflag_t = 0x00000400; +pub const ECHOPRT: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00001000; +pub const FLUSHO: ::tcflag_t = 0x00002000; +pub const PENDIN: ::tcflag_t = 0x00004000; + +pub const TCGB_CTS: ::c_int = 0x01; +pub const TCGB_DSR: ::c_int = 0x02; +pub const TCGB_RI: ::c_int = 0x04; +pub const TCGB_DCD: ::c_int = 0x08; +pub const TIOCM_CTS: ::c_int = TCGB_CTS; +pub const TIOCM_CD: ::c_int = TCGB_DCD; +pub const TIOCM_CAR: ::c_int = TIOCM_CD; +pub const TIOCM_RI: ::c_int = TCGB_RI; +pub const TIOCM_DSR: ::c_int = TCGB_DSR; +pub const TIOCM_DTR: ::c_int = 0x10; +pub const TIOCM_RTS: ::c_int = 0x20; + +pub const B0: speed_t = 0x00; +pub const B50: speed_t = 0x01; +pub const B75: speed_t = 0x02; +pub const B110: speed_t = 0x03; +pub const B134: speed_t = 0x04; +pub const B150: speed_t = 0x05; +pub const B200: speed_t = 0x06; +pub const B300: speed_t = 0x07; +pub const B600: speed_t = 0x08; +pub const B1200: speed_t = 0x09; +pub const B1800: speed_t = 0x0A; +pub const B2400: speed_t = 0x0B; +pub const B4800: speed_t = 0x0C; +pub const B9600: speed_t = 0x0D; +pub const B19200: speed_t = 0x0E; +pub const B38400: speed_t = 0x0F; +pub const B57600: speed_t = 0x10; +pub const B115200: speed_t = 0x11; +pub const B230400: speed_t = 0x12; +pub const B31250: speed_t = 0x13; + +pub const TCSANOW: ::c_int = 0x01; +pub const TCSADRAIN: ::c_int = 0x02; +pub const TCSAFLUSH: ::c_int = 0x04; + +pub const TCOOFF: ::c_int = 0x01; +pub const TCOON: ::c_int = 0x02; +pub const TCIOFF: ::c_int = 0x04; +pub const TCION: ::c_int = 0x08; + +pub const TCIFLUSH: ::c_int = 0x01; +pub const TCOFLUSH: ::c_int = 0x02; +pub const TCIOFLUSH: ::c_int = 0x03; + +pub const TCGETA: ::c_ulong = 0x8000; +pub const TCSETA: ::c_ulong = TCGETA + 1; +pub const TCSETAF: ::c_ulong = TCGETA + 2; +pub const TCSETAW: ::c_ulong = TCGETA + 3; +pub const TCWAITEVENT: ::c_ulong = TCGETA + 4; +pub const TCSBRK: ::c_ulong = TCGETA + 5; +pub const TCFLSH: ::c_ulong = TCGETA + 6; +pub const TCXONC: ::c_ulong = TCGETA + 7; +pub const TCQUERYCONNECTED: ::c_ulong = TCGETA + 8; +pub const TCGETBITS: ::c_ulong = TCGETA + 9; +pub const TCSETDTR: ::c_ulong = TCGETA + 10; +pub const TCSETRTS: ::c_ulong = TCGETA + 11; +pub const TIOCGWINSZ: ::c_ulong = TCGETA + 12; +pub const TIOCSWINSZ: ::c_ulong = TCGETA + 13; +pub const TCVTIME: ::c_ulong = TCGETA + 14; +pub const TIOCGPGRP: ::c_ulong = TCGETA + 15; +pub const TIOCSPGRP: ::c_ulong = TCGETA + 16; +pub const TIOCSCTTY: ::c_ulong = TCGETA + 17; +pub const TIOCMGET: ::c_ulong = TCGETA + 18; +pub const TIOCMSET: ::c_ulong = TCGETA + 19; +pub const TIOCSBRK: ::c_ulong = TCGETA + 20; +pub const TIOCCBRK: ::c_ulong = TCGETA + 21; +pub const TIOCMBIS: ::c_ulong = TCGETA + 22; +pub const TIOCMBIC: ::c_ulong = TCGETA + 23; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +// utmpx entry types +pub const EMPTY: ::c_short = 0; +pub const BOOT_TIME: ::c_short = 1; +pub const OLD_TIME: ::c_short = 2; +pub const NEW_TIME: ::c_short = 3; +pub const USER_PROCESS: ::c_short = 4; +pub const INIT_PROCESS: ::c_short = 5; +pub const LOGIN_PROCESS: ::c_short = 6; +pub const DEAD_PROCESS: ::c_short = 7; + +pub const LOG_PID: ::c_int = 1 << 12; +pub const LOG_CONS: ::c_int = 2 << 12; +pub const LOG_ODELAY: ::c_int = 4 << 12; +pub const LOG_NDELAY: ::c_int = 8 << 12; +pub const LOG_SERIAL: ::c_int = 16 << 12; +pub const LOG_PERROR: ::c_int = 32 << 12; +pub const LOG_NOWAIT: ::c_int = 64 << 12; + +// spawn.h +pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; +pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; +pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10; +pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20; +pub const POSIX_SPAWN_SETSID: ::c_int = 0x40; + +const_fn! { + {const} fn CMSG_ALIGN(len: usize) -> usize { + len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) + } +} + +f! { + pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { + if (*mhdr).msg_controllen as usize >= ::mem::size_of::() { + (*mhdr).msg_control as *mut cmsghdr + } else { + 0 as *mut cmsghdr + } + } + + pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { + (cmsg as *mut ::c_uchar) + .offset(CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) + } + + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::())) + as ::c_uint + } + + pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + CMSG_ALIGN(::mem::size_of::()) as ::c_uint + length + } + + pub fn CMSG_NXTHDR(mhdr: *const msghdr, + cmsg: *const cmsghdr) -> *mut cmsghdr { + if cmsg.is_null() { + return ::CMSG_FIRSTHDR(mhdr); + }; + let next = cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize) + + CMSG_ALIGN(::mem::size_of::<::cmsghdr>()); + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if next > max { + 0 as *mut ::cmsghdr + } else { + (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) + as *mut ::cmsghdr + } + } + + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + (*set).fds_bits[fd / size] &= !(1 << (fd % size)); + return + } + + pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0 + } + + pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + (*set).fds_bits[fd / size] |= 1 << (fd % size); + return + } + + pub fn FD_ZERO(set: *mut fd_set) -> () { + for slot in (*set).fds_bits.iter_mut() { + *slot = 0; + } + } +} + +safe_f! { + pub {const} fn WIFEXITED(status: ::c_int) -> bool { + (status & !0xff) == 0 + } + + pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int { + status & 0xff + } + + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + ((status >> 8) & 0xff) != 0 + } + + pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int { + (status >> 8) & 0xff + } + + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { + ((status >> 16) & 0xff) != 0 + } + + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { + (status >> 16) & 0xff + } + + // actually WIFCORED, but this is used everywhere else + pub {const} fn WCOREDUMP(status: ::c_int) -> bool { + (status & 0x10000) != 0 + } + + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + (status & 0x20000) != 0 + } +} + +extern "C" { + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + pub fn getpriority(which: ::c_int, who: id_t) -> ::c_int; + pub fn setpriority(which: ::c_int, who: id_t, priority: ::c_int) -> ::c_int; + + pub fn endusershell(); + pub fn getpass(prompt: *const ::c_char) -> *mut ::c_char; + pub fn getusershell() -> *mut ::c_char; + pub fn issetugid() -> ::c_int; + pub fn setusershell(); + + pub fn utimensat( + fd: ::c_int, + path: *const ::c_char, + times: *const ::timespec, + flag: ::c_int, + ) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + pub fn _errnop() -> *mut ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; + pub fn labs(i: ::c_long) -> ::c_long; + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int; + pub fn freeifaddrs(ifa: *mut ::ifaddrs); + pub fn ppoll( + fds: *mut ::pollfd, + numfds: ::nfds_t, + timeout: *const ::timespec, + sigMask: *const sigset_t, + ) -> ::c_int; + + pub fn getspent() -> *mut spwd; + pub fn getspent_r( + pwd: *mut spwd, + buf: *mut ::c_char, + bufferSize: ::size_t, + res: *mut *mut spwd, + ) -> ::c_int; + pub fn setspent(); + pub fn endspent(); + pub fn getspnam(name: *const ::c_char) -> *mut spwd; + pub fn getspnam_r( + name: *const ::c_char, + spwd: *mut spwd, + buffer: *mut ::c_char, + bufferSize: ::size_t, + res: *mut *mut spwd, + ) -> ::c_int; + pub fn sgetspent(line: *const ::c_char) -> *mut spwd; + pub fn sgetspent_r( + line: *const ::c_char, + spwd: *mut spwd, + buffer: *mut ::c_char, + bufferSize: ::size_t, + res: *mut *mut spwd, + ) -> ::c_int; + pub fn fgetspent(file: *mut ::FILE) -> *mut spwd; + pub fn fgetspent_r( + file: *mut ::FILE, + spwd: *mut spwd, + buffer: *mut ::c_char, + bufferSize: ::size_t, + res: *mut *mut spwd, + ) -> ::c_int; + pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; + pub fn mknodat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::mode_t, + dev: dev_t, + ) -> ::c_int; + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; + + pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; + pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int; + pub fn pthread_create( + thread: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + pub fn pthread_attr_getguardsize( + attr: *const ::pthread_attr_t, + guardsize: *mut ::size_t, + ) -> ::c_int; + pub fn pthread_attr_getstack( + attr: *const ::pthread_attr_t, + stackaddr: *mut *mut ::c_void, + stacksize: *mut ::size_t, + ) -> ::c_int; + pub fn pthread_condattr_getclock( + attr: *const pthread_condattr_t, + clock_id: *mut clockid_t, + ) -> ::c_int; + pub fn pthread_condattr_setclock( + attr: *mut pthread_condattr_t, + clock_id: ::clockid_t, + ) -> ::c_int; + pub fn valloc(numBytes: ::size_t) -> *mut ::c_void; + pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t; + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int; + pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int; + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::socklen_t, + serv: *mut ::c_char, + sevlen: ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + pub fn pthread_mutex_timedlock( + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) + -> ::c_int; + + pub fn glob( + pattern: *const ::c_char, + flags: ::c_int, + errfunc: ::Option ::c_int>, + pglob: *mut ::glob_t, + ) -> ::c_int; + pub fn globfree(pglob: *mut ::glob_t); + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advice: ::c_int) -> ::c_int; + pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; + + pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int; + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; + pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; + + pub fn recvfrom( + socket: ::c_int, + buf: *mut ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, + ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + + pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int; + + pub fn writev(fd: ::c_int, iov: *const ::iovec, count: ::c_int) -> ::ssize_t; + pub fn readv(fd: ::c_int, iov: *const ::iovec, count: ::c_int) -> ::ssize_t; + + pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t; + pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; + pub fn execvpe( + file: *const ::c_char, + argv: *const *const ::c_char, + environment: *const *const ::c_char, + ) -> ::c_int; + pub fn getgrgid_r( + gid: ::gid_t, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn getgrouplist( + user: *const ::c_char, + basegroup: ::gid_t, + grouplist: *mut ::gid_t, + groupcount: *mut ::c_int, + ) -> ::c_int; + pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; + pub fn getgrnam_r( + name: *const ::c_char, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn getpwnam_r( + name: *const ::c_char, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn getpwuid_r( + uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn getpwent() -> *mut passwd; + pub fn setpwent(); + pub fn endpwent(); + pub fn endgrent(); + pub fn getgrent() -> *mut ::group; + pub fn setgrent(); + pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; + pub fn pthread_atfork( + prepare: ::Option, + parent: ::Option, + child: ::Option, + ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; + pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + pub fn getutxent() -> *mut utmpx; + pub fn getutxid(ut: *const utmpx) -> *mut utmpx; + pub fn getutxline(ut: *const utmpx) -> *mut utmpx; + pub fn pututxline(ut: *const utmpx) -> *mut utmpx; + pub fn setutxent(); + pub fn endutxent(); + pub fn faccessat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::c_int, + flags: ::c_int, + ) -> ::c_int; + + pub fn sigtimedwait( + set: *const sigset_t, + info: *mut siginfo_t, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int; + + pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int; + pub fn setitimer( + which: ::c_int, + new_value: *const ::itimerval, + old_value: *mut ::itimerval, + ) -> ::c_int; + + pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int; + + pub fn regexec( + preg: *const regex_t, + input: *const ::c_char, + nmatch: ::size_t, + pmatch: *mut regmatch_t, + eflags: ::c_int, + ) -> ::c_int; + + pub fn regerror( + errcode: ::c_int, + preg: *const regex_t, + errbuf: *mut ::c_char, + errbuf_size: ::size_t, + ) -> ::size_t; + + pub fn regfree(preg: *mut regex_t); + + pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int; + pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int; + pub fn msgrcv( + msqid: ::c_int, + msgp: *mut ::c_void, + msgsz: ::size_t, + msgtype: ::c_long, + msgflg: ::c_int, + ) -> ::ssize_t; + pub fn msgsnd( + msqid: ::c_int, + msgp: *const ::c_void, + msgsz: ::size_t, + msgflg: ::c_int, + ) -> ::c_int; + pub fn semget(key: ::key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int; + pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int; + pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int; + pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t; + + pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void; + + pub fn lsearch( + key: *const ::c_void, + base: *mut ::c_void, + nelp: *mut ::size_t, + width: ::size_t, + compar: ::Option ::c_int>, + ) -> *mut ::c_void; + pub fn lfind( + key: *const ::c_void, + base: *const ::c_void, + nelp: *mut ::size_t, + width: ::size_t, + compar: ::Option ::c_int>, + ) -> *mut ::c_void; + pub fn hcreate(nelt: ::size_t) -> ::c_int; + pub fn hdestroy(); + pub fn hsearch(entry: ::ENTRY, action: ::ACTION) -> *mut ::ENTRY; + + pub fn drand48() -> ::c_double; + pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double; + pub fn lrand48() -> ::c_long; + pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long; + pub fn mrand48() -> ::c_long; + pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long; + pub fn srand48(seed: ::c_long); + pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort; + pub fn lcong48(p: *mut ::c_ushort); + + pub fn clearenv() -> ::c_int; + pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char; + + pub fn sync(); + pub fn getpagesize() -> ::c_int; + + pub fn brk(addr: *mut ::c_void) -> ::c_int; + pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void; + + pub fn posix_spawn( + pid: *mut ::pid_t, + path: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnp( + pid: *mut ::pid_t, + file: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + + pub fn posix_spawn_file_actions_init(file_actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_destroy( + file_actions: *mut posix_spawn_file_actions_t, + ) -> ::c_int; + pub fn posix_spawn_file_actions_addopen( + file_actions: *mut posix_spawn_file_actions_t, + fildes: ::c_int, + path: *const ::c_char, + oflag: ::c_int, + mode: ::mode_t, + ) -> ::c_int; + pub fn posix_spawn_file_actions_addclose( + file_actions: *mut posix_spawn_file_actions_t, + fildes: ::c_int, + ) -> ::c_int; + pub fn posix_spawn_file_actions_adddup2( + file_actions: *mut posix_spawn_file_actions_t, + fildes: ::c_int, + newfildes: ::c_int, + ) -> ::c_int; + + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_getflags( + attr: *const posix_spawnattr_t, + _flags: *mut ::c_short, + ) -> ::c_int; + pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; + pub fn posix_spawnattr_getpgroup( + attr: *const posix_spawnattr_t, + _pgroup: *mut ::pid_t, + ) -> ::c_int; + pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, pgroup: ::pid_t) -> ::c_int; + pub fn posix_spawnattr_getsigdefault( + attr: *const posix_spawnattr_t, + sigdefault: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigdefault( + attr: *mut posix_spawnattr_t, + sigdefault: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getsigmask( + attr: *const posix_spawnattr_t, + _sigmask: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigmask( + attr: *mut posix_spawnattr_t, + sigmask: *const ::sigset_t, + ) -> ::c_int; + +} + +#[link(name = "bsd")] +extern "C" { + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + pub fn forkpty( + amaster: *mut ::c_int, + name: *mut ::c_char, + termp: *mut termios, + winp: *mut ::winsize, + ) -> ::pid_t; + pub fn openpty( + amaster: *mut ::c_int, + aslave: *mut ::c_int, + name: *mut ::c_char, + termp: *mut termios, + winp: *mut ::winsize, + ) -> ::c_int; + pub fn strsep(string: *mut *mut ::c_char, delimiters: *const ::c_char) -> *mut ::c_char; + pub fn explicit_bzero(buf: *mut ::c_void, len: ::size_t); + pub fn login_tty(_fd: ::c_int) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_pointer_width = "64")] { + mod b64; + pub use self::b64::*; + } else { + mod b32; + pub use self::b32::*; + } +} + +cfg_if! { + if #[cfg(target_arch = "x86")] { + // TODO + // mod x86; + // pub use self::x86::*; + } else if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(target_arch = "aarch64")] { + // TODO + // mod aarch64; + // pub use self::aarch64::*; + } +} + +mod native; +pub use self::native::*; diff --git a/bash-5.1/vendor/libc/src/unix/haiku/native.rs b/bash-5.1/vendor/libc/src/unix/haiku/native.rs new file mode 100644 index 0000000000000000000000000000000000000000..44bcc1e3b75f44c899a001bb243fde51a2f45ed7 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/haiku/native.rs @@ -0,0 +1,1366 @@ +// This module contains bindings to the native Haiku API. The Haiku API +// originates from BeOS, and it was the original way to perform low level +// system and IO operations. The POSIX API was in that era was like a +// compatibility layer. In current Haiku development, both the POSIX API and +// the Haiku API are considered to be co-equal status. However, they are not +// integrated like they are on other UNIX platforms, which means that for many +// low level concepts there are two versions, like processes (POSIX) and +// teams (Haiku), or pthreads and native threads. +// +// Both the POSIX API and the Haiku API live in libroot.so, the library that is +// linked to any binary by default. +// +// This file follows the Haiku API for Haiku R1 beta 2. It is organized by the +// C/C++ header files in which the concepts can be found, while adhering to the +// style guide for this crate. + +// Helper macro to generate u32 constants. The Haiku API uses (non-standard) +// multi-character constants (like 'UPDA' or 'MSGM') to represent 32 bit +// integer constants. + +macro_rules! haiku_constant { + ($a:tt, $b:tt, $c:tt, $d:tt) => { + (($a as u32) << 24) + (($b as u32) << 16) + (($c as u32) << 8) + ($d as u32) + }; +} + +// support/SupportDefs.h +pub type status_t = i32; +pub type bigtime_t = i64; +pub type nanotime_t = i64; +pub type type_code = u32; +pub type perform_code = u32; + +// kernel/OS.h +pub type area_id = i32; +pub type port_id = i32; +pub type sem_id = i32; +pub type team_id = i32; +pub type thread_id = i32; + +pub type thread_func = extern "C" fn(*mut ::c_void) -> status_t; + +// kernel/image.h +pub type image_id = i32; + +e! { + // kernel/OS.h + pub enum thread_state { + B_THREAD_RUNNING = 1, + B_THREAD_READY, + B_THREAD_RECEIVING, + B_THREAD_ASLEEP, + B_THREAD_SUSPENDED, + B_THREAD_WAITING + } + + // kernel/image.h + pub enum image_type { + B_APP_IMAGE = 1, + B_LIBRARY_IMAGE, + B_ADD_ON_IMAGE, + B_SYSTEM_IMAGE + } + + // kernel/scheduler.h + + pub enum be_task_flags { + B_DEFAULT_MEDIA_PRIORITY = 0x000, + B_OFFLINE_PROCESSING = 0x001, + B_STATUS_RENDERING = 0x002, + B_USER_INPUT_HANDLING = 0x004, + B_LIVE_VIDEO_MANIPULATION = 0x008, + B_VIDEO_PLAYBACK = 0x010, + B_VIDEO_RECORDING = 0x020, + B_LIVE_AUDIO_MANIPULATION = 0x040, + B_AUDIO_PLAYBACK = 0x080, + B_AUDIO_RECORDING = 0x100, + B_LIVE_3D_RENDERING = 0x200, + B_NUMBER_CRUNCHING = 0x400, + B_MIDI_PROCESSING = 0x800, + } + + pub enum schduler_mode { + SCHEDULER_MODE_LOW_LATENCY, + SCHEDULER_MODE_POWER_SAVING, + } + + // FindDirectory.h + pub enum path_base_directory { + B_FIND_PATH_INSTALLATION_LOCATION_DIRECTORY, + B_FIND_PATH_ADD_ONS_DIRECTORY, + B_FIND_PATH_APPS_DIRECTORY, + B_FIND_PATH_BIN_DIRECTORY, + B_FIND_PATH_BOOT_DIRECTORY, + B_FIND_PATH_CACHE_DIRECTORY, + B_FIND_PATH_DATA_DIRECTORY, + B_FIND_PATH_DEVELOP_DIRECTORY, + B_FIND_PATH_DEVELOP_LIB_DIRECTORY, + B_FIND_PATH_DOCUMENTATION_DIRECTORY, + B_FIND_PATH_ETC_DIRECTORY, + B_FIND_PATH_FONTS_DIRECTORY, + B_FIND_PATH_HEADERS_DIRECTORY, + B_FIND_PATH_LIB_DIRECTORY, + B_FIND_PATH_LOG_DIRECTORY, + B_FIND_PATH_MEDIA_NODES_DIRECTORY, + B_FIND_PATH_PACKAGES_DIRECTORY, + B_FIND_PATH_PREFERENCES_DIRECTORY, + B_FIND_PATH_SERVERS_DIRECTORY, + B_FIND_PATH_SETTINGS_DIRECTORY, + B_FIND_PATH_SOUNDS_DIRECTORY, + B_FIND_PATH_SPOOL_DIRECTORY, + B_FIND_PATH_TRANSLATORS_DIRECTORY, + B_FIND_PATH_VAR_DIRECTORY, + B_FIND_PATH_IMAGE_PATH = 1000, + B_FIND_PATH_PACKAGE_PATH, + } + + pub enum directory_which { + B_DESKTOP_DIRECTORY = 0, + B_TRASH_DIRECTORY, + B_SYSTEM_DIRECTORY = 1000, + B_SYSTEM_ADDONS_DIRECTORY = 1002, + B_SYSTEM_BOOT_DIRECTORY, + B_SYSTEM_FONTS_DIRECTORY, + B_SYSTEM_LIB_DIRECTORY, + B_SYSTEM_SERVERS_DIRECTORY, + B_SYSTEM_APPS_DIRECTORY, + B_SYSTEM_BIN_DIRECTORY, + B_SYSTEM_DOCUMENTATION_DIRECTORY = 1010, + B_SYSTEM_PREFERENCES_DIRECTORY, + B_SYSTEM_TRANSLATORS_DIRECTORY, + B_SYSTEM_MEDIA_NODES_DIRECTORY, + B_SYSTEM_SOUNDS_DIRECTORY, + B_SYSTEM_DATA_DIRECTORY, + B_SYSTEM_DEVELOP_DIRECTORY, + B_SYSTEM_PACKAGES_DIRECTORY, + B_SYSTEM_HEADERS_DIRECTORY, + B_SYSTEM_ETC_DIRECTORY = 2008, + B_SYSTEM_SETTINGS_DIRECTORY = 2010, + B_SYSTEM_LOG_DIRECTORY = 2012, + B_SYSTEM_SPOOL_DIRECTORY, + B_SYSTEM_TEMP_DIRECTORY, + B_SYSTEM_VAR_DIRECTORY, + B_SYSTEM_CACHE_DIRECTORY = 2020, + B_SYSTEM_NONPACKAGED_DIRECTORY = 2023, + B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY, + B_SYSTEM_NONPACKAGED_TRANSLATORS_DIRECTORY, + B_SYSTEM_NONPACKAGED_MEDIA_NODES_DIRECTORY, + B_SYSTEM_NONPACKAGED_BIN_DIRECTORY, + B_SYSTEM_NONPACKAGED_DATA_DIRECTORY, + B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY, + B_SYSTEM_NONPACKAGED_SOUNDS_DIRECTORY, + B_SYSTEM_NONPACKAGED_DOCUMENTATION_DIRECTORY, + B_SYSTEM_NONPACKAGED_LIB_DIRECTORY, + B_SYSTEM_NONPACKAGED_HEADERS_DIRECTORY, + B_SYSTEM_NONPACKAGED_DEVELOP_DIRECTORY, + B_USER_DIRECTORY = 3000, + B_USER_CONFIG_DIRECTORY, + B_USER_ADDONS_DIRECTORY, + B_USER_BOOT_DIRECTORY, + B_USER_FONTS_DIRECTORY, + B_USER_LIB_DIRECTORY, + B_USER_SETTINGS_DIRECTORY, + B_USER_DESKBAR_DIRECTORY, + B_USER_PRINTERS_DIRECTORY, + B_USER_TRANSLATORS_DIRECTORY, + B_USER_MEDIA_NODES_DIRECTORY, + B_USER_SOUNDS_DIRECTORY, + B_USER_DATA_DIRECTORY, + B_USER_CACHE_DIRECTORY, + B_USER_PACKAGES_DIRECTORY, + B_USER_HEADERS_DIRECTORY, + B_USER_NONPACKAGED_DIRECTORY, + B_USER_NONPACKAGED_ADDONS_DIRECTORY, + B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY, + B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY, + B_USER_NONPACKAGED_BIN_DIRECTORY, + B_USER_NONPACKAGED_DATA_DIRECTORY, + B_USER_NONPACKAGED_FONTS_DIRECTORY, + B_USER_NONPACKAGED_SOUNDS_DIRECTORY, + B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY, + B_USER_NONPACKAGED_LIB_DIRECTORY, + B_USER_NONPACKAGED_HEADERS_DIRECTORY, + B_USER_NONPACKAGED_DEVELOP_DIRECTORY, + B_USER_DEVELOP_DIRECTORY, + B_USER_DOCUMENTATION_DIRECTORY, + B_USER_SERVERS_DIRECTORY, + B_USER_APPS_DIRECTORY, + B_USER_BIN_DIRECTORY, + B_USER_PREFERENCES_DIRECTORY, + B_USER_ETC_DIRECTORY, + B_USER_LOG_DIRECTORY, + B_USER_SPOOL_DIRECTORY, + B_USER_VAR_DIRECTORY, + B_APPS_DIRECTORY = 4000, + B_PREFERENCES_DIRECTORY, + B_UTILITIES_DIRECTORY, + B_PACKAGE_LINKS_DIRECTORY, + } +} + +s! { + // kernel/OS.h + pub struct area_info { + pub area: area_id, + pub name: [::c_char; B_OS_NAME_LENGTH], + pub size: usize, + pub lock: u32, + pub protection: u32, + pub team: team_id, + pub ram_size: u32, + pub copy_count: u32, + pub in_count: u32, + pub out_count: u32, + pub address: *mut ::c_void + } + + pub struct port_info { + pub port: port_id, + pub team: team_id, + pub name: [::c_char; B_OS_NAME_LENGTH], + pub capacity: i32, + pub queue_count: i32, + pub total_count: i32, + } + + pub struct port_message_info { + pub size: ::size_t, + pub sender: ::uid_t, + pub sender_group: ::gid_t, + pub sender_team: ::team_id + } + + pub struct team_info { + pub team: team_id, + pub thread_count: i32, + pub image_count: i32, + pub area_count: i32, + pub debugger_nub_thread: thread_id, + pub debugger_nub_port: port_id, + pub argc: i32, + pub args: [::c_char; 64], + pub uid: ::uid_t, + pub gid: ::gid_t + } + + pub struct sem_info { + pub sem: sem_id, + pub team: team_id, + pub name: [::c_char; B_OS_NAME_LENGTH], + pub count: i32, + pub latest_holder: thread_id + } + + pub struct team_usage_info { + pub user_time: bigtime_t, + pub kernel_time: bigtime_t + } + + pub struct thread_info { + pub thread: thread_id, + pub team: team_id, + pub name: [::c_char; B_OS_NAME_LENGTH], + pub state: thread_state, + pub priority: i32, + pub sem: sem_id, + pub user_time: bigtime_t, + pub kernel_time: bigtime_t, + pub stack_base: *mut ::c_void, + pub stack_end: *mut ::c_void + } + + pub struct cpu_info { + pub active_time: bigtime_t, + pub enabled: bool, + pub current_frequency: u64 + } + + pub struct system_info { + pub boot_time: bigtime_t, + pub cpu_count: u32, + pub max_pages: u64, + pub used_pages: u64, + pub cached_pages: u64, + pub block_cache_pages: u64, + pub ignored_pages: u64, + pub needed_memory: u64, + pub free_memory: u64, + pub max_swap_pages: u64, + pub free_swap_pages: u64, + pub page_faults: u32, + pub max_sems: u32, + pub used_sems: u32, + pub max_ports: u32, + pub used_ports: u32, + pub max_threads: u32, + pub used_threads: u32, + pub max_teams: u32, + pub used_teams: u32, + pub kernel_name: [::c_char; B_FILE_NAME_LENGTH], + pub kernel_build_date: [::c_char; B_OS_NAME_LENGTH], + pub kernel_build_time: [::c_char; B_OS_NAME_LENGTH], + pub kernel_version: i64, + pub abi: u32 + } + + pub struct object_wait_info { + pub object: i32, + pub type_: u16, + pub events: u16 + } + + // kernel/fs_attr.h + pub struct attr_info { + pub type_: u32, + pub size: ::off_t + } + + // kernel/fs_index.h + pub struct index_info { + pub type_: u32, + pub size: ::off_t, + pub modification_time: ::time_t, + pub creation_time: ::time_t, + pub uid: ::uid_t, + pub gid: ::gid_t + } + + //kernel/fs_info.h + pub struct fs_info { + pub dev: ::dev_t, + pub root: ::ino_t, + pub flags: u32, + pub block_size: ::off_t, + pub io_size: ::off_t, + pub total_blocks: ::off_t, + pub free_blocks: ::off_t, + pub total_nodes: ::off_t, + pub free_nodes: ::off_t, + pub device_name: [::c_char; 128], + pub volume_name: [::c_char; B_FILE_NAME_LENGTH], + pub fsh_name: [::c_char; B_OS_NAME_LENGTH] + } + + // kernel/image.h + pub struct image_info { + pub id: image_id, + pub image_type: ::c_int, + pub sequence: i32, + pub init_order: i32, + pub init_routine: extern "C" fn(), + pub term_routine: extern "C" fn(), + pub device: ::dev_t, + pub node: ::ino_t, + pub name: [::c_char; ::PATH_MAX as usize], + pub text: *mut ::c_void, + pub data: *mut ::c_void, + pub text_size: i32, + pub data_size: i32, + pub api_version: i32, + pub abi: i32 + } + + pub struct __c_anonymous_eax_0 { + pub max_eax: u32, + pub vendor_id: [::c_char; 12], + } + + pub struct __c_anonymous_eax_1 { + pub stepping: u32, + pub model: u32, + pub family: u32, + pub tpe: u32, + __reserved_0: u32, + pub extended_model: u32, + pub extended_family: u32, + __reserved_1: u32, + pub brand_index: u32, + pub clflush: u32, + pub logical_cpus: u32, + pub apic_id: u32, + pub features: u32, + pub extended_features: u32, + } + + pub struct __c_anonymous_eax_2 { + pub call_num: u8, + pub cache_descriptors: [u8; 15], + } + + pub struct __c_anonymous_eax_3 { + __reserved: [u32; 2], + pub serial_number_high: u32, + pub serial_number_low: u32, + } + + pub struct __c_anonymous_regs { + pub eax: u32, + pub ebx: u32, + pub edx: u32, + pub ecx: u32, + } +} + +s_no_extra_traits! { + #[cfg(libc_union)] + pub union cpuid_info { + pub eax_0: __c_anonymous_eax_0, + pub eax_1: __c_anonymous_eax_1, + pub eax_2: __c_anonymous_eax_2, + pub eax_3: __c_anonymous_eax_3, + pub as_chars: [::c_char; 16], + pub regs: __c_anonymous_regs, + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + #[cfg(libc_union)] + impl PartialEq for cpuid_info { + fn eq(&self, other: &cpuid_info) -> bool { + unsafe { + self.eax_0 == other.eax_0 + || self.eax_1 == other.eax_1 + || self.eax_2 == other.eax_2 + || self.eax_3 == other.eax_3 + || self.as_chars == other.as_chars + || self.regs == other.regs + } + } + } + #[cfg(libc_union)] + impl Eq for cpuid_info {} + #[cfg(libc_union)] + impl ::fmt::Debug for cpuid_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + unsafe { + f.debug_struct("cpuid_info") + .field("eax_0", &self.eax_0) + .field("eax_1", &self.eax_1) + .field("eax_2", &self.eax_2) + .field("eax_3", &self.eax_3) + .field("as_chars", &self.as_chars) + .field("regs", &self.regs) + .finish() + } + } + } + } +} + +// kernel/OS.h +pub const B_OS_NAME_LENGTH: usize = 32; +pub const B_PAGE_SIZE: usize = 4096; +pub const B_INFINITE_TIMEOUT: usize = 9223372036854775807; + +pub const B_RELATIVE_TIMEOUT: u32 = 0x8; +pub const B_ABSOLUTE_TIMEOUT: u32 = 0x10; +pub const B_TIMEOUT_REAL_TIME_BASE: u32 = 0x40; +pub const B_ABSOLUTE_REAL_TIME_TIMEOUT: u32 = B_ABSOLUTE_TIMEOUT | B_TIMEOUT_REAL_TIME_BASE; + +pub const B_NO_LOCK: u32 = 0; +pub const B_LAZY_LOCK: u32 = 1; +pub const B_FULL_LOCK: u32 = 2; +pub const B_CONTIGUOUS: u32 = 3; +pub const B_LOMEM: u32 = 4; +pub const B_32_BIT_FULL_LOCK: u32 = 5; +pub const B_32_BIT_CONTIGUOUS: u32 = 6; + +pub const B_ANY_ADDRESS: u32 = 0; +pub const B_EXACT_ADDRESS: u32 = 1; +pub const B_BASE_ADDRESS: u32 = 2; +pub const B_CLONE_ADDRESS: u32 = 3; +pub const B_ANY_KERNEL_ADDRESS: u32 = 4; +pub const B_RANDOMIZED_ANY_ADDRESS: u32 = 6; +pub const B_RANDOMIZED_BASE_ADDRESS: u32 = 7; + +pub const B_READ_AREA: u32 = 1 << 0; +pub const B_WRITE_AREA: u32 = 1 << 1; +pub const B_EXECUTE_AREA: u32 = 1 << 2; +pub const B_STACK_AREA: u32 = 1 << 3; +pub const B_CLONEABLE_AREA: u32 = 1 << 8; + +pub const B_CAN_INTERRUPT: u32 = 0x01; +pub const B_CHECK_PERMISSION: u32 = 0x04; +pub const B_KILL_CAN_INTERRUPT: u32 = 0x20; +pub const B_DO_NOT_RESCHEDULE: u32 = 0x02; +pub const B_RELEASE_ALL: u32 = 0x08; +pub const B_RELEASE_IF_WAITING_ONLY: u32 = 0x10; + +pub const B_CURRENT_TEAM: team_id = 0; +pub const B_SYSTEM_TEAM: team_id = 1; + +pub const B_TEAM_USAGE_SELF: i32 = 0; +pub const B_TEAM_USAGE_CHILDREN: i32 = -1; + +pub const B_IDLE_PRIORITY: i32 = 0; +pub const B_LOWEST_ACTIVE_PRIORITY: i32 = 1; +pub const B_LOW_PRIORITY: i32 = 5; +pub const B_NORMAL_PRIORITY: i32 = 10; +pub const B_DISPLAY_PRIORITY: i32 = 15; +pub const B_URGENT_DISPLAY_PRIORITY: i32 = 20; +pub const B_REAL_TIME_DISPLAY_PRIORITY: i32 = 100; +pub const B_URGENT_PRIORITY: i32 = 110; +pub const B_REAL_TIME_PRIORITY: i32 = 120; + +pub const B_SYSTEM_TIMEBASE: i32 = 0; +pub const B_FIRST_REAL_TIME_PRIORITY: i32 = B_REAL_TIME_DISPLAY_PRIORITY; + +pub const B_ONE_SHOT_ABSOLUTE_ALARM: u32 = 1; +pub const B_ONE_SHOT_RELATIVE_ALARM: u32 = 2; +pub const B_PERIODIC_ALARM: u32 = 3; + +pub const B_OBJECT_TYPE_FD: u16 = 0; +pub const B_OBJECT_TYPE_SEMAPHORE: u16 = 1; +pub const B_OBJECT_TYPE_PORT: u16 = 2; +pub const B_OBJECT_TYPE_THREAD: u16 = 3; + +pub const B_EVENT_READ: u16 = 0x0001; +pub const B_EVENT_WRITE: u16 = 0x0002; +pub const B_EVENT_ERROR: u16 = 0x0004; +pub const B_EVENT_PRIORITY_READ: u16 = 0x0008; +pub const B_EVENT_PRIORITY_WRITE: u16 = 0x0010; +pub const B_EVENT_HIGH_PRIORITY_READ: u16 = 0x0020; +pub const B_EVENT_HIGH_PRIORITY_WRITE: u16 = 0x0040; +pub const B_EVENT_DISCONNECTED: u16 = 0x0080; +pub const B_EVENT_ACQUIRE_SEMAPHORE: u16 = 0x0001; +pub const B_EVENT_INVALID: u16 = 0x1000; + +// kernel/fs_info.h +pub const B_FS_IS_READONLY: u32 = 0x00000001; +pub const B_FS_IS_REMOVABLE: u32 = 0x00000002; +pub const B_FS_IS_PERSISTENT: u32 = 0x00000004; +pub const B_FS_IS_SHARED: u32 = 0x00000008; +pub const B_FS_HAS_MIME: u32 = 0x00010000; +pub const B_FS_HAS_ATTR: u32 = 0x00020000; +pub const B_FS_HAS_QUERY: u32 = 0x00040000; +pub const B_FS_HAS_SELF_HEALING_LINKS: u32 = 0x00080000; +pub const B_FS_HAS_ALIASES: u32 = 0x00100000; +pub const B_FS_SUPPORTS_NODE_MONITORING: u32 = 0x00200000; +pub const B_FS_SUPPORTS_MONITOR_CHILDREN: u32 = 0x00400000; + +// kernel/fs_query.h +pub const B_LIVE_QUERY: u32 = 0x00000001; +pub const B_QUERY_NON_INDEXED: u32 = 0x00000002; + +// kernel/fs_volume.h +pub const B_MOUNT_READ_ONLY: u32 = 1; +pub const B_MOUNT_VIRTUAL_DEVICE: u32 = 2; +pub const B_FORCE_UNMOUNT: u32 = 1; + +// kernel/image.h +pub const B_FLUSH_DCACHE: u32 = 0x0001; +pub const B_FLUSH_ICACHE: u32 = 0x0004; +pub const B_INVALIDATE_DCACHE: u32 = 0x0002; +pub const B_INVALIDATE_ICACHE: u32 = 0x0008; + +pub const B_SYMBOL_TYPE_DATA: i32 = 0x1; +pub const B_SYMBOL_TYPE_TEXT: i32 = 0x2; +pub const B_SYMBOL_TYPE_ANY: i32 = 0x5; + +// storage/StorageDefs.h +pub const B_DEV_NAME_LENGTH: usize = 128; +pub const B_FILE_NAME_LENGTH: usize = ::FILENAME_MAX as usize; +pub const B_PATH_NAME_LENGTH: usize = ::PATH_MAX as usize; +pub const B_ATTR_NAME_LENGTH: usize = B_FILE_NAME_LENGTH - 1; +pub const B_MIME_TYPE_LENGTH: usize = B_ATTR_NAME_LENGTH - 15; +pub const B_MAX_SYMLINKS: usize = 16; + +// Haiku open modes in BFile are passed as u32 +pub const B_READ_ONLY: u32 = ::O_RDONLY as u32; +pub const B_WRITE_ONLY: u32 = ::O_WRONLY as u32; +pub const B_READ_WRITE: u32 = ::O_RDWR as u32; + +pub const B_FAIL_IF_EXISTS: u32 = ::O_EXCL as u32; +pub const B_CREATE_FILE: u32 = ::O_CREAT as u32; +pub const B_ERASE_FILE: u32 = ::O_TRUNC as u32; +pub const B_OPEN_AT_END: u32 = ::O_APPEND as u32; + +pub const B_FILE_NODE: u32 = 0x01; +pub const B_SYMLINK_NODE: u32 = 0x02; +pub const B_DIRECTORY_NODE: u32 = 0x04; +pub const B_ANY_NODE: u32 = 0x07; + +// support/Errors.h +pub const B_GENERAL_ERROR_BASE: status_t = core::i32::MIN; +pub const B_OS_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x1000; +pub const B_APP_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x2000; +pub const B_INTERFACE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x3000; +pub const B_MEDIA_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4000; +pub const B_TRANSLATION_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4800; +pub const B_MIDI_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x5000; +pub const B_STORAGE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x6000; +pub const B_POSIX_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x7000; +pub const B_MAIL_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x8000; +pub const B_PRINT_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x9000; +pub const B_DEVICE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0xa000; +pub const B_ERRORS_END: status_t = B_GENERAL_ERROR_BASE + 0xffff; + +// General errors +pub const B_NO_MEMORY: status_t = B_GENERAL_ERROR_BASE + 0; +pub const B_IO_ERROR: status_t = B_GENERAL_ERROR_BASE + 1; +pub const B_PERMISSION_DENIED: status_t = B_GENERAL_ERROR_BASE + 2; +pub const B_BAD_INDEX: status_t = B_GENERAL_ERROR_BASE + 3; +pub const B_BAD_TYPE: status_t = B_GENERAL_ERROR_BASE + 4; +pub const B_BAD_VALUE: status_t = B_GENERAL_ERROR_BASE + 5; +pub const B_MISMATCHED_VALUES: status_t = B_GENERAL_ERROR_BASE + 6; +pub const B_NAME_NOT_FOUND: status_t = B_GENERAL_ERROR_BASE + 7; +pub const B_NAME_IN_USE: status_t = B_GENERAL_ERROR_BASE + 8; +pub const B_TIMED_OUT: status_t = B_GENERAL_ERROR_BASE + 9; +pub const B_INTERRUPTED: status_t = B_GENERAL_ERROR_BASE + 10; +pub const B_WOULD_BLOCK: status_t = B_GENERAL_ERROR_BASE + 11; +pub const B_CANCELED: status_t = B_GENERAL_ERROR_BASE + 12; +pub const B_NO_INIT: status_t = B_GENERAL_ERROR_BASE + 13; +pub const B_NOT_INITIALIZED: status_t = B_GENERAL_ERROR_BASE + 13; +pub const B_BUSY: status_t = B_GENERAL_ERROR_BASE + 14; +pub const B_NOT_ALLOWED: status_t = B_GENERAL_ERROR_BASE + 15; +pub const B_BAD_DATA: status_t = B_GENERAL_ERROR_BASE + 16; +pub const B_DONT_DO_THAT: status_t = B_GENERAL_ERROR_BASE + 17; + +pub const B_ERROR: status_t = -1; +pub const B_OK: status_t = 0; +pub const B_NO_ERROR: status_t = 0; + +// Kernel kit errors +pub const B_BAD_SEM_ID: status_t = B_OS_ERROR_BASE + 0; +pub const B_NO_MORE_SEMS: status_t = B_OS_ERROR_BASE + 1; + +pub const B_BAD_THREAD_ID: status_t = B_OS_ERROR_BASE + 0x100; +pub const B_NO_MORE_THREADS: status_t = B_OS_ERROR_BASE + 0x101; +pub const B_BAD_THREAD_STATE: status_t = B_OS_ERROR_BASE + 0x102; +pub const B_BAD_TEAM_ID: status_t = B_OS_ERROR_BASE + 0x103; +pub const B_NO_MORE_TEAMS: status_t = B_OS_ERROR_BASE + 0x104; + +pub const B_BAD_PORT_ID: status_t = B_OS_ERROR_BASE + 0x200; +pub const B_NO_MORE_PORTS: status_t = B_OS_ERROR_BASE + 0x201; + +pub const B_BAD_IMAGE_ID: status_t = B_OS_ERROR_BASE + 0x300; +pub const B_BAD_ADDRESS: status_t = B_OS_ERROR_BASE + 0x301; +pub const B_NOT_AN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x302; +pub const B_MISSING_LIBRARY: status_t = B_OS_ERROR_BASE + 0x303; +pub const B_MISSING_SYMBOL: status_t = B_OS_ERROR_BASE + 0x304; +pub const B_UNKNOWN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x305; +pub const B_LEGACY_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x306; + +pub const B_DEBUGGER_ALREADY_INSTALLED: status_t = B_OS_ERROR_BASE + 0x400; + +// Application kit errors +pub const B_BAD_REPLY: status_t = B_APP_ERROR_BASE + 0; +pub const B_DUPLICATE_REPLY: status_t = B_APP_ERROR_BASE + 1; +pub const B_MESSAGE_TO_SELF: status_t = B_APP_ERROR_BASE + 2; +pub const B_BAD_HANDLER: status_t = B_APP_ERROR_BASE + 3; +pub const B_ALREADY_RUNNING: status_t = B_APP_ERROR_BASE + 4; +pub const B_LAUNCH_FAILED: status_t = B_APP_ERROR_BASE + 5; +pub const B_AMBIGUOUS_APP_LAUNCH: status_t = B_APP_ERROR_BASE + 6; +pub const B_UNKNOWN_MIME_TYPE: status_t = B_APP_ERROR_BASE + 7; +pub const B_BAD_SCRIPT_SYNTAX: status_t = B_APP_ERROR_BASE + 8; +pub const B_LAUNCH_FAILED_NO_RESOLVE_LINK: status_t = B_APP_ERROR_BASE + 9; +pub const B_LAUNCH_FAILED_EXECUTABLE: status_t = B_APP_ERROR_BASE + 10; +pub const B_LAUNCH_FAILED_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 11; +pub const B_LAUNCH_FAILED_APP_IN_TRASH: status_t = B_APP_ERROR_BASE + 12; +pub const B_LAUNCH_FAILED_NO_PREFERRED_APP: status_t = B_APP_ERROR_BASE + 13; +pub const B_LAUNCH_FAILED_FILES_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 14; +pub const B_BAD_MIME_SNIFFER_RULE: status_t = B_APP_ERROR_BASE + 15; +pub const B_NOT_A_MESSAGE: status_t = B_APP_ERROR_BASE + 16; +pub const B_SHUTDOWN_CANCELLED: status_t = B_APP_ERROR_BASE + 17; +pub const B_SHUTTING_DOWN: status_t = B_APP_ERROR_BASE + 18; + +// Storage kit errors +pub const B_FILE_ERROR: status_t = B_STORAGE_ERROR_BASE + 0; +pub const B_FILE_EXISTS: status_t = B_STORAGE_ERROR_BASE + 2; +pub const B_ENTRY_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 3; +pub const B_NAME_TOO_LONG: status_t = B_STORAGE_ERROR_BASE + 4; +pub const B_NOT_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 5; +pub const B_DIRECTORY_NOT_EMPTY: status_t = B_STORAGE_ERROR_BASE + 6; +pub const B_DEVICE_FULL: status_t = B_STORAGE_ERROR_BASE + 7; +pub const B_READ_ONLY_DEVICE: status_t = B_STORAGE_ERROR_BASE + 8; +pub const B_IS_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 9; +pub const B_NO_MORE_FDS: status_t = B_STORAGE_ERROR_BASE + 10; +pub const B_CROSS_DEVICE_LINK: status_t = B_STORAGE_ERROR_BASE + 11; +pub const B_LINK_LIMIT: status_t = B_STORAGE_ERROR_BASE + 12; +pub const B_BUSTED_PIPE: status_t = B_STORAGE_ERROR_BASE + 13; +pub const B_UNSUPPORTED: status_t = B_STORAGE_ERROR_BASE + 14; +pub const B_PARTITION_TOO_SMALL: status_t = B_STORAGE_ERROR_BASE + 15; +pub const B_PARTIAL_READ: status_t = B_STORAGE_ERROR_BASE + 16; +pub const B_PARTIAL_WRITE: status_t = B_STORAGE_ERROR_BASE + 17; + +// Mapped posix errors +pub const B_BUFFER_OVERFLOW: status_t = ::EOVERFLOW; +pub const B_TOO_MANY_ARGS: status_t = ::E2BIG; +pub const B_FILE_TOO_LARGE: status_t = ::EFBIG; +pub const B_RESULT_NOT_REPRESENTABLE: status_t = ::ERANGE; +pub const B_DEVICE_NOT_FOUND: status_t = ::ENODEV; +pub const B_NOT_SUPPORTED: status_t = ::EOPNOTSUPP; + +// Media kit errors +pub const B_STREAM_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 0; +pub const B_SERVER_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 1; +pub const B_RESOURCE_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 2; +pub const B_RESOURCE_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 3; +pub const B_BAD_SUBSCRIBER: status_t = B_MEDIA_ERROR_BASE + 4; +pub const B_SUBSCRIBER_NOT_ENTERED: status_t = B_MEDIA_ERROR_BASE + 5; +pub const B_BUFFER_NOT_AVAILABLE: status_t = B_MEDIA_ERROR_BASE + 6; +pub const B_LAST_BUFFER_ERROR: status_t = B_MEDIA_ERROR_BASE + 7; + +pub const B_MEDIA_SYSTEM_FAILURE: status_t = B_MEDIA_ERROR_BASE + 100; +pub const B_MEDIA_BAD_NODE: status_t = B_MEDIA_ERROR_BASE + 101; +pub const B_MEDIA_NODE_BUSY: status_t = B_MEDIA_ERROR_BASE + 102; +pub const B_MEDIA_BAD_FORMAT: status_t = B_MEDIA_ERROR_BASE + 103; +pub const B_MEDIA_BAD_BUFFER: status_t = B_MEDIA_ERROR_BASE + 104; +pub const B_MEDIA_TOO_MANY_NODES: status_t = B_MEDIA_ERROR_BASE + 105; +pub const B_MEDIA_TOO_MANY_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 106; +pub const B_MEDIA_NODE_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 107; +pub const B_MEDIA_BUFFER_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 108; +pub const B_MEDIA_CANNOT_SEEK: status_t = B_MEDIA_ERROR_BASE + 109; +pub const B_MEDIA_CANNOT_CHANGE_RUN_MODE: status_t = B_MEDIA_ERROR_BASE + 110; +pub const B_MEDIA_APP_ALREADY_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 111; +pub const B_MEDIA_APP_NOT_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 112; +pub const B_MEDIA_CANNOT_RECLAIM_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 113; +pub const B_MEDIA_BUFFERS_NOT_RECLAIMED: status_t = B_MEDIA_ERROR_BASE + 114; +pub const B_MEDIA_TIME_SOURCE_STOPPED: status_t = B_MEDIA_ERROR_BASE + 115; +pub const B_MEDIA_TIME_SOURCE_BUSY: status_t = B_MEDIA_ERROR_BASE + 116; +pub const B_MEDIA_BAD_SOURCE: status_t = B_MEDIA_ERROR_BASE + 117; +pub const B_MEDIA_BAD_DESTINATION: status_t = B_MEDIA_ERROR_BASE + 118; +pub const B_MEDIA_ALREADY_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 119; +pub const B_MEDIA_NOT_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 120; +pub const B_MEDIA_BAD_CLIP_FORMAT: status_t = B_MEDIA_ERROR_BASE + 121; +pub const B_MEDIA_ADDON_FAILED: status_t = B_MEDIA_ERROR_BASE + 122; +pub const B_MEDIA_ADDON_DISABLED: status_t = B_MEDIA_ERROR_BASE + 123; +pub const B_MEDIA_CHANGE_IN_PROGRESS: status_t = B_MEDIA_ERROR_BASE + 124; +pub const B_MEDIA_STALE_CHANGE_COUNT: status_t = B_MEDIA_ERROR_BASE + 125; +pub const B_MEDIA_ADDON_RESTRICTED: status_t = B_MEDIA_ERROR_BASE + 126; +pub const B_MEDIA_NO_HANDLER: status_t = B_MEDIA_ERROR_BASE + 127; +pub const B_MEDIA_DUPLICATE_FORMAT: status_t = B_MEDIA_ERROR_BASE + 128; +pub const B_MEDIA_REALTIME_DISABLED: status_t = B_MEDIA_ERROR_BASE + 129; +pub const B_MEDIA_REALTIME_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 130; + +// Mail kit errors +pub const B_MAIL_NO_DAEMON: status_t = B_MAIL_ERROR_BASE + 0; +pub const B_MAIL_UNKNOWN_USER: status_t = B_MAIL_ERROR_BASE + 1; +pub const B_MAIL_WRONG_PASSWORD: status_t = B_MAIL_ERROR_BASE + 2; +pub const B_MAIL_UNKNOWN_HOST: status_t = B_MAIL_ERROR_BASE + 3; +pub const B_MAIL_ACCESS_ERROR: status_t = B_MAIL_ERROR_BASE + 4; +pub const B_MAIL_UNKNOWN_FIELD: status_t = B_MAIL_ERROR_BASE + 5; +pub const B_MAIL_NO_RECIPIENT: status_t = B_MAIL_ERROR_BASE + 6; +pub const B_MAIL_INVALID_MAIL: status_t = B_MAIL_ERROR_BASE + 7; + +// Print kit errors +pub const B_NO_PRINT_SERVER: status_t = B_PRINT_ERROR_BASE + 0; + +// Device kit errors +pub const B_DEV_INVALID_IOCTL: status_t = B_DEVICE_ERROR_BASE + 0; +pub const B_DEV_NO_MEMORY: status_t = B_DEVICE_ERROR_BASE + 1; +pub const B_DEV_BAD_DRIVE_NUM: status_t = B_DEVICE_ERROR_BASE + 2; +pub const B_DEV_NO_MEDIA: status_t = B_DEVICE_ERROR_BASE + 3; +pub const B_DEV_UNREADABLE: status_t = B_DEVICE_ERROR_BASE + 4; +pub const B_DEV_FORMAT_ERROR: status_t = B_DEVICE_ERROR_BASE + 5; +pub const B_DEV_TIMEOUT: status_t = B_DEVICE_ERROR_BASE + 6; +pub const B_DEV_RECALIBRATE_ERROR: status_t = B_DEVICE_ERROR_BASE + 7; +pub const B_DEV_SEEK_ERROR: status_t = B_DEVICE_ERROR_BASE + 8; +pub const B_DEV_ID_ERROR: status_t = B_DEVICE_ERROR_BASE + 9; +pub const B_DEV_READ_ERROR: status_t = B_DEVICE_ERROR_BASE + 10; +pub const B_DEV_WRITE_ERROR: status_t = B_DEVICE_ERROR_BASE + 11; +pub const B_DEV_NOT_READY: status_t = B_DEVICE_ERROR_BASE + 12; +pub const B_DEV_MEDIA_CHANGED: status_t = B_DEVICE_ERROR_BASE + 13; +pub const B_DEV_MEDIA_CHANGE_REQUESTED: status_t = B_DEVICE_ERROR_BASE + 14; +pub const B_DEV_RESOURCE_CONFLICT: status_t = B_DEVICE_ERROR_BASE + 15; +pub const B_DEV_CONFIGURATION_ERROR: status_t = B_DEVICE_ERROR_BASE + 16; +pub const B_DEV_DISABLED_BY_USER: status_t = B_DEVICE_ERROR_BASE + 17; +pub const B_DEV_DOOR_OPEN: status_t = B_DEVICE_ERROR_BASE + 18; + +pub const B_DEV_INVALID_PIPE: status_t = B_DEVICE_ERROR_BASE + 19; +pub const B_DEV_CRC_ERROR: status_t = B_DEVICE_ERROR_BASE + 20; +pub const B_DEV_STALLED: status_t = B_DEVICE_ERROR_BASE + 21; +pub const B_DEV_BAD_PID: status_t = B_DEVICE_ERROR_BASE + 22; +pub const B_DEV_UNEXPECTED_PID: status_t = B_DEVICE_ERROR_BASE + 23; +pub const B_DEV_DATA_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 24; +pub const B_DEV_DATA_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 25; +pub const B_DEV_FIFO_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 26; +pub const B_DEV_FIFO_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 27; +pub const B_DEV_PENDING: status_t = B_DEVICE_ERROR_BASE + 28; +pub const B_DEV_MULTIPLE_ERRORS: status_t = B_DEVICE_ERROR_BASE + 29; +pub const B_DEV_TOO_LATE: status_t = B_DEVICE_ERROR_BASE + 30; + +// translation kit errors +pub const B_TRANSLATION_BASE_ERROR: status_t = B_TRANSLATION_ERROR_BASE + 0; +pub const B_NO_TRANSLATOR: status_t = B_TRANSLATION_ERROR_BASE + 1; +pub const B_ILLEGAL_DATA: status_t = B_TRANSLATION_ERROR_BASE + 2; + +// support/TypeConstants.h +pub const B_AFFINE_TRANSFORM_TYPE: u32 = haiku_constant!('A', 'M', 'T', 'X'); +pub const B_ALIGNMENT_TYPE: u32 = haiku_constant!('A', 'L', 'G', 'N'); +pub const B_ANY_TYPE: u32 = haiku_constant!('A', 'N', 'Y', 'T'); +pub const B_ATOM_TYPE: u32 = haiku_constant!('A', 'T', 'O', 'M'); +pub const B_ATOMREF_TYPE: u32 = haiku_constant!('A', 'T', 'M', 'R'); +pub const B_BOOL_TYPE: u32 = haiku_constant!('B', 'O', 'O', 'L'); +pub const B_CHAR_TYPE: u32 = haiku_constant!('C', 'H', 'A', 'R'); +pub const B_COLOR_8_BIT_TYPE: u32 = haiku_constant!('C', 'L', 'R', 'B'); +pub const B_DOUBLE_TYPE: u32 = haiku_constant!('D', 'B', 'L', 'E'); +pub const B_FLOAT_TYPE: u32 = haiku_constant!('F', 'L', 'O', 'T'); +pub const B_GRAYSCALE_8_BIT_TYPE: u32 = haiku_constant!('G', 'R', 'Y', 'B'); +pub const B_INT16_TYPE: u32 = haiku_constant!('S', 'H', 'R', 'T'); +pub const B_INT32_TYPE: u32 = haiku_constant!('L', 'O', 'N', 'G'); +pub const B_INT64_TYPE: u32 = haiku_constant!('L', 'L', 'N', 'G'); +pub const B_INT8_TYPE: u32 = haiku_constant!('B', 'Y', 'T', 'E'); +pub const B_LARGE_ICON_TYPE: u32 = haiku_constant!('I', 'C', 'O', 'N'); +pub const B_MEDIA_PARAMETER_GROUP_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'G'); +pub const B_MEDIA_PARAMETER_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'T'); +pub const B_MEDIA_PARAMETER_WEB_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'W'); +pub const B_MESSAGE_TYPE: u32 = haiku_constant!('M', 'S', 'G', 'G'); +pub const B_MESSENGER_TYPE: u32 = haiku_constant!('M', 'S', 'N', 'G'); +pub const B_MIME_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'E'); +pub const B_MINI_ICON_TYPE: u32 = haiku_constant!('M', 'I', 'C', 'N'); +pub const B_MONOCHROME_1_BIT_TYPE: u32 = haiku_constant!('M', 'N', 'O', 'B'); +pub const B_OBJECT_TYPE: u32 = haiku_constant!('O', 'P', 'T', 'R'); +pub const B_OFF_T_TYPE: u32 = haiku_constant!('O', 'F', 'F', 'T'); +pub const B_PATTERN_TYPE: u32 = haiku_constant!('P', 'A', 'T', 'N'); +pub const B_POINTER_TYPE: u32 = haiku_constant!('P', 'N', 'T', 'R'); +pub const B_POINT_TYPE: u32 = haiku_constant!('B', 'P', 'N', 'T'); +pub const B_PROPERTY_INFO_TYPE: u32 = haiku_constant!('S', 'C', 'T', 'D'); +pub const B_RAW_TYPE: u32 = haiku_constant!('R', 'A', 'W', 'T'); +pub const B_RECT_TYPE: u32 = haiku_constant!('R', 'E', 'C', 'T'); +pub const B_REF_TYPE: u32 = haiku_constant!('R', 'R', 'E', 'F'); +pub const B_RGB_32_BIT_TYPE: u32 = haiku_constant!('R', 'G', 'B', 'B'); +pub const B_RGB_COLOR_TYPE: u32 = haiku_constant!('R', 'G', 'B', 'C'); +pub const B_SIZE_TYPE: u32 = haiku_constant!('S', 'I', 'Z', 'E'); +pub const B_SIZE_T_TYPE: u32 = haiku_constant!('S', 'I', 'Z', 'T'); +pub const B_SSIZE_T_TYPE: u32 = haiku_constant!('S', 'S', 'Z', 'T'); +pub const B_STRING_TYPE: u32 = haiku_constant!('C', 'S', 'T', 'R'); +pub const B_STRING_LIST_TYPE: u32 = haiku_constant!('S', 'T', 'R', 'L'); +pub const B_TIME_TYPE: u32 = haiku_constant!('T', 'I', 'M', 'E'); +pub const B_UINT16_TYPE: u32 = haiku_constant!('U', 'S', 'H', 'T'); +pub const B_UINT32_TYPE: u32 = haiku_constant!('U', 'L', 'N', 'G'); +pub const B_UINT64_TYPE: u32 = haiku_constant!('U', 'L', 'L', 'G'); +pub const B_UINT8_TYPE: u32 = haiku_constant!('U', 'B', 'Y', 'T'); +pub const B_VECTOR_ICON_TYPE: u32 = haiku_constant!('V', 'I', 'C', 'N'); +pub const B_XATTR_TYPE: u32 = haiku_constant!('X', 'A', 'T', 'R'); +pub const B_NETWORK_ADDRESS_TYPE: u32 = haiku_constant!('N', 'W', 'A', 'D'); +pub const B_MIME_STRING_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'S'); +pub const B_ASCII_TYPE: u32 = haiku_constant!('T', 'E', 'X', 'T'); + +extern "C" { + // kernel/OS.h + pub fn create_area( + name: *const ::c_char, + startAddress: *mut *mut ::c_void, + addressSpec: u32, + size: usize, + lock: u32, + protection: u32, + ) -> area_id; + pub fn clone_area( + name: *const ::c_char, + destAddress: *mut *mut ::c_void, + addressSpec: u32, + protection: u32, + source: area_id, + ) -> area_id; + pub fn find_area(name: *const ::c_char) -> area_id; + pub fn area_for(address: *mut ::c_void) -> area_id; + pub fn delete_area(id: area_id) -> status_t; + pub fn resize_area(id: area_id, newSize: usize) -> status_t; + pub fn set_area_protection(id: area_id, newProtection: u32) -> status_t; + pub fn _get_area_info(id: area_id, areaInfo: *mut area_info, size: usize) -> status_t; + pub fn _get_next_area_info( + team: team_id, + cookie: *mut isize, + areaInfo: *mut area_info, + size: usize, + ) -> status_t; + + pub fn create_port(capacity: i32, name: *const ::c_char) -> port_id; + pub fn find_port(name: *const ::c_char) -> port_id; + pub fn read_port( + port: port_id, + code: *mut i32, + buffer: *mut ::c_void, + bufferSize: ::size_t, + ) -> ::ssize_t; + pub fn read_port_etc( + port: port_id, + code: *mut i32, + buffer: *mut ::c_void, + bufferSize: ::size_t, + flags: u32, + timeout: bigtime_t, + ) -> ::ssize_t; + pub fn write_port( + port: port_id, + code: i32, + buffer: *const ::c_void, + bufferSize: ::size_t, + ) -> status_t; + pub fn write_port_etc( + port: port_id, + code: i32, + buffer: *const ::c_void, + bufferSize: ::size_t, + flags: u32, + timeout: bigtime_t, + ) -> status_t; + pub fn close_port(port: port_id) -> status_t; + pub fn delete_port(port: port_id) -> status_t; + pub fn port_buffer_size(port: port_id) -> ::ssize_t; + pub fn port_buffer_size_etc(port: port_id, flags: u32, timeout: bigtime_t) -> ::ssize_t; + pub fn port_count(port: port_id) -> ::ssize_t; + pub fn set_port_owner(port: port_id, team: team_id) -> status_t; + + pub fn _get_port_info(port: port_id, buf: *mut port_info, portInfoSize: ::size_t) -> status_t; + pub fn _get_next_port_info( + port: port_id, + cookie: *mut i32, + portInfo: *mut port_info, + portInfoSize: ::size_t, + ) -> status_t; + pub fn _get_port_message_info_etc( + port: port_id, + info: *mut port_message_info, + infoSize: ::size_t, + flags: u32, + timeout: bigtime_t, + ) -> status_t; + + pub fn create_sem(count: i32, name: *const ::c_char) -> sem_id; + pub fn delete_sem(id: sem_id) -> status_t; + pub fn acquire_sem(id: sem_id) -> status_t; + pub fn acquire_sem_etc(id: sem_id, count: i32, flags: u32, timeout: bigtime_t) -> status_t; + pub fn release_sem(id: sem_id) -> status_t; + pub fn release_sem_etc(id: sem_id, count: i32, flags: u32) -> status_t; + pub fn switch_sem(semToBeReleased: sem_id, id: sem_id) -> status_t; + pub fn switch_sem_etc( + semToBeReleased: sem_id, + id: sem_id, + count: i32, + flags: u32, + timeout: bigtime_t, + ) -> status_t; + pub fn get_sem_count(id: sem_id, threadCount: *mut i32) -> status_t; + pub fn set_sem_owner(id: sem_id, team: team_id) -> status_t; + pub fn _get_sem_info(id: sem_id, info: *mut sem_info, infoSize: ::size_t) -> status_t; + pub fn _get_next_sem_info( + team: team_id, + cookie: *mut i32, + info: *mut sem_info, + infoSize: ::size_t, + ) -> status_t; + + pub fn kill_team(team: team_id) -> status_t; + pub fn _get_team_info(team: team_id, info: *mut team_info, size: ::size_t) -> status_t; + pub fn _get_next_team_info(cookie: *mut i32, info: *mut team_info, size: ::size_t) -> status_t; + + pub fn spawn_thread( + func: thread_func, + name: *const ::c_char, + priority: i32, + data: *mut ::c_void, + ) -> thread_id; + pub fn kill_thread(thread: thread_id) -> status_t; + pub fn resume_thread(thread: thread_id) -> status_t; + pub fn suspend_thread(thread: thread_id) -> status_t; + + pub fn rename_thread(thread: thread_id, newName: *const ::c_char) -> status_t; + pub fn set_thread_priority(thread: thread_id, newPriority: i32) -> status_t; + pub fn suggest_thread_priority( + what: u32, + period: i32, + jitter: ::bigtime_t, + length: ::bigtime_t, + ) -> i32; + pub fn estimate_max_scheduling_latency(th: ::thread_id) -> ::bigtime_t; + pub fn exit_thread(status: status_t); + pub fn wait_for_thread(thread: thread_id, returnValue: *mut status_t) -> status_t; + pub fn on_exit_thread(callback: extern "C" fn(*mut ::c_void), data: *mut ::c_void) -> status_t; + + pub fn find_thread(name: *const ::c_char) -> thread_id; + + pub fn get_scheduler_mode() -> i32; + pub fn set_scheduler_mode(mode: i32) -> status_t; + + pub fn send_data( + thread: thread_id, + code: i32, + buffer: *const ::c_void, + bufferSize: ::size_t, + ) -> status_t; + pub fn receive_data(sender: *mut thread_id, buffer: *mut ::c_void, bufferSize: ::size_t) + -> i32; + pub fn has_data(thread: thread_id) -> bool; + + pub fn snooze(amount: bigtime_t) -> status_t; + pub fn snooze_etc(amount: bigtime_t, timeBase: ::c_int, flags: u32) -> status_t; + pub fn snooze_until(time: bigtime_t, timeBase: ::c_int) -> status_t; + + pub fn _get_thread_info(id: thread_id, info: *mut thread_info, size: ::size_t) -> status_t; + pub fn _get_next_thread_info( + team: team_id, + cookie: *mut i32, + info: *mut thread_info, + size: ::size_t, + ) -> status_t; + + pub fn get_pthread_thread_id(thread: ::pthread_t) -> thread_id; + + pub fn _get_team_usage_info( + team: team_id, + who: i32, + info: *mut team_usage_info, + size: ::size_t, + ) -> status_t; + + pub fn real_time_clock() -> ::c_ulong; + pub fn set_real_time_clock(secsSinceJan1st1970: ::c_ulong); + pub fn real_time_clock_usecs() -> bigtime_t; + pub fn system_time() -> bigtime_t; + pub fn system_time_nsecs() -> nanotime_t; + // set_timezone() is deprecated and a no-op + + pub fn set_alarm(when: bigtime_t, flags: u32) -> bigtime_t; + pub fn debugger(message: *const ::c_char); + pub fn disable_debugger(state: ::c_int) -> ::c_int; + + pub fn get_system_info(info: *mut system_info) -> status_t; + pub fn _get_cpu_info_etc( + firstCPU: u32, + cpuCount: u32, + info: *mut cpu_info, + size: ::size_t, + ) -> status_t; + pub fn is_computer_on() -> i32; + pub fn is_computer_on_fire() -> ::c_double; + pub fn send_signal(threadID: thread_id, signal: ::c_uint) -> ::c_int; + pub fn set_signal_stack(base: *mut ::c_void, size: ::size_t); + + pub fn wait_for_objects(infos: *mut object_wait_info, numInfos: ::c_int) -> ::ssize_t; + pub fn wait_for_objects_etc( + infos: *mut object_wait_info, + numInfos: ::c_int, + flags: u32, + timeout: bigtime_t, + ) -> ::ssize_t; + + // kernel/fs_attr.h + pub fn fs_read_attr( + fd: ::c_int, + attribute: *const ::c_char, + type_: u32, + pos: ::off_t, + buffer: *mut ::c_void, + readBytes: ::size_t, + ) -> ::ssize_t; + pub fn fs_write_attr( + fd: ::c_int, + attribute: *const ::c_char, + type_: u32, + pos: ::off_t, + buffer: *const ::c_void, + writeBytes: ::size_t, + ) -> ::ssize_t; + pub fn fs_remove_attr(fd: ::c_int, attribute: *const ::c_char) -> ::c_int; + pub fn fs_stat_attr( + fd: ::c_int, + attribute: *const ::c_char, + attrInfo: *mut attr_info, + ) -> ::c_int; + + pub fn fs_open_attr( + path: *const ::c_char, + attribute: *const ::c_char, + type_: u32, + openMode: ::c_int, + ) -> ::c_int; + pub fn fs_fopen_attr( + fd: ::c_int, + attribute: *const ::c_char, + type_: u32, + openMode: ::c_int, + ) -> ::c_int; + pub fn fs_close_attr(fd: ::c_int) -> ::c_int; + + pub fn fs_open_attr_dir(path: *const ::c_char) -> *mut ::DIR; + pub fn fs_lopen_attr_dir(path: *const ::c_char) -> *mut ::DIR; + pub fn fs_fopen_attr_dir(fd: ::c_int) -> *mut ::DIR; + pub fn fs_close_attr_dir(dir: *mut ::DIR) -> ::c_int; + pub fn fs_read_attr_dir(dir: *mut ::DIR) -> *mut ::dirent; + pub fn fs_rewind_attr_dir(dir: *mut ::DIR); + + // kernel/fs_image.h + pub fn fs_create_index( + device: ::dev_t, + name: *const ::c_char, + type_: u32, + flags: u32, + ) -> ::c_int; + pub fn fs_remove_index(device: ::dev_t, name: *const ::c_char) -> ::c_int; + pub fn fs_stat_index( + device: ::dev_t, + name: *const ::c_char, + indexInfo: *mut index_info, + ) -> ::c_int; + + pub fn fs_open_index_dir(device: ::dev_t) -> *mut ::DIR; + pub fn fs_close_index_dir(indexDirectory: *mut ::DIR) -> ::c_int; + pub fn fs_read_index_dir(indexDirectory: *mut ::DIR) -> *mut ::dirent; + pub fn fs_rewind_index_dir(indexDirectory: *mut ::DIR); + + // kernel/fs_info.h + pub fn dev_for_path(path: *const ::c_char) -> ::dev_t; + pub fn next_dev(pos: *mut i32) -> ::dev_t; + pub fn fs_stat_dev(dev: ::dev_t, info: *mut fs_info) -> ::c_int; + + // kernel/fs_query.h + pub fn fs_open_query(device: ::dev_t, query: *const ::c_char, flags: u32) -> *mut ::DIR; + pub fn fs_open_live_query( + device: ::dev_t, + query: *const ::c_char, + flags: u32, + port: port_id, + token: i32, + ) -> *mut ::DIR; + pub fn fs_close_query(d: *mut ::DIR) -> ::c_int; + pub fn fs_read_query(d: *mut ::DIR) -> *mut ::dirent; + pub fn get_path_for_dirent(dent: *mut ::dirent, buf: *mut ::c_char, len: ::size_t) -> status_t; + + // kernel/fs_volume.h + pub fn fs_mount_volume( + where_: *const ::c_char, + device: *const ::c_char, + filesystem: *const ::c_char, + flags: u32, + parameters: *const ::c_char, + ) -> ::dev_t; + pub fn fs_unmount_volume(path: *const ::c_char, flags: u32) -> status_t; + + // kernel/image.h + pub fn load_image( + argc: i32, + argv: *mut *const ::c_char, + environ: *mut *const ::c_char, + ) -> thread_id; + pub fn load_add_on(path: *const ::c_char) -> image_id; + pub fn unload_add_on(image: image_id) -> status_t; + pub fn get_image_symbol( + image: image_id, + name: *const ::c_char, + symbolType: i32, + symbolLocation: *mut *mut ::c_void, + ) -> status_t; + pub fn get_nth_image_symbol( + image: image_id, + n: i32, + nameBuffer: *mut ::c_char, + nameLength: *mut i32, + symbolType: *mut i32, + symbolLocation: *mut *mut ::c_void, + ) -> status_t; + pub fn clear_caches(address: *mut ::c_void, length: ::size_t, flags: u32); + pub fn _get_image_info(image: image_id, info: *mut image_info, size: ::size_t) -> status_t; + pub fn _get_next_image_info( + team: team_id, + cookie: *mut i32, + info: *mut image_info, + size: ::size_t, + ) -> status_t; + pub fn find_path( + codePointer: *const ::c_void, + baseDirectory: path_base_directory, + subPath: *const ::c_char, + pathBuffer: *mut ::c_char, + bufferSize: usize, + ) -> status_t; + pub fn find_path_etc( + codePointer: *const ::c_void, + dependency: *const ::c_char, + architecture: *const ::c_char, + baseDirectory: path_base_directory, + subPath: *const ::c_char, + flags: u32, + pathBuffer: *mut ::c_char, + bufferSize: ::size_t, + ) -> status_t; + pub fn find_path_for_path( + path: *const ::c_char, + baseDirectory: path_base_directory, + subPath: *const ::c_char, + pathBuffer: *mut ::c_char, + bufferSize: ::size_t, + ) -> status_t; + pub fn find_path_for_path_etc( + path: *const ::c_char, + dependency: *const ::c_char, + architectur: *const ::c_char, + baseDirectory: path_base_directory, + subPath: *const ::c_char, + flags: u32, + pathBuffer: *mut ::c_char, + bufferSize: ::size_t, + ) -> status_t; + pub fn find_paths( + baseDirectory: path_base_directory, + subPath: *const ::c_char, + _paths: *mut *mut *mut ::c_char, + pathCount: *mut ::size_t, + ) -> status_t; + pub fn find_paths_etc( + architecture: *const ::c_char, + baseDirectory: path_base_directory, + subPath: *const ::c_char, + flags: u32, + _paths: *mut *mut *mut ::c_char, + pathCount: *mut ::size_t, + ) -> status_t; + pub fn find_directory( + which: directory_which, + volume: ::dev_t, + createIt: bool, + pathString: *mut ::c_char, + length: i32, + ) -> status_t; +} + +cfg_if! { + if #[cfg(libc_union)] { + extern "C" { + pub fn get_cpuid(info: *mut cpuid_info, eaxRegister: u32, cpuNum: u32) -> status_t; + } + } +} + +// The following functions are defined as macros in C/C++ +#[inline] +pub unsafe fn get_cpu_info(firstCPU: u32, cpuCount: u32, info: *mut cpu_info) -> status_t { + _get_cpu_info_etc( + firstCPU, + cpuCount, + info, + core::mem::size_of::() as ::size_t, + ) +} + +#[inline] +pub unsafe fn get_area_info(id: area_id, info: *mut area_info) -> status_t { + _get_area_info(id, info, core::mem::size_of::() as usize) +} + +#[inline] +pub unsafe fn get_next_area_info( + team: team_id, + cookie: *mut isize, + info: *mut area_info, +) -> status_t { + _get_next_area_info( + team, + cookie, + info, + core::mem::size_of::() as usize, + ) +} + +#[inline] +pub unsafe fn get_port_info(port: port_id, buf: *mut port_info) -> status_t { + _get_port_info(port, buf, core::mem::size_of::() as ::size_t) +} + +#[inline] +pub unsafe fn get_next_port_info( + port: port_id, + cookie: *mut i32, + portInfo: *mut port_info, +) -> status_t { + _get_next_port_info( + port, + cookie, + portInfo, + core::mem::size_of::() as ::size_t, + ) +} + +#[inline] +pub unsafe fn get_port_message_info_etc( + port: port_id, + info: *mut port_message_info, + flags: u32, + timeout: bigtime_t, +) -> status_t { + _get_port_message_info_etc( + port, + info, + core::mem::size_of::() as ::size_t, + flags, + timeout, + ) +} + +#[inline] +pub unsafe fn get_sem_info(id: sem_id, info: *mut sem_info) -> status_t { + _get_sem_info(id, info, core::mem::size_of::() as ::size_t) +} + +#[inline] +pub unsafe fn get_next_sem_info(team: team_id, cookie: *mut i32, info: *mut sem_info) -> status_t { + _get_next_sem_info( + team, + cookie, + info, + core::mem::size_of::() as ::size_t, + ) +} + +#[inline] +pub unsafe fn get_team_info(team: team_id, info: *mut team_info) -> status_t { + _get_team_info(team, info, core::mem::size_of::() as ::size_t) +} + +#[inline] +pub unsafe fn get_next_team_info(cookie: *mut i32, info: *mut team_info) -> status_t { + _get_next_team_info(cookie, info, core::mem::size_of::() as ::size_t) +} + +#[inline] +pub unsafe fn get_team_usage_info(team: team_id, who: i32, info: *mut team_usage_info) -> status_t { + _get_team_usage_info( + team, + who, + info, + core::mem::size_of::() as ::size_t, + ) +} + +#[inline] +pub unsafe fn get_thread_info(id: thread_id, info: *mut thread_info) -> status_t { + _get_thread_info(id, info, core::mem::size_of::() as ::size_t) +} + +#[inline] +pub unsafe fn get_next_thread_info( + team: team_id, + cookie: *mut i32, + info: *mut thread_info, +) -> status_t { + _get_next_thread_info( + team, + cookie, + info, + core::mem::size_of::() as ::size_t, + ) +} + +// kernel/image.h +#[inline] +pub unsafe fn get_image_info(image: image_id, info: *mut image_info) -> status_t { + _get_image_info(image, info, core::mem::size_of::() as ::size_t) +} + +#[inline] +pub unsafe fn get_next_image_info( + team: team_id, + cookie: *mut i32, + info: *mut image_info, +) -> status_t { + _get_next_image_info( + team, + cookie, + info, + core::mem::size_of::() as ::size_t, + ) +} diff --git a/bash-5.1/vendor/libc/src/unix/haiku/x86_64.rs b/bash-5.1/vendor/libc/src/unix/haiku/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..1b0462f2046321e21d0e4780e05fde83b07da15d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/haiku/x86_64.rs @@ -0,0 +1,264 @@ +s_no_extra_traits! { + pub struct fpu_state { + pub control: ::c_ushort, + pub status: ::c_ushort, + pub tag: ::c_ushort, + pub opcode: ::c_ushort, + pub rip: ::c_ulong, + pub rdp: ::c_ulong, + pub mxcsr: ::c_uint, + pub mscsr_mask: ::c_uint, + pub _fpreg: [[::c_uchar; 8]; 16], + pub _xmm: [[::c_uchar; 16]; 16], + pub _reserved_416_511: [::c_uchar; 96], + } + + pub struct xstate_hdr { + pub bv: ::c_ulong, + pub xcomp_bv: ::c_ulong, + pub _reserved: [::c_uchar; 48], + } + + pub struct savefpu { + pub fp_fxsave: fpu_state, + pub fp_xstate: xstate_hdr, + pub _fp_ymm: [[::c_uchar; 16]; 16], + } + + pub struct mcontext_t { + pub rax: ::c_ulong, + pub rbx: ::c_ulong, + pub rcx: ::c_ulong, + pub rdx: ::c_ulong, + pub rdi: ::c_ulong, + pub rsi: ::c_ulong, + pub rbp: ::c_ulong, + pub r8: ::c_ulong, + pub r9: ::c_ulong, + pub r10: ::c_ulong, + pub r11: ::c_ulong, + pub r12: ::c_ulong, + pub r13: ::c_ulong, + pub r14: ::c_ulong, + pub r15: ::c_ulong, + pub rsp: ::c_ulong, + pub rip: ::c_ulong, + pub rflags: ::c_ulong, + pub fpu: savefpu, + } + + pub struct ucontext_t { + pub uc_link: *mut ucontext_t, + pub uc_sigmask: ::sigset_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for fpu_state { + fn eq(&self, other: &fpu_state) -> bool { + self.control == other.control + && self.status == other.status + && self.tag == other.tag + && self.opcode == other.opcode + && self.rip == other.rip + && self.rdp == other.rdp + && self.mxcsr == other.mxcsr + && self.mscsr_mask == other.mscsr_mask + && self._fpreg.iter().zip(other._fpreg.iter()).all(|(a, b)| a == b) + && self._xmm.iter().zip(other._xmm.iter()).all(|(a, b)| a == b) + && self._reserved_416_511. + iter(). + zip(other._reserved_416_511.iter()). + all(|(a, b)| a == b) + } + } + impl Eq for fpu_state {} + impl ::fmt::Debug for fpu_state { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fpu_state") + .field("control", &self.control) + .field("status", &self.status) + .field("tag", &self.tag) + .field("opcode", &self.opcode) + .field("rip", &self.rip) + .field("rdp", &self.rdp) + .field("mxcsr", &self.mxcsr) + .field("mscsr_mask", &self.mscsr_mask) + // FIXME: .field("_fpreg", &self._fpreg) + // FIXME: .field("_xmm", &self._xmm) + // FIXME: .field("_reserved_416_511", &self._reserved_416_511) + .finish() + } + } + impl ::hash::Hash for fpu_state { + fn hash(&self, state: &mut H) { + self.control.hash(state); + self.status.hash(state); + self.tag.hash(state); + self.opcode.hash(state); + self.rip.hash(state); + self.rdp.hash(state); + self.mxcsr.hash(state); + self.mscsr_mask.hash(state); + self._fpreg.hash(state); + self._xmm.hash(state); + self._reserved_416_511.hash(state); + } + } + + impl PartialEq for xstate_hdr { + fn eq(&self, other: &xstate_hdr) -> bool { + self.bv == other.bv + && self.xcomp_bv == other.xcomp_bv + && self._reserved.iter().zip(other._reserved.iter()).all(|(a, b)| a == b) + } + } + impl Eq for xstate_hdr {} + impl ::fmt::Debug for xstate_hdr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("xstate_hdr") + .field("bv", &self.bv) + .field("xcomp_bv", &self.xcomp_bv) + // FIXME: .field("_reserved", &field._reserved) + .finish() + } + } + impl ::hash::Hash for xstate_hdr { + fn hash(&self, state: &mut H) { + self.bv.hash(state); + self.xcomp_bv.hash(state); + self._reserved.hash(state); + } + } + + impl PartialEq for savefpu { + fn eq(&self, other: &savefpu) -> bool { + self.fp_fxsave == other.fp_fxsave + && self.fp_xstate == other.fp_xstate + && self._fp_ymm.iter().zip(other._fp_ymm.iter()).all(|(a, b)| a == b) + } + } + impl Eq for savefpu {} + impl ::fmt::Debug for savefpu { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("savefpu") + .field("fp_fxsave", &self.fp_fxsave) + .field("fp_xstate", &self.fp_xstate) + // FIXME: .field("_fp_ymm", &field._fp_ymm) + .finish() + } + } + impl ::hash::Hash for savefpu { + fn hash(&self, state: &mut H) { + self.fp_fxsave.hash(state); + self.fp_xstate.hash(state); + self._fp_ymm.hash(state); + } + } + + impl PartialEq for mcontext_t { + fn eq(&self, other: &mcontext_t) -> bool { + self.rax == other.rax + && self.rbx == other.rbx + && self.rbx == other.rbx + && self.rcx == other.rcx + && self.rdx == other.rdx + && self.rdi == other.rdi + && self.rsi == other.rsi + && self.r8 == other.r8 + && self.r9 == other.r9 + && self.r10 == other.r10 + && self.r11 == other.r11 + && self.r12 == other.r12 + && self.r13 == other.r13 + && self.r14 == other.r14 + && self.r15 == other.r15 + && self.rsp == other.rsp + && self.rip == other.rip + && self.rflags == other.rflags + && self.fpu == other.fpu + } + } + impl Eq for mcontext_t {} + impl ::fmt::Debug for mcontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mcontext_t") + .field("rax", &self.rax) + .field("rbx", &self.rbx) + .field("rcx", &self.rcx) + .field("rdx", &self.rdx) + .field("rdi", &self.rdi) + .field("rsi", &self.rsi) + .field("rbp", &self.rbp) + .field("r8", &self.r8) + .field("r9", &self.r9) + .field("r10", &self.r10) + .field("r11", &self.r11) + .field("r12", &self.r12) + .field("r13", &self.r13) + .field("r14", &self.r14) + .field("r15", &self.r15) + .field("rsp", &self.rsp) + .field("rip", &self.rip) + .field("rflags", &self.rflags) + .field("fpu", &self.fpu) + .finish() + + } + } + impl ::hash::Hash for mcontext_t { + fn hash(&self, state: &mut H) { + self.rax.hash(state); + self.rbx.hash(state); + self.rcx.hash(state); + self.rdx.hash(state); + self.rdi.hash(state); + self.rsi.hash(state); + self.rbp.hash(state); + self.r8.hash(state); + self.r9.hash(state); + self.r10.hash(state); + self.r11.hash(state); + self.r12.hash(state); + self.r13.hash(state); + self.r14.hash(state); + self.r15.hash(state); + self.rsp.hash(state); + self.rip.hash(state); + self.rflags.hash(state); + self.fpu.hash(state); + } + } + + impl PartialEq for ucontext_t { + fn eq(&self, other: &ucontext_t) -> bool { + self.uc_link == other.uc_link + && self.uc_sigmask == other.uc_sigmask + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + } + } + impl Eq for ucontext_t {} + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_link", &self.uc_link) + .field("uc_sigmask", &self.uc_sigmask) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .finish() + } + } + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_link.hash(state); + self.uc_sigmask.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + } + } + } +} diff --git a/bash-5.1/vendor/libc/src/unix/hermit/aarch64.rs b/bash-5.1/vendor/libc/src/unix/hermit/aarch64.rs new file mode 100644 index 0000000000000000000000000000000000000000..1a92e3b4fa3412169caf35628d91ccfae399d6e9 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/hermit/aarch64.rs @@ -0,0 +1,2 @@ +pub type c_char = u8; +pub type wchar_t = u32; diff --git a/bash-5.1/vendor/libc/src/unix/hermit/mod.rs b/bash-5.1/vendor/libc/src/unix/hermit/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..eedfd28a49c239e930a66d7b4225673893fe8985 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/hermit/mod.rs @@ -0,0 +1,1024 @@ +// liblibc port for HermitCore (https://hermitcore.org) +// HermitCore is a unikernel based on lwIP, newlib, and +// pthread-embedded. +// Consider these definitions when porting liblibc to another +// lwIP/newlib/pte-based target. +// +// Ported by Colin Finck + +pub type c_long = i64; +pub type c_ulong = u64; + +pub type speed_t = ::c_uint; +pub type mode_t = u32; +pub type dev_t = i16; +pub type nfds_t = ::c_ulong; +pub type socklen_t = u32; +pub type sa_family_t = u8; +pub type clock_t = c_ulong; +pub type time_t = c_long; +pub type suseconds_t = c_long; +pub type off_t = i64; +pub type rlim_t = ::c_ulonglong; +pub type sigset_t = ::c_ulong; +pub type ino_t = u16; +pub type nlink_t = u16; +pub type blksize_t = c_long; +pub type blkcnt_t = c_long; +pub type stat64 = stat; +pub type clockid_t = c_ulong; +pub type pthread_t = pte_handle_t; +pub type pthread_attr_t = usize; +pub type pthread_cond_t = usize; +pub type pthread_condattr_t = usize; +pub type pthread_key_t = usize; +pub type pthread_mutex_t = usize; +pub type pthread_mutexattr_t = usize; +pub type pthread_rwlock_t = usize; +pub type pthread_rwlockattr_t = usize; + +s_no_extra_traits! { + pub struct dirent { + pub d_ino: ::c_long, + pub d_off: off_t, + pub d_reclen: u16, + pub d_name: [::c_char; 256], + } + + // Dummy + pub struct sockaddr_un { + pub sun_family: sa_family_t, + pub sun_path: [::c_char; 108], + } + + pub struct sockaddr { + pub sa_len: u8, + pub sa_family: sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in { + pub sin_len: u8, + pub sin_family: sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [::c_char; 8], + } + + pub struct fd_set { + fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE], + } + + pub struct sockaddr_storage { + pub s2_len: u8, + pub ss_family: sa_family_t, + pub s2_data1: [::c_char; 2], + pub s2_data2: [u32; 3], + pub s2_data3: [u32; 3], + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: dev_t, + pub st_size: off_t, + pub st_atime: time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: blksize_t, + pub st_blocks: blkcnt_t, + pub st_spare4: [::c_long; 2], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_ino == other.d_ino + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_ino", &self.d_ino) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for sockaddr_un { + fn eq(&self, other: &sockaddr_un) -> bool { + self.sun_family == other.sun_family + && self + .sun_path + .iter() + .zip(other.sun_path.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sockaddr_un {} + impl ::fmt::Debug for sockaddr_un { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_un") + .field("sun_family", &self.sun_family) + // FIXME: .field("sun_path", &self.sun_path) + .finish() + } + } + impl ::hash::Hash for sockaddr_un { + fn hash(&self, state: &mut H) { + self.sun_family.hash(state); + self.sun_path.hash(state); + } + } + + impl PartialEq for sockaddr { + fn eq(&self, other: &sockaddr) -> bool { + self.sa_len == other.sa_len + && self.sa_family == other.sa_family + && self + .sa_data + .iter() + .zip(other.sa_data.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sockaddr {} + impl ::fmt::Debug for sockaddr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr") + .field("sa_len", &self.sa_len) + .field("sa_family", &self.sa_family) + // FIXME: .field("sa_data", &self.sa_data) + .finish() + } + } + impl ::hash::Hash for sockaddr { + fn hash(&self, state: &mut H) { + self.sa_len.hash(state); + self.sa_family.hash(state); + self.sa_data.hash(state); + } + } + + impl PartialEq for sockaddr_in { + fn eq(&self, other: &sockaddr_in) -> bool { + self.sin_len == other.sin_len + && self.sin_family == other.sin_family + && self.sin_port == other.sin_port + && self.sin_addr == other.sin_addr + && self + .sin_zero + .iter() + .zip(other.sin_zero.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sockaddr_in {} + impl ::fmt::Debug for sockaddr_in { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_in") + .field("sin_len", &self.sin_len) + .field("sin_family", &self.sin_family) + .field("sin_port", &self.sin_port) + .field("sin_addr", &self.sin_addr) + // FIXME: .field("sin_zero", &self.sin_zero) + .finish() + } + } + impl ::hash::Hash for sockaddr_in { + fn hash(&self, state: &mut H) { + self.sin_len.hash(state); + self.sin_family.hash(state); + self.sin_port.hash(state); + self.sin_addr.hash(state); + self.sin_zero.hash(state); + } + } + + impl PartialEq for fd_set { + fn eq(&self, other: &fd_set) -> bool { + self.fds_bits + .iter() + .zip(other.fds_bits.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for fd_set {} + impl ::fmt::Debug for fd_set { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fd_set") + // FIXME: .field("fds_bits", &self.fds_bits) + .finish() + } + } + impl ::hash::Hash for fd_set { + fn hash(&self, state: &mut H) { + self.fds_bits.hash(state); + } + } + + impl PartialEq for sockaddr_storage { + fn eq(&self, other: &sockaddr_storage) -> bool { + self.s2_len == other.s2_len + && self.ss_family == other.ss_family + && self.s2_data1 + .iter() + .zip(other.s2_data1.iter()) + .all(|(a,b)| a == b) + && self.s2_data2 + .iter() + .zip(other.s2_data2.iter()) + .all(|(a,b)| a == b) + && self.s2_data3 + .iter() + .zip(other.s2_data3.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sockaddr_storage {} + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("s2_len", &self.s2_len) + .field("ss_family", &self.ss_family) + // FIXME: .field("s2_data1", &self.s2_data1) + // FIXME: .field("s2_data2", &self.s2_data2) + // FIXME: .field("s2_data3", &self.s2_data3) + .finish() + } + } + impl ::hash::Hash for sockaddr_storage { + fn hash(&self, state: &mut H) { + self.s2_len.hash(state); + self.ss_family.hash(state); + self.s2_data1.hash(state); + self.s2_data2.hash(state); + self.s2_data3.hash(state); + } + } + + impl PartialEq for stat { + fn eq(&self, other: &stat) -> bool { + self.st_dev == other.st_dev + && self.st_ino == other.st_ino + && self.st_mode == other.st_mode + && self.st_nlink == other.st_nlink + && self.st_uid == other.st_uid + && self.st_gid == other.st_gid + && self.st_rdev == other.st_rdev + && self.st_size == other.st_size + && self.st_atime == other.st_atime + && self.st_atime_nsec == other.st_atime_nsec + && self.st_mtime == other.st_mtime + && self.st_mtime_nsec == other.st_mtime_nsec + && self.st_ctime == other.st_ctime + && self.st_ctime_nsec == other.st_ctime_nsec + && self.st_blksize == other.st_blksize + && self.st_blocks == other.st_blocks + && self + .st_spare4 + .iter() + .zip(other.st_spare4.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for stat {} + impl ::fmt::Debug for stat { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("stat") + .field("st_dev", &self.st_dev) + .field("st_ino", &self.st_ino) + .field("st_mode", &self.st_mode) + .field("st_nlink", &self.st_nlink) + .field("st_uid", &self.st_uid) + .field("st_gid", &self.st_gid) + .field("st_rdev", &self.st_rdev) + .field("st_size", &self.st_size) + .field("st_atime", &self.st_atime) + .field("st_atime_nsec", &self.st_atime_nsec) + .field("st_mtime", &self.st_mtime) + .field("st_mtime_nsec", &self.st_mtime_nsec) + .field("st_ctime", &self.st_ctime) + .field("st_ctime_nsec", &self.st_ctime_nsec) + .field("st_blksize", &self.st_blksize) + .field("st_blocks", &self.st_blocks) + // FIXME: .field("st_spare4", &self.st_spare4) + .finish() + } + } + impl ::hash::Hash for stat { + fn hash(&self, state: &mut H) { + self.st_dev.hash(state); + self.st_ino.hash(state); + self.st_mode.hash(state); + self.st_nlink.hash(state); + self.st_uid.hash(state); + self.st_gid.hash(state); + self.st_rdev.hash(state); + self.st_size.hash(state); + self.st_atime.hash(state); + self.st_atime_nsec.hash(state); + self.st_mtime.hash(state); + self.st_mtime_nsec.hash(state); + self.st_ctime.hash(state); + self.st_ctime_nsec.hash(state); + self.st_blksize.hash(state); + self.st_blocks.hash(state); + self.st_spare4.hash(state); + } + } + } +} + +s! { + pub struct in_addr { + pub s_addr: ::in_addr_t, + } + + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + pub ai_addrlen: socklen_t, + pub ai_addr: *mut ::sockaddr, + pub ai_canonname: *mut c_char, + pub ai_next: *mut addrinfo, + } + + pub struct Dl_info {} + + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } + + pub struct passwd { // Unverified + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_gecos: *mut ::c_char, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char, + } + + pub struct pte_handle_t { + pub p: usize, + pub x: ::c_uint, + } + + pub struct sched_param { + pub sched_priority: ::c_int, + } + + pub struct sem_t { + pub value: i32, + pub lock: usize, + pub sem: usize, + } + + pub struct sigaction { + pub sa_flags: ::c_int, + pub sa_mask: sigset_t, + pub sa_handler: usize, + } + + pub struct sockaddr_in6 { + pub sin6_len: u8, + pub sin6_family: sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct statvfs {} + + pub struct tm { + pub tm_sec: ::c_int, + pub tm_min: ::c_int, + pub tm_hour: ::c_int, + pub tm_mday: ::c_int, + pub tm_mon: ::c_int, + pub tm_year: ::c_int, + pub tm_wday: ::c_int, + pub tm_yday: ::c_int, + pub tm_isdst: ::c_int, + } + + pub struct tms { + pub tms_utime: ::clock_t, + pub tms_stime: ::clock_t, + pub tms_cutime: ::clock_t, + pub tms_cstime: ::clock_t, + } + + pub struct termios {} + + pub struct utsname {} +} + +pub const AF_UNSPEC: ::c_int = 0; +pub const AF_INET: ::c_int = 2; +pub const AF_INET6: ::c_int = 10; + +// Dummy +pub const AF_UNIX: ::c_int = 1; + +pub const CLOCK_REALTIME: ::clockid_t = 1; +pub const CLOCK_MONOTONIC: ::clockid_t = 4; + +// Dummy +pub const EAI_SYSTEM: ::c_int = -11; + +pub const EPERM: ::c_int = 1; +pub const ENOENT: ::c_int = 2; +pub const ESRCH: ::c_int = 3; +pub const EINTR: ::c_int = 4; +pub const EIO: ::c_int = 5; +pub const ENXIO: ::c_int = 6; +pub const E2BIG: ::c_int = 7; +pub const ENOEXEC: ::c_int = 8; +pub const EBADF: ::c_int = 9; +pub const ECHILD: ::c_int = 10; +pub const EAGAIN: ::c_int = 11; +pub const ENOMEM: ::c_int = 12; +pub const EACCES: ::c_int = 13; +pub const EFAULT: ::c_int = 14; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENFILE: ::c_int = 23; +pub const EMFILE: ::c_int = 24; +pub const ENOTTY: ::c_int = 25; +pub const ETXTBSY: ::c_int = 26; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDOM: ::c_int = 33; +pub const ERANGE: ::c_int = 34; +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const EWOULDBLOCK: ::c_int = EAGAIN; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EDEADLOCK: ::c_int = EDEADLK; +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EMULTIHOP: ::c_int = 72; +pub const EDOTDOT: ::c_int = 73; +pub const EBADMSG: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const ERFKILL: ::c_int = 132; +pub const EHWPOISON: ::c_int = 133; + +pub const EXIT_FAILURE: ::c_int = 1; +pub const EXIT_SUCCESS: ::c_int = 0; + +pub const F_DUPFD: ::c_int = 0; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; +pub const F_GETOWN: ::c_int = 5; +pub const F_SETOWN: ::c_int = 6; +pub const F_GETLK: ::c_int = 7; +pub const F_SETLK: ::c_int = 8; +pub const F_SETLKW: ::c_int = 9; +pub const F_RGETLK: ::c_int = 10; +pub const F_RSETLK: ::c_int = 11; +pub const F_CNVT: ::c_int = 12; +pub const F_RSETLKW: ::c_int = 13; +pub const F_DUPFD_CLOEXEC: ::c_int = 14; + +pub const FD_SETSIZE: usize = 1024; + +// Dummy +pub const FIOCLEX: ::c_int = 0x5451; + +pub const FIONBIO: ::c_int = 0x8004667e; +pub const FIONREAD: ::c_int = 0x4004667f; + +pub const IP_ADD_MEMBERSHIP: ::c_int = 3; +pub const IP_DROP_MEMBERSHIP: ::c_int = 4; + +pub const IP_TOS: ::c_int = 1; +pub const IP_TTL: ::c_int = 2; + +pub const IP_MULTICAST_TTL: ::c_int = 5; +pub const IP_MULTICAST_IF: ::c_int = 6; +pub const IP_MULTICAST_LOOP: ::c_int = 7; + +pub const IPV6_JOIN_GROUP: ::c_int = 12; +pub const IPV6_ADD_MEMBERSHIP: ::c_int = 12; +pub const IPV6_LEAVE_GROUP: ::c_int = 13; +pub const IPV6_DROP_MEMBERSHIP: ::c_int = 13; +pub const IPV6_V6ONLY: ::c_int = 27; + +// Dummy +pub const IPV6_MULTICAST_LOOP: ::c_int = 7; + +pub const MSG_PEEK: ::c_int = 0x01; +pub const MSG_WAITALL: ::c_int = 0x02; +pub const MSG_OOB: ::c_int = 0x04; +pub const MSG_DONTWAIT: ::c_int = 0x08; +pub const MSG_MORE: ::c_int = 0x10; + +pub const O_ACCMODE: ::c_int = 3; +pub const O_RDONLY: ::c_int = 0; +pub const O_WRONLY: ::c_int = 1; +pub const O_RDWR: ::c_int = 2; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_TRUNC: ::c_int = 512; +pub const O_CLOEXEC: ::c_int = 524288; + +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; + +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = usize::max_value(); +pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = usize::max_value(); +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = usize::max_value(); + +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; +pub const PTHREAD_STACK_MIN: ::size_t = 0; + +// Dummy +pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; + +pub const _SC_ARG_MAX: ::c_int = 0; +pub const _SC_CHILD_MAX: ::c_int = 1; +pub const _SC_CLK_TCK: ::c_int = 2; +pub const _SC_NGROUPS_MAX: ::c_int = 3; +pub const _SC_OPEN_MAX: ::c_int = 4; +pub const _SC_JOB_CONTROL: ::c_int = 5; +pub const _SC_SAVED_IDS: ::c_int = 6; +pub const _SC_VERSION: ::c_int = 7; +pub const _SC_PAGESIZE: ::c_int = 8; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; +pub const _SC_NPROCESSORS_CONF: ::c_int = 9; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 10; +pub const _SC_PHYS_PAGES: ::c_int = 11; +pub const _SC_AVPHYS_PAGES: ::c_int = 12; +pub const _SC_MQ_OPEN_MAX: ::c_int = 13; +pub const _SC_MQ_PRIO_MAX: ::c_int = 14; +pub const _SC_RTSIG_MAX: ::c_int = 15; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 16; +pub const _SC_SEM_VALUE_MAX: ::c_int = 17; +pub const _SC_SIGQUEUE_MAX: ::c_int = 18; +pub const _SC_TIMER_MAX: ::c_int = 19; +pub const _SC_TZNAME_MAX: ::c_int = 20; +pub const _SC_ASYNCHRONOUS_IO: ::c_int = 21; +pub const _SC_FSYNC: ::c_int = 22; +pub const _SC_MAPPED_FILES: ::c_int = 23; +pub const _SC_MEMLOCK: ::c_int = 24; +pub const _SC_MEMLOCK_RANGE: ::c_int = 25; +pub const _SC_MEMORY_PROTECTION: ::c_int = 26; +pub const _SC_MESSAGE_PASSING: ::c_int = 27; +pub const _SC_PRIORITIZED_IO: ::c_int = 28; +pub const _SC_REALTIME_SIGNALS: ::c_int = 29; +pub const _SC_SEMAPHORES: ::c_int = 30; +pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 31; +pub const _SC_SYNCHRONIZED_IO: ::c_int = 32; +pub const _SC_TIMERS: ::c_int = 33; +pub const _SC_AIO_LISTIO_MAX: ::c_int = 34; +pub const _SC_AIO_MAX: ::c_int = 35; +pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 36; +pub const _SC_DELAYTIMER_MAX: ::c_int = 37; +pub const _SC_THREAD_KEYS_MAX: ::c_int = 38; +pub const _SC_THREAD_STACK_MIN: ::c_int = 39; +pub const _SC_THREAD_THREADS_MAX: ::c_int = 40; +pub const _SC_TTY_NAME_MAX: ::c_int = 41; +pub const _SC_THREADS: ::c_int = 42; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 43; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 44; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 45; +pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 46; +pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 47; +pub const _SC_THREAD_PRIO_CEILING: ::c_int = _SC_THREAD_PRIO_PROTECT; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 48; +pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 49; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 50; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 51; +pub const _SC_LOGIN_NAME_MAX: ::c_int = 52; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 53; +pub const _SC_ADVISORY_INFO: ::c_int = 54; +pub const _SC_ATEXIT_MAX: ::c_int = 55; +pub const _SC_BARRIERS: ::c_int = 56; +pub const _SC_BC_BASE_MAX: ::c_int = 57; +pub const _SC_BC_DIM_MAX: ::c_int = 58; +pub const _SC_BC_SCALE_MAX: ::c_int = 59; +pub const _SC_BC_STRING_MAX: ::c_int = 60; +pub const _SC_CLOCK_SELECTION: ::c_int = 61; +pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 62; +pub const _SC_CPUTIME: ::c_int = 63; +pub const _SC_EXPR_NEST_MAX: ::c_int = 64; +pub const _SC_HOST_NAME_MAX: ::c_int = 65; +pub const _SC_IOV_MAX: ::c_int = 66; +pub const _SC_IPV6: ::c_int = 67; +pub const _SC_LINE_MAX: ::c_int = 68; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 69; +pub const _SC_RAW_SOCKETS: ::c_int = 70; +pub const _SC_READER_WRITER_LOCKS: ::c_int = 71; +pub const _SC_REGEXP: ::c_int = 72; +pub const _SC_RE_DUP_MAX: ::c_int = 73; +pub const _SC_SHELL: ::c_int = 74; +pub const _SC_SPAWN: ::c_int = 75; +pub const _SC_SPIN_LOCKS: ::c_int = 76; +pub const _SC_SPORADIC_SERVER: ::c_int = 77; +pub const _SC_SS_REPL_MAX: ::c_int = 78; +pub const _SC_SYMLOOP_MAX: ::c_int = 79; +pub const _SC_THREAD_CPUTIME: ::c_int = 80; +pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 81; +pub const _SC_TIMEOUTS: ::c_int = 82; +pub const _SC_TRACE: ::c_int = 83; +pub const _SC_TRACE_EVENT_FILTER: ::c_int = 84; +pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 85; +pub const _SC_TRACE_INHERIT: ::c_int = 86; +pub const _SC_TRACE_LOG: ::c_int = 87; +pub const _SC_TRACE_NAME_MAX: ::c_int = 88; +pub const _SC_TRACE_SYS_MAX: ::c_int = 89; +pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 90; +pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 91; +pub const _SC_V7_ILP32_OFF32: ::c_int = 92; +pub const _SC_V6_ILP32_OFF32: ::c_int = _SC_V7_ILP32_OFF32; +pub const _SC_XBS5_ILP32_OFF32: ::c_int = _SC_V7_ILP32_OFF32; +pub const _SC_V7_ILP32_OFFBIG: ::c_int = 93; +pub const _SC_V6_ILP32_OFFBIG: ::c_int = _SC_V7_ILP32_OFFBIG; +pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = _SC_V7_ILP32_OFFBIG; +pub const _SC_V7_LP64_OFF64: ::c_int = 94; +pub const _SC_V6_LP64_OFF64: ::c_int = _SC_V7_LP64_OFF64; +pub const _SC_XBS5_LP64_OFF64: ::c_int = _SC_V7_LP64_OFF64; +pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 95; +pub const _SC_V6_LPBIG_OFFBIG: ::c_int = _SC_V7_LPBIG_OFFBIG; +pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = _SC_V7_LPBIG_OFFBIG; +pub const _SC_XOPEN_CRYPT: ::c_int = 96; +pub const _SC_XOPEN_ENH_I18N: ::c_int = 97; +pub const _SC_XOPEN_LEGACY: ::c_int = 98; +pub const _SC_XOPEN_REALTIME: ::c_int = 99; +pub const _SC_STREAM_MAX: ::c_int = 100; +pub const _SC_PRIORITY_SCHEDULING: ::c_int = 101; +pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 102; +pub const _SC_XOPEN_SHM: ::c_int = 103; +pub const _SC_XOPEN_STREAMS: ::c_int = 104; +pub const _SC_XOPEN_UNIX: ::c_int = 105; +pub const _SC_XOPEN_VERSION: ::c_int = 106; +pub const _SC_2_CHAR_TERM: ::c_int = 107; +pub const _SC_2_C_BIND: ::c_int = 108; +pub const _SC_2_C_DEV: ::c_int = 109; +pub const _SC_2_FORT_DEV: ::c_int = 110; +pub const _SC_2_FORT_RUN: ::c_int = 111; +pub const _SC_2_LOCALEDEF: ::c_int = 112; +pub const _SC_2_PBS: ::c_int = 113; +pub const _SC_2_PBS_ACCOUNTING: ::c_int = 114; +pub const _SC_2_PBS_CHECKPOINT: ::c_int = 115; +pub const _SC_2_PBS_LOCATE: ::c_int = 116; +pub const _SC_2_PBS_MESSAGE: ::c_int = 117; +pub const _SC_2_PBS_TRACK: ::c_int = 118; +pub const _SC_2_SW_DEV: ::c_int = 119; +pub const _SC_2_UPE: ::c_int = 120; +pub const _SC_2_VERSION: ::c_int = 121; +pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 122; +pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 123; +pub const _SC_XOPEN_UUCP: ::c_int = 124; +pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 125; +pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 126; +pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 127; +pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 128; +pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 129; +pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 130; +pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 131; +pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 132; +pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 133; +pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 134; +pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 135; +pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 136; +pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 137; +pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 138; +pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 139; + +pub const S_BLKSIZE: ::mode_t = 1024; +pub const S_IREAD: ::mode_t = 256; +pub const S_IWRITE: ::mode_t = 128; +pub const S_IEXEC: ::mode_t = 64; +pub const S_ENFMT: ::mode_t = 1024; +pub const S_IFMT: ::mode_t = 61440; +pub const S_IFDIR: ::mode_t = 16384; +pub const S_IFCHR: ::mode_t = 8192; +pub const S_IFBLK: ::mode_t = 24576; +pub const S_IFREG: ::mode_t = 32768; +pub const S_IFLNK: ::mode_t = 40960; +pub const S_IFSOCK: ::mode_t = 49152; +pub const S_IFIFO: ::mode_t = 4096; +pub const S_IRUSR: ::mode_t = 256; +pub const S_IWUSR: ::mode_t = 128; +pub const S_IXUSR: ::mode_t = 64; +pub const S_IRGRP: ::mode_t = 32; +pub const S_IWGRP: ::mode_t = 16; +pub const S_IXGRP: ::mode_t = 8; +pub const S_IROTH: ::mode_t = 4; +pub const S_IWOTH: ::mode_t = 2; +pub const S_IXOTH: ::mode_t = 1; + +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; + +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; + +pub const SIG_SETMASK: ::c_int = 0; + +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGABRT: ::c_int = 6; +pub const SIGEMT: ::c_int = 7; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGSEGV: ::c_int = 11; +pub const SIGPIPE: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; + +pub const SO_DEBUG: ::c_int = 0x0001; +pub const SO_ACCEPTCONN: ::c_int = 0x0002; +pub const SO_REUSEADDR: ::c_int = 0x0004; +pub const SO_KEEPALIVE: ::c_int = 0x0008; +pub const SO_DONTROUTE: ::c_int = 0x0010; +pub const SO_BROADCAST: ::c_int = 0x0020; +pub const SO_USELOOPBACK: ::c_int = 0x0040; +pub const SO_LINGER: ::c_int = 0x0080; +pub const SO_OOBINLINE: ::c_int = 0x0100; +pub const SO_REUSEPORT: ::c_int = 0x0200; +pub const SO_SNDBUF: ::c_int = 0x1001; +pub const SO_RCVBUF: ::c_int = 0x1002; +pub const SO_SNDLOWAT: ::c_int = 0x1003; +pub const SO_RCVLOWAT: ::c_int = 0x1004; +pub const SO_SNDTIMEO: ::c_int = 0x1005; +pub const SO_RCVTIMEO: ::c_int = 0x1006; +pub const SO_ERROR: ::c_int = 0x1007; +pub const SO_TYPE: ::c_int = 0x1008; +pub const SO_CONTIMEO: ::c_int = 0x1009; +pub const SO_NO_CHECK: ::c_int = 0x100a; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_RAW: ::c_int = 3; + +pub const SOL_SOCKET: ::c_int = 0xfff; + +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; + +pub const TCP_NODELAY: ::c_int = 0x01; +pub const TCP_KEEPALIVE: ::c_int = 0x02; +pub const TCP_KEEPIDLE: ::c_int = 0x03; +pub const TCP_KEEPINTVL: ::c_int = 0x04; +pub const TCP_KEEPCNT: ::c_int = 0x05; + +const ULONG_SIZE: usize = 64; + +pub const WNOHANG: ::c_int = 0x00000001; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +safe_f! { + pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int { + (status >> 8) & 0xff + } + + pub {const} fn WIFEXITED(status: ::c_int) -> bool { + (status & 0xff) == 0 + } + + pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int { + status & 0x7f + } +} + +extern "C" { + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; + pub fn labs(i: ::c_long) -> ::c_long; + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + + pub fn bind(s: ::c_int, name: *const ::sockaddr, namelen: ::socklen_t) -> ::c_int; + + pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn getpwuid_r( + uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + + // Dummy + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + + pub fn memalign(align: ::size_t, nbytes: ::size_t) -> *mut ::c_void; + + pub fn pthread_create( + tid: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + start: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + arg: *mut ::c_void, + ) -> ::c_int; + + pub fn pthread_sigmask(how: ::c_int, set: *const ::sigset_t, oset: *mut ::sigset_t) -> ::c_int; + + pub fn recvfrom( + s: ::c_int, + mem: *mut ::c_void, + len: ::size_t, + flags: ::c_int, + from: *mut ::sockaddr, + fromlen: *mut ::socklen_t, + ) -> ::c_int; + + pub fn setgroups(ngroups: ::c_int, grouplist: *const ::gid_t) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/hermit/x86_64.rs b/bash-5.1/vendor/libc/src/unix/hermit/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..76ec3ce823e8fedfc49c9e9118285af65b5d86fb --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/hermit/x86_64.rs @@ -0,0 +1,2 @@ +pub type c_char = i8; +pub type wchar_t = i32; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/arm.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/arm.rs new file mode 100644 index 0000000000000000000000000000000000000000..33d2fa07078d3f38bb7e6778097a57b63e767719 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/arm.rs @@ -0,0 +1,539 @@ +pub type c_char = u8; +pub type wchar_t = u32; +pub type greg_t = i32; +pub type mcontext_t = sigcontext; + +s! { + pub struct sigcontext { + pub trap_no: ::c_ulong, + pub error_code: ::c_ulong, + pub oldmask: ::c_ulong, + pub arm_r0: ::c_ulong, + pub arm_r1: ::c_ulong, + pub arm_r2: ::c_ulong, + pub arm_r3: ::c_ulong, + pub arm_r4: ::c_ulong, + pub arm_r5: ::c_ulong, + pub arm_r6: ::c_ulong, + pub arm_r7: ::c_ulong, + pub arm_r8: ::c_ulong, + pub arm_r9: ::c_ulong, + pub arm_r10: ::c_ulong, + pub arm_fp: ::c_ulong, + pub arm_ip: ::c_ulong, + pub arm_sp: ::c_ulong, + pub arm_lr: ::c_ulong, + pub arm_pc: ::c_ulong, + pub arm_cpsr: ::c_ulong, + pub fault_address: ::c_ulong, + } +} + +cfg_if! { + if #[cfg(libc_union)] { + s_no_extra_traits! { + pub struct __c_anonymous_uc_sigmask_with_padding { + pub uc_sigmask: ::sigset_t, + /* Android has a wrong (smaller) sigset_t on x86. */ + __padding_rt_sigset: u32, + } + + pub union __c_anonymous_uc_sigmask { + uc_sigmask: __c_anonymous_uc_sigmask_with_padding, + uc_sigmask64: ::sigset64_t, + } + + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask__c_anonymous_union: __c_anonymous_uc_sigmask, + /* The kernel adds extra padding after uc_sigmask to match + * glibc sigset_t on ARM. */ + __padding: [c_char; 120], + __align: [::c_longlong; 0], + uc_regspace: [::c_ulong; 128], + } + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for __c_anonymous_uc_sigmask_with_padding { + fn eq( + &self, other: &__c_anonymous_uc_sigmask_with_padding + ) -> bool { + self.uc_sigmask == other.uc_sigmask + // Ignore padding + } + } + impl Eq for __c_anonymous_uc_sigmask_with_padding {} + impl ::fmt::Debug for __c_anonymous_uc_sigmask_with_padding { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("uc_sigmask_with_padding") + .field("uc_sigmask_with_padding", &self.uc_sigmask) + // Ignore padding + .finish() + } + } + impl ::hash::Hash for __c_anonymous_uc_sigmask_with_padding { + fn hash(&self, state: &mut H) { + self.uc_sigmask.hash(state) + // Ignore padding + } + } + + impl PartialEq for __c_anonymous_uc_sigmask { + fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool { + unsafe { self.uc_sigmask == other.uc_sigmask } + } + } + impl Eq for __c_anonymous_uc_sigmask {} + impl ::fmt::Debug for __c_anonymous_uc_sigmask { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("uc_sigmask") + .field("uc_sigmask", unsafe { &self.uc_sigmask }) + .finish() + } + } + impl ::hash::Hash for __c_anonymous_uc_sigmask { + fn hash(&self, state: &mut H) { + unsafe { self.uc_sigmask.hash(state) } + } + } + + impl PartialEq for ucontext_t { + fn eq(&self, other: &Self) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_sigmask__c_anonymous_union + == other.uc_sigmask__c_anonymous_union + && &self.uc_regspace[..] == &other.uc_regspace[..] + // Ignore padding field + } + } + impl Eq for ucontext_t {} + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_flags) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field( + "uc_sigmask__c_anonymous_union", + &self.uc_sigmask__c_anonymous_union + ) + .field("uc_regspace", &&self.uc_regspace[..]) + // Ignore padding field + .finish() + } + } + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + self.uc_sigmask__c_anonymous_union.hash(state); + self.uc_regspace[..].hash(state); + // Ignore padding field + } + } + } + } + } +} + +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_LARGEFILE: ::c_int = 0o400000; + +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_pause: ::c_long = 29; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS_getdents: ::c_long = 141; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_chown: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_ugetrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_lchown32: ::c_long = 198; +pub const SYS_getuid32: ::c_long = 199; +pub const SYS_getgid32: ::c_long = 200; +pub const SYS_geteuid32: ::c_long = 201; +pub const SYS_getegid32: ::c_long = 202; +pub const SYS_setreuid32: ::c_long = 203; +pub const SYS_setregid32: ::c_long = 204; +pub const SYS_getgroups32: ::c_long = 205; +pub const SYS_setgroups32: ::c_long = 206; +pub const SYS_fchown32: ::c_long = 207; +pub const SYS_setresuid32: ::c_long = 208; +pub const SYS_getresuid32: ::c_long = 209; +pub const SYS_setresgid32: ::c_long = 210; +pub const SYS_getresgid32: ::c_long = 211; +pub const SYS_chown32: ::c_long = 212; +pub const SYS_setuid32: ::c_long = 213; +pub const SYS_setgid32: ::c_long = 214; +pub const SYS_setfsuid32: ::c_long = 215; +pub const SYS_setfsgid32: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; +pub const SYS_pivot_root: ::c_long = 218; +pub const SYS_mincore: ::c_long = 219; +pub const SYS_madvise: ::c_long = 220; +pub const SYS_fcntl64: ::c_long = 221; +pub const SYS_gettid: ::c_long = 224; +pub const SYS_readahead: ::c_long = 225; +pub const SYS_setxattr: ::c_long = 226; +pub const SYS_lsetxattr: ::c_long = 227; +pub const SYS_fsetxattr: ::c_long = 228; +pub const SYS_getxattr: ::c_long = 229; +pub const SYS_lgetxattr: ::c_long = 230; +pub const SYS_fgetxattr: ::c_long = 231; +pub const SYS_listxattr: ::c_long = 232; +pub const SYS_llistxattr: ::c_long = 233; +pub const SYS_flistxattr: ::c_long = 234; +pub const SYS_removexattr: ::c_long = 235; +pub const SYS_lremovexattr: ::c_long = 236; +pub const SYS_fremovexattr: ::c_long = 237; +pub const SYS_tkill: ::c_long = 238; +pub const SYS_sendfile64: ::c_long = 239; +pub const SYS_futex: ::c_long = 240; +pub const SYS_sched_setaffinity: ::c_long = 241; +pub const SYS_sched_getaffinity: ::c_long = 242; +pub const SYS_io_setup: ::c_long = 243; +pub const SYS_io_destroy: ::c_long = 244; +pub const SYS_io_getevents: ::c_long = 245; +pub const SYS_io_submit: ::c_long = 246; +pub const SYS_io_cancel: ::c_long = 247; +pub const SYS_exit_group: ::c_long = 248; +pub const SYS_lookup_dcookie: ::c_long = 249; +pub const SYS_epoll_create: ::c_long = 250; +pub const SYS_epoll_ctl: ::c_long = 251; +pub const SYS_epoll_wait: ::c_long = 252; +pub const SYS_remap_file_pages: ::c_long = 253; +pub const SYS_set_tid_address: ::c_long = 256; +pub const SYS_timer_create: ::c_long = 257; +pub const SYS_timer_settime: ::c_long = 258; +pub const SYS_timer_gettime: ::c_long = 259; +pub const SYS_timer_getoverrun: ::c_long = 260; +pub const SYS_timer_delete: ::c_long = 261; +pub const SYS_clock_settime: ::c_long = 262; +pub const SYS_clock_gettime: ::c_long = 263; +pub const SYS_clock_getres: ::c_long = 264; +pub const SYS_clock_nanosleep: ::c_long = 265; +pub const SYS_statfs64: ::c_long = 266; +pub const SYS_fstatfs64: ::c_long = 267; +pub const SYS_tgkill: ::c_long = 268; +pub const SYS_utimes: ::c_long = 269; +pub const SYS_arm_fadvise64_64: ::c_long = 270; +pub const SYS_pciconfig_iobase: ::c_long = 271; +pub const SYS_pciconfig_read: ::c_long = 272; +pub const SYS_pciconfig_write: ::c_long = 273; +pub const SYS_mq_open: ::c_long = 274; +pub const SYS_mq_unlink: ::c_long = 275; +pub const SYS_mq_timedsend: ::c_long = 276; +pub const SYS_mq_timedreceive: ::c_long = 277; +pub const SYS_mq_notify: ::c_long = 278; +pub const SYS_mq_getsetattr: ::c_long = 279; +pub const SYS_waitid: ::c_long = 280; +pub const SYS_socket: ::c_long = 281; +pub const SYS_bind: ::c_long = 282; +pub const SYS_connect: ::c_long = 283; +pub const SYS_listen: ::c_long = 284; +pub const SYS_accept: ::c_long = 285; +pub const SYS_getsockname: ::c_long = 286; +pub const SYS_getpeername: ::c_long = 287; +pub const SYS_socketpair: ::c_long = 288; +pub const SYS_send: ::c_long = 289; +pub const SYS_sendto: ::c_long = 290; +pub const SYS_recv: ::c_long = 291; +pub const SYS_recvfrom: ::c_long = 292; +pub const SYS_shutdown: ::c_long = 293; +pub const SYS_setsockopt: ::c_long = 294; +pub const SYS_getsockopt: ::c_long = 295; +pub const SYS_sendmsg: ::c_long = 296; +pub const SYS_recvmsg: ::c_long = 297; +pub const SYS_semop: ::c_long = 298; +pub const SYS_semget: ::c_long = 299; +pub const SYS_semctl: ::c_long = 300; +pub const SYS_msgsnd: ::c_long = 301; +pub const SYS_msgrcv: ::c_long = 302; +pub const SYS_msgget: ::c_long = 303; +pub const SYS_msgctl: ::c_long = 304; +pub const SYS_shmat: ::c_long = 305; +pub const SYS_shmdt: ::c_long = 306; +pub const SYS_shmget: ::c_long = 307; +pub const SYS_shmctl: ::c_long = 308; +pub const SYS_add_key: ::c_long = 309; +pub const SYS_request_key: ::c_long = 310; +pub const SYS_keyctl: ::c_long = 311; +pub const SYS_semtimedop: ::c_long = 312; +pub const SYS_vserver: ::c_long = 313; +pub const SYS_ioprio_set: ::c_long = 314; +pub const SYS_ioprio_get: ::c_long = 315; +pub const SYS_inotify_init: ::c_long = 316; +pub const SYS_inotify_add_watch: ::c_long = 317; +pub const SYS_inotify_rm_watch: ::c_long = 318; +pub const SYS_mbind: ::c_long = 319; +pub const SYS_get_mempolicy: ::c_long = 320; +pub const SYS_set_mempolicy: ::c_long = 321; +pub const SYS_openat: ::c_long = 322; +pub const SYS_mkdirat: ::c_long = 323; +pub const SYS_mknodat: ::c_long = 324; +pub const SYS_fchownat: ::c_long = 325; +pub const SYS_futimesat: ::c_long = 326; +pub const SYS_fstatat64: ::c_long = 327; +pub const SYS_unlinkat: ::c_long = 328; +pub const SYS_renameat: ::c_long = 329; +pub const SYS_linkat: ::c_long = 330; +pub const SYS_symlinkat: ::c_long = 331; +pub const SYS_readlinkat: ::c_long = 332; +pub const SYS_fchmodat: ::c_long = 333; +pub const SYS_faccessat: ::c_long = 334; +pub const SYS_pselect6: ::c_long = 335; +pub const SYS_ppoll: ::c_long = 336; +pub const SYS_unshare: ::c_long = 337; +pub const SYS_set_robust_list: ::c_long = 338; +pub const SYS_get_robust_list: ::c_long = 339; +pub const SYS_splice: ::c_long = 340; +pub const SYS_arm_sync_file_range: ::c_long = 341; +pub const SYS_tee: ::c_long = 342; +pub const SYS_vmsplice: ::c_long = 343; +pub const SYS_move_pages: ::c_long = 344; +pub const SYS_getcpu: ::c_long = 345; +pub const SYS_epoll_pwait: ::c_long = 346; +pub const SYS_kexec_load: ::c_long = 347; +pub const SYS_utimensat: ::c_long = 348; +pub const SYS_signalfd: ::c_long = 349; +pub const SYS_timerfd_create: ::c_long = 350; +pub const SYS_eventfd: ::c_long = 351; +pub const SYS_fallocate: ::c_long = 352; +pub const SYS_timerfd_settime: ::c_long = 353; +pub const SYS_timerfd_gettime: ::c_long = 354; +pub const SYS_signalfd4: ::c_long = 355; +pub const SYS_eventfd2: ::c_long = 356; +pub const SYS_epoll_create1: ::c_long = 357; +pub const SYS_dup3: ::c_long = 358; +pub const SYS_pipe2: ::c_long = 359; +pub const SYS_inotify_init1: ::c_long = 360; +pub const SYS_preadv: ::c_long = 361; +pub const SYS_pwritev: ::c_long = 362; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 363; +pub const SYS_perf_event_open: ::c_long = 364; +pub const SYS_recvmmsg: ::c_long = 365; +pub const SYS_accept4: ::c_long = 366; +pub const SYS_fanotify_init: ::c_long = 367; +pub const SYS_fanotify_mark: ::c_long = 368; +pub const SYS_prlimit64: ::c_long = 369; +pub const SYS_name_to_handle_at: ::c_long = 370; +pub const SYS_open_by_handle_at: ::c_long = 371; +pub const SYS_clock_adjtime: ::c_long = 372; +pub const SYS_syncfs: ::c_long = 373; +pub const SYS_sendmmsg: ::c_long = 374; +pub const SYS_setns: ::c_long = 375; +pub const SYS_process_vm_readv: ::c_long = 376; +pub const SYS_process_vm_writev: ::c_long = 377; +pub const SYS_kcmp: ::c_long = 378; +pub const SYS_finit_module: ::c_long = 379; +pub const SYS_sched_setattr: ::c_long = 380; +pub const SYS_sched_getattr: ::c_long = 381; +pub const SYS_renameat2: ::c_long = 382; +pub const SYS_seccomp: ::c_long = 383; +pub const SYS_getrandom: ::c_long = 384; +pub const SYS_memfd_create: ::c_long = 385; +pub const SYS_bpf: ::c_long = 386; +pub const SYS_execveat: ::c_long = 387; +pub const SYS_userfaultfd: ::c_long = 388; +pub const SYS_membarrier: ::c_long = 389; +pub const SYS_mlock2: ::c_long = 390; +pub const SYS_copy_file_range: ::c_long = 391; +pub const SYS_preadv2: ::c_long = 392; +pub const SYS_pwritev2: ::c_long = 393; +pub const SYS_pkey_mprotect: ::c_long = 394; +pub const SYS_pkey_alloc: ::c_long = 395; +pub const SYS_pkey_free: ::c_long = 396; + +// offsets in mcontext_t.gregs from sys/ucontext.h +pub const REG_R0: ::c_int = 0; +pub const REG_R1: ::c_int = 1; +pub const REG_R2: ::c_int = 2; +pub const REG_R3: ::c_int = 3; +pub const REG_R4: ::c_int = 4; +pub const REG_R5: ::c_int = 5; +pub const REG_R6: ::c_int = 6; +pub const REG_R7: ::c_int = 7; +pub const REG_R8: ::c_int = 8; +pub const REG_R9: ::c_int = 9; +pub const REG_R10: ::c_int = 10; +pub const REG_R11: ::c_int = 11; +pub const REG_R12: ::c_int = 12; +pub const REG_R13: ::c_int = 13; +pub const REG_R14: ::c_int = 14; +pub const REG_R15: ::c_int = 15; + +pub const NGREG: ::c_int = 18; + +f! { + // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not + // exposed by the libc. As work-around, we implement it through `syscall` + // directly. This workaround can be removed if the minimum version of + // Android is bumped. When the workaround is removed, `accept4` can be + // moved back to `linux_like/mod.rs` + pub fn accept4( + fd: ::c_int, + addr: *mut ::sockaddr, + len: *mut ::socklen_t, + flg: ::c_int + ) -> ::c_int { + ::syscall(SYS_accept4, fd, addr, len, flg) as ::c_int + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..1f4f796f2a94a543c968a9aed6592c49c91f6840 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/mod.rs @@ -0,0 +1,244 @@ +// The following definitions are correct for arm and i686, +// but may be wrong for mips + +pub type c_long = i32; +pub type c_ulong = u32; +pub type mode_t = u16; +pub type off64_t = ::c_longlong; +pub type sigset_t = ::c_ulong; +pub type socklen_t = i32; +pub type time64_t = i64; +pub type __u64 = ::c_ulonglong; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct rlimit64 { + pub rlim_cur: u64, + pub rlim_max: u64, + } + + pub struct stat { + pub st_dev: ::c_ulonglong, + __pad0: [::c_uchar; 4], + __st_ino: ::ino_t, + pub st_mode: ::c_uint, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::c_ulonglong, + __pad3: [::c_uchar; 4], + pub st_size: ::c_longlong, + pub st_blksize: ::blksize_t, + pub st_blocks: ::c_ulonglong, + pub st_atime: ::c_long, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::c_long, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::c_long, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::c_ulonglong, + } + + pub struct stat64 { + pub st_dev: ::c_ulonglong, + __pad0: [::c_uchar; 4], + __st_ino: ::ino_t, + pub st_mode: ::c_uint, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::c_ulonglong, + __pad3: [::c_uchar; 4], + pub st_size: ::c_longlong, + pub st_blksize: ::blksize_t, + pub st_blocks: ::c_ulonglong, + pub st_atime: ::c_long, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::c_long, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::c_long, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::c_ulonglong, + } + + pub struct statfs64 { + pub f_type: u32, + pub f_bsize: u32, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::__fsid_t, + pub f_namelen: u32, + pub f_frsize: u32, + pub f_flags: u32, + pub f_spare: [u32; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::c_ulong, + pub f_bfree: ::c_ulong, + pub f_bavail: ::c_ulong, + pub f_files: ::c_ulong, + pub f_ffree: ::c_ulong, + pub f_favail: ::c_ulong, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + } + + pub struct pthread_attr_t { + pub flags: u32, + pub stack_base: *mut ::c_void, + pub stack_size: ::size_t, + pub guard_size: ::size_t, + pub sched_policy: i32, + pub sched_priority: i32, + } + + pub struct pthread_mutex_t { value: ::c_int } + + pub struct pthread_cond_t { value: ::c_int } + + pub struct pthread_rwlock_t { + lock: pthread_mutex_t, + cond: pthread_cond_t, + numLocks: ::c_int, + writerThreadId: ::c_int, + pendingReaders: ::c_int, + pendingWriters: ::c_int, + attr: i32, + __reserved: [::c_char; 12], + } + + pub struct pthread_barrier_t { + __private: [i32; 8], + } + + pub struct pthread_spinlock_t { + __private: [i32; 2], + } + + pub struct passwd { + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char, + } + + pub struct statfs { + pub f_type: u32, + pub f_bsize: u32, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::__fsid_t, + pub f_namelen: u32, + pub f_frsize: u32, + pub f_flags: u32, + pub f_spare: [u32; 4], + } + + pub struct sysinfo { + pub uptime: ::c_long, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, + pub freeram: ::c_ulong, + pub sharedram: ::c_ulong, + pub bufferram: ::c_ulong, + pub totalswap: ::c_ulong, + pub freeswap: ::c_ulong, + pub procs: ::c_ushort, + pub pad: ::c_ushort, + pub totalhigh: ::c_ulong, + pub freehigh: ::c_ulong, + pub mem_unit: ::c_uint, + pub _f: [::c_char; 8], + } +} + +s_no_extra_traits! { + pub struct sigset64_t { + __bits: [::c_ulong; 2] + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl ::fmt::Debug for sigset64_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigset64_t") + .field("__bits", &self.__bits) + .finish() + } + } + } +} + +// These constants must be of the same type of sigaction.sa_flags +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; + +pub const RTLD_GLOBAL: ::c_int = 2; +pub const RTLD_NOW: ::c_int = 0; +pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void; + +pub const PTRACE_GETFPREGS: ::c_int = 14; +pub const PTRACE_SETFPREGS: ::c_int = 15; + +pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { value: 0 }; +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { value: 0 }; +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + lock: PTHREAD_MUTEX_INITIALIZER, + cond: PTHREAD_COND_INITIALIZER, + numLocks: 0, + writerThreadId: 0, + pendingReaders: 0, + pendingWriters: 0, + attr: 0, + __reserved: [0; 12], +}; +pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 2; +pub const CPU_SETSIZE: ::size_t = 32; +pub const __CPU_BITS: ::size_t = 32; + +pub const UT_LINESIZE: usize = 8; +pub const UT_NAMESIZE: usize = 8; +pub const UT_HOSTSIZE: usize = 16; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +extern "C" { + pub fn timegm64(tm: *const ::tm) -> ::time64_t; +} + +cfg_if! { + if #[cfg(target_arch = "x86")] { + mod x86; + pub use self::x86::*; + } else if #[cfg(target_arch = "arm")] { + mod arm; + pub use self::arm::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/x86/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/x86/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..04df4a05d19b71c0f18360daf8b8dcd0ce5a4d41 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/x86/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(8))] + pub struct max_align_t { + priv_: [f64; 2] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..6507cb4e07da3bbc59c3d2f7f753000820e0006c --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b32/x86/mod.rs @@ -0,0 +1,611 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type greg_t = i32; + +s! { + pub struct _libc_fpreg { + pub significand: [u16; 4], + pub exponent: u16, + } + + pub struct _libc_fpstate { + pub cw: ::c_ulong, + pub sw: ::c_ulong, + pub tag: ::c_ulong, + pub ipoff: ::c_ulong, + pub cssel: ::c_ulong, + pub dataoff: ::c_ulong, + pub datasel: ::c_ulong, + pub _st: [_libc_fpreg; 8], + pub status: ::c_ulong, + } + + pub struct mcontext_t { + pub gregs: [greg_t; 19], + pub fpregs: *mut _libc_fpstate, + pub oldmask: ::c_ulong, + pub cr2: ::c_ulong, + } +} + +cfg_if! { + if #[cfg(libc_union)] { + s_no_extra_traits! { + pub struct __c_anonymous_uc_sigmask_with_padding { + pub uc_sigmask: ::sigset_t, + /* Android has a wrong (smaller) sigset_t on x86. */ + __padding_rt_sigset: u32, + } + + pub union __c_anonymous_uc_sigmask { + uc_sigmask: __c_anonymous_uc_sigmask_with_padding, + uc_sigmask64: ::sigset64_t, + } + + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask__c_anonymous_union: __c_anonymous_uc_sigmask, + __padding_rt_sigset: u32, + __fpregs_mem: _libc_fpstate, + } + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for __c_anonymous_uc_sigmask_with_padding { + fn eq( + &self, other: &__c_anonymous_uc_sigmask_with_padding + ) -> bool { + self.uc_sigmask == other.uc_sigmask + // Ignore padding + } + } + impl Eq for __c_anonymous_uc_sigmask_with_padding {} + impl ::fmt::Debug for __c_anonymous_uc_sigmask_with_padding { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("uc_sigmask_with_padding") + .field("uc_sigmask_with_padding", &self.uc_sigmask) + // Ignore padding + .finish() + } + } + impl ::hash::Hash for __c_anonymous_uc_sigmask_with_padding { + fn hash(&self, state: &mut H) { + self.uc_sigmask.hash(state) + // Ignore padding + } + } + + impl PartialEq for __c_anonymous_uc_sigmask { + fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool { + unsafe { self.uc_sigmask == other.uc_sigmask } + } + } + impl Eq for __c_anonymous_uc_sigmask {} + impl ::fmt::Debug for __c_anonymous_uc_sigmask { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("uc_sigmask") + .field("uc_sigmask", unsafe { &self.uc_sigmask }) + .finish() + } + } + impl ::hash::Hash for __c_anonymous_uc_sigmask { + fn hash(&self, state: &mut H) { + unsafe { self.uc_sigmask.hash(state) } + } + } + + impl PartialEq for ucontext_t { + fn eq(&self, other: &Self) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_sigmask__c_anonymous_union + == other.uc_sigmask__c_anonymous_union + // Ignore padding field + } + } + impl Eq for ucontext_t {} + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_flags) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field( + "uc_sigmask__c_anonymous_union", + &self.uc_sigmask__c_anonymous_union + ) + // Ignore padding field + .finish() + } + } + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + self.uc_sigmask__c_anonymous_union.hash(state); + // Ignore padding field + } + } + } + } + } +} + +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; +pub const O_LARGEFILE: ::c_int = 0o0100000; + +pub const MAP_32BIT: ::c_int = 0x40; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_waitpid: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_time: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_break: ::c_long = 17; +pub const SYS_oldstat: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_stime: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_oldfstat: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_stty: ::c_long = 31; +pub const SYS_gtty: ::c_long = 32; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_ftime: ::c_long = 35; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_prof: ::c_long = 44; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_lock: ::c_long = 53; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_mpx: ::c_long = 56; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_ulimit: ::c_long = 58; +pub const SYS_oldolduname: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sgetmask: ::c_long = 68; +pub const SYS_ssetmask: ::c_long = 69; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrlimit: ::c_long = 76; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_select: ::c_long = 82; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_oldlstat: ::c_long = 84; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_profil: ::c_long = 98; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_ioperm: ::c_long = 101; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_olduname: ::c_long = 109; +pub const SYS_iopl: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_vm86old: ::c_long = 113; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_modify_ldt: ::c_long = 123; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +// FIXME: SYS__llseek is in the NDK sources but for some reason is +// not available in the tests +// pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +// FIXME: SYS__newselect is in the NDK sources but for some reason is +// not available in the tests +// pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +// FIXME: SYS__llseek is in the NDK sources but for some reason is +// not available in the tests +// pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_vm86: ::c_long = 166; +pub const SYS_query_module: ::c_long = 167; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_chown: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_getpmsg: ::c_long = 188; +pub const SYS_putpmsg: ::c_long = 189; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_ugetrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_lchown32: ::c_long = 198; +pub const SYS_getuid32: ::c_long = 199; +pub const SYS_getgid32: ::c_long = 200; +pub const SYS_geteuid32: ::c_long = 201; +pub const SYS_getegid32: ::c_long = 202; +pub const SYS_setreuid32: ::c_long = 203; +pub const SYS_setregid32: ::c_long = 204; +pub const SYS_getgroups32: ::c_long = 205; +pub const SYS_setgroups32: ::c_long = 206; +pub const SYS_fchown32: ::c_long = 207; +pub const SYS_setresuid32: ::c_long = 208; +pub const SYS_getresuid32: ::c_long = 209; +pub const SYS_setresgid32: ::c_long = 210; +pub const SYS_getresgid32: ::c_long = 211; +pub const SYS_chown32: ::c_long = 212; +pub const SYS_setuid32: ::c_long = 213; +pub const SYS_setgid32: ::c_long = 214; +pub const SYS_setfsuid32: ::c_long = 215; +pub const SYS_setfsgid32: ::c_long = 216; +pub const SYS_pivot_root: ::c_long = 217; +pub const SYS_mincore: ::c_long = 218; +pub const SYS_madvise: ::c_long = 219; +pub const SYS_getdents64: ::c_long = 220; +pub const SYS_fcntl64: ::c_long = 221; +pub const SYS_gettid: ::c_long = 224; +pub const SYS_readahead: ::c_long = 225; +pub const SYS_setxattr: ::c_long = 226; +pub const SYS_lsetxattr: ::c_long = 227; +pub const SYS_fsetxattr: ::c_long = 228; +pub const SYS_getxattr: ::c_long = 229; +pub const SYS_lgetxattr: ::c_long = 230; +pub const SYS_fgetxattr: ::c_long = 231; +pub const SYS_listxattr: ::c_long = 232; +pub const SYS_llistxattr: ::c_long = 233; +pub const SYS_flistxattr: ::c_long = 234; +pub const SYS_removexattr: ::c_long = 235; +pub const SYS_lremovexattr: ::c_long = 236; +pub const SYS_fremovexattr: ::c_long = 237; +pub const SYS_tkill: ::c_long = 238; +pub const SYS_sendfile64: ::c_long = 239; +pub const SYS_futex: ::c_long = 240; +pub const SYS_sched_setaffinity: ::c_long = 241; +pub const SYS_sched_getaffinity: ::c_long = 242; +pub const SYS_set_thread_area: ::c_long = 243; +pub const SYS_get_thread_area: ::c_long = 244; +pub const SYS_io_setup: ::c_long = 245; +pub const SYS_io_destroy: ::c_long = 246; +pub const SYS_io_getevents: ::c_long = 247; +pub const SYS_io_submit: ::c_long = 248; +pub const SYS_io_cancel: ::c_long = 249; +pub const SYS_fadvise64: ::c_long = 250; +pub const SYS_exit_group: ::c_long = 252; +pub const SYS_lookup_dcookie: ::c_long = 253; +pub const SYS_epoll_create: ::c_long = 254; +pub const SYS_epoll_ctl: ::c_long = 255; +pub const SYS_epoll_wait: ::c_long = 256; +pub const SYS_remap_file_pages: ::c_long = 257; +pub const SYS_set_tid_address: ::c_long = 258; +pub const SYS_timer_create: ::c_long = 259; +pub const SYS_timer_settime: ::c_long = 260; +pub const SYS_timer_gettime: ::c_long = 261; +pub const SYS_timer_getoverrun: ::c_long = 262; +pub const SYS_timer_delete: ::c_long = 263; +pub const SYS_clock_settime: ::c_long = 264; +pub const SYS_clock_gettime: ::c_long = 265; +pub const SYS_clock_getres: ::c_long = 266; +pub const SYS_clock_nanosleep: ::c_long = 267; +pub const SYS_statfs64: ::c_long = 268; +pub const SYS_fstatfs64: ::c_long = 269; +pub const SYS_tgkill: ::c_long = 270; +pub const SYS_utimes: ::c_long = 271; +pub const SYS_fadvise64_64: ::c_long = 272; +pub const SYS_vserver: ::c_long = 273; +pub const SYS_mbind: ::c_long = 274; +pub const SYS_get_mempolicy: ::c_long = 275; +pub const SYS_set_mempolicy: ::c_long = 276; +pub const SYS_mq_open: ::c_long = 277; +pub const SYS_mq_unlink: ::c_long = 278; +pub const SYS_mq_timedsend: ::c_long = 279; +pub const SYS_mq_timedreceive: ::c_long = 280; +pub const SYS_mq_notify: ::c_long = 281; +pub const SYS_mq_getsetattr: ::c_long = 282; +pub const SYS_kexec_load: ::c_long = 283; +pub const SYS_waitid: ::c_long = 284; +pub const SYS_add_key: ::c_long = 286; +pub const SYS_request_key: ::c_long = 287; +pub const SYS_keyctl: ::c_long = 288; +pub const SYS_ioprio_set: ::c_long = 289; +pub const SYS_ioprio_get: ::c_long = 290; +pub const SYS_inotify_init: ::c_long = 291; +pub const SYS_inotify_add_watch: ::c_long = 292; +pub const SYS_inotify_rm_watch: ::c_long = 293; +pub const SYS_migrate_pages: ::c_long = 294; +pub const SYS_openat: ::c_long = 295; +pub const SYS_mkdirat: ::c_long = 296; +pub const SYS_mknodat: ::c_long = 297; +pub const SYS_fchownat: ::c_long = 298; +pub const SYS_futimesat: ::c_long = 299; +pub const SYS_fstatat64: ::c_long = 300; +pub const SYS_unlinkat: ::c_long = 301; +pub const SYS_renameat: ::c_long = 302; +pub const SYS_linkat: ::c_long = 303; +pub const SYS_symlinkat: ::c_long = 304; +pub const SYS_readlinkat: ::c_long = 305; +pub const SYS_fchmodat: ::c_long = 306; +pub const SYS_faccessat: ::c_long = 307; +pub const SYS_pselect6: ::c_long = 308; +pub const SYS_ppoll: ::c_long = 309; +pub const SYS_unshare: ::c_long = 310; +pub const SYS_set_robust_list: ::c_long = 311; +pub const SYS_get_robust_list: ::c_long = 312; +pub const SYS_splice: ::c_long = 313; +pub const SYS_sync_file_range: ::c_long = 314; +pub const SYS_tee: ::c_long = 315; +pub const SYS_vmsplice: ::c_long = 316; +pub const SYS_move_pages: ::c_long = 317; +pub const SYS_getcpu: ::c_long = 318; +pub const SYS_epoll_pwait: ::c_long = 319; +pub const SYS_utimensat: ::c_long = 320; +pub const SYS_signalfd: ::c_long = 321; +pub const SYS_timerfd_create: ::c_long = 322; +pub const SYS_eventfd: ::c_long = 323; +pub const SYS_fallocate: ::c_long = 324; +pub const SYS_timerfd_settime: ::c_long = 325; +pub const SYS_timerfd_gettime: ::c_long = 326; +pub const SYS_signalfd4: ::c_long = 327; +pub const SYS_eventfd2: ::c_long = 328; +pub const SYS_epoll_create1: ::c_long = 329; +pub const SYS_dup3: ::c_long = 330; +pub const SYS_pipe2: ::c_long = 331; +pub const SYS_inotify_init1: ::c_long = 332; +pub const SYS_preadv: ::c_long = 333; +pub const SYS_pwritev: ::c_long = 334; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 335; +pub const SYS_perf_event_open: ::c_long = 336; +pub const SYS_recvmmsg: ::c_long = 337; +pub const SYS_fanotify_init: ::c_long = 338; +pub const SYS_fanotify_mark: ::c_long = 339; +pub const SYS_prlimit64: ::c_long = 340; +pub const SYS_name_to_handle_at: ::c_long = 341; +pub const SYS_open_by_handle_at: ::c_long = 342; +pub const SYS_clock_adjtime: ::c_long = 343; +pub const SYS_syncfs: ::c_long = 344; +pub const SYS_sendmmsg: ::c_long = 345; +pub const SYS_setns: ::c_long = 346; +pub const SYS_process_vm_readv: ::c_long = 347; +pub const SYS_process_vm_writev: ::c_long = 348; +pub const SYS_kcmp: ::c_long = 349; +pub const SYS_finit_module: ::c_long = 350; +pub const SYS_sched_setattr: ::c_long = 351; +pub const SYS_sched_getattr: ::c_long = 352; +pub const SYS_renameat2: ::c_long = 353; +pub const SYS_seccomp: ::c_long = 354; +pub const SYS_getrandom: ::c_long = 355; +pub const SYS_memfd_create: ::c_long = 356; +pub const SYS_bpf: ::c_long = 357; +pub const SYS_execveat: ::c_long = 358; +pub const SYS_socket: ::c_long = 359; +pub const SYS_socketpair: ::c_long = 360; +pub const SYS_bind: ::c_long = 361; +pub const SYS_connect: ::c_long = 362; +pub const SYS_listen: ::c_long = 363; +pub const SYS_accept4: ::c_long = 364; +pub const SYS_getsockopt: ::c_long = 365; +pub const SYS_setsockopt: ::c_long = 366; +pub const SYS_getsockname: ::c_long = 367; +pub const SYS_getpeername: ::c_long = 368; +pub const SYS_sendto: ::c_long = 369; +pub const SYS_sendmsg: ::c_long = 370; +pub const SYS_recvfrom: ::c_long = 371; +pub const SYS_recvmsg: ::c_long = 372; +pub const SYS_shutdown: ::c_long = 373; +pub const SYS_userfaultfd: ::c_long = 374; +pub const SYS_membarrier: ::c_long = 375; +pub const SYS_mlock2: ::c_long = 376; +pub const SYS_copy_file_range: ::c_long = 377; +pub const SYS_preadv2: ::c_long = 378; +pub const SYS_pwritev2: ::c_long = 379; +pub const SYS_pkey_mprotect: ::c_long = 380; +pub const SYS_pkey_alloc: ::c_long = 381; +pub const SYS_pkey_free: ::c_long = 382; + +// offsets in user_regs_structs, from sys/reg.h +pub const EBX: ::c_int = 0; +pub const ECX: ::c_int = 1; +pub const EDX: ::c_int = 2; +pub const ESI: ::c_int = 3; +pub const EDI: ::c_int = 4; +pub const EBP: ::c_int = 5; +pub const EAX: ::c_int = 6; +pub const DS: ::c_int = 7; +pub const ES: ::c_int = 8; +pub const FS: ::c_int = 9; +pub const GS: ::c_int = 10; +pub const ORIG_EAX: ::c_int = 11; +pub const EIP: ::c_int = 12; +pub const CS: ::c_int = 13; +pub const EFL: ::c_int = 14; +pub const UESP: ::c_int = 15; +pub const SS: ::c_int = 16; + +// offsets in mcontext_t.gregs from sys/ucontext.h +pub const REG_GS: ::c_int = 0; +pub const REG_FS: ::c_int = 1; +pub const REG_ES: ::c_int = 2; +pub const REG_DS: ::c_int = 3; +pub const REG_EDI: ::c_int = 4; +pub const REG_ESI: ::c_int = 5; +pub const REG_EBP: ::c_int = 6; +pub const REG_ESP: ::c_int = 7; +pub const REG_EBX: ::c_int = 8; +pub const REG_EDX: ::c_int = 9; +pub const REG_ECX: ::c_int = 10; +pub const REG_EAX: ::c_int = 11; +pub const REG_TRAPNO: ::c_int = 12; +pub const REG_ERR: ::c_int = 13; +pub const REG_EIP: ::c_int = 14; +pub const REG_CS: ::c_int = 15; +pub const REG_EFL: ::c_int = 16; +pub const REG_UESP: ::c_int = 17; +pub const REG_SS: ::c_int = 18; + +// socketcall values from linux/net.h (only the needed ones, and not public) +const SYS_ACCEPT4: ::c_int = 18; + +f! { + // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not + // exposed by the libc. As work-around, we implement it as raw syscall. + // Note that for x86, the `accept4` syscall is not available either, + // and we must use the `socketcall` syscall instead. + // This workaround can be removed if the minimum Android version is bumped. + // When the workaround is removed, `accept4` can be moved back + // to `linux_like/mod.rs` + pub fn accept4( + fd: ::c_int, + addr: *mut ::sockaddr, + len: *mut ::socklen_t, + flg: ::c_int + ) -> ::c_int { + // Arguments are passed as array of `long int` + // (which is big enough on x86 for a pointer). + let mut args = [ + fd as ::c_long, + addr as ::c_long, + len as ::c_long, + flg as ::c_long, + ]; + ::syscall(SYS_socketcall, SYS_ACCEPT4, args[..].as_mut_ptr()) + } +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..154c2c54ce6deb78622883e3805113698588e374 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/aarch64/align.rs @@ -0,0 +1,29 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f32; 8] + } +} + +s! { + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: mcontext_t, + } + + #[repr(align(16))] + pub struct mcontext_t { + pub fault_address: ::c_ulonglong, + pub regs: [::c_ulonglong; 31], + pub sp: ::c_ulonglong, + pub pc: ::c_ulonglong, + pub pstate: ::c_ulonglong, + // nested arrays to get the right size/length while being able to + // auto-derive traits like Debug + __reserved: [[u64; 32]; 16], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs new file mode 100644 index 0000000000000000000000000000000000000000..4535e73eeddf150890f9ca316e2d64859f5f2aa4 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/aarch64/int128.rs @@ -0,0 +1,7 @@ +s! { + pub struct user_fpsimd_struct { + pub vregs: [::__uint128_t; 32], + pub fpsr: u32, + pub fpcr: u32, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..c4d442060028380decc7b12304e5f2c2397a945a --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/aarch64/mod.rs @@ -0,0 +1,391 @@ +pub type c_char = u8; +pub type wchar_t = u32; +pub type __u64 = ::c_ulonglong; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::c_uint, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad1: ::c_ulong, + pub st_size: ::off64_t, + pub st_blksize: ::c_int, + __pad2: ::c_int, + pub st_blocks: ::c_long, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused4: ::c_uint, + __unused5: ::c_uint, + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::c_uint, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad1: ::c_ulong, + pub st_size: ::off64_t, + pub st_blksize: ::c_int, + __pad2: ::c_int, + pub st_blocks: ::c_long, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused4: ::c_uint, + __unused5: ::c_uint, + } + + pub struct user_regs_struct { + pub regs: [u64; 31], + pub sp: u64, + pub pc: u64, + pub pstate: u64, + } +} + +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_LARGEFILE: ::c_int = 0o400000; + +pub const SIGSTKSZ: ::size_t = 16384; +pub const MINSIGSTKSZ: ::size_t = 5120; + +// From NDK's asm/hwcap.h +pub const HWCAP_FP: ::c_ulong = 1 << 0; +pub const HWCAP_ASIMD: ::c_ulong = 1 << 1; +pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2; +pub const HWCAP_AES: ::c_ulong = 1 << 3; +pub const HWCAP_PMULL: ::c_ulong = 1 << 4; +pub const HWCAP_SHA1: ::c_ulong = 1 << 5; +pub const HWCAP_SHA2: ::c_ulong = 1 << 6; +pub const HWCAP_CRC32: ::c_ulong = 1 << 7; +pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8; +pub const HWCAP_FPHP: ::c_ulong = 1 << 9; +pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10; +pub const HWCAP_CPUID: ::c_ulong = 1 << 11; +pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12; +pub const HWCAP_JSCVT: ::c_ulong = 1 << 13; +pub const HWCAP_FCMA: ::c_ulong = 1 << 14; +pub const HWCAP_LRCPC: ::c_ulong = 1 << 15; +pub const HWCAP_DCPOP: ::c_ulong = 1 << 16; +pub const HWCAP_SHA3: ::c_ulong = 1 << 17; +pub const HWCAP_SM3: ::c_ulong = 1 << 18; +pub const HWCAP_SM4: ::c_ulong = 1 << 19; +pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20; +pub const HWCAP_SHA512: ::c_ulong = 1 << 21; +pub const HWCAP_SVE: ::c_ulong = 1 << 22; +pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23; +pub const HWCAP_DIT: ::c_ulong = 1 << 24; +pub const HWCAP_USCAT: ::c_ulong = 1 << 25; +pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26; +pub const HWCAP_FLAGM: ::c_ulong = 1 << 27; +pub const HWCAP_SSBS: ::c_ulong = 1 << 28; +pub const HWCAP_SB: ::c_ulong = 1 << 29; +pub const HWCAP_PACA: ::c_ulong = 1 << 30; +pub const HWCAP_PACG: ::c_ulong = 1 << 31; +pub const HWCAP2_DCPODP: ::c_ulong = 1 << 0; +pub const HWCAP2_SVE2: ::c_ulong = 1 << 1; +pub const HWCAP2_SVEAES: ::c_ulong = 1 << 2; +pub const HWCAP2_SVEPMULL: ::c_ulong = 1 << 3; +pub const HWCAP2_SVEBITPERM: ::c_ulong = 1 << 4; +pub const HWCAP2_SVESHA3: ::c_ulong = 1 << 5; +pub const HWCAP2_SVESM4: ::c_ulong = 1 << 6; +pub const HWCAP2_FLAGM2: ::c_ulong = 1 << 7; +pub const HWCAP2_FRINT: ::c_ulong = 1 << 8; + +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_dup: ::c_long = 23; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_fcntl: ::c_long = 25; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_flock: ::c_long = 32; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_renameat: ::c_long = 38; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_mount: ::c_long = 40; +pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_openat: ::c_long = 56; +pub const SYS_close: ::c_long = 57; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_sync: ::c_long = 81; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_acct: ::c_long = 89; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_personality: ::c_long = 92; +pub const SYS_exit: ::c_long = 93; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_futex: ::c_long = 98; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_kill: ::c_long = 129; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_times: ::c_long = 153; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_uname: ::c_long = 160; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_umask: ::c_long = 166; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_getegid: ::c_long = 177; +pub const SYS_gettid: ::c_long = 178; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_semop: ::c_long = 193; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_socket: ::c_long = 198; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_accept: ::c_long = 202; +pub const SYS_connect: ::c_long = 203; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_brk: ::c_long = 214; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; +pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_arch_specific_syscall: ::c_long = 244; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_setns: ::c_long = 268; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; +pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_syscalls: ::c_long = 436; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} + +cfg_if! { + if #[cfg(libc_int128)] { + mod int128; + pub use self::int128::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..67d0dacf17e93b1523d1ea5006eb9555bd77a05e --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/mod.rs @@ -0,0 +1,355 @@ +// The following definitions are correct for aarch64 and x86_64, +// but may be wrong for mips64 + +pub type c_long = i64; +pub type c_ulong = u64; +pub type mode_t = u32; +pub type off64_t = i64; +pub type socklen_t = u32; + +s! { + pub struct sigset_t { + __val: [::c_ulong; 1], + } + + pub struct sigaction { + pub sa_flags: ::c_int, + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_restorer: ::Option, + } + + pub struct rlimit64 { + pub rlim_cur: ::c_ulonglong, + pub rlim_max: ::c_ulonglong, + } + + pub struct pthread_attr_t { + pub flags: u32, + pub stack_base: *mut ::c_void, + pub stack_size: ::size_t, + pub guard_size: ::size_t, + pub sched_policy: i32, + pub sched_priority: i32, + __reserved: [::c_char; 16], + } + + pub struct passwd { + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_gecos: *mut ::c_char, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char, + } + + pub struct statfs { + pub f_type: u64, + pub f_bsize: u64, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::__fsid_t, + pub f_namelen: u64, + pub f_frsize: u64, + pub f_flags: u64, + pub f_spare: [u64; 4], + } + + pub struct sysinfo { + pub uptime: ::c_long, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, + pub freeram: ::c_ulong, + pub sharedram: ::c_ulong, + pub bufferram: ::c_ulong, + pub totalswap: ::c_ulong, + pub freeswap: ::c_ulong, + pub procs: ::c_ushort, + pub pad: ::c_ushort, + pub totalhigh: ::c_ulong, + pub freehigh: ::c_ulong, + pub mem_unit: ::c_uint, + pub _f: [::c_char; 0], + } + + pub struct statfs64 { + pub f_type: u64, + pub f_bsize: u64, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::__fsid_t, + pub f_namelen: u64, + pub f_frsize: u64, + pub f_flags: u64, + pub f_spare: [u64; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct pthread_barrier_t { + __private: [i64; 4], + } + + pub struct pthread_spinlock_t { + __private: i64, + } +} + +s_no_extra_traits! { + pub struct pthread_mutex_t { + value: ::c_int, + __reserved: [::c_char; 36], + } + + pub struct pthread_cond_t { + value: ::c_int, + __reserved: [::c_char; 44], + } + + pub struct pthread_rwlock_t { + numLocks: ::c_int, + writerThreadId: ::c_int, + pendingReaders: ::c_int, + pendingWriters: ::c_int, + attr: i32, + __reserved: [::c_char; 36], + } + + pub struct sigset64_t { + __bits: [::c_ulong; 1] + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for pthread_mutex_t { + fn eq(&self, other: &pthread_mutex_t) -> bool { + self.value == other.value + && self + .__reserved + .iter() + .zip(other.__reserved.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for pthread_mutex_t {} + + impl ::fmt::Debug for pthread_mutex_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_mutex_t") + .field("value", &self.value) + // FIXME: .field("__reserved", &self.__reserved) + .finish() + } + } + + impl ::hash::Hash for pthread_mutex_t { + fn hash(&self, state: &mut H) { + self.value.hash(state); + self.__reserved.hash(state); + } + } + + impl PartialEq for pthread_cond_t { + fn eq(&self, other: &pthread_cond_t) -> bool { + self.value == other.value + && self + .__reserved + .iter() + .zip(other.__reserved.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for pthread_cond_t {} + + impl ::fmt::Debug for pthread_cond_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_cond_t") + .field("value", &self.value) + // FIXME: .field("__reserved", &self.__reserved) + .finish() + } + } + + impl ::hash::Hash for pthread_cond_t { + fn hash(&self, state: &mut H) { + self.value.hash(state); + self.__reserved.hash(state); + } + } + + impl PartialEq for pthread_rwlock_t { + fn eq(&self, other: &pthread_rwlock_t) -> bool { + self.numLocks == other.numLocks + && self.writerThreadId == other.writerThreadId + && self.pendingReaders == other.pendingReaders + && self.pendingWriters == other.pendingWriters + && self.attr == other.attr + && self + .__reserved + .iter() + .zip(other.__reserved.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for pthread_rwlock_t {} + + impl ::fmt::Debug for pthread_rwlock_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_rwlock_t") + .field("numLocks", &self.numLocks) + .field("writerThreadId", &self.writerThreadId) + .field("pendingReaders", &self.pendingReaders) + .field("pendingWriters", &self.pendingWriters) + .field("attr", &self.attr) + // FIXME: .field("__reserved", &self.__reserved) + .finish() + } + } + + impl ::hash::Hash for pthread_rwlock_t { + fn hash(&self, state: &mut H) { + self.numLocks.hash(state); + self.writerThreadId.hash(state); + self.pendingReaders.hash(state); + self.pendingWriters.hash(state); + self.attr.hash(state); + self.__reserved.hash(state); + } + } + + impl ::fmt::Debug for sigset64_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigset64_t") + .field("__bits", &self.__bits) + .finish() + } + } + } +} + +// These constants must be of the same type of sigaction.sa_flags +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; + +pub const RTLD_GLOBAL: ::c_int = 0x00100; +pub const RTLD_NOW: ::c_int = 2; +pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; + +// From NDK's linux/auxvec.h +pub const AT_NULL: ::c_ulong = 0; +pub const AT_IGNORE: ::c_ulong = 1; +pub const AT_EXECFD: ::c_ulong = 2; +pub const AT_PHDR: ::c_ulong = 3; +pub const AT_PHENT: ::c_ulong = 4; +pub const AT_PHNUM: ::c_ulong = 5; +pub const AT_PAGESZ: ::c_ulong = 6; +pub const AT_BASE: ::c_ulong = 7; +pub const AT_FLAGS: ::c_ulong = 8; +pub const AT_ENTRY: ::c_ulong = 9; +pub const AT_NOTELF: ::c_ulong = 10; +pub const AT_UID: ::c_ulong = 11; +pub const AT_EUID: ::c_ulong = 12; +pub const AT_GID: ::c_ulong = 13; +pub const AT_EGID: ::c_ulong = 14; +pub const AT_PLATFORM: ::c_ulong = 15; +pub const AT_HWCAP: ::c_ulong = 16; +pub const AT_CLKTCK: ::c_ulong = 17; +pub const AT_SECURE: ::c_ulong = 23; +pub const AT_BASE_PLATFORM: ::c_ulong = 24; +pub const AT_RANDOM: ::c_ulong = 25; +pub const AT_HWCAP2: ::c_ulong = 26; +pub const AT_EXECFN: ::c_ulong = 31; + +pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + value: 0, + __reserved: [0; 36], +}; +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + value: 0, + __reserved: [0; 44], +}; +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + numLocks: 0, + writerThreadId: 0, + pendingReaders: 0, + pendingWriters: 0, + attr: 0, + __reserved: [0; 36], +}; +pub const PTHREAD_STACK_MIN: ::size_t = 4096 * 4; +pub const CPU_SETSIZE: ::size_t = 1024; +pub const __CPU_BITS: ::size_t = 64; + +pub const UT_LINESIZE: usize = 32; +pub const UT_NAMESIZE: usize = 32; +pub const UT_HOSTSIZE: usize = 256; + +f! { + // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not + // exposed by the libc. As work-around, we implement it through `syscall` + // directly. This workaround can be removed if the minimum version of + // Android is bumped. When the workaround is removed, `accept4` can be + // moved back to `linux_like/mod.rs` + pub fn accept4( + fd: ::c_int, + addr: *mut ::sockaddr, + len: *mut ::socklen_t, + flg: ::c_int + ) -> ::c_int { + ::syscall(SYS_accept4, fd, addr, len, flg) as ::c_int + } +} + +extern "C" { + pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; + pub fn __system_property_wait( + pi: *const ::prop_info, + __old_serial: u32, + __new_serial_ptr: *mut u32, + __relative_timeout: *const ::timespec, + ) -> bool; +} + +cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(target_arch = "riscv64")] { + mod riscv64; + pub use self::riscv64::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..8e949963a637fb4b171c1a3649cf6c2ef8d30a1d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/riscv64/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f32; 8] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..2421792cfd4f7aedfc809ac5a04805a1c6c75cb7 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/riscv64/mod.rs @@ -0,0 +1,342 @@ +pub type c_char = i8; +pub type wchar_t = u32; +pub type greg_t = i64; +pub type __u64 = ::c_ulonglong; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::c_uint, + pub st_nlink: ::c_uint, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad1: ::c_ulong, + pub st_size: ::off64_t, + pub st_blksize: ::c_int, + __pad2: ::c_int, + pub st_blocks: ::c_long, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused4: ::c_uint, + __unused5: ::c_uint, + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::c_uint, + pub st_nlink: ::c_uint, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad1: ::c_ulong, + pub st_size: ::off64_t, + pub st_blksize: ::c_int, + __pad2: ::c_int, + pub st_blocks: ::c_long, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused4: ::c_uint, + __unused5: ::c_uint, + } +} + +pub const O_DIRECT: ::c_int = 0x40000; +pub const O_DIRECTORY: ::c_int = 0x200000; +pub const O_NOFOLLOW: ::c_int = 0x400000; +pub const O_LARGEFILE: ::c_int = 0x100000; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +// From NDK's asm/hwcap.h +pub const COMPAT_HWCAP_ISA_I: ::c_ulong = 1 << ('I' - 'A'); +pub const COMPAT_HWCAP_ISA_M: ::c_ulong = 1 << ('M' - 'A'); +pub const COMPAT_HWCAP_ISA_A: ::c_ulong = 1 << ('A' - 'A'); +pub const COMPAT_HWCAP_ISA_F: ::c_ulong = 1 << ('F' - 'A'); +pub const COMPAT_HWCAP_ISA_D: ::c_ulong = 1 << ('D' - 'A'); +pub const COMPAT_HWCAP_ISA_C: ::c_ulong = 1 << ('C' - 'A'); + +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_dup: ::c_long = 23; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_flock: ::c_long = 32; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_renameat: ::c_long = 38; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_mount: ::c_long = 40; +pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_openat: ::c_long = 56; +pub const SYS_close: ::c_long = 57; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_sync: ::c_long = 81; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_acct: ::c_long = 89; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_personality: ::c_long = 92; +pub const SYS_exit: ::c_long = 93; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_futex: ::c_long = 98; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_kill: ::c_long = 129; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_times: ::c_long = 153; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_uname: ::c_long = 160; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_umask: ::c_long = 166; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_getegid: ::c_long = 177; +pub const SYS_gettid: ::c_long = 178; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_semop: ::c_long = 193; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_socket: ::c_long = 198; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_accept: ::c_long = 202; +pub const SYS_connect: ::c_long = 203; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_brk: ::c_long = 214; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; +pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_arch_specific_syscall: ::c_long = 244; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_setns: ::c_long = 268; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; +pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_syscalls: ::c_long = 436; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..7ca870fd02b71e31e44439e3fabdf1386eb75bb9 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/x86_64/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 4] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..d25b50775537cd6048c0ebacecae850cf1cd1959 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/b64/x86_64/mod.rs @@ -0,0 +1,791 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type greg_t = i64; +pub type __u64 = ::c_ulonglong; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::c_ulong, + pub st_mode: ::c_uint, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::c_long, + pub st_blocks: ::c_long, + pub st_atime: ::c_long, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::c_long, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::c_long, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::c_ulong, + pub st_mode: ::c_uint, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::c_long, + pub st_blocks: ::c_long, + pub st_atime: ::c_long, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::c_long, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::c_long, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 3], + } + + pub struct _libc_xmmreg { + pub element: [u32; 4], + } + + pub struct user_regs_struct { + pub r15: ::c_ulong, + pub r14: ::c_ulong, + pub r13: ::c_ulong, + pub r12: ::c_ulong, + pub rbp: ::c_ulong, + pub rbx: ::c_ulong, + pub r11: ::c_ulong, + pub r10: ::c_ulong, + pub r9: ::c_ulong, + pub r8: ::c_ulong, + pub rax: ::c_ulong, + pub rcx: ::c_ulong, + pub rdx: ::c_ulong, + pub rsi: ::c_ulong, + pub rdi: ::c_ulong, + pub orig_rax: ::c_ulong, + pub rip: ::c_ulong, + pub cs: ::c_ulong, + pub eflags: ::c_ulong, + pub rsp: ::c_ulong, + pub ss: ::c_ulong, + pub fs_base: ::c_ulong, + pub gs_base: ::c_ulong, + pub ds: ::c_ulong, + pub es: ::c_ulong, + pub fs: ::c_ulong, + pub gs: ::c_ulong, + } + + pub struct user { + pub regs: user_regs_struct, + pub u_fpvalid: ::c_int, + pub i387: user_fpregs_struct, + pub u_tsize: ::c_ulong, + pub u_dsize: ::c_ulong, + pub u_ssize: ::c_ulong, + pub start_code: ::c_ulong, + pub start_stack: ::c_ulong, + pub signal: ::c_long, + __reserved: ::c_int, + #[cfg(target_pointer_width = "32")] + __pad1: u32, + pub u_ar0: *mut user_regs_struct, + #[cfg(target_pointer_width = "32")] + __pad2: u32, + pub u_fpstate: *mut user_fpregs_struct, + pub magic: ::c_ulong, + pub u_comm: [::c_char; 32], + pub u_debugreg: [::c_ulong; 8], + pub error_code: ::c_ulong, + pub fault_address: ::c_ulong, + } + +} + +cfg_if! { + if #[cfg(libc_union)] { + s_no_extra_traits! { + pub union __c_anonymous_uc_sigmask { + uc_sigmask: ::sigset_t, + uc_sigmask64: ::sigset64_t, + } + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for __c_anonymous_uc_sigmask { + fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool { + unsafe { self.uc_sigmask == other.uc_sigmask } + } + } + impl Eq for __c_anonymous_uc_sigmask {} + impl ::fmt::Debug for __c_anonymous_uc_sigmask { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("uc_sigmask") + .field("uc_sigmask", unsafe { &self.uc_sigmask }) + .finish() + } + } + impl ::hash::Hash for __c_anonymous_uc_sigmask { + fn hash(&self, state: &mut H) { + unsafe { self.uc_sigmask.hash(state) } + } + } + } + } + } +} + +s_no_extra_traits! { + pub struct _libc_fpxreg { + pub significand: [u16; 4], + pub exponent: u16, + __padding: [u16; 3], + } + + pub struct _libc_fpstate { + pub cwd: u16, + pub swd: u16, + pub ftw: u16, + pub fop: u16, + pub rip: u64, + pub rdp: u64, + pub mxcsr: u32, + pub mxcr_mask: u32, + pub _st: [_libc_fpxreg; 8], + pub _xmm: [_libc_xmmreg; 16], + __private: [u32; 24], + } + + pub struct mcontext_t { + pub gregs: [greg_t; 23], + pub fpregs: *mut _libc_fpstate, + __private: [u64; 8], + } + + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask64: __c_anonymous_uc_sigmask, + __fpregs_mem: _libc_fpstate, + } + + pub struct user_fpregs_struct { + pub cwd: ::c_ushort, + pub swd: ::c_ushort, + pub ftw: ::c_ushort, + pub fop: ::c_ushort, + pub rip: ::c_ulong, + pub rdp: ::c_ulong, + pub mxcsr: ::c_uint, + pub mxcr_mask: ::c_uint, + pub st_space: [::c_uint; 32], + pub xmm_space: [::c_uint; 64], + padding: [::c_uint; 24], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for _libc_fpxreg { + fn eq(&self, other: &Self) -> bool { + self.significand == other.significand + && self.exponent == other.exponent + // Ignore padding field + } + } + impl Eq for _libc_fpxreg {} + impl ::fmt::Debug for _libc_fpxreg { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("_libc_fpxreg") + .field("significand", &self.significand) + .field("exponent", &self.exponent) + // Ignore padding field + .finish() + } + } + impl ::hash::Hash for _libc_fpxreg { + fn hash(&self, state: &mut H) { + self.significand.hash(state); + self.exponent.hash(state); + // Ignore padding field + } + } + + impl PartialEq for _libc_fpstate { + fn eq(&self, other: &Self) -> bool { + self.cwd == other.cwd + && self.swd == other.swd + && self.ftw == other.ftw + && self.fop == other.fop + && self.rip == other.rip + && self.rdp == other.rdp + && self.mxcsr == other.mxcsr + && self.mxcr_mask == other.mxcr_mask + && self._st == other._st + && self._xmm == other._xmm + // Ignore padding field + } + } + impl Eq for _libc_fpstate {} + impl ::fmt::Debug for _libc_fpstate { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("_libc_fpstate") + .field("cwd", &self.cwd) + .field("swd", &self.swd) + .field("ftw", &self.ftw) + .field("fop", &self.fop) + .field("rip", &self.rip) + .field("rdp", &self.rdp) + .field("mxcsr", &self.mxcsr) + .field("mxcr_mask", &self.mxcr_mask) + .field("_st", &self._st) + .field("_xmm", &self._xmm) + // Ignore padding field + .finish() + } + } + impl ::hash::Hash for _libc_fpstate { + fn hash(&self, state: &mut H) { + self.cwd.hash(state); + self.swd.hash(state); + self.ftw.hash(state); + self.fop.hash(state); + self.rip.hash(state); + self.rdp.hash(state); + self.mxcsr.hash(state); + self.mxcr_mask.hash(state); + self._st.hash(state); + self._xmm.hash(state); + // Ignore padding field + } + } + + impl PartialEq for mcontext_t { + fn eq(&self, other: &Self) -> bool { + self.gregs == other.gregs + && self.fpregs == other.fpregs + // Ignore padding field + } + } + impl Eq for mcontext_t {} + impl ::fmt::Debug for mcontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mcontext_t") + .field("gregs", &self.gregs) + .field("fpregs", &self.fpregs) + // Ignore padding field + .finish() + } + } + impl ::hash::Hash for mcontext_t { + fn hash(&self, state: &mut H) { + self.gregs.hash(state); + self.fpregs.hash(state); + // Ignore padding field + } + } + + impl PartialEq for ucontext_t { + fn eq(&self, other: &Self) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_sigmask64 == other.uc_sigmask64 + // Ignore padding field + } + } + impl Eq for ucontext_t {} + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_flags) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field("uc_sigmask64", &self.uc_sigmask64) + // Ignore padding field + .finish() + } + } + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + self.uc_sigmask64.hash(state); + // Ignore padding field + } + } + + impl PartialEq for user_fpregs_struct { + fn eq(&self, other: &user_fpregs_struct) -> bool { + self.cwd == other.cwd + && self.swd == other.swd + && self.ftw == other.ftw + && self.fop == other.fop + && self.rip == other.rip + && self.rdp == other.rdp + && self.mxcsr == other.mxcsr + && self.mxcr_mask == other.mxcr_mask + && self.st_space == other.st_space + && self + .xmm_space + .iter() + .zip(other.xmm_space.iter()) + .all(|(a,b)| a == b) + // Ignore padding field + } + } + + impl Eq for user_fpregs_struct {} + + impl ::fmt::Debug for user_fpregs_struct { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("user_fpregs_struct") + .field("cwd", &self.cwd) + .field("swd", &self.swd) + .field("ftw", &self.ftw) + .field("fop", &self.fop) + .field("rip", &self.rip) + .field("rdp", &self.rdp) + .field("mxcsr", &self.mxcsr) + .field("mxcr_mask", &self.mxcr_mask) + .field("st_space", &self.st_space) + // FIXME: .field("xmm_space", &self.xmm_space) + // Ignore padding field + .finish() + } + } + + impl ::hash::Hash for user_fpregs_struct { + fn hash(&self, state: &mut H) { + self.cwd.hash(state); + self.swd.hash(state); + self.ftw.hash(state); + self.fop.hash(state); + self.rip.hash(state); + self.rdp.hash(state); + self.mxcsr.hash(state); + self.mxcr_mask.hash(state); + self.st_space.hash(state); + self.xmm_space.hash(state); + // Ignore padding field + } + } + } +} + +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; +pub const O_LARGEFILE: ::c_int = 0o0100000; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +pub const MAP_32BIT: ::c_int = 0x40; + +// Syscall table + +pub const SYS_read: ::c_long = 0; +pub const SYS_write: ::c_long = 1; +pub const SYS_open: ::c_long = 2; +pub const SYS_close: ::c_long = 3; +pub const SYS_stat: ::c_long = 4; +pub const SYS_fstat: ::c_long = 5; +pub const SYS_lstat: ::c_long = 6; +pub const SYS_poll: ::c_long = 7; +pub const SYS_lseek: ::c_long = 8; +pub const SYS_mmap: ::c_long = 9; +pub const SYS_mprotect: ::c_long = 10; +pub const SYS_munmap: ::c_long = 11; +pub const SYS_brk: ::c_long = 12; +pub const SYS_rt_sigaction: ::c_long = 13; +pub const SYS_rt_sigprocmask: ::c_long = 14; +pub const SYS_rt_sigreturn: ::c_long = 15; +pub const SYS_ioctl: ::c_long = 16; +pub const SYS_pread64: ::c_long = 17; +pub const SYS_pwrite64: ::c_long = 18; +pub const SYS_readv: ::c_long = 19; +pub const SYS_writev: ::c_long = 20; +pub const SYS_access: ::c_long = 21; +pub const SYS_pipe: ::c_long = 22; +pub const SYS_select: ::c_long = 23; +pub const SYS_sched_yield: ::c_long = 24; +pub const SYS_mremap: ::c_long = 25; +pub const SYS_msync: ::c_long = 26; +pub const SYS_mincore: ::c_long = 27; +pub const SYS_madvise: ::c_long = 28; +pub const SYS_shmget: ::c_long = 29; +pub const SYS_shmat: ::c_long = 30; +pub const SYS_shmctl: ::c_long = 31; +pub const SYS_dup: ::c_long = 32; +pub const SYS_dup2: ::c_long = 33; +pub const SYS_pause: ::c_long = 34; +pub const SYS_nanosleep: ::c_long = 35; +pub const SYS_getitimer: ::c_long = 36; +pub const SYS_alarm: ::c_long = 37; +pub const SYS_setitimer: ::c_long = 38; +pub const SYS_getpid: ::c_long = 39; +pub const SYS_sendfile: ::c_long = 40; +pub const SYS_socket: ::c_long = 41; +pub const SYS_connect: ::c_long = 42; +pub const SYS_accept: ::c_long = 43; +pub const SYS_sendto: ::c_long = 44; +pub const SYS_recvfrom: ::c_long = 45; +pub const SYS_sendmsg: ::c_long = 46; +pub const SYS_recvmsg: ::c_long = 47; +pub const SYS_shutdown: ::c_long = 48; +pub const SYS_bind: ::c_long = 49; +pub const SYS_listen: ::c_long = 50; +pub const SYS_getsockname: ::c_long = 51; +pub const SYS_getpeername: ::c_long = 52; +pub const SYS_socketpair: ::c_long = 53; +pub const SYS_setsockopt: ::c_long = 54; +pub const SYS_getsockopt: ::c_long = 55; +pub const SYS_clone: ::c_long = 56; +pub const SYS_fork: ::c_long = 57; +pub const SYS_vfork: ::c_long = 58; +pub const SYS_execve: ::c_long = 59; +pub const SYS_exit: ::c_long = 60; +pub const SYS_wait4: ::c_long = 61; +pub const SYS_kill: ::c_long = 62; +pub const SYS_uname: ::c_long = 63; +pub const SYS_semget: ::c_long = 64; +pub const SYS_semop: ::c_long = 65; +pub const SYS_semctl: ::c_long = 66; +pub const SYS_shmdt: ::c_long = 67; +pub const SYS_msgget: ::c_long = 68; +pub const SYS_msgsnd: ::c_long = 69; +pub const SYS_msgrcv: ::c_long = 70; +pub const SYS_msgctl: ::c_long = 71; +pub const SYS_fcntl: ::c_long = 72; +pub const SYS_flock: ::c_long = 73; +pub const SYS_fsync: ::c_long = 74; +pub const SYS_fdatasync: ::c_long = 75; +pub const SYS_truncate: ::c_long = 76; +pub const SYS_ftruncate: ::c_long = 77; +pub const SYS_getdents: ::c_long = 78; +pub const SYS_getcwd: ::c_long = 79; +pub const SYS_chdir: ::c_long = 80; +pub const SYS_fchdir: ::c_long = 81; +pub const SYS_rename: ::c_long = 82; +pub const SYS_mkdir: ::c_long = 83; +pub const SYS_rmdir: ::c_long = 84; +pub const SYS_creat: ::c_long = 85; +pub const SYS_link: ::c_long = 86; +pub const SYS_unlink: ::c_long = 87; +pub const SYS_symlink: ::c_long = 88; +pub const SYS_readlink: ::c_long = 89; +pub const SYS_chmod: ::c_long = 90; +pub const SYS_fchmod: ::c_long = 91; +pub const SYS_chown: ::c_long = 92; +pub const SYS_fchown: ::c_long = 93; +pub const SYS_lchown: ::c_long = 94; +pub const SYS_umask: ::c_long = 95; +pub const SYS_gettimeofday: ::c_long = 96; +pub const SYS_getrlimit: ::c_long = 97; +pub const SYS_getrusage: ::c_long = 98; +pub const SYS_sysinfo: ::c_long = 99; +pub const SYS_times: ::c_long = 100; +pub const SYS_ptrace: ::c_long = 101; +pub const SYS_getuid: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_getgid: ::c_long = 104; +pub const SYS_setuid: ::c_long = 105; +pub const SYS_setgid: ::c_long = 106; +pub const SYS_geteuid: ::c_long = 107; +pub const SYS_getegid: ::c_long = 108; +pub const SYS_setpgid: ::c_long = 109; +pub const SYS_getppid: ::c_long = 110; +pub const SYS_getpgrp: ::c_long = 111; +pub const SYS_setsid: ::c_long = 112; +pub const SYS_setreuid: ::c_long = 113; +pub const SYS_setregid: ::c_long = 114; +pub const SYS_getgroups: ::c_long = 115; +pub const SYS_setgroups: ::c_long = 116; +pub const SYS_setresuid: ::c_long = 117; +pub const SYS_getresuid: ::c_long = 118; +pub const SYS_setresgid: ::c_long = 119; +pub const SYS_getresgid: ::c_long = 120; +pub const SYS_getpgid: ::c_long = 121; +pub const SYS_setfsuid: ::c_long = 122; +pub const SYS_setfsgid: ::c_long = 123; +pub const SYS_getsid: ::c_long = 124; +pub const SYS_capget: ::c_long = 125; +pub const SYS_capset: ::c_long = 126; +pub const SYS_rt_sigpending: ::c_long = 127; +pub const SYS_rt_sigtimedwait: ::c_long = 128; +pub const SYS_rt_sigqueueinfo: ::c_long = 129; +pub const SYS_rt_sigsuspend: ::c_long = 130; +pub const SYS_sigaltstack: ::c_long = 131; +pub const SYS_utime: ::c_long = 132; +pub const SYS_mknod: ::c_long = 133; +pub const SYS_uselib: ::c_long = 134; +pub const SYS_personality: ::c_long = 135; +pub const SYS_ustat: ::c_long = 136; +pub const SYS_statfs: ::c_long = 137; +pub const SYS_fstatfs: ::c_long = 138; +pub const SYS_sysfs: ::c_long = 139; +pub const SYS_getpriority: ::c_long = 140; +pub const SYS_setpriority: ::c_long = 141; +pub const SYS_sched_setparam: ::c_long = 142; +pub const SYS_sched_getparam: ::c_long = 143; +pub const SYS_sched_setscheduler: ::c_long = 144; +pub const SYS_sched_getscheduler: ::c_long = 145; +pub const SYS_sched_get_priority_max: ::c_long = 146; +pub const SYS_sched_get_priority_min: ::c_long = 147; +pub const SYS_sched_rr_get_interval: ::c_long = 148; +pub const SYS_mlock: ::c_long = 149; +pub const SYS_munlock: ::c_long = 150; +pub const SYS_mlockall: ::c_long = 151; +pub const SYS_munlockall: ::c_long = 152; +pub const SYS_vhangup: ::c_long = 153; +pub const SYS_modify_ldt: ::c_long = 154; +pub const SYS_pivot_root: ::c_long = 155; +// FIXME: SYS__sysctl is in the NDK sources but for some reason is +// not available in the tests +// pub const SYS__sysctl: ::c_long = 156; +pub const SYS_prctl: ::c_long = 157; +pub const SYS_arch_prctl: ::c_long = 158; +pub const SYS_adjtimex: ::c_long = 159; +pub const SYS_setrlimit: ::c_long = 160; +pub const SYS_chroot: ::c_long = 161; +pub const SYS_sync: ::c_long = 162; +pub const SYS_acct: ::c_long = 163; +pub const SYS_settimeofday: ::c_long = 164; +pub const SYS_mount: ::c_long = 165; +pub const SYS_umount2: ::c_long = 166; +pub const SYS_swapon: ::c_long = 167; +pub const SYS_swapoff: ::c_long = 168; +pub const SYS_reboot: ::c_long = 169; +pub const SYS_sethostname: ::c_long = 170; +pub const SYS_setdomainname: ::c_long = 171; +pub const SYS_iopl: ::c_long = 172; +pub const SYS_ioperm: ::c_long = 173; +pub const SYS_create_module: ::c_long = 174; +pub const SYS_init_module: ::c_long = 175; +pub const SYS_delete_module: ::c_long = 176; +pub const SYS_get_kernel_syms: ::c_long = 177; +pub const SYS_query_module: ::c_long = 178; +pub const SYS_quotactl: ::c_long = 179; +pub const SYS_nfsservctl: ::c_long = 180; +pub const SYS_getpmsg: ::c_long = 181; +pub const SYS_putpmsg: ::c_long = 182; +pub const SYS_afs_syscall: ::c_long = 183; +pub const SYS_tuxcall: ::c_long = 184; +pub const SYS_security: ::c_long = 185; +pub const SYS_gettid: ::c_long = 186; +pub const SYS_readahead: ::c_long = 187; +pub const SYS_setxattr: ::c_long = 188; +pub const SYS_lsetxattr: ::c_long = 189; +pub const SYS_fsetxattr: ::c_long = 190; +pub const SYS_getxattr: ::c_long = 191; +pub const SYS_lgetxattr: ::c_long = 192; +pub const SYS_fgetxattr: ::c_long = 193; +pub const SYS_listxattr: ::c_long = 194; +pub const SYS_llistxattr: ::c_long = 195; +pub const SYS_flistxattr: ::c_long = 196; +pub const SYS_removexattr: ::c_long = 197; +pub const SYS_lremovexattr: ::c_long = 198; +pub const SYS_fremovexattr: ::c_long = 199; +pub const SYS_tkill: ::c_long = 200; +pub const SYS_time: ::c_long = 201; +pub const SYS_futex: ::c_long = 202; +pub const SYS_sched_setaffinity: ::c_long = 203; +pub const SYS_sched_getaffinity: ::c_long = 204; +pub const SYS_set_thread_area: ::c_long = 205; +pub const SYS_io_setup: ::c_long = 206; +pub const SYS_io_destroy: ::c_long = 207; +pub const SYS_io_getevents: ::c_long = 208; +pub const SYS_io_submit: ::c_long = 209; +pub const SYS_io_cancel: ::c_long = 210; +pub const SYS_get_thread_area: ::c_long = 211; +pub const SYS_lookup_dcookie: ::c_long = 212; +pub const SYS_epoll_create: ::c_long = 213; +pub const SYS_epoll_ctl_old: ::c_long = 214; +pub const SYS_epoll_wait_old: ::c_long = 215; +pub const SYS_remap_file_pages: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; +pub const SYS_set_tid_address: ::c_long = 218; +pub const SYS_restart_syscall: ::c_long = 219; +pub const SYS_semtimedop: ::c_long = 220; +pub const SYS_fadvise64: ::c_long = 221; +pub const SYS_timer_create: ::c_long = 222; +pub const SYS_timer_settime: ::c_long = 223; +pub const SYS_timer_gettime: ::c_long = 224; +pub const SYS_timer_getoverrun: ::c_long = 225; +pub const SYS_timer_delete: ::c_long = 226; +pub const SYS_clock_settime: ::c_long = 227; +pub const SYS_clock_gettime: ::c_long = 228; +pub const SYS_clock_getres: ::c_long = 229; +pub const SYS_clock_nanosleep: ::c_long = 230; +pub const SYS_exit_group: ::c_long = 231; +pub const SYS_epoll_wait: ::c_long = 232; +pub const SYS_epoll_ctl: ::c_long = 233; +pub const SYS_tgkill: ::c_long = 234; +pub const SYS_utimes: ::c_long = 235; +pub const SYS_vserver: ::c_long = 236; +pub const SYS_mbind: ::c_long = 237; +pub const SYS_set_mempolicy: ::c_long = 238; +pub const SYS_get_mempolicy: ::c_long = 239; +pub const SYS_mq_open: ::c_long = 240; +pub const SYS_mq_unlink: ::c_long = 241; +pub const SYS_mq_timedsend: ::c_long = 242; +pub const SYS_mq_timedreceive: ::c_long = 243; +pub const SYS_mq_notify: ::c_long = 244; +pub const SYS_mq_getsetattr: ::c_long = 245; +pub const SYS_kexec_load: ::c_long = 246; +pub const SYS_waitid: ::c_long = 247; +pub const SYS_add_key: ::c_long = 248; +pub const SYS_request_key: ::c_long = 249; +pub const SYS_keyctl: ::c_long = 250; +pub const SYS_ioprio_set: ::c_long = 251; +pub const SYS_ioprio_get: ::c_long = 252; +pub const SYS_inotify_init: ::c_long = 253; +pub const SYS_inotify_add_watch: ::c_long = 254; +pub const SYS_inotify_rm_watch: ::c_long = 255; +pub const SYS_migrate_pages: ::c_long = 256; +pub const SYS_openat: ::c_long = 257; +pub const SYS_mkdirat: ::c_long = 258; +pub const SYS_mknodat: ::c_long = 259; +pub const SYS_fchownat: ::c_long = 260; +pub const SYS_futimesat: ::c_long = 261; +pub const SYS_newfstatat: ::c_long = 262; +pub const SYS_unlinkat: ::c_long = 263; +pub const SYS_renameat: ::c_long = 264; +pub const SYS_linkat: ::c_long = 265; +pub const SYS_symlinkat: ::c_long = 266; +pub const SYS_readlinkat: ::c_long = 267; +pub const SYS_fchmodat: ::c_long = 268; +pub const SYS_faccessat: ::c_long = 269; +pub const SYS_pselect6: ::c_long = 270; +pub const SYS_ppoll: ::c_long = 271; +pub const SYS_unshare: ::c_long = 272; +pub const SYS_set_robust_list: ::c_long = 273; +pub const SYS_get_robust_list: ::c_long = 274; +pub const SYS_splice: ::c_long = 275; +pub const SYS_tee: ::c_long = 276; +pub const SYS_sync_file_range: ::c_long = 277; +pub const SYS_vmsplice: ::c_long = 278; +pub const SYS_move_pages: ::c_long = 279; +pub const SYS_utimensat: ::c_long = 280; +pub const SYS_epoll_pwait: ::c_long = 281; +pub const SYS_signalfd: ::c_long = 282; +pub const SYS_timerfd_create: ::c_long = 283; +pub const SYS_eventfd: ::c_long = 284; +pub const SYS_fallocate: ::c_long = 285; +pub const SYS_timerfd_settime: ::c_long = 286; +pub const SYS_timerfd_gettime: ::c_long = 287; +pub const SYS_accept4: ::c_long = 288; +pub const SYS_signalfd4: ::c_long = 289; +pub const SYS_eventfd2: ::c_long = 290; +pub const SYS_epoll_create1: ::c_long = 291; +pub const SYS_dup3: ::c_long = 292; +pub const SYS_pipe2: ::c_long = 293; +pub const SYS_inotify_init1: ::c_long = 294; +pub const SYS_preadv: ::c_long = 295; +pub const SYS_pwritev: ::c_long = 296; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 297; +pub const SYS_perf_event_open: ::c_long = 298; +pub const SYS_recvmmsg: ::c_long = 299; +pub const SYS_fanotify_init: ::c_long = 300; +pub const SYS_fanotify_mark: ::c_long = 301; +pub const SYS_prlimit64: ::c_long = 302; +pub const SYS_name_to_handle_at: ::c_long = 303; +pub const SYS_open_by_handle_at: ::c_long = 304; +pub const SYS_clock_adjtime: ::c_long = 305; +pub const SYS_syncfs: ::c_long = 306; +pub const SYS_sendmmsg: ::c_long = 307; +pub const SYS_setns: ::c_long = 308; +pub const SYS_getcpu: ::c_long = 309; +pub const SYS_process_vm_readv: ::c_long = 310; +pub const SYS_process_vm_writev: ::c_long = 311; +pub const SYS_kcmp: ::c_long = 312; +pub const SYS_finit_module: ::c_long = 313; +pub const SYS_sched_setattr: ::c_long = 314; +pub const SYS_sched_getattr: ::c_long = 315; +pub const SYS_renameat2: ::c_long = 316; +pub const SYS_seccomp: ::c_long = 317; +pub const SYS_getrandom: ::c_long = 318; +pub const SYS_memfd_create: ::c_long = 319; +pub const SYS_kexec_file_load: ::c_long = 320; +pub const SYS_bpf: ::c_long = 321; +pub const SYS_execveat: ::c_long = 322; +pub const SYS_userfaultfd: ::c_long = 323; +pub const SYS_membarrier: ::c_long = 324; +pub const SYS_mlock2: ::c_long = 325; +pub const SYS_copy_file_range: ::c_long = 326; +pub const SYS_preadv2: ::c_long = 327; +pub const SYS_pwritev2: ::c_long = 328; +pub const SYS_pkey_mprotect: ::c_long = 329; +pub const SYS_pkey_alloc: ::c_long = 330; +pub const SYS_pkey_free: ::c_long = 331; + +// offsets in user_regs_structs, from sys/reg.h +pub const R15: ::c_int = 0; +pub const R14: ::c_int = 1; +pub const R13: ::c_int = 2; +pub const R12: ::c_int = 3; +pub const RBP: ::c_int = 4; +pub const RBX: ::c_int = 5; +pub const R11: ::c_int = 6; +pub const R10: ::c_int = 7; +pub const R9: ::c_int = 8; +pub const R8: ::c_int = 9; +pub const RAX: ::c_int = 10; +pub const RCX: ::c_int = 11; +pub const RDX: ::c_int = 12; +pub const RSI: ::c_int = 13; +pub const RDI: ::c_int = 14; +pub const ORIG_RAX: ::c_int = 15; +pub const RIP: ::c_int = 16; +pub const CS: ::c_int = 17; +pub const EFLAGS: ::c_int = 18; +pub const RSP: ::c_int = 19; +pub const SS: ::c_int = 20; +pub const FS_BASE: ::c_int = 21; +pub const GS_BASE: ::c_int = 22; +pub const DS: ::c_int = 23; +pub const ES: ::c_int = 24; +pub const FS: ::c_int = 25; +pub const GS: ::c_int = 26; + +// offsets in mcontext_t.gregs from sys/ucontext.h +pub const REG_R8: ::c_int = 0; +pub const REG_R9: ::c_int = 1; +pub const REG_R10: ::c_int = 2; +pub const REG_R11: ::c_int = 3; +pub const REG_R12: ::c_int = 4; +pub const REG_R13: ::c_int = 5; +pub const REG_R14: ::c_int = 6; +pub const REG_R15: ::c_int = 7; +pub const REG_RDI: ::c_int = 8; +pub const REG_RSI: ::c_int = 9; +pub const REG_RBP: ::c_int = 10; +pub const REG_RBX: ::c_int = 11; +pub const REG_RDX: ::c_int = 12; +pub const REG_RAX: ::c_int = 13; +pub const REG_RCX: ::c_int = 14; +pub const REG_RSP: ::c_int = 15; +pub const REG_RIP: ::c_int = 16; +pub const REG_EFL: ::c_int = 17; +pub const REG_CSGSFS: ::c_int = 18; +pub const REG_ERR: ::c_int = 19; +pub const REG_TRAPNO: ::c_int = 20; +pub const REG_OLDMASK: ::c_int = 21; +pub const REG_CR2: ::c_int = 22; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/android/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/android/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..cfd229a474a92fc7ef22ecb049bb8e13c13a2b75 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/android/mod.rs @@ -0,0 +1,3316 @@ +//! Android-specific definitions for linux-like values + +pub type clock_t = ::c_long; +pub type time_t = ::c_long; +pub type suseconds_t = ::c_long; +pub type off_t = ::c_long; +pub type blkcnt_t = ::c_ulong; +pub type blksize_t = ::c_ulong; +pub type nlink_t = u32; +pub type useconds_t = u32; +pub type pthread_t = ::c_long; +pub type pthread_mutexattr_t = ::c_long; +pub type pthread_rwlockattr_t = ::c_long; +pub type pthread_barrierattr_t = ::c_int; +pub type pthread_condattr_t = ::c_long; +pub type pthread_key_t = ::c_int; +pub type fsfilcnt_t = ::c_ulong; +pub type fsblkcnt_t = ::c_ulong; +pub type nfds_t = ::c_uint; +pub type rlim_t = ::c_ulong; +pub type dev_t = ::c_ulong; +pub type ino_t = ::c_ulong; +pub type ino64_t = u64; +pub type __CPU_BITTYPE = ::c_ulong; +pub type idtype_t = ::c_int; +pub type loff_t = ::c_longlong; +pub type __kernel_loff_t = ::c_longlong; +pub type __kernel_pid_t = ::c_int; + +pub type __u8 = ::c_uchar; +pub type __u16 = ::c_ushort; +pub type __s16 = ::c_short; +pub type __u32 = ::c_uint; +pub type __s32 = ::c_int; + +// linux/elf.h + +pub type Elf32_Addr = u32; +pub type Elf32_Half = u16; +pub type Elf32_Off = u32; +pub type Elf32_Word = u32; + +pub type Elf64_Addr = u64; +pub type Elf64_Half = u16; +pub type Elf64_Off = u64; +pub type Elf64_Word = u32; +pub type Elf64_Xword = u64; + +s! { + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct __fsid_t { + __val: [::c_int; 2], + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::size_t, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::size_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: ::size_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + } + + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } + + pub struct mallinfo { + pub arena: ::size_t, + pub ordblks: ::size_t, + pub smblks: ::size_t, + pub hblks: ::size_t, + pub hblkhd: ::size_t, + pub usmblks: ::size_t, + pub fsmblks: ::size_t, + pub uordblks: ::size_t, + pub fordblks: ::size_t, + pub keepcost: ::size_t, + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::__kernel_loff_t, + pub l_len: ::__kernel_loff_t, + pub l_pid: ::__kernel_pid_t, + } + + pub struct cpu_set_t { + #[cfg(target_pointer_width = "64")] + __bits: [__CPU_BITTYPE; 16], + #[cfg(target_pointer_width = "32")] + __bits: [__CPU_BITTYPE; 1], + } + + pub struct sem_t { + count: ::c_uint, + #[cfg(target_pointer_width = "64")] + __reserved: [::c_int; 3], + } + + pub struct exit_status { + pub e_termination: ::c_short, + pub e_exit: ::c_short, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + #[cfg(target_pointer_width = "64")] + __f_reserved: [u32; 6], + } + + pub struct signalfd_siginfo { + pub ssi_signo: u32, + pub ssi_errno: i32, + pub ssi_code: i32, + pub ssi_pid: u32, + pub ssi_uid: u32, + pub ssi_fd: i32, + pub ssi_tid: u32, + pub ssi_band: u32, + pub ssi_overrun: u32, + pub ssi_trapno: u32, + pub ssi_status: i32, + pub ssi_int: i32, + pub ssi_ptr: ::c_ulonglong, + pub ssi_utime: ::c_ulonglong, + pub ssi_stime: ::c_ulonglong, + pub ssi_addr: ::c_ulonglong, + pub ssi_addr_lsb: u16, + _pad2: u16, + pub ssi_syscall: i32, + pub ssi_call_addr: u64, + pub ssi_arch: u32, + _pad: [u8; 28], + } + + pub struct itimerspec { + pub it_interval: ::timespec, + pub it_value: ::timespec, + } + + pub struct ucred { + pub pid: ::pid_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + } + + pub struct genlmsghdr { + pub cmd: u8, + pub version: u8, + pub reserved: u16, + } + + pub struct nlmsghdr { + pub nlmsg_len: u32, + pub nlmsg_type: u16, + pub nlmsg_flags: u16, + pub nlmsg_seq: u32, + pub nlmsg_pid: u32, + } + + pub struct nlmsgerr { + pub error: ::c_int, + pub msg: nlmsghdr, + } + + pub struct nl_pktinfo { + pub group: u32, + } + + pub struct nl_mmap_req { + pub nm_block_size: ::c_uint, + pub nm_block_nr: ::c_uint, + pub nm_frame_size: ::c_uint, + pub nm_frame_nr: ::c_uint, + } + + pub struct nl_mmap_hdr { + pub nm_status: ::c_uint, + pub nm_len: ::c_uint, + pub nm_group: u32, + pub nm_pid: u32, + pub nm_uid: u32, + pub nm_gid: u32, + } + + pub struct nlattr { + pub nla_len: u16, + pub nla_type: u16, + } + + pub struct in6_pktinfo { + pub ipi6_addr: ::in6_addr, + pub ipi6_ifindex: ::c_int, + } + + pub struct inotify_event { + pub wd: ::c_int, + pub mask: u32, + pub cookie: u32, + pub len: u32 + } + + pub struct sock_extended_err { + pub ee_errno: u32, + pub ee_origin: u8, + pub ee_type: u8, + pub ee_code: u8, + pub ee_pad: u8, + pub ee_info: u32, + pub ee_data: u32, + } + + pub struct regex_t { + re_magic: ::c_int, + re_nsub: ::size_t, + re_endp: *const ::c_char, + re_guts: *mut ::c_void, + } + + pub struct regmatch_t { + pub rm_so: ::ssize_t, + pub rm_eo: ::ssize_t, + } + + pub struct sockaddr_vm { + pub svm_family: ::sa_family_t, + pub svm_reserved1: ::c_ushort, + pub svm_port: ::c_uint, + pub svm_cid: ::c_uint, + pub svm_zero: [u8; 4] + } + + // linux/elf.h + + pub struct Elf32_Phdr { + pub p_type: Elf32_Word, + pub p_offset: Elf32_Off, + pub p_vaddr: Elf32_Addr, + pub p_paddr: Elf32_Addr, + pub p_filesz: Elf32_Word, + pub p_memsz: Elf32_Word, + pub p_flags: Elf32_Word, + pub p_align: Elf32_Word, + } + + pub struct Elf64_Phdr { + pub p_type: Elf64_Word, + pub p_flags: Elf64_Word, + pub p_offset: Elf64_Off, + pub p_vaddr: Elf64_Addr, + pub p_paddr: Elf64_Addr, + pub p_filesz: Elf64_Xword, + pub p_memsz: Elf64_Xword, + pub p_align: Elf64_Xword, + } + + // link.h + + pub struct dl_phdr_info { + #[cfg(target_pointer_width = "64")] + pub dlpi_addr: Elf64_Addr, + #[cfg(target_pointer_width = "32")] + pub dlpi_addr: Elf32_Addr, + + pub dlpi_name: *const ::c_char, + + #[cfg(target_pointer_width = "64")] + pub dlpi_phdr: *const Elf64_Phdr, + #[cfg(target_pointer_width = "32")] + pub dlpi_phdr: *const Elf32_Phdr, + + #[cfg(target_pointer_width = "64")] + pub dlpi_phnum: Elf64_Half, + #[cfg(target_pointer_width = "32")] + pub dlpi_phnum: Elf32_Half, + + // These fields were added in Android R + pub dlpi_adds: ::c_ulonglong, + pub dlpi_subs: ::c_ulonglong, + pub dlpi_tls_modid: ::size_t, + pub dlpi_tls_data: *mut ::c_void, + } + + // linux/filter.h + pub struct sock_filter { + pub code: ::__u16, + pub jt: ::__u8, + pub jf: ::__u8, + pub k: ::__u32, + } + + pub struct sock_fprog { + pub len: ::c_ushort, + pub filter: *mut sock_filter, + } + + // linux/seccomp.h + pub struct seccomp_data { + pub nr: ::c_int, + pub arch: ::__u32, + pub instruction_pointer: ::__u64, + pub args: [::__u64; 6], + } + + pub struct ptrace_peeksiginfo_args { + pub off: ::__u64, + pub flags: ::__u32, + pub nr: ::__s32, + } +} + +s_no_extra_traits! { + pub struct sockaddr_nl { + pub nl_family: ::sa_family_t, + nl_pad: ::c_ushort, + pub nl_pid: u32, + pub nl_groups: u32 + } + + pub struct dirent { + pub d_ino: u64, + pub d_off: i64, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + + pub struct dirent64 { + pub d_ino: u64, + pub d_off: i64, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct lastlog { + ll_time: ::time_t, + ll_line: [::c_char; UT_LINESIZE], + ll_host: [::c_char; UT_HOSTSIZE], + } + + pub struct utmp { + pub ut_type: ::c_short, + pub ut_pid: ::pid_t, + pub ut_line: [::c_char; UT_LINESIZE], + pub ut_id: [::c_char; 4], + pub ut_user: [::c_char; UT_NAMESIZE], + pub ut_host: [::c_char; UT_HOSTSIZE], + pub ut_exit: exit_status, + pub ut_session: ::c_long, + pub ut_tv: ::timeval, + pub ut_addr_v6: [i32; 4], + unused: [::c_char; 20], + } + + pub struct sockaddr_alg { + pub salg_family: ::sa_family_t, + pub salg_type: [::c_uchar; 14], + pub salg_feat: u32, + pub salg_mask: u32, + pub salg_name: [::c_uchar; 64], + } + + /// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this + /// type are unsound and will be removed in the future. + #[deprecated( + note = "this struct has unsafe trait implementations that will be \ + removed in the future", + since = "0.2.80" + )] + pub struct af_alg_iv { + pub ivlen: u32, + pub iv: [::c_uchar; 0], + } + + pub struct prop_info { + __name: [::c_char; 32], + __serial: ::c_uint, + __value: [[::c_char; 4]; 23], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for sockaddr_nl { + fn eq(&self, other: &sockaddr_nl) -> bool { + self.nl_family == other.nl_family && + self.nl_pid == other.nl_pid && + self.nl_groups == other.nl_groups + } + } + impl Eq for sockaddr_nl {} + impl ::fmt::Debug for sockaddr_nl { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_nl") + .field("nl_family", &self.nl_family) + .field("nl_pid", &self.nl_pid) + .field("nl_groups", &self.nl_groups) + .finish() + } + } + impl ::hash::Hash for sockaddr_nl { + fn hash(&self, state: &mut H) { + self.nl_family.hash(state); + self.nl_pid.hash(state); + self.nl_groups.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_ino == other.d_ino + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for dirent {} + + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_ino", &self.d_ino) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for dirent64 { + fn eq(&self, other: &dirent64) -> bool { + self.d_ino == other.d_ino + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for dirent64 {} + + impl ::fmt::Debug for dirent64 { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent64") + .field("d_ino", &self.d_ino) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + + impl ::hash::Hash for dirent64 { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for siginfo_t { + fn eq(&self, other: &siginfo_t) -> bool { + self.si_signo == other.si_signo + && self.si_errno == other.si_errno + && self.si_code == other.si_code + // Ignore _pad + // Ignore _align + } + } + + impl Eq for siginfo_t {} + + impl ::fmt::Debug for siginfo_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("siginfo_t") + .field("si_signo", &self.si_signo) + .field("si_errno", &self.si_errno) + .field("si_code", &self.si_code) + // Ignore _pad + // Ignore _align + .finish() + } + } + + impl ::hash::Hash for siginfo_t { + fn hash(&self, state: &mut H) { + self.si_signo.hash(state); + self.si_errno.hash(state); + self.si_code.hash(state); + // Ignore _pad + // Ignore _align + } + } + + impl PartialEq for lastlog { + fn eq(&self, other: &lastlog) -> bool { + self.ll_time == other.ll_time + && self + .ll_line + .iter() + .zip(other.ll_line.iter()) + .all(|(a,b)| a == b) + && self + .ll_host + .iter() + .zip(other.ll_host.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for lastlog {} + + impl ::fmt::Debug for lastlog { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("lastlog") + .field("ll_time", &self.ll_time) + .field("ll_line", &self.ll_line) + // FIXME: .field("ll_host", &self.ll_host) + .finish() + } + } + + impl ::hash::Hash for lastlog { + fn hash(&self, state: &mut H) { + self.ll_time.hash(state); + self.ll_line.hash(state); + self.ll_host.hash(state); + } + } + + impl PartialEq for utmp { + fn eq(&self, other: &utmp) -> bool { + self.ut_type == other.ut_type + && self.ut_pid == other.ut_pid + && self + .ut_line + .iter() + .zip(other.ut_line.iter()) + .all(|(a,b)| a == b) + && self.ut_id == other.ut_id + && self + .ut_user + .iter() + .zip(other.ut_user.iter()) + .all(|(a,b)| a == b) + && self + .ut_host + .iter() + .zip(other.ut_host.iter()) + .all(|(a,b)| a == b) + && self.ut_exit == other.ut_exit + && self.ut_session == other.ut_session + && self.ut_tv == other.ut_tv + && self.ut_addr_v6 == other.ut_addr_v6 + && self.unused == other.unused + } + } + + impl Eq for utmp {} + + impl ::fmt::Debug for utmp { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmp") + .field("ut_type", &self.ut_type) + .field("ut_pid", &self.ut_pid) + .field("ut_line", &self.ut_line) + .field("ut_id", &self.ut_id) + .field("ut_user", &self.ut_user) + // FIXME: .field("ut_host", &self.ut_host) + .field("ut_exit", &self.ut_exit) + .field("ut_session", &self.ut_session) + .field("ut_tv", &self.ut_tv) + .field("ut_addr_v6", &self.ut_addr_v6) + .field("unused", &self.unused) + .finish() + } + } + + impl ::hash::Hash for utmp { + fn hash(&self, state: &mut H) { + self.ut_type.hash(state); + self.ut_pid.hash(state); + self.ut_line.hash(state); + self.ut_id.hash(state); + self.ut_user.hash(state); + self.ut_host.hash(state); + self.ut_exit.hash(state); + self.ut_session.hash(state); + self.ut_tv.hash(state); + self.ut_addr_v6.hash(state); + self.unused.hash(state); + } + } + + impl PartialEq for sockaddr_alg { + fn eq(&self, other: &sockaddr_alg) -> bool { + self.salg_family == other.salg_family + && self + .salg_type + .iter() + .zip(other.salg_type.iter()) + .all(|(a, b)| a == b) + && self.salg_feat == other.salg_feat + && self.salg_mask == other.salg_mask + && self + .salg_name + .iter() + .zip(other.salg_name.iter()) + .all(|(a, b)| a == b) + } + } + + impl Eq for sockaddr_alg {} + + impl ::fmt::Debug for sockaddr_alg { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_alg") + .field("salg_family", &self.salg_family) + .field("salg_type", &self.salg_type) + .field("salg_feat", &self.salg_feat) + .field("salg_mask", &self.salg_mask) + .field("salg_name", &&self.salg_name[..]) + .finish() + } + } + + impl ::hash::Hash for sockaddr_alg { + fn hash(&self, state: &mut H) { + self.salg_family.hash(state); + self.salg_type.hash(state); + self.salg_feat.hash(state); + self.salg_mask.hash(state); + self.salg_name.hash(state); + } + } + + #[allow(deprecated)] + impl af_alg_iv { + fn as_slice(&self) -> &[u8] { + unsafe { + ::core::slice::from_raw_parts( + self.iv.as_ptr(), + self.ivlen as usize + ) + } + } + } + + #[allow(deprecated)] + impl PartialEq for af_alg_iv { + fn eq(&self, other: &af_alg_iv) -> bool { + *self.as_slice() == *other.as_slice() + } + } + + #[allow(deprecated)] + impl Eq for af_alg_iv {} + + #[allow(deprecated)] + impl ::fmt::Debug for af_alg_iv { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("af_alg_iv") + .field("ivlen", &self.ivlen) + .finish() + } + } + + #[allow(deprecated)] + impl ::hash::Hash for af_alg_iv { + fn hash(&self, state: &mut H) { + self.as_slice().hash(state); + } + } + + impl PartialEq for prop_info { + fn eq(&self, other: &prop_info) -> bool { + self.__name == other.__name && + self.__serial == other.__serial && + self.__value == other.__value + } + } + impl Eq for prop_info {} + impl ::fmt::Debug for prop_info { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("prop_info") + .field("__name", &self.__name) + .field("__serial", &self.__serial) + .field("__value", &self.__value) + .finish() + } + } + } +} + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MS_NOUSER: ::c_ulong = 0xffffffff80000000; +pub const MS_RMT_MASK: ::c_ulong = 0x02800051; + +pub const O_TRUNC: ::c_int = 512; +pub const O_CLOEXEC: ::c_int = 0x80000; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_NOATIME: ::c_int = 0o1000000; + +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +// sys/eventfd.h +pub const EFD_SEMAPHORE: ::c_int = 0x1; +pub const EFD_CLOEXEC: ::c_int = O_CLOEXEC; +pub const EFD_NONBLOCK: ::c_int = O_NONBLOCK; + +// sys/timerfd.h +pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC; +pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK; +pub const TFD_TIMER_ABSTIME: ::c_int = 1; +pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 2; + +pub const USER_PROCESS: ::c_short = 7; + +pub const _POSIX_VDISABLE: ::cc_t = 0; + +// linux/falloc.h +pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01; +pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02; +pub const FALLOC_FL_NO_HIDE_STALE: ::c_int = 0x04; +pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08; +pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10; +pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20; +pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40; + +pub const BUFSIZ: ::c_uint = 1024; +pub const FILENAME_MAX: ::c_uint = 4096; +pub const FOPEN_MAX: ::c_uint = 20; +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; +pub const L_tmpnam: ::c_uint = 4096; +pub const TMP_MAX: ::c_uint = 308915776; +pub const _PC_LINK_MAX: ::c_int = 1; +pub const _PC_MAX_CANON: ::c_int = 2; +pub const _PC_MAX_INPUT: ::c_int = 3; +pub const _PC_NAME_MAX: ::c_int = 4; +pub const _PC_PATH_MAX: ::c_int = 5; +pub const _PC_PIPE_BUF: ::c_int = 6; +pub const _PC_2_SYMLINKS: ::c_int = 7; +pub const _PC_ALLOC_SIZE_MIN: ::c_int = 8; +pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 9; +pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 10; +pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 11; +pub const _PC_REC_XFER_ALIGN: ::c_int = 12; +pub const _PC_SYMLINK_MAX: ::c_int = 13; +pub const _PC_CHOWN_RESTRICTED: ::c_int = 14; +pub const _PC_NO_TRUNC: ::c_int = 15; +pub const _PC_VDISABLE: ::c_int = 16; +pub const _PC_ASYNC_IO: ::c_int = 17; +pub const _PC_PRIO_IO: ::c_int = 18; +pub const _PC_SYNC_IO: ::c_int = 19; + +pub const FIONBIO: ::c_int = 0x5421; + +pub const _SC_ARG_MAX: ::c_int = 0; +pub const _SC_BC_BASE_MAX: ::c_int = 1; +pub const _SC_BC_DIM_MAX: ::c_int = 2; +pub const _SC_BC_SCALE_MAX: ::c_int = 3; +pub const _SC_BC_STRING_MAX: ::c_int = 4; +pub const _SC_CHILD_MAX: ::c_int = 5; +pub const _SC_CLK_TCK: ::c_int = 6; +pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 7; +pub const _SC_EXPR_NEST_MAX: ::c_int = 8; +pub const _SC_LINE_MAX: ::c_int = 9; +pub const _SC_NGROUPS_MAX: ::c_int = 10; +pub const _SC_OPEN_MAX: ::c_int = 11; +pub const _SC_PASS_MAX: ::c_int = 12; +pub const _SC_2_C_BIND: ::c_int = 13; +pub const _SC_2_C_DEV: ::c_int = 14; +pub const _SC_2_C_VERSION: ::c_int = 15; +pub const _SC_2_CHAR_TERM: ::c_int = 16; +pub const _SC_2_FORT_DEV: ::c_int = 17; +pub const _SC_2_FORT_RUN: ::c_int = 18; +pub const _SC_2_LOCALEDEF: ::c_int = 19; +pub const _SC_2_SW_DEV: ::c_int = 20; +pub const _SC_2_UPE: ::c_int = 21; +pub const _SC_2_VERSION: ::c_int = 22; +pub const _SC_JOB_CONTROL: ::c_int = 23; +pub const _SC_SAVED_IDS: ::c_int = 24; +pub const _SC_VERSION: ::c_int = 25; +pub const _SC_RE_DUP_MAX: ::c_int = 26; +pub const _SC_STREAM_MAX: ::c_int = 27; +pub const _SC_TZNAME_MAX: ::c_int = 28; +pub const _SC_XOPEN_CRYPT: ::c_int = 29; +pub const _SC_XOPEN_ENH_I18N: ::c_int = 30; +pub const _SC_XOPEN_SHM: ::c_int = 31; +pub const _SC_XOPEN_VERSION: ::c_int = 32; +pub const _SC_XOPEN_XCU_VERSION: ::c_int = 33; +pub const _SC_XOPEN_REALTIME: ::c_int = 34; +pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 35; +pub const _SC_XOPEN_LEGACY: ::c_int = 36; +pub const _SC_ATEXIT_MAX: ::c_int = 37; +pub const _SC_IOV_MAX: ::c_int = 38; +pub const _SC_PAGESIZE: ::c_int = 39; +pub const _SC_PAGE_SIZE: ::c_int = 40; +pub const _SC_XOPEN_UNIX: ::c_int = 41; +pub const _SC_XBS5_ILP32_OFF32: ::c_int = 42; +pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 43; +pub const _SC_XBS5_LP64_OFF64: ::c_int = 44; +pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 45; +pub const _SC_AIO_LISTIO_MAX: ::c_int = 46; +pub const _SC_AIO_MAX: ::c_int = 47; +pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 48; +pub const _SC_DELAYTIMER_MAX: ::c_int = 49; +pub const _SC_MQ_OPEN_MAX: ::c_int = 50; +pub const _SC_MQ_PRIO_MAX: ::c_int = 51; +pub const _SC_RTSIG_MAX: ::c_int = 52; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 53; +pub const _SC_SEM_VALUE_MAX: ::c_int = 54; +pub const _SC_SIGQUEUE_MAX: ::c_int = 55; +pub const _SC_TIMER_MAX: ::c_int = 56; +pub const _SC_ASYNCHRONOUS_IO: ::c_int = 57; +pub const _SC_FSYNC: ::c_int = 58; +pub const _SC_MAPPED_FILES: ::c_int = 59; +pub const _SC_MEMLOCK: ::c_int = 60; +pub const _SC_MEMLOCK_RANGE: ::c_int = 61; +pub const _SC_MEMORY_PROTECTION: ::c_int = 62; +pub const _SC_MESSAGE_PASSING: ::c_int = 63; +pub const _SC_PRIORITIZED_IO: ::c_int = 64; +pub const _SC_PRIORITY_SCHEDULING: ::c_int = 65; +pub const _SC_REALTIME_SIGNALS: ::c_int = 66; +pub const _SC_SEMAPHORES: ::c_int = 67; +pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 68; +pub const _SC_SYNCHRONIZED_IO: ::c_int = 69; +pub const _SC_TIMERS: ::c_int = 70; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 71; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 72; +pub const _SC_LOGIN_NAME_MAX: ::c_int = 73; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 74; +pub const _SC_THREAD_KEYS_MAX: ::c_int = 75; +pub const _SC_THREAD_STACK_MIN: ::c_int = 76; +pub const _SC_THREAD_THREADS_MAX: ::c_int = 77; +pub const _SC_TTY_NAME_MAX: ::c_int = 78; +pub const _SC_THREADS: ::c_int = 79; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 80; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 81; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 82; +pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 83; +pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 84; +pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 85; +pub const _SC_NPROCESSORS_CONF: ::c_int = 96; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 97; +pub const _SC_PHYS_PAGES: ::c_int = 98; +pub const _SC_AVPHYS_PAGES: ::c_int = 99; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 100; + +pub const _SC_2_PBS: ::c_int = 101; +pub const _SC_2_PBS_ACCOUNTING: ::c_int = 102; +pub const _SC_2_PBS_CHECKPOINT: ::c_int = 103; +pub const _SC_2_PBS_LOCATE: ::c_int = 104; +pub const _SC_2_PBS_MESSAGE: ::c_int = 105; +pub const _SC_2_PBS_TRACK: ::c_int = 106; +pub const _SC_ADVISORY_INFO: ::c_int = 107; +pub const _SC_BARRIERS: ::c_int = 108; +pub const _SC_CLOCK_SELECTION: ::c_int = 109; +pub const _SC_CPUTIME: ::c_int = 110; +pub const _SC_HOST_NAME_MAX: ::c_int = 111; +pub const _SC_IPV6: ::c_int = 112; +pub const _SC_RAW_SOCKETS: ::c_int = 113; +pub const _SC_READER_WRITER_LOCKS: ::c_int = 114; +pub const _SC_REGEXP: ::c_int = 115; +pub const _SC_SHELL: ::c_int = 116; +pub const _SC_SPAWN: ::c_int = 117; +pub const _SC_SPIN_LOCKS: ::c_int = 118; +pub const _SC_SPORADIC_SERVER: ::c_int = 119; +pub const _SC_SS_REPL_MAX: ::c_int = 120; +pub const _SC_SYMLOOP_MAX: ::c_int = 121; +pub const _SC_THREAD_CPUTIME: ::c_int = 122; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 123; +pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 124; +pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 125; +pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 126; +pub const _SC_TIMEOUTS: ::c_int = 127; +pub const _SC_TRACE: ::c_int = 128; +pub const _SC_TRACE_EVENT_FILTER: ::c_int = 129; +pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 130; +pub const _SC_TRACE_INHERIT: ::c_int = 131; +pub const _SC_TRACE_LOG: ::c_int = 132; +pub const _SC_TRACE_NAME_MAX: ::c_int = 133; +pub const _SC_TRACE_SYS_MAX: ::c_int = 134; +pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 135; +pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 136; +pub const _SC_V7_ILP32_OFF32: ::c_int = 137; +pub const _SC_V7_ILP32_OFFBIG: ::c_int = 138; +pub const _SC_V7_LP64_OFF64: ::c_int = 139; +pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 140; +pub const _SC_XOPEN_STREAMS: ::c_int = 141; +pub const _SC_XOPEN_UUCP: ::c_int = 142; + +pub const F_LOCK: ::c_int = 1; +pub const F_TEST: ::c_int = 3; +pub const F_TLOCK: ::c_int = 2; +pub const F_ULOCK: ::c_int = 0; + +pub const F_SEAL_FUTURE_WRITE: ::c_int = 0x0010; + +pub const IFF_LOWER_UP: ::c_int = 0x10000; +pub const IFF_DORMANT: ::c_int = 0x20000; +pub const IFF_ECHO: ::c_int = 0x40000; + +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; + +// stdio.h +pub const RENAME_NOREPLACE: ::c_int = 1; +pub const RENAME_EXCHANGE: ::c_int = 2; +pub const RENAME_WHITEOUT: ::c_int = 4; + +pub const FIOCLEX: ::c_int = 0x5451; +pub const FIONCLEX: ::c_int = 0x5450; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = 31; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const RUSAGE_CHILDREN: ::c_int = -1; + +pub const LC_PAPER: ::c_int = 7; +pub const LC_NAME: ::c_int = 8; +pub const LC_ADDRESS: ::c_int = 9; +pub const LC_TELEPHONE: ::c_int = 10; +pub const LC_MEASUREMENT: ::c_int = 11; +pub const LC_IDENTIFICATION: ::c_int = 12; +pub const LC_PAPER_MASK: ::c_int = 1 << LC_PAPER; +pub const LC_NAME_MASK: ::c_int = 1 << LC_NAME; +pub const LC_ADDRESS_MASK: ::c_int = 1 << LC_ADDRESS; +pub const LC_TELEPHONE_MASK: ::c_int = 1 << LC_TELEPHONE; +pub const LC_MEASUREMENT_MASK: ::c_int = 1 << LC_MEASUREMENT; +pub const LC_IDENTIFICATION_MASK: ::c_int = 1 << LC_IDENTIFICATION; +pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK + | ::LC_NUMERIC_MASK + | ::LC_TIME_MASK + | ::LC_COLLATE_MASK + | ::LC_MONETARY_MASK + | ::LC_MESSAGES_MASK + | LC_PAPER_MASK + | LC_NAME_MASK + | LC_ADDRESS_MASK + | LC_TELEPHONE_MASK + | LC_MEASUREMENT_MASK + | LC_IDENTIFICATION_MASK; + +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; + +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; + +pub const EMULTIHOP: ::c_int = 72; +pub const EBADMSG: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_SEQPACKET: ::c_int = 5; +pub const SOCK_DCCP: ::c_int = 6; +pub const SOCK_PACKET: ::c_int = 10; + +pub const IPPROTO_MAX: ::c_int = 256; + +pub const SOL_SOCKET: ::c_int = 1; +pub const SOL_SCTP: ::c_int = 132; +pub const SOL_IPX: ::c_int = 256; +pub const SOL_AX25: ::c_int = 257; +pub const SOL_ATALK: ::c_int = 258; +pub const SOL_NETROM: ::c_int = 259; +pub const SOL_ROSE: ::c_int = 260; + +/* DCCP socket options */ +pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1; +pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2; +pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3; +pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4; +pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5; +pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6; +pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10; +pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11; +pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12; +pub const DCCP_SOCKOPT_CCID: ::c_int = 13; +pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14; +pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15; +pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16; +pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17; +pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128; +pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192; + +/// maximum number of services provided on the same listening port +pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32; + +pub const SO_REUSEADDR: ::c_int = 2; +pub const SO_TYPE: ::c_int = 3; +pub const SO_ERROR: ::c_int = 4; +pub const SO_DONTROUTE: ::c_int = 5; +pub const SO_BROADCAST: ::c_int = 6; +pub const SO_SNDBUF: ::c_int = 7; +pub const SO_RCVBUF: ::c_int = 8; +pub const SO_KEEPALIVE: ::c_int = 9; +pub const SO_OOBINLINE: ::c_int = 10; +pub const SO_PRIORITY: ::c_int = 12; +pub const SO_LINGER: ::c_int = 13; +pub const SO_BSDCOMPAT: ::c_int = 14; +pub const SO_REUSEPORT: ::c_int = 15; +pub const SO_PASSCRED: ::c_int = 16; +pub const SO_PEERCRED: ::c_int = 17; +pub const SO_RCVLOWAT: ::c_int = 18; +pub const SO_SNDLOWAT: ::c_int = 19; +pub const SO_RCVTIMEO: ::c_int = 20; +pub const SO_SNDTIMEO: ::c_int = 21; +pub const SO_BINDTODEVICE: ::c_int = 25; +pub const SO_ATTACH_FILTER: ::c_int = 26; +pub const SO_DETACH_FILTER: ::c_int = 27; +pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER; +pub const SO_TIMESTAMP: ::c_int = 29; +pub const SO_ACCEPTCONN: ::c_int = 30; +pub const SO_PEERSEC: ::c_int = 31; +pub const SO_SNDBUFFORCE: ::c_int = 32; +pub const SO_RCVBUFFORCE: ::c_int = 33; +pub const SO_PASSSEC: ::c_int = 34; +pub const SO_MARK: ::c_int = 36; +pub const SO_PROTOCOL: ::c_int = 38; +pub const SO_DOMAIN: ::c_int = 39; +pub const SO_RXQ_OVFL: ::c_int = 40; +pub const SO_PEEK_OFF: ::c_int = 42; +pub const SO_BUSY_POLL: ::c_int = 46; + +pub const IPTOS_ECN_NOTECT: u8 = 0x00; + +pub const O_ACCMODE: ::c_int = 3; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 0x101000; +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_NDELAY: ::c_int = 0x800; +pub const O_DSYNC: ::c_int = 4096; +pub const O_RSYNC: ::c_int = O_SYNC; + +pub const NI_MAXHOST: ::size_t = 1025; +pub const NI_MAXSERV: ::size_t = 32; + +pub const NI_NOFQDN: ::c_int = 0x00000001; +pub const NI_NUMERICHOST: ::c_int = 0x00000002; +pub const NI_NAMEREQD: ::c_int = 0x00000004; +pub const NI_NUMERICSERV: ::c_int = 0x00000008; +pub const NI_DGRAM: ::c_int = 0x00000010; + +pub const NCCS: usize = 19; +pub const TCSBRKP: ::c_int = 0x5425; +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 0x1; +pub const TCSAFLUSH: ::c_int = 0x2; +pub const VEOF: usize = 4; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; +pub const EXTPROC: ::tcflag_t = 0o200000; + +pub const MAP_HUGETLB: ::c_int = 0x040000; + +pub const PTRACE_TRACEME: ::c_int = 0; +pub const PTRACE_PEEKTEXT: ::c_int = 1; +pub const PTRACE_PEEKDATA: ::c_int = 2; +pub const PTRACE_PEEKUSER: ::c_int = 3; +pub const PTRACE_POKETEXT: ::c_int = 4; +pub const PTRACE_POKEDATA: ::c_int = 5; +pub const PTRACE_POKEUSER: ::c_int = 6; +pub const PTRACE_CONT: ::c_int = 7; +pub const PTRACE_KILL: ::c_int = 8; +pub const PTRACE_SINGLESTEP: ::c_int = 9; +pub const PTRACE_GETREGS: ::c_int = 12; +pub const PTRACE_SETREGS: ::c_int = 13; +pub const PTRACE_ATTACH: ::c_int = 16; +pub const PTRACE_DETACH: ::c_int = 17; +pub const PTRACE_SYSCALL: ::c_int = 24; +pub const PTRACE_SETOPTIONS: ::c_int = 0x4200; +pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201; +pub const PTRACE_GETSIGINFO: ::c_int = 0x4202; +pub const PTRACE_SETSIGINFO: ::c_int = 0x4203; +pub const PTRACE_GETREGSET: ::c_int = 0x4204; +pub const PTRACE_SETREGSET: ::c_int = 0x4205; + +pub const PTRACE_EVENT_STOP: ::c_int = 128; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_RDLCK: ::c_int = 0; +pub const F_WRLCK: ::c_int = 1; +pub const F_UNLCK: ::c_int = 2; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const RLIMIT_CPU: ::c_int = 0; +pub const RLIMIT_FSIZE: ::c_int = 1; +pub const RLIMIT_DATA: ::c_int = 2; +pub const RLIMIT_STACK: ::c_int = 3; +pub const RLIMIT_CORE: ::c_int = 4; +pub const RLIMIT_RSS: ::c_int = 5; +pub const RLIMIT_NPROC: ::c_int = 6; +pub const RLIMIT_NOFILE: ::c_int = 7; +pub const RLIMIT_MEMLOCK: ::c_int = 8; +pub const RLIMIT_AS: ::c_int = 9; +pub const RLIMIT_LOCKS: ::c_int = 10; +pub const RLIMIT_SIGPENDING: ::c_int = 11; +pub const RLIMIT_MSGQUEUE: ::c_int = 12; +pub const RLIMIT_NICE: ::c_int = 13; +pub const RLIMIT_RTPRIO: ::c_int = 14; + +pub const RLIM_NLIMITS: ::c_int = 16; +pub const RLIM_INFINITY: ::rlim_t = !0; + +pub const TCGETS: ::c_int = 0x5401; +pub const TCSETS: ::c_int = 0x5402; +pub const TCSETSW: ::c_int = 0x5403; +pub const TCSETSF: ::c_int = 0x5404; +pub const TCGETS2: ::c_int = 0x802c542a; +pub const TCSETS2: ::c_int = 0x402c542b; +pub const TCSETSW2: ::c_int = 0x402c542c; +pub const TCSETSF2: ::c_int = 0x402c542d; +pub const TCGETA: ::c_int = 0x5405; +pub const TCSETA: ::c_int = 0x5406; +pub const TCSETAW: ::c_int = 0x5407; +pub const TCSETAF: ::c_int = 0x5408; +pub const TCSBRK: ::c_int = 0x5409; +pub const TCXONC: ::c_int = 0x540A; +pub const TCFLSH: ::c_int = 0x540B; +pub const TIOCGSOFTCAR: ::c_int = 0x5419; +pub const TIOCSSOFTCAR: ::c_int = 0x541A; +pub const TIOCINQ: ::c_int = 0x541B; +pub const TIOCLINUX: ::c_int = 0x541C; +pub const TIOCGSERIAL: ::c_int = 0x541E; +pub const TIOCEXCL: ::c_int = 0x540C; +pub const TIOCNXCL: ::c_int = 0x540D; +pub const TIOCSCTTY: ::c_int = 0x540E; +pub const TIOCGPGRP: ::c_int = 0x540F; +pub const TIOCSPGRP: ::c_int = 0x5410; +pub const TIOCOUTQ: ::c_int = 0x5411; +pub const TIOCSTI: ::c_int = 0x5412; +pub const TIOCGWINSZ: ::c_int = 0x5413; +pub const TIOCSWINSZ: ::c_int = 0x5414; +pub const TIOCMGET: ::c_int = 0x5415; +pub const TIOCMBIS: ::c_int = 0x5416; +pub const TIOCMBIC: ::c_int = 0x5417; +pub const TIOCMSET: ::c_int = 0x5418; +pub const FIONREAD: ::c_int = 0x541B; +pub const TIOCCONS: ::c_int = 0x541D; +pub const TIOCSBRK: ::c_int = 0x5427; +pub const TIOCCBRK: ::c_int = 0x5428; + +pub const ST_RDONLY: ::c_ulong = 1; +pub const ST_NOSUID: ::c_ulong = 2; +pub const ST_NODEV: ::c_ulong = 4; +pub const ST_NOEXEC: ::c_ulong = 8; +pub const ST_SYNCHRONOUS: ::c_ulong = 16; +pub const ST_MANDLOCK: ::c_ulong = 64; +pub const ST_NOATIME: ::c_ulong = 1024; +pub const ST_NODIRATIME: ::c_ulong = 2048; +pub const ST_RELATIME: ::c_ulong = 4096; + +pub const RTLD_NOLOAD: ::c_int = 0x4; + +pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; + +pub const AI_PASSIVE: ::c_int = 0x00000001; +pub const AI_CANONNAME: ::c_int = 0x00000002; +pub const AI_NUMERICHOST: ::c_int = 0x00000004; +pub const AI_NUMERICSERV: ::c_int = 0x00000008; +pub const AI_MASK: ::c_int = + AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG; +pub const AI_ALL: ::c_int = 0x00000100; +pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200; +pub const AI_ADDRCONFIG: ::c_int = 0x00000400; +pub const AI_V4MAPPED: ::c_int = 0x00000800; +pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG; + +pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead; +pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793; +pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278; +pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448; +pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216; + +pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567; +pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123; +pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF; +pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000; +pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC; +pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4; +pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2; +pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543; + +pub const REG_BASIC: ::c_int = 0; +pub const REG_EXTENDED: ::c_int = 1; +pub const REG_ICASE: ::c_int = 2; +pub const REG_NOSUB: ::c_int = 4; +pub const REG_NEWLINE: ::c_int = 8; +pub const REG_NOSPEC: ::c_int = 16; +pub const REG_PEND: ::c_int = 32; +pub const REG_DUMP: ::c_int = 128; + +pub const REG_NOMATCH: ::c_int = 1; +pub const REG_BADPAT: ::c_int = 2; +pub const REG_ECOLLATE: ::c_int = 3; +pub const REG_ECTYPE: ::c_int = 4; +pub const REG_EESCAPE: ::c_int = 5; +pub const REG_ESUBREG: ::c_int = 6; +pub const REG_EBRACK: ::c_int = 7; +pub const REG_EPAREN: ::c_int = 8; +pub const REG_EBRACE: ::c_int = 9; +pub const REG_BADBR: ::c_int = 10; +pub const REG_ERANGE: ::c_int = 11; +pub const REG_ESPACE: ::c_int = 12; +pub const REG_BADRPT: ::c_int = 13; +pub const REG_EMPTY: ::c_int = 14; +pub const REG_ASSERT: ::c_int = 15; +pub const REG_INVARG: ::c_int = 16; +pub const REG_ATOI: ::c_int = 255; +pub const REG_ITOA: ::c_int = 256; + +pub const REG_NOTBOL: ::c_int = 1; +pub const REG_NOTEOL: ::c_int = 2; +pub const REG_STARTEND: ::c_int = 4; +pub const REG_TRACE: ::c_int = 256; +pub const REG_LARGE: ::c_int = 512; +pub const REG_BACKR: ::c_int = 1024; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const BOTHER: ::speed_t = 0o010000; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; +pub const IBSHIFT: ::tcflag_t = 16; + +pub const BLKIOMIN: ::c_int = 0x1278; +pub const BLKIOOPT: ::c_int = 0x1279; +pub const BLKSSZGET: ::c_int = 0x1268; +pub const BLKPBSZGET: ::c_int = 0x127B; + +pub const EAI_AGAIN: ::c_int = 2; +pub const EAI_BADFLAGS: ::c_int = 3; +pub const EAI_FAIL: ::c_int = 4; +pub const EAI_FAMILY: ::c_int = 5; +pub const EAI_MEMORY: ::c_int = 6; +pub const EAI_NODATA: ::c_int = 7; +pub const EAI_NONAME: ::c_int = 8; +pub const EAI_SERVICE: ::c_int = 9; +pub const EAI_SOCKTYPE: ::c_int = 10; +pub const EAI_SYSTEM: ::c_int = 11; +pub const EAI_OVERFLOW: ::c_int = 14; + +pub const NETLINK_ROUTE: ::c_int = 0; +pub const NETLINK_UNUSED: ::c_int = 1; +pub const NETLINK_USERSOCK: ::c_int = 2; +pub const NETLINK_FIREWALL: ::c_int = 3; +pub const NETLINK_SOCK_DIAG: ::c_int = 4; +pub const NETLINK_NFLOG: ::c_int = 5; +pub const NETLINK_XFRM: ::c_int = 6; +pub const NETLINK_SELINUX: ::c_int = 7; +pub const NETLINK_ISCSI: ::c_int = 8; +pub const NETLINK_AUDIT: ::c_int = 9; +pub const NETLINK_FIB_LOOKUP: ::c_int = 10; +pub const NETLINK_CONNECTOR: ::c_int = 11; +pub const NETLINK_NETFILTER: ::c_int = 12; +pub const NETLINK_IP6_FW: ::c_int = 13; +pub const NETLINK_DNRTMSG: ::c_int = 14; +pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15; +pub const NETLINK_GENERIC: ::c_int = 16; +pub const NETLINK_SCSITRANSPORT: ::c_int = 18; +pub const NETLINK_ECRYPTFS: ::c_int = 19; +pub const NETLINK_RDMA: ::c_int = 20; +pub const NETLINK_CRYPTO: ::c_int = 21; +pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG; + +pub const MAX_LINKS: ::c_int = 32; + +pub const NLM_F_REQUEST: ::c_int = 1; +pub const NLM_F_MULTI: ::c_int = 2; +pub const NLM_F_ACK: ::c_int = 4; +pub const NLM_F_ECHO: ::c_int = 8; +pub const NLM_F_DUMP_INTR: ::c_int = 16; + +pub const NLM_F_ROOT: ::c_int = 0x100; +pub const NLM_F_MATCH: ::c_int = 0x200; +pub const NLM_F_ATOMIC: ::c_int = 0x400; +pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH; + +pub const NLM_F_REPLACE: ::c_int = 0x100; +pub const NLM_F_EXCL: ::c_int = 0x200; +pub const NLM_F_CREATE: ::c_int = 0x400; +pub const NLM_F_APPEND: ::c_int = 0x800; + +pub const NLMSG_NOOP: ::c_int = 0x1; +pub const NLMSG_ERROR: ::c_int = 0x2; +pub const NLMSG_DONE: ::c_int = 0x3; +pub const NLMSG_OVERRUN: ::c_int = 0x4; +pub const NLMSG_MIN_TYPE: ::c_int = 0x10; + +// linux/netfilter/nfnetlink.h +pub const NFNLGRP_NONE: ::c_int = 0; +pub const NFNLGRP_CONNTRACK_NEW: ::c_int = 1; +pub const NFNLGRP_CONNTRACK_UPDATE: ::c_int = 2; +pub const NFNLGRP_CONNTRACK_DESTROY: ::c_int = 3; +pub const NFNLGRP_CONNTRACK_EXP_NEW: ::c_int = 4; +pub const NFNLGRP_CONNTRACK_EXP_UPDATE: ::c_int = 5; +pub const NFNLGRP_CONNTRACK_EXP_DESTROY: ::c_int = 6; +pub const NFNLGRP_NFTABLES: ::c_int = 7; +pub const NFNLGRP_ACCT_QUOTA: ::c_int = 8; + +pub const NFNETLINK_V0: ::c_int = 0; + +pub const NFNL_SUBSYS_NONE: ::c_int = 0; +pub const NFNL_SUBSYS_CTNETLINK: ::c_int = 1; +pub const NFNL_SUBSYS_CTNETLINK_EXP: ::c_int = 2; +pub const NFNL_SUBSYS_QUEUE: ::c_int = 3; +pub const NFNL_SUBSYS_ULOG: ::c_int = 4; +pub const NFNL_SUBSYS_OSF: ::c_int = 5; +pub const NFNL_SUBSYS_IPSET: ::c_int = 6; +pub const NFNL_SUBSYS_ACCT: ::c_int = 7; +pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: ::c_int = 8; +pub const NFNL_SUBSYS_CTHELPER: ::c_int = 9; +pub const NFNL_SUBSYS_NFTABLES: ::c_int = 10; +pub const NFNL_SUBSYS_NFT_COMPAT: ::c_int = 11; +pub const NFNL_SUBSYS_COUNT: ::c_int = 12; + +pub const NFNL_MSG_BATCH_BEGIN: ::c_int = NLMSG_MIN_TYPE; +pub const NFNL_MSG_BATCH_END: ::c_int = NLMSG_MIN_TYPE + 1; + +// linux/netfilter/nfnetlink_log.h +pub const NFULNL_MSG_PACKET: ::c_int = 0; +pub const NFULNL_MSG_CONFIG: ::c_int = 1; + +pub const NFULA_UNSPEC: ::c_int = 0; +pub const NFULA_PACKET_HDR: ::c_int = 1; +pub const NFULA_MARK: ::c_int = 2; +pub const NFULA_TIMESTAMP: ::c_int = 3; +pub const NFULA_IFINDEX_INDEV: ::c_int = 4; +pub const NFULA_IFINDEX_OUTDEV: ::c_int = 5; +pub const NFULA_IFINDEX_PHYSINDEV: ::c_int = 6; +pub const NFULA_IFINDEX_PHYSOUTDEV: ::c_int = 7; +pub const NFULA_HWADDR: ::c_int = 8; +pub const NFULA_PAYLOAD: ::c_int = 9; +pub const NFULA_PREFIX: ::c_int = 10; +pub const NFULA_UID: ::c_int = 11; +pub const NFULA_SEQ: ::c_int = 12; +pub const NFULA_SEQ_GLOBAL: ::c_int = 13; +pub const NFULA_GID: ::c_int = 14; +pub const NFULA_HWTYPE: ::c_int = 15; +pub const NFULA_HWHEADER: ::c_int = 16; +pub const NFULA_HWLEN: ::c_int = 17; +pub const NFULA_CT: ::c_int = 18; +pub const NFULA_CT_INFO: ::c_int = 19; + +pub const NFULNL_CFG_CMD_NONE: ::c_int = 0; +pub const NFULNL_CFG_CMD_BIND: ::c_int = 1; +pub const NFULNL_CFG_CMD_UNBIND: ::c_int = 2; +pub const NFULNL_CFG_CMD_PF_BIND: ::c_int = 3; +pub const NFULNL_CFG_CMD_PF_UNBIND: ::c_int = 4; + +pub const NFULA_CFG_UNSPEC: ::c_int = 0; +pub const NFULA_CFG_CMD: ::c_int = 1; +pub const NFULA_CFG_MODE: ::c_int = 2; +pub const NFULA_CFG_NLBUFSIZ: ::c_int = 3; +pub const NFULA_CFG_TIMEOUT: ::c_int = 4; +pub const NFULA_CFG_QTHRESH: ::c_int = 5; +pub const NFULA_CFG_FLAGS: ::c_int = 6; + +pub const NFULNL_COPY_NONE: ::c_int = 0x00; +pub const NFULNL_COPY_META: ::c_int = 0x01; +pub const NFULNL_COPY_PACKET: ::c_int = 0x02; + +pub const NFULNL_CFG_F_SEQ: ::c_int = 0x0001; +pub const NFULNL_CFG_F_SEQ_GLOBAL: ::c_int = 0x0002; +pub const NFULNL_CFG_F_CONNTRACK: ::c_int = 0x0004; + +// linux/netfilter/nfnetlink_log.h +pub const NFQNL_MSG_PACKET: ::c_int = 0; +pub const NFQNL_MSG_VERDICT: ::c_int = 1; +pub const NFQNL_MSG_CONFIG: ::c_int = 2; +pub const NFQNL_MSG_VERDICT_BATCH: ::c_int = 3; + +pub const NFQA_UNSPEC: ::c_int = 0; +pub const NFQA_PACKET_HDR: ::c_int = 1; +pub const NFQA_VERDICT_HDR: ::c_int = 2; +pub const NFQA_MARK: ::c_int = 3; +pub const NFQA_TIMESTAMP: ::c_int = 4; +pub const NFQA_IFINDEX_INDEV: ::c_int = 5; +pub const NFQA_IFINDEX_OUTDEV: ::c_int = 6; +pub const NFQA_IFINDEX_PHYSINDEV: ::c_int = 7; +pub const NFQA_IFINDEX_PHYSOUTDEV: ::c_int = 8; +pub const NFQA_HWADDR: ::c_int = 9; +pub const NFQA_PAYLOAD: ::c_int = 10; +pub const NFQA_CT: ::c_int = 11; +pub const NFQA_CT_INFO: ::c_int = 12; +pub const NFQA_CAP_LEN: ::c_int = 13; +pub const NFQA_SKB_INFO: ::c_int = 14; +pub const NFQA_EXP: ::c_int = 15; +pub const NFQA_UID: ::c_int = 16; +pub const NFQA_GID: ::c_int = 17; +pub const NFQA_SECCTX: ::c_int = 18; +/* + FIXME: These are not yet available in musl sanitized kernel headers and + make the tests fail. Enable them once musl has them. + + See https://github.com/rust-lang/libc/pull/1628 for more details. +pub const NFQA_VLAN: ::c_int = 19; +pub const NFQA_L2HDR: ::c_int = 20; + +pub const NFQA_VLAN_UNSPEC: ::c_int = 0; +pub const NFQA_VLAN_PROTO: ::c_int = 1; +pub const NFQA_VLAN_TCI: ::c_int = 2; +*/ + +pub const NFQNL_CFG_CMD_NONE: ::c_int = 0; +pub const NFQNL_CFG_CMD_BIND: ::c_int = 1; +pub const NFQNL_CFG_CMD_UNBIND: ::c_int = 2; +pub const NFQNL_CFG_CMD_PF_BIND: ::c_int = 3; +pub const NFQNL_CFG_CMD_PF_UNBIND: ::c_int = 4; + +pub const NFQNL_COPY_NONE: ::c_int = 0; +pub const NFQNL_COPY_META: ::c_int = 1; +pub const NFQNL_COPY_PACKET: ::c_int = 2; + +pub const NFQA_CFG_UNSPEC: ::c_int = 0; +pub const NFQA_CFG_CMD: ::c_int = 1; +pub const NFQA_CFG_PARAMS: ::c_int = 2; +pub const NFQA_CFG_QUEUE_MAXLEN: ::c_int = 3; +pub const NFQA_CFG_MASK: ::c_int = 4; +pub const NFQA_CFG_FLAGS: ::c_int = 5; + +pub const NFQA_CFG_F_FAIL_OPEN: ::c_int = 0x0001; +pub const NFQA_CFG_F_CONNTRACK: ::c_int = 0x0002; +pub const NFQA_CFG_F_GSO: ::c_int = 0x0004; +pub const NFQA_CFG_F_UID_GID: ::c_int = 0x0008; +pub const NFQA_CFG_F_SECCTX: ::c_int = 0x0010; +pub const NFQA_CFG_F_MAX: ::c_int = 0x0020; + +pub const NFQA_SKB_CSUMNOTREADY: ::c_int = 0x0001; +pub const NFQA_SKB_GSO: ::c_int = 0x0002; +pub const NFQA_SKB_CSUM_NOTVERIFIED: ::c_int = 0x0004; + +pub const GENL_NAMSIZ: ::c_int = 16; + +pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE; +pub const GENL_MAX_ID: ::c_int = 1023; + +pub const GENL_ADMIN_PERM: ::c_int = 0x01; +pub const GENL_CMD_CAP_DO: ::c_int = 0x02; +pub const GENL_CMD_CAP_DUMP: ::c_int = 0x04; +pub const GENL_CMD_CAP_HASPOL: ::c_int = 0x08; +pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10; + +pub const GENL_ID_CTRL: ::c_int = NLMSG_MIN_TYPE; +pub const GENL_ID_VFS_DQUOT: ::c_int = NLMSG_MIN_TYPE + 1; +pub const GENL_ID_PMCRAID: ::c_int = NLMSG_MIN_TYPE + 2; + +pub const CTRL_CMD_UNSPEC: ::c_int = 0; +pub const CTRL_CMD_NEWFAMILY: ::c_int = 1; +pub const CTRL_CMD_DELFAMILY: ::c_int = 2; +pub const CTRL_CMD_GETFAMILY: ::c_int = 3; +pub const CTRL_CMD_NEWOPS: ::c_int = 4; +pub const CTRL_CMD_DELOPS: ::c_int = 5; +pub const CTRL_CMD_GETOPS: ::c_int = 6; +pub const CTRL_CMD_NEWMCAST_GRP: ::c_int = 7; +pub const CTRL_CMD_DELMCAST_GRP: ::c_int = 8; +pub const CTRL_CMD_GETMCAST_GRP: ::c_int = 9; + +pub const CTRL_ATTR_UNSPEC: ::c_int = 0; +pub const CTRL_ATTR_FAMILY_ID: ::c_int = 1; +pub const CTRL_ATTR_FAMILY_NAME: ::c_int = 2; +pub const CTRL_ATTR_VERSION: ::c_int = 3; +pub const CTRL_ATTR_HDRSIZE: ::c_int = 4; +pub const CTRL_ATTR_MAXATTR: ::c_int = 5; +pub const CTRL_ATTR_OPS: ::c_int = 6; +pub const CTRL_ATTR_MCAST_GROUPS: ::c_int = 7; + +pub const CTRL_ATTR_OP_UNSPEC: ::c_int = 0; +pub const CTRL_ATTR_OP_ID: ::c_int = 1; +pub const CTRL_ATTR_OP_FLAGS: ::c_int = 2; + +pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0; +pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1; +pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2; + +pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1; +pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2; +pub const NETLINK_PKTINFO: ::c_int = 3; +pub const NETLINK_BROADCAST_ERROR: ::c_int = 4; +pub const NETLINK_NO_ENOBUFS: ::c_int = 5; +pub const NETLINK_RX_RING: ::c_int = 6; +pub const NETLINK_TX_RING: ::c_int = 7; +pub const NETLINK_LISTEN_ALL_NSID: ::c_int = 8; +pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9; +pub const NETLINK_CAP_ACK: ::c_int = 10; +pub const NETLINK_EXT_ACK: ::c_int = 11; +pub const NETLINK_GET_STRICT_CHK: ::c_int = 12; + +pub const GRND_NONBLOCK: ::c_uint = 0x0001; +pub const GRND_RANDOM: ::c_uint = 0x0002; +pub const GRND_INSECURE: ::c_uint = 0x0004; + +pub const SECCOMP_MODE_DISABLED: ::c_uint = 0; +pub const SECCOMP_MODE_STRICT: ::c_uint = 1; +pub const SECCOMP_MODE_FILTER: ::c_uint = 2; + +pub const SECCOMP_FILTER_FLAG_TSYNC: ::c_ulong = 1; +pub const SECCOMP_FILTER_FLAG_LOG: ::c_ulong = 2; +pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: ::c_ulong = 4; +pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: ::c_ulong = 8; + +pub const SECCOMP_RET_ACTION_FULL: ::c_uint = 0xffff0000; +pub const SECCOMP_RET_ACTION: ::c_uint = 0x7fff0000; +pub const SECCOMP_RET_DATA: ::c_uint = 0x0000ffff; + +pub const SECCOMP_RET_KILL_PROCESS: ::c_uint = 0x80000000; +pub const SECCOMP_RET_KILL_THREAD: ::c_uint = 0x00000000; +pub const SECCOMP_RET_KILL: ::c_uint = SECCOMP_RET_KILL_THREAD; +pub const SECCOMP_RET_TRAP: ::c_uint = 0x00030000; +pub const SECCOMP_RET_ERRNO: ::c_uint = 0x00050000; +pub const SECCOMP_RET_USER_NOTIF: ::c_uint = 0x7fc00000; +pub const SECCOMP_RET_TRACE: ::c_uint = 0x7ff00000; +pub const SECCOMP_RET_LOG: ::c_uint = 0x7ffc0000; +pub const SECCOMP_RET_ALLOW: ::c_uint = 0x7fff0000; + +pub const NLA_F_NESTED: ::c_int = 1 << 15; +pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14; +pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER); + +pub const NLA_ALIGNTO: ::c_int = 4; + +pub const SIGEV_THREAD_ID: ::c_int = 4; + +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; + +pub const TIOCM_LE: ::c_int = 0x001; +pub const TIOCM_DTR: ::c_int = 0x002; +pub const TIOCM_RTS: ::c_int = 0x004; +pub const TIOCM_ST: ::c_int = 0x008; +pub const TIOCM_SR: ::c_int = 0x010; +pub const TIOCM_CTS: ::c_int = 0x020; +pub const TIOCM_CAR: ::c_int = 0x040; +pub const TIOCM_RNG: ::c_int = 0x080; +pub const TIOCM_DSR: ::c_int = 0x100; +pub const TIOCM_CD: ::c_int = TIOCM_CAR; +pub const TIOCM_RI: ::c_int = TIOCM_RNG; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const SFD_CLOEXEC: ::c_int = O_CLOEXEC; +pub const SFD_NONBLOCK: ::c_int = O_NONBLOCK; + +pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK; + +pub const SO_ORIGINAL_DST: ::c_int = 80; + +pub const IP_RECVFRAGSIZE: ::c_int = 25; + +pub const IPV6_FLOWINFO: ::c_int = 11; +pub const IPV6_MULTICAST_ALL: ::c_int = 29; +pub const IPV6_ROUTER_ALERT_ISOLATE: ::c_int = 30; +pub const IPV6_FLOWLABEL_MGR: ::c_int = 32; +pub const IPV6_FLOWINFO_SEND: ::c_int = 33; +pub const IPV6_RECVFRAGSIZE: ::c_int = 77; +pub const IPV6_FREEBIND: ::c_int = 78; +pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff; +pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000; + +pub const IUTF8: ::tcflag_t = 0x00004000; +pub const CMSPAR: ::tcflag_t = 0o10000000000; +pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; + +pub const MFD_CLOEXEC: ::c_uint = 0x0001; +pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002; +pub const MFD_HUGETLB: ::c_uint = 0x0004; +pub const MFD_HUGE_64KB: ::c_uint = 0x40000000; +pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000; +pub const MFD_HUGE_1MB: ::c_uint = 0x50000000; +pub const MFD_HUGE_2MB: ::c_uint = 0x54000000; +pub const MFD_HUGE_8MB: ::c_uint = 0x5c000000; +pub const MFD_HUGE_16MB: ::c_uint = 0x60000000; +pub const MFD_HUGE_32MB: ::c_uint = 0x64000000; +pub const MFD_HUGE_256MB: ::c_uint = 0x70000000; +pub const MFD_HUGE_512MB: ::c_uint = 0x74000000; +pub const MFD_HUGE_1GB: ::c_uint = 0x78000000; +pub const MFD_HUGE_2GB: ::c_uint = 0x7c000000; +pub const MFD_HUGE_16GB: ::c_uint = 0x88000000; +pub const MFD_HUGE_MASK: ::c_uint = 63; +pub const MFD_HUGE_SHIFT: ::c_uint = 26; + +// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has +// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32 +// so we can use that type here to avoid having to cast. +pub const PT_NULL: u32 = 0; +pub const PT_LOAD: u32 = 1; +pub const PT_DYNAMIC: u32 = 2; +pub const PT_INTERP: u32 = 3; +pub const PT_NOTE: u32 = 4; +pub const PT_SHLIB: u32 = 5; +pub const PT_PHDR: u32 = 6; +pub const PT_TLS: u32 = 7; +pub const PT_LOOS: u32 = 0x60000000; +pub const PT_GNU_EH_FRAME: u32 = 0x6474e550; +pub const PT_GNU_STACK: u32 = 0x6474e551; +pub const PT_GNU_RELRO: u32 = 0x6474e552; +pub const PT_HIOS: u32 = 0x6fffffff; +pub const PT_LOPROC: u32 = 0x70000000; +pub const PT_HIPROC: u32 = 0x7fffffff; + +// linux/netfilter.h +pub const NF_DROP: ::c_int = 0; +pub const NF_ACCEPT: ::c_int = 1; +pub const NF_STOLEN: ::c_int = 2; +pub const NF_QUEUE: ::c_int = 3; +pub const NF_REPEAT: ::c_int = 4; +pub const NF_STOP: ::c_int = 5; +pub const NF_MAX_VERDICT: ::c_int = NF_STOP; + +pub const NF_VERDICT_MASK: ::c_int = 0x000000ff; +pub const NF_VERDICT_FLAG_QUEUE_BYPASS: ::c_int = 0x00008000; + +pub const NF_VERDICT_QMASK: ::c_int = 0xffff0000; +pub const NF_VERDICT_QBITS: ::c_int = 16; + +pub const NF_VERDICT_BITS: ::c_int = 16; + +pub const NF_INET_PRE_ROUTING: ::c_int = 0; +pub const NF_INET_LOCAL_IN: ::c_int = 1; +pub const NF_INET_FORWARD: ::c_int = 2; +pub const NF_INET_LOCAL_OUT: ::c_int = 3; +pub const NF_INET_POST_ROUTING: ::c_int = 4; +pub const NF_INET_NUMHOOKS: ::c_int = 5; + +pub const NF_NETDEV_INGRESS: ::c_int = 0; +pub const NF_NETDEV_NUMHOOKS: ::c_int = 1; + +pub const NFPROTO_UNSPEC: ::c_int = 0; +pub const NFPROTO_INET: ::c_int = 1; +pub const NFPROTO_IPV4: ::c_int = 2; +pub const NFPROTO_ARP: ::c_int = 3; +pub const NFPROTO_NETDEV: ::c_int = 5; +pub const NFPROTO_BRIDGE: ::c_int = 7; +pub const NFPROTO_IPV6: ::c_int = 10; +pub const NFPROTO_DECNET: ::c_int = 12; +pub const NFPROTO_NUMPROTO: ::c_int = 13; + +// linux/netfilter_ipv4.h +pub const NF_IP_PRE_ROUTING: ::c_int = 0; +pub const NF_IP_LOCAL_IN: ::c_int = 1; +pub const NF_IP_FORWARD: ::c_int = 2; +pub const NF_IP_LOCAL_OUT: ::c_int = 3; +pub const NF_IP_POST_ROUTING: ::c_int = 4; +pub const NF_IP_NUMHOOKS: ::c_int = 5; + +pub const NF_IP_PRI_FIRST: ::c_int = ::INT_MIN; +pub const NF_IP_PRI_CONNTRACK_DEFRAG: ::c_int = -400; +pub const NF_IP_PRI_RAW: ::c_int = -300; +pub const NF_IP_PRI_SELINUX_FIRST: ::c_int = -225; +pub const NF_IP_PRI_CONNTRACK: ::c_int = -200; +pub const NF_IP_PRI_MANGLE: ::c_int = -150; +pub const NF_IP_PRI_NAT_DST: ::c_int = -100; +pub const NF_IP_PRI_FILTER: ::c_int = 0; +pub const NF_IP_PRI_SECURITY: ::c_int = 50; +pub const NF_IP_PRI_NAT_SRC: ::c_int = 100; +pub const NF_IP_PRI_SELINUX_LAST: ::c_int = 225; +pub const NF_IP_PRI_CONNTRACK_HELPER: ::c_int = 300; +pub const NF_IP_PRI_CONNTRACK_CONFIRM: ::c_int = ::INT_MAX; +pub const NF_IP_PRI_LAST: ::c_int = ::INT_MAX; + +// linux/netfilter_ipv6.h +pub const NF_IP6_PRE_ROUTING: ::c_int = 0; +pub const NF_IP6_LOCAL_IN: ::c_int = 1; +pub const NF_IP6_FORWARD: ::c_int = 2; +pub const NF_IP6_LOCAL_OUT: ::c_int = 3; +pub const NF_IP6_POST_ROUTING: ::c_int = 4; +pub const NF_IP6_NUMHOOKS: ::c_int = 5; + +pub const NF_IP6_PRI_FIRST: ::c_int = ::INT_MIN; +pub const NF_IP6_PRI_CONNTRACK_DEFRAG: ::c_int = -400; +pub const NF_IP6_PRI_RAW: ::c_int = -300; +pub const NF_IP6_PRI_SELINUX_FIRST: ::c_int = -225; +pub const NF_IP6_PRI_CONNTRACK: ::c_int = -200; +pub const NF_IP6_PRI_MANGLE: ::c_int = -150; +pub const NF_IP6_PRI_NAT_DST: ::c_int = -100; +pub const NF_IP6_PRI_FILTER: ::c_int = 0; +pub const NF_IP6_PRI_SECURITY: ::c_int = 50; +pub const NF_IP6_PRI_NAT_SRC: ::c_int = 100; +pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225; +pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300; +pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX; + +// linux/netfilter_ipv6/ip6_tables.h +pub const IP6T_SO_ORIGINAL_DST: ::c_int = 80; + +// linux/netfilter/nf_tables.h +pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256; +pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256; +pub const NFT_SET_MAXNAMELEN: ::c_int = 256; +pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256; +pub const NFT_USERDATA_MAXLEN: ::c_int = 256; + +pub const NFT_REG_VERDICT: ::c_int = 0; +pub const NFT_REG_1: ::c_int = 1; +pub const NFT_REG_2: ::c_int = 2; +pub const NFT_REG_3: ::c_int = 3; +pub const NFT_REG_4: ::c_int = 4; +pub const __NFT_REG_MAX: ::c_int = 5; +pub const NFT_REG32_00: ::c_int = 8; +pub const NFT_REG32_01: ::c_int = 9; +pub const NFT_REG32_02: ::c_int = 10; +pub const NFT_REG32_03: ::c_int = 11; +pub const NFT_REG32_04: ::c_int = 12; +pub const NFT_REG32_05: ::c_int = 13; +pub const NFT_REG32_06: ::c_int = 14; +pub const NFT_REG32_07: ::c_int = 15; +pub const NFT_REG32_08: ::c_int = 16; +pub const NFT_REG32_09: ::c_int = 17; +pub const NFT_REG32_10: ::c_int = 18; +pub const NFT_REG32_11: ::c_int = 19; +pub const NFT_REG32_12: ::c_int = 20; +pub const NFT_REG32_13: ::c_int = 21; +pub const NFT_REG32_14: ::c_int = 22; +pub const NFT_REG32_15: ::c_int = 23; + +pub const NFT_REG_SIZE: ::c_int = 16; +pub const NFT_REG32_SIZE: ::c_int = 4; + +pub const NFT_CONTINUE: ::c_int = -1; +pub const NFT_BREAK: ::c_int = -2; +pub const NFT_JUMP: ::c_int = -3; +pub const NFT_GOTO: ::c_int = -4; +pub const NFT_RETURN: ::c_int = -5; + +pub const NFT_MSG_NEWTABLE: ::c_int = 0; +pub const NFT_MSG_GETTABLE: ::c_int = 1; +pub const NFT_MSG_DELTABLE: ::c_int = 2; +pub const NFT_MSG_NEWCHAIN: ::c_int = 3; +pub const NFT_MSG_GETCHAIN: ::c_int = 4; +pub const NFT_MSG_DELCHAIN: ::c_int = 5; +pub const NFT_MSG_NEWRULE: ::c_int = 6; +pub const NFT_MSG_GETRULE: ::c_int = 7; +pub const NFT_MSG_DELRULE: ::c_int = 8; +pub const NFT_MSG_NEWSET: ::c_int = 9; +pub const NFT_MSG_GETSET: ::c_int = 10; +pub const NFT_MSG_DELSET: ::c_int = 11; +pub const NFT_MSG_NEWSETELEM: ::c_int = 12; +pub const NFT_MSG_GETSETELEM: ::c_int = 13; +pub const NFT_MSG_DELSETELEM: ::c_int = 14; +pub const NFT_MSG_NEWGEN: ::c_int = 15; +pub const NFT_MSG_GETGEN: ::c_int = 16; +pub const NFT_MSG_TRACE: ::c_int = 17; +pub const NFT_MSG_NEWOBJ: ::c_int = 18; +pub const NFT_MSG_GETOBJ: ::c_int = 19; +pub const NFT_MSG_DELOBJ: ::c_int = 20; +pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21; +pub const NFT_MSG_MAX: ::c_int = 25; + +pub const NFT_SET_ANONYMOUS: ::c_int = 0x1; +pub const NFT_SET_CONSTANT: ::c_int = 0x2; +pub const NFT_SET_INTERVAL: ::c_int = 0x4; +pub const NFT_SET_MAP: ::c_int = 0x8; +pub const NFT_SET_TIMEOUT: ::c_int = 0x10; +pub const NFT_SET_EVAL: ::c_int = 0x20; + +pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0; +pub const NFT_SET_POL_MEMORY: ::c_int = 1; + +pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1; + +pub const NFT_DATA_VALUE: ::c_uint = 0; +pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00; + +pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00; + +pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64; + +pub const NFT_BYTEORDER_NTOH: ::c_int = 0; +pub const NFT_BYTEORDER_HTON: ::c_int = 1; + +pub const NFT_CMP_EQ: ::c_int = 0; +pub const NFT_CMP_NEQ: ::c_int = 1; +pub const NFT_CMP_LT: ::c_int = 2; +pub const NFT_CMP_LTE: ::c_int = 3; +pub const NFT_CMP_GT: ::c_int = 4; +pub const NFT_CMP_GTE: ::c_int = 5; + +pub const NFT_RANGE_EQ: ::c_int = 0; +pub const NFT_RANGE_NEQ: ::c_int = 1; + +pub const NFT_LOOKUP_F_INV: ::c_int = 1 << 0; + +pub const NFT_DYNSET_OP_ADD: ::c_int = 0; +pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1; + +pub const NFT_DYNSET_F_INV: ::c_int = 1 << 0; + +pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0; +pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1; +pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2; + +pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0; +pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1; + +pub const NFT_META_LEN: ::c_int = 0; +pub const NFT_META_PROTOCOL: ::c_int = 1; +pub const NFT_META_PRIORITY: ::c_int = 2; +pub const NFT_META_MARK: ::c_int = 3; +pub const NFT_META_IIF: ::c_int = 4; +pub const NFT_META_OIF: ::c_int = 5; +pub const NFT_META_IIFNAME: ::c_int = 6; +pub const NFT_META_OIFNAME: ::c_int = 7; +pub const NFT_META_IIFTYPE: ::c_int = 8; +pub const NFT_META_OIFTYPE: ::c_int = 9; +pub const NFT_META_SKUID: ::c_int = 10; +pub const NFT_META_SKGID: ::c_int = 11; +pub const NFT_META_NFTRACE: ::c_int = 12; +pub const NFT_META_RTCLASSID: ::c_int = 13; +pub const NFT_META_SECMARK: ::c_int = 14; +pub const NFT_META_NFPROTO: ::c_int = 15; +pub const NFT_META_L4PROTO: ::c_int = 16; +pub const NFT_META_BRI_IIFNAME: ::c_int = 17; +pub const NFT_META_BRI_OIFNAME: ::c_int = 18; +pub const NFT_META_PKTTYPE: ::c_int = 19; +pub const NFT_META_CPU: ::c_int = 20; +pub const NFT_META_IIFGROUP: ::c_int = 21; +pub const NFT_META_OIFGROUP: ::c_int = 22; +pub const NFT_META_CGROUP: ::c_int = 23; +pub const NFT_META_PRANDOM: ::c_int = 24; + +pub const NFT_CT_STATE: ::c_int = 0; +pub const NFT_CT_DIRECTION: ::c_int = 1; +pub const NFT_CT_STATUS: ::c_int = 2; +pub const NFT_CT_MARK: ::c_int = 3; +pub const NFT_CT_SECMARK: ::c_int = 4; +pub const NFT_CT_EXPIRATION: ::c_int = 5; +pub const NFT_CT_HELPER: ::c_int = 6; +pub const NFT_CT_L3PROTOCOL: ::c_int = 7; +pub const NFT_CT_SRC: ::c_int = 8; +pub const NFT_CT_DST: ::c_int = 9; +pub const NFT_CT_PROTOCOL: ::c_int = 10; +pub const NFT_CT_PROTO_SRC: ::c_int = 11; +pub const NFT_CT_PROTO_DST: ::c_int = 12; +pub const NFT_CT_LABELS: ::c_int = 13; +pub const NFT_CT_PKTS: ::c_int = 14; +pub const NFT_CT_BYTES: ::c_int = 15; + +pub const NFT_LIMIT_PKTS: ::c_int = 0; +pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1; + +pub const NFT_LIMIT_F_INV: ::c_int = 1 << 0; + +pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01; +pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02; +pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03; + +pub const NFT_QUOTA_F_INV: ::c_int = 1 << 0; + +pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0; +pub const NFT_REJECT_TCP_RST: ::c_int = 1; +pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2; + +pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0; +pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1; +pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2; +pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3; + +pub const NFT_NAT_SNAT: ::c_int = 0; +pub const NFT_NAT_DNAT: ::c_int = 1; + +pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0; +pub const NFT_TRACETYPE_POLICY: ::c_int = 1; +pub const NFT_TRACETYPE_RETURN: ::c_int = 2; +pub const NFT_TRACETYPE_RULE: ::c_int = 3; + +pub const NFT_NG_INCREMENTAL: ::c_int = 0; +pub const NFT_NG_RANDOM: ::c_int = 1; + +pub const IFF_TUN: ::c_int = 0x0001; +pub const IFF_TAP: ::c_int = 0x0002; +pub const IFF_NO_PI: ::c_int = 0x1000; + +// start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h +// from https://android.googlesource.com/ +// platform/bionic/+/master/libc/kernel/uapi/linux/if_ether.h +pub const ETH_ALEN: ::c_int = 6; +pub const ETH_HLEN: ::c_int = 14; +pub const ETH_ZLEN: ::c_int = 60; +pub const ETH_DATA_LEN: ::c_int = 1500; +pub const ETH_FRAME_LEN: ::c_int = 1514; +pub const ETH_FCS_LEN: ::c_int = 4; +pub const ETH_MIN_MTU: ::c_int = 68; +pub const ETH_MAX_MTU: ::c_int = 0xFFFF; +pub const ETH_P_LOOP: ::c_int = 0x0060; +pub const ETH_P_PUP: ::c_int = 0x0200; +pub const ETH_P_PUPAT: ::c_int = 0x0201; +pub const ETH_P_TSN: ::c_int = 0x22F0; +pub const ETH_P_IP: ::c_int = 0x0800; +pub const ETH_P_X25: ::c_int = 0x0805; +pub const ETH_P_ARP: ::c_int = 0x0806; +pub const ETH_P_BPQ: ::c_int = 0x08FF; +pub const ETH_P_IEEEPUP: ::c_int = 0x0a00; +pub const ETH_P_IEEEPUPAT: ::c_int = 0x0a01; +pub const ETH_P_BATMAN: ::c_int = 0x4305; +pub const ETH_P_DEC: ::c_int = 0x6000; +pub const ETH_P_DNA_DL: ::c_int = 0x6001; +pub const ETH_P_DNA_RC: ::c_int = 0x6002; +pub const ETH_P_DNA_RT: ::c_int = 0x6003; +pub const ETH_P_LAT: ::c_int = 0x6004; +pub const ETH_P_DIAG: ::c_int = 0x6005; +pub const ETH_P_CUST: ::c_int = 0x6006; +pub const ETH_P_SCA: ::c_int = 0x6007; +pub const ETH_P_TEB: ::c_int = 0x6558; +pub const ETH_P_RARP: ::c_int = 0x8035; +pub const ETH_P_ATALK: ::c_int = 0x809B; +pub const ETH_P_AARP: ::c_int = 0x80F3; +pub const ETH_P_8021Q: ::c_int = 0x8100; +/* see rust-lang/libc#924 pub const ETH_P_ERSPAN: ::c_int = 0x88BE;*/ +pub const ETH_P_IPX: ::c_int = 0x8137; +pub const ETH_P_IPV6: ::c_int = 0x86DD; +pub const ETH_P_PAUSE: ::c_int = 0x8808; +pub const ETH_P_SLOW: ::c_int = 0x8809; +pub const ETH_P_WCCP: ::c_int = 0x883E; +pub const ETH_P_MPLS_UC: ::c_int = 0x8847; +pub const ETH_P_MPLS_MC: ::c_int = 0x8848; +pub const ETH_P_ATMMPOA: ::c_int = 0x884c; +pub const ETH_P_PPP_DISC: ::c_int = 0x8863; +pub const ETH_P_PPP_SES: ::c_int = 0x8864; +pub const ETH_P_LINK_CTL: ::c_int = 0x886c; +pub const ETH_P_ATMFATE: ::c_int = 0x8884; +pub const ETH_P_PAE: ::c_int = 0x888E; +pub const ETH_P_AOE: ::c_int = 0x88A2; +pub const ETH_P_8021AD: ::c_int = 0x88A8; +pub const ETH_P_802_EX1: ::c_int = 0x88B5; +pub const ETH_P_TIPC: ::c_int = 0x88CA; +pub const ETH_P_MACSEC: ::c_int = 0x88E5; +pub const ETH_P_8021AH: ::c_int = 0x88E7; +pub const ETH_P_MVRP: ::c_int = 0x88F5; +pub const ETH_P_1588: ::c_int = 0x88F7; +pub const ETH_P_NCSI: ::c_int = 0x88F8; +pub const ETH_P_PRP: ::c_int = 0x88FB; +pub const ETH_P_FCOE: ::c_int = 0x8906; +/* see rust-lang/libc#924 pub const ETH_P_IBOE: ::c_int = 0x8915;*/ +pub const ETH_P_TDLS: ::c_int = 0x890D; +pub const ETH_P_FIP: ::c_int = 0x8914; +pub const ETH_P_80221: ::c_int = 0x8917; +pub const ETH_P_HSR: ::c_int = 0x892F; +/* see rust-lang/libc#924 pub const ETH_P_NSH: ::c_int = 0x894F;*/ +pub const ETH_P_LOOPBACK: ::c_int = 0x9000; +pub const ETH_P_QINQ1: ::c_int = 0x9100; +pub const ETH_P_QINQ2: ::c_int = 0x9200; +pub const ETH_P_QINQ3: ::c_int = 0x9300; +pub const ETH_P_EDSA: ::c_int = 0xDADA; +/* see rust-lang/libc#924 pub const ETH_P_IFE: ::c_int = 0xED3E;*/ +pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB; +pub const ETH_P_802_3_MIN: ::c_int = 0x0600; +pub const ETH_P_802_3: ::c_int = 0x0001; +pub const ETH_P_AX25: ::c_int = 0x0002; +pub const ETH_P_ALL: ::c_int = 0x0003; +pub const ETH_P_802_2: ::c_int = 0x0004; +pub const ETH_P_SNAP: ::c_int = 0x0005; +pub const ETH_P_DDCMP: ::c_int = 0x0006; +pub const ETH_P_WAN_PPP: ::c_int = 0x0007; +pub const ETH_P_PPP_MP: ::c_int = 0x0008; +pub const ETH_P_LOCALTALK: ::c_int = 0x0009; +pub const ETH_P_CAN: ::c_int = 0x000C; +pub const ETH_P_CANFD: ::c_int = 0x000D; +pub const ETH_P_PPPTALK: ::c_int = 0x0010; +pub const ETH_P_TR_802_2: ::c_int = 0x0011; +pub const ETH_P_MOBITEX: ::c_int = 0x0015; +pub const ETH_P_CONTROL: ::c_int = 0x0016; +pub const ETH_P_IRDA: ::c_int = 0x0017; +pub const ETH_P_ECONET: ::c_int = 0x0018; +pub const ETH_P_HDLC: ::c_int = 0x0019; +pub const ETH_P_ARCNET: ::c_int = 0x001A; +pub const ETH_P_DSA: ::c_int = 0x001B; +pub const ETH_P_TRAILER: ::c_int = 0x001C; +pub const ETH_P_PHONET: ::c_int = 0x00F5; +pub const ETH_P_IEEE802154: ::c_int = 0x00F6; +pub const ETH_P_CAIF: ::c_int = 0x00F7; +pub const ETH_P_XDSA: ::c_int = 0x00F8; +/* see rust-lang/libc#924 pub const ETH_P_MAP: ::c_int = 0x00F9;*/ +// end android/platform/bionic/libc/kernel/uapi/linux/if_ether.h + +pub const SIOCADDRT: ::c_ulong = 0x0000890B; +pub const SIOCDELRT: ::c_ulong = 0x0000890C; +pub const SIOCGIFNAME: ::c_ulong = 0x00008910; +pub const SIOCSIFLINK: ::c_ulong = 0x00008911; +pub const SIOCGIFCONF: ::c_ulong = 0x00008912; +pub const SIOCGIFFLAGS: ::c_ulong = 0x00008913; +pub const SIOCSIFFLAGS: ::c_ulong = 0x00008914; +pub const SIOCGIFADDR: ::c_ulong = 0x00008915; +pub const SIOCSIFADDR: ::c_ulong = 0x00008916; +pub const SIOCGIFDSTADDR: ::c_ulong = 0x00008917; +pub const SIOCSIFDSTADDR: ::c_ulong = 0x00008918; +pub const SIOCGIFBRDADDR: ::c_ulong = 0x00008919; +pub const SIOCSIFBRDADDR: ::c_ulong = 0x0000891A; +pub const SIOCGIFNETMASK: ::c_ulong = 0x0000891B; +pub const SIOCSIFNETMASK: ::c_ulong = 0x0000891C; +pub const SIOCGIFMETRIC: ::c_ulong = 0x0000891D; +pub const SIOCSIFMETRIC: ::c_ulong = 0x0000891E; +pub const SIOCGIFMEM: ::c_ulong = 0x0000891F; +pub const SIOCSIFMEM: ::c_ulong = 0x00008920; +pub const SIOCGIFMTU: ::c_ulong = 0x00008921; +pub const SIOCSIFMTU: ::c_ulong = 0x00008922; +pub const SIOCSIFHWADDR: ::c_ulong = 0x00008924; +pub const SIOCGIFENCAP: ::c_ulong = 0x00008925; +pub const SIOCSIFENCAP: ::c_ulong = 0x00008926; +pub const SIOCGIFHWADDR: ::c_ulong = 0x00008927; +pub const SIOCGIFSLAVE: ::c_ulong = 0x00008929; +pub const SIOCSIFSLAVE: ::c_ulong = 0x00008930; +pub const SIOCADDMULTI: ::c_ulong = 0x00008931; +pub const SIOCDELMULTI: ::c_ulong = 0x00008932; +pub const SIOCDARP: ::c_ulong = 0x00008953; +pub const SIOCGARP: ::c_ulong = 0x00008954; +pub const SIOCSARP: ::c_ulong = 0x00008955; +pub const SIOCDRARP: ::c_ulong = 0x00008960; +pub const SIOCGRARP: ::c_ulong = 0x00008961; +pub const SIOCSRARP: ::c_ulong = 0x00008962; +pub const SIOCGIFMAP: ::c_ulong = 0x00008970; +pub const SIOCSIFMAP: ::c_ulong = 0x00008971; + +// linux/module.h +pub const MODULE_INIT_IGNORE_MODVERSIONS: ::c_uint = 0x0001; +pub const MODULE_INIT_IGNORE_VERMAGIC: ::c_uint = 0x0002; + +#[deprecated( + since = "0.2.55", + note = "ENOATTR is not available on Android; use ENODATA instead" +)] +pub const ENOATTR: ::c_int = ::ENODATA; + +// linux/if_alg.h +pub const ALG_SET_KEY: ::c_int = 1; +pub const ALG_SET_IV: ::c_int = 2; +pub const ALG_SET_OP: ::c_int = 3; +pub const ALG_SET_AEAD_ASSOCLEN: ::c_int = 4; +pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5; + +pub const ALG_OP_DECRYPT: ::c_int = 0; +pub const ALG_OP_ENCRYPT: ::c_int = 1; + +// sys/mman.h +pub const MLOCK_ONFAULT: ::c_int = 0x01; + +// uapi/linux/vm_sockets.h +pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF; +pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0; +pub const VMADDR_CID_LOCAL: ::c_uint = 1; +pub const VMADDR_CID_HOST: ::c_uint = 2; +pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF; + +// uapi/linux/inotify.h +pub const IN_ACCESS: u32 = 0x0000_0001; +pub const IN_MODIFY: u32 = 0x0000_0002; +pub const IN_ATTRIB: u32 = 0x0000_0004; +pub const IN_CLOSE_WRITE: u32 = 0x0000_0008; +pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010; +pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE; +pub const IN_OPEN: u32 = 0x0000_0020; +pub const IN_MOVED_FROM: u32 = 0x0000_0040; +pub const IN_MOVED_TO: u32 = 0x0000_0080; +pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO; +pub const IN_CREATE: u32 = 0x0000_0100; +pub const IN_DELETE: u32 = 0x0000_0200; +pub const IN_DELETE_SELF: u32 = 0x0000_0400; +pub const IN_MOVE_SELF: u32 = 0x0000_0800; +pub const IN_UNMOUNT: u32 = 0x0000_2000; +pub const IN_Q_OVERFLOW: u32 = 0x0000_4000; +pub const IN_IGNORED: u32 = 0x0000_8000; +pub const IN_ONLYDIR: u32 = 0x0100_0000; +pub const IN_DONT_FOLLOW: u32 = 0x0200_0000; +// pub const IN_EXCL_UNLINK: u32 = 0x0400_0000; + +// pub const IN_MASK_CREATE: u32 = 0x1000_0000; +// pub const IN_MASK_ADD: u32 = 0x2000_0000; +pub const IN_ISDIR: u32 = 0x4000_0000; +pub const IN_ONESHOT: u32 = 0x8000_0000; + +pub const IN_ALL_EVENTS: u32 = IN_ACCESS + | IN_MODIFY + | IN_ATTRIB + | IN_CLOSE_WRITE + | IN_CLOSE_NOWRITE + | IN_OPEN + | IN_MOVED_FROM + | IN_MOVED_TO + | IN_DELETE + | IN_CREATE + | IN_DELETE_SELF + | IN_MOVE_SELF; + +pub const IN_CLOEXEC: ::c_int = O_CLOEXEC; +pub const IN_NONBLOCK: ::c_int = O_NONBLOCK; + +pub const FUTEX_WAIT: ::c_int = 0; +pub const FUTEX_WAKE: ::c_int = 1; +pub const FUTEX_FD: ::c_int = 2; +pub const FUTEX_REQUEUE: ::c_int = 3; +pub const FUTEX_CMP_REQUEUE: ::c_int = 4; +pub const FUTEX_WAKE_OP: ::c_int = 5; +pub const FUTEX_LOCK_PI: ::c_int = 6; +pub const FUTEX_UNLOCK_PI: ::c_int = 7; +pub const FUTEX_TRYLOCK_PI: ::c_int = 8; +pub const FUTEX_WAIT_BITSET: ::c_int = 9; +pub const FUTEX_WAKE_BITSET: ::c_int = 10; +pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11; +pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12; + +pub const FUTEX_PRIVATE_FLAG: ::c_int = 128; +pub const FUTEX_CLOCK_REALTIME: ::c_int = 256; +pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME); + +// linux/errqueue.h +pub const SO_EE_ORIGIN_NONE: u8 = 0; +pub const SO_EE_ORIGIN_LOCAL: u8 = 1; +pub const SO_EE_ORIGIN_ICMP: u8 = 2; +pub const SO_EE_ORIGIN_ICMP6: u8 = 3; +pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4; +pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS; + +// errno.h +pub const EPERM: ::c_int = 1; +pub const ENOENT: ::c_int = 2; +pub const ESRCH: ::c_int = 3; +pub const EINTR: ::c_int = 4; +pub const EIO: ::c_int = 5; +pub const ENXIO: ::c_int = 6; +pub const E2BIG: ::c_int = 7; +pub const ENOEXEC: ::c_int = 8; +pub const EBADF: ::c_int = 9; +pub const ECHILD: ::c_int = 10; +pub const EAGAIN: ::c_int = 11; +pub const ENOMEM: ::c_int = 12; +pub const EACCES: ::c_int = 13; +pub const EFAULT: ::c_int = 14; +pub const ENOTBLK: ::c_int = 15; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENFILE: ::c_int = 23; +pub const EMFILE: ::c_int = 24; +pub const ENOTTY: ::c_int = 25; +pub const ETXTBSY: ::c_int = 26; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDOM: ::c_int = 33; +pub const ERANGE: ::c_int = 34; +pub const EWOULDBLOCK: ::c_int = EAGAIN; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +// linux/sched.h +pub const SCHED_NORMAL: ::c_int = 0; +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_RR: ::c_int = 2; +pub const SCHED_BATCH: ::c_int = 3; +pub const SCHED_IDLE: ::c_int = 5; +pub const SCHED_DEADLINE: ::c_int = 6; + +pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000; + +pub const CLONE_PIDFD: ::c_int = 0x1000; + +// linux/mempolicy.h +pub const MPOL_DEFAULT: ::c_int = 0; +pub const MPOL_PREFERRED: ::c_int = 1; +pub const MPOL_BIND: ::c_int = 2; +pub const MPOL_INTERLEAVE: ::c_int = 3; +pub const MPOL_LOCAL: ::c_int = 4; +pub const MPOL_F_NUMA_BALANCING: ::c_int = 1 << 13; +pub const MPOL_F_RELATIVE_NODES: ::c_int = 1 << 14; +pub const MPOL_F_STATIC_NODES: ::c_int = 1 << 15; + +// bits/seek_constants.h +pub const SEEK_DATA: ::c_int = 3; +pub const SEEK_HOLE: ::c_int = 4; + +// sys/socket.h +pub const AF_NFC: ::c_int = 39; +pub const AF_VSOCK: ::c_int = 40; +pub const PF_NFC: ::c_int = AF_NFC; +pub const PF_VSOCK: ::c_int = AF_VSOCK; + +pub const SOMAXCONN: ::c_int = 128; + +// sys/system_properties.h +pub const PROP_VALUE_MAX: ::c_int = 92; +pub const PROP_NAME_MAX: ::c_int = 32; + +// sys/prctl.h +pub const PR_SET_VMA: ::c_int = 0x53564d41; +pub const PR_SET_VMA_ANON_NAME: ::c_int = 0; +pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38; +pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39; +pub const PR_GET_SECCOMP: ::c_int = 21; +pub const PR_SET_SECCOMP: ::c_int = 22; +pub const PR_GET_TIMING: ::c_int = 13; +pub const PR_SET_TIMING: ::c_int = 14; +pub const PR_TIMING_STATISTICAL: ::c_int = 0; +pub const PR_TIMING_TIMESTAMP: ::c_int = 1; + +// linux/if_addr.h +pub const IFA_UNSPEC: ::c_ushort = 0; +pub const IFA_ADDRESS: ::c_ushort = 1; +pub const IFA_LOCAL: ::c_ushort = 2; +pub const IFA_LABEL: ::c_ushort = 3; +pub const IFA_BROADCAST: ::c_ushort = 4; +pub const IFA_ANYCAST: ::c_ushort = 5; +pub const IFA_CACHEINFO: ::c_ushort = 6; +pub const IFA_MULTICAST: ::c_ushort = 7; + +pub const IFA_F_SECONDARY: u32 = 0x01; +pub const IFA_F_TEMPORARY: u32 = 0x01; +pub const IFA_F_NODAD: u32 = 0x02; +pub const IFA_F_OPTIMISTIC: u32 = 0x04; +pub const IFA_F_DADFAILED: u32 = 0x08; +pub const IFA_F_HOMEADDRESS: u32 = 0x10; +pub const IFA_F_DEPRECATED: u32 = 0x20; +pub const IFA_F_TENTATIVE: u32 = 0x40; +pub const IFA_F_PERMANENT: u32 = 0x80; + +// linux/if_link.h +pub const IFLA_UNSPEC: ::c_ushort = 0; +pub const IFLA_ADDRESS: ::c_ushort = 1; +pub const IFLA_BROADCAST: ::c_ushort = 2; +pub const IFLA_IFNAME: ::c_ushort = 3; +pub const IFLA_MTU: ::c_ushort = 4; +pub const IFLA_LINK: ::c_ushort = 5; +pub const IFLA_QDISC: ::c_ushort = 6; +pub const IFLA_STATS: ::c_ushort = 7; +pub const IFLA_COST: ::c_ushort = 8; +pub const IFLA_PRIORITY: ::c_ushort = 9; +pub const IFLA_MASTER: ::c_ushort = 10; +pub const IFLA_WIRELESS: ::c_ushort = 11; +pub const IFLA_PROTINFO: ::c_ushort = 12; +pub const IFLA_TXQLEN: ::c_ushort = 13; +pub const IFLA_MAP: ::c_ushort = 14; +pub const IFLA_WEIGHT: ::c_ushort = 15; +pub const IFLA_OPERSTATE: ::c_ushort = 16; +pub const IFLA_LINKMODE: ::c_ushort = 17; +pub const IFLA_LINKINFO: ::c_ushort = 18; +pub const IFLA_NET_NS_PID: ::c_ushort = 19; +pub const IFLA_IFALIAS: ::c_ushort = 20; +pub const IFLA_NUM_VF: ::c_ushort = 21; +pub const IFLA_VFINFO_LIST: ::c_ushort = 22; +pub const IFLA_STATS64: ::c_ushort = 23; +pub const IFLA_VF_PORTS: ::c_ushort = 24; +pub const IFLA_PORT_SELF: ::c_ushort = 25; +pub const IFLA_AF_SPEC: ::c_ushort = 26; +pub const IFLA_GROUP: ::c_ushort = 27; +pub const IFLA_NET_NS_FD: ::c_ushort = 28; +pub const IFLA_EXT_MASK: ::c_ushort = 29; +pub const IFLA_PROMISCUITY: ::c_ushort = 30; +pub const IFLA_NUM_TX_QUEUES: ::c_ushort = 31; +pub const IFLA_NUM_RX_QUEUES: ::c_ushort = 32; +pub const IFLA_CARRIER: ::c_ushort = 33; +pub const IFLA_PHYS_PORT_ID: ::c_ushort = 34; +pub const IFLA_CARRIER_CHANGES: ::c_ushort = 35; +pub const IFLA_PHYS_SWITCH_ID: ::c_ushort = 36; +pub const IFLA_LINK_NETNSID: ::c_ushort = 37; +pub const IFLA_PHYS_PORT_NAME: ::c_ushort = 38; +pub const IFLA_PROTO_DOWN: ::c_ushort = 39; +pub const IFLA_GSO_MAX_SEGS: ::c_ushort = 40; +pub const IFLA_GSO_MAX_SIZE: ::c_ushort = 41; +pub const IFLA_PAD: ::c_ushort = 42; +pub const IFLA_XDP: ::c_ushort = 43; +pub const IFLA_EVENT: ::c_ushort = 44; +pub const IFLA_NEW_NETNSID: ::c_ushort = 45; +pub const IFLA_IF_NETNSID: ::c_ushort = 46; +pub const IFLA_TARGET_NETNSID: ::c_ushort = IFLA_IF_NETNSID; +pub const IFLA_CARRIER_UP_COUNT: ::c_ushort = 47; +pub const IFLA_CARRIER_DOWN_COUNT: ::c_ushort = 48; +pub const IFLA_NEW_IFINDEX: ::c_ushort = 49; +pub const IFLA_MIN_MTU: ::c_ushort = 50; +pub const IFLA_MAX_MTU: ::c_ushort = 51; + +pub const IFLA_INFO_UNSPEC: ::c_ushort = 0; +pub const IFLA_INFO_KIND: ::c_ushort = 1; +pub const IFLA_INFO_DATA: ::c_ushort = 2; +pub const IFLA_INFO_XSTATS: ::c_ushort = 3; +pub const IFLA_INFO_SLAVE_KIND: ::c_ushort = 4; +pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5; + +// linux/rtnetlink.h +pub const TCA_UNSPEC: ::c_ushort = 0; +pub const TCA_KIND: ::c_ushort = 1; +pub const TCA_OPTIONS: ::c_ushort = 2; +pub const TCA_STATS: ::c_ushort = 3; +pub const TCA_XSTATS: ::c_ushort = 4; +pub const TCA_RATE: ::c_ushort = 5; +pub const TCA_FCNT: ::c_ushort = 6; +pub const TCA_STATS2: ::c_ushort = 7; +pub const TCA_STAB: ::c_ushort = 8; + +pub const RTM_NEWLINK: u16 = 16; +pub const RTM_DELLINK: u16 = 17; +pub const RTM_GETLINK: u16 = 18; +pub const RTM_SETLINK: u16 = 19; +pub const RTM_NEWADDR: u16 = 20; +pub const RTM_DELADDR: u16 = 21; +pub const RTM_GETADDR: u16 = 22; +pub const RTM_NEWROUTE: u16 = 24; +pub const RTM_DELROUTE: u16 = 25; +pub const RTM_GETROUTE: u16 = 26; +pub const RTM_NEWNEIGH: u16 = 28; +pub const RTM_DELNEIGH: u16 = 29; +pub const RTM_GETNEIGH: u16 = 30; +pub const RTM_NEWRULE: u16 = 32; +pub const RTM_DELRULE: u16 = 33; +pub const RTM_GETRULE: u16 = 34; +pub const RTM_NEWQDISC: u16 = 36; +pub const RTM_DELQDISC: u16 = 37; +pub const RTM_GETQDISC: u16 = 38; +pub const RTM_NEWTCLASS: u16 = 40; +pub const RTM_DELTCLASS: u16 = 41; +pub const RTM_GETTCLASS: u16 = 42; +pub const RTM_NEWTFILTER: u16 = 44; +pub const RTM_DELTFILTER: u16 = 45; +pub const RTM_GETTFILTER: u16 = 46; +pub const RTM_NEWACTION: u16 = 48; +pub const RTM_DELACTION: u16 = 49; +pub const RTM_GETACTION: u16 = 50; +pub const RTM_NEWPREFIX: u16 = 52; +pub const RTM_GETMULTICAST: u16 = 58; +pub const RTM_GETANYCAST: u16 = 62; +pub const RTM_NEWNEIGHTBL: u16 = 64; +pub const RTM_GETNEIGHTBL: u16 = 66; +pub const RTM_SETNEIGHTBL: u16 = 67; +pub const RTM_NEWNDUSEROPT: u16 = 68; +pub const RTM_NEWADDRLABEL: u16 = 72; +pub const RTM_DELADDRLABEL: u16 = 73; +pub const RTM_GETADDRLABEL: u16 = 74; +pub const RTM_GETDCB: u16 = 78; +pub const RTM_SETDCB: u16 = 79; +pub const RTM_NEWNETCONF: u16 = 80; +pub const RTM_GETNETCONF: u16 = 82; +pub const RTM_NEWMDB: u16 = 84; +pub const RTM_DELMDB: u16 = 85; +pub const RTM_GETMDB: u16 = 86; +pub const RTM_NEWNSID: u16 = 88; +pub const RTM_DELNSID: u16 = 89; +pub const RTM_GETNSID: u16 = 90; + +pub const RTM_F_NOTIFY: ::c_uint = 0x100; +pub const RTM_F_CLONED: ::c_uint = 0x200; +pub const RTM_F_EQUALIZE: ::c_uint = 0x400; +pub const RTM_F_PREFIX: ::c_uint = 0x800; + +pub const RTA_UNSPEC: ::c_ushort = 0; +pub const RTA_DST: ::c_ushort = 1; +pub const RTA_SRC: ::c_ushort = 2; +pub const RTA_IIF: ::c_ushort = 3; +pub const RTA_OIF: ::c_ushort = 4; +pub const RTA_GATEWAY: ::c_ushort = 5; +pub const RTA_PRIORITY: ::c_ushort = 6; +pub const RTA_PREFSRC: ::c_ushort = 7; +pub const RTA_METRICS: ::c_ushort = 8; +pub const RTA_MULTIPATH: ::c_ushort = 9; +pub const RTA_PROTOINFO: ::c_ushort = 10; // No longer used +pub const RTA_FLOW: ::c_ushort = 11; +pub const RTA_CACHEINFO: ::c_ushort = 12; +pub const RTA_SESSION: ::c_ushort = 13; // No longer used +pub const RTA_MP_ALGO: ::c_ushort = 14; // No longer used +pub const RTA_TABLE: ::c_ushort = 15; +pub const RTA_MARK: ::c_ushort = 16; +pub const RTA_MFC_STATS: ::c_ushort = 17; + +pub const RTN_UNSPEC: ::c_uchar = 0; +pub const RTN_UNICAST: ::c_uchar = 1; +pub const RTN_LOCAL: ::c_uchar = 2; +pub const RTN_BROADCAST: ::c_uchar = 3; +pub const RTN_ANYCAST: ::c_uchar = 4; +pub const RTN_MULTICAST: ::c_uchar = 5; +pub const RTN_BLACKHOLE: ::c_uchar = 6; +pub const RTN_UNREACHABLE: ::c_uchar = 7; +pub const RTN_PROHIBIT: ::c_uchar = 8; +pub const RTN_THROW: ::c_uchar = 9; +pub const RTN_NAT: ::c_uchar = 10; +pub const RTN_XRESOLVE: ::c_uchar = 11; + +pub const RTPROT_UNSPEC: ::c_uchar = 0; +pub const RTPROT_REDIRECT: ::c_uchar = 1; +pub const RTPROT_KERNEL: ::c_uchar = 2; +pub const RTPROT_BOOT: ::c_uchar = 3; +pub const RTPROT_STATIC: ::c_uchar = 4; + +pub const RT_SCOPE_UNIVERSE: ::c_uchar = 0; +pub const RT_SCOPE_SITE: ::c_uchar = 200; +pub const RT_SCOPE_LINK: ::c_uchar = 253; +pub const RT_SCOPE_HOST: ::c_uchar = 254; +pub const RT_SCOPE_NOWHERE: ::c_uchar = 255; + +pub const RT_TABLE_UNSPEC: ::c_uchar = 0; +pub const RT_TABLE_COMPAT: ::c_uchar = 252; +pub const RT_TABLE_DEFAULT: ::c_uchar = 253; +pub const RT_TABLE_MAIN: ::c_uchar = 254; +pub const RT_TABLE_LOCAL: ::c_uchar = 255; + +pub const RTMSG_NEWDEVICE: u32 = 0x11; +pub const RTMSG_DELDEVICE: u32 = 0x12; +pub const RTMSG_NEWROUTE: u32 = 0x21; +pub const RTMSG_DELROUTE: u32 = 0x22; + +f! { + pub fn CMSG_NXTHDR(mhdr: *const msghdr, + cmsg: *const cmsghdr) -> *mut cmsghdr { + let next = (cmsg as usize + + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) + as *mut cmsghdr; + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if (next.offset(1)) as usize > max { + 0 as *mut cmsghdr + } else { + next as *mut cmsghdr + } + } + + pub fn CPU_ALLOC_SIZE(count: ::c_int) -> ::size_t { + let _dummy: cpu_set_t = ::mem::zeroed(); + let size_in_bits = 8 * ::mem::size_of_val(&_dummy.__bits[0]); + ((count as ::size_t + size_in_bits - 1) / 8) as ::size_t + } + + pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { + for slot in cpuset.__bits.iter_mut() { + *slot = 0; + } + } + + pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let size_in_bits + = 8 * ::mem::size_of_val(&cpuset.__bits[0]); // 32, 64 etc + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + cpuset.__bits[idx] |= 1 << offset; + () + } + + pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let size_in_bits + = 8 * ::mem::size_of_val(&cpuset.__bits[0]); // 32, 64 etc + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + cpuset.__bits[idx] &= !(1 << offset); + () + } + + pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { + let size_in_bits = 8 * ::mem::size_of_val(&cpuset.__bits[0]); + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + 0 != (cpuset.__bits[idx] & (1 << offset)) + } + + pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> ::c_int { + let mut s: u32 = 0; + let size_of_mask = ::mem::size_of_val(&cpuset.__bits[0]); + for i in cpuset.__bits[..(size / size_of_mask)].iter() { + s += i.count_ones(); + }; + s as ::c_int + } + + pub fn CPU_COUNT(cpuset: &cpu_set_t) -> ::c_int { + CPU_COUNT_S(::mem::size_of::(), cpuset) + } + + pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { + set1.__bits == set2.__bits + } + + pub fn major(dev: ::dev_t) -> ::c_int { + ((dev >> 8) & 0xfff) as ::c_int + } + pub fn minor(dev: ::dev_t) -> ::c_int { + ((dev & 0xff) | ((dev >> 12) & 0xfff00)) as ::c_int + } + pub fn makedev(ma: ::c_int, mi: ::c_int) -> ::dev_t { + let ma = ma as ::dev_t; + let mi = mi as ::dev_t; + ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12) + } + + pub fn NLA_ALIGN(len: ::c_int) -> ::c_int { + return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1) + } + + pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr { + ee.offset(1) as *mut ::sockaddr + } +} + +extern "C" { + pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int; + pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int; + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + pub fn prlimit( + pid: ::pid_t, + resource: ::c_int, + new_limit: *const ::rlimit, + old_limit: *mut ::rlimit, + ) -> ::c_int; + pub fn prlimit64( + pid: ::pid_t, + resource: ::c_int, + new_limit: *const ::rlimit64, + old_limit: *mut ::rlimit64, + ) -> ::c_int; + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; + pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; + pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn recvfrom( + socket: ::c_int, + buf: *mut ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, + ) -> ::ssize_t; + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::size_t, + serv: *mut ::c_char, + sevlen: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn preadv(fd: ::c_int, iov: *const ::iovec, count: ::c_int, offset: ::off_t) -> ::ssize_t; + pub fn pwritev(fd: ::c_int, iov: *const ::iovec, count: ::c_int, offset: ::off_t) -> ::ssize_t; + pub fn process_vm_readv( + pid: ::pid_t, + local_iov: *const ::iovec, + local_iov_count: ::c_ulong, + remote_iov: *const ::iovec, + remote_iov_count: ::c_ulong, + flags: ::c_ulong, + ) -> ::ssize_t; + pub fn process_vm_writev( + pid: ::pid_t, + local_iov: *const ::iovec, + local_iov_count: ::c_ulong, + remote_iov: *const ::iovec, + remote_iov_count: ::c_ulong, + flags: ::c_ulong, + ) -> ::ssize_t; + pub fn ptrace(request: ::c_int, ...) -> ::c_long; + pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; + pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; + pub fn __sched_cpualloc(count: ::size_t) -> *mut ::cpu_set_t; + pub fn __sched_cpufree(set: *mut ::cpu_set_t); + pub fn __sched_cpucount(setsize: ::size_t, set: *const cpu_set_t) -> ::c_int; + pub fn sched_getcpu() -> ::c_int; + pub fn mallinfo() -> ::mallinfo; + // available from API 23 + pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int; + + pub fn malloc_usable_size(ptr: *const ::c_void) -> ::size_t; + + pub fn utmpname(name: *const ::c_char) -> ::c_int; + pub fn setutent(); + pub fn getutent() -> *mut utmp; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; + pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; + pub fn fallocate64(fd: ::c_int, mode: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int; + pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; + pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int; + pub fn getxattr( + path: *const c_char, + name: *const c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn lgetxattr( + path: *const c_char, + name: *const c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn fgetxattr( + filedes: ::c_int, + name: *const c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn setxattr( + path: *const c_char, + name: *const c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn lsetxattr( + path: *const c_char, + name: *const c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn fsetxattr( + filedes: ::c_int, + name: *const c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn listxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t; + pub fn llistxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t; + pub fn flistxattr(filedes: ::c_int, list: *mut c_char, size: ::size_t) -> ::ssize_t; + pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int; + pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int; + pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int; + pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int; + pub fn timerfd_create(clock: ::clockid_t, flags: ::c_int) -> ::c_int; + pub fn timerfd_gettime(fd: ::c_int, current_value: *mut itimerspec) -> ::c_int; + pub fn timerfd_settime( + fd: ::c_int, + flags: ::c_int, + new_value: *const itimerspec, + old_value: *mut itimerspec, + ) -> ::c_int; + pub fn syscall(num: ::c_long, ...) -> ::c_long; + pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t) + -> ::c_int; + pub fn sched_setaffinity( + pid: ::pid_t, + cpusetsize: ::size_t, + cpuset: *const cpu_set_t, + ) -> ::c_int; + pub fn epoll_create(size: ::c_int) -> ::c_int; + pub fn epoll_create1(flags: ::c_int) -> ::c_int; + pub fn epoll_wait( + epfd: ::c_int, + events: *mut ::epoll_event, + maxevents: ::c_int, + timeout: ::c_int, + ) -> ::c_int; + pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event) + -> ::c_int; + pub fn pthread_getschedparam( + native: ::pthread_t, + policy: *mut ::c_int, + param: *mut ::sched_param, + ) -> ::c_int; + pub fn unshare(flags: ::c_int) -> ::c_int; + pub fn umount(target: *const ::c_char) -> ::c_int; + pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; + pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t; + pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; + pub fn splice( + fd_in: ::c_int, + off_in: *mut ::loff_t, + fd_out: ::c_int, + off_out: *mut ::loff_t, + len: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int; + pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; + pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; + pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int; + pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int; + pub fn swapoff(puath: *const ::c_char) -> ::c_int; + pub fn vmsplice( + fd: ::c_int, + iov: *const ::iovec, + nr_segs: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; + pub fn mount( + src: *const ::c_char, + target: *const ::c_char, + fstype: *const ::c_char, + flags: ::c_ulong, + data: *const ::c_void, + ) -> ::c_int; + pub fn personality(persona: ::c_uint) -> ::c_int; + pub fn prctl(option: ::c_int, ...) -> ::c_int; + pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int; + pub fn ppoll( + fds: *mut ::pollfd, + nfds: nfds_t, + timeout: *const ::timespec, + sigmask: *const sigset_t, + ) -> ::c_int; + pub fn pthread_mutex_timedlock( + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int; + pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int; + pub fn pthread_barrierattr_getpshared( + attr: *const ::pthread_barrierattr_t, + shared: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_barrierattr_setpshared( + attr: *mut ::pthread_barrierattr_t, + shared: ::c_int, + ) -> ::c_int; + pub fn pthread_barrier_init( + barrier: *mut pthread_barrier_t, + attr: *const ::pthread_barrierattr_t, + count: ::c_uint, + ) -> ::c_int; + pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int; + pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int; + pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn clone( + cb: extern "C" fn(*mut ::c_void) -> ::c_int, + child_stack: *mut ::c_void, + flags: ::c_int, + arg: *mut ::c_void, + ... + ) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + pub fn pthread_attr_getguardsize( + attr: *const ::pthread_attr_t, + guardsize: *mut ::size_t, + ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; + pub fn pthread_condattr_getpshared( + attr: *const pthread_condattr_t, + pshared: *mut ::c_int, + ) -> ::c_int; + pub fn sysinfo(info: *mut ::sysinfo) -> ::c_int; + pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int; + pub fn pthread_setschedparam( + native: ::pthread_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int; + pub fn sched_setscheduler( + pid: ::pid_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + pub fn sendfile( + out_fd: ::c_int, + in_fd: ::c_int, + offset: *mut off_t, + count: ::size_t, + ) -> ::ssize_t; + pub fn setfsgid(gid: ::gid_t) -> ::c_int; + pub fn setfsuid(uid: ::uid_t) -> ::c_int; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; + pub fn getgrgid_r( + gid: ::gid_t, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getgrnam_r( + name: *const ::c_char, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + pub fn getpwnam_r( + name: *const ::c_char, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn getpwuid_r( + uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn sigtimedwait( + set: *const sigset_t, + info: *mut siginfo_t, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; + pub fn pthread_atfork( + prepare: ::Option, + parent: ::Option, + child: ::Option, + ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; + pub fn getgrouplist( + user: *const ::c_char, + group: ::gid_t, + groups: *mut ::gid_t, + ngroups: *mut ::c_int, + ) -> ::c_int; + pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; + pub fn pthread_mutexattr_getpshared( + attr: *const pthread_mutexattr_t, + pshared: *mut ::c_int, + ) -> ::c_int; + pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn faccessat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::c_int, + flags: ::c_int, + ) -> ::c_int; + pub fn pthread_create( + native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + pub fn __errno() -> *mut ::c_int; + pub fn inotify_rm_watch(fd: ::c_int, wd: u32) -> ::c_int; + pub fn sendmmsg( + sockfd: ::c_int, + msgvec: *const ::mmsghdr, + vlen: ::c_uint, + flags: ::c_int, + ) -> ::c_int; + pub fn recvmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn inotify_init() -> ::c_int; + pub fn inotify_init1(flags: ::c_int) -> ::c_int; + pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int; + + pub fn regcomp(preg: *mut ::regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int; + + pub fn regexec( + preg: *const ::regex_t, + input: *const ::c_char, + nmatch: ::size_t, + pmatch: *mut regmatch_t, + eflags: ::c_int, + ) -> ::c_int; + + pub fn regerror( + errcode: ::c_int, + preg: *const ::regex_t, + errbuf: *mut ::c_char, + errbuf_size: ::size_t, + ) -> ::size_t; + + pub fn regfree(preg: *mut ::regex_t); + + pub fn android_set_abort_message(msg: *const ::c_char); + + pub fn gettid() -> ::pid_t; + + pub fn __system_property_set(__name: *const ::c_char, __value: *const ::c_char) -> ::c_int; + pub fn __system_property_get(__name: *const ::c_char, __value: *mut ::c_char) -> ::c_int; + pub fn __system_property_find(__name: *const ::c_char) -> *const prop_info; + pub fn __system_property_find_nth(__n: ::c_uint) -> *const prop_info; + pub fn __system_property_foreach( + __callback: unsafe extern "C" fn(__pi: *const prop_info, __cookie: *mut ::c_void), + __cookie: *mut ::c_void, + ) -> ::c_int; + + // #include + /// Only available in API Version 21+ + pub fn dl_iterate_phdr( + callback: ::Option< + unsafe extern "C" fn( + info: *mut dl_phdr_info, + size: usize, + data: *mut ::c_void, + ) -> ::c_int, + >, + data: *mut ::c_void, + ) -> ::c_int; + + pub fn arc4random() -> u32; + pub fn arc4random_uniform(__upper_bound: u32) -> u32; + pub fn arc4random_buf(__buf: *mut ::c_void, __n: ::size_t); + + pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; + + pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_pointer_width = "32")] { + mod b32; + pub use self::b32::*; + } else if #[cfg(target_pointer_width = "64")] { + mod b64; + pub use self::b64::*; + } else { + // Unknown target_pointer_width + } +} + +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_void { + #[repr(C)] + struct siginfo_sigfault { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + si_addr: *mut ::c_void, + } + (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr + } + + pub unsafe fn si_value(&self) -> ::sigval { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + _si_tid: ::c_int, + _si_overrun: ::c_int, + si_sigval: ::sigval, + } + (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval + } +} + +cfg_if! { + if #[cfg(libc_union)] { + // Internal, for casts to access union fields + #[repr(C)] + struct sifields_sigchld { + si_pid: ::pid_t, + si_uid: ::uid_t, + si_status: ::c_int, + si_utime: ::c_long, + si_stime: ::c_long, + } + impl ::Copy for sifields_sigchld {} + impl ::Clone for sifields_sigchld { + fn clone(&self) -> sifields_sigchld { + *self + } + } + + // Internal, for casts to access union fields + #[repr(C)] + union sifields { + _align_pointer: *mut ::c_void, + sigchld: sifields_sigchld, + } + + // Internal, for casts to access union fields. Note that some variants + // of sifields start with a pointer, which makes the alignment of + // sifields vary on 32-bit and 64-bit architectures. + #[repr(C)] + struct siginfo_f { + _siginfo_base: [::c_int; 3], + sifields: sifields, + } + + impl siginfo_t { + unsafe fn sifields(&self) -> &sifields { + &(*(self as *const siginfo_t as *const siginfo_f)).sifields + } + + pub unsafe fn si_pid(&self) -> ::pid_t { + self.sifields().sigchld.si_pid + } + + pub unsafe fn si_uid(&self) -> ::uid_t { + self.sifields().sigchld.si_uid + } + + pub unsafe fn si_status(&self) -> ::c_int { + self.sifields().sigchld.si_status + } + + pub unsafe fn si_utime(&self) -> ::c_long { + self.sifields().sigchld.si_utime + } + + pub unsafe fn si_stime(&self) -> ::c_long { + self.sifields().sigchld.si_stime + } + } + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..b9ea3f39efdf5dceabea9be62387e702b58d62d0 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/align.rs @@ -0,0 +1,74 @@ +macro_rules! expand_align { + () => { + s! { + #[allow(missing_debug_implementations)] + #[repr(align(4))] + pub struct pthread_mutex_t { + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + + #[repr(align(4))] + pub struct pthread_rwlock_t { + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + + #[repr(align(4))] + pub struct pthread_mutexattr_t { + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + #[repr(align(4))] + pub struct pthread_rwlockattr_t { + size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T], + } + + #[repr(align(4))] + pub struct pthread_condattr_t { + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + } + + s_no_extra_traits! { + #[cfg_attr(target_pointer_width = "32", + repr(align(4)))] + #[cfg_attr(target_pointer_width = "64", + repr(align(8)))] + pub struct pthread_cond_t { + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 4] + } + + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for pthread_cond_t { + fn eq(&self, other: &pthread_cond_t) -> bool { + self.size + .iter() + .zip(other.size.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_cond_t {} + impl ::fmt::Debug for pthread_cond_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_cond_t") + // FIXME: .field("size", &self.size) + .finish() + } + } + impl ::hash::Hash for pthread_cond_t { + fn hash(&self, state: &mut H) { + self.size.hash(state); + } + } + } + } + }; +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..31d0ebf25b104b175610b7974965fa4e224e6b8a --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/mod.rs @@ -0,0 +1,1895 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type useconds_t = u32; +pub type dev_t = u32; +pub type socklen_t = u32; +pub type pthread_t = c_ulong; +pub type mode_t = u32; +pub type ino64_t = u64; +pub type off64_t = i64; +pub type blkcnt64_t = i32; +pub type rlim64_t = u64; +pub type shmatt_t = ::c_ulong; +pub type mqd_t = ::c_int; +pub type msgqnum_t = ::c_ulong; +pub type msglen_t = ::c_ulong; +pub type nfds_t = ::c_ulong; +pub type nl_item = ::c_int; +pub type idtype_t = ::c_uint; +pub type loff_t = i64; +pub type pthread_key_t = ::c_uint; + +pub type clock_t = c_long; +pub type time_t = c_long; +pub type suseconds_t = c_long; +pub type ino_t = u64; +pub type off_t = i64; +pub type blkcnt_t = i32; + +pub type blksize_t = c_long; +pub type fsblkcnt_t = u32; +pub type fsfilcnt_t = u32; +pub type rlim_t = ::c_ulonglong; +pub type c_long = i32; +pub type c_ulong = u32; +pub type nlink_t = u32; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum fpos64_t {} // FIXME: fill this out with a struct +impl ::Copy for fpos64_t {} +impl ::Clone for fpos64_t { + fn clone(&self) -> fpos64_t { + *self + } +} + +s! { + pub struct rlimit64 { + pub rlim_cur: rlim64_t, + pub rlim_max: rlim64_t, + } + + pub struct glob_t { + pub gl_pathc: ::size_t, + pub gl_pathv: *mut *mut c_char, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + + __unused1: *mut ::c_void, + __unused2: *mut ::c_void, + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + } + + pub struct passwd { + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_gecos: *mut ::c_char, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char, + } + + pub struct spwd { + pub sp_namp: *mut ::c_char, + pub sp_pwdp: *mut ::c_char, + pub sp_lstchg: ::c_long, + pub sp_min: ::c_long, + pub sp_max: ::c_long, + pub sp_warn: ::c_long, + pub sp_inact: ::c_long, + pub sp_expire: ::c_long, + pub sp_flag: ::c_ulong, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct dqblk { + pub dqb_bhardlimit: u64, + pub dqb_bsoftlimit: u64, + pub dqb_curspace: u64, + pub dqb_ihardlimit: u64, + pub dqb_isoftlimit: u64, + pub dqb_curinodes: u64, + pub dqb_btime: u64, + pub dqb_itime: u64, + pub dqb_valid: u32, + } + + pub struct signalfd_siginfo { + pub ssi_signo: u32, + pub ssi_errno: i32, + pub ssi_code: i32, + pub ssi_pid: u32, + pub ssi_uid: u32, + pub ssi_fd: i32, + pub ssi_tid: u32, + pub ssi_band: u32, + pub ssi_overrun: u32, + pub ssi_trapno: u32, + pub ssi_status: i32, + pub ssi_int: i32, + pub ssi_ptr: u64, + pub ssi_utime: u64, + pub ssi_stime: u64, + pub ssi_addr: u64, + pub ssi_addr_lsb: u16, + _pad2: u16, + pub ssi_syscall: i32, + pub ssi_call_addr: u64, + pub ssi_arch: u32, + _pad: [u8; 28], + } + + pub struct fsid_t { + __val: [::c_int; 2], + } + + pub struct cpu_set_t { + bits: [u32; 32], + } + + pub struct if_nameindex { + pub if_index: ::c_uint, + pub if_name: *mut ::c_char, + } + + // System V IPC + pub struct msginfo { + pub msgpool: ::c_int, + pub msgmap: ::c_int, + pub msgmax: ::c_int, + pub msgmnb: ::c_int, + pub msgmni: ::c_int, + pub msgssz: ::c_int, + pub msgtql: ::c_int, + pub msgseg: ::c_ushort, + } + + pub struct sembuf { + pub sem_num: ::c_ushort, + pub sem_op: ::c_short, + pub sem_flg: ::c_short, + } + + pub struct aiocb { + pub aio_fildes: ::c_int, + pub aio_lio_opcode: ::c_int, + pub aio_reqprio: ::c_int, + pub aio_buf: *mut ::c_void, + pub aio_nbytes: ::size_t, + pub aio_sigevent: ::sigevent, + __td: *mut ::c_void, + __lock: [::c_int; 2], + __err: ::c_int, + __ret: ::ssize_t, + pub aio_offset: off_t, + __next: *mut ::c_void, + __prev: *mut ::c_void, + __dummy4: [::c_char; 24], + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __unused1: ::c_long, + __unused2: ::c_long + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + pub __c_ispeed: ::speed_t, + pub __c_ospeed: ::speed_t, + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct pthread_attr_t { + __size: [u32; 11] + } + + pub struct sigset_t { + __val: [::c_ulong; 32], + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::c_int, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::socklen_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: ::socklen_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct sem_t { + __val: [::c_int; 4], + } + pub struct stat { + pub st_dev: ::dev_t, + __st_dev_padding: ::c_int, + __st_ino_truncated: ::c_long, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __st_rdev_padding: ::c_int, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::ino_t, + } + + pub struct stat64 { + pub st_dev: ::dev_t, + __st_dev_padding: ::c_int, + __st_ino_truncated: ::c_long, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __st_rdev_padding: ::c_int, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::ino_t, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + __unused1: ::c_int, + pub shm_dtime: ::time_t, + __unused2: ::c_int, + pub shm_ctime: ::time_t, + __unused3: ::c_int, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::c_ulong, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + __unused1: ::c_int, + pub msg_rtime: ::time_t, + __unused2: ::c_int, + pub msg_ctime: ::time_t, + __unused3: ::c_int, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct statfs { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u32, + pub f_bfree: u32, + pub f_bavail: u32, + pub f_files: u32, + pub f_ffree: u32, + pub f_favail: u32, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct arpd_request { + pub req: ::c_ushort, + pub ip: u32, + pub dev: ::c_ulong, + pub stamp: ::c_ulong, + pub updated: ::c_ulong, + pub ha: [::c_uchar; ::MAX_ADDR_LEN], + } +} + +s_no_extra_traits! { + pub struct dirent { + pub d_ino: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + + pub struct dirent64 { + pub d_ino: ::ino64_t, + pub d_off: ::off64_t, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + + pub struct sysinfo { + pub uptime: ::c_ulong, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, + pub freeram: ::c_ulong, + pub sharedram: ::c_ulong, + pub bufferram: ::c_ulong, + pub totalswap: ::c_ulong, + pub freeswap: ::c_ulong, + pub procs: ::c_ushort, + pub pad: ::c_ushort, + pub totalhigh: ::c_ulong, + pub freehigh: ::c_ulong, + pub mem_unit: ::c_uint, + pub __reserved: [::c_char; 256], + } + + pub struct mq_attr { + pub mq_flags: ::c_long, + pub mq_maxmsg: ::c_long, + pub mq_msgsize: ::c_long, + pub mq_curmsgs: ::c_long, + pad: [::c_long; 4] + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_ino == other.d_ino + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent {} + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_ino", &self.d_ino) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for dirent64 { + fn eq(&self, other: &dirent64) -> bool { + self.d_ino == other.d_ino + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for dirent64 {} + impl ::fmt::Debug for dirent64 { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent64") + .field("d_ino", &self.d_ino) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + impl ::hash::Hash for dirent64 { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for sysinfo { + fn eq(&self, other: &sysinfo) -> bool { + self.uptime == other.uptime + && self.loads == other.loads + && self.totalram == other.totalram + && self.freeram == other.freeram + && self.sharedram == other.sharedram + && self.bufferram == other.bufferram + && self.totalswap == other.totalswap + && self.freeswap == other.freeswap + && self.procs == other.procs + && self.pad == other.pad + && self.totalhigh == other.totalhigh + && self.freehigh == other.freehigh + && self.mem_unit == other.mem_unit + && self + .__reserved + .iter() + .zip(other.__reserved.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sysinfo {} + impl ::fmt::Debug for sysinfo { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sysinfo") + .field("uptime", &self.uptime) + .field("loads", &self.loads) + .field("totalram", &self.totalram) + .field("freeram", &self.freeram) + .field("sharedram", &self.sharedram) + .field("bufferram", &self.bufferram) + .field("totalswap", &self.totalswap) + .field("freeswap", &self.freeswap) + .field("procs", &self.procs) + .field("pad", &self.pad) + .field("totalhigh", &self.totalhigh) + .field("freehigh", &self.freehigh) + .field("mem_unit", &self.mem_unit) + // FIXME: .field("__reserved", &self.__reserved) + .finish() + } + } + impl ::hash::Hash for sysinfo { + fn hash(&self, state: &mut H) { + self.uptime.hash(state); + self.loads.hash(state); + self.totalram.hash(state); + self.freeram.hash(state); + self.sharedram.hash(state); + self.bufferram.hash(state); + self.totalswap.hash(state); + self.freeswap.hash(state); + self.procs.hash(state); + self.pad.hash(state); + self.totalhigh.hash(state); + self.freehigh.hash(state); + self.mem_unit.hash(state); + self.__reserved.hash(state); + } + } + + impl PartialEq for mq_attr { + fn eq(&self, other: &mq_attr) -> bool { + self.mq_flags == other.mq_flags && + self.mq_maxmsg == other.mq_maxmsg && + self.mq_msgsize == other.mq_msgsize && + self.mq_curmsgs == other.mq_curmsgs + } + } + impl Eq for mq_attr {} + impl ::fmt::Debug for mq_attr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mq_attr") + .field("mq_flags", &self.mq_flags) + .field("mq_maxmsg", &self.mq_maxmsg) + .field("mq_msgsize", &self.mq_msgsize) + .field("mq_curmsgs", &self.mq_curmsgs) + .finish() + } + } + impl ::hash::Hash for mq_attr { + fn hash(&self, state: &mut H) { + self.mq_flags.hash(state); + self.mq_maxmsg.hash(state); + self.mq_msgsize.hash(state); + self.mq_curmsgs.hash(state); + } + } + } +} + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MS_NOUSER: ::c_ulong = 0x80000000; +pub const MS_RMT_MASK: ::c_ulong = 0x02800051; + +pub const ABDAY_1: ::nl_item = 0x20000; +pub const ABDAY_2: ::nl_item = 0x20001; +pub const ABDAY_3: ::nl_item = 0x20002; +pub const ABDAY_4: ::nl_item = 0x20003; +pub const ABDAY_5: ::nl_item = 0x20004; +pub const ABDAY_6: ::nl_item = 0x20005; +pub const ABDAY_7: ::nl_item = 0x20006; + +pub const DAY_1: ::nl_item = 0x20007; +pub const DAY_2: ::nl_item = 0x20008; +pub const DAY_3: ::nl_item = 0x20009; +pub const DAY_4: ::nl_item = 0x2000A; +pub const DAY_5: ::nl_item = 0x2000B; +pub const DAY_6: ::nl_item = 0x2000C; +pub const DAY_7: ::nl_item = 0x2000D; + +pub const ABMON_1: ::nl_item = 0x2000E; +pub const ABMON_2: ::nl_item = 0x2000F; +pub const ABMON_3: ::nl_item = 0x20010; +pub const ABMON_4: ::nl_item = 0x20011; +pub const ABMON_5: ::nl_item = 0x20012; +pub const ABMON_6: ::nl_item = 0x20013; +pub const ABMON_7: ::nl_item = 0x20014; +pub const ABMON_8: ::nl_item = 0x20015; +pub const ABMON_9: ::nl_item = 0x20016; +pub const ABMON_10: ::nl_item = 0x20017; +pub const ABMON_11: ::nl_item = 0x20018; +pub const ABMON_12: ::nl_item = 0x20019; + +pub const MON_1: ::nl_item = 0x2001A; +pub const MON_2: ::nl_item = 0x2001B; +pub const MON_3: ::nl_item = 0x2001C; +pub const MON_4: ::nl_item = 0x2001D; +pub const MON_5: ::nl_item = 0x2001E; +pub const MON_6: ::nl_item = 0x2001F; +pub const MON_7: ::nl_item = 0x20020; +pub const MON_8: ::nl_item = 0x20021; +pub const MON_9: ::nl_item = 0x20022; +pub const MON_10: ::nl_item = 0x20023; +pub const MON_11: ::nl_item = 0x20024; +pub const MON_12: ::nl_item = 0x20025; + +pub const AM_STR: ::nl_item = 0x20026; +pub const PM_STR: ::nl_item = 0x20027; + +pub const D_T_FMT: ::nl_item = 0x20028; +pub const D_FMT: ::nl_item = 0x20029; +pub const T_FMT: ::nl_item = 0x2002A; +pub const T_FMT_AMPM: ::nl_item = 0x2002B; + +pub const ERA: ::nl_item = 0x2002C; +pub const ERA_D_FMT: ::nl_item = 0x2002E; +pub const ALT_DIGITS: ::nl_item = 0x2002F; +pub const ERA_D_T_FMT: ::nl_item = 0x20030; +pub const ERA_T_FMT: ::nl_item = 0x20031; + +pub const CODESET: ::nl_item = 14; + +pub const CRNCYSTR: ::nl_item = 0x4000F; + +pub const RUSAGE_THREAD: ::c_int = 1; +pub const RUSAGE_CHILDREN: ::c_int = -1; + +pub const RADIXCHAR: ::nl_item = 0x10000; +pub const THOUSEP: ::nl_item = 0x10001; + +pub const YESEXPR: ::nl_item = 0x50000; +pub const NOEXPR: ::nl_item = 0x50001; +pub const YESSTR: ::nl_item = 0x50002; +pub const NOSTR: ::nl_item = 0x50003; + +pub const FILENAME_MAX: ::c_uint = 4096; +pub const L_tmpnam: ::c_uint = 20; +pub const _PC_LINK_MAX: ::c_int = 0; +pub const _PC_MAX_CANON: ::c_int = 1; +pub const _PC_MAX_INPUT: ::c_int = 2; +pub const _PC_NAME_MAX: ::c_int = 3; +pub const _PC_PATH_MAX: ::c_int = 4; +pub const _PC_PIPE_BUF: ::c_int = 5; +pub const _PC_CHOWN_RESTRICTED: ::c_int = 6; +pub const _PC_NO_TRUNC: ::c_int = 7; +pub const _PC_VDISABLE: ::c_int = 8; +pub const _PC_SYNC_IO: ::c_int = 9; +pub const _PC_ASYNC_IO: ::c_int = 10; +pub const _PC_PRIO_IO: ::c_int = 11; +pub const _PC_SOCK_MAXBUF: ::c_int = 12; +pub const _PC_FILESIZEBITS: ::c_int = 13; +pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14; +pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15; +pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16; +pub const _PC_REC_XFER_ALIGN: ::c_int = 17; +pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18; +pub const _PC_SYMLINK_MAX: ::c_int = 19; +pub const _PC_2_SYMLINKS: ::c_int = 20; + +pub const _SC_ARG_MAX: ::c_int = 0; +pub const _SC_CHILD_MAX: ::c_int = 1; +pub const _SC_CLK_TCK: ::c_int = 2; +pub const _SC_NGROUPS_MAX: ::c_int = 3; +pub const _SC_OPEN_MAX: ::c_int = 4; +pub const _SC_STREAM_MAX: ::c_int = 5; +pub const _SC_TZNAME_MAX: ::c_int = 6; +pub const _SC_JOB_CONTROL: ::c_int = 7; +pub const _SC_SAVED_IDS: ::c_int = 8; +pub const _SC_REALTIME_SIGNALS: ::c_int = 9; +pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10; +pub const _SC_TIMERS: ::c_int = 11; +pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12; +pub const _SC_PRIORITIZED_IO: ::c_int = 13; +pub const _SC_SYNCHRONIZED_IO: ::c_int = 14; +pub const _SC_FSYNC: ::c_int = 15; +pub const _SC_MAPPED_FILES: ::c_int = 16; +pub const _SC_MEMLOCK: ::c_int = 17; +pub const _SC_MEMLOCK_RANGE: ::c_int = 18; +pub const _SC_MEMORY_PROTECTION: ::c_int = 19; +pub const _SC_MESSAGE_PASSING: ::c_int = 20; +pub const _SC_SEMAPHORES: ::c_int = 21; +pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22; +pub const _SC_AIO_LISTIO_MAX: ::c_int = 23; +pub const _SC_AIO_MAX: ::c_int = 24; +pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25; +pub const _SC_DELAYTIMER_MAX: ::c_int = 26; +pub const _SC_MQ_OPEN_MAX: ::c_int = 27; +pub const _SC_MQ_PRIO_MAX: ::c_int = 28; +pub const _SC_VERSION: ::c_int = 29; +pub const _SC_PAGESIZE: ::c_int = 30; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; +pub const _SC_RTSIG_MAX: ::c_int = 31; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 32; +pub const _SC_SEM_VALUE_MAX: ::c_int = 33; +pub const _SC_SIGQUEUE_MAX: ::c_int = 34; +pub const _SC_TIMER_MAX: ::c_int = 35; +pub const _SC_BC_BASE_MAX: ::c_int = 36; +pub const _SC_BC_DIM_MAX: ::c_int = 37; +pub const _SC_BC_SCALE_MAX: ::c_int = 38; +pub const _SC_BC_STRING_MAX: ::c_int = 39; +pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40; +pub const _SC_EXPR_NEST_MAX: ::c_int = 42; +pub const _SC_LINE_MAX: ::c_int = 43; +pub const _SC_RE_DUP_MAX: ::c_int = 44; +pub const _SC_2_VERSION: ::c_int = 46; +pub const _SC_2_C_BIND: ::c_int = 47; +pub const _SC_2_C_DEV: ::c_int = 48; +pub const _SC_2_FORT_DEV: ::c_int = 49; +pub const _SC_2_FORT_RUN: ::c_int = 50; +pub const _SC_2_SW_DEV: ::c_int = 51; +pub const _SC_2_LOCALEDEF: ::c_int = 52; +pub const _SC_UIO_MAXIOV: ::c_int = 60; +pub const _SC_IOV_MAX: ::c_int = 60; +pub const _SC_THREADS: ::c_int = 67; +pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70; +pub const _SC_LOGIN_NAME_MAX: ::c_int = 71; +pub const _SC_TTY_NAME_MAX: ::c_int = 72; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73; +pub const _SC_THREAD_KEYS_MAX: ::c_int = 74; +pub const _SC_THREAD_STACK_MIN: ::c_int = 75; +pub const _SC_THREAD_THREADS_MAX: ::c_int = 76; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79; +pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80; +pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82; +pub const _SC_NPROCESSORS_CONF: ::c_int = 83; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 84; +pub const _SC_PHYS_PAGES: ::c_int = 85; +pub const _SC_AVPHYS_PAGES: ::c_int = 86; +pub const _SC_ATEXIT_MAX: ::c_int = 87; +pub const _SC_PASS_MAX: ::c_int = 88; +pub const _SC_XOPEN_VERSION: ::c_int = 89; +pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90; +pub const _SC_XOPEN_UNIX: ::c_int = 91; +pub const _SC_XOPEN_CRYPT: ::c_int = 92; +pub const _SC_XOPEN_ENH_I18N: ::c_int = 93; +pub const _SC_XOPEN_SHM: ::c_int = 94; +pub const _SC_2_CHAR_TERM: ::c_int = 95; +pub const _SC_2_UPE: ::c_int = 97; +pub const _SC_XOPEN_XPG2: ::c_int = 98; +pub const _SC_XOPEN_XPG3: ::c_int = 99; +pub const _SC_XOPEN_XPG4: ::c_int = 100; +pub const _SC_NZERO: ::c_int = 109; +pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125; +pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126; +pub const _SC_XBS5_LP64_OFF64: ::c_int = 127; +pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128; +pub const _SC_XOPEN_LEGACY: ::c_int = 129; +pub const _SC_XOPEN_REALTIME: ::c_int = 130; +pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131; +pub const _SC_ADVISORY_INFO: ::c_int = 132; +pub const _SC_BARRIERS: ::c_int = 133; +pub const _SC_CLOCK_SELECTION: ::c_int = 137; +pub const _SC_CPUTIME: ::c_int = 138; +pub const _SC_THREAD_CPUTIME: ::c_int = 139; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 149; +pub const _SC_READER_WRITER_LOCKS: ::c_int = 153; +pub const _SC_SPIN_LOCKS: ::c_int = 154; +pub const _SC_REGEXP: ::c_int = 155; +pub const _SC_SHELL: ::c_int = 157; +pub const _SC_SPAWN: ::c_int = 159; +pub const _SC_SPORADIC_SERVER: ::c_int = 160; +pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161; +pub const _SC_TIMEOUTS: ::c_int = 164; +pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165; +pub const _SC_2_PBS: ::c_int = 168; +pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169; +pub const _SC_2_PBS_LOCATE: ::c_int = 170; +pub const _SC_2_PBS_MESSAGE: ::c_int = 171; +pub const _SC_2_PBS_TRACK: ::c_int = 172; +pub const _SC_SYMLOOP_MAX: ::c_int = 173; +pub const _SC_STREAMS: ::c_int = 174; +pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175; +pub const _SC_V6_ILP32_OFF32: ::c_int = 176; +pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177; +pub const _SC_V6_LP64_OFF64: ::c_int = 178; +pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179; +pub const _SC_HOST_NAME_MAX: ::c_int = 180; +pub const _SC_TRACE: ::c_int = 181; +pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182; +pub const _SC_TRACE_INHERIT: ::c_int = 183; +pub const _SC_TRACE_LOG: ::c_int = 184; +pub const _SC_IPV6: ::c_int = 235; +pub const _SC_RAW_SOCKETS: ::c_int = 236; +pub const _SC_V7_ILP32_OFF32: ::c_int = 237; +pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238; +pub const _SC_V7_LP64_OFF64: ::c_int = 239; +pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240; +pub const _SC_SS_REPL_MAX: ::c_int = 241; +pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242; +pub const _SC_TRACE_NAME_MAX: ::c_int = 243; +pub const _SC_TRACE_SYS_MAX: ::c_int = 244; +pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245; +pub const _SC_XOPEN_STREAMS: ::c_int = 246; +pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247; +pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248; + +pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY; +pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY; + +pub const GLOB_ERR: ::c_int = 1 << 0; +pub const GLOB_MARK: ::c_int = 1 << 1; +pub const GLOB_NOSORT: ::c_int = 1 << 2; +pub const GLOB_DOOFFS: ::c_int = 1 << 3; +pub const GLOB_NOCHECK: ::c_int = 1 << 4; +pub const GLOB_APPEND: ::c_int = 1 << 5; +pub const GLOB_NOESCAPE: ::c_int = 1 << 6; + +pub const GLOB_NOSPACE: ::c_int = 1; +pub const GLOB_ABORTED: ::c_int = 2; +pub const GLOB_NOMATCH: ::c_int = 3; + +pub const POSIX_MADV_NORMAL: ::c_int = 0; +pub const POSIX_MADV_RANDOM: ::c_int = 1; +pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_MADV_WILLNEED: ::c_int = 3; + +pub const S_IEXEC: mode_t = 64; +pub const S_IWRITE: mode_t = 128; +pub const S_IREAD: mode_t = 256; + +pub const F_LOCK: ::c_int = 1; +pub const F_TEST: ::c_int = 3; +pub const F_TLOCK: ::c_int = 2; +pub const F_ULOCK: ::c_int = 0; + +pub const ST_RDONLY: ::c_ulong = 1; +pub const ST_NOSUID: ::c_ulong = 2; +pub const ST_NODEV: ::c_ulong = 4; +pub const ST_NOEXEC: ::c_ulong = 8; +pub const ST_SYNCHRONOUS: ::c_ulong = 16; +pub const ST_MANDLOCK: ::c_ulong = 64; +pub const ST_WRITE: ::c_ulong = 128; +pub const ST_APPEND: ::c_ulong = 256; +pub const ST_IMMUTABLE: ::c_ulong = 512; +pub const ST_NOATIME: ::c_ulong = 1024; +pub const ST_NODIRATIME: ::c_ulong = 2048; + +pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void; +pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; +pub const RTLD_NODELETE: ::c_int = 0x1000; +pub const RTLD_NOW: ::c_int = 0x2; + +align_const! { + pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + size: [0; __SIZEOF_PTHREAD_MUTEX_T], + }; + pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + size: [0; __SIZEOF_PTHREAD_COND_T], + }; + pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + size: [0; __SIZEOF_PTHREAD_RWLOCK_T], + }; +} + +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; +pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0; +pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; +pub const __SIZEOF_PTHREAD_COND_T: usize = 48; + +pub const SCHED_OTHER: ::c_int = 0; +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_RR: ::c_int = 2; +pub const SCHED_BATCH: ::c_int = 3; +pub const SCHED_IDLE: ::c_int = 5; + +pub const AF_IB: ::c_int = 27; +pub const AF_MPLS: ::c_int = 28; +pub const AF_NFC: ::c_int = 39; +pub const AF_VSOCK: ::c_int = 40; +pub const PF_IB: ::c_int = AF_IB; +pub const PF_MPLS: ::c_int = AF_MPLS; +pub const PF_NFC: ::c_int = AF_NFC; +pub const PF_VSOCK: ::c_int = AF_VSOCK; + +// System V IPC +pub const IPC_PRIVATE: ::key_t = 0; + +pub const IPC_CREAT: ::c_int = 0o1000; +pub const IPC_EXCL: ::c_int = 0o2000; +pub const IPC_NOWAIT: ::c_int = 0o4000; + +pub const IPC_RMID: ::c_int = 0; +pub const IPC_SET: ::c_int = 1; +pub const IPC_STAT: ::c_int = 2; +pub const IPC_INFO: ::c_int = 3; +pub const MSG_STAT: ::c_int = 11; +pub const MSG_INFO: ::c_int = 12; + +pub const MSG_NOERROR: ::c_int = 0o10000; +pub const MSG_EXCEPT: ::c_int = 0o20000; + +pub const SHM_R: ::c_int = 0o400; +pub const SHM_W: ::c_int = 0o200; + +pub const SHM_RDONLY: ::c_int = 0o10000; +pub const SHM_RND: ::c_int = 0o20000; +pub const SHM_REMAP: ::c_int = 0o40000; +pub const SHM_EXEC: ::c_int = 0o100000; + +pub const SHM_LOCK: ::c_int = 11; +pub const SHM_UNLOCK: ::c_int = 12; + +pub const SHM_HUGETLB: ::c_int = 0o4000; +pub const SHM_NORESERVE: ::c_int = 0o10000; + +pub const QFMT_VFS_OLD: ::c_int = 1; +pub const QFMT_VFS_V0: ::c_int = 2; + +pub const EFD_SEMAPHORE: ::c_int = 0x1; + +pub const LOG_NFACILITIES: ::c_int = 24; + +pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t; + +pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32; +pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32; +pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32; +pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32; +pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32; +pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32; +pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32; + +pub const AI_PASSIVE: ::c_int = 0x0001; +pub const AI_CANONNAME: ::c_int = 0x0002; +pub const AI_NUMERICHOST: ::c_int = 0x0004; +pub const AI_V4MAPPED: ::c_int = 0x0008; +pub const AI_ALL: ::c_int = 0x0010; +pub const AI_ADDRCONFIG: ::c_int = 0x0020; + +pub const AI_NUMERICSERV: ::c_int = 0x0400; + +pub const EAI_BADFLAGS: ::c_int = -1; +pub const EAI_NONAME: ::c_int = -2; +pub const EAI_AGAIN: ::c_int = -3; +pub const EAI_FAIL: ::c_int = -4; +pub const EAI_FAMILY: ::c_int = -6; +pub const EAI_SOCKTYPE: ::c_int = -7; +pub const EAI_SERVICE: ::c_int = -8; +pub const EAI_MEMORY: ::c_int = -10; +pub const EAI_OVERFLOW: ::c_int = -12; + +pub const NI_NUMERICHOST: ::c_int = 1; +pub const NI_NUMERICSERV: ::c_int = 2; +pub const NI_NOFQDN: ::c_int = 4; +pub const NI_NAMEREQD: ::c_int = 8; +pub const NI_DGRAM: ::c_int = 16; + +pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1; +pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2; +pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4; + +pub const EAI_SYSTEM: ::c_int = -11; + +pub const AIO_CANCELED: ::c_int = 0; +pub const AIO_NOTCANCELED: ::c_int = 1; +pub const AIO_ALLDONE: ::c_int = 2; +pub const LIO_READ: ::c_int = 0; +pub const LIO_WRITE: ::c_int = 1; +pub const LIO_NOP: ::c_int = 2; +pub const LIO_WAIT: ::c_int = 0; +pub const LIO_NOWAIT: ::c_int = 1; + +pub const MREMAP_MAYMOVE: ::c_int = 1; +pub const MREMAP_FIXED: ::c_int = 2; + +pub const PR_SET_PDEATHSIG: ::c_int = 1; +pub const PR_GET_PDEATHSIG: ::c_int = 2; + +pub const PR_GET_DUMPABLE: ::c_int = 3; +pub const PR_SET_DUMPABLE: ::c_int = 4; + +pub const PR_GET_UNALIGN: ::c_int = 5; +pub const PR_SET_UNALIGN: ::c_int = 6; +pub const PR_UNALIGN_NOPRINT: ::c_int = 1; +pub const PR_UNALIGN_SIGBUS: ::c_int = 2; + +pub const PR_GET_KEEPCAPS: ::c_int = 7; +pub const PR_SET_KEEPCAPS: ::c_int = 8; + +pub const PR_GET_FPEMU: ::c_int = 9; +pub const PR_SET_FPEMU: ::c_int = 10; +pub const PR_FPEMU_NOPRINT: ::c_int = 1; +pub const PR_FPEMU_SIGFPE: ::c_int = 2; + +pub const PR_GET_FPEXC: ::c_int = 11; +pub const PR_SET_FPEXC: ::c_int = 12; +pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80; +pub const PR_FP_EXC_DIV: ::c_int = 0x010000; +pub const PR_FP_EXC_OVF: ::c_int = 0x020000; +pub const PR_FP_EXC_UND: ::c_int = 0x040000; +pub const PR_FP_EXC_RES: ::c_int = 0x080000; +pub const PR_FP_EXC_INV: ::c_int = 0x100000; +pub const PR_FP_EXC_DISABLED: ::c_int = 0; +pub const PR_FP_EXC_NONRECOV: ::c_int = 1; +pub const PR_FP_EXC_ASYNC: ::c_int = 2; +pub const PR_FP_EXC_PRECISE: ::c_int = 3; + +pub const PR_GET_TIMING: ::c_int = 13; +pub const PR_SET_TIMING: ::c_int = 14; +pub const PR_TIMING_STATISTICAL: ::c_int = 0; +pub const PR_TIMING_TIMESTAMP: ::c_int = 1; + +pub const PR_SET_NAME: ::c_int = 15; +pub const PR_GET_NAME: ::c_int = 16; + +pub const PR_GET_ENDIAN: ::c_int = 19; +pub const PR_SET_ENDIAN: ::c_int = 20; +pub const PR_ENDIAN_BIG: ::c_int = 0; +pub const PR_ENDIAN_LITTLE: ::c_int = 1; +pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2; + +pub const PR_GET_SECCOMP: ::c_int = 21; +pub const PR_SET_SECCOMP: ::c_int = 22; + +pub const PR_CAPBSET_READ: ::c_int = 23; +pub const PR_CAPBSET_DROP: ::c_int = 24; + +pub const PR_GET_TSC: ::c_int = 25; +pub const PR_SET_TSC: ::c_int = 26; +pub const PR_TSC_ENABLE: ::c_int = 1; +pub const PR_TSC_SIGSEGV: ::c_int = 2; + +pub const PR_GET_SECUREBITS: ::c_int = 27; +pub const PR_SET_SECUREBITS: ::c_int = 28; + +pub const PR_SET_TIMERSLACK: ::c_int = 29; +pub const PR_GET_TIMERSLACK: ::c_int = 30; + +pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31; +pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32; + +pub const PR_MCE_KILL: ::c_int = 33; +pub const PR_MCE_KILL_CLEAR: ::c_int = 0; +pub const PR_MCE_KILL_SET: ::c_int = 1; + +pub const PR_MCE_KILL_LATE: ::c_int = 0; +pub const PR_MCE_KILL_EARLY: ::c_int = 1; +pub const PR_MCE_KILL_DEFAULT: ::c_int = 2; + +pub const PR_MCE_KILL_GET: ::c_int = 34; + +pub const PR_SET_MM: ::c_int = 35; +pub const PR_SET_MM_START_CODE: ::c_int = 1; +pub const PR_SET_MM_END_CODE: ::c_int = 2; +pub const PR_SET_MM_START_DATA: ::c_int = 3; +pub const PR_SET_MM_END_DATA: ::c_int = 4; +pub const PR_SET_MM_START_STACK: ::c_int = 5; +pub const PR_SET_MM_START_BRK: ::c_int = 6; +pub const PR_SET_MM_BRK: ::c_int = 7; +pub const PR_SET_MM_ARG_START: ::c_int = 8; +pub const PR_SET_MM_ARG_END: ::c_int = 9; +pub const PR_SET_MM_ENV_START: ::c_int = 10; +pub const PR_SET_MM_ENV_END: ::c_int = 11; +pub const PR_SET_MM_AUXV: ::c_int = 12; +pub const PR_SET_MM_EXE_FILE: ::c_int = 13; +pub const PR_SET_MM_MAP: ::c_int = 14; +pub const PR_SET_MM_MAP_SIZE: ::c_int = 15; + +pub const PR_SET_PTRACER: ::c_int = 0x59616d61; + +pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36; +pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37; + +pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38; +pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39; + +pub const PR_GET_TID_ADDRESS: ::c_int = 40; + +pub const PR_SET_THP_DISABLE: ::c_int = 41; +pub const PR_GET_THP_DISABLE: ::c_int = 42; + +pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43; +pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44; + +pub const PR_SET_FP_MODE: ::c_int = 45; +pub const PR_GET_FP_MODE: ::c_int = 46; +pub const PR_FP_MODE_FR: ::c_int = 1 << 0; +pub const PR_FP_MODE_FRE: ::c_int = 1 << 1; + +pub const PR_CAP_AMBIENT: ::c_int = 47; +pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1; +pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2; +pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3; +pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4; + +pub const ITIMER_REAL: ::c_int = 0; +pub const ITIMER_VIRTUAL: ::c_int = 1; +pub const ITIMER_PROF: ::c_int = 2; + +pub const _POSIX_VDISABLE: ::cc_t = 0; + +pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01; +pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02; + +// On Linux, libc doesn't define this constant, libattr does instead. +// We still define it for Linux as it's defined by libc on other platforms, +// and it's mentioned in the man pages for getxattr and setxattr. +pub const SFD_CLOEXEC: ::c_int = 0x080000; + +pub const NCCS: usize = 32; + +pub const O_TRUNC: ::c_int = 512; +pub const O_NOATIME: ::c_int = 0o1000000; +pub const O_CLOEXEC: ::c_int = 0x80000; + +// Defined as wasi value. +pub const EPERM: ::c_int = 63; +pub const ENOENT: ::c_int = 44; +pub const ESRCH: ::c_int = 71; +pub const EINTR: ::c_int = 27; +pub const EIO: ::c_int = 29; +pub const ENXIO: ::c_int = 60; +pub const E2BIG: ::c_int = 1; +pub const ENOEXEC: ::c_int = 45; +pub const EBADF: ::c_int = 8; +pub const ECHILD: ::c_int = 12; +pub const EAGAIN: ::c_int = 6; +pub const ENOMEM: ::c_int = 48; +pub const EACCES: ::c_int = 2; +pub const EFAULT: ::c_int = 21; +pub const ENOTBLK: ::c_int = 105; +pub const EBUSY: ::c_int = 10; +pub const EEXIST: ::c_int = 20; +pub const EXDEV: ::c_int = 75; +pub const ENODEV: ::c_int = 43; +pub const ENOTDIR: ::c_int = 54; +pub const EISDIR: ::c_int = 31; +pub const EINVAL: ::c_int = 28; +pub const ENFILE: ::c_int = 41; +pub const EMFILE: ::c_int = 33; +pub const ENOTTY: ::c_int = 59; +pub const ETXTBSY: ::c_int = 74; +pub const EFBIG: ::c_int = 22; +pub const ENOSPC: ::c_int = 51; +pub const ESPIPE: ::c_int = 70; +pub const EROFS: ::c_int = 69; +pub const EMLINK: ::c_int = 34; +pub const EPIPE: ::c_int = 64; +pub const EDOM: ::c_int = 18; +pub const ERANGE: ::c_int = 68; +pub const EWOULDBLOCK: ::c_int = EAGAIN; +pub const ENOLINK: ::c_int = 47; +pub const EPROTO: ::c_int = 65; +pub const EDEADLK: ::c_int = 16; +pub const EDEADLOCK: ::c_int = EDEADLK; +pub const ENAMETOOLONG: ::c_int = 37; +pub const ENOLCK: ::c_int = 46; +pub const ENOSYS: ::c_int = 52; +pub const ENOTEMPTY: ::c_int = 55; +pub const ELOOP: ::c_int = 32; +pub const ENOMSG: ::c_int = 49; +pub const EIDRM: ::c_int = 24; +pub const EMULTIHOP: ::c_int = 36; +pub const EBADMSG: ::c_int = 9; +pub const EOVERFLOW: ::c_int = 61; +pub const EILSEQ: ::c_int = 25; +pub const ENOTSOCK: ::c_int = 57; +pub const EDESTADDRREQ: ::c_int = 17; +pub const EMSGSIZE: ::c_int = 35; +pub const EPROTOTYPE: ::c_int = 67; +pub const ENOPROTOOPT: ::c_int = 50; +pub const EPROTONOSUPPORT: ::c_int = 66; +pub const EAFNOSUPPORT: ::c_int = 5; +pub const EADDRINUSE: ::c_int = 3; +pub const EADDRNOTAVAIL: ::c_int = 4; +pub const ENETDOWN: ::c_int = 38; +pub const ENETUNREACH: ::c_int = 40; +pub const ENETRESET: ::c_int = 39; +pub const ECONNABORTED: ::c_int = 13; +pub const ECONNRESET: ::c_int = 15; +pub const ENOBUFS: ::c_int = 42; +pub const EISCONN: ::c_int = 30; +pub const ENOTCONN: ::c_int = 53; +pub const ETIMEDOUT: ::c_int = 73; +pub const ECONNREFUSED: ::c_int = 14; +pub const EHOSTUNREACH: ::c_int = 23; +pub const EALREADY: ::c_int = 7; +pub const EINPROGRESS: ::c_int = 26; +pub const ESTALE: ::c_int = 72; +pub const EDQUOT: ::c_int = 19; +pub const ECANCELED: ::c_int = 11; +pub const EOWNERDEAD: ::c_int = 62; +pub const ENOTRECOVERABLE: ::c_int = 56; + +pub const ENOSTR: ::c_int = 100; +pub const EBFONT: ::c_int = 101; +pub const EBADSLT: ::c_int = 102; +pub const EBADRQC: ::c_int = 103; +pub const ENOANO: ::c_int = 104; +pub const ECHRNG: ::c_int = 106; +pub const EL3HLT: ::c_int = 107; +pub const EL3RST: ::c_int = 108; +pub const ELNRNG: ::c_int = 109; +pub const EUNATCH: ::c_int = 110; +pub const ENOCSI: ::c_int = 111; +pub const EL2HLT: ::c_int = 112; +pub const EBADE: ::c_int = 113; +pub const EBADR: ::c_int = 114; +pub const EXFULL: ::c_int = 115; +pub const ENODATA: ::c_int = 116; +pub const ETIME: ::c_int = 117; +pub const ENOSR: ::c_int = 118; +pub const ENONET: ::c_int = 119; +pub const ENOPKG: ::c_int = 120; +pub const EREMOTE: ::c_int = 121; +pub const EADV: ::c_int = 122; +pub const ESRMNT: ::c_int = 123; +pub const ECOMM: ::c_int = 124; +pub const EDOTDOT: ::c_int = 125; +pub const ENOTUNIQ: ::c_int = 126; +pub const EBADFD: ::c_int = 127; +pub const EREMCHG: ::c_int = 128; +pub const ELIBACC: ::c_int = 129; +pub const ELIBBAD: ::c_int = 130; +pub const ELIBSCN: ::c_int = 131; +pub const ELIBMAX: ::c_int = 132; +pub const ELIBEXEC: ::c_int = 133; +pub const ERESTART: ::c_int = 134; +pub const ESTRPIPE: ::c_int = 135; +pub const EUSERS: ::c_int = 136; +pub const ESOCKTNOSUPPORT: ::c_int = 137; +pub const EOPNOTSUPP: ::c_int = 138; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 139; +pub const ESHUTDOWN: ::c_int = 140; +pub const ETOOMANYREFS: ::c_int = 141; +pub const EHOSTDOWN: ::c_int = 142; +pub const EUCLEAN: ::c_int = 143; +pub const ENOTNAM: ::c_int = 144; +pub const ENAVAIL: ::c_int = 145; +pub const EISNAM: ::c_int = 146; +pub const EREMOTEIO: ::c_int = 147; +pub const ENOMEDIUM: ::c_int = 148; +pub const EMEDIUMTYPE: ::c_int = 149; +pub const ENOKEY: ::c_int = 150; +pub const EKEYEXPIRED: ::c_int = 151; +pub const EKEYREVOKED: ::c_int = 152; +pub const EKEYREJECTED: ::c_int = 153; +pub const ERFKILL: ::c_int = 154; +pub const EHWPOISON: ::c_int = 155; +pub const EL2NSYNC: ::c_int = 156; + +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +pub const EFD_CLOEXEC: ::c_int = 0x80000; + +pub const BUFSIZ: ::c_uint = 1024; +pub const TMP_MAX: ::c_uint = 10000; +pub const FOPEN_MAX: ::c_uint = 1000; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_EXEC: ::c_int = 0o10000000; +pub const O_SEARCH: ::c_int = 0o10000000; +pub const O_ACCMODE: ::c_int = 0o10000003; +pub const O_NDELAY: ::c_int = O_NONBLOCK; +pub const NI_MAXHOST: ::socklen_t = 255; +pub const PTHREAD_STACK_MIN: ::size_t = 2048; +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +pub const POSIX_MADV_DONTNEED: ::c_int = 0; + +pub const RLIM_INFINITY: ::rlim_t = !0; +pub const RLIMIT_NLIMITS: ::c_int = 15; +pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS; + +pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; + +#[doc(hidden)] +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = ::SIGSYS; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; + +pub const CPU_SETSIZE: ::c_int = 128; + +pub const QFMT_VFS_V1: ::c_int = 4; + +pub const PTRACE_TRACEME: ::c_int = 0; +pub const PTRACE_PEEKTEXT: ::c_int = 1; +pub const PTRACE_PEEKDATA: ::c_int = 2; +pub const PTRACE_PEEKUSER: ::c_int = 3; +pub const PTRACE_POKETEXT: ::c_int = 4; +pub const PTRACE_POKEDATA: ::c_int = 5; +pub const PTRACE_POKEUSER: ::c_int = 6; +pub const PTRACE_CONT: ::c_int = 7; +pub const PTRACE_KILL: ::c_int = 8; +pub const PTRACE_SINGLESTEP: ::c_int = 9; +pub const PTRACE_ATTACH: ::c_int = 16; +pub const PTRACE_DETACH: ::c_int = 17; +pub const PTRACE_SYSCALL: ::c_int = 24; +pub const PTRACE_SETOPTIONS: ::c_int = 0x4200; +pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201; +pub const PTRACE_GETSIGINFO: ::c_int = 0x4202; +pub const PTRACE_SETSIGINFO: ::c_int = 0x4203; +pub const PTRACE_GETREGSET: ::c_int = 0x4204; +pub const PTRACE_SETREGSET: ::c_int = 0x4205; +pub const PTRACE_SEIZE: ::c_int = 0x4206; +pub const PTRACE_INTERRUPT: ::c_int = 0x4207; +pub const PTRACE_LISTEN: ::c_int = 0x4208; +pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209; + +pub const PTRACE_GETFPREGS: ::c_uint = 14; +pub const PTRACE_SETFPREGS: ::c_uint = 15; +pub const PTRACE_GETFPXREGS: ::c_uint = 18; +pub const PTRACE_SETFPXREGS: ::c_uint = 19; +pub const PTRACE_GETREGS: ::c_uint = 12; +pub const PTRACE_SETREGS: ::c_uint = 13; + +pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK; + +pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const TIOCINQ: ::c_int = ::FIONREAD; + +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; + +pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::c_int = 0x00000800; +pub const TAB2: ::c_int = 0x00001000; +pub const TAB3: ::c_int = 0x00001800; +pub const CR1: ::c_int = 0x00000200; +pub const CR2: ::c_int = 0x00000400; +pub const CR3: ::c_int = 0x00000600; +pub const FF1: ::c_int = 0x00008000; +pub const BS1: ::c_int = 0x00002000; +pub const VT1: ::c_int = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const SO_BINDTODEVICE: ::c_int = 25; +pub const SO_TIMESTAMP: ::c_int = 29; +pub const SO_MARK: ::c_int = 36; +pub const SO_RXQ_OVFL: ::c_int = 40; +pub const SO_PEEK_OFF: ::c_int = 42; +pub const SO_BUSY_POLL: ::c_int = 46; + +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 28; + +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; +pub const O_ASYNC: ::c_int = 0x2000; + +pub const FIOCLEX: ::c_int = 0x5451; +pub const FIONBIO: ::c_int = 0x5421; + +pub const RLIMIT_RSS: ::c_int = 5; +pub const RLIMIT_NOFILE: ::c_int = 7; +pub const RLIMIT_AS: ::c_int = 9; +pub const RLIMIT_NPROC: ::c_int = 6; +pub const RLIMIT_MEMLOCK: ::c_int = 8; +pub const RLIMIT_CPU: ::c_int = 0; +pub const RLIMIT_FSIZE: ::c_int = 1; +pub const RLIMIT_DATA: ::c_int = 2; +pub const RLIMIT_STACK: ::c_int = 3; +pub const RLIMIT_CORE: ::c_int = 4; +pub const RLIMIT_LOCKS: ::c_int = 10; +pub const RLIMIT_SIGPENDING: ::c_int = 11; +pub const RLIMIT_MSGQUEUE: ::c_int = 12; +pub const RLIMIT_NICE: ::c_int = 13; +pub const RLIMIT_RTPRIO: ::c_int = 14; + +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; + +pub const SOCK_NONBLOCK: ::c_int = 2048; + +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_SEQPACKET: ::c_int = 5; + +pub const IPPROTO_MAX: ::c_int = 256; + +pub const SOL_SOCKET: ::c_int = 1; + +pub const SO_REUSEADDR: ::c_int = 2; +pub const SO_TYPE: ::c_int = 3; +pub const SO_ERROR: ::c_int = 4; +pub const SO_DONTROUTE: ::c_int = 5; +pub const SO_BROADCAST: ::c_int = 6; +pub const SO_SNDBUF: ::c_int = 7; +pub const SO_RCVBUF: ::c_int = 8; +pub const SO_KEEPALIVE: ::c_int = 9; +pub const SO_OOBINLINE: ::c_int = 10; +pub const SO_LINGER: ::c_int = 13; +pub const SO_REUSEPORT: ::c_int = 15; +pub const SO_RCVLOWAT: ::c_int = 18; +pub const SO_SNDLOWAT: ::c_int = 19; +pub const SO_RCVTIMEO: ::c_int = 20; +pub const SO_SNDTIMEO: ::c_int = 21; +pub const SO_ACCEPTCONN: ::c_int = 30; + +pub const IPV6_RTHDR_LOOSE: ::c_int = 0; +pub const IPV6_RTHDR_STRICT: ::c_int = 1; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const EXTPROC: ::tcflag_t = 0x00010000; + +pub const MAP_HUGETLB: ::c_int = 0x040000; + +pub const F_GETLK: ::c_int = 12; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETLK: ::c_int = 13; +pub const F_SETLKW: ::c_int = 14; +pub const F_SETOWN: ::c_int = 8; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const VEOF: usize = 4; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; + +pub const TCGETS: ::c_int = 0x5401; +pub const TCSETS: ::c_int = 0x5402; +pub const TCSETSW: ::c_int = 0x5403; +pub const TCSETSF: ::c_int = 0x5404; +pub const TCGETA: ::c_int = 0x5405; +pub const TCSETA: ::c_int = 0x5406; +pub const TCSETAW: ::c_int = 0x5407; +pub const TCSETAF: ::c_int = 0x5408; +pub const TCSBRK: ::c_int = 0x5409; +pub const TCXONC: ::c_int = 0x540A; +pub const TCFLSH: ::c_int = 0x540B; +pub const TIOCGSOFTCAR: ::c_int = 0x5419; +pub const TIOCSSOFTCAR: ::c_int = 0x541A; +pub const TIOCLINUX: ::c_int = 0x541C; +pub const TIOCGSERIAL: ::c_int = 0x541E; +pub const TIOCEXCL: ::c_int = 0x540C; +pub const TIOCNXCL: ::c_int = 0x540D; +pub const TIOCSCTTY: ::c_int = 0x540E; +pub const TIOCGPGRP: ::c_int = 0x540F; +pub const TIOCSPGRP: ::c_int = 0x5410; +pub const TIOCOUTQ: ::c_int = 0x5411; +pub const TIOCSTI: ::c_int = 0x5412; +pub const TIOCGWINSZ: ::c_int = 0x5413; +pub const TIOCSWINSZ: ::c_int = 0x5414; +pub const TIOCMGET: ::c_int = 0x5415; +pub const TIOCMBIS: ::c_int = 0x5416; +pub const TIOCMBIC: ::c_int = 0x5417; +pub const TIOCMSET: ::c_int = 0x5418; +pub const FIONREAD: ::c_int = 0x541B; +pub const TIOCCONS: ::c_int = 0x541D; + +pub const SYS_gettid: ::c_long = 224; // Valid for arm (32-bit) and x86 (32-bit) + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const TIOCM_LE: ::c_int = 0x001; +pub const TIOCM_DTR: ::c_int = 0x002; +pub const TIOCM_RTS: ::c_int = 0x004; +pub const TIOCM_ST: ::c_int = 0x008; +pub const TIOCM_SR: ::c_int = 0x010; +pub const TIOCM_CTS: ::c_int = 0x020; +pub const TIOCM_CAR: ::c_int = 0x040; +pub const TIOCM_RNG: ::c_int = 0x080; +pub const TIOCM_DSR: ::c_int = 0x100; +pub const TIOCM_CD: ::c_int = TIOCM_CAR; +pub const TIOCM_RI: ::c_int = TIOCM_RNG; +pub const O_TMPFILE: ::c_int = 0x400000; + +pub const MAX_ADDR_LEN: usize = 7; +pub const ARPD_UPDATE: ::c_ushort = 0x01; +pub const ARPD_LOOKUP: ::c_ushort = 0x02; +pub const ARPD_FLUSH: ::c_ushort = 0x03; +pub const ATF_MAGIC: ::c_int = 0x80; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +pub const SOMAXCONN: ::c_int = 128; + +f! { + pub fn CMSG_NXTHDR(mhdr: *const msghdr, + cmsg: *const cmsghdr) -> *mut cmsghdr { + if ((*cmsg).cmsg_len as usize) < ::mem::size_of::() { + return 0 as *mut cmsghdr; + }; + let next = (cmsg as usize + + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) + as *mut cmsghdr; + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if (next.offset(1)) as usize > max { + 0 as *mut cmsghdr + } else { + next as *mut cmsghdr + } + } + + pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { + for slot in cpuset.bits.iter_mut() { + *slot = 0; + } + } + + pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let size_in_bits + = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + cpuset.bits[idx] |= 1 << offset; + () + } + + pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let size_in_bits + = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + cpuset.bits[idx] &= !(1 << offset); + () + } + + pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { + let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]); + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + 0 != (cpuset.bits[idx] & (1 << offset)) + } + + pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { + set1.bits == set2.bits + } + + pub fn major(dev: ::dev_t) -> ::c_uint { + // see + // https://github.com/emscripten-core/emscripten/blob/ + // master/system/include/libc/sys/sysmacros.h + let mut major = 0; + major |= (dev & 0x00000fff) >> 8; + major |= (dev & 0xfffff000) >> 31 >> 1; + major as ::c_uint + } + + pub fn minor(dev: ::dev_t) -> ::c_uint { + // see + // https://github.com/emscripten-core/emscripten/blob/ + // master/system/include/libc/sys/sysmacros.h + let mut minor = 0; + minor |= (dev & 0x000000ff) >> 0; + minor |= (dev & 0xffffff00) >> 12; + minor as ::c_uint + } + + pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t { + let major = major as ::dev_t; + let minor = minor as ::dev_t; + let mut dev = 0; + dev |= (major & 0x00000fff) << 8; + dev |= (major & 0xfffff000) << 31 << 1; + dev |= (minor & 0x000000ff) << 0; + dev |= (minor & 0xffffff00) << 12; + dev + } +} + +extern "C" { + pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int; + pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int; + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; + pub fn labs(i: ::c_long) -> ::c_long; + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + + pub fn setpwent(); + pub fn endpwent(); + pub fn getpwent() -> *mut passwd; + + pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int; + + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn __errno_location() -> *mut ::c_int; + + pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn freopen64( + filename: *const c_char, + mode: *const c_char, + file: *mut ::FILE, + ) -> *mut ::FILE; + pub fn tmpfile64() -> *mut ::FILE; + pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; + pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; + pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int; + pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; + pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; + pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) + -> ::ssize_t; + pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t; + pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int; + pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int; + pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int; + pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; + pub fn accept4( + fd: ::c_int, + addr: *mut ::sockaddr, + len: *mut ::socklen_t, + flg: ::c_int, + ) -> ::c_int; + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::socklen_t, + serv: *mut ::c_char, + sevlen: ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; + + // Not available now on Android + pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; + pub fn if_nameindex() -> *mut if_nameindex; + pub fn if_freenameindex(ptr: *mut if_nameindex); + + pub fn mremap( + addr: *mut ::c_void, + len: ::size_t, + new_len: ::size_t, + flags: ::c_int, + ... + ) -> *mut ::c_void; + + pub fn glob( + pattern: *const c_char, + flags: ::c_int, + errfunc: ::Option ::c_int>, + pglob: *mut ::glob_t, + ) -> ::c_int; + pub fn globfree(pglob: *mut ::glob_t); + + pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; + pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; + + pub fn recvfrom( + socket: ::c_int, + buf: *mut ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, + ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + + pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn sendmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_uint, + ) -> ::c_int; + pub fn recvmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_uint, + timeout: *mut ::timespec, + ) -> ::c_int; + pub fn sync(); + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; + pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; + pub fn pthread_create( + native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(libc_align)] { + #[macro_use] + mod align; + } else { + #[macro_use] + mod no_align; + } +} +expand_align!(); diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/no_align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/no_align.rs new file mode 100644 index 0000000000000000000000000000000000000000..768dc73a434f6c5394c360c2561d41b8d5873a83 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/emscripten/no_align.rs @@ -0,0 +1,63 @@ +macro_rules! expand_align { + () => { + s! { + pub struct pthread_mutex_t { + __align: [::c_long; 0], + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + + pub struct pthread_rwlock_t { + __align: [::c_long; 0], + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + + pub struct pthread_mutexattr_t { + __align: [::c_int; 0], + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + pub struct pthread_rwlockattr_t { + __align: [::c_int; 0], + size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T], + } + + pub struct pthread_condattr_t { + __align: [::c_int; 0], + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + } + + s_no_extra_traits! { + pub struct pthread_cond_t { + __align: [*const ::c_void; 0], + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + } + + cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for pthread_cond_t { + fn eq(&self, other: &pthread_cond_t) -> bool { + self.size + .iter() + .zip(other.size.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for pthread_cond_t {} + impl ::fmt::Debug for pthread_cond_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_cond_t") + // FIXME: .field("size", &self.size) + .finish() + } + } + impl ::hash::Hash for pthread_cond_t { + fn hash(&self, state: &mut H) { + self.size.hash(state); + } + } + } + } + }; +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..3a3277f29cf47d1af31bf12b5fcff74f9769ceae --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/align.rs @@ -0,0 +1,150 @@ +macro_rules! expand_align { + () => { + s! { + #[cfg_attr(any(target_pointer_width = "32", + target_arch = "x86_64", + target_arch = "powerpc64", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", + target_arch = "aarch64", + target_arch = "riscv64", + target_arch = "riscv32", + target_arch = "loongarch64"), + repr(align(4)))] + #[cfg_attr(not(any(target_pointer_width = "32", + target_arch = "x86_64", + target_arch = "powerpc64", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", + target_arch = "aarch64", + target_arch = "riscv64", + target_arch = "riscv32", + target_arch = "loongarch64")), + repr(align(8)))] + pub struct pthread_mutexattr_t { + #[doc(hidden)] + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + #[cfg_attr(any(target_env = "musl", target_pointer_width = "32"), + repr(align(4)))] + #[cfg_attr(all(not(target_env = "musl"), + target_pointer_width = "64"), + repr(align(8)))] + pub struct pthread_rwlockattr_t { + #[doc(hidden)] + size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T], + } + + #[repr(align(4))] + pub struct pthread_condattr_t { + #[doc(hidden)] + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + + #[repr(align(8))] + pub struct fanotify_event_metadata { + pub event_len: __u32, + pub vers: __u8, + pub reserved: __u8, + pub metadata_len: __u16, + pub mask: __u64, + pub fd: ::c_int, + pub pid: ::c_int, + } + } + + s_no_extra_traits! { + #[cfg_attr(all(target_env = "musl", + target_pointer_width = "32"), + repr(align(4)))] + #[cfg_attr(all(target_env = "musl", + target_pointer_width = "64"), + repr(align(8)))] + #[cfg_attr(all(not(target_env = "musl"), + target_arch = "x86"), + repr(align(4)))] + #[cfg_attr(all(not(target_env = "musl"), + not(target_arch = "x86")), + repr(align(8)))] + pub struct pthread_cond_t { + #[doc(hidden)] + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + + #[cfg_attr(all(target_pointer_width = "32", + any(target_arch = "mips", + target_arch = "arm", + target_arch = "hexagon", + target_arch = "m68k", + target_arch = "powerpc", + target_arch = "sparc", + target_arch = "x86_64", + target_arch = "x86")), + repr(align(4)))] + #[cfg_attr(any(target_pointer_width = "64", + not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "hexagon", + target_arch = "m68k", + target_arch = "powerpc", + target_arch = "sparc", + target_arch = "x86_64", + target_arch = "x86"))), + repr(align(8)))] + pub struct pthread_mutex_t { + #[doc(hidden)] + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + + #[cfg_attr(all(target_pointer_width = "32", + any(target_arch = "mips", + target_arch = "arm", + target_arch = "hexagon", + target_arch = "m68k", + target_arch = "powerpc", + target_arch = "sparc", + target_arch = "x86_64", + target_arch = "x86")), + repr(align(4)))] + #[cfg_attr(any(target_pointer_width = "64", + not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "hexagon", + target_arch = "m68k", + target_arch = "powerpc", + target_arch = "sparc", + target_arch = "x86_64", + target_arch = "x86"))), + repr(align(8)))] + pub struct pthread_rwlock_t { + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + + // linux/can.h + #[repr(align(8))] + #[allow(missing_debug_implementations)] + pub struct can_frame { + pub can_id: canid_t, + pub can_dlc: u8, + __pad: u8, + __res0: u8, + __res1: u8, + pub data: [u8; CAN_MAX_DLEN], + } + + #[repr(align(8))] + #[allow(missing_debug_implementations)] + pub struct canfd_frame { + pub can_id: canid_t, + pub len: u8, + pub flags: u8, + __res0: u8, + __res1: u8, + pub data: [u8; CANFD_MAX_DLEN], + } + } + }; +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..320579955367cf6553da96edb39ba7cdc9a570a5 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/generic/mod.rs @@ -0,0 +1,278 @@ +s! { + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } +} + +// include/uapi/asm-generic/socket.h +// arch/alpha/include/uapi/asm/socket.h +// tools/include/uapi/asm-generic/socket.h +// arch/mips/include/uapi/asm/socket.h +pub const SOL_SOCKET: ::c_int = 1; + +// Defined in unix/linux_like/mod.rs +// pub const SO_DEBUG: ::c_int = 1; +pub const SO_REUSEADDR: ::c_int = 2; +pub const SO_TYPE: ::c_int = 3; +pub const SO_ERROR: ::c_int = 4; +pub const SO_DONTROUTE: ::c_int = 5; +pub const SO_BROADCAST: ::c_int = 6; +pub const SO_SNDBUF: ::c_int = 7; +pub const SO_RCVBUF: ::c_int = 8; +pub const SO_KEEPALIVE: ::c_int = 9; +pub const SO_OOBINLINE: ::c_int = 10; +pub const SO_NO_CHECK: ::c_int = 11; +pub const SO_PRIORITY: ::c_int = 12; +pub const SO_LINGER: ::c_int = 13; +pub const SO_BSDCOMPAT: ::c_int = 14; +pub const SO_REUSEPORT: ::c_int = 15; +pub const SO_PASSCRED: ::c_int = 16; +pub const SO_PEERCRED: ::c_int = 17; +pub const SO_RCVLOWAT: ::c_int = 18; +pub const SO_SNDLOWAT: ::c_int = 19; +pub const SO_RCVTIMEO: ::c_int = 20; +pub const SO_SNDTIMEO: ::c_int = 21; +// pub const SO_RCVTIMEO_OLD: ::c_int = 20; +// pub const SO_SNDTIMEO_OLD: ::c_int = 21; +pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22; +pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23; +pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24; +pub const SO_BINDTODEVICE: ::c_int = 25; +pub const SO_ATTACH_FILTER: ::c_int = 26; +pub const SO_DETACH_FILTER: ::c_int = 27; +pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER; +pub const SO_PEERNAME: ::c_int = 28; +pub const SO_TIMESTAMP: ::c_int = 29; +// pub const SO_TIMESTAMP_OLD: ::c_int = 29; +pub const SO_ACCEPTCONN: ::c_int = 30; +pub const SO_PEERSEC: ::c_int = 31; +pub const SO_SNDBUFFORCE: ::c_int = 32; +pub const SO_RCVBUFFORCE: ::c_int = 33; +pub const SO_PASSSEC: ::c_int = 34; +pub const SO_TIMESTAMPNS: ::c_int = 35; +// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35; +pub const SO_MARK: ::c_int = 36; +pub const SO_TIMESTAMPING: ::c_int = 37; +// pub const SO_TIMESTAMPING_OLD: ::c_int = 37; +pub const SO_PROTOCOL: ::c_int = 38; +pub const SO_DOMAIN: ::c_int = 39; +pub const SO_RXQ_OVFL: ::c_int = 40; +pub const SO_WIFI_STATUS: ::c_int = 41; +pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS; +pub const SO_PEEK_OFF: ::c_int = 42; +pub const SO_NOFCS: ::c_int = 43; +pub const SO_LOCK_FILTER: ::c_int = 44; +pub const SO_SELECT_ERR_QUEUE: ::c_int = 45; +pub const SO_BUSY_POLL: ::c_int = 46; +pub const SO_MAX_PACING_RATE: ::c_int = 47; +pub const SO_BPF_EXTENSIONS: ::c_int = 48; +pub const SO_INCOMING_CPU: ::c_int = 49; +pub const SO_ATTACH_BPF: ::c_int = 50; +pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER; +pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51; +pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52; +pub const SO_CNX_ADVICE: ::c_int = 53; +pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54; +pub const SO_MEMINFO: ::c_int = 55; +pub const SO_INCOMING_NAPI_ID: ::c_int = 56; +pub const SO_COOKIE: ::c_int = 57; +pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58; +pub const SO_PEERGROUPS: ::c_int = 59; +pub const SO_ZEROCOPY: ::c_int = 60; +pub const SO_TXTIME: ::c_int = 61; +pub const SCM_TXTIME: ::c_int = SO_TXTIME; +pub const SO_BINDTOIFINDEX: ::c_int = 62; +cfg_if! { + // Some of these platforms in CI already have these constants. + // But they may still not have those _OLD ones. + if #[cfg(all(any(target_arch = "x86", + target_arch = "x86_64", + target_arch = "aarch64"), + not(target_env = "musl")))] { + pub const SO_TIMESTAMP_NEW: ::c_int = 63; + pub const SO_TIMESTAMPNS_NEW: ::c_int = 64; + pub const SO_TIMESTAMPING_NEW: ::c_int = 65; + pub const SO_RCVTIMEO_NEW: ::c_int = 66; + pub const SO_SNDTIMEO_NEW: ::c_int = 67; + pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68; + } +} +// pub const SO_PREFER_BUSY_POLL: ::c_int = 69; +// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; + +// Defined in unix/linux_like/mod.rs +// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; +pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; +pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING; + +// Ioctl Constants + +pub const TCGETS: ::Ioctl = 0x5401; +pub const TCSETS: ::Ioctl = 0x5402; +pub const TCSETSW: ::Ioctl = 0x5403; +pub const TCSETSF: ::Ioctl = 0x5404; +pub const TCGETA: ::Ioctl = 0x5405; +pub const TCSETA: ::Ioctl = 0x5406; +pub const TCSETAW: ::Ioctl = 0x5407; +pub const TCSETAF: ::Ioctl = 0x5408; +pub const TCSBRK: ::Ioctl = 0x5409; +pub const TCXONC: ::Ioctl = 0x540A; +pub const TCFLSH: ::Ioctl = 0x540B; +pub const TIOCEXCL: ::Ioctl = 0x540C; +pub const TIOCNXCL: ::Ioctl = 0x540D; +pub const TIOCSCTTY: ::Ioctl = 0x540E; +pub const TIOCGPGRP: ::Ioctl = 0x540F; +pub const TIOCSPGRP: ::Ioctl = 0x5410; +pub const TIOCOUTQ: ::Ioctl = 0x5411; +pub const TIOCSTI: ::Ioctl = 0x5412; +pub const TIOCGWINSZ: ::Ioctl = 0x5413; +pub const TIOCSWINSZ: ::Ioctl = 0x5414; +pub const TIOCMGET: ::Ioctl = 0x5415; +pub const TIOCMBIS: ::Ioctl = 0x5416; +pub const TIOCMBIC: ::Ioctl = 0x5417; +pub const TIOCMSET: ::Ioctl = 0x5418; +pub const TIOCGSOFTCAR: ::Ioctl = 0x5419; +pub const TIOCSSOFTCAR: ::Ioctl = 0x541A; +pub const FIONREAD: ::Ioctl = 0x541B; +pub const TIOCINQ: ::Ioctl = FIONREAD; +pub const TIOCLINUX: ::Ioctl = 0x541C; +pub const TIOCCONS: ::Ioctl = 0x541D; +pub const TIOCGSERIAL: ::Ioctl = 0x541E; +pub const TIOCSSERIAL: ::Ioctl = 0x541F; +pub const TIOCPKT: ::Ioctl = 0x5420; +pub const FIONBIO: ::Ioctl = 0x5421; +pub const TIOCNOTTY: ::Ioctl = 0x5422; +pub const TIOCSETD: ::Ioctl = 0x5423; +pub const TIOCGETD: ::Ioctl = 0x5424; +pub const TCSBRKP: ::Ioctl = 0x5425; +pub const TIOCSBRK: ::Ioctl = 0x5427; +pub const TIOCCBRK: ::Ioctl = 0x5428; +pub const TIOCGSID: ::Ioctl = 0x5429; +pub const TCGETS2: ::Ioctl = 0x802c542a; +pub const TCSETS2: ::Ioctl = 0x402c542b; +pub const TCSETSW2: ::Ioctl = 0x402c542c; +pub const TCSETSF2: ::Ioctl = 0x402c542d; +pub const TIOCGRS485: ::Ioctl = 0x542E; +pub const TIOCSRS485: ::Ioctl = 0x542F; +pub const TIOCGPTN: ::Ioctl = 0x80045430; +pub const TIOCSPTLCK: ::Ioctl = 0x40045431; +pub const TIOCGDEV: ::Ioctl = 0x80045432; +pub const TCGETX: ::Ioctl = 0x5432; +pub const TCSETX: ::Ioctl = 0x5433; +pub const TCSETXF: ::Ioctl = 0x5434; +pub const TCSETXW: ::Ioctl = 0x5435; +pub const TIOCSIG: ::Ioctl = 0x40045436; +pub const TIOCVHANGUP: ::Ioctl = 0x5437; +pub const TIOCGPKT: ::Ioctl = 0x80045438; +pub const TIOCGPTLCK: ::Ioctl = 0x80045439; +pub const TIOCGEXCL: ::Ioctl = 0x80045440; +pub const TIOCGPTPEER: ::Ioctl = 0x5441; +// pub const TIOCGISO7816: ::Ioctl = 0x80285442; +// pub const TIOCSISO7816: ::Ioctl = 0xc0285443; +pub const FIONCLEX: ::Ioctl = 0x5450; +pub const FIOCLEX: ::Ioctl = 0x5451; +pub const FIOASYNC: ::Ioctl = 0x5452; +pub const TIOCSERCONFIG: ::Ioctl = 0x5453; +pub const TIOCSERGWILD: ::Ioctl = 0x5454; +pub const TIOCSERSWILD: ::Ioctl = 0x5455; +pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456; +pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457; +pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458; +pub const TIOCSERGETLSR: ::Ioctl = 0x5459; +pub const TIOCSERGETMULTI: ::Ioctl = 0x545A; +pub const TIOCSERSETMULTI: ::Ioctl = 0x545B; +pub const TIOCMIWAIT: ::Ioctl = 0x545C; +pub const TIOCGICOUNT: ::Ioctl = 0x545D; +pub const BLKIOMIN: ::Ioctl = 0x1278; +pub const BLKIOOPT: ::Ioctl = 0x1279; +pub const BLKSSZGET: ::Ioctl = 0x1268; +pub const BLKPBSZGET: ::Ioctl = 0x127B; + +cfg_if! { + if #[cfg(any(target_arch = "arm", + target_arch = "s390x"))] { + pub const FIOQSIZE: ::Ioctl = 0x545E; + } else { + pub const FIOQSIZE: ::Ioctl = 0x5460; + } +} + +pub const TIOCM_LE: ::c_int = 0x001; +pub const TIOCM_DTR: ::c_int = 0x002; +pub const TIOCM_RTS: ::c_int = 0x004; +pub const TIOCM_ST: ::c_int = 0x008; +pub const TIOCM_SR: ::c_int = 0x010; +pub const TIOCM_CTS: ::c_int = 0x020; +pub const TIOCM_CAR: ::c_int = 0x040; +pub const TIOCM_CD: ::c_int = TIOCM_CAR; +pub const TIOCM_RNG: ::c_int = 0x080; +pub const TIOCM_RI: ::c_int = TIOCM_RNG; +pub const TIOCM_DSR: ::c_int = 0x100; + +pub const BOTHER: ::speed_t = 0o010000; +pub const IBSHIFT: ::tcflag_t = 16; + +// RLIMIT Constants + +cfg_if! { + if #[cfg(any(target_env = "gnu", + target_env = "uclibc"))] { + + pub const RLIMIT_CPU: ::__rlimit_resource_t = 0; + pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1; + pub const RLIMIT_DATA: ::__rlimit_resource_t = 2; + pub const RLIMIT_STACK: ::__rlimit_resource_t = 3; + pub const RLIMIT_CORE: ::__rlimit_resource_t = 4; + pub const RLIMIT_RSS: ::__rlimit_resource_t = 5; + pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6; + pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7; + pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8; + pub const RLIMIT_AS: ::__rlimit_resource_t = 9; + pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10; + pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11; + pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12; + pub const RLIMIT_NICE: ::__rlimit_resource_t = 13; + pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14; + pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15; + pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS; + + } else if #[cfg(target_env = "musl")] { + + pub const RLIMIT_CPU: ::c_int = 0; + pub const RLIMIT_FSIZE: ::c_int = 1; + pub const RLIMIT_DATA: ::c_int = 2; + pub const RLIMIT_STACK: ::c_int = 3; + pub const RLIMIT_CORE: ::c_int = 4; + pub const RLIMIT_RSS: ::c_int = 5; + pub const RLIMIT_NPROC: ::c_int = 6; + pub const RLIMIT_NOFILE: ::c_int = 7; + pub const RLIMIT_MEMLOCK: ::c_int = 8; + pub const RLIMIT_AS: ::c_int = 9; + pub const RLIMIT_LOCKS: ::c_int = 10; + pub const RLIMIT_SIGPENDING: ::c_int = 11; + pub const RLIMIT_MSGQUEUE: ::c_int = 12; + pub const RLIMIT_NICE: ::c_int = 13; + pub const RLIMIT_RTPRIO: ::c_int = 14; + pub const RLIMIT_RTTIME: ::c_int = 15; + pub const RLIM_NLIMITS: ::c_int = 15; + pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS; + } +} + +cfg_if! { + if #[cfg(target_env = "gnu")] { + pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16; + } + else if #[cfg(target_env = "uclibc")] { + pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15; + } +} + +pub const RLIM_INFINITY: ::rlim_t = !0; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..077417de52faf6a0a3d64b458bd9afbc7211e390 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/mips/mod.rs @@ -0,0 +1,285 @@ +s! { + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 23], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } +} + +// arch/mips/include/uapi/asm/socket.h +pub const SOL_SOCKET: ::c_int = 0xffff; + +// Defined in unix/linux_like/mod.rs +// pub const SO_DEBUG: ::c_int = 0x0001; +pub const SO_REUSEADDR: ::c_int = 0x0004; +pub const SO_KEEPALIVE: ::c_int = 0x0008; +pub const SO_DONTROUTE: ::c_int = 0x0010; +pub const SO_BROADCAST: ::c_int = 0x0020; +pub const SO_LINGER: ::c_int = 0x0080; +pub const SO_OOBINLINE: ::c_int = 0x0100; +pub const SO_REUSEPORT: ::c_int = 0x0200; +pub const SO_TYPE: ::c_int = 0x1008; +// pub const SO_STYLE: ::c_int = SO_TYPE; +pub const SO_ERROR: ::c_int = 0x1007; +pub const SO_SNDBUF: ::c_int = 0x1001; +pub const SO_RCVBUF: ::c_int = 0x1002; +pub const SO_SNDLOWAT: ::c_int = 0x1003; +pub const SO_RCVLOWAT: ::c_int = 0x1004; +// NOTE: These definitions are now being renamed with _OLD postfix, +// but CI haven't support them yet. +// Some related consts could be found in b32.rs and b64.rs +pub const SO_SNDTIMEO: ::c_int = 0x1005; +pub const SO_RCVTIMEO: ::c_int = 0x1006; +// pub const SO_SNDTIMEO_OLD: ::c_int = 0x1005; +// pub const SO_RCVTIMEO_OLD: ::c_int = 0x1006; +pub const SO_ACCEPTCONN: ::c_int = 0x1009; +pub const SO_PROTOCOL: ::c_int = 0x1028; +pub const SO_DOMAIN: ::c_int = 0x1029; + +pub const SO_NO_CHECK: ::c_int = 11; +pub const SO_PRIORITY: ::c_int = 12; +pub const SO_BSDCOMPAT: ::c_int = 14; +pub const SO_PASSCRED: ::c_int = 17; +pub const SO_PEERCRED: ::c_int = 18; +pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22; +pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23; +pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24; +pub const SO_BINDTODEVICE: ::c_int = 25; +pub const SO_ATTACH_FILTER: ::c_int = 26; +pub const SO_DETACH_FILTER: ::c_int = 27; +pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER; +pub const SO_PEERNAME: ::c_int = 28; +pub const SO_PEERSEC: ::c_int = 30; +pub const SO_SNDBUFFORCE: ::c_int = 31; +pub const SO_RCVBUFFORCE: ::c_int = 33; +pub const SO_PASSSEC: ::c_int = 34; +pub const SO_MARK: ::c_int = 36; +pub const SO_RXQ_OVFL: ::c_int = 40; +pub const SO_WIFI_STATUS: ::c_int = 41; +pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS; +pub const SO_PEEK_OFF: ::c_int = 42; +pub const SO_NOFCS: ::c_int = 43; +pub const SO_LOCK_FILTER: ::c_int = 44; +pub const SO_SELECT_ERR_QUEUE: ::c_int = 45; +pub const SO_BUSY_POLL: ::c_int = 46; +pub const SO_MAX_PACING_RATE: ::c_int = 47; +pub const SO_BPF_EXTENSIONS: ::c_int = 48; +pub const SO_INCOMING_CPU: ::c_int = 49; +pub const SO_ATTACH_BPF: ::c_int = 50; +pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER; +pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51; +pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52; +pub const SO_CNX_ADVICE: ::c_int = 53; +pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54; +pub const SO_MEMINFO: ::c_int = 55; +pub const SO_INCOMING_NAPI_ID: ::c_int = 56; +pub const SO_COOKIE: ::c_int = 57; +pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58; +pub const SO_PEERGROUPS: ::c_int = 59; +pub const SO_ZEROCOPY: ::c_int = 60; +pub const SO_TXTIME: ::c_int = 61; +pub const SCM_TXTIME: ::c_int = SO_TXTIME; +pub const SO_BINDTOIFINDEX: ::c_int = 62; +// NOTE: These definitions are now being renamed with _OLD postfix, +// but CI haven't support them yet. +// Some related consts could be found in b32.rs and b64.rs +pub const SO_TIMESTAMP: ::c_int = 29; +pub const SO_TIMESTAMPNS: ::c_int = 35; +pub const SO_TIMESTAMPING: ::c_int = 37; +// pub const SO_TIMESTAMP_OLD: ::c_int = 29; +// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35; +// pub const SO_TIMESTAMPING_OLD: ::c_int = 37; +// pub const SO_TIMESTAMP_NEW: ::c_int = 63; +// pub const SO_TIMESTAMPNS_NEW: ::c_int = 64; +// pub const SO_TIMESTAMPING_NEW: ::c_int = 65; +// pub const SO_RCVTIMEO_NEW: ::c_int = 66; +// pub const SO_SNDTIMEO_NEW: ::c_int = 67; +// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68; +// pub const SO_PREFER_BUSY_POLL: ::c_int = 69; +// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; + +// Defined in unix/linux_like/mod.rs +// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; +pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; +pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING; + +// Ioctl Constants + +pub const TCGETS: ::Ioctl = 0x540d; +pub const TCSETS: ::Ioctl = 0x540e; +pub const TCSETSW: ::Ioctl = 0x540f; +pub const TCSETSF: ::Ioctl = 0x5410; +pub const TCGETA: ::Ioctl = 0x5401; +pub const TCSETA: ::Ioctl = 0x5402; +pub const TCSETAW: ::Ioctl = 0x5403; +pub const TCSETAF: ::Ioctl = 0x5404; +pub const TCSBRK: ::Ioctl = 0x5405; +pub const TCXONC: ::Ioctl = 0x5406; +pub const TCFLSH: ::Ioctl = 0x5407; +pub const TIOCEXCL: ::Ioctl = 0x740d; +pub const TIOCNXCL: ::Ioctl = 0x740e; +pub const TIOCSCTTY: ::Ioctl = 0x5480; +pub const TIOCGPGRP: ::Ioctl = 0x40047477; +pub const TIOCSPGRP: ::Ioctl = 0x80047476; +pub const TIOCOUTQ: ::Ioctl = 0x7472; +pub const TIOCSTI: ::Ioctl = 0x5472; +pub const TIOCGWINSZ: ::Ioctl = 0x40087468; +pub const TIOCSWINSZ: ::Ioctl = 0x80087467; +pub const TIOCMGET: ::Ioctl = 0x741d; +pub const TIOCMBIS: ::Ioctl = 0x741b; +pub const TIOCMBIC: ::Ioctl = 0x741c; +pub const TIOCMSET: ::Ioctl = 0x741a; +pub const TIOCGSOFTCAR: ::Ioctl = 0x5481; +pub const TIOCSSOFTCAR: ::Ioctl = 0x5482; +pub const FIONREAD: ::Ioctl = 0x467f; +pub const TIOCINQ: ::Ioctl = FIONREAD; +pub const TIOCLINUX: ::Ioctl = 0x5483; +pub const TIOCCONS: ::Ioctl = 0x80047478; +pub const TIOCGSERIAL: ::Ioctl = 0x5484; +pub const TIOCSSERIAL: ::Ioctl = 0x5485; +pub const TIOCPKT: ::Ioctl = 0x5470; +pub const FIONBIO: ::Ioctl = 0x667e; +pub const TIOCNOTTY: ::Ioctl = 0x5471; +pub const TIOCSETD: ::Ioctl = 0x7401; +pub const TIOCGETD: ::Ioctl = 0x7400; +pub const TCSBRKP: ::Ioctl = 0x5486; +pub const TIOCSBRK: ::Ioctl = 0x5427; +pub const TIOCCBRK: ::Ioctl = 0x5428; +pub const TIOCGSID: ::Ioctl = 0x7416; +pub const TCGETS2: ::Ioctl = 0x4030542a; +pub const TCSETS2: ::Ioctl = 0x8030542b; +pub const TCSETSW2: ::Ioctl = 0x8030542c; +pub const TCSETSF2: ::Ioctl = 0x8030542d; +pub const TIOCGPTN: ::Ioctl = 0x40045430; +pub const TIOCSPTLCK: ::Ioctl = 0x80045431; +pub const TIOCGDEV: ::Ioctl = 0x40045432; +pub const TIOCSIG: ::Ioctl = 0x80045436; +pub const TIOCVHANGUP: ::Ioctl = 0x5437; +pub const TIOCGPKT: ::Ioctl = 0x40045438; +pub const TIOCGPTLCK: ::Ioctl = 0x40045439; +pub const TIOCGEXCL: ::Ioctl = 0x40045440; +pub const TIOCGPTPEER: ::Ioctl = 0x20005441; +//pub const TIOCGISO7816: ::Ioctl = 0x40285442; +//pub const TIOCSISO7816: ::Ioctl = 0xc0285443; +pub const FIONCLEX: ::Ioctl = 0x6602; +pub const FIOCLEX: ::Ioctl = 0x6601; +pub const FIOASYNC: ::Ioctl = 0x667d; +pub const TIOCSERCONFIG: ::Ioctl = 0x5488; +pub const TIOCSERGWILD: ::Ioctl = 0x5489; +pub const TIOCSERSWILD: ::Ioctl = 0x548a; +pub const TIOCGLCKTRMIOS: ::Ioctl = 0x548b; +pub const TIOCSLCKTRMIOS: ::Ioctl = 0x548c; +pub const TIOCSERGSTRUCT: ::Ioctl = 0x548d; +pub const TIOCSERGETLSR: ::Ioctl = 0x548e; +pub const TIOCSERGETMULTI: ::Ioctl = 0x548f; +pub const TIOCSERSETMULTI: ::Ioctl = 0x5490; +pub const TIOCMIWAIT: ::Ioctl = 0x5491; +pub const TIOCGICOUNT: ::Ioctl = 0x5492; +pub const FIOQSIZE: ::Ioctl = 0x667f; +pub const TIOCSLTC: ::Ioctl = 0x7475; +pub const TIOCGETP: ::Ioctl = 0x7408; +pub const TIOCSETP: ::Ioctl = 0x7409; +pub const TIOCSETN: ::Ioctl = 0x740a; +pub const BLKIOMIN: ::Ioctl = 0x20001278; +pub const BLKIOOPT: ::Ioctl = 0x20001279; +pub const BLKSSZGET: ::Ioctl = 0x20001268; +pub const BLKPBSZGET: ::Ioctl = 0x2000127B; + +cfg_if! { + if #[cfg(target_env = "musl")] { + pub const TIOCGRS485: ::Ioctl = 0x4020542e; + pub const TIOCSRS485: ::Ioctl = 0xc020542f; + } +} + +pub const TIOCM_LE: ::c_int = 0x001; +pub const TIOCM_DTR: ::c_int = 0x002; +pub const TIOCM_RTS: ::c_int = 0x004; +pub const TIOCM_ST: ::c_int = 0x010; +pub const TIOCM_SR: ::c_int = 0x020; +pub const TIOCM_CTS: ::c_int = 0x040; +pub const TIOCM_CAR: ::c_int = 0x100; +pub const TIOCM_CD: ::c_int = TIOCM_CAR; +pub const TIOCM_RNG: ::c_int = 0x200; +pub const TIOCM_RI: ::c_int = TIOCM_RNG; +pub const TIOCM_DSR: ::c_int = 0x400; + +pub const BOTHER: ::speed_t = 0o010000; +pub const IBSHIFT: ::tcflag_t = 16; + +// RLIMIT Constants + +cfg_if! { + if #[cfg(any(target_env = "gnu", + target_env = "uclibc"))] { + + pub const RLIMIT_CPU: ::__rlimit_resource_t = 0; + pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1; + pub const RLIMIT_DATA: ::__rlimit_resource_t = 2; + pub const RLIMIT_STACK: ::__rlimit_resource_t = 3; + pub const RLIMIT_CORE: ::__rlimit_resource_t = 4; + pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 5; + pub const RLIMIT_AS: ::__rlimit_resource_t = 6; + pub const RLIMIT_RSS: ::__rlimit_resource_t = 7; + pub const RLIMIT_NPROC: ::__rlimit_resource_t = 8; + pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 9; + pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10; + pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11; + pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12; + pub const RLIMIT_NICE: ::__rlimit_resource_t = 13; + pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14; + pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15; + pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS; + + } else if #[cfg(target_env = "musl")] { + + pub const RLIMIT_CPU: ::c_int = 0; + pub const RLIMIT_FSIZE: ::c_int = 1; + pub const RLIMIT_DATA: ::c_int = 2; + pub const RLIMIT_STACK: ::c_int = 3; + pub const RLIMIT_CORE: ::c_int = 4; + pub const RLIMIT_NOFILE: ::c_int = 5; + pub const RLIMIT_AS: ::c_int = 6; + pub const RLIMIT_RSS: ::c_int = 7; + pub const RLIMIT_NPROC: ::c_int = 8; + pub const RLIMIT_MEMLOCK: ::c_int = 9; + pub const RLIMIT_LOCKS: ::c_int = 10; + pub const RLIMIT_SIGPENDING: ::c_int = 11; + pub const RLIMIT_MSGQUEUE: ::c_int = 12; + pub const RLIMIT_NICE: ::c_int = 13; + pub const RLIMIT_RTPRIO: ::c_int = 14; + pub const RLIMIT_RTTIME: ::c_int = 15; + pub const RLIM_NLIMITS: ::c_int = 15; + pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS; + pub const RLIM_INFINITY: ::rlim_t = !0; + } +} + +cfg_if! { + if #[cfg(target_env = "gnu")] { + pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16; + } else if #[cfg(target_env = "uclibc")] { + pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15; + } +} + +cfg_if! { + if #[cfg(target_arch = "mips64", + any(target_env = "gnu", + target_env = "uclibc"))] { + pub const RLIM_INFINITY: ::rlim_t = !0; + } +} + +cfg_if! { + if #[cfg(target_arch = "mips", + any(target_env = "gnu", + target_env = "uclibc"))] { + pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..c1528f593f63e0fde3d3901102b27c1e95009d0c --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/mod.rs @@ -0,0 +1,15 @@ +cfg_if! { + if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] { + mod mips; + pub use self::mips::*; + } else if #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] { + mod powerpc; + pub use self::powerpc::*; + } else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] { + mod sparc; + pub use self::sparc::*; + } else { + mod generic; + pub use self::generic::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..637b7a1e34746ed410c15eeaf2964e8b5b391c16 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/powerpc/mod.rs @@ -0,0 +1,240 @@ +// arch/powerpc/include/uapi/asm/socket.h + +pub const SOL_SOCKET: ::c_int = 1; + +// Defined in unix/linux_like/mod.rs +// pub const SO_DEBUG: ::c_int = 1; +pub const SO_REUSEADDR: ::c_int = 2; +pub const SO_TYPE: ::c_int = 3; +pub const SO_ERROR: ::c_int = 4; +pub const SO_DONTROUTE: ::c_int = 5; +pub const SO_BROADCAST: ::c_int = 6; +pub const SO_SNDBUF: ::c_int = 7; +pub const SO_RCVBUF: ::c_int = 8; +pub const SO_KEEPALIVE: ::c_int = 9; +pub const SO_OOBINLINE: ::c_int = 10; +pub const SO_NO_CHECK: ::c_int = 11; +pub const SO_PRIORITY: ::c_int = 12; +pub const SO_LINGER: ::c_int = 13; +pub const SO_BSDCOMPAT: ::c_int = 14; +pub const SO_REUSEPORT: ::c_int = 15; +// powerpc only differs in these +pub const SO_RCVLOWAT: ::c_int = 16; +pub const SO_SNDLOWAT: ::c_int = 17; +pub const SO_RCVTIMEO: ::c_int = 18; +pub const SO_SNDTIMEO: ::c_int = 19; +// pub const SO_RCVTIMEO_OLD: ::c_int = 18; +// pub const SO_SNDTIMEO_OLD: ::c_int = 19; +pub const SO_PASSCRED: ::c_int = 20; +pub const SO_PEERCRED: ::c_int = 21; +// end +pub const SO_SECURITY_AUTHENTICATION: ::c_int = 22; +pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 23; +pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 24; +pub const SO_BINDTODEVICE: ::c_int = 25; +pub const SO_ATTACH_FILTER: ::c_int = 26; +pub const SO_DETACH_FILTER: ::c_int = 27; +pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER; +pub const SO_PEERNAME: ::c_int = 28; +pub const SO_TIMESTAMP: ::c_int = 29; +// pub const SO_TIMESTAMP_OLD: ::c_int = 29; +pub const SO_ACCEPTCONN: ::c_int = 30; +pub const SO_PEERSEC: ::c_int = 31; +pub const SO_SNDBUFFORCE: ::c_int = 32; +pub const SO_RCVBUFFORCE: ::c_int = 33; +pub const SO_PASSSEC: ::c_int = 34; +pub const SO_TIMESTAMPNS: ::c_int = 35; +// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35; +pub const SO_MARK: ::c_int = 36; +pub const SO_TIMESTAMPING: ::c_int = 37; +// pub const SO_TIMESTAMPING_OLD: ::c_int = 37; +pub const SO_PROTOCOL: ::c_int = 38; +pub const SO_DOMAIN: ::c_int = 39; +pub const SO_RXQ_OVFL: ::c_int = 40; +pub const SO_WIFI_STATUS: ::c_int = 41; +pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS; +pub const SO_PEEK_OFF: ::c_int = 42; +pub const SO_NOFCS: ::c_int = 43; +pub const SO_LOCK_FILTER: ::c_int = 44; +pub const SO_SELECT_ERR_QUEUE: ::c_int = 45; +pub const SO_BUSY_POLL: ::c_int = 46; +pub const SO_MAX_PACING_RATE: ::c_int = 47; +pub const SO_BPF_EXTENSIONS: ::c_int = 48; +pub const SO_INCOMING_CPU: ::c_int = 49; +pub const SO_ATTACH_BPF: ::c_int = 50; +pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER; +pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 51; +pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 52; +pub const SO_CNX_ADVICE: ::c_int = 53; +pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54; +pub const SO_MEMINFO: ::c_int = 55; +pub const SO_INCOMING_NAPI_ID: ::c_int = 56; +pub const SO_COOKIE: ::c_int = 57; +pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58; +pub const SO_PEERGROUPS: ::c_int = 59; +pub const SO_ZEROCOPY: ::c_int = 60; +pub const SO_TXTIME: ::c_int = 61; +pub const SCM_TXTIME: ::c_int = SO_TXTIME; +pub const SO_BINDTOIFINDEX: ::c_int = 62; +// pub const SO_TIMESTAMP_NEW: ::c_int = 63; +// pub const SO_TIMESTAMPNS_NEW: ::c_int = 64; +// pub const SO_TIMESTAMPING_NEW: ::c_int = 65; +// pub const SO_RCVTIMEO_NEW: ::c_int = 66; +// pub const SO_SNDTIMEO_NEW: ::c_int = 67; +// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68; +// pub const SO_PREFER_BUSY_POLL: ::c_int = 69; +// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; + +// Defined in unix/linux_like/mod.rs +// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; +pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; +pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING; + +// Ioctl Constants + +cfg_if! { + if #[cfg(target_env = "gnu")] { + pub const TCGETS: ::Ioctl = 0x403c7413; + pub const TCSETS: ::Ioctl = 0x803c7414; + pub const TCSETSW: ::Ioctl = 0x803c7415; + pub const TCSETSF: ::Ioctl = 0x803c7416; + } else if #[cfg(target_env = "musl")] { + pub const TCGETS: ::Ioctl = 0x402c7413; + pub const TCSETS: ::Ioctl = 0x802c7414; + pub const TCSETSW: ::Ioctl = 0x802c7415; + pub const TCSETSF: ::Ioctl = 0x802c7416; + } +} + +pub const TCGETA: ::Ioctl = 0x40147417; +pub const TCSETA: ::Ioctl = 0x80147418; +pub const TCSETAW: ::Ioctl = 0x80147419; +pub const TCSETAF: ::Ioctl = 0x8014741C; +pub const TCSBRK: ::Ioctl = 0x2000741D; +pub const TCXONC: ::Ioctl = 0x2000741E; +pub const TCFLSH: ::Ioctl = 0x2000741F; +pub const TIOCEXCL: ::Ioctl = 0x540C; +pub const TIOCNXCL: ::Ioctl = 0x540D; +pub const TIOCSCTTY: ::Ioctl = 0x540E; +pub const TIOCGPGRP: ::Ioctl = 0x40047477; +pub const TIOCSPGRP: ::Ioctl = 0x80047476; +pub const TIOCOUTQ: ::Ioctl = 0x40047473; +pub const TIOCSTI: ::Ioctl = 0x5412; +pub const TIOCGWINSZ: ::Ioctl = 0x40087468; +pub const TIOCSWINSZ: ::Ioctl = 0x80087467; +pub const TIOCMGET: ::Ioctl = 0x5415; +pub const TIOCMBIS: ::Ioctl = 0x5416; +pub const TIOCMBIC: ::Ioctl = 0x5417; +pub const TIOCMSET: ::Ioctl = 0x5418; +pub const TIOCGSOFTCAR: ::Ioctl = 0x5419; +pub const TIOCSSOFTCAR: ::Ioctl = 0x541A; +pub const FIONREAD: ::Ioctl = 0x4004667F; +pub const TIOCINQ: ::Ioctl = FIONREAD; +pub const TIOCLINUX: ::Ioctl = 0x541C; +pub const TIOCCONS: ::Ioctl = 0x541D; +pub const TIOCGSERIAL: ::Ioctl = 0x541E; +pub const TIOCSSERIAL: ::Ioctl = 0x541F; +pub const TIOCPKT: ::Ioctl = 0x5420; +pub const FIONBIO: ::Ioctl = 0x8004667e; +pub const TIOCNOTTY: ::Ioctl = 0x5422; +pub const TIOCSETD: ::Ioctl = 0x5423; +pub const TIOCGETD: ::Ioctl = 0x5424; +pub const TCSBRKP: ::Ioctl = 0x5425; +pub const TIOCSBRK: ::Ioctl = 0x5427; +pub const TIOCCBRK: ::Ioctl = 0x5428; +pub const TIOCGSID: ::Ioctl = 0x5429; +pub const TIOCGRS485: ::Ioctl = 0x542e; +pub const TIOCSRS485: ::Ioctl = 0x542f; +pub const TIOCGPTN: ::Ioctl = 0x40045430; +pub const TIOCSPTLCK: ::Ioctl = 0x80045431; +pub const TIOCGDEV: ::Ioctl = 0x40045432; +pub const TIOCSIG: ::Ioctl = 0x80045436; +pub const TIOCVHANGUP: ::Ioctl = 0x5437; +pub const TIOCGPKT: ::Ioctl = 0x40045438; +pub const TIOCGPTLCK: ::Ioctl = 0x40045439; +pub const TIOCGEXCL: ::Ioctl = 0x40045440; +pub const TIOCGPTPEER: ::Ioctl = 0x20005441; +//pub const TIOCGISO7816: ::Ioctl = 0x40285442; +//pub const TIOCSISO7816: ::Ioctl = 0xc0285443; +pub const FIONCLEX: ::Ioctl = 0x20006602; +pub const FIOCLEX: ::Ioctl = 0x20006601; +pub const FIOASYNC: ::Ioctl = 0x8004667d; +pub const TIOCSERCONFIG: ::Ioctl = 0x5453; +pub const TIOCSERGWILD: ::Ioctl = 0x5454; +pub const TIOCSERSWILD: ::Ioctl = 0x5455; +pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456; +pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457; +pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458; +pub const TIOCSERGETLSR: ::Ioctl = 0x5459; +pub const TIOCSERGETMULTI: ::Ioctl = 0x545A; +pub const TIOCSERSETMULTI: ::Ioctl = 0x545B; +pub const TIOCMIWAIT: ::Ioctl = 0x545C; +pub const TIOCGICOUNT: ::Ioctl = 0x545D; +pub const BLKIOMIN: ::Ioctl = 0x20001278; +pub const BLKIOOPT: ::Ioctl = 0x20001279; +pub const BLKSSZGET: ::Ioctl = 0x20001268; +pub const BLKPBSZGET: ::Ioctl = 0x2000127B; +//pub const FIOQSIZE: ::Ioctl = 0x40086680; + +pub const TIOCM_LE: ::c_int = 0x001; +pub const TIOCM_DTR: ::c_int = 0x002; +pub const TIOCM_RTS: ::c_int = 0x004; +pub const TIOCM_ST: ::c_int = 0x008; +pub const TIOCM_SR: ::c_int = 0x010; +pub const TIOCM_CTS: ::c_int = 0x020; +pub const TIOCM_CAR: ::c_int = 0x040; +pub const TIOCM_CD: ::c_int = TIOCM_CAR; +pub const TIOCM_RNG: ::c_int = 0x080; +pub const TIOCM_RI: ::c_int = TIOCM_RNG; +pub const TIOCM_DSR: ::c_int = 0x100; + +pub const BOTHER: ::speed_t = 0o0037; +pub const IBSHIFT: ::tcflag_t = 16; + +// RLIMIT Constants + +cfg_if! { + if #[cfg(target_env = "gnu")] { + + pub const RLIMIT_CPU: ::__rlimit_resource_t = 0; + pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1; + pub const RLIMIT_DATA: ::__rlimit_resource_t = 2; + pub const RLIMIT_STACK: ::__rlimit_resource_t = 3; + pub const RLIMIT_CORE: ::__rlimit_resource_t = 4; + pub const RLIMIT_RSS: ::__rlimit_resource_t = 5; + pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6; + pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7; + pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8; + pub const RLIMIT_AS: ::__rlimit_resource_t = 9; + pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10; + pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11; + pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12; + pub const RLIMIT_NICE: ::__rlimit_resource_t = 13; + pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14; + pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15; + pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16; + pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS; + + } else if #[cfg(target_env = "musl")] { + + pub const RLIMIT_CPU: ::c_int = 0; + pub const RLIMIT_FSIZE: ::c_int = 1; + pub const RLIMIT_DATA: ::c_int = 2; + pub const RLIMIT_STACK: ::c_int = 3; + pub const RLIMIT_CORE: ::c_int = 4; + pub const RLIMIT_RSS: ::c_int = 5; + pub const RLIMIT_NPROC: ::c_int = 6; + pub const RLIMIT_NOFILE: ::c_int = 7; + pub const RLIMIT_MEMLOCK: ::c_int = 8; + pub const RLIMIT_AS: ::c_int = 9; + pub const RLIMIT_LOCKS: ::c_int = 10; + pub const RLIMIT_SIGPENDING: ::c_int = 11; + pub const RLIMIT_MSGQUEUE: ::c_int = 12; + pub const RLIMIT_NICE: ::c_int = 13; + pub const RLIMIT_RTPRIO: ::c_int = 14; + pub const RLIMIT_RTTIME: ::c_int = 15; + pub const RLIM_NLIMITS: ::c_int = 15; + pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS; + } +} +pub const RLIM_INFINITY: ::rlim_t = !0; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..da3e388e3d286c01c7dcdfd3f9f776f6f1fb9537 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/arch/sparc/mod.rs @@ -0,0 +1,228 @@ +s! { + pub struct termios2 { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; 19], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } +} + +// arch/sparc/include/uapi/asm/socket.h +pub const SOL_SOCKET: ::c_int = 0xffff; + +// Defined in unix/linux_like/mod.rs +// pub const SO_DEBUG: ::c_int = 0x0001; +pub const SO_PASSCRED: ::c_int = 0x0002; +pub const SO_REUSEADDR: ::c_int = 0x0004; +pub const SO_KEEPALIVE: ::c_int = 0x0008; +pub const SO_DONTROUTE: ::c_int = 0x0010; +pub const SO_BROADCAST: ::c_int = 0x0020; +pub const SO_PEERCRED: ::c_int = 0x0040; +pub const SO_LINGER: ::c_int = 0x0080; +pub const SO_OOBINLINE: ::c_int = 0x0100; +pub const SO_REUSEPORT: ::c_int = 0x0200; +pub const SO_BSDCOMPAT: ::c_int = 0x0400; +pub const SO_RCVLOWAT: ::c_int = 0x0800; +pub const SO_SNDLOWAT: ::c_int = 0x1000; +pub const SO_RCVTIMEO: ::c_int = 0x2000; +pub const SO_SNDTIMEO: ::c_int = 0x4000; +// pub const SO_RCVTIMEO_OLD: ::c_int = 0x2000; +// pub const SO_SNDTIMEO_OLD: ::c_int = 0x4000; +pub const SO_ACCEPTCONN: ::c_int = 0x8000; +pub const SO_SNDBUF: ::c_int = 0x1001; +pub const SO_RCVBUF: ::c_int = 0x1002; +pub const SO_SNDBUFFORCE: ::c_int = 0x100a; +pub const SO_RCVBUFFORCE: ::c_int = 0x100b; +pub const SO_ERROR: ::c_int = 0x1007; +pub const SO_TYPE: ::c_int = 0x1008; +pub const SO_PROTOCOL: ::c_int = 0x1028; +pub const SO_DOMAIN: ::c_int = 0x1029; +pub const SO_NO_CHECK: ::c_int = 0x000b; +pub const SO_PRIORITY: ::c_int = 0x000c; +pub const SO_BINDTODEVICE: ::c_int = 0x000d; +pub const SO_ATTACH_FILTER: ::c_int = 0x001a; +pub const SO_DETACH_FILTER: ::c_int = 0x001b; +pub const SO_GET_FILTER: ::c_int = SO_ATTACH_FILTER; +pub const SO_PEERNAME: ::c_int = 0x001c; +pub const SO_PEERSEC: ::c_int = 0x001e; +pub const SO_PASSSEC: ::c_int = 0x001f; +pub const SO_MARK: ::c_int = 0x0022; +pub const SO_RXQ_OVFL: ::c_int = 0x0024; +pub const SO_WIFI_STATUS: ::c_int = 0x0025; +pub const SCM_WIFI_STATUS: ::c_int = SO_WIFI_STATUS; +pub const SO_PEEK_OFF: ::c_int = 0x0026; +pub const SO_NOFCS: ::c_int = 0x0027; +pub const SO_LOCK_FILTER: ::c_int = 0x0028; +pub const SO_SELECT_ERR_QUEUE: ::c_int = 0x0029; +pub const SO_BUSY_POLL: ::c_int = 0x0030; +pub const SO_MAX_PACING_RATE: ::c_int = 0x0031; +pub const SO_BPF_EXTENSIONS: ::c_int = 0x0032; +pub const SO_INCOMING_CPU: ::c_int = 0x0033; +pub const SO_ATTACH_BPF: ::c_int = 0x0034; +pub const SO_DETACH_BPF: ::c_int = SO_DETACH_FILTER; +pub const SO_ATTACH_REUSEPORT_CBPF: ::c_int = 0x0035; +pub const SO_ATTACH_REUSEPORT_EBPF: ::c_int = 0x0036; +pub const SO_CNX_ADVICE: ::c_int = 0x0037; +pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 0x0038; +pub const SO_MEMINFO: ::c_int = 0x0039; +pub const SO_INCOMING_NAPI_ID: ::c_int = 0x003a; +pub const SO_COOKIE: ::c_int = 0x003b; +pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 0x003c; +pub const SO_PEERGROUPS: ::c_int = 0x003d; +pub const SO_ZEROCOPY: ::c_int = 0x003e; +pub const SO_TXTIME: ::c_int = 0x003f; +pub const SCM_TXTIME: ::c_int = SO_TXTIME; +pub const SO_BINDTOIFINDEX: ::c_int = 0x0041; +pub const SO_SECURITY_AUTHENTICATION: ::c_int = 0x5001; +pub const SO_SECURITY_ENCRYPTION_TRANSPORT: ::c_int = 0x5002; +pub const SO_SECURITY_ENCRYPTION_NETWORK: ::c_int = 0x5004; +pub const SO_TIMESTAMP: ::c_int = 0x001d; +pub const SO_TIMESTAMPNS: ::c_int = 0x0021; +pub const SO_TIMESTAMPING: ::c_int = 0x0023; +// pub const SO_TIMESTAMP_OLD: ::c_int = 0x001d; +// pub const SO_TIMESTAMPNS_OLD: ::c_int = 0x0021; +// pub const SO_TIMESTAMPING_OLD: ::c_int = 0x0023; +// pub const SO_TIMESTAMP_NEW: ::c_int = 0x0046; +// pub const SO_TIMESTAMPNS_NEW: ::c_int = 0x0042; +// pub const SO_TIMESTAMPING_NEW: ::c_int = 0x0043; +// pub const SO_RCVTIMEO_NEW: ::c_int = 0x0044; +// pub const SO_SNDTIMEO_NEW: ::c_int = 0x0045; +// pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 0x0047; +// pub const SO_PREFER_BUSY_POLL: ::c_int = 0x0048; +// pub const SO_BUSY_POLL_BUDGET: ::c_int = 0x0049; + +// Defined in unix/linux_like/mod.rs +// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; +pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; +pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING; + +// Ioctl Constants + +pub const TCGETS: ::Ioctl = 0x40245408; +pub const TCSETS: ::Ioctl = 0x80245409; +pub const TCSETSW: ::Ioctl = 0x8024540a; +pub const TCSETSF: ::Ioctl = 0x8024540b; +pub const TCGETA: ::Ioctl = 0x40125401; +pub const TCSETA: ::Ioctl = 0x80125402; +pub const TCSETAW: ::Ioctl = 0x80125403; +pub const TCSETAF: ::Ioctl = 0x80125404; +pub const TCSBRK: ::Ioctl = 0x20005405; +pub const TCXONC: ::Ioctl = 0x20005406; +pub const TCFLSH: ::Ioctl = 0x20005407; +pub const TIOCEXCL: ::Ioctl = 0x2000740d; +pub const TIOCNXCL: ::Ioctl = 0x2000740e; +pub const TIOCSCTTY: ::Ioctl = 0x20007484; +pub const TIOCGPGRP: ::Ioctl = 0x40047483; +pub const TIOCSPGRP: ::Ioctl = 0x80047482; +pub const TIOCOUTQ: ::Ioctl = 0x40047473; +pub const TIOCSTI: ::Ioctl = 0x80017472; +pub const TIOCGWINSZ: ::Ioctl = 0x40087468; +pub const TIOCSWINSZ: ::Ioctl = 0x80087467; +pub const TIOCMGET: ::Ioctl = 0x4004746a; +pub const TIOCMBIS: ::Ioctl = 0x8004746c; +pub const TIOCMBIC: ::Ioctl = 0x8004746b; +pub const TIOCMSET: ::Ioctl = 0x8004746d; +pub const TIOCGSOFTCAR: ::Ioctl = 0x40047464; +pub const TIOCSSOFTCAR: ::Ioctl = 0x80047465; +pub const FIONREAD: ::Ioctl = 0x4004667f; +pub const TIOCINQ: ::Ioctl = FIONREAD; +pub const TIOCLINUX: ::Ioctl = 0x541C; +pub const TIOCCONS: ::Ioctl = 0x20007424; +pub const TIOCGSERIAL: ::Ioctl = 0x541E; +pub const TIOCSSERIAL: ::Ioctl = 0x541F; +pub const TIOCPKT: ::Ioctl = 0x80047470; +pub const FIONBIO: ::Ioctl = 0x8004667e; +pub const TIOCNOTTY: ::Ioctl = 0x20007471; +pub const TIOCSETD: ::Ioctl = 0x80047401; +pub const TIOCGETD: ::Ioctl = 0x40047400; +pub const TCSBRKP: ::Ioctl = 0x5425; +pub const TIOCSBRK: ::Ioctl = 0x2000747b; +pub const TIOCCBRK: ::Ioctl = 0x2000747a; +pub const TIOCGSID: ::Ioctl = 0x40047485; +pub const TCGETS2: ::Ioctl = 0x402c540c; +pub const TCSETS2: ::Ioctl = 0x802c540d; +pub const TCSETSW2: ::Ioctl = 0x802c540e; +pub const TCSETSF2: ::Ioctl = 0x802c540f; +pub const TIOCGPTN: ::Ioctl = 0x40047486; +pub const TIOCSPTLCK: ::Ioctl = 0x80047487; +pub const TIOCGDEV: ::Ioctl = 0x40045432; +pub const TIOCSIG: ::Ioctl = 0x80047488; +pub const TIOCVHANGUP: ::Ioctl = 0x20005437; +pub const TIOCGPKT: ::Ioctl = 0x40045438; +pub const TIOCGPTLCK: ::Ioctl = 0x40045439; +pub const TIOCGEXCL: ::Ioctl = 0x40045440; +pub const TIOCGPTPEER: ::Ioctl = 0x20007489; +pub const FIONCLEX: ::Ioctl = 0x20006602; +pub const FIOCLEX: ::Ioctl = 0x20006601; +pub const TIOCSERCONFIG: ::Ioctl = 0x5453; +pub const TIOCSERGWILD: ::Ioctl = 0x5454; +pub const TIOCSERSWILD: ::Ioctl = 0x5455; +pub const TIOCGLCKTRMIOS: ::Ioctl = 0x5456; +pub const TIOCSLCKTRMIOS: ::Ioctl = 0x5457; +pub const TIOCSERGSTRUCT: ::Ioctl = 0x5458; +pub const TIOCSERGETLSR: ::Ioctl = 0x5459; +pub const TIOCSERGETMULTI: ::Ioctl = 0x545A; +pub const TIOCSERSETMULTI: ::Ioctl = 0x545B; +pub const TIOCMIWAIT: ::Ioctl = 0x545C; +pub const TIOCGICOUNT: ::Ioctl = 0x545D; +pub const TIOCSTART: ::Ioctl = 0x2000746e; +pub const TIOCSTOP: ::Ioctl = 0x2000746f; +pub const BLKIOMIN: ::Ioctl = 0x20001278; +pub const BLKIOOPT: ::Ioctl = 0x20001279; +pub const BLKSSZGET: ::Ioctl = 0x20001268; +pub const BLKPBSZGET: ::Ioctl = 0x2000127B; + +//pub const FIOASYNC: ::Ioctl = 0x4004667d; +//pub const FIOQSIZE: ::Ioctl = ; +//pub const TIOCGISO7816: ::Ioctl = 0x40285443; +//pub const TIOCSISO7816: ::Ioctl = 0xc0285444; +//pub const TIOCGRS485: ::Ioctl = 0x40205441; +//pub const TIOCSRS485: ::Ioctl = 0xc0205442; + +pub const TIOCM_LE: ::c_int = 0x001; +pub const TIOCM_DTR: ::c_int = 0x002; +pub const TIOCM_RTS: ::c_int = 0x004; +pub const TIOCM_ST: ::c_int = 0x008; +pub const TIOCM_SR: ::c_int = 0x010; +pub const TIOCM_CTS: ::c_int = 0x020; +pub const TIOCM_CAR: ::c_int = 0x040; +pub const TIOCM_CD: ::c_int = TIOCM_CAR; +pub const TIOCM_RNG: ::c_int = 0x080; +pub const TIOCM_RI: ::c_int = TIOCM_RNG; +pub const TIOCM_DSR: ::c_int = 0x100; + +pub const BOTHER: ::speed_t = 0x1000; +pub const IBSHIFT: ::tcflag_t = 16; + +// RLIMIT Constants + +pub const RLIMIT_CPU: ::__rlimit_resource_t = 0; +pub const RLIMIT_FSIZE: ::__rlimit_resource_t = 1; +pub const RLIMIT_DATA: ::__rlimit_resource_t = 2; +pub const RLIMIT_STACK: ::__rlimit_resource_t = 3; +pub const RLIMIT_CORE: ::__rlimit_resource_t = 4; +pub const RLIMIT_RSS: ::__rlimit_resource_t = 5; +pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 6; +pub const RLIMIT_NPROC: ::__rlimit_resource_t = 7; +pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8; +pub const RLIMIT_AS: ::__rlimit_resource_t = 9; +pub const RLIMIT_LOCKS: ::__rlimit_resource_t = 10; +pub const RLIMIT_SIGPENDING: ::__rlimit_resource_t = 11; +pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12; +pub const RLIMIT_NICE: ::__rlimit_resource_t = 13; +pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14; +pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15; +pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16; +pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS; + +cfg_if! { + if #[cfg(target_arch = "sparc64")] { + pub const RLIM_INFINITY: ::rlim_t = !0; + } else if #[cfg(target_arch = "sparc")] { + pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..4a0e07460ebb10fe101ee84406726a5a2ac065a1 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/align.rs @@ -0,0 +1,13 @@ +s! { + // FIXME this is actually a union + #[cfg_attr(target_pointer_width = "32", + repr(align(4)))] + #[cfg_attr(target_pointer_width = "64", + repr(align(8)))] + pub struct sem_t { + #[cfg(target_pointer_width = "32")] + __size: [::c_char; 16], + #[cfg(target_pointer_width = "64")] + __size: [::c_char; 32], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..2645ec4c3d4f13b3b94a6467f515d09719abdb45 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/align.rs @@ -0,0 +1,53 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(8))] + pub struct max_align_t { + priv_: [i64; 2] + } + + #[allow(missing_debug_implementations)] + #[repr(align(8))] + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: ::mcontext_t, + pub uc_sigmask: ::sigset_t, + pub uc_regspace: [::c_ulong; 128], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for ucontext_t { + fn eq(&self, other: &ucontext_t) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_sigmask == other.uc_sigmask + } + } + impl Eq for ucontext_t {} + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_link) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field("uc_sigmask", &self.uc_sigmask) + .finish() + } + } + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + self.uc_sigmask.hash(state); + } + } + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..2a064974d41b12ac10fecb46e80bdf0d37ed3484 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs @@ -0,0 +1,844 @@ +pub type c_char = u8; +pub type wchar_t = u32; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct statfs { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + f_spare: [::__fsword_t; 5], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_ushort, + __pad1: ::c_ushort, + pub __seq: ::c_ushort, + __pad2: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + pub struct stat64 { + pub st_dev: ::dev_t, + __pad1: ::c_uint, + __st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad2: ::c_uint, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::ino64_t, + } + + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + __unused1: ::c_ulong, + pub shm_dtime: ::time_t, + __unused2: ::c_ulong, + pub shm_ctime: ::time_t, + __unused3: ::c_ulong, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + __glibc_reserved1: ::c_ulong, + pub msg_rtime: ::time_t, + __glibc_reserved2: ::c_ulong, + pub msg_ctime: ::time_t, + __glibc_reserved3: ::c_ulong, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __glibc_reserved4: ::c_ulong, + __glibc_reserved5: ::c_ulong, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct seccomp_notif_sizes { + pub seccomp_notif: ::__u16, + pub seccomp_notif_resp: ::__u16, + pub seccomp_data: ::__u16, + } + + pub struct mcontext_t { + pub trap_no: ::c_ulong, + pub error_code: ::c_ulong, + pub oldmask: ::c_ulong, + pub arm_r0: ::c_ulong, + pub arm_r1: ::c_ulong, + pub arm_r2: ::c_ulong, + pub arm_r3: ::c_ulong, + pub arm_r4: ::c_ulong, + pub arm_r5: ::c_ulong, + pub arm_r6: ::c_ulong, + pub arm_r7: ::c_ulong, + pub arm_r8: ::c_ulong, + pub arm_r9: ::c_ulong, + pub arm_r10: ::c_ulong, + pub arm_fp: ::c_ulong, + pub arm_ip: ::c_ulong, + pub arm_sp: ::c_ulong, + pub arm_lr: ::c_ulong, + pub arm_pc: ::c_ulong, + pub arm_cpsr: ::c_ulong, + pub fault_address: ::c_ulong, + } +} + +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_LARGEFILE: ::c_int = 0o400000; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 0x101000; +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_NDELAY: ::c_int = 0x800; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const EDEADLOCK: ::c_int = 35; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; + +pub const EFD_NONBLOCK: ::c_int = 0x800; +pub const SFD_NONBLOCK: ::c_int = 0x0800; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = 31; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0; +pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1; +pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2; +pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3; + +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; +pub const EXTPROC: ::tcflag_t = 0x00010000; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_pause: ::c_long = 29; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_chown: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_ugetrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_lchown32: ::c_long = 198; +pub const SYS_getuid32: ::c_long = 199; +pub const SYS_getgid32: ::c_long = 200; +pub const SYS_geteuid32: ::c_long = 201; +pub const SYS_getegid32: ::c_long = 202; +pub const SYS_setreuid32: ::c_long = 203; +pub const SYS_setregid32: ::c_long = 204; +pub const SYS_getgroups32: ::c_long = 205; +pub const SYS_setgroups32: ::c_long = 206; +pub const SYS_fchown32: ::c_long = 207; +pub const SYS_setresuid32: ::c_long = 208; +pub const SYS_getresuid32: ::c_long = 209; +pub const SYS_setresgid32: ::c_long = 210; +pub const SYS_getresgid32: ::c_long = 211; +pub const SYS_chown32: ::c_long = 212; +pub const SYS_setuid32: ::c_long = 213; +pub const SYS_setgid32: ::c_long = 214; +pub const SYS_setfsuid32: ::c_long = 215; +pub const SYS_setfsgid32: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; +pub const SYS_pivot_root: ::c_long = 218; +pub const SYS_mincore: ::c_long = 219; +pub const SYS_madvise: ::c_long = 220; +pub const SYS_fcntl64: ::c_long = 221; +pub const SYS_gettid: ::c_long = 224; +pub const SYS_readahead: ::c_long = 225; +pub const SYS_setxattr: ::c_long = 226; +pub const SYS_lsetxattr: ::c_long = 227; +pub const SYS_fsetxattr: ::c_long = 228; +pub const SYS_getxattr: ::c_long = 229; +pub const SYS_lgetxattr: ::c_long = 230; +pub const SYS_fgetxattr: ::c_long = 231; +pub const SYS_listxattr: ::c_long = 232; +pub const SYS_llistxattr: ::c_long = 233; +pub const SYS_flistxattr: ::c_long = 234; +pub const SYS_removexattr: ::c_long = 235; +pub const SYS_lremovexattr: ::c_long = 236; +pub const SYS_fremovexattr: ::c_long = 237; +pub const SYS_tkill: ::c_long = 238; +pub const SYS_sendfile64: ::c_long = 239; +pub const SYS_futex: ::c_long = 240; +pub const SYS_sched_setaffinity: ::c_long = 241; +pub const SYS_sched_getaffinity: ::c_long = 242; +pub const SYS_io_setup: ::c_long = 243; +pub const SYS_io_destroy: ::c_long = 244; +pub const SYS_io_getevents: ::c_long = 245; +pub const SYS_io_submit: ::c_long = 246; +pub const SYS_io_cancel: ::c_long = 247; +pub const SYS_exit_group: ::c_long = 248; +pub const SYS_lookup_dcookie: ::c_long = 249; +pub const SYS_epoll_create: ::c_long = 250; +pub const SYS_epoll_ctl: ::c_long = 251; +pub const SYS_epoll_wait: ::c_long = 252; +pub const SYS_remap_file_pages: ::c_long = 253; +pub const SYS_set_tid_address: ::c_long = 256; +pub const SYS_timer_create: ::c_long = 257; +pub const SYS_timer_settime: ::c_long = 258; +pub const SYS_timer_gettime: ::c_long = 259; +pub const SYS_timer_getoverrun: ::c_long = 260; +pub const SYS_timer_delete: ::c_long = 261; +pub const SYS_clock_settime: ::c_long = 262; +pub const SYS_clock_gettime: ::c_long = 263; +pub const SYS_clock_getres: ::c_long = 264; +pub const SYS_clock_nanosleep: ::c_long = 265; +pub const SYS_statfs64: ::c_long = 266; +pub const SYS_fstatfs64: ::c_long = 267; +pub const SYS_tgkill: ::c_long = 268; +pub const SYS_utimes: ::c_long = 269; +pub const SYS_arm_fadvise64_64: ::c_long = 270; +pub const SYS_pciconfig_iobase: ::c_long = 271; +pub const SYS_pciconfig_read: ::c_long = 272; +pub const SYS_pciconfig_write: ::c_long = 273; +pub const SYS_mq_open: ::c_long = 274; +pub const SYS_mq_unlink: ::c_long = 275; +pub const SYS_mq_timedsend: ::c_long = 276; +pub const SYS_mq_timedreceive: ::c_long = 277; +pub const SYS_mq_notify: ::c_long = 278; +pub const SYS_mq_getsetattr: ::c_long = 279; +pub const SYS_waitid: ::c_long = 280; +pub const SYS_socket: ::c_long = 281; +pub const SYS_bind: ::c_long = 282; +pub const SYS_connect: ::c_long = 283; +pub const SYS_listen: ::c_long = 284; +pub const SYS_accept: ::c_long = 285; +pub const SYS_getsockname: ::c_long = 286; +pub const SYS_getpeername: ::c_long = 287; +pub const SYS_socketpair: ::c_long = 288; +pub const SYS_send: ::c_long = 289; +pub const SYS_sendto: ::c_long = 290; +pub const SYS_recv: ::c_long = 291; +pub const SYS_recvfrom: ::c_long = 292; +pub const SYS_shutdown: ::c_long = 293; +pub const SYS_setsockopt: ::c_long = 294; +pub const SYS_getsockopt: ::c_long = 295; +pub const SYS_sendmsg: ::c_long = 296; +pub const SYS_recvmsg: ::c_long = 297; +pub const SYS_semop: ::c_long = 298; +pub const SYS_semget: ::c_long = 299; +pub const SYS_semctl: ::c_long = 300; +pub const SYS_msgsnd: ::c_long = 301; +pub const SYS_msgrcv: ::c_long = 302; +pub const SYS_msgget: ::c_long = 303; +pub const SYS_msgctl: ::c_long = 304; +pub const SYS_shmat: ::c_long = 305; +pub const SYS_shmdt: ::c_long = 306; +pub const SYS_shmget: ::c_long = 307; +pub const SYS_shmctl: ::c_long = 308; +pub const SYS_add_key: ::c_long = 309; +pub const SYS_request_key: ::c_long = 310; +pub const SYS_keyctl: ::c_long = 311; +pub const SYS_semtimedop: ::c_long = 312; +pub const SYS_vserver: ::c_long = 313; +pub const SYS_ioprio_set: ::c_long = 314; +pub const SYS_ioprio_get: ::c_long = 315; +pub const SYS_inotify_init: ::c_long = 316; +pub const SYS_inotify_add_watch: ::c_long = 317; +pub const SYS_inotify_rm_watch: ::c_long = 318; +pub const SYS_mbind: ::c_long = 319; +pub const SYS_get_mempolicy: ::c_long = 320; +pub const SYS_set_mempolicy: ::c_long = 321; +pub const SYS_openat: ::c_long = 322; +pub const SYS_mkdirat: ::c_long = 323; +pub const SYS_mknodat: ::c_long = 324; +pub const SYS_fchownat: ::c_long = 325; +pub const SYS_futimesat: ::c_long = 326; +pub const SYS_fstatat64: ::c_long = 327; +pub const SYS_unlinkat: ::c_long = 328; +pub const SYS_renameat: ::c_long = 329; +pub const SYS_linkat: ::c_long = 330; +pub const SYS_symlinkat: ::c_long = 331; +pub const SYS_readlinkat: ::c_long = 332; +pub const SYS_fchmodat: ::c_long = 333; +pub const SYS_faccessat: ::c_long = 334; +pub const SYS_pselect6: ::c_long = 335; +pub const SYS_ppoll: ::c_long = 336; +pub const SYS_unshare: ::c_long = 337; +pub const SYS_set_robust_list: ::c_long = 338; +pub const SYS_get_robust_list: ::c_long = 339; +pub const SYS_splice: ::c_long = 340; +pub const SYS_arm_sync_file_range: ::c_long = 341; +pub const SYS_tee: ::c_long = 342; +pub const SYS_vmsplice: ::c_long = 343; +pub const SYS_move_pages: ::c_long = 344; +pub const SYS_getcpu: ::c_long = 345; +pub const SYS_epoll_pwait: ::c_long = 346; +pub const SYS_kexec_load: ::c_long = 347; +pub const SYS_utimensat: ::c_long = 348; +pub const SYS_signalfd: ::c_long = 349; +pub const SYS_timerfd_create: ::c_long = 350; +pub const SYS_eventfd: ::c_long = 351; +pub const SYS_fallocate: ::c_long = 352; +pub const SYS_timerfd_settime: ::c_long = 353; +pub const SYS_timerfd_gettime: ::c_long = 354; +pub const SYS_signalfd4: ::c_long = 355; +pub const SYS_eventfd2: ::c_long = 356; +pub const SYS_epoll_create1: ::c_long = 357; +pub const SYS_dup3: ::c_long = 358; +pub const SYS_pipe2: ::c_long = 359; +pub const SYS_inotify_init1: ::c_long = 360; +pub const SYS_preadv: ::c_long = 361; +pub const SYS_pwritev: ::c_long = 362; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 363; +pub const SYS_perf_event_open: ::c_long = 364; +pub const SYS_recvmmsg: ::c_long = 365; +pub const SYS_accept4: ::c_long = 366; +pub const SYS_fanotify_init: ::c_long = 367; +pub const SYS_fanotify_mark: ::c_long = 368; +pub const SYS_prlimit64: ::c_long = 369; +pub const SYS_name_to_handle_at: ::c_long = 370; +pub const SYS_open_by_handle_at: ::c_long = 371; +pub const SYS_clock_adjtime: ::c_long = 372; +pub const SYS_syncfs: ::c_long = 373; +pub const SYS_sendmmsg: ::c_long = 374; +pub const SYS_setns: ::c_long = 375; +pub const SYS_process_vm_readv: ::c_long = 376; +pub const SYS_process_vm_writev: ::c_long = 377; +pub const SYS_kcmp: ::c_long = 378; +pub const SYS_finit_module: ::c_long = 379; +pub const SYS_sched_setattr: ::c_long = 380; +pub const SYS_sched_getattr: ::c_long = 381; +pub const SYS_renameat2: ::c_long = 382; +pub const SYS_seccomp: ::c_long = 383; +pub const SYS_getrandom: ::c_long = 384; +pub const SYS_memfd_create: ::c_long = 385; +pub const SYS_bpf: ::c_long = 386; +pub const SYS_execveat: ::c_long = 387; +pub const SYS_userfaultfd: ::c_long = 388; +pub const SYS_membarrier: ::c_long = 389; +pub const SYS_mlock2: ::c_long = 390; +pub const SYS_copy_file_range: ::c_long = 391; +pub const SYS_preadv2: ::c_long = 392; +pub const SYS_pwritev2: ::c_long = 393; +pub const SYS_pkey_mprotect: ::c_long = 394; +pub const SYS_pkey_alloc: ::c_long = 395; +pub const SYS_pkey_free: ::c_long = 396; +pub const SYS_statx: ::c_long = 397; +pub const SYS_rseq: ::c_long = 398; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..639394a309e3a1e95d1d8bb0b06255b908574af4 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(2))] + pub struct max_align_t { + priv_: [i8; 20] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..3b78f181cd19f1189be12048ad44de636a6a1ca2 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs @@ -0,0 +1,849 @@ +pub type c_char = i8; +pub type wchar_t = i32; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_ulong, + pub sa_restorer: ::Option, + } + + pub struct statfs { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + f_spare: [::__fsword_t; 4], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct ipc_perm { + __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + __seq: ::c_ushort, + __pad1: ::c_ushort, + __glibc_reserved1: ::c_ulong, + __glibc_reserved2: ::c_ulong, + } + + pub struct stat64 { + pub st_dev: ::dev_t, + __pad1: ::c_ushort, + pub __st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad2: ::c_ushort, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_ulong, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_ulong, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_ulong, + pub st_ino: ::ino64_t, + } + + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsblkcnt64_t, + pub f_ffree: ::fsblkcnt64_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsblkcnt64_t, + pub f_ffree: ::fsblkcnt64_t, + pub f_favail: ::fsblkcnt64_t, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + __glibc_reserved1: ::c_long, + pub shm_dtime: ::time_t, + __glibc_reserved2: ::c_long, + pub shm_ctime: ::time_t, + __glibc_reserved3: ::c_long, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __glibc_reserved5: ::c_ulong, + __glibc_reserved6: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + __glibc_reserved1: ::c_uint, + pub msg_rtime: ::time_t, + __glibc_reserved2: ::c_uint, + pub msg_ctime: ::time_t, + __glibc_reserved3: ::c_uint, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __glibc_reserved4: ::c_ulong, + __glibc_reserved5: ::c_ulong, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_code: ::c_int, + pub si_errno: ::c_int, + _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } +} + +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_LARGEFILE: ::c_int = 0x20000; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 0x101000; +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_NDELAY: ::c_int = 0x800; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_32BIT: ::c_int = 0x0040; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const EDEADLOCK: ::c_int = 35; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; + +pub const PTRACE_GETFPXREGS: ::c_uint = 18; +pub const PTRACE_SETFPXREGS: ::c_uint = 19; +pub const PTRACE_SYSEMU: ::c_uint = 31; +pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const EFD_NONBLOCK: ::c_int = 0x800; +pub const SFD_NONBLOCK: ::c_int = 0x0800; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = 31; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; +pub const EXTPROC: ::tcflag_t = 0x00010000; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_waitpid: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_time32: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_chown16: ::c_long = 16; +pub const SYS_stat: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_oldumount: ::c_long = 22; +pub const SYS_setuid16: ::c_long = 23; +pub const SYS_getuid16: ::c_long = 24; +pub const SYS_stime32: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_fstat: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime32: ::c_long = 30; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid16: ::c_long = 46; +pub const SYS_getgid16: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid16: ::c_long = 49; +pub const SYS_getegid16: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sgetmask: ::c_long = 68; +pub const SYS_ssetmask: ::c_long = 69; +pub const SYS_setreuid16: ::c_long = 70; +pub const SYS_setregid16: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_old_getrlimit: ::c_long = 76; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups16: ::c_long = 80; +pub const SYS_setgroups16: ::c_long = 81; +pub const SYS_old_select: ::c_long = 82; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_lstat: ::c_long = 84; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_old_readdir: ::c_long = 89; +pub const SYS_old_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown16: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_newstat: ::c_long = 106; +pub const SYS_newlstat: ::c_long = 107; +pub const SYS_newfstat: ::c_long = 108; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_newuname: ::c_long = 122; +pub const SYS_cacheflush: ::c_long = 123; +pub const SYS_adjtimex_time32: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_setfsuid16: ::c_long = 138; +pub const SYS_setfsgid16: ::c_long = 139; +pub const SYS_llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS_select: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval_time32: ::c_long = 161; +pub const SYS_nanosleep_time32: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid16: ::c_long = 164; +pub const SYS_getresuid16: ::c_long = 165; +pub const SYS_getpagesize: ::c_long = 166; +pub const SYS_query_module: ::c_long = 167; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid16: ::c_long = 170; +pub const SYS_getresgid16: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait_time32: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_lchown16: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_getpmsg: ::c_long = 188; +pub const SYS_putpmsg: ::c_long = 189; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_getrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_chown: ::c_long = 198; +pub const SYS_getuid: ::c_long = 199; +pub const SYS_getgid: ::c_long = 200; +pub const SYS_geteuid: ::c_long = 201; +pub const SYS_getegid: ::c_long = 202; +pub const SYS_setreuid: ::c_long = 203; +pub const SYS_setregid: ::c_long = 204; +pub const SYS_getgroups: ::c_long = 205; +pub const SYS_setgroups: ::c_long = 206; +pub const SYS_fchown: ::c_long = 207; +pub const SYS_setresuid: ::c_long = 208; +pub const SYS_getresuid: ::c_long = 209; +pub const SYS_setresgid: ::c_long = 210; +pub const SYS_getresgid: ::c_long = 211; +pub const SYS_lchown: ::c_long = 212; +pub const SYS_setuid: ::c_long = 213; +pub const SYS_setgid: ::c_long = 214; +pub const SYS_setfsuid: ::c_long = 215; +pub const SYS_setfsgid: ::c_long = 216; +pub const SYS_pivot_root: ::c_long = 217; +pub const SYS_getdents64: ::c_long = 220; +pub const SYS_gettid: ::c_long = 221; +pub const SYS_tkill: ::c_long = 222; +pub const SYS_setxattr: ::c_long = 223; +pub const SYS_lsetxattr: ::c_long = 224; +pub const SYS_fsetxattr: ::c_long = 225; +pub const SYS_getxattr: ::c_long = 226; +pub const SYS_lgetxattr: ::c_long = 227; +pub const SYS_fgetxattr: ::c_long = 228; +pub const SYS_listxattr: ::c_long = 229; +pub const SYS_llistxattr: ::c_long = 230; +pub const SYS_flistxattr: ::c_long = 231; +pub const SYS_removexattr: ::c_long = 232; +pub const SYS_lremovexattr: ::c_long = 233; +pub const SYS_fremovexattr: ::c_long = 234; +pub const SYS_futex_time32: ::c_long = 235; +pub const SYS_sendfile64: ::c_long = 236; +pub const SYS_mincore: ::c_long = 237; +pub const SYS_madvise: ::c_long = 238; +pub const SYS_fcntl64: ::c_long = 239; +pub const SYS_readahead: ::c_long = 240; +pub const SYS_io_setup: ::c_long = 241; +pub const SYS_io_destroy: ::c_long = 242; +pub const SYS_io_getevents_time32: ::c_long = 243; +pub const SYS_io_submit: ::c_long = 244; +pub const SYS_io_cancel: ::c_long = 245; +pub const SYS_fadvise64: ::c_long = 246; +pub const SYS_exit_group: ::c_long = 247; +pub const SYS_lookup_dcookie: ::c_long = 248; +pub const SYS_epoll_create: ::c_long = 249; +pub const SYS_epoll_ctl: ::c_long = 250; +pub const SYS_epoll_wait: ::c_long = 251; +pub const SYS_remap_file_pages: ::c_long = 252; +pub const SYS_set_tid_address: ::c_long = 253; +pub const SYS_timer_create: ::c_long = 254; +pub const SYS_timer_settime32: ::c_long = 255; +pub const SYS_timer_gettime32: ::c_long = 256; +pub const SYS_timer_getoverrun: ::c_long = 257; +pub const SYS_timer_delete: ::c_long = 258; +pub const SYS_clock_settime32: ::c_long = 259; +pub const SYS_clock_gettime32: ::c_long = 260; +pub const SYS_clock_getres_time32: ::c_long = 261; +pub const SYS_clock_nanosleep_time32: ::c_long = 262; +pub const SYS_statfs64: ::c_long = 263; +pub const SYS_fstatfs64: ::c_long = 264; +pub const SYS_tgkill: ::c_long = 265; +pub const SYS_utimes_time32: ::c_long = 266; +pub const SYS_fadvise64_64: ::c_long = 267; +pub const SYS_mbind: ::c_long = 268; +pub const SYS_get_mempolicy: ::c_long = 269; +pub const SYS_set_mempolicy: ::c_long = 270; +pub const SYS_mq_open: ::c_long = 271; +pub const SYS_mq_unlink: ::c_long = 272; +pub const SYS_mq_timedsend_time32: ::c_long = 273; +pub const SYS_mq_timedreceive_time32: ::c_long = 274; +pub const SYS_mq_notify: ::c_long = 275; +pub const SYS_mq_getsetattr: ::c_long = 276; +pub const SYS_waitid: ::c_long = 277; +pub const SYS_add_key: ::c_long = 279; +pub const SYS_request_key: ::c_long = 280; +pub const SYS_keyctl: ::c_long = 281; +pub const SYS_ioprio_set: ::c_long = 282; +pub const SYS_ioprio_get: ::c_long = 283; +pub const SYS_inotify_init: ::c_long = 284; +pub const SYS_inotify_add_watch: ::c_long = 285; +pub const SYS_inotify_rm_watch: ::c_long = 286; +pub const SYS_migrate_pages: ::c_long = 287; +pub const SYS_openat: ::c_long = 288; +pub const SYS_mkdirat: ::c_long = 289; +pub const SYS_mknodat: ::c_long = 290; +pub const SYS_fchownat: ::c_long = 291; +pub const SYS_futimesat_time32: ::c_long = 292; +pub const SYS_fstatat64: ::c_long = 293; +pub const SYS_unlinkat: ::c_long = 294; +pub const SYS_renameat: ::c_long = 295; +pub const SYS_linkat: ::c_long = 296; +pub const SYS_symlinkat: ::c_long = 297; +pub const SYS_readlinkat: ::c_long = 298; +pub const SYS_fchmodat: ::c_long = 299; +pub const SYS_faccessat: ::c_long = 300; +pub const SYS_pselect6_time32: ::c_long = 301; +pub const SYS_ppoll_time32: ::c_long = 302; +pub const SYS_unshare: ::c_long = 303; +pub const SYS_set_robust_list: ::c_long = 304; +pub const SYS_get_robust_list: ::c_long = 305; +pub const SYS_splice: ::c_long = 306; +pub const SYS_sync_file_range: ::c_long = 307; +pub const SYS_tee: ::c_long = 308; +pub const SYS_vmsplice: ::c_long = 309; +pub const SYS_move_pages: ::c_long = 310; +pub const SYS_sched_setaffinity: ::c_long = 311; +pub const SYS_sched_getaffinity: ::c_long = 312; +pub const SYS_kexec_load: ::c_long = 313; +pub const SYS_getcpu: ::c_long = 314; +pub const SYS_epoll_pwait: ::c_long = 315; +pub const SYS_utimensat_time32: ::c_long = 316; +pub const SYS_signalfd: ::c_long = 317; +pub const SYS_timerfd_create: ::c_long = 318; +pub const SYS_eventfd: ::c_long = 319; +pub const SYS_fallocate: ::c_long = 320; +pub const SYS_timerfd_settime32: ::c_long = 321; +pub const SYS_timerfd_gettime32: ::c_long = 322; +pub const SYS_signalfd4: ::c_long = 323; +pub const SYS_eventfd2: ::c_long = 324; +pub const SYS_epoll_create1: ::c_long = 325; +pub const SYS_dup3: ::c_long = 326; +pub const SYS_pipe2: ::c_long = 327; +pub const SYS_inotify_init1: ::c_long = 328; +pub const SYS_preadv: ::c_long = 329; +pub const SYS_pwritev: ::c_long = 330; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 331; +pub const SYS_perf_event_open: ::c_long = 332; +pub const SYS_get_thread_area: ::c_long = 333; +pub const SYS_set_thread_area: ::c_long = 334; +pub const SYS_atomic_cmpxchg_32: ::c_long = 335; +pub const SYS_atomic_barrier: ::c_long = 336; +pub const SYS_fanotify_init: ::c_long = 337; +pub const SYS_fanotify_mark: ::c_long = 338; +pub const SYS_prlimit64: ::c_long = 339; +pub const SYS_name_to_handle_at: ::c_long = 340; +pub const SYS_open_by_handle_at: ::c_long = 341; +pub const SYS_clock_adjtime32: ::c_long = 342; +pub const SYS_syncfs: ::c_long = 343; +pub const SYS_setns: ::c_long = 344; +pub const SYS_process_vm_readv: ::c_long = 345; +pub const SYS_process_vm_writev: ::c_long = 346; +pub const SYS_kcmp: ::c_long = 347; +pub const SYS_finit_module: ::c_long = 348; +pub const SYS_sched_setattr: ::c_long = 349; +pub const SYS_sched_getattr: ::c_long = 350; +pub const SYS_renameat2: ::c_long = 351; +pub const SYS_getrandom: ::c_long = 352; +pub const SYS_memfd_create: ::c_long = 353; +pub const SYS_bpf: ::c_long = 354; +pub const SYS_execveat: ::c_long = 355; +pub const SYS_socket: ::c_long = 356; +pub const SYS_socketpair: ::c_long = 357; +pub const SYS_bind: ::c_long = 358; +pub const SYS_connect: ::c_long = 359; +pub const SYS_listen: ::c_long = 360; +pub const SYS_accept4: ::c_long = 361; +pub const SYS_getsockopt: ::c_long = 362; +pub const SYS_setsockopt: ::c_long = 363; +pub const SYS_getsockname: ::c_long = 364; +pub const SYS_getpeername: ::c_long = 365; +pub const SYS_sendto: ::c_long = 366; +pub const SYS_sendmsg: ::c_long = 367; +pub const SYS_recvfrom: ::c_long = 368; +pub const SYS_recvmsg: ::c_long = 369; +pub const SYS_shutdown: ::c_long = 370; +pub const SYS_recvmmsg_time32: ::c_long = 371; +pub const SYS_sendmmsg: ::c_long = 372; +pub const SYS_userfaultfd: ::c_long = 373; +pub const SYS_membarrier: ::c_long = 374; +pub const SYS_mlock2: ::c_long = 375; +pub const SYS_copy_file_range: ::c_long = 376; +pub const SYS_preadv2: ::c_long = 377; +pub const SYS_pwritev2: ::c_long = 378; +pub const SYS_statx: ::c_long = 379; +pub const SYS_seccomp: ::c_long = 380; +pub const SYS_pkey_mprotect: ::c_long = 381; +pub const SYS_pkey_alloc: ::c_long = 382; +pub const SYS_pkey_free: ::c_long = 383; +pub const SYS_rseq: ::c_long = 384; +pub const SYS_semget: ::c_long = 393; +pub const SYS_semctl: ::c_long = 394; +pub const SYS_shmget: ::c_long = 395; +pub const SYS_shmctl: ::c_long = 396; +pub const SYS_shmat: ::c_long = 397; +pub const SYS_shmdt: ::c_long = 398; +pub const SYS_msgget: ::c_long = 399; +pub const SYS_msgsnd: ::c_long = 400; +pub const SYS_msgrcv: ::c_long = 401; +pub const SYS_msgctl: ::c_long = 402; +pub const SYS_clock_gettime: ::c_long = 403; +pub const SYS_clock_settime: ::c_long = 404; +pub const SYS_clock_adjtime: ::c_long = 405; +pub const SYS_clock_getres: ::c_long = 406; +pub const SYS_clock_nanosleep: ::c_long = 407; +pub const SYS_timer_gettime: ::c_long = 408; +pub const SYS_timer_settime: ::c_long = 409; +pub const SYS_timerfd_gettime: ::c_long = 410; +pub const SYS_timerfd_settime: ::c_long = 411; +pub const SYS_utimensat: ::c_long = 412; +pub const SYS_pselect6: ::c_long = 413; +pub const SYS_ppoll: ::c_long = 414; +pub const SYS_io_pgetevents: ::c_long = 416; +pub const SYS_recvmmsg: ::c_long = 417; +pub const SYS_mq_timedsend: ::c_long = 418; +pub const SYS_mq_timedreceive: ::c_long = 419; +pub const SYS_semtimedop: ::c_long = 420; +pub const SYS_rt_sigtimedwait: ::c_long = 421; +pub const SYS_futex: ::c_long = 422; +pub const SYS_sched_rr_get_interval: ::c_long = 423; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; +pub const SYS_quotactl_fd: ::c_long = 443; +pub const SYS_landlock_create_ruleset: ::c_long = 444; +pub const SYS_landlock_add_rule: ::c_long = 445; +pub const SYS_landlock_restrict_self: ::c_long = 446; +pub const SYS_process_mrelease: ::c_long = 448; +pub const SYS_futex_waitv: ::c_long = 449; +pub const SYS_set_mempolicy_home_node: ::c_long = 450; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..8c228ebab72cec19c6359b5b51d508c21f4f9000 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(8))] + pub struct max_align_t { + priv_: [f32; 4] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..eb3886fbcd115ac1a79be8f2541f072f627b4325 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs @@ -0,0 +1,810 @@ +pub type c_char = i8; +pub type wchar_t = i32; + +s! { + pub struct stat64 { + pub st_dev: ::c_ulong, + st_pad1: [::c_long; 3], + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::c_ulong, + st_pad2: [::c_long; 2], + pub st_size: ::off64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + st_pad3: ::c_long, + pub st_blocks: ::blkcnt64_t, + st_pad5: [::c_long; 14], + } + + pub struct statfs { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_frsize: ::c_long, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_files: ::fsblkcnt_t, + pub f_ffree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::c_long, + f_spare: [::c_long; 6], + } + + pub struct statfs64 { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_frsize: ::c_long, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_bavail: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_long, + pub f_flags: ::c_long, + pub f_spare: [::c_long; 5], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct sigaction { + pub sa_flags: ::c_int, + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_restorer: ::Option, + _resv: [::c_int; 1], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_code: ::c_int, + pub si_errno: ::c_int, + pub _pad: [::c_int; 29], + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_uint, + pub __seq: ::c_ushort, + __pad1: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + #[cfg(target_endian = "big")] + __glibc_reserved1: ::c_ulong, + pub msg_stime: ::time_t, + #[cfg(target_endian = "little")] + __glibc_reserved1: ::c_ulong, + #[cfg(target_endian = "big")] + __glibc_reserved2: ::c_ulong, + pub msg_rtime: ::time_t, + #[cfg(target_endian = "little")] + __glibc_reserved2: ::c_ulong, + #[cfg(target_endian = "big")] + __glibc_reserved3: ::c_ulong, + pub msg_ctime: ::time_t, + #[cfg(target_endian = "little")] + __glibc_reserved3: ::c_ulong, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __glibc_reserved4: ::c_ulong, + __glibc_reserved5: ::c_ulong, + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_sysid: ::c_long, + pub l_pid: ::pid_t, + pad: [::c_long; 4], + } +} + +pub const O_LARGEFILE: ::c_int = 0x2000; + +pub const SYS_syscall: ::c_long = 4000 + 0; +pub const SYS_exit: ::c_long = 4000 + 1; +pub const SYS_fork: ::c_long = 4000 + 2; +pub const SYS_read: ::c_long = 4000 + 3; +pub const SYS_write: ::c_long = 4000 + 4; +pub const SYS_open: ::c_long = 4000 + 5; +pub const SYS_close: ::c_long = 4000 + 6; +pub const SYS_waitpid: ::c_long = 4000 + 7; +pub const SYS_creat: ::c_long = 4000 + 8; +pub const SYS_link: ::c_long = 4000 + 9; +pub const SYS_unlink: ::c_long = 4000 + 10; +pub const SYS_execve: ::c_long = 4000 + 11; +pub const SYS_chdir: ::c_long = 4000 + 12; +pub const SYS_time: ::c_long = 4000 + 13; +pub const SYS_mknod: ::c_long = 4000 + 14; +pub const SYS_chmod: ::c_long = 4000 + 15; +pub const SYS_lchown: ::c_long = 4000 + 16; +pub const SYS_break: ::c_long = 4000 + 17; +pub const SYS_lseek: ::c_long = 4000 + 19; +pub const SYS_getpid: ::c_long = 4000 + 20; +pub const SYS_mount: ::c_long = 4000 + 21; +pub const SYS_umount: ::c_long = 4000 + 22; +pub const SYS_setuid: ::c_long = 4000 + 23; +pub const SYS_getuid: ::c_long = 4000 + 24; +pub const SYS_stime: ::c_long = 4000 + 25; +pub const SYS_ptrace: ::c_long = 4000 + 26; +pub const SYS_alarm: ::c_long = 4000 + 27; +pub const SYS_pause: ::c_long = 4000 + 29; +pub const SYS_utime: ::c_long = 4000 + 30; +pub const SYS_stty: ::c_long = 4000 + 31; +pub const SYS_gtty: ::c_long = 4000 + 32; +pub const SYS_access: ::c_long = 4000 + 33; +pub const SYS_nice: ::c_long = 4000 + 34; +pub const SYS_ftime: ::c_long = 4000 + 35; +pub const SYS_sync: ::c_long = 4000 + 36; +pub const SYS_kill: ::c_long = 4000 + 37; +pub const SYS_rename: ::c_long = 4000 + 38; +pub const SYS_mkdir: ::c_long = 4000 + 39; +pub const SYS_rmdir: ::c_long = 4000 + 40; +pub const SYS_dup: ::c_long = 4000 + 41; +pub const SYS_pipe: ::c_long = 4000 + 42; +pub const SYS_times: ::c_long = 4000 + 43; +pub const SYS_prof: ::c_long = 4000 + 44; +pub const SYS_brk: ::c_long = 4000 + 45; +pub const SYS_setgid: ::c_long = 4000 + 46; +pub const SYS_getgid: ::c_long = 4000 + 47; +pub const SYS_signal: ::c_long = 4000 + 48; +pub const SYS_geteuid: ::c_long = 4000 + 49; +pub const SYS_getegid: ::c_long = 4000 + 50; +pub const SYS_acct: ::c_long = 4000 + 51; +pub const SYS_umount2: ::c_long = 4000 + 52; +pub const SYS_lock: ::c_long = 4000 + 53; +pub const SYS_ioctl: ::c_long = 4000 + 54; +pub const SYS_fcntl: ::c_long = 4000 + 55; +pub const SYS_mpx: ::c_long = 4000 + 56; +pub const SYS_setpgid: ::c_long = 4000 + 57; +pub const SYS_ulimit: ::c_long = 4000 + 58; +pub const SYS_umask: ::c_long = 4000 + 60; +pub const SYS_chroot: ::c_long = 4000 + 61; +pub const SYS_ustat: ::c_long = 4000 + 62; +pub const SYS_dup2: ::c_long = 4000 + 63; +pub const SYS_getppid: ::c_long = 4000 + 64; +pub const SYS_getpgrp: ::c_long = 4000 + 65; +pub const SYS_setsid: ::c_long = 4000 + 66; +pub const SYS_sigaction: ::c_long = 4000 + 67; +pub const SYS_sgetmask: ::c_long = 4000 + 68; +pub const SYS_ssetmask: ::c_long = 4000 + 69; +pub const SYS_setreuid: ::c_long = 4000 + 70; +pub const SYS_setregid: ::c_long = 4000 + 71; +pub const SYS_sigsuspend: ::c_long = 4000 + 72; +pub const SYS_sigpending: ::c_long = 4000 + 73; +pub const SYS_sethostname: ::c_long = 4000 + 74; +pub const SYS_setrlimit: ::c_long = 4000 + 75; +pub const SYS_getrlimit: ::c_long = 4000 + 76; +pub const SYS_getrusage: ::c_long = 4000 + 77; +pub const SYS_gettimeofday: ::c_long = 4000 + 78; +pub const SYS_settimeofday: ::c_long = 4000 + 79; +pub const SYS_getgroups: ::c_long = 4000 + 80; +pub const SYS_setgroups: ::c_long = 4000 + 81; +pub const SYS_symlink: ::c_long = 4000 + 83; +pub const SYS_readlink: ::c_long = 4000 + 85; +pub const SYS_uselib: ::c_long = 4000 + 86; +pub const SYS_swapon: ::c_long = 4000 + 87; +pub const SYS_reboot: ::c_long = 4000 + 88; +pub const SYS_readdir: ::c_long = 4000 + 89; +pub const SYS_mmap: ::c_long = 4000 + 90; +pub const SYS_munmap: ::c_long = 4000 + 91; +pub const SYS_truncate: ::c_long = 4000 + 92; +pub const SYS_ftruncate: ::c_long = 4000 + 93; +pub const SYS_fchmod: ::c_long = 4000 + 94; +pub const SYS_fchown: ::c_long = 4000 + 95; +pub const SYS_getpriority: ::c_long = 4000 + 96; +pub const SYS_setpriority: ::c_long = 4000 + 97; +pub const SYS_profil: ::c_long = 4000 + 98; +pub const SYS_statfs: ::c_long = 4000 + 99; +pub const SYS_fstatfs: ::c_long = 4000 + 100; +pub const SYS_ioperm: ::c_long = 4000 + 101; +pub const SYS_socketcall: ::c_long = 4000 + 102; +pub const SYS_syslog: ::c_long = 4000 + 103; +pub const SYS_setitimer: ::c_long = 4000 + 104; +pub const SYS_getitimer: ::c_long = 4000 + 105; +pub const SYS_stat: ::c_long = 4000 + 106; +pub const SYS_lstat: ::c_long = 4000 + 107; +pub const SYS_fstat: ::c_long = 4000 + 108; +pub const SYS_iopl: ::c_long = 4000 + 110; +pub const SYS_vhangup: ::c_long = 4000 + 111; +pub const SYS_idle: ::c_long = 4000 + 112; +pub const SYS_vm86: ::c_long = 4000 + 113; +pub const SYS_wait4: ::c_long = 4000 + 114; +pub const SYS_swapoff: ::c_long = 4000 + 115; +pub const SYS_sysinfo: ::c_long = 4000 + 116; +pub const SYS_ipc: ::c_long = 4000 + 117; +pub const SYS_fsync: ::c_long = 4000 + 118; +pub const SYS_sigreturn: ::c_long = 4000 + 119; +pub const SYS_clone: ::c_long = 4000 + 120; +pub const SYS_setdomainname: ::c_long = 4000 + 121; +pub const SYS_uname: ::c_long = 4000 + 122; +pub const SYS_modify_ldt: ::c_long = 4000 + 123; +pub const SYS_adjtimex: ::c_long = 4000 + 124; +pub const SYS_mprotect: ::c_long = 4000 + 125; +pub const SYS_sigprocmask: ::c_long = 4000 + 126; +pub const SYS_create_module: ::c_long = 4000 + 127; +pub const SYS_init_module: ::c_long = 4000 + 128; +pub const SYS_delete_module: ::c_long = 4000 + 129; +pub const SYS_get_kernel_syms: ::c_long = 4000 + 130; +pub const SYS_quotactl: ::c_long = 4000 + 131; +pub const SYS_getpgid: ::c_long = 4000 + 132; +pub const SYS_fchdir: ::c_long = 4000 + 133; +pub const SYS_bdflush: ::c_long = 4000 + 134; +pub const SYS_sysfs: ::c_long = 4000 + 135; +pub const SYS_personality: ::c_long = 4000 + 136; +pub const SYS_afs_syscall: ::c_long = 4000 + 137; +pub const SYS_setfsuid: ::c_long = 4000 + 138; +pub const SYS_setfsgid: ::c_long = 4000 + 139; +pub const SYS__llseek: ::c_long = 4000 + 140; +pub const SYS_getdents: ::c_long = 4000 + 141; +pub const SYS__newselect: ::c_long = 4000 + 142; +pub const SYS_flock: ::c_long = 4000 + 143; +pub const SYS_msync: ::c_long = 4000 + 144; +pub const SYS_readv: ::c_long = 4000 + 145; +pub const SYS_writev: ::c_long = 4000 + 146; +pub const SYS_cacheflush: ::c_long = 4000 + 147; +pub const SYS_cachectl: ::c_long = 4000 + 148; +pub const SYS_sysmips: ::c_long = 4000 + 149; +pub const SYS_getsid: ::c_long = 4000 + 151; +pub const SYS_fdatasync: ::c_long = 4000 + 152; +pub const SYS__sysctl: ::c_long = 4000 + 153; +pub const SYS_mlock: ::c_long = 4000 + 154; +pub const SYS_munlock: ::c_long = 4000 + 155; +pub const SYS_mlockall: ::c_long = 4000 + 156; +pub const SYS_munlockall: ::c_long = 4000 + 157; +pub const SYS_sched_setparam: ::c_long = 4000 + 158; +pub const SYS_sched_getparam: ::c_long = 4000 + 159; +pub const SYS_sched_setscheduler: ::c_long = 4000 + 160; +pub const SYS_sched_getscheduler: ::c_long = 4000 + 161; +pub const SYS_sched_yield: ::c_long = 4000 + 162; +pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163; +pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164; +pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165; +pub const SYS_nanosleep: ::c_long = 4000 + 166; +pub const SYS_mremap: ::c_long = 4000 + 167; +pub const SYS_accept: ::c_long = 4000 + 168; +pub const SYS_bind: ::c_long = 4000 + 169; +pub const SYS_connect: ::c_long = 4000 + 170; +pub const SYS_getpeername: ::c_long = 4000 + 171; +pub const SYS_getsockname: ::c_long = 4000 + 172; +pub const SYS_getsockopt: ::c_long = 4000 + 173; +pub const SYS_listen: ::c_long = 4000 + 174; +pub const SYS_recv: ::c_long = 4000 + 175; +pub const SYS_recvfrom: ::c_long = 4000 + 176; +pub const SYS_recvmsg: ::c_long = 4000 + 177; +pub const SYS_send: ::c_long = 4000 + 178; +pub const SYS_sendmsg: ::c_long = 4000 + 179; +pub const SYS_sendto: ::c_long = 4000 + 180; +pub const SYS_setsockopt: ::c_long = 4000 + 181; +pub const SYS_shutdown: ::c_long = 4000 + 182; +pub const SYS_socket: ::c_long = 4000 + 183; +pub const SYS_socketpair: ::c_long = 4000 + 184; +pub const SYS_setresuid: ::c_long = 4000 + 185; +pub const SYS_getresuid: ::c_long = 4000 + 186; +pub const SYS_query_module: ::c_long = 4000 + 187; +pub const SYS_poll: ::c_long = 4000 + 188; +pub const SYS_nfsservctl: ::c_long = 4000 + 189; +pub const SYS_setresgid: ::c_long = 4000 + 190; +pub const SYS_getresgid: ::c_long = 4000 + 191; +pub const SYS_prctl: ::c_long = 4000 + 192; +pub const SYS_rt_sigreturn: ::c_long = 4000 + 193; +pub const SYS_rt_sigaction: ::c_long = 4000 + 194; +pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195; +pub const SYS_rt_sigpending: ::c_long = 4000 + 196; +pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197; +pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198; +pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199; +pub const SYS_pread64: ::c_long = 4000 + 200; +pub const SYS_pwrite64: ::c_long = 4000 + 201; +pub const SYS_chown: ::c_long = 4000 + 202; +pub const SYS_getcwd: ::c_long = 4000 + 203; +pub const SYS_capget: ::c_long = 4000 + 204; +pub const SYS_capset: ::c_long = 4000 + 205; +pub const SYS_sigaltstack: ::c_long = 4000 + 206; +pub const SYS_sendfile: ::c_long = 4000 + 207; +pub const SYS_getpmsg: ::c_long = 4000 + 208; +pub const SYS_putpmsg: ::c_long = 4000 + 209; +pub const SYS_mmap2: ::c_long = 4000 + 210; +pub const SYS_truncate64: ::c_long = 4000 + 211; +pub const SYS_ftruncate64: ::c_long = 4000 + 212; +pub const SYS_stat64: ::c_long = 4000 + 213; +pub const SYS_lstat64: ::c_long = 4000 + 214; +pub const SYS_fstat64: ::c_long = 4000 + 215; +pub const SYS_pivot_root: ::c_long = 4000 + 216; +pub const SYS_mincore: ::c_long = 4000 + 217; +pub const SYS_madvise: ::c_long = 4000 + 218; +pub const SYS_getdents64: ::c_long = 4000 + 219; +pub const SYS_fcntl64: ::c_long = 4000 + 220; +pub const SYS_gettid: ::c_long = 4000 + 222; +pub const SYS_readahead: ::c_long = 4000 + 223; +pub const SYS_setxattr: ::c_long = 4000 + 224; +pub const SYS_lsetxattr: ::c_long = 4000 + 225; +pub const SYS_fsetxattr: ::c_long = 4000 + 226; +pub const SYS_getxattr: ::c_long = 4000 + 227; +pub const SYS_lgetxattr: ::c_long = 4000 + 228; +pub const SYS_fgetxattr: ::c_long = 4000 + 229; +pub const SYS_listxattr: ::c_long = 4000 + 230; +pub const SYS_llistxattr: ::c_long = 4000 + 231; +pub const SYS_flistxattr: ::c_long = 4000 + 232; +pub const SYS_removexattr: ::c_long = 4000 + 233; +pub const SYS_lremovexattr: ::c_long = 4000 + 234; +pub const SYS_fremovexattr: ::c_long = 4000 + 235; +pub const SYS_tkill: ::c_long = 4000 + 236; +pub const SYS_sendfile64: ::c_long = 4000 + 237; +pub const SYS_futex: ::c_long = 4000 + 238; +pub const SYS_sched_setaffinity: ::c_long = 4000 + 239; +pub const SYS_sched_getaffinity: ::c_long = 4000 + 240; +pub const SYS_io_setup: ::c_long = 4000 + 241; +pub const SYS_io_destroy: ::c_long = 4000 + 242; +pub const SYS_io_getevents: ::c_long = 4000 + 243; +pub const SYS_io_submit: ::c_long = 4000 + 244; +pub const SYS_io_cancel: ::c_long = 4000 + 245; +pub const SYS_exit_group: ::c_long = 4000 + 246; +pub const SYS_lookup_dcookie: ::c_long = 4000 + 247; +pub const SYS_epoll_create: ::c_long = 4000 + 248; +pub const SYS_epoll_ctl: ::c_long = 4000 + 249; +pub const SYS_epoll_wait: ::c_long = 4000 + 250; +pub const SYS_remap_file_pages: ::c_long = 4000 + 251; +pub const SYS_set_tid_address: ::c_long = 4000 + 252; +pub const SYS_restart_syscall: ::c_long = 4000 + 253; +pub const SYS_fadvise64: ::c_long = 4000 + 254; +pub const SYS_statfs64: ::c_long = 4000 + 255; +pub const SYS_fstatfs64: ::c_long = 4000 + 256; +pub const SYS_timer_create: ::c_long = 4000 + 257; +pub const SYS_timer_settime: ::c_long = 4000 + 258; +pub const SYS_timer_gettime: ::c_long = 4000 + 259; +pub const SYS_timer_getoverrun: ::c_long = 4000 + 260; +pub const SYS_timer_delete: ::c_long = 4000 + 261; +pub const SYS_clock_settime: ::c_long = 4000 + 262; +pub const SYS_clock_gettime: ::c_long = 4000 + 263; +pub const SYS_clock_getres: ::c_long = 4000 + 264; +pub const SYS_clock_nanosleep: ::c_long = 4000 + 265; +pub const SYS_tgkill: ::c_long = 4000 + 266; +pub const SYS_utimes: ::c_long = 4000 + 267; +pub const SYS_mbind: ::c_long = 4000 + 268; +pub const SYS_get_mempolicy: ::c_long = 4000 + 269; +pub const SYS_set_mempolicy: ::c_long = 4000 + 270; +pub const SYS_mq_open: ::c_long = 4000 + 271; +pub const SYS_mq_unlink: ::c_long = 4000 + 272; +pub const SYS_mq_timedsend: ::c_long = 4000 + 273; +pub const SYS_mq_timedreceive: ::c_long = 4000 + 274; +pub const SYS_mq_notify: ::c_long = 4000 + 275; +pub const SYS_mq_getsetattr: ::c_long = 4000 + 276; +pub const SYS_vserver: ::c_long = 4000 + 277; +pub const SYS_waitid: ::c_long = 4000 + 278; +/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */ +pub const SYS_add_key: ::c_long = 4000 + 280; +pub const SYS_request_key: ::c_long = 4000 + 281; +pub const SYS_keyctl: ::c_long = 4000 + 282; +pub const SYS_set_thread_area: ::c_long = 4000 + 283; +pub const SYS_inotify_init: ::c_long = 4000 + 284; +pub const SYS_inotify_add_watch: ::c_long = 4000 + 285; +pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286; +pub const SYS_migrate_pages: ::c_long = 4000 + 287; +pub const SYS_openat: ::c_long = 4000 + 288; +pub const SYS_mkdirat: ::c_long = 4000 + 289; +pub const SYS_mknodat: ::c_long = 4000 + 290; +pub const SYS_fchownat: ::c_long = 4000 + 291; +pub const SYS_futimesat: ::c_long = 4000 + 292; +pub const SYS_fstatat64: ::c_long = 4000 + 293; +pub const SYS_unlinkat: ::c_long = 4000 + 294; +pub const SYS_renameat: ::c_long = 4000 + 295; +pub const SYS_linkat: ::c_long = 4000 + 296; +pub const SYS_symlinkat: ::c_long = 4000 + 297; +pub const SYS_readlinkat: ::c_long = 4000 + 298; +pub const SYS_fchmodat: ::c_long = 4000 + 299; +pub const SYS_faccessat: ::c_long = 4000 + 300; +pub const SYS_pselect6: ::c_long = 4000 + 301; +pub const SYS_ppoll: ::c_long = 4000 + 302; +pub const SYS_unshare: ::c_long = 4000 + 303; +pub const SYS_splice: ::c_long = 4000 + 304; +pub const SYS_sync_file_range: ::c_long = 4000 + 305; +pub const SYS_tee: ::c_long = 4000 + 306; +pub const SYS_vmsplice: ::c_long = 4000 + 307; +pub const SYS_move_pages: ::c_long = 4000 + 308; +pub const SYS_set_robust_list: ::c_long = 4000 + 309; +pub const SYS_get_robust_list: ::c_long = 4000 + 310; +pub const SYS_kexec_load: ::c_long = 4000 + 311; +pub const SYS_getcpu: ::c_long = 4000 + 312; +pub const SYS_epoll_pwait: ::c_long = 4000 + 313; +pub const SYS_ioprio_set: ::c_long = 4000 + 314; +pub const SYS_ioprio_get: ::c_long = 4000 + 315; +pub const SYS_utimensat: ::c_long = 4000 + 316; +pub const SYS_signalfd: ::c_long = 4000 + 317; +pub const SYS_timerfd: ::c_long = 4000 + 318; +pub const SYS_eventfd: ::c_long = 4000 + 319; +pub const SYS_fallocate: ::c_long = 4000 + 320; +pub const SYS_timerfd_create: ::c_long = 4000 + 321; +pub const SYS_timerfd_gettime: ::c_long = 4000 + 322; +pub const SYS_timerfd_settime: ::c_long = 4000 + 323; +pub const SYS_signalfd4: ::c_long = 4000 + 324; +pub const SYS_eventfd2: ::c_long = 4000 + 325; +pub const SYS_epoll_create1: ::c_long = 4000 + 326; +pub const SYS_dup3: ::c_long = 4000 + 327; +pub const SYS_pipe2: ::c_long = 4000 + 328; +pub const SYS_inotify_init1: ::c_long = 4000 + 329; +pub const SYS_preadv: ::c_long = 4000 + 330; +pub const SYS_pwritev: ::c_long = 4000 + 331; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332; +pub const SYS_perf_event_open: ::c_long = 4000 + 333; +pub const SYS_accept4: ::c_long = 4000 + 334; +pub const SYS_recvmmsg: ::c_long = 4000 + 335; +pub const SYS_fanotify_init: ::c_long = 4000 + 336; +pub const SYS_fanotify_mark: ::c_long = 4000 + 337; +pub const SYS_prlimit64: ::c_long = 4000 + 338; +pub const SYS_name_to_handle_at: ::c_long = 4000 + 339; +pub const SYS_open_by_handle_at: ::c_long = 4000 + 340; +pub const SYS_clock_adjtime: ::c_long = 4000 + 341; +pub const SYS_syncfs: ::c_long = 4000 + 342; +pub const SYS_sendmmsg: ::c_long = 4000 + 343; +pub const SYS_setns: ::c_long = 4000 + 344; +pub const SYS_process_vm_readv: ::c_long = 4000 + 345; +pub const SYS_process_vm_writev: ::c_long = 4000 + 346; +pub const SYS_kcmp: ::c_long = 4000 + 347; +pub const SYS_finit_module: ::c_long = 4000 + 348; +pub const SYS_sched_setattr: ::c_long = 4000 + 349; +pub const SYS_sched_getattr: ::c_long = 4000 + 350; +pub const SYS_renameat2: ::c_long = 4000 + 351; +pub const SYS_seccomp: ::c_long = 4000 + 352; +pub const SYS_getrandom: ::c_long = 4000 + 353; +pub const SYS_memfd_create: ::c_long = 4000 + 354; +pub const SYS_bpf: ::c_long = 4000 + 355; +pub const SYS_execveat: ::c_long = 4000 + 356; +pub const SYS_userfaultfd: ::c_long = 4000 + 357; +pub const SYS_membarrier: ::c_long = 4000 + 358; +pub const SYS_mlock2: ::c_long = 4000 + 359; +pub const SYS_copy_file_range: ::c_long = 4000 + 360; +pub const SYS_preadv2: ::c_long = 4000 + 361; +pub const SYS_pwritev2: ::c_long = 4000 + 362; +pub const SYS_pkey_mprotect: ::c_long = 4000 + 363; +pub const SYS_pkey_alloc: ::c_long = 4000 + 364; +pub const SYS_pkey_free: ::c_long = 4000 + 365; +pub const SYS_statx: ::c_long = 4000 + 366; +pub const SYS_rseq: ::c_long = 4000 + 367; +pub const SYS_pidfd_send_signal: ::c_long = 4000 + 424; +pub const SYS_io_uring_setup: ::c_long = 4000 + 425; +pub const SYS_io_uring_enter: ::c_long = 4000 + 426; +pub const SYS_io_uring_register: ::c_long = 4000 + 427; +pub const SYS_open_tree: ::c_long = 4000 + 428; +pub const SYS_move_mount: ::c_long = 4000 + 429; +pub const SYS_fsopen: ::c_long = 4000 + 430; +pub const SYS_fsconfig: ::c_long = 4000 + 431; +pub const SYS_fsmount: ::c_long = 4000 + 432; +pub const SYS_fspick: ::c_long = 4000 + 433; +pub const SYS_pidfd_open: ::c_long = 4000 + 434; +pub const SYS_clone3: ::c_long = 4000 + 435; +pub const SYS_close_range: ::c_long = 4000 + 436; +pub const SYS_openat2: ::c_long = 4000 + 437; +pub const SYS_pidfd_getfd: ::c_long = 4000 + 438; +pub const SYS_faccessat2: ::c_long = 4000 + 439; +pub const SYS_process_madvise: ::c_long = 4000 + 440; +pub const SYS_epoll_pwait2: ::c_long = 4000 + 441; +pub const SYS_mount_setattr: ::c_long = 4000 + 442; + +pub const O_DIRECT: ::c_int = 0x8000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; + +pub const O_APPEND: ::c_int = 8; +pub const O_CREAT: ::c_int = 256; +pub const O_EXCL: ::c_int = 1024; +pub const O_NOCTTY: ::c_int = 2048; +pub const O_NONBLOCK: ::c_int = 128; +pub const O_SYNC: ::c_int = 0x4010; +pub const O_RSYNC: ::c_int = 0x4010; +pub const O_DSYNC: ::c_int = 0x10; +pub const O_FSYNC: ::c_int = 0x4010; +pub const O_ASYNC: ::c_int = 0x1000; +pub const O_NDELAY: ::c_int = 0x80; + +pub const EDEADLK: ::c_int = 45; +pub const ENAMETOOLONG: ::c_int = 78; +pub const ENOLCK: ::c_int = 46; +pub const ENOSYS: ::c_int = 89; +pub const ENOTEMPTY: ::c_int = 93; +pub const ELOOP: ::c_int = 90; +pub const ENOMSG: ::c_int = 35; +pub const EIDRM: ::c_int = 36; +pub const ECHRNG: ::c_int = 37; +pub const EL2NSYNC: ::c_int = 38; +pub const EL3HLT: ::c_int = 39; +pub const EL3RST: ::c_int = 40; +pub const ELNRNG: ::c_int = 41; +pub const EUNATCH: ::c_int = 42; +pub const ENOCSI: ::c_int = 43; +pub const EL2HLT: ::c_int = 44; +pub const EBADE: ::c_int = 50; +pub const EBADR: ::c_int = 51; +pub const EXFULL: ::c_int = 52; +pub const ENOANO: ::c_int = 53; +pub const EBADRQC: ::c_int = 54; +pub const EBADSLT: ::c_int = 55; +pub const EDEADLOCK: ::c_int = 56; +pub const EMULTIHOP: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 79; +pub const ENOTUNIQ: ::c_int = 80; +pub const EBADFD: ::c_int = 81; +pub const EBADMSG: ::c_int = 77; +pub const EREMCHG: ::c_int = 82; +pub const ELIBACC: ::c_int = 83; +pub const ELIBBAD: ::c_int = 84; +pub const ELIBSCN: ::c_int = 85; +pub const ELIBMAX: ::c_int = 86; +pub const ELIBEXEC: ::c_int = 87; +pub const EILSEQ: ::c_int = 88; +pub const ERESTART: ::c_int = 91; +pub const ESTRPIPE: ::c_int = 92; +pub const EUSERS: ::c_int = 94; +pub const ENOTSOCK: ::c_int = 95; +pub const EDESTADDRREQ: ::c_int = 96; +pub const EMSGSIZE: ::c_int = 97; +pub const EPROTOTYPE: ::c_int = 98; +pub const ENOPROTOOPT: ::c_int = 99; +pub const EPROTONOSUPPORT: ::c_int = 120; +pub const ESOCKTNOSUPPORT: ::c_int = 121; +pub const EOPNOTSUPP: ::c_int = 122; +pub const EPFNOSUPPORT: ::c_int = 123; +pub const EAFNOSUPPORT: ::c_int = 124; +pub const EADDRINUSE: ::c_int = 125; +pub const EADDRNOTAVAIL: ::c_int = 126; +pub const ENETDOWN: ::c_int = 127; +pub const ENETUNREACH: ::c_int = 128; +pub const ENETRESET: ::c_int = 129; +pub const ECONNABORTED: ::c_int = 130; +pub const ECONNRESET: ::c_int = 131; +pub const ENOBUFS: ::c_int = 132; +pub const EISCONN: ::c_int = 133; +pub const ENOTCONN: ::c_int = 134; +pub const ESHUTDOWN: ::c_int = 143; +pub const ETOOMANYREFS: ::c_int = 144; +pub const ETIMEDOUT: ::c_int = 145; +pub const ECONNREFUSED: ::c_int = 146; +pub const EHOSTDOWN: ::c_int = 147; +pub const EHOSTUNREACH: ::c_int = 148; +pub const EALREADY: ::c_int = 149; +pub const EINPROGRESS: ::c_int = 150; +pub const ESTALE: ::c_int = 151; +pub const EUCLEAN: ::c_int = 135; +pub const ENOTNAM: ::c_int = 137; +pub const ENAVAIL: ::c_int = 138; +pub const EISNAM: ::c_int = 139; +pub const EREMOTEIO: ::c_int = 140; +pub const EDQUOT: ::c_int = 1133; +pub const ENOMEDIUM: ::c_int = 159; +pub const EMEDIUMTYPE: ::c_int = 160; +pub const ECANCELED: ::c_int = 158; +pub const ENOKEY: ::c_int = 161; +pub const EKEYEXPIRED: ::c_int = 162; +pub const EKEYREVOKED: ::c_int = 163; +pub const EKEYREJECTED: ::c_int = 164; +pub const EOWNERDEAD: ::c_int = 165; +pub const ENOTRECOVERABLE: ::c_int = 166; +pub const ERFKILL: ::c_int = 167; + +pub const MAP_NORESERVE: ::c_int = 0x400; +pub const MAP_ANON: ::c_int = 0x800; +pub const MAP_ANONYMOUS: ::c_int = 0x800; +pub const MAP_GROWSDOWN: ::c_int = 0x1000; +pub const MAP_DENYWRITE: ::c_int = 0x2000; +pub const MAP_EXECUTABLE: ::c_int = 0x4000; +pub const MAP_LOCKED: ::c_int = 0x8000; +pub const MAP_POPULATE: ::c_int = 0x10000; +pub const MAP_NONBLOCK: ::c_int = 0x20000; +pub const MAP_STACK: ::c_int = 0x40000; + +pub const SOCK_STREAM: ::c_int = 2; +pub const SOCK_DGRAM: ::c_int = 1; + +pub const SA_SIGINFO: ::c_int = 0x00000008; +pub const SA_NOCLDWAIT: ::c_int = 0x00010000; + +pub const SIGCHLD: ::c_int = 18; +pub const SIGBUS: ::c_int = 10; +pub const SIGTTIN: ::c_int = 26; +pub const SIGTTOU: ::c_int = 27; +pub const SIGXCPU: ::c_int = 30; +pub const SIGXFSZ: ::c_int = 31; +pub const SIGVTALRM: ::c_int = 28; +pub const SIGPROF: ::c_int = 29; +pub const SIGWINCH: ::c_int = 20; +pub const SIGUSR1: ::c_int = 16; +pub const SIGUSR2: ::c_int = 17; +pub const SIGCONT: ::c_int = 25; +pub const SIGSTOP: ::c_int = 23; +pub const SIGTSTP: ::c_int = 24; +pub const SIGURG: ::c_int = 21; +pub const SIGIO: ::c_int = 22; +pub const SIGSYS: ::c_int = 12; +pub const SIGPOLL: ::c_int = 22; +pub const SIGPWR: ::c_int = 19; +pub const SIG_SETMASK: ::c_int = 3; +pub const SIG_BLOCK: ::c_int = 0x1; +pub const SIG_UNBLOCK: ::c_int = 0x2; + +pub const POLLWRNORM: ::c_short = 0x004; +pub const POLLWRBAND: ::c_short = 0x100; + +pub const VEOF: usize = 16; +pub const VEOL: usize = 17; +pub const VEOL2: usize = 6; +pub const VMIN: usize = 4; +pub const IEXTEN: ::tcflag_t = 0x00000100; +pub const TOSTOP: ::tcflag_t = 0x00008000; +pub const FLUSHO: ::tcflag_t = 0x00002000; +pub const EXTPROC: ::tcflag_t = 0o200000; +pub const TCSANOW: ::c_int = 0x540e; +pub const TCSADRAIN: ::c_int = 0x540f; +pub const TCSAFLUSH: ::c_int = 0x5410; + +pub const PTRACE_GETFPXREGS: ::c_uint = 18; +pub const PTRACE_SETFPXREGS: ::c_uint = 19; + +pub const MAP_HUGETLB: ::c_int = 0x080000; + +pub const EFD_NONBLOCK: ::c_int = 0x80; + +pub const F_GETLK: ::c_int = 14; +pub const F_GETOWN: ::c_int = 23; +pub const F_SETOWN: ::c_int = 24; + +pub const SFD_NONBLOCK: ::c_int = 0x80; + +pub const RTLD_DEEPBIND: ::c_int = 0x10; +pub const RTLD_GLOBAL: ::c_int = 0x4; +pub const RTLD_NOLOAD: ::c_int = 0x8; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const EHWPOISON: ::c_int = 168; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..ad0d64c51d5b461ee2e6013a735706cc30e90e1b --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs @@ -0,0 +1,356 @@ +//! 32-bit specific definitions for linux-like values + +use pthread_mutex_t; + +pub type c_long = i32; +pub type c_ulong = u32; +pub type clock_t = i32; + +pub type shmatt_t = ::c_ulong; +pub type msgqnum_t = ::c_ulong; +pub type msglen_t = ::c_ulong; +pub type nlink_t = u32; +pub type __u64 = ::c_ulonglong; +pub type __s64 = ::c_longlong; +pub type __fsword_t = i32; +pub type fsblkcnt64_t = u64; +pub type fsfilcnt64_t = u64; +pub type __syscall_ulong_t = ::c_ulong; + +cfg_if! { + if #[cfg(target_arch = "riscv32")] { + pub type time_t = i64; + pub type suseconds_t = i64; + pub type ino_t = u64; + pub type off_t = i64; + pub type blkcnt_t = i64; + pub type fsblkcnt_t = u64; + pub type fsfilcnt_t = u64; + pub type rlim_t = u64; + pub type blksize_t = i64; + } else { + pub type time_t = i32; + pub type suseconds_t = i32; + pub type ino_t = u32; + pub type off_t = i32; + pub type blkcnt_t = i32; + pub type fsblkcnt_t = ::c_ulong; + pub type fsfilcnt_t = ::c_ulong; + pub type rlim_t = c_ulong; + pub type blksize_t = i32; + } +} + +s! { + pub struct stat { + #[cfg(not(target_arch = "mips"))] + pub st_dev: ::dev_t, + #[cfg(target_arch = "mips")] + pub st_dev: ::c_ulong, + + #[cfg(not(target_arch = "mips"))] + __pad1: ::c_short, + #[cfg(target_arch = "mips")] + st_pad1: [::c_long; 3], + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + #[cfg(not(target_arch = "mips"))] + pub st_rdev: ::dev_t, + #[cfg(target_arch = "mips")] + pub st_rdev: ::c_ulong, + #[cfg(not(target_arch = "mips"))] + __pad2: ::c_short, + #[cfg(target_arch = "mips")] + st_pad2: [::c_long; 2], + pub st_size: ::off_t, + #[cfg(target_arch = "mips")] + st_pad3: ::c_long, + #[cfg(not(target_arch = "mips"))] + pub st_blksize: ::blksize_t, + #[cfg(not(target_arch = "mips"))] + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + #[cfg(not(target_arch = "mips"))] + __unused4: ::c_long, + #[cfg(not(target_arch = "mips"))] + __unused5: ::c_long, + #[cfg(target_arch = "mips")] + pub st_blksize: ::blksize_t, + #[cfg(target_arch = "mips")] + pub st_blocks: ::blkcnt_t, + #[cfg(target_arch = "mips")] + st_pad5: [::c_long; 14], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct pthread_attr_t { + __size: [u32; 9] + } + + pub struct sigset_t { + __val: [::c_ulong; 32], + } + + pub struct sysinfo { + pub uptime: ::c_long, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, + pub freeram: ::c_ulong, + pub sharedram: ::c_ulong, + pub bufferram: ::c_ulong, + pub totalswap: ::c_ulong, + pub freeswap: ::c_ulong, + pub procs: ::c_ushort, + #[deprecated( + since = "0.2.58", + note = "This padding field might become private in the future" + )] + pub pad: ::c_ushort, + pub totalhigh: ::c_ulong, + pub freehigh: ::c_ulong, + pub mem_unit: ::c_uint, + pub _f: [::c_char; 8], + } + + pub struct semid_ds { + pub sem_perm: ipc_perm, + #[cfg(target_arch = "powerpc")] + __reserved: ::__syscall_ulong_t, + pub sem_otime: ::time_t, + #[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))] + __reserved: ::__syscall_ulong_t, + #[cfg(target_arch = "powerpc")] + __reserved2: ::__syscall_ulong_t, + pub sem_ctime: ::time_t, + #[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))] + __reserved2: ::__syscall_ulong_t, + pub sem_nsems: ::__syscall_ulong_t, + __glibc_reserved3: ::__syscall_ulong_t, + __glibc_reserved4: ::__syscall_ulong_t, + } +} + +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; + +cfg_if! { + if #[cfg(target_arch = "sparc")] { + pub const O_NOATIME: ::c_int = 0x200000; + pub const O_PATH: ::c_int = 0x1000000; + pub const O_TMPFILE: ::c_int = 0x2000000 | O_DIRECTORY; + + pub const SA_ONSTACK: ::c_int = 1; + + pub const PTRACE_DETACH: ::c_uint = 11; + + pub const F_SETLK: ::c_int = 8; + pub const F_SETLKW: ::c_int = 9; + + pub const F_RDLCK: ::c_int = 1; + pub const F_WRLCK: ::c_int = 2; + pub const F_UNLCK: ::c_int = 3; + + pub const SFD_CLOEXEC: ::c_int = 0x400000; + + pub const NCCS: usize = 17; + + pub const O_TRUNC: ::c_int = 0x400; + pub const O_CLOEXEC: ::c_int = 0x400000; + + pub const EBFONT: ::c_int = 109; + pub const ENOSTR: ::c_int = 72; + pub const ENODATA: ::c_int = 111; + pub const ETIME: ::c_int = 73; + pub const ENOSR: ::c_int = 74; + pub const ENONET: ::c_int = 80; + pub const ENOPKG: ::c_int = 113; + pub const EREMOTE: ::c_int = 71; + pub const ENOLINK: ::c_int = 82; + pub const EADV: ::c_int = 83; + pub const ESRMNT: ::c_int = 84; + pub const ECOMM: ::c_int = 85; + pub const EPROTO: ::c_int = 86; + pub const EDOTDOT: ::c_int = 88; + + pub const SA_NODEFER: ::c_int = 0x20; + pub const SA_RESETHAND: ::c_int = 0x4; + pub const SA_RESTART: ::c_int = 0x2; + pub const SA_NOCLDSTOP: ::c_int = 0x00000008; + + pub const EPOLL_CLOEXEC: ::c_int = 0x400000; + + pub const EFD_CLOEXEC: ::c_int = 0x400000; + } else { + pub const O_NOATIME: ::c_int = 0o1000000; + pub const O_PATH: ::c_int = 0o10000000; + pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; + + pub const SA_ONSTACK: ::c_int = 0x08000000; + + pub const PTRACE_DETACH: ::c_uint = 17; + + pub const F_SETLK: ::c_int = 6; + pub const F_SETLKW: ::c_int = 7; + + pub const F_RDLCK: ::c_int = 0; + pub const F_WRLCK: ::c_int = 1; + pub const F_UNLCK: ::c_int = 2; + + pub const SFD_CLOEXEC: ::c_int = 0x080000; + + pub const NCCS: usize = 32; + + pub const O_TRUNC: ::c_int = 512; + pub const O_CLOEXEC: ::c_int = 0x80000; + pub const EBFONT: ::c_int = 59; + pub const ENOSTR: ::c_int = 60; + pub const ENODATA: ::c_int = 61; + pub const ETIME: ::c_int = 62; + pub const ENOSR: ::c_int = 63; + pub const ENONET: ::c_int = 64; + pub const ENOPKG: ::c_int = 65; + pub const EREMOTE: ::c_int = 66; + pub const ENOLINK: ::c_int = 67; + pub const EADV: ::c_int = 68; + pub const ESRMNT: ::c_int = 69; + pub const ECOMM: ::c_int = 70; + pub const EPROTO: ::c_int = 71; + pub const EDOTDOT: ::c_int = 73; + + pub const SA_NODEFER: ::c_int = 0x40000000; + pub const SA_RESETHAND: ::c_int = 0x80000000; + pub const SA_RESTART: ::c_int = 0x10000000; + pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + + pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + + pub const EFD_CLOEXEC: ::c_int = 0x80000; + } +} + +align_const! { + #[cfg(target_endian = "little")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, + 0, 0, 0, + ], + }; +} + +pub const PTRACE_GETFPREGS: ::c_uint = 14; +pub const PTRACE_SETFPREGS: ::c_uint = 15; +pub const PTRACE_GETREGS: ::c_uint = 12; +pub const PTRACE_SETREGS: ::c_uint = 13; + +extern "C" { + pub fn sysctl( + name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_arch = "x86")] { + mod x86; + pub use self::x86::*; + } else if #[cfg(target_arch = "arm")] { + mod arm; + pub use self::arm::*; + } else if #[cfg(target_arch = "mips")] { + mod mips; + pub use self::mips::*; + } else if #[cfg(target_arch = "m68k")] { + mod m68k; + pub use self::m68k::*; + } else if #[cfg(target_arch = "powerpc")] { + mod powerpc; + pub use self::powerpc::*; + } else if #[cfg(target_arch = "sparc")] { + mod sparc; + pub use self::sparc::*; + } else if #[cfg(target_arch = "riscv32")] { + mod riscv32; + pub use self::riscv32::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs new file mode 100644 index 0000000000000000000000000000000000000000..ad45c607f9e054283408cb59f80e5d7754e578bf --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs @@ -0,0 +1,816 @@ +pub type c_char = u8; +pub type wchar_t = i32; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct statfs { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + f_spare: [::__fsword_t; 5], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct ipc_perm { + __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + __seq: u32, + __pad1: u32, + __glibc_reserved1: u64, + __glibc_reserved2: u64, + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad2: ::c_ushort, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __glibc_reserved4: ::c_ulong, + __glibc_reserved5: ::c_ulong, + } + + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + __glibc_reserved1: ::c_uint, + pub shm_atime: ::time_t, + __glibc_reserved2: ::c_uint, + pub shm_dtime: ::time_t, + __glibc_reserved3: ::c_uint, + pub shm_ctime: ::time_t, + __glibc_reserved4: ::c_uint, + pub shm_segsz: ::size_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __glibc_reserved5: ::c_ulong, + __glibc_reserved6: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + __glibc_reserved1: ::c_uint, + pub msg_stime: ::time_t, + __glibc_reserved2: ::c_uint, + pub msg_rtime: ::time_t, + __glibc_reserved3: ::c_uint, + pub msg_ctime: ::time_t, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __glibc_reserved4: ::c_ulong, + __glibc_reserved5: ::c_ulong, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } +} + +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const O_DIRECT: ::c_int = 0x20000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_LARGEFILE: ::c_int = 0o200000; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 0x101000; +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_NDELAY: ::c_int = 0x800; +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_LOCKED: ::c_int = 0x00080; +pub const MAP_NORESERVE: ::c_int = 0x00040; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const EDEADLOCK: ::c_int = 58; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const MCL_CURRENT: ::c_int = 0x2000; +pub const MCL_FUTURE: ::c_int = 0x4000; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; + +pub const EFD_NONBLOCK: ::c_int = 0x800; +pub const SFD_NONBLOCK: ::c_int = 0x0800; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = 31; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGSTKSZ: ::size_t = 0x4000; +pub const MINSIGSTKSZ: ::size_t = 4096; +pub const CBAUD: ::tcflag_t = 0xff; +pub const TAB1: ::tcflag_t = 0x400; +pub const TAB2: ::tcflag_t = 0x800; +pub const TAB3: ::tcflag_t = 0xc00; +pub const CR1: ::tcflag_t = 0x1000; +pub const CR2: ::tcflag_t = 0x2000; +pub const CR3: ::tcflag_t = 0x3000; +pub const FF1: ::tcflag_t = 0x4000; +pub const BS1: ::tcflag_t = 0x8000; +pub const VT1: ::tcflag_t = 0x10000; +pub const VWERASE: usize = 0xa; +pub const VREPRINT: usize = 0xb; +pub const VSUSP: usize = 0xc; +pub const VSTART: usize = 0xd; +pub const VSTOP: usize = 0xe; +pub const VDISCARD: usize = 0x10; +pub const VTIME: usize = 0x7; +pub const IXON: ::tcflag_t = 0x200; +pub const IXOFF: ::tcflag_t = 0x400; +pub const ONLCR: ::tcflag_t = 0x2; +pub const CSIZE: ::tcflag_t = 0x300; +pub const CS6: ::tcflag_t = 0x100; +pub const CS7: ::tcflag_t = 0x200; +pub const CS8: ::tcflag_t = 0x300; +pub const CSTOPB: ::tcflag_t = 0x400; +pub const CREAD: ::tcflag_t = 0x800; +pub const PARENB: ::tcflag_t = 0x1000; +pub const PARODD: ::tcflag_t = 0x2000; +pub const HUPCL: ::tcflag_t = 0x4000; +pub const CLOCAL: ::tcflag_t = 0x8000; +pub const ECHOKE: ::tcflag_t = 0x1; +pub const ECHOE: ::tcflag_t = 0x2; +pub const ECHOK: ::tcflag_t = 0x4; +pub const ECHONL: ::tcflag_t = 0x10; +pub const ECHOPRT: ::tcflag_t = 0x20; +pub const ECHOCTL: ::tcflag_t = 0x40; +pub const ISIG: ::tcflag_t = 0x80; +pub const ICANON: ::tcflag_t = 0x100; +pub const PENDIN: ::tcflag_t = 0x20000000; +pub const NOFLSH: ::tcflag_t = 0x80000000; +pub const VSWTC: usize = 9; +pub const OLCUC: ::tcflag_t = 0o000004; +pub const NLDLY: ::tcflag_t = 0o001400; +pub const CRDLY: ::tcflag_t = 0o030000; +pub const TABDLY: ::tcflag_t = 0o006000; +pub const BSDLY: ::tcflag_t = 0o100000; +pub const FFDLY: ::tcflag_t = 0o040000; +pub const VTDLY: ::tcflag_t = 0o200000; +pub const XTABS: ::tcflag_t = 0o006000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const CBAUDEX: ::speed_t = 0o000020; +pub const B57600: ::speed_t = 0o0020; +pub const B115200: ::speed_t = 0o0021; +pub const B230400: ::speed_t = 0o0022; +pub const B460800: ::speed_t = 0o0023; +pub const B500000: ::speed_t = 0o0024; +pub const B576000: ::speed_t = 0o0025; +pub const B921600: ::speed_t = 0o0026; +pub const B1000000: ::speed_t = 0o0027; +pub const B1152000: ::speed_t = 0o0030; +pub const B1500000: ::speed_t = 0o0031; +pub const B2000000: ::speed_t = 0o0032; +pub const B2500000: ::speed_t = 0o0033; +pub const B3000000: ::speed_t = 0o0034; +pub const B3500000: ::speed_t = 0o0035; +pub const B4000000: ::speed_t = 0o0036; + +pub const VEOL: usize = 6; +pub const VEOL2: usize = 8; +pub const VMIN: usize = 5; +pub const IEXTEN: ::tcflag_t = 0x400; +pub const TOSTOP: ::tcflag_t = 0x400000; +pub const FLUSHO: ::tcflag_t = 0x800000; +pub const EXTPROC: ::tcflag_t = 0x10000000; + +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_waitpid: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_time: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_break: ::c_long = 17; +pub const SYS_oldstat: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_stime: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_oldfstat: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_stty: ::c_long = 31; +pub const SYS_gtty: ::c_long = 32; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_ftime: ::c_long = 35; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_prof: ::c_long = 44; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_lock: ::c_long = 53; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_mpx: ::c_long = 56; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_ulimit: ::c_long = 58; +pub const SYS_oldolduname: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sgetmask: ::c_long = 68; +pub const SYS_ssetmask: ::c_long = 69; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrlimit: ::c_long = 76; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_select: ::c_long = 82; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_oldlstat: ::c_long = 84; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_profil: ::c_long = 98; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_ioperm: ::c_long = 101; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_olduname: ::c_long = 109; +pub const SYS_iopl: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_vm86: ::c_long = 113; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_modify_ldt: ::c_long = 123; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */ +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_query_module: ::c_long = 166; +pub const SYS_poll: ::c_long = 167; +pub const SYS_nfsservctl: ::c_long = 168; +pub const SYS_setresgid: ::c_long = 169; +pub const SYS_getresgid: ::c_long = 170; +pub const SYS_prctl: ::c_long = 171; +pub const SYS_rt_sigreturn: ::c_long = 172; +pub const SYS_rt_sigaction: ::c_long = 173; +pub const SYS_rt_sigprocmask: ::c_long = 174; +pub const SYS_rt_sigpending: ::c_long = 175; +pub const SYS_rt_sigtimedwait: ::c_long = 176; +pub const SYS_rt_sigqueueinfo: ::c_long = 177; +pub const SYS_rt_sigsuspend: ::c_long = 178; +pub const SYS_pread64: ::c_long = 179; +pub const SYS_pwrite64: ::c_long = 180; +pub const SYS_chown: ::c_long = 181; +pub const SYS_getcwd: ::c_long = 182; +pub const SYS_capget: ::c_long = 183; +pub const SYS_capset: ::c_long = 184; +pub const SYS_sigaltstack: ::c_long = 185; +pub const SYS_sendfile: ::c_long = 186; +pub const SYS_getpmsg: ::c_long = 187; /* some people actually want streams */ +pub const SYS_putpmsg: ::c_long = 188; /* some people actually want streams */ +pub const SYS_vfork: ::c_long = 189; +pub const SYS_ugetrlimit: ::c_long = 190; /* SuS compliant getrlimit */ +pub const SYS_readahead: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_pciconfig_read: ::c_long = 198; +pub const SYS_pciconfig_write: ::c_long = 199; +pub const SYS_pciconfig_iobase: ::c_long = 200; +pub const SYS_multiplexer: ::c_long = 201; +pub const SYS_getdents64: ::c_long = 202; +pub const SYS_pivot_root: ::c_long = 203; +pub const SYS_fcntl64: ::c_long = 204; +pub const SYS_madvise: ::c_long = 205; +pub const SYS_mincore: ::c_long = 206; +pub const SYS_gettid: ::c_long = 207; +pub const SYS_tkill: ::c_long = 208; +pub const SYS_setxattr: ::c_long = 209; +pub const SYS_lsetxattr: ::c_long = 210; +pub const SYS_fsetxattr: ::c_long = 211; +pub const SYS_getxattr: ::c_long = 212; +pub const SYS_lgetxattr: ::c_long = 213; +pub const SYS_fgetxattr: ::c_long = 214; +pub const SYS_listxattr: ::c_long = 215; +pub const SYS_llistxattr: ::c_long = 216; +pub const SYS_flistxattr: ::c_long = 217; +pub const SYS_removexattr: ::c_long = 218; +pub const SYS_lremovexattr: ::c_long = 219; +pub const SYS_fremovexattr: ::c_long = 220; +pub const SYS_futex: ::c_long = 221; +pub const SYS_sched_setaffinity: ::c_long = 222; +pub const SYS_sched_getaffinity: ::c_long = 223; +pub const SYS_tuxcall: ::c_long = 225; +pub const SYS_sendfile64: ::c_long = 226; +pub const SYS_io_setup: ::c_long = 227; +pub const SYS_io_destroy: ::c_long = 228; +pub const SYS_io_getevents: ::c_long = 229; +pub const SYS_io_submit: ::c_long = 230; +pub const SYS_io_cancel: ::c_long = 231; +pub const SYS_set_tid_address: ::c_long = 232; +pub const SYS_fadvise64: ::c_long = 233; +pub const SYS_exit_group: ::c_long = 234; +pub const SYS_lookup_dcookie: ::c_long = 235; +pub const SYS_epoll_create: ::c_long = 236; +pub const SYS_epoll_ctl: ::c_long = 237; +pub const SYS_epoll_wait: ::c_long = 238; +pub const SYS_remap_file_pages: ::c_long = 239; +pub const SYS_timer_create: ::c_long = 240; +pub const SYS_timer_settime: ::c_long = 241; +pub const SYS_timer_gettime: ::c_long = 242; +pub const SYS_timer_getoverrun: ::c_long = 243; +pub const SYS_timer_delete: ::c_long = 244; +pub const SYS_clock_settime: ::c_long = 245; +pub const SYS_clock_gettime: ::c_long = 246; +pub const SYS_clock_getres: ::c_long = 247; +pub const SYS_clock_nanosleep: ::c_long = 248; +pub const SYS_swapcontext: ::c_long = 249; +pub const SYS_tgkill: ::c_long = 250; +pub const SYS_utimes: ::c_long = 251; +pub const SYS_statfs64: ::c_long = 252; +pub const SYS_fstatfs64: ::c_long = 253; +pub const SYS_fadvise64_64: ::c_long = 254; +pub const SYS_rtas: ::c_long = 255; +pub const SYS_sys_debug_setcontext: ::c_long = 256; +pub const SYS_migrate_pages: ::c_long = 258; +pub const SYS_mbind: ::c_long = 259; +pub const SYS_get_mempolicy: ::c_long = 260; +pub const SYS_set_mempolicy: ::c_long = 261; +pub const SYS_mq_open: ::c_long = 262; +pub const SYS_mq_unlink: ::c_long = 263; +pub const SYS_mq_timedsend: ::c_long = 264; +pub const SYS_mq_timedreceive: ::c_long = 265; +pub const SYS_mq_notify: ::c_long = 266; +pub const SYS_mq_getsetattr: ::c_long = 267; +pub const SYS_kexec_load: ::c_long = 268; +pub const SYS_add_key: ::c_long = 269; +pub const SYS_request_key: ::c_long = 270; +pub const SYS_keyctl: ::c_long = 271; +pub const SYS_waitid: ::c_long = 272; +pub const SYS_ioprio_set: ::c_long = 273; +pub const SYS_ioprio_get: ::c_long = 274; +pub const SYS_inotify_init: ::c_long = 275; +pub const SYS_inotify_add_watch: ::c_long = 276; +pub const SYS_inotify_rm_watch: ::c_long = 277; +pub const SYS_spu_run: ::c_long = 278; +pub const SYS_spu_create: ::c_long = 279; +pub const SYS_pselect6: ::c_long = 280; +pub const SYS_ppoll: ::c_long = 281; +pub const SYS_unshare: ::c_long = 282; +pub const SYS_splice: ::c_long = 283; +pub const SYS_tee: ::c_long = 284; +pub const SYS_vmsplice: ::c_long = 285; +pub const SYS_openat: ::c_long = 286; +pub const SYS_mkdirat: ::c_long = 287; +pub const SYS_mknodat: ::c_long = 288; +pub const SYS_fchownat: ::c_long = 289; +pub const SYS_futimesat: ::c_long = 290; +pub const SYS_fstatat64: ::c_long = 291; +pub const SYS_unlinkat: ::c_long = 292; +pub const SYS_renameat: ::c_long = 293; +pub const SYS_linkat: ::c_long = 294; +pub const SYS_symlinkat: ::c_long = 295; +pub const SYS_readlinkat: ::c_long = 296; +pub const SYS_fchmodat: ::c_long = 297; +pub const SYS_faccessat: ::c_long = 298; +pub const SYS_get_robust_list: ::c_long = 299; +pub const SYS_set_robust_list: ::c_long = 300; +pub const SYS_move_pages: ::c_long = 301; +pub const SYS_getcpu: ::c_long = 302; +pub const SYS_epoll_pwait: ::c_long = 303; +pub const SYS_utimensat: ::c_long = 304; +pub const SYS_signalfd: ::c_long = 305; +pub const SYS_timerfd_create: ::c_long = 306; +pub const SYS_eventfd: ::c_long = 307; +pub const SYS_sync_file_range2: ::c_long = 308; +pub const SYS_fallocate: ::c_long = 309; +pub const SYS_subpage_prot: ::c_long = 310; +pub const SYS_timerfd_settime: ::c_long = 311; +pub const SYS_timerfd_gettime: ::c_long = 312; +pub const SYS_signalfd4: ::c_long = 313; +pub const SYS_eventfd2: ::c_long = 314; +pub const SYS_epoll_create1: ::c_long = 315; +pub const SYS_dup3: ::c_long = 316; +pub const SYS_pipe2: ::c_long = 317; +pub const SYS_inotify_init1: ::c_long = 318; +pub const SYS_perf_event_open: ::c_long = 319; +pub const SYS_preadv: ::c_long = 320; +pub const SYS_pwritev: ::c_long = 321; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 322; +pub const SYS_fanotify_init: ::c_long = 323; +pub const SYS_fanotify_mark: ::c_long = 324; +pub const SYS_prlimit64: ::c_long = 325; +pub const SYS_socket: ::c_long = 326; +pub const SYS_bind: ::c_long = 327; +pub const SYS_connect: ::c_long = 328; +pub const SYS_listen: ::c_long = 329; +pub const SYS_accept: ::c_long = 330; +pub const SYS_getsockname: ::c_long = 331; +pub const SYS_getpeername: ::c_long = 332; +pub const SYS_socketpair: ::c_long = 333; +pub const SYS_send: ::c_long = 334; +pub const SYS_sendto: ::c_long = 335; +pub const SYS_recv: ::c_long = 336; +pub const SYS_recvfrom: ::c_long = 337; +pub const SYS_shutdown: ::c_long = 338; +pub const SYS_setsockopt: ::c_long = 339; +pub const SYS_getsockopt: ::c_long = 340; +pub const SYS_sendmsg: ::c_long = 341; +pub const SYS_recvmsg: ::c_long = 342; +pub const SYS_recvmmsg: ::c_long = 343; +pub const SYS_accept4: ::c_long = 344; +pub const SYS_name_to_handle_at: ::c_long = 345; +pub const SYS_open_by_handle_at: ::c_long = 346; +pub const SYS_clock_adjtime: ::c_long = 347; +pub const SYS_syncfs: ::c_long = 348; +pub const SYS_sendmmsg: ::c_long = 349; +pub const SYS_setns: ::c_long = 350; +pub const SYS_process_vm_readv: ::c_long = 351; +pub const SYS_process_vm_writev: ::c_long = 352; +pub const SYS_finit_module: ::c_long = 353; +pub const SYS_kcmp: ::c_long = 354; +pub const SYS_sched_setattr: ::c_long = 355; +pub const SYS_sched_getattr: ::c_long = 356; +pub const SYS_renameat2: ::c_long = 357; +pub const SYS_seccomp: ::c_long = 358; +pub const SYS_getrandom: ::c_long = 359; +pub const SYS_memfd_create: ::c_long = 360; +pub const SYS_bpf: ::c_long = 361; +pub const SYS_execveat: ::c_long = 362; +pub const SYS_switch_endian: ::c_long = 363; +pub const SYS_userfaultfd: ::c_long = 364; +pub const SYS_membarrier: ::c_long = 365; +pub const SYS_mlock2: ::c_long = 378; +pub const SYS_copy_file_range: ::c_long = 379; +pub const SYS_preadv2: ::c_long = 380; +pub const SYS_pwritev2: ::c_long = 381; +pub const SYS_kexec_file_load: ::c_long = 382; +pub const SYS_statx: ::c_long = 383; +pub const SYS_rseq: ::c_long = 387; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..48d152a5721ec7ee762b70b5c4989e6bcc3ad9cf --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/align.rs @@ -0,0 +1,44 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + pub struct ucontext_t { + pub __uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: mcontext_t, + } + + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct mcontext_t { + pub __gregs: [::c_ulong; 32], + pub __fpregs: __riscv_mc_fp_state, + } + + #[allow(missing_debug_implementations)] + pub union __riscv_mc_fp_state { + pub __f: __riscv_mc_f_ext_state, + pub __d: __riscv_mc_d_ext_state, + pub __q: __riscv_mc_q_ext_state, + } + + #[allow(missing_debug_implementations)] + pub struct __riscv_mc_f_ext_state { + pub __f: [::c_uint; 32], + pub __fcsr: ::c_uint, + } + + #[allow(missing_debug_implementations)] + pub struct __riscv_mc_d_ext_state { + pub __f: [::c_ulonglong; 32], + pub __fcsr: ::c_uint, + } + + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct __riscv_mc_q_ext_state { + pub __f: [::c_ulonglong; 64], + pub __fcsr: ::c_uint, + pub __glibc_reserved: [::c_uint; 3], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..def90d6d1947a8d4883cf6dc7a996b4b0ef09956 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs @@ -0,0 +1,767 @@ +//! RISC-V-specific definitions for 32-bit linux-like values + +pub type c_char = u8; +pub type wchar_t = ::c_int; + +s! { + pub struct pthread_attr_t { + __size: [::c_ulong; 7], + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + pub msg_rtime: ::time_t, + pub msg_ctime: ::time_t, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __glibc_reserved4: ::c_ulong, + __glibc_reserved5: ::c_ulong, + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub __pad1: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub __pad2: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2usize], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub __pad1: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub __pad2: ::c_int, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2], + } + + pub struct statfs { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_long, + pub f_frsize: ::c_long, + pub f_flags: ::c_long, + pub f_spare: [::c_long; 4], + } + + pub struct statfs64 { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsfilcnt64_t, + pub f_ffree: ::fsfilcnt64_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_long, + pub f_frsize: ::c_long, + pub f_flags: ::c_long, + pub f_spare: [::c_long; 4], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + pub __f_spare: [::c_int; 6], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsfilcnt64_t, + pub f_ffree: ::fsfilcnt64_t, + pub f_favail: ::fsfilcnt64_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + pub __f_spare: [::c_int; 6], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [u64; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t, + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_ushort, + __pad1: ::c_ushort, + pub __seq: ::c_ushort, + __pad2: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused5: ::c_ulong, + __unused6: ::c_ulong, + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } +} + +pub const O_LARGEFILE: ::c_int = 0; +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 1052672; +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_GROWSDOWN: ::c_int = 256; +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SA_SIGINFO: ::c_int = 4; +pub const SA_NOCLDWAIT: ::c_int = 2; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0; +pub const SIG_UNBLOCK: ::c_int = 1; +pub const POLLWRNORM: ::c_short = 256; +pub const POLLWRBAND: ::c_short = 512; +pub const O_ASYNC: ::c_int = 8192; +pub const O_NDELAY: ::c_int = 2048; +pub const EFD_NONBLOCK: ::c_int = 2048; +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; +pub const SFD_NONBLOCK: ::c_int = 2048; +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const O_DIRECT: ::c_int = 16384; +pub const O_DIRECTORY: ::c_int = 65536; +pub const O_NOFOLLOW: ::c_int = 131072; +pub const MAP_HUGETLB: ::c_int = 262144; +pub const MAP_LOCKED: ::c_int = 8192; +pub const MAP_NORESERVE: ::c_int = 16384; +pub const MAP_ANON: ::c_int = 32; +pub const MAP_ANONYMOUS: ::c_int = 32; +pub const MAP_DENYWRITE: ::c_int = 2048; +pub const MAP_EXECUTABLE: ::c_int = 4096; +pub const MAP_POPULATE: ::c_int = 32768; +pub const MAP_NONBLOCK: ::c_int = 65536; +pub const MAP_STACK: ::c_int = 131072; +pub const MAP_SYNC: ::c_int = 0x080000; +pub const EDEADLOCK: ::c_int = 35; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const MCL_CURRENT: ::c_int = 1; +pub const MCL_FUTURE: ::c_int = 2; +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 4111; +pub const TAB1: ::tcflag_t = 2048; +pub const TAB2: ::tcflag_t = 4096; +pub const TAB3: ::tcflag_t = 6144; +pub const CR1: ::tcflag_t = 512; +pub const CR2: ::tcflag_t = 1024; +pub const CR3: ::tcflag_t = 1536; +pub const FF1: ::tcflag_t = 32768; +pub const BS1: ::tcflag_t = 8192; +pub const VT1: ::tcflag_t = 16384; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 1024; +pub const IXOFF: ::tcflag_t = 4096; +pub const ONLCR: ::tcflag_t = 4; +pub const CSIZE: ::tcflag_t = 48; +pub const CS6: ::tcflag_t = 16; +pub const CS7: ::tcflag_t = 32; +pub const CS8: ::tcflag_t = 48; +pub const CSTOPB: ::tcflag_t = 64; +pub const CREAD: ::tcflag_t = 128; +pub const PARENB: ::tcflag_t = 256; +pub const PARODD: ::tcflag_t = 512; +pub const HUPCL: ::tcflag_t = 1024; +pub const CLOCAL: ::tcflag_t = 2048; +pub const ECHOKE: ::tcflag_t = 2048; +pub const ECHOE: ::tcflag_t = 16; +pub const ECHOK: ::tcflag_t = 32; +pub const ECHONL: ::tcflag_t = 64; +pub const ECHOPRT: ::tcflag_t = 1024; +pub const ECHOCTL: ::tcflag_t = 512; +pub const ISIG: ::tcflag_t = 1; +pub const ICANON: ::tcflag_t = 2; +pub const PENDIN: ::tcflag_t = 16384; +pub const NOFLSH: ::tcflag_t = 128; +pub const CIBAUD: ::tcflag_t = 269418496; +pub const CBAUDEX: ::tcflag_t = 4096; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 2; +pub const NLDLY: ::tcflag_t = 256; +pub const CRDLY: ::tcflag_t = 1536; +pub const TABDLY: ::tcflag_t = 6144; +pub const BSDLY: ::tcflag_t = 8192; +pub const FFDLY: ::tcflag_t = 32768; +pub const VTDLY: ::tcflag_t = 16384; +pub const XTABS: ::tcflag_t = 6144; +pub const B0: ::speed_t = 0; +pub const B50: ::speed_t = 1; +pub const B75: ::speed_t = 2; +pub const B110: ::speed_t = 3; +pub const B134: ::speed_t = 4; +pub const B150: ::speed_t = 5; +pub const B200: ::speed_t = 6; +pub const B300: ::speed_t = 7; +pub const B600: ::speed_t = 8; +pub const B1200: ::speed_t = 9; +pub const B1800: ::speed_t = 10; +pub const B2400: ::speed_t = 11; +pub const B4800: ::speed_t = 12; +pub const B9600: ::speed_t = 13; +pub const B19200: ::speed_t = 14; +pub const B38400: ::speed_t = 15; +pub const EXTA: ::speed_t = 14; +pub const EXTB: ::speed_t = 15; +pub const B57600: ::speed_t = 4097; +pub const B115200: ::speed_t = 4098; +pub const B230400: ::speed_t = 4099; +pub const B460800: ::speed_t = 4100; +pub const B500000: ::speed_t = 4101; +pub const B576000: ::speed_t = 4102; +pub const B921600: ::speed_t = 4103; +pub const B1000000: ::speed_t = 4104; +pub const B1152000: ::speed_t = 4105; +pub const B1500000: ::speed_t = 4106; +pub const B2000000: ::speed_t = 4107; +pub const B2500000: ::speed_t = 4108; +pub const B3000000: ::speed_t = 4109; +pub const B3500000: ::speed_t = 4110; +pub const B4000000: ::speed_t = 4111; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 32768; +pub const TOSTOP: ::tcflag_t = 256; +pub const FLUSHO: ::tcflag_t = 4096; +pub const EXTPROC: ::tcflag_t = 65536; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; +pub const NGREG: usize = 32; +pub const REG_PC: usize = 0; +pub const REG_RA: usize = 1; +pub const REG_SP: usize = 2; +pub const REG_TP: usize = 4; +pub const REG_S0: usize = 8; +pub const REG_S1: usize = 9; +pub const REG_A0: usize = 10; +pub const REG_S2: usize = 18; +pub const REG_NARGS: usize = 8; + +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_close: ::c_long = 57; +pub const SYS_fstat: ::c_long = 80; +pub const SYS_lseek: ::c_long = 62; +pub const SYS_mmap: ::c_long = 222; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_brk: ::c_long = 214; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_dup: ::c_long = 23; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_sendfile: ::c_long = 71; +pub const SYS_socket: ::c_long = 198; +pub const SYS_connect: ::c_long = 203; +pub const SYS_accept: ::c_long = 202; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_exit: ::c_long = 93; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_kill: ::c_long = 129; +pub const SYS_uname: ::c_long = 160; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semop: ::c_long = 193; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_fcntl: ::c_long = 25; +pub const SYS_flock: ::c_long = 32; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_truncate: ::c_long = 45; +pub const SYS_ftruncate: ::c_long = 46; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_umask: ::c_long = 166; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_times: ::c_long = 153; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getegid: ::c_long = 177; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_personality: ::c_long = 92; +pub const SYS_statfs: ::c_long = 43; +pub const SYS_fstatfs: ::c_long = 44; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_sync: ::c_long = 81; +pub const SYS_acct: ::c_long = 89; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_mount: ::c_long = 40; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_gettid: ::c_long = 178; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_futex: ::c_long = 98; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_fadvise64: ::c_long = 223; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_openat: ::c_long = 56; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_newfstatat: ::c_long = 79; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; +pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_setns: ::c_long = 268; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; +pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_statx: ::c_long = 291; +pub const SYS_rseq: ::c_long = 293; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..98fda883cd37419f4d297defab5d1c2c6832ae9c --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(8))] + pub struct max_align_t { + priv_: [i64; 3] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..5dd2302dbfaaf01dd93f0c88f9ae4b8593c68a83 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs @@ -0,0 +1,848 @@ +//! SPARC-specific definitions for 32-bit linux-like values + +pub type c_char = i8; +pub type wchar_t = i32; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct statfs { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + f_spare: [::__fsword_t; 5], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + __reserved: ::c_short, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad2: ::c_ushort, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 2], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad2: ::c_ushort, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __reserved: [::c_long; 2], + } + + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + __pad1: ::c_ushort, + pub mode: ::c_ushort, + __pad2: ::c_ushort, + pub __seq: ::c_ushort, + __unused1: ::c_ulonglong, + __unused2: ::c_ulonglong, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + __pad1: ::c_uint, + pub shm_atime: ::time_t, + __pad2: ::c_uint, + pub shm_dtime: ::time_t, + __pad3: ::c_uint, + pub shm_ctime: ::time_t, + pub shm_segsz: ::size_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __reserved1: ::c_ulong, + __reserved2: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + __pad1: ::c_uint, + pub msg_stime: ::time_t, + __pad2: ::c_uint, + pub msg_rtime: ::time_t, + __pad3: ::c_uint, + pub msg_ctime: ::time_t, + __msg_cbytes: ::c_ushort, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __glibc_reserved1: ::c_ulong, + __glibc_reserved2: ::c_ulong, + } +} + +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; + +pub const O_APPEND: ::c_int = 0x8; +pub const O_CREAT: ::c_int = 0x200; +pub const O_EXCL: ::c_int = 0x800; +pub const O_NOCTTY: ::c_int = 0x8000; +pub const O_NONBLOCK: ::c_int = 0x4000; +pub const O_SYNC: ::c_int = 0x802000; +pub const O_RSYNC: ::c_int = 0x802000; +pub const O_DSYNC: ::c_int = 0x2000; +pub const O_FSYNC: ::c_int = 0x802000; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_GROWSDOWN: ::c_int = 0x0200; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const EDEADLK: ::c_int = 78; +pub const ENAMETOOLONG: ::c_int = 63; +pub const ENOLCK: ::c_int = 79; +pub const ENOSYS: ::c_int = 90; +pub const ENOTEMPTY: ::c_int = 66; +pub const ELOOP: ::c_int = 62; +pub const ENOMSG: ::c_int = 75; +pub const EIDRM: ::c_int = 77; +pub const ECHRNG: ::c_int = 94; +pub const EL2NSYNC: ::c_int = 95; +pub const EL3HLT: ::c_int = 96; +pub const EL3RST: ::c_int = 97; +pub const ELNRNG: ::c_int = 98; +pub const EUNATCH: ::c_int = 99; +pub const ENOCSI: ::c_int = 100; +pub const EL2HLT: ::c_int = 101; +pub const EBADE: ::c_int = 102; +pub const EBADR: ::c_int = 103; +pub const EXFULL: ::c_int = 104; +pub const ENOANO: ::c_int = 105; +pub const EBADRQC: ::c_int = 106; +pub const EBADSLT: ::c_int = 107; +pub const EMULTIHOP: ::c_int = 87; +pub const EOVERFLOW: ::c_int = 92; +pub const ENOTUNIQ: ::c_int = 115; +pub const EBADFD: ::c_int = 93; +pub const EBADMSG: ::c_int = 76; +pub const EREMCHG: ::c_int = 89; +pub const ELIBACC: ::c_int = 114; +pub const ELIBBAD: ::c_int = 112; +pub const ELIBSCN: ::c_int = 124; +pub const ELIBMAX: ::c_int = 123; +pub const ELIBEXEC: ::c_int = 110; +pub const EILSEQ: ::c_int = 122; +pub const ERESTART: ::c_int = 116; +pub const ESTRPIPE: ::c_int = 91; +pub const EUSERS: ::c_int = 68; +pub const ENOTSOCK: ::c_int = 38; +pub const EDESTADDRREQ: ::c_int = 39; +pub const EMSGSIZE: ::c_int = 40; +pub const EPROTOTYPE: ::c_int = 41; +pub const ENOPROTOOPT: ::c_int = 42; +pub const EPROTONOSUPPORT: ::c_int = 43; +pub const ESOCKTNOSUPPORT: ::c_int = 44; +pub const EOPNOTSUPP: ::c_int = 45; +pub const EPFNOSUPPORT: ::c_int = 46; +pub const EAFNOSUPPORT: ::c_int = 47; +pub const EADDRINUSE: ::c_int = 48; +pub const EADDRNOTAVAIL: ::c_int = 49; +pub const ENETDOWN: ::c_int = 50; +pub const ENETUNREACH: ::c_int = 51; +pub const ENETRESET: ::c_int = 52; +pub const ECONNABORTED: ::c_int = 53; +pub const ECONNRESET: ::c_int = 54; +pub const ENOBUFS: ::c_int = 55; +pub const EISCONN: ::c_int = 56; +pub const ENOTCONN: ::c_int = 57; +pub const ESHUTDOWN: ::c_int = 58; +pub const ETOOMANYREFS: ::c_int = 59; +pub const ETIMEDOUT: ::c_int = 60; +pub const ECONNREFUSED: ::c_int = 61; +pub const EHOSTDOWN: ::c_int = 64; +pub const EHOSTUNREACH: ::c_int = 65; +pub const EALREADY: ::c_int = 37; +pub const EINPROGRESS: ::c_int = 36; +pub const ESTALE: ::c_int = 70; +pub const EDQUOT: ::c_int = 69; +pub const ENOMEDIUM: ::c_int = 125; +pub const EMEDIUMTYPE: ::c_int = 126; +pub const ECANCELED: ::c_int = 127; +pub const ENOKEY: ::c_int = 128; +pub const EKEYEXPIRED: ::c_int = 129; +pub const EKEYREVOKED: ::c_int = 130; +pub const EKEYREJECTED: ::c_int = 131; +pub const EOWNERDEAD: ::c_int = 132; +pub const ENOTRECOVERABLE: ::c_int = 133; +pub const EHWPOISON: ::c_int = 135; +pub const ERFKILL: ::c_int = 134; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const SA_SIGINFO: ::c_int = 0x200; +pub const SA_NOCLDWAIT: ::c_int = 0x100; + +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGCHLD: ::c_int = 20; +pub const SIGBUS: ::c_int = 10; +pub const SIGUSR1: ::c_int = 30; +pub const SIGUSR2: ::c_int = 31; +pub const SIGCONT: ::c_int = 19; +pub const SIGSTOP: ::c_int = 17; +pub const SIGTSTP: ::c_int = 18; +pub const SIGURG: ::c_int = 16; +pub const SIGIO: ::c_int = 23; +pub const SIGSYS: ::c_int = 12; +pub const SIGPOLL: ::c_int = 23; +pub const SIGPWR: ::c_int = 29; +pub const SIG_SETMASK: ::c_int = 4; +pub const SIG_BLOCK: ::c_int = 1; +pub const SIG_UNBLOCK: ::c_int = 2; + +pub const POLLWRNORM: ::c_short = 4; +pub const POLLWRBAND: ::c_short = 0x100; + +pub const O_ASYNC: ::c_int = 0x40; +pub const O_NDELAY: ::c_int = 0x4004; + +pub const EFD_NONBLOCK: ::c_int = 0x4000; + +pub const F_GETLK: ::c_int = 7; +pub const F_GETOWN: ::c_int = 5; +pub const F_SETOWN: ::c_int = 6; + +pub const SFD_NONBLOCK: ::c_int = 0x4000; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const O_DIRECTORY: ::c_int = 0o200000; +pub const O_NOFOLLOW: ::c_int = 0o400000; +pub const O_LARGEFILE: ::c_int = 0x40000; +pub const O_DIRECT: ::c_int = 0x100000; + +pub const MAP_LOCKED: ::c_int = 0x0100; +pub const MAP_NORESERVE: ::c_int = 0x00040; + +pub const EDEADLOCK: ::c_int = 108; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; + +pub const MCL_CURRENT: ::c_int = 0x2000; +pub const MCL_FUTURE: ::c_int = 0x4000; + +pub const SIGSTKSZ: ::size_t = 16384; +pub const MINSIGSTKSZ: ::size_t = 4096; +pub const CBAUD: ::tcflag_t = 0x0000100f; +pub const TAB1: ::tcflag_t = 0x800; +pub const TAB2: ::tcflag_t = 0x1000; +pub const TAB3: ::tcflag_t = 0x1800; +pub const CR1: ::tcflag_t = 0x200; +pub const CR2: ::tcflag_t = 0x400; +pub const CR3: ::tcflag_t = 0x600; +pub const FF1: ::tcflag_t = 0x8000; +pub const BS1: ::tcflag_t = 0x2000; +pub const VT1: ::tcflag_t = 0x4000; +pub const VWERASE: usize = 0xe; +pub const VREPRINT: usize = 0xc; +pub const VSUSP: usize = 0xa; +pub const VSTART: usize = 0x8; +pub const VSTOP: usize = 0x9; +pub const VDISCARD: usize = 0xd; +pub const VTIME: usize = 0x5; +pub const IXON: ::tcflag_t = 0x400; +pub const IXOFF: ::tcflag_t = 0x1000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x30; +pub const CS6: ::tcflag_t = 0x10; +pub const CS7: ::tcflag_t = 0x20; +pub const CS8: ::tcflag_t = 0x30; +pub const CSTOPB: ::tcflag_t = 0x40; +pub const CREAD: ::tcflag_t = 0x80; +pub const PARENB: ::tcflag_t = 0x100; +pub const PARODD: ::tcflag_t = 0x200; +pub const HUPCL: ::tcflag_t = 0x400; +pub const CLOCAL: ::tcflag_t = 0x800; +pub const ECHOKE: ::tcflag_t = 0x800; +pub const ECHOE: ::tcflag_t = 0x10; +pub const ECHOK: ::tcflag_t = 0x20; +pub const ECHONL: ::tcflag_t = 0x40; +pub const ECHOPRT: ::tcflag_t = 0x400; +pub const ECHOCTL: ::tcflag_t = 0x200; +pub const ISIG: ::tcflag_t = 0x1; +pub const ICANON: ::tcflag_t = 0x2; +pub const PENDIN: ::tcflag_t = 0x4000; +pub const NOFLSH: ::tcflag_t = 0x80; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0x00001000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0x1001; +pub const B115200: ::speed_t = 0x1002; +pub const B230400: ::speed_t = 0x1003; +pub const B460800: ::speed_t = 0x1004; +pub const B76800: ::speed_t = 0x1005; +pub const B153600: ::speed_t = 0x1006; +pub const B307200: ::speed_t = 0x1007; +pub const B614400: ::speed_t = 0x1008; +pub const B921600: ::speed_t = 0x1009; +pub const B500000: ::speed_t = 0x100a; +pub const B576000: ::speed_t = 0x100b; +pub const B1000000: ::speed_t = 0x100c; +pub const B1152000: ::speed_t = 0x100d; +pub const B1500000: ::speed_t = 0x100e; +pub const B2000000: ::speed_t = 0x100f; + +pub const VEOL: usize = 5; +pub const VEOL2: usize = 6; +pub const VMIN: usize = 4; +pub const IEXTEN: ::tcflag_t = 0x8000; +pub const TOSTOP: ::tcflag_t = 0x100; +pub const FLUSHO: ::tcflag_t = 0x1000; +pub const EXTPROC: ::tcflag_t = 0x10000; + +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_wait4: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execv: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_chown: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_brk: ::c_long = 17; +pub const SYS_perfctr: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_capget: ::c_long = 21; +pub const SYS_capset: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_vmsplice: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_sigaltstack: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_lchown32: ::c_long = 31; +pub const SYS_fchown32: ::c_long = 32; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_chown32: ::c_long = 35; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_stat: ::c_long = 38; +pub const SYS_sendfile: ::c_long = 39; +pub const SYS_lstat: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_getuid32: ::c_long = 44; +pub const SYS_umount2: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_getgid32: ::c_long = 53; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_reboot: ::c_long = 55; +pub const SYS_mmap2: ::c_long = 56; +pub const SYS_symlink: ::c_long = 57; +pub const SYS_readlink: ::c_long = 58; +pub const SYS_execve: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_fstat: ::c_long = 62; +pub const SYS_fstat64: ::c_long = 63; +pub const SYS_getpagesize: ::c_long = 64; +pub const SYS_msync: ::c_long = 65; +pub const SYS_vfork: ::c_long = 66; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_geteuid32: ::c_long = 69; +pub const SYS_getegid32: ::c_long = 70; +pub const SYS_mmap: ::c_long = 71; +pub const SYS_setreuid32: ::c_long = 72; +pub const SYS_munmap: ::c_long = 73; +pub const SYS_mprotect: ::c_long = 74; +pub const SYS_madvise: ::c_long = 75; +pub const SYS_vhangup: ::c_long = 76; +pub const SYS_truncate64: ::c_long = 77; +pub const SYS_mincore: ::c_long = 78; +pub const SYS_getgroups: ::c_long = 79; +pub const SYS_setgroups: ::c_long = 80; +pub const SYS_getpgrp: ::c_long = 81; +pub const SYS_setgroups32: ::c_long = 82; +pub const SYS_setitimer: ::c_long = 83; +pub const SYS_ftruncate64: ::c_long = 84; +pub const SYS_swapon: ::c_long = 85; +pub const SYS_getitimer: ::c_long = 86; +pub const SYS_setuid32: ::c_long = 87; +pub const SYS_sethostname: ::c_long = 88; +pub const SYS_setgid32: ::c_long = 89; +pub const SYS_dup2: ::c_long = 90; +pub const SYS_setfsuid32: ::c_long = 91; +pub const SYS_fcntl: ::c_long = 92; +pub const SYS_select: ::c_long = 93; +pub const SYS_setfsgid32: ::c_long = 94; +pub const SYS_fsync: ::c_long = 95; +pub const SYS_setpriority: ::c_long = 96; +pub const SYS_socket: ::c_long = 97; +pub const SYS_connect: ::c_long = 98; +pub const SYS_accept: ::c_long = 99; +pub const SYS_getpriority: ::c_long = 100; +pub const SYS_rt_sigreturn: ::c_long = 101; +pub const SYS_rt_sigaction: ::c_long = 102; +pub const SYS_rt_sigprocmask: ::c_long = 103; +pub const SYS_rt_sigpending: ::c_long = 104; +pub const SYS_rt_sigtimedwait: ::c_long = 105; +pub const SYS_rt_sigqueueinfo: ::c_long = 106; +pub const SYS_rt_sigsuspend: ::c_long = 107; +pub const SYS_setresuid32: ::c_long = 108; +pub const SYS_getresuid32: ::c_long = 109; +pub const SYS_setresgid32: ::c_long = 110; +pub const SYS_getresgid32: ::c_long = 111; +pub const SYS_setregid32: ::c_long = 112; +pub const SYS_recvmsg: ::c_long = 113; +pub const SYS_sendmsg: ::c_long = 114; +pub const SYS_getgroups32: ::c_long = 115; +pub const SYS_gettimeofday: ::c_long = 116; +pub const SYS_getrusage: ::c_long = 117; +pub const SYS_getsockopt: ::c_long = 118; +pub const SYS_getcwd: ::c_long = 119; +pub const SYS_readv: ::c_long = 120; +pub const SYS_writev: ::c_long = 121; +pub const SYS_settimeofday: ::c_long = 122; +pub const SYS_fchown: ::c_long = 123; +pub const SYS_fchmod: ::c_long = 124; +pub const SYS_recvfrom: ::c_long = 125; +pub const SYS_setreuid: ::c_long = 126; +pub const SYS_setregid: ::c_long = 127; +pub const SYS_rename: ::c_long = 128; +pub const SYS_truncate: ::c_long = 129; +pub const SYS_ftruncate: ::c_long = 130; +pub const SYS_flock: ::c_long = 131; +pub const SYS_lstat64: ::c_long = 132; +pub const SYS_sendto: ::c_long = 133; +pub const SYS_shutdown: ::c_long = 134; +pub const SYS_socketpair: ::c_long = 135; +pub const SYS_mkdir: ::c_long = 136; +pub const SYS_rmdir: ::c_long = 137; +pub const SYS_utimes: ::c_long = 138; +pub const SYS_stat64: ::c_long = 139; +pub const SYS_sendfile64: ::c_long = 140; +pub const SYS_getpeername: ::c_long = 141; +pub const SYS_futex: ::c_long = 142; +pub const SYS_gettid: ::c_long = 143; +pub const SYS_getrlimit: ::c_long = 144; +pub const SYS_setrlimit: ::c_long = 145; +pub const SYS_pivot_root: ::c_long = 146; +pub const SYS_prctl: ::c_long = 147; +pub const SYS_pciconfig_read: ::c_long = 148; +pub const SYS_pciconfig_write: ::c_long = 149; +pub const SYS_getsockname: ::c_long = 150; +pub const SYS_inotify_init: ::c_long = 151; +pub const SYS_inotify_add_watch: ::c_long = 152; +pub const SYS_poll: ::c_long = 153; +pub const SYS_getdents64: ::c_long = 154; +pub const SYS_fcntl64: ::c_long = 155; +pub const SYS_inotify_rm_watch: ::c_long = 156; +pub const SYS_statfs: ::c_long = 157; +pub const SYS_fstatfs: ::c_long = 158; +pub const SYS_umount: ::c_long = 159; +pub const SYS_sched_set_affinity: ::c_long = 160; +pub const SYS_sched_get_affinity: ::c_long = 161; +pub const SYS_getdomainname: ::c_long = 162; +pub const SYS_setdomainname: ::c_long = 163; +pub const SYS_quotactl: ::c_long = 165; +pub const SYS_set_tid_address: ::c_long = 166; +pub const SYS_mount: ::c_long = 167; +pub const SYS_ustat: ::c_long = 168; +pub const SYS_setxattr: ::c_long = 169; +pub const SYS_lsetxattr: ::c_long = 170; +pub const SYS_fsetxattr: ::c_long = 171; +pub const SYS_getxattr: ::c_long = 172; +pub const SYS_lgetxattr: ::c_long = 173; +pub const SYS_getdents: ::c_long = 174; +pub const SYS_setsid: ::c_long = 175; +pub const SYS_fchdir: ::c_long = 176; +pub const SYS_fgetxattr: ::c_long = 177; +pub const SYS_listxattr: ::c_long = 178; +pub const SYS_llistxattr: ::c_long = 179; +pub const SYS_flistxattr: ::c_long = 180; +pub const SYS_removexattr: ::c_long = 181; +pub const SYS_lremovexattr: ::c_long = 182; +pub const SYS_sigpending: ::c_long = 183; +pub const SYS_query_module: ::c_long = 184; +pub const SYS_setpgid: ::c_long = 185; +pub const SYS_fremovexattr: ::c_long = 186; +pub const SYS_tkill: ::c_long = 187; +pub const SYS_exit_group: ::c_long = 188; +pub const SYS_uname: ::c_long = 189; +pub const SYS_init_module: ::c_long = 190; +pub const SYS_personality: ::c_long = 191; +pub const SYS_remap_file_pages: ::c_long = 192; +pub const SYS_epoll_create: ::c_long = 193; +pub const SYS_epoll_ctl: ::c_long = 194; +pub const SYS_epoll_wait: ::c_long = 195; +pub const SYS_ioprio_set: ::c_long = 196; +pub const SYS_getppid: ::c_long = 197; +pub const SYS_sigaction: ::c_long = 198; +pub const SYS_sgetmask: ::c_long = 199; +pub const SYS_ssetmask: ::c_long = 200; +pub const SYS_sigsuspend: ::c_long = 201; +pub const SYS_oldlstat: ::c_long = 202; +pub const SYS_uselib: ::c_long = 203; +pub const SYS_readdir: ::c_long = 204; +pub const SYS_readahead: ::c_long = 205; +pub const SYS_socketcall: ::c_long = 206; +pub const SYS_syslog: ::c_long = 207; +pub const SYS_lookup_dcookie: ::c_long = 208; +pub const SYS_fadvise64: ::c_long = 209; +pub const SYS_fadvise64_64: ::c_long = 210; +pub const SYS_tgkill: ::c_long = 211; +pub const SYS_waitpid: ::c_long = 212; +pub const SYS_swapoff: ::c_long = 213; +pub const SYS_sysinfo: ::c_long = 214; +pub const SYS_ipc: ::c_long = 215; +pub const SYS_sigreturn: ::c_long = 216; +pub const SYS_clone: ::c_long = 217; +pub const SYS_ioprio_get: ::c_long = 218; +pub const SYS_adjtimex: ::c_long = 219; +pub const SYS_sigprocmask: ::c_long = 220; +pub const SYS_create_module: ::c_long = 221; +pub const SYS_delete_module: ::c_long = 222; +pub const SYS_get_kernel_syms: ::c_long = 223; +pub const SYS_getpgid: ::c_long = 224; +pub const SYS_bdflush: ::c_long = 225; +pub const SYS_sysfs: ::c_long = 226; +pub const SYS_afs_syscall: ::c_long = 227; +pub const SYS_setfsuid: ::c_long = 228; +pub const SYS_setfsgid: ::c_long = 229; +pub const SYS__newselect: ::c_long = 230; +pub const SYS_time: ::c_long = 231; +pub const SYS_splice: ::c_long = 232; +pub const SYS_stime: ::c_long = 233; +pub const SYS_statfs64: ::c_long = 234; +pub const SYS_fstatfs64: ::c_long = 235; +pub const SYS__llseek: ::c_long = 236; +pub const SYS_mlock: ::c_long = 237; +pub const SYS_munlock: ::c_long = 238; +pub const SYS_mlockall: ::c_long = 239; +pub const SYS_munlockall: ::c_long = 240; +pub const SYS_sched_setparam: ::c_long = 241; +pub const SYS_sched_getparam: ::c_long = 242; +pub const SYS_sched_setscheduler: ::c_long = 243; +pub const SYS_sched_getscheduler: ::c_long = 244; +pub const SYS_sched_yield: ::c_long = 245; +pub const SYS_sched_get_priority_max: ::c_long = 246; +pub const SYS_sched_get_priority_min: ::c_long = 247; +pub const SYS_sched_rr_get_interval: ::c_long = 248; +pub const SYS_nanosleep: ::c_long = 249; +pub const SYS_mremap: ::c_long = 250; +pub const SYS__sysctl: ::c_long = 251; +pub const SYS_getsid: ::c_long = 252; +pub const SYS_fdatasync: ::c_long = 253; +pub const SYS_nfsservctl: ::c_long = 254; +pub const SYS_sync_file_range: ::c_long = 255; +pub const SYS_clock_settime: ::c_long = 256; +pub const SYS_clock_gettime: ::c_long = 257; +pub const SYS_clock_getres: ::c_long = 258; +pub const SYS_clock_nanosleep: ::c_long = 259; +pub const SYS_sched_getaffinity: ::c_long = 260; +pub const SYS_sched_setaffinity: ::c_long = 261; +pub const SYS_timer_settime: ::c_long = 262; +pub const SYS_timer_gettime: ::c_long = 263; +pub const SYS_timer_getoverrun: ::c_long = 264; +pub const SYS_timer_delete: ::c_long = 265; +pub const SYS_timer_create: ::c_long = 266; +pub const SYS_io_setup: ::c_long = 268; +pub const SYS_io_destroy: ::c_long = 269; +pub const SYS_io_submit: ::c_long = 270; +pub const SYS_io_cancel: ::c_long = 271; +pub const SYS_io_getevents: ::c_long = 272; +pub const SYS_mq_open: ::c_long = 273; +pub const SYS_mq_unlink: ::c_long = 274; +pub const SYS_mq_timedsend: ::c_long = 275; +pub const SYS_mq_timedreceive: ::c_long = 276; +pub const SYS_mq_notify: ::c_long = 277; +pub const SYS_mq_getsetattr: ::c_long = 278; +pub const SYS_waitid: ::c_long = 279; +pub const SYS_tee: ::c_long = 280; +pub const SYS_add_key: ::c_long = 281; +pub const SYS_request_key: ::c_long = 282; +pub const SYS_keyctl: ::c_long = 283; +pub const SYS_openat: ::c_long = 284; +pub const SYS_mkdirat: ::c_long = 285; +pub const SYS_mknodat: ::c_long = 286; +pub const SYS_fchownat: ::c_long = 287; +pub const SYS_futimesat: ::c_long = 288; +pub const SYS_fstatat64: ::c_long = 289; +pub const SYS_unlinkat: ::c_long = 290; +pub const SYS_renameat: ::c_long = 291; +pub const SYS_linkat: ::c_long = 292; +pub const SYS_symlinkat: ::c_long = 293; +pub const SYS_readlinkat: ::c_long = 294; +pub const SYS_fchmodat: ::c_long = 295; +pub const SYS_faccessat: ::c_long = 296; +pub const SYS_pselect6: ::c_long = 297; +pub const SYS_ppoll: ::c_long = 298; +pub const SYS_unshare: ::c_long = 299; +pub const SYS_set_robust_list: ::c_long = 300; +pub const SYS_get_robust_list: ::c_long = 301; +pub const SYS_migrate_pages: ::c_long = 302; +pub const SYS_mbind: ::c_long = 303; +pub const SYS_get_mempolicy: ::c_long = 304; +pub const SYS_set_mempolicy: ::c_long = 305; +pub const SYS_kexec_load: ::c_long = 306; +pub const SYS_move_pages: ::c_long = 307; +pub const SYS_getcpu: ::c_long = 308; +pub const SYS_epoll_pwait: ::c_long = 309; +pub const SYS_utimensat: ::c_long = 310; +pub const SYS_signalfd: ::c_long = 311; +pub const SYS_timerfd_create: ::c_long = 312; +pub const SYS_eventfd: ::c_long = 313; +pub const SYS_fallocate: ::c_long = 314; +pub const SYS_timerfd_settime: ::c_long = 315; +pub const SYS_timerfd_gettime: ::c_long = 316; +pub const SYS_signalfd4: ::c_long = 317; +pub const SYS_eventfd2: ::c_long = 318; +pub const SYS_epoll_create1: ::c_long = 319; +pub const SYS_dup3: ::c_long = 320; +pub const SYS_pipe2: ::c_long = 321; +pub const SYS_inotify_init1: ::c_long = 322; +pub const SYS_accept4: ::c_long = 323; +pub const SYS_preadv: ::c_long = 324; +pub const SYS_pwritev: ::c_long = 325; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 326; +pub const SYS_perf_event_open: ::c_long = 327; +pub const SYS_recvmmsg: ::c_long = 328; +pub const SYS_fanotify_init: ::c_long = 329; +pub const SYS_fanotify_mark: ::c_long = 330; +pub const SYS_prlimit64: ::c_long = 331; +pub const SYS_name_to_handle_at: ::c_long = 332; +pub const SYS_open_by_handle_at: ::c_long = 333; +pub const SYS_clock_adjtime: ::c_long = 334; +pub const SYS_syncfs: ::c_long = 335; +pub const SYS_sendmmsg: ::c_long = 336; +pub const SYS_setns: ::c_long = 337; +pub const SYS_process_vm_readv: ::c_long = 338; +pub const SYS_process_vm_writev: ::c_long = 339; +pub const SYS_kern_features: ::c_long = 340; +pub const SYS_kcmp: ::c_long = 341; +pub const SYS_finit_module: ::c_long = 342; +pub const SYS_sched_setattr: ::c_long = 343; +pub const SYS_sched_getattr: ::c_long = 344; +pub const SYS_renameat2: ::c_long = 345; +pub const SYS_seccomp: ::c_long = 346; +pub const SYS_getrandom: ::c_long = 347; +pub const SYS_memfd_create: ::c_long = 348; +pub const SYS_bpf: ::c_long = 349; +pub const SYS_execveat: ::c_long = 350; +pub const SYS_membarrier: ::c_long = 351; +pub const SYS_userfaultfd: ::c_long = 352; +pub const SYS_bind: ::c_long = 353; +pub const SYS_listen: ::c_long = 354; +pub const SYS_setsockopt: ::c_long = 355; +pub const SYS_mlock2: ::c_long = 356; +pub const SYS_copy_file_range: ::c_long = 357; +pub const SYS_preadv2: ::c_long = 358; +pub const SYS_pwritev2: ::c_long = 359; +pub const SYS_statx: ::c_long = 360; +pub const SYS_rseq: ::c_long = 365; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +// Reserved in the kernel, but not actually implemented yet +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..96634749f53b2a7c2f5e21113d5dbd8a92b7f550 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 6] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..e42e9ebd6ebe0b2d07fa2b3607d2c0eecf5e3fdf --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs @@ -0,0 +1,1101 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type greg_t = i32; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct statfs { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + f_spare: [::__fsword_t; 5], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct _libc_fpreg { + pub significand: [u16; 4], + pub exponent: u16, + } + + pub struct _libc_fpstate { + pub cw: ::c_ulong, + pub sw: ::c_ulong, + pub tag: ::c_ulong, + pub ipoff: ::c_ulong, + pub cssel: ::c_ulong, + pub dataoff: ::c_ulong, + pub datasel: ::c_ulong, + pub _st: [_libc_fpreg; 8], + pub status: ::c_ulong, + } + + pub struct user_fpregs_struct { + pub cwd: ::c_long, + pub swd: ::c_long, + pub twd: ::c_long, + pub fip: ::c_long, + pub fcs: ::c_long, + pub foo: ::c_long, + pub fos: ::c_long, + pub st_space: [::c_long; 20], + } + + pub struct user_regs_struct { + pub ebx: ::c_long, + pub ecx: ::c_long, + pub edx: ::c_long, + pub esi: ::c_long, + pub edi: ::c_long, + pub ebp: ::c_long, + pub eax: ::c_long, + pub xds: ::c_long, + pub xes: ::c_long, + pub xfs: ::c_long, + pub xgs: ::c_long, + pub orig_eax: ::c_long, + pub eip: ::c_long, + pub xcs: ::c_long, + pub eflags: ::c_long, + pub esp: ::c_long, + pub xss: ::c_long, + } + + pub struct user { + pub regs: user_regs_struct, + pub u_fpvalid: ::c_int, + pub i387: user_fpregs_struct, + pub u_tsize: ::c_ulong, + pub u_dsize: ::c_ulong, + pub u_ssize: ::c_ulong, + pub start_code: ::c_ulong, + pub start_stack: ::c_ulong, + pub signal: ::c_long, + __reserved: ::c_int, + pub u_ar0: *mut user_regs_struct, + pub u_fpstate: *mut user_fpregs_struct, + pub magic: ::c_ulong, + pub u_comm: [c_char; 32], + pub u_debugreg: [::c_int; 8], + } + + pub struct mcontext_t { + pub gregs: [greg_t; 19], + pub fpregs: *mut _libc_fpstate, + pub oldmask: ::c_ulong, + pub cr2: ::c_ulong, + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_ushort, + __pad1: ::c_ushort, + pub __seq: ::c_ushort, + __pad2: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + pub struct stat64 { + pub st_dev: ::dev_t, + __pad1: ::c_uint, + __st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad2: ::c_uint, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::ino64_t, + } + + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + __unused1: ::c_ulong, + pub shm_dtime: ::time_t, + __unused2: ::c_ulong, + pub shm_ctime: ::time_t, + __unused3: ::c_ulong, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + __glibc_reserved1: ::c_ulong, + pub msg_rtime: ::time_t, + __glibc_reserved2: ::c_ulong, + pub msg_ctime: ::time_t, + __glibc_reserved3: ::c_ulong, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __glibc_reserved4: ::c_ulong, + __glibc_reserved5: ::c_ulong, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct seccomp_notif_sizes { + pub seccomp_notif: ::__u16, + pub seccomp_notif_resp: ::__u16, + pub seccomp_data: ::__u16, + } +} + +s_no_extra_traits! { + pub struct user_fpxregs_struct { + pub cwd: ::c_ushort, + pub swd: ::c_ushort, + pub twd: ::c_ushort, + pub fop: ::c_ushort, + pub fip: ::c_long, + pub fcs: ::c_long, + pub foo: ::c_long, + pub fos: ::c_long, + pub mxcsr: ::c_long, + __reserved: ::c_long, + pub st_space: [::c_long; 32], + pub xmm_space: [::c_long; 32], + padding: [::c_long; 56], + } + + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask: ::sigset_t, + __private: [u8; 112], + __ssp: [::c_ulong; 4], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for user_fpxregs_struct { + fn eq(&self, other: &user_fpxregs_struct) -> bool { + self.cwd == other.cwd + && self.swd == other.swd + && self.twd == other.twd + && self.fop == other.fop + && self.fip == other.fip + && self.fcs == other.fcs + && self.foo == other.foo + && self.fos == other.fos + && self.mxcsr == other.mxcsr + // Ignore __reserved field + && self.st_space == other.st_space + && self.xmm_space == other.xmm_space + // Ignore padding field + } + } + + impl Eq for user_fpxregs_struct {} + + impl ::fmt::Debug for user_fpxregs_struct { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("user_fpxregs_struct") + .field("cwd", &self.cwd) + .field("swd", &self.swd) + .field("twd", &self.twd) + .field("fop", &self.fop) + .field("fip", &self.fip) + .field("fcs", &self.fcs) + .field("foo", &self.foo) + .field("fos", &self.fos) + .field("mxcsr", &self.mxcsr) + // Ignore __reserved field + .field("st_space", &self.st_space) + .field("xmm_space", &self.xmm_space) + // Ignore padding field + .finish() + } + } + + impl ::hash::Hash for user_fpxregs_struct { + fn hash(&self, state: &mut H) { + self.cwd.hash(state); + self.swd.hash(state); + self.twd.hash(state); + self.fop.hash(state); + self.fip.hash(state); + self.fcs.hash(state); + self.foo.hash(state); + self.fos.hash(state); + self.mxcsr.hash(state); + // Ignore __reserved field + self.st_space.hash(state); + self.xmm_space.hash(state); + // Ignore padding field + } + } + + impl PartialEq for ucontext_t { + fn eq(&self, other: &ucontext_t) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_sigmask == other.uc_sigmask + // Ignore __private field + } + } + + impl Eq for ucontext_t {} + + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_flags) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field("uc_sigmask", &self.uc_sigmask) + // Ignore __private field + .finish() + } + } + + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + self.uc_sigmask.hash(state); + // Ignore __private field + } + } + } +} + +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; +pub const O_LARGEFILE: ::c_int = 0o0100000; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 0x101000; +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_NDELAY: ::c_int = 0x800; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_32BIT: ::c_int = 0x0040; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const EDEADLOCK: ::c_int = 35; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; + +pub const PTRACE_GETFPXREGS: ::c_uint = 18; +pub const PTRACE_SETFPXREGS: ::c_uint = 19; +pub const PTRACE_SYSEMU: ::c_uint = 31; +pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const EFD_NONBLOCK: ::c_int = 0x800; +pub const SFD_NONBLOCK: ::c_int = 0x0800; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = 31; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; +pub const EXTPROC: ::tcflag_t = 0x00010000; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_waitpid: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_time: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_break: ::c_long = 17; +pub const SYS_oldstat: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_stime: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_oldfstat: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_stty: ::c_long = 31; +pub const SYS_gtty: ::c_long = 32; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_ftime: ::c_long = 35; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_prof: ::c_long = 44; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_lock: ::c_long = 53; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_mpx: ::c_long = 56; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_ulimit: ::c_long = 58; +pub const SYS_oldolduname: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sgetmask: ::c_long = 68; +pub const SYS_ssetmask: ::c_long = 69; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrlimit: ::c_long = 76; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_select: ::c_long = 82; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_oldlstat: ::c_long = 84; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_profil: ::c_long = 98; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_ioperm: ::c_long = 101; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_olduname: ::c_long = 109; +pub const SYS_iopl: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_vm86old: ::c_long = 113; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_modify_ldt: ::c_long = 123; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_vm86: ::c_long = 166; +pub const SYS_query_module: ::c_long = 167; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_chown: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_getpmsg: ::c_long = 188; +pub const SYS_putpmsg: ::c_long = 189; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_ugetrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_lchown32: ::c_long = 198; +pub const SYS_getuid32: ::c_long = 199; +pub const SYS_getgid32: ::c_long = 200; +pub const SYS_geteuid32: ::c_long = 201; +pub const SYS_getegid32: ::c_long = 202; +pub const SYS_setreuid32: ::c_long = 203; +pub const SYS_setregid32: ::c_long = 204; +pub const SYS_getgroups32: ::c_long = 205; +pub const SYS_setgroups32: ::c_long = 206; +pub const SYS_fchown32: ::c_long = 207; +pub const SYS_setresuid32: ::c_long = 208; +pub const SYS_getresuid32: ::c_long = 209; +pub const SYS_setresgid32: ::c_long = 210; +pub const SYS_getresgid32: ::c_long = 211; +pub const SYS_chown32: ::c_long = 212; +pub const SYS_setuid32: ::c_long = 213; +pub const SYS_setgid32: ::c_long = 214; +pub const SYS_setfsuid32: ::c_long = 215; +pub const SYS_setfsgid32: ::c_long = 216; +pub const SYS_pivot_root: ::c_long = 217; +pub const SYS_mincore: ::c_long = 218; +pub const SYS_madvise: ::c_long = 219; +pub const SYS_getdents64: ::c_long = 220; +pub const SYS_fcntl64: ::c_long = 221; +pub const SYS_gettid: ::c_long = 224; +pub const SYS_readahead: ::c_long = 225; +pub const SYS_setxattr: ::c_long = 226; +pub const SYS_lsetxattr: ::c_long = 227; +pub const SYS_fsetxattr: ::c_long = 228; +pub const SYS_getxattr: ::c_long = 229; +pub const SYS_lgetxattr: ::c_long = 230; +pub const SYS_fgetxattr: ::c_long = 231; +pub const SYS_listxattr: ::c_long = 232; +pub const SYS_llistxattr: ::c_long = 233; +pub const SYS_flistxattr: ::c_long = 234; +pub const SYS_removexattr: ::c_long = 235; +pub const SYS_lremovexattr: ::c_long = 236; +pub const SYS_fremovexattr: ::c_long = 237; +pub const SYS_tkill: ::c_long = 238; +pub const SYS_sendfile64: ::c_long = 239; +pub const SYS_futex: ::c_long = 240; +pub const SYS_sched_setaffinity: ::c_long = 241; +pub const SYS_sched_getaffinity: ::c_long = 242; +pub const SYS_set_thread_area: ::c_long = 243; +pub const SYS_get_thread_area: ::c_long = 244; +pub const SYS_io_setup: ::c_long = 245; +pub const SYS_io_destroy: ::c_long = 246; +pub const SYS_io_getevents: ::c_long = 247; +pub const SYS_io_submit: ::c_long = 248; +pub const SYS_io_cancel: ::c_long = 249; +pub const SYS_fadvise64: ::c_long = 250; +pub const SYS_exit_group: ::c_long = 252; +pub const SYS_lookup_dcookie: ::c_long = 253; +pub const SYS_epoll_create: ::c_long = 254; +pub const SYS_epoll_ctl: ::c_long = 255; +pub const SYS_epoll_wait: ::c_long = 256; +pub const SYS_remap_file_pages: ::c_long = 257; +pub const SYS_set_tid_address: ::c_long = 258; +pub const SYS_timer_create: ::c_long = 259; +pub const SYS_timer_settime: ::c_long = 260; +pub const SYS_timer_gettime: ::c_long = 261; +pub const SYS_timer_getoverrun: ::c_long = 262; +pub const SYS_timer_delete: ::c_long = 263; +pub const SYS_clock_settime: ::c_long = 264; +pub const SYS_clock_gettime: ::c_long = 265; +pub const SYS_clock_getres: ::c_long = 266; +pub const SYS_clock_nanosleep: ::c_long = 267; +pub const SYS_statfs64: ::c_long = 268; +pub const SYS_fstatfs64: ::c_long = 269; +pub const SYS_tgkill: ::c_long = 270; +pub const SYS_utimes: ::c_long = 271; +pub const SYS_fadvise64_64: ::c_long = 272; +pub const SYS_vserver: ::c_long = 273; +pub const SYS_mbind: ::c_long = 274; +pub const SYS_get_mempolicy: ::c_long = 275; +pub const SYS_set_mempolicy: ::c_long = 276; +pub const SYS_mq_open: ::c_long = 277; +pub const SYS_mq_unlink: ::c_long = 278; +pub const SYS_mq_timedsend: ::c_long = 279; +pub const SYS_mq_timedreceive: ::c_long = 280; +pub const SYS_mq_notify: ::c_long = 281; +pub const SYS_mq_getsetattr: ::c_long = 282; +pub const SYS_kexec_load: ::c_long = 283; +pub const SYS_waitid: ::c_long = 284; +pub const SYS_add_key: ::c_long = 286; +pub const SYS_request_key: ::c_long = 287; +pub const SYS_keyctl: ::c_long = 288; +pub const SYS_ioprio_set: ::c_long = 289; +pub const SYS_ioprio_get: ::c_long = 290; +pub const SYS_inotify_init: ::c_long = 291; +pub const SYS_inotify_add_watch: ::c_long = 292; +pub const SYS_inotify_rm_watch: ::c_long = 293; +pub const SYS_migrate_pages: ::c_long = 294; +pub const SYS_openat: ::c_long = 295; +pub const SYS_mkdirat: ::c_long = 296; +pub const SYS_mknodat: ::c_long = 297; +pub const SYS_fchownat: ::c_long = 298; +pub const SYS_futimesat: ::c_long = 299; +pub const SYS_fstatat64: ::c_long = 300; +pub const SYS_unlinkat: ::c_long = 301; +pub const SYS_renameat: ::c_long = 302; +pub const SYS_linkat: ::c_long = 303; +pub const SYS_symlinkat: ::c_long = 304; +pub const SYS_readlinkat: ::c_long = 305; +pub const SYS_fchmodat: ::c_long = 306; +pub const SYS_faccessat: ::c_long = 307; +pub const SYS_pselect6: ::c_long = 308; +pub const SYS_ppoll: ::c_long = 309; +pub const SYS_unshare: ::c_long = 310; +pub const SYS_set_robust_list: ::c_long = 311; +pub const SYS_get_robust_list: ::c_long = 312; +pub const SYS_splice: ::c_long = 313; +pub const SYS_sync_file_range: ::c_long = 314; +pub const SYS_tee: ::c_long = 315; +pub const SYS_vmsplice: ::c_long = 316; +pub const SYS_move_pages: ::c_long = 317; +pub const SYS_getcpu: ::c_long = 318; +pub const SYS_epoll_pwait: ::c_long = 319; +pub const SYS_utimensat: ::c_long = 320; +pub const SYS_signalfd: ::c_long = 321; +pub const SYS_timerfd_create: ::c_long = 322; +pub const SYS_eventfd: ::c_long = 323; +pub const SYS_fallocate: ::c_long = 324; +pub const SYS_timerfd_settime: ::c_long = 325; +pub const SYS_timerfd_gettime: ::c_long = 326; +pub const SYS_signalfd4: ::c_long = 327; +pub const SYS_eventfd2: ::c_long = 328; +pub const SYS_epoll_create1: ::c_long = 329; +pub const SYS_dup3: ::c_long = 330; +pub const SYS_pipe2: ::c_long = 331; +pub const SYS_inotify_init1: ::c_long = 332; +pub const SYS_preadv: ::c_long = 333; +pub const SYS_pwritev: ::c_long = 334; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 335; +pub const SYS_perf_event_open: ::c_long = 336; +pub const SYS_recvmmsg: ::c_long = 337; +pub const SYS_fanotify_init: ::c_long = 338; +pub const SYS_fanotify_mark: ::c_long = 339; +pub const SYS_prlimit64: ::c_long = 340; +pub const SYS_name_to_handle_at: ::c_long = 341; +pub const SYS_open_by_handle_at: ::c_long = 342; +pub const SYS_clock_adjtime: ::c_long = 343; +pub const SYS_syncfs: ::c_long = 344; +pub const SYS_sendmmsg: ::c_long = 345; +pub const SYS_setns: ::c_long = 346; +pub const SYS_process_vm_readv: ::c_long = 347; +pub const SYS_process_vm_writev: ::c_long = 348; +pub const SYS_kcmp: ::c_long = 349; +pub const SYS_finit_module: ::c_long = 350; +pub const SYS_sched_setattr: ::c_long = 351; +pub const SYS_sched_getattr: ::c_long = 352; +pub const SYS_renameat2: ::c_long = 353; +pub const SYS_seccomp: ::c_long = 354; +pub const SYS_getrandom: ::c_long = 355; +pub const SYS_memfd_create: ::c_long = 356; +pub const SYS_bpf: ::c_long = 357; +pub const SYS_execveat: ::c_long = 358; +pub const SYS_socket: ::c_long = 359; +pub const SYS_socketpair: ::c_long = 360; +pub const SYS_bind: ::c_long = 361; +pub const SYS_connect: ::c_long = 362; +pub const SYS_listen: ::c_long = 363; +pub const SYS_accept4: ::c_long = 364; +pub const SYS_getsockopt: ::c_long = 365; +pub const SYS_setsockopt: ::c_long = 366; +pub const SYS_getsockname: ::c_long = 367; +pub const SYS_getpeername: ::c_long = 368; +pub const SYS_sendto: ::c_long = 369; +pub const SYS_sendmsg: ::c_long = 370; +pub const SYS_recvfrom: ::c_long = 371; +pub const SYS_recvmsg: ::c_long = 372; +pub const SYS_shutdown: ::c_long = 373; +pub const SYS_userfaultfd: ::c_long = 374; +pub const SYS_membarrier: ::c_long = 375; +pub const SYS_mlock2: ::c_long = 376; +pub const SYS_copy_file_range: ::c_long = 377; +pub const SYS_preadv2: ::c_long = 378; +pub const SYS_pwritev2: ::c_long = 379; +pub const SYS_pkey_mprotect: ::c_long = 380; +pub const SYS_pkey_alloc: ::c_long = 381; +pub const SYS_pkey_free: ::c_long = 382; +pub const SYS_statx: ::c_long = 383; +pub const SYS_rseq: ::c_long = 386; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +// offsets in user_regs_structs, from sys/reg.h +pub const EBX: ::c_int = 0; +pub const ECX: ::c_int = 1; +pub const EDX: ::c_int = 2; +pub const ESI: ::c_int = 3; +pub const EDI: ::c_int = 4; +pub const EBP: ::c_int = 5; +pub const EAX: ::c_int = 6; +pub const DS: ::c_int = 7; +pub const ES: ::c_int = 8; +pub const FS: ::c_int = 9; +pub const GS: ::c_int = 10; +pub const ORIG_EAX: ::c_int = 11; +pub const EIP: ::c_int = 12; +pub const CS: ::c_int = 13; +pub const EFL: ::c_int = 14; +pub const UESP: ::c_int = 15; +pub const SS: ::c_int = 16; + +// offsets in mcontext_t.gregs from sys/ucontext.h +pub const REG_GS: ::c_int = 0; +pub const REG_FS: ::c_int = 1; +pub const REG_ES: ::c_int = 2; +pub const REG_DS: ::c_int = 3; +pub const REG_EDI: ::c_int = 4; +pub const REG_ESI: ::c_int = 5; +pub const REG_EBP: ::c_int = 6; +pub const REG_ESP: ::c_int = 7; +pub const REG_EBX: ::c_int = 8; +pub const REG_EDX: ::c_int = 9; +pub const REG_ECX: ::c_int = 10; +pub const REG_EAX: ::c_int = 11; +pub const REG_TRAPNO: ::c_int = 12; +pub const REG_ERR: ::c_int = 13; +pub const REG_EIP: ::c_int = 14; +pub const REG_CS: ::c_int = 15; +pub const REG_EFL: ::c_int = 16; +pub const REG_UESP: ::c_int = 17; +pub const REG_SS: ::c_int = 18; + +pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0; +pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1; +pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2; +pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3; + +extern "C" { + pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; + pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; + pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...); + pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int; +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..cb2df378cf5eab48d0a103bc17c84eaef7ed1500 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs @@ -0,0 +1,51 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f32; 8] + } +} + +s! { + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: mcontext_t, + } + + #[repr(align(16))] + pub struct mcontext_t { + pub fault_address: ::c_ulonglong, + pub regs: [::c_ulonglong; 31], + pub sp: ::c_ulonglong, + pub pc: ::c_ulonglong, + pub pstate: ::c_ulonglong, + // nested arrays to get the right size/length while being able to + // auto-derive traits like Debug + __reserved: [[u64; 32]; 16], + } + + #[repr(align(16))] + pub struct user_fpsimd_struct { + pub vregs: [[u64; 2]; 32], + pub fpsr: ::c_uint, + pub fpcr: ::c_uint, + } + + #[repr(align(8))] + pub struct clone_args { + pub flags: ::c_ulonglong, + pub pidfd: ::c_ulonglong, + pub child_tid: ::c_ulonglong, + pub parent_tid: ::c_ulonglong, + pub exit_signal: ::c_ulonglong, + pub stack: ::c_ulonglong, + pub stack_size: ::c_ulonglong, + pub tls: ::c_ulonglong, + pub set_tid: ::c_ulonglong, + pub set_tid_size: ::c_ulonglong, + pub cgroup: ::c_ulonglong, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs new file mode 100644 index 0000000000000000000000000000000000000000..24b7f4e6b90cfd694f857a8eba7f106b9cba5783 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs @@ -0,0 +1,62 @@ +use pthread_mutex_t; + +pub type c_long = i32; +pub type c_ulong = u32; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 48; + +align_const! { + #[cfg(target_endian = "little")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +} + +pub const SYS_sync_file_range2: ::c_long = 84; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs new file mode 100644 index 0000000000000000000000000000000000000000..4535e73eeddf150890f9ca316e2d64859f5f2aa4 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs @@ -0,0 +1,7 @@ +s! { + pub struct user_fpsimd_struct { + pub vregs: [::__uint128_t; 32], + pub fpsr: u32, + pub fpcr: u32, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs new file mode 100644 index 0000000000000000000000000000000000000000..14d39e543dc44a148a9e837fab78c64c267c397a --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs @@ -0,0 +1,71 @@ +use pthread_mutex_t; + +pub type c_long = i64; +pub type c_ulong = u64; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + +align_const! { + #[cfg(target_endian = "little")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + ], + }; +} + +pub const SYS_renameat: ::c_long = 38; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_setrlimit: ::c_long = 164; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..60a1b69323cf7bbdc31ceb546204d2676a0f849e --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs @@ -0,0 +1,922 @@ +//! AArch64-specific definitions for 64-bit linux-like values + +pub type c_char = u8; +pub type wchar_t = u32; +pub type nlink_t = u32; +pub type blksize_t = i32; +pub type suseconds_t = i64; +pub type __u64 = ::c_ulonglong; +pub type __s64 = ::c_longlong; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + #[cfg(target_arch = "sparc64")] + __reserved0: ::c_int, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct statfs { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + f_spare: [::__fsword_t; 5], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad1: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + __pad2: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad1: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + __pad2: ::c_int, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2], + } + + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct pthread_attr_t { + __size: [usize; 8] + } + + pub struct user_regs_struct { + pub regs: [::c_ulonglong; 31], + pub sp: ::c_ulonglong, + pub pc: ::c_ulonglong, + pub pstate: ::c_ulonglong, + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_uint, + pub __seq: ::c_ushort, + __pad1: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct seccomp_notif_sizes { + pub seccomp_notif: ::__u16, + pub seccomp_notif_resp: ::__u16, + pub seccomp_data: ::__u16, + } +} + +pub const VEOF: usize = 4; + +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; + +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 0x101000; +pub const O_NOATIME: ::c_int = 0o1000000; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; + +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = 31; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_NDELAY: ::c_int = 0x800; + +pub const PTRACE_DETACH: ::c_uint = 17; + +pub const EFD_NONBLOCK: ::c_int = 0x800; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const F_RDLCK: ::c_int = 0; +pub const F_WRLCK: ::c_int = 1; +pub const F_UNLCK: ::c_int = 2; + +pub const SFD_NONBLOCK: ::c_int = 0x0800; + +pub const SFD_CLOEXEC: ::c_int = 0x080000; + +pub const NCCS: usize = 32; + +pub const O_TRUNC: ::c_int = 512; + +pub const O_CLOEXEC: ::c_int = 0x80000; + +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; + +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +pub const EFD_CLOEXEC: ::c_int = 0x80000; + +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; + +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const EDEADLOCK: ::c_int = 35; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const SIGSTKSZ: ::size_t = 16384; +pub const MINSIGSTKSZ: ::size_t = 5120; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0; +pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1; +pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2; +pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3; + +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; +pub const EXTPROC: ::tcflag_t = 0x00010000; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +// sys/auxv.h +pub const HWCAP_FP: ::c_ulong = 1 << 0; +pub const HWCAP_ASIMD: ::c_ulong = 1 << 1; +pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2; +pub const HWCAP_AES: ::c_ulong = 1 << 3; +pub const HWCAP_PMULL: ::c_ulong = 1 << 4; +pub const HWCAP_SHA1: ::c_ulong = 1 << 5; +pub const HWCAP_SHA2: ::c_ulong = 1 << 6; +pub const HWCAP_CRC32: ::c_ulong = 1 << 7; +pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8; +pub const HWCAP_FPHP: ::c_ulong = 1 << 9; +pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10; +pub const HWCAP_CPUID: ::c_ulong = 1 << 11; +pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12; +pub const HWCAP_JSCVT: ::c_ulong = 1 << 13; +pub const HWCAP_FCMA: ::c_ulong = 1 << 14; +pub const HWCAP_LRCPC: ::c_ulong = 1 << 15; +pub const HWCAP_DCPOP: ::c_ulong = 1 << 16; +pub const HWCAP_SHA3: ::c_ulong = 1 << 17; +pub const HWCAP_SM3: ::c_ulong = 1 << 18; +pub const HWCAP_SM4: ::c_ulong = 1 << 19; +pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20; +pub const HWCAP_SHA512: ::c_ulong = 1 << 21; +pub const HWCAP_SVE: ::c_ulong = 1 << 22; +pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23; +pub const HWCAP_DIT: ::c_ulong = 1 << 24; +pub const HWCAP_USCAT: ::c_ulong = 1 << 25; +pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26; +pub const HWCAP_FLAGM: ::c_ulong = 1 << 27; +pub const HWCAP_SSBS: ::c_ulong = 1 << 28; +pub const HWCAP_SB: ::c_ulong = 1 << 29; +pub const HWCAP_PACA: ::c_ulong = 1 << 30; +pub const HWCAP_PACG: ::c_ulong = 1 << 31; +// FIXME: enable these again once linux-api-headers are up to date enough on CI. +// See discussion in https://github.com/rust-lang/libc/pull/1638 +//pub const HWCAP2_DCPODP: ::c_ulong = 1 << 0; +//pub const HWCAP2_SVE2: ::c_ulong = 1 << 1; +//pub const HWCAP2_SVEAES: ::c_ulong = 1 << 2; +//pub const HWCAP2_SVEPMULL: ::c_ulong = 1 << 3; +//pub const HWCAP2_SVEBITPERM: ::c_ulong = 1 << 4; +//pub const HWCAP2_SVESHA3: ::c_ulong = 1 << 5; +//pub const HWCAP2_SVESM4: ::c_ulong = 1 << 6; +//pub const HWCAP2_FLAGM2: ::c_ulong = 1 << 7; +//pub const HWCAP2_FRINT: ::c_ulong = 1 << 8; +//pub const HWCAP2_MTE: ::c_ulong = 1 << 18; + +// linux/prctl.h +pub const PR_PAC_RESET_KEYS: ::c_int = 54; +pub const PR_SET_TAGGED_ADDR_CTRL: ::c_int = 55; +pub const PR_GET_TAGGED_ADDR_CTRL: ::c_int = 56; +pub const PR_PAC_SET_ENABLED_KEYS: ::c_int = 60; +pub const PR_PAC_GET_ENABLED_KEYS: ::c_int = 61; + +pub const PR_TAGGED_ADDR_ENABLE: ::c_ulong = 1; + +pub const PR_PAC_APIAKEY: ::c_ulong = 1 << 0; +pub const PR_PAC_APIBKEY: ::c_ulong = 1 << 1; +pub const PR_PAC_APDAKEY: ::c_ulong = 1 << 2; +pub const PR_PAC_APDBKEY: ::c_ulong = 1 << 3; +pub const PR_PAC_APGAKEY: ::c_ulong = 1 << 4; + +// Syscall table +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_dup: ::c_long = 23; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_fcntl: ::c_long = 25; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_flock: ::c_long = 32; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_linkat: ::c_long = 37; +// 38 is renameat only on LP64 +pub const SYS_umount2: ::c_long = 39; +pub const SYS_mount: ::c_long = 40; +pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_statfs: ::c_long = 43; +pub const SYS_fstatfs: ::c_long = 44; +pub const SYS_truncate: ::c_long = 45; +pub const SYS_ftruncate: ::c_long = 46; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_openat: ::c_long = 56; +pub const SYS_close: ::c_long = 57; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_lseek: ::c_long = 62; +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_newfstatat: ::c_long = 79; +pub const SYS_fstat: ::c_long = 80; +pub const SYS_sync: ::c_long = 81; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +// 84 sync_file_range on LP64 and sync_file_range2 on ILP32 +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_acct: ::c_long = 89; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_personality: ::c_long = 92; +pub const SYS_exit: ::c_long = 93; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_futex: ::c_long = 98; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_kill: ::c_long = 129; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_times: ::c_long = 153; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_uname: ::c_long = 160; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +// 163 is getrlimit only on LP64 +// 164 is setrlimit only on LP64 +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_umask: ::c_long = 166; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_getegid: ::c_long = 177; +pub const SYS_gettid: ::c_long = 178; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_semop: ::c_long = 193; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_socket: ::c_long = 198; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_accept: ::c_long = 202; +pub const SYS_connect: ::c_long = 203; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_brk: ::c_long = 214; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_mmap: ::c_long = 222; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; +pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_setns: ::c_long = 268; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; +pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_statx: ::c_long = 291; +pub const SYS_rseq: ::c_long = 293; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +extern "C" { + pub fn sysctl( + name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_pointer_width = "32")] { + mod ilp32; + pub use self::ilp32::*; + } else { + mod lp64; + pub use self::lp64::*; + } +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} + +cfg_if! { + if #[cfg(libc_int128)] { + mod int128; + pub use self::int128::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..7ca870fd02b71e31e44439e3fabdf1386eb75bb9 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 4] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..2ed6a9156df2a4df9ea1de4432b088b7c7bf96f5 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs @@ -0,0 +1,877 @@ +use pthread_mutex_t; + +pub type c_char = i8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type wchar_t = i32; + +pub type blksize_t = i32; +pub type nlink_t = u32; +pub type suseconds_t = i64; +pub type __u64 = ::c_ulonglong; +pub type __s64 = ::c_longlong; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad1: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + __pad2: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub __pad1: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub __pad2: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2], + } + + pub struct statfs { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct pthread_attr_t { + __size: [::c_ulong; 7] + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [u64; 0], + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_uint, + pub __seq: ::c_ushort, + __pad2: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong + } +} + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + +align_const! { + #[cfg(target_endian = "little")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +} + +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_dup: ::c_long = 23; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_fcntl: ::c_long = 25; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_flock: ::c_long = 32; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_mount: ::c_long = 40; +pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_statfs: ::c_long = 43; +pub const SYS_fstatfs: ::c_long = 44; +pub const SYS_truncate: ::c_long = 45; +pub const SYS_ftruncate: ::c_long = 46; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_openat: ::c_long = 56; +pub const SYS_close: ::c_long = 57; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_lseek: ::c_long = 62; +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_sendfile: ::c_long = 71; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_newfstatat: ::c_long = 79; +pub const SYS_fstat: ::c_long = 80; +pub const SYS_sync: ::c_long = 81; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_acct: ::c_long = 89; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_personality: ::c_long = 92; +pub const SYS_exit: ::c_long = 93; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_futex: ::c_long = 98; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_kill: ::c_long = 129; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_times: ::c_long = 153; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_uname: ::c_long = 160; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_umask: ::c_long = 166; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_getegid: ::c_long = 177; +pub const SYS_gettid: ::c_long = 178; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_semop: ::c_long = 193; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_socket: ::c_long = 198; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_accept: ::c_long = 202; +pub const SYS_connect: ::c_long = 203; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_brk: ::c_long = 214; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_mmap: ::c_long = 222; +pub const SYS_fadvise64: ::c_long = 223; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; +pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_recvmmsg: ::c_long = 243; +//pub const SYS_arch_specific_syscall: ::c_long = 244; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_setns: ::c_long = 268; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; +pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_statx: ::c_long = 291; +pub const SYS_io_pgetevents: ::c_long = 292; +pub const SYS_rseq: ::c_long = 293; +pub const SYS_kexec_file_load: ::c_long = 294; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; +pub const SYS_quotactl_fd: ::c_long = 443; +pub const SYS_landlock_create_ruleset: ::c_long = 444; +pub const SYS_landlock_add_rule: ::c_long = 445; +pub const SYS_landlock_restrict_self: ::c_long = 446; +pub const SYS_process_mrelease: ::c_long = 448; +pub const SYS_futex_waitv: ::c_long = 449; +//pub const SYS_set_mempolicy_home_node: ::c_long = 450; + +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; +pub const O_DIRECT: ::c_int = 0o00040000; +pub const O_DIRECTORY: ::c_int = 0o00200000; +pub const O_NOFOLLOW: ::c_int = 0o00400000; +pub const O_TRUNC: ::c_int = 0o00001000; +pub const O_NOATIME: ::c_int = 0o1000000; +pub const O_CLOEXEC: ::c_int = 0o02000000; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; +pub const O_APPEND: ::c_int = 0o00002000; +pub const O_CREAT: ::c_int = 0o00000100; +pub const O_EXCL: ::c_int = 0o00000200; +pub const O_NOCTTY: ::c_int = 0o00000400; +pub const O_NONBLOCK: ::c_int = 0o00004000; +pub const FASYNC: ::c_int = 0o00020000; +pub const O_SYNC: ::c_int = 0o04010000; +pub const O_RSYNC: ::c_int = 0o04010000; +pub const O_FSYNC: ::c_int = O_SYNC; +pub const O_ASYNC: ::c_int = 0o00020000; +pub const O_DSYNC: ::c_int = 0o00010000; +pub const O_NDELAY: ::c_int = O_NONBLOCK; +pub const F_RDLCK: ::c_int = 0; +pub const F_WRLCK: ::c_int = 1; +pub const F_UNLCK: ::c_int = 2; +pub const F_GETLK: ::c_int = 5; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_SETOWN: ::c_int = 8; +pub const F_GETOWN: ::c_int = 9; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const EDEADLK: ::c_int = 35; +pub const EDEADLOCK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const ERFKILL: ::c_int = 132; +pub const EHWPOISON: ::c_int = 133; + +pub const MAP_NORESERVE: ::c_int = 0x4000; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x1000; +pub const MAP_LOCKED: ::c_int = 0x2000; +pub const MAP_POPULATE: ::c_int = 0x8000; +pub const MAP_NONBLOCK: ::c_int = 0x10000; +pub const MAP_STACK: ::c_int = 0x20000; +pub const MAP_HUGETLB: ::c_int = 0x40000; +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; +pub const MCL_ONFAULT: ::c_int = 0x0004; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const SFD_NONBLOCK: ::c_int = 0x800; +pub const SFD_CLOEXEC: ::c_int = 0x080000; +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; +pub const SIG_BLOCK: ::c_int = 0; +pub const SIG_UNBLOCK: ::c_int = 1; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGCHLD: ::c_int = 17; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGURG: ::c_int = 23; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGIO: ::c_int = 29; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIGSYS: ::c_int = 31; +pub const SIGUNUSED: ::c_int = 31; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const PTRACE_GETFPREGS: ::c_uint = 14; +pub const PTRACE_SETFPREGS: ::c_uint = 15; +pub const PTRACE_DETACH: ::c_uint = 17; +pub const PTRACE_GETFPXREGS: ::c_uint = 18; +pub const PTRACE_SETFPXREGS: ::c_uint = 19; +pub const PTRACE_GETREGS: ::c_uint = 12; +pub const PTRACE_SETREGS: ::c_uint = 13; + +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; + +pub const VEOF: usize = 4; +pub const VTIME: usize = 5; +pub const VMIN: usize = 6; +pub const VSWTC: usize = 7; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VSUSP: usize = 10; +pub const VEOL: usize = 11; +pub const VREPRINT: usize = 12; +pub const VDISCARD: usize = 13; +pub const VWERASE: usize = 14; +pub const VEOL2: usize = 16; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; +pub const EXTPROC: ::tcflag_t = 0x00010000; +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; + +pub const NCCS: usize = 32; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +pub const EFD_CLOEXEC: ::c_int = 0x80000; +pub const EFD_NONBLOCK: ::c_int = 0x800; + +extern "C" { + pub fn sysctl( + name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..7ca870fd02b71e31e44439e3fabdf1386eb75bb9 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 4] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..cac215dc43ebc4d4b51bcff23fbf29ca4321ce8f --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs @@ -0,0 +1,923 @@ +use pthread_mutex_t; + +pub type blksize_t = i64; +pub type c_char = i8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type nlink_t = u64; +pub type suseconds_t = i64; +pub type wchar_t = i32; +pub type __u64 = ::c_ulong; +pub type __s64 = ::c_long; + +s! { + pub struct stat { + pub st_dev: ::c_ulong, + st_pad1: [::c_long; 2], + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::c_ulong, + st_pad2: [::c_ulong; 1], + pub st_size: ::off_t, + st_pad3: ::c_long, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + st_pad4: ::c_long, + pub st_blocks: ::blkcnt_t, + st_pad5: [::c_long; 7], + } + + pub struct statfs { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_frsize: ::c_long, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_files: ::fsblkcnt_t, + pub f_ffree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::c_long, + f_spare: [::c_long; 6], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct stat64 { + pub st_dev: ::c_ulong, + st_pad1: [::c_long; 2], + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::c_ulong, + st_pad2: [::c_long; 2], + pub st_size: ::off64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + st_pad3: ::c_long, + pub st_blocks: ::blkcnt64_t, + st_pad5: [::c_long; 7], + } + + pub struct statfs64 { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_frsize: ::c_long, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_bavail: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_long, + pub f_flags: ::c_long, + pub f_spare: [::c_long; 5], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct pthread_attr_t { + __size: [::c_ulong; 7] + } + + pub struct sigaction { + pub sa_flags: ::c_int, + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_restorer: ::Option, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_code: ::c_int, + pub si_errno: ::c_int, + _pad: ::c_int, + _pad2: [::c_long; 14], + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_uint, + pub __seq: ::c_ushort, + __pad1: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong + } +} + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + +align_const! { + #[cfg(target_endian = "little")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +} + +pub const SYS_read: ::c_long = 5000 + 0; +pub const SYS_write: ::c_long = 5000 + 1; +pub const SYS_open: ::c_long = 5000 + 2; +pub const SYS_close: ::c_long = 5000 + 3; +pub const SYS_stat: ::c_long = 5000 + 4; +pub const SYS_fstat: ::c_long = 5000 + 5; +pub const SYS_lstat: ::c_long = 5000 + 6; +pub const SYS_poll: ::c_long = 5000 + 7; +pub const SYS_lseek: ::c_long = 5000 + 8; +pub const SYS_mmap: ::c_long = 5000 + 9; +pub const SYS_mprotect: ::c_long = 5000 + 10; +pub const SYS_munmap: ::c_long = 5000 + 11; +pub const SYS_brk: ::c_long = 5000 + 12; +pub const SYS_rt_sigaction: ::c_long = 5000 + 13; +pub const SYS_rt_sigprocmask: ::c_long = 5000 + 14; +pub const SYS_ioctl: ::c_long = 5000 + 15; +pub const SYS_pread64: ::c_long = 5000 + 16; +pub const SYS_pwrite64: ::c_long = 5000 + 17; +pub const SYS_readv: ::c_long = 5000 + 18; +pub const SYS_writev: ::c_long = 5000 + 19; +pub const SYS_access: ::c_long = 5000 + 20; +pub const SYS_pipe: ::c_long = 5000 + 21; +pub const SYS__newselect: ::c_long = 5000 + 22; +pub const SYS_sched_yield: ::c_long = 5000 + 23; +pub const SYS_mremap: ::c_long = 5000 + 24; +pub const SYS_msync: ::c_long = 5000 + 25; +pub const SYS_mincore: ::c_long = 5000 + 26; +pub const SYS_madvise: ::c_long = 5000 + 27; +pub const SYS_shmget: ::c_long = 5000 + 28; +pub const SYS_shmat: ::c_long = 5000 + 29; +pub const SYS_shmctl: ::c_long = 5000 + 30; +pub const SYS_dup: ::c_long = 5000 + 31; +pub const SYS_dup2: ::c_long = 5000 + 32; +pub const SYS_pause: ::c_long = 5000 + 33; +pub const SYS_nanosleep: ::c_long = 5000 + 34; +pub const SYS_getitimer: ::c_long = 5000 + 35; +pub const SYS_setitimer: ::c_long = 5000 + 36; +pub const SYS_alarm: ::c_long = 5000 + 37; +pub const SYS_getpid: ::c_long = 5000 + 38; +pub const SYS_sendfile: ::c_long = 5000 + 39; +pub const SYS_socket: ::c_long = 5000 + 40; +pub const SYS_connect: ::c_long = 5000 + 41; +pub const SYS_accept: ::c_long = 5000 + 42; +pub const SYS_sendto: ::c_long = 5000 + 43; +pub const SYS_recvfrom: ::c_long = 5000 + 44; +pub const SYS_sendmsg: ::c_long = 5000 + 45; +pub const SYS_recvmsg: ::c_long = 5000 + 46; +pub const SYS_shutdown: ::c_long = 5000 + 47; +pub const SYS_bind: ::c_long = 5000 + 48; +pub const SYS_listen: ::c_long = 5000 + 49; +pub const SYS_getsockname: ::c_long = 5000 + 50; +pub const SYS_getpeername: ::c_long = 5000 + 51; +pub const SYS_socketpair: ::c_long = 5000 + 52; +pub const SYS_setsockopt: ::c_long = 5000 + 53; +pub const SYS_getsockopt: ::c_long = 5000 + 54; +pub const SYS_clone: ::c_long = 5000 + 55; +pub const SYS_fork: ::c_long = 5000 + 56; +pub const SYS_execve: ::c_long = 5000 + 57; +pub const SYS_exit: ::c_long = 5000 + 58; +pub const SYS_wait4: ::c_long = 5000 + 59; +pub const SYS_kill: ::c_long = 5000 + 60; +pub const SYS_uname: ::c_long = 5000 + 61; +pub const SYS_semget: ::c_long = 5000 + 62; +pub const SYS_semop: ::c_long = 5000 + 63; +pub const SYS_semctl: ::c_long = 5000 + 64; +pub const SYS_shmdt: ::c_long = 5000 + 65; +pub const SYS_msgget: ::c_long = 5000 + 66; +pub const SYS_msgsnd: ::c_long = 5000 + 67; +pub const SYS_msgrcv: ::c_long = 5000 + 68; +pub const SYS_msgctl: ::c_long = 5000 + 69; +pub const SYS_fcntl: ::c_long = 5000 + 70; +pub const SYS_flock: ::c_long = 5000 + 71; +pub const SYS_fsync: ::c_long = 5000 + 72; +pub const SYS_fdatasync: ::c_long = 5000 + 73; +pub const SYS_truncate: ::c_long = 5000 + 74; +pub const SYS_ftruncate: ::c_long = 5000 + 75; +pub const SYS_getdents: ::c_long = 5000 + 76; +pub const SYS_getcwd: ::c_long = 5000 + 77; +pub const SYS_chdir: ::c_long = 5000 + 78; +pub const SYS_fchdir: ::c_long = 5000 + 79; +pub const SYS_rename: ::c_long = 5000 + 80; +pub const SYS_mkdir: ::c_long = 5000 + 81; +pub const SYS_rmdir: ::c_long = 5000 + 82; +pub const SYS_creat: ::c_long = 5000 + 83; +pub const SYS_link: ::c_long = 5000 + 84; +pub const SYS_unlink: ::c_long = 5000 + 85; +pub const SYS_symlink: ::c_long = 5000 + 86; +pub const SYS_readlink: ::c_long = 5000 + 87; +pub const SYS_chmod: ::c_long = 5000 + 88; +pub const SYS_fchmod: ::c_long = 5000 + 89; +pub const SYS_chown: ::c_long = 5000 + 90; +pub const SYS_fchown: ::c_long = 5000 + 91; +pub const SYS_lchown: ::c_long = 5000 + 92; +pub const SYS_umask: ::c_long = 5000 + 93; +pub const SYS_gettimeofday: ::c_long = 5000 + 94; +pub const SYS_getrlimit: ::c_long = 5000 + 95; +pub const SYS_getrusage: ::c_long = 5000 + 96; +pub const SYS_sysinfo: ::c_long = 5000 + 97; +pub const SYS_times: ::c_long = 5000 + 98; +pub const SYS_ptrace: ::c_long = 5000 + 99; +pub const SYS_getuid: ::c_long = 5000 + 100; +pub const SYS_syslog: ::c_long = 5000 + 101; +pub const SYS_getgid: ::c_long = 5000 + 102; +pub const SYS_setuid: ::c_long = 5000 + 103; +pub const SYS_setgid: ::c_long = 5000 + 104; +pub const SYS_geteuid: ::c_long = 5000 + 105; +pub const SYS_getegid: ::c_long = 5000 + 106; +pub const SYS_setpgid: ::c_long = 5000 + 107; +pub const SYS_getppid: ::c_long = 5000 + 108; +pub const SYS_getpgrp: ::c_long = 5000 + 109; +pub const SYS_setsid: ::c_long = 5000 + 110; +pub const SYS_setreuid: ::c_long = 5000 + 111; +pub const SYS_setregid: ::c_long = 5000 + 112; +pub const SYS_getgroups: ::c_long = 5000 + 113; +pub const SYS_setgroups: ::c_long = 5000 + 114; +pub const SYS_setresuid: ::c_long = 5000 + 115; +pub const SYS_getresuid: ::c_long = 5000 + 116; +pub const SYS_setresgid: ::c_long = 5000 + 117; +pub const SYS_getresgid: ::c_long = 5000 + 118; +pub const SYS_getpgid: ::c_long = 5000 + 119; +pub const SYS_setfsuid: ::c_long = 5000 + 120; +pub const SYS_setfsgid: ::c_long = 5000 + 121; +pub const SYS_getsid: ::c_long = 5000 + 122; +pub const SYS_capget: ::c_long = 5000 + 123; +pub const SYS_capset: ::c_long = 5000 + 124; +pub const SYS_rt_sigpending: ::c_long = 5000 + 125; +pub const SYS_rt_sigtimedwait: ::c_long = 5000 + 126; +pub const SYS_rt_sigqueueinfo: ::c_long = 5000 + 127; +pub const SYS_rt_sigsuspend: ::c_long = 5000 + 128; +pub const SYS_sigaltstack: ::c_long = 5000 + 129; +pub const SYS_utime: ::c_long = 5000 + 130; +pub const SYS_mknod: ::c_long = 5000 + 131; +pub const SYS_personality: ::c_long = 5000 + 132; +pub const SYS_ustat: ::c_long = 5000 + 133; +pub const SYS_statfs: ::c_long = 5000 + 134; +pub const SYS_fstatfs: ::c_long = 5000 + 135; +pub const SYS_sysfs: ::c_long = 5000 + 136; +pub const SYS_getpriority: ::c_long = 5000 + 137; +pub const SYS_setpriority: ::c_long = 5000 + 138; +pub const SYS_sched_setparam: ::c_long = 5000 + 139; +pub const SYS_sched_getparam: ::c_long = 5000 + 140; +pub const SYS_sched_setscheduler: ::c_long = 5000 + 141; +pub const SYS_sched_getscheduler: ::c_long = 5000 + 142; +pub const SYS_sched_get_priority_max: ::c_long = 5000 + 143; +pub const SYS_sched_get_priority_min: ::c_long = 5000 + 144; +pub const SYS_sched_rr_get_interval: ::c_long = 5000 + 145; +pub const SYS_mlock: ::c_long = 5000 + 146; +pub const SYS_munlock: ::c_long = 5000 + 147; +pub const SYS_mlockall: ::c_long = 5000 + 148; +pub const SYS_munlockall: ::c_long = 5000 + 149; +pub const SYS_vhangup: ::c_long = 5000 + 150; +pub const SYS_pivot_root: ::c_long = 5000 + 151; +pub const SYS__sysctl: ::c_long = 5000 + 152; +pub const SYS_prctl: ::c_long = 5000 + 153; +pub const SYS_adjtimex: ::c_long = 5000 + 154; +pub const SYS_setrlimit: ::c_long = 5000 + 155; +pub const SYS_chroot: ::c_long = 5000 + 156; +pub const SYS_sync: ::c_long = 5000 + 157; +pub const SYS_acct: ::c_long = 5000 + 158; +pub const SYS_settimeofday: ::c_long = 5000 + 159; +pub const SYS_mount: ::c_long = 5000 + 160; +pub const SYS_umount2: ::c_long = 5000 + 161; +pub const SYS_swapon: ::c_long = 5000 + 162; +pub const SYS_swapoff: ::c_long = 5000 + 163; +pub const SYS_reboot: ::c_long = 5000 + 164; +pub const SYS_sethostname: ::c_long = 5000 + 165; +pub const SYS_setdomainname: ::c_long = 5000 + 166; +pub const SYS_create_module: ::c_long = 5000 + 167; +pub const SYS_init_module: ::c_long = 5000 + 168; +pub const SYS_delete_module: ::c_long = 5000 + 169; +pub const SYS_get_kernel_syms: ::c_long = 5000 + 170; +pub const SYS_query_module: ::c_long = 5000 + 171; +pub const SYS_quotactl: ::c_long = 5000 + 172; +pub const SYS_nfsservctl: ::c_long = 5000 + 173; +pub const SYS_getpmsg: ::c_long = 5000 + 174; +pub const SYS_putpmsg: ::c_long = 5000 + 175; +pub const SYS_afs_syscall: ::c_long = 5000 + 176; +pub const SYS_gettid: ::c_long = 5000 + 178; +pub const SYS_readahead: ::c_long = 5000 + 179; +pub const SYS_setxattr: ::c_long = 5000 + 180; +pub const SYS_lsetxattr: ::c_long = 5000 + 181; +pub const SYS_fsetxattr: ::c_long = 5000 + 182; +pub const SYS_getxattr: ::c_long = 5000 + 183; +pub const SYS_lgetxattr: ::c_long = 5000 + 184; +pub const SYS_fgetxattr: ::c_long = 5000 + 185; +pub const SYS_listxattr: ::c_long = 5000 + 186; +pub const SYS_llistxattr: ::c_long = 5000 + 187; +pub const SYS_flistxattr: ::c_long = 5000 + 188; +pub const SYS_removexattr: ::c_long = 5000 + 189; +pub const SYS_lremovexattr: ::c_long = 5000 + 190; +pub const SYS_fremovexattr: ::c_long = 5000 + 191; +pub const SYS_tkill: ::c_long = 5000 + 192; +pub const SYS_futex: ::c_long = 5000 + 194; +pub const SYS_sched_setaffinity: ::c_long = 5000 + 195; +pub const SYS_sched_getaffinity: ::c_long = 5000 + 196; +pub const SYS_cacheflush: ::c_long = 5000 + 197; +pub const SYS_cachectl: ::c_long = 5000 + 198; +pub const SYS_sysmips: ::c_long = 5000 + 199; +pub const SYS_io_setup: ::c_long = 5000 + 200; +pub const SYS_io_destroy: ::c_long = 5000 + 201; +pub const SYS_io_getevents: ::c_long = 5000 + 202; +pub const SYS_io_submit: ::c_long = 5000 + 203; +pub const SYS_io_cancel: ::c_long = 5000 + 204; +pub const SYS_exit_group: ::c_long = 5000 + 205; +pub const SYS_lookup_dcookie: ::c_long = 5000 + 206; +pub const SYS_epoll_create: ::c_long = 5000 + 207; +pub const SYS_epoll_ctl: ::c_long = 5000 + 208; +pub const SYS_epoll_wait: ::c_long = 5000 + 209; +pub const SYS_remap_file_pages: ::c_long = 5000 + 210; +pub const SYS_rt_sigreturn: ::c_long = 5000 + 211; +pub const SYS_set_tid_address: ::c_long = 5000 + 212; +pub const SYS_restart_syscall: ::c_long = 5000 + 213; +pub const SYS_semtimedop: ::c_long = 5000 + 214; +pub const SYS_fadvise64: ::c_long = 5000 + 215; +pub const SYS_timer_create: ::c_long = 5000 + 216; +pub const SYS_timer_settime: ::c_long = 5000 + 217; +pub const SYS_timer_gettime: ::c_long = 5000 + 218; +pub const SYS_timer_getoverrun: ::c_long = 5000 + 219; +pub const SYS_timer_delete: ::c_long = 5000 + 220; +pub const SYS_clock_settime: ::c_long = 5000 + 221; +pub const SYS_clock_gettime: ::c_long = 5000 + 222; +pub const SYS_clock_getres: ::c_long = 5000 + 223; +pub const SYS_clock_nanosleep: ::c_long = 5000 + 224; +pub const SYS_tgkill: ::c_long = 5000 + 225; +pub const SYS_utimes: ::c_long = 5000 + 226; +pub const SYS_mbind: ::c_long = 5000 + 227; +pub const SYS_get_mempolicy: ::c_long = 5000 + 228; +pub const SYS_set_mempolicy: ::c_long = 5000 + 229; +pub const SYS_mq_open: ::c_long = 5000 + 230; +pub const SYS_mq_unlink: ::c_long = 5000 + 231; +pub const SYS_mq_timedsend: ::c_long = 5000 + 232; +pub const SYS_mq_timedreceive: ::c_long = 5000 + 233; +pub const SYS_mq_notify: ::c_long = 5000 + 234; +pub const SYS_mq_getsetattr: ::c_long = 5000 + 235; +pub const SYS_vserver: ::c_long = 5000 + 236; +pub const SYS_waitid: ::c_long = 5000 + 237; +/* pub const SYS_sys_setaltroot: ::c_long = 5000 + 238; */ +pub const SYS_add_key: ::c_long = 5000 + 239; +pub const SYS_request_key: ::c_long = 5000 + 240; +pub const SYS_keyctl: ::c_long = 5000 + 241; +pub const SYS_set_thread_area: ::c_long = 5000 + 242; +pub const SYS_inotify_init: ::c_long = 5000 + 243; +pub const SYS_inotify_add_watch: ::c_long = 5000 + 244; +pub const SYS_inotify_rm_watch: ::c_long = 5000 + 245; +pub const SYS_migrate_pages: ::c_long = 5000 + 246; +pub const SYS_openat: ::c_long = 5000 + 247; +pub const SYS_mkdirat: ::c_long = 5000 + 248; +pub const SYS_mknodat: ::c_long = 5000 + 249; +pub const SYS_fchownat: ::c_long = 5000 + 250; +pub const SYS_futimesat: ::c_long = 5000 + 251; +pub const SYS_newfstatat: ::c_long = 5000 + 252; +pub const SYS_unlinkat: ::c_long = 5000 + 253; +pub const SYS_renameat: ::c_long = 5000 + 254; +pub const SYS_linkat: ::c_long = 5000 + 255; +pub const SYS_symlinkat: ::c_long = 5000 + 256; +pub const SYS_readlinkat: ::c_long = 5000 + 257; +pub const SYS_fchmodat: ::c_long = 5000 + 258; +pub const SYS_faccessat: ::c_long = 5000 + 259; +pub const SYS_pselect6: ::c_long = 5000 + 260; +pub const SYS_ppoll: ::c_long = 5000 + 261; +pub const SYS_unshare: ::c_long = 5000 + 262; +pub const SYS_splice: ::c_long = 5000 + 263; +pub const SYS_sync_file_range: ::c_long = 5000 + 264; +pub const SYS_tee: ::c_long = 5000 + 265; +pub const SYS_vmsplice: ::c_long = 5000 + 266; +pub const SYS_move_pages: ::c_long = 5000 + 267; +pub const SYS_set_robust_list: ::c_long = 5000 + 268; +pub const SYS_get_robust_list: ::c_long = 5000 + 269; +pub const SYS_kexec_load: ::c_long = 5000 + 270; +pub const SYS_getcpu: ::c_long = 5000 + 271; +pub const SYS_epoll_pwait: ::c_long = 5000 + 272; +pub const SYS_ioprio_set: ::c_long = 5000 + 273; +pub const SYS_ioprio_get: ::c_long = 5000 + 274; +pub const SYS_utimensat: ::c_long = 5000 + 275; +pub const SYS_signalfd: ::c_long = 5000 + 276; +pub const SYS_timerfd: ::c_long = 5000 + 277; +pub const SYS_eventfd: ::c_long = 5000 + 278; +pub const SYS_fallocate: ::c_long = 5000 + 279; +pub const SYS_timerfd_create: ::c_long = 5000 + 280; +pub const SYS_timerfd_gettime: ::c_long = 5000 + 281; +pub const SYS_timerfd_settime: ::c_long = 5000 + 282; +pub const SYS_signalfd4: ::c_long = 5000 + 283; +pub const SYS_eventfd2: ::c_long = 5000 + 284; +pub const SYS_epoll_create1: ::c_long = 5000 + 285; +pub const SYS_dup3: ::c_long = 5000 + 286; +pub const SYS_pipe2: ::c_long = 5000 + 287; +pub const SYS_inotify_init1: ::c_long = 5000 + 288; +pub const SYS_preadv: ::c_long = 5000 + 289; +pub const SYS_pwritev: ::c_long = 5000 + 290; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 5000 + 291; +pub const SYS_perf_event_open: ::c_long = 5000 + 292; +pub const SYS_accept4: ::c_long = 5000 + 293; +pub const SYS_recvmmsg: ::c_long = 5000 + 294; +pub const SYS_fanotify_init: ::c_long = 5000 + 295; +pub const SYS_fanotify_mark: ::c_long = 5000 + 296; +pub const SYS_prlimit64: ::c_long = 5000 + 297; +pub const SYS_name_to_handle_at: ::c_long = 5000 + 298; +pub const SYS_open_by_handle_at: ::c_long = 5000 + 299; +pub const SYS_clock_adjtime: ::c_long = 5000 + 300; +pub const SYS_syncfs: ::c_long = 5000 + 301; +pub const SYS_sendmmsg: ::c_long = 5000 + 302; +pub const SYS_setns: ::c_long = 5000 + 303; +pub const SYS_process_vm_readv: ::c_long = 5000 + 304; +pub const SYS_process_vm_writev: ::c_long = 5000 + 305; +pub const SYS_kcmp: ::c_long = 5000 + 306; +pub const SYS_finit_module: ::c_long = 5000 + 307; +pub const SYS_getdents64: ::c_long = 5000 + 308; +pub const SYS_sched_setattr: ::c_long = 5000 + 309; +pub const SYS_sched_getattr: ::c_long = 5000 + 310; +pub const SYS_renameat2: ::c_long = 5000 + 311; +pub const SYS_seccomp: ::c_long = 5000 + 312; +pub const SYS_getrandom: ::c_long = 5000 + 313; +pub const SYS_memfd_create: ::c_long = 5000 + 314; +pub const SYS_bpf: ::c_long = 5000 + 315; +pub const SYS_execveat: ::c_long = 5000 + 316; +pub const SYS_userfaultfd: ::c_long = 5000 + 317; +pub const SYS_membarrier: ::c_long = 5000 + 318; +pub const SYS_mlock2: ::c_long = 5000 + 319; +pub const SYS_copy_file_range: ::c_long = 5000 + 320; +pub const SYS_preadv2: ::c_long = 5000 + 321; +pub const SYS_pwritev2: ::c_long = 5000 + 322; +pub const SYS_pkey_mprotect: ::c_long = 5000 + 323; +pub const SYS_pkey_alloc: ::c_long = 5000 + 324; +pub const SYS_pkey_free: ::c_long = 5000 + 325; +pub const SYS_statx: ::c_long = 5000 + 326; +pub const SYS_rseq: ::c_long = 5000 + 327; +pub const SYS_pidfd_send_signal: ::c_long = 5000 + 424; +pub const SYS_io_uring_setup: ::c_long = 5000 + 425; +pub const SYS_io_uring_enter: ::c_long = 5000 + 426; +pub const SYS_io_uring_register: ::c_long = 5000 + 427; +pub const SYS_open_tree: ::c_long = 5000 + 428; +pub const SYS_move_mount: ::c_long = 5000 + 429; +pub const SYS_fsopen: ::c_long = 5000 + 430; +pub const SYS_fsconfig: ::c_long = 5000 + 431; +pub const SYS_fsmount: ::c_long = 5000 + 432; +pub const SYS_fspick: ::c_long = 5000 + 433; +pub const SYS_pidfd_open: ::c_long = 5000 + 434; +pub const SYS_clone3: ::c_long = 5000 + 435; +pub const SYS_close_range: ::c_long = 5000 + 436; +pub const SYS_openat2: ::c_long = 5000 + 437; +pub const SYS_pidfd_getfd: ::c_long = 5000 + 438; +pub const SYS_faccessat2: ::c_long = 5000 + 439; +pub const SYS_process_madvise: ::c_long = 5000 + 440; +pub const SYS_epoll_pwait2: ::c_long = 5000 + 441; +pub const SYS_mount_setattr: ::c_long = 5000 + 442; + +pub const SFD_CLOEXEC: ::c_int = 0x080000; + +pub const NCCS: usize = 32; + +pub const O_TRUNC: ::c_int = 512; + +pub const O_NOATIME: ::c_int = 0o1000000; +pub const O_CLOEXEC: ::c_int = 0x80000; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; + +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; + +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +pub const EFD_CLOEXEC: ::c_int = 0x80000; + +pub const O_DIRECT: ::c_int = 0x8000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; + +pub const O_APPEND: ::c_int = 8; +pub const O_CREAT: ::c_int = 256; +pub const O_EXCL: ::c_int = 1024; +pub const O_NOCTTY: ::c_int = 2048; +pub const O_NONBLOCK: ::c_int = 128; +pub const O_SYNC: ::c_int = 0x4010; +pub const O_RSYNC: ::c_int = 0x4010; +pub const O_DSYNC: ::c_int = 0x10; +pub const O_FSYNC: ::c_int = 0x4010; +pub const O_ASYNC: ::c_int = 0x1000; +pub const O_NDELAY: ::c_int = 0x80; + +pub const EDEADLK: ::c_int = 45; +pub const ENAMETOOLONG: ::c_int = 78; +pub const ENOLCK: ::c_int = 46; +pub const ENOSYS: ::c_int = 89; +pub const ENOTEMPTY: ::c_int = 93; +pub const ELOOP: ::c_int = 90; +pub const ENOMSG: ::c_int = 35; +pub const EIDRM: ::c_int = 36; +pub const ECHRNG: ::c_int = 37; +pub const EL2NSYNC: ::c_int = 38; +pub const EL3HLT: ::c_int = 39; +pub const EL3RST: ::c_int = 40; +pub const ELNRNG: ::c_int = 41; +pub const EUNATCH: ::c_int = 42; +pub const ENOCSI: ::c_int = 43; +pub const EL2HLT: ::c_int = 44; +pub const EBADE: ::c_int = 50; +pub const EBADR: ::c_int = 51; +pub const EXFULL: ::c_int = 52; +pub const ENOANO: ::c_int = 53; +pub const EBADRQC: ::c_int = 54; +pub const EBADSLT: ::c_int = 55; +pub const EDEADLOCK: ::c_int = 56; +pub const EMULTIHOP: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 79; +pub const ENOTUNIQ: ::c_int = 80; +pub const EBADFD: ::c_int = 81; +pub const EBADMSG: ::c_int = 77; +pub const EREMCHG: ::c_int = 82; +pub const ELIBACC: ::c_int = 83; +pub const ELIBBAD: ::c_int = 84; +pub const ELIBSCN: ::c_int = 85; +pub const ELIBMAX: ::c_int = 86; +pub const ELIBEXEC: ::c_int = 87; +pub const EILSEQ: ::c_int = 88; +pub const ERESTART: ::c_int = 91; +pub const ESTRPIPE: ::c_int = 92; +pub const EUSERS: ::c_int = 94; +pub const ENOTSOCK: ::c_int = 95; +pub const EDESTADDRREQ: ::c_int = 96; +pub const EMSGSIZE: ::c_int = 97; +pub const EPROTOTYPE: ::c_int = 98; +pub const ENOPROTOOPT: ::c_int = 99; +pub const EPROTONOSUPPORT: ::c_int = 120; +pub const ESOCKTNOSUPPORT: ::c_int = 121; +pub const EOPNOTSUPP: ::c_int = 122; +pub const EPFNOSUPPORT: ::c_int = 123; +pub const EAFNOSUPPORT: ::c_int = 124; +pub const EADDRINUSE: ::c_int = 125; +pub const EADDRNOTAVAIL: ::c_int = 126; +pub const ENETDOWN: ::c_int = 127; +pub const ENETUNREACH: ::c_int = 128; +pub const ENETRESET: ::c_int = 129; +pub const ECONNABORTED: ::c_int = 130; +pub const ECONNRESET: ::c_int = 131; +pub const ENOBUFS: ::c_int = 132; +pub const EISCONN: ::c_int = 133; +pub const ENOTCONN: ::c_int = 134; +pub const ESHUTDOWN: ::c_int = 143; +pub const ETOOMANYREFS: ::c_int = 144; +pub const ETIMEDOUT: ::c_int = 145; +pub const ECONNREFUSED: ::c_int = 146; +pub const EHOSTDOWN: ::c_int = 147; +pub const EHOSTUNREACH: ::c_int = 148; +pub const EALREADY: ::c_int = 149; +pub const EINPROGRESS: ::c_int = 150; +pub const ESTALE: ::c_int = 151; +pub const EUCLEAN: ::c_int = 135; +pub const ENOTNAM: ::c_int = 137; +pub const ENAVAIL: ::c_int = 138; +pub const EISNAM: ::c_int = 139; +pub const EREMOTEIO: ::c_int = 140; +pub const EDQUOT: ::c_int = 1133; +pub const ENOMEDIUM: ::c_int = 159; +pub const EMEDIUMTYPE: ::c_int = 160; +pub const ECANCELED: ::c_int = 158; +pub const ENOKEY: ::c_int = 161; +pub const EKEYEXPIRED: ::c_int = 162; +pub const EKEYREVOKED: ::c_int = 163; +pub const EKEYREJECTED: ::c_int = 164; +pub const EOWNERDEAD: ::c_int = 165; +pub const ENOTRECOVERABLE: ::c_int = 166; +pub const ERFKILL: ::c_int = 167; + +pub const MAP_NORESERVE: ::c_int = 0x400; +pub const MAP_ANON: ::c_int = 0x800; +pub const MAP_ANONYMOUS: ::c_int = 0x800; +pub const MAP_GROWSDOWN: ::c_int = 0x1000; +pub const MAP_DENYWRITE: ::c_int = 0x2000; +pub const MAP_EXECUTABLE: ::c_int = 0x4000; +pub const MAP_LOCKED: ::c_int = 0x8000; +pub const MAP_POPULATE: ::c_int = 0x10000; +pub const MAP_NONBLOCK: ::c_int = 0x20000; +pub const MAP_STACK: ::c_int = 0x40000; +pub const MAP_HUGETLB: ::c_int = 0x080000; + +pub const SOCK_STREAM: ::c_int = 2; +pub const SOCK_DGRAM: ::c_int = 1; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000008; +pub const SA_NOCLDWAIT: ::c_int = 0x00010000; + +pub const SIGCHLD: ::c_int = 18; +pub const SIGBUS: ::c_int = 10; +pub const SIGTTIN: ::c_int = 26; +pub const SIGTTOU: ::c_int = 27; +pub const SIGXCPU: ::c_int = 30; +pub const SIGXFSZ: ::c_int = 31; +pub const SIGVTALRM: ::c_int = 28; +pub const SIGPROF: ::c_int = 29; +pub const SIGWINCH: ::c_int = 20; +pub const SIGUSR1: ::c_int = 16; +pub const SIGUSR2: ::c_int = 17; +pub const SIGCONT: ::c_int = 25; +pub const SIGSTOP: ::c_int = 23; +pub const SIGTSTP: ::c_int = 24; +pub const SIGURG: ::c_int = 21; +pub const SIGIO: ::c_int = 22; +pub const SIGSYS: ::c_int = 12; +pub const SIGPOLL: ::c_int = 22; +pub const SIGPWR: ::c_int = 19; +pub const SIG_SETMASK: ::c_int = 3; +pub const SIG_BLOCK: ::c_int = 0x1; +pub const SIG_UNBLOCK: ::c_int = 0x2; + +pub const POLLWRNORM: ::c_short = 0x004; +pub const POLLWRBAND: ::c_short = 0x100; + +pub const VEOF: usize = 16; +pub const VEOL: usize = 17; +pub const VEOL2: usize = 6; +pub const VMIN: usize = 4; +pub const IEXTEN: ::tcflag_t = 0x00000100; +pub const TOSTOP: ::tcflag_t = 0x00008000; +pub const FLUSHO: ::tcflag_t = 0x00002000; +pub const EXTPROC: ::tcflag_t = 0o200000; +pub const TCSANOW: ::c_int = 0x540e; +pub const TCSADRAIN: ::c_int = 0x540f; +pub const TCSAFLUSH: ::c_int = 0x5410; + +pub const PTRACE_GETFPREGS: ::c_uint = 14; +pub const PTRACE_SETFPREGS: ::c_uint = 15; +pub const PTRACE_DETACH: ::c_uint = 17; +pub const PTRACE_GETFPXREGS: ::c_uint = 18; +pub const PTRACE_SETFPXREGS: ::c_uint = 19; +pub const PTRACE_GETREGS: ::c_uint = 12; +pub const PTRACE_SETREGS: ::c_uint = 13; + +pub const EFD_NONBLOCK: ::c_int = 0x80; + +pub const F_RDLCK: ::c_int = 0; +pub const F_WRLCK: ::c_int = 1; +pub const F_UNLCK: ::c_int = 2; +pub const F_GETLK: ::c_int = 14; +pub const F_GETOWN: ::c_int = 23; +pub const F_SETOWN: ::c_int = 24; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const SFD_NONBLOCK: ::c_int = 0x80; + +pub const RTLD_DEEPBIND: ::c_int = 0x10; +pub const RTLD_GLOBAL: ::c_int = 0x4; +pub const RTLD_NOLOAD: ::c_int = 0x8; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const EHWPOISON: ::c_int = 168; + +extern "C" { + pub fn sysctl( + name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..443958cff737280c54bcf87fb00037089bf0cb47 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/mod.rs @@ -0,0 +1,126 @@ +//! 64-bit specific definitions for linux-like values + +pub type ino_t = u64; +pub type off_t = i64; +pub type blkcnt_t = i64; +pub type shmatt_t = u64; +pub type msgqnum_t = u64; +pub type msglen_t = u64; +pub type fsblkcnt_t = u64; +pub type fsfilcnt_t = u64; +pub type rlim_t = u64; +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +pub type __syscall_ulong_t = ::c_ulonglong; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +pub type __syscall_ulong_t = ::c_ulong; + +cfg_if! { + if #[cfg(all(target_arch = "aarch64", target_pointer_width = "32"))] { + pub type clock_t = i32; + pub type time_t = i32; + pub type __fsword_t = i32; + } else { + pub type __fsword_t = i64; + pub type clock_t = i64; + pub type time_t = i64; + } +} + +s! { + pub struct sigset_t { + #[cfg(target_pointer_width = "32")] + __val: [u32; 32], + #[cfg(target_pointer_width = "64")] + __val: [u64; 16], + } + + pub struct sysinfo { + pub uptime: i64, + pub loads: [u64; 3], + pub totalram: u64, + pub freeram: u64, + pub sharedram: u64, + pub bufferram: u64, + pub totalswap: u64, + pub freeswap: u64, + pub procs: ::c_ushort, + pub pad: ::c_ushort, + pub totalhigh: u64, + pub freehigh: u64, + pub mem_unit: ::c_uint, + pub _f: [::c_char; 0], + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + pub msg_rtime: ::time_t, + pub msg_ctime: ::time_t, + __msg_cbytes: u64, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __glibc_reserved4: u64, + __glibc_reserved5: u64, + } + + pub struct semid_ds { + pub sem_perm: ipc_perm, + pub sem_otime: ::time_t, + #[cfg(not(any( + target_arch = "aarch64", + target_arch = "loongarch64", + target_arch = "mips64", + target_arch = "powerpc64", + target_arch = "riscv64", + target_arch = "sparc64")))] + __reserved: ::__syscall_ulong_t, + pub sem_ctime: ::time_t, + #[cfg(not(any( + target_arch = "aarch64", + target_arch = "loongarch64", + target_arch = "mips64", + target_arch = "powerpc64", + target_arch = "riscv64", + target_arch = "sparc64")))] + __reserved2: ::__syscall_ulong_t, + pub sem_nsems: ::__syscall_ulong_t, + __glibc_reserved3: ::__syscall_ulong_t, + __glibc_reserved4: ::__syscall_ulong_t, + } +} + +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; + +pub const O_LARGEFILE: ::c_int = 0; + +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(any(target_arch = "powerpc64"))] { + mod powerpc64; + pub use self::powerpc64::*; + } else if #[cfg(any(target_arch = "sparc64"))] { + mod sparc64; + pub use self::sparc64::*; + } else if #[cfg(any(target_arch = "mips64"))] { + mod mips64; + pub use self::mips64::*; + } else if #[cfg(any(target_arch = "s390x"))] { + mod s390x; + pub use self::s390x::*; + } else if #[cfg(any(target_arch = "x86_64"))] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(any(target_arch = "riscv64"))] { + mod riscv64; + pub use self::riscv64::*; + } else if #[cfg(any(target_arch = "loongarch64"))] { + mod loongarch64; + pub use self::loongarch64::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..29d1e1c7b8a5558fcfa3b8ac333cee3fa9784163 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [i64; 4] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..b5c2687061907563d188832dff25761e0f20c711 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs @@ -0,0 +1,968 @@ +//! PowerPC64-specific definitions for 64-bit linux-like values + +use pthread_mutex_t; + +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = u8; +pub type wchar_t = i32; +pub type nlink_t = u64; +pub type blksize_t = i64; +pub type suseconds_t = i64; +pub type __u64 = ::c_ulong; +pub type __s64 = ::c_long; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + #[cfg(target_arch = "sparc64")] + __reserved0: ::c_int, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct statfs { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + f_spare: [::__fsword_t; 5], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __reserved: [::c_long; 3], + } + + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct pthread_attr_t { + __size: [u64; 7] + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: u32, + __pad1: u32, + __unused1: u64, + __unused2: ::c_ulong, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_segsz: ::size_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } +} + +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const VEOF: usize = 4; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 0x101000; +pub const O_NOATIME: ::c_int = 0o1000000; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; + +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = 31; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_NDELAY: ::c_int = 0x800; + +pub const PTRACE_DETACH: ::c_uint = 17; + +pub const EFD_NONBLOCK: ::c_int = 0x800; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const F_RDLCK: ::c_int = 0; +pub const F_WRLCK: ::c_int = 1; +pub const F_UNLCK: ::c_int = 2; + +pub const SFD_NONBLOCK: ::c_int = 0x0800; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const SFD_CLOEXEC: ::c_int = 0x080000; + +pub const NCCS: usize = 32; + +pub const O_TRUNC: ::c_int = 512; + +pub const O_CLOEXEC: ::c_int = 0x80000; + +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; + +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +pub const EFD_CLOEXEC: ::c_int = 0x80000; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; + +align_const! { + #[cfg(target_endian = "little")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +} + +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_DIRECT: ::c_int = 0x20000; + +pub const MAP_LOCKED: ::c_int = 0x00080; +pub const MAP_NORESERVE: ::c_int = 0x00040; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const EDEADLOCK: ::c_int = 58; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; + +pub const MCL_CURRENT: ::c_int = 0x2000; +pub const MCL_FUTURE: ::c_int = 0x4000; + +pub const SIGSTKSZ: ::size_t = 0x4000; +pub const MINSIGSTKSZ: ::size_t = 4096; +pub const CBAUD: ::tcflag_t = 0xff; +pub const TAB1: ::tcflag_t = 0x400; +pub const TAB2: ::tcflag_t = 0x800; +pub const TAB3: ::tcflag_t = 0xc00; +pub const CR1: ::tcflag_t = 0x1000; +pub const CR2: ::tcflag_t = 0x2000; +pub const CR3: ::tcflag_t = 0x3000; +pub const FF1: ::tcflag_t = 0x4000; +pub const BS1: ::tcflag_t = 0x8000; +pub const VT1: ::tcflag_t = 0x10000; +pub const VWERASE: usize = 0xa; +pub const VREPRINT: usize = 0xb; +pub const VSUSP: usize = 0xc; +pub const VSTART: usize = 0xd; +pub const VSTOP: usize = 0xe; +pub const VDISCARD: usize = 0x10; +pub const VTIME: usize = 0x7; +pub const IXON: ::tcflag_t = 0x200; +pub const IXOFF: ::tcflag_t = 0x400; +pub const ONLCR: ::tcflag_t = 0x2; +pub const CSIZE: ::tcflag_t = 0x300; +pub const CS6: ::tcflag_t = 0x100; +pub const CS7: ::tcflag_t = 0x200; +pub const CS8: ::tcflag_t = 0x300; +pub const CSTOPB: ::tcflag_t = 0x400; +pub const CREAD: ::tcflag_t = 0x800; +pub const PARENB: ::tcflag_t = 0x1000; +pub const PARODD: ::tcflag_t = 0x2000; +pub const HUPCL: ::tcflag_t = 0x4000; +pub const CLOCAL: ::tcflag_t = 0x8000; +pub const ECHOKE: ::tcflag_t = 0x1; +pub const ECHOE: ::tcflag_t = 0x2; +pub const ECHOK: ::tcflag_t = 0x4; +pub const ECHONL: ::tcflag_t = 0x10; +pub const ECHOPRT: ::tcflag_t = 0x20; +pub const ECHOCTL: ::tcflag_t = 0x40; +pub const ISIG: ::tcflag_t = 0x80; +pub const ICANON: ::tcflag_t = 0x100; +pub const PENDIN: ::tcflag_t = 0x20000000; +pub const NOFLSH: ::tcflag_t = 0x80000000; +pub const VSWTC: usize = 9; +pub const OLCUC: ::tcflag_t = 0o000004; +pub const NLDLY: ::tcflag_t = 0o001400; +pub const CRDLY: ::tcflag_t = 0o030000; +pub const TABDLY: ::tcflag_t = 0o006000; +pub const BSDLY: ::tcflag_t = 0o100000; +pub const FFDLY: ::tcflag_t = 0o040000; +pub const VTDLY: ::tcflag_t = 0o200000; +pub const XTABS: ::tcflag_t = 0o006000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const CBAUDEX: ::speed_t = 0o000020; +pub const B57600: ::speed_t = 0o0020; +pub const B115200: ::speed_t = 0o0021; +pub const B230400: ::speed_t = 0o0022; +pub const B460800: ::speed_t = 0o0023; +pub const B500000: ::speed_t = 0o0024; +pub const B576000: ::speed_t = 0o0025; +pub const B921600: ::speed_t = 0o0026; +pub const B1000000: ::speed_t = 0o0027; +pub const B1152000: ::speed_t = 0o0030; +pub const B1500000: ::speed_t = 0o0031; +pub const B2000000: ::speed_t = 0o0032; +pub const B2500000: ::speed_t = 0o0033; +pub const B3000000: ::speed_t = 0o0034; +pub const B3500000: ::speed_t = 0o0035; +pub const B4000000: ::speed_t = 0o0036; + +pub const VEOL: usize = 6; +pub const VEOL2: usize = 8; +pub const VMIN: usize = 5; +pub const IEXTEN: ::tcflag_t = 0x400; +pub const TOSTOP: ::tcflag_t = 0x400000; +pub const FLUSHO: ::tcflag_t = 0x800000; +pub const EXTPROC: ::tcflag_t = 0x10000000; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_waitpid: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_time: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_break: ::c_long = 17; +pub const SYS_oldstat: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_stime: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_oldfstat: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_stty: ::c_long = 31; +pub const SYS_gtty: ::c_long = 32; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_ftime: ::c_long = 35; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_prof: ::c_long = 44; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_lock: ::c_long = 53; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_mpx: ::c_long = 56; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_ulimit: ::c_long = 58; +pub const SYS_oldolduname: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sgetmask: ::c_long = 68; +pub const SYS_ssetmask: ::c_long = 69; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrlimit: ::c_long = 76; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_select: ::c_long = 82; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_oldlstat: ::c_long = 84; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_profil: ::c_long = 98; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_ioperm: ::c_long = 101; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_olduname: ::c_long = 109; +pub const SYS_iopl: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_vm86: ::c_long = 113; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_modify_ldt: ::c_long = 123; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */ +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_query_module: ::c_long = 166; +pub const SYS_poll: ::c_long = 167; +pub const SYS_nfsservctl: ::c_long = 168; +pub const SYS_setresgid: ::c_long = 169; +pub const SYS_getresgid: ::c_long = 170; +pub const SYS_prctl: ::c_long = 171; +pub const SYS_rt_sigreturn: ::c_long = 172; +pub const SYS_rt_sigaction: ::c_long = 173; +pub const SYS_rt_sigprocmask: ::c_long = 174; +pub const SYS_rt_sigpending: ::c_long = 175; +pub const SYS_rt_sigtimedwait: ::c_long = 176; +pub const SYS_rt_sigqueueinfo: ::c_long = 177; +pub const SYS_rt_sigsuspend: ::c_long = 178; +pub const SYS_pread64: ::c_long = 179; +pub const SYS_pwrite64: ::c_long = 180; +pub const SYS_chown: ::c_long = 181; +pub const SYS_getcwd: ::c_long = 182; +pub const SYS_capget: ::c_long = 183; +pub const SYS_capset: ::c_long = 184; +pub const SYS_sigaltstack: ::c_long = 185; +pub const SYS_sendfile: ::c_long = 186; +pub const SYS_getpmsg: ::c_long = 187; /* some people actually want streams */ +pub const SYS_putpmsg: ::c_long = 188; /* some people actually want streams */ +pub const SYS_vfork: ::c_long = 189; +pub const SYS_ugetrlimit: ::c_long = 190; /* SuS compliant getrlimit */ +pub const SYS_readahead: ::c_long = 191; +pub const SYS_pciconfig_read: ::c_long = 198; +pub const SYS_pciconfig_write: ::c_long = 199; +pub const SYS_pciconfig_iobase: ::c_long = 200; +pub const SYS_multiplexer: ::c_long = 201; +pub const SYS_getdents64: ::c_long = 202; +pub const SYS_pivot_root: ::c_long = 203; +pub const SYS_madvise: ::c_long = 205; +pub const SYS_mincore: ::c_long = 206; +pub const SYS_gettid: ::c_long = 207; +pub const SYS_tkill: ::c_long = 208; +pub const SYS_setxattr: ::c_long = 209; +pub const SYS_lsetxattr: ::c_long = 210; +pub const SYS_fsetxattr: ::c_long = 211; +pub const SYS_getxattr: ::c_long = 212; +pub const SYS_lgetxattr: ::c_long = 213; +pub const SYS_fgetxattr: ::c_long = 214; +pub const SYS_listxattr: ::c_long = 215; +pub const SYS_llistxattr: ::c_long = 216; +pub const SYS_flistxattr: ::c_long = 217; +pub const SYS_removexattr: ::c_long = 218; +pub const SYS_lremovexattr: ::c_long = 219; +pub const SYS_fremovexattr: ::c_long = 220; +pub const SYS_futex: ::c_long = 221; +pub const SYS_sched_setaffinity: ::c_long = 222; +pub const SYS_sched_getaffinity: ::c_long = 223; +pub const SYS_tuxcall: ::c_long = 225; +pub const SYS_io_setup: ::c_long = 227; +pub const SYS_io_destroy: ::c_long = 228; +pub const SYS_io_getevents: ::c_long = 229; +pub const SYS_io_submit: ::c_long = 230; +pub const SYS_io_cancel: ::c_long = 231; +pub const SYS_set_tid_address: ::c_long = 232; +pub const SYS_exit_group: ::c_long = 234; +pub const SYS_lookup_dcookie: ::c_long = 235; +pub const SYS_epoll_create: ::c_long = 236; +pub const SYS_epoll_ctl: ::c_long = 237; +pub const SYS_epoll_wait: ::c_long = 238; +pub const SYS_remap_file_pages: ::c_long = 239; +pub const SYS_timer_create: ::c_long = 240; +pub const SYS_timer_settime: ::c_long = 241; +pub const SYS_timer_gettime: ::c_long = 242; +pub const SYS_timer_getoverrun: ::c_long = 243; +pub const SYS_timer_delete: ::c_long = 244; +pub const SYS_clock_settime: ::c_long = 245; +pub const SYS_clock_gettime: ::c_long = 246; +pub const SYS_clock_getres: ::c_long = 247; +pub const SYS_clock_nanosleep: ::c_long = 248; +pub const SYS_swapcontext: ::c_long = 249; +pub const SYS_tgkill: ::c_long = 250; +pub const SYS_utimes: ::c_long = 251; +pub const SYS_statfs64: ::c_long = 252; +pub const SYS_fstatfs64: ::c_long = 253; +pub const SYS_rtas: ::c_long = 255; +pub const SYS_sys_debug_setcontext: ::c_long = 256; +pub const SYS_migrate_pages: ::c_long = 258; +pub const SYS_mbind: ::c_long = 259; +pub const SYS_get_mempolicy: ::c_long = 260; +pub const SYS_set_mempolicy: ::c_long = 261; +pub const SYS_mq_open: ::c_long = 262; +pub const SYS_mq_unlink: ::c_long = 263; +pub const SYS_mq_timedsend: ::c_long = 264; +pub const SYS_mq_timedreceive: ::c_long = 265; +pub const SYS_mq_notify: ::c_long = 266; +pub const SYS_mq_getsetattr: ::c_long = 267; +pub const SYS_kexec_load: ::c_long = 268; +pub const SYS_add_key: ::c_long = 269; +pub const SYS_request_key: ::c_long = 270; +pub const SYS_keyctl: ::c_long = 271; +pub const SYS_waitid: ::c_long = 272; +pub const SYS_ioprio_set: ::c_long = 273; +pub const SYS_ioprio_get: ::c_long = 274; +pub const SYS_inotify_init: ::c_long = 275; +pub const SYS_inotify_add_watch: ::c_long = 276; +pub const SYS_inotify_rm_watch: ::c_long = 277; +pub const SYS_spu_run: ::c_long = 278; +pub const SYS_spu_create: ::c_long = 279; +pub const SYS_pselect6: ::c_long = 280; +pub const SYS_ppoll: ::c_long = 281; +pub const SYS_unshare: ::c_long = 282; +pub const SYS_splice: ::c_long = 283; +pub const SYS_tee: ::c_long = 284; +pub const SYS_vmsplice: ::c_long = 285; +pub const SYS_openat: ::c_long = 286; +pub const SYS_mkdirat: ::c_long = 287; +pub const SYS_mknodat: ::c_long = 288; +pub const SYS_fchownat: ::c_long = 289; +pub const SYS_futimesat: ::c_long = 290; +pub const SYS_newfstatat: ::c_long = 291; +pub const SYS_unlinkat: ::c_long = 292; +pub const SYS_renameat: ::c_long = 293; +pub const SYS_linkat: ::c_long = 294; +pub const SYS_symlinkat: ::c_long = 295; +pub const SYS_readlinkat: ::c_long = 296; +pub const SYS_fchmodat: ::c_long = 297; +pub const SYS_faccessat: ::c_long = 298; +pub const SYS_get_robust_list: ::c_long = 299; +pub const SYS_set_robust_list: ::c_long = 300; +pub const SYS_move_pages: ::c_long = 301; +pub const SYS_getcpu: ::c_long = 302; +pub const SYS_epoll_pwait: ::c_long = 303; +pub const SYS_utimensat: ::c_long = 304; +pub const SYS_signalfd: ::c_long = 305; +pub const SYS_timerfd_create: ::c_long = 306; +pub const SYS_eventfd: ::c_long = 307; +pub const SYS_sync_file_range2: ::c_long = 308; +pub const SYS_fallocate: ::c_long = 309; +pub const SYS_subpage_prot: ::c_long = 310; +pub const SYS_timerfd_settime: ::c_long = 311; +pub const SYS_timerfd_gettime: ::c_long = 312; +pub const SYS_signalfd4: ::c_long = 313; +pub const SYS_eventfd2: ::c_long = 314; +pub const SYS_epoll_create1: ::c_long = 315; +pub const SYS_dup3: ::c_long = 316; +pub const SYS_pipe2: ::c_long = 317; +pub const SYS_inotify_init1: ::c_long = 318; +pub const SYS_perf_event_open: ::c_long = 319; +pub const SYS_preadv: ::c_long = 320; +pub const SYS_pwritev: ::c_long = 321; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 322; +pub const SYS_fanotify_init: ::c_long = 323; +pub const SYS_fanotify_mark: ::c_long = 324; +pub const SYS_prlimit64: ::c_long = 325; +pub const SYS_socket: ::c_long = 326; +pub const SYS_bind: ::c_long = 327; +pub const SYS_connect: ::c_long = 328; +pub const SYS_listen: ::c_long = 329; +pub const SYS_accept: ::c_long = 330; +pub const SYS_getsockname: ::c_long = 331; +pub const SYS_getpeername: ::c_long = 332; +pub const SYS_socketpair: ::c_long = 333; +pub const SYS_send: ::c_long = 334; +pub const SYS_sendto: ::c_long = 335; +pub const SYS_recv: ::c_long = 336; +pub const SYS_recvfrom: ::c_long = 337; +pub const SYS_shutdown: ::c_long = 338; +pub const SYS_setsockopt: ::c_long = 339; +pub const SYS_getsockopt: ::c_long = 340; +pub const SYS_sendmsg: ::c_long = 341; +pub const SYS_recvmsg: ::c_long = 342; +pub const SYS_recvmmsg: ::c_long = 343; +pub const SYS_accept4: ::c_long = 344; +pub const SYS_name_to_handle_at: ::c_long = 345; +pub const SYS_open_by_handle_at: ::c_long = 346; +pub const SYS_clock_adjtime: ::c_long = 347; +pub const SYS_syncfs: ::c_long = 348; +pub const SYS_sendmmsg: ::c_long = 349; +pub const SYS_setns: ::c_long = 350; +pub const SYS_process_vm_readv: ::c_long = 351; +pub const SYS_process_vm_writev: ::c_long = 352; +pub const SYS_finit_module: ::c_long = 353; +pub const SYS_kcmp: ::c_long = 354; +pub const SYS_sched_setattr: ::c_long = 355; +pub const SYS_sched_getattr: ::c_long = 356; +pub const SYS_renameat2: ::c_long = 357; +pub const SYS_seccomp: ::c_long = 358; +pub const SYS_getrandom: ::c_long = 359; +pub const SYS_memfd_create: ::c_long = 360; +pub const SYS_bpf: ::c_long = 361; +pub const SYS_execveat: ::c_long = 362; +pub const SYS_switch_endian: ::c_long = 363; +pub const SYS_userfaultfd: ::c_long = 364; +pub const SYS_membarrier: ::c_long = 365; +pub const SYS_mlock2: ::c_long = 378; +pub const SYS_copy_file_range: ::c_long = 379; +pub const SYS_preadv2: ::c_long = 380; +pub const SYS_pwritev2: ::c_long = 381; +pub const SYS_kexec_file_load: ::c_long = 382; +pub const SYS_statx: ::c_long = 383; +pub const SYS_rseq: ::c_long = 387; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +extern "C" { + pub fn sysctl( + name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..48d152a5721ec7ee762b70b5c4989e6bcc3ad9cf --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/align.rs @@ -0,0 +1,44 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + pub struct ucontext_t { + pub __uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: mcontext_t, + } + + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct mcontext_t { + pub __gregs: [::c_ulong; 32], + pub __fpregs: __riscv_mc_fp_state, + } + + #[allow(missing_debug_implementations)] + pub union __riscv_mc_fp_state { + pub __f: __riscv_mc_f_ext_state, + pub __d: __riscv_mc_d_ext_state, + pub __q: __riscv_mc_q_ext_state, + } + + #[allow(missing_debug_implementations)] + pub struct __riscv_mc_f_ext_state { + pub __f: [::c_uint; 32], + pub __fcsr: ::c_uint, + } + + #[allow(missing_debug_implementations)] + pub struct __riscv_mc_d_ext_state { + pub __f: [::c_ulonglong; 32], + pub __fcsr: ::c_uint, + } + + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct __riscv_mc_q_ext_state { + pub __f: [::c_ulonglong; 64], + pub __fcsr: ::c_uint, + pub __glibc_reserved: [::c_uint; 3], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..f8073902a74d55847083f64d5b9ce7434d319f69 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs @@ -0,0 +1,806 @@ +//! RISC-V-specific definitions for 64-bit linux-like values + +pub type c_char = u8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type wchar_t = ::c_int; + +pub type nlink_t = ::c_uint; +pub type blksize_t = ::c_int; +pub type fsblkcnt64_t = ::c_ulong; +pub type fsfilcnt64_t = ::c_ulong; +pub type suseconds_t = i64; +pub type __u64 = ::c_ulonglong; +pub type __s64 = ::c_longlong; + +s! { + pub struct pthread_attr_t { + __size: [::c_ulong; 7], + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub __pad1: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub __pad2: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2usize], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub __pad1: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub __pad2: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2], + } + + pub struct statfs { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_long, + pub f_frsize: ::c_long, + pub f_flags: ::c_long, + pub f_spare: [::c_long; 4], + } + + pub struct statfs64 { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsfilcnt64_t, + pub f_ffree: ::fsfilcnt64_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_long, + pub f_frsize: ::c_long, + pub f_flags: ::c_long, + pub f_spare: [::c_long; 4], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + pub __f_spare: [::c_int; 6], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsfilcnt64_t, + pub f_ffree: ::fsfilcnt64_t, + pub f_favail: ::fsfilcnt64_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + pub __f_spare: [::c_int; 6], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [u64; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t, + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_ushort, + __pad1: ::c_ushort, + pub __seq: ::c_ushort, + __pad2: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused5: ::c_ulong, + __unused6: ::c_ulong, + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } +} + +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 1052672; +pub const O_NOATIME: ::c_int = 262144; +pub const O_PATH: ::c_int = 2097152; +pub const O_TMPFILE: ::c_int = 4259840; +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_GROWSDOWN: ::c_int = 256; +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SA_ONSTACK: ::c_int = 134217728; +pub const SA_SIGINFO: ::c_int = 4; +pub const SA_NOCLDWAIT: ::c_int = 2; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0; +pub const SIG_UNBLOCK: ::c_int = 1; +pub const POLLWRNORM: ::c_short = 256; +pub const POLLWRBAND: ::c_short = 512; +pub const O_ASYNC: ::c_int = 8192; +pub const O_NDELAY: ::c_int = 2048; +pub const PTRACE_DETACH: ::c_uint = 17; +pub const EFD_NONBLOCK: ::c_int = 2048; +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_RDLCK: ::c_int = 0; +pub const F_WRLCK: ::c_int = 1; +pub const F_UNLCK: ::c_int = 2; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; +pub const SFD_NONBLOCK: ::c_int = 2048; +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; +pub const SFD_CLOEXEC: ::c_int = 524288; +pub const NCCS: usize = 32; +pub const O_TRUNC: ::c_int = 512; +pub const O_CLOEXEC: ::c_int = 524288; +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; +pub const SA_NODEFER: ::c_int = 1073741824; +pub const SA_RESETHAND: ::c_int = -2147483648; +pub const SA_RESTART: ::c_int = 268435456; +pub const SA_NOCLDSTOP: ::c_int = 1; +pub const EPOLL_CLOEXEC: ::c_int = 524288; +pub const EFD_CLOEXEC: ::c_int = 524288; +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const O_DIRECT: ::c_int = 16384; +pub const O_DIRECTORY: ::c_int = 65536; +pub const O_NOFOLLOW: ::c_int = 131072; +pub const MAP_HUGETLB: ::c_int = 262144; +pub const MAP_LOCKED: ::c_int = 8192; +pub const MAP_NORESERVE: ::c_int = 16384; +pub const MAP_ANON: ::c_int = 32; +pub const MAP_ANONYMOUS: ::c_int = 32; +pub const MAP_DENYWRITE: ::c_int = 2048; +pub const MAP_EXECUTABLE: ::c_int = 4096; +pub const MAP_POPULATE: ::c_int = 32768; +pub const MAP_NONBLOCK: ::c_int = 65536; +pub const MAP_STACK: ::c_int = 131072; +pub const MAP_SYNC: ::c_int = 0x080000; +pub const EDEADLOCK: ::c_int = 35; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const PTRACE_GETFPREGS: ::c_uint = 14; +pub const PTRACE_SETFPREGS: ::c_uint = 15; +pub const PTRACE_GETFPXREGS: ::c_uint = 18; +pub const PTRACE_SETFPXREGS: ::c_uint = 19; +pub const PTRACE_GETREGS: ::c_uint = 12; +pub const PTRACE_SETREGS: ::c_uint = 13; +pub const MCL_CURRENT: ::c_int = 1; +pub const MCL_FUTURE: ::c_int = 2; +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 4111; +pub const TAB1: ::tcflag_t = 2048; +pub const TAB2: ::tcflag_t = 4096; +pub const TAB3: ::tcflag_t = 6144; +pub const CR1: ::tcflag_t = 512; +pub const CR2: ::tcflag_t = 1024; +pub const CR3: ::tcflag_t = 1536; +pub const FF1: ::tcflag_t = 32768; +pub const BS1: ::tcflag_t = 8192; +pub const VT1: ::tcflag_t = 16384; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 1024; +pub const IXOFF: ::tcflag_t = 4096; +pub const ONLCR: ::tcflag_t = 4; +pub const CSIZE: ::tcflag_t = 48; +pub const CS6: ::tcflag_t = 16; +pub const CS7: ::tcflag_t = 32; +pub const CS8: ::tcflag_t = 48; +pub const CSTOPB: ::tcflag_t = 64; +pub const CREAD: ::tcflag_t = 128; +pub const PARENB: ::tcflag_t = 256; +pub const PARODD: ::tcflag_t = 512; +pub const HUPCL: ::tcflag_t = 1024; +pub const CLOCAL: ::tcflag_t = 2048; +pub const ECHOKE: ::tcflag_t = 2048; +pub const ECHOE: ::tcflag_t = 16; +pub const ECHOK: ::tcflag_t = 32; +pub const ECHONL: ::tcflag_t = 64; +pub const ECHOPRT: ::tcflag_t = 1024; +pub const ECHOCTL: ::tcflag_t = 512; +pub const ISIG: ::tcflag_t = 1; +pub const ICANON: ::tcflag_t = 2; +pub const PENDIN: ::tcflag_t = 16384; +pub const NOFLSH: ::tcflag_t = 128; +pub const CIBAUD: ::tcflag_t = 269418496; +pub const CBAUDEX: ::tcflag_t = 4096; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 2; +pub const NLDLY: ::tcflag_t = 256; +pub const CRDLY: ::tcflag_t = 1536; +pub const TABDLY: ::tcflag_t = 6144; +pub const BSDLY: ::tcflag_t = 8192; +pub const FFDLY: ::tcflag_t = 32768; +pub const VTDLY: ::tcflag_t = 16384; +pub const XTABS: ::tcflag_t = 6144; +pub const B0: ::speed_t = 0; +pub const B50: ::speed_t = 1; +pub const B75: ::speed_t = 2; +pub const B110: ::speed_t = 3; +pub const B134: ::speed_t = 4; +pub const B150: ::speed_t = 5; +pub const B200: ::speed_t = 6; +pub const B300: ::speed_t = 7; +pub const B600: ::speed_t = 8; +pub const B1200: ::speed_t = 9; +pub const B1800: ::speed_t = 10; +pub const B2400: ::speed_t = 11; +pub const B4800: ::speed_t = 12; +pub const B9600: ::speed_t = 13; +pub const B19200: ::speed_t = 14; +pub const B38400: ::speed_t = 15; +pub const EXTA: ::speed_t = 14; +pub const EXTB: ::speed_t = 15; +pub const B57600: ::speed_t = 4097; +pub const B115200: ::speed_t = 4098; +pub const B230400: ::speed_t = 4099; +pub const B460800: ::speed_t = 4100; +pub const B500000: ::speed_t = 4101; +pub const B576000: ::speed_t = 4102; +pub const B921600: ::speed_t = 4103; +pub const B1000000: ::speed_t = 4104; +pub const B1152000: ::speed_t = 4105; +pub const B1500000: ::speed_t = 4106; +pub const B2000000: ::speed_t = 4107; +pub const B2500000: ::speed_t = 4108; +pub const B3000000: ::speed_t = 4109; +pub const B3500000: ::speed_t = 4110; +pub const B4000000: ::speed_t = 4111; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 32768; +pub const TOSTOP: ::tcflag_t = 256; +pub const FLUSHO: ::tcflag_t = 4096; +pub const EXTPROC: ::tcflag_t = 65536; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; +pub const NGREG: usize = 32; +pub const REG_PC: usize = 0; +pub const REG_RA: usize = 1; +pub const REG_SP: usize = 2; +pub const REG_TP: usize = 4; +pub const REG_S0: usize = 8; +pub const REG_S1: usize = 9; +pub const REG_A0: usize = 10; +pub const REG_S2: usize = 18; +pub const REG_NARGS: usize = 8; + +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_close: ::c_long = 57; +pub const SYS_fstat: ::c_long = 80; +pub const SYS_lseek: ::c_long = 62; +pub const SYS_mmap: ::c_long = 222; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_brk: ::c_long = 214; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_dup: ::c_long = 23; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_sendfile: ::c_long = 71; +pub const SYS_socket: ::c_long = 198; +pub const SYS_connect: ::c_long = 203; +pub const SYS_accept: ::c_long = 202; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_exit: ::c_long = 93; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_kill: ::c_long = 129; +pub const SYS_uname: ::c_long = 160; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semop: ::c_long = 193; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_fcntl: ::c_long = 25; +pub const SYS_flock: ::c_long = 32; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_truncate: ::c_long = 45; +pub const SYS_ftruncate: ::c_long = 46; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_umask: ::c_long = 166; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_times: ::c_long = 153; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getegid: ::c_long = 177; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_personality: ::c_long = 92; +pub const SYS_statfs: ::c_long = 43; +pub const SYS_fstatfs: ::c_long = 44; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_sync: ::c_long = 81; +pub const SYS_acct: ::c_long = 89; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_mount: ::c_long = 40; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_gettid: ::c_long = 178; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_futex: ::c_long = 98; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_fadvise64: ::c_long = 223; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_openat: ::c_long = 56; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_newfstatat: ::c_long = 79; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; +pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_setns: ::c_long = 268; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; +pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_statx: ::c_long = 291; +pub const SYS_rseq: ::c_long = 293; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs new file mode 100644 index 0000000000000000000000000000000000000000..212dc898cfc4b7f6ca24114b644fc1870990dd59 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/s390x.rs @@ -0,0 +1,953 @@ +//! s390x + +use pthread_mutex_t; + +pub type blksize_t = i64; +pub type c_char = u8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type nlink_t = u64; +pub type suseconds_t = i64; +pub type wchar_t = i32; +pub type greg_t = u64; +pub type __u64 = u64; +pub type __s64 = i64; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + __glibc_reserved0: ::c_int, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + pub sa_mask: ::sigset_t, + } + + pub struct statfs { + pub f_type: ::c_uint, + pub f_bsize: ::c_uint, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_uint, + pub f_frsize: ::c_uint, + pub f_flags: ::c_uint, + f_spare: [::c_uint; 4], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + _pad: ::c_int, + _pad2: [::c_long; 14], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + st_pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + __glibc_reserved: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + st_pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + __glibc_reserved: [::c_long; 3], + } + + pub struct pthread_attr_t { + __size: [::c_ulong; 7] + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_ushort, + __pad1: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct __psw_t { + pub mask: u64, + pub addr: u64, + } + + pub struct fpregset_t { + pub fpc: u32, + __pad: u32, + pub fprs: [fpreg_t; 16], + } + + pub struct mcontext_t { + pub psw: __psw_t, + pub gregs: [u64; 16], + pub aregs: [u32; 16], + pub fpregs: fpregset_t, + } + + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask: ::sigset_t, + } + + pub struct statfs64 { + pub f_type: ::c_uint, + pub f_bsize: ::c_uint, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_uint, + pub f_frsize: ::c_uint, + pub f_flags: ::c_uint, + pub f_spare: [::c_uint; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } +} + +s_no_extra_traits! { + // FIXME: This is actually a union. + pub struct fpreg_t { + pub d: ::c_double, + // f: ::c_float, + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for fpreg_t { + fn eq(&self, other: &fpreg_t) -> bool { + self.d == other.d + } + } + + impl Eq for fpreg_t {} + + impl ::fmt::Debug for fpreg_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fpreg_t") + .field("d", &self.d) + .finish() + } + } + + impl ::hash::Hash for fpreg_t { + fn hash(&self, state: &mut H) { + let d: u64 = unsafe { ::mem::transmute(self.d) }; + d.hash(state); + } + } + } +} + +pub const POSIX_FADV_DONTNEED: ::c_int = 6; +pub const POSIX_FADV_NOREUSE: ::c_int = 7; + +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const SFD_CLOEXEC: ::c_int = 0x080000; + +pub const NCCS: usize = 32; + +pub const O_TRUNC: ::c_int = 512; +pub const O_NOATIME: ::c_int = 0o1000000; +pub const O_CLOEXEC: ::c_int = 0x80000; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; + +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; + +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +pub const EFD_CLOEXEC: ::c_int = 0x80000; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + +align_const! { + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +} + +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNREFUSED: ::c_int = 111; +pub const ECONNRESET: ::c_int = 104; +pub const EDEADLK: ::c_int = 35; +pub const ENOSYS: ::c_int = 38; +pub const ENOTCONN: ::c_int = 107; +pub const ETIMEDOUT: ::c_int = 110; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NONBLOCK: ::c_int = 2048; +pub const SA_NOCLDWAIT: ::c_int = 2; +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 4; +pub const SIGBUS: ::c_int = 7; +pub const SIGSTKSZ: ::size_t = 0x2000; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const SIG_SETMASK: ::c_int = 2; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const O_NOCTTY: ::c_int = 256; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 0x101000; +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const EDEADLOCK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGCHLD: ::c_int = 17; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = 31; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_NDELAY: ::c_int = 0x800; + +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; + +pub const EXTPROC: ::tcflag_t = 0x00010000; + +pub const PTRACE_DETACH: ::c_uint = 17; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const EFD_NONBLOCK: ::c_int = 0x800; + +pub const F_RDLCK: ::c_int = 0; +pub const F_WRLCK: ::c_int = 1; +pub const F_UNLCK: ::c_int = 2; +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const SFD_NONBLOCK: ::c_int = 0x0800; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const VTIME: usize = 5; +pub const VSWTC: usize = 7; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VSUSP: usize = 10; +pub const VREPRINT: usize = 12; +pub const VDISCARD: usize = 13; +pub const VWERASE: usize = 14; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const ONLCR: ::tcflag_t = 0o000004; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const FF1: ::tcflag_t = 0x00008000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const CBAUD: ::speed_t = 0o010017; +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const CSIZE: ::tcflag_t = 0o000060; +pub const CS6: ::tcflag_t = 0o000020; +pub const CS7: ::tcflag_t = 0o000040; +pub const CS8: ::tcflag_t = 0o000060; +pub const CSTOPB: ::tcflag_t = 0o000100; +pub const CREAD: ::tcflag_t = 0o000200; +pub const PARENB: ::tcflag_t = 0o000400; +pub const PARODD: ::tcflag_t = 0o001000; +pub const HUPCL: ::tcflag_t = 0o002000; +pub const CLOCAL: ::tcflag_t = 0o004000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; +pub const CIBAUD: ::tcflag_t = 0o02003600000; + +pub const ISIG: ::tcflag_t = 0o000001; +pub const ICANON: ::tcflag_t = 0o000002; +pub const XCASE: ::tcflag_t = 0o000004; +pub const ECHOE: ::tcflag_t = 0o000020; +pub const ECHOK: ::tcflag_t = 0o000040; +pub const ECHONL: ::tcflag_t = 0o000100; +pub const NOFLSH: ::tcflag_t = 0o000200; +pub const ECHOCTL: ::tcflag_t = 0o001000; +pub const ECHOPRT: ::tcflag_t = 0o002000; +pub const ECHOKE: ::tcflag_t = 0o004000; +pub const PENDIN: ::tcflag_t = 0o040000; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const IXON: ::tcflag_t = 0o002000; +pub const IXOFF: ::tcflag_t = 0o010000; + +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_restart_syscall: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_signal: ::c_long = 48; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_lookup_dcookie: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */ +pub const SYS_getdents: ::c_long = 141; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_query_module: ::c_long = 167; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_getpmsg: ::c_long = 188; +pub const SYS_putpmsg: ::c_long = 189; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_pivot_root: ::c_long = 217; +pub const SYS_mincore: ::c_long = 218; +pub const SYS_madvise: ::c_long = 219; +pub const SYS_getdents64: ::c_long = 220; +pub const SYS_readahead: ::c_long = 222; +pub const SYS_setxattr: ::c_long = 224; +pub const SYS_lsetxattr: ::c_long = 225; +pub const SYS_fsetxattr: ::c_long = 226; +pub const SYS_getxattr: ::c_long = 227; +pub const SYS_lgetxattr: ::c_long = 228; +pub const SYS_fgetxattr: ::c_long = 229; +pub const SYS_listxattr: ::c_long = 230; +pub const SYS_llistxattr: ::c_long = 231; +pub const SYS_flistxattr: ::c_long = 232; +pub const SYS_removexattr: ::c_long = 233; +pub const SYS_lremovexattr: ::c_long = 234; +pub const SYS_fremovexattr: ::c_long = 235; +pub const SYS_gettid: ::c_long = 236; +pub const SYS_tkill: ::c_long = 237; +pub const SYS_futex: ::c_long = 238; +pub const SYS_sched_setaffinity: ::c_long = 239; +pub const SYS_sched_getaffinity: ::c_long = 240; +pub const SYS_tgkill: ::c_long = 241; +pub const SYS_io_setup: ::c_long = 243; +pub const SYS_io_destroy: ::c_long = 244; +pub const SYS_io_getevents: ::c_long = 245; +pub const SYS_io_submit: ::c_long = 246; +pub const SYS_io_cancel: ::c_long = 247; +pub const SYS_exit_group: ::c_long = 248; +pub const SYS_epoll_create: ::c_long = 249; +pub const SYS_epoll_ctl: ::c_long = 250; +pub const SYS_epoll_wait: ::c_long = 251; +pub const SYS_set_tid_address: ::c_long = 252; +pub const SYS_fadvise64: ::c_long = 253; +pub const SYS_timer_create: ::c_long = 254; +pub const SYS_timer_settime: ::c_long = 255; +pub const SYS_timer_gettime: ::c_long = 256; +pub const SYS_timer_getoverrun: ::c_long = 257; +pub const SYS_timer_delete: ::c_long = 258; +pub const SYS_clock_settime: ::c_long = 259; +pub const SYS_clock_gettime: ::c_long = 260; +pub const SYS_clock_getres: ::c_long = 261; +pub const SYS_clock_nanosleep: ::c_long = 262; +pub const SYS_statfs64: ::c_long = 265; +pub const SYS_fstatfs64: ::c_long = 266; +pub const SYS_remap_file_pages: ::c_long = 267; +pub const SYS_mbind: ::c_long = 268; +pub const SYS_get_mempolicy: ::c_long = 269; +pub const SYS_set_mempolicy: ::c_long = 270; +pub const SYS_mq_open: ::c_long = 271; +pub const SYS_mq_unlink: ::c_long = 272; +pub const SYS_mq_timedsend: ::c_long = 273; +pub const SYS_mq_timedreceive: ::c_long = 274; +pub const SYS_mq_notify: ::c_long = 275; +pub const SYS_mq_getsetattr: ::c_long = 276; +pub const SYS_kexec_load: ::c_long = 277; +pub const SYS_add_key: ::c_long = 278; +pub const SYS_request_key: ::c_long = 279; +pub const SYS_keyctl: ::c_long = 280; +pub const SYS_waitid: ::c_long = 281; +pub const SYS_ioprio_set: ::c_long = 282; +pub const SYS_ioprio_get: ::c_long = 283; +pub const SYS_inotify_init: ::c_long = 284; +pub const SYS_inotify_add_watch: ::c_long = 285; +pub const SYS_inotify_rm_watch: ::c_long = 286; +pub const SYS_migrate_pages: ::c_long = 287; +pub const SYS_openat: ::c_long = 288; +pub const SYS_mkdirat: ::c_long = 289; +pub const SYS_mknodat: ::c_long = 290; +pub const SYS_fchownat: ::c_long = 291; +pub const SYS_futimesat: ::c_long = 292; +pub const SYS_unlinkat: ::c_long = 294; +pub const SYS_renameat: ::c_long = 295; +pub const SYS_linkat: ::c_long = 296; +pub const SYS_symlinkat: ::c_long = 297; +pub const SYS_readlinkat: ::c_long = 298; +pub const SYS_fchmodat: ::c_long = 299; +pub const SYS_faccessat: ::c_long = 300; +pub const SYS_pselect6: ::c_long = 301; +pub const SYS_ppoll: ::c_long = 302; +pub const SYS_unshare: ::c_long = 303; +pub const SYS_set_robust_list: ::c_long = 304; +pub const SYS_get_robust_list: ::c_long = 305; +pub const SYS_splice: ::c_long = 306; +pub const SYS_sync_file_range: ::c_long = 307; +pub const SYS_tee: ::c_long = 308; +pub const SYS_vmsplice: ::c_long = 309; +pub const SYS_move_pages: ::c_long = 310; +pub const SYS_getcpu: ::c_long = 311; +pub const SYS_epoll_pwait: ::c_long = 312; +pub const SYS_utimes: ::c_long = 313; +pub const SYS_fallocate: ::c_long = 314; +pub const SYS_utimensat: ::c_long = 315; +pub const SYS_signalfd: ::c_long = 316; +pub const SYS_timerfd: ::c_long = 317; +pub const SYS_eventfd: ::c_long = 318; +pub const SYS_timerfd_create: ::c_long = 319; +pub const SYS_timerfd_settime: ::c_long = 320; +pub const SYS_timerfd_gettime: ::c_long = 321; +pub const SYS_signalfd4: ::c_long = 322; +pub const SYS_eventfd2: ::c_long = 323; +pub const SYS_inotify_init1: ::c_long = 324; +pub const SYS_pipe2: ::c_long = 325; +pub const SYS_dup3: ::c_long = 326; +pub const SYS_epoll_create1: ::c_long = 327; +pub const SYS_preadv: ::c_long = 328; +pub const SYS_pwritev: ::c_long = 329; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 330; +pub const SYS_perf_event_open: ::c_long = 331; +pub const SYS_fanotify_init: ::c_long = 332; +pub const SYS_fanotify_mark: ::c_long = 333; +pub const SYS_prlimit64: ::c_long = 334; +pub const SYS_name_to_handle_at: ::c_long = 335; +pub const SYS_open_by_handle_at: ::c_long = 336; +pub const SYS_clock_adjtime: ::c_long = 337; +pub const SYS_syncfs: ::c_long = 338; +pub const SYS_setns: ::c_long = 339; +pub const SYS_process_vm_readv: ::c_long = 340; +pub const SYS_process_vm_writev: ::c_long = 341; +pub const SYS_s390_runtime_instr: ::c_long = 342; +pub const SYS_kcmp: ::c_long = 343; +pub const SYS_finit_module: ::c_long = 344; +pub const SYS_sched_setattr: ::c_long = 345; +pub const SYS_sched_getattr: ::c_long = 346; +pub const SYS_renameat2: ::c_long = 347; +pub const SYS_seccomp: ::c_long = 348; +pub const SYS_getrandom: ::c_long = 349; +pub const SYS_memfd_create: ::c_long = 350; +pub const SYS_bpf: ::c_long = 351; +pub const SYS_s390_pci_mmio_write: ::c_long = 352; +pub const SYS_s390_pci_mmio_read: ::c_long = 353; +pub const SYS_execveat: ::c_long = 354; +pub const SYS_userfaultfd: ::c_long = 355; +pub const SYS_membarrier: ::c_long = 356; +pub const SYS_recvmmsg: ::c_long = 357; +pub const SYS_sendmmsg: ::c_long = 358; +pub const SYS_socket: ::c_long = 359; +pub const SYS_socketpair: ::c_long = 360; +pub const SYS_bind: ::c_long = 361; +pub const SYS_connect: ::c_long = 362; +pub const SYS_listen: ::c_long = 363; +pub const SYS_accept4: ::c_long = 364; +pub const SYS_getsockopt: ::c_long = 365; +pub const SYS_setsockopt: ::c_long = 366; +pub const SYS_getsockname: ::c_long = 367; +pub const SYS_getpeername: ::c_long = 368; +pub const SYS_sendto: ::c_long = 369; +pub const SYS_sendmsg: ::c_long = 370; +pub const SYS_recvfrom: ::c_long = 371; +pub const SYS_recvmsg: ::c_long = 372; +pub const SYS_shutdown: ::c_long = 373; +pub const SYS_mlock2: ::c_long = 374; +pub const SYS_copy_file_range: ::c_long = 375; +pub const SYS_preadv2: ::c_long = 376; +pub const SYS_pwritev2: ::c_long = 377; +pub const SYS_lchown: ::c_long = 198; +pub const SYS_setuid: ::c_long = 213; +pub const SYS_getuid: ::c_long = 199; +pub const SYS_setgid: ::c_long = 214; +pub const SYS_getgid: ::c_long = 200; +pub const SYS_geteuid: ::c_long = 201; +pub const SYS_setreuid: ::c_long = 203; +pub const SYS_setregid: ::c_long = 204; +pub const SYS_getrlimit: ::c_long = 191; +pub const SYS_getgroups: ::c_long = 205; +pub const SYS_fchown: ::c_long = 207; +pub const SYS_setresuid: ::c_long = 208; +pub const SYS_setresgid: ::c_long = 210; +pub const SYS_getresgid: ::c_long = 211; +pub const SYS_select: ::c_long = 142; +pub const SYS_getegid: ::c_long = 202; +pub const SYS_setgroups: ::c_long = 206; +pub const SYS_getresuid: ::c_long = 209; +pub const SYS_chown: ::c_long = 212; +pub const SYS_setfsuid: ::c_long = 215; +pub const SYS_setfsgid: ::c_long = 216; +pub const SYS_newfstatat: ::c_long = 293; +pub const SYS_statx: ::c_long = 379; +pub const SYS_rseq: ::c_long = 383; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +extern "C" { + + pub fn sysctl( + name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; + pub fn getcontext(ucp: *mut ::ucontext_t) -> ::c_int; + pub fn setcontext(ucp: *const ::ucontext_t) -> ::c_int; + pub fn makecontext(ucp: *mut ::ucontext_t, func: extern "C" fn(), argc: ::c_int, ...); + pub fn swapcontext(uocp: *mut ::ucontext_t, ucp: *const ::ucontext_t) -> ::c_int; +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..29d1e1c7b8a5558fcfa3b8ac333cee3fa9784163 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [i64; 4] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..8d065e6a3b534a59c0a34fff6e74777feea62b13 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs @@ -0,0 +1,920 @@ +//! SPARC64-specific definitions for 64-bit linux-like values + +use pthread_mutex_t; + +pub type c_long = i64; +pub type c_ulong = u64; +pub type c_char = i8; +pub type wchar_t = i32; +pub type nlink_t = u32; +pub type blksize_t = i64; +pub type suseconds_t = i32; +pub type __u64 = ::c_ulonglong; +pub type __s64 = ::c_longlong; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + #[cfg(target_arch = "sparc64")] + __reserved0: ::c_int, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct statfs { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + f_spare: [::__fsword_t; 5], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + __reserved: ::c_short, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct stat { + pub st_dev: ::dev_t, + __pad0: u64, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad1: u64, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 2], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + __pad0: u64, + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad2: ::c_int, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __reserved: [::c_long; 2], + } + + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct pthread_attr_t { + __size: [u64; 7] + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + __pad0: u16, + pub __seq: ::c_ushort, + __unused1: ::c_ulonglong, + __unused2: ::c_ulonglong, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_segsz: ::size_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __reserved1: ::c_ulong, + __reserved2: ::c_ulong + } +} + +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + +pub const O_APPEND: ::c_int = 0x8; +pub const O_CREAT: ::c_int = 0x200; +pub const O_EXCL: ::c_int = 0x800; +pub const O_NOCTTY: ::c_int = 0x8000; +pub const O_NONBLOCK: ::c_int = 0x4000; +pub const O_SYNC: ::c_int = 0x802000; +pub const O_RSYNC: ::c_int = 0x802000; +pub const O_DSYNC: ::c_int = 0x2000; +pub const O_FSYNC: ::c_int = 0x802000; +pub const O_NOATIME: ::c_int = 0x200000; +pub const O_PATH: ::c_int = 0x1000000; +pub const O_TMPFILE: ::c_int = 0x2000000 | O_DIRECTORY; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_GROWSDOWN: ::c_int = 0x0200; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const EDEADLK: ::c_int = 78; +pub const ENAMETOOLONG: ::c_int = 63; +pub const ENOLCK: ::c_int = 79; +pub const ENOSYS: ::c_int = 90; +pub const ENOTEMPTY: ::c_int = 66; +pub const ELOOP: ::c_int = 62; +pub const ENOMSG: ::c_int = 75; +pub const EIDRM: ::c_int = 77; +pub const ECHRNG: ::c_int = 94; +pub const EL2NSYNC: ::c_int = 95; +pub const EL3HLT: ::c_int = 96; +pub const EL3RST: ::c_int = 97; +pub const ELNRNG: ::c_int = 98; +pub const EUNATCH: ::c_int = 99; +pub const ENOCSI: ::c_int = 100; +pub const EL2HLT: ::c_int = 101; +pub const EBADE: ::c_int = 102; +pub const EBADR: ::c_int = 103; +pub const EXFULL: ::c_int = 104; +pub const ENOANO: ::c_int = 105; +pub const EBADRQC: ::c_int = 106; +pub const EBADSLT: ::c_int = 107; +pub const EMULTIHOP: ::c_int = 87; +pub const EOVERFLOW: ::c_int = 92; +pub const ENOTUNIQ: ::c_int = 115; +pub const EBADFD: ::c_int = 93; +pub const EBADMSG: ::c_int = 76; +pub const EREMCHG: ::c_int = 89; +pub const ELIBACC: ::c_int = 114; +pub const ELIBBAD: ::c_int = 112; +pub const ELIBSCN: ::c_int = 124; +pub const ELIBMAX: ::c_int = 123; +pub const ELIBEXEC: ::c_int = 110; +pub const EILSEQ: ::c_int = 122; +pub const ERESTART: ::c_int = 116; +pub const ESTRPIPE: ::c_int = 91; +pub const EUSERS: ::c_int = 68; +pub const ENOTSOCK: ::c_int = 38; +pub const EDESTADDRREQ: ::c_int = 39; +pub const EMSGSIZE: ::c_int = 40; +pub const EPROTOTYPE: ::c_int = 41; +pub const ENOPROTOOPT: ::c_int = 42; +pub const EPROTONOSUPPORT: ::c_int = 43; +pub const ESOCKTNOSUPPORT: ::c_int = 44; +pub const EOPNOTSUPP: ::c_int = 45; +pub const EPFNOSUPPORT: ::c_int = 46; +pub const EAFNOSUPPORT: ::c_int = 47; +pub const EADDRINUSE: ::c_int = 48; +pub const EADDRNOTAVAIL: ::c_int = 49; +pub const ENETDOWN: ::c_int = 50; +pub const ENETUNREACH: ::c_int = 51; +pub const ENETRESET: ::c_int = 52; +pub const ECONNABORTED: ::c_int = 53; +pub const ECONNRESET: ::c_int = 54; +pub const ENOBUFS: ::c_int = 55; +pub const EISCONN: ::c_int = 56; +pub const ENOTCONN: ::c_int = 57; +pub const ESHUTDOWN: ::c_int = 58; +pub const ETOOMANYREFS: ::c_int = 59; +pub const ETIMEDOUT: ::c_int = 60; +pub const ECONNREFUSED: ::c_int = 61; +pub const EHOSTDOWN: ::c_int = 64; +pub const EHOSTUNREACH: ::c_int = 65; +pub const EALREADY: ::c_int = 37; +pub const EINPROGRESS: ::c_int = 36; +pub const ESTALE: ::c_int = 70; +pub const EDQUOT: ::c_int = 69; +pub const ENOMEDIUM: ::c_int = 125; +pub const EMEDIUMTYPE: ::c_int = 126; +pub const ECANCELED: ::c_int = 127; +pub const ENOKEY: ::c_int = 128; +pub const EKEYEXPIRED: ::c_int = 129; +pub const EKEYREVOKED: ::c_int = 130; +pub const EKEYREJECTED: ::c_int = 131; +pub const EOWNERDEAD: ::c_int = 132; +pub const ENOTRECOVERABLE: ::c_int = 133; +pub const EHWPOISON: ::c_int = 135; +pub const ERFKILL: ::c_int = 134; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const SA_ONSTACK: ::c_int = 1; +pub const SA_SIGINFO: ::c_int = 0x200; +pub const SA_NOCLDWAIT: ::c_int = 0x100; + +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGCHLD: ::c_int = 20; +pub const SIGBUS: ::c_int = 10; +pub const SIGUSR1: ::c_int = 30; +pub const SIGUSR2: ::c_int = 31; +pub const SIGCONT: ::c_int = 19; +pub const SIGSTOP: ::c_int = 17; +pub const SIGTSTP: ::c_int = 18; +pub const SIGURG: ::c_int = 16; +pub const SIGIO: ::c_int = 23; +pub const SIGSYS: ::c_int = 12; +pub const SIGPOLL: ::c_int = 23; +pub const SIGPWR: ::c_int = 29; +pub const SIG_SETMASK: ::c_int = 4; +pub const SIG_BLOCK: ::c_int = 1; +pub const SIG_UNBLOCK: ::c_int = 2; + +pub const POLLWRNORM: ::c_short = 4; +pub const POLLWRBAND: ::c_short = 0x100; + +pub const O_ASYNC: ::c_int = 0x40; +pub const O_NDELAY: ::c_int = 0x4004; + +pub const PTRACE_DETACH: ::c_uint = 17; + +pub const EFD_NONBLOCK: ::c_int = 0x4000; + +pub const F_GETLK: ::c_int = 7; +pub const F_GETOWN: ::c_int = 5; +pub const F_SETOWN: ::c_int = 6; +pub const F_SETLK: ::c_int = 8; +pub const F_SETLKW: ::c_int = 9; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const F_RDLCK: ::c_int = 1; +pub const F_WRLCK: ::c_int = 2; +pub const F_UNLCK: ::c_int = 3; + +pub const SFD_NONBLOCK: ::c_int = 0x4000; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const SFD_CLOEXEC: ::c_int = 0x400000; + +pub const NCCS: usize = 17; +pub const O_TRUNC: ::c_int = 0x400; + +pub const O_CLOEXEC: ::c_int = 0x400000; + +pub const EBFONT: ::c_int = 109; +pub const ENOSTR: ::c_int = 72; +pub const ENODATA: ::c_int = 111; +pub const ETIME: ::c_int = 73; +pub const ENOSR: ::c_int = 74; +pub const ENONET: ::c_int = 80; +pub const ENOPKG: ::c_int = 113; +pub const EREMOTE: ::c_int = 71; +pub const ENOLINK: ::c_int = 82; +pub const EADV: ::c_int = 83; +pub const ESRMNT: ::c_int = 84; +pub const ECOMM: ::c_int = 85; +pub const EPROTO: ::c_int = 86; +pub const EDOTDOT: ::c_int = 88; + +pub const SA_NODEFER: ::c_int = 0x20; +pub const SA_RESETHAND: ::c_int = 0x4; +pub const SA_RESTART: ::c_int = 0x2; +pub const SA_NOCLDSTOP: ::c_int = 0x00000008; + +pub const EPOLL_CLOEXEC: ::c_int = 0x400000; + +pub const EFD_CLOEXEC: ::c_int = 0x400000; +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; + +align_const! { + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +} + +pub const O_DIRECTORY: ::c_int = 0o200000; +pub const O_NOFOLLOW: ::c_int = 0o400000; +pub const O_DIRECT: ::c_int = 0x100000; + +pub const MAP_LOCKED: ::c_int = 0x0100; +pub const MAP_NORESERVE: ::c_int = 0x00040; + +pub const EDEADLOCK: ::c_int = 108; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; + +pub const MCL_CURRENT: ::c_int = 0x2000; +pub const MCL_FUTURE: ::c_int = 0x4000; + +pub const SIGSTKSZ: ::size_t = 16384; +pub const MINSIGSTKSZ: ::size_t = 4096; +pub const CBAUD: ::tcflag_t = 0x0000100f; +pub const TAB1: ::tcflag_t = 0x800; +pub const TAB2: ::tcflag_t = 0x1000; +pub const TAB3: ::tcflag_t = 0x1800; +pub const CR1: ::tcflag_t = 0x200; +pub const CR2: ::tcflag_t = 0x400; +pub const CR3: ::tcflag_t = 0x600; +pub const FF1: ::tcflag_t = 0x8000; +pub const BS1: ::tcflag_t = 0x2000; +pub const VT1: ::tcflag_t = 0x4000; +pub const VWERASE: usize = 0xe; +pub const VREPRINT: usize = 0xc; +pub const VSUSP: usize = 0xa; +pub const VSTART: usize = 0x8; +pub const VSTOP: usize = 0x9; +pub const VDISCARD: usize = 0xd; +pub const VTIME: usize = 0x5; +pub const IXON: ::tcflag_t = 0x400; +pub const IXOFF: ::tcflag_t = 0x1000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x30; +pub const CS6: ::tcflag_t = 0x10; +pub const CS7: ::tcflag_t = 0x20; +pub const CS8: ::tcflag_t = 0x30; +pub const CSTOPB: ::tcflag_t = 0x40; +pub const CREAD: ::tcflag_t = 0x80; +pub const PARENB: ::tcflag_t = 0x100; +pub const PARODD: ::tcflag_t = 0x200; +pub const HUPCL: ::tcflag_t = 0x400; +pub const CLOCAL: ::tcflag_t = 0x800; +pub const ECHOKE: ::tcflag_t = 0x800; +pub const ECHOE: ::tcflag_t = 0x10; +pub const ECHOK: ::tcflag_t = 0x20; +pub const ECHONL: ::tcflag_t = 0x40; +pub const ECHOPRT: ::tcflag_t = 0x400; +pub const ECHOCTL: ::tcflag_t = 0x200; +pub const ISIG: ::tcflag_t = 0x1; +pub const ICANON: ::tcflag_t = 0x2; +pub const PENDIN: ::tcflag_t = 0x4000; +pub const NOFLSH: ::tcflag_t = 0x80; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0x00001000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0x1001; +pub const B115200: ::speed_t = 0x1002; +pub const B230400: ::speed_t = 0x1003; +pub const B460800: ::speed_t = 0x1004; +pub const B76800: ::speed_t = 0x1005; +pub const B153600: ::speed_t = 0x1006; +pub const B307200: ::speed_t = 0x1007; +pub const B614400: ::speed_t = 0x1008; +pub const B921600: ::speed_t = 0x1009; +pub const B500000: ::speed_t = 0x100a; +pub const B576000: ::speed_t = 0x100b; +pub const B1000000: ::speed_t = 0x100c; +pub const B1152000: ::speed_t = 0x100d; +pub const B1500000: ::speed_t = 0x100e; +pub const B2000000: ::speed_t = 0x100f; + +pub const VEOL: usize = 5; +pub const VEOL2: usize = 6; +pub const VMIN: usize = 4; +pub const IEXTEN: ::tcflag_t = 0x8000; +pub const TOSTOP: ::tcflag_t = 0x100; +pub const FLUSHO: ::tcflag_t = 0x1000; +pub const EXTPROC: ::tcflag_t = 0x10000; + +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_wait4: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execv: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_chown: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_brk: ::c_long = 17; +pub const SYS_perfctr: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_capget: ::c_long = 21; +pub const SYS_capset: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_vmsplice: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_sigaltstack: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_stat: ::c_long = 38; +pub const SYS_sendfile: ::c_long = 39; +pub const SYS_lstat: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_umount2: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_memory_ordering: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_reboot: ::c_long = 55; +pub const SYS_symlink: ::c_long = 57; +pub const SYS_readlink: ::c_long = 58; +pub const SYS_execve: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_fstat: ::c_long = 62; +pub const SYS_fstat64: ::c_long = 63; +pub const SYS_getpagesize: ::c_long = 64; +pub const SYS_msync: ::c_long = 65; +pub const SYS_vfork: ::c_long = 66; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_mmap: ::c_long = 71; +pub const SYS_munmap: ::c_long = 73; +pub const SYS_mprotect: ::c_long = 74; +pub const SYS_madvise: ::c_long = 75; +pub const SYS_vhangup: ::c_long = 76; +pub const SYS_mincore: ::c_long = 78; +pub const SYS_getgroups: ::c_long = 79; +pub const SYS_setgroups: ::c_long = 80; +pub const SYS_getpgrp: ::c_long = 81; +pub const SYS_setitimer: ::c_long = 83; +pub const SYS_swapon: ::c_long = 85; +pub const SYS_getitimer: ::c_long = 86; +pub const SYS_sethostname: ::c_long = 88; +pub const SYS_dup2: ::c_long = 90; +pub const SYS_fcntl: ::c_long = 92; +pub const SYS_select: ::c_long = 93; +pub const SYS_fsync: ::c_long = 95; +pub const SYS_setpriority: ::c_long = 96; +pub const SYS_socket: ::c_long = 97; +pub const SYS_connect: ::c_long = 98; +pub const SYS_accept: ::c_long = 99; +pub const SYS_getpriority: ::c_long = 100; +pub const SYS_rt_sigreturn: ::c_long = 101; +pub const SYS_rt_sigaction: ::c_long = 102; +pub const SYS_rt_sigprocmask: ::c_long = 103; +pub const SYS_rt_sigpending: ::c_long = 104; +pub const SYS_rt_sigtimedwait: ::c_long = 105; +pub const SYS_rt_sigqueueinfo: ::c_long = 106; +pub const SYS_rt_sigsuspend: ::c_long = 107; +pub const SYS_setresuid: ::c_long = 108; +pub const SYS_getresuid: ::c_long = 109; +pub const SYS_setresgid: ::c_long = 110; +pub const SYS_getresgid: ::c_long = 111; +pub const SYS_recvmsg: ::c_long = 113; +pub const SYS_sendmsg: ::c_long = 114; +pub const SYS_gettimeofday: ::c_long = 116; +pub const SYS_getrusage: ::c_long = 117; +pub const SYS_getsockopt: ::c_long = 118; +pub const SYS_getcwd: ::c_long = 119; +pub const SYS_readv: ::c_long = 120; +pub const SYS_writev: ::c_long = 121; +pub const SYS_settimeofday: ::c_long = 122; +pub const SYS_fchown: ::c_long = 123; +pub const SYS_fchmod: ::c_long = 124; +pub const SYS_recvfrom: ::c_long = 125; +pub const SYS_setreuid: ::c_long = 126; +pub const SYS_setregid: ::c_long = 127; +pub const SYS_rename: ::c_long = 128; +pub const SYS_truncate: ::c_long = 129; +pub const SYS_ftruncate: ::c_long = 130; +pub const SYS_flock: ::c_long = 131; +pub const SYS_lstat64: ::c_long = 132; +pub const SYS_sendto: ::c_long = 133; +pub const SYS_shutdown: ::c_long = 134; +pub const SYS_socketpair: ::c_long = 135; +pub const SYS_mkdir: ::c_long = 136; +pub const SYS_rmdir: ::c_long = 137; +pub const SYS_utimes: ::c_long = 138; +pub const SYS_stat64: ::c_long = 139; +pub const SYS_sendfile64: ::c_long = 140; +pub const SYS_getpeername: ::c_long = 141; +pub const SYS_futex: ::c_long = 142; +pub const SYS_gettid: ::c_long = 143; +pub const SYS_getrlimit: ::c_long = 144; +pub const SYS_setrlimit: ::c_long = 145; +pub const SYS_pivot_root: ::c_long = 146; +pub const SYS_prctl: ::c_long = 147; +pub const SYS_pciconfig_read: ::c_long = 148; +pub const SYS_pciconfig_write: ::c_long = 149; +pub const SYS_getsockname: ::c_long = 150; +pub const SYS_inotify_init: ::c_long = 151; +pub const SYS_inotify_add_watch: ::c_long = 152; +pub const SYS_poll: ::c_long = 153; +pub const SYS_getdents64: ::c_long = 154; +pub const SYS_inotify_rm_watch: ::c_long = 156; +pub const SYS_statfs: ::c_long = 157; +pub const SYS_fstatfs: ::c_long = 158; +pub const SYS_umount: ::c_long = 159; +pub const SYS_sched_set_affinity: ::c_long = 160; +pub const SYS_sched_get_affinity: ::c_long = 161; +pub const SYS_getdomainname: ::c_long = 162; +pub const SYS_setdomainname: ::c_long = 163; +pub const SYS_utrap_install: ::c_long = 164; +pub const SYS_quotactl: ::c_long = 165; +pub const SYS_set_tid_address: ::c_long = 166; +pub const SYS_mount: ::c_long = 167; +pub const SYS_ustat: ::c_long = 168; +pub const SYS_setxattr: ::c_long = 169; +pub const SYS_lsetxattr: ::c_long = 170; +pub const SYS_fsetxattr: ::c_long = 171; +pub const SYS_getxattr: ::c_long = 172; +pub const SYS_lgetxattr: ::c_long = 173; +pub const SYS_getdents: ::c_long = 174; +pub const SYS_setsid: ::c_long = 175; +pub const SYS_fchdir: ::c_long = 176; +pub const SYS_fgetxattr: ::c_long = 177; +pub const SYS_listxattr: ::c_long = 178; +pub const SYS_llistxattr: ::c_long = 179; +pub const SYS_flistxattr: ::c_long = 180; +pub const SYS_removexattr: ::c_long = 181; +pub const SYS_lremovexattr: ::c_long = 182; +pub const SYS_sigpending: ::c_long = 183; +pub const SYS_query_module: ::c_long = 184; +pub const SYS_setpgid: ::c_long = 185; +pub const SYS_fremovexattr: ::c_long = 186; +pub const SYS_tkill: ::c_long = 187; +pub const SYS_exit_group: ::c_long = 188; +pub const SYS_uname: ::c_long = 189; +pub const SYS_init_module: ::c_long = 190; +pub const SYS_personality: ::c_long = 191; +pub const SYS_remap_file_pages: ::c_long = 192; +pub const SYS_epoll_create: ::c_long = 193; +pub const SYS_epoll_ctl: ::c_long = 194; +pub const SYS_epoll_wait: ::c_long = 195; +pub const SYS_ioprio_set: ::c_long = 196; +pub const SYS_getppid: ::c_long = 197; +pub const SYS_sigaction: ::c_long = 198; +pub const SYS_sgetmask: ::c_long = 199; +pub const SYS_ssetmask: ::c_long = 200; +pub const SYS_sigsuspend: ::c_long = 201; +pub const SYS_oldlstat: ::c_long = 202; +pub const SYS_uselib: ::c_long = 203; +pub const SYS_readdir: ::c_long = 204; +pub const SYS_readahead: ::c_long = 205; +pub const SYS_socketcall: ::c_long = 206; +pub const SYS_syslog: ::c_long = 207; +pub const SYS_lookup_dcookie: ::c_long = 208; +pub const SYS_fadvise64: ::c_long = 209; +pub const SYS_fadvise64_64: ::c_long = 210; +pub const SYS_tgkill: ::c_long = 211; +pub const SYS_waitpid: ::c_long = 212; +pub const SYS_swapoff: ::c_long = 213; +pub const SYS_sysinfo: ::c_long = 214; +pub const SYS_ipc: ::c_long = 215; +pub const SYS_sigreturn: ::c_long = 216; +pub const SYS_clone: ::c_long = 217; +pub const SYS_ioprio_get: ::c_long = 218; +pub const SYS_adjtimex: ::c_long = 219; +pub const SYS_sigprocmask: ::c_long = 220; +pub const SYS_create_module: ::c_long = 221; +pub const SYS_delete_module: ::c_long = 222; +pub const SYS_get_kernel_syms: ::c_long = 223; +pub const SYS_getpgid: ::c_long = 224; +pub const SYS_bdflush: ::c_long = 225; +pub const SYS_sysfs: ::c_long = 226; +pub const SYS_afs_syscall: ::c_long = 227; +pub const SYS_setfsuid: ::c_long = 228; +pub const SYS_setfsgid: ::c_long = 229; +pub const SYS__newselect: ::c_long = 230; +pub const SYS_splice: ::c_long = 232; +pub const SYS_stime: ::c_long = 233; +pub const SYS_statfs64: ::c_long = 234; +pub const SYS_fstatfs64: ::c_long = 235; +pub const SYS__llseek: ::c_long = 236; +pub const SYS_mlock: ::c_long = 237; +pub const SYS_munlock: ::c_long = 238; +pub const SYS_mlockall: ::c_long = 239; +pub const SYS_munlockall: ::c_long = 240; +pub const SYS_sched_setparam: ::c_long = 241; +pub const SYS_sched_getparam: ::c_long = 242; +pub const SYS_sched_setscheduler: ::c_long = 243; +pub const SYS_sched_getscheduler: ::c_long = 244; +pub const SYS_sched_yield: ::c_long = 245; +pub const SYS_sched_get_priority_max: ::c_long = 246; +pub const SYS_sched_get_priority_min: ::c_long = 247; +pub const SYS_sched_rr_get_interval: ::c_long = 248; +pub const SYS_nanosleep: ::c_long = 249; +pub const SYS_mremap: ::c_long = 250; +pub const SYS__sysctl: ::c_long = 251; +pub const SYS_getsid: ::c_long = 252; +pub const SYS_fdatasync: ::c_long = 253; +pub const SYS_nfsservctl: ::c_long = 254; +pub const SYS_sync_file_range: ::c_long = 255; +pub const SYS_clock_settime: ::c_long = 256; +pub const SYS_clock_gettime: ::c_long = 257; +pub const SYS_clock_getres: ::c_long = 258; +pub const SYS_clock_nanosleep: ::c_long = 259; +pub const SYS_sched_getaffinity: ::c_long = 260; +pub const SYS_sched_setaffinity: ::c_long = 261; +pub const SYS_timer_settime: ::c_long = 262; +pub const SYS_timer_gettime: ::c_long = 263; +pub const SYS_timer_getoverrun: ::c_long = 264; +pub const SYS_timer_delete: ::c_long = 265; +pub const SYS_timer_create: ::c_long = 266; +pub const SYS_io_setup: ::c_long = 268; +pub const SYS_io_destroy: ::c_long = 269; +pub const SYS_io_submit: ::c_long = 270; +pub const SYS_io_cancel: ::c_long = 271; +pub const SYS_io_getevents: ::c_long = 272; +pub const SYS_mq_open: ::c_long = 273; +pub const SYS_mq_unlink: ::c_long = 274; +pub const SYS_mq_timedsend: ::c_long = 275; +pub const SYS_mq_timedreceive: ::c_long = 276; +pub const SYS_mq_notify: ::c_long = 277; +pub const SYS_mq_getsetattr: ::c_long = 278; +pub const SYS_waitid: ::c_long = 279; +pub const SYS_tee: ::c_long = 280; +pub const SYS_add_key: ::c_long = 281; +pub const SYS_request_key: ::c_long = 282; +pub const SYS_keyctl: ::c_long = 283; +pub const SYS_openat: ::c_long = 284; +pub const SYS_mkdirat: ::c_long = 285; +pub const SYS_mknodat: ::c_long = 286; +pub const SYS_fchownat: ::c_long = 287; +pub const SYS_futimesat: ::c_long = 288; +pub const SYS_fstatat64: ::c_long = 289; +pub const SYS_unlinkat: ::c_long = 290; +pub const SYS_renameat: ::c_long = 291; +pub const SYS_linkat: ::c_long = 292; +pub const SYS_symlinkat: ::c_long = 293; +pub const SYS_readlinkat: ::c_long = 294; +pub const SYS_fchmodat: ::c_long = 295; +pub const SYS_faccessat: ::c_long = 296; +pub const SYS_pselect6: ::c_long = 297; +pub const SYS_ppoll: ::c_long = 298; +pub const SYS_unshare: ::c_long = 299; +pub const SYS_set_robust_list: ::c_long = 300; +pub const SYS_get_robust_list: ::c_long = 301; +pub const SYS_migrate_pages: ::c_long = 302; +pub const SYS_mbind: ::c_long = 303; +pub const SYS_get_mempolicy: ::c_long = 304; +pub const SYS_set_mempolicy: ::c_long = 305; +pub const SYS_kexec_load: ::c_long = 306; +pub const SYS_move_pages: ::c_long = 307; +pub const SYS_getcpu: ::c_long = 308; +pub const SYS_epoll_pwait: ::c_long = 309; +pub const SYS_utimensat: ::c_long = 310; +pub const SYS_signalfd: ::c_long = 311; +pub const SYS_timerfd_create: ::c_long = 312; +pub const SYS_eventfd: ::c_long = 313; +pub const SYS_fallocate: ::c_long = 314; +pub const SYS_timerfd_settime: ::c_long = 315; +pub const SYS_timerfd_gettime: ::c_long = 316; +pub const SYS_signalfd4: ::c_long = 317; +pub const SYS_eventfd2: ::c_long = 318; +pub const SYS_epoll_create1: ::c_long = 319; +pub const SYS_dup3: ::c_long = 320; +pub const SYS_pipe2: ::c_long = 321; +pub const SYS_inotify_init1: ::c_long = 322; +pub const SYS_accept4: ::c_long = 323; +pub const SYS_preadv: ::c_long = 324; +pub const SYS_pwritev: ::c_long = 325; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 326; +pub const SYS_perf_event_open: ::c_long = 327; +pub const SYS_recvmmsg: ::c_long = 328; +pub const SYS_fanotify_init: ::c_long = 329; +pub const SYS_fanotify_mark: ::c_long = 330; +pub const SYS_prlimit64: ::c_long = 331; +pub const SYS_name_to_handle_at: ::c_long = 332; +pub const SYS_open_by_handle_at: ::c_long = 333; +pub const SYS_clock_adjtime: ::c_long = 334; +pub const SYS_syncfs: ::c_long = 335; +pub const SYS_sendmmsg: ::c_long = 336; +pub const SYS_setns: ::c_long = 337; +pub const SYS_process_vm_readv: ::c_long = 338; +pub const SYS_process_vm_writev: ::c_long = 339; +pub const SYS_kern_features: ::c_long = 340; +pub const SYS_kcmp: ::c_long = 341; +pub const SYS_finit_module: ::c_long = 342; +pub const SYS_sched_setattr: ::c_long = 343; +pub const SYS_sched_getattr: ::c_long = 344; +pub const SYS_renameat2: ::c_long = 345; +pub const SYS_seccomp: ::c_long = 346; +pub const SYS_getrandom: ::c_long = 347; +pub const SYS_memfd_create: ::c_long = 348; +pub const SYS_bpf: ::c_long = 349; +pub const SYS_execveat: ::c_long = 350; +pub const SYS_membarrier: ::c_long = 351; +pub const SYS_userfaultfd: ::c_long = 352; +pub const SYS_bind: ::c_long = 353; +pub const SYS_listen: ::c_long = 354; +pub const SYS_setsockopt: ::c_long = 355; +pub const SYS_mlock2: ::c_long = 356; +pub const SYS_copy_file_range: ::c_long = 357; +pub const SYS_preadv2: ::c_long = 358; +pub const SYS_pwritev2: ::c_long = 359; +pub const SYS_statx: ::c_long = 360; +pub const SYS_rseq: ::c_long = 365; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +// Reserved in the kernel, but not actually implemented yet +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +extern "C" { + pub fn sysctl( + name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..ba3075edd7e36f9780a74a3c31d456418f213988 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/align.rs @@ -0,0 +1,24 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 4] + } +} + +s! { + #[repr(align(8))] + pub struct clone_args { + pub flags: ::c_ulonglong, + pub pidfd: ::c_ulonglong, + pub child_tid: ::c_ulonglong, + pub parent_tid: ::c_ulonglong, + pub exit_signal: ::c_ulonglong, + pub stack: ::c_ulonglong, + pub stack_size: ::c_ulonglong, + pub tls: ::c_ulonglong, + pub set_tid: ::c_ulonglong, + pub set_tid_size: ::c_ulonglong, + pub cgroup: ::c_ulonglong, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..7e876f2d86c879270080908facbf97f9f81bb87f --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs @@ -0,0 +1,824 @@ +//! x86_64-specific definitions for 64-bit linux-like values + +pub type c_char = i8; +pub type wchar_t = i32; +pub type nlink_t = u64; +pub type blksize_t = i64; +pub type greg_t = i64; +pub type suseconds_t = i64; +pub type __u64 = ::c_ulonglong; +pub type __s64 = ::c_longlong; + +s! { + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + #[cfg(target_arch = "sparc64")] + __reserved0: ::c_int, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct statfs { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + f_spare: [::__fsword_t; 5], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [u64; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: i64, + pub st_mtime: ::time_t, + pub st_mtime_nsec: i64, + pub st_ctime: ::time_t, + pub st_ctime_nsec: i64, + __unused: [i64; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: i64, + pub st_mtime: ::time_t, + pub st_mtime_nsec: i64, + pub st_ctime: ::time_t, + pub st_ctime_nsec: i64, + __reserved: [i64; 3], + } + + pub struct statfs64 { + pub f_type: ::__fsword_t, + pub f_bsize: ::__fsword_t, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_fsid: ::fsid_t, + pub f_namelen: ::__fsword_t, + pub f_frsize: ::__fsword_t, + pub f_flags: ::__fsword_t, + pub f_spare: [::__fsword_t; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct pthread_attr_t { + #[cfg(target_pointer_width = "32")] + __size: [u32; 8], + #[cfg(target_pointer_width = "64")] + __size: [u64; 7] + } + + pub struct _libc_fpxreg { + pub significand: [u16; 4], + pub exponent: u16, + __private: [u16; 3], + } + + pub struct _libc_xmmreg { + pub element: [u32; 4], + } + + pub struct _libc_fpstate { + pub cwd: u16, + pub swd: u16, + pub ftw: u16, + pub fop: u16, + pub rip: u64, + pub rdp: u64, + pub mxcsr: u32, + pub mxcr_mask: u32, + pub _st: [_libc_fpxreg; 8], + pub _xmm: [_libc_xmmreg; 16], + __private: [u64; 12], + } + + pub struct user_regs_struct { + pub r15: ::c_ulonglong, + pub r14: ::c_ulonglong, + pub r13: ::c_ulonglong, + pub r12: ::c_ulonglong, + pub rbp: ::c_ulonglong, + pub rbx: ::c_ulonglong, + pub r11: ::c_ulonglong, + pub r10: ::c_ulonglong, + pub r9: ::c_ulonglong, + pub r8: ::c_ulonglong, + pub rax: ::c_ulonglong, + pub rcx: ::c_ulonglong, + pub rdx: ::c_ulonglong, + pub rsi: ::c_ulonglong, + pub rdi: ::c_ulonglong, + pub orig_rax: ::c_ulonglong, + pub rip: ::c_ulonglong, + pub cs: ::c_ulonglong, + pub eflags: ::c_ulonglong, + pub rsp: ::c_ulonglong, + pub ss: ::c_ulonglong, + pub fs_base: ::c_ulonglong, + pub gs_base: ::c_ulonglong, + pub ds: ::c_ulonglong, + pub es: ::c_ulonglong, + pub fs: ::c_ulonglong, + pub gs: ::c_ulonglong, + } + + pub struct user { + pub regs: user_regs_struct, + pub u_fpvalid: ::c_int, + pub i387: user_fpregs_struct, + pub u_tsize: ::c_ulonglong, + pub u_dsize: ::c_ulonglong, + pub u_ssize: ::c_ulonglong, + pub start_code: ::c_ulonglong, + pub start_stack: ::c_ulonglong, + pub signal: ::c_longlong, + __reserved: ::c_int, + #[cfg(target_pointer_width = "32")] + __pad1: u32, + pub u_ar0: *mut user_regs_struct, + #[cfg(target_pointer_width = "32")] + __pad2: u32, + pub u_fpstate: *mut user_fpregs_struct, + pub magic: ::c_ulonglong, + pub u_comm: [::c_char; 32], + pub u_debugreg: [::c_ulonglong; 8], + } + + pub struct mcontext_t { + pub gregs: [greg_t; 23], + pub fpregs: *mut _libc_fpstate, + __private: [u64; 8], + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_ushort, + __pad1: ::c_ushort, + pub __seq: ::c_ushort, + __pad2: ::c_ushort, + __unused1: u64, + __unused2: u64 + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: u64, + __unused5: u64 + } + + pub struct seccomp_notif_sizes { + pub seccomp_notif: ::__u16, + pub seccomp_notif_resp: ::__u16, + pub seccomp_data: ::__u16, + } +} + +s_no_extra_traits! { + pub struct user_fpregs_struct { + pub cwd: ::c_ushort, + pub swd: ::c_ushort, + pub ftw: ::c_ushort, + pub fop: ::c_ushort, + pub rip: ::c_ulonglong, + pub rdp: ::c_ulonglong, + pub mxcsr: ::c_uint, + pub mxcr_mask: ::c_uint, + pub st_space: [::c_uint; 32], + pub xmm_space: [::c_uint; 64], + padding: [::c_uint; 24], + } + + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask: ::sigset_t, + __private: [u8; 512], + // FIXME: the shadow stack field requires glibc >= 2.28. + // Re-add once we drop compatibility with glibc versions older than + // 2.28. + // + // __ssp: [::c_ulonglong; 4], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for user_fpregs_struct { + fn eq(&self, other: &user_fpregs_struct) -> bool { + self.cwd == other.cwd + && self.swd == other.swd + && self.ftw == other.ftw + && self.fop == other.fop + && self.rip == other.rip + && self.rdp == other.rdp + && self.mxcsr == other.mxcsr + && self.mxcr_mask == other.mxcr_mask + && self.st_space == other.st_space + && self + .xmm_space + .iter() + .zip(other.xmm_space.iter()) + .all(|(a,b)| a == b) + // Ignore padding field + } + } + + impl Eq for user_fpregs_struct {} + + impl ::fmt::Debug for user_fpregs_struct { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("user_fpregs_struct") + .field("cwd", &self.cwd) + .field("ftw", &self.ftw) + .field("fop", &self.fop) + .field("rip", &self.rip) + .field("rdp", &self.rdp) + .field("mxcsr", &self.mxcsr) + .field("mxcr_mask", &self.mxcr_mask) + .field("st_space", &self.st_space) + // FIXME: .field("xmm_space", &self.xmm_space) + // Ignore padding field + .finish() + } + } + + impl ::hash::Hash for user_fpregs_struct { + fn hash(&self, state: &mut H) { + self.cwd.hash(state); + self.ftw.hash(state); + self.fop.hash(state); + self.rip.hash(state); + self.rdp.hash(state); + self.mxcsr.hash(state); + self.mxcr_mask.hash(state); + self.st_space.hash(state); + self.xmm_space.hash(state); + // Ignore padding field + } + } + + impl PartialEq for ucontext_t { + fn eq(&self, other: &ucontext_t) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_sigmask == other.uc_sigmask + // Ignore __private field + } + } + + impl Eq for ucontext_t {} + + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_flags) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field("uc_sigmask", &self.uc_sigmask) + // Ignore __private field + .finish() + } + } + + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + self.uc_sigmask.hash(state); + // Ignore __private field + } + } + } +} + +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; + +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 0x101000; +pub const O_NOATIME: ::c_int = 0o1000000; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; + +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = 31; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_NDELAY: ::c_int = 0x800; + +pub const PTRACE_DETACH: ::c_uint = 17; + +pub const EFD_NONBLOCK: ::c_int = 0x800; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const F_RDLCK: ::c_int = 0; +pub const F_WRLCK: ::c_int = 1; +pub const F_UNLCK: ::c_int = 2; + +pub const SFD_NONBLOCK: ::c_int = 0x0800; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const SFD_CLOEXEC: ::c_int = 0x080000; + +pub const NCCS: usize = 32; + +pub const O_TRUNC: ::c_int = 512; + +pub const O_CLOEXEC: ::c_int = 0x80000; + +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; + +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +pub const EFD_CLOEXEC: ::c_int = 0x80000; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; + +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; + +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_32BIT: ::c_int = 0x0040; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const EDEADLOCK: ::c_int = 35; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; + +pub const PTRACE_GETFPREGS: ::c_uint = 14; +pub const PTRACE_SETFPREGS: ::c_uint = 15; +pub const PTRACE_GETFPXREGS: ::c_uint = 18; +pub const PTRACE_SETFPXREGS: ::c_uint = 19; +pub const PTRACE_GETREGS: ::c_uint = 12; +pub const PTRACE_SETREGS: ::c_uint = 13; +pub const PTRACE_PEEKSIGINFO_SHARED: ::c_uint = 1; +pub const PTRACE_SYSEMU: ::c_uint = 31; +pub const PTRACE_SYSEMU_SINGLESTEP: ::c_uint = 32; + +pub const PR_GET_SPECULATION_CTRL: ::c_int = 52; +pub const PR_SET_SPECULATION_CTRL: ::c_int = 53; +pub const PR_SPEC_NOT_AFFECTED: ::c_uint = 0; +pub const PR_SPEC_PRCTL: ::c_uint = 1 << 0; +pub const PR_SPEC_ENABLE: ::c_uint = 1 << 1; +pub const PR_SPEC_DISABLE: ::c_uint = 1 << 2; +pub const PR_SPEC_FORCE_DISABLE: ::c_uint = 1 << 3; +pub const PR_SPEC_DISABLE_NOEXEC: ::c_uint = 1 << 4; +pub const PR_SPEC_STORE_BYPASS: ::c_int = 0; +pub const PR_SPEC_INDIRECT_BRANCH: ::c_int = 1; +// FIXME: perharps for later +//pub const PR_SPEC_L1D_FLUSH: ::c_int = 2; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; +pub const EXTPROC: ::tcflag_t = 0x00010000; + +// offsets in user_regs_structs, from sys/reg.h +pub const R15: ::c_int = 0; +pub const R14: ::c_int = 1; +pub const R13: ::c_int = 2; +pub const R12: ::c_int = 3; +pub const RBP: ::c_int = 4; +pub const RBX: ::c_int = 5; +pub const R11: ::c_int = 6; +pub const R10: ::c_int = 7; +pub const R9: ::c_int = 8; +pub const R8: ::c_int = 9; +pub const RAX: ::c_int = 10; +pub const RCX: ::c_int = 11; +pub const RDX: ::c_int = 12; +pub const RSI: ::c_int = 13; +pub const RDI: ::c_int = 14; +pub const ORIG_RAX: ::c_int = 15; +pub const RIP: ::c_int = 16; +pub const CS: ::c_int = 17; +pub const EFLAGS: ::c_int = 18; +pub const RSP: ::c_int = 19; +pub const SS: ::c_int = 20; +pub const FS_BASE: ::c_int = 21; +pub const GS_BASE: ::c_int = 22; +pub const DS: ::c_int = 23; +pub const ES: ::c_int = 24; +pub const FS: ::c_int = 25; +pub const GS: ::c_int = 26; + +// offsets in mcontext_t.gregs from sys/ucontext.h +pub const REG_R8: ::c_int = 0; +pub const REG_R9: ::c_int = 1; +pub const REG_R10: ::c_int = 2; +pub const REG_R11: ::c_int = 3; +pub const REG_R12: ::c_int = 4; +pub const REG_R13: ::c_int = 5; +pub const REG_R14: ::c_int = 6; +pub const REG_R15: ::c_int = 7; +pub const REG_RDI: ::c_int = 8; +pub const REG_RSI: ::c_int = 9; +pub const REG_RBP: ::c_int = 10; +pub const REG_RBX: ::c_int = 11; +pub const REG_RDX: ::c_int = 12; +pub const REG_RAX: ::c_int = 13; +pub const REG_RCX: ::c_int = 14; +pub const REG_RSP: ::c_int = 15; +pub const REG_RIP: ::c_int = 16; +pub const REG_EFL: ::c_int = 17; +pub const REG_CSGSFS: ::c_int = 18; +pub const REG_ERR: ::c_int = 19; +pub const REG_TRAPNO: ::c_int = 20; +pub const REG_OLDMASK: ::c_int = 21; +pub const REG_CR2: ::c_int = 22; + +pub const SECCOMP_SET_MODE_STRICT: ::c_uint = 0; +pub const SECCOMP_SET_MODE_FILTER: ::c_uint = 1; +pub const SECCOMP_GET_ACTION_AVAIL: ::c_uint = 2; +pub const SECCOMP_GET_NOTIF_SIZES: ::c_uint = 3; + +extern "C" { + pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int; + pub fn setcontext(ucp: *const ucontext_t) -> ::c_int; + pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...); + pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int; + pub fn iopl(level: ::c_int) -> ::c_int; + pub fn ioperm(from: ::c_ulong, num: ::c_ulong, turn_on: ::c_int) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_pointer_width = "32")] { + mod x32; + pub use self::x32::*; + } else { + mod not_x32; + pub use self::not_x32::*; + } +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs new file mode 100644 index 0000000000000000000000000000000000000000..f840f9f443ca014c5fe4a7c8688ae55a9f1fe5ee --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs @@ -0,0 +1,442 @@ +use pthread_mutex_t; + +pub type c_long = i64; +pub type c_ulong = u64; + +s! { + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } +} + +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + +align_const! { + #[cfg(target_endian = "little")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "little")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + #[cfg(target_endian = "big")] + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +} + +// Syscall table + +pub const SYS_read: ::c_long = 0; +pub const SYS_write: ::c_long = 1; +pub const SYS_open: ::c_long = 2; +pub const SYS_close: ::c_long = 3; +pub const SYS_stat: ::c_long = 4; +pub const SYS_fstat: ::c_long = 5; +pub const SYS_lstat: ::c_long = 6; +pub const SYS_poll: ::c_long = 7; +pub const SYS_lseek: ::c_long = 8; +pub const SYS_mmap: ::c_long = 9; +pub const SYS_mprotect: ::c_long = 10; +pub const SYS_munmap: ::c_long = 11; +pub const SYS_brk: ::c_long = 12; +pub const SYS_rt_sigaction: ::c_long = 13; +pub const SYS_rt_sigprocmask: ::c_long = 14; +pub const SYS_rt_sigreturn: ::c_long = 15; +pub const SYS_ioctl: ::c_long = 16; +pub const SYS_pread64: ::c_long = 17; +pub const SYS_pwrite64: ::c_long = 18; +pub const SYS_readv: ::c_long = 19; +pub const SYS_writev: ::c_long = 20; +pub const SYS_access: ::c_long = 21; +pub const SYS_pipe: ::c_long = 22; +pub const SYS_select: ::c_long = 23; +pub const SYS_sched_yield: ::c_long = 24; +pub const SYS_mremap: ::c_long = 25; +pub const SYS_msync: ::c_long = 26; +pub const SYS_mincore: ::c_long = 27; +pub const SYS_madvise: ::c_long = 28; +pub const SYS_shmget: ::c_long = 29; +pub const SYS_shmat: ::c_long = 30; +pub const SYS_shmctl: ::c_long = 31; +pub const SYS_dup: ::c_long = 32; +pub const SYS_dup2: ::c_long = 33; +pub const SYS_pause: ::c_long = 34; +pub const SYS_nanosleep: ::c_long = 35; +pub const SYS_getitimer: ::c_long = 36; +pub const SYS_alarm: ::c_long = 37; +pub const SYS_setitimer: ::c_long = 38; +pub const SYS_getpid: ::c_long = 39; +pub const SYS_sendfile: ::c_long = 40; +pub const SYS_socket: ::c_long = 41; +pub const SYS_connect: ::c_long = 42; +pub const SYS_accept: ::c_long = 43; +pub const SYS_sendto: ::c_long = 44; +pub const SYS_recvfrom: ::c_long = 45; +pub const SYS_sendmsg: ::c_long = 46; +pub const SYS_recvmsg: ::c_long = 47; +pub const SYS_shutdown: ::c_long = 48; +pub const SYS_bind: ::c_long = 49; +pub const SYS_listen: ::c_long = 50; +pub const SYS_getsockname: ::c_long = 51; +pub const SYS_getpeername: ::c_long = 52; +pub const SYS_socketpair: ::c_long = 53; +pub const SYS_setsockopt: ::c_long = 54; +pub const SYS_getsockopt: ::c_long = 55; +pub const SYS_clone: ::c_long = 56; +pub const SYS_fork: ::c_long = 57; +pub const SYS_vfork: ::c_long = 58; +pub const SYS_execve: ::c_long = 59; +pub const SYS_exit: ::c_long = 60; +pub const SYS_wait4: ::c_long = 61; +pub const SYS_kill: ::c_long = 62; +pub const SYS_uname: ::c_long = 63; +pub const SYS_semget: ::c_long = 64; +pub const SYS_semop: ::c_long = 65; +pub const SYS_semctl: ::c_long = 66; +pub const SYS_shmdt: ::c_long = 67; +pub const SYS_msgget: ::c_long = 68; +pub const SYS_msgsnd: ::c_long = 69; +pub const SYS_msgrcv: ::c_long = 70; +pub const SYS_msgctl: ::c_long = 71; +pub const SYS_fcntl: ::c_long = 72; +pub const SYS_flock: ::c_long = 73; +pub const SYS_fsync: ::c_long = 74; +pub const SYS_fdatasync: ::c_long = 75; +pub const SYS_truncate: ::c_long = 76; +pub const SYS_ftruncate: ::c_long = 77; +pub const SYS_getdents: ::c_long = 78; +pub const SYS_getcwd: ::c_long = 79; +pub const SYS_chdir: ::c_long = 80; +pub const SYS_fchdir: ::c_long = 81; +pub const SYS_rename: ::c_long = 82; +pub const SYS_mkdir: ::c_long = 83; +pub const SYS_rmdir: ::c_long = 84; +pub const SYS_creat: ::c_long = 85; +pub const SYS_link: ::c_long = 86; +pub const SYS_unlink: ::c_long = 87; +pub const SYS_symlink: ::c_long = 88; +pub const SYS_readlink: ::c_long = 89; +pub const SYS_chmod: ::c_long = 90; +pub const SYS_fchmod: ::c_long = 91; +pub const SYS_chown: ::c_long = 92; +pub const SYS_fchown: ::c_long = 93; +pub const SYS_lchown: ::c_long = 94; +pub const SYS_umask: ::c_long = 95; +pub const SYS_gettimeofday: ::c_long = 96; +pub const SYS_getrlimit: ::c_long = 97; +pub const SYS_getrusage: ::c_long = 98; +pub const SYS_sysinfo: ::c_long = 99; +pub const SYS_times: ::c_long = 100; +pub const SYS_ptrace: ::c_long = 101; +pub const SYS_getuid: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_getgid: ::c_long = 104; +pub const SYS_setuid: ::c_long = 105; +pub const SYS_setgid: ::c_long = 106; +pub const SYS_geteuid: ::c_long = 107; +pub const SYS_getegid: ::c_long = 108; +pub const SYS_setpgid: ::c_long = 109; +pub const SYS_getppid: ::c_long = 110; +pub const SYS_getpgrp: ::c_long = 111; +pub const SYS_setsid: ::c_long = 112; +pub const SYS_setreuid: ::c_long = 113; +pub const SYS_setregid: ::c_long = 114; +pub const SYS_getgroups: ::c_long = 115; +pub const SYS_setgroups: ::c_long = 116; +pub const SYS_setresuid: ::c_long = 117; +pub const SYS_getresuid: ::c_long = 118; +pub const SYS_setresgid: ::c_long = 119; +pub const SYS_getresgid: ::c_long = 120; +pub const SYS_getpgid: ::c_long = 121; +pub const SYS_setfsuid: ::c_long = 122; +pub const SYS_setfsgid: ::c_long = 123; +pub const SYS_getsid: ::c_long = 124; +pub const SYS_capget: ::c_long = 125; +pub const SYS_capset: ::c_long = 126; +pub const SYS_rt_sigpending: ::c_long = 127; +pub const SYS_rt_sigtimedwait: ::c_long = 128; +pub const SYS_rt_sigqueueinfo: ::c_long = 129; +pub const SYS_rt_sigsuspend: ::c_long = 130; +pub const SYS_sigaltstack: ::c_long = 131; +pub const SYS_utime: ::c_long = 132; +pub const SYS_mknod: ::c_long = 133; +pub const SYS_uselib: ::c_long = 134; +pub const SYS_personality: ::c_long = 135; +pub const SYS_ustat: ::c_long = 136; +pub const SYS_statfs: ::c_long = 137; +pub const SYS_fstatfs: ::c_long = 138; +pub const SYS_sysfs: ::c_long = 139; +pub const SYS_getpriority: ::c_long = 140; +pub const SYS_setpriority: ::c_long = 141; +pub const SYS_sched_setparam: ::c_long = 142; +pub const SYS_sched_getparam: ::c_long = 143; +pub const SYS_sched_setscheduler: ::c_long = 144; +pub const SYS_sched_getscheduler: ::c_long = 145; +pub const SYS_sched_get_priority_max: ::c_long = 146; +pub const SYS_sched_get_priority_min: ::c_long = 147; +pub const SYS_sched_rr_get_interval: ::c_long = 148; +pub const SYS_mlock: ::c_long = 149; +pub const SYS_munlock: ::c_long = 150; +pub const SYS_mlockall: ::c_long = 151; +pub const SYS_munlockall: ::c_long = 152; +pub const SYS_vhangup: ::c_long = 153; +pub const SYS_modify_ldt: ::c_long = 154; +pub const SYS_pivot_root: ::c_long = 155; +pub const SYS__sysctl: ::c_long = 156; +pub const SYS_prctl: ::c_long = 157; +pub const SYS_arch_prctl: ::c_long = 158; +pub const SYS_adjtimex: ::c_long = 159; +pub const SYS_setrlimit: ::c_long = 160; +pub const SYS_chroot: ::c_long = 161; +pub const SYS_sync: ::c_long = 162; +pub const SYS_acct: ::c_long = 163; +pub const SYS_settimeofday: ::c_long = 164; +pub const SYS_mount: ::c_long = 165; +pub const SYS_umount2: ::c_long = 166; +pub const SYS_swapon: ::c_long = 167; +pub const SYS_swapoff: ::c_long = 168; +pub const SYS_reboot: ::c_long = 169; +pub const SYS_sethostname: ::c_long = 170; +pub const SYS_setdomainname: ::c_long = 171; +pub const SYS_iopl: ::c_long = 172; +pub const SYS_ioperm: ::c_long = 173; +pub const SYS_create_module: ::c_long = 174; +pub const SYS_init_module: ::c_long = 175; +pub const SYS_delete_module: ::c_long = 176; +pub const SYS_get_kernel_syms: ::c_long = 177; +pub const SYS_query_module: ::c_long = 178; +pub const SYS_quotactl: ::c_long = 179; +pub const SYS_nfsservctl: ::c_long = 180; +pub const SYS_getpmsg: ::c_long = 181; +pub const SYS_putpmsg: ::c_long = 182; +pub const SYS_afs_syscall: ::c_long = 183; +pub const SYS_tuxcall: ::c_long = 184; +pub const SYS_security: ::c_long = 185; +pub const SYS_gettid: ::c_long = 186; +pub const SYS_readahead: ::c_long = 187; +pub const SYS_setxattr: ::c_long = 188; +pub const SYS_lsetxattr: ::c_long = 189; +pub const SYS_fsetxattr: ::c_long = 190; +pub const SYS_getxattr: ::c_long = 191; +pub const SYS_lgetxattr: ::c_long = 192; +pub const SYS_fgetxattr: ::c_long = 193; +pub const SYS_listxattr: ::c_long = 194; +pub const SYS_llistxattr: ::c_long = 195; +pub const SYS_flistxattr: ::c_long = 196; +pub const SYS_removexattr: ::c_long = 197; +pub const SYS_lremovexattr: ::c_long = 198; +pub const SYS_fremovexattr: ::c_long = 199; +pub const SYS_tkill: ::c_long = 200; +pub const SYS_time: ::c_long = 201; +pub const SYS_futex: ::c_long = 202; +pub const SYS_sched_setaffinity: ::c_long = 203; +pub const SYS_sched_getaffinity: ::c_long = 204; +pub const SYS_set_thread_area: ::c_long = 205; +pub const SYS_io_setup: ::c_long = 206; +pub const SYS_io_destroy: ::c_long = 207; +pub const SYS_io_getevents: ::c_long = 208; +pub const SYS_io_submit: ::c_long = 209; +pub const SYS_io_cancel: ::c_long = 210; +pub const SYS_get_thread_area: ::c_long = 211; +pub const SYS_lookup_dcookie: ::c_long = 212; +pub const SYS_epoll_create: ::c_long = 213; +pub const SYS_epoll_ctl_old: ::c_long = 214; +pub const SYS_epoll_wait_old: ::c_long = 215; +pub const SYS_remap_file_pages: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; +pub const SYS_set_tid_address: ::c_long = 218; +pub const SYS_restart_syscall: ::c_long = 219; +pub const SYS_semtimedop: ::c_long = 220; +pub const SYS_fadvise64: ::c_long = 221; +pub const SYS_timer_create: ::c_long = 222; +pub const SYS_timer_settime: ::c_long = 223; +pub const SYS_timer_gettime: ::c_long = 224; +pub const SYS_timer_getoverrun: ::c_long = 225; +pub const SYS_timer_delete: ::c_long = 226; +pub const SYS_clock_settime: ::c_long = 227; +pub const SYS_clock_gettime: ::c_long = 228; +pub const SYS_clock_getres: ::c_long = 229; +pub const SYS_clock_nanosleep: ::c_long = 230; +pub const SYS_exit_group: ::c_long = 231; +pub const SYS_epoll_wait: ::c_long = 232; +pub const SYS_epoll_ctl: ::c_long = 233; +pub const SYS_tgkill: ::c_long = 234; +pub const SYS_utimes: ::c_long = 235; +pub const SYS_vserver: ::c_long = 236; +pub const SYS_mbind: ::c_long = 237; +pub const SYS_set_mempolicy: ::c_long = 238; +pub const SYS_get_mempolicy: ::c_long = 239; +pub const SYS_mq_open: ::c_long = 240; +pub const SYS_mq_unlink: ::c_long = 241; +pub const SYS_mq_timedsend: ::c_long = 242; +pub const SYS_mq_timedreceive: ::c_long = 243; +pub const SYS_mq_notify: ::c_long = 244; +pub const SYS_mq_getsetattr: ::c_long = 245; +pub const SYS_kexec_load: ::c_long = 246; +pub const SYS_waitid: ::c_long = 247; +pub const SYS_add_key: ::c_long = 248; +pub const SYS_request_key: ::c_long = 249; +pub const SYS_keyctl: ::c_long = 250; +pub const SYS_ioprio_set: ::c_long = 251; +pub const SYS_ioprio_get: ::c_long = 252; +pub const SYS_inotify_init: ::c_long = 253; +pub const SYS_inotify_add_watch: ::c_long = 254; +pub const SYS_inotify_rm_watch: ::c_long = 255; +pub const SYS_migrate_pages: ::c_long = 256; +pub const SYS_openat: ::c_long = 257; +pub const SYS_mkdirat: ::c_long = 258; +pub const SYS_mknodat: ::c_long = 259; +pub const SYS_fchownat: ::c_long = 260; +pub const SYS_futimesat: ::c_long = 261; +pub const SYS_newfstatat: ::c_long = 262; +pub const SYS_unlinkat: ::c_long = 263; +pub const SYS_renameat: ::c_long = 264; +pub const SYS_linkat: ::c_long = 265; +pub const SYS_symlinkat: ::c_long = 266; +pub const SYS_readlinkat: ::c_long = 267; +pub const SYS_fchmodat: ::c_long = 268; +pub const SYS_faccessat: ::c_long = 269; +pub const SYS_pselect6: ::c_long = 270; +pub const SYS_ppoll: ::c_long = 271; +pub const SYS_unshare: ::c_long = 272; +pub const SYS_set_robust_list: ::c_long = 273; +pub const SYS_get_robust_list: ::c_long = 274; +pub const SYS_splice: ::c_long = 275; +pub const SYS_tee: ::c_long = 276; +pub const SYS_sync_file_range: ::c_long = 277; +pub const SYS_vmsplice: ::c_long = 278; +pub const SYS_move_pages: ::c_long = 279; +pub const SYS_utimensat: ::c_long = 280; +pub const SYS_epoll_pwait: ::c_long = 281; +pub const SYS_signalfd: ::c_long = 282; +pub const SYS_timerfd_create: ::c_long = 283; +pub const SYS_eventfd: ::c_long = 284; +pub const SYS_fallocate: ::c_long = 285; +pub const SYS_timerfd_settime: ::c_long = 286; +pub const SYS_timerfd_gettime: ::c_long = 287; +pub const SYS_accept4: ::c_long = 288; +pub const SYS_signalfd4: ::c_long = 289; +pub const SYS_eventfd2: ::c_long = 290; +pub const SYS_epoll_create1: ::c_long = 291; +pub const SYS_dup3: ::c_long = 292; +pub const SYS_pipe2: ::c_long = 293; +pub const SYS_inotify_init1: ::c_long = 294; +pub const SYS_preadv: ::c_long = 295; +pub const SYS_pwritev: ::c_long = 296; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 297; +pub const SYS_perf_event_open: ::c_long = 298; +pub const SYS_recvmmsg: ::c_long = 299; +pub const SYS_fanotify_init: ::c_long = 300; +pub const SYS_fanotify_mark: ::c_long = 301; +pub const SYS_prlimit64: ::c_long = 302; +pub const SYS_name_to_handle_at: ::c_long = 303; +pub const SYS_open_by_handle_at: ::c_long = 304; +pub const SYS_clock_adjtime: ::c_long = 305; +pub const SYS_syncfs: ::c_long = 306; +pub const SYS_sendmmsg: ::c_long = 307; +pub const SYS_setns: ::c_long = 308; +pub const SYS_getcpu: ::c_long = 309; +pub const SYS_process_vm_readv: ::c_long = 310; +pub const SYS_process_vm_writev: ::c_long = 311; +pub const SYS_kcmp: ::c_long = 312; +pub const SYS_finit_module: ::c_long = 313; +pub const SYS_sched_setattr: ::c_long = 314; +pub const SYS_sched_getattr: ::c_long = 315; +pub const SYS_renameat2: ::c_long = 316; +pub const SYS_seccomp: ::c_long = 317; +pub const SYS_getrandom: ::c_long = 318; +pub const SYS_memfd_create: ::c_long = 319; +pub const SYS_kexec_file_load: ::c_long = 320; +pub const SYS_bpf: ::c_long = 321; +pub const SYS_execveat: ::c_long = 322; +pub const SYS_userfaultfd: ::c_long = 323; +pub const SYS_membarrier: ::c_long = 324; +pub const SYS_mlock2: ::c_long = 325; +pub const SYS_copy_file_range: ::c_long = 326; +pub const SYS_preadv2: ::c_long = 327; +pub const SYS_pwritev2: ::c_long = 328; +pub const SYS_pkey_mprotect: ::c_long = 329; +pub const SYS_pkey_alloc: ::c_long = 330; +pub const SYS_pkey_free: ::c_long = 331; +pub const SYS_statx: ::c_long = 332; +pub const SYS_rseq: ::c_long = 334; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +extern "C" { + pub fn sysctl( + name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs new file mode 100644 index 0000000000000000000000000000000000000000..de1a8b94b9cc992cfb30acd78207b491d7f9a98a --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs @@ -0,0 +1,395 @@ +use pthread_mutex_t; + +pub type c_long = i32; +pub type c_ulong = u32; + +s! { + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } +} + +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 44; + +align_const! { + pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; + pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = + pthread_mutex_t { + size: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], + }; +} + +// Syscall table + +pub const __X32_SYSCALL_BIT: ::c_long = 0x40000000; + +pub const SYS_read: ::c_long = __X32_SYSCALL_BIT + 0; +pub const SYS_write: ::c_long = __X32_SYSCALL_BIT + 1; +pub const SYS_open: ::c_long = __X32_SYSCALL_BIT + 2; +pub const SYS_close: ::c_long = __X32_SYSCALL_BIT + 3; +pub const SYS_stat: ::c_long = __X32_SYSCALL_BIT + 4; +pub const SYS_fstat: ::c_long = __X32_SYSCALL_BIT + 5; +pub const SYS_lstat: ::c_long = __X32_SYSCALL_BIT + 6; +pub const SYS_poll: ::c_long = __X32_SYSCALL_BIT + 7; +pub const SYS_lseek: ::c_long = __X32_SYSCALL_BIT + 8; +pub const SYS_mmap: ::c_long = __X32_SYSCALL_BIT + 9; +pub const SYS_mprotect: ::c_long = __X32_SYSCALL_BIT + 10; +pub const SYS_munmap: ::c_long = __X32_SYSCALL_BIT + 11; +pub const SYS_brk: ::c_long = __X32_SYSCALL_BIT + 12; +pub const SYS_rt_sigprocmask: ::c_long = __X32_SYSCALL_BIT + 14; +pub const SYS_pread64: ::c_long = __X32_SYSCALL_BIT + 17; +pub const SYS_pwrite64: ::c_long = __X32_SYSCALL_BIT + 18; +pub const SYS_access: ::c_long = __X32_SYSCALL_BIT + 21; +pub const SYS_pipe: ::c_long = __X32_SYSCALL_BIT + 22; +pub const SYS_select: ::c_long = __X32_SYSCALL_BIT + 23; +pub const SYS_sched_yield: ::c_long = __X32_SYSCALL_BIT + 24; +pub const SYS_mremap: ::c_long = __X32_SYSCALL_BIT + 25; +pub const SYS_msync: ::c_long = __X32_SYSCALL_BIT + 26; +pub const SYS_mincore: ::c_long = __X32_SYSCALL_BIT + 27; +pub const SYS_madvise: ::c_long = __X32_SYSCALL_BIT + 28; +pub const SYS_shmget: ::c_long = __X32_SYSCALL_BIT + 29; +pub const SYS_shmat: ::c_long = __X32_SYSCALL_BIT + 30; +pub const SYS_shmctl: ::c_long = __X32_SYSCALL_BIT + 31; +pub const SYS_dup: ::c_long = __X32_SYSCALL_BIT + 32; +pub const SYS_dup2: ::c_long = __X32_SYSCALL_BIT + 33; +pub const SYS_pause: ::c_long = __X32_SYSCALL_BIT + 34; +pub const SYS_nanosleep: ::c_long = __X32_SYSCALL_BIT + 35; +pub const SYS_getitimer: ::c_long = __X32_SYSCALL_BIT + 36; +pub const SYS_alarm: ::c_long = __X32_SYSCALL_BIT + 37; +pub const SYS_setitimer: ::c_long = __X32_SYSCALL_BIT + 38; +pub const SYS_getpid: ::c_long = __X32_SYSCALL_BIT + 39; +pub const SYS_sendfile: ::c_long = __X32_SYSCALL_BIT + 40; +pub const SYS_socket: ::c_long = __X32_SYSCALL_BIT + 41; +pub const SYS_connect: ::c_long = __X32_SYSCALL_BIT + 42; +pub const SYS_accept: ::c_long = __X32_SYSCALL_BIT + 43; +pub const SYS_sendto: ::c_long = __X32_SYSCALL_BIT + 44; +pub const SYS_shutdown: ::c_long = __X32_SYSCALL_BIT + 48; +pub const SYS_bind: ::c_long = __X32_SYSCALL_BIT + 49; +pub const SYS_listen: ::c_long = __X32_SYSCALL_BIT + 50; +pub const SYS_getsockname: ::c_long = __X32_SYSCALL_BIT + 51; +pub const SYS_getpeername: ::c_long = __X32_SYSCALL_BIT + 52; +pub const SYS_socketpair: ::c_long = __X32_SYSCALL_BIT + 53; +pub const SYS_clone: ::c_long = __X32_SYSCALL_BIT + 56; +pub const SYS_fork: ::c_long = __X32_SYSCALL_BIT + 57; +pub const SYS_vfork: ::c_long = __X32_SYSCALL_BIT + 58; +pub const SYS_exit: ::c_long = __X32_SYSCALL_BIT + 60; +pub const SYS_wait4: ::c_long = __X32_SYSCALL_BIT + 61; +pub const SYS_kill: ::c_long = __X32_SYSCALL_BIT + 62; +pub const SYS_uname: ::c_long = __X32_SYSCALL_BIT + 63; +pub const SYS_semget: ::c_long = __X32_SYSCALL_BIT + 64; +pub const SYS_semop: ::c_long = __X32_SYSCALL_BIT + 65; +pub const SYS_semctl: ::c_long = __X32_SYSCALL_BIT + 66; +pub const SYS_shmdt: ::c_long = __X32_SYSCALL_BIT + 67; +pub const SYS_msgget: ::c_long = __X32_SYSCALL_BIT + 68; +pub const SYS_msgsnd: ::c_long = __X32_SYSCALL_BIT + 69; +pub const SYS_msgrcv: ::c_long = __X32_SYSCALL_BIT + 70; +pub const SYS_msgctl: ::c_long = __X32_SYSCALL_BIT + 71; +pub const SYS_fcntl: ::c_long = __X32_SYSCALL_BIT + 72; +pub const SYS_flock: ::c_long = __X32_SYSCALL_BIT + 73; +pub const SYS_fsync: ::c_long = __X32_SYSCALL_BIT + 74; +pub const SYS_fdatasync: ::c_long = __X32_SYSCALL_BIT + 75; +pub const SYS_truncate: ::c_long = __X32_SYSCALL_BIT + 76; +pub const SYS_ftruncate: ::c_long = __X32_SYSCALL_BIT + 77; +pub const SYS_getdents: ::c_long = __X32_SYSCALL_BIT + 78; +pub const SYS_getcwd: ::c_long = __X32_SYSCALL_BIT + 79; +pub const SYS_chdir: ::c_long = __X32_SYSCALL_BIT + 80; +pub const SYS_fchdir: ::c_long = __X32_SYSCALL_BIT + 81; +pub const SYS_rename: ::c_long = __X32_SYSCALL_BIT + 82; +pub const SYS_mkdir: ::c_long = __X32_SYSCALL_BIT + 83; +pub const SYS_rmdir: ::c_long = __X32_SYSCALL_BIT + 84; +pub const SYS_creat: ::c_long = __X32_SYSCALL_BIT + 85; +pub const SYS_link: ::c_long = __X32_SYSCALL_BIT + 86; +pub const SYS_unlink: ::c_long = __X32_SYSCALL_BIT + 87; +pub const SYS_symlink: ::c_long = __X32_SYSCALL_BIT + 88; +pub const SYS_readlink: ::c_long = __X32_SYSCALL_BIT + 89; +pub const SYS_chmod: ::c_long = __X32_SYSCALL_BIT + 90; +pub const SYS_fchmod: ::c_long = __X32_SYSCALL_BIT + 91; +pub const SYS_chown: ::c_long = __X32_SYSCALL_BIT + 92; +pub const SYS_fchown: ::c_long = __X32_SYSCALL_BIT + 93; +pub const SYS_lchown: ::c_long = __X32_SYSCALL_BIT + 94; +pub const SYS_umask: ::c_long = __X32_SYSCALL_BIT + 95; +pub const SYS_gettimeofday: ::c_long = __X32_SYSCALL_BIT + 96; +pub const SYS_getrlimit: ::c_long = __X32_SYSCALL_BIT + 97; +pub const SYS_getrusage: ::c_long = __X32_SYSCALL_BIT + 98; +pub const SYS_sysinfo: ::c_long = __X32_SYSCALL_BIT + 99; +pub const SYS_times: ::c_long = __X32_SYSCALL_BIT + 100; +pub const SYS_getuid: ::c_long = __X32_SYSCALL_BIT + 102; +pub const SYS_syslog: ::c_long = __X32_SYSCALL_BIT + 103; +pub const SYS_getgid: ::c_long = __X32_SYSCALL_BIT + 104; +pub const SYS_setuid: ::c_long = __X32_SYSCALL_BIT + 105; +pub const SYS_setgid: ::c_long = __X32_SYSCALL_BIT + 106; +pub const SYS_geteuid: ::c_long = __X32_SYSCALL_BIT + 107; +pub const SYS_getegid: ::c_long = __X32_SYSCALL_BIT + 108; +pub const SYS_setpgid: ::c_long = __X32_SYSCALL_BIT + 109; +pub const SYS_getppid: ::c_long = __X32_SYSCALL_BIT + 110; +pub const SYS_getpgrp: ::c_long = __X32_SYSCALL_BIT + 111; +pub const SYS_setsid: ::c_long = __X32_SYSCALL_BIT + 112; +pub const SYS_setreuid: ::c_long = __X32_SYSCALL_BIT + 113; +pub const SYS_setregid: ::c_long = __X32_SYSCALL_BIT + 114; +pub const SYS_getgroups: ::c_long = __X32_SYSCALL_BIT + 115; +pub const SYS_setgroups: ::c_long = __X32_SYSCALL_BIT + 116; +pub const SYS_setresuid: ::c_long = __X32_SYSCALL_BIT + 117; +pub const SYS_getresuid: ::c_long = __X32_SYSCALL_BIT + 118; +pub const SYS_setresgid: ::c_long = __X32_SYSCALL_BIT + 119; +pub const SYS_getresgid: ::c_long = __X32_SYSCALL_BIT + 120; +pub const SYS_getpgid: ::c_long = __X32_SYSCALL_BIT + 121; +pub const SYS_setfsuid: ::c_long = __X32_SYSCALL_BIT + 122; +pub const SYS_setfsgid: ::c_long = __X32_SYSCALL_BIT + 123; +pub const SYS_getsid: ::c_long = __X32_SYSCALL_BIT + 124; +pub const SYS_capget: ::c_long = __X32_SYSCALL_BIT + 125; +pub const SYS_capset: ::c_long = __X32_SYSCALL_BIT + 126; +pub const SYS_rt_sigsuspend: ::c_long = __X32_SYSCALL_BIT + 130; +pub const SYS_utime: ::c_long = __X32_SYSCALL_BIT + 132; +pub const SYS_mknod: ::c_long = __X32_SYSCALL_BIT + 133; +pub const SYS_personality: ::c_long = __X32_SYSCALL_BIT + 135; +pub const SYS_ustat: ::c_long = __X32_SYSCALL_BIT + 136; +pub const SYS_statfs: ::c_long = __X32_SYSCALL_BIT + 137; +pub const SYS_fstatfs: ::c_long = __X32_SYSCALL_BIT + 138; +pub const SYS_sysfs: ::c_long = __X32_SYSCALL_BIT + 139; +pub const SYS_getpriority: ::c_long = __X32_SYSCALL_BIT + 140; +pub const SYS_setpriority: ::c_long = __X32_SYSCALL_BIT + 141; +pub const SYS_sched_setparam: ::c_long = __X32_SYSCALL_BIT + 142; +pub const SYS_sched_getparam: ::c_long = __X32_SYSCALL_BIT + 143; +pub const SYS_sched_setscheduler: ::c_long = __X32_SYSCALL_BIT + 144; +pub const SYS_sched_getscheduler: ::c_long = __X32_SYSCALL_BIT + 145; +pub const SYS_sched_get_priority_max: ::c_long = __X32_SYSCALL_BIT + 146; +pub const SYS_sched_get_priority_min: ::c_long = __X32_SYSCALL_BIT + 147; +pub const SYS_sched_rr_get_interval: ::c_long = __X32_SYSCALL_BIT + 148; +pub const SYS_mlock: ::c_long = __X32_SYSCALL_BIT + 149; +pub const SYS_munlock: ::c_long = __X32_SYSCALL_BIT + 150; +pub const SYS_mlockall: ::c_long = __X32_SYSCALL_BIT + 151; +pub const SYS_munlockall: ::c_long = __X32_SYSCALL_BIT + 152; +pub const SYS_vhangup: ::c_long = __X32_SYSCALL_BIT + 153; +pub const SYS_modify_ldt: ::c_long = __X32_SYSCALL_BIT + 154; +pub const SYS_pivot_root: ::c_long = __X32_SYSCALL_BIT + 155; +pub const SYS_prctl: ::c_long = __X32_SYSCALL_BIT + 157; +pub const SYS_arch_prctl: ::c_long = __X32_SYSCALL_BIT + 158; +pub const SYS_adjtimex: ::c_long = __X32_SYSCALL_BIT + 159; +pub const SYS_setrlimit: ::c_long = __X32_SYSCALL_BIT + 160; +pub const SYS_chroot: ::c_long = __X32_SYSCALL_BIT + 161; +pub const SYS_sync: ::c_long = __X32_SYSCALL_BIT + 162; +pub const SYS_acct: ::c_long = __X32_SYSCALL_BIT + 163; +pub const SYS_settimeofday: ::c_long = __X32_SYSCALL_BIT + 164; +pub const SYS_mount: ::c_long = __X32_SYSCALL_BIT + 165; +pub const SYS_umount2: ::c_long = __X32_SYSCALL_BIT + 166; +pub const SYS_swapon: ::c_long = __X32_SYSCALL_BIT + 167; +pub const SYS_swapoff: ::c_long = __X32_SYSCALL_BIT + 168; +pub const SYS_reboot: ::c_long = __X32_SYSCALL_BIT + 169; +pub const SYS_sethostname: ::c_long = __X32_SYSCALL_BIT + 170; +pub const SYS_setdomainname: ::c_long = __X32_SYSCALL_BIT + 171; +pub const SYS_iopl: ::c_long = __X32_SYSCALL_BIT + 172; +pub const SYS_ioperm: ::c_long = __X32_SYSCALL_BIT + 173; +pub const SYS_init_module: ::c_long = __X32_SYSCALL_BIT + 175; +pub const SYS_delete_module: ::c_long = __X32_SYSCALL_BIT + 176; +pub const SYS_quotactl: ::c_long = __X32_SYSCALL_BIT + 179; +pub const SYS_getpmsg: ::c_long = __X32_SYSCALL_BIT + 181; +pub const SYS_putpmsg: ::c_long = __X32_SYSCALL_BIT + 182; +pub const SYS_afs_syscall: ::c_long = __X32_SYSCALL_BIT + 183; +pub const SYS_tuxcall: ::c_long = __X32_SYSCALL_BIT + 184; +pub const SYS_security: ::c_long = __X32_SYSCALL_BIT + 185; +pub const SYS_gettid: ::c_long = __X32_SYSCALL_BIT + 186; +pub const SYS_readahead: ::c_long = __X32_SYSCALL_BIT + 187; +pub const SYS_setxattr: ::c_long = __X32_SYSCALL_BIT + 188; +pub const SYS_lsetxattr: ::c_long = __X32_SYSCALL_BIT + 189; +pub const SYS_fsetxattr: ::c_long = __X32_SYSCALL_BIT + 190; +pub const SYS_getxattr: ::c_long = __X32_SYSCALL_BIT + 191; +pub const SYS_lgetxattr: ::c_long = __X32_SYSCALL_BIT + 192; +pub const SYS_fgetxattr: ::c_long = __X32_SYSCALL_BIT + 193; +pub const SYS_listxattr: ::c_long = __X32_SYSCALL_BIT + 194; +pub const SYS_llistxattr: ::c_long = __X32_SYSCALL_BIT + 195; +pub const SYS_flistxattr: ::c_long = __X32_SYSCALL_BIT + 196; +pub const SYS_removexattr: ::c_long = __X32_SYSCALL_BIT + 197; +pub const SYS_lremovexattr: ::c_long = __X32_SYSCALL_BIT + 198; +pub const SYS_fremovexattr: ::c_long = __X32_SYSCALL_BIT + 199; +pub const SYS_tkill: ::c_long = __X32_SYSCALL_BIT + 200; +pub const SYS_time: ::c_long = __X32_SYSCALL_BIT + 201; +pub const SYS_futex: ::c_long = __X32_SYSCALL_BIT + 202; +pub const SYS_sched_setaffinity: ::c_long = __X32_SYSCALL_BIT + 203; +pub const SYS_sched_getaffinity: ::c_long = __X32_SYSCALL_BIT + 204; +pub const SYS_io_destroy: ::c_long = __X32_SYSCALL_BIT + 207; +pub const SYS_io_getevents: ::c_long = __X32_SYSCALL_BIT + 208; +pub const SYS_io_cancel: ::c_long = __X32_SYSCALL_BIT + 210; +pub const SYS_lookup_dcookie: ::c_long = __X32_SYSCALL_BIT + 212; +pub const SYS_epoll_create: ::c_long = __X32_SYSCALL_BIT + 213; +pub const SYS_remap_file_pages: ::c_long = __X32_SYSCALL_BIT + 216; +pub const SYS_getdents64: ::c_long = __X32_SYSCALL_BIT + 217; +pub const SYS_set_tid_address: ::c_long = __X32_SYSCALL_BIT + 218; +pub const SYS_restart_syscall: ::c_long = __X32_SYSCALL_BIT + 219; +pub const SYS_semtimedop: ::c_long = __X32_SYSCALL_BIT + 220; +pub const SYS_fadvise64: ::c_long = __X32_SYSCALL_BIT + 221; +pub const SYS_timer_settime: ::c_long = __X32_SYSCALL_BIT + 223; +pub const SYS_timer_gettime: ::c_long = __X32_SYSCALL_BIT + 224; +pub const SYS_timer_getoverrun: ::c_long = __X32_SYSCALL_BIT + 225; +pub const SYS_timer_delete: ::c_long = __X32_SYSCALL_BIT + 226; +pub const SYS_clock_settime: ::c_long = __X32_SYSCALL_BIT + 227; +pub const SYS_clock_gettime: ::c_long = __X32_SYSCALL_BIT + 228; +pub const SYS_clock_getres: ::c_long = __X32_SYSCALL_BIT + 229; +pub const SYS_clock_nanosleep: ::c_long = __X32_SYSCALL_BIT + 230; +pub const SYS_exit_group: ::c_long = __X32_SYSCALL_BIT + 231; +pub const SYS_epoll_wait: ::c_long = __X32_SYSCALL_BIT + 232; +pub const SYS_epoll_ctl: ::c_long = __X32_SYSCALL_BIT + 233; +pub const SYS_tgkill: ::c_long = __X32_SYSCALL_BIT + 234; +pub const SYS_utimes: ::c_long = __X32_SYSCALL_BIT + 235; +pub const SYS_mbind: ::c_long = __X32_SYSCALL_BIT + 237; +pub const SYS_set_mempolicy: ::c_long = __X32_SYSCALL_BIT + 238; +pub const SYS_get_mempolicy: ::c_long = __X32_SYSCALL_BIT + 239; +pub const SYS_mq_open: ::c_long = __X32_SYSCALL_BIT + 240; +pub const SYS_mq_unlink: ::c_long = __X32_SYSCALL_BIT + 241; +pub const SYS_mq_timedsend: ::c_long = __X32_SYSCALL_BIT + 242; +pub const SYS_mq_timedreceive: ::c_long = __X32_SYSCALL_BIT + 243; +pub const SYS_mq_getsetattr: ::c_long = __X32_SYSCALL_BIT + 245; +pub const SYS_add_key: ::c_long = __X32_SYSCALL_BIT + 248; +pub const SYS_request_key: ::c_long = __X32_SYSCALL_BIT + 249; +pub const SYS_keyctl: ::c_long = __X32_SYSCALL_BIT + 250; +pub const SYS_ioprio_set: ::c_long = __X32_SYSCALL_BIT + 251; +pub const SYS_ioprio_get: ::c_long = __X32_SYSCALL_BIT + 252; +pub const SYS_inotify_init: ::c_long = __X32_SYSCALL_BIT + 253; +pub const SYS_inotify_add_watch: ::c_long = __X32_SYSCALL_BIT + 254; +pub const SYS_inotify_rm_watch: ::c_long = __X32_SYSCALL_BIT + 255; +pub const SYS_migrate_pages: ::c_long = __X32_SYSCALL_BIT + 256; +pub const SYS_openat: ::c_long = __X32_SYSCALL_BIT + 257; +pub const SYS_mkdirat: ::c_long = __X32_SYSCALL_BIT + 258; +pub const SYS_mknodat: ::c_long = __X32_SYSCALL_BIT + 259; +pub const SYS_fchownat: ::c_long = __X32_SYSCALL_BIT + 260; +pub const SYS_futimesat: ::c_long = __X32_SYSCALL_BIT + 261; +pub const SYS_newfstatat: ::c_long = __X32_SYSCALL_BIT + 262; +pub const SYS_unlinkat: ::c_long = __X32_SYSCALL_BIT + 263; +pub const SYS_renameat: ::c_long = __X32_SYSCALL_BIT + 264; +pub const SYS_linkat: ::c_long = __X32_SYSCALL_BIT + 265; +pub const SYS_symlinkat: ::c_long = __X32_SYSCALL_BIT + 266; +pub const SYS_readlinkat: ::c_long = __X32_SYSCALL_BIT + 267; +pub const SYS_fchmodat: ::c_long = __X32_SYSCALL_BIT + 268; +pub const SYS_faccessat: ::c_long = __X32_SYSCALL_BIT + 269; +pub const SYS_pselect6: ::c_long = __X32_SYSCALL_BIT + 270; +pub const SYS_ppoll: ::c_long = __X32_SYSCALL_BIT + 271; +pub const SYS_unshare: ::c_long = __X32_SYSCALL_BIT + 272; +pub const SYS_splice: ::c_long = __X32_SYSCALL_BIT + 275; +pub const SYS_tee: ::c_long = __X32_SYSCALL_BIT + 276; +pub const SYS_sync_file_range: ::c_long = __X32_SYSCALL_BIT + 277; +pub const SYS_utimensat: ::c_long = __X32_SYSCALL_BIT + 280; +pub const SYS_epoll_pwait: ::c_long = __X32_SYSCALL_BIT + 281; +pub const SYS_signalfd: ::c_long = __X32_SYSCALL_BIT + 282; +pub const SYS_timerfd_create: ::c_long = __X32_SYSCALL_BIT + 283; +pub const SYS_eventfd: ::c_long = __X32_SYSCALL_BIT + 284; +pub const SYS_fallocate: ::c_long = __X32_SYSCALL_BIT + 285; +pub const SYS_timerfd_settime: ::c_long = __X32_SYSCALL_BIT + 286; +pub const SYS_timerfd_gettime: ::c_long = __X32_SYSCALL_BIT + 287; +pub const SYS_accept4: ::c_long = __X32_SYSCALL_BIT + 288; +pub const SYS_signalfd4: ::c_long = __X32_SYSCALL_BIT + 289; +pub const SYS_eventfd2: ::c_long = __X32_SYSCALL_BIT + 290; +pub const SYS_epoll_create1: ::c_long = __X32_SYSCALL_BIT + 291; +pub const SYS_dup3: ::c_long = __X32_SYSCALL_BIT + 292; +pub const SYS_pipe2: ::c_long = __X32_SYSCALL_BIT + 293; +pub const SYS_inotify_init1: ::c_long = __X32_SYSCALL_BIT + 294; +pub const SYS_perf_event_open: ::c_long = __X32_SYSCALL_BIT + 298; +pub const SYS_fanotify_init: ::c_long = __X32_SYSCALL_BIT + 300; +pub const SYS_fanotify_mark: ::c_long = __X32_SYSCALL_BIT + 301; +pub const SYS_prlimit64: ::c_long = __X32_SYSCALL_BIT + 302; +pub const SYS_name_to_handle_at: ::c_long = __X32_SYSCALL_BIT + 303; +pub const SYS_open_by_handle_at: ::c_long = __X32_SYSCALL_BIT + 304; +pub const SYS_clock_adjtime: ::c_long = __X32_SYSCALL_BIT + 305; +pub const SYS_syncfs: ::c_long = __X32_SYSCALL_BIT + 306; +pub const SYS_setns: ::c_long = __X32_SYSCALL_BIT + 308; +pub const SYS_getcpu: ::c_long = __X32_SYSCALL_BIT + 309; +pub const SYS_kcmp: ::c_long = __X32_SYSCALL_BIT + 312; +pub const SYS_finit_module: ::c_long = __X32_SYSCALL_BIT + 313; +pub const SYS_sched_setattr: ::c_long = __X32_SYSCALL_BIT + 314; +pub const SYS_sched_getattr: ::c_long = __X32_SYSCALL_BIT + 315; +pub const SYS_renameat2: ::c_long = __X32_SYSCALL_BIT + 316; +pub const SYS_seccomp: ::c_long = __X32_SYSCALL_BIT + 317; +pub const SYS_getrandom: ::c_long = __X32_SYSCALL_BIT + 318; +pub const SYS_memfd_create: ::c_long = __X32_SYSCALL_BIT + 319; +pub const SYS_kexec_file_load: ::c_long = __X32_SYSCALL_BIT + 320; +pub const SYS_bpf: ::c_long = __X32_SYSCALL_BIT + 321; +pub const SYS_userfaultfd: ::c_long = __X32_SYSCALL_BIT + 323; +pub const SYS_membarrier: ::c_long = __X32_SYSCALL_BIT + 324; +pub const SYS_mlock2: ::c_long = __X32_SYSCALL_BIT + 325; +pub const SYS_copy_file_range: ::c_long = __X32_SYSCALL_BIT + 326; +pub const SYS_pkey_mprotect: ::c_long = __X32_SYSCALL_BIT + 329; +pub const SYS_pkey_alloc: ::c_long = __X32_SYSCALL_BIT + 330; +pub const SYS_pkey_free: ::c_long = __X32_SYSCALL_BIT + 331; +pub const SYS_statx: ::c_long = __X32_SYSCALL_BIT + 332; +pub const SYS_rseq: ::c_long = __X32_SYSCALL_BIT + 334; +pub const SYS_pidfd_send_signal: ::c_long = __X32_SYSCALL_BIT + 424; +pub const SYS_io_uring_setup: ::c_long = __X32_SYSCALL_BIT + 425; +pub const SYS_io_uring_enter: ::c_long = __X32_SYSCALL_BIT + 426; +pub const SYS_io_uring_register: ::c_long = __X32_SYSCALL_BIT + 427; +pub const SYS_open_tree: ::c_long = __X32_SYSCALL_BIT + 428; +pub const SYS_move_mount: ::c_long = __X32_SYSCALL_BIT + 429; +pub const SYS_fsopen: ::c_long = __X32_SYSCALL_BIT + 430; +pub const SYS_fsconfig: ::c_long = __X32_SYSCALL_BIT + 431; +pub const SYS_fsmount: ::c_long = __X32_SYSCALL_BIT + 432; +pub const SYS_fspick: ::c_long = __X32_SYSCALL_BIT + 433; +pub const SYS_pidfd_open: ::c_long = __X32_SYSCALL_BIT + 434; +pub const SYS_clone3: ::c_long = __X32_SYSCALL_BIT + 435; +pub const SYS_close_range: ::c_long = __X32_SYSCALL_BIT + 436; +pub const SYS_openat2: ::c_long = __X32_SYSCALL_BIT + 437; +pub const SYS_pidfd_getfd: ::c_long = __X32_SYSCALL_BIT + 438; +pub const SYS_faccessat2: ::c_long = __X32_SYSCALL_BIT + 439; +pub const SYS_process_madvise: ::c_long = __X32_SYSCALL_BIT + 440; +pub const SYS_epoll_pwait2: ::c_long = __X32_SYSCALL_BIT + 441; +pub const SYS_mount_setattr: ::c_long = __X32_SYSCALL_BIT + 442; +pub const SYS_rt_sigaction: ::c_long = __X32_SYSCALL_BIT + 512; +pub const SYS_rt_sigreturn: ::c_long = __X32_SYSCALL_BIT + 513; +pub const SYS_ioctl: ::c_long = __X32_SYSCALL_BIT + 514; +pub const SYS_readv: ::c_long = __X32_SYSCALL_BIT + 515; +pub const SYS_writev: ::c_long = __X32_SYSCALL_BIT + 516; +pub const SYS_recvfrom: ::c_long = __X32_SYSCALL_BIT + 517; +pub const SYS_sendmsg: ::c_long = __X32_SYSCALL_BIT + 518; +pub const SYS_recvmsg: ::c_long = __X32_SYSCALL_BIT + 519; +pub const SYS_execve: ::c_long = __X32_SYSCALL_BIT + 520; +pub const SYS_ptrace: ::c_long = __X32_SYSCALL_BIT + 521; +pub const SYS_rt_sigpending: ::c_long = __X32_SYSCALL_BIT + 522; +pub const SYS_rt_sigtimedwait: ::c_long = __X32_SYSCALL_BIT + 523; +pub const SYS_rt_sigqueueinfo: ::c_long = __X32_SYSCALL_BIT + 524; +pub const SYS_sigaltstack: ::c_long = __X32_SYSCALL_BIT + 525; +pub const SYS_timer_create: ::c_long = __X32_SYSCALL_BIT + 526; +pub const SYS_mq_notify: ::c_long = __X32_SYSCALL_BIT + 527; +pub const SYS_kexec_load: ::c_long = __X32_SYSCALL_BIT + 528; +pub const SYS_waitid: ::c_long = __X32_SYSCALL_BIT + 529; +pub const SYS_set_robust_list: ::c_long = __X32_SYSCALL_BIT + 530; +pub const SYS_get_robust_list: ::c_long = __X32_SYSCALL_BIT + 531; +pub const SYS_vmsplice: ::c_long = __X32_SYSCALL_BIT + 532; +pub const SYS_move_pages: ::c_long = __X32_SYSCALL_BIT + 533; +pub const SYS_preadv: ::c_long = __X32_SYSCALL_BIT + 534; +pub const SYS_pwritev: ::c_long = __X32_SYSCALL_BIT + 535; +pub const SYS_rt_tgsigqueueinfo: ::c_long = __X32_SYSCALL_BIT + 536; +pub const SYS_recvmmsg: ::c_long = __X32_SYSCALL_BIT + 537; +pub const SYS_sendmmsg: ::c_long = __X32_SYSCALL_BIT + 538; +pub const SYS_process_vm_readv: ::c_long = __X32_SYSCALL_BIT + 539; +pub const SYS_process_vm_writev: ::c_long = __X32_SYSCALL_BIT + 540; +pub const SYS_setsockopt: ::c_long = __X32_SYSCALL_BIT + 541; +pub const SYS_getsockopt: ::c_long = __X32_SYSCALL_BIT + 542; +pub const SYS_io_setup: ::c_long = __X32_SYSCALL_BIT + 543; +pub const SYS_io_submit: ::c_long = __X32_SYSCALL_BIT + 544; +pub const SYS_execveat: ::c_long = __X32_SYSCALL_BIT + 545; +pub const SYS_preadv2: ::c_long = __X32_SYSCALL_BIT + 546; +pub const SYS_pwritev2: ::c_long = __X32_SYSCALL_BIT + 547; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..88bc935f632b3799cab5d0dd2d64d9ae61a69902 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/mod.rs @@ -0,0 +1,1368 @@ +pub type pthread_t = c_ulong; +pub type __priority_which_t = ::c_uint; +pub type __rlimit_resource_t = ::c_uint; +pub type Lmid_t = ::c_long; +pub type regoff_t = ::c_int; + +cfg_if! { + if #[cfg(doc)] { + // Used in `linux::arch` to define ioctl constants. + pub(crate) type Ioctl = ::c_ulong; + } else { + #[doc(hidden)] + pub type Ioctl = ::c_ulong; + } +} + +s! { + pub struct statx { + pub stx_mask: u32, + pub stx_blksize: u32, + pub stx_attributes: u64, + pub stx_nlink: u32, + pub stx_uid: u32, + pub stx_gid: u32, + pub stx_mode: u16, + __statx_pad1: [u16; 1], + pub stx_ino: u64, + pub stx_size: u64, + pub stx_blocks: u64, + pub stx_attributes_mask: u64, + pub stx_atime: ::statx_timestamp, + pub stx_btime: ::statx_timestamp, + pub stx_ctime: ::statx_timestamp, + pub stx_mtime: ::statx_timestamp, + pub stx_rdev_major: u32, + pub stx_rdev_minor: u32, + pub stx_dev_major: u32, + pub stx_dev_minor: u32, + pub stx_mnt_id: u64, + __statx_pad2: u64, + __statx_pad3: [u64; 12], + } + + pub struct statx_timestamp { + pub tv_sec: i64, + pub tv_nsec: u32, + pub __statx_timestamp_pad1: [i32; 1], + } + + pub struct aiocb { + pub aio_fildes: ::c_int, + pub aio_lio_opcode: ::c_int, + pub aio_reqprio: ::c_int, + pub aio_buf: *mut ::c_void, + pub aio_nbytes: ::size_t, + pub aio_sigevent: ::sigevent, + __next_prio: *mut aiocb, + __abs_prio: ::c_int, + __policy: ::c_int, + __error_code: ::c_int, + __return_value: ::ssize_t, + pub aio_offset: off_t, + #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))] + __unused1: [::c_char; 4], + __glibc_reserved: [::c_char; 32] + } + + pub struct __exit_status { + pub e_termination: ::c_short, + pub e_exit: ::c_short, + } + + pub struct __timeval { + pub tv_sec: i32, + pub tv_usec: i32, + } + + pub struct glob64_t { + pub gl_pathc: ::size_t, + pub gl_pathv: *mut *mut ::c_char, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + + __unused1: *mut ::c_void, + __unused2: *mut ::c_void, + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::size_t, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::size_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: ::size_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", + target_arch = "mips", + target_arch = "mips64")))] + pub c_ispeed: ::speed_t, + #[cfg(not(any( + target_arch = "sparc", + target_arch = "sparc64", + target_arch = "mips", + target_arch = "mips64")))] + pub c_ospeed: ::speed_t, + } + + pub struct mallinfo { + pub arena: ::c_int, + pub ordblks: ::c_int, + pub smblks: ::c_int, + pub hblks: ::c_int, + pub hblkhd: ::c_int, + pub usmblks: ::c_int, + pub fsmblks: ::c_int, + pub uordblks: ::c_int, + pub fordblks: ::c_int, + pub keepcost: ::c_int, + } + + pub struct mallinfo2 { + pub arena: ::size_t, + pub ordblks: ::size_t, + pub smblks: ::size_t, + pub hblks: ::size_t, + pub hblkhd: ::size_t, + pub usmblks: ::size_t, + pub fsmblks: ::size_t, + pub uordblks: ::size_t, + pub fordblks: ::size_t, + pub keepcost: ::size_t, + } + + pub struct nl_pktinfo { + pub group: u32, + } + + pub struct nl_mmap_req { + pub nm_block_size: ::c_uint, + pub nm_block_nr: ::c_uint, + pub nm_frame_size: ::c_uint, + pub nm_frame_nr: ::c_uint, + } + + pub struct nl_mmap_hdr { + pub nm_status: ::c_uint, + pub nm_len: ::c_uint, + pub nm_group: u32, + pub nm_pid: u32, + pub nm_uid: u32, + pub nm_gid: u32, + } + + pub struct rtentry { + pub rt_pad1: ::c_ulong, + pub rt_dst: ::sockaddr, + pub rt_gateway: ::sockaddr, + pub rt_genmask: ::sockaddr, + pub rt_flags: ::c_ushort, + pub rt_pad2: ::c_short, + pub rt_pad3: ::c_ulong, + pub rt_tos: ::c_uchar, + pub rt_class: ::c_uchar, + #[cfg(target_pointer_width = "64")] + pub rt_pad4: [::c_short; 3usize], + #[cfg(not(target_pointer_width = "64"))] + pub rt_pad4: ::c_short, + pub rt_metric: ::c_short, + pub rt_dev: *mut ::c_char, + pub rt_mtu: ::c_ulong, + pub rt_window: ::c_ulong, + pub rt_irtt: ::c_ushort, + } + + pub struct timex { + pub modes: ::c_uint, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub offset: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub offset: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub freq: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub freq: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub maxerror: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub maxerror: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub esterror: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub esterror: ::c_long, + pub status: ::c_int, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub constant: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub constant: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub precision: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub precision: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub tolerance: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub tolerance: ::c_long, + pub time: ::timeval, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub tick: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub tick: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub ppsfreq: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub ppsfreq: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub jitter: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub jitter: ::c_long, + pub shift: ::c_int, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub stabil: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub stabil: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub jitcnt: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub jitcnt: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub calcnt: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub calcnt: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub errcnt: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub errcnt: ::c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub stbcnt: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub stbcnt: ::c_long, + pub tai: ::c_int, + pub __unused1: i32, + pub __unused2: i32, + pub __unused3: i32, + pub __unused4: i32, + pub __unused5: i32, + pub __unused6: i32, + pub __unused7: i32, + pub __unused8: i32, + pub __unused9: i32, + pub __unused10: i32, + pub __unused11: i32, + } + + pub struct ntptimeval { + pub time: ::timeval, + pub maxerror: ::c_long, + pub esterror: ::c_long, + pub tai: ::c_long, + pub __glibc_reserved1: ::c_long, + pub __glibc_reserved2: ::c_long, + pub __glibc_reserved3: ::c_long, + pub __glibc_reserved4: ::c_long, + } + + pub struct regex_t { + __buffer: *mut ::c_void, + __allocated: ::size_t, + __used: ::size_t, + __syntax: ::c_ulong, + __fastmap: *mut ::c_char, + __translate: *mut ::c_char, + __re_nsub: ::size_t, + __bitfield: u8, + } + + pub struct Elf64_Chdr { + pub ch_type: ::Elf64_Word, + pub ch_reserved: ::Elf64_Word, + pub ch_size: ::Elf64_Xword, + pub ch_addralign: ::Elf64_Xword, + } + + pub struct Elf32_Chdr { + pub ch_type: ::Elf32_Word, + pub ch_size: ::Elf32_Word, + pub ch_addralign: ::Elf32_Word, + } + + pub struct seminfo { + pub semmap: ::c_int, + pub semmni: ::c_int, + pub semmns: ::c_int, + pub semmnu: ::c_int, + pub semmsl: ::c_int, + pub semopm: ::c_int, + pub semume: ::c_int, + pub semusz: ::c_int, + pub semvmx: ::c_int, + pub semaem: ::c_int, + } + + pub struct ptrace_peeksiginfo_args { + pub off: ::__u64, + pub flags: ::__u32, + pub nr: ::__s32, + } + + pub struct __c_anonymous_ptrace_syscall_info_entry { + pub nr: ::__u64, + pub args: [::__u64; 6], + } + + pub struct __c_anonymous_ptrace_syscall_info_exit { + pub sval: ::__s64, + pub is_error: ::__u8, + } + + pub struct __c_anonymous_ptrace_syscall_info_seccomp { + pub nr: ::__u64, + pub args: [::__u64; 6], + pub ret_data: ::__u32, + } + + pub struct ptrace_syscall_info { + pub op: ::__u8, + pub pad: [::__u8; 3], + pub arch: ::__u32, + pub instruction_pointer: ::__u64, + pub stack_pointer: ::__u64, + #[cfg(libc_union)] + pub u: __c_anonymous_ptrace_syscall_info_data, + } +} + +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_void { + #[repr(C)] + struct siginfo_sigfault { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + si_addr: *mut ::c_void, + } + (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr + } + + pub unsafe fn si_value(&self) -> ::sigval { + #[repr(C)] + struct siginfo_timer { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + _si_tid: ::c_int, + _si_overrun: ::c_int, + si_sigval: ::sigval, + } + (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval + } +} + +cfg_if! { + if #[cfg(libc_union)] { + // Internal, for casts to access union fields + #[repr(C)] + struct sifields_sigchld { + si_pid: ::pid_t, + si_uid: ::uid_t, + si_status: ::c_int, + si_utime: ::c_long, + si_stime: ::c_long, + } + impl ::Copy for sifields_sigchld {} + impl ::Clone for sifields_sigchld { + fn clone(&self) -> sifields_sigchld { + *self + } + } + + // Internal, for casts to access union fields + #[repr(C)] + union sifields { + _align_pointer: *mut ::c_void, + sigchld: sifields_sigchld, + } + + // Internal, for casts to access union fields. Note that some variants + // of sifields start with a pointer, which makes the alignment of + // sifields vary on 32-bit and 64-bit architectures. + #[repr(C)] + struct siginfo_f { + _siginfo_base: [::c_int; 3], + sifields: sifields, + } + + impl siginfo_t { + unsafe fn sifields(&self) -> &sifields { + &(*(self as *const siginfo_t as *const siginfo_f)).sifields + } + + pub unsafe fn si_pid(&self) -> ::pid_t { + self.sifields().sigchld.si_pid + } + + pub unsafe fn si_uid(&self) -> ::uid_t { + self.sifields().sigchld.si_uid + } + + pub unsafe fn si_status(&self) -> ::c_int { + self.sifields().sigchld.si_status + } + + pub unsafe fn si_utime(&self) -> ::c_long { + self.sifields().sigchld.si_utime + } + + pub unsafe fn si_stime(&self) -> ::c_long { + self.sifields().sigchld.si_stime + } + } + + pub union __c_anonymous_ptrace_syscall_info_data { + pub entry: __c_anonymous_ptrace_syscall_info_entry, + pub exit: __c_anonymous_ptrace_syscall_info_exit, + pub seccomp: __c_anonymous_ptrace_syscall_info_seccomp, + } + impl ::Copy for __c_anonymous_ptrace_syscall_info_data {} + impl ::Clone for __c_anonymous_ptrace_syscall_info_data { + fn clone(&self) -> __c_anonymous_ptrace_syscall_info_data { + *self + } + } + } +} + +s_no_extra_traits! { + pub struct utmpx { + pub ut_type: ::c_short, + pub ut_pid: ::pid_t, + pub ut_line: [::c_char; __UT_LINESIZE], + pub ut_id: [::c_char; 4], + + pub ut_user: [::c_char; __UT_NAMESIZE], + pub ut_host: [::c_char; __UT_HOSTSIZE], + pub ut_exit: __exit_status, + + #[cfg(any(target_arch = "aarch64", + target_arch = "s390x", + target_arch = "loongarch64", + all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] + pub ut_session: ::c_long, + #[cfg(any(target_arch = "aarch64", + target_arch = "s390x", + target_arch = "loongarch64", + all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] + pub ut_tv: ::timeval, + + #[cfg(not(any(target_arch = "aarch64", + target_arch = "s390x", + target_arch = "loongarch64", + all(target_pointer_width = "32", + not(target_arch = "x86_64")))))] + pub ut_session: i32, + #[cfg(not(any(target_arch = "aarch64", + target_arch = "s390x", + target_arch = "loongarch64", + all(target_pointer_width = "32", + not(target_arch = "x86_64")))))] + pub ut_tv: __timeval, + + pub ut_addr_v6: [i32; 4], + __glibc_reserved: [::c_char; 20], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for utmpx { + fn eq(&self, other: &utmpx) -> bool { + self.ut_type == other.ut_type + && self.ut_pid == other.ut_pid + && self.ut_line == other.ut_line + && self.ut_id == other.ut_id + && self.ut_user == other.ut_user + && self + .ut_host + .iter() + .zip(other.ut_host.iter()) + .all(|(a,b)| a == b) + && self.ut_exit == other.ut_exit + && self.ut_session == other.ut_session + && self.ut_tv == other.ut_tv + && self.ut_addr_v6 == other.ut_addr_v6 + && self.__glibc_reserved == other.__glibc_reserved + } + } + + impl Eq for utmpx {} + + impl ::fmt::Debug for utmpx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmpx") + .field("ut_type", &self.ut_type) + .field("ut_pid", &self.ut_pid) + .field("ut_line", &self.ut_line) + .field("ut_id", &self.ut_id) + .field("ut_user", &self.ut_user) + // FIXME: .field("ut_host", &self.ut_host) + .field("ut_exit", &self.ut_exit) + .field("ut_session", &self.ut_session) + .field("ut_tv", &self.ut_tv) + .field("ut_addr_v6", &self.ut_addr_v6) + .field("__glibc_reserved", &self.__glibc_reserved) + .finish() + } + } + + impl ::hash::Hash for utmpx { + fn hash(&self, state: &mut H) { + self.ut_type.hash(state); + self.ut_pid.hash(state); + self.ut_line.hash(state); + self.ut_id.hash(state); + self.ut_user.hash(state); + self.ut_host.hash(state); + self.ut_exit.hash(state); + self.ut_session.hash(state); + self.ut_tv.hash(state); + self.ut_addr_v6.hash(state); + self.__glibc_reserved.hash(state); + } + } + + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_ptrace_syscall_info_data { + fn eq(&self, other: &__c_anonymous_ptrace_syscall_info_data) -> bool { + unsafe { + self.entry == other.entry || + self.exit == other.exit || + self.seccomp == other.seccomp + } + } + } + + #[cfg(libc_union)] + impl Eq for __c_anonymous_ptrace_syscall_info_data {} + + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_ptrace_syscall_info_data { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + unsafe { + f.debug_struct("__c_anonymous_ptrace_syscall_info_data") + .field("entry", &self.entry) + .field("exit", &self.exit) + .field("seccomp", &self.seccomp) + .finish() + } + } + } + + #[cfg(libc_union)] + impl ::hash::Hash for __c_anonymous_ptrace_syscall_info_data { + fn hash(&self, state: &mut H) { + unsafe { + self.entry.hash(state); + self.exit.hash(state); + self.seccomp.hash(state); + } + } + } + } +} + +// include/uapi/asm-generic/hugetlb_encode.h +pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26; +pub const HUGETLB_FLAG_ENCODE_MASK: ::c_int = 0x3f; + +pub const HUGETLB_FLAG_ENCODE_64KB: ::c_int = 16 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_512KB: ::c_int = 19 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_1MB: ::c_int = 20 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_2MB: ::c_int = 21 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_8MB: ::c_int = 23 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_16MB: ::c_int = 24 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_32MB: ::c_int = 25 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_256MB: ::c_int = 28 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_512MB: ::c_int = 29 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_1GB: ::c_int = 30 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_2GB: ::c_int = 31 << HUGETLB_FLAG_ENCODE_SHIFT; +pub const HUGETLB_FLAG_ENCODE_16GB: ::c_int = 34 << HUGETLB_FLAG_ENCODE_SHIFT; + +// include/uapi/linux/mman.h +/* + * Huge page size encoding when MAP_HUGETLB is specified, and a huge page + * size other than the default is desired. See hugetlb_encode.h. + * All known huge page size encodings are provided here. It is the + * responsibility of the application to know which sizes are supported on + * the running system. See mmap(2) man page for details. + */ +pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT; +pub const MAP_HUGE_MASK: ::c_int = HUGETLB_FLAG_ENCODE_MASK; + +pub const MAP_HUGE_64KB: ::c_int = HUGETLB_FLAG_ENCODE_64KB; +pub const MAP_HUGE_512KB: ::c_int = HUGETLB_FLAG_ENCODE_512KB; +pub const MAP_HUGE_1MB: ::c_int = HUGETLB_FLAG_ENCODE_1MB; +pub const MAP_HUGE_2MB: ::c_int = HUGETLB_FLAG_ENCODE_2MB; +pub const MAP_HUGE_8MB: ::c_int = HUGETLB_FLAG_ENCODE_8MB; +pub const MAP_HUGE_16MB: ::c_int = HUGETLB_FLAG_ENCODE_16MB; +pub const MAP_HUGE_32MB: ::c_int = HUGETLB_FLAG_ENCODE_32MB; +pub const MAP_HUGE_256MB: ::c_int = HUGETLB_FLAG_ENCODE_256MB; +pub const MAP_HUGE_512MB: ::c_int = HUGETLB_FLAG_ENCODE_512MB; +pub const MAP_HUGE_1GB: ::c_int = HUGETLB_FLAG_ENCODE_1GB; +pub const MAP_HUGE_2GB: ::c_int = HUGETLB_FLAG_ENCODE_2GB; +pub const MAP_HUGE_16GB: ::c_int = HUGETLB_FLAG_ENCODE_16GB; + +pub const PRIO_PROCESS: ::__priority_which_t = 0; +pub const PRIO_PGRP: ::__priority_which_t = 1; +pub const PRIO_USER: ::__priority_which_t = 2; + +pub const MS_RMT_MASK: ::c_ulong = 0x02800051; + +pub const __UT_LINESIZE: usize = 32; +pub const __UT_NAMESIZE: usize = 32; +pub const __UT_HOSTSIZE: usize = 256; +pub const EMPTY: ::c_short = 0; +pub const RUN_LVL: ::c_short = 1; +pub const BOOT_TIME: ::c_short = 2; +pub const NEW_TIME: ::c_short = 3; +pub const OLD_TIME: ::c_short = 4; +pub const INIT_PROCESS: ::c_short = 5; +pub const LOGIN_PROCESS: ::c_short = 6; +pub const USER_PROCESS: ::c_short = 7; +pub const DEAD_PROCESS: ::c_short = 8; +pub const ACCOUNTING: ::c_short = 9; + +// dlfcn.h +pub const LM_ID_BASE: ::c_long = 0; +pub const LM_ID_NEWLM: ::c_long = -1; + +pub const RTLD_DI_LMID: ::c_int = 1; +pub const RTLD_DI_LINKMAP: ::c_int = 2; +pub const RTLD_DI_CONFIGADDR: ::c_int = 3; +pub const RTLD_DI_SERINFO: ::c_int = 4; +pub const RTLD_DI_SERINFOSIZE: ::c_int = 5; +pub const RTLD_DI_ORIGIN: ::c_int = 6; +pub const RTLD_DI_PROFILENAME: ::c_int = 7; +pub const RTLD_DI_PROFILEOUT: ::c_int = 8; +pub const RTLD_DI_TLS_MODID: ::c_int = 9; +pub const RTLD_DI_TLS_DATA: ::c_int = 10; + +pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK; +pub const PIDFD_NONBLOCK: ::c_uint = O_NONBLOCK as ::c_uint; + +pub const SOL_RXRPC: ::c_int = 272; +pub const SOL_PPPOL2TP: ::c_int = 273; +pub const SOL_PNPIPE: ::c_int = 275; +pub const SOL_RDS: ::c_int = 276; +pub const SOL_IUCV: ::c_int = 277; +pub const SOL_CAIF: ::c_int = 278; +pub const SOL_NFC: ::c_int = 280; +pub const SOL_XDP: ::c_int = 283; + +pub const MSG_TRYHARD: ::c_int = 4; + +pub const LC_PAPER: ::c_int = 7; +pub const LC_NAME: ::c_int = 8; +pub const LC_ADDRESS: ::c_int = 9; +pub const LC_TELEPHONE: ::c_int = 10; +pub const LC_MEASUREMENT: ::c_int = 11; +pub const LC_IDENTIFICATION: ::c_int = 12; +pub const LC_PAPER_MASK: ::c_int = 1 << LC_PAPER; +pub const LC_NAME_MASK: ::c_int = 1 << LC_NAME; +pub const LC_ADDRESS_MASK: ::c_int = 1 << LC_ADDRESS; +pub const LC_TELEPHONE_MASK: ::c_int = 1 << LC_TELEPHONE; +pub const LC_MEASUREMENT_MASK: ::c_int = 1 << LC_MEASUREMENT; +pub const LC_IDENTIFICATION_MASK: ::c_int = 1 << LC_IDENTIFICATION; +pub const LC_ALL_MASK: ::c_int = ::LC_CTYPE_MASK + | ::LC_NUMERIC_MASK + | ::LC_TIME_MASK + | ::LC_COLLATE_MASK + | ::LC_MONETARY_MASK + | ::LC_MESSAGES_MASK + | LC_PAPER_MASK + | LC_NAME_MASK + | LC_ADDRESS_MASK + | LC_TELEPHONE_MASK + | LC_MEASUREMENT_MASK + | LC_IDENTIFICATION_MASK; + +pub const ENOTSUP: ::c_int = EOPNOTSUPP; + +pub const SOCK_SEQPACKET: ::c_int = 5; +pub const SOCK_DCCP: ::c_int = 6; +pub const SOCK_PACKET: ::c_int = 10; + +pub const FAN_MARK_INODE: ::c_uint = 0x0000_0000; +pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010; +// NOTE: FAN_MARK_FILESYSTEM requires Linux Kernel >= 4.20.0 +pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100; + +pub const AF_IB: ::c_int = 27; +pub const AF_MPLS: ::c_int = 28; +pub const AF_NFC: ::c_int = 39; +pub const AF_VSOCK: ::c_int = 40; +pub const AF_XDP: ::c_int = 44; +pub const PF_IB: ::c_int = AF_IB; +pub const PF_MPLS: ::c_int = AF_MPLS; +pub const PF_NFC: ::c_int = AF_NFC; +pub const PF_VSOCK: ::c_int = AF_VSOCK; +pub const PF_XDP: ::c_int = AF_XDP; + +/* DCCP socket options */ +pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1; +pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2; +pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3; +pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4; +pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5; +pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6; +pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10; +pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11; +pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12; +pub const DCCP_SOCKOPT_CCID: ::c_int = 13; +pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14; +pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15; +pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16; +pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17; +pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128; +pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192; + +/// maximum number of services provided on the same listening port +pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32; + +pub const SIGEV_THREAD_ID: ::c_int = 4; + +pub const BUFSIZ: ::c_uint = 8192; +pub const TMP_MAX: ::c_uint = 238328; +pub const FOPEN_MAX: ::c_uint = 16; +pub const FILENAME_MAX: ::c_uint = 4096; +pub const POSIX_MADV_DONTNEED: ::c_int = 4; +pub const _SC_EQUIV_CLASS_MAX: ::c_int = 41; +pub const _SC_CHARCLASS_NAME_MAX: ::c_int = 45; +pub const _SC_PII: ::c_int = 53; +pub const _SC_PII_XTI: ::c_int = 54; +pub const _SC_PII_SOCKET: ::c_int = 55; +pub const _SC_PII_INTERNET: ::c_int = 56; +pub const _SC_PII_OSI: ::c_int = 57; +pub const _SC_POLL: ::c_int = 58; +pub const _SC_SELECT: ::c_int = 59; +pub const _SC_PII_INTERNET_STREAM: ::c_int = 61; +pub const _SC_PII_INTERNET_DGRAM: ::c_int = 62; +pub const _SC_PII_OSI_COTS: ::c_int = 63; +pub const _SC_PII_OSI_CLTS: ::c_int = 64; +pub const _SC_PII_OSI_M: ::c_int = 65; +pub const _SC_T_IOV_MAX: ::c_int = 66; +pub const _SC_2_C_VERSION: ::c_int = 96; +pub const _SC_CHAR_BIT: ::c_int = 101; +pub const _SC_CHAR_MAX: ::c_int = 102; +pub const _SC_CHAR_MIN: ::c_int = 103; +pub const _SC_INT_MAX: ::c_int = 104; +pub const _SC_INT_MIN: ::c_int = 105; +pub const _SC_LONG_BIT: ::c_int = 106; +pub const _SC_WORD_BIT: ::c_int = 107; +pub const _SC_MB_LEN_MAX: ::c_int = 108; +pub const _SC_SSIZE_MAX: ::c_int = 110; +pub const _SC_SCHAR_MAX: ::c_int = 111; +pub const _SC_SCHAR_MIN: ::c_int = 112; +pub const _SC_SHRT_MAX: ::c_int = 113; +pub const _SC_SHRT_MIN: ::c_int = 114; +pub const _SC_UCHAR_MAX: ::c_int = 115; +pub const _SC_UINT_MAX: ::c_int = 116; +pub const _SC_ULONG_MAX: ::c_int = 117; +pub const _SC_USHRT_MAX: ::c_int = 118; +pub const _SC_NL_ARGMAX: ::c_int = 119; +pub const _SC_NL_LANGMAX: ::c_int = 120; +pub const _SC_NL_MSGMAX: ::c_int = 121; +pub const _SC_NL_NMAX: ::c_int = 122; +pub const _SC_NL_SETMAX: ::c_int = 123; +pub const _SC_NL_TEXTMAX: ::c_int = 124; +pub const _SC_BASE: ::c_int = 134; +pub const _SC_C_LANG_SUPPORT: ::c_int = 135; +pub const _SC_C_LANG_SUPPORT_R: ::c_int = 136; +pub const _SC_DEVICE_IO: ::c_int = 140; +pub const _SC_DEVICE_SPECIFIC: ::c_int = 141; +pub const _SC_DEVICE_SPECIFIC_R: ::c_int = 142; +pub const _SC_FD_MGMT: ::c_int = 143; +pub const _SC_FIFO: ::c_int = 144; +pub const _SC_PIPE: ::c_int = 145; +pub const _SC_FILE_ATTRIBUTES: ::c_int = 146; +pub const _SC_FILE_LOCKING: ::c_int = 147; +pub const _SC_FILE_SYSTEM: ::c_int = 148; +pub const _SC_MULTI_PROCESS: ::c_int = 150; +pub const _SC_SINGLE_PROCESS: ::c_int = 151; +pub const _SC_NETWORKING: ::c_int = 152; +pub const _SC_REGEX_VERSION: ::c_int = 156; +pub const _SC_SIGNALS: ::c_int = 158; +pub const _SC_SYSTEM_DATABASE: ::c_int = 162; +pub const _SC_SYSTEM_DATABASE_R: ::c_int = 163; +pub const _SC_USER_GROUPS: ::c_int = 166; +pub const _SC_USER_GROUPS_R: ::c_int = 167; +pub const _SC_LEVEL1_ICACHE_SIZE: ::c_int = 185; +pub const _SC_LEVEL1_ICACHE_ASSOC: ::c_int = 186; +pub const _SC_LEVEL1_ICACHE_LINESIZE: ::c_int = 187; +pub const _SC_LEVEL1_DCACHE_SIZE: ::c_int = 188; +pub const _SC_LEVEL1_DCACHE_ASSOC: ::c_int = 189; +pub const _SC_LEVEL1_DCACHE_LINESIZE: ::c_int = 190; +pub const _SC_LEVEL2_CACHE_SIZE: ::c_int = 191; +pub const _SC_LEVEL2_CACHE_ASSOC: ::c_int = 192; +pub const _SC_LEVEL2_CACHE_LINESIZE: ::c_int = 193; +pub const _SC_LEVEL3_CACHE_SIZE: ::c_int = 194; +pub const _SC_LEVEL3_CACHE_ASSOC: ::c_int = 195; +pub const _SC_LEVEL3_CACHE_LINESIZE: ::c_int = 196; +pub const _SC_LEVEL4_CACHE_SIZE: ::c_int = 197; +pub const _SC_LEVEL4_CACHE_ASSOC: ::c_int = 198; +pub const _SC_LEVEL4_CACHE_LINESIZE: ::c_int = 199; +pub const O_ACCMODE: ::c_int = 3; +pub const ST_RELATIME: ::c_ulong = 4096; +pub const NI_MAXHOST: ::socklen_t = 1025; + +// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the +// following are only available on newer Linux versions than the versions +// currently used in CI in some configurations, so we define them here. +cfg_if! { + if #[cfg(not(target_arch = "s390x"))] { + pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70; + pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342; + } else if #[cfg(target_arch = "s390x")] { + pub const BINDERFS_SUPER_MAGIC: ::c_uint = 0x6c6f6f70; + pub const XFS_SUPER_MAGIC: ::c_uint = 0x58465342; + } +} + +pub const CPU_SETSIZE: ::c_int = 0x400; + +pub const PTRACE_TRACEME: ::c_uint = 0; +pub const PTRACE_PEEKTEXT: ::c_uint = 1; +pub const PTRACE_PEEKDATA: ::c_uint = 2; +pub const PTRACE_PEEKUSER: ::c_uint = 3; +pub const PTRACE_POKETEXT: ::c_uint = 4; +pub const PTRACE_POKEDATA: ::c_uint = 5; +pub const PTRACE_POKEUSER: ::c_uint = 6; +pub const PTRACE_CONT: ::c_uint = 7; +pub const PTRACE_KILL: ::c_uint = 8; +pub const PTRACE_SINGLESTEP: ::c_uint = 9; +pub const PTRACE_ATTACH: ::c_uint = 16; +pub const PTRACE_SYSCALL: ::c_uint = 24; +pub const PTRACE_SETOPTIONS: ::c_uint = 0x4200; +pub const PTRACE_GETEVENTMSG: ::c_uint = 0x4201; +pub const PTRACE_GETSIGINFO: ::c_uint = 0x4202; +pub const PTRACE_SETSIGINFO: ::c_uint = 0x4203; +pub const PTRACE_GETREGSET: ::c_uint = 0x4204; +pub const PTRACE_SETREGSET: ::c_uint = 0x4205; +pub const PTRACE_SEIZE: ::c_uint = 0x4206; +pub const PTRACE_INTERRUPT: ::c_uint = 0x4207; +pub const PTRACE_LISTEN: ::c_uint = 0x4208; +pub const PTRACE_PEEKSIGINFO: ::c_uint = 0x4209; +pub const PTRACE_GET_SYSCALL_INFO: ::c_uint = 0x420e; + +// linux/fs.h + +// Flags for preadv2/pwritev2 +pub const RWF_HIPRI: ::c_int = 0x00000001; +pub const RWF_DSYNC: ::c_int = 0x00000002; +pub const RWF_SYNC: ::c_int = 0x00000004; +pub const RWF_NOWAIT: ::c_int = 0x00000008; +pub const RWF_APPEND: ::c_int = 0x00000010; + +// linux/rtnetlink.h +pub const TCA_PAD: ::c_ushort = 9; +pub const TCA_DUMP_INVISIBLE: ::c_ushort = 10; +pub const TCA_CHAIN: ::c_ushort = 11; +pub const TCA_HW_OFFLOAD: ::c_ushort = 12; + +pub const RTM_DELNETCONF: u16 = 81; +pub const RTM_NEWSTATS: u16 = 92; +pub const RTM_GETSTATS: u16 = 94; +pub const RTM_NEWCACHEREPORT: u16 = 96; + +pub const RTM_F_LOOKUP_TABLE: ::c_uint = 0x1000; +pub const RTM_F_FIB_MATCH: ::c_uint = 0x2000; + +pub const RTA_VIA: ::c_ushort = 18; +pub const RTA_NEWDST: ::c_ushort = 19; +pub const RTA_PREF: ::c_ushort = 20; +pub const RTA_ENCAP_TYPE: ::c_ushort = 21; +pub const RTA_ENCAP: ::c_ushort = 22; +pub const RTA_EXPIRES: ::c_ushort = 23; +pub const RTA_PAD: ::c_ushort = 24; +pub const RTA_UID: ::c_ushort = 25; +pub const RTA_TTL_PROPAGATE: ::c_ushort = 26; + +// linux/neighbor.h +pub const NTF_EXT_LEARNED: u8 = 0x10; +pub const NTF_OFFLOADED: u8 = 0x20; + +pub const NDA_MASTER: ::c_ushort = 9; +pub const NDA_LINK_NETNSID: ::c_ushort = 10; +pub const NDA_SRC_VNI: ::c_ushort = 11; + +// linux/personality.h +pub const UNAME26: ::c_int = 0x0020000; +pub const FDPIC_FUNCPTRS: ::c_int = 0x0080000; + +// linux/if_addr.h +pub const IFA_FLAGS: ::c_ushort = 8; + +pub const IFA_F_MANAGETEMPADDR: u32 = 0x100; +pub const IFA_F_NOPREFIXROUTE: u32 = 0x200; +pub const IFA_F_MCAUTOJOIN: u32 = 0x400; +pub const IFA_F_STABLE_PRIVACY: u32 = 0x800; + +pub const MAX_LINKS: ::c_int = 32; + +pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10; + +pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1; +pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2; + +// elf.h +pub const NT_PRSTATUS: ::c_int = 1; +pub const NT_PRFPREG: ::c_int = 2; +pub const NT_FPREGSET: ::c_int = 2; +pub const NT_PRPSINFO: ::c_int = 3; +pub const NT_PRXREG: ::c_int = 4; +pub const NT_TASKSTRUCT: ::c_int = 4; +pub const NT_PLATFORM: ::c_int = 5; +pub const NT_AUXV: ::c_int = 6; +pub const NT_GWINDOWS: ::c_int = 7; +pub const NT_ASRS: ::c_int = 8; +pub const NT_PSTATUS: ::c_int = 10; +pub const NT_PSINFO: ::c_int = 13; +pub const NT_PRCRED: ::c_int = 14; +pub const NT_UTSNAME: ::c_int = 15; +pub const NT_LWPSTATUS: ::c_int = 16; +pub const NT_LWPSINFO: ::c_int = 17; +pub const NT_PRFPXREG: ::c_int = 20; + +// linux/keyctl.h +pub const KEYCTL_DH_COMPUTE: u32 = 23; +pub const KEYCTL_PKEY_QUERY: u32 = 24; +pub const KEYCTL_PKEY_ENCRYPT: u32 = 25; +pub const KEYCTL_PKEY_DECRYPT: u32 = 26; +pub const KEYCTL_PKEY_SIGN: u32 = 27; +pub const KEYCTL_PKEY_VERIFY: u32 = 28; +pub const KEYCTL_RESTRICT_KEYRING: u32 = 29; + +pub const KEYCTL_SUPPORTS_ENCRYPT: u32 = 0x01; +pub const KEYCTL_SUPPORTS_DECRYPT: u32 = 0x02; +pub const KEYCTL_SUPPORTS_SIGN: u32 = 0x04; +pub const KEYCTL_SUPPORTS_VERIFY: u32 = 0x08; +cfg_if! { + if #[cfg(not(any(target_arch="mips", target_arch="mips64")))] { + pub const KEYCTL_MOVE: u32 = 30; + pub const KEYCTL_CAPABILITIES: u32 = 31; + + pub const KEYCTL_CAPS0_CAPABILITIES: u32 = 0x01; + pub const KEYCTL_CAPS0_PERSISTENT_KEYRINGS: u32 = 0x02; + pub const KEYCTL_CAPS0_DIFFIE_HELLMAN: u32 = 0x04; + pub const KEYCTL_CAPS0_PUBLIC_KEY: u32 = 0x08; + pub const KEYCTL_CAPS0_BIG_KEY: u32 = 0x10; + pub const KEYCTL_CAPS0_INVALIDATE: u32 = 0x20; + pub const KEYCTL_CAPS0_RESTRICT_KEYRING: u32 = 0x40; + pub const KEYCTL_CAPS0_MOVE: u32 = 0x80; + pub const KEYCTL_CAPS1_NS_KEYRING_NAME: u32 = 0x01; + pub const KEYCTL_CAPS1_NS_KEY_TAG: u32 = 0x02; + } +} + +pub const M_MXFAST: ::c_int = 1; +pub const M_NLBLKS: ::c_int = 2; +pub const M_GRAIN: ::c_int = 3; +pub const M_KEEP: ::c_int = 4; +pub const M_TRIM_THRESHOLD: ::c_int = -1; +pub const M_TOP_PAD: ::c_int = -2; +pub const M_MMAP_THRESHOLD: ::c_int = -3; +pub const M_MMAP_MAX: ::c_int = -4; +pub const M_CHECK_ACTION: ::c_int = -5; +pub const M_PERTURB: ::c_int = -6; +pub const M_ARENA_TEST: ::c_int = -7; +pub const M_ARENA_MAX: ::c_int = -8; + +pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000; +pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000; +pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000; +pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000; +pub const STATX_TYPE: ::c_uint = 0x0001; +pub const STATX_MODE: ::c_uint = 0x0002; +pub const STATX_NLINK: ::c_uint = 0x0004; +pub const STATX_UID: ::c_uint = 0x0008; +pub const STATX_GID: ::c_uint = 0x0010; +pub const STATX_ATIME: ::c_uint = 0x0020; +pub const STATX_MTIME: ::c_uint = 0x0040; +pub const STATX_CTIME: ::c_uint = 0x0080; +pub const STATX_INO: ::c_uint = 0x0100; +pub const STATX_SIZE: ::c_uint = 0x0200; +pub const STATX_BLOCKS: ::c_uint = 0x0400; +pub const STATX_BASIC_STATS: ::c_uint = 0x07ff; +pub const STATX_BTIME: ::c_uint = 0x0800; +pub const STATX_MNT_ID: ::c_uint = 0x1000; +pub const STATX_ALL: ::c_uint = 0x0fff; +pub const STATX__RESERVED: ::c_int = 0x80000000; +pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004; +pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010; +pub const STATX_ATTR_APPEND: ::c_int = 0x0020; +pub const STATX_ATTR_NODUMP: ::c_int = 0x0040; +pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800; +pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000; + +pub const SOMAXCONN: ::c_int = 4096; + +//sys/timex.h +pub const ADJ_OFFSET: ::c_uint = 0x0001; +pub const ADJ_FREQUENCY: ::c_uint = 0x0002; +pub const ADJ_MAXERROR: ::c_uint = 0x0004; +pub const ADJ_ESTERROR: ::c_uint = 0x0008; +pub const ADJ_STATUS: ::c_uint = 0x0010; +pub const ADJ_TIMECONST: ::c_uint = 0x0020; +pub const ADJ_TAI: ::c_uint = 0x0080; +pub const ADJ_SETOFFSET: ::c_uint = 0x0100; +pub const ADJ_MICRO: ::c_uint = 0x1000; +pub const ADJ_NANO: ::c_uint = 0x2000; +pub const ADJ_TICK: ::c_uint = 0x4000; +pub const ADJ_OFFSET_SINGLESHOT: ::c_uint = 0x8001; +pub const ADJ_OFFSET_SS_READ: ::c_uint = 0xa001; +pub const MOD_OFFSET: ::c_uint = ADJ_OFFSET; +pub const MOD_FREQUENCY: ::c_uint = ADJ_FREQUENCY; +pub const MOD_MAXERROR: ::c_uint = ADJ_MAXERROR; +pub const MOD_ESTERROR: ::c_uint = ADJ_ESTERROR; +pub const MOD_STATUS: ::c_uint = ADJ_STATUS; +pub const MOD_TIMECONST: ::c_uint = ADJ_TIMECONST; +pub const MOD_CLKB: ::c_uint = ADJ_TICK; +pub const MOD_CLKA: ::c_uint = ADJ_OFFSET_SINGLESHOT; +pub const MOD_TAI: ::c_uint = ADJ_TAI; +pub const MOD_MICRO: ::c_uint = ADJ_MICRO; +pub const MOD_NANO: ::c_uint = ADJ_NANO; +pub const STA_PLL: ::c_int = 0x0001; +pub const STA_PPSFREQ: ::c_int = 0x0002; +pub const STA_PPSTIME: ::c_int = 0x0004; +pub const STA_FLL: ::c_int = 0x0008; +pub const STA_INS: ::c_int = 0x0010; +pub const STA_DEL: ::c_int = 0x0020; +pub const STA_UNSYNC: ::c_int = 0x0040; +pub const STA_FREQHOLD: ::c_int = 0x0080; +pub const STA_PPSSIGNAL: ::c_int = 0x0100; +pub const STA_PPSJITTER: ::c_int = 0x0200; +pub const STA_PPSWANDER: ::c_int = 0x0400; +pub const STA_PPSERROR: ::c_int = 0x0800; +pub const STA_CLOCKERR: ::c_int = 0x1000; +pub const STA_NANO: ::c_int = 0x2000; +pub const STA_MODE: ::c_int = 0x4000; +pub const STA_CLK: ::c_int = 0x8000; +pub const STA_RONLY: ::c_int = STA_PPSSIGNAL + | STA_PPSJITTER + | STA_PPSWANDER + | STA_PPSERROR + | STA_CLOCKERR + | STA_NANO + | STA_MODE + | STA_CLK; +pub const NTP_API: ::c_int = 4; +pub const TIME_OK: ::c_int = 0; +pub const TIME_INS: ::c_int = 1; +pub const TIME_DEL: ::c_int = 2; +pub const TIME_OOP: ::c_int = 3; +pub const TIME_WAIT: ::c_int = 4; +pub const TIME_ERROR: ::c_int = 5; +pub const TIME_BAD: ::c_int = TIME_ERROR; +pub const MAXTC: ::c_long = 6; + +cfg_if! { + if #[cfg(any( + target_arch = "arm", + target_arch = "x86", + target_arch = "x86_64", + target_arch = "s390x", + target_arch = "riscv64", + target_arch = "riscv32" + ))] { + pub const PTHREAD_STACK_MIN: ::size_t = 16384; + } else if #[cfg(any( + target_arch = "sparc", + target_arch = "sparc64" + ))] { + pub const PTHREAD_STACK_MIN: ::size_t = 0x6000; + } else { + pub const PTHREAD_STACK_MIN: ::size_t = 131072; + } +} +pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3; + +pub const REG_STARTEND: ::c_int = 4; + +pub const REG_EEND: ::c_int = 14; +pub const REG_ESIZE: ::c_int = 15; +pub const REG_ERPAREN: ::c_int = 16; + +extern "C" { + pub fn fgetspent_r( + fp: *mut ::FILE, + spbuf: *mut ::spwd, + buf: *mut ::c_char, + buflen: ::size_t, + spbufp: *mut *mut ::spwd, + ) -> ::c_int; + pub fn sgetspent_r( + s: *const ::c_char, + spbuf: *mut ::spwd, + buf: *mut ::c_char, + buflen: ::size_t, + spbufp: *mut *mut ::spwd, + ) -> ::c_int; + pub fn getspent_r( + spbuf: *mut ::spwd, + buf: *mut ::c_char, + buflen: ::size_t, + spbufp: *mut *mut ::spwd, + ) -> ::c_int; + pub fn qsort_r( + base: *mut ::c_void, + num: ::size_t, + size: ::size_t, + compar: ::Option< + unsafe extern "C" fn(*const ::c_void, *const ::c_void, *mut ::c_void) -> ::c_int, + >, + arg: *mut ::c_void, + ); + pub fn sendmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_int, + ) -> ::c_int; + pub fn recvmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_int, + timeout: *mut ::timespec, + ) -> ::c_int; + + pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int; + pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int; + pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int; + pub fn prlimit( + pid: ::pid_t, + resource: ::__rlimit_resource_t, + new_limit: *const ::rlimit, + old_limit: *mut ::rlimit, + ) -> ::c_int; + pub fn prlimit64( + pid: ::pid_t, + resource: ::__rlimit_resource_t, + new_limit: *const ::rlimit64, + old_limit: *mut ::rlimit64, + ) -> ::c_int; + pub fn utmpname(file: *const ::c_char) -> ::c_int; + pub fn utmpxname(file: *const ::c_char) -> ::c_int; + pub fn getutxent() -> *mut utmpx; + pub fn getutxid(ut: *const utmpx) -> *mut utmpx; + pub fn getutxline(ut: *const utmpx) -> *mut utmpx; + pub fn pututxline(ut: *const utmpx) -> *mut utmpx; + pub fn setutxent(); + pub fn endutxent(); + pub fn getpt() -> ::c_int; + pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int; + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; + pub fn statx( + dirfd: ::c_int, + pathname: *const c_char, + flags: ::c_int, + mask: ::c_uint, + statxbuf: *mut statx, + ) -> ::c_int; + pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; + pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; + + pub fn adjtimex(buf: *mut timex) -> ::c_int; + pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; + #[link_name = "ntp_gettimex"] + pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; + pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int; + + pub fn copy_file_range( + fd_in: ::c_int, + off_in: *mut ::off64_t, + fd_out: ::c_int, + off_out: *mut ::off64_t, + len: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; + pub fn fanotify_mark( + fd: ::c_int, + flags: ::c_uint, + mask: u64, + dirfd: ::c_int, + path: *const ::c_char, + ) -> ::c_int; + pub fn preadv2( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off_t, + flags: ::c_int, + ) -> ::ssize_t; + pub fn pwritev2( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off_t, + flags: ::c_int, + ) -> ::ssize_t; + pub fn preadv64v2( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off64_t, + flags: ::c_int, + ) -> ::ssize_t; + pub fn pwritev64v2( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off64_t, + flags: ::c_int, + ) -> ::ssize_t; + pub fn renameat2( + olddirfd: ::c_int, + oldpath: *const ::c_char, + newdirfd: ::c_int, + newpath: *const ::c_char, + flags: ::c_uint, + ) -> ::c_int; + + // Added in `glibc` 2.25 + pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t); + // Added in `glibc` 2.29 + pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; + + pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char; +} + +extern "C" { + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; + pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int; + pub fn glob64( + pattern: *const ::c_char, + flags: ::c_int, + errfunc: ::Option ::c_int>, + pglob: *mut glob64_t, + ) -> ::c_int; + pub fn globfree64(pglob: *mut glob64_t); + pub fn ptrace(request: ::c_uint, ...) -> ::c_long; + pub fn pthread_attr_getaffinity_np( + attr: *const ::pthread_attr_t, + cpusetsize: ::size_t, + cpuset: *mut ::cpu_set_t, + ) -> ::c_int; + pub fn pthread_attr_setaffinity_np( + attr: *mut ::pthread_attr_t, + cpusetsize: ::size_t, + cpuset: *const ::cpu_set_t, + ) -> ::c_int; + pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int; + pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int; + pub fn pthread_rwlockattr_getkind_np( + attr: *const ::pthread_rwlockattr_t, + val: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_rwlockattr_setkind_np( + attr: *mut ::pthread_rwlockattr_t, + val: ::c_int, + ) -> ::c_int; + pub fn pthread_sigqueue(thread: ::pthread_t, sig: ::c_int, value: ::sigval) -> ::c_int; + pub fn mallinfo() -> ::mallinfo; + pub fn mallinfo2() -> ::mallinfo2; + pub fn malloc_info(options: ::c_int, stream: *mut ::FILE) -> ::c_int; + pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t; + pub fn getpwent_r( + pwd: *mut ::passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::passwd, + ) -> ::c_int; + pub fn getgrent_r( + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + + pub fn sethostid(hostid: ::c_long) -> ::c_int; + + pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int; + pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int; +} + +extern "C" { + pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void; + pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int; + pub fn dladdr1( + addr: *const ::c_void, + info: *mut ::Dl_info, + extra_info: *mut *mut ::c_void, + flags: ::c_int, + ) -> ::c_int; + pub fn malloc_trim(__pad: ::size_t) -> ::c_int; +} + +extern "C" { + pub fn gnu_get_libc_release() -> *const ::c_char; + pub fn gnu_get_libc_version() -> *const ::c_char; +} + +cfg_if! { + if #[cfg(any(target_arch = "x86", + target_arch = "arm", + target_arch = "m68k", + target_arch = "mips", + target_arch = "powerpc", + target_arch = "sparc", + target_arch = "riscv32"))] { + mod b32; + pub use self::b32::*; + } else if #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "powerpc64", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", + target_arch = "riscv64", + target_arch = "loongarch64"))] { + mod b64; + pub use self::b64::*; + } else { + // Unknown target_arch + } +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } else { + mod no_align; + pub use self::no_align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs new file mode 100644 index 0000000000000000000000000000000000000000..e32bf673d140e27b412196ccc9b9554b594e2ea8 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/gnu/no_align.rs @@ -0,0 +1,10 @@ +s! { + // FIXME this is actually a union + pub struct sem_t { + #[cfg(target_pointer_width = "32")] + __size: [::c_char; 16], + #[cfg(target_pointer_width = "64")] + __size: [::c_char; 32], + __align: [::c_long; 0], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..aba691e5a85c613784f002c7b974cf4bd07a993d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/mod.rs @@ -0,0 +1,4144 @@ +//! Linux-specific definitions for linux-like values + +pub type useconds_t = u32; +pub type dev_t = u64; +pub type socklen_t = u32; +pub type mode_t = u32; +pub type ino64_t = u64; +pub type off64_t = i64; +pub type blkcnt64_t = i64; +pub type rlim64_t = u64; +pub type mqd_t = ::c_int; +pub type nfds_t = ::c_ulong; +pub type nl_item = ::c_int; +pub type idtype_t = ::c_uint; +pub type loff_t = ::c_longlong; +pub type pthread_key_t = ::c_uint; +pub type pthread_spinlock_t = ::c_int; + +pub type __u8 = ::c_uchar; +pub type __u16 = ::c_ushort; +pub type __s16 = ::c_short; +pub type __u32 = ::c_uint; +pub type __s32 = ::c_int; + +pub type Elf32_Half = u16; +pub type Elf32_Word = u32; +pub type Elf32_Off = u32; +pub type Elf32_Addr = u32; + +pub type Elf64_Half = u16; +pub type Elf64_Word = u32; +pub type Elf64_Off = u64; +pub type Elf64_Addr = u64; +pub type Elf64_Xword = u64; +pub type Elf64_Sxword = i64; + +pub type Elf32_Section = u16; +pub type Elf64_Section = u16; + +// linux/can.h +pub type canid_t = u32; + +// linux/can/j1939.h +pub type can_err_mask_t = u32; +pub type pgn_t = u32; +pub type priority_t = u8; +pub type name_t = u64; + +pub type iconv_t = *mut ::c_void; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum fpos64_t {} // FIXME: fill this out with a struct +impl ::Copy for fpos64_t {} +impl ::Clone for fpos64_t { + fn clone(&self) -> fpos64_t { + *self + } +} + +s! { + pub struct rlimit64 { + pub rlim_cur: rlim64_t, + pub rlim_max: rlim64_t, + } + + pub struct glob_t { + pub gl_pathc: ::size_t, + pub gl_pathv: *mut *mut c_char, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + + __unused1: *mut ::c_void, + __unused2: *mut ::c_void, + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + } + + pub struct passwd { + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_gecos: *mut ::c_char, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char, + } + + pub struct spwd { + pub sp_namp: *mut ::c_char, + pub sp_pwdp: *mut ::c_char, + pub sp_lstchg: ::c_long, + pub sp_min: ::c_long, + pub sp_max: ::c_long, + pub sp_warn: ::c_long, + pub sp_inact: ::c_long, + pub sp_expire: ::c_long, + pub sp_flag: ::c_ulong, + } + + pub struct dqblk { + pub dqb_bhardlimit: u64, + pub dqb_bsoftlimit: u64, + pub dqb_curspace: u64, + pub dqb_ihardlimit: u64, + pub dqb_isoftlimit: u64, + pub dqb_curinodes: u64, + pub dqb_btime: u64, + pub dqb_itime: u64, + pub dqb_valid: u32, + } + + pub struct signalfd_siginfo { + pub ssi_signo: u32, + pub ssi_errno: i32, + pub ssi_code: i32, + pub ssi_pid: u32, + pub ssi_uid: u32, + pub ssi_fd: i32, + pub ssi_tid: u32, + pub ssi_band: u32, + pub ssi_overrun: u32, + pub ssi_trapno: u32, + pub ssi_status: i32, + pub ssi_int: i32, + pub ssi_ptr: u64, + pub ssi_utime: u64, + pub ssi_stime: u64, + pub ssi_addr: u64, + pub ssi_addr_lsb: u16, + _pad2: u16, + pub ssi_syscall: i32, + pub ssi_call_addr: u64, + pub ssi_arch: u32, + _pad: [u8; 28], + } + + pub struct itimerspec { + pub it_interval: ::timespec, + pub it_value: ::timespec, + } + + pub struct fsid_t { + __val: [::c_int; 2], + } + + pub struct packet_mreq { + pub mr_ifindex: ::c_int, + pub mr_type: ::c_ushort, + pub mr_alen: ::c_ushort, + pub mr_address: [::c_uchar; 8], + } + + pub struct cpu_set_t { + #[cfg(all(target_pointer_width = "32", + not(target_arch = "x86_64")))] + bits: [u32; 32], + #[cfg(not(all(target_pointer_width = "32", + not(target_arch = "x86_64"))))] + bits: [u64; 16], + } + + pub struct if_nameindex { + pub if_index: ::c_uint, + pub if_name: *mut ::c_char, + } + + // System V IPC + pub struct msginfo { + pub msgpool: ::c_int, + pub msgmap: ::c_int, + pub msgmax: ::c_int, + pub msgmnb: ::c_int, + pub msgmni: ::c_int, + pub msgssz: ::c_int, + pub msgtql: ::c_int, + pub msgseg: ::c_ushort, + } + + pub struct sembuf { + pub sem_num: ::c_ushort, + pub sem_op: ::c_short, + pub sem_flg: ::c_short, + } + + pub struct input_event { + pub time: ::timeval, + pub type_: ::__u16, + pub code: ::__u16, + pub value: ::__s32, + } + + pub struct input_id { + pub bustype: ::__u16, + pub vendor: ::__u16, + pub product: ::__u16, + pub version: ::__u16, + } + + pub struct input_absinfo { + pub value: ::__s32, + pub minimum: ::__s32, + pub maximum: ::__s32, + pub fuzz: ::__s32, + pub flat: ::__s32, + pub resolution: ::__s32, + } + + pub struct input_keymap_entry { + pub flags: ::__u8, + pub len: ::__u8, + pub index: ::__u16, + pub keycode: ::__u32, + pub scancode: [::__u8; 32], + } + + pub struct input_mask { + pub type_: ::__u32, + pub codes_size: ::__u32, + pub codes_ptr: ::__u64, + } + + pub struct ff_replay { + pub length: ::__u16, + pub delay: ::__u16, + } + + pub struct ff_trigger { + pub button: ::__u16, + pub interval: ::__u16, + } + + pub struct ff_envelope { + pub attack_length: ::__u16, + pub attack_level: ::__u16, + pub fade_length: ::__u16, + pub fade_level: ::__u16, + } + + pub struct ff_constant_effect { + pub level: ::__s16, + pub envelope: ff_envelope, + } + + pub struct ff_ramp_effect { + pub start_level: ::__s16, + pub end_level: ::__s16, + pub envelope: ff_envelope, + } + + pub struct ff_condition_effect { + pub right_saturation: ::__u16, + pub left_saturation: ::__u16, + + pub right_coeff: ::__s16, + pub left_coeff: ::__s16, + + pub deadband: ::__u16, + pub center: ::__s16, + } + + pub struct ff_periodic_effect { + pub waveform: ::__u16, + pub period: ::__u16, + pub magnitude: ::__s16, + pub offset: ::__s16, + pub phase: ::__u16, + + pub envelope: ff_envelope, + + pub custom_len: ::__u32, + pub custom_data: *mut ::__s16, + } + + pub struct ff_rumble_effect { + pub strong_magnitude: ::__u16, + pub weak_magnitude: ::__u16, + } + + pub struct ff_effect { + pub type_: ::__u16, + pub id: ::__s16, + pub direction: ::__u16, + pub trigger: ff_trigger, + pub replay: ff_replay, + // FIXME this is actually a union + #[cfg(target_pointer_width = "64")] + pub u: [u64; 4], + #[cfg(target_pointer_width = "32")] + pub u: [u32; 7], + } + + pub struct uinput_ff_upload { + pub request_id: ::__u32, + pub retval: ::__s32, + pub effect: ff_effect, + pub old: ff_effect, + } + + pub struct uinput_ff_erase { + pub request_id: ::__u32, + pub retval: ::__s32, + pub effect_id: ::__u32, + } + + pub struct uinput_abs_setup { + pub code: ::__u16, + pub absinfo: input_absinfo, + } + + pub struct dl_phdr_info { + #[cfg(target_pointer_width = "64")] + pub dlpi_addr: Elf64_Addr, + #[cfg(target_pointer_width = "32")] + pub dlpi_addr: Elf32_Addr, + + pub dlpi_name: *const ::c_char, + + #[cfg(target_pointer_width = "64")] + pub dlpi_phdr: *const Elf64_Phdr, + #[cfg(target_pointer_width = "32")] + pub dlpi_phdr: *const Elf32_Phdr, + + #[cfg(target_pointer_width = "64")] + pub dlpi_phnum: Elf64_Half, + #[cfg(target_pointer_width = "32")] + pub dlpi_phnum: Elf32_Half, + + // As of uClibc 1.0.36, the following fields are + // gated behind a "#if 0" block which always evaluates + // to false. So I'm just removing these, and if uClibc changes + // the #if block in the future to include the following fields, these + // will probably need including here. tsidea, skrap + #[cfg(not(target_env = "uclibc"))] + pub dlpi_adds: ::c_ulonglong, + #[cfg(not(target_env = "uclibc"))] + pub dlpi_subs: ::c_ulonglong, + #[cfg(not(target_env = "uclibc"))] + pub dlpi_tls_modid: ::size_t, + #[cfg(not(target_env = "uclibc"))] + pub dlpi_tls_data: *mut ::c_void, + } + + pub struct Elf32_Ehdr { + pub e_ident: [::c_uchar; 16], + pub e_type: Elf32_Half, + pub e_machine: Elf32_Half, + pub e_version: Elf32_Word, + pub e_entry: Elf32_Addr, + pub e_phoff: Elf32_Off, + pub e_shoff: Elf32_Off, + pub e_flags: Elf32_Word, + pub e_ehsize: Elf32_Half, + pub e_phentsize: Elf32_Half, + pub e_phnum: Elf32_Half, + pub e_shentsize: Elf32_Half, + pub e_shnum: Elf32_Half, + pub e_shstrndx: Elf32_Half, + } + + pub struct Elf64_Ehdr { + pub e_ident: [::c_uchar; 16], + pub e_type: Elf64_Half, + pub e_machine: Elf64_Half, + pub e_version: Elf64_Word, + pub e_entry: Elf64_Addr, + pub e_phoff: Elf64_Off, + pub e_shoff: Elf64_Off, + pub e_flags: Elf64_Word, + pub e_ehsize: Elf64_Half, + pub e_phentsize: Elf64_Half, + pub e_phnum: Elf64_Half, + pub e_shentsize: Elf64_Half, + pub e_shnum: Elf64_Half, + pub e_shstrndx: Elf64_Half, + } + + pub struct Elf32_Sym { + pub st_name: Elf32_Word, + pub st_value: Elf32_Addr, + pub st_size: Elf32_Word, + pub st_info: ::c_uchar, + pub st_other: ::c_uchar, + pub st_shndx: Elf32_Section, + } + + pub struct Elf64_Sym { + pub st_name: Elf64_Word, + pub st_info: ::c_uchar, + pub st_other: ::c_uchar, + pub st_shndx: Elf64_Section, + pub st_value: Elf64_Addr, + pub st_size: Elf64_Xword, + } + + pub struct Elf32_Phdr { + pub p_type: Elf32_Word, + pub p_offset: Elf32_Off, + pub p_vaddr: Elf32_Addr, + pub p_paddr: Elf32_Addr, + pub p_filesz: Elf32_Word, + pub p_memsz: Elf32_Word, + pub p_flags: Elf32_Word, + pub p_align: Elf32_Word, + } + + pub struct Elf64_Phdr { + pub p_type: Elf64_Word, + pub p_flags: Elf64_Word, + pub p_offset: Elf64_Off, + pub p_vaddr: Elf64_Addr, + pub p_paddr: Elf64_Addr, + pub p_filesz: Elf64_Xword, + pub p_memsz: Elf64_Xword, + pub p_align: Elf64_Xword, + } + + pub struct Elf32_Shdr { + pub sh_name: Elf32_Word, + pub sh_type: Elf32_Word, + pub sh_flags: Elf32_Word, + pub sh_addr: Elf32_Addr, + pub sh_offset: Elf32_Off, + pub sh_size: Elf32_Word, + pub sh_link: Elf32_Word, + pub sh_info: Elf32_Word, + pub sh_addralign: Elf32_Word, + pub sh_entsize: Elf32_Word, + } + + pub struct Elf64_Shdr { + pub sh_name: Elf64_Word, + pub sh_type: Elf64_Word, + pub sh_flags: Elf64_Xword, + pub sh_addr: Elf64_Addr, + pub sh_offset: Elf64_Off, + pub sh_size: Elf64_Xword, + pub sh_link: Elf64_Word, + pub sh_info: Elf64_Word, + pub sh_addralign: Elf64_Xword, + pub sh_entsize: Elf64_Xword, + } + + pub struct ucred { + pub pid: ::pid_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + } + + pub struct mntent { + pub mnt_fsname: *mut ::c_char, + pub mnt_dir: *mut ::c_char, + pub mnt_type: *mut ::c_char, + pub mnt_opts: *mut ::c_char, + pub mnt_freq: ::c_int, + pub mnt_passno: ::c_int, + } + + pub struct posix_spawn_file_actions_t { + __allocated: ::c_int, + __used: ::c_int, + __actions: *mut ::c_int, + __pad: [::c_int; 16], + } + + pub struct posix_spawnattr_t { + __flags: ::c_short, + __pgrp: ::pid_t, + __sd: ::sigset_t, + __ss: ::sigset_t, + #[cfg(target_env = "musl")] + __prio: ::c_int, + #[cfg(not(target_env = "musl"))] + __sp: ::sched_param, + __policy: ::c_int, + __pad: [::c_int; 16], + } + + pub struct genlmsghdr { + pub cmd: u8, + pub version: u8, + pub reserved: u16, + } + + pub struct in6_pktinfo { + pub ipi6_addr: ::in6_addr, + pub ipi6_ifindex: ::c_uint, + } + + pub struct arpd_request { + pub req: ::c_ushort, + pub ip: u32, + pub dev: ::c_ulong, + pub stamp: ::c_ulong, + pub updated: ::c_ulong, + pub ha: [::c_uchar; ::MAX_ADDR_LEN], + } + + pub struct inotify_event { + pub wd: ::c_int, + pub mask: u32, + pub cookie: u32, + pub len: u32 + } + + pub struct fanotify_response { + pub fd: ::c_int, + pub response: __u32, + } + + pub struct sockaddr_vm { + pub svm_family: ::sa_family_t, + pub svm_reserved1: ::c_ushort, + pub svm_port: ::c_uint, + pub svm_cid: ::c_uint, + pub svm_zero: [u8; 4] + } + + pub struct regmatch_t { + pub rm_so: regoff_t, + pub rm_eo: regoff_t, + } + + pub struct sock_extended_err { + pub ee_errno: u32, + pub ee_origin: u8, + pub ee_type: u8, + pub ee_code: u8, + pub ee_pad: u8, + pub ee_info: u32, + pub ee_data: u32, + } + + // linux/can.h + pub struct __c_anonymous_sockaddr_can_tp { + pub rx_id: canid_t, + pub tx_id: canid_t, + } + + pub struct __c_anonymous_sockaddr_can_j1939 { + pub name: u64, + pub pgn: u32, + pub addr: u8, + } + + pub struct can_filter { + pub can_id: canid_t, + pub can_mask: canid_t, + } + + // linux/can/j1939.h + pub struct j1939_filter { + pub name: name_t, + pub name_mask: name_t, + pub pgn: pgn_t, + pub pgn_mask: pgn_t, + pub addr: u8, + pub addr_mask: u8, + } + + // linux/filter.h + pub struct sock_filter { + pub code: ::__u16, + pub jt: ::__u8, + pub jf: ::__u8, + pub k: ::__u32, + } + + pub struct sock_fprog { + pub len: ::c_ushort, + pub filter: *mut sock_filter, + } + + // linux/seccomp.h + pub struct seccomp_data { + pub nr: ::c_int, + pub arch: ::__u32, + pub instruction_pointer: ::__u64, + pub args: [::__u64; 6], + } + + pub struct nlmsghdr { + pub nlmsg_len: u32, + pub nlmsg_type: u16, + pub nlmsg_flags: u16, + pub nlmsg_seq: u32, + pub nlmsg_pid: u32, + } + + pub struct nlmsgerr { + pub error: ::c_int, + pub msg: nlmsghdr, + } + + pub struct nlattr { + pub nla_len: u16, + pub nla_type: u16, + } +} + +s_no_extra_traits! { + pub struct sockaddr_nl { + pub nl_family: ::sa_family_t, + nl_pad: ::c_ushort, + pub nl_pid: u32, + pub nl_groups: u32 + } + + pub struct dirent { + pub d_ino: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + + pub struct dirent64 { + pub d_ino: ::ino64_t, + pub d_off: ::off64_t, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + + pub struct sockaddr_alg { + pub salg_family: ::sa_family_t, + pub salg_type: [::c_uchar; 14], + pub salg_feat: u32, + pub salg_mask: u32, + pub salg_name: [::c_uchar; 64], + } + + pub struct uinput_setup { + pub id: input_id, + pub name: [::c_char; UINPUT_MAX_NAME_SIZE], + pub ff_effects_max: ::__u32, + } + + pub struct uinput_user_dev { + pub name: [::c_char; UINPUT_MAX_NAME_SIZE], + pub id: input_id, + pub ff_effects_max: ::__u32, + pub absmax: [::__s32; ABS_CNT], + pub absmin: [::__s32; ABS_CNT], + pub absfuzz: [::__s32; ABS_CNT], + pub absflat: [::__s32; ABS_CNT], + } + + /// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this + /// type are unsound and will be removed in the future. + #[deprecated( + note = "this struct has unsafe trait implementations that will be \ + removed in the future", + since = "0.2.80" + )] + pub struct af_alg_iv { + pub ivlen: u32, + pub iv: [::c_uchar; 0], + } + + // x32 compatibility + // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279 + pub struct mq_attr { + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_flags: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_maxmsg: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_msgsize: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub mq_curmsgs: i64, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pad: [i64; 4], + + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub mq_flags: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub mq_maxmsg: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub mq_msgsize: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub mq_curmsgs: ::c_long, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pad: [::c_long; 4], + } +} + +s_no_extra_traits! { + // linux/net_tstamp.h + #[allow(missing_debug_implementations)] + pub struct sock_txtime { + pub clockid: ::clockid_t, + pub flags: ::__u32, + } +} + +cfg_if! { + if #[cfg(libc_union)] { + s_no_extra_traits! { + // linux/can.h + #[allow(missing_debug_implementations)] + pub union __c_anonymous_sockaddr_can_can_addr { + pub tp: __c_anonymous_sockaddr_can_tp, + pub j1939: __c_anonymous_sockaddr_can_j1939, + } + + #[allow(missing_debug_implementations)] + pub struct sockaddr_can { + pub can_family: ::sa_family_t, + pub can_ifindex: ::c_int, + pub can_addr: __c_anonymous_sockaddr_can_can_addr, + } + } + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for sockaddr_nl { + fn eq(&self, other: &sockaddr_nl) -> bool { + self.nl_family == other.nl_family && + self.nl_pid == other.nl_pid && + self.nl_groups == other.nl_groups + } + } + impl Eq for sockaddr_nl {} + impl ::fmt::Debug for sockaddr_nl { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_nl") + .field("nl_family", &self.nl_family) + .field("nl_pid", &self.nl_pid) + .field("nl_groups", &self.nl_groups) + .finish() + } + } + impl ::hash::Hash for sockaddr_nl { + fn hash(&self, state: &mut H) { + self.nl_family.hash(state); + self.nl_pid.hash(state); + self.nl_groups.hash(state); + } + } + + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_ino == other.d_ino + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for dirent {} + + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_ino", &self.d_ino) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for dirent64 { + fn eq(&self, other: &dirent64) -> bool { + self.d_ino == other.d_ino + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for dirent64 {} + + impl ::fmt::Debug for dirent64 { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent64") + .field("d_ino", &self.d_ino) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + + impl ::hash::Hash for dirent64 { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for pthread_cond_t { + fn eq(&self, other: &pthread_cond_t) -> bool { + self.size.iter().zip(other.size.iter()).all(|(a,b)| a == b) + } + } + + impl Eq for pthread_cond_t {} + + impl ::fmt::Debug for pthread_cond_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_cond_t") + // FIXME: .field("size", &self.size) + .finish() + } + } + + impl ::hash::Hash for pthread_cond_t { + fn hash(&self, state: &mut H) { + self.size.hash(state); + } + } + + impl PartialEq for pthread_mutex_t { + fn eq(&self, other: &pthread_mutex_t) -> bool { + self.size.iter().zip(other.size.iter()).all(|(a,b)| a == b) + } + } + + impl Eq for pthread_mutex_t {} + + impl ::fmt::Debug for pthread_mutex_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_mutex_t") + // FIXME: .field("size", &self.size) + .finish() + } + } + + impl ::hash::Hash for pthread_mutex_t { + fn hash(&self, state: &mut H) { + self.size.hash(state); + } + } + + impl PartialEq for pthread_rwlock_t { + fn eq(&self, other: &pthread_rwlock_t) -> bool { + self.size.iter().zip(other.size.iter()).all(|(a,b)| a == b) + } + } + + impl Eq for pthread_rwlock_t {} + + impl ::fmt::Debug for pthread_rwlock_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("pthread_rwlock_t") + // FIXME: .field("size", &self.size) + .finish() + } + } + + impl ::hash::Hash for pthread_rwlock_t { + fn hash(&self, state: &mut H) { + self.size.hash(state); + } + } + + impl PartialEq for sockaddr_alg { + fn eq(&self, other: &sockaddr_alg) -> bool { + self.salg_family == other.salg_family + && self + .salg_type + .iter() + .zip(other.salg_type.iter()) + .all(|(a, b)| a == b) + && self.salg_feat == other.salg_feat + && self.salg_mask == other.salg_mask + && self + .salg_name + .iter() + .zip(other.salg_name.iter()) + .all(|(a, b)| a == b) + } + } + + impl Eq for sockaddr_alg {} + + impl ::fmt::Debug for sockaddr_alg { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_alg") + .field("salg_family", &self.salg_family) + .field("salg_type", &self.salg_type) + .field("salg_feat", &self.salg_feat) + .field("salg_mask", &self.salg_mask) + .field("salg_name", &&self.salg_name[..]) + .finish() + } + } + + impl ::hash::Hash for sockaddr_alg { + fn hash(&self, state: &mut H) { + self.salg_family.hash(state); + self.salg_type.hash(state); + self.salg_feat.hash(state); + self.salg_mask.hash(state); + self.salg_name.hash(state); + } + } + + impl PartialEq for uinput_setup { + fn eq(&self, other: &uinput_setup) -> bool { + self.id == other.id + && self.name[..] == other.name[..] + && self.ff_effects_max == other.ff_effects_max + } + } + impl Eq for uinput_setup {} + + impl ::fmt::Debug for uinput_setup { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("uinput_setup") + .field("id", &self.id) + .field("name", &&self.name[..]) + .field("ff_effects_max", &self.ff_effects_max) + .finish() + } + } + + impl ::hash::Hash for uinput_setup { + fn hash(&self, state: &mut H) { + self.id.hash(state); + self.name.hash(state); + self.ff_effects_max.hash(state); + } + } + + impl PartialEq for uinput_user_dev { + fn eq(&self, other: &uinput_user_dev) -> bool { + self.name[..] == other.name[..] + && self.id == other.id + && self.ff_effects_max == other.ff_effects_max + && self.absmax[..] == other.absmax[..] + && self.absmin[..] == other.absmin[..] + && self.absfuzz[..] == other.absfuzz[..] + && self.absflat[..] == other.absflat[..] + } + } + impl Eq for uinput_user_dev {} + + impl ::fmt::Debug for uinput_user_dev { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("uinput_setup") + .field("name", &&self.name[..]) + .field("id", &self.id) + .field("ff_effects_max", &self.ff_effects_max) + .field("absmax", &&self.absmax[..]) + .field("absmin", &&self.absmin[..]) + .field("absfuzz", &&self.absfuzz[..]) + .field("absflat", &&self.absflat[..]) + .finish() + } + } + + impl ::hash::Hash for uinput_user_dev { + fn hash(&self, state: &mut H) { + self.name.hash(state); + self.id.hash(state); + self.ff_effects_max.hash(state); + self.absmax.hash(state); + self.absmin.hash(state); + self.absfuzz.hash(state); + self.absflat.hash(state); + } + } + + #[allow(deprecated)] + impl af_alg_iv { + fn as_slice(&self) -> &[u8] { + unsafe { + ::core::slice::from_raw_parts( + self.iv.as_ptr(), + self.ivlen as usize + ) + } + } + } + + #[allow(deprecated)] + impl PartialEq for af_alg_iv { + fn eq(&self, other: &af_alg_iv) -> bool { + *self.as_slice() == *other.as_slice() + } + } + + #[allow(deprecated)] + impl Eq for af_alg_iv {} + + #[allow(deprecated)] + impl ::fmt::Debug for af_alg_iv { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("af_alg_iv") + .field("ivlen", &self.ivlen) + .finish() + } + } + + #[allow(deprecated)] + impl ::hash::Hash for af_alg_iv { + fn hash(&self, state: &mut H) { + self.as_slice().hash(state); + } + } + + impl PartialEq for mq_attr { + fn eq(&self, other: &mq_attr) -> bool { + self.mq_flags == other.mq_flags && + self.mq_maxmsg == other.mq_maxmsg && + self.mq_msgsize == other.mq_msgsize && + self.mq_curmsgs == other.mq_curmsgs + } + } + impl Eq for mq_attr {} + impl ::fmt::Debug for mq_attr { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mq_attr") + .field("mq_flags", &self.mq_flags) + .field("mq_maxmsg", &self.mq_maxmsg) + .field("mq_msgsize", &self.mq_msgsize) + .field("mq_curmsgs", &self.mq_curmsgs) + .finish() + } + } + impl ::hash::Hash for mq_attr { + fn hash(&self, state: &mut H) { + self.mq_flags.hash(state); + self.mq_maxmsg.hash(state); + self.mq_msgsize.hash(state); + self.mq_curmsgs.hash(state); + } + } + } +} + +cfg_if! { + if #[cfg(any(target_env = "gnu", target_env = "musl"))] { + pub const ABDAY_1: ::nl_item = 0x20000; + pub const ABDAY_2: ::nl_item = 0x20001; + pub const ABDAY_3: ::nl_item = 0x20002; + pub const ABDAY_4: ::nl_item = 0x20003; + pub const ABDAY_5: ::nl_item = 0x20004; + pub const ABDAY_6: ::nl_item = 0x20005; + pub const ABDAY_7: ::nl_item = 0x20006; + + pub const DAY_1: ::nl_item = 0x20007; + pub const DAY_2: ::nl_item = 0x20008; + pub const DAY_3: ::nl_item = 0x20009; + pub const DAY_4: ::nl_item = 0x2000A; + pub const DAY_5: ::nl_item = 0x2000B; + pub const DAY_6: ::nl_item = 0x2000C; + pub const DAY_7: ::nl_item = 0x2000D; + + pub const ABMON_1: ::nl_item = 0x2000E; + pub const ABMON_2: ::nl_item = 0x2000F; + pub const ABMON_3: ::nl_item = 0x20010; + pub const ABMON_4: ::nl_item = 0x20011; + pub const ABMON_5: ::nl_item = 0x20012; + pub const ABMON_6: ::nl_item = 0x20013; + pub const ABMON_7: ::nl_item = 0x20014; + pub const ABMON_8: ::nl_item = 0x20015; + pub const ABMON_9: ::nl_item = 0x20016; + pub const ABMON_10: ::nl_item = 0x20017; + pub const ABMON_11: ::nl_item = 0x20018; + pub const ABMON_12: ::nl_item = 0x20019; + + pub const MON_1: ::nl_item = 0x2001A; + pub const MON_2: ::nl_item = 0x2001B; + pub const MON_3: ::nl_item = 0x2001C; + pub const MON_4: ::nl_item = 0x2001D; + pub const MON_5: ::nl_item = 0x2001E; + pub const MON_6: ::nl_item = 0x2001F; + pub const MON_7: ::nl_item = 0x20020; + pub const MON_8: ::nl_item = 0x20021; + pub const MON_9: ::nl_item = 0x20022; + pub const MON_10: ::nl_item = 0x20023; + pub const MON_11: ::nl_item = 0x20024; + pub const MON_12: ::nl_item = 0x20025; + + pub const AM_STR: ::nl_item = 0x20026; + pub const PM_STR: ::nl_item = 0x20027; + + pub const D_T_FMT: ::nl_item = 0x20028; + pub const D_FMT: ::nl_item = 0x20029; + pub const T_FMT: ::nl_item = 0x2002A; + pub const T_FMT_AMPM: ::nl_item = 0x2002B; + + pub const ERA: ::nl_item = 0x2002C; + pub const ERA_D_FMT: ::nl_item = 0x2002E; + pub const ALT_DIGITS: ::nl_item = 0x2002F; + pub const ERA_D_T_FMT: ::nl_item = 0x20030; + pub const ERA_T_FMT: ::nl_item = 0x20031; + + pub const CODESET: ::nl_item = 14; + pub const CRNCYSTR: ::nl_item = 0x4000F; + pub const RADIXCHAR: ::nl_item = 0x10000; + pub const THOUSEP: ::nl_item = 0x10001; + pub const YESEXPR: ::nl_item = 0x50000; + pub const NOEXPR: ::nl_item = 0x50001; + pub const YESSTR: ::nl_item = 0x50002; + pub const NOSTR: ::nl_item = 0x50003; + } +} + +pub const RUSAGE_CHILDREN: ::c_int = -1; +pub const L_tmpnam: ::c_uint = 20; +pub const _PC_LINK_MAX: ::c_int = 0; +pub const _PC_MAX_CANON: ::c_int = 1; +pub const _PC_MAX_INPUT: ::c_int = 2; +pub const _PC_NAME_MAX: ::c_int = 3; +pub const _PC_PATH_MAX: ::c_int = 4; +pub const _PC_PIPE_BUF: ::c_int = 5; +pub const _PC_CHOWN_RESTRICTED: ::c_int = 6; +pub const _PC_NO_TRUNC: ::c_int = 7; +pub const _PC_VDISABLE: ::c_int = 8; +pub const _PC_SYNC_IO: ::c_int = 9; +pub const _PC_ASYNC_IO: ::c_int = 10; +pub const _PC_PRIO_IO: ::c_int = 11; +pub const _PC_SOCK_MAXBUF: ::c_int = 12; +pub const _PC_FILESIZEBITS: ::c_int = 13; +pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14; +pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15; +pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16; +pub const _PC_REC_XFER_ALIGN: ::c_int = 17; +pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18; +pub const _PC_SYMLINK_MAX: ::c_int = 19; +pub const _PC_2_SYMLINKS: ::c_int = 20; + +pub const MS_NOUSER: ::c_ulong = 0xffffffff80000000; + +pub const _SC_ARG_MAX: ::c_int = 0; +pub const _SC_CHILD_MAX: ::c_int = 1; +pub const _SC_CLK_TCK: ::c_int = 2; +pub const _SC_NGROUPS_MAX: ::c_int = 3; +pub const _SC_OPEN_MAX: ::c_int = 4; +pub const _SC_STREAM_MAX: ::c_int = 5; +pub const _SC_TZNAME_MAX: ::c_int = 6; +pub const _SC_JOB_CONTROL: ::c_int = 7; +pub const _SC_SAVED_IDS: ::c_int = 8; +pub const _SC_REALTIME_SIGNALS: ::c_int = 9; +pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10; +pub const _SC_TIMERS: ::c_int = 11; +pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12; +pub const _SC_PRIORITIZED_IO: ::c_int = 13; +pub const _SC_SYNCHRONIZED_IO: ::c_int = 14; +pub const _SC_FSYNC: ::c_int = 15; +pub const _SC_MAPPED_FILES: ::c_int = 16; +pub const _SC_MEMLOCK: ::c_int = 17; +pub const _SC_MEMLOCK_RANGE: ::c_int = 18; +pub const _SC_MEMORY_PROTECTION: ::c_int = 19; +pub const _SC_MESSAGE_PASSING: ::c_int = 20; +pub const _SC_SEMAPHORES: ::c_int = 21; +pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22; +pub const _SC_AIO_LISTIO_MAX: ::c_int = 23; +pub const _SC_AIO_MAX: ::c_int = 24; +pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25; +pub const _SC_DELAYTIMER_MAX: ::c_int = 26; +pub const _SC_MQ_OPEN_MAX: ::c_int = 27; +pub const _SC_MQ_PRIO_MAX: ::c_int = 28; +pub const _SC_VERSION: ::c_int = 29; +pub const _SC_PAGESIZE: ::c_int = 30; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; +pub const _SC_RTSIG_MAX: ::c_int = 31; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 32; +pub const _SC_SEM_VALUE_MAX: ::c_int = 33; +pub const _SC_SIGQUEUE_MAX: ::c_int = 34; +pub const _SC_TIMER_MAX: ::c_int = 35; +pub const _SC_BC_BASE_MAX: ::c_int = 36; +pub const _SC_BC_DIM_MAX: ::c_int = 37; +pub const _SC_BC_SCALE_MAX: ::c_int = 38; +pub const _SC_BC_STRING_MAX: ::c_int = 39; +pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40; +pub const _SC_EXPR_NEST_MAX: ::c_int = 42; +pub const _SC_LINE_MAX: ::c_int = 43; +pub const _SC_RE_DUP_MAX: ::c_int = 44; +pub const _SC_2_VERSION: ::c_int = 46; +pub const _SC_2_C_BIND: ::c_int = 47; +pub const _SC_2_C_DEV: ::c_int = 48; +pub const _SC_2_FORT_DEV: ::c_int = 49; +pub const _SC_2_FORT_RUN: ::c_int = 50; +pub const _SC_2_SW_DEV: ::c_int = 51; +pub const _SC_2_LOCALEDEF: ::c_int = 52; +pub const _SC_UIO_MAXIOV: ::c_int = 60; +pub const _SC_IOV_MAX: ::c_int = 60; +pub const _SC_THREADS: ::c_int = 67; +pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70; +pub const _SC_LOGIN_NAME_MAX: ::c_int = 71; +pub const _SC_TTY_NAME_MAX: ::c_int = 72; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73; +pub const _SC_THREAD_KEYS_MAX: ::c_int = 74; +pub const _SC_THREAD_STACK_MIN: ::c_int = 75; +pub const _SC_THREAD_THREADS_MAX: ::c_int = 76; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79; +pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80; +pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82; +pub const _SC_NPROCESSORS_CONF: ::c_int = 83; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 84; +pub const _SC_PHYS_PAGES: ::c_int = 85; +pub const _SC_AVPHYS_PAGES: ::c_int = 86; +pub const _SC_ATEXIT_MAX: ::c_int = 87; +pub const _SC_PASS_MAX: ::c_int = 88; +pub const _SC_XOPEN_VERSION: ::c_int = 89; +pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90; +pub const _SC_XOPEN_UNIX: ::c_int = 91; +pub const _SC_XOPEN_CRYPT: ::c_int = 92; +pub const _SC_XOPEN_ENH_I18N: ::c_int = 93; +pub const _SC_XOPEN_SHM: ::c_int = 94; +pub const _SC_2_CHAR_TERM: ::c_int = 95; +pub const _SC_2_UPE: ::c_int = 97; +pub const _SC_XOPEN_XPG2: ::c_int = 98; +pub const _SC_XOPEN_XPG3: ::c_int = 99; +pub const _SC_XOPEN_XPG4: ::c_int = 100; +pub const _SC_NZERO: ::c_int = 109; +pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125; +pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126; +pub const _SC_XBS5_LP64_OFF64: ::c_int = 127; +pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128; +pub const _SC_XOPEN_LEGACY: ::c_int = 129; +pub const _SC_XOPEN_REALTIME: ::c_int = 130; +pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131; +pub const _SC_ADVISORY_INFO: ::c_int = 132; +pub const _SC_BARRIERS: ::c_int = 133; +pub const _SC_CLOCK_SELECTION: ::c_int = 137; +pub const _SC_CPUTIME: ::c_int = 138; +pub const _SC_THREAD_CPUTIME: ::c_int = 139; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 149; +pub const _SC_READER_WRITER_LOCKS: ::c_int = 153; +pub const _SC_SPIN_LOCKS: ::c_int = 154; +pub const _SC_REGEXP: ::c_int = 155; +pub const _SC_SHELL: ::c_int = 157; +pub const _SC_SPAWN: ::c_int = 159; +pub const _SC_SPORADIC_SERVER: ::c_int = 160; +pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161; +pub const _SC_TIMEOUTS: ::c_int = 164; +pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165; +pub const _SC_2_PBS: ::c_int = 168; +pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169; +pub const _SC_2_PBS_LOCATE: ::c_int = 170; +pub const _SC_2_PBS_MESSAGE: ::c_int = 171; +pub const _SC_2_PBS_TRACK: ::c_int = 172; +pub const _SC_SYMLOOP_MAX: ::c_int = 173; +pub const _SC_STREAMS: ::c_int = 174; +pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175; +pub const _SC_V6_ILP32_OFF32: ::c_int = 176; +pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177; +pub const _SC_V6_LP64_OFF64: ::c_int = 178; +pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179; +pub const _SC_HOST_NAME_MAX: ::c_int = 180; +pub const _SC_TRACE: ::c_int = 181; +pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182; +pub const _SC_TRACE_INHERIT: ::c_int = 183; +pub const _SC_TRACE_LOG: ::c_int = 184; +pub const _SC_IPV6: ::c_int = 235; +pub const _SC_RAW_SOCKETS: ::c_int = 236; +pub const _SC_V7_ILP32_OFF32: ::c_int = 237; +pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238; +pub const _SC_V7_LP64_OFF64: ::c_int = 239; +pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240; +pub const _SC_SS_REPL_MAX: ::c_int = 241; +pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242; +pub const _SC_TRACE_NAME_MAX: ::c_int = 243; +pub const _SC_TRACE_SYS_MAX: ::c_int = 244; +pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245; +pub const _SC_XOPEN_STREAMS: ::c_int = 246; +pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247; +pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248; + +pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY; +pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY; + +pub const AT_NULL: ::c_ulong = 0; +pub const AT_IGNORE: ::c_ulong = 1; +pub const AT_EXECFD: ::c_ulong = 2; +pub const AT_PHDR: ::c_ulong = 3; +pub const AT_PHENT: ::c_ulong = 4; +pub const AT_PHNUM: ::c_ulong = 5; +pub const AT_PAGESZ: ::c_ulong = 6; +pub const AT_BASE: ::c_ulong = 7; +pub const AT_FLAGS: ::c_ulong = 8; +pub const AT_ENTRY: ::c_ulong = 9; +pub const AT_NOTELF: ::c_ulong = 10; +pub const AT_UID: ::c_ulong = 11; +pub const AT_EUID: ::c_ulong = 12; +pub const AT_GID: ::c_ulong = 13; +pub const AT_EGID: ::c_ulong = 14; +pub const AT_PLATFORM: ::c_ulong = 15; +pub const AT_HWCAP: ::c_ulong = 16; +pub const AT_CLKTCK: ::c_ulong = 17; + +pub const AT_SECURE: ::c_ulong = 23; +pub const AT_BASE_PLATFORM: ::c_ulong = 24; +pub const AT_RANDOM: ::c_ulong = 25; +pub const AT_HWCAP2: ::c_ulong = 26; + +pub const AT_EXECFN: ::c_ulong = 31; + +pub const GLOB_ERR: ::c_int = 1 << 0; +pub const GLOB_MARK: ::c_int = 1 << 1; +pub const GLOB_NOSORT: ::c_int = 1 << 2; +pub const GLOB_DOOFFS: ::c_int = 1 << 3; +pub const GLOB_NOCHECK: ::c_int = 1 << 4; +pub const GLOB_APPEND: ::c_int = 1 << 5; +pub const GLOB_NOESCAPE: ::c_int = 1 << 6; + +pub const GLOB_NOSPACE: ::c_int = 1; +pub const GLOB_ABORTED: ::c_int = 2; +pub const GLOB_NOMATCH: ::c_int = 3; + +pub const POSIX_MADV_NORMAL: ::c_int = 0; +pub const POSIX_MADV_RANDOM: ::c_int = 1; +pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_MADV_WILLNEED: ::c_int = 3; +pub const POSIX_SPAWN_USEVFORK: ::c_int = 64; + +pub const S_IEXEC: mode_t = 64; +pub const S_IWRITE: mode_t = 128; +pub const S_IREAD: mode_t = 256; + +pub const F_LOCK: ::c_int = 1; +pub const F_TEST: ::c_int = 3; +pub const F_TLOCK: ::c_int = 2; +pub const F_ULOCK: ::c_int = 0; + +pub const F_SEAL_FUTURE_WRITE: ::c_int = 0x0010; + +pub const IFF_LOWER_UP: ::c_int = 0x10000; +pub const IFF_DORMANT: ::c_int = 0x20000; +pub const IFF_ECHO: ::c_int = 0x40000; + +// linux/if_addr.h +pub const IFA_UNSPEC: ::c_ushort = 0; +pub const IFA_ADDRESS: ::c_ushort = 1; +pub const IFA_LOCAL: ::c_ushort = 2; +pub const IFA_LABEL: ::c_ushort = 3; +pub const IFA_BROADCAST: ::c_ushort = 4; +pub const IFA_ANYCAST: ::c_ushort = 5; +pub const IFA_CACHEINFO: ::c_ushort = 6; +pub const IFA_MULTICAST: ::c_ushort = 7; + +pub const IFA_F_SECONDARY: u32 = 0x01; +pub const IFA_F_TEMPORARY: u32 = 0x01; +pub const IFA_F_NODAD: u32 = 0x02; +pub const IFA_F_OPTIMISTIC: u32 = 0x04; +pub const IFA_F_DADFAILED: u32 = 0x08; +pub const IFA_F_HOMEADDRESS: u32 = 0x10; +pub const IFA_F_DEPRECATED: u32 = 0x20; +pub const IFA_F_TENTATIVE: u32 = 0x40; +pub const IFA_F_PERMANENT: u32 = 0x80; + +// linux/if_link.h +pub const IFLA_UNSPEC: ::c_ushort = 0; +pub const IFLA_ADDRESS: ::c_ushort = 1; +pub const IFLA_BROADCAST: ::c_ushort = 2; +pub const IFLA_IFNAME: ::c_ushort = 3; +pub const IFLA_MTU: ::c_ushort = 4; +pub const IFLA_LINK: ::c_ushort = 5; +pub const IFLA_QDISC: ::c_ushort = 6; +pub const IFLA_STATS: ::c_ushort = 7; +pub const IFLA_COST: ::c_ushort = 8; +pub const IFLA_PRIORITY: ::c_ushort = 9; +pub const IFLA_MASTER: ::c_ushort = 10; +pub const IFLA_WIRELESS: ::c_ushort = 11; +pub const IFLA_PROTINFO: ::c_ushort = 12; +pub const IFLA_TXQLEN: ::c_ushort = 13; +pub const IFLA_MAP: ::c_ushort = 14; +pub const IFLA_WEIGHT: ::c_ushort = 15; +pub const IFLA_OPERSTATE: ::c_ushort = 16; +pub const IFLA_LINKMODE: ::c_ushort = 17; +pub const IFLA_LINKINFO: ::c_ushort = 18; +pub const IFLA_NET_NS_PID: ::c_ushort = 19; +pub const IFLA_IFALIAS: ::c_ushort = 20; +pub const IFLA_NUM_VF: ::c_ushort = 21; +pub const IFLA_VFINFO_LIST: ::c_ushort = 22; +pub const IFLA_STATS64: ::c_ushort = 23; +pub const IFLA_VF_PORTS: ::c_ushort = 24; +pub const IFLA_PORT_SELF: ::c_ushort = 25; +pub const IFLA_AF_SPEC: ::c_ushort = 26; +pub const IFLA_GROUP: ::c_ushort = 27; +pub const IFLA_NET_NS_FD: ::c_ushort = 28; +pub const IFLA_EXT_MASK: ::c_ushort = 29; +pub const IFLA_PROMISCUITY: ::c_ushort = 30; +pub const IFLA_NUM_TX_QUEUES: ::c_ushort = 31; +pub const IFLA_NUM_RX_QUEUES: ::c_ushort = 32; +pub const IFLA_CARRIER: ::c_ushort = 33; +pub const IFLA_PHYS_PORT_ID: ::c_ushort = 34; +pub const IFLA_CARRIER_CHANGES: ::c_ushort = 35; +pub const IFLA_PHYS_SWITCH_ID: ::c_ushort = 36; +pub const IFLA_LINK_NETNSID: ::c_ushort = 37; +pub const IFLA_PHYS_PORT_NAME: ::c_ushort = 38; +pub const IFLA_PROTO_DOWN: ::c_ushort = 39; +pub const IFLA_GSO_MAX_SEGS: ::c_ushort = 40; +pub const IFLA_GSO_MAX_SIZE: ::c_ushort = 41; +pub const IFLA_PAD: ::c_ushort = 42; +pub const IFLA_XDP: ::c_ushort = 43; +pub const IFLA_EVENT: ::c_ushort = 44; +pub const IFLA_NEW_NETNSID: ::c_ushort = 45; +pub const IFLA_IF_NETNSID: ::c_ushort = 46; +pub const IFLA_TARGET_NETNSID: ::c_ushort = IFLA_IF_NETNSID; +pub const IFLA_CARRIER_UP_COUNT: ::c_ushort = 47; +pub const IFLA_CARRIER_DOWN_COUNT: ::c_ushort = 48; +pub const IFLA_NEW_IFINDEX: ::c_ushort = 49; +pub const IFLA_MIN_MTU: ::c_ushort = 50; +pub const IFLA_MAX_MTU: ::c_ushort = 51; +pub const IFLA_PROP_LIST: ::c_ushort = 52; +pub const IFLA_ALT_IFNAME: ::c_ushort = 53; +pub const IFLA_PERM_ADDRESS: ::c_ushort = 54; +pub const IFLA_PROTO_DOWN_REASON: ::c_ushort = 55; + +pub const IFLA_INFO_UNSPEC: ::c_ushort = 0; +pub const IFLA_INFO_KIND: ::c_ushort = 1; +pub const IFLA_INFO_DATA: ::c_ushort = 2; +pub const IFLA_INFO_XSTATS: ::c_ushort = 3; +pub const IFLA_INFO_SLAVE_KIND: ::c_ushort = 4; +pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5; + +// linux/if_tun.h +pub const IFF_TUN: ::c_int = 0x0001; +pub const IFF_TAP: ::c_int = 0x0002; +pub const IFF_NO_PI: ::c_int = 0x1000; +// Read queue size +pub const TUN_READQ_SIZE: ::c_short = 500; +// TUN device type flags: deprecated. Use IFF_TUN/IFF_TAP instead. +pub const TUN_TUN_DEV: ::c_short = ::IFF_TUN as ::c_short; +pub const TUN_TAP_DEV: ::c_short = ::IFF_TAP as ::c_short; +pub const TUN_TYPE_MASK: ::c_short = 0x000f; +// This flag has no real effect +pub const IFF_ONE_QUEUE: ::c_int = 0x2000; +pub const IFF_VNET_HDR: ::c_int = 0x4000; +pub const IFF_TUN_EXCL: ::c_int = 0x8000; +pub const IFF_MULTI_QUEUE: ::c_int = 0x0100; +pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200; +pub const IFF_DETACH_QUEUE: ::c_int = 0x0400; +// read-only flag +pub const IFF_PERSIST: ::c_int = 0x0800; +pub const IFF_NOFILTER: ::c_int = 0x1000; + +// Since Linux 3.1 +pub const SEEK_DATA: ::c_int = 3; +pub const SEEK_HOLE: ::c_int = 4; + +pub const ST_RDONLY: ::c_ulong = 1; +pub const ST_NOSUID: ::c_ulong = 2; +pub const ST_NODEV: ::c_ulong = 4; +pub const ST_NOEXEC: ::c_ulong = 8; +pub const ST_SYNCHRONOUS: ::c_ulong = 16; +pub const ST_MANDLOCK: ::c_ulong = 64; +pub const ST_WRITE: ::c_ulong = 128; +pub const ST_APPEND: ::c_ulong = 256; +pub const ST_IMMUTABLE: ::c_ulong = 512; +pub const ST_NOATIME: ::c_ulong = 1024; +pub const ST_NODIRATIME: ::c_ulong = 2048; + +pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void; +pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; +pub const RTLD_NODELETE: ::c_int = 0x1000; +pub const RTLD_NOW: ::c_int = 0x2; + +pub const AT_EACCESS: ::c_int = 0x200; + +// linux/mempolicy.h +pub const MPOL_DEFAULT: ::c_int = 0; +pub const MPOL_PREFERRED: ::c_int = 1; +pub const MPOL_BIND: ::c_int = 2; +pub const MPOL_INTERLEAVE: ::c_int = 3; +pub const MPOL_LOCAL: ::c_int = 4; +pub const MPOL_F_NUMA_BALANCING: ::c_int = 1 << 13; +pub const MPOL_F_RELATIVE_NODES: ::c_int = 1 << 14; +pub const MPOL_F_STATIC_NODES: ::c_int = 1 << 15; + +align_const! { + pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + size: [0; __SIZEOF_PTHREAD_MUTEX_T], + }; + pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + size: [0; __SIZEOF_PTHREAD_COND_T], + }; + pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + size: [0; __SIZEOF_PTHREAD_RWLOCK_T], + }; +} +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; +pub const PTHREAD_MUTEX_STALLED: ::c_int = 0; +pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1; +pub const PTHREAD_PRIO_NONE: ::c_int = 0; +pub const PTHREAD_PRIO_INHERIT: ::c_int = 1; +pub const PTHREAD_PRIO_PROTECT: ::c_int = 2; +pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0; +pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; +pub const __SIZEOF_PTHREAD_COND_T: usize = 48; + +pub const RENAME_NOREPLACE: ::c_uint = 1; +pub const RENAME_EXCHANGE: ::c_uint = 2; +pub const RENAME_WHITEOUT: ::c_uint = 4; + +pub const SCHED_OTHER: ::c_int = 0; +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_RR: ::c_int = 2; +pub const SCHED_BATCH: ::c_int = 3; +pub const SCHED_IDLE: ::c_int = 5; + +pub const SCHED_RESET_ON_FORK: ::c_int = 0x40000000; + +pub const CLONE_PIDFD: ::c_int = 0x1000; + +// netinet/in.h +// NOTE: These are in addition to the constants defined in src/unix/mod.rs + +/// Multipath TCP +pub const IPPROTO_MPTCP: ::c_int = 262; +#[deprecated( + since = "0.2.80", + note = "This value was increased in the newer kernel \ + and we'll change this following upstream in the future release. \ + See #1896 for more info." +)] +pub const IPPROTO_MAX: ::c_int = 256; + +// System V IPC +pub const IPC_PRIVATE: ::key_t = 0; + +pub const IPC_CREAT: ::c_int = 0o1000; +pub const IPC_EXCL: ::c_int = 0o2000; +pub const IPC_NOWAIT: ::c_int = 0o4000; + +pub const IPC_RMID: ::c_int = 0; +pub const IPC_SET: ::c_int = 1; +pub const IPC_STAT: ::c_int = 2; +pub const IPC_INFO: ::c_int = 3; +pub const MSG_STAT: ::c_int = 11; +pub const MSG_INFO: ::c_int = 12; + +pub const MSG_NOERROR: ::c_int = 0o10000; +pub const MSG_EXCEPT: ::c_int = 0o20000; +pub const MSG_ZEROCOPY: ::c_int = 0x4000000; + +pub const SHM_R: ::c_int = 0o400; +pub const SHM_W: ::c_int = 0o200; + +pub const SHM_RDONLY: ::c_int = 0o10000; +pub const SHM_RND: ::c_int = 0o20000; +pub const SHM_REMAP: ::c_int = 0o40000; + +pub const SHM_LOCK: ::c_int = 11; +pub const SHM_UNLOCK: ::c_int = 12; + +pub const SHM_HUGETLB: ::c_int = 0o4000; +#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))] +pub const SHM_NORESERVE: ::c_int = 0o10000; + +pub const QFMT_VFS_OLD: ::c_int = 1; +pub const QFMT_VFS_V0: ::c_int = 2; +pub const QFMT_VFS_V1: ::c_int = 4; + +pub const EFD_SEMAPHORE: ::c_int = 0x1; + +pub const LOG_NFACILITIES: ::c_int = 24; + +pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t; + +pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32; +pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32; +pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32; +pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32; +pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32; +pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32; +pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32; + +pub const AI_PASSIVE: ::c_int = 0x0001; +pub const AI_CANONNAME: ::c_int = 0x0002; +pub const AI_NUMERICHOST: ::c_int = 0x0004; +pub const AI_V4MAPPED: ::c_int = 0x0008; +pub const AI_ALL: ::c_int = 0x0010; +pub const AI_ADDRCONFIG: ::c_int = 0x0020; + +pub const AI_NUMERICSERV: ::c_int = 0x0400; + +pub const EAI_BADFLAGS: ::c_int = -1; +pub const EAI_NONAME: ::c_int = -2; +pub const EAI_AGAIN: ::c_int = -3; +pub const EAI_FAIL: ::c_int = -4; +pub const EAI_NODATA: ::c_int = -5; +pub const EAI_FAMILY: ::c_int = -6; +pub const EAI_SOCKTYPE: ::c_int = -7; +pub const EAI_SERVICE: ::c_int = -8; +pub const EAI_MEMORY: ::c_int = -10; +pub const EAI_SYSTEM: ::c_int = -11; +pub const EAI_OVERFLOW: ::c_int = -12; + +pub const NI_NUMERICHOST: ::c_int = 1; +pub const NI_NUMERICSERV: ::c_int = 2; +pub const NI_NOFQDN: ::c_int = 4; +pub const NI_NAMEREQD: ::c_int = 8; +pub const NI_DGRAM: ::c_int = 16; + +pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1; +pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2; +pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4; + +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + pub const AIO_CANCELED: ::c_int = 0; + pub const AIO_NOTCANCELED: ::c_int = 1; + pub const AIO_ALLDONE: ::c_int = 2; + pub const LIO_READ: ::c_int = 0; + pub const LIO_WRITE: ::c_int = 1; + pub const LIO_NOP: ::c_int = 2; + pub const LIO_WAIT: ::c_int = 0; + pub const LIO_NOWAIT: ::c_int = 1; + pub const RUSAGE_THREAD: ::c_int = 1; + pub const MSG_COPY: ::c_int = 0o40000; + pub const SHM_EXEC: ::c_int = 0o100000; + pub const IPV6_MULTICAST_ALL: ::c_int = 29; + pub const IPV6_ROUTER_ALERT_ISOLATE: ::c_int = 30; + pub const PACKET_MR_UNICAST: ::c_int = 3; + pub const PTRACE_EVENT_STOP: ::c_int = 128; + pub const UDP_SEGMENT: ::c_int = 103; + pub const UDP_GRO: ::c_int = 104; + } +} + +pub const MREMAP_MAYMOVE: ::c_int = 1; +pub const MREMAP_FIXED: ::c_int = 2; +pub const MREMAP_DONTUNMAP: ::c_int = 4; + +pub const PR_SET_PDEATHSIG: ::c_int = 1; +pub const PR_GET_PDEATHSIG: ::c_int = 2; + +pub const PR_GET_DUMPABLE: ::c_int = 3; +pub const PR_SET_DUMPABLE: ::c_int = 4; + +pub const PR_GET_UNALIGN: ::c_int = 5; +pub const PR_SET_UNALIGN: ::c_int = 6; +pub const PR_UNALIGN_NOPRINT: ::c_int = 1; +pub const PR_UNALIGN_SIGBUS: ::c_int = 2; + +pub const PR_GET_KEEPCAPS: ::c_int = 7; +pub const PR_SET_KEEPCAPS: ::c_int = 8; + +pub const PR_GET_FPEMU: ::c_int = 9; +pub const PR_SET_FPEMU: ::c_int = 10; +pub const PR_FPEMU_NOPRINT: ::c_int = 1; +pub const PR_FPEMU_SIGFPE: ::c_int = 2; + +pub const PR_GET_FPEXC: ::c_int = 11; +pub const PR_SET_FPEXC: ::c_int = 12; +pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80; +pub const PR_FP_EXC_DIV: ::c_int = 0x010000; +pub const PR_FP_EXC_OVF: ::c_int = 0x020000; +pub const PR_FP_EXC_UND: ::c_int = 0x040000; +pub const PR_FP_EXC_RES: ::c_int = 0x080000; +pub const PR_FP_EXC_INV: ::c_int = 0x100000; +pub const PR_FP_EXC_DISABLED: ::c_int = 0; +pub const PR_FP_EXC_NONRECOV: ::c_int = 1; +pub const PR_FP_EXC_ASYNC: ::c_int = 2; +pub const PR_FP_EXC_PRECISE: ::c_int = 3; + +pub const PR_GET_TIMING: ::c_int = 13; +pub const PR_SET_TIMING: ::c_int = 14; +pub const PR_TIMING_STATISTICAL: ::c_int = 0; +pub const PR_TIMING_TIMESTAMP: ::c_int = 1; + +pub const PR_SET_NAME: ::c_int = 15; +pub const PR_GET_NAME: ::c_int = 16; + +pub const PR_GET_ENDIAN: ::c_int = 19; +pub const PR_SET_ENDIAN: ::c_int = 20; +pub const PR_ENDIAN_BIG: ::c_int = 0; +pub const PR_ENDIAN_LITTLE: ::c_int = 1; +pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2; + +pub const PR_GET_SECCOMP: ::c_int = 21; +pub const PR_SET_SECCOMP: ::c_int = 22; + +pub const PR_CAPBSET_READ: ::c_int = 23; +pub const PR_CAPBSET_DROP: ::c_int = 24; + +pub const PR_GET_TSC: ::c_int = 25; +pub const PR_SET_TSC: ::c_int = 26; +pub const PR_TSC_ENABLE: ::c_int = 1; +pub const PR_TSC_SIGSEGV: ::c_int = 2; + +pub const PR_GET_SECUREBITS: ::c_int = 27; +pub const PR_SET_SECUREBITS: ::c_int = 28; + +pub const PR_SET_TIMERSLACK: ::c_int = 29; +pub const PR_GET_TIMERSLACK: ::c_int = 30; + +pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31; +pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32; + +pub const PR_MCE_KILL: ::c_int = 33; +pub const PR_MCE_KILL_CLEAR: ::c_int = 0; +pub const PR_MCE_KILL_SET: ::c_int = 1; + +pub const PR_MCE_KILL_LATE: ::c_int = 0; +pub const PR_MCE_KILL_EARLY: ::c_int = 1; +pub const PR_MCE_KILL_DEFAULT: ::c_int = 2; + +pub const PR_MCE_KILL_GET: ::c_int = 34; + +pub const PR_SET_MM: ::c_int = 35; +pub const PR_SET_MM_START_CODE: ::c_int = 1; +pub const PR_SET_MM_END_CODE: ::c_int = 2; +pub const PR_SET_MM_START_DATA: ::c_int = 3; +pub const PR_SET_MM_END_DATA: ::c_int = 4; +pub const PR_SET_MM_START_STACK: ::c_int = 5; +pub const PR_SET_MM_START_BRK: ::c_int = 6; +pub const PR_SET_MM_BRK: ::c_int = 7; +pub const PR_SET_MM_ARG_START: ::c_int = 8; +pub const PR_SET_MM_ARG_END: ::c_int = 9; +pub const PR_SET_MM_ENV_START: ::c_int = 10; +pub const PR_SET_MM_ENV_END: ::c_int = 11; +pub const PR_SET_MM_AUXV: ::c_int = 12; +pub const PR_SET_MM_EXE_FILE: ::c_int = 13; +pub const PR_SET_MM_MAP: ::c_int = 14; +pub const PR_SET_MM_MAP_SIZE: ::c_int = 15; + +pub const PR_SET_PTRACER: ::c_int = 0x59616d61; + +pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36; +pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37; + +pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38; +pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39; + +pub const PR_GET_TID_ADDRESS: ::c_int = 40; + +pub const PR_SET_THP_DISABLE: ::c_int = 41; +pub const PR_GET_THP_DISABLE: ::c_int = 42; + +pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43; +pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44; + +pub const PR_SET_FP_MODE: ::c_int = 45; +pub const PR_GET_FP_MODE: ::c_int = 46; +pub const PR_FP_MODE_FR: ::c_int = 1 << 0; +pub const PR_FP_MODE_FRE: ::c_int = 1 << 1; + +pub const PR_CAP_AMBIENT: ::c_int = 47; +pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1; +pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2; +pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3; +pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4; + +pub const PR_SET_VMA: ::c_int = 0x53564d41; +pub const PR_SET_VMA_ANON_NAME: ::c_int = 0; + +pub const GRND_NONBLOCK: ::c_uint = 0x0001; +pub const GRND_RANDOM: ::c_uint = 0x0002; +pub const GRND_INSECURE: ::c_uint = 0x0004; + +pub const SECCOMP_MODE_DISABLED: ::c_uint = 0; +pub const SECCOMP_MODE_STRICT: ::c_uint = 1; +pub const SECCOMP_MODE_FILTER: ::c_uint = 2; + +pub const SECCOMP_FILTER_FLAG_TSYNC: ::c_ulong = 1; +pub const SECCOMP_FILTER_FLAG_LOG: ::c_ulong = 2; +pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: ::c_ulong = 4; + +pub const SECCOMP_RET_KILL_PROCESS: ::c_uint = 0x80000000; +pub const SECCOMP_RET_KILL_THREAD: ::c_uint = 0x00000000; +pub const SECCOMP_RET_KILL: ::c_uint = SECCOMP_RET_KILL_THREAD; +pub const SECCOMP_RET_TRAP: ::c_uint = 0x00030000; +pub const SECCOMP_RET_ERRNO: ::c_uint = 0x00050000; +pub const SECCOMP_RET_TRACE: ::c_uint = 0x7ff00000; +pub const SECCOMP_RET_LOG: ::c_uint = 0x7ffc0000; +pub const SECCOMP_RET_ALLOW: ::c_uint = 0x7fff0000; + +pub const SECCOMP_RET_ACTION_FULL: ::c_uint = 0xffff0000; +pub const SECCOMP_RET_ACTION: ::c_uint = 0x7fff0000; +pub const SECCOMP_RET_DATA: ::c_uint = 0x0000ffff; + +pub const ITIMER_REAL: ::c_int = 0; +pub const ITIMER_VIRTUAL: ::c_int = 1; +pub const ITIMER_PROF: ::c_int = 2; + +pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC; +pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK; +pub const TFD_TIMER_ABSTIME: ::c_int = 1; +pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 2; + +pub const _POSIX_VDISABLE: ::cc_t = 0; + +pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01; +pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02; +pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08; +pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10; +pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20; +pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40; + +#[deprecated( + since = "0.2.55", + note = "ENOATTR is not available on Linux; use ENODATA instead" +)] +pub const ENOATTR: ::c_int = ::ENODATA; + +pub const SO_ORIGINAL_DST: ::c_int = 80; + +pub const IP_RECVFRAGSIZE: ::c_int = 25; + +pub const IPV6_FLOWINFO: ::c_int = 11; +pub const IPV6_FLOWLABEL_MGR: ::c_int = 32; +pub const IPV6_FLOWINFO_SEND: ::c_int = 33; +pub const IPV6_RECVFRAGSIZE: ::c_int = 77; +pub const IPV6_FREEBIND: ::c_int = 78; +pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff; +pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000; + +pub const IPV6_RTHDR_LOOSE: ::c_int = 0; +pub const IPV6_RTHDR_STRICT: ::c_int = 1; + +// SO_MEMINFO offsets +pub const SK_MEMINFO_RMEM_ALLOC: ::c_int = 0; +pub const SK_MEMINFO_RCVBUF: ::c_int = 1; +pub const SK_MEMINFO_WMEM_ALLOC: ::c_int = 2; +pub const SK_MEMINFO_SNDBUF: ::c_int = 3; +pub const SK_MEMINFO_FWD_ALLOC: ::c_int = 4; +pub const SK_MEMINFO_WMEM_QUEUED: ::c_int = 5; +pub const SK_MEMINFO_OPTMEM: ::c_int = 6; +pub const SK_MEMINFO_BACKLOG: ::c_int = 7; +pub const SK_MEMINFO_DROPS: ::c_int = 8; + +pub const IUTF8: ::tcflag_t = 0x00004000; +#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))] +pub const CMSPAR: ::tcflag_t = 0o10000000000; + +pub const MFD_CLOEXEC: ::c_uint = 0x0001; +pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002; +pub const MFD_HUGETLB: ::c_uint = 0x0004; +pub const MFD_HUGE_64KB: ::c_uint = 0x40000000; +pub const MFD_HUGE_512KB: ::c_uint = 0x4c000000; +pub const MFD_HUGE_1MB: ::c_uint = 0x50000000; +pub const MFD_HUGE_2MB: ::c_uint = 0x54000000; +pub const MFD_HUGE_8MB: ::c_uint = 0x5c000000; +pub const MFD_HUGE_16MB: ::c_uint = 0x60000000; +pub const MFD_HUGE_32MB: ::c_uint = 0x64000000; +pub const MFD_HUGE_256MB: ::c_uint = 0x70000000; +pub const MFD_HUGE_512MB: ::c_uint = 0x74000000; +pub const MFD_HUGE_1GB: ::c_uint = 0x78000000; +pub const MFD_HUGE_2GB: ::c_uint = 0x7c000000; +pub const MFD_HUGE_16GB: ::c_uint = 0x88000000; +pub const MFD_HUGE_MASK: ::c_uint = 63; +pub const MFD_HUGE_SHIFT: ::c_uint = 26; + +// linux/close_range.h +pub const CLOSE_RANGE_UNSHARE: ::c_uint = 1 << 1; +pub const CLOSE_RANGE_CLOEXEC: ::c_uint = 1 << 2; + +// linux/filter.h +pub const SKF_AD_OFF: ::c_int = -0x1000; +pub const SKF_AD_PROTOCOL: ::c_int = 0; +pub const SKF_AD_PKTTYPE: ::c_int = 4; +pub const SKF_AD_IFINDEX: ::c_int = 8; +pub const SKF_AD_NLATTR: ::c_int = 12; +pub const SKF_AD_NLATTR_NEST: ::c_int = 16; +pub const SKF_AD_MARK: ::c_int = 20; +pub const SKF_AD_QUEUE: ::c_int = 24; +pub const SKF_AD_HATYPE: ::c_int = 28; +pub const SKF_AD_RXHASH: ::c_int = 32; +pub const SKF_AD_CPU: ::c_int = 36; +pub const SKF_AD_ALU_XOR_X: ::c_int = 40; +pub const SKF_AD_VLAN_TAG: ::c_int = 44; +pub const SKF_AD_VLAN_TAG_PRESENT: ::c_int = 48; +pub const SKF_AD_PAY_OFFSET: ::c_int = 52; +pub const SKF_AD_RANDOM: ::c_int = 56; +pub const SKF_AD_VLAN_TPID: ::c_int = 60; +pub const SKF_AD_MAX: ::c_int = 64; +pub const SKF_NET_OFF: ::c_int = -0x100000; +pub const SKF_LL_OFF: ::c_int = -0x200000; +pub const BPF_NET_OFF: ::c_int = SKF_NET_OFF; +pub const BPF_LL_OFF: ::c_int = SKF_LL_OFF; +pub const BPF_MEMWORDS: ::c_int = 16; +pub const BPF_MAXINSNS: ::c_int = 4096; + +// linux/bpf_common.h +pub const BPF_LD: ::__u32 = 0x00; +pub const BPF_LDX: ::__u32 = 0x01; +pub const BPF_ST: ::__u32 = 0x02; +pub const BPF_STX: ::__u32 = 0x03; +pub const BPF_ALU: ::__u32 = 0x04; +pub const BPF_JMP: ::__u32 = 0x05; +pub const BPF_RET: ::__u32 = 0x06; +pub const BPF_MISC: ::__u32 = 0x07; +pub const BPF_W: ::__u32 = 0x00; +pub const BPF_H: ::__u32 = 0x08; +pub const BPF_B: ::__u32 = 0x10; +pub const BPF_IMM: ::__u32 = 0x00; +pub const BPF_ABS: ::__u32 = 0x20; +pub const BPF_IND: ::__u32 = 0x40; +pub const BPF_MEM: ::__u32 = 0x60; +pub const BPF_LEN: ::__u32 = 0x80; +pub const BPF_MSH: ::__u32 = 0xa0; +pub const BPF_ADD: ::__u32 = 0x00; +pub const BPF_SUB: ::__u32 = 0x10; +pub const BPF_MUL: ::__u32 = 0x20; +pub const BPF_DIV: ::__u32 = 0x30; +pub const BPF_OR: ::__u32 = 0x40; +pub const BPF_AND: ::__u32 = 0x50; +pub const BPF_LSH: ::__u32 = 0x60; +pub const BPF_RSH: ::__u32 = 0x70; +pub const BPF_NEG: ::__u32 = 0x80; +pub const BPF_MOD: ::__u32 = 0x90; +pub const BPF_XOR: ::__u32 = 0xa0; +pub const BPF_JA: ::__u32 = 0x00; +pub const BPF_JEQ: ::__u32 = 0x10; +pub const BPF_JGT: ::__u32 = 0x20; +pub const BPF_JGE: ::__u32 = 0x30; +pub const BPF_JSET: ::__u32 = 0x40; +pub const BPF_K: ::__u32 = 0x00; +pub const BPF_X: ::__u32 = 0x08; + +// linux/openat2.h +pub const RESOLVE_NO_XDEV: ::__u64 = 0x01; +pub const RESOLVE_NO_MAGICLINKS: ::__u64 = 0x02; +pub const RESOLVE_NO_SYMLINKS: ::__u64 = 0x04; +pub const RESOLVE_BENEATH: ::__u64 = 0x08; +pub const RESOLVE_IN_ROOT: ::__u64 = 0x10; +pub const RESOLVE_CACHED: ::__u64 = 0x20; + +// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has +// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32 +// so we can use that type here to avoid having to cast. +pub const PT_NULL: u32 = 0; +pub const PT_LOAD: u32 = 1; +pub const PT_DYNAMIC: u32 = 2; +pub const PT_INTERP: u32 = 3; +pub const PT_NOTE: u32 = 4; +pub const PT_SHLIB: u32 = 5; +pub const PT_PHDR: u32 = 6; +pub const PT_TLS: u32 = 7; +pub const PT_NUM: u32 = 8; +pub const PT_LOOS: u32 = 0x60000000; +pub const PT_GNU_EH_FRAME: u32 = 0x6474e550; +pub const PT_GNU_STACK: u32 = 0x6474e551; +pub const PT_GNU_RELRO: u32 = 0x6474e552; +pub const PT_HIOS: u32 = 0x6fffffff; +pub const PT_LOPROC: u32 = 0x70000000; +pub const PT_HIPROC: u32 = 0x7fffffff; + +// linux/if_ether.h +pub const ETH_ALEN: ::c_int = 6; +pub const ETH_HLEN: ::c_int = 14; +pub const ETH_ZLEN: ::c_int = 60; +pub const ETH_DATA_LEN: ::c_int = 1500; +pub const ETH_FRAME_LEN: ::c_int = 1514; +pub const ETH_FCS_LEN: ::c_int = 4; + +// These are the defined Ethernet Protocol ID's. +pub const ETH_P_LOOP: ::c_int = 0x0060; +pub const ETH_P_PUP: ::c_int = 0x0200; +pub const ETH_P_PUPAT: ::c_int = 0x0201; +pub const ETH_P_IP: ::c_int = 0x0800; +pub const ETH_P_X25: ::c_int = 0x0805; +pub const ETH_P_ARP: ::c_int = 0x0806; +pub const ETH_P_BPQ: ::c_int = 0x08FF; +pub const ETH_P_IEEEPUP: ::c_int = 0x0a00; +pub const ETH_P_IEEEPUPAT: ::c_int = 0x0a01; +pub const ETH_P_BATMAN: ::c_int = 0x4305; +pub const ETH_P_DEC: ::c_int = 0x6000; +pub const ETH_P_DNA_DL: ::c_int = 0x6001; +pub const ETH_P_DNA_RC: ::c_int = 0x6002; +pub const ETH_P_DNA_RT: ::c_int = 0x6003; +pub const ETH_P_LAT: ::c_int = 0x6004; +pub const ETH_P_DIAG: ::c_int = 0x6005; +pub const ETH_P_CUST: ::c_int = 0x6006; +pub const ETH_P_SCA: ::c_int = 0x6007; +pub const ETH_P_TEB: ::c_int = 0x6558; +pub const ETH_P_RARP: ::c_int = 0x8035; +pub const ETH_P_ATALK: ::c_int = 0x809B; +pub const ETH_P_AARP: ::c_int = 0x80F3; +pub const ETH_P_8021Q: ::c_int = 0x8100; +pub const ETH_P_IPX: ::c_int = 0x8137; +pub const ETH_P_IPV6: ::c_int = 0x86DD; +pub const ETH_P_PAUSE: ::c_int = 0x8808; +pub const ETH_P_SLOW: ::c_int = 0x8809; +pub const ETH_P_WCCP: ::c_int = 0x883E; +pub const ETH_P_MPLS_UC: ::c_int = 0x8847; +pub const ETH_P_MPLS_MC: ::c_int = 0x8848; +pub const ETH_P_ATMMPOA: ::c_int = 0x884c; +pub const ETH_P_PPP_DISC: ::c_int = 0x8863; +pub const ETH_P_PPP_SES: ::c_int = 0x8864; +pub const ETH_P_LINK_CTL: ::c_int = 0x886c; +pub const ETH_P_ATMFATE: ::c_int = 0x8884; +pub const ETH_P_PAE: ::c_int = 0x888E; +pub const ETH_P_AOE: ::c_int = 0x88A2; +pub const ETH_P_8021AD: ::c_int = 0x88A8; +pub const ETH_P_802_EX1: ::c_int = 0x88B5; +pub const ETH_P_TIPC: ::c_int = 0x88CA; +pub const ETH_P_MACSEC: ::c_int = 0x88E5; +pub const ETH_P_8021AH: ::c_int = 0x88E7; +pub const ETH_P_MVRP: ::c_int = 0x88F5; +pub const ETH_P_1588: ::c_int = 0x88F7; +pub const ETH_P_PRP: ::c_int = 0x88FB; +pub const ETH_P_FCOE: ::c_int = 0x8906; +pub const ETH_P_TDLS: ::c_int = 0x890D; +pub const ETH_P_FIP: ::c_int = 0x8914; +pub const ETH_P_80221: ::c_int = 0x8917; +pub const ETH_P_LOOPBACK: ::c_int = 0x9000; +pub const ETH_P_QINQ1: ::c_int = 0x9100; +pub const ETH_P_QINQ2: ::c_int = 0x9200; +pub const ETH_P_QINQ3: ::c_int = 0x9300; +pub const ETH_P_EDSA: ::c_int = 0xDADA; +pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB; + +pub const ETH_P_802_3_MIN: ::c_int = 0x0600; + +// Non DIX types. Won't clash for 1500 types. +pub const ETH_P_802_3: ::c_int = 0x0001; +pub const ETH_P_AX25: ::c_int = 0x0002; +pub const ETH_P_ALL: ::c_int = 0x0003; +pub const ETH_P_802_2: ::c_int = 0x0004; +pub const ETH_P_SNAP: ::c_int = 0x0005; +pub const ETH_P_DDCMP: ::c_int = 0x0006; +pub const ETH_P_WAN_PPP: ::c_int = 0x0007; +pub const ETH_P_PPP_MP: ::c_int = 0x0008; +pub const ETH_P_LOCALTALK: ::c_int = 0x0009; +pub const ETH_P_CANFD: ::c_int = 0x000D; +pub const ETH_P_PPPTALK: ::c_int = 0x0010; +pub const ETH_P_TR_802_2: ::c_int = 0x0011; +pub const ETH_P_MOBITEX: ::c_int = 0x0015; +pub const ETH_P_CONTROL: ::c_int = 0x0016; +pub const ETH_P_IRDA: ::c_int = 0x0017; +pub const ETH_P_ECONET: ::c_int = 0x0018; +pub const ETH_P_HDLC: ::c_int = 0x0019; +pub const ETH_P_ARCNET: ::c_int = 0x001A; +pub const ETH_P_DSA: ::c_int = 0x001B; +pub const ETH_P_TRAILER: ::c_int = 0x001C; +pub const ETH_P_PHONET: ::c_int = 0x00F5; +pub const ETH_P_IEEE802154: ::c_int = 0x00F6; +pub const ETH_P_CAIF: ::c_int = 0x00F7; + +pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; +pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; +pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04; +pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08; +pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x10; +pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x20; + +pub const NLMSG_NOOP: ::c_int = 0x1; +pub const NLMSG_ERROR: ::c_int = 0x2; +pub const NLMSG_DONE: ::c_int = 0x3; +pub const NLMSG_OVERRUN: ::c_int = 0x4; +pub const NLMSG_MIN_TYPE: ::c_int = 0x10; + +// linux/netfilter/nfnetlink.h +pub const NFNLGRP_NONE: ::c_int = 0; +pub const NFNLGRP_CONNTRACK_NEW: ::c_int = 1; +pub const NFNLGRP_CONNTRACK_UPDATE: ::c_int = 2; +pub const NFNLGRP_CONNTRACK_DESTROY: ::c_int = 3; +pub const NFNLGRP_CONNTRACK_EXP_NEW: ::c_int = 4; +pub const NFNLGRP_CONNTRACK_EXP_UPDATE: ::c_int = 5; +pub const NFNLGRP_CONNTRACK_EXP_DESTROY: ::c_int = 6; +pub const NFNLGRP_NFTABLES: ::c_int = 7; +pub const NFNLGRP_ACCT_QUOTA: ::c_int = 8; + +pub const NFNETLINK_V0: ::c_int = 0; + +pub const NFNL_SUBSYS_NONE: ::c_int = 0; +pub const NFNL_SUBSYS_CTNETLINK: ::c_int = 1; +pub const NFNL_SUBSYS_CTNETLINK_EXP: ::c_int = 2; +pub const NFNL_SUBSYS_QUEUE: ::c_int = 3; +pub const NFNL_SUBSYS_ULOG: ::c_int = 4; +pub const NFNL_SUBSYS_OSF: ::c_int = 5; +pub const NFNL_SUBSYS_IPSET: ::c_int = 6; +pub const NFNL_SUBSYS_ACCT: ::c_int = 7; +pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: ::c_int = 8; +pub const NFNL_SUBSYS_CTHELPER: ::c_int = 9; +pub const NFNL_SUBSYS_NFTABLES: ::c_int = 10; +pub const NFNL_SUBSYS_NFT_COMPAT: ::c_int = 11; +pub const NFNL_SUBSYS_COUNT: ::c_int = 12; + +pub const NFNL_MSG_BATCH_BEGIN: ::c_int = NLMSG_MIN_TYPE; +pub const NFNL_MSG_BATCH_END: ::c_int = NLMSG_MIN_TYPE + 1; + +// linux/netfilter/nfnetlink_log.h +pub const NFULNL_MSG_PACKET: ::c_int = 0; +pub const NFULNL_MSG_CONFIG: ::c_int = 1; + +pub const NFULA_UNSPEC: ::c_int = 0; +pub const NFULA_PACKET_HDR: ::c_int = 1; +pub const NFULA_MARK: ::c_int = 2; +pub const NFULA_TIMESTAMP: ::c_int = 3; +pub const NFULA_IFINDEX_INDEV: ::c_int = 4; +pub const NFULA_IFINDEX_OUTDEV: ::c_int = 5; +pub const NFULA_IFINDEX_PHYSINDEV: ::c_int = 6; +pub const NFULA_IFINDEX_PHYSOUTDEV: ::c_int = 7; +pub const NFULA_HWADDR: ::c_int = 8; +pub const NFULA_PAYLOAD: ::c_int = 9; +pub const NFULA_PREFIX: ::c_int = 10; +pub const NFULA_UID: ::c_int = 11; +pub const NFULA_SEQ: ::c_int = 12; +pub const NFULA_SEQ_GLOBAL: ::c_int = 13; +pub const NFULA_GID: ::c_int = 14; +pub const NFULA_HWTYPE: ::c_int = 15; +pub const NFULA_HWHEADER: ::c_int = 16; +pub const NFULA_HWLEN: ::c_int = 17; +pub const NFULA_CT: ::c_int = 18; +pub const NFULA_CT_INFO: ::c_int = 19; + +pub const NFULNL_CFG_CMD_NONE: ::c_int = 0; +pub const NFULNL_CFG_CMD_BIND: ::c_int = 1; +pub const NFULNL_CFG_CMD_UNBIND: ::c_int = 2; +pub const NFULNL_CFG_CMD_PF_BIND: ::c_int = 3; +pub const NFULNL_CFG_CMD_PF_UNBIND: ::c_int = 4; + +pub const NFULA_CFG_UNSPEC: ::c_int = 0; +pub const NFULA_CFG_CMD: ::c_int = 1; +pub const NFULA_CFG_MODE: ::c_int = 2; +pub const NFULA_CFG_NLBUFSIZ: ::c_int = 3; +pub const NFULA_CFG_TIMEOUT: ::c_int = 4; +pub const NFULA_CFG_QTHRESH: ::c_int = 5; +pub const NFULA_CFG_FLAGS: ::c_int = 6; + +pub const NFULNL_COPY_NONE: ::c_int = 0x00; +pub const NFULNL_COPY_META: ::c_int = 0x01; +pub const NFULNL_COPY_PACKET: ::c_int = 0x02; + +pub const NFULNL_CFG_F_SEQ: ::c_int = 0x0001; +pub const NFULNL_CFG_F_SEQ_GLOBAL: ::c_int = 0x0002; +pub const NFULNL_CFG_F_CONNTRACK: ::c_int = 0x0004; + +// linux/netfilter/nfnetlink_log.h +pub const NFQNL_MSG_PACKET: ::c_int = 0; +pub const NFQNL_MSG_VERDICT: ::c_int = 1; +pub const NFQNL_MSG_CONFIG: ::c_int = 2; +pub const NFQNL_MSG_VERDICT_BATCH: ::c_int = 3; + +pub const NFQA_UNSPEC: ::c_int = 0; +pub const NFQA_PACKET_HDR: ::c_int = 1; +pub const NFQA_VERDICT_HDR: ::c_int = 2; +pub const NFQA_MARK: ::c_int = 3; +pub const NFQA_TIMESTAMP: ::c_int = 4; +pub const NFQA_IFINDEX_INDEV: ::c_int = 5; +pub const NFQA_IFINDEX_OUTDEV: ::c_int = 6; +pub const NFQA_IFINDEX_PHYSINDEV: ::c_int = 7; +pub const NFQA_IFINDEX_PHYSOUTDEV: ::c_int = 8; +pub const NFQA_HWADDR: ::c_int = 9; +pub const NFQA_PAYLOAD: ::c_int = 10; +pub const NFQA_CT: ::c_int = 11; +pub const NFQA_CT_INFO: ::c_int = 12; +pub const NFQA_CAP_LEN: ::c_int = 13; +pub const NFQA_SKB_INFO: ::c_int = 14; +pub const NFQA_EXP: ::c_int = 15; +pub const NFQA_UID: ::c_int = 16; +pub const NFQA_GID: ::c_int = 17; +pub const NFQA_SECCTX: ::c_int = 18; +/* + FIXME: These are not yet available in musl sanitized kernel headers and + make the tests fail. Enable them once musl has them. + + See https://github.com/rust-lang/libc/pull/1628 for more details. +pub const NFQA_VLAN: ::c_int = 19; +pub const NFQA_L2HDR: ::c_int = 20; + +pub const NFQA_VLAN_UNSPEC: ::c_int = 0; +pub const NFQA_VLAN_PROTO: ::c_int = 1; +pub const NFQA_VLAN_TCI: ::c_int = 2; +*/ + +pub const NFQNL_CFG_CMD_NONE: ::c_int = 0; +pub const NFQNL_CFG_CMD_BIND: ::c_int = 1; +pub const NFQNL_CFG_CMD_UNBIND: ::c_int = 2; +pub const NFQNL_CFG_CMD_PF_BIND: ::c_int = 3; +pub const NFQNL_CFG_CMD_PF_UNBIND: ::c_int = 4; + +pub const NFQNL_COPY_NONE: ::c_int = 0; +pub const NFQNL_COPY_META: ::c_int = 1; +pub const NFQNL_COPY_PACKET: ::c_int = 2; + +pub const NFQA_CFG_UNSPEC: ::c_int = 0; +pub const NFQA_CFG_CMD: ::c_int = 1; +pub const NFQA_CFG_PARAMS: ::c_int = 2; +pub const NFQA_CFG_QUEUE_MAXLEN: ::c_int = 3; +pub const NFQA_CFG_MASK: ::c_int = 4; +pub const NFQA_CFG_FLAGS: ::c_int = 5; + +pub const NFQA_CFG_F_FAIL_OPEN: ::c_int = 0x0001; +pub const NFQA_CFG_F_CONNTRACK: ::c_int = 0x0002; +pub const NFQA_CFG_F_GSO: ::c_int = 0x0004; +pub const NFQA_CFG_F_UID_GID: ::c_int = 0x0008; +pub const NFQA_CFG_F_SECCTX: ::c_int = 0x0010; +pub const NFQA_CFG_F_MAX: ::c_int = 0x0020; + +pub const NFQA_SKB_CSUMNOTREADY: ::c_int = 0x0001; +pub const NFQA_SKB_GSO: ::c_int = 0x0002; +pub const NFQA_SKB_CSUM_NOTVERIFIED: ::c_int = 0x0004; + +pub const GENL_NAMSIZ: ::c_int = 16; + +pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE; +pub const GENL_MAX_ID: ::c_int = 1023; + +pub const GENL_ADMIN_PERM: ::c_int = 0x01; +pub const GENL_CMD_CAP_DO: ::c_int = 0x02; +pub const GENL_CMD_CAP_DUMP: ::c_int = 0x04; +pub const GENL_CMD_CAP_HASPOL: ::c_int = 0x08; + +pub const GENL_ID_CTRL: ::c_int = NLMSG_MIN_TYPE; + +pub const CTRL_CMD_UNSPEC: ::c_int = 0; +pub const CTRL_CMD_NEWFAMILY: ::c_int = 1; +pub const CTRL_CMD_DELFAMILY: ::c_int = 2; +pub const CTRL_CMD_GETFAMILY: ::c_int = 3; +pub const CTRL_CMD_NEWOPS: ::c_int = 4; +pub const CTRL_CMD_DELOPS: ::c_int = 5; +pub const CTRL_CMD_GETOPS: ::c_int = 6; +pub const CTRL_CMD_NEWMCAST_GRP: ::c_int = 7; +pub const CTRL_CMD_DELMCAST_GRP: ::c_int = 8; +pub const CTRL_CMD_GETMCAST_GRP: ::c_int = 9; + +pub const CTRL_ATTR_UNSPEC: ::c_int = 0; +pub const CTRL_ATTR_FAMILY_ID: ::c_int = 1; +pub const CTRL_ATTR_FAMILY_NAME: ::c_int = 2; +pub const CTRL_ATTR_VERSION: ::c_int = 3; +pub const CTRL_ATTR_HDRSIZE: ::c_int = 4; +pub const CTRL_ATTR_MAXATTR: ::c_int = 5; +pub const CTRL_ATTR_OPS: ::c_int = 6; +pub const CTRL_ATTR_MCAST_GROUPS: ::c_int = 7; + +pub const CTRL_ATTR_OP_UNSPEC: ::c_int = 0; +pub const CTRL_ATTR_OP_ID: ::c_int = 1; +pub const CTRL_ATTR_OP_FLAGS: ::c_int = 2; + +pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0; +pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1; +pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2; + +// linux/if_packet.h +pub const PACKET_ADD_MEMBERSHIP: ::c_int = 1; +pub const PACKET_DROP_MEMBERSHIP: ::c_int = 2; + +pub const PACKET_MR_MULTICAST: ::c_int = 0; +pub const PACKET_MR_PROMISC: ::c_int = 1; +pub const PACKET_MR_ALLMULTI: ::c_int = 2; + +// linux/netfilter.h +pub const NF_DROP: ::c_int = 0; +pub const NF_ACCEPT: ::c_int = 1; +pub const NF_STOLEN: ::c_int = 2; +pub const NF_QUEUE: ::c_int = 3; +pub const NF_REPEAT: ::c_int = 4; +pub const NF_STOP: ::c_int = 5; +pub const NF_MAX_VERDICT: ::c_int = NF_STOP; + +pub const NF_VERDICT_MASK: ::c_int = 0x000000ff; +pub const NF_VERDICT_FLAG_QUEUE_BYPASS: ::c_int = 0x00008000; + +pub const NF_VERDICT_QMASK: ::c_int = 0xffff0000; +pub const NF_VERDICT_QBITS: ::c_int = 16; + +pub const NF_VERDICT_BITS: ::c_int = 16; + +pub const NF_INET_PRE_ROUTING: ::c_int = 0; +pub const NF_INET_LOCAL_IN: ::c_int = 1; +pub const NF_INET_FORWARD: ::c_int = 2; +pub const NF_INET_LOCAL_OUT: ::c_int = 3; +pub const NF_INET_POST_ROUTING: ::c_int = 4; +pub const NF_INET_NUMHOOKS: ::c_int = 5; + +// Some NFPROTO are not compatible with musl and are defined in submodules. +pub const NFPROTO_UNSPEC: ::c_int = 0; +pub const NFPROTO_IPV4: ::c_int = 2; +pub const NFPROTO_ARP: ::c_int = 3; +pub const NFPROTO_BRIDGE: ::c_int = 7; +pub const NFPROTO_IPV6: ::c_int = 10; +pub const NFPROTO_DECNET: ::c_int = 12; +pub const NFPROTO_NUMPROTO: ::c_int = 13; +pub const NFPROTO_INET: ::c_int = 1; +pub const NFPROTO_NETDEV: ::c_int = 5; + +pub const NF_NETDEV_INGRESS: ::c_int = 0; +pub const NF_NETDEV_NUMHOOKS: ::c_int = 1; + +// linux/netfilter_ipv4.h +pub const NF_IP_PRE_ROUTING: ::c_int = 0; +pub const NF_IP_LOCAL_IN: ::c_int = 1; +pub const NF_IP_FORWARD: ::c_int = 2; +pub const NF_IP_LOCAL_OUT: ::c_int = 3; +pub const NF_IP_POST_ROUTING: ::c_int = 4; +pub const NF_IP_NUMHOOKS: ::c_int = 5; + +pub const NF_IP_PRI_FIRST: ::c_int = ::INT_MIN; +pub const NF_IP_PRI_CONNTRACK_DEFRAG: ::c_int = -400; +pub const NF_IP_PRI_RAW: ::c_int = -300; +pub const NF_IP_PRI_SELINUX_FIRST: ::c_int = -225; +pub const NF_IP_PRI_CONNTRACK: ::c_int = -200; +pub const NF_IP_PRI_MANGLE: ::c_int = -150; +pub const NF_IP_PRI_NAT_DST: ::c_int = -100; +pub const NF_IP_PRI_FILTER: ::c_int = 0; +pub const NF_IP_PRI_SECURITY: ::c_int = 50; +pub const NF_IP_PRI_NAT_SRC: ::c_int = 100; +pub const NF_IP_PRI_SELINUX_LAST: ::c_int = 225; +pub const NF_IP_PRI_CONNTRACK_HELPER: ::c_int = 300; +pub const NF_IP_PRI_CONNTRACK_CONFIRM: ::c_int = ::INT_MAX; +pub const NF_IP_PRI_LAST: ::c_int = ::INT_MAX; + +// linux/netfilter_ipv6.h +pub const NF_IP6_PRE_ROUTING: ::c_int = 0; +pub const NF_IP6_LOCAL_IN: ::c_int = 1; +pub const NF_IP6_FORWARD: ::c_int = 2; +pub const NF_IP6_LOCAL_OUT: ::c_int = 3; +pub const NF_IP6_POST_ROUTING: ::c_int = 4; +pub const NF_IP6_NUMHOOKS: ::c_int = 5; + +pub const NF_IP6_PRI_FIRST: ::c_int = ::INT_MIN; +pub const NF_IP6_PRI_CONNTRACK_DEFRAG: ::c_int = -400; +pub const NF_IP6_PRI_RAW: ::c_int = -300; +pub const NF_IP6_PRI_SELINUX_FIRST: ::c_int = -225; +pub const NF_IP6_PRI_CONNTRACK: ::c_int = -200; +pub const NF_IP6_PRI_MANGLE: ::c_int = -150; +pub const NF_IP6_PRI_NAT_DST: ::c_int = -100; +pub const NF_IP6_PRI_FILTER: ::c_int = 0; +pub const NF_IP6_PRI_SECURITY: ::c_int = 50; +pub const NF_IP6_PRI_NAT_SRC: ::c_int = 100; +pub const NF_IP6_PRI_SELINUX_LAST: ::c_int = 225; +pub const NF_IP6_PRI_CONNTRACK_HELPER: ::c_int = 300; +pub const NF_IP6_PRI_LAST: ::c_int = ::INT_MAX; + +// linux/netfilter_ipv6/ip6_tables.h +pub const IP6T_SO_ORIGINAL_DST: ::c_int = 80; + +pub const SIOCADDRT: ::c_ulong = 0x0000890B; +pub const SIOCDELRT: ::c_ulong = 0x0000890C; +pub const SIOCGIFNAME: ::c_ulong = 0x00008910; +pub const SIOCSIFLINK: ::c_ulong = 0x00008911; +pub const SIOCGIFCONF: ::c_ulong = 0x00008912; +pub const SIOCGIFFLAGS: ::c_ulong = 0x00008913; +pub const SIOCSIFFLAGS: ::c_ulong = 0x00008914; +pub const SIOCGIFADDR: ::c_ulong = 0x00008915; +pub const SIOCSIFADDR: ::c_ulong = 0x00008916; +pub const SIOCGIFDSTADDR: ::c_ulong = 0x00008917; +pub const SIOCSIFDSTADDR: ::c_ulong = 0x00008918; +pub const SIOCGIFBRDADDR: ::c_ulong = 0x00008919; +pub const SIOCSIFBRDADDR: ::c_ulong = 0x0000891A; +pub const SIOCGIFNETMASK: ::c_ulong = 0x0000891B; +pub const SIOCSIFNETMASK: ::c_ulong = 0x0000891C; +pub const SIOCGIFMETRIC: ::c_ulong = 0x0000891D; +pub const SIOCSIFMETRIC: ::c_ulong = 0x0000891E; +pub const SIOCGIFMEM: ::c_ulong = 0x0000891F; +pub const SIOCSIFMEM: ::c_ulong = 0x00008920; +pub const SIOCGIFMTU: ::c_ulong = 0x00008921; +pub const SIOCSIFMTU: ::c_ulong = 0x00008922; +pub const SIOCSIFHWADDR: ::c_ulong = 0x00008924; +pub const SIOCGIFENCAP: ::c_ulong = 0x00008925; +pub const SIOCSIFENCAP: ::c_ulong = 0x00008926; +pub const SIOCGIFHWADDR: ::c_ulong = 0x00008927; +pub const SIOCGIFSLAVE: ::c_ulong = 0x00008929; +pub const SIOCSIFSLAVE: ::c_ulong = 0x00008930; +pub const SIOCADDMULTI: ::c_ulong = 0x00008931; +pub const SIOCDELMULTI: ::c_ulong = 0x00008932; +pub const SIOCDARP: ::c_ulong = 0x00008953; +pub const SIOCGARP: ::c_ulong = 0x00008954; +pub const SIOCSARP: ::c_ulong = 0x00008955; +pub const SIOCDRARP: ::c_ulong = 0x00008960; +pub const SIOCGRARP: ::c_ulong = 0x00008961; +pub const SIOCSRARP: ::c_ulong = 0x00008962; +pub const SIOCGIFMAP: ::c_ulong = 0x00008970; +pub const SIOCSIFMAP: ::c_ulong = 0x00008971; + +pub const IPTOS_TOS_MASK: u8 = 0x1E; +pub const IPTOS_PREC_MASK: u8 = 0xE0; + +pub const IPTOS_ECN_NOT_ECT: u8 = 0x00; + +pub const RTF_UP: ::c_ushort = 0x0001; +pub const RTF_GATEWAY: ::c_ushort = 0x0002; + +pub const RTF_HOST: ::c_ushort = 0x0004; +pub const RTF_REINSTATE: ::c_ushort = 0x0008; +pub const RTF_DYNAMIC: ::c_ushort = 0x0010; +pub const RTF_MODIFIED: ::c_ushort = 0x0020; +pub const RTF_MTU: ::c_ushort = 0x0040; +pub const RTF_MSS: ::c_ushort = RTF_MTU; +pub const RTF_WINDOW: ::c_ushort = 0x0080; +pub const RTF_IRTT: ::c_ushort = 0x0100; +pub const RTF_REJECT: ::c_ushort = 0x0200; +pub const RTF_STATIC: ::c_ushort = 0x0400; +pub const RTF_XRESOLVE: ::c_ushort = 0x0800; +pub const RTF_NOFORWARD: ::c_ushort = 0x1000; +pub const RTF_THROW: ::c_ushort = 0x2000; +pub const RTF_NOPMTUDISC: ::c_ushort = 0x4000; + +pub const RTF_DEFAULT: u32 = 0x00010000; +pub const RTF_ALLONLINK: u32 = 0x00020000; +pub const RTF_ADDRCONF: u32 = 0x00040000; +pub const RTF_LINKRT: u32 = 0x00100000; +pub const RTF_NONEXTHOP: u32 = 0x00200000; +pub const RTF_CACHE: u32 = 0x01000000; +pub const RTF_FLOW: u32 = 0x02000000; +pub const RTF_POLICY: u32 = 0x04000000; + +pub const RTCF_VALVE: u32 = 0x00200000; +pub const RTCF_MASQ: u32 = 0x00400000; +pub const RTCF_NAT: u32 = 0x00800000; +pub const RTCF_DOREDIRECT: u32 = 0x01000000; +pub const RTCF_LOG: u32 = 0x02000000; +pub const RTCF_DIRECTSRC: u32 = 0x04000000; + +pub const RTF_LOCAL: u32 = 0x80000000; +pub const RTF_INTERFACE: u32 = 0x40000000; +pub const RTF_MULTICAST: u32 = 0x20000000; +pub const RTF_BROADCAST: u32 = 0x10000000; +pub const RTF_NAT: u32 = 0x08000000; +pub const RTF_ADDRCLASSMASK: u32 = 0xF8000000; + +pub const RT_CLASS_UNSPEC: u8 = 0; +pub const RT_CLASS_DEFAULT: u8 = 253; +pub const RT_CLASS_MAIN: u8 = 254; +pub const RT_CLASS_LOCAL: u8 = 255; +pub const RT_CLASS_MAX: u8 = 255; + +// linux/neighbor.h +pub const NUD_NONE: u16 = 0x00; +pub const NUD_INCOMPLETE: u16 = 0x01; +pub const NUD_REACHABLE: u16 = 0x02; +pub const NUD_STALE: u16 = 0x04; +pub const NUD_DELAY: u16 = 0x08; +pub const NUD_PROBE: u16 = 0x10; +pub const NUD_FAILED: u16 = 0x20; +pub const NUD_NOARP: u16 = 0x40; +pub const NUD_PERMANENT: u16 = 0x80; + +pub const NTF_USE: u8 = 0x01; +pub const NTF_SELF: u8 = 0x02; +pub const NTF_MASTER: u8 = 0x04; +pub const NTF_PROXY: u8 = 0x08; +pub const NTF_ROUTER: u8 = 0x80; + +pub const NDA_UNSPEC: ::c_ushort = 0; +pub const NDA_DST: ::c_ushort = 1; +pub const NDA_LLADDR: ::c_ushort = 2; +pub const NDA_CACHEINFO: ::c_ushort = 3; +pub const NDA_PROBES: ::c_ushort = 4; +pub const NDA_VLAN: ::c_ushort = 5; +pub const NDA_PORT: ::c_ushort = 6; +pub const NDA_VNI: ::c_ushort = 7; +pub const NDA_IFINDEX: ::c_ushort = 8; + +// linux/netlink.h +pub const NLA_ALIGNTO: ::c_int = 4; + +pub const NETLINK_ROUTE: ::c_int = 0; +pub const NETLINK_UNUSED: ::c_int = 1; +pub const NETLINK_USERSOCK: ::c_int = 2; +pub const NETLINK_FIREWALL: ::c_int = 3; +pub const NETLINK_SOCK_DIAG: ::c_int = 4; +pub const NETLINK_NFLOG: ::c_int = 5; +pub const NETLINK_XFRM: ::c_int = 6; +pub const NETLINK_SELINUX: ::c_int = 7; +pub const NETLINK_ISCSI: ::c_int = 8; +pub const NETLINK_AUDIT: ::c_int = 9; +pub const NETLINK_FIB_LOOKUP: ::c_int = 10; +pub const NETLINK_CONNECTOR: ::c_int = 11; +pub const NETLINK_NETFILTER: ::c_int = 12; +pub const NETLINK_IP6_FW: ::c_int = 13; +pub const NETLINK_DNRTMSG: ::c_int = 14; +pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15; +pub const NETLINK_GENERIC: ::c_int = 16; +pub const NETLINK_SCSITRANSPORT: ::c_int = 18; +pub const NETLINK_ECRYPTFS: ::c_int = 19; +pub const NETLINK_RDMA: ::c_int = 20; +pub const NETLINK_CRYPTO: ::c_int = 21; +pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG; + +pub const NLM_F_REQUEST: ::c_int = 1; +pub const NLM_F_MULTI: ::c_int = 2; +pub const NLM_F_ACK: ::c_int = 4; +pub const NLM_F_ECHO: ::c_int = 8; +pub const NLM_F_DUMP_INTR: ::c_int = 16; +pub const NLM_F_DUMP_FILTERED: ::c_int = 32; + +pub const NLM_F_ROOT: ::c_int = 0x100; +pub const NLM_F_MATCH: ::c_int = 0x200; +pub const NLM_F_ATOMIC: ::c_int = 0x400; +pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH; + +pub const NLM_F_REPLACE: ::c_int = 0x100; +pub const NLM_F_EXCL: ::c_int = 0x200; +pub const NLM_F_CREATE: ::c_int = 0x400; +pub const NLM_F_APPEND: ::c_int = 0x800; + +pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1; +pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2; +pub const NETLINK_PKTINFO: ::c_int = 3; +pub const NETLINK_BROADCAST_ERROR: ::c_int = 4; +pub const NETLINK_NO_ENOBUFS: ::c_int = 5; +pub const NETLINK_RX_RING: ::c_int = 6; +pub const NETLINK_TX_RING: ::c_int = 7; +pub const NETLINK_LISTEN_ALL_NSID: ::c_int = 8; +pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9; +pub const NETLINK_CAP_ACK: ::c_int = 10; +pub const NETLINK_EXT_ACK: ::c_int = 11; +pub const NETLINK_GET_STRICT_CHK: ::c_int = 12; + +pub const NLA_F_NESTED: ::c_int = 1 << 15; +pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14; +pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER); + +// linux/rtnetlink.h +pub const TCA_UNSPEC: ::c_ushort = 0; +pub const TCA_KIND: ::c_ushort = 1; +pub const TCA_OPTIONS: ::c_ushort = 2; +pub const TCA_STATS: ::c_ushort = 3; +pub const TCA_XSTATS: ::c_ushort = 4; +pub const TCA_RATE: ::c_ushort = 5; +pub const TCA_FCNT: ::c_ushort = 6; +pub const TCA_STATS2: ::c_ushort = 7; +pub const TCA_STAB: ::c_ushort = 8; + +pub const RTM_NEWLINK: u16 = 16; +pub const RTM_DELLINK: u16 = 17; +pub const RTM_GETLINK: u16 = 18; +pub const RTM_SETLINK: u16 = 19; +pub const RTM_NEWADDR: u16 = 20; +pub const RTM_DELADDR: u16 = 21; +pub const RTM_GETADDR: u16 = 22; +pub const RTM_NEWROUTE: u16 = 24; +pub const RTM_DELROUTE: u16 = 25; +pub const RTM_GETROUTE: u16 = 26; +pub const RTM_NEWNEIGH: u16 = 28; +pub const RTM_DELNEIGH: u16 = 29; +pub const RTM_GETNEIGH: u16 = 30; +pub const RTM_NEWRULE: u16 = 32; +pub const RTM_DELRULE: u16 = 33; +pub const RTM_GETRULE: u16 = 34; +pub const RTM_NEWQDISC: u16 = 36; +pub const RTM_DELQDISC: u16 = 37; +pub const RTM_GETQDISC: u16 = 38; +pub const RTM_NEWTCLASS: u16 = 40; +pub const RTM_DELTCLASS: u16 = 41; +pub const RTM_GETTCLASS: u16 = 42; +pub const RTM_NEWTFILTER: u16 = 44; +pub const RTM_DELTFILTER: u16 = 45; +pub const RTM_GETTFILTER: u16 = 46; +pub const RTM_NEWACTION: u16 = 48; +pub const RTM_DELACTION: u16 = 49; +pub const RTM_GETACTION: u16 = 50; +pub const RTM_NEWPREFIX: u16 = 52; +pub const RTM_GETMULTICAST: u16 = 58; +pub const RTM_GETANYCAST: u16 = 62; +pub const RTM_NEWNEIGHTBL: u16 = 64; +pub const RTM_GETNEIGHTBL: u16 = 66; +pub const RTM_SETNEIGHTBL: u16 = 67; +pub const RTM_NEWNDUSEROPT: u16 = 68; +pub const RTM_NEWADDRLABEL: u16 = 72; +pub const RTM_DELADDRLABEL: u16 = 73; +pub const RTM_GETADDRLABEL: u16 = 74; +pub const RTM_GETDCB: u16 = 78; +pub const RTM_SETDCB: u16 = 79; +pub const RTM_NEWNETCONF: u16 = 80; +pub const RTM_GETNETCONF: u16 = 82; +pub const RTM_NEWMDB: u16 = 84; +pub const RTM_DELMDB: u16 = 85; +pub const RTM_GETMDB: u16 = 86; +pub const RTM_NEWNSID: u16 = 88; +pub const RTM_DELNSID: u16 = 89; +pub const RTM_GETNSID: u16 = 90; + +pub const RTM_F_NOTIFY: ::c_uint = 0x100; +pub const RTM_F_CLONED: ::c_uint = 0x200; +pub const RTM_F_EQUALIZE: ::c_uint = 0x400; +pub const RTM_F_PREFIX: ::c_uint = 0x800; + +pub const RTA_UNSPEC: ::c_ushort = 0; +pub const RTA_DST: ::c_ushort = 1; +pub const RTA_SRC: ::c_ushort = 2; +pub const RTA_IIF: ::c_ushort = 3; +pub const RTA_OIF: ::c_ushort = 4; +pub const RTA_GATEWAY: ::c_ushort = 5; +pub const RTA_PRIORITY: ::c_ushort = 6; +pub const RTA_PREFSRC: ::c_ushort = 7; +pub const RTA_METRICS: ::c_ushort = 8; +pub const RTA_MULTIPATH: ::c_ushort = 9; +pub const RTA_PROTOINFO: ::c_ushort = 10; // No longer used +pub const RTA_FLOW: ::c_ushort = 11; +pub const RTA_CACHEINFO: ::c_ushort = 12; +pub const RTA_SESSION: ::c_ushort = 13; // No longer used +pub const RTA_MP_ALGO: ::c_ushort = 14; // No longer used +pub const RTA_TABLE: ::c_ushort = 15; +pub const RTA_MARK: ::c_ushort = 16; +pub const RTA_MFC_STATS: ::c_ushort = 17; + +pub const RTN_UNSPEC: ::c_uchar = 0; +pub const RTN_UNICAST: ::c_uchar = 1; +pub const RTN_LOCAL: ::c_uchar = 2; +pub const RTN_BROADCAST: ::c_uchar = 3; +pub const RTN_ANYCAST: ::c_uchar = 4; +pub const RTN_MULTICAST: ::c_uchar = 5; +pub const RTN_BLACKHOLE: ::c_uchar = 6; +pub const RTN_UNREACHABLE: ::c_uchar = 7; +pub const RTN_PROHIBIT: ::c_uchar = 8; +pub const RTN_THROW: ::c_uchar = 9; +pub const RTN_NAT: ::c_uchar = 10; +pub const RTN_XRESOLVE: ::c_uchar = 11; + +pub const RTPROT_UNSPEC: ::c_uchar = 0; +pub const RTPROT_REDIRECT: ::c_uchar = 1; +pub const RTPROT_KERNEL: ::c_uchar = 2; +pub const RTPROT_BOOT: ::c_uchar = 3; +pub const RTPROT_STATIC: ::c_uchar = 4; + +pub const RT_SCOPE_UNIVERSE: ::c_uchar = 0; +pub const RT_SCOPE_SITE: ::c_uchar = 200; +pub const RT_SCOPE_LINK: ::c_uchar = 253; +pub const RT_SCOPE_HOST: ::c_uchar = 254; +pub const RT_SCOPE_NOWHERE: ::c_uchar = 255; + +pub const RT_TABLE_UNSPEC: ::c_uchar = 0; +pub const RT_TABLE_COMPAT: ::c_uchar = 252; +pub const RT_TABLE_DEFAULT: ::c_uchar = 253; +pub const RT_TABLE_MAIN: ::c_uchar = 254; +pub const RT_TABLE_LOCAL: ::c_uchar = 255; + +pub const RTMSG_OVERRUN: u32 = ::NLMSG_OVERRUN as u32; +pub const RTMSG_NEWDEVICE: u32 = 0x11; +pub const RTMSG_DELDEVICE: u32 = 0x12; +pub const RTMSG_NEWROUTE: u32 = 0x21; +pub const RTMSG_DELROUTE: u32 = 0x22; +pub const RTMSG_NEWRULE: u32 = 0x31; +pub const RTMSG_DELRULE: u32 = 0x32; +pub const RTMSG_CONTROL: u32 = 0x40; +pub const RTMSG_AR_FAILED: u32 = 0x51; + +pub const MAX_ADDR_LEN: usize = 7; +pub const ARPD_UPDATE: ::c_ushort = 0x01; +pub const ARPD_LOOKUP: ::c_ushort = 0x02; +pub const ARPD_FLUSH: ::c_ushort = 0x03; +pub const ATF_MAGIC: ::c_int = 0x80; + +// linux/module.h +pub const MODULE_INIT_IGNORE_MODVERSIONS: ::c_uint = 0x0001; +pub const MODULE_INIT_IGNORE_VERMAGIC: ::c_uint = 0x0002; + +// linux/net_tstamp.h +pub const SOF_TIMESTAMPING_TX_HARDWARE: ::c_uint = 1 << 0; +pub const SOF_TIMESTAMPING_TX_SOFTWARE: ::c_uint = 1 << 1; +pub const SOF_TIMESTAMPING_RX_HARDWARE: ::c_uint = 1 << 2; +pub const SOF_TIMESTAMPING_RX_SOFTWARE: ::c_uint = 1 << 3; +pub const SOF_TIMESTAMPING_SOFTWARE: ::c_uint = 1 << 4; +pub const SOF_TIMESTAMPING_SYS_HARDWARE: ::c_uint = 1 << 5; +pub const SOF_TIMESTAMPING_RAW_HARDWARE: ::c_uint = 1 << 6; +pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0; +pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1; + +// linux/if_alg.h +pub const ALG_SET_KEY: ::c_int = 1; +pub const ALG_SET_IV: ::c_int = 2; +pub const ALG_SET_OP: ::c_int = 3; +pub const ALG_SET_AEAD_ASSOCLEN: ::c_int = 4; +pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5; + +pub const ALG_OP_DECRYPT: ::c_int = 0; +pub const ALG_OP_ENCRYPT: ::c_int = 1; + +// include/uapi/linux/udp.h +pub const UDP_CORK: ::c_int = 1; +pub const UDP_ENCAP: ::c_int = 100; +pub const UDP_NO_CHECK6_TX: ::c_int = 101; +pub const UDP_NO_CHECK6_RX: ::c_int = 102; + +// include/uapi/linux/mman.h +pub const MAP_SHARED_VALIDATE: ::c_int = 0x3; + +// include/uapi/asm-generic/mman-common.h +pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000; +pub const MLOCK_ONFAULT: ::c_uint = 0x01; + +// uapi/linux/vm_sockets.h +pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF; +pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0; +#[deprecated( + since = "0.2.74", + note = "VMADDR_CID_RESERVED is removed since Linux v5.6 and \ + replaced with VMADDR_CID_LOCAL" +)] +pub const VMADDR_CID_RESERVED: ::c_uint = 1; +pub const VMADDR_CID_LOCAL: ::c_uint = 1; +pub const VMADDR_CID_HOST: ::c_uint = 2; +pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF; + +// uapi/linux/inotify.h +pub const IN_ACCESS: u32 = 0x0000_0001; +pub const IN_MODIFY: u32 = 0x0000_0002; +pub const IN_ATTRIB: u32 = 0x0000_0004; +pub const IN_CLOSE_WRITE: u32 = 0x0000_0008; +pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010; +pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE; +pub const IN_OPEN: u32 = 0x0000_0020; +pub const IN_MOVED_FROM: u32 = 0x0000_0040; +pub const IN_MOVED_TO: u32 = 0x0000_0080; +pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO; +pub const IN_CREATE: u32 = 0x0000_0100; +pub const IN_DELETE: u32 = 0x0000_0200; +pub const IN_DELETE_SELF: u32 = 0x0000_0400; +pub const IN_MOVE_SELF: u32 = 0x0000_0800; +pub const IN_UNMOUNT: u32 = 0x0000_2000; +pub const IN_Q_OVERFLOW: u32 = 0x0000_4000; +pub const IN_IGNORED: u32 = 0x0000_8000; +pub const IN_ONLYDIR: u32 = 0x0100_0000; +pub const IN_DONT_FOLLOW: u32 = 0x0200_0000; +// pub const IN_EXCL_UNLINK: u32 = 0x0400_0000; + +// linux/keyctl.h +pub const KEY_SPEC_THREAD_KEYRING: i32 = -1; +pub const KEY_SPEC_PROCESS_KEYRING: i32 = -2; +pub const KEY_SPEC_SESSION_KEYRING: i32 = -3; +pub const KEY_SPEC_USER_KEYRING: i32 = -4; +pub const KEY_SPEC_USER_SESSION_KEYRING: i32 = -5; +pub const KEY_SPEC_GROUP_KEYRING: i32 = -6; +pub const KEY_SPEC_REQKEY_AUTH_KEY: i32 = -7; +pub const KEY_SPEC_REQUESTOR_KEYRING: i32 = -8; + +pub const KEY_REQKEY_DEFL_NO_CHANGE: i32 = -1; +pub const KEY_REQKEY_DEFL_DEFAULT: i32 = 0; +pub const KEY_REQKEY_DEFL_THREAD_KEYRING: i32 = 1; +pub const KEY_REQKEY_DEFL_PROCESS_KEYRING: i32 = 2; +pub const KEY_REQKEY_DEFL_SESSION_KEYRING: i32 = 3; +pub const KEY_REQKEY_DEFL_USER_KEYRING: i32 = 4; +pub const KEY_REQKEY_DEFL_USER_SESSION_KEYRING: i32 = 5; +pub const KEY_REQKEY_DEFL_GROUP_KEYRING: i32 = 6; +pub const KEY_REQKEY_DEFL_REQUESTOR_KEYRING: i32 = 7; + +pub const KEYCTL_GET_KEYRING_ID: u32 = 0; +pub const KEYCTL_JOIN_SESSION_KEYRING: u32 = 1; +pub const KEYCTL_UPDATE: u32 = 2; +pub const KEYCTL_REVOKE: u32 = 3; +pub const KEYCTL_CHOWN: u32 = 4; +pub const KEYCTL_SETPERM: u32 = 5; +pub const KEYCTL_DESCRIBE: u32 = 6; +pub const KEYCTL_CLEAR: u32 = 7; +pub const KEYCTL_LINK: u32 = 8; +pub const KEYCTL_UNLINK: u32 = 9; +pub const KEYCTL_SEARCH: u32 = 10; +pub const KEYCTL_READ: u32 = 11; +pub const KEYCTL_INSTANTIATE: u32 = 12; +pub const KEYCTL_NEGATE: u32 = 13; +pub const KEYCTL_SET_REQKEY_KEYRING: u32 = 14; +pub const KEYCTL_SET_TIMEOUT: u32 = 15; +pub const KEYCTL_ASSUME_AUTHORITY: u32 = 16; +pub const KEYCTL_GET_SECURITY: u32 = 17; +pub const KEYCTL_SESSION_TO_PARENT: u32 = 18; +pub const KEYCTL_REJECT: u32 = 19; +pub const KEYCTL_INSTANTIATE_IOV: u32 = 20; +pub const KEYCTL_INVALIDATE: u32 = 21; +pub const KEYCTL_GET_PERSISTENT: u32 = 22; + +// pub const IN_MASK_CREATE: u32 = 0x1000_0000; +// pub const IN_MASK_ADD: u32 = 0x2000_0000; +pub const IN_ISDIR: u32 = 0x4000_0000; +pub const IN_ONESHOT: u32 = 0x8000_0000; + +pub const IN_ALL_EVENTS: u32 = IN_ACCESS + | IN_MODIFY + | IN_ATTRIB + | IN_CLOSE_WRITE + | IN_CLOSE_NOWRITE + | IN_OPEN + | IN_MOVED_FROM + | IN_MOVED_TO + | IN_DELETE + | IN_CREATE + | IN_DELETE_SELF + | IN_MOVE_SELF; + +pub const IN_CLOEXEC: ::c_int = O_CLOEXEC; +pub const IN_NONBLOCK: ::c_int = O_NONBLOCK; + +// uapi/linux/netfilter/nf_tables.h +pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256; +pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256; +pub const NFT_SET_MAXNAMELEN: ::c_int = 256; +pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256; +pub const NFT_USERDATA_MAXLEN: ::c_int = 256; + +pub const NFT_REG_VERDICT: ::c_int = 0; +pub const NFT_REG_1: ::c_int = 1; +pub const NFT_REG_2: ::c_int = 2; +pub const NFT_REG_3: ::c_int = 3; +pub const NFT_REG_4: ::c_int = 4; +pub const __NFT_REG_MAX: ::c_int = 5; +pub const NFT_REG32_00: ::c_int = 8; +pub const NFT_REG32_01: ::c_int = 9; +pub const NFT_REG32_02: ::c_int = 10; +pub const NFT_REG32_03: ::c_int = 11; +pub const NFT_REG32_04: ::c_int = 12; +pub const NFT_REG32_05: ::c_int = 13; +pub const NFT_REG32_06: ::c_int = 14; +pub const NFT_REG32_07: ::c_int = 15; +pub const NFT_REG32_08: ::c_int = 16; +pub const NFT_REG32_09: ::c_int = 17; +pub const NFT_REG32_10: ::c_int = 18; +pub const NFT_REG32_11: ::c_int = 19; +pub const NFT_REG32_12: ::c_int = 20; +pub const NFT_REG32_13: ::c_int = 21; +pub const NFT_REG32_14: ::c_int = 22; +pub const NFT_REG32_15: ::c_int = 23; + +pub const NFT_REG_SIZE: ::c_int = 16; +pub const NFT_REG32_SIZE: ::c_int = 4; + +pub const NFT_CONTINUE: ::c_int = -1; +pub const NFT_BREAK: ::c_int = -2; +pub const NFT_JUMP: ::c_int = -3; +pub const NFT_GOTO: ::c_int = -4; +pub const NFT_RETURN: ::c_int = -5; + +pub const NFT_MSG_NEWTABLE: ::c_int = 0; +pub const NFT_MSG_GETTABLE: ::c_int = 1; +pub const NFT_MSG_DELTABLE: ::c_int = 2; +pub const NFT_MSG_NEWCHAIN: ::c_int = 3; +pub const NFT_MSG_GETCHAIN: ::c_int = 4; +pub const NFT_MSG_DELCHAIN: ::c_int = 5; +pub const NFT_MSG_NEWRULE: ::c_int = 6; +pub const NFT_MSG_GETRULE: ::c_int = 7; +pub const NFT_MSG_DELRULE: ::c_int = 8; +pub const NFT_MSG_NEWSET: ::c_int = 9; +pub const NFT_MSG_GETSET: ::c_int = 10; +pub const NFT_MSG_DELSET: ::c_int = 11; +pub const NFT_MSG_NEWSETELEM: ::c_int = 12; +pub const NFT_MSG_GETSETELEM: ::c_int = 13; +pub const NFT_MSG_DELSETELEM: ::c_int = 14; +pub const NFT_MSG_NEWGEN: ::c_int = 15; +pub const NFT_MSG_GETGEN: ::c_int = 16; +pub const NFT_MSG_TRACE: ::c_int = 17; +cfg_if! { + if #[cfg(not(target_arch = "sparc64"))] { + pub const NFT_MSG_NEWOBJ: ::c_int = 18; + pub const NFT_MSG_GETOBJ: ::c_int = 19; + pub const NFT_MSG_DELOBJ: ::c_int = 20; + pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21; + } +} +pub const NFT_MSG_MAX: ::c_int = 25; + +pub const NFT_SET_ANONYMOUS: ::c_int = 0x1; +pub const NFT_SET_CONSTANT: ::c_int = 0x2; +pub const NFT_SET_INTERVAL: ::c_int = 0x4; +pub const NFT_SET_MAP: ::c_int = 0x8; +pub const NFT_SET_TIMEOUT: ::c_int = 0x10; +pub const NFT_SET_EVAL: ::c_int = 0x20; + +pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0; +pub const NFT_SET_POL_MEMORY: ::c_int = 1; + +pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1; + +pub const NFT_DATA_VALUE: ::c_uint = 0; +pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00; + +pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00; + +pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64; + +pub const NFT_BYTEORDER_NTOH: ::c_int = 0; +pub const NFT_BYTEORDER_HTON: ::c_int = 1; + +pub const NFT_CMP_EQ: ::c_int = 0; +pub const NFT_CMP_NEQ: ::c_int = 1; +pub const NFT_CMP_LT: ::c_int = 2; +pub const NFT_CMP_LTE: ::c_int = 3; +pub const NFT_CMP_GT: ::c_int = 4; +pub const NFT_CMP_GTE: ::c_int = 5; + +pub const NFT_RANGE_EQ: ::c_int = 0; +pub const NFT_RANGE_NEQ: ::c_int = 1; + +pub const NFT_LOOKUP_F_INV: ::c_int = 1 << 0; + +pub const NFT_DYNSET_OP_ADD: ::c_int = 0; +pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1; + +pub const NFT_DYNSET_F_INV: ::c_int = 1 << 0; + +pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0; +pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1; +pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2; + +pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0; +pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1; + +pub const NFT_META_LEN: ::c_int = 0; +pub const NFT_META_PROTOCOL: ::c_int = 1; +pub const NFT_META_PRIORITY: ::c_int = 2; +pub const NFT_META_MARK: ::c_int = 3; +pub const NFT_META_IIF: ::c_int = 4; +pub const NFT_META_OIF: ::c_int = 5; +pub const NFT_META_IIFNAME: ::c_int = 6; +pub const NFT_META_OIFNAME: ::c_int = 7; +pub const NFT_META_IIFTYPE: ::c_int = 8; +pub const NFT_META_OIFTYPE: ::c_int = 9; +pub const NFT_META_SKUID: ::c_int = 10; +pub const NFT_META_SKGID: ::c_int = 11; +pub const NFT_META_NFTRACE: ::c_int = 12; +pub const NFT_META_RTCLASSID: ::c_int = 13; +pub const NFT_META_SECMARK: ::c_int = 14; +pub const NFT_META_NFPROTO: ::c_int = 15; +pub const NFT_META_L4PROTO: ::c_int = 16; +pub const NFT_META_BRI_IIFNAME: ::c_int = 17; +pub const NFT_META_BRI_OIFNAME: ::c_int = 18; +pub const NFT_META_PKTTYPE: ::c_int = 19; +pub const NFT_META_CPU: ::c_int = 20; +pub const NFT_META_IIFGROUP: ::c_int = 21; +pub const NFT_META_OIFGROUP: ::c_int = 22; +pub const NFT_META_CGROUP: ::c_int = 23; +pub const NFT_META_PRANDOM: ::c_int = 24; + +pub const NFT_CT_STATE: ::c_int = 0; +pub const NFT_CT_DIRECTION: ::c_int = 1; +pub const NFT_CT_STATUS: ::c_int = 2; +pub const NFT_CT_MARK: ::c_int = 3; +pub const NFT_CT_SECMARK: ::c_int = 4; +pub const NFT_CT_EXPIRATION: ::c_int = 5; +pub const NFT_CT_HELPER: ::c_int = 6; +pub const NFT_CT_L3PROTOCOL: ::c_int = 7; +pub const NFT_CT_SRC: ::c_int = 8; +pub const NFT_CT_DST: ::c_int = 9; +pub const NFT_CT_PROTOCOL: ::c_int = 10; +pub const NFT_CT_PROTO_SRC: ::c_int = 11; +pub const NFT_CT_PROTO_DST: ::c_int = 12; +pub const NFT_CT_LABELS: ::c_int = 13; +pub const NFT_CT_PKTS: ::c_int = 14; +pub const NFT_CT_BYTES: ::c_int = 15; + +pub const NFT_LIMIT_PKTS: ::c_int = 0; +pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1; + +pub const NFT_LIMIT_F_INV: ::c_int = 1 << 0; + +pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01; +pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02; +pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03; + +pub const NFT_QUOTA_F_INV: ::c_int = 1 << 0; + +pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0; +pub const NFT_REJECT_TCP_RST: ::c_int = 1; +pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2; + +pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0; +pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1; +pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2; +pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3; + +pub const NFT_NAT_SNAT: ::c_int = 0; +pub const NFT_NAT_DNAT: ::c_int = 1; + +pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0; +pub const NFT_TRACETYPE_POLICY: ::c_int = 1; +pub const NFT_TRACETYPE_RETURN: ::c_int = 2; +pub const NFT_TRACETYPE_RULE: ::c_int = 3; + +pub const NFT_NG_INCREMENTAL: ::c_int = 0; +pub const NFT_NG_RANDOM: ::c_int = 1; + +// linux/input.h +pub const FF_MAX: ::__u16 = 0x7f; +pub const FF_CNT: usize = FF_MAX as usize + 1; + +// linux/input-event-codes.h +pub const INPUT_PROP_MAX: ::__u16 = 0x1f; +pub const INPUT_PROP_CNT: usize = INPUT_PROP_MAX as usize + 1; +pub const EV_MAX: ::__u16 = 0x1f; +pub const EV_CNT: usize = EV_MAX as usize + 1; +pub const SYN_MAX: ::__u16 = 0xf; +pub const SYN_CNT: usize = SYN_MAX as usize + 1; +pub const KEY_MAX: ::__u16 = 0x2ff; +pub const KEY_CNT: usize = KEY_MAX as usize + 1; +pub const REL_MAX: ::__u16 = 0x0f; +pub const REL_CNT: usize = REL_MAX as usize + 1; +pub const ABS_MAX: ::__u16 = 0x3f; +pub const ABS_CNT: usize = ABS_MAX as usize + 1; +pub const SW_MAX: ::__u16 = 0x10; +pub const SW_CNT: usize = SW_MAX as usize + 1; +pub const MSC_MAX: ::__u16 = 0x07; +pub const MSC_CNT: usize = MSC_MAX as usize + 1; +pub const LED_MAX: ::__u16 = 0x0f; +pub const LED_CNT: usize = LED_MAX as usize + 1; +pub const REP_MAX: ::__u16 = 0x01; +pub const REP_CNT: usize = REP_MAX as usize + 1; +pub const SND_MAX: ::__u16 = 0x07; +pub const SND_CNT: usize = SND_MAX as usize + 1; + +// linux/uinput.h +pub const UINPUT_VERSION: ::c_uint = 5; +pub const UINPUT_MAX_NAME_SIZE: usize = 80; + +// uapi/linux/fanotify.h +pub const FAN_ACCESS: u64 = 0x0000_0001; +pub const FAN_MODIFY: u64 = 0x0000_0002; +pub const FAN_CLOSE_WRITE: u64 = 0x0000_0008; +pub const FAN_CLOSE_NOWRITE: u64 = 0x0000_0010; +pub const FAN_OPEN: u64 = 0x0000_0020; + +pub const FAN_Q_OVERFLOW: u64 = 0x0000_4000; + +pub const FAN_OPEN_PERM: u64 = 0x0001_0000; +pub const FAN_ACCESS_PERM: u64 = 0x0002_0000; + +pub const FAN_ONDIR: u64 = 0x4000_0000; + +pub const FAN_EVENT_ON_CHILD: u64 = 0x0800_0000; + +pub const FAN_CLOSE: u64 = FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE; + +pub const FAN_CLOEXEC: ::c_uint = 0x0000_0001; +pub const FAN_NONBLOCK: ::c_uint = 0x0000_0002; + +pub const FAN_CLASS_NOTIF: ::c_uint = 0x0000_0000; +pub const FAN_CLASS_CONTENT: ::c_uint = 0x0000_0004; +pub const FAN_CLASS_PRE_CONTENT: ::c_uint = 0x0000_0008; + +pub const FAN_UNLIMITED_QUEUE: ::c_uint = 0x0000_0010; +pub const FAN_UNLIMITED_MARKS: ::c_uint = 0x0000_0020; + +pub const FAN_MARK_ADD: ::c_uint = 0x0000_0001; +pub const FAN_MARK_REMOVE: ::c_uint = 0x0000_0002; +pub const FAN_MARK_DONT_FOLLOW: ::c_uint = 0x0000_0004; +pub const FAN_MARK_ONLYDIR: ::c_uint = 0x0000_0008; +pub const FAN_MARK_IGNORED_MASK: ::c_uint = 0x0000_0020; +pub const FAN_MARK_IGNORED_SURV_MODIFY: ::c_uint = 0x0000_0040; +pub const FAN_MARK_FLUSH: ::c_uint = 0x0000_0080; + +pub const FANOTIFY_METADATA_VERSION: u8 = 3; + +pub const FAN_ALLOW: u32 = 0x01; +pub const FAN_DENY: u32 = 0x02; + +pub const FAN_NOFD: ::c_int = -1; + +pub const FUTEX_WAIT: ::c_int = 0; +pub const FUTEX_WAKE: ::c_int = 1; +pub const FUTEX_FD: ::c_int = 2; +pub const FUTEX_REQUEUE: ::c_int = 3; +pub const FUTEX_CMP_REQUEUE: ::c_int = 4; +pub const FUTEX_WAKE_OP: ::c_int = 5; +pub const FUTEX_LOCK_PI: ::c_int = 6; +pub const FUTEX_UNLOCK_PI: ::c_int = 7; +pub const FUTEX_TRYLOCK_PI: ::c_int = 8; +pub const FUTEX_WAIT_BITSET: ::c_int = 9; +pub const FUTEX_WAKE_BITSET: ::c_int = 10; +pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11; +pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12; +pub const FUTEX_LOCK_PI2: ::c_int = 13; + +pub const FUTEX_PRIVATE_FLAG: ::c_int = 128; +pub const FUTEX_CLOCK_REALTIME: ::c_int = 256; +pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME); + +// linux/reboot.h +pub const LINUX_REBOOT_MAGIC1: ::c_int = 0xfee1dead; +pub const LINUX_REBOOT_MAGIC2: ::c_int = 672274793; +pub const LINUX_REBOOT_MAGIC2A: ::c_int = 85072278; +pub const LINUX_REBOOT_MAGIC2B: ::c_int = 369367448; +pub const LINUX_REBOOT_MAGIC2C: ::c_int = 537993216; + +pub const LINUX_REBOOT_CMD_RESTART: ::c_int = 0x01234567; +pub const LINUX_REBOOT_CMD_HALT: ::c_int = 0xCDEF0123; +pub const LINUX_REBOOT_CMD_CAD_ON: ::c_int = 0x89ABCDEF; +pub const LINUX_REBOOT_CMD_CAD_OFF: ::c_int = 0x00000000; +pub const LINUX_REBOOT_CMD_POWER_OFF: ::c_int = 0x4321FEDC; +pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4; +pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2; +pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543; + +pub const REG_EXTENDED: ::c_int = 1; +pub const REG_ICASE: ::c_int = 2; +pub const REG_NEWLINE: ::c_int = 4; +pub const REG_NOSUB: ::c_int = 8; + +pub const REG_NOTBOL: ::c_int = 1; +pub const REG_NOTEOL: ::c_int = 2; + +pub const REG_ENOSYS: ::c_int = -1; +pub const REG_NOMATCH: ::c_int = 1; +pub const REG_BADPAT: ::c_int = 2; +pub const REG_ECOLLATE: ::c_int = 3; +pub const REG_ECTYPE: ::c_int = 4; +pub const REG_EESCAPE: ::c_int = 5; +pub const REG_ESUBREG: ::c_int = 6; +pub const REG_EBRACK: ::c_int = 7; +pub const REG_EPAREN: ::c_int = 8; +pub const REG_EBRACE: ::c_int = 9; +pub const REG_BADBR: ::c_int = 10; +pub const REG_ERANGE: ::c_int = 11; +pub const REG_ESPACE: ::c_int = 12; +pub const REG_BADRPT: ::c_int = 13; + +// linux/errqueue.h +pub const SO_EE_ORIGIN_NONE: u8 = 0; +pub const SO_EE_ORIGIN_LOCAL: u8 = 1; +pub const SO_EE_ORIGIN_ICMP: u8 = 2; +pub const SO_EE_ORIGIN_ICMP6: u8 = 3; +pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4; +pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS; + +// errno.h +pub const EPERM: ::c_int = 1; +pub const ENOENT: ::c_int = 2; +pub const ESRCH: ::c_int = 3; +pub const EINTR: ::c_int = 4; +pub const EIO: ::c_int = 5; +pub const ENXIO: ::c_int = 6; +pub const E2BIG: ::c_int = 7; +pub const ENOEXEC: ::c_int = 8; +pub const EBADF: ::c_int = 9; +pub const ECHILD: ::c_int = 10; +pub const EAGAIN: ::c_int = 11; +pub const ENOMEM: ::c_int = 12; +pub const EACCES: ::c_int = 13; +pub const EFAULT: ::c_int = 14; +pub const ENOTBLK: ::c_int = 15; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENFILE: ::c_int = 23; +pub const EMFILE: ::c_int = 24; +pub const ENOTTY: ::c_int = 25; +pub const ETXTBSY: ::c_int = 26; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDOM: ::c_int = 33; +pub const ERANGE: ::c_int = 34; +pub const EWOULDBLOCK: ::c_int = EAGAIN; + +// linux/can.h +pub const CAN_EFF_FLAG: canid_t = 0x80000000; +pub const CAN_RTR_FLAG: canid_t = 0x40000000; +pub const CAN_ERR_FLAG: canid_t = 0x20000000; +pub const CAN_SFF_MASK: canid_t = 0x000007FF; +pub const CAN_EFF_MASK: canid_t = 0x1FFFFFFF; +pub const CAN_ERR_MASK: canid_t = 0x1FFFFFFF; + +pub const CAN_SFF_ID_BITS: ::c_int = 11; +pub const CAN_EFF_ID_BITS: ::c_int = 29; + +pub const CAN_MAX_DLC: ::c_int = 8; +pub const CAN_MAX_DLEN: usize = 8; +pub const CANFD_MAX_DLC: ::c_int = 15; +pub const CANFD_MAX_DLEN: usize = 64; + +pub const CANFD_BRS: ::c_int = 0x01; +pub const CANFD_ESI: ::c_int = 0x02; + +cfg_if! { + if #[cfg(libc_align)] { + pub const CAN_MTU: usize = ::mem::size_of::(); + pub const CANFD_MTU: usize = ::mem::size_of::(); + } +} + +pub const CAN_RAW: ::c_int = 1; +pub const CAN_BCM: ::c_int = 2; +pub const CAN_TP16: ::c_int = 3; +pub const CAN_TP20: ::c_int = 4; +pub const CAN_MCNET: ::c_int = 5; +pub const CAN_ISOTP: ::c_int = 6; +pub const CAN_J1939: ::c_int = 7; +pub const CAN_NPROTO: ::c_int = 8; + +pub const SOL_CAN_BASE: ::c_int = 100; + +pub const CAN_INV_FILTER: canid_t = 0x20000000; +pub const CAN_RAW_FILTER_MAX: ::c_int = 512; + +// linux/can/raw.h +pub const SOL_CAN_RAW: ::c_int = SOL_CAN_BASE + CAN_RAW; +pub const CAN_RAW_FILTER: ::c_int = 1; +pub const CAN_RAW_ERR_FILTER: ::c_int = 2; +pub const CAN_RAW_LOOPBACK: ::c_int = 3; +pub const CAN_RAW_RECV_OWN_MSGS: ::c_int = 4; +pub const CAN_RAW_FD_FRAMES: ::c_int = 5; +pub const CAN_RAW_JOIN_FILTERS: ::c_int = 6; + +// linux/can/j1939.h +pub const SOL_CAN_J1939: ::c_int = SOL_CAN_BASE + CAN_J1939; + +pub const J1939_MAX_UNICAST_ADDR: ::c_uchar = 0xfd; +pub const J1939_IDLE_ADDR: ::c_uchar = 0xfe; +pub const J1939_NO_ADDR: ::c_uchar = 0xff; +pub const J1939_NO_NAME: ::c_ulong = 0; +pub const J1939_PGN_REQUEST: ::c_uint = 0x0ea00; +pub const J1939_PGN_ADDRESS_CLAIMED: ::c_uint = 0x0ee00; +pub const J1939_PGN_ADDRESS_COMMANDED: ::c_uint = 0x0fed8; +pub const J1939_PGN_PDU1_MAX: ::c_uint = 0x3ff00; +pub const J1939_PGN_MAX: ::c_uint = 0x3ffff; +pub const J1939_NO_PGN: ::c_uint = 0x40000; + +pub const SO_J1939_FILTER: ::c_int = 1; +pub const SO_J1939_PROMISC: ::c_int = 2; +pub const SO_J1939_SEND_PRIO: ::c_int = 3; +pub const SO_J1939_ERRQUEUE: ::c_int = 4; + +pub const SCM_J1939_DEST_ADDR: ::c_int = 1; +pub const SCM_J1939_DEST_NAME: ::c_int = 2; +pub const SCM_J1939_PRIO: ::c_int = 3; +pub const SCM_J1939_ERRQUEUE: ::c_int = 4; + +pub const J1939_NLA_PAD: ::c_int = 0; +pub const J1939_NLA_BYTES_ACKED: ::c_int = 1; +pub const J1939_NLA_TOTAL_SIZE: ::c_int = 2; +pub const J1939_NLA_PGN: ::c_int = 3; +pub const J1939_NLA_SRC_NAME: ::c_int = 4; +pub const J1939_NLA_DEST_NAME: ::c_int = 5; +pub const J1939_NLA_SRC_ADDR: ::c_int = 6; +pub const J1939_NLA_DEST_ADDR: ::c_int = 7; + +pub const J1939_EE_INFO_NONE: ::c_int = 0; +pub const J1939_EE_INFO_TX_ABORT: ::c_int = 1; +pub const J1939_EE_INFO_RX_RTS: ::c_int = 2; +pub const J1939_EE_INFO_RX_DPO: ::c_int = 3; +pub const J1939_EE_INFO_RX_ABORT: ::c_int = 4; + +pub const J1939_FILTER_MAX: ::c_int = 512; + +f! { + pub fn NLA_ALIGN(len: ::c_int) -> ::c_int { + return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1) + } + + pub fn CMSG_NXTHDR(mhdr: *const msghdr, + cmsg: *const cmsghdr) -> *mut cmsghdr { + if ((*cmsg).cmsg_len as usize) < ::mem::size_of::() { + return 0 as *mut cmsghdr; + }; + let next = (cmsg as usize + + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) + as *mut cmsghdr; + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if (next.offset(1)) as usize > max || + next as usize + super::CMSG_ALIGN((*next).cmsg_len as usize) > max + { + 0 as *mut cmsghdr + } else { + next as *mut cmsghdr + } + } + + pub fn CPU_ALLOC_SIZE(count: ::c_int) -> ::size_t { + let _dummy: cpu_set_t = ::mem::zeroed(); + let size_in_bits = 8 * ::mem::size_of_val(&_dummy.bits[0]); + ((count as ::size_t + size_in_bits - 1) / 8) as ::size_t + } + + pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { + for slot in cpuset.bits.iter_mut() { + *slot = 0; + } + } + + pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let size_in_bits + = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + cpuset.bits[idx] |= 1 << offset; + () + } + + pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { + let size_in_bits + = 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + cpuset.bits[idx] &= !(1 << offset); + () + } + + pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { + let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]); + let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); + 0 != (cpuset.bits[idx] & (1 << offset)) + } + + pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> ::c_int { + let mut s: u32 = 0; + let size_of_mask = ::mem::size_of_val(&cpuset.bits[0]); + for i in cpuset.bits[..(size / size_of_mask)].iter() { + s += i.count_ones(); + }; + s as ::c_int + } + + pub fn CPU_COUNT(cpuset: &cpu_set_t) -> ::c_int { + CPU_COUNT_S(::mem::size_of::(), cpuset) + } + + pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { + set1.bits == set2.bits + } + + pub fn major(dev: ::dev_t) -> ::c_uint { + let mut major = 0; + major |= (dev & 0x00000000000fff00) >> 8; + major |= (dev & 0xfffff00000000000) >> 32; + major as ::c_uint + } + + pub fn minor(dev: ::dev_t) -> ::c_uint { + let mut minor = 0; + minor |= (dev & 0x00000000000000ff) >> 0; + minor |= (dev & 0x00000ffffff00000) >> 12; + minor as ::c_uint + } + + pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t { + let major = major as ::dev_t; + let minor = minor as ::dev_t; + let mut dev = 0; + dev |= (major & 0x00000fff) << 8; + dev |= (major & 0xfffff000) << 32; + dev |= (minor & 0x000000ff) << 0; + dev |= (minor & 0xffffff00) << 12; + dev + } + + pub fn IPTOS_TOS(tos: u8) -> u8 { + tos & IPTOS_TOS_MASK + } + + pub fn IPTOS_PREC(tos: u8) -> u8 { + tos & IPTOS_PREC_MASK + } + + pub fn RT_TOS(tos: u8) -> u8 { + tos & ::IPTOS_TOS_MASK + } + + pub fn RT_ADDRCLASS(flags: u32) -> u32 { + flags >> 23 + } + + pub fn RT_LOCALADDR(flags: u32) -> bool { + (flags & RTF_ADDRCLASSMASK) == (RTF_LOCAL | RTF_INTERFACE) + } + + pub fn SO_EE_OFFENDER(ee: *const ::sock_extended_err) -> *mut ::sockaddr { + ee.offset(1) as *mut ::sockaddr + } + + pub fn BPF_RVAL(code: ::__u32) -> ::__u32 { + code & 0x18 + } + + pub fn BPF_MISCOP(code: ::__u32) -> ::__u32 { + code & 0xf8 + } + + pub fn BPF_STMT(code: ::__u16, k: ::__u32) -> sock_filter { + sock_filter{code: code, jt: 0, jf: 0, k: k} + } + + pub fn BPF_JUMP(code: ::__u16, k: ::__u32, jt: ::__u8, jf: ::__u8) -> sock_filter { + sock_filter{code: code, jt: jt, jf: jf, k: k} + } +} + +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + extern "C" { + pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn aio_error(aiocbp: *const aiocb) -> ::c_int; + pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t; + pub fn aio_suspend( + aiocb_list: *const *const aiocb, + nitems: ::c_int, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int; + pub fn lio_listio( + mode: ::c_int, + aiocb_list: *const *mut aiocb, + nitems: ::c_int, + sevp: *mut ::sigevent, + ) -> ::c_int; + pub fn pwritev( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off_t, + ) -> ::ssize_t; + pub fn preadv( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off_t, + ) -> ::ssize_t; + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::socklen_t, + serv: *mut ::c_char, + sevlen: ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + pub fn getloadavg( + loadavg: *mut ::c_double, + nelem: ::c_int + ) -> ::c_int; + pub fn process_vm_readv( + pid: ::pid_t, + local_iov: *const ::iovec, + liovcnt: ::c_ulong, + remote_iov: *const ::iovec, + riovcnt: ::c_ulong, + flags: ::c_ulong, + ) -> isize; + pub fn process_vm_writev( + pid: ::pid_t, + local_iov: *const ::iovec, + liovcnt: ::c_ulong, + remote_iov: *const ::iovec, + riovcnt: ::c_ulong, + flags: ::c_ulong, + ) -> isize; + pub fn futimes( + fd: ::c_int, + times: *const ::timeval + ) -> ::c_int; + } + } +} + +extern "C" { + #[cfg_attr(not(target_env = "musl"), link_name = "__xpg_strerror_r")] + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; + pub fn labs(i: ::c_long) -> ::c_long; + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + + pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int; + + pub fn setpwent(); + pub fn endpwent(); + pub fn getpwent() -> *mut passwd; + pub fn setgrent(); + pub fn endgrent(); + pub fn getgrent() -> *mut ::group; + pub fn setspent(); + pub fn endspent(); + pub fn getspent() -> *mut spwd; + + pub fn getspnam(name: *const ::c_char) -> *mut spwd; + // Only `getspnam_r` is implemented for musl, out of all of the reenterant + // functions from `shadow.h`. + // https://git.musl-libc.org/cgit/musl/tree/include/shadow.h + pub fn getspnam_r( + name: *const ::c_char, + spbuf: *mut spwd, + buf: *mut ::c_char, + buflen: ::size_t, + spbufp: *mut *mut spwd, + ) -> ::c_int; + + pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int; + + // System V IPC + pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; + pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; + pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; + pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; + pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t; + pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int; + pub fn semop(semid: ::c_int, sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int; + pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int; + pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int; + pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int; + pub fn msgrcv( + msqid: ::c_int, + msgp: *mut ::c_void, + msgsz: ::size_t, + msgtyp: ::c_long, + msgflg: ::c_int, + ) -> ::ssize_t; + pub fn msgsnd( + msqid: ::c_int, + msgp: *const ::c_void, + msgsz: ::size_t, + msgflg: ::c_int, + ) -> ::c_int; + + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn __errno_location() -> *mut ::c_int; + + pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn freopen64( + filename: *const c_char, + mode: *const c_char, + file: *mut ::FILE, + ) -> *mut ::FILE; + pub fn tmpfile64() -> *mut ::FILE; + pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int; + pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int; + pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int; + pub fn ftello64(stream: *mut ::FILE) -> ::off64_t; + pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; + pub fn fallocate64(fd: ::c_int, mode: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int; + pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; + pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int; + pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t; + pub fn getxattr( + path: *const c_char, + name: *const c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn lgetxattr( + path: *const c_char, + name: *const c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn fgetxattr( + filedes: ::c_int, + name: *const c_char, + value: *mut ::c_void, + size: ::size_t, + ) -> ::ssize_t; + pub fn setxattr( + path: *const c_char, + name: *const c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn lsetxattr( + path: *const c_char, + name: *const c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn fsetxattr( + filedes: ::c_int, + name: *const c_char, + value: *const ::c_void, + size: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn listxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t; + pub fn llistxattr(path: *const c_char, list: *mut c_char, size: ::size_t) -> ::ssize_t; + pub fn flistxattr(filedes: ::c_int, list: *mut c_char, size: ::size_t) -> ::ssize_t; + pub fn removexattr(path: *const c_char, name: *const c_char) -> ::c_int; + pub fn lremovexattr(path: *const c_char, name: *const c_char) -> ::c_int; + pub fn fremovexattr(filedes: ::c_int, name: *const c_char) -> ::c_int; + pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int; + pub fn timerfd_create(clockid: ::clockid_t, flags: ::c_int) -> ::c_int; + pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int; + pub fn timerfd_settime( + fd: ::c_int, + flags: ::c_int, + new_value: *const itimerspec, + old_value: *mut itimerspec, + ) -> ::c_int; + pub fn quotactl( + cmd: ::c_int, + special: *const ::c_char, + id: ::c_int, + data: *mut ::c_char, + ) -> ::c_int; + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; + pub fn mq_receive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + ) -> ::ssize_t; + pub fn mq_timedreceive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::ssize_t; + pub fn mq_send( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + ) -> ::c_int; + pub fn mq_timedsend( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; + pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int; + pub fn epoll_pwait( + epfd: ::c_int, + events: *mut ::epoll_event, + maxevents: ::c_int, + timeout: ::c_int, + sigmask: *const ::sigset_t, + ) -> ::c_int; + pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int; + pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int; + pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int; + pub fn sigtimedwait( + set: *const sigset_t, + info: *mut siginfo_t, + timeout: *const ::timespec, + ) -> ::c_int; + pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int; + pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; + pub fn accept4( + fd: ::c_int, + addr: *mut ::sockaddr, + len: *mut ::socklen_t, + flg: ::c_int, + ) -> ::c_int; + pub fn pthread_getaffinity_np( + thread: ::pthread_t, + cpusetsize: ::size_t, + cpuset: *mut ::cpu_set_t, + ) -> ::c_int; + pub fn pthread_setaffinity_np( + thread: ::pthread_t, + cpusetsize: ::size_t, + cpuset: *const ::cpu_set_t, + ) -> ::c_int; + pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int; + pub fn reboot(how_to: ::c_int) -> ::c_int; + pub fn setfsgid(gid: ::gid_t) -> ::c_int; + pub fn setfsuid(uid: ::uid_t) -> ::c_int; + + // Not available now on Android + pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; + pub fn if_nameindex() -> *mut if_nameindex; + pub fn if_freenameindex(ptr: *mut if_nameindex); + pub fn sync_file_range( + fd: ::c_int, + offset: ::off64_t, + nbytes: ::off64_t, + flags: ::c_uint, + ) -> ::c_int; + pub fn mremap( + addr: *mut ::c_void, + len: ::size_t, + new_len: ::size_t, + flags: ::c_int, + ... + ) -> *mut ::c_void; + + pub fn glob( + pattern: *const c_char, + flags: ::c_int, + errfunc: ::Option ::c_int>, + pglob: *mut ::glob_t, + ) -> ::c_int; + pub fn globfree(pglob: *mut ::glob_t); + + pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; + pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; + pub fn remap_file_pages( + addr: *mut ::c_void, + size: ::size_t, + prot: ::c_int, + pgoff: ::size_t, + flags: ::c_int, + ) -> ::c_int; + pub fn recvfrom( + socket: ::c_int, + buf: *mut ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, + ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + + pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn vhangup() -> ::c_int; + pub fn sync(); + pub fn syncfs(fd: ::c_int) -> ::c_int; + pub fn syscall(num: ::c_long, ...) -> ::c_long; + pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t) + -> ::c_int; + pub fn sched_setaffinity( + pid: ::pid_t, + cpusetsize: ::size_t, + cpuset: *const cpu_set_t, + ) -> ::c_int; + pub fn epoll_create(size: ::c_int) -> ::c_int; + pub fn epoll_create1(flags: ::c_int) -> ::c_int; + pub fn epoll_wait( + epfd: ::c_int, + events: *mut ::epoll_event, + maxevents: ::c_int, + timeout: ::c_int, + ) -> ::c_int; + pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event) + -> ::c_int; + pub fn pthread_getschedparam( + native: ::pthread_t, + policy: *mut ::c_int, + param: *mut ::sched_param, + ) -> ::c_int; + pub fn unshare(flags: ::c_int) -> ::c_int; + pub fn umount(target: *const ::c_char) -> ::c_int; + pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; + pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t; + pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; + pub fn splice( + fd_in: ::c_int, + off_in: *mut ::loff_t, + fd_out: ::c_int, + off_out: *mut ::loff_t, + len: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int; + pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; + pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; + pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int; + pub fn setns(fd: ::c_int, nstype: ::c_int) -> ::c_int; + pub fn swapoff(path: *const ::c_char) -> ::c_int; + pub fn vmsplice( + fd: ::c_int, + iov: *const ::iovec, + nr_segs: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; + pub fn mount( + src: *const ::c_char, + target: *const ::c_char, + fstype: *const ::c_char, + flags: ::c_ulong, + data: *const ::c_void, + ) -> ::c_int; + pub fn personality(persona: ::c_ulong) -> ::c_int; + pub fn prctl(option: ::c_int, ...) -> ::c_int; + pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int; + pub fn ppoll( + fds: *mut ::pollfd, + nfds: nfds_t, + timeout: *const ::timespec, + sigmask: *const sigset_t, + ) -> ::c_int; + pub fn pthread_mutexattr_getprotocol( + attr: *const pthread_mutexattr_t, + protocol: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_mutexattr_setprotocol( + attr: *mut pthread_mutexattr_t, + protocol: ::c_int, + ) -> ::c_int; + pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_timedlock( + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn clone( + cb: extern "C" fn(*mut ::c_void) -> ::c_int, + child_stack: *mut ::c_void, + flags: ::c_int, + arg: *mut ::c_void, + ... + ) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + pub fn pthread_attr_getguardsize( + attr: *const ::pthread_attr_t, + guardsize: *mut ::size_t, + ) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int; + pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; + pub fn pthread_condattr_getpshared( + attr: *const pthread_condattr_t, + pshared: *mut ::c_int, + ) -> ::c_int; + pub fn sysinfo(info: *mut ::sysinfo) -> ::c_int; + pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int; + pub fn pthread_setschedparam( + native: ::pthread_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int; + pub fn sched_setscheduler( + pid: ::pid_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + pub fn sendfile( + out_fd: ::c_int, + in_fd: ::c_int, + offset: *mut off_t, + count: ::size_t, + ) -> ::ssize_t; + pub fn sendfile64( + out_fd: ::c_int, + in_fd: ::c_int, + offset: *mut off64_t, + count: ::size_t, + ) -> ::ssize_t; + pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int; + pub fn getgrgid_r( + gid: ::gid_t, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; + pub fn getgrnam_r( + name: *const ::c_char, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int; + pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + pub fn getpwnam_r( + name: *const ::c_char, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn getpwuid_r( + uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; + pub fn pthread_atfork( + prepare: ::Option, + parent: ::Option, + child: ::Option, + ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; + pub fn getgrouplist( + user: *const ::c_char, + group: ::gid_t, + groups: *mut ::gid_t, + ngroups: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_mutexattr_getpshared( + attr: *const pthread_mutexattr_t, + pshared: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_mutexattr_getrobust( + attr: *const pthread_mutexattr_t, + robustness: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_mutexattr_setrobust( + attr: *mut pthread_mutexattr_t, + robustness: ::c_int, + ) -> ::c_int; + pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn faccessat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::c_int, + flags: ::c_int, + ) -> ::c_int; + pub fn pthread_create( + native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + pub fn dl_iterate_phdr( + callback: ::Option< + unsafe extern "C" fn( + info: *mut ::dl_phdr_info, + size: ::size_t, + data: *mut ::c_void, + ) -> ::c_int, + >, + data: *mut ::c_void, + ) -> ::c_int; + + pub fn setmntent(filename: *const ::c_char, ty: *const ::c_char) -> *mut ::FILE; + pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent; + pub fn addmntent(stream: *mut ::FILE, mnt: *const ::mntent) -> ::c_int; + pub fn endmntent(streamp: *mut ::FILE) -> ::c_int; + pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char; + + pub fn posix_spawn( + pid: *mut ::pid_t, + path: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnp( + pid: *mut ::pid_t, + file: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_getsigdefault( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigdefault( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getsigmask( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigmask( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getflags( + attr: *const posix_spawnattr_t, + flags: *mut ::c_short, + ) -> ::c_int; + pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; + pub fn posix_spawnattr_getpgroup( + attr: *const posix_spawnattr_t, + flags: *mut ::pid_t, + ) -> ::c_int; + pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; + pub fn posix_spawnattr_getschedpolicy( + attr: *const posix_spawnattr_t, + flags: *mut ::c_int, + ) -> ::c_int; + pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int; + pub fn posix_spawnattr_getschedparam( + attr: *const posix_spawnattr_t, + param: *mut ::sched_param, + ) -> ::c_int; + pub fn posix_spawnattr_setschedparam( + attr: *mut posix_spawnattr_t, + param: *const ::sched_param, + ) -> ::c_int; + + pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_addopen( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + path: *const ::c_char, + oflag: ::c_int, + mode: ::mode_t, + ) -> ::c_int; + pub fn posix_spawn_file_actions_addclose( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + ) -> ::c_int; + pub fn posix_spawn_file_actions_adddup2( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + newfd: ::c_int, + ) -> ::c_int; + pub fn fread_unlocked( + ptr: *mut ::c_void, + size: ::size_t, + nobj: ::size_t, + stream: *mut ::FILE, + ) -> ::size_t; + pub fn inotify_rm_watch(fd: ::c_int, wd: ::c_int) -> ::c_int; + pub fn inotify_init() -> ::c_int; + pub fn inotify_init1(flags: ::c_int) -> ::c_int; + pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int; + pub fn fanotify_init(flags: ::c_uint, event_f_flags: ::c_uint) -> ::c_int; + + pub fn regcomp(preg: *mut ::regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int; + + pub fn regexec( + preg: *const ::regex_t, + input: *const ::c_char, + nmatch: ::size_t, + pmatch: *mut regmatch_t, + eflags: ::c_int, + ) -> ::c_int; + + pub fn regerror( + errcode: ::c_int, + preg: *const ::regex_t, + errbuf: *mut ::c_char, + errbuf_size: ::size_t, + ) -> ::size_t; + + pub fn regfree(preg: *mut ::regex_t); + + pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t; + pub fn iconv( + cd: iconv_t, + inbuf: *mut *mut ::c_char, + inbytesleft: *mut ::size_t, + outbuf: *mut *mut ::c_char, + outbytesleft: *mut ::size_t, + ) -> ::size_t; + pub fn iconv_close(cd: iconv_t) -> ::c_int; + + pub fn gettid() -> ::pid_t; + + pub fn timer_create( + clockid: ::clockid_t, + sevp: *mut ::sigevent, + timerid: *mut ::timer_t, + ) -> ::c_int; + pub fn timer_delete(timerid: ::timer_t) -> ::c_int; + pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int; + pub fn timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int; + pub fn timer_settime( + timerid: ::timer_t, + flags: ::c_int, + new_value: *const ::itimerspec, + old_value: *mut ::itimerspec, + ) -> ::c_int; + + pub fn gethostid() -> ::c_long; + + pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int; + pub fn memmem( + haystack: *const ::c_void, + haystacklen: ::size_t, + needle: *const ::c_void, + needlelen: ::size_t, + ) -> *mut ::c_void; + pub fn sched_getcpu() -> ::c_int; + + pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int; +} + +cfg_if! { + if #[cfg(target_env = "uclibc")] { + mod uclibc; + pub use self::uclibc::*; + } else if #[cfg(target_env = "musl")] { + mod musl; + pub use self::musl::*; + } else if #[cfg(target_env = "gnu")] { + mod gnu; + pub use self::gnu::*; + } +} + +mod arch; +pub use self::arch::*; + +cfg_if! { + if #[cfg(libc_align)] { + #[macro_use] + mod align; + } else { + #[macro_use] + mod no_align; + } +} +expand_align!(); + +cfg_if! { + if #[cfg(libc_non_exhaustive)] { + mod non_exhaustive; + pub use self::non_exhaustive::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..aedbf7a99eb1b18a3f99ffb1746228f2c8d36179 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(8))] + pub struct max_align_t { + priv_: (i64, i64) + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..7e4868b85463119eda07ee50452548f2f3d35eb4 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/arm/mod.rs @@ -0,0 +1,850 @@ +pub type c_char = u8; +pub type wchar_t = u32; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + __st_dev_padding: ::c_int, + __st_ino_truncated: ::c_long, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __st_rdev_padding: ::c_int, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::ino_t, + } + + pub struct stat64 { + pub st_dev: ::dev_t, + __st_dev_padding: ::c_int, + __st_ino_truncated: ::c_long, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __st_rdev_padding: ::c_int, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::ino_t, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __unused1: ::c_long, + __unused2: ::c_long + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + __unused1: ::c_int, + pub shm_dtime: ::time_t, + __unused2: ::c_int, + pub shm_ctime: ::time_t, + __unused3: ::c_int, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::c_ulong, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + __unused1: ::c_int, + pub msg_rtime: ::time_t, + __unused2: ::c_int, + pub msg_ctime: ::time_t, + __unused3: ::c_int, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct statfs { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct mcontext_t { + pub trap_no: ::c_ulong, + pub error_code: ::c_ulong, + pub oldmask: ::c_ulong, + pub arm_r0: ::c_ulong, + pub arm_r1: ::c_ulong, + pub arm_r2: ::c_ulong, + pub arm_r3: ::c_ulong, + pub arm_r4: ::c_ulong, + pub arm_r5: ::c_ulong, + pub arm_r6: ::c_ulong, + pub arm_r7: ::c_ulong, + pub arm_r8: ::c_ulong, + pub arm_r9: ::c_ulong, + pub arm_r10: ::c_ulong, + pub arm_fp: ::c_ulong, + pub arm_ip: ::c_ulong, + pub arm_sp: ::c_ulong, + pub arm_lr: ::c_ulong, + pub arm_pc: ::c_ulong, + pub arm_cpsr: ::c_ulong, + pub fault_address: ::c_ulong, + } +} + +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask: ::sigset_t, + pub uc_regspace: [::c_ulonglong; 64], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for ucontext_t { + fn eq(&self, other: &ucontext_t) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_sigmask == other.uc_sigmask + } + } + impl Eq for ucontext_t {} + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_link) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field("uc_sigmask", &self.uc_sigmask) + .finish() + } + } + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + self.uc_sigmask.hash(state); + } + } + } +} + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_LARGEFILE: ::c_int = 0o400000; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::c_int = 0x00000800; +pub const TAB2: ::c_int = 0x00001000; +pub const TAB3: ::c_int = 0x00001800; +pub const CR1: ::c_int = 0x00000200; +pub const CR2: ::c_int = 0x00000400; +pub const CR3: ::c_int = 0x00000600; +pub const FF1: ::c_int = 0x00008000; +pub const BS1: ::c_int = 0x00002000; +pub const VT1: ::c_int = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; + +pub const SOCK_NONBLOCK: ::c_int = 2048; + +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_SEQPACKET: ::c_int = 5; + +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EDEADLOCK: ::c_int = EDEADLK; +pub const EMULTIHOP: ::c_int = 72; +pub const EBADMSG: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const ERFKILL: ::c_int = 132; +pub const EHWPOISON: ::c_int = 133; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const EXTPROC: ::tcflag_t = 0x00010000; + +pub const MAP_HUGETLB: ::c_int = 0x040000; + +pub const F_GETLK: ::c_int = 12; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETLK: ::c_int = 13; +pub const F_SETLKW: ::c_int = 14; +pub const F_SETOWN: ::c_int = 8; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const VEOF: usize = 4; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_pause: ::c_long = 29; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_chown: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_ugetrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_lchown32: ::c_long = 198; +pub const SYS_getuid32: ::c_long = 199; +pub const SYS_getgid32: ::c_long = 200; +pub const SYS_geteuid32: ::c_long = 201; +pub const SYS_getegid32: ::c_long = 202; +pub const SYS_setreuid32: ::c_long = 203; +pub const SYS_setregid32: ::c_long = 204; +pub const SYS_getgroups32: ::c_long = 205; +pub const SYS_setgroups32: ::c_long = 206; +pub const SYS_fchown32: ::c_long = 207; +pub const SYS_setresuid32: ::c_long = 208; +pub const SYS_getresuid32: ::c_long = 209; +pub const SYS_setresgid32: ::c_long = 210; +pub const SYS_getresgid32: ::c_long = 211; +pub const SYS_chown32: ::c_long = 212; +pub const SYS_setuid32: ::c_long = 213; +pub const SYS_setgid32: ::c_long = 214; +pub const SYS_setfsuid32: ::c_long = 215; +pub const SYS_setfsgid32: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; +pub const SYS_pivot_root: ::c_long = 218; +pub const SYS_mincore: ::c_long = 219; +pub const SYS_madvise: ::c_long = 220; +pub const SYS_fcntl64: ::c_long = 221; +pub const SYS_gettid: ::c_long = 224; +pub const SYS_readahead: ::c_long = 225; +pub const SYS_setxattr: ::c_long = 226; +pub const SYS_lsetxattr: ::c_long = 227; +pub const SYS_fsetxattr: ::c_long = 228; +pub const SYS_getxattr: ::c_long = 229; +pub const SYS_lgetxattr: ::c_long = 230; +pub const SYS_fgetxattr: ::c_long = 231; +pub const SYS_listxattr: ::c_long = 232; +pub const SYS_llistxattr: ::c_long = 233; +pub const SYS_flistxattr: ::c_long = 234; +pub const SYS_removexattr: ::c_long = 235; +pub const SYS_lremovexattr: ::c_long = 236; +pub const SYS_fremovexattr: ::c_long = 237; +pub const SYS_tkill: ::c_long = 238; +pub const SYS_sendfile64: ::c_long = 239; +pub const SYS_futex: ::c_long = 240; +pub const SYS_sched_setaffinity: ::c_long = 241; +pub const SYS_sched_getaffinity: ::c_long = 242; +pub const SYS_io_setup: ::c_long = 243; +pub const SYS_io_destroy: ::c_long = 244; +pub const SYS_io_getevents: ::c_long = 245; +pub const SYS_io_submit: ::c_long = 246; +pub const SYS_io_cancel: ::c_long = 247; +pub const SYS_exit_group: ::c_long = 248; +pub const SYS_lookup_dcookie: ::c_long = 249; +pub const SYS_epoll_create: ::c_long = 250; +pub const SYS_epoll_ctl: ::c_long = 251; +pub const SYS_epoll_wait: ::c_long = 252; +pub const SYS_remap_file_pages: ::c_long = 253; +pub const SYS_set_tid_address: ::c_long = 256; +pub const SYS_timer_create: ::c_long = 257; +pub const SYS_timer_settime: ::c_long = 258; +pub const SYS_timer_gettime: ::c_long = 259; +pub const SYS_timer_getoverrun: ::c_long = 260; +pub const SYS_timer_delete: ::c_long = 261; +pub const SYS_clock_settime: ::c_long = 262; +pub const SYS_clock_gettime: ::c_long = 263; +pub const SYS_clock_getres: ::c_long = 264; +pub const SYS_clock_nanosleep: ::c_long = 265; +pub const SYS_statfs64: ::c_long = 266; +pub const SYS_fstatfs64: ::c_long = 267; +pub const SYS_tgkill: ::c_long = 268; +pub const SYS_utimes: ::c_long = 269; +pub const SYS_pciconfig_iobase: ::c_long = 271; +pub const SYS_pciconfig_read: ::c_long = 272; +pub const SYS_pciconfig_write: ::c_long = 273; +pub const SYS_mq_open: ::c_long = 274; +pub const SYS_mq_unlink: ::c_long = 275; +pub const SYS_mq_timedsend: ::c_long = 276; +pub const SYS_mq_timedreceive: ::c_long = 277; +pub const SYS_mq_notify: ::c_long = 278; +pub const SYS_mq_getsetattr: ::c_long = 279; +pub const SYS_waitid: ::c_long = 280; +pub const SYS_socket: ::c_long = 281; +pub const SYS_bind: ::c_long = 282; +pub const SYS_connect: ::c_long = 283; +pub const SYS_listen: ::c_long = 284; +pub const SYS_accept: ::c_long = 285; +pub const SYS_getsockname: ::c_long = 286; +pub const SYS_getpeername: ::c_long = 287; +pub const SYS_socketpair: ::c_long = 288; +pub const SYS_send: ::c_long = 289; +pub const SYS_sendto: ::c_long = 290; +pub const SYS_recv: ::c_long = 291; +pub const SYS_recvfrom: ::c_long = 292; +pub const SYS_shutdown: ::c_long = 293; +pub const SYS_setsockopt: ::c_long = 294; +pub const SYS_getsockopt: ::c_long = 295; +pub const SYS_sendmsg: ::c_long = 296; +pub const SYS_recvmsg: ::c_long = 297; +pub const SYS_semop: ::c_long = 298; +pub const SYS_semget: ::c_long = 299; +pub const SYS_semctl: ::c_long = 300; +pub const SYS_msgsnd: ::c_long = 301; +pub const SYS_msgrcv: ::c_long = 302; +pub const SYS_msgget: ::c_long = 303; +pub const SYS_msgctl: ::c_long = 304; +pub const SYS_shmat: ::c_long = 305; +pub const SYS_shmdt: ::c_long = 306; +pub const SYS_shmget: ::c_long = 307; +pub const SYS_shmctl: ::c_long = 308; +pub const SYS_add_key: ::c_long = 309; +pub const SYS_request_key: ::c_long = 310; +pub const SYS_keyctl: ::c_long = 311; +pub const SYS_semtimedop: ::c_long = 312; +pub const SYS_vserver: ::c_long = 313; +pub const SYS_ioprio_set: ::c_long = 314; +pub const SYS_ioprio_get: ::c_long = 315; +pub const SYS_inotify_init: ::c_long = 316; +pub const SYS_inotify_add_watch: ::c_long = 317; +pub const SYS_inotify_rm_watch: ::c_long = 318; +pub const SYS_mbind: ::c_long = 319; +pub const SYS_get_mempolicy: ::c_long = 320; +pub const SYS_set_mempolicy: ::c_long = 321; +pub const SYS_openat: ::c_long = 322; +pub const SYS_mkdirat: ::c_long = 323; +pub const SYS_mknodat: ::c_long = 324; +pub const SYS_fchownat: ::c_long = 325; +pub const SYS_futimesat: ::c_long = 326; +pub const SYS_fstatat64: ::c_long = 327; +pub const SYS_unlinkat: ::c_long = 328; +pub const SYS_renameat: ::c_long = 329; +pub const SYS_linkat: ::c_long = 330; +pub const SYS_symlinkat: ::c_long = 331; +pub const SYS_readlinkat: ::c_long = 332; +pub const SYS_fchmodat: ::c_long = 333; +pub const SYS_faccessat: ::c_long = 334; +pub const SYS_pselect6: ::c_long = 335; +pub const SYS_ppoll: ::c_long = 336; +pub const SYS_unshare: ::c_long = 337; +pub const SYS_set_robust_list: ::c_long = 338; +pub const SYS_get_robust_list: ::c_long = 339; +pub const SYS_splice: ::c_long = 340; +pub const SYS_tee: ::c_long = 342; +pub const SYS_vmsplice: ::c_long = 343; +pub const SYS_move_pages: ::c_long = 344; +pub const SYS_getcpu: ::c_long = 345; +pub const SYS_epoll_pwait: ::c_long = 346; +pub const SYS_kexec_load: ::c_long = 347; +pub const SYS_utimensat: ::c_long = 348; +pub const SYS_signalfd: ::c_long = 349; +pub const SYS_timerfd_create: ::c_long = 350; +pub const SYS_eventfd: ::c_long = 351; +pub const SYS_fallocate: ::c_long = 352; +pub const SYS_timerfd_settime: ::c_long = 353; +pub const SYS_timerfd_gettime: ::c_long = 354; +pub const SYS_signalfd4: ::c_long = 355; +pub const SYS_eventfd2: ::c_long = 356; +pub const SYS_epoll_create1: ::c_long = 357; +pub const SYS_dup3: ::c_long = 358; +pub const SYS_pipe2: ::c_long = 359; +pub const SYS_inotify_init1: ::c_long = 360; +pub const SYS_preadv: ::c_long = 361; +pub const SYS_pwritev: ::c_long = 362; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 363; +pub const SYS_perf_event_open: ::c_long = 364; +pub const SYS_recvmmsg: ::c_long = 365; +pub const SYS_accept4: ::c_long = 366; +pub const SYS_fanotify_init: ::c_long = 367; +pub const SYS_fanotify_mark: ::c_long = 368; +pub const SYS_prlimit64: ::c_long = 369; +pub const SYS_name_to_handle_at: ::c_long = 370; +pub const SYS_open_by_handle_at: ::c_long = 371; +pub const SYS_clock_adjtime: ::c_long = 372; +pub const SYS_syncfs: ::c_long = 373; +pub const SYS_sendmmsg: ::c_long = 374; +pub const SYS_setns: ::c_long = 375; +pub const SYS_process_vm_readv: ::c_long = 376; +pub const SYS_process_vm_writev: ::c_long = 377; +pub const SYS_kcmp: ::c_long = 378; +pub const SYS_finit_module: ::c_long = 379; +pub const SYS_sched_setattr: ::c_long = 380; +pub const SYS_sched_getattr: ::c_long = 381; +pub const SYS_renameat2: ::c_long = 382; +pub const SYS_seccomp: ::c_long = 383; +pub const SYS_getrandom: ::c_long = 384; +pub const SYS_memfd_create: ::c_long = 385; +pub const SYS_bpf: ::c_long = 386; +pub const SYS_execveat: ::c_long = 387; +pub const SYS_userfaultfd: ::c_long = 388; +pub const SYS_membarrier: ::c_long = 389; +pub const SYS_mlock2: ::c_long = 390; +pub const SYS_copy_file_range: ::c_long = 391; +pub const SYS_preadv2: ::c_long = 392; +pub const SYS_pwritev2: ::c_long = 393; +pub const SYS_pkey_mprotect: ::c_long = 394; +pub const SYS_pkey_alloc: ::c_long = 395; +pub const SYS_pkey_free: ::c_long = 396; +pub const SYS_statx: ::c_long = 397; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +extern "C" { + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs new file mode 100644 index 0000000000000000000000000000000000000000..f83d208d5fe8f7e4e078d1a36111d84bf6865e9d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/hexagon.rs @@ -0,0 +1,673 @@ +pub type c_char = u8; +pub type wchar_t = u32; +pub type stat64 = ::stat; + +s! { + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::c_ulonglong, + pub st_mode: ::c_uint, + pub st_nlink: ::c_uint, + pub st_uid: ::c_uint, + pub st_gid: ::c_uint, + pub st_rdev: ::c_ulonglong, + __st_rdev_padding: ::c_ulong, + pub st_size: ::c_longlong, + pub st_blksize: ::blksize_t, + __st_blksize_padding: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + + __unused: [::c_int;2], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_ushort, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + __unused1: ::c_int, + pub shm_dtime: ::time_t, + __unused2: ::c_int, + pub shm_ctime: ::time_t, + __unused3: ::c_int, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::c_ulong, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + __unused1: ::c_int, + pub msg_rtime: ::time_t, + __unused2: ::c_int, + pub msg_ctime: ::time_t, + __unused3: ::c_int, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct statfs { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } +} + +pub const AF_FILE: ::c_int = 1; +pub const AF_KCM: ::c_int = 41; +pub const AF_MAX: ::c_int = 43; +pub const AF_QIPCRTR: ::c_int = 42; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EALREADY: ::c_int = 114; +pub const EBADE: ::c_int = 52; +pub const EBADMSG: ::c_int = 74; +pub const EBADR: ::c_int = 53; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const ECANCELED: ::c_int = 125; +pub const ECHRNG: ::c_int = 44; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNREFUSED: ::c_int = 111; +pub const ECONNRESET: ::c_int = 104; +pub const EDEADLK: ::c_int = 35; +pub const EDEADLOCK: ::c_int = 35; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EDQUOT: ::c_int = 122; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EHWPOISON: ::c_int = 133; +pub const EIDRM: ::c_int = 43; +pub const EILSEQ: ::c_int = 84; +pub const EINPROGRESS: ::c_int = 115; +pub const EISCONN: ::c_int = 106; +pub const EISNAM: ::c_int = 120; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREJECTED: ::c_int = 129; +pub const EKEYREVOKED: ::c_int = 128; +pub const EL2HLT: ::c_int = 51; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBEXEC: ::c_int = 83; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBSCN: ::c_int = 81; +pub const ELNRNG: ::c_int = 48; +pub const ELOOP: ::c_int = 40; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const EMSGSIZE: ::c_int = 90; +pub const EMULTIHOP: ::c_int = 72; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENAVAIL: ::c_int = 119; +pub const ENETDOWN: ::c_int = 100; +pub const ENETRESET: ::c_int = 102; +pub const ENETUNREACH: ::c_int = 101; +pub const ENOANO: ::c_int = 55; +pub const ENOBUFS: ::c_int = 105; +pub const ENOCSI: ::c_int = 50; +pub const ENOKEY: ::c_int = 126; +pub const ENOLCK: ::c_int = 37; +pub const ENOMEDIUM: ::c_int = 123; +pub const ENOMSG: ::c_int = 42; +pub const ENOPROTOOPT: ::c_int = 92; +pub const ENOSYS: ::c_int = 38; +pub const ENOTCONN: ::c_int = 107; +pub const ENOTEMPTY: ::c_int = 39; +pub const ENOTNAM: ::c_int = 118; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const ENOTSOCK: ::c_int = 88; +pub const ENOTSUP: ::c_int = 95; +pub const ENOTUNIQ: ::c_int = 76; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EOVERFLOW: ::c_int = 75; +pub const EOWNERDEAD: ::c_int = 130; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EREMCHG: ::c_int = 78; +pub const ERESTART: ::c_int = 85; +pub const ERFKILL: ::c_int = 132; +pub const ESHUTDOWN: ::c_int = 108; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const ESTALE: ::c_int = 116; +pub const ESTRPIPE: ::c_int = 86; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const EUCLEAN: ::c_int = 117; +pub const EUNATCH: ::c_int = 49; +pub const EUSERS: ::c_int = 87; +pub const EXFULL: ::c_int = 54; +pub const EXTPROC: ::c_int = 65536; +pub const F_EXLCK: ::c_int = 4; +pub const F_GETLK: ::c_int = 12; +pub const F_GETOWN: ::c_int = 9; +pub const F_GETOWNER_UIDS: ::c_int = 17; +pub const F_GETOWN_EX: ::c_int = 16; +pub const F_GETSIG: ::c_int = 11; +pub const F_LINUX_SPECIFIC_BASE: ::c_int = 1024; +pub const FLUSHO: ::c_int = 4096; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; +pub const F_OWNER_PGRP: ::c_int = 2; +pub const F_OWNER_PID: ::c_int = 1; +pub const F_OWNER_TID: ::c_int = 0; +pub const F_SETLK: ::c_int = 13; +pub const F_SETLKW: ::c_int = 14; +pub const F_SETOWN: ::c_int = 8; +pub const F_SETOWN_EX: ::c_int = 15; +pub const F_SETSIG: ::c_int = 10; +pub const F_SHLCK: ::c_int = 8; +pub const IEXTEN: ::c_int = 32768; +pub const MAP_ANON: ::c_int = 32; +pub const MAP_DENYWRITE: ::c_int = 2048; +pub const MAP_EXECUTABLE: ::c_int = 4096; +pub const MAP_GROWSDOWN: ::c_int = 256; +pub const MAP_HUGETLB: ::c_int = 262144; +pub const MAP_LOCKED: ::c_int = 8192; +pub const MAP_NONBLOCK: ::c_int = 65536; +pub const MAP_NORESERVE: ::c_int = 16384; +pub const MAP_POPULATE: ::c_int = 32768; +pub const MAP_STACK: ::c_int = 131072; +pub const MAP_UNINITIALIZED: ::c_int = 0; +pub const O_APPEND: ::c_int = 1024; +pub const O_ASYNC: ::c_int = 8192; +pub const O_CREAT: ::c_int = 64; +pub const O_DIRECT: ::c_int = 16384; +pub const O_DIRECTORY: ::c_int = 65536; +pub const O_DSYNC: ::c_int = 4096; +pub const O_EXCL: ::c_int = 128; +pub const O_LARGEFILE: ::c_int = 32768; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NOFOLLOW: ::c_int = 131072; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const PF_FILE: ::c_int = 1; +pub const PF_KCM: ::c_int = 41; +pub const PF_MAX: ::c_int = 43; +pub const PF_QIPCRTR: ::c_int = 42; +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; +pub const SIGBUS: ::c_int = 7; +pub const SIGCHLD: ::c_int = 17; +pub const SIGCONT: ::c_int = 18; +pub const SIGIO: ::c_int = 29; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPROF: ::c_int = 27; +pub const SIGPWR: ::c_int = 30; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const SIGSTOP: ::c_int = 19; +pub const SIGSYS: ::c_int = 31; +pub const SIGTSTP: ::c_int = 20; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGURG: ::c_int = 23; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGWINCH: ::c_int = 28; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIG_SETMASK: ::c_int = 2; // FIXME check these +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_NONBLOCK: ::c_int = 2048; +pub const SOCK_SEQPACKET: ::c_int = 5; +pub const SOCK_STREAM: ::c_int = 1; +pub const SOL_CAIF: ::c_int = 278; +pub const SOL_IUCV: ::c_int = 277; +pub const SOL_KCM: ::c_int = 281; +pub const SOL_NFC: ::c_int = 280; +pub const SOL_PNPIPE: ::c_int = 275; +pub const SOL_PPPOL2TP: ::c_int = 273; +pub const SOL_RDS: ::c_int = 276; +pub const SOL_RXRPC: ::c_int = 272; + +pub const SYS3264_fadvise64: ::c_int = 223; +pub const SYS3264_fcntl: ::c_int = 25; +pub const SYS3264_fstatat: ::c_int = 79; +pub const SYS3264_fstat: ::c_int = 80; +pub const SYS3264_fstatfs: ::c_int = 44; +pub const SYS3264_ftruncate: ::c_int = 46; +pub const SYS3264_lseek: ::c_int = 62; +pub const SYS3264_lstat: ::c_int = 1039; +pub const SYS3264_mmap: ::c_int = 222; +pub const SYS3264_sendfile: ::c_int = 71; +pub const SYS3264_stat: ::c_int = 1038; +pub const SYS3264_statfs: ::c_int = 43; +pub const SYS3264_truncate: ::c_int = 45; +pub const SYS_accept4: ::c_int = 242; +pub const SYS_accept: ::c_int = 202; +pub const SYS_access: ::c_int = 1033; +pub const SYS_acct: ::c_int = 89; +pub const SYS_add_key: ::c_int = 217; +pub const SYS_adjtimex: ::c_int = 171; +pub const SYS_alarm: ::c_int = 1059; +pub const SYS_arch_specific_syscall: ::c_int = 244; +pub const SYS_bdflush: ::c_int = 1075; +pub const SYS_bind: ::c_int = 200; +pub const SYS_bpf: ::c_int = 280; +pub const SYS_brk: ::c_int = 214; +pub const SYS_capget: ::c_int = 90; +pub const SYS_capset: ::c_int = 91; +pub const SYS_chdir: ::c_int = 49; +pub const SYS_chmod: ::c_int = 1028; +pub const SYS_chown: ::c_int = 1029; +pub const SYS_chroot: ::c_int = 51; +pub const SYS_clock_adjtime: ::c_int = 266; +pub const SYS_clock_getres: ::c_int = 114; +pub const SYS_clock_gettime: ::c_int = 113; +pub const SYS_clock_nanosleep: ::c_int = 115; +pub const SYS_clock_settime: ::c_int = 112; +pub const SYS_clone: ::c_int = 220; +pub const SYS_close: ::c_int = 57; +pub const SYS_connect: ::c_int = 203; +pub const SYS_copy_file_range: ::c_int = -1; // FIXME +pub const SYS_creat: ::c_int = 1064; +pub const SYS_delete_module: ::c_int = 106; +pub const SYS_dup2: ::c_int = 1041; +pub const SYS_dup3: ::c_int = 24; +pub const SYS_dup: ::c_int = 23; +pub const SYS_epoll_create1: ::c_int = 20; +pub const SYS_epoll_create: ::c_int = 1042; +pub const SYS_epoll_ctl: ::c_int = 21; +pub const SYS_epoll_pwait: ::c_int = 22; +pub const SYS_epoll_wait: ::c_int = 1069; +pub const SYS_eventfd2: ::c_int = 19; +pub const SYS_eventfd: ::c_int = 1044; +pub const SYS_execveat: ::c_int = 281; +pub const SYS_execve: ::c_int = 221; +pub const SYS_exit: ::c_int = 93; +pub const SYS_exit_group: ::c_int = 94; +pub const SYS_faccessat: ::c_int = 48; +pub const SYS_fadvise64_64: ::c_int = 223; +pub const SYS_fallocate: ::c_int = 47; +pub const SYS_fanotify_init: ::c_int = 262; +pub const SYS_fanotify_mark: ::c_int = 263; +pub const SYS_fchdir: ::c_int = 50; +pub const SYS_fchmodat: ::c_int = 53; +pub const SYS_fchmod: ::c_int = 52; +pub const SYS_fchownat: ::c_int = 54; +pub const SYS_fchown: ::c_int = 55; +pub const SYS_fcntl64: ::c_int = 25; +pub const SYS_fcntl: ::c_int = 25; +pub const SYS_fdatasync: ::c_int = 83; +pub const SYS_fgetxattr: ::c_int = 10; +pub const SYS_finit_module: ::c_int = 273; +pub const SYS_flistxattr: ::c_int = 13; +pub const SYS_flock: ::c_int = 32; +pub const SYS_fork: ::c_int = 1079; +pub const SYS_fremovexattr: ::c_int = 16; +pub const SYS_fsetxattr: ::c_int = 7; +pub const SYS_fstat64: ::c_int = 80; +pub const SYS_fstatat64: ::c_int = 79; +pub const SYS_fstatfs64: ::c_int = 44; +pub const SYS_fstatfs: ::c_int = 44; +pub const SYS_fsync: ::c_int = 82; +pub const SYS_ftruncate64: ::c_int = 46; +pub const SYS_ftruncate: ::c_int = 46; +pub const SYS_futex: ::c_int = 98; +pub const SYS_futimesat: ::c_int = 1066; +pub const SYS_getcpu: ::c_int = 168; +pub const SYS_getcwd: ::c_int = 17; +pub const SYS_getdents64: ::c_int = 61; +pub const SYS_getdents: ::c_int = 1065; +pub const SYS_getegid: ::c_int = 177; +pub const SYS_geteuid: ::c_int = 175; +pub const SYS_getgid: ::c_int = 176; +pub const SYS_getgroups: ::c_int = 158; +pub const SYS_getitimer: ::c_int = 102; +pub const SYS_get_mempolicy: ::c_int = 236; +pub const SYS_getpeername: ::c_int = 205; +pub const SYS_getpgid: ::c_int = 155; +pub const SYS_getpgrp: ::c_int = 1060; +pub const SYS_getpid: ::c_int = 172; +pub const SYS_getppid: ::c_int = 173; +pub const SYS_getpriority: ::c_int = 141; +pub const SYS_getrandom: ::c_int = 278; +pub const SYS_getresgid: ::c_int = 150; +pub const SYS_getresuid: ::c_int = 148; +pub const SYS_getrlimit: ::c_int = 163; +pub const SYS_get_robust_list: ::c_int = 100; +pub const SYS_getrusage: ::c_int = 165; +pub const SYS_getsid: ::c_int = 156; +pub const SYS_getsockname: ::c_int = 204; +pub const SYS_getsockopt: ::c_int = 209; +pub const SYS_gettid: ::c_int = 178; +pub const SYS_gettimeofday: ::c_int = 169; +pub const SYS_getuid: ::c_int = 174; +pub const SYS_getxattr: ::c_int = 8; +pub const SYS_init_module: ::c_int = 105; +pub const SYS_inotify_add_watch: ::c_int = 27; +pub const SYS_inotify_init1: ::c_int = 26; +pub const SYS_inotify_init: ::c_int = 1043; +pub const SYS_inotify_rm_watch: ::c_int = 28; +pub const SYS_io_cancel: ::c_int = 3; +pub const SYS_ioctl: ::c_int = 29; +pub const SYS_io_destroy: ::c_int = 1; +pub const SYS_io_getevents: ::c_int = 4; +pub const SYS_ioprio_get: ::c_int = 31; +pub const SYS_ioprio_set: ::c_int = 30; +pub const SYS_io_setup: ::c_int = 0; +pub const SYS_io_submit: ::c_int = 2; +pub const SYS_kcmp: ::c_int = 272; +pub const SYS_kexec_load: ::c_int = 104; +pub const SYS_keyctl: ::c_int = 219; +pub const SYS_kill: ::c_int = 129; +pub const SYS_lchown: ::c_int = 1032; +pub const SYS_lgetxattr: ::c_int = 9; +pub const SYS_linkat: ::c_int = 37; +pub const SYS_link: ::c_int = 1025; +pub const SYS_listen: ::c_int = 201; +pub const SYS_listxattr: ::c_int = 11; +pub const SYS_llistxattr: ::c_int = 12; +pub const SYS__llseek: ::c_int = 62; +pub const SYS_lookup_dcookie: ::c_int = 18; +pub const SYS_lremovexattr: ::c_int = 15; +pub const SYS_lseek: ::c_int = 62; +pub const SYS_lsetxattr: ::c_int = 6; +pub const SYS_lstat64: ::c_int = 1039; +pub const SYS_lstat: ::c_int = 1039; +pub const SYS_madvise: ::c_int = 233; +pub const SYS_mbind: ::c_int = 235; +pub const SYS_memfd_create: ::c_int = 279; +pub const SYS_migrate_pages: ::c_int = 238; +pub const SYS_mincore: ::c_int = 232; +pub const SYS_mkdirat: ::c_int = 34; +pub const SYS_mkdir: ::c_int = 1030; +pub const SYS_mknodat: ::c_int = 33; +pub const SYS_mknod: ::c_int = 1027; +pub const SYS_mlockall: ::c_int = 230; +pub const SYS_mlock: ::c_int = 228; +pub const SYS_mmap2: ::c_int = 222; +pub const SYS_mount: ::c_int = 40; +pub const SYS_move_pages: ::c_int = 239; +pub const SYS_mprotect: ::c_int = 226; +pub const SYS_mq_getsetattr: ::c_int = 185; +pub const SYS_mq_notify: ::c_int = 184; +pub const SYS_mq_open: ::c_int = 180; +pub const SYS_mq_timedreceive: ::c_int = 183; +pub const SYS_mq_timedsend: ::c_int = 182; +pub const SYS_mq_unlink: ::c_int = 181; +pub const SYS_mremap: ::c_int = 216; +pub const SYS_msgctl: ::c_int = 187; +pub const SYS_msgget: ::c_int = 186; +pub const SYS_msgrcv: ::c_int = 188; +pub const SYS_msgsnd: ::c_int = 189; +pub const SYS_msync: ::c_int = 227; +pub const SYS_munlockall: ::c_int = 231; +pub const SYS_munlock: ::c_int = 229; +pub const SYS_munmap: ::c_int = 215; +pub const SYS_name_to_handle_at: ::c_int = 264; +pub const SYS_nanosleep: ::c_int = 101; +pub const SYS_newfstatat: ::c_int = 79; +pub const SYS_nfsservctl: ::c_int = 42; +pub const SYS_oldwait4: ::c_int = 1072; +pub const SYS_openat: ::c_int = 56; +pub const SYS_open_by_handle_at: ::c_int = 265; +pub const SYS_open: ::c_int = 1024; +pub const SYS_pause: ::c_int = 1061; +pub const SYS_perf_event_open: ::c_int = 241; +pub const SYS_personality: ::c_int = 92; +pub const SYS_pipe2: ::c_int = 59; +pub const SYS_pipe: ::c_int = 1040; +pub const SYS_pivot_root: ::c_int = 41; +pub const SYS_poll: ::c_int = 1068; +pub const SYS_ppoll: ::c_int = 73; +pub const SYS_prctl: ::c_int = 167; +pub const SYS_pread64: ::c_int = 67; +pub const SYS_preadv: ::c_int = 69; +pub const SYS_prlimit64: ::c_int = 261; +pub const SYS_process_vm_readv: ::c_int = 270; +pub const SYS_process_vm_writev: ::c_int = 271; +pub const SYS_pselect6: ::c_int = 72; +pub const SYS_ptrace: ::c_int = 117; +pub const SYS_pwrite64: ::c_int = 68; +pub const SYS_pwritev: ::c_int = 70; +pub const SYS_quotactl: ::c_int = 60; +pub const SYS_readahead: ::c_int = 213; +pub const SYS_read: ::c_int = 63; +pub const SYS_readlinkat: ::c_int = 78; +pub const SYS_readlink: ::c_int = 1035; +pub const SYS_readv: ::c_int = 65; +pub const SYS_reboot: ::c_int = 142; +pub const SYS_recv: ::c_int = 1073; +pub const SYS_recvfrom: ::c_int = 207; +pub const SYS_recvmmsg: ::c_int = 243; +pub const SYS_recvmsg: ::c_int = 212; +pub const SYS_remap_file_pages: ::c_int = 234; +pub const SYS_removexattr: ::c_int = 14; +pub const SYS_renameat2: ::c_int = 276; +pub const SYS_renameat: ::c_int = 38; +pub const SYS_rename: ::c_int = 1034; +pub const SYS_request_key: ::c_int = 218; +pub const SYS_restart_syscall: ::c_int = 128; +pub const SYS_rmdir: ::c_int = 1031; +pub const SYS_rt_sigaction: ::c_int = 134; +pub const SYS_rt_sigpending: ::c_int = 136; +pub const SYS_rt_sigprocmask: ::c_int = 135; +pub const SYS_rt_sigqueueinfo: ::c_int = 138; +pub const SYS_rt_sigreturn: ::c_int = 139; +pub const SYS_rt_sigsuspend: ::c_int = 133; +pub const SYS_rt_sigtimedwait: ::c_int = 137; +pub const SYS_rt_tgsigqueueinfo: ::c_int = 240; +pub const SYS_sched_getaffinity: ::c_int = 123; +pub const SYS_sched_getattr: ::c_int = 275; +pub const SYS_sched_getparam: ::c_int = 121; +pub const SYS_sched_get_priority_max: ::c_int = 125; +pub const SYS_sched_get_priority_min: ::c_int = 126; +pub const SYS_sched_getscheduler: ::c_int = 120; +pub const SYS_sched_rr_get_interval: ::c_int = 127; +pub const SYS_sched_setaffinity: ::c_int = 122; +pub const SYS_sched_setattr: ::c_int = 274; +pub const SYS_sched_setparam: ::c_int = 118; +pub const SYS_sched_setscheduler: ::c_int = 119; +pub const SYS_sched_yield: ::c_int = 124; +pub const SYS_seccomp: ::c_int = 277; +pub const SYS_select: ::c_int = 1067; +pub const SYS_semctl: ::c_int = 191; +pub const SYS_semget: ::c_int = 190; +pub const SYS_semop: ::c_int = 193; +pub const SYS_semtimedop: ::c_int = 192; +pub const SYS_send: ::c_int = 1074; +pub const SYS_sendfile64: ::c_int = 71; +pub const SYS_sendfile: ::c_int = 71; +pub const SYS_sendmmsg: ::c_int = 269; +pub const SYS_sendmsg: ::c_int = 211; +pub const SYS_sendto: ::c_int = 206; +pub const SYS_setdomainname: ::c_int = 162; +pub const SYS_setfsgid: ::c_int = 152; +pub const SYS_setfsuid: ::c_int = 151; +pub const SYS_setgid: ::c_int = 144; +pub const SYS_setgroups: ::c_int = 159; +pub const SYS_sethostname: ::c_int = 161; +pub const SYS_setitimer: ::c_int = 103; +pub const SYS_set_mempolicy: ::c_int = 237; +pub const SYS_setns: ::c_int = 268; +pub const SYS_setpgid: ::c_int = 154; +pub const SYS_setpriority: ::c_int = 140; +pub const SYS_setregid: ::c_int = 143; +pub const SYS_setresgid: ::c_int = 149; +pub const SYS_setresuid: ::c_int = 147; +pub const SYS_setreuid: ::c_int = 145; +pub const SYS_setrlimit: ::c_int = 164; +pub const SYS_set_robust_list: ::c_int = 99; +pub const SYS_setsid: ::c_int = 157; +pub const SYS_setsockopt: ::c_int = 208; +pub const SYS_set_tid_address: ::c_int = 96; +pub const SYS_settimeofday: ::c_int = 170; +pub const SYS_setuid: ::c_int = 146; +pub const SYS_setxattr: ::c_int = 5; +pub const SYS_shmat: ::c_int = 196; +pub const SYS_shmctl: ::c_int = 195; +pub const SYS_shmdt: ::c_int = 197; +pub const SYS_shmget: ::c_int = 194; +pub const SYS_shutdown: ::c_int = 210; +pub const SYS_sigaltstack: ::c_int = 132; +pub const SYS_signalfd4: ::c_int = 74; +pub const SYS_signalfd: ::c_int = 1045; +pub const SYS_socket: ::c_int = 198; +pub const SYS_socketpair: ::c_int = 199; +pub const SYS_splice: ::c_int = 76; +pub const SYS_stat64: ::c_int = 1038; +pub const SYS_stat: ::c_int = 1038; +pub const SYS_statfs64: ::c_int = 43; +pub const SYS_swapoff: ::c_int = 225; +pub const SYS_swapon: ::c_int = 224; +pub const SYS_symlinkat: ::c_int = 36; +pub const SYS_symlink: ::c_int = 1036; +pub const SYS_sync: ::c_int = 81; +pub const SYS_sync_file_range2: ::c_int = 84; +pub const SYS_sync_file_range: ::c_int = 84; +pub const SYS_syncfs: ::c_int = 267; +pub const SYS_syscalls: ::c_int = 1080; +pub const SYS__sysctl: ::c_int = 1078; +pub const SYS_sysinfo: ::c_int = 179; +pub const SYS_syslog: ::c_int = 116; +pub const SYS_tee: ::c_int = 77; +pub const SYS_tgkill: ::c_int = 131; +pub const SYS_time: ::c_int = 1062; +pub const SYS_timer_create: ::c_int = 107; +pub const SYS_timer_delete: ::c_int = 111; +pub const SYS_timerfd_create: ::c_int = 85; +pub const SYS_timerfd_gettime: ::c_int = 87; +pub const SYS_timerfd_settime: ::c_int = 86; +pub const SYS_timer_getoverrun: ::c_int = 109; +pub const SYS_timer_gettime: ::c_int = 108; +pub const SYS_timer_settime: ::c_int = 110; +pub const SYS_times: ::c_int = 153; +pub const SYS_tkill: ::c_int = 130; +pub const SYS_truncate64: ::c_int = 45; +pub const SYS_truncate: ::c_int = 45; +pub const SYS_umask: ::c_int = 166; +pub const SYS_umount2: ::c_int = 39; +pub const SYS_umount: ::c_int = 1076; +pub const SYS_uname: ::c_int = 160; +pub const SYS_unlinkat: ::c_int = 35; +pub const SYS_unlink: ::c_int = 1026; +pub const SYS_unshare: ::c_int = 97; +pub const SYS_uselib: ::c_int = 1077; +pub const SYS_ustat: ::c_int = 1070; +pub const SYS_utime: ::c_int = 1063; +pub const SYS_utimensat: ::c_int = 88; +pub const SYS_utimes: ::c_int = 1037; +pub const SYS_vfork: ::c_int = 1071; +pub const SYS_vhangup: ::c_int = 58; +pub const SYS_vmsplice: ::c_int = 75; +pub const SYS_wait4: ::c_int = 260; +pub const SYS_waitid: ::c_int = 95; +pub const SYS_write: ::c_int = 64; +pub const SYS_writev: ::c_int = 66; +pub const SYS_statx: ::c_int = 291; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; +pub const TIOCM_LOOP: ::c_int = 32768; +pub const TIOCM_OUT1: ::c_int = 8192; +pub const TIOCM_OUT2: ::c_int = 16384; +pub const TIOCSER_TEMT: ::c_int = 1; +pub const TOSTOP: ::c_int = 256; +pub const VEOF: ::c_int = 4; +pub const VEOL2: ::c_int = 16; +pub const VEOL: ::c_int = 11; +pub const VMIN: ::c_int = 6; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..8c228ebab72cec19c6359b5b51d508c21f4f9000 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(8))] + pub struct max_align_t { + priv_: [f32; 4] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..7443a09edcd379b7448e9b4e43e0ecbe2f7fae91 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/mips/mod.rs @@ -0,0 +1,786 @@ +pub type c_char = i8; +pub type wchar_t = ::c_int; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + __st_padding1: [::c_long; 2], + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __st_padding2: [::c_long; 2], + pub st_size: ::off_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + __st_padding3: ::c_long, + pub st_blocks: ::blkcnt_t, + __st_padding4: [::c_long; 14], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + __st_padding1: [::c_long; 2], + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __st_padding2: [::c_long; 2], + pub st_size: ::off_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + __st_padding3: ::c_long, + pub st_blocks: ::blkcnt64_t, + __st_padding4: [::c_long; 14], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __unused1: ::c_long, + __unused2: ::c_long + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::c_ulong, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + #[cfg(target_endian = "big")] + __unused1: ::c_int, + pub msg_stime: ::time_t, + #[cfg(target_endian = "little")] + __unused1: ::c_int, + #[cfg(target_endian = "big")] + __unused2: ::c_int, + pub msg_rtime: ::time_t, + #[cfg(target_endian = "little")] + __unused2: ::c_int, + #[cfg(target_endian = "big")] + __unused3: ::c_int, + pub msg_ctime: ::time_t, + #[cfg(target_endian = "little")] + __unused3: ::c_int, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct statfs { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 5], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_code: ::c_int, + pub si_errno: ::c_int, + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 5], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + #[cfg(target_endian = "little")] + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + #[cfg(target_endian = "big")] + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } +} + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +pub const O_DIRECT: ::c_int = 0o100000; +pub const O_DIRECTORY: ::c_int = 0o200000; +pub const O_NOFOLLOW: ::c_int = 0o400000; +pub const O_ASYNC: ::c_int = 0o10000; +pub const O_LARGEFILE: ::c_int = 0x2000; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::c_int = 0x00000800; +pub const TAB2: ::c_int = 0x00001000; +pub const TAB3: ::c_int = 0x00001800; +pub const CR1: ::c_int = 0x00000200; +pub const CR2: ::c_int = 0x00000400; +pub const CR3: ::c_int = 0x00000600; +pub const FF1: ::c_int = 0x00008000; +pub const BS1: ::c_int = 0x00002000; +pub const VT1: ::c_int = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const O_APPEND: ::c_int = 0o010; +pub const O_CREAT: ::c_int = 0o400; +pub const O_EXCL: ::c_int = 0o2000; +pub const O_NOCTTY: ::c_int = 0o4000; +pub const O_NONBLOCK: ::c_int = 0o200; +pub const O_SYNC: ::c_int = 0o40020; +pub const O_RSYNC: ::c_int = 0o40020; +pub const O_DSYNC: ::c_int = 0o020; + +pub const SOCK_NONBLOCK: ::c_int = 0o200; + +pub const MAP_ANON: ::c_int = 0x800; +pub const MAP_GROWSDOWN: ::c_int = 0x1000; +pub const MAP_DENYWRITE: ::c_int = 0x2000; +pub const MAP_EXECUTABLE: ::c_int = 0x4000; +pub const MAP_LOCKED: ::c_int = 0x8000; +pub const MAP_NORESERVE: ::c_int = 0x0400; +pub const MAP_POPULATE: ::c_int = 0x10000; +pub const MAP_NONBLOCK: ::c_int = 0x20000; +pub const MAP_STACK: ::c_int = 0x40000; + +pub const EDEADLK: ::c_int = 45; +pub const ENAMETOOLONG: ::c_int = 78; +pub const ENOLCK: ::c_int = 46; +pub const ENOSYS: ::c_int = 89; +pub const ENOTEMPTY: ::c_int = 93; +pub const ELOOP: ::c_int = 90; +pub const ENOMSG: ::c_int = 35; +pub const EIDRM: ::c_int = 36; +pub const ECHRNG: ::c_int = 37; +pub const EL2NSYNC: ::c_int = 38; +pub const EL3HLT: ::c_int = 39; +pub const EL3RST: ::c_int = 40; +pub const ELNRNG: ::c_int = 41; +pub const EUNATCH: ::c_int = 42; +pub const ENOCSI: ::c_int = 43; +pub const EL2HLT: ::c_int = 44; +pub const EBADE: ::c_int = 50; +pub const EBADR: ::c_int = 51; +pub const EXFULL: ::c_int = 52; +pub const ENOANO: ::c_int = 53; +pub const EBADRQC: ::c_int = 54; +pub const EBADSLT: ::c_int = 55; +pub const EDEADLOCK: ::c_int = 56; +pub const EMULTIHOP: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 79; +pub const ENOTUNIQ: ::c_int = 80; +pub const EBADFD: ::c_int = 81; +pub const EBADMSG: ::c_int = 77; +pub const EREMCHG: ::c_int = 82; +pub const ELIBACC: ::c_int = 83; +pub const ELIBBAD: ::c_int = 84; +pub const ELIBSCN: ::c_int = 85; +pub const ELIBMAX: ::c_int = 86; +pub const ELIBEXEC: ::c_int = 87; +pub const EILSEQ: ::c_int = 88; +pub const ERESTART: ::c_int = 91; +pub const ESTRPIPE: ::c_int = 92; +pub const EUSERS: ::c_int = 94; +pub const ENOTSOCK: ::c_int = 95; +pub const EDESTADDRREQ: ::c_int = 96; +pub const EMSGSIZE: ::c_int = 97; +pub const EPROTOTYPE: ::c_int = 98; +pub const ENOPROTOOPT: ::c_int = 99; +pub const EPROTONOSUPPORT: ::c_int = 120; +pub const ESOCKTNOSUPPORT: ::c_int = 121; +pub const EOPNOTSUPP: ::c_int = 122; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 123; +pub const EAFNOSUPPORT: ::c_int = 124; +pub const EADDRINUSE: ::c_int = 125; +pub const EADDRNOTAVAIL: ::c_int = 126; +pub const ENETDOWN: ::c_int = 127; +pub const ENETUNREACH: ::c_int = 128; +pub const ENETRESET: ::c_int = 129; +pub const ECONNABORTED: ::c_int = 130; +pub const ECONNRESET: ::c_int = 131; +pub const ENOBUFS: ::c_int = 132; +pub const EISCONN: ::c_int = 133; +pub const ENOTCONN: ::c_int = 134; +pub const ESHUTDOWN: ::c_int = 143; +pub const ETOOMANYREFS: ::c_int = 144; +pub const ETIMEDOUT: ::c_int = 145; +pub const ECONNREFUSED: ::c_int = 146; +pub const EHOSTDOWN: ::c_int = 147; +pub const EHOSTUNREACH: ::c_int = 148; +pub const EALREADY: ::c_int = 149; +pub const EINPROGRESS: ::c_int = 150; +pub const ESTALE: ::c_int = 151; +pub const EUCLEAN: ::c_int = 135; +pub const ENOTNAM: ::c_int = 137; +pub const ENAVAIL: ::c_int = 138; +pub const EISNAM: ::c_int = 139; +pub const EREMOTEIO: ::c_int = 140; +pub const EDQUOT: ::c_int = 1133; +pub const ENOMEDIUM: ::c_int = 159; +pub const EMEDIUMTYPE: ::c_int = 160; +pub const ECANCELED: ::c_int = 158; +pub const ENOKEY: ::c_int = 161; +pub const EKEYEXPIRED: ::c_int = 162; +pub const EKEYREVOKED: ::c_int = 163; +pub const EKEYREJECTED: ::c_int = 164; +pub const EOWNERDEAD: ::c_int = 165; +pub const ENOTRECOVERABLE: ::c_int = 166; +pub const EHWPOISON: ::c_int = 168; +pub const ERFKILL: ::c_int = 167; + +pub const SOCK_STREAM: ::c_int = 2; +pub const SOCK_DGRAM: ::c_int = 1; +pub const SOCK_SEQPACKET: ::c_int = 5; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 8; +pub const SA_NOCLDWAIT: ::c_int = 0x10000; + +pub const SIGCHLD: ::c_int = 18; +pub const SIGBUS: ::c_int = 10; +pub const SIGTTIN: ::c_int = 26; +pub const SIGTTOU: ::c_int = 27; +pub const SIGXCPU: ::c_int = 30; +pub const SIGXFSZ: ::c_int = 31; +pub const SIGVTALRM: ::c_int = 28; +pub const SIGPROF: ::c_int = 29; +pub const SIGWINCH: ::c_int = 20; +pub const SIGUSR1: ::c_int = 16; +pub const SIGUSR2: ::c_int = 17; +pub const SIGCONT: ::c_int = 25; +pub const SIGSTOP: ::c_int = 23; +pub const SIGTSTP: ::c_int = 24; +pub const SIGURG: ::c_int = 21; +pub const SIGIO: ::c_int = 22; +pub const SIGSYS: ::c_int = 12; +pub const SIGSTKFLT: ::c_int = 7; +pub const SIGPOLL: ::c_int = ::SIGIO; +pub const SIGPWR: ::c_int = 19; +pub const SIG_SETMASK: ::c_int = 3; +pub const SIG_BLOCK: ::c_int = 1; +pub const SIG_UNBLOCK: ::c_int = 2; + +pub const EXTPROC: ::tcflag_t = 0o200000; + +pub const MAP_HUGETLB: ::c_int = 0x80000; + +pub const F_GETLK: ::c_int = 33; +pub const F_GETOWN: ::c_int = 23; +pub const F_SETLK: ::c_int = 34; +pub const F_SETLKW: ::c_int = 35; +pub const F_SETOWN: ::c_int = 24; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const VEOF: usize = 16; +pub const VEOL: usize = 17; +pub const VEOL2: usize = 6; +pub const VMIN: usize = 4; +pub const IEXTEN: ::tcflag_t = 0o000400; +pub const TOSTOP: ::tcflag_t = 0o100000; +pub const FLUSHO: ::tcflag_t = 0o020000; + +pub const POLLWRNORM: ::c_short = 0x4; +pub const POLLWRBAND: ::c_short = 0x100; + +pub const SYS_syscall: ::c_long = 4000 + 0; +pub const SYS_exit: ::c_long = 4000 + 1; +pub const SYS_fork: ::c_long = 4000 + 2; +pub const SYS_read: ::c_long = 4000 + 3; +pub const SYS_write: ::c_long = 4000 + 4; +pub const SYS_open: ::c_long = 4000 + 5; +pub const SYS_close: ::c_long = 4000 + 6; +pub const SYS_waitpid: ::c_long = 4000 + 7; +pub const SYS_creat: ::c_long = 4000 + 8; +pub const SYS_link: ::c_long = 4000 + 9; +pub const SYS_unlink: ::c_long = 4000 + 10; +pub const SYS_execve: ::c_long = 4000 + 11; +pub const SYS_chdir: ::c_long = 4000 + 12; +pub const SYS_time: ::c_long = 4000 + 13; +pub const SYS_mknod: ::c_long = 4000 + 14; +pub const SYS_chmod: ::c_long = 4000 + 15; +pub const SYS_lchown: ::c_long = 4000 + 16; +pub const SYS_break: ::c_long = 4000 + 17; +pub const SYS_lseek: ::c_long = 4000 + 19; +pub const SYS_getpid: ::c_long = 4000 + 20; +pub const SYS_mount: ::c_long = 4000 + 21; +pub const SYS_umount: ::c_long = 4000 + 22; +pub const SYS_setuid: ::c_long = 4000 + 23; +pub const SYS_getuid: ::c_long = 4000 + 24; +pub const SYS_stime: ::c_long = 4000 + 25; +pub const SYS_ptrace: ::c_long = 4000 + 26; +pub const SYS_alarm: ::c_long = 4000 + 27; +pub const SYS_pause: ::c_long = 4000 + 29; +pub const SYS_utime: ::c_long = 4000 + 30; +pub const SYS_stty: ::c_long = 4000 + 31; +pub const SYS_gtty: ::c_long = 4000 + 32; +pub const SYS_access: ::c_long = 4000 + 33; +pub const SYS_nice: ::c_long = 4000 + 34; +pub const SYS_ftime: ::c_long = 4000 + 35; +pub const SYS_sync: ::c_long = 4000 + 36; +pub const SYS_kill: ::c_long = 4000 + 37; +pub const SYS_rename: ::c_long = 4000 + 38; +pub const SYS_mkdir: ::c_long = 4000 + 39; +pub const SYS_rmdir: ::c_long = 4000 + 40; +pub const SYS_dup: ::c_long = 4000 + 41; +pub const SYS_pipe: ::c_long = 4000 + 42; +pub const SYS_times: ::c_long = 4000 + 43; +pub const SYS_prof: ::c_long = 4000 + 44; +pub const SYS_brk: ::c_long = 4000 + 45; +pub const SYS_setgid: ::c_long = 4000 + 46; +pub const SYS_getgid: ::c_long = 4000 + 47; +pub const SYS_signal: ::c_long = 4000 + 48; +pub const SYS_geteuid: ::c_long = 4000 + 49; +pub const SYS_getegid: ::c_long = 4000 + 50; +pub const SYS_acct: ::c_long = 4000 + 51; +pub const SYS_umount2: ::c_long = 4000 + 52; +pub const SYS_lock: ::c_long = 4000 + 53; +pub const SYS_ioctl: ::c_long = 4000 + 54; +pub const SYS_fcntl: ::c_long = 4000 + 55; +pub const SYS_mpx: ::c_long = 4000 + 56; +pub const SYS_setpgid: ::c_long = 4000 + 57; +pub const SYS_ulimit: ::c_long = 4000 + 58; +pub const SYS_umask: ::c_long = 4000 + 60; +pub const SYS_chroot: ::c_long = 4000 + 61; +pub const SYS_ustat: ::c_long = 4000 + 62; +pub const SYS_dup2: ::c_long = 4000 + 63; +pub const SYS_getppid: ::c_long = 4000 + 64; +pub const SYS_getpgrp: ::c_long = 4000 + 65; +pub const SYS_setsid: ::c_long = 4000 + 66; +pub const SYS_sigaction: ::c_long = 4000 + 67; +pub const SYS_sgetmask: ::c_long = 4000 + 68; +pub const SYS_ssetmask: ::c_long = 4000 + 69; +pub const SYS_setreuid: ::c_long = 4000 + 70; +pub const SYS_setregid: ::c_long = 4000 + 71; +pub const SYS_sigsuspend: ::c_long = 4000 + 72; +pub const SYS_sigpending: ::c_long = 4000 + 73; +pub const SYS_sethostname: ::c_long = 4000 + 74; +pub const SYS_setrlimit: ::c_long = 4000 + 75; +pub const SYS_getrlimit: ::c_long = 4000 + 76; +pub const SYS_getrusage: ::c_long = 4000 + 77; +pub const SYS_gettimeofday: ::c_long = 4000 + 78; +pub const SYS_settimeofday: ::c_long = 4000 + 79; +pub const SYS_getgroups: ::c_long = 4000 + 80; +pub const SYS_setgroups: ::c_long = 4000 + 81; +pub const SYS_symlink: ::c_long = 4000 + 83; +pub const SYS_readlink: ::c_long = 4000 + 85; +pub const SYS_uselib: ::c_long = 4000 + 86; +pub const SYS_swapon: ::c_long = 4000 + 87; +pub const SYS_reboot: ::c_long = 4000 + 88; +pub const SYS_readdir: ::c_long = 4000 + 89; +pub const SYS_mmap: ::c_long = 4000 + 90; +pub const SYS_munmap: ::c_long = 4000 + 91; +pub const SYS_truncate: ::c_long = 4000 + 92; +pub const SYS_ftruncate: ::c_long = 4000 + 93; +pub const SYS_fchmod: ::c_long = 4000 + 94; +pub const SYS_fchown: ::c_long = 4000 + 95; +pub const SYS_getpriority: ::c_long = 4000 + 96; +pub const SYS_setpriority: ::c_long = 4000 + 97; +pub const SYS_profil: ::c_long = 4000 + 98; +pub const SYS_statfs: ::c_long = 4000 + 99; +pub const SYS_fstatfs: ::c_long = 4000 + 100; +pub const SYS_ioperm: ::c_long = 4000 + 101; +pub const SYS_socketcall: ::c_long = 4000 + 102; +pub const SYS_syslog: ::c_long = 4000 + 103; +pub const SYS_setitimer: ::c_long = 4000 + 104; +pub const SYS_getitimer: ::c_long = 4000 + 105; +pub const SYS_stat: ::c_long = 4000 + 106; +pub const SYS_lstat: ::c_long = 4000 + 107; +pub const SYS_fstat: ::c_long = 4000 + 108; +pub const SYS_iopl: ::c_long = 4000 + 110; +pub const SYS_vhangup: ::c_long = 4000 + 111; +pub const SYS_idle: ::c_long = 4000 + 112; +pub const SYS_vm86: ::c_long = 4000 + 113; +pub const SYS_wait4: ::c_long = 4000 + 114; +pub const SYS_swapoff: ::c_long = 4000 + 115; +pub const SYS_sysinfo: ::c_long = 4000 + 116; +pub const SYS_ipc: ::c_long = 4000 + 117; +pub const SYS_fsync: ::c_long = 4000 + 118; +pub const SYS_sigreturn: ::c_long = 4000 + 119; +pub const SYS_clone: ::c_long = 4000 + 120; +pub const SYS_setdomainname: ::c_long = 4000 + 121; +pub const SYS_uname: ::c_long = 4000 + 122; +pub const SYS_modify_ldt: ::c_long = 4000 + 123; +pub const SYS_adjtimex: ::c_long = 4000 + 124; +pub const SYS_mprotect: ::c_long = 4000 + 125; +pub const SYS_sigprocmask: ::c_long = 4000 + 126; +pub const SYS_create_module: ::c_long = 4000 + 127; +pub const SYS_init_module: ::c_long = 4000 + 128; +pub const SYS_delete_module: ::c_long = 4000 + 129; +pub const SYS_get_kernel_syms: ::c_long = 4000 + 130; +pub const SYS_quotactl: ::c_long = 4000 + 131; +pub const SYS_getpgid: ::c_long = 4000 + 132; +pub const SYS_fchdir: ::c_long = 4000 + 133; +pub const SYS_bdflush: ::c_long = 4000 + 134; +pub const SYS_sysfs: ::c_long = 4000 + 135; +pub const SYS_personality: ::c_long = 4000 + 136; +pub const SYS_afs_syscall: ::c_long = 4000 + 137; +pub const SYS_setfsuid: ::c_long = 4000 + 138; +pub const SYS_setfsgid: ::c_long = 4000 + 139; +pub const SYS__llseek: ::c_long = 4000 + 140; +pub const SYS_getdents: ::c_long = 4000 + 141; +pub const SYS_flock: ::c_long = 4000 + 143; +pub const SYS_msync: ::c_long = 4000 + 144; +pub const SYS_readv: ::c_long = 4000 + 145; +pub const SYS_writev: ::c_long = 4000 + 146; +pub const SYS_cacheflush: ::c_long = 4000 + 147; +pub const SYS_cachectl: ::c_long = 4000 + 148; +pub const SYS_sysmips: ::c_long = 4000 + 149; +pub const SYS_getsid: ::c_long = 4000 + 151; +pub const SYS_fdatasync: ::c_long = 4000 + 152; +pub const SYS__sysctl: ::c_long = 4000 + 153; +pub const SYS_mlock: ::c_long = 4000 + 154; +pub const SYS_munlock: ::c_long = 4000 + 155; +pub const SYS_mlockall: ::c_long = 4000 + 156; +pub const SYS_munlockall: ::c_long = 4000 + 157; +pub const SYS_sched_setparam: ::c_long = 4000 + 158; +pub const SYS_sched_getparam: ::c_long = 4000 + 159; +pub const SYS_sched_setscheduler: ::c_long = 4000 + 160; +pub const SYS_sched_getscheduler: ::c_long = 4000 + 161; +pub const SYS_sched_yield: ::c_long = 4000 + 162; +pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163; +pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164; +pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165; +pub const SYS_nanosleep: ::c_long = 4000 + 166; +pub const SYS_mremap: ::c_long = 4000 + 167; +pub const SYS_accept: ::c_long = 4000 + 168; +pub const SYS_bind: ::c_long = 4000 + 169; +pub const SYS_connect: ::c_long = 4000 + 170; +pub const SYS_getpeername: ::c_long = 4000 + 171; +pub const SYS_getsockname: ::c_long = 4000 + 172; +pub const SYS_getsockopt: ::c_long = 4000 + 173; +pub const SYS_listen: ::c_long = 4000 + 174; +pub const SYS_recv: ::c_long = 4000 + 175; +pub const SYS_recvfrom: ::c_long = 4000 + 176; +pub const SYS_recvmsg: ::c_long = 4000 + 177; +pub const SYS_send: ::c_long = 4000 + 178; +pub const SYS_sendmsg: ::c_long = 4000 + 179; +pub const SYS_sendto: ::c_long = 4000 + 180; +pub const SYS_setsockopt: ::c_long = 4000 + 181; +pub const SYS_shutdown: ::c_long = 4000 + 182; +pub const SYS_socket: ::c_long = 4000 + 183; +pub const SYS_socketpair: ::c_long = 4000 + 184; +pub const SYS_setresuid: ::c_long = 4000 + 185; +pub const SYS_getresuid: ::c_long = 4000 + 186; +pub const SYS_query_module: ::c_long = 4000 + 187; +pub const SYS_poll: ::c_long = 4000 + 188; +pub const SYS_nfsservctl: ::c_long = 4000 + 189; +pub const SYS_setresgid: ::c_long = 4000 + 190; +pub const SYS_getresgid: ::c_long = 4000 + 191; +pub const SYS_prctl: ::c_long = 4000 + 192; +pub const SYS_rt_sigreturn: ::c_long = 4000 + 193; +pub const SYS_rt_sigaction: ::c_long = 4000 + 194; +pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195; +pub const SYS_rt_sigpending: ::c_long = 4000 + 196; +pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197; +pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198; +pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199; +pub const SYS_chown: ::c_long = 4000 + 202; +pub const SYS_getcwd: ::c_long = 4000 + 203; +pub const SYS_capget: ::c_long = 4000 + 204; +pub const SYS_capset: ::c_long = 4000 + 205; +pub const SYS_sigaltstack: ::c_long = 4000 + 206; +pub const SYS_sendfile: ::c_long = 4000 + 207; +pub const SYS_getpmsg: ::c_long = 4000 + 208; +pub const SYS_putpmsg: ::c_long = 4000 + 209; +pub const SYS_mmap2: ::c_long = 4000 + 210; +pub const SYS_truncate64: ::c_long = 4000 + 211; +pub const SYS_ftruncate64: ::c_long = 4000 + 212; +pub const SYS_stat64: ::c_long = 4000 + 213; +pub const SYS_lstat64: ::c_long = 4000 + 214; +pub const SYS_fstat64: ::c_long = 4000 + 215; +pub const SYS_pivot_root: ::c_long = 4000 + 216; +pub const SYS_mincore: ::c_long = 4000 + 217; +pub const SYS_madvise: ::c_long = 4000 + 218; +pub const SYS_getdents64: ::c_long = 4000 + 219; +pub const SYS_fcntl64: ::c_long = 4000 + 220; +pub const SYS_gettid: ::c_long = 4000 + 222; +pub const SYS_readahead: ::c_long = 4000 + 223; +pub const SYS_setxattr: ::c_long = 4000 + 224; +pub const SYS_lsetxattr: ::c_long = 4000 + 225; +pub const SYS_fsetxattr: ::c_long = 4000 + 226; +pub const SYS_getxattr: ::c_long = 4000 + 227; +pub const SYS_lgetxattr: ::c_long = 4000 + 228; +pub const SYS_fgetxattr: ::c_long = 4000 + 229; +pub const SYS_listxattr: ::c_long = 4000 + 230; +pub const SYS_llistxattr: ::c_long = 4000 + 231; +pub const SYS_flistxattr: ::c_long = 4000 + 232; +pub const SYS_removexattr: ::c_long = 4000 + 233; +pub const SYS_lremovexattr: ::c_long = 4000 + 234; +pub const SYS_fremovexattr: ::c_long = 4000 + 235; +pub const SYS_tkill: ::c_long = 4000 + 236; +pub const SYS_sendfile64: ::c_long = 4000 + 237; +pub const SYS_futex: ::c_long = 4000 + 238; +pub const SYS_sched_setaffinity: ::c_long = 4000 + 239; +pub const SYS_sched_getaffinity: ::c_long = 4000 + 240; +pub const SYS_io_setup: ::c_long = 4000 + 241; +pub const SYS_io_destroy: ::c_long = 4000 + 242; +pub const SYS_io_getevents: ::c_long = 4000 + 243; +pub const SYS_io_submit: ::c_long = 4000 + 244; +pub const SYS_io_cancel: ::c_long = 4000 + 245; +pub const SYS_exit_group: ::c_long = 4000 + 246; +pub const SYS_lookup_dcookie: ::c_long = 4000 + 247; +pub const SYS_epoll_create: ::c_long = 4000 + 248; +pub const SYS_epoll_ctl: ::c_long = 4000 + 249; +pub const SYS_epoll_wait: ::c_long = 4000 + 250; +pub const SYS_remap_file_pages: ::c_long = 4000 + 251; +pub const SYS_set_tid_address: ::c_long = 4000 + 252; +pub const SYS_restart_syscall: ::c_long = 4000 + 253; +pub const SYS_statfs64: ::c_long = 4000 + 255; +pub const SYS_fstatfs64: ::c_long = 4000 + 256; +pub const SYS_timer_create: ::c_long = 4000 + 257; +pub const SYS_timer_settime: ::c_long = 4000 + 258; +pub const SYS_timer_gettime: ::c_long = 4000 + 259; +pub const SYS_timer_getoverrun: ::c_long = 4000 + 260; +pub const SYS_timer_delete: ::c_long = 4000 + 261; +pub const SYS_clock_settime: ::c_long = 4000 + 262; +pub const SYS_clock_gettime: ::c_long = 4000 + 263; +pub const SYS_clock_getres: ::c_long = 4000 + 264; +pub const SYS_clock_nanosleep: ::c_long = 4000 + 265; +pub const SYS_tgkill: ::c_long = 4000 + 266; +pub const SYS_utimes: ::c_long = 4000 + 267; +pub const SYS_mbind: ::c_long = 4000 + 268; +pub const SYS_get_mempolicy: ::c_long = 4000 + 269; +pub const SYS_set_mempolicy: ::c_long = 4000 + 270; +pub const SYS_mq_open: ::c_long = 4000 + 271; +pub const SYS_mq_unlink: ::c_long = 4000 + 272; +pub const SYS_mq_timedsend: ::c_long = 4000 + 273; +pub const SYS_mq_timedreceive: ::c_long = 4000 + 274; +pub const SYS_mq_notify: ::c_long = 4000 + 275; +pub const SYS_mq_getsetattr: ::c_long = 4000 + 276; +pub const SYS_vserver: ::c_long = 4000 + 277; +pub const SYS_waitid: ::c_long = 4000 + 278; +/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */ +pub const SYS_add_key: ::c_long = 4000 + 280; +pub const SYS_request_key: ::c_long = 4000 + 281; +pub const SYS_keyctl: ::c_long = 4000 + 282; +pub const SYS_set_thread_area: ::c_long = 4000 + 283; +pub const SYS_inotify_init: ::c_long = 4000 + 284; +pub const SYS_inotify_add_watch: ::c_long = 4000 + 285; +pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286; +pub const SYS_migrate_pages: ::c_long = 4000 + 287; +pub const SYS_openat: ::c_long = 4000 + 288; +pub const SYS_mkdirat: ::c_long = 4000 + 289; +pub const SYS_mknodat: ::c_long = 4000 + 290; +pub const SYS_fchownat: ::c_long = 4000 + 291; +pub const SYS_futimesat: ::c_long = 4000 + 292; +pub const SYS_unlinkat: ::c_long = 4000 + 294; +pub const SYS_renameat: ::c_long = 4000 + 295; +pub const SYS_linkat: ::c_long = 4000 + 296; +pub const SYS_symlinkat: ::c_long = 4000 + 297; +pub const SYS_readlinkat: ::c_long = 4000 + 298; +pub const SYS_fchmodat: ::c_long = 4000 + 299; +pub const SYS_faccessat: ::c_long = 4000 + 300; +pub const SYS_pselect6: ::c_long = 4000 + 301; +pub const SYS_ppoll: ::c_long = 4000 + 302; +pub const SYS_unshare: ::c_long = 4000 + 303; +pub const SYS_splice: ::c_long = 4000 + 304; +pub const SYS_sync_file_range: ::c_long = 4000 + 305; +pub const SYS_tee: ::c_long = 4000 + 306; +pub const SYS_vmsplice: ::c_long = 4000 + 307; +pub const SYS_move_pages: ::c_long = 4000 + 308; +pub const SYS_set_robust_list: ::c_long = 4000 + 309; +pub const SYS_get_robust_list: ::c_long = 4000 + 310; +pub const SYS_kexec_load: ::c_long = 4000 + 311; +pub const SYS_getcpu: ::c_long = 4000 + 312; +pub const SYS_epoll_pwait: ::c_long = 4000 + 313; +pub const SYS_ioprio_set: ::c_long = 4000 + 314; +pub const SYS_ioprio_get: ::c_long = 4000 + 315; +pub const SYS_utimensat: ::c_long = 4000 + 316; +pub const SYS_signalfd: ::c_long = 4000 + 317; +pub const SYS_timerfd: ::c_long = 4000 + 318; +pub const SYS_eventfd: ::c_long = 4000 + 319; +pub const SYS_fallocate: ::c_long = 4000 + 320; +pub const SYS_timerfd_create: ::c_long = 4000 + 321; +pub const SYS_timerfd_gettime: ::c_long = 4000 + 322; +pub const SYS_timerfd_settime: ::c_long = 4000 + 323; +pub const SYS_signalfd4: ::c_long = 4000 + 324; +pub const SYS_eventfd2: ::c_long = 4000 + 325; +pub const SYS_epoll_create1: ::c_long = 4000 + 326; +pub const SYS_dup3: ::c_long = 4000 + 327; +pub const SYS_pipe2: ::c_long = 4000 + 328; +pub const SYS_inotify_init1: ::c_long = 4000 + 329; +pub const SYS_preadv: ::c_long = 4000 + 330; +pub const SYS_pwritev: ::c_long = 4000 + 331; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332; +pub const SYS_perf_event_open: ::c_long = 4000 + 333; +pub const SYS_accept4: ::c_long = 4000 + 334; +pub const SYS_recvmmsg: ::c_long = 4000 + 335; +pub const SYS_fanotify_init: ::c_long = 4000 + 336; +pub const SYS_fanotify_mark: ::c_long = 4000 + 337; +pub const SYS_prlimit64: ::c_long = 4000 + 338; +pub const SYS_name_to_handle_at: ::c_long = 4000 + 339; +pub const SYS_open_by_handle_at: ::c_long = 4000 + 340; +pub const SYS_clock_adjtime: ::c_long = 4000 + 341; +pub const SYS_syncfs: ::c_long = 4000 + 342; +pub const SYS_sendmmsg: ::c_long = 4000 + 343; +pub const SYS_setns: ::c_long = 4000 + 344; +pub const SYS_process_vm_readv: ::c_long = 4000 + 345; +pub const SYS_process_vm_writev: ::c_long = 4000 + 346; +pub const SYS_kcmp: ::c_long = 4000 + 347; +pub const SYS_finit_module: ::c_long = 4000 + 348; +pub const SYS_sched_setattr: ::c_long = 4000 + 349; +pub const SYS_sched_getattr: ::c_long = 4000 + 350; +pub const SYS_renameat2: ::c_long = 4000 + 351; +pub const SYS_seccomp: ::c_long = 4000 + 352; +pub const SYS_getrandom: ::c_long = 4000 + 353; +pub const SYS_memfd_create: ::c_long = 4000 + 354; +pub const SYS_bpf: ::c_long = 4000 + 355; +pub const SYS_execveat: ::c_long = 4000 + 356; +pub const SYS_userfaultfd: ::c_long = 4000 + 357; +pub const SYS_membarrier: ::c_long = 4000 + 358; +pub const SYS_mlock2: ::c_long = 4000 + 359; +pub const SYS_copy_file_range: ::c_long = 4000 + 360; +pub const SYS_preadv2: ::c_long = 4000 + 361; +pub const SYS_pwritev2: ::c_long = 4000 + 362; +pub const SYS_pkey_mprotect: ::c_long = 4000 + 363; +pub const SYS_pkey_alloc: ::c_long = 4000 + 364; +pub const SYS_pkey_free: ::c_long = 4000 + 365; +pub const SYS_statx: ::c_long = 4000 + 366; +pub const SYS_pidfd_send_signal: ::c_long = 4000 + 424; +pub const SYS_io_uring_setup: ::c_long = 4000 + 425; +pub const SYS_io_uring_enter: ::c_long = 4000 + 426; +pub const SYS_io_uring_register: ::c_long = 4000 + 427; +pub const SYS_open_tree: ::c_long = 4000 + 428; +pub const SYS_move_mount: ::c_long = 4000 + 429; +pub const SYS_fsopen: ::c_long = 4000 + 430; +pub const SYS_fsconfig: ::c_long = 4000 + 431; +pub const SYS_fsmount: ::c_long = 4000 + 432; +pub const SYS_fspick: ::c_long = 4000 + 433; +pub const SYS_pidfd_open: ::c_long = 4000 + 434; +pub const SYS_clone3: ::c_long = 4000 + 435; +pub const SYS_close_range: ::c_long = 4000 + 436; +pub const SYS_openat2: ::c_long = 4000 + 437; +pub const SYS_pidfd_getfd: ::c_long = 4000 + 438; +pub const SYS_faccessat2: ::c_long = 4000 + 439; +pub const SYS_process_madvise: ::c_long = 4000 + 440; +pub const SYS_epoll_pwait2: ::c_long = 4000 + 441; +pub const SYS_mount_setattr: ::c_long = 4000 + 442; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..6d2ecf2d835384a9876a136f33b6ae45a73be1bd --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/mod.rs @@ -0,0 +1,63 @@ +pub type c_long = i32; +pub type c_ulong = u32; +pub type nlink_t = u32; +pub type blksize_t = ::c_long; +pub type __u64 = ::c_ulonglong; +pub type regoff_t = ::c_int; + +s! { + pub struct pthread_attr_t { + __size: [u32; 9] + } + + pub struct sigset_t { + __val: [::c_ulong; 32], + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::c_int, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::socklen_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: ::socklen_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct sem_t { + __val: [::c_int; 4], + } +} + +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; + +cfg_if! { + if #[cfg(any(target_arch = "x86"))] { + mod x86; + pub use self::x86::*; + } else if #[cfg(any(target_arch = "mips"))] { + mod mips; + pub use self::mips::*; + } else if #[cfg(any(target_arch = "arm"))] { + mod arm; + pub use self::arm::*; + } else if #[cfg(any(target_arch = "powerpc"))] { + mod powerpc; + pub use self::powerpc::*; + } else if #[cfg(any(target_arch = "hexagon"))] { + mod hexagon; + pub use self::hexagon::*; + } else if #[cfg(any(target_arch = "riscv32"))] { + mod riscv32; + pub use self::riscv32::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs new file mode 100644 index 0000000000000000000000000000000000000000..d7ca03813e90be76fa65d68dfe6e924f7490d7b9 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/powerpc.rs @@ -0,0 +1,796 @@ +pub type c_char = u8; +pub type wchar_t = i32; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __st_rdev_padding: ::c_short, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 2], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __st_rdev_padding: ::c_short, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 2], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __pad1: ::c_int, + __pad2: ::c_longlong, + __pad3: ::c_longlong + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + __unused1: ::c_int, + pub shm_atime: ::time_t, + __unused2: ::c_int, + pub shm_dtime: ::time_t, + __unused3: ::c_int, + pub shm_ctime: ::time_t, + __unused4: ::c_int, + pub shm_segsz: ::size_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::c_ulong, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + __unused1: ::c_int, + pub msg_stime: ::time_t, + __unused2: ::c_int, + pub msg_rtime: ::time_t, + __unused3: ::c_int, + pub msg_ctime: ::time_t, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct statfs { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + #[cfg(target_endian = "little")] + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + #[cfg(target_endian = "big")] + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } +} + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const SIGSTKSZ: ::size_t = 10240; +pub const MINSIGSTKSZ: ::size_t = 4096; + +pub const O_DIRECT: ::c_int = 0x20000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_LARGEFILE: ::c_int = 0x10000; + +pub const MCL_CURRENT: ::c_int = 0x2000; +pub const MCL_FUTURE: ::c_int = 0x4000; +pub const CBAUD: ::tcflag_t = 0o0000377; +pub const TAB1: ::c_int = 0x00000400; +pub const TAB2: ::c_int = 0x00000800; +pub const TAB3: ::c_int = 0x00000C00; +pub const CR1: ::c_int = 0x00001000; +pub const CR2: ::c_int = 0x00002000; +pub const CR3: ::c_int = 0x00003000; +pub const FF1: ::c_int = 0x00004000; +pub const BS1: ::c_int = 0x00008000; +pub const VT1: ::c_int = 0x00010000; +pub const VWERASE: usize = 10; +pub const VREPRINT: usize = 11; +pub const VSUSP: usize = 12; +pub const VSTART: usize = 13; +pub const VSTOP: usize = 14; +pub const VDISCARD: usize = 16; +pub const VTIME: usize = 7; +pub const IXON: ::tcflag_t = 0x00000200; +pub const IXOFF: ::tcflag_t = 0x00000400; +pub const ONLCR: ::tcflag_t = 0x00000002; +pub const CSIZE: ::tcflag_t = 0x00000300; +pub const CS6: ::tcflag_t = 0x00000100; +pub const CS7: ::tcflag_t = 0x00000200; +pub const CS8: ::tcflag_t = 0x00000300; +pub const CSTOPB: ::tcflag_t = 0x00000400; +pub const CREAD: ::tcflag_t = 0x00000800; +pub const PARENB: ::tcflag_t = 0x00001000; +pub const PARODD: ::tcflag_t = 0x00002000; +pub const HUPCL: ::tcflag_t = 0x00004000; +pub const CLOCAL: ::tcflag_t = 0x00008000; +pub const ECHOKE: ::tcflag_t = 0x00000001; +pub const ECHOE: ::tcflag_t = 0x00000002; +pub const ECHOK: ::tcflag_t = 0x00000004; +pub const ECHONL: ::tcflag_t = 0x00000010; +pub const ECHOPRT: ::tcflag_t = 0x00000020; +pub const ECHOCTL: ::tcflag_t = 0x00000040; +pub const ISIG: ::tcflag_t = 0x00000080; +pub const ICANON: ::tcflag_t = 0x00000100; +pub const PENDIN: ::tcflag_t = 0x20000000; +pub const NOFLSH: ::tcflag_t = 0x80000000; +pub const CIBAUD: ::tcflag_t = 0o00077600000; +pub const CBAUDEX: ::tcflag_t = 0o000020; +pub const VSWTC: usize = 9; +pub const OLCUC: ::tcflag_t = 0o000004; +pub const NLDLY: ::tcflag_t = 0o001400; +pub const CRDLY: ::tcflag_t = 0o030000; +pub const TABDLY: ::tcflag_t = 0o006000; +pub const BSDLY: ::tcflag_t = 0o100000; +pub const FFDLY: ::tcflag_t = 0o040000; +pub const VTDLY: ::tcflag_t = 0o200000; +pub const XTABS: ::tcflag_t = 0o006000; +pub const B57600: ::speed_t = 0o000020; +pub const B115200: ::speed_t = 0o000021; +pub const B230400: ::speed_t = 0o000022; +pub const B460800: ::speed_t = 0o000023; +pub const B500000: ::speed_t = 0o000024; +pub const B576000: ::speed_t = 0o000025; +pub const B921600: ::speed_t = 0o000026; +pub const B1000000: ::speed_t = 0o000027; +pub const B1152000: ::speed_t = 0o000030; +pub const B1500000: ::speed_t = 0o000031; +pub const B2000000: ::speed_t = 0o000032; +pub const B2500000: ::speed_t = 0o000033; +pub const B3000000: ::speed_t = 0o000034; +pub const B3500000: ::speed_t = 0o000035; +pub const B4000000: ::speed_t = 0o000036; + +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; + +pub const SOCK_NONBLOCK: ::c_int = 2048; + +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_LOCKED: ::c_int = 0x00080; +pub const MAP_NORESERVE: ::c_int = 0x00040; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_SEQPACKET: ::c_int = 5; + +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EDEADLOCK: ::c_int = 58; +pub const EMULTIHOP: ::c_int = 72; +pub const EBADMSG: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const ERFKILL: ::c_int = 132; +pub const EHWPOISON: ::c_int = 133; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const EXTPROC: ::tcflag_t = 0x10000000; + +pub const MAP_HUGETLB: ::c_int = 0x040000; + +pub const F_GETLK: ::c_int = 12; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETLK: ::c_int = 13; +pub const F_SETLKW: ::c_int = 14; +pub const F_SETOWN: ::c_int = 8; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const VEOF: usize = 4; +pub const VEOL: usize = 6; +pub const VEOL2: usize = 8; +pub const VMIN: usize = 5; +pub const IEXTEN: ::tcflag_t = 0x00000400; +pub const TOSTOP: ::tcflag_t = 0x00400000; +pub const FLUSHO: ::tcflag_t = 0x00800000; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_waitpid: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_time: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_break: ::c_long = 17; +pub const SYS_oldstat: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_stime: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_oldfstat: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_stty: ::c_long = 31; +pub const SYS_gtty: ::c_long = 32; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_ftime: ::c_long = 35; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_prof: ::c_long = 44; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_lock: ::c_long = 53; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_mpx: ::c_long = 56; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_ulimit: ::c_long = 58; +pub const SYS_oldolduname: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sgetmask: ::c_long = 68; +pub const SYS_ssetmask: ::c_long = 69; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrlimit: ::c_long = 76; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_select: ::c_long = 82; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_oldlstat: ::c_long = 84; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_profil: ::c_long = 98; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_ioperm: ::c_long = 101; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_olduname: ::c_long = 109; +pub const SYS_iopl: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_vm86: ::c_long = 113; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_modify_ldt: ::c_long = 123; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_query_module: ::c_long = 166; +pub const SYS_poll: ::c_long = 167; +pub const SYS_nfsservctl: ::c_long = 168; +pub const SYS_setresgid: ::c_long = 169; +pub const SYS_getresgid: ::c_long = 170; +pub const SYS_prctl: ::c_long = 171; +pub const SYS_rt_sigreturn: ::c_long = 172; +pub const SYS_rt_sigaction: ::c_long = 173; +pub const SYS_rt_sigprocmask: ::c_long = 174; +pub const SYS_rt_sigpending: ::c_long = 175; +pub const SYS_rt_sigtimedwait: ::c_long = 176; +pub const SYS_rt_sigqueueinfo: ::c_long = 177; +pub const SYS_rt_sigsuspend: ::c_long = 178; +pub const SYS_pread64: ::c_long = 179; +pub const SYS_pwrite64: ::c_long = 180; +pub const SYS_chown: ::c_long = 181; +pub const SYS_getcwd: ::c_long = 182; +pub const SYS_capget: ::c_long = 183; +pub const SYS_capset: ::c_long = 184; +pub const SYS_sigaltstack: ::c_long = 185; +pub const SYS_sendfile: ::c_long = 186; +pub const SYS_getpmsg: ::c_long = 187; +pub const SYS_putpmsg: ::c_long = 188; +pub const SYS_vfork: ::c_long = 189; +pub const SYS_ugetrlimit: ::c_long = 190; +pub const SYS_readahead: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_pciconfig_read: ::c_long = 198; +pub const SYS_pciconfig_write: ::c_long = 199; +pub const SYS_pciconfig_iobase: ::c_long = 200; +pub const SYS_multiplexer: ::c_long = 201; +pub const SYS_getdents64: ::c_long = 202; +pub const SYS_pivot_root: ::c_long = 203; +pub const SYS_fcntl64: ::c_long = 204; +pub const SYS_madvise: ::c_long = 205; +pub const SYS_mincore: ::c_long = 206; +pub const SYS_gettid: ::c_long = 207; +pub const SYS_tkill: ::c_long = 208; +pub const SYS_setxattr: ::c_long = 209; +pub const SYS_lsetxattr: ::c_long = 210; +pub const SYS_fsetxattr: ::c_long = 211; +pub const SYS_getxattr: ::c_long = 212; +pub const SYS_lgetxattr: ::c_long = 213; +pub const SYS_fgetxattr: ::c_long = 214; +pub const SYS_listxattr: ::c_long = 215; +pub const SYS_llistxattr: ::c_long = 216; +pub const SYS_flistxattr: ::c_long = 217; +pub const SYS_removexattr: ::c_long = 218; +pub const SYS_lremovexattr: ::c_long = 219; +pub const SYS_fremovexattr: ::c_long = 220; +pub const SYS_futex: ::c_long = 221; +pub const SYS_sched_setaffinity: ::c_long = 222; +pub const SYS_sched_getaffinity: ::c_long = 223; +pub const SYS_tuxcall: ::c_long = 225; +pub const SYS_sendfile64: ::c_long = 226; +pub const SYS_io_setup: ::c_long = 227; +pub const SYS_io_destroy: ::c_long = 228; +pub const SYS_io_getevents: ::c_long = 229; +pub const SYS_io_submit: ::c_long = 230; +pub const SYS_io_cancel: ::c_long = 231; +pub const SYS_set_tid_address: ::c_long = 232; +pub const SYS_fadvise64: ::c_long = 233; +pub const SYS_exit_group: ::c_long = 234; +pub const SYS_lookup_dcookie: ::c_long = 235; +pub const SYS_epoll_create: ::c_long = 236; +pub const SYS_epoll_ctl: ::c_long = 237; +pub const SYS_epoll_wait: ::c_long = 238; +pub const SYS_remap_file_pages: ::c_long = 239; +pub const SYS_timer_create: ::c_long = 240; +pub const SYS_timer_settime: ::c_long = 241; +pub const SYS_timer_gettime: ::c_long = 242; +pub const SYS_timer_getoverrun: ::c_long = 243; +pub const SYS_timer_delete: ::c_long = 244; +pub const SYS_clock_settime: ::c_long = 245; +pub const SYS_clock_gettime: ::c_long = 246; +pub const SYS_clock_getres: ::c_long = 247; +pub const SYS_clock_nanosleep: ::c_long = 248; +pub const SYS_swapcontext: ::c_long = 249; +pub const SYS_tgkill: ::c_long = 250; +pub const SYS_utimes: ::c_long = 251; +pub const SYS_statfs64: ::c_long = 252; +pub const SYS_fstatfs64: ::c_long = 253; +pub const SYS_fadvise64_64: ::c_long = 254; +pub const SYS_rtas: ::c_long = 255; +pub const SYS_sys_debug_setcontext: ::c_long = 256; +pub const SYS_migrate_pages: ::c_long = 258; +pub const SYS_mbind: ::c_long = 259; +pub const SYS_get_mempolicy: ::c_long = 260; +pub const SYS_set_mempolicy: ::c_long = 261; +pub const SYS_mq_open: ::c_long = 262; +pub const SYS_mq_unlink: ::c_long = 263; +pub const SYS_mq_timedsend: ::c_long = 264; +pub const SYS_mq_timedreceive: ::c_long = 265; +pub const SYS_mq_notify: ::c_long = 266; +pub const SYS_mq_getsetattr: ::c_long = 267; +pub const SYS_kexec_load: ::c_long = 268; +pub const SYS_add_key: ::c_long = 269; +pub const SYS_request_key: ::c_long = 270; +pub const SYS_keyctl: ::c_long = 271; +pub const SYS_waitid: ::c_long = 272; +pub const SYS_ioprio_set: ::c_long = 273; +pub const SYS_ioprio_get: ::c_long = 274; +pub const SYS_inotify_init: ::c_long = 275; +pub const SYS_inotify_add_watch: ::c_long = 276; +pub const SYS_inotify_rm_watch: ::c_long = 277; +pub const SYS_spu_run: ::c_long = 278; +pub const SYS_spu_create: ::c_long = 279; +pub const SYS_pselect6: ::c_long = 280; +pub const SYS_ppoll: ::c_long = 281; +pub const SYS_unshare: ::c_long = 282; +pub const SYS_splice: ::c_long = 283; +pub const SYS_tee: ::c_long = 284; +pub const SYS_vmsplice: ::c_long = 285; +pub const SYS_openat: ::c_long = 286; +pub const SYS_mkdirat: ::c_long = 287; +pub const SYS_mknodat: ::c_long = 288; +pub const SYS_fchownat: ::c_long = 289; +pub const SYS_futimesat: ::c_long = 290; +pub const SYS_fstatat64: ::c_long = 291; +pub const SYS_unlinkat: ::c_long = 292; +pub const SYS_renameat: ::c_long = 293; +pub const SYS_linkat: ::c_long = 294; +pub const SYS_symlinkat: ::c_long = 295; +pub const SYS_readlinkat: ::c_long = 296; +pub const SYS_fchmodat: ::c_long = 297; +pub const SYS_faccessat: ::c_long = 298; +pub const SYS_get_robust_list: ::c_long = 299; +pub const SYS_set_robust_list: ::c_long = 300; +pub const SYS_move_pages: ::c_long = 301; +pub const SYS_getcpu: ::c_long = 302; +pub const SYS_epoll_pwait: ::c_long = 303; +pub const SYS_utimensat: ::c_long = 304; +pub const SYS_signalfd: ::c_long = 305; +pub const SYS_timerfd_create: ::c_long = 306; +pub const SYS_eventfd: ::c_long = 307; +pub const SYS_sync_file_range2: ::c_long = 308; +pub const SYS_fallocate: ::c_long = 309; +pub const SYS_subpage_prot: ::c_long = 310; +pub const SYS_timerfd_settime: ::c_long = 311; +pub const SYS_timerfd_gettime: ::c_long = 312; +pub const SYS_signalfd4: ::c_long = 313; +pub const SYS_eventfd2: ::c_long = 314; +pub const SYS_epoll_create1: ::c_long = 315; +pub const SYS_dup3: ::c_long = 316; +pub const SYS_pipe2: ::c_long = 317; +pub const SYS_inotify_init1: ::c_long = 318; +pub const SYS_perf_event_open: ::c_long = 319; +pub const SYS_preadv: ::c_long = 320; +pub const SYS_pwritev: ::c_long = 321; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 322; +pub const SYS_fanotify_init: ::c_long = 323; +pub const SYS_fanotify_mark: ::c_long = 324; +pub const SYS_prlimit64: ::c_long = 325; +pub const SYS_socket: ::c_long = 326; +pub const SYS_bind: ::c_long = 327; +pub const SYS_connect: ::c_long = 328; +pub const SYS_listen: ::c_long = 329; +pub const SYS_accept: ::c_long = 330; +pub const SYS_getsockname: ::c_long = 331; +pub const SYS_getpeername: ::c_long = 332; +pub const SYS_socketpair: ::c_long = 333; +pub const SYS_send: ::c_long = 334; +pub const SYS_sendto: ::c_long = 335; +pub const SYS_recv: ::c_long = 336; +pub const SYS_recvfrom: ::c_long = 337; +pub const SYS_shutdown: ::c_long = 338; +pub const SYS_setsockopt: ::c_long = 339; +pub const SYS_getsockopt: ::c_long = 340; +pub const SYS_sendmsg: ::c_long = 341; +pub const SYS_recvmsg: ::c_long = 342; +pub const SYS_recvmmsg: ::c_long = 343; +pub const SYS_accept4: ::c_long = 344; +pub const SYS_name_to_handle_at: ::c_long = 345; +pub const SYS_open_by_handle_at: ::c_long = 346; +pub const SYS_clock_adjtime: ::c_long = 347; +pub const SYS_syncfs: ::c_long = 348; +pub const SYS_sendmmsg: ::c_long = 349; +pub const SYS_setns: ::c_long = 350; +pub const SYS_process_vm_readv: ::c_long = 351; +pub const SYS_process_vm_writev: ::c_long = 352; +pub const SYS_finit_module: ::c_long = 353; +pub const SYS_kcmp: ::c_long = 354; +pub const SYS_sched_setattr: ::c_long = 355; +pub const SYS_sched_getattr: ::c_long = 356; +pub const SYS_renameat2: ::c_long = 357; +pub const SYS_seccomp: ::c_long = 358; +pub const SYS_getrandom: ::c_long = 359; +pub const SYS_memfd_create: ::c_long = 360; +pub const SYS_bpf: ::c_long = 361; +pub const SYS_execveat: ::c_long = 362; +pub const SYS_switch_endian: ::c_long = 363; +pub const SYS_userfaultfd: ::c_long = 364; +pub const SYS_membarrier: ::c_long = 365; +pub const SYS_mlock2: ::c_long = 378; +pub const SYS_copy_file_range: ::c_long = 379; +pub const SYS_preadv2: ::c_long = 380; +pub const SYS_pwritev2: ::c_long = 381; +pub const SYS_kexec_file_load: ::c_long = 382; +pub const SYS_statx: ::c_long = 383; +pub const SYS_pkey_alloc: ::c_long = 384; +pub const SYS_pkey_free: ::c_long = 385; +pub const SYS_pkey_mprotect: ::c_long = 386; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +extern "C" { + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..048268c96b7a72755dcd468efa1f18f84bc52d60 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(8))] + pub struct max_align_t { + priv_: (i64, f64) + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..9b68ce2585679b8d9a6cb90a4390630ccba2ab6e --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs @@ -0,0 +1,807 @@ +//! RISC-V-specific definitions for 32-bit linux-like values + +pub type c_char = u8; +pub type wchar_t = ::c_int; + +s! { + pub struct pthread_attr_t { + __size: [::c_ulong; 7], + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub __pad1: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub __pad2: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2usize], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub __pad1: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub __pad2: ::c_int, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2], + } + + pub struct statfs { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_long, + pub f_frsize: ::c_long, + pub f_flags: ::c_long, + pub f_spare: [::c_long; 4], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + pub __f_spare: [::c_int; 6], + } + + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [u64; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t, + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_ushort, + __pad1: ::c_ushort, + pub __seq: ::c_ushort, + __pad2: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused5: ::c_ulong, + __unused6: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + __unused1: ::c_int, + pub msg_rtime: ::time_t, + __unused2: ::c_int, + pub msg_ctime: ::time_t, + __unused3: ::c_int, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } +} + +//pub const RLIM_INFINITY: ::rlim_t = !0; +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const TIOCGSOFTCAR: ::c_ulong = 21529; +pub const TIOCSSOFTCAR: ::c_ulong = 21530; +pub const TIOCGRS485: ::c_int = 21550; +pub const TIOCSRS485: ::c_int = 21551; +//pub const RLIMIT_RSS: ::__rlimit_resource_t = 5; +//pub const RLIMIT_AS: ::__rlimit_resource_t = 9; +//pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8; +//pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7; +//pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 1052672; +pub const MAP_GROWSDOWN: ::c_int = 256; +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SA_ONSTACK: ::c_int = 8; +pub const SA_SIGINFO: ::c_int = 4; +pub const SA_NOCLDWAIT: ::c_int = 2; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0; +pub const SIG_UNBLOCK: ::c_int = 1; +pub const POLLWRNORM: ::c_short = 256; +pub const POLLWRBAND: ::c_short = 512; +pub const O_ASYNC: ::c_int = 8192; +pub const O_NDELAY: ::c_int = 2048; +pub const EFD_NONBLOCK: ::c_int = 2048; +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; +pub const SFD_NONBLOCK: ::c_int = 2048; +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; +pub const TIOCLINUX: ::c_ulong = 21532; +pub const TIOCGSERIAL: ::c_ulong = 21534; +pub const TIOCEXCL: ::c_ulong = 21516; +pub const TIOCNXCL: ::c_ulong = 21517; +pub const TIOCSCTTY: ::c_ulong = 21518; +pub const TIOCSTI: ::c_ulong = 21522; +pub const TIOCMGET: ::c_ulong = 21525; +pub const TIOCMBIS: ::c_ulong = 21526; +pub const TIOCMBIC: ::c_ulong = 21527; +pub const TIOCMSET: ::c_ulong = 21528; +pub const TIOCCONS: ::c_ulong = 21533; +pub const TIOCM_ST: ::c_int = 8; +pub const TIOCM_SR: ::c_int = 16; +pub const TIOCM_CTS: ::c_int = 32; +pub const TIOCM_CAR: ::c_int = 64; +pub const TIOCM_RNG: ::c_int = 128; +pub const TIOCM_DSR: ::c_int = 256; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const O_DIRECT: ::c_int = 16384; +pub const O_DIRECTORY: ::c_int = 65536; +pub const O_NOFOLLOW: ::c_int = 131072; +pub const MAP_HUGETLB: ::c_int = 262144; +pub const MAP_LOCKED: ::c_int = 8192; +pub const MAP_NORESERVE: ::c_int = 16384; +pub const MAP_ANON: ::c_int = 32; +pub const MAP_ANONYMOUS: ::c_int = 32; +pub const MAP_DENYWRITE: ::c_int = 2048; +pub const MAP_EXECUTABLE: ::c_int = 4096; +pub const MAP_POPULATE: ::c_int = 32768; +pub const MAP_NONBLOCK: ::c_int = 65536; +pub const MAP_STACK: ::c_int = 131072; +pub const MAP_SYNC: ::c_int = 0x080000; +pub const EDEADLOCK: ::c_int = 35; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const FIOCLEX: ::c_int = 21585; +pub const FIONCLEX: ::c_int = 21584; +pub const FIONBIO: ::c_int = 21537; +pub const MCL_CURRENT: ::c_int = 1; +pub const MCL_FUTURE: ::c_int = 2; +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const CBAUD: ::tcflag_t = 4111; +pub const TAB1: ::tcflag_t = 2048; +pub const TAB2: ::tcflag_t = 4096; +pub const TAB3: ::tcflag_t = 6144; +pub const CR1: ::tcflag_t = 512; +pub const CR2: ::tcflag_t = 1024; +pub const CR3: ::tcflag_t = 1536; +pub const FF1: ::tcflag_t = 32768; +pub const BS1: ::tcflag_t = 8192; +pub const VT1: ::tcflag_t = 16384; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 1024; +pub const IXOFF: ::tcflag_t = 4096; +pub const ONLCR: ::tcflag_t = 4; +pub const CSIZE: ::tcflag_t = 48; +pub const CS6: ::tcflag_t = 16; +pub const CS7: ::tcflag_t = 32; +pub const CS8: ::tcflag_t = 48; +pub const CSTOPB: ::tcflag_t = 64; +pub const CREAD: ::tcflag_t = 128; +pub const PARENB: ::tcflag_t = 256; +pub const PARODD: ::tcflag_t = 512; +pub const HUPCL: ::tcflag_t = 1024; +pub const CLOCAL: ::tcflag_t = 2048; +pub const ECHOKE: ::tcflag_t = 2048; +pub const ECHOE: ::tcflag_t = 16; +pub const ECHOK: ::tcflag_t = 32; +pub const ECHONL: ::tcflag_t = 64; +pub const ECHOPRT: ::tcflag_t = 1024; +pub const ECHOCTL: ::tcflag_t = 512; +pub const ISIG: ::tcflag_t = 1; +pub const ICANON: ::tcflag_t = 2; +pub const PENDIN: ::tcflag_t = 16384; +pub const NOFLSH: ::tcflag_t = 128; +pub const CIBAUD: ::tcflag_t = 269418496; +pub const CBAUDEX: ::tcflag_t = 4096; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 2; +pub const NLDLY: ::tcflag_t = 256; +pub const CRDLY: ::tcflag_t = 1536; +pub const TABDLY: ::tcflag_t = 6144; +pub const BSDLY: ::tcflag_t = 8192; +pub const FFDLY: ::tcflag_t = 32768; +pub const VTDLY: ::tcflag_t = 16384; +pub const XTABS: ::tcflag_t = 6144; +pub const B0: ::speed_t = 0; +pub const B50: ::speed_t = 1; +pub const B75: ::speed_t = 2; +pub const B110: ::speed_t = 3; +pub const B134: ::speed_t = 4; +pub const B150: ::speed_t = 5; +pub const B200: ::speed_t = 6; +pub const B300: ::speed_t = 7; +pub const B600: ::speed_t = 8; +pub const B1200: ::speed_t = 9; +pub const B1800: ::speed_t = 10; +pub const B2400: ::speed_t = 11; +pub const B4800: ::speed_t = 12; +pub const B9600: ::speed_t = 13; +pub const B19200: ::speed_t = 14; +pub const B38400: ::speed_t = 15; +pub const EXTA: ::speed_t = 14; +pub const EXTB: ::speed_t = 15; +pub const B57600: ::speed_t = 4097; +pub const B115200: ::speed_t = 4098; +pub const B230400: ::speed_t = 4099; +pub const B460800: ::speed_t = 4100; +pub const B500000: ::speed_t = 4101; +pub const B576000: ::speed_t = 4102; +pub const B921600: ::speed_t = 4103; +pub const B1000000: ::speed_t = 4104; +pub const B1152000: ::speed_t = 4105; +pub const B1500000: ::speed_t = 4106; +pub const B2000000: ::speed_t = 4107; +pub const B2500000: ::speed_t = 4108; +pub const B3000000: ::speed_t = 4109; +pub const B3500000: ::speed_t = 4110; +pub const B4000000: ::speed_t = 4111; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 32768; +pub const TOSTOP: ::tcflag_t = 256; +pub const FLUSHO: ::tcflag_t = 4096; +pub const EXTPROC: ::tcflag_t = 65536; +pub const TCGETS: ::c_int = 21505; +pub const TCSETS: ::c_int = 21506; +pub const TCSETSW: ::c_int = 21507; +pub const TCSETSF: ::c_int = 21508; +pub const TCGETA: ::c_int = 21509; +pub const TCSETA: ::c_int = 21510; +pub const TCSETAW: ::c_int = 21511; +pub const TCSETAF: ::c_int = 21512; +pub const TCSBRK: ::c_int = 21513; +pub const TCXONC: ::c_int = 21514; +pub const TCFLSH: ::c_int = 21515; +pub const TIOCINQ: ::c_int = 21531; +pub const TIOCGPGRP: ::c_int = 21519; +pub const TIOCSPGRP: ::c_int = 21520; +pub const TIOCOUTQ: ::c_int = 21521; +pub const TIOCGWINSZ: ::c_int = 21523; +pub const TIOCSWINSZ: ::c_int = 21524; +pub const FIONREAD: ::c_int = 21531; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_close: ::c_long = 57; +pub const SYS_fstat: ::c_long = 80; +pub const SYS_lseek: ::c_long = 62; +pub const SYS_mmap: ::c_long = 222; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_brk: ::c_long = 214; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_dup: ::c_long = 23; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_sendfile: ::c_long = 71; +pub const SYS_socket: ::c_long = 198; +pub const SYS_connect: ::c_long = 203; +pub const SYS_accept: ::c_long = 202; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_exit: ::c_long = 93; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_kill: ::c_long = 129; +pub const SYS_uname: ::c_long = 160; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semop: ::c_long = 193; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_fcntl: ::c_long = 25; +pub const SYS_flock: ::c_long = 32; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_truncate: ::c_long = 45; +pub const SYS_ftruncate: ::c_long = 46; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_umask: ::c_long = 166; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_times: ::c_long = 153; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getegid: ::c_long = 177; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_personality: ::c_long = 92; +pub const SYS_statfs: ::c_long = 43; +pub const SYS_fstatfs: ::c_long = 44; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_sync: ::c_long = 81; +pub const SYS_acct: ::c_long = 89; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_mount: ::c_long = 40; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_gettid: ::c_long = 178; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_futex: ::c_long = 98; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_fadvise64: ::c_long = 223; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_openat: ::c_long = 56; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_newfstatat: ::c_long = 79; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; +pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_setns: ::c_long = 268; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; +pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_statx: ::c_long = 291; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..79544176a88c92012772362fd005c65a954e7369 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/align.rs @@ -0,0 +1,7 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(8))] + pub struct max_align_t { + priv_: [f64; 3] + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..a6efea13b9d1dd0bb4c7c67a0ce41384919ad612 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b32/x86/mod.rs @@ -0,0 +1,888 @@ +pub type c_char = i8; +pub type wchar_t = i32; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + __st_dev_padding: ::c_int, + __st_ino_truncated: ::c_long, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __st_rdev_padding: ::c_int, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::ino_t, + } + + pub struct stat64 { + pub st_dev: ::dev_t, + __st_dev_padding: ::c_int, + __st_ino_truncated: ::c_long, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __st_rdev_padding: ::c_int, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::ino_t, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __unused1: ::c_long, + __unused2: ::c_long + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + __unused1: ::c_int, + pub shm_dtime: ::time_t, + __unused2: ::c_int, + pub shm_ctime: ::time_t, + __unused3: ::c_int, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::c_ulong, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + __unused1: ::c_int, + pub msg_rtime: ::time_t, + __unused2: ::c_int, + pub msg_ctime: ::time_t, + __unused3: ::c_int, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct statfs { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct mcontext_t { + __private: [u32; 22] + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } +} + +s_no_extra_traits! { + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask: ::sigset_t, + __private: [u8; 112], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for ucontext_t { + fn eq(&self, other: &ucontext_t) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_sigmask == other.uc_sigmask + && self + .__private + .iter() + .zip(other.__private.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for ucontext_t {} + + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_flags) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field("uc_sigmask", &self.uc_sigmask) + // Ignore __private field + .finish() + } + } + + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + self.uc_sigmask.hash(state); + self.__private.hash(state); + } + } + } +} + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; +pub const O_ASYNC: ::c_int = 0x2000; +pub const O_LARGEFILE: ::c_int = 0o0100000; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::c_int = 0x00000800; +pub const TAB2: ::c_int = 0x00001000; +pub const TAB3: ::c_int = 0x00001800; +pub const CR1: ::c_int = 0x00000200; +pub const CR2: ::c_int = 0x00000400; +pub const CR3: ::c_int = 0x00000600; +pub const FF1: ::c_int = 0x00008000; +pub const BS1: ::c_int = 0x00002000; +pub const VT1: ::c_int = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; + +pub const SOCK_NONBLOCK: ::c_int = 2048; + +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_SEQPACKET: ::c_int = 5; + +pub const EDEADLK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EDEADLOCK: ::c_int = EDEADLK; +pub const EMULTIHOP: ::c_int = 72; +pub const EBADMSG: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const ERFKILL: ::c_int = 132; +pub const EHWPOISON: ::c_int = 133; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const EXTPROC: ::tcflag_t = 0x00010000; + +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_32BIT: ::c_int = 0x0040; + +pub const F_GETLK: ::c_int = 12; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETLK: ::c_int = 13; +pub const F_SETLKW: ::c_int = 14; +pub const F_SETOWN: ::c_int = 8; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const VEOF: usize = 4; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_waitpid: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_time: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_break: ::c_long = 17; +pub const SYS_oldstat: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_stime: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_oldfstat: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_stty: ::c_long = 31; +pub const SYS_gtty: ::c_long = 32; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_ftime: ::c_long = 35; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_prof: ::c_long = 44; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_lock: ::c_long = 53; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_mpx: ::c_long = 56; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_ulimit: ::c_long = 58; +pub const SYS_oldolduname: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sgetmask: ::c_long = 68; +pub const SYS_ssetmask: ::c_long = 69; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrlimit: ::c_long = 76; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_select: ::c_long = 82; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_oldlstat: ::c_long = 84; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_profil: ::c_long = 98; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_ioperm: ::c_long = 101; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_olduname: ::c_long = 109; +pub const SYS_iopl: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_vm86old: ::c_long = 113; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_modify_ldt: ::c_long = 123; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_vm86: ::c_long = 166; +pub const SYS_query_module: ::c_long = 167; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_chown: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_getpmsg: ::c_long = 188; +pub const SYS_putpmsg: ::c_long = 189; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_ugetrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_lchown32: ::c_long = 198; +pub const SYS_getuid32: ::c_long = 199; +pub const SYS_getgid32: ::c_long = 200; +pub const SYS_geteuid32: ::c_long = 201; +pub const SYS_getegid32: ::c_long = 202; +pub const SYS_setreuid32: ::c_long = 203; +pub const SYS_setregid32: ::c_long = 204; +pub const SYS_getgroups32: ::c_long = 205; +pub const SYS_setgroups32: ::c_long = 206; +pub const SYS_fchown32: ::c_long = 207; +pub const SYS_setresuid32: ::c_long = 208; +pub const SYS_getresuid32: ::c_long = 209; +pub const SYS_setresgid32: ::c_long = 210; +pub const SYS_getresgid32: ::c_long = 211; +pub const SYS_chown32: ::c_long = 212; +pub const SYS_setuid32: ::c_long = 213; +pub const SYS_setgid32: ::c_long = 214; +pub const SYS_setfsuid32: ::c_long = 215; +pub const SYS_setfsgid32: ::c_long = 216; +pub const SYS_pivot_root: ::c_long = 217; +pub const SYS_mincore: ::c_long = 218; +pub const SYS_madvise: ::c_long = 219; +pub const SYS_getdents64: ::c_long = 220; +pub const SYS_fcntl64: ::c_long = 221; +pub const SYS_gettid: ::c_long = 224; +pub const SYS_readahead: ::c_long = 225; +pub const SYS_setxattr: ::c_long = 226; +pub const SYS_lsetxattr: ::c_long = 227; +pub const SYS_fsetxattr: ::c_long = 228; +pub const SYS_getxattr: ::c_long = 229; +pub const SYS_lgetxattr: ::c_long = 230; +pub const SYS_fgetxattr: ::c_long = 231; +pub const SYS_listxattr: ::c_long = 232; +pub const SYS_llistxattr: ::c_long = 233; +pub const SYS_flistxattr: ::c_long = 234; +pub const SYS_removexattr: ::c_long = 235; +pub const SYS_lremovexattr: ::c_long = 236; +pub const SYS_fremovexattr: ::c_long = 237; +pub const SYS_tkill: ::c_long = 238; +pub const SYS_sendfile64: ::c_long = 239; +pub const SYS_futex: ::c_long = 240; +pub const SYS_sched_setaffinity: ::c_long = 241; +pub const SYS_sched_getaffinity: ::c_long = 242; +pub const SYS_set_thread_area: ::c_long = 243; +pub const SYS_get_thread_area: ::c_long = 244; +pub const SYS_io_setup: ::c_long = 245; +pub const SYS_io_destroy: ::c_long = 246; +pub const SYS_io_getevents: ::c_long = 247; +pub const SYS_io_submit: ::c_long = 248; +pub const SYS_io_cancel: ::c_long = 249; +pub const SYS_fadvise64: ::c_long = 250; +pub const SYS_exit_group: ::c_long = 252; +pub const SYS_lookup_dcookie: ::c_long = 253; +pub const SYS_epoll_create: ::c_long = 254; +pub const SYS_epoll_ctl: ::c_long = 255; +pub const SYS_epoll_wait: ::c_long = 256; +pub const SYS_remap_file_pages: ::c_long = 257; +pub const SYS_set_tid_address: ::c_long = 258; +pub const SYS_timer_create: ::c_long = 259; +pub const SYS_timer_settime: ::c_long = 260; +pub const SYS_timer_gettime: ::c_long = 261; +pub const SYS_timer_getoverrun: ::c_long = 262; +pub const SYS_timer_delete: ::c_long = 263; +pub const SYS_clock_settime: ::c_long = 264; +pub const SYS_clock_gettime: ::c_long = 265; +pub const SYS_clock_getres: ::c_long = 266; +pub const SYS_clock_nanosleep: ::c_long = 267; +pub const SYS_statfs64: ::c_long = 268; +pub const SYS_fstatfs64: ::c_long = 269; +pub const SYS_tgkill: ::c_long = 270; +pub const SYS_utimes: ::c_long = 271; +pub const SYS_fadvise64_64: ::c_long = 272; +pub const SYS_vserver: ::c_long = 273; +pub const SYS_mbind: ::c_long = 274; +pub const SYS_get_mempolicy: ::c_long = 275; +pub const SYS_set_mempolicy: ::c_long = 276; +pub const SYS_mq_open: ::c_long = 277; +pub const SYS_mq_unlink: ::c_long = 278; +pub const SYS_mq_timedsend: ::c_long = 279; +pub const SYS_mq_timedreceive: ::c_long = 280; +pub const SYS_mq_notify: ::c_long = 281; +pub const SYS_mq_getsetattr: ::c_long = 282; +pub const SYS_kexec_load: ::c_long = 283; +pub const SYS_waitid: ::c_long = 284; +pub const SYS_add_key: ::c_long = 286; +pub const SYS_request_key: ::c_long = 287; +pub const SYS_keyctl: ::c_long = 288; +pub const SYS_ioprio_set: ::c_long = 289; +pub const SYS_ioprio_get: ::c_long = 290; +pub const SYS_inotify_init: ::c_long = 291; +pub const SYS_inotify_add_watch: ::c_long = 292; +pub const SYS_inotify_rm_watch: ::c_long = 293; +pub const SYS_migrate_pages: ::c_long = 294; +pub const SYS_openat: ::c_long = 295; +pub const SYS_mkdirat: ::c_long = 296; +pub const SYS_mknodat: ::c_long = 297; +pub const SYS_fchownat: ::c_long = 298; +pub const SYS_futimesat: ::c_long = 299; +pub const SYS_fstatat64: ::c_long = 300; +pub const SYS_unlinkat: ::c_long = 301; +pub const SYS_renameat: ::c_long = 302; +pub const SYS_linkat: ::c_long = 303; +pub const SYS_symlinkat: ::c_long = 304; +pub const SYS_readlinkat: ::c_long = 305; +pub const SYS_fchmodat: ::c_long = 306; +pub const SYS_faccessat: ::c_long = 307; +pub const SYS_pselect6: ::c_long = 308; +pub const SYS_ppoll: ::c_long = 309; +pub const SYS_unshare: ::c_long = 310; +pub const SYS_set_robust_list: ::c_long = 311; +pub const SYS_get_robust_list: ::c_long = 312; +pub const SYS_splice: ::c_long = 313; +pub const SYS_sync_file_range: ::c_long = 314; +pub const SYS_tee: ::c_long = 315; +pub const SYS_vmsplice: ::c_long = 316; +pub const SYS_move_pages: ::c_long = 317; +pub const SYS_getcpu: ::c_long = 318; +pub const SYS_epoll_pwait: ::c_long = 319; +pub const SYS_utimensat: ::c_long = 320; +pub const SYS_signalfd: ::c_long = 321; +pub const SYS_timerfd_create: ::c_long = 322; +pub const SYS_eventfd: ::c_long = 323; +pub const SYS_fallocate: ::c_long = 324; +pub const SYS_timerfd_settime: ::c_long = 325; +pub const SYS_timerfd_gettime: ::c_long = 326; +pub const SYS_signalfd4: ::c_long = 327; +pub const SYS_eventfd2: ::c_long = 328; +pub const SYS_epoll_create1: ::c_long = 329; +pub const SYS_dup3: ::c_long = 330; +pub const SYS_pipe2: ::c_long = 331; +pub const SYS_inotify_init1: ::c_long = 332; +pub const SYS_preadv: ::c_long = 333; +pub const SYS_pwritev: ::c_long = 334; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 335; +pub const SYS_perf_event_open: ::c_long = 336; +pub const SYS_recvmmsg: ::c_long = 337; +pub const SYS_fanotify_init: ::c_long = 338; +pub const SYS_fanotify_mark: ::c_long = 339; +pub const SYS_prlimit64: ::c_long = 340; +pub const SYS_name_to_handle_at: ::c_long = 341; +pub const SYS_open_by_handle_at: ::c_long = 342; +pub const SYS_clock_adjtime: ::c_long = 343; +pub const SYS_syncfs: ::c_long = 344; +pub const SYS_sendmmsg: ::c_long = 345; +pub const SYS_setns: ::c_long = 346; +pub const SYS_process_vm_readv: ::c_long = 347; +pub const SYS_process_vm_writev: ::c_long = 348; +pub const SYS_kcmp: ::c_long = 349; +pub const SYS_finit_module: ::c_long = 350; +pub const SYS_sched_setattr: ::c_long = 351; +pub const SYS_sched_getattr: ::c_long = 352; +pub const SYS_renameat2: ::c_long = 353; +pub const SYS_seccomp: ::c_long = 354; +pub const SYS_getrandom: ::c_long = 355; +pub const SYS_memfd_create: ::c_long = 356; +pub const SYS_bpf: ::c_long = 357; +pub const SYS_execveat: ::c_long = 358; +pub const SYS_socket: ::c_long = 359; +pub const SYS_socketpair: ::c_long = 360; +pub const SYS_bind: ::c_long = 361; +pub const SYS_connect: ::c_long = 362; +pub const SYS_listen: ::c_long = 363; +pub const SYS_accept4: ::c_long = 364; +pub const SYS_getsockopt: ::c_long = 365; +pub const SYS_setsockopt: ::c_long = 366; +pub const SYS_getsockname: ::c_long = 367; +pub const SYS_getpeername: ::c_long = 368; +pub const SYS_sendto: ::c_long = 369; +pub const SYS_sendmsg: ::c_long = 370; +pub const SYS_recvfrom: ::c_long = 371; +pub const SYS_recvmsg: ::c_long = 372; +pub const SYS_shutdown: ::c_long = 373; +pub const SYS_userfaultfd: ::c_long = 374; +pub const SYS_membarrier: ::c_long = 375; +pub const SYS_mlock2: ::c_long = 376; +pub const SYS_copy_file_range: ::c_long = 377; +pub const SYS_preadv2: ::c_long = 378; +pub const SYS_pwritev2: ::c_long = 379; +pub const SYS_pkey_mprotect: ::c_long = 380; +pub const SYS_pkey_alloc: ::c_long = 381; +pub const SYS_pkey_free: ::c_long = 382; +pub const SYS_statx: ::c_long = 383; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +// offsets in user_regs_structs, from sys/reg.h +pub const EBX: ::c_int = 0; +pub const ECX: ::c_int = 1; +pub const EDX: ::c_int = 2; +pub const ESI: ::c_int = 3; +pub const EDI: ::c_int = 4; +pub const EBP: ::c_int = 5; +pub const EAX: ::c_int = 6; +pub const DS: ::c_int = 7; +pub const ES: ::c_int = 8; +pub const FS: ::c_int = 9; +pub const GS: ::c_int = 10; +pub const ORIG_EAX: ::c_int = 11; +pub const EIP: ::c_int = 12; +pub const CS: ::c_int = 13; +pub const EFL: ::c_int = 14; +pub const UESP: ::c_int = 15; +pub const SS: ::c_int = 16; + +extern "C" { + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..a4bf9bff4f1474322735a183865a0d69b6e3ea84 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/align.rs @@ -0,0 +1,42 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f32; 8] + } +} + +s! { + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: mcontext_t, + } + + #[repr(align(16))] + pub struct mcontext_t { + pub fault_address: ::c_ulong, + pub regs: [::c_ulong; 31], + pub sp: ::c_ulong, + pub pc: ::c_ulong, + pub pstate: ::c_ulong, + __reserved: [[u64; 32]; 16], + } + + #[repr(align(8))] + pub struct clone_args { + pub flags: ::c_ulonglong, + pub pidfd: ::c_ulonglong, + pub child_tid: ::c_ulonglong, + pub parent_tid: ::c_ulonglong, + pub exit_signal: ::c_ulonglong, + pub stack: ::c_ulonglong, + pub stack_size: ::c_ulonglong, + pub tls: ::c_ulonglong, + pub set_tid: ::c_ulonglong, + pub set_tid_size: ::c_ulonglong, + pub cgroup: ::c_ulonglong, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs new file mode 100644 index 0000000000000000000000000000000000000000..4535e73eeddf150890f9ca316e2d64859f5f2aa4 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs @@ -0,0 +1,7 @@ +s! { + pub struct user_fpsimd_struct { + pub vregs: [::__uint128_t; 32], + pub fpsr: u32, + pub fpcr: u32, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..845707dcd9ab52ee21e01946d47b7516d2e19826 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs @@ -0,0 +1,651 @@ +pub type c_char = u8; +pub type __u64 = ::c_ulonglong; +pub type wchar_t = u32; +pub type nlink_t = u32; +pub type blksize_t = ::c_int; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad0: ::c_ulong, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + __pad1: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_uint; 2], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad0: ::c_ulong, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + __pad1: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_uint; 2], + } + + pub struct user_regs_struct { + pub regs: [::c_ulonglong; 31], + pub sp: ::c_ulonglong, + pub pc: ::c_ulonglong, + pub pstate: ::c_ulonglong, + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong, + } +} + +pub const O_APPEND: ::c_int = 1024; +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_LARGEFILE: ::c_int = 0x20000; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_ASYNC: ::c_int = 0x2000; + +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EBADMSG: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const ERFKILL: ::c_int = 132; +pub const EHWPOISON: ::c_int = 133; + +// bits/hwcap.h +pub const HWCAP_FP: ::c_ulong = 1 << 0; +pub const HWCAP_ASIMD: ::c_ulong = 1 << 1; +pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2; +pub const HWCAP_AES: ::c_ulong = 1 << 3; +pub const HWCAP_PMULL: ::c_ulong = 1 << 4; +pub const HWCAP_SHA1: ::c_ulong = 1 << 5; +pub const HWCAP_SHA2: ::c_ulong = 1 << 6; +pub const HWCAP_CRC32: ::c_ulong = 1 << 7; +pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8; +pub const HWCAP_FPHP: ::c_ulong = 1 << 9; +pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10; +pub const HWCAP_CPUID: ::c_ulong = 1 << 11; +pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12; +pub const HWCAP_JSCVT: ::c_ulong = 1 << 13; +pub const HWCAP_FCMA: ::c_ulong = 1 << 14; +pub const HWCAP_LRCPC: ::c_ulong = 1 << 15; +pub const HWCAP_DCPOP: ::c_ulong = 1 << 16; +pub const HWCAP_SHA3: ::c_ulong = 1 << 17; +pub const HWCAP_SM3: ::c_ulong = 1 << 18; +pub const HWCAP_SM4: ::c_ulong = 1 << 19; +pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20; +pub const HWCAP_SHA512: ::c_ulong = 1 << 21; +pub const HWCAP_SVE: ::c_ulong = 1 << 22; +pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23; +pub const HWCAP_DIT: ::c_ulong = 1 << 24; +pub const HWCAP_USCAT: ::c_ulong = 1 << 25; +pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26; +pub const HWCAP_FLAGM: ::c_ulong = 1 << 27; +pub const HWCAP_SSBS: ::c_ulong = 1 << 28; +pub const HWCAP_SB: ::c_ulong = 1 << 29; +pub const HWCAP_PACA: ::c_ulong = 1 << 30; +pub const HWCAP_PACG: ::c_ulong = 1 << 31; + +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_SETOWN: ::c_int = 8; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const VEOF: usize = 4; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const MINSIGSTKSZ: ::size_t = 6144; +pub const SIGSTKSZ: ::size_t = 12288; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_dup: ::c_long = 23; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_fcntl: ::c_long = 25; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_flock: ::c_long = 32; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_renameat: ::c_long = 38; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_mount: ::c_long = 40; +pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_statfs: ::c_long = 43; +pub const SYS_fstatfs: ::c_long = 44; +pub const SYS_truncate: ::c_long = 45; +pub const SYS_ftruncate: ::c_long = 46; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_openat: ::c_long = 56; +pub const SYS_close: ::c_long = 57; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_lseek: ::c_long = 62; +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_newfstatat: ::c_long = 79; +pub const SYS_fstat: ::c_long = 80; +pub const SYS_sync: ::c_long = 81; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_acct: ::c_long = 89; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_personality: ::c_long = 92; +pub const SYS_exit: ::c_long = 93; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_futex: ::c_long = 98; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_kill: ::c_long = 129; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_times: ::c_long = 153; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_uname: ::c_long = 160; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_umask: ::c_long = 166; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_getegid: ::c_long = 177; +pub const SYS_gettid: ::c_long = 178; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_semop: ::c_long = 193; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_socket: ::c_long = 198; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_accept: ::c_long = 202; +pub const SYS_connect: ::c_long = 203; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_brk: ::c_long = 214; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_mmap: ::c_long = 222; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; +pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_setns: ::c_long = 268; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; +pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_statx: ::c_long = 291; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::c_int = 0x00000800; +pub const TAB2: ::c_int = 0x00001000; +pub const TAB3: ::c_int = 0x00001800; +pub const CR1: ::c_int = 0x00000200; +pub const CR2: ::c_int = 0x00000400; +pub const CR3: ::c_int = 0x00000600; +pub const FF1: ::c_int = 0x00008000; +pub const BS1: ::c_int = 0x00002000; +pub const VT1: ::c_int = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const EDEADLK: ::c_int = 35; +pub const EDEADLOCK: ::c_int = EDEADLK; + +pub const EXTPROC: ::tcflag_t = 0x00010000; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} + +cfg_if! { + if #[cfg(libc_int128)] { + mod int128; + pub use self::int128::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs new file mode 100644 index 0000000000000000000000000000000000000000..1ed13f66bf2fe4a77917b12e7dfe931bdd78ac96 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/mips64.rs @@ -0,0 +1,681 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type __u64 = ::c_ulong; +pub type nlink_t = u64; +pub type blksize_t = i64; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + __pad1: [::c_int; 3], + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad2: [::c_uint; 2], + pub st_size: ::off_t, + __pad3: ::c_int, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + __pad4: ::c_uint, + pub st_blocks: ::blkcnt_t, + __pad5: [::c_int; 14], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + __pad1: [::c_int; 3], + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + __pad2: [::c_uint; 2], + pub st_size: ::off_t, + __pad3: ::c_int, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + __pad4: ::c_uint, + pub st_blocks: ::blkcnt_t, + __pad5: [::c_int; 14], + } + + pub struct statfs { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 5], + } + + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 5], + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __pad1: ::c_int, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } +} + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +pub const SYS_read: ::c_long = 5000 + 0; +pub const SYS_write: ::c_long = 5000 + 1; +pub const SYS_open: ::c_long = 5000 + 2; +pub const SYS_close: ::c_long = 5000 + 3; +pub const SYS_stat: ::c_long = 5000 + 4; +pub const SYS_fstat: ::c_long = 5000 + 5; +pub const SYS_lstat: ::c_long = 5000 + 6; +pub const SYS_poll: ::c_long = 5000 + 7; +pub const SYS_lseek: ::c_long = 5000 + 8; +pub const SYS_mmap: ::c_long = 5000 + 9; +pub const SYS_mprotect: ::c_long = 5000 + 10; +pub const SYS_munmap: ::c_long = 5000 + 11; +pub const SYS_brk: ::c_long = 5000 + 12; +pub const SYS_rt_sigaction: ::c_long = 5000 + 13; +pub const SYS_rt_sigprocmask: ::c_long = 5000 + 14; +pub const SYS_ioctl: ::c_long = 5000 + 15; +pub const SYS_pread64: ::c_long = 5000 + 16; +pub const SYS_pwrite64: ::c_long = 5000 + 17; +pub const SYS_readv: ::c_long = 5000 + 18; +pub const SYS_writev: ::c_long = 5000 + 19; +pub const SYS_access: ::c_long = 5000 + 20; +pub const SYS_pipe: ::c_long = 5000 + 21; +pub const SYS__newselect: ::c_long = 5000 + 22; +pub const SYS_sched_yield: ::c_long = 5000 + 23; +pub const SYS_mremap: ::c_long = 5000 + 24; +pub const SYS_msync: ::c_long = 5000 + 25; +pub const SYS_mincore: ::c_long = 5000 + 26; +pub const SYS_madvise: ::c_long = 5000 + 27; +pub const SYS_shmget: ::c_long = 5000 + 28; +pub const SYS_shmat: ::c_long = 5000 + 29; +pub const SYS_shmctl: ::c_long = 5000 + 30; +pub const SYS_dup: ::c_long = 5000 + 31; +pub const SYS_dup2: ::c_long = 5000 + 32; +pub const SYS_pause: ::c_long = 5000 + 33; +pub const SYS_nanosleep: ::c_long = 5000 + 34; +pub const SYS_getitimer: ::c_long = 5000 + 35; +pub const SYS_setitimer: ::c_long = 5000 + 36; +pub const SYS_alarm: ::c_long = 5000 + 37; +pub const SYS_getpid: ::c_long = 5000 + 38; +pub const SYS_sendfile: ::c_long = 5000 + 39; +pub const SYS_socket: ::c_long = 5000 + 40; +pub const SYS_connect: ::c_long = 5000 + 41; +pub const SYS_accept: ::c_long = 5000 + 42; +pub const SYS_sendto: ::c_long = 5000 + 43; +pub const SYS_recvfrom: ::c_long = 5000 + 44; +pub const SYS_sendmsg: ::c_long = 5000 + 45; +pub const SYS_recvmsg: ::c_long = 5000 + 46; +pub const SYS_shutdown: ::c_long = 5000 + 47; +pub const SYS_bind: ::c_long = 5000 + 48; +pub const SYS_listen: ::c_long = 5000 + 49; +pub const SYS_getsockname: ::c_long = 5000 + 50; +pub const SYS_getpeername: ::c_long = 5000 + 51; +pub const SYS_socketpair: ::c_long = 5000 + 52; +pub const SYS_setsockopt: ::c_long = 5000 + 53; +pub const SYS_getsockopt: ::c_long = 5000 + 54; +pub const SYS_clone: ::c_long = 5000 + 55; +pub const SYS_fork: ::c_long = 5000 + 56; +pub const SYS_execve: ::c_long = 5000 + 57; +pub const SYS_exit: ::c_long = 5000 + 58; +pub const SYS_wait4: ::c_long = 5000 + 59; +pub const SYS_kill: ::c_long = 5000 + 60; +pub const SYS_uname: ::c_long = 5000 + 61; +pub const SYS_semget: ::c_long = 5000 + 62; +pub const SYS_semop: ::c_long = 5000 + 63; +pub const SYS_semctl: ::c_long = 5000 + 64; +pub const SYS_shmdt: ::c_long = 5000 + 65; +pub const SYS_msgget: ::c_long = 5000 + 66; +pub const SYS_msgsnd: ::c_long = 5000 + 67; +pub const SYS_msgrcv: ::c_long = 5000 + 68; +pub const SYS_msgctl: ::c_long = 5000 + 69; +pub const SYS_fcntl: ::c_long = 5000 + 70; +pub const SYS_flock: ::c_long = 5000 + 71; +pub const SYS_fsync: ::c_long = 5000 + 72; +pub const SYS_fdatasync: ::c_long = 5000 + 73; +pub const SYS_truncate: ::c_long = 5000 + 74; +pub const SYS_ftruncate: ::c_long = 5000 + 75; +pub const SYS_getdents: ::c_long = 5000 + 76; +pub const SYS_getcwd: ::c_long = 5000 + 77; +pub const SYS_chdir: ::c_long = 5000 + 78; +pub const SYS_fchdir: ::c_long = 5000 + 79; +pub const SYS_rename: ::c_long = 5000 + 80; +pub const SYS_mkdir: ::c_long = 5000 + 81; +pub const SYS_rmdir: ::c_long = 5000 + 82; +pub const SYS_creat: ::c_long = 5000 + 83; +pub const SYS_link: ::c_long = 5000 + 84; +pub const SYS_unlink: ::c_long = 5000 + 85; +pub const SYS_symlink: ::c_long = 5000 + 86; +pub const SYS_readlink: ::c_long = 5000 + 87; +pub const SYS_chmod: ::c_long = 5000 + 88; +pub const SYS_fchmod: ::c_long = 5000 + 89; +pub const SYS_chown: ::c_long = 5000 + 90; +pub const SYS_fchown: ::c_long = 5000 + 91; +pub const SYS_lchown: ::c_long = 5000 + 92; +pub const SYS_umask: ::c_long = 5000 + 93; +pub const SYS_gettimeofday: ::c_long = 5000 + 94; +pub const SYS_getrlimit: ::c_long = 5000 + 95; +pub const SYS_getrusage: ::c_long = 5000 + 96; +pub const SYS_sysinfo: ::c_long = 5000 + 97; +pub const SYS_times: ::c_long = 5000 + 98; +pub const SYS_ptrace: ::c_long = 5000 + 99; +pub const SYS_getuid: ::c_long = 5000 + 100; +pub const SYS_syslog: ::c_long = 5000 + 101; +pub const SYS_getgid: ::c_long = 5000 + 102; +pub const SYS_setuid: ::c_long = 5000 + 103; +pub const SYS_setgid: ::c_long = 5000 + 104; +pub const SYS_geteuid: ::c_long = 5000 + 105; +pub const SYS_getegid: ::c_long = 5000 + 106; +pub const SYS_setpgid: ::c_long = 5000 + 107; +pub const SYS_getppid: ::c_long = 5000 + 108; +pub const SYS_getpgrp: ::c_long = 5000 + 109; +pub const SYS_setsid: ::c_long = 5000 + 110; +pub const SYS_setreuid: ::c_long = 5000 + 111; +pub const SYS_setregid: ::c_long = 5000 + 112; +pub const SYS_getgroups: ::c_long = 5000 + 113; +pub const SYS_setgroups: ::c_long = 5000 + 114; +pub const SYS_setresuid: ::c_long = 5000 + 115; +pub const SYS_getresuid: ::c_long = 5000 + 116; +pub const SYS_setresgid: ::c_long = 5000 + 117; +pub const SYS_getresgid: ::c_long = 5000 + 118; +pub const SYS_getpgid: ::c_long = 5000 + 119; +pub const SYS_setfsuid: ::c_long = 5000 + 120; +pub const SYS_setfsgid: ::c_long = 5000 + 121; +pub const SYS_getsid: ::c_long = 5000 + 122; +pub const SYS_capget: ::c_long = 5000 + 123; +pub const SYS_capset: ::c_long = 5000 + 124; +pub const SYS_rt_sigpending: ::c_long = 5000 + 125; +pub const SYS_rt_sigtimedwait: ::c_long = 5000 + 126; +pub const SYS_rt_sigqueueinfo: ::c_long = 5000 + 127; +pub const SYS_rt_sigsuspend: ::c_long = 5000 + 128; +pub const SYS_sigaltstack: ::c_long = 5000 + 129; +pub const SYS_utime: ::c_long = 5000 + 130; +pub const SYS_mknod: ::c_long = 5000 + 131; +pub const SYS_personality: ::c_long = 5000 + 132; +pub const SYS_ustat: ::c_long = 5000 + 133; +pub const SYS_statfs: ::c_long = 5000 + 134; +pub const SYS_fstatfs: ::c_long = 5000 + 135; +pub const SYS_sysfs: ::c_long = 5000 + 136; +pub const SYS_getpriority: ::c_long = 5000 + 137; +pub const SYS_setpriority: ::c_long = 5000 + 138; +pub const SYS_sched_setparam: ::c_long = 5000 + 139; +pub const SYS_sched_getparam: ::c_long = 5000 + 140; +pub const SYS_sched_setscheduler: ::c_long = 5000 + 141; +pub const SYS_sched_getscheduler: ::c_long = 5000 + 142; +pub const SYS_sched_get_priority_max: ::c_long = 5000 + 143; +pub const SYS_sched_get_priority_min: ::c_long = 5000 + 144; +pub const SYS_sched_rr_get_interval: ::c_long = 5000 + 145; +pub const SYS_mlock: ::c_long = 5000 + 146; +pub const SYS_munlock: ::c_long = 5000 + 147; +pub const SYS_mlockall: ::c_long = 5000 + 148; +pub const SYS_munlockall: ::c_long = 5000 + 149; +pub const SYS_vhangup: ::c_long = 5000 + 150; +pub const SYS_pivot_root: ::c_long = 5000 + 151; +pub const SYS__sysctl: ::c_long = 5000 + 152; +pub const SYS_prctl: ::c_long = 5000 + 153; +pub const SYS_adjtimex: ::c_long = 5000 + 154; +pub const SYS_setrlimit: ::c_long = 5000 + 155; +pub const SYS_chroot: ::c_long = 5000 + 156; +pub const SYS_sync: ::c_long = 5000 + 157; +pub const SYS_acct: ::c_long = 5000 + 158; +pub const SYS_settimeofday: ::c_long = 5000 + 159; +pub const SYS_mount: ::c_long = 5000 + 160; +pub const SYS_umount2: ::c_long = 5000 + 161; +pub const SYS_swapon: ::c_long = 5000 + 162; +pub const SYS_swapoff: ::c_long = 5000 + 163; +pub const SYS_reboot: ::c_long = 5000 + 164; +pub const SYS_sethostname: ::c_long = 5000 + 165; +pub const SYS_setdomainname: ::c_long = 5000 + 166; +pub const SYS_create_module: ::c_long = 5000 + 167; +pub const SYS_init_module: ::c_long = 5000 + 168; +pub const SYS_delete_module: ::c_long = 5000 + 169; +pub const SYS_get_kernel_syms: ::c_long = 5000 + 170; +pub const SYS_query_module: ::c_long = 5000 + 171; +pub const SYS_quotactl: ::c_long = 5000 + 172; +pub const SYS_nfsservctl: ::c_long = 5000 + 173; +pub const SYS_getpmsg: ::c_long = 5000 + 174; +pub const SYS_putpmsg: ::c_long = 5000 + 175; +pub const SYS_afs_syscall: ::c_long = 5000 + 176; +pub const SYS_gettid: ::c_long = 5000 + 178; +pub const SYS_readahead: ::c_long = 5000 + 179; +pub const SYS_setxattr: ::c_long = 5000 + 180; +pub const SYS_lsetxattr: ::c_long = 5000 + 181; +pub const SYS_fsetxattr: ::c_long = 5000 + 182; +pub const SYS_getxattr: ::c_long = 5000 + 183; +pub const SYS_lgetxattr: ::c_long = 5000 + 184; +pub const SYS_fgetxattr: ::c_long = 5000 + 185; +pub const SYS_listxattr: ::c_long = 5000 + 186; +pub const SYS_llistxattr: ::c_long = 5000 + 187; +pub const SYS_flistxattr: ::c_long = 5000 + 188; +pub const SYS_removexattr: ::c_long = 5000 + 189; +pub const SYS_lremovexattr: ::c_long = 5000 + 190; +pub const SYS_fremovexattr: ::c_long = 5000 + 191; +pub const SYS_tkill: ::c_long = 5000 + 192; +pub const SYS_futex: ::c_long = 5000 + 194; +pub const SYS_sched_setaffinity: ::c_long = 5000 + 195; +pub const SYS_sched_getaffinity: ::c_long = 5000 + 196; +pub const SYS_cacheflush: ::c_long = 5000 + 197; +pub const SYS_cachectl: ::c_long = 5000 + 198; +pub const SYS_sysmips: ::c_long = 5000 + 199; +pub const SYS_io_setup: ::c_long = 5000 + 200; +pub const SYS_io_destroy: ::c_long = 5000 + 201; +pub const SYS_io_getevents: ::c_long = 5000 + 202; +pub const SYS_io_submit: ::c_long = 5000 + 203; +pub const SYS_io_cancel: ::c_long = 5000 + 204; +pub const SYS_exit_group: ::c_long = 5000 + 205; +pub const SYS_lookup_dcookie: ::c_long = 5000 + 206; +pub const SYS_epoll_create: ::c_long = 5000 + 207; +pub const SYS_epoll_ctl: ::c_long = 5000 + 208; +pub const SYS_epoll_wait: ::c_long = 5000 + 209; +pub const SYS_remap_file_pages: ::c_long = 5000 + 210; +pub const SYS_rt_sigreturn: ::c_long = 5000 + 211; +pub const SYS_set_tid_address: ::c_long = 5000 + 212; +pub const SYS_restart_syscall: ::c_long = 5000 + 213; +pub const SYS_semtimedop: ::c_long = 5000 + 214; +pub const SYS_fadvise64: ::c_long = 5000 + 215; +pub const SYS_timer_create: ::c_long = 5000 + 216; +pub const SYS_timer_settime: ::c_long = 5000 + 217; +pub const SYS_timer_gettime: ::c_long = 5000 + 218; +pub const SYS_timer_getoverrun: ::c_long = 5000 + 219; +pub const SYS_timer_delete: ::c_long = 5000 + 220; +pub const SYS_clock_settime: ::c_long = 5000 + 221; +pub const SYS_clock_gettime: ::c_long = 5000 + 222; +pub const SYS_clock_getres: ::c_long = 5000 + 223; +pub const SYS_clock_nanosleep: ::c_long = 5000 + 224; +pub const SYS_tgkill: ::c_long = 5000 + 225; +pub const SYS_utimes: ::c_long = 5000 + 226; +pub const SYS_mbind: ::c_long = 5000 + 227; +pub const SYS_get_mempolicy: ::c_long = 5000 + 228; +pub const SYS_set_mempolicy: ::c_long = 5000 + 229; +pub const SYS_mq_open: ::c_long = 5000 + 230; +pub const SYS_mq_unlink: ::c_long = 5000 + 231; +pub const SYS_mq_timedsend: ::c_long = 5000 + 232; +pub const SYS_mq_timedreceive: ::c_long = 5000 + 233; +pub const SYS_mq_notify: ::c_long = 5000 + 234; +pub const SYS_mq_getsetattr: ::c_long = 5000 + 235; +pub const SYS_vserver: ::c_long = 5000 + 236; +pub const SYS_waitid: ::c_long = 5000 + 237; +/* pub const SYS_sys_setaltroot: ::c_long = 5000 + 238; */ +pub const SYS_add_key: ::c_long = 5000 + 239; +pub const SYS_request_key: ::c_long = 5000 + 240; +pub const SYS_keyctl: ::c_long = 5000 + 241; +pub const SYS_set_thread_area: ::c_long = 5000 + 242; +pub const SYS_inotify_init: ::c_long = 5000 + 243; +pub const SYS_inotify_add_watch: ::c_long = 5000 + 244; +pub const SYS_inotify_rm_watch: ::c_long = 5000 + 245; +pub const SYS_migrate_pages: ::c_long = 5000 + 246; +pub const SYS_openat: ::c_long = 5000 + 247; +pub const SYS_mkdirat: ::c_long = 5000 + 248; +pub const SYS_mknodat: ::c_long = 5000 + 249; +pub const SYS_fchownat: ::c_long = 5000 + 250; +pub const SYS_futimesat: ::c_long = 5000 + 251; +pub const SYS_newfstatat: ::c_long = 5000 + 252; +pub const SYS_unlinkat: ::c_long = 5000 + 253; +pub const SYS_renameat: ::c_long = 5000 + 254; +pub const SYS_linkat: ::c_long = 5000 + 255; +pub const SYS_symlinkat: ::c_long = 5000 + 256; +pub const SYS_readlinkat: ::c_long = 5000 + 257; +pub const SYS_fchmodat: ::c_long = 5000 + 258; +pub const SYS_faccessat: ::c_long = 5000 + 259; +pub const SYS_pselect6: ::c_long = 5000 + 260; +pub const SYS_ppoll: ::c_long = 5000 + 261; +pub const SYS_unshare: ::c_long = 5000 + 262; +pub const SYS_splice: ::c_long = 5000 + 263; +pub const SYS_sync_file_range: ::c_long = 5000 + 264; +pub const SYS_tee: ::c_long = 5000 + 265; +pub const SYS_vmsplice: ::c_long = 5000 + 266; +pub const SYS_move_pages: ::c_long = 5000 + 267; +pub const SYS_set_robust_list: ::c_long = 5000 + 268; +pub const SYS_get_robust_list: ::c_long = 5000 + 269; +pub const SYS_kexec_load: ::c_long = 5000 + 270; +pub const SYS_getcpu: ::c_long = 5000 + 271; +pub const SYS_epoll_pwait: ::c_long = 5000 + 272; +pub const SYS_ioprio_set: ::c_long = 5000 + 273; +pub const SYS_ioprio_get: ::c_long = 5000 + 274; +pub const SYS_utimensat: ::c_long = 5000 + 275; +pub const SYS_signalfd: ::c_long = 5000 + 276; +pub const SYS_timerfd: ::c_long = 5000 + 277; +pub const SYS_eventfd: ::c_long = 5000 + 278; +pub const SYS_fallocate: ::c_long = 5000 + 279; +pub const SYS_timerfd_create: ::c_long = 5000 + 280; +pub const SYS_timerfd_gettime: ::c_long = 5000 + 281; +pub const SYS_timerfd_settime: ::c_long = 5000 + 282; +pub const SYS_signalfd4: ::c_long = 5000 + 283; +pub const SYS_eventfd2: ::c_long = 5000 + 284; +pub const SYS_epoll_create1: ::c_long = 5000 + 285; +pub const SYS_dup3: ::c_long = 5000 + 286; +pub const SYS_pipe2: ::c_long = 5000 + 287; +pub const SYS_inotify_init1: ::c_long = 5000 + 288; +pub const SYS_preadv: ::c_long = 5000 + 289; +pub const SYS_pwritev: ::c_long = 5000 + 290; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 5000 + 291; +pub const SYS_perf_event_open: ::c_long = 5000 + 292; +pub const SYS_accept4: ::c_long = 5000 + 293; +pub const SYS_recvmmsg: ::c_long = 5000 + 294; +pub const SYS_fanotify_init: ::c_long = 5000 + 295; +pub const SYS_fanotify_mark: ::c_long = 5000 + 296; +pub const SYS_prlimit64: ::c_long = 5000 + 297; +pub const SYS_name_to_handle_at: ::c_long = 5000 + 298; +pub const SYS_open_by_handle_at: ::c_long = 5000 + 299; +pub const SYS_clock_adjtime: ::c_long = 5000 + 300; +pub const SYS_syncfs: ::c_long = 5000 + 301; +pub const SYS_sendmmsg: ::c_long = 5000 + 302; +pub const SYS_setns: ::c_long = 5000 + 303; +pub const SYS_process_vm_readv: ::c_long = 5000 + 304; +pub const SYS_process_vm_writev: ::c_long = 5000 + 305; +pub const SYS_kcmp: ::c_long = 5000 + 306; +pub const SYS_finit_module: ::c_long = 5000 + 307; +pub const SYS_getdents64: ::c_long = 5000 + 308; +pub const SYS_sched_setattr: ::c_long = 5000 + 309; +pub const SYS_sched_getattr: ::c_long = 5000 + 310; +pub const SYS_renameat2: ::c_long = 5000 + 311; +pub const SYS_seccomp: ::c_long = 5000 + 312; +pub const SYS_getrandom: ::c_long = 5000 + 313; +pub const SYS_memfd_create: ::c_long = 5000 + 314; +pub const SYS_bpf: ::c_long = 5000 + 315; +pub const SYS_execveat: ::c_long = 5000 + 316; +pub const SYS_userfaultfd: ::c_long = 5000 + 317; +pub const SYS_membarrier: ::c_long = 5000 + 318; +pub const SYS_mlock2: ::c_long = 5000 + 319; +pub const SYS_copy_file_range: ::c_long = 5000 + 320; +pub const SYS_preadv2: ::c_long = 5000 + 321; +pub const SYS_pwritev2: ::c_long = 5000 + 322; +pub const SYS_pkey_mprotect: ::c_long = 5000 + 323; +pub const SYS_pkey_alloc: ::c_long = 5000 + 324; +pub const SYS_pkey_free: ::c_long = 5000 + 325; +pub const SYS_statx: ::c_long = 5000 + 326; +pub const SYS_pidfd_send_signal: ::c_long = 5000 + 424; +pub const SYS_io_uring_setup: ::c_long = 5000 + 425; +pub const SYS_io_uring_enter: ::c_long = 5000 + 426; +pub const SYS_io_uring_register: ::c_long = 5000 + 427; +pub const SYS_open_tree: ::c_long = 5000 + 428; +pub const SYS_move_mount: ::c_long = 5000 + 429; +pub const SYS_fsopen: ::c_long = 5000 + 430; +pub const SYS_fsconfig: ::c_long = 5000 + 431; +pub const SYS_fsmount: ::c_long = 5000 + 432; +pub const SYS_fspick: ::c_long = 5000 + 433; +pub const SYS_pidfd_open: ::c_long = 5000 + 434; +pub const SYS_clone3: ::c_long = 5000 + 435; +pub const SYS_close_range: ::c_long = 5000 + 436; +pub const SYS_openat2: ::c_long = 5000 + 437; +pub const SYS_pidfd_getfd: ::c_long = 5000 + 438; +pub const SYS_faccessat2: ::c_long = 5000 + 439; +pub const SYS_process_madvise: ::c_long = 5000 + 440; +pub const SYS_epoll_pwait2: ::c_long = 5000 + 441; +pub const SYS_mount_setattr: ::c_long = 5000 + 442; + +pub const O_DIRECT: ::c_int = 0x8000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; + +pub const O_APPEND: ::c_int = 8; +pub const O_CREAT: ::c_int = 256; +pub const O_EXCL: ::c_int = 1024; +pub const O_NOCTTY: ::c_int = 2048; +pub const O_NONBLOCK: ::c_int = 128; +pub const O_SYNC: ::c_int = 0x4010; +pub const O_RSYNC: ::c_int = 0x4010; +pub const O_DSYNC: ::c_int = 0x10; +pub const O_ASYNC: ::c_int = 0x1000; +pub const O_LARGEFILE: ::c_int = 0x2000; + +pub const EDEADLK: ::c_int = 45; +pub const ENAMETOOLONG: ::c_int = 78; +pub const ENOLCK: ::c_int = 46; +pub const ENOSYS: ::c_int = 89; +pub const ENOTEMPTY: ::c_int = 93; +pub const ELOOP: ::c_int = 90; +pub const ENOMSG: ::c_int = 35; +pub const EIDRM: ::c_int = 36; +pub const ECHRNG: ::c_int = 37; +pub const EL2NSYNC: ::c_int = 38; +pub const EL3HLT: ::c_int = 39; +pub const EL3RST: ::c_int = 40; +pub const ELNRNG: ::c_int = 41; +pub const EUNATCH: ::c_int = 42; +pub const ENOCSI: ::c_int = 43; +pub const EL2HLT: ::c_int = 44; +pub const EBADE: ::c_int = 50; +pub const EBADR: ::c_int = 51; +pub const EXFULL: ::c_int = 52; +pub const ENOANO: ::c_int = 53; +pub const EBADRQC: ::c_int = 54; +pub const EBADSLT: ::c_int = 55; +pub const EDEADLOCK: ::c_int = 56; +pub const EMULTIHOP: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 79; +pub const ENOTUNIQ: ::c_int = 80; +pub const EBADFD: ::c_int = 81; +pub const EBADMSG: ::c_int = 77; +pub const EREMCHG: ::c_int = 82; +pub const ELIBACC: ::c_int = 83; +pub const ELIBBAD: ::c_int = 84; +pub const ELIBSCN: ::c_int = 85; +pub const ELIBMAX: ::c_int = 86; +pub const ELIBEXEC: ::c_int = 87; +pub const EILSEQ: ::c_int = 88; +pub const ERESTART: ::c_int = 91; +pub const ESTRPIPE: ::c_int = 92; +pub const EUSERS: ::c_int = 94; +pub const ENOTSOCK: ::c_int = 95; +pub const EDESTADDRREQ: ::c_int = 96; +pub const EMSGSIZE: ::c_int = 97; +pub const EPROTOTYPE: ::c_int = 98; +pub const ENOPROTOOPT: ::c_int = 99; +pub const EPROTONOSUPPORT: ::c_int = 120; +pub const ESOCKTNOSUPPORT: ::c_int = 121; +pub const EOPNOTSUPP: ::c_int = 122; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 123; +pub const EAFNOSUPPORT: ::c_int = 124; +pub const EADDRINUSE: ::c_int = 125; +pub const EADDRNOTAVAIL: ::c_int = 126; +pub const ENETDOWN: ::c_int = 127; +pub const ENETUNREACH: ::c_int = 128; +pub const ENETRESET: ::c_int = 129; +pub const ECONNABORTED: ::c_int = 130; +pub const ECONNRESET: ::c_int = 131; +pub const ENOBUFS: ::c_int = 132; +pub const EISCONN: ::c_int = 133; +pub const ENOTCONN: ::c_int = 134; +pub const ESHUTDOWN: ::c_int = 143; +pub const ETOOMANYREFS: ::c_int = 144; +pub const ETIMEDOUT: ::c_int = 145; +pub const ECONNREFUSED: ::c_int = 146; +pub const EHOSTDOWN: ::c_int = 147; +pub const EHOSTUNREACH: ::c_int = 148; +pub const EALREADY: ::c_int = 149; +pub const EINPROGRESS: ::c_int = 150; +pub const ESTALE: ::c_int = 151; +pub const EUCLEAN: ::c_int = 135; +pub const ENOTNAM: ::c_int = 137; +pub const ENAVAIL: ::c_int = 138; +pub const EISNAM: ::c_int = 139; +pub const EREMOTEIO: ::c_int = 140; +pub const EDQUOT: ::c_int = 1133; +pub const ENOMEDIUM: ::c_int = 159; +pub const EMEDIUMTYPE: ::c_int = 160; +pub const ECANCELED: ::c_int = 158; +pub const ENOKEY: ::c_int = 161; +pub const EKEYEXPIRED: ::c_int = 162; +pub const EKEYREVOKED: ::c_int = 163; +pub const EKEYREJECTED: ::c_int = 164; +pub const EOWNERDEAD: ::c_int = 165; +pub const ENOTRECOVERABLE: ::c_int = 166; +pub const ERFKILL: ::c_int = 167; + +pub const MAP_ANON: ::c_int = 0x800; +pub const MAP_GROWSDOWN: ::c_int = 0x1000; +pub const MAP_DENYWRITE: ::c_int = 0x2000; +pub const MAP_EXECUTABLE: ::c_int = 0x4000; +pub const MAP_LOCKED: ::c_int = 0x8000; +pub const MAP_NORESERVE: ::c_int = 0x400; +pub const MAP_POPULATE: ::c_int = 0x10000; +pub const MAP_NONBLOCK: ::c_int = 0x20000; +pub const MAP_STACK: ::c_int = 0x40000; +pub const MAP_HUGETLB: ::c_int = 0x080000; + +pub const SOCK_STREAM: ::c_int = 2; +pub const SOCK_DGRAM: ::c_int = 1; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000008; +pub const SA_NOCLDWAIT: ::c_int = 0x00010000; + +pub const SIGCHLD: ::c_int = 18; +pub const SIGBUS: ::c_int = 10; +pub const SIGTTIN: ::c_int = 26; +pub const SIGTTOU: ::c_int = 27; +pub const SIGXCPU: ::c_int = 30; +pub const SIGXFSZ: ::c_int = 31; +pub const SIGVTALRM: ::c_int = 28; +pub const SIGPROF: ::c_int = 29; +pub const SIGWINCH: ::c_int = 20; +pub const SIGUSR1: ::c_int = 16; +pub const SIGUSR2: ::c_int = 17; +pub const SIGCONT: ::c_int = 25; +pub const SIGSTOP: ::c_int = 23; +pub const SIGTSTP: ::c_int = 24; +pub const SIGURG: ::c_int = 21; +pub const SIGIO: ::c_int = 22; +pub const SIGSYS: ::c_int = 12; +pub const SIGPOLL: ::c_int = 22; +pub const SIGPWR: ::c_int = 19; +pub const SIG_SETMASK: ::c_int = 3; +pub const SIG_BLOCK: ::c_int = 0x1; +pub const SIG_UNBLOCK: ::c_int = 0x2; + +pub const POLLWRNORM: ::c_short = 0x004; +pub const POLLWRBAND: ::c_short = 0x100; + +pub const VEOF: usize = 16; +pub const VEOL: usize = 17; +pub const VEOL2: usize = 6; +pub const VMIN: usize = 4; +pub const IEXTEN: ::tcflag_t = 0x00000100; +pub const TOSTOP: ::tcflag_t = 0x00008000; +pub const FLUSHO: ::tcflag_t = 0x00002000; +pub const EXTPROC: ::tcflag_t = 0o200000; + +pub const F_GETLK: ::c_int = 14; +pub const F_GETOWN: ::c_int = 23; +pub const F_SETOWN: ::c_int = 24; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const EHWPOISON: ::c_int = 168; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..34c63bc69cc8b551f2673ef211bda134c801a25d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/mod.rs @@ -0,0 +1,166 @@ +pub type c_long = i64; +pub type c_ulong = u64; +pub type regoff_t = ::c_long; + +s! { + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct pthread_attr_t { + __size: [u64; 7] + } + + pub struct sigset_t { + __val: [::c_ulong; 16], + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::c_ulong, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + pub msg_rtime: ::time_t, + pub msg_ctime: ::time_t, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __pad1: ::c_ulong, + __pad2: ::c_ulong, + } + + pub struct statfs { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + #[cfg(target_endian = "big")] + __pad1: ::c_int, + pub msg_iovlen: ::c_int, + #[cfg(target_endian = "little")] + __pad1: ::c_int, + pub msg_control: *mut ::c_void, + #[cfg(target_endian = "big")] + __pad2: ::c_int, + pub msg_controllen: ::socklen_t, + #[cfg(target_endian = "little")] + __pad2: ::c_int, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + #[cfg(target_endian = "big")] + pub __pad1: ::c_int, + pub cmsg_len: ::socklen_t, + #[cfg(target_endian = "little")] + pub __pad1: ::c_int, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct sem_t { + __val: [::c_int; 8], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub _pad: [::c_int; 29], + _align: [usize; 0], + } +} + +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; + +pub const SOCK_NONBLOCK: ::c_int = 2048; + +pub const SOCK_SEQPACKET: ::c_int = 5; + +extern "C" { + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; +} + +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(target_arch = "mips64")] { + mod mips64; + pub use self::mips64::*; + } else if #[cfg(any(target_arch = "powerpc64"))] { + mod powerpc64; + pub use self::powerpc64::*; + } else if #[cfg(any(target_arch = "s390x"))] { + mod s390x; + pub use self::s390x::*; + } else if #[cfg(any(target_arch = "x86_64"))] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(any(target_arch = "riscv64"))] { + mod riscv64; + pub use self::riscv64::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs new file mode 100644 index 0000000000000000000000000000000000000000..f17d72cb14fdbcb5528ec03065b86e4fb3acf04e --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/powerpc64.rs @@ -0,0 +1,685 @@ +pub type c_char = u8; +pub type wchar_t = i32; +pub type __u64 = ::c_ulong; +pub type nlink_t = u64; +pub type blksize_t = ::c_long; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __reserved: [::c_long; 3], + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __unused1: ::c_long, + __unused2: ::c_long + } +} + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_32BIT: ::c_int = 0x0040; +pub const O_APPEND: ::c_int = 1024; +pub const O_DIRECT: ::c_int = 0x20000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_LARGEFILE: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_ASYNC: ::c_int = 0x2000; + +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EBADMSG: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const ERFKILL: ::c_int = 132; +pub const EHWPOISON: ::c_int = 133; + +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_SETOWN: ::c_int = 8; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const VEOF: usize = 4; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const SIGSTKSZ: ::size_t = 10240; +pub const MINSIGSTKSZ: ::size_t = 4096; + +// Syscall table +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_waitpid: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_time: ::c_long = 13; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_break: ::c_long = 17; +pub const SYS_oldstat: ::c_long = 18; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_stime: ::c_long = 25; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_oldfstat: ::c_long = 28; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_stty: ::c_long = 31; +pub const SYS_gtty: ::c_long = 32; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_ftime: ::c_long = 35; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_prof: ::c_long = 44; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_signal: ::c_long = 48; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_lock: ::c_long = 53; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_mpx: ::c_long = 56; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_ulimit: ::c_long = 58; +pub const SYS_oldolduname: ::c_long = 59; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sgetmask: ::c_long = 68; +pub const SYS_ssetmask: ::c_long = 69; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrlimit: ::c_long = 76; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_select: ::c_long = 82; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_oldlstat: ::c_long = 84; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_profil: ::c_long = 98; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_ioperm: ::c_long = 101; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_olduname: ::c_long = 109; +pub const SYS_iopl: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_vm86: ::c_long = 113; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_modify_ldt: ::c_long = 123; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */ +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_query_module: ::c_long = 166; +pub const SYS_poll: ::c_long = 167; +pub const SYS_nfsservctl: ::c_long = 168; +pub const SYS_setresgid: ::c_long = 169; +pub const SYS_getresgid: ::c_long = 170; +pub const SYS_prctl: ::c_long = 171; +pub const SYS_rt_sigreturn: ::c_long = 172; +pub const SYS_rt_sigaction: ::c_long = 173; +pub const SYS_rt_sigprocmask: ::c_long = 174; +pub const SYS_rt_sigpending: ::c_long = 175; +pub const SYS_rt_sigtimedwait: ::c_long = 176; +pub const SYS_rt_sigqueueinfo: ::c_long = 177; +pub const SYS_rt_sigsuspend: ::c_long = 178; +pub const SYS_pread64: ::c_long = 179; +pub const SYS_pwrite64: ::c_long = 180; +pub const SYS_chown: ::c_long = 181; +pub const SYS_getcwd: ::c_long = 182; +pub const SYS_capget: ::c_long = 183; +pub const SYS_capset: ::c_long = 184; +pub const SYS_sigaltstack: ::c_long = 185; +pub const SYS_sendfile: ::c_long = 186; +pub const SYS_getpmsg: ::c_long = 187; /* some people actually want streams */ +pub const SYS_putpmsg: ::c_long = 188; /* some people actually want streams */ +pub const SYS_vfork: ::c_long = 189; +pub const SYS_ugetrlimit: ::c_long = 190; /* SuS compliant getrlimit */ +pub const SYS_readahead: ::c_long = 191; +pub const SYS_pciconfig_read: ::c_long = 198; +pub const SYS_pciconfig_write: ::c_long = 199; +pub const SYS_pciconfig_iobase: ::c_long = 200; +pub const SYS_multiplexer: ::c_long = 201; +pub const SYS_getdents64: ::c_long = 202; +pub const SYS_pivot_root: ::c_long = 203; +pub const SYS_madvise: ::c_long = 205; +pub const SYS_mincore: ::c_long = 206; +pub const SYS_gettid: ::c_long = 207; +pub const SYS_tkill: ::c_long = 208; +pub const SYS_setxattr: ::c_long = 209; +pub const SYS_lsetxattr: ::c_long = 210; +pub const SYS_fsetxattr: ::c_long = 211; +pub const SYS_getxattr: ::c_long = 212; +pub const SYS_lgetxattr: ::c_long = 213; +pub const SYS_fgetxattr: ::c_long = 214; +pub const SYS_listxattr: ::c_long = 215; +pub const SYS_llistxattr: ::c_long = 216; +pub const SYS_flistxattr: ::c_long = 217; +pub const SYS_removexattr: ::c_long = 218; +pub const SYS_lremovexattr: ::c_long = 219; +pub const SYS_fremovexattr: ::c_long = 220; +pub const SYS_futex: ::c_long = 221; +pub const SYS_sched_setaffinity: ::c_long = 222; +pub const SYS_sched_getaffinity: ::c_long = 223; +pub const SYS_tuxcall: ::c_long = 225; +pub const SYS_io_setup: ::c_long = 227; +pub const SYS_io_destroy: ::c_long = 228; +pub const SYS_io_getevents: ::c_long = 229; +pub const SYS_io_submit: ::c_long = 230; +pub const SYS_io_cancel: ::c_long = 231; +pub const SYS_set_tid_address: ::c_long = 232; +pub const SYS_exit_group: ::c_long = 234; +pub const SYS_lookup_dcookie: ::c_long = 235; +pub const SYS_epoll_create: ::c_long = 236; +pub const SYS_epoll_ctl: ::c_long = 237; +pub const SYS_epoll_wait: ::c_long = 238; +pub const SYS_remap_file_pages: ::c_long = 239; +pub const SYS_timer_create: ::c_long = 240; +pub const SYS_timer_settime: ::c_long = 241; +pub const SYS_timer_gettime: ::c_long = 242; +pub const SYS_timer_getoverrun: ::c_long = 243; +pub const SYS_timer_delete: ::c_long = 244; +pub const SYS_clock_settime: ::c_long = 245; +pub const SYS_clock_gettime: ::c_long = 246; +pub const SYS_clock_getres: ::c_long = 247; +pub const SYS_clock_nanosleep: ::c_long = 248; +pub const SYS_swapcontext: ::c_long = 249; +pub const SYS_tgkill: ::c_long = 250; +pub const SYS_utimes: ::c_long = 251; +pub const SYS_statfs64: ::c_long = 252; +pub const SYS_fstatfs64: ::c_long = 253; +pub const SYS_rtas: ::c_long = 255; +pub const SYS_sys_debug_setcontext: ::c_long = 256; +pub const SYS_migrate_pages: ::c_long = 258; +pub const SYS_mbind: ::c_long = 259; +pub const SYS_get_mempolicy: ::c_long = 260; +pub const SYS_set_mempolicy: ::c_long = 261; +pub const SYS_mq_open: ::c_long = 262; +pub const SYS_mq_unlink: ::c_long = 263; +pub const SYS_mq_timedsend: ::c_long = 264; +pub const SYS_mq_timedreceive: ::c_long = 265; +pub const SYS_mq_notify: ::c_long = 266; +pub const SYS_mq_getsetattr: ::c_long = 267; +pub const SYS_kexec_load: ::c_long = 268; +pub const SYS_add_key: ::c_long = 269; +pub const SYS_request_key: ::c_long = 270; +pub const SYS_keyctl: ::c_long = 271; +pub const SYS_waitid: ::c_long = 272; +pub const SYS_ioprio_set: ::c_long = 273; +pub const SYS_ioprio_get: ::c_long = 274; +pub const SYS_inotify_init: ::c_long = 275; +pub const SYS_inotify_add_watch: ::c_long = 276; +pub const SYS_inotify_rm_watch: ::c_long = 277; +pub const SYS_spu_run: ::c_long = 278; +pub const SYS_spu_create: ::c_long = 279; +pub const SYS_pselect6: ::c_long = 280; +pub const SYS_ppoll: ::c_long = 281; +pub const SYS_unshare: ::c_long = 282; +pub const SYS_splice: ::c_long = 283; +pub const SYS_tee: ::c_long = 284; +pub const SYS_vmsplice: ::c_long = 285; +pub const SYS_openat: ::c_long = 286; +pub const SYS_mkdirat: ::c_long = 287; +pub const SYS_mknodat: ::c_long = 288; +pub const SYS_fchownat: ::c_long = 289; +pub const SYS_futimesat: ::c_long = 290; +pub const SYS_newfstatat: ::c_long = 291; +pub const SYS_unlinkat: ::c_long = 292; +pub const SYS_renameat: ::c_long = 293; +pub const SYS_linkat: ::c_long = 294; +pub const SYS_symlinkat: ::c_long = 295; +pub const SYS_readlinkat: ::c_long = 296; +pub const SYS_fchmodat: ::c_long = 297; +pub const SYS_faccessat: ::c_long = 298; +pub const SYS_get_robust_list: ::c_long = 299; +pub const SYS_set_robust_list: ::c_long = 300; +pub const SYS_move_pages: ::c_long = 301; +pub const SYS_getcpu: ::c_long = 302; +pub const SYS_epoll_pwait: ::c_long = 303; +pub const SYS_utimensat: ::c_long = 304; +pub const SYS_signalfd: ::c_long = 305; +pub const SYS_timerfd_create: ::c_long = 306; +pub const SYS_eventfd: ::c_long = 307; +pub const SYS_sync_file_range2: ::c_long = 308; +pub const SYS_fallocate: ::c_long = 309; +pub const SYS_subpage_prot: ::c_long = 310; +pub const SYS_timerfd_settime: ::c_long = 311; +pub const SYS_timerfd_gettime: ::c_long = 312; +pub const SYS_signalfd4: ::c_long = 313; +pub const SYS_eventfd2: ::c_long = 314; +pub const SYS_epoll_create1: ::c_long = 315; +pub const SYS_dup3: ::c_long = 316; +pub const SYS_pipe2: ::c_long = 317; +pub const SYS_inotify_init1: ::c_long = 318; +pub const SYS_perf_event_open: ::c_long = 319; +pub const SYS_preadv: ::c_long = 320; +pub const SYS_pwritev: ::c_long = 321; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 322; +pub const SYS_fanotify_init: ::c_long = 323; +pub const SYS_fanotify_mark: ::c_long = 324; +pub const SYS_prlimit64: ::c_long = 325; +pub const SYS_socket: ::c_long = 326; +pub const SYS_bind: ::c_long = 327; +pub const SYS_connect: ::c_long = 328; +pub const SYS_listen: ::c_long = 329; +pub const SYS_accept: ::c_long = 330; +pub const SYS_getsockname: ::c_long = 331; +pub const SYS_getpeername: ::c_long = 332; +pub const SYS_socketpair: ::c_long = 333; +pub const SYS_send: ::c_long = 334; +pub const SYS_sendto: ::c_long = 335; +pub const SYS_recv: ::c_long = 336; +pub const SYS_recvfrom: ::c_long = 337; +pub const SYS_shutdown: ::c_long = 338; +pub const SYS_setsockopt: ::c_long = 339; +pub const SYS_getsockopt: ::c_long = 340; +pub const SYS_sendmsg: ::c_long = 341; +pub const SYS_recvmsg: ::c_long = 342; +pub const SYS_recvmmsg: ::c_long = 343; +pub const SYS_accept4: ::c_long = 344; +pub const SYS_name_to_handle_at: ::c_long = 345; +pub const SYS_open_by_handle_at: ::c_long = 346; +pub const SYS_clock_adjtime: ::c_long = 347; +pub const SYS_syncfs: ::c_long = 348; +pub const SYS_sendmmsg: ::c_long = 349; +pub const SYS_setns: ::c_long = 350; +pub const SYS_process_vm_readv: ::c_long = 351; +pub const SYS_process_vm_writev: ::c_long = 352; +pub const SYS_finit_module: ::c_long = 353; +pub const SYS_kcmp: ::c_long = 354; +pub const SYS_sched_setattr: ::c_long = 355; +pub const SYS_sched_getattr: ::c_long = 356; +pub const SYS_renameat2: ::c_long = 357; +pub const SYS_seccomp: ::c_long = 358; +pub const SYS_getrandom: ::c_long = 359; +pub const SYS_memfd_create: ::c_long = 360; +pub const SYS_bpf: ::c_long = 361; +pub const SYS_execveat: ::c_long = 362; +pub const SYS_switch_endian: ::c_long = 363; +pub const SYS_userfaultfd: ::c_long = 364; +pub const SYS_membarrier: ::c_long = 365; +pub const SYS_mlock2: ::c_long = 378; +pub const SYS_copy_file_range: ::c_long = 379; +pub const SYS_preadv2: ::c_long = 380; +pub const SYS_pwritev2: ::c_long = 381; +pub const SYS_kexec_file_load: ::c_long = 382; +pub const SYS_statx: ::c_long = 383; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +pub const EDEADLK: ::c_int = 58; +pub const EDEADLOCK: ::c_int = EDEADLK; + +pub const EXTPROC: ::tcflag_t = 0x10000000; +pub const VEOL: usize = 6; +pub const VEOL2: usize = 8; +pub const VMIN: usize = 5; +pub const IEXTEN: ::tcflag_t = 0x00000400; +pub const TOSTOP: ::tcflag_t = 0x00400000; +pub const FLUSHO: ::tcflag_t = 0x00800000; + +pub const MCL_CURRENT: ::c_int = 0x2000; +pub const MCL_FUTURE: ::c_int = 0x4000; +pub const CBAUD: ::tcflag_t = 0xff; +pub const TAB1: ::c_int = 0x400; +pub const TAB2: ::c_int = 0x800; +pub const TAB3: ::c_int = 0xc00; +pub const CR1: ::c_int = 0x1000; +pub const CR2: ::c_int = 0x2000; +pub const CR3: ::c_int = 0x3000; +pub const FF1: ::c_int = 0x4000; +pub const BS1: ::c_int = 0x8000; +pub const VT1: ::c_int = 0x10000; +pub const VWERASE: usize = 10; +pub const VREPRINT: usize = 11; +pub const VSUSP: usize = 12; +pub const VSTART: usize = 13; +pub const VSTOP: usize = 14; +pub const VDISCARD: usize = 16; +pub const VTIME: usize = 7; +pub const IXON: ::tcflag_t = 0x00000200; +pub const IXOFF: ::tcflag_t = 0x00000400; +pub const ONLCR: ::tcflag_t = 0x2; +pub const CSIZE: ::tcflag_t = 0x00000300; + +pub const CS6: ::tcflag_t = 0x00000100; +pub const CS7: ::tcflag_t = 0x00000200; +pub const CS8: ::tcflag_t = 0x00000300; +pub const CSTOPB: ::tcflag_t = 0x00000400; +pub const CREAD: ::tcflag_t = 0x00000800; +pub const PARENB: ::tcflag_t = 0x00001000; +pub const PARODD: ::tcflag_t = 0x00002000; +pub const HUPCL: ::tcflag_t = 0x00004000; +pub const CLOCAL: ::tcflag_t = 0x00008000; +pub const ECHOKE: ::tcflag_t = 0x00000001; +pub const ECHOE: ::tcflag_t = 0x00000002; +pub const ECHOK: ::tcflag_t = 0x00000004; +pub const ECHONL: ::tcflag_t = 0x00000010; +pub const ECHOPRT: ::tcflag_t = 0x00000020; +pub const ECHOCTL: ::tcflag_t = 0x00000040; +pub const ISIG: ::tcflag_t = 0x00000080; +pub const ICANON: ::tcflag_t = 0x00000100; +pub const PENDIN: ::tcflag_t = 0x20000000; +pub const NOFLSH: ::tcflag_t = 0x80000000; + +pub const CIBAUD: ::tcflag_t = 0o77600000; +pub const CBAUDEX: ::tcflag_t = 0o0000020; +pub const VSWTC: usize = 9; +pub const OLCUC: ::tcflag_t = 0o000004; +pub const NLDLY: ::tcflag_t = 0o0001400; +pub const CRDLY: ::tcflag_t = 0o0030000; +pub const TABDLY: ::tcflag_t = 0o0006000; +pub const BSDLY: ::tcflag_t = 0o0100000; +pub const FFDLY: ::tcflag_t = 0o0040000; +pub const VTDLY: ::tcflag_t = 0o0200000; +pub const XTABS: ::tcflag_t = 0o00006000; + +pub const B57600: ::speed_t = 0o00020; +pub const B115200: ::speed_t = 0o00021; +pub const B230400: ::speed_t = 0o00022; +pub const B460800: ::speed_t = 0o00023; +pub const B500000: ::speed_t = 0o00024; +pub const B576000: ::speed_t = 0o00025; +pub const B921600: ::speed_t = 0o00026; +pub const B1000000: ::speed_t = 0o00027; +pub const B1152000: ::speed_t = 0o00030; +pub const B1500000: ::speed_t = 0o00031; +pub const B2000000: ::speed_t = 0o00032; +pub const B2500000: ::speed_t = 0o00033; +pub const B3000000: ::speed_t = 0o00034; +pub const B3500000: ::speed_t = 0o00035; +pub const B4000000: ::speed_t = 0o00036; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..48d152a5721ec7ee762b70b5c4989e6bcc3ad9cf --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/align.rs @@ -0,0 +1,44 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + pub struct ucontext_t { + pub __uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: mcontext_t, + } + + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct mcontext_t { + pub __gregs: [::c_ulong; 32], + pub __fpregs: __riscv_mc_fp_state, + } + + #[allow(missing_debug_implementations)] + pub union __riscv_mc_fp_state { + pub __f: __riscv_mc_f_ext_state, + pub __d: __riscv_mc_d_ext_state, + pub __q: __riscv_mc_q_ext_state, + } + + #[allow(missing_debug_implementations)] + pub struct __riscv_mc_f_ext_state { + pub __f: [::c_uint; 32], + pub __fcsr: ::c_uint, + } + + #[allow(missing_debug_implementations)] + pub struct __riscv_mc_d_ext_state { + pub __f: [::c_ulonglong; 32], + pub __fcsr: ::c_uint, + } + + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct __riscv_mc_q_ext_state { + pub __f: [::c_ulonglong; 64], + pub __fcsr: ::c_uint, + pub __glibc_reserved: [::c_uint; 3], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..fcb28c3cf29f53be3606d40467513bd527842c55 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs @@ -0,0 +1,741 @@ +//! RISC-V-specific definitions for 64-bit linux-like values + +pub type c_char = u8; +pub type wchar_t = ::c_int; + +pub type nlink_t = ::c_uint; +pub type blksize_t = ::c_int; +pub type fsblkcnt64_t = ::c_ulong; +pub type fsfilcnt64_t = ::c_ulong; +pub type __u64 = ::c_ulonglong; + +s! { + pub struct pthread_attr_t { + __size: [::c_ulong; 7], + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub __pad1: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub __pad2: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2usize], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub __pad1: ::dev_t, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub __pad2: ::c_int, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_int; 2], + } + + pub struct statfs { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_long, + pub f_frsize: ::c_long, + pub f_flags: ::c_long, + pub f_spare: [::c_long; 4], + } + + pub struct statfs64 { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsfilcnt64_t, + pub f_ffree: ::fsfilcnt64_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_long, + pub f_frsize: ::c_long, + pub f_flags: ::c_long, + pub f_spare: [::c_long; 4], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + pub __f_spare: [::c_int; 6], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsfilcnt64_t, + pub f_ffree: ::fsfilcnt64_t, + pub f_favail: ::fsfilcnt64_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + pub __f_spare: [::c_int; 6], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + #[doc(hidden)] + #[deprecated( + since="0.2.54", + note="Please leave a comment on \ + https://github.com/rust-lang/libc/pull/1316 if you're using \ + this field" + )] + pub _pad: [::c_int; 29], + _align: [u64; 0], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t, + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_ushort, + __pad1: ::c_ushort, + pub __seq: ::c_ushort, + __pad2: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused5: ::c_ulong, + __unused6: ::c_ulong, + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct flock64 { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off64_t, + pub l_len: ::off64_t, + pub l_pid: ::pid_t, + } +} + +pub const SYS_read: ::c_long = 63; +pub const SYS_write: ::c_long = 64; +pub const SYS_close: ::c_long = 57; +pub const SYS_fstat: ::c_long = 80; +pub const SYS_lseek: ::c_long = 62; +pub const SYS_mmap: ::c_long = 222; +pub const SYS_mprotect: ::c_long = 226; +pub const SYS_munmap: ::c_long = 215; +pub const SYS_brk: ::c_long = 214; +pub const SYS_rt_sigaction: ::c_long = 134; +pub const SYS_rt_sigprocmask: ::c_long = 135; +pub const SYS_rt_sigreturn: ::c_long = 139; +pub const SYS_ioctl: ::c_long = 29; +pub const SYS_pread64: ::c_long = 67; +pub const SYS_pwrite64: ::c_long = 68; +pub const SYS_readv: ::c_long = 65; +pub const SYS_writev: ::c_long = 66; +pub const SYS_sched_yield: ::c_long = 124; +pub const SYS_mremap: ::c_long = 216; +pub const SYS_msync: ::c_long = 227; +pub const SYS_mincore: ::c_long = 232; +pub const SYS_madvise: ::c_long = 233; +pub const SYS_shmget: ::c_long = 194; +pub const SYS_shmat: ::c_long = 196; +pub const SYS_shmctl: ::c_long = 195; +pub const SYS_dup: ::c_long = 23; +pub const SYS_nanosleep: ::c_long = 101; +pub const SYS_getitimer: ::c_long = 102; +pub const SYS_setitimer: ::c_long = 103; +pub const SYS_getpid: ::c_long = 172; +pub const SYS_sendfile: ::c_long = 71; +pub const SYS_socket: ::c_long = 198; +pub const SYS_connect: ::c_long = 203; +pub const SYS_accept: ::c_long = 202; +pub const SYS_sendto: ::c_long = 206; +pub const SYS_recvfrom: ::c_long = 207; +pub const SYS_sendmsg: ::c_long = 211; +pub const SYS_recvmsg: ::c_long = 212; +pub const SYS_shutdown: ::c_long = 210; +pub const SYS_bind: ::c_long = 200; +pub const SYS_listen: ::c_long = 201; +pub const SYS_getsockname: ::c_long = 204; +pub const SYS_getpeername: ::c_long = 205; +pub const SYS_socketpair: ::c_long = 199; +pub const SYS_setsockopt: ::c_long = 208; +pub const SYS_getsockopt: ::c_long = 209; +pub const SYS_clone: ::c_long = 220; +pub const SYS_execve: ::c_long = 221; +pub const SYS_exit: ::c_long = 93; +pub const SYS_wait4: ::c_long = 260; +pub const SYS_kill: ::c_long = 129; +pub const SYS_uname: ::c_long = 160; +pub const SYS_semget: ::c_long = 190; +pub const SYS_semop: ::c_long = 193; +pub const SYS_semctl: ::c_long = 191; +pub const SYS_shmdt: ::c_long = 197; +pub const SYS_msgget: ::c_long = 186; +pub const SYS_msgsnd: ::c_long = 189; +pub const SYS_msgrcv: ::c_long = 188; +pub const SYS_msgctl: ::c_long = 187; +pub const SYS_fcntl: ::c_long = 25; +pub const SYS_flock: ::c_long = 32; +pub const SYS_fsync: ::c_long = 82; +pub const SYS_fdatasync: ::c_long = 83; +pub const SYS_truncate: ::c_long = 45; +pub const SYS_ftruncate: ::c_long = 46; +pub const SYS_getcwd: ::c_long = 17; +pub const SYS_chdir: ::c_long = 49; +pub const SYS_fchdir: ::c_long = 50; +pub const SYS_fchmod: ::c_long = 52; +pub const SYS_fchown: ::c_long = 55; +pub const SYS_umask: ::c_long = 166; +pub const SYS_gettimeofday: ::c_long = 169; +pub const SYS_getrlimit: ::c_long = 163; +pub const SYS_getrusage: ::c_long = 165; +pub const SYS_sysinfo: ::c_long = 179; +pub const SYS_times: ::c_long = 153; +pub const SYS_ptrace: ::c_long = 117; +pub const SYS_getuid: ::c_long = 174; +pub const SYS_syslog: ::c_long = 116; +pub const SYS_getgid: ::c_long = 176; +pub const SYS_setuid: ::c_long = 146; +pub const SYS_setgid: ::c_long = 144; +pub const SYS_geteuid: ::c_long = 175; +pub const SYS_getegid: ::c_long = 177; +pub const SYS_setpgid: ::c_long = 154; +pub const SYS_getppid: ::c_long = 173; +pub const SYS_setsid: ::c_long = 157; +pub const SYS_setreuid: ::c_long = 145; +pub const SYS_setregid: ::c_long = 143; +pub const SYS_getgroups: ::c_long = 158; +pub const SYS_setgroups: ::c_long = 159; +pub const SYS_setresuid: ::c_long = 147; +pub const SYS_getresuid: ::c_long = 148; +pub const SYS_setresgid: ::c_long = 149; +pub const SYS_getresgid: ::c_long = 150; +pub const SYS_getpgid: ::c_long = 155; +pub const SYS_setfsuid: ::c_long = 151; +pub const SYS_setfsgid: ::c_long = 152; +pub const SYS_getsid: ::c_long = 156; +pub const SYS_capget: ::c_long = 90; +pub const SYS_capset: ::c_long = 91; +pub const SYS_rt_sigpending: ::c_long = 136; +pub const SYS_rt_sigtimedwait: ::c_long = 137; +pub const SYS_rt_sigqueueinfo: ::c_long = 138; +pub const SYS_rt_sigsuspend: ::c_long = 133; +pub const SYS_sigaltstack: ::c_long = 132; +pub const SYS_personality: ::c_long = 92; +pub const SYS_statfs: ::c_long = 43; +pub const SYS_fstatfs: ::c_long = 44; +pub const SYS_getpriority: ::c_long = 141; +pub const SYS_setpriority: ::c_long = 140; +pub const SYS_sched_setparam: ::c_long = 118; +pub const SYS_sched_getparam: ::c_long = 121; +pub const SYS_sched_setscheduler: ::c_long = 119; +pub const SYS_sched_getscheduler: ::c_long = 120; +pub const SYS_sched_get_priority_max: ::c_long = 125; +pub const SYS_sched_get_priority_min: ::c_long = 126; +pub const SYS_sched_rr_get_interval: ::c_long = 127; +pub const SYS_mlock: ::c_long = 228; +pub const SYS_munlock: ::c_long = 229; +pub const SYS_mlockall: ::c_long = 230; +pub const SYS_munlockall: ::c_long = 231; +pub const SYS_vhangup: ::c_long = 58; +pub const SYS_pivot_root: ::c_long = 41; +pub const SYS_prctl: ::c_long = 167; +pub const SYS_adjtimex: ::c_long = 171; +pub const SYS_setrlimit: ::c_long = 164; +pub const SYS_chroot: ::c_long = 51; +pub const SYS_sync: ::c_long = 81; +pub const SYS_acct: ::c_long = 89; +pub const SYS_settimeofday: ::c_long = 170; +pub const SYS_mount: ::c_long = 40; +pub const SYS_umount2: ::c_long = 39; +pub const SYS_swapon: ::c_long = 224; +pub const SYS_swapoff: ::c_long = 225; +pub const SYS_reboot: ::c_long = 142; +pub const SYS_sethostname: ::c_long = 161; +pub const SYS_setdomainname: ::c_long = 162; +pub const SYS_init_module: ::c_long = 105; +pub const SYS_delete_module: ::c_long = 106; +pub const SYS_quotactl: ::c_long = 60; +pub const SYS_nfsservctl: ::c_long = 42; +pub const SYS_gettid: ::c_long = 178; +pub const SYS_readahead: ::c_long = 213; +pub const SYS_setxattr: ::c_long = 5; +pub const SYS_lsetxattr: ::c_long = 6; +pub const SYS_fsetxattr: ::c_long = 7; +pub const SYS_getxattr: ::c_long = 8; +pub const SYS_lgetxattr: ::c_long = 9; +pub const SYS_fgetxattr: ::c_long = 10; +pub const SYS_listxattr: ::c_long = 11; +pub const SYS_llistxattr: ::c_long = 12; +pub const SYS_flistxattr: ::c_long = 13; +pub const SYS_removexattr: ::c_long = 14; +pub const SYS_lremovexattr: ::c_long = 15; +pub const SYS_fremovexattr: ::c_long = 16; +pub const SYS_tkill: ::c_long = 130; +pub const SYS_futex: ::c_long = 98; +pub const SYS_sched_setaffinity: ::c_long = 122; +pub const SYS_sched_getaffinity: ::c_long = 123; +pub const SYS_io_setup: ::c_long = 0; +pub const SYS_io_destroy: ::c_long = 1; +pub const SYS_io_getevents: ::c_long = 4; +pub const SYS_io_submit: ::c_long = 2; +pub const SYS_io_cancel: ::c_long = 3; +pub const SYS_lookup_dcookie: ::c_long = 18; +pub const SYS_remap_file_pages: ::c_long = 234; +pub const SYS_getdents64: ::c_long = 61; +pub const SYS_set_tid_address: ::c_long = 96; +pub const SYS_restart_syscall: ::c_long = 128; +pub const SYS_semtimedop: ::c_long = 192; +pub const SYS_fadvise64: ::c_long = 223; +pub const SYS_timer_create: ::c_long = 107; +pub const SYS_timer_settime: ::c_long = 110; +pub const SYS_timer_gettime: ::c_long = 108; +pub const SYS_timer_getoverrun: ::c_long = 109; +pub const SYS_timer_delete: ::c_long = 111; +pub const SYS_clock_settime: ::c_long = 112; +pub const SYS_clock_gettime: ::c_long = 113; +pub const SYS_clock_getres: ::c_long = 114; +pub const SYS_clock_nanosleep: ::c_long = 115; +pub const SYS_exit_group: ::c_long = 94; +pub const SYS_epoll_ctl: ::c_long = 21; +pub const SYS_tgkill: ::c_long = 131; +pub const SYS_mbind: ::c_long = 235; +pub const SYS_set_mempolicy: ::c_long = 237; +pub const SYS_get_mempolicy: ::c_long = 236; +pub const SYS_mq_open: ::c_long = 180; +pub const SYS_mq_unlink: ::c_long = 181; +pub const SYS_mq_timedsend: ::c_long = 182; +pub const SYS_mq_timedreceive: ::c_long = 183; +pub const SYS_mq_notify: ::c_long = 184; +pub const SYS_mq_getsetattr: ::c_long = 185; +pub const SYS_kexec_load: ::c_long = 104; +pub const SYS_waitid: ::c_long = 95; +pub const SYS_add_key: ::c_long = 217; +pub const SYS_request_key: ::c_long = 218; +pub const SYS_keyctl: ::c_long = 219; +pub const SYS_ioprio_set: ::c_long = 30; +pub const SYS_ioprio_get: ::c_long = 31; +pub const SYS_inotify_add_watch: ::c_long = 27; +pub const SYS_inotify_rm_watch: ::c_long = 28; +pub const SYS_migrate_pages: ::c_long = 238; +pub const SYS_openat: ::c_long = 56; +pub const SYS_mkdirat: ::c_long = 34; +pub const SYS_mknodat: ::c_long = 33; +pub const SYS_fchownat: ::c_long = 54; +pub const SYS_newfstatat: ::c_long = 79; +pub const SYS_unlinkat: ::c_long = 35; +pub const SYS_linkat: ::c_long = 37; +pub const SYS_symlinkat: ::c_long = 36; +pub const SYS_readlinkat: ::c_long = 78; +pub const SYS_fchmodat: ::c_long = 53; +pub const SYS_faccessat: ::c_long = 48; +pub const SYS_pselect6: ::c_long = 72; +pub const SYS_ppoll: ::c_long = 73; +pub const SYS_unshare: ::c_long = 97; +pub const SYS_set_robust_list: ::c_long = 99; +pub const SYS_get_robust_list: ::c_long = 100; +pub const SYS_splice: ::c_long = 76; +pub const SYS_tee: ::c_long = 77; +pub const SYS_sync_file_range: ::c_long = 84; +pub const SYS_vmsplice: ::c_long = 75; +pub const SYS_move_pages: ::c_long = 239; +pub const SYS_utimensat: ::c_long = 88; +pub const SYS_epoll_pwait: ::c_long = 22; +pub const SYS_timerfd_create: ::c_long = 85; +pub const SYS_fallocate: ::c_long = 47; +pub const SYS_timerfd_settime: ::c_long = 86; +pub const SYS_timerfd_gettime: ::c_long = 87; +pub const SYS_accept4: ::c_long = 242; +pub const SYS_signalfd4: ::c_long = 74; +pub const SYS_eventfd2: ::c_long = 19; +pub const SYS_epoll_create1: ::c_long = 20; +pub const SYS_dup3: ::c_long = 24; +pub const SYS_pipe2: ::c_long = 59; +pub const SYS_inotify_init1: ::c_long = 26; +pub const SYS_preadv: ::c_long = 69; +pub const SYS_pwritev: ::c_long = 70; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 240; +pub const SYS_perf_event_open: ::c_long = 241; +pub const SYS_recvmmsg: ::c_long = 243; +pub const SYS_fanotify_init: ::c_long = 262; +pub const SYS_fanotify_mark: ::c_long = 263; +pub const SYS_prlimit64: ::c_long = 261; +pub const SYS_name_to_handle_at: ::c_long = 264; +pub const SYS_open_by_handle_at: ::c_long = 265; +pub const SYS_clock_adjtime: ::c_long = 266; +pub const SYS_syncfs: ::c_long = 267; +pub const SYS_sendmmsg: ::c_long = 269; +pub const SYS_setns: ::c_long = 268; +pub const SYS_getcpu: ::c_long = 168; +pub const SYS_process_vm_readv: ::c_long = 270; +pub const SYS_process_vm_writev: ::c_long = 271; +pub const SYS_kcmp: ::c_long = 272; +pub const SYS_finit_module: ::c_long = 273; +pub const SYS_sched_setattr: ::c_long = 274; +pub const SYS_sched_getattr: ::c_long = 275; +pub const SYS_renameat2: ::c_long = 276; +pub const SYS_seccomp: ::c_long = 277; +pub const SYS_getrandom: ::c_long = 278; +pub const SYS_memfd_create: ::c_long = 279; +pub const SYS_bpf: ::c_long = 280; +pub const SYS_execveat: ::c_long = 281; +pub const SYS_userfaultfd: ::c_long = 282; +pub const SYS_membarrier: ::c_long = 283; +pub const SYS_mlock2: ::c_long = 284; +pub const SYS_copy_file_range: ::c_long = 285; +pub const SYS_preadv2: ::c_long = 286; +pub const SYS_pwritev2: ::c_long = 287; +pub const SYS_pkey_mprotect: ::c_long = 288; +pub const SYS_pkey_alloc: ::c_long = 289; +pub const SYS_pkey_free: ::c_long = 290; +pub const SYS_statx: ::c_long = 291; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +pub const O_APPEND: ::c_int = 1024; +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_LARGEFILE: ::c_int = 0; +pub const O_NOFOLLOW: ::c_int = 0x20000; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_ASYNC: ::c_int = 0x2000; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_SETOWN: ::c_int = 8; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const VEOF: usize = 4; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::c_int = 0x00000800; +pub const TAB2: ::c_int = 0x00001000; +pub const TAB3: ::c_int = 0x00001800; +pub const CR1: ::c_int = 0x00000200; +pub const CR2: ::c_int = 0x00000400; +pub const CR3: ::c_int = 0x00000600; +pub const FF1: ::c_int = 0x00008000; +pub const BS1: ::c_int = 0x00002000; +pub const VT1: ::c_int = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const EDEADLK: ::c_int = 35; +pub const EDEADLOCK: ::c_int = EDEADLK; +pub const EXTPROC: ::tcflag_t = 0x00010000; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; + +pub const NGREG: usize = 32; +pub const REG_PC: usize = 0; +pub const REG_RA: usize = 1; +pub const REG_SP: usize = 2; +pub const REG_TP: usize = 4; +pub const REG_S0: usize = 8; +pub const REG_S1: usize = 9; +pub const REG_A0: usize = 10; +pub const REG_S2: usize = 18; +pub const REG_NARGS: usize = 8; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs new file mode 100644 index 0000000000000000000000000000000000000000..cb6237abcfaf2bd385e7f6321d96279bfdbf16fc --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/s390x.rs @@ -0,0 +1,712 @@ +pub type blksize_t = i64; +pub type c_char = u8; +pub type nlink_t = u64; +pub type wchar_t = i32; +pub type greg_t = u64; +pub type __u64 = u64; + +s! { + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __pad1: ::c_long, + __pad2: ::c_long, + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + __unused: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + __unused: [::c_long; 3], + } + + pub struct statfs { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } + + pub struct statfs64 { + pub f_type: ::c_ulong, + pub f_bsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_flags: ::c_ulong, + pub f_spare: [::c_ulong; 4], + } +} + +s_no_extra_traits! { + // FIXME: This is actually a union. + pub struct fpreg_t { + pub d: ::c_double, + // f: ::c_float, + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for fpreg_t { + fn eq(&self, other: &fpreg_t) -> bool { + self.d == other.d + } + } + + impl Eq for fpreg_t {} + + impl ::fmt::Debug for fpreg_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fpreg_t") + .field("d", &self.d) + .finish() + } + } + + impl ::hash::Hash for fpreg_t { + fn hash(&self, state: &mut H) { + let d: u64 = unsafe { ::mem::transmute(self.d) }; + d.hash(state); + } + } + } +} + +pub const VEOF: usize = 4; +pub const RTLD_DEEPBIND: ::c_int = 0x8; + +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNREFUSED: ::c_int = 111; +pub const ECONNRESET: ::c_int = 104; +pub const EDEADLK: ::c_int = 35; +pub const ENOSYS: ::c_int = 38; +pub const ENOTCONN: ::c_int = 107; +pub const ETIMEDOUT: ::c_int = 110; +pub const O_APPEND: ::c_int = 1024; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NONBLOCK: ::c_int = 2048; +pub const SA_NOCLDWAIT: ::c_int = 2; +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 4; +pub const SIGBUS: ::c_int = 7; +pub const SIGSTKSZ: ::size_t = 0x2000; +pub const MINSIGSTKSZ: ::size_t = 2048; +pub const SIG_SETMASK: ::c_int = 2; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const O_NOCTTY: ::c_int = 256; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_FSYNC: ::c_int = 0x101000; +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; + +pub const EDEADLOCK: ::c_int = 35; +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EBADMSG: ::c_int = 74; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const EHWPOISON: ::c_int = 133; +pub const ERFKILL: ::c_int = 132; + +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGCHLD: ::c_int = 17; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const O_ASYNC: ::c_int = 0x2000; + +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; + +pub const EXTPROC: ::tcflag_t = 0x00010000; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETOWN: ::c_int = 8; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const VTIME: usize = 5; +pub const VSWTC: usize = 7; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VSUSP: usize = 10; +pub const VREPRINT: usize = 12; +pub const VDISCARD: usize = 13; +pub const VWERASE: usize = 14; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const ONLCR: ::tcflag_t = 0o000004; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const FF1: ::tcflag_t = 0x00008000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const XTABS: ::tcflag_t = 0o014000; + +pub const CBAUD: ::speed_t = 0o010017; +pub const CSIZE: ::tcflag_t = 0o000060; +pub const CS6: ::tcflag_t = 0o000020; +pub const CS7: ::tcflag_t = 0o000040; +pub const CS8: ::tcflag_t = 0o000060; +pub const CSTOPB: ::tcflag_t = 0o000100; +pub const CREAD: ::tcflag_t = 0o000200; +pub const PARENB: ::tcflag_t = 0o000400; +pub const PARODD: ::tcflag_t = 0o001000; +pub const HUPCL: ::tcflag_t = 0o002000; +pub const CLOCAL: ::tcflag_t = 0o004000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; +pub const CIBAUD: ::tcflag_t = 0o02003600000; + +pub const ISIG: ::tcflag_t = 0o000001; +pub const ICANON: ::tcflag_t = 0o000002; +pub const XCASE: ::tcflag_t = 0o000004; +pub const ECHOE: ::tcflag_t = 0o000020; +pub const ECHOK: ::tcflag_t = 0o000040; +pub const ECHONL: ::tcflag_t = 0o000100; +pub const NOFLSH: ::tcflag_t = 0o000200; +pub const ECHOCTL: ::tcflag_t = 0o001000; +pub const ECHOPRT: ::tcflag_t = 0o002000; +pub const ECHOKE: ::tcflag_t = 0o004000; +pub const PENDIN: ::tcflag_t = 0o040000; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const IXON: ::tcflag_t = 0o002000; +pub const IXOFF: ::tcflag_t = 0o010000; + +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_restart_syscall: ::c_long = 7; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_umount: ::c_long = 22; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_alarm: ::c_long = 27; +pub const SYS_pause: ::c_long = 29; +pub const SYS_utime: ::c_long = 30; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_signal: ::c_long = 48; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_readdir: ::c_long = 89; +pub const SYS_mmap: ::c_long = 90; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_socketcall: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_lookup_dcookie: ::c_long = 110; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_idle: ::c_long = 112; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_ipc: ::c_long = 117; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_create_module: ::c_long = 127; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_get_kernel_syms: ::c_long = 130; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_afs_syscall: ::c_long = 137; /* Syscall for Andrew File System */ +pub const SYS_getdents: ::c_long = 141; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_query_module: ::c_long = 167; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_getpmsg: ::c_long = 188; +pub const SYS_putpmsg: ::c_long = 189; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_pivot_root: ::c_long = 217; +pub const SYS_mincore: ::c_long = 218; +pub const SYS_madvise: ::c_long = 219; +pub const SYS_getdents64: ::c_long = 220; +pub const SYS_readahead: ::c_long = 222; +pub const SYS_setxattr: ::c_long = 224; +pub const SYS_lsetxattr: ::c_long = 225; +pub const SYS_fsetxattr: ::c_long = 226; +pub const SYS_getxattr: ::c_long = 227; +pub const SYS_lgetxattr: ::c_long = 228; +pub const SYS_fgetxattr: ::c_long = 229; +pub const SYS_listxattr: ::c_long = 230; +pub const SYS_llistxattr: ::c_long = 231; +pub const SYS_flistxattr: ::c_long = 232; +pub const SYS_removexattr: ::c_long = 233; +pub const SYS_lremovexattr: ::c_long = 234; +pub const SYS_fremovexattr: ::c_long = 235; +pub const SYS_gettid: ::c_long = 236; +pub const SYS_tkill: ::c_long = 237; +pub const SYS_futex: ::c_long = 238; +pub const SYS_sched_setaffinity: ::c_long = 239; +pub const SYS_sched_getaffinity: ::c_long = 240; +pub const SYS_tgkill: ::c_long = 241; +pub const SYS_io_setup: ::c_long = 243; +pub const SYS_io_destroy: ::c_long = 244; +pub const SYS_io_getevents: ::c_long = 245; +pub const SYS_io_submit: ::c_long = 246; +pub const SYS_io_cancel: ::c_long = 247; +pub const SYS_exit_group: ::c_long = 248; +pub const SYS_epoll_create: ::c_long = 249; +pub const SYS_epoll_ctl: ::c_long = 250; +pub const SYS_epoll_wait: ::c_long = 251; +pub const SYS_set_tid_address: ::c_long = 252; +pub const SYS_fadvise64: ::c_long = 253; +pub const SYS_timer_create: ::c_long = 254; +pub const SYS_timer_settime: ::c_long = 255; +pub const SYS_timer_gettime: ::c_long = 256; +pub const SYS_timer_getoverrun: ::c_long = 257; +pub const SYS_timer_delete: ::c_long = 258; +pub const SYS_clock_settime: ::c_long = 259; +pub const SYS_clock_gettime: ::c_long = 260; +pub const SYS_clock_getres: ::c_long = 261; +pub const SYS_clock_nanosleep: ::c_long = 262; +pub const SYS_statfs64: ::c_long = 265; +pub const SYS_fstatfs64: ::c_long = 266; +pub const SYS_remap_file_pages: ::c_long = 267; +pub const SYS_mbind: ::c_long = 268; +pub const SYS_get_mempolicy: ::c_long = 269; +pub const SYS_set_mempolicy: ::c_long = 270; +pub const SYS_mq_open: ::c_long = 271; +pub const SYS_mq_unlink: ::c_long = 272; +pub const SYS_mq_timedsend: ::c_long = 273; +pub const SYS_mq_timedreceive: ::c_long = 274; +pub const SYS_mq_notify: ::c_long = 275; +pub const SYS_mq_getsetattr: ::c_long = 276; +pub const SYS_kexec_load: ::c_long = 277; +pub const SYS_add_key: ::c_long = 278; +pub const SYS_request_key: ::c_long = 279; +pub const SYS_keyctl: ::c_long = 280; +pub const SYS_waitid: ::c_long = 281; +pub const SYS_ioprio_set: ::c_long = 282; +pub const SYS_ioprio_get: ::c_long = 283; +pub const SYS_inotify_init: ::c_long = 284; +pub const SYS_inotify_add_watch: ::c_long = 285; +pub const SYS_inotify_rm_watch: ::c_long = 286; +pub const SYS_migrate_pages: ::c_long = 287; +pub const SYS_openat: ::c_long = 288; +pub const SYS_mkdirat: ::c_long = 289; +pub const SYS_mknodat: ::c_long = 290; +pub const SYS_fchownat: ::c_long = 291; +pub const SYS_futimesat: ::c_long = 292; +pub const SYS_unlinkat: ::c_long = 294; +pub const SYS_renameat: ::c_long = 295; +pub const SYS_linkat: ::c_long = 296; +pub const SYS_symlinkat: ::c_long = 297; +pub const SYS_readlinkat: ::c_long = 298; +pub const SYS_fchmodat: ::c_long = 299; +pub const SYS_faccessat: ::c_long = 300; +pub const SYS_pselect6: ::c_long = 301; +pub const SYS_ppoll: ::c_long = 302; +pub const SYS_unshare: ::c_long = 303; +pub const SYS_set_robust_list: ::c_long = 304; +pub const SYS_get_robust_list: ::c_long = 305; +pub const SYS_splice: ::c_long = 306; +pub const SYS_sync_file_range: ::c_long = 307; +pub const SYS_tee: ::c_long = 308; +pub const SYS_vmsplice: ::c_long = 309; +pub const SYS_move_pages: ::c_long = 310; +pub const SYS_getcpu: ::c_long = 311; +pub const SYS_epoll_pwait: ::c_long = 312; +pub const SYS_utimes: ::c_long = 313; +pub const SYS_fallocate: ::c_long = 314; +pub const SYS_utimensat: ::c_long = 315; +pub const SYS_signalfd: ::c_long = 316; +pub const SYS_timerfd: ::c_long = 317; +pub const SYS_eventfd: ::c_long = 318; +pub const SYS_timerfd_create: ::c_long = 319; +pub const SYS_timerfd_settime: ::c_long = 320; +pub const SYS_timerfd_gettime: ::c_long = 321; +pub const SYS_signalfd4: ::c_long = 322; +pub const SYS_eventfd2: ::c_long = 323; +pub const SYS_inotify_init1: ::c_long = 324; +pub const SYS_pipe2: ::c_long = 325; +pub const SYS_dup3: ::c_long = 326; +pub const SYS_epoll_create1: ::c_long = 327; +pub const SYS_preadv: ::c_long = 328; +pub const SYS_pwritev: ::c_long = 329; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 330; +pub const SYS_perf_event_open: ::c_long = 331; +pub const SYS_fanotify_init: ::c_long = 332; +pub const SYS_fanotify_mark: ::c_long = 333; +pub const SYS_prlimit64: ::c_long = 334; +pub const SYS_name_to_handle_at: ::c_long = 335; +pub const SYS_open_by_handle_at: ::c_long = 336; +pub const SYS_clock_adjtime: ::c_long = 337; +pub const SYS_syncfs: ::c_long = 338; +pub const SYS_setns: ::c_long = 339; +pub const SYS_process_vm_readv: ::c_long = 340; +pub const SYS_process_vm_writev: ::c_long = 341; +pub const SYS_s390_runtime_instr: ::c_long = 342; +pub const SYS_kcmp: ::c_long = 343; +pub const SYS_finit_module: ::c_long = 344; +pub const SYS_sched_setattr: ::c_long = 345; +pub const SYS_sched_getattr: ::c_long = 346; +pub const SYS_renameat2: ::c_long = 347; +pub const SYS_seccomp: ::c_long = 348; +pub const SYS_getrandom: ::c_long = 349; +pub const SYS_memfd_create: ::c_long = 350; +pub const SYS_bpf: ::c_long = 351; +pub const SYS_s390_pci_mmio_write: ::c_long = 352; +pub const SYS_s390_pci_mmio_read: ::c_long = 353; +pub const SYS_execveat: ::c_long = 354; +pub const SYS_userfaultfd: ::c_long = 355; +pub const SYS_membarrier: ::c_long = 356; +pub const SYS_recvmmsg: ::c_long = 357; +pub const SYS_sendmmsg: ::c_long = 358; +pub const SYS_socket: ::c_long = 359; +pub const SYS_socketpair: ::c_long = 360; +pub const SYS_bind: ::c_long = 361; +pub const SYS_connect: ::c_long = 362; +pub const SYS_listen: ::c_long = 363; +pub const SYS_accept4: ::c_long = 364; +pub const SYS_getsockopt: ::c_long = 365; +pub const SYS_setsockopt: ::c_long = 366; +pub const SYS_getsockname: ::c_long = 367; +pub const SYS_getpeername: ::c_long = 368; +pub const SYS_sendto: ::c_long = 369; +pub const SYS_sendmsg: ::c_long = 370; +pub const SYS_recvfrom: ::c_long = 371; +pub const SYS_recvmsg: ::c_long = 372; +pub const SYS_shutdown: ::c_long = 373; +pub const SYS_mlock2: ::c_long = 374; +pub const SYS_copy_file_range: ::c_long = 375; +pub const SYS_preadv2: ::c_long = 376; +pub const SYS_pwritev2: ::c_long = 377; +pub const SYS_lchown: ::c_long = 198; +pub const SYS_setuid: ::c_long = 213; +pub const SYS_getuid: ::c_long = 199; +pub const SYS_setgid: ::c_long = 214; +pub const SYS_getgid: ::c_long = 200; +pub const SYS_geteuid: ::c_long = 201; +pub const SYS_setreuid: ::c_long = 203; +pub const SYS_setregid: ::c_long = 204; +pub const SYS_getrlimit: ::c_long = 191; +pub const SYS_getgroups: ::c_long = 205; +pub const SYS_fchown: ::c_long = 207; +pub const SYS_setresuid: ::c_long = 208; +pub const SYS_setresgid: ::c_long = 210; +pub const SYS_getresgid: ::c_long = 211; +pub const SYS_select: ::c_long = 142; +pub const SYS_getegid: ::c_long = 202; +pub const SYS_setgroups: ::c_long = 206; +pub const SYS_getresuid: ::c_long = 209; +pub const SYS_chown: ::c_long = 212; +pub const SYS_setfsuid: ::c_long = 215; +pub const SYS_setfsgid: ::c_long = 216; +pub const SYS_newfstatat: ::c_long = 293; +pub const SYS_statx: ::c_long = 379; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..94391a01a727ef2ac5f1320db867268d5fe84077 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/align.rs @@ -0,0 +1,25 @@ +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 4] + } + +} + +s! { + #[repr(align(8))] + pub struct clone_args { + pub flags: ::c_ulonglong, + pub pidfd: ::c_ulonglong, + pub child_tid: ::c_ulonglong, + pub parent_tid: ::c_ulonglong, + pub exit_signal: ::c_ulonglong, + pub stack: ::c_ulonglong, + pub stack_size: ::c_ulonglong, + pub tls: ::c_ulonglong, + pub set_tid: ::c_ulonglong, + pub set_tid_size: ::c_ulonglong, + pub cgroup: ::c_ulonglong, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..3429c2c1a7822bdc41e2d4fefa82cd7ff5b4dec6 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs @@ -0,0 +1,905 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type nlink_t = u64; +pub type blksize_t = ::c_long; +pub type __u64 = ::c_ulonglong; +pub type greg_t = i64; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused: [::c_long; 3], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + pub st_ino: ::ino64_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + __pad0: ::c_int, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __reserved: [::c_long; 3], + } + + pub struct user_regs_struct { + pub r15: ::c_ulong, + pub r14: ::c_ulong, + pub r13: ::c_ulong, + pub r12: ::c_ulong, + pub rbp: ::c_ulong, + pub rbx: ::c_ulong, + pub r11: ::c_ulong, + pub r10: ::c_ulong, + pub r9: ::c_ulong, + pub r8: ::c_ulong, + pub rax: ::c_ulong, + pub rcx: ::c_ulong, + pub rdx: ::c_ulong, + pub rsi: ::c_ulong, + pub rdi: ::c_ulong, + pub orig_rax: ::c_ulong, + pub rip: ::c_ulong, + pub cs: ::c_ulong, + pub eflags: ::c_ulong, + pub rsp: ::c_ulong, + pub ss: ::c_ulong, + pub fs_base: ::c_ulong, + pub gs_base: ::c_ulong, + pub ds: ::c_ulong, + pub es: ::c_ulong, + pub fs: ::c_ulong, + pub gs: ::c_ulong, + } + + pub struct user { + pub regs: user_regs_struct, + pub u_fpvalid: ::c_int, + pub i387: user_fpregs_struct, + pub u_tsize: ::c_ulong, + pub u_dsize: ::c_ulong, + pub u_ssize: ::c_ulong, + pub start_code: ::c_ulong, + pub start_stack: ::c_ulong, + pub signal: ::c_long, + __reserved: ::c_int, + #[cfg(target_pointer_width = "32")] + __pad1: u32, + pub u_ar0: *mut user_regs_struct, + #[cfg(target_pointer_width = "32")] + __pad2: u32, + pub u_fpstate: *mut user_fpregs_struct, + pub magic: ::c_ulong, + pub u_comm: [::c_char; 32], + pub u_debugreg: [::c_ulong; 8], + } + + // GitHub repo: ifduyue/musl/ + // commit: b4b1e10364c8737a632be61582e05a8d3acf5690 + // file: arch/x86_64/bits/signal.h#L80-L84 + pub struct mcontext_t { + pub gregs: [greg_t; 23], + __private: [u64; 9], + } + + pub struct ipc_perm { + pub __ipc_perm_key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub __seq: ::c_int, + __unused1: ::c_long, + __unused2: ::c_long + } +} + +s_no_extra_traits! { + pub struct user_fpregs_struct { + pub cwd: ::c_ushort, + pub swd: ::c_ushort, + pub ftw: ::c_ushort, + pub fop: ::c_ushort, + pub rip: ::c_ulong, + pub rdp: ::c_ulong, + pub mxcsr: ::c_uint, + pub mxcr_mask: ::c_uint, + pub st_space: [::c_uint; 32], + pub xmm_space: [::c_uint; 64], + padding: [::c_uint; 24], + } + + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_sigmask: ::sigset_t, + __private: [u8; 512], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for user_fpregs_struct { + fn eq(&self, other: &user_fpregs_struct) -> bool { + self.cwd == other.cwd + && self.swd == other.swd + && self.ftw == other.ftw + && self.fop == other.fop + && self.rip == other.rip + && self.rdp == other.rdp + && self.mxcsr == other.mxcsr + && self.mxcr_mask == other.mxcr_mask + && self.st_space == other.st_space + && self + .xmm_space + .iter() + .zip(other.xmm_space.iter()) + .all(|(a,b)| a == b) + // Ignore padding field + } + } + + impl Eq for user_fpregs_struct {} + + impl ::fmt::Debug for user_fpregs_struct { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("user_fpregs_struct") + .field("cwd", &self.cwd) + .field("ftw", &self.ftw) + .field("fop", &self.fop) + .field("rip", &self.rip) + .field("rdp", &self.rdp) + .field("mxcsr", &self.mxcsr) + .field("mxcr_mask", &self.mxcr_mask) + .field("st_space", &self.st_space) + // FIXME: .field("xmm_space", &self.xmm_space) + // Ignore padding field + .finish() + } + } + + impl ::hash::Hash for user_fpregs_struct { + fn hash(&self, state: &mut H) { + self.cwd.hash(state); + self.ftw.hash(state); + self.fop.hash(state); + self.rip.hash(state); + self.rdp.hash(state); + self.mxcsr.hash(state); + self.mxcr_mask.hash(state); + self.st_space.hash(state); + self.xmm_space.hash(state); + // Ignore padding field + } + } + + impl PartialEq for ucontext_t { + fn eq(&self, other: &ucontext_t) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_sigmask == other.uc_sigmask + && self + .__private + .iter() + .zip(other.__private.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for ucontext_t {} + + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_flags) + .field("uc_link", &self.uc_link) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field("uc_sigmask", &self.uc_sigmask) + // Ignore __private field + .finish() + } + } + + impl ::hash::Hash for ucontext_t { + fn hash(&self, state: &mut H) { + self.uc_flags.hash(state); + self.uc_link.hash(state); + self.uc_stack.hash(state); + self.uc_mcontext.hash(state); + self.uc_sigmask.hash(state); + self.__private.hash(state); + } + } + } +} + +// Syscall table + +pub const SYS_read: ::c_long = 0; +pub const SYS_write: ::c_long = 1; +pub const SYS_open: ::c_long = 2; +pub const SYS_close: ::c_long = 3; +pub const SYS_stat: ::c_long = 4; +pub const SYS_fstat: ::c_long = 5; +pub const SYS_lstat: ::c_long = 6; +pub const SYS_poll: ::c_long = 7; +pub const SYS_lseek: ::c_long = 8; +pub const SYS_mmap: ::c_long = 9; +pub const SYS_mprotect: ::c_long = 10; +pub const SYS_munmap: ::c_long = 11; +pub const SYS_brk: ::c_long = 12; +pub const SYS_rt_sigaction: ::c_long = 13; +pub const SYS_rt_sigprocmask: ::c_long = 14; +pub const SYS_rt_sigreturn: ::c_long = 15; +pub const SYS_ioctl: ::c_long = 16; +pub const SYS_pread64: ::c_long = 17; +pub const SYS_pwrite64: ::c_long = 18; +pub const SYS_readv: ::c_long = 19; +pub const SYS_writev: ::c_long = 20; +pub const SYS_access: ::c_long = 21; +pub const SYS_pipe: ::c_long = 22; +pub const SYS_select: ::c_long = 23; +pub const SYS_sched_yield: ::c_long = 24; +pub const SYS_mremap: ::c_long = 25; +pub const SYS_msync: ::c_long = 26; +pub const SYS_mincore: ::c_long = 27; +pub const SYS_madvise: ::c_long = 28; +pub const SYS_shmget: ::c_long = 29; +pub const SYS_shmat: ::c_long = 30; +pub const SYS_shmctl: ::c_long = 31; +pub const SYS_dup: ::c_long = 32; +pub const SYS_dup2: ::c_long = 33; +pub const SYS_pause: ::c_long = 34; +pub const SYS_nanosleep: ::c_long = 35; +pub const SYS_getitimer: ::c_long = 36; +pub const SYS_alarm: ::c_long = 37; +pub const SYS_setitimer: ::c_long = 38; +pub const SYS_getpid: ::c_long = 39; +pub const SYS_sendfile: ::c_long = 40; +pub const SYS_socket: ::c_long = 41; +pub const SYS_connect: ::c_long = 42; +pub const SYS_accept: ::c_long = 43; +pub const SYS_sendto: ::c_long = 44; +pub const SYS_recvfrom: ::c_long = 45; +pub const SYS_sendmsg: ::c_long = 46; +pub const SYS_recvmsg: ::c_long = 47; +pub const SYS_shutdown: ::c_long = 48; +pub const SYS_bind: ::c_long = 49; +pub const SYS_listen: ::c_long = 50; +pub const SYS_getsockname: ::c_long = 51; +pub const SYS_getpeername: ::c_long = 52; +pub const SYS_socketpair: ::c_long = 53; +pub const SYS_setsockopt: ::c_long = 54; +pub const SYS_getsockopt: ::c_long = 55; +pub const SYS_clone: ::c_long = 56; +pub const SYS_fork: ::c_long = 57; +pub const SYS_vfork: ::c_long = 58; +pub const SYS_execve: ::c_long = 59; +pub const SYS_exit: ::c_long = 60; +pub const SYS_wait4: ::c_long = 61; +pub const SYS_kill: ::c_long = 62; +pub const SYS_uname: ::c_long = 63; +pub const SYS_semget: ::c_long = 64; +pub const SYS_semop: ::c_long = 65; +pub const SYS_semctl: ::c_long = 66; +pub const SYS_shmdt: ::c_long = 67; +pub const SYS_msgget: ::c_long = 68; +pub const SYS_msgsnd: ::c_long = 69; +pub const SYS_msgrcv: ::c_long = 70; +pub const SYS_msgctl: ::c_long = 71; +pub const SYS_fcntl: ::c_long = 72; +pub const SYS_flock: ::c_long = 73; +pub const SYS_fsync: ::c_long = 74; +pub const SYS_fdatasync: ::c_long = 75; +pub const SYS_truncate: ::c_long = 76; +pub const SYS_ftruncate: ::c_long = 77; +pub const SYS_getdents: ::c_long = 78; +pub const SYS_getcwd: ::c_long = 79; +pub const SYS_chdir: ::c_long = 80; +pub const SYS_fchdir: ::c_long = 81; +pub const SYS_rename: ::c_long = 82; +pub const SYS_mkdir: ::c_long = 83; +pub const SYS_rmdir: ::c_long = 84; +pub const SYS_creat: ::c_long = 85; +pub const SYS_link: ::c_long = 86; +pub const SYS_unlink: ::c_long = 87; +pub const SYS_symlink: ::c_long = 88; +pub const SYS_readlink: ::c_long = 89; +pub const SYS_chmod: ::c_long = 90; +pub const SYS_fchmod: ::c_long = 91; +pub const SYS_chown: ::c_long = 92; +pub const SYS_fchown: ::c_long = 93; +pub const SYS_lchown: ::c_long = 94; +pub const SYS_umask: ::c_long = 95; +pub const SYS_gettimeofday: ::c_long = 96; +pub const SYS_getrlimit: ::c_long = 97; +pub const SYS_getrusage: ::c_long = 98; +pub const SYS_sysinfo: ::c_long = 99; +pub const SYS_times: ::c_long = 100; +pub const SYS_ptrace: ::c_long = 101; +pub const SYS_getuid: ::c_long = 102; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_getgid: ::c_long = 104; +pub const SYS_setuid: ::c_long = 105; +pub const SYS_setgid: ::c_long = 106; +pub const SYS_geteuid: ::c_long = 107; +pub const SYS_getegid: ::c_long = 108; +pub const SYS_setpgid: ::c_long = 109; +pub const SYS_getppid: ::c_long = 110; +pub const SYS_getpgrp: ::c_long = 111; +pub const SYS_setsid: ::c_long = 112; +pub const SYS_setreuid: ::c_long = 113; +pub const SYS_setregid: ::c_long = 114; +pub const SYS_getgroups: ::c_long = 115; +pub const SYS_setgroups: ::c_long = 116; +pub const SYS_setresuid: ::c_long = 117; +pub const SYS_getresuid: ::c_long = 118; +pub const SYS_setresgid: ::c_long = 119; +pub const SYS_getresgid: ::c_long = 120; +pub const SYS_getpgid: ::c_long = 121; +pub const SYS_setfsuid: ::c_long = 122; +pub const SYS_setfsgid: ::c_long = 123; +pub const SYS_getsid: ::c_long = 124; +pub const SYS_capget: ::c_long = 125; +pub const SYS_capset: ::c_long = 126; +pub const SYS_rt_sigpending: ::c_long = 127; +pub const SYS_rt_sigtimedwait: ::c_long = 128; +pub const SYS_rt_sigqueueinfo: ::c_long = 129; +pub const SYS_rt_sigsuspend: ::c_long = 130; +pub const SYS_sigaltstack: ::c_long = 131; +pub const SYS_utime: ::c_long = 132; +pub const SYS_mknod: ::c_long = 133; +pub const SYS_uselib: ::c_long = 134; +pub const SYS_personality: ::c_long = 135; +pub const SYS_ustat: ::c_long = 136; +pub const SYS_statfs: ::c_long = 137; +pub const SYS_fstatfs: ::c_long = 138; +pub const SYS_sysfs: ::c_long = 139; +pub const SYS_getpriority: ::c_long = 140; +pub const SYS_setpriority: ::c_long = 141; +pub const SYS_sched_setparam: ::c_long = 142; +pub const SYS_sched_getparam: ::c_long = 143; +pub const SYS_sched_setscheduler: ::c_long = 144; +pub const SYS_sched_getscheduler: ::c_long = 145; +pub const SYS_sched_get_priority_max: ::c_long = 146; +pub const SYS_sched_get_priority_min: ::c_long = 147; +pub const SYS_sched_rr_get_interval: ::c_long = 148; +pub const SYS_mlock: ::c_long = 149; +pub const SYS_munlock: ::c_long = 150; +pub const SYS_mlockall: ::c_long = 151; +pub const SYS_munlockall: ::c_long = 152; +pub const SYS_vhangup: ::c_long = 153; +pub const SYS_modify_ldt: ::c_long = 154; +pub const SYS_pivot_root: ::c_long = 155; +pub const SYS__sysctl: ::c_long = 156; +pub const SYS_prctl: ::c_long = 157; +pub const SYS_arch_prctl: ::c_long = 158; +pub const SYS_adjtimex: ::c_long = 159; +pub const SYS_setrlimit: ::c_long = 160; +pub const SYS_chroot: ::c_long = 161; +pub const SYS_sync: ::c_long = 162; +pub const SYS_acct: ::c_long = 163; +pub const SYS_settimeofday: ::c_long = 164; +pub const SYS_mount: ::c_long = 165; +pub const SYS_umount2: ::c_long = 166; +pub const SYS_swapon: ::c_long = 167; +pub const SYS_swapoff: ::c_long = 168; +pub const SYS_reboot: ::c_long = 169; +pub const SYS_sethostname: ::c_long = 170; +pub const SYS_setdomainname: ::c_long = 171; +pub const SYS_iopl: ::c_long = 172; +pub const SYS_ioperm: ::c_long = 173; +pub const SYS_create_module: ::c_long = 174; +pub const SYS_init_module: ::c_long = 175; +pub const SYS_delete_module: ::c_long = 176; +pub const SYS_get_kernel_syms: ::c_long = 177; +pub const SYS_query_module: ::c_long = 178; +pub const SYS_quotactl: ::c_long = 179; +pub const SYS_nfsservctl: ::c_long = 180; +pub const SYS_getpmsg: ::c_long = 181; +pub const SYS_putpmsg: ::c_long = 182; +pub const SYS_afs_syscall: ::c_long = 183; +pub const SYS_tuxcall: ::c_long = 184; +pub const SYS_security: ::c_long = 185; +pub const SYS_gettid: ::c_long = 186; +pub const SYS_readahead: ::c_long = 187; +pub const SYS_setxattr: ::c_long = 188; +pub const SYS_lsetxattr: ::c_long = 189; +pub const SYS_fsetxattr: ::c_long = 190; +pub const SYS_getxattr: ::c_long = 191; +pub const SYS_lgetxattr: ::c_long = 192; +pub const SYS_fgetxattr: ::c_long = 193; +pub const SYS_listxattr: ::c_long = 194; +pub const SYS_llistxattr: ::c_long = 195; +pub const SYS_flistxattr: ::c_long = 196; +pub const SYS_removexattr: ::c_long = 197; +pub const SYS_lremovexattr: ::c_long = 198; +pub const SYS_fremovexattr: ::c_long = 199; +pub const SYS_tkill: ::c_long = 200; +pub const SYS_time: ::c_long = 201; +pub const SYS_futex: ::c_long = 202; +pub const SYS_sched_setaffinity: ::c_long = 203; +pub const SYS_sched_getaffinity: ::c_long = 204; +pub const SYS_set_thread_area: ::c_long = 205; +pub const SYS_io_setup: ::c_long = 206; +pub const SYS_io_destroy: ::c_long = 207; +pub const SYS_io_getevents: ::c_long = 208; +pub const SYS_io_submit: ::c_long = 209; +pub const SYS_io_cancel: ::c_long = 210; +pub const SYS_get_thread_area: ::c_long = 211; +pub const SYS_lookup_dcookie: ::c_long = 212; +pub const SYS_epoll_create: ::c_long = 213; +pub const SYS_epoll_ctl_old: ::c_long = 214; +pub const SYS_epoll_wait_old: ::c_long = 215; +pub const SYS_remap_file_pages: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; +pub const SYS_set_tid_address: ::c_long = 218; +pub const SYS_restart_syscall: ::c_long = 219; +pub const SYS_semtimedop: ::c_long = 220; +pub const SYS_fadvise64: ::c_long = 221; +pub const SYS_timer_create: ::c_long = 222; +pub const SYS_timer_settime: ::c_long = 223; +pub const SYS_timer_gettime: ::c_long = 224; +pub const SYS_timer_getoverrun: ::c_long = 225; +pub const SYS_timer_delete: ::c_long = 226; +pub const SYS_clock_settime: ::c_long = 227; +pub const SYS_clock_gettime: ::c_long = 228; +pub const SYS_clock_getres: ::c_long = 229; +pub const SYS_clock_nanosleep: ::c_long = 230; +pub const SYS_exit_group: ::c_long = 231; +pub const SYS_epoll_wait: ::c_long = 232; +pub const SYS_epoll_ctl: ::c_long = 233; +pub const SYS_tgkill: ::c_long = 234; +pub const SYS_utimes: ::c_long = 235; +pub const SYS_vserver: ::c_long = 236; +pub const SYS_mbind: ::c_long = 237; +pub const SYS_set_mempolicy: ::c_long = 238; +pub const SYS_get_mempolicy: ::c_long = 239; +pub const SYS_mq_open: ::c_long = 240; +pub const SYS_mq_unlink: ::c_long = 241; +pub const SYS_mq_timedsend: ::c_long = 242; +pub const SYS_mq_timedreceive: ::c_long = 243; +pub const SYS_mq_notify: ::c_long = 244; +pub const SYS_mq_getsetattr: ::c_long = 245; +pub const SYS_kexec_load: ::c_long = 246; +pub const SYS_waitid: ::c_long = 247; +pub const SYS_add_key: ::c_long = 248; +pub const SYS_request_key: ::c_long = 249; +pub const SYS_keyctl: ::c_long = 250; +pub const SYS_ioprio_set: ::c_long = 251; +pub const SYS_ioprio_get: ::c_long = 252; +pub const SYS_inotify_init: ::c_long = 253; +pub const SYS_inotify_add_watch: ::c_long = 254; +pub const SYS_inotify_rm_watch: ::c_long = 255; +pub const SYS_migrate_pages: ::c_long = 256; +pub const SYS_openat: ::c_long = 257; +pub const SYS_mkdirat: ::c_long = 258; +pub const SYS_mknodat: ::c_long = 259; +pub const SYS_fchownat: ::c_long = 260; +pub const SYS_futimesat: ::c_long = 261; +pub const SYS_newfstatat: ::c_long = 262; +pub const SYS_unlinkat: ::c_long = 263; +pub const SYS_renameat: ::c_long = 264; +pub const SYS_linkat: ::c_long = 265; +pub const SYS_symlinkat: ::c_long = 266; +pub const SYS_readlinkat: ::c_long = 267; +pub const SYS_fchmodat: ::c_long = 268; +pub const SYS_faccessat: ::c_long = 269; +pub const SYS_pselect6: ::c_long = 270; +pub const SYS_ppoll: ::c_long = 271; +pub const SYS_unshare: ::c_long = 272; +pub const SYS_set_robust_list: ::c_long = 273; +pub const SYS_get_robust_list: ::c_long = 274; +pub const SYS_splice: ::c_long = 275; +pub const SYS_tee: ::c_long = 276; +pub const SYS_sync_file_range: ::c_long = 277; +pub const SYS_vmsplice: ::c_long = 278; +pub const SYS_move_pages: ::c_long = 279; +pub const SYS_utimensat: ::c_long = 280; +pub const SYS_epoll_pwait: ::c_long = 281; +pub const SYS_signalfd: ::c_long = 282; +pub const SYS_timerfd_create: ::c_long = 283; +pub const SYS_eventfd: ::c_long = 284; +pub const SYS_fallocate: ::c_long = 285; +pub const SYS_timerfd_settime: ::c_long = 286; +pub const SYS_timerfd_gettime: ::c_long = 287; +pub const SYS_accept4: ::c_long = 288; +pub const SYS_signalfd4: ::c_long = 289; +pub const SYS_eventfd2: ::c_long = 290; +pub const SYS_epoll_create1: ::c_long = 291; +pub const SYS_dup3: ::c_long = 292; +pub const SYS_pipe2: ::c_long = 293; +pub const SYS_inotify_init1: ::c_long = 294; +pub const SYS_preadv: ::c_long = 295; +pub const SYS_pwritev: ::c_long = 296; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 297; +pub const SYS_perf_event_open: ::c_long = 298; +pub const SYS_recvmmsg: ::c_long = 299; +pub const SYS_fanotify_init: ::c_long = 300; +pub const SYS_fanotify_mark: ::c_long = 301; +pub const SYS_prlimit64: ::c_long = 302; +pub const SYS_name_to_handle_at: ::c_long = 303; +pub const SYS_open_by_handle_at: ::c_long = 304; +pub const SYS_clock_adjtime: ::c_long = 305; +pub const SYS_syncfs: ::c_long = 306; +pub const SYS_sendmmsg: ::c_long = 307; +pub const SYS_setns: ::c_long = 308; +pub const SYS_getcpu: ::c_long = 309; +pub const SYS_process_vm_readv: ::c_long = 310; +pub const SYS_process_vm_writev: ::c_long = 311; +pub const SYS_kcmp: ::c_long = 312; +pub const SYS_finit_module: ::c_long = 313; +pub const SYS_sched_setattr: ::c_long = 314; +pub const SYS_sched_getattr: ::c_long = 315; +pub const SYS_renameat2: ::c_long = 316; +pub const SYS_seccomp: ::c_long = 317; +pub const SYS_getrandom: ::c_long = 318; +pub const SYS_memfd_create: ::c_long = 319; +pub const SYS_kexec_file_load: ::c_long = 320; +pub const SYS_bpf: ::c_long = 321; +pub const SYS_execveat: ::c_long = 322; +pub const SYS_userfaultfd: ::c_long = 323; +pub const SYS_membarrier: ::c_long = 324; +pub const SYS_mlock2: ::c_long = 325; +pub const SYS_copy_file_range: ::c_long = 326; +pub const SYS_preadv2: ::c_long = 327; +pub const SYS_pwritev2: ::c_long = 328; +pub const SYS_pkey_mprotect: ::c_long = 329; +pub const SYS_pkey_alloc: ::c_long = 330; +pub const SYS_pkey_free: ::c_long = 331; +pub const SYS_statx: ::c_long = 332; +pub const SYS_pidfd_send_signal: ::c_long = 424; +pub const SYS_io_uring_setup: ::c_long = 425; +pub const SYS_io_uring_enter: ::c_long = 426; +pub const SYS_io_uring_register: ::c_long = 427; +pub const SYS_open_tree: ::c_long = 428; +pub const SYS_move_mount: ::c_long = 429; +pub const SYS_fsopen: ::c_long = 430; +pub const SYS_fsconfig: ::c_long = 431; +pub const SYS_fsmount: ::c_long = 432; +pub const SYS_fspick: ::c_long = 433; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; +pub const SYS_close_range: ::c_long = 436; +pub const SYS_openat2: ::c_long = 437; +pub const SYS_pidfd_getfd: ::c_long = 438; +pub const SYS_faccessat2: ::c_long = 439; +pub const SYS_process_madvise: ::c_long = 440; +pub const SYS_epoll_pwait2: ::c_long = 441; +pub const SYS_mount_setattr: ::c_long = 442; + +// offsets in user_regs_structs, from sys/reg.h +pub const R15: ::c_int = 0; +pub const R14: ::c_int = 1; +pub const R13: ::c_int = 2; +pub const R12: ::c_int = 3; +pub const RBP: ::c_int = 4; +pub const RBX: ::c_int = 5; +pub const R11: ::c_int = 6; +pub const R10: ::c_int = 7; +pub const R9: ::c_int = 8; +pub const R8: ::c_int = 9; +pub const RAX: ::c_int = 10; +pub const RCX: ::c_int = 11; +pub const RDX: ::c_int = 12; +pub const RSI: ::c_int = 13; +pub const RDI: ::c_int = 14; +pub const ORIG_RAX: ::c_int = 15; +pub const RIP: ::c_int = 16; +pub const CS: ::c_int = 17; +pub const EFLAGS: ::c_int = 18; +pub const RSP: ::c_int = 19; +pub const SS: ::c_int = 20; +pub const FS_BASE: ::c_int = 21; +pub const GS_BASE: ::c_int = 22; +pub const DS: ::c_int = 23; +pub const ES: ::c_int = 24; +pub const FS: ::c_int = 25; +pub const GS: ::c_int = 26; + +// offsets in mcontext_t.gregs from bits/signal.h +// GitHub repo: ifduyue/musl/ +// commit: b4b1e10364c8737a632be61582e05a8d3acf5690 +// file: arch/x86_64/bits/signal.h#L9-L56 +pub const REG_R8: ::c_int = 0; +pub const REG_R9: ::c_int = 1; +pub const REG_R10: ::c_int = 2; +pub const REG_R11: ::c_int = 3; +pub const REG_R12: ::c_int = 4; +pub const REG_R13: ::c_int = 5; +pub const REG_R14: ::c_int = 6; +pub const REG_R15: ::c_int = 7; +pub const REG_RDI: ::c_int = 8; +pub const REG_RSI: ::c_int = 9; +pub const REG_RBP: ::c_int = 10; +pub const REG_RBX: ::c_int = 11; +pub const REG_RDX: ::c_int = 12; +pub const REG_RAX: ::c_int = 13; +pub const REG_RCX: ::c_int = 14; +pub const REG_RSP: ::c_int = 15; +pub const REG_RIP: ::c_int = 16; +pub const REG_EFL: ::c_int = 17; +pub const REG_CSGSFS: ::c_int = 18; +pub const REG_ERR: ::c_int = 19; +pub const REG_TRAPNO: ::c_int = 20; +pub const REG_OLDMASK: ::c_int = 21; +pub const REG_CR2: ::c_int = 22; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; +pub const MAP_32BIT: ::c_int = 0x0040; +pub const O_APPEND: ::c_int = 1024; +pub const O_DIRECT: ::c_int = 0x4000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_LARGEFILE: ::c_int = 0; +pub const O_NOFOLLOW: ::c_int = 0x20000; +pub const O_CREAT: ::c_int = 64; +pub const O_EXCL: ::c_int = 128; +pub const O_NOCTTY: ::c_int = 256; +pub const O_NONBLOCK: ::c_int = 2048; +pub const O_SYNC: ::c_int = 1052672; +pub const O_RSYNC: ::c_int = 1052672; +pub const O_DSYNC: ::c_int = 4096; +pub const O_ASYNC: ::c_int = 0x2000; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const MINSIGSTKSZ: ::size_t = 2048; + +pub const ENAMETOOLONG: ::c_int = 36; +pub const ENOLCK: ::c_int = 37; +pub const ENOSYS: ::c_int = 38; +pub const ENOTEMPTY: ::c_int = 39; +pub const ELOOP: ::c_int = 40; +pub const ENOMSG: ::c_int = 42; +pub const EIDRM: ::c_int = 43; +pub const ECHRNG: ::c_int = 44; +pub const EL2NSYNC: ::c_int = 45; +pub const EL3HLT: ::c_int = 46; +pub const EL3RST: ::c_int = 47; +pub const ELNRNG: ::c_int = 48; +pub const EUNATCH: ::c_int = 49; +pub const ENOCSI: ::c_int = 50; +pub const EL2HLT: ::c_int = 51; +pub const EBADE: ::c_int = 52; +pub const EBADR: ::c_int = 53; +pub const EXFULL: ::c_int = 54; +pub const ENOANO: ::c_int = 55; +pub const EBADRQC: ::c_int = 56; +pub const EBADSLT: ::c_int = 57; +pub const EMULTIHOP: ::c_int = 72; +pub const EBADMSG: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 75; +pub const ENOTUNIQ: ::c_int = 76; +pub const EBADFD: ::c_int = 77; +pub const EREMCHG: ::c_int = 78; +pub const ELIBACC: ::c_int = 79; +pub const ELIBBAD: ::c_int = 80; +pub const ELIBSCN: ::c_int = 81; +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; +pub const EILSEQ: ::c_int = 84; +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; +pub const EUSERS: ::c_int = 87; +pub const ENOTSOCK: ::c_int = 88; +pub const EDESTADDRREQ: ::c_int = 89; +pub const EMSGSIZE: ::c_int = 90; +pub const EPROTOTYPE: ::c_int = 91; +pub const ENOPROTOOPT: ::c_int = 92; +pub const EPROTONOSUPPORT: ::c_int = 93; +pub const ESOCKTNOSUPPORT: ::c_int = 94; +pub const EOPNOTSUPP: ::c_int = 95; +pub const ENOTSUP: ::c_int = EOPNOTSUPP; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; +pub const EADDRNOTAVAIL: ::c_int = 99; +pub const ENETDOWN: ::c_int = 100; +pub const ENETUNREACH: ::c_int = 101; +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EISCONN: ::c_int = 106; +pub const ENOTCONN: ::c_int = 107; +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; +pub const ETIMEDOUT: ::c_int = 110; +pub const ECONNREFUSED: ::c_int = 111; +pub const EHOSTDOWN: ::c_int = 112; +pub const EHOSTUNREACH: ::c_int = 113; +pub const EALREADY: ::c_int = 114; +pub const EINPROGRESS: ::c_int = 115; +pub const ESTALE: ::c_int = 116; +pub const EUCLEAN: ::c_int = 117; +pub const ENOTNAM: ::c_int = 118; +pub const ENAVAIL: ::c_int = 119; +pub const EISNAM: ::c_int = 120; +pub const EREMOTEIO: ::c_int = 121; +pub const EDQUOT: ::c_int = 122; +pub const ENOMEDIUM: ::c_int = 123; +pub const EMEDIUMTYPE: ::c_int = 124; +pub const ECANCELED: ::c_int = 125; +pub const ENOKEY: ::c_int = 126; +pub const EKEYEXPIRED: ::c_int = 127; +pub const EKEYREVOKED: ::c_int = 128; +pub const EKEYREJECTED: ::c_int = 129; +pub const EOWNERDEAD: ::c_int = 130; +pub const ENOTRECOVERABLE: ::c_int = 131; +pub const ERFKILL: ::c_int = 132; +pub const EHWPOISON: ::c_int = 133; + +pub const SA_ONSTACK: ::c_int = 0x08000000; +pub const SA_SIGINFO: ::c_int = 0x00000004; +pub const SA_NOCLDWAIT: ::c_int = 0x00000002; + +pub const SIGCHLD: ::c_int = 17; +pub const SIGBUS: ::c_int = 7; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGUSR1: ::c_int = 10; +pub const SIGUSR2: ::c_int = 12; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGURG: ::c_int = 23; +pub const SIGIO: ::c_int = 29; +pub const SIGSYS: ::c_int = 31; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGPOLL: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIG_BLOCK: ::c_int = 0x000000; +pub const SIG_UNBLOCK: ::c_int = 0x01; + +pub const F_GETLK: ::c_int = 5; +pub const F_GETOWN: ::c_int = 9; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_SETOWN: ::c_int = 8; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; + +pub const VEOF: usize = 4; + +pub const POLLWRNORM: ::c_short = 0x100; +pub const POLLWRBAND: ::c_short = 0x200; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_GROWSDOWN: ::c_int = 0x0100; +pub const MAP_DENYWRITE: ::c_int = 0x0800; +pub const MAP_EXECUTABLE: ::c_int = 0x01000; +pub const MAP_LOCKED: ::c_int = 0x02000; +pub const MAP_NORESERVE: ::c_int = 0x04000; +pub const MAP_POPULATE: ::c_int = 0x08000; +pub const MAP_NONBLOCK: ::c_int = 0x010000; +pub const MAP_STACK: ::c_int = 0x020000; +pub const MAP_HUGETLB: ::c_int = 0x040000; +pub const MAP_SYNC: ::c_int = 0x080000; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::c_int = 0x00000800; +pub const TAB2: ::c_int = 0x00001000; +pub const TAB3: ::c_int = 0x00001800; +pub const CR1: ::c_int = 0x00000200; +pub const CR2: ::c_int = 0x00000400; +pub const CR3: ::c_int = 0x00000600; +pub const FF1: ::c_int = 0x00008000; +pub const BS1: ::c_int = 0x00002000; +pub const VT1: ::c_int = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; +pub const CIBAUD: ::tcflag_t = 0o02003600000; +pub const CBAUDEX: ::tcflag_t = 0o010000; +pub const VSWTC: usize = 7; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const NLDLY: ::tcflag_t = 0o000400; +pub const CRDLY: ::tcflag_t = 0o003000; +pub const TABDLY: ::tcflag_t = 0o014000; +pub const BSDLY: ::tcflag_t = 0o020000; +pub const FFDLY: ::tcflag_t = 0o100000; +pub const VTDLY: ::tcflag_t = 0o040000; +pub const XTABS: ::tcflag_t = 0o014000; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +pub const EDEADLK: ::c_int = 35; +pub const EDEADLOCK: ::c_int = EDEADLK; + +pub const EXTPROC: ::tcflag_t = 0x00010000; +pub const VEOL: usize = 11; +pub const VEOL2: usize = 16; +pub const VMIN: usize = 6; +pub const IEXTEN: ::tcflag_t = 0x00008000; +pub const TOSTOP: ::tcflag_t = 0x00000100; +pub const FLUSHO: ::tcflag_t = 0x00001000; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..6cdc313881dbb6008e5c15855e6e1b746cc5e1e5 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/musl/mod.rs @@ -0,0 +1,777 @@ +pub type pthread_t = *mut ::c_void; +pub type clock_t = c_long; +#[cfg_attr( + not(feature = "rustc-dep-of-std"), + deprecated( + since = "0.2.80", + note = "This type is changed to 64-bit in musl 1.2.0, \ + we'll follow that change in the future release. \ + See #1848 for more info." + ) +)] +pub type time_t = c_long; +pub type suseconds_t = c_long; +pub type ino_t = u64; +pub type off_t = i64; +pub type blkcnt_t = i64; + +pub type shmatt_t = ::c_ulong; +pub type msgqnum_t = ::c_ulong; +pub type msglen_t = ::c_ulong; +pub type fsblkcnt_t = ::c_ulonglong; +pub type fsfilcnt_t = ::c_ulonglong; +pub type rlim_t = ::c_ulonglong; + +pub type flock64 = flock; + +cfg_if! { + if #[cfg(doc)] { + // Used in `linux::arch` to define ioctl constants. + pub(crate) type Ioctl = ::c_int; + } else { + #[doc(hidden)] + pub type Ioctl = ::c_int; + } +} + +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_void { + #[repr(C)] + struct siginfo_sigfault { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + si_addr: *mut ::c_void, + } + (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr + } + + pub unsafe fn si_value(&self) -> ::sigval { + #[repr(C)] + struct siginfo_si_value { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + _si_timerid: ::c_int, + _si_overrun: ::c_int, + si_value: ::sigval, + } + (*(self as *const siginfo_t as *const siginfo_si_value)).si_value + } +} + +cfg_if! { + if #[cfg(libc_union)] { + // Internal, for casts to access union fields + #[repr(C)] + struct sifields_sigchld { + si_pid: ::pid_t, + si_uid: ::uid_t, + si_status: ::c_int, + si_utime: ::c_long, + si_stime: ::c_long, + } + impl ::Copy for sifields_sigchld {} + impl ::Clone for sifields_sigchld { + fn clone(&self) -> sifields_sigchld { + *self + } + } + + // Internal, for casts to access union fields + #[repr(C)] + union sifields { + _align_pointer: *mut ::c_void, + sigchld: sifields_sigchld, + } + + // Internal, for casts to access union fields. Note that some variants + // of sifields start with a pointer, which makes the alignment of + // sifields vary on 32-bit and 64-bit architectures. + #[repr(C)] + struct siginfo_f { + _siginfo_base: [::c_int; 3], + sifields: sifields, + } + + impl siginfo_t { + unsafe fn sifields(&self) -> &sifields { + &(*(self as *const siginfo_t as *const siginfo_f)).sifields + } + + pub unsafe fn si_pid(&self) -> ::pid_t { + self.sifields().sigchld.si_pid + } + + pub unsafe fn si_uid(&self) -> ::uid_t { + self.sifields().sigchld.si_uid + } + + pub unsafe fn si_status(&self) -> ::c_int { + self.sifields().sigchld.si_status + } + + pub unsafe fn si_utime(&self) -> ::c_long { + self.sifields().sigchld.si_utime + } + + pub unsafe fn si_stime(&self) -> ::c_long { + self.sifields().sigchld.si_stime + } + } + } +} + +s! { + pub struct aiocb { + pub aio_fildes: ::c_int, + pub aio_lio_opcode: ::c_int, + pub aio_reqprio: ::c_int, + pub aio_buf: *mut ::c_void, + pub aio_nbytes: ::size_t, + pub aio_sigevent: ::sigevent, + __td: *mut ::c_void, + __lock: [::c_int; 2], + __err: ::c_int, + __ret: ::ssize_t, + pub aio_offset: off_t, + __next: *mut ::c_void, + __prev: *mut ::c_void, + #[cfg(target_pointer_width = "32")] + __dummy4: [::c_char; 24], + #[cfg(target_pointer_width = "64")] + __dummy4: [::c_char; 16], + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_mask: ::sigset_t, + pub sa_flags: ::c_int, + pub sa_restorer: ::Option, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + #[cfg(target_endian = "little")] + pub f_fsid: ::c_ulong, + #[cfg(target_pointer_width = "32")] + __f_unused: ::c_int, + #[cfg(target_endian = "big")] + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + pub __c_ispeed: ::speed_t, + pub __c_ospeed: ::speed_t, + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct regex_t { + __re_nsub: ::size_t, + __opaque: *mut ::c_void, + __padding: [*mut ::c_void; 4usize], + __nsub2: ::size_t, + __padding2: ::c_char, + } + + pub struct rtentry { + pub rt_pad1: ::c_ulong, + pub rt_dst: ::sockaddr, + pub rt_gateway: ::sockaddr, + pub rt_genmask: ::sockaddr, + pub rt_flags: ::c_ushort, + pub rt_pad2: ::c_short, + pub rt_pad3: ::c_ulong, + pub rt_tos: ::c_uchar, + pub rt_class: ::c_uchar, + #[cfg(target_pointer_width = "64")] + pub rt_pad4: [::c_short; 3usize], + #[cfg(not(target_pointer_width = "64"))] + pub rt_pad4: [::c_short; 1usize], + pub rt_metric: ::c_short, + pub rt_dev: *mut ::c_char, + pub rt_mtu: ::c_ulong, + pub rt_window: ::c_ulong, + pub rt_irtt: ::c_ushort, + } + + pub struct __exit_status { + pub e_termination: ::c_short, + pub e_exit: ::c_short, + } + + pub struct Elf64_Chdr { + pub ch_type: ::Elf64_Word, + pub ch_reserved: ::Elf64_Word, + pub ch_size: ::Elf64_Xword, + pub ch_addralign: ::Elf64_Xword, + } + + pub struct Elf32_Chdr { + pub ch_type: ::Elf32_Word, + pub ch_size: ::Elf32_Word, + pub ch_addralign: ::Elf32_Word, + } + + pub struct timex { + pub modes: ::c_uint, + pub offset: ::c_long, + pub freq: ::c_long, + pub maxerror: ::c_long, + pub esterror: ::c_long, + pub status: ::c_int, + pub constant: ::c_long, + pub precision: ::c_long, + pub tolerance: ::c_long, + pub time: ::timeval, + pub tick: ::c_long, + pub ppsfreq: ::c_long, + pub jitter: ::c_long, + pub shift: ::c_int, + pub stabil: ::c_long, + pub jitcnt: ::c_long, + pub calcnt: ::c_long, + pub errcnt: ::c_long, + pub stbcnt: ::c_long, + pub tai: ::c_int, + pub __padding: [::c_int; 11], + } + + pub struct ntptimeval { + pub time: ::timeval, + pub maxerror: ::c_long, + pub esterror: ::c_long, + } +} + +s_no_extra_traits! { + pub struct sysinfo { + pub uptime: ::c_ulong, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, + pub freeram: ::c_ulong, + pub sharedram: ::c_ulong, + pub bufferram: ::c_ulong, + pub totalswap: ::c_ulong, + pub freeswap: ::c_ulong, + pub procs: ::c_ushort, + pub pad: ::c_ushort, + pub totalhigh: ::c_ulong, + pub freehigh: ::c_ulong, + pub mem_unit: ::c_uint, + pub __reserved: [::c_char; 256], + } + + // FIXME: musl added paddings and adjusted + // layout in 1.2.0 but our CI is still 1.1.24. + // So, I'm leaving some fields as comments for now. + // ref. https://github.com/bminor/musl/commit/ + // 1e7f0fcd7ff2096904fd93a2ee6d12a2392be392 + pub struct utmpx { + pub ut_type: ::c_short, + //__ut_pad1: ::c_short, + pub ut_pid: ::pid_t, + pub ut_line: [::c_char; 32], + pub ut_id: [::c_char; 4], + pub ut_user: [::c_char; 32], + pub ut_host: [::c_char; 256], + pub ut_exit: __exit_status, + + //#[cfg(target_endian = "little")] + pub ut_session: ::c_long, + //#[cfg(target_endian = "little")] + //__ut_pad2: ::c_long, + + //#[cfg(not(target_endian = "little"))] + //__ut_pad2: ::c_int, + //#[cfg(not(target_endian = "little"))] + //pub ut_session: ::c_int, + + pub ut_tv: ::timeval, + pub ut_addr_v6: [::c_uint; 4], + __unused: [::c_char; 20], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for sysinfo { + fn eq(&self, other: &sysinfo) -> bool { + self.uptime == other.uptime + && self.loads == other.loads + && self.totalram == other.totalram + && self.freeram == other.freeram + && self.sharedram == other.sharedram + && self.bufferram == other.bufferram + && self.totalswap == other.totalswap + && self.freeswap == other.freeswap + && self.procs == other.procs + && self.pad == other.pad + && self.totalhigh == other.totalhigh + && self.freehigh == other.freehigh + && self.mem_unit == other.mem_unit + && self + .__reserved + .iter() + .zip(other.__reserved.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for sysinfo {} + + impl ::fmt::Debug for sysinfo { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sysinfo") + .field("uptime", &self.uptime) + .field("loads", &self.loads) + .field("totalram", &self.totalram) + .field("freeram", &self.freeram) + .field("sharedram", &self.sharedram) + .field("bufferram", &self.bufferram) + .field("totalswap", &self.totalswap) + .field("freeswap", &self.freeswap) + .field("procs", &self.procs) + .field("pad", &self.pad) + .field("totalhigh", &self.totalhigh) + .field("freehigh", &self.freehigh) + .field("mem_unit", &self.mem_unit) + // FIXME: .field("__reserved", &self.__reserved) + .finish() + } + } + + impl ::hash::Hash for sysinfo { + fn hash(&self, state: &mut H) { + self.uptime.hash(state); + self.loads.hash(state); + self.totalram.hash(state); + self.freeram.hash(state); + self.sharedram.hash(state); + self.bufferram.hash(state); + self.totalswap.hash(state); + self.freeswap.hash(state); + self.procs.hash(state); + self.pad.hash(state); + self.totalhigh.hash(state); + self.freehigh.hash(state); + self.mem_unit.hash(state); + self.__reserved.hash(state); + } + } + + impl PartialEq for utmpx { + fn eq(&self, other: &utmpx) -> bool { + self.ut_type == other.ut_type + //&& self.__ut_pad1 == other.__ut_pad1 + && self.ut_pid == other.ut_pid + && self.ut_line == other.ut_line + && self.ut_id == other.ut_id + && self.ut_user == other.ut_user + && self + .ut_host + .iter() + .zip(other.ut_host.iter()) + .all(|(a,b)| a == b) + && self.ut_exit == other.ut_exit + && self.ut_session == other.ut_session + //&& self.__ut_pad2 == other.__ut_pad2 + && self.ut_tv == other.ut_tv + && self.ut_addr_v6 == other.ut_addr_v6 + && self.__unused == other.__unused + } + } + + impl Eq for utmpx {} + + impl ::fmt::Debug for utmpx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmpx") + .field("ut_type", &self.ut_type) + //.field("__ut_pad1", &self.__ut_pad1) + .field("ut_pid", &self.ut_pid) + .field("ut_line", &self.ut_line) + .field("ut_id", &self.ut_id) + .field("ut_user", &self.ut_user) + //FIXME: .field("ut_host", &self.ut_host) + .field("ut_exit", &self.ut_exit) + .field("ut_session", &self.ut_session) + //.field("__ut_pad2", &self.__ut_pad2) + .field("ut_tv", &self.ut_tv) + .field("ut_addr_v6", &self.ut_addr_v6) + .field("__unused", &self.__unused) + .finish() + } + } + + impl ::hash::Hash for utmpx { + fn hash(&self, state: &mut H) { + self.ut_type.hash(state); + //self.__ut_pad1.hash(state); + self.ut_pid.hash(state); + self.ut_line.hash(state); + self.ut_id.hash(state); + self.ut_user.hash(state); + self.ut_host.hash(state); + self.ut_exit.hash(state); + self.ut_session.hash(state); + //self.__ut_pad2.hash(state); + self.ut_tv.hash(state); + self.ut_addr_v6.hash(state); + self.__unused.hash(state); + } + } + } +} + +// include/sys/mman.h +/* + * Huge page size encoding when MAP_HUGETLB is specified, and a huge page + * size other than the default is desired. See hugetlb_encode.h. + * All known huge page size encodings are provided here. It is the + * responsibility of the application to know which sizes are supported on + * the running system. See mmap(2) man page for details. + */ +pub const MAP_HUGE_SHIFT: ::c_int = 26; +pub const MAP_HUGE_MASK: ::c_int = 0x3f; + +pub const MAP_HUGE_64KB: ::c_int = 16 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_512KB: ::c_int = 19 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_1MB: ::c_int = 20 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_2MB: ::c_int = 21 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_8MB: ::c_int = 23 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_16MB: ::c_int = 24 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_32MB: ::c_int = 25 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_256MB: ::c_int = 28 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_512MB: ::c_int = 29 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_1GB: ::c_int = 30 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_2GB: ::c_int = 31 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT; + +pub const MS_RMT_MASK: ::c_ulong = 0x02800051; + +pub const SFD_CLOEXEC: ::c_int = 0x080000; + +pub const NCCS: usize = 32; + +pub const O_TRUNC: ::c_int = 512; +pub const O_NOATIME: ::c_int = 0o1000000; +pub const O_CLOEXEC: ::c_int = 0x80000; +pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; + +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; + +pub const F_RDLCK: ::c_int = 0; +pub const F_WRLCK: ::c_int = 1; +pub const F_UNLCK: ::c_int = 2; + +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +pub const EFD_CLOEXEC: ::c_int = 0x80000; + +pub const BUFSIZ: ::c_uint = 1024; +pub const TMP_MAX: ::c_uint = 10000; +pub const FOPEN_MAX: ::c_uint = 1000; +pub const FILENAME_MAX: ::c_uint = 4096; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_EXEC: ::c_int = 0o10000000; +pub const O_SEARCH: ::c_int = 0o10000000; +pub const O_ACCMODE: ::c_int = 0o10000003; +pub const O_NDELAY: ::c_int = O_NONBLOCK; +pub const NI_MAXHOST: ::socklen_t = 255; +pub const PTHREAD_STACK_MIN: ::size_t = 2048; + +pub const POSIX_MADV_DONTNEED: ::c_int = 4; + +pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; + +pub const SOCK_DCCP: ::c_int = 6; +pub const SOCK_PACKET: ::c_int = 10; + +pub const SOMAXCONN: ::c_int = 128; + +#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] +pub const SIGUNUSED: ::c_int = ::SIGSYS; + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; + +pub const CPU_SETSIZE: ::c_int = 128; + +pub const PTRACE_TRACEME: ::c_int = 0; +pub const PTRACE_PEEKTEXT: ::c_int = 1; +pub const PTRACE_PEEKDATA: ::c_int = 2; +pub const PTRACE_PEEKUSER: ::c_int = 3; +pub const PTRACE_POKETEXT: ::c_int = 4; +pub const PTRACE_POKEDATA: ::c_int = 5; +pub const PTRACE_POKEUSER: ::c_int = 6; +pub const PTRACE_CONT: ::c_int = 7; +pub const PTRACE_KILL: ::c_int = 8; +pub const PTRACE_SINGLESTEP: ::c_int = 9; +pub const PTRACE_GETREGS: ::c_int = 12; +pub const PTRACE_SETREGS: ::c_int = 13; +pub const PTRACE_GETFPREGS: ::c_int = 14; +pub const PTRACE_SETFPREGS: ::c_int = 15; +pub const PTRACE_ATTACH: ::c_int = 16; +pub const PTRACE_DETACH: ::c_int = 17; +pub const PTRACE_GETFPXREGS: ::c_int = 18; +pub const PTRACE_SETFPXREGS: ::c_int = 19; +pub const PTRACE_SYSCALL: ::c_int = 24; +pub const PTRACE_SETOPTIONS: ::c_int = 0x4200; +pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201; +pub const PTRACE_GETSIGINFO: ::c_int = 0x4202; +pub const PTRACE_SETSIGINFO: ::c_int = 0x4203; +pub const PTRACE_GETREGSET: ::c_int = 0x4204; +pub const PTRACE_SETREGSET: ::c_int = 0x4205; +pub const PTRACE_SEIZE: ::c_int = 0x4206; +pub const PTRACE_INTERRUPT: ::c_int = 0x4207; +pub const PTRACE_LISTEN: ::c_int = 0x4208; +pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209; + +pub const FAN_MARK_INODE: ::c_uint = 0x0000_0000; +pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010; +// NOTE: FAN_MARK_FILESYSTEM requires Linux Kernel >= 4.20.0 +pub const FAN_MARK_FILESYSTEM: ::c_uint = 0x0000_0100; + +pub const AF_IB: ::c_int = 27; +pub const AF_MPLS: ::c_int = 28; +pub const AF_NFC: ::c_int = 39; +pub const AF_VSOCK: ::c_int = 40; +pub const AF_XDP: ::c_int = 44; +pub const PF_IB: ::c_int = AF_IB; +pub const PF_MPLS: ::c_int = AF_MPLS; +pub const PF_NFC: ::c_int = AF_NFC; +pub const PF_VSOCK: ::c_int = AF_VSOCK; +pub const PF_XDP: ::c_int = AF_XDP; + +pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK; + +pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_NOLOAD: ::c_int = 0x4; + +pub const CLOCK_SGI_CYCLE: ::clockid_t = 10; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const EXTA: ::speed_t = B19200; +pub const EXTB: ::speed_t = B38400; + +pub const REG_OK: ::c_int = 0; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +pub const ADJ_OFFSET: ::c_uint = 0x0001; +pub const ADJ_FREQUENCY: ::c_uint = 0x0002; +pub const ADJ_MAXERROR: ::c_uint = 0x0004; +pub const ADJ_ESTERROR: ::c_uint = 0x0008; +pub const ADJ_STATUS: ::c_uint = 0x0010; +pub const ADJ_TIMECONST: ::c_uint = 0x0020; +pub const ADJ_TAI: ::c_uint = 0x0080; +pub const ADJ_SETOFFSET: ::c_uint = 0x0100; +pub const ADJ_MICRO: ::c_uint = 0x1000; +pub const ADJ_NANO: ::c_uint = 0x2000; +pub const ADJ_TICK: ::c_uint = 0x4000; +pub const ADJ_OFFSET_SINGLESHOT: ::c_uint = 0x8001; +pub const ADJ_OFFSET_SS_READ: ::c_uint = 0xa001; +pub const MOD_OFFSET: ::c_uint = ADJ_OFFSET; +pub const MOD_FREQUENCY: ::c_uint = ADJ_FREQUENCY; +pub const MOD_MAXERROR: ::c_uint = ADJ_MAXERROR; +pub const MOD_ESTERROR: ::c_uint = ADJ_ESTERROR; +pub const MOD_STATUS: ::c_uint = ADJ_STATUS; +pub const MOD_TIMECONST: ::c_uint = ADJ_TIMECONST; +pub const MOD_CLKB: ::c_uint = ADJ_TICK; +pub const MOD_CLKA: ::c_uint = ADJ_OFFSET_SINGLESHOT; +pub const MOD_TAI: ::c_uint = ADJ_TAI; +pub const MOD_MICRO: ::c_uint = ADJ_MICRO; +pub const MOD_NANO: ::c_uint = ADJ_NANO; +pub const STA_PLL: ::c_int = 0x0001; +pub const STA_PPSFREQ: ::c_int = 0x0002; +pub const STA_PPSTIME: ::c_int = 0x0004; +pub const STA_FLL: ::c_int = 0x0008; +pub const STA_INS: ::c_int = 0x0010; +pub const STA_DEL: ::c_int = 0x0020; +pub const STA_UNSYNC: ::c_int = 0x0040; +pub const STA_FREQHOLD: ::c_int = 0x0080; +pub const STA_PPSSIGNAL: ::c_int = 0x0100; +pub const STA_PPSJITTER: ::c_int = 0x0200; +pub const STA_PPSWANDER: ::c_int = 0x0400; +pub const STA_PPSERROR: ::c_int = 0x0800; +pub const STA_CLOCKERR: ::c_int = 0x1000; +pub const STA_NANO: ::c_int = 0x2000; +pub const STA_MODE: ::c_int = 0x4000; +pub const STA_CLK: ::c_int = 0x8000; +pub const STA_RONLY: ::c_int = STA_PPSSIGNAL + | STA_PPSJITTER + | STA_PPSWANDER + | STA_PPSERROR + | STA_CLOCKERR + | STA_NANO + | STA_MODE + | STA_CLK; + +pub const TIME_OK: ::c_int = 0; +pub const TIME_INS: ::c_int = 1; +pub const TIME_DEL: ::c_int = 2; +pub const TIME_OOP: ::c_int = 3; +pub const TIME_WAIT: ::c_int = 4; +pub const TIME_ERROR: ::c_int = 5; +pub const TIME_BAD: ::c_int = TIME_ERROR; +pub const MAXTC: ::c_long = 6; + +cfg_if! { + if #[cfg(target_arch = "s390x")] { + pub const POSIX_FADV_DONTNEED: ::c_int = 6; + pub const POSIX_FADV_NOREUSE: ::c_int = 7; + } else { + pub const POSIX_FADV_DONTNEED: ::c_int = 4; + pub const POSIX_FADV_NOREUSE: ::c_int = 5; + } +} + +extern "C" { + pub fn sendmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_uint, + ) -> ::c_int; + pub fn recvmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_uint, + timeout: *mut ::timespec, + ) -> ::c_int; + + pub fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int; + pub fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int; + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + pub fn prlimit( + pid: ::pid_t, + resource: ::c_int, + new_limit: *const ::rlimit, + old_limit: *mut ::rlimit, + ) -> ::c_int; + pub fn prlimit64( + pid: ::pid_t, + resource: ::c_int, + new_limit: *const ::rlimit64, + old_limit: *mut ::rlimit64, + ) -> ::c_int; + + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn ptrace(request: ::c_int, ...) -> ::c_long; + pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int; + pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int; + // Musl targets need the `mask` argument of `fanotify_mark` be specified + // `::c_ulonglong` instead of `u64` or there will be a type mismatch between + // `long long unsigned int` and the expected `uint64_t`. + pub fn fanotify_mark( + fd: ::c_int, + flags: ::c_uint, + mask: ::c_ulonglong, + dirfd: ::c_int, + path: *const ::c_char, + ) -> ::c_int; + pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; + + // Added in `musl` 1.1.20 + pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t); + // Added in `musl` 1.2.2 + pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void; + + pub fn adjtimex(buf: *mut ::timex) -> ::c_int; + pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int; + + pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char; + + pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int; + pub fn mlock2(addr: *const ::c_void, len: ::size_t, flags: ::c_uint) -> ::c_int; + pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t; +} + +cfg_if! { + if #[cfg(any(target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "mips64", + target_arch = "powerpc64", + target_arch = "s390x", + target_arch = "riscv64"))] { + mod b64; + pub use self::b64::*; + } else if #[cfg(any(target_arch = "x86", + target_arch = "mips", + target_arch = "powerpc", + target_arch = "hexagon", + target_arch = "riscv32", + target_arch = "arm"))] { + mod b32; + pub use self::b32::*; + } else { } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/no_align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/no_align.rs new file mode 100644 index 0000000000000000000000000000000000000000..2b5abb3bed4b35ef79a9d1bb998f58438c160157 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/no_align.rs @@ -0,0 +1,105 @@ +macro_rules! expand_align { + () => { + s! { + pub struct pthread_mutexattr_t { + #[cfg(any(target_arch = "x86_64", + target_arch = "powerpc64", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", + target_arch = "riscv64", + target_arch = "riscv32", + target_arch = "loongarch64", + all(target_arch = "aarch64", + target_env = "musl")))] + __align: [::c_int; 0], + #[cfg(not(any(target_arch = "x86_64", + target_arch = "powerpc64", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", + target_arch = "riscv64", + target_arch = "riscv32", + target_arch = "loongarch64", + all(target_arch = "aarch64", + target_env = "musl"))))] + __align: [::c_long; 0], + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + pub struct pthread_rwlockattr_t { + #[cfg(target_env = "musl")] + __align: [::c_int; 0], + #[cfg(not(target_env = "musl"))] + __align: [::c_long; 0], + size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T], + } + + pub struct pthread_condattr_t { + __align: [::c_int; 0], + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + + pub struct fanotify_event_metadata { + __align: [::c_long; 0], + pub event_len: __u32, + pub vers: __u8, + pub reserved: __u8, + pub metadata_len: __u16, + pub mask: __u64, + pub fd: ::c_int, + pub pid: ::c_int, + } + } + + s_no_extra_traits! { + pub struct pthread_cond_t { + #[cfg(target_env = "musl")] + __align: [*const ::c_void; 0], + #[cfg(not(target_env = "musl"))] + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + + pub struct pthread_mutex_t { + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "m68k", + target_arch = "powerpc", + target_arch = "sparc", + all(target_arch = "x86_64", + target_pointer_width = "32")))] + __align: [::c_long; 0], + #[cfg(not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "m68k", + target_arch = "powerpc", + target_arch = "sparc", + all(target_arch = "x86_64", + target_pointer_width = "32"))))] + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + + pub struct pthread_rwlock_t { + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "m68k", + target_arch = "powerpc", + target_arch = "sparc", + all(target_arch = "x86_64", + target_pointer_width = "32")))] + __align: [::c_long; 0], + #[cfg(not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "m68k", + target_arch = "powerpc", + target_arch = "sparc", + all(target_arch = "x86_64", + target_pointer_width = "32"))))] + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + } + }; +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs new file mode 100644 index 0000000000000000000000000000000000000000..e2e2cb847ac655fb5055e6998f2a5ea47b627420 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/non_exhaustive.rs @@ -0,0 +1,9 @@ +s! { + // linux/openat2.h + #[non_exhaustive] + pub struct open_how { + pub flags: ::__u64, + pub mode: ::__u64, + pub resolve: ::__u64, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..e6610bb7b985c69b5f1a9969294ad90e49bd9703 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/align.rs @@ -0,0 +1,28 @@ +macro_rules! expand_align { + () => { + s! { + #[cfg_attr(any(target_pointer_width = "32", + target_arch = "x86_64", + target_arch = "powerpc64", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64"), + repr(align(4)))] + #[cfg_attr(not(any(target_pointer_width = "32", + target_arch = "x86_64", + target_arch = "powerpc64", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64")), + repr(align(8)))] + pub struct pthread_mutexattr_t { + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + #[repr(align(4))] + pub struct pthread_condattr_t { + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + } + }; +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..4a0e07460ebb10fe101ee84406726a5a2ac065a1 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/arm/align.rs @@ -0,0 +1,13 @@ +s! { + // FIXME this is actually a union + #[cfg_attr(target_pointer_width = "32", + repr(align(4)))] + #[cfg_attr(target_pointer_width = "64", + repr(align(8)))] + pub struct sem_t { + #[cfg(target_pointer_width = "32")] + __size: [::c_char; 16], + #[cfg(target_pointer_width = "64")] + __size: [::c_char; 32], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..e0279574b9921d51ce07e4c392e7f735305a0f0b --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/arm/mod.rs @@ -0,0 +1,897 @@ +pub type c_char = u8; +pub type wchar_t = ::c_uint; +pub type c_long = i32; +pub type c_ulong = u32; +pub type time_t = ::c_long; + +pub type clock_t = ::c_long; +pub type fsblkcnt_t = ::c_ulong; +pub type fsfilcnt_t = ::c_ulong; +pub type ino_t = ::c_ulong; +pub type off_t = ::c_long; +pub type pthread_t = ::c_ulong; +pub type suseconds_t = ::c_long; + +pub type nlink_t = ::c_uint; +pub type blksize_t = ::c_long; +pub type blkcnt_t = ::c_long; + +pub type fsblkcnt64_t = u64; +pub type fsfilcnt64_t = u64; +pub type __u64 = ::c_ulonglong; + +s! { + pub struct cmsghdr { + pub cmsg_len: ::size_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::c_int, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::socklen_t, + pub msg_flags: ::c_int, + } + + pub struct pthread_attr_t { + __size: [::c_long; 9], + } + + pub struct stat { + pub st_dev: ::c_ulonglong, + __pad1: ::c_ushort, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::c_ulonglong, + __pad2: ::c_ushort, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + __unused4: ::c_ulong, + __unused5: ::c_ulong, + } + + pub struct stat64 + { + pub st_dev: ::c_ulonglong, + pub __pad1: ::c_uint, + pub __st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::c_ulonglong, + pub __pad2: ::c_uint, + pub st_size: ::off64_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_ino: ::ino64_t, + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_pid: ::pid_t, + } + + pub struct sysinfo { + pub uptime: ::c_long, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, + pub freeram: ::c_ulong, + pub sharedram: ::c_ulong, + pub bufferram: ::c_ulong, + pub totalswap: ::c_ulong, + pub freeswap: ::c_ulong, + pub procs: ::c_ushort, + pub pad: ::c_ushort, + pub totalhigh: ::c_ulong, + pub freehigh: ::c_ulong, + pub mem_unit: ::c_uint, + pub _f: [::c_char; 8], + } + + pub struct statfs { + pub f_type: ::c_int, + pub f_bsize: ::c_int, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_int, + pub f_frsize: ::c_int, + pub f_flags: ::c_int, + pub f_spare: [::c_int; 4], + } + + pub struct statfs64 { + pub f_type: ::c_int, + pub f_bsize: ::c_int, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsfilcnt64_t, + pub f_ffree: ::fsfilcnt64_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_int, + pub f_frsize: ::c_int, + pub f_flags: ::c_int, + pub f_spare: [::c_int; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct sigset_t { + __val: [::c_ulong; 2], + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_flags: ::c_ulong, + pub sa_restorer: ::Option, + pub sa_mask: sigset_t, + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + pub _pad: [::c_int; 29], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t, + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_ushort, + __pad1: ::c_ushort, + pub __seq: ::c_ushort, + __pad2: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong, + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + __unused1: ::c_ulong, + pub msg_rtime: ::time_t, + __unused2: ::c_ulong, + pub msg_ctime: ::time_t, + __unused3: ::c_ulong, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong, + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + __unused1: ::c_ulong, + pub shm_dtime: ::time_t, + __unused2: ::c_ulong, + pub shm_ctime: ::time_t, + __unused3: ::c_ulong, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong, + } +} + +pub const O_CLOEXEC: ::c_int = 0o2000000; +pub const __SIZEOF_PTHREAD_ATTR_T: usize = 36; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_COND_COMPAT_T: usize = 12; +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; +pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20; +pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; +pub const NCCS: usize = 32; + +// I wasn't able to find those constants +// in uclibc build environment for armv7 +pub const MAP_HUGETLB: ::c_int = 0x040000; // from linux/other/mod.rs + +// autogenerated constants with hand tuned types +pub const B0: ::speed_t = 0; +pub const B1000000: ::speed_t = 0x1008; +pub const B110: ::speed_t = 0x3; +pub const B115200: ::speed_t = 0x1002; +pub const B1152000: ::speed_t = 0x1009; +pub const B1200: ::speed_t = 0x9; +pub const B134: ::speed_t = 0x4; +pub const B150: ::speed_t = 0x5; +pub const B1500000: ::speed_t = 0x100a; +pub const B1800: ::speed_t = 0xa; +pub const B19200: ::speed_t = 0xe; +pub const B200: ::speed_t = 0x6; +pub const B2000000: ::speed_t = 0x100b; +pub const B230400: ::speed_t = 0x1003; +pub const B2400: ::speed_t = 0xb; +pub const B2500000: ::speed_t = 0x100c; +pub const B300: ::speed_t = 0x7; +pub const B3000000: ::speed_t = 0x100d; +pub const B3500000: ::speed_t = 0x100e; +pub const B38400: ::speed_t = 0xf; +pub const B4000000: ::speed_t = 0x100f; +pub const B460800: ::speed_t = 0x1004; +pub const B4800: ::speed_t = 0xc; +pub const B50: ::speed_t = 0x1; +pub const B500000: ::speed_t = 0x1005; +pub const B57600: ::speed_t = 0x1001; +pub const B576000: ::speed_t = 0x1006; +pub const B600: ::speed_t = 0x8; +pub const B75: ::speed_t = 0x2; +pub const B921600: ::speed_t = 0x1007; +pub const B9600: ::speed_t = 0xd; +pub const BS1: ::c_int = 0x2000; +pub const BSDLY: ::c_int = 0x2000; +pub const CBAUD: ::tcflag_t = 0x100f; +pub const CBAUDEX: ::tcflag_t = 0x1000; +pub const CIBAUD: ::tcflag_t = 0x100f0000; +pub const CLOCAL: ::tcflag_t = 0x800; +pub const CPU_SETSIZE: ::c_int = 0x400; +pub const CR1: ::c_int = 0x200; +pub const CR2: ::c_int = 0x400; +pub const CR3: ::c_int = 0x600; +pub const CRDLY: ::c_int = 0x600; +pub const CREAD: ::tcflag_t = 0x80; +pub const CS6: ::tcflag_t = 0x10; +pub const CS7: ::tcflag_t = 0x20; +pub const CS8: ::tcflag_t = 0x30; +pub const CSIZE: ::tcflag_t = 0x30; +pub const CSTOPB: ::tcflag_t = 0x40; +pub const EADDRINUSE: ::c_int = 0x62; +pub const EADDRNOTAVAIL: ::c_int = 0x63; +pub const EADV: ::c_int = 0x44; +pub const EAFNOSUPPORT: ::c_int = 0x61; +pub const EALREADY: ::c_int = 0x72; +pub const EBADE: ::c_int = 0x34; +pub const EBADFD: ::c_int = 0x4d; +pub const EBADMSG: ::c_int = 0x4a; +pub const EBADR: ::c_int = 0x35; +pub const EBADRQC: ::c_int = 0x38; +pub const EBADSLT: ::c_int = 0x39; +pub const EBFONT: ::c_int = 0x3b; +pub const ECANCELED: ::c_int = 0x7d; +pub const ECHOCTL: ::tcflag_t = 0x200; +pub const ECHOE: ::tcflag_t = 0x10; +pub const ECHOK: ::tcflag_t = 0x20; +pub const ECHOKE: ::tcflag_t = 0x800; +pub const ECHONL: ::tcflag_t = 0x40; +pub const ECHOPRT: ::tcflag_t = 0x400; +pub const ECHRNG: ::c_int = 0x2c; +pub const ECOMM: ::c_int = 0x46; +pub const ECONNABORTED: ::c_int = 0x67; +pub const ECONNREFUSED: ::c_int = 0x6f; +pub const ECONNRESET: ::c_int = 0x68; +pub const EDEADLK: ::c_int = 0x23; +pub const EDESTADDRREQ: ::c_int = 0x59; +pub const EDOTDOT: ::c_int = 0x49; +pub const EDQUOT: ::c_int = 0x7a; +pub const EFD_CLOEXEC: ::c_int = 0x80000; +pub const EFD_NONBLOCK: ::c_int = 0x800; +pub const EHOSTDOWN: ::c_int = 0x70; +pub const EHOSTUNREACH: ::c_int = 0x71; +pub const EHWPOISON: ::c_int = 0x85; +pub const EIDRM: ::c_int = 0x2b; +pub const EILSEQ: ::c_int = 0x54; +pub const EINPROGRESS: ::c_int = 0x73; +pub const EISCONN: ::c_int = 0x6a; +pub const EISNAM: ::c_int = 0x78; +pub const EKEYEXPIRED: ::c_int = 0x7f; +pub const EKEYREJECTED: ::c_int = 0x81; +pub const EKEYREVOKED: ::c_int = 0x80; +pub const EL2HLT: ::c_int = 0x33; +pub const EL2NSYNC: ::c_int = 0x2d; +pub const EL3HLT: ::c_int = 0x2e; +pub const EL3RST: ::c_int = 0x2f; +pub const ELIBACC: ::c_int = 0x4f; +pub const ELIBBAD: ::c_int = 0x50; +pub const ELIBEXEC: ::c_int = 0x53; +pub const ELIBMAX: ::c_int = 0x52; +pub const ELIBSCN: ::c_int = 0x51; +pub const ELNRNG: ::c_int = 0x30; +pub const ELOOP: ::c_int = 0x28; +pub const EMEDIUMTYPE: ::c_int = 0x7c; +pub const EMSGSIZE: ::c_int = 0x5a; +pub const EMULTIHOP: ::c_int = 0x48; +pub const ENAMETOOLONG: ::c_int = 0x24; +pub const ENAVAIL: ::c_int = 0x77; +pub const ENETDOWN: ::c_int = 0x64; +pub const ENETRESET: ::c_int = 0x66; +pub const ENETUNREACH: ::c_int = 0x65; +pub const ENOANO: ::c_int = 0x37; +pub const ENOBUFS: ::c_int = 0x69; +pub const ENOCSI: ::c_int = 0x32; +pub const ENODATA: ::c_int = 0x3d; +pub const ENOKEY: ::c_int = 0x7e; +pub const ENOLCK: ::c_int = 0x25; +pub const ENOLINK: ::c_int = 0x43; +pub const ENOMEDIUM: ::c_int = 0x7b; +pub const ENOMSG: ::c_int = 0x2a; +pub const ENONET: ::c_int = 0x40; +pub const ENOPKG: ::c_int = 0x41; +pub const ENOPROTOOPT: ::c_int = 0x5c; +pub const ENOSR: ::c_int = 0x3f; +pub const ENOSTR: ::c_int = 0x3c; +pub const ENOSYS: ::c_int = 0x26; +pub const ENOTCONN: ::c_int = 0x6b; +pub const ENOTEMPTY: ::c_int = 0x27; +pub const ENOTNAM: ::c_int = 0x76; +pub const ENOTRECOVERABLE: ::c_int = 0x83; +pub const ENOTSOCK: ::c_int = 0x58; +pub const ENOTUNIQ: ::c_int = 0x4c; +pub const EOPNOTSUPP: ::c_int = 0x5f; +pub const EOVERFLOW: ::c_int = 0x4b; +pub const EOWNERDEAD: ::c_int = 0x82; +pub const EPFNOSUPPORT: ::c_int = 0x60; +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; +pub const EPROTO: ::c_int = 0x47; +pub const EPROTONOSUPPORT: ::c_int = 0x5d; +pub const EPROTOTYPE: ::c_int = 0x5b; +pub const EREMCHG: ::c_int = 0x4e; +pub const EREMOTE: ::c_int = 0x42; +pub const EREMOTEIO: ::c_int = 0x79; +pub const ERESTART: ::c_int = 0x55; +pub const ERFKILL: ::c_int = 0x84; +pub const ESHUTDOWN: ::c_int = 0x6c; +pub const ESOCKTNOSUPPORT: ::c_int = 0x5e; +pub const ESRMNT: ::c_int = 0x45; +pub const ESTALE: ::c_int = 0x74; +pub const ESTRPIPE: ::c_int = 0x56; +pub const ETIME: ::c_int = 0x3e; +pub const ETIMEDOUT: ::c_int = 0x6e; +pub const ETOOMANYREFS: ::c_int = 0x6d; +pub const EUCLEAN: ::c_int = 0x75; +pub const EUNATCH: ::c_int = 0x31; +pub const EUSERS: ::c_int = 0x57; +pub const EXFULL: ::c_int = 0x36; +pub const FF1: ::c_int = 0x8000; +pub const FFDLY: ::c_int = 0x8000; +pub const FLUSHO: ::tcflag_t = 0x1000; +pub const F_GETLK: ::c_int = 0x5; +pub const F_SETLK: ::c_int = 0x6; +pub const F_SETLKW: ::c_int = 0x7; +pub const HUPCL: ::tcflag_t = 0x400; +pub const ICANON: ::tcflag_t = 0x2; +pub const IEXTEN: ::tcflag_t = 0x8000; +pub const ISIG: ::tcflag_t = 0x1; +pub const IXOFF: ::tcflag_t = 0x1000; +pub const IXON: ::tcflag_t = 0x400; +pub const MAP_ANON: ::c_int = 0x20; +pub const MAP_ANONYMOUS: ::c_int = 0x20; +pub const MAP_DENYWRITE: ::c_int = 0x800; +pub const MAP_EXECUTABLE: ::c_int = 0x1000; +pub const MAP_GROWSDOWN: ::c_int = 0x100; +pub const MAP_LOCKED: ::c_int = 0x2000; +pub const MAP_NONBLOCK: ::c_int = 0x10000; +pub const MAP_NORESERVE: ::c_int = 0x4000; +pub const MAP_POPULATE: ::c_int = 0x8000; +pub const MAP_STACK: ::c_int = 0x20000; +pub const NLDLY: ::tcflag_t = 0x100; +pub const NOFLSH: ::tcflag_t = 0x80; +pub const OLCUC: ::tcflag_t = 0x2; +pub const ONLCR: ::tcflag_t = 0x4; +pub const O_ACCMODE: ::c_int = 0x3; +pub const O_APPEND: ::c_int = 0x400; +pub const O_ASYNC: ::c_int = 0o20000; +pub const O_CREAT: ::c_int = 0x40; +pub const O_DIRECT: ::c_int = 0x10000; +pub const O_DIRECTORY: ::c_int = 0x4000; +pub const O_DSYNC: ::c_int = O_SYNC; +pub const O_EXCL: ::c_int = 0x80; +pub const O_FSYNC: ::c_int = O_SYNC; +pub const O_LARGEFILE: ::c_int = 0o400000; +pub const O_NDELAY: ::c_int = O_NONBLOCK; +pub const O_NOATIME: ::c_int = 0o1000000; +pub const O_NOCTTY: ::c_int = 0x100; +pub const O_NOFOLLOW: ::c_int = 0x8000; +pub const O_NONBLOCK: ::c_int = 0x800; +pub const O_PATH: ::c_int = 0o10000000; +pub const O_RSYNC: ::c_int = O_SYNC; +pub const O_SYNC: ::c_int = 0o10000; +pub const O_TRUNC: ::c_int = 0x200; +pub const PARENB: ::tcflag_t = 0x100; +pub const PARODD: ::tcflag_t = 0x200; +pub const PENDIN: ::tcflag_t = 0x4000; +pub const POLLWRBAND: ::c_short = 0x200; +pub const POLLWRNORM: ::c_short = 0x100; +pub const PTHREAD_STACK_MIN: ::size_t = 16384; +pub const RTLD_GLOBAL: ::c_int = 0x00100; + +// These are typed unsigned to match sigaction +pub const SA_NOCLDSTOP: ::c_ulong = 0x1; +pub const SA_NOCLDWAIT: ::c_ulong = 0x2; +pub const SA_SIGINFO: ::c_ulong = 0x4; +pub const SA_NODEFER: ::c_ulong = 0x40000000; +pub const SA_ONSTACK: ::c_ulong = 0x8000000; +pub const SA_RESETHAND: ::c_ulong = 0x80000000; +pub const SA_RESTART: ::c_ulong = 0x10000000; + +pub const SFD_CLOEXEC: ::c_int = 0x80000; +pub const SFD_NONBLOCK: ::c_int = 0x800; +pub const SIGBUS: ::c_int = 0x7; +pub const SIGCHLD: ::c_int = 0x11; +pub const SIGCONT: ::c_int = 0x12; +pub const SIGIO: ::c_int = 0x1d; +pub const SIGPROF: ::c_int = 0x1b; +pub const SIGPWR: ::c_int = 0x1e; +pub const SIGSTKFLT: ::c_int = 0x10; +pub const SIGSTKSZ: ::size_t = 8192; +pub const SIGSTOP: ::c_int = 0x13; +pub const SIGSYS: ::c_int = 0x1f; +pub const SIGTSTP: ::c_int = 0x14; +pub const SIGTTIN: ::c_int = 0x15; +pub const SIGTTOU: ::c_int = 0x16; +pub const SIGURG: ::c_int = 0x17; +pub const SIGUSR1: ::c_int = 0xa; +pub const SIGUSR2: ::c_int = 0xc; +pub const SIGVTALRM: ::c_int = 0x1a; +pub const SIGWINCH: ::c_int = 0x1c; +pub const SIGXCPU: ::c_int = 0x18; +pub const SIGXFSZ: ::c_int = 0x19; +pub const SIG_BLOCK: ::c_int = 0; +pub const SIG_SETMASK: ::c_int = 0x2; +pub const SIG_UNBLOCK: ::c_int = 0x1; +pub const SOCK_DGRAM: ::c_int = 0x2; +pub const SOCK_NONBLOCK: ::c_int = 0o0004000; +pub const SOCK_SEQPACKET: ::c_int = 0x5; +pub const SOCK_STREAM: ::c_int = 0x1; + +pub const TAB1: ::c_int = 0x800; +pub const TAB2: ::c_int = 0x1000; +pub const TAB3: ::c_int = 0x1800; +pub const TABDLY: ::c_int = 0x1800; +pub const TCSADRAIN: ::c_int = 0x1; +pub const TCSAFLUSH: ::c_int = 0x2; +pub const TCSANOW: ::c_int = 0; +pub const TOSTOP: ::tcflag_t = 0x100; +pub const VDISCARD: usize = 0xd; +pub const VEOF: usize = 0x4; +pub const VEOL: usize = 0xb; +pub const VEOL2: usize = 0x10; +pub const VMIN: usize = 0x6; +pub const VREPRINT: usize = 0xc; +pub const VSTART: usize = 0x8; +pub const VSTOP: usize = 0x9; +pub const VSUSP: usize = 0xa; +pub const VSWTC: usize = 0x7; +pub const VT1: ::c_int = 0x4000; +pub const VTDLY: ::c_int = 0x4000; +pub const VTIME: usize = 0x5; +pub const VWERASE: usize = 0xe; +pub const XTABS: ::tcflag_t = 0x1800; + +pub const MADV_SOFT_OFFLINE: ::c_int = 101; + +// Syscall table is copied from src/unix/notbsd/linux/musl/b32/arm.rs +pub const SYS_restart_syscall: ::c_long = 0; +pub const SYS_exit: ::c_long = 1; +pub const SYS_fork: ::c_long = 2; +pub const SYS_read: ::c_long = 3; +pub const SYS_write: ::c_long = 4; +pub const SYS_open: ::c_long = 5; +pub const SYS_close: ::c_long = 6; +pub const SYS_creat: ::c_long = 8; +pub const SYS_link: ::c_long = 9; +pub const SYS_unlink: ::c_long = 10; +pub const SYS_execve: ::c_long = 11; +pub const SYS_chdir: ::c_long = 12; +pub const SYS_mknod: ::c_long = 14; +pub const SYS_chmod: ::c_long = 15; +pub const SYS_lchown: ::c_long = 16; +pub const SYS_lseek: ::c_long = 19; +pub const SYS_getpid: ::c_long = 20; +pub const SYS_mount: ::c_long = 21; +pub const SYS_setuid: ::c_long = 23; +pub const SYS_getuid: ::c_long = 24; +pub const SYS_ptrace: ::c_long = 26; +pub const SYS_pause: ::c_long = 29; +pub const SYS_access: ::c_long = 33; +pub const SYS_nice: ::c_long = 34; +pub const SYS_sync: ::c_long = 36; +pub const SYS_kill: ::c_long = 37; +pub const SYS_rename: ::c_long = 38; +pub const SYS_mkdir: ::c_long = 39; +pub const SYS_rmdir: ::c_long = 40; +pub const SYS_dup: ::c_long = 41; +pub const SYS_pipe: ::c_long = 42; +pub const SYS_times: ::c_long = 43; +pub const SYS_brk: ::c_long = 45; +pub const SYS_setgid: ::c_long = 46; +pub const SYS_getgid: ::c_long = 47; +pub const SYS_geteuid: ::c_long = 49; +pub const SYS_getegid: ::c_long = 50; +pub const SYS_acct: ::c_long = 51; +pub const SYS_umount2: ::c_long = 52; +pub const SYS_ioctl: ::c_long = 54; +pub const SYS_fcntl: ::c_long = 55; +pub const SYS_setpgid: ::c_long = 57; +pub const SYS_umask: ::c_long = 60; +pub const SYS_chroot: ::c_long = 61; +pub const SYS_ustat: ::c_long = 62; +pub const SYS_dup2: ::c_long = 63; +pub const SYS_getppid: ::c_long = 64; +pub const SYS_getpgrp: ::c_long = 65; +pub const SYS_setsid: ::c_long = 66; +pub const SYS_sigaction: ::c_long = 67; +pub const SYS_setreuid: ::c_long = 70; +pub const SYS_setregid: ::c_long = 71; +pub const SYS_sigsuspend: ::c_long = 72; +pub const SYS_sigpending: ::c_long = 73; +pub const SYS_sethostname: ::c_long = 74; +pub const SYS_setrlimit: ::c_long = 75; +pub const SYS_getrusage: ::c_long = 77; +pub const SYS_gettimeofday: ::c_long = 78; +pub const SYS_settimeofday: ::c_long = 79; +pub const SYS_getgroups: ::c_long = 80; +pub const SYS_setgroups: ::c_long = 81; +pub const SYS_symlink: ::c_long = 83; +pub const SYS_readlink: ::c_long = 85; +pub const SYS_uselib: ::c_long = 86; +pub const SYS_swapon: ::c_long = 87; +pub const SYS_reboot: ::c_long = 88; +pub const SYS_munmap: ::c_long = 91; +pub const SYS_truncate: ::c_long = 92; +pub const SYS_ftruncate: ::c_long = 93; +pub const SYS_fchmod: ::c_long = 94; +pub const SYS_fchown: ::c_long = 95; +pub const SYS_getpriority: ::c_long = 96; +pub const SYS_setpriority: ::c_long = 97; +pub const SYS_statfs: ::c_long = 99; +pub const SYS_fstatfs: ::c_long = 100; +pub const SYS_syslog: ::c_long = 103; +pub const SYS_setitimer: ::c_long = 104; +pub const SYS_getitimer: ::c_long = 105; +pub const SYS_stat: ::c_long = 106; +pub const SYS_lstat: ::c_long = 107; +pub const SYS_fstat: ::c_long = 108; +pub const SYS_vhangup: ::c_long = 111; +pub const SYS_wait4: ::c_long = 114; +pub const SYS_swapoff: ::c_long = 115; +pub const SYS_sysinfo: ::c_long = 116; +pub const SYS_fsync: ::c_long = 118; +pub const SYS_sigreturn: ::c_long = 119; +pub const SYS_clone: ::c_long = 120; +pub const SYS_setdomainname: ::c_long = 121; +pub const SYS_uname: ::c_long = 122; +pub const SYS_adjtimex: ::c_long = 124; +pub const SYS_mprotect: ::c_long = 125; +pub const SYS_sigprocmask: ::c_long = 126; +pub const SYS_init_module: ::c_long = 128; +pub const SYS_delete_module: ::c_long = 129; +pub const SYS_quotactl: ::c_long = 131; +pub const SYS_getpgid: ::c_long = 132; +pub const SYS_fchdir: ::c_long = 133; +pub const SYS_bdflush: ::c_long = 134; +pub const SYS_sysfs: ::c_long = 135; +pub const SYS_personality: ::c_long = 136; +pub const SYS_setfsuid: ::c_long = 138; +pub const SYS_setfsgid: ::c_long = 139; +pub const SYS__llseek: ::c_long = 140; +pub const SYS_getdents: ::c_long = 141; +pub const SYS__newselect: ::c_long = 142; +pub const SYS_flock: ::c_long = 143; +pub const SYS_msync: ::c_long = 144; +pub const SYS_readv: ::c_long = 145; +pub const SYS_writev: ::c_long = 146; +pub const SYS_getsid: ::c_long = 147; +pub const SYS_fdatasync: ::c_long = 148; +pub const SYS__sysctl: ::c_long = 149; +pub const SYS_mlock: ::c_long = 150; +pub const SYS_munlock: ::c_long = 151; +pub const SYS_mlockall: ::c_long = 152; +pub const SYS_munlockall: ::c_long = 153; +pub const SYS_sched_setparam: ::c_long = 154; +pub const SYS_sched_getparam: ::c_long = 155; +pub const SYS_sched_setscheduler: ::c_long = 156; +pub const SYS_sched_getscheduler: ::c_long = 157; +pub const SYS_sched_yield: ::c_long = 158; +pub const SYS_sched_get_priority_max: ::c_long = 159; +pub const SYS_sched_get_priority_min: ::c_long = 160; +pub const SYS_sched_rr_get_interval: ::c_long = 161; +pub const SYS_nanosleep: ::c_long = 162; +pub const SYS_mremap: ::c_long = 163; +pub const SYS_setresuid: ::c_long = 164; +pub const SYS_getresuid: ::c_long = 165; +pub const SYS_poll: ::c_long = 168; +pub const SYS_nfsservctl: ::c_long = 169; +pub const SYS_setresgid: ::c_long = 170; +pub const SYS_getresgid: ::c_long = 171; +pub const SYS_prctl: ::c_long = 172; +pub const SYS_rt_sigreturn: ::c_long = 173; +pub const SYS_rt_sigaction: ::c_long = 174; +pub const SYS_rt_sigprocmask: ::c_long = 175; +pub const SYS_rt_sigpending: ::c_long = 176; +pub const SYS_rt_sigtimedwait: ::c_long = 177; +pub const SYS_rt_sigqueueinfo: ::c_long = 178; +pub const SYS_rt_sigsuspend: ::c_long = 179; +pub const SYS_pread64: ::c_long = 180; +pub const SYS_pwrite64: ::c_long = 181; +pub const SYS_chown: ::c_long = 182; +pub const SYS_getcwd: ::c_long = 183; +pub const SYS_capget: ::c_long = 184; +pub const SYS_capset: ::c_long = 185; +pub const SYS_sigaltstack: ::c_long = 186; +pub const SYS_sendfile: ::c_long = 187; +pub const SYS_vfork: ::c_long = 190; +pub const SYS_ugetrlimit: ::c_long = 191; +pub const SYS_mmap2: ::c_long = 192; +pub const SYS_truncate64: ::c_long = 193; +pub const SYS_ftruncate64: ::c_long = 194; +pub const SYS_stat64: ::c_long = 195; +pub const SYS_lstat64: ::c_long = 196; +pub const SYS_fstat64: ::c_long = 197; +pub const SYS_lchown32: ::c_long = 198; +pub const SYS_getuid32: ::c_long = 199; +pub const SYS_getgid32: ::c_long = 200; +pub const SYS_geteuid32: ::c_long = 201; +pub const SYS_getegid32: ::c_long = 202; +pub const SYS_setreuid32: ::c_long = 203; +pub const SYS_setregid32: ::c_long = 204; +pub const SYS_getgroups32: ::c_long = 205; +pub const SYS_setgroups32: ::c_long = 206; +pub const SYS_fchown32: ::c_long = 207; +pub const SYS_setresuid32: ::c_long = 208; +pub const SYS_getresuid32: ::c_long = 209; +pub const SYS_setresgid32: ::c_long = 210; +pub const SYS_getresgid32: ::c_long = 211; +pub const SYS_chown32: ::c_long = 212; +pub const SYS_setuid32: ::c_long = 213; +pub const SYS_setgid32: ::c_long = 214; +pub const SYS_setfsuid32: ::c_long = 215; +pub const SYS_setfsgid32: ::c_long = 216; +pub const SYS_getdents64: ::c_long = 217; +pub const SYS_pivot_root: ::c_long = 218; +pub const SYS_mincore: ::c_long = 219; +pub const SYS_madvise: ::c_long = 220; +pub const SYS_fcntl64: ::c_long = 221; +pub const SYS_gettid: ::c_long = 224; +pub const SYS_readahead: ::c_long = 225; +pub const SYS_setxattr: ::c_long = 226; +pub const SYS_lsetxattr: ::c_long = 227; +pub const SYS_fsetxattr: ::c_long = 228; +pub const SYS_getxattr: ::c_long = 229; +pub const SYS_lgetxattr: ::c_long = 230; +pub const SYS_fgetxattr: ::c_long = 231; +pub const SYS_listxattr: ::c_long = 232; +pub const SYS_llistxattr: ::c_long = 233; +pub const SYS_flistxattr: ::c_long = 234; +pub const SYS_removexattr: ::c_long = 235; +pub const SYS_lremovexattr: ::c_long = 236; +pub const SYS_fremovexattr: ::c_long = 237; +pub const SYS_tkill: ::c_long = 238; +pub const SYS_sendfile64: ::c_long = 239; +pub const SYS_futex: ::c_long = 240; +pub const SYS_sched_setaffinity: ::c_long = 241; +pub const SYS_sched_getaffinity: ::c_long = 242; +pub const SYS_io_setup: ::c_long = 243; +pub const SYS_io_destroy: ::c_long = 244; +pub const SYS_io_getevents: ::c_long = 245; +pub const SYS_io_submit: ::c_long = 246; +pub const SYS_io_cancel: ::c_long = 247; +pub const SYS_exit_group: ::c_long = 248; +pub const SYS_lookup_dcookie: ::c_long = 249; +pub const SYS_epoll_create: ::c_long = 250; +pub const SYS_epoll_ctl: ::c_long = 251; +pub const SYS_epoll_wait: ::c_long = 252; +pub const SYS_remap_file_pages: ::c_long = 253; +pub const SYS_set_tid_address: ::c_long = 256; +pub const SYS_timer_create: ::c_long = 257; +pub const SYS_timer_settime: ::c_long = 258; +pub const SYS_timer_gettime: ::c_long = 259; +pub const SYS_timer_getoverrun: ::c_long = 260; +pub const SYS_timer_delete: ::c_long = 261; +pub const SYS_clock_settime: ::c_long = 262; +pub const SYS_clock_gettime: ::c_long = 263; +pub const SYS_clock_getres: ::c_long = 264; +pub const SYS_clock_nanosleep: ::c_long = 265; +pub const SYS_statfs64: ::c_long = 266; +pub const SYS_fstatfs64: ::c_long = 267; +pub const SYS_tgkill: ::c_long = 268; +pub const SYS_utimes: ::c_long = 269; +pub const SYS_pciconfig_iobase: ::c_long = 271; +pub const SYS_pciconfig_read: ::c_long = 272; +pub const SYS_pciconfig_write: ::c_long = 273; +pub const SYS_mq_open: ::c_long = 274; +pub const SYS_mq_unlink: ::c_long = 275; +pub const SYS_mq_timedsend: ::c_long = 276; +pub const SYS_mq_timedreceive: ::c_long = 277; +pub const SYS_mq_notify: ::c_long = 278; +pub const SYS_mq_getsetattr: ::c_long = 279; +pub const SYS_waitid: ::c_long = 280; +pub const SYS_socket: ::c_long = 281; +pub const SYS_bind: ::c_long = 282; +pub const SYS_connect: ::c_long = 283; +pub const SYS_listen: ::c_long = 284; +pub const SYS_accept: ::c_long = 285; +pub const SYS_getsockname: ::c_long = 286; +pub const SYS_getpeername: ::c_long = 287; +pub const SYS_socketpair: ::c_long = 288; +pub const SYS_send: ::c_long = 289; +pub const SYS_sendto: ::c_long = 290; +pub const SYS_recv: ::c_long = 291; +pub const SYS_recvfrom: ::c_long = 292; +pub const SYS_shutdown: ::c_long = 293; +pub const SYS_setsockopt: ::c_long = 294; +pub const SYS_getsockopt: ::c_long = 295; +pub const SYS_sendmsg: ::c_long = 296; +pub const SYS_recvmsg: ::c_long = 297; +pub const SYS_semop: ::c_long = 298; +pub const SYS_semget: ::c_long = 299; +pub const SYS_semctl: ::c_long = 300; +pub const SYS_msgsnd: ::c_long = 301; +pub const SYS_msgrcv: ::c_long = 302; +pub const SYS_msgget: ::c_long = 303; +pub const SYS_msgctl: ::c_long = 304; +pub const SYS_shmat: ::c_long = 305; +pub const SYS_shmdt: ::c_long = 306; +pub const SYS_shmget: ::c_long = 307; +pub const SYS_shmctl: ::c_long = 308; +pub const SYS_add_key: ::c_long = 309; +pub const SYS_request_key: ::c_long = 310; +pub const SYS_keyctl: ::c_long = 311; +pub const SYS_semtimedop: ::c_long = 312; +pub const SYS_vserver: ::c_long = 313; +pub const SYS_ioprio_set: ::c_long = 314; +pub const SYS_ioprio_get: ::c_long = 315; +pub const SYS_inotify_init: ::c_long = 316; +pub const SYS_inotify_add_watch: ::c_long = 317; +pub const SYS_inotify_rm_watch: ::c_long = 318; +pub const SYS_mbind: ::c_long = 319; +pub const SYS_get_mempolicy: ::c_long = 320; +pub const SYS_set_mempolicy: ::c_long = 321; +pub const SYS_openat: ::c_long = 322; +pub const SYS_mkdirat: ::c_long = 323; +pub const SYS_mknodat: ::c_long = 324; +pub const SYS_fchownat: ::c_long = 325; +pub const SYS_futimesat: ::c_long = 326; +pub const SYS_fstatat64: ::c_long = 327; +pub const SYS_unlinkat: ::c_long = 328; +pub const SYS_renameat: ::c_long = 329; +pub const SYS_linkat: ::c_long = 330; +pub const SYS_symlinkat: ::c_long = 331; +pub const SYS_readlinkat: ::c_long = 332; +pub const SYS_fchmodat: ::c_long = 333; +pub const SYS_faccessat: ::c_long = 334; +pub const SYS_pselect6: ::c_long = 335; +pub const SYS_ppoll: ::c_long = 336; +pub const SYS_unshare: ::c_long = 337; +pub const SYS_set_robust_list: ::c_long = 338; +pub const SYS_get_robust_list: ::c_long = 339; +pub const SYS_splice: ::c_long = 340; +pub const SYS_tee: ::c_long = 342; +pub const SYS_vmsplice: ::c_long = 343; +pub const SYS_move_pages: ::c_long = 344; +pub const SYS_getcpu: ::c_long = 345; +pub const SYS_epoll_pwait: ::c_long = 346; +pub const SYS_kexec_load: ::c_long = 347; +pub const SYS_utimensat: ::c_long = 348; +pub const SYS_signalfd: ::c_long = 349; +pub const SYS_timerfd_create: ::c_long = 350; +pub const SYS_eventfd: ::c_long = 351; +pub const SYS_fallocate: ::c_long = 352; +pub const SYS_timerfd_settime: ::c_long = 353; +pub const SYS_timerfd_gettime: ::c_long = 354; +pub const SYS_signalfd4: ::c_long = 355; +pub const SYS_eventfd2: ::c_long = 356; +pub const SYS_epoll_create1: ::c_long = 357; +pub const SYS_dup3: ::c_long = 358; +pub const SYS_pipe2: ::c_long = 359; +pub const SYS_inotify_init1: ::c_long = 360; +pub const SYS_preadv: ::c_long = 361; +pub const SYS_pwritev: ::c_long = 362; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 363; +pub const SYS_perf_event_open: ::c_long = 364; +pub const SYS_recvmmsg: ::c_long = 365; +pub const SYS_accept4: ::c_long = 366; +pub const SYS_fanotify_init: ::c_long = 367; +pub const SYS_fanotify_mark: ::c_long = 368; +pub const SYS_prlimit64: ::c_long = 369; +pub const SYS_name_to_handle_at: ::c_long = 370; +pub const SYS_open_by_handle_at: ::c_long = 371; +pub const SYS_clock_adjtime: ::c_long = 372; +pub const SYS_syncfs: ::c_long = 373; +pub const SYS_sendmmsg: ::c_long = 374; +pub const SYS_setns: ::c_long = 375; +pub const SYS_process_vm_readv: ::c_long = 376; +pub const SYS_process_vm_writev: ::c_long = 377; +pub const SYS_kcmp: ::c_long = 378; +pub const SYS_finit_module: ::c_long = 379; +pub const SYS_sched_setattr: ::c_long = 380; +pub const SYS_sched_getattr: ::c_long = 381; +pub const SYS_renameat2: ::c_long = 382; +pub const SYS_seccomp: ::c_long = 383; +pub const SYS_getrandom: ::c_long = 384; +pub const SYS_memfd_create: ::c_long = 385; +pub const SYS_bpf: ::c_long = 386; +pub const SYS_execveat: ::c_long = 387; +pub const SYS_userfaultfd: ::c_long = 388; +pub const SYS_membarrier: ::c_long = 389; +pub const SYS_mlock2: ::c_long = 390; +pub const SYS_copy_file_range: ::c_long = 391; +pub const SYS_preadv2: ::c_long = 392; +pub const SYS_pwritev2: ::c_long = 393; +pub const SYS_pkey_mprotect: ::c_long = 394; +pub const SYS_pkey_alloc: ::c_long = 395; +pub const SYS_pkey_free: ::c_long = 396; +pub const SYS_statx: ::c_int = 397; +pub const SYS_pidfd_open: ::c_long = 434; +pub const SYS_clone3: ::c_long = 435; + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } else { + mod no_align; + pub use self::no_align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs new file mode 100644 index 0000000000000000000000000000000000000000..e32bf673d140e27b412196ccc9b9554b594e2ea8 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/arm/no_align.rs @@ -0,0 +1,10 @@ +s! { + // FIXME this is actually a union + pub struct sem_t { + #[cfg(target_pointer_width = "32")] + __size: [::c_char; 16], + #[cfg(target_pointer_width = "64")] + __size: [::c_char; 32], + __align: [::c_long; 0], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..4a0e07460ebb10fe101ee84406726a5a2ac065a1 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/align.rs @@ -0,0 +1,13 @@ +s! { + // FIXME this is actually a union + #[cfg_attr(target_pointer_width = "32", + repr(align(4)))] + #[cfg_attr(target_pointer_width = "64", + repr(align(8)))] + pub struct sem_t { + #[cfg(target_pointer_width = "32")] + __size: [::c_char; 16], + #[cfg(target_pointer_width = "64")] + __size: [::c_char; 32], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..e11dc6145e63fbee0bee620fe2d7fcdff49f7991 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs @@ -0,0 +1,664 @@ +pub type c_char = i8; +pub type c_long = i32; +pub type c_ulong = u32; +pub type clock_t = i32; +pub type time_t = i32; +pub type suseconds_t = i32; +pub type wchar_t = i32; +pub type off_t = i32; +pub type ino_t = u32; +pub type blkcnt_t = i32; +pub type blksize_t = i32; +pub type nlink_t = u32; +pub type fsblkcnt_t = ::c_ulong; +pub type fsfilcnt_t = ::c_ulong; +pub type __u64 = ::c_ulonglong; +pub type fsblkcnt64_t = u64; +pub type fsfilcnt64_t = u64; + +s! { + pub struct stat { + pub st_dev: ::dev_t, + st_pad1: [::c_long; 2], + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_pad2: [::c_long; 1], + pub st_size: ::off_t, + st_pad3: ::c_long, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + st_pad5: [::c_long; 14], + } + + pub struct stat64 { + pub st_dev: ::dev_t, + st_pad1: [::c_long; 2], + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + st_pad2: [::c_long; 2], + pub st_size: ::off64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + st_pad3: ::c_long, + pub st_blocks: ::blkcnt64_t, + st_pad5: [::c_long; 14], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsfilcnt64_t, + pub f_ffree: ::fsfilcnt64_t, + pub f_favail: ::fsfilcnt64_t, + pub f_fsid: ::c_ulong, + pub __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + pub __f_spare: [::c_int; 6], + } + + pub struct pthread_attr_t { + __size: [u32; 9] + } + + pub struct sigaction { + pub sa_flags: ::c_uint, + pub sa_sigaction: ::sighandler_t, + pub sa_mask: sigset_t, + _restorer: *mut ::c_void, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct sigset_t { + __val: [::c_ulong; 4], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_code: ::c_int, + pub si_errno: ::c_int, + pub _pad: [::c_int; 29], + } + + pub struct glob64_t { + pub gl_pathc: ::size_t, + pub gl_pathv: *mut *mut ::c_char, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + + __unused1: *mut ::c_void, + __unused2: *mut ::c_void, + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_uint, + pub __seq: ::c_ushort, + __pad1: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + #[cfg(target_endian = "big")] + __glibc_reserved1: ::c_ulong, + pub msg_stime: ::time_t, + #[cfg(target_endian = "little")] + __glibc_reserved1: ::c_ulong, + #[cfg(target_endian = "big")] + __glibc_reserved2: ::c_ulong, + pub msg_rtime: ::time_t, + #[cfg(target_endian = "little")] + __glibc_reserved2: ::c_ulong, + #[cfg(target_endian = "big")] + __glibc_reserved3: ::c_ulong, + pub msg_ctime: ::time_t, + #[cfg(target_endian = "little")] + __glibc_reserved3: ::c_ulong, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __glibc_reserved4: ::c_ulong, + __glibc_reserved5: ::c_ulong, + } + + pub struct statfs { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_frsize: ::c_long, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_files: ::fsblkcnt_t, + pub f_ffree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::c_long, + f_spare: [::c_long; 6], + } + + pub struct statfs64 { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_frsize: ::c_long, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_files: ::fsblkcnt64_t, + pub f_ffree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_long, + pub f_flags: ::c_long, + pub f_spare: [::c_long; 5], + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::c_int, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::size_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: ::size_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_sysid: ::c_long, + pub l_pid: ::pid_t, + pad: [::c_long; 4], + } + + pub struct sysinfo { + pub uptime: ::c_long, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, + pub freeram: ::c_ulong, + pub sharedram: ::c_ulong, + pub bufferram: ::c_ulong, + pub totalswap: ::c_ulong, + pub freeswap: ::c_ulong, + pub procs: ::c_ushort, + pub pad: ::c_ushort, + pub totalhigh: ::c_ulong, + pub freehigh: ::c_ulong, + pub mem_unit: ::c_uint, + pub _f: [::c_char; 8], + } +} + +pub const __SIZEOF_PTHREAD_ATTR_T: usize = 36; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; +pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20; +pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; + +pub const SYS_syscall: ::c_long = 4000 + 0; +pub const SYS_exit: ::c_long = 4000 + 1; +pub const SYS_fork: ::c_long = 4000 + 2; +pub const SYS_read: ::c_long = 4000 + 3; +pub const SYS_write: ::c_long = 4000 + 4; +pub const SYS_open: ::c_long = 4000 + 5; +pub const SYS_close: ::c_long = 4000 + 6; +pub const SYS_waitpid: ::c_long = 4000 + 7; +pub const SYS_creat: ::c_long = 4000 + 8; +pub const SYS_link: ::c_long = 4000 + 9; +pub const SYS_unlink: ::c_long = 4000 + 10; +pub const SYS_execve: ::c_long = 4000 + 11; +pub const SYS_chdir: ::c_long = 4000 + 12; +pub const SYS_time: ::c_long = 4000 + 13; +pub const SYS_mknod: ::c_long = 4000 + 14; +pub const SYS_chmod: ::c_long = 4000 + 15; +pub const SYS_lchown: ::c_long = 4000 + 16; +pub const SYS_break: ::c_long = 4000 + 17; +pub const SYS_lseek: ::c_long = 4000 + 19; +pub const SYS_getpid: ::c_long = 4000 + 20; +pub const SYS_mount: ::c_long = 4000 + 21; +pub const SYS_umount: ::c_long = 4000 + 22; +pub const SYS_setuid: ::c_long = 4000 + 23; +pub const SYS_getuid: ::c_long = 4000 + 24; +pub const SYS_stime: ::c_long = 4000 + 25; +pub const SYS_ptrace: ::c_long = 4000 + 26; +pub const SYS_alarm: ::c_long = 4000 + 27; +pub const SYS_pause: ::c_long = 4000 + 29; +pub const SYS_utime: ::c_long = 4000 + 30; +pub const SYS_stty: ::c_long = 4000 + 31; +pub const SYS_gtty: ::c_long = 4000 + 32; +pub const SYS_access: ::c_long = 4000 + 33; +pub const SYS_nice: ::c_long = 4000 + 34; +pub const SYS_ftime: ::c_long = 4000 + 35; +pub const SYS_sync: ::c_long = 4000 + 36; +pub const SYS_kill: ::c_long = 4000 + 37; +pub const SYS_rename: ::c_long = 4000 + 38; +pub const SYS_mkdir: ::c_long = 4000 + 39; +pub const SYS_rmdir: ::c_long = 4000 + 40; +pub const SYS_dup: ::c_long = 4000 + 41; +pub const SYS_pipe: ::c_long = 4000 + 42; +pub const SYS_times: ::c_long = 4000 + 43; +pub const SYS_prof: ::c_long = 4000 + 44; +pub const SYS_brk: ::c_long = 4000 + 45; +pub const SYS_setgid: ::c_long = 4000 + 46; +pub const SYS_getgid: ::c_long = 4000 + 47; +pub const SYS_signal: ::c_long = 4000 + 48; +pub const SYS_geteuid: ::c_long = 4000 + 49; +pub const SYS_getegid: ::c_long = 4000 + 50; +pub const SYS_acct: ::c_long = 4000 + 51; +pub const SYS_umount2: ::c_long = 4000 + 52; +pub const SYS_lock: ::c_long = 4000 + 53; +pub const SYS_ioctl: ::c_long = 4000 + 54; +pub const SYS_fcntl: ::c_long = 4000 + 55; +pub const SYS_mpx: ::c_long = 4000 + 56; +pub const SYS_setpgid: ::c_long = 4000 + 57; +pub const SYS_ulimit: ::c_long = 4000 + 58; +pub const SYS_umask: ::c_long = 4000 + 60; +pub const SYS_chroot: ::c_long = 4000 + 61; +pub const SYS_ustat: ::c_long = 4000 + 62; +pub const SYS_dup2: ::c_long = 4000 + 63; +pub const SYS_getppid: ::c_long = 4000 + 64; +pub const SYS_getpgrp: ::c_long = 4000 + 65; +pub const SYS_setsid: ::c_long = 4000 + 66; +pub const SYS_sigaction: ::c_long = 4000 + 67; +pub const SYS_sgetmask: ::c_long = 4000 + 68; +pub const SYS_ssetmask: ::c_long = 4000 + 69; +pub const SYS_setreuid: ::c_long = 4000 + 70; +pub const SYS_setregid: ::c_long = 4000 + 71; +pub const SYS_sigsuspend: ::c_long = 4000 + 72; +pub const SYS_sigpending: ::c_long = 4000 + 73; +pub const SYS_sethostname: ::c_long = 4000 + 74; +pub const SYS_setrlimit: ::c_long = 4000 + 75; +pub const SYS_getrlimit: ::c_long = 4000 + 76; +pub const SYS_getrusage: ::c_long = 4000 + 77; +pub const SYS_gettimeofday: ::c_long = 4000 + 78; +pub const SYS_settimeofday: ::c_long = 4000 + 79; +pub const SYS_getgroups: ::c_long = 4000 + 80; +pub const SYS_setgroups: ::c_long = 4000 + 81; +pub const SYS_symlink: ::c_long = 4000 + 83; +pub const SYS_readlink: ::c_long = 4000 + 85; +pub const SYS_uselib: ::c_long = 4000 + 86; +pub const SYS_swapon: ::c_long = 4000 + 87; +pub const SYS_reboot: ::c_long = 4000 + 88; +pub const SYS_readdir: ::c_long = 4000 + 89; +pub const SYS_mmap: ::c_long = 4000 + 90; +pub const SYS_munmap: ::c_long = 4000 + 91; +pub const SYS_truncate: ::c_long = 4000 + 92; +pub const SYS_ftruncate: ::c_long = 4000 + 93; +pub const SYS_fchmod: ::c_long = 4000 + 94; +pub const SYS_fchown: ::c_long = 4000 + 95; +pub const SYS_getpriority: ::c_long = 4000 + 96; +pub const SYS_setpriority: ::c_long = 4000 + 97; +pub const SYS_profil: ::c_long = 4000 + 98; +pub const SYS_statfs: ::c_long = 4000 + 99; +pub const SYS_fstatfs: ::c_long = 4000 + 100; +pub const SYS_ioperm: ::c_long = 4000 + 101; +pub const SYS_socketcall: ::c_long = 4000 + 102; +pub const SYS_syslog: ::c_long = 4000 + 103; +pub const SYS_setitimer: ::c_long = 4000 + 104; +pub const SYS_getitimer: ::c_long = 4000 + 105; +pub const SYS_stat: ::c_long = 4000 + 106; +pub const SYS_lstat: ::c_long = 4000 + 107; +pub const SYS_fstat: ::c_long = 4000 + 108; +pub const SYS_iopl: ::c_long = 4000 + 110; +pub const SYS_vhangup: ::c_long = 4000 + 111; +pub const SYS_idle: ::c_long = 4000 + 112; +pub const SYS_vm86: ::c_long = 4000 + 113; +pub const SYS_wait4: ::c_long = 4000 + 114; +pub const SYS_swapoff: ::c_long = 4000 + 115; +pub const SYS_sysinfo: ::c_long = 4000 + 116; +pub const SYS_ipc: ::c_long = 4000 + 117; +pub const SYS_fsync: ::c_long = 4000 + 118; +pub const SYS_sigreturn: ::c_long = 4000 + 119; +pub const SYS_clone: ::c_long = 4000 + 120; +pub const SYS_setdomainname: ::c_long = 4000 + 121; +pub const SYS_uname: ::c_long = 4000 + 122; +pub const SYS_modify_ldt: ::c_long = 4000 + 123; +pub const SYS_adjtimex: ::c_long = 4000 + 124; +pub const SYS_mprotect: ::c_long = 4000 + 125; +pub const SYS_sigprocmask: ::c_long = 4000 + 126; +pub const SYS_create_module: ::c_long = 4000 + 127; +pub const SYS_init_module: ::c_long = 4000 + 128; +pub const SYS_delete_module: ::c_long = 4000 + 129; +pub const SYS_get_kernel_syms: ::c_long = 4000 + 130; +pub const SYS_quotactl: ::c_long = 4000 + 131; +pub const SYS_getpgid: ::c_long = 4000 + 132; +pub const SYS_fchdir: ::c_long = 4000 + 133; +pub const SYS_bdflush: ::c_long = 4000 + 134; +pub const SYS_sysfs: ::c_long = 4000 + 135; +pub const SYS_personality: ::c_long = 4000 + 136; +pub const SYS_afs_syscall: ::c_long = 4000 + 137; +pub const SYS_setfsuid: ::c_long = 4000 + 138; +pub const SYS_setfsgid: ::c_long = 4000 + 139; +pub const SYS__llseek: ::c_long = 4000 + 140; +pub const SYS_getdents: ::c_long = 4000 + 141; +pub const SYS__newselect: ::c_long = 4000 + 142; +pub const SYS_flock: ::c_long = 4000 + 143; +pub const SYS_msync: ::c_long = 4000 + 144; +pub const SYS_readv: ::c_long = 4000 + 145; +pub const SYS_writev: ::c_long = 4000 + 146; +pub const SYS_cacheflush: ::c_long = 4000 + 147; +pub const SYS_cachectl: ::c_long = 4000 + 148; +pub const SYS_sysmips: ::c_long = 4000 + 149; +pub const SYS_getsid: ::c_long = 4000 + 151; +pub const SYS_fdatasync: ::c_long = 4000 + 152; +pub const SYS__sysctl: ::c_long = 4000 + 153; +pub const SYS_mlock: ::c_long = 4000 + 154; +pub const SYS_munlock: ::c_long = 4000 + 155; +pub const SYS_mlockall: ::c_long = 4000 + 156; +pub const SYS_munlockall: ::c_long = 4000 + 157; +pub const SYS_sched_setparam: ::c_long = 4000 + 158; +pub const SYS_sched_getparam: ::c_long = 4000 + 159; +pub const SYS_sched_setscheduler: ::c_long = 4000 + 160; +pub const SYS_sched_getscheduler: ::c_long = 4000 + 161; +pub const SYS_sched_yield: ::c_long = 4000 + 162; +pub const SYS_sched_get_priority_max: ::c_long = 4000 + 163; +pub const SYS_sched_get_priority_min: ::c_long = 4000 + 164; +pub const SYS_sched_rr_get_interval: ::c_long = 4000 + 165; +pub const SYS_nanosleep: ::c_long = 4000 + 166; +pub const SYS_mremap: ::c_long = 4000 + 167; +pub const SYS_accept: ::c_long = 4000 + 168; +pub const SYS_bind: ::c_long = 4000 + 169; +pub const SYS_connect: ::c_long = 4000 + 170; +pub const SYS_getpeername: ::c_long = 4000 + 171; +pub const SYS_getsockname: ::c_long = 4000 + 172; +pub const SYS_getsockopt: ::c_long = 4000 + 173; +pub const SYS_listen: ::c_long = 4000 + 174; +pub const SYS_recv: ::c_long = 4000 + 175; +pub const SYS_recvfrom: ::c_long = 4000 + 176; +pub const SYS_recvmsg: ::c_long = 4000 + 177; +pub const SYS_send: ::c_long = 4000 + 178; +pub const SYS_sendmsg: ::c_long = 4000 + 179; +pub const SYS_sendto: ::c_long = 4000 + 180; +pub const SYS_setsockopt: ::c_long = 4000 + 181; +pub const SYS_shutdown: ::c_long = 4000 + 182; +pub const SYS_socket: ::c_long = 4000 + 183; +pub const SYS_socketpair: ::c_long = 4000 + 184; +pub const SYS_setresuid: ::c_long = 4000 + 185; +pub const SYS_getresuid: ::c_long = 4000 + 186; +pub const SYS_query_module: ::c_long = 4000 + 187; +pub const SYS_poll: ::c_long = 4000 + 188; +pub const SYS_nfsservctl: ::c_long = 4000 + 189; +pub const SYS_setresgid: ::c_long = 4000 + 190; +pub const SYS_getresgid: ::c_long = 4000 + 191; +pub const SYS_prctl: ::c_long = 4000 + 192; +pub const SYS_rt_sigreturn: ::c_long = 4000 + 193; +pub const SYS_rt_sigaction: ::c_long = 4000 + 194; +pub const SYS_rt_sigprocmask: ::c_long = 4000 + 195; +pub const SYS_rt_sigpending: ::c_long = 4000 + 196; +pub const SYS_rt_sigtimedwait: ::c_long = 4000 + 197; +pub const SYS_rt_sigqueueinfo: ::c_long = 4000 + 198; +pub const SYS_rt_sigsuspend: ::c_long = 4000 + 199; +pub const SYS_pread64: ::c_long = 4000 + 200; +pub const SYS_pwrite64: ::c_long = 4000 + 201; +pub const SYS_chown: ::c_long = 4000 + 202; +pub const SYS_getcwd: ::c_long = 4000 + 203; +pub const SYS_capget: ::c_long = 4000 + 204; +pub const SYS_capset: ::c_long = 4000 + 205; +pub const SYS_sigaltstack: ::c_long = 4000 + 206; +pub const SYS_sendfile: ::c_long = 4000 + 207; +pub const SYS_getpmsg: ::c_long = 4000 + 208; +pub const SYS_putpmsg: ::c_long = 4000 + 209; +pub const SYS_mmap2: ::c_long = 4000 + 210; +pub const SYS_truncate64: ::c_long = 4000 + 211; +pub const SYS_ftruncate64: ::c_long = 4000 + 212; +pub const SYS_stat64: ::c_long = 4000 + 213; +pub const SYS_lstat64: ::c_long = 4000 + 214; +pub const SYS_fstat64: ::c_long = 4000 + 215; +pub const SYS_pivot_root: ::c_long = 4000 + 216; +pub const SYS_mincore: ::c_long = 4000 + 217; +pub const SYS_madvise: ::c_long = 4000 + 218; +pub const SYS_getdents64: ::c_long = 4000 + 219; +pub const SYS_fcntl64: ::c_long = 4000 + 220; +pub const SYS_gettid: ::c_long = 4000 + 222; +pub const SYS_readahead: ::c_long = 4000 + 223; +pub const SYS_setxattr: ::c_long = 4000 + 224; +pub const SYS_lsetxattr: ::c_long = 4000 + 225; +pub const SYS_fsetxattr: ::c_long = 4000 + 226; +pub const SYS_getxattr: ::c_long = 4000 + 227; +pub const SYS_lgetxattr: ::c_long = 4000 + 228; +pub const SYS_fgetxattr: ::c_long = 4000 + 229; +pub const SYS_listxattr: ::c_long = 4000 + 230; +pub const SYS_llistxattr: ::c_long = 4000 + 231; +pub const SYS_flistxattr: ::c_long = 4000 + 232; +pub const SYS_removexattr: ::c_long = 4000 + 233; +pub const SYS_lremovexattr: ::c_long = 4000 + 234; +pub const SYS_fremovexattr: ::c_long = 4000 + 235; +pub const SYS_tkill: ::c_long = 4000 + 236; +pub const SYS_sendfile64: ::c_long = 4000 + 237; +pub const SYS_futex: ::c_long = 4000 + 238; +pub const SYS_sched_setaffinity: ::c_long = 4000 + 239; +pub const SYS_sched_getaffinity: ::c_long = 4000 + 240; +pub const SYS_io_setup: ::c_long = 4000 + 241; +pub const SYS_io_destroy: ::c_long = 4000 + 242; +pub const SYS_io_getevents: ::c_long = 4000 + 243; +pub const SYS_io_submit: ::c_long = 4000 + 244; +pub const SYS_io_cancel: ::c_long = 4000 + 245; +pub const SYS_exit_group: ::c_long = 4000 + 246; +pub const SYS_lookup_dcookie: ::c_long = 4000 + 247; +pub const SYS_epoll_create: ::c_long = 4000 + 248; +pub const SYS_epoll_ctl: ::c_long = 4000 + 249; +pub const SYS_epoll_wait: ::c_long = 4000 + 250; +pub const SYS_remap_file_pages: ::c_long = 4000 + 251; +pub const SYS_set_tid_address: ::c_long = 4000 + 252; +pub const SYS_restart_syscall: ::c_long = 4000 + 253; +pub const SYS_fadvise64: ::c_long = 4000 + 254; +pub const SYS_statfs64: ::c_long = 4000 + 255; +pub const SYS_fstatfs64: ::c_long = 4000 + 256; +pub const SYS_timer_create: ::c_long = 4000 + 257; +pub const SYS_timer_settime: ::c_long = 4000 + 258; +pub const SYS_timer_gettime: ::c_long = 4000 + 259; +pub const SYS_timer_getoverrun: ::c_long = 4000 + 260; +pub const SYS_timer_delete: ::c_long = 4000 + 261; +pub const SYS_clock_settime: ::c_long = 4000 + 262; +pub const SYS_clock_gettime: ::c_long = 4000 + 263; +pub const SYS_clock_getres: ::c_long = 4000 + 264; +pub const SYS_clock_nanosleep: ::c_long = 4000 + 265; +pub const SYS_tgkill: ::c_long = 4000 + 266; +pub const SYS_utimes: ::c_long = 4000 + 267; +pub const SYS_mbind: ::c_long = 4000 + 268; +pub const SYS_get_mempolicy: ::c_long = 4000 + 269; +pub const SYS_set_mempolicy: ::c_long = 4000 + 270; +pub const SYS_mq_open: ::c_long = 4000 + 271; +pub const SYS_mq_unlink: ::c_long = 4000 + 272; +pub const SYS_mq_timedsend: ::c_long = 4000 + 273; +pub const SYS_mq_timedreceive: ::c_long = 4000 + 274; +pub const SYS_mq_notify: ::c_long = 4000 + 275; +pub const SYS_mq_getsetattr: ::c_long = 4000 + 276; +pub const SYS_vserver: ::c_long = 4000 + 277; +pub const SYS_waitid: ::c_long = 4000 + 278; +/* pub const SYS_sys_setaltroot: ::c_long = 4000 + 279; */ +pub const SYS_add_key: ::c_long = 4000 + 280; +pub const SYS_request_key: ::c_long = 4000 + 281; +pub const SYS_keyctl: ::c_long = 4000 + 282; +pub const SYS_set_thread_area: ::c_long = 4000 + 283; +pub const SYS_inotify_init: ::c_long = 4000 + 284; +pub const SYS_inotify_add_watch: ::c_long = 4000 + 285; +pub const SYS_inotify_rm_watch: ::c_long = 4000 + 286; +pub const SYS_migrate_pages: ::c_long = 4000 + 287; +pub const SYS_openat: ::c_long = 4000 + 288; +pub const SYS_mkdirat: ::c_long = 4000 + 289; +pub const SYS_mknodat: ::c_long = 4000 + 290; +pub const SYS_fchownat: ::c_long = 4000 + 291; +pub const SYS_futimesat: ::c_long = 4000 + 292; +pub const SYS_fstatat64: ::c_long = 4000 + 293; +pub const SYS_unlinkat: ::c_long = 4000 + 294; +pub const SYS_renameat: ::c_long = 4000 + 295; +pub const SYS_linkat: ::c_long = 4000 + 296; +pub const SYS_symlinkat: ::c_long = 4000 + 297; +pub const SYS_readlinkat: ::c_long = 4000 + 298; +pub const SYS_fchmodat: ::c_long = 4000 + 299; +pub const SYS_faccessat: ::c_long = 4000 + 300; +pub const SYS_pselect6: ::c_long = 4000 + 301; +pub const SYS_ppoll: ::c_long = 4000 + 302; +pub const SYS_unshare: ::c_long = 4000 + 303; +pub const SYS_splice: ::c_long = 4000 + 304; +pub const SYS_sync_file_range: ::c_long = 4000 + 305; +pub const SYS_tee: ::c_long = 4000 + 306; +pub const SYS_vmsplice: ::c_long = 4000 + 307; +pub const SYS_move_pages: ::c_long = 4000 + 308; +pub const SYS_set_robust_list: ::c_long = 4000 + 309; +pub const SYS_get_robust_list: ::c_long = 4000 + 310; +pub const SYS_kexec_load: ::c_long = 4000 + 311; +pub const SYS_getcpu: ::c_long = 4000 + 312; +pub const SYS_epoll_pwait: ::c_long = 4000 + 313; +pub const SYS_ioprio_set: ::c_long = 4000 + 314; +pub const SYS_ioprio_get: ::c_long = 4000 + 315; +pub const SYS_utimensat: ::c_long = 4000 + 316; +pub const SYS_signalfd: ::c_long = 4000 + 317; +pub const SYS_timerfd: ::c_long = 4000 + 318; +pub const SYS_eventfd: ::c_long = 4000 + 319; +pub const SYS_fallocate: ::c_long = 4000 + 320; +pub const SYS_timerfd_create: ::c_long = 4000 + 321; +pub const SYS_timerfd_gettime: ::c_long = 4000 + 322; +pub const SYS_timerfd_settime: ::c_long = 4000 + 323; +pub const SYS_signalfd4: ::c_long = 4000 + 324; +pub const SYS_eventfd2: ::c_long = 4000 + 325; +pub const SYS_epoll_create1: ::c_long = 4000 + 326; +pub const SYS_dup3: ::c_long = 4000 + 327; +pub const SYS_pipe2: ::c_long = 4000 + 328; +pub const SYS_inotify_init1: ::c_long = 4000 + 329; +pub const SYS_preadv: ::c_long = 4000 + 330; +pub const SYS_pwritev: ::c_long = 4000 + 331; +pub const SYS_rt_tgsigqueueinfo: ::c_long = 4000 + 332; +pub const SYS_perf_event_open: ::c_long = 4000 + 333; +pub const SYS_accept4: ::c_long = 4000 + 334; +pub const SYS_recvmmsg: ::c_long = 4000 + 335; +pub const SYS_fanotify_init: ::c_long = 4000 + 336; +pub const SYS_fanotify_mark: ::c_long = 4000 + 337; +pub const SYS_prlimit64: ::c_long = 4000 + 338; +pub const SYS_name_to_handle_at: ::c_long = 4000 + 339; +pub const SYS_open_by_handle_at: ::c_long = 4000 + 340; +pub const SYS_clock_adjtime: ::c_long = 4000 + 341; +pub const SYS_syncfs: ::c_long = 4000 + 342; +pub const SYS_sendmmsg: ::c_long = 4000 + 343; +pub const SYS_setns: ::c_long = 4000 + 344; +pub const SYS_process_vm_readv: ::c_long = 4000 + 345; +pub const SYS_process_vm_writev: ::c_long = 4000 + 346; +pub const SYS_kcmp: ::c_long = 4000 + 347; +pub const SYS_finit_module: ::c_long = 4000 + 348; +pub const SYS_sched_setattr: ::c_long = 4000 + 349; +pub const SYS_sched_getattr: ::c_long = 4000 + 350; +pub const SYS_renameat2: ::c_long = 4000 + 351; +pub const SYS_seccomp: ::c_long = 4000 + 352; +pub const SYS_getrandom: ::c_long = 4000 + 353; +pub const SYS_memfd_create: ::c_long = 4000 + 354; +pub const SYS_bpf: ::c_long = 4000 + 355; +pub const SYS_execveat: ::c_long = 4000 + 356; +pub const SYS_userfaultfd: ::c_long = 4000 + 357; +pub const SYS_membarrier: ::c_long = 4000 + 358; +pub const SYS_mlock2: ::c_long = 4000 + 359; +pub const SYS_copy_file_range: ::c_long = 4000 + 360; +pub const SYS_preadv2: ::c_long = 4000 + 361; +pub const SYS_pwritev2: ::c_long = 4000 + 362; +pub const SYS_pkey_mprotect: ::c_long = 4000 + 363; +pub const SYS_pkey_alloc: ::c_long = 4000 + 364; +pub const SYS_pkey_free: ::c_long = 4000 + 365; +pub const SYS_clone3: ::c_long = 4000 + 435; + +#[link(name = "util")] +extern "C" { + pub fn sysctl( + name: *mut ::c_int, + namelen: ::c_int, + oldp: *mut ::c_void, + oldlenp: *mut ::size_t, + newp: *mut ::c_void, + newlen: ::size_t, + ) -> ::c_int; + pub fn glob64( + pattern: *const ::c_char, + flags: ::c_int, + errfunc: ::Option ::c_int>, + pglob: *mut glob64_t, + ) -> ::c_int; + pub fn globfree64(pglob: *mut glob64_t); + pub fn pthread_attr_getaffinity_np( + attr: *const ::pthread_attr_t, + cpusetsize: ::size_t, + cpuset: *mut ::cpu_set_t, + ) -> ::c_int; + pub fn pthread_attr_setaffinity_np( + attr: *mut ::pthread_attr_t, + cpusetsize: ::size_t, + cpuset: *const ::cpu_set_t, + ) -> ::c_int; +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } else { + mod no_align; + pub use self::no_align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs new file mode 100644 index 0000000000000000000000000000000000000000..e32bf673d140e27b412196ccc9b9554b594e2ea8 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips32/no_align.rs @@ -0,0 +1,10 @@ +s! { + // FIXME this is actually a union + pub struct sem_t { + #[cfg(target_pointer_width = "32")] + __size: [::c_char; 16], + #[cfg(target_pointer_width = "64")] + __size: [::c_char; 32], + __align: [::c_long; 0], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..21e21907d4a70f03de850a8d11f4c093aab1d622 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/align.rs @@ -0,0 +1,10 @@ +s! { + // FIXME this is actually a union + #[cfg_attr(target_pointer_width = "32", + repr(align(4)))] + #[cfg_attr(target_pointer_width = "64", + repr(align(8)))] + pub struct sem_t { + __size: [::c_char; 32], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..be6d2813d52fa479d4e6d00e6f9145366cf46e04 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs @@ -0,0 +1,205 @@ +pub type blkcnt_t = i64; +pub type blksize_t = i64; +pub type c_char = i8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type fsblkcnt_t = ::c_ulong; +pub type fsfilcnt_t = ::c_ulong; +pub type ino_t = u64; +pub type nlink_t = u64; +pub type off_t = i64; +pub type suseconds_t = i64; +pub type time_t = i64; +pub type wchar_t = i32; + +s! { + pub struct stat { + pub st_dev: ::c_ulong, + st_pad1: [::c_long; 2], + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::c_ulong, + st_pad2: [::c_ulong; 1], + pub st_size: ::off_t, + st_pad3: ::c_long, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + st_pad4: ::c_long, + pub st_blocks: ::blkcnt_t, + st_pad5: [::c_long; 7], + } + + pub struct stat64 { + pub st_dev: ::c_ulong, + st_pad1: [::c_long; 2], + pub st_ino: ::ino64_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::c_ulong, + st_pad2: [::c_long; 2], + pub st_size: ::off64_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + st_pad3: ::c_long, + pub st_blocks: ::blkcnt64_t, + st_pad5: [::c_long; 7], + } + + pub struct pthread_attr_t { + __size: [::c_ulong; 7] + } + + pub struct sigaction { + pub sa_flags: ::c_int, + pub sa_sigaction: ::sighandler_t, + pub sa_mask: sigset_t, + _restorer: *mut ::c_void, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct sigset_t { + __size: [::c_ulong; 16], + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_code: ::c_int, + pub si_errno: ::c_int, + _pad: ::c_int, + _pad2: [::c_long; 14], + } + + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_uint, + pub __seq: ::c_ushort, + __pad1: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused4: ::c_ulong, + __unused5: ::c_ulong + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + pub msg_rtime: ::time_t, + pub msg_ctime: ::time_t, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __glibc_reserved4: ::c_ulong, + __glibc_reserved5: ::c_ulong, + } + + pub struct statfs { + pub f_type: ::c_long, + pub f_bsize: ::c_long, + pub f_frsize: ::c_long, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_files: ::fsblkcnt_t, + pub f_ffree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_fsid: ::fsid_t, + + pub f_namelen: ::c_long, + f_spare: [::c_long; 6], + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::size_t, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::size_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: ::size_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + } + + pub struct sysinfo { + pub uptime: ::c_long, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, + pub freeram: ::c_ulong, + pub sharedram: ::c_ulong, + pub bufferram: ::c_ulong, + pub totalswap: ::c_ulong, + pub freeswap: ::c_ulong, + pub procs: ::c_ushort, + pub pad: ::c_ushort, + pub totalhigh: ::c_ulong, + pub freehigh: ::c_ulong, + pub mem_unit: ::c_uint, + pub _f: [::c_char; 0], + } +} + +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + +pub const SYS_gettid: ::c_long = 5178; // Valid for n64 + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } else { + mod no_align; + pub use self::no_align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs new file mode 100644 index 0000000000000000000000000000000000000000..8909114cdfa42f6063b2423ce0d7a53d0a943c29 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mips64/no_align.rs @@ -0,0 +1,7 @@ +s! { + // FIXME this is actually a union + pub struct sem_t { + __size: [::c_char; 32], + __align: [::c_long; 0], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..61684094fa9f823295c12e15d4c95f76dbd690f9 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mips/mod.rs @@ -0,0 +1,292 @@ +pub type pthread_t = ::c_ulong; + +pub const SFD_CLOEXEC: ::c_int = 0x080000; + +pub const NCCS: usize = 32; + +pub const O_TRUNC: ::c_int = 512; + +pub const O_CLOEXEC: ::c_int = 0x80000; + +pub const EBFONT: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const EDOTDOT: ::c_int = 73; + +pub const SA_NODEFER: ::c_int = 0x40000000; +pub const SA_RESETHAND: ::c_int = 0x80000000; +pub const SA_RESTART: ::c_int = 0x10000000; +pub const SA_NOCLDSTOP: ::c_int = 0x00000001; + +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; + +pub const EFD_CLOEXEC: ::c_int = 0x80000; + +pub const TMP_MAX: ::c_uint = 238328; +pub const _SC_2_C_VERSION: ::c_int = 96; +pub const O_ACCMODE: ::c_int = 3; +pub const O_DIRECT: ::c_int = 0x8000; +pub const O_DIRECTORY: ::c_int = 0x10000; +pub const O_NOFOLLOW: ::c_int = 0x20000; + +pub const O_APPEND: ::c_int = 8; +pub const O_CREAT: ::c_int = 256; +pub const O_EXCL: ::c_int = 1024; +pub const O_NOCTTY: ::c_int = 2048; +pub const O_NONBLOCK: ::c_int = 128; +pub const O_SYNC: ::c_int = 0x10; +pub const O_RSYNC: ::c_int = 0x10; +pub const O_DSYNC: ::c_int = 0x10; +pub const O_FSYNC: ::c_int = 0x10; +pub const O_ASYNC: ::c_int = 0x1000; +pub const O_NDELAY: ::c_int = 0x80; + +pub const SOCK_NONBLOCK: ::c_int = 128; + +pub const EDEADLK: ::c_int = 45; +pub const ENAMETOOLONG: ::c_int = 78; +pub const ENOLCK: ::c_int = 46; +pub const ENOSYS: ::c_int = 89; +pub const ENOTEMPTY: ::c_int = 93; +pub const ELOOP: ::c_int = 90; +pub const ENOMSG: ::c_int = 35; +pub const EIDRM: ::c_int = 36; +pub const ECHRNG: ::c_int = 37; +pub const EL2NSYNC: ::c_int = 38; +pub const EL3HLT: ::c_int = 39; +pub const EL3RST: ::c_int = 40; +pub const ELNRNG: ::c_int = 41; +pub const EUNATCH: ::c_int = 42; +pub const ENOCSI: ::c_int = 43; +pub const EL2HLT: ::c_int = 44; +pub const EBADE: ::c_int = 50; +pub const EBADR: ::c_int = 51; +pub const EXFULL: ::c_int = 52; +pub const ENOANO: ::c_int = 53; +pub const EBADRQC: ::c_int = 54; +pub const EBADSLT: ::c_int = 55; +pub const EMULTIHOP: ::c_int = 74; +pub const EOVERFLOW: ::c_int = 79; +pub const ENOTUNIQ: ::c_int = 80; +pub const EBADFD: ::c_int = 81; +pub const EBADMSG: ::c_int = 77; +pub const EREMCHG: ::c_int = 82; +pub const ELIBACC: ::c_int = 83; +pub const ELIBBAD: ::c_int = 84; +pub const ELIBSCN: ::c_int = 85; +pub const ELIBMAX: ::c_int = 86; +pub const ELIBEXEC: ::c_int = 87; +pub const EILSEQ: ::c_int = 88; +pub const ERESTART: ::c_int = 91; +pub const ESTRPIPE: ::c_int = 92; +pub const EUSERS: ::c_int = 94; +pub const ENOTSOCK: ::c_int = 95; +pub const EDESTADDRREQ: ::c_int = 96; +pub const EMSGSIZE: ::c_int = 97; +pub const EPROTOTYPE: ::c_int = 98; +pub const ENOPROTOOPT: ::c_int = 99; +pub const EPROTONOSUPPORT: ::c_int = 120; +pub const ESOCKTNOSUPPORT: ::c_int = 121; +pub const EOPNOTSUPP: ::c_int = 122; +pub const EPFNOSUPPORT: ::c_int = 123; +pub const EAFNOSUPPORT: ::c_int = 124; +pub const EADDRINUSE: ::c_int = 125; +pub const EADDRNOTAVAIL: ::c_int = 126; +pub const ENETDOWN: ::c_int = 127; +pub const ENETUNREACH: ::c_int = 128; +pub const ENETRESET: ::c_int = 129; +pub const ECONNABORTED: ::c_int = 130; +pub const ECONNRESET: ::c_int = 131; +pub const ENOBUFS: ::c_int = 132; +pub const EISCONN: ::c_int = 133; +pub const ENOTCONN: ::c_int = 134; +pub const ESHUTDOWN: ::c_int = 143; +pub const ETOOMANYREFS: ::c_int = 144; +pub const ETIMEDOUT: ::c_int = 145; +pub const ECONNREFUSED: ::c_int = 146; +pub const EHOSTDOWN: ::c_int = 147; +pub const EHOSTUNREACH: ::c_int = 148; +pub const EALREADY: ::c_int = 149; +pub const EINPROGRESS: ::c_int = 150; +pub const ESTALE: ::c_int = 151; +pub const EUCLEAN: ::c_int = 135; +pub const ENOTNAM: ::c_int = 137; +pub const ENAVAIL: ::c_int = 138; +pub const EISNAM: ::c_int = 139; +pub const EREMOTEIO: ::c_int = 140; +pub const EDQUOT: ::c_int = 1133; +pub const ENOMEDIUM: ::c_int = 159; +pub const EMEDIUMTYPE: ::c_int = 160; +pub const ECANCELED: ::c_int = 158; +pub const ENOKEY: ::c_int = 161; +pub const EKEYEXPIRED: ::c_int = 162; +pub const EKEYREVOKED: ::c_int = 163; +pub const EKEYREJECTED: ::c_int = 164; +pub const EOWNERDEAD: ::c_int = 165; +pub const ENOTRECOVERABLE: ::c_int = 166; +pub const ERFKILL: ::c_int = 167; + +pub const MAP_NORESERVE: ::c_int = 0x400; +pub const MAP_ANON: ::c_int = 0x800; +pub const MAP_ANONYMOUS: ::c_int = 0x800; +pub const MAP_GROWSDOWN: ::c_int = 0x1000; +pub const MAP_DENYWRITE: ::c_int = 0x2000; +pub const MAP_EXECUTABLE: ::c_int = 0x4000; +pub const MAP_LOCKED: ::c_int = 0x8000; +pub const MAP_POPULATE: ::c_int = 0x10000; +pub const MAP_NONBLOCK: ::c_int = 0x20000; +pub const MAP_STACK: ::c_int = 0x40000; + +pub const SOCK_STREAM: ::c_int = 2; +pub const SOCK_DGRAM: ::c_int = 1; +pub const SOCK_SEQPACKET: ::c_int = 5; + +pub const SA_ONSTACK: ::c_uint = 0x08000000; +pub const SA_SIGINFO: ::c_uint = 0x00000008; +pub const SA_NOCLDWAIT: ::c_int = 0x00010000; + +pub const SIGCHLD: ::c_int = 18; +pub const SIGBUS: ::c_int = 10; +pub const SIGTTIN: ::c_int = 26; +pub const SIGTTOU: ::c_int = 27; +pub const SIGXCPU: ::c_int = 30; +pub const SIGXFSZ: ::c_int = 31; +pub const SIGVTALRM: ::c_int = 28; +pub const SIGPROF: ::c_int = 29; +pub const SIGWINCH: ::c_int = 20; +pub const SIGUSR1: ::c_int = 16; +pub const SIGUSR2: ::c_int = 17; +pub const SIGCONT: ::c_int = 25; +pub const SIGSTOP: ::c_int = 23; +pub const SIGTSTP: ::c_int = 24; +pub const SIGURG: ::c_int = 21; +pub const SIGIO: ::c_int = 22; +pub const SIGSYS: ::c_int = 12; +pub const SIGPWR: ::c_int = 19; +pub const SIG_SETMASK: ::c_int = 3; +pub const SIG_BLOCK: ::c_int = 0x1; +pub const SIG_UNBLOCK: ::c_int = 0x2; + +pub const POLLWRNORM: ::c_short = 0x004; +pub const POLLWRBAND: ::c_short = 0x100; + +pub const PTHREAD_STACK_MIN: ::size_t = 16384; + +pub const VEOF: usize = 16; +pub const VEOL: usize = 17; +pub const VEOL2: usize = 6; +pub const VMIN: usize = 4; +pub const IEXTEN: ::tcflag_t = 0x00000100; +pub const TOSTOP: ::tcflag_t = 0x00008000; +pub const FLUSHO: ::tcflag_t = 0x00002000; +pub const TCSANOW: ::c_int = 0x540e; +pub const TCSADRAIN: ::c_int = 0x540f; +pub const TCSAFLUSH: ::c_int = 0x5410; + +pub const CPU_SETSIZE: ::c_int = 0x400; + +pub const EFD_NONBLOCK: ::c_int = 0x80; + +pub const F_GETLK: ::c_int = 14; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; + +pub const SFD_NONBLOCK: ::c_int = 0x80; + +pub const RTLD_GLOBAL: ::c_int = 0x4; + +pub const SIGSTKSZ: ::size_t = 8192; +pub const CBAUD: ::tcflag_t = 0o0010017; +pub const TAB1: ::tcflag_t = 0x00000800; +pub const TAB2: ::tcflag_t = 0x00001000; +pub const TAB3: ::tcflag_t = 0x00001800; +pub const CR1: ::tcflag_t = 0x00000200; +pub const CR2: ::tcflag_t = 0x00000400; +pub const CR3: ::tcflag_t = 0x00000600; +pub const FF1: ::tcflag_t = 0x00008000; +pub const BS1: ::tcflag_t = 0x00002000; +pub const VT1: ::tcflag_t = 0x00004000; +pub const VWERASE: usize = 14; +pub const VREPRINT: usize = 12; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VDISCARD: usize = 13; +pub const VTIME: usize = 5; +pub const IXON: ::tcflag_t = 0x00000400; +pub const IXOFF: ::tcflag_t = 0x00001000; +pub const ONLCR: ::tcflag_t = 0x4; +pub const CSIZE: ::tcflag_t = 0x00000030; +pub const CS6: ::tcflag_t = 0x00000010; +pub const CS7: ::tcflag_t = 0x00000020; +pub const CS8: ::tcflag_t = 0x00000030; +pub const CSTOPB: ::tcflag_t = 0x00000040; +pub const CREAD: ::tcflag_t = 0x00000080; +pub const PARENB: ::tcflag_t = 0x00000100; +pub const PARODD: ::tcflag_t = 0x00000200; +pub const HUPCL: ::tcflag_t = 0x00000400; +pub const CLOCAL: ::tcflag_t = 0x00000800; +pub const ECHOKE: ::tcflag_t = 0x00000800; +pub const ECHOE: ::tcflag_t = 0x00000010; +pub const ECHOK: ::tcflag_t = 0x00000020; +pub const ECHONL: ::tcflag_t = 0x00000040; +pub const ECHOPRT: ::tcflag_t = 0x00000400; +pub const ECHOCTL: ::tcflag_t = 0x00000200; +pub const ISIG: ::tcflag_t = 0x00000001; +pub const ICANON: ::tcflag_t = 0x00000002; +pub const PENDIN: ::tcflag_t = 0x00004000; +pub const NOFLSH: ::tcflag_t = 0x00000080; + +pub const B0: ::speed_t = 0o000000; +pub const B50: ::speed_t = 0o000001; +pub const B75: ::speed_t = 0o000002; +pub const B110: ::speed_t = 0o000003; +pub const B134: ::speed_t = 0o000004; +pub const B150: ::speed_t = 0o000005; +pub const B200: ::speed_t = 0o000006; +pub const B300: ::speed_t = 0o000007; +pub const B600: ::speed_t = 0o000010; +pub const B1200: ::speed_t = 0o000011; +pub const B1800: ::speed_t = 0o000012; +pub const B2400: ::speed_t = 0o000013; +pub const B4800: ::speed_t = 0o000014; +pub const B9600: ::speed_t = 0o000015; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; +pub const B57600: ::speed_t = 0o010001; +pub const B115200: ::speed_t = 0o010002; +pub const B230400: ::speed_t = 0o010003; +pub const B460800: ::speed_t = 0o010004; +pub const B500000: ::speed_t = 0o010005; +pub const B576000: ::speed_t = 0o010006; +pub const B921600: ::speed_t = 0o010007; +pub const B1000000: ::speed_t = 0o010010; +pub const B1152000: ::speed_t = 0o010011; +pub const B1500000: ::speed_t = 0o010012; +pub const B2000000: ::speed_t = 0o010013; +pub const B2500000: ::speed_t = 0o010014; +pub const B3000000: ::speed_t = 0o010015; +pub const B3500000: ::speed_t = 0o010016; +pub const B4000000: ::speed_t = 0o010017; + +cfg_if! { + if #[cfg(target_arch = "mips")] { + mod mips32; + pub use self::mips32::*; + } else if #[cfg(target_arch = "mips64")] { + mod mips64; + pub use self::mips64::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..4a01e0cd81c857f31e516a3683da20eca3c6193b --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/mod.rs @@ -0,0 +1,392 @@ +pub type shmatt_t = ::c_ulong; +pub type msgqnum_t = ::c_ulong; +pub type msglen_t = ::c_ulong; +pub type regoff_t = ::c_int; +pub type rlim_t = ::c_ulong; +pub type __rlimit_resource_t = ::c_ulong; +pub type __priority_which_t = ::c_uint; + +cfg_if! { + if #[cfg(doc)] { + // Used in `linux::arch` to define ioctl constants. + pub(crate) type Ioctl = ::c_ulong; + } else { + #[doc(hidden)] + pub type Ioctl = ::c_ulong; + } +} + +s! { + pub struct statvfs { // Different than GNU! + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + #[cfg(target_endian = "little")] + pub f_fsid: ::c_ulong, + #[cfg(target_pointer_width = "32")] + __f_unused: ::c_int, + #[cfg(target_endian = "big")] + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct regex_t { + __buffer: *mut ::c_void, + __allocated: ::size_t, + __used: ::size_t, + __syntax: ::c_ulong, + __fastmap: *mut ::c_char, + __translate: *mut ::c_char, + __re_nsub: ::size_t, + __bitfield: u8, + } + + pub struct rtentry { + pub rt_pad1: ::c_ulong, + pub rt_dst: ::sockaddr, + pub rt_gateway: ::sockaddr, + pub rt_genmask: ::sockaddr, + pub rt_flags: ::c_ushort, + pub rt_pad2: ::c_short, + pub rt_pad3: ::c_ulong, + pub rt_tos: ::c_uchar, + pub rt_class: ::c_uchar, + #[cfg(target_pointer_width = "64")] + pub rt_pad4: [::c_short; 3usize], + #[cfg(not(target_pointer_width = "64"))] + pub rt_pad4: ::c_short, + pub rt_metric: ::c_short, + pub rt_dev: *mut ::c_char, + pub rt_mtu: ::c_ulong, + pub rt_window: ::c_ulong, + pub rt_irtt: ::c_ushort, + } + + pub struct __exit_status { + pub e_termination: ::c_short, + pub e_exit: ::c_short, + } + + pub struct ptrace_peeksiginfo_args { + pub off: ::__u64, + pub flags: ::__u32, + pub nr: ::__s32, + } +} + +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_void { + #[repr(C)] + struct siginfo_sigfault { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + si_addr: *mut ::c_void, + } + (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr + } + + pub unsafe fn si_value(&self) -> ::sigval { + #[repr(C)] + struct siginfo_si_value { + _si_signo: ::c_int, + _si_errno: ::c_int, + _si_code: ::c_int, + _si_timerid: ::c_int, + _si_overrun: ::c_int, + si_value: ::sigval, + } + (*(self as *const siginfo_t as *const siginfo_si_value)).si_value + } +} + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const SIGEV_THREAD_ID: ::c_int = 4; + +pub const AF_VSOCK: ::c_int = 40; + +// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the +// following are only available on newer Linux versions than the versions +// currently used in CI in some configurations, so we define them here. +pub const BINDERFS_SUPER_MAGIC: ::c_long = 0x6c6f6f70; +pub const XFS_SUPER_MAGIC: ::c_long = 0x58465342; + +pub const PTRACE_TRACEME: ::c_int = 0; +pub const PTRACE_PEEKTEXT: ::c_int = 1; +pub const PTRACE_PEEKDATA: ::c_int = 2; +pub const PTRACE_PEEKUSER: ::c_int = 3; +pub const PTRACE_POKETEXT: ::c_int = 4; +pub const PTRACE_POKEDATA: ::c_int = 5; +pub const PTRACE_POKEUSER: ::c_int = 6; +pub const PTRACE_CONT: ::c_int = 7; +pub const PTRACE_KILL: ::c_int = 8; +pub const PTRACE_SINGLESTEP: ::c_int = 9; +pub const PTRACE_GETREGS: ::c_int = 12; +pub const PTRACE_SETREGS: ::c_int = 13; +pub const PTRACE_GETFPREGS: ::c_int = 14; +pub const PTRACE_SETFPREGS: ::c_int = 15; +pub const PTRACE_ATTACH: ::c_int = 16; +pub const PTRACE_DETACH: ::c_int = 17; +pub const PTRACE_GETFPXREGS: ::c_int = 18; +pub const PTRACE_SETFPXREGS: ::c_int = 19; +pub const PTRACE_SYSCALL: ::c_int = 24; +pub const PTRACE_SETOPTIONS: ::c_int = 0x4200; +pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201; +pub const PTRACE_GETSIGINFO: ::c_int = 0x4202; +pub const PTRACE_SETSIGINFO: ::c_int = 0x4203; +pub const PTRACE_GETREGSET: ::c_int = 0x4204; +pub const PTRACE_SETREGSET: ::c_int = 0x4205; +pub const PTRACE_SEIZE: ::c_int = 0x4206; +pub const PTRACE_INTERRUPT: ::c_int = 0x4207; +pub const PTRACE_LISTEN: ::c_int = 0x4208; + +pub const POSIX_FADV_DONTNEED: ::c_int = 4; +pub const POSIX_FADV_NOREUSE: ::c_int = 5; + +// These are different than GNU! +pub const LC_CTYPE: ::c_int = 0; +pub const LC_NUMERIC: ::c_int = 1; +pub const LC_TIME: ::c_int = 3; +pub const LC_COLLATE: ::c_int = 4; +pub const LC_MONETARY: ::c_int = 2; +pub const LC_MESSAGES: ::c_int = 5; +pub const LC_ALL: ::c_int = 6; +// end different section + +// MS_ flags for mount(2) +pub const MS_RMT_MASK: ::c_ulong = ::MS_RDONLY | ::MS_SYNCHRONOUS | ::MS_MANDLOCK | ::MS_I_VERSION; + +pub const ENOTSUP: ::c_int = EOPNOTSUPP; + +pub const IPV6_JOIN_GROUP: ::c_int = 20; +pub const IPV6_LEAVE_GROUP: ::c_int = 21; + +// These are different from GNU +pub const ABDAY_1: ::nl_item = 0x300; +pub const ABDAY_2: ::nl_item = 0x301; +pub const ABDAY_3: ::nl_item = 0x302; +pub const ABDAY_4: ::nl_item = 0x303; +pub const ABDAY_5: ::nl_item = 0x304; +pub const ABDAY_6: ::nl_item = 0x305; +pub const ABDAY_7: ::nl_item = 0x306; +pub const DAY_1: ::nl_item = 0x307; +pub const DAY_2: ::nl_item = 0x308; +pub const DAY_3: ::nl_item = 0x309; +pub const DAY_4: ::nl_item = 0x30A; +pub const DAY_5: ::nl_item = 0x30B; +pub const DAY_6: ::nl_item = 0x30C; +pub const DAY_7: ::nl_item = 0x30D; +pub const ABMON_1: ::nl_item = 0x30E; +pub const ABMON_2: ::nl_item = 0x30F; +pub const ABMON_3: ::nl_item = 0x310; +pub const ABMON_4: ::nl_item = 0x311; +pub const ABMON_5: ::nl_item = 0x312; +pub const ABMON_6: ::nl_item = 0x313; +pub const ABMON_7: ::nl_item = 0x314; +pub const ABMON_8: ::nl_item = 0x315; +pub const ABMON_9: ::nl_item = 0x316; +pub const ABMON_10: ::nl_item = 0x317; +pub const ABMON_11: ::nl_item = 0x318; +pub const ABMON_12: ::nl_item = 0x319; +pub const MON_1: ::nl_item = 0x31A; +pub const MON_2: ::nl_item = 0x31B; +pub const MON_3: ::nl_item = 0x31C; +pub const MON_4: ::nl_item = 0x31D; +pub const MON_5: ::nl_item = 0x31E; +pub const MON_6: ::nl_item = 0x31F; +pub const MON_7: ::nl_item = 0x320; +pub const MON_8: ::nl_item = 0x321; +pub const MON_9: ::nl_item = 0x322; +pub const MON_10: ::nl_item = 0x323; +pub const MON_11: ::nl_item = 0x324; +pub const MON_12: ::nl_item = 0x325; +pub const AM_STR: ::nl_item = 0x326; +pub const PM_STR: ::nl_item = 0x327; +pub const D_T_FMT: ::nl_item = 0x328; +pub const D_FMT: ::nl_item = 0x329; +pub const T_FMT: ::nl_item = 0x32A; +pub const T_FMT_AMPM: ::nl_item = 0x32B; +pub const ERA: ::nl_item = 0x32C; +pub const ERA_D_FMT: ::nl_item = 0x32E; +pub const ALT_DIGITS: ::nl_item = 0x32F; +pub const ERA_D_T_FMT: ::nl_item = 0x330; +pub const ERA_T_FMT: ::nl_item = 0x331; +pub const CODESET: ::nl_item = 10; +pub const CRNCYSTR: ::nl_item = 0x215; +pub const RADIXCHAR: ::nl_item = 0x100; +pub const THOUSEP: ::nl_item = 0x101; +pub const NOEXPR: ::nl_item = 0x501; +pub const YESSTR: ::nl_item = 0x502; +pub const NOSTR: ::nl_item = 0x503; + +// Different than Gnu. +pub const FILENAME_MAX: ::c_uint = 4095; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +pub const SOMAXCONN: ::c_int = 128; + +pub const ST_RELATIME: ::c_ulong = 4096; + +pub const AF_NFC: ::c_int = PF_NFC; +pub const BUFSIZ: ::c_int = 4096; +pub const EDEADLOCK: ::c_int = EDEADLK; +pub const EXTA: ::c_uint = B19200; +pub const EXTB: ::c_uint = B38400; +pub const EXTPROC: ::tcflag_t = 0200000; +pub const FAN_MARK_FILESYSTEM: ::c_int = 0x00000100; +pub const FAN_MARK_INODE: ::c_int = 0x00000000; +pub const FAN_MARK_MOUNT: ::c_int = 0x10; +pub const FOPEN_MAX: ::c_int = 16; +pub const F_GETOWN: ::c_int = 9; +pub const F_OFD_GETLK: ::c_int = 36; +pub const F_OFD_SETLK: ::c_int = 37; +pub const F_OFD_SETLKW: ::c_int = 38; +pub const F_RDLCK: ::c_int = 0; +pub const F_SETOWN: ::c_int = 8; +pub const F_UNLCK: ::c_int = 2; +pub const F_WRLCK: ::c_int = 1; +pub const IPV6_MULTICAST_ALL: ::c_int = 29; +pub const IPV6_ROUTER_ALERT_ISOLATE: ::c_int = 30; +pub const MAP_HUGE_SHIFT: ::c_int = 26; +pub const MAP_HUGE_MASK: ::c_int = 0x3f; +pub const MAP_HUGE_64KB: ::c_int = 16 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_512KB: ::c_int = 19 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_1MB: ::c_int = 20 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_2MB: ::c_int = 21 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_8MB: ::c_int = 23 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_16MB: ::c_int = 24 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_32MB: ::c_int = 25 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_256MB: ::c_int = 28 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_512MB: ::c_int = 29 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_1GB: ::c_int = 30 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_2GB: ::c_int = 31 << MAP_HUGE_SHIFT; +pub const MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT; +pub const MINSIGSTKSZ: ::c_int = 2048; +pub const MSG_COPY: ::c_int = 040000; +pub const NI_MAXHOST: ::socklen_t = 1025; +pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY; +pub const PACKET_MR_UNICAST: ::c_int = 3; +pub const PF_NFC: ::c_int = 39; +pub const PF_VSOCK: ::c_int = 40; +pub const POSIX_MADV_DONTNEED: ::c_int = 4; +pub const PTRACE_EVENT_STOP: ::c_int = 128; +pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209; +pub const RTLD_NOLOAD: ::c_int = 0x00004; +pub const RUSAGE_THREAD: ::c_int = 1; +pub const SHM_EXEC: ::c_int = 0100000; +pub const SIGPOLL: ::c_int = SIGIO; +pub const SOCK_DCCP: ::c_int = 6; +pub const SOCK_PACKET: ::c_int = 10; +pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15; +pub const UDP_GRO: ::c_int = 104; +pub const UDP_SEGMENT: ::c_int = 103; +pub const YESEXPR: ::c_int = ((5) << 8) | (0); + +extern "C" { + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; + + pub fn pthread_rwlockattr_getkind_np( + attr: *const ::pthread_rwlockattr_t, + val: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_rwlockattr_setkind_np( + attr: *mut ::pthread_rwlockattr_t, + val: ::c_int, + ) -> ::c_int; + + pub fn ptrace(request: ::c_uint, ...) -> ::c_long; + + pub fn sendmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_int, + ) -> ::c_int; + pub fn recvmmsg( + sockfd: ::c_int, + msgvec: *mut ::mmsghdr, + vlen: ::c_uint, + flags: ::c_int, + timeout: *mut ::timespec, + ) -> ::c_int; + + pub fn openpty( + amaster: *mut ::c_int, + aslave: *mut ::c_int, + name: *mut ::c_char, + termp: *mut termios, + winp: *mut ::winsize, + ) -> ::c_int; + pub fn forkpty( + amaster: *mut ::c_int, + name: *mut ::c_char, + termp: *mut termios, + winp: *mut ::winsize, + ) -> ::pid_t; + + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::socklen_t, + serv: *mut ::c_char, + sevlen: ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + + pub fn pwritev( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off64_t, + ) -> ::ssize_t; + pub fn preadv( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off64_t, + ) -> ::ssize_t; + + pub fn sethostid(hostid: ::c_long) -> ::c_int; + pub fn fanotify_mark( + fd: ::c_int, + flags: ::c_uint, + mask: u64, + dirfd: ::c_int, + path: *const ::c_char, + ) -> ::c_int; + pub fn getrlimit64(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit64) -> ::c_int; + pub fn setrlimit64(resource: ::__rlimit_resource_t, rlim: *const ::rlimit64) -> ::c_int; + pub fn getrlimit(resource: ::__rlimit_resource_t, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int; + pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int; + pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int; +} + +cfg_if! { + if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] { + mod mips; + pub use self::mips::*; + } else if #[cfg(target_arch = "x86_64")] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(target_arch = "arm")] { + mod arm; + pub use self::arm::*; + } else { + pub use unsupported_target; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs new file mode 100644 index 0000000000000000000000000000000000000000..a73dbded57ac710d2a78d6ee2cbd141147ae6352 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/no_align.rs @@ -0,0 +1,53 @@ +macro_rules! expand_align { + () => { + s! { + pub struct pthread_mutex_t { + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc"))] + __align: [::c_long; 0], + #[cfg(any(libc_align, + target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc"))] + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + + pub struct pthread_rwlock_t { + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc"))] + __align: [::c_long; 0], + #[cfg(not(any( + target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")))] + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + + pub struct pthread_mutexattr_t { + #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64", + target_arch = "mips64", target_arch = "s390x", + target_arch = "sparc64"))] + __align: [::c_int; 0], + #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64", + target_arch = "mips64", target_arch = "s390x", + target_arch = "sparc64")))] + __align: [::c_long; 0], + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + pub struct pthread_cond_t { + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + + pub struct pthread_condattr_t { + __align: [::c_int; 0], + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + } + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs new file mode 100644 index 0000000000000000000000000000000000000000..c7cbafa16ecf319abe82d81ec1cb75764e38c1af --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs @@ -0,0 +1,53 @@ +/// L4Re specifics +/// This module contains definitions required by various L4Re libc backends. +/// Some of them are formally not part of the libc, but are a dependency of the +/// libc and hence we should provide them here. + +pub type l4_umword_t = ::c_ulong; // Unsigned machine word. +pub type pthread_t = *mut ::c_void; + +s! { + /// CPU sets. + pub struct l4_sched_cpu_set_t { + // from the L4Re docs + /// Combination of granularity and offset. + /// + /// The granularity defines how many CPUs each bit in map describes. + /// The offset is the numer of the first CPU described by the first + /// bit in the bitmap. + /// offset must be a multiple of 2^graularity. + /// + /// | MSB | LSB | + /// | ---------------- | ------------------- | + /// | 8bit granularity | 24bit offset .. | + gran_offset: l4_umword_t , + /// Bitmap of CPUs. + map: l4_umword_t , + } +} + +#[cfg(target_os = "l4re")] +#[allow(missing_debug_implementations)] +pub struct pthread_attr_t { + pub __detachstate: ::c_int, + pub __schedpolicy: ::c_int, + pub __schedparam: super::__sched_param, + pub __inheritsched: ::c_int, + pub __scope: ::c_int, + pub __guardsize: ::size_t, + pub __stackaddr_set: ::c_int, + pub __stackaddr: *mut ::c_void, // better don't use it + pub __stacksize: ::size_t, + // L4Re specifics + pub affinity: l4_sched_cpu_set_t, + pub create_flags: ::c_uint, +} + +// L4Re requires a min stack size of 64k; that isn't defined in uClibc, but +// somewhere in the core libraries. uClibc wants 16k, but that's not enough. +pub const PTHREAD_STACK_MIN: usize = 65536; + +// Misc other constants required for building. +pub const SIGIO: ::c_int = 29; +pub const B19200: ::speed_t = 0o000016; +pub const B38400: ::speed_t = 0o000017; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..529711fcec127f56d6841eadbbfe934076572a80 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/mod.rs @@ -0,0 +1,341 @@ +//! Definitions for uclibc on 64bit systems +pub type blkcnt_t = i64; +pub type blksize_t = i64; +pub type clock_t = i64; +pub type c_char = u8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type fsblkcnt_t = ::c_ulong; +pub type fsfilcnt_t = ::c_ulong; +pub type fsword_t = ::c_long; +pub type ino_t = ::c_ulong; +pub type nlink_t = ::c_uint; +pub type off_t = ::c_long; +// [uClibc docs] Note stat64 has the same shape as stat for x86-64. +pub type stat64 = stat; +pub type suseconds_t = ::c_long; +pub type time_t = ::c_int; +pub type wchar_t = ::c_int; + +pub type fsblkcnt64_t = u64; +pub type fsfilcnt64_t = u64; +pub type __u64 = ::c_ulong; + +s! { + pub struct ipc_perm { + pub __key: ::key_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::c_ushort, // read / write + __pad1: ::c_ushort, + pub __seq: ::c_ushort, + __pad2: ::c_ushort, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + #[cfg(not(target_os = "l4re"))] + pub struct pthread_attr_t { + __detachstate: ::c_int, + __schedpolicy: ::c_int, + __schedparam: __sched_param, + __inheritsched: ::c_int, + __scope: ::c_int, + __guardsize: ::size_t, + __stackaddr_set: ::c_int, + __stackaddr: *mut ::c_void, // better don't use it + __stacksize: ::size_t, + } + + pub struct __sched_param { + __sched_priority: ::c_int, + } + + pub struct siginfo_t { + si_signo: ::c_int, // signal number + si_errno: ::c_int, // if not zero: error value of signal, see errno.h + si_code: ::c_int, // signal code + pub _pad: [::c_int; 28], // unported union + _align: [usize; 0], + } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, // segment size in bytes + pub shm_atime: ::time_t, // time of last shmat() + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_cpid: ::pid_t, + pub shm_lpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + __unused1: ::c_ulong, + __unused2: ::c_ulong + } + + pub struct msqid_ds { + pub msg_perm: ::ipc_perm, + pub msg_stime: ::time_t, + pub msg_rtime: ::time_t, + pub msg_ctime: ::time_t, + __msg_cbytes: ::c_ulong, + pub msg_qnum: ::msgqnum_t, + pub msg_qbytes: ::msglen_t, + pub msg_lspid: ::pid_t, + pub msg_lrpid: ::pid_t, + __ignored1: ::c_ulong, + __ignored2: ::c_ulong, + } + + pub struct sockaddr { + pub sa_family: ::sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in { + pub sin_family: ::sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [u8; 8], + } + + pub struct sockaddr_in6 { + pub sin6_family: ::sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + // ------------------------------------------------------------ + // definitions below are *unverified* and might **break** the software +// pub struct in_addr { +// pub s_addr: in_addr_t, +// } +// +// pub struct in6_addr { +// pub s6_addr: [u8; 16], +// #[cfg(not(libc_align))] +// __align: [u32; 0], +// } + + pub struct stat { + pub st_dev: ::c_ulong, + pub st_ino: ::ino_t, + // According to uclibc/libc/sysdeps/linux/x86_64/bits/stat.h, order of + // nlink and mode are swapped on 64 bit systems. + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::c_ulong, // dev_t + pub st_size: off_t, // file size + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_ulong, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_ulong, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_ulong, + st_pad4: [::c_long; 3] + } + + pub struct sigaction { + pub sa_handler: ::sighandler_t, + pub sa_flags: ::c_ulong, + pub sa_restorer: ::Option, + pub sa_mask: ::sigset_t, + } + + pub struct stack_t { // FIXME + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: ::size_t + } + + pub struct statfs { // FIXME + pub f_type: fsword_t, + pub f_bsize: fsword_t, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_fsid: ::fsid_t, + pub f_namelen: fsword_t, + pub f_frsize: fsword_t, + f_spare: [fsword_t; 5], + } + + pub struct statfs64 { + pub f_type: ::c_int, + pub f_bsize: ::c_int, + pub f_blocks: ::fsblkcnt64_t, + pub f_bfree: ::fsblkcnt64_t, + pub f_bavail: ::fsblkcnt64_t, + pub f_files: ::fsfilcnt64_t, + pub f_ffree: ::fsfilcnt64_t, + pub f_fsid: ::fsid_t, + pub f_namelen: ::c_int, + pub f_frsize: ::c_int, + pub f_flags: ::c_int, + pub f_spare: [::c_int; 4], + } + + pub struct statvfs64 { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, + pub f_files: u64, + pub f_ffree: u64, + pub f_favail: u64, + pub f_fsid: ::c_ulong, + __f_unused: ::c_int, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + __f_spare: [::c_int; 6], + } + + pub struct msghdr { // FIXME + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::size_t, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::size_t, + pub msg_flags: ::c_int, + } + + pub struct termios { // FIXME + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + } + + pub struct sigset_t { // FIXME + __val: [::c_ulong; 16], + } + + pub struct sysinfo { // FIXME + pub uptime: ::c_long, + pub loads: [::c_ulong; 3], + pub totalram: ::c_ulong, + pub freeram: ::c_ulong, + pub sharedram: ::c_ulong, + pub bufferram: ::c_ulong, + pub totalswap: ::c_ulong, + pub freeswap: ::c_ulong, + pub procs: ::c_ushort, + pub pad: ::c_ushort, + pub totalhigh: ::c_ulong, + pub freehigh: ::c_ulong, + pub mem_unit: ::c_uint, + pub _f: [::c_char; 0], + } + + pub struct glob_t { // FIXME + pub gl_pathc: ::size_t, + pub gl_pathv: *mut *mut c_char, + pub gl_offs: ::size_t, + pub gl_flags: ::c_int, + __unused1: *mut ::c_void, + __unused2: *mut ::c_void, + __unused3: *mut ::c_void, + __unused4: *mut ::c_void, + __unused5: *mut ::c_void, + } + + pub struct cpu_set_t { // FIXME + #[cfg(target_pointer_width = "32")] + bits: [u32; 32], + #[cfg(target_pointer_width = "64")] + bits: [u64; 16], + } + + pub struct fsid_t { // FIXME + __val: [::c_int; 2], + } + + // FIXME this is actually a union + pub struct sem_t { + #[cfg(target_pointer_width = "32")] + __size: [::c_char; 16], + #[cfg(target_pointer_width = "64")] + __size: [::c_char; 32], + __align: [::c_long; 0], + } + + pub struct cmsghdr { + pub cmsg_len: ::size_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } +} + +s_no_extra_traits! { + #[allow(missing_debug_implementations)] + pub struct dirent { + pub d_ino: ::ino64_t, + pub d_off: ::off64_t, + pub d_reclen: u16, + pub d_type: u8, + pub d_name: [::c_char; 256], + } +} + +// constants +pub const ENAMETOOLONG: ::c_int = 36; // File name too long +pub const ENOTEMPTY: ::c_int = 39; // Directory not empty +pub const ELOOP: ::c_int = 40; // Too many symbolic links encountered +pub const EADDRINUSE: ::c_int = 98; // Address already in use +pub const EADDRNOTAVAIL: ::c_int = 99; // Cannot assign requested address +pub const ENETDOWN: ::c_int = 100; // Network is down +pub const ENETUNREACH: ::c_int = 101; // Network is unreachable +pub const ECONNABORTED: ::c_int = 103; // Software caused connection abort +pub const ECONNREFUSED: ::c_int = 111; // Connection refused +pub const ECONNRESET: ::c_int = 104; // Connection reset by peer +pub const EDEADLK: ::c_int = 35; // Resource deadlock would occur +pub const ENOSYS: ::c_int = 38; // Function not implemented +pub const ENOTCONN: ::c_int = 107; // Transport endpoint is not connected +pub const ETIMEDOUT: ::c_int = 110; // connection timed out +pub const ESTALE: ::c_int = 116; // Stale file handle +pub const EHOSTUNREACH: ::c_int = 113; // No route to host +pub const EDQUOT: ::c_int = 122; // Quota exceeded +pub const EOPNOTSUPP: ::c_int = 0x5f; +pub const ENODATA: ::c_int = 0x3d; +pub const O_APPEND: ::c_int = 02000; +pub const O_ACCMODE: ::c_int = 0003; +pub const O_CLOEXEC: ::c_int = 0x80000; +pub const O_CREAT: ::c_int = 0100; +pub const O_DIRECTORY: ::c_int = 0200000; +pub const O_EXCL: ::c_int = 0200; +pub const O_NOFOLLOW: ::c_int = 0x20000; +pub const O_NONBLOCK: ::c_int = 04000; +pub const O_TRUNC: ::c_int = 01000; +pub const NCCS: usize = 32; +pub const SIG_SETMASK: ::c_int = 2; // Set the set of blocked signals +pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; +pub const SOCK_DGRAM: ::c_int = 2; // connectionless, unreliable datagrams +pub const SOCK_STREAM: ::c_int = 1; // …/common/bits/socket_type.h +pub const __SIZEOF_PTHREAD_COND_T: usize = 48; +pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; +pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; + +cfg_if! { + if #[cfg(target_os = "l4re")] { + mod l4re; + pub use self::l4re::*; + } else { + mod other; + pub use other::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs new file mode 100644 index 0000000000000000000000000000000000000000..481577cfc27ff0afc18686be60986cff8cff4d50 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/linux/uclibc/x86_64/other.rs @@ -0,0 +1,5 @@ +// Thestyle checker discourages the use of #[cfg], so this has to go into a +// separate module +pub type pthread_t = ::c_ulong; + +pub const PTHREAD_STACK_MIN: usize = 16384; diff --git a/bash-5.1/vendor/libc/src/unix/linux_like/mod.rs b/bash-5.1/vendor/libc/src/unix/linux_like/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..57600f24b8f12dc57e0ce5444336133c43aae641 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/linux_like/mod.rs @@ -0,0 +1,1827 @@ +pub type sa_family_t = u16; +pub type speed_t = ::c_uint; +pub type tcflag_t = ::c_uint; +pub type clockid_t = ::c_int; +pub type timer_t = *mut ::c_void; +pub type key_t = ::c_int; +pub type id_t = ::c_uint; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { + *self + } +} + +s! { + pub struct in_addr { + pub s_addr: ::in_addr_t, + } + + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct ip_mreqn { + pub imr_multiaddr: in_addr, + pub imr_address: in_addr, + pub imr_ifindex: ::c_int, + } + + pub struct ip_mreq_source { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + pub imr_sourceaddr: in_addr, + } + + pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in { + pub sin_family: sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [u8; 8], + } + + pub struct sockaddr_in6 { + pub sin6_family: sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + // The order of the `ai_addr` field in this struct is crucial + // for converting between the Rust and C types. + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + pub ai_addrlen: socklen_t, + + #[cfg(any(target_os = "linux", + target_os = "emscripten"))] + pub ai_addr: *mut ::sockaddr, + + pub ai_canonname: *mut c_char, + + #[cfg(target_os = "android")] + pub ai_addr: *mut ::sockaddr, + + pub ai_next: *mut addrinfo, + } + + pub struct sockaddr_ll { + pub sll_family: ::c_ushort, + pub sll_protocol: ::c_ushort, + pub sll_ifindex: ::c_int, + pub sll_hatype: ::c_ushort, + pub sll_pkttype: ::c_uchar, + pub sll_halen: ::c_uchar, + pub sll_addr: [::c_uchar; 8] + } + + pub struct fd_set { + fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE], + } + + pub struct tm { + pub tm_sec: ::c_int, + pub tm_min: ::c_int, + pub tm_hour: ::c_int, + pub tm_mday: ::c_int, + pub tm_mon: ::c_int, + pub tm_year: ::c_int, + pub tm_wday: ::c_int, + pub tm_yday: ::c_int, + pub tm_isdst: ::c_int, + pub tm_gmtoff: ::c_long, + pub tm_zone: *const ::c_char, + } + + pub struct sched_param { + pub sched_priority: ::c_int, + #[cfg(any(target_env = "musl", target_os = "emscripten"))] + pub sched_ss_low_priority: ::c_int, + #[cfg(any(target_env = "musl", target_os = "emscripten"))] + pub sched_ss_repl_period: ::timespec, + #[cfg(any(target_env = "musl", target_os = "emscripten"))] + pub sched_ss_init_budget: ::timespec, + #[cfg(any(target_env = "musl", target_os = "emscripten"))] + pub sched_ss_max_repl: ::c_int, + } + + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *mut ::c_void, + } + + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } + + pub struct in_pktinfo { + pub ipi_ifindex: ::c_int, + pub ipi_spec_dst: ::in_addr, + pub ipi_addr: ::in_addr, + } + + pub struct ifaddrs { + pub ifa_next: *mut ifaddrs, + pub ifa_name: *mut c_char, + pub ifa_flags: ::c_uint, + pub ifa_addr: *mut ::sockaddr, + pub ifa_netmask: *mut ::sockaddr, + pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union + pub ifa_data: *mut ::c_void + } + + pub struct in6_rtmsg { + rtmsg_dst: ::in6_addr, + rtmsg_src: ::in6_addr, + rtmsg_gateway: ::in6_addr, + rtmsg_type: u32, + rtmsg_dst_len: u16, + rtmsg_src_len: u16, + rtmsg_metric: u32, + rtmsg_info: ::c_ulong, + rtmsg_flags: u32, + rtmsg_ifindex: ::c_int, + } + + pub struct arpreq { + pub arp_pa: ::sockaddr, + pub arp_ha: ::sockaddr, + pub arp_flags: ::c_int, + pub arp_netmask: ::sockaddr, + pub arp_dev: [::c_char; 16], + } + + pub struct arpreq_old { + pub arp_pa: ::sockaddr, + pub arp_ha: ::sockaddr, + pub arp_flags: ::c_int, + pub arp_netmask: ::sockaddr, + } + + pub struct arphdr { + pub ar_hrd: u16, + pub ar_pro: u16, + pub ar_hln: u8, + pub ar_pln: u8, + pub ar_op: u16, + } + + pub struct mmsghdr { + pub msg_hdr: ::msghdr, + pub msg_len: ::c_uint, + } +} + +s_no_extra_traits! { + #[cfg_attr( + any( + all( + target_arch = "x86", + not(target_env = "musl"), + not(target_os = "android")), + target_arch = "x86_64"), + repr(packed))] + pub struct epoll_event { + pub events: u32, + pub u64: u64, + } + + pub struct sockaddr_un { + pub sun_family: sa_family_t, + pub sun_path: [::c_char; 108] + } + + pub struct sockaddr_storage { + pub ss_family: sa_family_t, + __ss_align: ::size_t, + #[cfg(target_pointer_width = "32")] + __ss_pad2: [u8; 128 - 2 * 4], + #[cfg(target_pointer_width = "64")] + __ss_pad2: [u8; 128 - 2 * 8], + } + + pub struct utsname { + pub sysname: [::c_char; 65], + pub nodename: [::c_char; 65], + pub release: [::c_char; 65], + pub version: [::c_char; 65], + pub machine: [::c_char; 65], + pub domainname: [::c_char; 65] + } + + pub struct sigevent { + pub sigev_value: ::sigval, + pub sigev_signo: ::c_int, + pub sigev_notify: ::c_int, + // Actually a union. We only expose sigev_notify_thread_id because it's + // the most useful member + pub sigev_notify_thread_id: ::c_int, + #[cfg(target_pointer_width = "64")] + __unused1: [::c_int; 11], + #[cfg(target_pointer_width = "32")] + __unused1: [::c_int; 12] + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for epoll_event { + fn eq(&self, other: &epoll_event) -> bool { + self.events == other.events + && self.u64 == other.u64 + } + } + impl Eq for epoll_event {} + impl ::fmt::Debug for epoll_event { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let events = self.events; + let u64 = self.u64; + f.debug_struct("epoll_event") + .field("events", &events) + .field("u64", &u64) + .finish() + } + } + impl ::hash::Hash for epoll_event { + fn hash(&self, state: &mut H) { + let events = self.events; + let u64 = self.u64; + events.hash(state); + u64.hash(state); + } + } + + impl PartialEq for sockaddr_un { + fn eq(&self, other: &sockaddr_un) -> bool { + self.sun_family == other.sun_family + && self + .sun_path + .iter() + .zip(other.sun_path.iter()) + .all(|(a, b)| a == b) + } + } + impl Eq for sockaddr_un {} + impl ::fmt::Debug for sockaddr_un { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_un") + .field("sun_family", &self.sun_family) + // FIXME: .field("sun_path", &self.sun_path) + .finish() + } + } + impl ::hash::Hash for sockaddr_un { + fn hash(&self, state: &mut H) { + self.sun_family.hash(state); + self.sun_path.hash(state); + } + } + + impl PartialEq for sockaddr_storage { + fn eq(&self, other: &sockaddr_storage) -> bool { + self.ss_family == other.ss_family + && self + .__ss_pad2 + .iter() + .zip(other.__ss_pad2.iter()) + .all(|(a, b)| a == b) + } + } + + impl Eq for sockaddr_storage {} + + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("ss_family", &self.ss_family) + .field("__ss_align", &self.__ss_align) + // FIXME: .field("__ss_pad2", &self.__ss_pad2) + .finish() + } + } + + impl ::hash::Hash for sockaddr_storage { + fn hash(&self, state: &mut H) { + self.ss_family.hash(state); + self.__ss_pad2.hash(state); + } + } + + impl PartialEq for utsname { + fn eq(&self, other: &utsname) -> bool { + self.sysname + .iter() + .zip(other.sysname.iter()) + .all(|(a, b)| a == b) + && self + .nodename + .iter() + .zip(other.nodename.iter()) + .all(|(a, b)| a == b) + && self + .release + .iter() + .zip(other.release.iter()) + .all(|(a, b)| a == b) + && self + .version + .iter() + .zip(other.version.iter()) + .all(|(a, b)| a == b) + && self + .machine + .iter() + .zip(other.machine.iter()) + .all(|(a, b)| a == b) + && self + .domainname + .iter() + .zip(other.domainname.iter()) + .all(|(a, b)| a == b) + } + } + + impl Eq for utsname {} + + impl ::fmt::Debug for utsname { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utsname") + // FIXME: .field("sysname", &self.sysname) + // FIXME: .field("nodename", &self.nodename) + // FIXME: .field("release", &self.release) + // FIXME: .field("version", &self.version) + // FIXME: .field("machine", &self.machine) + // FIXME: .field("domainname", &self.domainname) + .finish() + } + } + + impl ::hash::Hash for utsname { + fn hash(&self, state: &mut H) { + self.sysname.hash(state); + self.nodename.hash(state); + self.release.hash(state); + self.version.hash(state); + self.machine.hash(state); + self.domainname.hash(state); + } + } + + impl PartialEq for sigevent { + fn eq(&self, other: &sigevent) -> bool { + self.sigev_value == other.sigev_value + && self.sigev_signo == other.sigev_signo + && self.sigev_notify == other.sigev_notify + && self.sigev_notify_thread_id + == other.sigev_notify_thread_id + } + } + impl Eq for sigevent {} + impl ::fmt::Debug for sigevent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigevent") + .field("sigev_value", &self.sigev_value) + .field("sigev_signo", &self.sigev_signo) + .field("sigev_notify", &self.sigev_notify) + .field("sigev_notify_thread_id", + &self.sigev_notify_thread_id) + .finish() + } + } + impl ::hash::Hash for sigevent { + fn hash(&self, state: &mut H) { + self.sigev_value.hash(state); + self.sigev_signo.hash(state); + self.sigev_notify.hash(state); + self.sigev_notify_thread_id.hash(state); + } + } + } +} + +// intentionally not public, only used for fd_set +cfg_if! { + if #[cfg(target_pointer_width = "32")] { + const ULONG_SIZE: usize = 32; + } else if #[cfg(target_pointer_width = "64")] { + const ULONG_SIZE: usize = 64; + } else { + // Unknown target_pointer_width + } +} + +pub const EXIT_FAILURE: ::c_int = 1; +pub const EXIT_SUCCESS: ::c_int = 0; +pub const RAND_MAX: ::c_int = 2147483647; +pub const EOF: ::c_int = -1; +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; +pub const _IOFBF: ::c_int = 0; +pub const _IONBF: ::c_int = 2; +pub const _IOLBF: ::c_int = 1; + +pub const F_DUPFD: ::c_int = 0; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; + +// Linux-specific fcntls +pub const F_SETLEASE: ::c_int = 1024; +pub const F_GETLEASE: ::c_int = 1025; +pub const F_NOTIFY: ::c_int = 1026; +pub const F_CANCELLK: ::c_int = 1029; +pub const F_DUPFD_CLOEXEC: ::c_int = 1030; +pub const F_SETPIPE_SZ: ::c_int = 1031; +pub const F_GETPIPE_SZ: ::c_int = 1032; +pub const F_ADD_SEALS: ::c_int = 1033; +pub const F_GET_SEALS: ::c_int = 1034; + +pub const F_SEAL_SEAL: ::c_int = 0x0001; +pub const F_SEAL_SHRINK: ::c_int = 0x0002; +pub const F_SEAL_GROW: ::c_int = 0x0004; +pub const F_SEAL_WRITE: ::c_int = 0x0008; + +// FIXME(#235): Include file sealing fcntls once we have a way to verify them. + +pub const SIGTRAP: ::c_int = 5; + +pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; +pub const PTHREAD_CREATE_DETACHED: ::c_int = 1; + +pub const CLOCK_REALTIME: ::clockid_t = 0; +pub const CLOCK_MONOTONIC: ::clockid_t = 1; +pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2; +pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3; +pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4; +pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5; +pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6; +pub const CLOCK_BOOTTIME: ::clockid_t = 7; +pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8; +pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9; +pub const CLOCK_TAI: ::clockid_t = 11; +pub const TIMER_ABSTIME: ::c_int = 1; + +pub const RUSAGE_SELF: ::c_int = 0; + +pub const O_RDONLY: ::c_int = 0; +pub const O_WRONLY: ::c_int = 1; +pub const O_RDWR: ::c_int = 2; + +pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC; + +pub const S_IFIFO: ::mode_t = 4096; +pub const S_IFCHR: ::mode_t = 8192; +pub const S_IFBLK: ::mode_t = 24576; +pub const S_IFDIR: ::mode_t = 16384; +pub const S_IFREG: ::mode_t = 32768; +pub const S_IFLNK: ::mode_t = 40960; +pub const S_IFSOCK: ::mode_t = 49152; +pub const S_IFMT: ::mode_t = 61440; +pub const S_IRWXU: ::mode_t = 448; +pub const S_IXUSR: ::mode_t = 64; +pub const S_IWUSR: ::mode_t = 128; +pub const S_IRUSR: ::mode_t = 256; +pub const S_IRWXG: ::mode_t = 56; +pub const S_IXGRP: ::mode_t = 8; +pub const S_IWGRP: ::mode_t = 16; +pub const S_IRGRP: ::mode_t = 32; +pub const S_IRWXO: ::mode_t = 7; +pub const S_IXOTH: ::mode_t = 1; +pub const S_IWOTH: ::mode_t = 2; +pub const S_IROTH: ::mode_t = 4; +pub const F_OK: ::c_int = 0; +pub const R_OK: ::c_int = 4; +pub const W_OK: ::c_int = 2; +pub const X_OK: ::c_int = 1; +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGABRT: ::c_int = 6; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGSEGV: ::c_int = 11; +pub const SIGPIPE: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; + +pub const PROT_NONE: ::c_int = 0; +pub const PROT_READ: ::c_int = 1; +pub const PROT_WRITE: ::c_int = 2; +pub const PROT_EXEC: ::c_int = 4; + +pub const XATTR_CREATE: ::c_int = 0x1; +pub const XATTR_REPLACE: ::c_int = 0x2; + +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + pub const LC_CTYPE: ::c_int = 0; + pub const LC_NUMERIC: ::c_int = 1; + pub const LC_TIME: ::c_int = 2; + pub const LC_COLLATE: ::c_int = 3; + pub const LC_MONETARY: ::c_int = 4; + pub const LC_MESSAGES: ::c_int = 5; + pub const LC_ALL: ::c_int = 6; + } +} + +pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE; +pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC; +pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME; +pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE; +pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY; +pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES; +// LC_ALL_MASK defined per platform + +pub const MAP_FILE: ::c_int = 0x0000; +pub const MAP_SHARED: ::c_int = 0x0001; +pub const MAP_PRIVATE: ::c_int = 0x0002; +pub const MAP_FIXED: ::c_int = 0x0010; + +pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; + +// MS_ flags for msync(2) +pub const MS_ASYNC: ::c_int = 0x0001; +pub const MS_INVALIDATE: ::c_int = 0x0002; +pub const MS_SYNC: ::c_int = 0x0004; + +// MS_ flags for mount(2) +pub const MS_RDONLY: ::c_ulong = 0x01; +pub const MS_NOSUID: ::c_ulong = 0x02; +pub const MS_NODEV: ::c_ulong = 0x04; +pub const MS_NOEXEC: ::c_ulong = 0x08; +pub const MS_SYNCHRONOUS: ::c_ulong = 0x10; +pub const MS_REMOUNT: ::c_ulong = 0x20; +pub const MS_MANDLOCK: ::c_ulong = 0x40; +pub const MS_DIRSYNC: ::c_ulong = 0x80; +pub const MS_NOATIME: ::c_ulong = 0x0400; +pub const MS_NODIRATIME: ::c_ulong = 0x0800; +pub const MS_BIND: ::c_ulong = 0x1000; +pub const MS_MOVE: ::c_ulong = 0x2000; +pub const MS_REC: ::c_ulong = 0x4000; +pub const MS_SILENT: ::c_ulong = 0x8000; +pub const MS_POSIXACL: ::c_ulong = 0x010000; +pub const MS_UNBINDABLE: ::c_ulong = 0x020000; +pub const MS_PRIVATE: ::c_ulong = 0x040000; +pub const MS_SLAVE: ::c_ulong = 0x080000; +pub const MS_SHARED: ::c_ulong = 0x100000; +pub const MS_RELATIME: ::c_ulong = 0x200000; +pub const MS_KERNMOUNT: ::c_ulong = 0x400000; +pub const MS_I_VERSION: ::c_ulong = 0x800000; +pub const MS_STRICTATIME: ::c_ulong = 0x1000000; +pub const MS_LAZYTIME: ::c_ulong = 0x2000000; +pub const MS_ACTIVE: ::c_ulong = 0x40000000; +pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000; +pub const MS_MGC_MSK: ::c_ulong = 0xffff0000; + +pub const SCM_RIGHTS: ::c_int = 0x01; +pub const SCM_CREDENTIALS: ::c_int = 0x02; + +pub const PROT_GROWSDOWN: ::c_int = 0x1000000; +pub const PROT_GROWSUP: ::c_int = 0x2000000; + +pub const MAP_TYPE: ::c_int = 0x000f; + +pub const MADV_NORMAL: ::c_int = 0; +pub const MADV_RANDOM: ::c_int = 1; +pub const MADV_SEQUENTIAL: ::c_int = 2; +pub const MADV_WILLNEED: ::c_int = 3; +pub const MADV_DONTNEED: ::c_int = 4; +pub const MADV_FREE: ::c_int = 8; +pub const MADV_REMOVE: ::c_int = 9; +pub const MADV_DONTFORK: ::c_int = 10; +pub const MADV_DOFORK: ::c_int = 11; +pub const MADV_MERGEABLE: ::c_int = 12; +pub const MADV_UNMERGEABLE: ::c_int = 13; +pub const MADV_HUGEPAGE: ::c_int = 14; +pub const MADV_NOHUGEPAGE: ::c_int = 15; +pub const MADV_DONTDUMP: ::c_int = 16; +pub const MADV_DODUMP: ::c_int = 17; +pub const MADV_HWPOISON: ::c_int = 100; + +pub const IFF_UP: ::c_int = 0x1; +pub const IFF_BROADCAST: ::c_int = 0x2; +pub const IFF_DEBUG: ::c_int = 0x4; +pub const IFF_LOOPBACK: ::c_int = 0x8; +pub const IFF_POINTOPOINT: ::c_int = 0x10; +pub const IFF_NOTRAILERS: ::c_int = 0x20; +pub const IFF_RUNNING: ::c_int = 0x40; +pub const IFF_NOARP: ::c_int = 0x80; +pub const IFF_PROMISC: ::c_int = 0x100; +pub const IFF_ALLMULTI: ::c_int = 0x200; +pub const IFF_MASTER: ::c_int = 0x400; +pub const IFF_SLAVE: ::c_int = 0x800; +pub const IFF_MULTICAST: ::c_int = 0x1000; +pub const IFF_PORTSEL: ::c_int = 0x2000; +pub const IFF_AUTOMEDIA: ::c_int = 0x4000; +pub const IFF_DYNAMIC: ::c_int = 0x8000; + +pub const SOL_IP: ::c_int = 0; +pub const SOL_TCP: ::c_int = 6; +pub const SOL_UDP: ::c_int = 17; +pub const SOL_IPV6: ::c_int = 41; +pub const SOL_ICMPV6: ::c_int = 58; +pub const SOL_RAW: ::c_int = 255; +pub const SOL_DECNET: ::c_int = 261; +pub const SOL_X25: ::c_int = 262; +pub const SOL_PACKET: ::c_int = 263; +pub const SOL_ATM: ::c_int = 264; +pub const SOL_AAL: ::c_int = 265; +pub const SOL_IRDA: ::c_int = 266; +pub const SOL_NETBEUI: ::c_int = 267; +pub const SOL_LLC: ::c_int = 268; +pub const SOL_DCCP: ::c_int = 269; +pub const SOL_NETLINK: ::c_int = 270; +pub const SOL_TIPC: ::c_int = 271; +pub const SOL_BLUETOOTH: ::c_int = 274; +pub const SOL_ALG: ::c_int = 279; + +pub const AF_UNSPEC: ::c_int = 0; +pub const AF_UNIX: ::c_int = 1; +pub const AF_LOCAL: ::c_int = 1; +pub const AF_INET: ::c_int = 2; +pub const AF_AX25: ::c_int = 3; +pub const AF_IPX: ::c_int = 4; +pub const AF_APPLETALK: ::c_int = 5; +pub const AF_NETROM: ::c_int = 6; +pub const AF_BRIDGE: ::c_int = 7; +pub const AF_ATMPVC: ::c_int = 8; +pub const AF_X25: ::c_int = 9; +pub const AF_INET6: ::c_int = 10; +pub const AF_ROSE: ::c_int = 11; +pub const AF_DECnet: ::c_int = 12; +pub const AF_NETBEUI: ::c_int = 13; +pub const AF_SECURITY: ::c_int = 14; +pub const AF_KEY: ::c_int = 15; +pub const AF_NETLINK: ::c_int = 16; +pub const AF_ROUTE: ::c_int = AF_NETLINK; +pub const AF_PACKET: ::c_int = 17; +pub const AF_ASH: ::c_int = 18; +pub const AF_ECONET: ::c_int = 19; +pub const AF_ATMSVC: ::c_int = 20; +pub const AF_RDS: ::c_int = 21; +pub const AF_SNA: ::c_int = 22; +pub const AF_IRDA: ::c_int = 23; +pub const AF_PPPOX: ::c_int = 24; +pub const AF_WANPIPE: ::c_int = 25; +pub const AF_LLC: ::c_int = 26; +pub const AF_CAN: ::c_int = 29; +pub const AF_TIPC: ::c_int = 30; +pub const AF_BLUETOOTH: ::c_int = 31; +pub const AF_IUCV: ::c_int = 32; +pub const AF_RXRPC: ::c_int = 33; +pub const AF_ISDN: ::c_int = 34; +pub const AF_PHONET: ::c_int = 35; +pub const AF_IEEE802154: ::c_int = 36; +pub const AF_CAIF: ::c_int = 37; +pub const AF_ALG: ::c_int = 38; + +pub const PF_UNSPEC: ::c_int = AF_UNSPEC; +pub const PF_UNIX: ::c_int = AF_UNIX; +pub const PF_LOCAL: ::c_int = AF_LOCAL; +pub const PF_INET: ::c_int = AF_INET; +pub const PF_AX25: ::c_int = AF_AX25; +pub const PF_IPX: ::c_int = AF_IPX; +pub const PF_APPLETALK: ::c_int = AF_APPLETALK; +pub const PF_NETROM: ::c_int = AF_NETROM; +pub const PF_BRIDGE: ::c_int = AF_BRIDGE; +pub const PF_ATMPVC: ::c_int = AF_ATMPVC; +pub const PF_X25: ::c_int = AF_X25; +pub const PF_INET6: ::c_int = AF_INET6; +pub const PF_ROSE: ::c_int = AF_ROSE; +pub const PF_DECnet: ::c_int = AF_DECnet; +pub const PF_NETBEUI: ::c_int = AF_NETBEUI; +pub const PF_SECURITY: ::c_int = AF_SECURITY; +pub const PF_KEY: ::c_int = AF_KEY; +pub const PF_NETLINK: ::c_int = AF_NETLINK; +pub const PF_ROUTE: ::c_int = AF_ROUTE; +pub const PF_PACKET: ::c_int = AF_PACKET; +pub const PF_ASH: ::c_int = AF_ASH; +pub const PF_ECONET: ::c_int = AF_ECONET; +pub const PF_ATMSVC: ::c_int = AF_ATMSVC; +pub const PF_RDS: ::c_int = AF_RDS; +pub const PF_SNA: ::c_int = AF_SNA; +pub const PF_IRDA: ::c_int = AF_IRDA; +pub const PF_PPPOX: ::c_int = AF_PPPOX; +pub const PF_WANPIPE: ::c_int = AF_WANPIPE; +pub const PF_LLC: ::c_int = AF_LLC; +pub const PF_CAN: ::c_int = AF_CAN; +pub const PF_TIPC: ::c_int = AF_TIPC; +pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH; +pub const PF_IUCV: ::c_int = AF_IUCV; +pub const PF_RXRPC: ::c_int = AF_RXRPC; +pub const PF_ISDN: ::c_int = AF_ISDN; +pub const PF_PHONET: ::c_int = AF_PHONET; +pub const PF_IEEE802154: ::c_int = AF_IEEE802154; +pub const PF_CAIF: ::c_int = AF_CAIF; +pub const PF_ALG: ::c_int = AF_ALG; + +pub const MSG_OOB: ::c_int = 1; +pub const MSG_PEEK: ::c_int = 2; +pub const MSG_DONTROUTE: ::c_int = 4; +pub const MSG_CTRUNC: ::c_int = 8; +pub const MSG_TRUNC: ::c_int = 0x20; +pub const MSG_DONTWAIT: ::c_int = 0x40; +pub const MSG_EOR: ::c_int = 0x80; +pub const MSG_WAITALL: ::c_int = 0x100; +pub const MSG_FIN: ::c_int = 0x200; +pub const MSG_SYN: ::c_int = 0x400; +pub const MSG_CONFIRM: ::c_int = 0x800; +pub const MSG_RST: ::c_int = 0x1000; +pub const MSG_ERRQUEUE: ::c_int = 0x2000; +pub const MSG_NOSIGNAL: ::c_int = 0x4000; +pub const MSG_MORE: ::c_int = 0x8000; +pub const MSG_WAITFORONE: ::c_int = 0x10000; +pub const MSG_FASTOPEN: ::c_int = 0x20000000; +pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000; + +pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; + +pub const SOCK_RAW: ::c_int = 3; +pub const SOCK_RDM: ::c_int = 4; +pub const IP_TOS: ::c_int = 1; +pub const IP_TTL: ::c_int = 2; +pub const IP_HDRINCL: ::c_int = 3; +pub const IP_OPTIONS: ::c_int = 4; +pub const IP_ROUTER_ALERT: ::c_int = 5; +pub const IP_RECVOPTS: ::c_int = 6; +pub const IP_RETOPTS: ::c_int = 7; +pub const IP_PKTINFO: ::c_int = 8; +pub const IP_PKTOPTIONS: ::c_int = 9; +pub const IP_MTU_DISCOVER: ::c_int = 10; +pub const IP_RECVERR: ::c_int = 11; +pub const IP_RECVTTL: ::c_int = 12; +pub const IP_RECVTOS: ::c_int = 13; +pub const IP_MTU: ::c_int = 14; +pub const IP_FREEBIND: ::c_int = 15; +pub const IP_IPSEC_POLICY: ::c_int = 16; +pub const IP_XFRM_POLICY: ::c_int = 17; +pub const IP_PASSSEC: ::c_int = 18; +pub const IP_TRANSPARENT: ::c_int = 19; +pub const IP_ORIGDSTADDR: ::c_int = 20; +pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR; +pub const IP_MINTTL: ::c_int = 21; +pub const IP_NODEFRAG: ::c_int = 22; +pub const IP_CHECKSUM: ::c_int = 23; +pub const IP_BIND_ADDRESS_NO_PORT: ::c_int = 24; +pub const IP_MULTICAST_IF: ::c_int = 32; +pub const IP_MULTICAST_TTL: ::c_int = 33; +pub const IP_MULTICAST_LOOP: ::c_int = 34; +pub const IP_ADD_MEMBERSHIP: ::c_int = 35; +pub const IP_DROP_MEMBERSHIP: ::c_int = 36; +pub const IP_UNBLOCK_SOURCE: ::c_int = 37; +pub const IP_BLOCK_SOURCE: ::c_int = 38; +pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 39; +pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 40; +pub const IP_MSFILTER: ::c_int = 41; +pub const IP_MULTICAST_ALL: ::c_int = 49; +pub const IP_UNICAST_IF: ::c_int = 50; + +pub const IP_DEFAULT_MULTICAST_TTL: ::c_int = 1; +pub const IP_DEFAULT_MULTICAST_LOOP: ::c_int = 1; + +pub const IP_PMTUDISC_DONT: ::c_int = 0; +pub const IP_PMTUDISC_WANT: ::c_int = 1; +pub const IP_PMTUDISC_DO: ::c_int = 2; +pub const IP_PMTUDISC_PROBE: ::c_int = 3; +pub const IP_PMTUDISC_INTERFACE: ::c_int = 4; +pub const IP_PMTUDISC_OMIT: ::c_int = 5; + +// IPPROTO_IP defined in src/unix/mod.rs +/// Hop-by-hop option header +pub const IPPROTO_HOPOPTS: ::c_int = 0; +// IPPROTO_ICMP defined in src/unix/mod.rs +/// group mgmt protocol +pub const IPPROTO_IGMP: ::c_int = 2; +/// for compatibility +pub const IPPROTO_IPIP: ::c_int = 4; +// IPPROTO_TCP defined in src/unix/mod.rs +/// exterior gateway protocol +pub const IPPROTO_EGP: ::c_int = 8; +/// pup +pub const IPPROTO_PUP: ::c_int = 12; +// IPPROTO_UDP defined in src/unix/mod.rs +/// xns idp +pub const IPPROTO_IDP: ::c_int = 22; +/// tp-4 w/ class negotiation +pub const IPPROTO_TP: ::c_int = 29; +/// DCCP +pub const IPPROTO_DCCP: ::c_int = 33; +// IPPROTO_IPV6 defined in src/unix/mod.rs +/// IP6 routing header +pub const IPPROTO_ROUTING: ::c_int = 43; +/// IP6 fragmentation header +pub const IPPROTO_FRAGMENT: ::c_int = 44; +/// resource reservation +pub const IPPROTO_RSVP: ::c_int = 46; +/// General Routing Encap. +pub const IPPROTO_GRE: ::c_int = 47; +/// IP6 Encap Sec. Payload +pub const IPPROTO_ESP: ::c_int = 50; +/// IP6 Auth Header +pub const IPPROTO_AH: ::c_int = 51; +// IPPROTO_ICMPV6 defined in src/unix/mod.rs +/// IP6 no next header +pub const IPPROTO_NONE: ::c_int = 59; +/// IP6 destination option +pub const IPPROTO_DSTOPTS: ::c_int = 60; +pub const IPPROTO_MTP: ::c_int = 92; +/// encapsulation header +pub const IPPROTO_ENCAP: ::c_int = 98; +/// Protocol indep. multicast +pub const IPPROTO_PIM: ::c_int = 103; +/// IP Payload Comp. Protocol +pub const IPPROTO_COMP: ::c_int = 108; +/// SCTP +pub const IPPROTO_SCTP: ::c_int = 132; +pub const IPPROTO_MH: ::c_int = 135; +pub const IPPROTO_UDPLITE: ::c_int = 136; +/// raw IP packet +pub const IPPROTO_RAW: ::c_int = 255; +pub const IPPROTO_BEETPH: ::c_int = 94; +pub const IPPROTO_MPLS: ::c_int = 137; + +pub const MCAST_EXCLUDE: ::c_int = 0; +pub const MCAST_INCLUDE: ::c_int = 1; +pub const MCAST_JOIN_GROUP: ::c_int = 42; +pub const MCAST_BLOCK_SOURCE: ::c_int = 43; +pub const MCAST_UNBLOCK_SOURCE: ::c_int = 44; +pub const MCAST_LEAVE_GROUP: ::c_int = 45; +pub const MCAST_JOIN_SOURCE_GROUP: ::c_int = 46; +pub const MCAST_LEAVE_SOURCE_GROUP: ::c_int = 47; +pub const MCAST_MSFILTER: ::c_int = 48; + +pub const IPV6_ADDRFORM: ::c_int = 1; +pub const IPV6_2292PKTINFO: ::c_int = 2; +pub const IPV6_2292HOPOPTS: ::c_int = 3; +pub const IPV6_2292DSTOPTS: ::c_int = 4; +pub const IPV6_2292RTHDR: ::c_int = 5; +pub const IPV6_2292PKTOPTIONS: ::c_int = 6; +pub const IPV6_CHECKSUM: ::c_int = 7; +pub const IPV6_2292HOPLIMIT: ::c_int = 8; +pub const IPV6_NEXTHOP: ::c_int = 9; +pub const IPV6_AUTHHDR: ::c_int = 10; +pub const IPV6_UNICAST_HOPS: ::c_int = 16; +pub const IPV6_MULTICAST_IF: ::c_int = 17; +pub const IPV6_MULTICAST_HOPS: ::c_int = 18; +pub const IPV6_MULTICAST_LOOP: ::c_int = 19; +pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20; +pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21; +pub const IPV6_ROUTER_ALERT: ::c_int = 22; +pub const IPV6_MTU_DISCOVER: ::c_int = 23; +pub const IPV6_MTU: ::c_int = 24; +pub const IPV6_RECVERR: ::c_int = 25; +pub const IPV6_V6ONLY: ::c_int = 26; +pub const IPV6_JOIN_ANYCAST: ::c_int = 27; +pub const IPV6_LEAVE_ANYCAST: ::c_int = 28; +pub const IPV6_IPSEC_POLICY: ::c_int = 34; +pub const IPV6_XFRM_POLICY: ::c_int = 35; +pub const IPV6_HDRINCL: ::c_int = 36; +pub const IPV6_RECVPKTINFO: ::c_int = 49; +pub const IPV6_PKTINFO: ::c_int = 50; +pub const IPV6_RECVHOPLIMIT: ::c_int = 51; +pub const IPV6_HOPLIMIT: ::c_int = 52; +pub const IPV6_RECVHOPOPTS: ::c_int = 53; +pub const IPV6_HOPOPTS: ::c_int = 54; +pub const IPV6_RTHDRDSTOPTS: ::c_int = 55; +pub const IPV6_RECVRTHDR: ::c_int = 56; +pub const IPV6_RTHDR: ::c_int = 57; +pub const IPV6_RECVDSTOPTS: ::c_int = 58; +pub const IPV6_DSTOPTS: ::c_int = 59; +pub const IPV6_RECVPATHMTU: ::c_int = 60; +pub const IPV6_PATHMTU: ::c_int = 61; +pub const IPV6_DONTFRAG: ::c_int = 62; +pub const IPV6_RECVTCLASS: ::c_int = 66; +pub const IPV6_TCLASS: ::c_int = 67; +pub const IPV6_AUTOFLOWLABEL: ::c_int = 70; +pub const IPV6_ADDR_PREFERENCES: ::c_int = 72; +pub const IPV6_MINHOPCOUNT: ::c_int = 73; +pub const IPV6_ORIGDSTADDR: ::c_int = 74; +pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR; +pub const IPV6_TRANSPARENT: ::c_int = 75; +pub const IPV6_UNICAST_IF: ::c_int = 76; +pub const IPV6_PREFER_SRC_TMP: ::c_int = 0x0001; +pub const IPV6_PREFER_SRC_PUBLIC: ::c_int = 0x0002; +pub const IPV6_PREFER_SRC_PUBTMP_DEFAULT: ::c_int = 0x0100; +pub const IPV6_PREFER_SRC_COA: ::c_int = 0x0004; +pub const IPV6_PREFER_SRC_HOME: ::c_int = 0x0400; +pub const IPV6_PREFER_SRC_CGA: ::c_int = 0x0008; +pub const IPV6_PREFER_SRC_NONCGA: ::c_int = 0x0800; + +pub const IPV6_PMTUDISC_DONT: ::c_int = 0; +pub const IPV6_PMTUDISC_WANT: ::c_int = 1; +pub const IPV6_PMTUDISC_DO: ::c_int = 2; +pub const IPV6_PMTUDISC_PROBE: ::c_int = 3; +pub const IPV6_PMTUDISC_INTERFACE: ::c_int = 4; +pub const IPV6_PMTUDISC_OMIT: ::c_int = 5; + +pub const TCP_NODELAY: ::c_int = 1; +pub const TCP_MAXSEG: ::c_int = 2; +pub const TCP_CORK: ::c_int = 3; +pub const TCP_KEEPIDLE: ::c_int = 4; +pub const TCP_KEEPINTVL: ::c_int = 5; +pub const TCP_KEEPCNT: ::c_int = 6; +pub const TCP_SYNCNT: ::c_int = 7; +pub const TCP_LINGER2: ::c_int = 8; +pub const TCP_DEFER_ACCEPT: ::c_int = 9; +pub const TCP_WINDOW_CLAMP: ::c_int = 10; +pub const TCP_INFO: ::c_int = 11; +pub const TCP_QUICKACK: ::c_int = 12; +pub const TCP_CONGESTION: ::c_int = 13; +pub const TCP_MD5SIG: ::c_int = 14; +cfg_if! { + if #[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "musl")))] { + // WARN: deprecated + pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15; + } +} +pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16; +pub const TCP_THIN_DUPACK: ::c_int = 17; +pub const TCP_USER_TIMEOUT: ::c_int = 18; +pub const TCP_REPAIR: ::c_int = 19; +pub const TCP_REPAIR_QUEUE: ::c_int = 20; +pub const TCP_QUEUE_SEQ: ::c_int = 21; +pub const TCP_REPAIR_OPTIONS: ::c_int = 22; +pub const TCP_FASTOPEN: ::c_int = 23; +pub const TCP_TIMESTAMP: ::c_int = 24; +pub const TCP_NOTSENT_LOWAT: ::c_int = 25; +pub const TCP_CC_INFO: ::c_int = 26; +pub const TCP_SAVE_SYN: ::c_int = 27; +pub const TCP_SAVED_SYN: ::c_int = 28; +cfg_if! { + if #[cfg(not(target_os = "emscripten"))] { + // NOTE: emscripten doesn't support these options yet. + + pub const TCP_REPAIR_WINDOW: ::c_int = 29; + pub const TCP_FASTOPEN_CONNECT: ::c_int = 30; + pub const TCP_ULP: ::c_int = 31; + pub const TCP_MD5SIG_EXT: ::c_int = 32; + pub const TCP_FASTOPEN_KEY: ::c_int = 33; + pub const TCP_FASTOPEN_NO_COOKIE: ::c_int = 34; + pub const TCP_ZEROCOPY_RECEIVE: ::c_int = 35; + pub const TCP_INQ: ::c_int = 36; + pub const TCP_CM_INQ: ::c_int = TCP_INQ; + // NOTE: Some CI images doesn't have this option yet. + // pub const TCP_TX_DELAY: ::c_int = 37; + } +} + +pub const SO_DEBUG: ::c_int = 1; + +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; + +pub const LOCK_SH: ::c_int = 1; +pub const LOCK_EX: ::c_int = 2; +pub const LOCK_NB: ::c_int = 4; +pub const LOCK_UN: ::c_int = 8; + +pub const SS_ONSTACK: ::c_int = 1; +pub const SS_DISABLE: ::c_int = 2; + +pub const PATH_MAX: ::c_int = 4096; + +pub const UIO_MAXIOV: ::c_int = 1024; + +pub const FD_SETSIZE: usize = 1024; + +pub const EPOLLIN: ::c_int = 0x1; +pub const EPOLLPRI: ::c_int = 0x2; +pub const EPOLLOUT: ::c_int = 0x4; +pub const EPOLLERR: ::c_int = 0x8; +pub const EPOLLHUP: ::c_int = 0x10; +pub const EPOLLRDNORM: ::c_int = 0x40; +pub const EPOLLRDBAND: ::c_int = 0x80; +pub const EPOLLWRNORM: ::c_int = 0x100; +pub const EPOLLWRBAND: ::c_int = 0x200; +pub const EPOLLMSG: ::c_int = 0x400; +pub const EPOLLRDHUP: ::c_int = 0x2000; +pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000; +pub const EPOLLWAKEUP: ::c_int = 0x20000000; +pub const EPOLLONESHOT: ::c_int = 0x40000000; +pub const EPOLLET: ::c_int = 0x80000000; + +pub const EPOLL_CTL_ADD: ::c_int = 1; +pub const EPOLL_CTL_MOD: ::c_int = 3; +pub const EPOLL_CTL_DEL: ::c_int = 2; + +pub const MNT_FORCE: ::c_int = 0x1; +pub const MNT_DETACH: ::c_int = 0x2; +pub const MNT_EXPIRE: ::c_int = 0x4; +pub const UMOUNT_NOFOLLOW: ::c_int = 0x8; + +pub const Q_GETFMT: ::c_int = 0x800004; +pub const Q_GETINFO: ::c_int = 0x800005; +pub const Q_SETINFO: ::c_int = 0x800006; +pub const QIF_BLIMITS: u32 = 1; +pub const QIF_SPACE: u32 = 2; +pub const QIF_ILIMITS: u32 = 4; +pub const QIF_INODES: u32 = 8; +pub const QIF_BTIME: u32 = 16; +pub const QIF_ITIME: u32 = 32; +pub const QIF_LIMITS: u32 = 5; +pub const QIF_USAGE: u32 = 10; +pub const QIF_TIMES: u32 = 48; +pub const QIF_ALL: u32 = 63; + +pub const Q_SYNC: ::c_int = 0x800001; +pub const Q_QUOTAON: ::c_int = 0x800002; +pub const Q_QUOTAOFF: ::c_int = 0x800003; +pub const Q_GETQUOTA: ::c_int = 0x800007; +pub const Q_SETQUOTA: ::c_int = 0x800008; + +pub const TCIOFF: ::c_int = 2; +pub const TCION: ::c_int = 3; +pub const TCOOFF: ::c_int = 0; +pub const TCOON: ::c_int = 1; +pub const TCIFLUSH: ::c_int = 0; +pub const TCOFLUSH: ::c_int = 1; +pub const TCIOFLUSH: ::c_int = 2; +pub const NL0: ::tcflag_t = 0x00000000; +pub const NL1: ::tcflag_t = 0x00000100; +pub const TAB0: ::tcflag_t = 0x00000000; +pub const CR0: ::tcflag_t = 0x00000000; +pub const FF0: ::tcflag_t = 0x00000000; +pub const BS0: ::tcflag_t = 0x00000000; +pub const VT0: ::tcflag_t = 0x00000000; +pub const VERASE: usize = 2; +pub const VKILL: usize = 3; +pub const VINTR: usize = 0; +pub const VQUIT: usize = 1; +pub const VLNEXT: usize = 15; +pub const IGNBRK: ::tcflag_t = 0x00000001; +pub const BRKINT: ::tcflag_t = 0x00000002; +pub const IGNPAR: ::tcflag_t = 0x00000004; +pub const PARMRK: ::tcflag_t = 0x00000008; +pub const INPCK: ::tcflag_t = 0x00000010; +pub const ISTRIP: ::tcflag_t = 0x00000020; +pub const INLCR: ::tcflag_t = 0x00000040; +pub const IGNCR: ::tcflag_t = 0x00000080; +pub const ICRNL: ::tcflag_t = 0x00000100; +pub const IXANY: ::tcflag_t = 0x00000800; +pub const IMAXBEL: ::tcflag_t = 0x00002000; +pub const OPOST: ::tcflag_t = 0x1; +pub const CS5: ::tcflag_t = 0x00000000; +pub const CRTSCTS: ::tcflag_t = 0x80000000; +pub const ECHO: ::tcflag_t = 0x00000008; +pub const OCRNL: ::tcflag_t = 0o000010; +pub const ONOCR: ::tcflag_t = 0o000020; +pub const ONLRET: ::tcflag_t = 0o000040; +pub const OFILL: ::tcflag_t = 0o000100; +pub const OFDEL: ::tcflag_t = 0o000200; + +pub const CLONE_VM: ::c_int = 0x100; +pub const CLONE_FS: ::c_int = 0x200; +pub const CLONE_FILES: ::c_int = 0x400; +pub const CLONE_SIGHAND: ::c_int = 0x800; +pub const CLONE_PTRACE: ::c_int = 0x2000; +pub const CLONE_VFORK: ::c_int = 0x4000; +pub const CLONE_PARENT: ::c_int = 0x8000; +pub const CLONE_THREAD: ::c_int = 0x10000; +pub const CLONE_NEWNS: ::c_int = 0x20000; +pub const CLONE_SYSVSEM: ::c_int = 0x40000; +pub const CLONE_SETTLS: ::c_int = 0x80000; +pub const CLONE_PARENT_SETTID: ::c_int = 0x100000; +pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000; +pub const CLONE_DETACHED: ::c_int = 0x400000; +pub const CLONE_UNTRACED: ::c_int = 0x800000; +pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000; +pub const CLONE_NEWCGROUP: ::c_int = 0x02000000; +pub const CLONE_NEWUTS: ::c_int = 0x04000000; +pub const CLONE_NEWIPC: ::c_int = 0x08000000; +pub const CLONE_NEWUSER: ::c_int = 0x10000000; +pub const CLONE_NEWPID: ::c_int = 0x20000000; +pub const CLONE_NEWNET: ::c_int = 0x40000000; +pub const CLONE_IO: ::c_int = 0x80000000; + +pub const WNOHANG: ::c_int = 0x00000001; +pub const WUNTRACED: ::c_int = 0x00000002; +pub const WSTOPPED: ::c_int = WUNTRACED; +pub const WEXITED: ::c_int = 0x00000004; +pub const WCONTINUED: ::c_int = 0x00000008; +pub const WNOWAIT: ::c_int = 0x01000000; + +// Options for personality(2). +pub const ADDR_NO_RANDOMIZE: ::c_int = 0x0040000; +pub const MMAP_PAGE_ZERO: ::c_int = 0x0100000; +pub const ADDR_COMPAT_LAYOUT: ::c_int = 0x0200000; +pub const READ_IMPLIES_EXEC: ::c_int = 0x0400000; +pub const ADDR_LIMIT_32BIT: ::c_int = 0x0800000; +pub const SHORT_INODE: ::c_int = 0x1000000; +pub const WHOLE_SECONDS: ::c_int = 0x2000000; +pub const STICKY_TIMEOUTS: ::c_int = 0x4000000; +pub const ADDR_LIMIT_3GB: ::c_int = 0x8000000; + +// Options set using PTRACE_SETOPTIONS. +pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001; +pub const PTRACE_O_TRACEFORK: ::c_int = 0x00000002; +pub const PTRACE_O_TRACEVFORK: ::c_int = 0x00000004; +pub const PTRACE_O_TRACECLONE: ::c_int = 0x00000008; +pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010; +pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020; +pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040; +pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080; +pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000; +pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000; +pub const PTRACE_O_MASK: ::c_int = 0x003000ff; + +// Wait extended result codes for the above trace options. +pub const PTRACE_EVENT_FORK: ::c_int = 1; +pub const PTRACE_EVENT_VFORK: ::c_int = 2; +pub const PTRACE_EVENT_CLONE: ::c_int = 3; +pub const PTRACE_EVENT_EXEC: ::c_int = 4; +pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5; +pub const PTRACE_EVENT_EXIT: ::c_int = 6; +pub const PTRACE_EVENT_SECCOMP: ::c_int = 7; + +pub const __WNOTHREAD: ::c_int = 0x20000000; +pub const __WALL: ::c_int = 0x40000000; +pub const __WCLONE: ::c_int = 0x80000000; + +pub const SPLICE_F_MOVE: ::c_uint = 0x01; +pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02; +pub const SPLICE_F_MORE: ::c_uint = 0x04; +pub const SPLICE_F_GIFT: ::c_uint = 0x08; + +pub const RTLD_LOCAL: ::c_int = 0; +pub const RTLD_LAZY: ::c_int = 1; + +pub const POSIX_FADV_NORMAL: ::c_int = 0; +pub const POSIX_FADV_RANDOM: ::c_int = 1; +pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_FADV_WILLNEED: ::c_int = 3; + +pub const AT_FDCWD: ::c_int = -100; +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100; +pub const AT_REMOVEDIR: ::c_int = 0x200; +pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400; +pub const AT_NO_AUTOMOUNT: ::c_int = 0x800; +pub const AT_EMPTY_PATH: ::c_int = 0x1000; + +pub const LOG_CRON: ::c_int = 9 << 3; +pub const LOG_AUTHPRIV: ::c_int = 10 << 3; +pub const LOG_FTP: ::c_int = 11 << 3; +pub const LOG_PERROR: ::c_int = 0x20; + +pub const PIPE_BUF: usize = 4096; + +pub const SI_LOAD_SHIFT: ::c_uint = 16; + +// si_code values for SIGBUS signal +pub const BUS_ADRALN: ::c_int = 1; +pub const BUS_ADRERR: ::c_int = 2; +pub const BUS_OBJERR: ::c_int = 3; +// Linux-specific si_code values for SIGBUS signal +pub const BUS_MCEERR_AR: ::c_int = 4; +pub const BUS_MCEERR_AO: ::c_int = 5; + +// si_code values for SIGCHLD signal +pub const CLD_EXITED: ::c_int = 1; +pub const CLD_KILLED: ::c_int = 2; +pub const CLD_DUMPED: ::c_int = 3; +pub const CLD_TRAPPED: ::c_int = 4; +pub const CLD_STOPPED: ::c_int = 5; +pub const CLD_CONTINUED: ::c_int = 6; + +pub const SIGEV_SIGNAL: ::c_int = 0; +pub const SIGEV_NONE: ::c_int = 1; +pub const SIGEV_THREAD: ::c_int = 2; + +pub const P_ALL: idtype_t = 0; +pub const P_PID: idtype_t = 1; +pub const P_PGID: idtype_t = 2; +cfg_if! { + if #[cfg(not(target_os = "emscripten"))] { + pub const P_PIDFD: idtype_t = 3; + } +} + +pub const UTIME_OMIT: c_long = 1073741822; +pub const UTIME_NOW: c_long = 1073741823; + +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; +pub const POLLRDNORM: ::c_short = 0x040; +pub const POLLRDBAND: ::c_short = 0x080; +#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))] +pub const POLLRDHUP: ::c_short = 0x2000; +#[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] +pub const POLLRDHUP: ::c_short = 0x800; + +pub const IPTOS_LOWDELAY: u8 = 0x10; +pub const IPTOS_THROUGHPUT: u8 = 0x08; +pub const IPTOS_RELIABILITY: u8 = 0x04; +pub const IPTOS_MINCOST: u8 = 0x02; + +pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0; +pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0; +pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0; +pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80; +pub const IPTOS_PREC_FLASH: u8 = 0x60; +pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40; +pub const IPTOS_PREC_PRIORITY: u8 = 0x20; +pub const IPTOS_PREC_ROUTINE: u8 = 0x00; + +pub const IPTOS_ECN_MASK: u8 = 0x03; +pub const IPTOS_ECN_ECT1: u8 = 0x01; +pub const IPTOS_ECN_ECT0: u8 = 0x02; +pub const IPTOS_ECN_CE: u8 = 0x03; + +pub const IPOPT_COPY: u8 = 0x80; +pub const IPOPT_CLASS_MASK: u8 = 0x60; +pub const IPOPT_NUMBER_MASK: u8 = 0x1f; + +pub const IPOPT_CONTROL: u8 = 0x00; +pub const IPOPT_RESERVED1: u8 = 0x20; +pub const IPOPT_MEASUREMENT: u8 = 0x40; +pub const IPOPT_RESERVED2: u8 = 0x60; +pub const IPOPT_END: u8 = 0 | IPOPT_CONTROL; +pub const IPOPT_NOOP: u8 = 1 | IPOPT_CONTROL; +pub const IPOPT_SEC: u8 = 2 | IPOPT_CONTROL | IPOPT_COPY; +pub const IPOPT_LSRR: u8 = 3 | IPOPT_CONTROL | IPOPT_COPY; +pub const IPOPT_TIMESTAMP: u8 = 4 | IPOPT_MEASUREMENT; +pub const IPOPT_RR: u8 = 7 | IPOPT_CONTROL; +pub const IPOPT_SID: u8 = 8 | IPOPT_CONTROL | IPOPT_COPY; +pub const IPOPT_SSRR: u8 = 9 | IPOPT_CONTROL | IPOPT_COPY; +pub const IPOPT_RA: u8 = 20 | IPOPT_CONTROL | IPOPT_COPY; +pub const IPVERSION: u8 = 4; +pub const MAXTTL: u8 = 255; +pub const IPDEFTTL: u8 = 64; +pub const IPOPT_OPTVAL: u8 = 0; +pub const IPOPT_OLEN: u8 = 1; +pub const IPOPT_OFFSET: u8 = 2; +pub const IPOPT_MINOFF: u8 = 4; +pub const MAX_IPOPTLEN: u8 = 40; +pub const IPOPT_NOP: u8 = IPOPT_NOOP; +pub const IPOPT_EOL: u8 = IPOPT_END; +pub const IPOPT_TS: u8 = IPOPT_TIMESTAMP; +pub const IPOPT_TS_TSONLY: u8 = 0; +pub const IPOPT_TS_TSANDADDR: u8 = 1; +pub const IPOPT_TS_PRESPEC: u8 = 3; + +pub const ARPOP_RREQUEST: u16 = 3; +pub const ARPOP_RREPLY: u16 = 4; +pub const ARPOP_InREQUEST: u16 = 8; +pub const ARPOP_InREPLY: u16 = 9; +pub const ARPOP_NAK: u16 = 10; + +pub const ATF_NETMASK: ::c_int = 0x20; +pub const ATF_DONTPUB: ::c_int = 0x40; + +pub const ARPHRD_NETROM: u16 = 0; +pub const ARPHRD_ETHER: u16 = 1; +pub const ARPHRD_EETHER: u16 = 2; +pub const ARPHRD_AX25: u16 = 3; +pub const ARPHRD_PRONET: u16 = 4; +pub const ARPHRD_CHAOS: u16 = 5; +pub const ARPHRD_IEEE802: u16 = 6; +pub const ARPHRD_ARCNET: u16 = 7; +pub const ARPHRD_APPLETLK: u16 = 8; +pub const ARPHRD_DLCI: u16 = 15; +pub const ARPHRD_ATM: u16 = 19; +pub const ARPHRD_METRICOM: u16 = 23; +pub const ARPHRD_IEEE1394: u16 = 24; +pub const ARPHRD_EUI64: u16 = 27; +pub const ARPHRD_INFINIBAND: u16 = 32; + +pub const ARPHRD_SLIP: u16 = 256; +pub const ARPHRD_CSLIP: u16 = 257; +pub const ARPHRD_SLIP6: u16 = 258; +pub const ARPHRD_CSLIP6: u16 = 259; +pub const ARPHRD_RSRVD: u16 = 260; +pub const ARPHRD_ADAPT: u16 = 264; +pub const ARPHRD_ROSE: u16 = 270; +pub const ARPHRD_X25: u16 = 271; +pub const ARPHRD_HWX25: u16 = 272; +pub const ARPHRD_CAN: u16 = 280; +pub const ARPHRD_PPP: u16 = 512; +pub const ARPHRD_CISCO: u16 = 513; +pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO; +pub const ARPHRD_LAPB: u16 = 516; +pub const ARPHRD_DDCMP: u16 = 517; +pub const ARPHRD_RAWHDLC: u16 = 518; + +pub const ARPHRD_TUNNEL: u16 = 768; +pub const ARPHRD_TUNNEL6: u16 = 769; +pub const ARPHRD_FRAD: u16 = 770; +pub const ARPHRD_SKIP: u16 = 771; +pub const ARPHRD_LOOPBACK: u16 = 772; +pub const ARPHRD_LOCALTLK: u16 = 773; +pub const ARPHRD_FDDI: u16 = 774; +pub const ARPHRD_BIF: u16 = 775; +pub const ARPHRD_SIT: u16 = 776; +pub const ARPHRD_IPDDP: u16 = 777; +pub const ARPHRD_IPGRE: u16 = 778; +pub const ARPHRD_PIMREG: u16 = 779; +pub const ARPHRD_HIPPI: u16 = 780; +pub const ARPHRD_ASH: u16 = 781; +pub const ARPHRD_ECONET: u16 = 782; +pub const ARPHRD_IRDA: u16 = 783; +pub const ARPHRD_FCPP: u16 = 784; +pub const ARPHRD_FCAL: u16 = 785; +pub const ARPHRD_FCPL: u16 = 786; +pub const ARPHRD_FCFABRIC: u16 = 787; +pub const ARPHRD_IEEE802_TR: u16 = 800; +pub const ARPHRD_IEEE80211: u16 = 801; +pub const ARPHRD_IEEE80211_PRISM: u16 = 802; +pub const ARPHRD_IEEE80211_RADIOTAP: u16 = 803; +pub const ARPHRD_IEEE802154: u16 = 804; + +pub const ARPHRD_VOID: u16 = 0xFFFF; +pub const ARPHRD_NONE: u16 = 0xFFFE; + +cfg_if! { + if #[cfg(target_os = "emscripten")] { + // Emscripten does not define any `*_SUPER_MAGIC` constants. + } else if #[cfg(not(target_arch = "s390x"))] { + pub const ADFS_SUPER_MAGIC: ::c_long = 0x0000adf5; + pub const AFFS_SUPER_MAGIC: ::c_long = 0x0000adff; + pub const AFS_SUPER_MAGIC: ::c_long = 0x5346414f; + pub const AUTOFS_SUPER_MAGIC: ::c_long = 0x0187; + pub const BPF_FS_MAGIC: ::c_long = 0xcafe4a11; + pub const BTRFS_SUPER_MAGIC: ::c_long = 0x9123683e; + pub const CGROUP2_SUPER_MAGIC: ::c_long = 0x63677270; + pub const CGROUP_SUPER_MAGIC: ::c_long = 0x27e0eb; + pub const CODA_SUPER_MAGIC: ::c_long = 0x73757245; + pub const CRAMFS_MAGIC: ::c_long = 0x28cd3d45; + pub const DEBUGFS_MAGIC: ::c_long = 0x64626720; + pub const DEVPTS_SUPER_MAGIC: ::c_long = 0x1cd1; + pub const ECRYPTFS_SUPER_MAGIC: ::c_long = 0xf15f; + pub const EFS_SUPER_MAGIC: ::c_long = 0x00414a53; + pub const EXT2_SUPER_MAGIC: ::c_long = 0x0000ef53; + pub const EXT3_SUPER_MAGIC: ::c_long = 0x0000ef53; + pub const EXT4_SUPER_MAGIC: ::c_long = 0x0000ef53; + pub const F2FS_SUPER_MAGIC: ::c_long = 0xf2f52010; + pub const FUSE_SUPER_MAGIC: ::c_long = 0x65735546; + pub const FUTEXFS_SUPER_MAGIC: ::c_long = 0xbad1dea; + pub const HOSTFS_SUPER_MAGIC: ::c_long = 0x00c0ffee; + pub const HPFS_SUPER_MAGIC: ::c_long = 0xf995e849; + pub const HUGETLBFS_MAGIC: ::c_long = 0x958458f6; + pub const ISOFS_SUPER_MAGIC: ::c_long = 0x00009660; + pub const JFFS2_SUPER_MAGIC: ::c_long = 0x000072b6; + pub const MINIX2_SUPER_MAGIC2: ::c_long = 0x00002478; + pub const MINIX2_SUPER_MAGIC: ::c_long = 0x00002468; + pub const MINIX3_SUPER_MAGIC: ::c_long = 0x4d5a; + pub const MINIX_SUPER_MAGIC2: ::c_long = 0x0000138f; + pub const MINIX_SUPER_MAGIC: ::c_long = 0x0000137f; + pub const MSDOS_SUPER_MAGIC: ::c_long = 0x00004d44; + pub const NCP_SUPER_MAGIC: ::c_long = 0x0000564c; + pub const NFS_SUPER_MAGIC: ::c_long = 0x00006969; + pub const NILFS_SUPER_MAGIC: ::c_long = 0x3434; + pub const OCFS2_SUPER_MAGIC: ::c_long = 0x7461636f; + pub const OPENPROM_SUPER_MAGIC: ::c_long = 0x00009fa1; + pub const OVERLAYFS_SUPER_MAGIC: ::c_long = 0x794c7630; + pub const PROC_SUPER_MAGIC: ::c_long = 0x00009fa0; + pub const QNX4_SUPER_MAGIC: ::c_long = 0x0000002f; + pub const QNX6_SUPER_MAGIC: ::c_long = 0x68191122; + pub const RDTGROUP_SUPER_MAGIC: ::c_long = 0x7655821; + pub const REISERFS_SUPER_MAGIC: ::c_long = 0x52654973; + pub const SECURITYFS_MAGIC: ::c_long = 0x73636673; + pub const SELINUX_MAGIC: ::c_long = 0xf97cff8c; + pub const SMACK_MAGIC: ::c_long = 0x43415d53; + pub const SMB_SUPER_MAGIC: ::c_long = 0x0000517b; + pub const SYSFS_MAGIC: ::c_long = 0x62656572; + pub const TMPFS_MAGIC: ::c_long = 0x01021994; + pub const TRACEFS_MAGIC: ::c_long = 0x74726163; + pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346; + pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2; + pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974; + } else if #[cfg(target_arch = "s390x")] { + pub const ADFS_SUPER_MAGIC: ::c_uint = 0x0000adf5; + pub const AFFS_SUPER_MAGIC: ::c_uint = 0x0000adff; + pub const AFS_SUPER_MAGIC: ::c_uint = 0x5346414f; + pub const AUTOFS_SUPER_MAGIC: ::c_uint = 0x0187; + pub const BPF_FS_MAGIC: ::c_uint = 0xcafe4a11; + pub const BTRFS_SUPER_MAGIC: ::c_uint = 0x9123683e; + pub const CGROUP2_SUPER_MAGIC: ::c_uint = 0x63677270; + pub const CGROUP_SUPER_MAGIC: ::c_uint = 0x27e0eb; + pub const CODA_SUPER_MAGIC: ::c_uint = 0x73757245; + pub const CRAMFS_MAGIC: ::c_uint = 0x28cd3d45; + pub const DEBUGFS_MAGIC: ::c_uint = 0x64626720; + pub const DEVPTS_SUPER_MAGIC: ::c_uint = 0x1cd1; + pub const ECRYPTFS_SUPER_MAGIC: ::c_uint = 0xf15f; + pub const EFS_SUPER_MAGIC: ::c_uint = 0x00414a53; + pub const EXT2_SUPER_MAGIC: ::c_uint = 0x0000ef53; + pub const EXT3_SUPER_MAGIC: ::c_uint = 0x0000ef53; + pub const EXT4_SUPER_MAGIC: ::c_uint = 0x0000ef53; + pub const F2FS_SUPER_MAGIC: ::c_uint = 0xf2f52010; + pub const FUSE_SUPER_MAGIC: ::c_uint = 0x65735546; + pub const FUTEXFS_SUPER_MAGIC: ::c_uint = 0xbad1dea; + pub const HOSTFS_SUPER_MAGIC: ::c_uint = 0x00c0ffee; + pub const HPFS_SUPER_MAGIC: ::c_uint = 0xf995e849; + pub const HUGETLBFS_MAGIC: ::c_uint = 0x958458f6; + pub const ISOFS_SUPER_MAGIC: ::c_uint = 0x00009660; + pub const JFFS2_SUPER_MAGIC: ::c_uint = 0x000072b6; + pub const MINIX2_SUPER_MAGIC2: ::c_uint = 0x00002478; + pub const MINIX2_SUPER_MAGIC: ::c_uint = 0x00002468; + pub const MINIX3_SUPER_MAGIC: ::c_uint = 0x4d5a; + pub const MINIX_SUPER_MAGIC2: ::c_uint = 0x0000138f; + pub const MINIX_SUPER_MAGIC: ::c_uint = 0x0000137f; + pub const MSDOS_SUPER_MAGIC: ::c_uint = 0x00004d44; + pub const NCP_SUPER_MAGIC: ::c_uint = 0x0000564c; + pub const NFS_SUPER_MAGIC: ::c_uint = 0x00006969; + pub const NILFS_SUPER_MAGIC: ::c_uint = 0x3434; + pub const OCFS2_SUPER_MAGIC: ::c_uint = 0x7461636f; + pub const OPENPROM_SUPER_MAGIC: ::c_uint = 0x00009fa1; + pub const OVERLAYFS_SUPER_MAGIC: ::c_uint = 0x794c7630; + pub const PROC_SUPER_MAGIC: ::c_uint = 0x00009fa0; + pub const QNX4_SUPER_MAGIC: ::c_uint = 0x0000002f; + pub const QNX6_SUPER_MAGIC: ::c_uint = 0x68191122; + pub const RDTGROUP_SUPER_MAGIC: ::c_uint = 0x7655821; + pub const REISERFS_SUPER_MAGIC: ::c_uint = 0x52654973; + pub const SECURITYFS_MAGIC: ::c_uint = 0x73636673; + pub const SELINUX_MAGIC: ::c_uint = 0xf97cff8c; + pub const SMACK_MAGIC: ::c_uint = 0x43415d53; + pub const SMB_SUPER_MAGIC: ::c_uint = 0x0000517b; + pub const SYSFS_MAGIC: ::c_uint = 0x62656572; + pub const TMPFS_MAGIC: ::c_uint = 0x01021994; + pub const TRACEFS_MAGIC: ::c_uint = 0x74726163; + pub const UDF_SUPER_MAGIC: ::c_uint = 0x15013346; + pub const USBDEVICE_SUPER_MAGIC: ::c_uint = 0x00009fa2; + pub const XENFS_SUPER_MAGIC: ::c_uint = 0xabba1974; + } +} + +const_fn! { + {const} fn CMSG_ALIGN(len: usize) -> usize { + len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) + } +} + +f! { + pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { + if (*mhdr).msg_controllen as usize >= ::mem::size_of::() { + (*mhdr).msg_control as *mut cmsghdr + } else { + 0 as *mut cmsghdr + } + } + + pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut ::c_uchar { + cmsg.offset(1) as *mut ::c_uchar + } + + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::())) + as ::c_uint + } + + pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + CMSG_ALIGN(::mem::size_of::()) as ::c_uint + length + } + + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + (*set).fds_bits[fd / size] &= !(1 << (fd % size)); + return + } + + pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0 + } + + pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + (*set).fds_bits[fd / size] |= 1 << (fd % size); + return + } + + pub fn FD_ZERO(set: *mut fd_set) -> () { + for slot in (*set).fds_bits.iter_mut() { + *slot = 0; + } + } +} + +safe_f! { + pub fn SIGRTMAX() -> ::c_int { + unsafe { __libc_current_sigrtmax() } + } + + pub fn SIGRTMIN() -> ::c_int { + unsafe { __libc_current_sigrtmin() } + } + + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { + (status & 0xff) == 0x7f + } + + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { + (status >> 8) & 0xff + } + + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + status == 0xffff + } + + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + ((status & 0x7f) + 1) as i8 >= 2 + } + + pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int { + status & 0x7f + } + + pub {const} fn WIFEXITED(status: ::c_int) -> bool { + (status & 0x7f) == 0 + } + + pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int { + (status >> 8) & 0xff + } + + pub {const} fn WCOREDUMP(status: ::c_int) -> bool { + (status & 0x80) != 0 + } + + pub {const} fn W_EXITCODE(ret: ::c_int, sig: ::c_int) -> ::c_int { + (ret << 8) | sig + } + + pub {const} fn W_STOPCODE(sig: ::c_int) -> ::c_int { + (sig << 8) | 0x7f + } + + pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int { + (cmd << 8) | (type_ & 0x00ff) + } + + pub {const} fn IPOPT_COPIED(o: u8) -> u8 { + o & IPOPT_COPY + } + + pub {const} fn IPOPT_CLASS(o: u8) -> u8 { + o & IPOPT_CLASS_MASK + } + + pub {const} fn IPOPT_NUMBER(o: u8) -> u8 { + o & IPOPT_NUMBER_MASK + } + + pub {const} fn IPTOS_ECN(x: u8) -> u8 { + x & ::IPTOS_ECN_MASK + } +} + +extern "C" { + #[doc(hidden)] + pub fn __libc_current_sigrtmax() -> ::c_int; + #[doc(hidden)] + pub fn __libc_current_sigrtmin() -> ::c_int; + + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; + pub fn fdatasync(fd: ::c_int) -> ::c_int; + pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_uchar) -> ::c_int; + + pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; + pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int; + + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + + pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_attr_getstack( + attr: *const ::pthread_attr_t, + stackaddr: *mut *mut ::c_void, + stacksize: *mut ::size_t, + ) -> ::c_int; + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; + pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int; + pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int; + pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int; + pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int; + pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int; + pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int; + pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void; + + pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int; + pub fn posix_fadvise64( + fd: ::c_int, + offset: ::off64_t, + len: ::off64_t, + advise: ::c_int, + ) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + pub fn utimensat( + dirfd: ::c_int, + path: *const ::c_char, + times: *const ::timespec, + flag: ::c_int, + ) -> ::c_int; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t); + pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; + pub fn uselocale(loc: ::locale_t) -> ::locale_t; + pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int; + pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int; + pub fn fstatat64( + dirfd: ::c_int, + pathname: *const c_char, + buf: *mut stat64, + flags: ::c_int, + ) -> ::c_int; + pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int; + pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t; + pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int; + pub fn mmap64( + addr: *mut ::c_void, + len: ::size_t, + prot: ::c_int, + flags: ::c_int, + fd: ::c_int, + offset: off64_t, + ) -> *mut ::c_void; + pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; + pub fn openat64(fd: ::c_int, path: *const c_char, oflag: ::c_int, ...) -> ::c_int; + pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t; + pub fn pwrite64( + fd: ::c_int, + buf: *const ::c_void, + count: ::size_t, + offset: off64_t, + ) -> ::ssize_t; + pub fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64; + pub fn readdir64_r( + dirp: *mut ::DIR, + entry: *mut ::dirent64, + result: *mut *mut ::dirent64, + ) -> ::c_int; + pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int; + pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int; + + pub fn mknodat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::mode_t, + dev: dev_t, + ) -> ::c_int; + pub fn pthread_condattr_getclock( + attr: *const pthread_condattr_t, + clock_id: *mut clockid_t, + ) -> ::c_int; + pub fn pthread_condattr_setclock( + attr: *mut pthread_condattr_t, + clock_id: ::clockid_t, + ) -> ::c_int; + pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_mutexattr_setpshared( + attr: *mut pthread_mutexattr_t, + pshared: ::c_int, + ) -> ::c_int; + pub fn pthread_rwlockattr_getpshared( + attr: *const pthread_rwlockattr_t, + val: *mut ::c_int, + ) -> ::c_int; + pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int; + pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int; + pub fn clearenv() -> ::c_int; + pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) + -> ::c_int; + pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int; + pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int; + pub fn acct(filename: *const ::c_char) -> ::c_int; + pub fn brk(addr: *mut ::c_void) -> ::c_int; + pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void; + #[deprecated( + since = "0.2.66", + note = "causes memory corruption, see rust-lang/libc#1596" + )] + pub fn vfork() -> ::pid_t; + pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int; + pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int; + pub fn wait4( + pid: ::pid_t, + status: *mut ::c_int, + options: ::c_int, + rusage: *mut ::rusage, + ) -> ::pid_t; + pub fn login_tty(fd: ::c_int) -> ::c_int; + pub fn execvpe( + file: *const ::c_char, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + pub fn fexecve( + fd: ::c_int, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int; + pub fn freeifaddrs(ifa: *mut ::ifaddrs); + pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int; + + pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + + pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t; + pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; + pub fn uname(buf: *mut ::utsname) -> ::c_int; +} + +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + extern "C" { + pub fn preadv64( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off64_t, + ) -> ::ssize_t; + pub fn pwritev64( + fd: ::c_int, + iov: *const ::iovec, + iovcnt: ::c_int, + offset: ::off64_t, + ) -> ::ssize_t; + // uclibc has separate non-const version of this function + pub fn forkpty( + amaster: *mut ::c_int, + name: *mut ::c_char, + termp: *const termios, + winp: *const ::winsize, + ) -> ::pid_t; + // uclibc has separate non-const version of this function + pub fn openpty( + amaster: *mut ::c_int, + aslave: *mut ::c_int, + name: *mut ::c_char, + termp: *const termios, + winp: *const ::winsize, + ) -> ::c_int; + } + } +} + +cfg_if! { + if #[cfg(target_os = "emscripten")] { + mod emscripten; + pub use self::emscripten::*; + } else if #[cfg(target_os = "linux")] { + mod linux; + pub use self::linux::*; + } else if #[cfg(target_os = "l4re")] { + mod linux; + pub use self::linux::*; + } else if #[cfg(target_os = "android")] { + mod android; + pub use self::android::*; + } else { + // Unknown target_os + } +} diff --git a/bash-5.1/vendor/libc/src/unix/mod.rs b/bash-5.1/vendor/libc/src/unix/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..ecc693e3db10531d1621cb872eab51f63a1b8ec0 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/mod.rs @@ -0,0 +1,1539 @@ +//! Definitions found commonly among almost all Unix derivatives +//! +//! More functions and definitions can be found in the more specific modules +//! according to the platform in question. + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_float = f32; +pub type c_double = f64; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; + +pub type size_t = usize; +pub type ptrdiff_t = isize; +pub type intptr_t = isize; +pub type uintptr_t = usize; +pub type ssize_t = isize; + +pub type pid_t = i32; +pub type in_addr_t = u32; +pub type in_port_t = u16; +pub type sighandler_t = ::size_t; +pub type cc_t = ::c_uchar; + +cfg_if! { + if #[cfg(any(target_os = "espidf", target_os = "horizon"))] { + pub type uid_t = ::c_ushort; + pub type gid_t = ::c_ushort; + } else { + pub type uid_t = u32; + pub type gid_t = u32; + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum DIR {} +impl ::Copy for DIR {} +impl ::Clone for DIR { + fn clone(&self) -> DIR { + *self + } +} +pub type locale_t = *mut ::c_void; + +s! { + pub struct group { + pub gr_name: *mut ::c_char, + pub gr_passwd: *mut ::c_char, + pub gr_gid: ::gid_t, + pub gr_mem: *mut *mut ::c_char, + } + + pub struct utimbuf { + pub actime: time_t, + pub modtime: time_t, + } + + pub struct timeval { + pub tv_sec: time_t, + pub tv_usec: suseconds_t, + } + + // linux x32 compatibility + // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 + pub struct timespec { + pub tv_sec: time_t, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + pub tv_nsec: i64, + #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] + pub tv_nsec: ::c_long, + } + + pub struct rlimit { + pub rlim_cur: rlim_t, + pub rlim_max: rlim_t, + } + + pub struct rusage { + pub ru_utime: timeval, + pub ru_stime: timeval, + pub ru_maxrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad1: u32, + pub ru_ixrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad2: u32, + pub ru_idrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad3: u32, + pub ru_isrss: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad4: u32, + pub ru_minflt: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad5: u32, + pub ru_majflt: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad6: u32, + pub ru_nswap: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad7: u32, + pub ru_inblock: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad8: u32, + pub ru_oublock: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad9: u32, + pub ru_msgsnd: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad10: u32, + pub ru_msgrcv: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad11: u32, + pub ru_nsignals: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad12: u32, + pub ru_nvcsw: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad13: u32, + pub ru_nivcsw: c_long, + #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] + __pad14: u32, + + #[cfg(any(target_env = "musl", target_os = "emscripten"))] + __reserved: [c_long; 16], + } + + pub struct ipv6_mreq { + pub ipv6mr_multiaddr: in6_addr, + #[cfg(target_os = "android")] + pub ipv6mr_interface: ::c_int, + #[cfg(not(target_os = "android"))] + pub ipv6mr_interface: ::c_uint, + } + + pub struct hostent { + pub h_name: *mut ::c_char, + pub h_aliases: *mut *mut ::c_char, + pub h_addrtype: ::c_int, + pub h_length: ::c_int, + pub h_addr_list: *mut *mut ::c_char, + } + + pub struct iovec { + pub iov_base: *mut ::c_void, + pub iov_len: ::size_t, + } + + pub struct pollfd { + pub fd: ::c_int, + pub events: ::c_short, + pub revents: ::c_short, + } + + pub struct winsize { + pub ws_row: ::c_ushort, + pub ws_col: ::c_ushort, + pub ws_xpixel: ::c_ushort, + pub ws_ypixel: ::c_ushort, + } + + pub struct linger { + pub l_onoff: ::c_int, + pub l_linger: ::c_int, + } + + pub struct sigval { + // Actually a union of an int and a void* + pub sival_ptr: *mut ::c_void + } + + // + pub struct itimerval { + pub it_interval: ::timeval, + pub it_value: ::timeval, + } + + // + pub struct tms { + pub tms_utime: ::clock_t, + pub tms_stime: ::clock_t, + pub tms_cutime: ::clock_t, + pub tms_cstime: ::clock_t, + } + + pub struct servent { + pub s_name: *mut ::c_char, + pub s_aliases: *mut *mut ::c_char, + pub s_port: ::c_int, + pub s_proto: *mut ::c_char, + } + + pub struct protoent { + pub p_name: *mut ::c_char, + pub p_aliases: *mut *mut ::c_char, + pub p_proto: ::c_int, + } +} + +pub const INT_MIN: c_int = -2147483648; +pub const INT_MAX: c_int = 2147483647; + +pub const SIG_DFL: sighandler_t = 0 as sighandler_t; +pub const SIG_IGN: sighandler_t = 1 as sighandler_t; +pub const SIG_ERR: sighandler_t = !0 as sighandler_t; + +pub const DT_UNKNOWN: u8 = 0; +pub const DT_FIFO: u8 = 1; +pub const DT_CHR: u8 = 2; +pub const DT_DIR: u8 = 4; +pub const DT_BLK: u8 = 6; +pub const DT_REG: u8 = 8; +pub const DT_LNK: u8 = 10; +pub const DT_SOCK: u8 = 12; + +cfg_if! { + if #[cfg(not(target_os = "redox"))] { + pub const FD_CLOEXEC: ::c_int = 0x1; + } +} + +pub const USRQUOTA: ::c_int = 0; +pub const GRPQUOTA: ::c_int = 1; + +pub const SIGIOT: ::c_int = 6; + +pub const S_ISUID: ::mode_t = 0x800; +pub const S_ISGID: ::mode_t = 0x400; +pub const S_ISVTX: ::mode_t = 0x200; + +cfg_if! { + if #[cfg(not(any(target_os = "haiku", target_os = "illumos", + target_os = "solaris")))] { + pub const IF_NAMESIZE: ::size_t = 16; + pub const IFNAMSIZ: ::size_t = IF_NAMESIZE; + } +} + +pub const LOG_EMERG: ::c_int = 0; +pub const LOG_ALERT: ::c_int = 1; +pub const LOG_CRIT: ::c_int = 2; +pub const LOG_ERR: ::c_int = 3; +pub const LOG_WARNING: ::c_int = 4; +pub const LOG_NOTICE: ::c_int = 5; +pub const LOG_INFO: ::c_int = 6; +pub const LOG_DEBUG: ::c_int = 7; + +pub const LOG_KERN: ::c_int = 0; +pub const LOG_USER: ::c_int = 1 << 3; +pub const LOG_MAIL: ::c_int = 2 << 3; +pub const LOG_DAEMON: ::c_int = 3 << 3; +pub const LOG_AUTH: ::c_int = 4 << 3; +pub const LOG_SYSLOG: ::c_int = 5 << 3; +pub const LOG_LPR: ::c_int = 6 << 3; +pub const LOG_NEWS: ::c_int = 7 << 3; +pub const LOG_UUCP: ::c_int = 8 << 3; +pub const LOG_LOCAL0: ::c_int = 16 << 3; +pub const LOG_LOCAL1: ::c_int = 17 << 3; +pub const LOG_LOCAL2: ::c_int = 18 << 3; +pub const LOG_LOCAL3: ::c_int = 19 << 3; +pub const LOG_LOCAL4: ::c_int = 20 << 3; +pub const LOG_LOCAL5: ::c_int = 21 << 3; +pub const LOG_LOCAL6: ::c_int = 22 << 3; +pub const LOG_LOCAL7: ::c_int = 23 << 3; + +cfg_if! { + if #[cfg(not(target_os = "haiku"))] { + pub const LOG_PID: ::c_int = 0x01; + pub const LOG_CONS: ::c_int = 0x02; + pub const LOG_ODELAY: ::c_int = 0x04; + pub const LOG_NDELAY: ::c_int = 0x08; + pub const LOG_NOWAIT: ::c_int = 0x10; + } +} +pub const LOG_PRIMASK: ::c_int = 7; +pub const LOG_FACMASK: ::c_int = 0x3f8; + +pub const PRIO_MIN: ::c_int = -20; +pub const PRIO_MAX: ::c_int = 20; + +pub const IPPROTO_ICMP: ::c_int = 1; +pub const IPPROTO_ICMPV6: ::c_int = 58; +pub const IPPROTO_TCP: ::c_int = 6; +pub const IPPROTO_UDP: ::c_int = 17; +pub const IPPROTO_IP: ::c_int = 0; +pub const IPPROTO_IPV6: ::c_int = 41; + +pub const INADDR_LOOPBACK: in_addr_t = 2130706433; +pub const INADDR_ANY: in_addr_t = 0; +pub const INADDR_BROADCAST: in_addr_t = 4294967295; +pub const INADDR_NONE: in_addr_t = 4294967295; + +pub const ARPOP_REQUEST: u16 = 1; +pub const ARPOP_REPLY: u16 = 2; + +pub const ATF_COM: ::c_int = 0x02; +pub const ATF_PERM: ::c_int = 0x04; +pub const ATF_PUBL: ::c_int = 0x08; +pub const ATF_USETRAILERS: ::c_int = 0x10; + +cfg_if! { + if #[cfg(any(target_os = "l4re", target_os = "espidf"))] { + // required libraries for L4Re and the ESP-IDF framework are linked externally, ATM + } else if #[cfg(feature = "std")] { + // cargo build, don't pull in anything extra as the libstd dep + // already pulls in all libs. + } else if #[cfg(all(target_os = "linux", + any(target_env = "gnu", target_env = "uclibc"), + feature = "rustc-dep-of-std"))] { + #[link(name = "util", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static"))] + #[link(name = "rt", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static"))] + #[link(name = "pthread", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static"))] + #[link(name = "m", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static"))] + #[link(name = "dl", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static"))] + #[link(name = "c", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static"))] + #[link(name = "gcc_eh", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static"))] + #[link(name = "gcc", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static"))] + #[link(name = "util", cfg(not(target_feature = "crt-static")))] + #[link(name = "rt", cfg(not(target_feature = "crt-static")))] + #[link(name = "pthread", cfg(not(target_feature = "crt-static")))] + #[link(name = "m", cfg(not(target_feature = "crt-static")))] + #[link(name = "dl", cfg(not(target_feature = "crt-static")))] + #[link(name = "c", cfg(not(target_feature = "crt-static")))] + extern {} + } else if #[cfg(target_env = "musl")] { + #[cfg_attr(feature = "rustc-dep-of-std", + link(name = "c", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static")))] + #[cfg_attr(feature = "rustc-dep-of-std", + link(name = "c", cfg(not(target_feature = "crt-static"))))] + extern {} + } else if #[cfg(target_os = "emscripten")] { + #[link(name = "c")] + extern {} + } else if #[cfg(all(target_os = "android", feature = "rustc-dep-of-std"))] { + #[link(name = "c", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static"))] + #[link(name = "m", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static"))] + #[link(name = "m", cfg(not(target_feature = "crt-static")))] + #[link(name = "c", cfg(not(target_feature = "crt-static")))] + extern {} + } else if #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "watchos", + target_os = "android", + target_os = "openbsd"))] { + #[link(name = "c")] + #[link(name = "m")] + extern {} + } else if #[cfg(target_os = "haiku")] { + #[link(name = "root")] + #[link(name = "network")] + extern {} + } else if #[cfg(target_env = "newlib")] { + #[link(name = "c")] + #[link(name = "m")] + extern {} + } else if #[cfg(target_os = "hermit")] { + // no_default_libraries is set to false for HermitCore, so only a link + // to "pthread" needs to be added. + #[link(name = "pthread")] + extern {} + } else if #[cfg(target_env = "illumos")] { + #[link(name = "c")] + #[link(name = "m")] + extern {} + } else if #[cfg(target_os = "redox")] { + #[cfg_attr(feature = "rustc-dep-of-std", + link(name = "c", kind = "static", modifiers = "-bundle", + cfg(target_feature = "crt-static")))] + #[cfg_attr(feature = "rustc-dep-of-std", + link(name = "c", cfg(not(target_feature = "crt-static"))))] + extern {} + } else { + #[link(name = "c")] + #[link(name = "m")] + #[link(name = "rt")] + #[link(name = "pthread")] + extern {} + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum FILE {} +impl ::Copy for FILE {} +impl ::Clone for FILE { + fn clone(&self) -> FILE { + *self + } +} +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum fpos_t {} // FIXME: fill this out with a struct +impl ::Copy for fpos_t {} +impl ::Clone for fpos_t { + fn clone(&self) -> fpos_t { + *self + } +} + +extern "C" { + pub fn isalnum(c: c_int) -> c_int; + pub fn isalpha(c: c_int) -> c_int; + pub fn iscntrl(c: c_int) -> c_int; + pub fn isdigit(c: c_int) -> c_int; + pub fn isgraph(c: c_int) -> c_int; + pub fn islower(c: c_int) -> c_int; + pub fn isprint(c: c_int) -> c_int; + pub fn ispunct(c: c_int) -> c_int; + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; + pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; + pub fn qsort( + base: *mut c_void, + num: size_t, + size: size_t, + compar: ::Option c_int>, + ); + pub fn bsearch( + key: *const c_void, + base: *const c_void, + num: size_t, + size: size_t, + compar: ::Option c_int>, + ) -> *mut c_void; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fopen$UNIX2003" + )] + pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "freopen$UNIX2003" + )] + pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE; + pub fn fmemopen(buf: *mut c_void, size: size_t, mode: *const c_char) -> *mut FILE; + pub fn open_memstream(ptr: *mut *mut c_char, sizeloc: *mut size_t) -> *mut FILE; + + pub fn fflush(file: *mut FILE) -> c_int; + pub fn fclose(file: *mut FILE) -> c_int; + pub fn remove(filename: *const c_char) -> c_int; + pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; + pub fn tmpfile() -> *mut FILE; + pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int; + pub fn setbuf(stream: *mut FILE, buf: *mut c_char); + pub fn getchar() -> c_int; + pub fn putchar(c: c_int) -> c_int; + pub fn fgetc(stream: *mut FILE) -> c_int; + pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; + pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fputs$UNIX2003" + )] + pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; + pub fn puts(s: *const c_char) -> c_int; + pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; + pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fwrite$UNIX2003" + )] + pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; + pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; + pub fn ftell(stream: *mut FILE) -> c_long; + pub fn rewind(stream: *mut FILE); + #[cfg_attr(target_os = "netbsd", link_name = "__fgetpos50")] + pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__fsetpos50")] + pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; + pub fn feof(stream: *mut FILE) -> c_int; + pub fn ferror(stream: *mut FILE) -> c_int; + pub fn clearerr(stream: *mut FILE); + pub fn perror(s: *const c_char); + pub fn atoi(s: *const c_char) -> c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "strtod$UNIX2003" + )] + pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; + pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float; + pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long; + pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong; + pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; + pub fn malloc(size: size_t) -> *mut c_void; + pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; + pub fn free(p: *mut c_void); + pub fn abort() -> !; + pub fn exit(status: c_int) -> !; + pub fn _exit(status: c_int) -> !; + pub fn atexit(cb: extern "C" fn()) -> c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "system$UNIX2003" + )] + pub fn system(s: *const c_char) -> c_int; + pub fn getenv(s: *const c_char) -> *mut c_char; + + pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; + pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; + pub fn stpcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; + pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; + pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; + pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; + pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; + pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; + pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strdup(cs: *const c_char) -> *mut c_char; + pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char; + pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; + pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int; + pub fn strlen(cs: *const c_char) -> size_t; + pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "strerror$UNIX2003" + )] + pub fn strerror(n: c_int) -> *mut c_char; + pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; + pub fn strtok_r(s: *mut c_char, t: *const c_char, p: *mut *mut c_char) -> *mut c_char; + pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; + pub fn strsignal(sig: c_int) -> *mut c_char; + pub fn wcslen(buf: *const wchar_t) -> size_t; + pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t; + + pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; + pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; + pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; + pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; + pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; + pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; +} + +extern "C" { + #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam50")] + pub fn getpwnam(name: *const ::c_char) -> *mut passwd; + #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid50")] + pub fn getpwuid(uid: ::uid_t) -> *mut passwd; + + pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int; + pub fn printf(format: *const ::c_char, ...) -> ::c_int; + pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int; + pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int; + #[cfg_attr( + all(target_os = "linux", not(target_env = "uclibc")), + link_name = "__isoc99_fscanf" + )] + pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int; + #[cfg_attr( + all(target_os = "linux", not(target_env = "uclibc")), + link_name = "__isoc99_scanf" + )] + pub fn scanf(format: *const ::c_char, ...) -> ::c_int; + #[cfg_attr( + all(target_os = "linux", not(target_env = "uclibc")), + link_name = "__isoc99_sscanf" + )] + pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int; + pub fn getchar_unlocked() -> ::c_int; + pub fn putchar_unlocked(c: ::c_int) -> ::c_int; + + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + #[cfg_attr(target_os = "netbsd", link_name = "__socket30")] + #[cfg_attr(target_os = "illumos", link_name = "__xnet_socket")] + #[cfg_attr(target_os = "espidf", link_name = "lwip_socket")] + pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int; + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "connect$UNIX2003" + )] + #[cfg_attr(target_os = "illumos", link_name = "__xnet_connect")] + #[cfg_attr(target_os = "espidf", link_name = "lwip_connect")] + pub fn connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "listen$UNIX2003" + )] + #[cfg_attr(target_os = "espidf", link_name = "lwip_listen")] + pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int; + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "accept$UNIX2003" + )] + #[cfg_attr(target_os = "espidf", link_name = "lwip_accept")] + pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int; + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "getpeername$UNIX2003" + )] + #[cfg_attr(target_os = "espidf", link_name = "lwip_getpeername")] + pub fn getpeername( + socket: ::c_int, + address: *mut sockaddr, + address_len: *mut socklen_t, + ) -> ::c_int; + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "getsockname$UNIX2003" + )] + #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockname")] + pub fn getsockname( + socket: ::c_int, + address: *mut sockaddr, + address_len: *mut socklen_t, + ) -> ::c_int; + #[cfg_attr(target_os = "espidf", link_name = "lwip_setsockopt")] + pub fn setsockopt( + socket: ::c_int, + level: ::c_int, + name: ::c_int, + value: *const ::c_void, + option_len: socklen_t, + ) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "socketpair$UNIX2003" + )] + #[cfg_attr(target_os = "illumos", link_name = "__xnet_socketpair")] + pub fn socketpair( + domain: ::c_int, + type_: ::c_int, + protocol: ::c_int, + socket_vector: *mut ::c_int, + ) -> ::c_int; + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "sendto$UNIX2003" + )] + #[cfg_attr(target_os = "illumos", link_name = "__xnet_sendto")] + #[cfg_attr(target_os = "espidf", link_name = "lwip_sendto")] + pub fn sendto( + socket: ::c_int, + buf: *const ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *const sockaddr, + addrlen: socklen_t, + ) -> ::ssize_t; + #[cfg_attr(target_os = "espidf", link_name = "lwip_shutdown")] + pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "chmod$UNIX2003" + )] + pub fn chmod(path: *const c_char, mode: mode_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fchmod$UNIX2003" + )] + pub fn fchmod(fd: ::c_int, mode: mode_t) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "fstat$INODE64" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__fstat50")] + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "fstat@FBSD_1.0" + )] + pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int; + + pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "stat$INODE64" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__stat50")] + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "stat@FBSD_1.0" + )] + pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int; + + pub fn pclose(stream: *mut ::FILE) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fdopen$UNIX2003" + )] + pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE; + pub fn fileno(stream: *mut ::FILE) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "open$UNIX2003" + )] + pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "creat$UNIX2003" + )] + pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fcntl$UNIX2003" + )] + pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86_64"), + link_name = "opendir$INODE64" + )] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "opendir$INODE64$UNIX2003" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__opendir30")] + pub fn opendir(dirname: *const c_char) -> *mut ::DIR; + + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "readdir$INODE64" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__readdir30")] + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "readdir@FBSD_1.0" + )] + pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "closedir$UNIX2003" + )] + pub fn closedir(dirp: *mut ::DIR) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86_64"), + link_name = "rewinddir$INODE64" + )] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "rewinddir$INODE64$UNIX2003" + )] + pub fn rewinddir(dirp: *mut ::DIR); + + pub fn fchmodat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::mode_t, + flags: ::c_int, + ) -> ::c_int; + pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int; + pub fn fchownat( + dirfd: ::c_int, + pathname: *const ::c_char, + owner: ::uid_t, + group: ::gid_t, + flags: ::c_int, + ) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "fstatat$INODE64" + )] + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "fstatat@FBSD_1.1" + )] + pub fn fstatat( + dirfd: ::c_int, + pathname: *const ::c_char, + buf: *mut stat, + flags: ::c_int, + ) -> ::c_int; + pub fn linkat( + olddirfd: ::c_int, + oldpath: *const ::c_char, + newdirfd: ::c_int, + newpath: *const ::c_char, + flags: ::c_int, + ) -> ::c_int; + pub fn renameat( + olddirfd: ::c_int, + oldpath: *const ::c_char, + newdirfd: ::c_int, + newpath: *const ::c_char, + ) -> ::c_int; + pub fn symlinkat( + target: *const ::c_char, + newdirfd: ::c_int, + linkpath: *const ::c_char, + ) -> ::c_int; + pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int; + + pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int; + pub fn alarm(seconds: ::c_uint) -> ::c_uint; + pub fn chdir(dir: *const c_char) -> ::c_int; + pub fn fchdir(dirfd: ::c_int) -> ::c_int; + pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "lchown$UNIX2003" + )] + pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "close$NOCANCEL$UNIX2003" + )] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86_64"), + link_name = "close$NOCANCEL" + )] + pub fn close(fd: ::c_int) -> ::c_int; + pub fn dup(fd: ::c_int) -> ::c_int; + pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int; + pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int; + pub fn execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int; + pub fn execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int; + pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int; + pub fn execve( + prog: *const c_char, + argv: *const *const c_char, + envp: *const *const c_char, + ) -> ::c_int; + pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int; + pub fn fork() -> pid_t; + pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long; + pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char; + pub fn getegid() -> gid_t; + pub fn geteuid() -> uid_t; + pub fn getgid() -> gid_t; + pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int; + #[cfg_attr(target_os = "illumos", link_name = "getloginx")] + pub fn getlogin() -> *mut c_char; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "getopt$UNIX2003" + )] + pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int; + pub fn getpgid(pid: pid_t) -> pid_t; + pub fn getpgrp() -> pid_t; + pub fn getpid() -> pid_t; + pub fn getppid() -> pid_t; + pub fn getuid() -> uid_t; + pub fn isatty(fd: ::c_int) -> ::c_int; + pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int; + pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t; + pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long; + pub fn pipe(fds: *mut ::c_int) -> ::c_int; + pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "read$UNIX2003" + )] + pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t; + pub fn rmdir(path: *const c_char) -> ::c_int; + pub fn seteuid(uid: uid_t) -> ::c_int; + pub fn setegid(gid: gid_t) -> ::c_int; + pub fn setgid(gid: gid_t) -> ::c_int; + pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int; + pub fn setsid() -> pid_t; + pub fn setuid(uid: uid_t) -> ::c_int; + pub fn setreuid(ruid: uid_t, euid: uid_t) -> ::c_int; + pub fn setregid(rgid: gid_t, egid: gid_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "sleep$UNIX2003" + )] + pub fn sleep(secs: ::c_uint) -> ::c_uint; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "nanosleep$UNIX2003" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__nanosleep50")] + pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::c_int; + pub fn tcgetpgrp(fd: ::c_int) -> pid_t; + pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int; + pub fn ttyname(fd: ::c_int) -> *mut c_char; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "ttyname_r$UNIX2003" + )] + #[cfg_attr(target_os = "illumos", link_name = "__posix_ttyname_r")] + pub fn ttyname_r(fd: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + pub fn unlink(c: *const c_char) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "wait$UNIX2003" + )] + pub fn wait(status: *mut ::c_int) -> pid_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "waitpid$UNIX2003" + )] + pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "write$UNIX2003" + )] + pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pread$UNIX2003" + )] + pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pwrite$UNIX2003" + )] + pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t; + pub fn umask(mask: mode_t) -> mode_t; + + #[cfg_attr(target_os = "netbsd", link_name = "__utime50")] + pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "kill$UNIX2003" + )] + pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "killpg$UNIX2003" + )] + pub fn killpg(pgrp: pid_t, sig: ::c_int) -> ::c_int; + + pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn mlockall(flags: ::c_int) -> ::c_int; + pub fn munlockall() -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "mmap$UNIX2003" + )] + pub fn mmap( + addr: *mut ::c_void, + len: ::size_t, + prot: ::c_int, + flags: ::c_int, + fd: ::c_int, + offset: off_t, + ) -> *mut ::c_void; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "munmap$UNIX2003" + )] + pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int; + + pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint; + pub fn if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char; + + #[cfg_attr( + all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "lstat$INODE64" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__lstat50")] + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "lstat@FBSD_1.0" + )] + pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "fsync$UNIX2003" + )] + pub fn fsync(fd: ::c_int) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "setenv$UNIX2003" + )] + pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "unsetenv$UNIX2003" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__unsetenv13")] + pub fn unsetenv(name: *const c_char) -> ::c_int; + + pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int; + + pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int; + + pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t; + + #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")] + pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int; + + #[cfg_attr( + any(target_os = "macos", target_os = "ios", target_os = "watchos"), + link_name = "realpath$DARWIN_EXTSN" + )] + pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char; + + pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int; + + #[cfg_attr(target_os = "netbsd", link_name = "__times13")] + pub fn times(buf: *mut ::tms) -> ::clock_t; + + pub fn pthread_self() -> ::pthread_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_join$UNIX2003" + )] + pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int; + pub fn pthread_exit(value: *mut ::c_void) -> !; + pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int; + pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int; + pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int; + pub fn pthread_detach(thread: ::pthread_t) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__libc_thr_yield")] + pub fn sched_yield() -> ::c_int; + pub fn pthread_key_create( + key: *mut pthread_key_t, + dtor: ::Option, + ) -> ::c_int; + pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int; + pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void; + pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int; + pub fn pthread_mutex_init( + lock: *mut pthread_mutex_t, + attr: *const pthread_mutexattr_t, + ) -> ::c_int; + pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int; + pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int; + + pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_mutexattr_destroy$UNIX2003" + )] + pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int; + pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_cond_init$UNIX2003" + )] + pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t) + -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_cond_wait$UNIX2003" + )] + pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_cond_timedwait$UNIX2003" + )] + pub fn pthread_cond_timedwait( + cond: *mut pthread_cond_t, + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int; + pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int; + pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_rwlock_init$UNIX2003" + )] + pub fn pthread_rwlock_init( + lock: *mut pthread_rwlock_t, + attr: *const pthread_rwlockattr_t, + ) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_rwlock_destroy$UNIX2003" + )] + pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_rwlock_rdlock$UNIX2003" + )] + pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_rwlock_tryrdlock$UNIX2003" + )] + pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_rwlock_wrlock$UNIX2003" + )] + pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_rwlock_trywrlock$UNIX2003" + )] + pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pthread_rwlock_unlock$UNIX2003" + )] + pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int; + pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int; + pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int; + + #[cfg_attr(target_os = "illumos", link_name = "__xnet_getsockopt")] + #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockopt")] + pub fn getsockopt( + sockfd: ::c_int, + level: ::c_int, + optname: ::c_int, + optval: *mut ::c_void, + optlen: *mut ::socklen_t, + ) -> ::c_int; + pub fn raise(signum: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")] + pub fn sigaction(signum: ::c_int, act: *const sigaction, oldact: *mut sigaction) -> ::c_int; + + #[cfg_attr(target_os = "netbsd", link_name = "__utimes50")] + pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int; + pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void; + pub fn dlerror() -> *mut ::c_char; + pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void; + pub fn dlclose(handle: *mut ::c_void) -> ::c_int; + pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int; + + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + #[cfg_attr(target_os = "illumos", link_name = "__xnet_getaddrinfo")] + #[cfg_attr(target_os = "espidf", link_name = "lwip_getaddrinfo")] + pub fn getaddrinfo( + node: *const c_char, + service: *const c_char, + hints: *const addrinfo, + res: *mut *mut addrinfo, + ) -> ::c_int; + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + #[cfg_attr(target_os = "espidf", link_name = "lwip_freeaddrinfo")] + pub fn freeaddrinfo(res: *mut addrinfo); + pub fn hstrerror(errcode: ::c_int) -> *const ::c_char; + pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char; + #[cfg_attr( + any( + all(target_os = "linux", not(target_env = "musl")), + target_os = "freebsd", + target_os = "dragonfly", + target_os = "haiku" + ), + link_name = "__res_init" + )] + #[cfg_attr( + any(target_os = "macos", target_os = "ios", target_os = "watchos"), + link_name = "res_9_init" + )] + pub fn res_init() -> ::c_int; + + #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")] + #[cfg_attr(target_env = "musl", allow(deprecated))] + // FIXME: for `time_t` + pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; + #[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")] + #[cfg_attr(target_env = "musl", allow(deprecated))] + // FIXME: for `time_t` + pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "mktime$UNIX2003" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__mktime50")] + #[cfg_attr(target_env = "musl", allow(deprecated))] + // FIXME: for `time_t` + pub fn mktime(tm: *mut tm) -> time_t; + #[cfg_attr(target_os = "netbsd", link_name = "__time50")] + #[cfg_attr(target_env = "musl", allow(deprecated))] + // FIXME: for `time_t` + pub fn time(time: *mut time_t) -> time_t; + #[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")] + #[cfg_attr(target_env = "musl", allow(deprecated))] + // FIXME: for `time_t` + pub fn gmtime(time_p: *const time_t) -> *mut tm; + #[cfg_attr(target_os = "netbsd", link_name = "__locatime50")] + #[cfg_attr(target_env = "musl", allow(deprecated))] + // FIXME: for `time_t` + pub fn localtime(time_p: *const time_t) -> *mut tm; + #[cfg_attr(target_os = "netbsd", link_name = "__difftime50")] + #[cfg_attr(target_env = "musl", allow(deprecated))] + // FIXME: for `time_t` + pub fn difftime(time1: time_t, time0: time_t) -> ::c_double; + #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")] + #[cfg_attr(target_env = "musl", allow(deprecated))] + // FIXME: for `time_t` + pub fn timegm(tm: *mut ::tm) -> time_t; + + #[cfg_attr(target_os = "netbsd", link_name = "__mknod50")] + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "mknod@FBSD_1.0" + )] + pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int; + pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn endservent(); + pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent; + pub fn getservbyport(port: ::c_int, proto: *const ::c_char) -> *mut servent; + pub fn getservent() -> *mut servent; + pub fn setservent(stayopen: ::c_int); + pub fn getprotobyname(name: *const ::c_char) -> *mut protoent; + pub fn getprotobynumber(proto: ::c_int) -> *mut protoent; + pub fn chroot(name: *const ::c_char) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "usleep$UNIX2003" + )] + pub fn usleep(secs: ::c_uint) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "send$UNIX2003" + )] + #[cfg_attr(target_os = "espidf", link_name = "lwip_send")] + pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "recv$UNIX2003" + )] + #[cfg_attr(target_os = "espidf", link_name = "lwip_recv")] + pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "putenv$UNIX2003" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__putenv50")] + pub fn putenv(string: *mut c_char) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "poll$UNIX2003" + )] + pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86_64"), + link_name = "select$1050" + )] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "select$UNIX2003" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__select50")] + pub fn select( + nfds: ::c_int, + readfs: *mut fd_set, + writefds: *mut fd_set, + errorfds: *mut fd_set, + timeout: *mut timeval, + ) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__setlocale50")] + pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char; + pub fn localeconv() -> *mut lconv; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "sem_wait$UNIX2003" + )] + pub fn sem_wait(sem: *mut sem_t) -> ::c_int; + pub fn sem_trywait(sem: *mut sem_t) -> ::c_int; + pub fn sem_post(sem: *mut sem_t) -> ::c_int; + pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int; + pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int; + + pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t; + + #[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")] + pub fn sigemptyset(set: *mut sigset_t) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")] + pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__sigfillset14")] + pub fn sigfillset(set: *mut sigset_t) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__sigdelset14")] + pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__sigismember14")] + pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int; + + #[cfg_attr(target_os = "netbsd", link_name = "__sigprocmask14")] + pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; + #[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")] + pub fn sigpending(set: *mut sigset_t) -> ::c_int; + + pub fn sysconf(name: ::c_int) -> ::c_long; + + pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int; + + #[cfg_attr( + all(target_os = "macos", target_arch = "x86_64"), + link_name = "pselect$1050" + )] + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "pselect$UNIX2003" + )] + #[cfg_attr(target_os = "netbsd", link_name = "__pselect50")] + pub fn pselect( + nfds: ::c_int, + readfs: *mut fd_set, + writefds: *mut fd_set, + errorfds: *mut fd_set, + timeout: *const timespec, + sigmask: *const sigset_t, + ) -> ::c_int; + pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int; + pub fn ftello(stream: *mut ::FILE) -> ::off_t; + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "tcdrain$UNIX2003" + )] + pub fn tcdrain(fd: ::c_int) -> ::c_int; + pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t; + pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t; + pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int; + pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int; + pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int; + pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int; + pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int; + pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int; + pub fn tcgetsid(fd: ::c_int) -> ::pid_t; + pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int; + pub fn mkstemp(template: *mut ::c_char) -> ::c_int; + pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char; + + pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char; + + pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int); + pub fn closelog(); + pub fn setlogmask(maskpri: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "macos", link_name = "syslog$DARWIN_EXTSN")] + pub fn syslog(priority: ::c_int, message: *const ::c_char, ...); + #[cfg_attr( + all(target_os = "macos", target_arch = "x86"), + link_name = "nice$UNIX2003" + )] + pub fn nice(incr: ::c_int) -> ::c_int; + + pub fn grantpt(fd: ::c_int) -> ::c_int; + pub fn posix_openpt(flags: ::c_int) -> ::c_int; + pub fn ptsname(fd: ::c_int) -> *mut ::c_char; + pub fn unlockpt(fd: ::c_int) -> ::c_int; + + pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t; + + pub fn lockf(fd: ::c_int, cmd: ::c_int, len: ::off_t) -> ::c_int; + +} +cfg_if! { + if #[cfg(not(any(target_os = "emscripten", + target_os = "android", + target_os = "haiku")))] { + extern "C" { + pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> ::c_int; + pub fn stpncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; + } + } +} + +cfg_if! { + if #[cfg(not(target_env = "uclibc"))] { + extern "C" { + pub fn open_wmemstream( + ptr: *mut *mut wchar_t, + sizeloc: *mut size_t, + ) -> *mut FILE; + } + } +} + +cfg_if! { + if #[cfg(not(target_os = "redox"))] { + extern { + pub fn getsid(pid: pid_t) -> pid_t; + pub fn truncate(path: *const c_char, length: off_t) -> ::c_int; + #[cfg_attr(all(target_os = "macos", target_arch = "x86"), + link_name = "pause$UNIX2003")] + pub fn pause() -> ::c_int; + + pub fn readlinkat(dirfd: ::c_int, + pathname: *const ::c_char, + buf: *mut ::c_char, + bufsiz: ::size_t) -> ::ssize_t; + pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, + mode: ::mode_t) -> ::c_int; + pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, + flags: ::c_int, ...) -> ::c_int; + + #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"), + link_name = "fdopendir$INODE64")] + #[cfg_attr(all(target_os = "macos", target_arch = "x86"), + link_name = "fdopendir$INODE64$UNIX2003")] + pub fn fdopendir(fd: ::c_int) -> *mut ::DIR; + + #[cfg_attr(all(target_os = "macos", not(target_arch = "aarch64")), + link_name = "readdir_r$INODE64")] + #[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")] + #[cfg_attr( + all(target_os = "freebsd", any(freebsd11, freebsd10)), + link_name = "readdir_r@FBSD_1.0" + )] + #[allow(non_autolinks)] // FIXME: `<>` breaks line length limit. + /// The 64-bit libc on Solaris and illumos only has readdir_r. If a + /// 32-bit Solaris or illumos target is ever created, it should use + /// __posix_readdir_r. See libc(3LIB) on Solaris or illumos: + /// https://illumos.org/man/3lib/libc + /// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html + /// https://www.unix.com/man-page/opensolaris/3LIB/libc/ + pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, + result: *mut *mut ::dirent) -> ::c_int; + } + } +} + +cfg_if! { + if #[cfg(not(any(target_os = "solaris", target_os = "illumos")))] { + extern { + pub fn cfmakeraw(termios: *mut ::termios); + pub fn cfsetspeed(termios: *mut ::termios, + speed: ::speed_t) -> ::c_int; + } + } +} + +cfg_if! { + if #[cfg(target_env = "newlib")] { + mod newlib; + pub use self::newlib::*; + } else if #[cfg(any(target_os = "linux", + target_os = "l4re", + target_os = "android", + target_os = "emscripten"))] { + mod linux_like; + pub use self::linux_like::*; + } else if #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "watchos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd", + target_os = "netbsd"))] { + mod bsd; + pub use self::bsd::*; + } else if #[cfg(any(target_os = "solaris", + target_os = "illumos"))] { + mod solarish; + pub use self::solarish::*; + } else if #[cfg(target_os = "haiku")] { + mod haiku; + pub use self::haiku::*; + } else if #[cfg(target_os = "hermit")] { + mod hermit; + pub use self::hermit::*; + } else if #[cfg(target_os = "redox")] { + mod redox; + pub use self::redox::*; + } else { + // Unknown target_os + } +} + +cfg_if! { + if #[cfg(libc_core_cvoid)] { + pub use ::ffi::c_void; + } else { + // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help + // enable more optimization opportunities around it recognizing things + // like malloc/free. + #[repr(u8)] + #[allow(missing_copy_implementations)] + #[allow(missing_debug_implementations)] + pub enum c_void { + // Two dummy variants so the #[repr] attribute can be used. + #[doc(hidden)] + __variant1, + #[doc(hidden)] + __variant2, + } + } +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } else { + mod no_align; + pub use self::no_align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/newlib/aarch64/mod.rs b/bash-5.1/vendor/libc/src/unix/newlib/aarch64/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..d686b3692d86d9351a6dfbbf401656bf7f3c1067 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/newlib/aarch64/mod.rs @@ -0,0 +1,54 @@ +pub type clock_t = ::c_long; +pub type c_char = u8; +pub type wchar_t = u32; + +pub type c_long = i64; +pub type c_ulong = u64; + +s! { + pub struct sockaddr { + pub sa_len: u8, + pub sa_family: ::sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in6 { + pub sin6_len: u8, + pub sin6_family: ::sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct sockaddr_in { + pub sin_len: u8, + pub sin_family: ::sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [::c_char; 8], + } +} + +pub const AF_INET6: ::c_int = 23; + +pub const FIONBIO: ::c_ulong = 1; + +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; + +pub const SOL_SOCKET: ::c_int = 65535; + +pub const MSG_OOB: ::c_int = 1; +pub const MSG_PEEK: ::c_int = 2; +pub const MSG_DONTWAIT: ::c_int = 4; +pub const MSG_DONTROUTE: ::c_int = 0; +pub const MSG_WAITALL: ::c_int = 0; +pub const MSG_MORE: ::c_int = 0; +pub const MSG_NOSIGNAL: ::c_int = 0; + +pub use crate::unix::newlib::generic::{sigset_t, stat}; diff --git a/bash-5.1/vendor/libc/src/unix/newlib/align.rs b/bash-5.1/vendor/libc/src/unix/newlib/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..db9beb83523c24bdfc693ac3fb187db9c02234bf --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/newlib/align.rs @@ -0,0 +1,61 @@ +macro_rules! expand_align { + () => { + s! { + #[cfg_attr(all(target_pointer_width = "32", + any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")), + repr(align(4)))] + #[cfg_attr(any(target_pointer_width = "64", + not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc"))), + repr(align(8)))] + pub struct pthread_mutex_t { // Unverified + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + + #[cfg_attr(all(target_pointer_width = "32", + any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")), + repr(align(4)))] + #[cfg_attr(any(target_pointer_width = "64", + not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc"))), + repr(align(8)))] + pub struct pthread_rwlock_t { // Unverified + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + + #[cfg_attr(any(target_pointer_width = "32", + target_arch = "x86_64", + target_arch = "powerpc64", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64"), + repr(align(4)))] + #[cfg_attr(not(any(target_pointer_width = "32", + target_arch = "x86_64", + target_arch = "powerpc64", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64")), + repr(align(8)))] + pub struct pthread_mutexattr_t { // Unverified + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + #[repr(align(8))] + pub struct pthread_cond_t { // Unverified + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + + #[repr(align(4))] + pub struct pthread_condattr_t { // Unverified + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + } + }; +} diff --git a/bash-5.1/vendor/libc/src/unix/newlib/arm/mod.rs b/bash-5.1/vendor/libc/src/unix/newlib/arm/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..f644349cb997fd9003901698ee306954a1ea8e69 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/newlib/arm/mod.rs @@ -0,0 +1,56 @@ +pub type clock_t = ::c_long; +pub type c_char = u8; +pub type wchar_t = u32; + +pub type c_long = i32; +pub type c_ulong = u32; + +s! { + pub struct sockaddr { + pub sa_family: ::sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in6 { + pub sin6_family: ::sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct sockaddr_in { + pub sin_family: ::sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [u8; 8], + } + + pub struct sockaddr_storage { + pub ss_family: ::sa_family_t, + pub __ss_padding: [u8; 26], + } +} + +pub const AF_INET6: ::c_int = 23; + +pub const FIONBIO: ::c_ulong = 1; + +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLHUP: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLOUT: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; + +pub const SOL_SOCKET: ::c_int = 65535; + +pub const MSG_OOB: ::c_int = 1; +pub const MSG_PEEK: ::c_int = 2; +pub const MSG_DONTWAIT: ::c_int = 4; +pub const MSG_DONTROUTE: ::c_int = 0; +pub const MSG_WAITALL: ::c_int = 0; +pub const MSG_MORE: ::c_int = 0; +pub const MSG_NOSIGNAL: ::c_int = 0; + +pub use crate::unix::newlib::generic::{sigset_t, stat}; diff --git a/bash-5.1/vendor/libc/src/unix/newlib/espidf/mod.rs b/bash-5.1/vendor/libc/src/unix/newlib/espidf/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..804cd66454f464ec8e767c0f653ff02ea2cd9ad5 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/newlib/espidf/mod.rs @@ -0,0 +1,110 @@ +pub type clock_t = ::c_ulong; +pub type c_char = i8; +pub type wchar_t = u32; + +pub type c_long = i32; +pub type c_ulong = u32; + +s! { + pub struct cmsghdr { + pub cmsg_len: ::socklen_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::c_int, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::socklen_t, + pub msg_flags: ::c_int, + } + + pub struct sockaddr_un { + pub sun_family: ::sa_family_t, + pub sun_path: [::c_char; 108], + } + + pub struct sockaddr { + pub sa_len: u8, + pub sa_family: ::sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in6 { + pub sin6_len: u8, + pub sin6_family: ::sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct sockaddr_in { + pub sin_len: u8, + pub sin_family: ::sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [::c_char; 8], + } + + pub struct sockaddr_storage { + pub s2_len: u8, + pub ss_family: ::sa_family_t, + pub s2_data1: [::c_char; 2], + pub s2_data2: [u32; 3], + pub s2_data3: [u32; 3], + } +} + +pub const AF_UNIX: ::c_int = 1; +pub const AF_INET6: ::c_int = 10; + +pub const FIONBIO: ::c_ulong = 2147772030; + +pub const POLLIN: ::c_short = 1 << 0; +pub const POLLRDNORM: ::c_short = 1 << 1; +pub const POLLRDBAND: ::c_short = 1 << 2; +pub const POLLPRI: ::c_short = POLLRDBAND; +pub const POLLOUT: ::c_short = 1 << 3; +pub const POLLWRNORM: ::c_short = POLLOUT; +pub const POLLWRBAND: ::c_short = 1 << 4; +pub const POLLERR: ::c_short = 1 << 5; +pub const POLLHUP: ::c_short = 1 << 6; + +pub const SOL_SOCKET: ::c_int = 0xfff; + +pub const MSG_OOB: ::c_int = 0x04; +pub const MSG_PEEK: ::c_int = 0x01; +pub const MSG_DONTWAIT: ::c_int = 0x08; +pub const MSG_DONTROUTE: ::c_int = 0x4; +pub const MSG_WAITALL: ::c_int = 0x02; +pub const MSG_MORE: ::c_int = 0x10; +pub const MSG_NOSIGNAL: ::c_int = 0x20; +pub const MSG_TRUNC: ::c_int = 0x04; +pub const MSG_CTRUNC: ::c_int = 0x08; +pub const MSG_EOR: ::c_int = 0x08; + +pub const PTHREAD_STACK_MIN: ::size_t = 768; + +extern "C" { + pub fn pthread_create( + native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; + + #[link_name = "lwip_sendmsg"] + pub fn sendmsg(s: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t; + #[link_name = "lwip_recvmsg"] + pub fn recvmsg(s: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; + + pub fn eventfd(initval: ::c_uint, flags: ::c_int) -> ::c_int; +} + +pub use crate::unix::newlib::generic::{sigset_t, stat}; diff --git a/bash-5.1/vendor/libc/src/unix/newlib/generic.rs b/bash-5.1/vendor/libc/src/unix/newlib/generic.rs new file mode 100644 index 0000000000000000000000000000000000000000..db7797f17c29722ee7d56c4f9933afe239439283 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/newlib/generic.rs @@ -0,0 +1,27 @@ +//! Common types used by most newlib platforms + +s! { + pub struct sigset_t { + __val: [::c_ulong; 16], + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_atime: ::time_t, + pub st_spare1: ::c_long, + pub st_mtime: ::time_t, + pub st_spare2: ::c_long, + pub st_ctime: ::time_t, + pub st_spare3: ::c_long, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_spare4: [::c_long; 2usize], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/newlib/horizon/mod.rs b/bash-5.1/vendor/libc/src/unix/newlib/horizon/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..bcb93ad9df4f1182c77c45cdadbd995a7b61937d --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/newlib/horizon/mod.rs @@ -0,0 +1,268 @@ +//! ARMv6K Nintendo 3DS C Newlib definitions + +pub type c_char = u8; +pub type c_long = i32; +pub type c_ulong = u32; + +pub type wchar_t = ::c_uint; + +pub type u_register_t = ::c_uint; +pub type u_char = ::c_uchar; +pub type u_short = ::c_ushort; +pub type u_int = ::c_uint; +pub type u_long = c_ulong; +pub type ushort = ::c_ushort; +pub type uint = ::c_uint; +pub type ulong = c_ulong; +pub type clock_t = c_ulong; +pub type daddr_t = c_long; +pub type caddr_t = *mut c_char; +pub type sbintime_t = ::c_longlong; +pub type sigset_t = ::c_ulong; + +s! { + pub struct sockaddr { + pub sa_family: ::sa_family_t, + pub sa_data: [::c_char; 26usize], + } + + pub struct sockaddr_storage { + pub ss_family: ::sa_family_t, + pub __ss_padding: [::c_char; 26usize], + } + + pub struct sockaddr_in { + pub sin_family: ::sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + } + + pub struct sockaddr_in6 { + pub sin6_family: ::sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct sockaddr_un { + pub sun_len: ::c_uchar, + pub sun_family: ::sa_family_t, + pub sun_path: [::c_char; 104usize], + } + + pub struct sched_param { + pub sched_priority: ::c_int, + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_atim: ::timespec, + pub st_mtim: ::timespec, + pub st_ctim: ::timespec, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_spare4: [::c_long; 2usize], + } +} + +pub const SIGEV_NONE: ::c_int = 1; +pub const SIGEV_SIGNAL: ::c_int = 2; +pub const SIGEV_THREAD: ::c_int = 3; +pub const SA_NOCLDSTOP: ::c_int = 1; +pub const MINSIGSTKSZ: ::c_int = 2048; +pub const SIGSTKSZ: ::c_int = 8192; +pub const SS_ONSTACK: ::c_int = 1; +pub const SS_DISABLE: ::c_int = 2; +pub const SIG_SETMASK: ::c_int = 0; +pub const SIG_BLOCK: ::c_int = 1; +pub const SIG_UNBLOCK: ::c_int = 2; +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGTRAP: ::c_int = 5; +pub const SIGABRT: ::c_int = 6; +pub const SIGEMT: ::c_int = 7; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGBUS: ::c_int = 10; +pub const SIGSEGV: ::c_int = 11; +pub const SIGSYS: ::c_int = 12; +pub const SIGPIPE: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; +pub const SIGURG: ::c_int = 16; +pub const SIGSTOP: ::c_int = 17; +pub const SIGTSTP: ::c_int = 18; +pub const SIGCONT: ::c_int = 19; +pub const SIGCHLD: ::c_int = 20; +pub const SIGCLD: ::c_int = 20; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGIO: ::c_int = 23; +pub const SIGPOLL: ::c_int = 23; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGLOST: ::c_int = 29; +pub const SIGUSR1: ::c_int = 30; +pub const SIGUSR2: ::c_int = 31; +pub const NSIG: ::c_int = 32; +pub const CLOCK_ENABLED: ::c_uint = 1; +pub const CLOCK_DISABLED: ::c_uint = 0; +pub const CLOCK_ALLOWED: ::c_uint = 1; +pub const CLOCK_DISALLOWED: ::c_uint = 0; +pub const TIMER_ABSTIME: ::c_uint = 4; +pub const SOL_SOCKET: ::c_int = 65535; +pub const MSG_OOB: ::c_int = 1; +pub const MSG_PEEK: ::c_int = 2; +pub const MSG_DONTWAIT: ::c_int = 4; +pub const MSG_DONTROUTE: ::c_int = 0; +pub const MSG_WAITALL: ::c_int = 0; +pub const MSG_MORE: ::c_int = 0; +pub const MSG_NOSIGNAL: ::c_int = 0; +pub const SOL_CONFIG: ::c_uint = 65534; + +pub const _SC_PAGESIZE: ::c_int = 8; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 51; + +pub const PTHREAD_STACK_MIN: ::size_t = 4096; +pub const WNOHANG: ::c_int = 1; + +pub const POLLIN: ::c_short = 0x0001; +pub const POLLPRI: ::c_short = 0x0002; +pub const POLLOUT: ::c_short = 0x0004; +pub const POLLRDNORM: ::c_short = 0x0040; +pub const POLLWRNORM: ::c_short = POLLOUT; +pub const POLLRDBAND: ::c_short = 0x0080; +pub const POLLWRBAND: ::c_short = 0x0100; +pub const POLLERR: ::c_short = 0x0008; +pub const POLLHUP: ::c_short = 0x0010; +pub const POLLNVAL: ::c_short = 0x0020; + +pub const EAI_AGAIN: ::c_int = 2; +pub const EAI_BADFLAGS: ::c_int = 3; +pub const EAI_FAIL: ::c_int = 4; +pub const EAI_SERVICE: ::c_int = 9; +pub const EAI_SYSTEM: ::c_int = 11; +pub const EAI_BADHINTS: ::c_int = 12; +pub const EAI_PROTOCOL: ::c_int = 13; +pub const EAI_OVERFLOW: ::c_int = 14; +pub const EAI_MAX: ::c_int = 15; + +pub const AF_UNIX: ::c_int = 1; +pub const AF_INET6: ::c_int = 23; + +pub const FIONBIO: ::c_ulong = 1; + +pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void; + +// For pthread get/setschedparam +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_RR: ::c_int = 2; + +// For getrandom() +pub const GRND_NONBLOCK: ::c_uint = 0x1; +pub const GRND_RANDOM: ::c_uint = 0x2; + +// Horizon OS works doesn't or can't hold any of this information +safe_f! { + pub {const} fn WIFSTOPPED(_status: ::c_int) -> bool { + false + } + + pub {const} fn WSTOPSIG(_status: ::c_int) -> ::c_int { + 0 + } + + pub {const} fn WIFCONTINUED(_status: ::c_int) -> bool { + true + } + + pub {const} fn WIFSIGNALED(_status: ::c_int) -> bool { + false + } + + pub {const} fn WTERMSIG(_status: ::c_int) -> ::c_int { + 0 + } + + pub {const} fn WIFEXITED(_status: ::c_int) -> bool { + true + } + + pub {const} fn WEXITSTATUS(_status: ::c_int) -> ::c_int { + 0 + } + + pub {const} fn WCOREDUMP(_status: ::c_int) -> bool { + false + } +} + +extern "C" { + pub fn pthread_create( + native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern "C" fn(_: *mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + + pub fn pthread_attr_getschedparam( + attr: *const ::pthread_attr_t, + param: *mut sched_param, + ) -> ::c_int; + + pub fn pthread_attr_setschedparam( + attr: *mut ::pthread_attr_t, + param: *const sched_param, + ) -> ::c_int; + + pub fn pthread_attr_getprocessorid_np( + attr: *const ::pthread_attr_t, + processor_id: *mut ::c_int, + ) -> ::c_int; + + pub fn pthread_attr_setprocessorid_np( + attr: *mut ::pthread_attr_t, + processor_id: ::c_int, + ) -> ::c_int; + + pub fn pthread_getschedparam( + native: ::pthread_t, + policy: *mut ::c_int, + param: *mut ::sched_param, + ) -> ::c_int; + + pub fn pthread_setschedparam( + native: ::pthread_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + + pub fn pthread_condattr_getclock( + attr: *const ::pthread_condattr_t, + clock_id: *mut ::clockid_t, + ) -> ::c_int; + + pub fn pthread_condattr_setclock( + attr: *mut ::pthread_condattr_t, + clock_id: ::clockid_t, + ) -> ::c_int; + + pub fn pthread_getprocessorid_np() -> ::c_int; + + pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; + + pub fn gethostid() -> ::c_long; +} diff --git a/bash-5.1/vendor/libc/src/unix/newlib/mod.rs b/bash-5.1/vendor/libc/src/unix/newlib/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..34a63a81a03f7b2de82e60669a07afa6bc0b4ca0 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/newlib/mod.rs @@ -0,0 +1,759 @@ +pub type blkcnt_t = i32; +pub type blksize_t = i32; +pub type clockid_t = ::c_ulong; + +cfg_if! { + if #[cfg(target_os = "espidf")] { + pub type dev_t = ::c_short; + pub type ino_t = ::c_ushort; + pub type off_t = ::c_long; + } else { + pub type dev_t = u32; + pub type ino_t = u32; + pub type off_t = i64; + } +} + +pub type fsblkcnt_t = u64; +pub type fsfilcnt_t = u32; +pub type id_t = u32; +pub type key_t = ::c_int; +pub type loff_t = ::c_longlong; +pub type mode_t = ::c_uint; +pub type nfds_t = u32; +pub type nlink_t = ::c_ushort; +pub type pthread_t = ::c_ulong; +pub type pthread_key_t = ::c_uint; +pub type rlim_t = u32; + +cfg_if! { + if #[cfg(target_os = "horizon")] { + pub type sa_family_t = u16; + } else { + pub type sa_family_t = u8; + } +} + +pub type socklen_t = u32; +pub type speed_t = u32; +pub type suseconds_t = i32; +pub type tcflag_t = ::c_uint; +pub type useconds_t = u32; + +cfg_if! { + if #[cfg(target_os = "horizon")] { + pub type time_t = ::c_longlong; + } else { + pub type time_t = i32; + } +} + +s! { + // The order of the `ai_addr` field in this struct is crucial + // for converting between the Rust and C types. + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + pub ai_addrlen: socklen_t, + + #[cfg(target_os = "espidf")] + pub ai_addr: *mut sockaddr, + + pub ai_canonname: *mut ::c_char, + + #[cfg(not(any( + target_os = "espidf", + all(libc_cfg_target_vendor, target_arch = "powerpc", target_vendor = "nintendo"))))] + pub ai_addr: *mut sockaddr, + + pub ai_next: *mut addrinfo, + } + + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct linger { + pub l_onoff: ::c_int, + pub l_linger: ::c_int, + } + + pub struct in_addr { + pub s_addr: ::in_addr_t, + } + + pub struct hostent { + pub h_name: *mut ::c_char, + pub h_aliases: *mut *mut ::c_char, + pub h_addrtype: ::c_int, + pub h_length: ::c_int, + pub h_addr_list: *mut *mut ::c_char, + pub h_addr: *mut ::c_char, + } + + pub struct pollfd { + pub fd: ::c_int, + pub events: ::c_int, + pub revents: ::c_int, + } + + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + } + + pub struct tm { + pub tm_sec: ::c_int, + pub tm_min: ::c_int, + pub tm_hour: ::c_int, + pub tm_mday: ::c_int, + pub tm_mon: ::c_int, + pub tm_year: ::c_int, + pub tm_wday: ::c_int, + pub tm_yday: ::c_int, + pub tm_isdst: ::c_int, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: fsblkcnt_t, + pub f_bfree: fsblkcnt_t, + pub f_bavail: fsblkcnt_t, + pub f_files: fsfilcnt_t, + pub f_ffree: fsfilcnt_t, + pub f_favail: fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + } + + pub struct sigaction { + pub sa_handler: extern fn(arg1: ::c_int), + pub sa_mask: sigset_t, + pub sa_flags: ::c_int, + } + + pub struct dirent { + pub d_ino: ino_t, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256usize], + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_flags: ::c_int, + pub ss_size: usize, + } + + pub struct fd_set { // Unverified + fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE], + } + + pub struct passwd { // Unverified + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_gecos: *mut ::c_char, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char, + } + + pub struct termios { // Unverified + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + } + + pub struct sem_t { // Unverified + __size: [::c_char; 16], + } + + pub struct Dl_info { // Unverified + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *mut ::c_void, + } + + pub struct utsname { // Unverified + pub sysname: [::c_char; 65], + pub nodename: [::c_char; 65], + pub release: [::c_char; 65], + pub version: [::c_char; 65], + pub machine: [::c_char; 65], + pub domainname: [::c_char; 65] + } + + pub struct cpu_set_t { // Unverified + bits: [u32; 32], + } + + pub struct pthread_attr_t { // Unverified + __size: [u64; 7] + } + + pub struct pthread_rwlockattr_t { // Unverified + __lockkind: ::c_int, + __pshared: ::c_int, + } +} + +// unverified constants +align_const! { + pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_MUTEX_T], + }; + pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_COND_T], + }; + pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_RWLOCK_T], + }; +} +pub const NCCS: usize = 32; +cfg_if! { + if #[cfg(target_os = "espidf")] { + const __PTHREAD_INITIALIZER_BYTE: u8 = 0xff; + pub const __SIZEOF_PTHREAD_ATTR_T: usize = 32; + pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 4; + pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 12; + pub const __SIZEOF_PTHREAD_COND_T: usize = 4; + pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8; + pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 4; + pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 12; + } else { + const __PTHREAD_INITIALIZER_BYTE: u8 = 0; + pub const __SIZEOF_PTHREAD_ATTR_T: usize = 56; + pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; + pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; + pub const __SIZEOF_PTHREAD_COND_T: usize = 48; + pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; + pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; + pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; + } +} +pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; +pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; +pub const __PTHREAD_MUTEX_HAVE_PREV: usize = 1; +pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: usize = 1; +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; + +cfg_if! { + if #[cfg(target_os = "horizon")] { + pub const FD_SETSIZE: usize = 64; + } else { + pub const FD_SETSIZE: usize = 1024; + } +} +// intentionally not public, only used for fd_set +const ULONG_SIZE: usize = 32; + +// Other constants +pub const EPERM: ::c_int = 1; +pub const ENOENT: ::c_int = 2; +pub const ESRCH: ::c_int = 3; +pub const EINTR: ::c_int = 4; +pub const EIO: ::c_int = 5; +pub const ENXIO: ::c_int = 6; +pub const E2BIG: ::c_int = 7; +pub const ENOEXEC: ::c_int = 8; +pub const EBADF: ::c_int = 9; +pub const ECHILD: ::c_int = 10; +pub const EAGAIN: ::c_int = 11; +pub const ENOMEM: ::c_int = 12; +pub const EACCES: ::c_int = 13; +pub const EFAULT: ::c_int = 14; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENFILE: ::c_int = 23; +pub const EMFILE: ::c_int = 24; +pub const ENOTTY: ::c_int = 25; +pub const ETXTBSY: ::c_int = 26; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDOM: ::c_int = 33; +pub const ERANGE: ::c_int = 34; +pub const ENOMSG: ::c_int = 35; +pub const EIDRM: ::c_int = 36; +pub const EDEADLK: ::c_int = 45; +pub const ENOLCK: ::c_int = 46; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENOLINK: ::c_int = 67; +pub const EPROTO: ::c_int = 71; +pub const EMULTIHOP: ::c_int = 74; +pub const EBADMSG: ::c_int = 77; +pub const EFTYPE: ::c_int = 79; +pub const ENOSYS: ::c_int = 88; +pub const ENOTEMPTY: ::c_int = 90; +pub const ENAMETOOLONG: ::c_int = 91; +pub const ELOOP: ::c_int = 92; +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; +pub const ECONNRESET: ::c_int = 104; +pub const ENOBUFS: ::c_int = 105; +pub const EAFNOSUPPORT: ::c_int = 106; +pub const EPROTOTYPE: ::c_int = 107; +pub const ENOTSOCK: ::c_int = 108; +pub const ENOPROTOOPT: ::c_int = 109; +pub const ECONNREFUSED: ::c_int = 111; +pub const EADDRINUSE: ::c_int = 112; +pub const ECONNABORTED: ::c_int = 113; +pub const ENETUNREACH: ::c_int = 114; +pub const ENETDOWN: ::c_int = 115; +pub const ETIMEDOUT: ::c_int = 116; +pub const EHOSTDOWN: ::c_int = 117; +pub const EHOSTUNREACH: ::c_int = 118; +pub const EINPROGRESS: ::c_int = 119; +pub const EALREADY: ::c_int = 120; +pub const EDESTADDRREQ: ::c_int = 121; +pub const EMSGSIZE: ::c_int = 122; +pub const EPROTONOSUPPORT: ::c_int = 123; +pub const EADDRNOTAVAIL: ::c_int = 125; +pub const ENETRESET: ::c_int = 126; +pub const EISCONN: ::c_int = 127; +pub const ENOTCONN: ::c_int = 128; +pub const ETOOMANYREFS: ::c_int = 129; +pub const EDQUOT: ::c_int = 132; +pub const ESTALE: ::c_int = 133; +pub const ENOTSUP: ::c_int = 134; +pub const EILSEQ: ::c_int = 138; +pub const EOVERFLOW: ::c_int = 139; +pub const ECANCELED: ::c_int = 140; +pub const ENOTRECOVERABLE: ::c_int = 141; +pub const EOWNERDEAD: ::c_int = 142; +pub const EWOULDBLOCK: ::c_int = 11; + +pub const F_DUPFD: ::c_int = 0; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; +pub const F_GETOWN: ::c_int = 5; +pub const F_SETOWN: ::c_int = 6; +pub const F_GETLK: ::c_int = 7; +pub const F_SETLK: ::c_int = 8; +pub const F_SETLKW: ::c_int = 9; +pub const F_RGETLK: ::c_int = 10; +pub const F_RSETLK: ::c_int = 11; +pub const F_CNVT: ::c_int = 12; +pub const F_RSETLKW: ::c_int = 13; +pub const F_DUPFD_CLOEXEC: ::c_int = 14; + +pub const O_RDONLY: ::c_int = 0; +pub const O_WRONLY: ::c_int = 1; +pub const O_RDWR: ::c_int = 2; +pub const O_APPEND: ::c_int = 8; +pub const O_CREAT: ::c_int = 512; +pub const O_TRUNC: ::c_int = 1024; +pub const O_EXCL: ::c_int = 2048; +pub const O_SYNC: ::c_int = 8192; +pub const O_NONBLOCK: ::c_int = 16384; + +pub const O_ACCMODE: ::c_int = 3; +pub const O_CLOEXEC: ::c_int = 0x80000; + +pub const RTLD_LAZY: ::c_int = 0x1; + +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; + +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; + +pub const FIOCLEX: ::c_ulong = 0x20006601; +pub const FIONCLEX: ::c_ulong = 0x20006602; + +pub const S_BLKSIZE: ::mode_t = 1024; +pub const S_IREAD: ::mode_t = 256; +pub const S_IWRITE: ::mode_t = 128; +pub const S_IEXEC: ::mode_t = 64; +pub const S_ENFMT: ::mode_t = 1024; +pub const S_IFMT: ::mode_t = 61440; +pub const S_IFDIR: ::mode_t = 16384; +pub const S_IFCHR: ::mode_t = 8192; +pub const S_IFBLK: ::mode_t = 24576; +pub const S_IFREG: ::mode_t = 32768; +pub const S_IFLNK: ::mode_t = 40960; +pub const S_IFSOCK: ::mode_t = 49152; +pub const S_IFIFO: ::mode_t = 4096; +pub const S_IRUSR: ::mode_t = 256; +pub const S_IWUSR: ::mode_t = 128; +pub const S_IXUSR: ::mode_t = 64; +pub const S_IRGRP: ::mode_t = 32; +pub const S_IWGRP: ::mode_t = 16; +pub const S_IXGRP: ::mode_t = 8; +pub const S_IROTH: ::mode_t = 4; +pub const S_IWOTH: ::mode_t = 2; +pub const S_IXOTH: ::mode_t = 1; + +pub const SOL_TCP: ::c_int = 6; + +pub const PF_UNSPEC: ::c_int = 0; +pub const PF_INET: ::c_int = 2; +pub const PF_INET6: ::c_int = 23; + +pub const AF_UNSPEC: ::c_int = 0; +pub const AF_INET: ::c_int = 2; + +pub const CLOCK_REALTIME: ::clockid_t = 1; +pub const CLOCK_MONOTONIC: ::clockid_t = 4; +pub const CLOCK_BOOTTIME: ::clockid_t = 4; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; + +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; + +pub const SO_BINTIME: ::c_int = 0x2000; +pub const SO_NO_OFFLOAD: ::c_int = 0x4000; +pub const SO_NO_DDP: ::c_int = 0x8000; +pub const SO_REUSEPORT_LB: ::c_int = 0x10000; +pub const SO_LABEL: ::c_int = 0x1009; +pub const SO_PEERLABEL: ::c_int = 0x1010; +pub const SO_LISTENQLIMIT: ::c_int = 0x1011; +pub const SO_LISTENQLEN: ::c_int = 0x1012; +pub const SO_LISTENINCQLEN: ::c_int = 0x1013; +pub const SO_SETFIB: ::c_int = 0x1014; +pub const SO_USER_COOKIE: ::c_int = 0x1015; +pub const SO_PROTOCOL: ::c_int = 0x1016; +pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL; +pub const SO_VENDOR: ::c_int = 0x80000000; +pub const SO_DEBUG: ::c_int = 0x01; +pub const SO_ACCEPTCONN: ::c_int = 0x0002; +pub const SO_REUSEADDR: ::c_int = 0x0004; +pub const SO_KEEPALIVE: ::c_int = 0x0008; +pub const SO_DONTROUTE: ::c_int = 0x0010; +pub const SO_BROADCAST: ::c_int = 0x0020; +pub const SO_USELOOPBACK: ::c_int = 0x0040; +pub const SO_LINGER: ::c_int = 0x0080; +pub const SO_OOBINLINE: ::c_int = 0x0100; +pub const SO_REUSEPORT: ::c_int = 0x0200; +pub const SO_TIMESTAMP: ::c_int = 0x0400; +pub const SO_NOSIGPIPE: ::c_int = 0x0800; +pub const SO_ACCEPTFILTER: ::c_int = 0x1000; +pub const SO_SNDBUF: ::c_int = 0x1001; +pub const SO_RCVBUF: ::c_int = 0x1002; +pub const SO_SNDLOWAT: ::c_int = 0x1003; +pub const SO_RCVLOWAT: ::c_int = 0x1004; +pub const SO_SNDTIMEO: ::c_int = 0x1005; +pub const SO_RCVTIMEO: ::c_int = 0x1006; +cfg_if! { + if #[cfg(target_os = "horizon")] { + pub const SO_ERROR: ::c_int = 0x1009; + } else { + pub const SO_ERROR: ::c_int = 0x1007; + } +} +pub const SO_TYPE: ::c_int = 0x1008; + +pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC; + +pub const INET_ADDRSTRLEN: ::c_int = 16; + +// https://github. +// com/bminor/newlib/blob/master/newlib/libc/sys/linux/include/net/if.h#L121 +pub const IFF_UP: ::c_int = 0x1; // interface is up +pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid +pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging +pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net +pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link +pub const IFF_NOTRAILERS: ::c_int = 0x20; // avoid use of trailers +pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated +pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol +pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets +pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets +pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress +pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions +pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit +pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit +pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit +pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection +pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast + +pub const TCP_NODELAY: ::c_int = 8193; +pub const TCP_MAXSEG: ::c_int = 8194; +pub const TCP_NOPUSH: ::c_int = 4; +pub const TCP_NOOPT: ::c_int = 8; +pub const TCP_KEEPIDLE: ::c_int = 256; +pub const TCP_KEEPINTVL: ::c_int = 512; +pub const TCP_KEEPCNT: ::c_int = 1024; + +cfg_if! { + if #[cfg(target_os = "horizon")] { + pub const IP_TOS: ::c_int = 7; + } else { + pub const IP_TOS: ::c_int = 3; + } +} +pub const IP_TTL: ::c_int = 8; +pub const IP_MULTICAST_IF: ::c_int = 9; +pub const IP_MULTICAST_TTL: ::c_int = 10; +pub const IP_MULTICAST_LOOP: ::c_int = 11; +pub const IP_ADD_MEMBERSHIP: ::c_int = 11; +pub const IP_DROP_MEMBERSHIP: ::c_int = 12; + +pub const IPV6_UNICAST_HOPS: ::c_int = 4; +pub const IPV6_MULTICAST_IF: ::c_int = 9; +pub const IPV6_MULTICAST_HOPS: ::c_int = 10; +pub const IPV6_MULTICAST_LOOP: ::c_int = 11; +pub const IPV6_V6ONLY: ::c_int = 27; +pub const IPV6_JOIN_GROUP: ::c_int = 12; +pub const IPV6_LEAVE_GROUP: ::c_int = 13; +pub const IPV6_ADD_MEMBERSHIP: ::c_int = 12; +pub const IPV6_DROP_MEMBERSHIP: ::c_int = 13; + +pub const HOST_NOT_FOUND: ::c_int = 1; +pub const NO_DATA: ::c_int = 2; +pub const NO_ADDRESS: ::c_int = 2; +pub const NO_RECOVERY: ::c_int = 3; +pub const TRY_AGAIN: ::c_int = 4; + +pub const AI_PASSIVE: ::c_int = 1; +pub const AI_CANONNAME: ::c_int = 2; +pub const AI_NUMERICHOST: ::c_int = 4; +pub const AI_NUMERICSERV: ::c_int = 0; +pub const AI_ADDRCONFIG: ::c_int = 0; + +pub const NI_MAXHOST: ::c_int = 1025; +pub const NI_MAXSERV: ::c_int = 32; +pub const NI_NOFQDN: ::c_int = 1; +pub const NI_NUMERICHOST: ::c_int = 2; +pub const NI_NAMEREQD: ::c_int = 4; +pub const NI_NUMERICSERV: ::c_int = 0; +pub const NI_DGRAM: ::c_int = 0; + +pub const EAI_FAMILY: ::c_int = -303; +pub const EAI_MEMORY: ::c_int = -304; +pub const EAI_NONAME: ::c_int = -305; +pub const EAI_SOCKTYPE: ::c_int = -307; + +pub const EXIT_SUCCESS: ::c_int = 0; +pub const EXIT_FAILURE: ::c_int = 1; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +f! { + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + let fd = fd as usize; + (*set).fds_bits[fd / bits] &= !(1 << (fd % bits)); + return + } + + pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + let fd = fd as usize; + return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0 + } + + pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + let fd = fd as usize; + (*set).fds_bits[fd / bits] |= 1 << (fd % bits); + return + } + + pub fn FD_ZERO(set: *mut fd_set) -> () { + for slot in (*set).fds_bits.iter_mut() { + *slot = 0; + } + } +} + +extern "C" { + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + + #[cfg_attr(target_os = "linux", link_name = "__xpg_strerror_r")] + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; + pub fn labs(i: ::c_long) -> ::c_long; + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + #[cfg_attr(target_os = "espidf", link_name = "lwip_bind")] + pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int; + pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; + pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_getres(clock_id: ::clockid_t, res: *mut ::timespec) -> ::c_int; + #[cfg_attr(target_os = "espidf", link_name = "lwip_close")] + pub fn closesocket(sockfd: ::c_int) -> ::c_int; + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + #[cfg_attr(target_os = "espidf", link_name = "lwip_recvfrom")] + pub fn recvfrom( + fd: ::c_int, + buf: *mut ::c_void, + n: usize, + flags: ::c_int, + addr: *mut sockaddr, + addr_len: *mut socklen_t, + ) -> isize; + #[cfg(not(all( + libc_cfg_target_vendor, + target_arch = "powerpc", + target_vendor = "nintendo" + )))] + pub fn getnameinfo( + sa: *const sockaddr, + salen: socklen_t, + host: *mut ::c_char, + hostlen: socklen_t, + serv: *mut ::c_char, + servlen: socklen_t, + flags: ::c_int, + ) -> ::c_int; + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + pub fn fexecve( + fd: ::c_int, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn getgrgid_r( + gid: ::gid_t, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; + pub fn getgrnam_r( + name: *const ::c_char, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + pub fn getpwnam_r( + name: *const ::c_char, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn getpwuid_r( + uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; + pub fn pthread_atfork( + prepare: ::Option, + parent: ::Option, + child: ::Option, + ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; + pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + pub fn uname(buf: *mut ::utsname) -> ::c_int; +} + +mod generic; + +cfg_if! { + if #[cfg(target_os = "espidf")] { + mod espidf; + pub use self::espidf::*; + } else if #[cfg(target_os = "horizon")] { + mod horizon; + pub use self::horizon::*; + } else if #[cfg(target_arch = "arm")] { + mod arm; + pub use self::arm::*; + } else if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(target_arch = "powerpc")] { + mod powerpc; + pub use self::powerpc::*; + } else { + // Only tested on ARM so far. Other platforms might have different + // definitions for types and constants. + pub use target_arch_not_implemented; + } +} + +cfg_if! { + if #[cfg(libc_align)] { + #[macro_use] + mod align; + } else { + #[macro_use] + mod no_align; + } +} +expand_align!(); diff --git a/bash-5.1/vendor/libc/src/unix/newlib/no_align.rs b/bash-5.1/vendor/libc/src/unix/newlib/no_align.rs new file mode 100644 index 0000000000000000000000000000000000000000..ce3aca4ed57237c745fb576999bc07b3dec26072 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/newlib/no_align.rs @@ -0,0 +1,51 @@ +macro_rules! expand_align { + () => { + s! { + pub struct pthread_mutex_t { // Unverified + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc"))] + __align: [::c_long; 0], + #[cfg(not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")))] + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T], + } + + pub struct pthread_rwlock_t { // Unverified + #[cfg(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc"))] + __align: [::c_long; 0], + #[cfg(not(any(target_arch = "mips", + target_arch = "arm", + target_arch = "powerpc")))] + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T], + } + + pub struct pthread_mutexattr_t { // Unverified + #[cfg(any(target_arch = "x86_64", target_arch = "powerpc64", + target_arch = "mips64", target_arch = "s390x", + target_arch = "sparc64"))] + __align: [::c_int; 0], + #[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64", + target_arch = "mips64", target_arch = "s390x", + target_arch = "sparc64")))] + __align: [::c_long; 0], + size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T], + } + + pub struct pthread_cond_t { // Unverified + __align: [::c_longlong; 0], + size: [u8; ::__SIZEOF_PTHREAD_COND_T], + } + + pub struct pthread_condattr_t { // Unverified + __align: [::c_int; 0], + size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T], + } + } + }; +} diff --git a/bash-5.1/vendor/libc/src/unix/newlib/powerpc/mod.rs b/bash-5.1/vendor/libc/src/unix/newlib/powerpc/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..6bed1ce27acbf30606bb8207cceadbca7a40a0fb --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/newlib/powerpc/mod.rs @@ -0,0 +1,16 @@ +pub type clock_t = ::c_ulong; +pub type c_char = u8; +pub type wchar_t = ::c_int; + +pub type c_long = i32; +pub type c_ulong = u32; + +pub use crate::unix::newlib::generic::{sigset_t, stat}; + +// the newlib shipped with devkitPPC does not support the following components: +// - sockaddr +// - AF_INET6 +// - FIONBIO +// - POLL* +// - SOL_SOCKET +// - MSG_* diff --git a/bash-5.1/vendor/libc/src/unix/no_align.rs b/bash-5.1/vendor/libc/src/unix/no_align.rs new file mode 100644 index 0000000000000000000000000000000000000000..f6b9f4c12d4bab7e069ff89b08f878362b31d98e --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/no_align.rs @@ -0,0 +1,6 @@ +s! { + pub struct in6_addr { + pub s6_addr: [u8; 16], + __align: [u32; 0], + } +} diff --git a/bash-5.1/vendor/libc/src/unix/redox/mod.rs b/bash-5.1/vendor/libc/src/unix/redox/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..bc46d4942a43daf1796b6419d32300d491d8d9ae --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/redox/mod.rs @@ -0,0 +1,1227 @@ +pub type c_char = i8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type wchar_t = i32; + +pub type blkcnt_t = ::c_ulong; +pub type blksize_t = ::c_long; +pub type clock_t = ::c_long; +pub type clockid_t = ::c_int; +pub type dev_t = ::c_long; +pub type fsblkcnt_t = ::c_ulong; +pub type fsfilcnt_t = ::c_ulong; +pub type ino_t = ::c_ulong; +pub type mode_t = ::c_int; +pub type nfds_t = ::c_ulong; +pub type nlink_t = ::c_ulong; +pub type off_t = ::c_long; +pub type pthread_t = *mut ::c_void; +pub type pthread_attr_t = *mut ::c_void; +pub type pthread_cond_t = *mut ::c_void; +pub type pthread_condattr_t = *mut ::c_void; +// Must be usize due to libstd/sys_common/thread_local.rs, +// should technically be *mut ::c_void +pub type pthread_key_t = usize; +pub type pthread_mutex_t = *mut ::c_void; +pub type pthread_mutexattr_t = *mut ::c_void; +pub type pthread_rwlock_t = *mut ::c_void; +pub type pthread_rwlockattr_t = *mut ::c_void; +pub type rlim_t = ::c_ulonglong; +pub type sa_family_t = u16; +pub type sem_t = *mut ::c_void; +pub type sigset_t = ::c_ulong; +pub type socklen_t = u32; +pub type speed_t = u32; +pub type suseconds_t = ::c_int; +pub type tcflag_t = u32; +pub type time_t = ::c_long; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { + *self + } +} + +s_no_extra_traits! { + #[repr(C)] + pub struct utsname { + pub sysname: [::c_char; UTSLENGTH], + pub nodename: [::c_char; UTSLENGTH], + pub release: [::c_char; UTSLENGTH], + pub version: [::c_char; UTSLENGTH], + pub machine: [::c_char; UTSLENGTH], + pub domainname: [::c_char; UTSLENGTH], + } + + pub struct dirent { + pub d_ino: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: ::c_ushort, + pub d_type: ::c_uchar, + pub d_name: [::c_char; 256], + } + + pub struct sockaddr_un { + pub sun_family: ::sa_family_t, + pub sun_path: [::c_char; 108] + } + + pub struct sockaddr_storage { + pub ss_family: ::sa_family_t, + __ss_padding: [ + u8; + 128 - + ::core::mem::size_of::() - + ::core::mem::size_of::() + ], + __ss_align: ::c_ulong, + } +} + +s! { + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + pub ai_addrlen: ::size_t, + pub ai_canonname: *mut ::c_char, + pub ai_addr: *mut ::sockaddr, + pub ai_next: *mut ::addrinfo, + } + + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *mut ::c_void, + } + + pub struct epoll_event { + pub events: u32, + pub u64: u64, + pub _pad: u64, + } + + pub struct fd_set { + fds_bits: [::c_ulong; ::FD_SETSIZE / ULONG_SIZE], + } + + pub struct in_addr { + pub s_addr: ::in_addr_t, + } + + pub struct ip_mreq { + pub imr_multiaddr: ::in_addr, + pub imr_interface: ::in_addr, + } + + pub struct lconv { + pub currency_symbol: *const ::c_char, + pub decimal_point: *const ::c_char, + pub frac_digits: ::c_char, + pub grouping: *const ::c_char, + pub int_curr_symbol: *const ::c_char, + pub int_frac_digits: ::c_char, + pub mon_decimal_point: *const ::c_char, + pub mon_grouping: *const ::c_char, + pub mon_thousands_sep: *const ::c_char, + pub negative_sign: *const ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub n_sign_posn: ::c_char, + pub positive_sign: *const ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub thousands_sep: *const ::c_char, + } + + pub struct passwd { + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_gecos: *mut ::c_char, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char, + } + + pub struct sigaction { + pub sa_sigaction: ::sighandler_t, + pub sa_flags: ::c_ulong, + pub sa_restorer: ::Option, + pub sa_mask: ::sigset_t, + } + + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_errno: ::c_int, + pub si_code: ::c_int, + _pad: [::c_int; 29], + _align: [usize; 0], + } + + pub struct sockaddr { + pub sa_family: ::sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in { + pub sin_family: ::sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [::c_char; 8], + } + + pub struct sockaddr_in6 { + pub sin6_family: ::sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + _pad: [::c_char; 24], + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_line: ::cc_t, + pub c_cc: [::cc_t; ::NCCS], + pub c_ispeed: ::speed_t, + pub c_ospeed: ::speed_t, + } + + pub struct tm { + pub tm_sec: ::c_int, + pub tm_min: ::c_int, + pub tm_hour: ::c_int, + pub tm_mday: ::c_int, + pub tm_mon: ::c_int, + pub tm_year: ::c_int, + pub tm_wday: ::c_int, + pub tm_yday: ::c_int, + pub tm_isdst: ::c_int, + pub tm_gmtoff: ::c_long, + pub tm_zone: *const ::c_char, + } +} + +pub const UTSLENGTH: usize = 65; + +// intentionally not public, only used for fd_set +cfg_if! { + if #[cfg(target_pointer_width = "32")] { + const ULONG_SIZE: usize = 32; + } else if #[cfg(target_pointer_width = "64")] { + const ULONG_SIZE: usize = 64; + } else { + // Unknown target_pointer_width + } +} + +// limits.h +pub const PATH_MAX: ::c_int = 4096; + +// fcntl.h +pub const F_GETLK: ::c_int = 5; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; + +// FIXME: relibc { +pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; +// } + +// dlfcn.h +pub const RTLD_LAZY: ::c_int = 0x0001; +pub const RTLD_NOW: ::c_int = 0x0002; +pub const RTLD_GLOBAL: ::c_int = 0x0100; +pub const RTLD_LOCAL: ::c_int = 0x0000; + +// errno.h +pub const EPERM: ::c_int = 1; /* Operation not permitted */ +pub const ENOENT: ::c_int = 2; /* No such file or directory */ +pub const ESRCH: ::c_int = 3; /* No such process */ +pub const EINTR: ::c_int = 4; /* Interrupted system call */ +pub const EIO: ::c_int = 5; /* I/O error */ +pub const ENXIO: ::c_int = 6; /* No such device or address */ +pub const E2BIG: ::c_int = 7; /* Argument list too long */ +pub const ENOEXEC: ::c_int = 8; /* Exec format error */ +pub const EBADF: ::c_int = 9; /* Bad file number */ +pub const ECHILD: ::c_int = 10; /* No child processes */ +pub const EAGAIN: ::c_int = 11; /* Try again */ +pub const ENOMEM: ::c_int = 12; /* Out of memory */ +pub const EACCES: ::c_int = 13; /* Permission denied */ +pub const EFAULT: ::c_int = 14; /* Bad address */ +pub const ENOTBLK: ::c_int = 15; /* Block device required */ +pub const EBUSY: ::c_int = 16; /* Device or resource busy */ +pub const EEXIST: ::c_int = 17; /* File exists */ +pub const EXDEV: ::c_int = 18; /* Cross-device link */ +pub const ENODEV: ::c_int = 19; /* No such device */ +pub const ENOTDIR: ::c_int = 20; /* Not a directory */ +pub const EISDIR: ::c_int = 21; /* Is a directory */ +pub const EINVAL: ::c_int = 22; /* Invalid argument */ +pub const ENFILE: ::c_int = 23; /* File table overflow */ +pub const EMFILE: ::c_int = 24; /* Too many open files */ +pub const ENOTTY: ::c_int = 25; /* Not a typewriter */ +pub const ETXTBSY: ::c_int = 26; /* Text file busy */ +pub const EFBIG: ::c_int = 27; /* File too large */ +pub const ENOSPC: ::c_int = 28; /* No space left on device */ +pub const ESPIPE: ::c_int = 29; /* Illegal seek */ +pub const EROFS: ::c_int = 30; /* Read-only file system */ +pub const EMLINK: ::c_int = 31; /* Too many links */ +pub const EPIPE: ::c_int = 32; /* Broken pipe */ +pub const EDOM: ::c_int = 33; /* Math argument out of domain of func */ +pub const ERANGE: ::c_int = 34; /* Math result not representable */ +pub const EDEADLK: ::c_int = 35; /* Resource deadlock would occur */ +pub const ENAMETOOLONG: ::c_int = 36; /* File name too long */ +pub const ENOLCK: ::c_int = 37; /* No record locks available */ +pub const ENOSYS: ::c_int = 38; /* Function not implemented */ +pub const ENOTEMPTY: ::c_int = 39; /* Directory not empty */ +pub const ELOOP: ::c_int = 40; /* Too many symbolic links encountered */ +pub const EWOULDBLOCK: ::c_int = 41; /* Operation would block */ +pub const ENOMSG: ::c_int = 42; /* No message of desired type */ +pub const EIDRM: ::c_int = 43; /* Identifier removed */ +pub const ECHRNG: ::c_int = 44; /* Channel number out of range */ +pub const EL2NSYNC: ::c_int = 45; /* Level 2 not synchronized */ +pub const EL3HLT: ::c_int = 46; /* Level 3 halted */ +pub const EL3RST: ::c_int = 47; /* Level 3 reset */ +pub const ELNRNG: ::c_int = 48; /* Link number out of range */ +pub const EUNATCH: ::c_int = 49; /* Protocol driver not attached */ +pub const ENOCSI: ::c_int = 50; /* No CSI structure available */ +pub const EL2HLT: ::c_int = 51; /* Level 2 halted */ +pub const EBADE: ::c_int = 52; /* Invalid exchange */ +pub const EBADR: ::c_int = 53; /* Invalid request descriptor */ +pub const EXFULL: ::c_int = 54; /* Exchange full */ +pub const ENOANO: ::c_int = 55; /* No anode */ +pub const EBADRQC: ::c_int = 56; /* Invalid request code */ +pub const EBADSLT: ::c_int = 57; /* Invalid slot */ +pub const EDEADLOCK: ::c_int = 58; /* Resource deadlock would occur */ +pub const EBFONT: ::c_int = 59; /* Bad font file format */ +pub const ENOSTR: ::c_int = 60; /* Device not a stream */ +pub const ENODATA: ::c_int = 61; /* No data available */ +pub const ETIME: ::c_int = 62; /* Timer expired */ +pub const ENOSR: ::c_int = 63; /* Out of streams resources */ +pub const ENONET: ::c_int = 64; /* Machine is not on the network */ +pub const ENOPKG: ::c_int = 65; /* Package not installed */ +pub const EREMOTE: ::c_int = 66; /* Object is remote */ +pub const ENOLINK: ::c_int = 67; /* Link has been severed */ +pub const EADV: ::c_int = 68; /* Advertise error */ +pub const ESRMNT: ::c_int = 69; /* Srmount error */ +pub const ECOMM: ::c_int = 70; /* Communication error on send */ +pub const EPROTO: ::c_int = 71; /* Protocol error */ +pub const EMULTIHOP: ::c_int = 72; /* Multihop attempted */ +pub const EDOTDOT: ::c_int = 73; /* RFS specific error */ +pub const EBADMSG: ::c_int = 74; /* Not a data message */ +pub const EOVERFLOW: ::c_int = 75; /* Value too large for defined data type */ +pub const ENOTUNIQ: ::c_int = 76; /* Name not unique on network */ +pub const EBADFD: ::c_int = 77; /* File descriptor in bad state */ +pub const EREMCHG: ::c_int = 78; /* Remote address changed */ +pub const ELIBACC: ::c_int = 79; /* Can not access a needed shared library */ +pub const ELIBBAD: ::c_int = 80; /* Accessing a corrupted shared library */ +pub const ELIBSCN: ::c_int = 81; /* .lib section in a.out corrupted */ +/* Attempting to link in too many shared libraries */ +pub const ELIBMAX: ::c_int = 82; +pub const ELIBEXEC: ::c_int = 83; /* Cannot exec a shared library directly */ +pub const EILSEQ: ::c_int = 84; /* Illegal byte sequence */ +/* Interrupted system call should be restarted */ +pub const ERESTART: ::c_int = 85; +pub const ESTRPIPE: ::c_int = 86; /* Streams pipe error */ +pub const EUSERS: ::c_int = 87; /* Too many users */ +pub const ENOTSOCK: ::c_int = 88; /* Socket operation on non-socket */ +pub const EDESTADDRREQ: ::c_int = 89; /* Destination address required */ +pub const EMSGSIZE: ::c_int = 90; /* Message too long */ +pub const EPROTOTYPE: ::c_int = 91; /* Protocol wrong type for socket */ +pub const ENOPROTOOPT: ::c_int = 92; /* Protocol not available */ +pub const EPROTONOSUPPORT: ::c_int = 93; /* Protocol not supported */ +pub const ESOCKTNOSUPPORT: ::c_int = 94; /* Socket type not supported */ +/* Operation not supported on transport endpoint */ +pub const EOPNOTSUPP: ::c_int = 95; +pub const EPFNOSUPPORT: ::c_int = 96; /* Protocol family not supported */ +/* Address family not supported by protocol */ +pub const EAFNOSUPPORT: ::c_int = 97; +pub const EADDRINUSE: ::c_int = 98; /* Address already in use */ +pub const EADDRNOTAVAIL: ::c_int = 99; /* Cannot assign requested address */ +pub const ENETDOWN: ::c_int = 100; /* Network is down */ +pub const ENETUNREACH: ::c_int = 101; /* Network is unreachable */ +/* Network dropped connection because of reset */ +pub const ENETRESET: ::c_int = 102; +pub const ECONNABORTED: ::c_int = 103; /* Software caused connection abort */ +pub const ECONNRESET: ::c_int = 104; /* Connection reset by peer */ +pub const ENOBUFS: ::c_int = 105; /* No buffer space available */ +pub const EISCONN: ::c_int = 106; /* Transport endpoint is already connected */ +pub const ENOTCONN: ::c_int = 107; /* Transport endpoint is not connected */ +/* Cannot send after transport endpoint shutdown */ +pub const ESHUTDOWN: ::c_int = 108; +pub const ETOOMANYREFS: ::c_int = 109; /* Too many references: cannot splice */ +pub const ETIMEDOUT: ::c_int = 110; /* Connection timed out */ +pub const ECONNREFUSED: ::c_int = 111; /* Connection refused */ +pub const EHOSTDOWN: ::c_int = 112; /* Host is down */ +pub const EHOSTUNREACH: ::c_int = 113; /* No route to host */ +pub const EALREADY: ::c_int = 114; /* Operation already in progress */ +pub const EINPROGRESS: ::c_int = 115; /* Operation now in progress */ +pub const ESTALE: ::c_int = 116; /* Stale NFS file handle */ +pub const EUCLEAN: ::c_int = 117; /* Structure needs cleaning */ +pub const ENOTNAM: ::c_int = 118; /* Not a XENIX named type file */ +pub const ENAVAIL: ::c_int = 119; /* No XENIX semaphores available */ +pub const EISNAM: ::c_int = 120; /* Is a named type file */ +pub const EREMOTEIO: ::c_int = 121; /* Remote I/O error */ +pub const EDQUOT: ::c_int = 122; /* Quota exceeded */ +pub const ENOMEDIUM: ::c_int = 123; /* No medium found */ +pub const EMEDIUMTYPE: ::c_int = 124; /* Wrong medium type */ +pub const ECANCELED: ::c_int = 125; /* Operation Canceled */ +pub const ENOKEY: ::c_int = 126; /* Required key not available */ +pub const EKEYEXPIRED: ::c_int = 127; /* Key has expired */ +pub const EKEYREVOKED: ::c_int = 128; /* Key has been revoked */ +pub const EKEYREJECTED: ::c_int = 129; /* Key was rejected by service */ +pub const EOWNERDEAD: ::c_int = 130; /* Owner died */ +pub const ENOTRECOVERABLE: ::c_int = 131; /* State not recoverable */ + +// fcntl.h +pub const F_DUPFD: ::c_int = 0; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; +// FIXME: relibc { +pub const F_DUPFD_CLOEXEC: ::c_int = ::F_DUPFD; +// } +pub const FD_CLOEXEC: ::c_int = 0x0100_0000; +pub const O_RDONLY: ::c_int = 0x0001_0000; +pub const O_WRONLY: ::c_int = 0x0002_0000; +pub const O_RDWR: ::c_int = 0x0003_0000; +pub const O_ACCMODE: ::c_int = 0x0003_0000; +pub const O_NONBLOCK: ::c_int = 0x0004_0000; +pub const O_APPEND: ::c_int = 0x0008_0000; +pub const O_SHLOCK: ::c_int = 0x0010_0000; +pub const O_EXLOCK: ::c_int = 0x0020_0000; +pub const O_ASYNC: ::c_int = 0x0040_0000; +pub const O_FSYNC: ::c_int = 0x0080_0000; +pub const O_CLOEXEC: ::c_int = 0x0100_0000; +pub const O_CREAT: ::c_int = 0x0200_0000; +pub const O_TRUNC: ::c_int = 0x0400_0000; +pub const O_EXCL: ::c_int = 0x0800_0000; +pub const O_DIRECTORY: ::c_int = 0x1000_0000; +pub const O_PATH: ::c_int = 0x2000_0000; +pub const O_SYMLINK: ::c_int = 0x4000_0000; +// Negative to allow it to be used as int +// FIXME: Fix negative values missing from includes +pub const O_NOFOLLOW: ::c_int = -0x8000_0000; + +// netdb.h +pub const AI_PASSIVE: ::c_int = 0x0001; +pub const AI_CANONNAME: ::c_int = 0x0002; +pub const AI_NUMERICHOST: ::c_int = 0x0004; +pub const AI_V4MAPPED: ::c_int = 0x0008; +pub const AI_ALL: ::c_int = 0x0010; +pub const AI_ADDRCONFIG: ::c_int = 0x0020; +pub const AI_NUMERICSERV: ::c_int = 0x0400; +pub const EAI_BADFLAGS: ::c_int = -1; +pub const EAI_NONAME: ::c_int = -2; +pub const EAI_AGAIN: ::c_int = -3; +pub const EAI_FAIL: ::c_int = -4; +pub const EAI_NODATA: ::c_int = -5; +pub const EAI_FAMILY: ::c_int = -6; +pub const EAI_SOCKTYPE: ::c_int = -7; +pub const EAI_SERVICE: ::c_int = -8; +pub const EAI_ADDRFAMILY: ::c_int = -9; +pub const EAI_MEMORY: ::c_int = -10; +pub const EAI_SYSTEM: ::c_int = -11; +pub const EAI_OVERFLOW: ::c_int = -12; +pub const NI_MAXHOST: ::c_int = 1025; +pub const NI_MAXSERV: ::c_int = 32; +pub const NI_NUMERICHOST: ::c_int = 0x0001; +pub const NI_NUMERICSERV: ::c_int = 0x0002; +pub const NI_NOFQDN: ::c_int = 0x0004; +pub const NI_NAMEREQD: ::c_int = 0x0008; +pub const NI_DGRAM: ::c_int = 0x0010; + +// netinet/in.h +// FIXME: relibc { +pub const IP_TTL: ::c_int = 2; +pub const IPV6_UNICAST_HOPS: ::c_int = 16; +pub const IPV6_MULTICAST_IF: ::c_int = 17; +pub const IPV6_MULTICAST_HOPS: ::c_int = 18; +pub const IPV6_MULTICAST_LOOP: ::c_int = 19; +pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20; +pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21; +pub const IPV6_V6ONLY: ::c_int = 26; +pub const IP_MULTICAST_IF: ::c_int = 32; +pub const IP_MULTICAST_TTL: ::c_int = 33; +pub const IP_MULTICAST_LOOP: ::c_int = 34; +pub const IP_ADD_MEMBERSHIP: ::c_int = 35; +pub const IP_DROP_MEMBERSHIP: ::c_int = 36; +// } + +// netinet/tcp.h +pub const TCP_NODELAY: ::c_int = 1; +// FIXME: relibc { +pub const TCP_KEEPIDLE: ::c_int = 1; +// } + +// poll.h +pub const POLLIN: ::c_short = 0x001; +pub const POLLPRI: ::c_short = 0x002; +pub const POLLOUT: ::c_short = 0x004; +pub const POLLERR: ::c_short = 0x008; +pub const POLLHUP: ::c_short = 0x010; +pub const POLLNVAL: ::c_short = 0x020; + +// pthread.h +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1; +pub const PTHREAD_MUTEX_INITIALIZER: ::pthread_mutex_t = -1isize as *mut _; +pub const PTHREAD_COND_INITIALIZER: ::pthread_cond_t = -1isize as *mut _; +pub const PTHREAD_RWLOCK_INITIALIZER: ::pthread_rwlock_t = -1isize as *mut _; +pub const PTHREAD_STACK_MIN: ::size_t = 4096; + +// signal.h +pub const SIG_BLOCK: ::c_int = 0; +pub const SIG_UNBLOCK: ::c_int = 1; +pub const SIG_SETMASK: ::c_int = 2; +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGTRAP: ::c_int = 5; +pub const SIGABRT: ::c_int = 6; +pub const SIGBUS: ::c_int = 7; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGUSR1: ::c_int = 10; +pub const SIGSEGV: ::c_int = 11; +pub const SIGUSR2: ::c_int = 12; +pub const SIGPIPE: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; +pub const SIGSTKFLT: ::c_int = 16; +pub const SIGCHLD: ::c_int = 17; +pub const SIGCONT: ::c_int = 18; +pub const SIGSTOP: ::c_int = 19; +pub const SIGTSTP: ::c_int = 20; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; +pub const SIGURG: ::c_int = 23; +pub const SIGXCPU: ::c_int = 24; +pub const SIGXFSZ: ::c_int = 25; +pub const SIGVTALRM: ::c_int = 26; +pub const SIGPROF: ::c_int = 27; +pub const SIGWINCH: ::c_int = 28; +pub const SIGIO: ::c_int = 29; +pub const SIGPWR: ::c_int = 30; +pub const SIGSYS: ::c_int = 31; +pub const NSIG: ::c_int = 32; + +pub const SA_NOCLDSTOP: ::c_ulong = 0x00000001; +pub const SA_NOCLDWAIT: ::c_ulong = 0x00000002; +pub const SA_SIGINFO: ::c_ulong = 0x00000004; +pub const SA_RESTORER: ::c_ulong = 0x04000000; +pub const SA_ONSTACK: ::c_ulong = 0x08000000; +pub const SA_RESTART: ::c_ulong = 0x10000000; +pub const SA_NODEFER: ::c_ulong = 0x40000000; +pub const SA_RESETHAND: ::c_ulong = 0x80000000; + +// sys/file.h +pub const LOCK_SH: ::c_int = 1; +pub const LOCK_EX: ::c_int = 2; +pub const LOCK_NB: ::c_int = 4; +pub const LOCK_UN: ::c_int = 8; + +// sys/epoll.h +pub const EPOLL_CLOEXEC: ::c_int = 0x0100_0000; +pub const EPOLL_CTL_ADD: ::c_int = 1; +pub const EPOLL_CTL_DEL: ::c_int = 2; +pub const EPOLL_CTL_MOD: ::c_int = 3; +pub const EPOLLIN: ::c_int = 1; +pub const EPOLLPRI: ::c_int = 0; +pub const EPOLLOUT: ::c_int = 2; +pub const EPOLLRDNORM: ::c_int = 0; +pub const EPOLLNVAL: ::c_int = 0; +pub const EPOLLRDBAND: ::c_int = 0; +pub const EPOLLWRNORM: ::c_int = 0; +pub const EPOLLWRBAND: ::c_int = 0; +pub const EPOLLMSG: ::c_int = 0; +pub const EPOLLERR: ::c_int = 0; +pub const EPOLLHUP: ::c_int = 0; +pub const EPOLLRDHUP: ::c_int = 0; +pub const EPOLLEXCLUSIVE: ::c_int = 0; +pub const EPOLLWAKEUP: ::c_int = 0; +pub const EPOLLONESHOT: ::c_int = 0; +pub const EPOLLET: ::c_int = 0; + +// sys/stat.h +pub const S_IFMT: ::c_int = 0o0_170_000; +pub const S_IFDIR: ::c_int = 0o040_000; +pub const S_IFCHR: ::c_int = 0o020_000; +pub const S_IFBLK: ::c_int = 0o060_000; +pub const S_IFREG: ::c_int = 0o100_000; +pub const S_IFIFO: ::c_int = 0o010_000; +pub const S_IFLNK: ::c_int = 0o120_000; +pub const S_IFSOCK: ::c_int = 0o140_000; +pub const S_IRWXU: ::c_int = 0o0_700; +pub const S_IRUSR: ::c_int = 0o0_400; +pub const S_IWUSR: ::c_int = 0o0_200; +pub const S_IXUSR: ::c_int = 0o0_100; +pub const S_IRWXG: ::c_int = 0o0_070; +pub const S_IRGRP: ::c_int = 0o0_040; +pub const S_IWGRP: ::c_int = 0o0_020; +pub const S_IXGRP: ::c_int = 0o0_010; +pub const S_IRWXO: ::c_int = 0o0_007; +pub const S_IROTH: ::c_int = 0o0_004; +pub const S_IWOTH: ::c_int = 0o0_002; +pub const S_IXOTH: ::c_int = 0o0_001; + +// stdlib.h +pub const EXIT_SUCCESS: ::c_int = 0; +pub const EXIT_FAILURE: ::c_int = 1; + +// sys/ioctl.h +// FIXME: relibc { +pub const FIONBIO: ::c_ulong = 0x5421; +pub const FIOCLEX: ::c_ulong = 0x5451; +// } +pub const TCGETS: ::c_ulong = 0x5401; +pub const TCSETS: ::c_ulong = 0x5402; +pub const TCFLSH: ::c_ulong = 0x540B; +pub const TIOCGPGRP: ::c_ulong = 0x540F; +pub const TIOCSPGRP: ::c_ulong = 0x5410; +pub const TIOCGWINSZ: ::c_ulong = 0x5413; +pub const TIOCSWINSZ: ::c_ulong = 0x5414; + +// sys/mman.h +pub const PROT_NONE: ::c_int = 0x0000; +pub const PROT_READ: ::c_int = 0x0004; +pub const PROT_WRITE: ::c_int = 0x0002; +pub const PROT_EXEC: ::c_int = 0x0001; + +pub const MAP_SHARED: ::c_int = 0x0001; +pub const MAP_PRIVATE: ::c_int = 0x0002; +pub const MAP_ANON: ::c_int = 0x0020; +pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; +pub const MAP_FIXED: ::c_int = 0x0010; +pub const MAP_FAILED: *mut ::c_void = !0 as _; + +pub const MS_ASYNC: ::c_int = 0x0001; +pub const MS_INVALIDATE: ::c_int = 0x0002; +pub const MS_SYNC: ::c_int = 0x0004; + +// sys/select.h +pub const FD_SETSIZE: usize = 1024; + +// sys/socket.h +pub const AF_INET: ::c_int = 2; +pub const AF_INET6: ::c_int = 10; +pub const AF_UNIX: ::c_int = 1; +pub const AF_UNSPEC: ::c_int = 0; +pub const PF_INET: ::c_int = 2; +pub const PF_INET6: ::c_int = 10; +pub const PF_UNIX: ::c_int = 1; +pub const PF_UNSPEC: ::c_int = 0; +pub const MSG_CTRUNC: ::c_int = 8; +pub const MSG_DONTROUTE: ::c_int = 4; +pub const MSG_EOR: ::c_int = 128; +pub const MSG_OOB: ::c_int = 1; +pub const MSG_PEEK: ::c_int = 2; +pub const MSG_TRUNC: ::c_int = 32; +pub const MSG_WAITALL: ::c_int = 256; +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; +pub const SO_DEBUG: ::c_int = 1; +pub const SO_REUSEADDR: ::c_int = 2; +pub const SO_TYPE: ::c_int = 3; +pub const SO_ERROR: ::c_int = 4; +pub const SO_DONTROUTE: ::c_int = 5; +pub const SO_BROADCAST: ::c_int = 6; +pub const SO_SNDBUF: ::c_int = 7; +pub const SO_RCVBUF: ::c_int = 8; +pub const SO_KEEPALIVE: ::c_int = 9; +pub const SO_OOBINLINE: ::c_int = 10; +pub const SO_NO_CHECK: ::c_int = 11; +pub const SO_PRIORITY: ::c_int = 12; +pub const SO_LINGER: ::c_int = 13; +pub const SO_BSDCOMPAT: ::c_int = 14; +pub const SO_REUSEPORT: ::c_int = 15; +pub const SO_PASSCRED: ::c_int = 16; +pub const SO_PEERCRED: ::c_int = 17; +pub const SO_RCVLOWAT: ::c_int = 18; +pub const SO_SNDLOWAT: ::c_int = 19; +pub const SO_RCVTIMEO: ::c_int = 20; +pub const SO_SNDTIMEO: ::c_int = 21; +pub const SO_ACCEPTCONN: ::c_int = 30; +pub const SO_PEERSEC: ::c_int = 31; +pub const SO_SNDBUFFORCE: ::c_int = 32; +pub const SO_RCVBUFFORCE: ::c_int = 33; +pub const SO_PROTOCOL: ::c_int = 38; +pub const SO_DOMAIN: ::c_int = 39; +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_NONBLOCK: ::c_int = 0o4_000; +pub const SOCK_CLOEXEC: ::c_int = 0o2_000_000; +pub const SOCK_SEQPACKET: ::c_int = 5; +pub const SOL_SOCKET: ::c_int = 1; + +// sys/termios.h +pub const VEOF: usize = 0; +pub const VEOL: usize = 1; +pub const VEOL2: usize = 2; +pub const VERASE: usize = 3; +pub const VWERASE: usize = 4; +pub const VKILL: usize = 5; +pub const VREPRINT: usize = 6; +pub const VSWTC: usize = 7; +pub const VINTR: usize = 8; +pub const VQUIT: usize = 9; +pub const VSUSP: usize = 10; +pub const VSTART: usize = 12; +pub const VSTOP: usize = 13; +pub const VLNEXT: usize = 14; +pub const VDISCARD: usize = 15; +pub const VMIN: usize = 16; +pub const VTIME: usize = 17; +pub const NCCS: usize = 32; + +pub const IGNBRK: ::tcflag_t = 0o000_001; +pub const BRKINT: ::tcflag_t = 0o000_002; +pub const IGNPAR: ::tcflag_t = 0o000_004; +pub const PARMRK: ::tcflag_t = 0o000_010; +pub const INPCK: ::tcflag_t = 0o000_020; +pub const ISTRIP: ::tcflag_t = 0o000_040; +pub const INLCR: ::tcflag_t = 0o000_100; +pub const IGNCR: ::tcflag_t = 0o000_200; +pub const ICRNL: ::tcflag_t = 0o000_400; +pub const IXON: ::tcflag_t = 0o001_000; +pub const IXOFF: ::tcflag_t = 0o002_000; + +pub const OPOST: ::tcflag_t = 0o000_001; +pub const ONLCR: ::tcflag_t = 0o000_002; +pub const OLCUC: ::tcflag_t = 0o000_004; +pub const OCRNL: ::tcflag_t = 0o000_010; +pub const ONOCR: ::tcflag_t = 0o000_020; +pub const ONLRET: ::tcflag_t = 0o000_040; +pub const OFILL: ::tcflag_t = 0o0000_100; +pub const OFDEL: ::tcflag_t = 0o0000_200; + +pub const B0: speed_t = 0o000_000; +pub const B50: speed_t = 0o000_001; +pub const B75: speed_t = 0o000_002; +pub const B110: speed_t = 0o000_003; +pub const B134: speed_t = 0o000_004; +pub const B150: speed_t = 0o000_005; +pub const B200: speed_t = 0o000_006; +pub const B300: speed_t = 0o000_007; +pub const B600: speed_t = 0o000_010; +pub const B1200: speed_t = 0o000_011; +pub const B1800: speed_t = 0o000_012; +pub const B2400: speed_t = 0o000_013; +pub const B4800: speed_t = 0o000_014; +pub const B9600: speed_t = 0o000_015; +pub const B19200: speed_t = 0o000_016; +pub const B38400: speed_t = 0o000_017; + +pub const B57600: speed_t = 0o0_020; +pub const B115200: speed_t = 0o0_021; +pub const B230400: speed_t = 0o0_022; +pub const B460800: speed_t = 0o0_023; +pub const B500000: speed_t = 0o0_024; +pub const B576000: speed_t = 0o0_025; +pub const B921600: speed_t = 0o0_026; +pub const B1000000: speed_t = 0o0_027; +pub const B1152000: speed_t = 0o0_030; +pub const B1500000: speed_t = 0o0_031; +pub const B2000000: speed_t = 0o0_032; +pub const B2500000: speed_t = 0o0_033; +pub const B3000000: speed_t = 0o0_034; +pub const B3500000: speed_t = 0o0_035; +pub const B4000000: speed_t = 0o0_036; + +pub const CSIZE: ::tcflag_t = 0o001_400; +pub const CS5: ::tcflag_t = 0o000_000; +pub const CS6: ::tcflag_t = 0o000_400; +pub const CS7: ::tcflag_t = 0o001_000; +pub const CS8: ::tcflag_t = 0o001_400; + +pub const CSTOPB: ::tcflag_t = 0o002_000; +pub const CREAD: ::tcflag_t = 0o004_000; +pub const PARENB: ::tcflag_t = 0o010_000; +pub const PARODD: ::tcflag_t = 0o020_000; +pub const HUPCL: ::tcflag_t = 0o040_000; + +pub const CLOCAL: ::tcflag_t = 0o0100000; + +pub const ISIG: ::tcflag_t = 0x0000_0080; +pub const ICANON: ::tcflag_t = 0x0000_0100; +pub const ECHO: ::tcflag_t = 0x0000_0008; +pub const ECHOE: ::tcflag_t = 0x0000_0002; +pub const ECHOK: ::tcflag_t = 0x0000_0004; +pub const ECHONL: ::tcflag_t = 0x0000_0010; +pub const NOFLSH: ::tcflag_t = 0x8000_0000; +pub const TOSTOP: ::tcflag_t = 0x0040_0000; +pub const IEXTEN: ::tcflag_t = 0x0000_0400; + +pub const TCOOFF: ::c_int = 0; +pub const TCOON: ::c_int = 1; +pub const TCIOFF: ::c_int = 2; +pub const TCION: ::c_int = 3; + +pub const TCIFLUSH: ::c_int = 0; +pub const TCOFLUSH: ::c_int = 1; +pub const TCIOFLUSH: ::c_int = 2; + +pub const TCSANOW: ::c_int = 0; +pub const TCSADRAIN: ::c_int = 1; +pub const TCSAFLUSH: ::c_int = 2; + +// sys/wait.h +pub const WNOHANG: ::c_int = 1; +pub const WUNTRACED: ::c_int = 2; + +pub const WSTOPPED: ::c_int = 2; +pub const WEXITED: ::c_int = 4; +pub const WCONTINUED: ::c_int = 8; +pub const WNOWAIT: ::c_int = 0x0100_0000; + +pub const __WNOTHREAD: ::c_int = 0x2000_0000; +pub const __WALL: ::c_int = 0x4000_0000; +#[allow(overflowing_literals)] +pub const __WCLONE: ::c_int = 0x8000_0000; + +// time.h +pub const CLOCK_REALTIME: ::c_int = 1; +pub const CLOCK_MONOTONIC: ::c_int = 4; +pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2; +pub const CLOCKS_PER_SEC: ::clock_t = 1_000_000; + +// unistd.h +// POSIX.1 { +pub const _SC_ARG_MAX: ::c_int = 0; +pub const _SC_CHILD_MAX: ::c_int = 1; +pub const _SC_CLK_TCK: ::c_int = 2; +pub const _SC_NGROUPS_MAX: ::c_int = 3; +pub const _SC_OPEN_MAX: ::c_int = 4; +pub const _SC_STREAM_MAX: ::c_int = 5; +pub const _SC_TZNAME_MAX: ::c_int = 6; +// ... +pub const _SC_VERSION: ::c_int = 29; +pub const _SC_PAGESIZE: ::c_int = 30; +pub const _SC_PAGE_SIZE: ::c_int = 30; +// ... +pub const _SC_RE_DUP_MAX: ::c_int = 44; +// ... +pub const _SC_LOGIN_NAME_MAX: ::c_int = 71; +pub const _SC_TTY_NAME_MAX: ::c_int = 72; +// ... +pub const _SC_SYMLOOP_MAX: ::c_int = 173; +// ... +pub const _SC_HOST_NAME_MAX: ::c_int = 180; +// } POSIX.1 + +pub const F_OK: ::c_int = 0; +pub const R_OK: ::c_int = 4; +pub const W_OK: ::c_int = 2; +pub const X_OK: ::c_int = 1; + +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; + +pub const _PC_LINK_MAX: ::c_int = 0; +pub const _PC_MAX_CANON: ::c_int = 1; +pub const _PC_MAX_INPUT: ::c_int = 2; +pub const _PC_NAME_MAX: ::c_int = 3; +pub const _PC_PATH_MAX: ::c_int = 4; +pub const _PC_PIPE_BUF: ::c_int = 5; +pub const _PC_CHOWN_RESTRICTED: ::c_int = 6; +pub const _PC_NO_TRUNC: ::c_int = 7; +pub const _PC_VDISABLE: ::c_int = 8; +pub const _PC_SYNC_IO: ::c_int = 9; +pub const _PC_ASYNC_IO: ::c_int = 10; +pub const _PC_PRIO_IO: ::c_int = 11; +pub const _PC_SOCK_MAXBUF: ::c_int = 12; +pub const _PC_FILESIZEBITS: ::c_int = 13; +pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14; +pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15; +pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16; +pub const _PC_REC_XFER_ALIGN: ::c_int = 17; +pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18; +pub const _PC_SYMLINK_MAX: ::c_int = 19; +pub const _PC_2_SYMLINKS: ::c_int = 20; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +// wait.h +f! { + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + (*set).fds_bits[fd / size] &= !(1 << (fd % size)); + return + } + + pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0 + } + + pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () { + let fd = fd as usize; + let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + (*set).fds_bits[fd / size] |= 1 << (fd % size); + return + } + + pub fn FD_ZERO(set: *mut fd_set) -> () { + for slot in (*set).fds_bits.iter_mut() { + *slot = 0; + } + } +} + +safe_f! { + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { + (status & 0xff) == 0x7f + } + + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { + (status >> 8) & 0xff + } + + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + status == 0xffff + } + + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + ((status & 0x7f) + 1) as i8 >= 2 + } + + pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int { + status & 0x7f + } + + pub {const} fn WIFEXITED(status: ::c_int) -> bool { + (status & 0x7f) == 0 + } + + pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int { + (status >> 8) & 0xff + } + + pub {const} fn WCOREDUMP(status: ::c_int) -> bool { + (status & 0x80) != 0 + } +} + +extern "C" { + // errno.h + pub fn __errno_location() -> *mut ::c_int; + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + + // unistd.h + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; + + // malloc.h + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + + // netdb.h + pub fn getnameinfo( + addr: *const ::sockaddr, + addrlen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::socklen_t, + serv: *mut ::c_char, + servlen: ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + + // pthread.h + pub fn pthread_atfork( + prepare: ::Option, + parent: ::Option, + child: ::Option, + ) -> ::c_int; + pub fn pthread_create( + tid: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + start: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + arg: *mut ::c_void, + ) -> ::c_int; + pub fn pthread_condattr_setclock( + attr: *mut pthread_condattr_t, + clock_id: ::clockid_t, + ) -> ::c_int; + + // pwd.h + pub fn getpwuid_r( + uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + + // signal.h + pub fn pthread_sigmask( + how: ::c_int, + set: *const ::sigset_t, + oldset: *mut ::sigset_t, + ) -> ::c_int; + pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + + // sys/epoll.h + pub fn epoll_create(size: ::c_int) -> ::c_int; + pub fn epoll_create1(flags: ::c_int) -> ::c_int; + pub fn epoll_wait( + epfd: ::c_int, + events: *mut ::epoll_event, + maxevents: ::c_int, + timeout: ::c_int, + ) -> ::c_int; + pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event) + -> ::c_int; + + // sys/ioctl.h + pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int; + + // sys/mman.h + pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; + pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int; + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + // sys/resource.h + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + + // sys/socket.h + pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int; + pub fn recvfrom( + socket: ::c_int, + buf: *mut ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, + ) -> ::ssize_t; + + // sys/stat.h + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + + // sys/uio.h + pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + + // sys/utsname.h + pub fn uname(utsname: *mut utsname) -> ::c_int; + + // time.h + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int; + pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for dirent { + fn eq(&self, other: &dirent) -> bool { + self.d_ino == other.d_ino + && self.d_off == other.d_off + && self.d_reclen == other.d_reclen + && self.d_type == other.d_type + && self + .d_name + .iter() + .zip(other.d_name.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for dirent {} + + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_ino", &self.d_ino) + .field("d_off", &self.d_off) + .field("d_reclen", &self.d_reclen) + .field("d_type", &self.d_type) + // FIXME: .field("d_name", &self.d_name) + .finish() + } + } + + impl ::hash::Hash for dirent { + fn hash(&self, state: &mut H) { + self.d_ino.hash(state); + self.d_off.hash(state); + self.d_reclen.hash(state); + self.d_type.hash(state); + self.d_name.hash(state); + } + } + + impl PartialEq for sockaddr_un { + fn eq(&self, other: &sockaddr_un) -> bool { + self.sun_family == other.sun_family + && self + .sun_path + .iter() + .zip(other.sun_path.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for sockaddr_un {} + + impl ::fmt::Debug for sockaddr_un { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_un") + .field("sun_family", &self.sun_family) + // FIXME: .field("sun_path", &self.sun_path) + .finish() + } + } + + impl ::hash::Hash for sockaddr_un { + fn hash(&self, state: &mut H) { + self.sun_family.hash(state); + self.sun_path.hash(state); + } + } + + impl PartialEq for sockaddr_storage { + fn eq(&self, other: &sockaddr_storage) -> bool { + self.ss_family == other.ss_family + && self.__ss_align == self.__ss_align + && self + .__ss_padding + .iter() + .zip(other.__ss_padding.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for sockaddr_storage {} + + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("ss_family", &self.ss_family) + .field("__ss_align", &self.__ss_align) + // FIXME: .field("__ss_padding", &self.__ss_padding) + .finish() + } + } + + impl ::hash::Hash for sockaddr_storage { + fn hash(&self, state: &mut H) { + self.ss_family.hash(state); + self.__ss_padding.hash(state); + self.__ss_align.hash(state); + } + } + + impl PartialEq for utsname { + fn eq(&self, other: &utsname) -> bool { + self.sysname + .iter() + .zip(other.sysname.iter()) + .all(|(a, b)| a == b) + && self + .nodename + .iter() + .zip(other.nodename.iter()) + .all(|(a, b)| a == b) + && self + .release + .iter() + .zip(other.release.iter()) + .all(|(a, b)| a == b) + && self + .version + .iter() + .zip(other.version.iter()) + .all(|(a, b)| a == b) + && self + .machine + .iter() + .zip(other.machine.iter()) + .all(|(a, b)| a == b) + && self + .domainname + .iter() + .zip(other.domainname.iter()) + .all(|(a, b)| a == b) + } + } + + impl Eq for utsname {} + + impl ::fmt::Debug for utsname { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utsname") + // FIXME: .field("sysname", &self.sysname) + // FIXME: .field("nodename", &self.nodename) + // FIXME: .field("release", &self.release) + // FIXME: .field("version", &self.version) + // FIXME: .field("machine", &self.machine) + // FIXME: .field("domainname", &self.domainname) + .finish() + } + } + + impl ::hash::Hash for utsname { + fn hash(&self, state: &mut H) { + self.sysname.hash(state); + self.nodename.hash(state); + self.release.hash(state); + self.version.hash(state); + self.machine.hash(state); + self.domainname.hash(state); + } + } + } +} diff --git a/bash-5.1/vendor/libc/src/unix/solarish/compat.rs b/bash-5.1/vendor/libc/src/unix/solarish/compat.rs new file mode 100644 index 0000000000000000000000000000000000000000..4a232f0d83ace688d0e18220876c0f747017d76c --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/solarish/compat.rs @@ -0,0 +1,171 @@ +// Common functions that are unfortunately missing on illumos and +// Solaris, but often needed by other crates. + +use unix::solarish::*; + +const PTEM: &[u8] = b"ptem\0"; +const LDTERM: &[u8] = b"ldterm\0"; + +pub unsafe fn cfmakeraw(termios: *mut ::termios) { + (*termios).c_iflag &= + !(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); + (*termios).c_oflag &= !OPOST; + (*termios).c_lflag &= !(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + (*termios).c_cflag &= !(CSIZE | PARENB); + (*termios).c_cflag |= CS8; + + // By default, most software expects a pending read to block until at + // least one byte becomes available. As per termio(7I), this requires + // setting the MIN and TIME parameters appropriately. + // + // As a somewhat unfortunate artefact of history, the MIN and TIME slots + // in the control character array overlap with the EOF and EOL slots used + // for canonical mode processing. Because the EOF character needs to be + // the ASCII EOT value (aka Control-D), it has the byte value 4. When + // switching to raw mode, this is interpreted as a MIN value of 4; i.e., + // reads will block until at least four bytes have been input. + // + // Other platforms with a distinct MIN slot like Linux and FreeBSD appear + // to default to a MIN value of 1, so we'll force that value here: + (*termios).c_cc[VMIN] = 1; + (*termios).c_cc[VTIME] = 0; +} + +pub unsafe fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int { + // Neither of these functions on illumos or Solaris actually ever + // return an error + ::cfsetispeed(termios, speed); + ::cfsetospeed(termios, speed); + 0 +} + +unsafe fn bail(fdm: ::c_int, fds: ::c_int) -> ::c_int { + let e = *___errno(); + if fds >= 0 { + ::close(fds); + } + if fdm >= 0 { + ::close(fdm); + } + *___errno() = e; + return -1; +} + +pub unsafe fn openpty( + amain: *mut ::c_int, + asubord: *mut ::c_int, + name: *mut ::c_char, + termp: *const termios, + winp: *const ::winsize, +) -> ::c_int { + // Open the main pseudo-terminal device, making sure not to set it as the + // controlling terminal for this process: + let fdm = ::posix_openpt(O_RDWR | O_NOCTTY); + if fdm < 0 { + return -1; + } + + // Set permissions and ownership on the subordinate device and unlock it: + if ::grantpt(fdm) < 0 || ::unlockpt(fdm) < 0 { + return bail(fdm, -1); + } + + // Get the path name of the subordinate device: + let subordpath = ::ptsname(fdm); + if subordpath.is_null() { + return bail(fdm, -1); + } + + // Open the subordinate device without setting it as the controlling + // terminal for this process: + let fds = ::open(subordpath, O_RDWR | O_NOCTTY); + if fds < 0 { + return bail(fdm, -1); + } + + // Check if the STREAMS modules are already pushed: + let setup = ::ioctl(fds, I_FIND, LDTERM.as_ptr()); + if setup < 0 { + return bail(fdm, fds); + } else if setup == 0 { + // The line discipline is not present, so push the appropriate STREAMS + // modules for the subordinate device: + if ::ioctl(fds, I_PUSH, PTEM.as_ptr()) < 0 || ::ioctl(fds, I_PUSH, LDTERM.as_ptr()) < 0 { + return bail(fdm, fds); + } + } + + // If provided, set the terminal parameters: + if !termp.is_null() && ::tcsetattr(fds, TCSAFLUSH, termp) != 0 { + return bail(fdm, fds); + } + + // If provided, set the window size: + if !winp.is_null() && ::ioctl(fds, TIOCSWINSZ, winp) < 0 { + return bail(fdm, fds); + } + + // If the caller wants the name of the subordinate device, copy it out. + // + // Note that this is a terrible interface: there appears to be no standard + // upper bound on the copy length for this pointer. Nobody should pass + // anything but NULL here, preferring instead to use ptsname(3C) directly. + if !name.is_null() { + ::strcpy(name, subordpath); + } + + *amain = fdm; + *asubord = fds; + 0 +} + +pub unsafe fn forkpty( + amain: *mut ::c_int, + name: *mut ::c_char, + termp: *const termios, + winp: *const ::winsize, +) -> ::pid_t { + let mut fds = -1; + + if openpty(amain, &mut fds, name, termp, winp) != 0 { + return -1; + } + + let pid = ::fork(); + if pid < 0 { + return bail(*amain, fds); + } else if pid > 0 { + // In the parent process, we close the subordinate device and return the + // process ID of the new child: + ::close(fds); + return pid; + } + + // The rest of this function executes in the child process. + + // Close the main side of the pseudo-terminal pair: + ::close(*amain); + + // Use TIOCSCTTY to set the subordinate device as our controlling + // terminal. This will fail (with ENOTTY) if we are not the leader in + // our own session, so we call setsid() first. Finally, arrange for + // the pseudo-terminal to occupy the standard I/O descriptors. + if ::setsid() < 0 + || ::ioctl(fds, TIOCSCTTY, 0) < 0 + || ::dup2(fds, 0) < 0 + || ::dup2(fds, 1) < 0 + || ::dup2(fds, 2) < 0 + { + // At this stage there are no particularly good ways to handle failure. + // Exit as abruptly as possible, using _exit() to avoid messing with any + // state still shared with the parent process. + ::_exit(EXIT_FAILURE); + } + // Close the inherited descriptor, taking care to avoid closing the standard + // descriptors by mistake: + if fds > 2 { + ::close(fds); + } + + 0 +} diff --git a/bash-5.1/vendor/libc/src/unix/solarish/illumos.rs b/bash-5.1/vendor/libc/src/unix/solarish/illumos.rs new file mode 100644 index 0000000000000000000000000000000000000000..c86c6d69d07f445b75fa7784d1cc3f9b0ffc83e2 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/solarish/illumos.rs @@ -0,0 +1,85 @@ +s! { + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_amp: *mut ::c_void, + pub shm_lkcnt: ::c_ushort, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + pub shm_cnattch: ::c_ulong, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_pad4: [i64; 4], + } + + pub struct fil_info { + pub fi_flags: ::c_int, + pub fi_pos: ::c_int, + pub fi_name: [::c_char; ::FILNAME_MAX as usize], + } +} + +pub const AF_LOCAL: ::c_int = 1; // AF_UNIX +pub const AF_FILE: ::c_int = 1; // AF_UNIX + +pub const EFD_SEMAPHORE: ::c_int = 0x1; +pub const EFD_NONBLOCK: ::c_int = 0x800; +pub const EFD_CLOEXEC: ::c_int = 0x80000; + +pub const TCP_KEEPIDLE: ::c_int = 34; +pub const TCP_KEEPCNT: ::c_int = 35; +pub const TCP_KEEPINTVL: ::c_int = 36; +pub const TCP_CONGESTION: ::c_int = 37; + +// These constants are correct for 64-bit programs or 32-bit programs that are +// not using large-file mode. If Rust ever supports anything other than 64-bit +// compilation on illumos, this may require adjustment: +pub const F_OFD_GETLK: ::c_int = 47; +pub const F_OFD_SETLK: ::c_int = 48; +pub const F_OFD_SETLKW: ::c_int = 49; +pub const F_FLOCK: ::c_int = 53; +pub const F_FLOCKW: ::c_int = 54; + +pub const FIL_ATTACH: ::c_int = 0x1; +pub const FIL_DETACH: ::c_int = 0x2; +pub const FIL_LIST: ::c_int = 0x3; +pub const FILNAME_MAX: ::c_int = 32; +pub const FILF_PROG: ::c_int = 0x1; +pub const FILF_AUTO: ::c_int = 0x2; +pub const FILF_BYPASS: ::c_int = 0x4; +pub const SOL_FILTER: ::c_int = 0xfffc; + +pub const MR_HDR_AOUT: ::c_uint = 0x3; + +pub const B1000000: ::speed_t = 24; +pub const B1152000: ::speed_t = 25; +pub const B1500000: ::speed_t = 26; +pub const B2000000: ::speed_t = 27; +pub const B2500000: ::speed_t = 28; +pub const B3000000: ::speed_t = 29; +pub const B3500000: ::speed_t = 30; +pub const B4000000: ::speed_t = 31; + +// sys/systeminfo.h +pub const SI_ADDRESS_WIDTH: ::c_int = 520; + +extern "C" { + pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int; + + pub fn mincore(addr: ::caddr_t, len: ::size_t, vec: *mut ::c_char) -> ::c_int; + + pub fn pset_bind_lwp( + pset: ::psetid_t, + id: ::id_t, + pid: ::pid_t, + opset: *mut ::psetid_t, + ) -> ::c_int; + pub fn pset_getloadavg(pset: ::psetid_t, load: *mut ::c_double, num: ::c_int) -> ::c_int; + + pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t; + pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) + -> ::ssize_t; + pub fn getpagesizes2(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int; +} diff --git a/bash-5.1/vendor/libc/src/unix/solarish/mod.rs b/bash-5.1/vendor/libc/src/unix/solarish/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..fef08d08f4b6d2658a9eb39c40e253c3c8f3cefb --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/solarish/mod.rs @@ -0,0 +1,3265 @@ +pub type c_char = i8; +pub type c_long = i64; +pub type c_ulong = u64; +pub type caddr_t = *mut ::c_char; + +pub type clockid_t = ::c_int; +pub type blkcnt_t = ::c_long; +pub type clock_t = ::c_long; +pub type daddr_t = ::c_long; +pub type dev_t = ::c_ulong; +pub type fsblkcnt_t = ::c_ulong; +pub type fsfilcnt_t = ::c_ulong; +pub type ino_t = ::c_ulong; +pub type key_t = ::c_int; +pub type major_t = ::c_uint; +pub type minor_t = ::c_uint; +pub type mode_t = ::c_uint; +pub type nlink_t = ::c_uint; +pub type rlim_t = ::c_ulong; +pub type speed_t = ::c_uint; +pub type tcflag_t = ::c_uint; +pub type time_t = ::c_long; +pub type timer_t = ::c_int; +pub type wchar_t = ::c_int; +pub type nfds_t = ::c_ulong; +pub type projid_t = ::c_int; +pub type zoneid_t = ::c_int; +pub type psetid_t = ::c_int; +pub type processorid_t = ::c_int; +pub type chipid_t = ::c_int; +pub type ctid_t = ::id_t; + +pub type suseconds_t = ::c_long; +pub type off_t = ::c_long; +pub type useconds_t = ::c_uint; +pub type socklen_t = ::c_uint; +pub type sa_family_t = u16; +pub type pthread_t = ::c_uint; +pub type pthread_key_t = ::c_uint; +pub type thread_t = ::c_uint; +pub type blksize_t = ::c_int; +pub type nl_item = ::c_int; +pub type mqd_t = *mut ::c_void; +pub type id_t = ::c_int; +pub type idtype_t = ::c_uint; +pub type shmatt_t = ::c_ulong; + +pub type lgrp_rsrc_t = ::c_int; +pub type lgrp_affinity_t = ::c_int; +pub type lgrp_id_t = ::id_t; +pub type lgrp_mem_size_t = ::c_longlong; +pub type lgrp_cookie_t = ::uintptr_t; +pub type lgrp_content_t = ::c_uint; +pub type lgrp_lat_between_t = ::c_uint; +pub type lgrp_mem_size_flag_t = ::c_uint; +pub type lgrp_view_t = ::c_uint; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { + *self + } +} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum ucred_t {} +impl ::Copy for ucred_t {} +impl ::Clone for ucred_t { + fn clone(&self) -> ucred_t { + *self + } +} + +s! { + pub struct in_addr { + pub s_addr: ::in_addr_t, + } + + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct ip_mreq_source { + pub imr_multiaddr: in_addr, + pub imr_sourceaddr: in_addr, + pub imr_interface: in_addr, + } + + pub struct ipc_perm { + pub uid: ::uid_t, + pub gid: ::gid_t, + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub mode: ::mode_t, + pub seq: ::c_uint, + pub key: ::key_t, + } + + pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: [::c_char; 14], + } + + pub struct sockaddr_in { + pub sin_family: sa_family_t, + pub sin_port: ::in_port_t, + pub sin_addr: ::in_addr, + pub sin_zero: [::c_char; 8] + } + + pub struct sockaddr_in6 { + pub sin6_family: sa_family_t, + pub sin6_port: ::in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: ::in6_addr, + pub sin6_scope_id: u32, + pub __sin6_src_id: u32 + } + + pub struct passwd { + pub pw_name: *mut ::c_char, + pub pw_passwd: *mut ::c_char, + pub pw_uid: ::uid_t, + pub pw_gid: ::gid_t, + pub pw_age: *mut ::c_char, + pub pw_comment: *mut ::c_char, + pub pw_gecos: *mut ::c_char, + pub pw_dir: *mut ::c_char, + pub pw_shell: *mut ::c_char + } + + pub struct ifaddrs { + pub ifa_next: *mut ifaddrs, + pub ifa_name: *mut ::c_char, + pub ifa_flags: ::c_ulong, + pub ifa_addr: *mut ::sockaddr, + pub ifa_netmask: *mut ::sockaddr, + pub ifa_dstaddr: *mut ::sockaddr, + pub ifa_data: *mut ::c_void + } + + pub struct itimerspec { + pub it_interval: ::timespec, + pub it_value: ::timespec, + } + + pub struct tm { + pub tm_sec: ::c_int, + pub tm_min: ::c_int, + pub tm_hour: ::c_int, + pub tm_mday: ::c_int, + pub tm_mon: ::c_int, + pub tm_year: ::c_int, + pub tm_wday: ::c_int, + pub tm_yday: ::c_int, + pub tm_isdst: ::c_int + } + + pub struct msghdr { + pub msg_name: *mut ::c_void, + pub msg_namelen: ::socklen_t, + pub msg_iov: *mut ::iovec, + pub msg_iovlen: ::c_int, + pub msg_control: *mut ::c_void, + pub msg_controllen: ::socklen_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: ::socklen_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + pub struct pthread_attr_t { + __pthread_attrp: *mut ::c_void + } + + pub struct pthread_mutex_t { + __pthread_mutex_flag1: u16, + __pthread_mutex_flag2: u8, + __pthread_mutex_ceiling: u8, + __pthread_mutex_type: u16, + __pthread_mutex_magic: u16, + __pthread_mutex_lock: u64, + __pthread_mutex_data: u64 + } + + pub struct pthread_mutexattr_t { + __pthread_mutexattrp: *mut ::c_void + } + + pub struct pthread_cond_t { + __pthread_cond_flag: [u8; 4], + __pthread_cond_type: u16, + __pthread_cond_magic: u16, + __pthread_cond_data: u64 + } + + pub struct pthread_condattr_t { + __pthread_condattrp: *mut ::c_void, + } + + pub struct pthread_rwlock_t { + __pthread_rwlock_readers: i32, + __pthread_rwlock_type: u16, + __pthread_rwlock_magic: u16, + __pthread_rwlock_mutex: ::pthread_mutex_t, + __pthread_rwlock_readercv: ::pthread_cond_t, + __pthread_rwlock_writercv: ::pthread_cond_t + } + + pub struct pthread_rwlockattr_t { + __pthread_rwlockattrp: *mut ::c_void, + } + + pub struct dirent { + pub d_ino: ::ino_t, + pub d_off: ::off_t, + pub d_reclen: u16, + pub d_name: [::c_char; 3] + } + + pub struct glob_t { + pub gl_pathc: ::size_t, + pub gl_pathv: *mut *mut ::c_char, + pub gl_offs: ::size_t, + __unused1: *mut ::c_void, + __unused2: ::c_int, + __unused3: ::c_int, + __unused4: ::c_int, + __unused5: *mut ::c_void, + __unused6: *mut ::c_void, + __unused7: *mut ::c_void, + __unused8: *mut ::c_void, + __unused9: *mut ::c_void, + __unused10: *mut ::c_void, + } + + pub struct addrinfo { + pub ai_flags: ::c_int, + pub ai_family: ::c_int, + pub ai_socktype: ::c_int, + pub ai_protocol: ::c_int, + #[cfg(target_arch = "sparc64")] + __sparcv9_pad: ::c_int, + pub ai_addrlen: ::socklen_t, + pub ai_canonname: *mut ::c_char, + pub ai_addr: *mut ::sockaddr, + pub ai_next: *mut addrinfo, + } + + pub struct sigset_t { + bits: [u32; 4], + } + + pub struct sigaction { + pub sa_flags: ::c_int, + pub sa_sigaction: ::sighandler_t, + pub sa_mask: sigset_t, + } + + pub struct stack_t { + pub ss_sp: *mut ::c_void, + pub ss_size: ::size_t, + pub ss_flags: ::c_int, + } + + pub struct statvfs { + pub f_bsize: ::c_ulong, + pub f_frsize: ::c_ulong, + pub f_blocks: ::fsblkcnt_t, + pub f_bfree: ::fsblkcnt_t, + pub f_bavail: ::fsblkcnt_t, + pub f_files: ::fsfilcnt_t, + pub f_ffree: ::fsfilcnt_t, + pub f_favail: ::fsfilcnt_t, + pub f_fsid: ::c_ulong, + pub f_basetype: [::c_char; 16], + pub f_flag: ::c_ulong, + pub f_namemax: ::c_ulong, + pub f_fstr: [::c_char; 32] + } + + pub struct sendfilevec_t { + pub sfv_fd: ::c_int, + pub sfv_flag: ::c_uint, + pub sfv_off: ::off_t, + pub sfv_len: ::size_t, + } + + pub struct sched_param { + pub sched_priority: ::c_int, + sched_pad: [::c_int; 8] + } + + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *mut ::c_void, + } + + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, + pub st_mode: ::mode_t, + pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, + pub st_rdev: ::dev_t, + pub st_size: ::off_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, + pub st_mtime: ::time_t, + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, + pub st_blksize: ::blksize_t, + pub st_blocks: ::blkcnt_t, + __unused: [::c_char; 16] + } + + pub struct termios { + pub c_iflag: ::tcflag_t, + pub c_oflag: ::tcflag_t, + pub c_cflag: ::tcflag_t, + pub c_lflag: ::tcflag_t, + pub c_cc: [::cc_t; ::NCCS] + } + + pub struct lconv { + pub decimal_point: *mut ::c_char, + pub thousands_sep: *mut ::c_char, + pub grouping: *mut ::c_char, + pub int_curr_symbol: *mut ::c_char, + pub currency_symbol: *mut ::c_char, + pub mon_decimal_point: *mut ::c_char, + pub mon_thousands_sep: *mut ::c_char, + pub mon_grouping: *mut ::c_char, + pub positive_sign: *mut ::c_char, + pub negative_sign: *mut ::c_char, + pub int_frac_digits: ::c_char, + pub frac_digits: ::c_char, + pub p_cs_precedes: ::c_char, + pub p_sep_by_space: ::c_char, + pub n_cs_precedes: ::c_char, + pub n_sep_by_space: ::c_char, + pub p_sign_posn: ::c_char, + pub n_sign_posn: ::c_char, + pub int_p_cs_precedes: ::c_char, + pub int_p_sep_by_space: ::c_char, + pub int_n_cs_precedes: ::c_char, + pub int_n_sep_by_space: ::c_char, + pub int_p_sign_posn: ::c_char, + pub int_n_sign_posn: ::c_char, + } + + pub struct sem_t { + pub sem_count: u32, + pub sem_type: u16, + pub sem_magic: u16, + pub sem_pad1: [u64; 3], + pub sem_pad2: [u64; 2] + } + + pub struct flock { + pub l_type: ::c_short, + pub l_whence: ::c_short, + pub l_start: ::off_t, + pub l_len: ::off_t, + pub l_sysid: ::c_int, + pub l_pid: ::pid_t, + pub l_pad: [::c_long; 4] + } + + pub struct if_nameindex { + pub if_index: ::c_uint, + pub if_name: *mut ::c_char, + } + + pub struct mq_attr { + pub mq_flags: ::c_long, + pub mq_maxmsg: ::c_long, + pub mq_msgsize: ::c_long, + pub mq_curmsgs: ::c_long, + _pad: [::c_int; 12] + } + + pub struct port_event { + pub portev_events: ::c_int, + pub portev_source: ::c_ushort, + pub portev_pad: ::c_ushort, + pub portev_object: ::uintptr_t, + pub portev_user: *mut ::c_void, + } + + pub struct port_notify { + pub portnfy_port: ::c_int, + pub portnfy_user: *mut ::c_void, + } + + pub struct exit_status { + e_termination: ::c_short, + e_exit: ::c_short, + } + + pub struct utmp { + pub ut_user: [::c_char; 8], + pub ut_id: [::c_char; 4], + pub ut_line: [::c_char; 12], + pub ut_pid: ::c_short, + pub ut_type: ::c_short, + pub ut_exit: exit_status, + pub ut_time: ::time_t, + } + + pub struct timex { + pub modes: u32, + pub offset: i32, + pub freq: i32, + pub maxerror: i32, + pub esterror: i32, + pub status: i32, + pub constant: i32, + pub precision: i32, + pub tolerance: i32, + pub ppsfreq: i32, + pub jitter: i32, + pub shift: i32, + pub stabil: i32, + pub jitcnt: i32, + pub calcnt: i32, + pub errcnt: i32, + pub stbcnt: i32, + } + + pub struct ntptimeval { + pub time: ::timeval, + pub maxerror: i32, + pub esterror: i32, + } + + pub struct mmapobj_result_t { + pub mr_addr: ::caddr_t, + pub mr_msize: ::size_t, + pub mr_fsize: ::size_t, + pub mr_offset: ::size_t, + pub mr_prot: ::c_uint, + pub mr_flags: ::c_uint, + } + + pub struct lgrp_affinity_args { + pub idtype: ::idtype_t, + pub id: ::id_t, + pub lgrp: ::lgrp_id_t, + pub aff: ::lgrp_affinity_t, + } + + pub struct processor_info_t { + pub pi_state: ::c_int, + pub pi_processor_type: [::c_char; PI_TYPELEN as usize], + pub pi_fputypes: [::c_char; PI_FPUTYPE as usize], + pub pi_clock: ::c_int, + } +} + +s_no_extra_traits! { + #[cfg_attr(all( + any(target_arch = "x86", target_arch = "x86_64"), + libc_packedN + ), repr(packed(4)))] + #[cfg_attr(all( + any(target_arch = "x86", target_arch = "x86_64"), + not(libc_packedN) + ), repr(packed))] + pub struct epoll_event { + pub events: u32, + pub u64: u64, + } + + pub struct utmpx { + pub ut_user: [::c_char; _UTX_USERSIZE], + pub ut_id: [::c_char; _UTX_IDSIZE], + pub ut_line: [::c_char; _UTX_LINESIZE], + pub ut_pid: ::pid_t, + pub ut_type: ::c_short, + pub ut_exit: exit_status, + pub ut_tv: ::timeval, + pub ut_session: ::c_int, + pub ut_pad: [::c_int; _UTX_PADSIZE], + pub ut_syslen: ::c_short, + pub ut_host: [::c_char; _UTX_HOSTSIZE], + } + + pub struct sockaddr_un { + pub sun_family: sa_family_t, + pub sun_path: [c_char; 108] + } + + pub struct utsname { + pub sysname: [::c_char; 257], + pub nodename: [::c_char; 257], + pub release: [::c_char; 257], + pub version: [::c_char; 257], + pub machine: [::c_char; 257], + } + + pub struct fd_set { + #[cfg(target_pointer_width = "64")] + fds_bits: [i64; FD_SETSIZE / 64], + #[cfg(target_pointer_width = "32")] + fds_bits: [i32; FD_SETSIZE / 32], + } + + pub struct sockaddr_storage { + pub ss_family: ::sa_family_t, + __ss_pad1: [u8; 6], + __ss_align: i64, + __ss_pad2: [u8; 240], + } + + #[cfg_attr(all(target_pointer_width = "64", libc_align), repr(align(8)))] + pub struct siginfo_t { + pub si_signo: ::c_int, + pub si_code: ::c_int, + pub si_errno: ::c_int, + #[cfg(target_pointer_width = "64")] + pub si_pad: ::c_int, + + __data_pad: [::c_int; SIGINFO_DATA_SIZE], + } + + pub struct sockaddr_dl { + pub sdl_family: ::c_ushort, + pub sdl_index: ::c_ushort, + pub sdl_type: ::c_uchar, + pub sdl_nlen: ::c_uchar, + pub sdl_alen: ::c_uchar, + pub sdl_slen: ::c_uchar, + pub sdl_data: [::c_char; 244], + } + + pub struct sigevent { + pub sigev_notify: ::c_int, + pub sigev_signo: ::c_int, + pub sigev_value: ::sigval, + pub ss_sp: *mut ::c_void, + pub sigev_notify_attributes: *const ::pthread_attr_t, + __sigev_pad2: ::c_int, + } + + #[cfg(libc_union)] + #[cfg_attr(libc_align, repr(align(16)))] + pub union pad128_t { + // pub _q in this structure would be a "long double", of 16 bytes + pub _l: [i32; 4], + } + + #[cfg(libc_union)] + #[cfg_attr(libc_align, repr(align(16)))] + pub union upad128_t { + // pub _q in this structure would be a "long double", of 16 bytes + pub _l: [u32; 4], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl PartialEq for utmpx { + fn eq(&self, other: &utmpx) -> bool { + self.ut_type == other.ut_type + && self.ut_pid == other.ut_pid + && self.ut_user == other.ut_user + && self.ut_line == other.ut_line + && self.ut_id == other.ut_id + && self.ut_exit == other.ut_exit + && self.ut_session == other.ut_session + && self.ut_tv == other.ut_tv + && self.ut_syslen == other.ut_syslen + && self.ut_pad == other.ut_pad + && self + .ut_host + .iter() + .zip(other.ut_host.iter()) + .all(|(a,b)| a == b) + } + } + + impl Eq for utmpx {} + + impl ::fmt::Debug for utmpx { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utmpx") + .field("ut_user", &self.ut_user) + .field("ut_id", &self.ut_id) + .field("ut_line", &self.ut_line) + .field("ut_pid", &self.ut_pid) + .field("ut_type", &self.ut_type) + .field("ut_exit", &self.ut_exit) + .field("ut_tv", &self.ut_tv) + .field("ut_session", &self.ut_session) + .field("ut_pad", &self.ut_pad) + .field("ut_syslen", &self.ut_syslen) + .field("ut_host", &&self.ut_host[..]) + .finish() + } + } + + impl ::hash::Hash for utmpx { + fn hash(&self, state: &mut H) { + self.ut_user.hash(state); + self.ut_type.hash(state); + self.ut_pid.hash(state); + self.ut_line.hash(state); + self.ut_id.hash(state); + self.ut_host.hash(state); + self.ut_exit.hash(state); + self.ut_session.hash(state); + self.ut_tv.hash(state); + self.ut_syslen.hash(state); + self.ut_pad.hash(state); + } + } + + impl PartialEq for epoll_event { + fn eq(&self, other: &epoll_event) -> bool { + self.events == other.events + && self.u64 == other.u64 + } + } + impl Eq for epoll_event {} + impl ::fmt::Debug for epoll_event { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + let events = self.events; + let u64 = self.u64; + f.debug_struct("epoll_event") + .field("events", &events) + .field("u64", &u64) + .finish() + } + } + impl ::hash::Hash for epoll_event { + fn hash(&self, state: &mut H) { + let events = self.events; + let u64 = self.u64; + events.hash(state); + u64.hash(state); + } + } + + impl PartialEq for sockaddr_un { + fn eq(&self, other: &sockaddr_un) -> bool { + self.sun_family == other.sun_family + && self + .sun_path + .iter() + .zip(other.sun_path.iter()) + .all(|(a, b)| a == b) + } + } + impl Eq for sockaddr_un {} + impl ::fmt::Debug for sockaddr_un { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_un") + .field("sun_family", &self.sun_family) + // FIXME: .field("sun_path", &self.sun_path) + .finish() + } + } + impl ::hash::Hash for sockaddr_un { + fn hash(&self, state: &mut H) { + self.sun_family.hash(state); + self.sun_path.hash(state); + } + } + + impl PartialEq for utsname { + fn eq(&self, other: &utsname) -> bool { + self.sysname + .iter() + .zip(other.sysname.iter()) + .all(|(a, b)| a == b) + && self + .nodename + .iter() + .zip(other.nodename.iter()) + .all(|(a, b)| a == b) + && self + .release + .iter() + .zip(other.release.iter()) + .all(|(a, b)| a == b) + && self + .version + .iter() + .zip(other.version.iter()) + .all(|(a, b)| a == b) + && self + .machine + .iter() + .zip(other.machine.iter()) + .all(|(a, b)| a == b) + } + } + impl Eq for utsname {} + impl ::fmt::Debug for utsname { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("utsname") + // FIXME: .field("sysname", &self.sysname) + // FIXME: .field("nodename", &self.nodename) + // FIXME: .field("release", &self.release) + // FIXME: .field("version", &self.version) + // FIXME: .field("machine", &self.machine) + .finish() + } + } + impl ::hash::Hash for utsname { + fn hash(&self, state: &mut H) { + self.sysname.hash(state); + self.nodename.hash(state); + self.release.hash(state); + self.version.hash(state); + self.machine.hash(state); + } + } + + impl PartialEq for fd_set { + fn eq(&self, other: &fd_set) -> bool { + self.fds_bits + .iter() + .zip(other.fds_bits.iter()) + .all(|(a, b)| a == b) + } + } + impl Eq for fd_set {} + impl ::fmt::Debug for fd_set { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fd_set") + // FIXME: .field("fds_bits", &self.fds_bits) + .finish() + } + } + impl ::hash::Hash for fd_set { + fn hash(&self, state: &mut H) { + self.fds_bits.hash(state); + } + } + + impl PartialEq for sockaddr_storage { + fn eq(&self, other: &sockaddr_storage) -> bool { + self.ss_family == other.ss_family + && self.__ss_pad1 == other.__ss_pad1 + && self.__ss_align == other.__ss_align + && self + .__ss_pad2 + .iter() + .zip(other.__ss_pad2.iter()) + .all(|(a, b)| a == b) + } + } + impl Eq for sockaddr_storage {} + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("ss_family", &self.ss_family) + .field("__ss_pad1", &self.__ss_pad1) + .field("__ss_align", &self.__ss_align) + // FIXME: .field("__ss_pad2", &self.__ss_pad2) + .finish() + } + } + impl ::hash::Hash for sockaddr_storage { + fn hash(&self, state: &mut H) { + self.ss_family.hash(state); + self.__ss_pad1.hash(state); + self.__ss_align.hash(state); + self.__ss_pad2.hash(state); + } + } + + impl siginfo_t { + /// The siginfo_t will have differing contents based on the delivered signal. Based on + /// `si_signo`, this determines how many of the `c_int` pad fields contain valid data + /// exposed by the C unions. + /// + /// It is not yet exhausitive for the OS-defined types, and defaults to assuming the + /// entire data pad area is "valid" for otherwise unrecognized signal numbers. + fn data_field_count(&self) -> usize { + match self.si_signo { + ::SIGSEGV | ::SIGBUS | ::SIGILL | ::SIGTRAP | ::SIGFPE => { + ::mem::size_of::() / ::mem::size_of::<::c_int>() + } + ::SIGCLD => ::mem::size_of::() / ::mem::size_of::<::c_int>(), + ::SIGHUP + | ::SIGINT + | ::SIGQUIT + | ::SIGABRT + | ::SIGSYS + | ::SIGPIPE + | ::SIGALRM + | ::SIGTERM + | ::SIGUSR1 + | ::SIGUSR2 + | ::SIGPWR + | ::SIGWINCH + | ::SIGURG => ::mem::size_of::() / ::mem::size_of::<::c_int>(), + _ => SIGINFO_DATA_SIZE, + } + } + } + impl PartialEq for siginfo_t { + fn eq(&self, other: &siginfo_t) -> bool { + if self.si_signo == other.si_signo + && self.si_code == other.si_code + && self.si_errno == other.si_errno { + // FIXME: The `si_pad` field in the 64-bit version of the struct is ignored + // (for now) when doing comparisons. + + let field_count = self.data_field_count(); + self.__data_pad[..field_count] + .iter() + .zip(other.__data_pad[..field_count].iter()) + .all(|(a, b)| a == b) + } else { + false + } + } + } + impl Eq for siginfo_t {} + impl ::fmt::Debug for siginfo_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("siginfo_t") + .field("si_signo", &self.si_signo) + .field("si_code", &self.si_code) + .field("si_errno", &self.si_errno) + // FIXME: .field("__pad", &self.__pad) + .finish() + } + } + impl ::hash::Hash for siginfo_t { + fn hash(&self, state: &mut H) { + self.si_signo.hash(state); + self.si_code.hash(state); + self.si_errno.hash(state); + + // FIXME: The `si_pad` field in the 64-bit version of the struct is ignored + // (for now) when doing hashing. + + let field_count = self.data_field_count(); + self.__data_pad[..field_count].hash(state) + } + } + + impl PartialEq for sockaddr_dl { + fn eq(&self, other: &sockaddr_dl) -> bool { + self.sdl_family == other.sdl_family + && self.sdl_index == other.sdl_index + && self.sdl_type == other.sdl_type + && self.sdl_nlen == other.sdl_nlen + && self.sdl_alen == other.sdl_alen + && self.sdl_slen == other.sdl_slen + && self + .sdl_data + .iter() + .zip(other.sdl_data.iter()) + .all(|(a,b)| a == b) + } + } + impl Eq for sockaddr_dl {} + impl ::fmt::Debug for sockaddr_dl { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_dl") + .field("sdl_family", &self.sdl_family) + .field("sdl_index", &self.sdl_index) + .field("sdl_type", &self.sdl_type) + .field("sdl_nlen", &self.sdl_nlen) + .field("sdl_alen", &self.sdl_alen) + .field("sdl_slen", &self.sdl_slen) + // FIXME: .field("sdl_data", &self.sdl_data) + .finish() + } + } + impl ::hash::Hash for sockaddr_dl { + fn hash(&self, state: &mut H) { + self.sdl_family.hash(state); + self.sdl_index.hash(state); + self.sdl_type.hash(state); + self.sdl_nlen.hash(state); + self.sdl_alen.hash(state); + self.sdl_slen.hash(state); + self.sdl_data.hash(state); + } + } + + impl PartialEq for sigevent { + fn eq(&self, other: &sigevent) -> bool { + self.sigev_notify == other.sigev_notify + && self.sigev_signo == other.sigev_signo + && self.sigev_value == other.sigev_value + && self.ss_sp == other.ss_sp + && self.sigev_notify_attributes + == other.sigev_notify_attributes + } + } + impl Eq for sigevent {} + impl ::fmt::Debug for sigevent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigevent") + .field("sigev_notify", &self.sigev_notify) + .field("sigev_signo", &self.sigev_signo) + .field("sigev_value", &self.sigev_value) + .field("ss_sp", &self.ss_sp) + .field("sigev_notify_attributes", + &self.sigev_notify_attributes) + .finish() + } + } + impl ::hash::Hash for sigevent { + fn hash(&self, state: &mut H) { + self.sigev_notify.hash(state); + self.sigev_signo.hash(state); + self.sigev_value.hash(state); + self.ss_sp.hash(state); + self.sigev_notify_attributes.hash(state); + } + } + + #[cfg(libc_union)] + impl PartialEq for pad128_t { + fn eq(&self, other: &pad128_t) -> bool { + unsafe { + // FIXME: self._q == other._q || + self._l == other._l + } + } + } + #[cfg(libc_union)] + impl Eq for pad128_t {} + #[cfg(libc_union)] + impl ::fmt::Debug for pad128_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + unsafe { + f.debug_struct("pad128_t") + // FIXME: .field("_q", &{self._q}) + .field("_l", &{self._l}) + .finish() + } + } + } + #[cfg(libc_union)] + impl ::hash::Hash for pad128_t { + fn hash(&self, state: &mut H) { + unsafe { + // FIXME: state.write_i64(self._q as i64); + self._l.hash(state); + } + } + } + #[cfg(libc_union)] + impl PartialEq for upad128_t { + fn eq(&self, other: &upad128_t) -> bool { + unsafe { + // FIXME: self._q == other._q || + self._l == other._l + } + } + } + #[cfg(libc_union)] + impl Eq for upad128_t {} + #[cfg(libc_union)] + impl ::fmt::Debug for upad128_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + unsafe { + f.debug_struct("upad128_t") + // FIXME: .field("_q", &{self._q}) + .field("_l", &{self._l}) + .finish() + } + } + } + #[cfg(libc_union)] + impl ::hash::Hash for upad128_t { + fn hash(&self, state: &mut H) { + unsafe { + // FIXME: state.write_i64(self._q as i64); + self._l.hash(state); + } + } + } + } +} + +cfg_if! { + if #[cfg(target_pointer_width = "64")] { + const SIGINFO_DATA_SIZE: usize = 60; + } else { + const SIGINFO_DATA_SIZE: usize = 29; + } +} + +#[repr(C)] +struct siginfo_fault { + addr: *mut ::c_void, + trapno: ::c_int, + pc: *mut ::caddr_t, +} +impl ::Copy for siginfo_fault {} +impl ::Clone for siginfo_fault { + fn clone(&self) -> Self { + *self + } +} + +#[repr(C)] +struct siginfo_cldval { + utime: ::clock_t, + status: ::c_int, + stime: ::clock_t, +} +impl ::Copy for siginfo_cldval {} +impl ::Clone for siginfo_cldval { + fn clone(&self) -> Self { + *self + } +} + +#[repr(C)] +struct siginfo_killval { + uid: ::uid_t, + value: ::sigval, + // Pad out to match the SIGCLD value size + _pad: *mut ::c_void, +} +impl ::Copy for siginfo_killval {} +impl ::Clone for siginfo_killval { + fn clone(&self) -> Self { + *self + } +} + +#[repr(C)] +struct siginfo_sigcld { + pid: ::pid_t, + val: siginfo_cldval, + ctid: ::ctid_t, + zoneid: ::zoneid_t, +} +impl ::Copy for siginfo_sigcld {} +impl ::Clone for siginfo_sigcld { + fn clone(&self) -> Self { + *self + } +} + +#[repr(C)] +struct siginfo_kill { + pid: ::pid_t, + val: siginfo_killval, + ctid: ::ctid_t, + zoneid: ::zoneid_t, +} +impl ::Copy for siginfo_kill {} +impl ::Clone for siginfo_kill { + fn clone(&self) -> Self { + *self + } +} + +impl siginfo_t { + unsafe fn sidata(&self) -> T { + *((&self.__data_pad) as *const ::c_int as *const T) + } + pub unsafe fn si_addr(&self) -> *mut ::c_void { + let sifault: siginfo_fault = self.sidata(); + sifault.addr + } + pub unsafe fn si_uid(&self) -> ::uid_t { + let kill: siginfo_kill = self.sidata(); + kill.val.uid + } + pub unsafe fn si_value(&self) -> ::sigval { + let kill: siginfo_kill = self.sidata(); + kill.val.value + } + pub unsafe fn si_pid(&self) -> ::pid_t { + let sigcld: siginfo_sigcld = self.sidata(); + sigcld.pid + } + pub unsafe fn si_status(&self) -> ::c_int { + let sigcld: siginfo_sigcld = self.sidata(); + sigcld.val.status + } + pub unsafe fn si_utime(&self) -> ::c_long { + let sigcld: siginfo_sigcld = self.sidata(); + sigcld.val.utime + } + pub unsafe fn si_stime(&self) -> ::c_long { + let sigcld: siginfo_sigcld = self.sidata(); + sigcld.val.stime + } +} + +pub const LC_CTYPE: ::c_int = 0; +pub const LC_NUMERIC: ::c_int = 1; +pub const LC_TIME: ::c_int = 2; +pub const LC_COLLATE: ::c_int = 3; +pub const LC_MONETARY: ::c_int = 4; +pub const LC_MESSAGES: ::c_int = 5; +pub const LC_ALL: ::c_int = 6; +pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE; +pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC; +pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME; +pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE; +pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY; +pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES; +pub const LC_ALL_MASK: ::c_int = LC_CTYPE_MASK + | LC_NUMERIC_MASK + | LC_TIME_MASK + | LC_COLLATE_MASK + | LC_MONETARY_MASK + | LC_MESSAGES_MASK; + +pub const DAY_1: ::nl_item = 1; +pub const DAY_2: ::nl_item = 2; +pub const DAY_3: ::nl_item = 3; +pub const DAY_4: ::nl_item = 4; +pub const DAY_5: ::nl_item = 5; +pub const DAY_6: ::nl_item = 6; +pub const DAY_7: ::nl_item = 7; + +pub const ABDAY_1: ::nl_item = 8; +pub const ABDAY_2: ::nl_item = 9; +pub const ABDAY_3: ::nl_item = 10; +pub const ABDAY_4: ::nl_item = 11; +pub const ABDAY_5: ::nl_item = 12; +pub const ABDAY_6: ::nl_item = 13; +pub const ABDAY_7: ::nl_item = 14; + +pub const MON_1: ::nl_item = 15; +pub const MON_2: ::nl_item = 16; +pub const MON_3: ::nl_item = 17; +pub const MON_4: ::nl_item = 18; +pub const MON_5: ::nl_item = 19; +pub const MON_6: ::nl_item = 20; +pub const MON_7: ::nl_item = 21; +pub const MON_8: ::nl_item = 22; +pub const MON_9: ::nl_item = 23; +pub const MON_10: ::nl_item = 24; +pub const MON_11: ::nl_item = 25; +pub const MON_12: ::nl_item = 26; + +pub const ABMON_1: ::nl_item = 27; +pub const ABMON_2: ::nl_item = 28; +pub const ABMON_3: ::nl_item = 29; +pub const ABMON_4: ::nl_item = 30; +pub const ABMON_5: ::nl_item = 31; +pub const ABMON_6: ::nl_item = 32; +pub const ABMON_7: ::nl_item = 33; +pub const ABMON_8: ::nl_item = 34; +pub const ABMON_9: ::nl_item = 35; +pub const ABMON_10: ::nl_item = 36; +pub const ABMON_11: ::nl_item = 37; +pub const ABMON_12: ::nl_item = 38; + +pub const RADIXCHAR: ::nl_item = 39; +pub const THOUSEP: ::nl_item = 40; +pub const YESSTR: ::nl_item = 41; +pub const NOSTR: ::nl_item = 42; +pub const CRNCYSTR: ::nl_item = 43; + +pub const D_T_FMT: ::nl_item = 44; +pub const D_FMT: ::nl_item = 45; +pub const T_FMT: ::nl_item = 46; +pub const AM_STR: ::nl_item = 47; +pub const PM_STR: ::nl_item = 48; + +pub const CODESET: ::nl_item = 49; +pub const T_FMT_AMPM: ::nl_item = 50; +pub const ERA: ::nl_item = 51; +pub const ERA_D_FMT: ::nl_item = 52; +pub const ERA_D_T_FMT: ::nl_item = 53; +pub const ERA_T_FMT: ::nl_item = 54; +pub const ALT_DIGITS: ::nl_item = 55; +pub const YESEXPR: ::nl_item = 56; +pub const NOEXPR: ::nl_item = 57; +pub const _DATE_FMT: ::nl_item = 58; +pub const MAXSTRMSG: ::nl_item = 58; + +pub const PATH_MAX: ::c_int = 1024; + +pub const SA_ONSTACK: ::c_int = 0x00000001; +pub const SA_RESETHAND: ::c_int = 0x00000002; +pub const SA_RESTART: ::c_int = 0x00000004; +pub const SA_SIGINFO: ::c_int = 0x00000008; +pub const SA_NODEFER: ::c_int = 0x00000010; +pub const SA_NOCLDWAIT: ::c_int = 0x00010000; +pub const SA_NOCLDSTOP: ::c_int = 0x00020000; + +pub const SS_ONSTACK: ::c_int = 1; +pub const SS_DISABLE: ::c_int = 2; + +pub const FIOCLEX: ::c_int = 0x20006601; +pub const FIONCLEX: ::c_int = 0x20006602; +pub const FIONREAD: ::c_int = 0x4004667f; +pub const FIONBIO: ::c_int = 0x8004667e; +pub const FIOASYNC: ::c_int = 0x8004667d; +pub const FIOSETOWN: ::c_int = 0x8004667c; +pub const FIOGETOWN: ::c_int = 0x4004667b; + +pub const SIGCHLD: ::c_int = 18; +pub const SIGCLD: ::c_int = ::SIGCHLD; +pub const SIGBUS: ::c_int = 10; +pub const SIGINFO: ::c_int = 41; +pub const SIG_BLOCK: ::c_int = 1; +pub const SIG_UNBLOCK: ::c_int = 2; +pub const SIG_SETMASK: ::c_int = 3; + +pub const SIGEV_NONE: ::c_int = 1; +pub const SIGEV_SIGNAL: ::c_int = 2; +pub const SIGEV_THREAD: ::c_int = 3; + +pub const CLD_EXITED: ::c_int = 1; +pub const CLD_KILLED: ::c_int = 2; +pub const CLD_DUMPED: ::c_int = 3; +pub const CLD_TRAPPED: ::c_int = 4; +pub const CLD_STOPPED: ::c_int = 5; +pub const CLD_CONTINUED: ::c_int = 6; + +pub const IP_RECVDSTADDR: ::c_int = 0x7; +pub const IP_SEC_OPT: ::c_int = 0x22; + +pub const IPV6_UNICAST_HOPS: ::c_int = 0x5; +pub const IPV6_MULTICAST_IF: ::c_int = 0x6; +pub const IPV6_MULTICAST_HOPS: ::c_int = 0x7; +pub const IPV6_MULTICAST_LOOP: ::c_int = 0x8; +pub const IPV6_RECVPKTINFO: ::c_int = 0x12; +pub const IPV6_SEC_OPT: ::c_int = 0x22; +pub const IPV6_V6ONLY: ::c_int = 0x27; + +cfg_if! { + if #[cfg(target_pointer_width = "64")] { + pub const FD_SETSIZE: usize = 65536; + } else { + pub const FD_SETSIZE: usize = 1024; + } +} + +pub const ST_RDONLY: ::c_ulong = 1; +pub const ST_NOSUID: ::c_ulong = 2; + +pub const NI_MAXHOST: ::socklen_t = 1025; +pub const NI_MAXSERV: ::socklen_t = 32; + +pub const EXIT_FAILURE: ::c_int = 1; +pub const EXIT_SUCCESS: ::c_int = 0; +pub const RAND_MAX: ::c_int = 32767; +pub const EOF: ::c_int = -1; +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; +pub const SEEK_DATA: ::c_int = 3; +pub const SEEK_HOLE: ::c_int = 4; +pub const _IOFBF: ::c_int = 0; +pub const _IONBF: ::c_int = 4; +pub const _IOLBF: ::c_int = 64; +pub const BUFSIZ: ::c_uint = 1024; +pub const FOPEN_MAX: ::c_uint = 20; +pub const FILENAME_MAX: ::c_uint = 1024; +pub const L_tmpnam: ::c_uint = 25; +pub const TMP_MAX: ::c_uint = 17576; + +pub const GRND_NONBLOCK: ::c_int = 0x0001; +pub const GRND_RANDOM: ::c_int = 0x0002; + +pub const O_RDONLY: ::c_int = 0; +pub const O_WRONLY: ::c_int = 1; +pub const O_RDWR: ::c_int = 2; +pub const O_NDELAY: ::c_int = 0x04; +pub const O_APPEND: ::c_int = 8; +pub const O_DSYNC: ::c_int = 0x40; +pub const O_CREAT: ::c_int = 256; +pub const O_EXCL: ::c_int = 1024; +pub const O_NOCTTY: ::c_int = 2048; +pub const O_TRUNC: ::c_int = 512; +pub const O_NOFOLLOW: ::c_int = 0x20000; +pub const O_DIRECTORY: ::c_int = 0x1000000; +pub const O_SEARCH: ::c_int = 0x200000; +pub const O_EXEC: ::c_int = 0x400000; +pub const O_CLOEXEC: ::c_int = 0x800000; +pub const O_ACCMODE: ::c_int = 0x600003; +pub const O_XATTR: ::c_int = 0x4000; +pub const S_IFIFO: mode_t = 4096; +pub const S_IFCHR: mode_t = 8192; +pub const S_IFBLK: mode_t = 24576; +pub const S_IFDIR: mode_t = 16384; +pub const S_IFREG: mode_t = 32768; +pub const S_IFLNK: mode_t = 40960; +pub const S_IFSOCK: mode_t = 49152; +pub const S_IFMT: mode_t = 61440; +pub const S_IEXEC: mode_t = 64; +pub const S_IWRITE: mode_t = 128; +pub const S_IREAD: mode_t = 256; +pub const S_IRWXU: mode_t = 448; +pub const S_IXUSR: mode_t = 64; +pub const S_IWUSR: mode_t = 128; +pub const S_IRUSR: mode_t = 256; +pub const S_IRWXG: mode_t = 56; +pub const S_IXGRP: mode_t = 8; +pub const S_IWGRP: mode_t = 16; +pub const S_IRGRP: mode_t = 32; +pub const S_IRWXO: mode_t = 7; +pub const S_IXOTH: mode_t = 1; +pub const S_IWOTH: mode_t = 2; +pub const S_IROTH: mode_t = 4; +pub const F_OK: ::c_int = 0; +pub const R_OK: ::c_int = 4; +pub const W_OK: ::c_int = 2; +pub const X_OK: ::c_int = 1; +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; +pub const F_LOCK: ::c_int = 1; +pub const F_TEST: ::c_int = 3; +pub const F_TLOCK: ::c_int = 2; +pub const F_ULOCK: ::c_int = 0; +pub const F_DUPFD_CLOEXEC: ::c_int = 37; +pub const F_SETLK: ::c_int = 6; +pub const F_SETLKW: ::c_int = 7; +pub const F_GETLK: ::c_int = 14; +pub const F_ALLOCSP: ::c_int = 10; +pub const F_FREESP: ::c_int = 11; +pub const F_BLOCKS: ::c_int = 18; +pub const F_BLKSIZE: ::c_int = 19; +pub const F_SHARE: ::c_int = 40; +pub const F_UNSHARE: ::c_int = 41; +pub const F_ISSTREAM: ::c_int = 13; +pub const F_PRIV: ::c_int = 15; +pub const F_NPRIV: ::c_int = 16; +pub const F_QUOTACTL: ::c_int = 17; +pub const F_GETOWN: ::c_int = 23; +pub const F_SETOWN: ::c_int = 24; +pub const F_REVOKE: ::c_int = 25; +pub const F_HASREMOTELOCKS: ::c_int = 26; +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGABRT: ::c_int = 6; +pub const SIGEMT: ::c_int = 7; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGSEGV: ::c_int = 11; +pub const SIGSYS: ::c_int = 12; +pub const SIGPIPE: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; +pub const SIGUSR1: ::c_int = 16; +pub const SIGUSR2: ::c_int = 17; +pub const SIGPWR: ::c_int = 19; +pub const SIGWINCH: ::c_int = 20; +pub const SIGURG: ::c_int = 21; +pub const SIGPOLL: ::c_int = 22; +pub const SIGIO: ::c_int = SIGPOLL; +pub const SIGSTOP: ::c_int = 23; +pub const SIGTSTP: ::c_int = 24; +pub const SIGCONT: ::c_int = 25; +pub const SIGTTIN: ::c_int = 26; +pub const SIGTTOU: ::c_int = 27; +pub const SIGVTALRM: ::c_int = 28; +pub const SIGPROF: ::c_int = 29; +pub const SIGXCPU: ::c_int = 30; +pub const SIGXFSZ: ::c_int = 31; + +pub const WNOHANG: ::c_int = 0x40; +pub const WUNTRACED: ::c_int = 0x04; + +pub const WEXITED: ::c_int = 0x01; +pub const WTRAPPED: ::c_int = 0x02; +pub const WSTOPPED: ::c_int = WUNTRACED; +pub const WCONTINUED: ::c_int = 0x08; +pub const WNOWAIT: ::c_int = 0x80; + +pub const AT_FDCWD: ::c_int = 0xffd19553; +pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x1000; +pub const AT_SYMLINK_FOLLOW: ::c_int = 0x2000; +pub const AT_REMOVEDIR: ::c_int = 0x1; +pub const _AT_TRIGGER: ::c_int = 0x2; +pub const AT_EACCESS: ::c_int = 0x4; + +pub const P_PID: idtype_t = 0; +pub const P_PPID: idtype_t = 1; +pub const P_PGID: idtype_t = 2; +pub const P_SID: idtype_t = 3; +pub const P_CID: idtype_t = 4; +pub const P_UID: idtype_t = 5; +pub const P_GID: idtype_t = 6; +pub const P_ALL: idtype_t = 7; +pub const P_LWPID: idtype_t = 8; +pub const P_TASKID: idtype_t = 9; +pub const P_PROJID: idtype_t = 10; +pub const P_POOLID: idtype_t = 11; +pub const P_ZONEID: idtype_t = 12; +pub const P_CTID: idtype_t = 13; +pub const P_CPUID: idtype_t = 14; +pub const P_PSETID: idtype_t = 15; + +pub const PBIND_NONE: ::processorid_t = -1; +pub const PBIND_QUERY: ::processorid_t = -2; +pub const PBIND_HARD: ::processorid_t = -3; +pub const PBIND_SOFT: ::processorid_t = -4; + +pub const PS_NONE: ::c_int = -1; +pub const PS_QUERY: ::c_int = -2; +pub const PS_MYID: ::c_int = -3; +pub const PS_SOFT: ::c_int = -4; +pub const PS_HARD: ::c_int = -5; +pub const PS_QUERY_TYPE: ::c_int = -6; +pub const PS_SYSTEM: ::c_int = 1; +pub const PS_PRIVATE: ::c_int = 2; + +pub const UTIME_OMIT: c_long = -2; +pub const UTIME_NOW: c_long = -1; + +pub const PROT_NONE: ::c_int = 0; +pub const PROT_READ: ::c_int = 1; +pub const PROT_WRITE: ::c_int = 2; +pub const PROT_EXEC: ::c_int = 4; + +pub const MAP_FILE: ::c_int = 0; +pub const MAP_SHARED: ::c_int = 0x0001; +pub const MAP_PRIVATE: ::c_int = 0x0002; +pub const MAP_FIXED: ::c_int = 0x0010; +pub const MAP_NORESERVE: ::c_int = 0x40; +pub const MAP_ANON: ::c_int = 0x0100; +pub const MAP_ANONYMOUS: ::c_int = 0x0100; +pub const MAP_RENAME: ::c_int = 0x20; +pub const MAP_ALIGN: ::c_int = 0x200; +pub const MAP_TEXT: ::c_int = 0x400; +pub const MAP_INITDATA: ::c_int = 0x800; +pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; + +pub const MCL_CURRENT: ::c_int = 0x0001; +pub const MCL_FUTURE: ::c_int = 0x0002; + +pub const MS_SYNC: ::c_int = 0x0004; +pub const MS_ASYNC: ::c_int = 0x0001; +pub const MS_INVALIDATE: ::c_int = 0x0002; + +pub const MMOBJ_PADDING: ::c_uint = 0x10000; +pub const MMOBJ_INTERPRET: ::c_uint = 0x20000; +pub const MR_PADDING: ::c_uint = 0x1; +pub const MR_HDR_ELF: ::c_uint = 0x2; + +pub const EPERM: ::c_int = 1; +pub const ENOENT: ::c_int = 2; +pub const ESRCH: ::c_int = 3; +pub const EINTR: ::c_int = 4; +pub const EIO: ::c_int = 5; +pub const ENXIO: ::c_int = 6; +pub const E2BIG: ::c_int = 7; +pub const ENOEXEC: ::c_int = 8; +pub const EBADF: ::c_int = 9; +pub const ECHILD: ::c_int = 10; +pub const EAGAIN: ::c_int = 11; +pub const ENOMEM: ::c_int = 12; +pub const EACCES: ::c_int = 13; +pub const EFAULT: ::c_int = 14; +pub const ENOTBLK: ::c_int = 15; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENFILE: ::c_int = 23; +pub const EMFILE: ::c_int = 24; +pub const ENOTTY: ::c_int = 25; +pub const ETXTBSY: ::c_int = 26; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDOM: ::c_int = 33; +pub const ERANGE: ::c_int = 34; +pub const ENOMSG: ::c_int = 35; +pub const EIDRM: ::c_int = 36; +pub const ECHRNG: ::c_int = 37; +pub const EL2NSYNC: ::c_int = 38; +pub const EL3HLT: ::c_int = 39; +pub const EL3RST: ::c_int = 40; +pub const ELNRNG: ::c_int = 41; +pub const EUNATCH: ::c_int = 42; +pub const ENOCSI: ::c_int = 43; +pub const EL2HLT: ::c_int = 44; +pub const EDEADLK: ::c_int = 45; +pub const ENOLCK: ::c_int = 46; +pub const ECANCELED: ::c_int = 47; +pub const ENOTSUP: ::c_int = 48; +pub const EDQUOT: ::c_int = 49; +pub const EBADE: ::c_int = 50; +pub const EBADR: ::c_int = 51; +pub const EXFULL: ::c_int = 52; +pub const ENOANO: ::c_int = 53; +pub const EBADRQC: ::c_int = 54; +pub const EBADSLT: ::c_int = 55; +pub const EDEADLOCK: ::c_int = 56; +pub const EBFONT: ::c_int = 57; +pub const EOWNERDEAD: ::c_int = 58; +pub const ENOTRECOVERABLE: ::c_int = 59; +pub const ENOSTR: ::c_int = 60; +pub const ENODATA: ::c_int = 61; +pub const ETIME: ::c_int = 62; +pub const ENOSR: ::c_int = 63; +pub const ENONET: ::c_int = 64; +pub const ENOPKG: ::c_int = 65; +pub const EREMOTE: ::c_int = 66; +pub const ENOLINK: ::c_int = 67; +pub const EADV: ::c_int = 68; +pub const ESRMNT: ::c_int = 69; +pub const ECOMM: ::c_int = 70; +pub const EPROTO: ::c_int = 71; +pub const ELOCKUNMAPPED: ::c_int = 72; +pub const ENOTACTIVE: ::c_int = 73; +pub const EMULTIHOP: ::c_int = 74; +pub const EADI: ::c_int = 75; +pub const EBADMSG: ::c_int = 77; +pub const ENAMETOOLONG: ::c_int = 78; +pub const EOVERFLOW: ::c_int = 79; +pub const ENOTUNIQ: ::c_int = 80; +pub const EBADFD: ::c_int = 81; +pub const EREMCHG: ::c_int = 82; +pub const ELIBACC: ::c_int = 83; +pub const ELIBBAD: ::c_int = 84; +pub const ELIBSCN: ::c_int = 85; +pub const ELIBMAX: ::c_int = 86; +pub const ELIBEXEC: ::c_int = 87; +pub const EILSEQ: ::c_int = 88; +pub const ENOSYS: ::c_int = 89; +pub const ELOOP: ::c_int = 90; +pub const ERESTART: ::c_int = 91; +pub const ESTRPIPE: ::c_int = 92; +pub const ENOTEMPTY: ::c_int = 93; +pub const EUSERS: ::c_int = 94; +pub const ENOTSOCK: ::c_int = 95; +pub const EDESTADDRREQ: ::c_int = 96; +pub const EMSGSIZE: ::c_int = 97; +pub const EPROTOTYPE: ::c_int = 98; +pub const ENOPROTOOPT: ::c_int = 99; +pub const EPROTONOSUPPORT: ::c_int = 120; +pub const ESOCKTNOSUPPORT: ::c_int = 121; +pub const EOPNOTSUPP: ::c_int = 122; +pub const EPFNOSUPPORT: ::c_int = 123; +pub const EAFNOSUPPORT: ::c_int = 124; +pub const EADDRINUSE: ::c_int = 125; +pub const EADDRNOTAVAIL: ::c_int = 126; +pub const ENETDOWN: ::c_int = 127; +pub const ENETUNREACH: ::c_int = 128; +pub const ENETRESET: ::c_int = 129; +pub const ECONNABORTED: ::c_int = 130; +pub const ECONNRESET: ::c_int = 131; +pub const ENOBUFS: ::c_int = 132; +pub const EISCONN: ::c_int = 133; +pub const ENOTCONN: ::c_int = 134; +pub const ESHUTDOWN: ::c_int = 143; +pub const ETOOMANYREFS: ::c_int = 144; +pub const ETIMEDOUT: ::c_int = 145; +pub const ECONNREFUSED: ::c_int = 146; +pub const EHOSTDOWN: ::c_int = 147; +pub const EHOSTUNREACH: ::c_int = 148; +pub const EWOULDBLOCK: ::c_int = EAGAIN; +pub const EALREADY: ::c_int = 149; +pub const EINPROGRESS: ::c_int = 150; +pub const ESTALE: ::c_int = 151; + +pub const EAI_AGAIN: ::c_int = 2; +pub const EAI_BADFLAGS: ::c_int = 3; +pub const EAI_FAIL: ::c_int = 4; +pub const EAI_FAMILY: ::c_int = 5; +pub const EAI_MEMORY: ::c_int = 6; +pub const EAI_NODATA: ::c_int = 7; +pub const EAI_NONAME: ::c_int = 8; +pub const EAI_SERVICE: ::c_int = 9; +pub const EAI_SOCKTYPE: ::c_int = 10; +pub const EAI_SYSTEM: ::c_int = 11; +pub const EAI_OVERFLOW: ::c_int = 12; + +pub const NI_NOFQDN: ::c_uint = 0x0001; +pub const NI_NUMERICHOST: ::c_uint = 0x0002; +pub const NI_NAMEREQD: ::c_uint = 0x0004; +pub const NI_NUMERICSERV: ::c_uint = 0x0008; +pub const NI_DGRAM: ::c_uint = 0x0010; +pub const NI_WITHSCOPEID: ::c_uint = 0x0020; +pub const NI_NUMERICSCOPE: ::c_uint = 0x0040; + +pub const F_DUPFD: ::c_int = 0; +pub const F_DUP2FD: ::c_int = 9; +pub const F_DUP2FD_CLOEXEC: ::c_int = 36; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; +pub const F_GETXFL: ::c_int = 45; + +pub const SIGTRAP: ::c_int = 5; + +pub const GLOB_APPEND: ::c_int = 32; +pub const GLOB_DOOFFS: ::c_int = 16; +pub const GLOB_ERR: ::c_int = 1; +pub const GLOB_MARK: ::c_int = 2; +pub const GLOB_NOCHECK: ::c_int = 8; +pub const GLOB_NOSORT: ::c_int = 4; +pub const GLOB_NOESCAPE: ::c_int = 64; + +pub const GLOB_NOSPACE: ::c_int = -2; +pub const GLOB_ABORTED: ::c_int = -1; +pub const GLOB_NOMATCH: ::c_int = -3; + +pub const POLLIN: ::c_short = 0x1; +pub const POLLPRI: ::c_short = 0x2; +pub const POLLOUT: ::c_short = 0x4; +pub const POLLERR: ::c_short = 0x8; +pub const POLLHUP: ::c_short = 0x10; +pub const POLLNVAL: ::c_short = 0x20; +pub const POLLNORM: ::c_short = 0x0040; +pub const POLLRDNORM: ::c_short = 0x0040; +pub const POLLWRNORM: ::c_short = 0x4; /* POLLOUT */ +pub const POLLRDBAND: ::c_short = 0x0080; +pub const POLLWRBAND: ::c_short = 0x0100; + +pub const POSIX_MADV_NORMAL: ::c_int = 0; +pub const POSIX_MADV_RANDOM: ::c_int = 1; +pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; +pub const POSIX_MADV_WILLNEED: ::c_int = 3; +pub const POSIX_MADV_DONTNEED: ::c_int = 4; + +pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0; +pub const PTHREAD_CREATE_DETACHED: ::c_int = 0x40; +pub const PTHREAD_PROCESS_SHARED: ::c_int = 1; +pub const PTHREAD_PROCESS_PRIVATE: ::c_ushort = 0; +pub const PTHREAD_STACK_MIN: ::size_t = 4096; + +pub const SIGSTKSZ: ::size_t = 8192; + +// https://illumos.org/man/3c/clock_gettime +// https://github.com/illumos/illumos-gate/ +// blob/HEAD/usr/src/lib/libc/amd64/sys/__clock_gettime.s +// clock_gettime(3c) doesn't seem to accept anything other than CLOCK_REALTIME +// or __CLOCK_REALTIME0 +// +// https://github.com/illumos/illumos-gate/ +// blob/HEAD/usr/src/uts/common/sys/time_impl.h +// Confusing! CLOCK_HIGHRES==CLOCK_MONOTONIC==4 +// __CLOCK_REALTIME0==0 is an obsoleted version of CLOCK_REALTIME==3 +pub const CLOCK_REALTIME: ::clockid_t = 3; +pub const CLOCK_MONOTONIC: ::clockid_t = 4; +pub const TIMER_RELTIME: ::c_int = 0; +pub const TIMER_ABSTIME: ::c_int = 1; + +pub const RLIMIT_CPU: ::c_int = 0; +pub const RLIMIT_FSIZE: ::c_int = 1; +pub const RLIMIT_DATA: ::c_int = 2; +pub const RLIMIT_STACK: ::c_int = 3; +pub const RLIMIT_CORE: ::c_int = 4; +pub const RLIMIT_NOFILE: ::c_int = 5; +pub const RLIMIT_VMEM: ::c_int = 6; +pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM; + +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] +pub const RLIM_NLIMITS: rlim_t = 7; +pub const RLIM_INFINITY: rlim_t = 0xfffffffffffffffd; + +pub const RUSAGE_SELF: ::c_int = 0; +pub const RUSAGE_CHILDREN: ::c_int = -1; + +pub const MADV_NORMAL: ::c_int = 0; +pub const MADV_RANDOM: ::c_int = 1; +pub const MADV_SEQUENTIAL: ::c_int = 2; +pub const MADV_WILLNEED: ::c_int = 3; +pub const MADV_DONTNEED: ::c_int = 4; +pub const MADV_FREE: ::c_int = 5; + +pub const AF_UNSPEC: ::c_int = 0; +pub const AF_UNIX: ::c_int = 1; +pub const AF_INET: ::c_int = 2; +pub const AF_IMPLINK: ::c_int = 3; +pub const AF_PUP: ::c_int = 4; +pub const AF_CHAOS: ::c_int = 5; +pub const AF_NS: ::c_int = 6; +pub const AF_NBS: ::c_int = 7; +pub const AF_ECMA: ::c_int = 8; +pub const AF_DATAKIT: ::c_int = 9; +pub const AF_CCITT: ::c_int = 10; +pub const AF_SNA: ::c_int = 11; +pub const AF_DECnet: ::c_int = 12; +pub const AF_DLI: ::c_int = 13; +pub const AF_LAT: ::c_int = 14; +pub const AF_HYLINK: ::c_int = 15; +pub const AF_APPLETALK: ::c_int = 16; +pub const AF_NIT: ::c_int = 17; +pub const AF_802: ::c_int = 18; +pub const AF_OSI: ::c_int = 19; +pub const AF_X25: ::c_int = 20; +pub const AF_OSINET: ::c_int = 21; +pub const AF_GOSIP: ::c_int = 22; +pub const AF_IPX: ::c_int = 23; +pub const AF_ROUTE: ::c_int = 24; +pub const AF_LINK: ::c_int = 25; +pub const AF_INET6: ::c_int = 26; +pub const AF_KEY: ::c_int = 27; +pub const AF_NCA: ::c_int = 28; +pub const AF_POLICY: ::c_int = 29; +pub const AF_INET_OFFLOAD: ::c_int = 30; +pub const AF_TRILL: ::c_int = 31; +pub const AF_PACKET: ::c_int = 32; + +pub const PF_UNSPEC: ::c_int = AF_UNSPEC; +pub const PF_UNIX: ::c_int = AF_UNIX; +pub const PF_LOCAL: ::c_int = PF_UNIX; +pub const PF_FILE: ::c_int = PF_UNIX; +pub const PF_INET: ::c_int = AF_INET; +pub const PF_IMPLINK: ::c_int = AF_IMPLINK; +pub const PF_PUP: ::c_int = AF_PUP; +pub const PF_CHAOS: ::c_int = AF_CHAOS; +pub const PF_NS: ::c_int = AF_NS; +pub const PF_NBS: ::c_int = AF_NBS; +pub const PF_ECMA: ::c_int = AF_ECMA; +pub const PF_DATAKIT: ::c_int = AF_DATAKIT; +pub const PF_CCITT: ::c_int = AF_CCITT; +pub const PF_SNA: ::c_int = AF_SNA; +pub const PF_DECnet: ::c_int = AF_DECnet; +pub const PF_DLI: ::c_int = AF_DLI; +pub const PF_LAT: ::c_int = AF_LAT; +pub const PF_HYLINK: ::c_int = AF_HYLINK; +pub const PF_APPLETALK: ::c_int = AF_APPLETALK; +pub const PF_NIT: ::c_int = AF_NIT; +pub const PF_802: ::c_int = AF_802; +pub const PF_OSI: ::c_int = AF_OSI; +pub const PF_X25: ::c_int = AF_X25; +pub const PF_OSINET: ::c_int = AF_OSINET; +pub const PF_GOSIP: ::c_int = AF_GOSIP; +pub const PF_IPX: ::c_int = AF_IPX; +pub const PF_ROUTE: ::c_int = AF_ROUTE; +pub const PF_LINK: ::c_int = AF_LINK; +pub const PF_INET6: ::c_int = AF_INET6; +pub const PF_KEY: ::c_int = AF_KEY; +pub const PF_NCA: ::c_int = AF_NCA; +pub const PF_POLICY: ::c_int = AF_POLICY; +pub const PF_INET_OFFLOAD: ::c_int = AF_INET_OFFLOAD; +pub const PF_TRILL: ::c_int = AF_TRILL; +pub const PF_PACKET: ::c_int = AF_PACKET; + +pub const SOCK_DGRAM: ::c_int = 1; +pub const SOCK_STREAM: ::c_int = 2; +pub const SOCK_RAW: ::c_int = 4; +pub const SOCK_RDM: ::c_int = 5; +pub const SOCK_SEQPACKET: ::c_int = 6; +pub const IP_MULTICAST_IF: ::c_int = 16; +pub const IP_MULTICAST_TTL: ::c_int = 17; +pub const IP_MULTICAST_LOOP: ::c_int = 18; +pub const IP_TTL: ::c_int = 4; +pub const IP_HDRINCL: ::c_int = 2; +pub const IP_ADD_MEMBERSHIP: ::c_int = 19; +pub const IP_DROP_MEMBERSHIP: ::c_int = 20; +pub const IPV6_JOIN_GROUP: ::c_int = 9; +pub const IPV6_LEAVE_GROUP: ::c_int = 10; +pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 23; +pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 24; +pub const IP_BLOCK_SOURCE: ::c_int = 21; +pub const IP_UNBLOCK_SOURCE: ::c_int = 22; + +// These TCP socket options are common between illumos and Solaris, while higher +// numbers have generally diverged: +pub const TCP_NODELAY: ::c_int = 0x1; +pub const TCP_MAXSEG: ::c_int = 0x2; +pub const TCP_KEEPALIVE: ::c_int = 0x8; +pub const TCP_NOTIFY_THRESHOLD: ::c_int = 0x10; +pub const TCP_ABORT_THRESHOLD: ::c_int = 0x11; +pub const TCP_CONN_NOTIFY_THRESHOLD: ::c_int = 0x12; +pub const TCP_CONN_ABORT_THRESHOLD: ::c_int = 0x13; +pub const TCP_RECVDSTADDR: ::c_int = 0x14; +pub const TCP_INIT_CWND: ::c_int = 0x15; +pub const TCP_KEEPALIVE_THRESHOLD: ::c_int = 0x16; +pub const TCP_KEEPALIVE_ABORT_THRESHOLD: ::c_int = 0x17; +pub const TCP_CORK: ::c_int = 0x18; +pub const TCP_RTO_INITIAL: ::c_int = 0x19; +pub const TCP_RTO_MIN: ::c_int = 0x1a; +pub const TCP_RTO_MAX: ::c_int = 0x1b; +pub const TCP_LINGER2: ::c_int = 0x1c; + +pub const UDP_NAT_T_ENDPOINT: ::c_int = 0x0103; + +pub const SOMAXCONN: ::c_int = 128; + +pub const SOL_SOCKET: ::c_int = 0xffff; +pub const SO_DEBUG: ::c_int = 0x01; +pub const SO_ACCEPTCONN: ::c_int = 0x0002; +pub const SO_REUSEADDR: ::c_int = 0x0004; +pub const SO_KEEPALIVE: ::c_int = 0x0008; +pub const SO_DONTROUTE: ::c_int = 0x0010; +pub const SO_BROADCAST: ::c_int = 0x0020; +pub const SO_USELOOPBACK: ::c_int = 0x0040; +pub const SO_LINGER: ::c_int = 0x0080; +pub const SO_OOBINLINE: ::c_int = 0x0100; +pub const SO_SNDBUF: ::c_int = 0x1001; +pub const SO_RCVBUF: ::c_int = 0x1002; +pub const SO_SNDLOWAT: ::c_int = 0x1003; +pub const SO_RCVLOWAT: ::c_int = 0x1004; +pub const SO_SNDTIMEO: ::c_int = 0x1005; +pub const SO_RCVTIMEO: ::c_int = 0x1006; +pub const SO_ERROR: ::c_int = 0x1007; +pub const SO_TYPE: ::c_int = 0x1008; +pub const SO_TIMESTAMP: ::c_int = 0x1013; + +pub const SCM_RIGHTS: ::c_int = 0x1010; +pub const SCM_UCRED: ::c_int = 0x1012; +pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; + +pub const MSG_OOB: ::c_int = 0x1; +pub const MSG_PEEK: ::c_int = 0x2; +pub const MSG_DONTROUTE: ::c_int = 0x4; +pub const MSG_EOR: ::c_int = 0x8; +pub const MSG_CTRUNC: ::c_int = 0x10; +pub const MSG_TRUNC: ::c_int = 0x20; +pub const MSG_WAITALL: ::c_int = 0x40; +pub const MSG_DONTWAIT: ::c_int = 0x80; +pub const MSG_NOTIFICATION: ::c_int = 0x100; +pub const MSG_NOSIGNAL: ::c_int = 0x200; +pub const MSG_DUPCTRL: ::c_int = 0x800; +pub const MSG_XPG4_2: ::c_int = 0x8000; +pub const MSG_MAXIOVLEN: ::c_int = 16; + +pub const IF_NAMESIZE: ::size_t = 32; +pub const IFNAMSIZ: ::size_t = 16; + +// https://docs.oracle.com/cd/E23824_01/html/821-1475/if-7p.html +pub const IFF_UP: ::c_int = 0x0000000001; // Address is up +pub const IFF_BROADCAST: ::c_int = 0x0000000002; // Broadcast address valid +pub const IFF_DEBUG: ::c_int = 0x0000000004; // Turn on debugging +pub const IFF_LOOPBACK: ::c_int = 0x0000000008; // Loopback net +pub const IFF_POINTOPOINT: ::c_int = 0x0000000010; // Interface is p-to-p +pub const IFF_NOTRAILERS: ::c_int = 0x0000000020; // Avoid use of trailers +pub const IFF_RUNNING: ::c_int = 0x0000000040; // Resources allocated +pub const IFF_NOARP: ::c_int = 0x0000000080; // No address res. protocol +pub const IFF_PROMISC: ::c_int = 0x0000000100; // Receive all packets +pub const IFF_ALLMULTI: ::c_int = 0x0000000200; // Receive all multicast pkts +pub const IFF_INTELLIGENT: ::c_int = 0x0000000400; // Protocol code on board +pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast + +// Multicast using broadcst. add. +pub const IFF_MULTI_BCAST: ::c_int = 0x0000001000; +pub const IFF_UNNUMBERED: ::c_int = 0x0000002000; // Non-unique address +pub const IFF_DHCPRUNNING: ::c_int = 0x0000004000; // DHCP controls interface +pub const IFF_PRIVATE: ::c_int = 0x0000008000; // Do not advertise +pub const IFF_NOXMIT: ::c_int = 0x0000010000; // Do not transmit pkts + +// No address - just on-link subnet +pub const IFF_NOLOCAL: ::c_int = 0x0000020000; +pub const IFF_DEPRECATED: ::c_int = 0x0000040000; // Address is deprecated +pub const IFF_ADDRCONF: ::c_int = 0x0000080000; // Addr. from stateless addrconf +pub const IFF_ROUTER: ::c_int = 0x0000100000; // Router on interface +pub const IFF_NONUD: ::c_int = 0x0000200000; // No NUD on interface +pub const IFF_ANYCAST: ::c_int = 0x0000400000; // Anycast address +pub const IFF_NORTEXCH: ::c_int = 0x0000800000; // Don't xchange rout. info +pub const IFF_IPV4: ::c_int = 0x0001000000; // IPv4 interface +pub const IFF_IPV6: ::c_int = 0x0002000000; // IPv6 interface +pub const IFF_NOFAILOVER: ::c_int = 0x0008000000; // in.mpathd test address +pub const IFF_FAILED: ::c_int = 0x0010000000; // Interface has failed +pub const IFF_STANDBY: ::c_int = 0x0020000000; // Interface is a hot-spare +pub const IFF_INACTIVE: ::c_int = 0x0040000000; // Functioning but not used +pub const IFF_OFFLINE: ::c_int = 0x0080000000; // Interface is offline + // If CoS marking is supported +pub const IFF_COS_ENABLED: ::c_longlong = 0x0200000000; +pub const IFF_PREFERRED: ::c_longlong = 0x0400000000; // Prefer as source addr. +pub const IFF_TEMPORARY: ::c_longlong = 0x0800000000; // RFC3041 +pub const IFF_FIXEDMTU: ::c_longlong = 0x1000000000; // MTU set with SIOCSLIFMTU +pub const IFF_VIRTUAL: ::c_longlong = 0x2000000000; // Cannot send/receive pkts +pub const IFF_DUPLICATE: ::c_longlong = 0x4000000000; // Local address in use +pub const IFF_IPMP: ::c_longlong = 0x8000000000; // IPMP IP interface + +// sys/ipc.h: +pub const IPC_ALLOC: ::c_int = 0x8000; +pub const IPC_CREAT: ::c_int = 0x200; +pub const IPC_EXCL: ::c_int = 0x400; +pub const IPC_NOWAIT: ::c_int = 0x800; +pub const IPC_PRIVATE: key_t = 0; +pub const IPC_RMID: ::c_int = 10; +pub const IPC_SET: ::c_int = 11; +pub const IPC_SEAT: ::c_int = 12; + +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; + +pub const LOCK_SH: ::c_int = 1; +pub const LOCK_EX: ::c_int = 2; +pub const LOCK_NB: ::c_int = 4; +pub const LOCK_UN: ::c_int = 8; + +pub const F_RDLCK: ::c_short = 1; +pub const F_WRLCK: ::c_short = 2; +pub const F_UNLCK: ::c_short = 3; + +pub const O_SYNC: ::c_int = 16; +pub const O_NONBLOCK: ::c_int = 128; + +pub const IPPROTO_RAW: ::c_int = 255; + +pub const _PC_LINK_MAX: ::c_int = 1; +pub const _PC_MAX_CANON: ::c_int = 2; +pub const _PC_MAX_INPUT: ::c_int = 3; +pub const _PC_NAME_MAX: ::c_int = 4; +pub const _PC_PATH_MAX: ::c_int = 5; +pub const _PC_PIPE_BUF: ::c_int = 6; +pub const _PC_NO_TRUNC: ::c_int = 7; +pub const _PC_VDISABLE: ::c_int = 8; +pub const _PC_CHOWN_RESTRICTED: ::c_int = 9; +pub const _PC_ASYNC_IO: ::c_int = 10; +pub const _PC_PRIO_IO: ::c_int = 11; +pub const _PC_SYNC_IO: ::c_int = 12; +pub const _PC_ALLOC_SIZE_MIN: ::c_int = 13; +pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14; +pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15; +pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16; +pub const _PC_REC_XFER_ALIGN: ::c_int = 17; +pub const _PC_SYMLINK_MAX: ::c_int = 18; +pub const _PC_2_SYMLINKS: ::c_int = 19; +pub const _PC_ACL_ENABLED: ::c_int = 20; +pub const _PC_MIN_HOLE_SIZE: ::c_int = 21; +pub const _PC_CASE_BEHAVIOR: ::c_int = 22; +pub const _PC_SATTR_ENABLED: ::c_int = 23; +pub const _PC_SATTR_EXISTS: ::c_int = 24; +pub const _PC_ACCESS_FILTERING: ::c_int = 25; +pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 26; +pub const _PC_FILESIZEBITS: ::c_int = 67; +pub const _PC_XATTR_ENABLED: ::c_int = 100; +pub const _PC_LAST: ::c_int = 101; +pub const _PC_XATTR_EXISTS: ::c_int = 101; + +pub const _SC_ARG_MAX: ::c_int = 1; +pub const _SC_CHILD_MAX: ::c_int = 2; +pub const _SC_CLK_TCK: ::c_int = 3; +pub const _SC_NGROUPS_MAX: ::c_int = 4; +pub const _SC_OPEN_MAX: ::c_int = 5; +pub const _SC_JOB_CONTROL: ::c_int = 6; +pub const _SC_SAVED_IDS: ::c_int = 7; +pub const _SC_VERSION: ::c_int = 8; +pub const _SC_PASS_MAX: ::c_int = 9; +pub const _SC_LOGNAME_MAX: ::c_int = 10; +pub const _SC_PAGESIZE: ::c_int = 11; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; +pub const _SC_XOPEN_VERSION: ::c_int = 12; +pub const _SC_NPROCESSORS_CONF: ::c_int = 14; +pub const _SC_NPROCESSORS_ONLN: ::c_int = 15; +pub const _SC_STREAM_MAX: ::c_int = 16; +pub const _SC_TZNAME_MAX: ::c_int = 17; +pub const _SC_AIO_LISTIO_MAX: ::c_int = 18; +pub const _SC_AIO_MAX: ::c_int = 19; +pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 20; +pub const _SC_ASYNCHRONOUS_IO: ::c_int = 21; +pub const _SC_DELAYTIMER_MAX: ::c_int = 22; +pub const _SC_FSYNC: ::c_int = 23; +pub const _SC_MAPPED_FILES: ::c_int = 24; +pub const _SC_MEMLOCK: ::c_int = 25; +pub const _SC_MEMLOCK_RANGE: ::c_int = 26; +pub const _SC_MEMORY_PROTECTION: ::c_int = 27; +pub const _SC_MESSAGE_PASSING: ::c_int = 28; +pub const _SC_MQ_OPEN_MAX: ::c_int = 29; +pub const _SC_MQ_PRIO_MAX: ::c_int = 30; +pub const _SC_PRIORITIZED_IO: ::c_int = 31; +pub const _SC_PRIORITY_SCHEDULING: ::c_int = 32; +pub const _SC_REALTIME_SIGNALS: ::c_int = 33; +pub const _SC_RTSIG_MAX: ::c_int = 34; +pub const _SC_SEMAPHORES: ::c_int = 35; +pub const _SC_SEM_NSEMS_MAX: ::c_int = 36; +pub const _SC_SEM_VALUE_MAX: ::c_int = 37; +pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 38; +pub const _SC_SIGQUEUE_MAX: ::c_int = 39; +pub const _SC_SIGRT_MIN: ::c_int = 40; +pub const _SC_SIGRT_MAX: ::c_int = 41; +pub const _SC_SYNCHRONIZED_IO: ::c_int = 42; +pub const _SC_TIMERS: ::c_int = 43; +pub const _SC_TIMER_MAX: ::c_int = 44; +pub const _SC_2_C_BIND: ::c_int = 45; +pub const _SC_2_C_DEV: ::c_int = 46; +pub const _SC_2_C_VERSION: ::c_int = 47; +pub const _SC_2_FORT_DEV: ::c_int = 48; +pub const _SC_2_FORT_RUN: ::c_int = 49; +pub const _SC_2_LOCALEDEF: ::c_int = 50; +pub const _SC_2_SW_DEV: ::c_int = 51; +pub const _SC_2_UPE: ::c_int = 52; +pub const _SC_2_VERSION: ::c_int = 53; +pub const _SC_BC_BASE_MAX: ::c_int = 54; +pub const _SC_BC_DIM_MAX: ::c_int = 55; +pub const _SC_BC_SCALE_MAX: ::c_int = 56; +pub const _SC_BC_STRING_MAX: ::c_int = 57; +pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 58; +pub const _SC_EXPR_NEST_MAX: ::c_int = 59; +pub const _SC_LINE_MAX: ::c_int = 60; +pub const _SC_RE_DUP_MAX: ::c_int = 61; +pub const _SC_XOPEN_CRYPT: ::c_int = 62; +pub const _SC_XOPEN_ENH_I18N: ::c_int = 63; +pub const _SC_XOPEN_SHM: ::c_int = 64; +pub const _SC_2_CHAR_TERM: ::c_int = 66; +pub const _SC_XOPEN_XCU_VERSION: ::c_int = 67; +pub const _SC_ATEXIT_MAX: ::c_int = 76; +pub const _SC_IOV_MAX: ::c_int = 77; +pub const _SC_XOPEN_UNIX: ::c_int = 78; +pub const _SC_T_IOV_MAX: ::c_int = 79; +pub const _SC_PHYS_PAGES: ::c_int = 500; +pub const _SC_AVPHYS_PAGES: ::c_int = 501; +pub const _SC_COHER_BLKSZ: ::c_int = 503; +pub const _SC_SPLIT_CACHE: ::c_int = 504; +pub const _SC_ICACHE_SZ: ::c_int = 505; +pub const _SC_DCACHE_SZ: ::c_int = 506; +pub const _SC_ICACHE_LINESZ: ::c_int = 507; +pub const _SC_DCACHE_LINESZ: ::c_int = 508; +pub const _SC_ICACHE_BLKSZ: ::c_int = 509; +pub const _SC_DCACHE_BLKSZ: ::c_int = 510; +pub const _SC_DCACHE_TBLKSZ: ::c_int = 511; +pub const _SC_ICACHE_ASSOC: ::c_int = 512; +pub const _SC_DCACHE_ASSOC: ::c_int = 513; +pub const _SC_MAXPID: ::c_int = 514; +pub const _SC_STACK_PROT: ::c_int = 515; +pub const _SC_NPROCESSORS_MAX: ::c_int = 516; +pub const _SC_CPUID_MAX: ::c_int = 517; +pub const _SC_EPHID_MAX: ::c_int = 518; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 568; +pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 569; +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 570; +pub const _SC_LOGIN_NAME_MAX: ::c_int = 571; +pub const _SC_THREAD_KEYS_MAX: ::c_int = 572; +pub const _SC_THREAD_STACK_MIN: ::c_int = 573; +pub const _SC_THREAD_THREADS_MAX: ::c_int = 574; +pub const _SC_TTY_NAME_MAX: ::c_int = 575; +pub const _SC_THREADS: ::c_int = 576; +pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 577; +pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 578; +pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 579; +pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 580; +pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 581; +pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 582; +pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 583; +pub const _SC_XOPEN_LEGACY: ::c_int = 717; +pub const _SC_XOPEN_REALTIME: ::c_int = 718; +pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 719; +pub const _SC_XBS5_ILP32_OFF32: ::c_int = 720; +pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 721; +pub const _SC_XBS5_LP64_OFF64: ::c_int = 722; +pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 723; +pub const _SC_2_PBS: ::c_int = 724; +pub const _SC_2_PBS_ACCOUNTING: ::c_int = 725; +pub const _SC_2_PBS_CHECKPOINT: ::c_int = 726; +pub const _SC_2_PBS_LOCATE: ::c_int = 728; +pub const _SC_2_PBS_MESSAGE: ::c_int = 729; +pub const _SC_2_PBS_TRACK: ::c_int = 730; +pub const _SC_ADVISORY_INFO: ::c_int = 731; +pub const _SC_BARRIERS: ::c_int = 732; +pub const _SC_CLOCK_SELECTION: ::c_int = 733; +pub const _SC_CPUTIME: ::c_int = 734; +pub const _SC_HOST_NAME_MAX: ::c_int = 735; +pub const _SC_MONOTONIC_CLOCK: ::c_int = 736; +pub const _SC_READER_WRITER_LOCKS: ::c_int = 737; +pub const _SC_REGEXP: ::c_int = 738; +pub const _SC_SHELL: ::c_int = 739; +pub const _SC_SPAWN: ::c_int = 740; +pub const _SC_SPIN_LOCKS: ::c_int = 741; +pub const _SC_SPORADIC_SERVER: ::c_int = 742; +pub const _SC_SS_REPL_MAX: ::c_int = 743; +pub const _SC_SYMLOOP_MAX: ::c_int = 744; +pub const _SC_THREAD_CPUTIME: ::c_int = 745; +pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 746; +pub const _SC_TIMEOUTS: ::c_int = 747; +pub const _SC_TRACE: ::c_int = 748; +pub const _SC_TRACE_EVENT_FILTER: ::c_int = 749; +pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 750; +pub const _SC_TRACE_INHERIT: ::c_int = 751; +pub const _SC_TRACE_LOG: ::c_int = 752; +pub const _SC_TRACE_NAME_MAX: ::c_int = 753; +pub const _SC_TRACE_SYS_MAX: ::c_int = 754; +pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 755; +pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 756; +pub const _SC_V6_ILP32_OFF32: ::c_int = 757; +pub const _SC_V6_ILP32_OFFBIG: ::c_int = 758; +pub const _SC_V6_LP64_OFF64: ::c_int = 759; +pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 760; +pub const _SC_XOPEN_STREAMS: ::c_int = 761; +pub const _SC_IPV6: ::c_int = 762; +pub const _SC_RAW_SOCKETS: ::c_int = 763; + +pub const _MUTEX_MAGIC: u16 = 0x4d58; // MX +pub const _COND_MAGIC: u16 = 0x4356; // CV +pub const _RWL_MAGIC: u16 = 0x5257; // RW + +pub const NCCS: usize = 19; + +pub const LOG_CRON: ::c_int = 15 << 3; + +pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + __pthread_mutex_flag1: 0, + __pthread_mutex_flag2: 0, + __pthread_mutex_ceiling: 0, + __pthread_mutex_type: PTHREAD_PROCESS_PRIVATE, + __pthread_mutex_magic: _MUTEX_MAGIC, + __pthread_mutex_lock: 0, + __pthread_mutex_data: 0, +}; +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + __pthread_cond_flag: [0; 4], + __pthread_cond_type: PTHREAD_PROCESS_PRIVATE, + __pthread_cond_magic: _COND_MAGIC, + __pthread_cond_data: 0, +}; +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + __pthread_rwlock_readers: 0, + __pthread_rwlock_type: PTHREAD_PROCESS_PRIVATE, + __pthread_rwlock_magic: _RWL_MAGIC, + __pthread_rwlock_mutex: PTHREAD_MUTEX_INITIALIZER, + __pthread_rwlock_readercv: PTHREAD_COND_INITIALIZER, + __pthread_rwlock_writercv: PTHREAD_COND_INITIALIZER, +}; +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 4; +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; + +pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void; +pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void; +pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void; +pub const RTLD_PROBE: *mut ::c_void = -4isize as *mut ::c_void; + +pub const RTLD_LAZY: ::c_int = 0x1; +pub const RTLD_NOW: ::c_int = 0x2; +pub const RTLD_NOLOAD: ::c_int = 0x4; +pub const RTLD_GLOBAL: ::c_int = 0x100; +pub const RTLD_LOCAL: ::c_int = 0x0; +pub const RTLD_PARENT: ::c_int = 0x200; +pub const RTLD_GROUP: ::c_int = 0x400; +pub const RTLD_WORLD: ::c_int = 0x800; +pub const RTLD_NODELETE: ::c_int = 0x1000; +pub const RTLD_FIRST: ::c_int = 0x2000; +pub const RTLD_CONFGEN: ::c_int = 0x10000; + +pub const PORT_SOURCE_AIO: ::c_int = 1; +pub const PORT_SOURCE_TIMER: ::c_int = 2; +pub const PORT_SOURCE_USER: ::c_int = 3; +pub const PORT_SOURCE_FD: ::c_int = 4; +pub const PORT_SOURCE_ALERT: ::c_int = 5; +pub const PORT_SOURCE_MQ: ::c_int = 6; +pub const PORT_SOURCE_FILE: ::c_int = 7; + +pub const NONROOT_USR: ::c_short = 2; +pub const _UTX_USERSIZE: usize = 32; +pub const _UTX_LINESIZE: usize = 32; +pub const _UTX_PADSIZE: usize = 5; +pub const _UTX_IDSIZE: usize = 4; +pub const _UTX_HOSTSIZE: usize = 257; +pub const EMPTY: ::c_short = 0; +pub const RUN_LVL: ::c_short = 1; +pub const BOOT_TIME: ::c_short = 2; +pub const OLD_TIME: ::c_short = 3; +pub const NEW_TIME: ::c_short = 4; +pub const INIT_PROCESS: ::c_short = 5; +pub const LOGIN_PROCESS: ::c_short = 6; +pub const USER_PROCESS: ::c_short = 7; +pub const DEAD_PROCESS: ::c_short = 8; +pub const ACCOUNTING: ::c_short = 9; +pub const DOWN_TIME: ::c_short = 10; + +const _TIOC: ::c_int = ('T' as i32) << 8; +const tIOC: ::c_int = ('t' as i32) << 8; +pub const TCGETA: ::c_int = _TIOC | 1; +pub const TCSETA: ::c_int = _TIOC | 2; +pub const TCSETAW: ::c_int = _TIOC | 3; +pub const TCSETAF: ::c_int = _TIOC | 4; +pub const TCSBRK: ::c_int = _TIOC | 5; +pub const TCXONC: ::c_int = _TIOC | 6; +pub const TCFLSH: ::c_int = _TIOC | 7; +pub const TCDSET: ::c_int = _TIOC | 32; +pub const TCGETS: ::c_int = _TIOC | 13; +pub const TCSETS: ::c_int = _TIOC | 14; +pub const TCSANOW: ::c_int = _TIOC | 14; +pub const TCSETSW: ::c_int = _TIOC | 15; +pub const TCSADRAIN: ::c_int = _TIOC | 15; +pub const TCSETSF: ::c_int = _TIOC | 16; +pub const TCSAFLUSH: ::c_int = _TIOC | 16; +pub const TCIFLUSH: ::c_int = 0; +pub const TCOFLUSH: ::c_int = 1; +pub const TCIOFLUSH: ::c_int = 2; +pub const TCOOFF: ::c_int = 0; +pub const TCOON: ::c_int = 1; +pub const TCIOFF: ::c_int = 2; +pub const TCION: ::c_int = 3; +pub const TIOC: ::c_int = _TIOC; +pub const TIOCKBON: ::c_int = _TIOC | 8; +pub const TIOCKBOF: ::c_int = _TIOC | 9; +pub const TIOCGWINSZ: ::c_int = _TIOC | 104; +pub const TIOCSWINSZ: ::c_int = _TIOC | 103; +pub const TIOCGSOFTCAR: ::c_int = _TIOC | 105; +pub const TIOCSSOFTCAR: ::c_int = _TIOC | 106; +pub const TIOCGPPS: ::c_int = _TIOC | 125; +pub const TIOCSPPS: ::c_int = _TIOC | 126; +pub const TIOCGPPSEV: ::c_int = _TIOC | 127; +pub const TIOCGETD: ::c_int = tIOC | 0; +pub const TIOCSETD: ::c_int = tIOC | 1; +pub const TIOCHPCL: ::c_int = tIOC | 2; +pub const TIOCGETP: ::c_int = tIOC | 8; +pub const TIOCSETP: ::c_int = tIOC | 9; +pub const TIOCSETN: ::c_int = tIOC | 10; +pub const TIOCEXCL: ::c_int = tIOC | 13; +pub const TIOCNXCL: ::c_int = tIOC | 14; +pub const TIOCFLUSH: ::c_int = tIOC | 16; +pub const TIOCSETC: ::c_int = tIOC | 17; +pub const TIOCGETC: ::c_int = tIOC | 18; +pub const TIOCLBIS: ::c_int = tIOC | 127; +pub const TIOCLBIC: ::c_int = tIOC | 126; +pub const TIOCLSET: ::c_int = tIOC | 125; +pub const TIOCLGET: ::c_int = tIOC | 124; +pub const TIOCSBRK: ::c_int = tIOC | 123; +pub const TIOCCBRK: ::c_int = tIOC | 122; +pub const TIOCSDTR: ::c_int = tIOC | 121; +pub const TIOCCDTR: ::c_int = tIOC | 120; +pub const TIOCSLTC: ::c_int = tIOC | 117; +pub const TIOCGLTC: ::c_int = tIOC | 116; +pub const TIOCOUTQ: ::c_int = tIOC | 115; +pub const TIOCNOTTY: ::c_int = tIOC | 113; +pub const TIOCSCTTY: ::c_int = tIOC | 132; +pub const TIOCSTOP: ::c_int = tIOC | 111; +pub const TIOCSTART: ::c_int = tIOC | 110; +pub const TIOCSILOOP: ::c_int = tIOC | 109; +pub const TIOCCILOOP: ::c_int = tIOC | 108; +pub const TIOCGPGRP: ::c_int = tIOC | 20; +pub const TIOCSPGRP: ::c_int = tIOC | 21; +pub const TIOCGSID: ::c_int = tIOC | 22; +pub const TIOCSTI: ::c_int = tIOC | 23; +pub const TIOCMSET: ::c_int = tIOC | 26; +pub const TIOCMBIS: ::c_int = tIOC | 27; +pub const TIOCMBIC: ::c_int = tIOC | 28; +pub const TIOCMGET: ::c_int = tIOC | 29; +pub const TIOCREMOTE: ::c_int = tIOC | 30; +pub const TIOCSIGNAL: ::c_int = tIOC | 31; + +pub const TIOCM_LE: ::c_int = 0o0001; +pub const TIOCM_DTR: ::c_int = 0o0002; +pub const TIOCM_RTS: ::c_int = 0o0004; +pub const TIOCM_ST: ::c_int = 0o0010; +pub const TIOCM_SR: ::c_int = 0o0020; +pub const TIOCM_CTS: ::c_int = 0o0040; +pub const TIOCM_CAR: ::c_int = 0o0100; +pub const TIOCM_CD: ::c_int = TIOCM_CAR; +pub const TIOCM_RNG: ::c_int = 0o0200; +pub const TIOCM_RI: ::c_int = TIOCM_RNG; +pub const TIOCM_DSR: ::c_int = 0o0400; + +pub const EPOLLIN: ::c_int = 0x1; +pub const EPOLLPRI: ::c_int = 0x2; +pub const EPOLLOUT: ::c_int = 0x4; +pub const EPOLLRDNORM: ::c_int = 0x40; +pub const EPOLLRDBAND: ::c_int = 0x80; +pub const EPOLLWRNORM: ::c_int = 0x100; +pub const EPOLLWRBAND: ::c_int = 0x200; +pub const EPOLLMSG: ::c_int = 0x400; +pub const EPOLLERR: ::c_int = 0x8; +pub const EPOLLHUP: ::c_int = 0x10; +pub const EPOLLET: ::c_int = 0x80000000; +pub const EPOLLRDHUP: ::c_int = 0x2000; +pub const EPOLLONESHOT: ::c_int = 0x40000000; +pub const EPOLLWAKEUP: ::c_int = 0x20000000; +pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000; +pub const EPOLL_CLOEXEC: ::c_int = 0x80000; +pub const EPOLL_CTL_ADD: ::c_int = 1; +pub const EPOLL_CTL_MOD: ::c_int = 3; +pub const EPOLL_CTL_DEL: ::c_int = 2; + +/* termios */ +pub const B0: speed_t = 0; +pub const B50: speed_t = 1; +pub const B75: speed_t = 2; +pub const B110: speed_t = 3; +pub const B134: speed_t = 4; +pub const B150: speed_t = 5; +pub const B200: speed_t = 6; +pub const B300: speed_t = 7; +pub const B600: speed_t = 8; +pub const B1200: speed_t = 9; +pub const B1800: speed_t = 10; +pub const B2400: speed_t = 11; +pub const B4800: speed_t = 12; +pub const B9600: speed_t = 13; +pub const B19200: speed_t = 14; +pub const B38400: speed_t = 15; +pub const B57600: speed_t = 16; +pub const B76800: speed_t = 17; +pub const B115200: speed_t = 18; +pub const B153600: speed_t = 19; +pub const B230400: speed_t = 20; +pub const B307200: speed_t = 21; +pub const B460800: speed_t = 22; +pub const B921600: speed_t = 23; +pub const CSTART: ::tcflag_t = 0o21; +pub const CSTOP: ::tcflag_t = 0o23; +pub const CSWTCH: ::tcflag_t = 0o32; +pub const CBAUD: ::tcflag_t = 0o17; +pub const CIBAUD: ::tcflag_t = 0o3600000; +pub const CBAUDEXT: ::tcflag_t = 0o10000000; +pub const CIBAUDEXT: ::tcflag_t = 0o20000000; +pub const CSIZE: ::tcflag_t = 0o000060; +pub const CS5: ::tcflag_t = 0; +pub const CS6: ::tcflag_t = 0o000020; +pub const CS7: ::tcflag_t = 0o000040; +pub const CS8: ::tcflag_t = 0o000060; +pub const CSTOPB: ::tcflag_t = 0o000100; +pub const ECHO: ::tcflag_t = 0o000010; +pub const ECHOE: ::tcflag_t = 0o000020; +pub const ECHOK: ::tcflag_t = 0o000040; +pub const ECHONL: ::tcflag_t = 0o000100; +pub const ECHOCTL: ::tcflag_t = 0o001000; +pub const ECHOPRT: ::tcflag_t = 0o002000; +pub const ECHOKE: ::tcflag_t = 0o004000; +pub const EXTPROC: ::tcflag_t = 0o200000; +pub const IGNBRK: ::tcflag_t = 0o000001; +pub const BRKINT: ::tcflag_t = 0o000002; +pub const IGNPAR: ::tcflag_t = 0o000004; +pub const PARMRK: ::tcflag_t = 0o000010; +pub const INPCK: ::tcflag_t = 0o000020; +pub const ISTRIP: ::tcflag_t = 0o000040; +pub const INLCR: ::tcflag_t = 0o000100; +pub const IGNCR: ::tcflag_t = 0o000200; +pub const ICRNL: ::tcflag_t = 0o000400; +pub const IUCLC: ::tcflag_t = 0o001000; +pub const IXON: ::tcflag_t = 0o002000; +pub const IXOFF: ::tcflag_t = 0o010000; +pub const IXANY: ::tcflag_t = 0o004000; +pub const IMAXBEL: ::tcflag_t = 0o020000; +pub const DOSMODE: ::tcflag_t = 0o100000; +pub const OPOST: ::tcflag_t = 0o000001; +pub const OLCUC: ::tcflag_t = 0o000002; +pub const ONLCR: ::tcflag_t = 0o000004; +pub const OCRNL: ::tcflag_t = 0o000010; +pub const ONOCR: ::tcflag_t = 0o000020; +pub const ONLRET: ::tcflag_t = 0o000040; +pub const OFILL: ::tcflag_t = 0o0000100; +pub const OFDEL: ::tcflag_t = 0o0000200; +pub const CREAD: ::tcflag_t = 0o000200; +pub const PARENB: ::tcflag_t = 0o000400; +pub const PARODD: ::tcflag_t = 0o001000; +pub const HUPCL: ::tcflag_t = 0o002000; +pub const CLOCAL: ::tcflag_t = 0o004000; +pub const CRTSXOFF: ::tcflag_t = 0o10000000000; +pub const CRTSCTS: ::tcflag_t = 0o20000000000; +pub const ISIG: ::tcflag_t = 0o000001; +pub const ICANON: ::tcflag_t = 0o000002; +pub const IEXTEN: ::tcflag_t = 0o100000; +pub const TOSTOP: ::tcflag_t = 0o000400; +pub const FLUSHO: ::tcflag_t = 0o020000; +pub const PENDIN: ::tcflag_t = 0o040000; +pub const NOFLSH: ::tcflag_t = 0o000200; +pub const VINTR: usize = 0; +pub const VQUIT: usize = 1; +pub const VERASE: usize = 2; +pub const VKILL: usize = 3; +pub const VEOF: usize = 4; +pub const VEOL: usize = 5; +pub const VEOL2: usize = 6; +pub const VMIN: usize = 4; +pub const VTIME: usize = 5; +pub const VSWTCH: usize = 7; +pub const VSTART: usize = 8; +pub const VSTOP: usize = 9; +pub const VSUSP: usize = 10; +pub const VDSUSP: usize = 11; +pub const VREPRINT: usize = 12; +pub const VDISCARD: usize = 13; +pub const VWERASE: usize = 14; +pub const VLNEXT: usize = 15; +pub const VSTATUS: usize = 16; +pub const VERASE2: usize = 17; + +// +const STR: ::c_int = (b'S' as ::c_int) << 8; +pub const I_NREAD: ::c_int = STR | 0o1; +pub const I_PUSH: ::c_int = STR | 0o2; +pub const I_POP: ::c_int = STR | 0o3; +pub const I_LOOK: ::c_int = STR | 0o4; +pub const I_FLUSH: ::c_int = STR | 0o5; +pub const I_SRDOPT: ::c_int = STR | 0o6; +pub const I_GRDOPT: ::c_int = STR | 0o7; +pub const I_STR: ::c_int = STR | 0o10; +pub const I_SETSIG: ::c_int = STR | 0o11; +pub const I_GETSIG: ::c_int = STR | 0o12; +pub const I_FIND: ::c_int = STR | 0o13; +pub const I_LINK: ::c_int = STR | 0o14; +pub const I_UNLINK: ::c_int = STR | 0o15; +pub const I_PEEK: ::c_int = STR | 0o17; +pub const I_FDINSERT: ::c_int = STR | 0o20; +pub const I_SENDFD: ::c_int = STR | 0o21; +pub const I_RECVFD: ::c_int = STR | 0o16; +pub const I_SWROPT: ::c_int = STR | 0o23; +pub const I_GWROPT: ::c_int = STR | 0o24; +pub const I_LIST: ::c_int = STR | 0o25; +pub const I_PLINK: ::c_int = STR | 0o26; +pub const I_PUNLINK: ::c_int = STR | 0o27; +pub const I_ANCHOR: ::c_int = STR | 0o30; +pub const I_FLUSHBAND: ::c_int = STR | 0o34; +pub const I_CKBAND: ::c_int = STR | 0o35; +pub const I_GETBAND: ::c_int = STR | 0o36; +pub const I_ATMARK: ::c_int = STR | 0o37; +pub const I_SETCLTIME: ::c_int = STR | 0o40; +pub const I_GETCLTIME: ::c_int = STR | 0o41; +pub const I_CANPUT: ::c_int = STR | 0o42; +pub const I_SERROPT: ::c_int = STR | 0o43; +pub const I_GERROPT: ::c_int = STR | 0o44; +pub const I_ESETSIG: ::c_int = STR | 0o45; +pub const I_EGETSIG: ::c_int = STR | 0o46; +pub const __I_PUSH_NOCTTY: ::c_int = STR | 0o47; + +// 3SOCKET flags +pub const SOCK_CLOEXEC: ::c_int = 0x080000; +pub const SOCK_NONBLOCK: ::c_int = 0x100000; +pub const SOCK_NDELAY: ::c_int = 0x200000; + +// +pub const SCALE_KG: ::c_int = 1 << 6; +pub const SCALE_KF: ::c_int = 1 << 16; +pub const SCALE_KH: ::c_int = 1 << 2; +pub const MAXTC: ::c_int = 1 << 6; +pub const SCALE_PHASE: ::c_int = 1 << 22; +pub const SCALE_USEC: ::c_int = 1 << 16; +pub const SCALE_UPDATE: ::c_int = SCALE_KG * MAXTC; +pub const FINEUSEC: ::c_int = 1 << 22; +pub const MAXPHASE: ::c_int = 512000; +pub const MAXFREQ: ::c_int = 512 * SCALE_USEC; +pub const MAXTIME: ::c_int = 200 << PPS_AVG; +pub const MINSEC: ::c_int = 16; +pub const MAXSEC: ::c_int = 1200; +pub const PPS_AVG: ::c_int = 2; +pub const PPS_SHIFT: ::c_int = 2; +pub const PPS_SHIFTMAX: ::c_int = 8; +pub const PPS_VALID: ::c_int = 120; +pub const MAXGLITCH: ::c_int = 30; +pub const MOD_OFFSET: u32 = 0x0001; +pub const MOD_FREQUENCY: u32 = 0x0002; +pub const MOD_MAXERROR: u32 = 0x0004; +pub const MOD_ESTERROR: u32 = 0x0008; +pub const MOD_STATUS: u32 = 0x0010; +pub const MOD_TIMECONST: u32 = 0x0020; +pub const MOD_CLKB: u32 = 0x4000; +pub const MOD_CLKA: u32 = 0x8000; +pub const STA_PLL: u32 = 0x0001; +pub const STA_PPSFREQ: i32 = 0x0002; +pub const STA_PPSTIME: i32 = 0x0004; +pub const STA_FLL: i32 = 0x0008; +pub const STA_INS: i32 = 0x0010; +pub const STA_DEL: i32 = 0x0020; +pub const STA_UNSYNC: i32 = 0x0040; +pub const STA_FREQHOLD: i32 = 0x0080; +pub const STA_PPSSIGNAL: i32 = 0x0100; +pub const STA_PPSJITTER: i32 = 0x0200; +pub const STA_PPSWANDER: i32 = 0x0400; +pub const STA_PPSERROR: i32 = 0x0800; +pub const STA_CLOCKERR: i32 = 0x1000; +pub const STA_RONLY: i32 = + STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR | STA_CLOCKERR; +pub const TIME_OK: i32 = 0; +pub const TIME_INS: i32 = 1; +pub const TIME_DEL: i32 = 2; +pub const TIME_OOP: i32 = 3; +pub const TIME_WAIT: i32 = 4; +pub const TIME_ERROR: i32 = 5; + +pub const PRIO_PROCESS: ::c_int = 0; +pub const PRIO_PGRP: ::c_int = 1; +pub const PRIO_USER: ::c_int = 2; + +pub const SCHED_OTHER: ::c_int = 0; +pub const SCHED_FIFO: ::c_int = 1; +pub const SCHED_RR: ::c_int = 2; +pub const SCHED_SYS: ::c_int = 3; +pub const SCHED_IA: ::c_int = 4; +pub const SCHED_FSS: ::c_int = 5; +pub const SCHED_FX: ::c_int = 6; + +// sys/priv.h +pub const PRIV_DEBUG: ::c_uint = 0x0001; +pub const PRIV_AWARE: ::c_uint = 0x0002; +pub const PRIV_AWARE_INHERIT: ::c_uint = 0x0004; +pub const __PROC_PROTECT: ::c_uint = 0x0008; +pub const NET_MAC_AWARE: ::c_uint = 0x0010; +pub const NET_MAC_AWARE_INHERIT: ::c_uint = 0x0020; +pub const PRIV_AWARE_RESET: ::c_uint = 0x0040; +pub const PRIV_XPOLICY: ::c_uint = 0x0080; +pub const PRIV_PFEXEC: ::c_uint = 0x0100; +pub const PRIV_USER: ::c_uint = PRIV_DEBUG + | NET_MAC_AWARE + | NET_MAC_AWARE_INHERIT + | PRIV_XPOLICY + | PRIV_AWARE_RESET + | PRIV_PFEXEC; + +// sys/systeminfo.h +pub const SI_SYSNAME: ::c_int = 1; +pub const SI_HOSTNAME: ::c_int = 2; +pub const SI_RELEASE: ::c_int = 3; +pub const SI_VERSION: ::c_int = 4; +pub const SI_MACHINE: ::c_int = 5; +pub const SI_ARCHITECTURE: ::c_int = 6; +pub const SI_HW_SERIAL: ::c_int = 7; +pub const SI_HW_PROVIDER: ::c_int = 8; +pub const SI_SET_HOSTNAME: ::c_int = 258; +pub const SI_SET_SRPC_DOMAIN: ::c_int = 265; +pub const SI_PLATFORM: ::c_int = 513; +pub const SI_ISALIST: ::c_int = 514; +pub const SI_DHCP_CACHE: ::c_int = 515; +pub const SI_ARCHITECTURE_32: ::c_int = 516; +pub const SI_ARCHITECTURE_64: ::c_int = 517; +pub const SI_ARCHITECTURE_K: ::c_int = 518; +pub const SI_ARCHITECTURE_NATIVE: ::c_int = 519; + +// sys/lgrp_user.h +pub const LGRP_COOKIE_NONE: ::lgrp_cookie_t = 0; +pub const LGRP_AFF_NONE: ::lgrp_affinity_t = 0x0; +pub const LGRP_AFF_WEAK: ::lgrp_affinity_t = 0x10; +pub const LGRP_AFF_STRONG: ::lgrp_affinity_t = 0x100; +pub const LGRP_RSRC_COUNT: ::lgrp_rsrc_t = 2; +pub const LGRP_RSRC_CPU: ::lgrp_rsrc_t = 0; +pub const LGRP_RSRC_MEM: ::lgrp_rsrc_t = 1; +pub const LGRP_CONTENT_ALL: ::lgrp_content_t = 0; +pub const LGRP_CONTENT_HIERARCHY: ::lgrp_content_t = LGRP_CONTENT_ALL; +pub const LGRP_CONTENT_DIRECT: ::lgrp_content_t = 1; +pub const LGRP_LAT_CPU_TO_MEM: ::lgrp_lat_between_t = 0; +pub const LGRP_MEM_SZ_FREE: ::lgrp_mem_size_flag_t = 0; +pub const LGRP_MEM_SZ_INSTALLED: ::lgrp_mem_size_flag_t = 1; +pub const LGRP_VIEW_CALLER: ::lgrp_view_t = 0; +pub const LGRP_VIEW_OS: ::lgrp_view_t = 1; + +// sys/processor.h + +pub const P_OFFLINE: ::c_int = 0x001; +pub const P_ONLINE: ::c_int = 0x002; +pub const P_STATUS: ::c_int = 0x003; +pub const P_FAULTED: ::c_int = 0x004; +pub const P_POWEROFF: ::c_int = 0x005; +pub const P_NOINTR: ::c_int = 0x006; +pub const P_SPARE: ::c_int = 0x007; +pub const P_DISABLED: ::c_int = 0x008; +pub const P_FORCED: ::c_int = 0x10000000; +pub const PI_TYPELEN: ::c_int = 16; +pub const PI_FPUTYPE: ::c_int = 32; + +// sys/auxv.h +pub const AT_SUN_HWCAP: ::c_uint = 2009; +pub const AT_SUN_HWCAP2: ::c_uint = 2023; +pub const AT_SUN_FPTYPE: ::c_uint = 2027; + +// As per sys/socket.h, header alignment must be 8 bytes on SPARC +// and 4 bytes everywhere else: +#[cfg(target_arch = "sparc64")] +const _CMSG_HDR_ALIGNMENT: usize = 8; +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +const _CMSG_HDR_ALIGNMENT: usize = 4; + +const _CMSG_DATA_ALIGNMENT: usize = ::mem::size_of::<::c_int>(); + +const_fn! { + {const} fn _CMSG_HDR_ALIGN(p: usize) -> usize { + (p + _CMSG_HDR_ALIGNMENT - 1) & !(_CMSG_HDR_ALIGNMENT - 1) + } + + {const} fn _CMSG_DATA_ALIGN(p: usize) -> usize { + (p + _CMSG_DATA_ALIGNMENT - 1) & !(_CMSG_DATA_ALIGNMENT - 1) + } +} + +f! { + pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar { + _CMSG_DATA_ALIGN(cmsg.offset(1) as usize) as *mut ::c_uchar + } + + pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + _CMSG_DATA_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length + } + + pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr { + if ((*mhdr).msg_controllen as usize) < ::mem::size_of::<::cmsghdr>() { + 0 as *mut ::cmsghdr + } else { + (*mhdr).msg_control as *mut ::cmsghdr + } + } + + pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr) + -> *mut ::cmsghdr + { + if cmsg.is_null() { + return ::CMSG_FIRSTHDR(mhdr); + }; + let next = _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize + + ::mem::size_of::<::cmsghdr>()); + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if next > max { + 0 as *mut ::cmsghdr + } else { + _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize) + as *mut ::cmsghdr + } + } + + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + _CMSG_HDR_ALIGN(::mem::size_of::<::cmsghdr>() as usize + + length as usize) as ::c_uint + } + + pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + let fd = fd as usize; + (*set).fds_bits[fd / bits] &= !(1 << (fd % bits)); + return + } + + pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + let fd = fd as usize; + return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0 + } + + pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () { + let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8; + let fd = fd as usize; + (*set).fds_bits[fd / bits] |= 1 << (fd % bits); + return + } + + pub fn FD_ZERO(set: *mut fd_set) -> () { + for slot in (*set).fds_bits.iter_mut() { + *slot = 0; + } + } +} + +safe_f! { + pub {const} fn WIFEXITED(status: ::c_int) -> bool { + (status & 0xFF) == 0 + } + + pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int { + (status >> 8) & 0xFF + } + + pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int { + status & 0x7F + } + + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + (status & 0xffff) == 0xffff + } + + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { + (status & 0xff00) >> 8 + } + + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + ((status & 0xff) > 0) && (status & 0xff00 == 0) + } + + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { + ((status & 0xff) == 0x7f) && ((status & 0xff00) != 0) + } + + pub {const} fn WCOREDUMP(status: ::c_int) -> bool { + (status & 0x80) != 0 + } + + pub {const} fn MR_GET_TYPE(flags: ::c_uint) -> ::c_uint { + flags & 0x0000ffff + } +} + +extern "C" { + pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int; + pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int; + + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + + pub fn sem_destroy(sem: *mut sem_t) -> ::c_int; + pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int; + + pub fn abs(i: ::c_int) -> ::c_int; + pub fn acct(filename: *const ::c_char) -> ::c_int; + pub fn atof(s: *const ::c_char) -> ::c_double; + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + pub fn labs(i: ::c_long) -> ::c_long; + pub fn rand() -> ::c_int; + pub fn srand(seed: ::c_uint); + pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; + pub fn getrandom(bbuf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; + + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn settimeofday(tp: *const ::timeval, tz: *const ::c_void) -> ::c_int; + pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int; + pub fn freeifaddrs(ifa: *mut ::ifaddrs); + + pub fn stack_getbounds(sp: *mut ::stack_t) -> ::c_int; + pub fn getgrouplist( + name: *const ::c_char, + basegid: ::gid_t, + groups: *mut ::gid_t, + ngroups: *mut ::c_int, + ) -> ::c_int; + pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int; + pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int; + pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int; + pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; + pub fn ___errno() -> *mut ::c_int; + pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + pub fn clock_nanosleep( + clk_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; + pub fn getnameinfo( + sa: *const ::sockaddr, + salen: ::socklen_t, + host: *mut ::c_char, + hostlen: ::socklen_t, + serv: *mut ::c_char, + sevlen: ::socklen_t, + flags: ::c_int, + ) -> ::c_int; + pub fn setpwent(); + pub fn endpwent(); + pub fn getpwent() -> *mut passwd; + pub fn fdatasync(fd: ::c_int) -> ::c_int; + pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t); + pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; + pub fn uselocale(loc: ::locale_t) -> ::locale_t; + pub fn getprogname() -> *const ::c_char; + pub fn setprogname(name: *const ::c_char); + pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int; + pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int; + pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int; + + pub fn mknodat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::mode_t, + dev: dev_t, + ) -> ::c_int; + pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; + pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int; + pub fn if_nameindex() -> *mut if_nameindex; + pub fn if_freenameindex(ptr: *mut if_nameindex); + pub fn pthread_create( + native: *mut ::pthread_t, + attr: *const ::pthread_attr_t, + f: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + pub fn pthread_attr_getstack( + attr: *const ::pthread_attr_t, + stackaddr: *mut *mut ::c_void, + stacksize: *mut ::size_t, + ) -> ::c_int; + pub fn pthread_condattr_getclock( + attr: *const pthread_condattr_t, + clock_id: *mut clockid_t, + ) -> ::c_int; + pub fn pthread_condattr_setclock( + attr: *mut pthread_condattr_t, + clock_id: ::clockid_t, + ) -> ::c_int; + pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int; + pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int; + pub fn pthread_mutex_timedlock( + lock: *mut pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + pub fn pthread_getname_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn pthread_setname_np(tid: ::pthread_t, name: *const ::c_char) -> ::c_int; + pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) + -> ::c_int; + + #[cfg_attr(target_os = "illumos", link_name = "_glob_ext")] + pub fn glob( + pattern: *const ::c_char, + flags: ::c_int, + errfunc: ::Option ::c_int>, + pglob: *mut ::glob_t, + ) -> ::c_int; + + #[cfg_attr(target_os = "illumos", link_name = "_globfree_ext")] + pub fn globfree(pglob: *mut ::glob_t); + + pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; + + pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; + + pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; + + pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; + + pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int; + pub fn shm_unlink(name: *const ::c_char) -> ::c_int; + + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; + pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int; + + pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int; + + pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; + + pub fn recvfrom( + socket: ::c_int, + buf: *mut ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *mut ::sockaddr, + addrlen: *mut ::socklen_t, + ) -> ::ssize_t; + pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int; + pub fn futimesat(fd: ::c_int, path: *const ::c_char, times: *const ::timeval) -> ::c_int; + pub fn futimens(dirfd: ::c_int, times: *const ::timespec) -> ::c_int; + pub fn utimensat( + dirfd: ::c_int, + path: *const ::c_char, + times: *const ::timespec, + flag: ::c_int, + ) -> ::c_int; + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + + #[cfg_attr(target_os = "illumos", link_name = "__xnet_bind")] + pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int; + + pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + + #[cfg_attr(target_os = "illumos", link_name = "__xnet_sendmsg")] + pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t; + #[cfg_attr(target_os = "illumos", link_name = "__xnet_recvmsg")] + pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; + pub fn accept4( + fd: ::c_int, + address: *mut sockaddr, + address_len: *mut socklen_t, + flags: ::c_int, + ) -> ::c_int; + + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; + pub fn mq_receive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + ) -> ::ssize_t; + pub fn mq_timedreceive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::ssize_t; + pub fn mq_send( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + ) -> ::c_int; + pub fn mq_timedsend( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; + pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int; + pub fn port_create() -> ::c_int; + pub fn port_associate( + port: ::c_int, + source: ::c_int, + object: ::uintptr_t, + events: ::c_int, + user: *mut ::c_void, + ) -> ::c_int; + pub fn port_dissociate(port: ::c_int, source: ::c_int, object: ::uintptr_t) -> ::c_int; + pub fn port_get(port: ::c_int, pe: *mut port_event, timeout: *mut ::timespec) -> ::c_int; + pub fn port_getn( + port: ::c_int, + pe_list: *mut port_event, + max: ::c_uint, + nget: *mut ::c_uint, + timeout: *mut ::timespec, + ) -> ::c_int; + pub fn port_send(port: ::c_int, events: ::c_int, user: *mut ::c_void) -> ::c_int; + pub fn port_sendn( + port_list: *mut ::c_int, + error_list: *mut ::c_int, + nent: ::c_uint, + events: ::c_int, + user: *mut ::c_void, + ) -> ::c_int; + #[cfg_attr( + any(target_os = "solaris", target_os = "illumos"), + link_name = "__posix_getgrgid_r" + )] + pub fn getgrgid_r( + gid: ::gid_t, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int; + pub fn sem_close(sem: *mut sem_t) -> ::c_int; + pub fn getdtablesize() -> ::c_int; + + // The epoll functions are actually only present on illumos. However, + // there are things using epoll on illumos (built using the + // x86_64-pc-solaris target) which would break until the illumos target is + // present in rustc. + pub fn epoll_pwait( + epfd: ::c_int, + events: *mut ::epoll_event, + maxevents: ::c_int, + timeout: ::c_int, + sigmask: *const ::sigset_t, + ) -> ::c_int; + + pub fn epoll_create(size: ::c_int) -> ::c_int; + pub fn epoll_create1(flags: ::c_int) -> ::c_int; + pub fn epoll_wait( + epfd: ::c_int, + events: *mut ::epoll_event, + maxevents: ::c_int, + timeout: ::c_int, + ) -> ::c_int; + pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event) + -> ::c_int; + + #[cfg_attr( + any(target_os = "solaris", target_os = "illumos"), + link_name = "__posix_getgrnam_r" + )] + pub fn getgrnam_r( + name: *const ::c_char, + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + pub fn thr_self() -> ::thread_t; + pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; + pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t; + pub fn getgrnam(name: *const ::c_char) -> *mut ::group; + pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int; + pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int; + pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int; + pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int; + pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int; + pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int; + pub fn sched_setscheduler( + pid: ::pid_t, + policy: ::c_int, + param: *const ::sched_param, + ) -> ::c_int; + pub fn sem_unlink(name: *const ::c_char) -> ::c_int; + pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int; + #[cfg_attr( + any(target_os = "solaris", target_os = "illumos"), + link_name = "__posix_getpwnam_r" + )] + pub fn getpwnam_r( + name: *const ::c_char, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + #[cfg_attr( + any(target_os = "solaris", target_os = "illumos"), + link_name = "__posix_getpwuid_r" + )] + pub fn getpwuid_r( + uid: ::uid_t, + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + #[cfg_attr( + any(target_os = "solaris", target_os = "illumos"), + link_name = "__posix_getpwent_r" + )] + pub fn getpwent_r( + pwd: *mut passwd, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut passwd, + ) -> ::c_int; + #[cfg_attr( + any(target_os = "solaris", target_os = "illumos"), + link_name = "__posix_getgrent_r" + )] + pub fn getgrent_r( + grp: *mut ::group, + buf: *mut ::c_char, + buflen: ::size_t, + result: *mut *mut ::group, + ) -> ::c_int; + #[cfg_attr( + any(target_os = "solaris", target_os = "illumos"), + link_name = "__posix_sigwait" + )] + pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int; + pub fn pthread_atfork( + prepare: ::Option, + parent: ::Option, + child: ::Option, + ) -> ::c_int; + pub fn getgrgid(gid: ::gid_t) -> *mut ::group; + pub fn setgrent(); + pub fn endgrent(); + pub fn getgrent() -> *mut ::group; + pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + + pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int; + pub fn uname(buf: *mut ::utsname) -> ::c_int; + pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int; + + pub fn makeutx(ux: *const utmpx) -> *mut utmpx; + pub fn modutx(ux: *const utmpx) -> *mut utmpx; + pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int; + pub fn utmpxname(file: *const ::c_char) -> ::c_int; + pub fn getutxent() -> *mut utmpx; + pub fn getutxid(ut: *const utmpx) -> *mut utmpx; + pub fn getutxline(ut: *const utmpx) -> *mut utmpx; + pub fn pututxline(ut: *const utmpx) -> *mut utmpx; + pub fn setutxent(); + pub fn endutxent(); + + pub fn endutent(); + pub fn getutent() -> *mut utmp; + pub fn getutid(u: *const utmp) -> *mut utmp; + pub fn getutline(u: *const utmp) -> *mut utmp; + pub fn pututline(u: *const utmp) -> *mut utmp; + pub fn setutent(); + pub fn utmpname(file: *const ::c_char) -> ::c_int; + + pub fn getutmp(ux: *const utmpx, u: *mut utmp); + pub fn getutmpx(u: *const utmp, ux: *mut utmpx); + pub fn updwtmp(file: *const ::c_char, u: *mut utmp); + + pub fn ntp_adjtime(buf: *mut timex) -> ::c_int; + pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int; + + pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int; + pub fn timer_delete(timerid: timer_t) -> ::c_int; + pub fn timer_getoverrun(timerid: timer_t) -> ::c_int; + pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int; + pub fn timer_settime( + timerid: timer_t, + flags: ::c_int, + value: *const itimerspec, + ovalue: *mut itimerspec, + ) -> ::c_int; + + pub fn ucred_get(pid: ::pid_t) -> *mut ucred_t; + pub fn getpeerucred(fd: ::c_int, ucred: *mut *mut ucred_t) -> ::c_int; + + pub fn ucred_free(ucred: *mut ucred_t); + + pub fn ucred_geteuid(ucred: *const ucred_t) -> ::uid_t; + pub fn ucred_getruid(ucred: *const ucred_t) -> ::uid_t; + pub fn ucred_getsuid(ucred: *const ucred_t) -> ::uid_t; + pub fn ucred_getegid(ucred: *const ucred_t) -> ::gid_t; + pub fn ucred_getrgid(ucred: *const ucred_t) -> ::gid_t; + pub fn ucred_getsgid(ucred: *const ucred_t) -> ::gid_t; + pub fn ucred_getgroups(ucred: *const ucred_t, groups: *mut *const ::gid_t) -> ::c_int; + pub fn ucred_getpid(ucred: *const ucred_t) -> ::pid_t; + pub fn ucred_getprojid(ucred: *const ucred_t) -> projid_t; + pub fn ucred_getzoneid(ucred: *const ucred_t) -> zoneid_t; + pub fn ucred_getpflags(ucred: *const ucred_t, flags: ::c_uint) -> ::c_uint; + + pub fn ucred_size() -> ::size_t; + + pub fn pset_create(newpset: *mut ::psetid_t) -> ::c_int; + pub fn pset_destroy(pset: ::psetid_t) -> ::c_int; + pub fn pset_assign(pset: ::psetid_t, cpu: ::processorid_t, opset: *mut psetid_t) -> ::c_int; + pub fn pset_info( + pset: ::psetid_t, + tpe: *mut ::c_int, + numcpus: *mut ::c_uint, + cpulist: *mut processorid_t, + ) -> ::c_int; + pub fn pset_bind( + pset: ::psetid_t, + idtype: ::idtype_t, + id: ::id_t, + opset: *mut psetid_t, + ) -> ::c_int; + pub fn pset_list(pset: *mut psetid_t, numpsets: *mut ::c_uint) -> ::c_int; + pub fn pset_setattr(pset: psetid_t, attr: ::c_uint) -> ::c_int; + pub fn pset_getattr(pset: psetid_t, attr: *mut ::c_uint) -> ::c_int; + pub fn processor_bind( + idtype: ::idtype_t, + id: ::id_t, + new_binding: ::processorid_t, + old_binding: *mut processorid_t, + ) -> ::c_int; + pub fn p_online(processorid: ::processorid_t, flag: ::c_int) -> ::c_int; + pub fn processor_info(processorid: ::processorid_t, infop: *mut processor_info_t) -> ::c_int; + + pub fn getexecname() -> *const ::c_char; + + pub fn gethostid() -> ::c_long; + + pub fn getpflags(flags: ::c_uint) -> ::c_uint; + pub fn setpflags(flags: ::c_uint, value: ::c_uint) -> ::c_int; + + pub fn sysinfo(command: ::c_int, buf: *mut ::c_char, count: ::c_long) -> ::c_int; +} + +#[link(name = "sendfile")] +extern "C" { + pub fn sendfile(out_fd: ::c_int, in_fd: ::c_int, off: *mut ::off_t, len: ::size_t) + -> ::ssize_t; + pub fn sendfilev( + fildes: ::c_int, + vec: *const sendfilevec_t, + sfvcnt: ::c_int, + xferred: *mut ::size_t, + ) -> ::ssize_t; + // #include + #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] + pub fn dl_iterate_phdr( + callback: ::Option< + unsafe extern "C" fn( + info: *mut dl_phdr_info, + size: usize, + data: *mut ::c_void, + ) -> ::c_int, + >, + data: *mut ::c_void, + ) -> ::c_int; + pub fn getpagesize() -> ::c_int; + pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int; + pub fn mmapobj( + fd: ::c_int, + flags: ::c_uint, + storage: *mut mmapobj_result_t, + elements: *mut ::c_uint, + arg: *mut ::c_void, + ) -> ::c_int; + pub fn meminfo( + inaddr: *const u64, + addr_count: ::c_int, + info_req: *const ::c_uint, + info_count: ::c_int, + outdata: *mut u64, + validity: *mut ::c_uint, + ) -> ::c_int; + + pub fn strcasecmp_l(s1: *const ::c_char, s2: *const ::c_char, loc: ::locale_t) -> ::c_int; + pub fn strncasecmp_l( + s1: *const ::c_char, + s2: *const ::c_char, + n: ::size_t, + loc: ::locale_t, + ) -> ::c_int; + pub fn strsep(string: *mut *mut ::c_char, delim: *const ::c_char) -> *mut ::c_char; + + pub fn getisax(array: *mut u32, n: ::c_uint) -> ::c_uint; + + pub fn backtrace(buffer: *mut *mut ::c_void, size: ::c_int) -> ::c_int; + pub fn backtrace_symbols(buffer: *const *mut ::c_void, size: ::c_int) -> *mut *mut ::c_char; + pub fn backtrace_symbols_fd(buffer: *const *mut ::c_void, size: ::c_int, fd: ::c_int); +} + +#[link(name = "lgrp")] +extern "C" { + pub fn lgrp_init(view: lgrp_view_t) -> lgrp_cookie_t; + pub fn lgrp_fini(cookie: lgrp_cookie_t) -> ::c_int; + pub fn lgrp_affinity_get( + idtype: ::idtype_t, + id: ::id_t, + lgrp: ::lgrp_id_t, + ) -> ::lgrp_affinity_t; + pub fn lgrp_affinity_set( + idtype: ::idtype_t, + id: ::id_t, + lgrp: ::lgrp_id_t, + aff: lgrp_affinity_t, + ) -> ::lgrp_affinity_t; + pub fn lgrp_cpus( + cookie: ::lgrp_cookie_t, + lgrp: ::lgrp_id_t, + cpuids: *mut ::processorid_t, + count: ::c_uint, + content: ::lgrp_content_t, + ) -> ::c_int; + pub fn lgrp_mem_size( + cookie: ::lgrp_cookie_t, + lgrp: ::lgrp_id_t, + tpe: ::lgrp_mem_size_flag_t, + content: ::lgrp_content_t, + ) -> ::lgrp_mem_size_t; + pub fn lgrp_nlgrps(cookie: ::lgrp_cookie_t) -> ::c_int; + pub fn lgrp_view(cookie: ::lgrp_cookie_t) -> ::lgrp_view_t; + pub fn lgrp_home(idtype: ::idtype_t, id: ::id_t) -> ::lgrp_id_t; + pub fn lgrp_version(version: ::c_int) -> ::c_int; + pub fn lgrp_resources( + cookie: ::lgrp_cookie_t, + lgrp: ::lgrp_id_t, + lgrps: *mut ::lgrp_id_t, + count: ::c_uint, + tpe: ::lgrp_rsrc_t, + ) -> ::c_int; + pub fn lgrp_root(cookie: ::lgrp_cookie_t) -> ::lgrp_id_t; +} + +mod compat; +pub use self::compat::*; + +cfg_if! { + if #[cfg(target_os = "illumos")] { + mod illumos; + pub use self::illumos::*; + } else if #[cfg(target_os = "solaris")] { + mod solaris; + pub use self::solaris::*; + } else { + // Unknown target_os + } +} + +cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; + mod x86_common; + pub use self::x86_64::*; + pub use self::x86_common::*; + } else if #[cfg(target_arch = "x86")] { + mod x86; + mod x86_common; + pub use self::x86::*; + pub use self::x86_common::*; + } +} diff --git a/bash-5.1/vendor/libc/src/unix/solarish/solaris.rs b/bash-5.1/vendor/libc/src/unix/solarish/solaris.rs new file mode 100644 index 0000000000000000000000000000000000000000..8ea070c6db23440814e15f7ee321546e7eae0d87 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/solarish/solaris.rs @@ -0,0 +1,94 @@ +pub type door_attr_t = ::c_uint; +pub type door_id_t = ::c_ulonglong; + +s! { + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_flags: ::uintptr_t, + pub shm_lkcnt: ::c_ushort, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + pub shm_cnattch: ::c_ulong, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + pub shm_amp: *mut ::c_void, + pub shm_gransize: u64, + pub shm_allocated: u64, + pub shm_pad4: [i64; 1], + } + + pub struct door_desc_t__d_data__d_desc { + pub d_descriptor: ::c_int, + pub d_id: ::door_id_t + } +} + +pub const PORT_SOURCE_POSTWAIT: ::c_int = 8; +pub const PORT_SOURCE_SIGNAL: ::c_int = 9; + +pub const AF_LOCAL: ::c_int = 0; +pub const AF_FILE: ::c_int = 0; + +pub const TCP_KEEPIDLE: ::c_int = 0x1d; +pub const TCP_KEEPCNT: ::c_int = 0x1e; +pub const TCP_KEEPINTVL: ::c_int = 0x1f; + +extern "C" { + pub fn fexecve( + fd: ::c_int, + argv: *const *const ::c_char, + envp: *const *const ::c_char, + ) -> ::c_int; + + pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int; + + pub fn door_call(d: ::c_int, params: *const door_arg_t) -> ::c_int; + pub fn door_return( + data_ptr: *const ::c_char, + data_size: ::size_t, + desc_ptr: *const door_desc_t, + num_desc: ::c_uint, + ); + pub fn door_create( + server_procedure: extern "C" fn( + cookie: *const ::c_void, + argp: *const ::c_char, + arg_size: ::size_t, + dp: *const door_desc_t, + n_desc: ::c_uint, + ), + cookie: *const ::c_void, + attributes: door_attr_t, + ) -> ::c_int; + + pub fn fattach(fildes: ::c_int, path: *const ::c_char) -> ::c_int; + + pub fn pthread_getattr_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int; +} + +s_no_extra_traits! { + #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] + pub union door_desc_t__d_data { + pub d_desc: door_desc_t__d_data__d_desc, + d_resv: [::c_int; 5], /* Check out /usr/include/sys/door.h */ + } + + #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] + pub struct door_desc_t { + pub d_attributes: door_attr_t, + pub d_data: door_desc_t__d_data, + } + + #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] + pub struct door_arg_t { + pub data_ptr: *const ::c_char, + pub data_size: ::size_t, + pub desc_ptr: *const door_desc_t, + pub dec_num: ::c_uint, + pub rbuf: *const ::c_char, + pub rsize: ::size_t, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/solarish/x86.rs b/bash-5.1/vendor/libc/src/unix/solarish/x86.rs new file mode 100644 index 0000000000000000000000000000000000000000..23f52ad3c894febbb251471da0f1412e5fe81d62 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/solarish/x86.rs @@ -0,0 +1,29 @@ +pub type Elf32_Addr = ::c_ulong; +pub type Elf32_Half = ::c_ushort; +pub type Elf32_Off = ::c_ulong; +pub type Elf32_Sword = ::c_long; +pub type Elf32_Word = ::c_ulong; +pub type Elf32_Lword = ::c_ulonglong; +pub type Elf32_Phdr = __c_anonymous_Elf32_Phdr; + +s! { + pub struct __c_anonymous_Elf32_Phdr { + pub p_type: ::Elf32_Word, + pub p_offset: ::Elf32_Off, + pub p_vaddr: ::Elf32_Addr, + pub p_paddr: ::Elf32_Addr, + pub p_filesz: ::Elf32_Word, + pub p_memsz: ::Elf32_Word, + pub p_flags: ::Elf32_Word, + pub p_align: ::Elf32_Word, + } + + pub struct dl_phdr_info { + pub dlpi_addr: ::Elf32_Addr, + pub dlpi_name: *const ::c_char, + pub dlpi_phdr: *const ::Elf32_Phdr, + pub dlpi_phnum: ::Elf32_Half, + pub dlpi_adds: ::c_ulonglong, + pub dlpi_subs: ::c_ulonglong, + } +} diff --git a/bash-5.1/vendor/libc/src/unix/solarish/x86_64.rs b/bash-5.1/vendor/libc/src/unix/solarish/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..5f75bdb79624add346f81876189fe97a4b82ffd9 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/solarish/x86_64.rs @@ -0,0 +1,159 @@ +pub type greg_t = ::c_long; + +pub type Elf64_Addr = ::c_ulong; +pub type Elf64_Half = ::c_ushort; +pub type Elf64_Off = ::c_ulong; +pub type Elf64_Sword = ::c_int; +pub type Elf64_Sxword = ::c_long; +pub type Elf64_Word = ::c_uint; +pub type Elf64_Xword = ::c_ulong; +pub type Elf64_Lword = ::c_ulong; +pub type Elf64_Phdr = __c_anonymous_Elf64_Phdr; + +s! { + pub struct __c_anonymous_fpchip_state { + pub cw: u16, + pub sw: u16, + pub fctw: u8, + pub __fx_rsvd: u8, + pub fop: u16, + pub rip: u64, + pub rdp: u64, + pub mxcsr: u32, + pub mxcsr_mask: u32, + pub st: [::upad128_t; 8], + pub xmm: [::upad128_t; 16], + pub __fx_ign: [::upad128_t; 6], + pub status: u32, + pub xstatus: u32, + } + + pub struct __c_anonymous_Elf64_Phdr { + pub p_type: ::Elf64_Word, + pub p_flags: ::Elf64_Word, + pub p_offset: ::Elf64_Off, + pub p_vaddr: ::Elf64_Addr, + pub p_paddr: ::Elf64_Addr, + pub p_filesz: ::Elf64_Xword, + pub p_memsz: ::Elf64_Xword, + pub p_align: ::Elf64_Xword, + } + + pub struct dl_phdr_info { + pub dlpi_addr: ::Elf64_Addr, + pub dlpi_name: *const ::c_char, + pub dlpi_phdr: *const ::Elf64_Phdr, + pub dlpi_phnum: ::Elf64_Half, + pub dlpi_adds: ::c_ulonglong, + pub dlpi_subs: ::c_ulonglong, + } +} + +s_no_extra_traits! { + #[cfg(libc_union)] + pub union __c_anonymous_fp_reg_set { + pub fpchip_state: __c_anonymous_fpchip_state, + pub f_fpregs: [[u32; 13]; 10], + } + + pub struct fpregset_t { + pub fp_reg_set: __c_anonymous_fp_reg_set, + } + + pub struct mcontext_t { + pub gregs: [::greg_t; 28], + pub fpregs: fpregset_t, + } + + pub struct ucontext_t { + pub uc_flags: ::c_ulong, + pub uc_link: *mut ucontext_t, + pub uc_sigmask: ::sigset_t, + pub uc_stack: ::stack_t, + pub uc_mcontext: mcontext_t, + pub uc_filler: [::c_long; 5], + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + #[cfg(libc_union)] + impl PartialEq for __c_anonymous_fp_reg_set { + fn eq(&self, other: &__c_anonymous_fp_reg_set) -> bool { + unsafe { + self.fpchip_state == other.fpchip_state || + self. + f_fpregs. + iter(). + zip(other.f_fpregs.iter()). + all(|(a, b)| a == b) + } + } + } + #[cfg(libc_union)] + impl Eq for __c_anonymous_fp_reg_set {} + #[cfg(libc_union)] + impl ::fmt::Debug for __c_anonymous_fp_reg_set { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + unsafe { + f.debug_struct("__c_anonymous_fp_reg_set") + .field("fpchip_state", &{self.fpchip_state}) + .field("f_fpregs", &{self.f_fpregs}) + .finish() + } + } + } + impl PartialEq for fpregset_t { + fn eq(&self, other: &fpregset_t) -> bool { + self.fp_reg_set == other.fp_reg_set + } + } + impl Eq for fpregset_t {} + impl ::fmt::Debug for fpregset_t { + fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("fpregset_t") + .field("fp_reg_set", &self.fp_reg_set) + .finish() + } + } + impl PartialEq for mcontext_t { + fn eq(&self, other: &mcontext_t) -> bool { + self.gregs == other.gregs && + self.fpregs == other.fpregs + } + } + impl Eq for mcontext_t {} + impl ::fmt::Debug for mcontext_t { + fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("mcontext_t") + .field("gregs", &self.gregs) + .field("fpregs", &self.fpregs) + .finish() + } + } + impl PartialEq for ucontext_t { + fn eq(&self, other: &ucontext_t) -> bool { + self.uc_flags == other.uc_flags + && self.uc_link == other.uc_link + && self.uc_sigmask == other.uc_sigmask + && self.uc_stack == other.uc_stack + && self.uc_mcontext == other.uc_mcontext + && self.uc_filler == other.uc_filler + } + } + impl Eq for ucontext_t {} + impl ::fmt::Debug for ucontext_t { + fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ucontext_t") + .field("uc_flags", &self.uc_flags) + .field("uc_link", &self.uc_link) + .field("uc_sigmask", &self.uc_sigmask) + .field("uc_stack", &self.uc_stack) + .field("uc_mcontext", &self.uc_mcontext) + .field("uc_filler", &self.uc_filler) + .finish() + } + } + + } +} diff --git a/bash-5.1/vendor/libc/src/unix/solarish/x86_common.rs b/bash-5.1/vendor/libc/src/unix/solarish/x86_common.rs new file mode 100644 index 0000000000000000000000000000000000000000..515f23490db554b5b6c09c73967ed0c0db502981 --- /dev/null +++ b/bash-5.1/vendor/libc/src/unix/solarish/x86_common.rs @@ -0,0 +1,65 @@ +// AT_SUN_HWCAP +pub const AV_386_FPU: u32 = 0x00001; +pub const AV_386_TSC: u32 = 0x00002; +pub const AV_386_CX8: u32 = 0x00004; +pub const AV_386_SEP: u32 = 0x00008; +pub const AV_386_AMD_SYSC: u32 = 0x00010; +pub const AV_386_CMOV: u32 = 0x00020; +pub const AV_386_MMX: u32 = 0x00040; +pub const AV_386_AMD_MMX: u32 = 0x00080; +pub const AV_386_AMD_3DNow: u32 = 0x00100; +pub const AV_386_AMD_3DNowx: u32 = 0x00200; +pub const AV_386_FXSR: u32 = 0x00400; +pub const AV_386_SSE: u32 = 0x00800; +pub const AV_386_SSE2: u32 = 0x01000; +pub const AV_386_CX16: u32 = 0x10000; +pub const AV_386_AHF: u32 = 0x20000; +pub const AV_386_TSCP: u32 = 0x40000; +pub const AV_386_AMD_SSE4A: u32 = 0x80000; +pub const AV_386_POPCNT: u32 = 0x100000; +pub const AV_386_AMD_LZCNT: u32 = 0x200000; +pub const AV_386_SSSE3: u32 = 0x400000; +pub const AV_386_SSE4_1: u32 = 0x800000; +pub const AV_386_SSE4_2: u32 = 0x1000000; +pub const AV_386_MOVBE: u32 = 0x2000000; +pub const AV_386_AES: u32 = 0x4000000; +pub const AV_386_PCLMULQDQ: u32 = 0x8000000; +pub const AV_386_XSAVE: u32 = 0x10000000; +pub const AV_386_AVX: u32 = 0x20000000; +pub const AV_386_VMX: u32 = 0x40000000; +pub const AV_386_AMD_SVM: u32 = 0x80000000; +// AT_SUN_HWCAP2 +pub const AV_386_2_F16C: u32 = 0x00000001; +pub const AV_386_2_RDRAND: u32 = 0x00000002; +pub const AV_386_2_BMI1: u32 = 0x00000004; +pub const AV_386_2_BMI2: u32 = 0x00000008; +pub const AV_386_2_FMA: u32 = 0x00000010; +pub const AV_386_2_AVX2: u32 = 0x00000020; +pub const AV_386_2_ADX: u32 = 0x00000040; +pub const AV_386_2_RDSEED: u32 = 0x00000080; +pub const AV_386_2_AVX512F: u32 = 0x00000100; +pub const AV_386_2_AVX512DQ: u32 = 0x00000200; +pub const AV_386_2_AVX512IFMA: u32 = 0x00000400; +pub const AV_386_2_AVX512PF: u32 = 0x00000800; +pub const AV_386_2_AVX512ER: u32 = 0x00001000; +pub const AV_386_2_AVX512CD: u32 = 0x00002000; +pub const AV_386_2_AVX512BW: u32 = 0x00004000; +pub const AV_386_2_AVX512VL: u32 = 0x00008000; +pub const AV_386_2_AVX512VBMI: u32 = 0x00010000; +pub const AV_386_2_AVX512VPOPCDQ: u32 = 0x00020000; +pub const AV_386_2_AVX512_4NNIW: u32 = 0x00040000; +pub const AV_386_2_AVX512_4FMAPS: u32 = 0x00080000; +pub const AV_386_2_SHA: u32 = 0x00100000; +pub const AV_386_2_FSGSBASE: u32 = 0x00200000; +pub const AV_386_2_CLFLUSHOPT: u32 = 0x00400000; +pub const AV_386_2_CLWB: u32 = 0x00800000; +pub const AV_386_2_MONITORX: u32 = 0x01000000; +pub const AV_386_2_CLZERO: u32 = 0x02000000; +pub const AV_386_2_AVX512_VNNI: u32 = 0x04000000; +pub const AV_386_2_VPCLMULQDQ: u32 = 0x08000000; +pub const AV_386_2_VAES: u32 = 0x10000000; +// AT_SUN_FPTYPE +pub const AT_386_FPINFO_NONE: u32 = 0; +pub const AT_386_FPINFO_FXSAVE: u32 = 1; +pub const AT_386_FPINFO_XSAVE: u32 = 2; +pub const AT_386_FPINFO_XSAVE_AMD: u32 = 3; diff --git a/bash-5.1/vendor/libc/src/vxworks/aarch64.rs b/bash-5.1/vendor/libc/src/vxworks/aarch64.rs new file mode 100644 index 0000000000000000000000000000000000000000..4032488b6c0d5b1128fad52fabe5faaf80add3c4 --- /dev/null +++ b/bash-5.1/vendor/libc/src/vxworks/aarch64.rs @@ -0,0 +1,4 @@ +pub type c_char = u8; +pub type wchar_t = u32; +pub type c_long = i64; +pub type c_ulong = u64; diff --git a/bash-5.1/vendor/libc/src/vxworks/arm.rs b/bash-5.1/vendor/libc/src/vxworks/arm.rs new file mode 100644 index 0000000000000000000000000000000000000000..55240068aa08eb7992d9adc49739f44679207b8b --- /dev/null +++ b/bash-5.1/vendor/libc/src/vxworks/arm.rs @@ -0,0 +1,4 @@ +pub type c_char = u8; +pub type wchar_t = u32; +pub type c_long = i32; +pub type c_ulong = u32; diff --git a/bash-5.1/vendor/libc/src/vxworks/mod.rs b/bash-5.1/vendor/libc/src/vxworks/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..2772d68d2f4b1cb05ecd4fed9a850c6d692ef32f --- /dev/null +++ b/bash-5.1/vendor/libc/src/vxworks/mod.rs @@ -0,0 +1,1925 @@ +//! Interface to VxWorks C library + +use core::mem::size_of; +use core::ptr::null_mut; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum DIR {} +impl ::Copy for DIR {} +impl ::Clone for DIR { + fn clone(&self) -> DIR { + *self + } +} + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_float = f32; +pub type c_double = f64; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; + +pub type uintptr_t = usize; +pub type intptr_t = isize; +pub type ptrdiff_t = isize; +pub type size_t = ::uintptr_t; +pub type ssize_t = ::intptr_t; + +pub type pid_t = ::c_int; +pub type in_addr_t = u32; +pub type sighandler_t = ::size_t; +pub type cpuset_t = u32; + +pub type blkcnt_t = ::c_long; +pub type blksize_t = ::c_long; +pub type ino_t = ::c_ulong; + +pub type rlim_t = ::c_ulong; +pub type suseconds_t = ::c_long; +pub type time_t = ::c_long; + +pub type errno_t = ::c_int; + +pub type useconds_t = ::c_ulong; + +pub type socklen_t = ::c_uint; + +pub type pthread_t = ::c_ulong; + +pub type clockid_t = ::c_int; + +//defined for the structs +pub type dev_t = ::c_ulong; +pub type mode_t = ::c_int; +pub type nlink_t = ::c_ulong; +pub type uid_t = ::c_ushort; +pub type gid_t = ::c_ushort; +pub type sigset_t = ::c_ulonglong; +pub type key_t = ::c_long; + +pub type nfds_t = ::c_uint; +pub type stat64 = ::stat; + +pub type pthread_key_t = ::c_ulong; + +// From b_off_t.h +pub type off_t = ::c_longlong; +pub type off64_t = off_t; + +// From b_BOOL.h +pub type BOOL = ::c_int; + +// From vxWind.h .. +pub type _Vx_OBJ_HANDLE = ::c_int; +pub type _Vx_TASK_ID = ::_Vx_OBJ_HANDLE; +pub type _Vx_MSG_Q_ID = ::_Vx_OBJ_HANDLE; +pub type _Vx_SEM_ID_KERNEL = ::_Vx_OBJ_HANDLE; +pub type _Vx_RTP_ID = ::_Vx_OBJ_HANDLE; +pub type _Vx_SD_ID = ::_Vx_OBJ_HANDLE; +pub type _Vx_CONDVAR_ID = ::_Vx_OBJ_HANDLE; +pub type _Vx_SEM_ID = *mut ::_Vx_semaphore; +pub type OBJ_HANDLE = ::_Vx_OBJ_HANDLE; +pub type TASK_ID = ::OBJ_HANDLE; +pub type MSG_Q_ID = ::OBJ_HANDLE; +pub type SEM_ID_KERNEL = ::OBJ_HANDLE; +pub type RTP_ID = ::OBJ_HANDLE; +pub type SD_ID = ::OBJ_HANDLE; +pub type CONDVAR_ID = ::OBJ_HANDLE; + +// From vxTypes.h +pub type _Vx_usr_arg_t = isize; +pub type _Vx_exit_code_t = isize; +pub type _Vx_ticks_t = ::c_uint; +pub type _Vx_ticks64_t = ::c_ulonglong; + +pub type sa_family_t = ::c_uchar; + +// mqueue.h +pub type mqd_t = ::c_int; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum _Vx_semaphore {} +impl ::Copy for _Vx_semaphore {} +impl ::Clone for _Vx_semaphore { + fn clone(&self) -> _Vx_semaphore { + *self + } +} + +impl siginfo_t { + pub unsafe fn si_addr(&self) -> *mut ::c_void { + self.si_addr + } + + pub unsafe fn si_value(&self) -> ::sigval { + self.si_value + } + + pub unsafe fn si_pid(&self) -> ::pid_t { + self.si_pid + } + + pub unsafe fn si_uid(&self) -> ::uid_t { + self.si_uid + } + + pub unsafe fn si_status(&self) -> ::c_int { + self.si_status + } +} + +s! { + // b_pthread_condattr_t.h + pub struct pthread_condattr_t { + pub condAttrStatus: ::c_int, + pub condAttrPshared: ::c_int, + pub condAttrClockId: ::clockid_t, + } + + // b_pthread_cond_t.h + pub struct pthread_cond_t{ + pub condSemId: ::_Vx_SEM_ID, + pub condValid: ::c_int, + pub condInitted: ::c_int, + pub condRefCount: ::c_int, + pub condMutex: *mut ::pthread_mutex_t, + pub condAttr: ::pthread_condattr_t, + pub condSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX] + } + + // b_pthread_rwlockattr_t.h + pub struct pthread_rwlockattr_t { + pub rwlockAttrStatus: ::c_int, + pub rwlockAttrPshared: ::c_int, + pub rwlockAttrMaxReaders: ::c_uint, + pub rwlockAttrConformOpt: ::c_uint, + } + + // b_pthread_rwlock_t.h + pub struct pthread_rwlock_t { + pub rwlockSemId: :: _Vx_SEM_ID, + pub rwlockReadersRefCount: ::c_uint, + pub rwlockValid: ::c_int, + pub rwlockInitted: ::c_int, + pub rwlockAttr: ::pthread_rwlockattr_t, + pub rwlockSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX] + } + + // b_struct_timeval.h + pub struct timeval { + pub tv_sec: ::time_t, + pub tv_usec: ::suseconds_t, + } + + // socket.h + pub struct linger { + pub l_onoff: ::c_int, + pub l_linger: ::c_int, + } + + pub struct sockaddr { + pub sa_len : ::c_uchar, + pub sa_family : sa_family_t, + pub sa_data : [::c_char; 14], + } + + pub struct iovec { + pub iov_base: *mut ::c_void, + pub iov_len: ::size_t, + } + + pub struct msghdr { + pub msg_name: *mut c_void, + pub msg_namelen: socklen_t, + pub msg_iov: *mut iovec, + pub msg_iovlen: ::c_int, + pub msg_control: *mut c_void, + pub msg_controllen: socklen_t, + pub msg_flags: ::c_int, + } + + pub struct cmsghdr { + pub cmsg_len: socklen_t, + pub cmsg_level: ::c_int, + pub cmsg_type: ::c_int, + } + + // poll.h + pub struct pollfd { + pub fd : ::c_int, + pub events : ::c_short, + pub revents : ::c_short, + } + + // resource.h + pub struct rlimit { + pub rlim_cur : ::rlim_t, + pub rlim_max : ::rlim_t, + } + + // stat.h + pub struct stat { + pub st_dev : ::dev_t, + pub st_ino : ::ino_t, + pub st_mode : ::mode_t, + pub st_nlink : ::nlink_t, + pub st_uid : ::uid_t, + pub st_gid : ::gid_t, + pub st_rdev : ::dev_t, + pub st_size : ::off_t, + pub st_atime : ::time_t, + pub st_mtime : ::time_t, + pub st_ctime : ::time_t, + pub st_blksize : ::blksize_t, + pub st_blocks : ::blkcnt_t, + pub st_attrib : ::c_uchar, + pub st_reserved1 : ::c_int, + pub st_reserved2 : ::c_int, + pub st_reserved3 : ::c_int, + pub st_reserved4 : ::c_int, + } + + //b_struct__Timespec.h + pub struct _Timespec { + pub tv_sec : ::time_t, + pub tv_nsec : ::c_long, + } + + // b_struct__Sched_param.h + pub struct _Sched_param { + pub sched_priority: ::c_int, /* scheduling priority */ + pub sched_ss_low_priority: ::c_int, /* low scheduling priority */ + pub sched_ss_repl_period: ::_Timespec, /* replenishment period */ + pub sched_ss_init_budget: ::_Timespec, /* initial budget */ + pub sched_ss_max_repl: ::c_int, /* max pending replenishment */ + + } + + // b_pthread_attr_t.h + pub struct pthread_attr_t { + pub threadAttrStatus : ::c_int, + pub threadAttrStacksize : ::size_t, + pub threadAttrStackaddr : *mut ::c_void, + pub threadAttrGuardsize : ::size_t, + pub threadAttrDetachstate : ::c_int, + pub threadAttrContentionscope : ::c_int, + pub threadAttrInheritsched : ::c_int, + pub threadAttrSchedpolicy : ::c_int, + pub threadAttrName : *mut ::c_char, + pub threadAttrOptions : ::c_int, + pub threadAttrSchedparam : ::_Sched_param, + } + + // signal.h + + pub struct sigaction { + pub sa_u : ::sa_u_t, + pub sa_mask : ::sigset_t, + pub sa_flags : ::c_int, + } + + // b_stack_t.h + pub struct stack_t { + pub ss_sp : *mut ::c_void, + pub ss_size : ::size_t, + pub ss_flags : ::c_int, + } + + // signal.h + pub struct siginfo_t { + pub si_signo : ::c_int, + pub si_code : ::c_int, + pub si_value : ::sigval, + pub si_errno : ::c_int, + pub si_status: ::c_int, + pub si_addr: *mut ::c_void, + pub si_uid: ::uid_t, + pub si_pid: ::pid_t, + } + + // pthread.h (krnl) + // b_pthread_mutexattr_t.h (usr) + pub struct pthread_mutexattr_t { + mutexAttrStatus : ::c_int, + mutexAttrPshared : ::c_int, + mutexAttrProtocol : ::c_int, + mutexAttrPrioceiling : ::c_int, + mutexAttrType : ::c_int, + } + + // pthread.h (krnl) + // b_pthread_mutex_t.h (usr) + pub struct pthread_mutex_t { + pub mutexSemId: ::_Vx_SEM_ID, /*_Vx_SEM_ID ..*/ + pub mutexValid: ::c_int, + pub mutexInitted: ::c_int, + pub mutexCondRefCount: ::c_int, + pub mutexSavPriority: ::c_int, + pub mutexAttr: ::pthread_mutexattr_t, + pub mutexSemName: [::c_char; _PTHREAD_SHARED_SEM_NAME_MAX], + } + + // b_struct_timespec.h + pub struct timespec { + pub tv_sec: ::time_t, + pub tv_nsec: ::c_long, + } + + // time.h + pub struct tm { + pub tm_sec: ::c_int, + pub tm_min: ::c_int, + pub tm_hour: ::c_int, + pub tm_mday: ::c_int, + pub tm_mon: ::c_int, + pub tm_year: ::c_int, + pub tm_wday: ::c_int, + pub tm_yday: ::c_int, + pub tm_isdst: ::c_int, + } + + // in.h + pub struct in_addr { + pub s_addr: in_addr_t, + } + + // in.h + pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, + } + + // in6.h + #[repr(align(4))] + pub struct in6_addr { + pub s6_addr: [u8; 16], + } + + // in6.h + pub struct ipv6_mreq { + pub ipv6mr_multiaddr: in6_addr, + pub ipv6mr_interface: ::c_uint, + } + + // netdb.h + pub struct addrinfo { + pub ai_flags : ::c_int, + pub ai_family : ::c_int, + pub ai_socktype : ::c_int, + pub ai_protocol : ::c_int, + pub ai_addrlen : ::size_t, + pub ai_canonname: *mut ::c_char, + pub ai_addr : *mut ::sockaddr, + pub ai_next : *mut ::addrinfo, + } + + // in.h + pub struct sockaddr_in { + pub sin_len : u8, + pub sin_family: u8, + pub sin_port : u16, + pub sin_addr : ::in_addr, + pub sin_zero : [::c_char; 8], + } + + // in6.h + pub struct sockaddr_in6 { + pub sin6_len : u8, + pub sin6_family : u8, + pub sin6_port : u16, + pub sin6_flowinfo: u32, + pub sin6_addr : ::in6_addr, + pub sin6_scope_id: u32, + } + + pub struct Dl_info { + pub dli_fname: *const ::c_char, + pub dli_fbase: *mut ::c_void, + pub dli_sname: *const ::c_char, + pub dli_saddr: *mut ::c_void, + } + + pub struct mq_attr { + pub mq_maxmsg: ::c_long, + pub mq_msgsize: ::c_long, + pub mq_flags: ::c_long, + pub mq_curmsgs: ::c_long, + } +} + +s_no_extra_traits! { + // dirent.h + pub struct dirent { + pub d_ino : ::ino_t, + pub d_name : [::c_char; _PARM_NAME_MAX as usize + 1], + } + + pub struct sockaddr_un { + pub sun_len: u8, + pub sun_family: sa_family_t, + pub sun_path: [::c_char; 104] + } + + // rtpLibCommon.h + pub struct RTP_DESC { + pub status : ::c_int, + pub options : u32, + pub entrAddr : *mut ::c_void, + pub initTaskId: ::TASK_ID, + pub parentId : ::RTP_ID, + pub pathName : [::c_char; VX_RTP_NAME_LENGTH as usize + 1], + pub taskCnt : ::c_int, + pub textStart : *mut ::c_void, + pub textEnd : *mut ::c_void, + } + // socket.h + pub struct sockaddr_storage { + pub ss_len : ::c_uchar, + pub ss_family : ::sa_family_t, + pub __ss_pad1 : [::c_char; _SS_PAD1SIZE], + pub __ss_align : i32, + pub __ss_pad2 : [::c_char; _SS_PAD2SIZE], + } + + pub union sa_u_t { + pub sa_handler : ::Option !>, + pub sa_sigaction: ::Option !>, + } + + pub union sigval { + pub sival_int : ::c_int, + pub sival_ptr : *mut ::c_void, + } +} + +cfg_if! { + if #[cfg(feature = "extra_traits")] { + impl ::fmt::Debug for dirent { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("dirent") + .field("d_ino", &self.d_ino) + .field("d_name", &&self.d_name[..]) + .finish() + } + } + + impl ::fmt::Debug for sockaddr_un { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_un") + .field("sun_len", &self.sun_len) + .field("sun_family", &self.sun_family) + .field("sun_path", &&self.sun_path[..]) + .finish() + } + } + + impl ::fmt::Debug for RTP_DESC { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("RTP_DESC") + .field("status", &self.status) + .field("options", &self.options) + .field("entrAddr", &self.entrAddr) + .field("initTaskId", &self.initTaskId) + .field("parentId", &self.parentId) + .field("pathName", &&self.pathName[..]) + .field("taskCnt", &self.taskCnt) + .field("textStart", &self.textStart) + .field("textEnd", &self.textEnd) + .finish() + } + } + impl ::fmt::Debug for sockaddr_storage { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sockaddr_storage") + .field("ss_len", &self.ss_len) + .field("ss_family", &self.ss_family) + .field("__ss_pad1", &&self.__ss_pad1[..]) + .field("__ss_align", &self.__ss_align) + .field("__ss_pad2", &&self.__ss_pad2[..]) + .finish() + } + } + + impl PartialEq for sa_u_t { + fn eq(&self, other: &sa_u_t) -> bool { + unsafe { + let h1 = match self.sa_handler { + Some(handler) => handler as usize, + None => 0 as usize, + }; + let h2 = match other.sa_handler { + Some(handler) => handler as usize, + None => 0 as usize, + }; + h1 == h2 + } + } + } + impl Eq for sa_u_t {} + impl ::fmt::Debug for sa_u_t { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + unsafe { + let h = match self.sa_handler { + Some(handler) => handler as usize, + None => 0 as usize, + }; + + f.debug_struct("sa_u_t") + .field("sa_handler", &h) + .finish() + } + } + } + impl ::hash::Hash for sa_u_t { + fn hash(&self, state: &mut H) { + unsafe { + let h = match self.sa_handler { + Some(handler) => handler as usize, + None => 0 as usize, + }; + h.hash(state) + } + } + } + + impl PartialEq for sigval { + fn eq(&self, other: &sigval) -> bool { + unsafe { self.sival_ptr as usize == other.sival_ptr as usize } + } + } + impl Eq for sigval {} + impl ::fmt::Debug for sigval { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("sigval") + .field("sival_ptr", unsafe { &(self.sival_ptr as usize) }) + .finish() + } + } + impl ::hash::Hash for sigval { + fn hash(&self, state: &mut H) { + unsafe { (self.sival_ptr as usize).hash(state) }; + } + } + } +} + +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; + +pub const EXIT_SUCCESS: ::c_int = 0; +pub const EXIT_FAILURE: ::c_int = 1; + +pub const EAI_SERVICE: ::c_int = 9; +pub const EAI_SOCKTYPE: ::c_int = 10; +pub const EAI_SYSTEM: ::c_int = 11; + +// This is not defined in vxWorks, but we have to define it here +// to make the building pass for getrandom and libstd, FIXME +pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; + +//Clock Lib Stuff +pub const CLOCK_REALTIME: ::c_int = 0x0; +pub const CLOCK_MONOTONIC: ::c_int = 0x1; +pub const CLOCK_PROCESS_CPUTIME_ID: ::c_int = 0x2; +pub const CLOCK_THREAD_CPUTIME_ID: ::c_int = 0x3; +pub const TIMER_ABSTIME: ::c_int = 0x1; +pub const TIMER_RELTIME: ::c_int = 0x0; + +// PTHREAD STUFF +pub const PTHREAD_INITIALIZED_OBJ: ::c_int = 0xF70990EF; +pub const PTHREAD_DESTROYED_OBJ: ::c_int = -1; +pub const PTHREAD_VALID_OBJ: ::c_int = 0xEC542A37; +pub const PTHREAD_INVALID_OBJ: ::c_int = -1; +pub const PTHREAD_UNUSED_YET_OBJ: ::c_int = -1; + +pub const PTHREAD_PRIO_NONE: ::c_int = 0; +pub const PTHREAD_PRIO_INHERIT: ::c_int = 1; +pub const PTHREAD_PRIO_PROTECT: ::c_int = 2; + +pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0; +pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; +pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; +pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL; +pub const PTHREAD_STACK_MIN: usize = 4096; +pub const _PTHREAD_SHARED_SEM_NAME_MAX: usize = 30; + +// ERRNO STUFF +pub const OK: ::c_int = 0; +pub const EPERM: ::c_int = 1; /* Not owner */ +pub const ENOENT: ::c_int = 2; /* No such file or directory */ +pub const ESRCH: ::c_int = 3; /* No such process */ +pub const EINTR: ::c_int = 4; /* Interrupted system call */ +pub const EIO: ::c_int = 5; /* I/O error */ +pub const ENXIO: ::c_int = 6; /* No such device or address */ +pub const E2BIG: ::c_int = 7; /* Arg list too long */ +pub const ENOEXEC: ::c_int = 8; /* Exec format error */ +pub const EBADF: ::c_int = 9; /* Bad file number */ +pub const ECHILD: ::c_int = 10; /* No children */ +pub const EAGAIN: ::c_int = 11; /* No more processes */ +pub const ENOMEM: ::c_int = 12; /* Not enough core */ +pub const EACCES: ::c_int = 13; /* Permission denied */ +pub const EFAULT: ::c_int = 14; +pub const ENOTEMPTY: ::c_int = 15; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENAMETOOLONG: ::c_int = 26; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDEADLK: ::c_int = 33; +pub const ERANGE: ::c_int = 38; +pub const EDESTADDRREQ: ::c_int = 40; +pub const EPROTOTYPE: ::c_int = 41; +pub const ENOPROTOOPT: ::c_int = 42; +pub const EPROTONOSUPPORT: ::c_int = 43; +pub const ESOCKTNOSUPPORT: ::c_int = 44; +pub const EOPNOTSUPP: ::c_int = 45; +pub const EPFNOSUPPORT: ::c_int = 46; +pub const EAFNOSUPPORT: ::c_int = 47; +pub const EADDRINUSE: ::c_int = 48; +pub const EADDRNOTAVAIL: ::c_int = 49; +pub const ENOTSOCK: ::c_int = 50; +pub const ENETUNREACH: ::c_int = 51; +pub const ENETRESET: ::c_int = 52; +pub const ECONNABORTED: ::c_int = 53; +pub const ECONNRESET: ::c_int = 54; +pub const ENOBUFS: ::c_int = 55; +pub const EISCONN: ::c_int = 56; +pub const ENOTCONN: ::c_int = 57; +pub const ESHUTDOWN: ::c_int = 58; +pub const ETOOMANYREFS: ::c_int = 59; +pub const ETIMEDOUT: ::c_int = 60; +pub const ECONNREFUSED: ::c_int = 61; +pub const ENETDOWN: ::c_int = 62; +pub const ETXTBSY: ::c_int = 63; +pub const ELOOP: ::c_int = 64; +pub const EHOSTUNREACH: ::c_int = 65; +pub const EINPROGRESS: ::c_int = 68; +pub const EALREADY: ::c_int = 69; +pub const EWOULDBLOCK: ::c_int = 70; +pub const ENOSYS: ::c_int = 71; +pub const EDQUOT: ::c_int = 83; +pub const ESTALE: ::c_int = 88; + +// NFS errnos: Refer to pkgs_v2/storage/fs/nfs/h/nfs/nfsCommon.h +const M_nfsStat: ::c_int = 48 << 16; +enum nfsstat { + NFSERR_REMOTE = 71, + NFSERR_WFLUSH = 99, + NFSERR_BADHANDLE = 10001, + NFSERR_NOT_SYNC = 10002, + NFSERR_BAD_COOKIE = 10003, + NFSERR_TOOSMALL = 10005, + NFSERR_BADTYPE = 10007, + NFSERR_JUKEBOX = 10008, +} + +pub const S_nfsLib_NFS_OK: ::c_int = OK; +pub const S_nfsLib_NFSERR_PERM: ::c_int = EPERM; +pub const S_nfsLib_NFSERR_NOENT: ::c_int = ENOENT; +pub const S_nfsLib_NFSERR_IO: ::c_int = EIO; +pub const S_nfsLib_NFSERR_NXIO: ::c_int = ENXIO; +pub const S_nfsLib_NFSERR_ACCESS: ::c_int = EACCES; +pub const S_nfsLib_NFSERR_EXIST: ::c_int = EEXIST; +pub const S_nfsLib_NFSERR_ENODEV: ::c_int = ENODEV; +pub const S_nfsLib_NFSERR_NOTDIR: ::c_int = ENOTDIR; +pub const S_nfsLib_NFSERR_ISDIR: ::c_int = EISDIR; +pub const S_nfsLib_NFSERR_INVAL: ::c_int = EINVAL; +pub const S_nfsLib_NFSERR_FBIG: ::c_int = EFBIG; +pub const S_nfsLib_NFSERR_NOSPC: ::c_int = ENOSPC; +pub const S_nfsLib_NFSERR_ROFS: ::c_int = EROFS; +pub const S_nfsLib_NFSERR_NAMETOOLONG: ::c_int = ENAMETOOLONG; +pub const S_nfsLib_NFSERR_NOTEMPTY: ::c_int = ENOTEMPTY; +pub const S_nfsLib_NFSERR_DQUOT: ::c_int = EDQUOT; +pub const S_nfsLib_NFSERR_STALE: ::c_int = ESTALE; +pub const S_nfsLib_NFSERR_WFLUSH: ::c_int = M_nfsStat | nfsstat::NFSERR_WFLUSH as ::c_int; +pub const S_nfsLib_NFSERR_REMOTE: ::c_int = M_nfsStat | nfsstat::NFSERR_REMOTE as ::c_int; +pub const S_nfsLib_NFSERR_BADHANDLE: ::c_int = M_nfsStat | nfsstat::NFSERR_BADHANDLE as ::c_int; +pub const S_nfsLib_NFSERR_NOT_SYNC: ::c_int = M_nfsStat | nfsstat::NFSERR_NOT_SYNC as ::c_int; +pub const S_nfsLib_NFSERR_BAD_COOKIE: ::c_int = M_nfsStat | nfsstat::NFSERR_BAD_COOKIE as ::c_int; +pub const S_nfsLib_NFSERR_NOTSUPP: ::c_int = EOPNOTSUPP; +pub const S_nfsLib_NFSERR_TOOSMALL: ::c_int = M_nfsStat | nfsstat::NFSERR_TOOSMALL as ::c_int; +pub const S_nfsLib_NFSERR_SERVERFAULT: ::c_int = EIO; +pub const S_nfsLib_NFSERR_BADTYPE: ::c_int = M_nfsStat | nfsstat::NFSERR_BADTYPE as ::c_int; +pub const S_nfsLib_NFSERR_JUKEBOX: ::c_int = M_nfsStat | nfsstat::NFSERR_JUKEBOX as ::c_int; + +// in.h +pub const IPPROTO_IP: ::c_int = 0; +pub const IPPROTO_IPV6: ::c_int = 41; + +pub const IP_TTL: ::c_int = 4; +pub const IP_MULTICAST_IF: ::c_int = 9; +pub const IP_MULTICAST_TTL: ::c_int = 10; +pub const IP_MULTICAST_LOOP: ::c_int = 11; +pub const IP_ADD_MEMBERSHIP: ::c_int = 12; +pub const IP_DROP_MEMBERSHIP: ::c_int = 13; + +// in6.h +pub const IPV6_V6ONLY: ::c_int = 1; +pub const IPV6_UNICAST_HOPS: ::c_int = 4; +pub const IPV6_MULTICAST_IF: ::c_int = 9; +pub const IPV6_MULTICAST_HOPS: ::c_int = 10; +pub const IPV6_MULTICAST_LOOP: ::c_int = 11; +pub const IPV6_ADD_MEMBERSHIP: ::c_int = 12; +pub const IPV6_DROP_MEMBERSHIP: ::c_int = 13; + +// STAT Stuff +pub const S_IFMT: ::c_int = 0xf000; +pub const S_IFIFO: ::c_int = 0x1000; +pub const S_IFCHR: ::c_int = 0x2000; +pub const S_IFDIR: ::c_int = 0x4000; +pub const S_IFBLK: ::c_int = 0x6000; +pub const S_IFREG: ::c_int = 0x8000; +pub const S_IFLNK: ::c_int = 0xa000; +pub const S_IFSHM: ::c_int = 0xb000; +pub const S_IFSOCK: ::c_int = 0xc000; +pub const S_ISUID: ::c_int = 0x0800; +pub const S_ISGID: ::c_int = 0x0400; +pub const S_ISTXT: ::c_int = 0x0200; +pub const S_IRUSR: ::c_int = 0x0100; +pub const S_IWUSR: ::c_int = 0x0080; +pub const S_IXUSR: ::c_int = 0x0040; +pub const S_IRWXU: ::c_int = 0x01c0; +pub const S_IRGRP: ::c_int = 0x0020; +pub const S_IWGRP: ::c_int = 0x0010; +pub const S_IXGRP: ::c_int = 0x0008; +pub const S_IRWXG: ::c_int = 0x0038; +pub const S_IROTH: ::c_int = 0x0004; +pub const S_IWOTH: ::c_int = 0x0002; +pub const S_IXOTH: ::c_int = 0x0001; +pub const S_IRWXO: ::c_int = 0x0007; + +// socket.h +pub const SOL_SOCKET: ::c_int = 0xffff; + +pub const SO_DEBUG: ::c_int = 0x0001; +pub const SO_REUSEADDR: ::c_int = 0x0004; +pub const SO_KEEPALIVE: ::c_int = 0x0008; +pub const SO_DONTROUTE: ::c_int = 0x0010; +pub const SO_RCVLOWAT: ::c_int = 0x0012; +pub const SO_SNDLOWAT: ::c_int = 0x0013; +pub const SO_SNDTIMEO: ::c_int = 0x1005; +pub const SO_ACCEPTCONN: ::c_int = 0x001e; +pub const SO_BROADCAST: ::c_int = 0x0020; +pub const SO_USELOOPBACK: ::c_int = 0x0040; +pub const SO_LINGER: ::c_int = 0x0080; +pub const SO_REUSEPORT: ::c_int = 0x0200; + +pub const SO_VLAN: ::c_int = 0x8000; + +pub const SO_SNDBUF: ::c_int = 0x1001; +pub const SO_RCVBUF: ::c_int = 0x1002; +pub const SO_RCVTIMEO: ::c_int = 0x1006; +pub const SO_ERROR: ::c_int = 0x1007; +pub const SO_TYPE: ::c_int = 0x1008; +pub const SO_BINDTODEVICE: ::c_int = 0x1010; +pub const SO_OOBINLINE: ::c_int = 0x1011; +pub const SO_CONNTIMEO: ::c_int = 0x100a; + +pub const SOCK_STREAM: ::c_int = 1; +pub const SOCK_DGRAM: ::c_int = 2; +pub const SOCK_RAW: ::c_int = 3; +pub const SOCK_RDM: ::c_int = 4; +pub const SOCK_SEQPACKET: ::c_int = 5; +pub const SOCK_PACKET: ::c_int = 10; + +pub const _SS_MAXSIZE: usize = 128; +pub const _SS_ALIGNSIZE: usize = size_of::(); +pub const _SS_PAD1SIZE: usize = _SS_ALIGNSIZE - size_of::<::c_uchar>() - size_of::<::sa_family_t>(); +pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE + - size_of::<::c_uchar>() + - size_of::<::sa_family_t>() + - _SS_PAD1SIZE + - _SS_ALIGNSIZE; + +pub const MSG_OOB: ::c_int = 0x0001; +pub const MSG_PEEK: ::c_int = 0x0002; +pub const MSG_DONTROUTE: ::c_int = 0x0004; +pub const MSG_EOR: ::c_int = 0x0008; +pub const MSG_TRUNC: ::c_int = 0x0010; +pub const MSG_CTRUNC: ::c_int = 0x0020; +pub const MSG_WAITALL: ::c_int = 0x0040; +pub const MSG_DONTWAIT: ::c_int = 0x0080; +pub const MSG_EOF: ::c_int = 0x0100; +pub const MSG_EXP: ::c_int = 0x0200; +pub const MSG_MBUF: ::c_int = 0x0400; +pub const MSG_NOTIFICATION: ::c_int = 0x0800; +pub const MSG_COMPAT: ::c_int = 0x8000; + +pub const AF_UNSPEC: ::c_int = 0; +pub const AF_LOCAL: ::c_int = 1; +pub const AF_UNIX: ::c_int = AF_LOCAL; +pub const AF_INET: ::c_int = 2; +pub const AF_NETLINK: ::c_int = 16; +pub const AF_ROUTE: ::c_int = 17; +pub const AF_LINK: ::c_int = 18; +pub const AF_PACKET: ::c_int = 19; +pub const pseudo_AF_KEY: ::c_int = 27; +pub const AF_KEY: ::c_int = pseudo_AF_KEY; +pub const AF_INET6: ::c_int = 28; +pub const AF_SOCKDEV: ::c_int = 31; +pub const AF_TIPC: ::c_int = 33; +pub const AF_MIPC: ::c_int = 34; +pub const AF_MIPC_SAFE: ::c_int = 35; +pub const AF_MAX: ::c_int = 37; + +pub const SHUT_RD: ::c_int = 0; +pub const SHUT_WR: ::c_int = 1; +pub const SHUT_RDWR: ::c_int = 2; + +pub const IPPROTO_TCP: ::c_int = 6; +pub const TCP_NODELAY: ::c_int = 1; +pub const TCP_MAXSEG: ::c_int = 2; +pub const TCP_NOPUSH: ::c_int = 3; +pub const TCP_KEEPIDLE: ::c_int = 4; +pub const TCP_KEEPINTVL: ::c_int = 5; +pub const TCP_KEEPCNT: ::c_int = 6; + +// ioLib.h +pub const FIONREAD: ::c_int = 0x40040001; +pub const FIOFLUSH: ::c_int = 2; +pub const FIOOPTIONS: ::c_int = 3; +pub const FIOBAUDRATE: ::c_int = 4; +pub const FIODISKFORMAT: ::c_int = 5; +pub const FIODISKINIT: ::c_int = 6; +pub const FIOSEEK: ::c_int = 7; +pub const FIOWHERE: ::c_int = 8; +pub const FIODIRENTRY: ::c_int = 9; +pub const FIORENAME: ::c_int = 10; +pub const FIOREADYCHANGE: ::c_int = 11; +pub const FIODISKCHANGE: ::c_int = 13; +pub const FIOCANCEL: ::c_int = 14; +pub const FIOSQUEEZE: ::c_int = 15; +pub const FIOGETNAME: ::c_int = 18; +pub const FIONBIO: ::c_int = 0x90040010; + +// limits.h +pub const PATH_MAX: ::c_int = _PARM_PATH_MAX; +pub const _POSIX_PATH_MAX: ::c_int = 256; + +// Some poll stuff +pub const POLLIN: ::c_short = 0x0001; +pub const POLLPRI: ::c_short = 0x0002; +pub const POLLOUT: ::c_short = 0x0004; +pub const POLLRDNORM: ::c_short = 0x0040; +pub const POLLWRNORM: ::c_short = POLLOUT; +pub const POLLRDBAND: ::c_short = 0x0080; +pub const POLLWRBAND: ::c_short = 0x0100; +pub const POLLERR: ::c_short = 0x0008; +pub const POLLHUP: ::c_short = 0x0010; +pub const POLLNVAL: ::c_short = 0x0020; + +// fnctlcom.h +pub const FD_CLOEXEC: ::c_int = 1; +pub const F_DUPFD: ::c_int = 0; +pub const F_GETFD: ::c_int = 1; +pub const F_SETFD: ::c_int = 2; +pub const F_GETFL: ::c_int = 3; +pub const F_SETFL: ::c_int = 4; +pub const F_GETOWN: ::c_int = 5; +pub const F_SETOWN: ::c_int = 6; +pub const F_GETLK: ::c_int = 7; +pub const F_SETLK: ::c_int = 8; +pub const F_SETLKW: ::c_int = 9; +pub const F_DUPFD_CLOEXEC: ::c_int = 14; + +// signal.h +pub const SIG_DFL: sighandler_t = 0 as sighandler_t; +pub const SIG_IGN: sighandler_t = 1 as sighandler_t; +pub const SIG_ERR: sighandler_t = -1 as isize as sighandler_t; + +pub const SIGHUP: ::c_int = 1; +pub const SIGINT: ::c_int = 2; +pub const SIGQUIT: ::c_int = 3; +pub const SIGILL: ::c_int = 4; +pub const SIGTRAP: ::c_int = 5; +pub const SIGABRT: ::c_int = 6; +pub const SIGEMT: ::c_int = 7; +pub const SIGFPE: ::c_int = 8; +pub const SIGKILL: ::c_int = 9; +pub const SIGBUS: ::c_int = 10; +pub const SIGSEGV: ::c_int = 11; +pub const SIGFMT: ::c_int = 12; +pub const SIGPIPE: ::c_int = 13; +pub const SIGALRM: ::c_int = 14; +pub const SIGTERM: ::c_int = 15; +pub const SIGCNCL: ::c_int = 16; +pub const SIGSTOP: ::c_int = 17; +pub const SIGTSTP: ::c_int = 18; +pub const SIGCONT: ::c_int = 19; +pub const SIGCHLD: ::c_int = 20; +pub const SIGTTIN: ::c_int = 21; +pub const SIGTTOU: ::c_int = 22; + +pub const SIG_BLOCK: ::c_int = 1; +pub const SIG_UNBLOCK: ::c_int = 2; +pub const SIG_SETMASK: ::c_int = 3; + +pub const SI_SYNC: ::c_int = 0; +pub const SI_USER: ::c_int = -1; +pub const SI_QUEUE: ::c_int = -2; +pub const SI_TIMER: ::c_int = -3; +pub const SI_ASYNCIO: ::c_int = -4; +pub const SI_MESGQ: ::c_int = -5; +pub const SI_CHILD: ::c_int = -6; +pub const SI_KILL: ::c_int = SI_USER; + +// vxParams.h definitions +pub const _PARM_NAME_MAX: ::c_int = 255; +pub const _PARM_PATH_MAX: ::c_int = 1024; + +// WAIT STUFF +pub const WNOHANG: ::c_int = 0x01; +pub const WUNTRACED: ::c_int = 0x02; + +const PTHREAD_MUTEXATTR_INITIALIZER: pthread_mutexattr_t = pthread_mutexattr_t { + mutexAttrStatus: PTHREAD_INITIALIZED_OBJ, + mutexAttrProtocol: PTHREAD_PRIO_NONE, + mutexAttrPrioceiling: 0, + mutexAttrType: PTHREAD_MUTEX_DEFAULT, + mutexAttrPshared: 1, +}; +pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { + mutexSemId: null_mut(), + mutexValid: PTHREAD_VALID_OBJ, + mutexInitted: PTHREAD_UNUSED_YET_OBJ, + mutexCondRefCount: 0, + mutexSavPriority: -1, + mutexAttr: PTHREAD_MUTEXATTR_INITIALIZER, + mutexSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX], +}; + +const PTHREAD_CONDATTR_INITIALIZER: pthread_condattr_t = pthread_condattr_t { + condAttrStatus: 0xf70990ef, + condAttrPshared: 1, + condAttrClockId: CLOCK_REALTIME, +}; +pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { + condSemId: null_mut(), + condValid: PTHREAD_VALID_OBJ, + condInitted: PTHREAD_UNUSED_YET_OBJ, + condRefCount: 0, + condMutex: null_mut(), + condAttr: PTHREAD_CONDATTR_INITIALIZER, + condSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX], +}; + +const PTHREAD_RWLOCKATTR_INITIALIZER: pthread_rwlockattr_t = pthread_rwlockattr_t { + rwlockAttrStatus: PTHREAD_INITIALIZED_OBJ, + rwlockAttrPshared: 1, + rwlockAttrMaxReaders: 0, + rwlockAttrConformOpt: 1, +}; +pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { + rwlockSemId: null_mut(), + rwlockReadersRefCount: 0, + rwlockValid: PTHREAD_VALID_OBJ, + rwlockInitted: PTHREAD_UNUSED_YET_OBJ, + rwlockAttr: PTHREAD_RWLOCKATTR_INITIALIZER, + rwlockSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX], +}; + +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; + +// rtpLibCommon.h +pub const VX_RTP_NAME_LENGTH: ::c_int = 255; +pub const RTP_ID_ERROR: ::RTP_ID = -1; + +// h/public/unistd.h +pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 21; // Via unistd.h +pub const _SC_PAGESIZE: ::c_int = 39; +pub const O_ACCMODE: ::c_int = 3; +pub const O_CLOEXEC: ::c_int = 0x100000; // fcntlcom +pub const O_EXCL: ::c_int = 0x0800; +pub const O_CREAT: ::c_int = 0x0200; +pub const O_TRUNC: ::c_int = 0x0400; +pub const O_APPEND: ::c_int = 0x0008; +pub const O_RDWR: ::c_int = 0x0002; +pub const O_WRONLY: ::c_int = 0x0001; +pub const O_RDONLY: ::c_int = 0; +pub const O_NONBLOCK: ::c_int = 0x4000; + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum FILE {} +impl ::Copy for FILE {} +impl ::Clone for FILE { + fn clone(&self) -> FILE { + *self + } +} +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum fpos_t {} // FIXME: fill this out with a struct +impl ::Copy for fpos_t {} +impl ::Clone for fpos_t { + fn clone(&self) -> fpos_t { + *self + } +} + +f! { + pub {const} fn CMSG_ALIGN(len: usize) -> usize { + len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) + } + + pub fn CMSG_NXTHDR(mhdr: *const msghdr, + cmsg: *const cmsghdr) -> *mut cmsghdr { + let next = cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize) + + CMSG_ALIGN(::mem::size_of::<::cmsghdr>()); + let max = (*mhdr).msg_control as usize + + (*mhdr).msg_controllen as usize; + if next <= max { + (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) + as *mut ::cmsghdr + } else { + 0 as *mut ::cmsghdr + } + } + + pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { + if (*mhdr).msg_controllen as usize > 0 { + (*mhdr).msg_control as *mut cmsghdr + } else { + 0 as *mut cmsghdr + } + } + + pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut ::c_uchar { + (cmsg as *mut ::c_uchar) + .offset(CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize) + } + + pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint { + (CMSG_ALIGN(length as usize) + CMSG_ALIGN(::mem::size_of::())) + as ::c_uint + } + + pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint { + CMSG_ALIGN(::mem::size_of::()) as ::c_uint + length + } +} + +extern "C" { + pub fn isalnum(c: c_int) -> c_int; + pub fn isalpha(c: c_int) -> c_int; + pub fn iscntrl(c: c_int) -> c_int; + pub fn isdigit(c: c_int) -> c_int; + pub fn isgraph(c: c_int) -> c_int; + pub fn islower(c: c_int) -> c_int; + pub fn isprint(c: c_int) -> c_int; + pub fn ispunct(c: c_int) -> c_int; + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; + pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; + pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; + pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE; + pub fn fflush(file: *mut FILE) -> c_int; + pub fn fclose(file: *mut FILE) -> c_int; + pub fn remove(filename: *const c_char) -> c_int; + pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; + pub fn tmpfile() -> *mut FILE; + pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int; + pub fn setbuf(stream: *mut FILE, buf: *mut c_char); + pub fn getchar() -> c_int; + pub fn putchar(c: c_int) -> c_int; + pub fn fgetc(stream: *mut FILE) -> c_int; + pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; + pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; + pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; + pub fn puts(s: *const c_char) -> c_int; + pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; + pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; + pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; + pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; + pub fn ftell(stream: *mut FILE) -> c_long; + pub fn rewind(stream: *mut FILE); + pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; + pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; + pub fn feof(stream: *mut FILE) -> c_int; + pub fn ferror(stream: *mut FILE) -> c_int; + pub fn perror(s: *const c_char); + pub fn atoi(s: *const c_char) -> c_int; + pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; + pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float; + pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long; + pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong; + pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; + pub fn malloc(size: size_t) -> *mut c_void; + pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; + pub fn free(p: *mut c_void); + pub fn abort() -> !; + pub fn exit(status: c_int) -> !; + pub fn atexit(cb: extern "C" fn()) -> c_int; + pub fn system(s: *const c_char) -> c_int; + pub fn getenv(s: *const c_char) -> *mut c_char; + + pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; + pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; + pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; + pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; + pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; + pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; + pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; + pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strdup(cs: *const c_char) -> *mut c_char; + pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; + pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int; + pub fn strlen(cs: *const c_char) -> size_t; + pub fn strerror(n: c_int) -> *mut c_char; + pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; + pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; + pub fn wcslen(buf: *const wchar_t) -> size_t; + pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t; + + pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; + pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; + pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; + pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; + pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; + pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; +} + +extern "C" { + pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int; + pub fn printf(format: *const ::c_char, ...) -> ::c_int; + pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int; + pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int; + pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int; + pub fn scanf(format: *const ::c_char, ...) -> ::c_int; + pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int; + pub fn getchar_unlocked() -> ::c_int; + pub fn putchar_unlocked(c: ::c_int) -> ::c_int; + pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int; + pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE; + pub fn fileno(stream: *mut ::FILE) -> ::c_int; + pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int; + pub fn rewinddir(dirp: *mut ::DIR); + pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int; + pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int; + pub fn alarm(seconds: ::c_uint) -> ::c_uint; + pub fn fchdir(dirfd: ::c_int) -> ::c_int; + pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; + pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long; + pub fn getegid() -> gid_t; + pub fn geteuid() -> uid_t; + pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int; + pub fn getlogin() -> *mut c_char; + pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int; + pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long; + pub fn pause() -> ::c_int; + pub fn seteuid(uid: uid_t) -> ::c_int; + pub fn setegid(gid: gid_t) -> ::c_int; + pub fn sleep(secs: ::c_uint) -> ::c_uint; + pub fn ttyname(fd: ::c_int) -> *mut c_char; + pub fn wait(status: *mut ::c_int) -> pid_t; + pub fn umask(mask: mode_t) -> mode_t; + pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int; + pub fn mlockall(flags: ::c_int) -> ::c_int; + pub fn munlockall() -> ::c_int; + + pub fn mmap( + addr: *mut ::c_void, + len: ::size_t, + prot: ::c_int, + flags: ::c_int, + fd: ::c_int, + offset: off_t, + ) -> *mut ::c_void; + pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int; + pub fn truncate(path: *const c_char, length: off_t) -> ::c_int; + + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn pthread_exit(value: *mut ::c_void) -> !; + pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int; + + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + + pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int; + + pub fn sigaction(signum: ::c_int, act: *const sigaction, oldact: *mut sigaction) -> ::c_int; + + pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int; + + #[link_name = "_rtld_dlopen"] + pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void; + + #[link_name = "_rtld_dlerror"] + pub fn dlerror() -> *mut ::c_char; + + #[link_name = "_rtld_dlsym"] + pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void; + + #[link_name = "_rtld_dlclose"] + pub fn dlclose(handle: *mut ::c_void) -> ::c_int; + + #[link_name = "_rtld_dladdr"] + pub fn dladdr(addr: *mut ::c_void, info: *mut Dl_info) -> ::c_int; + + // time.h + pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; + pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; + pub fn mktime(tm: *mut tm) -> time_t; + pub fn time(time: *mut time_t) -> time_t; + pub fn gmtime(time_p: *const time_t) -> *mut tm; + pub fn localtime(time_p: *const time_t) -> *mut tm; + pub fn timegm(tm: *mut tm) -> time_t; + pub fn difftime(time1: time_t, time0: time_t) -> ::c_double; + pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn usleep(secs: ::useconds_t) -> ::c_int; + pub fn putenv(string: *mut c_char) -> ::c_int; + pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char; + + pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int; + pub fn sigpending(set: *mut sigset_t) -> ::c_int; + + pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int; + + pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int; + pub fn ftello(stream: *mut ::FILE) -> ::off_t; + pub fn mkstemp(template: *mut ::c_char) -> ::c_int; + + pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char; + + pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int); + pub fn closelog(); + pub fn setlogmask(maskpri: ::c_int) -> ::c_int; + pub fn syslog(priority: ::c_int, message: *const ::c_char, ...); + pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t; + +} + +extern "C" { + // stdlib.h + pub fn memalign(block_size: ::size_t, size_arg: ::size_t) -> *mut ::c_void; + + // ioLib.h + pub fn getcwd(buf: *mut ::c_char, size: ::size_t) -> *mut ::c_char; + + // ioLib.h + pub fn chdir(attr: *const ::c_char) -> ::c_int; + + // pthread.h + pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int; + + // pthread.h + pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int; + + // pthread.h + pub fn pthread_mutexattr_settype(pAttr: *mut ::pthread_mutexattr_t, pType: ::c_int) -> ::c_int; + + // pthread.h + pub fn pthread_mutex_init( + mutex: *mut pthread_mutex_t, + attr: *const pthread_mutexattr_t, + ) -> ::c_int; + + // pthread.h + pub fn pthread_mutex_destroy(mutex: *mut pthread_mutex_t) -> ::c_int; + + // pthread.h + pub fn pthread_mutex_lock(mutex: *mut pthread_mutex_t) -> ::c_int; + + // pthread.h + pub fn pthread_mutex_trylock(mutex: *mut pthread_mutex_t) -> ::c_int; + + // pthread.h + pub fn pthread_mutex_timedlock(attr: *mut pthread_mutex_t, spec: *const timespec) -> ::c_int; + + // pthread.h + pub fn pthread_mutex_unlock(mutex: *mut pthread_mutex_t) -> ::c_int; + + // pthread.h + pub fn pthread_attr_setname(pAttr: *mut ::pthread_attr_t, name: *mut ::c_char) -> ::c_int; + + // pthread.h + pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stacksize: ::size_t) -> ::c_int; + + // pthread.h + pub fn pthread_attr_getstacksize(attr: *const ::pthread_attr_t, size: *mut ::size_t) + -> ::c_int; + + // pthread.h + pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int; + + // pthread.h + pub fn pthread_create( + pThread: *mut ::pthread_t, + pAttr: *const ::pthread_attr_t, + start_routine: extern "C" fn(*mut ::c_void) -> *mut ::c_void, + value: *mut ::c_void, + ) -> ::c_int; + + // pthread.h + pub fn pthread_attr_destroy(thread: *mut ::pthread_attr_t) -> ::c_int; + + // pthread.h + pub fn pthread_detach(thread: ::pthread_t) -> ::c_int; + + // int pthread_atfork (void (*)(void), void (*)(void), void (*)(void)); + pub fn pthread_atfork( + prepare: ::Option, + parent: ::Option, + child: ::Option, + ) -> ::c_int; + // stat.h + pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int; + + // stat.h + pub fn lstat(path: *const ::c_char, buf: *mut stat) -> ::c_int; + + // unistd.h + pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int; + + // dirent.h + pub fn readdir_r(pDir: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent) + -> ::c_int; + + // dirent.h + pub fn readdir(pDir: *mut ::DIR) -> *mut ::dirent; + + // fcntl.h or + // ioLib.h + pub fn open(path: *const ::c_char, oflag: ::c_int, ...) -> ::c_int; + + // poll.h + pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int; + + // pthread.h + pub fn pthread_condattr_init(attr: *mut ::pthread_condattr_t) -> ::c_int; + + // pthread.h + pub fn pthread_condattr_destroy(attr: *mut ::pthread_condattr_t) -> ::c_int; + + // pthread.h + pub fn pthread_condattr_getclock( + pAttr: *const ::pthread_condattr_t, + pClockId: *mut ::clockid_t, + ) -> ::c_int; + + // pthread.h + pub fn pthread_condattr_setclock( + pAttr: *mut ::pthread_condattr_t, + clockId: ::clockid_t, + ) -> ::c_int; + + // pthread.h + pub fn pthread_cond_init( + cond: *mut ::pthread_cond_t, + attr: *const ::pthread_condattr_t, + ) -> ::c_int; + + // pthread.h + pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int; + + // pthread.h + pub fn pthread_cond_signal(cond: *mut ::pthread_cond_t) -> ::c_int; + + // pthread.h + pub fn pthread_cond_broadcast(cond: *mut ::pthread_cond_t) -> ::c_int; + + // pthread.h + pub fn pthread_cond_wait(cond: *mut ::pthread_cond_t, mutex: *mut ::pthread_mutex_t) + -> ::c_int; + + // pthread.h + pub fn pthread_rwlockattr_init(attr: *mut ::pthread_rwlockattr_t) -> ::c_int; + + // pthread.h + pub fn pthread_rwlockattr_destroy(attr: *mut ::pthread_rwlockattr_t) -> ::c_int; + + // pthread.h + pub fn pthread_rwlockattr_setmaxreaders( + attr: *mut ::pthread_rwlockattr_t, + attr2: ::c_uint, + ) -> ::c_int; + + // pthread.h + pub fn pthread_rwlock_init( + attr: *mut ::pthread_rwlock_t, + host: *const ::pthread_rwlockattr_t, + ) -> ::c_int; + + // pthread.h + pub fn pthread_rwlock_destroy(attr: *mut ::pthread_rwlock_t) -> ::c_int; + + // pthread.h + pub fn pthread_rwlock_rdlock(attr: *mut ::pthread_rwlock_t) -> ::c_int; + + // pthread.h + pub fn pthread_rwlock_tryrdlock(attr: *mut ::pthread_rwlock_t) -> ::c_int; + + // pthread.h + pub fn pthread_rwlock_timedrdlock( + attr: *mut ::pthread_rwlock_t, + host: *const ::timespec, + ) -> ::c_int; + + // pthread.h + pub fn pthread_rwlock_wrlock(attr: *mut ::pthread_rwlock_t) -> ::c_int; + + // pthread.h + pub fn pthread_rwlock_trywrlock(attr: *mut ::pthread_rwlock_t) -> ::c_int; + + // pthread.h + pub fn pthread_rwlock_timedwrlock( + attr: *mut ::pthread_rwlock_t, + host: *const ::timespec, + ) -> ::c_int; + + // pthread.h + pub fn pthread_rwlock_unlock(attr: *mut ::pthread_rwlock_t) -> ::c_int; + + // pthread.h + pub fn pthread_key_create( + key: *mut ::pthread_key_t, + dtor: ::Option, + ) -> ::c_int; + + // pthread.h + pub fn pthread_key_delete(key: ::pthread_key_t) -> ::c_int; + + // pthread.h + pub fn pthread_setspecific(key: ::pthread_key_t, value: *const ::c_void) -> ::c_int; + + // pthread.h + pub fn pthread_getspecific(key: ::pthread_key_t) -> *mut ::c_void; + + // pthread.h + pub fn pthread_cond_timedwait( + cond: *mut ::pthread_cond_t, + mutex: *mut ::pthread_mutex_t, + abstime: *const ::timespec, + ) -> ::c_int; + + // pthread.h + pub fn pthread_attr_getname(attr: *mut ::pthread_attr_t, name: *mut *mut ::c_char) -> ::c_int; + + // pthread.h + pub fn pthread_join(thread: ::pthread_t, status: *mut *mut ::c_void) -> ::c_int; + + // pthread.h + pub fn pthread_self() -> ::pthread_t; + + // clockLib.h + pub fn clock_gettime(clock_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int; + + // clockLib.h + pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int; + + // clockLib.h + pub fn clock_getres(clock_id: ::clockid_t, res: *mut ::timespec) -> ::c_int; + + // clockLib.h + pub fn clock_nanosleep( + clock_id: ::clockid_t, + flags: ::c_int, + rqtp: *const ::timespec, + rmtp: *mut ::timespec, + ) -> ::c_int; + + // timerLib.h + pub fn nanosleep(rqtp: *const ::timespec, rmtp: *mut ::timespec) -> ::c_int; + + // socket.h + pub fn accept(s: ::c_int, addr: *mut ::sockaddr, addrlen: *mut ::socklen_t) -> ::c_int; + + // socket.h + pub fn bind(fd: ::c_int, addr: *const sockaddr, len: socklen_t) -> ::c_int; + + // socket.h + pub fn connect(s: ::c_int, name: *const ::sockaddr, namelen: ::socklen_t) -> ::c_int; + + // socket.h + pub fn getpeername(s: ::c_int, name: *mut ::sockaddr, namelen: *mut ::socklen_t) -> ::c_int; + + // socket.h + pub fn getsockname( + socket: ::c_int, + address: *mut sockaddr, + address_len: *mut socklen_t, + ) -> ::c_int; + + // socket.h + pub fn getsockopt( + sockfd: ::c_int, + level: ::c_int, + optname: ::c_int, + optval: *mut ::c_void, + optlen: *mut ::socklen_t, + ) -> ::c_int; + + // socket.h + pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int; + + // socket.h + pub fn recv(s: ::c_int, buf: *mut ::c_void, bufLen: ::size_t, flags: ::c_int) -> ::ssize_t; + + // socket.h + pub fn recvfrom( + s: ::c_int, + buf: *mut ::c_void, + bufLen: ::size_t, + flags: ::c_int, + from: *mut ::sockaddr, + pFromLen: *mut ::socklen_t, + ) -> ::ssize_t; + + pub fn recvmsg(socket: ::c_int, mp: *mut ::msghdr, flags: ::c_int) -> ::ssize_t; + + // socket.h + pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t; + + pub fn sendmsg(socket: ::c_int, mp: *const ::msghdr, flags: ::c_int) -> ::ssize_t; + + // socket.h + pub fn sendto( + socket: ::c_int, + buf: *const ::c_void, + len: ::size_t, + flags: ::c_int, + addr: *const sockaddr, + addrlen: socklen_t, + ) -> ::ssize_t; + + // socket.h + pub fn setsockopt( + socket: ::c_int, + level: ::c_int, + name: ::c_int, + value: *const ::c_void, + option_len: socklen_t, + ) -> ::c_int; + + // socket.h + pub fn shutdown(s: ::c_int, how: ::c_int) -> ::c_int; + + // socket.h + pub fn socket(domain: ::c_int, _type: ::c_int, protocol: ::c_int) -> ::c_int; + + // icotl.h + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + + // fcntl.h + pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int; + + // ntp_rfc2553.h for kernel + // netdb.h for user + pub fn gai_strerror(errcode: ::c_int) -> *mut ::c_char; + + // ioLib.h or + // unistd.h + pub fn close(fd: ::c_int) -> ::c_int; + + // ioLib.h or + // unistd.h + pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t; + + // ioLib.h or + // unistd.h + pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t; + + // ioLib.h or + // unistd.h + pub fn isatty(fd: ::c_int) -> ::c_int; + + // ioLib.h or + // unistd.h + pub fn dup(src: ::c_int) -> ::c_int; + + // ioLib.h or + // unistd.h + pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int; + + // ioLib.h or + // unistd.h + pub fn pipe(fds: *mut ::c_int) -> ::c_int; + + // ioLib.h or + // unistd.h + pub fn unlink(pathname: *const ::c_char) -> ::c_int; + + // unistd.h and + // ioLib.h + pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t; + + // netdb.h + pub fn getaddrinfo( + node: *const ::c_char, + service: *const ::c_char, + hints: *const addrinfo, + res: *mut *mut addrinfo, + ) -> ::c_int; + + // netdb.h + pub fn freeaddrinfo(res: *mut addrinfo); + + // signal.h + pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t; + + // unistd.h + pub fn getpid() -> pid_t; + + // unistd.h + pub fn getppid() -> pid_t; + + // wait.h + pub fn waitpid(pid: pid_t, status: *mut ::c_int, optons: ::c_int) -> pid_t; + + // unistd.h + pub fn sysconf(attr: ::c_int) -> ::c_long; + + // stdlib.h + pub fn setenv( + // setenv.c + envVarName: *const ::c_char, + envVarValue: *const ::c_char, + overwrite: ::c_int, + ) -> ::c_int; + + // stdlib.h + pub fn unsetenv( + // setenv.c + envVarName: *const ::c_char, + ) -> ::c_int; + + // stdlib.h + pub fn realpath(fileName: *const ::c_char, resolvedName: *mut ::c_char) -> *mut ::c_char; + + // unistd.h + pub fn link(src: *const ::c_char, dst: *const ::c_char) -> ::c_int; + + // unistd.h + pub fn readlink(path: *const ::c_char, buf: *mut ::c_char, bufsize: ::size_t) -> ::ssize_t; + + // unistd.h + pub fn symlink(path1: *const ::c_char, path2: *const ::c_char) -> ::c_int; + + // dirent.h + pub fn opendir(name: *const ::c_char) -> *mut ::DIR; + + // unistd.h + pub fn rmdir(path: *const ::c_char) -> ::c_int; + + // stat.h + pub fn mkdir(dirName: *const ::c_char, mode: ::mode_t) -> ::c_int; + + // stat.h + pub fn chmod(path: *const ::c_char, mode: ::mode_t) -> ::c_int; + + // stat.h + pub fn fchmod(attr1: ::c_int, attr2: ::mode_t) -> ::c_int; + + // unistd.h + pub fn fsync(fd: ::c_int) -> ::c_int; + + // dirent.h + pub fn closedir(ptr: *mut ::DIR) -> ::c_int; + + // sched.h + pub fn sched_yield() -> ::c_int; + + // errnoLib.h + pub fn errnoSet(err: ::c_int) -> ::c_int; + + // errnoLib.h + pub fn errnoGet() -> ::c_int; + + // unistd.h + pub fn _exit(status: ::c_int) -> !; + + // unistd.h + pub fn setgid(gid: ::gid_t) -> ::c_int; + + // unistd.h + pub fn getgid() -> ::gid_t; + + // unistd.h + pub fn setuid(uid: ::uid_t) -> ::c_int; + + // unistd.h + pub fn getuid() -> ::uid_t; + + // signal.h + pub fn sigemptyset(__set: *mut sigset_t) -> ::c_int; + + // pthread.h for kernel + // signal.h for user + pub fn pthread_sigmask( + __how: ::c_int, + __set: *const sigset_t, + __oset: *mut sigset_t, + ) -> ::c_int; + + // signal.h for user + pub fn kill(__pid: pid_t, __signo: ::c_int) -> ::c_int; + + // signal.h for user + pub fn sigqueue(__pid: pid_t, __signo: ::c_int, __value: ::sigval) -> ::c_int; + + // signal.h for user + pub fn _sigqueue( + rtpId: ::RTP_ID, + signo: ::c_int, + pValue: *const ::sigval, + sigCode: ::c_int, + ) -> ::c_int; + + // signal.h + pub fn taskKill(taskId: ::TASK_ID, signo: ::c_int) -> ::c_int; + + // signal.h + pub fn raise(__signo: ::c_int) -> ::c_int; + + // taskLibCommon.h + pub fn taskIdSelf() -> ::TASK_ID; + pub fn taskDelay(ticks: ::_Vx_ticks_t) -> ::c_int; + + // rtpLibCommon.h + pub fn rtpInfoGet(rtpId: ::RTP_ID, rtpStruct: *mut ::RTP_DESC) -> ::c_int; + pub fn rtpSpawn( + pubrtpFileName: *const ::c_char, + argv: *mut *const ::c_char, + envp: *mut *const ::c_char, + priority: ::c_int, + uStackSize: ::size_t, + options: ::c_int, + taskOptions: ::c_int, + ) -> RTP_ID; + + // ioLib.h + pub fn _realpath(fileName: *const ::c_char, resolvedName: *mut ::c_char) -> *mut ::c_char; + + // pathLib.h + pub fn _pathIsAbsolute(filepath: *const ::c_char, pNameTail: *mut *const ::c_char) -> BOOL; + + pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + + // randomNumGen.h + pub fn randBytes(buf: *mut c_uchar, length: c_int) -> c_int; + pub fn randABytes(buf: *mut c_uchar, length: c_int) -> c_int; + pub fn randUBytes(buf: *mut c_uchar, length: c_int) -> c_int; + pub fn randSecure() -> c_int; + + // mqueue.h + pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t; + pub fn mq_close(mqd: ::mqd_t) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; + pub fn mq_receive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + ) -> ::ssize_t; + pub fn mq_timedreceive( + mqd: ::mqd_t, + msg_ptr: *mut ::c_char, + msg_len: ::size_t, + msg_prio: *mut ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::ssize_t; + pub fn mq_send( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + ) -> ::c_int; + pub fn mq_timedsend( + mqd: ::mqd_t, + msg_ptr: *const ::c_char, + msg_len: ::size_t, + msg_prio: ::c_uint, + abs_timeout: *const ::timespec, + ) -> ::c_int; + pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int; + pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int; +} + +//Dummy functions, these don't really exist in VxWorks. + +// wait.h macros +safe_f! { + pub {const} fn WIFEXITED(status: ::c_int) -> bool { + (status & 0xFF00) == 0 + } + pub {const} fn WIFSIGNALED(status: ::c_int) -> bool { + (status & 0xFF00) != 0 + } + pub {const} fn WIFSTOPPED(status: ::c_int) -> bool { + (status & 0xFF0000) != 0 + } + pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int { + status & 0xFF + } + pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int { + (status >> 8) & 0xFF + } + pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int { + (status >> 16) & 0xFF + } +} + +pub fn pread(_fd: ::c_int, _buf: *mut ::c_void, _count: ::size_t, _offset: off64_t) -> ::ssize_t { + -1 +} + +pub fn pwrite( + _fd: ::c_int, + _buf: *const ::c_void, + _count: ::size_t, + _offset: off64_t, +) -> ::ssize_t { + -1 +} +pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int { + // check to see if align is a power of 2 and if align is a multiple + // of sizeof(void *) + if (align & align - 1 != 0) || (align as usize % size_of::<::size_t>() != 0) { + return ::EINVAL; + } + + unsafe { + // posix_memalign should not set errno + let e = ::errnoGet(); + + let temp = memalign(align, size); + ::errnoSet(e as ::c_int); + + if temp.is_null() { + ::ENOMEM + } else { + *memptr = temp; + 0 + } + } +} + +cfg_if! { + if #[cfg(libc_core_cvoid)] { + pub use ::ffi::c_void; + } else { + // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help + // enable more optimization opportunities around it recognizing things + // like malloc/free. + #[repr(u8)] + #[allow(missing_copy_implementations)] + #[allow(missing_debug_implementations)] + pub enum c_void { + // Two dummy variants so the #[repr] attribute can be used. + #[doc(hidden)] + __variant1, + #[doc(hidden)] + __variant2, + } + } +} + +cfg_if! { + if #[cfg(target_arch = "aarch64")] { + mod aarch64; + pub use self::aarch64::*; + } else if #[cfg(any(target_arch = "arm"))] { + mod arm; + pub use self::arm::*; + } else if #[cfg(any(target_arch = "x86"))] { + mod x86; + pub use self::x86::*; + } else if #[cfg(any(target_arch = "x86_64"))] { + mod x86_64; + pub use self::x86_64::*; + } else if #[cfg(any(target_arch = "powerpc"))] { + mod powerpc; + pub use self::powerpc::*; + } else if #[cfg(any(target_arch = "powerpc64"))] { + mod powerpc64; + pub use self::powerpc64::*; + } else { + // Unknown target_arch + } +} diff --git a/bash-5.1/vendor/libc/src/vxworks/powerpc.rs b/bash-5.1/vendor/libc/src/vxworks/powerpc.rs new file mode 100644 index 0000000000000000000000000000000000000000..55240068aa08eb7992d9adc49739f44679207b8b --- /dev/null +++ b/bash-5.1/vendor/libc/src/vxworks/powerpc.rs @@ -0,0 +1,4 @@ +pub type c_char = u8; +pub type wchar_t = u32; +pub type c_long = i32; +pub type c_ulong = u32; diff --git a/bash-5.1/vendor/libc/src/vxworks/powerpc64.rs b/bash-5.1/vendor/libc/src/vxworks/powerpc64.rs new file mode 100644 index 0000000000000000000000000000000000000000..4032488b6c0d5b1128fad52fabe5faaf80add3c4 --- /dev/null +++ b/bash-5.1/vendor/libc/src/vxworks/powerpc64.rs @@ -0,0 +1,4 @@ +pub type c_char = u8; +pub type wchar_t = u32; +pub type c_long = i64; +pub type c_ulong = u64; diff --git a/bash-5.1/vendor/libc/src/vxworks/x86.rs b/bash-5.1/vendor/libc/src/vxworks/x86.rs new file mode 100644 index 0000000000000000000000000000000000000000..e617bb83c6ce342761d36dade9d591486f264521 --- /dev/null +++ b/bash-5.1/vendor/libc/src/vxworks/x86.rs @@ -0,0 +1,4 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type c_long = i32; +pub type c_ulong = u32; diff --git a/bash-5.1/vendor/libc/src/vxworks/x86_64.rs b/bash-5.1/vendor/libc/src/vxworks/x86_64.rs new file mode 100644 index 0000000000000000000000000000000000000000..5e95ea2567ddfe80fd88feb2aaecf70697f06d99 --- /dev/null +++ b/bash-5.1/vendor/libc/src/vxworks/x86_64.rs @@ -0,0 +1,4 @@ +pub type c_char = i8; +pub type wchar_t = i32; +pub type c_long = i64; +pub type c_ulong = u64; diff --git a/bash-5.1/vendor/libc/src/wasi.rs b/bash-5.1/vendor/libc/src/wasi.rs new file mode 100644 index 0000000000000000000000000000000000000000..ef88fac75dcac04a57af7367b4b0b70ede1684fc --- /dev/null +++ b/bash-5.1/vendor/libc/src/wasi.rs @@ -0,0 +1,822 @@ +use super::{Send, Sync}; + +pub use ffi::c_void; + +pub type c_char = i8; +pub type c_uchar = u8; +pub type c_schar = i8; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_long = i32; +pub type c_ulong = u32; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; +pub type size_t = usize; +pub type ssize_t = isize; +pub type ptrdiff_t = isize; +pub type intptr_t = isize; +pub type uintptr_t = usize; +pub type off_t = i64; +pub type pid_t = i32; +pub type clock_t = c_longlong; +pub type time_t = c_longlong; +pub type c_double = f64; +pub type c_float = f32; +pub type ino_t = u64; +pub type sigset_t = c_uchar; +pub type suseconds_t = c_longlong; +pub type mode_t = u32; +pub type dev_t = u64; +pub type uid_t = u32; +pub type gid_t = u32; +pub type nlink_t = u64; +pub type blksize_t = c_long; +pub type blkcnt_t = i64; +pub type nfds_t = c_ulong; +pub type wchar_t = i32; +pub type nl_item = c_int; + +s_no_extra_traits! { + #[repr(align(16))] + #[allow(missing_debug_implementations)] + pub struct max_align_t { + priv_: [f64; 4] + } +} + +pub type __wasi_rights_t = u64; + +#[allow(missing_copy_implementations)] +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum FILE {} +#[allow(missing_copy_implementations)] +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum DIR {} +#[allow(missing_copy_implementations)] +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum __locale_struct {} + +pub type locale_t = *mut __locale_struct; + +s_paren! { + // in wasi-libc clockid_t is const struct __clockid* (where __clockid is an opaque struct), + // but that's an implementation detail that we don't want to have to deal with + #[repr(transparent)] + pub struct clockid_t(*const u8); +} + +unsafe impl Send for clockid_t {} +unsafe impl Sync for clockid_t {} + +s! { + #[repr(align(8))] + pub struct fpos_t { + data: [u8; 16], + } + + pub struct tm { + pub tm_sec: c_int, + pub tm_min: c_int, + pub tm_hour: c_int, + pub tm_mday: c_int, + pub tm_mon: c_int, + pub tm_year: c_int, + pub tm_wday: c_int, + pub tm_yday: c_int, + pub tm_isdst: c_int, + pub __tm_gmtoff: c_int, + pub __tm_zone: *const c_char, + pub __tm_nsec: c_int, + } + + pub struct timeval { + pub tv_sec: time_t, + pub tv_usec: suseconds_t, + } + + pub struct timespec { + pub tv_sec: time_t, + pub tv_nsec: c_long, + } + + pub struct tms { + pub tms_utime: clock_t, + pub tms_stime: clock_t, + pub tms_cutime: clock_t, + pub tms_cstime: clock_t, + } + + pub struct itimerspec { + pub it_interval: timespec, + pub it_value: timespec, + } + + pub struct iovec { + pub iov_base: *mut c_void, + pub iov_len: size_t, + } + + pub struct lconv { + pub decimal_point: *mut c_char, + pub thousands_sep: *mut c_char, + pub grouping: *mut c_char, + pub int_curr_symbol: *mut c_char, + pub currency_symbol: *mut c_char, + pub mon_decimal_point: *mut c_char, + pub mon_thousands_sep: *mut c_char, + pub mon_grouping: *mut c_char, + pub positive_sign: *mut c_char, + pub negative_sign: *mut c_char, + pub int_frac_digits: c_char, + pub frac_digits: c_char, + pub p_cs_precedes: c_char, + pub p_sep_by_space: c_char, + pub n_cs_precedes: c_char, + pub n_sep_by_space: c_char, + pub p_sign_posn: c_char, + pub n_sign_posn: c_char, + pub int_p_cs_precedes: c_char, + pub int_p_sep_by_space: c_char, + pub int_n_cs_precedes: c_char, + pub int_n_sep_by_space: c_char, + pub int_p_sign_posn: c_char, + pub int_n_sign_posn: c_char, + } + + pub struct pollfd { + pub fd: c_int, + pub events: c_short, + pub revents: c_short, + } + + pub struct rusage { + pub ru_utime: timeval, + pub ru_stime: timeval, + } + + pub struct stat { + pub st_dev: dev_t, + pub st_ino: ino_t, + pub st_nlink: nlink_t, + pub st_mode: mode_t, + pub st_uid: uid_t, + pub st_gid: gid_t, + __pad0: c_uint, + pub st_rdev: dev_t, + pub st_size: off_t, + pub st_blksize: blksize_t, + pub st_blocks: blkcnt_t, + pub st_atim: timespec, + pub st_mtim: timespec, + pub st_ctim: timespec, + __reserved: [c_longlong; 3], + } +} + +// Declare dirent outside of s! so that it doesn't implement Copy, Eq, Hash, +// etc., since it contains a flexible array member with a dynamic size. +#[repr(C)] +#[allow(missing_copy_implementations)] +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub struct dirent { + pub d_ino: ino_t, + pub d_type: c_uchar, + /// d_name is declared in WASI libc as a flexible array member, which + /// can't be directly expressed in Rust. As an imperfect workaround, + /// declare it as a zero-length array instead. + pub d_name: [c_char; 0], +} + +pub const EXIT_SUCCESS: c_int = 0; +pub const EXIT_FAILURE: c_int = 1; +pub const STDIN_FILENO: c_int = 0; +pub const STDOUT_FILENO: c_int = 1; +pub const STDERR_FILENO: c_int = 2; +pub const SEEK_SET: c_int = 0; +pub const SEEK_CUR: c_int = 1; +pub const SEEK_END: c_int = 2; +pub const _IOFBF: c_int = 0; +pub const _IONBF: c_int = 2; +pub const _IOLBF: c_int = 1; +pub const F_GETFD: c_int = 1; +pub const F_SETFD: c_int = 2; +pub const F_GETFL: c_int = 3; +pub const F_SETFL: c_int = 4; +pub const FD_CLOEXEC: c_int = 1; +pub const FD_SETSIZE: size_t = 1024; +pub const O_APPEND: c_int = 0x0001; +pub const O_DSYNC: c_int = 0x0002; +pub const O_NONBLOCK: c_int = 0x0004; +pub const O_RSYNC: c_int = 0x0008; +pub const O_SYNC: c_int = 0x0010; +pub const O_CREAT: c_int = 0x0001 << 12; +pub const O_DIRECTORY: c_int = 0x0002 << 12; +pub const O_EXCL: c_int = 0x0004 << 12; +pub const O_TRUNC: c_int = 0x0008 << 12; +pub const O_NOFOLLOW: c_int = 0x01000000; +pub const O_EXEC: c_int = 0x02000000; +pub const O_RDONLY: c_int = 0x04000000; +pub const O_SEARCH: c_int = 0x08000000; +pub const O_WRONLY: c_int = 0x10000000; +pub const O_CLOEXEC: c_int = 0x0; +pub const O_RDWR: c_int = O_WRONLY | O_RDONLY; +pub const O_ACCMODE: c_int = O_EXEC | O_RDWR | O_SEARCH; +pub const O_NOCTTY: c_int = 0x0; +pub const POSIX_FADV_DONTNEED: c_int = 4; +pub const POSIX_FADV_NOREUSE: c_int = 5; +pub const POSIX_FADV_NORMAL: c_int = 0; +pub const POSIX_FADV_RANDOM: c_int = 2; +pub const POSIX_FADV_SEQUENTIAL: c_int = 1; +pub const POSIX_FADV_WILLNEED: c_int = 3; +pub const AT_FDCWD: ::c_int = -2; +pub const AT_EACCESS: c_int = 0x0; +pub const AT_SYMLINK_NOFOLLOW: c_int = 0x1; +pub const AT_SYMLINK_FOLLOW: c_int = 0x2; +pub const AT_REMOVEDIR: c_int = 0x4; +pub const UTIME_OMIT: c_long = 0xfffffffe; +pub const UTIME_NOW: c_long = 0xffffffff; +pub const S_IFIFO: mode_t = 49152; +pub const S_IFCHR: mode_t = 8192; +pub const S_IFBLK: mode_t = 24576; +pub const S_IFDIR: mode_t = 16384; +pub const S_IFREG: mode_t = 32768; +pub const S_IFLNK: mode_t = 40960; +pub const S_IFSOCK: mode_t = 49152; +pub const S_IFMT: mode_t = 57344; +pub const S_IXOTH: mode_t = 0x1; +pub const S_IWOTH: mode_t = 0x2; +pub const S_IROTH: mode_t = 0x4; +pub const S_IXGRP: mode_t = 0x8; +pub const S_IWGRP: mode_t = 0x10; +pub const S_IRGRP: mode_t = 0x20; +pub const S_IXUSR: mode_t = 0x40; +pub const S_IWUSR: mode_t = 0x80; +pub const S_IRUSR: mode_t = 0x100; +pub const S_ISVTX: mode_t = 0x200; +pub const S_ISGID: mode_t = 0x400; +pub const S_ISUID: mode_t = 0x800; +pub const DT_UNKNOWN: u8 = 0; +pub const DT_BLK: u8 = 1; +pub const DT_CHR: u8 = 2; +pub const DT_DIR: u8 = 3; +pub const DT_REG: u8 = 4; +pub const DT_LNK: u8 = 7; +pub const FIONREAD: c_int = 1; +pub const FIONBIO: c_int = 2; +pub const F_OK: ::c_int = 0; +pub const R_OK: ::c_int = 4; +pub const W_OK: ::c_int = 2; +pub const X_OK: ::c_int = 1; +pub const POLLIN: ::c_short = 0x1; +pub const POLLOUT: ::c_short = 0x2; +pub const POLLERR: ::c_short = 0x1000; +pub const POLLHUP: ::c_short = 0x2000; +pub const POLLNVAL: ::c_short = 0x4000; +pub const POLLRDNORM: ::c_short = 0x1; +pub const POLLWRNORM: ::c_short = 0x2; + +pub const E2BIG: c_int = 1; +pub const EACCES: c_int = 2; +pub const EADDRINUSE: c_int = 3; +pub const EADDRNOTAVAIL: c_int = 4; +pub const EAFNOSUPPORT: c_int = 5; +pub const EAGAIN: c_int = 6; +pub const EALREADY: c_int = 7; +pub const EBADF: c_int = 8; +pub const EBADMSG: c_int = 9; +pub const EBUSY: c_int = 10; +pub const ECANCELED: c_int = 11; +pub const ECHILD: c_int = 12; +pub const ECONNABORTED: c_int = 13; +pub const ECONNREFUSED: c_int = 14; +pub const ECONNRESET: c_int = 15; +pub const EDEADLK: c_int = 16; +pub const EDESTADDRREQ: c_int = 17; +pub const EDOM: c_int = 18; +pub const EDQUOT: c_int = 19; +pub const EEXIST: c_int = 20; +pub const EFAULT: c_int = 21; +pub const EFBIG: c_int = 22; +pub const EHOSTUNREACH: c_int = 23; +pub const EIDRM: c_int = 24; +pub const EILSEQ: c_int = 25; +pub const EINPROGRESS: c_int = 26; +pub const EINTR: c_int = 27; +pub const EINVAL: c_int = 28; +pub const EIO: c_int = 29; +pub const EISCONN: c_int = 30; +pub const EISDIR: c_int = 31; +pub const ELOOP: c_int = 32; +pub const EMFILE: c_int = 33; +pub const EMLINK: c_int = 34; +pub const EMSGSIZE: c_int = 35; +pub const EMULTIHOP: c_int = 36; +pub const ENAMETOOLONG: c_int = 37; +pub const ENETDOWN: c_int = 38; +pub const ENETRESET: c_int = 39; +pub const ENETUNREACH: c_int = 40; +pub const ENFILE: c_int = 41; +pub const ENOBUFS: c_int = 42; +pub const ENODEV: c_int = 43; +pub const ENOENT: c_int = 44; +pub const ENOEXEC: c_int = 45; +pub const ENOLCK: c_int = 46; +pub const ENOLINK: c_int = 47; +pub const ENOMEM: c_int = 48; +pub const ENOMSG: c_int = 49; +pub const ENOPROTOOPT: c_int = 50; +pub const ENOSPC: c_int = 51; +pub const ENOSYS: c_int = 52; +pub const ENOTCONN: c_int = 53; +pub const ENOTDIR: c_int = 54; +pub const ENOTEMPTY: c_int = 55; +pub const ENOTRECOVERABLE: c_int = 56; +pub const ENOTSOCK: c_int = 57; +pub const ENOTSUP: c_int = 58; +pub const ENOTTY: c_int = 59; +pub const ENXIO: c_int = 60; +pub const EOVERFLOW: c_int = 61; +pub const EOWNERDEAD: c_int = 62; +pub const EPERM: c_int = 63; +pub const EPIPE: c_int = 64; +pub const EPROTO: c_int = 65; +pub const EPROTONOSUPPORT: c_int = 66; +pub const EPROTOTYPE: c_int = 67; +pub const ERANGE: c_int = 68; +pub const EROFS: c_int = 69; +pub const ESPIPE: c_int = 70; +pub const ESRCH: c_int = 71; +pub const ESTALE: c_int = 72; +pub const ETIMEDOUT: c_int = 73; +pub const ETXTBSY: c_int = 74; +pub const EXDEV: c_int = 75; +pub const ENOTCAPABLE: c_int = 76; +pub const EOPNOTSUPP: c_int = ENOTSUP; +pub const EWOULDBLOCK: c_int = EAGAIN; + +pub const _SC_PAGESIZE: c_int = 30; +pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE; +pub const _SC_IOV_MAX: c_int = 60; +pub const _SC_SYMLOOP_MAX: c_int = 173; + +pub static CLOCK_MONOTONIC: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) }; +pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t = + unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) }; +pub static CLOCK_REALTIME: clockid_t = unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) }; +pub static CLOCK_THREAD_CPUTIME_ID: clockid_t = + unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) }; + +pub const ABDAY_1: ::nl_item = 0x20000; +pub const ABDAY_2: ::nl_item = 0x20001; +pub const ABDAY_3: ::nl_item = 0x20002; +pub const ABDAY_4: ::nl_item = 0x20003; +pub const ABDAY_5: ::nl_item = 0x20004; +pub const ABDAY_6: ::nl_item = 0x20005; +pub const ABDAY_7: ::nl_item = 0x20006; + +pub const DAY_1: ::nl_item = 0x20007; +pub const DAY_2: ::nl_item = 0x20008; +pub const DAY_3: ::nl_item = 0x20009; +pub const DAY_4: ::nl_item = 0x2000A; +pub const DAY_5: ::nl_item = 0x2000B; +pub const DAY_6: ::nl_item = 0x2000C; +pub const DAY_7: ::nl_item = 0x2000D; + +pub const ABMON_1: ::nl_item = 0x2000E; +pub const ABMON_2: ::nl_item = 0x2000F; +pub const ABMON_3: ::nl_item = 0x20010; +pub const ABMON_4: ::nl_item = 0x20011; +pub const ABMON_5: ::nl_item = 0x20012; +pub const ABMON_6: ::nl_item = 0x20013; +pub const ABMON_7: ::nl_item = 0x20014; +pub const ABMON_8: ::nl_item = 0x20015; +pub const ABMON_9: ::nl_item = 0x20016; +pub const ABMON_10: ::nl_item = 0x20017; +pub const ABMON_11: ::nl_item = 0x20018; +pub const ABMON_12: ::nl_item = 0x20019; + +pub const MON_1: ::nl_item = 0x2001A; +pub const MON_2: ::nl_item = 0x2001B; +pub const MON_3: ::nl_item = 0x2001C; +pub const MON_4: ::nl_item = 0x2001D; +pub const MON_5: ::nl_item = 0x2001E; +pub const MON_6: ::nl_item = 0x2001F; +pub const MON_7: ::nl_item = 0x20020; +pub const MON_8: ::nl_item = 0x20021; +pub const MON_9: ::nl_item = 0x20022; +pub const MON_10: ::nl_item = 0x20023; +pub const MON_11: ::nl_item = 0x20024; +pub const MON_12: ::nl_item = 0x20025; + +pub const AM_STR: ::nl_item = 0x20026; +pub const PM_STR: ::nl_item = 0x20027; + +pub const D_T_FMT: ::nl_item = 0x20028; +pub const D_FMT: ::nl_item = 0x20029; +pub const T_FMT: ::nl_item = 0x2002A; +pub const T_FMT_AMPM: ::nl_item = 0x2002B; + +pub const ERA: ::nl_item = 0x2002C; +pub const ERA_D_FMT: ::nl_item = 0x2002E; +pub const ALT_DIGITS: ::nl_item = 0x2002F; +pub const ERA_D_T_FMT: ::nl_item = 0x20030; +pub const ERA_T_FMT: ::nl_item = 0x20031; + +pub const CODESET: ::nl_item = 14; +pub const CRNCYSTR: ::nl_item = 0x4000F; +pub const RADIXCHAR: ::nl_item = 0x10000; +pub const THOUSEP: ::nl_item = 0x10001; +pub const YESEXPR: ::nl_item = 0x50000; +pub const NOEXPR: ::nl_item = 0x50001; +pub const YESSTR: ::nl_item = 0x50002; +pub const NOSTR: ::nl_item = 0x50003; + +#[cfg_attr( + feature = "rustc-dep-of-std", + link( + name = "c", + kind = "static", + modifiers = "-bundle", + cfg(target_feature = "crt-static") + ) +)] +#[cfg_attr( + feature = "rustc-dep-of-std", + link(name = "c", cfg(not(target_feature = "crt-static"))) +)] +extern "C" { + pub fn _Exit(code: c_int) -> !; + pub fn _exit(code: c_int) -> !; + pub fn abort() -> !; + pub fn aligned_alloc(a: size_t, b: size_t) -> *mut c_void; + pub fn calloc(amt: size_t, amt2: size_t) -> *mut c_void; + pub fn exit(code: c_int) -> !; + pub fn free(ptr: *mut c_void); + pub fn getenv(s: *const c_char) -> *mut c_char; + pub fn malloc(amt: size_t) -> *mut c_void; + pub fn malloc_usable_size(ptr: *mut c_void) -> size_t; + pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void; + pub fn rand() -> c_int; + pub fn read(fd: c_int, ptr: *mut c_void, size: size_t) -> ssize_t; + pub fn realloc(ptr: *mut c_void, amt: size_t) -> *mut c_void; + pub fn setenv(k: *const c_char, v: *const c_char, a: c_int) -> c_int; + pub fn unsetenv(k: *const c_char) -> c_int; + pub fn clearenv() -> ::c_int; + pub fn write(fd: c_int, ptr: *const c_void, size: size_t) -> ssize_t; + pub static mut environ: *mut *mut c_char; + pub fn fopen(a: *const c_char, b: *const c_char) -> *mut FILE; + pub fn freopen(a: *const c_char, b: *const c_char, f: *mut FILE) -> *mut FILE; + pub fn fclose(f: *mut FILE) -> c_int; + pub fn remove(a: *const c_char) -> c_int; + pub fn rename(a: *const c_char, b: *const c_char) -> c_int; + pub fn feof(f: *mut FILE) -> c_int; + pub fn ferror(f: *mut FILE) -> c_int; + pub fn fflush(f: *mut FILE) -> c_int; + pub fn clearerr(f: *mut FILE); + pub fn fseek(f: *mut FILE, b: c_long, c: c_int) -> c_int; + pub fn ftell(f: *mut FILE) -> c_long; + pub fn rewind(f: *mut FILE); + pub fn fgetpos(f: *mut FILE, pos: *mut fpos_t) -> c_int; + pub fn fsetpos(f: *mut FILE, pos: *const fpos_t) -> c_int; + pub fn fread(buf: *mut c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t; + pub fn fwrite(buf: *const c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t; + pub fn fgetc(f: *mut FILE) -> c_int; + pub fn getc(f: *mut FILE) -> c_int; + pub fn getchar() -> c_int; + pub fn ungetc(a: c_int, f: *mut FILE) -> c_int; + pub fn fputc(a: c_int, f: *mut FILE) -> c_int; + pub fn putc(a: c_int, f: *mut FILE) -> c_int; + pub fn putchar(a: c_int) -> c_int; + pub fn fputs(a: *const c_char, f: *mut FILE) -> c_int; + pub fn puts(a: *const c_char) -> c_int; + pub fn perror(a: *const c_char); + pub fn srand(a: c_uint); + pub fn atexit(a: extern "C" fn()) -> c_int; + pub fn at_quick_exit(a: extern "C" fn()) -> c_int; + pub fn quick_exit(a: c_int) -> !; + pub fn posix_memalign(a: *mut *mut c_void, b: size_t, c: size_t) -> c_int; + pub fn rand_r(a: *mut c_uint) -> c_int; + pub fn random() -> c_long; + pub fn srandom(a: c_uint); + pub fn putenv(a: *mut c_char) -> c_int; + pub fn clock() -> clock_t; + pub fn time(a: *mut time_t) -> time_t; + pub fn difftime(a: time_t, b: time_t) -> c_double; + pub fn mktime(a: *mut tm) -> time_t; + pub fn strftime(a: *mut c_char, b: size_t, c: *const c_char, d: *const tm) -> size_t; + pub fn gmtime(a: *const time_t) -> *mut tm; + pub fn gmtime_r(a: *const time_t, b: *mut tm) -> *mut tm; + pub fn localtime(a: *const time_t) -> *mut tm; + pub fn localtime_r(a: *const time_t, b: *mut tm) -> *mut tm; + pub fn asctime_r(a: *const tm, b: *mut c_char) -> *mut c_char; + pub fn ctime_r(a: *const time_t, b: *mut c_char) -> *mut c_char; + + static _CLOCK_MONOTONIC: u8; + static _CLOCK_PROCESS_CPUTIME_ID: u8; + static _CLOCK_REALTIME: u8; + static _CLOCK_THREAD_CPUTIME_ID: u8; + pub fn nanosleep(a: *const timespec, b: *mut timespec) -> c_int; + pub fn clock_getres(a: clockid_t, b: *mut timespec) -> c_int; + pub fn clock_gettime(a: clockid_t, b: *mut timespec) -> c_int; + pub fn clock_nanosleep(a: clockid_t, a2: c_int, b: *const timespec, c: *mut timespec) -> c_int; + + pub fn isalnum(c: c_int) -> c_int; + pub fn isalpha(c: c_int) -> c_int; + pub fn iscntrl(c: c_int) -> c_int; + pub fn isdigit(c: c_int) -> c_int; + pub fn isgraph(c: c_int) -> c_int; + pub fn islower(c: c_int) -> c_int; + pub fn isprint(c: c_int) -> c_int; + pub fn ispunct(c: c_int) -> c_int; + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; + pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; + pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int; + pub fn setbuf(stream: *mut FILE, buf: *mut c_char); + pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; + pub fn atoi(s: *const c_char) -> c_int; + pub fn atof(s: *const c_char) -> c_double; + pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; + pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float; + pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long; + pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong; + + pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; + pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; + pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; + pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; + pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; + pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; + pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; + pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strdup(cs: *const c_char) -> *mut c_char; + pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char; + pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; + pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int; + pub fn strlen(cs: *const c_char) -> size_t; + pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; + pub fn strerror(n: c_int) -> *mut c_char; + pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; + pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; + + pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; + pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; + pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; + pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; + pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; + + pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int; + pub fn printf(format: *const ::c_char, ...) -> ::c_int; + pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int; + pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int; + pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int; + pub fn scanf(format: *const ::c_char, ...) -> ::c_int; + pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int; + pub fn getchar_unlocked() -> ::c_int; + pub fn putchar_unlocked(c: ::c_int) -> ::c_int; + + pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int; + pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int; + pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int; + pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int; + pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE; + pub fn fileno(stream: *mut ::FILE) -> ::c_int; + pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; + pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int; + pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int; + pub fn opendir(dirname: *const c_char) -> *mut ::DIR; + pub fn fdopendir(fd: ::c_int) -> *mut ::DIR; + pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent; + pub fn closedir(dirp: *mut ::DIR) -> ::c_int; + pub fn rewinddir(dirp: *mut ::DIR); + pub fn dirfd(dirp: *mut ::DIR) -> ::c_int; + pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long); + pub fn telldir(dirp: *mut ::DIR) -> ::c_long; + + pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int; + pub fn fstatat( + dirfd: ::c_int, + pathname: *const ::c_char, + buf: *mut stat, + flags: ::c_int, + ) -> ::c_int; + pub fn linkat( + olddirfd: ::c_int, + oldpath: *const ::c_char, + newdirfd: ::c_int, + newpath: *const ::c_char, + flags: ::c_int, + ) -> ::c_int; + pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int; + pub fn readlinkat( + dirfd: ::c_int, + pathname: *const ::c_char, + buf: *mut ::c_char, + bufsiz: ::size_t, + ) -> ::ssize_t; + pub fn renameat( + olddirfd: ::c_int, + oldpath: *const ::c_char, + newdirfd: ::c_int, + newpath: *const ::c_char, + ) -> ::c_int; + pub fn symlinkat( + target: *const ::c_char, + newdirfd: ::c_int, + linkpath: *const ::c_char, + ) -> ::c_int; + pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int; + + pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int; + pub fn close(fd: ::c_int) -> ::c_int; + pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long; + pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int; + pub fn isatty(fd: ::c_int) -> ::c_int; + pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int; + pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t; + pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long; + pub fn rmdir(path: *const c_char) -> ::c_int; + pub fn sleep(secs: ::c_uint) -> ::c_uint; + pub fn unlink(c: *const c_char) -> ::c_int; + pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t; + pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t; + + pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int; + + pub fn fsync(fd: ::c_int) -> ::c_int; + pub fn fdatasync(fd: ::c_int) -> ::c_int; + + pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int; + + pub fn truncate(path: *const c_char, length: off_t) -> ::c_int; + pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int; + + pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int; + + pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int; + pub fn times(buf: *mut ::tms) -> ::clock_t; + + pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int; + + pub fn usleep(secs: ::c_uint) -> ::c_int; + pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t; + pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t; + pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int; + pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char; + pub fn localeconv() -> *mut lconv; + + pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t; + + pub fn timegm(tm: *mut ::tm) -> time_t; + + pub fn sysconf(name: ::c_int) -> ::c_long; + + pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int; + + pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int; + pub fn ftello(stream: *mut ::FILE) -> ::off_t; + pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int; + + pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t; + + pub fn faccessat( + dirfd: ::c_int, + pathname: *const ::c_char, + mode: ::c_int, + flags: ::c_int, + ) -> ::c_int; + pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t; + pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) + -> ::ssize_t; + pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t; + pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int; + pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int; + pub fn utimensat( + dirfd: ::c_int, + path: *const ::c_char, + times: *const ::timespec, + flag: ::c_int, + ) -> ::c_int; + pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; + pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void; + pub fn abs(i: c_int) -> c_int; + pub fn labs(i: c_long) -> c_long; + pub fn duplocale(base: ::locale_t) -> ::locale_t; + pub fn freelocale(loc: ::locale_t); + pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t; + pub fn uselocale(loc: ::locale_t) -> ::locale_t; + pub fn sched_yield() -> ::c_int; + pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char; + pub fn chdir(dir: *const c_char) -> ::c_int; + + pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char; + pub fn nl_langinfo_l(item: ::nl_item, loc: ::locale_t) -> *mut ::c_char; + + pub fn __wasilibc_register_preopened_fd(fd: c_int, path: *const c_char) -> c_int; + pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int; + pub fn __wasilibc_unlinkat(fd: c_int, path: *const c_char) -> c_int; + pub fn __wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int; + pub fn __wasilibc_find_relpath( + path: *const c_char, + abs_prefix: *mut *const c_char, + relative_path: *mut *mut c_char, + relative_path_len: usize, + ) -> c_int; + pub fn __wasilibc_tell(fd: c_int) -> ::off_t; + pub fn __wasilibc_nocwd___wasilibc_unlinkat(dirfd: c_int, path: *const c_char) -> c_int; + pub fn __wasilibc_nocwd___wasilibc_rmdirat(dirfd: c_int, path: *const c_char) -> c_int; + pub fn __wasilibc_nocwd_linkat( + olddirfd: c_int, + oldpath: *const c_char, + newdirfd: c_int, + newpath: *const c_char, + flags: c_int, + ) -> c_int; + pub fn __wasilibc_nocwd_symlinkat( + target: *const c_char, + dirfd: c_int, + path: *const c_char, + ) -> c_int; + pub fn __wasilibc_nocwd_readlinkat( + dirfd: c_int, + path: *const c_char, + buf: *mut c_char, + bufsize: usize, + ) -> isize; + pub fn __wasilibc_nocwd_faccessat( + dirfd: c_int, + path: *const c_char, + mode: c_int, + flags: c_int, + ) -> c_int; + pub fn __wasilibc_nocwd_renameat( + olddirfd: c_int, + oldpath: *const c_char, + newdirfd: c_int, + newpath: *const c_char, + ) -> c_int; + pub fn __wasilibc_nocwd_openat_nomode(dirfd: c_int, path: *const c_char, flags: c_int) + -> c_int; + pub fn __wasilibc_nocwd_fstatat( + dirfd: c_int, + path: *const c_char, + buf: *mut stat, + flags: c_int, + ) -> c_int; + pub fn __wasilibc_nocwd_mkdirat_nomode(dirfd: c_int, path: *const c_char) -> c_int; + pub fn __wasilibc_nocwd_utimensat( + dirfd: c_int, + path: *const c_char, + times: *const ::timespec, + flags: c_int, + ) -> c_int; + pub fn __wasilibc_nocwd_opendirat(dirfd: c_int, path: *const c_char) -> *mut ::DIR; + pub fn __wasilibc_access(pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; + pub fn __wasilibc_stat(pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int; + pub fn __wasilibc_utimens( + pathname: *const c_char, + times: *const ::timespec, + flags: c_int, + ) -> c_int; + pub fn __wasilibc_link(oldpath: *const c_char, newpath: *const c_char, flags: c_int) -> c_int; + pub fn __wasilibc_link_oldat( + olddirfd: c_int, + oldpath: *const c_char, + newpath: *const c_char, + flags: c_int, + ) -> c_int; + pub fn __wasilibc_link_newat( + oldpath: *const c_char, + newdirfd: c_int, + newpath: *const c_char, + flags: c_int, + ) -> c_int; + pub fn __wasilibc_rename_oldat( + olddirfd: c_int, + oldpath: *const c_char, + newpath: *const c_char, + ) -> c_int; + pub fn __wasilibc_rename_newat( + oldpath: *const c_char, + newdirfd: c_int, + newpath: *const c_char, + ) -> c_int; + + pub fn arc4random() -> u32; + pub fn arc4random_buf(a: *mut c_void, b: size_t); + pub fn arc4random_uniform(a: u32) -> u32; +} diff --git a/bash-5.1/vendor/libc/src/windows/gnu/align.rs b/bash-5.1/vendor/libc/src/windows/gnu/align.rs new file mode 100644 index 0000000000000000000000000000000000000000..3af99e3ca149bf53fa803e05bb15f02f6f60a6e1 --- /dev/null +++ b/bash-5.1/vendor/libc/src/windows/gnu/align.rs @@ -0,0 +1,19 @@ +cfg_if! { + if #[cfg(target_pointer_width = "64")] { + s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [f64; 4] + } + } + } else if #[cfg(target_pointer_width = "32")] { + s_no_extra_traits! { + #[allow(missing_debug_implementations)] + #[repr(align(16))] + pub struct max_align_t { + priv_: [i64; 6] + } + } + } +} diff --git a/bash-5.1/vendor/libc/src/windows/gnu/mod.rs b/bash-5.1/vendor/libc/src/windows/gnu/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..3e7d38b8e83c6bfebdd71c691f20b52beae734ed --- /dev/null +++ b/bash-5.1/vendor/libc/src/windows/gnu/mod.rs @@ -0,0 +1,23 @@ +pub const L_tmpnam: ::c_uint = 14; +pub const TMP_MAX: ::c_uint = 0x7fff; + +// stdio file descriptor numbers +pub const STDIN_FILENO: ::c_int = 0; +pub const STDOUT_FILENO: ::c_int = 1; +pub const STDERR_FILENO: ::c_int = 2; + +extern "C" { + pub fn strcasecmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int; + pub fn strncasecmp(s1: *const ::c_char, s2: *const ::c_char, n: ::size_t) -> ::c_int; + + // NOTE: For MSVC target, `wmemchr` is only a inline function in `` + // header file. We cannot find a way to link to that symbol from Rust. + pub fn wmemchr(cx: *const ::wchar_t, c: ::wchar_t, n: ::size_t) -> *mut ::wchar_t; +} + +cfg_if! { + if #[cfg(libc_align)] { + mod align; + pub use self::align::*; + } +} diff --git a/bash-5.1/vendor/libc/src/windows/mod.rs b/bash-5.1/vendor/libc/src/windows/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..acb0de98951707abd05a9b69074f5ae9f53d5ab0 --- /dev/null +++ b/bash-5.1/vendor/libc/src/windows/mod.rs @@ -0,0 +1,584 @@ +//! Windows CRT definitions + +pub type c_schar = i8; +pub type c_uchar = u8; +pub type c_short = i16; +pub type c_ushort = u16; +pub type c_int = i32; +pub type c_uint = u32; +pub type c_float = f32; +pub type c_double = f64; +pub type c_longlong = i64; +pub type c_ulonglong = u64; +pub type intmax_t = i64; +pub type uintmax_t = u64; + +pub type size_t = usize; +pub type ptrdiff_t = isize; +pub type intptr_t = isize; +pub type uintptr_t = usize; +pub type ssize_t = isize; +pub type sighandler_t = usize; + +pub type c_char = i8; +pub type c_long = i32; +pub type c_ulong = u32; +pub type wchar_t = u16; + +pub type clock_t = i32; + +pub type errno_t = ::c_int; + +cfg_if! { + if #[cfg(all(target_arch = "x86", target_env = "gnu"))] { + pub type time_t = i32; + } else { + pub type time_t = i64; + } +} + +pub type off_t = i32; +pub type dev_t = u32; +pub type ino_t = u16; +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum timezone {} +impl ::Copy for timezone {} +impl ::Clone for timezone { + fn clone(&self) -> timezone { + *self + } +} +pub type time64_t = i64; + +pub type SOCKET = ::uintptr_t; + +s! { + // note this is the struct called stat64 in Windows. Not stat, nor stati64. + pub struct stat { + pub st_dev: dev_t, + pub st_ino: ino_t, + pub st_mode: u16, + pub st_nlink: ::c_short, + pub st_uid: ::c_short, + pub st_gid: ::c_short, + pub st_rdev: dev_t, + pub st_size: i64, + pub st_atime: time64_t, + pub st_mtime: time64_t, + pub st_ctime: time64_t, + } + + // note that this is called utimbuf64 in Windows + pub struct utimbuf { + pub actime: time64_t, + pub modtime: time64_t, + } + + pub struct tm { + pub tm_sec: ::c_int, + pub tm_min: ::c_int, + pub tm_hour: ::c_int, + pub tm_mday: ::c_int, + pub tm_mon: ::c_int, + pub tm_year: ::c_int, + pub tm_wday: ::c_int, + pub tm_yday: ::c_int, + pub tm_isdst: ::c_int, + } + + pub struct timeval { + pub tv_sec: c_long, + pub tv_usec: c_long, + } + + pub struct timespec { + pub tv_sec: time_t, + pub tv_nsec: c_long, + } + + pub struct sockaddr { + pub sa_family: c_ushort, + pub sa_data: [c_char; 14], + } +} + +pub const INT_MIN: c_int = -2147483648; +pub const INT_MAX: c_int = 2147483647; + +pub const EXIT_FAILURE: ::c_int = 1; +pub const EXIT_SUCCESS: ::c_int = 0; +pub const RAND_MAX: ::c_int = 32767; +pub const EOF: ::c_int = -1; +pub const SEEK_SET: ::c_int = 0; +pub const SEEK_CUR: ::c_int = 1; +pub const SEEK_END: ::c_int = 2; +pub const _IOFBF: ::c_int = 0; +pub const _IONBF: ::c_int = 4; +pub const _IOLBF: ::c_int = 64; +pub const BUFSIZ: ::c_uint = 512; +pub const FOPEN_MAX: ::c_uint = 20; +pub const FILENAME_MAX: ::c_uint = 260; + +// fcntl.h +pub const O_RDONLY: ::c_int = 0x0000; +pub const O_WRONLY: ::c_int = 0x0001; +pub const O_RDWR: ::c_int = 0x0002; +pub const O_APPEND: ::c_int = 0x0008; +pub const O_CREAT: ::c_int = 0x0100; +pub const O_TRUNC: ::c_int = 0x0200; +pub const O_EXCL: ::c_int = 0x0400; +pub const O_TEXT: ::c_int = 0x4000; +pub const O_BINARY: ::c_int = 0x8000; +pub const _O_WTEXT: ::c_int = 0x10000; +pub const _O_U16TEXT: ::c_int = 0x20000; +pub const _O_U8TEXT: ::c_int = 0x40000; +pub const O_RAW: ::c_int = O_BINARY; +pub const O_NOINHERIT: ::c_int = 0x0080; +pub const O_TEMPORARY: ::c_int = 0x0040; +pub const _O_SHORT_LIVED: ::c_int = 0x1000; +pub const _O_OBTAIN_DIR: ::c_int = 0x2000; +pub const O_SEQUENTIAL: ::c_int = 0x0020; +pub const O_RANDOM: ::c_int = 0x0010; + +pub const S_IFCHR: ::c_int = 8192; +pub const S_IFDIR: ::c_int = 16384; +pub const S_IFREG: ::c_int = 32768; +pub const S_IFMT: ::c_int = 61440; +pub const S_IEXEC: ::c_int = 64; +pub const S_IWRITE: ::c_int = 128; +pub const S_IREAD: ::c_int = 256; + +pub const LC_ALL: ::c_int = 0; +pub const LC_COLLATE: ::c_int = 1; +pub const LC_CTYPE: ::c_int = 2; +pub const LC_MONETARY: ::c_int = 3; +pub const LC_NUMERIC: ::c_int = 4; +pub const LC_TIME: ::c_int = 5; + +pub const EPERM: ::c_int = 1; +pub const ENOENT: ::c_int = 2; +pub const ESRCH: ::c_int = 3; +pub const EINTR: ::c_int = 4; +pub const EIO: ::c_int = 5; +pub const ENXIO: ::c_int = 6; +pub const E2BIG: ::c_int = 7; +pub const ENOEXEC: ::c_int = 8; +pub const EBADF: ::c_int = 9; +pub const ECHILD: ::c_int = 10; +pub const EAGAIN: ::c_int = 11; +pub const ENOMEM: ::c_int = 12; +pub const EACCES: ::c_int = 13; +pub const EFAULT: ::c_int = 14; +pub const EBUSY: ::c_int = 16; +pub const EEXIST: ::c_int = 17; +pub const EXDEV: ::c_int = 18; +pub const ENODEV: ::c_int = 19; +pub const ENOTDIR: ::c_int = 20; +pub const EISDIR: ::c_int = 21; +pub const EINVAL: ::c_int = 22; +pub const ENFILE: ::c_int = 23; +pub const EMFILE: ::c_int = 24; +pub const ENOTTY: ::c_int = 25; +pub const EFBIG: ::c_int = 27; +pub const ENOSPC: ::c_int = 28; +pub const ESPIPE: ::c_int = 29; +pub const EROFS: ::c_int = 30; +pub const EMLINK: ::c_int = 31; +pub const EPIPE: ::c_int = 32; +pub const EDOM: ::c_int = 33; +pub const ERANGE: ::c_int = 34; +pub const EDEADLK: ::c_int = 36; +pub const EDEADLOCK: ::c_int = 36; +pub const ENAMETOOLONG: ::c_int = 38; +pub const ENOLCK: ::c_int = 39; +pub const ENOSYS: ::c_int = 40; +pub const ENOTEMPTY: ::c_int = 41; +pub const EILSEQ: ::c_int = 42; +pub const STRUNCATE: ::c_int = 80; + +// POSIX Supplement (from errno.h) +pub const EADDRINUSE: ::c_int = 100; +pub const EADDRNOTAVAIL: ::c_int = 101; +pub const EAFNOSUPPORT: ::c_int = 102; +pub const EALREADY: ::c_int = 103; +pub const EBADMSG: ::c_int = 104; +pub const ECANCELED: ::c_int = 105; +pub const ECONNABORTED: ::c_int = 106; +pub const ECONNREFUSED: ::c_int = 107; +pub const ECONNRESET: ::c_int = 108; +pub const EDESTADDRREQ: ::c_int = 109; +pub const EHOSTUNREACH: ::c_int = 110; +pub const EIDRM: ::c_int = 111; +pub const EINPROGRESS: ::c_int = 112; +pub const EISCONN: ::c_int = 113; +pub const ELOOP: ::c_int = 114; +pub const EMSGSIZE: ::c_int = 115; +pub const ENETDOWN: ::c_int = 116; +pub const ENETRESET: ::c_int = 117; +pub const ENETUNREACH: ::c_int = 118; +pub const ENOBUFS: ::c_int = 119; +pub const ENODATA: ::c_int = 120; +pub const ENOLINK: ::c_int = 121; +pub const ENOMSG: ::c_int = 122; +pub const ENOPROTOOPT: ::c_int = 123; +pub const ENOSR: ::c_int = 124; +pub const ENOSTR: ::c_int = 125; +pub const ENOTCONN: ::c_int = 126; +pub const ENOTRECOVERABLE: ::c_int = 127; +pub const ENOTSOCK: ::c_int = 128; +pub const ENOTSUP: ::c_int = 129; +pub const EOPNOTSUPP: ::c_int = 130; +pub const EOVERFLOW: ::c_int = 132; +pub const EOWNERDEAD: ::c_int = 133; +pub const EPROTO: ::c_int = 134; +pub const EPROTONOSUPPORT: ::c_int = 135; +pub const EPROTOTYPE: ::c_int = 136; +pub const ETIME: ::c_int = 137; +pub const ETIMEDOUT: ::c_int = 138; +pub const ETXTBSY: ::c_int = 139; +pub const EWOULDBLOCK: ::c_int = 140; + +// signal codes +pub const SIGINT: ::c_int = 2; +pub const SIGILL: ::c_int = 4; +pub const SIGFPE: ::c_int = 8; +pub const SIGSEGV: ::c_int = 11; +pub const SIGTERM: ::c_int = 15; +pub const SIGABRT: ::c_int = 22; +pub const NSIG: ::c_int = 23; + +pub const SIG_ERR: ::c_int = -1; +pub const SIG_DFL: ::sighandler_t = 0; +pub const SIG_IGN: ::sighandler_t = 1; +pub const SIG_GET: ::sighandler_t = 2; +pub const SIG_SGE: ::sighandler_t = 3; +pub const SIG_ACK: ::sighandler_t = 4; + +// inline comment below appeases style checker +#[cfg(all(target_env = "msvc", feature = "rustc-dep-of-std"))] // " if " +#[link(name = "msvcrt", cfg(not(target_feature = "crt-static")))] +#[link(name = "libcmt", cfg(target_feature = "crt-static"))] +extern "C" {} + +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum FILE {} +impl ::Copy for FILE {} +impl ::Clone for FILE { + fn clone(&self) -> FILE { + *self + } +} +#[cfg_attr(feature = "extra_traits", derive(Debug))] +pub enum fpos_t {} // FIXME: fill this out with a struct +impl ::Copy for fpos_t {} +impl ::Clone for fpos_t { + fn clone(&self) -> fpos_t { + *self + } +} + +// Special handling for all print and scan type functions because of https://github.com/rust-lang/libc/issues/2860 +#[cfg_attr( + all(windows, target_env = "msvc"), + link(name = "legacy_stdio_definitions") +)] +extern "C" { + pub fn printf(format: *const c_char, ...) -> ::c_int; + pub fn fprintf(stream: *mut FILE, format: *const c_char, ...) -> ::c_int; +} + +extern "C" { + pub fn isalnum(c: c_int) -> c_int; + pub fn isalpha(c: c_int) -> c_int; + pub fn iscntrl(c: c_int) -> c_int; + pub fn isdigit(c: c_int) -> c_int; + pub fn isgraph(c: c_int) -> c_int; + pub fn islower(c: c_int) -> c_int; + pub fn isprint(c: c_int) -> c_int; + pub fn ispunct(c: c_int) -> c_int; + pub fn isspace(c: c_int) -> c_int; + pub fn isupper(c: c_int) -> c_int; + pub fn isxdigit(c: c_int) -> c_int; + pub fn isblank(c: c_int) -> c_int; + pub fn tolower(c: c_int) -> c_int; + pub fn toupper(c: c_int) -> c_int; + pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; + pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE; + pub fn fflush(file: *mut FILE) -> c_int; + pub fn fclose(file: *mut FILE) -> c_int; + pub fn remove(filename: *const c_char) -> c_int; + pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; + pub fn tmpfile() -> *mut FILE; + pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int; + pub fn setbuf(stream: *mut FILE, buf: *mut c_char); + pub fn getchar() -> c_int; + pub fn putchar(c: c_int) -> c_int; + pub fn fgetc(stream: *mut FILE) -> c_int; + pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; + pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; + pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; + pub fn puts(s: *const c_char) -> c_int; + pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; + pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; + pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; + pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; + pub fn ftell(stream: *mut FILE) -> c_long; + pub fn rewind(stream: *mut FILE); + pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; + pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; + pub fn feof(stream: *mut FILE) -> c_int; + pub fn ferror(stream: *mut FILE) -> c_int; + pub fn perror(s: *const c_char); + pub fn atoi(s: *const c_char) -> c_int; + pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; + pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float; + pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long; + pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong; + pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; + pub fn malloc(size: size_t) -> *mut c_void; + pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; + pub fn free(p: *mut c_void); + pub fn abort() -> !; + pub fn exit(status: c_int) -> !; + pub fn _exit(status: c_int) -> !; + pub fn atexit(cb: extern "C" fn()) -> c_int; + pub fn system(s: *const c_char) -> c_int; + pub fn getenv(s: *const c_char) -> *mut c_char; + + pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; + pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; + pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; + pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; + pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; + pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; + pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; + pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; + pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; + pub fn strdup(cs: *const c_char) -> *mut c_char; + pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; + pub fn strlen(cs: *const c_char) -> size_t; + pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; + pub fn strerror(n: c_int) -> *mut c_char; + pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; + pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; + pub fn wcslen(buf: *const wchar_t) -> size_t; + pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t; + + pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; + pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; + pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; + pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; + pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; + + pub fn abs(i: c_int) -> c_int; + pub fn atof(s: *const c_char) -> c_double; + pub fn labs(i: c_long) -> c_long; + pub fn rand() -> c_int; + pub fn srand(seed: c_uint); + + pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; + pub fn raise(signum: c_int) -> c_int; + + #[link_name = "_gmtime64_s"] + pub fn gmtime_s(destTime: *mut tm, srcTime: *const time_t) -> ::c_int; + #[link_name = "_localtime64_s"] + pub fn localtime_s(tmDest: *mut tm, sourceTime: *const time_t) -> ::errno_t; + #[link_name = "_time64"] + pub fn time(destTime: *mut time_t) -> time_t; + #[link_name = "_chmod"] + pub fn chmod(path: *const c_char, mode: ::c_int) -> ::c_int; + #[link_name = "_wchmod"] + pub fn wchmod(path: *const wchar_t, mode: ::c_int) -> ::c_int; + #[link_name = "_mkdir"] + pub fn mkdir(path: *const c_char) -> ::c_int; + #[link_name = "_wrmdir"] + pub fn wrmdir(path: *const wchar_t) -> ::c_int; + #[link_name = "_fstat64"] + pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int; + #[link_name = "_stat64"] + pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int; + #[link_name = "_wstat64"] + pub fn wstat(path: *const wchar_t, buf: *mut stat) -> ::c_int; + #[link_name = "_wutime64"] + pub fn wutime(file: *const wchar_t, buf: *mut utimbuf) -> ::c_int; + #[link_name = "_popen"] + pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE; + #[link_name = "_pclose"] + pub fn pclose(stream: *mut ::FILE) -> ::c_int; + #[link_name = "_fdopen"] + pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE; + #[link_name = "_fileno"] + pub fn fileno(stream: *mut ::FILE) -> ::c_int; + #[link_name = "_open"] + pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; + #[link_name = "_wopen"] + pub fn wopen(path: *const wchar_t, oflag: ::c_int, ...) -> ::c_int; + #[link_name = "_creat"] + pub fn creat(path: *const c_char, mode: ::c_int) -> ::c_int; + #[link_name = "_access"] + pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int; + #[link_name = "_chdir"] + pub fn chdir(dir: *const c_char) -> ::c_int; + #[link_name = "_close"] + pub fn close(fd: ::c_int) -> ::c_int; + #[link_name = "_dup"] + pub fn dup(fd: ::c_int) -> ::c_int; + #[link_name = "_dup2"] + pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int; + #[link_name = "_execl"] + pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> intptr_t; + #[link_name = "_wexecl"] + pub fn wexecl(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t; + #[link_name = "_execle"] + pub fn execle(path: *const c_char, arg0: *const c_char, ...) -> intptr_t; + #[link_name = "_wexecle"] + pub fn wexecle(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t; + #[link_name = "_execlp"] + pub fn execlp(path: *const c_char, arg0: *const c_char, ...) -> intptr_t; + #[link_name = "_wexeclp"] + pub fn wexeclp(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t; + #[link_name = "_execlpe"] + pub fn execlpe(path: *const c_char, arg0: *const c_char, ...) -> intptr_t; + #[link_name = "_wexeclpe"] + pub fn wexeclpe(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t; + #[link_name = "_execv"] + pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::intptr_t; + #[link_name = "_execve"] + pub fn execve( + prog: *const c_char, + argv: *const *const c_char, + envp: *const *const c_char, + ) -> ::c_int; + #[link_name = "_execvp"] + pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int; + #[link_name = "_execvpe"] + pub fn execvpe( + c: *const c_char, + argv: *const *const c_char, + envp: *const *const c_char, + ) -> ::c_int; + #[link_name = "_wexecv"] + pub fn wexecv(prog: *const wchar_t, argv: *const *const wchar_t) -> ::intptr_t; + #[link_name = "_wexecve"] + pub fn wexecve( + prog: *const wchar_t, + argv: *const *const wchar_t, + envp: *const *const wchar_t, + ) -> ::intptr_t; + #[link_name = "_wexecvp"] + pub fn wexecvp(c: *const wchar_t, argv: *const *const wchar_t) -> ::intptr_t; + #[link_name = "_wexecvpe"] + pub fn wexecvpe( + c: *const wchar_t, + argv: *const *const wchar_t, + envp: *const *const wchar_t, + ) -> ::intptr_t; + #[link_name = "_getcwd"] + pub fn getcwd(buf: *mut c_char, size: ::c_int) -> *mut c_char; + #[link_name = "_getpid"] + pub fn getpid() -> ::c_int; + #[link_name = "_isatty"] + pub fn isatty(fd: ::c_int) -> ::c_int; + #[link_name = "_lseek"] + pub fn lseek(fd: ::c_int, offset: c_long, origin: ::c_int) -> c_long; + #[link_name = "_lseeki64"] + pub fn lseek64(fd: ::c_int, offset: c_longlong, origin: ::c_int) -> c_longlong; + #[link_name = "_pipe"] + pub fn pipe(fds: *mut ::c_int, psize: ::c_uint, textmode: ::c_int) -> ::c_int; + #[link_name = "_read"] + pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::c_uint) -> ::c_int; + #[link_name = "_rmdir"] + pub fn rmdir(path: *const c_char) -> ::c_int; + #[link_name = "_unlink"] + pub fn unlink(c: *const c_char) -> ::c_int; + #[link_name = "_write"] + pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::c_uint) -> ::c_int; + #[link_name = "_commit"] + pub fn commit(fd: ::c_int) -> ::c_int; + #[link_name = "_get_osfhandle"] + pub fn get_osfhandle(fd: ::c_int) -> ::intptr_t; + #[link_name = "_open_osfhandle"] + pub fn open_osfhandle(osfhandle: ::intptr_t, flags: ::c_int) -> ::c_int; + pub fn setlocale(category: ::c_int, locale: *const c_char) -> *mut c_char; + #[link_name = "_wsetlocale"] + pub fn wsetlocale(category: ::c_int, locale: *const wchar_t) -> *mut wchar_t; + #[link_name = "_aligned_malloc"] + pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void; + #[link_name = "_aligned_free"] + pub fn aligned_free(ptr: *mut ::c_void); +} + +extern "system" { + pub fn listen(s: SOCKET, backlog: ::c_int) -> ::c_int; + pub fn accept(s: SOCKET, addr: *mut ::sockaddr, addrlen: *mut ::c_int) -> SOCKET; + pub fn bind(s: SOCKET, name: *const ::sockaddr, namelen: ::c_int) -> ::c_int; + pub fn connect(s: SOCKET, name: *const ::sockaddr, namelen: ::c_int) -> ::c_int; + pub fn getpeername(s: SOCKET, name: *mut ::sockaddr, nameln: *mut ::c_int) -> ::c_int; + pub fn getsockname(s: SOCKET, name: *mut ::sockaddr, nameln: *mut ::c_int) -> ::c_int; + pub fn getsockopt( + s: SOCKET, + level: ::c_int, + optname: ::c_int, + optval: *mut ::c_char, + optlen: *mut ::c_int, + ) -> ::c_int; + pub fn recvfrom( + s: SOCKET, + buf: *mut ::c_char, + len: ::c_int, + flags: ::c_int, + from: *mut ::sockaddr, + fromlen: *mut ::c_int, + ) -> ::c_int; + pub fn sendto( + s: SOCKET, + buf: *const ::c_char, + len: ::c_int, + flags: ::c_int, + to: *const ::sockaddr, + tolen: ::c_int, + ) -> ::c_int; + pub fn setsockopt( + s: SOCKET, + level: ::c_int, + optname: ::c_int, + optval: *const ::c_char, + optlen: ::c_int, + ) -> ::c_int; + pub fn socket(af: ::c_int, socket_type: ::c_int, protocol: ::c_int) -> SOCKET; +} + +cfg_if! { + if #[cfg(libc_core_cvoid)] { + pub use ::ffi::c_void; + } else { + // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help + // enable more optimization opportunities around it recognizing things + // like malloc/free. + #[repr(u8)] + #[allow(missing_copy_implementations)] + #[allow(missing_debug_implementations)] + pub enum c_void { + // Two dummy variants so the #[repr] attribute can be used. + #[doc(hidden)] + __variant1, + #[doc(hidden)] + __variant2, + } + } +} + +cfg_if! { + if #[cfg(all(target_env = "gnu"))] { + mod gnu; + pub use self::gnu::*; + } else if #[cfg(all(target_env = "msvc"))] { + mod msvc; + pub use self::msvc::*; + } else { + // Unknown target_env + } +} diff --git a/bash-5.1/vendor/libc/src/windows/msvc/mod.rs b/bash-5.1/vendor/libc/src/windows/msvc/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..f5a1d95f395b393b587773c4028aedb3d64624c4 --- /dev/null +++ b/bash-5.1/vendor/libc/src/windows/msvc/mod.rs @@ -0,0 +1,20 @@ +pub const L_tmpnam: ::c_uint = 260; +pub const TMP_MAX: ::c_uint = 0x7fff_ffff; + +// POSIX Supplement (from errno.h) +// This particular error code is only currently available in msvc toolchain +pub const EOTHER: ::c_int = 131; + +extern "C" { + #[link_name = "_stricmp"] + pub fn stricmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int; + #[link_name = "_strnicmp"] + pub fn strnicmp(s1: *const ::c_char, s2: *const ::c_char, n: ::size_t) -> ::c_int; + #[link_name = "_memccpy"] + pub fn memccpy( + dest: *mut ::c_void, + src: *const ::c_void, + c: ::c_int, + count: ::size_t, + ) -> *mut ::c_void; +} diff --git a/bash-5.1/vendor/libc/tests/const_fn.rs b/bash-5.1/vendor/libc/tests/const_fn.rs new file mode 100644 index 0000000000000000000000000000000000000000..0e7e1864b9f85233669f98fe99c78f71a755b2e8 --- /dev/null +++ b/bash-5.1/vendor/libc/tests/const_fn.rs @@ -0,0 +1,5 @@ +#![cfg(libc_const_extern_fn)] // If this does not hold, the file is empty + +#[cfg(target_os = "linux")] +const _FOO: libc::c_uint = unsafe { libc::CMSG_SPACE(1) }; +//^ if CMSG_SPACE is not const, this will fail to compile diff --git a/bash-5.1/vendor/libloading/.cargo-checksum.json b/bash-5.1/vendor/libloading/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..611fc27485767402eab3ea8181556afcfc2d2961 --- /dev/null +++ b/bash-5.1/vendor/libloading/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"e46195f62deca2f1fa63c19e754fb9eca0e0469d624e2ff5ac33f9d2bb0c67bf","LICENSE":"b29f8b01452350c20dd1af16ef83b598fea3053578ccc1c7a0ef40e57be2620f","README.mkd":"973a5fa332a8f33abc73ffc0ed509f81c66dbd681d8f50969cac32cdfe16ecb2","src/changelog.rs":"2c7cf7025d8f44a7c145852a0497934ae40d317cdd03de6284e36cd0d4774003","src/error.rs":"156c53e299e8f1cd4694b277a5d92772a8a9e7ec4004bae067367f4c2502de8b","src/lib.rs":"2eebab93230a59cd87c7884e95c91b3a8736c0a76814dd040864b8c25f0d5f9e","src/os/mod.rs":"6c59ef8c1120953ae6b6c32f27766c643ca90d85075c49c3545d2fe1ed82cedd","src/os/unix/consts.rs":"8d0422d6063c617e1a91425da4233f8d83de3667a011cb9e50b10736b9158c50","src/os/unix/mod.rs":"b4bdccdbd0a2f75593cf5355f54b1494a917c58fcb2e76528b8deedf481d65f2","src/os/windows/mod.rs":"c51ca318114dd4ec2e515b3e0539c11c5f1b86ad7fdbe7bc889dd929eee23b30","src/safe.rs":"b0dc1cb5c8e0216e365063b5e84218b2377bb7a62714fca9a6215a22a7bc58b8","src/test_helpers.rs":"201403e143e5b3204864124cd38067cf8813d5273dc1a9099288a9dc4bdd15b6","src/util.rs":"0b6dcfb9eafff2d87966460ef6b1b99980f888813037e787ed92deee602f8c2b","tests/constants.rs":"4778c062605ed22238c1bed16de4c076d0857282f090f36e6d985dafb7b4544d","tests/functions.rs":"57c5b15b679ccee3c0bd8e677dbecb14d1019dd82dc9207aa20b931d915ce39d","tests/library_filename.rs":"b1481f0bb374687c5f24e25113426d2a95f08a45fb8bc41a41e8702bd5a7b4bf","tests/markers.rs":"0ebc8f807b92e39452d35732988012cdca7ce96231c57eaac9c3f4217225ad39","tests/nagisa32.dll":"5c69b2bd9c8a6ad04165c221075fc9fade1dd66ca697399ace528a5a62328e36","tests/nagisa64.dll":"e20b95e3036f3289421abd100760874d4f455afd33c3b5b64fec56b191f7d477","tests/windows.rs":"35584a46658b305cd539712d3ba3c21fe7a130fd693aa1389e4886a67625d532"},"package":"efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd"} \ No newline at end of file diff --git a/bash-5.1/vendor/libloading/Cargo.toml b/bash-5.1/vendor/libloading/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..39b41f3e4e4b78fee6b0bd6a7fc8f6a766403227 --- /dev/null +++ b/bash-5.1/vendor/libloading/Cargo.toml @@ -0,0 +1,36 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +rust-version = "1.40.0" +name = "libloading" +version = "0.7.3" +authors = ["Simonas Kazlauskas "] +description = "Bindings around the platform's dynamic library loading primitives with greatly improved memory safety." +documentation = "https://docs.rs/libloading/" +readme = "README.mkd" +keywords = ["dlopen", "load", "shared", "dylib"] +categories = ["api-bindings"] +license = "ISC" +repository = "https://github.com/nagisa/rust_libloading/" +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "libloading_docs"] +[dev-dependencies.libc] +version = "0.2" + +[dev-dependencies.static_assertions] +version = "1.1" +[target."cfg(unix)".dependencies.cfg-if] +version = "1" +[target."cfg(windows)".dependencies.winapi] +version = "0.3" +features = ["errhandlingapi", "libloaderapi"] diff --git a/bash-5.1/vendor/libloading/LICENSE b/bash-5.1/vendor/libloading/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9137d5607a42844cf2789296ab259304037ee06b --- /dev/null +++ b/bash-5.1/vendor/libloading/LICENSE @@ -0,0 +1,12 @@ +Copyright © 2015, Simonas Kazlauskas + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without +fee is hereby granted, provided that the above copyright notice and this permission notice appear +in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/bash-5.1/vendor/libloading/README.mkd b/bash-5.1/vendor/libloading/README.mkd new file mode 100644 index 0000000000000000000000000000000000000000..66abb30b6ee10430fd65ae1dd171027168dbc996 --- /dev/null +++ b/bash-5.1/vendor/libloading/README.mkd @@ -0,0 +1,13 @@ +# libloading + +Bindings around the platform's dynamic library loading primitives with greatly improved memory safety. The most important safety guarantee of this library is the prevention of dangling `Symbol`s that may occur after a `Library` is unloaded. + +Using this library allows the loading of dynamic libraries, also known as shared libraries, as well as the use of the functions and static variables that these libraries may contain. + +* [Documentation][docs] +* [Changelog][changelog] + +[docs]: https://docs.rs/libloading/ +[changelog]: https://docs.rs/libloading/*/libloading/changelog/index.html + +libloading is available to use under ISC (MIT-like) license. diff --git a/bash-5.1/vendor/libloading/src/changelog.rs b/bash-5.1/vendor/libloading/src/changelog.rs new file mode 100644 index 0000000000000000000000000000000000000000..f8b898e6c6a39908160871afa329aa54ea1b5c40 --- /dev/null +++ b/bash-5.1/vendor/libloading/src/changelog.rs @@ -0,0 +1,325 @@ +//! The change log. + +/// Release 0.7.3 (2022-01-15) +/// +/// This release has no functional changes. +/// +/// In this release the `docsrs` `cfg` has been renamed to `libloading_docs` to better reflect that +/// this `cfg` is intended to be only used by `libloading` and only specifically for the invocation +/// of `rustdoc` when documenting `libloading`. Setting this `cfg` in any other situation is +/// unsupported and will not work. +pub mod r0_7_3 {} + +/// Release 0.7.2 (2021-11-14) +/// +/// Cargo.toml now specifies the MSRV bounds, which enables tooling to report an early failure when +/// the version of the toolchain is insufficient. Refer to the [min-rust-version RFC] and its +/// [tracking issue]. +/// +/// [min-rust-version RFC]: https://rust-lang.github.io/rfcs/2495-min-rust-version.html +/// [tracking issue]: https://github.com/rust-lang/rust/issues/65262 +/// +/// Additionally, on platforms `libloading` has no support (today: `not(any(unix, windows))`), we +/// will no longer attempt to implement the cross-platform `Library` and `Symbol` types. This makes +/// `libloading` compile on targets such as `wasm32-unknown-unknown` and gives ability to the +/// downstream consumers of this library to decide how they want to handle the absence of the +/// library loading implementation in their code. One of such approaches could be depending on +/// `libloading` itself optionally as such: +/// +/// ```toml +/// [target.'cfg(any(unix, windows))'.dependencies.libloading] +/// version = "0.7" +/// ``` +pub mod r0_7_2 {} + +/// Release 0.7.1 (2021-10-09) +/// +/// Significantly improved the consistency and style of the documentation. +pub mod r0_7_1 {} + +/// Release 0.7.0 (2021-02-06) +/// +/// ## Breaking changes +/// +/// ### Loading functions are now `unsafe` +/// +/// A number of associated methods involved in loading a library were changed to +/// be `unsafe`. The affected functions are: [`Library::new`], [`os::unix::Library::new`], +/// [`os::unix::Library::open`], [`os::windows::Library::new`], +/// [`os::windows::Library::load_with_flags`]. This is the most prominent breaking change in this +/// release and affects majority of the users of `libloading`. +/// +/// In order to see why it was necessary, consider the following snippet of C++ code: +/// +/// ```c++ +/// #include +/// #include +/// +/// static std::vector UNSHUU = { 1, 2, 3 }; +/// +/// int main() { +/// std::cout << UNSHUU[0] << UNSHUU[1] << UNSHUU[2] << std::endl; // Prints 123 +/// return 0; +/// } +/// ``` +/// +/// The `std::vector` type, much like in Rust's `Vec`, stores its contents in a buffer allocated on +/// the heap. In this example the vector object itself is stored and initialized as a static +/// variable – a compile time construct. The heap, on the other hand, is a runtime construct. And +/// yet the code works exactly as you'd expect – the vector contains numbers 1, 2 and 3 stored in +/// a buffer on heap. So, _what_ makes it work out, exactly? +/// +/// Various executable and shared library formats define conventions and machinery to execute +/// arbitrary code when a program or a shared library is loaded. On systems using the PE format +/// (e.g. Windows) this is available via the optional `DllMain` initializer. Various systems +/// utilizing the ELF format take a sightly different approach of maintaining an array of function +/// pointers in the `.init_array` section. A very similar mechanism exists on systems that utilize +/// the Mach-O format. +/// +/// For the C++ program above, the object stored in the `UNSHUU` global variable is constructed +/// by code run as part of such an initializer routine. This initializer is run before the entry +/// point (the `main` function) is executed, allowing for this magical behaviour to be possible. +/// Were the C++ code built as a shared library instead, the initialization routines would run as +/// the resulting shared library is loaded. In case of `libloading` – during the call to +/// `Library::new` and other methods affected by this change. +/// +/// These initialization (and very closely related termination) routines can be utilized outside of +/// C++ too. Anybody can build a shared library in variety of different programming languages and +/// set up the initializers to execute arbitrary code. Potentially code that does all sorts of +/// wildly unsound stuff. +/// +/// The routines are executed by components that are an integral part of the operating system. +/// Changing or controlling the operation of these components is infeasible. With that in +/// mind, the initializer and termination routines are something anybody loading a library must +/// carefully evaluate the libraries loaded for soundness. +/// +/// In practice, a vast majority of the libraries can be considered a good citizen and their +/// initialization and termination routines, if they have any at all, can be trusted to be sound. +/// +/// Also see: [issue #86]. +/// +/// ### Better & more consistent default behaviour on UNIX systems +/// +/// On UNIX systems the [`Library::new`], [`os::unix::Library::new`] and +/// [`os::unix::Library::this`] methods have been changed to use +/// [RTLD_LAZY] | [RTLD_LOCAL] as the default set of loader options (previously: +/// [`RTLD_NOW`]). This has a couple benefits. Namely: +/// +/// * Lazy binding is generally quicker to execute when only a subset of symbols from a library are +/// used and is typically the default when neither `RTLD_LAZY` nor `RTLD_NOW` are specified when +/// calling the underlying `dlopen` API; +/// * On most UNIX systems (macOS being a notable exception) `RTLD_LOCAL` is the default when +/// neither `RTLD_LOCAL` nor [`RTLD_GLOBAL`] are specified. The explicit setting of the +/// `RTLD_LOCAL` flag makes this behaviour consistent across platforms. +/// +/// ### Dropped support for Windows XP/Vista +/// +/// The (broken) support for Windows XP and Windows Vista environments was removed. This was +/// prompted primarily by a similar policy change in the [Rust +/// project](https://github.com/rust-lang/compiler-team/issues/378) but also as an acknowledgement +/// to the fact that `libloading` never worked in these environments anyway. +/// +/// ### More accurate error variant names +/// +/// Finally, the `Error::LoadLibraryW` renamed to [`Error::LoadLibraryExW`] to more accurately +/// represent the underlying API that's failing. No functional changes as part of this rename +/// intended. +/// +/// [issue #86]: https://github.com/nagisa/rust_libloading/issues/86 +/// [`Library::new`]: crate::Library::new +/// [`Error::LoadLibraryExW`]: crate::Error::LoadLibraryExW +/// [`os::unix::Library::this`]: crate::os::unix::Library::this +/// [`os::unix::Library::new`]: crate::os::unix::Library::new +/// [`os::unix::Library::open`]: crate::os::unix::Library::new +/// [`os::windows::Library::new`]: crate::os::windows::Library::new +/// [`os::windows::Library::load_with_flags`]: crate::os::windows::Library::load_with_flags +/// [`RTLD_NOW`]: crate::os::unix::RTLD_NOW +/// [RTLD_LAZY]: crate::os::unix::RTLD_LAZY +/// [RTLD_LOCAL]: crate::os::unix::RTLD_LOCAL +/// [`RTLD_GLOBAL`]: crate::os::unix::RTLD_GLOBAL +pub mod r0_7_0 {} + +/// Release 0.6.7 (2021-01-14) +/// +/// * Added a [`os::windows::Library::open_already_loaded`] to obtain a handle to a library that +/// must already be loaded. There is no portable equivalent for all UNIX targets. Users who do not +/// care about portability across UNIX platforms may use [`os::unix::Library::open`] with +/// `libc::RTLD_NOLOAD`; +/// +/// [`os::windows::Library::open_already_loaded`]: crate::os::windows::Library::open_already_loaded +/// [`os::unix::Library::open`]: crate::os::unix::Library::open +pub mod r0_6_7 {} + +/// Release 0.6.6 (2020-12-03) +/// +/// * Fix a double-release of resources when [`Library::close`] or [`os::windows::Library::close`] +/// is used on Windows. +/// +/// [`Library::close`]: crate::Library::close +/// [`os::windows::Library::close`]: crate::os::windows::Library::close +pub mod r0_6_6 {} + +/// Release 0.6.5 (2020-10-23) +/// +/// * Upgrade cfg-if 0.1 to 1.0 +pub mod r0_6_5 {} + +/// Release 0.6.4 (2020-10-10) +/// +/// * Remove use of `build.rs` making it easier to build `libloading` without cargo. It also +/// almost halves the build time of this crate. +pub mod r0_6_4 {} + +/// Release 0.6.3 (2020-08-22) +/// +/// * Improve documentation, allowing to view all of the os-specific functionality from +/// documentation generated for any target; +/// * Add [`os::windows::Library::this`]; +/// * Added constants to use with OS-specific `Library::open`; +/// * Add [`library_filename`]. +/// +/// [`os::windows::Library::this`]: crate::os::windows::Library::this +/// [`library_filename`]: crate::library_filename +pub mod r0_6_3 {} + +/// Release 0.6.2 (2020-05-06) +/// +/// * Fixed building of this library on Illumos. +pub mod r0_6_2 {} + +/// Release 0.6.1 (2020-04-15) +/// +/// * Introduced a new method [`os::windows::Library::load_with_flags`]; +/// * Added support for the Illumos triple. +/// +/// [`os::windows::Library::load_with_flags`]: crate::os::windows::Library::load_with_flags +pub mod r0_6_1 {} + +/// Release 0.6.0 (2020-04-05) +/// +/// * Introduced a new method [`os::unix::Library::get_singlethreaded`]; +/// * Added (untested) support for building when targetting Redox and Fuchsia; +/// * The APIs exposed by this library no longer panic and instead return an `Err` when it used +/// to panic. +/// +/// ## Breaking changes +/// +/// * Minimum required (stable) version of Rust to build this library is now 1.40.0; +/// * This crate now implements a custom [`Error`] type and all APIs now return this type rather +/// than returning the `std::io::Error`; +/// * `libloading::Result` has been removed; +/// * Removed the dependency on the C compiler to build this library on UNIX-like platforms. +/// `libloading` used to utilize a snippet written in C to work-around the unlikely possibility +/// of the target having a thread-unsafe implementation of the `dlerror` function. The effect of +/// the work-around was very opportunistic: it would not work if the function was called by +/// forgoing `libloading`. +/// +/// Starting with 0.6.0, [`Library::get`] on platforms where `dlerror` is not MT-safe (such as +/// FreeBSD, DragonflyBSD or NetBSD) will unconditionally return an error when the underlying +/// `dlsym` returns a null pointer. For the use-cases where loading null pointers is necessary +/// consider using [`os::unix::Library::get_singlethreaded`] instead. +/// +/// [`Library::get`]: crate::Library::get +/// [`os::unix::Library::get_singlethreaded`]: crate::os::unix::Library::get_singlethreaded +/// [`Error`]: crate::Error +pub mod r0_6_0 {} + +/// Release 0.5.2 (2019-07-07) +/// +/// * Added API to convert OS-specific `Library` and `Symbol` conversion to underlying resources. +pub mod r0_5_2 {} + +/// Release 0.5.1 (2019-06-01) +/// +/// * Build on Haiku targets. +pub mod r0_5_1 {} + +/// Release 0.5.0 (2018-01-11) +/// +/// * Update to `winapi = ^0.3`; +/// +/// ## Breaking changes +/// +/// * libloading now requires a C compiler to build on UNIX; +/// * This is a temporary measure until the [`linkage`] attribute is stabilised; +/// * Necessary to resolve [#32]. +/// +/// [`linkage`]: https://github.com/rust-lang/rust/issues/29603 +/// [#32]: https://github.com/nagisa/rust_libloading/issues/32 +pub mod r0_5_0 {} + +/// Release 0.4.3 (2017-12-07) +/// +/// * Bump lazy-static dependency to `^1.0`; +/// * `cargo test --release` now works when testing libloading. +pub mod r0_4_3 {} + +/// Release 0.4.2 (2017-09-24) +/// +/// * Improved error and race-condition handling on Windows; +/// * Improved documentation about thread-safety of Library; +/// * Added `Symbol::::lift_option() -> Option>` convenience method. +pub mod r0_4_2 {} + +/// Release 0.4.1 (2017-08-29) +/// +/// * Solaris support +pub mod r0_4_1 {} + +/// Release 0.4.0 (2017-05-01) +/// +/// * Remove build-time dependency on target_build_utils (and by extension serde/phf); +/// * Require at least version 1.14.0 of rustc to build; +/// * Actually, it is cargo which has to be more recent here. The one shipped with rustc 1.14.0 +/// is what’s being required from now on. +pub mod r0_4_0 {} + +/// Release 0.3.4 (2017-03-25) +/// +/// * Remove rogue println! +pub mod r0_3_4 {} + +/// Release 0.3.3 (2017-03-25) +/// +/// * Panics when `Library::get` is called for incompatibly sized type such as named function +/// types (which are zero-sized). +pub mod r0_3_3 {} + +/// Release 0.3.2 (2017-02-10) +/// +/// * Minimum version required is now rustc 1.12.0; +/// * Updated dependency versions (most notably target_build_utils to 0.3.0) +pub mod r0_3_2 {} + +/// Release 0.3.1 (2016-10-01) +/// +/// * `Symbol` and `os::*::Symbol` now implement `Send` where `T: Send`; +/// * `Symbol` and `os::*::Symbol` now implement `Sync` where `T: Sync`; +/// * `Library` and `os::*::Library` now implement `Sync` (they were `Send` in 0.3.0 already). +pub mod r0_3_1 {} + +/// Release 0.3.0 (2016-07-27) +/// +/// * Greatly improved documentation, especially around platform-specific behaviours; +/// * Improved test suite by building our own library to test against; +/// * All `Library`-ies now implement `Send`. +/// * Added `impl From for Library` and `impl From for +/// os::platform::Library` allowing wrapping and extracting the platform-specific library handle; +/// * Added methods to wrap (`Symbol::from_raw`) and unwrap (`Symbol::into_raw`) the safe `Symbol` +/// wrapper into unsafe `os::platform::Symbol`. +/// +/// The last two additions focus on not restricting potential usecases of this library, allowing +/// users of the library to circumvent safety checks if need be. +/// +/// ## Breaking Changes +/// +/// `Library::new` defaults to `RTLD_NOW` instead of `RTLD_LAZY` on UNIX for more consistent +/// cross-platform behaviour. If a library loaded with `Library::new` had any linking errors, but +/// unresolved references weren’t forced to be resolved, the library would’ve “just worked”, +/// whereas now the call to `Library::new` will return an error signifying presence of such error. +/// +/// ## os::platform +/// * Added `os::unix::Library::open` which allows specifying arbitrary flags (e.g. `RTLD_LAZY`); +/// * Added `os::windows::Library::get_ordinal` which allows finding a function or variable by its +/// ordinal number; +pub mod r0_3_0 {} diff --git a/bash-5.1/vendor/libloading/src/error.rs b/bash-5.1/vendor/libloading/src/error.rs new file mode 100644 index 0000000000000000000000000000000000000000..bd70ec39ce21e75308fd67890a8d6ce3328f55cf --- /dev/null +++ b/bash-5.1/vendor/libloading/src/error.rs @@ -0,0 +1,130 @@ +use std::ffi::CString; + +/// A `dlerror` error. +pub struct DlDescription(pub(crate) CString); + +impl std::fmt::Debug for DlDescription { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + std::fmt::Debug::fmt(&self.0, f) + } +} + +/// A Windows API error. +pub struct WindowsError(pub(crate) std::io::Error); + +impl std::fmt::Debug for WindowsError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + std::fmt::Debug::fmt(&self.0, f) + } +} + +/// Errors. +#[derive(Debug)] +#[non_exhaustive] +pub enum Error { + /// The `dlopen` call failed. + DlOpen { + /// The source error. + desc: DlDescription + }, + /// The `dlopen` call failed and system did not report an error. + DlOpenUnknown, + /// The `dlsym` call failed. + DlSym { + /// The source error. + desc: DlDescription + }, + /// The `dlsym` call failed and system did not report an error. + DlSymUnknown, + /// The `dlclose` call failed. + DlClose { + /// The source error. + desc: DlDescription + }, + /// The `dlclose` call failed and system did not report an error. + DlCloseUnknown, + /// The `LoadLibraryW` call failed. + LoadLibraryExW { + /// The source error. + source: WindowsError + }, + /// The `LoadLibraryW` call failed and system did not report an error. + LoadLibraryExWUnknown, + /// The `GetModuleHandleExW` call failed. + GetModuleHandleExW { + /// The source error. + source: WindowsError + }, + /// The `GetModuleHandleExW` call failed and system did not report an error. + GetModuleHandleExWUnknown, + /// The `GetProcAddress` call failed. + GetProcAddress { + /// The source error. + source: WindowsError + }, + /// The `GetProcAddressUnknown` call failed and system did not report an error. + GetProcAddressUnknown, + /// The `FreeLibrary` call failed. + FreeLibrary { + /// The source error. + source: WindowsError + }, + /// The `FreeLibrary` call failed and system did not report an error. + FreeLibraryUnknown, + /// The requested type cannot possibly work. + IncompatibleSize, + /// Could not create a new CString. + CreateCString { + /// The source error. + source: std::ffi::NulError + }, + /// Could not create a new CString from bytes with trailing null. + CreateCStringWithTrailing { + /// The source error. + source: std::ffi::FromBytesWithNulError + }, +} + +impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + use Error::*; + match *self { + CreateCString { ref source } => Some(source), + CreateCStringWithTrailing { ref source } => Some(source), + LoadLibraryExW { ref source } => Some(&source.0), + GetProcAddress { ref source } => Some(&source.0), + FreeLibrary { ref source } => Some(&source.0), + _ => None, + } + } +} + +impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + use Error::*; + match *self { + DlOpen { ref desc } => write!(f, "{}", desc.0.to_string_lossy()), + DlOpenUnknown => write!(f, "dlopen failed, but system did not report the error"), + DlSym { ref desc } => write!(f, "{}", desc.0.to_string_lossy()), + DlSymUnknown => write!(f, "dlsym failed, but system did not report the error"), + DlClose { ref desc } => write!(f, "{}", desc.0.to_string_lossy()), + DlCloseUnknown => write!(f, "dlclose failed, but system did not report the error"), + LoadLibraryExW { .. } => write!(f, "LoadLibraryExW failed"), + LoadLibraryExWUnknown => + write!(f, "LoadLibraryExW failed, but system did not report the error"), + GetModuleHandleExW { .. } => write!(f, "GetModuleHandleExW failed"), + GetModuleHandleExWUnknown => + write!(f, "GetModuleHandleExWUnknown failed, but system did not report the error"), + GetProcAddress { .. } => write!(f, "GetProcAddress failed"), + GetProcAddressUnknown => + write!(f, "GetProcAddress failed, but system did not report the error"), + FreeLibrary { .. } => write!(f, "FreeLibrary failed"), + FreeLibraryUnknown => + write!(f, "FreeLibrary failed, but system did not report the error"), + CreateCString { .. } => write!(f, "could not create a C string from bytes"), + CreateCStringWithTrailing { .. } => + write!(f, "could not create a C string from bytes with trailing null"), + IncompatibleSize => write!(f, "requested type cannot possibly work"), + } + } +} diff --git a/bash-5.1/vendor/libloading/src/lib.rs b/bash-5.1/vendor/libloading/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..6f0e4cb7f78223e9e2ad4a5f702c12cdb75318e8 --- /dev/null +++ b/bash-5.1/vendor/libloading/src/lib.rs @@ -0,0 +1,80 @@ +//! Bindings around the platform's dynamic library loading primitives with greatly improved memory safety. +//! +//! Using this library allows the loading of [dynamic libraries](struct.Library.html), also known as +//! shared libraries, and the use of the functions and static variables they contain. +//! +//! The `libloading` crate exposes a cross-platform interface to load a library and make use of its +//! contents, but little is done to hide the differences in behaviour between platforms. +//! The API documentation strives to document such differences as much as possible. +//! +//! Platform-specific APIs are also available in the [`os`](crate::os) module. These APIs are more +//! flexible, but less safe. +//! +//! # Installation +//! +//! Add the `libloading` library to your dependencies in `Cargo.toml`: +//! +//! ```toml +//! [dependencies] +//! libloading = "0.7" +//! ``` +//! +//! # Usage +//! +//! In your code, run the following: +//! +//! ```no_run +//! fn call_dynamic() -> Result> { +//! unsafe { +//! let lib = libloading::Library::new("/path/to/liblibrary.so")?; +//! let func: libloading::Symbol u32> = lib.get(b"my_func")?; +//! Ok(func()) +//! } +//! } +//! ``` +//! +//! The compiler will ensure that the loaded function will not outlive the `Library` from which it comes, +//! preventing the most common memory-safety issues. +#![cfg_attr(any(unix, windows), deny(missing_docs, clippy::all, unreachable_pub, unused))] +#![cfg_attr(libloading_docs, feature(doc_cfg))] + +pub mod changelog; +pub mod os; +mod util; + +mod error; +pub use self::error::Error; + +#[cfg(any(unix, windows, libloading_docs))] +mod safe; +#[cfg(any(unix, windows, libloading_docs))] +pub use self::safe::{Library, Symbol}; + +use std::env::consts::{DLL_PREFIX, DLL_SUFFIX}; +use std::ffi::{OsStr, OsString}; + +/// Converts a library name to a filename generally appropriate for use on the system. +/// +/// This function will prepend prefixes (such as `lib`) and suffixes (such as `.so`) to the library +/// `name` to construct the filename. +/// +/// # Examples +/// +/// It can be used to load global libraries in a platform independent manner: +/// +/// ``` +/// use libloading::{Library, library_filename}; +/// // Will attempt to load `libLLVM.so` on Linux, `libLLVM.dylib` on macOS and `LLVM.dll` on +/// // Windows. +/// let library = unsafe { +/// Library::new(library_filename("LLVM")) +/// }; +/// ``` +pub fn library_filename>(name: S) -> OsString { + let name = name.as_ref(); + let mut string = OsString::with_capacity(name.len() + DLL_PREFIX.len() + DLL_SUFFIX.len()); + string.push(DLL_PREFIX); + string.push(name); + string.push(DLL_SUFFIX); + string +} diff --git a/bash-5.1/vendor/libloading/src/os/mod.rs b/bash-5.1/vendor/libloading/src/os/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..710353f5ef385206815df65eeabfddab71010513 --- /dev/null +++ b/bash-5.1/vendor/libloading/src/os/mod.rs @@ -0,0 +1,27 @@ +//! Unsafe but flexible platform-specific bindings to dynamic library loading facilities. +//! +//! These modules expose more extensive and powerful bindings to the dynamic +//! library loading facilities. Use of these bindings come at the cost of less (in most cases, +//! none at all) safety guarantees, which are provided by the top-level bindings. +//! +//! # Examples +//! +//! Using these modules will likely involve conditional compilation: +//! +//! ```ignore +//! # extern crate libloading; +//! #[cfg(unix)] +//! use libloading::os::unix::*; +//! #[cfg(windows)] +//! use libloading::os::windows::*; +//! ``` + +/// UNIX implementation of dynamic library loading. +#[cfg(any(unix, libloading_docs))] +#[cfg_attr(libloading_docs, doc(cfg(unix)))] +pub mod unix; + +/// Windows implementation of dynamic library loading. +#[cfg(any(windows, libloading_docs))] +#[cfg_attr(libloading_docs, doc(cfg(windows)))] +pub mod windows; diff --git a/bash-5.1/vendor/libloading/src/os/unix/consts.rs b/bash-5.1/vendor/libloading/src/os/unix/consts.rs new file mode 100644 index 0000000000000000000000000000000000000000..dbe4df972b7c1e441eae1d73ee62e4039ebba73b --- /dev/null +++ b/bash-5.1/vendor/libloading/src/os/unix/consts.rs @@ -0,0 +1,230 @@ +use std::os::raw::c_int; + +/// Perform lazy binding. +/// +/// Relocations shall be performed at an implementation-defined time, ranging from the time +/// of the [`Library::open`] call until the first reference to a given symbol occurs. +/// Specifying `RTLD_LAZY` should improve performance on implementations supporting dynamic +/// symbol binding since a process might not reference all of the symbols in an executable +/// object file. And, for systems supporting dynamic symbol resolution for normal process +/// execution, this behaviour mimics the normal handling of process execution. +/// +/// Conflicts with [`RTLD_NOW`]. +/// +/// [`Library::open`]: crate::os::unix::Library::open +pub const RTLD_LAZY: c_int = posix::RTLD_LAZY; + +/// Perform eager binding. +/// +/// All necessary relocations shall be performed when the executable object file is first +/// loaded. This may waste some processing if relocations are performed for symbols +/// that are never referenced. This behaviour may be useful for applications that need to +/// know that all symbols referenced during execution will be available before +/// [`Library::open`] returns. +/// +/// Conflicts with [`RTLD_LAZY`]. +/// +/// [`Library::open`]: crate::os::unix::Library::open +pub const RTLD_NOW: c_int = posix::RTLD_NOW; + +/// Make loaded symbols available for resolution globally. +/// +/// The executable object file's symbols shall be made available for relocation processing of any +/// other executable object file. In addition, calls to [`Library::get`] on `Library` obtained from +/// [`Library::this`] allows executable object files loaded with this mode to be searched. +/// +/// [`Library::this`]: crate::os::unix::Library::this +/// [`Library::get`]: crate::os::unix::Library::get +pub const RTLD_GLOBAL: c_int = posix::RTLD_GLOBAL; + +/// Load symbols into an isolated namespace. +/// +/// The executable object file's symbols shall not be made available for relocation processing of +/// any other executable object file. This mode of operation is most appropriate for e.g. plugins. +pub const RTLD_LOCAL: c_int = posix::RTLD_LOCAL; + +#[cfg(all(libloading_docs, not(unix)))] +mod posix { + use super::c_int; + pub(super) const RTLD_LAZY: c_int = !0; + pub(super) const RTLD_NOW: c_int = !0; + pub(super) const RTLD_GLOBAL: c_int = !0; + pub(super) const RTLD_LOCAL: c_int = !0; +} + +#[cfg(any(not(libloading_docs), unix))] +mod posix { + extern crate cfg_if; + use self::cfg_if::cfg_if; + use super::c_int; + cfg_if! { + if #[cfg(target_os = "haiku")] { + pub(super) const RTLD_LAZY: c_int = 0; + } else if #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd", + target_os = "netbsd", + + target_os = "solaris", + target_os = "illumos", + + target_env = "uclibc", + target_env = "newlib", + + target_os = "fuchsia", + target_os = "redox", + ))] { + pub(super) const RTLD_LAZY: c_int = 1; + } else { + compile_error!( + "Target has no known `RTLD_LAZY` value. Please submit an issue or PR adding it." + ); + } + } + + cfg_if! { + if #[cfg(target_os = "haiku")] { + pub(super) const RTLD_NOW: c_int = 1; + } else if #[cfg(any( + target_os = "linux", + all(target_os = "android", target_pointer_width = "64"), + target_os = "emscripten", + + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd", + target_os = "netbsd", + + target_os = "solaris", + target_os = "illumos", + + target_env = "uclibc", + target_env = "newlib", + + target_os = "fuchsia", + target_os = "redox", + ))] { + pub(super) const RTLD_NOW: c_int = 2; + } else if #[cfg(all(target_os = "android",target_pointer_width = "32"))] { + pub(super) const RTLD_NOW: c_int = 0; + } else { + compile_error!( + "Target has no known `RTLD_NOW` value. Please submit an issue or PR adding it." + ); + } + } + + cfg_if! { + if #[cfg(any( + target_os = "haiku", + all(target_os = "android",target_pointer_width = "32"), + ))] { + pub(super) const RTLD_GLOBAL: c_int = 2; + } else if #[cfg(any( + target_env = "uclibc", + all(target_os = "linux", target_arch = "mips"), + all(target_os = "linux", target_arch = "mips64"), + ))] { + pub(super) const RTLD_GLOBAL: c_int = 4; + } else if #[cfg(any( + target_os = "macos", + target_os = "ios", + ))] { + pub(super) const RTLD_GLOBAL: c_int = 8; + } else if #[cfg(any( + target_os = "linux", + all(target_os = "android", target_pointer_width = "64"), + target_os = "emscripten", + + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd", + target_os = "netbsd", + + target_os = "solaris", + target_os = "illumos", + + target_env = "newlib", + + target_os = "fuchsia", + target_os = "redox", + ))] { + pub(super) const RTLD_GLOBAL: c_int = 0x100; + } else { + compile_error!( + "Target has no known `RTLD_GLOBAL` value. Please submit an issue or PR adding it." + ); + } + } + + cfg_if! { + if #[cfg(target_os = "netbsd")] { + pub(super) const RTLD_LOCAL: c_int = 0x200; + } else if #[cfg(any( + target_os = "macos", + target_os = "ios", + ))] { + pub(super) const RTLD_LOCAL: c_int = 4; + } else if #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd", + + target_os = "haiku", + + target_os = "solaris", + target_os = "illumos", + + target_env = "uclibc", + target_env = "newlib", + + target_os = "fuchsia", + target_os = "redox", + ))] { + pub(super) const RTLD_LOCAL: c_int = 0; + } else { + compile_error!( + "Target has no known `RTLD_LOCAL` value. Please submit an issue or PR adding it." + ); + } + } +} + +// Other constants that exist but are not bound because they are platform-specific (non-posix) +// extensions. Some of these constants are only relevant to `dlsym` or `dlmopen` calls. +// +// RTLD_CONFGEN +// RTLD_DEFAULT +// RTLD_DI_CONFIGADDR +// RTLD_DI_LINKMAP +// RTLD_DI_LMID +// RTLD_DI_ORIGIN +// RTLD_DI_PROFILENAME +// RTLD_DI_PROFILEOUT +// RTLD_DI_SERINFO +// RTLD_DI_SERINFOSIZE +// RTLD_DI_TLS_DATA +// RTLD_DI_TLS_MODID +// RTLD_FIRST +// RTLD_GROUP +// RTLD_NEXT +// RTLD_PARENT +// RTLD_PROBE +// RTLD_SELF +// RTLD_WORLD +// RTLD_NODELETE +// RTLD_NOLOAD +// RTLD_DEEPBIND diff --git a/bash-5.1/vendor/libloading/src/os/unix/mod.rs b/bash-5.1/vendor/libloading/src/os/unix/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..fd0777eab115c2baa7b17284456dc2f3b99923ba --- /dev/null +++ b/bash-5.1/vendor/libloading/src/os/unix/mod.rs @@ -0,0 +1,446 @@ +// A hack for docs.rs to build documentation that has both windows and linux documentation in the +// same rustdoc build visible. +#[cfg(all(libloading_docs, not(unix)))] +mod unix_imports {} +#[cfg(any(not(libloading_docs), unix))] +mod unix_imports { + pub(super) use std::os::unix::ffi::OsStrExt; +} + +pub use self::consts::*; +use self::unix_imports::*; +use std::ffi::{CStr, OsStr}; +use std::os::raw; +use std::{fmt, marker, mem, ptr}; +use util::{cstr_cow_from_bytes, ensure_compatible_types}; + +mod consts; + +// dl* family of functions did not have enough thought put into it. +// +// Whole error handling scheme is done via setting and querying some global state, therefore it is +// not safe to use dynamic library loading in MT-capable environment at all. Only in POSIX 2008+TC1 +// a thread-local state was allowed for `dlerror`, making the dl* family of functions MT-safe. +// +// In practice (as of 2020-04-01) most of the widely used targets use a thread-local for error +// state and have been doing so for a long time. Regardless the comments in this function shall +// remain as a documentation for the future generations. +fn with_dlerror(wrap: fn(crate::error::DlDescription) -> crate::Error, closure: F) +-> Result> +where F: FnOnce() -> Option { + // We used to guard all uses of dl* functions with our own mutex. This made them safe to use in + // MT programs provided the only way a program used dl* was via this library. However, it also + // had a number of downsides or cases where it failed to handle the problems. For instance, + // if any other library called `dlerror` internally concurrently with `libloading` things would + // still go awry. + // + // On platforms where `dlerror` is still MT-unsafe, `dlsym` (`Library::get`) can spuriously + // succeed and return a null pointer for a symbol when the actual symbol look-up operation + // fails. Instances where the actual symbol _could_ be `NULL` are platform specific. For + // instance on GNU glibc based-systems (an excerpt from dlsym(3)): + // + // > The value of a symbol returned by dlsym() will never be NULL if the shared object is the + // > result of normal compilation, since a global symbol is never placed at the NULL + // > address. There are nevertheless cases where a lookup using dlsym() may return NULL as the + // > value of a symbol. For example, the symbol value may be the result of a GNU indirect + // > function (IFUNC) resolver function that returns NULL as the resolved value. + + // While we could could call `dlerror` here to clear the previous error value, only the `dlsym` + // call depends on it being cleared beforehand and only in some cases too. We will instead + // clear the error inside the dlsym binding instead. + // + // In all the other cases, clearing the error here will only be hiding misuse of these bindings + // or a bug in implementation of dl* family of functions. + closure().ok_or_else(|| unsafe { + // This code will only get executed if the `closure` returns `None`. + let error = dlerror(); + if error.is_null() { + // In non-dlsym case this may happen when there’re bugs in our bindings or there’s + // non-libloading user of libdl; possibly in another thread. + None + } else { + // You can’t even rely on error string being static here; call to subsequent dlerror + // may invalidate or overwrite the error message. Why couldn’t they simply give up the + // ownership over the message? + // TODO: should do locale-aware conversion here. OTOH Rust doesn’t seem to work well in + // any system that uses non-utf8 locale, so I doubt there’s a problem here. + let message = CStr::from_ptr(error).into(); + Some(wrap(crate::error::DlDescription(message))) + // Since we do a copy of the error string above, maybe we should call dlerror again to + // let libdl know it may free its copy of the string now? + } + }) +} + +/// A platform-specific counterpart of the cross-platform [`Library`](crate::Library). +pub struct Library { + handle: *mut raw::c_void +} + +unsafe impl Send for Library {} + +// That being said... this section in the volume 2 of POSIX.1-2008 states: +// +// > All functions defined by this volume of POSIX.1-2008 shall be thread-safe, except that the +// > following functions need not be thread-safe. +// +// With notable absence of any dl* function other than dlerror in the list. By “this volume” +// I suppose they refer precisely to the “volume 2”. dl* family of functions are specified +// by this same volume, so the conclusion is indeed that dl* functions are required by POSIX +// to be thread-safe. Great! +// +// See for more details: +// +// * https://github.com/nagisa/rust_libloading/pull/17 +// * http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_01 +unsafe impl Sync for Library {} + +impl Library { + /// Find and eagerly load a shared library (module). + /// + /// If the `filename` contains a [path separator], the `filename` is interpreted as a `path` to + /// a file. Otherwise, platform-specific algorithms are employed to find a library with a + /// matching file name. + /// + /// This is equivalent to [Library::open](filename, [RTLD_LAZY] | [RTLD_LOCAL]). + /// + /// [path separator]: std::path::MAIN_SEPARATOR + /// + /// # Safety + /// + /// When a library is loaded, initialisation routines contained within the library are executed. + /// For the purposes of safety, the execution of these routines is conceptually the same calling an + /// unknown foreign function and may impose arbitrary requirements on the caller for the call + /// to be sound. + /// + /// Additionally, the callers of this function must also ensure that execution of the + /// termination routines contained within the library is safe as well. These routines may be + /// executed when the library is unloaded. + #[inline] + pub unsafe fn new>(filename: P) -> Result { + Library::open(Some(filename), RTLD_LAZY | RTLD_LOCAL) + } + + /// Load the `Library` representing the current executable. + /// + /// [`Library::get`] calls of the returned `Library` will look for symbols in following + /// locations in order: + /// + /// 1. The original program image; + /// 2. Any executable object files (e.g. shared libraries) loaded at program startup; + /// 3. Any executable object files loaded at runtime (e.g. via other `Library::new` calls or via + /// calls to the `dlopen` function). + /// + /// Note that the behaviour of a `Library` loaded with this method is different from that of + /// Libraries loaded with [`os::windows::Library::this`]. + /// + /// This is equivalent to [Library::open](None, [RTLD_LAZY] | [RTLD_LOCAL]). + /// + /// [`os::windows::Library::this`]: crate::os::windows::Library::this + #[inline] + pub fn this() -> Library { + unsafe { + // SAFE: this does not load any new shared library images, no danger in it executing + // initialiser routines. + Library::open(None::<&OsStr>, RTLD_LAZY | RTLD_LOCAL).expect("this should never fail") + } + } + + /// Find and load an executable object file (shared library). + /// + /// See documentation for [`Library::this`] for further description of the behaviour + /// when the `filename` is `None`. Otherwise see [`Library::new`]. + /// + /// Corresponds to `dlopen(filename, flags)`. + /// + /// # Safety + /// + /// When a library is loaded, initialisation routines contained within the library are executed. + /// For the purposes of safety, the execution of these routines is conceptually the same calling an + /// unknown foreign function and may impose arbitrary requirements on the caller for the call + /// to be sound. + /// + /// Additionally, the callers of this function must also ensure that execution of the + /// termination routines contained within the library is safe as well. These routines may be + /// executed when the library is unloaded. + pub unsafe fn open

(filename: Option

, flags: raw::c_int) -> Result + where P: AsRef { + let filename = match filename { + None => None, + Some(ref f) => Some(cstr_cow_from_bytes(f.as_ref().as_bytes())?), + }; + with_dlerror(|desc| crate::Error::DlOpen { desc }, move || { + let result = dlopen(match filename { + None => ptr::null(), + Some(ref f) => f.as_ptr() + }, flags); + // ensure filename lives until dlopen completes + drop(filename); + if result.is_null() { + None + } else { + Some(Library { + handle: result + }) + } + }).map_err(|e| e.unwrap_or(crate::Error::DlOpenUnknown)) + } + + unsafe fn get_impl(&self, symbol: &[u8], on_null: F) -> Result, crate::Error> + where F: FnOnce() -> Result, crate::Error> + { + ensure_compatible_types::()?; + let symbol = cstr_cow_from_bytes(symbol)?; + // `dlsym` may return nullptr in two cases: when a symbol genuinely points to a null + // pointer or the symbol cannot be found. In order to detect this case a double dlerror + // pattern must be used, which is, sadly, a little bit racy. + // + // We try to leave as little space as possible for this to occur, but we can’t exactly + // fully prevent it. + match with_dlerror(|desc| crate::Error::DlSym { desc }, || { + dlerror(); + let symbol = dlsym(self.handle, symbol.as_ptr()); + if symbol.is_null() { + None + } else { + Some(Symbol { + pointer: symbol, + pd: marker::PhantomData + }) + } + }) { + Err(None) => on_null(), + Err(Some(e)) => Err(e), + Ok(x) => Ok(x) + } + + } + + /// Get a pointer to a function or static variable by symbol name. + /// + /// The `symbol` may not contain any null bytes, with the exception of the last byte. Providing a + /// null terminated `symbol` may help to avoid an allocation. + /// + /// Symbol is interpreted as-is; no mangling is done. This means that symbols like `x::y` are + /// most likely invalid. + /// + /// # Safety + /// + /// Users of this API must specify the correct type of the function or variable loaded. Using a + /// `Symbol` with a wrong type is undefined. + /// + /// # Platform-specific behaviour + /// + /// Implementation of thread local variables is extremely platform specific and uses of such + /// variables that work on e.g. Linux may have unintended behaviour on other targets. + /// + /// On POSIX implementations where the `dlerror` function is not confirmed to be MT-safe (such + /// as FreeBSD), this function will unconditionally return an error when the underlying `dlsym` + /// call returns a null pointer. There are rare situations where `dlsym` returns a genuine null + /// pointer without it being an error. If loading a null pointer is something you care about, + /// consider using the [`Library::get_singlethreaded`] call. + #[inline(always)] + pub unsafe fn get(&self, symbol: &[u8]) -> Result, crate::Error> { + extern crate cfg_if; + cfg_if::cfg_if! { + // These targets are known to have MT-safe `dlerror`. + if #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "openbsd", + target_os = "macos", + target_os = "ios", + target_os = "solaris", + target_os = "illumos", + target_os = "redox", + target_os = "fuchsia" + ))] { + self.get_singlethreaded(symbol) + } else { + self.get_impl(symbol, || Err(crate::Error::DlSymUnknown)) + } + } + } + + /// Get a pointer to function or static variable by symbol name. + /// + /// The `symbol` may not contain any null bytes, with the exception of the last byte. Providing a + /// null terminated `symbol` may help to avoid an allocation. + /// + /// Symbol is interpreted as-is; no mangling is done. This means that symbols like `x::y` are + /// most likely invalid. + /// + /// # Safety + /// + /// Users of this API must specify the correct type of the function or variable loaded. + /// + /// It is up to the user of this library to ensure that no other calls to an MT-unsafe + /// implementation of `dlerror` occur during the execution of this function. Failing that, the + /// behaviour of this function is not defined. + /// + /// # Platform-specific behaviour + /// + /// The implementation of thread-local variables is extremely platform specific and uses of such + /// variables that work on e.g. Linux may have unintended behaviour on other targets. + #[inline(always)] + pub unsafe fn get_singlethreaded(&self, symbol: &[u8]) -> Result, crate::Error> { + self.get_impl(symbol, || Ok(Symbol { + pointer: ptr::null_mut(), + pd: marker::PhantomData + })) + } + + /// Convert the `Library` to a raw handle. + /// + /// The handle returned by this function shall be usable with APIs which accept handles + /// as returned by `dlopen`. + pub fn into_raw(self) -> *mut raw::c_void { + let handle = self.handle; + mem::forget(self); + handle + } + + /// Convert a raw handle returned by `dlopen`-family of calls to a `Library`. + /// + /// # Safety + /// + /// The pointer shall be a result of a successful call of the `dlopen`-family of functions or a + /// pointer previously returned by `Library::into_raw` call. It must be valid to call `dlclose` + /// with this pointer as an argument. + pub unsafe fn from_raw(handle: *mut raw::c_void) -> Library { + Library { + handle + } + } + + /// Unload the library. + /// + /// This method might be a no-op, depending on the flags with which the `Library` was opened, + /// what library was opened or other platform specifics. + /// + /// You only need to call this if you are interested in handling any errors that may arise when + /// library is unloaded. Otherwise the implementation of `Drop` for `Library` will close the + /// library and ignore the errors were they arise. + /// + /// The underlying data structures may still get leaked if an error does occur. + pub fn close(self) -> Result<(), crate::Error> { + let result = with_dlerror(|desc| crate::Error::DlClose { desc }, || { + if unsafe { dlclose(self.handle) } == 0 { + Some(()) + } else { + None + } + }).map_err(|e| e.unwrap_or(crate::Error::DlCloseUnknown)); + // While the library is not free'd yet in case of an error, there is no reason to try + // dropping it again, because all that will do is try calling `dlclose` again. only + // this time it would ignore the return result, which we already seen failing… + std::mem::forget(self); + result + } +} + +impl Drop for Library { + fn drop(&mut self) { + unsafe { + dlclose(self.handle); + } + } +} + +impl fmt::Debug for Library { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&format!("Library@{:p}", self.handle)) + } +} + +/// Symbol from a library. +/// +/// A major difference compared to the cross-platform `Symbol` is that this does not ensure that the +/// `Symbol` does not outlive the `Library` it comes from. +pub struct Symbol { + pointer: *mut raw::c_void, + pd: marker::PhantomData +} + +impl Symbol { + /// Convert the loaded `Symbol` into a raw pointer. + pub fn into_raw(self) -> *mut raw::c_void { + let pointer = self.pointer; + mem::forget(self); + pointer + } +} + +impl Symbol> { + /// Lift Option out of the symbol. + pub fn lift_option(self) -> Option> { + if self.pointer.is_null() { + None + } else { + Some(Symbol { + pointer: self.pointer, + pd: marker::PhantomData, + }) + } + } +} + +unsafe impl Send for Symbol {} +unsafe impl Sync for Symbol {} + +impl Clone for Symbol { + fn clone(&self) -> Symbol { + Symbol { ..*self } + } +} + +impl ::std::ops::Deref for Symbol { + type Target = T; + fn deref(&self) -> &T { + unsafe { + // Additional reference level for a dereference on `deref` return value. + &*(&self.pointer as *const *mut _ as *const T) + } + } +} + +impl fmt::Debug for Symbol { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + unsafe { + let mut info = mem::MaybeUninit::::uninit(); + if dladdr(self.pointer, info.as_mut_ptr()) != 0 { + let info = info.assume_init(); + if info.dli_sname.is_null() { + f.write_str(&format!("Symbol@{:p} from {:?}", + self.pointer, + CStr::from_ptr(info.dli_fname))) + } else { + f.write_str(&format!("Symbol {:?}@{:p} from {:?}", + CStr::from_ptr(info.dli_sname), self.pointer, + CStr::from_ptr(info.dli_fname))) + } + } else { + f.write_str(&format!("Symbol@{:p}", self.pointer)) + } + } + } +} + +// Platform specific things +#[cfg_attr(any(target_os = "linux", target_os = "android"), link(name="dl"))] +#[cfg_attr(any(target_os = "freebsd", target_os = "dragonfly"), link(name="c"))] +extern { + fn dlopen(filename: *const raw::c_char, flags: raw::c_int) -> *mut raw::c_void; + fn dlclose(handle: *mut raw::c_void) -> raw::c_int; + fn dlsym(handle: *mut raw::c_void, symbol: *const raw::c_char) -> *mut raw::c_void; + fn dlerror() -> *mut raw::c_char; + fn dladdr(addr: *mut raw::c_void, info: *mut DlInfo) -> raw::c_int; +} + +#[repr(C)] +struct DlInfo { + dli_fname: *const raw::c_char, + dli_fbase: *mut raw::c_void, + dli_sname: *const raw::c_char, + dli_saddr: *mut raw::c_void +} diff --git a/bash-5.1/vendor/libloading/src/os/windows/mod.rs b/bash-5.1/vendor/libloading/src/os/windows/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..eadeb6980ffa47b9ec3e63670dcb68379995da4f --- /dev/null +++ b/bash-5.1/vendor/libloading/src/os/windows/mod.rs @@ -0,0 +1,534 @@ +// A hack for docs.rs to build documentation that has both windows and linux documentation in the +// same rustdoc build visible. +#[cfg(all(libloading_docs, not(windows)))] +mod windows_imports { + pub(super) enum WORD {} + pub(super) struct DWORD; + pub(super) enum HMODULE {} + pub(super) enum FARPROC {} + + pub(super) mod consts { + use super::DWORD; + pub(crate) const LOAD_IGNORE_CODE_AUTHZ_LEVEL: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_AS_DATAFILE: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_AS_IMAGE_RESOURCE: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SEARCH_SYSTEM32: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SEARCH_USER_DIRS: DWORD = DWORD; + pub(crate) const LOAD_WITH_ALTERED_SEARCH_PATH: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_REQUIRE_SIGNED_TARGET: DWORD = DWORD; + pub(crate) const LOAD_LIBRARY_SAFE_CURRENT_DIRS: DWORD = DWORD; + } +} +#[cfg(any(not(libloading_docs), windows))] +mod windows_imports { + extern crate winapi; + pub(super) use self::winapi::shared::minwindef::{WORD, DWORD, HMODULE, FARPROC}; + pub(super) use self::winapi::shared::ntdef::WCHAR; + pub(super) use self::winapi::um::{errhandlingapi, libloaderapi}; + pub(super) use std::os::windows::ffi::{OsStrExt, OsStringExt}; + pub(super) const SEM_FAILCE: DWORD = 1; + + pub(super) mod consts { + pub(crate) use super::winapi::um::libloaderapi::{ + LOAD_IGNORE_CODE_AUTHZ_LEVEL, + LOAD_LIBRARY_AS_DATAFILE, + LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE, + LOAD_LIBRARY_AS_IMAGE_RESOURCE, + LOAD_LIBRARY_SEARCH_APPLICATION_DIR, + LOAD_LIBRARY_SEARCH_DEFAULT_DIRS, + LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, + LOAD_LIBRARY_SEARCH_SYSTEM32, + LOAD_LIBRARY_SEARCH_USER_DIRS, + LOAD_WITH_ALTERED_SEARCH_PATH, + LOAD_LIBRARY_REQUIRE_SIGNED_TARGET, + LOAD_LIBRARY_SAFE_CURRENT_DIRS, + }; + } +} + +use self::windows_imports::*; +use util::{ensure_compatible_types, cstr_cow_from_bytes}; +use std::ffi::{OsStr, OsString}; +use std::{fmt, io, marker, mem, ptr}; + +/// The platform-specific counterpart of the cross-platform [`Library`](crate::Library). +pub struct Library(HMODULE); + +unsafe impl Send for Library {} +// Now, this is sort-of-tricky. MSDN documentation does not really make any claims as to safety of +// the Win32 APIs. Sadly, whomever I asked, even current and former Microsoft employees, couldn’t +// say for sure whether the Win32 APIs used to implement `Library` are thread-safe or not. +// +// My investigation ended up with a question about thread-safety properties of the API involved +// being sent to an internal (to MS) general question mailing-list. The conclusion of the mail is +// as such: +// +// * Nobody inside MS (at least out of all of the people who have seen the question) knows for +// sure either; +// * However, the general consensus between MS developers is that one can rely on the API being +// thread-safe. In case it is not thread-safe it should be considered a bug on the Windows +// part. (NB: bugs filed at https://connect.microsoft.com/ against Windows Server) +unsafe impl Sync for Library {} + +impl Library { + /// Find and load a module. + /// + /// If the `filename` specifies a full path, the function only searches that path for the + /// module. Otherwise, if the `filename` specifies a relative path or a module name without a + /// path, the function uses a Windows-specific search strategy to find the module. For more + /// information, see the [Remarks on MSDN][msdn]. + /// + /// If the `filename` specifies a library filename without a path and with the extension omitted, + /// the `.dll` extension is implicitly added. This behaviour may be suppressed by appending a + /// trailing `.` to the `filename`. + /// + /// This is equivalent to [Library::load_with_flags](filename, 0). + /// + /// [msdn]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryw#remarks + /// + /// # Safety + /// + /// When a library is loaded, initialisation routines contained within the library are executed. + /// For the purposes of safety, the execution of these routines is conceptually the same calling an + /// unknown foreign function and may impose arbitrary requirements on the caller for the call + /// to be sound. + /// + /// Additionally, the callers of this function must also ensure that execution of the + /// termination routines contained within the library is safe as well. These routines may be + /// executed when the library is unloaded. + #[inline] + pub unsafe fn new>(filename: P) -> Result { + Library::load_with_flags(filename, 0) + } + + /// Get the `Library` representing the original program executable. + /// + /// Note that the behaviour of the `Library` loaded with this method is different from + /// Libraries loaded with [`os::unix::Library::this`]. For more information refer to [MSDN]. + /// + /// Corresponds to `GetModuleHandleExW(0, NULL, _)`. + /// + /// [`os::unix::Library::this`]: crate::os::unix::Library::this + /// [MSDN]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandleexw + pub fn this() -> Result { + unsafe { + let mut handle: HMODULE = std::ptr::null_mut(); + with_get_last_error(|source| crate::Error::GetModuleHandleExW { source }, || { + let result = libloaderapi::GetModuleHandleExW(0, std::ptr::null_mut(), &mut handle); + if result == 0 { + None + } else { + Some(Library(handle)) + } + }).map_err(|e| e.unwrap_or(crate::Error::GetModuleHandleExWUnknown)) + } + } + + /// Get a module that is already loaded by the program. + /// + /// This function returns a `Library` corresponding to a module with the given name that is + /// already mapped into the address space of the process. If the module isn't found, an error is + /// returned. + /// + /// If the `filename` does not include a full path and there are multiple different loaded + /// modules corresponding to the `filename`, it is impossible to predict which module handle + /// will be returned. For more information refer to [MSDN]. + /// + /// If the `filename` specifies a library filename without a path and with the extension omitted, + /// the `.dll` extension is implicitly added. This behaviour may be suppressed by appending a + /// trailing `.` to the `filename`. + /// + /// This is equivalent to `GetModuleHandleExW(0, filename, _)`. + /// + /// [MSDN]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandleexw + pub fn open_already_loaded>(filename: P) -> Result { + let wide_filename: Vec = filename.as_ref().encode_wide().chain(Some(0)).collect(); + + let ret = unsafe { + let mut handle: HMODULE = std::ptr::null_mut(); + with_get_last_error(|source| crate::Error::GetModuleHandleExW { source }, || { + // Make sure no winapi calls as a result of drop happen inside this closure, because + // otherwise that might change the return value of the GetLastError. + let result = libloaderapi::GetModuleHandleExW(0, wide_filename.as_ptr(), &mut handle); + if result == 0 { + None + } else { + Some(Library(handle)) + } + }).map_err(|e| e.unwrap_or(crate::Error::GetModuleHandleExWUnknown)) + }; + + drop(wide_filename); // Drop wide_filename here to ensure it doesn’t get moved and dropped + // inside the closure by mistake. See comment inside the closure. + ret + } + + /// Find and load a module, additionally adjusting behaviour with flags. + /// + /// See [`Library::new`] for documentation on the handling of the `filename` argument. See the + /// [flag table on MSDN][flags] for information on applicable values for the `flags` argument. + /// + /// Corresponds to `LoadLibraryExW(filename, reserved: NULL, flags)`. + /// + /// [flags]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters + /// + /// # Safety + /// + /// When a library is loaded, initialisation routines contained within the library are executed. + /// For the purposes of safety, the execution of these routines is conceptually the same calling an + /// unknown foreign function and may impose arbitrary requirements on the caller for the call + /// to be sound. + /// + /// Additionally, the callers of this function must also ensure that execution of the + /// termination routines contained within the library is safe as well. These routines may be + /// executed when the library is unloaded. + pub unsafe fn load_with_flags>(filename: P, flags: DWORD) -> Result { + let wide_filename: Vec = filename.as_ref().encode_wide().chain(Some(0)).collect(); + let _guard = ErrorModeGuard::new(); + + let ret = with_get_last_error(|source| crate::Error::LoadLibraryExW { source }, || { + // Make sure no winapi calls as a result of drop happen inside this closure, because + // otherwise that might change the return value of the GetLastError. + let handle = + libloaderapi::LoadLibraryExW(wide_filename.as_ptr(), std::ptr::null_mut(), flags); + if handle.is_null() { + None + } else { + Some(Library(handle)) + } + }).map_err(|e| e.unwrap_or(crate::Error::LoadLibraryExWUnknown)); + drop(wide_filename); // Drop wide_filename here to ensure it doesn’t get moved and dropped + // inside the closure by mistake. See comment inside the closure. + ret + } + + /// Get a pointer to a function or static variable by symbol name. + /// + /// The `symbol` may not contain any null bytes, with the exception of the last byte. A null + /// terminated `symbol` may avoid a string allocation in some cases. + /// + /// Symbol is interpreted as-is; no mangling is done. This means that symbols like `x::y` are + /// most likely invalid. + /// + /// # Safety + /// + /// Users of this API must specify the correct type of the function or variable loaded. + pub unsafe fn get(&self, symbol: &[u8]) -> Result, crate::Error> { + ensure_compatible_types::()?; + let symbol = cstr_cow_from_bytes(symbol)?; + with_get_last_error(|source| crate::Error::GetProcAddress { source }, || { + let symbol = libloaderapi::GetProcAddress(self.0, symbol.as_ptr()); + if symbol.is_null() { + None + } else { + Some(Symbol { + pointer: symbol, + pd: marker::PhantomData + }) + } + }).map_err(|e| e.unwrap_or(crate::Error::GetProcAddressUnknown)) + } + + /// Get a pointer to a function or static variable by ordinal number. + /// + /// # Safety + /// + /// Users of this API must specify the correct type of the function or variable loaded. + pub unsafe fn get_ordinal(&self, ordinal: WORD) -> Result, crate::Error> { + ensure_compatible_types::()?; + with_get_last_error(|source| crate::Error::GetProcAddress { source }, || { + let ordinal = ordinal as usize as *mut _; + let symbol = libloaderapi::GetProcAddress(self.0, ordinal); + if symbol.is_null() { + None + } else { + Some(Symbol { + pointer: symbol, + pd: marker::PhantomData + }) + } + }).map_err(|e| e.unwrap_or(crate::Error::GetProcAddressUnknown)) + } + + /// Convert the `Library` to a raw handle. + pub fn into_raw(self) -> HMODULE { + let handle = self.0; + mem::forget(self); + handle + } + + /// Convert a raw handle to a `Library`. + /// + /// # Safety + /// + /// The handle must be the result of a successful call of `LoadLibraryA`, `LoadLibraryW`, + /// `LoadLibraryExW`, or `LoadLibraryExA`, or a handle previously returned by the + /// `Library::into_raw` call. + pub unsafe fn from_raw(handle: HMODULE) -> Library { + Library(handle) + } + + /// Unload the library. + /// + /// You only need to call this if you are interested in handling any errors that may arise when + /// library is unloaded. Otherwise this will be done when `Library` is dropped. + /// + /// The underlying data structures may still get leaked if an error does occur. + pub fn close(self) -> Result<(), crate::Error> { + let result = with_get_last_error(|source| crate::Error::FreeLibrary { source }, || { + if unsafe { libloaderapi::FreeLibrary(self.0) == 0 } { + None + } else { + Some(()) + } + }).map_err(|e| e.unwrap_or(crate::Error::FreeLibraryUnknown)); + // While the library is not free'd yet in case of an error, there is no reason to try + // dropping it again, because all that will do is try calling `FreeLibrary` again. only + // this time it would ignore the return result, which we already seen failing... + std::mem::forget(self); + result + } +} + +impl Drop for Library { + fn drop(&mut self) { + unsafe { libloaderapi::FreeLibrary(self.0); } + } +} + +impl fmt::Debug for Library { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + unsafe { + // FIXME: use Maybeuninit::uninit_array when stable + let mut buf = + mem::MaybeUninit::<[mem::MaybeUninit::; 1024]>::uninit().assume_init(); + let len = libloaderapi::GetModuleFileNameW(self.0, + (&mut buf[..]).as_mut_ptr().cast(), 1024) as usize; + if len == 0 { + f.write_str(&format!("Library@{:p}", self.0)) + } else { + let string: OsString = OsString::from_wide( + // FIXME: use Maybeuninit::slice_get_ref when stable + &*(&buf[..len] as *const [_] as *const [WCHAR]) + ); + f.write_str(&format!("Library@{:p} from {:?}", self.0, string)) + } + } + } +} + +/// A symbol from a library. +/// +/// A major difference compared to the cross-platform `Symbol` is that this does not ensure that the +/// `Symbol` does not outlive the `Library` that it comes from. +pub struct Symbol { + pointer: FARPROC, + pd: marker::PhantomData +} + +impl Symbol { + /// Convert the loaded `Symbol` into a handle. + pub fn into_raw(self) -> FARPROC { + let pointer = self.pointer; + mem::forget(self); + pointer + } +} + +impl Symbol> { + /// Lift Option out of the symbol. + pub fn lift_option(self) -> Option> { + if self.pointer.is_null() { + None + } else { + Some(Symbol { + pointer: self.pointer, + pd: marker::PhantomData, + }) + } + } +} + +unsafe impl Send for Symbol {} +unsafe impl Sync for Symbol {} + +impl Clone for Symbol { + fn clone(&self) -> Symbol { + Symbol { ..*self } + } +} + +impl ::std::ops::Deref for Symbol { + type Target = T; + fn deref(&self) -> &T { + unsafe { + // Additional reference level for a dereference on `deref` return value. + &*(&self.pointer as *const *mut _ as *const T) + } + } +} + +impl fmt::Debug for Symbol { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&format!("Symbol@{:p}", self.pointer)) + } +} + +struct ErrorModeGuard(DWORD); + +impl ErrorModeGuard { + #[allow(clippy::if_same_then_else)] + fn new() -> Option { + unsafe { + let mut previous_mode = 0; + if errhandlingapi::SetThreadErrorMode(SEM_FAILCE, &mut previous_mode) == 0 { + // How in the world is it possible for what is essentially a simple variable swap + // to fail? For now we just ignore the error -- the worst that can happen here is + // the previous mode staying on and user seeing a dialog error on older Windows + // machines. + None + } else if previous_mode == SEM_FAILCE { + None + } else { + Some(ErrorModeGuard(previous_mode)) + } + } + } +} + +impl Drop for ErrorModeGuard { + fn drop(&mut self) { + unsafe { + errhandlingapi::SetThreadErrorMode(self.0, ptr::null_mut()); + } + } +} + +fn with_get_last_error(wrap: fn(crate::error::WindowsError) -> crate::Error, closure: F) +-> Result> +where F: FnOnce() -> Option { + closure().ok_or_else(|| { + let error = unsafe { errhandlingapi::GetLastError() }; + if error == 0 { + None + } else { + Some(wrap(crate::error::WindowsError(io::Error::from_raw_os_error(error as i32)))) + } + }) +} + +/// Do not check AppLocker rules or apply Software Restriction Policies for the DLL. +/// +/// This action applies only to the DLL being loaded and not to its dependencies. This value is +/// recommended for use in setup programs that must run extracted DLLs during installation. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_IGNORE_CODE_AUTHZ_LEVEL: DWORD = consts::LOAD_IGNORE_CODE_AUTHZ_LEVEL; + +/// Map the file into the calling process’ virtual address space as if it were a data file. +/// +/// Nothing is done to execute or prepare to execute the mapped file. Therefore, you cannot call +/// functions like [`Library::get`] with this DLL. Using this value causes writes to read-only +/// memory to raise an access violation. Use this flag when you want to load a DLL only to extract +/// messages or resources from it. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_AS_DATAFILE: DWORD = consts::LOAD_LIBRARY_AS_DATAFILE; + +/// Map the file into the calling process’ virtual address space as if it were a data file. +/// +/// Similar to [`LOAD_LIBRARY_AS_DATAFILE`], except that the DLL file is opened with exclusive +/// write access for the calling process. Other processes cannot open the DLL file for write access +/// while it is in use. However, the DLL can still be opened by other processes. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: DWORD = consts::LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE; + +/// Map the file into the process’ virtual address space as an image file. +/// +/// The loader does not load the static imports or perform the other usual initialisation steps. +/// Use this flag when you want to load a DLL only to extract messages or resources from it. +/// +/// Unless the application depends on the file having the in-memory layout of an image, this value +/// should be used with either [`LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE`] or +/// [`LOAD_LIBRARY_AS_DATAFILE`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_AS_IMAGE_RESOURCE: DWORD = consts::LOAD_LIBRARY_AS_IMAGE_RESOURCE; + +/// Search the application's installation directory for the DLL and its dependencies. +/// +/// Directories in the standard search path are not searched. This value cannot be combined with +/// [`LOAD_WITH_ALTERED_SEARCH_PATH`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: DWORD = consts::LOAD_LIBRARY_SEARCH_APPLICATION_DIR; + +/// Search default directories when looking for the DLL and its dependencies. +/// +/// This value is a combination of [`LOAD_LIBRARY_SEARCH_APPLICATION_DIR`], +/// [`LOAD_LIBRARY_SEARCH_SYSTEM32`], and [`LOAD_LIBRARY_SEARCH_USER_DIRS`]. Directories in the +/// standard search path are not searched. This value cannot be combined with +/// [`LOAD_WITH_ALTERED_SEARCH_PATH`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: DWORD = consts::LOAD_LIBRARY_SEARCH_DEFAULT_DIRS; + +/// Directory that contains the DLL is temporarily added to the beginning of the list of +/// directories that are searched for the DLL’s dependencies. +/// +/// Directories in the standard search path are not searched. +/// +/// The `filename` parameter must specify a fully qualified path. This value cannot be combined +/// with [`LOAD_WITH_ALTERED_SEARCH_PATH`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: DWORD = consts::LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR; + +/// Search `%windows%\system32` for the DLL and its dependencies. +/// +/// Directories in the standard search path are not searched. This value cannot be combined with +/// [`LOAD_WITH_ALTERED_SEARCH_PATH`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SEARCH_SYSTEM32: DWORD = consts::LOAD_LIBRARY_SEARCH_SYSTEM32; + +/// Directories added using the `AddDllDirectory` or the `SetDllDirectory` function are searched +/// for the DLL and its dependencies. +/// +/// If more than one directory has been added, the order in which the directories are searched is +/// unspecified. Directories in the standard search path are not searched. This value cannot be +/// combined with [`LOAD_WITH_ALTERED_SEARCH_PATH`]. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SEARCH_USER_DIRS: DWORD = consts::LOAD_LIBRARY_SEARCH_USER_DIRS; + +/// If `filename` specifies an absolute path, the system uses the alternate file search strategy +/// discussed in the [Remarks section] to find associated executable modules that the specified +/// module causes to be loaded. +/// +/// If this value is used and `filename` specifies a relative path, the behaviour is undefined. +/// +/// If this value is not used, or if `filename` does not specify a path, the system uses the +/// standard search strategy discussed in the [Remarks section] to find associated executable +/// modules that the specified module causes to be loaded. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +/// +/// [Remarks]: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#remarks +pub const LOAD_WITH_ALTERED_SEARCH_PATH: DWORD = consts::LOAD_WITH_ALTERED_SEARCH_PATH; + +/// Specifies that the digital signature of the binary image must be checked at load time. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_REQUIRE_SIGNED_TARGET: DWORD = consts::LOAD_LIBRARY_REQUIRE_SIGNED_TARGET; + +/// Allow loading a DLL for execution from the current directory only if it is under a directory in +/// the Safe load list. +/// +/// See [flag documentation on MSDN](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters). +pub const LOAD_LIBRARY_SAFE_CURRENT_DIRS: DWORD = consts::LOAD_LIBRARY_SAFE_CURRENT_DIRS; diff --git a/bash-5.1/vendor/libloading/src/safe.rs b/bash-5.1/vendor/libloading/src/safe.rs new file mode 100644 index 0000000000000000000000000000000000000000..49be0cfc9a35de6bf472614ae309ef3da06fcc21 --- /dev/null +++ b/bash-5.1/vendor/libloading/src/safe.rs @@ -0,0 +1,299 @@ +use super::Error; +#[cfg(libloading_docs)] +use super::os::unix as imp; // the implementation used here doesn't matter particularly much... +#[cfg(all(not(libloading_docs), unix))] +use super::os::unix as imp; +#[cfg(all(not(libloading_docs), windows))] +use super::os::windows as imp; +use std::ffi::OsStr; +use std::fmt; +use std::marker; +use std::ops; + +/// A loaded dynamic library. +#[cfg_attr(libloading_docs, doc(cfg(any(unix, windows))))] +pub struct Library(imp::Library); + +impl Library { + /// Find and load a dynamic library. + /// + /// The `filename` argument may be either: + /// + /// * A library filename; + /// * The absolute path to the library; + /// * A relative (to the current working directory) path to the library. + /// + /// # Safety + /// + /// When a library is loaded, initialisation routines contained within it are executed. + /// For the purposes of safety, the execution of these routines is conceptually the same calling an + /// unknown foreign function and may impose arbitrary requirements on the caller for the call + /// to be sound. + /// + /// Additionally, the callers of this function must also ensure that execution of the + /// termination routines contained within the library is safe as well. These routines may be + /// executed when the library is unloaded. + /// + /// # Thread-safety + /// + /// The implementation strives to be as MT-safe as sanely possible, however on certain + /// platforms the underlying error-handling related APIs not always MT-safe. This library + /// shares these limitations on those platforms. In particular, on certain UNIX targets + /// `dlerror` is not MT-safe, resulting in garbage error messages in certain MT-scenarios. + /// + /// Calling this function from multiple threads is not MT-safe if used in conjunction with + /// library filenames and the library search path is modified (`SetDllDirectory` function on + /// Windows, `{DY,}LD_LIBRARY_PATH` environment variable on UNIX). + /// + /// # Platform-specific behaviour + /// + /// When a plain library filename is supplied, the locations in which the library is searched are + /// platform specific and cannot be adjusted in a portable manner. See the documentation for + /// the platform specific [`os::unix::Library::new`] and [`os::windows::Library::new`] methods + /// for further information on library lookup behaviour. + /// + /// If the `filename` specifies a library filename without a path and with the extension omitted, + /// the `.dll` extension is implicitly added on Windows. + /// + /// [`os::unix::Library::new`]: crate::os::unix::Library::new + /// [`os::windows::Library::new`]: crate::os::windows::Library::new + /// + /// # Tips + /// + /// Distributing your dynamic libraries under a filename common to all platforms (e.g. + /// `awesome.module`) allows you to avoid code which has to account for platform’s conventional + /// library filenames. + /// + /// Strive to specify an absolute or at least a relative path to your library, unless + /// system-wide libraries are being loaded. Platform-dependent library search locations + /// combined with various quirks related to path-less filenames may cause flakiness in + /// programs. + /// + /// # Examples + /// + /// ```no_run + /// # use ::libloading::Library; + /// // Any of the following are valid. + /// unsafe { + /// let _ = Library::new("/path/to/awesome.module").unwrap(); + /// let _ = Library::new("../awesome.module").unwrap(); + /// let _ = Library::new("libsomelib.so.1").unwrap(); + /// } + /// ``` + pub unsafe fn new>(filename: P) -> Result { + imp::Library::new(filename).map(From::from) + } + + /// Get a pointer to a function or static variable by symbol name. + /// + /// The `symbol` may not contain any null bytes, with the exception of the last byte. Providing a + /// null-terminated `symbol` may help to avoid an allocation. + /// + /// The symbol is interpreted as-is; no mangling is done. This means that symbols like `x::y` are + /// most likely invalid. + /// + /// # Safety + /// + /// Users of this API must specify the correct type of the function or variable loaded. + /// + /// # Platform-specific behaviour + /// + /// The implementation of thread-local variables is extremely platform specific and uses of such + /// variables that work on e.g. Linux may have unintended behaviour on other targets. + /// + /// On POSIX implementations where the `dlerror` function is not confirmed to be MT-safe (such + /// as FreeBSD), this function will unconditionally return an error when the underlying `dlsym` + /// call returns a null pointer. There are rare situations where `dlsym` returns a genuine null + /// pointer without it being an error. If loading a null pointer is something you care about, + /// consider using the [`os::unix::Library::get_singlethreaded`] call. + /// + /// [`os::unix::Library::get_singlethreaded`]: crate::os::unix::Library::get_singlethreaded + /// + /// # Examples + /// + /// Given a loaded library: + /// + /// ```no_run + /// # use ::libloading::Library; + /// let lib = unsafe { + /// Library::new("/path/to/awesome.module").unwrap() + /// }; + /// ``` + /// + /// Loading and using a function looks like this: + /// + /// ```no_run + /// # use ::libloading::{Library, Symbol}; + /// # let lib = unsafe { + /// # Library::new("/path/to/awesome.module").unwrap() + /// # }; + /// unsafe { + /// let awesome_function: Symbol f64> = + /// lib.get(b"awesome_function\0").unwrap(); + /// awesome_function(0.42); + /// } + /// ``` + /// + /// A static variable may also be loaded and inspected: + /// + /// ```no_run + /// # use ::libloading::{Library, Symbol}; + /// # let lib = unsafe { Library::new("/path/to/awesome.module").unwrap() }; + /// unsafe { + /// let awesome_variable: Symbol<*mut f64> = lib.get(b"awesome_variable\0").unwrap(); + /// **awesome_variable = 42.0; + /// }; + /// ``` + pub unsafe fn get<'lib, T>(&'lib self, symbol: &[u8]) -> Result, Error> { + self.0.get(symbol).map(|from| Symbol::from_raw(from, self)) + } + + /// Unload the library. + /// + /// This method might be a no-op, depending on the flags with which the `Library` was opened, + /// what library was opened or other platform specifics. + /// + /// You only need to call this if you are interested in handling any errors that may arise when + /// library is unloaded. Otherwise the implementation of `Drop` for `Library` will close the + /// library and ignore the errors were they arise. + /// + /// The underlying data structures may still get leaked if an error does occur. + pub fn close(self) -> Result<(), Error> { + self.0.close() + } +} + +impl fmt::Debug for Library { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +impl From for Library { + fn from(lib: imp::Library) -> Library { + Library(lib) + } +} + +impl From for imp::Library { + fn from(lib: Library) -> imp::Library { + lib.0 + } +} + +unsafe impl Send for Library {} +unsafe impl Sync for Library {} + +/// Symbol from a library. +/// +/// This type is a safeguard against using dynamically loaded symbols after a `Library` is +/// unloaded. The primary method to create an instance of a `Symbol` is via [`Library::get`]. +/// +/// The `Deref` trait implementation allows the use of `Symbol` as if it was a function or variable +/// itself, without taking care to “extract” the function or variable manually most of the time. +/// +/// [`Library::get`]: Library::get +#[cfg_attr(libloading_docs, doc(cfg(any(unix, windows))))] +pub struct Symbol<'lib, T: 'lib> { + inner: imp::Symbol, + pd: marker::PhantomData<&'lib T>, +} + +impl<'lib, T> Symbol<'lib, T> { + /// Extract the wrapped `os::platform::Symbol`. + /// + /// # Safety + /// + /// Using this function relinquishes all the lifetime guarantees. It is up to the developer to + /// ensure the resulting `Symbol` is not used past the lifetime of the `Library` this symbol + /// was loaded from. + /// + /// # Examples + /// + /// ```no_run + /// # use ::libloading::{Library, Symbol}; + /// unsafe { + /// let lib = Library::new("/path/to/awesome.module").unwrap(); + /// let symbol: Symbol<*mut u32> = lib.get(b"symbol\0").unwrap(); + /// let symbol = symbol.into_raw(); + /// } + /// ``` + pub unsafe fn into_raw(self) -> imp::Symbol { + self.inner + } + + /// Wrap the `os::platform::Symbol` into this safe wrapper. + /// + /// Note that, in order to create association between the symbol and the library this symbol + /// came from, this function requires a reference to the library. + /// + /// # Safety + /// + /// The `library` reference must be exactly the library `sym` was loaded from. + /// + /// # Examples + /// + /// ```no_run + /// # use ::libloading::{Library, Symbol}; + /// unsafe { + /// let lib = Library::new("/path/to/awesome.module").unwrap(); + /// let symbol: Symbol<*mut u32> = lib.get(b"symbol\0").unwrap(); + /// let symbol = symbol.into_raw(); + /// let symbol = Symbol::from_raw(symbol, &lib); + /// } + /// ``` + pub unsafe fn from_raw(sym: imp::Symbol, library: &'lib L) -> Symbol<'lib, T> { + let _ = library; // ignore here for documentation purposes. + Symbol { + inner: sym, + pd: marker::PhantomData, + } + } +} + +impl<'lib, T> Symbol<'lib, Option> { + /// Lift Option out of the symbol. + /// + /// # Examples + /// + /// ```no_run + /// # use ::libloading::{Library, Symbol}; + /// unsafe { + /// let lib = Library::new("/path/to/awesome.module").unwrap(); + /// let symbol: Symbol> = lib.get(b"symbol\0").unwrap(); + /// let symbol: Symbol<*mut u32> = symbol.lift_option().expect("static is not null"); + /// } + /// ``` + pub fn lift_option(self) -> Option> { + self.inner.lift_option().map(|is| Symbol { + inner: is, + pd: marker::PhantomData, + }) + } +} + +impl<'lib, T> Clone for Symbol<'lib, T> { + fn clone(&self) -> Symbol<'lib, T> { + Symbol { + inner: self.inner.clone(), + pd: marker::PhantomData, + } + } +} + +// FIXME: implement FnOnce for callable stuff instead. +impl<'lib, T> ops::Deref for Symbol<'lib, T> { + type Target = T; + fn deref(&self) -> &T { + ops::Deref::deref(&self.inner) + } +} + +impl<'lib, T> fmt::Debug for Symbol<'lib, T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +unsafe impl<'lib, T: Send> Send for Symbol<'lib, T> {} +unsafe impl<'lib, T: Sync> Sync for Symbol<'lib, T> {} diff --git a/bash-5.1/vendor/libloading/src/test_helpers.rs b/bash-5.1/vendor/libloading/src/test_helpers.rs new file mode 100644 index 0000000000000000000000000000000000000000..9e3e9924ff86b0a85eda77ab51bda720a63d4113 --- /dev/null +++ b/bash-5.1/vendor/libloading/src/test_helpers.rs @@ -0,0 +1,37 @@ +//! This is a separate file containing helpers for tests of this library. It is built into a +//! dynamic library by the build.rs script. +#![crate_type="cdylib"] + +#[no_mangle] +pub static mut TEST_STATIC_U32: u32 = 0; + +#[no_mangle] +pub static mut TEST_STATIC_PTR: *mut () = 0 as *mut _; + +#[no_mangle] +pub extern "C" fn test_identity_u32(x: u32) -> u32 { + x +} + +#[repr(C)] +pub struct S { + a: u64, + b: u32, + c: u16, + d: u8 +} + +#[no_mangle] +pub extern "C" fn test_identity_struct(x: S) -> S { + x +} + +#[no_mangle] +pub unsafe extern "C" fn test_get_static_u32() -> u32 { + TEST_STATIC_U32 +} + +#[no_mangle] +pub unsafe extern "C" fn test_check_static_ptr() -> bool { + TEST_STATIC_PTR == (&mut TEST_STATIC_PTR as *mut *mut _ as *mut _) +} diff --git a/bash-5.1/vendor/libloading/src/util.rs b/bash-5.1/vendor/libloading/src/util.rs new file mode 100644 index 0000000000000000000000000000000000000000..599e6c254eaa8ccdc1d2fc18811d722a12c01ee0 --- /dev/null +++ b/bash-5.1/vendor/libloading/src/util.rs @@ -0,0 +1,34 @@ +use std::borrow::Cow; +use std::ffi::{CStr, CString}; +use std::os::raw; + +use crate::Error; + +/// Checks for the last byte and avoids allocating if it is zero. +/// +/// Non-last null bytes still result in an error. +pub(crate) fn cstr_cow_from_bytes(slice: &[u8]) -> Result, Error> { + static ZERO: raw::c_char = 0; + Ok(match slice.last() { + // Slice out of 0 elements + None => unsafe { Cow::Borrowed(CStr::from_ptr(&ZERO)) }, + // Slice with trailing 0 + Some(&0) => Cow::Borrowed( + CStr::from_bytes_with_nul(slice) + .map_err(|source| Error::CreateCStringWithTrailing { source })?, + ), + // Slice with no trailing 0 + Some(_) => { + Cow::Owned(CString::new(slice).map_err(|source| Error::CreateCString { source })?) + } + }) +} + +#[inline] +pub(crate) fn ensure_compatible_types() -> Result<(), Error> { + if ::std::mem::size_of::() != ::std::mem::size_of::() { + Err(Error::IncompatibleSize) + } else { + Ok(()) + } +} diff --git a/bash-5.1/vendor/libloading/tests/constants.rs b/bash-5.1/vendor/libloading/tests/constants.rs new file mode 100644 index 0000000000000000000000000000000000000000..6ae5a8460aef5b287f27625749b6be7df3a7a1b1 --- /dev/null +++ b/bash-5.1/vendor/libloading/tests/constants.rs @@ -0,0 +1,13 @@ +extern crate libc; +extern crate libloading; +extern crate static_assertions; + +#[cfg(all(test, unix))] +mod unix { + use super::static_assertions::const_assert_eq; + + const_assert_eq!(libloading::os::unix::RTLD_LOCAL, libc::RTLD_LOCAL); + const_assert_eq!(libloading::os::unix::RTLD_GLOBAL, libc::RTLD_GLOBAL); + const_assert_eq!(libloading::os::unix::RTLD_NOW, libc::RTLD_NOW); + const_assert_eq!(libloading::os::unix::RTLD_LAZY, libc::RTLD_LAZY); +} diff --git a/bash-5.1/vendor/libloading/tests/functions.rs b/bash-5.1/vendor/libloading/tests/functions.rs new file mode 100644 index 0000000000000000000000000000000000000000..795f0cfe94d4d387f5780c425cabf3da83ae7938 --- /dev/null +++ b/bash-5.1/vendor/libloading/tests/functions.rs @@ -0,0 +1,256 @@ +#[cfg(windows)] +extern crate winapi; + +extern crate libloading; +use libloading::{Symbol, Library}; + +const LIBPATH: &'static str = "target/libtest_helpers.module"; + +fn make_helpers() { + static ONCE: ::std::sync::Once = ::std::sync::Once::new(); + ONCE.call_once(|| { + let rustc = std::env::var_os("RUSTC").unwrap_or_else(|| { "rustc".into() }); + let mut cmd = ::std::process::Command::new(rustc); + cmd + .arg("src/test_helpers.rs") + .arg("-o") + .arg(LIBPATH); + if let Some(target) = std::env::var_os("TARGET") { + cmd.arg("--target").arg(target); + } else { + eprintln!("WARNING: $TARGET NOT SPECIFIED! BUILDING HELPER MODULE FOR NATIVE TARGET."); + } + assert!(cmd + .status() + .expect("could not compile the test helpers!") + .success() + ); + }); +} + +#[test] +fn test_id_u32() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + let f: Symbol u32> = lib.get(b"test_identity_u32\0").unwrap(); + assert_eq!(42, f(42)); + } +} + +#[repr(C)] +#[derive(Clone,Copy,PartialEq,Debug)] +struct S { + a: u64, + b: u32, + c: u16, + d: u8 +} + +#[test] +fn test_id_struct() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + let f: Symbol S> = lib.get(b"test_identity_struct\0").unwrap(); + assert_eq!(S { a: 1, b: 2, c: 3, d: 4 }, f(S { a: 1, b: 2, c: 3, d: 4 })); + } +} + +#[test] +fn test_0_no_0() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + let f: Symbol S> = lib.get(b"test_identity_struct\0").unwrap(); + let f2: Symbol S> = lib.get(b"test_identity_struct").unwrap(); + assert_eq!(*f, *f2); + } +} + +#[test] +fn wrong_name_fails() { + unsafe { + Library::new("target/this_location_is_definitely_non existent:^~").err().unwrap(); + } +} + +#[test] +fn missing_symbol_fails() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + lib.get::<*mut ()>(b"test_does_not_exist").err().unwrap(); + lib.get::<*mut ()>(b"test_does_not_exist\0").err().unwrap(); + } +} + +#[test] +fn interior_null_fails() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + lib.get::<*mut ()>(b"test_does\0_not_exist").err().unwrap(); + lib.get::<*mut ()>(b"test\0_does_not_exist\0").err().unwrap(); + } +} + +#[test] +fn test_incompatible_type() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + assert!(match lib.get::<()>(b"test_identity_u32\0") { + Err(libloading::Error::IncompatibleSize) => true, + _ => false, + }) + } +} + +#[test] +fn test_incompatible_type_named_fn() { + make_helpers(); + unsafe fn get<'a, T>(l: &'a Library, _: T) -> Result, libloading::Error> { + l.get::(b"test_identity_u32\0") + } + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + assert!(match get(&lib, test_incompatible_type_named_fn) { + Err(libloading::Error::IncompatibleSize) => true, + _ => false, + }) + } +} + +#[test] +fn test_static_u32() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + let var: Symbol<*mut u32> = lib.get(b"TEST_STATIC_U32\0").unwrap(); + **var = 42; + let help: Symbol u32> = lib.get(b"test_get_static_u32\0").unwrap(); + assert_eq!(42, help()); + } +} + +#[test] +fn test_static_ptr() { + make_helpers(); + unsafe { + let lib = Library::new(LIBPATH).unwrap(); + let var: Symbol<*mut *mut ()> = lib.get(b"TEST_STATIC_PTR\0").unwrap(); + **var = *var as *mut _; + let works: Symbol bool> = + lib.get(b"test_check_static_ptr\0").unwrap(); + assert!(works()); + } +} + +#[test] +// Something about i686-pc-windows-gnu, makes dll initialisation code call abort when it is loaded +// and unloaded many times. So far it seems like an issue with mingw, not libloading, so ignoring +// the target. Especially since it is very unlikely to be fixed given the state of support its +// support. +#[cfg(not(all(target_arch="x86", target_os="windows", target_env="gnu")))] +fn manual_close_many_times() { + make_helpers(); + let join_handles: Vec<_> = (0..16).map(|_| { + std::thread::spawn(|| unsafe { + for _ in 0..10000 { + let lib = Library::new(LIBPATH).expect("open library"); + let _: Symbol u32> = + lib.get(b"test_identity_u32").expect("get fn"); + lib.close().expect("close is successful"); + } + }) + }).collect(); + for handle in join_handles { + handle.join().expect("thread should succeed"); + } +} + + +#[cfg(unix)] +#[test] +fn library_this_get() { + use libloading::os::unix::Library; + make_helpers(); + // SAFE: functions are never called + unsafe { + let _lib = Library::new(LIBPATH).unwrap(); + let this = Library::this(); + // Library we loaded in `_lib` (should be RTLD_LOCAL). + assert!(this.get::(b"test_identity_u32").is_err()); + // Something obscure from libc... + assert!(this.get::(b"freopen").is_ok()); + } +} + +#[cfg(windows)] +#[test] +fn library_this() { + use libloading::os::windows::Library; + make_helpers(); + unsafe { + // SAFE: well-known library without initialisers is loaded. + let _lib = Library::new(LIBPATH).unwrap(); + let this = Library::this().expect("this library"); + // SAFE: functions are never called. + // Library we loaded in `_lib`. + assert!(this.get::(b"test_identity_u32").is_err()); + // Something "obscure" from kernel32... + assert!(this.get::(b"GetLastError").is_err()); + } +} + +#[cfg(windows)] +#[test] +fn works_getlasterror() { + use winapi::um::errhandlingapi; + use winapi::shared::minwindef::DWORD; + use libloading::os::windows::{Library, Symbol}; + + unsafe { + let lib = Library::new("kernel32.dll").unwrap(); + let gle: Symbol DWORD> = lib.get(b"GetLastError").unwrap(); + errhandlingapi::SetLastError(42); + assert_eq!(errhandlingapi::GetLastError(), gle()) + } +} + +#[cfg(windows)] +#[test] +fn works_getlasterror0() { + use winapi::um::errhandlingapi; + use winapi::shared::minwindef::DWORD; + use libloading::os::windows::{Library, Symbol}; + + unsafe { + let lib = Library::new("kernel32.dll").unwrap(); + let gle: Symbol DWORD> = lib.get(b"GetLastError\0").unwrap(); + errhandlingapi::SetLastError(42); + assert_eq!(errhandlingapi::GetLastError(), gle()) + } +} + +#[cfg(windows)] +#[test] +fn library_open_already_loaded() { + use libloading::os::windows::Library; + + // Present on Windows systems and NOT used by any other tests to prevent races. + const LIBPATH: &str = "Msftedit.dll"; + + // Not loaded yet. + assert!(match Library::open_already_loaded(LIBPATH) { + Err(libloading::Error::GetModuleHandleExW { .. }) => true, + _ => false, + }); + + unsafe { + let _lib = Library::new(LIBPATH).unwrap(); + // Loaded now. + assert!(Library::open_already_loaded(LIBPATH).is_ok()); + } +} diff --git a/bash-5.1/vendor/libloading/tests/library_filename.rs b/bash-5.1/vendor/libloading/tests/library_filename.rs new file mode 100644 index 0000000000000000000000000000000000000000..efe51b8656f623ccc993d9a5ddbdb05fe383cdb4 --- /dev/null +++ b/bash-5.1/vendor/libloading/tests/library_filename.rs @@ -0,0 +1,17 @@ +extern crate libloading; +use libloading::library_filename; +use std::path::Path; + +#[cfg(target_os = "windows")] +const EXPECTED: &str = "audioengine.dll"; +#[cfg(target_os = "linux")] +const EXPECTED: &str = "libaudioengine.so"; +#[cfg(target_os = "macos")] +const EXPECTED: &str = "libaudioengine.dylib"; + +#[test] +fn test_library_filename() { + let name = "audioengine"; + let resolved = library_filename(name); + assert!(Path::new(&resolved).ends_with(EXPECTED)); +} diff --git a/bash-5.1/vendor/libloading/tests/markers.rs b/bash-5.1/vendor/libloading/tests/markers.rs new file mode 100644 index 0000000000000000000000000000000000000000..330c034ad5f45cc4a8328a423d6b708ffadbd1ba --- /dev/null +++ b/bash-5.1/vendor/libloading/tests/markers.rs @@ -0,0 +1,96 @@ +extern crate libloading; + +#[cfg(test)] +fn assert_send() {} +#[cfg(test)] +fn assert_sync() {} +#[cfg(test)] +fn assert_display() {} + +#[test] +fn check_error_send() { + assert_send::(); +} + +#[test] +fn check_error_sync() { + assert_sync::(); +} + +#[test] +fn check_error_display() { + assert_display::(); +} + +#[test] +fn check_library_send() { + assert_send::(); +} + +#[cfg(unix)] +#[test] +fn check_unix_library_send() { + assert_send::(); +} + +#[cfg(windows)] +#[test] +fn check_windows_library_send() { + assert_send::(); +} + +#[test] +fn check_library_sync() { + assert_sync::(); +} + +#[cfg(unix)] +#[test] +fn check_unix_library_sync() { + assert_sync::(); +} + +#[cfg(windows)] +#[test] +fn check_windows_library_sync() { + assert_sync::(); +} + +#[test] +fn check_symbol_send() { + assert_send:: ()>>(); + // assert_not_send::>(); +} + +#[cfg(unix)] +#[test] +fn check_unix_symbol_send() { + assert_send:: ()>>(); + // assert_not_send::>(); +} + +#[cfg(windows)] +#[test] +fn check_windows_symbol_send() { + assert_send:: ()>>(); +} + +#[test] +fn check_symbol_sync() { + assert_sync:: ()>>(); + // assert_not_sync::>(); +} + +#[cfg(unix)] +#[test] +fn check_unix_symbol_sync() { + assert_sync:: ()>>(); + // assert_not_sync::>(); +} + +#[cfg(windows)] +#[test] +fn check_windows_symbol_sync() { + assert_sync:: ()>>(); + // assert_not_sync::>(); +} diff --git a/bash-5.1/vendor/libloading/tests/nagisa32.dll b/bash-5.1/vendor/libloading/tests/nagisa32.dll new file mode 100644 index 0000000000000000000000000000000000000000..0a6218ade9c051e3ebc34c5ad4a687c44263fb33 Binary files /dev/null and b/bash-5.1/vendor/libloading/tests/nagisa32.dll differ diff --git a/bash-5.1/vendor/libloading/tests/nagisa64.dll b/bash-5.1/vendor/libloading/tests/nagisa64.dll new file mode 100644 index 0000000000000000000000000000000000000000..bacaa4b969411958776c0aad5a848114b1b7bf51 Binary files /dev/null and b/bash-5.1/vendor/libloading/tests/nagisa64.dll differ diff --git a/bash-5.1/vendor/libloading/tests/windows.rs b/bash-5.1/vendor/libloading/tests/windows.rs new file mode 100644 index 0000000000000000000000000000000000000000..b4aad4a69808eed54b700dcba94aa6a4244ec518 --- /dev/null +++ b/bash-5.1/vendor/libloading/tests/windows.rs @@ -0,0 +1,64 @@ +#![cfg(windows)] +extern crate libloading; +use libloading::os::windows::*; +use std::ffi::CStr; + +// The ordinal DLL contains exactly one function (other than DllMain, that is) with ordinal number +// 1. This function has the sugnature `fn() -> *const c_char` and returns a string "bunny\0" (in +// reference to WindowsBunny). +// +// Both x86_64 and x86 versions of the .dll are functionally the same. Ideally we would compile the +// dlls with well known ordinals from our own testing helpers library, but rustc does not allow +// specifying a custom .def file (https://github.com/rust-lang/rust/issues/35089) +// +// The DLLs were kindly compiled by WindowsBunny (aka. @retep998). + +#[cfg(target_arch="x86")] +fn load_ordinal_lib() -> Library { + unsafe { + Library::new("tests/nagisa32.dll").expect("nagisa32.dll") + } +} + +#[cfg(target_arch="x86_64")] +fn load_ordinal_lib() -> Library { + unsafe { + Library::new("tests/nagisa64.dll").expect("nagisa64.dll") + } +} + +#[cfg(any(target_arch="x86", target_arch="x86_64"))] +#[test] +fn test_ordinal() { + let lib = load_ordinal_lib(); + unsafe { + let windows: Symbol *const i8> = lib.get_ordinal(1).expect("function"); + assert_eq!(CStr::from_ptr(windows()).to_bytes(), b"bunny"); + } +} + +#[cfg(any(target_arch="x86", target_arch="x86_64"))] +#[test] +fn test_ordinal_missing_fails() { + let lib = load_ordinal_lib(); + unsafe { + let r: Result *const i8>, _> = lib.get_ordinal(2); + r.err().unwrap(); + let r: Result *const i8>, _> = lib.get_ordinal(!0); + r.err().unwrap(); + } +} + +#[test] +fn test_new_kernel23() { + unsafe { + Library::new("kernel23").err().unwrap(); + } +} + +#[test] +fn test_new_kernel32_no_ext() { + unsafe { + Library::new("kernel32").unwrap(); + } +} diff --git a/bash-5.1/vendor/memoffset/.cargo-checksum.json b/bash-5.1/vendor/memoffset/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..01e3e71cb8a2304194a3c9cf6ec57c37e202e1f8 --- /dev/null +++ b/bash-5.1/vendor/memoffset/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"2556143c764ef2315fe44ff0ec43af47ca70b260fd64aa53f57dc42760d7132d","LICENSE":"3234ac55816264ee7b6c7ee27efd61cf0a1fe775806870e3d9b4c41ea73c5cb1","README.md":"299c8957a769bac2a71f9c63064c58a8b54e613e3bf03d41a889f0b428eb4a9c","build.rs":"6d677e33a1c98d588c97ec7985d4d5c3b954683e0a73c3dc53d79db4fbb5e638","ci/miri.sh":"ad7410b0a5bd6e346f55e9d96ec0719a085a2d1ce266bddfe6fe73333a1eb8ec","src/lib.rs":"e7976d295371a3c1e0cf31b0d50210cd6b1135caba3a5111403a97ec6175c0a2","src/offset_of.rs":"e5e3062947f61418cb48220a0d17604411b5ce651b5945c06b876f26c50220b2","src/raw_field.rs":"295cc971d64e51f3d053e56c692ae6ef3bb58915298f1ec49bb695b767daff46","src/span_of.rs":"03bfb743c2dee2e5fbb9568bcbbe9f24ace3e18488a6924d26812fcb9e3c425a"},"package":"5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"} \ No newline at end of file diff --git a/bash-5.1/vendor/memoffset/Cargo.toml b/bash-5.1/vendor/memoffset/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..2874e3124fa8205816642a452196f4c610da322e --- /dev/null +++ b/bash-5.1/vendor/memoffset/Cargo.toml @@ -0,0 +1,29 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +name = "memoffset" +version = "0.6.5" +authors = ["Gilad Naaman "] +description = "offset_of functionality for Rust structs." +readme = "README.md" +keywords = ["mem", "offset", "offset_of", "offsetof"] +categories = ["no-std"] +license = "MIT" +repository = "https://github.com/Gilnaa/memoffset" +[dev-dependencies.doc-comment] +version = "0.3" +[build-dependencies.autocfg] +version = "1" + +[features] +default = [] +unstable_const = [] diff --git a/bash-5.1/vendor/memoffset/LICENSE b/bash-5.1/vendor/memoffset/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..61f608134a6bf25c3c0a3f0dcc17cfd314d978dd --- /dev/null +++ b/bash-5.1/vendor/memoffset/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2017 Gilad Naaman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/bash-5.1/vendor/memoffset/README.md b/bash-5.1/vendor/memoffset/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9e93c2bccd7e5c37c0e9faa80b64eb4178986c22 --- /dev/null +++ b/bash-5.1/vendor/memoffset/README.md @@ -0,0 +1,65 @@ +# memoffset # + +[![](https://img.shields.io/crates/v/memoffset.svg)](https://crates.io/crates/memoffset) + +C-Like `offset_of` functionality for Rust structs. + +Introduces the following macros: + * `offset_of!` for obtaining the offset of a member of a struct. + * `offset_of_tuple!` for obtaining the offset of a member of a tuple. (Requires Rust 1.20+) + * `span_of!` for obtaining the range that a field, or fields, span. + +`memoffset` works under `no_std` environments. + +## Usage ## +Add the following dependency to your `Cargo.toml`: + +```toml +[dependencies] +memoffset = "0.6" +``` + +These versions will compile fine with rustc versions greater or equal to 1.19. + +## Examples ## +```rust +use memoffset::{offset_of, span_of}; + +#[repr(C, packed)] +struct Foo { + a: u32, + b: u32, + c: [u8; 5], + d: u32, +} + +fn main() { + assert_eq!(offset_of!(Foo, b), 4); + assert_eq!(offset_of!(Foo, d), 4+4+5); + + assert_eq!(span_of!(Foo, a), 0..4); + assert_eq!(span_of!(Foo, a .. c), 0..8); + assert_eq!(span_of!(Foo, a ..= c), 0..13); + assert_eq!(span_of!(Foo, ..= d), 0..17); + assert_eq!(span_of!(Foo, b ..), 4..17); +} +``` + +## Feature flags ## + +### Usage in constants ### +`memoffset` has **experimental** support for compile-time `offset_of!` on a nightly compiler. + +In order to use it, you must enable the `unstable_const` crate feature and several compiler features. + +Cargo.toml: +```toml +[dependencies.memoffset] +version = "0.6" +features = ["unstable_const"] +``` + +Your crate root: (`lib.rs`/`main.rs`) +```rust,ignore +#![feature(const_ptr_offset_from, const_refs_to_cell)] +``` diff --git a/bash-5.1/vendor/memoffset/build.rs b/bash-5.1/vendor/memoffset/build.rs new file mode 100644 index 0000000000000000000000000000000000000000..0604c1954efbf2b0e3a02dcbb4f90099b259422d --- /dev/null +++ b/bash-5.1/vendor/memoffset/build.rs @@ -0,0 +1,22 @@ +extern crate autocfg; + +fn main() { + let ac = autocfg::new(); + + // Check for a minimum version for a few features + if ac.probe_rustc_version(1, 20) { + println!("cargo:rustc-cfg=tuple_ty"); + } + if ac.probe_rustc_version(1, 31) { + println!("cargo:rustc-cfg=allow_clippy"); + } + if ac.probe_rustc_version(1, 36) { + println!("cargo:rustc-cfg=maybe_uninit"); + } + if ac.probe_rustc_version(1, 40) { + println!("cargo:rustc-cfg=doctests"); + } + if ac.probe_rustc_version(1, 51) { + println!("cargo:rustc-cfg=raw_ref_macros"); + } +} diff --git a/bash-5.1/vendor/memoffset/ci/miri.sh b/bash-5.1/vendor/memoffset/ci/miri.sh new file mode 100755 index 0000000000000000000000000000000000000000..5aea2ecd4b500df6ac238e28cd6eda5df9a3752c --- /dev/null +++ b/bash-5.1/vendor/memoffset/ci/miri.sh @@ -0,0 +1,14 @@ +set -ex + +# Install Miri. +MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) +echo "Installing latest nightly with Miri: $MIRI_NIGHTLY" +rustup default "$MIRI_NIGHTLY" +rustup component add miri + +# Run tests. +cargo miri test +cargo miri test --all-features + +# Restore old state in case Travis uses this cache for other jobs. +rustup default nightly diff --git a/bash-5.1/vendor/memoffset/src/lib.rs b/bash-5.1/vendor/memoffset/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..d80ff17437f9bb1dede1476249c1a5c480da2baa --- /dev/null +++ b/bash-5.1/vendor/memoffset/src/lib.rs @@ -0,0 +1,92 @@ +// Copyright (c) 2017 Gilad Naaman +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//! A crate used for calculating offsets of struct members and their spans. +//! +//! This functionality currently can not be used in compile time code such as `const` or `const fn` definitions. +//! +//! ## Examples +//! ``` +//! use memoffset::{offset_of, span_of}; +//! +//! #[repr(C, packed)] +//! struct HelpMeIAmTrappedInAStructFactory { +//! help_me_before_they_: [u8; 15], +//! a: u32 +//! } +//! +//! fn main() { +//! assert_eq!(offset_of!(HelpMeIAmTrappedInAStructFactory, a), 15); +//! assert_eq!(span_of!(HelpMeIAmTrappedInAStructFactory, a), 15..19); +//! assert_eq!(span_of!(HelpMeIAmTrappedInAStructFactory, help_me_before_they_ .. a), 0..15); +//! } +//! ``` +//! +//! This functionality can be useful, for example, for checksum calculations: +//! +//! ```ignore +//! #[repr(C, packed)] +//! struct Message { +//! header: MessageHeader, +//! fragment_index: u32, +//! fragment_count: u32, +//! payload: [u8; 1024], +//! checksum: u16 +//! } +//! +//! let checksum_range = &raw[span_of!(Message, header..checksum)]; +//! let checksum = crc16(checksum_range); +//! ``` + +#![no_std] +#![cfg_attr( + feature = "unstable_const", + feature(const_ptr_offset_from, const_refs_to_cell) +)] + +#[macro_use] +#[cfg(doctests)] +#[cfg(doctest)] +extern crate doc_comment; +#[cfg(doctests)] +#[cfg(doctest)] +doctest!("../README.md"); + +/// Hidden module for things the macros need to access. +#[doc(hidden)] +pub mod __priv { + #[doc(hidden)] + pub use core::mem; + #[doc(hidden)] + pub use core::ptr; + + /// Use type inference to obtain the size of the pointee (without actually using the pointer). + #[doc(hidden)] + pub fn size_of_pointee(_ptr: *const T) -> usize { + mem::size_of::() + } +} + +#[macro_use] +mod raw_field; +#[macro_use] +mod offset_of; +#[macro_use] +mod span_of; diff --git a/bash-5.1/vendor/memoffset/src/offset_of.rs b/bash-5.1/vendor/memoffset/src/offset_of.rs new file mode 100644 index 0000000000000000000000000000000000000000..8596e45cf6148ab022d46f9be47ca02fac3426d0 --- /dev/null +++ b/bash-5.1/vendor/memoffset/src/offset_of.rs @@ -0,0 +1,282 @@ +// Copyright (c) 2017 Gilad Naaman +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +/// Macro to create a local `base_ptr` raw pointer of the given type, avoiding UB as +/// much as is possible currently. +#[cfg(maybe_uninit)] +#[macro_export] +#[doc(hidden)] +macro_rules! _memoffset__let_base_ptr { + ($name:ident, $type:ty) => { + // No UB here, and the pointer does not dangle, either. + // But we have to make sure that `uninit` lives long enough, + // so it has to be in the same scope as `$name`. That's why + // `let_base_ptr` declares a variable (several, actually) + // instead of returning one. + let uninit = $crate::__priv::mem::MaybeUninit::<$type>::uninit(); + let $name: *const $type = uninit.as_ptr(); + }; +} +#[cfg(not(maybe_uninit))] +#[macro_export] +#[doc(hidden)] +macro_rules! _memoffset__let_base_ptr { + ($name:ident, $type:ty) => { + // No UB right here, but we will later dereference this pointer to + // offset into a field, and that is UB because the pointer is dangling. + let $name = $crate::__priv::mem::align_of::<$type>() as *const $type; + }; +} + +/// Macro to compute the distance between two pointers. +#[cfg(feature = "unstable_const")] +#[macro_export] +#[doc(hidden)] +macro_rules! _memoffset_offset_from_unsafe { + ($field:expr, $base:expr) => {{ + let field = $field; // evaluate $field outside the `unsafe` block + let base = $base; // evaluate $base outside the `unsafe` block + // Compute offset, with unstable `offset_from` for const-compatibility. + // (Requires the pointers to not dangle, but we already need that for `raw_field!` anyway.) + unsafe { (field as *const u8).offset_from(base as *const u8) as usize } + }}; +} +#[cfg(not(feature = "unstable_const"))] +#[macro_export] +#[doc(hidden)] +macro_rules! _memoffset_offset_from_unsafe { + ($field:expr, $base:expr) => { + // Compute offset. + ($field as usize) - ($base as usize) + }; +} + +/// Calculates the offset of the specified field from the start of the named struct. +/// +/// ## Examples +/// ``` +/// use memoffset::offset_of; +/// +/// #[repr(C, packed)] +/// struct Foo { +/// a: u32, +/// b: u64, +/// c: [u8; 5] +/// } +/// +/// fn main() { +/// assert_eq!(offset_of!(Foo, a), 0); +/// assert_eq!(offset_of!(Foo, b), 4); +/// } +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! offset_of { + ($parent:path, $field:tt) => {{ + // Get a base pointer (non-dangling if rustc supports `MaybeUninit`). + _memoffset__let_base_ptr!(base_ptr, $parent); + // Get field pointer. + let field_ptr = raw_field!(base_ptr, $parent, $field); + // Compute offset. + _memoffset_offset_from_unsafe!(field_ptr, base_ptr) + }}; +} + +/// Calculates the offset of the specified field from the start of the tuple. +/// +/// ## Examples +/// ``` +/// use memoffset::offset_of_tuple; +/// +/// fn main() { +/// assert!(offset_of_tuple!((u8, u32), 1) >= 0, "Tuples do not have a defined layout"); +/// } +/// ``` +#[cfg(tuple_ty)] +#[macro_export(local_inner_macros)] +macro_rules! offset_of_tuple { + ($parent:ty, $field:tt) => {{ + // Get a base pointer (non-dangling if rustc supports `MaybeUninit`). + _memoffset__let_base_ptr!(base_ptr, $parent); + // Get field pointer. + let field_ptr = raw_field_tuple!(base_ptr, $parent, $field); + // Compute offset. + _memoffset_offset_from_unsafe!(field_ptr, base_ptr) + }}; +} + +#[cfg(test)] +mod tests { + #[test] + fn offset_simple() { + #[repr(C)] + struct Foo { + a: u32, + b: [u8; 2], + c: i64, + } + + assert_eq!(offset_of!(Foo, a), 0); + assert_eq!(offset_of!(Foo, b), 4); + assert_eq!(offset_of!(Foo, c), 8); + } + + #[test] + #[cfg_attr(miri, ignore)] // this creates unaligned references + fn offset_simple_packed() { + #[repr(C, packed)] + struct Foo { + a: u32, + b: [u8; 2], + c: i64, + } + + assert_eq!(offset_of!(Foo, a), 0); + assert_eq!(offset_of!(Foo, b), 4); + assert_eq!(offset_of!(Foo, c), 6); + } + + #[test] + fn tuple_struct() { + #[repr(C)] + struct Tup(i32, i32); + + assert_eq!(offset_of!(Tup, 0), 0); + assert_eq!(offset_of!(Tup, 1), 4); + } + + #[test] + fn path() { + mod sub { + #[repr(C)] + pub struct Foo { + pub x: u32, + } + } + + assert_eq!(offset_of!(sub::Foo, x), 0); + } + + #[test] + fn inside_generic_method() { + struct Pair(T, U); + + fn foo(_: Pair) -> usize { + offset_of!(Pair, 1) + } + + assert_eq!(foo(Pair(0, 0)), 4); + } + + #[cfg(tuple_ty)] + #[test] + fn test_tuple_offset() { + let f = (0i32, 0.0f32, 0u8); + let f_ptr = &f as *const _; + let f1_ptr = &f.1 as *const _; + + assert_eq!( + f1_ptr as usize - f_ptr as usize, + offset_of_tuple!((i32, f32, u8), 1) + ); + } + + #[test] + fn test_raw_field() { + #[repr(C)] + struct Foo { + a: u32, + b: [u8; 2], + c: i64, + } + + let f: Foo = Foo { + a: 0, + b: [0, 0], + c: 0, + }; + let f_ptr = &f as *const _; + assert_eq!(f_ptr as usize + 0, raw_field!(f_ptr, Foo, a) as usize); + assert_eq!(f_ptr as usize + 4, raw_field!(f_ptr, Foo, b) as usize); + assert_eq!(f_ptr as usize + 8, raw_field!(f_ptr, Foo, c) as usize); + } + + #[cfg(tuple_ty)] + #[test] + fn test_raw_field_tuple() { + let t = (0u32, 0u8, false); + let t_ptr = &t as *const _; + let t_addr = t_ptr as usize; + + assert_eq!( + &t.0 as *const _ as usize - t_addr, + raw_field_tuple!(t_ptr, (u32, u8, bool), 0) as usize - t_addr + ); + assert_eq!( + &t.1 as *const _ as usize - t_addr, + raw_field_tuple!(t_ptr, (u32, u8, bool), 1) as usize - t_addr + ); + assert_eq!( + &t.2 as *const _ as usize - t_addr, + raw_field_tuple!(t_ptr, (u32, u8, bool), 2) as usize - t_addr + ); + } + + #[cfg(feature = "unstable_const")] + #[test] + fn const_offset() { + #[repr(C)] + struct Foo { + a: u32, + b: [u8; 2], + c: i64, + } + + assert_eq!([0; offset_of!(Foo, b)].len(), 4); + } + + #[cfg(feature = "unstable_const")] + #[test] + fn const_offset_interior_mutable() { + #[repr(C)] + struct Foo { + a: u32, + b: core::cell::Cell, + } + + assert_eq!([0; offset_of!(Foo, b)].len(), 4); + } + + #[cfg(feature = "unstable_const")] + #[test] + fn const_fn_offset() { + const fn test_fn() -> usize { + #[repr(C)] + struct Foo { + a: u32, + b: [u8; 2], + c: i64, + } + + offset_of!(Foo, b) + } + + assert_eq!([0; test_fn()].len(), 4); + } +} diff --git a/bash-5.1/vendor/memoffset/src/raw_field.rs b/bash-5.1/vendor/memoffset/src/raw_field.rs new file mode 100644 index 0000000000000000000000000000000000000000..a8dd2b359449d129a39e04261cc0b3e81f22e4bb --- /dev/null +++ b/bash-5.1/vendor/memoffset/src/raw_field.rs @@ -0,0 +1,117 @@ +// Copyright (c) 2020 Gilad Naaman, Ralf Jung +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +/// `addr_of!`, or just ref-then-cast when that is not available. +#[cfg(raw_ref_macros)] +#[macro_export] +#[doc(hidden)] +macro_rules! _memoffset__addr_of { + ($path:expr) => {{ + $crate::__priv::ptr::addr_of!($path) + }}; +} +#[cfg(not(raw_ref_macros))] +#[macro_export] +#[doc(hidden)] +macro_rules! _memoffset__addr_of { + ($path:expr) => {{ + // This is UB because we create an intermediate reference to uninitialized memory. + // Nothing we can do about that without `addr_of!` though. + &$path as *const _ + }}; +} + +/// Deref-coercion protection macro. +#[cfg(allow_clippy)] +#[macro_export] +#[doc(hidden)] +macro_rules! _memoffset__field_check { + ($type:path, $field:tt) => { + // Make sure the field actually exists. This line ensures that a + // compile-time error is generated if $field is accessed through a + // Deref impl. + #[allow(clippy::unneeded_field_pattern)] + let $type { $field: _, .. }; + }; +} +#[cfg(not(allow_clippy))] +#[macro_export] +#[doc(hidden)] +macro_rules! _memoffset__field_check { + ($type:path, $field:tt) => { + // Make sure the field actually exists. This line ensures that a + // compile-time error is generated if $field is accessed through a + // Deref impl. + let $type { $field: _, .. }; + }; +} + +/// Deref-coercion protection macro. +#[macro_export] +#[doc(hidden)] +macro_rules! _memoffset__field_check_tuple { + ($type:ty, $field:tt) => { + // Make sure the type argument is a tuple + let (_, ..): $type; + }; +} + +/// Computes a const raw pointer to the given field of the given base pointer +/// to the given parent type. +/// +/// The `base` pointer *must not* be dangling, but it *may* point to +/// uninitialized memory. +#[macro_export(local_inner_macros)] +macro_rules! raw_field { + ($base:expr, $parent:path, $field:tt) => {{ + _memoffset__field_check!($parent, $field); + let base = $base; // evaluate $base outside the `unsafe` block + + // Get the field address. + // Crucially, we know that this will not trigger a deref coercion because + // of the field check we did above. + #[allow(unused_unsafe)] // for when the macro is used in an unsafe block + unsafe { + _memoffset__addr_of!((*(base as *const $parent)).$field) + } + }}; +} + +/// Computes a const raw pointer to the given field of the given base pointer +/// to the given parent tuple typle. +/// +/// The `base` pointer *must not* be dangling, but it *may* point to +/// uninitialized memory. +#[cfg(tuple_ty)] +#[macro_export(local_inner_macros)] +macro_rules! raw_field_tuple { + ($base:expr, $parent:ty, $field:tt) => {{ + _memoffset__field_check_tuple!($parent, $field); + let base = $base; // evaluate $base outside the `unsafe` block + + // Get the field address. + // Crucially, we know that this will not trigger a deref coercion because + // of the field check we did above. + #[allow(unused_unsafe)] // for when the macro is used in an unsafe block + unsafe { + _memoffset__addr_of!((*(base as *const $parent)).$field) + } + }}; +} diff --git a/bash-5.1/vendor/memoffset/src/span_of.rs b/bash-5.1/vendor/memoffset/src/span_of.rs new file mode 100644 index 0000000000000000000000000000000000000000..aab9d0acaf2ffe83e4ffdb03b1dd833c0e422737 --- /dev/null +++ b/bash-5.1/vendor/memoffset/src/span_of.rs @@ -0,0 +1,256 @@ +// Copyright (c) 2017 Gilad Naaman +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +/// Reexport for `local_inner_macros`; see +/// . +#[doc(hidden)] +#[macro_export] +macro_rules! _memoffset__compile_error { + ($($inner:tt)*) => { + compile_error! { $($inner)* } + } +} + +/// Produces a range instance representing the sub-slice containing the specified member. +/// +/// This macro provides 2 forms of differing functionalities. +/// +/// The first form is identical to the appearance of the `offset_of!` macro. +/// +/// ```ignore +/// span_of!(Struct, member) +/// ``` +/// +/// The second form of `span_of!` returns a sub-slice which starts at one field, and ends at another. +/// The general pattern of this form is: +/// +/// ```ignore +/// // Exclusive +/// span_of!(Struct, member_a .. member_b) +/// // Inclusive +/// span_of!(Struct, member_a ..= member_b) +/// +/// // Open-ended ranges +/// span_of!(Struct, .. end) +/// span_of!(Struct, start ..) +/// ``` +/// +/// *Note*: +/// This macro uses recursion in order to resolve the range expressions, so there is a limit to +/// the complexity of the expression. +/// In order to raise the limit, the compiler's recursion limit should be lifted. +/// +/// ## Examples +/// ``` +/// use memoffset::span_of; +/// +/// #[repr(C)] +/// struct Florp { +/// a: u32 +/// } +/// +/// #[repr(C)] +/// struct Blarg { +/// x: [u32; 2], +/// y: [u8; 56], +/// z: Florp, +/// egg: [[u8; 4]; 4] +/// } +/// +/// fn main() { +/// assert_eq!(0..84, span_of!(Blarg, ..)); +/// assert_eq!(0..8, span_of!(Blarg, .. y)); +/// assert_eq!(0..64, span_of!(Blarg, ..= y)); +/// assert_eq!(0..8, span_of!(Blarg, x)); +/// assert_eq!(8..84, span_of!(Blarg, y ..)); +/// assert_eq!(0..8, span_of!(Blarg, x .. y)); +/// assert_eq!(0..64, span_of!(Blarg, x ..= y)); +/// } +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! span_of { + (@helper $root:ident, [] ..=) => { + _memoffset__compile_error!("Expected a range, found '..='") + }; + (@helper $root:ident, [] ..) => { + _memoffset__compile_error!("Expected a range, found '..'") + }; + // No explicit begin for range. + (@helper $root:ident, $parent:path, [] ..) => {{ + ($root as usize, + $root as usize + $crate::__priv::size_of_pointee($root)) + }}; + (@helper $root:ident, $parent:path, [] ..= $end:tt) => {{ + let end = raw_field!($root, $parent, $end); + ($root as usize, end as usize + $crate::__priv::size_of_pointee(end)) + }}; + (@helper $root:ident, $parent:path, [] .. $end:tt) => {{ + ($root as usize, raw_field!($root, $parent, $end) as usize) + }}; + // Explicit begin and end for range. + (@helper $root:ident, $parent:path, # $begin:tt [] ..= $end:tt) => {{ + let begin = raw_field!($root, $parent, $begin); + let end = raw_field!($root, $parent, $end); + (begin as usize, end as usize + $crate::__priv::size_of_pointee(end)) + }}; + (@helper $root:ident, $parent:path, # $begin:tt [] .. $end:tt) => {{ + (raw_field!($root, $parent, $begin) as usize, + raw_field!($root, $parent, $end) as usize) + }}; + // No explicit end for range. + (@helper $root:ident, $parent:path, # $begin:tt [] ..) => {{ + (raw_field!($root, $parent, $begin) as usize, + $root as usize + $crate::__priv::size_of_pointee($root)) + }}; + (@helper $root:ident, $parent:path, # $begin:tt [] ..=) => {{ + _memoffset__compile_error!( + "Found inclusive range to the end of a struct. Did you mean '..' instead of '..='?") + }}; + // Just one field. + (@helper $root:ident, $parent:path, # $field:tt []) => {{ + let field = raw_field!($root, $parent, $field); + (field as usize, field as usize + $crate::__priv::size_of_pointee(field)) + }}; + // Parsing. + (@helper $root:ident, $parent:path, $(# $begin:tt)+ [] $tt:tt $($rest:tt)*) => {{ + span_of!(@helper $root, $parent, $(#$begin)* #$tt [] $($rest)*) + }}; + (@helper $root:ident, $parent:path, [] $tt:tt $($rest:tt)*) => {{ + span_of!(@helper $root, $parent, #$tt [] $($rest)*) + }}; + + // Entry point. + ($sty:path, $($exp:tt)+) => ({ + // Get a base pointer. + _memoffset__let_base_ptr!(root, $sty); + let base = root as usize; + let (begin, end) = span_of!(@helper root, $sty, [] $($exp)*); + begin-base..end-base + }); +} + +#[cfg(test)] +mod tests { + use core::mem; + + #[test] + fn span_simple() { + #[repr(C)] + struct Foo { + a: u32, + b: [u8; 2], + c: i64, + } + + assert_eq!(span_of!(Foo, a), 0..4); + assert_eq!(span_of!(Foo, b), 4..6); + assert_eq!(span_of!(Foo, c), 8..8 + 8); + } + + #[test] + #[cfg_attr(miri, ignore)] // this creates unaligned references + fn span_simple_packed() { + #[repr(C, packed)] + struct Foo { + a: u32, + b: [u8; 2], + c: i64, + } + + assert_eq!(span_of!(Foo, a), 0..4); + assert_eq!(span_of!(Foo, b), 4..6); + assert_eq!(span_of!(Foo, c), 6..6 + 8); + } + + #[test] + fn span_forms() { + #[repr(C)] + struct Florp { + a: u32, + } + + #[repr(C)] + struct Blarg { + x: u64, + y: [u8; 56], + z: Florp, + egg: [[u8; 4]; 5], + } + + // Love me some brute force + assert_eq!(0..8, span_of!(Blarg, x)); + assert_eq!(64..68, span_of!(Blarg, z)); + assert_eq!(68..mem::size_of::(), span_of!(Blarg, egg)); + + assert_eq!(8..64, span_of!(Blarg, y..z)); + assert_eq!(0..64, span_of!(Blarg, x..=y)); + } + + #[test] + fn ig_test() { + #[repr(C)] + struct Member { + foo: u32, + } + + #[repr(C)] + struct Test { + x: u64, + y: [u8; 56], + z: Member, + egg: [[u8; 4]; 4], + } + + assert_eq!(span_of!(Test, ..x), 0..0); + assert_eq!(span_of!(Test, ..=x), 0..8); + assert_eq!(span_of!(Test, ..y), 0..8); + assert_eq!(span_of!(Test, ..=y), 0..64); + assert_eq!(span_of!(Test, ..z), 0..64); + assert_eq!(span_of!(Test, ..=z), 0..68); + assert_eq!(span_of!(Test, ..egg), 0..68); + assert_eq!(span_of!(Test, ..=egg), 0..84); + assert_eq!(span_of!(Test, ..), 0..mem::size_of::()); + assert_eq!( + span_of!(Test, x..), + offset_of!(Test, x)..mem::size_of::() + ); + assert_eq!( + span_of!(Test, y..), + offset_of!(Test, y)..mem::size_of::() + ); + + assert_eq!( + span_of!(Test, z..), + offset_of!(Test, z)..mem::size_of::() + ); + assert_eq!( + span_of!(Test, egg..), + offset_of!(Test, egg)..mem::size_of::() + ); + assert_eq!( + span_of!(Test, x..y), + offset_of!(Test, x)..offset_of!(Test, y) + ); + assert_eq!( + span_of!(Test, x..=y), + offset_of!(Test, x)..offset_of!(Test, y) + mem::size_of::<[u8; 56]>() + ); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/.cargo-checksum.json b/bash-5.1/vendor/nix-0.23.1/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..27737e6f172ca6d204c6149752175c3519e1970d --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"0f61d921a725184e0b751fafe4facf309f66f51e6ec008ed4a155aab7d6f5fd7","Cargo.toml":"a355ac1778ff0fac880a96f375ff267c3f60df6a961c245339dd2664e0f9c294","LICENSE":"66e3ee1fa7f909ad3c612d556f2a0cdabcd809ad6e66f3b0605015ac64841b70","README.md":"a025a45d01d256e4dff5445f84c9ab81e510f17d5c491dd0e88372cd0f738076","src/dir.rs":"87accca507d4023d2f040101aed2b1684dc6dba81c09c7efb068c0b6ea0dfd78","src/env.rs":"3657fb51d8569ed525787e22cd2adb0ea5eb250d27641cfb8926be6908be4f38","src/errno.rs":"dfd94a76ced3cb3c2d12db4e4ea557a8123361d6d5d0577c1588425067b87957","src/fcntl.rs":"f43d5bd24238686f57766023be3421c64ec03c40cdcab77ebe635320e4818130","src/features.rs":"939e9512b4cf4192e18b7ba6557896c8a65f26bbbe78361e786e50bfd06168fb","src/ifaddrs.rs":"4f19ed3b15f5059c2859958c6aa313d6fa75703e68f8608359ef8e0089508ed3","src/kmod.rs":"9031edb7b0a8ed1d6635163c9c32490537d5c204e9794cce9dc2db24ead60957","src/lib.rs":"50820d5cdb642823f80b14622e29a47bcc36b9983c5884bbb23376fb7eeb4229","src/macros.rs":"49577415d703c089bf45f352b0da8c796dc5173fbe85329b8d8070c987ed6019","src/mount/bsd.rs":"37790209392c66105704986905f12b05215fcf1595c23ca4f16a8af93e55c0b8","src/mount/linux.rs":"cb82f6be7fb1cf131ee89b65dfa0d30df853fe934ff3bb2c9f7fe65f56bd2a21","src/mount/mod.rs":"6929135b12505c270cc2253fcabdae0d4cc92191b2171cf62645e7ec93cf5157","src/mqueue.rs":"2551fb14e10482dbb6db187f02794be613d207074fd8953caf27088aa4f880b7","src/net/if_.rs":"4b797a75d1c20fa53ae9ccea86fa421342c468a7e8ff737a129ab831464169d2","src/net/mod.rs":"577f70170e53d4a6de1abb70bf8f1031ec3e65c0e63ef5fcf05c907125e7ac17","src/poll.rs":"a3d4c17ed046d838e0cb55051d93f6d5585f73934fe1dfcb94e422735fc051ef","src/pty.rs":"dc9c19d91c176f41548bdde9a79f0663b01115688f474542c48f6736c433a709","src/sched.rs":"fcfb4f8886931a8aeeb5ac957956a19ba43dfa75d7fb473d7e8d7c8c0b173054","src/sys/aio.rs":"3e499c53bb3f1f62851543a307f22e552f0b3c971a06ca36c98a14645236e6c3","src/sys/epoll.rs":"11582831df3fa13e2f1f7fc024c1d5142a8dbfb94f6ab9b206e40e025f4a9106","src/sys/event.rs":"5768b2fed5cf8952b76c2292a0e9625b355a605b7276b1604459f01d1462b588","src/sys/eventfd.rs":"bc8009f19e8b93b03d0202896e10bd08497f34e2987bb8ce864d6cde11eab892","src/sys/inotify.rs":"5f970799355fe395cdcc81fcffab9b62eeb79f1127f935e76f51a8e0a59083e6","src/sys/ioctl/bsd.rs":"76acf6de6c9e2cd9367835f1b97815120e4baede4c2200661f396be4e4eb800e","src/sys/ioctl/linux.rs":"642b25d3997518815dea454fa976e9067ad5fe4ed75622e7540e3f0d0c7d320a","src/sys/ioctl/mod.rs":"6341f40c37227c77ca4bbb1864e60f99c43898eeaaf05ebb5132be1129550f4b","src/sys/memfd.rs":"72a153df4da17ea0cc4ce90ee3c47c5bec24c6e32fbb4ee7c77c1a89d79efbdd","src/sys/mman.rs":"8c519c52194c2928d93f0f33159b09fdfa420522b5a48fc84cbe2689db5424a0","src/sys/mod.rs":"21df0a582abff77c5706f01667e3aed97385a1b8c6cb8bb7e8678323c3ca31ec","src/sys/personality.rs":"1ce33010f0b8343f8f3167d3c7905a9a1e43c656e5db4043072bf0dd411cdeba","src/sys/pthread.rs":"a0e57ebb60463bf7e62536cccfe6ab352a7e8d5d99004837e29fe10ae91a13c4","src/sys/ptrace/bsd.rs":"0b9293cf21f23a790fd5c0e8744e31826d229e320603de782d7bb6fd4aaede33","src/sys/ptrace/linux.rs":"fc36f737463d001c47ba7830909eb458a18ecf4a5e33d59447a921e5d5fb6ae7","src/sys/ptrace/mod.rs":"671a6ccac955e75d5998f7e53ffc45ed4c7b6522a0f24a0937d60141f692dd39","src/sys/quota.rs":"1b60c34302e6fad9422fe0bec9fe7e6b93fbe554b8cfe98ecf5834daf93c84de","src/sys/reboot.rs":"865310ee46951a49e51ec368f854368faa9eb1dcead51280aa758e125294d672","src/sys/resource.rs":"c1a8fc95d8dc239e5be1a11ab690a053abdbd7ead42e1f1e4f83e822f8b81867","src/sys/select.rs":"4f0e476faa4447bb59f795e71b28f9440c17396429af05ac6dc67ed78104a292","src/sys/sendfile.rs":"8858c15b27e5bf3acb6b6c2740fc5e3cad057293c6e65314b949e4c2273c7fb5","src/sys/signal.rs":"b3855c93ddc1f9d415d7e2b6ca870c3ac225496ffdf085f6a6e95e2c49017d9b","src/sys/signalfd.rs":"2677af132b9f01ec277615a5d039f49fbdd06dc4442639df668561b74b9785c4","src/sys/socket/addr.rs":"b1003c0b6dbe7c1b1a76a5882a43a6ae6bbffa7d587d27fab00e8334693e1a83","src/sys/socket/mod.rs":"281f12673fa136da83ecd9a0c4361a94ff96894c83077246081fedb40fac4645","src/sys/socket/sockopt.rs":"b894b009a07935a3236a3fb7e159a0fb67f5e2fd1c7c61264948d1022f0ddb80","src/sys/stat.rs":"7c7bd8e895040b0f05a7eee3d8ab559566262ebdae711cb19ca8f19dd16d93c6","src/sys/statfs.rs":"dd14609e60bca2d09b84c10a9b7ba28d35ca7df529a94e62b0f7c5bfe4203eb6","src/sys/statvfs.rs":"1b27b88ef4bdd33a5005519e5e263d6b929980746d49e2768d9dba5466ce1138","src/sys/sysinfo.rs":"7ff86d7848c2e8ded13b47dc53bf24cb0f4d7f3ded634d6d2f34558a2511ed99","src/sys/termios.rs":"ef1926cd1db964ebeb33775aa9f219506a11be22df499d2479eb3c4aa91b7753","src/sys/time.rs":"6ff8a79d143332995060b40b5bdf9596a03ed4b9195183d2331787394d6e389d","src/sys/timerfd.rs":"1ea212abc30742e99fe280e294cdab7ac182336f86e874d19b128a1413945365","src/sys/uio.rs":"92be85585382a45a24db7c82bc79983df5c8ccc8889f191494dfcf8d5b6a7daf","src/sys/utsname.rs":"f7d02dda48a328d733677d40984227441090efa5ad4865c1c43552735a43d13e","src/sys/wait.rs":"6acfb219db9f5b36577b36b12071dd7d671c0d23cd731e3549017fd59d9c479e","src/time.rs":"bf585149bc0c2df2d94acd5658ea821493adb1afa8b0c6011ae301e3ead104de","src/ucontext.rs":"863d783443be1307477daf1970a42594d17d637aba94c8e5b63d5d9a49ea624b","src/unistd.rs":"4bdf24d32c4d5cfd2a25140d4cf3e93761f80df4a94610cd27cdbf277694cb86","test/common/mod.rs":"89c8980966aa17a8d3f5872b44648f1541276e2331854203d327f7f36c86ee77","test/sys/mod.rs":"3f71863e16193521cc366b2daf21e56365a30208f0b2f117844f68c2e1404636","test/sys/test_aio.rs":"414af194f06b35b83a692e3569801f2c6b7999ba7b55b59f006091902e00146e","test/sys/test_aio_drop.rs":"b05b58b3fc5253f389e1869ee6fc3833701572fb68ed57bf79237080dac3125d","test/sys/test_epoll.rs":"c982bd8fa90c615a6f11de2c816b4553e11171dbbdd8db0944166fb044221a16","test/sys/test_inotify.rs":"dc3e4fe548b0b3b71f94c9bfc157c21b017f5ce8df9dee599849f3bfe7c222bb","test/sys/test_ioctl.rs":"b809085aca01c351380b3ab650153d3800f7271391e090b6f2d6dc9186ee50f4","test/sys/test_lio_listio_resubmit.rs":"436135fce2d2e55cfc9a3a18d43ca15018feb1a51b870eed56dff2f734b9c059","test/sys/test_mman.rs":"d149493cad917afaa7fcba8c74c42f3ba22420099917818399b8af1305a8e00b","test/sys/test_pthread.rs":"4be4a467ead0633429157c1b2191eb28962c5670aeb2ad6fe872acb95c336129","test/sys/test_ptrace.rs":"71634c3405ddb37c241a3cebe60c11516b95b82d29adaf13182bb36d0b50c6cb","test/sys/test_select.rs":"913ee0569c539fbf8f8d87678cec7ceb9d5529c184e72af845c8076b099b7d29","test/sys/test_signal.rs":"619aeb586309ffd2547b22c37475bb8cf6e88717c4cc114df72f6786b14de1f3","test/sys/test_signalfd.rs":"cccba36d0aba74178d78571dbd728448c8c23aba9063ad5ee24c7d89d01429c6","test/sys/test_socket.rs":"ec6d34cf06d1c52c32ba1bc5c13cd837968738f6268d976d136d7cc6128b9a26","test/sys/test_sockopt.rs":"ae74873a34be764c20c358a73002c10447b9f79055475f7c109d9f6f29c2bd72","test/sys/test_sysinfo.rs":"1e1bea9130fe38ccb07cd0ad7334c7be1e45efc33f7656a5973f8cad7126f225","test/sys/test_termios.rs":"9a9fb30655f418b59851edc9a9763f0fa1a97faaa5310989d9fa9a5c21add111","test/sys/test_timerfd.rs":"fcada956abd981e4d846da58e5640c5705b16026d47bccd1d603fae765ad10db","test/sys/test_uio.rs":"88a9616172beb9ed63021ec19aadf7c439d6f2fc42548fa265c4c7df8f65085f","test/sys/test_wait.rs":"ba95237600e1b825f09a3976219787a5041c6ba12296640070fd1244b9533539","test/test.rs":"8b6834fd1627d81f5bb5de3eef628b8e04e6b1bbed5e2c6947e25af921b7c65f","test/test_clearenv.rs":"45ca548035b3c20ec87314715feaba2be973709a635d85b8cde46fd1d9f1ecd4","test/test_dir.rs":"837d1666d6c48da3ae9f172fa32a497e0d61af94f1e5335c2afd16eafd6b1989","test/test_fcntl.rs":"04479bb8c082860481c9833911cb28fe4a62d35e1e0b283be045e2e53642ae5d","test/test_kmod/hello_mod/Makefile":"0219f7bce0603f97d997fb377ca071966c90333ecc665e78a54dfeb97a9c811b","test/test_kmod/hello_mod/hello.c":"bcac6b19c5bd807e1f3878c15e426acc85785a8ade9840c3bb4d068635c9188c","test/test_kmod/mod.rs":"58ac2bfb788480833d0bab990177324a405bd56d980edc222807acfb12ef23cf","test/test_mount.rs":"fc3fb51f4e7262dd8424e183e07919b378d5996b021544471b7cb1b3f9ad945f","test/test_mq.rs":"d9032902fcab0a69574ba09dd7fa9fa7db60cb1a1dd875124461276547dbdae5","test/test_net.rs":"d027680cdb1e2eed9e6912267b42a30cc0d81399826e03abfd7de81296a88282","test/test_nix_path.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","test/test_nmount.rs":"26ecb0c687d9403e2d34d8e67733ddeeba7b4820f886ffa14e75f05ec4de38ea","test/test_poll.rs":"7c7ca94669c7879ee73d793a0261b27904b80c0bb380a5b5acdd4960c9c1aba5","test/test_pty.rs":"7cbc9a5c49fda499b957ef428e29f2c898aa772a9999c1a694f40f52a5a291bf","test/test_ptymaster_drop.rs":"48ae888ff4573c68e4da7d1fa737374deb307afb64deff2d788d1e0c81a11112","test/test_resource.rs":"569b95e16e84ab42a93ff9268bbb8545397408cbac17feb104a9559e8b0798ef","test/test_sched.rs":"f8ad92eb554164b0f92428f716db99040186d741cc6e1976f7930f099652f70c","test/test_sendfile.rs":"31d3f4982fe73610e216d9c332342b98c2c21de34b933744bfb3193d17376764","test/test_stat.rs":"c5358407e345bba02b827e2a3bd622bde4ec064dfdd5516b1b74561ad3e8dda5","test/test_time.rs":"bf668b680db81e443fb402a2580425553329636cd39fad70b828041ea894b43a","test/test_unistd.rs":"72a555c71232592de6a3799e11432e1eb73e0477dbf737868c1232e90aca822c"},"package":"9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6"} \ No newline at end of file diff --git a/bash-5.1/vendor/nix-0.23.1/CHANGELOG.md b/bash-5.1/vendor/nix-0.23.1/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..77d5b2a3268ab92c98eb5f2a06a53c8b602fee85 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/CHANGELOG.md @@ -0,0 +1,1233 @@ +# Change Log + +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](https://semver.org/). + +## [0.23.1] - 2021-12-16 + +### Added +### Changed + +- Relaxed the bitflags requirement from 1.3.1 to 1.1. This partially reverts + #1492. From now on, the MSRV is not guaranteed to work with all versions of + all dependencies, just with some version of all dependencies. + (#[1607](https://github.com/nix-rust/nix/pull/1607)) + +### Fixed + +- Fixed soundness issues in `FdSet::insert`, `FdSet::remove`, and + `FdSet::contains` involving file descriptors outside of the range + `0..FD_SETSIZE`. + (#[1575](https://github.com/nix-rust/nix/pull/1575)) + +### Removed + +## [0.23.0] - 2021-09-28 +### Added + +- Added the `LocalPeerCred` sockopt. + (#[1482](https://github.com/nix-rust/nix/pull/1482)) +- Added `TimeSpec::from_duration` and `TimeSpec::from_timespec` + (#[1465](https://github.com/nix-rust/nix/pull/1465)) +- Added `IPV6_V6ONLY` sockopt. + (#[1470](https://github.com/nix-rust/nix/pull/1470)) +- Added `impl From for libc::passwd` trait implementation to convert a `User` + into a `libc::passwd`. Consumes the `User` struct to give ownership over + the member pointers. + (#[1471](https://github.com/nix-rust/nix/pull/1471)) +- Added `pthread_kill`. + (#[1472](https://github.com/nix-rust/nix/pull/1472)) +- Added `mknodat`. + (#[1473](https://github.com/nix-rust/nix/pull/1473)) +- Added `setrlimit` and `getrlimit`. + (#[1302](https://github.com/nix-rust/nix/pull/1302)) +- Added `ptrace::interrupt` method for platforms that support `PTRACE_INTERRUPT` + (#[1422](https://github.com/nix-rust/nix/pull/1422)) +- Added `IP6T_SO_ORIGINAL_DST` sockopt. + (#[1490](https://github.com/nix-rust/nix/pull/1490)) +- Added the `PTRACE_EVENT_STOP` variant to the `sys::ptrace::Event` enum + (#[1335](https://github.com/nix-rust/nix/pull/1335)) +- Exposed `SockAddr::from_raw_sockaddr` + (#[1447](https://github.com/nix-rust/nix/pull/1447)) +- Added `TcpRepair` + (#[1503](https://github.com/nix-rust/nix/pull/1503)) +- Enabled `pwritev` and `preadv` for more operating systems. + (#[1511](https://github.com/nix-rust/nix/pull/1511)) +- Added support for `TCP_MAXSEG` TCP Maximum Segment Size socket options + (#[1292](https://github.com/nix-rust/nix/pull/1292)) +- Added `Ipv4RecvErr` and `Ipv6RecvErr` sockopts and associated control messages. + (#[1514](https://github.com/nix-rust/nix/pull/1514)) +- Added `AsRawFd` implementation on `PollFd`. + (#[1516](https://github.com/nix-rust/nix/pull/1516)) +- Added `Ipv4Ttl` and `Ipv6Ttl` sockopts. + (#[1515](https://github.com/nix-rust/nix/pull/1515)) +- Added `MAP_EXCL`, `MAP_ALIGNED_SUPER`, and `MAP_CONCEAL` mmap flags, and + exposed `MAP_ANONYMOUS` for all operating systems. + (#[1522](https://github.com/nix-rust/nix/pull/1522)) + (#[1525](https://github.com/nix-rust/nix/pull/1525)) + (#[1531](https://github.com/nix-rust/nix/pull/1531)) + (#[1534](https://github.com/nix-rust/nix/pull/1534)) +- Added read/write accessors for 'events' on `PollFd`. + (#[1517](https://github.com/nix-rust/nix/pull/1517)) + +### Changed + +- `FdSet::{contains, highest, fds}` no longer require a mutable reference. + (#[1464](https://github.com/nix-rust/nix/pull/1464)) +- `User::gecos` and corresponding `libc::passwd::pw_gecos` are supported on + 64-bit Android, change conditional compilation to include the field in + 64-bit Android builds + (#[1471](https://github.com/nix-rust/nix/pull/1471)) +- `eventfd`s are supported on Android, change conditional compilation to + include `sys::eventfd::eventfd` and `sys::eventfd::EfdFlags`for Android + builds. + (#[1481](https://github.com/nix-rust/nix/pull/1481)) +- Most enums that come from C, for example `Errno`, are now marked as + `#[non_exhaustive]`. + (#[1474](https://github.com/nix-rust/nix/pull/1474)) +- Many more functions, mostly contructors, are now `const`. + (#[1476](https://github.com/nix-rust/nix/pull/1476)) + (#[1492](https://github.com/nix-rust/nix/pull/1492)) +- `sys::event::KEvent::filter` now returns a `Result` instead of being + infalliable. The only cases where it will now return an error are cases + where it previously would've had undefined behavior. + (#[1484](https://github.com/nix-rust/nix/pull/1484)) +- Minimum supported Rust version is now 1.46.0. + ([#1492](https://github.com/nix-rust/nix/pull/1492)) +- Rework `UnixAddr` to encapsulate internals better in order to fix soundness + issues. No longer allows creating a `UnixAddr` from a raw `sockaddr_un`. + ([#1496](https://github.com/nix-rust/nix/pull/1496)) +- Raised bitflags to 1.3.0 and the MSRV to 1.46.0. + ([#1492](https://github.com/nix-rust/nix/pull/1492)) + +### Fixed + +- `posix_fadvise` now returns errors in the conventional way, rather than as a + non-zero value in `Ok()`. + (#[1538](https://github.com/nix-rust/nix/pull/1538)) +- Added more errno definitions for better backwards compatibility with + Nix 0.21.0. + (#[1467](https://github.com/nix-rust/nix/pull/1467)) +- Fixed potential undefined behavior in `Signal::try_from` on some platforms. + (#[1484](https://github.com/nix-rust/nix/pull/1484)) +- Fixed buffer overflow in `unistd::getgrouplist`. + (#[1545](https://github.com/nix-rust/nix/pull/1545)) + + +### Removed + +- Removed a couple of termios constants on redox that were never actually + supported. + (#[1483](https://github.com/nix-rust/nix/pull/1483)) +- Removed `nix::sys::signal::NSIG`. It was of dubious utility, and not correct + for all platforms. + (#[1484](https://github.com/nix-rust/nix/pull/1484)) +- Removed support for 32-bit Apple targets, since they've been dropped by both + Rustc and Xcode. + (#[1492](https://github.com/nix-rust/nix/pull/1492)) +- Deprecated `SockAddr/InetAddr::to_str` in favor of `ToString::to_string` + (#[1495](https://github.com/nix-rust/nix/pull/1495)) +- Removed `SigevNotify` on OpenBSD and Redox. + (#[1511](https://github.com/nix-rust/nix/pull/1511)) + +## [0.22.0] - 9 July 2021 +### Added +- Added `if_nameindex` (#[1445](https://github.com/nix-rust/nix/pull/1445)) +- Added `nmount` for FreeBSD. + (#[1453](https://github.com/nix-rust/nix/pull/1453)) +- Added `IpFreebind` socket option (sockopt) on Linux, Fuchsia and Android. + (#[1456](https://github.com/nix-rust/nix/pull/1456)) +- Added `TcpUserTimeout` socket option (sockopt) on Linux and Fuchsia. + (#[1457](https://github.com/nix-rust/nix/pull/1457)) +- Added `renameat2` for Linux + (#[1458](https://github.com/nix-rust/nix/pull/1458)) +- Added `RxqOvfl` support on Linux, Fuchsia and Android. + (#[1455](https://github.com/nix-rust/nix/pull/1455)) + +### Changed +- `ptsname_r` now returns a lossily-converted string in the event of bad UTF, + just like `ptsname`. + ([#1446](https://github.com/nix-rust/nix/pull/1446)) +- Nix's error type is now a simple wrapper around the platform's Errno. This + means it is now `Into`. It's also `Clone`, `Copy`, `Eq`, and + has a small fixed size. It also requires less typing. For example, the old + enum variant `nix::Error::Sys(nix::errno::Errno::EINVAL)` is now simply + `nix::Error::EINVAL`. + ([#1446](https://github.com/nix-rust/nix/pull/1446)) + +### Fixed +### Removed + +## [0.21.0] - 31 May 2021 +### Added +- Added `getresuid` and `getresgid` + (#[1430](https://github.com/nix-rust/nix/pull/1430)) +- Added TIMESTAMPNS support for linux + (#[1402](https://github.com/nix-rust/nix/pull/1402)) +- Added `sendfile64` (#[1439](https://github.com/nix-rust/nix/pull/1439)) +- Added `MS_LAZYTIME` to `MsFlags` + (#[1437](https://github.com/nix-rust/nix/pull/1437)) + +### Changed +- Made `forkpty` unsafe, like `fork` + (#[1390](https://github.com/nix-rust/nix/pull/1390)) +- Made `Uid`, `Gid` and `Pid` methods `from_raw` and `as_raw` a `const fn` + (#[1429](https://github.com/nix-rust/nix/pull/1429)) +- Made `Uid::is_root` a `const fn` + (#[1429](https://github.com/nix-rust/nix/pull/1429)) +- `AioCb` is now always pinned. Once a `libc::aiocb` gets sent to the kernel, + its address in memory must not change. Nix now enforces that by using + `std::pin`. Most users won't need to change anything, except when using + `aio_suspend`. See that method's documentation for the new usage. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- `LioCb` is now constructed using a distinct `LioCbBuilder` struct. This + avoids a soundness issue with the old `LioCb`. Usage is similar but + construction now uses the builder pattern. See the documentation for + details. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- Minimum supported Rust version is now 1.41.0. + ([#1440](https://github.com/nix-rust/nix/pull/1440)) +- Errno aliases are now associated consts on `Errno`, instead of consts in the + `errno` module. + (#[1452](https://github.com/nix-rust/nix/pull/1452)) + +### Fixed +- Allow `sockaddr_ll` size, as reported by the Linux kernel, to be smaller then it's definition + (#[1395](https://github.com/nix-rust/nix/pull/1395)) +- Fix spurious errors using `sendmmsg` with multiple cmsgs + (#[1414](https://github.com/nix-rust/nix/pull/1414)) +- Added `Errno::EOPNOTSUPP` to FreeBSD, where it was missing. + (#[1452](https://github.com/nix-rust/nix/pull/1452)) + +### Removed + +- Removed `sys::socket::accept4` from Android arm because libc removed it in + version 0.2.87. + ([#1399](https://github.com/nix-rust/nix/pull/1399)) +- `AioCb::from_boxed_slice` and `AioCb::from_boxed_mut_slice` have been + removed. They were useful with earlier versions of Rust, but should no + longer be needed now that async/await are available. `AioCb`s now work + exclusively with borrowed buffers, not owned ones. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- Removed some Errno values from platforms where they aren't actually defined. + (#[1452](https://github.com/nix-rust/nix/pull/1452)) + +## [0.20.0] - 20 February 2021 +### Added + +- Added a `passwd` field to `Group` (#[1338](https://github.com/nix-rust/nix/pull/1338)) +- Added `mremap` (#[1306](https://github.com/nix-rust/nix/pull/1306)) +- Added `personality` (#[1331](https://github.com/nix-rust/nix/pull/1331)) +- Added limited Fuchsia support (#[1285](https://github.com/nix-rust/nix/pull/1285)) +- Added `getpeereid` (#[1342](https://github.com/nix-rust/nix/pull/1342)) +- Implemented `IntoIterator` for `Dir` + (#[1333](https://github.com/nix-rust/nix/pull/1333)). + +### Changed + +- Minimum supported Rust version is now 1.40.0. + ([#1356](https://github.com/nix-rust/nix/pull/1356)) +- i686-apple-darwin has been demoted to Tier 2 support, because it's deprecated + by Xcode. + (#[1350](https://github.com/nix-rust/nix/pull/1350)) +- Fixed calling `recvfrom` on an `AddrFamily::Packet` socket + (#[1344](https://github.com/nix-rust/nix/pull/1344)) + +### Fixed +- `TimerFd` now closes the underlying fd on drop. + ([#1381](https://github.com/nix-rust/nix/pull/1381)) +- Define `*_MAGIC` filesystem constants on Linux s390x + (#[1372](https://github.com/nix-rust/nix/pull/1372)) +- mqueue, sysinfo, timespec, statfs, test_ptrace_syscall() on x32 + (#[1366](https://github.com/nix-rust/nix/pull/1366)) + +### Removed + +- `Dir`, `SignalFd`, and `PtyMaster` are no longer `Clone`. + (#[1382](https://github.com/nix-rust/nix/pull/1382)) +- Removed `SockLevel`, which hasn't been used for a few years + (#[1362](https://github.com/nix-rust/nix/pull/1362)) +- Removed both `Copy` and `Clone` from `TimerFd`. + ([#1381](https://github.com/nix-rust/nix/pull/1381)) + +## [0.19.1] - 28 November 2020 +### Fixed +- Fixed bugs in `recvmmsg`. + (#[1341](https://github.com/nix-rust/nix/pull/1341)) + +## [0.19.0] - 6 October 2020 +### Added +- Added Netlink protocol families to the `SockProtocol` enum + (#[1289](https://github.com/nix-rust/nix/pull/1289)) +- Added `clock_gettime`, `clock_settime`, `clock_getres`, + `clock_getcpuclockid` functions and `ClockId` struct. + (#[1281](https://github.com/nix-rust/nix/pull/1281)) +- Added wrapper functions for `PTRACE_SYSEMU` and `PTRACE_SYSEMU_SINGLESTEP`. + (#[1300](https://github.com/nix-rust/nix/pull/1300)) +- Add support for Vsock on Android rather than just Linux. + (#[1301](https://github.com/nix-rust/nix/pull/1301)) +- Added `TCP_KEEPCNT` and `TCP_KEEPINTVL` TCP keepalive options. + (#[1283](https://github.com/nix-rust/nix/pull/1283)) +### Changed +- Expose `SeekData` and `SeekHole` on all Linux targets + (#[1284](https://github.com/nix-rust/nix/pull/1284)) +- Changed unistd::{execv,execve,execvp,execvpe,fexecve,execveat} to take both `&[&CStr]` and `&[CString]` as its list argument(s). + (#[1278](https://github.com/nix-rust/nix/pull/1278)) +- Made `unistd::fork` an unsafe funtion, bringing it in line with [libstd's decision](https://github.com/rust-lang/rust/pull/58059). + (#[1293](https://github.com/nix-rust/nix/pull/1293)) +### Fixed +### Removed + +## [0.18.0] - 26 July 2020 +### Added +- Added `fchown(2)` wrapper. + (#[1257](https://github.com/nix-rust/nix/pull/1257)) +- Added support on linux systems for `MAP_HUGE_`_`SIZE`_ family of flags. + (#[1211](https://github.com/nix-rust/nix/pull/1211)) +- Added support for `F_OFD_*` `fcntl` commands on Linux and Android. + (#[1195](https://github.com/nix-rust/nix/pull/1195)) +- Added `env::clearenv()`: calls `libc::clearenv` on platforms + where it's available, and clears the environment of all variables + via `std::env::vars` and `std::env::remove_var` on others. + (#[1185](https://github.com/nix-rust/nix/pull/1185)) +- `FsType` inner value made public. + (#[1187](https://github.com/nix-rust/nix/pull/1187)) +- Added `unistd::setfsuid` and `unistd::setfsgid` to set the user or group + identity for filesystem checks per-thread. + (#[1163](https://github.com/nix-rust/nix/pull/1163)) +- Derived `Ord`, `PartialOrd` for `unistd::Pid` (#[1189](https://github.com/nix-rust/nix/pull/1189)) +- Added `select::FdSet::fds` method to iterate over file descriptors in a set. + ([#1207](https://github.com/nix-rust/nix/pull/1207)) +- Added support for UDP generic segmentation offload (GSO) and generic + receive offload (GRO) ([#1209](https://github.com/nix-rust/nix/pull/1209)) +- Added support for `sendmmsg` and `recvmmsg` calls + (#[1208](https://github.com/nix-rust/nix/pull/1208)) +- Added support for `SCM_CREDS` messages (`UnixCredentials`) on FreeBSD/DragonFly + (#[1216](https://github.com/nix-rust/nix/pull/1216)) +- Added `BindToDevice` socket option (sockopt) on Linux + (#[1233](https://github.com/nix-rust/nix/pull/1233)) +- Added `EventFilter` bitflags for `EV_DISPATCH` and `EV_RECEIPT` on OpenBSD. + (#[1252](https://github.com/nix-rust/nix/pull/1252)) +- Added support for `Ipv4PacketInfo` and `Ipv6PacketInfo` to `ControlMessage`. + (#[1222](https://github.com/nix-rust/nix/pull/1222)) +- `CpuSet` and `UnixCredentials` now implement `Default`. + (#[1244](https://github.com/nix-rust/nix/pull/1244)) +- Added `unistd::ttyname` + (#[1259](https://github.com/nix-rust/nix/pull/1259)) +- Added support for `Ipv4PacketInfo` and `Ipv6PacketInfo` to `ControlMessage` for iOS and Android. + (#[1265](https://github.com/nix-rust/nix/pull/1265)) +- Added support for `TimerFd`. + (#[1261](https://github.com/nix-rust/nix/pull/1261)) + +### Changed +- Changed `fallocate` return type from `c_int` to `()` (#[1201](https://github.com/nix-rust/nix/pull/1201)) +- Enabled `sys::ptrace::setregs` and `sys::ptrace::getregs` on x86_64-unknown-linux-musl target + (#[1198](https://github.com/nix-rust/nix/pull/1198)) +- On Linux, `ptrace::write` is now an `unsafe` function. Caveat programmer. + (#[1245](https://github.com/nix-rust/nix/pull/1245)) +- `execv`, `execve`, `execvp` and `execveat` in `::nix::unistd` and `reboot` in + `::nix::sys::reboot` now return `Result` instead of `Result` (#[1239](https://github.com/nix-rust/nix/pull/1239)) +- `sys::socket::sockaddr_storage_to_addr` is no longer `unsafe`. So is + `offset_of!`. +- `sys::socket::sockaddr_storage_to_addr`, `offset_of!`, and `Errno::clear` are + no longer `unsafe`. +- `SockAddr::as_ffi_pair`,`sys::socket::sockaddr_storage_to_addr`, `offset_of!`, + and `Errno::clear` are no longer `unsafe`. + (#[1244](https://github.com/nix-rust/nix/pull/1244)) +- Several `Inotify` methods now take `self` by value instead of by reference + (#[1244](https://github.com/nix-rust/nix/pull/1244)) +- `nix::poll::ppoll`: `timeout` parameter is now optional, None is equivalent for infinite timeout. + +### Fixed + +- Fixed `getsockopt`. The old code produced UB which triggers a panic with + Rust 1.44.0. + (#[1214](https://github.com/nix-rust/nix/pull/1214)) + +- Fixed a bug in nix::unistd that would result in an infinite loop + when a group or user lookup required a buffer larger than + 16KB. (#[1198](https://github.com/nix-rust/nix/pull/1198)) +- Fixed unaligned casting of `cmsg_data` to `af_alg_iv` (#[1206](https://github.com/nix-rust/nix/pull/1206)) +- Fixed `readlink`/`readlinkat` when reading symlinks longer than `PATH_MAX` (#[1231](https://github.com/nix-rust/nix/pull/1231)) +- `PollFd`, `EpollEvent`, `IpMembershipRequest`, `Ipv6MembershipRequest`, + `TimeVal`, and `IoVec` are now `repr(transparent)`. This is required for + correctness's sake across all architectures and compilers, though now bugs + have been reported so far. + (#[1243](https://github.com/nix-rust/nix/pull/1243)) +- Fixed unaligned pointer read in `Inotify::read_events`. + (#[1244](https://github.com/nix-rust/nix/pull/1244)) + +### Removed + +- Removed `sys::socket::addr::from_libc_sockaddr` from the public API. + (#[1215](https://github.com/nix-rust/nix/pull/1215)) +- Removed `sys::termios::{get_libc_termios, get_libc_termios_mut, update_wrapper` + from the public API. These were previously hidden in the docs but still usable + by downstream. + (#[1235](https://github.com/nix-rust/nix/pull/1235)) + +- Nix no longer implements `NixPath` for `Option

where P: NixPath`. Most + Nix functions that accept `NixPath` arguments can't do anything useful with + `None`. The exceptions (`mount` and `quotactl_sync`) already take explicitly + optional arguments. + (#[1242](https://github.com/nix-rust/nix/pull/1242)) + +- Removed `unistd::daemon` and `unistd::pipe2` on OSX and ios + (#[1255](https://github.com/nix-rust/nix/pull/1255)) + +- Removed `sys::event::FilterFlag::NOTE_EXIT_REPARENTED` and + `sys::event::FilterFlag::NOTE_REAP` on OSX and ios. + (#[1255](https://github.com/nix-rust/nix/pull/1255)) + +- Removed `sys::ptrace::ptrace` on Android and Linux. + (#[1255](https://github.com/nix-rust/nix/pull/1255)) + +- Dropped support for powerpc64-unknown-linux-gnu + (#[1266](https://github.com/nix-rust/nix/pull/1268)) + +## [0.17.0] - 3 February 2020 +### Added +- Add `CLK_TCK` to `SysconfVar` + (#[1177](https://github.com/nix-rust/nix/pull/1177)) +### Changed +### Fixed +### Removed +- Removed deprecated Error::description from error types + (#[1175](https://github.com/nix-rust/nix/pull/1175)) + +## [0.16.1] - 23 December 2019 +### Added +### Changed +### Fixed + +- Fixed the build for OpenBSD + (#[1168](https://github.com/nix-rust/nix/pull/1168)) + +### Removed + +## [0.16.0] - 1 December 2019 +### Added +- Added `ptrace::seize()`: similar to `attach()` on Linux + but with better-defined semantics. + (#[1154](https://github.com/nix-rust/nix/pull/1154)) + +- Added `Signal::as_str()`: returns signal name as `&'static str` + (#[1138](https://github.com/nix-rust/nix/pull/1138)) + +- Added `posix_fallocate`. + ([#1105](https://github.com/nix-rust/nix/pull/1105)) + +- Implemented `Default` for `FdSet` + ([#1107](https://github.com/nix-rust/nix/pull/1107)) + +- Added `NixPath::is_empty`. + ([#1107](https://github.com/nix-rust/nix/pull/1107)) + +- Added `mkfifoat` + ([#1133](https://github.com/nix-rust/nix/pull/1133)) + +- Added `User::from_uid`, `User::from_name`, `User::from_gid` and + `Group::from_name`, + ([#1139](https://github.com/nix-rust/nix/pull/1139)) + +- Added `linkat` + ([#1101](https://github.com/nix-rust/nix/pull/1101)) + +- Added `sched_getaffinity`. + ([#1148](https://github.com/nix-rust/nix/pull/1148)) + +- Added optional `Signal` argument to `ptrace::{detach, syscall}` for signal + injection. ([#1083](https://github.com/nix-rust/nix/pull/1083)) + +### Changed +- `sys::termios::BaudRate` now implements `TryFrom` instead of + `From`. The old `From` implementation would panic on failure. + ([#1159](https://github.com/nix-rust/nix/pull/1159)) + +- `sys::socket::ControlMessage::ScmCredentials` and + `sys::socket::ControlMessageOwned::ScmCredentials` now wrap `UnixCredentials` + rather than `libc::ucred`. + ([#1160](https://github.com/nix-rust/nix/pull/1160)) + +- `sys::socket::recvmsg` now takes a plain `Vec` instead of a `CmsgBuffer` + implementor. If you were already using `cmsg_space!`, then you needn't worry. + ([#1156](https://github.com/nix-rust/nix/pull/1156)) + +- `sys::socket::recvfrom` now returns + `Result<(usize, Option)>` instead of `Result<(usize, SockAddr)>`. + ([#1145](https://github.com/nix-rust/nix/pull/1145)) + +- `Signal::from_c_int` has been replaced by `Signal::try_from` + ([#1113](https://github.com/nix-rust/nix/pull/1113)) + +- Changed `readlink` and `readlinkat` to return `OsString` + ([#1109](https://github.com/nix-rust/nix/pull/1109)) + + ```rust + # use nix::fcntl::{readlink, readlinkat}; + // the buffer argument of `readlink` and `readlinkat` has been removed, + // and the return value is now an owned type (`OsString`). + // Existing code can be updated by removing the buffer argument + // and removing any clone or similar operation on the output + + // old code `readlink(&path, &mut buf)` can be replaced with the following + let _: OsString = readlink(&path); + + // old code `readlinkat(dirfd, &path, &mut buf)` can be replaced with the following + let _: OsString = readlinkat(dirfd, &path); + ``` + +- Minimum supported Rust version is now 1.36.0. + ([#1108](https://github.com/nix-rust/nix/pull/1108)) + +- `Ipv4Addr::octets`, `Ipv4Addr::to_std`, `Error::as_errno`, + `ForkResult::is_child`, `ForkResult::is_parent`, `Gid::as_raw`, + `Uid::is_root`, `Uid::as_raw`, `Pid::as_raw`, and `PollFd::revents` now take + `self` by value. + ([#1107](https://github.com/nix-rust/nix/pull/1107)) + +- Type `&CString` for parameters of `exec(v|ve|vp|vpe|veat)` are changed to `&CStr`. + ([#1121](https://github.com/nix-rust/nix/pull/1121)) + +### Fixed +- Fix length of abstract socket addresses + ([#1120](https://github.com/nix-rust/nix/pull/1120)) + +- Fix initialization of msghdr in recvmsg/sendmsg when built with musl + ([#1136](https://github.com/nix-rust/nix/pull/1136)) + +### Removed +- Remove the deprecated `CmsgSpace`. + ([#1156](https://github.com/nix-rust/nix/pull/1156)) + +## [0.15.0] - 10 August 2019 +### Added +- Added `MSG_WAITALL` to `MsgFlags` in `sys::socket`. + ([#1079](https://github.com/nix-rust/nix/pull/1079)) +- Implemented `Clone`, `Copy`, `Debug`, `Eq`, `Hash`, and `PartialEq` for most + types that support them. ([#1035](https://github.com/nix-rust/nix/pull/1035)) +- Added `copy_file_range` wrapper + ([#1069](https://github.com/nix-rust/nix/pull/1069)) +- Add `mkdirat`. + ([#1084](https://github.com/nix-rust/nix/pull/1084)) +- Add `posix_fadvise`. + ([#1089](https://github.com/nix-rust/nix/pull/1089)) +- Added `AF_VSOCK` to `AddressFamily`. + ([#1091](https://github.com/nix-rust/nix/pull/1091)) +- Add `unlinkat` + ([#1058](https://github.com/nix-rust/nix/pull/1058)) +- Add `renameat`. + ([#1097](https://github.com/nix-rust/nix/pull/1097)) + +### Changed +- Support for `ifaddrs` now present when building for Android. + ([#1077](https://github.com/nix-rust/nix/pull/1077)) +- Minimum supported Rust version is now 1.31.0 + ([#1035](https://github.com/nix-rust/nix/pull/1035)) + ([#1095](https://github.com/nix-rust/nix/pull/1095)) +- Now functions `statfs()` and `fstatfs()` return result with `Statfs` wrapper + ([#928](https://github.com/nix-rust/nix/pull/928)) + +### Fixed +- Enabled `sched_yield` for all nix hosts. + ([#1090](https://github.com/nix-rust/nix/pull/1090)) + +### Removed + +## [0.14.1] - 2019-06-06 +### Added +- Macros exported by `nix` may now be imported via `use` on the Rust 2018 + edition without importing helper macros on Linux targets. + ([#1066](https://github.com/nix-rust/nix/pull/1066)) + + For example, in Rust 2018, the `ioctl_read_bad!` macro can now be imported + without importing the `convert_ioctl_res!` macro. + + ```rust + use nix::ioctl_read_bad; + + ioctl_read_bad!(tcgets, libc::TCGETS, libc::termios); + ``` + +### Changed +- Changed some public types from reexports of libc types like `uint32_t` to the + native equivalents like `u32.` + ([#1072](https://github.com/nix-rust/nix/pull/1072/commits)) + +### Fixed +- Fix the build on Android and Linux/mips with recent versions of libc. + ([#1072](https://github.com/nix-rust/nix/pull/1072/commits)) + +### Removed + +## [0.14.0] - 2019-05-21 +### Added +- Add IP_RECVIF & IP_RECVDSTADDR. Enable IP_PKTINFO and IP6_PKTINFO on netbsd/openbsd. + ([#1002](https://github.com/nix-rust/nix/pull/1002)) +- Added `inotify_init1`, `inotify_add_watch` and `inotify_rm_watch` wrappers for + Android and Linux. ([#1016](https://github.com/nix-rust/nix/pull/1016)) +- Add `ALG_SET_IV`, `ALG_SET_OP` and `ALG_SET_AEAD_ASSOCLEN` control messages and `AF_ALG` + socket types on Linux and Android ([#1031](https://github.com/nix-rust/nix/pull/1031)) +- Add killpg + ([#1034](https://github.com/nix-rust/nix/pull/1034)) +- Added ENOTSUP errno support for Linux and Android. + ([#969](https://github.com/nix-rust/nix/pull/969)) +- Add several errno constants from OpenBSD 6.2 + ([#1036](https://github.com/nix-rust/nix/pull/1036)) +- Added `from_std` and `to_std` methods for `sys::socket::IpAddr` + ([#1043](https://github.com/nix-rust/nix/pull/1043)) +- Added `nix::unistd:seteuid` and `nix::unistd::setegid` for those platforms that do + not support `setresuid` nor `setresgid` respectively. + ([#1044](https://github.com/nix-rust/nix/pull/1044)) +- Added a `access` wrapper + ([#1045](https://github.com/nix-rust/nix/pull/1045)) +- Add `forkpty` + ([#1042](https://github.com/nix-rust/nix/pull/1042)) +- Add `sched_yield` + ([#1050](https://github.com/nix-rust/nix/pull/1050)) + +### Changed +- `PollFd` event flags renamed to `PollFlags` ([#1024](https://github.com/nix-rust/nix/pull/1024/)) +- `recvmsg` now returns an Iterator over `ControlMessageOwned` objects rather + than `ControlMessage` objects. This is sadly not backwards-compatible. Fix + code like this: + ```rust + if let ControlMessage::ScmRights(&fds) = cmsg { + ``` + + By replacing it with code like this: + ```rust + if let ControlMessageOwned::ScmRights(fds) = cmsg { + ``` + ([#1020](https://github.com/nix-rust/nix/pull/1020)) +- Replaced `CmsgSpace` with the `cmsg_space` macro. + ([#1020](https://github.com/nix-rust/nix/pull/1020)) + +### Fixed +- Fixed multiple bugs when using `sendmsg` and `recvmsg` with ancillary control messages + ([#1020](https://github.com/nix-rust/nix/pull/1020)) +- Macros exported by `nix` may now be imported via `use` on the Rust 2018 + edition without importing helper macros for BSD targets. + ([#1041](https://github.com/nix-rust/nix/pull/1041)) + + For example, in Rust 2018, the `ioctl_read_bad!` macro can now be imported + without importing the `convert_ioctl_res!` macro. + + ```rust + use nix::ioctl_read_bad; + + ioctl_read_bad!(tcgets, libc::TCGETS, libc::termios); + ``` + +### Removed +- `Daemon`, `NOTE_REAP`, and `NOTE_EXIT_REPARENTED` are now deprecated on OSX + and iOS. + ([#1033](https://github.com/nix-rust/nix/pull/1033)) +- `PTRACE_GETREGS`, `PTRACE_SETREGS`, `PTRACE_GETFPREGS`, and + `PTRACE_SETFPREGS` have been removed from some platforms where they never + should've been defined in the first place. + ([#1055](https://github.com/nix-rust/nix/pull/1055)) + +## [0.13.0] - 2019-01-15 +### Added +- Added PKTINFO(V4) & V6PKTINFO cmsg support - Android/FreeBSD/iOS/Linux/MacOS. + ([#990](https://github.com/nix-rust/nix/pull/990)) +- Added support of CString type in `setsockopt`. + ([#972](https://github.com/nix-rust/nix/pull/972)) +- Added option `TCP_CONGESTION` in `setsockopt`. + ([#972](https://github.com/nix-rust/nix/pull/972)) +- Added `symlinkat` wrapper. + ([#997](https://github.com/nix-rust/nix/pull/997)) +- Added `ptrace::{getregs, setregs}`. + ([#1010](https://github.com/nix-rust/nix/pull/1010)) +- Added `nix::sys::signal::signal`. + ([#817](https://github.com/nix-rust/nix/pull/817)) +- Added an `mprotect` wrapper. + ([#991](https://github.com/nix-rust/nix/pull/991)) + +### Changed +### Fixed +- `lutimes` never worked on OpenBSD as it is not implemented on OpenBSD. It has + been removed. ([#1000](https://github.com/nix-rust/nix/pull/1000)) +- `fexecve` never worked on NetBSD or on OpenBSD as it is not implemented on + either OS. It has been removed. ([#1000](https://github.com/nix-rust/nix/pull/1000)) + +### Removed + +## [0.12.0] 2018-11-28 + +### Added +- Added `FromStr` and `Display` impls for `nix::sys::Signal` + ([#884](https://github.com/nix-rust/nix/pull/884)) +- Added a `sync` wrapper. + ([#961](https://github.com/nix-rust/nix/pull/961)) +- Added a `sysinfo` wrapper. + ([#922](https://github.com/nix-rust/nix/pull/922)) +- Support the `SO_PEERCRED` socket option and the `UnixCredentials` type on all Linux and Android targets. + ([#921](https://github.com/nix-rust/nix/pull/921)) +- Added support for `SCM_CREDENTIALS`, allowing to send process credentials over Unix sockets. + ([#923](https://github.com/nix-rust/nix/pull/923)) +- Added a `dir` module for reading directories (wraps `fdopendir`, `readdir`, and `rewinddir`). + ([#916](https://github.com/nix-rust/nix/pull/916)) +- Added `kmod` module that allows loading and unloading kernel modules on Linux. + ([#930](https://github.com/nix-rust/nix/pull/930)) +- Added `futimens` and `utimesat` wrappers ([#944](https://github.com/nix-rust/nix/pull/944)), + an `lutimes` wrapper ([#967](https://github.com/nix-rust/nix/pull/967)), + and a `utimes` wrapper ([#946](https://github.com/nix-rust/nix/pull/946)). +- Added `AF_UNSPEC` wrapper to `AddressFamily` ([#948](https://github.com/nix-rust/nix/pull/948)) +- Added the `mode_t` public alias within `sys::stat`. + ([#954](https://github.com/nix-rust/nix/pull/954)) +- Added a `truncate` wrapper. + ([#956](https://github.com/nix-rust/nix/pull/956)) +- Added a `fchownat` wrapper. + ([#955](https://github.com/nix-rust/nix/pull/955)) +- Added support for `ptrace` on BSD operating systems ([#949](https://github.com/nix-rust/nix/pull/949)) +- Added `ptrace` functions for reads and writes to tracee memory and ptrace kill + ([#949](https://github.com/nix-rust/nix/pull/949)) ([#958](https://github.com/nix-rust/nix/pull/958)) +- Added a `acct` wrapper module for enabling and disabling process accounting + ([#952](https://github.com/nix-rust/nix/pull/952)) +- Added the `time_t` and `suseconds_t` public aliases within `sys::time`. + ([#968](https://github.com/nix-rust/nix/pull/968)) +- Added `unistd::execvpe` for Haiku, Linux and OpenBSD + ([#975](https://github.com/nix-rust/nix/pull/975)) +- Added `Error::as_errno`. + ([#977](https://github.com/nix-rust/nix/pull/977)) + +### Changed +- Increased required Rust version to 1.24.1 + ([#900](https://github.com/nix-rust/nix/pull/900)) + ([#966](https://github.com/nix-rust/nix/pull/966)) + +### Fixed +- Made `preadv` take immutable slice of IoVec. + ([#914](https://github.com/nix-rust/nix/pull/914)) +- Fixed passing multiple file descriptors over Unix Sockets. + ([#918](https://github.com/nix-rust/nix/pull/918)) + +### Removed + +## [0.11.0] 2018-06-01 + +### Added +- Added `sendfile` on FreeBSD and Darwin. + ([#901](https://github.com/nix-rust/nix/pull/901)) +- Added `pselect` + ([#894](https://github.com/nix-rust/nix/pull/894)) +- Exposed `preadv` and `pwritev` on the BSDs. + ([#883](https://github.com/nix-rust/nix/pull/883)) +- Added `mlockall` and `munlockall` + ([#876](https://github.com/nix-rust/nix/pull/876)) +- Added `SO_MARK` on Linux. + ([#873](https://github.com/nix-rust/nix/pull/873)) +- Added safe support for nearly any buffer type in the `sys::aio` module. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Added `sys::aio::LioCb` as a wrapper for `libc::lio_listio`. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Added `unistd::getsid` + ([#850](https://github.com/nix-rust/nix/pull/850)) +- Added `alarm`. ([#830](https://github.com/nix-rust/nix/pull/830)) +- Added interface flags `IFF_NO_PI, IFF_TUN, IFF_TAP` on linux-like systems. + ([#853](https://github.com/nix-rust/nix/pull/853)) +- Added `statvfs` module to all MacOS and Linux architectures. + ([#832](https://github.com/nix-rust/nix/pull/832)) +- Added `EVFILT_EMPTY`, `EVFILT_PROCDESC`, and `EVFILT_SENDFILE` on FreeBSD. + ([#825](https://github.com/nix-rust/nix/pull/825)) +- Exposed `termios::cfmakesane` on FreeBSD. + ([#825](https://github.com/nix-rust/nix/pull/825)) +- Exposed `MSG_CMSG_CLOEXEC` on *BSD. + ([#825](https://github.com/nix-rust/nix/pull/825)) +- Added `fchmod`, `fchmodat`. + ([#857](https://github.com/nix-rust/nix/pull/857)) +- Added `request_code_write_int!` on FreeBSD/DragonFlyBSD + ([#833](https://github.com/nix-rust/nix/pull/833)) + +### Changed +- `Display` and `Debug` for `SysControlAddr` now includes all fields. + ([#837](https://github.com/nix-rust/nix/pull/837)) +- `ioctl!` has been replaced with a family of `ioctl_*!` macros. + ([#833](https://github.com/nix-rust/nix/pull/833)) +- `io!`, `ior!`, `iow!`, and `iorw!` has been renamed to `request_code_none!`, `request_code_read!`, + `request_code_write!`, and `request_code_readwrite!` respectively. These have also now been exposed + in the documentation. + ([#833](https://github.com/nix-rust/nix/pull/833)) +- Enabled more `ptrace::Request` definitions for uncommon Linux platforms + ([#892](https://github.com/nix-rust/nix/pull/892)) +- Emulation of `FD_CLOEXEC` and `O_NONBLOCK` was removed from `socket()`, `accept4()`, and + `socketpair()`. + ([#907](https://github.com/nix-rust/nix/pull/907)) + +### Fixed +- Fixed possible panics when using `SigAction::flags` on Linux + ([#869](https://github.com/nix-rust/nix/pull/869)) +- Properly exposed 460800 and 921600 baud rates on NetBSD + ([#837](https://github.com/nix-rust/nix/pull/837)) +- Fixed `ioctl_write_int!` on FreeBSD/DragonFlyBSD + ([#833](https://github.com/nix-rust/nix/pull/833)) +- `ioctl_write_int!` now properly supports passing a `c_ulong` as the parameter on Linux non-musl targets + ([#833](https://github.com/nix-rust/nix/pull/833)) + +### Removed +- Removed explicit support for the `bytes` crate from the `sys::aio` module. + See `sys::aio::AioCb::from_boxed_slice` examples for alternatives. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Removed `sys::aio::lio_listio`. Use `sys::aio::LioCb::listio` instead. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Removed emulated `accept4()` from macos, ios, and netbsd targets + ([#907](https://github.com/nix-rust/nix/pull/907)) +- Removed `IFF_NOTRAILERS` on OpenBSD, as it has been removed in OpenBSD 6.3 + ([#893](https://github.com/nix-rust/nix/pull/893)) + +## [0.10.0] 2018-01-26 + +### Added +- Added specialized wrapper: `sys::ptrace::step` + ([#852](https://github.com/nix-rust/nix/pull/852)) +- Added `AioCb::from_ptr` and `AioCb::from_mut_ptr` + ([#820](https://github.com/nix-rust/nix/pull/820)) +- Added specialized wrappers: `sys::ptrace::{traceme, syscall, cont, attach}`. Using the matching routines + with `sys::ptrace::ptrace` is now deprecated. +- Added `nix::poll` module for all platforms + ([#672](https://github.com/nix-rust/nix/pull/672)) +- Added `nix::ppoll` function for FreeBSD and DragonFly + ([#672](https://github.com/nix-rust/nix/pull/672)) +- Added protocol families in `AddressFamily` enum. + ([#647](https://github.com/nix-rust/nix/pull/647)) +- Added the `pid()` method to `WaitStatus` for extracting the PID. + ([#722](https://github.com/nix-rust/nix/pull/722)) +- Added `nix::unistd:fexecve`. + ([#727](https://github.com/nix-rust/nix/pull/727)) +- Expose `uname()` on all platforms. + ([#739](https://github.com/nix-rust/nix/pull/739)) +- Expose `signalfd` module on Android as well. + ([#739](https://github.com/nix-rust/nix/pull/739)) +- Added `nix::sys::ptrace::detach`. + ([#749](https://github.com/nix-rust/nix/pull/749)) +- Added timestamp socket control message variant: + `nix::sys::socket::ControlMessage::ScmTimestamp` + ([#663](https://github.com/nix-rust/nix/pull/663)) +- Added socket option variant that enables the timestamp socket + control message: `nix::sys::socket::sockopt::ReceiveTimestamp` + ([#663](https://github.com/nix-rust/nix/pull/663)) +- Added more accessor methods for `AioCb` + ([#773](https://github.com/nix-rust/nix/pull/773)) +- Add `nix::sys::fallocate` + ([#768](https:://github.com/nix-rust/nix/pull/768)) +- Added `nix::unistd::mkfifo`. + ([#602](https://github.com/nix-rust/nix/pull/774)) +- Added `ptrace::Options::PTRACE_O_EXITKILL` on Linux and Android. + ([#771](https://github.com/nix-rust/nix/pull/771)) +- Added `nix::sys::uio::{process_vm_readv, process_vm_writev}` on Linux + ([#568](https://github.com/nix-rust/nix/pull/568)) +- Added `nix::unistd::{getgroups, setgroups, getgrouplist, initgroups}`. ([#733](https://github.com/nix-rust/nix/pull/733)) +- Added `nix::sys::socket::UnixAddr::as_abstract` on Linux and Android. + ([#785](https://github.com/nix-rust/nix/pull/785)) +- Added `nix::unistd::execveat` on Linux and Android. + ([#800](https://github.com/nix-rust/nix/pull/800)) +- Added the `from_raw()` method to `WaitStatus` for converting raw status values + to `WaitStatus` independent of syscalls. + ([#741](https://github.com/nix-rust/nix/pull/741)) +- Added more standard trait implementations for various types. + ([#814](https://github.com/nix-rust/nix/pull/814)) +- Added `sigprocmask` to the signal module. + ([#826](https://github.com/nix-rust/nix/pull/826)) +- Added `nix::sys::socket::LinkAddr` on Linux and all bsdlike system. + ([#813](https://github.com/nix-rust/nix/pull/813)) +- Add socket options for `IP_TRANSPARENT` / `BIND_ANY`. + ([#835](https://github.com/nix-rust/nix/pull/835)) + +### Changed +- Exposed the `mqueue` module for all supported operating systems. + ([#834](https://github.com/nix-rust/nix/pull/834)) +- Use native `pipe2` on all BSD targets. Users should notice no difference. + ([#777](https://github.com/nix-rust/nix/pull/777)) +- Renamed existing `ptrace` wrappers to encourage namespacing ([#692](https://github.com/nix-rust/nix/pull/692)) +- Marked `sys::ptrace::ptrace` as `unsafe`. +- Changed function signature of `socket()` and `socketpair()`. The `protocol` argument + has changed type from `c_int` to `SockProtocol`. + It accepts a `None` value for default protocol that was specified with zero using `c_int`. + ([#647](https://github.com/nix-rust/nix/pull/647)) +- Made `select` easier to use, adding the ability to automatically calculate the `nfds` parameter using the new + `FdSet::highest` ([#701](https://github.com/nix-rust/nix/pull/701)) +- Exposed `unistd::setresuid` and `unistd::setresgid` on FreeBSD and OpenBSD + ([#721](https://github.com/nix-rust/nix/pull/721)) +- Refactored the `statvfs` module removing extraneous API functions and the + `statvfs::vfs` module. Additionally `(f)statvfs()` now return the struct + directly. And the returned `Statvfs` struct now exposes its data through + accessor methods. ([#729](https://github.com/nix-rust/nix/pull/729)) +- The `addr` argument to `madvise` and `msync` is now `*mut` to better match the + libc API. ([#731](https://github.com/nix-rust/nix/pull/731)) +- `shm_open` and `shm_unlink` are no longer exposed on Android targets, where + they are not officially supported. ([#731](https://github.com/nix-rust/nix/pull/731)) +- `MapFlags`, `MmapAdvise`, and `MsFlags` expose some more variants and only + officially-supported variants are provided for each target. + ([#731](https://github.com/nix-rust/nix/pull/731)) +- Marked `pty::ptsname` function as `unsafe` + ([#744](https://github.com/nix-rust/nix/pull/744)) +- Moved constants ptrace request, event and options to enums and updated ptrace functions and argument types accordingly. + ([#749](https://github.com/nix-rust/nix/pull/749)) +- `AioCb::Drop` will now panic if the `AioCb` is still in-progress ([#715](https://github.com/nix-rust/nix/pull/715)) +- Restricted `nix::sys::socket::UnixAddr::new_abstract` to Linux and Android only. + ([#785](https://github.com/nix-rust/nix/pull/785)) +- The `ucred` struct has been removed in favor of a `UserCredentials` struct that + contains only getters for its fields. + ([#814](https://github.com/nix-rust/nix/pull/814)) +- Both `ip_mreq` and `ipv6_mreq` have been replaced with `IpMembershipRequest` and + `Ipv6MembershipRequest`. + ([#814](https://github.com/nix-rust/nix/pull/814)) +- Removed return type from `pause`. + ([#829](https://github.com/nix-rust/nix/pull/829)) +- Changed the termios APIs to allow for using a `u32` instead of the `BaudRate` + enum on BSD platforms to support arbitrary baud rates. See the module docs for + `nix::sys::termios` for more details. + ([#843](https://github.com/nix-rust/nix/pull/843)) + +### Fixed +- Fix compilation and tests for OpenBSD targets + ([#688](https://github.com/nix-rust/nix/pull/688)) +- Fixed error handling in `AioCb::fsync`, `AioCb::read`, and `AioCb::write`. + It is no longer an error to drop an `AioCb` that failed to enqueue in the OS. + ([#715](https://github.com/nix-rust/nix/pull/715)) +- Fix potential memory corruption on non-Linux platforms when using + `sendmsg`/`recvmsg`, caused by mismatched `msghdr` definition. + ([#648](https://github.com/nix-rust/nix/pull/648)) + +### Removed +- `AioCb::from_boxed_slice` has been removed. It was never actually safe. Use + `from_bytes` or `from_bytes_mut` instead. + ([#820](https://github.com/nix-rust/nix/pull/820)) +- The syscall module has been removed. This only exposed enough functionality for + `memfd_create()` and `pivot_root()`, which are still exposed as separate functions. + ([#747](https://github.com/nix-rust/nix/pull/747)) +- The `Errno` variants are no longer reexported from the `errno` module. `Errno` itself is no longer reexported from the + crate root and instead must be accessed using the `errno` module. ([#696](https://github.com/nix-rust/nix/pull/696)) +- Removed `MS_VERBOSE`, `MS_NOSEC`, and `MS_BORN` from `MsFlags`. These + are internal kernel flags and should never have been exposed. + ([#814](https://github.com/nix-rust/nix/pull/814)) + + +## [0.9.0] 2017-07-23 + +### Added +- Added `sysconf`, `pathconf`, and `fpathconf` + ([#630](https://github.com/nix-rust/nix/pull/630) +- Added `sys::signal::SigAction::{ flags, mask, handler}` + ([#611](https://github.com/nix-rust/nix/pull/609) +- Added `nix::sys::pthread::pthread_self` + ([#591](https://github.com/nix-rust/nix/pull/591) +- Added `AioCb::from_boxed_slice` + ([#582](https://github.com/nix-rust/nix/pull/582) +- Added `nix::unistd::{openat, fstatat, readlink, readlinkat}` + ([#551](https://github.com/nix-rust/nix/pull/551)) +- Added `nix::pty::{grantpt, posix_openpt, ptsname/ptsname_r, unlockpt}` + ([#556](https://github.com/nix-rust/nix/pull/556) +- Added `nix::ptr::openpty` + ([#456](https://github.com/nix-rust/nix/pull/456)) +- Added `nix::ptrace::{ptrace_get_data, ptrace_getsiginfo, ptrace_setsiginfo + and nix::Error::UnsupportedOperation}` + ([#614](https://github.com/nix-rust/nix/pull/614)) +- Added `cfmakeraw`, `cfsetspeed`, and `tcgetsid`. ([#527](https://github.com/nix-rust/nix/pull/527)) +- Added "bad none", "bad write_ptr", "bad write_int", and "bad readwrite" variants to the `ioctl!` + macro. ([#670](https://github.com/nix-rust/nix/pull/670)) +- On Linux and Android, added support for receiving `PTRACE_O_TRACESYSGOOD` + events from `wait` and `waitpid` using `WaitStatus::PtraceSyscall` + ([#566](https://github.com/nix-rust/nix/pull/566)). + +### Changed +- The `ioctl!` macro and its variants now allow the generated functions to have + doccomments. ([#661](https://github.com/nix-rust/nix/pull/661)) +- Changed `ioctl!(write ...)` into `ioctl!(write_ptr ...)` and `ioctl!(write_int ..)` variants + to more clearly separate those use cases. ([#670](https://github.com/nix-rust/nix/pull/670)) +- Marked `sys::mman::{ mmap, munmap, madvise, munlock, msync }` as unsafe. + ([#559](https://github.com/nix-rust/nix/pull/559)) +- Minimum supported Rust version is now 1.13. +- Removed `revents` argument from `PollFd::new()` as it's an output argument and + will be overwritten regardless of value. + ([#542](https://github.com/nix-rust/nix/pull/542)) +- Changed type signature of `sys::select::FdSet::contains` to make `self` + immutable ([#564](https://github.com/nix-rust/nix/pull/564)) +- Introduced wrapper types for `gid_t`, `pid_t`, and `uid_t` as `Gid`, `Pid`, and `Uid` + respectively. Various functions have been changed to use these new types as + arguments. ([#629](https://github.com/nix-rust/nix/pull/629)) +- Fixed compilation on all Android and iOS targets ([#527](https://github.com/nix-rust/nix/pull/527)) + and promoted them to Tier 2 support. +- `nix::sys::statfs::{statfs,fstatfs}` uses statfs definition from `libc::statfs` instead of own linux specific type `nix::sys::Statfs`. + Also file system type constants like `nix::sys::statfs::ADFS_SUPER_MAGIC` were removed in favor of the libc equivalent. + ([#561](https://github.com/nix-rust/nix/pull/561)) +- Revised the termios API including additional tests and documentation and exposed it on iOS. ([#527](https://github.com/nix-rust/nix/pull/527)) +- `eventfd`, `signalfd`, and `pwritev`/`preadv` functionality is now included by default for all + supported platforms. ([#681](https://github.com/nix-rust/nix/pull/561)) +- The `ioctl!` macro's plain variants has been replaced with "bad read" to be consistent with + other variants. The generated functions also have more strict types for their arguments. The + "*_buf" variants also now calculate total array size and take slice references for improved type + safety. The documentation has also been dramatically improved. + ([#670](https://github.com/nix-rust/nix/pull/670)) + +### Removed +- Removed `io::Error` from `nix::Error` and the conversion from `nix::Error` to `Errno` + ([#614](https://github.com/nix-rust/nix/pull/614)) +- All feature flags have been removed in favor of conditional compilation on supported platforms. + `execvpe` is no longer supported, but this was already broken and will be added back in the next + release. ([#681](https://github.com/nix-rust/nix/pull/561)) +- Removed `ioc_*` functions and many helper constants and macros within the `ioctl` module. These + should always have been private and only the `ioctl!` should be used in public code. + ([#670](https://github.com/nix-rust/nix/pull/670)) + +### Fixed +- Fixed multiple issues compiling under different archetectures and OSes. + Now compiles on Linux/MIPS ([#538](https://github.com/nix-rust/nix/pull/538)), + `Linux/PPC` ([#553](https://github.com/nix-rust/nix/pull/553)), + `MacOS/x86_64,i686` ([#553](https://github.com/nix-rust/nix/pull/553)), + `NetBSD/x64_64` ([#538](https://github.com/nix-rust/nix/pull/538)), + `FreeBSD/x86_64,i686` ([#536](https://github.com/nix-rust/nix/pull/536)), and + `Android` ([#631](https://github.com/nix-rust/nix/pull/631)). +- `bind` and `errno_location` now work correctly on `Android` + ([#631](https://github.com/nix-rust/nix/pull/631)) +- Added `nix::ptrace` on all Linux-kernel-based platforms + [#624](https://github.com/nix-rust/nix/pull/624). Previously it was + only available on x86, x86-64, and ARM, and also not on Android. +- Fixed `sys::socket::sendmsg` with zero entry `cmsgs` parameter. + ([#623](https://github.com/nix-rust/nix/pull/623)) +- Multiple constants related to the termios API have now been properly defined for + all supported platforms. ([#527](https://github.com/nix-rust/nix/pull/527)) +- `ioctl!` macro now supports working with non-int datatypes and properly supports all platforms. + ([#670](https://github.com/nix-rust/nix/pull/670)) + +## [0.8.1] 2017-04-16 + +### Fixed +- Fixed build on FreeBSD. (Cherry-picked + [a859ee3c](https://github.com/nix-rust/nix/commit/a859ee3c9396dfdb118fcc2c8ecc697e2d303467)) + +## [0.8.0] 2017-03-02 + +### Added +- Added `::nix::sys::termios::BaudRate` enum to provide portable baudrate + values. ([#518](https://github.com/nix-rust/nix/pull/518)) +- Added a new `WaitStatus::PtraceEvent` to support ptrace events on Linux + and Android ([#438](https://github.com/nix-rust/nix/pull/438)) +- Added support for POSIX AIO + ([#483](https://github.com/nix-rust/nix/pull/483)) + ([#506](https://github.com/nix-rust/nix/pull/506)) +- Added support for XNU system control sockets + ([#478](https://github.com/nix-rust/nix/pull/478)) +- Added support for `ioctl` calls on BSD platforms + ([#478](https://github.com/nix-rust/nix/pull/478)) +- Added struct `TimeSpec` + ([#475](https://github.com/nix-rust/nix/pull/475)) + ([#483](https://github.com/nix-rust/nix/pull/483)) +- Added complete definitions for all kqueue-related constants on all supported + OSes + ([#415](https://github.com/nix-rust/nix/pull/415)) +- Added function `epoll_create1` and bitflags `EpollCreateFlags` in + `::nix::sys::epoll` in order to support `::libc::epoll_create1`. + ([#410](https://github.com/nix-rust/nix/pull/410)) +- Added `setresuid` and `setresgid` for Linux in `::nix::unistd` + ([#448](https://github.com/nix-rust/nix/pull/448)) +- Added `getpgid` in `::nix::unistd` + ([#433](https://github.com/nix-rust/nix/pull/433)) +- Added `tcgetpgrp` and `tcsetpgrp` in `::nix::unistd` + ([#451](https://github.com/nix-rust/nix/pull/451)) +- Added `CLONE_NEWCGROUP` in `::nix::sched` + ([#457](https://github.com/nix-rust/nix/pull/457)) +- Added `getpgrp` in `::nix::unistd` + ([#491](https://github.com/nix-rust/nix/pull/491)) +- Added `fchdir` in `::nix::unistd` + ([#497](https://github.com/nix-rust/nix/pull/497)) +- Added `major` and `minor` in `::nix::sys::stat` for decomposing `dev_t` + ([#508](https://github.com/nix-rust/nix/pull/508)) +- Fixed the style of many bitflags and use `libc` in more places. + ([#503](https://github.com/nix-rust/nix/pull/503)) +- Added `ppoll` in `::nix::poll` + ([#520](https://github.com/nix-rust/nix/pull/520)) +- Added support for getting and setting pipe size with fcntl(2) on Linux + ([#540](https://github.com/nix-rust/nix/pull/540)) + +### Changed +- `::nix::sys::termios::{cfgetispeed, cfsetispeed, cfgetospeed, cfsetospeed}` + switched to use `BaudRate` enum from `speed_t`. + ([#518](https://github.com/nix-rust/nix/pull/518)) +- `epoll_ctl` now could accept None as argument `event` + when op is `EpollOp::EpollCtlDel`. + ([#480](https://github.com/nix-rust/nix/pull/480)) +- Removed the `bad` keyword from the `ioctl!` macro + ([#478](https://github.com/nix-rust/nix/pull/478)) +- Changed `TimeVal` into an opaque Newtype + ([#475](https://github.com/nix-rust/nix/pull/475)) +- `kill`'s signature, defined in `::nix::sys::signal`, changed, so that the + signal parameter has type `T: Into>`. `None` as an argument + for that parameter will result in a 0 passed to libc's `kill`, while a + `Some`-argument will result in the previous behavior for the contained + `Signal`. + ([#445](https://github.com/nix-rust/nix/pull/445)) +- The minimum supported version of rustc is now 1.7.0. + ([#444](https://github.com/nix-rust/nix/pull/444)) +- Changed `KEvent` to an opaque structure that may only be modified by its + constructor and the `ev_set` method. + ([#415](https://github.com/nix-rust/nix/pull/415)) + ([#442](https://github.com/nix-rust/nix/pull/442)) + ([#463](https://github.com/nix-rust/nix/pull/463)) +- `pipe2` now calls `libc::pipe2` where available. Previously it was emulated + using `pipe`, which meant that setting `O_CLOEXEC` was not atomic. + ([#427](https://github.com/nix-rust/nix/pull/427)) +- Renamed `EpollEventKind` to `EpollFlags` in `::nix::sys::epoll` in order for + it to conform with our conventions. + ([#410](https://github.com/nix-rust/nix/pull/410)) +- `EpollEvent` in `::nix::sys::epoll` is now an opaque proxy for + `::libc::epoll_event`. The formerly public field `events` is now be read-only + accessible with the new method `events()` of `EpollEvent`. Instances of + `EpollEvent` can be constructed using the new method `new()` of EpollEvent. + ([#410](https://github.com/nix-rust/nix/pull/410)) +- `SigFlags` in `::nix::sys::signal` has be renamed to `SigmaskHow` and its type + has changed from `bitflags` to `enum` in order to conform to our conventions. + ([#460](https://github.com/nix-rust/nix/pull/460)) +- `sethostname` now takes a `&str` instead of a `&[u8]` as this provides an API + that makes more sense in normal, correct usage of the API. +- `gethostname` previously did not expose the actual length of the hostname + written from the underlying system call at all. This has been updated to + return a `&CStr` within the provided buffer that is always properly + NUL-terminated (this is not guaranteed by the call with all platforms/libc + implementations). +- Exposed all fcntl(2) operations at the module level, so they can be + imported direclty instead of via `FcntlArg` enum. + ([#541](https://github.com/nix-rust/nix/pull/541)) + +### Fixed +- Fixed multiple issues with Unix domain sockets on non-Linux OSes + ([#474](https://github.com/nix-rust/nix/pull/415)) +- Fixed using kqueue with `EVFILT_USER` on FreeBSD + ([#415](https://github.com/nix-rust/nix/pull/415)) +- Fixed the build on FreeBSD, and fixed the getsockopt, sendmsg, and recvmsg + functions on that same OS. + ([#397](https://github.com/nix-rust/nix/pull/397)) +- Fixed an off-by-one bug in `UnixAddr::new_abstract` in `::nix::sys::socket`. + ([#429](https://github.com/nix-rust/nix/pull/429)) +- Fixed clone passing a potentially unaligned stack. + ([#490](https://github.com/nix-rust/nix/pull/490)) +- Fixed mkdev not creating a `dev_t` the same way as libc. + ([#508](https://github.com/nix-rust/nix/pull/508)) + +## [0.7.0] 2016-09-09 + +### Added +- Added `lseek` and `lseek64` in `::nix::unistd` + ([#377](https://github.com/nix-rust/nix/pull/377)) +- Added `mkdir` and `getcwd` in `::nix::unistd` + ([#416](https://github.com/nix-rust/nix/pull/416)) +- Added accessors `sigmask_mut` and `sigmask` to `UContext` in + `::nix::ucontext`. + ([#370](https://github.com/nix-rust/nix/pull/370)) +- Added `WUNTRACED` to `WaitPidFlag` in `::nix::sys::wait` for non-_linux_ + targets. + ([#379](https://github.com/nix-rust/nix/pull/379)) +- Added new module `::nix::sys::reboot` with enumeration `RebootMode` and + functions `reboot` and `set_cad_enabled`. Currently for _linux_ only. + ([#386](https://github.com/nix-rust/nix/pull/386)) +- `FdSet` in `::nix::sys::select` now also implements `Clone`. + ([#405](https://github.com/nix-rust/nix/pull/405)) +- Added `F_FULLFSYNC` to `FcntlArg` in `::nix::fcntl` for _apple_ targets. + ([#407](https://github.com/nix-rust/nix/pull/407)) +- Added `CpuSet::unset` in `::nix::sched`. + ([#402](https://github.com/nix-rust/nix/pull/402)) +- Added constructor method `new()` to `PollFd` in `::nix::poll`, in order to + allow creation of objects, after removing public access to members. + ([#399](https://github.com/nix-rust/nix/pull/399)) +- Added method `revents()` to `PollFd` in `::nix::poll`, in order to provide + read access to formerly public member `revents`. + ([#399](https://github.com/nix-rust/nix/pull/399)) +- Added `MSG_CMSG_CLOEXEC` to `MsgFlags` in `::nix::sys::socket` for _linux_ only. + ([#422](https://github.com/nix-rust/nix/pull/422)) + +### Changed +- Replaced the reexported integer constants for signals by the enumeration + `Signal` in `::nix::sys::signal`. + ([#362](https://github.com/nix-rust/nix/pull/362)) +- Renamed `EventFdFlag` to `EfdFlags` in `::nix::sys::eventfd`. + ([#383](https://github.com/nix-rust/nix/pull/383)) +- Changed the result types of `CpuSet::is_set` and `CpuSet::set` in + `::nix::sched` to `Result` and `Result<()>`, respectively. They now + return `EINVAL`, if an invalid argument for the `field` parameter is passed. + ([#402](https://github.com/nix-rust/nix/pull/402)) +- `MqAttr` in `::nix::mqueue` is now an opaque proxy for `::libc::mq_attr`, + which has the same structure as the old `MqAttr`. The field `mq_flags` of + `::libc::mq_attr` is readable using the new method `flags()` of `MqAttr`. + `MqAttr` also no longer implements `Debug`. + ([#392](https://github.com/nix-rust/nix/pull/392)) +- The parameter `msq_prio` of `mq_receive` with type `u32` in `::nix::mqueue` + was replaced by a parameter named `msg_prio` with type `&mut u32`, so that + the message priority can be obtained by the caller. + ([#392](https://github.com/nix-rust/nix/pull/392)) +- The type alias `MQd` in `::nix::queue` was replaced by the type alias + `libc::mqd_t`, both of which are aliases for the same type. + ([#392](https://github.com/nix-rust/nix/pull/392)) + +### Removed +- Type alias `SigNum` from `::nix::sys::signal`. + ([#362](https://github.com/nix-rust/nix/pull/362)) +- Type alias `CpuMask` from `::nix::shed`. + ([#402](https://github.com/nix-rust/nix/pull/402)) +- Removed public fields from `PollFd` in `::nix::poll`. (See also added method + `revents()`. + ([#399](https://github.com/nix-rust/nix/pull/399)) + +### Fixed +- Fixed the build problem for NetBSD (Note, that we currently do not support + it, so it might already be broken again). + ([#389](https://github.com/nix-rust/nix/pull/389)) +- Fixed the build on FreeBSD, and fixed the getsockopt, sendmsg, and recvmsg + functions on that same OS. + ([#397](https://github.com/nix-rust/nix/pull/397)) + +## [0.6.0] 2016-06-10 + +### Added +- Added `gettid` in `::nix::unistd` for _linux_ and _android_. + ([#293](https://github.com/nix-rust/nix/pull/293)) +- Some _mips_ support in `::nix::sched` and `::nix::sys::syscall`. + ([#301](https://github.com/nix-rust/nix/pull/301)) +- Added `SIGNALFD_SIGINFO_SIZE` in `::nix::sys::signalfd`. + ([#309](https://github.com/nix-rust/nix/pull/309)) +- Added new module `::nix::ucontext` with struct `UContext`. Currently for + _linux_ only. + ([#311](https://github.com/nix-rust/nix/pull/311)) +- Added `EPOLLEXCLUSIVE` to `EpollEventKind` in `::nix::sys::epoll`. + ([#330](https://github.com/nix-rust/nix/pull/330)) +- Added `pause` to `::nix::unistd`. + ([#336](https://github.com/nix-rust/nix/pull/336)) +- Added `sleep` to `::nix::unistd`. + ([#351](https://github.com/nix-rust/nix/pull/351)) +- Added `S_IFDIR`, `S_IFLNK`, `S_IFMT` to `SFlag` in `::nix::sys::stat`. + ([#359](https://github.com/nix-rust/nix/pull/359)) +- Added `clear` and `extend` functions to `SigSet`'s implementation in + `::nix::sys::signal`. + ([#347](https://github.com/nix-rust/nix/pull/347)) +- `sockaddr_storage_to_addr` in `::nix::sys::socket` now supports `sockaddr_nl` + on _linux_ and _android_. + ([#366](https://github.com/nix-rust/nix/pull/366)) +- Added support for `SO_ORIGINAL_DST` in `::nix::sys::socket` on _linux_. + ([#367](https://github.com/nix-rust/nix/pull/367)) +- Added `SIGINFO` in `::nix::sys::signal` for the _macos_ target as well as + `SIGPWR` and `SIGSTKFLT` in `::nix::sys::signal` for non-_macos_ targets. + ([#361](https://github.com/nix-rust/nix/pull/361)) + +### Changed +- Changed the structure `IoVec` in `::nix::sys::uio`. + ([#304](https://github.com/nix-rust/nix/pull/304)) +- Replaced `CREATE_NEW_FD` by `SIGNALFD_NEW` in `::nix::sys::signalfd`. + ([#309](https://github.com/nix-rust/nix/pull/309)) +- Renamed `SaFlag` to `SaFlags` and `SigFlag` to `SigFlags` in + `::nix::sys::signal`. + ([#314](https://github.com/nix-rust/nix/pull/314)) +- Renamed `Fork` to `ForkResult` and changed its fields in `::nix::unistd`. + ([#332](https://github.com/nix-rust/nix/pull/332)) +- Added the `signal` parameter to `clone`'s signature in `::nix::sched`. + ([#344](https://github.com/nix-rust/nix/pull/344)) +- `execv`, `execve`, and `execvp` now return `Result` instead of + `Result<()>` in `::nix::unistd`. + ([#357](https://github.com/nix-rust/nix/pull/357)) + +### Fixed +- Improved the conversion from `std::net::SocketAddr` to `InetAddr` in + `::nix::sys::socket::addr`. + ([#335](https://github.com/nix-rust/nix/pull/335)) + +## [0.5.0] 2016-03-01 diff --git a/bash-5.1/vendor/nix-0.23.1/Cargo.toml b/bash-5.1/vendor/nix-0.23.1/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..122c1af2ff4f1f75cc68da75583dfcdf3b4c1189 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/Cargo.toml @@ -0,0 +1,83 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2018" +rust-version = "1.46" +name = "nix" +version = "0.23.1" +authors = ["The nix-rust Project Developers"] +include = ["src/**/*", "test/**/*", "LICENSE", "README.md", "CHANGELOG.md"] +description = "Rust friendly bindings to *nix APIs" +categories = ["os::unix-apis"] +license = "MIT" +repository = "https://github.com/nix-rust/nix" +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu", "aarch64-linux-android", "x86_64-apple-darwin", "aarch64-apple-ios", "x86_64-unknown-freebsd", "x86_64-unknown-openbsd", "x86_64-unknown-netbsd", "x86_64-unknown-dragonfly", "x86_64-fuchsia", "x86_64-unknown-redox", "x86_64-unknown-illumos"] + +[[test]] +name = "test" +path = "test/test.rs" + +[[test]] +name = "test-aio-drop" +path = "test/sys/test_aio_drop.rs" + +[[test]] +name = "test-clearenv" +path = "test/test_clearenv.rs" + +[[test]] +name = "test-lio-listio-resubmit" +path = "test/sys/test_lio_listio_resubmit.rs" + +[[test]] +name = "test-mount" +path = "test/test_mount.rs" +harness = false + +[[test]] +name = "test-ptymaster-drop" +path = "test/test_ptymaster_drop.rs" +[dependencies.bitflags] +version = "1.1" + +[dependencies.cfg-if] +version = "1.0" + +[dependencies.libc] +version = "0.2.102" +features = ["extra_traits"] +[dev-dependencies.assert-impl] +version = "0.1" + +[dev-dependencies.lazy_static] +version = "1.2" + +[dev-dependencies.parking_lot] +version = "0.11.2" + +[dev-dependencies.rand] +version = "0.8" + +[dev-dependencies.semver] +version = "1.0.0" + +[dev-dependencies.tempfile] +version = "3.2.0" +[target."cfg(any(target_os = \"android\", target_os = \"linux\"))".dev-dependencies.caps] +version = "0.5.1" +[target."cfg(not(target_os = \"redox\"))".dependencies.memoffset] +version = "0.6.3" +[target."cfg(target_os = \"dragonfly\")".build-dependencies.cc] +version = "1" +[target."cfg(target_os = \"freebsd\")".dev-dependencies.sysctl] +version = "0.1" diff --git a/bash-5.1/vendor/nix-0.23.1/LICENSE b/bash-5.1/vendor/nix-0.23.1/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..aff9096fdf11d161613202fe9329fcfa5e35d212 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Carl Lerche + nix-rust Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/bash-5.1/vendor/nix-0.23.1/README.md b/bash-5.1/vendor/nix-0.23.1/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a8759f1ce8ecbee70a9f0900a1a92ba563a813b6 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/README.md @@ -0,0 +1,102 @@ +# Rust bindings to *nix APIs + +[![Cirrus Build Status](https://api.cirrus-ci.com/github/nix-rust/nix.svg)](https://cirrus-ci.com/github/nix-rust/nix) +[![crates.io](https://img.shields.io/crates/v/nix.svg)](https://crates.io/crates/nix) + +[Documentation (Releases)](https://docs.rs/nix/) + +Nix seeks to provide friendly bindings to various *nix platform APIs (Linux, Darwin, +...). The goal is to not provide a 100% unified interface, but to unify +what can be while still providing platform specific APIs. + +For many system APIs, Nix provides a safe alternative to the unsafe APIs +exposed by the [libc crate](https://github.com/rust-lang/libc). This is done by +wrapping the libc functionality with types/abstractions that enforce legal/safe +usage. + + +As an example of what Nix provides, examine the differences between what is +exposed by libc and nix for the +[gethostname](https://man7.org/linux/man-pages/man2/gethostname.2.html) system +call: + +```rust,ignore +// libc api (unsafe, requires handling return code/errno) +pub unsafe extern fn gethostname(name: *mut c_char, len: size_t) -> c_int; + +// nix api (returns a nix::Result) +pub fn gethostname<'a>(buffer: &'a mut [u8]) -> Result<&'a CStr>; +``` + +## Supported Platforms + +nix target support consists of two tiers. While nix attempts to support all +platforms supported by [libc](https://github.com/rust-lang/libc), only some +platforms are actively supported due to either technical or manpower +limitations. Support for platforms is split into three tiers: + + * Tier 1 - Builds and tests for this target are run in CI. Failures of either + block the inclusion of new code. + * Tier 2 - Builds for this target are run in CI. Failures during the build + blocks the inclusion of new code. Tests may be run, but failures + in tests don't block the inclusion of new code. + * Tier 3 - Builds for this target are run in CI. Failures during the build + *do not* block the inclusion of new code. Testing may be run, but + failures in tests don't block the inclusion of new code. + +The following targets are supported by `nix`: + +Tier 1: + * aarch64-unknown-linux-gnu + * arm-unknown-linux-gnueabi + * armv7-unknown-linux-gnueabihf + * i686-unknown-freebsd + * i686-unknown-linux-gnu + * i686-unknown-linux-musl + * mips-unknown-linux-gnu + * mips64-unknown-linux-gnuabi64 + * mips64el-unknown-linux-gnuabi64 + * mipsel-unknown-linux-gnu + * powerpc64le-unknown-linux-gnu + * x86_64-apple-darwin + * x86_64-unknown-freebsd + * x86_64-unknown-linux-gnu + * x86_64-unknown-linux-musl + +Tier 2: + * aarch64-apple-ios + * aarch64-linux-android + * arm-linux-androideabi + * arm-unknown-linux-musleabi + * armv7-linux-androideabi + * i686-linux-android + * powerpc-unknown-linux-gnu + * s390x-unknown-linux-gnu + * x86_64-apple-ios + * x86_64-linux-android + * x86_64-unknown-illumos + * x86_64-unknown-netbsd + +Tier 3: + * x86_64-fuchsia + * x86_64-unknown-dragonfly + * x86_64-unknown-linux-gnux32 + * x86_64-unknown-openbsd + * x86_64-unknown-redox + +## Minimum Supported Rust Version (MSRV) + +nix is supported on Rust 1.46.0 and higher. It's MSRV will not be +changed in the future without bumping the major or minor version. + +## Contributing + +Contributions are very welcome. Please See [CONTRIBUTING](CONTRIBUTING.md) for +additional details. + +Feel free to join us in [the nix-rust/nix](https://gitter.im/nix-rust/nix) channel on Gitter to +discuss `nix` development. + +## License + +Nix is licensed under the MIT license. See [LICENSE](LICENSE) for more details. diff --git a/bash-5.1/vendor/nix-0.23.1/src/dir.rs b/bash-5.1/vendor/nix-0.23.1/src/dir.rs new file mode 100644 index 0000000000000000000000000000000000000000..ed70a458ac2abe69538aab8694d0ccd9c73fffe3 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/dir.rs @@ -0,0 +1,246 @@ +use crate::{Error, NixPath, Result}; +use crate::errno::Errno; +use crate::fcntl::{self, OFlag}; +use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd}; +use std::ptr; +use std::ffi; +use crate::sys; + +#[cfg(target_os = "linux")] +use libc::{dirent64 as dirent, readdir64_r as readdir_r}; + +#[cfg(not(target_os = "linux"))] +use libc::{dirent, readdir_r}; + +/// An open directory. +/// +/// This is a lower-level interface than `std::fs::ReadDir`. Notable differences: +/// * can be opened from a file descriptor (as returned by `openat`, perhaps before knowing +/// if the path represents a file or directory). +/// * implements `AsRawFd`, so it can be passed to `fstat`, `openat`, etc. +/// The file descriptor continues to be owned by the `Dir`, so callers must not keep a `RawFd` +/// after the `Dir` is dropped. +/// * can be iterated through multiple times without closing and reopening the file +/// descriptor. Each iteration rewinds when finished. +/// * returns entries for `.` (current directory) and `..` (parent directory). +/// * returns entries' names as a `CStr` (no allocation or conversion beyond whatever libc +/// does). +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct Dir( + ptr::NonNull +); + +impl Dir { + /// Opens the given path as with `fcntl::open`. + pub fn open(path: &P, oflag: OFlag, + mode: sys::stat::Mode) -> Result { + let fd = fcntl::open(path, oflag, mode)?; + Dir::from_fd(fd) + } + + /// Opens the given path as with `fcntl::openat`. + pub fn openat(dirfd: RawFd, path: &P, oflag: OFlag, + mode: sys::stat::Mode) -> Result { + let fd = fcntl::openat(dirfd, path, oflag, mode)?; + Dir::from_fd(fd) + } + + /// Converts from a descriptor-based object, closing the descriptor on success or failure. + #[inline] + pub fn from(fd: F) -> Result { + Dir::from_fd(fd.into_raw_fd()) + } + + /// Converts from a file descriptor, closing it on success or failure. + pub fn from_fd(fd: RawFd) -> Result { + let d = ptr::NonNull::new(unsafe { libc::fdopendir(fd) }).ok_or_else(|| { + let e = Error::last(); + unsafe { libc::close(fd) }; + e + })?; + Ok(Dir(d)) + } + + /// Returns an iterator of `Result` which rewinds when finished. + pub fn iter(&mut self) -> Iter { + Iter(self) + } +} + +// `Dir` is not `Sync`. With the current implementation, it could be, but according to +// https://www.gnu.org/software/libc/manual/html_node/Reading_002fClosing-Directory.html, +// future versions of POSIX are likely to obsolete `readdir_r` and specify that it's unsafe to +// call `readdir` simultaneously from multiple threads. +// +// `Dir` is safe to pass from one thread to another, as it's not reference-counted. +unsafe impl Send for Dir {} + +impl AsRawFd for Dir { + fn as_raw_fd(&self) -> RawFd { + unsafe { libc::dirfd(self.0.as_ptr()) } + } +} + +impl Drop for Dir { + fn drop(&mut self) { + let e = Errno::result(unsafe { libc::closedir(self.0.as_ptr()) }); + if !std::thread::panicking() && e == Err(Errno::EBADF) { + panic!("Closing an invalid file descriptor!"); + }; + } +} + +fn next(dir: &mut Dir) -> Option> { + unsafe { + // Note: POSIX specifies that portable applications should dynamically allocate a + // buffer with room for a `d_name` field of size `pathconf(..., _PC_NAME_MAX)` plus 1 + // for the NUL byte. It doesn't look like the std library does this; it just uses + // fixed-sized buffers (and libc's dirent seems to be sized so this is appropriate). + // Probably fine here too then. + let mut ent = std::mem::MaybeUninit::::uninit(); + let mut result = ptr::null_mut(); + if let Err(e) = Errno::result( + readdir_r(dir.0.as_ptr(), ent.as_mut_ptr(), &mut result)) + { + return Some(Err(e)); + } + if result.is_null() { + return None; + } + assert_eq!(result, ent.as_mut_ptr()); + Some(Ok(Entry(ent.assume_init()))) + } +} + +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct Iter<'d>(&'d mut Dir); + +impl<'d> Iterator for Iter<'d> { + type Item = Result; + + fn next(&mut self) -> Option { + next(self.0) + } +} + +impl<'d> Drop for Iter<'d> { + fn drop(&mut self) { + unsafe { libc::rewinddir((self.0).0.as_ptr()) } + } +} + +/// The return type of [Dir::into_iter] +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct OwningIter(Dir); + +impl Iterator for OwningIter { + type Item = Result; + + fn next(&mut self) -> Option { + next(&mut self.0) + } +} + +impl IntoIterator for Dir { + type Item = Result; + type IntoIter = OwningIter; + + /// Creates a owning iterator, that is, one that takes ownership of the + /// `Dir`. The `Dir` cannot be used after calling this. This can be useful + /// when you have a function that both creates a `Dir` instance and returns + /// an `Iterator`. + /// + /// Example: + /// + /// ``` + /// use nix::{dir::Dir, fcntl::OFlag, sys::stat::Mode}; + /// use std::{iter::Iterator, string::String}; + /// + /// fn ls_upper(dirname: &str) -> impl Iterator { + /// let d = Dir::open(dirname, OFlag::O_DIRECTORY, Mode::S_IXUSR).unwrap(); + /// d.into_iter().map(|x| x.unwrap().file_name().as_ref().to_string_lossy().to_ascii_uppercase()) + /// } + /// ``` + fn into_iter(self) -> Self::IntoIter { + OwningIter(self) + } +} + +/// A directory entry, similar to `std::fs::DirEntry`. +/// +/// Note that unlike the std version, this may represent the `.` or `..` entries. +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct Entry(dirent); + +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] +pub enum Type { + Fifo, + CharacterDevice, + Directory, + BlockDevice, + File, + Symlink, + Socket, +} + +impl Entry { + /// Returns the inode number (`d_ino`) of the underlying `dirent`. + #[cfg(any(target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "ios", + target_os = "l4re", + target_os = "linux", + target_os = "macos", + target_os = "solaris"))] + pub fn ino(&self) -> u64 { + self.0.d_ino as u64 + } + + /// Returns the inode number (`d_fileno`) of the underlying `dirent`. + #[cfg(not(any(target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "ios", + target_os = "l4re", + target_os = "linux", + target_os = "macos", + target_os = "solaris")))] + #[allow(clippy::useless_conversion)] // Not useless on all OSes + pub fn ino(&self) -> u64 { + u64::from(self.0.d_fileno) + } + + /// Returns the bare file name of this directory entry without any other leading path component. + pub fn file_name(&self) -> &ffi::CStr { + unsafe { ::std::ffi::CStr::from_ptr(self.0.d_name.as_ptr()) } + } + + /// Returns the type of this directory entry, if known. + /// + /// See platform `readdir(3)` or `dirent(5)` manpage for when the file type is known; + /// notably, some Linux filesystems don't implement this. The caller should use `stat` or + /// `fstat` if this returns `None`. + pub fn file_type(&self) -> Option { + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + match self.0.d_type { + libc::DT_FIFO => Some(Type::Fifo), + libc::DT_CHR => Some(Type::CharacterDevice), + libc::DT_DIR => Some(Type::Directory), + libc::DT_BLK => Some(Type::BlockDevice), + libc::DT_REG => Some(Type::File), + libc::DT_LNK => Some(Type::Symlink), + libc::DT_SOCK => Some(Type::Socket), + /* libc::DT_UNKNOWN | */ _ => None, + } + + // illumos and Solaris systems do not have the d_type member at all: + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + None + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/env.rs b/bash-5.1/vendor/nix-0.23.1/src/env.rs new file mode 100644 index 0000000000000000000000000000000000000000..bcae28713edb90edb54c24b0d1bcaa9e6d254f6d --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/env.rs @@ -0,0 +1,65 @@ +//! Environment variables +use cfg_if::cfg_if; +use std::fmt; + +/// Indicates that [`clearenv`] failed for some unknown reason +#[derive(Clone, Copy, Debug)] +pub struct ClearEnvError; + +impl fmt::Display for ClearEnvError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "clearenv failed") + } +} + +impl std::error::Error for ClearEnvError {} + +/// Clear the environment of all name-value pairs. +/// +/// On platforms where libc provides `clearenv()`, it will be used. libc's +/// `clearenv()` is documented to return an error code but not set errno; if the +/// return value indicates a failure, this function will return +/// [`ClearEnvError`]. +/// +/// On platforms where libc does not provide `clearenv()`, a fallback +/// implementation will be used that iterates over all environment variables and +/// removes them one-by-one. +/// +/// # Safety +/// +/// This function is not threadsafe and can cause undefined behavior in +/// combination with `std::env` or other program components that access the +/// environment. See, for example, the discussion on `std::env::remove_var`; this +/// function is a case of an "inherently unsafe non-threadsafe API" dealing with +/// the environment. +/// +/// The caller must ensure no other threads access the process environment while +/// this function executes and that no raw pointers to an element of libc's +/// `environ` is currently held. The latter is not an issue if the only other +/// environment access in the program is via `std::env`, but the requirement on +/// thread safety must still be upheld. +pub unsafe fn clearenv() -> std::result::Result<(), ClearEnvError> { + cfg_if! { + if #[cfg(any(target_os = "fuchsia", + target_os = "wasi", + target_env = "wasi", + target_env = "uclibc", + target_os = "linux", + target_os = "android", + target_os = "emscripten"))] { + let ret = libc::clearenv(); + } else { + use std::env; + for (name, _) in env::vars_os() { + env::remove_var(name); + } + let ret = 0; + } + } + + if ret == 0 { + Ok(()) + } else { + Err(ClearEnvError) + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/errno.rs b/bash-5.1/vendor/nix-0.23.1/src/errno.rs new file mode 100644 index 0000000000000000000000000000000000000000..3da246e823969bca1e9819ee649fba7fbbc929ab --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/errno.rs @@ -0,0 +1,2723 @@ +use cfg_if::cfg_if; +use libc::{c_int, c_void}; +use std::convert::TryFrom; +use std::{fmt, io, error}; +use crate::{Error, Result}; + +pub use self::consts::*; + +cfg_if! { + if #[cfg(any(target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] { + unsafe fn errno_location() -> *mut c_int { + libc::__error() + } + } else if #[cfg(any(target_os = "android", + target_os = "netbsd", + target_os = "openbsd"))] { + unsafe fn errno_location() -> *mut c_int { + libc::__errno() + } + } else if #[cfg(any(target_os = "linux", + target_os = "redox", + target_os = "dragonfly", + target_os = "fuchsia"))] { + unsafe fn errno_location() -> *mut c_int { + libc::__errno_location() + } + } else if #[cfg(any(target_os = "illumos", target_os = "solaris"))] { + unsafe fn errno_location() -> *mut c_int { + libc::___errno() + } + } +} + +/// Sets the platform-specific errno to no-error +fn clear() { + // Safe because errno is a thread-local variable + unsafe { + *errno_location() = 0; + } +} + +/// Returns the platform-specific value of errno +pub fn errno() -> i32 { + unsafe { + (*errno_location()) as i32 + } +} + +impl Errno { + /// Convert this `Error` to an [`Errno`](enum.Errno.html). + /// + /// # Example + /// + /// ``` + /// # use nix::Error; + /// # use nix::errno::Errno; + /// let e = Error::from(Errno::EPERM); + /// assert_eq!(Some(Errno::EPERM), e.as_errno()); + /// ``` + #[deprecated( + since = "0.22.0", + note = "It's a no-op now; just delete it." + )] + pub const fn as_errno(self) -> Option { + Some(self) + } + + /// Create a nix Error from a given errno + #[deprecated( + since = "0.22.0", + note = "It's a no-op now; just delete it." + )] + #[allow(clippy::wrong_self_convention)] // False positive + pub fn from_errno(errno: Errno) -> Error { + errno + } + + /// Create a new invalid argument error (`EINVAL`) + #[deprecated( + since = "0.22.0", + note = "Use Errno::EINVAL instead" + )] + pub const fn invalid_argument() -> Error { + Errno::EINVAL + } + + pub fn last() -> Self { + last() + } + + pub fn desc(self) -> &'static str { + desc(self) + } + + pub const fn from_i32(err: i32) -> Errno { + from_i32(err) + } + + pub fn clear() { + clear() + } + + /// Returns `Ok(value)` if it does not contain the sentinel value. This + /// should not be used when `-1` is not the errno sentinel value. + #[inline] + pub fn result>(value: S) -> Result { + if value == S::sentinel() { + Err(Self::last()) + } else { + Ok(value) + } + } + + /// Backwards compatibility hack for Nix <= 0.21.0 users + /// + /// In older versions of Nix, `Error::Sys` was an enum variant. Now it's a + /// function, which is compatible with most of the former use cases of the + /// enum variant. But you should use `Error(Errno::...)` instead. + #[deprecated( + since = "0.22.0", + note = "Use Errno::... instead" + )] + #[allow(non_snake_case)] + #[inline] + pub const fn Sys(errno: Errno) -> Error { + errno + } +} + +/// The sentinel value indicates that a function failed and more detailed +/// information about the error can be found in `errno` +pub trait ErrnoSentinel: Sized { + fn sentinel() -> Self; +} + +impl ErrnoSentinel for isize { + fn sentinel() -> Self { -1 } +} + +impl ErrnoSentinel for i32 { + fn sentinel() -> Self { -1 } +} + +impl ErrnoSentinel for i64 { + fn sentinel() -> Self { -1 } +} + +impl ErrnoSentinel for *mut c_void { + fn sentinel() -> Self { -1isize as *mut c_void } +} + +impl ErrnoSentinel for libc::sighandler_t { + fn sentinel() -> Self { libc::SIG_ERR } +} + +impl error::Error for Errno {} + +impl fmt::Display for Errno { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{:?}: {}", self, self.desc()) + } +} + +impl From for io::Error { + fn from(err: Errno) -> Self { + io::Error::from_raw_os_error(err as i32) + } +} + +impl TryFrom for Errno { + type Error = io::Error; + + fn try_from(ioerror: io::Error) -> std::result::Result { + ioerror.raw_os_error() + .map(Errno::from_i32) + .ok_or(ioerror) + } +} + +fn last() -> Errno { + Errno::from_i32(errno()) +} + +fn desc(errno: Errno) -> &'static str { + use self::Errno::*; + match errno { + UnknownErrno => "Unknown errno", + EPERM => "Operation not permitted", + ENOENT => "No such file or directory", + ESRCH => "No such process", + EINTR => "Interrupted system call", + EIO => "I/O error", + ENXIO => "No such device or address", + E2BIG => "Argument list too long", + ENOEXEC => "Exec format error", + EBADF => "Bad file number", + ECHILD => "No child processes", + EAGAIN => "Try again", + ENOMEM => "Out of memory", + EACCES => "Permission denied", + EFAULT => "Bad address", + ENOTBLK => "Block device required", + EBUSY => "Device or resource busy", + EEXIST => "File exists", + EXDEV => "Cross-device link", + ENODEV => "No such device", + ENOTDIR => "Not a directory", + EISDIR => "Is a directory", + EINVAL => "Invalid argument", + ENFILE => "File table overflow", + EMFILE => "Too many open files", + ENOTTY => "Not a typewriter", + ETXTBSY => "Text file busy", + EFBIG => "File too large", + ENOSPC => "No space left on device", + ESPIPE => "Illegal seek", + EROFS => "Read-only file system", + EMLINK => "Too many links", + EPIPE => "Broken pipe", + EDOM => "Math argument out of domain of func", + ERANGE => "Math result not representable", + EDEADLK => "Resource deadlock would occur", + ENAMETOOLONG => "File name too long", + ENOLCK => "No record locks available", + ENOSYS => "Function not implemented", + ENOTEMPTY => "Directory not empty", + ELOOP => "Too many symbolic links encountered", + ENOMSG => "No message of desired type", + EIDRM => "Identifier removed", + EINPROGRESS => "Operation now in progress", + EALREADY => "Operation already in progress", + ENOTSOCK => "Socket operation on non-socket", + EDESTADDRREQ => "Destination address required", + EMSGSIZE => "Message too long", + EPROTOTYPE => "Protocol wrong type for socket", + ENOPROTOOPT => "Protocol not available", + EPROTONOSUPPORT => "Protocol not supported", + ESOCKTNOSUPPORT => "Socket type not supported", + EPFNOSUPPORT => "Protocol family not supported", + EAFNOSUPPORT => "Address family not supported by protocol", + EADDRINUSE => "Address already in use", + EADDRNOTAVAIL => "Cannot assign requested address", + ENETDOWN => "Network is down", + ENETUNREACH => "Network is unreachable", + ENETRESET => "Network dropped connection because of reset", + ECONNABORTED => "Software caused connection abort", + ECONNRESET => "Connection reset by peer", + ENOBUFS => "No buffer space available", + EISCONN => "Transport endpoint is already connected", + ENOTCONN => "Transport endpoint is not connected", + ESHUTDOWN => "Cannot send after transport endpoint shutdown", + ETOOMANYREFS => "Too many references: cannot splice", + ETIMEDOUT => "Connection timed out", + ECONNREFUSED => "Connection refused", + EHOSTDOWN => "Host is down", + EHOSTUNREACH => "No route to host", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ECHRNG => "Channel number out of range", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL2NSYNC => "Level 2 not synchronized", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL3HLT => "Level 3 halted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL3RST => "Level 3 reset", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELNRNG => "Link number out of range", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EUNATCH => "Protocol driver not attached", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOCSI => "No CSI structure available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL2HLT => "Level 2 halted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADE => "Invalid exchange", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADR => "Invalid request descriptor", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EXFULL => "Exchange full", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOANO => "No anode", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADRQC => "Invalid request code", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADSLT => "Invalid slot", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBFONT => "Bad font file format", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOSTR => "Device not a stream", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENODATA => "No data available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ETIME => "Timer expired", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOSR => "Out of streams resources", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENONET => "Machine is not on the network", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOPKG => "Package not installed", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EREMOTE => "Object is remote", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOLINK => "Link has been severed", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EADV => "Advertise error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ESRMNT => "Srmount error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ECOMM => "Communication error on send", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EPROTO => "Protocol error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EMULTIHOP => "Multihop attempted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EDOTDOT => "RFS specific error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EBADMSG => "Not a data message", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + EBADMSG => "Trying to read unreadable message", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EOVERFLOW => "Value too large for defined data type", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOTUNIQ => "Name not unique on network", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADFD => "File descriptor in bad state", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EREMCHG => "Remote address changed", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBACC => "Can not access a needed shared library", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBBAD => "Accessing a corrupted shared library", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBSCN => ".lib section in a.out corrupted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBMAX => "Attempting to link in too many shared libraries", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBEXEC => "Cannot exec a shared library directly", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia", target_os = "openbsd"))] + EILSEQ => "Illegal byte sequence", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ERESTART => "Interrupted system call should be restarted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ESTRPIPE => "Streams pipe error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EUSERS => "Too many users", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "netbsd", + target_os = "redox"))] + EOPNOTSUPP => "Operation not supported on transport endpoint", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ESTALE => "Stale file handle", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EUCLEAN => "Structure needs cleaning", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENOTNAM => "Not a XENIX named type file", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENAVAIL => "No XENIX semaphores available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EISNAM => "Is a named type file", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EREMOTEIO => "Remote I/O error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EDQUOT => "Quota exceeded", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "openbsd", + target_os = "dragonfly"))] + ENOMEDIUM => "No medium found", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "openbsd"))] + EMEDIUMTYPE => "Wrong medium type", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ECANCELED => "Operation canceled", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENOKEY => "Required key not available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EKEYEXPIRED => "Key has expired", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EKEYREVOKED => "Key has been revoked", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EKEYREJECTED => "Key was rejected by service", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EOWNERDEAD => "Owner died", + + #[cfg(any( target_os = "illumos", target_os = "solaris"))] + EOWNERDEAD => "Process died with lock", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENOTRECOVERABLE => "State not recoverable", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + ENOTRECOVERABLE => "Lock is not recoverable", + + #[cfg(any(all(target_os = "linux", not(target_arch="mips")), + target_os = "fuchsia"))] + ERFKILL => "Operation not possible due to RF-kill", + + #[cfg(any(all(target_os = "linux", not(target_arch="mips")), + target_os = "fuchsia"))] + EHWPOISON => "Memory page has hardware error", + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + EDOOFUS => "Programming error", + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly", target_os = "redox"))] + EMULTIHOP => "Multihop attempted", + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly", + target_os = "redox"))] + ENOLINK => "Link has been severed", + + #[cfg(target_os = "freebsd")] + ENOTCAPABLE => "Capabilities insufficient", + + #[cfg(target_os = "freebsd")] + ECAPMODE => "Not permitted in capability mode", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + ENEEDAUTH => "Need authenticator", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox", target_os = "illumos", + target_os = "solaris"))] + EOVERFLOW => "Value too large to be stored in data type", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + EILSEQ => "Illegal byte sequence", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + ENOATTR => "Attribute not found", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EBADMSG => "Bad message", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EPROTO => "Protocol error", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "ios", target_os = "openbsd"))] + ENOTRECOVERABLE => "State not recoverable", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "ios", target_os = "openbsd"))] + EOWNERDEAD => "Previous owner died", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "illumos", target_os = "solaris"))] + ENOTSUP => "Operation not supported", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROCLIM => "Too many processes", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EUSERS => "Too many users", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox", target_os = "illumos", + target_os = "solaris"))] + EDQUOT => "Disc quota exceeded", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox", target_os = "illumos", + target_os = "solaris"))] + ESTALE => "Stale NFS file handle", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EREMOTE => "Too many levels of remote in path", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EBADRPC => "RPC struct is bad", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + ERPCMISMATCH => "RPC version wrong", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROGUNAVAIL => "RPC prog. not avail", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROGMISMATCH => "Program version wrong", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROCUNAVAIL => "Bad procedure for program", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EFTYPE => "Inappropriate file type or format", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EAUTH => "Authentication error", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + ECANCELED => "Operation canceled", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EPWROFF => "Device power is off", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EDEVERR => "Device error, e.g. paper out", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EBADEXEC => "Bad executable", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EBADARCH => "Bad CPU type in executable", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + ESHLIBVERS => "Shared library version mismatch", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EBADMACHO => "Malformed Macho file", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd"))] + EMULTIHOP => "Reserved", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ENODATA => "No message available on STREAM", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd"))] + ENOLINK => "Reserved", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ENOSR => "No STREAM resources", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ENOSTR => "Not a STREAM", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ETIME => "STREAM ioctl timeout", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "illumos", target_os = "solaris"))] + EOPNOTSUPP => "Operation not supported on socket", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + ENOPOLICY => "No such policy registered", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EQFULL => "Interface output queue is full", + + #[cfg(target_os = "openbsd")] + EOPNOTSUPP => "Operation not supported", + + #[cfg(target_os = "openbsd")] + EIPSEC => "IPsec processing failure", + + #[cfg(target_os = "dragonfly")] + EASYNC => "Async", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + EDEADLOCK => "Resource deadlock would occur", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + ELOCKUNMAPPED => "Locked lock was unmapped", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + ENOTACTIVE => "Facility is not active", + } +} + +#[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EAGAIN = libc::EAGAIN, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EDEADLK = libc::EDEADLK, + ENAMETOOLONG = libc::ENAMETOOLONG, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + ENOTEMPTY = libc::ENOTEMPTY, + ELOOP = libc::ELOOP, + ENOMSG = libc::ENOMSG, + EIDRM = libc::EIDRM, + ECHRNG = libc::ECHRNG, + EL2NSYNC = libc::EL2NSYNC, + EL3HLT = libc::EL3HLT, + EL3RST = libc::EL3RST, + ELNRNG = libc::ELNRNG, + EUNATCH = libc::EUNATCH, + ENOCSI = libc::ENOCSI, + EL2HLT = libc::EL2HLT, + EBADE = libc::EBADE, + EBADR = libc::EBADR, + EXFULL = libc::EXFULL, + ENOANO = libc::ENOANO, + EBADRQC = libc::EBADRQC, + EBADSLT = libc::EBADSLT, + EBFONT = libc::EBFONT, + ENOSTR = libc::ENOSTR, + ENODATA = libc::ENODATA, + ETIME = libc::ETIME, + ENOSR = libc::ENOSR, + ENONET = libc::ENONET, + ENOPKG = libc::ENOPKG, + EREMOTE = libc::EREMOTE, + ENOLINK = libc::ENOLINK, + EADV = libc::EADV, + ESRMNT = libc::ESRMNT, + ECOMM = libc::ECOMM, + EPROTO = libc::EPROTO, + EMULTIHOP = libc::EMULTIHOP, + EDOTDOT = libc::EDOTDOT, + EBADMSG = libc::EBADMSG, + EOVERFLOW = libc::EOVERFLOW, + ENOTUNIQ = libc::ENOTUNIQ, + EBADFD = libc::EBADFD, + EREMCHG = libc::EREMCHG, + ELIBACC = libc::ELIBACC, + ELIBBAD = libc::ELIBBAD, + ELIBSCN = libc::ELIBSCN, + ELIBMAX = libc::ELIBMAX, + ELIBEXEC = libc::ELIBEXEC, + EILSEQ = libc::EILSEQ, + ERESTART = libc::ERESTART, + ESTRPIPE = libc::ESTRPIPE, + EUSERS = libc::EUSERS, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + EALREADY = libc::EALREADY, + EINPROGRESS = libc::EINPROGRESS, + ESTALE = libc::ESTALE, + EUCLEAN = libc::EUCLEAN, + ENOTNAM = libc::ENOTNAM, + ENAVAIL = libc::ENAVAIL, + EISNAM = libc::EISNAM, + EREMOTEIO = libc::EREMOTEIO, + EDQUOT = libc::EDQUOT, + ENOMEDIUM = libc::ENOMEDIUM, + EMEDIUMTYPE = libc::EMEDIUMTYPE, + ECANCELED = libc::ECANCELED, + ENOKEY = libc::ENOKEY, + EKEYEXPIRED = libc::EKEYEXPIRED, + EKEYREVOKED = libc::EKEYREVOKED, + EKEYREJECTED = libc::EKEYREJECTED, + EOWNERDEAD = libc::EOWNERDEAD, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + ERFKILL = libc::ERFKILL, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + EHWPOISON = libc::EHWPOISON, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ENOTSUP instead" + )] + pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; + + impl Errno { + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EAGAIN => EAGAIN, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EDEADLK => EDEADLK, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::ENOTEMPTY => ENOTEMPTY, + libc::ELOOP => ELOOP, + libc::ENOMSG => ENOMSG, + libc::EIDRM => EIDRM, + libc::ECHRNG => ECHRNG, + libc::EL2NSYNC => EL2NSYNC, + libc::EL3HLT => EL3HLT, + libc::EL3RST => EL3RST, + libc::ELNRNG => ELNRNG, + libc::EUNATCH => EUNATCH, + libc::ENOCSI => ENOCSI, + libc::EL2HLT => EL2HLT, + libc::EBADE => EBADE, + libc::EBADR => EBADR, + libc::EXFULL => EXFULL, + libc::ENOANO => ENOANO, + libc::EBADRQC => EBADRQC, + libc::EBADSLT => EBADSLT, + libc::EBFONT => EBFONT, + libc::ENOSTR => ENOSTR, + libc::ENODATA => ENODATA, + libc::ETIME => ETIME, + libc::ENOSR => ENOSR, + libc::ENONET => ENONET, + libc::ENOPKG => ENOPKG, + libc::EREMOTE => EREMOTE, + libc::ENOLINK => ENOLINK, + libc::EADV => EADV, + libc::ESRMNT => ESRMNT, + libc::ECOMM => ECOMM, + libc::EPROTO => EPROTO, + libc::EMULTIHOP => EMULTIHOP, + libc::EDOTDOT => EDOTDOT, + libc::EBADMSG => EBADMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ENOTUNIQ => ENOTUNIQ, + libc::EBADFD => EBADFD, + libc::EREMCHG => EREMCHG, + libc::ELIBACC => ELIBACC, + libc::ELIBBAD => ELIBBAD, + libc::ELIBSCN => ELIBSCN, + libc::ELIBMAX => ELIBMAX, + libc::ELIBEXEC => ELIBEXEC, + libc::EILSEQ => EILSEQ, + libc::ERESTART => ERESTART, + libc::ESTRPIPE => ESTRPIPE, + libc::EUSERS => EUSERS, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::EALREADY => EALREADY, + libc::EINPROGRESS => EINPROGRESS, + libc::ESTALE => ESTALE, + libc::EUCLEAN => EUCLEAN, + libc::ENOTNAM => ENOTNAM, + libc::ENAVAIL => ENAVAIL, + libc::EISNAM => EISNAM, + libc::EREMOTEIO => EREMOTEIO, + libc::EDQUOT => EDQUOT, + libc::ENOMEDIUM => ENOMEDIUM, + libc::EMEDIUMTYPE => EMEDIUMTYPE, + libc::ECANCELED => ECANCELED, + libc::ENOKEY => ENOKEY, + libc::EKEYEXPIRED => EKEYEXPIRED, + libc::EKEYREVOKED => EKEYREVOKED, + libc::EKEYREJECTED => EKEYREJECTED, + libc::EOWNERDEAD => EOWNERDEAD, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + libc::ERFKILL => ERFKILL, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + libc::EHWPOISON => EHWPOISON, + _ => UnknownErrno, + } + } +} + +#[cfg(any(target_os = "macos", target_os = "ios"))] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EPWROFF = libc::EPWROFF, + EDEVERR = libc::EDEVERR, + EOVERFLOW = libc::EOVERFLOW, + EBADEXEC = libc::EBADEXEC, + EBADARCH = libc::EBADARCH, + ESHLIBVERS = libc::ESHLIBVERS, + EBADMACHO = libc::EBADMACHO, + ECANCELED = libc::ECANCELED, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENODATA = libc::ENODATA, + ENOLINK = libc::ENOLINK, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + EPROTO = libc::EPROTO, + ETIME = libc::ETIME, + EOPNOTSUPP = libc::EOPNOTSUPP, + ENOPOLICY = libc::ENOPOLICY, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + EQFULL = libc::EQFULL, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::EQFULL; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + + impl Errno { + pub const ELAST: Errno = Errno::EQFULL; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::ENOTSUP => ENOTSUP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EPWROFF => EPWROFF, + libc::EDEVERR => EDEVERR, + libc::EOVERFLOW => EOVERFLOW, + libc::EBADEXEC => EBADEXEC, + libc::EBADARCH => EBADARCH, + libc::ESHLIBVERS => ESHLIBVERS, + libc::EBADMACHO => EBADMACHO, + libc::ECANCELED => ECANCELED, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EILSEQ => EILSEQ, + libc::ENOATTR => ENOATTR, + libc::EBADMSG => EBADMSG, + libc::EMULTIHOP => EMULTIHOP, + libc::ENODATA => ENODATA, + libc::ENOLINK => ENOLINK, + libc::ENOSR => ENOSR, + libc::ENOSTR => ENOSTR, + libc::EPROTO => EPROTO, + libc::ETIME => ETIME, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::ENOPOLICY => ENOPOLICY, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::EOWNERDEAD => EOWNERDEAD, + libc::EQFULL => EQFULL, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "freebsd")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EDOOFUS = libc::EDOOFUS, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + ENOTCAPABLE = libc::ENOTCAPABLE, + ECAPMODE = libc::ECAPMODE, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::EOWNERDEAD; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EOPNOTSUPP instead" + )] + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + + impl Errno { + pub const ELAST: Errno = Errno::EOWNERDEAD; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::ENOTSUP => ENOTSUP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ECANCELED => ECANCELED, + libc::EILSEQ => EILSEQ, + libc::ENOATTR => ENOATTR, + libc::EDOOFUS => EDOOFUS, + libc::EBADMSG => EBADMSG, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + libc::ENOTCAPABLE => ENOTCAPABLE, + libc::ECAPMODE => ECAPMODE, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::EOWNERDEAD => EOWNERDEAD, + _ => UnknownErrno, + } + } +} + + +#[cfg(target_os = "dragonfly")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EDOOFUS = libc::EDOOFUS, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + ENOMEDIUM = libc::ENOMEDIUM, + EASYNC = libc::EASYNC, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::EASYNC; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EOPNOTSUPP instead" + )] + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + + impl Errno { + pub const ELAST: Errno = Errno::EASYNC; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR=> EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::ENOTSUP => ENOTSUP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ECANCELED => ECANCELED, + libc::EILSEQ => EILSEQ, + libc::ENOATTR => ENOATTR, + libc::EDOOFUS => EDOOFUS, + libc::EBADMSG => EBADMSG, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + libc::ENOMEDIUM => ENOMEDIUM, + libc::EASYNC => EASYNC, + _ => UnknownErrno, + } + } +} + + +#[cfg(target_os = "openbsd")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIPSEC = libc::EIPSEC, + ENOATTR = libc::ENOATTR, + EILSEQ = libc::EILSEQ, + ENOMEDIUM = libc::ENOMEDIUM, + EMEDIUMTYPE = libc::EMEDIUMTYPE, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + ENOTSUP = libc::ENOTSUP, + EBADMSG = libc::EBADMSG, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + EPROTO = libc::EPROTO, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::ENOTSUP; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const ELAST: Errno = Errno::ENOTSUP; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIPSEC => EIPSEC, + libc::ENOATTR => ENOATTR, + libc::EILSEQ => EILSEQ, + libc::ENOMEDIUM => ENOMEDIUM, + libc::EMEDIUMTYPE => EMEDIUMTYPE, + libc::EOVERFLOW => EOVERFLOW, + libc::ECANCELED => ECANCELED, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::ENOTSUP => ENOTSUP, + libc::EBADMSG => EBADMSG, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::EOWNERDEAD => EOWNERDEAD, + libc::EPROTO => EPROTO, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "netbsd")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + EILSEQ = libc::EILSEQ, + ENOTSUP = libc::ENOTSUP, + ECANCELED = libc::ECANCELED, + EBADMSG = libc::EBADMSG, + ENODATA = libc::ENODATA, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + ETIME = libc::ETIME, + ENOATTR = libc::ENOATTR, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::ENOTSUP; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const ELAST: Errno = Errno::ENOTSUP; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::EILSEQ => EILSEQ, + libc::ENOTSUP => ENOTSUP, + libc::ECANCELED => ECANCELED, + libc::EBADMSG => EBADMSG, + libc::ENODATA => ENODATA, + libc::ENOSR => ENOSR, + libc::ENOSTR => ENOSTR, + libc::ETIME => ETIME, + libc::ENOATTR => ENOATTR, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "redox")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + EILSEQ = libc::EILSEQ, + ECANCELED = libc::ECANCELED, + EBADMSG = libc::EBADMSG, + ENODATA = libc::ENODATA, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + ETIME = libc::ETIME, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::EILSEQ => EILSEQ, + libc::ECANCELED => ECANCELED, + libc::EBADMSG => EBADMSG, + libc::ENODATA => ENODATA, + libc::ENOSR => ENOSR, + libc::ENOSTR => ENOSTR, + libc::ETIME => ETIME, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + _ => UnknownErrno, + } + } +} + +#[cfg(any(target_os = "illumos", target_os = "solaris"))] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EAGAIN = libc::EAGAIN, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + ENOMSG = libc::ENOMSG, + EIDRM = libc::EIDRM, + ECHRNG = libc::ECHRNG, + EL2NSYNC = libc::EL2NSYNC, + EL3HLT = libc::EL3HLT, + EL3RST = libc::EL3RST, + ELNRNG = libc::ELNRNG, + EUNATCH = libc::EUNATCH, + ENOCSI = libc::ENOCSI, + EL2HLT = libc::EL2HLT, + EDEADLK = libc::EDEADLK, + ENOLCK = libc::ENOLCK, + ECANCELED = libc::ECANCELED, + ENOTSUP = libc::ENOTSUP, + EDQUOT = libc::EDQUOT, + EBADE = libc::EBADE, + EBADR = libc::EBADR, + EXFULL = libc::EXFULL, + ENOANO = libc::ENOANO, + EBADRQC = libc::EBADRQC, + EBADSLT = libc::EBADSLT, + EDEADLOCK = libc::EDEADLOCK, + EBFONT = libc::EBFONT, + EOWNERDEAD = libc::EOWNERDEAD, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + ENOSTR = libc::ENOSTR, + ENODATA = libc::ENODATA, + ETIME = libc::ETIME, + ENOSR = libc::ENOSR, + ENONET = libc::ENONET, + ENOPKG = libc::ENOPKG, + EREMOTE = libc::EREMOTE, + ENOLINK = libc::ENOLINK, + EADV = libc::EADV, + ESRMNT = libc::ESRMNT, + ECOMM = libc::ECOMM, + EPROTO = libc::EPROTO, + ELOCKUNMAPPED = libc::ELOCKUNMAPPED, + ENOTACTIVE = libc::ENOTACTIVE, + EMULTIHOP = libc::EMULTIHOP, + EBADMSG = libc::EBADMSG, + ENAMETOOLONG = libc::ENAMETOOLONG, + EOVERFLOW = libc::EOVERFLOW, + ENOTUNIQ = libc::ENOTUNIQ, + EBADFD = libc::EBADFD, + EREMCHG = libc::EREMCHG, + ELIBACC = libc::ELIBACC, + ELIBBAD = libc::ELIBBAD, + ELIBSCN = libc::ELIBSCN, + ELIBMAX = libc::ELIBMAX, + ELIBEXEC = libc::ELIBEXEC, + EILSEQ = libc::EILSEQ, + ENOSYS = libc::ENOSYS, + ELOOP = libc::ELOOP, + ERESTART = libc::ERESTART, + ESTRPIPE = libc::ESTRPIPE, + ENOTEMPTY = libc::ENOTEMPTY, + EUSERS = libc::EUSERS, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + EALREADY = libc::EALREADY, + EINPROGRESS = libc::EINPROGRESS, + ESTALE = libc::ESTALE, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::ELAST; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const ELAST: Errno = Errno::ESTALE; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EAGAIN => EAGAIN, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::ENOMSG => ENOMSG, + libc::EIDRM => EIDRM, + libc::ECHRNG => ECHRNG, + libc::EL2NSYNC => EL2NSYNC, + libc::EL3HLT => EL3HLT, + libc::EL3RST => EL3RST, + libc::ELNRNG => ELNRNG, + libc::EUNATCH => EUNATCH, + libc::ENOCSI => ENOCSI, + libc::EL2HLT => EL2HLT, + libc::EDEADLK => EDEADLK, + libc::ENOLCK => ENOLCK, + libc::ECANCELED => ECANCELED, + libc::ENOTSUP => ENOTSUP, + libc::EDQUOT => EDQUOT, + libc::EBADE => EBADE, + libc::EBADR => EBADR, + libc::EXFULL => EXFULL, + libc::ENOANO => ENOANO, + libc::EBADRQC => EBADRQC, + libc::EBADSLT => EBADSLT, + libc::EDEADLOCK => EDEADLOCK, + libc::EBFONT => EBFONT, + libc::EOWNERDEAD => EOWNERDEAD, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::ENOSTR => ENOSTR, + libc::ENODATA => ENODATA, + libc::ETIME => ETIME, + libc::ENOSR => ENOSR, + libc::ENONET => ENONET, + libc::ENOPKG => ENOPKG, + libc::EREMOTE => EREMOTE, + libc::ENOLINK => ENOLINK, + libc::EADV => EADV, + libc::ESRMNT => ESRMNT, + libc::ECOMM => ECOMM, + libc::EPROTO => EPROTO, + libc::ELOCKUNMAPPED => ELOCKUNMAPPED, + libc::ENOTACTIVE => ENOTACTIVE, + libc::EMULTIHOP => EMULTIHOP, + libc::EBADMSG => EBADMSG, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EOVERFLOW => EOVERFLOW, + libc::ENOTUNIQ => ENOTUNIQ, + libc::EBADFD => EBADFD, + libc::EREMCHG => EREMCHG, + libc::ELIBACC => ELIBACC, + libc::ELIBBAD => ELIBBAD, + libc::ELIBSCN => ELIBSCN, + libc::ELIBMAX => ELIBMAX, + libc::ELIBEXEC => ELIBEXEC, + libc::EILSEQ => EILSEQ, + libc::ENOSYS => ENOSYS, + libc::ELOOP => ELOOP, + libc::ERESTART => ERESTART, + libc::ESTRPIPE => ESTRPIPE, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EUSERS => EUSERS, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::EALREADY => EALREADY, + libc::EINPROGRESS => EINPROGRESS, + libc::ESTALE => ESTALE, + _ => UnknownErrno, + } + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/fcntl.rs b/bash-5.1/vendor/nix-0.23.1/src/fcntl.rs new file mode 100644 index 0000000000000000000000000000000000000000..dd8e59a6ec49f2c4c466161e6cbe842e1cbcfadb --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/fcntl.rs @@ -0,0 +1,696 @@ +use crate::errno::Errno; +use libc::{self, c_char, c_int, c_uint, size_t, ssize_t}; +use std::ffi::OsString; +#[cfg(not(target_os = "redox"))] +use std::os::raw; +use std::os::unix::ffi::OsStringExt; +use std::os::unix::io::RawFd; +use crate::sys::stat::Mode; +use crate::{NixPath, Result}; + +#[cfg(any(target_os = "android", target_os = "linux"))] +use std::ptr; // For splice and copy_file_range +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::sys::uio::IoVec; // For vmsplice + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_env = "uclibc", + target_os = "freebsd" +))] +pub use self::posix_fadvise::*; + +#[cfg(not(target_os = "redox"))] +libc_bitflags! { + pub struct AtFlags: c_int { + AT_REMOVEDIR; + AT_SYMLINK_FOLLOW; + AT_SYMLINK_NOFOLLOW; + #[cfg(any(target_os = "android", target_os = "linux"))] + AT_NO_AUTOMOUNT; + #[cfg(any(target_os = "android", target_os = "linux"))] + AT_EMPTY_PATH; + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + AT_EACCESS; + } +} + +libc_bitflags!( + /// Configuration options for opened files. + pub struct OFlag: c_int { + /// Mask for the access mode of the file. + O_ACCMODE; + /// Use alternate I/O semantics. + #[cfg(target_os = "netbsd")] + O_ALT_IO; + /// Open the file in append-only mode. + O_APPEND; + /// Generate a signal when input or output becomes possible. + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + O_ASYNC; + /// Closes the file descriptor once an `execve` call is made. + /// + /// Also sets the file offset to the beginning of the file. + O_CLOEXEC; + /// Create the file if it does not exist. + O_CREAT; + /// Try to minimize cache effects of the I/O for this file. + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd"))] + O_DIRECT; + /// If the specified path isn't a directory, fail. + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + O_DIRECTORY; + /// Implicitly follow each `write()` with an `fdatasync()`. + #[cfg(any(target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + O_DSYNC; + /// Error out if a file was not created. + O_EXCL; + /// Open for execute only. + #[cfg(target_os = "freebsd")] + O_EXEC; + /// Open with an exclusive file lock. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox"))] + O_EXLOCK; + /// Same as `O_SYNC`. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + all(target_os = "linux", not(target_env = "musl")), + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox"))] + O_FSYNC; + /// Allow files whose sizes can't be represented in an `off_t` to be opened. + #[cfg(any(target_os = "android", target_os = "linux"))] + O_LARGEFILE; + /// Do not update the file last access time during `read(2)`s. + #[cfg(any(target_os = "android", target_os = "linux"))] + O_NOATIME; + /// Don't attach the device as the process' controlling terminal. + #[cfg(not(target_os = "redox"))] + O_NOCTTY; + /// Same as `O_NONBLOCK`. + #[cfg(not(target_os = "redox"))] + O_NDELAY; + /// `open()` will fail if the given path is a symbolic link. + O_NOFOLLOW; + /// When possible, open the file in nonblocking mode. + O_NONBLOCK; + /// Don't deliver `SIGPIPE`. + #[cfg(target_os = "netbsd")] + O_NOSIGPIPE; + /// Obtain a file descriptor for low-level access. + /// + /// The file itself is not opened and other file operations will fail. + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + O_PATH; + /// Only allow reading. + /// + /// This should not be combined with `O_WRONLY` or `O_RDWR`. + O_RDONLY; + /// Allow both reading and writing. + /// + /// This should not be combined with `O_WRONLY` or `O_RDONLY`. + O_RDWR; + /// Similar to `O_DSYNC` but applies to `read`s instead. + #[cfg(any(target_os = "linux", target_os = "netbsd", target_os = "openbsd"))] + O_RSYNC; + /// Skip search permission checks. + #[cfg(target_os = "netbsd")] + O_SEARCH; + /// Open with a shared file lock. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox"))] + O_SHLOCK; + /// Implicitly follow each `write()` with an `fsync()`. + #[cfg(not(target_os = "redox"))] + O_SYNC; + /// Create an unnamed temporary file. + #[cfg(any(target_os = "android", target_os = "linux"))] + O_TMPFILE; + /// Truncate an existing regular file to 0 length if it allows writing. + O_TRUNC; + /// Restore default TTY attributes. + #[cfg(target_os = "freebsd")] + O_TTY_INIT; + /// Only allow writing. + /// + /// This should not be combined with `O_RDONLY` or `O_RDWR`. + O_WRONLY; + } +); + +// The conversion is not identical on all operating systems. +#[allow(clippy::useless_conversion)] +pub fn open(path: &P, oflag: OFlag, mode: Mode) -> Result { + let fd = path.with_nix_path(|cstr| { + unsafe { libc::open(cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) } + })?; + + Errno::result(fd) +} + +// The conversion is not identical on all operating systems. +#[allow(clippy::useless_conversion)] +#[cfg(not(target_os = "redox"))] +pub fn openat( + dirfd: RawFd, + path: &P, + oflag: OFlag, + mode: Mode, +) -> Result { + let fd = path.with_nix_path(|cstr| { + unsafe { libc::openat(dirfd, cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) } + })?; + Errno::result(fd) +} + +#[cfg(not(target_os = "redox"))] +pub fn renameat( + old_dirfd: Option, + old_path: &P1, + new_dirfd: Option, + new_path: &P2, +) -> Result<()> { + let res = old_path.with_nix_path(|old_cstr| { + new_path.with_nix_path(|new_cstr| unsafe { + libc::renameat( + at_rawfd(old_dirfd), + old_cstr.as_ptr(), + at_rawfd(new_dirfd), + new_cstr.as_ptr(), + ) + }) + })??; + Errno::result(res).map(drop) +} + +#[cfg(all( + target_os = "linux", + target_env = "gnu", +))] +libc_bitflags! { + pub struct RenameFlags: u32 { + RENAME_EXCHANGE; + RENAME_NOREPLACE; + RENAME_WHITEOUT; + } +} + +#[cfg(all( + target_os = "linux", + target_env = "gnu", +))] +pub fn renameat2( + old_dirfd: Option, + old_path: &P1, + new_dirfd: Option, + new_path: &P2, + flags: RenameFlags, +) -> Result<()> { + let res = old_path.with_nix_path(|old_cstr| { + new_path.with_nix_path(|new_cstr| unsafe { + libc::renameat2( + at_rawfd(old_dirfd), + old_cstr.as_ptr(), + at_rawfd(new_dirfd), + new_cstr.as_ptr(), + flags.bits(), + ) + }) + })??; + Errno::result(res).map(drop) +} + +fn wrap_readlink_result(mut v: Vec, len: ssize_t) -> Result { + unsafe { v.set_len(len as usize) } + v.shrink_to_fit(); + Ok(OsString::from_vec(v.to_vec())) +} + +fn readlink_maybe_at( + dirfd: Option, + path: &P, + v: &mut Vec, +) -> Result { + path.with_nix_path(|cstr| unsafe { + match dirfd { + #[cfg(target_os = "redox")] + Some(_) => unreachable!(), + #[cfg(not(target_os = "redox"))] + Some(dirfd) => libc::readlinkat( + dirfd, + cstr.as_ptr(), + v.as_mut_ptr() as *mut c_char, + v.capacity() as size_t, + ), + None => libc::readlink( + cstr.as_ptr(), + v.as_mut_ptr() as *mut c_char, + v.capacity() as size_t, + ), + } + }) +} + +fn inner_readlink(dirfd: Option, path: &P) -> Result { + let mut v = Vec::with_capacity(libc::PATH_MAX as usize); + // simple case: result is strictly less than `PATH_MAX` + let res = readlink_maybe_at(dirfd, path, &mut v)?; + let len = Errno::result(res)?; + debug_assert!(len >= 0); + if (len as usize) < v.capacity() { + return wrap_readlink_result(v, res); + } + // Uh oh, the result is too long... + // Let's try to ask lstat how many bytes to allocate. + let reported_size = match dirfd { + #[cfg(target_os = "redox")] + Some(_) => unreachable!(), + #[cfg(any(target_os = "android", target_os = "linux"))] + Some(dirfd) => { + let flags = if path.is_empty() { AtFlags::AT_EMPTY_PATH } else { AtFlags::empty() }; + super::sys::stat::fstatat(dirfd, path, flags | AtFlags::AT_SYMLINK_NOFOLLOW) + }, + #[cfg(not(any(target_os = "android", target_os = "linux", target_os = "redox")))] + Some(dirfd) => super::sys::stat::fstatat(dirfd, path, AtFlags::AT_SYMLINK_NOFOLLOW), + None => super::sys::stat::lstat(path) + } + .map(|x| x.st_size) + .unwrap_or(0); + let mut try_size = if reported_size > 0 { + // Note: even if `lstat`'s apparently valid answer turns out to be + // wrong, we will still read the full symlink no matter what. + reported_size as usize + 1 + } else { + // If lstat doesn't cooperate, or reports an error, be a little less + // precise. + (libc::PATH_MAX as usize).max(128) << 1 + }; + loop { + v.reserve_exact(try_size); + let res = readlink_maybe_at(dirfd, path, &mut v)?; + let len = Errno::result(res)?; + debug_assert!(len >= 0); + if (len as usize) < v.capacity() { + break wrap_readlink_result(v, res); + } else { + // Ugh! Still not big enough! + match try_size.checked_shl(1) { + Some(next_size) => try_size = next_size, + // It's absurd that this would happen, but handle it sanely + // anyway. + None => break Err(Errno::ENAMETOOLONG), + } + } + } +} + +pub fn readlink(path: &P) -> Result { + inner_readlink(None, path) +} + +#[cfg(not(target_os = "redox"))] +pub fn readlinkat(dirfd: RawFd, path: &P) -> Result { + inner_readlink(Some(dirfd), path) +} + +/// Computes the raw fd consumed by a function of the form `*at`. +#[cfg(not(target_os = "redox"))] +pub(crate) fn at_rawfd(fd: Option) -> raw::c_int { + match fd { + None => libc::AT_FDCWD, + Some(fd) => fd, + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +libc_bitflags!( + /// Additional flags for file sealing, which allows for limiting operations on a file. + pub struct SealFlag: c_int { + /// Prevents further calls to `fcntl()` with `F_ADD_SEALS`. + F_SEAL_SEAL; + /// The file cannot be reduced in size. + F_SEAL_SHRINK; + /// The size of the file cannot be increased. + F_SEAL_GROW; + /// The file contents cannot be modified. + F_SEAL_WRITE; + } +); + +libc_bitflags!( + /// Additional configuration flags for `fcntl`'s `F_SETFD`. + pub struct FdFlag: c_int { + /// The file descriptor will automatically be closed during a successful `execve(2)`. + FD_CLOEXEC; + } +); + +#[cfg(not(target_os = "redox"))] +#[derive(Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum FcntlArg<'a> { + F_DUPFD(RawFd), + F_DUPFD_CLOEXEC(RawFd), + F_GETFD, + F_SETFD(FdFlag), // FD_FLAGS + F_GETFL, + F_SETFL(OFlag), // O_NONBLOCK + F_SETLK(&'a libc::flock), + F_SETLKW(&'a libc::flock), + F_GETLK(&'a mut libc::flock), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_OFD_SETLK(&'a libc::flock), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_OFD_SETLKW(&'a libc::flock), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_OFD_GETLK(&'a mut libc::flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_ADD_SEALS(SealFlag), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_GET_SEALS, + #[cfg(any(target_os = "macos", target_os = "ios"))] + F_FULLFSYNC, + #[cfg(any(target_os = "linux", target_os = "android"))] + F_GETPIPE_SZ, + #[cfg(any(target_os = "linux", target_os = "android"))] + F_SETPIPE_SZ(c_int), + // TODO: Rest of flags +} + +#[cfg(target_os = "redox")] +#[derive(Debug, Clone, Copy, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum FcntlArg { + F_DUPFD(RawFd), + F_DUPFD_CLOEXEC(RawFd), + F_GETFD, + F_SETFD(FdFlag), // FD_FLAGS + F_GETFL, + F_SETFL(OFlag), // O_NONBLOCK +} +pub use self::FcntlArg::*; + +// TODO: Figure out how to handle value fcntl returns +pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result { + let res = unsafe { + match arg { + F_DUPFD(rawfd) => libc::fcntl(fd, libc::F_DUPFD, rawfd), + F_DUPFD_CLOEXEC(rawfd) => libc::fcntl(fd, libc::F_DUPFD_CLOEXEC, rawfd), + F_GETFD => libc::fcntl(fd, libc::F_GETFD), + F_SETFD(flag) => libc::fcntl(fd, libc::F_SETFD, flag.bits()), + F_GETFL => libc::fcntl(fd, libc::F_GETFL), + F_SETFL(flag) => libc::fcntl(fd, libc::F_SETFL, flag.bits()), + #[cfg(not(target_os = "redox"))] + F_SETLK(flock) => libc::fcntl(fd, libc::F_SETLK, flock), + #[cfg(not(target_os = "redox"))] + F_SETLKW(flock) => libc::fcntl(fd, libc::F_SETLKW, flock), + #[cfg(not(target_os = "redox"))] + F_GETLK(flock) => libc::fcntl(fd, libc::F_GETLK, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_OFD_SETLK(flock) => libc::fcntl(fd, libc::F_OFD_SETLK, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_OFD_SETLKW(flock) => libc::fcntl(fd, libc::F_OFD_SETLKW, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_OFD_GETLK(flock) => libc::fcntl(fd, libc::F_OFD_GETLK, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_ADD_SEALS(flag) => libc::fcntl(fd, libc::F_ADD_SEALS, flag.bits()), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_GET_SEALS => libc::fcntl(fd, libc::F_GET_SEALS), + #[cfg(any(target_os = "macos", target_os = "ios"))] + F_FULLFSYNC => libc::fcntl(fd, libc::F_FULLFSYNC), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_GETPIPE_SZ => libc::fcntl(fd, libc::F_GETPIPE_SZ), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_SETPIPE_SZ(size) => libc::fcntl(fd, libc::F_SETPIPE_SZ, size), + } + }; + + Errno::result(res) +} + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum FlockArg { + LockShared, + LockExclusive, + Unlock, + LockSharedNonblock, + LockExclusiveNonblock, + UnlockNonblock, +} + +#[cfg(not(target_os = "redox"))] +pub fn flock(fd: RawFd, arg: FlockArg) -> Result<()> { + use self::FlockArg::*; + + let res = unsafe { + match arg { + LockShared => libc::flock(fd, libc::LOCK_SH), + LockExclusive => libc::flock(fd, libc::LOCK_EX), + Unlock => libc::flock(fd, libc::LOCK_UN), + LockSharedNonblock => libc::flock(fd, libc::LOCK_SH | libc::LOCK_NB), + LockExclusiveNonblock => libc::flock(fd, libc::LOCK_EX | libc::LOCK_NB), + UnlockNonblock => libc::flock(fd, libc::LOCK_UN | libc::LOCK_NB), + } + }; + + Errno::result(res).map(drop) +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +libc_bitflags! { + /// Additional flags to `splice` and friends. + pub struct SpliceFFlags: c_uint { + /// Request that pages be moved instead of copied. + /// + /// Not applicable to `vmsplice`. + SPLICE_F_MOVE; + /// Do not block on I/O. + SPLICE_F_NONBLOCK; + /// Hint that more data will be coming in a subsequent splice. + /// + /// Not applicable to `vmsplice`. + SPLICE_F_MORE; + /// Gift the user pages to the kernel. + /// + /// Not applicable to `splice`. + SPLICE_F_GIFT; + } +} + +/// Copy a range of data from one file to another +/// +/// The `copy_file_range` system call performs an in-kernel copy between +/// file descriptors `fd_in` and `fd_out` without the additional cost of +/// transferring data from the kernel to user space and then back into the +/// kernel. It copies up to `len` bytes of data from file descriptor `fd_in` to +/// file descriptor `fd_out`, overwriting any data that exists within the +/// requested range of the target file. +/// +/// If the `off_in` and/or `off_out` arguments are used, the values +/// will be mutated to reflect the new position within the file after +/// copying. If they are not used, the relevant filedescriptors will be seeked +/// to the new position. +/// +/// On successful completion the number of bytes actually copied will be +/// returned. +#[cfg(any(target_os = "android", target_os = "linux"))] +pub fn copy_file_range( + fd_in: RawFd, + off_in: Option<&mut libc::loff_t>, + fd_out: RawFd, + off_out: Option<&mut libc::loff_t>, + len: usize, +) -> Result { + let off_in = off_in + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + let off_out = off_out + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + + let ret = unsafe { + libc::syscall( + libc::SYS_copy_file_range, + fd_in, + off_in, + fd_out, + off_out, + len, + 0, + ) + }; + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn splice( + fd_in: RawFd, + off_in: Option<&mut libc::loff_t>, + fd_out: RawFd, + off_out: Option<&mut libc::loff_t>, + len: usize, + flags: SpliceFFlags, +) -> Result { + let off_in = off_in + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + let off_out = off_out + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + + let ret = unsafe { libc::splice(fd_in, off_in, fd_out, off_out, len, flags.bits()) }; + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn tee(fd_in: RawFd, fd_out: RawFd, len: usize, flags: SpliceFFlags) -> Result { + let ret = unsafe { libc::tee(fd_in, fd_out, len, flags.bits()) }; + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn vmsplice(fd: RawFd, iov: &[IoVec<&[u8]>], flags: SpliceFFlags) -> Result { + let ret = unsafe { + libc::vmsplice( + fd, + iov.as_ptr() as *const libc::iovec, + iov.len(), + flags.bits(), + ) + }; + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any(target_os = "linux"))] +libc_bitflags!( + /// Mode argument flags for fallocate determining operation performed on a given range. + pub struct FallocateFlags: c_int { + /// File size is not changed. + /// + /// offset + len can be greater than file size. + FALLOC_FL_KEEP_SIZE; + /// Deallocates space by creating a hole. + /// + /// Must be ORed with FALLOC_FL_KEEP_SIZE. Byte range starts at offset and continues for len bytes. + FALLOC_FL_PUNCH_HOLE; + /// Removes byte range from a file without leaving a hole. + /// + /// Byte range to collapse starts at offset and continues for len bytes. + FALLOC_FL_COLLAPSE_RANGE; + /// Zeroes space in specified byte range. + /// + /// Byte range starts at offset and continues for len bytes. + FALLOC_FL_ZERO_RANGE; + /// Increases file space by inserting a hole within the file size. + /// + /// Does not overwrite existing data. Hole starts at offset and continues for len bytes. + FALLOC_FL_INSERT_RANGE; + /// Shared file data extants are made private to the file. + /// + /// Gaurantees that a subsequent write will not fail due to lack of space. + FALLOC_FL_UNSHARE_RANGE; + } +); + +/// Manipulates file space. +/// +/// Allows the caller to directly manipulate the allocated disk space for the +/// file referred to by fd. +#[cfg(any(target_os = "linux"))] +pub fn fallocate( + fd: RawFd, + mode: FallocateFlags, + offset: libc::off_t, + len: libc::off_t, +) -> Result<()> { + let res = unsafe { libc::fallocate(fd, mode.bits(), offset, len) }; + Errno::result(res).map(drop) +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_env = "uclibc", + target_os = "freebsd" +))] +mod posix_fadvise { + use crate::errno::Errno; + use std::os::unix::io::RawFd; + use crate::Result; + + libc_enum! { + #[repr(i32)] + #[non_exhaustive] + pub enum PosixFadviseAdvice { + POSIX_FADV_NORMAL, + POSIX_FADV_SEQUENTIAL, + POSIX_FADV_RANDOM, + POSIX_FADV_NOREUSE, + POSIX_FADV_WILLNEED, + POSIX_FADV_DONTNEED, + } + } + + pub fn posix_fadvise( + fd: RawFd, + offset: libc::off_t, + len: libc::off_t, + advice: PosixFadviseAdvice, + ) -> Result<()> { + let res = unsafe { libc::posix_fadvise(fd, offset, len, advice as libc::c_int) }; + + if res == 0 { + Ok(()) + } else { + Err(Errno::from_i32(res)) + } + } +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_os = "freebsd" +))] +pub fn posix_fallocate(fd: RawFd, offset: libc::off_t, len: libc::off_t) -> Result<()> { + let res = unsafe { libc::posix_fallocate(fd, offset, len) }; + match Errno::result(res) { + Err(err) => Err(err), + Ok(0) => Ok(()), + Ok(errno) => Err(Errno::from_i32(errno)), + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/features.rs b/bash-5.1/vendor/nix-0.23.1/src/features.rs new file mode 100644 index 0000000000000000000000000000000000000000..ed80fd714b3bfd96a7ddb6654ebb2db936e67093 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/features.rs @@ -0,0 +1,121 @@ +//! Feature tests for OS functionality +pub use self::os::*; + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod os { + use crate::sys::utsname::uname; + + // Features: + // * atomic cloexec on socket: 2.6.27 + // * pipe2: 2.6.27 + // * accept4: 2.6.28 + + static VERS_UNKNOWN: usize = 1; + static VERS_2_6_18: usize = 2; + static VERS_2_6_27: usize = 3; + static VERS_2_6_28: usize = 4; + static VERS_3: usize = 5; + + #[inline] + fn digit(dst: &mut usize, b: u8) { + *dst *= 10; + *dst += (b - b'0') as usize; + } + + fn parse_kernel_version() -> usize { + let u = uname(); + + let mut curr: usize = 0; + let mut major: usize = 0; + let mut minor: usize = 0; + let mut patch: usize = 0; + + for b in u.release().bytes() { + if curr >= 3 { + break; + } + + match b { + b'.' | b'-' => { + curr += 1; + } + b'0'..=b'9' => { + match curr { + 0 => digit(&mut major, b), + 1 => digit(&mut minor, b), + _ => digit(&mut patch, b), + } + } + _ => break, + } + } + + if major >= 3 { + VERS_3 + } else if major >= 2 { + if minor >= 7 { + VERS_UNKNOWN + } else if minor >= 6 { + if patch >= 28 { + VERS_2_6_28 + } else if patch >= 27 { + VERS_2_6_27 + } else { + VERS_2_6_18 + } + } else { + VERS_UNKNOWN + } + } else { + VERS_UNKNOWN + } + } + + fn kernel_version() -> usize { + static mut KERNEL_VERS: usize = 0; + + unsafe { + if KERNEL_VERS == 0 { + KERNEL_VERS = parse_kernel_version(); + } + + KERNEL_VERS + } + } + + /// Check if the OS supports atomic close-on-exec for sockets + pub fn socket_atomic_cloexec() -> bool { + kernel_version() >= VERS_2_6_27 + } + + #[test] + pub fn test_parsing_kernel_version() { + assert!(kernel_version() > 0); + } +} + +#[cfg(any( + target_os = "dragonfly", // Since ??? + target_os = "freebsd", // Since 10.0 + target_os = "illumos", // Since ??? + target_os = "netbsd", // Since 6.0 + target_os = "openbsd", // Since 5.7 + target_os = "redox", // Since 1-july-2020 +))] +mod os { + /// Check if the OS supports atomic close-on-exec for sockets + pub const fn socket_atomic_cloexec() -> bool { + true + } +} + +#[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "fuchsia", + target_os = "solaris"))] +mod os { + /// Check if the OS supports atomic close-on-exec for sockets + pub const fn socket_atomic_cloexec() -> bool { + false + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/ifaddrs.rs b/bash-5.1/vendor/nix-0.23.1/src/ifaddrs.rs new file mode 100644 index 0000000000000000000000000000000000000000..ed6328f3efab2842c99f2570ba3276e85fbfd374 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/ifaddrs.rs @@ -0,0 +1,147 @@ +//! Query network interface addresses +//! +//! Uses the Linux and/or BSD specific function `getifaddrs` to query the list +//! of interfaces and their associated addresses. + +use cfg_if::cfg_if; +use std::ffi; +use std::iter::Iterator; +use std::mem; +use std::option::Option; + +use crate::{Result, Errno}; +use crate::sys::socket::SockAddr; +use crate::net::if_::*; + +/// Describes a single address for an interface as returned by `getifaddrs`. +#[derive(Clone, Debug, Eq, Hash, PartialEq)] +pub struct InterfaceAddress { + /// Name of the network interface + pub interface_name: String, + /// Flags as from `SIOCGIFFLAGS` ioctl + pub flags: InterfaceFlags, + /// Network address of this interface + pub address: Option, + /// Netmask of this interface + pub netmask: Option, + /// Broadcast address of this interface, if applicable + pub broadcast: Option, + /// Point-to-point destination address + pub destination: Option, +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))] { + fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr { + info.ifa_ifu + } + } else { + fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr { + info.ifa_dstaddr + } + } +} + +impl InterfaceAddress { + /// Create an `InterfaceAddress` from the libc struct. + fn from_libc_ifaddrs(info: &libc::ifaddrs) -> InterfaceAddress { + let ifname = unsafe { ffi::CStr::from_ptr(info.ifa_name) }; + let address = unsafe { SockAddr::from_libc_sockaddr(info.ifa_addr) }; + let netmask = unsafe { SockAddr::from_libc_sockaddr(info.ifa_netmask) }; + let mut addr = InterfaceAddress { + interface_name: ifname.to_string_lossy().to_string(), + flags: InterfaceFlags::from_bits_truncate(info.ifa_flags as i32), + address, + netmask, + broadcast: None, + destination: None, + }; + + let ifu = get_ifu_from_sockaddr(info); + if addr.flags.contains(InterfaceFlags::IFF_POINTOPOINT) { + addr.destination = unsafe { SockAddr::from_libc_sockaddr(ifu) }; + } else if addr.flags.contains(InterfaceFlags::IFF_BROADCAST) { + addr.broadcast = unsafe { SockAddr::from_libc_sockaddr(ifu) }; + } + + addr + } +} + +/// Holds the results of `getifaddrs`. +/// +/// Use the function `getifaddrs` to create this Iterator. Note that the +/// actual list of interfaces can be iterated once and will be freed as +/// soon as the Iterator goes out of scope. +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct InterfaceAddressIterator { + base: *mut libc::ifaddrs, + next: *mut libc::ifaddrs, +} + +impl Drop for InterfaceAddressIterator { + fn drop(&mut self) { + unsafe { libc::freeifaddrs(self.base) }; + } +} + +impl Iterator for InterfaceAddressIterator { + type Item = InterfaceAddress; + fn next(&mut self) -> Option<::Item> { + match unsafe { self.next.as_ref() } { + Some(ifaddr) => { + self.next = ifaddr.ifa_next; + Some(InterfaceAddress::from_libc_ifaddrs(ifaddr)) + } + None => None, + } + } +} + +/// Get interface addresses using libc's `getifaddrs` +/// +/// Note that the underlying implementation differs between OSes. Only the +/// most common address families are supported by the nix crate (due to +/// lack of time and complexity of testing). The address family is encoded +/// in the specific variant of `SockAddr` returned for the fields `address`, +/// `netmask`, `broadcast`, and `destination`. For any entry not supported, +/// the returned list will contain a `None` entry. +/// +/// # Example +/// ``` +/// let addrs = nix::ifaddrs::getifaddrs().unwrap(); +/// for ifaddr in addrs { +/// match ifaddr.address { +/// Some(address) => { +/// println!("interface {} address {}", +/// ifaddr.interface_name, address); +/// }, +/// None => { +/// println!("interface {} with unsupported address family", +/// ifaddr.interface_name); +/// } +/// } +/// } +/// ``` +pub fn getifaddrs() -> Result { + let mut addrs = mem::MaybeUninit::<*mut libc::ifaddrs>::uninit(); + unsafe { + Errno::result(libc::getifaddrs(addrs.as_mut_ptr())).map(|_| { + InterfaceAddressIterator { + base: addrs.assume_init(), + next: addrs.assume_init(), + } + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + // Only checks if `getifaddrs` can be invoked without panicking. + #[test] + fn test_getifaddrs() { + let _ = getifaddrs(); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/kmod.rs b/bash-5.1/vendor/nix-0.23.1/src/kmod.rs new file mode 100644 index 0000000000000000000000000000000000000000..c42068c70a619302d121cf035eb97164b25f094d --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/kmod.rs @@ -0,0 +1,122 @@ +//! Load and unload kernel modules. +//! +//! For more details see + +use std::ffi::CStr; +use std::os::unix::io::AsRawFd; + +use crate::errno::Errno; +use crate::Result; + +/// Loads a kernel module from a buffer. +/// +/// It loads an ELF image into kernel space, +/// performs any necessary symbol relocations, +/// initializes module parameters to values provided by the caller, +/// and then runs the module's init function. +/// +/// This function requires `CAP_SYS_MODULE` privilege. +/// +/// The `module_image` argument points to a buffer containing the binary image +/// to be loaded. The buffer should contain a valid ELF image +/// built for the running kernel. +/// +/// The `param_values` argument is a string containing space-delimited specifications +/// of the values for module parameters. +/// Each of the parameter specifications has the form: +/// +/// `name[=value[,value...]]` +/// +/// # Example +/// +/// ```no_run +/// use std::fs::File; +/// use std::io::Read; +/// use std::ffi::CString; +/// use nix::kmod::init_module; +/// +/// let mut f = File::open("mykernel.ko").unwrap(); +/// let mut contents: Vec = Vec::new(); +/// f.read_to_end(&mut contents).unwrap(); +/// init_module(&mut contents, &CString::new("who=Rust when=Now,12").unwrap()).unwrap(); +/// ``` +/// +/// See [`man init_module(2)`](https://man7.org/linux/man-pages/man2/init_module.2.html) for more information. +pub fn init_module(module_image: &[u8], param_values: &CStr) -> Result<()> { + let res = unsafe { + libc::syscall( + libc::SYS_init_module, + module_image.as_ptr(), + module_image.len(), + param_values.as_ptr(), + ) + }; + + Errno::result(res).map(drop) +} + +libc_bitflags!( + /// Flags used by the `finit_module` function. + pub struct ModuleInitFlags: libc::c_uint { + /// Ignore symbol version hashes. + MODULE_INIT_IGNORE_MODVERSIONS; + /// Ignore kernel version magic. + MODULE_INIT_IGNORE_VERMAGIC; + } +); + +/// Loads a kernel module from a given file descriptor. +/// +/// # Example +/// +/// ```no_run +/// use std::fs::File; +/// use std::ffi::CString; +/// use nix::kmod::{finit_module, ModuleInitFlags}; +/// +/// let f = File::open("mymod.ko").unwrap(); +/// finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()).unwrap(); +/// ``` +/// +/// See [`man init_module(2)`](https://man7.org/linux/man-pages/man2/init_module.2.html) for more information. +pub fn finit_module(fd: &T, param_values: &CStr, flags: ModuleInitFlags) -> Result<()> { + let res = unsafe { + libc::syscall( + libc::SYS_finit_module, + fd.as_raw_fd(), + param_values.as_ptr(), + flags.bits(), + ) + }; + + Errno::result(res).map(drop) +} + +libc_bitflags!( + /// Flags used by `delete_module`. + /// + /// See [`man delete_module(2)`](https://man7.org/linux/man-pages/man2/delete_module.2.html) + /// for a detailed description how these flags work. + pub struct DeleteModuleFlags: libc::c_int { + O_NONBLOCK; + O_TRUNC; + } +); + +/// Unloads the kernel module with the given name. +/// +/// # Example +/// +/// ```no_run +/// use std::ffi::CString; +/// use nix::kmod::{delete_module, DeleteModuleFlags}; +/// +/// delete_module(&CString::new("mymod").unwrap(), DeleteModuleFlags::O_NONBLOCK).unwrap(); +/// ``` +/// +/// See [`man delete_module(2)`](https://man7.org/linux/man-pages/man2/delete_module.2.html) for more information. +pub fn delete_module(name: &CStr, flags: DeleteModuleFlags) -> Result<()> { + let res = unsafe { libc::syscall(libc::SYS_delete_module, name.as_ptr(), flags.bits()) }; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/lib.rs b/bash-5.1/vendor/nix-0.23.1/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..3a2b63ab0b7598d43f1215727d9b61d8c549aad7 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/lib.rs @@ -0,0 +1,227 @@ +//! Rust friendly bindings to the various *nix system functions. +//! +//! Modules are structured according to the C header file that they would be +//! defined in. +#![crate_name = "nix"] +#![cfg(unix)] +#![allow(non_camel_case_types)] +#![cfg_attr(test, deny(warnings))] +#![recursion_limit = "500"] +#![deny(unused)] +#![deny(unstable_features)] +#![deny(missing_copy_implementations)] +#![deny(missing_debug_implementations)] +#![warn(missing_docs)] + +// Re-exported external crates +pub use libc; + +// Private internal modules +#[macro_use] mod macros; + +// Public crates +#[cfg(not(target_os = "redox"))] +#[allow(missing_docs)] +pub mod dir; +pub mod env; +#[allow(missing_docs)] +pub mod errno; +pub mod features; +#[allow(missing_docs)] +pub mod fcntl; +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] +pub mod ifaddrs; +#[cfg(any(target_os = "android", + target_os = "linux"))] +#[allow(missing_docs)] +pub mod kmod; +#[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "linux"))] +pub mod mount; +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "fushsia", + target_os = "linux", + target_os = "netbsd"))] +#[allow(missing_docs)] +pub mod mqueue; +#[cfg(not(target_os = "redox"))] +pub mod net; +pub mod poll; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +pub mod pty; +pub mod sched; +pub mod sys; +#[allow(missing_docs)] +pub mod time; +// This can be implemented for other platforms as soon as libc +// provides bindings for them. +#[cfg(all(target_os = "linux", + any(target_arch = "x86", target_arch = "x86_64")))] +#[allow(missing_docs)] +pub mod ucontext; +#[allow(missing_docs)] +pub mod unistd; + +/* + * + * ===== Result / Error ===== + * + */ + +use libc::{c_char, PATH_MAX}; + +use std::{ptr, result}; +use std::ffi::{CStr, OsStr}; +use std::os::unix::ffi::OsStrExt; +use std::path::{Path, PathBuf}; + +use errno::Errno; + +/// Nix Result Type +pub type Result = result::Result; + +/// Nix's main error type. +/// +/// It's a wrapper around Errno. As such, it's very interoperable with +/// [`std::io::Error`], but it has the advantages of: +/// * `Clone` +/// * `Copy` +/// * `Eq` +/// * Small size +/// * Represents all of the system's errnos, instead of just the most common +/// ones. +pub type Error = Errno; + +/// Common trait used to represent file system paths by many Nix functions. +pub trait NixPath { + /// Is the path empty? + fn is_empty(&self) -> bool; + + /// Length of the path in bytes + fn len(&self) -> usize; + + /// Execute a function with this path as a `CStr`. + /// + /// Mostly used internally by Nix. + fn with_nix_path(&self, f: F) -> Result + where F: FnOnce(&CStr) -> T; +} + +impl NixPath for str { + fn is_empty(&self) -> bool { + NixPath::is_empty(OsStr::new(self)) + } + + fn len(&self) -> usize { + NixPath::len(OsStr::new(self)) + } + + fn with_nix_path(&self, f: F) -> Result + where F: FnOnce(&CStr) -> T { + OsStr::new(self).with_nix_path(f) + } +} + +impl NixPath for OsStr { + fn is_empty(&self) -> bool { + self.as_bytes().is_empty() + } + + fn len(&self) -> usize { + self.as_bytes().len() + } + + fn with_nix_path(&self, f: F) -> Result + where F: FnOnce(&CStr) -> T { + self.as_bytes().with_nix_path(f) + } +} + +impl NixPath for CStr { + fn is_empty(&self) -> bool { + self.to_bytes().is_empty() + } + + fn len(&self) -> usize { + self.to_bytes().len() + } + + fn with_nix_path(&self, f: F) -> Result + where F: FnOnce(&CStr) -> T { + // Equivalence with the [u8] impl. + if self.len() >= PATH_MAX as usize { + return Err(Errno::ENAMETOOLONG) + } + + Ok(f(self)) + } +} + +impl NixPath for [u8] { + fn is_empty(&self) -> bool { + self.is_empty() + } + + fn len(&self) -> usize { + self.len() + } + + fn with_nix_path(&self, f: F) -> Result + where F: FnOnce(&CStr) -> T { + let mut buf = [0u8; PATH_MAX as usize]; + + if self.len() >= PATH_MAX as usize { + return Err(Errno::ENAMETOOLONG) + } + + match self.iter().position(|b| *b == 0) { + Some(_) => Err(Errno::EINVAL), + None => { + unsafe { + // TODO: Replace with bytes::copy_memory. rust-lang/rust#24028 + ptr::copy_nonoverlapping(self.as_ptr(), buf.as_mut_ptr(), self.len()); + Ok(f(CStr::from_ptr(buf.as_ptr() as *const c_char))) + } + + } + } + } +} + +impl NixPath for Path { + fn is_empty(&self) -> bool { + NixPath::is_empty(self.as_os_str()) + } + + fn len(&self) -> usize { + NixPath::len(self.as_os_str()) + } + + fn with_nix_path(&self, f: F) -> Result where F: FnOnce(&CStr) -> T { + self.as_os_str().with_nix_path(f) + } +} + +impl NixPath for PathBuf { + fn is_empty(&self) -> bool { + NixPath::is_empty(self.as_os_str()) + } + + fn len(&self) -> usize { + NixPath::len(self.as_os_str()) + } + + fn with_nix_path(&self, f: F) -> Result where F: FnOnce(&CStr) -> T { + self.as_os_str().with_nix_path(f) + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/macros.rs b/bash-5.1/vendor/nix-0.23.1/src/macros.rs new file mode 100644 index 0000000000000000000000000000000000000000..3ccbfdd43b0488a56423b6a936dae9ba92aa13d1 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/macros.rs @@ -0,0 +1,311 @@ +/// The `libc_bitflags!` macro helps with a common use case of defining a public bitflags type +/// with values from the libc crate. It is used the same way as the `bitflags!` macro, except +/// that only the name of the flag value has to be given. +/// +/// The `libc` crate must be in scope with the name `libc`. +/// +/// # Example +/// ``` +/// libc_bitflags!{ +/// pub struct ProtFlags: libc::c_int { +/// PROT_NONE; +/// PROT_READ; +/// /// PROT_WRITE enables write protect +/// PROT_WRITE; +/// PROT_EXEC; +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSDOWN; +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSUP; +/// } +/// } +/// ``` +/// +/// Example with casting, due to a mistake in libc. In this example, the +/// various flags have different types, so we cast the broken ones to the right +/// type. +/// +/// ``` +/// libc_bitflags!{ +/// pub struct SaFlags: libc::c_ulong { +/// SA_NOCLDSTOP as libc::c_ulong; +/// SA_NOCLDWAIT; +/// SA_NODEFER as libc::c_ulong; +/// SA_ONSTACK; +/// SA_RESETHAND as libc::c_ulong; +/// SA_RESTART as libc::c_ulong; +/// SA_SIGINFO; +/// } +/// } +/// ``` +macro_rules! libc_bitflags { + ( + $(#[$outer:meta])* + pub struct $BitFlags:ident: $T:ty { + $( + $(#[$inner:ident $($args:tt)*])* + $Flag:ident $(as $cast:ty)*; + )+ + } + ) => { + ::bitflags::bitflags! { + $(#[$outer])* + pub struct $BitFlags: $T { + $( + $(#[$inner $($args)*])* + const $Flag = libc::$Flag $(as $cast)*; + )+ + } + } + }; +} + +/// The `libc_enum!` macro helps with a common use case of defining an enum exclusively using +/// values from the `libc` crate. This macro supports both `pub` and private `enum`s. +/// +/// The `libc` crate must be in scope with the name `libc`. +/// +/// # Example +/// ``` +/// libc_enum!{ +/// pub enum ProtFlags { +/// PROT_NONE, +/// PROT_READ, +/// PROT_WRITE, +/// PROT_EXEC, +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSDOWN, +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSUP, +/// } +/// } +/// ``` +macro_rules! libc_enum { + // Exit rule. + (@make_enum + name: $BitFlags:ident, + { + $v:vis + attrs: [$($attrs:tt)*], + entries: [$($entries:tt)*], + } + ) => { + $($attrs)* + #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + $v enum $BitFlags { + $($entries)* + } + }; + + // Exit rule including TryFrom + (@make_enum + name: $BitFlags:ident, + { + $v:vis + attrs: [$($attrs:tt)*], + entries: [$($entries:tt)*], + from_type: $repr:path, + try_froms: [$($try_froms:tt)*] + } + ) => { + $($attrs)* + #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + $v enum $BitFlags { + $($entries)* + } + impl ::std::convert::TryFrom<$repr> for $BitFlags { + type Error = $crate::Error; + #[allow(unused_doc_comments)] + fn try_from(x: $repr) -> $crate::Result { + match x { + $($try_froms)* + _ => Err($crate::Error::EINVAL) + } + } + } + }; + + // Done accumulating. + (@accumulate_entries + name: $BitFlags:ident, + { + $v:vis + attrs: $attrs:tt, + }, + $entries:tt, + $try_froms:tt; + ) => { + libc_enum! { + @make_enum + name: $BitFlags, + { + $v + attrs: $attrs, + entries: $entries, + } + } + }; + + // Done accumulating and want TryFrom + (@accumulate_entries + name: $BitFlags:ident, + { + $v:vis + attrs: $attrs:tt, + from_type: $repr:path, + }, + $entries:tt, + $try_froms:tt; + ) => { + libc_enum! { + @make_enum + name: $BitFlags, + { + $v + attrs: $attrs, + entries: $entries, + from_type: $repr, + try_froms: $try_froms + } + } + }; + + // Munch an attr. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + #[$attr:meta] $($tail:tt)* + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + #[$attr] + ], + [ + $($try_froms)* + #[$attr] + ]; + $($tail)* + } + }; + + // Munch last ident if not followed by a comma. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + $entry:ident + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + $entry = libc::$entry, + ], + [ + $($try_froms)* + libc::$entry => Ok($BitFlags::$entry), + ]; + } + }; + + // Munch an ident; covers terminating comma case. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + $entry:ident, + $($tail:tt)* + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + $entry = libc::$entry, + ], + [ + $($try_froms)* + libc::$entry => Ok($BitFlags::$entry), + ]; + $($tail)* + } + }; + + // Munch an ident and cast it to the given type; covers terminating comma. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + $entry:ident as $ty:ty, + $($tail:tt)* + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + $entry = libc::$entry as $ty, + ], + [ + $($try_froms)* + libc::$entry as $ty => Ok($BitFlags::$entry), + ]; + $($tail)* + } + }; + + // Entry rule. + ( + $(#[$attr:meta])* + $v:vis enum $BitFlags:ident { + $($vals:tt)* + } + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + { + $v + attrs: [$(#[$attr])*], + }, + [], + []; + $($vals)* + } + }; + + // Entry rule including TryFrom + ( + $(#[$attr:meta])* + $v:vis enum $BitFlags:ident { + $($vals:tt)* + } + impl TryFrom<$repr:path> + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + { + $v + attrs: [$(#[$attr])*], + from_type: $repr, + }, + [], + []; + $($vals)* + } + }; +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/mount/bsd.rs b/bash-5.1/vendor/nix-0.23.1/src/mount/bsd.rs new file mode 100644 index 0000000000000000000000000000000000000000..627bfa5ec1092ed13d3794f33107b6f5bde1f42d --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/mount/bsd.rs @@ -0,0 +1,426 @@ +use crate::{ + Error, + Errno, + NixPath, + Result, + sys::uio::IoVec +}; +use libc::{c_char, c_int, c_uint, c_void}; +use std::{ + borrow::Cow, + ffi::{CString, CStr}, + fmt, + io, + ptr +}; + + +libc_bitflags!( + /// Used with [`Nmount::nmount`]. + pub struct MntFlags: c_int { + /// ACL support enabled. + #[cfg(any(target_os = "netbsd", target_os = "freebsd"))] + MNT_ACLS; + /// All I/O to the file system should be done asynchronously. + MNT_ASYNC; + /// dir should instead be a file system ID encoded as “FSID:val0:val1”. + #[cfg(target_os = "freebsd")] + MNT_BYFSID; + /// Force a read-write mount even if the file system appears to be + /// unclean. + MNT_FORCE; + /// GEOM journal support enabled. + #[cfg(target_os = "freebsd")] + MNT_GJOURNAL; + /// MAC support for objects. + #[cfg(any(target_os = "macos", target_os = "freebsd"))] + MNT_MULTILABEL; + /// Disable read clustering. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + MNT_NOCLUSTERR; + /// Disable write clustering. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + MNT_NOCLUSTERW; + /// Enable NFS version 4 ACLs. + #[cfg(target_os = "freebsd")] + MNT_NFS4ACLS; + /// Do not update access times. + MNT_NOATIME; + /// Disallow program execution. + MNT_NOEXEC; + /// Do not honor setuid or setgid bits on files when executing them. + MNT_NOSUID; + /// Do not follow symlinks. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + MNT_NOSYMFOLLOW; + /// Mount read-only. + MNT_RDONLY; + /// Causes the vfs subsystem to update its data structures pertaining to + /// the specified already mounted file system. + MNT_RELOAD; + /// Create a snapshot of the file system. + /// + /// See [mksnap_ffs(8)](https://www.freebsd.org/cgi/man.cgi?query=mksnap_ffs) + #[cfg(any(target_os = "macos", target_os = "freebsd"))] + MNT_SNAPSHOT; + /// Using soft updates. + #[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + MNT_SOFTDEP; + /// Directories with the SUID bit set chown new files to their own + /// owner. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + MNT_SUIDDIR; + /// All I/O to the file system should be done synchronously. + MNT_SYNCHRONOUS; + /// Union with underlying fs. + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd" + ))] + MNT_UNION; + /// Indicates that the mount command is being applied to an already + /// mounted file system. + MNT_UPDATE; + /// Check vnode use counts. + #[cfg(target_os = "freebsd")] + MNT_NONBUSY; + } +); + + +/// The Error type of [`Nmount::nmount`]. +/// +/// It wraps an [`Errno`], but also may contain an additional message returned +/// by `nmount(2)`. +#[derive(Debug)] +pub struct NmountError { + errno: Error, + errmsg: Option +} + +impl NmountError { + /// Returns the additional error string sometimes generated by `nmount(2)`. + pub fn errmsg(&self) -> Option<&str> { + self.errmsg.as_deref() + } + + /// Returns the inner [`Error`] + pub const fn error(&self) -> Error { + self.errno + } + + fn new(error: Error, errmsg: Option<&CStr>) -> Self { + Self { + errno: error, + errmsg: errmsg.map(CStr::to_string_lossy).map(Cow::into_owned) + } + } +} + +impl std::error::Error for NmountError {} + +impl fmt::Display for NmountError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if let Some(errmsg) = &self.errmsg { + write!(f, "{:?}: {}: {}", self.errno, errmsg, self.errno.desc()) + } else { + write!(f, "{:?}: {}", self.errno, self.errno.desc()) + } + } +} + +impl From for io::Error { + fn from(err: NmountError) -> Self { + err.errno.into() + } +} + +/// Result type of [`Nmount::nmount`]. +pub type NmountResult = std::result::Result<(), NmountError>; + +/// Mount a FreeBSD file system. +/// +/// The `nmount(2)` system call works similarly to the `mount(8)` program; it +/// takes its options as a series of name-value pairs. Most of the values are +/// strings, as are all of the names. The `Nmount` structure builds up an +/// argument list and then executes the syscall. +/// +/// # Examples +/// +/// To mount `target` onto `mountpoint` with `nullfs`: +/// ``` +/// # use nix::unistd::Uid; +/// # use ::sysctl::CtlValue; +/// # if !Uid::current().is_root() && CtlValue::Int(0) == ::sysctl::value("vfs.usermount").unwrap() { +/// # return; +/// # }; +/// use nix::mount::{MntFlags, Nmount, unmount}; +/// use std::ffi::CString; +/// use tempfile::tempdir; +/// +/// let mountpoint = tempdir().unwrap(); +/// let target = tempdir().unwrap(); +/// +/// let fstype = CString::new("fstype").unwrap(); +/// let nullfs = CString::new("nullfs").unwrap(); +/// Nmount::new() +/// .str_opt(&fstype, &nullfs) +/// .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) +/// .str_opt_owned("target", target.path().to_str().unwrap()) +/// .nmount(MntFlags::empty()).unwrap(); +/// +/// unmount(mountpoint.path(), MntFlags::empty()).unwrap(); +/// ``` +/// +/// # See Also +/// * [`nmount(2)`](https://www.freebsd.org/cgi/man.cgi?query=nmount) +/// * [`nullfs(5)`](https://www.freebsd.org/cgi/man.cgi?query=nullfs) +#[cfg(target_os = "freebsd")] +#[derive(Debug, Default)] +pub struct Nmount<'a>{ + iov: Vec>, + is_owned: Vec, +} + +#[cfg(target_os = "freebsd")] +impl<'a> Nmount<'a> { + /// Add an opaque mount option. + /// + /// Some file systems take binary-valued mount options. They can be set + /// with this method. + /// + /// # Safety + /// + /// Unsafe because it will cause `Nmount::nmount` to dereference a raw + /// pointer. The user is responsible for ensuring that `val` is valid and + /// its lifetime outlives `self`! An easy way to do that is to give the + /// value a larger scope than `name` + /// + /// # Examples + /// ``` + /// use libc::c_void; + /// use nix::mount::Nmount; + /// use std::ffi::CString; + /// use std::mem; + /// + /// // Note that flags outlives name + /// let mut flags: u32 = 0xdeadbeef; + /// let name = CString::new("flags").unwrap(); + /// let p = &mut flags as *mut u32 as *mut c_void; + /// let len = mem::size_of_val(&flags); + /// let mut nmount = Nmount::new(); + /// unsafe { nmount.mut_ptr_opt(&name, p, len) }; + /// ``` + pub unsafe fn mut_ptr_opt( + &mut self, + name: &'a CStr, + val: *mut c_void, + len: usize + ) -> &mut Self + { + self.iov.push(IoVec::from_slice(name.to_bytes_with_nul())); + self.is_owned.push(false); + self.iov.push(IoVec::from_raw_parts(val, len)); + self.is_owned.push(false); + self + } + + /// Add a mount option that does not take a value. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// use std::ffi::CString; + /// + /// let read_only = CString::new("ro").unwrap(); + /// Nmount::new() + /// .null_opt(&read_only); + /// ``` + pub fn null_opt(&mut self, name: &'a CStr) -> &mut Self { + self.iov.push(IoVec::from_slice(name.to_bytes_with_nul())); + self.is_owned.push(false); + self.iov.push(IoVec::from_raw_parts(ptr::null_mut(), 0)); + self.is_owned.push(false); + self + } + + /// Add a mount option that does not take a value, but whose name must be + /// owned. + /// + /// + /// This has higher runtime cost than [`Nmount::null_opt`], but is useful + /// when the name's lifetime doesn't outlive the `Nmount`, or it's a + /// different string type than `CStr`. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// + /// let read_only = "ro"; + /// let mut nmount: Nmount<'static> = Nmount::new(); + /// nmount.null_opt_owned(read_only); + /// ``` + pub fn null_opt_owned(&mut self, name: &P) -> &mut Self + { + name.with_nix_path(|s| { + let len = s.to_bytes_with_nul().len(); + self.iov.push(IoVec::from_raw_parts( + // Must free it later + s.to_owned().into_raw() as *mut c_void, + len + )); + self.is_owned.push(true); + }).unwrap(); + self.iov.push(IoVec::from_raw_parts(ptr::null_mut(), 0)); + self.is_owned.push(false); + self + } + + /// Add a mount option as a [`CStr`]. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// use std::ffi::CString; + /// + /// let fstype = CString::new("fstype").unwrap(); + /// let nullfs = CString::new("nullfs").unwrap(); + /// Nmount::new() + /// .str_opt(&fstype, &nullfs); + /// ``` + pub fn str_opt( + &mut self, + name: &'a CStr, + val: &'a CStr + ) -> &mut Self + { + self.iov.push(IoVec::from_slice(name.to_bytes_with_nul())); + self.is_owned.push(false); + self.iov.push(IoVec::from_slice(val.to_bytes_with_nul())); + self.is_owned.push(false); + self + } + + /// Add a mount option as an owned string. + /// + /// This has higher runtime cost than [`Nmount::str_opt`], but is useful + /// when the value's lifetime doesn't outlive the `Nmount`, or it's a + /// different string type than `CStr`. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// use std::path::Path; + /// + /// let mountpoint = Path::new("/mnt"); + /// Nmount::new() + /// .str_opt_owned("fspath", mountpoint.to_str().unwrap()); + /// ``` + pub fn str_opt_owned(&mut self, name: &P1, val: &P2) -> &mut Self + where P1: ?Sized + NixPath, + P2: ?Sized + NixPath + { + name.with_nix_path(|s| { + let len = s.to_bytes_with_nul().len(); + self.iov.push(IoVec::from_raw_parts( + // Must free it later + s.to_owned().into_raw() as *mut c_void, + len + )); + self.is_owned.push(true); + }).unwrap(); + val.with_nix_path(|s| { + let len = s.to_bytes_with_nul().len(); + self.iov.push(IoVec::from_raw_parts( + // Must free it later + s.to_owned().into_raw() as *mut c_void, + len + )); + self.is_owned.push(true); + }).unwrap(); + self + } + + /// Create a new `Nmount` struct with no options + pub fn new() -> Self { + Self::default() + } + + /// Actually mount the file system. + pub fn nmount(&mut self, flags: MntFlags) -> NmountResult { + // nmount can return extra error information via a "errmsg" return + // argument. + const ERRMSG_NAME: &[u8] = b"errmsg\0"; + let mut errmsg = vec![0u8; 255]; + self.iov.push(IoVec::from_raw_parts( + ERRMSG_NAME.as_ptr() as *mut c_void, + ERRMSG_NAME.len() + )); + self.iov.push(IoVec::from_raw_parts( + errmsg.as_mut_ptr() as *mut c_void, + errmsg.len() + )); + + let niov = self.iov.len() as c_uint; + let iovp = self.iov.as_mut_ptr() as *mut libc::iovec; + let res = unsafe { + libc::nmount(iovp, niov, flags.bits) + }; + match Errno::result(res) { + Ok(_) => Ok(()), + Err(error) => { + let errmsg = match errmsg.iter().position(|&x| x == 0) { + None => None, + Some(0) => None, + Some(n) => { + let sl = &errmsg[0..n + 1]; + Some(CStr::from_bytes_with_nul(sl).unwrap()) + } + }; + Err(NmountError::new(error, errmsg)) + } + } + } +} + +#[cfg(target_os = "freebsd")] +impl<'a> Drop for Nmount<'a> { + fn drop(&mut self) { + for (iov, is_owned) in self.iov.iter().zip(self.is_owned.iter()) { + if *is_owned { + // Free the owned string. Safe because we recorded ownership, + // and Nmount does not implement Clone. + unsafe { + drop(CString::from_raw(iov.0.iov_base as *mut c_char)); + } + } + } + } +} + +/// Unmount the file system mounted at `mountpoint`. +/// +/// Useful flags include +/// * `MNT_FORCE` - Unmount even if still in use. +/// * `MNT_BYFSID` - `mountpoint` is not a path, but a file system ID +/// encoded as `FSID:val0:val1`, where `val0` and `val1` +/// are the contents of the `fsid_t val[]` array in decimal. +/// The file system that has the specified file system ID +/// will be unmounted. See +/// [`statfs`](crate::sys::statfs::statfs) to determine the +/// `fsid`. +pub fn unmount

(mountpoint: &P, flags: MntFlags) -> Result<()> + where P: ?Sized + NixPath +{ + let res = mountpoint.with_nix_path(|cstr| { + unsafe { libc::unmount(cstr.as_ptr(), flags.bits) } + })?; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/mount/linux.rs b/bash-5.1/vendor/nix-0.23.1/src/mount/linux.rs new file mode 100644 index 0000000000000000000000000000000000000000..4cb2fa549070cec18ebc732e81b2eac15141c963 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/mount/linux.rs @@ -0,0 +1,111 @@ +#![allow(missing_docs)] +use libc::{self, c_ulong, c_int}; +use crate::{Result, NixPath}; +use crate::errno::Errno; + +libc_bitflags!( + pub struct MsFlags: c_ulong { + /// Mount read-only + MS_RDONLY; + /// Ignore suid and sgid bits + MS_NOSUID; + /// Disallow access to device special files + MS_NODEV; + /// Disallow program execution + MS_NOEXEC; + /// Writes are synced at once + MS_SYNCHRONOUS; + /// Alter flags of a mounted FS + MS_REMOUNT; + /// Allow mandatory locks on a FS + MS_MANDLOCK; + /// Directory modifications are synchronous + MS_DIRSYNC; + /// Do not update access times + MS_NOATIME; + /// Do not update directory access times + MS_NODIRATIME; + /// Linux 2.4.0 - Bind directory at different place + MS_BIND; + MS_MOVE; + MS_REC; + MS_SILENT; + MS_POSIXACL; + MS_UNBINDABLE; + MS_PRIVATE; + MS_SLAVE; + MS_SHARED; + MS_RELATIME; + MS_KERNMOUNT; + MS_I_VERSION; + MS_STRICTATIME; + MS_LAZYTIME; + MS_ACTIVE; + MS_NOUSER; + MS_RMT_MASK; + MS_MGC_VAL; + MS_MGC_MSK; + } +); + +libc_bitflags!( + pub struct MntFlags: c_int { + MNT_FORCE; + MNT_DETACH; + MNT_EXPIRE; + } +); + +pub fn mount( + source: Option<&P1>, + target: &P2, + fstype: Option<&P3>, + flags: MsFlags, + data: Option<&P4>) -> Result<()> { + + fn with_opt_nix_path(p: Option<&P>, f: F) -> Result + where P: ?Sized + NixPath, + F: FnOnce(*const libc::c_char) -> T + { + match p { + Some(path) => path.with_nix_path(|p_str| f(p_str.as_ptr())), + None => Ok(f(std::ptr::null())) + } + } + + let res = with_opt_nix_path(source, |s| { + target.with_nix_path(|t| { + with_opt_nix_path(fstype, |ty| { + with_opt_nix_path(data, |d| { + unsafe { + libc::mount( + s, + t.as_ptr(), + ty, + flags.bits, + d as *const libc::c_void + ) + } + }) + }) + }) + })????; + + Errno::result(res).map(drop) +} + +pub fn umount(target: &P) -> Result<()> { + let res = target.with_nix_path(|cstr| { + unsafe { libc::umount(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) +} + +pub fn umount2(target: &P, flags: MntFlags) -> Result<()> { + let res = target.with_nix_path(|cstr| { + unsafe { libc::umount2(cstr.as_ptr(), flags.bits) } + })?; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/mount/mod.rs b/bash-5.1/vendor/nix-0.23.1/src/mount/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..14bf2a963607f36f250ecd2b1b07d5b82fbf662a --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/mount/mod.rs @@ -0,0 +1,21 @@ +//! Mount file systems +#[cfg(any(target_os = "android", target_os = "linux"))] +mod linux; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::linux::*; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +mod bsd; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd" + ))] +pub use self::bsd::*; diff --git a/bash-5.1/vendor/nix-0.23.1/src/mqueue.rs b/bash-5.1/vendor/nix-0.23.1/src/mqueue.rs new file mode 100644 index 0000000000000000000000000000000000000000..34fd80278589db835fb456d3dabfcbd372681a17 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/mqueue.rs @@ -0,0 +1,178 @@ +//! Posix Message Queue functions +//! +//! [Further reading and details on the C API](https://man7.org/linux/man-pages/man7/mq_overview.7.html) + +use crate::Result; +use crate::errno::Errno; + +use libc::{self, c_char, mqd_t, size_t}; +use std::ffi::CString; +use crate::sys::stat::Mode; +use std::mem; + +libc_bitflags!{ + pub struct MQ_OFlag: libc::c_int { + O_RDONLY; + O_WRONLY; + O_RDWR; + O_CREAT; + O_EXCL; + O_NONBLOCK; + O_CLOEXEC; + } +} + +libc_bitflags!{ + pub struct FdFlag: libc::c_int { + FD_CLOEXEC; + } +} + +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct MqAttr { + mq_attr: libc::mq_attr, +} + +// x32 compatibility +// See https://sourceware.org/bugzilla/show_bug.cgi?id=21279 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +pub type mq_attr_member_t = i64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +pub type mq_attr_member_t = libc::c_long; + +impl MqAttr { + pub fn new(mq_flags: mq_attr_member_t, + mq_maxmsg: mq_attr_member_t, + mq_msgsize: mq_attr_member_t, + mq_curmsgs: mq_attr_member_t) + -> MqAttr + { + let mut attr = mem::MaybeUninit::::uninit(); + unsafe { + let p = attr.as_mut_ptr(); + (*p).mq_flags = mq_flags; + (*p).mq_maxmsg = mq_maxmsg; + (*p).mq_msgsize = mq_msgsize; + (*p).mq_curmsgs = mq_curmsgs; + MqAttr { mq_attr: attr.assume_init() } + } + } + + pub const fn flags(&self) -> mq_attr_member_t { + self.mq_attr.mq_flags + } +} + + +/// Open a message queue +/// +/// See also [`mq_open(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_open.html) +// The mode.bits cast is only lossless on some OSes +#[allow(clippy::cast_lossless)] +pub fn mq_open(name: &CString, + oflag: MQ_OFlag, + mode: Mode, + attr: Option<&MqAttr>) + -> Result { + let res = match attr { + Some(mq_attr) => unsafe { + libc::mq_open(name.as_ptr(), + oflag.bits(), + mode.bits() as libc::c_int, + &mq_attr.mq_attr as *const libc::mq_attr) + }, + None => unsafe { libc::mq_open(name.as_ptr(), oflag.bits()) }, + }; + Errno::result(res) +} + +/// Remove a message queue +/// +/// See also [`mq_unlink(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_unlink.html) +pub fn mq_unlink(name: &CString) -> Result<()> { + let res = unsafe { libc::mq_unlink(name.as_ptr()) }; + Errno::result(res).map(drop) +} + +/// Close a message queue +/// +/// See also [`mq_close(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_close.html) +pub fn mq_close(mqdes: mqd_t) -> Result<()> { + let res = unsafe { libc::mq_close(mqdes) }; + Errno::result(res).map(drop) +} + +/// Receive a message from a message queue +/// +/// See also [`mq_receive(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_receive.html) +pub fn mq_receive(mqdes: mqd_t, message: &mut [u8], msg_prio: &mut u32) -> Result { + let len = message.len() as size_t; + let res = unsafe { + libc::mq_receive(mqdes, + message.as_mut_ptr() as *mut c_char, + len, + msg_prio as *mut u32) + }; + Errno::result(res).map(|r| r as usize) +} + +/// Send a message to a message queue +/// +/// See also [`mq_send(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_send.html) +pub fn mq_send(mqdes: mqd_t, message: &[u8], msq_prio: u32) -> Result<()> { + let res = unsafe { + libc::mq_send(mqdes, + message.as_ptr() as *const c_char, + message.len(), + msq_prio) + }; + Errno::result(res).map(drop) +} + +/// Get message queue attributes +/// +/// See also [`mq_getattr(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_getattr.html) +pub fn mq_getattr(mqd: mqd_t) -> Result { + let mut attr = mem::MaybeUninit::::uninit(); + let res = unsafe { libc::mq_getattr(mqd, attr.as_mut_ptr()) }; + Errno::result(res).map(|_| unsafe{MqAttr { mq_attr: attr.assume_init() }}) +} + +/// Set the attributes of the message queue. Only `O_NONBLOCK` can be set, everything else will be ignored +/// Returns the old attributes +/// It is recommend to use the `mq_set_nonblock()` and `mq_remove_nonblock()` convenience functions as they are easier to use +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_setattr.html) +pub fn mq_setattr(mqd: mqd_t, newattr: &MqAttr) -> Result { + let mut attr = mem::MaybeUninit::::uninit(); + let res = unsafe { + libc::mq_setattr(mqd, &newattr.mq_attr as *const libc::mq_attr, attr.as_mut_ptr()) + }; + Errno::result(res).map(|_| unsafe{ MqAttr { mq_attr: attr.assume_init() }}) +} + +/// Convenience function. +/// Sets the `O_NONBLOCK` attribute for a given message queue descriptor +/// Returns the old attributes +#[allow(clippy::useless_conversion)] // Not useless on all OSes +pub fn mq_set_nonblock(mqd: mqd_t) -> Result { + let oldattr = mq_getattr(mqd)?; + let newattr = MqAttr::new(mq_attr_member_t::from(MQ_OFlag::O_NONBLOCK.bits()), + oldattr.mq_attr.mq_maxmsg, + oldattr.mq_attr.mq_msgsize, + oldattr.mq_attr.mq_curmsgs); + mq_setattr(mqd, &newattr) +} + +/// Convenience function. +/// Removes `O_NONBLOCK` attribute for a given message queue descriptor +/// Returns the old attributes +pub fn mq_remove_nonblock(mqd: mqd_t) -> Result { + let oldattr = mq_getattr(mqd)?; + let newattr = MqAttr::new(0, + oldattr.mq_attr.mq_maxmsg, + oldattr.mq_attr.mq_msgsize, + oldattr.mq_attr.mq_curmsgs); + mq_setattr(mqd, &newattr) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/net/if_.rs b/bash-5.1/vendor/nix-0.23.1/src/net/if_.rs new file mode 100644 index 0000000000000000000000000000000000000000..bc00a4328b4ebadf258ca4e2c7fa442334221915 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/net/if_.rs @@ -0,0 +1,411 @@ +//! Network interface name resolution. +//! +//! Uses Linux and/or POSIX functions to resolve interface names like "eth0" +//! or "socan1" into device numbers. + +use crate::{Error, NixPath, Result}; +use libc::c_uint; + +/// Resolve an interface into a interface number. +pub fn if_nametoindex(name: &P) -> Result { + let if_index = name.with_nix_path(|name| unsafe { libc::if_nametoindex(name.as_ptr()) })?; + + if if_index == 0 { + Err(Error::last()) + } else { + Ok(if_index) + } +} + +libc_bitflags!( + /// Standard interface flags, used by `getifaddrs` + pub struct InterfaceFlags: libc::c_int { + /// Interface is running. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_UP; + /// Valid broadcast address set. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_BROADCAST; + /// Internal debugging flag. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_DEBUG; + /// Interface is a loopback interface. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_LOOPBACK; + /// Interface is a point-to-point link. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_POINTOPOINT; + /// Avoid use of trailers. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "solaris"))] + IFF_NOTRAILERS; + /// Interface manages own routes. + #[cfg(any(target_os = "dragonfly"))] + IFF_SMART; + /// Resources allocated. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "illumos", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + IFF_RUNNING; + /// No arp protocol, L2 destination address not set. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_NOARP; + /// Interface is in promiscuous mode. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_PROMISC; + /// Receive all multicast packets. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_ALLMULTI; + /// Master of a load balancing bundle. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + IFF_MASTER; + /// transmission in progress, tx hardware queue is full + #[cfg(any(target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + IFF_OACTIVE; + /// Protocol code on board. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_INTELLIGENT; + /// Slave of a load balancing bundle. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + IFF_SLAVE; + /// Can't hear own transmissions. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "osx"))] + IFF_SIMPLEX; + /// Supports multicast. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_MULTICAST; + /// Per link layer defined bit. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + IFF_LINK0; + /// Multicast using broadcast. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_MULTI_BCAST; + /// Is able to select media type via ifmap. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + IFF_PORTSEL; + /// Per link layer defined bit. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + IFF_LINK1; + /// Non-unique address. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_UNNUMBERED; + /// Auto media selection active. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + IFF_AUTOMEDIA; + /// Per link layer defined bit. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + IFF_LINK2; + /// Use alternate physical connection. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios"))] + IFF_ALTPHYS; + /// DHCP controls interface. + #[cfg(any(target_os = "solaris", target_os = "illumos"))] + IFF_DHCPRUNNING; + /// The addresses are lost when the interface goes down. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + IFF_DYNAMIC; + /// Do not advertise. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_PRIVATE; + /// Driver signals L1 up. Volatile. + #[cfg(any(target_os = "fuchsia", target_os = "linux"))] + IFF_LOWER_UP; + /// Interface is in polling mode. + #[cfg(any(target_os = "dragonfly"))] + IFF_POLLING_COMPAT; + /// Unconfigurable using ioctl(2). + #[cfg(any(target_os = "freebsd"))] + IFF_CANTCONFIG; + /// Do not transmit packets. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_NOXMIT; + /// Driver signals dormant. Volatile. + #[cfg(any(target_os = "fuchsia", target_os = "linux"))] + IFF_DORMANT; + /// User-requested promisc mode. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + IFF_PPROMISC; + /// Just on-link subnet. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_NOLOCAL; + /// Echo sent packets. Volatile. + #[cfg(any(target_os = "fuchsia", target_os = "linux"))] + IFF_ECHO; + /// User-requested monitor mode. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + IFF_MONITOR; + /// Address is deprecated. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_DEPRECATED; + /// Static ARP. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + IFF_STATICARP; + /// Address from stateless addrconf. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_ADDRCONF; + /// Interface is in polling mode. + #[cfg(any(target_os = "dragonfly"))] + IFF_NPOLLING; + /// Router on interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_ROUTER; + /// Interface is in polling mode. + #[cfg(any(target_os = "dragonfly"))] + IFF_IDIRECT; + /// Interface is winding down + #[cfg(any(target_os = "freebsd"))] + IFF_DYING; + /// No NUD on interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_NONUD; + /// Interface is being renamed + #[cfg(any(target_os = "freebsd"))] + IFF_RENAMING; + /// Anycast address. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_ANYCAST; + /// Don't exchange routing info. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_NORTEXCH; + /// Do not provide packet information + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + IFF_NO_PI as libc::c_int; + /// TUN device (no Ethernet headers) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + IFF_TUN as libc::c_int; + /// TAP device + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + IFF_TAP as libc::c_int; + /// IPv4 interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_IPV4; + /// IPv6 interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_IPV6; + /// in.mpathd test address + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_NOFAILOVER; + /// Interface has failed + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_FAILED; + /// Interface is a hot-spare + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_STANDBY; + /// Functioning but not used + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_INACTIVE; + /// Interface is offline + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + IFF_OFFLINE; + #[cfg(target_os = "solaris")] + IFF_COS_ENABLED; + /// Prefer as source addr. + #[cfg(target_os = "solaris")] + IFF_PREFERRED; + /// RFC3041 + #[cfg(target_os = "solaris")] + IFF_TEMPORARY; + /// MTU set with SIOCSLIFMTU + #[cfg(target_os = "solaris")] + IFF_FIXEDMTU; + /// Cannot send / receive packets + #[cfg(target_os = "solaris")] + IFF_VIRTUAL; + /// Local address in use + #[cfg(target_os = "solaris")] + IFF_DUPLICATE; + /// IPMP IP interface + #[cfg(target_os = "solaris")] + IFF_IPMP; + } +); + +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +mod if_nameindex { + use super::*; + + use std::ffi::CStr; + use std::fmt; + use std::marker::PhantomData; + use std::ptr::NonNull; + + /// A network interface. Has a name like "eth0" or "wlp4s0" or "wlan0", as well as an index + /// (1, 2, 3, etc) that identifies it in the OS's networking stack. + #[allow(missing_copy_implementations)] + #[repr(transparent)] + pub struct Interface(libc::if_nameindex); + + impl Interface { + /// Obtain the index of this interface. + pub fn index(&self) -> c_uint { + self.0.if_index + } + + /// Obtain the name of this interface. + pub fn name(&self) -> &CStr { + unsafe { CStr::from_ptr(self.0.if_name) } + } + } + + impl fmt::Debug for Interface { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Interface") + .field("index", &self.index()) + .field("name", &self.name()) + .finish() + } + } + + /// A list of the network interfaces available on this system. Obtained from [`if_nameindex()`]. + pub struct Interfaces { + ptr: NonNull, + } + + impl Interfaces { + /// Iterate over the interfaces in this list. + #[inline] + pub fn iter(&self) -> InterfacesIter<'_> { + self.into_iter() + } + + /// Convert this to a slice of interfaces. Note that the underlying interfaces list is + /// null-terminated, so calling this calculates the length. If random access isn't needed, + /// [`Interfaces::iter()`] should be used instead. + pub fn to_slice(&self) -> &[Interface] { + let ifs = self.ptr.as_ptr() as *const Interface; + let len = self.iter().count(); + unsafe { std::slice::from_raw_parts(ifs, len) } + } + } + + impl Drop for Interfaces { + fn drop(&mut self) { + unsafe { libc::if_freenameindex(self.ptr.as_ptr()) }; + } + } + + impl fmt::Debug for Interfaces { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.to_slice().fmt(f) + } + } + + impl<'a> IntoIterator for &'a Interfaces { + type IntoIter = InterfacesIter<'a>; + type Item = &'a Interface; + #[inline] + fn into_iter(self) -> Self::IntoIter { + InterfacesIter { + ptr: self.ptr.as_ptr(), + _marker: PhantomData, + } + } + } + + /// An iterator over the interfaces in an [`Interfaces`]. + #[derive(Debug)] + pub struct InterfacesIter<'a> { + ptr: *const libc::if_nameindex, + _marker: PhantomData<&'a Interfaces>, + } + + impl<'a> Iterator for InterfacesIter<'a> { + type Item = &'a Interface; + #[inline] + fn next(&mut self) -> Option { + unsafe { + if (*self.ptr).if_index == 0 { + None + } else { + let ret = &*(self.ptr as *const Interface); + self.ptr = self.ptr.add(1); + Some(ret) + } + } + } + } + + /// Retrieve a list of the network interfaces available on the local system. + /// + /// ``` + /// let interfaces = nix::net::if_::if_nameindex().unwrap(); + /// for iface in &interfaces { + /// println!("Interface #{} is called {}", iface.index(), iface.name().to_string_lossy()); + /// } + /// ``` + pub fn if_nameindex() -> Result { + unsafe { + let ifs = libc::if_nameindex(); + let ptr = NonNull::new(ifs).ok_or_else(Error::last)?; + Ok(Interfaces { ptr }) + } + } +} +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +pub use if_nameindex::*; diff --git a/bash-5.1/vendor/nix-0.23.1/src/net/mod.rs b/bash-5.1/vendor/nix-0.23.1/src/net/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..079fcfde6fd4436e3b595295ff9e4c18f20b002c --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/net/mod.rs @@ -0,0 +1,4 @@ +//! Functionality involving network interfaces +// To avoid clashing with the keyword "if", we use "if_" as the module name. +// The original header is called "net/if.h". +pub mod if_; diff --git a/bash-5.1/vendor/nix-0.23.1/src/poll.rs b/bash-5.1/vendor/nix-0.23.1/src/poll.rs new file mode 100644 index 0000000000000000000000000000000000000000..8556c1bb748df5737e8e67e74135a67cd9dc0a5d --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/poll.rs @@ -0,0 +1,163 @@ +//! Wait for events to trigger on specific file descriptors +#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux"))] +use crate::sys::time::TimeSpec; +#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux"))] +use crate::sys::signal::SigSet; +use std::os::unix::io::{AsRawFd, RawFd}; + +use crate::Result; +use crate::errno::Errno; + +/// This is a wrapper around `libc::pollfd`. +/// +/// It's meant to be used as an argument to the [`poll`](fn.poll.html) and +/// [`ppoll`](fn.ppoll.html) functions to specify the events of interest +/// for a specific file descriptor. +/// +/// After a call to `poll` or `ppoll`, the events that occured can be +/// retrieved by calling [`revents()`](#method.revents) on the `PollFd`. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct PollFd { + pollfd: libc::pollfd, +} + +impl PollFd { + /// Creates a new `PollFd` specifying the events of interest + /// for a given file descriptor. + pub const fn new(fd: RawFd, events: PollFlags) -> PollFd { + PollFd { + pollfd: libc::pollfd { + fd, + events: events.bits(), + revents: PollFlags::empty().bits(), + }, + } + } + + /// Returns the events that occured in the last call to `poll` or `ppoll`. Will only return + /// `None` if the kernel provides status flags that Nix does not know about. + pub fn revents(self) -> Option { + PollFlags::from_bits(self.pollfd.revents) + } + + /// The events of interest for this `PollFd`. + pub fn events(self) -> PollFlags { + PollFlags::from_bits(self.pollfd.events).unwrap() + } + + /// Modify the events of interest for this `PollFd`. + pub fn set_events(&mut self, events: PollFlags) { + self.pollfd.events = events.bits(); + } +} + +impl AsRawFd for PollFd { + fn as_raw_fd(&self) -> RawFd { + self.pollfd.fd + } +} + +libc_bitflags! { + /// These flags define the different events that can be monitored by `poll` and `ppoll` + pub struct PollFlags: libc::c_short { + /// There is data to read. + POLLIN; + /// There is some exceptional condition on the file descriptor. + /// + /// Possibilities include: + /// + /// * There is out-of-band data on a TCP socket (see + /// [tcp(7)](https://man7.org/linux/man-pages/man7/tcp.7.html)). + /// * A pseudoterminal master in packet mode has seen a state + /// change on the slave (see + /// [ioctl_tty(2)](https://man7.org/linux/man-pages/man2/ioctl_tty.2.html)). + /// * A cgroup.events file has been modified (see + /// [cgroups(7)](https://man7.org/linux/man-pages/man7/cgroups.7.html)). + POLLPRI; + /// Writing is now possible, though a write larger that the + /// available space in a socket or pipe will still block (unless + /// `O_NONBLOCK` is set). + POLLOUT; + /// Equivalent to [`POLLIN`](constant.POLLIN.html) + #[cfg(not(target_os = "redox"))] + POLLRDNORM; + #[cfg(not(target_os = "redox"))] + /// Equivalent to [`POLLOUT`](constant.POLLOUT.html) + POLLWRNORM; + /// Priority band data can be read (generally unused on Linux). + #[cfg(not(target_os = "redox"))] + POLLRDBAND; + /// Priority data may be written. + #[cfg(not(target_os = "redox"))] + POLLWRBAND; + /// Error condition (only returned in + /// [`PollFd::revents`](struct.PollFd.html#method.revents); + /// ignored in [`PollFd::new`](struct.PollFd.html#method.new)). + /// This bit is also set for a file descriptor referring to the + /// write end of a pipe when the read end has been closed. + POLLERR; + /// Hang up (only returned in [`PollFd::revents`](struct.PollFd.html#method.revents); + /// ignored in [`PollFd::new`](struct.PollFd.html#method.new)). + /// Note that when reading from a channel such as a pipe or a stream + /// socket, this event merely indicates that the peer closed its + /// end of the channel. Subsequent reads from the channel will + /// return 0 (end of file) only after all outstanding data in the + /// channel has been consumed. + POLLHUP; + /// Invalid request: `fd` not open (only returned in + /// [`PollFd::revents`](struct.PollFd.html#method.revents); + /// ignored in [`PollFd::new`](struct.PollFd.html#method.new)). + POLLNVAL; + } +} + +/// `poll` waits for one of a set of file descriptors to become ready to perform I/O. +/// ([`poll(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html)) +/// +/// `fds` contains all [`PollFd`](struct.PollFd.html) to poll. +/// The function will return as soon as any event occur for any of these `PollFd`s. +/// +/// The `timeout` argument specifies the number of milliseconds that `poll()` +/// should block waiting for a file descriptor to become ready. The call +/// will block until either: +/// +/// * a file descriptor becomes ready; +/// * the call is interrupted by a signal handler; or +/// * the timeout expires. +/// +/// Note that the timeout interval will be rounded up to the system clock +/// granularity, and kernel scheduling delays mean that the blocking +/// interval may overrun by a small amount. Specifying a negative value +/// in timeout means an infinite timeout. Specifying a timeout of zero +/// causes `poll()` to return immediately, even if no file descriptors are +/// ready. +pub fn poll(fds: &mut [PollFd], timeout: libc::c_int) -> Result { + let res = unsafe { + libc::poll(fds.as_mut_ptr() as *mut libc::pollfd, + fds.len() as libc::nfds_t, + timeout) + }; + + Errno::result(res) +} + +/// `ppoll()` allows an application to safely wait until either a file +/// descriptor becomes ready or until a signal is caught. +/// ([`poll(2)`](https://man7.org/linux/man-pages/man2/poll.2.html)) +/// +/// `ppoll` behaves like `poll`, but let you specify what signals may interrupt it +/// with the `sigmask` argument. If you want `ppoll` to block indefinitely, +/// specify `None` as `timeout` (it is like `timeout = -1` for `poll`). +/// +#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux"))] +pub fn ppoll(fds: &mut [PollFd], timeout: Option, sigmask: SigSet) -> Result { + let timeout = timeout.as_ref().map_or(core::ptr::null(), |r| r.as_ref()); + let res = unsafe { + libc::ppoll(fds.as_mut_ptr() as *mut libc::pollfd, + fds.len() as libc::nfds_t, + timeout, + sigmask.as_ref()) + }; + Errno::result(res) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/pty.rs b/bash-5.1/vendor/nix-0.23.1/src/pty.rs new file mode 100644 index 0000000000000000000000000000000000000000..facc9aaf4006e7baf304ca51fe3868a7b94b7723 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/pty.rs @@ -0,0 +1,348 @@ +//! Create master and slave virtual pseudo-terminals (PTYs) + +pub use libc::pid_t as SessionId; +pub use libc::winsize as Winsize; + +use std::ffi::CStr; +use std::io; +use std::mem; +use std::os::unix::prelude::*; + +use crate::sys::termios::Termios; +use crate::unistd::{self, ForkResult, Pid}; +use crate::{Result, fcntl}; +use crate::errno::Errno; + +/// Representation of a master/slave pty pair +/// +/// This is returned by `openpty`. Note that this type does *not* implement `Drop`, so the user +/// must manually close the file descriptors. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct OpenptyResult { + /// The master port in a virtual pty pair + pub master: RawFd, + /// The slave port in a virtual pty pair + pub slave: RawFd, +} + +/// Representation of a master with a forked pty +/// +/// This is returned by `forkpty`. Note that this type does *not* implement `Drop`, so the user +/// must manually close the file descriptors. +#[derive(Clone, Copy, Debug)] +pub struct ForkptyResult { + /// The master port in a virtual pty pair + pub master: RawFd, + /// Metadata about forked process + pub fork_result: ForkResult, +} + + +/// Representation of the Master device in a master/slave pty pair +/// +/// While this datatype is a thin wrapper around `RawFd`, it enforces that the available PTY +/// functions are given the correct file descriptor. Additionally this type implements `Drop`, +/// so that when it's consumed or goes out of scope, it's automatically cleaned-up. +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct PtyMaster(RawFd); + +impl AsRawFd for PtyMaster { + fn as_raw_fd(&self) -> RawFd { + self.0 + } +} + +impl IntoRawFd for PtyMaster { + fn into_raw_fd(self) -> RawFd { + let fd = self.0; + mem::forget(self); + fd + } +} + +impl Drop for PtyMaster { + fn drop(&mut self) { + // On drop, we ignore errors like EINTR and EIO because there's no clear + // way to handle them, we can't return anything, and (on FreeBSD at + // least) the file descriptor is deallocated in these cases. However, + // we must panic on EBADF, because it is always an error to close an + // invalid file descriptor. That frequently indicates a double-close + // condition, which can cause confusing errors for future I/O + // operations. + let e = unistd::close(self.0); + if e == Err(Errno::EBADF) { + panic!("Closing an invalid file descriptor!"); + }; + } +} + +impl io::Read for PtyMaster { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + unistd::read(self.0, buf).map_err(io::Error::from) + } +} + +impl io::Write for PtyMaster { + fn write(&mut self, buf: &[u8]) -> io::Result { + unistd::write(self.0, buf).map_err(io::Error::from) + } + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } +} + +/// Grant access to a slave pseudoterminal (see +/// [`grantpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/grantpt.html)) +/// +/// `grantpt()` changes the mode and owner of the slave pseudoterminal device corresponding to the +/// master pseudoterminal referred to by `fd`. This is a necessary step towards opening the slave. +#[inline] +pub fn grantpt(fd: &PtyMaster) -> Result<()> { + if unsafe { libc::grantpt(fd.as_raw_fd()) } < 0 { + return Err(Errno::last()); + } + + Ok(()) +} + +/// Open a pseudoterminal device (see +/// [`posix_openpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_openpt.html)) +/// +/// `posix_openpt()` returns a file descriptor to an existing unused pseuterminal master device. +/// +/// # Examples +/// +/// A common use case with this function is to open both a master and slave PTY pair. This can be +/// done as follows: +/// +/// ``` +/// use std::path::Path; +/// use nix::fcntl::{OFlag, open}; +/// use nix::pty::{grantpt, posix_openpt, ptsname, unlockpt}; +/// use nix::sys::stat::Mode; +/// +/// # #[allow(dead_code)] +/// # fn run() -> nix::Result<()> { +/// // Open a new PTY master +/// let master_fd = posix_openpt(OFlag::O_RDWR)?; +/// +/// // Allow a slave to be generated for it +/// grantpt(&master_fd)?; +/// unlockpt(&master_fd)?; +/// +/// // Get the name of the slave +/// let slave_name = unsafe { ptsname(&master_fd) }?; +/// +/// // Try to open the slave +/// let _slave_fd = open(Path::new(&slave_name), OFlag::O_RDWR, Mode::empty())?; +/// # Ok(()) +/// # } +/// ``` +#[inline] +pub fn posix_openpt(flags: fcntl::OFlag) -> Result { + let fd = unsafe { + libc::posix_openpt(flags.bits()) + }; + + if fd < 0 { + return Err(Errno::last()); + } + + Ok(PtyMaster(fd)) +} + +/// Get the name of the slave pseudoterminal (see +/// [`ptsname(3)`](https://man7.org/linux/man-pages/man3/ptsname.3.html)) +/// +/// `ptsname()` returns the name of the slave pseudoterminal device corresponding to the master +/// referred to by `fd`. +/// +/// This value is useful for opening the slave pty once the master has already been opened with +/// `posix_openpt()`. +/// +/// # Safety +/// +/// `ptsname()` mutates global variables and is *not* threadsafe. +/// Mutating global variables is always considered `unsafe` by Rust and this +/// function is marked as `unsafe` to reflect that. +/// +/// For a threadsafe and non-`unsafe` alternative on Linux, see `ptsname_r()`. +#[inline] +pub unsafe fn ptsname(fd: &PtyMaster) -> Result { + let name_ptr = libc::ptsname(fd.as_raw_fd()); + if name_ptr.is_null() { + return Err(Errno::last()); + } + + let name = CStr::from_ptr(name_ptr); + Ok(name.to_string_lossy().into_owned()) +} + +/// Get the name of the slave pseudoterminal (see +/// [`ptsname(3)`](https://man7.org/linux/man-pages/man3/ptsname.3.html)) +/// +/// `ptsname_r()` returns the name of the slave pseudoterminal device corresponding to the master +/// referred to by `fd`. This is the threadsafe version of `ptsname()`, but it is not part of the +/// POSIX standard and is instead a Linux-specific extension. +/// +/// This value is useful for opening the slave ptty once the master has already been opened with +/// `posix_openpt()`. +#[cfg(any(target_os = "android", target_os = "linux"))] +#[inline] +pub fn ptsname_r(fd: &PtyMaster) -> Result { + let mut name_buf = Vec::::with_capacity(64); + let name_buf_ptr = name_buf.as_mut_ptr(); + let cname = unsafe { + let cap = name_buf.capacity(); + if libc::ptsname_r(fd.as_raw_fd(), name_buf_ptr, cap) != 0 { + return Err(crate::Error::last()); + } + CStr::from_ptr(name_buf.as_ptr()) + }; + + let name = cname.to_string_lossy().into_owned(); + Ok(name) +} + +/// Unlock a pseudoterminal master/slave pseudoterminal pair (see +/// [`unlockpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlockpt.html)) +/// +/// `unlockpt()` unlocks the slave pseudoterminal device corresponding to the master pseudoterminal +/// referred to by `fd`. This must be called before trying to open the slave side of a +/// pseuoterminal. +#[inline] +pub fn unlockpt(fd: &PtyMaster) -> Result<()> { + if unsafe { libc::unlockpt(fd.as_raw_fd()) } < 0 { + return Err(Errno::last()); + } + + Ok(()) +} + + +/// Create a new pseudoterminal, returning the slave and master file descriptors +/// in `OpenptyResult` +/// (see [`openpty`](https://man7.org/linux/man-pages/man3/openpty.3.html)). +/// +/// If `winsize` is not `None`, the window size of the slave will be set to +/// the values in `winsize`. If `termios` is not `None`, the pseudoterminal's +/// terminal settings of the slave will be set to the values in `termios`. +#[inline] +pub fn openpty<'a, 'b, T: Into>, U: Into>>(winsize: T, termios: U) -> Result { + use std::ptr; + + let mut slave = mem::MaybeUninit::::uninit(); + let mut master = mem::MaybeUninit::::uninit(); + let ret = { + match (termios.into(), winsize.into()) { + (Some(termios), Some(winsize)) => { + let inner_termios = termios.get_libc_termios(); + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + &*inner_termios as *const libc::termios as *mut _, + winsize as *const Winsize as *mut _, + ) + } + } + (None, Some(winsize)) => { + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + ptr::null_mut(), + winsize as *const Winsize as *mut _, + ) + } + } + (Some(termios), None) => { + let inner_termios = termios.get_libc_termios(); + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + &*inner_termios as *const libc::termios as *mut _, + ptr::null_mut(), + ) + } + } + (None, None) => { + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + ptr::null_mut(), + ptr::null_mut(), + ) + } + } + } + }; + + Errno::result(ret)?; + + unsafe { + Ok(OpenptyResult { + master: master.assume_init(), + slave: slave.assume_init(), + }) + } +} + +/// Create a new pseudoterminal, returning the master file descriptor and forked pid. +/// in `ForkptyResult` +/// (see [`forkpty`](https://man7.org/linux/man-pages/man3/forkpty.3.html)). +/// +/// If `winsize` is not `None`, the window size of the slave will be set to +/// the values in `winsize`. If `termios` is not `None`, the pseudoterminal's +/// terminal settings of the slave will be set to the values in `termios`. +/// +/// # Safety +/// +/// In a multithreaded program, only [async-signal-safe] functions like `pause` +/// and `_exit` may be called by the child (the parent isn't restricted). Note +/// that memory allocation may **not** be async-signal-safe and thus must be +/// prevented. +/// +/// Those functions are only a small subset of your operating system's API, so +/// special care must be taken to only invoke code you can control and audit. +/// +/// [async-signal-safe]: https://man7.org/linux/man-pages/man7/signal-safety.7.html +pub unsafe fn forkpty<'a, 'b, T: Into>, U: Into>>( + winsize: T, + termios: U, +) -> Result { + use std::ptr; + + let mut master = mem::MaybeUninit::::uninit(); + + let term = match termios.into() { + Some(termios) => { + let inner_termios = termios.get_libc_termios(); + &*inner_termios as *const libc::termios as *mut _ + }, + None => ptr::null_mut(), + }; + + let win = winsize + .into() + .map(|ws| ws as *const Winsize as *mut _) + .unwrap_or(ptr::null_mut()); + + let res = libc::forkpty(master.as_mut_ptr(), ptr::null_mut(), term, win); + + let fork_result = Errno::result(res).map(|res| match res { + 0 => ForkResult::Child, + res => ForkResult::Parent { child: Pid::from_raw(res) }, + })?; + + Ok(ForkptyResult { + master: master.assume_init(), + fork_result, + }) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sched.rs b/bash-5.1/vendor/nix-0.23.1/src/sched.rs new file mode 100644 index 0000000000000000000000000000000000000000..c2dd7b84ce777353b2b9de17a2834875419ffcb7 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sched.rs @@ -0,0 +1,282 @@ +//! Execution scheduling +//! +//! See Also +//! [sched.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sched.h.html) +use crate::{Errno, Result}; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::sched_linux_like::*; + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod sched_linux_like { + use crate::errno::Errno; + use libc::{self, c_int, c_void}; + use std::mem; + use std::option::Option; + use std::os::unix::io::RawFd; + use crate::unistd::Pid; + use crate::Result; + + // For some functions taking with a parameter of type CloneFlags, + // only a subset of these flags have an effect. + libc_bitflags! { + /// Options for use with [`clone`] + pub struct CloneFlags: c_int { + /// The calling process and the child process run in the same + /// memory space. + CLONE_VM; + /// The caller and the child process share the same filesystem + /// information. + CLONE_FS; + /// The calling process and the child process share the same file + /// descriptor table. + CLONE_FILES; + /// The calling process and the child process share the same table + /// of signal handlers. + CLONE_SIGHAND; + /// If the calling process is being traced, then trace the child + /// also. + CLONE_PTRACE; + /// The execution of the calling process is suspended until the + /// child releases its virtual memory resources via a call to + /// execve(2) or _exit(2) (as with vfork(2)). + CLONE_VFORK; + /// The parent of the new child (as returned by getppid(2)) + /// will be the same as that of the calling process. + CLONE_PARENT; + /// The child is placed in the same thread group as the calling + /// process. + CLONE_THREAD; + /// The cloned child is started in a new mount namespace. + CLONE_NEWNS; + /// The child and the calling process share a single list of System + /// V semaphore adjustment values + CLONE_SYSVSEM; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_SETTLS; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_PARENT_SETTID; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_CHILD_CLEARTID; + /// Unused since Linux 2.6.2 + #[deprecated(since = "0.23.0", note = "Deprecated by Linux 2.6.2")] + CLONE_DETACHED; + /// A tracing process cannot force `CLONE_PTRACE` on this child + /// process. + CLONE_UNTRACED; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_CHILD_SETTID; + /// Create the process in a new cgroup namespace. + CLONE_NEWCGROUP; + /// Create the process in a new UTS namespace. + CLONE_NEWUTS; + /// Create the process in a new IPC namespace. + CLONE_NEWIPC; + /// Create the process in a new user namespace. + CLONE_NEWUSER; + /// Create the process in a new PID namespace. + CLONE_NEWPID; + /// Create the process in a new network namespace. + CLONE_NEWNET; + /// The new process shares an I/O context with the calling process. + CLONE_IO; + } + } + + /// Type for the function executed by [`clone`]. + pub type CloneCb<'a> = Box isize + 'a>; + + /// CpuSet represent a bit-mask of CPUs. + /// CpuSets are used by sched_setaffinity and + /// sched_getaffinity for example. + /// + /// This is a wrapper around `libc::cpu_set_t`. + #[repr(C)] + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct CpuSet { + cpu_set: libc::cpu_set_t, + } + + impl CpuSet { + /// Create a new and empty CpuSet. + pub fn new() -> CpuSet { + CpuSet { + cpu_set: unsafe { mem::zeroed() }, + } + } + + /// Test to see if a CPU is in the CpuSet. + /// `field` is the CPU id to test + pub fn is_set(&self, field: usize) -> Result { + if field >= CpuSet::count() { + Err(Errno::EINVAL) + } else { + Ok(unsafe { libc::CPU_ISSET(field, &self.cpu_set) }) + } + } + + /// Add a CPU to CpuSet. + /// `field` is the CPU id to add + pub fn set(&mut self, field: usize) -> Result<()> { + if field >= CpuSet::count() { + Err(Errno::EINVAL) + } else { + unsafe { libc::CPU_SET(field, &mut self.cpu_set); } + Ok(()) + } + } + + /// Remove a CPU from CpuSet. + /// `field` is the CPU id to remove + pub fn unset(&mut self, field: usize) -> Result<()> { + if field >= CpuSet::count() { + Err(Errno::EINVAL) + } else { + unsafe { libc::CPU_CLR(field, &mut self.cpu_set);} + Ok(()) + } + } + + /// Return the maximum number of CPU in CpuSet + pub const fn count() -> usize { + 8 * mem::size_of::() + } + } + + impl Default for CpuSet { + fn default() -> Self { + Self::new() + } + } + + /// `sched_setaffinity` set a thread's CPU affinity mask + /// ([`sched_setaffinity(2)`](https://man7.org/linux/man-pages/man2/sched_setaffinity.2.html)) + /// + /// `pid` is the thread ID to update. + /// If pid is zero, then the calling thread is updated. + /// + /// The `cpuset` argument specifies the set of CPUs on which the thread + /// will be eligible to run. + /// + /// # Example + /// + /// Binding the current thread to CPU 0 can be done as follows: + /// + /// ```rust,no_run + /// use nix::sched::{CpuSet, sched_setaffinity}; + /// use nix::unistd::Pid; + /// + /// let mut cpu_set = CpuSet::new(); + /// cpu_set.set(0); + /// sched_setaffinity(Pid::from_raw(0), &cpu_set); + /// ``` + pub fn sched_setaffinity(pid: Pid, cpuset: &CpuSet) -> Result<()> { + let res = unsafe { + libc::sched_setaffinity( + pid.into(), + mem::size_of::() as libc::size_t, + &cpuset.cpu_set, + ) + }; + + Errno::result(res).map(drop) + } + + /// `sched_getaffinity` get a thread's CPU affinity mask + /// ([`sched_getaffinity(2)`](https://man7.org/linux/man-pages/man2/sched_getaffinity.2.html)) + /// + /// `pid` is the thread ID to check. + /// If pid is zero, then the calling thread is checked. + /// + /// Returned `cpuset` is the set of CPUs on which the thread + /// is eligible to run. + /// + /// # Example + /// + /// Checking if the current thread can run on CPU 0 can be done as follows: + /// + /// ```rust,no_run + /// use nix::sched::sched_getaffinity; + /// use nix::unistd::Pid; + /// + /// let cpu_set = sched_getaffinity(Pid::from_raw(0)).unwrap(); + /// if cpu_set.is_set(0).unwrap() { + /// println!("Current thread can run on CPU 0"); + /// } + /// ``` + pub fn sched_getaffinity(pid: Pid) -> Result { + let mut cpuset = CpuSet::new(); + let res = unsafe { + libc::sched_getaffinity( + pid.into(), + mem::size_of::() as libc::size_t, + &mut cpuset.cpu_set, + ) + }; + + Errno::result(res).and(Ok(cpuset)) + } + + /// `clone` create a child process + /// ([`clone(2)`](https://man7.org/linux/man-pages/man2/clone.2.html)) + /// + /// `stack` is a reference to an array which will hold the stack of the new + /// process. Unlike when calling `clone(2)` from C, the provided stack + /// address need not be the highest address of the region. Nix will take + /// care of that requirement. The user only needs to provide a reference to + /// a normally allocated buffer. + pub fn clone( + mut cb: CloneCb, + stack: &mut [u8], + flags: CloneFlags, + signal: Option, + ) -> Result { + extern "C" fn callback(data: *mut CloneCb) -> c_int { + let cb: &mut CloneCb = unsafe { &mut *data }; + (*cb)() as c_int + } + + let res = unsafe { + let combined = flags.bits() | signal.unwrap_or(0); + let ptr = stack.as_mut_ptr().add(stack.len()); + let ptr_aligned = ptr.sub(ptr as usize % 16); + libc::clone( + mem::transmute( + callback as extern "C" fn(*mut Box isize>) -> i32, + ), + ptr_aligned as *mut c_void, + combined, + &mut cb as *mut _ as *mut c_void, + ) + }; + + Errno::result(res).map(Pid::from_raw) + } + + /// disassociate parts of the process execution context + /// + /// See also [unshare(2)](https://man7.org/linux/man-pages/man2/unshare.2.html) + pub fn unshare(flags: CloneFlags) -> Result<()> { + let res = unsafe { libc::unshare(flags.bits()) }; + + Errno::result(res).map(drop) + } + + /// reassociate thread with a namespace + /// + /// See also [setns(2)](https://man7.org/linux/man-pages/man2/setns.2.html) + pub fn setns(fd: RawFd, nstype: CloneFlags) -> Result<()> { + let res = unsafe { libc::setns(fd, nstype.bits()) }; + + Errno::result(res).map(drop) + } +} + +/// Explicitly yield the processor to other threads. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_yield.html) +pub fn sched_yield() -> Result<()> { + let res = unsafe { libc::sched_yield() }; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/aio.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/aio.rs new file mode 100644 index 0000000000000000000000000000000000000000..e64a2a823a64364421eeb4c5fe149e93d49dc0c9 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/aio.rs @@ -0,0 +1,1122 @@ +// vim: tw=80 +//! POSIX Asynchronous I/O +//! +//! The POSIX AIO interface is used for asynchronous I/O on files and disk-like +//! devices. It supports [`read`](struct.AioCb.html#method.read), +//! [`write`](struct.AioCb.html#method.write), and +//! [`fsync`](struct.AioCb.html#method.fsync) operations. Completion +//! notifications can optionally be delivered via +//! [signals](../signal/enum.SigevNotify.html#variant.SigevSignal), via the +//! [`aio_suspend`](fn.aio_suspend.html) function, or via polling. Some +//! platforms support other completion +//! notifications, such as +//! [kevent](../signal/enum.SigevNotify.html#variant.SigevKevent). +//! +//! Multiple operations may be submitted in a batch with +//! [`lio_listio`](fn.lio_listio.html), though the standard does not guarantee +//! that they will be executed atomically. +//! +//! Outstanding operations may be cancelled with +//! [`cancel`](struct.AioCb.html#method.cancel) or +//! [`aio_cancel_all`](fn.aio_cancel_all.html), though the operating system may +//! not support this for all filesystems and devices. + +use crate::Result; +use crate::errno::Errno; +use std::os::unix::io::RawFd; +use libc::{c_void, off_t, size_t}; +use std::fmt; +use std::fmt::Debug; +use std::marker::PhantomData; +use std::mem; +use std::pin::Pin; +use std::ptr::{null, null_mut}; +use crate::sys::signal::*; +use std::thread; +use crate::sys::time::TimeSpec; + +libc_enum! { + /// Mode for `AioCb::fsync`. Controls whether only data or both data and + /// metadata are synced. + #[repr(i32)] + #[non_exhaustive] + pub enum AioFsyncMode { + /// do it like `fsync` + O_SYNC, + /// on supported operating systems only, do it like `fdatasync` + #[cfg(any(target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + O_DSYNC + } +} + +libc_enum! { + /// When used with [`lio_listio`](fn.lio_listio.html), determines whether a + /// given `aiocb` should be used for a read operation, a write operation, or + /// ignored. Has no effect for any other aio functions. + #[repr(i32)] + #[non_exhaustive] + pub enum LioOpcode { + /// No operation + LIO_NOP, + /// Write data as if by a call to [`AioCb::write`] + LIO_WRITE, + /// Write data as if by a call to [`AioCb::read`] + LIO_READ, + } +} + +libc_enum! { + /// Mode for [`lio_listio`](fn.lio_listio.html) + #[repr(i32)] + pub enum LioMode { + /// Requests that [`lio_listio`](fn.lio_listio.html) block until all + /// requested operations have been completed + LIO_WAIT, + /// Requests that [`lio_listio`](fn.lio_listio.html) return immediately + LIO_NOWAIT, + } +} + +/// Return values for [`AioCb::cancel`](struct.AioCb.html#method.cancel) and +/// [`aio_cancel_all`](fn.aio_cancel_all.html) +#[repr(i32)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum AioCancelStat { + /// All outstanding requests were canceled + AioCanceled = libc::AIO_CANCELED, + /// Some requests were not canceled. Their status should be checked with + /// `AioCb::error` + AioNotCanceled = libc::AIO_NOTCANCELED, + /// All of the requests have already finished + AioAllDone = libc::AIO_ALLDONE, +} + +/// Newtype that adds Send and Sync to libc::aiocb, which contains raw pointers +#[repr(transparent)] +struct LibcAiocb(libc::aiocb); + +unsafe impl Send for LibcAiocb {} +unsafe impl Sync for LibcAiocb {} + +/// AIO Control Block. +/// +/// The basic structure used by all aio functions. Each `AioCb` represents one +/// I/O request. +pub struct AioCb<'a> { + aiocb: LibcAiocb, + /// Tracks whether the buffer pointed to by `libc::aiocb.aio_buf` is mutable + mutable: bool, + /// Could this `AioCb` potentially have any in-kernel state? + in_progress: bool, + _buffer: std::marker::PhantomData<&'a [u8]>, + _pin: std::marker::PhantomPinned +} + +impl<'a> AioCb<'a> { + /// Returns the underlying file descriptor associated with the `AioCb` + pub fn fd(&self) -> RawFd { + self.aiocb.0.aio_fildes + } + + /// Constructs a new `AioCb` with no associated buffer. + /// + /// The resulting `AioCb` structure is suitable for use with `AioCb::fsync`. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio`. + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// + /// # Examples + /// + /// Create an `AioCb` from a raw file descriptor and use it for an + /// [`fsync`](#method.fsync) operation. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify::SigevNone; + /// # use std::{thread, time}; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// let f = tempfile().unwrap(); + /// let mut aiocb = AioCb::from_fd( f.as_raw_fd(), 0, SigevNone); + /// aiocb.fsync(AioFsyncMode::O_SYNC).expect("aio_fsync failed early"); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// aiocb.aio_return().expect("aio_fsync failed late"); + /// ``` + pub fn from_fd(fd: RawFd, prio: libc::c_int, + sigev_notify: SigevNotify) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = 0; + a.0.aio_nbytes = 0; + a.0.aio_buf = null_mut(); + + Box::pin(AioCb { + aiocb: a, + mutable: false, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + }) + } + + // Private helper + #[cfg(not(any(target_os = "ios", target_os = "macos")))] + fn from_mut_slice_unpinned(fd: RawFd, offs: off_t, buf: &'a mut [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> AioCb<'a> + { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = buf.len() as size_t; + a.0.aio_buf = buf.as_ptr() as *mut c_void; + a.0.aio_lio_opcode = opcode as libc::c_int; + + AioCb { + aiocb: a, + mutable: true, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + } + } + + /// Constructs a new `AioCb` from a mutable slice. + /// + /// The resulting `AioCb` will be suitable for both read and write + /// operations, but only if the borrow checker can guarantee that the slice + /// will outlive the `AioCb`. That will usually be the case if the `AioCb` + /// is stack-allocated. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `offs`: File offset + /// * `buf`: A memory buffer + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// * `opcode`: This field is only used for `lio_listio`. It + /// determines which operation to use for this individual + /// aiocb + /// + /// # Examples + /// + /// Create an `AioCb` from a mutable slice and read into it. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::io::Write; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const INITIAL: &[u8] = b"abcdef123456"; + /// const LEN: usize = 4; + /// let mut rbuf = vec![0; LEN]; + /// let mut f = tempfile().unwrap(); + /// f.write_all(INITIAL).unwrap(); + /// { + /// let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + /// 2, //offset + /// &mut rbuf, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.read().unwrap(); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// assert_eq!(aiocb.aio_return().unwrap() as usize, LEN); + /// } + /// assert_eq!(rbuf, b"cdef"); + /// ``` + pub fn from_mut_slice(fd: RawFd, offs: off_t, buf: &'a mut [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = buf.len() as size_t; + a.0.aio_buf = buf.as_ptr() as *mut c_void; + a.0.aio_lio_opcode = opcode as libc::c_int; + + Box::pin(AioCb { + aiocb: a, + mutable: true, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + }) + } + + /// Constructs a new `AioCb` from a mutable raw pointer + /// + /// Unlike `from_mut_slice`, this method returns a structure suitable for + /// placement on the heap. It may be used for both reads and writes. Due + /// to its unsafety, this method is not recommended. It is most useful when + /// heap allocation is required. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `offs`: File offset + /// * `buf`: Pointer to the memory buffer + /// * `len`: Length of the buffer pointed to by `buf` + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// * `opcode`: This field is only used for `lio_listio`. It + /// determines which operation to use for this individual + /// aiocb + /// + /// # Safety + /// + /// The caller must ensure that the storage pointed to by `buf` outlives the + /// `AioCb`. The lifetime checker can't help here. + pub unsafe fn from_mut_ptr(fd: RawFd, offs: off_t, + buf: *mut c_void, len: usize, + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = len; + a.0.aio_buf = buf; + a.0.aio_lio_opcode = opcode as libc::c_int; + + Box::pin(AioCb { + aiocb: a, + mutable: true, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned, + }) + } + + /// Constructs a new `AioCb` from a raw pointer. + /// + /// Unlike `from_slice`, this method returns a structure suitable for + /// placement on the heap. Due to its unsafety, this method is not + /// recommended. It is most useful when heap allocation is required. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `offs`: File offset + /// * `buf`: Pointer to the memory buffer + /// * `len`: Length of the buffer pointed to by `buf` + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// * `opcode`: This field is only used for `lio_listio`. It + /// determines which operation to use for this individual + /// aiocb + /// + /// # Safety + /// + /// The caller must ensure that the storage pointed to by `buf` outlives the + /// `AioCb`. The lifetime checker can't help here. + pub unsafe fn from_ptr(fd: RawFd, offs: off_t, + buf: *const c_void, len: usize, + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = len; + // casting a const ptr to a mutable ptr here is ok, because we set the + // AioCb's mutable field to false + a.0.aio_buf = buf as *mut c_void; + a.0.aio_lio_opcode = opcode as libc::c_int; + + Box::pin(AioCb { + aiocb: a, + mutable: false, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + }) + } + + // Private helper + fn from_slice_unpinned(fd: RawFd, offs: off_t, buf: &'a [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> AioCb + { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = buf.len() as size_t; + // casting an immutable buffer to a mutable pointer looks unsafe, + // but technically its only unsafe to dereference it, not to create + // it. + a.0.aio_buf = buf.as_ptr() as *mut c_void; + assert!(opcode != LioOpcode::LIO_READ, "Can't read into an immutable buffer"); + a.0.aio_lio_opcode = opcode as libc::c_int; + + AioCb { + aiocb: a, + mutable: false, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + } + } + + /// Like [`AioCb::from_mut_slice`], but works on constant slices rather than + /// mutable slices. + /// + /// An `AioCb` created this way cannot be used with `read`, and its + /// `LioOpcode` cannot be set to `LIO_READ`. This method is useful when + /// writing a const buffer with `AioCb::write`, since `from_mut_slice` can't + /// work with const buffers. + /// + /// # Examples + /// + /// Construct an `AioCb` from a slice and use it for writing. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.write().unwrap(); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); + /// ``` + // Note: another solution to the problem of writing const buffers would be + // to genericize AioCb for both &mut [u8] and &[u8] buffers. AioCb::read + // could take the former and AioCb::write could take the latter. However, + // then lio_listio wouldn't work, because that function needs a slice of + // AioCb, and they must all be of the same type. + pub fn from_slice(fd: RawFd, offs: off_t, buf: &'a [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin> + { + Box::pin(AioCb::from_slice_unpinned(fd, offs, buf, prio, sigev_notify, + opcode)) + } + + fn common_init(fd: RawFd, prio: libc::c_int, + sigev_notify: SigevNotify) -> LibcAiocb { + // Use mem::zeroed instead of explicitly zeroing each field, because the + // number and name of reserved fields is OS-dependent. On some OSes, + // some reserved fields are used the kernel for state, and must be + // explicitly zeroed when allocated. + let mut a = unsafe { mem::zeroed::()}; + a.aio_fildes = fd; + a.aio_reqprio = prio; + a.aio_sigevent = SigEvent::new(sigev_notify).sigevent(); + LibcAiocb(a) + } + + /// Update the notification settings for an existing `aiocb` + pub fn set_sigev_notify(self: &mut Pin>, + sigev_notify: SigevNotify) + { + // Safe because we don't move any of the data + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + selfp.aiocb.0.aio_sigevent = SigEvent::new(sigev_notify).sigevent(); + } + + /// Cancels an outstanding AIO request. + /// + /// The operating system is not required to implement cancellation for all + /// file and device types. Even if it does, there is no guarantee that the + /// operation has not already completed. So the caller must check the + /// result and handle operations that were not canceled or that have already + /// completed. + /// + /// # Examples + /// + /// Cancel an outstanding aio operation. Note that we must still call + /// `aio_return` to free resources, even though we don't care about the + /// result. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::io::Write; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// let wbuf = b"CDEF"; + /// let mut f = tempfile().unwrap(); + /// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + /// 2, //offset + /// &wbuf[..], + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.write().unwrap(); + /// let cs = aiocb.cancel().unwrap(); + /// if cs == AioCancelStat::AioNotCanceled { + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// } + /// // Must call `aio_return`, but ignore the result + /// let _ = aiocb.aio_return(); + /// ``` + /// + /// # References + /// + /// [aio_cancel](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html) + pub fn cancel(self: &mut Pin>) -> Result { + let r = unsafe { + let selfp = self.as_mut().get_unchecked_mut(); + libc::aio_cancel(selfp.aiocb.0.aio_fildes, &mut selfp.aiocb.0) + }; + match r { + libc::AIO_CANCELED => Ok(AioCancelStat::AioCanceled), + libc::AIO_NOTCANCELED => Ok(AioCancelStat::AioNotCanceled), + libc::AIO_ALLDONE => Ok(AioCancelStat::AioAllDone), + -1 => Err(Errno::last()), + _ => panic!("unknown aio_cancel return value") + } + } + + fn error_unpinned(&mut self) -> Result<()> { + let r = unsafe { + libc::aio_error(&mut self.aiocb.0 as *mut libc::aiocb) + }; + match r { + 0 => Ok(()), + num if num > 0 => Err(Errno::from_i32(num)), + -1 => Err(Errno::last()), + num => panic!("unknown aio_error return value {:?}", num) + } + } + + /// Retrieve error status of an asynchronous operation. + /// + /// If the request has not yet completed, returns `EINPROGRESS`. Otherwise, + /// returns `Ok` or any other error. + /// + /// # Examples + /// + /// Issue an aio operation and use `error` to poll for completion. Polling + /// is an alternative to `aio_suspend`, used by most of the other examples. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.write().unwrap(); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); + /// ``` + /// + /// # References + /// + /// [aio_error](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_error.html) + pub fn error(self: &mut Pin>) -> Result<()> { + // Safe because error_unpinned doesn't move the data + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + selfp.error_unpinned() + } + + /// An asynchronous version of `fsync(2)`. + /// + /// # References + /// + /// [aio_fsync](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_fsync.html) + pub fn fsync(self: &mut Pin>, mode: AioFsyncMode) -> Result<()> { + // Safe because we don't move the libc::aiocb + unsafe { + let selfp = self.as_mut().get_unchecked_mut(); + Errno::result({ + let p: *mut libc::aiocb = &mut selfp.aiocb.0; + libc::aio_fsync(mode as libc::c_int, p) + }).map(|_| { + selfp.in_progress = true; + }) + } + } + + /// Returns the `aiocb`'s `LioOpcode` field + /// + /// If the value cannot be represented as an `LioOpcode`, returns `None` + /// instead. + pub fn lio_opcode(&self) -> Option { + match self.aiocb.0.aio_lio_opcode { + libc::LIO_READ => Some(LioOpcode::LIO_READ), + libc::LIO_WRITE => Some(LioOpcode::LIO_WRITE), + libc::LIO_NOP => Some(LioOpcode::LIO_NOP), + _ => None + } + } + + /// Returns the requested length of the aio operation in bytes + /// + /// This method returns the *requested* length of the operation. To get the + /// number of bytes actually read or written by a completed operation, use + /// `aio_return` instead. + pub fn nbytes(&self) -> usize { + self.aiocb.0.aio_nbytes + } + + /// Returns the file offset stored in the `AioCb` + pub fn offset(&self) -> off_t { + self.aiocb.0.aio_offset + } + + /// Returns the priority of the `AioCb` + pub fn priority(&self) -> libc::c_int { + self.aiocb.0.aio_reqprio + } + + /// Asynchronously reads from a file descriptor into a buffer + /// + /// # References + /// + /// [aio_read](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_read.html) + pub fn read(self: &mut Pin>) -> Result<()> { + assert!(self.mutable, "Can't read into an immutable buffer"); + // Safe because we don't move anything + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + Errno::result({ + let p: *mut libc::aiocb = &mut selfp.aiocb.0; + unsafe { libc::aio_read(p) } + }).map(|_| { + selfp.in_progress = true; + }) + } + + /// Returns the `SigEvent` stored in the `AioCb` + pub fn sigevent(&self) -> SigEvent { + SigEvent::from(&self.aiocb.0.aio_sigevent) + } + + fn aio_return_unpinned(&mut self) -> Result { + unsafe { + let p: *mut libc::aiocb = &mut self.aiocb.0; + self.in_progress = false; + Errno::result(libc::aio_return(p)) + } + } + + /// Retrieve return status of an asynchronous operation. + /// + /// Should only be called once for each `AioCb`, after `AioCb::error` + /// indicates that it has completed. The result is the same as for the + /// synchronous `read(2)`, `write(2)`, of `fsync(2)` functions. + /// + /// # References + /// + /// [aio_return](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_return.html) + // Note: this should be just `return`, but that's a reserved word + pub fn aio_return(self: &mut Pin>) -> Result { + // Safe because aio_return_unpinned does not move the data + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + selfp.aio_return_unpinned() + } + + /// Asynchronously writes from a buffer to a file descriptor + /// + /// # References + /// + /// [aio_write](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_write.html) + pub fn write(self: &mut Pin>) -> Result<()> { + // Safe because we don't move anything + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + Errno::result({ + let p: *mut libc::aiocb = &mut selfp.aiocb.0; + unsafe{ libc::aio_write(p) } + }).map(|_| { + selfp.in_progress = true; + }) + } +} + +/// Cancels outstanding AIO requests for a given file descriptor. +/// +/// # Examples +/// +/// Issue an aio operation, then cancel all outstanding operations on that file +/// descriptor. +/// +/// ``` +/// # use nix::errno::Errno; +/// # use nix::Error; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use std::{thread, time}; +/// # use std::io::Write; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// let wbuf = b"CDEF"; +/// let mut f = tempfile().unwrap(); +/// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), +/// 2, //offset +/// &wbuf[..], +/// 0, //priority +/// SigevNotify::SigevNone, +/// LioOpcode::LIO_NOP); +/// aiocb.write().unwrap(); +/// let cs = aio_cancel_all(f.as_raw_fd()).unwrap(); +/// if cs == AioCancelStat::AioNotCanceled { +/// while (aiocb.error() == Err(Errno::EINPROGRESS)) { +/// thread::sleep(time::Duration::from_millis(10)); +/// } +/// } +/// // Must call `aio_return`, but ignore the result +/// let _ = aiocb.aio_return(); +/// ``` +/// +/// # References +/// +/// [`aio_cancel`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html) +pub fn aio_cancel_all(fd: RawFd) -> Result { + match unsafe { libc::aio_cancel(fd, null_mut()) } { + libc::AIO_CANCELED => Ok(AioCancelStat::AioCanceled), + libc::AIO_NOTCANCELED => Ok(AioCancelStat::AioNotCanceled), + libc::AIO_ALLDONE => Ok(AioCancelStat::AioAllDone), + -1 => Err(Errno::last()), + _ => panic!("unknown aio_cancel return value") + } +} + +/// Suspends the calling process until at least one of the specified `AioCb`s +/// has completed, a signal is delivered, or the timeout has passed. +/// +/// If `timeout` is `None`, `aio_suspend` will block indefinitely. +/// +/// # Examples +/// +/// Use `aio_suspend` to block until an aio operation completes. +/// +/// ``` +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// const WBUF: &[u8] = b"abcdef123456"; +/// let mut f = tempfile().unwrap(); +/// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), +/// 2, //offset +/// WBUF, +/// 0, //priority +/// SigevNotify::SigevNone, +/// LioOpcode::LIO_NOP); +/// aiocb.write().unwrap(); +/// aio_suspend(&[aiocb.as_ref()], None).expect("aio_suspend failed"); +/// assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); +/// ``` +/// # References +/// +/// [`aio_suspend`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_suspend.html) +pub fn aio_suspend(list: &[Pin<&AioCb>], timeout: Option) -> Result<()> { + let plist = list as *const [Pin<&AioCb>] as *const [*const libc::aiocb]; + let p = plist as *const *const libc::aiocb; + let timep = match timeout { + None => null::(), + Some(x) => x.as_ref() as *const libc::timespec + }; + Errno::result(unsafe { + libc::aio_suspend(p, list.len() as i32, timep) + }).map(drop) +} + +impl<'a> Debug for AioCb<'a> { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("AioCb") + .field("aiocb", &self.aiocb.0) + .field("mutable", &self.mutable) + .field("in_progress", &self.in_progress) + .finish() + } +} + +impl<'a> Drop for AioCb<'a> { + /// If the `AioCb` has no remaining state in the kernel, just drop it. + /// Otherwise, dropping constitutes a resource leak, which is an error + fn drop(&mut self) { + assert!(thread::panicking() || !self.in_progress, + "Dropped an in-progress AioCb"); + } +} + +/// LIO Control Block. +/// +/// The basic structure used to issue multiple AIO operations simultaneously. +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +pub struct LioCb<'a> { + /// A collection of [`AioCb`]s. All of these will be issued simultaneously + /// by the [`listio`] method. + /// + /// [`AioCb`]: struct.AioCb.html + /// [`listio`]: #method.listio + // Their locations in memory must be fixed once they are passed to the + // kernel. So this field must be non-public so the user can't swap. + aiocbs: Box<[AioCb<'a>]>, + + /// The actual list passed to `libc::lio_listio`. + /// + /// It must live for as long as any of the operations are still being + /// processesed, because the aio subsystem uses its address as a unique + /// identifier. + list: Vec<*mut libc::aiocb>, + + /// A partial set of results. This field will get populated by + /// `listio_resubmit` when an `LioCb` is resubmitted after an error + results: Vec>> +} + +/// LioCb can't automatically impl Send and Sync just because of the raw +/// pointers in list. But that's stupid. There's no reason that raw pointers +/// should automatically be non-Send +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +unsafe impl<'a> Send for LioCb<'a> {} +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +unsafe impl<'a> Sync for LioCb<'a> {} + +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +impl<'a> LioCb<'a> { + /// Are no [`AioCb`]s contained? + pub fn is_empty(&self) -> bool { + self.aiocbs.is_empty() + } + + /// Return the number of individual [`AioCb`]s contained. + pub fn len(&self) -> usize { + self.aiocbs.len() + } + + /// Submits multiple asynchronous I/O requests with a single system call. + /// + /// They are not guaranteed to complete atomically, and the order in which + /// the requests are carried out is not specified. Reads, writes, and + /// fsyncs may be freely mixed. + /// + /// This function is useful for reducing the context-switch overhead of + /// submitting many AIO operations. It can also be used with + /// `LioMode::LIO_WAIT` to block on the result of several independent + /// operations. Used that way, it is often useful in programs that + /// otherwise make little use of AIO. + /// + /// # Examples + /// + /// Use `listio` to submit an aio operation and wait for its completion. In + /// this case, there is no need to use [`aio_suspend`] to wait or + /// [`AioCb::error`] to poll. + /// + /// ``` + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut liocb = LioCbBuilder::with_capacity(1) + /// .emplace_slice( + /// f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_WRITE + /// ).finish(); + /// liocb.listio(LioMode::LIO_WAIT, + /// SigevNotify::SigevNone).unwrap(); + /// assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + /// ``` + /// + /// # References + /// + /// [`lio_listio`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lio_listio.html) + /// + /// [`aio_suspend`]: fn.aio_suspend.html + /// [`AioCb::error`]: struct.AioCb.html#method.error + pub fn listio(&mut self, mode: LioMode, + sigev_notify: SigevNotify) -> Result<()> { + let sigev = SigEvent::new(sigev_notify); + let sigevp = &mut sigev.sigevent() as *mut libc::sigevent; + self.list.clear(); + for a in &mut self.aiocbs.iter_mut() { + a.in_progress = true; + self.list.push(a as *mut AioCb<'a> + as *mut libc::aiocb); + } + let p = self.list.as_ptr(); + Errno::result(unsafe { + libc::lio_listio(mode as i32, p, self.list.len() as i32, sigevp) + }).map(drop) + } + + /// Resubmits any incomplete operations with [`lio_listio`]. + /// + /// Sometimes, due to system resource limitations, an `lio_listio` call will + /// return `EIO`, or `EAGAIN`. Or, if a signal is received, it may return + /// `EINTR`. In any of these cases, only a subset of its constituent + /// operations will actually have been initiated. `listio_resubmit` will + /// resubmit any operations that are still uninitiated. + /// + /// After calling `listio_resubmit`, results should be collected by + /// [`LioCb::aio_return`]. + /// + /// # Examples + /// ```no_run + /// # use nix::Error; + /// # use nix::errno::Errno; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::os::unix::io::AsRawFd; + /// # use std::{thread, time}; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut liocb = LioCbBuilder::with_capacity(1) + /// .emplace_slice( + /// f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_WRITE + /// ).finish(); + /// let mut err = liocb.listio(LioMode::LIO_WAIT, SigevNotify::SigevNone); + /// while err == Err(Errno::EIO) || + /// err == Err(Errno::EAGAIN) { + /// thread::sleep(time::Duration::from_millis(10)); + /// err = liocb.listio_resubmit(LioMode::LIO_WAIT, SigevNotify::SigevNone); + /// } + /// assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + /// ``` + /// + /// # References + /// + /// [`lio_listio`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lio_listio.html) + /// + /// [`lio_listio`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/lio_listio.html + /// [`LioCb::aio_return`]: struct.LioCb.html#method.aio_return + // Note: the addresses of any EINPROGRESS or EOK aiocbs _must_ not be + // changed by this method, because the kernel relies on their addresses + // being stable. + // Note: aiocbs that are Ok(()) must be finalized by aio_return, or else the + // sigev_notify will immediately refire. + pub fn listio_resubmit(&mut self, mode:LioMode, + sigev_notify: SigevNotify) -> Result<()> { + let sigev = SigEvent::new(sigev_notify); + let sigevp = &mut sigev.sigevent() as *mut libc::sigevent; + self.list.clear(); + + while self.results.len() < self.aiocbs.len() { + self.results.push(None); + } + + for (i, a) in self.aiocbs.iter_mut().enumerate() { + if self.results[i].is_some() { + // Already collected final status for this operation + continue; + } + match a.error_unpinned() { + Ok(()) => { + // aiocb is complete; collect its status and don't resubmit + self.results[i] = Some(a.aio_return_unpinned()); + }, + Err(Errno::EAGAIN) => { + self.list.push(a as *mut AioCb<'a> as *mut libc::aiocb); + }, + Err(Errno::EINPROGRESS) => { + // aiocb is was successfully queued; no need to do anything + }, + Err(Errno::EINVAL) => panic!( + "AioCb was never submitted, or already finalized"), + _ => unreachable!() + } + } + let p = self.list.as_ptr(); + Errno::result(unsafe { + libc::lio_listio(mode as i32, p, self.list.len() as i32, sigevp) + }).map(drop) + } + + /// Collect final status for an individual `AioCb` submitted as part of an + /// `LioCb`. + /// + /// This is just like [`AioCb::aio_return`], except it takes into account + /// operations that were restarted by [`LioCb::listio_resubmit`] + /// + /// [`AioCb::aio_return`]: struct.AioCb.html#method.aio_return + /// [`LioCb::listio_resubmit`]: #method.listio_resubmit + pub fn aio_return(&mut self, i: usize) -> Result { + if i >= self.results.len() || self.results[i].is_none() { + self.aiocbs[i].aio_return_unpinned() + } else { + self.results[i].unwrap() + } + } + + /// Retrieve error status of an individual `AioCb` submitted as part of an + /// `LioCb`. + /// + /// This is just like [`AioCb::error`], except it takes into account + /// operations that were restarted by [`LioCb::listio_resubmit`] + /// + /// [`AioCb::error`]: struct.AioCb.html#method.error + /// [`LioCb::listio_resubmit`]: #method.listio_resubmit + pub fn error(&mut self, i: usize) -> Result<()> { + if i >= self.results.len() || self.results[i].is_none() { + self.aiocbs[i].error_unpinned() + } else { + Ok(()) + } + } +} + +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +impl<'a> Debug for LioCb<'a> { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("LioCb") + .field("aiocbs", &self.aiocbs) + .finish() + } +} + +/// Used to construct `LioCb` +// This must be a separate class from LioCb due to pinning constraints. LioCb +// must use a boxed slice of AioCbs so they will have stable storage, but +// LioCbBuilder must use a Vec to make construction possible when the final size +// is unknown. +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[derive(Debug)] +pub struct LioCbBuilder<'a> { + /// A collection of [`AioCb`]s. + /// + /// [`AioCb`]: struct.AioCb.html + pub aiocbs: Vec>, +} + +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +impl<'a> LioCbBuilder<'a> { + /// Initialize an empty `LioCb` + pub fn with_capacity(capacity: usize) -> LioCbBuilder<'a> { + LioCbBuilder { + aiocbs: Vec::with_capacity(capacity), + } + } + + /// Add a new operation on an immutable slice to the [`LioCb`] under + /// construction. + /// + /// Arguments are the same as for [`AioCb::from_slice`] + /// + /// [`LioCb`]: struct.LioCb.html + /// [`AioCb::from_slice`]: struct.AioCb.html#method.from_slice + pub fn emplace_slice(mut self, fd: RawFd, offs: off_t, buf: &'a [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Self + { + self.aiocbs.push(AioCb::from_slice_unpinned(fd, offs, buf, prio, + sigev_notify, opcode)); + self + } + + /// Add a new operation on a mutable slice to the [`LioCb`] under + /// construction. + /// + /// Arguments are the same as for [`AioCb::from_mut_slice`] + /// + /// [`LioCb`]: struct.LioCb.html + /// [`AioCb::from_mut_slice`]: struct.AioCb.html#method.from_mut_slice + pub fn emplace_mut_slice(mut self, fd: RawFd, offs: off_t, + buf: &'a mut [u8], prio: libc::c_int, + sigev_notify: SigevNotify, opcode: LioOpcode) + -> Self + { + self.aiocbs.push(AioCb::from_mut_slice_unpinned(fd, offs, buf, prio, + sigev_notify, opcode)); + self + } + + /// Finalize this [`LioCb`]. + /// + /// Afterwards it will be possible to issue the operations with + /// [`LioCb::listio`]. Conversely, it will no longer be possible to add new + /// operations with [`LioCbBuilder::emplace_slice`] or + /// [`LioCbBuilder::emplace_mut_slice`]. + /// + /// [`LioCb::listio`]: struct.LioCb.html#method.listio + /// [`LioCb::from_mut_slice`]: struct.LioCb.html#method.from_mut_slice + /// [`LioCb::from_slice`]: struct.LioCb.html#method.from_slice + pub fn finish(self) -> LioCb<'a> { + let len = self.aiocbs.len(); + LioCb { + aiocbs: self.aiocbs.into(), + list: Vec::with_capacity(len), + results: Vec::with_capacity(len) + } + } +} + +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg(test)] +mod t { + use super::*; + + // It's important that `LioCb` be `UnPin`. The tokio-file crate relies on + // it. + #[test] + fn liocb_is_unpin() { + use assert_impl::assert_impl; + + assert_impl!(Unpin: LioCb); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/epoll.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/epoll.rs new file mode 100644 index 0000000000000000000000000000000000000000..6bc2a2539eb2b184fecbc0be0023484dd227883a --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/epoll.rs @@ -0,0 +1,109 @@ +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_int}; +use std::os::unix::io::RawFd; +use std::ptr; +use std::mem; + +libc_bitflags!( + pub struct EpollFlags: c_int { + EPOLLIN; + EPOLLPRI; + EPOLLOUT; + EPOLLRDNORM; + EPOLLRDBAND; + EPOLLWRNORM; + EPOLLWRBAND; + EPOLLMSG; + EPOLLERR; + EPOLLHUP; + EPOLLRDHUP; + #[cfg(target_os = "linux")] // Added in 4.5; not in Android. + EPOLLEXCLUSIVE; + #[cfg(not(target_arch = "mips"))] + EPOLLWAKEUP; + EPOLLONESHOT; + EPOLLET; + } +); + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(i32)] +#[non_exhaustive] +pub enum EpollOp { + EpollCtlAdd = libc::EPOLL_CTL_ADD, + EpollCtlDel = libc::EPOLL_CTL_DEL, + EpollCtlMod = libc::EPOLL_CTL_MOD, +} + +libc_bitflags!{ + pub struct EpollCreateFlags: c_int { + EPOLL_CLOEXEC; + } +} + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct EpollEvent { + event: libc::epoll_event, +} + +impl EpollEvent { + pub fn new(events: EpollFlags, data: u64) -> Self { + EpollEvent { event: libc::epoll_event { events: events.bits() as u32, u64: data } } + } + + pub fn empty() -> Self { + unsafe { mem::zeroed::() } + } + + pub fn events(&self) -> EpollFlags { + EpollFlags::from_bits(self.event.events as c_int).unwrap() + } + + pub fn data(&self) -> u64 { + self.event.u64 + } +} + +#[inline] +pub fn epoll_create() -> Result { + let res = unsafe { libc::epoll_create(1024) }; + + Errno::result(res) +} + +#[inline] +pub fn epoll_create1(flags: EpollCreateFlags) -> Result { + let res = unsafe { libc::epoll_create1(flags.bits()) }; + + Errno::result(res) +} + +#[inline] +pub fn epoll_ctl<'a, T>(epfd: RawFd, op: EpollOp, fd: RawFd, event: T) -> Result<()> + where T: Into> +{ + let mut event: Option<&mut EpollEvent> = event.into(); + if event.is_none() && op != EpollOp::EpollCtlDel { + Err(Errno::EINVAL) + } else { + let res = unsafe { + if let Some(ref mut event) = event { + libc::epoll_ctl(epfd, op as c_int, fd, &mut event.event) + } else { + libc::epoll_ctl(epfd, op as c_int, fd, ptr::null_mut()) + } + }; + Errno::result(res).map(drop) + } +} + +#[inline] +pub fn epoll_wait(epfd: RawFd, events: &mut [EpollEvent], timeout_ms: isize) -> Result { + let res = unsafe { + libc::epoll_wait(epfd, events.as_mut_ptr() as *mut libc::epoll_event, events.len() as c_int, timeout_ms as c_int) + }; + + Errno::result(res).map(|r| r as usize) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/event.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/event.rs new file mode 100644 index 0000000000000000000000000000000000000000..c648f5ebc861781df59b6b5a120fe1a8c309bf50 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/event.rs @@ -0,0 +1,348 @@ +/* TOOD: Implement for other kqueue based systems + */ + +use crate::{Errno, Result}; +#[cfg(not(target_os = "netbsd"))] +use libc::{timespec, time_t, c_int, c_long, intptr_t, uintptr_t}; +#[cfg(target_os = "netbsd")] +use libc::{timespec, time_t, c_long, intptr_t, uintptr_t, size_t}; +use std::convert::TryInto; +use std::os::unix::io::RawFd; +use std::ptr; + +// Redefine kevent in terms of programmer-friendly enums and bitfields. +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct KEvent { + kevent: libc::kevent, +} + +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "openbsd"))] +type type_of_udata = *mut libc::c_void; +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos"))] +type type_of_data = intptr_t; +#[cfg(any(target_os = "netbsd"))] +type type_of_udata = intptr_t; +#[cfg(any(target_os = "netbsd", target_os = "openbsd"))] +type type_of_data = i64; + +#[cfg(target_os = "netbsd")] +type type_of_event_filter = u32; +#[cfg(not(target_os = "netbsd"))] +type type_of_event_filter = i16; +libc_enum! { + #[cfg_attr(target_os = "netbsd", repr(u32))] + #[cfg_attr(not(target_os = "netbsd"), repr(i16))] + #[non_exhaustive] + pub enum EventFilter { + EVFILT_AIO, + /// Returns whenever there is no remaining data in the write buffer + #[cfg(target_os = "freebsd")] + EVFILT_EMPTY, + #[cfg(target_os = "dragonfly")] + EVFILT_EXCEPT, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] + EVFILT_FS, + #[cfg(target_os = "freebsd")] + EVFILT_LIO, + #[cfg(any(target_os = "ios", target_os = "macos"))] + EVFILT_MACHPORT, + EVFILT_PROC, + /// Returns events associated with the process referenced by a given + /// process descriptor, created by `pdfork()`. The events to monitor are: + /// + /// - NOTE_EXIT: the process has exited. The exit status will be stored in data. + #[cfg(target_os = "freebsd")] + EVFILT_PROCDESC, + EVFILT_READ, + /// Returns whenever an asynchronous `sendfile()` call completes. + #[cfg(target_os = "freebsd")] + EVFILT_SENDFILE, + EVFILT_SIGNAL, + EVFILT_TIMER, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] + EVFILT_USER, + #[cfg(any(target_os = "ios", target_os = "macos"))] + EVFILT_VM, + EVFILT_VNODE, + EVFILT_WRITE, + } + impl TryFrom +} + +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "openbsd"))] +pub type type_of_event_flag = u16; +#[cfg(any(target_os = "netbsd"))] +pub type type_of_event_flag = u32; +libc_bitflags!{ + pub struct EventFlag: type_of_event_flag { + EV_ADD; + EV_CLEAR; + EV_DELETE; + EV_DISABLE; + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + EV_DISPATCH; + #[cfg(target_os = "freebsd")] + EV_DROP; + EV_ENABLE; + EV_EOF; + EV_ERROR; + #[cfg(any(target_os = "macos", target_os = "ios"))] + EV_FLAG0; + EV_FLAG1; + #[cfg(target_os = "dragonfly")] + EV_NODATA; + EV_ONESHOT; + #[cfg(any(target_os = "macos", target_os = "ios"))] + EV_OOBAND; + #[cfg(any(target_os = "macos", target_os = "ios"))] + EV_POLL; + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + EV_RECEIPT; + EV_SYSFLAGS; + } +} + +libc_bitflags!( + pub struct FilterFlag: u32 { + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_ABSOLUTE; + NOTE_ATTRIB; + NOTE_CHILD; + NOTE_DELETE; + #[cfg(target_os = "openbsd")] + NOTE_EOF; + NOTE_EXEC; + NOTE_EXIT; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_EXITSTATUS; + NOTE_EXTEND; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFAND; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFCOPY; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFCTRLMASK; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFLAGSMASK; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFNOP; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFOR; + NOTE_FORK; + NOTE_LINK; + NOTE_LOWAT; + #[cfg(target_os = "freebsd")] + NOTE_MSECONDS; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_NONE; + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))] + NOTE_NSECONDS; + #[cfg(target_os = "dragonfly")] + NOTE_OOB; + NOTE_PCTRLMASK; + NOTE_PDATAMASK; + NOTE_RENAME; + NOTE_REVOKE; + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))] + NOTE_SECONDS; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_SIGNAL; + NOTE_TRACK; + NOTE_TRACKERR; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_TRIGGER; + #[cfg(target_os = "openbsd")] + NOTE_TRUNCATE; + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))] + NOTE_USECONDS; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_ERROR; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_PRESSURE; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_PRESSURE_SUDDEN_TERMINATE; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_PRESSURE_TERMINATE; + NOTE_WRITE; + } +); + +pub fn kqueue() -> Result { + let res = unsafe { libc::kqueue() }; + + Errno::result(res) +} + + +// KEvent can't derive Send because on some operating systems, udata is defined +// as a void*. However, KEvent's public API always treats udata as an intptr_t, +// which is safe to Send. +unsafe impl Send for KEvent { +} + +impl KEvent { + pub fn new(ident: uintptr_t, filter: EventFilter, flags: EventFlag, + fflags:FilterFlag, data: intptr_t, udata: intptr_t) -> KEvent { + KEvent { kevent: libc::kevent { + ident, + filter: filter as type_of_event_filter, + flags: flags.bits(), + fflags: fflags.bits(), + data: data as type_of_data, + udata: udata as type_of_udata + } } + } + + pub fn ident(&self) -> uintptr_t { + self.kevent.ident + } + + pub fn filter(&self) -> Result { + self.kevent.filter.try_into() + } + + pub fn flags(&self) -> EventFlag { + EventFlag::from_bits(self.kevent.flags).unwrap() + } + + pub fn fflags(&self) -> FilterFlag { + FilterFlag::from_bits(self.kevent.fflags).unwrap() + } + + pub fn data(&self) -> intptr_t { + self.kevent.data as intptr_t + } + + pub fn udata(&self) -> intptr_t { + self.kevent.udata as intptr_t + } +} + +pub fn kevent(kq: RawFd, + changelist: &[KEvent], + eventlist: &mut [KEvent], + timeout_ms: usize) -> Result { + + // Convert ms to timespec + let timeout = timespec { + tv_sec: (timeout_ms / 1000) as time_t, + tv_nsec: ((timeout_ms % 1000) * 1_000_000) as c_long + }; + + kevent_ts(kq, changelist, eventlist, Some(timeout)) +} + +#[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd"))] +type type_of_nchanges = c_int; +#[cfg(target_os = "netbsd")] +type type_of_nchanges = size_t; + +pub fn kevent_ts(kq: RawFd, + changelist: &[KEvent], + eventlist: &mut [KEvent], + timeout_opt: Option) -> Result { + + let res = unsafe { + libc::kevent( + kq, + changelist.as_ptr() as *const libc::kevent, + changelist.len() as type_of_nchanges, + eventlist.as_mut_ptr() as *mut libc::kevent, + eventlist.len() as type_of_nchanges, + if let Some(ref timeout) = timeout_opt {timeout as *const timespec} else {ptr::null()}) + }; + + Errno::result(res).map(|r| r as usize) +} + +#[inline] +pub fn ev_set(ev: &mut KEvent, + ident: usize, + filter: EventFilter, + flags: EventFlag, + fflags: FilterFlag, + udata: intptr_t) { + + ev.kevent.ident = ident as uintptr_t; + ev.kevent.filter = filter as type_of_event_filter; + ev.kevent.flags = flags.bits(); + ev.kevent.fflags = fflags.bits(); + ev.kevent.data = 0; + ev.kevent.udata = udata as type_of_udata; +} + +#[test] +fn test_struct_kevent() { + use std::mem; + + let udata : intptr_t = 12345; + + let actual = KEvent::new(0xdead_beef, + EventFilter::EVFILT_READ, + EventFlag::EV_ONESHOT | EventFlag::EV_ADD, + FilterFlag::NOTE_CHILD | FilterFlag::NOTE_EXIT, + 0x1337, + udata); + assert_eq!(0xdead_beef, actual.ident()); + let filter = actual.kevent.filter; + assert_eq!(libc::EVFILT_READ, filter); + assert_eq!(libc::EV_ONESHOT | libc::EV_ADD, actual.flags().bits()); + assert_eq!(libc::NOTE_CHILD | libc::NOTE_EXIT, actual.fflags().bits()); + assert_eq!(0x1337, actual.data() as type_of_data); + assert_eq!(udata as type_of_udata, actual.udata() as type_of_udata); + assert_eq!(mem::size_of::(), mem::size_of::()); +} + +#[test] +fn test_kevent_filter() { + let udata : intptr_t = 12345; + + let actual = KEvent::new(0xdead_beef, + EventFilter::EVFILT_READ, + EventFlag::EV_ONESHOT | EventFlag::EV_ADD, + FilterFlag::NOTE_CHILD | FilterFlag::NOTE_EXIT, + 0x1337, + udata); + assert_eq!(EventFilter::EVFILT_READ, actual.filter().unwrap()); +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/eventfd.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/eventfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..c54f952f09a9ead9f04640ce69d374acbcf1bddd --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/eventfd.rs @@ -0,0 +1,17 @@ +use std::os::unix::io::RawFd; +use crate::Result; +use crate::errno::Errno; + +libc_bitflags! { + pub struct EfdFlags: libc::c_int { + EFD_CLOEXEC; // Since Linux 2.6.27 + EFD_NONBLOCK; // Since Linux 2.6.27 + EFD_SEMAPHORE; // Since Linux 2.6.30 + } +} + +pub fn eventfd(initval: libc::c_uint, flags: EfdFlags) -> Result { + let res = unsafe { libc::eventfd(initval, flags.bits()) }; + + Errno::result(res).map(|r| r as RawFd) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/inotify.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/inotify.rs new file mode 100644 index 0000000000000000000000000000000000000000..3f5ae22abc3e2126ea249cab7058fa57f14d9af8 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/inotify.rs @@ -0,0 +1,233 @@ +//! Monitoring API for filesystem events. +//! +//! Inotify is a Linux-only API to monitor filesystems events. +//! +//! For more documentation, please read [inotify(7)](https://man7.org/linux/man-pages/man7/inotify.7.html). +//! +//! # Examples +//! +//! Monitor all events happening in directory "test": +//! ```no_run +//! # use nix::sys::inotify::{AddWatchFlags,InitFlags,Inotify}; +//! # +//! // We create a new inotify instance. +//! let instance = Inotify::init(InitFlags::empty()).unwrap(); +//! +//! // We add a new watch on directory "test" for all events. +//! let wd = instance.add_watch("test", AddWatchFlags::IN_ALL_EVENTS).unwrap(); +//! +//! loop { +//! // We read from our inotify instance for events. +//! let events = instance.read_events().unwrap(); +//! println!("Events: {:?}", events); +//! } +//! ``` + +use libc::{ + c_char, + c_int, +}; +use std::ffi::{OsString,OsStr,CStr}; +use std::os::unix::ffi::OsStrExt; +use std::mem::{MaybeUninit, size_of}; +use std::os::unix::io::{RawFd,AsRawFd,FromRawFd}; +use std::ptr; +use crate::unistd::read; +use crate::Result; +use crate::NixPath; +use crate::errno::Errno; + +libc_bitflags! { + /// Configuration options for [`inotify_add_watch`](fn.inotify_add_watch.html). + pub struct AddWatchFlags: u32 { + IN_ACCESS; + IN_MODIFY; + IN_ATTRIB; + IN_CLOSE_WRITE; + IN_CLOSE_NOWRITE; + IN_OPEN; + IN_MOVED_FROM; + IN_MOVED_TO; + IN_CREATE; + IN_DELETE; + IN_DELETE_SELF; + IN_MOVE_SELF; + + IN_UNMOUNT; + IN_Q_OVERFLOW; + IN_IGNORED; + + IN_CLOSE; + IN_MOVE; + + IN_ONLYDIR; + IN_DONT_FOLLOW; + + IN_ISDIR; + IN_ONESHOT; + IN_ALL_EVENTS; + } +} + +libc_bitflags! { + /// Configuration options for [`inotify_init1`](fn.inotify_init1.html). + pub struct InitFlags: c_int { + IN_CLOEXEC; + IN_NONBLOCK; + } +} + +/// An inotify instance. This is also a file descriptor, you can feed it to +/// other interfaces consuming file descriptors, epoll for example. +#[derive(Debug, Clone, Copy)] +pub struct Inotify { + fd: RawFd +} + +/// This object is returned when you create a new watch on an inotify instance. +/// It is then returned as part of an event once triggered. It allows you to +/// know which watch triggered which event. +#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Ord, PartialOrd)] +pub struct WatchDescriptor { + wd: i32 +} + +/// A single inotify event. +/// +/// For more documentation see, [inotify(7)](https://man7.org/linux/man-pages/man7/inotify.7.html). +#[derive(Debug)] +pub struct InotifyEvent { + /// Watch descriptor. This field corresponds to the watch descriptor you + /// were issued when calling add_watch. It allows you to know which watch + /// this event comes from. + pub wd: WatchDescriptor, + /// Event mask. This field is a bitfield describing the exact event that + /// occured. + pub mask: AddWatchFlags, + /// This cookie is a number that allows you to connect related events. For + /// now only IN_MOVED_FROM and IN_MOVED_TO can be connected. + pub cookie: u32, + /// Filename. This field exists only if the event was triggered for a file + /// inside the watched directory. + pub name: Option +} + +impl Inotify { + /// Initialize a new inotify instance. + /// + /// Returns a Result containing an inotify instance. + /// + /// For more information see, [inotify_init(2)](https://man7.org/linux/man-pages/man2/inotify_init.2.html). + pub fn init(flags: InitFlags) -> Result { + let res = Errno::result(unsafe { + libc::inotify_init1(flags.bits()) + }); + + res.map(|fd| Inotify { fd }) + } + + /// Adds a new watch on the target file or directory. + /// + /// Returns a watch descriptor. This is not a File Descriptor! + /// + /// For more information see, [inotify_add_watch(2)](https://man7.org/linux/man-pages/man2/inotify_add_watch.2.html). + pub fn add_watch(self, + path: &P, + mask: AddWatchFlags) + -> Result + { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::inotify_add_watch(self.fd, cstr.as_ptr(), mask.bits()) + } + })?; + + Errno::result(res).map(|wd| WatchDescriptor { wd }) + } + + /// Removes an existing watch using the watch descriptor returned by + /// inotify_add_watch. + /// + /// Returns an EINVAL error if the watch descriptor is invalid. + /// + /// For more information see, [inotify_rm_watch(2)](https://man7.org/linux/man-pages/man2/inotify_rm_watch.2.html). + #[cfg(target_os = "linux")] + pub fn rm_watch(self, wd: WatchDescriptor) -> Result<()> { + let res = unsafe { libc::inotify_rm_watch(self.fd, wd.wd) }; + + Errno::result(res).map(drop) + } + + #[cfg(target_os = "android")] + pub fn rm_watch(self, wd: WatchDescriptor) -> Result<()> { + let res = unsafe { libc::inotify_rm_watch(self.fd, wd.wd as u32) }; + + Errno::result(res).map(drop) + } + + /// Reads a collection of events from the inotify file descriptor. This call + /// can either be blocking or non blocking depending on whether IN_NONBLOCK + /// was set at initialization. + /// + /// Returns as many events as available. If the call was non blocking and no + /// events could be read then the EAGAIN error is returned. + pub fn read_events(self) -> Result> { + let header_size = size_of::(); + const BUFSIZ: usize = 4096; + let mut buffer = [0u8; BUFSIZ]; + let mut events = Vec::new(); + let mut offset = 0; + + let nread = read(self.fd, &mut buffer)?; + + while (nread - offset) >= header_size { + let event = unsafe { + let mut event = MaybeUninit::::uninit(); + ptr::copy_nonoverlapping( + buffer.as_ptr().add(offset), + event.as_mut_ptr() as *mut u8, + (BUFSIZ - offset).min(header_size) + ); + event.assume_init() + }; + + let name = match event.len { + 0 => None, + _ => { + let ptr = unsafe { + buffer + .as_ptr() + .add(offset + header_size) + as *const c_char + }; + let cstr = unsafe { CStr::from_ptr(ptr) }; + + Some(OsStr::from_bytes(cstr.to_bytes()).to_owned()) + } + }; + + events.push(InotifyEvent { + wd: WatchDescriptor { wd: event.wd }, + mask: AddWatchFlags::from_bits_truncate(event.mask), + cookie: event.cookie, + name + }); + + offset += header_size + event.len as usize; + } + + Ok(events) + } +} + +impl AsRawFd for Inotify { + fn as_raw_fd(&self) -> RawFd { + self.fd + } +} + +impl FromRawFd for Inotify { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + Inotify { fd } + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/ioctl/bsd.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/ioctl/bsd.rs new file mode 100644 index 0000000000000000000000000000000000000000..4ce4d332a82696b40de169accd77618f3178de98 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/ioctl/bsd.rs @@ -0,0 +1,109 @@ +/// The datatype used for the ioctl number +#[doc(hidden)] +#[cfg(not(target_os = "illumos"))] +pub type ioctl_num_type = ::libc::c_ulong; + +#[doc(hidden)] +#[cfg(target_os = "illumos")] +pub type ioctl_num_type = ::libc::c_int; + +/// The datatype used for the 3rd argument +#[doc(hidden)] +pub type ioctl_param_type = ::libc::c_int; + +mod consts { + use crate::sys::ioctl::ioctl_num_type; + #[doc(hidden)] + pub const VOID: ioctl_num_type = 0x2000_0000; + #[doc(hidden)] + pub const OUT: ioctl_num_type = 0x4000_0000; + #[doc(hidden)] + #[allow(overflowing_literals)] + pub const IN: ioctl_num_type = 0x8000_0000; + #[doc(hidden)] + pub const INOUT: ioctl_num_type = IN|OUT; + #[doc(hidden)] + pub const IOCPARM_MASK: ioctl_num_type = 0x1fff; +} + +pub use self::consts::*; + +#[macro_export] +#[doc(hidden)] +macro_rules! ioc { + ($inout:expr, $group:expr, $num:expr, $len:expr) => ( + $inout | (($len as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::IOCPARM_MASK) << 16) | (($group as $crate::sys::ioctl::ioctl_num_type) << 8) | ($num as $crate::sys::ioctl::ioctl_num_type) + ) +} + +/// Generate an ioctl request code for a command that passes no data. +/// +/// This is equivalent to the `_IO()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_none!()` directly. +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const KVMIO: u8 = 0xAE; +/// ioctl_write_int_bad!(kvm_create_vm, request_code_none!(KVMIO, 0x03)); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! request_code_none { + ($g:expr, $n:expr) => (ioc!($crate::sys::ioctl::VOID, $g, $n, 0)) +} + +/// Generate an ioctl request code for a command that passes an integer +/// +/// This is equivalent to the `_IOWINT()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_write_int!()` directly. +#[macro_export(local_inner_macros)] +macro_rules! request_code_write_int { + ($g:expr, $n:expr) => (ioc!($crate::sys::ioctl::VOID, $g, $n, ::std::mem::size_of::<$crate::libc::c_int>())) +} + +/// Generate an ioctl request code for a command that reads. +/// +/// This is equivalent to the `_IOR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_read!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is reading and the kernel is +/// writing. +#[macro_export(local_inner_macros)] +macro_rules! request_code_read { + ($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::OUT, $g, $n, $len)) +} + +/// Generate an ioctl request code for a command that writes. +/// +/// This is equivalent to the `_IOW()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_write!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is writing and the kernel is +/// reading. +#[macro_export(local_inner_macros)] +macro_rules! request_code_write { + ($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::IN, $g, $n, $len)) +} + +/// Generate an ioctl request code for a command that reads and writes. +/// +/// This is equivalent to the `_IOWR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_readwrite!()` directly. +#[macro_export(local_inner_macros)] +macro_rules! request_code_readwrite { + ($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::INOUT, $g, $n, $len)) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/ioctl/linux.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/ioctl/linux.rs new file mode 100644 index 0000000000000000000000000000000000000000..68ebaba9bf4965b32a2fdc3d1e6b983187d5d059 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/ioctl/linux.rs @@ -0,0 +1,141 @@ +/// The datatype used for the ioctl number +#[cfg(any(target_os = "android", target_env = "musl"))] +#[doc(hidden)] +pub type ioctl_num_type = ::libc::c_int; +#[cfg(not(any(target_os = "android", target_env = "musl")))] +#[doc(hidden)] +pub type ioctl_num_type = ::libc::c_ulong; +/// The datatype used for the 3rd argument +#[doc(hidden)] +pub type ioctl_param_type = ::libc::c_ulong; + +#[doc(hidden)] +pub const NRBITS: ioctl_num_type = 8; +#[doc(hidden)] +pub const TYPEBITS: ioctl_num_type = 8; + +#[cfg(any(target_arch = "mips", target_arch = "mips64", target_arch = "powerpc", target_arch = "powerpc64", target_arch = "sparc64"))] +mod consts { + #[doc(hidden)] + pub const NONE: u8 = 1; + #[doc(hidden)] + pub const READ: u8 = 2; + #[doc(hidden)] + pub const WRITE: u8 = 4; + #[doc(hidden)] + pub const SIZEBITS: u8 = 13; + #[doc(hidden)] + pub const DIRBITS: u8 = 3; +} + +// "Generic" ioctl protocol +#[cfg(any(target_arch = "x86", + target_arch = "arm", + target_arch = "s390x", + target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "riscv64"))] +mod consts { + #[doc(hidden)] + pub const NONE: u8 = 0; + #[doc(hidden)] + pub const READ: u8 = 2; + #[doc(hidden)] + pub const WRITE: u8 = 1; + #[doc(hidden)] + pub const SIZEBITS: u8 = 14; + #[doc(hidden)] + pub const DIRBITS: u8 = 2; +} + +pub use self::consts::*; + +#[doc(hidden)] +pub const NRSHIFT: ioctl_num_type = 0; +#[doc(hidden)] +pub const TYPESHIFT: ioctl_num_type = NRSHIFT + NRBITS as ioctl_num_type; +#[doc(hidden)] +pub const SIZESHIFT: ioctl_num_type = TYPESHIFT + TYPEBITS as ioctl_num_type; +#[doc(hidden)] +pub const DIRSHIFT: ioctl_num_type = SIZESHIFT + SIZEBITS as ioctl_num_type; + +#[doc(hidden)] +pub const NRMASK: ioctl_num_type = (1 << NRBITS) - 1; +#[doc(hidden)] +pub const TYPEMASK: ioctl_num_type = (1 << TYPEBITS) - 1; +#[doc(hidden)] +pub const SIZEMASK: ioctl_num_type = (1 << SIZEBITS) - 1; +#[doc(hidden)] +pub const DIRMASK: ioctl_num_type = (1 << DIRBITS) - 1; + +/// Encode an ioctl command. +#[macro_export] +#[doc(hidden)] +macro_rules! ioc { + ($dir:expr, $ty:expr, $nr:expr, $sz:expr) => ( + (($dir as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::DIRMASK) << $crate::sys::ioctl::DIRSHIFT) | + (($ty as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::TYPEMASK) << $crate::sys::ioctl::TYPESHIFT) | + (($nr as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::NRMASK) << $crate::sys::ioctl::NRSHIFT) | + (($sz as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::SIZEMASK) << $crate::sys::ioctl::SIZESHIFT)) +} + +/// Generate an ioctl request code for a command that passes no data. +/// +/// This is equivalent to the `_IO()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_none!()` directly. +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const KVMIO: u8 = 0xAE; +/// ioctl_write_int_bad!(kvm_create_vm, request_code_none!(KVMIO, 0x03)); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! request_code_none { + ($ty:expr, $nr:expr) => (ioc!($crate::sys::ioctl::NONE, $ty, $nr, 0)) +} + +/// Generate an ioctl request code for a command that reads. +/// +/// This is equivalent to the `_IOR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_read!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is reading and the kernel is +/// writing. +#[macro_export(local_inner_macros)] +macro_rules! request_code_read { + ($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::READ, $ty, $nr, $sz)) +} + +/// Generate an ioctl request code for a command that writes. +/// +/// This is equivalent to the `_IOW()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_write!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is writing and the kernel is +/// reading. +#[macro_export(local_inner_macros)] +macro_rules! request_code_write { + ($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::WRITE, $ty, $nr, $sz)) +} + +/// Generate an ioctl request code for a command that reads and writes. +/// +/// This is equivalent to the `_IOWR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_readwrite!()` directly. +#[macro_export(local_inner_macros)] +macro_rules! request_code_readwrite { + ($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::READ | $crate::sys::ioctl::WRITE, $ty, $nr, $sz)) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/ioctl/mod.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/ioctl/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..203b7d06f31f116f68bc3757bd6b4ae3ae07195e --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/ioctl/mod.rs @@ -0,0 +1,778 @@ +//! Provide helpers for making ioctl system calls. +//! +//! This library is pretty low-level and messy. `ioctl` is not fun. +//! +//! What is an `ioctl`? +//! =================== +//! +//! The `ioctl` syscall is the grab-bag syscall on POSIX systems. Don't want to add a new +//! syscall? Make it an `ioctl`! `ioctl` refers to both the syscall, and the commands that can be +//! sent with it. `ioctl` stands for "IO control", and the commands are always sent to a file +//! descriptor. +//! +//! It is common to see `ioctl`s used for the following purposes: +//! +//! * Provide read/write access to out-of-band data related to a device such as configuration +//! (for instance, setting serial port options) +//! * Provide a mechanism for performing full-duplex data transfers (for instance, xfer on SPI +//! devices). +//! * Provide access to control functions on a device (for example, on Linux you can send +//! commands like pause, resume, and eject to the CDROM device. +//! * Do whatever else the device driver creator thought made most sense. +//! +//! `ioctl`s are synchronous system calls and are similar to read and write calls in that regard. +//! They operate on file descriptors and have an identifier that specifies what the ioctl is. +//! Additionally they may read or write data and therefore need to pass along a data pointer. +//! Besides the semantics of the ioctls being confusing, the generation of this identifer can also +//! be difficult. +//! +//! Historically `ioctl` numbers were arbitrary hard-coded values. In Linux (before 2.6) and some +//! unices this has changed to a more-ordered system where the ioctl numbers are partitioned into +//! subcomponents (For linux this is documented in +//! [`Documentation/ioctl/ioctl-number.rst`](https://elixir.bootlin.com/linux/latest/source/Documentation/userspace-api/ioctl/ioctl-number.rst)): +//! +//! * Number: The actual ioctl ID +//! * Type: A grouping of ioctls for a common purpose or driver +//! * Size: The size in bytes of the data that will be transferred +//! * Direction: Whether there is any data and if it's read, write, or both +//! +//! Newer drivers should not generate complete integer identifiers for their `ioctl`s instead +//! preferring to use the 4 components above to generate the final ioctl identifier. Because of +//! how old `ioctl`s are, however, there are many hard-coded `ioctl` identifiers. These are +//! commonly referred to as "bad" in `ioctl` documentation. +//! +//! Defining `ioctl`s +//! ================= +//! +//! This library provides several `ioctl_*!` macros for binding `ioctl`s. These generate public +//! unsafe functions that can then be used for calling the ioctl. This macro has a few different +//! ways it can be used depending on the specific ioctl you're working with. +//! +//! A simple `ioctl` is `SPI_IOC_RD_MODE`. This ioctl works with the SPI interface on Linux. This +//! specific `ioctl` reads the mode of the SPI device as a `u8`. It's declared in +//! `/include/uapi/linux/spi/spidev.h` as `_IOR(SPI_IOC_MAGIC, 1, __u8)`. Since it uses the `_IOR` +//! macro, we know it's a `read` ioctl and can use the `ioctl_read!` macro as follows: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +//! const SPI_IOC_TYPE_MODE: u8 = 1; +//! ioctl_read!(spi_read_mode, SPI_IOC_MAGIC, SPI_IOC_TYPE_MODE, u8); +//! # fn main() {} +//! ``` +//! +//! This generates the function: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # use std::mem; +//! # use nix::{libc, Result}; +//! # use nix::errno::Errno; +//! # use nix::libc::c_int as c_int; +//! # const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +//! # const SPI_IOC_TYPE_MODE: u8 = 1; +//! pub unsafe fn spi_read_mode(fd: c_int, data: *mut u8) -> Result { +//! let res = libc::ioctl(fd, request_code_read!(SPI_IOC_MAGIC, SPI_IOC_TYPE_MODE, mem::size_of::()), data); +//! Errno::result(res) +//! } +//! # fn main() {} +//! ``` +//! +//! The return value for the wrapper functions generated by the `ioctl_*!` macros are `nix::Error`s. +//! These are generated by assuming the return value of the ioctl is `-1` on error and everything +//! else is a valid return value. If this is not the case, `Result::map` can be used to map some +//! of the range of "good" values (-Inf..-2, 0..Inf) into a smaller range in a helper function. +//! +//! Writing `ioctl`s generally use pointers as their data source and these should use the +//! `ioctl_write_ptr!`. But in some cases an `int` is passed directly. For these `ioctl`s use the +//! `ioctl_write_int!` macro. This variant does not take a type as the last argument: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! const HCI_IOC_MAGIC: u8 = b'k'; +//! const HCI_IOC_HCIDEVUP: u8 = 1; +//! ioctl_write_int!(hci_dev_up, HCI_IOC_MAGIC, HCI_IOC_HCIDEVUP); +//! # fn main() {} +//! ``` +//! +//! Some `ioctl`s don't transfer any data, and those should use `ioctl_none!`. This macro +//! doesn't take a type and so it is declared similar to the `write_int` variant shown above. +//! +//! The mode for a given `ioctl` should be clear from the documentation if it has good +//! documentation. Otherwise it will be clear based on the macro used to generate the `ioctl` +//! number where `_IO`, `_IOR`, `_IOW`, and `_IOWR` map to "none", "read", "write_*", and "readwrite" +//! respectively. To determine the specific `write_` variant to use you'll need to find +//! what the argument type is supposed to be. If it's an `int`, then `write_int` should be used, +//! otherwise it should be a pointer and `write_ptr` should be used. On Linux the +//! [`ioctl_list` man page](https://man7.org/linux/man-pages/man2/ioctl_list.2.html) describes a +//! large number of `ioctl`s and describes their argument data type. +//! +//! Using "bad" `ioctl`s +//! -------------------- +//! +//! As mentioned earlier, there are many old `ioctl`s that do not use the newer method of +//! generating `ioctl` numbers and instead use hardcoded values. These can be used with the +//! `ioctl_*_bad!` macros. This naming comes from the Linux kernel which refers to these +//! `ioctl`s as "bad". These are a different variant as they bypass calling the macro that generates +//! the ioctl number and instead use the defined value directly. +//! +//! For example the `TCGETS` `ioctl` reads a `termios` data structure for a given file descriptor. +//! It's defined as `0x5401` in `ioctls.h` on Linux and can be implemented as: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # #[cfg(any(target_os = "android", target_os = "linux"))] +//! # use nix::libc::TCGETS as TCGETS; +//! # #[cfg(any(target_os = "android", target_os = "linux"))] +//! # use nix::libc::termios as termios; +//! # #[cfg(any(target_os = "android", target_os = "linux"))] +//! ioctl_read_bad!(tcgets, TCGETS, termios); +//! # fn main() {} +//! ``` +//! +//! The generated function has the same form as that generated by `ioctl_read!`: +//! +//! ```text +//! pub unsafe fn tcgets(fd: c_int, data: *mut termios) -> Result; +//! ``` +//! +//! Working with Arrays +//! ------------------- +//! +//! Some `ioctl`s work with entire arrays of elements. These are supported by the `ioctl_*_buf` +//! family of macros: `ioctl_read_buf`, `ioctl_write_buf`, and `ioctl_readwrite_buf`. Note that +//! there are no "bad" versions for working with buffers. The generated functions include a `len` +//! argument to specify the number of elements (where the type of each element is specified in the +//! macro). +//! +//! Again looking to the SPI `ioctl`s on Linux for an example, there is a `SPI_IOC_MESSAGE` `ioctl` +//! that queues up multiple SPI messages by writing an entire array of `spi_ioc_transfer` structs. +//! `linux/spi/spidev.h` defines a macro to calculate the `ioctl` number like: +//! +//! ```C +//! #define SPI_IOC_MAGIC 'k' +//! #define SPI_MSGSIZE(N) ... +//! #define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)]) +//! ``` +//! +//! The `SPI_MSGSIZE(N)` calculation is already handled by the `ioctl_*!` macros, so all that's +//! needed to define this `ioctl` is: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +//! const SPI_IOC_TYPE_MESSAGE: u8 = 0; +//! # pub struct spi_ioc_transfer(u64); +//! ioctl_write_buf!(spi_transfer, SPI_IOC_MAGIC, SPI_IOC_TYPE_MESSAGE, spi_ioc_transfer); +//! # fn main() {} +//! ``` +//! +//! This generates a function like: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # use std::mem; +//! # use nix::{libc, Result}; +//! # use nix::errno::Errno; +//! # use nix::libc::c_int as c_int; +//! # const SPI_IOC_MAGIC: u8 = b'k'; +//! # const SPI_IOC_TYPE_MESSAGE: u8 = 0; +//! # pub struct spi_ioc_transfer(u64); +//! pub unsafe fn spi_message(fd: c_int, data: &mut [spi_ioc_transfer]) -> Result { +//! let res = libc::ioctl(fd, +//! request_code_write!(SPI_IOC_MAGIC, SPI_IOC_TYPE_MESSAGE, data.len() * mem::size_of::()), +//! data); +//! Errno::result(res) +//! } +//! # fn main() {} +//! ``` +//! +//! Finding `ioctl` Documentation +//! ----------------------------- +//! +//! For Linux, look at your system's headers. For example, `/usr/include/linux/input.h` has a lot +//! of lines defining macros which use `_IO`, `_IOR`, `_IOW`, `_IOC`, and `_IOWR`. Some `ioctl`s are +//! documented directly in the headers defining their constants, but others have more extensive +//! documentation in man pages (like termios' `ioctl`s which are in `tty_ioctl(4)`). +//! +//! Documenting the Generated Functions +//! =================================== +//! +//! In many cases, users will wish for the functions generated by the `ioctl` +//! macro to be public and documented. For this reason, the generated functions +//! are public by default. If you wish to hide the ioctl, you will need to put +//! them in a private module. +//! +//! For documentation, it is possible to use doc comments inside the `ioctl_*!` macros. Here is an +//! example : +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # use nix::libc::c_int; +//! ioctl_read! { +//! /// Make the given terminal the controlling terminal of the calling process. The calling +//! /// process must be a session leader and not have a controlling terminal already. If the +//! /// terminal is already the controlling terminal of a different session group then the +//! /// ioctl will fail with **EPERM**, unless the caller is root (more precisely: has the +//! /// **CAP_SYS_ADMIN** capability) and arg equals 1, in which case the terminal is stolen +//! /// and all processes that had it as controlling terminal lose it. +//! tiocsctty, b't', 19, c_int +//! } +//! +//! # fn main() {} +//! ``` +use cfg_if::cfg_if; + +#[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] +#[macro_use] +mod linux; + +#[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] +pub use self::linux::*; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +#[macro_use] +mod bsd; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +pub use self::bsd::*; + +/// Convert raw ioctl return value to a Nix result +#[macro_export] +#[doc(hidden)] +macro_rules! convert_ioctl_res { + ($w:expr) => ( + { + $crate::errno::Errno::result($w) + } + ); +} + +/// Generates a wrapper function for an ioctl that passes no data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// The `videodev2` driver on Linux defines the `log_status` `ioctl` as: +/// +/// ```C +/// #define VIDIOC_LOG_STATUS _IO('V', 70) +/// ``` +/// +/// This can be implemented in Rust like: +/// +/// ```no_run +/// # #[macro_use] extern crate nix; +/// ioctl_none!(log_status, b'V', 70); +/// fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_none { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_none!($ioty, $nr) as $crate::sys::ioctl::ioctl_num_type)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that passes no data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ```no_run +/// # #[macro_use] extern crate nix; +/// # use libc::TIOCNXCL; +/// # use std::fs::File; +/// # use std::os::unix::io::AsRawFd; +/// ioctl_none_bad!(tiocnxcl, TIOCNXCL); +/// fn main() { +/// let file = File::open("/dev/ttyUSB0").unwrap(); +/// unsafe { tiocnxcl(file.as_raw_fd()) }.unwrap(); +/// } +/// ``` +// TODO: add an example using request_code_*!() +#[macro_export(local_inner_macros)] +macro_rules! ioctl_none_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads data from the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +/// const SPI_IOC_TYPE_MODE: u8 = 1; +/// ioctl_read!(spi_read_mode, SPI_IOC_MAGIC, SPI_IOC_TYPE_MODE, u8); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_read { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_read!($ioty, $nr, ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that reads data from the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # #[cfg(any(target_os = "android", target_os = "linux"))] +/// ioctl_read_bad!(tcgets, libc::TCGETS, libc::termios); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_read_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that writes data through a pointer to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *const DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # pub struct v4l2_audio {} +/// ioctl_write_ptr!(s_audio, b'V', 34, v4l2_audio); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_ptr { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *const $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write!($ioty, $nr, ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that writes data through a pointer to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *const DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # #[cfg(any(target_os = "android", target_os = "linux"))] +/// ioctl_write_ptr_bad!(tcsets, libc::TCSETS, libc::termios); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_ptr_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *const $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +cfg_if!{ + if #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] { + /// Generates a wrapper function for a ioctl that writes an integer to the kernel. + /// + /// The arguments to this macro are: + /// + /// * The function name + /// * The ioctl identifier + /// * The ioctl sequence number + /// + /// The generated function has the following signature: + /// + /// ```rust,ignore + /// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: nix::sys::ioctl::ioctl_param_type) -> Result + /// ``` + /// + /// `nix::sys::ioctl::ioctl_param_type` depends on the OS: + /// * BSD - `libc::c_int` + /// * Linux - `libc::c_ulong` + /// + /// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). + /// + /// # Example + /// + /// ``` + /// # #[macro_use] extern crate nix; + /// ioctl_write_int!(vt_activate, b'v', 4); + /// # fn main() {} + /// ``` + #[macro_export(local_inner_macros)] + macro_rules! ioctl_write_int { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: $crate::sys::ioctl::ioctl_param_type) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write_int!($ioty, $nr) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) + } + } else { + /// Generates a wrapper function for a ioctl that writes an integer to the kernel. + /// + /// The arguments to this macro are: + /// + /// * The function name + /// * The ioctl identifier + /// * The ioctl sequence number + /// + /// The generated function has the following signature: + /// + /// ```rust,ignore + /// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: nix::sys::ioctl::ioctl_param_type) -> Result + /// ``` + /// + /// `nix::sys::ioctl::ioctl_param_type` depends on the OS: + /// * BSD - `libc::c_int` + /// * Linux - `libc::c_ulong` + /// + /// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). + /// + /// # Example + /// + /// ``` + /// # #[macro_use] extern crate nix; + /// const HCI_IOC_MAGIC: u8 = b'k'; + /// const HCI_IOC_HCIDEVUP: u8 = 1; + /// ioctl_write_int!(hci_dev_up, HCI_IOC_MAGIC, HCI_IOC_HCIDEVUP); + /// # fn main() {} + /// ``` + #[macro_export(local_inner_macros)] + macro_rules! ioctl_write_int { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: $crate::sys::ioctl::ioctl_param_type) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write!($ioty, $nr, ::std::mem::size_of::<$crate::libc::c_int>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) + } + } +} + +/// Generates a wrapper function for a "bad" ioctl that writes an integer to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: libc::c_int) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Examples +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # #[cfg(any(target_os = "android", target_os = "linux"))] +/// ioctl_write_int_bad!(tcsbrk, libc::TCSBRK); +/// # fn main() {} +/// ``` +/// +/// ```rust +/// # #[macro_use] extern crate nix; +/// const KVMIO: u8 = 0xAE; +/// ioctl_write_int_bad!(kvm_create_vm, request_code_none!(KVMIO, 0x03)); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_int_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: $crate::libc::c_int) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads and writes data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # pub struct v4l2_audio {} +/// ioctl_readwrite!(enum_audio, b'V', 65, v4l2_audio); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_readwrite { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_readwrite!($ioty, $nr, ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that reads and writes data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +// TODO: Find an example for ioctl_readwrite_bad +#[macro_export(local_inner_macros)] +macro_rules! ioctl_readwrite_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads an array of elements from the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: &mut [DATA_TYPE]) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +// TODO: Find an example for ioctl_read_buf +#[macro_export(local_inner_macros)] +macro_rules! ioctl_read_buf { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: &mut [$ty]) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_read!($ioty, $nr, data.len() * ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that writes an array of elements to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: &[DATA_TYPE]) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Examples +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +/// const SPI_IOC_TYPE_MESSAGE: u8 = 0; +/// # pub struct spi_ioc_transfer(u64); +/// ioctl_write_buf!(spi_transfer, SPI_IOC_MAGIC, SPI_IOC_TYPE_MESSAGE, spi_ioc_transfer); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_buf { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: &[$ty]) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write!($ioty, $nr, data.len() * ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads and writes an array of elements to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: &mut [DATA_TYPE]) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +// TODO: Find an example for readwrite_buf +#[macro_export(local_inner_macros)] +macro_rules! ioctl_readwrite_buf { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: &mut [$ty]) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_readwrite!($ioty, $nr, data.len() * ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/memfd.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/memfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..642676b431d07fbae2588b6239f003ad3027f425 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/memfd.rs @@ -0,0 +1,47 @@ +//! Interfaces for managing memory-backed files. + +use std::os::unix::io::RawFd; +use crate::Result; +use crate::errno::Errno; +use std::ffi::CStr; + +libc_bitflags!( + /// Options that change the behavior of [`memfd_create`]. + pub struct MemFdCreateFlag: libc::c_uint { + /// Set the close-on-exec ([`FD_CLOEXEC`]) flag on the new file descriptor. + /// + /// By default, the new file descriptor is set to remain open across an [`execve`] + /// (the `FD_CLOEXEC` flag is initially disabled). This flag can be used to change + /// this default. The file offset is set to the beginning of the file (see [`lseek`]). + /// + /// See also the description of the `O_CLOEXEC` flag in [`open(2)`]. + /// + /// [`execve`]: crate::unistd::execve + /// [`lseek`]: crate::unistd::lseek + /// [`FD_CLOEXEC`]: crate::fcntl::FdFlag::FD_CLOEXEC + /// [`open(2)`]: https://man7.org/linux/man-pages/man2/open.2.html + MFD_CLOEXEC; + /// Allow sealing operations on this file. + /// + /// See also the file sealing notes given in [`memfd_create(2)`]. + /// + /// [`memfd_create(2)`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html + MFD_ALLOW_SEALING; + } +); + +/// Creates an anonymous file that lives in memory, and return a file-descriptor to it. +/// +/// The file behaves like a regular file, and so can be modified, truncated, memory-mapped, and so on. +/// However, unlike a regular file, it lives in RAM and has a volatile backing storage. +/// +/// For more information, see [`memfd_create(2)`]. +/// +/// [`memfd_create(2)`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html +pub fn memfd_create(name: &CStr, flags: MemFdCreateFlag) -> Result { + let res = unsafe { + libc::syscall(libc::SYS_memfd_create, name.as_ptr(), flags.bits()) + }; + + Errno::result(res).map(|r| r as RawFd) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/mman.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/mman.rs new file mode 100644 index 0000000000000000000000000000000000000000..0ef1ca8a4f13ecc00bf6f9fd2d519ae4372738b4 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/mman.rs @@ -0,0 +1,489 @@ +//! Memory management declarations. + +use crate::Result; +#[cfg(not(target_os = "android"))] +use crate::NixPath; +use crate::errno::Errno; +#[cfg(not(target_os = "android"))] +use crate::fcntl::OFlag; +use libc::{self, c_int, c_void, size_t, off_t}; +#[cfg(not(target_os = "android"))] +use crate::sys::stat::Mode; +use std::os::unix::io::RawFd; + +libc_bitflags!{ + /// Desired memory protection of a memory mapping. + pub struct ProtFlags: c_int { + /// Pages cannot be accessed. + PROT_NONE; + /// Pages can be read. + PROT_READ; + /// Pages can be written. + PROT_WRITE; + /// Pages can be executed + PROT_EXEC; + /// Apply protection up to the end of a mapping that grows upwards. + #[cfg(any(target_os = "android", target_os = "linux"))] + PROT_GROWSDOWN; + /// Apply protection down to the beginning of a mapping that grows downwards. + #[cfg(any(target_os = "android", target_os = "linux"))] + PROT_GROWSUP; + } +} + +libc_bitflags!{ + /// Additional parameters for [`mmap`]. + pub struct MapFlags: c_int { + /// Compatibility flag. Ignored. + MAP_FILE; + /// Share this mapping. Mutually exclusive with `MAP_PRIVATE`. + MAP_SHARED; + /// Create a private copy-on-write mapping. Mutually exclusive with `MAP_SHARED`. + MAP_PRIVATE; + /// Place the mapping at exactly the address specified in `addr`. + MAP_FIXED; + /// To be used with `MAP_FIXED`, to forbid the system + /// to select a different address than the one specified. + #[cfg(target_os = "freebsd")] + MAP_EXCL; + /// Synonym for `MAP_ANONYMOUS`. + MAP_ANON; + /// The mapping is not backed by any file. + MAP_ANONYMOUS; + /// Put the mapping into the first 2GB of the process address space. + #[cfg(any(all(any(target_os = "android", target_os = "linux"), + any(target_arch = "x86", target_arch = "x86_64")), + all(target_os = "linux", target_env = "musl", any(target_arch = "x86", target_arch = "x86_64")), + all(target_os = "freebsd", target_pointer_width = "64")))] + MAP_32BIT; + /// Used for stacks; indicates to the kernel that the mapping should extend downward in memory. + #[cfg(any(target_os = "android", target_os = "linux"))] + MAP_GROWSDOWN; + /// Compatibility flag. Ignored. + #[cfg(any(target_os = "android", target_os = "linux"))] + MAP_DENYWRITE; + /// Compatibility flag. Ignored. + #[cfg(any(target_os = "android", target_os = "linux"))] + MAP_EXECUTABLE; + /// Mark the mmaped region to be locked in the same way as `mlock(2)`. + #[cfg(any(target_os = "android", target_os = "linux"))] + MAP_LOCKED; + /// Do not reserve swap space for this mapping. + /// + /// This was removed in FreeBSD 11 and is unused in DragonFlyBSD. + #[cfg(not(any(target_os = "dragonfly", target_os = "freebsd")))] + MAP_NORESERVE; + /// Populate page tables for a mapping. + #[cfg(any(target_os = "android", target_os = "linux"))] + MAP_POPULATE; + /// Only meaningful when used with `MAP_POPULATE`. Don't perform read-ahead. + #[cfg(any(target_os = "android", target_os = "linux"))] + MAP_NONBLOCK; + /// Allocate the mapping using "huge pages." + #[cfg(any(target_os = "android", target_os = "linux"))] + MAP_HUGETLB; + /// Make use of 64KB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_64KB; + /// Make use of 512KB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_512KB; + /// Make use of 1MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_1MB; + /// Make use of 2MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_2MB; + /// Make use of 8MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_8MB; + /// Make use of 16MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_16MB; + /// Make use of 32MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_32MB; + /// Make use of 256MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_256MB; + /// Make use of 512MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_512MB; + /// Make use of 1GB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_1GB; + /// Make use of 2GB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_2GB; + /// Make use of 16GB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + MAP_HUGE_16GB; + + /// Lock the mapped region into memory as with `mlock(2)`. + #[cfg(target_os = "netbsd")] + MAP_WIRED; + /// Causes dirtied data in the specified range to be flushed to disk only when necessary. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + MAP_NOSYNC; + /// Rename private pages to a file. + /// + /// This was removed in FreeBSD 11 and is unused in DragonFlyBSD. + #[cfg(any(target_os = "netbsd", target_os = "openbsd"))] + MAP_RENAME; + /// Region may contain semaphores. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))] + MAP_HASSEMAPHORE; + /// Region grows down, like a stack. + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux", target_os = "openbsd"))] + MAP_STACK; + /// Pages in this mapping are not retained in the kernel's memory cache. + #[cfg(any(target_os = "ios", target_os = "macos"))] + MAP_NOCACHE; + /// Allows the W/X bit on the page, it's necessary on aarch64 architecture. + #[cfg(any(target_os = "ios", target_os = "macos"))] + MAP_JIT; + /// Allows to use large pages, underlying alignment based on size. + #[cfg(target_os = "freebsd")] + MAP_ALIGNED_SUPER; + /// Pages will be discarded in the core dumps. + #[cfg(target_os = "openbsd")] + MAP_CONCEAL; + } +} + +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +libc_bitflags!{ + /// Options for [`mremap`]. + pub struct MRemapFlags: c_int { + /// Permit the kernel to relocate the mapping to a new virtual address, if necessary. + #[cfg(target_os = "linux")] + MREMAP_MAYMOVE; + /// Place the mapping at exactly the address specified in `new_address`. + #[cfg(target_os = "linux")] + MREMAP_FIXED; + /// Permits to use the old and new address as hints to relocate the mapping. + #[cfg(target_os = "netbsd")] + MAP_FIXED; + /// Allows to duplicate the mapping to be able to apply different flags on the copy. + #[cfg(target_os = "netbsd")] + MAP_REMAPDUP; + } +} + +libc_enum!{ + /// Usage information for a range of memory to allow for performance optimizations by the kernel. + /// + /// Used by [`madvise`]. + #[repr(i32)] + #[non_exhaustive] + pub enum MmapAdvise { + /// No further special treatment. This is the default. + MADV_NORMAL, + /// Expect random page references. + MADV_RANDOM, + /// Expect sequential page references. + MADV_SEQUENTIAL, + /// Expect access in the near future. + MADV_WILLNEED, + /// Do not expect access in the near future. + MADV_DONTNEED, + /// Free up a given range of pages and its associated backing store. + #[cfg(any(target_os = "android", target_os = "linux"))] + MADV_REMOVE, + /// Do not make pages in this range available to the child after a `fork(2)`. + #[cfg(any(target_os = "android", target_os = "linux"))] + MADV_DONTFORK, + /// Undo the effect of `MADV_DONTFORK`. + #[cfg(any(target_os = "android", target_os = "linux"))] + MADV_DOFORK, + /// Poison the given pages. + /// + /// Subsequent references to those pages are treated like hardware memory corruption. + #[cfg(any(target_os = "android", target_os = "linux"))] + MADV_HWPOISON, + /// Enable Kernel Samepage Merging (KSM) for the given pages. + #[cfg(any(target_os = "android", target_os = "linux"))] + MADV_MERGEABLE, + /// Undo the effect of `MADV_MERGEABLE` + #[cfg(any(target_os = "android", target_os = "linux"))] + MADV_UNMERGEABLE, + /// Preserve the memory of each page but offline the original page. + #[cfg(any(target_os = "android", + all(target_os = "linux", any( + target_arch = "aarch64", + target_arch = "arm", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "s390x", + target_arch = "x86", + target_arch = "x86_64", + target_arch = "sparc64"))))] + MADV_SOFT_OFFLINE, + /// Enable Transparent Huge Pages (THP) for pages in the given range. + #[cfg(any(target_os = "android", target_os = "linux"))] + MADV_HUGEPAGE, + /// Undo the effect of `MADV_HUGEPAGE`. + #[cfg(any(target_os = "android", target_os = "linux"))] + MADV_NOHUGEPAGE, + /// Exclude the given range from a core dump. + #[cfg(any(target_os = "android", target_os = "linux"))] + MADV_DONTDUMP, + /// Undo the effect of an earlier `MADV_DONTDUMP`. + #[cfg(any(target_os = "android", target_os = "linux"))] + MADV_DODUMP, + /// Specify that the application no longer needs the pages in the given range. + MADV_FREE, + /// Request that the system not flush the current range to disk unless it needs to. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + MADV_NOSYNC, + /// Undoes the effects of `MADV_NOSYNC` for any future pages dirtied within the given range. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + MADV_AUTOSYNC, + /// Region is not included in a core file. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + MADV_NOCORE, + /// Include region in a core file + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + MADV_CORE, + #[cfg(any(target_os = "freebsd"))] + MADV_PROTECT, + /// Invalidate the hardware page table for the given region. + #[cfg(target_os = "dragonfly")] + MADV_INVAL, + /// Set the offset of the page directory page to `value` for the virtual page table. + #[cfg(target_os = "dragonfly")] + MADV_SETMAP, + /// Indicates that the application will not need the data in the given range. + #[cfg(any(target_os = "ios", target_os = "macos"))] + MADV_ZERO_WIRED_PAGES, + #[cfg(any(target_os = "ios", target_os = "macos"))] + MADV_FREE_REUSABLE, + #[cfg(any(target_os = "ios", target_os = "macos"))] + MADV_FREE_REUSE, + #[cfg(any(target_os = "ios", target_os = "macos"))] + MADV_CAN_REUSE, + } +} + +libc_bitflags!{ + /// Configuration flags for [`msync`]. + pub struct MsFlags: c_int { + /// Schedule an update but return immediately. + MS_ASYNC; + /// Invalidate all cached data. + MS_INVALIDATE; + /// Invalidate pages, but leave them mapped. + #[cfg(any(target_os = "ios", target_os = "macos"))] + MS_KILLPAGES; + /// Deactivate pages, but leave them mapped. + #[cfg(any(target_os = "ios", target_os = "macos"))] + MS_DEACTIVATE; + /// Perform an update and wait for it to complete. + MS_SYNC; + } +} + +libc_bitflags!{ + /// Flags for [`mlockall`]. + pub struct MlockAllFlags: c_int { + /// Lock pages that are currently mapped into the address space of the process. + MCL_CURRENT; + /// Lock pages which will become mapped into the address space of the process in the future. + MCL_FUTURE; + } +} + +/// Locks all memory pages that contain part of the address range with `length` +/// bytes starting at `addr`. +/// +/// Locked pages never move to the swap area. +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`mlock(2)`] man page. +/// +/// [`mlock(2)`]: https://man7.org/linux/man-pages/man2/mlock.2.html +pub unsafe fn mlock(addr: *const c_void, length: size_t) -> Result<()> { + Errno::result(libc::mlock(addr, length)).map(drop) +} + +/// Unlocks all memory pages that contain part of the address range with +/// `length` bytes starting at `addr`. +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`munlock(2)`] man +/// page. +/// +/// [`munlock(2)`]: https://man7.org/linux/man-pages/man2/munlock.2.html +pub unsafe fn munlock(addr: *const c_void, length: size_t) -> Result<()> { + Errno::result(libc::munlock(addr, length)).map(drop) +} + +/// Locks all memory pages mapped into this process' address space. +/// +/// Locked pages never move to the swap area. For more information, see [`mlockall(2)`]. +/// +/// [`mlockall(2)`]: https://man7.org/linux/man-pages/man2/mlockall.2.html +pub fn mlockall(flags: MlockAllFlags) -> Result<()> { + unsafe { Errno::result(libc::mlockall(flags.bits())) }.map(drop) +} + +/// Unlocks all memory pages mapped into this process' address space. +/// +/// For more information, see [`munlockall(2)`]. +/// +/// [`munlockall(2)`]: https://man7.org/linux/man-pages/man2/munlockall.2.html +pub fn munlockall() -> Result<()> { + unsafe { Errno::result(libc::munlockall()) }.map(drop) +} + +/// allocate memory, or map files or devices into memory +/// +/// # Safety +/// +/// See the [`mmap(2)`] man page for detailed requirements. +/// +/// [`mmap(2)`]: https://man7.org/linux/man-pages/man2/mmap.2.html +pub unsafe fn mmap(addr: *mut c_void, length: size_t, prot: ProtFlags, flags: MapFlags, fd: RawFd, offset: off_t) -> Result<*mut c_void> { + let ret = libc::mmap(addr, length, prot.bits(), flags.bits(), fd, offset); + + if ret == libc::MAP_FAILED { + Err(Errno::last()) + } else { + Ok(ret) + } +} + +/// Expands (or shrinks) an existing memory mapping, potentially moving it at +/// the same time. +/// +/// # Safety +/// +/// See the `mremap(2)` [man page](https://man7.org/linux/man-pages/man2/mremap.2.html) for +/// detailed requirements. +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +pub unsafe fn mremap( + addr: *mut c_void, + old_size: size_t, + new_size: size_t, + flags: MRemapFlags, + new_address: Option<* mut c_void>, +) -> Result<*mut c_void> { + #[cfg(target_os = "linux")] + let ret = libc::mremap(addr, old_size, new_size, flags.bits(), new_address.unwrap_or(std::ptr::null_mut())); + #[cfg(target_os = "netbsd")] + let ret = libc::mremap( + addr, + old_size, + new_address.unwrap_or(std::ptr::null_mut()), + new_size, + flags.bits(), + ); + + if ret == libc::MAP_FAILED { + Err(Errno::last()) + } else { + Ok(ret) + } +} + +/// remove a mapping +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`munmap(2)`] man +/// page. +/// +/// [`munmap(2)`]: https://man7.org/linux/man-pages/man2/munmap.2.html +pub unsafe fn munmap(addr: *mut c_void, len: size_t) -> Result<()> { + Errno::result(libc::munmap(addr, len)).map(drop) +} + +/// give advice about use of memory +/// +/// # Safety +/// +/// See the [`madvise(2)`] man page. Take special care when using +/// [`MmapAdvise::MADV_FREE`]. +/// +/// [`madvise(2)`]: https://man7.org/linux/man-pages/man2/madvise.2.html +pub unsafe fn madvise(addr: *mut c_void, length: size_t, advise: MmapAdvise) -> Result<()> { + Errno::result(libc::madvise(addr, length, advise as i32)).map(drop) +} + +/// Set protection of memory mapping. +/// +/// See [`mprotect(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mprotect.html) for +/// details. +/// +/// # Safety +/// +/// Calls to `mprotect` are inherently unsafe, as changes to memory protections can lead to +/// SIGSEGVs. +/// +/// ``` +/// # use nix::libc::size_t; +/// # use nix::sys::mman::{mmap, mprotect, MapFlags, ProtFlags}; +/// # use std::ptr; +/// const ONE_K: size_t = 1024; +/// let mut slice: &mut [u8] = unsafe { +/// let mem = mmap(ptr::null_mut(), ONE_K, ProtFlags::PROT_NONE, +/// MapFlags::MAP_ANON | MapFlags::MAP_PRIVATE, -1, 0).unwrap(); +/// mprotect(mem, ONE_K, ProtFlags::PROT_READ | ProtFlags::PROT_WRITE).unwrap(); +/// std::slice::from_raw_parts_mut(mem as *mut u8, ONE_K) +/// }; +/// assert_eq!(slice[0], 0x00); +/// slice[0] = 0xFF; +/// assert_eq!(slice[0], 0xFF); +/// ``` +pub unsafe fn mprotect(addr: *mut c_void, length: size_t, prot: ProtFlags) -> Result<()> { + Errno::result(libc::mprotect(addr, length, prot.bits())).map(drop) +} + +/// synchronize a mapped region +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`msync(2)`] man +/// page. +/// +/// [`msync(2)`]: https://man7.org/linux/man-pages/man2/msync.2.html +pub unsafe fn msync(addr: *mut c_void, length: size_t, flags: MsFlags) -> Result<()> { + Errno::result(libc::msync(addr, length, flags.bits())).map(drop) +} + +/// Creates and opens a new, or opens an existing, POSIX shared memory object. +/// +/// For more information, see [`shm_open(3)`]. +/// +/// [`shm_open(3)`]: https://man7.org/linux/man-pages/man3/shm_open.3.html +#[cfg(not(target_os = "android"))] +pub fn shm_open(name: &P, flag: OFlag, mode: Mode) -> Result { + let ret = name.with_nix_path(|cstr| { + #[cfg(any(target_os = "macos", target_os = "ios"))] + unsafe { + libc::shm_open(cstr.as_ptr(), flag.bits(), mode.bits() as libc::c_uint) + } + #[cfg(not(any(target_os = "macos", target_os = "ios")))] + unsafe { + libc::shm_open(cstr.as_ptr(), flag.bits(), mode.bits() as libc::mode_t) + } + })?; + + Errno::result(ret) +} + +/// Performs the converse of [`shm_open`], removing an object previously created. +/// +/// For more information, see [`shm_unlink(3)`]. +/// +/// [`shm_unlink(3)`]: https://man7.org/linux/man-pages/man3/shm_unlink.3.html +#[cfg(not(target_os = "android"))] +pub fn shm_unlink(name: &P) -> Result<()> { + let ret = name.with_nix_path(|cstr| { + unsafe { libc::shm_unlink(cstr.as_ptr()) } + })?; + + Errno::result(ret).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/mod.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..156b0d9d1ce85f5bbe348c8c8215af0b98a4d6e3 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/mod.rs @@ -0,0 +1,130 @@ +//! Mostly platform-specific functionality +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd"))] +pub mod aio; + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[allow(missing_docs)] +pub mod epoll; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +#[allow(missing_docs)] +pub mod event; + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[allow(missing_docs)] +pub mod eventfd; + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] +#[macro_use] +pub mod ioctl; + +#[cfg(target_os = "linux")] +pub mod memfd; + +#[cfg(not(target_os = "redox"))] +#[allow(missing_docs)] +pub mod mman; + +#[cfg(target_os = "linux")] +#[allow(missing_docs)] +pub mod personality; + +pub mod pthread; + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +#[allow(missing_docs)] +pub mod ptrace; + +#[cfg(target_os = "linux")] +pub mod quota; + +#[cfg(any(target_os = "linux"))] +#[allow(missing_docs)] +pub mod reboot; + +#[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "illumos")))] +pub mod resource; + +#[cfg(not(target_os = "redox"))] +pub mod select; + +#[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] +pub mod sendfile; + +pub mod signal; + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[allow(missing_docs)] +pub mod signalfd; + +#[cfg(not(target_os = "redox"))] +#[allow(missing_docs)] +pub mod socket; + +#[allow(missing_docs)] +pub mod stat; + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "openbsd" +))] +pub mod statfs; + +pub mod statvfs; + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[allow(missing_docs)] +pub mod sysinfo; + +#[allow(missing_docs)] +pub mod termios; + +#[allow(missing_docs)] +pub mod time; + +pub mod uio; + +pub mod utsname; + +pub mod wait; + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[allow(missing_docs)] +pub mod inotify; + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[allow(missing_docs)] +pub mod timerfd; diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/personality.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/personality.rs new file mode 100644 index 0000000000000000000000000000000000000000..b15956c469b99a1238096eba3daef2a7e957193e --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/personality.rs @@ -0,0 +1,70 @@ +use crate::Result; +use crate::errno::Errno; + +use libc::{self, c_int, c_ulong}; + +libc_bitflags! { + /// Flags used and returned by [`get()`](fn.get.html) and + /// [`set()`](fn.set.html). + pub struct Persona: c_int { + ADDR_COMPAT_LAYOUT; + ADDR_NO_RANDOMIZE; + ADDR_LIMIT_32BIT; + ADDR_LIMIT_3GB; + #[cfg(not(target_env = "musl"))] + FDPIC_FUNCPTRS; + MMAP_PAGE_ZERO; + READ_IMPLIES_EXEC; + SHORT_INODE; + STICKY_TIMEOUTS; + #[cfg(not(target_env = "musl"))] + UNAME26; + WHOLE_SECONDS; + } +} + +/// Retrieve the current process personality. +/// +/// Returns a Result containing a Persona instance. +/// +/// Example: +/// +/// ``` +/// # use nix::sys::personality::{self, Persona}; +/// let pers = personality::get().unwrap(); +/// assert!(!pers.contains(Persona::WHOLE_SECONDS)); +/// ``` +pub fn get() -> Result { + let res = unsafe { + libc::personality(0xFFFFFFFF) + }; + + Errno::result(res).map(Persona::from_bits_truncate) +} + +/// Set the current process personality. +/// +/// Returns a Result containing the *previous* personality for the +/// process, as a Persona. +/// +/// For more information, see [personality(2)](https://man7.org/linux/man-pages/man2/personality.2.html) +/// +/// **NOTE**: This call **replaces** the current personality entirely. +/// To **update** the personality, first call `get()` and then `set()` +/// with the modified persona. +/// +/// Example: +/// +/// ``` +/// # use nix::sys::personality::{self, Persona}; +/// let mut pers = personality::get().unwrap(); +/// assert!(!pers.contains(Persona::ADDR_NO_RANDOMIZE)); +/// personality::set(pers | Persona::ADDR_NO_RANDOMIZE); +/// ``` +pub fn set(persona: Persona) -> Result { + let res = unsafe { + libc::personality(persona.bits() as c_ulong) + }; + + Errno::result(res).map(Persona::from_bits_truncate) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/pthread.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/pthread.rs new file mode 100644 index 0000000000000000000000000000000000000000..d42e45d13dcd70cda721bfabd5ab3ccac3475430 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/pthread.rs @@ -0,0 +1,38 @@ +//! Low level threading primitives + +#[cfg(not(target_os = "redox"))] +use crate::errno::Errno; +#[cfg(not(target_os = "redox"))] +use crate::Result; +#[cfg(not(target_os = "redox"))] +use crate::sys::signal::Signal; +use libc::{self, pthread_t}; + +/// Identifies an individual thread. +pub type Pthread = pthread_t; + +/// Obtain ID of the calling thread (see +/// [`pthread_self(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_self.html) +/// +/// The thread ID returned by `pthread_self()` is not the same thing as +/// the kernel thread ID returned by a call to `gettid(2)`. +#[inline] +pub fn pthread_self() -> Pthread { + unsafe { libc::pthread_self() } +} + +/// Send a signal to a thread (see [`pthread_kill(3)`]). +/// +/// If `signal` is `None`, `pthread_kill` will only preform error checking and +/// won't send any signal. +/// +/// [`pthread_kill(3)`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_kill.html +#[cfg(not(target_os = "redox"))] +pub fn pthread_kill>>(thread: Pthread, signal: T) -> Result<()> { + let sig = match signal.into() { + Some(s) => s as libc::c_int, + None => 0, + }; + let res = unsafe { libc::pthread_kill(thread, sig) }; + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/ptrace/bsd.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/ptrace/bsd.rs new file mode 100644 index 0000000000000000000000000000000000000000..a62881ef34b776240ac8c3cf67f26aadc13aa0d2 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/ptrace/bsd.rs @@ -0,0 +1,176 @@ +use cfg_if::cfg_if; +use crate::errno::Errno; +use libc::{self, c_int}; +use std::ptr; +use crate::sys::signal::Signal; +use crate::unistd::Pid; +use crate::Result; + +pub type RequestType = c_int; + +cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "openbsd"))] { + #[doc(hidden)] + pub type AddressType = *mut ::libc::c_char; + } else { + #[doc(hidden)] + pub type AddressType = *mut ::libc::c_void; + } +} + +libc_enum! { + #[repr(i32)] + /// Ptrace Request enum defining the action to be taken. + #[non_exhaustive] + pub enum Request { + PT_TRACE_ME, + PT_READ_I, + PT_READ_D, + #[cfg(target_os = "macos")] + PT_READ_U, + PT_WRITE_I, + PT_WRITE_D, + #[cfg(target_os = "macos")] + PT_WRITE_U, + PT_CONTINUE, + PT_KILL, + #[cfg(any(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos"), + all(target_os = "openbsd", target_arch = "x86_64"), + all(target_os = "netbsd", any(target_arch = "x86_64", + target_arch = "powerpc"))))] + PT_STEP, + PT_ATTACH, + PT_DETACH, + #[cfg(target_os = "macos")] + PT_SIGEXC, + #[cfg(target_os = "macos")] + PT_THUPDATE, + #[cfg(target_os = "macos")] + PT_ATTACHEXC + } +} + +unsafe fn ptrace_other( + request: Request, + pid: Pid, + addr: AddressType, + data: c_int, +) -> Result { + Errno::result(libc::ptrace( + request as RequestType, + libc::pid_t::from(pid), + addr, + data, + )).map(|_| 0) +} + +/// Sets the process as traceable, as with `ptrace(PT_TRACEME, ...)` +/// +/// Indicates that this process is to be traced by its parent. +/// This is the only ptrace request to be issued by the tracee. +pub fn traceme() -> Result<()> { + unsafe { ptrace_other(Request::PT_TRACE_ME, Pid::from_raw(0), ptr::null_mut(), 0).map(drop) } +} + +/// Attach to a running process, as with `ptrace(PT_ATTACH, ...)` +/// +/// Attaches to the process specified by `pid`, making it a tracee of the calling process. +pub fn attach(pid: Pid) -> Result<()> { + unsafe { ptrace_other(Request::PT_ATTACH, pid, ptr::null_mut(), 0).map(drop) } +} + +/// Detaches the current running process, as with `ptrace(PT_DETACH, ...)` +/// +/// Detaches from the process specified by `pid` allowing it to run freely, optionally delivering a +/// signal specified by `sig`. +pub fn detach>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as c_int, + None => 0, + }; + unsafe { + ptrace_other(Request::PT_DETACH, pid, ptr::null_mut(), data).map(drop) + } +} + +/// Restart the stopped tracee process, as with `ptrace(PTRACE_CONT, ...)` +/// +/// Continues the execution of the process with PID `pid`, optionally +/// delivering a signal specified by `sig`. +pub fn cont>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as c_int, + None => 0, + }; + unsafe { + // Ignore the useless return value + ptrace_other(Request::PT_CONTINUE, pid, 1 as AddressType, data).map(drop) + } +} + +/// Issues a kill request as with `ptrace(PT_KILL, ...)` +/// +/// This request is equivalent to `ptrace(PT_CONTINUE, ..., SIGKILL);` +pub fn kill(pid: Pid) -> Result<()> { + unsafe { + ptrace_other(Request::PT_KILL, pid, 0 as AddressType, 0).map(drop) + } +} + +/// Move the stopped tracee process forward by a single step as with +/// `ptrace(PT_STEP, ...)` +/// +/// Advances the execution of the process with PID `pid` by a single step optionally delivering a +/// signal specified by `sig`. +/// +/// # Example +/// ```rust +/// use nix::sys::ptrace::step; +/// use nix::unistd::Pid; +/// use nix::sys::signal::Signal; +/// use nix::sys::wait::*; +/// // If a process changes state to the stopped state because of a SIGUSR1 +/// // signal, this will step the process forward and forward the user +/// // signal to the stopped process +/// match waitpid(Pid::from_raw(-1), None) { +/// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => { +/// let _ = step(pid, Signal::SIGUSR1); +/// } +/// _ => {}, +/// } +/// ``` +#[cfg( + any( + any(target_os = "dragonfly", target_os = "freebsd", target_os = "macos"), + all(target_os = "openbsd", target_arch = "x86_64"), + all(target_os = "netbsd", + any(target_arch = "x86_64", target_arch = "powerpc") + ) + ) +)] +pub fn step>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as c_int, + None => 0, + }; + unsafe { ptrace_other(Request::PT_STEP, pid, ptr::null_mut(), data).map(drop) } +} + +/// Reads a word from a processes memory at the given address +pub fn read(pid: Pid, addr: AddressType) -> Result { + unsafe { + // Traditionally there was a difference between reading data or + // instruction memory but not in modern systems. + ptrace_other(Request::PT_READ_D, pid, addr, 0) + } +} + +/// Writes a word into the processes memory at the given address +pub fn write(pid: Pid, addr: AddressType, data: c_int) -> Result<()> { + unsafe { ptrace_other(Request::PT_WRITE_D, pid, addr, data).map(drop) } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/ptrace/linux.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/ptrace/linux.rs new file mode 100644 index 0000000000000000000000000000000000000000..37236790b41c1710b34d43b13827e621b2f2bcb7 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/ptrace/linux.rs @@ -0,0 +1,479 @@ +//! For detailed description of the ptrace requests, consult `man ptrace`. + +use cfg_if::cfg_if; +use std::{mem, ptr}; +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_void, c_long, siginfo_t}; +use crate::unistd::Pid; +use crate::sys::signal::Signal; + +pub type AddressType = *mut ::libc::c_void; + +#[cfg(all( + target_os = "linux", + any(all(target_arch = "x86_64", + any(target_env = "gnu", target_env = "musl")), + all(target_arch = "x86", target_env = "gnu")) +))] +use libc::user_regs_struct; + +cfg_if! { + if #[cfg(any(all(target_os = "linux", target_arch = "s390x"), + all(target_os = "linux", target_env = "gnu")))] { + #[doc(hidden)] + pub type RequestType = ::libc::c_uint; + } else { + #[doc(hidden)] + pub type RequestType = ::libc::c_int; + } +} + +libc_enum!{ + #[cfg_attr(not(any(target_env = "musl", target_os = "android")), repr(u32))] + #[cfg_attr(any(target_env = "musl", target_os = "android"), repr(i32))] + /// Ptrace Request enum defining the action to be taken. + #[non_exhaustive] + pub enum Request { + PTRACE_TRACEME, + PTRACE_PEEKTEXT, + PTRACE_PEEKDATA, + PTRACE_PEEKUSER, + PTRACE_POKETEXT, + PTRACE_POKEDATA, + PTRACE_POKEUSER, + PTRACE_CONT, + PTRACE_KILL, + PTRACE_SINGLESTEP, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_GETREGS, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_SETREGS, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_GETFPREGS, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_SETFPREGS, + PTRACE_ATTACH, + PTRACE_DETACH, + #[cfg(all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86", + target_arch = "x86_64")))] + PTRACE_GETFPXREGS, + #[cfg(all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86", + target_arch = "x86_64")))] + PTRACE_SETFPXREGS, + PTRACE_SYSCALL, + PTRACE_SETOPTIONS, + PTRACE_GETEVENTMSG, + PTRACE_GETSIGINFO, + PTRACE_SETSIGINFO, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_GETREGSET, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_SETREGSET, + #[cfg(target_os = "linux")] + PTRACE_SEIZE, + #[cfg(target_os = "linux")] + PTRACE_INTERRUPT, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_LISTEN, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_PEEKSIGINFO, + #[cfg(all(target_os = "linux", target_env = "gnu", + any(target_arch = "x86", target_arch = "x86_64")))] + PTRACE_SYSEMU, + #[cfg(all(target_os = "linux", target_env = "gnu", + any(target_arch = "x86", target_arch = "x86_64")))] + PTRACE_SYSEMU_SINGLESTEP, + } +} + +libc_enum!{ + #[repr(i32)] + /// Using the ptrace options the tracer can configure the tracee to stop + /// at certain events. This enum is used to define those events as defined + /// in `man ptrace`. + #[non_exhaustive] + pub enum Event { + /// Event that stops before a return from fork or clone. + PTRACE_EVENT_FORK, + /// Event that stops before a return from vfork or clone. + PTRACE_EVENT_VFORK, + /// Event that stops before a return from clone. + PTRACE_EVENT_CLONE, + /// Event that stops before a return from execve. + PTRACE_EVENT_EXEC, + /// Event for a return from vfork. + PTRACE_EVENT_VFORK_DONE, + /// Event for a stop before an exit. Unlike the waitpid Exit status program. + /// registers can still be examined + PTRACE_EVENT_EXIT, + /// Stop triggered by a seccomp rule on a tracee. + PTRACE_EVENT_SECCOMP, + /// Stop triggered by the `INTERRUPT` syscall, or a group stop, + /// or when a new child is attached. + PTRACE_EVENT_STOP, + } +} + +libc_bitflags! { + /// Ptrace options used in conjunction with the PTRACE_SETOPTIONS request. + /// See `man ptrace` for more details. + pub struct Options: libc::c_int { + /// When delivering system call traps set a bit to allow tracer to + /// distinguish between normal stops or syscall stops. May not work on + /// all systems. + PTRACE_O_TRACESYSGOOD; + /// Stop tracee at next fork and start tracing the forked process. + PTRACE_O_TRACEFORK; + /// Stop tracee at next vfork call and trace the vforked process. + PTRACE_O_TRACEVFORK; + /// Stop tracee at next clone call and trace the cloned process. + PTRACE_O_TRACECLONE; + /// Stop tracee at next execve call. + PTRACE_O_TRACEEXEC; + /// Stop tracee at vfork completion. + PTRACE_O_TRACEVFORKDONE; + /// Stop tracee at next exit call. Stops before exit commences allowing + /// tracer to see location of exit and register states. + PTRACE_O_TRACEEXIT; + /// Stop tracee when a SECCOMP_RET_TRACE rule is triggered. See `man seccomp` for more + /// details. + PTRACE_O_TRACESECCOMP; + /// Send a SIGKILL to the tracee if the tracer exits. This is useful + /// for ptrace jailers to prevent tracees from escaping their control. + #[cfg(any(target_os = "android", target_os = "linux"))] + PTRACE_O_EXITKILL; + } +} + +fn ptrace_peek(request: Request, pid: Pid, addr: AddressType, data: *mut c_void) -> Result { + let ret = unsafe { + Errno::clear(); + libc::ptrace(request as RequestType, libc::pid_t::from(pid), addr, data) + }; + match Errno::result(ret) { + Ok(..) | Err(Errno::UnknownErrno) => Ok(ret), + err @ Err(..) => err, + } +} + +/// Get user registers, as with `ptrace(PTRACE_GETREGS, ...)` +#[cfg(all( + target_os = "linux", + any(all(target_arch = "x86_64", + any(target_env = "gnu", target_env = "musl")), + all(target_arch = "x86", target_env = "gnu")) +))] +pub fn getregs(pid: Pid) -> Result { + ptrace_get_data::(Request::PTRACE_GETREGS, pid) +} + +/// Set user registers, as with `ptrace(PTRACE_SETREGS, ...)` +#[cfg(all( + target_os = "linux", + any(all(target_arch = "x86_64", + any(target_env = "gnu", target_env = "musl")), + all(target_arch = "x86", target_env = "gnu")) +))] +pub fn setregs(pid: Pid, regs: user_regs_struct) -> Result<()> { + let res = unsafe { + libc::ptrace(Request::PTRACE_SETREGS as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + ®s as *const _ as *const c_void) + }; + Errno::result(res).map(drop) +} + +/// Function for ptrace requests that return values from the data field. +/// Some ptrace get requests populate structs or larger elements than `c_long` +/// and therefore use the data field to return values. This function handles these +/// requests. +fn ptrace_get_data(request: Request, pid: Pid) -> Result { + let mut data = mem::MaybeUninit::uninit(); + let res = unsafe { + libc::ptrace(request as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + data.as_mut_ptr() as *const _ as *const c_void) + }; + Errno::result(res)?; + Ok(unsafe{ data.assume_init() }) +} + +unsafe fn ptrace_other(request: Request, pid: Pid, addr: AddressType, data: *mut c_void) -> Result { + Errno::result(libc::ptrace(request as RequestType, libc::pid_t::from(pid), addr, data)).map(|_| 0) +} + +/// Set options, as with `ptrace(PTRACE_SETOPTIONS,...)`. +pub fn setoptions(pid: Pid, options: Options) -> Result<()> { + let res = unsafe { + libc::ptrace(Request::PTRACE_SETOPTIONS as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + options.bits() as *mut c_void) + }; + Errno::result(res).map(drop) +} + +/// Gets a ptrace event as described by `ptrace(PTRACE_GETEVENTMSG,...)` +pub fn getevent(pid: Pid) -> Result { + ptrace_get_data::(Request::PTRACE_GETEVENTMSG, pid) +} + +/// Get siginfo as with `ptrace(PTRACE_GETSIGINFO,...)` +pub fn getsiginfo(pid: Pid) -> Result { + ptrace_get_data::(Request::PTRACE_GETSIGINFO, pid) +} + +/// Set siginfo as with `ptrace(PTRACE_SETSIGINFO,...)` +pub fn setsiginfo(pid: Pid, sig: &siginfo_t) -> Result<()> { + let ret = unsafe{ + Errno::clear(); + libc::ptrace(Request::PTRACE_SETSIGINFO as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + sig as *const _ as *const c_void) + }; + match Errno::result(ret) { + Ok(_) => Ok(()), + Err(e) => Err(e), + } +} + +/// Sets the process as traceable, as with `ptrace(PTRACE_TRACEME, ...)` +/// +/// Indicates that this process is to be traced by its parent. +/// This is the only ptrace request to be issued by the tracee. +pub fn traceme() -> Result<()> { + unsafe { + ptrace_other( + Request::PTRACE_TRACEME, + Pid::from_raw(0), + ptr::null_mut(), + ptr::null_mut(), + ).map(drop) // ignore the useless return value + } +} + +/// Continue execution until the next syscall, as with `ptrace(PTRACE_SYSCALL, ...)` +/// +/// Arranges for the tracee to be stopped at the next entry to or exit from a system call, +/// optionally delivering a signal specified by `sig`. +pub fn syscall>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other( + Request::PTRACE_SYSCALL, + pid, + ptr::null_mut(), + data, + ).map(drop) // ignore the useless return value + } +} + +/// Continue execution until the next syscall, as with `ptrace(PTRACE_SYSEMU, ...)` +/// +/// In contrast to the `syscall` function, the syscall stopped at will not be executed. +/// Thus the the tracee will only be stopped once per syscall, +/// optionally delivering a signal specified by `sig`. +#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))] +pub fn sysemu>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other(Request::PTRACE_SYSEMU, pid, ptr::null_mut(), data).map(drop) + // ignore the useless return value + } +} + +/// Attach to a running process, as with `ptrace(PTRACE_ATTACH, ...)` +/// +/// Attaches to the process specified by `pid`, making it a tracee of the calling process. +pub fn attach(pid: Pid) -> Result<()> { + unsafe { + ptrace_other( + Request::PTRACE_ATTACH, + pid, + ptr::null_mut(), + ptr::null_mut(), + ).map(drop) // ignore the useless return value + } +} + +/// Attach to a running process, as with `ptrace(PTRACE_SEIZE, ...)` +/// +/// Attaches to the process specified in pid, making it a tracee of the calling process. +#[cfg(target_os = "linux")] +pub fn seize(pid: Pid, options: Options) -> Result<()> { + unsafe { + ptrace_other( + Request::PTRACE_SEIZE, + pid, + ptr::null_mut(), + options.bits() as *mut c_void, + ).map(drop) // ignore the useless return value + } +} + +/// Detaches the current running process, as with `ptrace(PTRACE_DETACH, ...)` +/// +/// Detaches from the process specified by `pid` allowing it to run freely, optionally delivering a +/// signal specified by `sig`. +pub fn detach>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other( + Request::PTRACE_DETACH, + pid, + ptr::null_mut(), + data + ).map(drop) + } +} + +/// Restart the stopped tracee process, as with `ptrace(PTRACE_CONT, ...)` +/// +/// Continues the execution of the process with PID `pid`, optionally +/// delivering a signal specified by `sig`. +pub fn cont>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other(Request::PTRACE_CONT, pid, ptr::null_mut(), data).map(drop) // ignore the useless return value + } +} + +/// Stop a tracee, as with `ptrace(PTRACE_INTERRUPT, ...)` +/// +/// This request is equivalent to `ptrace(PTRACE_INTERRUPT, ...)` +#[cfg(target_os = "linux")] +pub fn interrupt(pid: Pid) -> Result<()> { + unsafe { + ptrace_other(Request::PTRACE_INTERRUPT, pid, ptr::null_mut(), ptr::null_mut()).map(drop) + } +} + +/// Issues a kill request as with `ptrace(PTRACE_KILL, ...)` +/// +/// This request is equivalent to `ptrace(PTRACE_CONT, ..., SIGKILL);` +pub fn kill(pid: Pid) -> Result<()> { + unsafe { + ptrace_other(Request::PTRACE_KILL, pid, ptr::null_mut(), ptr::null_mut()).map(drop) + } +} + +/// Move the stopped tracee process forward by a single step as with +/// `ptrace(PTRACE_SINGLESTEP, ...)` +/// +/// Advances the execution of the process with PID `pid` by a single step optionally delivering a +/// signal specified by `sig`. +/// +/// # Example +/// ```rust +/// use nix::sys::ptrace::step; +/// use nix::unistd::Pid; +/// use nix::sys::signal::Signal; +/// use nix::sys::wait::*; +/// +/// // If a process changes state to the stopped state because of a SIGUSR1 +/// // signal, this will step the process forward and forward the user +/// // signal to the stopped process +/// match waitpid(Pid::from_raw(-1), None) { +/// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => { +/// let _ = step(pid, Signal::SIGUSR1); +/// } +/// _ => {}, +/// } +/// ``` +pub fn step>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other(Request::PTRACE_SINGLESTEP, pid, ptr::null_mut(), data).map(drop) + } +} + +/// Move the stopped tracee process forward by a single step or stop at the next syscall +/// as with `ptrace(PTRACE_SYSEMU_SINGLESTEP, ...)` +/// +/// Advances the execution by a single step or until the next syscall. +/// In case the tracee is stopped at a syscall, the syscall will not be executed. +/// Optionally, the signal specified by `sig` is delivered to the tracee upon continuation. +#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))] +pub fn sysemu_step>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other( + Request::PTRACE_SYSEMU_SINGLESTEP, + pid, + ptr::null_mut(), + data, + ) + .map(drop) // ignore the useless return value + } +} + +/// Reads a word from a processes memory at the given address +pub fn read(pid: Pid, addr: AddressType) -> Result { + ptrace_peek(Request::PTRACE_PEEKDATA, pid, addr, ptr::null_mut()) +} + +/// Writes a word into the processes memory at the given address +/// +/// # Safety +/// +/// The `data` argument is passed directly to `ptrace(2)`. Read that man page +/// for guidance. +pub unsafe fn write( + pid: Pid, + addr: AddressType, + data: *mut c_void) -> Result<()> +{ + ptrace_other(Request::PTRACE_POKEDATA, pid, addr, data).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/ptrace/mod.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/ptrace/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..782c30409bc12e9e930793924c41c3ad6137513b --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/ptrace/mod.rs @@ -0,0 +1,22 @@ +///! Provides helpers for making ptrace system calls + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod linux; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::linux::*; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +mod bsd; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd" + ))] +pub use self::bsd::*; diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/quota.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/quota.rs new file mode 100644 index 0000000000000000000000000000000000000000..6e34e38d2b720f151c24cefd84daba506123281e --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/quota.rs @@ -0,0 +1,277 @@ +//! Set and configure disk quotas for users, groups, or projects. +//! +//! # Examples +//! +//! Enabling and setting a quota: +//! +//! ```rust,no_run +//! # use nix::sys::quota::{Dqblk, quotactl_on, quotactl_set, QuotaFmt, QuotaType, QuotaValidFlags}; +//! quotactl_on(QuotaType::USRQUOTA, "/dev/sda1", QuotaFmt::QFMT_VFS_V1, "aquota.user"); +//! let mut dqblk: Dqblk = Default::default(); +//! dqblk.set_blocks_hard_limit(10000); +//! dqblk.set_blocks_soft_limit(8000); +//! quotactl_set(QuotaType::USRQUOTA, "/dev/sda1", 50, &dqblk, QuotaValidFlags::QIF_BLIMITS); +//! ``` +use std::default::Default; +use std::{mem, ptr}; +use libc::{self, c_int, c_char}; +use crate::{Result, NixPath}; +use crate::errno::Errno; + +struct QuotaCmd(QuotaSubCmd, QuotaType); + +impl QuotaCmd { + #[allow(unused_unsafe)] + fn as_int(&self) -> c_int { + unsafe { libc::QCMD(self.0 as i32, self.1 as i32) } + } +} + +// linux quota version >= 2 +libc_enum!{ + #[repr(i32)] + enum QuotaSubCmd { + Q_SYNC, + Q_QUOTAON, + Q_QUOTAOFF, + Q_GETQUOTA, + Q_SETQUOTA, + } +} + +libc_enum!{ + /// The scope of the quota. + #[repr(i32)] + #[non_exhaustive] + pub enum QuotaType { + /// Specify a user quota + USRQUOTA, + /// Specify a group quota + GRPQUOTA, + } +} + +libc_enum!{ + /// The type of quota format to use. + #[repr(i32)] + #[non_exhaustive] + pub enum QuotaFmt { + /// Use the original quota format. + QFMT_VFS_OLD, + /// Use the standard VFS v0 quota format. + /// + /// Handles 32-bit UIDs/GIDs and quota limits up to 232 bytes/232 inodes. + QFMT_VFS_V0, + /// Use the VFS v1 quota format. + /// + /// Handles 32-bit UIDs/GIDs and quota limits of 264 bytes/264 inodes. + QFMT_VFS_V1, + } +} + +libc_bitflags!( + /// Indicates the quota fields that are valid to read from. + #[derive(Default)] + pub struct QuotaValidFlags: u32 { + /// The block hard & soft limit fields. + QIF_BLIMITS; + /// The current space field. + QIF_SPACE; + /// The inode hard & soft limit fields. + QIF_ILIMITS; + /// The current inodes field. + QIF_INODES; + /// The disk use time limit field. + QIF_BTIME; + /// The file quote time limit field. + QIF_ITIME; + /// All block & inode limits. + QIF_LIMITS; + /// The space & inodes usage fields. + QIF_USAGE; + /// The time limit fields. + QIF_TIMES; + /// All fields. + QIF_ALL; + } +); + +/// Wrapper type for `if_dqblk` +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct Dqblk(libc::dqblk); + +impl Default for Dqblk { + fn default() -> Dqblk { + Dqblk(libc::dqblk { + dqb_bhardlimit: 0, + dqb_bsoftlimit: 0, + dqb_curspace: 0, + dqb_ihardlimit: 0, + dqb_isoftlimit: 0, + dqb_curinodes: 0, + dqb_btime: 0, + dqb_itime: 0, + dqb_valid: 0, + }) + } +} + +impl Dqblk { + /// The absolute limit on disk quota blocks allocated. + pub fn blocks_hard_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_BLIMITS) { + Some(self.0.dqb_bhardlimit) + } else { + None + } + } + + /// Set the absolute limit on disk quota blocks allocated. + pub fn set_blocks_hard_limit(&mut self, limit: u64) { + self.0.dqb_bhardlimit = limit; + } + + /// Preferred limit on disk quota blocks + pub fn blocks_soft_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_BLIMITS) { + Some(self.0.dqb_bsoftlimit) + } else { + None + } + } + + /// Set the preferred limit on disk quota blocks allocated. + pub fn set_blocks_soft_limit(&mut self, limit: u64) { + self.0.dqb_bsoftlimit = limit; + } + + /// Current occupied space (bytes). + pub fn occupied_space(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_SPACE) { + Some(self.0.dqb_curspace) + } else { + None + } + } + + /// Maximum number of allocated inodes. + pub fn inodes_hard_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_ILIMITS) { + Some(self.0.dqb_ihardlimit) + } else { + None + } + } + + /// Set the maximum number of allocated inodes. + pub fn set_inodes_hard_limit(&mut self, limit: u64) { + self.0.dqb_ihardlimit = limit; + } + + /// Preferred inode limit + pub fn inodes_soft_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_ILIMITS) { + Some(self.0.dqb_isoftlimit) + } else { + None + } + } + + /// Set the preferred limit of allocated inodes. + pub fn set_inodes_soft_limit(&mut self, limit: u64) { + self.0.dqb_isoftlimit = limit; + } + + /// Current number of allocated inodes. + pub fn allocated_inodes(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_INODES) { + Some(self.0.dqb_curinodes) + } else { + None + } + } + + /// Time limit for excessive disk use. + pub fn block_time_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_BTIME) { + Some(self.0.dqb_btime) + } else { + None + } + } + + /// Set the time limit for excessive disk use. + pub fn set_block_time_limit(&mut self, limit: u64) { + self.0.dqb_btime = limit; + } + + /// Time limit for excessive files. + pub fn inode_time_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_ITIME) { + Some(self.0.dqb_itime) + } else { + None + } + } + + /// Set the time limit for excessive files. + pub fn set_inode_time_limit(&mut self, limit: u64) { + self.0.dqb_itime = limit; + } +} + +fn quotactl(cmd: QuotaCmd, special: Option<&P>, id: c_int, addr: *mut c_char) -> Result<()> { + unsafe { + Errno::clear(); + let res = match special { + Some(dev) => dev.with_nix_path(|path| libc::quotactl(cmd.as_int(), path.as_ptr(), id, addr)), + None => Ok(libc::quotactl(cmd.as_int(), ptr::null(), id, addr)), + }?; + + Errno::result(res).map(drop) + } +} + +/// Turn on disk quotas for a block device. +pub fn quotactl_on(which: QuotaType, special: &P, format: QuotaFmt, quota_file: &P) -> Result<()> { + quota_file.with_nix_path(|path| { + let mut path_copy = path.to_bytes_with_nul().to_owned(); + let p: *mut c_char = path_copy.as_mut_ptr() as *mut c_char; + quotactl(QuotaCmd(QuotaSubCmd::Q_QUOTAON, which), Some(special), format as c_int, p) + })? +} + +/// Disable disk quotas for a block device. +pub fn quotactl_off(which: QuotaType, special: &P) -> Result<()> { + quotactl(QuotaCmd(QuotaSubCmd::Q_QUOTAOFF, which), Some(special), 0, ptr::null_mut()) +} + +/// Update the on-disk copy of quota usages for a filesystem. +/// +/// If `special` is `None`, then all file systems with active quotas are sync'd. +pub fn quotactl_sync(which: QuotaType, special: Option<&P>) -> Result<()> { + quotactl(QuotaCmd(QuotaSubCmd::Q_SYNC, which), special, 0, ptr::null_mut()) +} + +/// Get disk quota limits and current usage for the given user/group id. +pub fn quotactl_get(which: QuotaType, special: &P, id: c_int) -> Result { + let mut dqblk = mem::MaybeUninit::uninit(); + quotactl(QuotaCmd(QuotaSubCmd::Q_GETQUOTA, which), Some(special), id, dqblk.as_mut_ptr() as *mut c_char)?; + Ok(unsafe{ Dqblk(dqblk.assume_init())}) +} + +/// Configure quota values for the specified fields for a given user/group id. +pub fn quotactl_set(which: QuotaType, special: &P, id: c_int, dqblk: &Dqblk, fields: QuotaValidFlags) -> Result<()> { + let mut dqblk_copy = *dqblk; + dqblk_copy.0.dqb_valid = fields.bits(); + quotactl(QuotaCmd(QuotaSubCmd::Q_SETQUOTA, which), Some(special), id, &mut dqblk_copy as *mut _ as *mut c_char) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/reboot.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/reboot.rs new file mode 100644 index 0000000000000000000000000000000000000000..46ab68b6320628e5a83291dee8a922071b1e4d39 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/reboot.rs @@ -0,0 +1,45 @@ +//! Reboot/shutdown or enable/disable Ctrl-Alt-Delete. + +use crate::Result; +use crate::errno::Errno; +use std::convert::Infallible; +use std::mem::drop; + +libc_enum! { + /// How exactly should the system be rebooted. + /// + /// See [`set_cad_enabled()`](fn.set_cad_enabled.html) for + /// enabling/disabling Ctrl-Alt-Delete. + #[repr(i32)] + #[non_exhaustive] + pub enum RebootMode { + RB_HALT_SYSTEM, + RB_KEXEC, + RB_POWER_OFF, + RB_AUTOBOOT, + // we do not support Restart2, + RB_SW_SUSPEND, + } +} + +pub fn reboot(how: RebootMode) -> Result { + unsafe { + libc::reboot(how as libc::c_int) + }; + Err(Errno::last()) +} + +/// Enable or disable the reboot keystroke (Ctrl-Alt-Delete). +/// +/// Corresponds to calling `reboot(RB_ENABLE_CAD)` or `reboot(RB_DISABLE_CAD)` in C. +pub fn set_cad_enabled(enable: bool) -> Result<()> { + let cmd = if enable { + libc::RB_ENABLE_CAD + } else { + libc::RB_DISABLE_CAD + }; + let res = unsafe { + libc::reboot(cmd) + }; + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/resource.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/resource.rs new file mode 100644 index 0000000000000000000000000000000000000000..f3bfb671943a89a4780eaade1784c179bf3f8bbe --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/resource.rs @@ -0,0 +1,233 @@ +//! Configure the process resource limits. +use cfg_if::cfg_if; + +use crate::errno::Errno; +use crate::Result; +pub use libc::rlim_t; +use std::mem; + +cfg_if! { + if #[cfg(all(target_os = "linux", target_env = "gnu"))]{ + use libc::{__rlimit_resource_t, rlimit, RLIM_INFINITY}; + }else if #[cfg(any( + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "macos", + target_os = "ios", + target_os = "android", + target_os = "dragonfly", + all(target_os = "linux", not(target_env = "gnu")) + ))]{ + use libc::{c_int, rlimit, RLIM_INFINITY}; + } +} + +libc_enum! { + /// The Resource enum is platform dependent. Check different platform + /// manuals for more details. Some platform links has been provided for + /// earier reference (non-exhaustive). + /// + /// * [Linux](https://man7.org/linux/man-pages/man2/getrlimit.2.html) + /// * [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=setrlimit) + + // linux-gnu uses u_int as resource enum, which is implemented in libc as + // well. + // + // https://gcc.gnu.org/legacy-ml/gcc/2015-08/msg00441.html + // https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/linux/gnu/mod.rs + #[cfg_attr(all(target_os = "linux", target_env = "gnu"), repr(u32))] + #[cfg_attr(any( + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "macos", + target_os = "ios", + target_os = "android", + target_os = "dragonfly", + all(target_os = "linux", not(target_env = "gnu")) + ), repr(i32))] + #[non_exhaustive] + pub enum Resource { + #[cfg(not(any( + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + )))] + /// The maximum amount (in bytes) of virtual memory the process is + /// allowed to map. + RLIMIT_AS, + /// The largest size (in bytes) core(5) file that may be created. + RLIMIT_CORE, + /// The maximum amount of cpu time (in seconds) to be used by each + /// process. + RLIMIT_CPU, + /// The maximum size (in bytes) of the data segment for a process + RLIMIT_DATA, + /// The largest size (in bytes) file that may be created. + RLIMIT_FSIZE, + /// The maximum number of open files for this process. + RLIMIT_NOFILE, + /// The maximum size (in bytes) of the stack segment for a process. + RLIMIT_STACK, + + #[cfg(target_os = "freebsd")] + /// The maximum number of kqueues this user id is allowed to create. + RLIMIT_KQUEUES, + + #[cfg(any(target_os = "android", target_os = "linux"))] + /// A limit on the combined number of flock locks and fcntl leases that + /// this process may establish. + RLIMIT_LOCKS, + + #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "openbsd", target_os = "linux"))] + /// The maximum size (in bytes) which a process may lock into memory + /// using the mlock(2) system call. + RLIMIT_MEMLOCK, + + #[cfg(any(target_os = "android", target_os = "linux"))] + /// A limit on the number of bytes that can be allocated for POSIX + /// message queues for the real user ID of the calling process. + RLIMIT_MSGQUEUE, + + #[cfg(any(target_os = "android", target_os = "linux"))] + /// A ceiling to which the process's nice value can be raised using + /// setpriority or nice. + RLIMIT_NICE, + + #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "openbsd", target_os = "linux"))] + /// The maximum number of simultaneous processes for this user id. + RLIMIT_NPROC, + + #[cfg(target_os = "freebsd")] + /// The maximum number of pseudo-terminals this user id is allowed to + /// create. + RLIMIT_NPTS, + + #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "openbsd", target_os = "linux"))] + /// When there is memory pressure and swap is available, prioritize + /// eviction of a process' resident pages beyond this amount (in bytes). + RLIMIT_RSS, + + #[cfg(any(target_os = "android", target_os = "linux"))] + /// A ceiling on the real-time priority that may be set for this process + /// using sched_setscheduler and sched_set‐ param. + RLIMIT_RTPRIO, + + #[cfg(any(target_os = "linux"))] + /// A limit (in microseconds) on the amount of CPU time that a process + /// scheduled under a real-time scheduling policy may con‐ sume without + /// making a blocking system call. + RLIMIT_RTTIME, + + #[cfg(any(target_os = "android", target_os = "linux"))] + /// A limit on the number of signals that may be queued for the real + /// user ID of the calling process. + RLIMIT_SIGPENDING, + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + /// The maximum size (in bytes) of socket buffer usage for this user. + RLIMIT_SBSIZE, + + #[cfg(target_os = "freebsd")] + /// The maximum size (in bytes) of the swap space that may be reserved + /// or used by all of this user id's processes. + RLIMIT_SWAP, + + #[cfg(target_os = "freebsd")] + /// An alias for RLIMIT_AS. + RLIMIT_VMEM, + } +} + +/// Get the current processes resource limits +/// +/// A value of `None` indicates the value equals to `RLIM_INFINITY` which means +/// there is no limit. +/// +/// # Parameters +/// +/// * `resource`: The [`Resource`] that we want to get the limits of. +/// +/// # Examples +/// +/// ``` +/// # use nix::sys::resource::{getrlimit, Resource}; +/// +/// let (soft_limit, hard_limit) = getrlimit(Resource::RLIMIT_NOFILE).unwrap(); +/// println!("current soft_limit: {:?}", soft_limit); +/// println!("current hard_limit: {:?}", hard_limit); +/// ``` +/// +/// # References +/// +/// [getrlimit(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html#tag_16_215) +/// +/// [`Resource`]: enum.Resource.html +pub fn getrlimit(resource: Resource) -> Result<(Option, Option)> { + let mut old_rlim = mem::MaybeUninit::::uninit(); + + cfg_if! { + if #[cfg(all(target_os = "linux", target_env = "gnu"))]{ + let res = unsafe { libc::getrlimit(resource as __rlimit_resource_t, old_rlim.as_mut_ptr()) }; + }else{ + let res = unsafe { libc::getrlimit(resource as c_int, old_rlim.as_mut_ptr()) }; + } + } + + Errno::result(res).map(|_| { + let rlimit { rlim_cur, rlim_max } = unsafe { old_rlim.assume_init() }; + (Some(rlim_cur), Some(rlim_max)) + }) +} + +/// Set the current processes resource limits +/// +/// # Parameters +/// +/// * `resource`: The [`Resource`] that we want to set the limits of. +/// * `soft_limit`: The value that the kernel enforces for the corresponding +/// resource. Note: `None` input will be replaced by constant `RLIM_INFINITY`. +/// * `hard_limit`: The ceiling for the soft limit. Must be lower or equal to +/// the current hard limit for non-root users. Note: `None` input will be +/// replaced by constant `RLIM_INFINITY`. +/// +/// > Note: for some os (linux_gnu), setting hard_limit to `RLIM_INFINITY` can +/// > results `EPERM` Error. So you will need to set the number explicitly. +/// +/// # Examples +/// +/// ``` +/// # use nix::sys::resource::{setrlimit, Resource}; +/// +/// let soft_limit = Some(512); +/// let hard_limit = Some(1024); +/// setrlimit(Resource::RLIMIT_NOFILE, soft_limit, hard_limit).unwrap(); +/// ``` +/// +/// # References +/// +/// [setrlimit(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html#tag_16_215) +/// +/// [`Resource`]: enum.Resource.html +/// +/// Note: `setrlimit` provides a safe wrapper to libc's `setrlimit`. +pub fn setrlimit( + resource: Resource, + soft_limit: Option, + hard_limit: Option, +) -> Result<()> { + let new_rlim = rlimit { + rlim_cur: soft_limit.unwrap_or(RLIM_INFINITY), + rlim_max: hard_limit.unwrap_or(RLIM_INFINITY), + }; + cfg_if! { + if #[cfg(all(target_os = "linux", target_env = "gnu"))]{ + let res = unsafe { libc::setrlimit(resource as __rlimit_resource_t, &new_rlim as *const rlimit) }; + }else{ + let res = unsafe { libc::setrlimit(resource as c_int, &new_rlim as *const rlimit) }; + } + } + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/select.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/select.rs new file mode 100644 index 0000000000000000000000000000000000000000..4d7576a58af9501d6c0ac0b8065ae3764361c901 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/select.rs @@ -0,0 +1,430 @@ +//! Portably monitor a group of file descriptors for readiness. +use std::convert::TryFrom; +use std::iter::FusedIterator; +use std::mem; +use std::ops::Range; +use std::os::unix::io::RawFd; +use std::ptr::{null, null_mut}; +use libc::{self, c_int}; +use crate::Result; +use crate::errno::Errno; +use crate::sys::signal::SigSet; +use crate::sys::time::{TimeSpec, TimeVal}; + +pub use libc::FD_SETSIZE; + +/// Contains a set of file descriptors used by [`select`] +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct FdSet(libc::fd_set); + +fn assert_fd_valid(fd: RawFd) { + assert!( + usize::try_from(fd).map_or(false, |fd| fd < FD_SETSIZE), + "fd must be in the range 0..FD_SETSIZE", + ); +} + +impl FdSet { + /// Create an empty `FdSet` + pub fn new() -> FdSet { + let mut fdset = mem::MaybeUninit::uninit(); + unsafe { + libc::FD_ZERO(fdset.as_mut_ptr()); + FdSet(fdset.assume_init()) + } + } + + /// Add a file descriptor to an `FdSet` + pub fn insert(&mut self, fd: RawFd) { + assert_fd_valid(fd); + unsafe { libc::FD_SET(fd, &mut self.0) }; + } + + /// Remove a file descriptor from an `FdSet` + pub fn remove(&mut self, fd: RawFd) { + assert_fd_valid(fd); + unsafe { libc::FD_CLR(fd, &mut self.0) }; + } + + /// Test an `FdSet` for the presence of a certain file descriptor. + pub fn contains(&self, fd: RawFd) -> bool { + assert_fd_valid(fd); + unsafe { libc::FD_ISSET(fd, &self.0) } + } + + /// Remove all file descriptors from this `FdSet`. + pub fn clear(&mut self) { + unsafe { libc::FD_ZERO(&mut self.0) }; + } + + /// Finds the highest file descriptor in the set. + /// + /// Returns `None` if the set is empty. + /// + /// This can be used to calculate the `nfds` parameter of the [`select`] function. + /// + /// # Example + /// + /// ``` + /// # use nix::sys::select::FdSet; + /// let mut set = FdSet::new(); + /// set.insert(4); + /// set.insert(9); + /// assert_eq!(set.highest(), Some(9)); + /// ``` + /// + /// [`select`]: fn.select.html + pub fn highest(&self) -> Option { + self.fds(None).next_back() + } + + /// Returns an iterator over the file descriptors in the set. + /// + /// For performance, it takes an optional higher bound: the iterator will + /// not return any elements of the set greater than the given file + /// descriptor. + /// + /// # Examples + /// + /// ``` + /// # use nix::sys::select::FdSet; + /// # use std::os::unix::io::RawFd; + /// let mut set = FdSet::new(); + /// set.insert(4); + /// set.insert(9); + /// let fds: Vec = set.fds(None).collect(); + /// assert_eq!(fds, vec![4, 9]); + /// ``` + #[inline] + pub fn fds(&self, highest: Option) -> Fds { + Fds { + set: self, + range: 0..highest.map(|h| h as usize + 1).unwrap_or(FD_SETSIZE), + } + } +} + +impl Default for FdSet { + fn default() -> Self { + Self::new() + } +} + +/// Iterator over `FdSet`. +#[derive(Debug)] +pub struct Fds<'a> { + set: &'a FdSet, + range: Range, +} + +impl<'a> Iterator for Fds<'a> { + type Item = RawFd; + + fn next(&mut self) -> Option { + for i in &mut self.range { + if self.set.contains(i as RawFd) { + return Some(i as RawFd); + } + } + None + } + + #[inline] + fn size_hint(&self) -> (usize, Option) { + let (_, upper) = self.range.size_hint(); + (0, upper) + } +} + +impl<'a> DoubleEndedIterator for Fds<'a> { + #[inline] + fn next_back(&mut self) -> Option { + while let Some(i) = self.range.next_back() { + if self.set.contains(i as RawFd) { + return Some(i as RawFd); + } + } + None + } +} + +impl<'a> FusedIterator for Fds<'a> {} + +/// Monitors file descriptors for readiness +/// +/// Returns the total number of ready file descriptors in all sets. The sets are changed so that all +/// file descriptors that are ready for the given operation are set. +/// +/// When this function returns, `timeout` has an implementation-defined value. +/// +/// # Parameters +/// +/// * `nfds`: The highest file descriptor set in any of the passed `FdSet`s, plus 1. If `None`, this +/// is calculated automatically by calling [`FdSet::highest`] on all descriptor sets and adding 1 +/// to the maximum of that. +/// * `readfds`: File descriptors to check for being ready to read. +/// * `writefds`: File descriptors to check for being ready to write. +/// * `errorfds`: File descriptors to check for pending error conditions. +/// * `timeout`: Maximum time to wait for descriptors to become ready (`None` to block +/// indefinitely). +/// +/// # References +/// +/// [select(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/select.html) +/// +/// [`FdSet::highest`]: struct.FdSet.html#method.highest +pub fn select<'a, N, R, W, E, T>(nfds: N, + readfds: R, + writefds: W, + errorfds: E, + timeout: T) -> Result +where + N: Into>, + R: Into>, + W: Into>, + E: Into>, + T: Into>, +{ + let mut readfds = readfds.into(); + let mut writefds = writefds.into(); + let mut errorfds = errorfds.into(); + let timeout = timeout.into(); + + let nfds = nfds.into().unwrap_or_else(|| { + readfds.iter_mut() + .chain(writefds.iter_mut()) + .chain(errorfds.iter_mut()) + .map(|set| set.highest().unwrap_or(-1)) + .max() + .unwrap_or(-1) + 1 + }); + + let readfds = readfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let writefds = writefds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let errorfds = errorfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let timeout = timeout.map(|tv| tv as *mut _ as *mut libc::timeval) + .unwrap_or(null_mut()); + + let res = unsafe { + libc::select(nfds, readfds, writefds, errorfds, timeout) + }; + + Errno::result(res) +} + +/// Monitors file descriptors for readiness with an altered signal mask. +/// +/// Returns the total number of ready file descriptors in all sets. The sets are changed so that all +/// file descriptors that are ready for the given operation are set. +/// +/// When this function returns, the original signal mask is restored. +/// +/// Unlike [`select`](#fn.select), `pselect` does not mutate the `timeout` value. +/// +/// # Parameters +/// +/// * `nfds`: The highest file descriptor set in any of the passed `FdSet`s, plus 1. If `None`, this +/// is calculated automatically by calling [`FdSet::highest`] on all descriptor sets and adding 1 +/// to the maximum of that. +/// * `readfds`: File descriptors to check for read readiness +/// * `writefds`: File descriptors to check for write readiness +/// * `errorfds`: File descriptors to check for pending error conditions. +/// * `timeout`: Maximum time to wait for descriptors to become ready (`None` to block +/// indefinitely). +/// * `sigmask`: Signal mask to activate while waiting for file descriptors to turn +/// ready (`None` to set no alternative signal mask). +/// +/// # References +/// +/// [pselect(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pselect.html) +/// +/// [The new pselect() system call](https://lwn.net/Articles/176911/) +/// +/// [`FdSet::highest`]: struct.FdSet.html#method.highest +pub fn pselect<'a, N, R, W, E, T, S>(nfds: N, + readfds: R, + writefds: W, + errorfds: E, + timeout: T, + sigmask: S) -> Result +where + N: Into>, + R: Into>, + W: Into>, + E: Into>, + T: Into>, + S: Into>, +{ + let mut readfds = readfds.into(); + let mut writefds = writefds.into(); + let mut errorfds = errorfds.into(); + let sigmask = sigmask.into(); + let timeout = timeout.into(); + + let nfds = nfds.into().unwrap_or_else(|| { + readfds.iter_mut() + .chain(writefds.iter_mut()) + .chain(errorfds.iter_mut()) + .map(|set| set.highest().unwrap_or(-1)) + .max() + .unwrap_or(-1) + 1 + }); + + let readfds = readfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let writefds = writefds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let errorfds = errorfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let timeout = timeout.map(|ts| ts.as_ref() as *const libc::timespec).unwrap_or(null()); + let sigmask = sigmask.map(|sm| sm.as_ref() as *const libc::sigset_t).unwrap_or(null()); + + let res = unsafe { + libc::pselect(nfds, readfds, writefds, errorfds, timeout, sigmask) + }; + + Errno::result(res) +} + + +#[cfg(test)] +mod tests { + use super::*; + use std::os::unix::io::RawFd; + use crate::sys::time::{TimeVal, TimeValLike}; + use crate::unistd::{write, pipe}; + + #[test] + fn fdset_insert() { + let mut fd_set = FdSet::new(); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + + fd_set.insert(7); + + assert!(fd_set.contains(7)); + } + + #[test] + fn fdset_remove() { + let mut fd_set = FdSet::new(); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + + fd_set.insert(7); + fd_set.remove(7); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + } + + #[test] + fn fdset_clear() { + let mut fd_set = FdSet::new(); + fd_set.insert(1); + fd_set.insert((FD_SETSIZE / 2) as RawFd); + fd_set.insert((FD_SETSIZE - 1) as RawFd); + + fd_set.clear(); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + } + + #[test] + fn fdset_highest() { + let mut set = FdSet::new(); + assert_eq!(set.highest(), None); + set.insert(0); + assert_eq!(set.highest(), Some(0)); + set.insert(90); + assert_eq!(set.highest(), Some(90)); + set.remove(0); + assert_eq!(set.highest(), Some(90)); + set.remove(90); + assert_eq!(set.highest(), None); + + set.insert(4); + set.insert(5); + set.insert(7); + assert_eq!(set.highest(), Some(7)); + } + + #[test] + fn fdset_fds() { + let mut set = FdSet::new(); + assert_eq!(set.fds(None).collect::>(), vec![]); + set.insert(0); + assert_eq!(set.fds(None).collect::>(), vec![0]); + set.insert(90); + assert_eq!(set.fds(None).collect::>(), vec![0, 90]); + + // highest limit + assert_eq!(set.fds(Some(89)).collect::>(), vec![0]); + assert_eq!(set.fds(Some(90)).collect::>(), vec![0, 90]); + } + + #[test] + fn test_select() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let mut timeout = TimeVal::seconds(10); + assert_eq!(1, select(None, + &mut fd_set, + None, + None, + &mut timeout).unwrap()); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); + } + + #[test] + fn test_select_nfds() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let mut timeout = TimeVal::seconds(10); + assert_eq!(1, select(Some(fd_set.highest().unwrap() + 1), + &mut fd_set, + None, + None, + &mut timeout).unwrap()); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); + } + + #[test] + fn test_select_nfds2() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let mut timeout = TimeVal::seconds(10); + assert_eq!(1, select(::std::cmp::max(r1, r2) + 1, + &mut fd_set, + None, + None, + &mut timeout).unwrap()); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/sendfile.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/sendfile.rs new file mode 100644 index 0000000000000000000000000000000000000000..7a210c6fc32fa91e7f90a29ca6faaf9aadef5313 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/sendfile.rs @@ -0,0 +1,231 @@ +//! Send data from a file to a socket, bypassing userland. + +use cfg_if::cfg_if; +use std::os::unix::io::RawFd; +use std::ptr; + +use libc::{self, off_t}; + +use crate::Result; +use crate::errno::Errno; + +/// Copy up to `count` bytes to `out_fd` from `in_fd` starting at `offset`. +/// +/// Returns a `Result` with the number of bytes written. +/// +/// If `offset` is `None`, `sendfile` will begin reading at the current offset of `in_fd`and will +/// update the offset of `in_fd`. If `offset` is `Some`, `sendfile` will begin at the specified +/// offset and will not update the offset of `in_fd`. Instead, it will mutate `offset` to point to +/// the byte after the last byte copied. +/// +/// `in_fd` must support `mmap`-like operations and therefore cannot be a socket. +/// +/// For more information, see [the sendfile(2) man page.](https://man7.org/linux/man-pages/man2/sendfile.2.html) +#[cfg(any(target_os = "android", target_os = "linux"))] +pub fn sendfile( + out_fd: RawFd, + in_fd: RawFd, + offset: Option<&mut off_t>, + count: usize, +) -> Result { + let offset = offset + .map(|offset| offset as *mut _) + .unwrap_or(ptr::null_mut()); + let ret = unsafe { libc::sendfile(out_fd, in_fd, offset, count) }; + Errno::result(ret).map(|r| r as usize) +} + +/// Copy up to `count` bytes to `out_fd` from `in_fd` starting at `offset`. +/// +/// Returns a `Result` with the number of bytes written. +/// +/// If `offset` is `None`, `sendfile` will begin reading at the current offset of `in_fd`and will +/// update the offset of `in_fd`. If `offset` is `Some`, `sendfile` will begin at the specified +/// offset and will not update the offset of `in_fd`. Instead, it will mutate `offset` to point to +/// the byte after the last byte copied. +/// +/// `in_fd` must support `mmap`-like operations and therefore cannot be a socket. +/// +/// For more information, see [the sendfile(2) man page.](https://man7.org/linux/man-pages/man2/sendfile.2.html) +#[cfg(target_os = "linux")] +pub fn sendfile64( + out_fd: RawFd, + in_fd: RawFd, + offset: Option<&mut libc::off64_t>, + count: usize, +) -> Result { + let offset = offset + .map(|offset| offset as *mut _) + .unwrap_or(ptr::null_mut()); + let ret = unsafe { libc::sendfile64(out_fd, in_fd, offset, count) }; + Errno::result(ret).map(|r| r as usize) +} + +cfg_if! { + if #[cfg(any(target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] { + use crate::sys::uio::IoVec; + + #[derive(Clone, Debug, Eq, Hash, PartialEq)] + struct SendfileHeaderTrailer<'a>( + libc::sf_hdtr, + Option>>, + Option>>, + ); + + impl<'a> SendfileHeaderTrailer<'a> { + fn new( + headers: Option<&'a [&'a [u8]]>, + trailers: Option<&'a [&'a [u8]]> + ) -> SendfileHeaderTrailer<'a> { + let header_iovecs: Option>> = + headers.map(|s| s.iter().map(|b| IoVec::from_slice(b)).collect()); + let trailer_iovecs: Option>> = + trailers.map(|s| s.iter().map(|b| IoVec::from_slice(b)).collect()); + SendfileHeaderTrailer( + libc::sf_hdtr { + headers: { + header_iovecs + .as_ref() + .map_or(ptr::null(), |v| v.as_ptr()) as *mut libc::iovec + }, + hdr_cnt: header_iovecs.as_ref().map(|v| v.len()).unwrap_or(0) as i32, + trailers: { + trailer_iovecs + .as_ref() + .map_or(ptr::null(), |v| v.as_ptr()) as *mut libc::iovec + }, + trl_cnt: trailer_iovecs.as_ref().map(|v| v.len()).unwrap_or(0) as i32 + }, + header_iovecs, + trailer_iovecs, + ) + } + } + } +} + +cfg_if! { + if #[cfg(target_os = "freebsd")] { + use libc::c_int; + + libc_bitflags!{ + /// Configuration options for [`sendfile`.](fn.sendfile.html) + pub struct SfFlags: c_int { + /// Causes `sendfile` to return EBUSY instead of blocking when attempting to read a + /// busy page. + SF_NODISKIO; + /// Causes `sendfile` to sleep until the network stack releases its reference to the + /// VM pages read. When `sendfile` returns, the data is not guaranteed to have been + /// sent, but it is safe to modify the file. + SF_SYNC; + /// Causes `sendfile` to cache exactly the number of pages specified in the + /// `readahead` parameter, disabling caching heuristics. + SF_USER_READAHEAD; + /// Causes `sendfile` not to cache the data read. + SF_NOCACHE; + } + } + + /// Read up to `count` bytes from `in_fd` starting at `offset` and write to `out_sock`. + /// + /// Returns a `Result` and a count of bytes written. Bytes written may be non-zero even if + /// an error occurs. + /// + /// `in_fd` must describe a regular file or shared memory object. `out_sock` must describe a + /// stream socket. + /// + /// If `offset` falls past the end of the file, the function returns success and zero bytes + /// written. + /// + /// If `count` is `None` or 0, bytes will be read from `in_fd` until reaching the end of + /// file (EOF). + /// + /// `headers` and `trailers` specify optional slices of byte slices to be sent before and + /// after the data read from `in_fd`, respectively. The length of headers and trailers sent + /// is included in the returned count of bytes written. The values of `offset` and `count` + /// do not apply to headers or trailers. + /// + /// `readahead` specifies the minimum number of pages to cache in memory ahead of the page + /// currently being sent. + /// + /// For more information, see + /// [the sendfile(2) man page.](https://www.freebsd.org/cgi/man.cgi?query=sendfile&sektion=2) + #[allow(clippy::too_many_arguments)] + pub fn sendfile( + in_fd: RawFd, + out_sock: RawFd, + offset: off_t, + count: Option, + headers: Option<&[&[u8]]>, + trailers: Option<&[&[u8]]>, + flags: SfFlags, + readahead: u16 + ) -> (Result<()>, off_t) { + // Readahead goes in upper 16 bits + // Flags goes in lower 16 bits + // see `man 2 sendfile` + let ra32 = u32::from(readahead); + let flags: u32 = (ra32 << 16) | (flags.bits() as u32); + let mut bytes_sent: off_t = 0; + let hdtr = headers.or(trailers).map(|_| SendfileHeaderTrailer::new(headers, trailers)); + let hdtr_ptr = hdtr.as_ref().map_or(ptr::null(), |s| &s.0 as *const libc::sf_hdtr); + let return_code = unsafe { + libc::sendfile(in_fd, + out_sock, + offset, + count.unwrap_or(0), + hdtr_ptr as *mut libc::sf_hdtr, + &mut bytes_sent as *mut off_t, + flags as c_int) + }; + (Errno::result(return_code).and(Ok(())), bytes_sent) + } + } else if #[cfg(any(target_os = "ios", target_os = "macos"))] { + /// Read bytes from `in_fd` starting at `offset` and write up to `count` bytes to + /// `out_sock`. + /// + /// Returns a `Result` and a count of bytes written. Bytes written may be non-zero even if + /// an error occurs. + /// + /// `in_fd` must describe a regular file. `out_sock` must describe a stream socket. + /// + /// If `offset` falls past the end of the file, the function returns success and zero bytes + /// written. + /// + /// If `count` is `None` or 0, bytes will be read from `in_fd` until reaching the end of + /// file (EOF). + /// + /// `hdtr` specifies an optional list of headers and trailers to be sent before and after + /// the data read from `in_fd`, respectively. The length of headers and trailers sent is + /// included in the returned count of bytes written. If any headers are specified and + /// `count` is non-zero, the length of the headers will be counted in the limit of total + /// bytes sent. Trailers do not count toward the limit of bytes sent and will always be sent + /// regardless. The value of `offset` does not affect headers or trailers. + /// + /// For more information, see + /// [the sendfile(2) man page.](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man2/sendfile.2.html) + pub fn sendfile( + in_fd: RawFd, + out_sock: RawFd, + offset: off_t, + count: Option, + headers: Option<&[&[u8]]>, + trailers: Option<&[&[u8]]> + ) -> (Result<()>, off_t) { + let mut len = count.unwrap_or(0); + let hdtr = headers.or(trailers).map(|_| SendfileHeaderTrailer::new(headers, trailers)); + let hdtr_ptr = hdtr.as_ref().map_or(ptr::null(), |s| &s.0 as *const libc::sf_hdtr); + let return_code = unsafe { + libc::sendfile(in_fd, + out_sock, + offset, + &mut len as *mut off_t, + hdtr_ptr as *mut libc::sf_hdtr, + 0) + }; + (Errno::result(return_code).and(Ok(())), len) + } + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/signal.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/signal.rs new file mode 100644 index 0000000000000000000000000000000000000000..61bdc74aef1aa2dbb40b4a9e5a903ad9cc6ded71 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/signal.rs @@ -0,0 +1,1234 @@ +// Portions of this file are Copyright 2014 The Rust Project Developers. +// See https://www.rust-lang.org/policies/licenses. + +//! Operating system signals. + +use crate::{Error, Result}; +use crate::errno::Errno; +use crate::unistd::Pid; +use std::mem; +use std::fmt; +use std::str::FromStr; +#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] +use std::os::unix::io::RawFd; +use std::ptr; + +#[cfg(not(any(target_os = "openbsd", target_os = "redox")))] +pub use self::sigevent::*; + +libc_enum!{ + /// Types of operating system signals + // Currently there is only one definition of c_int in libc, as well as only one + // type for signal constants. + // We would prefer to use the libc::c_int alias in the repr attribute. Unfortunately + // this is not (yet) possible. + #[repr(i32)] + #[non_exhaustive] + pub enum Signal { + /// Hangup + SIGHUP, + /// Interrupt + SIGINT, + /// Quit + SIGQUIT, + /// Illegal instruction (not reset when caught) + SIGILL, + /// Trace trap (not reset when caught) + SIGTRAP, + /// Abort + SIGABRT, + /// Bus error + SIGBUS, + /// Floating point exception + SIGFPE, + /// Kill (cannot be caught or ignored) + SIGKILL, + /// User defined signal 1 + SIGUSR1, + /// Segmentation violation + SIGSEGV, + /// User defined signal 2 + SIGUSR2, + /// Write on a pipe with no one to read it + SIGPIPE, + /// Alarm clock + SIGALRM, + /// Software termination signal from kill + SIGTERM, + /// Stack fault (obsolete) + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] + SIGSTKFLT, + /// To parent on child stop or exit + SIGCHLD, + /// Continue a stopped process + SIGCONT, + /// Sendable stop signal not from tty + SIGSTOP, + /// Stop signal from tty + SIGTSTP, + /// To readers pgrp upon background tty read + SIGTTIN, + /// Like TTIN if (tp->t_local<OSTOP) + SIGTTOU, + /// Urgent condition on IO channel + SIGURG, + /// Exceeded CPU time limit + SIGXCPU, + /// Exceeded file size limit + SIGXFSZ, + /// Virtual time alarm + SIGVTALRM, + /// Profiling time alarm + SIGPROF, + /// Window size changes + SIGWINCH, + /// Input/output possible signal + SIGIO, + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] + /// Power failure imminent. + SIGPWR, + /// Bad system call + SIGSYS, + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + /// Emulator trap + SIGEMT, + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + /// Information request + SIGINFO, + } + impl TryFrom +} + +impl FromStr for Signal { + type Err = Error; + fn from_str(s: &str) -> Result { + Ok(match s { + "SIGHUP" => Signal::SIGHUP, + "SIGINT" => Signal::SIGINT, + "SIGQUIT" => Signal::SIGQUIT, + "SIGILL" => Signal::SIGILL, + "SIGTRAP" => Signal::SIGTRAP, + "SIGABRT" => Signal::SIGABRT, + "SIGBUS" => Signal::SIGBUS, + "SIGFPE" => Signal::SIGFPE, + "SIGKILL" => Signal::SIGKILL, + "SIGUSR1" => Signal::SIGUSR1, + "SIGSEGV" => Signal::SIGSEGV, + "SIGUSR2" => Signal::SIGUSR2, + "SIGPIPE" => Signal::SIGPIPE, + "SIGALRM" => Signal::SIGALRM, + "SIGTERM" => Signal::SIGTERM, + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] + "SIGSTKFLT" => Signal::SIGSTKFLT, + "SIGCHLD" => Signal::SIGCHLD, + "SIGCONT" => Signal::SIGCONT, + "SIGSTOP" => Signal::SIGSTOP, + "SIGTSTP" => Signal::SIGTSTP, + "SIGTTIN" => Signal::SIGTTIN, + "SIGTTOU" => Signal::SIGTTOU, + "SIGURG" => Signal::SIGURG, + "SIGXCPU" => Signal::SIGXCPU, + "SIGXFSZ" => Signal::SIGXFSZ, + "SIGVTALRM" => Signal::SIGVTALRM, + "SIGPROF" => Signal::SIGPROF, + "SIGWINCH" => Signal::SIGWINCH, + "SIGIO" => Signal::SIGIO, + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] + "SIGPWR" => Signal::SIGPWR, + "SIGSYS" => Signal::SIGSYS, + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + "SIGEMT" => Signal::SIGEMT, + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + "SIGINFO" => Signal::SIGINFO, + _ => return Err(Errno::EINVAL), + }) + } +} + +impl Signal { + /// Returns name of signal. + /// + /// This function is equivalent to `>::as_ref()`, + /// with difference that returned string is `'static` + /// and not bound to `self`'s lifetime. + pub const fn as_str(self) -> &'static str { + match self { + Signal::SIGHUP => "SIGHUP", + Signal::SIGINT => "SIGINT", + Signal::SIGQUIT => "SIGQUIT", + Signal::SIGILL => "SIGILL", + Signal::SIGTRAP => "SIGTRAP", + Signal::SIGABRT => "SIGABRT", + Signal::SIGBUS => "SIGBUS", + Signal::SIGFPE => "SIGFPE", + Signal::SIGKILL => "SIGKILL", + Signal::SIGUSR1 => "SIGUSR1", + Signal::SIGSEGV => "SIGSEGV", + Signal::SIGUSR2 => "SIGUSR2", + Signal::SIGPIPE => "SIGPIPE", + Signal::SIGALRM => "SIGALRM", + Signal::SIGTERM => "SIGTERM", + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))] + Signal::SIGSTKFLT => "SIGSTKFLT", + Signal::SIGCHLD => "SIGCHLD", + Signal::SIGCONT => "SIGCONT", + Signal::SIGSTOP => "SIGSTOP", + Signal::SIGTSTP => "SIGTSTP", + Signal::SIGTTIN => "SIGTTIN", + Signal::SIGTTOU => "SIGTTOU", + Signal::SIGURG => "SIGURG", + Signal::SIGXCPU => "SIGXCPU", + Signal::SIGXFSZ => "SIGXFSZ", + Signal::SIGVTALRM => "SIGVTALRM", + Signal::SIGPROF => "SIGPROF", + Signal::SIGWINCH => "SIGWINCH", + Signal::SIGIO => "SIGIO", + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] + Signal::SIGPWR => "SIGPWR", + Signal::SIGSYS => "SIGSYS", + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + Signal::SIGEMT => "SIGEMT", + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + Signal::SIGINFO => "SIGINFO", + } + } +} + +impl AsRef for Signal { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl fmt::Display for Signal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(self.as_ref()) + } +} + +pub use self::Signal::*; + +#[cfg(target_os = "redox")] +const SIGNALS: [Signal; 29] = [ + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGSYS]; +#[cfg(all(any(target_os = "linux", target_os = "android", + target_os = "emscripten", target_os = "fuchsia"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] +const SIGNALS: [Signal; 31] = [ + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGSTKFLT, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGPWR, + SIGSYS]; +#[cfg(all(any(target_os = "linux", target_os = "android", + target_os = "emscripten", target_os = "fuchsia"), + any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64")))] +const SIGNALS: [Signal; 30] = [ + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGPWR, + SIGSYS]; +#[cfg(not(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "emscripten", + target_os = "redox")))] +const SIGNALS: [Signal; 31] = [ + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGSYS, + SIGEMT, + SIGINFO]; + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +/// Iterate through all signals defined by this operating system +pub struct SignalIterator { + next: usize, +} + +impl Iterator for SignalIterator { + type Item = Signal; + + fn next(&mut self) -> Option { + if self.next < SIGNALS.len() { + let next_signal = SIGNALS[self.next]; + self.next += 1; + Some(next_signal) + } else { + None + } + } +} + +impl Signal { + /// Iterate through all signals defined by this OS + pub const fn iterator() -> SignalIterator { + SignalIterator{next: 0} + } +} + +/// Alias for [`SIGABRT`] +pub const SIGIOT : Signal = SIGABRT; +/// Alias for [`SIGIO`] +pub const SIGPOLL : Signal = SIGIO; +/// Alias for [`SIGSYS`] +pub const SIGUNUSED : Signal = SIGSYS; + +#[cfg(not(target_os = "redox"))] +type SaFlags_t = libc::c_int; +#[cfg(target_os = "redox")] +type SaFlags_t = libc::c_ulong; + +libc_bitflags!{ + /// Controls the behavior of a [`SigAction`] + pub struct SaFlags: SaFlags_t { + /// When catching a [`Signal::SIGCHLD`] signal, the signal will be + /// generated only when a child process exits, not when a child process + /// stops. + SA_NOCLDSTOP; + /// When catching a [`Signal::SIGCHLD`] signal, the system will not + /// create zombie processes when children of the calling process exit. + SA_NOCLDWAIT; + /// Further occurrences of the delivered signal are not masked during + /// the execution of the handler. + SA_NODEFER; + /// The system will deliver the signal to the process on a signal stack, + /// specified by each thread with sigaltstack(2). + SA_ONSTACK; + /// The handler is reset back to the default at the moment the signal is + /// delivered. + SA_RESETHAND; + /// Requests that certain system calls restart if interrupted by this + /// signal. See the man page for complete details. + SA_RESTART; + /// This flag is controlled internally by Nix. + SA_SIGINFO; + } +} + +libc_enum! { + /// Specifies how certain functions should manipulate a signal mask + #[repr(i32)] + #[non_exhaustive] + pub enum SigmaskHow { + /// The new mask is the union of the current mask and the specified set. + SIG_BLOCK, + /// The new mask is the intersection of the current mask and the + /// complement of the specified set. + SIG_UNBLOCK, + /// The current mask is replaced by the specified set. + SIG_SETMASK, + } +} + +/// Specifies a set of [`Signal`]s that may be blocked, waited for, etc. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct SigSet { + sigset: libc::sigset_t +} + + +impl SigSet { + /// Initialize to include all signals. + pub fn all() -> SigSet { + let mut sigset = mem::MaybeUninit::uninit(); + let _ = unsafe { libc::sigfillset(sigset.as_mut_ptr()) }; + + unsafe{ SigSet { sigset: sigset.assume_init() } } + } + + /// Initialize to include nothing. + pub fn empty() -> SigSet { + let mut sigset = mem::MaybeUninit::uninit(); + let _ = unsafe { libc::sigemptyset(sigset.as_mut_ptr()) }; + + unsafe{ SigSet { sigset: sigset.assume_init() } } + } + + /// Add the specified signal to the set. + pub fn add(&mut self, signal: Signal) { + unsafe { libc::sigaddset(&mut self.sigset as *mut libc::sigset_t, signal as libc::c_int) }; + } + + /// Remove all signals from this set. + pub fn clear(&mut self) { + unsafe { libc::sigemptyset(&mut self.sigset as *mut libc::sigset_t) }; + } + + /// Remove the specified signal from this set. + pub fn remove(&mut self, signal: Signal) { + unsafe { libc::sigdelset(&mut self.sigset as *mut libc::sigset_t, signal as libc::c_int) }; + } + + /// Return whether this set includes the specified signal. + pub fn contains(&self, signal: Signal) -> bool { + let res = unsafe { libc::sigismember(&self.sigset as *const libc::sigset_t, signal as libc::c_int) }; + + match res { + 1 => true, + 0 => false, + _ => unreachable!("unexpected value from sigismember"), + } + } + + /// Merge all of `other`'s signals into this set. + // TODO: use libc::sigorset on supported operating systems. + pub fn extend(&mut self, other: &SigSet) { + for signal in Signal::iterator() { + if other.contains(signal) { + self.add(signal); + } + } + } + + /// Gets the currently blocked (masked) set of signals for the calling thread. + pub fn thread_get_mask() -> Result { + let mut oldmask = mem::MaybeUninit::uninit(); + do_pthread_sigmask(SigmaskHow::SIG_SETMASK, None, Some(oldmask.as_mut_ptr()))?; + Ok(unsafe{ SigSet{sigset: oldmask.assume_init()}}) + } + + /// Sets the set of signals as the signal mask for the calling thread. + pub fn thread_set_mask(&self) -> Result<()> { + pthread_sigmask(SigmaskHow::SIG_SETMASK, Some(self), None) + } + + /// Adds the set of signals to the signal mask for the calling thread. + pub fn thread_block(&self) -> Result<()> { + pthread_sigmask(SigmaskHow::SIG_BLOCK, Some(self), None) + } + + /// Removes the set of signals from the signal mask for the calling thread. + pub fn thread_unblock(&self) -> Result<()> { + pthread_sigmask(SigmaskHow::SIG_UNBLOCK, Some(self), None) + } + + /// Sets the set of signals as the signal mask, and returns the old mask. + pub fn thread_swap_mask(&self, how: SigmaskHow) -> Result { + let mut oldmask = mem::MaybeUninit::uninit(); + do_pthread_sigmask(how, Some(self), Some(oldmask.as_mut_ptr()))?; + Ok(unsafe{ SigSet{sigset: oldmask.assume_init()}}) + } + + /// Suspends execution of the calling thread until one of the signals in the + /// signal mask becomes pending, and returns the accepted signal. + #[cfg(not(target_os = "redox"))] // RedoxFS does not yet support sigwait + pub fn wait(&self) -> Result { + use std::convert::TryFrom; + + let mut signum = mem::MaybeUninit::uninit(); + let res = unsafe { libc::sigwait(&self.sigset as *const libc::sigset_t, signum.as_mut_ptr()) }; + + Errno::result(res).map(|_| unsafe { + Signal::try_from(signum.assume_init()).unwrap() + }) + } +} + +impl AsRef for SigSet { + fn as_ref(&self) -> &libc::sigset_t { + &self.sigset + } +} + +/// A signal handler. +#[allow(unknown_lints)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum SigHandler { + /// Default signal handling. + SigDfl, + /// Request that the signal be ignored. + SigIgn, + /// Use the given signal-catching function, which takes in the signal. + Handler(extern fn(libc::c_int)), + /// Use the given signal-catching function, which takes in the signal, information about how + /// the signal was generated, and a pointer to the threads `ucontext_t`. + #[cfg(not(target_os = "redox"))] + SigAction(extern fn(libc::c_int, *mut libc::siginfo_t, *mut libc::c_void)) +} + +/// Action to take on receipt of a signal. Corresponds to `sigaction`. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct SigAction { + sigaction: libc::sigaction +} + +impl SigAction { + /// Creates a new action. + /// + /// The `SA_SIGINFO` bit in the `flags` argument is ignored (it will be set only if `handler` + /// is the `SigAction` variant). `mask` specifies other signals to block during execution of + /// the signal-catching function. + pub fn new(handler: SigHandler, flags: SaFlags, mask: SigSet) -> SigAction { + #[cfg(target_os = "redox")] + unsafe fn install_sig(p: *mut libc::sigaction, handler: SigHandler) { + (*p).sa_handler = match handler { + SigHandler::SigDfl => libc::SIG_DFL, + SigHandler::SigIgn => libc::SIG_IGN, + SigHandler::Handler(f) => f as *const extern fn(libc::c_int) as usize, + }; + } + + #[cfg(not(target_os = "redox"))] + unsafe fn install_sig(p: *mut libc::sigaction, handler: SigHandler) { + (*p).sa_sigaction = match handler { + SigHandler::SigDfl => libc::SIG_DFL, + SigHandler::SigIgn => libc::SIG_IGN, + SigHandler::Handler(f) => f as *const extern fn(libc::c_int) as usize, + SigHandler::SigAction(f) => f as *const extern fn(libc::c_int, *mut libc::siginfo_t, *mut libc::c_void) as usize, + }; + } + + let mut s = mem::MaybeUninit::::uninit(); + unsafe { + let p = s.as_mut_ptr(); + install_sig(p, handler); + (*p).sa_flags = match handler { + #[cfg(not(target_os = "redox"))] + SigHandler::SigAction(_) => (flags | SaFlags::SA_SIGINFO).bits(), + _ => (flags - SaFlags::SA_SIGINFO).bits(), + }; + (*p).sa_mask = mask.sigset; + + SigAction { sigaction: s.assume_init() } + } + } + + /// Returns the flags set on the action. + pub fn flags(&self) -> SaFlags { + SaFlags::from_bits_truncate(self.sigaction.sa_flags) + } + + /// Returns the set of signals that are blocked during execution of the action's + /// signal-catching function. + pub fn mask(&self) -> SigSet { + SigSet { sigset: self.sigaction.sa_mask } + } + + /// Returns the action's handler. + #[cfg(not(target_os = "redox"))] + pub fn handler(&self) -> SigHandler { + match self.sigaction.sa_sigaction { + libc::SIG_DFL => SigHandler::SigDfl, + libc::SIG_IGN => SigHandler::SigIgn, + p if self.flags().contains(SaFlags::SA_SIGINFO) => + SigHandler::SigAction( + // Safe for one of two reasons: + // * The SigHandler was created by SigHandler::new, in which + // case the pointer is correct, or + // * The SigHandler was created by signal or sigaction, which + // are unsafe functions, so the caller should've somehow + // ensured that it is correctly initialized. + unsafe{ + *(&p as *const usize + as *const extern fn(_, _, _)) + } + as extern fn(_, _, _)), + p => SigHandler::Handler( + // Safe for one of two reasons: + // * The SigHandler was created by SigHandler::new, in which + // case the pointer is correct, or + // * The SigHandler was created by signal or sigaction, which + // are unsafe functions, so the caller should've somehow + // ensured that it is correctly initialized. + unsafe{ + *(&p as *const usize + as *const extern fn(libc::c_int)) + } + as extern fn(libc::c_int)), + } + } + + /// Returns the action's handler. + #[cfg(target_os = "redox")] + pub fn handler(&self) -> SigHandler { + match self.sigaction.sa_handler { + libc::SIG_DFL => SigHandler::SigDfl, + libc::SIG_IGN => SigHandler::SigIgn, + p => SigHandler::Handler( + // Safe for one of two reasons: + // * The SigHandler was created by SigHandler::new, in which + // case the pointer is correct, or + // * The SigHandler was created by signal or sigaction, which + // are unsafe functions, so the caller should've somehow + // ensured that it is correctly initialized. + unsafe{ + *(&p as *const usize + as *const extern fn(libc::c_int)) + } + as extern fn(libc::c_int)), + } + } +} + +/// Changes the action taken by a process on receipt of a specific signal. +/// +/// `signal` can be any signal except `SIGKILL` or `SIGSTOP`. On success, it returns the previous +/// action for the given signal. If `sigaction` fails, no new signal handler is installed. +/// +/// # Safety +/// +/// * Signal handlers may be called at any point during execution, which limits +/// what is safe to do in the body of the signal-catching function. Be certain +/// to only make syscalls that are explicitly marked safe for signal handlers +/// and only share global data using atomics. +/// +/// * There is also no guarantee that the old signal handler was installed +/// correctly. If it was installed by this crate, it will be. But if it was +/// installed by, for example, C code, then there is no guarantee its function +/// pointer is valid. In that case, this function effectively dereferences a +/// raw pointer of unknown provenance. +pub unsafe fn sigaction(signal: Signal, sigaction: &SigAction) -> Result { + let mut oldact = mem::MaybeUninit::::uninit(); + + let res = libc::sigaction(signal as libc::c_int, + &sigaction.sigaction as *const libc::sigaction, + oldact.as_mut_ptr()); + + Errno::result(res).map(|_| SigAction { sigaction: oldact.assume_init() }) +} + +/// Signal management (see [signal(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/signal.html)) +/// +/// Installs `handler` for the given `signal`, returning the previous signal +/// handler. `signal` should only be used following another call to `signal` or +/// if the current handler is the default. The return value of `signal` is +/// undefined after setting the handler with [`sigaction`][SigActionFn]. +/// +/// # Safety +/// +/// If the pointer to the previous signal handler is invalid, undefined +/// behavior could be invoked when casting it back to a [`SigAction`][SigActionStruct]. +/// +/// # Examples +/// +/// Ignore `SIGINT`: +/// +/// ```no_run +/// # use nix::sys::signal::{self, Signal, SigHandler}; +/// unsafe { signal::signal(Signal::SIGINT, SigHandler::SigIgn) }.unwrap(); +/// ``` +/// +/// Use a signal handler to set a flag variable: +/// +/// ```no_run +/// # #[macro_use] extern crate lazy_static; +/// # use std::convert::TryFrom; +/// # use std::sync::atomic::{AtomicBool, Ordering}; +/// # use nix::sys::signal::{self, Signal, SigHandler}; +/// lazy_static! { +/// static ref SIGNALED: AtomicBool = AtomicBool::new(false); +/// } +/// +/// extern fn handle_sigint(signal: libc::c_int) { +/// let signal = Signal::try_from(signal).unwrap(); +/// SIGNALED.store(signal == Signal::SIGINT, Ordering::Relaxed); +/// } +/// +/// fn main() { +/// let handler = SigHandler::Handler(handle_sigint); +/// unsafe { signal::signal(Signal::SIGINT, handler) }.unwrap(); +/// } +/// ``` +/// +/// # Errors +/// +/// Returns [`Error(Errno::EOPNOTSUPP)`] if `handler` is +/// [`SigAction`][SigActionStruct]. Use [`sigaction`][SigActionFn] instead. +/// +/// `signal` also returns any error from `libc::signal`, such as when an attempt +/// is made to catch a signal that cannot be caught or to ignore a signal that +/// cannot be ignored. +/// +/// [`Error::UnsupportedOperation`]: ../../enum.Error.html#variant.UnsupportedOperation +/// [SigActionStruct]: struct.SigAction.html +/// [sigactionFn]: fn.sigaction.html +pub unsafe fn signal(signal: Signal, handler: SigHandler) -> Result { + let signal = signal as libc::c_int; + let res = match handler { + SigHandler::SigDfl => libc::signal(signal, libc::SIG_DFL), + SigHandler::SigIgn => libc::signal(signal, libc::SIG_IGN), + SigHandler::Handler(handler) => libc::signal(signal, handler as libc::sighandler_t), + #[cfg(not(target_os = "redox"))] + SigHandler::SigAction(_) => return Err(Errno::ENOTSUP), + }; + Errno::result(res).map(|oldhandler| { + match oldhandler { + libc::SIG_DFL => SigHandler::SigDfl, + libc::SIG_IGN => SigHandler::SigIgn, + p => SigHandler::Handler( + *(&p as *const usize + as *const extern fn(libc::c_int)) + as extern fn(libc::c_int)), + } + }) +} + +fn do_pthread_sigmask(how: SigmaskHow, + set: Option<&SigSet>, + oldset: Option<*mut libc::sigset_t>) -> Result<()> { + if set.is_none() && oldset.is_none() { + return Ok(()) + } + + let res = unsafe { + // if set or oldset is None, pass in null pointers instead + libc::pthread_sigmask(how as libc::c_int, + set.map_or_else(ptr::null::, + |s| &s.sigset as *const libc::sigset_t), + oldset.unwrap_or(ptr::null_mut()) + ) + }; + + Errno::result(res).map(drop) +} + +/// Manages the signal mask (set of blocked signals) for the calling thread. +/// +/// If the `set` parameter is `Some(..)`, then the signal mask will be updated with the signal set. +/// The `how` flag decides the type of update. If `set` is `None`, `how` will be ignored, +/// and no modification will take place. +/// +/// If the 'oldset' parameter is `Some(..)` then the current signal mask will be written into it. +/// +/// If both `set` and `oldset` is `Some(..)`, the current signal mask will be written into oldset, +/// and then it will be updated with `set`. +/// +/// If both `set` and `oldset` is None, this function is a no-op. +/// +/// For more information, visit the [`pthread_sigmask`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html), +/// or [`sigprocmask`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html) man pages. +pub fn pthread_sigmask(how: SigmaskHow, + set: Option<&SigSet>, + oldset: Option<&mut SigSet>) -> Result<()> +{ + do_pthread_sigmask(how, set, oldset.map(|os| &mut os.sigset as *mut _ )) +} + +/// Examine and change blocked signals. +/// +/// For more informations see the [`sigprocmask` man +/// pages](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html). +pub fn sigprocmask(how: SigmaskHow, set: Option<&SigSet>, oldset: Option<&mut SigSet>) -> Result<()> { + if set.is_none() && oldset.is_none() { + return Ok(()) + } + + let res = unsafe { + // if set or oldset is None, pass in null pointers instead + libc::sigprocmask(how as libc::c_int, + set.map_or_else(ptr::null::, + |s| &s.sigset as *const libc::sigset_t), + oldset.map_or_else(ptr::null_mut::, + |os| &mut os.sigset as *mut libc::sigset_t)) + }; + + Errno::result(res).map(drop) +} + +/// Send a signal to a process +/// +/// # Arguments +/// +/// * `pid` - Specifies which processes should receive the signal. +/// - If positive, specifies an individual process +/// - If zero, the signal will be sent to all processes whose group +/// ID is equal to the process group ID of the sender. This is a +/// variant of [`killpg`]. +/// - If `-1` and the process has super-user privileges, the signal +/// is sent to all processes exclusing system processes. +/// - If less than `-1`, the signal is sent to all processes whose +/// process group ID is equal to the absolute value of `pid`. +/// * `signal` - Signal to send. If `None`, error checking is performed +/// but no signal is actually sent. +/// +/// See Also +/// [`kill(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html) +pub fn kill>>(pid: Pid, signal: T) -> Result<()> { + let res = unsafe { libc::kill(pid.into(), + match signal.into() { + Some(s) => s as libc::c_int, + None => 0, + }) }; + + Errno::result(res).map(drop) +} + +/// Send a signal to a process group +/// +/// # Arguments +/// +/// * `pgrp` - Process group to signal. If less then or equal 1, the behavior +/// is platform-specific. +/// * `signal` - Signal to send. If `None`, `killpg` will only preform error +/// checking and won't send any signal. +/// +/// See Also [killpg(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/killpg.html). +#[cfg(not(target_os = "fuchsia"))] +pub fn killpg>>(pgrp: Pid, signal: T) -> Result<()> { + let res = unsafe { libc::killpg(pgrp.into(), + match signal.into() { + Some(s) => s as libc::c_int, + None => 0, + }) }; + + Errno::result(res).map(drop) +} + +/// Send a signal to the current thread +/// +/// See Also [raise(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/raise.html) +pub fn raise(signal: Signal) -> Result<()> { + let res = unsafe { libc::raise(signal as libc::c_int) }; + + Errno::result(res).map(drop) +} + + +/// Identifies a thread for [`SigevNotify::SigevThreadId`] +#[cfg(target_os = "freebsd")] +pub type type_of_thread_id = libc::lwpid_t; +/// Identifies a thread for [`SigevNotify::SigevThreadId`] +#[cfg(target_os = "linux")] +pub type type_of_thread_id = libc::pid_t; + +/// Specifies the notification method used by a [`SigEvent`] +// sigval is actually a union of a int and a void*. But it's never really used +// as a pointer, because neither libc nor the kernel ever dereference it. nix +// therefore presents it as an intptr_t, which is how kevent uses it. +#[cfg(not(any(target_os = "openbsd", target_os = "redox")))] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum SigevNotify { + /// No notification will be delivered + SigevNone, + /// Notify by delivering a signal to the process. + SigevSignal { + /// Signal to deliver + signal: Signal, + /// Will be present in the `si_value` field of the [`libc::siginfo_t`] + /// structure of the queued signal. + si_value: libc::intptr_t + }, + // Note: SIGEV_THREAD is not implemented because libc::sigevent does not + // expose a way to set the union members needed by SIGEV_THREAD. + /// Notify by delivering an event to a kqueue. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + SigevKevent { + /// File descriptor of the kqueue to notify. + kq: RawFd, + /// Will be contained in the kevent's `udata` field. + udata: libc::intptr_t + }, + /// Notify by delivering a signal to a thread. + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + SigevThreadId { + /// Signal to send + signal: Signal, + /// LWP ID of the thread to notify + thread_id: type_of_thread_id, + /// Will be present in the `si_value` field of the [`libc::siginfo_t`] + /// structure of the queued signal. + si_value: libc::intptr_t + }, +} + +#[cfg(not(any(target_os = "openbsd", target_os = "redox")))] +mod sigevent { + use std::mem; + use std::ptr; + use super::SigevNotify; + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + use super::type_of_thread_id; + + /// Used to request asynchronous notification of the completion of certain + /// events, such as POSIX AIO and timers. + #[repr(C)] + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct SigEvent { + sigevent: libc::sigevent + } + + impl SigEvent { + /// **Note:** this constructor does not allow the user to set the + /// `sigev_notify_kevent_flags` field. That's considered ok because on FreeBSD + /// at least those flags don't do anything useful. That field is part of a + /// union that shares space with the more genuinely useful fields. + /// + /// **Note:** This constructor also doesn't allow the caller to set the + /// `sigev_notify_function` or `sigev_notify_attributes` fields, which are + /// required for `SIGEV_THREAD`. That's considered ok because on no operating + /// system is `SIGEV_THREAD` the most efficient way to deliver AIO + /// notification. FreeBSD and DragonFly BSD programs should prefer `SIGEV_KEVENT`. + /// Linux, Solaris, and portable programs should prefer `SIGEV_THREAD_ID` or + /// `SIGEV_SIGNAL`. That field is part of a union that shares space with the + /// more genuinely useful `sigev_notify_thread_id` + // Allow invalid_value warning on Fuchsia only. + // See https://github.com/nix-rust/nix/issues/1441 + #[cfg_attr(target_os = "fuchsia", allow(invalid_value))] + pub fn new(sigev_notify: SigevNotify) -> SigEvent { + let mut sev = unsafe { mem::MaybeUninit::::zeroed().assume_init() }; + sev.sigev_notify = match sigev_notify { + SigevNotify::SigevNone => libc::SIGEV_NONE, + SigevNotify::SigevSignal{..} => libc::SIGEV_SIGNAL, + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + SigevNotify::SigevKevent{..} => libc::SIGEV_KEVENT, + #[cfg(target_os = "freebsd")] + SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID, + #[cfg(all(target_os = "linux", target_env = "gnu", not(target_arch = "mips")))] + SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID, + #[cfg(any(all(target_os = "linux", target_env = "musl"), target_arch = "mips"))] + SigevNotify::SigevThreadId{..} => 4 // No SIGEV_THREAD_ID defined + }; + sev.sigev_signo = match sigev_notify { + SigevNotify::SigevSignal{ signal, .. } => signal as libc::c_int, + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + SigevNotify::SigevKevent{ kq, ..} => kq, + #[cfg(any(target_os = "linux", target_os = "freebsd"))] + SigevNotify::SigevThreadId{ signal, .. } => signal as libc::c_int, + _ => 0 + }; + sev.sigev_value.sival_ptr = match sigev_notify { + SigevNotify::SigevNone => ptr::null_mut::(), + SigevNotify::SigevSignal{ si_value, .. } => si_value as *mut libc::c_void, + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + SigevNotify::SigevKevent{ udata, .. } => udata as *mut libc::c_void, + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + SigevNotify::SigevThreadId{ si_value, .. } => si_value as *mut libc::c_void, + }; + SigEvent::set_tid(&mut sev, &sigev_notify); + SigEvent{sigevent: sev} + } + + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + fn set_tid(sev: &mut libc::sigevent, sigev_notify: &SigevNotify) { + sev.sigev_notify_thread_id = match *sigev_notify { + SigevNotify::SigevThreadId { thread_id, .. } => thread_id, + _ => 0 as type_of_thread_id + }; + } + + #[cfg(not(any(target_os = "freebsd", target_os = "linux")))] + fn set_tid(_sev: &mut libc::sigevent, _sigev_notify: &SigevNotify) { + } + + /// Return a copy of the inner structure + pub fn sigevent(&self) -> libc::sigevent { + self.sigevent + } + } + + impl<'a> From<&'a libc::sigevent> for SigEvent { + fn from(sigevent: &libc::sigevent) -> Self { + SigEvent{ sigevent: *sigevent } + } + } +} + +#[cfg(test)] +mod tests { + #[cfg(not(target_os = "redox"))] + use std::thread; + use super::*; + + #[test] + fn test_contains() { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + assert!(mask.contains(SIGUSR1)); + assert!(!mask.contains(SIGUSR2)); + + let all = SigSet::all(); + assert!(all.contains(SIGUSR1)); + assert!(all.contains(SIGUSR2)); + } + + #[test] + fn test_clear() { + let mut set = SigSet::all(); + set.clear(); + for signal in Signal::iterator() { + assert!(!set.contains(signal)); + } + } + + #[test] + fn test_from_str_round_trips() { + for signal in Signal::iterator() { + assert_eq!(signal.as_ref().parse::().unwrap(), signal); + assert_eq!(signal.to_string().parse::().unwrap(), signal); + } + } + + #[test] + fn test_from_str_invalid_value() { + let errval = Err(Errno::EINVAL); + assert_eq!("NOSIGNAL".parse::(), errval); + assert_eq!("kill".parse::(), errval); + assert_eq!("9".parse::(), errval); + } + + #[test] + fn test_extend() { + let mut one_signal = SigSet::empty(); + one_signal.add(SIGUSR1); + + let mut two_signals = SigSet::empty(); + two_signals.add(SIGUSR2); + two_signals.extend(&one_signal); + + assert!(two_signals.contains(SIGUSR1)); + assert!(two_signals.contains(SIGUSR2)); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_set_mask() { + thread::spawn(|| { + let prev_mask = SigSet::thread_get_mask() + .expect("Failed to get existing signal mask!"); + + let mut test_mask = prev_mask; + test_mask.add(SIGUSR1); + + assert!(test_mask.thread_set_mask().is_ok()); + let new_mask = SigSet::thread_get_mask() + .expect("Failed to get new mask!"); + + assert!(new_mask.contains(SIGUSR1)); + assert!(!new_mask.contains(SIGUSR2)); + + prev_mask.thread_set_mask().expect("Failed to revert signal mask!"); + }).join().unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_block() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + assert!(mask.thread_block().is_ok()); + + assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); + }).join().unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_unblock() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + assert!(mask.thread_unblock().is_ok()); + + assert!(!SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); + }).join().unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_swap() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + mask.thread_block().unwrap(); + + assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); + + let mut mask2 = SigSet::empty(); + mask2.add(SIGUSR2); + + let oldmask = mask2.thread_swap_mask(SigmaskHow::SIG_SETMASK) + .unwrap(); + + assert!(oldmask.contains(SIGUSR1)); + assert!(!oldmask.contains(SIGUSR2)); + + assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR2)); + }).join().unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_sigaction() { + thread::spawn(|| { + extern fn test_sigaction_handler(_: libc::c_int) {} + extern fn test_sigaction_action(_: libc::c_int, + _: *mut libc::siginfo_t, _: *mut libc::c_void) {} + + let handler_sig = SigHandler::Handler(test_sigaction_handler); + + let flags = SaFlags::SA_ONSTACK | SaFlags::SA_RESTART | + SaFlags::SA_SIGINFO; + + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + let action_sig = SigAction::new(handler_sig, flags, mask); + + assert_eq!(action_sig.flags(), + SaFlags::SA_ONSTACK | SaFlags::SA_RESTART); + assert_eq!(action_sig.handler(), handler_sig); + + mask = action_sig.mask(); + assert!(mask.contains(SIGUSR1)); + assert!(!mask.contains(SIGUSR2)); + + let handler_act = SigHandler::SigAction(test_sigaction_action); + let action_act = SigAction::new(handler_act, flags, mask); + assert_eq!(action_act.handler(), handler_act); + + let action_dfl = SigAction::new(SigHandler::SigDfl, flags, mask); + assert_eq!(action_dfl.handler(), SigHandler::SigDfl); + + let action_ign = SigAction::new(SigHandler::SigIgn, flags, mask); + assert_eq!(action_ign.handler(), SigHandler::SigIgn); + }).join().unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_sigwait() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + mask.add(SIGUSR2); + mask.thread_block().unwrap(); + + raise(SIGUSR1).unwrap(); + assert_eq!(mask.wait().unwrap(), SIGUSR1); + }).join().unwrap(); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/signalfd.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/signalfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..bc4a4522439ad22789609139206caabed0e6927f --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/signalfd.rs @@ -0,0 +1,169 @@ +//! Interface for the `signalfd` syscall. +//! +//! # Signal discarding +//! When a signal can't be delivered to a process (or thread), it will become a pending signal. +//! Failure to deliver could happen if the signal is blocked by every thread in the process or if +//! the signal handler is still handling a previous signal. +//! +//! If a signal is sent to a process (or thread) that already has a pending signal of the same +//! type, it will be discarded. This means that if signals of the same type are received faster than +//! they are processed, some of those signals will be dropped. Because of this limitation, +//! `signalfd` in itself cannot be used for reliable communication between processes or threads. +//! +//! Once the signal is unblocked, or the signal handler is finished, and a signal is still pending +//! (ie. not consumed from a signalfd) it will be delivered to the signal handler. +//! +//! Please note that signal discarding is not specific to `signalfd`, but also happens with regular +//! signal handlers. +use crate::unistd; +use crate::Result; +use crate::errno::Errno; +pub use crate::sys::signal::{self, SigSet}; +pub use libc::signalfd_siginfo as siginfo; + +use std::os::unix::io::{RawFd, AsRawFd}; +use std::mem; + + +libc_bitflags!{ + pub struct SfdFlags: libc::c_int { + SFD_NONBLOCK; + SFD_CLOEXEC; + } +} + +pub const SIGNALFD_NEW: RawFd = -1; +#[deprecated(since = "0.23.0", note = "use mem::size_of::() instead")] +pub const SIGNALFD_SIGINFO_SIZE: usize = mem::size_of::(); + +/// Creates a new file descriptor for reading signals. +/// +/// **Important:** please read the module level documentation about signal discarding before using +/// this function! +/// +/// The `mask` parameter specifies the set of signals that can be accepted via this file descriptor. +/// +/// A signal must be blocked on every thread in a process, otherwise it won't be visible from +/// signalfd (the default handler will be invoked instead). +/// +/// See [the signalfd man page for more information](https://man7.org/linux/man-pages/man2/signalfd.2.html) +pub fn signalfd(fd: RawFd, mask: &SigSet, flags: SfdFlags) -> Result { + unsafe { + Errno::result(libc::signalfd(fd as libc::c_int, mask.as_ref(), flags.bits())) + } +} + +/// A helper struct for creating, reading and closing a `signalfd` instance. +/// +/// **Important:** please read the module level documentation about signal discarding before using +/// this struct! +/// +/// # Examples +/// +/// ``` +/// # use nix::sys::signalfd::*; +/// // Set the thread to block the SIGUSR1 signal, otherwise the default handler will be used +/// let mut mask = SigSet::empty(); +/// mask.add(signal::SIGUSR1); +/// mask.thread_block().unwrap(); +/// +/// // Signals are queued up on the file descriptor +/// let mut sfd = SignalFd::with_flags(&mask, SfdFlags::SFD_NONBLOCK).unwrap(); +/// +/// match sfd.read_signal() { +/// // we caught a signal +/// Ok(Some(sig)) => (), +/// // there were no signals waiting (only happens when the SFD_NONBLOCK flag is set, +/// // otherwise the read_signal call blocks) +/// Ok(None) => (), +/// Err(err) => (), // some error happend +/// } +/// ``` +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct SignalFd(RawFd); + +impl SignalFd { + pub fn new(mask: &SigSet) -> Result { + Self::with_flags(mask, SfdFlags::empty()) + } + + pub fn with_flags(mask: &SigSet, flags: SfdFlags) -> Result { + let fd = signalfd(SIGNALFD_NEW, mask, flags)?; + + Ok(SignalFd(fd)) + } + + pub fn set_mask(&mut self, mask: &SigSet) -> Result<()> { + signalfd(self.0, mask, SfdFlags::empty()).map(drop) + } + + pub fn read_signal(&mut self) -> Result> { + let mut buffer = mem::MaybeUninit::::uninit(); + + let size = mem::size_of_val(&buffer); + let res = Errno::result(unsafe { + libc::read(self.0, buffer.as_mut_ptr() as *mut libc::c_void, size) + }).map(|r| r as usize); + match res { + Ok(x) if x == size => Ok(Some(unsafe { buffer.assume_init() })), + Ok(_) => unreachable!("partial read on signalfd"), + Err(Errno::EAGAIN) => Ok(None), + Err(error) => Err(error) + } + } +} + +impl Drop for SignalFd { + fn drop(&mut self) { + let e = unistd::close(self.0); + if !std::thread::panicking() && e == Err(Errno::EBADF) { + panic!("Closing an invalid file descriptor!"); + }; + } +} + +impl AsRawFd for SignalFd { + fn as_raw_fd(&self) -> RawFd { + self.0 + } +} + +impl Iterator for SignalFd { + type Item = siginfo; + + fn next(&mut self) -> Option { + match self.read_signal() { + Ok(Some(sig)) => Some(sig), + Ok(None) | Err(_) => None, + } + } +} + + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn create_signalfd() { + let mask = SigSet::empty(); + let fd = SignalFd::new(&mask); + assert!(fd.is_ok()); + } + + #[test] + fn create_signalfd_with_opts() { + let mask = SigSet::empty(); + let fd = SignalFd::with_flags(&mask, SfdFlags::SFD_CLOEXEC | SfdFlags::SFD_NONBLOCK); + assert!(fd.is_ok()); + } + + #[test] + fn read_empty_signalfd() { + let mask = SigSet::empty(); + let mut fd = SignalFd::with_flags(&mask, SfdFlags::SFD_NONBLOCK).unwrap(); + + let res = fd.read_signal(); + assert!(res.unwrap().is_none()); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/socket/addr.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/socket/addr.rs new file mode 100644 index 0000000000000000000000000000000000000000..b119642b3fc661374becbd2a6fc4ac80d04e71c3 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/socket/addr.rs @@ -0,0 +1,1447 @@ +use super::sa_family_t; +use crate::{Result, NixPath}; +use crate::errno::Errno; +use memoffset::offset_of; +use std::{fmt, mem, net, ptr, slice}; +use std::ffi::OsStr; +use std::hash::{Hash, Hasher}; +use std::path::Path; +use std::os::unix::ffi::OsStrExt; +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::sys::socket::addr::netlink::NetlinkAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::sys::socket::addr::alg::AlgAddr; +#[cfg(any(target_os = "ios", target_os = "macos"))] +use std::os::unix::io::RawFd; +#[cfg(any(target_os = "ios", target_os = "macos"))] +use crate::sys::socket::addr::sys_control::SysControlAddr; +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "fuchsia"))] +pub use self::datalink::LinkAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::vsock::VsockAddr; + +/// These constants specify the protocol family to be used +/// in [`socket`](fn.socket.html) and [`socketpair`](fn.socketpair.html) +#[repr(i32)] +#[non_exhaustive] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] +pub enum AddressFamily { + /// Local communication (see [`unix(7)`](https://man7.org/linux/man-pages/man7/unix.7.html)) + Unix = libc::AF_UNIX, + /// IPv4 Internet protocols (see [`ip(7)`](https://man7.org/linux/man-pages/man7/ip.7.html)) + Inet = libc::AF_INET, + /// IPv6 Internet protocols (see [`ipv6(7)`](https://man7.org/linux/man-pages/man7/ipv6.7.html)) + Inet6 = libc::AF_INET6, + /// Kernel user interface device (see [`netlink(7)`](https://man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + Netlink = libc::AF_NETLINK, + /// Low level packet interface (see [`packet(7)`](https://man7.org/linux/man-pages/man7/packet.7.html)) + #[cfg(any(target_os = "android", + target_os = "linux", + target_os = "illumos", + target_os = "fuchsia", + target_os = "solaris"))] + Packet = libc::AF_PACKET, + /// KEXT Controls and Notifications + #[cfg(any(target_os = "ios", target_os = "macos"))] + System = libc::AF_SYSTEM, + /// Amateur radio AX.25 protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + Ax25 = libc::AF_AX25, + /// IPX - Novell protocols + Ipx = libc::AF_IPX, + /// AppleTalk + AppleTalk = libc::AF_APPLETALK, + #[cfg(any(target_os = "android", target_os = "linux"))] + NetRom = libc::AF_NETROM, + #[cfg(any(target_os = "android", target_os = "linux"))] + Bridge = libc::AF_BRIDGE, + /// Access to raw ATM PVCs + #[cfg(any(target_os = "android", target_os = "linux"))] + AtmPvc = libc::AF_ATMPVC, + /// ITU-T X.25 / ISO-8208 protocol (see [`x25(7)`](https://man7.org/linux/man-pages/man7/x25.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + X25 = libc::AF_X25, + #[cfg(any(target_os = "android", target_os = "linux"))] + Rose = libc::AF_ROSE, + Decnet = libc::AF_DECnet, + #[cfg(any(target_os = "android", target_os = "linux"))] + NetBeui = libc::AF_NETBEUI, + #[cfg(any(target_os = "android", target_os = "linux"))] + Security = libc::AF_SECURITY, + #[cfg(any(target_os = "android", target_os = "linux"))] + Key = libc::AF_KEY, + #[cfg(any(target_os = "android", target_os = "linux"))] + Ash = libc::AF_ASH, + #[cfg(any(target_os = "android", target_os = "linux"))] + Econet = libc::AF_ECONET, + #[cfg(any(target_os = "android", target_os = "linux"))] + AtmSvc = libc::AF_ATMSVC, + #[cfg(any(target_os = "android", target_os = "linux"))] + Rds = libc::AF_RDS, + Sna = libc::AF_SNA, + #[cfg(any(target_os = "android", target_os = "linux"))] + Irda = libc::AF_IRDA, + #[cfg(any(target_os = "android", target_os = "linux"))] + Pppox = libc::AF_PPPOX, + #[cfg(any(target_os = "android", target_os = "linux"))] + Wanpipe = libc::AF_WANPIPE, + #[cfg(any(target_os = "android", target_os = "linux"))] + Llc = libc::AF_LLC, + #[cfg(target_os = "linux")] + Ib = libc::AF_IB, + #[cfg(target_os = "linux")] + Mpls = libc::AF_MPLS, + #[cfg(any(target_os = "android", target_os = "linux"))] + Can = libc::AF_CAN, + #[cfg(any(target_os = "android", target_os = "linux"))] + Tipc = libc::AF_TIPC, + #[cfg(not(any(target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "solaris")))] + Bluetooth = libc::AF_BLUETOOTH, + #[cfg(any(target_os = "android", target_os = "linux"))] + Iucv = libc::AF_IUCV, + #[cfg(any(target_os = "android", target_os = "linux"))] + RxRpc = libc::AF_RXRPC, + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + Isdn = libc::AF_ISDN, + #[cfg(any(target_os = "android", target_os = "linux"))] + Phonet = libc::AF_PHONET, + #[cfg(any(target_os = "android", target_os = "linux"))] + Ieee802154 = libc::AF_IEEE802154, + #[cfg(any(target_os = "android", target_os = "linux"))] + Caif = libc::AF_CAIF, + /// Interface to kernel crypto API + #[cfg(any(target_os = "android", target_os = "linux"))] + Alg = libc::AF_ALG, + #[cfg(target_os = "linux")] + Nfc = libc::AF_NFC, + #[cfg(any(target_os = "android", target_os = "linux"))] + Vsock = libc::AF_VSOCK, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + ImpLink = libc::AF_IMPLINK, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Pup = libc::AF_PUP, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Chaos = libc::AF_CHAOS, + #[cfg(any(target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Ns = libc::AF_NS, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Iso = libc::AF_ISO, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Datakit = libc::AF_DATAKIT, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Ccitt = libc::AF_CCITT, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Dli = libc::AF_DLI, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Lat = libc::AF_LAT, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Hylink = libc::AF_HYLINK, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + Link = libc::AF_LINK, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Coip = libc::AF_COIP, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Cnt = libc::AF_CNT, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + Natm = libc::AF_NATM, + /// Unspecified address family, (see [`getaddrinfo(3)`](https://man7.org/linux/man-pages/man3/getaddrinfo.3.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + Unspec = libc::AF_UNSPEC, +} + +impl AddressFamily { + /// Create a new `AddressFamily` from an integer value retrieved from `libc`, usually from + /// the `sa_family` field of a `sockaddr`. + /// + /// Currently only supports these address families: Unix, Inet (v4 & v6), Netlink, Link/Packet + /// and System. Returns None for unsupported or unknown address families. + pub const fn from_i32(family: i32) -> Option { + match family { + libc::AF_UNIX => Some(AddressFamily::Unix), + libc::AF_INET => Some(AddressFamily::Inet), + libc::AF_INET6 => Some(AddressFamily::Inet6), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => Some(AddressFamily::Netlink), + #[cfg(any(target_os = "macos", target_os = "macos"))] + libc::AF_SYSTEM => Some(AddressFamily::System), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_PACKET => Some(AddressFamily::Packet), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + libc::AF_LINK => Some(AddressFamily::Link), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => Some(AddressFamily::Vsock), + _ => None + } + } +} + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum InetAddr { + V4(libc::sockaddr_in), + V6(libc::sockaddr_in6), +} + +impl InetAddr { + #[allow(clippy::needless_update)] // It isn't needless on all OSes + pub fn from_std(std: &net::SocketAddr) -> InetAddr { + match *std { + net::SocketAddr::V4(ref addr) => { + InetAddr::V4(libc::sockaddr_in { + sin_family: AddressFamily::Inet as sa_family_t, + sin_port: addr.port().to_be(), // network byte order + sin_addr: Ipv4Addr::from_std(addr.ip()).0, + .. unsafe { mem::zeroed() } + }) + } + net::SocketAddr::V6(ref addr) => { + InetAddr::V6(libc::sockaddr_in6 { + sin6_family: AddressFamily::Inet6 as sa_family_t, + sin6_port: addr.port().to_be(), // network byte order + sin6_addr: Ipv6Addr::from_std(addr.ip()).0, + sin6_flowinfo: addr.flowinfo(), // host byte order + sin6_scope_id: addr.scope_id(), // host byte order + .. unsafe { mem::zeroed() } + }) + } + } + } + + #[allow(clippy::needless_update)] // It isn't needless on all OSes + pub fn new(ip: IpAddr, port: u16) -> InetAddr { + match ip { + IpAddr::V4(ref ip) => { + InetAddr::V4(libc::sockaddr_in { + sin_family: AddressFamily::Inet as sa_family_t, + sin_port: port.to_be(), + sin_addr: ip.0, + .. unsafe { mem::zeroed() } + }) + } + IpAddr::V6(ref ip) => { + InetAddr::V6(libc::sockaddr_in6 { + sin6_family: AddressFamily::Inet6 as sa_family_t, + sin6_port: port.to_be(), + sin6_addr: ip.0, + .. unsafe { mem::zeroed() } + }) + } + } + } + /// Gets the IP address associated with this socket address. + pub const fn ip(&self) -> IpAddr { + match *self { + InetAddr::V4(ref sa) => IpAddr::V4(Ipv4Addr(sa.sin_addr)), + InetAddr::V6(ref sa) => IpAddr::V6(Ipv6Addr(sa.sin6_addr)), + } + } + + /// Gets the port number associated with this socket address + pub const fn port(&self) -> u16 { + match *self { + InetAddr::V6(ref sa) => u16::from_be(sa.sin6_port), + InetAddr::V4(ref sa) => u16::from_be(sa.sin_port), + } + } + + pub fn to_std(&self) -> net::SocketAddr { + match *self { + InetAddr::V4(ref sa) => net::SocketAddr::V4( + net::SocketAddrV4::new( + Ipv4Addr(sa.sin_addr).to_std(), + self.port())), + InetAddr::V6(ref sa) => net::SocketAddr::V6( + net::SocketAddrV6::new( + Ipv6Addr(sa.sin6_addr).to_std(), + self.port(), + sa.sin6_flowinfo, + sa.sin6_scope_id)), + } + } + + #[deprecated(since = "0.23.0", note = "use .to_string() instead")] + pub fn to_str(&self) -> String { + format!("{}", self) + } +} + +impl fmt::Display for InetAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + InetAddr::V4(_) => write!(f, "{}:{}", self.ip(), self.port()), + InetAddr::V6(_) => write!(f, "[{}]:{}", self.ip(), self.port()), + } + } +} + +/* + * + * ===== IpAddr ===== + * + */ +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum IpAddr { + V4(Ipv4Addr), + V6(Ipv6Addr), +} + +impl IpAddr { + /// Create a new IpAddr that contains an IPv4 address. + /// + /// The result will represent the IP address a.b.c.d + pub const fn new_v4(a: u8, b: u8, c: u8, d: u8) -> IpAddr { + IpAddr::V4(Ipv4Addr::new(a, b, c, d)) + } + + /// Create a new IpAddr that contains an IPv6 address. + /// + /// The result will represent the IP address a:b:c:d:e:f + #[allow(clippy::many_single_char_names)] + #[allow(clippy::too_many_arguments)] + pub const fn new_v6(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> IpAddr { + IpAddr::V6(Ipv6Addr::new(a, b, c, d, e, f, g, h)) + } + + pub fn from_std(std: &net::IpAddr) -> IpAddr { + match *std { + net::IpAddr::V4(ref std) => IpAddr::V4(Ipv4Addr::from_std(std)), + net::IpAddr::V6(ref std) => IpAddr::V6(Ipv6Addr::from_std(std)), + } + } + + pub const fn to_std(&self) -> net::IpAddr { + match *self { + IpAddr::V4(ref ip) => net::IpAddr::V4(ip.to_std()), + IpAddr::V6(ref ip) => net::IpAddr::V6(ip.to_std()), + } + } +} + +impl fmt::Display for IpAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + IpAddr::V4(ref v4) => v4.fmt(f), + IpAddr::V6(ref v6) => v6.fmt(f) + } + } +} + +/* + * + * ===== Ipv4Addr ===== + * + */ + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct Ipv4Addr(pub libc::in_addr); + +impl Ipv4Addr { + #[allow(clippy::identity_op)] // More readable this way + pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr { + let ip = (((a as u32) << 24) | + ((b as u32) << 16) | + ((c as u32) << 8) | + ((d as u32) << 0)).to_be(); + + Ipv4Addr(libc::in_addr { s_addr: ip }) + } + + // Use pass by reference for symmetry with Ipv6Addr::from_std + #[allow(clippy::trivially_copy_pass_by_ref)] + pub fn from_std(std: &net::Ipv4Addr) -> Ipv4Addr { + let bits = std.octets(); + Ipv4Addr::new(bits[0], bits[1], bits[2], bits[3]) + } + + pub const fn any() -> Ipv4Addr { + Ipv4Addr(libc::in_addr { s_addr: libc::INADDR_ANY }) + } + + pub const fn octets(self) -> [u8; 4] { + let bits = u32::from_be(self.0.s_addr); + [(bits >> 24) as u8, (bits >> 16) as u8, (bits >> 8) as u8, bits as u8] + } + + pub const fn to_std(self) -> net::Ipv4Addr { + let bits = self.octets(); + net::Ipv4Addr::new(bits[0], bits[1], bits[2], bits[3]) + } +} + +impl fmt::Display for Ipv4Addr { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + let octets = self.octets(); + write!(fmt, "{}.{}.{}.{}", octets[0], octets[1], octets[2], octets[3]) + } +} + +/* + * + * ===== Ipv6Addr ===== + * + */ + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct Ipv6Addr(pub libc::in6_addr); + +// Note that IPv6 addresses are stored in big endian order on all architectures. +// See https://tools.ietf.org/html/rfc1700 or consult your favorite search +// engine. + +macro_rules! to_u8_array { + ($($num:ident),*) => { + [ $(($num>>8) as u8, ($num&0xff) as u8,)* ] + } +} + +macro_rules! to_u16_array { + ($slf:ident, $($first:expr, $second:expr),*) => { + [$( (($slf.0.s6_addr[$first] as u16) << 8) + $slf.0.s6_addr[$second] as u16,)*] + } +} + +impl Ipv6Addr { + #[allow(clippy::many_single_char_names)] + #[allow(clippy::too_many_arguments)] + pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr { + Ipv6Addr(libc::in6_addr{s6_addr: to_u8_array!(a,b,c,d,e,f,g,h)}) + } + + pub fn from_std(std: &net::Ipv6Addr) -> Ipv6Addr { + let s = std.segments(); + Ipv6Addr::new(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]) + } + + /// Return the eight 16-bit segments that make up this address + pub const fn segments(&self) -> [u16; 8] { + to_u16_array!(self, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) + } + + pub const fn to_std(&self) -> net::Ipv6Addr { + let s = self.segments(); + net::Ipv6Addr::new(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]) + } +} + +impl fmt::Display for Ipv6Addr { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + self.to_std().fmt(fmt) + } +} + +/// A wrapper around `sockaddr_un`. +#[derive(Clone, Copy, Debug)] +pub struct UnixAddr { + // INVARIANT: sun & path_len are valid as defined by docs for from_raw_parts + sun: libc::sockaddr_un, + path_len: usize, +} + +// linux man page unix(7) says there are 3 kinds of unix socket: +// pathname: addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1 +// unnamed: addrlen = sizeof(sa_family_t) +// abstract: addren > sizeof(sa_family_t), name = sun_path[..(addrlen - sizeof(sa_family_t))] +// +// what we call path_len = addrlen - offsetof(struct sockaddr_un, sun_path) +#[derive(PartialEq, Eq, Hash)] +enum UnixAddrKind<'a> { + Pathname(&'a Path), + Unnamed, + #[cfg(any(target_os = "android", target_os = "linux"))] + Abstract(&'a [u8]), +} +impl<'a> UnixAddrKind<'a> { + /// Safety: sun & path_len must be valid + unsafe fn get(sun: &'a libc::sockaddr_un, path_len: usize) -> Self { + if path_len == 0 { + return Self::Unnamed; + } + #[cfg(any(target_os = "android", target_os = "linux"))] + if sun.sun_path[0] == 0 { + let name = + slice::from_raw_parts(sun.sun_path.as_ptr().add(1) as *const u8, path_len - 1); + return Self::Abstract(name); + } + let pathname = slice::from_raw_parts(sun.sun_path.as_ptr() as *const u8, path_len - 1); + Self::Pathname(Path::new(OsStr::from_bytes(pathname))) + } +} + +impl UnixAddr { + /// Create a new sockaddr_un representing a filesystem path. + pub fn new(path: &P) -> Result { + path.with_nix_path(|cstr| { + unsafe { + let mut ret = libc::sockaddr_un { + sun_family: AddressFamily::Unix as sa_family_t, + .. mem::zeroed() + }; + + let bytes = cstr.to_bytes(); + + if bytes.len() >= ret.sun_path.len() { + return Err(Errno::ENAMETOOLONG); + } + + ptr::copy_nonoverlapping(bytes.as_ptr(), + ret.sun_path.as_mut_ptr() as *mut u8, + bytes.len()); + + Ok(UnixAddr::from_raw_parts(ret, bytes.len() + 1)) + } + })? + } + + /// Create a new `sockaddr_un` representing an address in the "abstract namespace". + /// + /// The leading null byte for the abstract namespace is automatically added; + /// thus the input `path` is expected to be the bare name, not null-prefixed. + /// This is a Linux-specific extension, primarily used to allow chrooted + /// processes to communicate with processes having a different filesystem view. + #[cfg(any(target_os = "android", target_os = "linux"))] + pub fn new_abstract(path: &[u8]) -> Result { + unsafe { + let mut ret = libc::sockaddr_un { + sun_family: AddressFamily::Unix as sa_family_t, + .. mem::zeroed() + }; + + if path.len() >= ret.sun_path.len() { + return Err(Errno::ENAMETOOLONG); + } + + // Abstract addresses are represented by sun_path[0] == + // b'\0', so copy starting one byte in. + ptr::copy_nonoverlapping(path.as_ptr(), + ret.sun_path.as_mut_ptr().offset(1) as *mut u8, + path.len()); + + Ok(UnixAddr::from_raw_parts(ret, path.len() + 1)) + } + } + + /// Create a UnixAddr from a raw `sockaddr_un` struct and a size. `path_len` is the "addrlen" + /// of this address, but minus `offsetof(struct sockaddr_un, sun_path)`. Basically the length + /// of the data in `sun_path`. + /// + /// # Safety + /// This pair of sockaddr_un & path_len must be a valid unix addr, which means: + /// - path_len <= sockaddr_un.sun_path.len() + /// - if this is a unix addr with a pathname, sun.sun_path is a nul-terminated fs path and + /// sun.sun_path[path_len - 1] == 0 || sun.sun_path[path_len] == 0 + pub(crate) unsafe fn from_raw_parts(sun: libc::sockaddr_un, mut path_len: usize) -> UnixAddr { + if let UnixAddrKind::Pathname(_) = UnixAddrKind::get(&sun, path_len) { + if sun.sun_path[path_len - 1] != 0 { + assert_eq!(sun.sun_path[path_len], 0); + path_len += 1 + } + } + UnixAddr { sun, path_len } + } + + fn kind(&self) -> UnixAddrKind<'_> { + // SAFETY: our sockaddr is always valid because of the invariant on the struct + unsafe { UnixAddrKind::get(&self.sun, self.path_len) } + } + + /// If this address represents a filesystem path, return that path. + pub fn path(&self) -> Option<&Path> { + match self.kind() { + UnixAddrKind::Pathname(path) => Some(path), + _ => None, + } + } + + /// If this address represents an abstract socket, return its name. + /// + /// For abstract sockets only the bare name is returned, without the + /// leading null byte. `None` is returned for unnamed or path-backed sockets. + #[cfg(any(target_os = "android", target_os = "linux"))] + pub fn as_abstract(&self) -> Option<&[u8]> { + match self.kind() { + UnixAddrKind::Abstract(name) => Some(name), + _ => None, + } + } + + /// Returns the addrlen of this socket - `offsetof(struct sockaddr_un, sun_path)` + #[inline] + pub fn path_len(&self) -> usize { + self.path_len + } + /// Returns a pointer to the raw `sockaddr_un` struct + #[inline] + pub fn as_ptr(&self) -> *const libc::sockaddr_un { + &self.sun + } + /// Returns a mutable pointer to the raw `sockaddr_un` struct + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut libc::sockaddr_un { + &mut self.sun + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn fmt_abstract(abs: &[u8], f: &mut fmt::Formatter) -> fmt::Result { + use fmt::Write; + f.write_str("@\"")?; + for &b in abs { + use fmt::Display; + char::from(b).escape_default().fmt(f)?; + } + f.write_char('"')?; + Ok(()) +} + +impl fmt::Display for UnixAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self.kind() { + UnixAddrKind::Pathname(path) => path.display().fmt(f), + UnixAddrKind::Unnamed => f.pad(""), + #[cfg(any(target_os = "android", target_os = "linux"))] + UnixAddrKind::Abstract(name) => fmt_abstract(name, f), + } + } +} + +impl PartialEq for UnixAddr { + fn eq(&self, other: &UnixAddr) -> bool { + self.kind() == other.kind() + } +} + +impl Eq for UnixAddr {} + +impl Hash for UnixAddr { + fn hash(&self, s: &mut H) { + self.kind().hash(s) + } +} + +/// Represents a socket address +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum SockAddr { + Inet(InetAddr), + Unix(UnixAddr), + #[cfg(any(target_os = "android", target_os = "linux"))] + Netlink(NetlinkAddr), + #[cfg(any(target_os = "android", target_os = "linux"))] + Alg(AlgAddr), + #[cfg(any(target_os = "ios", target_os = "macos"))] + SysControl(SysControlAddr), + /// Datalink address (MAC) + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + Link(LinkAddr), + #[cfg(any(target_os = "android", target_os = "linux"))] + Vsock(VsockAddr), +} + +impl SockAddr { + pub fn new_inet(addr: InetAddr) -> SockAddr { + SockAddr::Inet(addr) + } + + pub fn new_unix(path: &P) -> Result { + Ok(SockAddr::Unix(UnixAddr::new(path)?)) + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + pub fn new_netlink(pid: u32, groups: u32) -> SockAddr { + SockAddr::Netlink(NetlinkAddr::new(pid, groups)) + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + pub fn new_alg(alg_type: &str, alg_name: &str) -> SockAddr { + SockAddr::Alg(AlgAddr::new(alg_type, alg_name)) + } + + #[cfg(any(target_os = "ios", target_os = "macos"))] + pub fn new_sys_control(sockfd: RawFd, name: &str, unit: u32) -> Result { + SysControlAddr::from_name(sockfd, name, unit).map(SockAddr::SysControl) + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + pub fn new_vsock(cid: u32, port: u32) -> SockAddr { + SockAddr::Vsock(VsockAddr::new(cid, port)) + } + + pub fn family(&self) -> AddressFamily { + match *self { + SockAddr::Inet(InetAddr::V4(..)) => AddressFamily::Inet, + SockAddr::Inet(InetAddr::V6(..)) => AddressFamily::Inet6, + SockAddr::Unix(..) => AddressFamily::Unix, + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Netlink(..) => AddressFamily::Netlink, + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Alg(..) => AddressFamily::Alg, + #[cfg(any(target_os = "ios", target_os = "macos"))] + SockAddr::SysControl(..) => AddressFamily::System, + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Link(..) => AddressFamily::Packet, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + SockAddr::Link(..) => AddressFamily::Link, + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Vsock(..) => AddressFamily::Vsock, + } + } + + #[deprecated(since = "0.23.0", note = "use .to_string() instead")] + pub fn to_str(&self) -> String { + format!("{}", self) + } + + /// Creates a `SockAddr` struct from libc's sockaddr. + /// + /// Supports only the following address families: Unix, Inet (v4 & v6), Netlink and System. + /// Returns None for unsupported families. + /// + /// # Safety + /// + /// unsafe because it takes a raw pointer as argument. The caller must + /// ensure that the pointer is valid. + #[cfg(not(target_os = "fuchsia"))] + pub(crate) unsafe fn from_libc_sockaddr(addr: *const libc::sockaddr) -> Option { + if addr.is_null() { + None + } else { + match AddressFamily::from_i32(i32::from((*addr).sa_family)) { + Some(AddressFamily::Unix) => None, + Some(AddressFamily::Inet) => Some(SockAddr::Inet( + InetAddr::V4(*(addr as *const libc::sockaddr_in)))), + Some(AddressFamily::Inet6) => Some(SockAddr::Inet( + InetAddr::V6(*(addr as *const libc::sockaddr_in6)))), + #[cfg(any(target_os = "android", target_os = "linux"))] + Some(AddressFamily::Netlink) => Some(SockAddr::Netlink( + NetlinkAddr(*(addr as *const libc::sockaddr_nl)))), + #[cfg(any(target_os = "ios", target_os = "macos"))] + Some(AddressFamily::System) => Some(SockAddr::SysControl( + SysControlAddr(*(addr as *const libc::sockaddr_ctl)))), + #[cfg(any(target_os = "android", target_os = "linux"))] + Some(AddressFamily::Packet) => Some(SockAddr::Link( + LinkAddr(*(addr as *const libc::sockaddr_ll)))), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + Some(AddressFamily::Link) => { + let ether_addr = LinkAddr(*(addr as *const libc::sockaddr_dl)); + if ether_addr.is_empty() { + None + } else { + Some(SockAddr::Link(ether_addr)) + } + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + Some(AddressFamily::Vsock) => Some(SockAddr::Vsock( + VsockAddr(*(addr as *const libc::sockaddr_vm)))), + // Other address families are currently not supported and simply yield a None + // entry instead of a proper conversion to a `SockAddr`. + Some(_) | None => None, + } + } + } + + /// Conversion from nix's SockAddr type to the underlying libc sockaddr type. + /// + /// This is useful for interfacing with other libc functions that don't yet have nix wrappers. + /// Returns a reference to the underlying data type (as a sockaddr reference) along + /// with the size of the actual data type. sockaddr is commonly used as a proxy for + /// a superclass as C doesn't support inheritance, so many functions that take + /// a sockaddr * need to take the size of the underlying type as well and then internally cast it back. + pub fn as_ffi_pair(&self) -> (&libc::sockaddr, libc::socklen_t) { + match *self { + SockAddr::Inet(InetAddr::V4(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_in as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + SockAddr::Inet(InetAddr::V6(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_in6 as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + SockAddr::Unix(UnixAddr { ref sun, path_len }) => ( + // This cast is always allowed in C + unsafe { + &*(sun as *const libc::sockaddr_un as *const libc::sockaddr) + }, + (path_len + offset_of!(libc::sockaddr_un, sun_path)) as libc::socklen_t + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Netlink(NetlinkAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_nl as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Alg(AlgAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_alg as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + ), + #[cfg(any(target_os = "ios", target_os = "macos"))] + SockAddr::SysControl(SysControlAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_ctl as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Link(LinkAddr(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_ll as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + SockAddr::Link(LinkAddr(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_dl as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Vsock(VsockAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_vm as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + ), + } + } +} + +impl fmt::Display for SockAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + SockAddr::Inet(ref inet) => inet.fmt(f), + SockAddr::Unix(ref unix) => unix.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Netlink(ref nl) => nl.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Alg(ref nl) => nl.fmt(f), + #[cfg(any(target_os = "ios", target_os = "macos"))] + SockAddr::SysControl(ref sc) => sc.fmt(f), + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + SockAddr::Link(ref ether_addr) => ether_addr.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Vsock(ref svm) => svm.fmt(f), + } + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub mod netlink { + use crate::sys::socket::addr::AddressFamily; + use libc::{sa_family_t, sockaddr_nl}; + use std::{fmt, mem}; + + #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] + pub struct NetlinkAddr(pub sockaddr_nl); + + impl NetlinkAddr { + pub fn new(pid: u32, groups: u32) -> NetlinkAddr { + let mut addr: sockaddr_nl = unsafe { mem::zeroed() }; + addr.nl_family = AddressFamily::Netlink as sa_family_t; + addr.nl_pid = pid; + addr.nl_groups = groups; + + NetlinkAddr(addr) + } + + pub const fn pid(&self) -> u32 { + self.0.nl_pid + } + + pub const fn groups(&self) -> u32 { + self.0.nl_groups + } + } + + impl fmt::Display for NetlinkAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "pid: {} groups: {}", self.pid(), self.groups()) + } + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub mod alg { + use libc::{AF_ALG, sockaddr_alg, c_char}; + use std::{fmt, mem, str}; + use std::hash::{Hash, Hasher}; + use std::ffi::CStr; + + #[derive(Copy, Clone)] + pub struct AlgAddr(pub sockaddr_alg); + + // , PartialEq, Eq, Debug, Hash + impl PartialEq for AlgAddr { + fn eq(&self, other: &Self) -> bool { + let (inner, other) = (self.0, other.0); + (inner.salg_family, &inner.salg_type[..], inner.salg_feat, inner.salg_mask, &inner.salg_name[..]) == + (other.salg_family, &other.salg_type[..], other.salg_feat, other.salg_mask, &other.salg_name[..]) + } + } + + impl Eq for AlgAddr {} + + impl Hash for AlgAddr { + fn hash(&self, s: &mut H) { + let inner = self.0; + (inner.salg_family, &inner.salg_type[..], inner.salg_feat, inner.salg_mask, &inner.salg_name[..]).hash(s); + } + } + + impl AlgAddr { + pub fn new(alg_type: &str, alg_name: &str) -> AlgAddr { + let mut addr: sockaddr_alg = unsafe { mem::zeroed() }; + addr.salg_family = AF_ALG as u16; + addr.salg_type[..alg_type.len()].copy_from_slice(alg_type.to_string().as_bytes()); + addr.salg_name[..alg_name.len()].copy_from_slice(alg_name.to_string().as_bytes()); + + AlgAddr(addr) + } + + + pub fn alg_type(&self) -> &CStr { + unsafe { CStr::from_ptr(self.0.salg_type.as_ptr() as *const c_char) } + } + + pub fn alg_name(&self) -> &CStr { + unsafe { CStr::from_ptr(self.0.salg_name.as_ptr() as *const c_char) } + } + } + + impl fmt::Display for AlgAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "type: {} alg: {}", + self.alg_name().to_string_lossy(), + self.alg_type().to_string_lossy()) + } + } + + impl fmt::Debug for AlgAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(self, f) + } + } +} + +#[cfg(any(target_os = "ios", target_os = "macos"))] +pub mod sys_control { + use crate::sys::socket::addr::AddressFamily; + use libc::{self, c_uchar}; + use std::{fmt, mem}; + use std::os::unix::io::RawFd; + use crate::{Errno, Result}; + + // FIXME: Move type into `libc` + #[repr(C)] + #[derive(Clone, Copy)] + #[allow(missing_debug_implementations)] + pub struct ctl_ioc_info { + pub ctl_id: u32, + pub ctl_name: [c_uchar; MAX_KCTL_NAME], + } + + const CTL_IOC_MAGIC: u8 = b'N'; + const CTL_IOC_INFO: u8 = 3; + const MAX_KCTL_NAME: usize = 96; + + ioctl_readwrite!(ctl_info, CTL_IOC_MAGIC, CTL_IOC_INFO, ctl_ioc_info); + + #[repr(C)] + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct SysControlAddr(pub libc::sockaddr_ctl); + + impl SysControlAddr { + pub const fn new(id: u32, unit: u32) -> SysControlAddr { + let addr = libc::sockaddr_ctl { + sc_len: mem::size_of::() as c_uchar, + sc_family: AddressFamily::System as c_uchar, + ss_sysaddr: libc::AF_SYS_CONTROL as u16, + sc_id: id, + sc_unit: unit, + sc_reserved: [0; 5] + }; + + SysControlAddr(addr) + } + + pub fn from_name(sockfd: RawFd, name: &str, unit: u32) -> Result { + if name.len() > MAX_KCTL_NAME { + return Err(Errno::ENAMETOOLONG); + } + + let mut ctl_name = [0; MAX_KCTL_NAME]; + ctl_name[..name.len()].clone_from_slice(name.as_bytes()); + let mut info = ctl_ioc_info { ctl_id: 0, ctl_name }; + + unsafe { ctl_info(sockfd, &mut info)?; } + + Ok(SysControlAddr::new(info.ctl_id, unit)) + } + + pub const fn id(&self) -> u32 { + self.0.sc_id + } + + pub const fn unit(&self) -> u32 { + self.0.sc_unit + } + } + + impl fmt::Display for SysControlAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Debug::fmt(self, f) + } + } +} + + +#[cfg(any(target_os = "android", target_os = "linux", target_os = "fuchsia"))] +mod datalink { + use super::{fmt, AddressFamily}; + + /// Hardware Address + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct LinkAddr(pub libc::sockaddr_ll); + + impl LinkAddr { + /// Always AF_PACKET + pub fn family(&self) -> AddressFamily { + assert_eq!(self.0.sll_family as i32, libc::AF_PACKET); + AddressFamily::Packet + } + + /// Physical-layer protocol + pub fn protocol(&self) -> u16 { + self.0.sll_protocol + } + + /// Interface number + pub fn ifindex(&self) -> usize { + self.0.sll_ifindex as usize + } + + /// ARP hardware type + pub fn hatype(&self) -> u16 { + self.0.sll_hatype + } + + /// Packet type + pub fn pkttype(&self) -> u8 { + self.0.sll_pkttype + } + + /// Length of MAC address + pub fn halen(&self) -> usize { + self.0.sll_halen as usize + } + + /// Physical-layer address (MAC) + pub fn addr(&self) -> [u8; 6] { + [ + self.0.sll_addr[0] as u8, + self.0.sll_addr[1] as u8, + self.0.sll_addr[2] as u8, + self.0.sll_addr[3] as u8, + self.0.sll_addr[4] as u8, + self.0.sll_addr[5] as u8, + ] + } + } + + impl fmt::Display for LinkAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let addr = self.addr(); + write!(f, "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}", + addr[0], + addr[1], + addr[2], + addr[3], + addr[4], + addr[5]) + } + } +} + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] +mod datalink { + use super::{fmt, AddressFamily}; + + /// Hardware Address + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct LinkAddr(pub libc::sockaddr_dl); + + impl LinkAddr { + /// Total length of sockaddr + #[cfg(not(target_os = "illumos"))] + pub fn len(&self) -> usize { + self.0.sdl_len as usize + } + + /// always == AF_LINK + pub fn family(&self) -> AddressFamily { + assert_eq!(i32::from(self.0.sdl_family), libc::AF_LINK); + AddressFamily::Link + } + + /// interface index, if != 0, system given index for interface + pub fn ifindex(&self) -> usize { + self.0.sdl_index as usize + } + + /// Datalink type + pub fn datalink_type(&self) -> u8 { + self.0.sdl_type + } + + // MAC address start position + pub fn nlen(&self) -> usize { + self.0.sdl_nlen as usize + } + + /// link level address length + pub fn alen(&self) -> usize { + self.0.sdl_alen as usize + } + + /// link layer selector length + pub fn slen(&self) -> usize { + self.0.sdl_slen as usize + } + + /// if link level address length == 0, + /// or `sdl_data` not be larger. + pub fn is_empty(&self) -> bool { + let nlen = self.nlen(); + let alen = self.alen(); + let data_len = self.0.sdl_data.len(); + + alen == 0 || nlen + alen >= data_len + } + + /// Physical-layer address (MAC) + pub fn addr(&self) -> [u8; 6] { + let nlen = self.nlen(); + let data = self.0.sdl_data; + + assert!(!self.is_empty()); + + [ + data[nlen] as u8, + data[nlen + 1] as u8, + data[nlen + 2] as u8, + data[nlen + 3] as u8, + data[nlen + 4] as u8, + data[nlen + 5] as u8, + ] + } + } + + impl fmt::Display for LinkAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let addr = self.addr(); + write!(f, "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}", + addr[0], + addr[1], + addr[2], + addr[3], + addr[4], + addr[5]) + } + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub mod vsock { + use crate::sys::socket::addr::AddressFamily; + use libc::{sa_family_t, sockaddr_vm}; + use std::{fmt, mem}; + use std::hash::{Hash, Hasher}; + + #[derive(Copy, Clone)] + pub struct VsockAddr(pub sockaddr_vm); + + impl PartialEq for VsockAddr { + fn eq(&self, other: &Self) -> bool { + let (inner, other) = (self.0, other.0); + (inner.svm_family, inner.svm_cid, inner.svm_port) == + (other.svm_family, other.svm_cid, other.svm_port) + } + } + + impl Eq for VsockAddr {} + + impl Hash for VsockAddr { + fn hash(&self, s: &mut H) { + let inner = self.0; + (inner.svm_family, inner.svm_cid, inner.svm_port).hash(s); + } + } + + /// VSOCK Address + /// + /// The address for AF_VSOCK socket is defined as a combination of a + /// 32-bit Context Identifier (CID) and a 32-bit port number. + impl VsockAddr { + pub fn new(cid: u32, port: u32) -> VsockAddr { + let mut addr: sockaddr_vm = unsafe { mem::zeroed() }; + addr.svm_family = AddressFamily::Vsock as sa_family_t; + addr.svm_cid = cid; + addr.svm_port = port; + + VsockAddr(addr) + } + + /// Context Identifier (CID) + pub fn cid(&self) -> u32 { + self.0.svm_cid + } + + /// Port number + pub fn port(&self) -> u32 { + self.0.svm_port + } + } + + impl fmt::Display for VsockAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "cid: {} port: {}", self.cid(), self.port()) + } + } + + impl fmt::Debug for VsockAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(self, f) + } + } +} + +#[cfg(test)] +mod tests { + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + use super::*; + + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[test] + fn test_macos_loopback_datalink_addr() { + let bytes = [20i8, 18, 1, 0, 24, 3, 0, 0, 108, 111, 48, 0, 0, 0, 0, 0]; + let sa = bytes.as_ptr() as *const libc::sockaddr; + let _sock_addr = unsafe { SockAddr::from_libc_sockaddr(sa) }; + assert!(_sock_addr.is_none()); + } + + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[test] + fn test_macos_tap_datalink_addr() { + let bytes = [20i8, 18, 7, 0, 6, 3, 6, 0, 101, 110, 48, 24, 101, -112, -35, 76, -80]; + let ptr = bytes.as_ptr(); + let sa = ptr as *const libc::sockaddr; + let _sock_addr = unsafe { SockAddr::from_libc_sockaddr(sa) }; + + assert!(_sock_addr.is_some()); + + let sock_addr = _sock_addr.unwrap(); + + assert_eq!(sock_addr.family(), AddressFamily::Link); + + match sock_addr { + SockAddr::Link(ether_addr) => { + assert_eq!(ether_addr.addr(), [24u8, 101, 144, 221, 76, 176]); + }, + _ => { unreachable!() } + }; + } + + #[cfg(target_os = "illumos")] + #[test] + fn test_illumos_tap_datalink_addr() { + let bytes = [25u8, 0, 0, 0, 6, 0, 6, 0, 24, 101, 144, 221, 76, 176]; + let ptr = bytes.as_ptr(); + let sa = ptr as *const libc::sockaddr; + let _sock_addr = unsafe { SockAddr::from_libc_sockaddr(sa) }; + + assert!(_sock_addr.is_some()); + + let sock_addr = _sock_addr.unwrap(); + + assert_eq!(sock_addr.family(), AddressFamily::Link); + + match sock_addr { + SockAddr::Link(ether_addr) => { + assert_eq!(ether_addr.addr(), [24u8, 101, 144, 221, 76, 176]); + }, + _ => { unreachable!() } + }; + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[test] + fn test_abstract_sun_path() { + let name = String::from("nix\0abstract\0test"); + let addr = UnixAddr::new_abstract(name.as_bytes()).unwrap(); + + let sun_path1 = unsafe { &(*addr.as_ptr()).sun_path[..addr.path_len()] }; + let sun_path2 = [0, 110, 105, 120, 0, 97, 98, 115, 116, 114, 97, 99, 116, 0, 116, 101, 115, 116]; + assert_eq!(sun_path1, sun_path2); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/socket/mod.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/socket/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..97eea3dcb125a3e5081d2cce1124908c6ebeb415 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/socket/mod.rs @@ -0,0 +1,1916 @@ +//! Socket interface functions +//! +//! [Further reading](https://man7.org/linux/man-pages/man7/socket.7.html) +use cfg_if::cfg_if; +use crate::{Result, errno::Errno}; +use libc::{self, c_void, c_int, iovec, socklen_t, size_t, + CMSG_FIRSTHDR, CMSG_NXTHDR, CMSG_DATA, CMSG_LEN}; +use memoffset::offset_of; +use std::{mem, ptr, slice}; +use std::os::unix::io::RawFd; +#[cfg(all(target_os = "linux"))] +use crate::sys::time::TimeSpec; +use crate::sys::time::TimeVal; +use crate::sys::uio::IoVec; + +mod addr; +#[deny(missing_docs)] +pub mod sockopt; + +/* + * + * ===== Re-exports ===== + * + */ + +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] +pub use self::addr::{ + AddressFamily, + SockAddr, + InetAddr, + UnixAddr, + IpAddr, + Ipv4Addr, + Ipv6Addr, + LinkAddr, +}; +#[cfg(any(target_os = "illumos", target_os = "solaris"))] +pub use self::addr::{ + AddressFamily, + SockAddr, + InetAddr, + UnixAddr, + IpAddr, + Ipv4Addr, + Ipv6Addr, +}; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use crate::sys::socket::addr::netlink::NetlinkAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use crate::sys::socket::addr::alg::AlgAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use crate::sys::socket::addr::vsock::VsockAddr; + +pub use libc::{ + cmsghdr, + msghdr, + sa_family_t, + sockaddr, + sockaddr_in, + sockaddr_in6, + sockaddr_storage, + sockaddr_un, +}; + +// Needed by the cmsg_space macro +#[doc(hidden)] +pub use libc::{c_uint, CMSG_SPACE}; + +/// These constants are used to specify the communication semantics +/// when creating a socket with [`socket()`](fn.socket.html) +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +#[repr(i32)] +#[non_exhaustive] +pub enum SockType { + /// Provides sequenced, reliable, two-way, connection- + /// based byte streams. An out-of-band data transmission + /// mechanism may be supported. + Stream = libc::SOCK_STREAM, + /// Supports datagrams (connectionless, unreliable + /// messages of a fixed maximum length). + Datagram = libc::SOCK_DGRAM, + /// Provides a sequenced, reliable, two-way connection- + /// based data transmission path for datagrams of fixed + /// maximum length; a consumer is required to read an + /// entire packet with each input system call. + SeqPacket = libc::SOCK_SEQPACKET, + /// Provides raw network protocol access. + Raw = libc::SOCK_RAW, + /// Provides a reliable datagram layer that does not + /// guarantee ordering. + Rdm = libc::SOCK_RDM, +} + +/// Constants used in [`socket`](fn.socket.html) and [`socketpair`](fn.socketpair.html) +/// to specify the protocol to use. +#[repr(i32)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum SockProtocol { + /// TCP protocol ([ip(7)](https://man7.org/linux/man-pages/man7/ip.7.html)) + Tcp = libc::IPPROTO_TCP, + /// UDP protocol ([ip(7)](https://man7.org/linux/man-pages/man7/ip.7.html)) + Udp = libc::IPPROTO_UDP, + /// Allows applications and other KEXTs to be notified when certain kernel events occur + /// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html)) + #[cfg(any(target_os = "ios", target_os = "macos"))] + KextEvent = libc::SYSPROTO_EVENT, + /// Allows applications to configure and control a KEXT + /// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html)) + #[cfg(any(target_os = "ios", target_os = "macos"))] + KextControl = libc::SYSPROTO_CONTROL, + /// Receives routing and link updates and may be used to modify the routing tables (both IPv4 and IPv6), IP addresses, link + // parameters, neighbor setups, queueing disciplines, traffic classes and packet classifiers + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkRoute = libc::NETLINK_ROUTE, + /// Reserved for user-mode socket protocols + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkUserSock = libc::NETLINK_USERSOCK, + /// Query information about sockets of various protocol families from the kernel + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkSockDiag = libc::NETLINK_SOCK_DIAG, + /// SELinux event notifications. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkSELinux = libc::NETLINK_SELINUX, + /// Open-iSCSI + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkISCSI = libc::NETLINK_ISCSI, + /// Auditing + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkAudit = libc::NETLINK_AUDIT, + /// Access to FIB lookup from user space + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkFIBLookup = libc::NETLINK_FIB_LOOKUP, + /// Netfilter subsystem + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkNetFilter = libc::NETLINK_NETFILTER, + /// SCSI Transports + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkSCSITransport = libc::NETLINK_SCSITRANSPORT, + /// Infiniband RDMA + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkRDMA = libc::NETLINK_RDMA, + /// Transport IPv6 packets from netfilter to user space. Used by ip6_queue kernel module. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkIPv6Firewall = libc::NETLINK_IP6_FW, + /// DECnet routing messages + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkDECNetRoutingMessage = libc::NETLINK_DNRTMSG, + /// Kernel messages to user space + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkKObjectUEvent = libc::NETLINK_KOBJECT_UEVENT, + /// Netlink interface to request information about ciphers registered with the kernel crypto API as well as allow + /// configuration of the kernel crypto API. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + NetlinkCrypto = libc::NETLINK_CRYPTO, +} + +libc_bitflags!{ + /// Additional socket options + pub struct SockFlag: c_int { + /// Set non-blocking mode on the new socket + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] + SOCK_NONBLOCK; + /// Set close-on-exec on the new descriptor + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] + SOCK_CLOEXEC; + /// Return `EPIPE` instead of raising `SIGPIPE` + #[cfg(target_os = "netbsd")] + SOCK_NOSIGPIPE; + /// For domains `AF_INET(6)`, only allow `connect(2)`, `sendto(2)`, or `sendmsg(2)` + /// to the DNS port (typically 53) + #[cfg(target_os = "openbsd")] + SOCK_DNS; + } +} + +libc_bitflags!{ + /// Flags for send/recv and their relatives + pub struct MsgFlags: c_int { + /// Sends or requests out-of-band data on sockets that support this notion + /// (e.g., of type [`Stream`](enum.SockType.html)); the underlying protocol must also + /// support out-of-band data. + MSG_OOB; + /// Peeks at an incoming message. The data is treated as unread and the next + /// [`recv()`](fn.recv.html) + /// or similar function shall still return this data. + MSG_PEEK; + /// Receive operation blocks until the full amount of data can be + /// returned. The function may return smaller amount of data if a signal + /// is caught, an error or disconnect occurs. + MSG_WAITALL; + /// Enables nonblocking operation; if the operation would block, + /// `EAGAIN` or `EWOULDBLOCK` is returned. This provides similar + /// behavior to setting the `O_NONBLOCK` flag + /// (via the [`fcntl`](../../fcntl/fn.fcntl.html) + /// `F_SETFL` operation), but differs in that `MSG_DONTWAIT` is a per- + /// call option, whereas `O_NONBLOCK` is a setting on the open file + /// description (see [open(2)](https://man7.org/linux/man-pages/man2/open.2.html)), + /// which will affect all threads in + /// the calling process and as well as other processes that hold + /// file descriptors referring to the same open file description. + MSG_DONTWAIT; + /// Receive flags: Control Data was discarded (buffer too small) + MSG_CTRUNC; + /// For raw ([`Packet`](addr/enum.AddressFamily.html)), Internet datagram + /// (since Linux 2.4.27/2.6.8), + /// netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4) + /// sockets: return the real length of the packet or datagram, even + /// when it was longer than the passed buffer. Not implemented for UNIX + /// domain ([unix(7)](https://linux.die.net/man/7/unix)) sockets. + /// + /// For use with Internet stream sockets, see [tcp(7)](https://linux.die.net/man/7/tcp). + MSG_TRUNC; + /// Terminates a record (when this notion is supported, as for + /// sockets of type [`SeqPacket`](enum.SockType.html)). + MSG_EOR; + /// This flag specifies that queued errors should be received from + /// the socket error queue. (For more details, see + /// [recvfrom(2)](https://linux.die.net/man/2/recvfrom)) + #[cfg(any(target_os = "android", target_os = "linux"))] + MSG_ERRQUEUE; + /// Set the `close-on-exec` flag for the file descriptor received via a UNIX domain + /// file descriptor using the `SCM_RIGHTS` operation (described in + /// [unix(7)](https://linux.die.net/man/7/unix)). + /// This flag is useful for the same reasons as the `O_CLOEXEC` flag of + /// [open(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html). + /// + /// Only used in [`recvmsg`](fn.recvmsg.html) function. + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] + MSG_CMSG_CLOEXEC; + } +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + /// Unix credentials of the sending process. + /// + /// This struct is used with the `SO_PEERCRED` ancillary message + /// and the `SCM_CREDENTIALS` control message for UNIX sockets. + #[repr(transparent)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + pub struct UnixCredentials(libc::ucred); + + impl UnixCredentials { + /// Creates a new instance with the credentials of the current process + pub fn new() -> Self { + UnixCredentials(libc::ucred { + pid: crate::unistd::getpid().as_raw(), + uid: crate::unistd::getuid().as_raw(), + gid: crate::unistd::getgid().as_raw(), + }) + } + + /// Returns the process identifier + pub fn pid(&self) -> libc::pid_t { + self.0.pid + } + + /// Returns the user identifier + pub fn uid(&self) -> libc::uid_t { + self.0.uid + } + + /// Returns the group identifier + pub fn gid(&self) -> libc::gid_t { + self.0.gid + } + } + + impl Default for UnixCredentials { + fn default() -> Self { + Self::new() + } + } + + impl From for UnixCredentials { + fn from(cred: libc::ucred) -> Self { + UnixCredentials(cred) + } + } + + impl From for libc::ucred { + fn from(uc: UnixCredentials) -> Self { + uc.0 + } + } + } else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] { + /// Unix credentials of the sending process. + /// + /// This struct is used with the `SCM_CREDS` ancillary message for UNIX sockets. + #[repr(transparent)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + pub struct UnixCredentials(libc::cmsgcred); + + impl UnixCredentials { + /// Returns the process identifier + pub fn pid(&self) -> libc::pid_t { + self.0.cmcred_pid + } + + /// Returns the real user identifier + pub fn uid(&self) -> libc::uid_t { + self.0.cmcred_uid + } + + /// Returns the effective user identifier + pub fn euid(&self) -> libc::uid_t { + self.0.cmcred_euid + } + + /// Returns the real group identifier + pub fn gid(&self) -> libc::gid_t { + self.0.cmcred_gid + } + + /// Returns a list group identifiers (the first one being the effective GID) + pub fn groups(&self) -> &[libc::gid_t] { + unsafe { slice::from_raw_parts(self.0.cmcred_groups.as_ptr() as *const libc::gid_t, self.0.cmcred_ngroups as _) } + } + } + + impl From for UnixCredentials { + fn from(cred: libc::cmsgcred) -> Self { + UnixCredentials(cred) + } + } + } +} + +cfg_if!{ + if #[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios" + ))] { + /// Return type of [`LocalPeerCred`](crate::sys::socket::sockopt::LocalPeerCred) + #[repr(transparent)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + pub struct XuCred(libc::xucred); + + impl XuCred { + /// Structure layout version + pub fn version(&self) -> u32 { + self.0.cr_version + } + + /// Effective user ID + pub fn uid(&self) -> libc::uid_t { + self.0.cr_uid + } + + /// Returns a list of group identifiers (the first one being the + /// effective GID) + pub fn groups(&self) -> &[libc::gid_t] { + &self.0.cr_groups + } + } + } +} + +/// Request for multicast socket operations +/// +/// This is a wrapper type around `ip_mreq`. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct IpMembershipRequest(libc::ip_mreq); + +impl IpMembershipRequest { + /// Instantiate a new `IpMembershipRequest` + /// + /// If `interface` is `None`, then `Ipv4Addr::any()` will be used for the interface. + pub fn new(group: Ipv4Addr, interface: Option) -> Self { + IpMembershipRequest(libc::ip_mreq { + imr_multiaddr: group.0, + imr_interface: interface.unwrap_or_else(Ipv4Addr::any).0, + }) + } +} + +/// Request for ipv6 multicast socket operations +/// +/// This is a wrapper type around `ipv6_mreq`. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct Ipv6MembershipRequest(libc::ipv6_mreq); + +impl Ipv6MembershipRequest { + /// Instantiate a new `Ipv6MembershipRequest` + pub const fn new(group: Ipv6Addr) -> Self { + Ipv6MembershipRequest(libc::ipv6_mreq { + ipv6mr_multiaddr: group.0, + ipv6mr_interface: 0, + }) + } +} + +/// Create a buffer large enough for storing some control messages as returned +/// by [`recvmsg`](fn.recvmsg.html). +/// +/// # Examples +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # use nix::sys::time::TimeVal; +/// # use std::os::unix::io::RawFd; +/// # fn main() { +/// // Create a buffer for a `ControlMessageOwned::ScmTimestamp` message +/// let _ = cmsg_space!(TimeVal); +/// // Create a buffer big enough for a `ControlMessageOwned::ScmRights` message +/// // with two file descriptors +/// let _ = cmsg_space!([RawFd; 2]); +/// // Create a buffer big enough for a `ControlMessageOwned::ScmRights` message +/// // and a `ControlMessageOwned::ScmTimestamp` message +/// let _ = cmsg_space!(RawFd, TimeVal); +/// # } +/// ``` +// Unfortunately, CMSG_SPACE isn't a const_fn, or else we could return a +// stack-allocated array. +#[macro_export] +macro_rules! cmsg_space { + ( $( $x:ty ),* ) => { + { + let mut space = 0; + $( + // CMSG_SPACE is always safe + space += unsafe { + $crate::sys::socket::CMSG_SPACE(::std::mem::size_of::<$x>() as $crate::sys::socket::c_uint) + } as usize; + )* + Vec::::with_capacity(space) + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct RecvMsg<'a> { + pub bytes: usize, + cmsghdr: Option<&'a cmsghdr>, + pub address: Option, + pub flags: MsgFlags, + mhdr: msghdr, +} + +impl<'a> RecvMsg<'a> { + /// Iterate over the valid control messages pointed to by this + /// msghdr. + pub fn cmsgs(&self) -> CmsgIterator { + CmsgIterator { + cmsghdr: self.cmsghdr, + mhdr: &self.mhdr + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct CmsgIterator<'a> { + /// Control message buffer to decode from. Must adhere to cmsg alignment. + cmsghdr: Option<&'a cmsghdr>, + mhdr: &'a msghdr +} + +impl<'a> Iterator for CmsgIterator<'a> { + type Item = ControlMessageOwned; + + fn next(&mut self) -> Option { + match self.cmsghdr { + None => None, // No more messages + Some(hdr) => { + // Get the data. + // Safe if cmsghdr points to valid data returned by recvmsg(2) + let cm = unsafe { Some(ControlMessageOwned::decode_from(hdr))}; + // Advance the internal pointer. Safe if mhdr and cmsghdr point + // to valid data returned by recvmsg(2) + self.cmsghdr = unsafe { + let p = CMSG_NXTHDR(self.mhdr as *const _, hdr as *const _); + p.as_ref() + }; + cm + } + } + } +} + +/// A type-safe wrapper around a single control message, as used with +/// [`recvmsg`](#fn.recvmsg). +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/cmsg.3.html) +// Nix version 0.13.0 and earlier used ControlMessage for both recvmsg and +// sendmsg. However, on some platforms the messages returned by recvmsg may be +// unaligned. ControlMessageOwned takes those messages by copy, obviating any +// alignment issues. +// +// See https://github.com/nix-rust/nix/issues/999 +#[derive(Clone, Debug, Eq, PartialEq)] +#[non_exhaustive] +pub enum ControlMessageOwned { + /// Received version of [`ControlMessage::ScmRights`] + ScmRights(Vec), + /// Received version of [`ControlMessage::ScmCredentials`] + #[cfg(any(target_os = "android", target_os = "linux"))] + ScmCredentials(UnixCredentials), + /// Received version of [`ControlMessage::ScmCreds`] + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ScmCreds(UnixCredentials), + /// A message of type `SCM_TIMESTAMP`, containing the time the + /// packet was received by the kernel. + /// + /// See the kernel's explanation in "SO_TIMESTAMP" of + /// [networking/timestamping](https://www.kernel.org/doc/Documentation/networking/timestamping.txt). + /// + /// # Examples + /// + /// ``` + /// # #[macro_use] extern crate nix; + /// # use nix::sys::socket::*; + /// # use nix::sys::uio::IoVec; + /// # use nix::sys::time::*; + /// # use std::time::*; + /// # fn main() { + /// // Set up + /// let message = "Ohayō!".as_bytes(); + /// let in_socket = socket( + /// AddressFamily::Inet, + /// SockType::Datagram, + /// SockFlag::empty(), + /// None).unwrap(); + /// setsockopt(in_socket, sockopt::ReceiveTimestamp, &true).unwrap(); + /// let localhost = InetAddr::new(IpAddr::new_v4(127, 0, 0, 1), 0); + /// bind(in_socket, &SockAddr::new_inet(localhost)).unwrap(); + /// let address = getsockname(in_socket).unwrap(); + /// // Get initial time + /// let time0 = SystemTime::now(); + /// // Send the message + /// let iov = [IoVec::from_slice(message)]; + /// let flags = MsgFlags::empty(); + /// let l = sendmsg(in_socket, &iov, &[], flags, Some(&address)).unwrap(); + /// assert_eq!(message.len(), l); + /// // Receive the message + /// let mut buffer = vec![0u8; message.len()]; + /// let mut cmsgspace = cmsg_space!(TimeVal); + /// let iov = [IoVec::from_mut_slice(&mut buffer)]; + /// let r = recvmsg(in_socket, &iov, Some(&mut cmsgspace), flags).unwrap(); + /// let rtime = match r.cmsgs().next() { + /// Some(ControlMessageOwned::ScmTimestamp(rtime)) => rtime, + /// Some(_) => panic!("Unexpected control message"), + /// None => panic!("No control message") + /// }; + /// // Check the final time + /// let time1 = SystemTime::now(); + /// // the packet's received timestamp should lie in-between the two system + /// // times, unless the system clock was adjusted in the meantime. + /// let rduration = Duration::new(rtime.tv_sec() as u64, + /// rtime.tv_usec() as u32 * 1000); + /// assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); + /// assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); + /// // Close socket + /// nix::unistd::close(in_socket).unwrap(); + /// # } + /// ``` + ScmTimestamp(TimeVal), + /// Nanoseconds resolution timestamp + /// + /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) + #[cfg(all(target_os = "linux"))] + ScmTimestampns(TimeSpec), + #[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + ))] + Ipv4PacketInfo(libc::in_pktinfo), + #[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "openbsd", + target_os = "netbsd", + ))] + Ipv6PacketInfo(libc::in6_pktinfo), + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + Ipv4RecvIf(libc::sockaddr_dl), + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + Ipv4RecvDstAddr(libc::in_addr), + + /// UDP Generic Receive Offload (GRO) allows receiving multiple UDP + /// packets from a single sender. + /// Fixed-size payloads are following one by one in a receive buffer. + /// This Control Message indicates the size of all smaller packets, + /// except, maybe, the last one. + /// + /// `UdpGroSegment` socket option should be enabled on a socket + /// to allow receiving GRO packets. + #[cfg(target_os = "linux")] + UdpGroSegments(u16), + + /// SO_RXQ_OVFL indicates that an unsigned 32 bit value + /// ancilliary msg (cmsg) should be attached to recieved + /// skbs indicating the number of packets dropped by the + /// socket between the last recieved packet and this + /// received packet. + /// + /// `RxqOvfl` socket option should be enabled on a socket + /// to allow receiving the drop counter. + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + RxqOvfl(u32), + + /// Socket error queue control messages read with the `MSG_ERRQUEUE` flag. + #[cfg(any(target_os = "android", target_os = "linux"))] + Ipv4RecvErr(libc::sock_extended_err, Option), + /// Socket error queue control messages read with the `MSG_ERRQUEUE` flag. + #[cfg(any(target_os = "android", target_os = "linux"))] + Ipv6RecvErr(libc::sock_extended_err, Option), + + /// Catch-all variant for unimplemented cmsg types. + #[doc(hidden)] + Unknown(UnknownCmsg), +} + +impl ControlMessageOwned { + /// Decodes a `ControlMessageOwned` from raw bytes. + /// + /// This is only safe to call if the data is correct for the message type + /// specified in the header. Normally, the kernel ensures that this is the + /// case. "Correct" in this case includes correct length, alignment and + /// actual content. + // Clippy complains about the pointer alignment of `p`, not understanding + // that it's being fed to a function that can handle that. + #[allow(clippy::cast_ptr_alignment)] + unsafe fn decode_from(header: &cmsghdr) -> ControlMessageOwned + { + let p = CMSG_DATA(header); + let len = header as *const _ as usize + header.cmsg_len as usize + - p as usize; + match (header.cmsg_level, header.cmsg_type) { + (libc::SOL_SOCKET, libc::SCM_RIGHTS) => { + let n = len / mem::size_of::(); + let mut fds = Vec::with_capacity(n); + for i in 0..n { + let fdp = (p as *const RawFd).add(i); + fds.push(ptr::read_unaligned(fdp)); + } + ControlMessageOwned::ScmRights(fds) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::SOL_SOCKET, libc::SCM_CREDENTIALS) => { + let cred: libc::ucred = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmCredentials(cred.into()) + } + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + (libc::SOL_SOCKET, libc::SCM_CREDS) => { + let cred: libc::cmsgcred = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmCreds(cred.into()) + } + (libc::SOL_SOCKET, libc::SCM_TIMESTAMP) => { + let tv: libc::timeval = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmTimestamp(TimeVal::from(tv)) + }, + #[cfg(all(target_os = "linux"))] + (libc::SOL_SOCKET, libc::SCM_TIMESTAMPNS) => { + let ts: libc::timespec = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmTimestampns(TimeSpec::from(ts)) + } + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] + (libc::IPPROTO_IPV6, libc::IPV6_PKTINFO) => { + let info = ptr::read_unaligned(p as *const libc::in6_pktinfo); + ControlMessageOwned::Ipv6PacketInfo(info) + } + #[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + ))] + (libc::IPPROTO_IP, libc::IP_PKTINFO) => { + let info = ptr::read_unaligned(p as *const libc::in_pktinfo); + ControlMessageOwned::Ipv4PacketInfo(info) + } + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + (libc::IPPROTO_IP, libc::IP_RECVIF) => { + let dl = ptr::read_unaligned(p as *const libc::sockaddr_dl); + ControlMessageOwned::Ipv4RecvIf(dl) + }, + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + (libc::IPPROTO_IP, libc::IP_RECVDSTADDR) => { + let dl = ptr::read_unaligned(p as *const libc::in_addr); + ControlMessageOwned::Ipv4RecvDstAddr(dl) + }, + #[cfg(target_os = "linux")] + (libc::SOL_UDP, libc::UDP_GRO) => { + let gso_size: u16 = ptr::read_unaligned(p as *const _); + ControlMessageOwned::UdpGroSegments(gso_size) + }, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + (libc::SOL_SOCKET, libc::SO_RXQ_OVFL) => { + let drop_counter = ptr::read_unaligned(p as *const u32); + ControlMessageOwned::RxqOvfl(drop_counter) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::IPPROTO_IP, libc::IP_RECVERR) => { + let (err, addr) = Self::recv_err_helper::(p, len); + ControlMessageOwned::Ipv4RecvErr(err, addr) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::IPPROTO_IPV6, libc::IPV6_RECVERR) => { + let (err, addr) = Self::recv_err_helper::(p, len); + ControlMessageOwned::Ipv6RecvErr(err, addr) + }, + (_, _) => { + let sl = slice::from_raw_parts(p, len); + let ucmsg = UnknownCmsg(*header, Vec::::from(sl)); + ControlMessageOwned::Unknown(ucmsg) + } + } + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + unsafe fn recv_err_helper(p: *mut libc::c_uchar, len: usize) -> (libc::sock_extended_err, Option) { + let ee = p as *const libc::sock_extended_err; + let err = ptr::read_unaligned(ee); + + // For errors originating on the network, SO_EE_OFFENDER(ee) points inside the p[..len] + // CMSG_DATA buffer. For local errors, there is no address included in the control + // message, and SO_EE_OFFENDER(ee) points beyond the end of the buffer. So, we need to + // validate that the address object is in-bounds before we attempt to copy it. + let addrp = libc::SO_EE_OFFENDER(ee) as *const T; + + if addrp.offset(1) as usize - (p as usize) > len { + (err, None) + } else { + (err, Some(ptr::read_unaligned(addrp))) + } + } +} + +/// A type-safe zero-copy wrapper around a single control message, as used wih +/// [`sendmsg`](#fn.sendmsg). More types may be added to this enum; do not +/// exhaustively pattern-match it. +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/cmsg.3.html) +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[non_exhaustive] +pub enum ControlMessage<'a> { + /// A message of type `SCM_RIGHTS`, containing an array of file + /// descriptors passed between processes. + /// + /// See the description in the "Ancillary messages" section of the + /// [unix(7) man page](https://man7.org/linux/man-pages/man7/unix.7.html). + /// + /// Using multiple `ScmRights` messages for a single `sendmsg` call isn't + /// recommended since it causes platform-dependent behaviour: It might + /// swallow all but the first `ScmRights` message or fail with `EINVAL`. + /// Instead, you can put all fds to be passed into a single `ScmRights` + /// message. + ScmRights(&'a [RawFd]), + /// A message of type `SCM_CREDENTIALS`, containing the pid, uid and gid of + /// a process connected to the socket. + /// + /// This is similar to the socket option `SO_PEERCRED`, but requires a + /// process to explicitly send its credentials. A process running as root is + /// allowed to specify any credentials, while credentials sent by other + /// processes are verified by the kernel. + /// + /// For further information, please refer to the + /// [`unix(7)`](https://man7.org/linux/man-pages/man7/unix.7.html) man page. + #[cfg(any(target_os = "android", target_os = "linux"))] + ScmCredentials(&'a UnixCredentials), + /// A message of type `SCM_CREDS`, containing the pid, uid, euid, gid and groups of + /// a process connected to the socket. + /// + /// This is similar to the socket options `LOCAL_CREDS` and `LOCAL_PEERCRED`, but + /// requires a process to explicitly send its credentials. + /// + /// Credentials are always overwritten by the kernel, so this variant does have + /// any data, unlike the receive-side + /// [`ControlMessageOwned::ScmCreds`]. + /// + /// For further information, please refer to the + /// [`unix(4)`](https://www.freebsd.org/cgi/man.cgi?query=unix) man page. + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ScmCreds, + + /// Set IV for `AF_ALG` crypto API. + /// + /// For further information, please refer to the + /// [`documentation`](https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html) + #[cfg(any( + target_os = "android", + target_os = "linux", + ))] + AlgSetIv(&'a [u8]), + /// Set crypto operation for `AF_ALG` crypto API. It may be one of + /// `ALG_OP_ENCRYPT` or `ALG_OP_DECRYPT` + /// + /// For further information, please refer to the + /// [`documentation`](https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html) + #[cfg(any( + target_os = "android", + target_os = "linux", + ))] + AlgSetOp(&'a libc::c_int), + /// Set the length of associated authentication data (AAD) (applicable only to AEAD algorithms) + /// for `AF_ALG` crypto API. + /// + /// For further information, please refer to the + /// [`documentation`](https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html) + #[cfg(any( + target_os = "android", + target_os = "linux", + ))] + AlgSetAeadAssoclen(&'a u32), + + /// UDP GSO makes it possible for applications to generate network packets + /// for a virtual MTU much greater than the real one. + /// The length of the send data no longer matches the expected length on + /// the wire. + /// The size of the datagram payload as it should appear on the wire may be + /// passed through this control message. + /// Send buffer should consist of multiple fixed-size wire payloads + /// following one by one, and the last, possibly smaller one. + #[cfg(target_os = "linux")] + UdpGsoSegments(&'a u16), + + /// Configure the sending addressing and interface for v4 + /// + /// For further information, please refer to the + /// [`ip(7)`](https://man7.org/linux/man-pages/man7/ip.7.html) man page. + #[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "android", + target_os = "ios",))] + Ipv4PacketInfo(&'a libc::in_pktinfo), + + /// Configure the sending addressing and interface for v6 + /// + /// For further information, please refer to the + /// [`ipv6(7)`](https://man7.org/linux/man-pages/man7/ipv6.7.html) man page. + #[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "freebsd", + target_os = "android", + target_os = "ios",))] + Ipv6PacketInfo(&'a libc::in6_pktinfo), + + /// SO_RXQ_OVFL indicates that an unsigned 32 bit value + /// ancilliary msg (cmsg) should be attached to recieved + /// skbs indicating the number of packets dropped by the + /// socket between the last recieved packet and this + /// received packet. + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + RxqOvfl(&'a u32), +} + +// An opaque structure used to prevent cmsghdr from being a public type +#[doc(hidden)] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UnknownCmsg(cmsghdr, Vec); + +impl<'a> ControlMessage<'a> { + /// The value of CMSG_SPACE on this message. + /// Safe because CMSG_SPACE is always safe + fn space(&self) -> usize { + unsafe{CMSG_SPACE(self.len() as libc::c_uint) as usize} + } + + /// The value of CMSG_LEN on this message. + /// Safe because CMSG_LEN is always safe + #[cfg(any(target_os = "android", + all(target_os = "linux", not(target_env = "musl"))))] + fn cmsg_len(&self) -> usize { + unsafe{CMSG_LEN(self.len() as libc::c_uint) as usize} + } + + #[cfg(not(any(target_os = "android", + all(target_os = "linux", not(target_env = "musl")))))] + fn cmsg_len(&self) -> libc::c_uint { + unsafe{CMSG_LEN(self.len() as libc::c_uint)} + } + + /// Return a reference to the payload data as a byte pointer + fn copy_to_cmsg_data(&self, cmsg_data: *mut u8) { + let data_ptr = match *self { + ControlMessage::ScmRights(fds) => { + fds as *const _ as *const u8 + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(creds) => { + &creds.0 as *const libc::ucred as *const u8 + } + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => { + // The kernel overwrites the data, we just zero it + // to make sure it's not uninitialized memory + unsafe { ptr::write_bytes(cmsg_data, 0, self.len()) }; + return + } + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(iv) => { + #[allow(deprecated)] // https://github.com/rust-lang/libc/issues/1501 + let af_alg_iv = libc::af_alg_iv { + ivlen: iv.len() as u32, + iv: [0u8; 0], + }; + + let size = mem::size_of_val(&af_alg_iv); + + unsafe { + ptr::copy_nonoverlapping( + &af_alg_iv as *const _ as *const u8, + cmsg_data, + size, + ); + ptr::copy_nonoverlapping( + iv.as_ptr(), + cmsg_data.add(size), + iv.len() + ); + }; + + return + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetOp(op) => { + op as *const _ as *const u8 + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetAeadAssoclen(len) => { + len as *const _ as *const u8 + }, + #[cfg(target_os = "linux")] + ControlMessage::UdpGsoSegments(gso_size) => { + gso_size as *const _ as *const u8 + }, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + ControlMessage::Ipv4PacketInfo(info) => info as *const _ as *const u8, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + ControlMessage::Ipv6PacketInfo(info) => info as *const _ as *const u8, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(drop_count) => { + drop_count as *const _ as *const u8 + }, + }; + unsafe { + ptr::copy_nonoverlapping( + data_ptr, + cmsg_data, + self.len() + ) + }; + } + + /// The size of the payload, excluding its cmsghdr + fn len(&self) -> usize { + match *self { + ControlMessage::ScmRights(fds) => { + mem::size_of_val(fds) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(creds) => { + mem::size_of_val(creds) + } + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => { + mem::size_of::() + } + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(iv) => { + mem::size_of_val(&iv) + iv.len() + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetOp(op) => { + mem::size_of_val(op) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetAeadAssoclen(len) => { + mem::size_of_val(len) + }, + #[cfg(target_os = "linux")] + ControlMessage::UdpGsoSegments(gso_size) => { + mem::size_of_val(gso_size) + }, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + ControlMessage::Ipv4PacketInfo(info) => mem::size_of_val(info), + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + ControlMessage::Ipv6PacketInfo(info) => mem::size_of_val(info), + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(drop_count) => { + mem::size_of_val(drop_count) + }, + } + } + + /// Returns the value to put into the `cmsg_level` field of the header. + fn cmsg_level(&self) -> libc::c_int { + match *self { + ControlMessage::ScmRights(_) => libc::SOL_SOCKET, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(_) => libc::SOL_SOCKET, + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => libc::SOL_SOCKET, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(_) | ControlMessage::AlgSetOp(_) | + ControlMessage::AlgSetAeadAssoclen(_) => libc::SOL_ALG, + #[cfg(target_os = "linux")] + ControlMessage::UdpGsoSegments(_) => libc::SOL_UDP, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + ControlMessage::Ipv4PacketInfo(_) => libc::IPPROTO_IP, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + ControlMessage::Ipv6PacketInfo(_) => libc::IPPROTO_IPV6, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(_) => libc::SOL_SOCKET, + } + } + + /// Returns the value to put into the `cmsg_type` field of the header. + fn cmsg_type(&self) -> libc::c_int { + match *self { + ControlMessage::ScmRights(_) => libc::SCM_RIGHTS, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(_) => libc::SCM_CREDENTIALS, + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => libc::SCM_CREDS, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(_) => { + libc::ALG_SET_IV + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetOp(_) => { + libc::ALG_SET_OP + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetAeadAssoclen(_) => { + libc::ALG_SET_AEAD_ASSOCLEN + }, + #[cfg(target_os = "linux")] + ControlMessage::UdpGsoSegments(_) => { + libc::UDP_SEGMENT + }, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + ControlMessage::Ipv4PacketInfo(_) => libc::IP_PKTINFO, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + ControlMessage::Ipv6PacketInfo(_) => libc::IPV6_PKTINFO, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(_) => { + libc::SO_RXQ_OVFL + }, + } + } + + // Unsafe: cmsg must point to a valid cmsghdr with enough space to + // encode self. + unsafe fn encode_into(&self, cmsg: *mut cmsghdr) { + (*cmsg).cmsg_level = self.cmsg_level(); + (*cmsg).cmsg_type = self.cmsg_type(); + (*cmsg).cmsg_len = self.cmsg_len(); + self.copy_to_cmsg_data(CMSG_DATA(cmsg)); + } +} + + +/// Send data in scatter-gather vectors to a socket, possibly accompanied +/// by ancillary data. Optionally direct the message at the given address, +/// as with sendto. +/// +/// Allocates if cmsgs is nonempty. +pub fn sendmsg(fd: RawFd, iov: &[IoVec<&[u8]>], cmsgs: &[ControlMessage], + flags: MsgFlags, addr: Option<&SockAddr>) -> Result +{ + let capacity = cmsgs.iter().map(|c| c.space()).sum(); + + // First size the buffer needed to hold the cmsgs. It must be zeroed, + // because subsequent code will not clear the padding bytes. + let mut cmsg_buffer = vec![0u8; capacity]; + + let mhdr = pack_mhdr_to_send(&mut cmsg_buffer[..], &iov, &cmsgs, addr); + + let ret = unsafe { libc::sendmsg(fd, &mhdr, flags.bits()) }; + + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +#[derive(Debug)] +pub struct SendMmsgData<'a, I, C> + where + I: AsRef<[IoVec<&'a [u8]>]>, + C: AsRef<[ControlMessage<'a>]> +{ + pub iov: I, + pub cmsgs: C, + pub addr: Option, + pub _lt: std::marker::PhantomData<&'a I>, +} + +/// An extension of `sendmsg` that allows the caller to transmit multiple +/// messages on a socket using a single system call. This has performance +/// benefits for some applications. +/// +/// Allocations are performed for cmsgs and to build `msghdr` buffer +/// +/// # Arguments +/// +/// * `fd`: Socket file descriptor +/// * `data`: Struct that implements `IntoIterator` with `SendMmsgData` items +/// * `flags`: Optional flags passed directly to the operating system. +/// +/// # Returns +/// `Vec` with numbers of sent bytes on each sent message. +/// +/// # References +/// [`sendmsg`](fn.sendmsg.html) +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +pub fn sendmmsg<'a, I, C>( + fd: RawFd, + data: impl std::iter::IntoIterator>, + flags: MsgFlags +) -> Result> + where + I: AsRef<[IoVec<&'a [u8]>]> + 'a, + C: AsRef<[ControlMessage<'a>]> + 'a, +{ + let iter = data.into_iter(); + + let size_hint = iter.size_hint(); + let reserve_items = size_hint.1.unwrap_or(size_hint.0); + + let mut output = Vec::::with_capacity(reserve_items); + + let mut cmsgs_buffers = Vec::>::with_capacity(reserve_items); + + for d in iter { + let capacity: usize = d.cmsgs.as_ref().iter().map(|c| c.space()).sum(); + let mut cmsgs_buffer = vec![0u8; capacity]; + + output.push(libc::mmsghdr { + msg_hdr: pack_mhdr_to_send( + &mut cmsgs_buffer, + &d.iov, + &d.cmsgs, + d.addr.as_ref() + ), + msg_len: 0, + }); + cmsgs_buffers.push(cmsgs_buffer); + }; + + let ret = unsafe { libc::sendmmsg(fd, output.as_mut_ptr(), output.len() as _, flags.bits() as _) }; + + let sent_messages = Errno::result(ret)? as usize; + let mut sent_bytes = Vec::with_capacity(sent_messages); + + for item in &output { + sent_bytes.push(item.msg_len as usize); + } + + Ok(sent_bytes) +} + + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +#[derive(Debug)] +pub struct RecvMmsgData<'a, I> + where + I: AsRef<[IoVec<&'a mut [u8]>]> + 'a, +{ + pub iov: I, + pub cmsg_buffer: Option<&'a mut Vec>, +} + +/// An extension of `recvmsg` that allows the caller to receive multiple +/// messages from a socket using a single system call. This has +/// performance benefits for some applications. +/// +/// `iov` and `cmsg_buffer` should be constructed similarly to `recvmsg` +/// +/// Multiple allocations are performed +/// +/// # Arguments +/// +/// * `fd`: Socket file descriptor +/// * `data`: Struct that implements `IntoIterator` with `RecvMmsgData` items +/// * `flags`: Optional flags passed directly to the operating system. +/// +/// # RecvMmsgData +/// +/// * `iov`: Scatter-gather list of buffers to receive the message +/// * `cmsg_buffer`: Space to receive ancillary data. Should be created by +/// [`cmsg_space!`](macro.cmsg_space.html) +/// +/// # Returns +/// A `Vec` with multiple `RecvMsg`, one per received message +/// +/// # References +/// - [`recvmsg`](fn.recvmsg.html) +/// - [`RecvMsg`](struct.RecvMsg.html) +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +#[allow(clippy::needless_collect)] // Complicated false positive +pub fn recvmmsg<'a, I>( + fd: RawFd, + data: impl std::iter::IntoIterator, + IntoIter=impl ExactSizeIterator + Iterator>>, + flags: MsgFlags, + timeout: Option +) -> Result>> + where + I: AsRef<[IoVec<&'a mut [u8]>]> + 'a, +{ + let iter = data.into_iter(); + + let num_messages = iter.len(); + + let mut output: Vec = Vec::with_capacity(num_messages); + + // Addresses should be pre-allocated. pack_mhdr_to_receive will store them + // as raw pointers, so we may not move them. Turn the vec into a boxed + // slice so we won't inadvertently reallocate the vec. + let mut addresses = vec![mem::MaybeUninit::uninit(); num_messages] + .into_boxed_slice(); + + let results: Vec<_> = iter.enumerate().map(|(i, d)| { + let (msg_controllen, mhdr) = unsafe { + pack_mhdr_to_receive( + d.iov.as_ref(), + &mut d.cmsg_buffer, + addresses[i].as_mut_ptr(), + ) + }; + + output.push( + libc::mmsghdr { + msg_hdr: mhdr, + msg_len: 0, + } + ); + + (msg_controllen as usize, &mut d.cmsg_buffer) + }).collect(); + + let timeout = if let Some(mut t) = timeout { + t.as_mut() as *mut libc::timespec + } else { + ptr::null_mut() + }; + + let ret = unsafe { libc::recvmmsg(fd, output.as_mut_ptr(), output.len() as _, flags.bits() as _, timeout) }; + + let _ = Errno::result(ret)?; + + Ok(output + .into_iter() + .take(ret as usize) + .zip(addresses.iter().map(|addr| unsafe{addr.assume_init()})) + .zip(results.into_iter()) + .map(|((mmsghdr, address), (msg_controllen, cmsg_buffer))| { + unsafe { + read_mhdr( + mmsghdr.msg_hdr, + mmsghdr.msg_len as isize, + msg_controllen, + address, + cmsg_buffer + ) + } + }) + .collect()) +} + +unsafe fn read_mhdr<'a, 'b>( + mhdr: msghdr, + r: isize, + msg_controllen: usize, + address: sockaddr_storage, + cmsg_buffer: &'a mut Option<&'b mut Vec> +) -> RecvMsg<'b> { + let cmsghdr = { + if mhdr.msg_controllen > 0 { + // got control message(s) + cmsg_buffer + .as_mut() + .unwrap() + .set_len(mhdr.msg_controllen as usize); + debug_assert!(!mhdr.msg_control.is_null()); + debug_assert!(msg_controllen >= mhdr.msg_controllen as usize); + CMSG_FIRSTHDR(&mhdr as *const msghdr) + } else { + ptr::null() + }.as_ref() + }; + + let address = sockaddr_storage_to_addr( + &address , + mhdr.msg_namelen as usize + ).ok(); + + RecvMsg { + bytes: r as usize, + cmsghdr, + address, + flags: MsgFlags::from_bits_truncate(mhdr.msg_flags), + mhdr, + } +} + +unsafe fn pack_mhdr_to_receive<'a, I>( + iov: I, + cmsg_buffer: &mut Option<&mut Vec>, + address: *mut sockaddr_storage, +) -> (usize, msghdr) + where + I: AsRef<[IoVec<&'a mut [u8]>]> + 'a, +{ + let (msg_control, msg_controllen) = cmsg_buffer.as_mut() + .map(|v| (v.as_mut_ptr(), v.capacity())) + .unwrap_or((ptr::null_mut(), 0)); + + let mhdr = { + // Musl's msghdr has private fields, so this is the only way to + // initialize it. + let mut mhdr = mem::MaybeUninit::::zeroed(); + let p = mhdr.as_mut_ptr(); + (*p).msg_name = address as *mut c_void; + (*p).msg_namelen = mem::size_of::() as socklen_t; + (*p).msg_iov = iov.as_ref().as_ptr() as *mut iovec; + (*p).msg_iovlen = iov.as_ref().len() as _; + (*p).msg_control = msg_control as *mut c_void; + (*p).msg_controllen = msg_controllen as _; + (*p).msg_flags = 0; + mhdr.assume_init() + }; + + (msg_controllen, mhdr) +} + +fn pack_mhdr_to_send<'a, I, C>( + cmsg_buffer: &mut [u8], + iov: I, + cmsgs: C, + addr: Option<&SockAddr> +) -> msghdr + where + I: AsRef<[IoVec<&'a [u8]>]>, + C: AsRef<[ControlMessage<'a>]> +{ + let capacity = cmsg_buffer.len(); + + // Next encode the sending address, if provided + let (name, namelen) = match addr { + Some(addr) => { + let (x, y) = addr.as_ffi_pair(); + (x as *const _, y) + }, + None => (ptr::null(), 0), + }; + + // The message header must be initialized before the individual cmsgs. + let cmsg_ptr = if capacity > 0 { + cmsg_buffer.as_ptr() as *mut c_void + } else { + ptr::null_mut() + }; + + let mhdr = unsafe { + // Musl's msghdr has private fields, so this is the only way to + // initialize it. + let mut mhdr = mem::MaybeUninit::::zeroed(); + let p = mhdr.as_mut_ptr(); + (*p).msg_name = name as *mut _; + (*p).msg_namelen = namelen; + // transmute iov into a mutable pointer. sendmsg doesn't really mutate + // the buffer, but the standard says that it takes a mutable pointer + (*p).msg_iov = iov.as_ref().as_ptr() as *mut _; + (*p).msg_iovlen = iov.as_ref().len() as _; + (*p).msg_control = cmsg_ptr; + (*p).msg_controllen = capacity as _; + (*p).msg_flags = 0; + mhdr.assume_init() + }; + + // Encode each cmsg. This must happen after initializing the header because + // CMSG_NEXT_HDR and friends read the msg_control and msg_controllen fields. + // CMSG_FIRSTHDR is always safe + let mut pmhdr: *mut cmsghdr = unsafe { CMSG_FIRSTHDR(&mhdr as *const msghdr) }; + for cmsg in cmsgs.as_ref() { + assert_ne!(pmhdr, ptr::null_mut()); + // Safe because we know that pmhdr is valid, and we initialized it with + // sufficient space + unsafe { cmsg.encode_into(pmhdr) }; + // Safe because mhdr is valid + pmhdr = unsafe { CMSG_NXTHDR(&mhdr as *const msghdr, pmhdr) }; + } + + mhdr +} + +/// Receive message in scatter-gather vectors from a socket, and +/// optionally receive ancillary data into the provided buffer. +/// If no ancillary data is desired, use () as the type parameter. +/// +/// # Arguments +/// +/// * `fd`: Socket file descriptor +/// * `iov`: Scatter-gather list of buffers to receive the message +/// * `cmsg_buffer`: Space to receive ancillary data. Should be created by +/// [`cmsg_space!`](macro.cmsg_space.html) +/// * `flags`: Optional flags passed directly to the operating system. +/// +/// # References +/// [recvmsg(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvmsg.html) +pub fn recvmsg<'a>(fd: RawFd, iov: &[IoVec<&mut [u8]>], + mut cmsg_buffer: Option<&'a mut Vec>, + flags: MsgFlags) -> Result> +{ + let mut address = mem::MaybeUninit::uninit(); + + let (msg_controllen, mut mhdr) = unsafe { + pack_mhdr_to_receive(&iov, &mut cmsg_buffer, address.as_mut_ptr()) + }; + + let ret = unsafe { libc::recvmsg(fd, &mut mhdr, flags.bits()) }; + + let r = Errno::result(ret)?; + + Ok(unsafe { read_mhdr(mhdr, r, msg_controllen, address.assume_init(), &mut cmsg_buffer) }) +} + + +/// Create an endpoint for communication +/// +/// The `protocol` specifies a particular protocol to be used with the +/// socket. Normally only a single protocol exists to support a +/// particular socket type within a given protocol family, in which case +/// protocol can be specified as `None`. However, it is possible that many +/// protocols may exist, in which case a particular protocol must be +/// specified in this manner. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html) +pub fn socket>>(domain: AddressFamily, ty: SockType, flags: SockFlag, protocol: T) -> Result { + let protocol = match protocol.into() { + None => 0, + Some(p) => p as c_int, + }; + + // SockFlags are usually embedded into `ty`, but we don't do that in `nix` because it's a + // little easier to understand by separating it out. So we have to merge these bitfields + // here. + let mut ty = ty as c_int; + ty |= flags.bits(); + + let res = unsafe { libc::socket(domain as c_int, ty, protocol) }; + + Errno::result(res) +} + +/// Create a pair of connected sockets +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/socketpair.html) +pub fn socketpair>>(domain: AddressFamily, ty: SockType, protocol: T, + flags: SockFlag) -> Result<(RawFd, RawFd)> { + let protocol = match protocol.into() { + None => 0, + Some(p) => p as c_int, + }; + + // SockFlags are usually embedded into `ty`, but we don't do that in `nix` because it's a + // little easier to understand by separating it out. So we have to merge these bitfields + // here. + let mut ty = ty as c_int; + ty |= flags.bits(); + + let mut fds = [-1, -1]; + + let res = unsafe { libc::socketpair(domain as c_int, ty, protocol, fds.as_mut_ptr()) }; + Errno::result(res)?; + + Ok((fds[0], fds[1])) +} + +/// Listen for connections on a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/listen.html) +pub fn listen(sockfd: RawFd, backlog: usize) -> Result<()> { + let res = unsafe { libc::listen(sockfd, backlog as c_int) }; + + Errno::result(res).map(drop) +} + +/// Bind a name to a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html) +pub fn bind(fd: RawFd, addr: &SockAddr) -> Result<()> { + let res = unsafe { + let (ptr, len) = addr.as_ffi_pair(); + libc::bind(fd, ptr, len) + }; + + Errno::result(res).map(drop) +} + +/// Accept a connection on a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/accept.html) +pub fn accept(sockfd: RawFd) -> Result { + let res = unsafe { libc::accept(sockfd, ptr::null_mut(), ptr::null_mut()) }; + + Errno::result(res) +} + +/// Accept a connection on a socket +/// +/// [Further reading](https://man7.org/linux/man-pages/man2/accept.2.html) +#[cfg(any(all( + target_os = "android", + any( + target_arch = "aarch64", + target_arch = "x86", + target_arch = "x86_64" + ) + ), + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] +pub fn accept4(sockfd: RawFd, flags: SockFlag) -> Result { + let res = unsafe { libc::accept4(sockfd, ptr::null_mut(), ptr::null_mut(), flags.bits()) }; + + Errno::result(res) +} + +/// Initiate a connection on a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html) +pub fn connect(fd: RawFd, addr: &SockAddr) -> Result<()> { + let res = unsafe { + let (ptr, len) = addr.as_ffi_pair(); + libc::connect(fd, ptr, len) + }; + + Errno::result(res).map(drop) +} + +/// Receive data from a connection-oriented socket. Returns the number of +/// bytes read +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/recv.html) +pub fn recv(sockfd: RawFd, buf: &mut [u8], flags: MsgFlags) -> Result { + unsafe { + let ret = libc::recv( + sockfd, + buf.as_ptr() as *mut c_void, + buf.len() as size_t, + flags.bits()); + + Errno::result(ret).map(|r| r as usize) + } +} + +/// Receive data from a connectionless or connection-oriented socket. Returns +/// the number of bytes read and, for connectionless sockets, the socket +/// address of the sender. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html) +pub fn recvfrom(sockfd: RawFd, buf: &mut [u8]) + -> Result<(usize, Option)> +{ + unsafe { + let mut addr: sockaddr_storage = mem::zeroed(); + let mut len = mem::size_of::() as socklen_t; + + let ret = Errno::result(libc::recvfrom( + sockfd, + buf.as_ptr() as *mut c_void, + buf.len() as size_t, + 0, + &mut addr as *mut libc::sockaddr_storage as *mut libc::sockaddr, + &mut len as *mut socklen_t))? as usize; + + match sockaddr_storage_to_addr(&addr, len as usize) { + Err(Errno::ENOTCONN) => Ok((ret, None)), + Ok(addr) => Ok((ret, Some(addr))), + Err(e) => Err(e) + } + } +} + +/// Send a message to a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html) +pub fn sendto(fd: RawFd, buf: &[u8], addr: &SockAddr, flags: MsgFlags) -> Result { + let ret = unsafe { + let (ptr, len) = addr.as_ffi_pair(); + libc::sendto(fd, buf.as_ptr() as *const c_void, buf.len() as size_t, flags.bits(), ptr, len) + }; + + Errno::result(ret).map(|r| r as usize) +} + +/// Send data to a connection-oriented socket. Returns the number of bytes read +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/send.html) +pub fn send(fd: RawFd, buf: &[u8], flags: MsgFlags) -> Result { + let ret = unsafe { + libc::send(fd, buf.as_ptr() as *const c_void, buf.len() as size_t, flags.bits()) + }; + + Errno::result(ret).map(|r| r as usize) +} + +/* + * + * ===== Socket Options ===== + * + */ + +/// Represents a socket option that can be retrieved. +pub trait GetSockOpt : Copy { + type Val; + + /// Look up the value of this socket option on the given socket. + fn get(&self, fd: RawFd) -> Result; +} + +/// Represents a socket option that can be set. +pub trait SetSockOpt : Clone { + type Val; + + /// Set the value of this socket option on the given socket. + fn set(&self, fd: RawFd, val: &Self::Val) -> Result<()>; +} + +/// Get the current value for the requested socket option +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html) +pub fn getsockopt(fd: RawFd, opt: O) -> Result { + opt.get(fd) +} + +/// Sets the value for the requested socket option +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html) +/// +/// # Examples +/// +/// ``` +/// use nix::sys::socket::setsockopt; +/// use nix::sys::socket::sockopt::KeepAlive; +/// use std::net::TcpListener; +/// use std::os::unix::io::AsRawFd; +/// +/// let listener = TcpListener::bind("0.0.0.0:0").unwrap(); +/// let fd = listener.as_raw_fd(); +/// let res = setsockopt(fd, KeepAlive, &true); +/// assert!(res.is_ok()); +/// ``` +pub fn setsockopt(fd: RawFd, opt: O, val: &O::Val) -> Result<()> { + opt.set(fd, val) +} + +/// Get the address of the peer connected to the socket `fd`. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpeername.html) +pub fn getpeername(fd: RawFd) -> Result { + unsafe { + let mut addr = mem::MaybeUninit::uninit(); + let mut len = mem::size_of::() as socklen_t; + + let ret = libc::getpeername( + fd, + addr.as_mut_ptr() as *mut libc::sockaddr, + &mut len + ); + + Errno::result(ret)?; + + sockaddr_storage_to_addr(&addr.assume_init(), len as usize) + } +} + +/// Get the current address to which the socket `fd` is bound. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockname.html) +pub fn getsockname(fd: RawFd) -> Result { + unsafe { + let mut addr = mem::MaybeUninit::uninit(); + let mut len = mem::size_of::() as socklen_t; + + let ret = libc::getsockname( + fd, + addr.as_mut_ptr() as *mut libc::sockaddr, + &mut len + ); + + Errno::result(ret)?; + + sockaddr_storage_to_addr(&addr.assume_init(), len as usize) + } +} + +/// Return the appropriate `SockAddr` type from a `sockaddr_storage` of a +/// certain size. +/// +/// In C this would usually be done by casting. The `len` argument +/// should be the number of bytes in the `sockaddr_storage` that are actually +/// allocated and valid. It must be at least as large as all the useful parts +/// of the structure. Note that in the case of a `sockaddr_un`, `len` need not +/// include the terminating null. +pub fn sockaddr_storage_to_addr( + addr: &sockaddr_storage, + len: usize) -> Result { + + assert!(len <= mem::size_of::()); + if len < mem::size_of_val(&addr.ss_family) { + return Err(Errno::ENOTCONN); + } + + match c_int::from(addr.ss_family) { + libc::AF_INET => { + assert!(len as usize >= mem::size_of::()); + let sin = unsafe { + *(addr as *const sockaddr_storage as *const sockaddr_in) + }; + Ok(SockAddr::Inet(InetAddr::V4(sin))) + } + libc::AF_INET6 => { + assert!(len as usize >= mem::size_of::()); + let sin6 = unsafe { + *(addr as *const _ as *const sockaddr_in6) + }; + Ok(SockAddr::Inet(InetAddr::V6(sin6))) + } + libc::AF_UNIX => { + let pathlen = len - offset_of!(sockaddr_un, sun_path); + unsafe { + let sun = *(addr as *const _ as *const sockaddr_un); + Ok(SockAddr::Unix(UnixAddr::from_raw_parts(sun, pathlen))) + } + } + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_PACKET => { + use libc::sockaddr_ll; + // Don't assert anything about the size. + // Apparently the Linux kernel can return smaller sizes when + // the value in the last element of sockaddr_ll (`sll_addr`) is + // smaller than the declared size of that field + let sll = unsafe { + *(addr as *const _ as *const sockaddr_ll) + }; + Ok(SockAddr::Link(LinkAddr(sll))) + } + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => { + use libc::sockaddr_nl; + let snl = unsafe { + *(addr as *const _ as *const sockaddr_nl) + }; + Ok(SockAddr::Netlink(NetlinkAddr(snl))) + } + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_ALG => { + use libc::sockaddr_alg; + let salg = unsafe { + *(addr as *const _ as *const sockaddr_alg) + }; + Ok(SockAddr::Alg(AlgAddr(salg))) + } + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => { + use libc::sockaddr_vm; + let svm = unsafe { + *(addr as *const _ as *const sockaddr_vm) + }; + Ok(SockAddr::Vsock(VsockAddr(svm))) + } + af => panic!("unexpected address family {}", af), + } +} + + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum Shutdown { + /// Further receptions will be disallowed. + Read, + /// Further transmissions will be disallowed. + Write, + /// Further receptions and transmissions will be disallowed. + Both, +} + +/// Shut down part of a full-duplex connection. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/shutdown.html) +pub fn shutdown(df: RawFd, how: Shutdown) -> Result<()> { + unsafe { + use libc::shutdown; + + let how = match how { + Shutdown::Read => libc::SHUT_RD, + Shutdown::Write => libc::SHUT_WR, + Shutdown::Both => libc::SHUT_RDWR, + }; + + Errno::result(shutdown(df, how)).map(drop) + } +} + +#[cfg(test)] +mod tests { + #[test] + fn can_use_cmsg_space() { + let _ = cmsg_space!(u8); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/socket/sockopt.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/socket/sockopt.rs new file mode 100644 index 0000000000000000000000000000000000000000..fcb4be81be861ab9783c4b51f4a058903ceeab67 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/socket/sockopt.rs @@ -0,0 +1,930 @@ +//! Socket options as used by `setsockopt` and `getsockopt`. +use cfg_if::cfg_if; +use super::{GetSockOpt, SetSockOpt}; +use crate::Result; +use crate::errno::Errno; +use crate::sys::time::TimeVal; +use libc::{self, c_int, c_void, socklen_t}; +use std::mem::{ + self, + MaybeUninit +}; +use std::os::unix::io::RawFd; +use std::ffi::{OsStr, OsString}; +#[cfg(target_family = "unix")] +use std::os::unix::ffi::OsStrExt; + +// Constants +// TCP_CA_NAME_MAX isn't defined in user space include files +#[cfg(any(target_os = "freebsd", target_os = "linux"))] +const TCP_CA_NAME_MAX: usize = 16; + +/// Helper for implementing `SetSockOpt` for a given socket option. See +/// [`::sys::socket::SetSockOpt`](sys/socket/trait.SetSockOpt.html). +/// +/// This macro aims to help implementing `SetSockOpt` for different socket options that accept +/// different kinds of data to be used with `setsockopt`. +/// +/// Instead of using this macro directly consider using `sockopt_impl!`, especially if the option +/// you are implementing represents a simple type. +/// +/// # Arguments +/// +/// * `$name:ident`: name of the type you want to implement `SetSockOpt` for. +/// * `$level:expr` : socket layer, or a `protocol level`: could be *raw sockets* +/// (`libc::SOL_SOCKET`), *ip protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc::IPPROTO_TCP`), +/// and more. Please refer to your system manual for more options. Will be passed as the second +/// argument (`level`) to the `setsockopt` call. +/// * `$flag:path`: a flag name to set. Some examples: `libc::SO_REUSEADDR`, `libc::TCP_NODELAY`, +/// `libc::IP_ADD_MEMBERSHIP` and others. Will be passed as the third argument (`option_name`) +/// to the `setsockopt` call. +/// * Type of the value that you are going to set. +/// * Type that implements the `Set` trait for the type from the previous item (like `SetBool` for +/// `bool`, `SetUsize` for `usize`, etc.). +macro_rules! setsockopt_impl { + ($name:ident, $level:expr, $flag:path, $ty:ty, $setter:ty) => { + impl SetSockOpt for $name { + type Val = $ty; + + fn set(&self, fd: RawFd, val: &$ty) -> Result<()> { + unsafe { + let setter: $setter = Set::new(val); + + let res = libc::setsockopt(fd, $level, $flag, + setter.ffi_ptr(), + setter.ffi_len()); + Errno::result(res).map(drop) + } + } + } + } +} + +/// Helper for implementing `GetSockOpt` for a given socket option. See +/// [`::sys::socket::GetSockOpt`](sys/socket/trait.GetSockOpt.html). +/// +/// This macro aims to help implementing `GetSockOpt` for different socket options that accept +/// different kinds of data to be use with `getsockopt`. +/// +/// Instead of using this macro directly consider using `sockopt_impl!`, especially if the option +/// you are implementing represents a simple type. +/// +/// # Arguments +/// +/// * Name of the type you want to implement `GetSockOpt` for. +/// * Socket layer, or a `protocol level`: could be *raw sockets* (`lic::SOL_SOCKET`), *ip +/// protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc::IPPROTO_TCP`), and more. Please refer +/// to your system manual for more options. Will be passed as the second argument (`level`) to +/// the `getsockopt` call. +/// * A flag to set. Some examples: `libc::SO_REUSEADDR`, `libc::TCP_NODELAY`, +/// `libc::SO_ORIGINAL_DST` and others. Will be passed as the third argument (`option_name`) to +/// the `getsockopt` call. +/// * Type of the value that you are going to get. +/// * Type that implements the `Get` trait for the type from the previous item (`GetBool` for +/// `bool`, `GetUsize` for `usize`, etc.). +macro_rules! getsockopt_impl { + ($name:ident, $level:expr, $flag:path, $ty:ty, $getter:ty) => { + impl GetSockOpt for $name { + type Val = $ty; + + fn get(&self, fd: RawFd) -> Result<$ty> { + unsafe { + let mut getter: $getter = Get::uninit(); + + let res = libc::getsockopt(fd, $level, $flag, + getter.ffi_ptr(), + getter.ffi_len()); + Errno::result(res)?; + + Ok(getter.assume_init()) + } + } + } + } +} + +/// Helper to generate the sockopt accessors. See +/// [`::sys::socket::GetSockOpt`](sys/socket/trait.GetSockOpt.html) and +/// [`::sys::socket::SetSockOpt`](sys/socket/trait.SetSockOpt.html). +/// +/// This macro aims to help implementing `GetSockOpt` and `SetSockOpt` for different socket options +/// that accept different kinds of data to be use with `getsockopt` and `setsockopt` respectively. +/// +/// Basically this macro wraps up the [`getsockopt_impl!`](macro.getsockopt_impl.html) and +/// [`setsockopt_impl!`](macro.setsockopt_impl.html) macros. +/// +/// # Arguments +/// +/// * `GetOnly`, `SetOnly` or `Both`: whether you want to implement only getter, only setter or +/// both of them. +/// * `$name:ident`: name of type `GetSockOpt`/`SetSockOpt` will be implemented for. +/// * `$level:expr` : socket layer, or a `protocol level`: could be *raw sockets* +/// (`lic::SOL_SOCKET`), *ip protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc::IPPROTO_TCP`), +/// and more. Please refer to your system manual for more options. Will be passed as the second +/// argument (`level`) to the `getsockopt`/`setsockopt` call. +/// * `$flag:path`: a flag name to set. Some examples: `libc::SO_REUSEADDR`, `libc::TCP_NODELAY`, +/// `libc::IP_ADD_MEMBERSHIP` and others. Will be passed as the third argument (`option_name`) +/// to the `setsockopt`/`getsockopt` call. +/// * `$ty:ty`: type of the value that will be get/set. +/// * `$getter:ty`: `Get` implementation; optional; only for `GetOnly` and `Both`. +/// * `$setter:ty`: `Set` implementation; optional; only for `SetOnly` and `Both`. +macro_rules! sockopt_impl { + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, bool) => { + sockopt_impl!($(#[$attr])* + $name, GetOnly, $level, $flag, bool, GetBool); + }; + + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, u8) => { + sockopt_impl!($(#[$attr])* $name, GetOnly, $level, $flag, u8, GetU8); + }; + + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, usize) => + { + sockopt_impl!($(#[$attr])* + $name, GetOnly, $level, $flag, usize, GetUsize); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, bool) => { + sockopt_impl!($(#[$attr])* + $name, SetOnly, $level, $flag, bool, SetBool); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, u8) => { + sockopt_impl!($(#[$attr])* $name, SetOnly, $level, $flag, u8, SetU8); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, usize) => + { + sockopt_impl!($(#[$attr])* + $name, SetOnly, $level, $flag, usize, SetUsize); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, bool) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, bool, GetBool, SetBool); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, u8) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, u8, GetU8, SetU8); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, usize) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, usize, GetUsize, SetUsize); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, + OsString<$array:ty>) => + { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, OsString, GetOsString<$array>, + SetOsString); + }; + + /* + * Matchers with generic getter types must be placed at the end, so + * they'll only match _after_ specialized matchers fail + */ + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, $ty:ty) => + { + sockopt_impl!($(#[$attr])* + $name, GetOnly, $level, $flag, $ty, GetStruct<$ty>); + }; + + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, $ty:ty, + $getter:ty) => + { + $(#[$attr])* + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct $name; + + getsockopt_impl!($name, $level, $flag, $ty, $getter); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, $ty:ty) => + { + sockopt_impl!($(#[$attr])* + $name, SetOnly, $level, $flag, $ty, SetStruct<$ty>); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, $ty:ty, + $setter:ty) => + { + $(#[$attr])* + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct $name; + + setsockopt_impl!($name, $level, $flag, $ty, $setter); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, $ty:ty, + $getter:ty, $setter:ty) => + { + $(#[$attr])* + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct $name; + + setsockopt_impl!($name, $level, $flag, $ty, $setter); + getsockopt_impl!($name, $level, $flag, $ty, $getter); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, $ty:ty) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, $ty, GetStruct<$ty>, + SetStruct<$ty>); + }; +} + +/* + * + * ===== Define sockopts ===== + * + */ + +sockopt_impl!( + /// Enables local address reuse + ReuseAddr, Both, libc::SOL_SOCKET, libc::SO_REUSEADDR, bool +); +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] +sockopt_impl!( + /// Permits multiple AF_INET or AF_INET6 sockets to be bound to an + /// identical socket address. + ReusePort, Both, libc::SOL_SOCKET, libc::SO_REUSEPORT, bool); +sockopt_impl!( + /// Under most circumstances, TCP sends data when it is presented; when + /// outstanding data has not yet been acknowledged, it gathers small amounts + /// of output to be sent in a single packet once an acknowledgement is + /// received. For a small number of clients, such as window systems that + /// send a stream of mouse events which receive no replies, this + /// packetization may cause significant delays. The boolean option + /// TCP_NODELAY defeats this algorithm. + TcpNoDelay, Both, libc::IPPROTO_TCP, libc::TCP_NODELAY, bool); +sockopt_impl!( + /// When enabled, a close(2) or shutdown(2) will not return until all + /// queued messages for the socket have been successfully sent or the + /// linger timeout has been reached. + Linger, Both, libc::SOL_SOCKET, libc::SO_LINGER, libc::linger); +sockopt_impl!( + /// Join a multicast group + IpAddMembership, SetOnly, libc::IPPROTO_IP, libc::IP_ADD_MEMBERSHIP, + super::IpMembershipRequest); +sockopt_impl!( + /// Leave a multicast group. + IpDropMembership, SetOnly, libc::IPPROTO_IP, libc::IP_DROP_MEMBERSHIP, + super::IpMembershipRequest); +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + sockopt_impl!( + /// Join an IPv6 multicast group. + Ipv6AddMembership, SetOnly, libc::IPPROTO_IPV6, libc::IPV6_ADD_MEMBERSHIP, super::Ipv6MembershipRequest); + sockopt_impl!( + /// Leave an IPv6 multicast group. + Ipv6DropMembership, SetOnly, libc::IPPROTO_IPV6, libc::IPV6_DROP_MEMBERSHIP, super::Ipv6MembershipRequest); + } else if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] { + sockopt_impl!( + /// Join an IPv6 multicast group. + Ipv6AddMembership, SetOnly, libc::IPPROTO_IPV6, + libc::IPV6_JOIN_GROUP, super::Ipv6MembershipRequest); + sockopt_impl!( + /// Leave an IPv6 multicast group. + Ipv6DropMembership, SetOnly, libc::IPPROTO_IPV6, + libc::IPV6_LEAVE_GROUP, super::Ipv6MembershipRequest); + } +} +sockopt_impl!( + /// Set or read the time-to-live value of outgoing multicast packets for + /// this socket. + IpMulticastTtl, Both, libc::IPPROTO_IP, libc::IP_MULTICAST_TTL, u8); +sockopt_impl!( + /// Set or read a boolean integer argument that determines whether sent + /// multicast packets should be looped back to the local sockets. + IpMulticastLoop, Both, libc::IPPROTO_IP, libc::IP_MULTICAST_LOOP, bool); +#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] +sockopt_impl!( + /// If enabled, this boolean option allows binding to an IP address that + /// is nonlocal or does not (yet) exist. + IpFreebind, Both, libc::IPPROTO_IP, libc::IP_FREEBIND, bool); +sockopt_impl!( + /// Specify the receiving timeout until reporting an error. + ReceiveTimeout, Both, libc::SOL_SOCKET, libc::SO_RCVTIMEO, TimeVal); +sockopt_impl!( + /// Specify the sending timeout until reporting an error. + SendTimeout, Both, libc::SOL_SOCKET, libc::SO_SNDTIMEO, TimeVal); +sockopt_impl!( + /// Set or get the broadcast flag. + Broadcast, Both, libc::SOL_SOCKET, libc::SO_BROADCAST, bool); +sockopt_impl!( + /// If this option is enabled, out-of-band data is directly placed into + /// the receive data stream. + OobInline, Both, libc::SOL_SOCKET, libc::SO_OOBINLINE, bool); +sockopt_impl!( + /// Get and clear the pending socket error. + SocketError, GetOnly, libc::SOL_SOCKET, libc::SO_ERROR, i32); +sockopt_impl!( + /// Enable sending of keep-alive messages on connection-oriented sockets. + KeepAlive, Both, libc::SOL_SOCKET, libc::SO_KEEPALIVE, bool); +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios" +))] +sockopt_impl!( + /// Get the credentials of the peer process of a connected unix domain + /// socket. + LocalPeerCred, GetOnly, 0, libc::LOCAL_PEERCRED, super::XuCred); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Return the credentials of the foreign process connected to this socket. + PeerCredentials, GetOnly, libc::SOL_SOCKET, libc::SO_PEERCRED, super::UnixCredentials); +#[cfg(any(target_os = "ios", + target_os = "macos"))] +sockopt_impl!( + /// Specify the amount of time, in seconds, that the connection must be idle + /// before keepalive probes (if enabled) are sent. + TcpKeepAlive, Both, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE, u32); +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "nacl"))] +sockopt_impl!( + /// The time (in seconds) the connection needs to remain idle before TCP + /// starts sending keepalive probes + TcpKeepIdle, Both, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE, u32); +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + sockopt_impl!( + /// The maximum segment size for outgoing TCP packets. + TcpMaxSeg, Both, libc::IPPROTO_TCP, libc::TCP_MAXSEG, u32); + } else { + sockopt_impl!( + /// The maximum segment size for outgoing TCP packets. + TcpMaxSeg, GetOnly, libc::IPPROTO_TCP, libc::TCP_MAXSEG, u32); + } +} +#[cfg(not(target_os = "openbsd"))] +sockopt_impl!( + /// The maximum number of keepalive probes TCP should send before + /// dropping the connection. + TcpKeepCount, Both, libc::IPPROTO_TCP, libc::TCP_KEEPCNT, u32); +#[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "linux"))] +sockopt_impl!( + #[allow(missing_docs)] + // Not documented by Linux! + TcpRepair, Both, libc::IPPROTO_TCP, libc::TCP_REPAIR, u32); +#[cfg(not(target_os = "openbsd"))] +sockopt_impl!( + /// The time (in seconds) between individual keepalive probes. + TcpKeepInterval, Both, libc::IPPROTO_TCP, libc::TCP_KEEPINTVL, u32); +#[cfg(any(target_os = "fuchsia", target_os = "linux"))] +sockopt_impl!( + /// Specifies the maximum amount of time in milliseconds that transmitted + /// data may remain unacknowledged before TCP will forcibly close the + /// corresponding connection + TcpUserTimeout, Both, libc::IPPROTO_TCP, libc::TCP_USER_TIMEOUT, u32); +sockopt_impl!( + /// Sets or gets the maximum socket receive buffer in bytes. + RcvBuf, Both, libc::SOL_SOCKET, libc::SO_RCVBUF, usize); +sockopt_impl!( + /// Sets or gets the maximum socket send buffer in bytes. + SndBuf, Both, libc::SOL_SOCKET, libc::SO_SNDBUF, usize); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Using this socket option, a privileged (`CAP_NET_ADMIN`) process can + /// perform the same task as `SO_RCVBUF`, but the `rmem_max limit` can be + /// overridden. + RcvBufForce, SetOnly, libc::SOL_SOCKET, libc::SO_RCVBUFFORCE, usize); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Using this socket option, a privileged (`CAP_NET_ADMIN`) process can + /// perform the same task as `SO_SNDBUF`, but the `wmem_max` limit can be + /// overridden. + SndBufForce, SetOnly, libc::SOL_SOCKET, libc::SO_SNDBUFFORCE, usize); +sockopt_impl!( + /// Gets the socket type as an integer. + SockType, GetOnly, libc::SOL_SOCKET, libc::SO_TYPE, super::SockType); +sockopt_impl!( + /// Returns a value indicating whether or not this socket has been marked to + /// accept connections with `listen(2)`. + AcceptConn, GetOnly, libc::SOL_SOCKET, libc::SO_ACCEPTCONN, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Bind this socket to a particular device like “eth0”. + BindToDevice, Both, libc::SOL_SOCKET, libc::SO_BINDTODEVICE, OsString<[u8; libc::IFNAMSIZ]>); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + #[allow(missing_docs)] + // Not documented by Linux! + OriginalDst, GetOnly, libc::SOL_IP, libc::SO_ORIGINAL_DST, libc::sockaddr_in); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + #[allow(missing_docs)] + // Not documented by Linux! + Ip6tOriginalDst, GetOnly, libc::SOL_IPV6, libc::IP6T_SO_ORIGINAL_DST, libc::sockaddr_in6); +sockopt_impl!( + /// Enable or disable the receiving of the `SO_TIMESTAMP` control message. + ReceiveTimestamp, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMP, bool); +#[cfg(all(target_os = "linux"))] +sockopt_impl!( + /// Enable or disable the receiving of the `SO_TIMESTAMPNS` control message. + ReceiveTimestampns, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMPNS, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Setting this boolean option enables transparent proxying on this socket. + IpTransparent, Both, libc::SOL_IP, libc::IP_TRANSPARENT, bool); +#[cfg(target_os = "openbsd")] +sockopt_impl!( + /// Allows the socket to be bound to addresses which are not local to the + /// machine, so it can be used to make a transparent proxy. + BindAny, Both, libc::SOL_SOCKET, libc::SO_BINDANY, bool); +#[cfg(target_os = "freebsd")] +sockopt_impl!( + /// Can `bind(2)` to any address, even one not bound to any available + /// network interface in the system. + BindAny, Both, libc::IPPROTO_IP, libc::IP_BINDANY, bool); +#[cfg(target_os = "linux")] +sockopt_impl!( + /// Set the mark for each packet sent through this socket (similar to the + /// netfilter MARK target but socket-based). + Mark, Both, libc::SOL_SOCKET, libc::SO_MARK, u32); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Enable or disable the receiving of the `SCM_CREDENTIALS` control + /// message. + PassCred, Both, libc::SOL_SOCKET, libc::SO_PASSCRED, bool); +#[cfg(any(target_os = "freebsd", target_os = "linux"))] +sockopt_impl!( + /// This option allows the caller to set the TCP congestion control + /// algorithm to be used, on a per-socket basis. + TcpCongestion, Both, libc::IPPROTO_TCP, libc::TCP_CONGESTION, OsString<[u8; TCP_CA_NAME_MAX]>); +#[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", +))] +sockopt_impl!( + /// Pass an `IP_PKTINFO` ancillary message that contains a pktinfo + /// structure that supplies some information about the incoming packet. + Ipv4PacketInfo, Both, libc::IPPROTO_IP, libc::IP_PKTINFO, bool); +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +sockopt_impl!( + /// Set delivery of the `IPV6_PKTINFO` control message on incoming + /// datagrams. + Ipv6RecvPacketInfo, Both, libc::IPPROTO_IPV6, libc::IPV6_RECVPKTINFO, bool); +#[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +sockopt_impl!( + /// The `recvmsg(2)` call returns a `struct sockaddr_dl` corresponding to + /// the interface on which the packet was received. + Ipv4RecvIf, Both, libc::IPPROTO_IP, libc::IP_RECVIF, bool); +#[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +sockopt_impl!( + /// The `recvmsg(2)` call will return the destination IP address for a UDP + /// datagram. + Ipv4RecvDstAddr, Both, libc::IPPROTO_IP, libc::IP_RECVDSTADDR, bool); +#[cfg(target_os = "linux")] +sockopt_impl!( + #[allow(missing_docs)] + // Not documented by Linux! + UdpGsoSegment, Both, libc::SOL_UDP, libc::UDP_SEGMENT, libc::c_int); +#[cfg(target_os = "linux")] +sockopt_impl!( + #[allow(missing_docs)] + // Not documented by Linux! + UdpGroSegment, Both, libc::IPPROTO_UDP, libc::UDP_GRO, bool); +#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] +sockopt_impl!( + /// Indicates that an unsigned 32-bit value ancillary message (cmsg) should + /// be attached to received skbs indicating the number of packets dropped by + /// the socket since its creation. + RxqOvfl, Both, libc::SOL_SOCKET, libc::SO_RXQ_OVFL, libc::c_int); +sockopt_impl!( + /// The socket is restricted to sending and receiving IPv6 packets only. + Ipv6V6Only, Both, libc::IPPROTO_IPV6, libc::IPV6_V6ONLY, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Enable extended reliable error message passing. + Ipv4RecvErr, Both, libc::IPPROTO_IP, libc::IP_RECVERR, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Control receiving of asynchronous error options. + Ipv6RecvErr, Both, libc::IPPROTO_IPV6, libc::IPV6_RECVERR, bool); +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +sockopt_impl!( + /// Set or retrieve the current time-to-live field that is used in every + /// packet sent from this socket. + Ipv4Ttl, Both, libc::IPPROTO_IP, libc::IP_TTL, libc::c_int); +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +sockopt_impl!( + /// Set the unicast hop limit for the socket. + Ipv6Ttl, Both, libc::IPPROTO_IPV6, libc::IPV6_UNICAST_HOPS, libc::c_int); + +#[allow(missing_docs)] +// Not documented by Linux! +#[cfg(any(target_os = "android", target_os = "linux"))] +#[derive(Copy, Clone, Debug)] +pub struct AlgSetAeadAuthSize; + +// ALG_SET_AEAD_AUTH_SIZE read the length from passed `option_len` +// See https://elixir.bootlin.com/linux/v4.4/source/crypto/af_alg.c#L222 +#[cfg(any(target_os = "android", target_os = "linux"))] +impl SetSockOpt for AlgSetAeadAuthSize { + type Val = usize; + + fn set(&self, fd: RawFd, val: &usize) -> Result<()> { + unsafe { + let res = libc::setsockopt(fd, + libc::SOL_ALG, + libc::ALG_SET_AEAD_AUTHSIZE, + ::std::ptr::null(), + *val as libc::socklen_t); + Errno::result(res).map(drop) + } + } +} + +#[allow(missing_docs)] +// Not documented by Linux! +#[cfg(any(target_os = "android", target_os = "linux"))] +#[derive(Clone, Debug)] +pub struct AlgSetKey(::std::marker::PhantomData); + +#[cfg(any(target_os = "android", target_os = "linux"))] +impl Default for AlgSetKey { + fn default() -> Self { + AlgSetKey(Default::default()) + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +impl SetSockOpt for AlgSetKey where T: AsRef<[u8]> + Clone { + type Val = T; + + fn set(&self, fd: RawFd, val: &T) -> Result<()> { + unsafe { + let res = libc::setsockopt(fd, + libc::SOL_ALG, + libc::ALG_SET_KEY, + val.as_ref().as_ptr() as *const _, + val.as_ref().len() as libc::socklen_t); + Errno::result(res).map(drop) + } + } +} + +/* + * + * ===== Accessor helpers ===== + * + */ + +/// Helper trait that describes what is expected from a `GetSockOpt` getter. +trait Get { + /// Returns an uninitialized value. + fn uninit() -> Self; + /// Returns a pointer to the stored value. This pointer will be passed to the system's + /// `getsockopt` call (`man 3p getsockopt`, argument `option_value`). + fn ffi_ptr(&mut self) -> *mut c_void; + /// Returns length of the stored value. This pointer will be passed to the system's + /// `getsockopt` call (`man 3p getsockopt`, argument `option_len`). + fn ffi_len(&mut self) -> *mut socklen_t; + /// Returns the hopefully initialized inner value. + unsafe fn assume_init(self) -> T; +} + +/// Helper trait that describes what is expected from a `SetSockOpt` setter. +trait Set<'a, T> { + /// Initialize the setter with a given value. + fn new(val: &'a T) -> Self; + /// Returns a pointer to the stored value. This pointer will be passed to the system's + /// `setsockopt` call (`man 3p setsockopt`, argument `option_value`). + fn ffi_ptr(&self) -> *const c_void; + /// Returns length of the stored value. This pointer will be passed to the system's + /// `setsockopt` call (`man 3p setsockopt`, argument `option_len`). + fn ffi_len(&self) -> socklen_t; +} + +/// Getter for an arbitrary `struct`. +struct GetStruct { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetStruct { + fn uninit() -> Self { + GetStruct { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> T { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() + } +} + +/// Setter for an arbitrary `struct`. +struct SetStruct<'a, T: 'static> { + ptr: &'a T, +} + +impl<'a, T> Set<'a, T> for SetStruct<'a, T> { + fn new(ptr: &'a T) -> SetStruct<'a, T> { + SetStruct { ptr } + } + + fn ffi_ptr(&self) -> *const c_void { + self.ptr as *const T as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for a boolean value. +struct GetBool { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetBool { + fn uninit() -> Self { + GetBool { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> bool { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() != 0 + } +} + +/// Setter for a boolean value. +struct SetBool { + val: c_int, +} + +impl<'a> Set<'a, bool> for SetBool { + fn new(val: &'a bool) -> SetBool { + SetBool { val: if *val { 1 } else { 0 } } + } + + fn ffi_ptr(&self) -> *const c_void { + &self.val as *const c_int as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for an `u8` value. +struct GetU8 { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetU8 { + fn uninit() -> Self { + GetU8 { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> u8 { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() + } +} + +/// Setter for an `u8` value. +struct SetU8 { + val: u8, +} + +impl<'a> Set<'a, u8> for SetU8 { + fn new(val: &'a u8) -> SetU8 { + SetU8 { val: *val as u8 } + } + + fn ffi_ptr(&self) -> *const c_void { + &self.val as *const u8 as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for an `usize` value. +struct GetUsize { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetUsize { + fn uninit() -> Self { + GetUsize { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> usize { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() as usize + } +} + +/// Setter for an `usize` value. +struct SetUsize { + val: c_int, +} + +impl<'a> Set<'a, usize> for SetUsize { + fn new(val: &'a usize) -> SetUsize { + SetUsize { val: *val as c_int } + } + + fn ffi_ptr(&self) -> *const c_void { + &self.val as *const c_int as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for a `OsString` value. +struct GetOsString> { + len: socklen_t, + val: MaybeUninit, +} + +impl> Get for GetOsString { + fn uninit() -> Self { + GetOsString { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> OsString { + let len = self.len as usize; + let mut v = self.val.assume_init(); + OsStr::from_bytes(&v.as_mut()[0..len]).to_owned() + } +} + +/// Setter for a `OsString` value. +struct SetOsString<'a> { + val: &'a OsStr, +} + +impl<'a> Set<'a, OsString> for SetOsString<'a> { + fn new(val: &'a OsString) -> SetOsString { + SetOsString { val: val.as_os_str() } + } + + fn ffi_ptr(&self) -> *const c_void { + self.val.as_bytes().as_ptr() as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + self.val.len() as socklen_t + } +} + + +#[cfg(test)] +mod test { + #[cfg(any(target_os = "android", target_os = "linux"))] + #[test] + fn can_get_peercred_on_unix_socket() { + use super::super::*; + + let (a, b) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()).unwrap(); + let a_cred = getsockopt(a, super::PeerCredentials).unwrap(); + let b_cred = getsockopt(b, super::PeerCredentials).unwrap(); + assert_eq!(a_cred, b_cred); + assert!(a_cred.pid() != 0); + } + + #[test] + fn is_socket_type_unix() { + use super::super::*; + use crate::unistd::close; + + let (a, b) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()).unwrap(); + let a_type = getsockopt(a, super::SockType).unwrap(); + assert_eq!(a_type, SockType::Stream); + close(a).unwrap(); + close(b).unwrap(); + } + + #[test] + fn is_socket_type_dgram() { + use super::super::*; + use crate::unistd::close; + + let s = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None).unwrap(); + let s_type = getsockopt(s, super::SockType).unwrap(); + assert_eq!(s_type, SockType::Datagram); + close(s).unwrap(); + } + + #[cfg(any(target_os = "freebsd", + target_os = "linux", + target_os = "nacl"))] + #[test] + fn can_get_listen_on_tcp_socket() { + use super::super::*; + use crate::unistd::close; + + let s = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); + let s_listening = getsockopt(s, super::AcceptConn).unwrap(); + assert!(!s_listening); + listen(s, 10).unwrap(); + let s_listening2 = getsockopt(s, super::AcceptConn).unwrap(); + assert!(s_listening2); + close(s).unwrap(); + } + +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/stat.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/stat.rs new file mode 100644 index 0000000000000000000000000000000000000000..c8f10419c31b5788d5a3ccf9c9c0084bc00c7284 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/stat.rs @@ -0,0 +1,315 @@ +pub use libc::{dev_t, mode_t}; +pub use libc::stat as FileStat; + +use crate::{Result, NixPath, errno::Errno}; +#[cfg(not(target_os = "redox"))] +use crate::fcntl::{AtFlags, at_rawfd}; +use std::mem; +use std::os::unix::io::RawFd; +use crate::sys::time::{TimeSpec, TimeVal}; + +libc_bitflags!( + /// "File type" flags for `mknod` and related functions. + pub struct SFlag: mode_t { + S_IFIFO; + S_IFCHR; + S_IFDIR; + S_IFBLK; + S_IFREG; + S_IFLNK; + S_IFSOCK; + S_IFMT; + } +); + +libc_bitflags! { + /// "File mode / permissions" flags. + pub struct Mode: mode_t { + S_IRWXU; + S_IRUSR; + S_IWUSR; + S_IXUSR; + S_IRWXG; + S_IRGRP; + S_IWGRP; + S_IXGRP; + S_IRWXO; + S_IROTH; + S_IWOTH; + S_IXOTH; + S_ISUID as mode_t; + S_ISGID as mode_t; + S_ISVTX as mode_t; + } +} + +/// Create a special or ordinary file, by pathname. +pub fn mknod(path: &P, kind: SFlag, perm: Mode, dev: dev_t) -> Result<()> { + let res = path.with_nix_path(|cstr| unsafe { + libc::mknod(cstr.as_ptr(), kind.bits | perm.bits() as mode_t, dev) + })?; + + Errno::result(res).map(drop) +} + +/// Create a special or ordinary file, relative to a given directory. +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] +pub fn mknodat( + dirfd: RawFd, + path: &P, + kind: SFlag, + perm: Mode, + dev: dev_t, +) -> Result<()> { + let res = path.with_nix_path(|cstr| unsafe { + libc::mknodat(dirfd, cstr.as_ptr(), kind.bits | perm.bits() as mode_t, dev) + })?; + + Errno::result(res).map(drop) +} + +#[cfg(target_os = "linux")] +pub const fn major(dev: dev_t) -> u64 { + ((dev >> 32) & 0xffff_f000) | + ((dev >> 8) & 0x0000_0fff) +} + +#[cfg(target_os = "linux")] +pub const fn minor(dev: dev_t) -> u64 { + ((dev >> 12) & 0xffff_ff00) | + ((dev ) & 0x0000_00ff) +} + +#[cfg(target_os = "linux")] +pub const fn makedev(major: u64, minor: u64) -> dev_t { + ((major & 0xffff_f000) << 32) | + ((major & 0x0000_0fff) << 8) | + ((minor & 0xffff_ff00) << 12) | + (minor & 0x0000_00ff) +} + +pub fn umask(mode: Mode) -> Mode { + let prev = unsafe { libc::umask(mode.bits() as mode_t) }; + Mode::from_bits(prev).expect("[BUG] umask returned invalid Mode") +} + +pub fn stat(path: &P) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = path.with_nix_path(|cstr| { + unsafe { + libc::stat(cstr.as_ptr(), dst.as_mut_ptr()) + } + })?; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +pub fn lstat(path: &P) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = path.with_nix_path(|cstr| { + unsafe { + libc::lstat(cstr.as_ptr(), dst.as_mut_ptr()) + } + })?; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +pub fn fstat(fd: RawFd) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = unsafe { libc::fstat(fd, dst.as_mut_ptr()) }; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +#[cfg(not(target_os = "redox"))] +pub fn fstatat(dirfd: RawFd, pathname: &P, f: AtFlags) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = pathname.with_nix_path(|cstr| { + unsafe { libc::fstatat(dirfd, cstr.as_ptr(), dst.as_mut_ptr(), f.bits() as libc::c_int) } + })?; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +/// Change the file permission bits of the file specified by a file descriptor. +/// +/// # References +/// +/// [fchmod(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchmod.html). +pub fn fchmod(fd: RawFd, mode: Mode) -> Result<()> { + let res = unsafe { libc::fchmod(fd, mode.bits() as mode_t) }; + + Errno::result(res).map(drop) +} + +/// Flags for `fchmodat` function. +#[derive(Clone, Copy, Debug)] +pub enum FchmodatFlags { + FollowSymlink, + NoFollowSymlink, +} + +/// Change the file permission bits. +/// +/// The file to be changed is determined relative to the directory associated +/// with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. +/// +/// If `flag` is `FchmodatFlags::NoFollowSymlink` and `path` names a symbolic link, +/// then the mode of the symbolic link is changed. +/// +/// `fchmodat(None, path, mode, FchmodatFlags::FollowSymlink)` is identical to +/// a call `libc::chmod(path, mode)`. That's why `chmod` is unimplemented +/// in the `nix` crate. +/// +/// # References +/// +/// [fchmodat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchmodat.html). +#[cfg(not(target_os = "redox"))] +pub fn fchmodat( + dirfd: Option, + path: &P, + mode: Mode, + flag: FchmodatFlags, +) -> Result<()> { + let atflag = + match flag { + FchmodatFlags::FollowSymlink => AtFlags::empty(), + FchmodatFlags::NoFollowSymlink => AtFlags::AT_SYMLINK_NOFOLLOW, + }; + let res = path.with_nix_path(|cstr| unsafe { + libc::fchmodat( + at_rawfd(dirfd), + cstr.as_ptr(), + mode.bits() as mode_t, + atflag.bits() as libc::c_int, + ) + })?; + + Errno::result(res).map(drop) +} + +/// Change the access and modification times of a file. +/// +/// `utimes(path, times)` is identical to +/// `utimensat(None, path, times, UtimensatFlags::FollowSymlink)`. The former +/// is a deprecated API so prefer using the latter if the platforms you care +/// about support it. +/// +/// # References +/// +/// [utimes(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimes.html). +pub fn utimes(path: &P, atime: &TimeVal, mtime: &TimeVal) -> Result<()> { + let times: [libc::timeval; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = path.with_nix_path(|cstr| unsafe { + libc::utimes(cstr.as_ptr(), ×[0]) + })?; + + Errno::result(res).map(drop) +} + +/// Change the access and modification times of a file without following symlinks. +/// +/// `lutimes(path, times)` is identical to +/// `utimensat(None, path, times, UtimensatFlags::NoFollowSymlink)`. The former +/// is a deprecated API so prefer using the latter if the platforms you care +/// about support it. +/// +/// # References +/// +/// [lutimes(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lutimes.html). +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] +pub fn lutimes(path: &P, atime: &TimeVal, mtime: &TimeVal) -> Result<()> { + let times: [libc::timeval; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = path.with_nix_path(|cstr| unsafe { + libc::lutimes(cstr.as_ptr(), ×[0]) + })?; + + Errno::result(res).map(drop) +} + +/// Change the access and modification times of the file specified by a file descriptor. +/// +/// # References +/// +/// [futimens(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html). +#[inline] +pub fn futimens(fd: RawFd, atime: &TimeSpec, mtime: &TimeSpec) -> Result<()> { + let times: [libc::timespec; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = unsafe { libc::futimens(fd, ×[0]) }; + + Errno::result(res).map(drop) +} + +/// Flags for `utimensat` function. +// TODO: replace with fcntl::AtFlags +#[derive(Clone, Copy, Debug)] +pub enum UtimensatFlags { + FollowSymlink, + NoFollowSymlink, +} + +/// Change the access and modification times of a file. +/// +/// The file to be changed is determined relative to the directory associated +/// with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. +/// +/// If `flag` is `UtimensatFlags::NoFollowSymlink` and `path` names a symbolic link, +/// then the mode of the symbolic link is changed. +/// +/// `utimensat(None, path, times, UtimensatFlags::FollowSymlink)` is identical to +/// `utimes(path, times)`. The latter is a deprecated API so prefer using the +/// former if the platforms you care about support it. +/// +/// # References +/// +/// [utimensat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimens.html). +#[cfg(not(target_os = "redox"))] +pub fn utimensat( + dirfd: Option, + path: &P, + atime: &TimeSpec, + mtime: &TimeSpec, + flag: UtimensatFlags +) -> Result<()> { + let atflag = + match flag { + UtimensatFlags::FollowSymlink => AtFlags::empty(), + UtimensatFlags::NoFollowSymlink => AtFlags::AT_SYMLINK_NOFOLLOW, + }; + let times: [libc::timespec; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = path.with_nix_path(|cstr| unsafe { + libc::utimensat( + at_rawfd(dirfd), + cstr.as_ptr(), + ×[0], + atflag.bits() as libc::c_int, + ) + })?; + + Errno::result(res).map(drop) +} + +#[cfg(not(target_os = "redox"))] +pub fn mkdirat(fd: RawFd, path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::mkdirat(fd, cstr.as_ptr(), mode.bits() as mode_t) } + })?; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/statfs.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/statfs.rs new file mode 100644 index 0000000000000000000000000000000000000000..829be57f635c56b995ce5c895bad418902e94721 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/statfs.rs @@ -0,0 +1,622 @@ +//! Get filesystem statistics, non-portably +//! +//! See [`statvfs`](crate::sys::statvfs) for a portable alternative. +use std::fmt::{self, Debug}; +use std::mem; +use std::os::unix::io::AsRawFd; +#[cfg(not(any(target_os = "linux", target_os = "android")))] +use std::ffi::CStr; + +use crate::{NixPath, Result, errno::Errno}; + +/// Identifies a mounted file system +#[cfg(target_os = "android")] +pub type fsid_t = libc::__fsid_t; +/// Identifies a mounted file system +#[cfg(not(target_os = "android"))] +pub type fsid_t = libc::fsid_t; + +/// Describes a mounted file system +#[derive(Clone, Copy)] +#[repr(transparent)] +pub struct Statfs(libc::statfs); + +#[cfg(target_os = "freebsd")] +type fs_type_t = u32; +#[cfg(target_os = "android")] +type fs_type_t = libc::c_ulong; +#[cfg(all(target_os = "linux", target_arch = "s390x"))] +type fs_type_t = libc::c_uint; +#[cfg(all(target_os = "linux", target_env = "musl"))] +type fs_type_t = libc::c_ulong; +#[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))))] +type fs_type_t = libc::__fsword_t; + +/// Describes the file system type as known by the operating system. +#[cfg(any( + target_os = "freebsd", + target_os = "android", + all(target_os = "linux", target_arch = "s390x"), + all(target_os = "linux", target_env = "musl"), + all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))), +))] +#[derive(Eq, Copy, Clone, PartialEq, Debug)] +pub struct FsType(pub fs_type_t); + +// These constants are defined without documentation in the Linux headers, so we +// can't very well document them here. +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const ADFS_SUPER_MAGIC: FsType = FsType(libc::ADFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const AFFS_SUPER_MAGIC: FsType = FsType(libc::AFFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const CODA_SUPER_MAGIC: FsType = FsType(libc::CODA_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const CRAMFS_MAGIC: FsType = FsType(libc::CRAMFS_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const EFS_SUPER_MAGIC: FsType = FsType(libc::EFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const EXT2_SUPER_MAGIC: FsType = FsType(libc::EXT2_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const EXT3_SUPER_MAGIC: FsType = FsType(libc::EXT3_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const EXT4_SUPER_MAGIC: FsType = FsType(libc::EXT4_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const HPFS_SUPER_MAGIC: FsType = FsType(libc::HPFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const HUGETLBFS_MAGIC: FsType = FsType(libc::HUGETLBFS_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const ISOFS_SUPER_MAGIC: FsType = FsType(libc::ISOFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const JFFS2_SUPER_MAGIC: FsType = FsType(libc::JFFS2_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const MINIX_SUPER_MAGIC: FsType = FsType(libc::MINIX_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const MINIX_SUPER_MAGIC2: FsType = FsType(libc::MINIX_SUPER_MAGIC2 as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const MINIX2_SUPER_MAGIC: FsType = FsType(libc::MINIX2_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const MINIX2_SUPER_MAGIC2: FsType = FsType(libc::MINIX2_SUPER_MAGIC2 as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const MSDOS_SUPER_MAGIC: FsType = FsType(libc::MSDOS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const NCP_SUPER_MAGIC: FsType = FsType(libc::NCP_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const NFS_SUPER_MAGIC: FsType = FsType(libc::NFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const OPENPROM_SUPER_MAGIC: FsType = FsType(libc::OPENPROM_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const OVERLAYFS_SUPER_MAGIC: FsType = FsType(libc::OVERLAYFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const PROC_SUPER_MAGIC: FsType = FsType(libc::PROC_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const QNX4_SUPER_MAGIC: FsType = FsType(libc::QNX4_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const REISERFS_SUPER_MAGIC: FsType = FsType(libc::REISERFS_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const SMB_SUPER_MAGIC: FsType = FsType(libc::SMB_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const TMPFS_MAGIC: FsType = FsType(libc::TMPFS_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const USBDEVICE_SUPER_MAGIC: FsType = FsType(libc::USBDEVICE_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const CGROUP_SUPER_MAGIC: FsType = FsType(libc::CGROUP_SUPER_MAGIC as fs_type_t); +#[cfg(all(target_os = "linux", not(target_env = "musl")))] +#[allow(missing_docs)] +pub const CGROUP2_SUPER_MAGIC: FsType = FsType(libc::CGROUP2_SUPER_MAGIC as fs_type_t); + + +impl Statfs { + /// Magic code defining system type + #[cfg(not(any( + target_os = "openbsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos" + )))] + pub fn filesystem_type(&self) -> FsType { + FsType(self.0.f_type) + } + + /// Magic code defining system type + #[cfg(not(any(target_os = "linux", target_os = "android")))] + pub fn filesystem_type_name(&self) -> &str { + let c_str = unsafe { CStr::from_ptr(self.0.f_fstypename.as_ptr()) }; + c_str.to_str().unwrap() + } + + /// Optimal transfer block size + #[cfg(any(target_os = "ios", target_os = "macos"))] + pub fn optimal_transfer_size(&self) -> i32 { + self.0.f_iosize + } + + /// Optimal transfer block size + #[cfg(target_os = "openbsd")] + pub fn optimal_transfer_size(&self) -> u32 { + self.0.f_iosize + } + + /// Optimal transfer block size + #[cfg(all(target_os = "linux", target_arch = "s390x"))] + pub fn optimal_transfer_size(&self) -> u32 { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(any( + target_os = "android", + all(target_os = "linux", target_env = "musl") + ))] + pub fn optimal_transfer_size(&self) -> libc::c_ulong { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))))] + pub fn optimal_transfer_size(&self) -> libc::__fsword_t { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(target_os = "dragonfly")] + pub fn optimal_transfer_size(&self) -> libc::c_long { + self.0.f_iosize + } + + /// Optimal transfer block size + #[cfg(target_os = "freebsd")] + pub fn optimal_transfer_size(&self) -> u64 { + self.0.f_iosize + } + + /// Size of a block + #[cfg(any(target_os = "ios", target_os = "macos", target_os = "openbsd"))] + pub fn block_size(&self) -> u32 { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", target_arch = "s390x"))] + pub fn block_size(&self) -> u32 { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", target_env = "musl"))] + pub fn block_size(&self) -> libc::c_ulong { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))))] + pub fn block_size(&self) -> libc::__fsword_t { + self.0.f_bsize + } + + /// Size of a block + #[cfg(target_os = "freebsd")] + pub fn block_size(&self) -> u64 { + self.0.f_bsize + } + + /// Size of a block + #[cfg(target_os = "android")] + pub fn block_size(&self) -> libc::c_ulong { + self.0.f_bsize + } + + /// Size of a block + #[cfg(target_os = "dragonfly")] + pub fn block_size(&self) -> libc::c_long { + self.0.f_bsize + } + + /// Maximum length of filenames + #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] + pub fn maximum_name_length(&self) -> u32 { + self.0.f_namemax + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", target_arch = "s390x"))] + pub fn maximum_name_length(&self) -> u32 { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", target_env = "musl"))] + pub fn maximum_name_length(&self) -> libc::c_ulong { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))))] + pub fn maximum_name_length(&self) -> libc::__fsword_t { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(target_os = "android")] + pub fn maximum_name_length(&self) -> libc::c_ulong { + self.0.f_namelen + } + + /// Total data blocks in filesystem + #[cfg(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + ))] + pub fn blocks(&self) -> u64 { + self.0.f_blocks + } + + /// Total data blocks in filesystem + #[cfg(target_os = "dragonfly")] + pub fn blocks(&self) -> libc::c_long { + self.0.f_blocks + } + + /// Total data blocks in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn blocks(&self) -> u64 { + self.0.f_blocks + } + + /// Total data blocks in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + pub fn blocks(&self) -> libc::c_ulong { + self.0.f_blocks + } + + /// Free blocks in filesystem + #[cfg(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + ))] + pub fn blocks_free(&self) -> u64 { + self.0.f_bfree + } + + /// Free blocks in filesystem + #[cfg(target_os = "dragonfly")] + pub fn blocks_free(&self) -> libc::c_long { + self.0.f_bfree + } + + /// Free blocks in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn blocks_free(&self) -> u64 { + self.0.f_bfree + } + + /// Free blocks in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + pub fn blocks_free(&self) -> libc::c_ulong { + self.0.f_bfree + } + + /// Free blocks available to unprivileged user + #[cfg(any(target_os = "ios", target_os = "macos", target_os = "android"))] + pub fn blocks_available(&self) -> u64 { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(target_os = "dragonfly")] + pub fn blocks_available(&self) -> libc::c_long { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] + pub fn blocks_available(&self) -> i64 { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn blocks_available(&self) -> u64 { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + pub fn blocks_available(&self) -> libc::c_ulong { + self.0.f_bavail + } + + /// Total file nodes in filesystem + #[cfg(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + ))] + pub fn files(&self) -> u64 { + self.0.f_files + } + + /// Total file nodes in filesystem + #[cfg(target_os = "dragonfly")] + pub fn files(&self) -> libc::c_long { + self.0.f_files + } + + /// Total file nodes in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn files(&self) -> libc::fsfilcnt_t { + self.0.f_files + } + + /// Total file nodes in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + pub fn files(&self) -> libc::c_ulong { + self.0.f_files + } + + /// Free file nodes in filesystem + #[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "macos", + target_os = "openbsd" + ))] + pub fn files_free(&self) -> u64 { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(target_os = "dragonfly")] + pub fn files_free(&self) -> libc::c_long { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(target_os = "freebsd")] + pub fn files_free(&self) -> i64 { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))))] + pub fn files_free(&self) -> libc::fsfilcnt_t { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + pub fn files_free(&self) -> libc::c_ulong { + self.0.f_ffree + } + + /// Filesystem ID + pub fn filesystem_id(&self) -> fsid_t { + self.0.f_fsid + } +} + +impl Debug for Statfs { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Statfs") + .field("optimal_transfer_size", &self.optimal_transfer_size()) + .field("block_size", &self.block_size()) + .field("blocks", &self.blocks()) + .field("blocks_free", &self.blocks_free()) + .field("blocks_available", &self.blocks_available()) + .field("files", &self.files()) + .field("files_free", &self.files_free()) + .field("filesystem_id", &self.filesystem_id()) + .finish() + } +} + +/// Describes a mounted file system. +/// +/// The result is OS-dependent. For a portabable alternative, see +/// [`statvfs`](crate::sys::statvfs::statvfs). +/// +/// # Arguments +/// +/// `path` - Path to any file within the file system to describe +pub fn statfs(path: &P) -> Result { + unsafe { + let mut stat = mem::MaybeUninit::::uninit(); + let res = path.with_nix_path(|path| libc::statfs(path.as_ptr(), stat.as_mut_ptr()))?; + Errno::result(res).map(|_| Statfs(stat.assume_init())) + } +} + +/// Describes a mounted file system. +/// +/// The result is OS-dependent. For a portabable alternative, see +/// [`fstatvfs`](crate::sys::statvfs::fstatvfs). +/// +/// # Arguments +/// +/// `fd` - File descriptor of any open file within the file system to describe +pub fn fstatfs(fd: &T) -> Result { + unsafe { + let mut stat = mem::MaybeUninit::::uninit(); + Errno::result(libc::fstatfs(fd.as_raw_fd(), stat.as_mut_ptr())) + .map(|_| Statfs(stat.assume_init())) + } +} + +#[cfg(test)] +mod test { + use std::fs::File; + + use crate::sys::statfs::*; + use crate::sys::statvfs::*; + use std::path::Path; + + #[test] + fn statfs_call() { + check_statfs("/tmp"); + check_statfs("/dev"); + check_statfs("/run"); + check_statfs("/"); + } + + #[test] + fn fstatfs_call() { + check_fstatfs("/tmp"); + check_fstatfs("/dev"); + check_fstatfs("/run"); + check_fstatfs("/"); + } + + fn check_fstatfs(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()).unwrap(); + let file = File::open(path).unwrap(); + let fs = fstatfs(&file).unwrap(); + assert_fs_equals(fs, vfs); + } + + fn check_statfs(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()).unwrap(); + let fs = statfs(path.as_bytes()).unwrap(); + assert_fs_equals(fs, vfs); + } + + fn assert_fs_equals(fs: Statfs, vfs: Statvfs) { + assert_eq!(fs.files() as u64, vfs.files() as u64); + assert_eq!(fs.blocks() as u64, vfs.blocks() as u64); + assert_eq!(fs.block_size() as u64, vfs.fragment_size() as u64); + } + + // This test is ignored because files_free/blocks_free can change after statvfs call and before + // statfs call. + #[test] + #[ignore] + fn statfs_call_strict() { + check_statfs_strict("/tmp"); + check_statfs_strict("/dev"); + check_statfs_strict("/run"); + check_statfs_strict("/"); + } + + // This test is ignored because files_free/blocks_free can change after statvfs call and before + // fstatfs call. + #[test] + #[ignore] + fn fstatfs_call_strict() { + check_fstatfs_strict("/tmp"); + check_fstatfs_strict("/dev"); + check_fstatfs_strict("/run"); + check_fstatfs_strict("/"); + } + + fn check_fstatfs_strict(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()); + let file = File::open(path).unwrap(); + let fs = fstatfs(&file); + assert_fs_equals_strict(fs.unwrap(), vfs.unwrap()) + } + + fn check_statfs_strict(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()); + let fs = statfs(path.as_bytes()); + assert_fs_equals_strict(fs.unwrap(), vfs.unwrap()) + } + + fn assert_fs_equals_strict(fs: Statfs, vfs: Statvfs) { + assert_eq!(fs.files_free() as u64, vfs.files_free() as u64); + assert_eq!(fs.blocks_free() as u64, vfs.blocks_free() as u64); + assert_eq!(fs.blocks_available() as u64, vfs.blocks_available() as u64); + assert_eq!(fs.files() as u64, vfs.files() as u64); + assert_eq!(fs.blocks() as u64, vfs.blocks() as u64); + assert_eq!(fs.block_size() as u64, vfs.fragment_size() as u64); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/statvfs.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/statvfs.rs new file mode 100644 index 0000000000000000000000000000000000000000..15e7a7d4ab2e45d6480d4a7d8200db403bb2091c --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/statvfs.rs @@ -0,0 +1,161 @@ +//! Get filesystem statistics +//! +//! See [the man pages](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fstatvfs.html) +//! for more details. +use std::mem; +use std::os::unix::io::AsRawFd; + +use libc::{self, c_ulong}; + +use crate::{Result, NixPath, errno::Errno}; + +#[cfg(not(target_os = "redox"))] +libc_bitflags!( + /// File system mount Flags + #[repr(C)] + #[derive(Default)] + pub struct FsFlags: c_ulong { + /// Read Only + ST_RDONLY; + /// Do not allow the set-uid bits to have an effect + ST_NOSUID; + /// Do not interpret character or block-special devices + #[cfg(any(target_os = "android", target_os = "linux"))] + ST_NODEV; + /// Do not allow execution of binaries on the filesystem + #[cfg(any(target_os = "android", target_os = "linux"))] + ST_NOEXEC; + /// All IO should be done synchronously + #[cfg(any(target_os = "android", target_os = "linux"))] + ST_SYNCHRONOUS; + /// Allow mandatory locks on the filesystem + #[cfg(any(target_os = "android", target_os = "linux"))] + ST_MANDLOCK; + /// Write on file/directory/symlink + #[cfg(target_os = "linux")] + ST_WRITE; + /// Append-only file + #[cfg(target_os = "linux")] + ST_APPEND; + /// Immutable file + #[cfg(target_os = "linux")] + ST_IMMUTABLE; + /// Do not update access times on files + #[cfg(any(target_os = "android", target_os = "linux"))] + ST_NOATIME; + /// Do not update access times on files + #[cfg(any(target_os = "android", target_os = "linux"))] + ST_NODIRATIME; + /// Update access time relative to modify/change time + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_env = "musl"))))] + ST_RELATIME; + } +); + +/// Wrapper around the POSIX `statvfs` struct +/// +/// For more information see the [`statvfs(3)` man pages](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_statvfs.h.html). +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct Statvfs(libc::statvfs); + +impl Statvfs { + /// get the file system block size + pub fn block_size(&self) -> c_ulong { + self.0.f_bsize + } + + /// Get the fundamental file system block size + pub fn fragment_size(&self) -> c_ulong { + self.0.f_frsize + } + + /// Get the number of blocks. + /// + /// Units are in units of `fragment_size()` + pub fn blocks(&self) -> libc::fsblkcnt_t { + self.0.f_blocks + } + + /// Get the number of free blocks in the file system + pub fn blocks_free(&self) -> libc::fsblkcnt_t { + self.0.f_bfree + } + + /// Get the number of free blocks for unprivileged users + pub fn blocks_available(&self) -> libc::fsblkcnt_t { + self.0.f_bavail + } + + /// Get the total number of file inodes + pub fn files(&self) -> libc::fsfilcnt_t { + self.0.f_files + } + + /// Get the number of free file inodes + pub fn files_free(&self) -> libc::fsfilcnt_t { + self.0.f_ffree + } + + /// Get the number of free file inodes for unprivileged users + pub fn files_available(&self) -> libc::fsfilcnt_t { + self.0.f_favail + } + + /// Get the file system id + pub fn filesystem_id(&self) -> c_ulong { + self.0.f_fsid + } + + /// Get the mount flags + #[cfg(not(target_os = "redox"))] + pub fn flags(&self) -> FsFlags { + FsFlags::from_bits_truncate(self.0.f_flag) + } + + /// Get the maximum filename length + pub fn name_max(&self) -> c_ulong { + self.0.f_namemax + } + +} + +/// Return a `Statvfs` object with information about the `path` +pub fn statvfs(path: &P) -> Result { + unsafe { + Errno::clear(); + let mut stat = mem::MaybeUninit::::uninit(); + let res = path.with_nix_path(|path| + libc::statvfs(path.as_ptr(), stat.as_mut_ptr()) + )?; + + Errno::result(res).map(|_| Statvfs(stat.assume_init())) + } +} + +/// Return a `Statvfs` object with information about `fd` +pub fn fstatvfs(fd: &T) -> Result { + unsafe { + Errno::clear(); + let mut stat = mem::MaybeUninit::::uninit(); + Errno::result(libc::fstatvfs(fd.as_raw_fd(), stat.as_mut_ptr())) + .map(|_| Statvfs(stat.assume_init())) + } +} + +#[cfg(test)] +mod test { + use std::fs::File; + use crate::sys::statvfs::*; + + #[test] + fn statvfs_call() { + statvfs(&b"/"[..]).unwrap(); + } + + #[test] + fn fstatvfs_call() { + let root = File::open("/").unwrap(); + fstatvfs(&root).unwrap(); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/sysinfo.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/sysinfo.rs new file mode 100644 index 0000000000000000000000000000000000000000..dc943c1adce12454034a9bd31f0860a2c8dc3660 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/sysinfo.rs @@ -0,0 +1,79 @@ +use libc::{self, SI_LOAD_SHIFT}; +use std::{cmp, mem}; +use std::time::Duration; + +use crate::Result; +use crate::errno::Errno; + +/// System info structure returned by `sysinfo`. +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct SysInfo(libc::sysinfo); + +// The fields are c_ulong on 32-bit linux, u64 on 64-bit linux; x32's ulong is u32 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +type mem_blocks_t = u64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +type mem_blocks_t = libc::c_ulong; + +impl SysInfo { + /// Returns the load average tuple. + /// + /// The returned values represent the load average over time intervals of + /// 1, 5, and 15 minutes, respectively. + pub fn load_average(&self) -> (f64, f64, f64) { + ( + self.0.loads[0] as f64 / (1 << SI_LOAD_SHIFT) as f64, + self.0.loads[1] as f64 / (1 << SI_LOAD_SHIFT) as f64, + self.0.loads[2] as f64 / (1 << SI_LOAD_SHIFT) as f64, + ) + } + + /// Returns the time since system boot. + pub fn uptime(&self) -> Duration { + // Truncate negative values to 0 + Duration::from_secs(cmp::max(self.0.uptime, 0) as u64) + } + + /// Current number of processes. + pub fn process_count(&self) -> u16 { + self.0.procs + } + + /// Returns the amount of swap memory in Bytes. + pub fn swap_total(&self) -> u64 { + self.scale_mem(self.0.totalswap) + } + + /// Returns the amount of unused swap memory in Bytes. + pub fn swap_free(&self) -> u64 { + self.scale_mem(self.0.freeswap) + } + + /// Returns the total amount of installed RAM in Bytes. + pub fn ram_total(&self) -> u64 { + self.scale_mem(self.0.totalram) + } + + /// Returns the amount of completely unused RAM in Bytes. + /// + /// "Unused" in this context means that the RAM in neither actively used by + /// programs, nor by the operating system as disk cache or buffer. It is + /// "wasted" RAM since it currently serves no purpose. + pub fn ram_unused(&self) -> u64 { + self.scale_mem(self.0.freeram) + } + + fn scale_mem(&self, units: mem_blocks_t) -> u64 { + units as u64 * self.0.mem_unit as u64 + } +} + +/// Returns system information. +/// +/// [See `sysinfo(2)`](https://man7.org/linux/man-pages/man2/sysinfo.2.html). +pub fn sysinfo() -> Result { + let mut info = mem::MaybeUninit::uninit(); + let res = unsafe { libc::sysinfo(info.as_mut_ptr()) }; + Errno::result(res).map(|_| unsafe{ SysInfo(info.assume_init()) }) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/termios.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/termios.rs new file mode 100644 index 0000000000000000000000000000000000000000..01d460803913aa5143021cd7e2c731c9f4c98b37 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/termios.rs @@ -0,0 +1,1016 @@ +//! An interface for controlling asynchronous communication ports +//! +//! This interface provides a safe wrapper around the termios subsystem defined by POSIX. The +//! underlying types are all implemented in libc for most platforms and either wrapped in safer +//! types here or exported directly. +//! +//! If you are unfamiliar with the `termios` API, you should first read the +//! [API documentation](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html) and +//! then come back to understand how `nix` safely wraps it. +//! +//! It should be noted that this API incurs some runtime overhead above the base `libc` definitions. +//! As this interface is not used with high-bandwidth information, this should be fine in most +//! cases. The primary cost when using this API is that the `Termios` datatype here duplicates the +//! standard fields of the underlying `termios` struct and uses safe type wrappers for those fields. +//! This means that when crossing the FFI interface to the underlying C library, data is first +//! copied into the underlying `termios` struct, then the operation is done, and the data is copied +//! back (with additional sanity checking) into the safe wrapper types. The `termios` struct is +//! relatively small across all platforms (on the order of 32-64 bytes). +//! +//! The following examples highlight some of the API use cases such that users coming from using C +//! or reading the standard documentation will understand how to use the safe API exposed here. +//! +//! Example disabling processing of the end-of-file control character: +//! +//! ``` +//! # use self::nix::sys::termios::SpecialCharacterIndices::VEOF; +//! # use self::nix::sys::termios::{_POSIX_VDISABLE, Termios}; +//! # let mut termios: Termios = unsafe { std::mem::zeroed() }; +//! termios.control_chars[VEOF as usize] = _POSIX_VDISABLE; +//! ``` +//! +//! The flags within `Termios` are defined as bitfields using the `bitflags` crate. This provides +//! an interface for working with bitfields that is similar to working with the raw unsigned +//! integer types but offers type safety because of the internal checking that values will always +//! be a valid combination of the defined flags. +//! +//! An example showing some of the basic operations for interacting with the control flags: +//! +//! ``` +//! # use self::nix::sys::termios::{ControlFlags, Termios}; +//! # let mut termios: Termios = unsafe { std::mem::zeroed() }; +//! termios.control_flags & ControlFlags::CSIZE == ControlFlags::CS5; +//! termios.control_flags |= ControlFlags::CS5; +//! ``` +//! +//! # Baud rates +//! +//! This API is not consistent across platforms when it comes to `BaudRate`: Android and Linux both +//! only support the rates specified by the `BaudRate` enum through their termios API while the BSDs +//! support arbitrary baud rates as the values of the `BaudRate` enum constants are the same integer +//! value of the constant (`B9600` == `9600`). Therefore the `nix::termios` API uses the following +//! conventions: +//! +//! * `cfgetispeed()` - Returns `u32` on BSDs, `BaudRate` on Android/Linux +//! * `cfgetospeed()` - Returns `u32` on BSDs, `BaudRate` on Android/Linux +//! * `cfsetispeed()` - Takes `u32` or `BaudRate` on BSDs, `BaudRate` on Android/Linux +//! * `cfsetospeed()` - Takes `u32` or `BaudRate` on BSDs, `BaudRate` on Android/Linux +//! * `cfsetspeed()` - Takes `u32` or `BaudRate` on BSDs, `BaudRate` on Android/Linux +//! +//! The most common use case of specifying a baud rate using the enum will work the same across +//! platforms: +//! +//! ```rust +//! # use nix::sys::termios::{BaudRate, cfsetispeed, cfsetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! cfsetispeed(&mut t, BaudRate::B9600); +//! cfsetospeed(&mut t, BaudRate::B9600); +//! cfsetspeed(&mut t, BaudRate::B9600); +//! # } +//! ``` +//! +//! Additionally round-tripping baud rates is consistent across platforms: +//! +//! ```rust +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetispeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, BaudRate::B9600); +//! let speed = cfgetispeed(&t); +//! assert_eq!(speed, cfgetospeed(&t)); +//! cfsetispeed(&mut t, speed); +//! # } +//! ``` +//! +//! On non-BSDs, `cfgetispeed()` and `cfgetospeed()` both return a `BaudRate`: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust,ignore")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust")] +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, BaudRate::B9600); +//! assert_eq!(cfgetispeed(&t), BaudRate::B9600); +//! assert_eq!(cfgetospeed(&t), BaudRate::B9600); +//! # } +//! ``` +//! +//! But on the BSDs, `cfgetispeed()` and `cfgetospeed()` both return `u32`s: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust,ignore")] +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, 9600u32); +//! assert_eq!(cfgetispeed(&t), 9600u32); +//! assert_eq!(cfgetospeed(&t), 9600u32); +//! # } +//! ``` +//! +//! It's trivial to convert from a `BaudRate` to a `u32` on BSDs: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust,ignore")] +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, 9600u32); +//! assert_eq!(cfgetispeed(&t), BaudRate::B9600.into()); +//! assert_eq!(u32::from(BaudRate::B9600), 9600u32); +//! # } +//! ``` +//! +//! And on BSDs you can specify arbitrary baud rates (**note** this depends on hardware support) +//! by specifying baud rates directly using `u32`s: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust,ignore")] +//! # use nix::sys::termios::{cfsetispeed, cfsetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! cfsetispeed(&mut t, 9600u32); +//! cfsetospeed(&mut t, 9600u32); +//! cfsetspeed(&mut t, 9600u32); +//! # } +//! ``` +use cfg_if::cfg_if; +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_int, tcflag_t}; +use std::cell::{Ref, RefCell}; +use std::convert::From; +use std::mem; +use std::os::unix::io::RawFd; + +use crate::unistd::Pid; + +/// Stores settings for the termios API +/// +/// This is a wrapper around the `libc::termios` struct that provides a safe interface for the +/// standard fields. The only safe way to obtain an instance of this struct is to extract it from +/// an open port using `tcgetattr()`. +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Termios { + inner: RefCell, + /// Input mode flags (see `termios.c_iflag` documentation) + pub input_flags: InputFlags, + /// Output mode flags (see `termios.c_oflag` documentation) + pub output_flags: OutputFlags, + /// Control mode flags (see `termios.c_cflag` documentation) + pub control_flags: ControlFlags, + /// Local mode flags (see `termios.c_lflag` documentation) + pub local_flags: LocalFlags, + /// Control characters (see `termios.c_cc` documentation) + pub control_chars: [libc::cc_t; NCCS], +} + +impl Termios { + /// Exposes an immutable reference to the underlying `libc::termios` data structure. + /// + /// This is not part of `nix`'s public API because it requires additional work to maintain type + /// safety. + pub(crate) fn get_libc_termios(&self) -> Ref { + { + let mut termios = self.inner.borrow_mut(); + termios.c_iflag = self.input_flags.bits(); + termios.c_oflag = self.output_flags.bits(); + termios.c_cflag = self.control_flags.bits(); + termios.c_lflag = self.local_flags.bits(); + termios.c_cc = self.control_chars; + } + self.inner.borrow() + } + + /// Exposes the inner `libc::termios` datastore within `Termios`. + /// + /// This is unsafe because if this is used to modify the inner `libc::termios` struct, it will + /// not automatically update the safe wrapper type around it. In this case it should also be + /// paired with a call to `update_wrapper()` so that the wrapper-type and internal + /// representation stay consistent. + pub(crate) unsafe fn get_libc_termios_mut(&mut self) -> *mut libc::termios { + { + let mut termios = self.inner.borrow_mut(); + termios.c_iflag = self.input_flags.bits(); + termios.c_oflag = self.output_flags.bits(); + termios.c_cflag = self.control_flags.bits(); + termios.c_lflag = self.local_flags.bits(); + termios.c_cc = self.control_chars; + } + self.inner.as_ptr() + } + + /// Updates the wrapper values from the internal `libc::termios` data structure. + pub(crate) fn update_wrapper(&mut self) { + let termios = *self.inner.borrow_mut(); + self.input_flags = InputFlags::from_bits_truncate(termios.c_iflag); + self.output_flags = OutputFlags::from_bits_truncate(termios.c_oflag); + self.control_flags = ControlFlags::from_bits_truncate(termios.c_cflag); + self.local_flags = LocalFlags::from_bits_truncate(termios.c_lflag); + self.control_chars = termios.c_cc; + } +} + +impl From for Termios { + fn from(termios: libc::termios) -> Self { + Termios { + inner: RefCell::new(termios), + input_flags: InputFlags::from_bits_truncate(termios.c_iflag), + output_flags: OutputFlags::from_bits_truncate(termios.c_oflag), + control_flags: ControlFlags::from_bits_truncate(termios.c_cflag), + local_flags: LocalFlags::from_bits_truncate(termios.c_lflag), + control_chars: termios.c_cc, + } + } +} + +impl From for libc::termios { + fn from(termios: Termios) -> Self { + termios.inner.into_inner() + } +} + +libc_enum!{ + /// Baud rates supported by the system. + /// + /// For the BSDs, arbitrary baud rates can be specified by using `u32`s directly instead of this + /// enum. + /// + /// B0 is special and will disable the port. + #[cfg_attr(all(any(target_os = "ios", target_os = "macos"), target_pointer_width = "64"), repr(u64))] + #[cfg_attr(not(all(any(target_os = "ios", target_os = "macos"), target_pointer_width = "64")), repr(u32))] + #[non_exhaustive] + pub enum BaudRate { + B0, + B50, + B75, + B110, + B134, + B150, + B200, + B300, + B600, + B1200, + B1800, + B2400, + B4800, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + B7200, + B9600, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + B14400, + B19200, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + B28800, + B38400, + B57600, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + B76800, + B115200, + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + B153600, + B230400, + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + B307200, + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "solaris"))] + B460800, + #[cfg(any(target_os = "android", target_os = "linux"))] + B500000, + #[cfg(any(target_os = "android", target_os = "linux"))] + B576000, + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "solaris"))] + B921600, + #[cfg(any(target_os = "android", target_os = "linux"))] + B1000000, + #[cfg(any(target_os = "android", target_os = "linux"))] + B1152000, + #[cfg(any(target_os = "android", target_os = "linux"))] + B1500000, + #[cfg(any(target_os = "android", target_os = "linux"))] + B2000000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + B2500000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + B3000000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + B3500000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + B4000000, + } + impl TryFrom +} + +#[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +impl From for u32 { + fn from(b: BaudRate) -> u32 { + b as u32 + } +} + +// TODO: Add TCSASOFT, which will require treating this as a bitfield. +libc_enum! { + /// Specify when a port configuration change should occur. + /// + /// Used as an argument to `tcsetattr()` + #[repr(i32)] + #[non_exhaustive] + pub enum SetArg { + /// The change will occur immediately + TCSANOW, + /// The change occurs after all output has been written + TCSADRAIN, + /// Same as `TCSADRAIN`, but will also flush the input buffer + TCSAFLUSH, + } +} + +libc_enum! { + /// Specify a combination of the input and output buffers to flush + /// + /// Used as an argument to `tcflush()`. + #[repr(i32)] + #[non_exhaustive] + pub enum FlushArg { + /// Flush data that was received but not read + TCIFLUSH, + /// Flush data written but not transmitted + TCOFLUSH, + /// Flush both received data not read and written data not transmitted + TCIOFLUSH, + } +} + +libc_enum! { + /// Specify how transmission flow should be altered + /// + /// Used as an argument to `tcflow()`. + #[repr(i32)] + #[non_exhaustive] + pub enum FlowArg { + /// Suspend transmission + TCOOFF, + /// Resume transmission + TCOON, + /// Transmit a STOP character, which should disable a connected terminal device + TCIOFF, + /// Transmit a START character, which should re-enable a connected terminal device + TCION, + } +} + +// TODO: Make this usable directly as a slice index. +libc_enum! { + /// Indices into the `termios.c_cc` array for special characters. + #[repr(usize)] + #[non_exhaustive] + pub enum SpecialCharacterIndices { + VDISCARD, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + VDSUSP, + VEOF, + VEOL, + VEOL2, + VERASE, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "solaris"))] + VERASE2, + VINTR, + VKILL, + VLNEXT, + #[cfg(not(any(all(target_os = "linux", target_arch = "sparc64"), + target_os = "illumos", target_os = "solaris")))] + VMIN, + VQUIT, + VREPRINT, + VSTART, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + VSTATUS, + VSTOP, + VSUSP, + #[cfg(target_os = "linux")] + VSWTC, + #[cfg(any(target_os = "haiku", target_os = "illumos", target_os = "solaris"))] + VSWTCH, + #[cfg(not(any(all(target_os = "linux", target_arch = "sparc64"), + target_os = "illumos", target_os = "solaris")))] + VTIME, + VWERASE, + #[cfg(target_os = "dragonfly")] + VCHECKPT, + } +} + +#[cfg(any(all(target_os = "linux", target_arch = "sparc64"), + target_os = "illumos", target_os = "solaris"))] +impl SpecialCharacterIndices { + pub const VMIN: SpecialCharacterIndices = SpecialCharacterIndices::VEOF; + pub const VTIME: SpecialCharacterIndices = SpecialCharacterIndices::VEOL; +} + +pub use libc::NCCS; +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +pub use libc::_POSIX_VDISABLE; + +libc_bitflags! { + /// Flags for configuring the input mode of a terminal + pub struct InputFlags: tcflag_t { + IGNBRK; + BRKINT; + IGNPAR; + PARMRK; + INPCK; + ISTRIP; + INLCR; + IGNCR; + ICRNL; + IXON; + IXOFF; + #[cfg(not(target_os = "redox"))] + IXANY; + #[cfg(not(target_os = "redox"))] + IMAXBEL; + #[cfg(any(target_os = "android", target_os = "linux", target_os = "macos"))] + IUTF8; + } +} + +libc_bitflags! { + /// Flags for configuring the output mode of a terminal + pub struct OutputFlags: tcflag_t { + OPOST; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "linux", + target_os = "openbsd"))] + OLCUC; + ONLCR; + OCRNL as tcflag_t; + ONOCR as tcflag_t; + ONLRET as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + OFILL as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + OFDEL as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + NL0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + NL1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + CR0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + CR1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + CR2 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + CR3 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + TAB0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + TAB1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + TAB2 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + TAB3 as tcflag_t; + #[cfg(any(target_os = "android", target_os = "linux"))] + XTABS; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + BS0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + BS1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + VT0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + VT1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + FF0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + FF1 as tcflag_t; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + OXTABS; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + ONOEOT as tcflag_t; + + // Bitmasks for use with OutputFlags to select specific settings + // These should be moved to be a mask once https://github.com/rust-lang-nursery/bitflags/issues/110 + // is resolved. + + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + NLDLY as tcflag_t; // FIXME: Datatype needs to be corrected in libc for mac + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + CRDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + TABDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + BSDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + VTDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + FFDLY as tcflag_t; + } +} + +libc_bitflags! { + /// Flags for setting the control mode of a terminal + pub struct ControlFlags: tcflag_t { + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + CIGNORE; + CS5; + CS6; + CS7; + CS8; + CSTOPB; + CREAD; + PARENB; + PARODD; + HUPCL; + CLOCAL; + #[cfg(not(target_os = "redox"))] + CRTSCTS; + #[cfg(any(target_os = "android", target_os = "linux"))] + CBAUD; + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "mips"))))] + CMSPAR; + #[cfg(any(target_os = "android", + all(target_os = "linux", + not(any(target_arch = "powerpc", target_arch = "powerpc64")))))] + CIBAUD; + #[cfg(any(target_os = "android", target_os = "linux"))] + CBAUDEX; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + MDMBUF; + #[cfg(any(target_os = "netbsd", target_os = "openbsd"))] + CHWFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd"))] + CCTS_OFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd"))] + CRTS_IFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd"))] + CDTR_IFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd"))] + CDSR_OFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd"))] + CCAR_OFLOW; + + // Bitmasks for use with ControlFlags to select specific settings + // These should be moved to be a mask once https://github.com/rust-lang-nursery/bitflags/issues/110 + // is resolved. + + CSIZE; + } +} + +libc_bitflags! { + /// Flags for setting any local modes + pub struct LocalFlags: tcflag_t { + #[cfg(not(target_os = "redox"))] + ECHOKE; + ECHOE; + ECHOK; + ECHO; + ECHONL; + #[cfg(not(target_os = "redox"))] + ECHOPRT; + #[cfg(not(target_os = "redox"))] + ECHOCTL; + ISIG; + ICANON; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + ALTWERASE; + IEXTEN; + #[cfg(not(target_os = "redox"))] + EXTPROC; + TOSTOP; + #[cfg(not(target_os = "redox"))] + FLUSHO; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + NOKERNINFO; + #[cfg(not(target_os = "redox"))] + PENDIN; + NOFLSH; + } +} + +cfg_if!{ + if #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] { + /// Get input baud rate (see + /// [cfgetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetispeed.html)). + /// + /// `cfgetispeed()` extracts the input baud rate from the given `Termios` structure. + pub fn cfgetispeed(termios: &Termios) -> u32 { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetispeed(&*inner_termios) as u32 } + } + + /// Get output baud rate (see + /// [cfgetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetospeed.html)). + /// + /// `cfgetospeed()` extracts the output baud rate from the given `Termios` structure. + pub fn cfgetospeed(termios: &Termios) -> u32 { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetospeed(&*inner_termios) as u32 } + } + + /// Set input baud rate (see + /// [cfsetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetispeed.html)). + /// + /// `cfsetispeed()` sets the intput baud rate in the given `Termios` structure. + pub fn cfsetispeed>(termios: &mut Termios, baud: T) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetispeed(inner_termios, baud.into() as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set output baud rate (see + /// [cfsetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetospeed.html)). + /// + /// `cfsetospeed()` sets the output baud rate in the given termios structure. + pub fn cfsetospeed>(termios: &mut Termios, baud: T) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetospeed(inner_termios, baud.into() as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set both the input and output baud rates (see + /// [termios(3)](https://www.freebsd.org/cgi/man.cgi?query=cfsetspeed)). + /// + /// `cfsetspeed()` sets the input and output baud rate in the given termios structure. Note that + /// this is part of the 4.4BSD standard and not part of POSIX. + pub fn cfsetspeed>(termios: &mut Termios, baud: T) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetspeed(inner_termios, baud.into() as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + } else { + use std::convert::TryInto; + + /// Get input baud rate (see + /// [cfgetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetispeed.html)). + /// + /// `cfgetispeed()` extracts the input baud rate from the given `Termios` structure. + pub fn cfgetispeed(termios: &Termios) -> BaudRate { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetispeed(&*inner_termios) }.try_into().unwrap() + } + + /// Get output baud rate (see + /// [cfgetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetospeed.html)). + /// + /// `cfgetospeed()` extracts the output baud rate from the given `Termios` structure. + pub fn cfgetospeed(termios: &Termios) -> BaudRate { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetospeed(&*inner_termios) }.try_into().unwrap() + } + + /// Set input baud rate (see + /// [cfsetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetispeed.html)). + /// + /// `cfsetispeed()` sets the intput baud rate in the given `Termios` structure. + pub fn cfsetispeed(termios: &mut Termios, baud: BaudRate) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetispeed(inner_termios, baud as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set output baud rate (see + /// [cfsetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetospeed.html)). + /// + /// `cfsetospeed()` sets the output baud rate in the given `Termios` structure. + pub fn cfsetospeed(termios: &mut Termios, baud: BaudRate) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetospeed(inner_termios, baud as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set both the input and output baud rates (see + /// [termios(3)](https://www.freebsd.org/cgi/man.cgi?query=cfsetspeed)). + /// + /// `cfsetspeed()` sets the input and output baud rate in the given `Termios` structure. Note that + /// this is part of the 4.4BSD standard and not part of POSIX. + pub fn cfsetspeed(termios: &mut Termios, baud: BaudRate) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetspeed(inner_termios, baud as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + } +} + +/// Configures the port to something like the "raw" mode of the old Version 7 terminal driver (see +/// [termios(3)](https://man7.org/linux/man-pages/man3/termios.3.html)). +/// +/// `cfmakeraw()` configures the termios structure such that input is available character-by- +/// character, echoing is disabled, and all special input and output processing is disabled. Note +/// that this is a non-standard function, but is available on Linux and BSDs. +pub fn cfmakeraw(termios: &mut Termios) { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + unsafe { + libc::cfmakeraw(inner_termios); + } + termios.update_wrapper(); +} + +/// Configures the port to "sane" mode (like the configuration of a newly created terminal) (see +/// [tcsetattr(3)](https://www.freebsd.org/cgi/man.cgi?query=tcsetattr)). +/// +/// Note that this is a non-standard function, available on FreeBSD. +#[cfg(target_os = "freebsd")] +pub fn cfmakesane(termios: &mut Termios) { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + unsafe { + libc::cfmakesane(inner_termios); + } + termios.update_wrapper(); +} + +/// Return the configuration of a port +/// [tcgetattr(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetattr.html)). +/// +/// `tcgetattr()` returns a `Termios` structure with the current configuration for a port. Modifying +/// this structure *will not* reconfigure the port, instead the modifications should be done to +/// the `Termios` structure and then the port should be reconfigured using `tcsetattr()`. +pub fn tcgetattr(fd: RawFd) -> Result { + let mut termios = mem::MaybeUninit::uninit(); + + let res = unsafe { libc::tcgetattr(fd, termios.as_mut_ptr()) }; + + Errno::result(res)?; + + unsafe { Ok(termios.assume_init().into()) } +} + +/// Set the configuration for a terminal (see +/// [tcsetattr(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetattr.html)). +/// +/// `tcsetattr()` reconfigures the given port based on a given `Termios` structure. This change +/// takes affect at a time specified by `actions`. Note that this function may return success if +/// *any* of the parameters were successfully set, not only if all were set successfully. +pub fn tcsetattr(fd: RawFd, actions: SetArg, termios: &Termios) -> Result<()> { + let inner_termios = termios.get_libc_termios(); + Errno::result(unsafe { libc::tcsetattr(fd, actions as c_int, &*inner_termios) }).map(drop) +} + +/// Block until all output data is written (see +/// [tcdrain(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcdrain.html)). +pub fn tcdrain(fd: RawFd) -> Result<()> { + Errno::result(unsafe { libc::tcdrain(fd) }).map(drop) +} + +/// Suspend or resume the transmission or reception of data (see +/// [tcflow(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcflow.html)). +/// +/// `tcflow()` suspends of resumes the transmission or reception of data for the given port +/// depending on the value of `action`. +pub fn tcflow(fd: RawFd, action: FlowArg) -> Result<()> { + Errno::result(unsafe { libc::tcflow(fd, action as c_int) }).map(drop) +} + +/// Discard data in the output or input queue (see +/// [tcflush(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcflush.html)). +/// +/// `tcflush()` will discard data for a terminal port in the input queue, output queue, or both +/// depending on the value of `action`. +pub fn tcflush(fd: RawFd, action: FlushArg) -> Result<()> { + Errno::result(unsafe { libc::tcflush(fd, action as c_int) }).map(drop) +} + +/// Send a break for a specific duration (see +/// [tcsendbreak(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsendbreak.html)). +/// +/// When using asynchronous data transmission `tcsendbreak()` will transmit a continuous stream +/// of zero-valued bits for an implementation-defined duration. +pub fn tcsendbreak(fd: RawFd, duration: c_int) -> Result<()> { + Errno::result(unsafe { libc::tcsendbreak(fd, duration) }).map(drop) +} + +/// Get the session controlled by the given terminal (see +/// [tcgetsid(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetsid.html)). +pub fn tcgetsid(fd: RawFd) -> Result { + let res = unsafe { libc::tcgetsid(fd) }; + + Errno::result(res).map(Pid::from_raw) +} + +#[cfg(test)] +mod test { + use super::*; + use std::convert::TryFrom; + + #[test] + fn try_from() { + assert_eq!(Ok(BaudRate::B0), BaudRate::try_from(libc::B0)); + assert!(BaudRate::try_from(999999999).is_err()); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/time.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/time.rs new file mode 100644 index 0000000000000000000000000000000000000000..ac4247180ddbeddfa4c5ebf544fe0e4303df3c05 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/time.rs @@ -0,0 +1,609 @@ +use std::{cmp, fmt, ops}; +use std::time::Duration; +use std::convert::From; +use libc::{timespec, timeval}; +#[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 +pub use libc::{time_t, suseconds_t}; + +pub trait TimeValLike: Sized { + #[inline] + fn zero() -> Self { + Self::seconds(0) + } + + #[inline] + fn hours(hours: i64) -> Self { + let secs = hours.checked_mul(SECS_PER_HOUR) + .expect("TimeValLike::hours ouf of bounds"); + Self::seconds(secs) + } + + #[inline] + fn minutes(minutes: i64) -> Self { + let secs = minutes.checked_mul(SECS_PER_MINUTE) + .expect("TimeValLike::minutes out of bounds"); + Self::seconds(secs) + } + + fn seconds(seconds: i64) -> Self; + fn milliseconds(milliseconds: i64) -> Self; + fn microseconds(microseconds: i64) -> Self; + fn nanoseconds(nanoseconds: i64) -> Self; + + #[inline] + fn num_hours(&self) -> i64 { + self.num_seconds() / 3600 + } + + #[inline] + fn num_minutes(&self) -> i64 { + self.num_seconds() / 60 + } + + fn num_seconds(&self) -> i64; + fn num_milliseconds(&self) -> i64; + fn num_microseconds(&self) -> i64; + fn num_nanoseconds(&self) -> i64; +} + +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct TimeSpec(timespec); + +const NANOS_PER_SEC: i64 = 1_000_000_000; +const SECS_PER_MINUTE: i64 = 60; +const SECS_PER_HOUR: i64 = 3600; + +#[cfg(target_pointer_width = "64")] +const TS_MAX_SECONDS: i64 = (::std::i64::MAX / NANOS_PER_SEC) - 1; + +#[cfg(target_pointer_width = "32")] +const TS_MAX_SECONDS: i64 = ::std::isize::MAX as i64; + +const TS_MIN_SECONDS: i64 = -TS_MAX_SECONDS; + +// x32 compatibility +// See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +type timespec_tv_nsec_t = i64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +type timespec_tv_nsec_t = libc::c_long; + +impl From for TimeSpec { + fn from(ts: timespec) -> Self { + Self(ts) + } +} + +impl From for TimeSpec { + fn from(duration: Duration) -> Self { + Self::from_duration(duration) + } +} + +impl From for Duration { + fn from(timespec: TimeSpec) -> Self { + Duration::new(timespec.0.tv_sec as u64, timespec.0.tv_nsec as u32) + } +} + +impl AsRef for TimeSpec { + fn as_ref(&self) -> ×pec { + &self.0 + } +} + +impl AsMut for TimeSpec { + fn as_mut(&mut self) -> &mut timespec { + &mut self.0 + } +} + +impl Ord for TimeSpec { + // The implementation of cmp is simplified by assuming that the struct is + // normalized. That is, tv_nsec must always be within [0, 1_000_000_000) + fn cmp(&self, other: &TimeSpec) -> cmp::Ordering { + if self.tv_sec() == other.tv_sec() { + self.tv_nsec().cmp(&other.tv_nsec()) + } else { + self.tv_sec().cmp(&other.tv_sec()) + } + } +} + +impl PartialOrd for TimeSpec { + fn partial_cmp(&self, other: &TimeSpec) -> Option { + Some(self.cmp(other)) + } +} + +impl TimeValLike for TimeSpec { + #[inline] + fn seconds(seconds: i64) -> TimeSpec { + assert!(seconds >= TS_MIN_SECONDS && seconds <= TS_MAX_SECONDS, + "TimeSpec out of bounds; seconds={}", seconds); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec {tv_sec: seconds as time_t, tv_nsec: 0 }) + } + + #[inline] + fn milliseconds(milliseconds: i64) -> TimeSpec { + let nanoseconds = milliseconds.checked_mul(1_000_000) + .expect("TimeSpec::milliseconds out of bounds"); + + TimeSpec::nanoseconds(nanoseconds) + } + + /// Makes a new `TimeSpec` with given number of microseconds. + #[inline] + fn microseconds(microseconds: i64) -> TimeSpec { + let nanoseconds = microseconds.checked_mul(1_000) + .expect("TimeSpec::milliseconds out of bounds"); + + TimeSpec::nanoseconds(nanoseconds) + } + + /// Makes a new `TimeSpec` with given number of nanoseconds. + #[inline] + fn nanoseconds(nanoseconds: i64) -> TimeSpec { + let (secs, nanos) = div_mod_floor_64(nanoseconds, NANOS_PER_SEC); + assert!(secs >= TS_MIN_SECONDS && secs <= TS_MAX_SECONDS, + "TimeSpec out of bounds"); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec {tv_sec: secs as time_t, + tv_nsec: nanos as timespec_tv_nsec_t }) + } + + fn num_seconds(&self) -> i64 { + if self.tv_sec() < 0 && self.tv_nsec() > 0 { + (self.tv_sec() + 1) as i64 + } else { + self.tv_sec() as i64 + } + } + + fn num_milliseconds(&self) -> i64 { + self.num_nanoseconds() / 1_000_000 + } + + fn num_microseconds(&self) -> i64 { + self.num_nanoseconds() / 1_000_000_000 + } + + fn num_nanoseconds(&self) -> i64 { + let secs = self.num_seconds() * 1_000_000_000; + let nsec = self.nanos_mod_sec(); + secs + nsec as i64 + } +} + +impl TimeSpec { + fn nanos_mod_sec(&self) -> timespec_tv_nsec_t { + if self.tv_sec() < 0 && self.tv_nsec() > 0 { + self.tv_nsec() - NANOS_PER_SEC as timespec_tv_nsec_t + } else { + self.tv_nsec() + } + } + + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + pub const fn tv_sec(&self) -> time_t { + self.0.tv_sec + } + + pub const fn tv_nsec(&self) -> timespec_tv_nsec_t { + self.0.tv_nsec + } + + pub const fn from_duration(duration: Duration) -> Self { + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec { + tv_sec: duration.as_secs() as time_t, + tv_nsec: duration.subsec_nanos() as timespec_tv_nsec_t + }) + } + + pub const fn from_timespec(timespec: timespec) -> Self { + Self(timespec) + } +} + +impl ops::Neg for TimeSpec { + type Output = TimeSpec; + + fn neg(self) -> TimeSpec { + TimeSpec::nanoseconds(-self.num_nanoseconds()) + } +} + +impl ops::Add for TimeSpec { + type Output = TimeSpec; + + fn add(self, rhs: TimeSpec) -> TimeSpec { + TimeSpec::nanoseconds( + self.num_nanoseconds() + rhs.num_nanoseconds()) + } +} + +impl ops::Sub for TimeSpec { + type Output = TimeSpec; + + fn sub(self, rhs: TimeSpec) -> TimeSpec { + TimeSpec::nanoseconds( + self.num_nanoseconds() - rhs.num_nanoseconds()) + } +} + +impl ops::Mul for TimeSpec { + type Output = TimeSpec; + + fn mul(self, rhs: i32) -> TimeSpec { + let usec = self.num_nanoseconds().checked_mul(i64::from(rhs)) + .expect("TimeSpec multiply out of bounds"); + + TimeSpec::nanoseconds(usec) + } +} + +impl ops::Div for TimeSpec { + type Output = TimeSpec; + + fn div(self, rhs: i32) -> TimeSpec { + let usec = self.num_nanoseconds() / i64::from(rhs); + TimeSpec::nanoseconds(usec) + } +} + +impl fmt::Display for TimeSpec { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let (abs, sign) = if self.tv_sec() < 0 { + (-*self, "-") + } else { + (*self, "") + }; + + let sec = abs.tv_sec(); + + write!(f, "{}", sign)?; + + if abs.tv_nsec() == 0 { + if abs.tv_sec() == 1 { + write!(f, "{} second", sec)?; + } else { + write!(f, "{} seconds", sec)?; + } + } else if abs.tv_nsec() % 1_000_000 == 0 { + write!(f, "{}.{:03} seconds", sec, abs.tv_nsec() / 1_000_000)?; + } else if abs.tv_nsec() % 1_000 == 0 { + write!(f, "{}.{:06} seconds", sec, abs.tv_nsec() / 1_000)?; + } else { + write!(f, "{}.{:09} seconds", sec, abs.tv_nsec())?; + } + + Ok(()) + } +} + + + +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct TimeVal(timeval); + +const MICROS_PER_SEC: i64 = 1_000_000; + +#[cfg(target_pointer_width = "64")] +const TV_MAX_SECONDS: i64 = (::std::i64::MAX / MICROS_PER_SEC) - 1; + +#[cfg(target_pointer_width = "32")] +const TV_MAX_SECONDS: i64 = ::std::isize::MAX as i64; + +const TV_MIN_SECONDS: i64 = -TV_MAX_SECONDS; + +impl AsRef for TimeVal { + fn as_ref(&self) -> &timeval { + &self.0 + } +} + +impl AsMut for TimeVal { + fn as_mut(&mut self) -> &mut timeval { + &mut self.0 + } +} + +impl Ord for TimeVal { + // The implementation of cmp is simplified by assuming that the struct is + // normalized. That is, tv_usec must always be within [0, 1_000_000) + fn cmp(&self, other: &TimeVal) -> cmp::Ordering { + if self.tv_sec() == other.tv_sec() { + self.tv_usec().cmp(&other.tv_usec()) + } else { + self.tv_sec().cmp(&other.tv_sec()) + } + } +} + +impl PartialOrd for TimeVal { + fn partial_cmp(&self, other: &TimeVal) -> Option { + Some(self.cmp(other)) + } +} + +impl TimeValLike for TimeVal { + #[inline] + fn seconds(seconds: i64) -> TimeVal { + assert!(seconds >= TV_MIN_SECONDS && seconds <= TV_MAX_SECONDS, + "TimeVal out of bounds; seconds={}", seconds); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval {tv_sec: seconds as time_t, tv_usec: 0 }) + } + + #[inline] + fn milliseconds(milliseconds: i64) -> TimeVal { + let microseconds = milliseconds.checked_mul(1_000) + .expect("TimeVal::milliseconds out of bounds"); + + TimeVal::microseconds(microseconds) + } + + /// Makes a new `TimeVal` with given number of microseconds. + #[inline] + fn microseconds(microseconds: i64) -> TimeVal { + let (secs, micros) = div_mod_floor_64(microseconds, MICROS_PER_SEC); + assert!(secs >= TV_MIN_SECONDS && secs <= TV_MAX_SECONDS, + "TimeVal out of bounds"); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval {tv_sec: secs as time_t, + tv_usec: micros as suseconds_t }) + } + + /// Makes a new `TimeVal` with given number of nanoseconds. Some precision + /// will be lost + #[inline] + fn nanoseconds(nanoseconds: i64) -> TimeVal { + let microseconds = nanoseconds / 1000; + let (secs, micros) = div_mod_floor_64(microseconds, MICROS_PER_SEC); + assert!(secs >= TV_MIN_SECONDS && secs <= TV_MAX_SECONDS, + "TimeVal out of bounds"); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval {tv_sec: secs as time_t, + tv_usec: micros as suseconds_t }) + } + + fn num_seconds(&self) -> i64 { + if self.tv_sec() < 0 && self.tv_usec() > 0 { + (self.tv_sec() + 1) as i64 + } else { + self.tv_sec() as i64 + } + } + + fn num_milliseconds(&self) -> i64 { + self.num_microseconds() / 1_000 + } + + fn num_microseconds(&self) -> i64 { + let secs = self.num_seconds() * 1_000_000; + let usec = self.micros_mod_sec(); + secs + usec as i64 + } + + fn num_nanoseconds(&self) -> i64 { + self.num_microseconds() * 1_000 + } +} + +impl TimeVal { + fn micros_mod_sec(&self) -> suseconds_t { + if self.tv_sec() < 0 && self.tv_usec() > 0 { + self.tv_usec() - MICROS_PER_SEC as suseconds_t + } else { + self.tv_usec() + } + } + + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + pub const fn tv_sec(&self) -> time_t { + self.0.tv_sec + } + + pub const fn tv_usec(&self) -> suseconds_t { + self.0.tv_usec + } +} + +impl ops::Neg for TimeVal { + type Output = TimeVal; + + fn neg(self) -> TimeVal { + TimeVal::microseconds(-self.num_microseconds()) + } +} + +impl ops::Add for TimeVal { + type Output = TimeVal; + + fn add(self, rhs: TimeVal) -> TimeVal { + TimeVal::microseconds( + self.num_microseconds() + rhs.num_microseconds()) + } +} + +impl ops::Sub for TimeVal { + type Output = TimeVal; + + fn sub(self, rhs: TimeVal) -> TimeVal { + TimeVal::microseconds( + self.num_microseconds() - rhs.num_microseconds()) + } +} + +impl ops::Mul for TimeVal { + type Output = TimeVal; + + fn mul(self, rhs: i32) -> TimeVal { + let usec = self.num_microseconds().checked_mul(i64::from(rhs)) + .expect("TimeVal multiply out of bounds"); + + TimeVal::microseconds(usec) + } +} + +impl ops::Div for TimeVal { + type Output = TimeVal; + + fn div(self, rhs: i32) -> TimeVal { + let usec = self.num_microseconds() / i64::from(rhs); + TimeVal::microseconds(usec) + } +} + +impl fmt::Display for TimeVal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let (abs, sign) = if self.tv_sec() < 0 { + (-*self, "-") + } else { + (*self, "") + }; + + let sec = abs.tv_sec(); + + write!(f, "{}", sign)?; + + if abs.tv_usec() == 0 { + if abs.tv_sec() == 1 { + write!(f, "{} second", sec)?; + } else { + write!(f, "{} seconds", sec)?; + } + } else if abs.tv_usec() % 1000 == 0 { + write!(f, "{}.{:03} seconds", sec, abs.tv_usec() / 1000)?; + } else { + write!(f, "{}.{:06} seconds", sec, abs.tv_usec())?; + } + + Ok(()) + } +} + +impl From for TimeVal { + fn from(tv: timeval) -> Self { + TimeVal(tv) + } +} + +#[inline] +fn div_mod_floor_64(this: i64, other: i64) -> (i64, i64) { + (div_floor_64(this, other), mod_floor_64(this, other)) +} + +#[inline] +fn div_floor_64(this: i64, other: i64) -> i64 { + match div_rem_64(this, other) { + (d, r) if (r > 0 && other < 0) + || (r < 0 && other > 0) => d - 1, + (d, _) => d, + } +} + +#[inline] +fn mod_floor_64(this: i64, other: i64) -> i64 { + match this % other { + r if (r > 0 && other < 0) + || (r < 0 && other > 0) => r + other, + r => r, + } +} + +#[inline] +fn div_rem_64(this: i64, other: i64) -> (i64, i64) { + (this / other, this % other) +} + +#[cfg(test)] +mod test { + use super::{TimeSpec, TimeVal, TimeValLike}; + use std::time::Duration; + + #[test] + pub fn test_timespec() { + assert!(TimeSpec::seconds(1) != TimeSpec::zero()); + assert_eq!(TimeSpec::seconds(1) + TimeSpec::seconds(2), + TimeSpec::seconds(3)); + assert_eq!(TimeSpec::minutes(3) + TimeSpec::seconds(2), + TimeSpec::seconds(182)); + } + + #[test] + pub fn test_timespec_from() { + let duration = Duration::new(123, 123_456_789); + let timespec = TimeSpec::nanoseconds(123_123_456_789); + + assert_eq!(TimeSpec::from(duration), timespec); + assert_eq!(Duration::from(timespec), duration); + } + + #[test] + pub fn test_timespec_neg() { + let a = TimeSpec::seconds(1) + TimeSpec::nanoseconds(123); + let b = TimeSpec::seconds(-1) + TimeSpec::nanoseconds(-123); + + assert_eq!(a, -b); + } + + #[test] + pub fn test_timespec_ord() { + assert!(TimeSpec::seconds(1) == TimeSpec::nanoseconds(1_000_000_000)); + assert!(TimeSpec::seconds(1) < TimeSpec::nanoseconds(1_000_000_001)); + assert!(TimeSpec::seconds(1) > TimeSpec::nanoseconds(999_999_999)); + assert!(TimeSpec::seconds(-1) < TimeSpec::nanoseconds(-999_999_999)); + assert!(TimeSpec::seconds(-1) > TimeSpec::nanoseconds(-1_000_000_001)); + } + + #[test] + pub fn test_timespec_fmt() { + assert_eq!(TimeSpec::zero().to_string(), "0 seconds"); + assert_eq!(TimeSpec::seconds(42).to_string(), "42 seconds"); + assert_eq!(TimeSpec::milliseconds(42).to_string(), "0.042 seconds"); + assert_eq!(TimeSpec::microseconds(42).to_string(), "0.000042 seconds"); + assert_eq!(TimeSpec::nanoseconds(42).to_string(), "0.000000042 seconds"); + assert_eq!(TimeSpec::seconds(-86401).to_string(), "-86401 seconds"); + } + + #[test] + pub fn test_timeval() { + assert!(TimeVal::seconds(1) != TimeVal::zero()); + assert_eq!(TimeVal::seconds(1) + TimeVal::seconds(2), + TimeVal::seconds(3)); + assert_eq!(TimeVal::minutes(3) + TimeVal::seconds(2), + TimeVal::seconds(182)); + } + + #[test] + pub fn test_timeval_ord() { + assert!(TimeVal::seconds(1) == TimeVal::microseconds(1_000_000)); + assert!(TimeVal::seconds(1) < TimeVal::microseconds(1_000_001)); + assert!(TimeVal::seconds(1) > TimeVal::microseconds(999_999)); + assert!(TimeVal::seconds(-1) < TimeVal::microseconds(-999_999)); + assert!(TimeVal::seconds(-1) > TimeVal::microseconds(-1_000_001)); + } + + #[test] + pub fn test_timeval_neg() { + let a = TimeVal::seconds(1) + TimeVal::microseconds(123); + let b = TimeVal::seconds(-1) + TimeVal::microseconds(-123); + + assert_eq!(a, -b); + } + + #[test] + pub fn test_timeval_fmt() { + assert_eq!(TimeVal::zero().to_string(), "0 seconds"); + assert_eq!(TimeVal::seconds(42).to_string(), "42 seconds"); + assert_eq!(TimeVal::milliseconds(42).to_string(), "0.042 seconds"); + assert_eq!(TimeVal::microseconds(42).to_string(), "0.000042 seconds"); + assert_eq!(TimeVal::nanoseconds(1402).to_string(), "0.000001 seconds"); + assert_eq!(TimeVal::seconds(-86401).to_string(), "-86401 seconds"); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/timerfd.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/timerfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..705a3c4d651c79aecc978f56edfcdf2f65c43669 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/timerfd.rs @@ -0,0 +1,281 @@ +//! Timer API via file descriptors. +//! +//! Timer FD is a Linux-only API to create timers and get expiration +//! notifications through file descriptors. +//! +//! For more documentation, please read [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html). +//! +//! # Examples +//! +//! Create a new one-shot timer that expires after 1 second. +//! ``` +//! # use std::os::unix::io::AsRawFd; +//! # use nix::sys::timerfd::{TimerFd, ClockId, TimerFlags, TimerSetTimeFlags, +//! # Expiration}; +//! # use nix::sys::time::{TimeSpec, TimeValLike}; +//! # use nix::unistd::read; +//! # +//! // We create a new monotonic timer. +//! let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()) +//! .unwrap(); +//! +//! // We set a new one-shot timer in 1 seconds. +//! timer.set( +//! Expiration::OneShot(TimeSpec::seconds(1)), +//! TimerSetTimeFlags::empty() +//! ).unwrap(); +//! +//! // We wait for the timer to expire. +//! timer.wait().unwrap(); +//! ``` +use crate::sys::time::TimeSpec; +use crate::unistd::read; +use crate::{errno::Errno, Result}; +use bitflags::bitflags; +use libc::c_int; +use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; + +/// A timerfd instance. This is also a file descriptor, you can feed it to +/// other interfaces consuming file descriptors, epoll for example. +#[derive(Debug)] +pub struct TimerFd { + fd: RawFd, +} + +impl AsRawFd for TimerFd { + fn as_raw_fd(&self) -> RawFd { + self.fd + } +} + +impl FromRawFd for TimerFd { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + TimerFd { fd } + } +} + +libc_enum! { + /// The type of the clock used to mark the progress of the timer. For more + /// details on each kind of clock, please refer to [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html). + #[repr(i32)] + #[non_exhaustive] + pub enum ClockId { + CLOCK_REALTIME, + CLOCK_MONOTONIC, + CLOCK_BOOTTIME, + CLOCK_REALTIME_ALARM, + CLOCK_BOOTTIME_ALARM, + } +} + +libc_bitflags! { + /// Additional flags to change the behaviour of the file descriptor at the + /// time of creation. + pub struct TimerFlags: c_int { + TFD_NONBLOCK; + TFD_CLOEXEC; + } +} + +bitflags! { + /// Flags that are used for arming the timer. + pub struct TimerSetTimeFlags: libc::c_int { + const TFD_TIMER_ABSTIME = libc::TFD_TIMER_ABSTIME; + } +} + +#[derive(Debug, Clone, Copy)] +struct TimerSpec(libc::itimerspec); + +impl TimerSpec { + pub const fn none() -> Self { + Self(libc::itimerspec { + it_interval: libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + it_value: libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + }) + } +} + +impl AsRef for TimerSpec { + fn as_ref(&self) -> &libc::itimerspec { + &self.0 + } +} + +impl From for TimerSpec { + fn from(expiration: Expiration) -> TimerSpec { + match expiration { + Expiration::OneShot(t) => TimerSpec(libc::itimerspec { + it_interval: libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + it_value: *t.as_ref(), + }), + Expiration::IntervalDelayed(start, interval) => TimerSpec(libc::itimerspec { + it_interval: *interval.as_ref(), + it_value: *start.as_ref(), + }), + Expiration::Interval(t) => TimerSpec(libc::itimerspec { + it_interval: *t.as_ref(), + it_value: *t.as_ref(), + }), + } + } +} + +impl From for Expiration { + fn from(timerspec: TimerSpec) -> Expiration { + match timerspec { + TimerSpec(libc::itimerspec { + it_interval: + libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + it_value: ts, + }) => Expiration::OneShot(ts.into()), + TimerSpec(libc::itimerspec { + it_interval: int_ts, + it_value: val_ts, + }) => { + if (int_ts.tv_sec == val_ts.tv_sec) && (int_ts.tv_nsec == val_ts.tv_nsec) { + Expiration::Interval(int_ts.into()) + } else { + Expiration::IntervalDelayed(val_ts.into(), int_ts.into()) + } + } + } + } +} + +/// An enumeration allowing the definition of the expiration time of an alarm, +/// recurring or not. +#[derive(Debug, Clone, Copy, PartialEq)] +pub enum Expiration { + OneShot(TimeSpec), + IntervalDelayed(TimeSpec, TimeSpec), + Interval(TimeSpec), +} + +impl TimerFd { + /// Creates a new timer based on the clock defined by `clockid`. The + /// underlying fd can be assigned specific flags with `flags` (CLOEXEC, + /// NONBLOCK). The underlying fd will be closed on drop. + pub fn new(clockid: ClockId, flags: TimerFlags) -> Result { + Errno::result(unsafe { libc::timerfd_create(clockid as i32, flags.bits()) }) + .map(|fd| Self { fd }) + } + + /// Sets a new alarm on the timer. + /// + /// # Types of alarm + /// + /// There are 3 types of alarms you can set: + /// + /// - one shot: the alarm will trigger once after the specified amount of + /// time. + /// Example: I want an alarm to go off in 60s and then disables itself. + /// + /// - interval: the alarm will trigger every specified interval of time. + /// Example: I want an alarm to go off every 60s. The alarm will first + /// go off 60s after I set it and every 60s after that. The alarm will + /// not disable itself. + /// + /// - interval delayed: the alarm will trigger after a certain amount of + /// time and then trigger at a specified interval. + /// Example: I want an alarm to go off every 60s but only start in 1h. + /// The alarm will first trigger 1h after I set it and then every 60s + /// after that. The alarm will not disable itself. + /// + /// # Relative vs absolute alarm + /// + /// If you do not set any `TimerSetTimeFlags`, then the `TimeSpec` you pass + /// to the `Expiration` you want is relative. If however you want an alarm + /// to go off at a certain point in time, you can set `TFD_TIMER_ABSTIME`. + /// Then the one shot TimeSpec and the delay TimeSpec of the delayed + /// interval are going to be interpreted as absolute. + /// + /// # Disabling alarms + /// + /// Note: Only one alarm can be set for any given timer. Setting a new alarm + /// actually removes the previous one. + /// + /// Note: Setting a one shot alarm with a 0s TimeSpec disables the alarm + /// altogether. + pub fn set(&self, expiration: Expiration, flags: TimerSetTimeFlags) -> Result<()> { + let timerspec: TimerSpec = expiration.into(); + Errno::result(unsafe { + libc::timerfd_settime( + self.fd, + flags.bits(), + timerspec.as_ref(), + std::ptr::null_mut(), + ) + }) + .map(drop) + } + + /// Get the parameters for the alarm currently set, if any. + pub fn get(&self) -> Result> { + let mut timerspec = TimerSpec::none(); + let timerspec_ptr: *mut libc::itimerspec = &mut timerspec.0; + + Errno::result(unsafe { libc::timerfd_gettime(self.fd, timerspec_ptr) }).map(|_| { + if timerspec.0.it_interval.tv_sec == 0 + && timerspec.0.it_interval.tv_nsec == 0 + && timerspec.0.it_value.tv_sec == 0 + && timerspec.0.it_value.tv_nsec == 0 + { + None + } else { + Some(timerspec.into()) + } + }) + } + + /// Remove the alarm if any is set. + pub fn unset(&self) -> Result<()> { + Errno::result(unsafe { + libc::timerfd_settime( + self.fd, + TimerSetTimeFlags::empty().bits(), + TimerSpec::none().as_ref(), + std::ptr::null_mut(), + ) + }) + .map(drop) + } + + /// Wait for the configured alarm to expire. + /// + /// Note: If the alarm is unset, then you will wait forever. + pub fn wait(&self) -> Result<()> { + while let Err(e) = read(self.fd, &mut [0u8; 8]) { + if e != Errno::EINTR { + return Err(e) + } + } + + Ok(()) + } +} + +impl Drop for TimerFd { + fn drop(&mut self) { + if !std::thread::panicking() { + let result = Errno::result(unsafe { + libc::close(self.fd) + }); + if let Err(Errno::EBADF) = result { + panic!("close of TimerFd encountered EBADF"); + } + } + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/uio.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/uio.rs new file mode 100644 index 0000000000000000000000000000000000000000..3abcde24fe8e03aed724ba8eaf38347a9acfc96c --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/uio.rs @@ -0,0 +1,223 @@ +//! Vectored I/O + +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_int, c_void, size_t, off_t}; +use std::marker::PhantomData; +use std::os::unix::io::RawFd; + +/// Low-level vectored write to a raw file descriptor +/// +/// See also [writev(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/writev.html) +pub fn writev(fd: RawFd, iov: &[IoVec<&[u8]>]) -> Result { + let res = unsafe { libc::writev(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int) }; + + Errno::result(res).map(|r| r as usize) +} + +/// Low-level vectored read from a raw file descriptor +/// +/// See also [readv(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/readv.html) +pub fn readv(fd: RawFd, iov: &mut [IoVec<&mut [u8]>]) -> Result { + let res = unsafe { libc::readv(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int) }; + + Errno::result(res).map(|r| r as usize) +} + +/// Write to `fd` at `offset` from buffers in `iov`. +/// +/// Buffers in `iov` will be written in order until all buffers have been written +/// or an error occurs. The file offset is not changed. +/// +/// See also: [`writev`](fn.writev.html) and [`pwrite`](fn.pwrite.html) +#[cfg(not(target_os = "redox"))] +pub fn pwritev(fd: RawFd, iov: &[IoVec<&[u8]>], + offset: off_t) -> Result { + let res = unsafe { + libc::pwritev(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int, offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Read from `fd` at `offset` filling buffers in `iov`. +/// +/// Buffers in `iov` will be filled in order until all buffers have been filled, +/// no more bytes are available, or an error occurs. The file offset is not +/// changed. +/// +/// See also: [`readv`](fn.readv.html) and [`pread`](fn.pread.html) +#[cfg(not(target_os = "redox"))] +pub fn preadv(fd: RawFd, iov: &[IoVec<&mut [u8]>], + offset: off_t) -> Result { + let res = unsafe { + libc::preadv(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int, offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Low-level write to a file, with specified offset. +/// +/// See also [pwrite(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html) +// TODO: move to unistd +pub fn pwrite(fd: RawFd, buf: &[u8], offset: off_t) -> Result { + let res = unsafe { + libc::pwrite(fd, buf.as_ptr() as *const c_void, buf.len() as size_t, + offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Low-level write to a file, with specified offset. +/// +/// See also [pread(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html) +// TODO: move to unistd +pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result{ + let res = unsafe { + libc::pread(fd, buf.as_mut_ptr() as *mut c_void, buf.len() as size_t, + offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// A slice of memory in a remote process, starting at address `base` +/// and consisting of `len` bytes. +/// +/// This is the same underlying C structure as [`IoVec`](struct.IoVec.html), +/// except that it refers to memory in some other process, and is +/// therefore not represented in Rust by an actual slice as `IoVec` is. It +/// is used with [`process_vm_readv`](fn.process_vm_readv.html) +/// and [`process_vm_writev`](fn.process_vm_writev.html). +#[cfg(target_os = "linux")] +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct RemoteIoVec { + /// The starting address of this slice (`iov_base`). + pub base: usize, + /// The number of bytes in this slice (`iov_len`). + pub len: usize, +} + +/// Write data directly to another process's virtual memory +/// (see [`process_vm_writev`(2)]). +/// +/// `local_iov` is a list of [`IoVec`]s containing the data to be written, +/// and `remote_iov` is a list of [`RemoteIoVec`]s identifying where the +/// data should be written in the target process. On success, returns the +/// number of bytes written, which will always be a whole +/// number of `remote_iov` chunks. +/// +/// This requires the same permissions as debugging the process using +/// [ptrace]: you must either be a privileged process (with +/// `CAP_SYS_PTRACE`), or you must be running as the same user as the +/// target process and the OS must have unprivileged debugging enabled. +/// +/// This function is only available on Linux. +/// +/// [`process_vm_writev`(2)]: https://man7.org/linux/man-pages/man2/process_vm_writev.2.html +/// [ptrace]: ../ptrace/index.html +/// [`IoVec`]: struct.IoVec.html +/// [`RemoteIoVec`]: struct.RemoteIoVec.html +#[cfg(target_os = "linux")] +pub fn process_vm_writev( + pid: crate::unistd::Pid, + local_iov: &[IoVec<&[u8]>], + remote_iov: &[RemoteIoVec]) -> Result +{ + let res = unsafe { + libc::process_vm_writev(pid.into(), + local_iov.as_ptr() as *const libc::iovec, local_iov.len() as libc::c_ulong, + remote_iov.as_ptr() as *const libc::iovec, remote_iov.len() as libc::c_ulong, 0) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Read data directly from another process's virtual memory +/// (see [`process_vm_readv`(2)]). +/// +/// `local_iov` is a list of [`IoVec`]s containing the buffer to copy +/// data into, and `remote_iov` is a list of [`RemoteIoVec`]s identifying +/// where the source data is in the target process. On success, +/// returns the number of bytes written, which will always be a whole +/// number of `remote_iov` chunks. +/// +/// This requires the same permissions as debugging the process using +/// [`ptrace`]: you must either be a privileged process (with +/// `CAP_SYS_PTRACE`), or you must be running as the same user as the +/// target process and the OS must have unprivileged debugging enabled. +/// +/// This function is only available on Linux. +/// +/// [`process_vm_readv`(2)]: https://man7.org/linux/man-pages/man2/process_vm_readv.2.html +/// [`ptrace`]: ../ptrace/index.html +/// [`IoVec`]: struct.IoVec.html +/// [`RemoteIoVec`]: struct.RemoteIoVec.html +#[cfg(any(target_os = "linux"))] +pub fn process_vm_readv( + pid: crate::unistd::Pid, + local_iov: &[IoVec<&mut [u8]>], + remote_iov: &[RemoteIoVec]) -> Result +{ + let res = unsafe { + libc::process_vm_readv(pid.into(), + local_iov.as_ptr() as *const libc::iovec, local_iov.len() as libc::c_ulong, + remote_iov.as_ptr() as *const libc::iovec, remote_iov.len() as libc::c_ulong, 0) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// A vector of buffers. +/// +/// Vectored I/O methods like [`writev`] and [`readv`] use this structure for +/// both reading and writing. Each `IoVec` specifies the base address and +/// length of an area in memory. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct IoVec(pub(crate) libc::iovec, PhantomData); + +impl IoVec { + /// View the `IoVec` as a Rust slice. + #[inline] + pub fn as_slice(&self) -> &[u8] { + use std::slice; + + unsafe { + slice::from_raw_parts( + self.0.iov_base as *const u8, + self.0.iov_len as usize) + } + } +} + +impl<'a> IoVec<&'a [u8]> { + #[cfg(target_os = "freebsd")] + pub(crate) fn from_raw_parts(base: *mut c_void, len: usize) -> Self { + IoVec(libc::iovec { + iov_base: base, + iov_len: len + }, PhantomData) + } + + /// Create an `IoVec` from a Rust slice. + pub fn from_slice(buf: &'a [u8]) -> IoVec<&'a [u8]> { + IoVec(libc::iovec { + iov_base: buf.as_ptr() as *mut c_void, + iov_len: buf.len() as size_t, + }, PhantomData) + } +} + +impl<'a> IoVec<&'a mut [u8]> { + /// Create an `IoVec` from a mutable Rust slice. + pub fn from_mut_slice(buf: &'a mut [u8]) -> IoVec<&'a mut [u8]> { + IoVec(libc::iovec { + iov_base: buf.as_ptr() as *mut c_void, + iov_len: buf.len() as size_t, + }, PhantomData) + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/utsname.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/utsname.rs new file mode 100644 index 0000000000000000000000000000000000000000..98edee0428fdd4c1bb1014fcaff2b9456e95acb8 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/utsname.rs @@ -0,0 +1,75 @@ +//! Get system identification +use std::mem; +use libc::{self, c_char}; +use std::ffi::CStr; +use std::str::from_utf8_unchecked; + +/// Describes the running system. Return type of [`uname`]. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct UtsName(libc::utsname); + +impl UtsName { + /// Name of the operating system implementation + pub fn sysname(&self) -> &str { + to_str(&(&self.0.sysname as *const c_char ) as *const *const c_char) + } + + /// Network name of this machine. + pub fn nodename(&self) -> &str { + to_str(&(&self.0.nodename as *const c_char ) as *const *const c_char) + } + + /// Release level of the operating system. + pub fn release(&self) -> &str { + to_str(&(&self.0.release as *const c_char ) as *const *const c_char) + } + + /// Version level of the operating system. + pub fn version(&self) -> &str { + to_str(&(&self.0.version as *const c_char ) as *const *const c_char) + } + + /// Machine hardware platform. + pub fn machine(&self) -> &str { + to_str(&(&self.0.machine as *const c_char ) as *const *const c_char) + } +} + +/// Get system identification +pub fn uname() -> UtsName { + unsafe { + let mut ret = mem::MaybeUninit::uninit(); + libc::uname(ret.as_mut_ptr()); + UtsName(ret.assume_init()) + } +} + +#[inline] +fn to_str<'a>(s: *const *const c_char) -> &'a str { + unsafe { + let res = CStr::from_ptr(*s).to_bytes(); + from_utf8_unchecked(res) + } +} + +#[cfg(test)] +mod test { + #[cfg(target_os = "linux")] + #[test] + pub fn test_uname_linux() { + assert_eq!(super::uname().sysname(), "Linux"); + } + + #[cfg(any(target_os = "macos", target_os = "ios"))] + #[test] + pub fn test_uname_darwin() { + assert_eq!(super::uname().sysname(), "Darwin"); + } + + #[cfg(target_os = "freebsd")] + #[test] + pub fn test_uname_freebsd() { + assert_eq!(super::uname().sysname(), "FreeBSD"); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/sys/wait.rs b/bash-5.1/vendor/nix-0.23.1/src/sys/wait.rs new file mode 100644 index 0000000000000000000000000000000000000000..ee49e37decfa851c32fac9b47650057feb17f830 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/sys/wait.rs @@ -0,0 +1,262 @@ +//! Wait for a process to change status +use crate::errno::Errno; +use crate::sys::signal::Signal; +use crate::unistd::Pid; +use crate::Result; +use cfg_if::cfg_if; +use libc::{self, c_int}; +use std::convert::TryFrom; + +libc_bitflags!( + /// Controls the behavior of [`waitpid`]. + pub struct WaitPidFlag: c_int { + /// Do not block when there are no processes wishing to report status. + WNOHANG; + /// Report the status of selected processes which are stopped due to a + /// [`SIGTTIN`](crate::sys::signal::Signal::SIGTTIN), + /// [`SIGTTOU`](crate::sys::signal::Signal::SIGTTOU), + /// [`SIGTSTP`](crate::sys::signal::Signal::SIGTSTP), or + /// [`SIGSTOP`](crate::sys::signal::Signal::SIGSTOP) signal. + WUNTRACED; + /// Report the status of selected processes which have terminated. + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd"))] + WEXITED; + /// Report the status of selected processes that have continued from a + /// job control stop by receiving a + /// [`SIGCONT`](crate::sys::signal::Signal::SIGCONT) signal. + WCONTINUED; + /// An alias for WUNTRACED. + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd"))] + WSTOPPED; + /// Don't reap, just poll status. + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd"))] + WNOWAIT; + /// Don't wait on children of other threads in this group + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + __WNOTHREAD; + /// Wait on all children, regardless of type + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + __WALL; + /// Wait for "clone" children only. + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + __WCLONE; + } +); + +/// Possible return values from `wait()` or `waitpid()`. +/// +/// Each status (other than `StillAlive`) describes a state transition +/// in a child process `Pid`, such as the process exiting or stopping, +/// plus additional data about the transition if any. +/// +/// Note that there are two Linux-specific enum variants, `PtraceEvent` +/// and `PtraceSyscall`. Portable code should avoid exhaustively +/// matching on `WaitStatus`. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum WaitStatus { + /// The process exited normally (as with `exit()` or returning from + /// `main`) with the given exit code. This case matches the C macro + /// `WIFEXITED(status)`; the second field is `WEXITSTATUS(status)`. + Exited(Pid, i32), + /// The process was killed by the given signal. The third field + /// indicates whether the signal generated a core dump. This case + /// matches the C macro `WIFSIGNALED(status)`; the last two fields + /// correspond to `WTERMSIG(status)` and `WCOREDUMP(status)`. + Signaled(Pid, Signal, bool), + /// The process is alive, but was stopped by the given signal. This + /// is only reported if `WaitPidFlag::WUNTRACED` was passed. This + /// case matches the C macro `WIFSTOPPED(status)`; the second field + /// is `WSTOPSIG(status)`. + Stopped(Pid, Signal), + /// The traced process was stopped by a `PTRACE_EVENT_*` event. See + /// [`nix::sys::ptrace`] and [`ptrace`(2)] for more information. All + /// currently-defined events use `SIGTRAP` as the signal; the third + /// field is the `PTRACE_EVENT_*` value of the event. + /// + /// [`nix::sys::ptrace`]: ../ptrace/index.html + /// [`ptrace`(2)]: https://man7.org/linux/man-pages/man2/ptrace.2.html + #[cfg(any(target_os = "linux", target_os = "android"))] + PtraceEvent(Pid, Signal, c_int), + /// The traced process was stopped by execution of a system call, + /// and `PTRACE_O_TRACESYSGOOD` is in effect. See [`ptrace`(2)] for + /// more information. + /// + /// [`ptrace`(2)]: https://man7.org/linux/man-pages/man2/ptrace.2.html + #[cfg(any(target_os = "linux", target_os = "android"))] + PtraceSyscall(Pid), + /// The process was previously stopped but has resumed execution + /// after receiving a `SIGCONT` signal. This is only reported if + /// `WaitPidFlag::WCONTINUED` was passed. This case matches the C + /// macro `WIFCONTINUED(status)`. + Continued(Pid), + /// There are currently no state changes to report in any awaited + /// child process. This is only returned if `WaitPidFlag::WNOHANG` + /// was used (otherwise `wait()` or `waitpid()` would block until + /// there was something to report). + StillAlive, +} + +impl WaitStatus { + /// Extracts the PID from the WaitStatus unless it equals StillAlive. + pub fn pid(&self) -> Option { + use self::WaitStatus::*; + match *self { + Exited(p, _) | Signaled(p, _, _) | Stopped(p, _) | Continued(p) => Some(p), + StillAlive => None, + #[cfg(any(target_os = "android", target_os = "linux"))] + PtraceEvent(p, _, _) | PtraceSyscall(p) => Some(p), + } + } +} + +fn exited(status: i32) -> bool { + libc::WIFEXITED(status) +} + +fn exit_status(status: i32) -> i32 { + libc::WEXITSTATUS(status) +} + +fn signaled(status: i32) -> bool { + libc::WIFSIGNALED(status) +} + +fn term_signal(status: i32) -> Result { + Signal::try_from(libc::WTERMSIG(status)) +} + +fn dumped_core(status: i32) -> bool { + libc::WCOREDUMP(status) +} + +fn stopped(status: i32) -> bool { + libc::WIFSTOPPED(status) +} + +fn stop_signal(status: i32) -> Result { + Signal::try_from(libc::WSTOPSIG(status)) +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn syscall_stop(status: i32) -> bool { + // From ptrace(2), setting PTRACE_O_TRACESYSGOOD has the effect + // of delivering SIGTRAP | 0x80 as the signal number for syscall + // stops. This allows easily distinguishing syscall stops from + // genuine SIGTRAP signals. + libc::WSTOPSIG(status) == libc::SIGTRAP | 0x80 +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn stop_additional(status: i32) -> c_int { + (status >> 16) as c_int +} + +fn continued(status: i32) -> bool { + libc::WIFCONTINUED(status) +} + +impl WaitStatus { + /// Convert a raw `wstatus` as returned by `waitpid`/`wait` into a `WaitStatus` + /// + /// # Errors + /// + /// Returns an `Error` corresponding to `EINVAL` for invalid status values. + /// + /// # Examples + /// + /// Convert a `wstatus` obtained from `libc::waitpid` into a `WaitStatus`: + /// + /// ``` + /// use nix::sys::wait::WaitStatus; + /// use nix::sys::signal::Signal; + /// let pid = nix::unistd::Pid::from_raw(1); + /// let status = WaitStatus::from_raw(pid, 0x0002); + /// assert_eq!(status, Ok(WaitStatus::Signaled(pid, Signal::SIGINT, false))); + /// ``` + pub fn from_raw(pid: Pid, status: i32) -> Result { + Ok(if exited(status) { + WaitStatus::Exited(pid, exit_status(status)) + } else if signaled(status) { + WaitStatus::Signaled(pid, term_signal(status)?, dumped_core(status)) + } else if stopped(status) { + cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + fn decode_stopped(pid: Pid, status: i32) -> Result { + let status_additional = stop_additional(status); + Ok(if syscall_stop(status) { + WaitStatus::PtraceSyscall(pid) + } else if status_additional == 0 { + WaitStatus::Stopped(pid, stop_signal(status)?) + } else { + WaitStatus::PtraceEvent(pid, stop_signal(status)?, + stop_additional(status)) + }) + } + } else { + fn decode_stopped(pid: Pid, status: i32) -> Result { + Ok(WaitStatus::Stopped(pid, stop_signal(status)?)) + } + } + } + return decode_stopped(pid, status); + } else { + assert!(continued(status)); + WaitStatus::Continued(pid) + }) + } +} + +/// Wait for a process to change status +/// +/// See also [waitpid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/waitpid.html) +pub fn waitpid>>(pid: P, options: Option) -> Result { + use self::WaitStatus::*; + + let mut status: i32 = 0; + + let option_bits = match options { + Some(bits) => bits.bits(), + None => 0, + }; + + let res = unsafe { + libc::waitpid( + pid.into().unwrap_or_else(|| Pid::from_raw(-1)).into(), + &mut status as *mut c_int, + option_bits, + ) + }; + + match Errno::result(res)? { + 0 => Ok(StillAlive), + res => WaitStatus::from_raw(Pid::from_raw(res), status), + } +} + +/// Wait for any child process to change status or a signal is received. +/// +/// See also [wait(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/wait.html) +pub fn wait() -> Result { + waitpid(None, None) +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/time.rs b/bash-5.1/vendor/nix-0.23.1/src/time.rs new file mode 100644 index 0000000000000000000000000000000000000000..6275b59c748742b7b54b36ac086aeba706f6202f --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/time.rs @@ -0,0 +1,260 @@ +use crate::sys::time::TimeSpec; +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +use crate::unistd::Pid; +use crate::{Errno, Result}; +use libc::{self, clockid_t}; +use std::mem::MaybeUninit; + +/// Clock identifier +/// +/// Newtype pattern around `clockid_t` (which is just alias). It pervents bugs caused by +/// accidentally passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] +pub struct ClockId(clockid_t); + +impl ClockId { + /// Creates `ClockId` from raw `clockid_t` + pub const fn from_raw(clk_id: clockid_t) -> Self { + ClockId(clk_id) + } + + /// Returns `ClockId` of a `pid` CPU-time clock + #[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", + ))] + pub fn pid_cpu_clock_id(pid: Pid) -> Result { + clock_getcpuclockid(pid) + } + + /// Returns resolution of the clock id + #[cfg(not(target_os = "redox"))] + pub fn res(self) -> Result { + clock_getres(self) + } + + /// Returns the current time on the clock id + pub fn now(self) -> Result { + clock_gettime(self) + } + + /// Sets time to `timespec` on the clock id + #[cfg(not(any( + target_os = "macos", + target_os = "ios", + all( + not(any(target_env = "uclibc", target_env = "newlibc")), + any(target_os = "redox", target_os = "hermit",), + ), + )))] + pub fn set_time(self, timespec: TimeSpec) -> Result<()> { + clock_settime(self, timespec) + } + + /// Gets the raw `clockid_t` wrapped by `self` + pub const fn as_raw(self) -> clockid_t { + self.0 + } + + #[cfg(any( + target_os = "fuchsia", + all( + not(any(target_env = "uclibc", target_env = "newlib")), + any(target_os = "linux", target_os = "android", target_os = "emscripten"), + ) + ))] + pub const CLOCK_BOOTTIME: ClockId = ClockId(libc::CLOCK_BOOTTIME); + #[cfg(any( + target_os = "fuchsia", + all( + not(any(target_env = "uclibc", target_env = "newlib")), + any(target_os = "linux", target_os = "android", target_os = "emscripten") + ) + ))] + pub const CLOCK_BOOTTIME_ALARM: ClockId = ClockId(libc::CLOCK_BOOTTIME_ALARM); + pub const CLOCK_MONOTONIC: ClockId = ClockId(libc::CLOCK_MONOTONIC); + #[cfg(any( + target_os = "fuchsia", + all( + not(any(target_env = "uclibc", target_env = "newlib")), + any(target_os = "linux", target_os = "android", target_os = "emscripten") + ) + ))] + pub const CLOCK_MONOTONIC_COARSE: ClockId = ClockId(libc::CLOCK_MONOTONIC_COARSE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + pub const CLOCK_MONOTONIC_FAST: ClockId = ClockId(libc::CLOCK_MONOTONIC_FAST); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + pub const CLOCK_MONOTONIC_PRECISE: ClockId = ClockId(libc::CLOCK_MONOTONIC_PRECISE); + #[cfg(any( + target_os = "fuchsia", + all( + not(any(target_env = "uclibc", target_env = "newlib")), + any(target_os = "linux", target_os = "android", target_os = "emscripten") + ) + ))] + pub const CLOCK_MONOTONIC_RAW: ClockId = ClockId(libc::CLOCK_MONOTONIC_RAW); + #[cfg(any( + target_os = "fuchsia", + target_env = "uclibc", + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly", + all( + not(target_env = "newlib"), + any(target_os = "linux", target_os = "android", target_os = "emscripten") + ) + ))] + pub const CLOCK_PROCESS_CPUTIME_ID: ClockId = ClockId(libc::CLOCK_PROCESS_CPUTIME_ID); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + pub const CLOCK_PROF: ClockId = ClockId(libc::CLOCK_PROF); + pub const CLOCK_REALTIME: ClockId = ClockId(libc::CLOCK_REALTIME); + #[cfg(any( + target_os = "fuchsia", + all( + not(any(target_env = "uclibc", target_env = "newlib")), + any(target_os = "linux", target_os = "android", target_os = "emscripten") + ) + ))] + pub const CLOCK_REALTIME_ALARM: ClockId = ClockId(libc::CLOCK_REALTIME_ALARM); + #[cfg(any( + target_os = "fuchsia", + all( + not(any(target_env = "uclibc", target_env = "newlib")), + any(target_os = "linux", target_os = "android", target_os = "emscripten") + ) + ))] + pub const CLOCK_REALTIME_COARSE: ClockId = ClockId(libc::CLOCK_REALTIME_COARSE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + pub const CLOCK_REALTIME_FAST: ClockId = ClockId(libc::CLOCK_REALTIME_FAST); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + pub const CLOCK_REALTIME_PRECISE: ClockId = ClockId(libc::CLOCK_REALTIME_PRECISE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + pub const CLOCK_SECOND: ClockId = ClockId(libc::CLOCK_SECOND); + #[cfg(any( + target_os = "fuchsia", + all( + not(any(target_env = "uclibc", target_env = "newlib")), + any( + target_os = "emscripten", + all(target_os = "linux", target_env = "musl") + ) + ) + ))] + pub const CLOCK_SGI_CYCLE: ClockId = ClockId(libc::CLOCK_SGI_CYCLE); + #[cfg(any( + target_os = "fuchsia", + all( + not(any(target_env = "uclibc", target_env = "newlib")), + any( + target_os = "emscripten", + all(target_os = "linux", target_env = "musl") + ) + ) + ))] + pub const CLOCK_TAI: ClockId = ClockId(libc::CLOCK_TAI); + #[cfg(any( + target_env = "uclibc", + target_os = "fuchsia", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + all( + not(target_env = "newlib"), + any(target_os = "linux", target_os = "android", target_os = "emscripten",), + ), + ))] + pub const CLOCK_THREAD_CPUTIME_ID: ClockId = ClockId(libc::CLOCK_THREAD_CPUTIME_ID); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + pub const CLOCK_UPTIME: ClockId = ClockId(libc::CLOCK_UPTIME); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + pub const CLOCK_UPTIME_FAST: ClockId = ClockId(libc::CLOCK_UPTIME_FAST); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + pub const CLOCK_UPTIME_PRECISE: ClockId = ClockId(libc::CLOCK_UPTIME_PRECISE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + pub const CLOCK_VIRTUAL: ClockId = ClockId(libc::CLOCK_VIRTUAL); +} + +impl From for clockid_t { + fn from(clock_id: ClockId) -> Self { + clock_id.as_raw() + } +} + +impl From for ClockId { + fn from(clk_id: clockid_t) -> Self { + ClockId::from_raw(clk_id) + } +} + +impl std::fmt::Display for ClockId { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + std::fmt::Display::fmt(&self.0, f) + } +} + +/// Get the resolution of the specified clock, (see +/// [clock_getres(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_getres.html)). +#[cfg(not(target_os = "redox"))] +pub fn clock_getres(clock_id: ClockId) -> Result { + let mut c_time: MaybeUninit = MaybeUninit::uninit(); + let ret = unsafe { libc::clock_getres(clock_id.as_raw(), c_time.as_mut_ptr()) }; + Errno::result(ret)?; + let res = unsafe { c_time.assume_init() }; + Ok(TimeSpec::from(res)) +} + +/// Get the time of the specified clock, (see +/// [clock_gettime(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_gettime.html)). +pub fn clock_gettime(clock_id: ClockId) -> Result { + let mut c_time: MaybeUninit = MaybeUninit::uninit(); + let ret = unsafe { libc::clock_gettime(clock_id.as_raw(), c_time.as_mut_ptr()) }; + Errno::result(ret)?; + let res = unsafe { c_time.assume_init() }; + Ok(TimeSpec::from(res)) +} + +/// Set the time of the specified clock, (see +/// [clock_settime(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_settime.html)). +#[cfg(not(any( + target_os = "macos", + target_os = "ios", + all( + not(any(target_env = "uclibc", target_env = "newlibc")), + any(target_os = "redox", target_os = "hermit",), + ), +)))] +pub fn clock_settime(clock_id: ClockId, timespec: TimeSpec) -> Result<()> { + let ret = unsafe { libc::clock_settime(clock_id.as_raw(), timespec.as_ref()) }; + Errno::result(ret).map(drop) +} + +/// Get the clock id of the specified process id, (see +/// [clock_getcpuclockid(3)](https://pubs.opengroup.org/onlinepubs/009695399/functions/clock_getcpuclockid.html)). +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +pub fn clock_getcpuclockid(pid: Pid) -> Result { + let mut clk_id: MaybeUninit = MaybeUninit::uninit(); + let ret = unsafe { libc::clock_getcpuclockid(pid.into(), clk_id.as_mut_ptr()) }; + if ret == 0 { + let res = unsafe { clk_id.assume_init() }; + Ok(ClockId::from(res)) + } else { + Err(Errno::from_i32(ret)) + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/ucontext.rs b/bash-5.1/vendor/nix-0.23.1/src/ucontext.rs new file mode 100644 index 0000000000000000000000000000000000000000..f2338bd426ac2f731040439c4de36cbc5fdc934f --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/ucontext.rs @@ -0,0 +1,43 @@ +#[cfg(not(target_env = "musl"))] +use crate::Result; +#[cfg(not(target_env = "musl"))] +use crate::errno::Errno; +#[cfg(not(target_env = "musl"))] +use std::mem; +use crate::sys::signal::SigSet; + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct UContext { + context: libc::ucontext_t, +} + +impl UContext { + #[cfg(not(target_env = "musl"))] + pub fn get() -> Result { + let mut context = mem::MaybeUninit::::uninit(); + let res = unsafe { libc::getcontext(context.as_mut_ptr()) }; + Errno::result(res).map(|_| unsafe { + UContext { context: context.assume_init()} + }) + } + + #[cfg(not(target_env = "musl"))] + pub fn set(&self) -> Result<()> { + let res = unsafe { + libc::setcontext(&self.context as *const libc::ucontext_t) + }; + Errno::result(res).map(drop) + } + + pub fn sigmask_mut(&mut self) -> &mut SigSet { + unsafe { + &mut *(&mut self.context.uc_sigmask as *mut libc::sigset_t as *mut SigSet) + } + } + + pub fn sigmask(&self) -> &SigSet { + unsafe { + &*(&self.context.uc_sigmask as *const libc::sigset_t as *const SigSet) + } + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/src/unistd.rs b/bash-5.1/vendor/nix-0.23.1/src/unistd.rs new file mode 100644 index 0000000000000000000000000000000000000000..2c89d77240e263b20887360360a315cacec0f549 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/src/unistd.rs @@ -0,0 +1,2994 @@ +//! Safe wrappers around functions found in libc "unistd.h" header + +#[cfg(not(target_os = "redox"))] +use cfg_if::cfg_if; +use crate::errno::{self, Errno}; +use crate::{Error, Result, NixPath}; +#[cfg(not(target_os = "redox"))] +use crate::fcntl::{AtFlags, at_rawfd}; +use crate::fcntl::{FdFlag, OFlag, fcntl}; +use crate::fcntl::FcntlArg::F_SETFD; +use libc::{self, c_char, c_void, c_int, c_long, c_uint, size_t, pid_t, off_t, + uid_t, gid_t, mode_t, PATH_MAX}; +use std::{fmt, mem, ptr}; +use std::convert::Infallible; +use std::ffi::{CStr, OsString}; +#[cfg(not(target_os = "redox"))] +use std::ffi::{CString, OsStr}; +use std::os::unix::ffi::OsStringExt; +#[cfg(not(target_os = "redox"))] +use std::os::unix::ffi::OsStrExt; +use std::os::unix::io::RawFd; +use std::path::PathBuf; +use crate::sys::stat::Mode; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::pivot_root::*; + +#[cfg(any(target_os = "android", target_os = "freebsd", + target_os = "linux", target_os = "openbsd"))] +pub use self::setres::*; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::getres::*; + +/// User identifier +/// +/// Newtype pattern around `uid_t` (which is just alias). It prevents bugs caused by accidentally +/// passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub struct Uid(uid_t); + +impl Uid { + /// Creates `Uid` from raw `uid_t`. + pub const fn from_raw(uid: uid_t) -> Self { + Uid(uid) + } + + /// Returns Uid of calling process. This is practically a more Rusty alias for `getuid`. + pub fn current() -> Self { + getuid() + } + + /// Returns effective Uid of calling process. This is practically a more Rusty alias for `geteuid`. + pub fn effective() -> Self { + geteuid() + } + + /// Returns true if the `Uid` represents privileged user - root. (If it equals zero.) + pub const fn is_root(self) -> bool { + self.0 == ROOT.0 + } + + /// Get the raw `uid_t` wrapped by `self`. + pub const fn as_raw(self) -> uid_t { + self.0 + } +} + +impl From for uid_t { + fn from(uid: Uid) -> Self { + uid.0 + } +} + +impl fmt::Display for Uid { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.0, f) + } +} + +/// Constant for UID = 0 +pub const ROOT: Uid = Uid(0); + +/// Group identifier +/// +/// Newtype pattern around `gid_t` (which is just alias). It prevents bugs caused by accidentally +/// passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub struct Gid(gid_t); + +impl Gid { + /// Creates `Gid` from raw `gid_t`. + pub const fn from_raw(gid: gid_t) -> Self { + Gid(gid) + } + + /// Returns Gid of calling process. This is practically a more Rusty alias for `getgid`. + pub fn current() -> Self { + getgid() + } + + /// Returns effective Gid of calling process. This is practically a more Rusty alias for `getegid`. + pub fn effective() -> Self { + getegid() + } + + /// Get the raw `gid_t` wrapped by `self`. + pub const fn as_raw(self) -> gid_t { + self.0 + } +} + +impl From for gid_t { + fn from(gid: Gid) -> Self { + gid.0 + } +} + +impl fmt::Display for Gid { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.0, f) + } +} + +/// Process identifier +/// +/// Newtype pattern around `pid_t` (which is just alias). It prevents bugs caused by accidentally +/// passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] +pub struct Pid(pid_t); + +impl Pid { + /// Creates `Pid` from raw `pid_t`. + pub const fn from_raw(pid: pid_t) -> Self { + Pid(pid) + } + + /// Returns PID of calling process + pub fn this() -> Self { + getpid() + } + + /// Returns PID of parent of calling process + pub fn parent() -> Self { + getppid() + } + + /// Get the raw `pid_t` wrapped by `self`. + pub const fn as_raw(self) -> pid_t { + self.0 + } +} + +impl From for pid_t { + fn from(pid: Pid) -> Self { + pid.0 + } +} + +impl fmt::Display for Pid { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.0, f) + } +} + + +/// Represents the successful result of calling `fork` +/// +/// When `fork` is called, the process continues execution in the parent process +/// and in the new child. This return type can be examined to determine whether +/// you are now executing in the parent process or in the child. +#[derive(Clone, Copy, Debug)] +pub enum ForkResult { + Parent { child: Pid }, + Child, +} + +impl ForkResult { + + /// Return `true` if this is the child process of the `fork()` + #[inline] + pub fn is_child(self) -> bool { + matches!(self, ForkResult::Child) + } + + /// Returns `true` if this is the parent process of the `fork()` + #[inline] + pub fn is_parent(self) -> bool { + !self.is_child() + } +} + +/// Create a new child process duplicating the parent process ([see +/// fork(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html)). +/// +/// After calling the fork system call (successfully) two processes will +/// be created that are identical with the exception of their pid and the +/// return value of this function. As an example: +/// +/// ``` +/// use nix::{sys::wait::waitpid,unistd::{fork, ForkResult, write}}; +/// +/// match unsafe{fork()} { +/// Ok(ForkResult::Parent { child, .. }) => { +/// println!("Continuing execution in parent process, new child has pid: {}", child); +/// waitpid(child, None).unwrap(); +/// } +/// Ok(ForkResult::Child) => { +/// // Unsafe to use `println!` (or `unwrap`) here. See Safety. +/// write(libc::STDOUT_FILENO, "I'm a new child process\n".as_bytes()).ok(); +/// unsafe { libc::_exit(0) }; +/// } +/// Err(_) => println!("Fork failed"), +/// } +/// ``` +/// +/// This will print something like the following (order indeterministic). The +/// thing to note is that you end up with two processes continuing execution +/// immediately after the fork call but with different match arms. +/// +/// ```text +/// Continuing execution in parent process, new child has pid: 1234 +/// I'm a new child process +/// ``` +/// +/// # Safety +/// +/// In a multithreaded program, only [async-signal-safe] functions like `pause` +/// and `_exit` may be called by the child (the parent isn't restricted). Note +/// that memory allocation may **not** be async-signal-safe and thus must be +/// prevented. +/// +/// Those functions are only a small subset of your operating system's API, so +/// special care must be taken to only invoke code you can control and audit. +/// +/// [async-signal-safe]: https://man7.org/linux/man-pages/man7/signal-safety.7.html +#[inline] +pub unsafe fn fork() -> Result { + use self::ForkResult::*; + let res = libc::fork(); + + Errno::result(res).map(|res| match res { + 0 => Child, + res => Parent { child: Pid(res) }, + }) +} + +/// Get the pid of this process (see +/// [getpid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpid.html)). +/// +/// Since you are running code, there is always a pid to return, so there +/// is no error case that needs to be handled. +#[inline] +pub fn getpid() -> Pid { + Pid(unsafe { libc::getpid() }) +} + +/// Get the pid of this processes' parent (see +/// [getpid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getppid.html)). +/// +/// There is always a parent pid to return, so there is no error case that needs +/// to be handled. +#[inline] +pub fn getppid() -> Pid { + Pid(unsafe { libc::getppid() }) // no error handling, according to man page: "These functions are always successful." +} + +/// Set a process group ID (see +/// [setpgid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setpgid.html)). +/// +/// Set the process group id (PGID) of a particular process. If a pid of zero +/// is specified, then the pid of the calling process is used. Process groups +/// may be used to group together a set of processes in order for the OS to +/// apply some operations across the group. +/// +/// `setsid()` may be used to create a new process group. +#[inline] +pub fn setpgid(pid: Pid, pgid: Pid) -> Result<()> { + let res = unsafe { libc::setpgid(pid.into(), pgid.into()) }; + Errno::result(res).map(drop) +} +#[inline] +pub fn getpgid(pid: Option) -> Result { + let res = unsafe { libc::getpgid(pid.unwrap_or(Pid(0)).into()) }; + Errno::result(res).map(Pid) +} + +/// Create new session and set process group id (see +/// [setsid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setsid.html)). +#[inline] +pub fn setsid() -> Result { + Errno::result(unsafe { libc::setsid() }).map(Pid) +} + +/// Get the process group ID of a session leader +/// [getsid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsid.html). +/// +/// Obtain the process group ID of the process that is the session leader of the process specified +/// by pid. If pid is zero, it specifies the calling process. +#[inline] +#[cfg(not(target_os = "redox"))] +pub fn getsid(pid: Option) -> Result { + let res = unsafe { libc::getsid(pid.unwrap_or(Pid(0)).into()) }; + Errno::result(res).map(Pid) +} + + +/// Get the terminal foreground process group (see +/// [tcgetpgrp(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetpgrp.html)). +/// +/// Get the group process id (GPID) of the foreground process group on the +/// terminal associated to file descriptor (FD). +#[inline] +pub fn tcgetpgrp(fd: c_int) -> Result { + let res = unsafe { libc::tcgetpgrp(fd) }; + Errno::result(res).map(Pid) +} +/// Set the terminal foreground process group (see +/// [tcgetpgrp(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetpgrp.html)). +/// +/// Get the group process id (PGID) to the foreground process group on the +/// terminal associated to file descriptor (FD). +#[inline] +pub fn tcsetpgrp(fd: c_int, pgrp: Pid) -> Result<()> { + let res = unsafe { libc::tcsetpgrp(fd, pgrp.into()) }; + Errno::result(res).map(drop) +} + + +/// Get the group id of the calling process (see +///[getpgrp(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpgrp.html)). +/// +/// Get the process group id (PGID) of the calling process. +/// According to the man page it is always successful. +#[inline] +pub fn getpgrp() -> Pid { + Pid(unsafe { libc::getpgrp() }) +} + +/// Get the caller's thread ID (see +/// [gettid(2)](https://man7.org/linux/man-pages/man2/gettid.2.html). +/// +/// This function is only available on Linux based systems. In a single +/// threaded process, the main thread will have the same ID as the process. In +/// a multithreaded process, each thread will have a unique thread id but the +/// same process ID. +/// +/// No error handling is required as a thread id should always exist for any +/// process, even if threads are not being used. +#[cfg(any(target_os = "linux", target_os = "android"))] +#[inline] +pub fn gettid() -> Pid { + Pid(unsafe { libc::syscall(libc::SYS_gettid) as pid_t }) +} + +/// Create a copy of the specified file descriptor (see +/// [dup(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html)). +/// +/// The new file descriptor will be have a new index but refer to the same +/// resource as the old file descriptor and the old and new file descriptors may +/// be used interchangeably. The new and old file descriptor share the same +/// underlying resource, offset, and file status flags. The actual index used +/// for the file descriptor will be the lowest fd index that is available. +/// +/// The two file descriptors do not share file descriptor flags (e.g. `OFlag::FD_CLOEXEC`). +#[inline] +pub fn dup(oldfd: RawFd) -> Result { + let res = unsafe { libc::dup(oldfd) }; + + Errno::result(res) +} + +/// Create a copy of the specified file descriptor using the specified fd (see +/// [dup(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html)). +/// +/// This function behaves similar to `dup()` except that it will try to use the +/// specified fd instead of allocating a new one. See the man pages for more +/// detail on the exact behavior of this function. +#[inline] +pub fn dup2(oldfd: RawFd, newfd: RawFd) -> Result { + let res = unsafe { libc::dup2(oldfd, newfd) }; + + Errno::result(res) +} + +/// Create a new copy of the specified file descriptor using the specified fd +/// and flags (see [dup(2)](https://man7.org/linux/man-pages/man2/dup.2.html)). +/// +/// This function behaves similar to `dup2()` but allows for flags to be +/// specified. +pub fn dup3(oldfd: RawFd, newfd: RawFd, flags: OFlag) -> Result { + dup3_polyfill(oldfd, newfd, flags) +} + +#[inline] +fn dup3_polyfill(oldfd: RawFd, newfd: RawFd, flags: OFlag) -> Result { + if oldfd == newfd { + return Err(Errno::EINVAL); + } + + let fd = dup2(oldfd, newfd)?; + + if flags.contains(OFlag::O_CLOEXEC) { + if let Err(e) = fcntl(fd, F_SETFD(FdFlag::FD_CLOEXEC)) { + let _ = close(fd); + return Err(e); + } + } + + Ok(fd) +} + +/// Change the current working directory of the calling process (see +/// [chdir(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/chdir.html)). +/// +/// This function may fail in a number of different scenarios. See the man +/// pages for additional details on possible failure cases. +#[inline] +pub fn chdir(path: &P) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::chdir(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) +} + +/// Change the current working directory of the process to the one +/// given as an open file descriptor (see +/// [fchdir(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html)). +/// +/// This function may fail in a number of different scenarios. See the man +/// pages for additional details on possible failure cases. +#[inline] +#[cfg(not(target_os = "fuchsia"))] +pub fn fchdir(dirfd: RawFd) -> Result<()> { + let res = unsafe { libc::fchdir(dirfd) }; + + Errno::result(res).map(drop) +} + +/// Creates new directory `path` with access rights `mode`. (see [mkdir(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdir.html)) +/// +/// # Errors +/// +/// There are several situations where mkdir might fail: +/// +/// - current user has insufficient rights in the parent directory +/// - the path already exists +/// - the path name is too long (longer than `PATH_MAX`, usually 4096 on linux, 1024 on OS X) +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// use nix::sys::stat; +/// use tempfile::tempdir; +/// +/// let tmp_dir1 = tempdir().unwrap(); +/// let tmp_dir2 = tmp_dir1.path().join("new_dir"); +/// +/// // create new directory and give read, write and execute rights to the owner +/// match unistd::mkdir(&tmp_dir2, stat::Mode::S_IRWXU) { +/// Ok(_) => println!("created {:?}", tmp_dir2), +/// Err(err) => println!("Error creating directory: {}", err), +/// } +/// ``` +#[inline] +pub fn mkdir(path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::mkdir(cstr.as_ptr(), mode.bits() as mode_t) } + })?; + + Errno::result(res).map(drop) +} + +/// Creates new fifo special file (named pipe) with path `path` and access rights `mode`. +/// +/// # Errors +/// +/// There are several situations where mkfifo might fail: +/// +/// - current user has insufficient rights in the parent directory +/// - the path already exists +/// - the path name is too long (longer than `PATH_MAX`, usually 4096 on linux, 1024 on OS X) +/// +/// For a full list consult +/// [posix specification](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifo.html) +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// use nix::sys::stat; +/// use tempfile::tempdir; +/// +/// let tmp_dir = tempdir().unwrap(); +/// let fifo_path = tmp_dir.path().join("foo.pipe"); +/// +/// // create new fifo and give read, write and execute rights to the owner +/// match unistd::mkfifo(&fifo_path, stat::Mode::S_IRWXU) { +/// Ok(_) => println!("created {:?}", fifo_path), +/// Err(err) => println!("Error creating fifo: {}", err), +/// } +/// ``` +#[inline] +#[cfg(not(target_os = "redox"))] // RedoxFS does not support fifo yet +pub fn mkfifo(path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::mkfifo(cstr.as_ptr(), mode.bits() as mode_t) } + })?; + + Errno::result(res).map(drop) +} + +/// Creates new fifo special file (named pipe) with path `path` and access rights `mode`. +/// +/// If `dirfd` has a value, then `path` is relative to directory associated with the file descriptor. +/// +/// If `dirfd` is `None`, then `path` is relative to the current working directory. +/// +/// # References +/// +/// [mkfifoat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifoat.html). +// mkfifoat is not implemented in OSX or android +#[inline] +#[cfg(not(any( + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] +pub fn mkfifoat(dirfd: Option, path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| unsafe { + libc::mkfifoat(at_rawfd(dirfd), cstr.as_ptr(), mode.bits() as mode_t) + })?; + + Errno::result(res).map(drop) +} + +/// Creates a symbolic link at `path2` which points to `path1`. +/// +/// If `dirfd` has a value, then `path2` is relative to directory associated +/// with the file descriptor. +/// +/// If `dirfd` is `None`, then `path2` is relative to the current working +/// directory. This is identical to `libc::symlink(path1, path2)`. +/// +/// See also [symlinkat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/symlinkat.html). +#[cfg(not(target_os = "redox"))] +pub fn symlinkat( + path1: &P1, + dirfd: Option, + path2: &P2) -> Result<()> { + let res = + path1.with_nix_path(|path1| { + path2.with_nix_path(|path2| { + unsafe { + libc::symlinkat( + path1.as_ptr(), + dirfd.unwrap_or(libc::AT_FDCWD), + path2.as_ptr() + ) + } + }) + })??; + Errno::result(res).map(drop) +} + +// Double the buffer capacity up to limit. In case it already has +// reached the limit, return Errno::ERANGE. +fn reserve_double_buffer_size(buf: &mut Vec, limit: usize) -> Result<()> { + use std::cmp::min; + + if buf.capacity() >= limit { + return Err(Errno::ERANGE) + } + + let capacity = min(buf.capacity() * 2, limit); + buf.reserve(capacity); + + Ok(()) +} + +/// Returns the current directory as a `PathBuf` +/// +/// Err is returned if the current user doesn't have the permission to read or search a component +/// of the current path. +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// +/// // assume that we are allowed to get current directory +/// let dir = unistd::getcwd().unwrap(); +/// println!("The current directory is {:?}", dir); +/// ``` +#[inline] +pub fn getcwd() -> Result { + let mut buf = Vec::with_capacity(512); + loop { + unsafe { + let ptr = buf.as_mut_ptr() as *mut c_char; + + // The buffer must be large enough to store the absolute pathname plus + // a terminating null byte, or else null is returned. + // To safely handle this we start with a reasonable size (512 bytes) + // and double the buffer size upon every error + if !libc::getcwd(ptr, buf.capacity()).is_null() { + let len = CStr::from_ptr(buf.as_ptr() as *const c_char).to_bytes().len(); + buf.set_len(len); + buf.shrink_to_fit(); + return Ok(PathBuf::from(OsString::from_vec(buf))); + } else { + let error = Errno::last(); + // ERANGE means buffer was too small to store directory name + if error != Errno::ERANGE { + return Err(error); + } + } + + // Trigger the internal buffer resizing logic. + reserve_double_buffer_size(&mut buf, PATH_MAX as usize)?; + } + } +} + +/// Computes the raw UID and GID values to pass to a `*chown` call. +// The cast is not unnecessary on all platforms. +#[allow(clippy::unnecessary_cast)] +fn chown_raw_ids(owner: Option, group: Option) -> (libc::uid_t, libc::gid_t) { + // According to the POSIX specification, -1 is used to indicate that owner and group + // are not to be changed. Since uid_t and gid_t are unsigned types, we have to wrap + // around to get -1. + let uid = owner.map(Into::into) + .unwrap_or_else(|| (0 as uid_t).wrapping_sub(1)); + let gid = group.map(Into::into) + .unwrap_or_else(|| (0 as gid_t).wrapping_sub(1)); + (uid, gid) +} + +/// Change the ownership of the file at `path` to be owned by the specified +/// `owner` (user) and `group` (see +/// [chown(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html)). +/// +/// The owner/group for the provided path name will not be modified if `None` is +/// provided for that argument. Ownership change will be attempted for the path +/// only if `Some` owner/group is provided. +#[inline] +pub fn chown(path: &P, owner: Option, group: Option) -> Result<()> { + let res = path.with_nix_path(|cstr| { + let (uid, gid) = chown_raw_ids(owner, group); + unsafe { libc::chown(cstr.as_ptr(), uid, gid) } + })?; + + Errno::result(res).map(drop) +} + +/// Change the ownership of the file referred to by the open file descriptor `fd` to be owned by +/// the specified `owner` (user) and `group` (see +/// [fchown(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchown.html)). +/// +/// The owner/group for the provided file will not be modified if `None` is +/// provided for that argument. Ownership change will be attempted for the path +/// only if `Some` owner/group is provided. +#[inline] +pub fn fchown(fd: RawFd, owner: Option, group: Option) -> Result<()> { + let (uid, gid) = chown_raw_ids(owner, group); + let res = unsafe { libc::fchown(fd, uid, gid) }; + Errno::result(res).map(drop) +} + +/// Flags for `fchownat` function. +#[derive(Clone, Copy, Debug)] +pub enum FchownatFlags { + FollowSymlink, + NoFollowSymlink, +} + +/// Change the ownership of the file at `path` to be owned by the specified +/// `owner` (user) and `group`. +/// +/// The owner/group for the provided path name will not be modified if `None` is +/// provided for that argument. Ownership change will be attempted for the path +/// only if `Some` owner/group is provided. +/// +/// The file to be changed is determined relative to the directory associated +/// with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. +/// +/// If `flag` is `FchownatFlags::NoFollowSymlink` and `path` names a symbolic link, +/// then the mode of the symbolic link is changed. +/// +/// `fchownat(None, path, mode, FchownatFlags::NoFollowSymlink)` is identical to +/// a call `libc::lchown(path, mode)`. That's why `lchmod` is unimplemented in +/// the `nix` crate. +/// +/// # References +/// +/// [fchownat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchownat.html). +#[cfg(not(target_os = "redox"))] +pub fn fchownat( + dirfd: Option, + path: &P, + owner: Option, + group: Option, + flag: FchownatFlags, +) -> Result<()> { + let atflag = + match flag { + FchownatFlags::FollowSymlink => AtFlags::empty(), + FchownatFlags::NoFollowSymlink => AtFlags::AT_SYMLINK_NOFOLLOW, + }; + let res = path.with_nix_path(|cstr| unsafe { + let (uid, gid) = chown_raw_ids(owner, group); + libc::fchownat(at_rawfd(dirfd), cstr.as_ptr(), uid, gid, + atflag.bits() as libc::c_int) + })?; + + Errno::result(res).map(drop) +} + +fn to_exec_array>(args: &[S]) -> Vec<*const c_char> { + use std::iter::once; + args.iter().map(|s| s.as_ref().as_ptr()).chain(once(ptr::null())).collect() +} + +/// Replace the current process image with a new one (see +/// [exec(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html)). +/// +/// See the `::nix::unistd::execve` system call for additional details. `execv` +/// performs the same action but does not allow for customization of the +/// environment for the new process. +#[inline] +pub fn execv>(path: &CStr, argv: &[S]) -> Result { + let args_p = to_exec_array(argv); + + unsafe { + libc::execv(path.as_ptr(), args_p.as_ptr()) + }; + + Err(Errno::last()) +} + + +/// Replace the current process image with a new one (see +/// [execve(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html)). +/// +/// The execve system call allows for another process to be "called" which will +/// replace the current process image. That is, this process becomes the new +/// command that is run. On success, this function will not return. Instead, +/// the new program will run until it exits. +/// +/// `::nix::unistd::execv` and `::nix::unistd::execve` take as arguments a slice +/// of `::std::ffi::CString`s for `args` and `env` (for `execve`). Each element +/// in the `args` list is an argument to the new process. Each element in the +/// `env` list should be a string in the form "key=value". +#[inline] +pub fn execve, SE: AsRef>(path: &CStr, args: &[SA], env: &[SE]) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::execve(path.as_ptr(), args_p.as_ptr(), env_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Replace the current process image with a new one and replicate shell `PATH` +/// searching behavior (see +/// [exec(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html)). +/// +/// See `::nix::unistd::execve` for additional details. `execvp` behaves the +/// same as execv except that it will examine the `PATH` environment variables +/// for file names not specified with a leading slash. For example, `execv` +/// would not work if "bash" was specified for the path argument, but `execvp` +/// would assuming that a bash executable was on the system `PATH`. +#[inline] +pub fn execvp>(filename: &CStr, args: &[S]) -> Result { + let args_p = to_exec_array(args); + + unsafe { + libc::execvp(filename.as_ptr(), args_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Replace the current process image with a new one and replicate shell `PATH` +/// searching behavior (see +/// [`execvpe(3)`](https://man7.org/linux/man-pages/man3/exec.3.html)). +/// +/// This functions like a combination of `execvp(2)` and `execve(2)` to pass an +/// environment and have a search path. See these two for additional +/// information. +#[cfg(any(target_os = "haiku", + target_os = "linux", + target_os = "openbsd"))] +pub fn execvpe, SE: AsRef>(filename: &CStr, args: &[SA], env: &[SE]) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::execvpe(filename.as_ptr(), args_p.as_ptr(), env_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Replace the current process image with a new one (see +/// [fexecve(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fexecve.html)). +/// +/// The `fexecve` function allows for another process to be "called" which will +/// replace the current process image. That is, this process becomes the new +/// command that is run. On success, this function will not return. Instead, +/// the new program will run until it exits. +/// +/// This function is similar to `execve`, except that the program to be executed +/// is referenced as a file descriptor instead of a path. +// Note for NetBSD and OpenBSD: although rust-lang/libc includes it (under +// unix/bsd/netbsdlike/) fexecve is not currently implemented on NetBSD nor on +// OpenBSD. +#[cfg(any(target_os = "android", + target_os = "linux", + target_os = "freebsd"))] +#[inline] +pub fn fexecve ,SE: AsRef>(fd: RawFd, args: &[SA], env: &[SE]) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::fexecve(fd, args_p.as_ptr(), env_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Execute program relative to a directory file descriptor (see +/// [execveat(2)](https://man7.org/linux/man-pages/man2/execveat.2.html)). +/// +/// The `execveat` function allows for another process to be "called" which will +/// replace the current process image. That is, this process becomes the new +/// command that is run. On success, this function will not return. Instead, +/// the new program will run until it exits. +/// +/// This function is similar to `execve`, except that the program to be executed +/// is referenced as a file descriptor to the base directory plus a path. +#[cfg(any(target_os = "android", target_os = "linux"))] +#[inline] +pub fn execveat,SE: AsRef>(dirfd: RawFd, pathname: &CStr, args: &[SA], + env: &[SE], flags: super::fcntl::AtFlags) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::syscall(libc::SYS_execveat, dirfd, pathname.as_ptr(), + args_p.as_ptr(), env_p.as_ptr(), flags); + }; + + Err(Errno::last()) +} + +/// Daemonize this process by detaching from the controlling terminal (see +/// [daemon(3)](https://man7.org/linux/man-pages/man3/daemon.3.html)). +/// +/// When a process is launched it is typically associated with a parent and it, +/// in turn, by its controlling terminal/process. In order for a process to run +/// in the "background" it must daemonize itself by detaching itself. Under +/// posix, this is done by doing the following: +/// +/// 1. Parent process (this one) forks +/// 2. Parent process exits +/// 3. Child process continues to run. +/// +/// `nochdir`: +/// +/// * `nochdir = true`: The current working directory after daemonizing will +/// be the current working directory. +/// * `nochdir = false`: The current working directory after daemonizing will +/// be the root direcory, `/`. +/// +/// `noclose`: +/// +/// * `noclose = true`: The process' current stdin, stdout, and stderr file +/// descriptors will remain identical after daemonizing. +/// * `noclose = false`: The process' stdin, stdout, and stderr will point to +/// `/dev/null` after daemonizing. +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] +pub fn daemon(nochdir: bool, noclose: bool) -> Result<()> { + let res = unsafe { libc::daemon(nochdir as c_int, noclose as c_int) }; + Errno::result(res).map(drop) +} + +/// Set the system host name (see +/// [sethostname(2)](https://man7.org/linux/man-pages/man2/gethostname.2.html)). +/// +/// Given a name, attempt to update the system host name to the given string. +/// On some systems, the host name is limited to as few as 64 bytes. An error +/// will be return if the name is not valid or the current process does not have +/// permissions to update the host name. +#[cfg(not(target_os = "redox"))] +pub fn sethostname>(name: S) -> Result<()> { + // Handle some differences in type of the len arg across platforms. + cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "solaris", ))] { + type sethostname_len_t = c_int; + } else { + type sethostname_len_t = size_t; + } + } + let ptr = name.as_ref().as_bytes().as_ptr() as *const c_char; + let len = name.as_ref().len() as sethostname_len_t; + + let res = unsafe { libc::sethostname(ptr, len) }; + Errno::result(res).map(drop) +} + +/// Get the host name and store it in the provided buffer, returning a pointer +/// the `CStr` in that buffer on success (see +/// [gethostname(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostname.html)). +/// +/// This function call attempts to get the host name for the running system and +/// store it in a provided buffer. The buffer will be populated with bytes up +/// to the length of the provided slice including a NUL terminating byte. If +/// the hostname is longer than the length provided, no error will be provided. +/// The posix specification does not specify whether implementations will +/// null-terminate in this case, but the nix implementation will ensure that the +/// buffer is null terminated in this case. +/// +/// ```no_run +/// use nix::unistd; +/// +/// let mut buf = [0u8; 64]; +/// let hostname_cstr = unistd::gethostname(&mut buf).expect("Failed getting hostname"); +/// let hostname = hostname_cstr.to_str().expect("Hostname wasn't valid UTF-8"); +/// println!("Hostname: {}", hostname); +/// ``` +pub fn gethostname(buffer: &mut [u8]) -> Result<&CStr> { + let ptr = buffer.as_mut_ptr() as *mut c_char; + let len = buffer.len() as size_t; + + let res = unsafe { libc::gethostname(ptr, len) }; + Errno::result(res).map(|_| { + buffer[len - 1] = 0; // ensure always null-terminated + unsafe { CStr::from_ptr(buffer.as_ptr() as *const c_char) } + }) +} + +/// Close a raw file descriptor +/// +/// Be aware that many Rust types implicitly close-on-drop, including +/// `std::fs::File`. Explicitly closing them with this method too can result in +/// a double-close condition, which can cause confusing `EBADF` errors in +/// seemingly unrelated code. Caveat programmer. See also +/// [close(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html). +/// +/// # Examples +/// +/// ```no_run +/// use std::os::unix::io::AsRawFd; +/// use nix::unistd::close; +/// +/// let f = tempfile::tempfile().unwrap(); +/// close(f.as_raw_fd()).unwrap(); // Bad! f will also close on drop! +/// ``` +/// +/// ```rust +/// use std::os::unix::io::IntoRawFd; +/// use nix::unistd::close; +/// +/// let f = tempfile::tempfile().unwrap(); +/// close(f.into_raw_fd()).unwrap(); // Good. into_raw_fd consumes f +/// ``` +pub fn close(fd: RawFd) -> Result<()> { + let res = unsafe { libc::close(fd) }; + Errno::result(res).map(drop) +} + +/// Read from a raw file descriptor. +/// +/// See also [read(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html) +pub fn read(fd: RawFd, buf: &mut [u8]) -> Result { + let res = unsafe { libc::read(fd, buf.as_mut_ptr() as *mut c_void, buf.len() as size_t) }; + + Errno::result(res).map(|r| r as usize) +} + +/// Write to a raw file descriptor. +/// +/// See also [write(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html) +pub fn write(fd: RawFd, buf: &[u8]) -> Result { + let res = unsafe { libc::write(fd, buf.as_ptr() as *const c_void, buf.len() as size_t) }; + + Errno::result(res).map(|r| r as usize) +} + +/// Directive that tells [`lseek`] and [`lseek64`] what the offset is relative to. +/// +/// [`lseek`]: ./fn.lseek.html +/// [`lseek64`]: ./fn.lseek64.html +#[repr(i32)] +#[derive(Clone, Copy, Debug)] +pub enum Whence { + /// Specify an offset relative to the start of the file. + SeekSet = libc::SEEK_SET, + /// Specify an offset relative to the current file location. + SeekCur = libc::SEEK_CUR, + /// Specify an offset relative to the end of the file. + SeekEnd = libc::SEEK_END, + /// Specify an offset relative to the next location in the file greater than or + /// equal to offset that contains some data. If offset points to + /// some data, then the file offset is set to offset. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "solaris"))] + SeekData = libc::SEEK_DATA, + /// Specify an offset relative to the next hole in the file greater than + /// or equal to offset. If offset points into the middle of a hole, then + /// the file offset should be set to offset. If there is no hole past offset, + /// then the file offset should be adjusted to the end of the file (i.e., there + /// is an implicit hole at the end of any file). + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "solaris"))] + SeekHole = libc::SEEK_HOLE +} + +/// Move the read/write file offset. +/// +/// See also [lseek(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html) +pub fn lseek(fd: RawFd, offset: off_t, whence: Whence) -> Result { + let res = unsafe { libc::lseek(fd, offset, whence as i32) }; + + Errno::result(res).map(|r| r as off_t) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn lseek64(fd: RawFd, offset: libc::off64_t, whence: Whence) -> Result { + let res = unsafe { libc::lseek64(fd, offset, whence as i32) }; + + Errno::result(res).map(|r| r as libc::off64_t) +} + +/// Create an interprocess channel. +/// +/// See also [pipe(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pipe.html) +pub fn pipe() -> std::result::Result<(RawFd, RawFd), Error> { + unsafe { + let mut fds = mem::MaybeUninit::<[c_int; 2]>::uninit(); + + let res = libc::pipe(fds.as_mut_ptr() as *mut c_int); + + Error::result(res)?; + + Ok((fds.assume_init()[0], fds.assume_init()[1])) + } +} + +/// Like `pipe`, but allows setting certain file descriptor flags. +/// +/// The following flags are supported, and will be set atomically as the pipe is +/// created: +/// +/// - `O_CLOEXEC`: Set the close-on-exec flag for the new file descriptors. +#[cfg_attr(target_os = "linux", doc = "- `O_DIRECT`: Create a pipe that performs I/O in \"packet\" mode.")] +#[cfg_attr(target_os = "netbsd", doc = "- `O_NOSIGPIPE`: Return `EPIPE` instead of raising `SIGPIPE`.")] +/// - `O_NONBLOCK`: Set the non-blocking flag for the ends of the pipe. +/// +/// See also [pipe(2)](https://man7.org/linux/man-pages/man2/pipe.2.html) +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "redox", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] +pub fn pipe2(flags: OFlag) -> Result<(RawFd, RawFd)> { + let mut fds = mem::MaybeUninit::<[c_int; 2]>::uninit(); + + let res = unsafe { + libc::pipe2(fds.as_mut_ptr() as *mut c_int, flags.bits()) + }; + + Errno::result(res)?; + + unsafe { Ok((fds.assume_init()[0], fds.assume_init()[1])) } +} + +/// Truncate a file to a specified length +/// +/// See also +/// [truncate(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html) +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +pub fn truncate(path: &P, len: off_t) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::truncate(cstr.as_ptr(), len) + } + })?; + + Errno::result(res).map(drop) +} + +/// Truncate a file to a specified length +/// +/// See also +/// [ftruncate(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html) +pub fn ftruncate(fd: RawFd, len: off_t) -> Result<()> { + Errno::result(unsafe { libc::ftruncate(fd, len) }).map(drop) +} + +pub fn isatty(fd: RawFd) -> Result { + unsafe { + // ENOTTY means `fd` is a valid file descriptor, but not a TTY, so + // we return `Ok(false)` + if libc::isatty(fd) == 1 { + Ok(true) + } else { + match Errno::last() { + Errno::ENOTTY => Ok(false), + err => Err(err), + } + } + } +} + +/// Flags for `linkat` function. +#[derive(Clone, Copy, Debug)] +pub enum LinkatFlags { + SymlinkFollow, + NoSymlinkFollow, +} + +/// Link one file to another file +/// +/// Creates a new link (directory entry) at `newpath` for the existing file at `oldpath`. In the +/// case of a relative `oldpath`, the path is interpreted relative to the directory associated +/// with file descriptor `olddirfd` instead of the current working directory and similiarly for +/// `newpath` and file descriptor `newdirfd`. In case `flag` is LinkatFlags::SymlinkFollow and +/// `oldpath` names a symoblic link, a new link for the target of the symbolic link is created. +/// If either `olddirfd` or `newdirfd` is `None`, `AT_FDCWD` is used respectively where `oldpath` +/// and/or `newpath` is then interpreted relative to the current working directory of the calling +/// process. If either `oldpath` or `newpath` is absolute, then `dirfd` is ignored. +/// +/// # References +/// See also [linkat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html) +#[cfg(not(target_os = "redox"))] // RedoxFS does not support symlinks yet +pub fn linkat( + olddirfd: Option, + oldpath: &P, + newdirfd: Option, + newpath: &P, + flag: LinkatFlags, +) -> Result<()> { + + let atflag = + match flag { + LinkatFlags::SymlinkFollow => AtFlags::AT_SYMLINK_FOLLOW, + LinkatFlags::NoSymlinkFollow => AtFlags::empty(), + }; + + let res = + oldpath.with_nix_path(|oldcstr| { + newpath.with_nix_path(|newcstr| { + unsafe { + libc::linkat( + at_rawfd(olddirfd), + oldcstr.as_ptr(), + at_rawfd(newdirfd), + newcstr.as_ptr(), + atflag.bits() as libc::c_int + ) + } + }) + })??; + Errno::result(res).map(drop) +} + + +/// Remove a directory entry +/// +/// See also [unlink(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html) +pub fn unlink(path: &P) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::unlink(cstr.as_ptr()) + } + })?; + Errno::result(res).map(drop) +} + +/// Flags for `unlinkat` function. +#[derive(Clone, Copy, Debug)] +pub enum UnlinkatFlags { + RemoveDir, + NoRemoveDir, +} + +/// Remove a directory entry +/// +/// In the case of a relative path, the directory entry to be removed is determined relative to +/// the directory associated with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. In the case of an absolute `path` `dirfd` is ignored. If `flag` is +/// `UnlinkatFlags::RemoveDir` then removal of the directory entry specified by `dirfd` and `path` +/// is performed. +/// +/// # References +/// See also [unlinkat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html) +#[cfg(not(target_os = "redox"))] +pub fn unlinkat( + dirfd: Option, + path: &P, + flag: UnlinkatFlags, +) -> Result<()> { + let atflag = + match flag { + UnlinkatFlags::RemoveDir => AtFlags::AT_REMOVEDIR, + UnlinkatFlags::NoRemoveDir => AtFlags::empty(), + }; + let res = path.with_nix_path(|cstr| { + unsafe { + libc::unlinkat(at_rawfd(dirfd), cstr.as_ptr(), atflag.bits() as libc::c_int) + } + })?; + Errno::result(res).map(drop) +} + + +#[inline] +#[cfg(not(target_os = "fuchsia"))] +pub fn chroot(path: &P) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::chroot(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) +} + +/// Commit filesystem caches to disk +/// +/// See also [sync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sync.html) +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd" +))] +pub fn sync() { + unsafe { libc::sync() }; +} + +/// Synchronize changes to a file +/// +/// See also [fsync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html) +#[inline] +pub fn fsync(fd: RawFd) -> Result<()> { + let res = unsafe { libc::fsync(fd) }; + + Errno::result(res).map(drop) +} + +/// Synchronize the data of a file +/// +/// See also +/// [fdatasync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html) +// `fdatasync(2) is in POSIX, but in libc it is only defined in `libc::notbsd`. +// TODO: exclude only Apple systems after https://github.com/rust-lang/libc/pull/211 +#[cfg(any(target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "illumos", + target_os = "solaris"))] +#[inline] +pub fn fdatasync(fd: RawFd) -> Result<()> { + let res = unsafe { libc::fdatasync(fd) }; + + Errno::result(res).map(drop) +} + +/// Get a real user ID +/// +/// See also [getuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getuid.html) +// POSIX requires that getuid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn getuid() -> Uid { + Uid(unsafe { libc::getuid() }) +} + +/// Get the effective user ID +/// +/// See also [geteuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/geteuid.html) +// POSIX requires that geteuid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn geteuid() -> Uid { + Uid(unsafe { libc::geteuid() }) +} + +/// Get the real group ID +/// +/// See also [getgid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getgid.html) +// POSIX requires that getgid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn getgid() -> Gid { + Gid(unsafe { libc::getgid() }) +} + +/// Get the effective group ID +/// +/// See also [getegid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getegid.html) +// POSIX requires that getegid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn getegid() -> Gid { + Gid(unsafe { libc::getegid() }) +} + +/// Set the effective user ID +/// +/// See also [seteuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/seteuid.html) +#[inline] +pub fn seteuid(euid: Uid) -> Result<()> { + let res = unsafe { libc::seteuid(euid.into()) }; + + Errno::result(res).map(drop) +} + +/// Set the effective group ID +/// +/// See also [setegid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setegid.html) +#[inline] +pub fn setegid(egid: Gid) -> Result<()> { + let res = unsafe { libc::setegid(egid.into()) }; + + Errno::result(res).map(drop) +} + +/// Set the user ID +/// +/// See also [setuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setuid.html) +#[inline] +pub fn setuid(uid: Uid) -> Result<()> { + let res = unsafe { libc::setuid(uid.into()) }; + + Errno::result(res).map(drop) +} + +/// Set the group ID +/// +/// See also [setgid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setgid.html) +#[inline] +pub fn setgid(gid: Gid) -> Result<()> { + let res = unsafe { libc::setgid(gid.into()) }; + + Errno::result(res).map(drop) +} + +/// Set the user identity used for filesystem checks per-thread. +/// On both success and failure, this call returns the previous filesystem user +/// ID of the caller. +/// +/// See also [setfsuid(2)](https://man7.org/linux/man-pages/man2/setfsuid.2.html) +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn setfsuid(uid: Uid) -> Uid { + let prev_fsuid = unsafe { libc::setfsuid(uid.into()) }; + Uid::from_raw(prev_fsuid as uid_t) +} + +/// Set the group identity used for filesystem checks per-thread. +/// On both success and failure, this call returns the previous filesystem group +/// ID of the caller. +/// +/// See also [setfsgid(2)](https://man7.org/linux/man-pages/man2/setfsgid.2.html) +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn setfsgid(gid: Gid) -> Gid { + let prev_fsgid = unsafe { libc::setfsgid(gid.into()) }; + Gid::from_raw(prev_fsgid as gid_t) +} + +/// Get the list of supplementary group IDs of the calling process. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/009695399/functions/getgroups.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, checking group membership should be achieved via communication +/// with the `opendirectoryd` service. +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +pub fn getgroups() -> Result> { + // First get the maximum number of groups. The value returned + // shall always be greater than or equal to one and less than or + // equal to the value of {NGROUPS_MAX} + 1. + let ngroups_max = match sysconf(SysconfVar::NGROUPS_MAX) { + Ok(Some(n)) => (n + 1) as usize, + Ok(None) | Err(_) => ::max_value(), + }; + + // Next, get the number of groups so we can size our Vec + let ngroups = unsafe { libc::getgroups(0, ptr::null_mut()) }; + + // If there are no supplementary groups, return early. + // This prevents a potential buffer over-read if the number of groups + // increases from zero before the next call. It would return the total + // number of groups beyond the capacity of the buffer. + if ngroups == 0 { + return Ok(Vec::new()); + } + + // Now actually get the groups. We try multiple times in case the number of + // groups has changed since the first call to getgroups() and the buffer is + // now too small. + let mut groups = Vec::::with_capacity(Errno::result(ngroups)? as usize); + loop { + // FIXME: On the platforms we currently support, the `Gid` struct has + // the same representation in memory as a bare `gid_t`. This is not + // necessarily the case on all Rust platforms, though. See RFC 1785. + let ngroups = unsafe { + libc::getgroups(groups.capacity() as c_int, groups.as_mut_ptr() as *mut gid_t) + }; + + match Errno::result(ngroups) { + Ok(s) => { + unsafe { groups.set_len(s as usize) }; + return Ok(groups); + }, + Err(Errno::EINVAL) => { + // EINVAL indicates that the buffer size was too + // small, resize it up to ngroups_max as limit. + reserve_double_buffer_size(&mut groups, ngroups_max) + .or(Err(Errno::EINVAL))?; + }, + Err(e) => return Err(e) + } + } +} + +/// Set the list of supplementary group IDs for the calling process. +/// +/// [Further reading](https://man7.org/linux/man-pages/man2/getgroups.2.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, group membership management should be achieved via communication +/// with the `opendirectoryd` service. +/// +/// # Examples +/// +/// `setgroups` can be used when dropping privileges from the root user to a +/// specific user and group. For example, given the user `www-data` with UID +/// `33` and the group `backup` with the GID `34`, one could switch the user as +/// follows: +/// +/// ```rust,no_run +/// # use std::error::Error; +/// # use nix::unistd::*; +/// # +/// # fn try_main() -> Result<(), Box> { +/// let uid = Uid::from_raw(33); +/// let gid = Gid::from_raw(34); +/// setgroups(&[gid])?; +/// setgid(gid)?; +/// setuid(uid)?; +/// # +/// # Ok(()) +/// # } +/// # +/// # try_main().unwrap(); +/// ``` +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] +pub fn setgroups(groups: &[Gid]) -> Result<()> { + cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] { + type setgroups_ngroups_t = c_int; + } else { + type setgroups_ngroups_t = size_t; + } + } + // FIXME: On the platforms we currently support, the `Gid` struct has the + // same representation in memory as a bare `gid_t`. This is not necessarily + // the case on all Rust platforms, though. See RFC 1785. + let res = unsafe { + libc::setgroups(groups.len() as setgroups_ngroups_t, groups.as_ptr() as *const gid_t) + }; + + Errno::result(res).map(drop) +} + +/// Calculate the supplementary group access list. +/// +/// Gets the group IDs of all groups that `user` is a member of. The additional +/// group `group` is also added to the list. +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/getgrouplist.3.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, checking group membership should be achieved via communication +/// with the `opendirectoryd` service. +/// +/// # Errors +/// +/// Although the `getgrouplist()` call does not return any specific +/// errors on any known platforms, this implementation will return a system +/// error of `EINVAL` if the number of groups to be fetched exceeds the +/// `NGROUPS_MAX` sysconf value. This mimics the behaviour of `getgroups()` +/// and `setgroups()`. Additionally, while some implementations will return a +/// partial list of groups when `NGROUPS_MAX` is exceeded, this implementation +/// will only ever return the complete list or else an error. +#[cfg(not(any(target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "redox")))] +pub fn getgrouplist(user: &CStr, group: Gid) -> Result> { + let ngroups_max = match sysconf(SysconfVar::NGROUPS_MAX) { + Ok(Some(n)) => n as c_int, + Ok(None) | Err(_) => ::max_value(), + }; + use std::cmp::min; + let mut groups = Vec::::with_capacity(min(ngroups_max, 8) as usize); + cfg_if! { + if #[cfg(any(target_os = "ios", target_os = "macos"))] { + type getgrouplist_group_t = c_int; + } else { + type getgrouplist_group_t = gid_t; + } + } + let gid: gid_t = group.into(); + loop { + let mut ngroups = groups.capacity() as i32; + let ret = unsafe { + libc::getgrouplist(user.as_ptr(), + gid as getgrouplist_group_t, + groups.as_mut_ptr() as *mut getgrouplist_group_t, + &mut ngroups) + }; + + // BSD systems only return 0 or -1, Linux returns ngroups on success. + if ret >= 0 { + unsafe { groups.set_len(ngroups as usize) }; + return Ok(groups); + } else if ret == -1 { + // Returns -1 if ngroups is too small, but does not set errno. + // BSD systems will still fill the groups buffer with as many + // groups as possible, but Linux manpages do not mention this + // behavior. + reserve_double_buffer_size(&mut groups, ngroups_max as usize) + .map_err(|_| Errno::EINVAL)?; + } + } +} + +/// Initialize the supplementary group access list. +/// +/// Sets the supplementary group IDs for the calling process using all groups +/// that `user` is a member of. The additional group `group` is also added to +/// the list. +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/initgroups.3.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, group membership management should be achieved via communication +/// with the `opendirectoryd` service. +/// +/// # Examples +/// +/// `initgroups` can be used when dropping privileges from the root user to +/// another user. For example, given the user `www-data`, we could look up the +/// UID and GID for the user in the system's password database (usually found +/// in `/etc/passwd`). If the `www-data` user's UID and GID were `33` and `33`, +/// respectively, one could switch the user as follows: +/// +/// ```rust,no_run +/// # use std::error::Error; +/// # use std::ffi::CString; +/// # use nix::unistd::*; +/// # +/// # fn try_main() -> Result<(), Box> { +/// let user = CString::new("www-data").unwrap(); +/// let uid = Uid::from_raw(33); +/// let gid = Gid::from_raw(33); +/// initgroups(&user, gid)?; +/// setgid(gid)?; +/// setuid(uid)?; +/// # +/// # Ok(()) +/// # } +/// # +/// # try_main().unwrap(); +/// ``` +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] +pub fn initgroups(user: &CStr, group: Gid) -> Result<()> { + cfg_if! { + if #[cfg(any(target_os = "ios", target_os = "macos"))] { + type initgroups_group_t = c_int; + } else { + type initgroups_group_t = gid_t; + } + } + let gid: gid_t = group.into(); + let res = unsafe { libc::initgroups(user.as_ptr(), gid as initgroups_group_t) }; + + Errno::result(res).map(drop) +} + +/// Suspend the thread until a signal is received. +/// +/// See also [pause(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html). +#[inline] +#[cfg(not(target_os = "redox"))] +pub fn pause() { + unsafe { libc::pause() }; +} + +pub mod alarm { + //! Alarm signal scheduling. + //! + //! Scheduling an alarm will trigger a `SIGALRM` signal when the time has + //! elapsed, which has to be caught, because the default action for the + //! signal is to terminate the program. This signal also can't be ignored + //! because the system calls like `pause` will not be interrupted, see the + //! second example below. + //! + //! # Examples + //! + //! Canceling an alarm: + //! + //! ``` + //! use nix::unistd::alarm; + //! + //! // Set an alarm for 60 seconds from now. + //! alarm::set(60); + //! + //! // Cancel the above set alarm, which returns the number of seconds left + //! // of the previously set alarm. + //! assert_eq!(alarm::cancel(), Some(60)); + //! ``` + //! + //! Scheduling an alarm and waiting for the signal: + //! +#![cfg_attr(target_os = "redox", doc = " ```rust,ignore")] +#![cfg_attr(not(target_os = "redox"), doc = " ```rust")] + //! use std::time::{Duration, Instant}; + //! + //! use nix::unistd::{alarm, pause}; + //! use nix::sys::signal::*; + //! + //! // We need to setup an empty signal handler to catch the alarm signal, + //! // otherwise the program will be terminated once the signal is delivered. + //! extern fn signal_handler(_: nix::libc::c_int) { } + //! let sa = SigAction::new( + //! SigHandler::Handler(signal_handler), + //! SaFlags::SA_RESTART, + //! SigSet::empty() + //! ); + //! unsafe { + //! sigaction(Signal::SIGALRM, &sa); + //! } + //! + //! let start = Instant::now(); + //! + //! // Set an alarm for 1 second from now. + //! alarm::set(1); + //! + //! // Pause the process until the alarm signal is received. + //! let mut sigset = SigSet::empty(); + //! sigset.add(Signal::SIGALRM); + //! sigset.wait(); + //! + //! assert!(start.elapsed() >= Duration::from_secs(1)); + //! ``` + //! + //! # References + //! + //! See also [alarm(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/alarm.html). + + /// Schedule an alarm signal. + /// + /// This will cause the system to generate a `SIGALRM` signal for the + /// process after the specified number of seconds have elapsed. + /// + /// Returns the leftover time of a previously set alarm if there was one. + pub fn set(secs: libc::c_uint) -> Option { + assert!(secs != 0, "passing 0 to `alarm::set` is not allowed, to cancel an alarm use `alarm::cancel`"); + alarm(secs) + } + + /// Cancel an previously set alarm signal. + /// + /// Returns the leftover time of a previously set alarm if there was one. + pub fn cancel() -> Option { + alarm(0) + } + + fn alarm(secs: libc::c_uint) -> Option { + match unsafe { libc::alarm(secs) } { + 0 => None, + secs => Some(secs), + } + } +} + +/// Suspend execution for an interval of time +/// +/// See also [sleep(2)](https://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html#tag_03_705_05) +// Per POSIX, does not fail +#[inline] +pub fn sleep(seconds: c_uint) -> c_uint { + unsafe { libc::sleep(seconds) } +} + +#[cfg(not(target_os = "redox"))] +pub mod acct { + use crate::{Result, NixPath}; + use crate::errno::Errno; + use std::ptr; + + /// Enable process accounting + /// + /// See also [acct(2)](https://linux.die.net/man/2/acct) + pub fn enable(filename: &P) -> Result<()> { + let res = filename.with_nix_path(|cstr| { + unsafe { libc::acct(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) + } + + /// Disable process accounting + pub fn disable() -> Result<()> { + let res = unsafe { libc::acct(ptr::null()) }; + + Errno::result(res).map(drop) + } +} + +/// Creates a regular file which persists even after process termination +/// +/// * `template`: a path whose 6 rightmost characters must be X, e.g. `/tmp/tmpfile_XXXXXX` +/// * returns: tuple of file descriptor and filename +/// +/// Err is returned either if no temporary filename could be created or the template doesn't +/// end with XXXXXX +/// +/// See also [mkstemp(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkstemp.html) +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// +/// let _ = match unistd::mkstemp("/tmp/tempfile_XXXXXX") { +/// Ok((fd, path)) => { +/// unistd::unlink(path.as_path()).unwrap(); // flag file to be deleted at app termination +/// fd +/// } +/// Err(e) => panic!("mkstemp failed: {}", e) +/// }; +/// // do something with fd +/// ``` +#[inline] +pub fn mkstemp(template: &P) -> Result<(RawFd, PathBuf)> { + let mut path = template.with_nix_path(|path| {path.to_bytes_with_nul().to_owned()})?; + let p = path.as_mut_ptr() as *mut _; + let fd = unsafe { libc::mkstemp(p) }; + let last = path.pop(); // drop the trailing nul + debug_assert!(last == Some(b'\0')); + let pathname = OsString::from_vec(path); + Errno::result(fd)?; + Ok((fd, PathBuf::from(pathname))) +} + +/// Variable names for `pathconf` +/// +/// Nix uses the same naming convention for these variables as the +/// [getconf(1)](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html) utility. +/// That is, `PathconfVar` variables have the same name as the abstract +/// variables shown in the `pathconf(2)` man page. Usually, it's the same as +/// the C variable name without the leading `_PC_`. +/// +/// POSIX 1003.1-2008 standardizes all of these variables, but some OSes choose +/// not to implement variables that cannot change at runtime. +/// +/// # References +/// +/// - [pathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html) +/// - [limits.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) +/// - [unistd.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html) +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(i32)] +#[non_exhaustive] +pub enum PathconfVar { + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "linux", + target_os = "netbsd", target_os = "openbsd", target_os = "redox"))] + /// Minimum number of bits needed to represent, as a signed integer value, + /// the maximum size of a regular file allowed in the specified directory. + FILESIZEBITS = libc::_PC_FILESIZEBITS, + /// Maximum number of links to a single file. + LINK_MAX = libc::_PC_LINK_MAX, + /// Maximum number of bytes in a terminal canonical input line. + MAX_CANON = libc::_PC_MAX_CANON, + /// Minimum number of bytes for which space is available in a terminal input + /// queue; therefore, the maximum number of bytes a conforming application + /// may require to be typed as input before reading them. + MAX_INPUT = libc::_PC_MAX_INPUT, + /// Maximum number of bytes in a filename (not including the terminating + /// null of a filename string). + NAME_MAX = libc::_PC_NAME_MAX, + /// Maximum number of bytes the implementation will store as a pathname in a + /// user-supplied buffer of unspecified size, including the terminating null + /// character. Minimum number the implementation will accept as the maximum + /// number of bytes in a pathname. + PATH_MAX = libc::_PC_PATH_MAX, + /// Maximum number of bytes that is guaranteed to be atomic when writing to + /// a pipe. + PIPE_BUF = libc::_PC_PIPE_BUF, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "illumos", + target_os = "linux", target_os = "netbsd", target_os = "openbsd", + target_os = "redox", target_os = "solaris"))] + /// Symbolic links can be created. + POSIX2_SYMLINKS = libc::_PC_2_SYMLINKS, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + /// Minimum number of bytes of storage actually allocated for any portion of + /// a file. + POSIX_ALLOC_SIZE_MIN = libc::_PC_ALLOC_SIZE_MIN, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd"))] + /// Recommended increment for file transfer sizes between the + /// `POSIX_REC_MIN_XFER_SIZE` and `POSIX_REC_MAX_XFER_SIZE` values. + POSIX_REC_INCR_XFER_SIZE = libc::_PC_REC_INCR_XFER_SIZE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + /// Maximum recommended file transfer size. + POSIX_REC_MAX_XFER_SIZE = libc::_PC_REC_MAX_XFER_SIZE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + /// Minimum recommended file transfer size. + POSIX_REC_MIN_XFER_SIZE = libc::_PC_REC_MIN_XFER_SIZE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + /// Recommended file transfer buffer alignment. + POSIX_REC_XFER_ALIGN = libc::_PC_REC_XFER_ALIGN, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "netbsd", + target_os = "openbsd", target_os = "redox", target_os = "solaris"))] + /// Maximum number of bytes in a symbolic link. + SYMLINK_MAX = libc::_PC_SYMLINK_MAX, + /// The use of `chown` and `fchown` is restricted to a process with + /// appropriate privileges, and to changing the group ID of a file only to + /// the effective group ID of the process or to one of its supplementary + /// group IDs. + _POSIX_CHOWN_RESTRICTED = libc::_PC_CHOWN_RESTRICTED, + /// Pathname components longer than {NAME_MAX} generate an error. + _POSIX_NO_TRUNC = libc::_PC_NO_TRUNC, + /// This symbol shall be defined to be the value of a character that shall + /// disable terminal special character handling. + _POSIX_VDISABLE = libc::_PC_VDISABLE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "openbsd", + target_os = "redox", target_os = "solaris"))] + /// Asynchronous input or output operations may be performed for the + /// associated file. + _POSIX_ASYNC_IO = libc::_PC_ASYNC_IO, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "openbsd", + target_os = "redox", target_os = "solaris"))] + /// Prioritized input or output operations may be performed for the + /// associated file. + _POSIX_PRIO_IO = libc::_PC_PRIO_IO, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "netbsd", + target_os = "openbsd", target_os = "redox", target_os = "solaris"))] + /// Synchronized input or output operations may be performed for the + /// associated file. + _POSIX_SYNC_IO = libc::_PC_SYNC_IO, + #[cfg(any(target_os = "dragonfly", target_os = "openbsd"))] + /// The resolution in nanoseconds for all file timestamps. + _POSIX_TIMESTAMP_RESOLUTION = libc::_PC_TIMESTAMP_RESOLUTION +} + +/// Like `pathconf`, but works with file descriptors instead of paths (see +/// [fpathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html)) +/// +/// # Parameters +/// +/// - `fd`: The file descriptor whose variable should be interrogated +/// - `var`: The pathconf variable to lookup +/// +/// # Returns +/// +/// - `Ok(Some(x))`: the variable's limit (for limit variables) or its +/// implementation level (for option variables). Implementation levels are +/// usually a decimal-coded date, such as 200112 for POSIX 2001.12 +/// - `Ok(None)`: the variable has no limit (for limit variables) or is +/// unsupported (for option variables) +/// - `Err(x)`: an error occurred +pub fn fpathconf(fd: RawFd, var: PathconfVar) -> Result> { + let raw = unsafe { + Errno::clear(); + libc::fpathconf(fd, var as c_int) + }; + if raw == -1 { + if errno::errno() == 0 { + Ok(None) + } else { + Err(Errno::last()) + } + } else { + Ok(Some(raw)) + } +} + +/// Get path-dependent configurable system variables (see +/// [pathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html)) +/// +/// Returns the value of a path-dependent configurable system variable. Most +/// supported variables also have associated compile-time constants, but POSIX +/// allows their values to change at runtime. There are generally two types of +/// `pathconf` variables: options and limits. See [pathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html) for more details. +/// +/// # Parameters +/// +/// - `path`: Lookup the value of `var` for this file or directory +/// - `var`: The `pathconf` variable to lookup +/// +/// # Returns +/// +/// - `Ok(Some(x))`: the variable's limit (for limit variables) or its +/// implementation level (for option variables). Implementation levels are +/// usually a decimal-coded date, such as 200112 for POSIX 2001.12 +/// - `Ok(None)`: the variable has no limit (for limit variables) or is +/// unsupported (for option variables) +/// - `Err(x)`: an error occurred +pub fn pathconf(path: &P, var: PathconfVar) -> Result> { + let raw = path.with_nix_path(|cstr| { + unsafe { + Errno::clear(); + libc::pathconf(cstr.as_ptr(), var as c_int) + } + })?; + if raw == -1 { + if errno::errno() == 0 { + Ok(None) + } else { + Err(Errno::last()) + } + } else { + Ok(Some(raw)) + } +} + +/// Variable names for `sysconf` +/// +/// Nix uses the same naming convention for these variables as the +/// [getconf(1)](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html) utility. +/// That is, `SysconfVar` variables have the same name as the abstract variables +/// shown in the `sysconf(3)` man page. Usually, it's the same as the C +/// variable name without the leading `_SC_`. +/// +/// All of these symbols are standardized by POSIX 1003.1-2008, but haven't been +/// implemented by all platforms. +/// +/// # References +/// +/// - [sysconf(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html) +/// - [unistd.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html) +/// - [limits.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(i32)] +#[non_exhaustive] +pub enum SysconfVar { + /// Maximum number of I/O operations in a single list I/O call supported by + /// the implementation. + #[cfg(not(target_os = "redox"))] + AIO_LISTIO_MAX = libc::_SC_AIO_LISTIO_MAX, + /// Maximum number of outstanding asynchronous I/O operations supported by + /// the implementation. + #[cfg(not(target_os = "redox"))] + AIO_MAX = libc::_SC_AIO_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + /// The maximum amount by which a process can decrease its asynchronous I/O + /// priority level from its own scheduling priority. + AIO_PRIO_DELTA_MAX = libc::_SC_AIO_PRIO_DELTA_MAX, + /// Maximum length of argument to the exec functions including environment data. + ARG_MAX = libc::_SC_ARG_MAX, + /// Maximum number of functions that may be registered with `atexit`. + #[cfg(not(target_os = "redox"))] + ATEXIT_MAX = libc::_SC_ATEXIT_MAX, + /// Maximum obase values allowed by the bc utility. + #[cfg(not(target_os = "redox"))] + BC_BASE_MAX = libc::_SC_BC_BASE_MAX, + /// Maximum number of elements permitted in an array by the bc utility. + #[cfg(not(target_os = "redox"))] + BC_DIM_MAX = libc::_SC_BC_DIM_MAX, + /// Maximum scale value allowed by the bc utility. + #[cfg(not(target_os = "redox"))] + BC_SCALE_MAX = libc::_SC_BC_SCALE_MAX, + /// Maximum length of a string constant accepted by the bc utility. + #[cfg(not(target_os = "redox"))] + BC_STRING_MAX = libc::_SC_BC_STRING_MAX, + /// Maximum number of simultaneous processes per real user ID. + CHILD_MAX = libc::_SC_CHILD_MAX, + // The number of clock ticks per second. + CLK_TCK = libc::_SC_CLK_TCK, + /// Maximum number of weights that can be assigned to an entry of the + /// LC_COLLATE order keyword in the locale definition file + #[cfg(not(target_os = "redox"))] + COLL_WEIGHTS_MAX = libc::_SC_COLL_WEIGHTS_MAX, + /// Maximum number of timer expiration overruns. + #[cfg(not(target_os = "redox"))] + DELAYTIMER_MAX = libc::_SC_DELAYTIMER_MAX, + /// Maximum number of expressions that can be nested within parentheses by + /// the expr utility. + #[cfg(not(target_os = "redox"))] + EXPR_NEST_MAX = libc::_SC_EXPR_NEST_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + /// Maximum length of a host name (not including the terminating null) as + /// returned from the `gethostname` function + HOST_NAME_MAX = libc::_SC_HOST_NAME_MAX, + /// Maximum number of iovec structures that one process has available for + /// use with `readv` or `writev`. + #[cfg(not(target_os = "redox"))] + IOV_MAX = libc::_SC_IOV_MAX, + /// Unless otherwise noted, the maximum length, in bytes, of a utility's + /// input line (either standard input or another file), when the utility is + /// described as processing text files. The length includes room for the + /// trailing . + #[cfg(not(target_os = "redox"))] + LINE_MAX = libc::_SC_LINE_MAX, + /// Maximum length of a login name. + LOGIN_NAME_MAX = libc::_SC_LOGIN_NAME_MAX, + /// Maximum number of simultaneous supplementary group IDs per process. + NGROUPS_MAX = libc::_SC_NGROUPS_MAX, + /// Initial size of `getgrgid_r` and `getgrnam_r` data buffers + #[cfg(not(target_os = "redox"))] + GETGR_R_SIZE_MAX = libc::_SC_GETGR_R_SIZE_MAX, + /// Initial size of `getpwuid_r` and `getpwnam_r` data buffers + #[cfg(not(target_os = "redox"))] + GETPW_R_SIZE_MAX = libc::_SC_GETPW_R_SIZE_MAX, + /// The maximum number of open message queue descriptors a process may hold. + #[cfg(not(target_os = "redox"))] + MQ_OPEN_MAX = libc::_SC_MQ_OPEN_MAX, + /// The maximum number of message priorities supported by the implementation. + #[cfg(not(target_os = "redox"))] + MQ_PRIO_MAX = libc::_SC_MQ_PRIO_MAX, + /// A value one greater than the maximum value that the system may assign to + /// a newly-created file descriptor. + OPEN_MAX = libc::_SC_OPEN_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + /// The implementation supports the Advisory Information option. + _POSIX_ADVISORY_INFO = libc::_SC_ADVISORY_INFO, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + /// The implementation supports barriers. + _POSIX_BARRIERS = libc::_SC_BARRIERS, + /// The implementation supports asynchronous input and output. + #[cfg(not(target_os = "redox"))] + _POSIX_ASYNCHRONOUS_IO = libc::_SC_ASYNCHRONOUS_IO, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + /// The implementation supports clock selection. + _POSIX_CLOCK_SELECTION = libc::_SC_CLOCK_SELECTION, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + /// The implementation supports the Process CPU-Time Clocks option. + _POSIX_CPUTIME = libc::_SC_CPUTIME, + /// The implementation supports the File Synchronization option. + #[cfg(not(target_os = "redox"))] + _POSIX_FSYNC = libc::_SC_FSYNC, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd", target_os = "solaris"))] + /// The implementation supports the IPv6 option. + _POSIX_IPV6 = libc::_SC_IPV6, + /// The implementation supports job control. + #[cfg(not(target_os = "redox"))] + _POSIX_JOB_CONTROL = libc::_SC_JOB_CONTROL, + /// The implementation supports memory mapped Files. + #[cfg(not(target_os = "redox"))] + _POSIX_MAPPED_FILES = libc::_SC_MAPPED_FILES, + /// The implementation supports the Process Memory Locking option. + #[cfg(not(target_os = "redox"))] + _POSIX_MEMLOCK = libc::_SC_MEMLOCK, + /// The implementation supports the Range Memory Locking option. + #[cfg(not(target_os = "redox"))] + _POSIX_MEMLOCK_RANGE = libc::_SC_MEMLOCK_RANGE, + /// The implementation supports memory protection. + #[cfg(not(target_os = "redox"))] + _POSIX_MEMORY_PROTECTION = libc::_SC_MEMORY_PROTECTION, + /// The implementation supports the Message Passing option. + #[cfg(not(target_os = "redox"))] + _POSIX_MESSAGE_PASSING = libc::_SC_MESSAGE_PASSING, + /// The implementation supports the Monotonic Clock option. + #[cfg(not(target_os = "redox"))] + _POSIX_MONOTONIC_CLOCK = libc::_SC_MONOTONIC_CLOCK, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "illumos", target_os = "ios", target_os="linux", + target_os = "macos", target_os="openbsd", target_os = "solaris"))] + /// The implementation supports the Prioritized Input and Output option. + _POSIX_PRIORITIZED_IO = libc::_SC_PRIORITIZED_IO, + /// The implementation supports the Process Scheduling option. + #[cfg(not(target_os = "redox"))] + _POSIX_PRIORITY_SCHEDULING = libc::_SC_PRIORITY_SCHEDULING, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd", target_os = "solaris"))] + /// The implementation supports the Raw Sockets option. + _POSIX_RAW_SOCKETS = libc::_SC_RAW_SOCKETS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + /// The implementation supports read-write locks. + _POSIX_READER_WRITER_LOCKS = libc::_SC_READER_WRITER_LOCKS, + #[cfg(any(target_os = "android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os = "openbsd"))] + /// The implementation supports realtime signals. + _POSIX_REALTIME_SIGNALS = libc::_SC_REALTIME_SIGNALS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + /// The implementation supports the Regular Expression Handling option. + _POSIX_REGEXP = libc::_SC_REGEXP, + /// Each process has a saved set-user-ID and a saved set-group-ID. + #[cfg(not(target_os = "redox"))] + _POSIX_SAVED_IDS = libc::_SC_SAVED_IDS, + /// The implementation supports semaphores. + #[cfg(not(target_os = "redox"))] + _POSIX_SEMAPHORES = libc::_SC_SEMAPHORES, + /// The implementation supports the Shared Memory Objects option. + #[cfg(not(target_os = "redox"))] + _POSIX_SHARED_MEMORY_OBJECTS = libc::_SC_SHARED_MEMORY_OBJECTS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation supports the POSIX shell. + _POSIX_SHELL = libc::_SC_SHELL, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation supports the Spawn option. + _POSIX_SPAWN = libc::_SC_SPAWN, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation supports spin locks. + _POSIX_SPIN_LOCKS = libc::_SC_SPIN_LOCKS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + /// The implementation supports the Process Sporadic Server option. + _POSIX_SPORADIC_SERVER = libc::_SC_SPORADIC_SERVER, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + _POSIX_SS_REPL_MAX = libc::_SC_SS_REPL_MAX, + /// The implementation supports the Synchronized Input and Output option. + #[cfg(not(target_os = "redox"))] + _POSIX_SYNCHRONIZED_IO = libc::_SC_SYNCHRONIZED_IO, + /// The implementation supports the Thread Stack Address Attribute option. + #[cfg(not(target_os = "redox"))] + _POSIX_THREAD_ATTR_STACKADDR = libc::_SC_THREAD_ATTR_STACKADDR, + /// The implementation supports the Thread Stack Size Attribute option. + #[cfg(not(target_os = "redox"))] + _POSIX_THREAD_ATTR_STACKSIZE = libc::_SC_THREAD_ATTR_STACKSIZE, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd"))] + /// The implementation supports the Thread CPU-Time Clocks option. + _POSIX_THREAD_CPUTIME = libc::_SC_THREAD_CPUTIME, + /// The implementation supports the Non-Robust Mutex Priority Inheritance + /// option. + #[cfg(not(target_os = "redox"))] + _POSIX_THREAD_PRIO_INHERIT = libc::_SC_THREAD_PRIO_INHERIT, + /// The implementation supports the Non-Robust Mutex Priority Protection option. + #[cfg(not(target_os = "redox"))] + _POSIX_THREAD_PRIO_PROTECT = libc::_SC_THREAD_PRIO_PROTECT, + /// The implementation supports the Thread Execution Scheduling option. + #[cfg(not(target_os = "redox"))] + _POSIX_THREAD_PRIORITY_SCHEDULING = libc::_SC_THREAD_PRIORITY_SCHEDULING, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation supports the Thread Process-Shared Synchronization + /// option. + _POSIX_THREAD_PROCESS_SHARED = libc::_SC_THREAD_PROCESS_SHARED, + #[cfg(any(target_os="dragonfly", target_os="linux", target_os="openbsd"))] + /// The implementation supports the Robust Mutex Priority Inheritance option. + _POSIX_THREAD_ROBUST_PRIO_INHERIT = libc::_SC_THREAD_ROBUST_PRIO_INHERIT, + #[cfg(any(target_os="dragonfly", target_os="linux", target_os="openbsd"))] + /// The implementation supports the Robust Mutex Priority Protection option. + _POSIX_THREAD_ROBUST_PRIO_PROTECT = libc::_SC_THREAD_ROBUST_PRIO_PROTECT, + /// The implementation supports thread-safe functions. + #[cfg(not(target_os = "redox"))] + _POSIX_THREAD_SAFE_FUNCTIONS = libc::_SC_THREAD_SAFE_FUNCTIONS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + /// The implementation supports the Thread Sporadic Server option. + _POSIX_THREAD_SPORADIC_SERVER = libc::_SC_THREAD_SPORADIC_SERVER, + /// The implementation supports threads. + #[cfg(not(target_os = "redox"))] + _POSIX_THREADS = libc::_SC_THREADS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + /// The implementation supports timeouts. + _POSIX_TIMEOUTS = libc::_SC_TIMEOUTS, + /// The implementation supports timers. + #[cfg(not(target_os = "redox"))] + _POSIX_TIMERS = libc::_SC_TIMERS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + /// The implementation supports the Trace option. + _POSIX_TRACE = libc::_SC_TRACE, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + /// The implementation supports the Trace Event Filter option. + _POSIX_TRACE_EVENT_FILTER = libc::_SC_TRACE_EVENT_FILTER, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + _POSIX_TRACE_EVENT_NAME_MAX = libc::_SC_TRACE_EVENT_NAME_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + /// The implementation supports the Trace Inherit option. + _POSIX_TRACE_INHERIT = libc::_SC_TRACE_INHERIT, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + /// The implementation supports the Trace Log option. + _POSIX_TRACE_LOG = libc::_SC_TRACE_LOG, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + _POSIX_TRACE_NAME_MAX = libc::_SC_TRACE_NAME_MAX, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + _POSIX_TRACE_SYS_MAX = libc::_SC_TRACE_SYS_MAX, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + _POSIX_TRACE_USER_EVENT_MAX = libc::_SC_TRACE_USER_EVENT_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + /// The implementation supports the Typed Memory Objects option. + _POSIX_TYPED_MEMORY_OBJECTS = libc::_SC_TYPED_MEMORY_OBJECTS, + /// Integer value indicating version of this standard (C-language binding) + /// to which the implementation conforms. For implementations conforming to + /// POSIX.1-2008, the value shall be 200809L. + _POSIX_VERSION = libc::_SC_VERSION, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation provides a C-language compilation environment with + /// 32-bit `int`, `long`, `pointer`, and `off_t` types. + _POSIX_V6_ILP32_OFF32 = libc::_SC_V6_ILP32_OFF32, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation provides a C-language compilation environment with + /// 32-bit `int`, `long`, and pointer types and an `off_t` type using at + /// least 64 bits. + _POSIX_V6_ILP32_OFFBIG = libc::_SC_V6_ILP32_OFFBIG, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation provides a C-language compilation environment with + /// 32-bit `int` and 64-bit `long`, `pointer`, and `off_t` types. + _POSIX_V6_LP64_OFF64 = libc::_SC_V6_LP64_OFF64, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation provides a C-language compilation environment with an + /// `int` type using at least 32 bits and `long`, pointer, and `off_t` types + /// using at least 64 bits. + _POSIX_V6_LPBIG_OFFBIG = libc::_SC_V6_LPBIG_OFFBIG, + /// The implementation supports the C-Language Binding option. + #[cfg(not(target_os = "redox"))] + _POSIX2_C_BIND = libc::_SC_2_C_BIND, + /// The implementation supports the C-Language Development Utilities option. + #[cfg(not(target_os = "redox"))] + _POSIX2_C_DEV = libc::_SC_2_C_DEV, + /// The implementation supports the Terminal Characteristics option. + #[cfg(not(target_os = "redox"))] + _POSIX2_CHAR_TERM = libc::_SC_2_CHAR_TERM, + /// The implementation supports the FORTRAN Development Utilities option. + #[cfg(not(target_os = "redox"))] + _POSIX2_FORT_DEV = libc::_SC_2_FORT_DEV, + /// The implementation supports the FORTRAN Runtime Utilities option. + #[cfg(not(target_os = "redox"))] + _POSIX2_FORT_RUN = libc::_SC_2_FORT_RUN, + /// The implementation supports the creation of locales by the localedef + /// utility. + #[cfg(not(target_os = "redox"))] + _POSIX2_LOCALEDEF = libc::_SC_2_LOCALEDEF, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation supports the Batch Environment Services and Utilities + /// option. + _POSIX2_PBS = libc::_SC_2_PBS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation supports the Batch Accounting option. + _POSIX2_PBS_ACCOUNTING = libc::_SC_2_PBS_ACCOUNTING, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation supports the Batch Checkpoint/Restart option. + _POSIX2_PBS_CHECKPOINT = libc::_SC_2_PBS_CHECKPOINT, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation supports the Locate Batch Job Request option. + _POSIX2_PBS_LOCATE = libc::_SC_2_PBS_LOCATE, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation supports the Batch Job Message Request option. + _POSIX2_PBS_MESSAGE = libc::_SC_2_PBS_MESSAGE, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + /// The implementation supports the Track Batch Job Request option. + _POSIX2_PBS_TRACK = libc::_SC_2_PBS_TRACK, + /// The implementation supports the Software Development Utilities option. + #[cfg(not(target_os = "redox"))] + _POSIX2_SW_DEV = libc::_SC_2_SW_DEV, + /// The implementation supports the User Portability Utilities option. + #[cfg(not(target_os = "redox"))] + _POSIX2_UPE = libc::_SC_2_UPE, + /// Integer value indicating version of the Shell and Utilities volume of + /// POSIX.1 to which the implementation conforms. + #[cfg(not(target_os = "redox"))] + _POSIX2_VERSION = libc::_SC_2_VERSION, + /// The size of a system page in bytes. + /// + /// POSIX also defines an alias named `PAGESIZE`, but Rust does not allow two + /// enum constants to have the same value, so nix omits `PAGESIZE`. + PAGE_SIZE = libc::_SC_PAGE_SIZE, + #[cfg(not(target_os = "redox"))] + PTHREAD_DESTRUCTOR_ITERATIONS = libc::_SC_THREAD_DESTRUCTOR_ITERATIONS, + #[cfg(not(target_os = "redox"))] + PTHREAD_KEYS_MAX = libc::_SC_THREAD_KEYS_MAX, + #[cfg(not(target_os = "redox"))] + PTHREAD_STACK_MIN = libc::_SC_THREAD_STACK_MIN, + #[cfg(not(target_os = "redox"))] + PTHREAD_THREADS_MAX = libc::_SC_THREAD_THREADS_MAX, + RE_DUP_MAX = libc::_SC_RE_DUP_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + RTSIG_MAX = libc::_SC_RTSIG_MAX, + #[cfg(not(target_os = "redox"))] + SEM_NSEMS_MAX = libc::_SC_SEM_NSEMS_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + SEM_VALUE_MAX = libc::_SC_SEM_VALUE_MAX, + #[cfg(any(target_os = "android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os = "openbsd"))] + SIGQUEUE_MAX = libc::_SC_SIGQUEUE_MAX, + STREAM_MAX = libc::_SC_STREAM_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + SYMLOOP_MAX = libc::_SC_SYMLOOP_MAX, + #[cfg(not(target_os = "redox"))] + TIMER_MAX = libc::_SC_TIMER_MAX, + TTY_NAME_MAX = libc::_SC_TTY_NAME_MAX, + TZNAME_MAX = libc::_SC_TZNAME_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + /// The implementation supports the X/Open Encryption Option Group. + _XOPEN_CRYPT = libc::_SC_XOPEN_CRYPT, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + /// The implementation supports the Issue 4, Version 2 Enhanced + /// Internationalization Option Group. + _XOPEN_ENH_I18N = libc::_SC_XOPEN_ENH_I18N, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + _XOPEN_LEGACY = libc::_SC_XOPEN_LEGACY, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + /// The implementation supports the X/Open Realtime Option Group. + _XOPEN_REALTIME = libc::_SC_XOPEN_REALTIME, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + /// The implementation supports the X/Open Realtime Threads Option Group. + _XOPEN_REALTIME_THREADS = libc::_SC_XOPEN_REALTIME_THREADS, + /// The implementation supports the Issue 4, Version 2 Shared Memory Option + /// Group. + #[cfg(not(target_os = "redox"))] + _XOPEN_SHM = libc::_SC_XOPEN_SHM, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + /// The implementation supports the XSI STREAMS Option Group. + _XOPEN_STREAMS = libc::_SC_XOPEN_STREAMS, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + /// The implementation supports the XSI option + _XOPEN_UNIX = libc::_SC_XOPEN_UNIX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + /// Integer value indicating version of the X/Open Portability Guide to + /// which the implementation conforms. + _XOPEN_VERSION = libc::_SC_XOPEN_VERSION, +} + +/// Get configurable system variables (see +/// [sysconf(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html)) +/// +/// Returns the value of a configurable system variable. Most supported +/// variables also have associated compile-time constants, but POSIX +/// allows their values to change at runtime. There are generally two types of +/// sysconf variables: options and limits. See sysconf(3) for more details. +/// +/// # Returns +/// +/// - `Ok(Some(x))`: the variable's limit (for limit variables) or its +/// implementation level (for option variables). Implementation levels are +/// usually a decimal-coded date, such as 200112 for POSIX 2001.12 +/// - `Ok(None)`: the variable has no limit (for limit variables) or is +/// unsupported (for option variables) +/// - `Err(x)`: an error occurred +pub fn sysconf(var: SysconfVar) -> Result> { + let raw = unsafe { + Errno::clear(); + libc::sysconf(var as c_int) + }; + if raw == -1 { + if errno::errno() == 0 { + Ok(None) + } else { + Err(Errno::last()) + } + } else { + Ok(Some(raw)) + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod pivot_root { + use crate::{Result, NixPath}; + use crate::errno::Errno; + + pub fn pivot_root( + new_root: &P1, put_old: &P2) -> Result<()> { + let res = new_root.with_nix_path(|new_root| { + put_old.with_nix_path(|put_old| { + unsafe { + libc::syscall(libc::SYS_pivot_root, new_root.as_ptr(), put_old.as_ptr()) + } + }) + })??; + + Errno::result(res).map(drop) + } +} + +#[cfg(any(target_os = "android", target_os = "freebsd", + target_os = "linux", target_os = "openbsd"))] +mod setres { + use crate::Result; + use crate::errno::Errno; + use super::{Uid, Gid}; + + /// Sets the real, effective, and saved uid. + /// ([see setresuid(2)](https://man7.org/linux/man-pages/man2/setresuid.2.html)) + /// + /// * `ruid`: real user id + /// * `euid`: effective user id + /// * `suid`: saved user id + /// * returns: Ok or libc error code. + /// + /// Err is returned if the user doesn't have permission to set this UID. + #[inline] + pub fn setresuid(ruid: Uid, euid: Uid, suid: Uid) -> Result<()> { + let res = unsafe { libc::setresuid(ruid.into(), euid.into(), suid.into()) }; + + Errno::result(res).map(drop) + } + + /// Sets the real, effective, and saved gid. + /// ([see setresuid(2)](https://man7.org/linux/man-pages/man2/setresuid.2.html)) + /// + /// * `rgid`: real group id + /// * `egid`: effective group id + /// * `sgid`: saved group id + /// * returns: Ok or libc error code. + /// + /// Err is returned if the user doesn't have permission to set this GID. + #[inline] + pub fn setresgid(rgid: Gid, egid: Gid, sgid: Gid) -> Result<()> { + let res = unsafe { libc::setresgid(rgid.into(), egid.into(), sgid.into()) }; + + Errno::result(res).map(drop) + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod getres { + use crate::Result; + use crate::errno::Errno; + use super::{Uid, Gid}; + + /// Real, effective and saved user IDs. + #[derive(Debug, Copy, Clone, Eq, PartialEq)] + pub struct ResUid { + pub real: Uid, + pub effective: Uid, + pub saved: Uid + } + + /// Real, effective and saved group IDs. + #[derive(Debug, Copy, Clone, Eq, PartialEq)] + pub struct ResGid { + pub real: Gid, + pub effective: Gid, + pub saved: Gid + } + + /// Gets the real, effective, and saved user IDs. + /// + /// ([see getresuid(2)](http://man7.org/linux/man-pages/man2/getresuid.2.html)) + /// + /// #Returns + /// + /// - `Ok((Uid, Uid, Uid))`: tuple of real, effective and saved uids on success. + /// - `Err(x)`: libc error code on failure. + /// + #[inline] + pub fn getresuid() -> Result { + let mut ruid = libc::uid_t::max_value(); + let mut euid = libc::uid_t::max_value(); + let mut suid = libc::uid_t::max_value(); + let res = unsafe { libc::getresuid(&mut ruid, &mut euid, &mut suid) }; + + Errno::result(res).map(|_| ResUid{ real: Uid(ruid), effective: Uid(euid), saved: Uid(suid) }) + } + + /// Gets the real, effective, and saved group IDs. + /// + /// ([see getresgid(2)](http://man7.org/linux/man-pages/man2/getresgid.2.html)) + /// + /// #Returns + /// + /// - `Ok((Gid, Gid, Gid))`: tuple of real, effective and saved gids on success. + /// - `Err(x)`: libc error code on failure. + /// + #[inline] + pub fn getresgid() -> Result { + let mut rgid = libc::gid_t::max_value(); + let mut egid = libc::gid_t::max_value(); + let mut sgid = libc::gid_t::max_value(); + let res = unsafe { libc::getresgid(&mut rgid, &mut egid, &mut sgid) }; + + Errno::result(res).map(|_| ResGid { real: Gid(rgid), effective: Gid(egid), saved: Gid(sgid) } ) + } +} + +libc_bitflags!{ + /// Options for access() + pub struct AccessFlags : c_int { + /// Test for existence of file. + F_OK; + /// Test for read permission. + R_OK; + /// Test for write permission. + W_OK; + /// Test for execute (search) permission. + X_OK; + } +} + +/// Checks the file named by `path` for accessibility according to the flags given by `amode` +/// See [access(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html) +pub fn access(path: &P, amode: AccessFlags) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::access(cstr.as_ptr(), amode.bits) + } + })?; + Errno::result(res).map(drop) +} + +/// Representation of a User, based on `libc::passwd` +/// +/// The reason some fields in this struct are `String` and others are `CString` is because some +/// fields are based on the user's locale, which could be non-UTF8, while other fields are +/// guaranteed to conform to [`NAME_REGEX`](https://serverfault.com/a/73101/407341), which only +/// contains ASCII. +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +#[derive(Debug, Clone, PartialEq)] +pub struct User { + /// Username + pub name: String, + /// User password (probably encrypted) + pub passwd: CString, + /// User ID + pub uid: Uid, + /// Group ID + pub gid: Gid, + /// User information + #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] + pub gecos: CString, + /// Home directory + pub dir: PathBuf, + /// Path to shell + pub shell: PathBuf, + /// Login class + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pub class: CString, + /// Last password change + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pub change: libc::time_t, + /// Expiration time of account + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pub expire: libc::time_t +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl From<&libc::passwd> for User { + fn from(pw: &libc::passwd) -> User { + unsafe { + User { + name: CStr::from_ptr((*pw).pw_name).to_string_lossy().into_owned(), + passwd: CString::new(CStr::from_ptr((*pw).pw_passwd).to_bytes()).unwrap(), + #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] + gecos: CString::new(CStr::from_ptr((*pw).pw_gecos).to_bytes()).unwrap(), + dir: PathBuf::from(OsStr::from_bytes(CStr::from_ptr((*pw).pw_dir).to_bytes())), + shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr((*pw).pw_shell).to_bytes())), + uid: Uid::from_raw((*pw).pw_uid), + gid: Gid::from_raw((*pw).pw_gid), + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + class: CString::new(CStr::from_ptr((*pw).pw_class).to_bytes()).unwrap(), + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + change: (*pw).pw_change, + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + expire: (*pw).pw_expire + } + } + } +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl From for libc::passwd { + fn from(u: User) -> Self { + let name = match CString::new(u.name) { + Ok(n) => n.into_raw(), + Err(_) => CString::new("").unwrap().into_raw(), + }; + let dir = match u.dir.into_os_string().into_string() { + Ok(s) => CString::new(s.as_str()).unwrap().into_raw(), + Err(_) => CString::new("").unwrap().into_raw(), + }; + let shell = match u.shell.into_os_string().into_string() { + Ok(s) => CString::new(s.as_str()).unwrap().into_raw(), + Err(_) => CString::new("").unwrap().into_raw(), + }; + Self { + pw_name: name, + pw_passwd: u.passwd.into_raw(), + #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] + pw_gecos: u.gecos.into_raw(), + pw_dir: dir, + pw_shell: shell, + pw_uid: u.uid.0, + pw_gid: u.gid.0, + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pw_class: u.class.into_raw(), + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pw_change: u.change, + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pw_expire: u.expire, + #[cfg(target_os = "illumos")] + pw_age: CString::new("").unwrap().into_raw(), + #[cfg(target_os = "illumos")] + pw_comment: CString::new("").unwrap().into_raw(), + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + pw_fields: 0, + } + } +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl User { + fn from_anything(f: F) -> Result> + where + F: Fn(*mut libc::passwd, + *mut libc::c_char, + libc::size_t, + *mut *mut libc::passwd) -> libc::c_int + { + let buflimit = 1048576; + let bufsize = match sysconf(SysconfVar::GETPW_R_SIZE_MAX) { + Ok(Some(n)) => n as usize, + Ok(None) | Err(_) => 16384, + }; + + let mut cbuf = Vec::with_capacity(bufsize); + let mut pwd = mem::MaybeUninit::::uninit(); + let mut res = ptr::null_mut(); + + loop { + let error = f(pwd.as_mut_ptr(), cbuf.as_mut_ptr(), cbuf.capacity(), &mut res); + if error == 0 { + if res.is_null() { + return Ok(None); + } else { + let pwd = unsafe { pwd.assume_init() }; + return Ok(Some(User::from(&pwd))); + } + } else if Errno::last() == Errno::ERANGE { + // Trigger the internal buffer resizing logic. + reserve_double_buffer_size(&mut cbuf, buflimit)?; + } else { + return Err(Errno::last()); + } + } + } + + /// Get a user by UID. + /// + /// Internally, this function calls + /// [getpwuid_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + /// ``` + /// use nix::unistd::{Uid, User}; + /// // Returns an Result>, thus the double unwrap. + /// let res = User::from_uid(Uid::from_raw(0)).unwrap().unwrap(); + /// assert!(res.name == "root"); + /// ``` + pub fn from_uid(uid: Uid) -> Result> { + User::from_anything(|pwd, cbuf, cap, res| { + unsafe { libc::getpwuid_r(uid.0, pwd, cbuf, cap, res) } + }) + } + + /// Get a user by name. + /// + /// Internally, this function calls + /// [getpwnam_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + /// ``` + /// use nix::unistd::User; + /// // Returns an Result>, thus the double unwrap. + /// let res = User::from_name("root").unwrap().unwrap(); + /// assert!(res.name == "root"); + /// ``` + pub fn from_name(name: &str) -> Result> { + let name = CString::new(name).unwrap(); + User::from_anything(|pwd, cbuf, cap, res| { + unsafe { libc::getpwnam_r(name.as_ptr(), pwd, cbuf, cap, res) } + }) + } +} + +/// Representation of a Group, based on `libc::group` +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +#[derive(Debug, Clone, PartialEq)] +pub struct Group { + /// Group name + pub name: String, + /// Group password + pub passwd: CString, + /// Group ID + pub gid: Gid, + /// List of Group members + pub mem: Vec +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl From<&libc::group> for Group { + fn from(gr: &libc::group) -> Group { + unsafe { + Group { + name: CStr::from_ptr((*gr).gr_name).to_string_lossy().into_owned(), + passwd: CString::new(CStr::from_ptr((*gr).gr_passwd).to_bytes()).unwrap(), + gid: Gid::from_raw((*gr).gr_gid), + mem: Group::members((*gr).gr_mem) + } + } + } +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl Group { + unsafe fn members(mem: *mut *mut c_char) -> Vec { + let mut ret = Vec::new(); + + for i in 0.. { + let u = mem.offset(i); + if (*u).is_null() { + break; + } else { + let s = CStr::from_ptr(*u).to_string_lossy().into_owned(); + ret.push(s); + } + } + + ret + } + + fn from_anything(f: F) -> Result> + where + F: Fn(*mut libc::group, + *mut libc::c_char, + libc::size_t, + *mut *mut libc::group) -> libc::c_int + { + let buflimit = 1048576; + let bufsize = match sysconf(SysconfVar::GETGR_R_SIZE_MAX) { + Ok(Some(n)) => n as usize, + Ok(None) | Err(_) => 16384, + }; + + let mut cbuf = Vec::with_capacity(bufsize); + let mut grp = mem::MaybeUninit::::uninit(); + let mut res = ptr::null_mut(); + + loop { + let error = f(grp.as_mut_ptr(), cbuf.as_mut_ptr(), cbuf.capacity(), &mut res); + if error == 0 { + if res.is_null() { + return Ok(None); + } else { + let grp = unsafe { grp.assume_init() }; + return Ok(Some(Group::from(&grp))); + } + } else if Errno::last() == Errno::ERANGE { + // Trigger the internal buffer resizing logic. + reserve_double_buffer_size(&mut cbuf, buflimit)?; + } else { + return Err(Errno::last()); + } + } + } + + /// Get a group by GID. + /// + /// Internally, this function calls + /// [getgrgid_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + // Disable this test on all OS except Linux as root group may not exist. + #[cfg_attr(not(target_os = "linux"), doc = " ```no_run")] + #[cfg_attr(target_os = "linux", doc = " ```")] + /// use nix::unistd::{Gid, Group}; + /// // Returns an Result>, thus the double unwrap. + /// let res = Group::from_gid(Gid::from_raw(0)).unwrap().unwrap(); + /// assert!(res.name == "root"); + /// ``` + pub fn from_gid(gid: Gid) -> Result> { + Group::from_anything(|grp, cbuf, cap, res| { + unsafe { libc::getgrgid_r(gid.0, grp, cbuf, cap, res) } + }) + } + + /// Get a group by name. + /// + /// Internally, this function calls + /// [getgrnam_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + // Disable this test on all OS except Linux as root group may not exist. + #[cfg_attr(not(target_os = "linux"), doc = " ```no_run")] + #[cfg_attr(target_os = "linux", doc = " ```")] + /// use nix::unistd::Group; + /// // Returns an Result>, thus the double unwrap. + /// let res = Group::from_name("root").unwrap().unwrap(); + /// assert!(res.name == "root"); + /// ``` + pub fn from_name(name: &str) -> Result> { + let name = CString::new(name).unwrap(); + Group::from_anything(|grp, cbuf, cap, res| { + unsafe { libc::getgrnam_r(name.as_ptr(), grp, cbuf, cap, res) } + }) + } +} + +/// Get the name of the terminal device that is open on file descriptor fd +/// (see [`ttyname(3)`](https://man7.org/linux/man-pages/man3/ttyname.3.html)). +#[cfg(not(target_os = "fuchsia"))] +pub fn ttyname(fd: RawFd) -> Result { + const PATH_MAX: usize = libc::PATH_MAX as usize; + let mut buf = vec![0_u8; PATH_MAX]; + let c_buf = buf.as_mut_ptr() as *mut libc::c_char; + + let ret = unsafe { libc::ttyname_r(fd, c_buf, buf.len()) }; + if ret != 0 { + return Err(Errno::from_i32(ret)); + } + + let nul = buf.iter().position(|c| *c == b'\0').unwrap(); + buf.truncate(nul); + Ok(OsString::from_vec(buf).into()) +} + +/// Get the effective user ID and group ID associated with a Unix domain socket. +/// +/// See also [getpeereid(3)](https://www.freebsd.org/cgi/man.cgi?query=getpeereid) +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +pub fn getpeereid(fd: RawFd) -> Result<(Uid, Gid)> { + let mut uid = 1; + let mut gid = 1; + + let ret = unsafe { libc::getpeereid(fd, &mut uid, &mut gid) }; + + Errno::result(ret).map(|_| (Uid(uid), Gid(gid))) +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/common/mod.rs b/bash-5.1/vendor/nix-0.23.1/test/common/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..84a0b4fa3082369df0db515fbc29c2adb7760627 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/common/mod.rs @@ -0,0 +1,141 @@ +use cfg_if::cfg_if; + +#[macro_export] macro_rules! skip { + ($($reason: expr),+) => { + use ::std::io::{self, Write}; + + let stderr = io::stderr(); + let mut handle = stderr.lock(); + writeln!(handle, $($reason),+).unwrap(); + return; + } +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + #[macro_export] macro_rules! require_capability { + ($name:expr, $capname:ident) => { + use ::caps::{Capability, CapSet, has_cap}; + + if !has_cap(None, CapSet::Effective, Capability::$capname) + .unwrap() + { + skip!("{} requires capability {}. Skipping test.", $name, Capability::$capname); + } + } + } + } else if #[cfg(not(target_os = "redox"))] { + #[macro_export] macro_rules! require_capability { + ($name:expr, $capname:ident) => {} + } + } +} + +/// Skip the test if we don't have the ability to mount file systems. +#[cfg(target_os = "freebsd")] +#[macro_export] macro_rules! require_mount { + ($name:expr) => { + use ::sysctl::CtlValue; + use nix::unistd::Uid; + + if !Uid::current().is_root() && CtlValue::Int(0) == ::sysctl::value("vfs.usermount").unwrap() + { + skip!("{} requires the ability to mount file systems. Skipping test.", $name); + } + } +} + +#[cfg(any(target_os = "linux", target_os= "android"))] +#[macro_export] macro_rules! skip_if_cirrus { + ($reason:expr) => { + if std::env::var_os("CIRRUS_CI").is_some() { + skip!("{}", $reason); + } + } +} + +#[cfg(target_os = "freebsd")] +#[macro_export] macro_rules! skip_if_jailed { + ($name:expr) => { + use ::sysctl::CtlValue; + + if let CtlValue::Int(1) = ::sysctl::value("security.jail.jailed") + .unwrap() + { + skip!("{} cannot run in a jail. Skipping test.", $name); + } + } +} + +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +#[macro_export] macro_rules! skip_if_not_root { + ($name:expr) => { + use nix::unistd::Uid; + + if !Uid::current().is_root() { + skip!("{} requires root privileges. Skipping test.", $name); + } + }; +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + #[macro_export] macro_rules! skip_if_seccomp { + ($name:expr) => { + if let Ok(s) = std::fs::read_to_string("/proc/self/status") { + for l in s.lines() { + let mut fields = l.split_whitespace(); + if fields.next() == Some("Seccomp:") && + fields.next() != Some("0") + { + skip!("{} cannot be run in Seccomp mode. Skipping test.", + stringify!($name)); + } + } + } + } + } + } else if #[cfg(not(target_os = "redox"))] { + #[macro_export] macro_rules! skip_if_seccomp { + ($name:expr) => {} + } + } +} + +cfg_if! { + if #[cfg(target_os = "linux")] { + #[macro_export] macro_rules! require_kernel_version { + ($name:expr, $version_requirement:expr) => { + use semver::{Version, VersionReq}; + + let version_requirement = VersionReq::parse($version_requirement) + .expect("Bad match_version provided"); + + let uname = nix::sys::utsname::uname(); + println!("{}", uname.sysname()); + println!("{}", uname.nodename()); + println!("{}", uname.release()); + println!("{}", uname.version()); + println!("{}", uname.machine()); + + // Fix stuff that the semver parser can't handle + let fixed_release = &uname.release().to_string() + // Fedora 33 reports version as 4.18.el8_2.x86_64 or + // 5.18.200-fc33.x86_64. Remove the underscore. + .replace("_", "-") + // Cirrus-CI reports version as 4.19.112+ . Remove the + + .replace("+", ""); + let mut version = Version::parse(fixed_release).unwrap(); + + //Keep only numeric parts + version.pre = semver::Prerelease::EMPTY; + version.build = semver::BuildMetadata::EMPTY; + + if !version_requirement.matches(&version) { + skip!("Skip {} because kernel version `{}` doesn't match the requirement `{}`", + stringify!($name), version, version_requirement); + } + } + } + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/mod.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..e73d9b1dc673c3aff66a3189d8d2940228ffa5de --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/mod.rs @@ -0,0 +1,47 @@ +mod test_signal; + +// NOTE: DragonFly lacks a kernel-level implementation of Posix AIO as of +// this writing. There is an user-level implementation, but whether aio +// works or not heavily depends on which pthread implementation is chosen +// by the user at link time. For this reason we do not want to run aio test +// cases on DragonFly. +#[cfg(any(target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd"))] +mod test_aio; +#[cfg(not(target_os = "redox"))] +mod test_mman; +#[cfg(target_os = "linux")] +mod test_signalfd; +#[cfg(not(target_os = "redox"))] +mod test_socket; +#[cfg(not(target_os = "redox"))] +mod test_sockopt; +#[cfg(not(target_os = "redox"))] +mod test_select; +#[cfg(any(target_os = "android", target_os = "linux"))] +mod test_sysinfo; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod test_termios; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod test_ioctl; +mod test_wait; +mod test_uio; + +#[cfg(target_os = "linux")] +mod test_epoll; +#[cfg(target_os = "linux")] +mod test_inotify; +mod test_pthread; +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +mod test_ptrace; +#[cfg(any(target_os = "android", target_os = "linux"))] +mod test_timerfd; diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_aio.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_aio.rs new file mode 100644 index 0000000000000000000000000000000000000000..80cd053f8defadb83b8c8dbf8cf68f4d2a20511d --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_aio.rs @@ -0,0 +1,620 @@ +use libc::{c_int, c_void}; +use nix::Result; +use nix::errno::*; +use nix::sys::aio::*; +use nix::sys::signal::{SaFlags, SigAction, sigaction, SigevNotify, SigHandler, Signal, SigSet}; +use nix::sys::time::{TimeSpec, TimeValLike}; +use std::io::{Write, Read, Seek, SeekFrom}; +use std::ops::Deref; +use std::os::unix::io::AsRawFd; +use std::pin::Pin; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::{thread, time}; +use tempfile::tempfile; + +// Helper that polls an AioCb for completion or error +fn poll_aio(aiocb: &mut Pin>) -> Result<()> { + loop { + let err = aiocb.error(); + if err != Err(Errno::EINPROGRESS) { return err; }; + thread::sleep(time::Duration::from_millis(10)); + } +} + +// Helper that polls a component of an LioCb for completion or error +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +fn poll_lio(liocb: &mut LioCb, i: usize) -> Result<()> { + loop { + let err = liocb.error(i); + if err != Err(Errno::EINPROGRESS) { return err; }; + thread::sleep(time::Duration::from_millis(10)); + } +} + +#[test] +fn test_accessors() { + let mut rbuf = vec![0; 4]; + let aiocb = AioCb::from_mut_slice( 1001, + 2, //offset + &mut rbuf, + 42, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 99 + }, + LioOpcode::LIO_NOP); + assert_eq!(1001, aiocb.fd()); + assert_eq!(Some(LioOpcode::LIO_NOP), aiocb.lio_opcode()); + assert_eq!(4, aiocb.nbytes()); + assert_eq!(2, aiocb.offset()); + assert_eq!(42, aiocb.priority()); + let sev = aiocb.sigevent().sigevent(); + assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); + assert_eq!(99, sev.sigev_value.sival_ptr as i64); +} + +// Tests AioCb.cancel. We aren't trying to test the OS's implementation, only +// our bindings. So it's sufficient to check that AioCb.cancel returned any +// AioCancelStat value. +#[test] +#[cfg_attr(target_env = "musl", ignore)] +fn test_cancel() { + let wbuf: &[u8] = b"CDEF"; + + let f = tempfile().unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 0, //offset + wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + let err = aiocb.error(); + assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); + + let cancelstat = aiocb.cancel(); + assert!(cancelstat.is_ok()); + + // Wait for aiocb to complete, but don't care whether it succeeded + let _ = poll_aio(&mut aiocb); + let _ = aiocb.aio_return(); +} + +// Tests using aio_cancel_all for all outstanding IOs. +#[test] +#[cfg_attr(target_env = "musl", ignore)] +fn test_aio_cancel_all() { + let wbuf: &[u8] = b"CDEF"; + + let f = tempfile().unwrap(); + let mut aiocb = AioCb::from_slice(f.as_raw_fd(), + 0, //offset + wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + let err = aiocb.error(); + assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); + + let cancelstat = aio_cancel_all(f.as_raw_fd()); + assert!(cancelstat.is_ok()); + + // Wait for aiocb to complete, but don't care whether it succeeded + let _ = poll_aio(&mut aiocb); + let _ = aiocb.aio_return(); +} + +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_fsync() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_fd( f.as_raw_fd(), + 0, //priority + SigevNotify::SigevNone); + let err = aiocb.fsync(AioFsyncMode::O_SYNC); + assert!(err.is_ok()); + poll_aio(&mut aiocb).unwrap(); + aiocb.aio_return().unwrap(); +} + +/// `AioCb::fsync` should not modify the `AioCb` object if `libc::aio_fsync` returns +/// an error +// Skip on Linux, because Linux's AIO implementation can't detect errors +// synchronously +#[test] +#[cfg(any(target_os = "freebsd", target_os = "macos"))] +fn test_fsync_error() { + use std::mem; + + const INITIAL: &[u8] = b"abcdef123456"; + // Create an invalid AioFsyncMode + let mode = unsafe { mem::transmute(666) }; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_fd( f.as_raw_fd(), + 0, //priority + SigevNotify::SigevNone); + let err = aiocb.fsync(mode); + assert!(err.is_err()); +} + +#[test] +// On Cirrus on Linux, this test fails due to a glibc bug. +// https://github.com/nix-rust/nix/issues/1099 +#[cfg_attr(target_os = "linux", ignore)] +// On Cirrus, aio_suspend is failing with EINVAL +// https://github.com/nix-rust/nix/issues/1361 +#[cfg_attr(target_os = "macos", ignore)] +fn test_aio_suspend() { + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEFG"; + let timeout = TimeSpec::seconds(10); + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + + let mut wcb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE); + + let mut rcb = AioCb::from_mut_slice( f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ); + wcb.write().unwrap(); + rcb.read().unwrap(); + loop { + { + let cbbuf = [wcb.as_ref(), rcb.as_ref()]; + let r = aio_suspend(&cbbuf[..], Some(timeout)); + match r { + Err(Errno::EINTR) => continue, + Err(e) => panic!("aio_suspend returned {:?}", e), + Ok(_) => () + }; + } + if rcb.error() != Err(Errno::EINPROGRESS) && + wcb.error() != Err(Errno::EINPROGRESS) { + break + } + } + + assert_eq!(wcb.aio_return().unwrap() as usize, WBUF.len()); + assert_eq!(rcb.aio_return().unwrap() as usize, rlen); +} + +// Test a simple aio operation with no completion notification. We must poll +// for completion +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_read() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + 2, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.read().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, EXPECT.len()); + } + + assert_eq!(EXPECT, rbuf.deref().deref()); +} + +/// `AioCb::read` should not modify the `AioCb` object if `libc::aio_read` +/// returns an error +// Skip on Linux, because Linux's AIO implementation can't detect errors +// synchronously +#[test] +#[cfg(any(target_os = "freebsd", target_os = "macos"))] +fn test_read_error() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + -1, //an invalid offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + assert!(aiocb.read().is_err()); +} + +// Tests from_mut_slice +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_read_into_mut_slice() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + 2, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.read().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, EXPECT.len()); + } + + assert_eq!(rbuf, EXPECT); +} + +// Tests from_ptr +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_read_into_pointer() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + // Safety: ok because rbuf lives until after poll_aio + let mut aiocb = unsafe { + AioCb::from_mut_ptr( f.as_raw_fd(), + 2, //offset + rbuf.as_mut_ptr() as *mut c_void, + rbuf.len(), + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP) + }; + aiocb.read().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, EXPECT.len()); + } + + assert_eq!(rbuf, EXPECT); +} + +// Test reading into an immutable buffer. It should fail +// FIXME: This test fails to panic on Linux/musl +#[test] +#[should_panic(expected = "Can't read into an immutable buffer")] +#[cfg_attr(target_env = "musl", ignore)] +fn test_read_immutable_buffer() { + let rbuf: &[u8] = b"CDEF"; + let f = tempfile().unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.read().unwrap(); +} + + +// Test a simple aio operation with no completion notification. We must poll +// for completion. Unlike test_aio_read, this test uses AioCb::from_slice +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_write() { + const INITIAL: &[u8] = b"abcdef123456"; + let wbuf = "CDEF".to_string().into_bytes(); + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + &wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, wbuf.len()); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); +} + +// Tests `AioCb::from_ptr` +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_write_from_pointer() { + const INITIAL: &[u8] = b"abcdef123456"; + let wbuf = "CDEF".to_string().into_bytes(); + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + // Safety: ok because aiocb outlives poll_aio + let mut aiocb = unsafe { + AioCb::from_ptr( f.as_raw_fd(), + 2, //offset + wbuf.as_ptr() as *const c_void, + wbuf.len(), + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP) + }; + aiocb.write().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, wbuf.len()); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); +} + +/// `AioCb::write` should not modify the `AioCb` object if `libc::aio_write` +/// returns an error +// Skip on Linux, because Linux's AIO implementation can't detect errors +// synchronously +#[test] +#[cfg(any(target_os = "freebsd", target_os = "macos"))] +fn test_write_error() { + let wbuf = "CDEF".to_string().into_bytes(); + let mut aiocb = AioCb::from_slice( 666, // An invalid file descriptor + 0, //offset + &wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + assert!(aiocb.write().is_err()); +} + +lazy_static! { + pub static ref SIGNALED: AtomicBool = AtomicBool::new(false); +} + +extern fn sigfunc(_: c_int) { + SIGNALED.store(true, Ordering::Relaxed); +} + +// Test an aio operation with completion delivered by a signal +// FIXME: This test is ignored on mips because of failures in qemu in CI +#[test] +#[cfg_attr(any(all(target_env = "musl", target_arch = "x86_64"), target_arch = "mips", target_arch = "mips64"), ignore)] +fn test_write_sigev_signal() { + let _m = crate::SIGNAL_MTX.lock(); + let sa = SigAction::new(SigHandler::Handler(sigfunc), + SaFlags::SA_RESETHAND, + SigSet::empty()); + SIGNALED.store(false, Ordering::Relaxed); + unsafe { sigaction(Signal::SIGUSR2, &sa) }.unwrap(); + + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 0 //TODO: validate in sigfunc + }, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + while !SIGNALED.load(Ordering::Relaxed) { + thread::sleep(time::Duration::from_millis(10)); + } + + assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); +} + +// Test LioCb::listio with LIO_WAIT, so all AIO ops should be complete by the +// time listio returns. +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_liocb_listio_wait() { + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut rbuf2 = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + let mut f = tempfile().unwrap(); + + f.write_all(INITIAL).unwrap(); + + { + let mut liocb = LioCbBuilder::with_capacity(2) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE + ).emplace_mut_slice( + f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + let err = liocb.listio(LioMode::LIO_WAIT, SigevNotify::SigevNone); + err.expect("lio_listio"); + + assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + assert_eq!(liocb.aio_return(1).unwrap() as usize, rlen); + } + assert_eq!(rbuf.deref().deref(), b"3456"); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf2).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf2, EXPECT); +} + +// Test LioCb::listio with LIO_NOWAIT and no SigEvent, so we must use some other +// mechanism to check for the individual AioCb's completion. +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_liocb_listio_nowait() { + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut rbuf2 = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + let mut f = tempfile().unwrap(); + + f.write_all(INITIAL).unwrap(); + + { + let mut liocb = LioCbBuilder::with_capacity(2) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE + ).emplace_mut_slice( + f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + let err = liocb.listio(LioMode::LIO_NOWAIT, SigevNotify::SigevNone); + err.expect("lio_listio"); + + poll_lio(&mut liocb, 0).unwrap(); + poll_lio(&mut liocb, 1).unwrap(); + assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + assert_eq!(liocb.aio_return(1).unwrap() as usize, rlen); + } + assert_eq!(rbuf.deref().deref(), b"3456"); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf2).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf2, EXPECT); +} + +// Test LioCb::listio with LIO_NOWAIT and a SigEvent to indicate when all +// AioCb's are complete. +// FIXME: This test is ignored on mips/mips64 because of failures in qemu in CI. +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(any(target_arch = "mips", target_arch = "mips64", target_env = "musl"), ignore)] +fn test_liocb_listio_signal() { + let _m = crate::SIGNAL_MTX.lock(); + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut rbuf2 = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + let mut f = tempfile().unwrap(); + let sa = SigAction::new(SigHandler::Handler(sigfunc), + SaFlags::SA_RESETHAND, + SigSet::empty()); + let sigev_notify = SigevNotify::SigevSignal { signal: Signal::SIGUSR2, + si_value: 0 }; + + f.write_all(INITIAL).unwrap(); + + { + let mut liocb = LioCbBuilder::with_capacity(2) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE + ).emplace_mut_slice( + f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + SIGNALED.store(false, Ordering::Relaxed); + unsafe { sigaction(Signal::SIGUSR2, &sa) }.unwrap(); + let err = liocb.listio(LioMode::LIO_NOWAIT, sigev_notify); + err.expect("lio_listio"); + while !SIGNALED.load(Ordering::Relaxed) { + thread::sleep(time::Duration::from_millis(10)); + } + + assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + assert_eq!(liocb.aio_return(1).unwrap() as usize, rlen); + } + assert_eq!(rbuf.deref().deref(), b"3456"); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf2).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf2, EXPECT); +} + +// Try to use LioCb::listio to read into an immutable buffer. It should fail +// FIXME: This test fails to panic on Linux/musl +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[should_panic(expected = "Can't read into an immutable buffer")] +#[cfg_attr(target_env = "musl", ignore)] +fn test_liocb_listio_read_immutable() { + let rbuf: &[u8] = b"abcd"; + let f = tempfile().unwrap(); + + + let mut liocb = LioCbBuilder::with_capacity(1) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + let _ = liocb.listio(LioMode::LIO_NOWAIT, SigevNotify::SigevNone); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_aio_drop.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_aio_drop.rs new file mode 100644 index 0000000000000000000000000000000000000000..71a2183bc1b56d2cc8f28899af76737f8bdd8bcd --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_aio_drop.rs @@ -0,0 +1,29 @@ +// Test dropping an AioCb that hasn't yet finished. +// This must happen in its own process, because on OSX this test seems to hose +// the AIO subsystem and causes subsequent tests to fail +#[test] +#[should_panic(expected = "Dropped an in-progress AioCb")] +#[cfg(all(not(target_env = "musl"), + any(target_os = "linux", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd")))] +fn test_drop() { + use nix::sys::aio::*; + use nix::sys::signal::*; + use std::os::unix::io::AsRawFd; + use tempfile::tempfile; + + const WBUF: &[u8] = b"CDEF"; + + let f = tempfile().unwrap(); + f.set_len(6).unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_epoll.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_epoll.rs new file mode 100644 index 0000000000000000000000000000000000000000..8d44cd08f01c9be80e9c75dbecb5b85814ab083c --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_epoll.rs @@ -0,0 +1,23 @@ +use nix::sys::epoll::{EpollCreateFlags, EpollFlags, EpollOp, EpollEvent}; +use nix::sys::epoll::{epoll_create1, epoll_ctl}; +use nix::errno::Errno; + +#[test] +pub fn test_epoll_errno() { + let efd = epoll_create1(EpollCreateFlags::empty()).unwrap(); + let result = epoll_ctl(efd, EpollOp::EpollCtlDel, 1, None); + assert!(result.is_err()); + assert_eq!(result.unwrap_err(), Errno::ENOENT); + + let result = epoll_ctl(efd, EpollOp::EpollCtlAdd, 1, None); + assert!(result.is_err()); + assert_eq!(result.unwrap_err(), Errno::EINVAL); +} + +#[test] +pub fn test_epoll_ctl() { + let efd = epoll_create1(EpollCreateFlags::empty()).unwrap(); + let mut event = EpollEvent::new(EpollFlags::EPOLLIN | EpollFlags::EPOLLERR, 1); + epoll_ctl(efd, EpollOp::EpollCtlAdd, 1, &mut event).unwrap(); + epoll_ctl(efd, EpollOp::EpollCtlDel, 1, None).unwrap(); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_inotify.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_inotify.rs new file mode 100644 index 0000000000000000000000000000000000000000..137816a352086cfc17f7d3711fbfb4dd4c5a5361 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_inotify.rs @@ -0,0 +1,63 @@ +use nix::sys::inotify::{AddWatchFlags,InitFlags,Inotify}; +use nix::errno::Errno; +use std::ffi::OsString; +use std::fs::{rename, File}; + +#[test] +pub fn test_inotify() { + let instance = Inotify::init(InitFlags::IN_NONBLOCK) + .unwrap(); + let tempdir = tempfile::tempdir().unwrap(); + + instance.add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS).unwrap(); + + let events = instance.read_events(); + assert_eq!(events.unwrap_err(), Errno::EAGAIN); + + File::create(tempdir.path().join("test")).unwrap(); + + let events = instance.read_events().unwrap(); + assert_eq!(events[0].name, Some(OsString::from("test"))); +} + +#[test] +pub fn test_inotify_multi_events() { + let instance = Inotify::init(InitFlags::IN_NONBLOCK) + .unwrap(); + let tempdir = tempfile::tempdir().unwrap(); + + instance.add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS).unwrap(); + + let events = instance.read_events(); + assert_eq!(events.unwrap_err(), Errno::EAGAIN); + + File::create(tempdir.path().join("test")).unwrap(); + rename(tempdir.path().join("test"), tempdir.path().join("test2")).unwrap(); + + // Now there should be 5 events in queue: + // - IN_CREATE on test + // - IN_OPEN on test + // - IN_CLOSE_WRITE on test + // - IN_MOVED_FROM on test with a cookie + // - IN_MOVED_TO on test2 with the same cookie + + let events = instance.read_events().unwrap(); + assert_eq!(events.len(), 5); + + assert_eq!(events[0].mask, AddWatchFlags::IN_CREATE); + assert_eq!(events[0].name, Some(OsString::from("test"))); + + assert_eq!(events[1].mask, AddWatchFlags::IN_OPEN); + assert_eq!(events[1].name, Some(OsString::from("test"))); + + assert_eq!(events[2].mask, AddWatchFlags::IN_CLOSE_WRITE); + assert_eq!(events[2].name, Some(OsString::from("test"))); + + assert_eq!(events[3].mask, AddWatchFlags::IN_MOVED_FROM); + assert_eq!(events[3].name, Some(OsString::from("test"))); + + assert_eq!(events[4].mask, AddWatchFlags::IN_MOVED_TO); + assert_eq!(events[4].name, Some(OsString::from("test2"))); + + assert_eq!(events[3].cookie, events[4].cookie); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_ioctl.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_ioctl.rs new file mode 100644 index 0000000000000000000000000000000000000000..236d24268a738493ca5229e3109e9cb82a4129a6 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_ioctl.rs @@ -0,0 +1,337 @@ +#![allow(dead_code)] + +// Simple tests to ensure macro generated fns compile +ioctl_none_bad!(do_bad, 0x1234); +ioctl_read_bad!(do_bad_read, 0x1234, u16); +ioctl_write_int_bad!(do_bad_write_int, 0x1234); +ioctl_write_ptr_bad!(do_bad_write_ptr, 0x1234, u8); +ioctl_readwrite_bad!(do_bad_readwrite, 0x1234, u32); +ioctl_none!(do_none, 0, 0); +ioctl_read!(read_test, 0, 0, u32); +ioctl_write_int!(write_ptr_int, 0, 0); +ioctl_write_ptr!(write_ptr_u8, 0, 0, u8); +ioctl_write_ptr!(write_ptr_u32, 0, 0, u32); +ioctl_write_ptr!(write_ptr_u64, 0, 0, u64); +ioctl_readwrite!(readwrite_test, 0, 0, u64); +ioctl_read_buf!(readbuf_test, 0, 0, u32); +const SPI_IOC_MAGIC: u8 = b'k'; +const SPI_IOC_MESSAGE: u8 = 0; +ioctl_write_buf!(writebuf_test_consts, SPI_IOC_MAGIC, SPI_IOC_MESSAGE, u8); +ioctl_write_buf!(writebuf_test_u8, 0, 0, u8); +ioctl_write_buf!(writebuf_test_u32, 0, 0, u32); +ioctl_write_buf!(writebuf_test_u64, 0, 0, u64); +ioctl_readwrite_buf!(readwritebuf_test, 0, 0, u32); + +// See C code for source of values for op calculations (does NOT work for mips/powerpc): +// https://gist.github.com/posborne/83ea6880770a1aef332e +// +// TODO: Need a way to compute these constants at test time. Using precomputed +// values is fragile and needs to be maintained. + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod linux { + #[test] + fn test_op_none() { + if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){ + assert_eq!(request_code_none!(b'q', 10) as u32, 0x2000_710A); + assert_eq!(request_code_none!(b'a', 255) as u32, 0x2000_61FF); + } else { + assert_eq!(request_code_none!(b'q', 10) as u32, 0x0000_710A); + assert_eq!(request_code_none!(b'a', 255) as u32, 0x0000_61FF); + } + } + + #[test] + fn test_op_write() { + if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){ + assert_eq!(request_code_write!(b'z', 10, 1) as u32, 0x8001_7A0A); + assert_eq!(request_code_write!(b'z', 10, 512) as u32, 0x8200_7A0A); + } else { + assert_eq!(request_code_write!(b'z', 10, 1) as u32, 0x4001_7A0A); + assert_eq!(request_code_write!(b'z', 10, 512) as u32, 0x4200_7A0A); + } + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_write_64() { + if cfg!(any(target_arch = "mips64", target_arch="powerpc64")){ + assert_eq!(request_code_write!(b'z', 10, 1u64 << 32) as u32, + 0x8000_7A0A); + } else { + assert_eq!(request_code_write!(b'z', 10, 1u64 << 32) as u32, + 0x4000_7A0A); + } + + } + + #[test] + fn test_op_read() { + if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){ + assert_eq!(request_code_read!(b'z', 10, 1) as u32, 0x4001_7A0A); + assert_eq!(request_code_read!(b'z', 10, 512) as u32, 0x4200_7A0A); + } else { + assert_eq!(request_code_read!(b'z', 10, 1) as u32, 0x8001_7A0A); + assert_eq!(request_code_read!(b'z', 10, 512) as u32, 0x8200_7A0A); + } + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_64() { + if cfg!(any(target_arch = "mips64", target_arch="powerpc64")){ + assert_eq!(request_code_read!(b'z', 10, 1u64 << 32) as u32, + 0x4000_7A0A); + } else { + assert_eq!(request_code_read!(b'z', 10, 1u64 << 32) as u32, + 0x8000_7A0A); + } + } + + #[test] + fn test_op_read_write() { + assert_eq!(request_code_readwrite!(b'z', 10, 1) as u32, 0xC001_7A0A); + assert_eq!(request_code_readwrite!(b'z', 10, 512) as u32, 0xC200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_write_64() { + assert_eq!(request_code_readwrite!(b'z', 10, 1u64 << 32) as u32, + 0xC000_7A0A); + } +} + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +mod bsd { + #[test] + fn test_op_none() { + assert_eq!(request_code_none!(b'q', 10), 0x2000_710A); + assert_eq!(request_code_none!(b'a', 255), 0x2000_61FF); + } + + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[test] + fn test_op_write_int() { + assert_eq!(request_code_write_int!(b'v', 4), 0x2004_7604); + assert_eq!(request_code_write_int!(b'p', 2), 0x2004_7002); + } + + #[test] + fn test_op_write() { + assert_eq!(request_code_write!(b'z', 10, 1), 0x8001_7A0A); + assert_eq!(request_code_write!(b'z', 10, 512), 0x8200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_write_64() { + assert_eq!(request_code_write!(b'z', 10, 1u64 << 32), 0x8000_7A0A); + } + + #[test] + fn test_op_read() { + assert_eq!(request_code_read!(b'z', 10, 1), 0x4001_7A0A); + assert_eq!(request_code_read!(b'z', 10, 512), 0x4200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_64() { + assert_eq!(request_code_read!(b'z', 10, 1u64 << 32), 0x4000_7A0A); + } + + #[test] + fn test_op_read_write() { + assert_eq!(request_code_readwrite!(b'z', 10, 1), 0xC001_7A0A); + assert_eq!(request_code_readwrite!(b'z', 10, 512), 0xC200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_write_64() { + assert_eq!(request_code_readwrite!(b'z', 10, 1u64 << 32), 0xC000_7A0A); + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod linux_ioctls { + use std::mem; + use std::os::unix::io::AsRawFd; + + use tempfile::tempfile; + use libc::{TCGETS, TCSBRK, TCSETS, TIOCNXCL, termios}; + + use nix::errno::Errno; + + ioctl_none_bad!(tiocnxcl, TIOCNXCL); + #[test] + fn test_ioctl_none_bad() { + let file = tempfile().unwrap(); + let res = unsafe { tiocnxcl(file.as_raw_fd()) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_read_bad!(tcgets, TCGETS, termios); + #[test] + fn test_ioctl_read_bad() { + let file = tempfile().unwrap(); + let mut termios = unsafe { mem::zeroed() }; + let res = unsafe { tcgets(file.as_raw_fd(), &mut termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_write_int_bad!(tcsbrk, TCSBRK); + #[test] + fn test_ioctl_write_int_bad() { + let file = tempfile().unwrap(); + let res = unsafe { tcsbrk(file.as_raw_fd(), 0) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_write_ptr_bad!(tcsets, TCSETS, termios); + #[test] + fn test_ioctl_write_ptr_bad() { + let file = tempfile().unwrap(); + let termios: termios = unsafe { mem::zeroed() }; + let res = unsafe { tcsets(file.as_raw_fd(), &termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + // FIXME: Find a suitable example for `ioctl_readwrite_bad` + + // From linux/videodev2.h + ioctl_none!(log_status, b'V', 70); + #[test] + fn test_ioctl_none() { + let file = tempfile().unwrap(); + let res = unsafe { log_status(file.as_raw_fd()) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + #[repr(C)] + pub struct v4l2_audio { + index: u32, + name: [u8; 32], + capability: u32, + mode: u32, + reserved: [u32; 2], + } + + // From linux/videodev2.h + ioctl_write_ptr!(s_audio, b'V', 34, v4l2_audio); + #[test] + fn test_ioctl_write_ptr() { + let file = tempfile().unwrap(); + let data: v4l2_audio = unsafe { mem::zeroed() }; + let res = unsafe { s_audio(file.as_raw_fd(), &data) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // From linux/net/bluetooth/hci_sock.h + const HCI_IOC_MAGIC: u8 = b'H'; + const HCI_IOC_HCIDEVUP: u8 = 201; + ioctl_write_int!(hcidevup, HCI_IOC_MAGIC, HCI_IOC_HCIDEVUP); + #[test] + fn test_ioctl_write_int() { + let file = tempfile().unwrap(); + let res = unsafe { hcidevup(file.as_raw_fd(), 0) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // From linux/videodev2.h + ioctl_read!(g_audio, b'V', 33, v4l2_audio); + #[test] + fn test_ioctl_read() { + let file = tempfile().unwrap(); + let mut data: v4l2_audio = unsafe { mem::zeroed() }; + let res = unsafe { g_audio(file.as_raw_fd(), &mut data) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // From linux/videodev2.h + ioctl_readwrite!(enum_audio, b'V', 65, v4l2_audio); + #[test] + fn test_ioctl_readwrite() { + let file = tempfile().unwrap(); + let mut data: v4l2_audio = unsafe { mem::zeroed() }; + let res = unsafe { enum_audio(file.as_raw_fd(), &mut data) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // FIXME: Find a suitable example for `ioctl_read_buf`. + + #[repr(C)] + pub struct spi_ioc_transfer { + tx_buf: u64, + rx_buf: u64, + len: u32, + speed_hz: u32, + delay_usecs: u16, + bits_per_word: u8, + cs_change: u8, + tx_nbits: u8, + rx_nbits: u8, + pad: u16, + } + + // From linux/spi/spidev.h + ioctl_write_buf!(spi_ioc_message, super::SPI_IOC_MAGIC, super::SPI_IOC_MESSAGE, spi_ioc_transfer); + #[test] + fn test_ioctl_write_buf() { + let file = tempfile().unwrap(); + let data: [spi_ioc_transfer; 4] = unsafe { mem::zeroed() }; + let res = unsafe { spi_ioc_message(file.as_raw_fd(), &data[..]) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // FIXME: Find a suitable example for `ioctl_readwrite_buf`. +} + +#[cfg(target_os = "freebsd")] +mod freebsd_ioctls { + use std::mem; + use std::os::unix::io::AsRawFd; + + use tempfile::tempfile; + use libc::termios; + + use nix::errno::Errno; + + // From sys/sys/ttycom.h + const TTY_IOC_MAGIC: u8 = b't'; + const TTY_IOC_TYPE_NXCL: u8 = 14; + const TTY_IOC_TYPE_GETA: u8 = 19; + const TTY_IOC_TYPE_SETA: u8 = 20; + + ioctl_none!(tiocnxcl, TTY_IOC_MAGIC, TTY_IOC_TYPE_NXCL); + #[test] + fn test_ioctl_none() { + let file = tempfile().unwrap(); + let res = unsafe { tiocnxcl(file.as_raw_fd()) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_read!(tiocgeta, TTY_IOC_MAGIC, TTY_IOC_TYPE_GETA, termios); + #[test] + fn test_ioctl_read() { + let file = tempfile().unwrap(); + let mut termios = unsafe { mem::zeroed() }; + let res = unsafe { tiocgeta(file.as_raw_fd(), &mut termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_write_ptr!(tiocseta, TTY_IOC_MAGIC, TTY_IOC_TYPE_SETA, termios); + #[test] + fn test_ioctl_write_ptr() { + let file = tempfile().unwrap(); + let termios: termios = unsafe { mem::zeroed() }; + let res = unsafe { tiocseta(file.as_raw_fd(), &termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_lio_listio_resubmit.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_lio_listio_resubmit.rs new file mode 100644 index 0000000000000000000000000000000000000000..c9077891cb192e133c7bdbbef6b7f0cee5bec4b6 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_lio_listio_resubmit.rs @@ -0,0 +1,106 @@ +// vim: tw=80 + +// Annoyingly, Cargo is unable to conditionally build an entire test binary. So +// we must disable the test here rather than in Cargo.toml +#![cfg(target_os = "freebsd")] + +use nix::errno::*; +use nix::libc::off_t; +use nix::sys::aio::*; +use nix::sys::signal::SigevNotify; +use nix::unistd::{SysconfVar, sysconf}; +use std::os::unix::io::AsRawFd; +use std::{thread, time}; +use sysctl::CtlValue; +use tempfile::tempfile; + +const BYTES_PER_OP: usize = 512; + +/// Attempt to collect final status for all of `liocb`'s operations, freeing +/// system resources +fn finish_liocb(liocb: &mut LioCb) { + for j in 0..liocb.len() { + loop { + let e = liocb.error(j); + match e { + Ok(()) => break, + Err(Errno::EINPROGRESS) => + thread::sleep(time::Duration::from_millis(10)), + Err(x) => panic!("aio_error({:?})", x) + } + } + assert_eq!(liocb.aio_return(j).unwrap(), BYTES_PER_OP as isize); + } +} + +// Deliberately exceed system resource limits, causing lio_listio to return EIO. +// This test must run in its own process since it deliberately uses all AIO +// resources. ATM it is only enabled on FreeBSD, because I don't know how to +// check system AIO limits on other operating systems. +#[test] +fn test_lio_listio_resubmit() { + let mut resubmit_count = 0; + + // Lookup system resource limits + let alm = sysconf(SysconfVar::AIO_LISTIO_MAX) + .expect("sysconf").unwrap() as usize; + let maqpp = if let CtlValue::Int(x) = sysctl::value( + "vfs.aio.max_aio_queue_per_proc").unwrap(){ + x as usize + } else { + panic!("unknown sysctl"); + }; + + // Find lio_listio sizes that satisfy the AIO_LISTIO_MAX constraint and also + // result in a final lio_listio call that can only partially be queued + let target_ops = maqpp + alm / 2; + let num_listios = (target_ops + alm - 3) / (alm - 2); + let ops_per_listio = (target_ops + num_listios - 1) / num_listios; + assert!((num_listios - 1) * ops_per_listio < maqpp, + "the last lio_listio won't make any progress; fix the algorithm"); + println!("Using {:?} LioCbs of {:?} operations apiece", num_listios, + ops_per_listio); + + let f = tempfile().unwrap(); + let buffer_set = (0..num_listios).map(|_| { + (0..ops_per_listio).map(|_| { + vec![0u8; BYTES_PER_OP] + }).collect::>() + }).collect::>(); + + let mut liocbs = (0..num_listios).map(|i| { + let mut builder = LioCbBuilder::with_capacity(ops_per_listio); + for j in 0..ops_per_listio { + let offset = (BYTES_PER_OP * (i * ops_per_listio + j)) as off_t; + builder = builder.emplace_slice(f.as_raw_fd(), + offset, + &buffer_set[i][j][..], + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE); + } + let mut liocb = builder.finish(); + let mut err = liocb.listio(LioMode::LIO_NOWAIT, SigevNotify::SigevNone); + while err == Err(Errno::EIO) || + err == Err(Errno::EAGAIN) || + err == Err(Errno::EINTR) { + // + thread::sleep(time::Duration::from_millis(10)); + resubmit_count += 1; + err = liocb.listio_resubmit(LioMode::LIO_NOWAIT, + SigevNotify::SigevNone); + } + liocb + }).collect::>(); + + // Ensure that every AioCb completed + for liocb in liocbs.iter_mut() { + finish_liocb(liocb); + } + + if resubmit_count > 0 { + println!("Resubmitted {:?} times, test passed", resubmit_count); + } else { + println!("Never resubmitted. Test ambiguous"); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_mman.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_mman.rs new file mode 100644 index 0000000000000000000000000000000000000000..a7ceedcbd1150780652b1502efaac5607a4ed37c --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_mman.rs @@ -0,0 +1,92 @@ +use nix::sys::mman::{mmap, MapFlags, ProtFlags}; + +#[test] +fn test_mmap_anonymous() { + unsafe { + let ptr = mmap(std::ptr::null_mut(), 1, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_PRIVATE | MapFlags::MAP_ANONYMOUS, -1, 0) + .unwrap() as *mut u8; + assert_eq !(*ptr, 0x00u8); + *ptr = 0xffu8; + assert_eq !(*ptr, 0xffu8); + } +} + +#[test] +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +fn test_mremap_grow() { + use nix::sys::mman::{mremap, MRemapFlags}; + use nix::libc::{c_void, size_t}; + + const ONE_K : size_t = 1024; + let slice : &mut[u8] = unsafe { + let mem = mmap(std::ptr::null_mut(), ONE_K, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, -1, 0) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) + }; + assert_eq !(slice[ONE_K - 1], 0x00); + slice[ONE_K - 1] = 0xFF; + assert_eq !(slice[ONE_K - 1], 0xFF); + + let slice : &mut[u8] = unsafe { + #[cfg(target_os = "linux")] + let mem = mremap(slice.as_mut_ptr() as * mut c_void, ONE_K, 10 * ONE_K, + MRemapFlags::MREMAP_MAYMOVE, None) + .unwrap(); + #[cfg(target_os = "netbsd")] + let mem = mremap(slice.as_mut_ptr() as * mut c_void, ONE_K, 10 * ONE_K, + MRemapFlags::MAP_REMAPDUP, None) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, 10 * ONE_K) + }; + + // The first KB should still have the old data in it. + assert_eq !(slice[ONE_K - 1], 0xFF); + + // The additional range should be zero-init'd and accessible. + assert_eq !(slice[10 * ONE_K - 1], 0x00); + slice[10 * ONE_K - 1] = 0xFF; + assert_eq !(slice[10 * ONE_K - 1], 0xFF); +} + +#[test] +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +// Segfaults for unknown reasons under QEMU for 32-bit targets +#[cfg_attr(all(target_pointer_width = "32", qemu), ignore)] +fn test_mremap_shrink() { + use nix::sys::mman::{mremap, MRemapFlags}; + use nix::libc::{c_void, size_t}; + + const ONE_K : size_t = 1024; + let slice : &mut[u8] = unsafe { + let mem = mmap(std::ptr::null_mut(), 10 * ONE_K, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, -1, 0) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) + }; + assert_eq !(slice[ONE_K - 1], 0x00); + slice[ONE_K - 1] = 0xFF; + assert_eq !(slice[ONE_K - 1], 0xFF); + + let slice : &mut[u8] = unsafe { + #[cfg(target_os = "linux")] + let mem = mremap(slice.as_mut_ptr() as * mut c_void, 10 * ONE_K, ONE_K, + MRemapFlags::empty(), None) + .unwrap(); + // Since we didn't supply MREMAP_MAYMOVE, the address should be the + // same. + #[cfg(target_os = "netbsd")] + let mem = mremap(slice.as_mut_ptr() as * mut c_void, 10 * ONE_K, ONE_K, + MRemapFlags::MAP_FIXED, None) + .unwrap(); + assert_eq !(mem, slice.as_mut_ptr() as * mut c_void); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) + }; + + // The first KB should still be accessible and have the old data in it. + assert_eq !(slice[ONE_K - 1], 0xFF); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_pthread.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_pthread.rs new file mode 100644 index 0000000000000000000000000000000000000000..fa9b510e8532e64a3f7335e850bdb4b6c7fd353e --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_pthread.rs @@ -0,0 +1,22 @@ +use nix::sys::pthread::*; + +#[cfg(any(target_env = "musl", target_os = "redox"))] +#[test] +fn test_pthread_self() { + let tid = pthread_self(); + assert!(tid != ::std::ptr::null_mut()); +} + +#[cfg(not(any(target_env = "musl", target_os = "redox")))] +#[test] +fn test_pthread_self() { + let tid = pthread_self(); + assert!(tid != 0); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_pthread_kill_none() { + pthread_kill(pthread_self(), None) + .expect("Should be able to send signal to my thread."); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_ptrace.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_ptrace.rs new file mode 100644 index 0000000000000000000000000000000000000000..83fff9a5b41099c73a34e7ce2737f2bc33674e00 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_ptrace.rs @@ -0,0 +1,219 @@ +use nix::errno::Errno; +use nix::unistd::getpid; +use nix::sys::ptrace; +#[cfg(any(target_os = "android", target_os = "linux"))] +use nix::sys::ptrace::Options; + +#[cfg(any(target_os = "android", target_os = "linux"))] +use std::mem; + +use crate::*; + +#[test] +fn test_ptrace() { + // Just make sure ptrace can be called at all, for now. + // FIXME: qemu-user doesn't implement ptrace on all arches, so permit ENOSYS + require_capability!("test_ptrace", CAP_SYS_PTRACE); + let err = ptrace::attach(getpid()).unwrap_err(); + assert!(err == Errno::EPERM || err == Errno::EINVAL || + err == Errno::ENOSYS); +} + +// Just make sure ptrace_setoptions can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_setoptions() { + require_capability!("test_ptrace_setoptions", CAP_SYS_PTRACE); + let err = ptrace::setoptions(getpid(), Options::PTRACE_O_TRACESYSGOOD).unwrap_err(); + assert!(err != Errno::EOPNOTSUPP); +} + +// Just make sure ptrace_getevent can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_getevent() { + require_capability!("test_ptrace_getevent", CAP_SYS_PTRACE); + let err = ptrace::getevent(getpid()).unwrap_err(); + assert!(err != Errno::EOPNOTSUPP); +} + +// Just make sure ptrace_getsiginfo can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_getsiginfo() { + require_capability!("test_ptrace_getsiginfo", CAP_SYS_PTRACE); + if let Err(Errno::EOPNOTSUPP) = ptrace::getsiginfo(getpid()) { + panic!("ptrace_getsiginfo returns Errno::EOPNOTSUPP!"); + } +} + +// Just make sure ptrace_setsiginfo can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_setsiginfo() { + require_capability!("test_ptrace_setsiginfo", CAP_SYS_PTRACE); + let siginfo = unsafe { mem::zeroed() }; + if let Err(Errno::EOPNOTSUPP) = ptrace::setsiginfo(getpid(), &siginfo) { + panic!("ptrace_setsiginfo returns Errno::EOPNOTSUPP!"); + } +} + + +#[test] +fn test_ptrace_cont() { + use nix::sys::ptrace; + use nix::sys::signal::{raise, Signal}; + use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus}; + use nix::unistd::fork; + use nix::unistd::ForkResult::*; + + require_capability!("test_ptrace_cont", CAP_SYS_PTRACE); + + let _m = crate::FORK_MTX.lock(); + + // FIXME: qemu-user doesn't implement ptrace on all architectures + // and retunrs ENOSYS in this case. + // We (ab)use this behavior to detect the affected platforms + // and skip the test then. + // On valid platforms the ptrace call should return Errno::EPERM, this + // is already tested by `test_ptrace`. + let err = ptrace::attach(getpid()).unwrap_err(); + if err == Errno::ENOSYS { + return; + } + + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + ptrace::traceme().unwrap(); + // As recommended by ptrace(2), raise SIGTRAP to pause the child + // until the parent is ready to continue + loop { + raise(Signal::SIGTRAP).unwrap(); + } + + }, + Parent { child } => { + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGTRAP))); + ptrace::cont(child, None).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGTRAP))); + ptrace::cont(child, Some(Signal::SIGKILL)).unwrap(); + match waitpid(child, None) { + Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) if pid == child => { + // FIXME It's been observed on some systems (apple) the + // tracee may not be killed but remain as a zombie process + // affecting other wait based tests. Add an extra kill just + // to make sure there are no zombies. + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + while ptrace::cont(child, Some(Signal::SIGKILL)).is_ok() { + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + } + } + _ => panic!("The process should have been killed"), + } + }, + } +} + +#[cfg(target_os = "linux")] +#[test] +fn test_ptrace_interrupt() { + use nix::sys::ptrace; + use nix::sys::signal::Signal; + use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus}; + use nix::unistd::fork; + use nix::unistd::ForkResult::*; + use std::thread::sleep; + use std::time::Duration; + + require_capability!("test_ptrace_interrupt", CAP_SYS_PTRACE); + + let _m = crate::FORK_MTX.lock(); + + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + loop { + sleep(Duration::from_millis(1000)); + } + + }, + Parent { child } => { + ptrace::seize(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap(); + ptrace::interrupt(child).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceEvent(child, Signal::SIGTRAP, 128))); + ptrace::syscall(child, None).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); + ptrace::detach(child, Some(Signal::SIGKILL)).unwrap(); + match waitpid(child, None) { + Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) if pid == child => { + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + while ptrace::cont(child, Some(Signal::SIGKILL)).is_ok() { + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + } + } + _ => panic!("The process should have been killed"), + } + }, + } +} + +// ptrace::{setoptions, getregs} are only available in these platforms +#[cfg(all(target_os = "linux", + any(target_arch = "x86_64", + target_arch = "x86"), + target_env = "gnu"))] +#[test] +fn test_ptrace_syscall() { + use nix::sys::signal::kill; + use nix::sys::ptrace; + use nix::sys::signal::Signal; + use nix::sys::wait::{waitpid, WaitStatus}; + use nix::unistd::fork; + use nix::unistd::getpid; + use nix::unistd::ForkResult::*; + + require_capability!("test_ptrace_syscall", CAP_SYS_PTRACE); + + let _m = crate::FORK_MTX.lock(); + + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + ptrace::traceme().unwrap(); + // first sigstop until parent is ready to continue + let pid = getpid(); + kill(pid, Signal::SIGSTOP).unwrap(); + kill(pid, Signal::SIGTERM).unwrap(); + unsafe { ::libc::_exit(0); } + }, + + Parent { child } => { + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGSTOP))); + + // set this option to recognize syscall-stops + ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap(); + + #[cfg(target_arch = "x86_64")] + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as libc::c_long; + + #[cfg(target_arch = "x86")] + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as libc::c_long; + + // kill entry + ptrace::syscall(child, None).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); + assert_eq!(get_syscall_id(), ::libc::SYS_kill); + + // kill exit + ptrace::syscall(child, None).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); + assert_eq!(get_syscall_id(), ::libc::SYS_kill); + + // receive signal + ptrace::syscall(child, None).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGTERM))); + + // inject signal + ptrace::syscall(child, Signal::SIGTERM).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Signaled(child, Signal::SIGTERM, false))); + }, + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_select.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_select.rs new file mode 100644 index 0000000000000000000000000000000000000000..2f7396b1895e5bcddbd14dfd82a7775b45545285 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_select.rs @@ -0,0 +1,80 @@ +use nix::sys::select::*; +use nix::unistd::{pipe, write}; +use nix::sys::signal::SigSet; +use nix::sys::time::{TimeSpec, TimeValLike}; + +#[test] +pub fn test_pselect() { + let _mtx = crate::SIGNAL_MTX.lock(); + + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let timeout = TimeSpec::seconds(10); + let sigmask = SigSet::empty(); + assert_eq!( + 1, + pselect(None, &mut fd_set, None, None, &timeout, &sigmask).unwrap() + ); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); +} + +#[test] +pub fn test_pselect_nfds2() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let timeout = TimeSpec::seconds(10); + assert_eq!( + 1, + pselect( + ::std::cmp::max(r1, r2) + 1, + &mut fd_set, + None, + None, + &timeout, + None + ).unwrap() + ); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); +} + +macro_rules! generate_fdset_bad_fd_tests { + ($fd:expr, $($method:ident),* $(,)?) => { + $( + #[test] + #[should_panic] + fn $method() { + FdSet::new().$method($fd); + } + )* + } +} + +mod test_fdset_negative_fd { + use super::*; + generate_fdset_bad_fd_tests!(-1, insert, remove, contains); +} + +mod test_fdset_too_large_fd { + use super::*; + use std::convert::TryInto; + generate_fdset_bad_fd_tests!( + FD_SETSIZE.try_into().unwrap(), + insert, + remove, + contains, + ); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_signal.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_signal.rs new file mode 100644 index 0000000000000000000000000000000000000000..fdd2568df463be41ce7e1708df3dd1bdc25fd738 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_signal.rs @@ -0,0 +1,121 @@ +#[cfg(not(target_os = "redox"))] +use nix::errno::Errno; +use nix::sys::signal::*; +use nix::unistd::*; +use std::convert::TryFrom; +use std::sync::atomic::{AtomicBool, Ordering}; + +#[test] +fn test_kill_none() { + kill(getpid(), None).expect("Should be able to send signal to myself."); +} + +#[test] +#[cfg(not(target_os = "fuchsia"))] +fn test_killpg_none() { + killpg(getpgrp(), None) + .expect("Should be able to send signal to my process group."); +} + +#[test] +fn test_old_sigaction_flags() { + let _m = crate::SIGNAL_MTX.lock(); + + extern "C" fn handler(_: ::libc::c_int) {} + let act = SigAction::new( + SigHandler::Handler(handler), + SaFlags::empty(), + SigSet::empty(), + ); + let oact = unsafe { sigaction(SIGINT, &act) }.unwrap(); + let _flags = oact.flags(); + let oact = unsafe { sigaction(SIGINT, &act) }.unwrap(); + let _flags = oact.flags(); +} + +#[test] +fn test_sigprocmask_noop() { + sigprocmask(SigmaskHow::SIG_BLOCK, None, None) + .expect("this should be an effective noop"); +} + +#[test] +fn test_sigprocmask() { + let _m = crate::SIGNAL_MTX.lock(); + + // This needs to be a signal that rust doesn't use in the test harness. + const SIGNAL: Signal = Signal::SIGCHLD; + + let mut old_signal_set = SigSet::empty(); + sigprocmask(SigmaskHow::SIG_BLOCK, None, Some(&mut old_signal_set)) + .expect("expect to be able to retrieve old signals"); + + // Make sure the old set doesn't contain the signal, otherwise the following + // test don't make sense. + assert!(!old_signal_set.contains(SIGNAL), + "the {:?} signal is already blocked, please change to a \ + different one", SIGNAL); + + // Now block the signal. + let mut signal_set = SigSet::empty(); + signal_set.add(SIGNAL); + sigprocmask(SigmaskHow::SIG_BLOCK, Some(&signal_set), None) + .expect("expect to be able to block signals"); + + // And test it again, to make sure the change was effective. + old_signal_set.clear(); + sigprocmask(SigmaskHow::SIG_BLOCK, None, Some(&mut old_signal_set)) + .expect("expect to be able to retrieve old signals"); + assert!(old_signal_set.contains(SIGNAL), + "expected the {:?} to be blocked", SIGNAL); + + // Reset the signal. + sigprocmask(SigmaskHow::SIG_UNBLOCK, Some(&signal_set), None) + .expect("expect to be able to block signals"); +} + +lazy_static! { + static ref SIGNALED: AtomicBool = AtomicBool::new(false); +} + +extern fn test_sigaction_handler(signal: libc::c_int) { + let signal = Signal::try_from(signal).unwrap(); + SIGNALED.store(signal == Signal::SIGINT, Ordering::Relaxed); +} + +#[cfg(not(target_os = "redox"))] +extern fn test_sigaction_action(_: libc::c_int, _: *mut libc::siginfo_t, _: *mut libc::c_void) {} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_signal_sigaction() { + let _m = crate::SIGNAL_MTX.lock(); + + let action_handler = SigHandler::SigAction(test_sigaction_action); + assert_eq!(unsafe { signal(Signal::SIGINT, action_handler) }.unwrap_err(), Errno::ENOTSUP); +} + +#[test] +fn test_signal() { + let _m = crate::SIGNAL_MTX.lock(); + + unsafe { signal(Signal::SIGINT, SigHandler::SigIgn) }.unwrap(); + raise(Signal::SIGINT).unwrap(); + assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), SigHandler::SigIgn); + + let handler = SigHandler::Handler(test_sigaction_handler); + assert_eq!(unsafe { signal(Signal::SIGINT, handler) }.unwrap(), SigHandler::SigDfl); + raise(Signal::SIGINT).unwrap(); + assert!(SIGNALED.load(Ordering::Relaxed)); + + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), handler); + + // System V based OSes (e.g. illumos and Solaris) always resets the + // disposition to SIG_DFL prior to calling the signal handler + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), SigHandler::SigDfl); + + // Restore default signal handler + unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_signalfd.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_signalfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..b6f748b46a42b9332dca1cbc7445721a26d1d763 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_signalfd.rs @@ -0,0 +1,27 @@ +use std::convert::TryFrom; + +#[test] +fn test_signalfd() { + use nix::sys::signalfd::SignalFd; + use nix::sys::signal::{self, raise, Signal, SigSet}; + + // Grab the mutex for altering signals so we don't interfere with other tests. + let _m = crate::SIGNAL_MTX.lock(); + + // Block the SIGUSR1 signal from automatic processing for this thread + let mut mask = SigSet::empty(); + mask.add(signal::SIGUSR1); + mask.thread_block().unwrap(); + + let mut fd = SignalFd::new(&mask).unwrap(); + + // Send a SIGUSR1 signal to the current process. Note that this uses `raise` instead of `kill` + // because `kill` with `getpid` isn't correct during multi-threaded execution like during a + // cargo test session. Instead use `raise` which does the correct thing by default. + raise(signal::SIGUSR1).expect("Error: raise(SIGUSR1) failed"); + + // And now catch that same signal. + let res = fd.read_signal().unwrap().unwrap(); + let signo = Signal::try_from(res.ssi_signo as i32).unwrap(); + assert_eq!(signo, signal::SIGUSR1); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_socket.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_socket.rs new file mode 100644 index 0000000000000000000000000000000000000000..0f6fac6664d56993e59e7bbfec5f7dc8356675ec --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_socket.rs @@ -0,0 +1,1941 @@ +use nix::sys::socket::{AddressFamily, InetAddr, SockAddr, UnixAddr, getsockname, sockaddr, sockaddr_in6, sockaddr_storage_to_addr}; +use std::collections::hash_map::DefaultHasher; +use std::hash::{Hash, Hasher}; +use std::mem::{self, MaybeUninit}; +use std::net::{self, Ipv6Addr, SocketAddr, SocketAddrV6}; +use std::os::unix::io::RawFd; +use std::path::Path; +use std::slice; +use std::str::FromStr; +use libc::{c_char, sockaddr_storage}; +#[cfg(any(target_os = "linux", target_os= "android"))] +use crate::*; + +#[test] +pub fn test_inetv4_addr_to_sock_addr() { + let actual: net::SocketAddr = FromStr::from_str("127.0.0.1:3000").unwrap(); + let addr = InetAddr::from_std(&actual); + + match addr { + InetAddr::V4(addr) => { + let ip: u32 = 0x7f00_0001; + let port: u16 = 3000; + let saddr = addr.sin_addr.s_addr; + + assert_eq!(saddr, ip.to_be()); + assert_eq!(addr.sin_port, port.to_be()); + } + _ => panic!("nope"), + } + + assert_eq!(addr.to_string(), "127.0.0.1:3000"); + + let inet = addr.to_std(); + assert_eq!(actual, inet); +} + +#[test] +pub fn test_inetv4_addr_roundtrip_sockaddr_storage_to_addr() { + let actual: net::SocketAddr = FromStr::from_str("127.0.0.1:3000").unwrap(); + let addr = InetAddr::from_std(&actual); + let sockaddr = SockAddr::new_inet(addr); + + let (storage, ffi_size) = { + let mut storage = MaybeUninit::::zeroed(); + let storage_ptr = storage.as_mut_ptr().cast::(); + let (ffi_ptr, ffi_size) = sockaddr.as_ffi_pair(); + assert_eq!(mem::size_of::(), ffi_size as usize); + unsafe { + storage_ptr.copy_from_nonoverlapping(ffi_ptr as *const sockaddr, 1); + (storage.assume_init(), ffi_size) + } + }; + + let from_storage = sockaddr_storage_to_addr(&storage, ffi_size as usize).unwrap(); + assert_eq!(from_storage, sockaddr); + let from_storage = sockaddr_storage_to_addr(&storage, mem::size_of::()).unwrap(); + assert_eq!(from_storage, sockaddr); +} + +#[test] +pub fn test_inetv6_addr_to_sock_addr() { + let port: u16 = 3000; + let flowinfo: u32 = 1; + let scope_id: u32 = 2; + let ip: Ipv6Addr = "fe80::1".parse().unwrap(); + + let actual = SocketAddr::V6(SocketAddrV6::new(ip, port, flowinfo, scope_id)); + let addr = InetAddr::from_std(&actual); + + match addr { + InetAddr::V6(addr) => { + assert_eq!(addr.sin6_port, port.to_be()); + assert_eq!(addr.sin6_flowinfo, flowinfo); + assert_eq!(addr.sin6_scope_id, scope_id); + } + _ => panic!("nope"), + } + + assert_eq!(actual, addr.to_std()); +} +#[test] +pub fn test_inetv6_addr_roundtrip_sockaddr_storage_to_addr() { + let port: u16 = 3000; + let flowinfo: u32 = 1; + let scope_id: u32 = 2; + let ip: Ipv6Addr = "fe80::1".parse().unwrap(); + + let actual = SocketAddr::V6(SocketAddrV6::new(ip, port, flowinfo, scope_id)); + let addr = InetAddr::from_std(&actual); + let sockaddr = SockAddr::new_inet(addr); + + let (storage, ffi_size) = { + let mut storage = MaybeUninit::::zeroed(); + let storage_ptr = storage.as_mut_ptr().cast::(); + let (ffi_ptr, ffi_size) = sockaddr.as_ffi_pair(); + assert_eq!(mem::size_of::(), ffi_size as usize); + unsafe { + storage_ptr.copy_from_nonoverlapping((ffi_ptr as *const sockaddr).cast::(), 1); + (storage.assume_init(), ffi_size) + } + }; + + let from_storage = sockaddr_storage_to_addr(&storage, ffi_size as usize).unwrap(); + assert_eq!(from_storage, sockaddr); + let from_storage = sockaddr_storage_to_addr(&storage, mem::size_of::()).unwrap(); + assert_eq!(from_storage, sockaddr); +} + +#[test] +pub fn test_path_to_sock_addr() { + let path = "/foo/bar"; + let actual = Path::new(path); + let addr = UnixAddr::new(actual).unwrap(); + + let expect: &[c_char] = unsafe { + slice::from_raw_parts(path.as_ptr() as *const c_char, path.len()) + }; + assert_eq!(unsafe { &(*addr.as_ptr()).sun_path[..8] }, expect); + + assert_eq!(addr.path(), Some(actual)); +} + +fn calculate_hash(t: &T) -> u64 { + let mut s = DefaultHasher::new(); + t.hash(&mut s); + s.finish() +} + +#[test] +pub fn test_addr_equality_path() { + let path = "/foo/bar"; + let actual = Path::new(path); + let addr1 = UnixAddr::new(actual).unwrap(); + let mut addr2 = addr1; + + unsafe { (*addr2.as_mut_ptr()).sun_path[10] = 127 }; + + assert_eq!(addr1, addr2); + assert_eq!(calculate_hash(&addr1), calculate_hash(&addr2)); +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +pub fn test_abstract_sun_path_too_long() { + let name = String::from("nix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0testttttnix\0abstract\0test\0make\0sure\0this\0is\0long\0enough"); + let addr = UnixAddr::new_abstract(name.as_bytes()); + assert!(addr.is_err()); +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +pub fn test_addr_equality_abstract() { + let name = String::from("nix\0abstract\0test"); + let addr1 = UnixAddr::new_abstract(name.as_bytes()).unwrap(); + let mut addr2 = addr1; + + assert_eq!(addr1, addr2); + assert_eq!(calculate_hash(&addr1), calculate_hash(&addr2)); + + unsafe { (*addr2.as_mut_ptr()).sun_path[17] = 127 }; + assert_ne!(addr1, addr2); + assert_ne!(calculate_hash(&addr1), calculate_hash(&addr2)); +} + +// Test getting/setting abstract addresses (without unix socket creation) +#[cfg(target_os = "linux")] +#[test] +pub fn test_abstract_uds_addr() { + let empty = String::new(); + let addr = UnixAddr::new_abstract(empty.as_bytes()).unwrap(); + let sun_path: [u8; 0] = []; + assert_eq!(addr.as_abstract(), Some(&sun_path[..])); + + let name = String::from("nix\0abstract\0test"); + let addr = UnixAddr::new_abstract(name.as_bytes()).unwrap(); + let sun_path = [ + 110u8, 105, 120, 0, 97, 98, 115, 116, 114, 97, 99, 116, 0, 116, 101, 115, 116 + ]; + assert_eq!(addr.as_abstract(), Some(&sun_path[..])); + assert_eq!(addr.path(), None); + + // Internally, name is null-prefixed (abstract namespace) + assert_eq!(unsafe { (*addr.as_ptr()).sun_path[0] }, 0); +} + +#[test] +pub fn test_getsockname() { + use nix::sys::socket::{socket, AddressFamily, SockType, SockFlag}; + use nix::sys::socket::{bind, SockAddr}; + + let tempdir = tempfile::tempdir().unwrap(); + let sockname = tempdir.path().join("sock"); + let sock = socket(AddressFamily::Unix, SockType::Stream, SockFlag::empty(), None) + .expect("socket failed"); + let sockaddr = SockAddr::new_unix(&sockname).unwrap(); + bind(sock, &sockaddr).expect("bind failed"); + assert_eq!(sockaddr, getsockname(sock).expect("getsockname failed")); +} + +#[test] +pub fn test_socketpair() { + use nix::unistd::{read, write}; + use nix::sys::socket::{socketpair, AddressFamily, SockType, SockFlag}; + + let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); + write(fd1, b"hello").unwrap(); + let mut buf = [0;5]; + read(fd2, &mut buf).unwrap(); + + assert_eq!(&buf[..], b"hello"); +} + +mod recvfrom { + use nix::Result; + use nix::sys::socket::*; + use std::thread; + use super::*; + + const MSG: &[u8] = b"Hello, World!"; + + fn sendrecv(rsock: RawFd, ssock: RawFd, f_send: Fs, mut f_recv: Fr) -> Option + where + Fs: Fn(RawFd, &[u8], MsgFlags) -> Result + Send + 'static, + Fr: FnMut(usize, Option), + { + let mut buf: [u8; 13] = [0u8; 13]; + let mut l = 0; + let mut from = None; + + let send_thread = thread::spawn(move || { + let mut l = 0; + while l < std::mem::size_of_val(MSG) { + l += f_send(ssock, &MSG[l..], MsgFlags::empty()).unwrap(); + } + }); + + while l < std::mem::size_of_val(MSG) { + let (len, from_) = recvfrom(rsock, &mut buf[l..]).unwrap(); + f_recv(len, from_); + from = from_; + l += len; + } + assert_eq!(&buf, MSG); + send_thread.join().unwrap(); + from + } + + #[test] + pub fn stream() { + let (fd2, fd1) = socketpair(AddressFamily::Unix, SockType::Stream, + None, SockFlag::empty()).unwrap(); + // Ignore from for stream sockets + let _ = sendrecv(fd1, fd2, |s, m, flags| { + send(s, m, flags) + }, |_, _| {}); + } + + #[test] + pub fn udp() { + let std_sa = SocketAddr::from_str("127.0.0.1:6789").unwrap(); + let inet_addr = InetAddr::from_std(&std_sa); + let sock_addr = SockAddr::new_inet(inet_addr); + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + let from = sendrecv(rsock, ssock, move |s, m, flags| { + sendto(s, m, &sock_addr, flags) + },|_, _| {}); + // UDP sockets should set the from address + assert_eq!(AddressFamily::Inet, from.unwrap().family()); + } + + #[cfg(target_os = "linux")] + mod udp_offload { + use super::*; + use nix::sys::uio::IoVec; + use nix::sys::socket::sockopt::{UdpGroSegment, UdpGsoSegment}; + + #[test] + // Disable the test under emulation because it fails in Cirrus-CI. Lack + // of QEMU support is suspected. + #[cfg_attr(qemu, ignore)] + pub fn gso() { + require_kernel_version!(udp_offload::gso, ">= 4.18"); + + // In this test, we send the data and provide a GSO segment size. + // Since we are sending the buffer of size 13, six UDP packets + // with size 2 and two UDP packet with size 1 will be sent. + let segment_size: u16 = 2; + + let std_sa = SocketAddr::from_str("127.0.0.1:6791").unwrap(); + let inet_addr = InetAddr::from_std(&std_sa); + let sock_addr = SockAddr::new_inet(inet_addr); + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + + setsockopt(rsock, UdpGsoSegment, &(segment_size as _)) + .expect("setsockopt UDP_SEGMENT failed"); + + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + + let mut num_packets_received: i32 = 0; + + sendrecv(rsock, ssock, move |s, m, flags| { + let iov = [IoVec::from_slice(m)]; + let cmsg = ControlMessage::UdpGsoSegments(&segment_size); + sendmsg(s, &iov, &[cmsg], flags, Some(&sock_addr)) + }, { + let num_packets_received_ref = &mut num_packets_received; + + move |len, _| { + // check that we receive UDP packets with payload size + // less or equal to segment size + assert!(len <= segment_size as usize); + *num_packets_received_ref += 1; + } + }); + + // Buffer size is 13, we will receive six packets of size 2, + // and one packet of size 1. + assert_eq!(7, num_packets_received); + } + + #[test] + // Disable the test on emulated platforms because it fails in Cirrus-CI. + // Lack of QEMU support is suspected. + #[cfg_attr(qemu, ignore)] + pub fn gro() { + require_kernel_version!(udp_offload::gro, ">= 5.3"); + + // It's hard to guarantee receiving GRO packets. Just checking + // that `setsockopt` doesn't fail with error + + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + + setsockopt(rsock, UdpGroSegment, &true) + .expect("setsockopt UDP_GRO failed"); + } + } + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + ))] + #[test] + pub fn udp_sendmmsg() { + use nix::sys::uio::IoVec; + + let std_sa = SocketAddr::from_str("127.0.0.1:6793").unwrap(); + let std_sa2 = SocketAddr::from_str("127.0.0.1:6794").unwrap(); + let inet_addr = InetAddr::from_std(&std_sa); + let inet_addr2 = InetAddr::from_std(&std_sa2); + let sock_addr = SockAddr::new_inet(inet_addr); + let sock_addr2 = SockAddr::new_inet(inet_addr2); + + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + + let from = sendrecv(rsock, ssock, move |s, m, flags| { + let iov = [IoVec::from_slice(m)]; + let mut msgs = vec![ + SendMmsgData { + iov: &iov, + cmsgs: &[], + addr: Some(sock_addr), + _lt: Default::default(), + } + ]; + + let batch_size = 15; + + for _ in 0..batch_size { + msgs.push( + SendMmsgData { + iov: &iov, + cmsgs: &[], + addr: Some(sock_addr2), + _lt: Default::default(), + } + ); + } + sendmmsg(s, msgs.iter(), flags) + .map(move |sent_bytes| { + assert!(!sent_bytes.is_empty()); + for sent in &sent_bytes { + assert_eq!(*sent, m.len()); + } + sent_bytes.len() + }) + }, |_, _ | {}); + // UDP sockets should set the from address + assert_eq!(AddressFamily::Inet, from.unwrap().family()); + } + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + ))] + #[test] + pub fn udp_recvmmsg() { + use nix::sys::uio::IoVec; + use nix::sys::socket::{MsgFlags, recvmmsg}; + + const NUM_MESSAGES_SENT: usize = 2; + const DATA: [u8; 2] = [1,2]; + + let std_sa = SocketAddr::from_str("127.0.0.1:6798").unwrap(); + let inet_addr = InetAddr::from_std(&std_sa); + let sock_addr = SockAddr::new_inet(inet_addr); + + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + + let send_thread = thread::spawn(move || { + for _ in 0..NUM_MESSAGES_SENT { + sendto(ssock, &DATA[..], &sock_addr, MsgFlags::empty()).unwrap(); + } + }); + + let mut msgs = std::collections::LinkedList::new(); + + // Buffers to receive exactly `NUM_MESSAGES_SENT` messages + let mut receive_buffers = [[0u8; 32]; NUM_MESSAGES_SENT]; + let iovs: Vec<_> = receive_buffers.iter_mut().map(|buf| { + [IoVec::from_mut_slice(&mut buf[..])] + }).collect(); + + for iov in &iovs { + msgs.push_back(RecvMmsgData { + iov, + cmsg_buffer: None, + }) + }; + + let res = recvmmsg(rsock, &mut msgs, MsgFlags::empty(), None).expect("recvmmsg"); + assert_eq!(res.len(), DATA.len()); + + for RecvMsg { address, bytes, .. } in res.into_iter() { + assert_eq!(AddressFamily::Inet, address.unwrap().family()); + assert_eq!(DATA.len(), bytes); + } + + for buf in &receive_buffers { + assert_eq!(&buf[..DATA.len()], DATA); + } + + send_thread.join().unwrap(); + } + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + ))] + #[test] + pub fn udp_recvmmsg_dontwait_short_read() { + use nix::sys::uio::IoVec; + use nix::sys::socket::{MsgFlags, recvmmsg}; + + const NUM_MESSAGES_SENT: usize = 2; + const DATA: [u8; 4] = [1,2,3,4]; + + let std_sa = SocketAddr::from_str("127.0.0.1:6799").unwrap(); + let inet_addr = InetAddr::from_std(&std_sa); + let sock_addr = SockAddr::new_inet(inet_addr); + + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + + let send_thread = thread::spawn(move || { + for _ in 0..NUM_MESSAGES_SENT { + sendto(ssock, &DATA[..], &sock_addr, MsgFlags::empty()).unwrap(); + } + }); + // Ensure we've sent all the messages before continuing so `recvmmsg` + // will return right away + send_thread.join().unwrap(); + + let mut msgs = std::collections::LinkedList::new(); + + // Buffers to receive >`NUM_MESSAGES_SENT` messages to ensure `recvmmsg` + // will return when there are fewer than requested messages in the + // kernel buffers when using `MSG_DONTWAIT`. + let mut receive_buffers = [[0u8; 32]; NUM_MESSAGES_SENT + 2]; + let iovs: Vec<_> = receive_buffers.iter_mut().map(|buf| { + [IoVec::from_mut_slice(&mut buf[..])] + }).collect(); + + for iov in &iovs { + msgs.push_back(RecvMmsgData { + iov, + cmsg_buffer: None, + }) + }; + + let res = recvmmsg(rsock, &mut msgs, MsgFlags::MSG_DONTWAIT, None).expect("recvmmsg"); + assert_eq!(res.len(), NUM_MESSAGES_SENT); + + for RecvMsg { address, bytes, .. } in res.into_iter() { + assert_eq!(AddressFamily::Inet, address.unwrap().family()); + assert_eq!(DATA.len(), bytes); + } + + for buf in &receive_buffers[..NUM_MESSAGES_SENT] { + assert_eq!(&buf[..DATA.len()], DATA); + } + } +} + +// Test error handling of our recvmsg wrapper +#[test] +pub fn test_recvmsg_ebadf() { + use nix::errno::Errno; + use nix::sys::socket::{MsgFlags, recvmsg}; + use nix::sys::uio::IoVec; + + let mut buf = [0u8; 5]; + let iov = [IoVec::from_mut_slice(&mut buf[..])]; + let fd = -1; // Bad file descriptor + let r = recvmsg(fd, &iov, None, MsgFlags::empty()); + assert_eq!(r.err().unwrap(), Errno::EBADF); +} + +// Disable the test on emulated platforms due to a bug in QEMU versions < +// 2.12.0. https://bugs.launchpad.net/qemu/+bug/1701808 +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_scm_rights() { + use nix::sys::uio::IoVec; + use nix::unistd::{pipe, read, write, close}; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, + AddressFamily, SockType, SockFlag, + ControlMessage, ControlMessageOwned, MsgFlags}; + + let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); + let (r, w) = pipe().unwrap(); + let mut received_r: Option = None; + + { + let iov = [IoVec::from_slice(b"hello")]; + let fds = [r]; + let cmsg = ControlMessage::ScmRights(&fds); + assert_eq!(sendmsg(fd1, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(), 5); + close(r).unwrap(); + close(fd1).unwrap(); + } + + { + let mut buf = [0u8; 5]; + let iov = [IoVec::from_mut_slice(&mut buf[..])]; + let mut cmsgspace = cmsg_space!([RawFd; 1]); + let msg = recvmsg(fd2, &iov, Some(&mut cmsgspace), MsgFlags::empty()).unwrap(); + + for cmsg in msg.cmsgs() { + if let ControlMessageOwned::ScmRights(fd) = cmsg { + assert_eq!(received_r, None); + assert_eq!(fd.len(), 1); + received_r = Some(fd[0]); + } else { + panic!("unexpected cmsg"); + } + } + assert_eq!(msg.bytes, 5); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + close(fd2).unwrap(); + } + + let received_r = received_r.expect("Did not receive passed fd"); + // Ensure that the received file descriptor works + write(w, b"world").unwrap(); + let mut buf = [0u8; 5]; + read(received_r, &mut buf).unwrap(); + assert_eq!(&buf[..], b"world"); + close(received_r).unwrap(); + close(w).unwrap(); +} + +// Disable the test on emulated platforms due to not enabled support of AF_ALG in QEMU from rust cross +#[cfg(any(target_os = "linux", target_os= "android"))] +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_af_alg_cipher() { + use nix::sys::uio::IoVec; + use nix::unistd::read; + use nix::sys::socket::{socket, sendmsg, bind, accept, setsockopt, + AddressFamily, SockType, SockFlag, SockAddr, + ControlMessage, MsgFlags}; + use nix::sys::socket::sockopt::AlgSetKey; + + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); + // Travis's seccomp profile blocks AF_ALG + // https://docs.docker.com/engine/security/seccomp/ + skip_if_seccomp!(test_af_alg_cipher); + + let alg_type = "skcipher"; + let alg_name = "ctr-aes-aesni"; + // 256-bits secret key + let key = vec![0u8; 32]; + // 16-bytes IV + let iv_len = 16; + let iv = vec![1u8; iv_len]; + // 256-bytes plain payload + let payload_len = 256; + let payload = vec![2u8; payload_len]; + + let sock = socket(AddressFamily::Alg, SockType::SeqPacket, SockFlag::empty(), None) + .expect("socket failed"); + + let sockaddr = SockAddr::new_alg(alg_type, alg_name); + bind(sock, &sockaddr).expect("bind failed"); + + if let SockAddr::Alg(alg) = sockaddr { + assert_eq!(alg.alg_name().to_string_lossy(), alg_name); + assert_eq!(alg.alg_type().to_string_lossy(), alg_type); + } else { + panic!("unexpected SockAddr"); + } + + setsockopt(sock, AlgSetKey::default(), &key).expect("setsockopt"); + let session_socket = accept(sock).expect("accept failed"); + + let msgs = [ControlMessage::AlgSetOp(&libc::ALG_OP_ENCRYPT), ControlMessage::AlgSetIv(iv.as_slice())]; + let iov = IoVec::from_slice(&payload); + sendmsg(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg encrypt"); + + // allocate buffer for encrypted data + let mut encrypted = vec![0u8; payload_len]; + let num_bytes = read(session_socket, &mut encrypted).expect("read encrypt"); + assert_eq!(num_bytes, payload_len); + + let iov = IoVec::from_slice(&encrypted); + + let iv = vec![1u8; iv_len]; + + let msgs = [ControlMessage::AlgSetOp(&libc::ALG_OP_DECRYPT), ControlMessage::AlgSetIv(iv.as_slice())]; + sendmsg(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg decrypt"); + + // allocate buffer for decrypted data + let mut decrypted = vec![0u8; payload_len]; + let num_bytes = read(session_socket, &mut decrypted).expect("read decrypt"); + + assert_eq!(num_bytes, payload_len); + assert_eq!(decrypted, payload); +} + +// Disable the test on emulated platforms due to not enabled support of AF_ALG +// in QEMU from rust cross +#[cfg(any(target_os = "linux", target_os= "android"))] +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_af_alg_aead() { + use libc::{ALG_OP_DECRYPT, ALG_OP_ENCRYPT}; + use nix::fcntl::{fcntl, FcntlArg, OFlag}; + use nix::sys::uio::IoVec; + use nix::unistd::{read, close}; + use nix::sys::socket::{socket, sendmsg, bind, accept, setsockopt, + AddressFamily, SockType, SockFlag, SockAddr, + ControlMessage, MsgFlags}; + use nix::sys::socket::sockopt::{AlgSetKey, AlgSetAeadAuthSize}; + + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); + // Travis's seccomp profile blocks AF_ALG + // https://docs.docker.com/engine/security/seccomp/ + skip_if_seccomp!(test_af_alg_aead); + + let auth_size = 4usize; + let assoc_size = 16u32; + + let alg_type = "aead"; + let alg_name = "gcm(aes)"; + // 256-bits secret key + let key = vec![0u8; 32]; + // 12-bytes IV + let iv_len = 12; + let iv = vec![1u8; iv_len]; + // 256-bytes plain payload + let payload_len = 256; + let mut payload = vec![2u8; payload_len + (assoc_size as usize) + auth_size]; + + for i in 0..assoc_size { + payload[i as usize] = 10; + } + + let len = payload.len(); + + for i in 0..auth_size { + payload[len - 1 - i] = 0; + } + + let sock = socket(AddressFamily::Alg, SockType::SeqPacket, SockFlag::empty(), None) + .expect("socket failed"); + + let sockaddr = SockAddr::new_alg(alg_type, alg_name); + bind(sock, &sockaddr).expect("bind failed"); + + setsockopt(sock, AlgSetAeadAuthSize, &auth_size).expect("setsockopt AlgSetAeadAuthSize"); + setsockopt(sock, AlgSetKey::default(), &key).expect("setsockopt AlgSetKey"); + let session_socket = accept(sock).expect("accept failed"); + + let msgs = [ + ControlMessage::AlgSetOp(&ALG_OP_ENCRYPT), + ControlMessage::AlgSetIv(iv.as_slice()), + ControlMessage::AlgSetAeadAssoclen(&assoc_size)]; + let iov = IoVec::from_slice(&payload); + sendmsg(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg encrypt"); + + // allocate buffer for encrypted data + let mut encrypted = vec![0u8; (assoc_size as usize) + payload_len + auth_size]; + let num_bytes = read(session_socket, &mut encrypted).expect("read encrypt"); + assert_eq!(num_bytes, payload_len + auth_size + (assoc_size as usize)); + close(session_socket).expect("close"); + + for i in 0..assoc_size { + encrypted[i as usize] = 10; + } + + let iov = IoVec::from_slice(&encrypted); + + let iv = vec![1u8; iv_len]; + + let session_socket = accept(sock).expect("accept failed"); + + let msgs = [ + ControlMessage::AlgSetOp(&ALG_OP_DECRYPT), + ControlMessage::AlgSetIv(iv.as_slice()), + ControlMessage::AlgSetAeadAssoclen(&assoc_size), + ]; + sendmsg(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg decrypt"); + + // allocate buffer for decrypted data + let mut decrypted = vec![0u8; payload_len + (assoc_size as usize) + auth_size]; + // Starting with kernel 4.9, the interface changed slightly such that the + // authentication tag memory is only needed in the output buffer for encryption + // and in the input buffer for decryption. + // Do not block on read, as we may have fewer bytes than buffer size + fcntl(session_socket,FcntlArg::F_SETFL(OFlag::O_NONBLOCK)).expect("fcntl non_blocking"); + let num_bytes = read(session_socket, &mut decrypted).expect("read decrypt"); + + assert!(num_bytes >= payload_len + (assoc_size as usize)); + assert_eq!(decrypted[(assoc_size as usize)..(payload_len + (assoc_size as usize))], payload[(assoc_size as usize)..payload_len + (assoc_size as usize)]); +} + +// Verify `ControlMessage::Ipv4PacketInfo` for `sendmsg`. +// This creates a (udp) socket bound to localhost, then sends a message to +// itself but uses Ipv4PacketInfo to force the source address to be localhost. +// +// This would be a more interesting test if we could assume that the test host +// has more than one IP address (since we could select a different address to +// test from). +#[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd"))] +#[test] +pub fn test_sendmsg_ipv4packetinfo() { + use cfg_if::cfg_if; + use nix::sys::uio::IoVec; + use nix::sys::socket::{socket, sendmsg, bind, + AddressFamily, SockType, SockFlag, SockAddr, + ControlMessage, MsgFlags}; + + let sock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None) + .expect("socket failed"); + + let std_sa = SocketAddr::from_str("127.0.0.1:4000").unwrap(); + let inet_addr = InetAddr::from_std(&std_sa); + let sock_addr = SockAddr::new_inet(inet_addr); + + bind(sock, &sock_addr).expect("bind failed"); + + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoVec::from_slice(&slice)]; + + if let InetAddr::V4(sin) = inet_addr { + cfg_if! { + if #[cfg(target_os = "netbsd")] { + let _dontcare = sin; + let pi = libc::in_pktinfo { + ipi_ifindex: 0, /* Unspecified interface */ + ipi_addr: libc::in_addr { s_addr: 0 }, + }; + } else { + let pi = libc::in_pktinfo { + ipi_ifindex: 0, /* Unspecified interface */ + ipi_addr: libc::in_addr { s_addr: 0 }, + ipi_spec_dst: sin.sin_addr, + }; + } + } + + let cmsg = [ControlMessage::Ipv4PacketInfo(&pi)]; + + sendmsg(sock, &iov, &cmsg, MsgFlags::empty(), Some(&sock_addr)) + .expect("sendmsg"); + } else { + panic!("No IPv4 addresses available for testing?"); + } +} + +// Verify `ControlMessage::Ipv6PacketInfo` for `sendmsg`. +// This creates a (udp) socket bound to ip6-localhost, then sends a message to +// itself but uses Ipv6PacketInfo to force the source address to be +// ip6-localhost. +// +// This would be a more interesting test if we could assume that the test host +// has more than one IP address (since we could select a different address to +// test from). +#[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "freebsd"))] +#[test] +pub fn test_sendmsg_ipv6packetinfo() { + use nix::errno::Errno; + use nix::sys::uio::IoVec; + use nix::sys::socket::{socket, sendmsg, bind, + AddressFamily, SockType, SockFlag, SockAddr, + ControlMessage, MsgFlags}; + + let sock = socket(AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None) + .expect("socket failed"); + + let std_sa = SocketAddr::from_str("[::1]:6000").unwrap(); + let inet_addr = InetAddr::from_std(&std_sa); + let sock_addr = SockAddr::new_inet(inet_addr); + + if let Err(Errno::EADDRNOTAVAIL) = bind(sock, &sock_addr) { + println!("IPv6 not available, skipping test."); + return; + } + + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoVec::from_slice(&slice)]; + + if let InetAddr::V6(sin) = inet_addr { + let pi = libc::in6_pktinfo { + ipi6_ifindex: 0, /* Unspecified interface */ + ipi6_addr: sin.sin6_addr, + }; + + let cmsg = [ControlMessage::Ipv6PacketInfo(&pi)]; + + sendmsg(sock, &iov, &cmsg, MsgFlags::empty(), Some(&sock_addr)) + .expect("sendmsg"); + } else { + println!("No IPv6 addresses available for testing: skipping testing Ipv6PacketInfo"); + } +} + +/// Tests that passing multiple fds using a single `ControlMessage` works. +// Disable the test on emulated platforms due to a bug in QEMU versions < +// 2.12.0. https://bugs.launchpad.net/qemu/+bug/1701808 +#[cfg_attr(qemu, ignore)] +#[test] +fn test_scm_rights_single_cmsg_multiple_fds() { + use std::os::unix::net::UnixDatagram; + use std::os::unix::io::{RawFd, AsRawFd}; + use std::thread; + use nix::sys::socket::{ControlMessage, ControlMessageOwned, MsgFlags, + sendmsg, recvmsg}; + use nix::sys::uio::IoVec; + + let (send, receive) = UnixDatagram::pair().unwrap(); + let thread = thread::spawn(move || { + let mut buf = [0u8; 8]; + let iovec = [IoVec::from_mut_slice(&mut buf)]; + let mut space = cmsg_space!([RawFd; 2]); + let msg = recvmsg( + receive.as_raw_fd(), + &iovec, + Some(&mut space), + MsgFlags::empty() + ).unwrap(); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + + let mut cmsgs = msg.cmsgs(); + match cmsgs.next() { + Some(ControlMessageOwned::ScmRights(fds)) => { + assert_eq!(fds.len(), 2, + "unexpected fd count (expected 2 fds, got {})", + fds.len()); + }, + _ => panic!(), + } + assert!(cmsgs.next().is_none(), "unexpected control msg"); + + assert_eq!(msg.bytes, 8); + assert_eq!(iovec[0].as_slice(), [1u8, 2, 3, 4, 5, 6, 7, 8]); + }); + + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoVec::from_slice(&slice)]; + let fds = [libc::STDIN_FILENO, libc::STDOUT_FILENO]; // pass stdin and stdout + let cmsg = [ControlMessage::ScmRights(&fds)]; + sendmsg(send.as_raw_fd(), &iov, &cmsg, MsgFlags::empty(), None).unwrap(); + thread.join().unwrap(); +} + +// Verify `sendmsg` builds a valid `msghdr` when passing an empty +// `cmsgs` argument. This should result in a msghdr with a nullptr +// msg_control field and a msg_controllen of 0 when calling into the +// raw `sendmsg`. +#[test] +pub fn test_sendmsg_empty_cmsgs() { + use nix::sys::uio::IoVec; + use nix::unistd::close; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, + AddressFamily, SockType, SockFlag, MsgFlags}; + + let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); + + { + let iov = [IoVec::from_slice(b"hello")]; + assert_eq!(sendmsg(fd1, &iov, &[], MsgFlags::empty(), None).unwrap(), 5); + close(fd1).unwrap(); + } + + { + let mut buf = [0u8; 5]; + let iov = [IoVec::from_mut_slice(&mut buf[..])]; + let mut cmsgspace = cmsg_space!([RawFd; 1]); + let msg = recvmsg(fd2, &iov, Some(&mut cmsgspace), MsgFlags::empty()).unwrap(); + + for _ in msg.cmsgs() { + panic!("unexpected cmsg"); + } + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + assert_eq!(msg.bytes, 5); + close(fd2).unwrap(); + } +} + +#[cfg(any( + target_os = "android", + target_os = "linux", + target_os = "freebsd", + target_os = "dragonfly", +))] +#[test] +fn test_scm_credentials() { + use nix::sys::uio::IoVec; + use nix::unistd::{close, getpid, getuid, getgid}; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, + AddressFamily, SockType, SockFlag, + ControlMessage, ControlMessageOwned, MsgFlags, + UnixCredentials}; + #[cfg(any(target_os = "android", target_os = "linux"))] + use nix::sys::socket::{setsockopt, sockopt::PassCred}; + + let (send, recv) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); + #[cfg(any(target_os = "android", target_os = "linux"))] + setsockopt(recv, PassCred, &true).unwrap(); + + { + let iov = [IoVec::from_slice(b"hello")]; + #[cfg(any(target_os = "android", target_os = "linux"))] + let cred = UnixCredentials::new(); + #[cfg(any(target_os = "android", target_os = "linux"))] + let cmsg = ControlMessage::ScmCredentials(&cred); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + let cmsg = ControlMessage::ScmCreds; + assert_eq!(sendmsg(send, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(), 5); + close(send).unwrap(); + } + + { + let mut buf = [0u8; 5]; + let iov = [IoVec::from_mut_slice(&mut buf[..])]; + let mut cmsgspace = cmsg_space!(UnixCredentials); + let msg = recvmsg(recv, &iov, Some(&mut cmsgspace), MsgFlags::empty()).unwrap(); + let mut received_cred = None; + + for cmsg in msg.cmsgs() { + let cred = match cmsg { + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessageOwned::ScmCredentials(cred) => cred, + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessageOwned::ScmCreds(cred) => cred, + other => panic!("unexpected cmsg {:?}", other), + }; + assert!(received_cred.is_none()); + assert_eq!(cred.pid(), getpid().as_raw()); + assert_eq!(cred.uid(), getuid().as_raw()); + assert_eq!(cred.gid(), getgid().as_raw()); + received_cred = Some(cred); + } + received_cred.expect("no creds received"); + assert_eq!(msg.bytes, 5); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + close(recv).unwrap(); + } +} + +/// Ensure that we can send `SCM_CREDENTIALS` and `SCM_RIGHTS` with a single +/// `sendmsg` call. +#[cfg(any(target_os = "android", target_os = "linux"))] +// qemu's handling of multiple cmsgs is bugged, ignore tests under emulation +// see https://bugs.launchpad.net/qemu/+bug/1781280 +#[cfg_attr(qemu, ignore)] +#[test] +fn test_scm_credentials_and_rights() { + let space = cmsg_space!(libc::ucred, RawFd); + test_impl_scm_credentials_and_rights(space); +} + +/// Ensure that passing a an oversized control message buffer to recvmsg +/// still works. +#[cfg(any(target_os = "android", target_os = "linux"))] +// qemu's handling of multiple cmsgs is bugged, ignore tests under emulation +// see https://bugs.launchpad.net/qemu/+bug/1781280 +#[cfg_attr(qemu, ignore)] +#[test] +fn test_too_large_cmsgspace() { + let space = vec![0u8; 1024]; + test_impl_scm_credentials_and_rights(space); +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_impl_scm_credentials_and_rights(mut space: Vec) { + use libc::ucred; + use nix::sys::uio::IoVec; + use nix::unistd::{pipe, write, close, getpid, getuid, getgid}; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, setsockopt, + SockType, SockFlag, + ControlMessage, ControlMessageOwned, MsgFlags}; + use nix::sys::socket::sockopt::PassCred; + + let (send, recv) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); + setsockopt(recv, PassCred, &true).unwrap(); + + let (r, w) = pipe().unwrap(); + let mut received_r: Option = None; + + { + let iov = [IoVec::from_slice(b"hello")]; + let cred = ucred { + pid: getpid().as_raw(), + uid: getuid().as_raw(), + gid: getgid().as_raw(), + }.into(); + let fds = [r]; + let cmsgs = [ + ControlMessage::ScmCredentials(&cred), + ControlMessage::ScmRights(&fds), + ]; + assert_eq!(sendmsg(send, &iov, &cmsgs, MsgFlags::empty(), None).unwrap(), 5); + close(r).unwrap(); + close(send).unwrap(); + } + + { + let mut buf = [0u8; 5]; + let iov = [IoVec::from_mut_slice(&mut buf[..])]; + let msg = recvmsg(recv, &iov, Some(&mut space), MsgFlags::empty()).unwrap(); + let mut received_cred = None; + + assert_eq!(msg.cmsgs().count(), 2, "expected 2 cmsgs"); + + for cmsg in msg.cmsgs() { + match cmsg { + ControlMessageOwned::ScmRights(fds) => { + assert_eq!(received_r, None, "already received fd"); + assert_eq!(fds.len(), 1); + received_r = Some(fds[0]); + } + ControlMessageOwned::ScmCredentials(cred) => { + assert!(received_cred.is_none()); + assert_eq!(cred.pid(), getpid().as_raw()); + assert_eq!(cred.uid(), getuid().as_raw()); + assert_eq!(cred.gid(), getgid().as_raw()); + received_cred = Some(cred); + } + _ => panic!("unexpected cmsg"), + } + } + received_cred.expect("no creds received"); + assert_eq!(msg.bytes, 5); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + close(recv).unwrap(); + } + + let received_r = received_r.expect("Did not receive passed fd"); + // Ensure that the received file descriptor works + write(w, b"world").unwrap(); + let mut buf = [0u8; 5]; + read(received_r, &mut buf).unwrap(); + assert_eq!(&buf[..], b"world"); + close(received_r).unwrap(); + close(w).unwrap(); +} + +// Test creating and using named unix domain sockets +#[test] +pub fn test_unixdomain() { + use nix::sys::socket::{SockType, SockFlag}; + use nix::sys::socket::{bind, socket, connect, listen, accept, SockAddr}; + use nix::unistd::{read, write, close}; + use std::thread; + + let tempdir = tempfile::tempdir().unwrap(); + let sockname = tempdir.path().join("sock"); + let s1 = socket(AddressFamily::Unix, SockType::Stream, + SockFlag::empty(), None).expect("socket failed"); + let sockaddr = SockAddr::new_unix(&sockname).unwrap(); + bind(s1, &sockaddr).expect("bind failed"); + listen(s1, 10).expect("listen failed"); + + let thr = thread::spawn(move || { + let s2 = socket(AddressFamily::Unix, SockType::Stream, SockFlag::empty(), None) + .expect("socket failed"); + connect(s2, &sockaddr).expect("connect failed"); + write(s2, b"hello").expect("write failed"); + close(s2).unwrap(); + }); + + let s3 = accept(s1).expect("accept failed"); + + let mut buf = [0;5]; + read(s3, &mut buf).unwrap(); + close(s3).unwrap(); + close(s1).unwrap(); + thr.join().unwrap(); + + assert_eq!(&buf[..], b"hello"); +} + +// Test creating and using named system control sockets +#[cfg(any(target_os = "macos", target_os = "ios"))] +#[test] +pub fn test_syscontrol() { + use nix::errno::Errno; + use nix::sys::socket::{socket, SockAddr, SockType, SockFlag, SockProtocol}; + + let fd = socket(AddressFamily::System, SockType::Datagram, + SockFlag::empty(), SockProtocol::KextControl) + .expect("socket failed"); + let _sockaddr = SockAddr::new_sys_control(fd, "com.apple.net.utun_control", 0).expect("resolving sys_control name failed"); + assert_eq!(SockAddr::new_sys_control(fd, "foo.bar.lol", 0).err(), Some(Errno::ENOENT)); + + // requires root privileges + // connect(fd, &sockaddr).expect("connect failed"); +} + +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +fn loopback_address(family: AddressFamily) -> Option { + use std::io; + use std::io::Write; + use nix::ifaddrs::getifaddrs; + use nix::net::if_::*; + + let addrs = match getifaddrs() { + Ok(iter) => iter, + Err(e) => { + let stdioerr = io::stderr(); + let mut handle = stdioerr.lock(); + writeln!(handle, "getifaddrs: {:?}", e).unwrap(); + return None; + }, + }; + // return first address matching family + for ifaddr in addrs { + if ifaddr.flags.contains(InterfaceFlags::IFF_LOOPBACK) { + match ifaddr.address { + Some(SockAddr::Inet(InetAddr::V4(..))) => { + match family { + AddressFamily::Inet => return Some(ifaddr), + _ => continue + } + }, + Some(SockAddr::Inet(InetAddr::V6(..))) => { + match family { + AddressFamily::Inet6 => return Some(ifaddr), + _ => continue + } + }, + _ => continue, + } + } + } + None +} + +#[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", +))] +// qemu doesn't seem to be emulating this correctly in these architectures +#[cfg_attr(all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) +), ignore)] +#[test] +pub fn test_recv_ipv4pktinfo() { + use nix::sys::socket::sockopt::Ipv4PacketInfo; + use nix::sys::socket::{bind, SockFlag, SockType}; + use nix::sys::socket::{getsockname, setsockopt, socket}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use nix::sys::uio::IoVec; + use nix::net::if_::*; + + let lo_ifaddr = loopback_address(AddressFamily::Inet); + let (lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => (ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface")), + None => return, + }; + let receive = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv4PacketInfo, &true).expect("setsockopt failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoVec::from_slice(&slice)]; + + let send = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)).expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let iovec = [IoVec::from_mut_slice(&mut buf)]; + let mut space = cmsg_space!(libc::in_pktinfo); + let msg = recvmsg( + receive, + &iovec, + Some(&mut space), + MsgFlags::empty(), + ).expect("recvmsg failed"); + assert!( + !msg.flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC) + ); + + let mut cmsgs = msg.cmsgs(); + if let Some(ControlMessageOwned::Ipv4PacketInfo(pktinfo)) = cmsgs.next() { + let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); + assert_eq!( + pktinfo.ipi_ifindex as libc::c_uint, + i, + "unexpected ifindex (expected {}, got {})", + i, + pktinfo.ipi_ifindex + ); + } + assert!(cmsgs.next().is_none(), "unexpected additional control msg"); + assert_eq!(msg.bytes, 8); + assert_eq!( + iovec[0].as_slice(), + [1u8, 2, 3, 4, 5, 6, 7, 8] + ); + } +} + +#[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +// qemu doesn't seem to be emulating this correctly in these architectures +#[cfg_attr(all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) +), ignore)] +#[test] +pub fn test_recvif() { + use nix::net::if_::*; + use nix::sys::socket::sockopt::{Ipv4RecvIf, Ipv4RecvDstAddr}; + use nix::sys::socket::{bind, SockFlag, SockType}; + use nix::sys::socket::{getsockname, setsockopt, socket, SockAddr}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use nix::sys::uio::IoVec; + + let lo_ifaddr = loopback_address(AddressFamily::Inet); + let (lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => (ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface")), + None => return, + }; + let receive = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv4RecvIf, &true).expect("setsockopt IP_RECVIF failed"); + setsockopt(receive, Ipv4RecvDstAddr, &true).expect("setsockopt IP_RECVDSTADDR failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoVec::from_slice(&slice)]; + + let send = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)).expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let iovec = [IoVec::from_mut_slice(&mut buf)]; + let mut space = cmsg_space!(libc::sockaddr_dl, libc::in_addr); + let msg = recvmsg( + receive, + &iovec, + Some(&mut space), + MsgFlags::empty(), + ).expect("recvmsg failed"); + assert!( + !msg.flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC) + ); + assert_eq!(msg.cmsgs().count(), 2, "expected 2 cmsgs"); + + let mut rx_recvif = false; + let mut rx_recvdstaddr = false; + for cmsg in msg.cmsgs() { + match cmsg { + ControlMessageOwned::Ipv4RecvIf(dl) => { + rx_recvif = true; + let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); + assert_eq!( + dl.sdl_index as libc::c_uint, + i, + "unexpected ifindex (expected {}, got {})", + i, + dl.sdl_index + ); + }, + ControlMessageOwned::Ipv4RecvDstAddr(addr) => { + rx_recvdstaddr = true; + if let SockAddr::Inet(InetAddr::V4(a)) = lo { + assert_eq!(a.sin_addr.s_addr, + addr.s_addr, + "unexpected destination address (expected {}, got {})", + a.sin_addr.s_addr, + addr.s_addr); + } else { + panic!("unexpected Sockaddr"); + } + }, + _ => panic!("unexpected additional control msg"), + } + } + assert!(rx_recvif); + assert!(rx_recvdstaddr); + assert_eq!(msg.bytes, 8); + assert_eq!( + iovec[0].as_slice(), + [1u8, 2, 3, 4, 5, 6, 7, 8] + ); + } +} + +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +// qemu doesn't seem to be emulating this correctly in these architectures +#[cfg_attr(all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) +), ignore)] +#[test] +pub fn test_recv_ipv6pktinfo() { + use nix::net::if_::*; + use nix::sys::socket::sockopt::Ipv6RecvPacketInfo; + use nix::sys::socket::{bind, SockFlag, SockType}; + use nix::sys::socket::{getsockname, setsockopt, socket}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use nix::sys::uio::IoVec; + + let lo_ifaddr = loopback_address(AddressFamily::Inet6); + let (lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => (ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface")), + None => return, + }; + let receive = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv6RecvPacketInfo, &true).expect("setsockopt failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoVec::from_slice(&slice)]; + + let send = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)).expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let iovec = [IoVec::from_mut_slice(&mut buf)]; + let mut space = cmsg_space!(libc::in6_pktinfo); + let msg = recvmsg( + receive, + &iovec, + Some(&mut space), + MsgFlags::empty(), + ).expect("recvmsg failed"); + assert!( + !msg.flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC) + ); + + let mut cmsgs = msg.cmsgs(); + if let Some(ControlMessageOwned::Ipv6PacketInfo(pktinfo)) = cmsgs.next() + { + let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); + assert_eq!( + pktinfo.ipi6_ifindex as libc::c_uint, + i, + "unexpected ifindex (expected {}, got {})", + i, + pktinfo.ipi6_ifindex + ); + } + assert!(cmsgs.next().is_none(), "unexpected additional control msg"); + assert_eq!(msg.bytes, 8); + assert_eq!( + iovec[0].as_slice(), + [1u8, 2, 3, 4, 5, 6, 7, 8] + ); + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(graviton, ignore = "Not supported by the CI environment")] +#[test] +pub fn test_vsock() { + use nix::errno::Errno; + use nix::sys::socket::{AddressFamily, socket, bind, connect, listen, + SockAddr, SockType, SockFlag}; + use nix::unistd::{close}; + use std::thread; + + let port: u32 = 3000; + + let s1 = socket(AddressFamily::Vsock, SockType::Stream, + SockFlag::empty(), None) + .expect("socket failed"); + + // VMADDR_CID_HYPERVISOR is reserved, so we expect an EADDRNOTAVAIL error. + let sockaddr = SockAddr::new_vsock(libc::VMADDR_CID_HYPERVISOR, port); + assert_eq!(bind(s1, &sockaddr).err(), + Some(Errno::EADDRNOTAVAIL)); + + let sockaddr = SockAddr::new_vsock(libc::VMADDR_CID_ANY, port); + assert_eq!(bind(s1, &sockaddr), Ok(())); + listen(s1, 10).expect("listen failed"); + + let thr = thread::spawn(move || { + let cid: u32 = libc::VMADDR_CID_HOST; + + let s2 = socket(AddressFamily::Vsock, SockType::Stream, + SockFlag::empty(), None) + .expect("socket failed"); + + let sockaddr = SockAddr::new_vsock(cid, port); + + // The current implementation does not support loopback devices, so, + // for now, we expect a failure on the connect. + assert_ne!(connect(s2, &sockaddr), Ok(())); + + close(s2).unwrap(); + }); + + close(s1).unwrap(); + thr.join().unwrap(); +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(all(target_os = "linux"))] +#[test] +fn test_recvmsg_timestampns() { + use nix::sys::socket::*; + use nix::sys::uio::IoVec; + use nix::sys::time::*; + use std::time::*; + + // Set up + let message = "Ohayō!".as_bytes(); + let in_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None).unwrap(); + setsockopt(in_socket, sockopt::ReceiveTimestampns, &true).unwrap(); + let localhost = InetAddr::new(IpAddr::new_v4(127, 0, 0, 1), 0); + bind(in_socket, &SockAddr::new_inet(localhost)).unwrap(); + let address = getsockname(in_socket).unwrap(); + // Get initial time + let time0 = SystemTime::now(); + // Send the message + let iov = [IoVec::from_slice(message)]; + let flags = MsgFlags::empty(); + let l = sendmsg(in_socket, &iov, &[], flags, Some(&address)).unwrap(); + assert_eq!(message.len(), l); + // Receive the message + let mut buffer = vec![0u8; message.len()]; + let mut cmsgspace = nix::cmsg_space!(TimeSpec); + let iov = [IoVec::from_mut_slice(&mut buffer)]; + let r = recvmsg(in_socket, &iov, Some(&mut cmsgspace), flags).unwrap(); + let rtime = match r.cmsgs().next() { + Some(ControlMessageOwned::ScmTimestampns(rtime)) => rtime, + Some(_) => panic!("Unexpected control message"), + None => panic!("No control message") + }; + // Check the final time + let time1 = SystemTime::now(); + // the packet's received timestamp should lie in-between the two system + // times, unless the system clock was adjusted in the meantime. + let rduration = Duration::new(rtime.tv_sec() as u64, + rtime.tv_nsec() as u32); + assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); + assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); + // Close socket + nix::unistd::close(in_socket).unwrap(); +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(all(target_os = "linux"))] +#[test] +fn test_recvmmsg_timestampns() { + use nix::sys::socket::*; + use nix::sys::uio::IoVec; + use nix::sys::time::*; + use std::time::*; + + // Set up + let message = "Ohayō!".as_bytes(); + let in_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None).unwrap(); + setsockopt(in_socket, sockopt::ReceiveTimestampns, &true).unwrap(); + let localhost = InetAddr::new(IpAddr::new_v4(127, 0, 0, 1), 0); + bind(in_socket, &SockAddr::new_inet(localhost)).unwrap(); + let address = getsockname(in_socket).unwrap(); + // Get initial time + let time0 = SystemTime::now(); + // Send the message + let iov = [IoVec::from_slice(message)]; + let flags = MsgFlags::empty(); + let l = sendmsg(in_socket, &iov, &[], flags, Some(&address)).unwrap(); + assert_eq!(message.len(), l); + // Receive the message + let mut buffer = vec![0u8; message.len()]; + let mut cmsgspace = nix::cmsg_space!(TimeSpec); + let iov = [IoVec::from_mut_slice(&mut buffer)]; + let mut data = vec![ + RecvMmsgData { + iov, + cmsg_buffer: Some(&mut cmsgspace), + }, + ]; + let r = recvmmsg(in_socket, &mut data, flags, None).unwrap(); + let rtime = match r[0].cmsgs().next() { + Some(ControlMessageOwned::ScmTimestampns(rtime)) => rtime, + Some(_) => panic!("Unexpected control message"), + None => panic!("No control message") + }; + // Check the final time + let time1 = SystemTime::now(); + // the packet's received timestamp should lie in-between the two system + // times, unless the system clock was adjusted in the meantime. + let rduration = Duration::new(rtime.tv_sec() as u64, + rtime.tv_nsec() as u32); + assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); + assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); + // Close socket + nix::unistd::close(in_socket).unwrap(); +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] +#[test] +fn test_recvmsg_rxq_ovfl() { + use nix::Error; + use nix::sys::socket::*; + use nix::sys::uio::IoVec; + use nix::sys::socket::sockopt::{RxqOvfl, RcvBuf}; + + let message = [0u8; 2048]; + let bufsize = message.len() * 2; + + let in_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None).unwrap(); + let out_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None).unwrap(); + + let localhost = InetAddr::new(IpAddr::new_v4(127, 0, 0, 1), 0); + bind(in_socket, &SockAddr::new_inet(localhost)).unwrap(); + + let address = getsockname(in_socket).unwrap(); + connect(out_socket, &address).unwrap(); + + // Set SO_RXQ_OVFL flag. + setsockopt(in_socket, RxqOvfl, &1).unwrap(); + + // Set the receiver buffer size to hold only 2 messages. + setsockopt(in_socket, RcvBuf, &bufsize).unwrap(); + + let mut drop_counter = 0; + + for _ in 0..2 { + let iov = [IoVec::from_slice(&message)]; + let flags = MsgFlags::empty(); + + // Send the 3 messages (the receiver buffer can only hold 2 messages) + // to create an overflow. + for _ in 0..3 { + let l = sendmsg(out_socket, &iov, &[], flags, Some(&address)).unwrap(); + assert_eq!(message.len(), l); + } + + // Receive the message and check the drop counter if any. + loop { + let mut buffer = vec![0u8; message.len()]; + let mut cmsgspace = nix::cmsg_space!(u32); + + let iov = [IoVec::from_mut_slice(&mut buffer)]; + + match recvmsg( + in_socket, + &iov, + Some(&mut cmsgspace), + MsgFlags::MSG_DONTWAIT) { + Ok(r) => { + drop_counter = match r.cmsgs().next() { + Some(ControlMessageOwned::RxqOvfl(drop_counter)) => drop_counter, + Some(_) => panic!("Unexpected control message"), + None => 0, + }; + }, + Err(Error::EAGAIN) => { break; }, + _ => { panic!("unknown recvmsg() error"); }, + } + } + } + + // One packet lost. + assert_eq!(drop_counter, 1); + + // Close sockets + nix::unistd::close(in_socket).unwrap(); + nix::unistd::close(out_socket).unwrap(); +} + +#[cfg(any( + target_os = "linux", + target_os = "android", +))] +mod linux_errqueue { + use nix::sys::socket::*; + use super::{FromStr, SocketAddr}; + + // Send a UDP datagram to a bogus destination address and observe an ICMP error (v4). + // + // Disable the test on QEMU because QEMU emulation of IP_RECVERR is broken (as documented on PR + // #1514). + #[cfg_attr(qemu, ignore)] + #[test] + fn test_recverr_v4() { + #[repr(u8)] + enum IcmpTypes { + DestUnreach = 3, // ICMP_DEST_UNREACH + } + #[repr(u8)] + enum IcmpUnreachCodes { + PortUnreach = 3, // ICMP_PORT_UNREACH + } + + test_recverr_impl::( + "127.0.0.1:6800", + AddressFamily::Inet, + sockopt::Ipv4RecvErr, + libc::SO_EE_ORIGIN_ICMP, + IcmpTypes::DestUnreach as u8, + IcmpUnreachCodes::PortUnreach as u8, + // Closure handles protocol-specific testing and returns generic sock_extended_err for + // protocol-independent test impl. + |cmsg| { + if let ControlMessageOwned::Ipv4RecvErr(ext_err, err_addr) = cmsg { + if let Some(origin) = err_addr { + // Validate that our network error originated from 127.0.0.1:0. + assert_eq!(origin.sin_family, AddressFamily::Inet as _); + assert_eq!(Ipv4Addr(origin.sin_addr), Ipv4Addr::new(127, 0, 0, 1)); + assert_eq!(origin.sin_port, 0); + } else { + panic!("Expected some error origin"); + } + *ext_err + } else { + panic!("Unexpected control message {:?}", cmsg); + } + }, + ) + } + + // Essentially the same test as v4. + // + // Disable the test on QEMU because QEMU emulation of IPV6_RECVERR is broken (as documented on + // PR #1514). + #[cfg_attr(qemu, ignore)] + #[test] + fn test_recverr_v6() { + #[repr(u8)] + enum IcmpV6Types { + DestUnreach = 1, // ICMPV6_DEST_UNREACH + } + #[repr(u8)] + enum IcmpV6UnreachCodes { + PortUnreach = 4, // ICMPV6_PORT_UNREACH + } + + test_recverr_impl::( + "[::1]:6801", + AddressFamily::Inet6, + sockopt::Ipv6RecvErr, + libc::SO_EE_ORIGIN_ICMP6, + IcmpV6Types::DestUnreach as u8, + IcmpV6UnreachCodes::PortUnreach as u8, + // Closure handles protocol-specific testing and returns generic sock_extended_err for + // protocol-independent test impl. + |cmsg| { + if let ControlMessageOwned::Ipv6RecvErr(ext_err, err_addr) = cmsg { + if let Some(origin) = err_addr { + // Validate that our network error originated from localhost:0. + assert_eq!(origin.sin6_family, AddressFamily::Inet6 as _); + assert_eq!( + Ipv6Addr(origin.sin6_addr), + Ipv6Addr::from_std(&"::1".parse().unwrap()), + ); + assert_eq!(origin.sin6_port, 0); + } else { + panic!("Expected some error origin"); + } + *ext_err + } else { + panic!("Unexpected control message {:?}", cmsg); + } + }, + ) + } + + fn test_recverr_impl(sa: &str, + af: AddressFamily, + opt: OPT, + ee_origin: u8, + ee_type: u8, + ee_code: u8, + testf: TESTF) + where + OPT: SetSockOpt, + TESTF: FnOnce(&ControlMessageOwned) -> libc::sock_extended_err, + { + use nix::errno::Errno; + use nix::sys::uio::IoVec; + + const MESSAGE_CONTENTS: &str = "ABCDEF"; + + let sock_addr = { + let std_sa = SocketAddr::from_str(sa).unwrap(); + let inet_addr = InetAddr::from_std(&std_sa); + SockAddr::new_inet(inet_addr) + }; + let sock = socket(af, SockType::Datagram, SockFlag::SOCK_CLOEXEC, None).unwrap(); + setsockopt(sock, opt, &true).unwrap(); + if let Err(e) = sendto(sock, MESSAGE_CONTENTS.as_bytes(), &sock_addr, MsgFlags::empty()) { + assert_eq!(e, Errno::EADDRNOTAVAIL); + println!("{:?} not available, skipping test.", af); + return; + } + + let mut buf = [0u8; 8]; + let iovec = [IoVec::from_mut_slice(&mut buf)]; + let mut cspace = cmsg_space!(libc::sock_extended_err, SA); + + let msg = recvmsg(sock, &iovec, Some(&mut cspace), MsgFlags::MSG_ERRQUEUE).unwrap(); + // The sent message / destination associated with the error is returned: + assert_eq!(msg.bytes, MESSAGE_CONTENTS.as_bytes().len()); + assert_eq!(&buf[..msg.bytes], MESSAGE_CONTENTS.as_bytes()); + // recvmsg(2): "The original destination address of the datagram that caused the error is + // supplied via msg_name;" however, this is not literally true. E.g., an earlier version + // of this test used 0.0.0.0 (::0) as the destination address, which was mutated into + // 127.0.0.1 (::1). + assert_eq!(msg.address, Some(sock_addr)); + + // Check for expected control message. + let ext_err = match msg.cmsgs().next() { + Some(cmsg) => testf(&cmsg), + None => panic!("No control message"), + }; + + assert_eq!(ext_err.ee_errno, libc::ECONNREFUSED as u32); + assert_eq!(ext_err.ee_origin, ee_origin); + // ip(7): ee_type and ee_code are set from the type and code fields of the ICMP (ICMPv6) + // header. + assert_eq!(ext_err.ee_type, ee_type); + assert_eq!(ext_err.ee_code, ee_code); + // ip(7): ee_info contains the discovered MTU for EMSGSIZE errors. + assert_eq!(ext_err.ee_info, 0); + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_sockopt.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_sockopt.rs new file mode 100644 index 0000000000000000000000000000000000000000..01920fd40ac77ebdc6e20b6e9d1527729a8a7312 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_sockopt.rs @@ -0,0 +1,199 @@ +use rand::{thread_rng, Rng}; +use nix::sys::socket::{socket, sockopt, getsockopt, setsockopt, AddressFamily, SockType, SockFlag, SockProtocol}; +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::*; + +// NB: FreeBSD supports LOCAL_PEERCRED for SOCK_SEQPACKET, but OSX does not. +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", +))] +#[test] +pub fn test_local_peercred_seqpacket() { + use nix::{ + unistd::{Gid, Uid}, + sys::socket::socketpair + }; + + let (fd1, _fd2) = socketpair(AddressFamily::Unix, SockType::SeqPacket, None, + SockFlag::empty()).unwrap(); + let xucred = getsockopt(fd1, sockopt::LocalPeerCred).unwrap(); + assert_eq!(xucred.version(), 0); + assert_eq!(Uid::from_raw(xucred.uid()), Uid::current()); + assert_eq!(Gid::from_raw(xucred.groups()[0]), Gid::current()); +} + +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios" +))] +#[test] +pub fn test_local_peercred_stream() { + use nix::{ + unistd::{Gid, Uid}, + sys::socket::socketpair + }; + + let (fd1, _fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, + SockFlag::empty()).unwrap(); + let xucred = getsockopt(fd1, sockopt::LocalPeerCred).unwrap(); + assert_eq!(xucred.version(), 0); + assert_eq!(Uid::from_raw(xucred.uid()), Uid::current()); + assert_eq!(Gid::from_raw(xucred.groups()[0]), Gid::current()); +} + +#[cfg(target_os = "linux")] +#[test] +fn is_so_mark_functional() { + use nix::sys::socket::sockopt; + + require_capability!("is_so_mark_functional", CAP_NET_ADMIN); + + let s = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); + setsockopt(s, sockopt::Mark, &1337).unwrap(); + let mark = getsockopt(s, sockopt::Mark).unwrap(); + assert_eq!(mark, 1337); +} + +#[test] +fn test_so_buf() { + let fd = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), SockProtocol::Udp) + .unwrap(); + let bufsize: usize = thread_rng().gen_range(4096..131_072); + setsockopt(fd, sockopt::SndBuf, &bufsize).unwrap(); + let actual = getsockopt(fd, sockopt::SndBuf).unwrap(); + assert!(actual >= bufsize); + setsockopt(fd, sockopt::RcvBuf, &bufsize).unwrap(); + let actual = getsockopt(fd, sockopt::RcvBuf).unwrap(); + assert!(actual >= bufsize); +} + +#[test] +fn test_so_tcp_maxseg() { + use std::net::SocketAddr; + use std::str::FromStr; + use nix::sys::socket::{accept, bind, connect, listen, InetAddr, SockAddr}; + use nix::unistd::{close, write}; + + let std_sa = SocketAddr::from_str("127.0.0.1:4001").unwrap(); + let inet_addr = InetAddr::from_std(&std_sa); + let sock_addr = SockAddr::new_inet(inet_addr); + + let rsock = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp) + .unwrap(); + bind(rsock, &sock_addr).unwrap(); + listen(rsock, 10).unwrap(); + let initial = getsockopt(rsock, sockopt::TcpMaxSeg).unwrap(); + // Initial MSS is expected to be 536 (https://tools.ietf.org/html/rfc879#section-1) but some + // platforms keep it even lower. This might fail if you've tuned your initial MSS to be larger + // than 700 + cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + let segsize: u32 = 873; + assert!(initial < segsize); + setsockopt(rsock, sockopt::TcpMaxSeg, &segsize).unwrap(); + } else { + assert!(initial < 700); + } + } + + // Connect and check the MSS that was advertised + let ssock = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp) + .unwrap(); + connect(ssock, &sock_addr).unwrap(); + let rsess = accept(rsock).unwrap(); + write(rsess, b"hello").unwrap(); + let actual = getsockopt(ssock, sockopt::TcpMaxSeg).unwrap(); + // Actual max segment size takes header lengths into account, max IPv4 options (60 bytes) + max + // TCP options (40 bytes) are subtracted from the requested maximum as a lower boundary. + cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + assert!((segsize - 100) <= actual); + assert!(actual <= segsize); + } else { + assert!(initial < actual); + assert!(536 < actual); + } + } + close(rsock).unwrap(); + close(ssock).unwrap(); +} + +// The CI doesn't supported getsockopt and setsockopt on emulated processors. +// It's beleived that a QEMU issue, the tests run ok on a fully emulated system. +// Current CI just run the binary with QEMU but the Kernel remains the same as the host. +// So the syscall doesn't work properly unless the kernel is also emulated. +#[test] +#[cfg(all( + any(target_arch = "x86", target_arch = "x86_64"), + any(target_os = "freebsd", target_os = "linux") +))] +fn test_tcp_congestion() { + use std::ffi::OsString; + + let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); + + let val = getsockopt(fd, sockopt::TcpCongestion).unwrap(); + setsockopt(fd, sockopt::TcpCongestion, &val).unwrap(); + + setsockopt(fd, sockopt::TcpCongestion, &OsString::from("tcp_congestion_does_not_exist")).unwrap_err(); + + assert_eq!( + getsockopt(fd, sockopt::TcpCongestion).unwrap(), + val + ); +} + +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_bindtodevice() { + skip_if_not_root!("test_bindtodevice"); + + let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); + + let val = getsockopt(fd, sockopt::BindToDevice).unwrap(); + setsockopt(fd, sockopt::BindToDevice, &val).unwrap(); + + assert_eq!( + getsockopt(fd, sockopt::BindToDevice).unwrap(), + val + ); +} + +#[test] +fn test_so_tcp_keepalive() { + let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp).unwrap(); + setsockopt(fd, sockopt::KeepAlive, &true).unwrap(); + assert!(getsockopt(fd, sockopt::KeepAlive).unwrap()); + + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "nacl"))] { + let x = getsockopt(fd, sockopt::TcpKeepIdle).unwrap(); + setsockopt(fd, sockopt::TcpKeepIdle, &(x + 1)).unwrap(); + assert_eq!(getsockopt(fd, sockopt::TcpKeepIdle).unwrap(), x + 1); + + let x = getsockopt(fd, sockopt::TcpKeepCount).unwrap(); + setsockopt(fd, sockopt::TcpKeepCount, &(x + 1)).unwrap(); + assert_eq!(getsockopt(fd, sockopt::TcpKeepCount).unwrap(), x + 1); + + let x = getsockopt(fd, sockopt::TcpKeepInterval).unwrap(); + setsockopt(fd, sockopt::TcpKeepInterval, &(x + 1)).unwrap(); + assert_eq!(getsockopt(fd, sockopt::TcpKeepInterval).unwrap(), x + 1); + } +} + +#[test] +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +fn test_ttl_opts() { + let fd4 = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None).unwrap(); + setsockopt(fd4, sockopt::Ipv4Ttl, &1) + .expect("setting ipv4ttl on an inet socket should succeed"); + let fd6 = socket(AddressFamily::Inet6, SockType::Datagram, SockFlag::empty(), None).unwrap(); + setsockopt(fd6, sockopt::Ipv6Ttl, &1) + .expect("setting ipv6ttl on an inet6 socket should succeed"); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_sysinfo.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_sysinfo.rs new file mode 100644 index 0000000000000000000000000000000000000000..73e6586f6223e637dd94b0b6ded6008dd4ce48f2 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_sysinfo.rs @@ -0,0 +1,18 @@ +use nix::sys::sysinfo::*; + +#[test] +fn sysinfo_works() { + let info = sysinfo().unwrap(); + + let (l1, l5, l15) = info.load_average(); + assert!(l1 >= 0.0); + assert!(l5 >= 0.0); + assert!(l15 >= 0.0); + + info.uptime(); // just test Duration construction + + assert!(info.swap_free() <= info.swap_total(), + "more swap available than installed (free: {}, total: {})", + info.swap_free(), + info.swap_total()); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_termios.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_termios.rs new file mode 100644 index 0000000000000000000000000000000000000000..4a8615437e22d7db175cf6b10373cbcea516a568 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_termios.rs @@ -0,0 +1,130 @@ +use std::os::unix::prelude::*; +use tempfile::tempfile; + +use nix::fcntl; +use nix::errno::Errno; +use nix::pty::openpty; +use nix::sys::termios::{self, LocalFlags, OutputFlags, tcgetattr}; +use nix::unistd::{read, write, close}; + +/// Helper function analogous to `std::io::Write::write_all`, but for `RawFd`s +fn write_all(f: RawFd, buf: &[u8]) { + let mut len = 0; + while len < buf.len() { + len += write(f, &buf[len..]).unwrap(); + } +} + +// Test tcgetattr on a terminal +#[test] +fn test_tcgetattr_pty() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + let pty = openpty(None, None).expect("openpty failed"); + assert!(termios::tcgetattr(pty.slave).is_ok()); + close(pty.master).expect("closing the master failed"); + close(pty.slave).expect("closing the slave failed"); +} + +// Test tcgetattr on something that isn't a terminal +#[test] +fn test_tcgetattr_enotty() { + let file = tempfile().unwrap(); + assert_eq!(termios::tcgetattr(file.as_raw_fd()).err(), + Some(Errno::ENOTTY)); +} + +// Test tcgetattr on an invalid file descriptor +#[test] +fn test_tcgetattr_ebadf() { + assert_eq!(termios::tcgetattr(-1).err(), + Some(Errno::EBADF)); +} + +// Test modifying output flags +#[test] +fn test_output_flags() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + // Open one pty to get attributes for the second one + let mut termios = { + let pty = openpty(None, None).expect("openpty failed"); + assert!(pty.master > 0); + assert!(pty.slave > 0); + let termios = tcgetattr(pty.slave).expect("tcgetattr failed"); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + termios + }; + + // Make sure postprocessing '\r' isn't specified by default or this test is useless. + assert!(!termios.output_flags.contains(OutputFlags::OPOST | OutputFlags::OCRNL)); + + // Specify that '\r' characters should be transformed to '\n' + // OPOST is specified to enable post-processing + termios.output_flags.insert(OutputFlags::OPOST | OutputFlags::OCRNL); + + // Open a pty + let pty = openpty(None, &termios).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Write into the master + let string = "foofoofoo\r"; + write_all(pty.master, string.as_bytes()); + + // Read from the slave verifying that the output has been properly transformed + let mut buf = [0u8; 10]; + crate::read_exact(pty.slave, &mut buf); + let transformed_string = "foofoofoo\n"; + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + assert_eq!(&buf, transformed_string.as_bytes()); +} + +// Test modifying local flags +#[test] +fn test_local_flags() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + // Open one pty to get attributes for the second one + let mut termios = { + let pty = openpty(None, None).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + let termios = tcgetattr(pty.slave).unwrap(); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + termios + }; + + // Make sure echo is specified by default or this test is useless. + assert!(termios.local_flags.contains(LocalFlags::ECHO)); + + // Disable local echo + termios.local_flags.remove(LocalFlags::ECHO); + + // Open a new pty with our modified termios settings + let pty = openpty(None, &termios).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Set the master is in nonblocking mode or reading will never return. + let flags = fcntl::fcntl(pty.master, fcntl::F_GETFL).unwrap(); + let new_flags = fcntl::OFlag::from_bits_truncate(flags) | fcntl::OFlag::O_NONBLOCK; + fcntl::fcntl(pty.master, fcntl::F_SETFL(new_flags)).unwrap(); + + // Write into the master + let string = "foofoofoo\r"; + write_all(pty.master, string.as_bytes()); + + // Try to read from the master, which should not have anything as echoing was disabled. + let mut buf = [0u8; 10]; + let read = read(pty.master, &mut buf).unwrap_err(); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + assert_eq!(read, Errno::EAGAIN); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_timerfd.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_timerfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..24fb2ac002e1da959a377956d04aedf13c2df4ef --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_timerfd.rs @@ -0,0 +1,61 @@ +use nix::sys::time::{TimeSpec, TimeValLike}; +use nix::sys::timerfd::{ClockId, Expiration, TimerFd, TimerFlags, TimerSetTimeFlags}; +use std::time::Instant; + +#[test] +pub fn test_timerfd_oneshot() { + let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + + let before = Instant::now(); + + timer + .set( + Expiration::OneShot(TimeSpec::seconds(1)), + TimerSetTimeFlags::empty(), + ) + .unwrap(); + + timer.wait().unwrap(); + + let millis = before.elapsed().as_millis(); + assert!(millis > 900); +} + +#[test] +pub fn test_timerfd_interval() { + let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + + let before = Instant::now(); + timer + .set( + Expiration::IntervalDelayed(TimeSpec::seconds(1), TimeSpec::seconds(2)), + TimerSetTimeFlags::empty(), + ) + .unwrap(); + + timer.wait().unwrap(); + + let start_delay = before.elapsed().as_millis(); + assert!(start_delay > 900); + + timer.wait().unwrap(); + + let interval_delay = before.elapsed().as_millis(); + assert!(interval_delay > 2900); +} + +#[test] +pub fn test_timerfd_unset() { + let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + + timer + .set( + Expiration::OneShot(TimeSpec::seconds(1)), + TimerSetTimeFlags::empty(), + ) + .unwrap(); + + timer.unset().unwrap(); + + assert!(timer.get().unwrap() == None); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_uio.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_uio.rs new file mode 100644 index 0000000000000000000000000000000000000000..c63b58103c6701fb5a048f645455806964e44882 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_uio.rs @@ -0,0 +1,255 @@ +use nix::sys::uio::*; +use nix::unistd::*; +use rand::{thread_rng, Rng}; +use rand::distributions::Alphanumeric; +use std::{cmp, iter}; +use std::fs::{OpenOptions}; +use std::os::unix::io::AsRawFd; + +#[cfg(not(target_os = "redox"))] +use tempfile::tempfile; +use tempfile::tempdir; + +#[test] +fn test_writev() { + let mut to_write = Vec::with_capacity(16 * 128); + for _ in 0..16 { + let s: String = thread_rng() + .sample_iter(&Alphanumeric) + .map(char::from) + .take(128) + .collect(); + let b = s.as_bytes(); + to_write.extend(b.iter().cloned()); + } + // Allocate and fill iovecs + let mut iovecs = Vec::new(); + let mut consumed = 0; + while consumed < to_write.len() { + let left = to_write.len() - consumed; + let slice_len = if left <= 64 { left } else { thread_rng().gen_range(64..cmp::min(256, left)) }; + let b = &to_write[consumed..consumed+slice_len]; + iovecs.push(IoVec::from_slice(b)); + consumed += slice_len; + } + let pipe_res = pipe(); + assert!(pipe_res.is_ok()); + let (reader, writer) = pipe_res.ok().unwrap(); + // FileDesc will close its filedesc (reader). + let mut read_buf: Vec = iter::repeat(0u8).take(128 * 16).collect(); + // Blocking io, should write all data. + let write_res = writev(writer, &iovecs); + // Successful write + assert!(write_res.is_ok()); + let written = write_res.ok().unwrap(); + // Check whether we written all data + assert_eq!(to_write.len(), written); + let read_res = read(reader, &mut read_buf[..]); + // Successful read + assert!(read_res.is_ok()); + let read = read_res.ok().unwrap() as usize; + // Check we have read as much as we written + assert_eq!(read, written); + // Check equality of written and read data + assert_eq!(&to_write, &read_buf); + let close_res = close(writer); + assert!(close_res.is_ok()); + let close_res = close(reader); + assert!(close_res.is_ok()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_readv() { + let s:String = thread_rng() + .sample_iter(&Alphanumeric) + .map(char::from) + .take(128) + .collect(); + let to_write = s.as_bytes().to_vec(); + let mut storage = Vec::new(); + let mut allocated = 0; + while allocated < to_write.len() { + let left = to_write.len() - allocated; + let vec_len = if left <= 64 { left } else { thread_rng().gen_range(64..cmp::min(256, left)) }; + let v: Vec = iter::repeat(0u8).take(vec_len).collect(); + storage.push(v); + allocated += vec_len; + } + let mut iovecs = Vec::with_capacity(storage.len()); + for v in &mut storage { + iovecs.push(IoVec::from_mut_slice(&mut v[..])); + } + let pipe_res = pipe(); + assert!(pipe_res.is_ok()); + let (reader, writer) = pipe_res.ok().unwrap(); + // Blocking io, should write all data. + let write_res = write(writer, &to_write); + // Successful write + assert!(write_res.is_ok()); + let read_res = readv(reader, &mut iovecs[..]); + assert!(read_res.is_ok()); + let read = read_res.ok().unwrap(); + // Check whether we've read all data + assert_eq!(to_write.len(), read); + // Cccumulate data from iovecs + let mut read_buf = Vec::with_capacity(to_write.len()); + for iovec in &iovecs { + read_buf.extend(iovec.as_slice().iter().cloned()); + } + // Check whether iovecs contain all written data + assert_eq!(read_buf.len(), to_write.len()); + // Check equality of written and read data + assert_eq!(&read_buf, &to_write); + let close_res = close(reader); + assert!(close_res.is_ok()); + let close_res = close(writer); + assert!(close_res.is_ok()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_pwrite() { + use std::io::Read; + + let mut file = tempfile().unwrap(); + let buf = [1u8;8]; + assert_eq!(Ok(8), pwrite(file.as_raw_fd(), &buf, 8)); + let mut file_content = Vec::new(); + file.read_to_end(&mut file_content).unwrap(); + let mut expected = vec![0u8;8]; + expected.extend(vec![1;8]); + assert_eq!(file_content, expected); +} + +#[test] +fn test_pread() { + use std::io::Write; + + let tempdir = tempdir().unwrap(); + + let path = tempdir.path().join("pread_test_file"); + let mut file = OpenOptions::new().write(true).read(true).create(true) + .truncate(true).open(path).unwrap(); + let file_content: Vec = (0..64).collect(); + file.write_all(&file_content).unwrap(); + + let mut buf = [0u8;16]; + assert_eq!(Ok(16), pread(file.as_raw_fd(), &mut buf, 16)); + let expected: Vec<_> = (16..32).collect(); + assert_eq!(&buf[..], &expected[..]); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_pwritev() { + use std::io::Read; + + let to_write: Vec = (0..128).collect(); + let expected: Vec = [vec![0;100], to_write.clone()].concat(); + + let iovecs = [ + IoVec::from_slice(&to_write[0..17]), + IoVec::from_slice(&to_write[17..64]), + IoVec::from_slice(&to_write[64..128]), + ]; + + let tempdir = tempdir().unwrap(); + + // pwritev them into a temporary file + let path = tempdir.path().join("pwritev_test_file"); + let mut file = OpenOptions::new().write(true).read(true).create(true) + .truncate(true).open(path).unwrap(); + + let written = pwritev(file.as_raw_fd(), &iovecs, 100).ok().unwrap(); + assert_eq!(written, to_write.len()); + + // Read the data back and make sure it matches + let mut contents = Vec::new(); + file.read_to_end(&mut contents).unwrap(); + assert_eq!(contents, expected); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_preadv() { + use std::io::Write; + + let to_write: Vec = (0..200).collect(); + let expected: Vec = (100..200).collect(); + + let tempdir = tempdir().unwrap(); + + let path = tempdir.path().join("preadv_test_file"); + + let mut file = OpenOptions::new().read(true).write(true).create(true) + .truncate(true).open(path).unwrap(); + file.write_all(&to_write).unwrap(); + + let mut buffers: Vec> = vec![ + vec![0; 24], + vec![0; 1], + vec![0; 75], + ]; + + { + // Borrow the buffers into IoVecs and preadv into them + let iovecs: Vec<_> = buffers.iter_mut().map( + |buf| IoVec::from_mut_slice(&mut buf[..])).collect(); + assert_eq!(Ok(100), preadv(file.as_raw_fd(), &iovecs, 100)); + } + + let all = buffers.concat(); + assert_eq!(all, expected); +} + +#[test] +#[cfg(target_os = "linux")] +// qemu-user doesn't implement process_vm_readv/writev on most arches +#[cfg_attr(qemu, ignore)] +fn test_process_vm_readv() { + use nix::unistd::ForkResult::*; + use nix::sys::signal::*; + use nix::sys::wait::*; + use crate::*; + + require_capability!("test_process_vm_readv", CAP_SYS_PTRACE); + let _m = crate::FORK_MTX.lock(); + + // Pre-allocate memory in the child, since allocation isn't safe + // post-fork (~= async-signal-safe) + let mut vector = vec![1u8, 2, 3, 4, 5]; + + let (r, w) = pipe().unwrap(); + match unsafe{fork()}.expect("Error: Fork Failed") { + Parent { child } => { + close(w).unwrap(); + // wait for child + read(r, &mut [0u8]).unwrap(); + close(r).unwrap(); + + let ptr = vector.as_ptr() as usize; + let remote_iov = RemoteIoVec { base: ptr, len: 5 }; + let mut buf = vec![0u8; 5]; + + let ret = process_vm_readv(child, + &[IoVec::from_mut_slice(&mut buf)], + &[remote_iov]); + + kill(child, SIGTERM).unwrap(); + waitpid(child, None).unwrap(); + + assert_eq!(Ok(5), ret); + assert_eq!(20u8, buf.iter().sum()); + }, + Child => { + let _ = close(r); + for i in &mut vector { + *i += 1; + } + let _ = write(w, b"\0"); + let _ = close(w); + loop { let _ = pause(); } + }, + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/sys/test_wait.rs b/bash-5.1/vendor/nix-0.23.1/test/sys/test_wait.rs new file mode 100644 index 0000000000000000000000000000000000000000..afe4f42b298725ef153383a695ee36d41ab81422 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/sys/test_wait.rs @@ -0,0 +1,107 @@ +use nix::errno::Errno; +use nix::unistd::*; +use nix::unistd::ForkResult::*; +use nix::sys::signal::*; +use nix::sys::wait::*; +use libc::_exit; + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_wait_signal() { + let _m = crate::FORK_MTX.lock(); + + // Safe: The child only calls `pause` and/or `_exit`, which are async-signal-safe. + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + pause(); + unsafe { _exit(123) } + }, + Parent { child } => { + kill(child, Some(SIGKILL)).expect("Error: Kill Failed"); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Signaled(child, SIGKILL, false))); + }, + } +} + +#[test] +fn test_wait_exit() { + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is async-signal-safe. + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => unsafe { _exit(12); }, + Parent { child } => { + assert_eq!(waitpid(child, None), Ok(WaitStatus::Exited(child, 12))); + }, + } +} + +#[test] +fn test_waitstatus_from_raw() { + let pid = Pid::from_raw(1); + assert_eq!(WaitStatus::from_raw(pid, 0x0002), Ok(WaitStatus::Signaled(pid, Signal::SIGINT, false))); + assert_eq!(WaitStatus::from_raw(pid, 0x0200), Ok(WaitStatus::Exited(pid, 2))); + assert_eq!(WaitStatus::from_raw(pid, 0x7f7f), Err(Errno::EINVAL)); +} + +#[test] +fn test_waitstatus_pid() { + let _m = crate::FORK_MTX.lock(); + + match unsafe{fork()}.unwrap() { + Child => unsafe { _exit(0) }, + Parent { child } => { + let status = waitpid(child, None).unwrap(); + assert_eq!(status.pid(), Some(child)); + } + } +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +// FIXME: qemu-user doesn't implement ptrace on most arches +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +mod ptrace { + use nix::sys::ptrace::{self, Options, Event}; + use nix::sys::signal::*; + use nix::sys::wait::*; + use nix::unistd::*; + use nix::unistd::ForkResult::*; + use libc::_exit; + use crate::*; + + fn ptrace_child() -> ! { + ptrace::traceme().unwrap(); + // As recommended by ptrace(2), raise SIGTRAP to pause the child + // until the parent is ready to continue + raise(SIGTRAP).unwrap(); + unsafe { _exit(0) } + } + + fn ptrace_parent(child: Pid) { + // Wait for the raised SIGTRAP + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, SIGTRAP))); + // We want to test a syscall stop and a PTRACE_EVENT stop + assert!(ptrace::setoptions(child, Options::PTRACE_O_TRACESYSGOOD | Options::PTRACE_O_TRACEEXIT).is_ok()); + + // First, stop on the next system call, which will be exit() + assert!(ptrace::syscall(child, None).is_ok()); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); + // Then get the ptrace event for the process exiting + assert!(ptrace::cont(child, None).is_ok()); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceEvent(child, SIGTRAP, Event::PTRACE_EVENT_EXIT as i32))); + // Finally get the normal wait() result, now that the process has exited + assert!(ptrace::cont(child, None).is_ok()); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Exited(child, 0))); + } + + #[test] + fn test_wait_ptrace() { + require_capability!("test_wait_ptrace", CAP_SYS_PTRACE); + let _m = crate::FORK_MTX.lock(); + + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => ptrace_child(), + Parent { child } => ptrace_parent(child), + } + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test.rs b/bash-5.1/vendor/nix-0.23.1/test/test.rs new file mode 100644 index 0000000000000000000000000000000000000000..aade937ab977fd9c3a5f0d65d4c40fe22b8e82a1 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test.rs @@ -0,0 +1,102 @@ +#[macro_use] +extern crate cfg_if; +#[cfg_attr(not(target_os = "redox"), macro_use)] +extern crate nix; +#[macro_use] +extern crate lazy_static; + +mod common; +mod sys; +#[cfg(not(target_os = "redox"))] +mod test_dir; +mod test_fcntl; +#[cfg(any(target_os = "android", + target_os = "linux"))] +mod test_kmod; +#[cfg(target_os = "freebsd")] +mod test_nmount; +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "fushsia", + target_os = "linux", + target_os = "netbsd"))] +mod test_mq; +#[cfg(not(target_os = "redox"))] +mod test_net; +mod test_nix_path; +mod test_resource; +mod test_poll; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod test_pty; +#[cfg(any(target_os = "android", + target_os = "linux"))] +mod test_sched; +#[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] +mod test_sendfile; +mod test_stat; +mod test_time; +mod test_unistd; + +use std::os::unix::io::RawFd; +use std::path::PathBuf; +use parking_lot::{Mutex, RwLock, RwLockWriteGuard}; +use nix::unistd::{chdir, getcwd, read}; + + +/// Helper function analogous to `std::io::Read::read_exact`, but for `RawFD`s +fn read_exact(f: RawFd, buf: &mut [u8]) { + let mut len = 0; + while len < buf.len() { + // get_mut would be better than split_at_mut, but it requires nightly + let (_, remaining) = buf.split_at_mut(len); + len += read(f, remaining).unwrap(); + } +} + +lazy_static! { + /// Any test that changes the process's current working directory must grab + /// the RwLock exclusively. Any process that cares about the current + /// working directory must grab it shared. + pub static ref CWD_LOCK: RwLock<()> = RwLock::new(()); + /// Any test that creates child processes must grab this mutex, regardless + /// of what it does with those children. + pub static ref FORK_MTX: Mutex<()> = Mutex::new(()); + /// Any test that changes the process's supplementary groups must grab this + /// mutex + pub static ref GROUPS_MTX: Mutex<()> = Mutex::new(()); + /// Any tests that loads or unloads kernel modules must grab this mutex + pub static ref KMOD_MTX: Mutex<()> = Mutex::new(()); + /// Any test that calls ptsname(3) must grab this mutex. + pub static ref PTSNAME_MTX: Mutex<()> = Mutex::new(()); + /// Any test that alters signal handling must grab this mutex. + pub static ref SIGNAL_MTX: Mutex<()> = Mutex::new(()); +} + +/// RAII object that restores a test's original directory on drop +struct DirRestore<'a> { + d: PathBuf, + _g: RwLockWriteGuard<'a, ()> +} + +impl<'a> DirRestore<'a> { + fn new() -> Self { + let guard = crate::CWD_LOCK.write(); + DirRestore{ + _g: guard, + d: getcwd().unwrap(), + } + } +} + +impl<'a> Drop for DirRestore<'a> { + fn drop(&mut self) { + let r = chdir(&self.d); + if std::thread::panicking() { + r.unwrap(); + } + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_clearenv.rs b/bash-5.1/vendor/nix-0.23.1/test/test_clearenv.rs new file mode 100644 index 0000000000000000000000000000000000000000..28a77680498ca5cafc041aa011b20cc6216963ee --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_clearenv.rs @@ -0,0 +1,9 @@ +use std::env; + +#[test] +fn clearenv() { + env::set_var("FOO", "BAR"); + unsafe { nix::env::clearenv() }.unwrap(); + assert_eq!(env::var("FOO").unwrap_err(), env::VarError::NotPresent); + assert_eq!(env::vars().count(), 0); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_dir.rs b/bash-5.1/vendor/nix-0.23.1/test/test_dir.rs new file mode 100644 index 0000000000000000000000000000000000000000..2940b6eafb351b27da004a431972b41d9031966c --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_dir.rs @@ -0,0 +1,56 @@ +use nix::dir::{Dir, Type}; +use nix::fcntl::OFlag; +use nix::sys::stat::Mode; +use std::fs::File; +use tempfile::tempdir; + + +#[cfg(test)] +fn flags() -> OFlag { + #[cfg(target_os = "illumos")] + let f = OFlag::O_RDONLY | OFlag::O_CLOEXEC; + + #[cfg(not(target_os = "illumos"))] + let f = OFlag::O_RDONLY | OFlag::O_CLOEXEC | OFlag::O_DIRECTORY; + + f +} + +#[test] +#[allow(clippy::unnecessary_sort_by)] // False positive +fn read() { + let tmp = tempdir().unwrap(); + File::create(&tmp.path().join("foo")).unwrap(); + ::std::os::unix::fs::symlink("foo", tmp.path().join("bar")).unwrap(); + let mut dir = Dir::open(tmp.path(), flags(), Mode::empty()).unwrap(); + let mut entries: Vec<_> = dir.iter().map(|e| e.unwrap()).collect(); + entries.sort_by(|a, b| a.file_name().cmp(b.file_name())); + let entry_names: Vec<_> = entries + .iter() + .map(|e| e.file_name().to_str().unwrap().to_owned()) + .collect(); + assert_eq!(&entry_names[..], &[".", "..", "bar", "foo"]); + + // Check file types. The system is allowed to return DT_UNKNOWN (aka None here) but if it does + // return a type, ensure it's correct. + assert!(&[Some(Type::Directory), None].contains(&entries[0].file_type())); // .: dir + assert!(&[Some(Type::Directory), None].contains(&entries[1].file_type())); // ..: dir + assert!(&[Some(Type::Symlink), None].contains(&entries[2].file_type())); // bar: symlink + assert!(&[Some(Type::File), None].contains(&entries[3].file_type())); // foo: regular file +} + +#[test] +fn rewind() { + let tmp = tempdir().unwrap(); + let mut dir = Dir::open(tmp.path(), flags(), Mode::empty()).unwrap(); + let entries1: Vec<_> = dir.iter().map(|e| e.unwrap().file_name().to_owned()).collect(); + let entries2: Vec<_> = dir.iter().map(|e| e.unwrap().file_name().to_owned()).collect(); + let entries3: Vec<_> = dir.into_iter().map(|e| e.unwrap().file_name().to_owned()).collect(); + assert_eq!(entries1, entries2); + assert_eq!(entries2, entries3); +} + +#[test] +fn ebadf() { + assert_eq!(Dir::from_fd(-1).unwrap_err(), nix::Error::EBADF); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_fcntl.rs b/bash-5.1/vendor/nix-0.23.1/test/test_fcntl.rs new file mode 100644 index 0000000000000000000000000000000000000000..db2acfbf520b6340fb1507333d07aaf20aef19b3 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_fcntl.rs @@ -0,0 +1,540 @@ +#[cfg(not(target_os = "redox"))] +use nix::errno::*; +#[cfg(not(target_os = "redox"))] +use nix::fcntl::{open, OFlag, readlink}; +#[cfg(not(target_os = "redox"))] +use nix::fcntl::{openat, readlinkat, renameat}; +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +use nix::fcntl::{RenameFlags, renameat2}; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::Mode; +#[cfg(not(target_os = "redox"))] +use nix::unistd::{close, read}; +#[cfg(not(target_os = "redox"))] +use tempfile::{self, NamedTempFile}; +#[cfg(not(target_os = "redox"))] +use std::fs::File; +#[cfg(not(target_os = "redox"))] +use std::io::prelude::*; +#[cfg(not(target_os = "redox"))] +use std::os::unix::fs; + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_openat() { + const CONTENTS: &[u8] = b"abcd"; + let mut tmp = NamedTempFile::new().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let dirfd = open(tmp.path().parent().unwrap(), + OFlag::empty(), + Mode::empty()).unwrap(); + let fd = openat(dirfd, + tmp.path().file_name().unwrap(), + OFlag::O_RDONLY, + Mode::empty()).unwrap(); + + let mut buf = [0u8; 1024]; + assert_eq!(4, read(fd, &mut buf).unwrap()); + assert_eq!(CONTENTS, &buf[0..4]); + + close(fd).unwrap(); + close(dirfd).unwrap(); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_renameat() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + File::create(&old_path).unwrap(); + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap(); + assert_eq!(renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap_err(), + Errno::ENOENT); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); + assert!(new_dir.path().join("new").exists()); +} + +#[test] +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +fn test_renameat2_behaves_like_renameat_with_no_flags() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + File::create(&old_path).unwrap(); + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::empty(), + ) + .unwrap(); + assert_eq!( + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::empty() + ) + .unwrap_err(), + Errno::ENOENT + ); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); + assert!(new_dir.path().join("new").exists()); +} + +#[test] +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +fn test_renameat2_exchange() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + { + let mut old_f = File::create(&old_path).unwrap(); + old_f.write_all(b"old").unwrap(); + } + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let new_path = new_dir.path().join("new"); + { + let mut new_f = File::create(&new_path).unwrap(); + new_f.write_all(b"new").unwrap(); + } + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::RENAME_EXCHANGE, + ) + .unwrap(); + let mut buf = String::new(); + let mut new_f = File::open(&new_path).unwrap(); + new_f.read_to_string(&mut buf).unwrap(); + assert_eq!(buf, "old"); + buf = "".to_string(); + let mut old_f = File::open(&old_path).unwrap(); + old_f.read_to_string(&mut buf).unwrap(); + assert_eq!(buf, "new"); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); +} + +#[test] +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +fn test_renameat2_noreplace() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + File::create(&old_path).unwrap(); + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let new_path = new_dir.path().join("new"); + File::create(&new_path).unwrap(); + assert_eq!( + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::RENAME_NOREPLACE + ) + .unwrap_err(), + Errno::EEXIST + ); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); + assert!(new_dir.path().join("new").exists()); + assert!(old_dir.path().join("old").exists()); +} + + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_readlink() { + let tempdir = tempfile::tempdir().unwrap(); + let src = tempdir.path().join("a"); + let dst = tempdir.path().join("b"); + println!("a: {:?}, b: {:?}", &src, &dst); + fs::symlink(&src.as_path(), &dst.as_path()).unwrap(); + let dirfd = open(tempdir.path(), + OFlag::empty(), + Mode::empty()).unwrap(); + let expected_dir = src.to_str().unwrap(); + + assert_eq!(readlink(&dst).unwrap().to_str().unwrap(), expected_dir); + assert_eq!(readlinkat(dirfd, "b").unwrap().to_str().unwrap(), expected_dir); + +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod linux_android { + use std::io::prelude::*; + use std::io::SeekFrom; + use std::os::unix::prelude::*; + use libc::loff_t; + + use nix::fcntl::*; + use nix::sys::uio::IoVec; + use nix::unistd::{close, pipe, read, write}; + + use tempfile::tempfile; + #[cfg(any(target_os = "linux"))] + use tempfile::NamedTempFile; + + use crate::*; + + /// This test creates a temporary file containing the contents + /// 'foobarbaz' and uses the `copy_file_range` call to transfer + /// 3 bytes at offset 3 (`bar`) to another empty file at offset 0. The + /// resulting file is read and should contain the contents `bar`. + /// The from_offset should be updated by the call to reflect + /// the 3 bytes read (6). + #[test] + // QEMU does not support copy_file_range. Skip under qemu + #[cfg_attr(qemu, ignore)] + fn test_copy_file_range() { + const CONTENTS: &[u8] = b"foobarbaz"; + + let mut tmp1 = tempfile().unwrap(); + let mut tmp2 = tempfile().unwrap(); + + tmp1.write_all(CONTENTS).unwrap(); + tmp1.flush().unwrap(); + + let mut from_offset: i64 = 3; + copy_file_range( + tmp1.as_raw_fd(), + Some(&mut from_offset), + tmp2.as_raw_fd(), + None, + 3, + ) + .unwrap(); + + let mut res: String = String::new(); + tmp2.seek(SeekFrom::Start(0)).unwrap(); + tmp2.read_to_string(&mut res).unwrap(); + + assert_eq!(res, String::from("bar")); + assert_eq!(from_offset, 6); + } + + #[test] + fn test_splice() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let (rd, wr) = pipe().unwrap(); + let mut offset: loff_t = 5; + let res = splice(tmp.as_raw_fd(), Some(&mut offset), + wr, None, 2, SpliceFFlags::empty()).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + assert_eq!(2, read(rd, &mut buf).unwrap()); + assert_eq!(b"f1", &buf[0..2]); + assert_eq!(7, offset); + + close(rd).unwrap(); + close(wr).unwrap(); + } + + #[test] + fn test_tee() { + let (rd1, wr1) = pipe().unwrap(); + let (rd2, wr2) = pipe().unwrap(); + + write(wr1, b"abc").unwrap(); + let res = tee(rd1, wr2, 2, SpliceFFlags::empty()).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + + // Check the tee'd bytes are at rd2. + assert_eq!(2, read(rd2, &mut buf).unwrap()); + assert_eq!(b"ab", &buf[0..2]); + + // Check all the bytes are still at rd1. + assert_eq!(3, read(rd1, &mut buf).unwrap()); + assert_eq!(b"abc", &buf[0..3]); + + close(rd1).unwrap(); + close(wr1).unwrap(); + close(rd2).unwrap(); + close(wr2).unwrap(); + } + + #[test] + fn test_vmsplice() { + let (rd, wr) = pipe().unwrap(); + + let buf1 = b"abcdef"; + let buf2 = b"defghi"; + let iovecs = vec![ + IoVec::from_slice(&buf1[0..3]), + IoVec::from_slice(&buf2[0..3]) + ]; + + let res = vmsplice(wr, &iovecs[..], SpliceFFlags::empty()).unwrap(); + + assert_eq!(6, res); + + // Check the bytes can be read at rd. + let mut buf = [0u8; 32]; + assert_eq!(6, read(rd, &mut buf).unwrap()); + assert_eq!(b"abcdef", &buf[0..6]); + + close(rd).unwrap(); + close(wr).unwrap(); + } + + #[cfg(any(target_os = "linux"))] + #[test] + fn test_fallocate() { + let tmp = NamedTempFile::new().unwrap(); + + let fd = tmp.as_raw_fd(); + fallocate(fd, FallocateFlags::empty(), 0, 100).unwrap(); + + // Check if we read exactly 100 bytes + let mut buf = [0u8; 200]; + assert_eq!(100, read(fd, &mut buf).unwrap()); + } + + // The tests below are disabled for the listed targets + // due to OFD locks not being available in the kernel/libc + // versions used in the CI environment, probably because + // they run under QEMU. + + #[test] + #[cfg(all(target_os = "linux", not(target_env = "musl")))] + fn test_ofd_write_lock() { + use nix::sys::stat::fstat; + use std::mem; + + let tmp = NamedTempFile::new().unwrap(); + + let fd = tmp.as_raw_fd(); + let statfs = nix::sys::statfs::fstatfs(&tmp).unwrap(); + if statfs.filesystem_type() == nix::sys::statfs::OVERLAYFS_SUPER_MAGIC { + // OverlayFS is a union file system. It returns one inode value in + // stat(2), but a different one shows up in /proc/locks. So we must + // skip the test. + skip!("/proc/locks does not work on overlayfs"); + } + let inode = fstat(fd).expect("fstat failed").st_ino as usize; + + let mut flock: libc::flock = unsafe { + mem::zeroed() // required for Linux/mips + }; + flock.l_type = libc::F_WRLCK as libc::c_short; + flock.l_whence = libc::SEEK_SET as libc::c_short; + flock.l_start = 0; + flock.l_len = 0; + flock.l_pid = 0; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("write lock failed"); + assert_eq!( + Some(("OFDLCK".to_string(), "WRITE".to_string())), + lock_info(inode) + ); + + flock.l_type = libc::F_UNLCK as libc::c_short; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("write unlock failed"); + assert_eq!(None, lock_info(inode)); + } + + #[test] + #[cfg(all(target_os = "linux", not(target_env = "musl")))] + fn test_ofd_read_lock() { + use nix::sys::stat::fstat; + use std::mem; + + let tmp = NamedTempFile::new().unwrap(); + + let fd = tmp.as_raw_fd(); + let statfs = nix::sys::statfs::fstatfs(&tmp).unwrap(); + if statfs.filesystem_type() == nix::sys::statfs::OVERLAYFS_SUPER_MAGIC { + // OverlayFS is a union file system. It returns one inode value in + // stat(2), but a different one shows up in /proc/locks. So we must + // skip the test. + skip!("/proc/locks does not work on overlayfs"); + } + let inode = fstat(fd).expect("fstat failed").st_ino as usize; + + let mut flock: libc::flock = unsafe { + mem::zeroed() // required for Linux/mips + }; + flock.l_type = libc::F_RDLCK as libc::c_short; + flock.l_whence = libc::SEEK_SET as libc::c_short; + flock.l_start = 0; + flock.l_len = 0; + flock.l_pid = 0; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("read lock failed"); + assert_eq!( + Some(("OFDLCK".to_string(), "READ".to_string())), + lock_info(inode) + ); + + flock.l_type = libc::F_UNLCK as libc::c_short; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("read unlock failed"); + assert_eq!(None, lock_info(inode)); + } + + #[cfg(all(target_os = "linux", not(target_env = "musl")))] + fn lock_info(inode: usize) -> Option<(String, String)> { + use std::{ + fs::File, + io::BufReader + }; + + let file = File::open("/proc/locks").expect("open /proc/locks failed"); + let buf = BufReader::new(file); + + for line in buf.lines() { + let line = line.unwrap(); + let parts: Vec<_> = line.split_whitespace().collect(); + let lock_type = parts[1]; + let lock_access = parts[3]; + let ino_parts: Vec<_> = parts[5].split(':').collect(); + let ino: usize = ino_parts[2].parse().unwrap(); + if ino == inode { + return Some((lock_type.to_string(), lock_access.to_string())); + } + } + None + } +} + +#[cfg(any(target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_env = "uclibc", + target_os = "freebsd"))] +mod test_posix_fadvise { + + use tempfile::NamedTempFile; + use std::os::unix::io::{RawFd, AsRawFd}; + use nix::errno::Errno; + use nix::fcntl::*; + use nix::unistd::pipe; + + #[test] + fn test_success() { + let tmp = NamedTempFile::new().unwrap(); + let fd = tmp.as_raw_fd(); + let res = posix_fadvise(fd, 0, 100, PosixFadviseAdvice::POSIX_FADV_WILLNEED); + + assert!(res.is_ok()); + } + + #[test] + fn test_errno() { + let (rd, _wr) = pipe().unwrap(); + let res = posix_fadvise(rd as RawFd, 0, 100, PosixFadviseAdvice::POSIX_FADV_WILLNEED); + assert_eq!(res, Err(Errno::ESPIPE)); + } +} + +#[cfg(any(target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_os = "freebsd"))] +mod test_posix_fallocate { + + use tempfile::NamedTempFile; + use std::{io::Read, os::unix::io::{RawFd, AsRawFd}}; + use nix::errno::Errno; + use nix::fcntl::*; + use nix::unistd::pipe; + + #[test] + fn success() { + const LEN: usize = 100; + let mut tmp = NamedTempFile::new().unwrap(); + let fd = tmp.as_raw_fd(); + let res = posix_fallocate(fd, 0, LEN as libc::off_t); + match res { + Ok(_) => { + let mut data = [1u8; LEN]; + assert_eq!(tmp.read(&mut data).expect("read failure"), LEN); + assert_eq!(&data[..], &[0u8; LEN][..]); + } + Err(Errno::EINVAL) => { + // POSIX requires posix_fallocate to return EINVAL both for + // invalid arguments (i.e. len < 0) and if the operation is not + // supported by the file system. + // There's no way to tell for sure whether the file system + // supports posix_fallocate, so we must pass the test if it + // returns EINVAL. + } + _ => res.unwrap(), + } + } + + #[test] + fn errno() { + let (rd, _wr) = pipe().unwrap(); + let err = posix_fallocate(rd as RawFd, 0, 100).unwrap_err(); + match err { + Errno::EINVAL | Errno::ENODEV | Errno::ESPIPE | Errno::EBADF => (), + errno => + panic!( + "unexpected errno {}", + errno, + ), + } + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_kmod/hello_mod/Makefile b/bash-5.1/vendor/nix-0.23.1/test/test_kmod/hello_mod/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..74c99b77e96e1434c00eee89f44b0baa07951760 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_kmod/hello_mod/Makefile @@ -0,0 +1,7 @@ +obj-m += hello.o + +all: + make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules + +clean: + make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_kmod/hello_mod/hello.c b/bash-5.1/vendor/nix-0.23.1/test/test_kmod/hello_mod/hello.c new file mode 100644 index 0000000000000000000000000000000000000000..1c34987d2ac399af2a498233967a425119036f71 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_kmod/hello_mod/hello.c @@ -0,0 +1,26 @@ +/* + * SPDX-License-Identifier: GPL-2.0+ or MIT + */ +#include +#include + +static int number= 1; +static char *who = "World"; + +module_param(number, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +MODULE_PARM_DESC(myint, "Just some number"); +module_param(who, charp, 0000); +MODULE_PARM_DESC(who, "Whot to greet"); + +int init_module(void) +{ + printk(KERN_INFO "Hello %s (%d)!\n", who, number); + return 0; +} + +void cleanup_module(void) +{ + printk(KERN_INFO "Goodbye %s (%d)!\n", who, number); +} + +MODULE_LICENSE("Dual MIT/GPL"); diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_kmod/mod.rs b/bash-5.1/vendor/nix-0.23.1/test/test_kmod/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..8eef5384a36e258d4970f98a67ecb055448c6222 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_kmod/mod.rs @@ -0,0 +1,164 @@ +use std::fs::copy; +use std::path::PathBuf; +use std::process::Command; +use tempfile::{tempdir, TempDir}; +use crate::*; + +fn compile_kernel_module() -> (PathBuf, String, TempDir) { + let _m = crate::FORK_MTX.lock(); + + let tmp_dir = tempdir().expect("unable to create temporary build directory"); + + copy( + "test/test_kmod/hello_mod/hello.c", + &tmp_dir.path().join("hello.c"), + ).expect("unable to copy hello.c to temporary build directory"); + copy( + "test/test_kmod/hello_mod/Makefile", + &tmp_dir.path().join("Makefile"), + ).expect("unable to copy Makefile to temporary build directory"); + + let status = Command::new("make") + .current_dir(tmp_dir.path()) + .status() + .expect("failed to run make"); + + assert!(status.success()); + + // Return the relative path of the build kernel module + (tmp_dir.path().join("hello.ko"), "hello".to_owned(), tmp_dir) +} + +use nix::errno::Errno; +use nix::kmod::{delete_module, DeleteModuleFlags}; +use nix::kmod::{finit_module, init_module, ModuleInitFlags}; +use std::ffi::CString; +use std::fs::File; +use std::io::Read; + +#[test] +fn test_finit_and_delete_module() { + require_capability!("test_finit_and_delete_module", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let f = File::open(kmod_path).expect("unable to open kernel module"); + finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()) + .expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ).expect("unable to unload kernel module"); +} + +#[test] +fn test_finit_and_delete_module_with_params() { + require_capability!("test_finit_and_delete_module_with_params", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let f = File::open(kmod_path).expect("unable to open kernel module"); + finit_module( + &f, + &CString::new("who=Rust number=2018").unwrap(), + ModuleInitFlags::empty(), + ).expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ).expect("unable to unload kernel module"); +} + +#[test] +fn test_init_and_delete_module() { + require_capability!("test_init_and_delete_module", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let mut f = File::open(kmod_path).expect("unable to open kernel module"); + let mut contents: Vec = Vec::new(); + f.read_to_end(&mut contents) + .expect("unable to read kernel module content to buffer"); + init_module(&contents, &CString::new("").unwrap()).expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ).expect("unable to unload kernel module"); +} + +#[test] +fn test_init_and_delete_module_with_params() { + require_capability!("test_init_and_delete_module_with_params", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let mut f = File::open(kmod_path).expect("unable to open kernel module"); + let mut contents: Vec = Vec::new(); + f.read_to_end(&mut contents) + .expect("unable to read kernel module content to buffer"); + init_module(&contents, &CString::new("who=Nix number=2015").unwrap()) + .expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ).expect("unable to unload kernel module"); +} + +#[test] +fn test_finit_module_invalid() { + require_capability!("test_finit_module_invalid", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let kmod_path = "/dev/zero"; + + let f = File::open(kmod_path).expect("unable to open kernel module"); + let result = finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()); + + assert_eq!(result.unwrap_err(), Errno::EINVAL); +} + +#[test] +fn test_finit_module_twice_and_delete_module() { + require_capability!("test_finit_module_twice_and_delete_module", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let f = File::open(kmod_path).expect("unable to open kernel module"); + finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()) + .expect("unable to load kernel module"); + + let result = finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()); + + assert_eq!(result.unwrap_err(), Errno::EEXIST); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ).expect("unable to unload kernel module"); +} + +#[test] +fn test_delete_module_not_loaded() { + require_capability!("test_delete_module_not_loaded", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let result = delete_module(&CString::new("hello").unwrap(), DeleteModuleFlags::empty()); + + assert_eq!(result.unwrap_err(), Errno::ENOENT); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_mount.rs b/bash-5.1/vendor/nix-0.23.1/test/test_mount.rs new file mode 100644 index 0000000000000000000000000000000000000000..44287f975ff0723cf5397407bd84391e8b5fa64d --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_mount.rs @@ -0,0 +1,236 @@ +mod common; + +// Impelmentation note: to allow unprivileged users to run it, this test makes +// use of user and mount namespaces. On systems that allow unprivileged user +// namespaces (Linux >= 3.8 compiled with CONFIG_USER_NS), the test should run +// without root. + +#[cfg(target_os = "linux")] +mod test_mount { + use std::fs::{self, File}; + use std::io::{self, Read, Write}; + use std::os::unix::fs::OpenOptionsExt; + use std::os::unix::fs::PermissionsExt; + use std::process::{self, Command}; + + use libc::{EACCES, EROFS}; + + use nix::errno::Errno; + use nix::mount::{mount, umount, MsFlags}; + use nix::sched::{unshare, CloneFlags}; + use nix::sys::stat::{self, Mode}; + use nix::unistd::getuid; + + static SCRIPT_CONTENTS: &[u8] = b"#!/bin/sh +exit 23"; + + const EXPECTED_STATUS: i32 = 23; + + const NONE: Option<&'static [u8]> = None; + #[allow(clippy::bind_instead_of_map)] // False positive + pub fn test_mount_tmpfs_without_flags_allows_rwx() { + let tempdir = tempfile::tempdir().unwrap(); + + mount(NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::empty(), + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + let test_path = tempdir.path().join("test"); + + // Verify write. + fs::OpenOptions::new() + .create(true) + .write(true) + .mode((Mode::S_IRWXU | Mode::S_IRWXG | Mode::S_IRWXO).bits()) + .open(&test_path) + .or_else(|e| + if Errno::from_i32(e.raw_os_error().unwrap()) == Errno::EOVERFLOW { + // Skip tests on certain Linux kernels which have a bug + // regarding tmpfs in namespaces. + // Ubuntu 14.04 and 16.04 are known to be affected; 16.10 is + // not. There is no legitimate reason for open(2) to return + // EOVERFLOW here. + // https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1659087 + let stderr = io::stderr(); + let mut handle = stderr.lock(); + writeln!(handle, "Buggy Linux kernel detected. Skipping test.") + .unwrap(); + process::exit(0); + } else { + panic!("open failed: {}", e); + } + ) + .and_then(|mut f| f.write(SCRIPT_CONTENTS)) + .unwrap_or_else(|e| panic!("write failed: {}", e)); + + // Verify read. + let mut buf = Vec::new(); + File::open(&test_path) + .and_then(|mut f| f.read_to_end(&mut buf)) + .unwrap_or_else(|e| panic!("read failed: {}", e)); + assert_eq!(buf, SCRIPT_CONTENTS); + + // Verify execute. + assert_eq!(EXPECTED_STATUS, + Command::new(&test_path) + .status() + .unwrap_or_else(|e| panic!("exec failed: {}", e)) + .code() + .unwrap_or_else(|| panic!("child killed by signal"))); + + umount(tempdir.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + pub fn test_mount_rdonly_disallows_write() { + let tempdir = tempfile::tempdir().unwrap(); + + mount(NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::MS_RDONLY, + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + // EROFS: Read-only file system + assert_eq!(EROFS as i32, + File::create(tempdir.path().join("test")).unwrap_err().raw_os_error().unwrap()); + + umount(tempdir.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + pub fn test_mount_noexec_disallows_exec() { + let tempdir = tempfile::tempdir().unwrap(); + + mount(NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::MS_NOEXEC, + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + let test_path = tempdir.path().join("test"); + + fs::OpenOptions::new() + .create(true) + .write(true) + .mode((Mode::S_IRWXU | Mode::S_IRWXG | Mode::S_IRWXO).bits()) + .open(&test_path) + .and_then(|mut f| f.write(SCRIPT_CONTENTS)) + .unwrap_or_else(|e| panic!("write failed: {}", e)); + + // Verify that we cannot execute despite a+x permissions being set. + let mode = stat::Mode::from_bits_truncate(fs::metadata(&test_path) + .map(|md| md.permissions().mode()) + .unwrap_or_else(|e| { + panic!("metadata failed: {}", e) + })); + + assert!(mode.contains(Mode::S_IXUSR | Mode::S_IXGRP | Mode::S_IXOTH), + "{:?} did not have execute permissions", + &test_path); + + // EACCES: Permission denied + assert_eq!(EACCES as i32, + Command::new(&test_path).status().unwrap_err().raw_os_error().unwrap()); + + umount(tempdir.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + pub fn test_mount_bind() { + let tempdir = tempfile::tempdir().unwrap(); + let file_name = "test"; + + { + let mount_point = tempfile::tempdir().unwrap(); + + mount(Some(tempdir.path()), + mount_point.path(), + NONE, + MsFlags::MS_BIND, + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + fs::OpenOptions::new() + .create(true) + .write(true) + .mode((Mode::S_IRWXU | Mode::S_IRWXG | Mode::S_IRWXO).bits()) + .open(mount_point.path().join(file_name)) + .and_then(|mut f| f.write(SCRIPT_CONTENTS)) + .unwrap_or_else(|e| panic!("write failed: {}", e)); + + umount(mount_point.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + // Verify the file written in the mount shows up in source directory, even + // after unmounting. + + let mut buf = Vec::new(); + File::open(tempdir.path().join(file_name)) + .and_then(|mut f| f.read_to_end(&mut buf)) + .unwrap_or_else(|e| panic!("read failed: {}", e)); + assert_eq!(buf, SCRIPT_CONTENTS); + } + + pub fn setup_namespaces() { + // Hold on to the uid in the parent namespace. + let uid = getuid(); + + unshare(CloneFlags::CLONE_NEWNS | CloneFlags::CLONE_NEWUSER).unwrap_or_else(|e| { + let stderr = io::stderr(); + let mut handle = stderr.lock(); + writeln!(handle, + "unshare failed: {}. Are unprivileged user namespaces available?", + e).unwrap(); + writeln!(handle, "mount is not being tested").unwrap(); + // Exit with success because not all systems support unprivileged user namespaces, and + // that's not what we're testing for. + process::exit(0); + }); + + // Map user as uid 1000. + fs::OpenOptions::new() + .write(true) + .open("/proc/self/uid_map") + .and_then(|mut f| f.write(format!("1000 {} 1\n", uid).as_bytes())) + .unwrap_or_else(|e| panic!("could not write uid map: {}", e)); + } +} + + +// Test runner + +/// Mimic normal test output (hackishly). +#[cfg(target_os = "linux")] +macro_rules! run_tests { + ( $($test_fn:ident),* ) => {{ + println!(); + + $( + print!("test test_mount::{} ... ", stringify!($test_fn)); + $test_fn(); + println!("ok"); + )* + + println!(); + }} +} + +#[cfg(target_os = "linux")] +fn main() { + use test_mount::{setup_namespaces, test_mount_tmpfs_without_flags_allows_rwx, + test_mount_rdonly_disallows_write, test_mount_noexec_disallows_exec, + test_mount_bind}; + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1351"); + setup_namespaces(); + + run_tests!(test_mount_tmpfs_without_flags_allows_rwx, + test_mount_rdonly_disallows_write, + test_mount_noexec_disallows_exec, + test_mount_bind); +} + +#[cfg(not(target_os = "linux"))] +fn main() {} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_mq.rs b/bash-5.1/vendor/nix-0.23.1/test/test_mq.rs new file mode 100644 index 0000000000000000000000000000000000000000..430df5ddccbe504b66183b83e7061b992da77774 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_mq.rs @@ -0,0 +1,157 @@ +use std::ffi::CString; +use std::str; + +use nix::errno::Errno; +use nix::mqueue::{mq_open, mq_close, mq_send, mq_receive, mq_attr_member_t}; +use nix::mqueue::{MqAttr, MQ_OFlag}; +use nix::sys::stat::Mode; + +#[test] +fn test_mq_send_and_receive() { + const MSG_SIZE: mq_attr_member_t = 32; + let attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name= &CString::new(b"/a_nix_test_queue".as_ref()).unwrap(); + + let oflag0 = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r0 = mq_open(mq_name, oflag0, mode, Some(&attr)); + if let Err(Errno::ENOSYS) = r0 { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd0 = r0.unwrap(); + let msg_to_send = "msg_1"; + mq_send(mqd0, msg_to_send.as_bytes(), 1).unwrap(); + + let oflag1 = MQ_OFlag::O_CREAT | MQ_OFlag::O_RDONLY; + let mqd1 = mq_open(mq_name, oflag1, mode, Some(&attr)).unwrap(); + let mut buf = [0u8; 32]; + let mut prio = 0u32; + let len = mq_receive(mqd1, &mut buf, &mut prio).unwrap(); + assert_eq!(prio, 1); + + mq_close(mqd1).unwrap(); + mq_close(mqd0).unwrap(); + assert_eq!(msg_to_send, str::from_utf8(&buf[0..len]).unwrap()); +} + + +#[test] +#[cfg(not(any(target_os = "netbsd")))] +fn test_mq_getattr() { + use nix::mqueue::mq_getattr; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + + let read_attr = mq_getattr(mqd).unwrap(); + assert_eq!(read_attr, initial_attr); + mq_close(mqd).unwrap(); +} + +// FIXME: Fix failures for mips in QEMU +#[test] +#[cfg(not(any(target_os = "netbsd")))] +#[cfg_attr(all( + qemu, + any(target_arch = "mips", target_arch = "mips64") + ), ignore +)] +fn test_mq_setattr() { + use nix::mqueue::{mq_getattr, mq_setattr}; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + + let new_attr = MqAttr::new(0, 20, MSG_SIZE * 2, 100); + let old_attr = mq_setattr(mqd, &new_attr).unwrap(); + assert_eq!(old_attr, initial_attr); + + let new_attr_get = mq_getattr(mqd).unwrap(); + // The following tests make sense. No changes here because according to the Linux man page only + // O_NONBLOCK can be set (see tests below) + assert_ne!(new_attr_get, new_attr); + + let new_attr_non_blocking = MqAttr::new(MQ_OFlag::O_NONBLOCK.bits() as mq_attr_member_t, 10, MSG_SIZE, 0); + mq_setattr(mqd, &new_attr_non_blocking).unwrap(); + let new_attr_get = mq_getattr(mqd).unwrap(); + + // now the O_NONBLOCK flag has been set + assert_ne!(new_attr_get, initial_attr); + assert_eq!(new_attr_get, new_attr_non_blocking); + mq_close(mqd).unwrap(); +} + +// FIXME: Fix failures for mips in QEMU +#[test] +#[cfg(not(any(target_os = "netbsd")))] +#[cfg_attr(all( + qemu, + any(target_arch = "mips", target_arch = "mips64") + ), ignore +)] +fn test_mq_set_nonblocking() { + use nix::mqueue::{mq_getattr, mq_set_nonblock, mq_remove_nonblock}; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + mq_set_nonblock(mqd).unwrap(); + let new_attr = mq_getattr(mqd); + assert_eq!(new_attr.unwrap().flags(), MQ_OFlag::O_NONBLOCK.bits() as mq_attr_member_t); + mq_remove_nonblock(mqd).unwrap(); + let new_attr = mq_getattr(mqd); + assert_eq!(new_attr.unwrap().flags(), 0); + mq_close(mqd).unwrap(); +} + +#[test] +#[cfg(not(any(target_os = "netbsd")))] +fn test_mq_unlink() { + use nix::mqueue::mq_unlink; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name_opened = &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); + let mq_name_not_opened = &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name_opened, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + + let res_unlink = mq_unlink(mq_name_opened); + assert_eq!(res_unlink, Ok(()) ); + + let res_unlink_not_opened = mq_unlink(mq_name_not_opened); + assert_eq!(res_unlink_not_opened, Err(Errno::ENOENT) ); + + mq_close(mqd).unwrap(); + let res_unlink_after_close = mq_unlink(mq_name_opened); + assert_eq!(res_unlink_after_close, Err(Errno::ENOENT) ); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_net.rs b/bash-5.1/vendor/nix-0.23.1/test/test_net.rs new file mode 100644 index 0000000000000000000000000000000000000000..40ecd6bb754fae5eb0a55d650ec64f37dc93c3d7 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_net.rs @@ -0,0 +1,12 @@ +use nix::net::if_::*; + +#[cfg(any(target_os = "android", target_os = "linux"))] +const LOOPBACK: &[u8] = b"lo"; + +#[cfg(not(any(target_os = "android", target_os = "linux")))] +const LOOPBACK: &[u8] = b"lo0"; + +#[test] +fn test_if_nametoindex() { + assert!(if_nametoindex(LOOPBACK).is_ok()); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_nix_path.rs b/bash-5.1/vendor/nix-0.23.1/test/test_nix_path.rs new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_nmount.rs b/bash-5.1/vendor/nix-0.23.1/test/test_nmount.rs new file mode 100644 index 0000000000000000000000000000000000000000..4c74ecf627330c781efcd0d0ddd601abc626da01 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_nmount.rs @@ -0,0 +1,51 @@ +use crate::*; +use nix::{ + errno::Errno, + mount::{MntFlags, Nmount, unmount} +}; +use std::{ + ffi::CString, + fs::File, + path::Path +}; +use tempfile::tempdir; + +#[test] +fn ok() { + require_mount!("nullfs"); + + let mountpoint = tempdir().unwrap(); + let target = tempdir().unwrap(); + let _sentry = File::create(target.path().join("sentry")).unwrap(); + + let fstype = CString::new("fstype").unwrap(); + let nullfs = CString::new("nullfs").unwrap(); + Nmount::new() + .str_opt(&fstype, &nullfs) + .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) + .str_opt_owned("target", target.path().to_str().unwrap()) + .nmount(MntFlags::empty()).unwrap(); + + // Now check that the sentry is visible through the mountpoint + let exists = Path::exists(&mountpoint.path().join("sentry")); + + // Cleanup the mountpoint before asserting + unmount(mountpoint.path(), MntFlags::empty()).unwrap(); + + assert!(exists); +} + +#[test] +fn bad_fstype() { + let mountpoint = tempdir().unwrap(); + let target = tempdir().unwrap(); + let _sentry = File::create(target.path().join("sentry")).unwrap(); + + let e = Nmount::new() + .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) + .str_opt_owned("target", target.path().to_str().unwrap()) + .nmount(MntFlags::empty()).unwrap_err(); + + assert_eq!(e.error(), Errno::EINVAL); + assert_eq!(e.errmsg(), Some("Invalid fstype")); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_poll.rs b/bash-5.1/vendor/nix-0.23.1/test/test_poll.rs new file mode 100644 index 0000000000000000000000000000000000000000..e4b369f3f2a0201aa984624e0831bae85a5d5268 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_poll.rs @@ -0,0 +1,82 @@ +use nix::{ + errno::Errno, + poll::{PollFlags, poll, PollFd}, + unistd::{write, pipe} +}; + +macro_rules! loop_while_eintr { + ($poll_expr: expr) => { + loop { + match $poll_expr { + Ok(nfds) => break nfds, + Err(Errno::EINTR) => (), + Err(e) => panic!("{}", e) + } + } + } +} + +#[test] +fn test_poll() { + let (r, w) = pipe().unwrap(); + let mut fds = [PollFd::new(r, PollFlags::POLLIN)]; + + // Poll an idle pipe. Should timeout + let nfds = loop_while_eintr!(poll(&mut fds, 100)); + assert_eq!(nfds, 0); + assert!(!fds[0].revents().unwrap().contains(PollFlags::POLLIN)); + + write(w, b".").unwrap(); + + // Poll a readable pipe. Should return an event. + let nfds = poll(&mut fds, 100).unwrap(); + assert_eq!(nfds, 1); + assert!(fds[0].revents().unwrap().contains(PollFlags::POLLIN)); +} + +// ppoll(2) is the same as poll except for how it handles timeouts and signals. +// Repeating the test for poll(2) should be sufficient to check that our +// bindings are correct. +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux"))] +#[test] +fn test_ppoll() { + use nix::poll::ppoll; + use nix::sys::signal::SigSet; + use nix::sys::time::{TimeSpec, TimeValLike}; + + let timeout = TimeSpec::milliseconds(1); + let (r, w) = pipe().unwrap(); + let mut fds = [PollFd::new(r, PollFlags::POLLIN)]; + + // Poll an idle pipe. Should timeout + let sigset = SigSet::empty(); + let nfds = loop_while_eintr!(ppoll(&mut fds, Some(timeout), sigset)); + assert_eq!(nfds, 0); + assert!(!fds[0].revents().unwrap().contains(PollFlags::POLLIN)); + + write(w, b".").unwrap(); + + // Poll a readable pipe. Should return an event. + let nfds = ppoll(&mut fds, Some(timeout), SigSet::empty()).unwrap(); + assert_eq!(nfds, 1); + assert!(fds[0].revents().unwrap().contains(PollFlags::POLLIN)); +} + +#[test] +fn test_pollfd_fd() { + use std::os::unix::io::AsRawFd; + + let pfd = PollFd::new(0x1234, PollFlags::empty()); + assert_eq!(pfd.as_raw_fd(), 0x1234); +} + +#[test] +fn test_pollfd_events() { + let mut pfd = PollFd::new(-1, PollFlags::POLLIN); + assert_eq!(pfd.events(), PollFlags::POLLIN); + pfd.set_events(PollFlags::POLLOUT); + assert_eq!(pfd.events(), PollFlags::POLLOUT); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_pty.rs b/bash-5.1/vendor/nix-0.23.1/test/test_pty.rs new file mode 100644 index 0000000000000000000000000000000000000000..71932f2d6e2300c7864fb33b746be9a07a3345a0 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_pty.rs @@ -0,0 +1,301 @@ +use std::fs::File; +use std::io::{Read, Write}; +use std::path::Path; +use std::os::unix::prelude::*; +use tempfile::tempfile; + +use libc::{_exit, STDOUT_FILENO}; +use nix::fcntl::{OFlag, open}; +use nix::pty::*; +use nix::sys::stat; +use nix::sys::termios::*; +use nix::unistd::{write, close, pause}; + +/// Regression test for Issue #659 +/// This is the correct way to explicitly close a `PtyMaster` +#[test] +fn test_explicit_close() { + let mut f = { + let m = posix_openpt(OFlag::O_RDWR).unwrap(); + close(m.into_raw_fd()).unwrap(); + tempfile().unwrap() + }; + // This should work. But if there's been a double close, then it will + // return EBADF + f.write_all(b"whatever").unwrap(); +} + +/// Test equivalence of `ptsname` and `ptsname_r` +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_equivalence() { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name = unsafe { ptsname(&master_fd) }.unwrap() ; + let slave_name_r = ptsname_r(&master_fd).unwrap(); + assert_eq!(slave_name, slave_name_r); +} + +/// Test data copying of `ptsname` +// TODO need to run in a subprocess, since ptsname is non-reentrant +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_copy() { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name1 = unsafe { ptsname(&master_fd) }.unwrap(); + let slave_name2 = unsafe { ptsname(&master_fd) }.unwrap(); + assert_eq!(slave_name1, slave_name2); + // Also make sure that the string was actually copied and they point to different parts of + // memory. + assert!(slave_name1.as_ptr() != slave_name2.as_ptr()); +} + +/// Test data copying of `ptsname_r` +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_r_copy() { + // Open a new PTTY master + let master_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name1 = ptsname_r(&master_fd).unwrap(); + let slave_name2 = ptsname_r(&master_fd).unwrap(); + assert_eq!(slave_name1, slave_name2); + assert!(slave_name1.as_ptr() != slave_name2.as_ptr()); +} + +/// Test that `ptsname` returns different names for different devices +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_unique() { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master1_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master1_fd.as_raw_fd() > 0); + + // Open a second PTTY master + let master2_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master2_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name1 = unsafe { ptsname(&master1_fd) }.unwrap(); + let slave_name2 = unsafe { ptsname(&master2_fd) }.unwrap(); + assert!(slave_name1 != slave_name2); +} + +/// Common setup for testing PTTY pairs +fn open_ptty_pair() -> (PtyMaster, File) { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master = posix_openpt(OFlag::O_RDWR).expect("posix_openpt failed"); + + // Allow a slave to be generated for it + grantpt(&master).expect("grantpt failed"); + unlockpt(&master).expect("unlockpt failed"); + + // Get the name of the slave + let slave_name = unsafe { ptsname(&master) }.expect("ptsname failed"); + + // Open the slave device + let slave_fd = open(Path::new(&slave_name), OFlag::O_RDWR, stat::Mode::empty()).unwrap(); + + #[cfg(target_os = "illumos")] + // TODO: rewrite using ioctl! + #[allow(clippy::comparison_chain)] + { + use libc::{ioctl, I_FIND, I_PUSH}; + + // On illumos systems, as per pts(7D), one must push STREAMS modules + // after opening a device path returned from ptsname(). + let ptem = b"ptem\0"; + let ldterm = b"ldterm\0"; + let r = unsafe { ioctl(slave_fd, I_FIND, ldterm.as_ptr()) }; + if r < 0 { + panic!("I_FIND failure"); + } else if r == 0 { + if unsafe { ioctl(slave_fd, I_PUSH, ptem.as_ptr()) } < 0 { + panic!("I_PUSH ptem failure"); + } + if unsafe { ioctl(slave_fd, I_PUSH, ldterm.as_ptr()) } < 0 { + panic!("I_PUSH ldterm failure"); + } + } + } + + let slave = unsafe { File::from_raw_fd(slave_fd) }; + + (master, slave) +} + +/// Test opening a master/slave PTTY pair +/// +/// This uses a common `open_ptty_pair` because much of these functions aren't useful by +/// themselves. So for this test we perform the basic act of getting a file handle for a +/// master/slave PTTY pair, then just sanity-check the raw values. +#[test] +fn test_open_ptty_pair() { + let (master, slave) = open_ptty_pair(); + assert!(master.as_raw_fd() > 0); + assert!(slave.as_raw_fd() > 0); +} + +/// Put the terminal in raw mode. +fn make_raw(fd: RawFd) { + let mut termios = tcgetattr(fd).unwrap(); + cfmakeraw(&mut termios); + tcsetattr(fd, SetArg::TCSANOW, &termios).unwrap(); +} + +/// Test `io::Read` on the PTTY master +#[test] +fn test_read_ptty_pair() { + let (mut master, mut slave) = open_ptty_pair(); + make_raw(slave.as_raw_fd()); + + let mut buf = [0u8; 5]; + slave.write_all(b"hello").unwrap(); + master.read_exact(&mut buf).unwrap(); + assert_eq!(&buf, b"hello"); +} + +/// Test `io::Write` on the PTTY master +#[test] +fn test_write_ptty_pair() { + let (mut master, mut slave) = open_ptty_pair(); + make_raw(slave.as_raw_fd()); + + let mut buf = [0u8; 5]; + master.write_all(b"adios").unwrap(); + slave.read_exact(&mut buf).unwrap(); + assert_eq!(&buf, b"adios"); +} + +#[test] +fn test_openpty() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + let pty = openpty(None, None).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Writing to one should be readable on the other one + let string = "foofoofoo\n"; + let mut buf = [0u8; 10]; + write(pty.master, string.as_bytes()).unwrap(); + crate::read_exact(pty.slave, &mut buf); + + assert_eq!(&buf, string.as_bytes()); + + // Read the echo as well + let echoed_string = "foofoofoo\r\n"; + let mut buf = [0u8; 11]; + crate::read_exact(pty.master, &mut buf); + assert_eq!(&buf, echoed_string.as_bytes()); + + let string2 = "barbarbarbar\n"; + let echoed_string2 = "barbarbarbar\r\n"; + let mut buf = [0u8; 14]; + write(pty.slave, string2.as_bytes()).unwrap(); + crate::read_exact(pty.master, &mut buf); + + assert_eq!(&buf, echoed_string2.as_bytes()); + + close(pty.master).unwrap(); + close(pty.slave).unwrap(); +} + +#[test] +fn test_openpty_with_termios() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + // Open one pty to get attributes for the second one + let mut termios = { + let pty = openpty(None, None).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + let termios = tcgetattr(pty.slave).unwrap(); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + termios + }; + // Make sure newlines are not transformed so the data is preserved when sent. + termios.output_flags.remove(OutputFlags::ONLCR); + + let pty = openpty(None, &termios).unwrap(); + // Must be valid file descriptors + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Writing to one should be readable on the other one + let string = "foofoofoo\n"; + let mut buf = [0u8; 10]; + write(pty.master, string.as_bytes()).unwrap(); + crate::read_exact(pty.slave, &mut buf); + + assert_eq!(&buf, string.as_bytes()); + + // read the echo as well + let echoed_string = "foofoofoo\n"; + crate::read_exact(pty.master, &mut buf); + assert_eq!(&buf, echoed_string.as_bytes()); + + let string2 = "barbarbarbar\n"; + let echoed_string2 = "barbarbarbar\n"; + let mut buf = [0u8; 13]; + write(pty.slave, string2.as_bytes()).unwrap(); + crate::read_exact(pty.master, &mut buf); + + assert_eq!(&buf, echoed_string2.as_bytes()); + + close(pty.master).unwrap(); + close(pty.slave).unwrap(); +} + +#[test] +fn test_forkpty() { + use nix::unistd::ForkResult::*; + use nix::sys::signal::*; + use nix::sys::wait::wait; + // forkpty calls openpty which uses ptname(3) internally. + let _m0 = crate::PTSNAME_MTX.lock(); + // forkpty spawns a child process + let _m1 = crate::FORK_MTX.lock(); + + let string = "naninani\n"; + let echoed_string = "naninani\r\n"; + let pty = unsafe { + forkpty(None, None).unwrap() + }; + match pty.fork_result { + Child => { + write(STDOUT_FILENO, string.as_bytes()).unwrap(); + pause(); // we need the child to stay alive until the parent calls read + unsafe { _exit(0); } + }, + Parent { child } => { + let mut buf = [0u8; 10]; + assert!(child.as_raw() > 0); + crate::read_exact(pty.master, &mut buf); + kill(child, SIGTERM).unwrap(); + wait().unwrap(); // keep other tests using generic wait from getting our child + assert_eq!(&buf, echoed_string.as_bytes()); + close(pty.master).unwrap(); + }, + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_ptymaster_drop.rs b/bash-5.1/vendor/nix-0.23.1/test/test_ptymaster_drop.rs new file mode 100644 index 0000000000000000000000000000000000000000..a68f81ee1e24f59c387587c389d4a33245da34ca --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_ptymaster_drop.rs @@ -0,0 +1,20 @@ +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod t { + use nix::fcntl::OFlag; + use nix::pty::*; + use nix::unistd::close; + use std::os::unix::io::AsRawFd; + + /// Regression test for Issue #659 + /// + /// `PtyMaster` should panic rather than double close the file descriptor + /// This must run in its own test process because it deliberately creates a + /// race condition. + #[test] + #[should_panic(expected = "Closing an invalid file descriptor!")] + fn test_double_close() { + let m = posix_openpt(OFlag::O_RDWR).unwrap(); + close(m.as_raw_fd()).unwrap(); + drop(m); // should panic here + } +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_resource.rs b/bash-5.1/vendor/nix-0.23.1/test/test_resource.rs new file mode 100644 index 0000000000000000000000000000000000000000..5969750091d7e968d66103b1aeff7bf8abded303 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_resource.rs @@ -0,0 +1,23 @@ +#[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "illumos")))] +use nix::sys::resource::{getrlimit, setrlimit, Resource}; + +/// Tests the RLIMIT_NOFILE functionality of getrlimit(), where the resource RLIMIT_NOFILE refers +/// to the maximum file descriptor number that can be opened by the process (aka the maximum number +/// of file descriptors that the process can open, since Linux 4.5). +/// +/// We first fetch the existing file descriptor maximum values using getrlimit(), then edit the +/// soft limit to make sure it has a new and distinct value to the hard limit. We then setrlimit() +/// to put the new soft limit in effect, and then getrlimit() once more to ensure the limits have +/// been updated. +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "illumos")))] +pub fn test_resource_limits_nofile() { + let (soft_limit, hard_limit) = getrlimit(Resource::RLIMIT_NOFILE).unwrap(); + + let soft_limit = Some(soft_limit.map_or(1024, |v| v - 1)); + assert_ne!(soft_limit, hard_limit); + setrlimit(Resource::RLIMIT_NOFILE, soft_limit, hard_limit).unwrap(); + + let (new_soft_limit, _) = getrlimit(Resource::RLIMIT_NOFILE).unwrap(); + assert_eq!(new_soft_limit, soft_limit); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_sched.rs b/bash-5.1/vendor/nix-0.23.1/test/test_sched.rs new file mode 100644 index 0000000000000000000000000000000000000000..922196a3dba73b96a97b32e9227f1103b3b6ed09 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_sched.rs @@ -0,0 +1,32 @@ +use nix::sched::{sched_getaffinity, sched_setaffinity, CpuSet}; +use nix::unistd::Pid; + +#[test] +fn test_sched_affinity() { + // If pid is zero, then the mask of the calling process is returned. + let initial_affinity = sched_getaffinity(Pid::from_raw(0)).unwrap(); + let mut at_least_one_cpu = false; + let mut last_valid_cpu = 0; + for field in 0..CpuSet::count() { + if initial_affinity.is_set(field).unwrap() { + at_least_one_cpu = true; + last_valid_cpu = field; + } + } + assert!(at_least_one_cpu); + + // Now restrict the running CPU + let mut new_affinity = CpuSet::new(); + new_affinity.set(last_valid_cpu).unwrap(); + sched_setaffinity(Pid::from_raw(0), &new_affinity).unwrap(); + + // And now re-check the affinity which should be only the one we set. + let updated_affinity = sched_getaffinity(Pid::from_raw(0)).unwrap(); + for field in 0..CpuSet::count() { + // Should be set only for the CPU we set previously + assert_eq!(updated_affinity.is_set(field).unwrap(), field==last_valid_cpu) + } + + // Finally, reset the initial CPU set + sched_setaffinity(Pid::from_raw(0), &initial_affinity).unwrap(); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_sendfile.rs b/bash-5.1/vendor/nix-0.23.1/test/test_sendfile.rs new file mode 100644 index 0000000000000000000000000000000000000000..b6559d329b470ac623f3087d7282747559792250 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_sendfile.rs @@ -0,0 +1,151 @@ +use std::io::prelude::*; +use std::os::unix::prelude::*; + +use libc::off_t; +use nix::sys::sendfile::*; +use tempfile::tempfile; + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + use nix::unistd::{close, pipe, read}; + } else if #[cfg(any(target_os = "freebsd", target_os = "ios", target_os = "macos"))] { + use std::net::Shutdown; + use std::os::unix::net::UnixStream; + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +fn test_sendfile_linux() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let (rd, wr) = pipe().unwrap(); + let mut offset: off_t = 5; + let res = sendfile(wr, tmp.as_raw_fd(), Some(&mut offset), 2).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + assert_eq!(2, read(rd, &mut buf).unwrap()); + assert_eq!(b"f1", &buf[0..2]); + assert_eq!(7, offset); + + close(rd).unwrap(); + close(wr).unwrap(); +} + +#[cfg(target_os = "linux")] +#[test] +fn test_sendfile64_linux() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let (rd, wr) = pipe().unwrap(); + let mut offset: libc::off64_t = 5; + let res = sendfile64(wr, tmp.as_raw_fd(), Some(&mut offset), 2).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + assert_eq!(2, read(rd, &mut buf).unwrap()); + assert_eq!(b"f1", &buf[0..2]); + assert_eq!(7, offset); + + close(rd).unwrap(); + close(wr).unwrap(); +} + +#[cfg(target_os = "freebsd")] +#[test] +fn test_sendfile_freebsd() { + // Declare the content + let header_strings = vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let body = "Xabcdef123456"; + let body_offset = 1; + let trailer_strings = vec!["\n", "Served by Make Believe\n"]; + + // Write the body to a file + let mut tmp = tempfile().unwrap(); + tmp.write_all(body.as_bytes()).unwrap(); + + // Prepare headers and trailers for sendfile + let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); + + // Prepare socket pair + let (mut rd, wr) = UnixStream::pair().unwrap(); + + // Call the test method + let (res, bytes_written) = sendfile( + tmp.as_raw_fd(), + wr.as_raw_fd(), + body_offset as off_t, + None, + Some(headers.as_slice()), + Some(trailers.as_slice()), + SfFlags::empty(), + 0, + ); + assert!(res.is_ok()); + wr.shutdown(Shutdown::Both).unwrap(); + + // Prepare the expected result + let expected_string = + header_strings.concat() + &body[body_offset..] + &trailer_strings.concat(); + + // Verify the message that was sent + assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); + + let mut read_string = String::new(); + let bytes_read = rd.read_to_string(&mut read_string).unwrap(); + assert_eq!(bytes_written as usize, bytes_read); + assert_eq!(expected_string, read_string); +} + +#[cfg(any(target_os = "ios", target_os = "macos"))] +#[test] +fn test_sendfile_darwin() { + // Declare the content + let header_strings = vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let body = "Xabcdef123456"; + let body_offset = 1; + let trailer_strings = vec!["\n", "Served by Make Believe\n"]; + + // Write the body to a file + let mut tmp = tempfile().unwrap(); + tmp.write_all(body.as_bytes()).unwrap(); + + // Prepare headers and trailers for sendfile + let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); + + // Prepare socket pair + let (mut rd, wr) = UnixStream::pair().unwrap(); + + // Call the test method + let (res, bytes_written) = sendfile( + tmp.as_raw_fd(), + wr.as_raw_fd(), + body_offset as off_t, + None, + Some(headers.as_slice()), + Some(trailers.as_slice()), + ); + assert!(res.is_ok()); + wr.shutdown(Shutdown::Both).unwrap(); + + // Prepare the expected result + let expected_string = + header_strings.concat() + &body[body_offset..] + &trailer_strings.concat(); + + // Verify the message that was sent + assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); + + let mut read_string = String::new(); + let bytes_read = rd.read_to_string(&mut read_string).unwrap(); + assert_eq!(bytes_written as usize, bytes_read); + assert_eq!(expected_string, read_string); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_stat.rs b/bash-5.1/vendor/nix-0.23.1/test/test_stat.rs new file mode 100644 index 0000000000000000000000000000000000000000..33cf748da3730a0f0ae31077b05b3a8b0db63e82 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_stat.rs @@ -0,0 +1,358 @@ +#[cfg(not(target_os = "redox"))] +use std::fs; +use std::fs::File; +#[cfg(not(target_os = "redox"))] +use std::os::unix::fs::{symlink, PermissionsExt}; +use std::os::unix::prelude::AsRawFd; +#[cfg(not(target_os = "redox"))] +use std::time::{Duration, UNIX_EPOCH}; +#[cfg(not(target_os = "redox"))] +use std::path::Path; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +use libc::{S_IFMT, S_IFLNK}; +use libc::mode_t; + +#[cfg(not(target_os = "redox"))] +use nix::fcntl; +#[cfg(not(target_os = "redox"))] +use nix::errno::Errno; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::{self, futimens, utimes}; +use nix::sys::stat::{fchmod, stat}; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::{fchmodat, utimensat, mkdirat}; +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] +use nix::sys::stat::lutimes; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::{FchmodatFlags, UtimensatFlags}; +use nix::sys::stat::Mode; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +use nix::sys::stat::FileStat; + +#[cfg(not(target_os = "redox"))] +use nix::sys::time::{TimeSpec, TimeVal, TimeValLike}; +#[cfg(not(target_os = "redox"))] +use nix::unistd::chdir; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +use nix::Result; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn assert_stat_results(stat_result: Result) { + let stats = stat_result.expect("stat call failed"); + assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_ino > 0); // inode is positive integer, exact number machine dependent + assert!(stats.st_mode > 0); // must be positive integer + assert_eq!(stats.st_nlink, 1); // there links created, must be 1 + assert_eq!(stats.st_size, 0); // size is 0 because we did not write anything to the file + assert!(stats.st_blksize > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_blocks <= 16); // Up to 16 blocks can be allocated for a blank file +} + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +// (Android's st_blocks is ulonglong which is always non-negative.) +#[cfg_attr(target_os = "android", allow(unused_comparisons))] +#[allow(clippy::absurd_extreme_comparisons)] // Not absurd on all OSes +fn assert_lstat_results(stat_result: Result) { + let stats = stat_result.expect("stat call failed"); + assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_ino > 0); // inode is positive integer, exact number machine dependent + assert!(stats.st_mode > 0); // must be positive integer + + // st_mode is c_uint (u32 on Android) while S_IFMT is mode_t + // (u16 on Android), and that will be a compile error. + // On other platforms they are the same (either both are u16 or u32). + assert_eq!((stats.st_mode as usize) & (S_IFMT as usize), S_IFLNK as usize); // should be a link + assert_eq!(stats.st_nlink, 1); // there links created, must be 1 + assert!(stats.st_size > 0); // size is > 0 because it points to another file + assert!(stats.st_blksize > 0); // must be positive integer, exact number machine dependent + + // st_blocks depends on whether the machine's file system uses fast + // or slow symlinks, so just make sure it's not negative + assert!(stats.st_blocks >= 0); +} + +#[test] +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn test_stat_and_fstat() { + use nix::sys::stat::fstat; + + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("foo.txt"); + let file = File::create(&filename).unwrap(); + + let stat_result = stat(&filename); + assert_stat_results(stat_result); + + let fstat_result = fstat(file.as_raw_fd()); + assert_stat_results(fstat_result); +} + +#[test] +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn test_fstatat() { + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("foo.txt"); + File::create(&filename).unwrap(); + let dirfd = fcntl::open(tempdir.path(), + fcntl::OFlag::empty(), + stat::Mode::empty()); + + let result = stat::fstatat(dirfd.unwrap(), + &filename, + fcntl::AtFlags::empty()); + assert_stat_results(result); +} + +#[test] +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn test_stat_fstat_lstat() { + use nix::sys::stat::{fstat, lstat}; + + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("bar.txt"); + let linkname = tempdir.path().join("barlink"); + + File::create(&filename).unwrap(); + symlink("bar.txt", &linkname).unwrap(); + let link = File::open(&linkname).unwrap(); + + // should be the same result as calling stat, + // since it's a regular file + let stat_result = stat(&filename); + assert_stat_results(stat_result); + + let lstat_result = lstat(&linkname); + assert_lstat_results(lstat_result); + + let fstat_result = fstat(link.as_raw_fd()); + assert_stat_results(fstat_result); +} + +#[test] +fn test_fchmod() { + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("foo.txt"); + let file = File::create(&filename).unwrap(); + + let mut mode1 = Mode::empty(); + mode1.insert(Mode::S_IRUSR); + mode1.insert(Mode::S_IWUSR); + fchmod(file.as_raw_fd(), mode1).unwrap(); + + let file_stat1 = stat(&filename).unwrap(); + assert_eq!(file_stat1.st_mode as mode_t & 0o7777, mode1.bits()); + + let mut mode2 = Mode::empty(); + mode2.insert(Mode::S_IROTH); + fchmod(file.as_raw_fd(), mode2).unwrap(); + + let file_stat2 = stat(&filename).unwrap(); + assert_eq!(file_stat2.st_mode as mode_t & 0o7777, mode2.bits()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_fchmodat() { + let _dr = crate::DirRestore::new(); + let tempdir = tempfile::tempdir().unwrap(); + let filename = "foo.txt"; + let fullpath = tempdir.path().join(filename); + File::create(&fullpath).unwrap(); + + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + let mut mode1 = Mode::empty(); + mode1.insert(Mode::S_IRUSR); + mode1.insert(Mode::S_IWUSR); + fchmodat(Some(dirfd), filename, mode1, FchmodatFlags::FollowSymlink).unwrap(); + + let file_stat1 = stat(&fullpath).unwrap(); + assert_eq!(file_stat1.st_mode as mode_t & 0o7777, mode1.bits()); + + chdir(tempdir.path()).unwrap(); + + let mut mode2 = Mode::empty(); + mode2.insert(Mode::S_IROTH); + fchmodat(None, filename, mode2, FchmodatFlags::FollowSymlink).unwrap(); + + let file_stat2 = stat(&fullpath).unwrap(); + assert_eq!(file_stat2.st_mode as mode_t & 0o7777, mode2.bits()); +} + +/// Asserts that the atime and mtime in a file's metadata match expected values. +/// +/// The atime and mtime are expressed with a resolution of seconds because some file systems +/// (like macOS's HFS+) do not have higher granularity. +#[cfg(not(target_os = "redox"))] +fn assert_times_eq(exp_atime_sec: u64, exp_mtime_sec: u64, attr: &fs::Metadata) { + assert_eq!( + Duration::new(exp_atime_sec, 0), + attr.accessed().unwrap().duration_since(UNIX_EPOCH).unwrap()); + assert_eq!( + Duration::new(exp_mtime_sec, 0), + attr.modified().unwrap().duration_since(UNIX_EPOCH).unwrap()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_utimes() { + let tempdir = tempfile::tempdir().unwrap(); + let fullpath = tempdir.path().join("file"); + drop(File::create(&fullpath).unwrap()); + + utimes(&fullpath, &TimeVal::seconds(9990), &TimeVal::seconds(5550)).unwrap(); + assert_times_eq(9990, 5550, &fs::metadata(&fullpath).unwrap()); +} + +#[test] +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] +fn test_lutimes() { + let tempdir = tempfile::tempdir().unwrap(); + let target = tempdir.path().join("target"); + let fullpath = tempdir.path().join("symlink"); + drop(File::create(&target).unwrap()); + symlink(&target, &fullpath).unwrap(); + + let exp_target_metadata = fs::symlink_metadata(&target).unwrap(); + lutimes(&fullpath, &TimeVal::seconds(4560), &TimeVal::seconds(1230)).unwrap(); + assert_times_eq(4560, 1230, &fs::symlink_metadata(&fullpath).unwrap()); + + let target_metadata = fs::symlink_metadata(&target).unwrap(); + assert_eq!(exp_target_metadata.accessed().unwrap(), target_metadata.accessed().unwrap(), + "atime of symlink target was unexpectedly modified"); + assert_eq!(exp_target_metadata.modified().unwrap(), target_metadata.modified().unwrap(), + "mtime of symlink target was unexpectedly modified"); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_futimens() { + let tempdir = tempfile::tempdir().unwrap(); + let fullpath = tempdir.path().join("file"); + drop(File::create(&fullpath).unwrap()); + + let fd = fcntl::open(&fullpath, fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + futimens(fd, &TimeSpec::seconds(10), &TimeSpec::seconds(20)).unwrap(); + assert_times_eq(10, 20, &fs::metadata(&fullpath).unwrap()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_utimensat() { + let _dr = crate::DirRestore::new(); + let tempdir = tempfile::tempdir().unwrap(); + let filename = "foo.txt"; + let fullpath = tempdir.path().join(filename); + drop(File::create(&fullpath).unwrap()); + + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + utimensat(Some(dirfd), filename, &TimeSpec::seconds(12345), &TimeSpec::seconds(678), + UtimensatFlags::FollowSymlink).unwrap(); + assert_times_eq(12345, 678, &fs::metadata(&fullpath).unwrap()); + + chdir(tempdir.path()).unwrap(); + + utimensat(None, filename, &TimeSpec::seconds(500), &TimeSpec::seconds(800), + UtimensatFlags::FollowSymlink).unwrap(); + assert_times_eq(500, 800, &fs::metadata(&fullpath).unwrap()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkdirat_success_path() { + let tempdir = tempfile::tempdir().unwrap(); + let filename = "example_subdir"; + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + assert!((mkdirat(dirfd, filename, Mode::S_IRWXU)).is_ok()); + assert!(Path::exists(&tempdir.path().join(filename))); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkdirat_success_mode() { + let expected_bits = stat::SFlag::S_IFDIR.bits() | stat::Mode::S_IRWXU.bits(); + let tempdir = tempfile::tempdir().unwrap(); + let filename = "example_subdir"; + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + assert!((mkdirat(dirfd, filename, Mode::S_IRWXU)).is_ok()); + let permissions = fs::metadata(tempdir.path().join(filename)).unwrap().permissions(); + let mode = permissions.mode(); + assert_eq!(mode as mode_t, expected_bits) +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkdirat_fail() { + let tempdir = tempfile::tempdir().unwrap(); + let not_dir_filename= "example_not_dir"; + let filename = "example_subdir_dir"; + let dirfd = fcntl::open(&tempdir.path().join(not_dir_filename), fcntl::OFlag::O_CREAT, + stat::Mode::empty()).unwrap(); + let result = mkdirat(dirfd, filename, Mode::S_IRWXU).unwrap_err(); + assert_eq!(result, Errno::ENOTDIR); +} + +#[test] +#[cfg(not(any(target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "redox")))] +fn test_mknod() { + use stat::{lstat, mknod, SFlag}; + + let file_name = "test_file"; + let tempdir = tempfile::tempdir().unwrap(); + let target = tempdir.path().join(file_name); + mknod(&target, SFlag::S_IFREG, Mode::S_IRWXU, 0).unwrap(); + let mode = lstat(&target).unwrap().st_mode as mode_t; + assert!(mode & libc::S_IFREG == libc::S_IFREG); + assert!(mode & libc::S_IRWXU == libc::S_IRWXU); +} + +#[test] +#[cfg(not(any(target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "redox")))] +fn test_mknodat() { + use fcntl::{AtFlags, OFlag}; + use nix::dir::Dir; + use stat::{fstatat, mknodat, SFlag}; + + let file_name = "test_file"; + let tempdir = tempfile::tempdir().unwrap(); + let target_dir = Dir::open(tempdir.path(), OFlag::O_DIRECTORY, Mode::S_IRWXU).unwrap(); + mknodat( + target_dir.as_raw_fd(), + file_name, + SFlag::S_IFREG, + Mode::S_IRWXU, + 0, + ) + .unwrap(); + let mode = fstatat( + target_dir.as_raw_fd(), + file_name, + AtFlags::AT_SYMLINK_NOFOLLOW, + ) + .unwrap() + .st_mode as mode_t; + assert!(mode & libc::S_IFREG == libc::S_IFREG); + assert!(mode & libc::S_IRWXU == libc::S_IRWXU); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_time.rs b/bash-5.1/vendor/nix-0.23.1/test/test_time.rs new file mode 100644 index 0000000000000000000000000000000000000000..dc307e57b3abf44eef794a6224aeceb19c81ca92 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_time.rs @@ -0,0 +1,58 @@ +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +use nix::time::clock_getcpuclockid; +use nix::time::{clock_gettime, ClockId}; + +#[cfg(not(target_os = "redox"))] +#[test] +pub fn test_clock_getres() { + assert!(nix::time::clock_getres(ClockId::CLOCK_REALTIME).is_ok()); +} + +#[test] +pub fn test_clock_gettime() { + assert!(clock_gettime(ClockId::CLOCK_REALTIME).is_ok()); +} + +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +#[test] +pub fn test_clock_getcpuclockid() { + let clock_id = clock_getcpuclockid(nix::unistd::Pid::this()).unwrap(); + assert!(clock_gettime(clock_id).is_ok()); +} + +#[cfg(not(target_os = "redox"))] +#[test] +pub fn test_clock_id_res() { + assert!(ClockId::CLOCK_REALTIME.res().is_ok()); +} + +#[test] +pub fn test_clock_id_now() { + assert!(ClockId::CLOCK_REALTIME.now().is_ok()); +} + +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +#[test] +pub fn test_clock_id_pid_cpu_clock_id() { + assert!(ClockId::pid_cpu_clock_id(nix::unistd::Pid::this()) + .map(ClockId::now) + .is_ok()); +} diff --git a/bash-5.1/vendor/nix-0.23.1/test/test_unistd.rs b/bash-5.1/vendor/nix-0.23.1/test/test_unistd.rs new file mode 100644 index 0000000000000000000000000000000000000000..61062ad2299881845db24b1d0b31e371cd7abb22 --- /dev/null +++ b/bash-5.1/vendor/nix-0.23.1/test/test_unistd.rs @@ -0,0 +1,1150 @@ +#[cfg(not(target_os = "redox"))] +use nix::fcntl::{self, open, readlink}; +use nix::fcntl::OFlag; +use nix::unistd::*; +use nix::unistd::ForkResult::*; +#[cfg(not(target_os = "redox"))] +use nix::sys::signal::{SaFlags, SigAction, SigHandler, SigSet, Signal, sigaction}; +use nix::sys::wait::*; +use nix::sys::stat::{self, Mode, SFlag}; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +use nix::pty::{posix_openpt, grantpt, unlockpt, ptsname}; +use nix::errno::Errno; +use std::env; +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] +use std::ffi::CString; +#[cfg(not(target_os = "redox"))] +use std::fs::DirBuilder; +use std::fs::{self, File}; +use std::io::Write; +use std::os::unix::prelude::*; +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] +use std::path::Path; +use tempfile::{tempdir, tempfile}; +use libc::{_exit, mode_t, off_t}; + +use crate::*; + +#[test] +#[cfg(not(any(target_os = "netbsd")))] +fn test_fork_and_waitpid() { + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is signal-safe + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => unsafe { _exit(0) }, + Parent { child } => { + // assert that child was created and pid > 0 + let child_raw: ::libc::pid_t = child.into(); + assert!(child_raw > 0); + let wait_status = waitpid(child, None); + match wait_status { + // assert that waitpid returned correct status and the pid is the one of the child + Ok(WaitStatus::Exited(pid_t, _)) => assert_eq!(pid_t, child), + + // panic, must never happen + s @ Ok(_) => panic!("Child exited {:?}, should never happen", s), + + // panic, waitpid should never fail + Err(s) => panic!("Error: waitpid returned Err({:?}", s) + } + + }, + } +} + +#[test] +fn test_wait() { + // Grab FORK_MTX so wait doesn't reap a different test's child process + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is signal-safe + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => unsafe { _exit(0) }, + Parent { child } => { + let wait_status = wait(); + + // just assert that (any) one child returns with WaitStatus::Exited + assert_eq!(wait_status, Ok(WaitStatus::Exited(child, 0))); + }, + } +} + +#[test] +fn test_mkstemp() { + let mut path = env::temp_dir(); + path.push("nix_tempfile.XXXXXX"); + + let result = mkstemp(&path); + match result { + Ok((fd, path)) => { + close(fd).unwrap(); + unlink(path.as_path()).unwrap(); + }, + Err(e) => panic!("mkstemp failed: {}", e) + } +} + +#[test] +fn test_mkstemp_directory() { + // mkstemp should fail if a directory is given + assert!(mkstemp(&env::temp_dir()).is_err()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkfifo() { + let tempdir = tempdir().unwrap(); + let mkfifo_fifo = tempdir.path().join("mkfifo_fifo"); + + mkfifo(&mkfifo_fifo, Mode::S_IRUSR).unwrap(); + + let stats = stat::stat(&mkfifo_fifo).unwrap(); + let typ = stat::SFlag::from_bits_truncate(stats.st_mode as mode_t); + assert!(typ == SFlag::S_IFIFO); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkfifo_directory() { + // mkfifo should fail if a directory is given + assert!(mkfifo(&env::temp_dir(), Mode::S_IRUSR).is_err()); +} + +#[test] +#[cfg(not(any( + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] +fn test_mkfifoat_none() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + let mkfifoat_fifo = tempdir.path().join("mkfifoat_fifo"); + + mkfifoat(None, &mkfifoat_fifo, Mode::S_IRUSR).unwrap(); + + let stats = stat::stat(&mkfifoat_fifo).unwrap(); + let typ = stat::SFlag::from_bits_truncate(stats.st_mode); + assert_eq!(typ, SFlag::S_IFIFO); +} + +#[test] +#[cfg(not(any( + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] +fn test_mkfifoat() { + use nix::fcntl; + + let tempdir = tempdir().unwrap(); + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let mkfifoat_name = "mkfifoat_name"; + + mkfifoat(Some(dirfd), mkfifoat_name, Mode::S_IRUSR).unwrap(); + + let stats = stat::fstatat(dirfd, mkfifoat_name, fcntl::AtFlags::empty()).unwrap(); + let typ = stat::SFlag::from_bits_truncate(stats.st_mode); + assert_eq!(typ, SFlag::S_IFIFO); +} + +#[test] +#[cfg(not(any( + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] +fn test_mkfifoat_directory_none() { + let _m = crate::CWD_LOCK.read(); + + // mkfifoat should fail if a directory is given + assert!(mkfifoat(None, &env::temp_dir(), Mode::S_IRUSR).is_err()); +} + +#[test] +#[cfg(not(any( + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] +fn test_mkfifoat_directory() { + // mkfifoat should fail if a directory is given + let tempdir = tempdir().unwrap(); + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let mkfifoat_dir = "mkfifoat_dir"; + stat::mkdirat(dirfd, mkfifoat_dir, Mode::S_IRUSR).unwrap(); + + assert!(mkfifoat(Some(dirfd), mkfifoat_dir, Mode::S_IRUSR).is_err()); +} + +#[test] +fn test_getpid() { + let pid: ::libc::pid_t = getpid().into(); + let ppid: ::libc::pid_t = getppid().into(); + assert!(pid > 0); + assert!(ppid > 0); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_getsid() { + let none_sid: ::libc::pid_t = getsid(None).unwrap().into(); + let pid_sid: ::libc::pid_t = getsid(Some(getpid())).unwrap().into(); + assert!(none_sid > 0); + assert_eq!(none_sid, pid_sid); +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod linux_android { + use nix::unistd::gettid; + + #[test] + fn test_gettid() { + let tid: ::libc::pid_t = gettid().into(); + assert!(tid > 0); + } +} + +#[test] +// `getgroups()` and `setgroups()` do not behave as expected on Apple platforms +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "fuchsia")))] +fn test_setgroups() { + // Skip this test when not run as root as `setgroups()` requires root. + skip_if_not_root!("test_setgroups"); + + let _m = crate::GROUPS_MTX.lock(); + + // Save the existing groups + let old_groups = getgroups().unwrap(); + + // Set some new made up groups + let groups = [Gid::from_raw(123), Gid::from_raw(456)]; + setgroups(&groups).unwrap(); + + let new_groups = getgroups().unwrap(); + assert_eq!(new_groups, groups); + + // Revert back to the old groups + setgroups(&old_groups).unwrap(); +} + +#[test] +// `getgroups()` and `setgroups()` do not behave as expected on Apple platforms +#[cfg(not(any(target_os = "ios", + target_os = "macos", + target_os = "redox", + target_os = "fuchsia", + target_os = "illumos")))] +fn test_initgroups() { + // Skip this test when not run as root as `initgroups()` and `setgroups()` + // require root. + skip_if_not_root!("test_initgroups"); + + let _m = crate::GROUPS_MTX.lock(); + + // Save the existing groups + let old_groups = getgroups().unwrap(); + + // It doesn't matter if the root user is not called "root" or if a user + // called "root" doesn't exist. We are just checking that the extra, + // made-up group, `123`, is set. + // FIXME: Test the other half of initgroups' functionality: whether the + // groups that the user belongs to are also set. + let user = CString::new("root").unwrap(); + let group = Gid::from_raw(123); + let group_list = getgrouplist(&user, group).unwrap(); + assert!(group_list.contains(&group)); + + initgroups(&user, group).unwrap(); + + let new_groups = getgroups().unwrap(); + assert_eq!(new_groups, group_list); + + // Revert back to the old groups + setgroups(&old_groups).unwrap(); +} + +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] +macro_rules! execve_test_factory( + ($test_name:ident, $syscall:ident, $exe: expr $(, $pathname:expr, $flags:expr)*) => ( + + #[cfg(test)] + mod $test_name { + use std::ffi::CStr; + use super::*; + + const EMPTY: &'static [u8] = b"\0"; + const DASH_C: &'static [u8] = b"-c\0"; + const BIGARG: &'static [u8] = b"echo nix!!! && echo foo=$foo && echo baz=$baz\0"; + const FOO: &'static [u8] = b"foo=bar\0"; + const BAZ: &'static [u8] = b"baz=quux\0"; + + fn syscall_cstr_ref() -> Result { + $syscall( + $exe, + $(CString::new($pathname).unwrap().as_c_str(), )* + &[CStr::from_bytes_with_nul(EMPTY).unwrap(), + CStr::from_bytes_with_nul(DASH_C).unwrap(), + CStr::from_bytes_with_nul(BIGARG).unwrap()], + &[CStr::from_bytes_with_nul(FOO).unwrap(), + CStr::from_bytes_with_nul(BAZ).unwrap()] + $(, $flags)*) + } + + fn syscall_cstring() -> Result { + $syscall( + $exe, + $(CString::new($pathname).unwrap().as_c_str(), )* + &[CString::from(CStr::from_bytes_with_nul(EMPTY).unwrap()), + CString::from(CStr::from_bytes_with_nul(DASH_C).unwrap()), + CString::from(CStr::from_bytes_with_nul(BIGARG).unwrap())], + &[CString::from(CStr::from_bytes_with_nul(FOO).unwrap()), + CString::from(CStr::from_bytes_with_nul(BAZ).unwrap())] + $(, $flags)*) + } + + fn common_test(syscall: fn() -> Result) { + if "execveat" == stringify!($syscall) { + // Though undocumented, Docker's default seccomp profile seems to + // block this syscall. https://github.com/nix-rust/nix/issues/1122 + skip_if_seccomp!($test_name); + } + + let m = crate::FORK_MTX.lock(); + // The `exec`d process will write to `writer`, and we'll read that + // data from `reader`. + let (reader, writer) = pipe().unwrap(); + + // Safe: Child calls `exit`, `dup`, `close` and the provided `exec*` family function. + // NOTE: Technically, this makes the macro unsafe to use because you could pass anything. + // The tests make sure not to do that, though. + match unsafe{fork()}.unwrap() { + Child => { + // Make `writer` be the stdout of the new process. + dup2(writer, 1).unwrap(); + let r = syscall(); + let _ = std::io::stderr() + .write_all(format!("{:?}", r).as_bytes()); + // Should only get here in event of error + unsafe{ _exit(1) }; + }, + Parent { child } => { + // Wait for the child to exit. + let ws = waitpid(child, None); + drop(m); + assert_eq!(ws, Ok(WaitStatus::Exited(child, 0))); + // Read 1024 bytes. + let mut buf = [0u8; 1024]; + read(reader, &mut buf).unwrap(); + // It should contain the things we printed using `/bin/sh`. + let string = String::from_utf8_lossy(&buf); + assert!(string.contains("nix!!!")); + assert!(string.contains("foo=bar")); + assert!(string.contains("baz=quux")); + } + } + } + + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + #[cfg_attr(target_env = "musl", ignore)] + #[test] + fn test_cstr_ref() { + common_test(syscall_cstr_ref); + } + + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + #[cfg_attr(target_env = "musl", ignore)] + #[test] + fn test_cstring() { + common_test(syscall_cstring); + } + } + + ) +); + +cfg_if!{ + if #[cfg(target_os = "android")] { + execve_test_factory!(test_execve, execve, CString::new("/system/bin/sh").unwrap().as_c_str()); + execve_test_factory!(test_fexecve, fexecve, File::open("/system/bin/sh").unwrap().into_raw_fd()); + } else if #[cfg(any(target_os = "freebsd", + target_os = "linux"))] { + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + execve_test_factory!(test_execve, execve, CString::new("/bin/sh").unwrap().as_c_str()); + execve_test_factory!(test_fexecve, fexecve, File::open("/bin/sh").unwrap().into_raw_fd()); + } else if #[cfg(any(target_os = "dragonfly", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] { + execve_test_factory!(test_execve, execve, CString::new("/bin/sh").unwrap().as_c_str()); + // No fexecve() on DragonFly, ios, macos, NetBSD, OpenBSD. + // + // Note for NetBSD and OpenBSD: although rust-lang/libc includes it + // (under unix/bsd/netbsdlike/) fexecve is not currently implemented on + // NetBSD nor on OpenBSD. + } +} + +#[cfg(any(target_os = "haiku", target_os = "linux", target_os = "openbsd"))] +execve_test_factory!(test_execvpe, execvpe, &CString::new("sh").unwrap()); + +cfg_if!{ + if #[cfg(target_os = "android")] { + use nix::fcntl::AtFlags; + execve_test_factory!(test_execveat_empty, execveat, + File::open("/system/bin/sh").unwrap().into_raw_fd(), + "", AtFlags::AT_EMPTY_PATH); + execve_test_factory!(test_execveat_relative, execveat, + File::open("/system/bin/").unwrap().into_raw_fd(), + "./sh", AtFlags::empty()); + execve_test_factory!(test_execveat_absolute, execveat, + File::open("/").unwrap().into_raw_fd(), + "/system/bin/sh", AtFlags::empty()); + } else if #[cfg(all(target_os = "linux", any(target_arch ="x86_64", target_arch ="x86")))] { + use nix::fcntl::AtFlags; + execve_test_factory!(test_execveat_empty, execveat, File::open("/bin/sh").unwrap().into_raw_fd(), + "", AtFlags::AT_EMPTY_PATH); + execve_test_factory!(test_execveat_relative, execveat, File::open("/bin/").unwrap().into_raw_fd(), + "./sh", AtFlags::empty()); + execve_test_factory!(test_execveat_absolute, execveat, File::open("/").unwrap().into_raw_fd(), + "/bin/sh", AtFlags::empty()); + } +} + +#[test] +#[cfg(not(target_os = "fuchsia"))] +fn test_fchdir() { + // fchdir changes the process's cwd + let _dr = crate::DirRestore::new(); + + let tmpdir = tempdir().unwrap(); + let tmpdir_path = tmpdir.path().canonicalize().unwrap(); + let tmpdir_fd = File::open(&tmpdir_path).unwrap().into_raw_fd(); + + assert!(fchdir(tmpdir_fd).is_ok()); + assert_eq!(getcwd().unwrap(), tmpdir_path); + + assert!(close(tmpdir_fd).is_ok()); +} + +#[test] +fn test_getcwd() { + // chdir changes the process's cwd + let _dr = crate::DirRestore::new(); + + let tmpdir = tempdir().unwrap(); + let tmpdir_path = tmpdir.path().canonicalize().unwrap(); + assert!(chdir(&tmpdir_path).is_ok()); + assert_eq!(getcwd().unwrap(), tmpdir_path); + + // make path 500 chars longer so that buffer doubling in getcwd + // kicks in. Note: One path cannot be longer than 255 bytes + // (NAME_MAX) whole path cannot be longer than PATH_MAX (usually + // 4096 on linux, 1024 on macos) + let mut inner_tmp_dir = tmpdir_path; + for _ in 0..5 { + let newdir = "a".repeat(100); + inner_tmp_dir.push(newdir); + assert!(mkdir(inner_tmp_dir.as_path(), Mode::S_IRWXU).is_ok()); + } + assert!(chdir(inner_tmp_dir.as_path()).is_ok()); + assert_eq!(getcwd().unwrap(), inner_tmp_dir.as_path()); +} + +#[test] +fn test_chown() { + // Testing for anything other than our own UID/GID is hard. + let uid = Some(getuid()); + let gid = Some(getgid()); + + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + { + File::create(&path).unwrap(); + } + + chown(&path, uid, gid).unwrap(); + chown(&path, uid, None).unwrap(); + chown(&path, None, gid).unwrap(); + + fs::remove_file(&path).unwrap(); + chown(&path, uid, gid).unwrap_err(); +} + +#[test] +fn test_fchown() { + // Testing for anything other than our own UID/GID is hard. + let uid = Some(getuid()); + let gid = Some(getgid()); + + let path = tempfile().unwrap(); + let fd = path.as_raw_fd(); + + fchown(fd, uid, gid).unwrap(); + fchown(fd, uid, None).unwrap(); + fchown(fd, None, gid).unwrap(); + fchown(999999999, uid, gid).unwrap_err(); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_fchownat() { + let _dr = crate::DirRestore::new(); + // Testing for anything other than our own UID/GID is hard. + let uid = Some(getuid()); + let gid = Some(getgid()); + + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + { + File::create(&path).unwrap(); + } + + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + + fchownat(Some(dirfd), "file", uid, gid, FchownatFlags::FollowSymlink).unwrap(); + + chdir(tempdir.path()).unwrap(); + fchownat(None, "file", uid, gid, FchownatFlags::FollowSymlink).unwrap(); + + fs::remove_file(&path).unwrap(); + fchownat(None, "file", uid, gid, FchownatFlags::FollowSymlink).unwrap_err(); +} + +#[test] +fn test_lseek() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + let tmpfd = tmp.into_raw_fd(); + + let offset: off_t = 5; + lseek(tmpfd, offset, Whence::SeekSet).unwrap(); + + let mut buf = [0u8; 7]; + crate::read_exact(tmpfd, &mut buf); + assert_eq!(b"f123456", &buf); + + close(tmpfd).unwrap(); +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +#[test] +fn test_lseek64() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + let tmpfd = tmp.into_raw_fd(); + + lseek64(tmpfd, 5, Whence::SeekSet).unwrap(); + + let mut buf = [0u8; 7]; + crate::read_exact(tmpfd, &mut buf); + assert_eq!(b"f123456", &buf); + + close(tmpfd).unwrap(); +} + +cfg_if!{ + if #[cfg(any(target_os = "android", target_os = "linux"))] { + macro_rules! require_acct{ + () => { + require_capability!("test_acct", CAP_SYS_PACCT); + } + } + } else if #[cfg(target_os = "freebsd")] { + macro_rules! require_acct{ + () => { + skip_if_not_root!("test_acct"); + skip_if_jailed!("test_acct"); + } + } + } else if #[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] { + macro_rules! require_acct{ + () => { + skip_if_not_root!("test_acct"); + } + } + } +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_acct() { + use tempfile::NamedTempFile; + use std::process::Command; + use std::{thread, time}; + + let _m = crate::FORK_MTX.lock(); + require_acct!(); + + let file = NamedTempFile::new().unwrap(); + let path = file.path().to_str().unwrap(); + + acct::enable(path).unwrap(); + + loop { + Command::new("echo").arg("Hello world"); + let len = fs::metadata(path).unwrap().len(); + if len > 0 { break; } + thread::sleep(time::Duration::from_millis(10)); + } + acct::disable().unwrap(); +} + +#[test] +fn test_fpathconf_limited() { + let f = tempfile().unwrap(); + // AFAIK, PATH_MAX is limited on all platforms, so it makes a good test + let path_max = fpathconf(f.as_raw_fd(), PathconfVar::PATH_MAX); + assert!(path_max.expect("fpathconf failed").expect("PATH_MAX is unlimited") > 0); +} + +#[test] +fn test_pathconf_limited() { + // AFAIK, PATH_MAX is limited on all platforms, so it makes a good test + let path_max = pathconf("/", PathconfVar::PATH_MAX); + assert!(path_max.expect("pathconf failed").expect("PATH_MAX is unlimited") > 0); +} + +#[test] +fn test_sysconf_limited() { + // AFAIK, OPEN_MAX is limited on all platforms, so it makes a good test + let open_max = sysconf(SysconfVar::OPEN_MAX); + assert!(open_max.expect("sysconf failed").expect("OPEN_MAX is unlimited") > 0); +} + +#[cfg(target_os = "freebsd")] +#[test] +fn test_sysconf_unsupported() { + // I know of no sysconf variables that are unsupported everywhere, but + // _XOPEN_CRYPT is unsupported on FreeBSD 11.0, which is one of the platforms + // we test. + let open_max = sysconf(SysconfVar::_XOPEN_CRYPT); + assert!(open_max.expect("sysconf failed").is_none()) +} + + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +fn test_getresuid() { + let resuids = getresuid().unwrap(); + assert!(resuids.real.as_raw() != libc::uid_t::max_value()); + assert!(resuids.effective.as_raw() != libc::uid_t::max_value()); + assert!(resuids.saved.as_raw() != libc::uid_t::max_value()); +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +fn test_getresgid() { + let resgids = getresgid().unwrap(); + assert!(resgids.real.as_raw() != libc::gid_t::max_value()); + assert!(resgids.effective.as_raw() != libc::gid_t::max_value()); + assert!(resgids.saved.as_raw() != libc::gid_t::max_value()); +} + +// Test that we can create a pair of pipes. No need to verify that they pass +// data; that's the domain of the OS, not nix. +#[test] +fn test_pipe() { + let (fd0, fd1) = pipe().unwrap(); + let m0 = stat::SFlag::from_bits_truncate(stat::fstat(fd0).unwrap().st_mode as mode_t); + // S_IFIFO means it's a pipe + assert_eq!(m0, SFlag::S_IFIFO); + let m1 = stat::SFlag::from_bits_truncate(stat::fstat(fd1).unwrap().st_mode as mode_t); + assert_eq!(m1, SFlag::S_IFIFO); +} + +// pipe2(2) is the same as pipe(2), except it allows setting some flags. Check +// that we can set a flag. +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox", + target_os = "solaris"))] +#[test] +fn test_pipe2() { + use nix::fcntl::{fcntl, FcntlArg, FdFlag}; + + let (fd0, fd1) = pipe2(OFlag::O_CLOEXEC).unwrap(); + let f0 = FdFlag::from_bits_truncate(fcntl(fd0, FcntlArg::F_GETFD).unwrap()); + assert!(f0.contains(FdFlag::FD_CLOEXEC)); + let f1 = FdFlag::from_bits_truncate(fcntl(fd1, FcntlArg::F_GETFD).unwrap()); + assert!(f1.contains(FdFlag::FD_CLOEXEC)); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_truncate() { + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + + { + let mut tmp = File::create(&path).unwrap(); + const CONTENTS: &[u8] = b"12345678"; + tmp.write_all(CONTENTS).unwrap(); + } + + truncate(&path, 4).unwrap(); + + let metadata = fs::metadata(&path).unwrap(); + assert_eq!(4, metadata.len()); +} + +#[test] +fn test_ftruncate() { + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + + let tmpfd = { + let mut tmp = File::create(&path).unwrap(); + const CONTENTS: &[u8] = b"12345678"; + tmp.write_all(CONTENTS).unwrap(); + tmp.into_raw_fd() + }; + + ftruncate(tmpfd, 2).unwrap(); + close(tmpfd).unwrap(); + + let metadata = fs::metadata(&path).unwrap(); + assert_eq!(2, metadata.len()); +} + +// Used in `test_alarm`. +#[cfg(not(target_os = "redox"))] +static mut ALARM_CALLED: bool = false; + +// Used in `test_alarm`. +#[cfg(not(target_os = "redox"))] +pub extern fn alarm_signal_handler(raw_signal: libc::c_int) { + assert_eq!(raw_signal, libc::SIGALRM, "unexpected signal: {}", raw_signal); + unsafe { ALARM_CALLED = true }; +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_alarm() { + use std::{ + time::{Duration, Instant,}, + thread + }; + + // Maybe other tests that fork interfere with this one? + let _m = crate::SIGNAL_MTX.lock(); + + let handler = SigHandler::Handler(alarm_signal_handler); + let signal_action = SigAction::new(handler, SaFlags::SA_RESTART, SigSet::empty()); + let old_handler = unsafe { + sigaction(Signal::SIGALRM, &signal_action) + .expect("unable to set signal handler for alarm") + }; + + // Set an alarm. + assert_eq!(alarm::set(60), None); + + // Overwriting an alarm should return the old alarm. + assert_eq!(alarm::set(1), Some(60)); + + // We should be woken up after 1 second by the alarm, so we'll sleep for 3 + // seconds to be sure. + let starttime = Instant::now(); + loop { + thread::sleep(Duration::from_millis(100)); + if unsafe { ALARM_CALLED} { + break; + } + if starttime.elapsed() > Duration::from_secs(3) { + panic!("Timeout waiting for SIGALRM"); + } + } + + // Reset the signal. + unsafe { + sigaction(Signal::SIGALRM, &old_handler) + .expect("unable to set signal handler for alarm"); + } +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_canceling_alarm() { + let _m = crate::SIGNAL_MTX.lock(); + + assert_eq!(alarm::cancel(), None); + + assert_eq!(alarm::set(60), None); + assert_eq!(alarm::cancel(), Some(60)); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_symlinkat() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + + let target = tempdir.path().join("a"); + let linkpath = tempdir.path().join("b"); + symlinkat(&target, None, &linkpath).unwrap(); + assert_eq!( + readlink(&linkpath).unwrap().to_str().unwrap(), + target.to_str().unwrap() + ); + + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let target = "c"; + let linkpath = "d"; + symlinkat(target, Some(dirfd), linkpath).unwrap(); + assert_eq!( + readlink(&tempdir.path().join(linkpath)) + .unwrap() + .to_str() + .unwrap(), + target + ); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_linkat_file() { + let tempdir = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir.path().join(oldfilename); + + let newfilename = "bar.txt"; + let newfilepath = tempdir.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt hard link file at relative path + linkat(Some(dirfd), oldfilename, Some(dirfd), newfilename, LinkatFlags::SymlinkFollow).unwrap(); + assert!(newfilepath.exists()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_linkat_olddirfd_none() { + let _dr = crate::DirRestore::new(); + + let tempdir_oldfile = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir_oldfile.path().join(oldfilename); + + let tempdir_newfile = tempdir().unwrap(); + let newfilename = "bar.txt"; + let newfilepath = tempdir_newfile.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Get file descriptor for base directory of new file + let dirfd = fcntl::open(tempdir_newfile.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt hard link file using curent working directory as relative path for old file path + chdir(tempdir_oldfile.path()).unwrap(); + linkat(None, oldfilename, Some(dirfd), newfilename, LinkatFlags::SymlinkFollow).unwrap(); + assert!(newfilepath.exists()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_linkat_newdirfd_none() { + let _dr = crate::DirRestore::new(); + + let tempdir_oldfile = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir_oldfile.path().join(oldfilename); + + let tempdir_newfile = tempdir().unwrap(); + let newfilename = "bar.txt"; + let newfilepath = tempdir_newfile.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Get file descriptor for base directory of old file + let dirfd = fcntl::open(tempdir_oldfile.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt hard link file using current working directory as relative path for new file path + chdir(tempdir_newfile.path()).unwrap(); + linkat(Some(dirfd), oldfilename, None, newfilename, LinkatFlags::SymlinkFollow).unwrap(); + assert!(newfilepath.exists()); +} + +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] +fn test_linkat_no_follow_symlink() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir.path().join(oldfilename); + + let symoldfilename = "symfoo.txt"; + let symoldfilepath = tempdir.path().join(symoldfilename); + + let newfilename = "nofollowsymbar.txt"; + let newfilepath = tempdir.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Create symlink to file + symlinkat(&oldfilepath, None, &symoldfilepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt link symlink of file at relative path + linkat(Some(dirfd), symoldfilename, Some(dirfd), newfilename, LinkatFlags::NoSymlinkFollow).unwrap(); + + // Assert newfile is actually a symlink to oldfile. + assert_eq!( + readlink(&newfilepath) + .unwrap() + .to_str() + .unwrap(), + oldfilepath.to_str().unwrap() + ); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_linkat_follow_symlink() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir.path().join(oldfilename); + + let symoldfilename = "symfoo.txt"; + let symoldfilepath = tempdir.path().join(symoldfilename); + + let newfilename = "nofollowsymbar.txt"; + let newfilepath = tempdir.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Create symlink to file + symlinkat(&oldfilepath, None, &symoldfilepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt link target of symlink of file at relative path + linkat(Some(dirfd), symoldfilename, Some(dirfd), newfilename, LinkatFlags::SymlinkFollow).unwrap(); + + let newfilestat = stat::stat(&newfilepath).unwrap(); + + // Check the file type of the new link + assert_eq!((stat::SFlag::from_bits_truncate(newfilestat.st_mode as mode_t) & SFlag::S_IFMT), + SFlag::S_IFREG + ); + + // Check the number of hard links to the original file + assert_eq!(newfilestat.st_nlink, 2); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_unlinkat_dir_noremovedir() { + let tempdir = tempdir().unwrap(); + let dirname = "foo_dir"; + let dirpath = tempdir.path().join(dirname); + + // Create dir + DirBuilder::new().recursive(true).create(&dirpath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt unlink dir at relative path without proper flag + let err_result = unlinkat(Some(dirfd), dirname, UnlinkatFlags::NoRemoveDir).unwrap_err(); + assert!(err_result == Errno::EISDIR || err_result == Errno::EPERM); + } + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_unlinkat_dir_removedir() { + let tempdir = tempdir().unwrap(); + let dirname = "foo_dir"; + let dirpath = tempdir.path().join(dirname); + + // Create dir + DirBuilder::new().recursive(true).create(&dirpath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt unlink dir at relative path with proper flag + unlinkat(Some(dirfd), dirname, UnlinkatFlags::RemoveDir).unwrap(); + assert!(!dirpath.exists()); + } + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_unlinkat_file() { + let tempdir = tempdir().unwrap(); + let filename = "foo.txt"; + let filepath = tempdir.path().join(filename); + + // Create file + File::create(&filepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt unlink file at relative path + unlinkat(Some(dirfd), filename, UnlinkatFlags::NoRemoveDir).unwrap(); + assert!(!filepath.exists()); + } + +#[test] +fn test_access_not_existing() { + let tempdir = tempdir().unwrap(); + let dir = tempdir.path().join("does_not_exist.txt"); + assert_eq!(access(&dir, AccessFlags::F_OK).err().unwrap(), + Errno::ENOENT); +} + +#[test] +fn test_access_file_exists() { + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("does_exist.txt"); + let _file = File::create(path.clone()).unwrap(); + assert!(access(&path, AccessFlags::R_OK | AccessFlags::W_OK).is_ok()); +} + +#[cfg(not(target_os = "redox"))] +#[test] +fn test_user_into_passwd() { + // get the UID of the "nobody" user + let nobody = User::from_name("nobody").unwrap().unwrap(); + let pwd: libc::passwd = nobody.into(); + let _: User = (&pwd).into(); +} + +/// Tests setting the filesystem UID with `setfsuid`. +#[cfg(any(target_os = "linux", target_os = "android"))] +#[test] +fn test_setfsuid() { + use std::os::unix::fs::PermissionsExt; + use std::{fs, io, thread}; + require_capability!("test_setfsuid", CAP_SETUID); + + // get the UID of the "nobody" user + let nobody = User::from_name("nobody").unwrap().unwrap(); + + // create a temporary file with permissions '-rw-r-----' + let file = tempfile::NamedTempFile::new_in("/var/tmp").unwrap(); + let temp_path = file.into_temp_path(); + dbg!(&temp_path); + let temp_path_2 = (&temp_path).to_path_buf(); + let mut permissions = fs::metadata(&temp_path).unwrap().permissions(); + permissions.set_mode(0o640); + + // spawn a new thread where to test setfsuid + thread::spawn(move || { + // set filesystem UID + let fuid = setfsuid(nobody.uid); + // trying to open the temporary file should fail with EACCES + let res = fs::File::open(&temp_path); + assert!(res.is_err()); + assert_eq!(res.err().unwrap().kind(), io::ErrorKind::PermissionDenied); + + // assert fuid actually changes + let prev_fuid = setfsuid(Uid::from_raw(-1i32 as u32)); + assert_ne!(prev_fuid, fuid); + }) + .join() + .unwrap(); + + // open the temporary file with the current thread filesystem UID + fs::File::open(temp_path_2).unwrap(); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_ttyname() { + let fd = posix_openpt(OFlag::O_RDWR).expect("posix_openpt failed"); + assert!(fd.as_raw_fd() > 0); + + // on linux, we can just call ttyname on the pty master directly, but + // apparently osx requires that ttyname is called on a slave pty (can't + // find this documented anywhere, but it seems to empirically be the case) + grantpt(&fd).expect("grantpt failed"); + unlockpt(&fd).expect("unlockpt failed"); + let sname = unsafe { ptsname(&fd) }.expect("ptsname failed"); + let fds = open( + Path::new(&sname), + OFlag::O_RDWR, + stat::Mode::empty(), + ).expect("open failed"); + assert!(fds > 0); + + let name = ttyname(fds).expect("ttyname failed"); + assert!(name.starts_with("/dev")); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_ttyname_not_pty() { + let fd = File::open("/dev/zero").unwrap(); + assert!(fd.as_raw_fd() > 0); + assert_eq!(ttyname(fd.as_raw_fd()), Err(Errno::ENOTTY)); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_ttyname_invalid_fd() { + assert_eq!(ttyname(-1), Err(Errno::EBADF)); +} + +#[test] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +fn test_getpeereid() { + use std::os::unix::net::UnixStream; + let (sock_a, sock_b) = UnixStream::pair().unwrap(); + + let (uid_a, gid_a) = getpeereid(sock_a.as_raw_fd()).unwrap(); + let (uid_b, gid_b) = getpeereid(sock_b.as_raw_fd()).unwrap(); + + let uid = geteuid(); + let gid = getegid(); + + assert_eq!(uid, uid_a); + assert_eq!(gid, gid_a); + assert_eq!(uid_a, uid_b); + assert_eq!(gid_a, gid_b); +} + +#[test] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +fn test_getpeereid_invalid_fd() { + // getpeereid is not POSIX, so error codes are inconsistent between different Unices. + assert!(getpeereid(-1).is_err()); +} diff --git a/bash-5.1/vendor/nix-0.24.2/.cargo-checksum.json b/bash-5.1/vendor/nix-0.24.2/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..b08873855ab63a4f3b360d7660f6af23f18f2871 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"2226acdaf94690ac857e89726385d7404d9c209a7ca645bc331607fe862de969","Cargo.toml":"b1aabe6d5ff69f5058dc1e38ef94d447b60b5646b5bb3a90b54847114bfe2a79","LICENSE":"66e3ee1fa7f909ad3c612d556f2a0cdabcd809ad6e66f3b0605015ac64841b70","README.md":"00ed4b7d1b538eaea937bcc82e51b21b4b185fac5e2d2124f3163f0c75b09795","src/dir.rs":"37f34eb1db53bc4953c4a0629f2b06a2130228898ae9afe42fe392af08d73842","src/env.rs":"3657fb51d8569ed525787e22cd2adb0ea5eb250d27641cfb8926be6908be4f38","src/errno.rs":"c973e7c0e769208ecdf20da5a7e026375c8eba785e825ff9d5ffe74290fa6a36","src/fcntl.rs":"a80857b4458c16d6ae15eaa71e5cd335ee2557ff598591f6296d898950fce963","src/features.rs":"18ac07e56c3187a650a0ea3b3eee9dacca51686fc3ca3fa0ddde449deb102f56","src/ifaddrs.rs":"e59a7540976c7c60b89929febdf5f6384b42c6d801bd1f339236e0e9c5636b67","src/kmod.rs":"9031edb7b0a8ed1d6635163c9c32490537d5c204e9794cce9dc2db24ead60957","src/lib.rs":"6330ce3b43d21d2ce658f2fab8b7c7e0c43080cf17002718b070d250ca9d70da","src/macros.rs":"e23d7d8be22ef0bf9febaaf2739585453103607c0139bd3995a324e4a16d011e","src/mount/bsd.rs":"c14a0e477f08c2949945139fcae9f0ede1f15d17fdd4277f7344b6bd5fafdc48","src/mount/linux.rs":"d938612abe89d2cf0d375b335a570ba4831f2009d3ef6c7e786ccbc398bf2c15","src/mount/mod.rs":"5c9d906d4760ac1a3767949e2cab69d7fa683c454c06045919c58a90689d439f","src/mqueue.rs":"513120f89399fb832f78e8e6f151e23a0b5fcaea40745b465b3fe7080346dc87","src/net/if_.rs":"7e05ba4e41f9921dc5c78ba10c130bc79f31d26863f4db2df3754b6a317839c8","src/net/mod.rs":"577f70170e53d4a6de1abb70bf8f1031ec3e65c0e63ef5fcf05c907125e7ac17","src/poll.rs":"aab8f9e48db4fa43113e5e4eecb095dc1bfa76431d9792e5f79e305af28066ea","src/pty.rs":"e94219e1981cb023d4f3c22edbe26c87f7508fa25b96b9f74b3b36436aebe2fb","src/sched.rs":"83029c0f8f473f2e1323ecaae8e3f15dc0f5326afd7e768d024d91a80aa73e1c","src/sys/aio.rs":"505cd3edec0f8bc77a69c65e26c4f05b12ff565e58d0c029c466369e535eca27","src/sys/epoll.rs":"6d9bcd668010ba26abb9c5ede9f3e238a56ce4949a5c51ee80853fc8e3c37607","src/sys/event.rs":"19061ad0780d01bfd0a17c12d5527b8568aa3d0fa2b1e30692aa594c1dba4fca","src/sys/eventfd.rs":"bc8009f19e8b93b03d0202896e10bd08497f34e2987bb8ce864d6cde11eab892","src/sys/inotify.rs":"215c4217f698b47f73f4418f98f331f06ca93d35e01c6f522e5fa6a156554174","src/sys/ioctl/bsd.rs":"76acf6de6c9e2cd9367835f1b97815120e4baede4c2200661f396be4e4eb800e","src/sys/ioctl/linux.rs":"e91474bee3984a5b80ea41d5edafb4fdb9bf7c8e53969b6450cc56aa4dc7ad65","src/sys/ioctl/mod.rs":"6341f40c37227c77ca4bbb1864e60f99c43898eeaaf05ebb5132be1129550f4b","src/sys/memfd.rs":"72a153df4da17ea0cc4ce90ee3c47c5bec24c6e32fbb4ee7c77c1a89d79efbdd","src/sys/mman.rs":"93f3f4dc0212b0abb172a822e5cc179b15080bf4f5df6b91d950003650db889a","src/sys/mod.rs":"efcaefe12a84e86acd543168006963d062f52d929d1f40c1c79853297830c9d9","src/sys/personality.rs":"bf1daba7141811b39aa293e060a932bb1c2b3a5ac5552658e6509b8fa7b05016","src/sys/pthread.rs":"0407064036af5b1e6247eedd38157201104c51d73575ba2eaba5e89259521462","src/sys/ptrace/bsd.rs":"ca948c863fa55de1f9fc8eabd9fd7803054df08a6ee5044b2a6a7de49a321819","src/sys/ptrace/linux.rs":"7dadde65fa8aac137d9b189d4c571dd64eb44042d0117a0c28ff55dc73de5d66","src/sys/ptrace/mod.rs":"671a6ccac955e75d5998f7e53ffc45ed4c7b6522a0f24a0937d60141f692dd39","src/sys/quota.rs":"1b60c34302e6fad9422fe0bec9fe7e6b93fbe554b8cfe98ecf5834daf93c84de","src/sys/reboot.rs":"dbb1faeeb6525f1952a20cb75adbd76b0681b6214501f747cc154be2bbff7594","src/sys/resource.rs":"a26d30490bcc56eb8b86faf23a3a4ada3c0cd3ce28e2b3040d5f36c668f14f20","src/sys/select.rs":"d30e8dfcfa46f6bd8d8b86676ad09d7aa6f1d7747d2c9601b9bb4f5ccf44b59f","src/sys/sendfile.rs":"637b09a267813c6adf72b6b74235175ed5347e3816777881ba8a9ab192c3e497","src/sys/signal.rs":"625e14dd43d5d7e1d3540543d6438e7a27edbd425838749592418caa18d01d08","src/sys/signalfd.rs":"2677af132b9f01ec277615a5d039f49fbdd06dc4442639df668561b74b9785c4","src/sys/socket/addr.rs":"c03a8aafa64ec0fbaad483b94b25ebedea0e162fc1c07eab8a8d934077d5e48d","src/sys/socket/mod.rs":"a9726bf312413805f2560be993c4902e5a1d5fe739aaa0621d8fa13b5af06bbf","src/sys/socket/sockopt.rs":"5493998c2ef8b329025a3a431780fbb784fe411fad8f5646ef1f9805efab6ea2","src/sys/stat.rs":"aaaf7802733ac6c13c8c1ad22b864d6ba5369c123c06700d5d7d37afe87e8a66","src/sys/statfs.rs":"5827183678ddffad548f131c4e906ef73d8453534b0ac5f838cbc79ee2a12a9c","src/sys/statvfs.rs":"b8e0ea6b22e5bcf906e7367393190a2c60251211c2b4c5fa616e314d50e90d4f","src/sys/sysinfo.rs":"7ff86d7848c2e8ded13b47dc53bf24cb0f4d7f3ded634d6d2f34558a2511ed99","src/sys/termios.rs":"9281d162b68802c8c3a7bdab0a71dc794c81de1493a259f602244d7dfba2d491","src/sys/time.rs":"13b4f399b2cf5298d9f6a3a1176d4e0b12d2ee4346944911858eee1b098970c6","src/sys/timer.rs":"1263c84eca7487a0174d507f6c108fdb8ccddbeeafad66ae80e3ba509e7e6ab0","src/sys/timerfd.rs":"c9193f5e1b8d963c7d0d529602859242ec00210238ed30e359001b206c809071","src/sys/uio.rs":"0e440715a3332d11efa8add4a3d4b2c1589562a5b0904d5e515156ed3904e5d1","src/sys/utsname.rs":"7f1c75dd550c9637a023a4629df571bcd292d53feee7b18f9f80dce425e65bea","src/sys/wait.rs":"5b21039400633d85aa49e153cc927cbf32d05df33c1d6a365921af2432b9495d","src/time.rs":"63ae33f73c79a70c811f87af2edd34e21ce93a3f89b3f176e35065fa1ece3ad7","src/ucontext.rs":"863d783443be1307477daf1970a42594d17d637aba94c8e5b63d5d9a49ea624b","src/unistd.rs":"d50a37cf4cbc4c8a9a3e15f6602f4e240093a6af96f1f9358f5c918c70f413b4","test/common/mod.rs":"2fb748319611c8ed528b5ea81d7dcfba3a47aabe915917ebbeb5451deaa86e2b","test/sys/mod.rs":"d569cc63defcdcd6d0e23c9799a3f69870a02bd910b50f5aa147f8b5a50e3a25","test/sys/test_aio.rs":"414af194f06b35b83a692e3569801f2c6b7999ba7b55b59f006091902e00146e","test/sys/test_aio_drop.rs":"dbb6808f7813be0de12cef11c4156637eab1d990df6f1192cbc4b26b072b633a","test/sys/test_epoll.rs":"c982bd8fa90c615a6f11de2c816b4553e11171dbbdd8db0944166fb044221a16","test/sys/test_inotify.rs":"dc3e4fe548b0b3b71f94c9bfc157c21b017f5ce8df9dee599849f3bfe7c222bb","test/sys/test_ioctl.rs":"b809085aca01c351380b3ab650153d3800f7271391e090b6f2d6dc9186ee50f4","test/sys/test_lio_listio_resubmit.rs":"436135fce2d2e55cfc9a3a18d43ca15018feb1a51b870eed56dff2f734b9c059","test/sys/test_mman.rs":"09ec20c05f63a909f5ce3b8b3223cbc7240ca9f93a4a3ed50d20a416ab6e7296","test/sys/test_pthread.rs":"4be4a467ead0633429157c1b2191eb28962c5670aeb2ad6fe872acb95c336129","test/sys/test_ptrace.rs":"4a9df38ff14e39967763805e86d7cac86a7411f485815a6aa50b8f0321a84a48","test/sys/test_select.rs":"913ee0569c539fbf8f8d87678cec7ceb9d5529c184e72af845c8076b099b7d29","test/sys/test_signal.rs":"619aeb586309ffd2547b22c37475bb8cf6e88717c4cc114df72f6786b14de1f3","test/sys/test_signalfd.rs":"cccba36d0aba74178d78571dbd728448c8c23aba9063ad5ee24c7d89d01429c6","test/sys/test_socket.rs":"935893375ef49ba697d609ee8cc4b7df6eb604f62a0b68c468b494fb22e0f646","test/sys/test_sockopt.rs":"c635f46e9c4f479e78e97ce712263bc9dd6a708ca4a3630b0f1fb9cdc0358570","test/sys/test_sysinfo.rs":"1e1bea9130fe38ccb07cd0ad7334c7be1e45efc33f7656a5973f8cad7126f225","test/sys/test_termios.rs":"9a9fb30655f418b59851edc9a9763f0fa1a97faaa5310989d9fa9a5c21add111","test/sys/test_timerfd.rs":"fcada956abd981e4d846da58e5640c5705b16026d47bccd1d603fae765ad10db","test/sys/test_uio.rs":"1e92ae46a1d7d9d0025fbe631123909e97c29264898d59294f0a9cda09d8a298","test/sys/test_wait.rs":"011397c19b2960ec0aa4866405d68a0307b871f52a3d6d627341b836fb4a025c","test/test.rs":"68966e13a75411107ba525891f854613650dc8621dba73fd7158b84c55bb6f55","test/test_clearenv.rs":"45ca548035b3c20ec87314715feaba2be973709a635d85b8cde46fd1d9f1ecd4","test/test_dir.rs":"837d1666d6c48da3ae9f172fa32a497e0d61af94f1e5335c2afd16eafd6b1989","test/test_fcntl.rs":"a61a12011062402900cc709f31c414ba19763107d711f69a17d1e1e71ee3be82","test/test_kmod/hello_mod/Makefile":"0219f7bce0603f97d997fb377ca071966c90333ecc665e78a54dfeb97a9c811b","test/test_kmod/hello_mod/hello.c":"bcac6b19c5bd807e1f3878c15e426acc85785a8ade9840c3bb4d068635c9188c","test/test_kmod/mod.rs":"58ac2bfb788480833d0bab990177324a405bd56d980edc222807acfb12ef23cf","test/test_mount.rs":"6b01b884b97db926ec1d4792f171344c590224554f2930c75609aaf2c0773abf","test/test_mq.rs":"b1609d4d25d6a4aaf0425d7a08700736ec3aa56b971b833fd41c4235b47922a9","test/test_net.rs":"d027680cdb1e2eed9e6912267b42a30cc0d81399826e03abfd7de81296a88282","test/test_nix_path.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","test/test_nmount.rs":"26ecb0c687d9403e2d34d8e67733ddeeba7b4820f886ffa14e75f05ec4de38ea","test/test_poll.rs":"7c7ca94669c7879ee73d793a0261b27904b80c0bb380a5b5acdd4960c9c1aba5","test/test_pty.rs":"4a6dd1afe0056678f1f2c1f27f309827da5806889c4b87dafa8889664889762d","test/test_ptymaster_drop.rs":"48ae888ff4573c68e4da7d1fa737374deb307afb64deff2d788d1e0c81a11112","test/test_resource.rs":"fcbb16942458fa2c11fa4a75831f038b532d87809920dbe30c1af67d4800d94a","test/test_sched.rs":"f8ad92eb554164b0f92428f716db99040186d741cc6e1976f7930f099652f70c","test/test_sendfile.rs":"20739ab4430a23be04a980578c831a0813a94c15e595965aa74bc9882fa79bf8","test/test_stat.rs":"8632715b3f38e5b150108d219959ee8de4d69c2b1ab5321c7ca218bb7a583d0d","test/test_time.rs":"bf668b680db81e443fb402a2580425553329636cd39fad70b828041ea894b43a","test/test_timer.rs":"1c2bab1787c343a2db2963c77f484a038a63e68ed9e98629c8af05a343908372","test/test_unistd.rs":"52966b7c7cff426a9dfb2143699fc4f7e293f8cebfd14b18502df6184f5af58e"},"package":"195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc"} \ No newline at end of file diff --git a/bash-5.1/vendor/nix-0.24.2/CHANGELOG.md b/bash-5.1/vendor/nix-0.24.2/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..aaa4c5625a190a7d6f7d692df19c38120074a930 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/CHANGELOG.md @@ -0,0 +1,1364 @@ +# Change Log + +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](https://semver.org/). + +## [0.24.2] - 2022-07-17 +### Added +### Changed +### Fixed + +- Fixed buffer overflow in nix::sys::socket::recvfrom. + (#[1763](https://github.com/nix-rust/nix/pull/1763)) +- Enabled `SockaddrStorage::{as_link_addr, as_link_addr_mut}` for Linux-like + operating systems. + (#[1729](https://github.com/nix-rust/nix/pull/1729)) +- Fixed `SockaddrLike::from_raw` implementations for `VsockAddr` and + `SysControlAddr`. + (#[1736](https://github.com/nix-rust/nix/pull/1736)) + +### Removed + +## [0.24.1] - 2022-04-22 +### Added +### Changed +### Fixed + +- Fixed `UnixAddr::size` on Linux-based OSes. + (#[1702](https://github.com/nix-rust/nix/pull/1702)) + +### Removed + +## [0.24.0] - 2022-04-21 +### Added + +- Added fine-grained features flags. Most Nix functionality can now be + conditionally enabled. By default, all features are enabled. + (#[1611](https://github.com/nix-rust/nix/pull/1611)) +- Added statfs FS type magic constants for `target_os = "android"` + and synced constants with libc v0.2.121. + (#[1690](https://github.com/nix-rust/nix/pull/1690)) +- Added `fexecve` on DragonFly. + (#[1577](https://github.com/nix-rust/nix/pull/1577)) +- `sys::uio::IoVec` is now `Send` and `Sync` + (#[1582](https://github.com/nix-rust/nix/pull/1582)) +- Added `EPOLLEXCLUSIVE` on Android. + (#[1567](https://github.com/nix-rust/nix/pull/1567)) +- Added `fdatasync` for FreeBSD, Fuchsia, NetBSD, and OpenBSD. + (#[1581](https://github.com/nix-rust/nix/pull/1581)) +- Added `sched_setaffinity` and `sched_getaffinity` on DragonFly. + (#[1537](https://github.com/nix-rust/nix/pull/1537)) +- Added `posix_fallocate` on DragonFly. + (#[1621](https://github.com/nix-rust/nix/pull/1621)) +- Added `SO_TIMESTAMPING` support + (#[1547](https://github.com/nix-rust/nix/pull/1547)) +- Added getter methods to `MqAttr` struct + (#[1619](https://github.com/nix-rust/nix/pull/1619)) +- Added the `TxTime` sockopt and control message. + (#[1564](https://github.com/nix-rust/nix/pull/1564)) +- Added POSIX per-process timer support + (#[1622](https://github.com/nix-rust/nix/pull/1622)) +- Added `sendfile` on DragonFly. + (#[1615](https://github.com/nix-rust/nix/pull/1615)) +- Added `UMOUNT_NOFOLLOW`, `FUSE_SUPER_MAGIC` on Linux. + (#[1634](https://github.com/nix-rust/nix/pull/1634)) +- Added `getresuid`, `setresuid`, `getresgid`, and `setresgid` on DragonFly, FreeBSD, and OpenBSD. + (#[1628](https://github.com/nix-rust/nix/pull/1628)) +- Added `MAP_FIXED_NOREPLACE` on Linux. + (#[1636](https://github.com/nix-rust/nix/pull/1636)) +- Added `fspacectl` on FreeBSD + (#[1640](https://github.com/nix-rust/nix/pull/1640)) +- Added `accept4` on DragonFly, Emscripten, Fuchsia, Illumos, and NetBSD. + (#[1654](https://github.com/nix-rust/nix/pull/1654)) +- Added `AsRawFd` implementation on `OwningIter`. + (#[1563](https://github.com/nix-rust/nix/pull/1563)) +- Added `process_vm_readv` and `process_vm_writev` on Android. + (#[1557](https://github.com/nix-rust/nix/pull/1557)) +- Added `nix::uncontext` module on s390x. + (#[1662](https://github.com/nix-rust/nix/pull/1662)) +- Implemented `Extend`, `FromIterator`, and `IntoIterator` for `SigSet` and + added `SigSet::iter` and `SigSetIter`. + (#[1553](https://github.com/nix-rust/nix/pull/1553)) +- Added `ENOTRECOVERABLE` and `EOWNERDEAD` error codes on DragonFly. + (#[1665](https://github.com/nix-rust/nix/pull/1665)) +- Implemented `Read` and `Write` for `&PtyMaster` + (#[1664](https://github.com/nix-rust/nix/pull/1664)) +- Added `MSG_NOSIGNAL` for Android, Dragonfly, FreeBSD, Fuchsia, Haiku, Illumos, Linux, NetBSD, OpenBSD and Solaris. + (#[1670](https://github.com/nix-rust/nix/pull/1670)) +- Added `waitid`. + (#[1584](https://github.com/nix-rust/nix/pull/1584)) +- Added `Ipv6DontFrag` for android, iOS, linux and macOS. +- Added `IpDontFrag` for iOS, macOS. + (#[1692](https://github.com/nix-rust/nix/pull/1692)) + +### Changed + +- `mqueue` functions now operate on a distinct type, `nix::mqueue::MqdT`. + Accessors take this type by reference, not by value. + (#[1639](https://github.com/nix-rust/nix/pull/1639)) +- Removed `SigSet::extend` in favor of `>::extend`. + Because of this change, you now need `use std::iter::Extend` to call `extend` + on a `SigSet`. + (#[1553](https://github.com/nix-rust/nix/pull/1553)) +- Removed the the `PATH_MAX` restriction from APIs accepting paths. Paths + will now be allocated on the heap if they are too long. In addition, large + instruction count improvements (~30x) were made to path handling. + (#[1656](https://github.com/nix-rust/nix/pull/1656)) +- Changed `getrlimit` and `setrlimit` to use `rlim_t` directly + instead of `Option`. + (#[1668](https://github.com/nix-rust/nix/pull/1668)) +- Deprecated `InetAddr` and `SockAddr` in favor of `SockaddrIn`, `SockaddrIn6`, + and `SockaddrStorage`. + (#[1684](https://github.com/nix-rust/nix/pull/1684)) +- Deprecated `IpAddr`, `Ipv4Addr`, and `Ipv6Addr` in favor of their equivalents + from the standard library. + (#[1685](https://github.com/nix-rust/nix/pull/1685)) +- `uname` now returns a `Result` instead of just a `UtsName` and + ignoring failures from libc. And getters on the `UtsName` struct now return + an `&OsStr` instead of `&str`. + (#[1672](https://github.com/nix-rust/nix/pull/1672)) +- Replaced `IoVec` with `IoSlice` and `IoSliceMut`, and replaced `IoVec::from_slice` with + `IoSlice::new`. (#[1643](https://github.com/nix-rust/nix/pull/1643)) + +### Fixed + +- `InetAddr::from_std` now sets the `sin_len`/`sin6_len` fields on the BSDs. + (#[1642](https://github.com/nix-rust/nix/pull/1642)) +- Fixed a panic in `LinkAddr::addr`. That function now returns an `Option`. + (#[1675](https://github.com/nix-rust/nix/pull/1675)) + (#[1677](https://github.com/nix-rust/nix/pull/1677)) + +### Removed + +- Removed public access to the inner fields of `NetlinkAddr`, `AlgAddr`, + `SysControlAddr`, `LinkAddr`, and `VsockAddr`. + (#[1614](https://github.com/nix-rust/nix/pull/1614)) +- Removed `EventFlag::EV_SYSFLAG`. + (#[1635](https://github.com/nix-rust/nix/pull/1635)) + +## [0.23.1] - 2021-12-16 + +### Added +### Changed + +- Relaxed the bitflags requirement from 1.3.1 to 1.1. This partially reverts + #1492. From now on, the MSRV is not guaranteed to work with all versions of + all dependencies, just with some version of all dependencies. + (#[1607](https://github.com/nix-rust/nix/pull/1607)) + +### Fixed + +- Fixed soundness issues in `FdSet::insert`, `FdSet::remove`, and + `FdSet::contains` involving file descriptors outside of the range + `0..FD_SETSIZE`. + (#[1575](https://github.com/nix-rust/nix/pull/1575)) + +## [0.23.0] - 2021-09-28 +### Added + +- Added the `LocalPeerCred` sockopt. + (#[1482](https://github.com/nix-rust/nix/pull/1482)) +- Added `TimeSpec::from_duration` and `TimeSpec::from_timespec` + (#[1465](https://github.com/nix-rust/nix/pull/1465)) +- Added `IPV6_V6ONLY` sockopt. + (#[1470](https://github.com/nix-rust/nix/pull/1470)) +- Added `impl From for libc::passwd` trait implementation to convert a `User` + into a `libc::passwd`. Consumes the `User` struct to give ownership over + the member pointers. + (#[1471](https://github.com/nix-rust/nix/pull/1471)) +- Added `pthread_kill`. + (#[1472](https://github.com/nix-rust/nix/pull/1472)) +- Added `mknodat`. + (#[1473](https://github.com/nix-rust/nix/pull/1473)) +- Added `setrlimit` and `getrlimit`. + (#[1302](https://github.com/nix-rust/nix/pull/1302)) +- Added `ptrace::interrupt` method for platforms that support `PTRACE_INTERRUPT` + (#[1422](https://github.com/nix-rust/nix/pull/1422)) +- Added `IP6T_SO_ORIGINAL_DST` sockopt. + (#[1490](https://github.com/nix-rust/nix/pull/1490)) +- Added the `PTRACE_EVENT_STOP` variant to the `sys::ptrace::Event` enum + (#[1335](https://github.com/nix-rust/nix/pull/1335)) +- Exposed `SockAddr::from_raw_sockaddr` + (#[1447](https://github.com/nix-rust/nix/pull/1447)) +- Added `TcpRepair` + (#[1503](https://github.com/nix-rust/nix/pull/1503)) +- Enabled `pwritev` and `preadv` for more operating systems. + (#[1511](https://github.com/nix-rust/nix/pull/1511)) +- Added support for `TCP_MAXSEG` TCP Maximum Segment Size socket options + (#[1292](https://github.com/nix-rust/nix/pull/1292)) +- Added `Ipv4RecvErr` and `Ipv6RecvErr` sockopts and associated control messages. + (#[1514](https://github.com/nix-rust/nix/pull/1514)) +- Added `AsRawFd` implementation on `PollFd`. + (#[1516](https://github.com/nix-rust/nix/pull/1516)) +- Added `Ipv4Ttl` and `Ipv6Ttl` sockopts. + (#[1515](https://github.com/nix-rust/nix/pull/1515)) +- Added `MAP_EXCL`, `MAP_ALIGNED_SUPER`, and `MAP_CONCEAL` mmap flags, and + exposed `MAP_ANONYMOUS` for all operating systems. + (#[1522](https://github.com/nix-rust/nix/pull/1522)) + (#[1525](https://github.com/nix-rust/nix/pull/1525)) + (#[1531](https://github.com/nix-rust/nix/pull/1531)) + (#[1534](https://github.com/nix-rust/nix/pull/1534)) +- Added read/write accessors for 'events' on `PollFd`. + (#[1517](https://github.com/nix-rust/nix/pull/1517)) + +### Changed + +- `FdSet::{contains, highest, fds}` no longer require a mutable reference. + (#[1464](https://github.com/nix-rust/nix/pull/1464)) +- `User::gecos` and corresponding `libc::passwd::pw_gecos` are supported on + 64-bit Android, change conditional compilation to include the field in + 64-bit Android builds + (#[1471](https://github.com/nix-rust/nix/pull/1471)) +- `eventfd`s are supported on Android, change conditional compilation to + include `sys::eventfd::eventfd` and `sys::eventfd::EfdFlags`for Android + builds. + (#[1481](https://github.com/nix-rust/nix/pull/1481)) +- Most enums that come from C, for example `Errno`, are now marked as + `#[non_exhaustive]`. + (#[1474](https://github.com/nix-rust/nix/pull/1474)) +- Many more functions, mostly contructors, are now `const`. + (#[1476](https://github.com/nix-rust/nix/pull/1476)) + (#[1492](https://github.com/nix-rust/nix/pull/1492)) +- `sys::event::KEvent::filter` now returns a `Result` instead of being + infalliable. The only cases where it will now return an error are cases + where it previously would've had undefined behavior. + (#[1484](https://github.com/nix-rust/nix/pull/1484)) +- Minimum supported Rust version is now 1.46.0. + ([#1492](https://github.com/nix-rust/nix/pull/1492)) +- Rework `UnixAddr` to encapsulate internals better in order to fix soundness + issues. No longer allows creating a `UnixAddr` from a raw `sockaddr_un`. + ([#1496](https://github.com/nix-rust/nix/pull/1496)) +- Raised bitflags to 1.3.0 and the MSRV to 1.46.0. + ([#1492](https://github.com/nix-rust/nix/pull/1492)) + +### Fixed + +- `posix_fadvise` now returns errors in the conventional way, rather than as a + non-zero value in `Ok()`. + (#[1538](https://github.com/nix-rust/nix/pull/1538)) +- Added more errno definitions for better backwards compatibility with + Nix 0.21.0. + (#[1467](https://github.com/nix-rust/nix/pull/1467)) +- Fixed potential undefined behavior in `Signal::try_from` on some platforms. + (#[1484](https://github.com/nix-rust/nix/pull/1484)) +- Fixed buffer overflow in `unistd::getgrouplist`. + (#[1545](https://github.com/nix-rust/nix/pull/1545)) + + +### Removed + +- Removed a couple of termios constants on redox that were never actually + supported. + (#[1483](https://github.com/nix-rust/nix/pull/1483)) +- Removed `nix::sys::signal::NSIG`. It was of dubious utility, and not correct + for all platforms. + (#[1484](https://github.com/nix-rust/nix/pull/1484)) +- Removed support for 32-bit Apple targets, since they've been dropped by both + Rustc and Xcode. + (#[1492](https://github.com/nix-rust/nix/pull/1492)) +- Deprecated `SockAddr/InetAddr::to_str` in favor of `ToString::to_string` + (#[1495](https://github.com/nix-rust/nix/pull/1495)) +- Removed `SigevNotify` on OpenBSD and Redox. + (#[1511](https://github.com/nix-rust/nix/pull/1511)) + +## [0.22.0] - 9 July 2021 +### Added +- Added `if_nameindex` (#[1445](https://github.com/nix-rust/nix/pull/1445)) +- Added `nmount` for FreeBSD. + (#[1453](https://github.com/nix-rust/nix/pull/1453)) +- Added `IpFreebind` socket option (sockopt) on Linux, Fuchsia and Android. + (#[1456](https://github.com/nix-rust/nix/pull/1456)) +- Added `TcpUserTimeout` socket option (sockopt) on Linux and Fuchsia. + (#[1457](https://github.com/nix-rust/nix/pull/1457)) +- Added `renameat2` for Linux + (#[1458](https://github.com/nix-rust/nix/pull/1458)) +- Added `RxqOvfl` support on Linux, Fuchsia and Android. + (#[1455](https://github.com/nix-rust/nix/pull/1455)) + +### Changed +- `ptsname_r` now returns a lossily-converted string in the event of bad UTF, + just like `ptsname`. + ([#1446](https://github.com/nix-rust/nix/pull/1446)) +- Nix's error type is now a simple wrapper around the platform's Errno. This + means it is now `Into`. It's also `Clone`, `Copy`, `Eq`, and + has a small fixed size. It also requires less typing. For example, the old + enum variant `nix::Error::Sys(nix::errno::Errno::EINVAL)` is now simply + `nix::Error::EINVAL`. + ([#1446](https://github.com/nix-rust/nix/pull/1446)) + +### Fixed +### Removed + +## [0.21.0] - 31 May 2021 +### Added +- Added `getresuid` and `getresgid` + (#[1430](https://github.com/nix-rust/nix/pull/1430)) +- Added TIMESTAMPNS support for linux + (#[1402](https://github.com/nix-rust/nix/pull/1402)) +- Added `sendfile64` (#[1439](https://github.com/nix-rust/nix/pull/1439)) +- Added `MS_LAZYTIME` to `MsFlags` + (#[1437](https://github.com/nix-rust/nix/pull/1437)) + +### Changed +- Made `forkpty` unsafe, like `fork` + (#[1390](https://github.com/nix-rust/nix/pull/1390)) +- Made `Uid`, `Gid` and `Pid` methods `from_raw` and `as_raw` a `const fn` + (#[1429](https://github.com/nix-rust/nix/pull/1429)) +- Made `Uid::is_root` a `const fn` + (#[1429](https://github.com/nix-rust/nix/pull/1429)) +- `AioCb` is now always pinned. Once a `libc::aiocb` gets sent to the kernel, + its address in memory must not change. Nix now enforces that by using + `std::pin`. Most users won't need to change anything, except when using + `aio_suspend`. See that method's documentation for the new usage. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- `LioCb` is now constructed using a distinct `LioCbBuilder` struct. This + avoids a soundness issue with the old `LioCb`. Usage is similar but + construction now uses the builder pattern. See the documentation for + details. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- Minimum supported Rust version is now 1.41.0. + ([#1440](https://github.com/nix-rust/nix/pull/1440)) +- Errno aliases are now associated consts on `Errno`, instead of consts in the + `errno` module. + (#[1452](https://github.com/nix-rust/nix/pull/1452)) + +### Fixed +- Allow `sockaddr_ll` size, as reported by the Linux kernel, to be smaller then it's definition + (#[1395](https://github.com/nix-rust/nix/pull/1395)) +- Fix spurious errors using `sendmmsg` with multiple cmsgs + (#[1414](https://github.com/nix-rust/nix/pull/1414)) +- Added `Errno::EOPNOTSUPP` to FreeBSD, where it was missing. + (#[1452](https://github.com/nix-rust/nix/pull/1452)) + +### Removed + +- Removed `sys::socket::accept4` from Android arm because libc removed it in + version 0.2.87. + ([#1399](https://github.com/nix-rust/nix/pull/1399)) +- `AioCb::from_boxed_slice` and `AioCb::from_boxed_mut_slice` have been + removed. They were useful with earlier versions of Rust, but should no + longer be needed now that async/await are available. `AioCb`s now work + exclusively with borrowed buffers, not owned ones. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- Removed some Errno values from platforms where they aren't actually defined. + (#[1452](https://github.com/nix-rust/nix/pull/1452)) + +## [0.20.0] - 20 February 2021 +### Added + +- Added a `passwd` field to `Group` (#[1338](https://github.com/nix-rust/nix/pull/1338)) +- Added `mremap` (#[1306](https://github.com/nix-rust/nix/pull/1306)) +- Added `personality` (#[1331](https://github.com/nix-rust/nix/pull/1331)) +- Added limited Fuchsia support (#[1285](https://github.com/nix-rust/nix/pull/1285)) +- Added `getpeereid` (#[1342](https://github.com/nix-rust/nix/pull/1342)) +- Implemented `IntoIterator` for `Dir` + (#[1333](https://github.com/nix-rust/nix/pull/1333)). + +### Changed + +- Minimum supported Rust version is now 1.40.0. + ([#1356](https://github.com/nix-rust/nix/pull/1356)) +- i686-apple-darwin has been demoted to Tier 2 support, because it's deprecated + by Xcode. + (#[1350](https://github.com/nix-rust/nix/pull/1350)) +- Fixed calling `recvfrom` on an `AddrFamily::Packet` socket + (#[1344](https://github.com/nix-rust/nix/pull/1344)) + +### Fixed +- `TimerFd` now closes the underlying fd on drop. + ([#1381](https://github.com/nix-rust/nix/pull/1381)) +- Define `*_MAGIC` filesystem constants on Linux s390x + (#[1372](https://github.com/nix-rust/nix/pull/1372)) +- mqueue, sysinfo, timespec, statfs, test_ptrace_syscall() on x32 + (#[1366](https://github.com/nix-rust/nix/pull/1366)) + +### Removed + +- `Dir`, `SignalFd`, and `PtyMaster` are no longer `Clone`. + (#[1382](https://github.com/nix-rust/nix/pull/1382)) +- Removed `SockLevel`, which hasn't been used for a few years + (#[1362](https://github.com/nix-rust/nix/pull/1362)) +- Removed both `Copy` and `Clone` from `TimerFd`. + ([#1381](https://github.com/nix-rust/nix/pull/1381)) + +## [0.19.1] - 28 November 2020 +### Fixed +- Fixed bugs in `recvmmsg`. + (#[1341](https://github.com/nix-rust/nix/pull/1341)) + +## [0.19.0] - 6 October 2020 +### Added +- Added Netlink protocol families to the `SockProtocol` enum + (#[1289](https://github.com/nix-rust/nix/pull/1289)) +- Added `clock_gettime`, `clock_settime`, `clock_getres`, + `clock_getcpuclockid` functions and `ClockId` struct. + (#[1281](https://github.com/nix-rust/nix/pull/1281)) +- Added wrapper functions for `PTRACE_SYSEMU` and `PTRACE_SYSEMU_SINGLESTEP`. + (#[1300](https://github.com/nix-rust/nix/pull/1300)) +- Add support for Vsock on Android rather than just Linux. + (#[1301](https://github.com/nix-rust/nix/pull/1301)) +- Added `TCP_KEEPCNT` and `TCP_KEEPINTVL` TCP keepalive options. + (#[1283](https://github.com/nix-rust/nix/pull/1283)) +### Changed +- Expose `SeekData` and `SeekHole` on all Linux targets + (#[1284](https://github.com/nix-rust/nix/pull/1284)) +- Changed unistd::{execv,execve,execvp,execvpe,fexecve,execveat} to take both `&[&CStr]` and `&[CString]` as its list argument(s). + (#[1278](https://github.com/nix-rust/nix/pull/1278)) +- Made `unistd::fork` an unsafe funtion, bringing it in line with [libstd's decision](https://github.com/rust-lang/rust/pull/58059). + (#[1293](https://github.com/nix-rust/nix/pull/1293)) +### Fixed +### Removed + +## [0.18.0] - 26 July 2020 +### Added +- Added `fchown(2)` wrapper. + (#[1257](https://github.com/nix-rust/nix/pull/1257)) +- Added support on linux systems for `MAP_HUGE_`_`SIZE`_ family of flags. + (#[1211](https://github.com/nix-rust/nix/pull/1211)) +- Added support for `F_OFD_*` `fcntl` commands on Linux and Android. + (#[1195](https://github.com/nix-rust/nix/pull/1195)) +- Added `env::clearenv()`: calls `libc::clearenv` on platforms + where it's available, and clears the environment of all variables + via `std::env::vars` and `std::env::remove_var` on others. + (#[1185](https://github.com/nix-rust/nix/pull/1185)) +- `FsType` inner value made public. + (#[1187](https://github.com/nix-rust/nix/pull/1187)) +- Added `unistd::setfsuid` and `unistd::setfsgid` to set the user or group + identity for filesystem checks per-thread. + (#[1163](https://github.com/nix-rust/nix/pull/1163)) +- Derived `Ord`, `PartialOrd` for `unistd::Pid` (#[1189](https://github.com/nix-rust/nix/pull/1189)) +- Added `select::FdSet::fds` method to iterate over file descriptors in a set. + ([#1207](https://github.com/nix-rust/nix/pull/1207)) +- Added support for UDP generic segmentation offload (GSO) and generic + receive offload (GRO) ([#1209](https://github.com/nix-rust/nix/pull/1209)) +- Added support for `sendmmsg` and `recvmmsg` calls + (#[1208](https://github.com/nix-rust/nix/pull/1208)) +- Added support for `SCM_CREDS` messages (`UnixCredentials`) on FreeBSD/DragonFly + (#[1216](https://github.com/nix-rust/nix/pull/1216)) +- Added `BindToDevice` socket option (sockopt) on Linux + (#[1233](https://github.com/nix-rust/nix/pull/1233)) +- Added `EventFilter` bitflags for `EV_DISPATCH` and `EV_RECEIPT` on OpenBSD. + (#[1252](https://github.com/nix-rust/nix/pull/1252)) +- Added support for `Ipv4PacketInfo` and `Ipv6PacketInfo` to `ControlMessage`. + (#[1222](https://github.com/nix-rust/nix/pull/1222)) +- `CpuSet` and `UnixCredentials` now implement `Default`. + (#[1244](https://github.com/nix-rust/nix/pull/1244)) +- Added `unistd::ttyname` + (#[1259](https://github.com/nix-rust/nix/pull/1259)) +- Added support for `Ipv4PacketInfo` and `Ipv6PacketInfo` to `ControlMessage` for iOS and Android. + (#[1265](https://github.com/nix-rust/nix/pull/1265)) +- Added support for `TimerFd`. + (#[1261](https://github.com/nix-rust/nix/pull/1261)) + +### Changed +- Changed `fallocate` return type from `c_int` to `()` (#[1201](https://github.com/nix-rust/nix/pull/1201)) +- Enabled `sys::ptrace::setregs` and `sys::ptrace::getregs` on x86_64-unknown-linux-musl target + (#[1198](https://github.com/nix-rust/nix/pull/1198)) +- On Linux, `ptrace::write` is now an `unsafe` function. Caveat programmer. + (#[1245](https://github.com/nix-rust/nix/pull/1245)) +- `execv`, `execve`, `execvp` and `execveat` in `::nix::unistd` and `reboot` in + `::nix::sys::reboot` now return `Result` instead of `Result` (#[1239](https://github.com/nix-rust/nix/pull/1239)) +- `sys::socket::sockaddr_storage_to_addr` is no longer `unsafe`. So is + `offset_of!`. +- `sys::socket::sockaddr_storage_to_addr`, `offset_of!`, and `Errno::clear` are + no longer `unsafe`. +- `SockAddr::as_ffi_pair`,`sys::socket::sockaddr_storage_to_addr`, `offset_of!`, + and `Errno::clear` are no longer `unsafe`. + (#[1244](https://github.com/nix-rust/nix/pull/1244)) +- Several `Inotify` methods now take `self` by value instead of by reference + (#[1244](https://github.com/nix-rust/nix/pull/1244)) +- `nix::poll::ppoll`: `timeout` parameter is now optional, None is equivalent for infinite timeout. + +### Fixed + +- Fixed `getsockopt`. The old code produced UB which triggers a panic with + Rust 1.44.0. + (#[1214](https://github.com/nix-rust/nix/pull/1214)) + +- Fixed a bug in nix::unistd that would result in an infinite loop + when a group or user lookup required a buffer larger than + 16KB. (#[1198](https://github.com/nix-rust/nix/pull/1198)) +- Fixed unaligned casting of `cmsg_data` to `af_alg_iv` (#[1206](https://github.com/nix-rust/nix/pull/1206)) +- Fixed `readlink`/`readlinkat` when reading symlinks longer than `PATH_MAX` (#[1231](https://github.com/nix-rust/nix/pull/1231)) +- `PollFd`, `EpollEvent`, `IpMembershipRequest`, `Ipv6MembershipRequest`, + `TimeVal`, and `IoVec` are now `repr(transparent)`. This is required for + correctness's sake across all architectures and compilers, though now bugs + have been reported so far. + (#[1243](https://github.com/nix-rust/nix/pull/1243)) +- Fixed unaligned pointer read in `Inotify::read_events`. + (#[1244](https://github.com/nix-rust/nix/pull/1244)) + +### Removed + +- Removed `sys::socket::addr::from_libc_sockaddr` from the public API. + (#[1215](https://github.com/nix-rust/nix/pull/1215)) +- Removed `sys::termios::{get_libc_termios, get_libc_termios_mut, update_wrapper` + from the public API. These were previously hidden in the docs but still usable + by downstream. + (#[1235](https://github.com/nix-rust/nix/pull/1235)) + +- Nix no longer implements `NixPath` for `Option

where P: NixPath`. Most + Nix functions that accept `NixPath` arguments can't do anything useful with + `None`. The exceptions (`mount` and `quotactl_sync`) already take explicitly + optional arguments. + (#[1242](https://github.com/nix-rust/nix/pull/1242)) + +- Removed `unistd::daemon` and `unistd::pipe2` on OSX and ios + (#[1255](https://github.com/nix-rust/nix/pull/1255)) + +- Removed `sys::event::FilterFlag::NOTE_EXIT_REPARENTED` and + `sys::event::FilterFlag::NOTE_REAP` on OSX and ios. + (#[1255](https://github.com/nix-rust/nix/pull/1255)) + +- Removed `sys::ptrace::ptrace` on Android and Linux. + (#[1255](https://github.com/nix-rust/nix/pull/1255)) + +- Dropped support for powerpc64-unknown-linux-gnu + (#[1266](https://github.com/nix-rust/nix/pull/1268)) + +## [0.17.0] - 3 February 2020 +### Added +- Add `CLK_TCK` to `SysconfVar` + (#[1177](https://github.com/nix-rust/nix/pull/1177)) +### Changed +### Fixed +### Removed +- Removed deprecated Error::description from error types + (#[1175](https://github.com/nix-rust/nix/pull/1175)) + +## [0.16.1] - 23 December 2019 +### Added +### Changed +### Fixed + +- Fixed the build for OpenBSD + (#[1168](https://github.com/nix-rust/nix/pull/1168)) + +### Removed + +## [0.16.0] - 1 December 2019 +### Added +- Added `ptrace::seize()`: similar to `attach()` on Linux + but with better-defined semantics. + (#[1154](https://github.com/nix-rust/nix/pull/1154)) + +- Added `Signal::as_str()`: returns signal name as `&'static str` + (#[1138](https://github.com/nix-rust/nix/pull/1138)) + +- Added `posix_fallocate`. + ([#1105](https://github.com/nix-rust/nix/pull/1105)) + +- Implemented `Default` for `FdSet` + ([#1107](https://github.com/nix-rust/nix/pull/1107)) + +- Added `NixPath::is_empty`. + ([#1107](https://github.com/nix-rust/nix/pull/1107)) + +- Added `mkfifoat` + ([#1133](https://github.com/nix-rust/nix/pull/1133)) + +- Added `User::from_uid`, `User::from_name`, `User::from_gid` and + `Group::from_name`, + ([#1139](https://github.com/nix-rust/nix/pull/1139)) + +- Added `linkat` + ([#1101](https://github.com/nix-rust/nix/pull/1101)) + +- Added `sched_getaffinity`. + ([#1148](https://github.com/nix-rust/nix/pull/1148)) + +- Added optional `Signal` argument to `ptrace::{detach, syscall}` for signal + injection. ([#1083](https://github.com/nix-rust/nix/pull/1083)) + +### Changed +- `sys::termios::BaudRate` now implements `TryFrom` instead of + `From`. The old `From` implementation would panic on failure. + ([#1159](https://github.com/nix-rust/nix/pull/1159)) + +- `sys::socket::ControlMessage::ScmCredentials` and + `sys::socket::ControlMessageOwned::ScmCredentials` now wrap `UnixCredentials` + rather than `libc::ucred`. + ([#1160](https://github.com/nix-rust/nix/pull/1160)) + +- `sys::socket::recvmsg` now takes a plain `Vec` instead of a `CmsgBuffer` + implementor. If you were already using `cmsg_space!`, then you needn't worry. + ([#1156](https://github.com/nix-rust/nix/pull/1156)) + +- `sys::socket::recvfrom` now returns + `Result<(usize, Option)>` instead of `Result<(usize, SockAddr)>`. + ([#1145](https://github.com/nix-rust/nix/pull/1145)) + +- `Signal::from_c_int` has been replaced by `Signal::try_from` + ([#1113](https://github.com/nix-rust/nix/pull/1113)) + +- Changed `readlink` and `readlinkat` to return `OsString` + ([#1109](https://github.com/nix-rust/nix/pull/1109)) + + ```rust + # use nix::fcntl::{readlink, readlinkat}; + // the buffer argument of `readlink` and `readlinkat` has been removed, + // and the return value is now an owned type (`OsString`). + // Existing code can be updated by removing the buffer argument + // and removing any clone or similar operation on the output + + // old code `readlink(&path, &mut buf)` can be replaced with the following + let _: OsString = readlink(&path); + + // old code `readlinkat(dirfd, &path, &mut buf)` can be replaced with the following + let _: OsString = readlinkat(dirfd, &path); + ``` + +- Minimum supported Rust version is now 1.36.0. + ([#1108](https://github.com/nix-rust/nix/pull/1108)) + +- `Ipv4Addr::octets`, `Ipv4Addr::to_std`, `Error::as_errno`, + `ForkResult::is_child`, `ForkResult::is_parent`, `Gid::as_raw`, + `Uid::is_root`, `Uid::as_raw`, `Pid::as_raw`, and `PollFd::revents` now take + `self` by value. + ([#1107](https://github.com/nix-rust/nix/pull/1107)) + +- Type `&CString` for parameters of `exec(v|ve|vp|vpe|veat)` are changed to `&CStr`. + ([#1121](https://github.com/nix-rust/nix/pull/1121)) + +### Fixed +- Fix length of abstract socket addresses + ([#1120](https://github.com/nix-rust/nix/pull/1120)) + +- Fix initialization of msghdr in recvmsg/sendmsg when built with musl + ([#1136](https://github.com/nix-rust/nix/pull/1136)) + +### Removed +- Remove the deprecated `CmsgSpace`. + ([#1156](https://github.com/nix-rust/nix/pull/1156)) + +## [0.15.0] - 10 August 2019 +### Added +- Added `MSG_WAITALL` to `MsgFlags` in `sys::socket`. + ([#1079](https://github.com/nix-rust/nix/pull/1079)) +- Implemented `Clone`, `Copy`, `Debug`, `Eq`, `Hash`, and `PartialEq` for most + types that support them. ([#1035](https://github.com/nix-rust/nix/pull/1035)) +- Added `copy_file_range` wrapper + ([#1069](https://github.com/nix-rust/nix/pull/1069)) +- Add `mkdirat`. + ([#1084](https://github.com/nix-rust/nix/pull/1084)) +- Add `posix_fadvise`. + ([#1089](https://github.com/nix-rust/nix/pull/1089)) +- Added `AF_VSOCK` to `AddressFamily`. + ([#1091](https://github.com/nix-rust/nix/pull/1091)) +- Add `unlinkat` + ([#1058](https://github.com/nix-rust/nix/pull/1058)) +- Add `renameat`. + ([#1097](https://github.com/nix-rust/nix/pull/1097)) + +### Changed +- Support for `ifaddrs` now present when building for Android. + ([#1077](https://github.com/nix-rust/nix/pull/1077)) +- Minimum supported Rust version is now 1.31.0 + ([#1035](https://github.com/nix-rust/nix/pull/1035)) + ([#1095](https://github.com/nix-rust/nix/pull/1095)) +- Now functions `statfs()` and `fstatfs()` return result with `Statfs` wrapper + ([#928](https://github.com/nix-rust/nix/pull/928)) + +### Fixed +- Enabled `sched_yield` for all nix hosts. + ([#1090](https://github.com/nix-rust/nix/pull/1090)) + +### Removed + +## [0.14.1] - 2019-06-06 +### Added +- Macros exported by `nix` may now be imported via `use` on the Rust 2018 + edition without importing helper macros on Linux targets. + ([#1066](https://github.com/nix-rust/nix/pull/1066)) + + For example, in Rust 2018, the `ioctl_read_bad!` macro can now be imported + without importing the `convert_ioctl_res!` macro. + + ```rust + use nix::ioctl_read_bad; + + ioctl_read_bad!(tcgets, libc::TCGETS, libc::termios); + ``` + +### Changed +- Changed some public types from reexports of libc types like `uint32_t` to the + native equivalents like `u32.` + ([#1072](https://github.com/nix-rust/nix/pull/1072/commits)) + +### Fixed +- Fix the build on Android and Linux/mips with recent versions of libc. + ([#1072](https://github.com/nix-rust/nix/pull/1072/commits)) + +### Removed + +## [0.14.0] - 2019-05-21 +### Added +- Add IP_RECVIF & IP_RECVDSTADDR. Enable IP_PKTINFO and IP6_PKTINFO on netbsd/openbsd. + ([#1002](https://github.com/nix-rust/nix/pull/1002)) +- Added `inotify_init1`, `inotify_add_watch` and `inotify_rm_watch` wrappers for + Android and Linux. ([#1016](https://github.com/nix-rust/nix/pull/1016)) +- Add `ALG_SET_IV`, `ALG_SET_OP` and `ALG_SET_AEAD_ASSOCLEN` control messages and `AF_ALG` + socket types on Linux and Android ([#1031](https://github.com/nix-rust/nix/pull/1031)) +- Add killpg + ([#1034](https://github.com/nix-rust/nix/pull/1034)) +- Added ENOTSUP errno support for Linux and Android. + ([#969](https://github.com/nix-rust/nix/pull/969)) +- Add several errno constants from OpenBSD 6.2 + ([#1036](https://github.com/nix-rust/nix/pull/1036)) +- Added `from_std` and `to_std` methods for `sys::socket::IpAddr` + ([#1043](https://github.com/nix-rust/nix/pull/1043)) +- Added `nix::unistd:seteuid` and `nix::unistd::setegid` for those platforms that do + not support `setresuid` nor `setresgid` respectively. + ([#1044](https://github.com/nix-rust/nix/pull/1044)) +- Added a `access` wrapper + ([#1045](https://github.com/nix-rust/nix/pull/1045)) +- Add `forkpty` + ([#1042](https://github.com/nix-rust/nix/pull/1042)) +- Add `sched_yield` + ([#1050](https://github.com/nix-rust/nix/pull/1050)) + +### Changed +- `PollFd` event flags renamed to `PollFlags` ([#1024](https://github.com/nix-rust/nix/pull/1024/)) +- `recvmsg` now returns an Iterator over `ControlMessageOwned` objects rather + than `ControlMessage` objects. This is sadly not backwards-compatible. Fix + code like this: + ```rust + if let ControlMessage::ScmRights(&fds) = cmsg { + ``` + + By replacing it with code like this: + ```rust + if let ControlMessageOwned::ScmRights(fds) = cmsg { + ``` + ([#1020](https://github.com/nix-rust/nix/pull/1020)) +- Replaced `CmsgSpace` with the `cmsg_space` macro. + ([#1020](https://github.com/nix-rust/nix/pull/1020)) + +### Fixed +- Fixed multiple bugs when using `sendmsg` and `recvmsg` with ancillary control messages + ([#1020](https://github.com/nix-rust/nix/pull/1020)) +- Macros exported by `nix` may now be imported via `use` on the Rust 2018 + edition without importing helper macros for BSD targets. + ([#1041](https://github.com/nix-rust/nix/pull/1041)) + + For example, in Rust 2018, the `ioctl_read_bad!` macro can now be imported + without importing the `convert_ioctl_res!` macro. + + ```rust + use nix::ioctl_read_bad; + + ioctl_read_bad!(tcgets, libc::TCGETS, libc::termios); + ``` + +### Removed +- `Daemon`, `NOTE_REAP`, and `NOTE_EXIT_REPARENTED` are now deprecated on OSX + and iOS. + ([#1033](https://github.com/nix-rust/nix/pull/1033)) +- `PTRACE_GETREGS`, `PTRACE_SETREGS`, `PTRACE_GETFPREGS`, and + `PTRACE_SETFPREGS` have been removed from some platforms where they never + should've been defined in the first place. + ([#1055](https://github.com/nix-rust/nix/pull/1055)) + +## [0.13.0] - 2019-01-15 +### Added +- Added PKTINFO(V4) & V6PKTINFO cmsg support - Android/FreeBSD/iOS/Linux/MacOS. + ([#990](https://github.com/nix-rust/nix/pull/990)) +- Added support of CString type in `setsockopt`. + ([#972](https://github.com/nix-rust/nix/pull/972)) +- Added option `TCP_CONGESTION` in `setsockopt`. + ([#972](https://github.com/nix-rust/nix/pull/972)) +- Added `symlinkat` wrapper. + ([#997](https://github.com/nix-rust/nix/pull/997)) +- Added `ptrace::{getregs, setregs}`. + ([#1010](https://github.com/nix-rust/nix/pull/1010)) +- Added `nix::sys::signal::signal`. + ([#817](https://github.com/nix-rust/nix/pull/817)) +- Added an `mprotect` wrapper. + ([#991](https://github.com/nix-rust/nix/pull/991)) + +### Changed +### Fixed +- `lutimes` never worked on OpenBSD as it is not implemented on OpenBSD. It has + been removed. ([#1000](https://github.com/nix-rust/nix/pull/1000)) +- `fexecve` never worked on NetBSD or on OpenBSD as it is not implemented on + either OS. It has been removed. ([#1000](https://github.com/nix-rust/nix/pull/1000)) + +### Removed + +## [0.12.0] 2018-11-28 + +### Added +- Added `FromStr` and `Display` impls for `nix::sys::Signal` + ([#884](https://github.com/nix-rust/nix/pull/884)) +- Added a `sync` wrapper. + ([#961](https://github.com/nix-rust/nix/pull/961)) +- Added a `sysinfo` wrapper. + ([#922](https://github.com/nix-rust/nix/pull/922)) +- Support the `SO_PEERCRED` socket option and the `UnixCredentials` type on all Linux and Android targets. + ([#921](https://github.com/nix-rust/nix/pull/921)) +- Added support for `SCM_CREDENTIALS`, allowing to send process credentials over Unix sockets. + ([#923](https://github.com/nix-rust/nix/pull/923)) +- Added a `dir` module for reading directories (wraps `fdopendir`, `readdir`, and `rewinddir`). + ([#916](https://github.com/nix-rust/nix/pull/916)) +- Added `kmod` module that allows loading and unloading kernel modules on Linux. + ([#930](https://github.com/nix-rust/nix/pull/930)) +- Added `futimens` and `utimesat` wrappers ([#944](https://github.com/nix-rust/nix/pull/944)), + an `lutimes` wrapper ([#967](https://github.com/nix-rust/nix/pull/967)), + and a `utimes` wrapper ([#946](https://github.com/nix-rust/nix/pull/946)). +- Added `AF_UNSPEC` wrapper to `AddressFamily` ([#948](https://github.com/nix-rust/nix/pull/948)) +- Added the `mode_t` public alias within `sys::stat`. + ([#954](https://github.com/nix-rust/nix/pull/954)) +- Added a `truncate` wrapper. + ([#956](https://github.com/nix-rust/nix/pull/956)) +- Added a `fchownat` wrapper. + ([#955](https://github.com/nix-rust/nix/pull/955)) +- Added support for `ptrace` on BSD operating systems ([#949](https://github.com/nix-rust/nix/pull/949)) +- Added `ptrace` functions for reads and writes to tracee memory and ptrace kill + ([#949](https://github.com/nix-rust/nix/pull/949)) ([#958](https://github.com/nix-rust/nix/pull/958)) +- Added a `acct` wrapper module for enabling and disabling process accounting + ([#952](https://github.com/nix-rust/nix/pull/952)) +- Added the `time_t` and `suseconds_t` public aliases within `sys::time`. + ([#968](https://github.com/nix-rust/nix/pull/968)) +- Added `unistd::execvpe` for Haiku, Linux and OpenBSD + ([#975](https://github.com/nix-rust/nix/pull/975)) +- Added `Error::as_errno`. + ([#977](https://github.com/nix-rust/nix/pull/977)) + +### Changed +- Increased required Rust version to 1.24.1 + ([#900](https://github.com/nix-rust/nix/pull/900)) + ([#966](https://github.com/nix-rust/nix/pull/966)) + +### Fixed +- Made `preadv` take immutable slice of IoVec. + ([#914](https://github.com/nix-rust/nix/pull/914)) +- Fixed passing multiple file descriptors over Unix Sockets. + ([#918](https://github.com/nix-rust/nix/pull/918)) + +### Removed + +## [0.11.0] 2018-06-01 + +### Added +- Added `sendfile` on FreeBSD and Darwin. + ([#901](https://github.com/nix-rust/nix/pull/901)) +- Added `pselect` + ([#894](https://github.com/nix-rust/nix/pull/894)) +- Exposed `preadv` and `pwritev` on the BSDs. + ([#883](https://github.com/nix-rust/nix/pull/883)) +- Added `mlockall` and `munlockall` + ([#876](https://github.com/nix-rust/nix/pull/876)) +- Added `SO_MARK` on Linux. + ([#873](https://github.com/nix-rust/nix/pull/873)) +- Added safe support for nearly any buffer type in the `sys::aio` module. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Added `sys::aio::LioCb` as a wrapper for `libc::lio_listio`. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Added `unistd::getsid` + ([#850](https://github.com/nix-rust/nix/pull/850)) +- Added `alarm`. ([#830](https://github.com/nix-rust/nix/pull/830)) +- Added interface flags `IFF_NO_PI, IFF_TUN, IFF_TAP` on linux-like systems. + ([#853](https://github.com/nix-rust/nix/pull/853)) +- Added `statvfs` module to all MacOS and Linux architectures. + ([#832](https://github.com/nix-rust/nix/pull/832)) +- Added `EVFILT_EMPTY`, `EVFILT_PROCDESC`, and `EVFILT_SENDFILE` on FreeBSD. + ([#825](https://github.com/nix-rust/nix/pull/825)) +- Exposed `termios::cfmakesane` on FreeBSD. + ([#825](https://github.com/nix-rust/nix/pull/825)) +- Exposed `MSG_CMSG_CLOEXEC` on *BSD. + ([#825](https://github.com/nix-rust/nix/pull/825)) +- Added `fchmod`, `fchmodat`. + ([#857](https://github.com/nix-rust/nix/pull/857)) +- Added `request_code_write_int!` on FreeBSD/DragonFlyBSD + ([#833](https://github.com/nix-rust/nix/pull/833)) + +### Changed +- `Display` and `Debug` for `SysControlAddr` now includes all fields. + ([#837](https://github.com/nix-rust/nix/pull/837)) +- `ioctl!` has been replaced with a family of `ioctl_*!` macros. + ([#833](https://github.com/nix-rust/nix/pull/833)) +- `io!`, `ior!`, `iow!`, and `iorw!` has been renamed to `request_code_none!`, `request_code_read!`, + `request_code_write!`, and `request_code_readwrite!` respectively. These have also now been exposed + in the documentation. + ([#833](https://github.com/nix-rust/nix/pull/833)) +- Enabled more `ptrace::Request` definitions for uncommon Linux platforms + ([#892](https://github.com/nix-rust/nix/pull/892)) +- Emulation of `FD_CLOEXEC` and `O_NONBLOCK` was removed from `socket()`, `accept4()`, and + `socketpair()`. + ([#907](https://github.com/nix-rust/nix/pull/907)) + +### Fixed +- Fixed possible panics when using `SigAction::flags` on Linux + ([#869](https://github.com/nix-rust/nix/pull/869)) +- Properly exposed 460800 and 921600 baud rates on NetBSD + ([#837](https://github.com/nix-rust/nix/pull/837)) +- Fixed `ioctl_write_int!` on FreeBSD/DragonFlyBSD + ([#833](https://github.com/nix-rust/nix/pull/833)) +- `ioctl_write_int!` now properly supports passing a `c_ulong` as the parameter on Linux non-musl targets + ([#833](https://github.com/nix-rust/nix/pull/833)) + +### Removed +- Removed explicit support for the `bytes` crate from the `sys::aio` module. + See `sys::aio::AioCb::from_boxed_slice` examples for alternatives. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Removed `sys::aio::lio_listio`. Use `sys::aio::LioCb::listio` instead. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Removed emulated `accept4()` from macos, ios, and netbsd targets + ([#907](https://github.com/nix-rust/nix/pull/907)) +- Removed `IFF_NOTRAILERS` on OpenBSD, as it has been removed in OpenBSD 6.3 + ([#893](https://github.com/nix-rust/nix/pull/893)) + +## [0.10.0] 2018-01-26 + +### Added +- Added specialized wrapper: `sys::ptrace::step` + ([#852](https://github.com/nix-rust/nix/pull/852)) +- Added `AioCb::from_ptr` and `AioCb::from_mut_ptr` + ([#820](https://github.com/nix-rust/nix/pull/820)) +- Added specialized wrappers: `sys::ptrace::{traceme, syscall, cont, attach}`. Using the matching routines + with `sys::ptrace::ptrace` is now deprecated. +- Added `nix::poll` module for all platforms + ([#672](https://github.com/nix-rust/nix/pull/672)) +- Added `nix::ppoll` function for FreeBSD and DragonFly + ([#672](https://github.com/nix-rust/nix/pull/672)) +- Added protocol families in `AddressFamily` enum. + ([#647](https://github.com/nix-rust/nix/pull/647)) +- Added the `pid()` method to `WaitStatus` for extracting the PID. + ([#722](https://github.com/nix-rust/nix/pull/722)) +- Added `nix::unistd:fexecve`. + ([#727](https://github.com/nix-rust/nix/pull/727)) +- Expose `uname()` on all platforms. + ([#739](https://github.com/nix-rust/nix/pull/739)) +- Expose `signalfd` module on Android as well. + ([#739](https://github.com/nix-rust/nix/pull/739)) +- Added `nix::sys::ptrace::detach`. + ([#749](https://github.com/nix-rust/nix/pull/749)) +- Added timestamp socket control message variant: + `nix::sys::socket::ControlMessage::ScmTimestamp` + ([#663](https://github.com/nix-rust/nix/pull/663)) +- Added socket option variant that enables the timestamp socket + control message: `nix::sys::socket::sockopt::ReceiveTimestamp` + ([#663](https://github.com/nix-rust/nix/pull/663)) +- Added more accessor methods for `AioCb` + ([#773](https://github.com/nix-rust/nix/pull/773)) +- Add `nix::sys::fallocate` + ([#768](https:://github.com/nix-rust/nix/pull/768)) +- Added `nix::unistd::mkfifo`. + ([#602](https://github.com/nix-rust/nix/pull/774)) +- Added `ptrace::Options::PTRACE_O_EXITKILL` on Linux and Android. + ([#771](https://github.com/nix-rust/nix/pull/771)) +- Added `nix::sys::uio::{process_vm_readv, process_vm_writev}` on Linux + ([#568](https://github.com/nix-rust/nix/pull/568)) +- Added `nix::unistd::{getgroups, setgroups, getgrouplist, initgroups}`. ([#733](https://github.com/nix-rust/nix/pull/733)) +- Added `nix::sys::socket::UnixAddr::as_abstract` on Linux and Android. + ([#785](https://github.com/nix-rust/nix/pull/785)) +- Added `nix::unistd::execveat` on Linux and Android. + ([#800](https://github.com/nix-rust/nix/pull/800)) +- Added the `from_raw()` method to `WaitStatus` for converting raw status values + to `WaitStatus` independent of syscalls. + ([#741](https://github.com/nix-rust/nix/pull/741)) +- Added more standard trait implementations for various types. + ([#814](https://github.com/nix-rust/nix/pull/814)) +- Added `sigprocmask` to the signal module. + ([#826](https://github.com/nix-rust/nix/pull/826)) +- Added `nix::sys::socket::LinkAddr` on Linux and all bsdlike system. + ([#813](https://github.com/nix-rust/nix/pull/813)) +- Add socket options for `IP_TRANSPARENT` / `BIND_ANY`. + ([#835](https://github.com/nix-rust/nix/pull/835)) + +### Changed +- Exposed the `mqueue` module for all supported operating systems. + ([#834](https://github.com/nix-rust/nix/pull/834)) +- Use native `pipe2` on all BSD targets. Users should notice no difference. + ([#777](https://github.com/nix-rust/nix/pull/777)) +- Renamed existing `ptrace` wrappers to encourage namespacing ([#692](https://github.com/nix-rust/nix/pull/692)) +- Marked `sys::ptrace::ptrace` as `unsafe`. +- Changed function signature of `socket()` and `socketpair()`. The `protocol` argument + has changed type from `c_int` to `SockProtocol`. + It accepts a `None` value for default protocol that was specified with zero using `c_int`. + ([#647](https://github.com/nix-rust/nix/pull/647)) +- Made `select` easier to use, adding the ability to automatically calculate the `nfds` parameter using the new + `FdSet::highest` ([#701](https://github.com/nix-rust/nix/pull/701)) +- Exposed `unistd::setresuid` and `unistd::setresgid` on FreeBSD and OpenBSD + ([#721](https://github.com/nix-rust/nix/pull/721)) +- Refactored the `statvfs` module removing extraneous API functions and the + `statvfs::vfs` module. Additionally `(f)statvfs()` now return the struct + directly. And the returned `Statvfs` struct now exposes its data through + accessor methods. ([#729](https://github.com/nix-rust/nix/pull/729)) +- The `addr` argument to `madvise` and `msync` is now `*mut` to better match the + libc API. ([#731](https://github.com/nix-rust/nix/pull/731)) +- `shm_open` and `shm_unlink` are no longer exposed on Android targets, where + they are not officially supported. ([#731](https://github.com/nix-rust/nix/pull/731)) +- `MapFlags`, `MmapAdvise`, and `MsFlags` expose some more variants and only + officially-supported variants are provided for each target. + ([#731](https://github.com/nix-rust/nix/pull/731)) +- Marked `pty::ptsname` function as `unsafe` + ([#744](https://github.com/nix-rust/nix/pull/744)) +- Moved constants ptrace request, event and options to enums and updated ptrace functions and argument types accordingly. + ([#749](https://github.com/nix-rust/nix/pull/749)) +- `AioCb::Drop` will now panic if the `AioCb` is still in-progress ([#715](https://github.com/nix-rust/nix/pull/715)) +- Restricted `nix::sys::socket::UnixAddr::new_abstract` to Linux and Android only. + ([#785](https://github.com/nix-rust/nix/pull/785)) +- The `ucred` struct has been removed in favor of a `UserCredentials` struct that + contains only getters for its fields. + ([#814](https://github.com/nix-rust/nix/pull/814)) +- Both `ip_mreq` and `ipv6_mreq` have been replaced with `IpMembershipRequest` and + `Ipv6MembershipRequest`. + ([#814](https://github.com/nix-rust/nix/pull/814)) +- Removed return type from `pause`. + ([#829](https://github.com/nix-rust/nix/pull/829)) +- Changed the termios APIs to allow for using a `u32` instead of the `BaudRate` + enum on BSD platforms to support arbitrary baud rates. See the module docs for + `nix::sys::termios` for more details. + ([#843](https://github.com/nix-rust/nix/pull/843)) + +### Fixed +- Fix compilation and tests for OpenBSD targets + ([#688](https://github.com/nix-rust/nix/pull/688)) +- Fixed error handling in `AioCb::fsync`, `AioCb::read`, and `AioCb::write`. + It is no longer an error to drop an `AioCb` that failed to enqueue in the OS. + ([#715](https://github.com/nix-rust/nix/pull/715)) +- Fix potential memory corruption on non-Linux platforms when using + `sendmsg`/`recvmsg`, caused by mismatched `msghdr` definition. + ([#648](https://github.com/nix-rust/nix/pull/648)) + +### Removed +- `AioCb::from_boxed_slice` has been removed. It was never actually safe. Use + `from_bytes` or `from_bytes_mut` instead. + ([#820](https://github.com/nix-rust/nix/pull/820)) +- The syscall module has been removed. This only exposed enough functionality for + `memfd_create()` and `pivot_root()`, which are still exposed as separate functions. + ([#747](https://github.com/nix-rust/nix/pull/747)) +- The `Errno` variants are no longer reexported from the `errno` module. `Errno` itself is no longer reexported from the + crate root and instead must be accessed using the `errno` module. ([#696](https://github.com/nix-rust/nix/pull/696)) +- Removed `MS_VERBOSE`, `MS_NOSEC`, and `MS_BORN` from `MsFlags`. These + are internal kernel flags and should never have been exposed. + ([#814](https://github.com/nix-rust/nix/pull/814)) + + +## [0.9.0] 2017-07-23 + +### Added +- Added `sysconf`, `pathconf`, and `fpathconf` + ([#630](https://github.com/nix-rust/nix/pull/630) +- Added `sys::signal::SigAction::{ flags, mask, handler}` + ([#611](https://github.com/nix-rust/nix/pull/609) +- Added `nix::sys::pthread::pthread_self` + ([#591](https://github.com/nix-rust/nix/pull/591) +- Added `AioCb::from_boxed_slice` + ([#582](https://github.com/nix-rust/nix/pull/582) +- Added `nix::unistd::{openat, fstatat, readlink, readlinkat}` + ([#551](https://github.com/nix-rust/nix/pull/551)) +- Added `nix::pty::{grantpt, posix_openpt, ptsname/ptsname_r, unlockpt}` + ([#556](https://github.com/nix-rust/nix/pull/556) +- Added `nix::ptr::openpty` + ([#456](https://github.com/nix-rust/nix/pull/456)) +- Added `nix::ptrace::{ptrace_get_data, ptrace_getsiginfo, ptrace_setsiginfo + and nix::Error::UnsupportedOperation}` + ([#614](https://github.com/nix-rust/nix/pull/614)) +- Added `cfmakeraw`, `cfsetspeed`, and `tcgetsid`. ([#527](https://github.com/nix-rust/nix/pull/527)) +- Added "bad none", "bad write_ptr", "bad write_int", and "bad readwrite" variants to the `ioctl!` + macro. ([#670](https://github.com/nix-rust/nix/pull/670)) +- On Linux and Android, added support for receiving `PTRACE_O_TRACESYSGOOD` + events from `wait` and `waitpid` using `WaitStatus::PtraceSyscall` + ([#566](https://github.com/nix-rust/nix/pull/566)). + +### Changed +- The `ioctl!` macro and its variants now allow the generated functions to have + doccomments. ([#661](https://github.com/nix-rust/nix/pull/661)) +- Changed `ioctl!(write ...)` into `ioctl!(write_ptr ...)` and `ioctl!(write_int ..)` variants + to more clearly separate those use cases. ([#670](https://github.com/nix-rust/nix/pull/670)) +- Marked `sys::mman::{ mmap, munmap, madvise, munlock, msync }` as unsafe. + ([#559](https://github.com/nix-rust/nix/pull/559)) +- Minimum supported Rust version is now 1.13. +- Removed `revents` argument from `PollFd::new()` as it's an output argument and + will be overwritten regardless of value. + ([#542](https://github.com/nix-rust/nix/pull/542)) +- Changed type signature of `sys::select::FdSet::contains` to make `self` + immutable ([#564](https://github.com/nix-rust/nix/pull/564)) +- Introduced wrapper types for `gid_t`, `pid_t`, and `uid_t` as `Gid`, `Pid`, and `Uid` + respectively. Various functions have been changed to use these new types as + arguments. ([#629](https://github.com/nix-rust/nix/pull/629)) +- Fixed compilation on all Android and iOS targets ([#527](https://github.com/nix-rust/nix/pull/527)) + and promoted them to Tier 2 support. +- `nix::sys::statfs::{statfs,fstatfs}` uses statfs definition from `libc::statfs` instead of own linux specific type `nix::sys::Statfs`. + Also file system type constants like `nix::sys::statfs::ADFS_SUPER_MAGIC` were removed in favor of the libc equivalent. + ([#561](https://github.com/nix-rust/nix/pull/561)) +- Revised the termios API including additional tests and documentation and exposed it on iOS. ([#527](https://github.com/nix-rust/nix/pull/527)) +- `eventfd`, `signalfd`, and `pwritev`/`preadv` functionality is now included by default for all + supported platforms. ([#681](https://github.com/nix-rust/nix/pull/561)) +- The `ioctl!` macro's plain variants has been replaced with "bad read" to be consistent with + other variants. The generated functions also have more strict types for their arguments. The + "*_buf" variants also now calculate total array size and take slice references for improved type + safety. The documentation has also been dramatically improved. + ([#670](https://github.com/nix-rust/nix/pull/670)) + +### Removed +- Removed `io::Error` from `nix::Error` and the conversion from `nix::Error` to `Errno` + ([#614](https://github.com/nix-rust/nix/pull/614)) +- All feature flags have been removed in favor of conditional compilation on supported platforms. + `execvpe` is no longer supported, but this was already broken and will be added back in the next + release. ([#681](https://github.com/nix-rust/nix/pull/561)) +- Removed `ioc_*` functions and many helper constants and macros within the `ioctl` module. These + should always have been private and only the `ioctl!` should be used in public code. + ([#670](https://github.com/nix-rust/nix/pull/670)) + +### Fixed +- Fixed multiple issues compiling under different archetectures and OSes. + Now compiles on Linux/MIPS ([#538](https://github.com/nix-rust/nix/pull/538)), + `Linux/PPC` ([#553](https://github.com/nix-rust/nix/pull/553)), + `MacOS/x86_64,i686` ([#553](https://github.com/nix-rust/nix/pull/553)), + `NetBSD/x64_64` ([#538](https://github.com/nix-rust/nix/pull/538)), + `FreeBSD/x86_64,i686` ([#536](https://github.com/nix-rust/nix/pull/536)), and + `Android` ([#631](https://github.com/nix-rust/nix/pull/631)). +- `bind` and `errno_location` now work correctly on `Android` + ([#631](https://github.com/nix-rust/nix/pull/631)) +- Added `nix::ptrace` on all Linux-kernel-based platforms + [#624](https://github.com/nix-rust/nix/pull/624). Previously it was + only available on x86, x86-64, and ARM, and also not on Android. +- Fixed `sys::socket::sendmsg` with zero entry `cmsgs` parameter. + ([#623](https://github.com/nix-rust/nix/pull/623)) +- Multiple constants related to the termios API have now been properly defined for + all supported platforms. ([#527](https://github.com/nix-rust/nix/pull/527)) +- `ioctl!` macro now supports working with non-int datatypes and properly supports all platforms. + ([#670](https://github.com/nix-rust/nix/pull/670)) + +## [0.8.1] 2017-04-16 + +### Fixed +- Fixed build on FreeBSD. (Cherry-picked + [a859ee3c](https://github.com/nix-rust/nix/commit/a859ee3c9396dfdb118fcc2c8ecc697e2d303467)) + +## [0.8.0] 2017-03-02 + +### Added +- Added `::nix::sys::termios::BaudRate` enum to provide portable baudrate + values. ([#518](https://github.com/nix-rust/nix/pull/518)) +- Added a new `WaitStatus::PtraceEvent` to support ptrace events on Linux + and Android ([#438](https://github.com/nix-rust/nix/pull/438)) +- Added support for POSIX AIO + ([#483](https://github.com/nix-rust/nix/pull/483)) + ([#506](https://github.com/nix-rust/nix/pull/506)) +- Added support for XNU system control sockets + ([#478](https://github.com/nix-rust/nix/pull/478)) +- Added support for `ioctl` calls on BSD platforms + ([#478](https://github.com/nix-rust/nix/pull/478)) +- Added struct `TimeSpec` + ([#475](https://github.com/nix-rust/nix/pull/475)) + ([#483](https://github.com/nix-rust/nix/pull/483)) +- Added complete definitions for all kqueue-related constants on all supported + OSes + ([#415](https://github.com/nix-rust/nix/pull/415)) +- Added function `epoll_create1` and bitflags `EpollCreateFlags` in + `::nix::sys::epoll` in order to support `::libc::epoll_create1`. + ([#410](https://github.com/nix-rust/nix/pull/410)) +- Added `setresuid` and `setresgid` for Linux in `::nix::unistd` + ([#448](https://github.com/nix-rust/nix/pull/448)) +- Added `getpgid` in `::nix::unistd` + ([#433](https://github.com/nix-rust/nix/pull/433)) +- Added `tcgetpgrp` and `tcsetpgrp` in `::nix::unistd` + ([#451](https://github.com/nix-rust/nix/pull/451)) +- Added `CLONE_NEWCGROUP` in `::nix::sched` + ([#457](https://github.com/nix-rust/nix/pull/457)) +- Added `getpgrp` in `::nix::unistd` + ([#491](https://github.com/nix-rust/nix/pull/491)) +- Added `fchdir` in `::nix::unistd` + ([#497](https://github.com/nix-rust/nix/pull/497)) +- Added `major` and `minor` in `::nix::sys::stat` for decomposing `dev_t` + ([#508](https://github.com/nix-rust/nix/pull/508)) +- Fixed the style of many bitflags and use `libc` in more places. + ([#503](https://github.com/nix-rust/nix/pull/503)) +- Added `ppoll` in `::nix::poll` + ([#520](https://github.com/nix-rust/nix/pull/520)) +- Added support for getting and setting pipe size with fcntl(2) on Linux + ([#540](https://github.com/nix-rust/nix/pull/540)) + +### Changed +- `::nix::sys::termios::{cfgetispeed, cfsetispeed, cfgetospeed, cfsetospeed}` + switched to use `BaudRate` enum from `speed_t`. + ([#518](https://github.com/nix-rust/nix/pull/518)) +- `epoll_ctl` now could accept None as argument `event` + when op is `EpollOp::EpollCtlDel`. + ([#480](https://github.com/nix-rust/nix/pull/480)) +- Removed the `bad` keyword from the `ioctl!` macro + ([#478](https://github.com/nix-rust/nix/pull/478)) +- Changed `TimeVal` into an opaque Newtype + ([#475](https://github.com/nix-rust/nix/pull/475)) +- `kill`'s signature, defined in `::nix::sys::signal`, changed, so that the + signal parameter has type `T: Into>`. `None` as an argument + for that parameter will result in a 0 passed to libc's `kill`, while a + `Some`-argument will result in the previous behavior for the contained + `Signal`. + ([#445](https://github.com/nix-rust/nix/pull/445)) +- The minimum supported version of rustc is now 1.7.0. + ([#444](https://github.com/nix-rust/nix/pull/444)) +- Changed `KEvent` to an opaque structure that may only be modified by its + constructor and the `ev_set` method. + ([#415](https://github.com/nix-rust/nix/pull/415)) + ([#442](https://github.com/nix-rust/nix/pull/442)) + ([#463](https://github.com/nix-rust/nix/pull/463)) +- `pipe2` now calls `libc::pipe2` where available. Previously it was emulated + using `pipe`, which meant that setting `O_CLOEXEC` was not atomic. + ([#427](https://github.com/nix-rust/nix/pull/427)) +- Renamed `EpollEventKind` to `EpollFlags` in `::nix::sys::epoll` in order for + it to conform with our conventions. + ([#410](https://github.com/nix-rust/nix/pull/410)) +- `EpollEvent` in `::nix::sys::epoll` is now an opaque proxy for + `::libc::epoll_event`. The formerly public field `events` is now be read-only + accessible with the new method `events()` of `EpollEvent`. Instances of + `EpollEvent` can be constructed using the new method `new()` of EpollEvent. + ([#410](https://github.com/nix-rust/nix/pull/410)) +- `SigFlags` in `::nix::sys::signal` has be renamed to `SigmaskHow` and its type + has changed from `bitflags` to `enum` in order to conform to our conventions. + ([#460](https://github.com/nix-rust/nix/pull/460)) +- `sethostname` now takes a `&str` instead of a `&[u8]` as this provides an API + that makes more sense in normal, correct usage of the API. +- `gethostname` previously did not expose the actual length of the hostname + written from the underlying system call at all. This has been updated to + return a `&CStr` within the provided buffer that is always properly + NUL-terminated (this is not guaranteed by the call with all platforms/libc + implementations). +- Exposed all fcntl(2) operations at the module level, so they can be + imported direclty instead of via `FcntlArg` enum. + ([#541](https://github.com/nix-rust/nix/pull/541)) + +### Fixed +- Fixed multiple issues with Unix domain sockets on non-Linux OSes + ([#474](https://github.com/nix-rust/nix/pull/415)) +- Fixed using kqueue with `EVFILT_USER` on FreeBSD + ([#415](https://github.com/nix-rust/nix/pull/415)) +- Fixed the build on FreeBSD, and fixed the getsockopt, sendmsg, and recvmsg + functions on that same OS. + ([#397](https://github.com/nix-rust/nix/pull/397)) +- Fixed an off-by-one bug in `UnixAddr::new_abstract` in `::nix::sys::socket`. + ([#429](https://github.com/nix-rust/nix/pull/429)) +- Fixed clone passing a potentially unaligned stack. + ([#490](https://github.com/nix-rust/nix/pull/490)) +- Fixed mkdev not creating a `dev_t` the same way as libc. + ([#508](https://github.com/nix-rust/nix/pull/508)) + +## [0.7.0] 2016-09-09 + +### Added +- Added `lseek` and `lseek64` in `::nix::unistd` + ([#377](https://github.com/nix-rust/nix/pull/377)) +- Added `mkdir` and `getcwd` in `::nix::unistd` + ([#416](https://github.com/nix-rust/nix/pull/416)) +- Added accessors `sigmask_mut` and `sigmask` to `UContext` in + `::nix::ucontext`. + ([#370](https://github.com/nix-rust/nix/pull/370)) +- Added `WUNTRACED` to `WaitPidFlag` in `::nix::sys::wait` for non-_linux_ + targets. + ([#379](https://github.com/nix-rust/nix/pull/379)) +- Added new module `::nix::sys::reboot` with enumeration `RebootMode` and + functions `reboot` and `set_cad_enabled`. Currently for _linux_ only. + ([#386](https://github.com/nix-rust/nix/pull/386)) +- `FdSet` in `::nix::sys::select` now also implements `Clone`. + ([#405](https://github.com/nix-rust/nix/pull/405)) +- Added `F_FULLFSYNC` to `FcntlArg` in `::nix::fcntl` for _apple_ targets. + ([#407](https://github.com/nix-rust/nix/pull/407)) +- Added `CpuSet::unset` in `::nix::sched`. + ([#402](https://github.com/nix-rust/nix/pull/402)) +- Added constructor method `new()` to `PollFd` in `::nix::poll`, in order to + allow creation of objects, after removing public access to members. + ([#399](https://github.com/nix-rust/nix/pull/399)) +- Added method `revents()` to `PollFd` in `::nix::poll`, in order to provide + read access to formerly public member `revents`. + ([#399](https://github.com/nix-rust/nix/pull/399)) +- Added `MSG_CMSG_CLOEXEC` to `MsgFlags` in `::nix::sys::socket` for _linux_ only. + ([#422](https://github.com/nix-rust/nix/pull/422)) + +### Changed +- Replaced the reexported integer constants for signals by the enumeration + `Signal` in `::nix::sys::signal`. + ([#362](https://github.com/nix-rust/nix/pull/362)) +- Renamed `EventFdFlag` to `EfdFlags` in `::nix::sys::eventfd`. + ([#383](https://github.com/nix-rust/nix/pull/383)) +- Changed the result types of `CpuSet::is_set` and `CpuSet::set` in + `::nix::sched` to `Result` and `Result<()>`, respectively. They now + return `EINVAL`, if an invalid argument for the `field` parameter is passed. + ([#402](https://github.com/nix-rust/nix/pull/402)) +- `MqAttr` in `::nix::mqueue` is now an opaque proxy for `::libc::mq_attr`, + which has the same structure as the old `MqAttr`. The field `mq_flags` of + `::libc::mq_attr` is readable using the new method `flags()` of `MqAttr`. + `MqAttr` also no longer implements `Debug`. + ([#392](https://github.com/nix-rust/nix/pull/392)) +- The parameter `msq_prio` of `mq_receive` with type `u32` in `::nix::mqueue` + was replaced by a parameter named `msg_prio` with type `&mut u32`, so that + the message priority can be obtained by the caller. + ([#392](https://github.com/nix-rust/nix/pull/392)) +- The type alias `MQd` in `::nix::queue` was replaced by the type alias + `libc::mqd_t`, both of which are aliases for the same type. + ([#392](https://github.com/nix-rust/nix/pull/392)) + +### Removed +- Type alias `SigNum` from `::nix::sys::signal`. + ([#362](https://github.com/nix-rust/nix/pull/362)) +- Type alias `CpuMask` from `::nix::shed`. + ([#402](https://github.com/nix-rust/nix/pull/402)) +- Removed public fields from `PollFd` in `::nix::poll`. (See also added method + `revents()`. + ([#399](https://github.com/nix-rust/nix/pull/399)) + +### Fixed +- Fixed the build problem for NetBSD (Note, that we currently do not support + it, so it might already be broken again). + ([#389](https://github.com/nix-rust/nix/pull/389)) +- Fixed the build on FreeBSD, and fixed the getsockopt, sendmsg, and recvmsg + functions on that same OS. + ([#397](https://github.com/nix-rust/nix/pull/397)) + +## [0.6.0] 2016-06-10 + +### Added +- Added `gettid` in `::nix::unistd` for _linux_ and _android_. + ([#293](https://github.com/nix-rust/nix/pull/293)) +- Some _mips_ support in `::nix::sched` and `::nix::sys::syscall`. + ([#301](https://github.com/nix-rust/nix/pull/301)) +- Added `SIGNALFD_SIGINFO_SIZE` in `::nix::sys::signalfd`. + ([#309](https://github.com/nix-rust/nix/pull/309)) +- Added new module `::nix::ucontext` with struct `UContext`. Currently for + _linux_ only. + ([#311](https://github.com/nix-rust/nix/pull/311)) +- Added `EPOLLEXCLUSIVE` to `EpollEventKind` in `::nix::sys::epoll`. + ([#330](https://github.com/nix-rust/nix/pull/330)) +- Added `pause` to `::nix::unistd`. + ([#336](https://github.com/nix-rust/nix/pull/336)) +- Added `sleep` to `::nix::unistd`. + ([#351](https://github.com/nix-rust/nix/pull/351)) +- Added `S_IFDIR`, `S_IFLNK`, `S_IFMT` to `SFlag` in `::nix::sys::stat`. + ([#359](https://github.com/nix-rust/nix/pull/359)) +- Added `clear` and `extend` functions to `SigSet`'s implementation in + `::nix::sys::signal`. + ([#347](https://github.com/nix-rust/nix/pull/347)) +- `sockaddr_storage_to_addr` in `::nix::sys::socket` now supports `sockaddr_nl` + on _linux_ and _android_. + ([#366](https://github.com/nix-rust/nix/pull/366)) +- Added support for `SO_ORIGINAL_DST` in `::nix::sys::socket` on _linux_. + ([#367](https://github.com/nix-rust/nix/pull/367)) +- Added `SIGINFO` in `::nix::sys::signal` for the _macos_ target as well as + `SIGPWR` and `SIGSTKFLT` in `::nix::sys::signal` for non-_macos_ targets. + ([#361](https://github.com/nix-rust/nix/pull/361)) + +### Changed +- Changed the structure `IoVec` in `::nix::sys::uio`. + ([#304](https://github.com/nix-rust/nix/pull/304)) +- Replaced `CREATE_NEW_FD` by `SIGNALFD_NEW` in `::nix::sys::signalfd`. + ([#309](https://github.com/nix-rust/nix/pull/309)) +- Renamed `SaFlag` to `SaFlags` and `SigFlag` to `SigFlags` in + `::nix::sys::signal`. + ([#314](https://github.com/nix-rust/nix/pull/314)) +- Renamed `Fork` to `ForkResult` and changed its fields in `::nix::unistd`. + ([#332](https://github.com/nix-rust/nix/pull/332)) +- Added the `signal` parameter to `clone`'s signature in `::nix::sched`. + ([#344](https://github.com/nix-rust/nix/pull/344)) +- `execv`, `execve`, and `execvp` now return `Result` instead of + `Result<()>` in `::nix::unistd`. + ([#357](https://github.com/nix-rust/nix/pull/357)) + +### Fixed +- Improved the conversion from `std::net::SocketAddr` to `InetAddr` in + `::nix::sys::socket::addr`. + ([#335](https://github.com/nix-rust/nix/pull/335)) + +## [0.5.0] 2016-03-01 diff --git a/bash-5.1/vendor/nix-0.24.2/Cargo.toml b/bash-5.1/vendor/nix-0.24.2/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..2bcd0f07d463d9cc2ebe8818daabb7ffdc5dfb8b --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/Cargo.toml @@ -0,0 +1,182 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2018" +rust-version = "1.46" +name = "nix" +version = "0.24.2" +authors = ["The nix-rust Project Developers"] +include = [ + "src/**/*", + "test/**/*", + "LICENSE", + "README.md", + "CHANGELOG.md", +] +description = "Rust friendly bindings to *nix APIs" +readme = "README.md" +categories = ["os::unix-apis"] +license = "MIT" +repository = "https://github.com/nix-rust/nix" + +[package.metadata.docs.rs] +rustdoc-args = [ + "--cfg", + "docsrs", +] +targets = [ + "x86_64-unknown-linux-gnu", + "aarch64-linux-android", + "x86_64-apple-darwin", + "aarch64-apple-ios", + "x86_64-unknown-freebsd", + "x86_64-unknown-openbsd", + "x86_64-unknown-netbsd", + "x86_64-unknown-dragonfly", + "x86_64-fuchsia", + "x86_64-unknown-redox", + "x86_64-unknown-illumos", +] + +[[test]] +name = "test" +path = "test/test.rs" + +[[test]] +name = "test-aio-drop" +path = "test/sys/test_aio_drop.rs" + +[[test]] +name = "test-clearenv" +path = "test/test_clearenv.rs" + +[[test]] +name = "test-lio-listio-resubmit" +path = "test/sys/test_lio_listio_resubmit.rs" + +[[test]] +name = "test-mount" +path = "test/test_mount.rs" +harness = false + +[[test]] +name = "test-ptymaster-drop" +path = "test/test_ptymaster_drop.rs" + +[dependencies.bitflags] +version = "1.1" + +[dependencies.cfg-if] +version = "1.0" + +[dependencies.libc] +version = "0.2.121" +features = ["extra_traits"] + +[dev-dependencies.assert-impl] +version = "0.1" + +[dev-dependencies.lazy_static] +version = "1.2" + +[dev-dependencies.parking_lot] +version = "0.11.2" + +[dev-dependencies.rand] +version = "0.8" + +[dev-dependencies.semver] +version = "1.0.0" + +[dev-dependencies.tempfile] +version = "3.2.0" + +[features] +acct = [] +aio = [] +default = [ + "acct", + "aio", + "dir", + "env", + "event", + "feature", + "fs", + "hostname", + "inotify", + "ioctl", + "kmod", + "mman", + "mount", + "mqueue", + "net", + "personality", + "poll", + "process", + "pthread", + "ptrace", + "quota", + "reboot", + "resource", + "sched", + "signal", + "socket", + "term", + "time", + "ucontext", + "uio", + "user", + "zerocopy", +] +dir = ["fs"] +env = [] +event = [] +feature = [] +fs = [] +hostname = [] +inotify = [] +ioctl = [] +kmod = [] +mman = [] +mount = ["uio"] +mqueue = ["fs"] +net = ["socket"] +personality = [] +poll = [] +process = [] +pthread = [] +ptrace = ["process"] +quota = [] +reboot = [] +resource = [] +sched = ["process"] +signal = ["process"] +socket = ["memoffset"] +term = [] +time = [] +ucontext = ["signal"] +uio = [] +user = ["feature"] +zerocopy = [ + "fs", + "uio", +] + +[target."cfg(any(target_os = \"android\", target_os = \"linux\"))".dev-dependencies.caps] +version = "0.5.1" + +[target."cfg(not(target_os = \"redox\"))".dependencies.memoffset] +version = "0.6.3" +optional = true + +[target."cfg(target_os = \"freebsd\")".dev-dependencies.sysctl] +version = "0.1" diff --git a/bash-5.1/vendor/nix-0.24.2/LICENSE b/bash-5.1/vendor/nix-0.24.2/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..aff9096fdf11d161613202fe9329fcfa5e35d212 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Carl Lerche + nix-rust Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/bash-5.1/vendor/nix-0.24.2/README.md b/bash-5.1/vendor/nix-0.24.2/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b0c27b16f34c30f847448a5c7fa7ac49b3ee3495 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/README.md @@ -0,0 +1,104 @@ +# Rust bindings to *nix APIs + +[![Cirrus Build Status](https://api.cirrus-ci.com/github/nix-rust/nix.svg)](https://cirrus-ci.com/github/nix-rust/nix) +[![crates.io](https://img.shields.io/crates/v/nix.svg)](https://crates.io/crates/nix) + +[Documentation (Releases)](https://docs.rs/nix/) + +Nix seeks to provide friendly bindings to various *nix platform APIs (Linux, Darwin, +...). The goal is to not provide a 100% unified interface, but to unify +what can be while still providing platform specific APIs. + +For many system APIs, Nix provides a safe alternative to the unsafe APIs +exposed by the [libc crate](https://github.com/rust-lang/libc). This is done by +wrapping the libc functionality with types/abstractions that enforce legal/safe +usage. + + +As an example of what Nix provides, examine the differences between what is +exposed by libc and nix for the +[gethostname](https://man7.org/linux/man-pages/man2/gethostname.2.html) system +call: + +```rust,ignore +// libc api (unsafe, requires handling return code/errno) +pub unsafe extern fn gethostname(name: *mut c_char, len: size_t) -> c_int; + +// nix api (returns a nix::Result) +pub fn gethostname<'a>(buffer: &'a mut [u8]) -> Result<&'a CStr>; +``` + +## Supported Platforms + +nix target support consists of two tiers. While nix attempts to support all +platforms supported by [libc](https://github.com/rust-lang/libc), only some +platforms are actively supported due to either technical or manpower +limitations. Support for platforms is split into three tiers: + + * Tier 1 - Builds and tests for this target are run in CI. Failures of either + block the inclusion of new code. + * Tier 2 - Builds for this target are run in CI. Failures during the build + blocks the inclusion of new code. Tests may be run, but failures + in tests don't block the inclusion of new code. + * Tier 3 - Builds for this target are run in CI. Failures during the build + *do not* block the inclusion of new code. Testing may be run, but + failures in tests don't block the inclusion of new code. + +The following targets are supported by `nix`: + +Tier 1: + * aarch64-unknown-linux-gnu + * arm-unknown-linux-gnueabi + * armv7-unknown-linux-gnueabihf + * i686-unknown-freebsd + * i686-unknown-linux-gnu + * i686-unknown-linux-musl + * mips-unknown-linux-gnu + * mips64-unknown-linux-gnuabi64 + * mips64el-unknown-linux-gnuabi64 + * mipsel-unknown-linux-gnu + * powerpc64le-unknown-linux-gnu + * x86_64-apple-darwin + * x86_64-unknown-freebsd + * x86_64-unknown-linux-gnu + * x86_64-unknown-linux-musl + +Tier 2: + * aarch64-apple-darwin + * aarch64-apple-ios + * aarch64-linux-android + * arm-linux-androideabi + * arm-unknown-linux-musleabi + * armv7-linux-androideabi + * i686-linux-android + * powerpc-unknown-linux-gnu + * s390x-unknown-linux-gnu + * x86_64-apple-ios + * x86_64-linux-android + * x86_64-unknown-illumos + * x86_64-unknown-netbsd + +Tier 3: + * armv7-unknown-linux-uclibceabihf + * x86_64-fuchsia + * x86_64-unknown-dragonfly + * x86_64-unknown-linux-gnux32 + * x86_64-unknown-openbsd + * x86_64-unknown-redox + +## Minimum Supported Rust Version (MSRV) + +nix is supported on Rust 1.46.0 and higher. Its MSRV will not be +changed in the future without bumping the major or minor version. + +## Contributing + +Contributions are very welcome. Please See [CONTRIBUTING](CONTRIBUTING.md) for +additional details. + +Feel free to join us in [the nix-rust/nix](https://gitter.im/nix-rust/nix) channel on Gitter to +discuss `nix` development. + +## License + +Nix is licensed under the MIT license. See [LICENSE](LICENSE) for more details. diff --git a/bash-5.1/vendor/nix-0.24.2/src/dir.rs b/bash-5.1/vendor/nix-0.24.2/src/dir.rs new file mode 100644 index 0000000000000000000000000000000000000000..396b54fb031dee7a80f8faf230947e63a4879de6 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/dir.rs @@ -0,0 +1,245 @@ +use crate::{Error, NixPath, Result}; +use crate::errno::Errno; +use crate::fcntl::{self, OFlag}; +use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd}; +use std::ptr; +use std::ffi; +use crate::sys; +use cfg_if::cfg_if; + +#[cfg(target_os = "linux")] +use libc::{dirent64 as dirent, readdir64_r as readdir_r}; + +#[cfg(not(target_os = "linux"))] +use libc::{dirent, readdir_r}; + +/// An open directory. +/// +/// This is a lower-level interface than `std::fs::ReadDir`. Notable differences: +/// * can be opened from a file descriptor (as returned by `openat`, perhaps before knowing +/// if the path represents a file or directory). +/// * implements `AsRawFd`, so it can be passed to `fstat`, `openat`, etc. +/// The file descriptor continues to be owned by the `Dir`, so callers must not keep a `RawFd` +/// after the `Dir` is dropped. +/// * can be iterated through multiple times without closing and reopening the file +/// descriptor. Each iteration rewinds when finished. +/// * returns entries for `.` (current directory) and `..` (parent directory). +/// * returns entries' names as a `CStr` (no allocation or conversion beyond whatever libc +/// does). +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct Dir( + ptr::NonNull +); + +impl Dir { + /// Opens the given path as with `fcntl::open`. + pub fn open(path: &P, oflag: OFlag, + mode: sys::stat::Mode) -> Result { + let fd = fcntl::open(path, oflag, mode)?; + Dir::from_fd(fd) + } + + /// Opens the given path as with `fcntl::openat`. + pub fn openat(dirfd: RawFd, path: &P, oflag: OFlag, + mode: sys::stat::Mode) -> Result { + let fd = fcntl::openat(dirfd, path, oflag, mode)?; + Dir::from_fd(fd) + } + + /// Converts from a descriptor-based object, closing the descriptor on success or failure. + #[inline] + pub fn from(fd: F) -> Result { + Dir::from_fd(fd.into_raw_fd()) + } + + /// Converts from a file descriptor, closing it on success or failure. + pub fn from_fd(fd: RawFd) -> Result { + let d = ptr::NonNull::new(unsafe { libc::fdopendir(fd) }).ok_or_else(|| { + let e = Error::last(); + unsafe { libc::close(fd) }; + e + })?; + Ok(Dir(d)) + } + + /// Returns an iterator of `Result` which rewinds when finished. + pub fn iter(&mut self) -> Iter { + Iter(self) + } +} + +// `Dir` is not `Sync`. With the current implementation, it could be, but according to +// https://www.gnu.org/software/libc/manual/html_node/Reading_002fClosing-Directory.html, +// future versions of POSIX are likely to obsolete `readdir_r` and specify that it's unsafe to +// call `readdir` simultaneously from multiple threads. +// +// `Dir` is safe to pass from one thread to another, as it's not reference-counted. +unsafe impl Send for Dir {} + +impl AsRawFd for Dir { + fn as_raw_fd(&self) -> RawFd { + unsafe { libc::dirfd(self.0.as_ptr()) } + } +} + +impl Drop for Dir { + fn drop(&mut self) { + let e = Errno::result(unsafe { libc::closedir(self.0.as_ptr()) }); + if !std::thread::panicking() && e == Err(Errno::EBADF) { + panic!("Closing an invalid file descriptor!"); + }; + } +} + +fn next(dir: &mut Dir) -> Option> { + unsafe { + // Note: POSIX specifies that portable applications should dynamically allocate a + // buffer with room for a `d_name` field of size `pathconf(..., _PC_NAME_MAX)` plus 1 + // for the NUL byte. It doesn't look like the std library does this; it just uses + // fixed-sized buffers (and libc's dirent seems to be sized so this is appropriate). + // Probably fine here too then. + let mut ent = std::mem::MaybeUninit::::uninit(); + let mut result = ptr::null_mut(); + if let Err(e) = Errno::result( + readdir_r(dir.0.as_ptr(), ent.as_mut_ptr(), &mut result)) + { + return Some(Err(e)); + } + if result.is_null() { + return None; + } + assert_eq!(result, ent.as_mut_ptr()); + Some(Ok(Entry(ent.assume_init()))) + } +} + +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct Iter<'d>(&'d mut Dir); + +impl<'d> Iterator for Iter<'d> { + type Item = Result; + + fn next(&mut self) -> Option { + next(self.0) + } +} + +impl<'d> Drop for Iter<'d> { + fn drop(&mut self) { + unsafe { libc::rewinddir((self.0).0.as_ptr()) } + } +} + +/// The return type of [Dir::into_iter] +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct OwningIter(Dir); + +impl Iterator for OwningIter { + type Item = Result; + + fn next(&mut self) -> Option { + next(&mut self.0) + } +} + +/// The file descriptor continues to be owned by the `OwningIter`, +/// so callers must not keep a `RawFd` after the `OwningIter` is dropped. +impl AsRawFd for OwningIter { + fn as_raw_fd(&self) -> RawFd { + self.0.as_raw_fd() + } +} + +impl IntoIterator for Dir { + type Item = Result; + type IntoIter = OwningIter; + + /// Creates a owning iterator, that is, one that takes ownership of the + /// `Dir`. The `Dir` cannot be used after calling this. This can be useful + /// when you have a function that both creates a `Dir` instance and returns + /// an `Iterator`. + /// + /// Example: + /// + /// ``` + /// use nix::{dir::Dir, fcntl::OFlag, sys::stat::Mode}; + /// use std::{iter::Iterator, string::String}; + /// + /// fn ls_upper(dirname: &str) -> impl Iterator { + /// let d = Dir::open(dirname, OFlag::O_DIRECTORY, Mode::S_IXUSR).unwrap(); + /// d.into_iter().map(|x| x.unwrap().file_name().as_ref().to_string_lossy().to_ascii_uppercase()) + /// } + /// ``` + fn into_iter(self) -> Self::IntoIter { + OwningIter(self) + } +} + +/// A directory entry, similar to `std::fs::DirEntry`. +/// +/// Note that unlike the std version, this may represent the `.` or `..` entries. +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct Entry(dirent); + +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] +pub enum Type { + Fifo, + CharacterDevice, + Directory, + BlockDevice, + File, + Symlink, + Socket, +} + +impl Entry { + /// Returns the inode number (`d_ino`) of the underlying `dirent`. + #[allow(clippy::useless_conversion)] // Not useless on all OSes + pub fn ino(&self) -> u64 { + cfg_if! { + if #[cfg(any(target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "ios", + target_os = "l4re", + target_os = "linux", + target_os = "macos", + target_os = "solaris"))] { + self.0.d_ino as u64 + } else { + u64::from(self.0.d_fileno) + } + } + } + + /// Returns the bare file name of this directory entry without any other leading path component. + pub fn file_name(&self) -> &ffi::CStr { + unsafe { ::std::ffi::CStr::from_ptr(self.0.d_name.as_ptr()) } + } + + /// Returns the type of this directory entry, if known. + /// + /// See platform `readdir(3)` or `dirent(5)` manpage for when the file type is known; + /// notably, some Linux filesystems don't implement this. The caller should use `stat` or + /// `fstat` if this returns `None`. + pub fn file_type(&self) -> Option { + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + match self.0.d_type { + libc::DT_FIFO => Some(Type::Fifo), + libc::DT_CHR => Some(Type::CharacterDevice), + libc::DT_DIR => Some(Type::Directory), + libc::DT_BLK => Some(Type::BlockDevice), + libc::DT_REG => Some(Type::File), + libc::DT_LNK => Some(Type::Symlink), + libc::DT_SOCK => Some(Type::Socket), + /* libc::DT_UNKNOWN | */ _ => None, + } + + // illumos and Solaris systems do not have the d_type member at all: + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + None + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/env.rs b/bash-5.1/vendor/nix-0.24.2/src/env.rs new file mode 100644 index 0000000000000000000000000000000000000000..bcae28713edb90edb54c24b0d1bcaa9e6d254f6d --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/env.rs @@ -0,0 +1,65 @@ +//! Environment variables +use cfg_if::cfg_if; +use std::fmt; + +/// Indicates that [`clearenv`] failed for some unknown reason +#[derive(Clone, Copy, Debug)] +pub struct ClearEnvError; + +impl fmt::Display for ClearEnvError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "clearenv failed") + } +} + +impl std::error::Error for ClearEnvError {} + +/// Clear the environment of all name-value pairs. +/// +/// On platforms where libc provides `clearenv()`, it will be used. libc's +/// `clearenv()` is documented to return an error code but not set errno; if the +/// return value indicates a failure, this function will return +/// [`ClearEnvError`]. +/// +/// On platforms where libc does not provide `clearenv()`, a fallback +/// implementation will be used that iterates over all environment variables and +/// removes them one-by-one. +/// +/// # Safety +/// +/// This function is not threadsafe and can cause undefined behavior in +/// combination with `std::env` or other program components that access the +/// environment. See, for example, the discussion on `std::env::remove_var`; this +/// function is a case of an "inherently unsafe non-threadsafe API" dealing with +/// the environment. +/// +/// The caller must ensure no other threads access the process environment while +/// this function executes and that no raw pointers to an element of libc's +/// `environ` is currently held. The latter is not an issue if the only other +/// environment access in the program is via `std::env`, but the requirement on +/// thread safety must still be upheld. +pub unsafe fn clearenv() -> std::result::Result<(), ClearEnvError> { + cfg_if! { + if #[cfg(any(target_os = "fuchsia", + target_os = "wasi", + target_env = "wasi", + target_env = "uclibc", + target_os = "linux", + target_os = "android", + target_os = "emscripten"))] { + let ret = libc::clearenv(); + } else { + use std::env; + for (name, _) in env::vars_os() { + env::remove_var(name); + } + let ret = 0; + } + } + + if ret == 0 { + Ok(()) + } else { + Err(ClearEnvError) + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/errno.rs b/bash-5.1/vendor/nix-0.24.2/src/errno.rs new file mode 100644 index 0000000000000000000000000000000000000000..17744fe22a1a409d39acff71188a7ec9392ec132 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/errno.rs @@ -0,0 +1,2727 @@ +use cfg_if::cfg_if; +use libc::{c_int, c_void}; +use std::convert::TryFrom; +use std::{fmt, io, error}; +use crate::{Error, Result}; + +pub use self::consts::*; + +cfg_if! { + if #[cfg(any(target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] { + unsafe fn errno_location() -> *mut c_int { + libc::__error() + } + } else if #[cfg(any(target_os = "android", + target_os = "netbsd", + target_os = "openbsd"))] { + unsafe fn errno_location() -> *mut c_int { + libc::__errno() + } + } else if #[cfg(any(target_os = "linux", + target_os = "redox", + target_os = "dragonfly", + target_os = "fuchsia"))] { + unsafe fn errno_location() -> *mut c_int { + libc::__errno_location() + } + } else if #[cfg(any(target_os = "illumos", target_os = "solaris"))] { + unsafe fn errno_location() -> *mut c_int { + libc::___errno() + } + } +} + +/// Sets the platform-specific errno to no-error +fn clear() { + // Safe because errno is a thread-local variable + unsafe { + *errno_location() = 0; + } +} + +/// Returns the platform-specific value of errno +pub fn errno() -> i32 { + unsafe { + (*errno_location()) as i32 + } +} + +impl Errno { + /// Convert this `Error` to an [`Errno`](enum.Errno.html). + /// + /// # Example + /// + /// ``` + /// # use nix::Error; + /// # use nix::errno::Errno; + /// let e = Error::from(Errno::EPERM); + /// assert_eq!(Some(Errno::EPERM), e.as_errno()); + /// ``` + #[deprecated( + since = "0.22.0", + note = "It's a no-op now; just delete it." + )] + pub const fn as_errno(self) -> Option { + Some(self) + } + + /// Create a nix Error from a given errno + #[deprecated( + since = "0.22.0", + note = "It's a no-op now; just delete it." + )] + #[allow(clippy::wrong_self_convention)] // False positive + pub fn from_errno(errno: Errno) -> Error { + errno + } + + /// Create a new invalid argument error (`EINVAL`) + #[deprecated( + since = "0.22.0", + note = "Use Errno::EINVAL instead" + )] + pub const fn invalid_argument() -> Error { + Errno::EINVAL + } + + pub fn last() -> Self { + last() + } + + pub fn desc(self) -> &'static str { + desc(self) + } + + pub const fn from_i32(err: i32) -> Errno { + from_i32(err) + } + + pub fn clear() { + clear() + } + + /// Returns `Ok(value)` if it does not contain the sentinel value. This + /// should not be used when `-1` is not the errno sentinel value. + #[inline] + pub fn result>(value: S) -> Result { + if value == S::sentinel() { + Err(Self::last()) + } else { + Ok(value) + } + } + + /// Backwards compatibility hack for Nix <= 0.21.0 users + /// + /// In older versions of Nix, `Error::Sys` was an enum variant. Now it's a + /// function, which is compatible with most of the former use cases of the + /// enum variant. But you should use `Error(Errno::...)` instead. + #[deprecated( + since = "0.22.0", + note = "Use Errno::... instead" + )] + #[allow(non_snake_case)] + #[inline] + pub const fn Sys(errno: Errno) -> Error { + errno + } +} + +/// The sentinel value indicates that a function failed and more detailed +/// information about the error can be found in `errno` +pub trait ErrnoSentinel: Sized { + fn sentinel() -> Self; +} + +impl ErrnoSentinel for isize { + fn sentinel() -> Self { -1 } +} + +impl ErrnoSentinel for i32 { + fn sentinel() -> Self { -1 } +} + +impl ErrnoSentinel for i64 { + fn sentinel() -> Self { -1 } +} + +impl ErrnoSentinel for *mut c_void { + fn sentinel() -> Self { -1isize as *mut c_void } +} + +impl ErrnoSentinel for libc::sighandler_t { + fn sentinel() -> Self { libc::SIG_ERR } +} + +impl error::Error for Errno {} + +impl fmt::Display for Errno { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{:?}: {}", self, self.desc()) + } +} + +impl From for io::Error { + fn from(err: Errno) -> Self { + io::Error::from_raw_os_error(err as i32) + } +} + +impl TryFrom for Errno { + type Error = io::Error; + + fn try_from(ioerror: io::Error) -> std::result::Result { + ioerror.raw_os_error() + .map(Errno::from_i32) + .ok_or(ioerror) + } +} + +fn last() -> Errno { + Errno::from_i32(errno()) +} + +fn desc(errno: Errno) -> &'static str { + use self::Errno::*; + match errno { + UnknownErrno => "Unknown errno", + EPERM => "Operation not permitted", + ENOENT => "No such file or directory", + ESRCH => "No such process", + EINTR => "Interrupted system call", + EIO => "I/O error", + ENXIO => "No such device or address", + E2BIG => "Argument list too long", + ENOEXEC => "Exec format error", + EBADF => "Bad file number", + ECHILD => "No child processes", + EAGAIN => "Try again", + ENOMEM => "Out of memory", + EACCES => "Permission denied", + EFAULT => "Bad address", + ENOTBLK => "Block device required", + EBUSY => "Device or resource busy", + EEXIST => "File exists", + EXDEV => "Cross-device link", + ENODEV => "No such device", + ENOTDIR => "Not a directory", + EISDIR => "Is a directory", + EINVAL => "Invalid argument", + ENFILE => "File table overflow", + EMFILE => "Too many open files", + ENOTTY => "Not a typewriter", + ETXTBSY => "Text file busy", + EFBIG => "File too large", + ENOSPC => "No space left on device", + ESPIPE => "Illegal seek", + EROFS => "Read-only file system", + EMLINK => "Too many links", + EPIPE => "Broken pipe", + EDOM => "Math argument out of domain of func", + ERANGE => "Math result not representable", + EDEADLK => "Resource deadlock would occur", + ENAMETOOLONG => "File name too long", + ENOLCK => "No record locks available", + ENOSYS => "Function not implemented", + ENOTEMPTY => "Directory not empty", + ELOOP => "Too many symbolic links encountered", + ENOMSG => "No message of desired type", + EIDRM => "Identifier removed", + EINPROGRESS => "Operation now in progress", + EALREADY => "Operation already in progress", + ENOTSOCK => "Socket operation on non-socket", + EDESTADDRREQ => "Destination address required", + EMSGSIZE => "Message too long", + EPROTOTYPE => "Protocol wrong type for socket", + ENOPROTOOPT => "Protocol not available", + EPROTONOSUPPORT => "Protocol not supported", + ESOCKTNOSUPPORT => "Socket type not supported", + EPFNOSUPPORT => "Protocol family not supported", + EAFNOSUPPORT => "Address family not supported by protocol", + EADDRINUSE => "Address already in use", + EADDRNOTAVAIL => "Cannot assign requested address", + ENETDOWN => "Network is down", + ENETUNREACH => "Network is unreachable", + ENETRESET => "Network dropped connection because of reset", + ECONNABORTED => "Software caused connection abort", + ECONNRESET => "Connection reset by peer", + ENOBUFS => "No buffer space available", + EISCONN => "Transport endpoint is already connected", + ENOTCONN => "Transport endpoint is not connected", + ESHUTDOWN => "Cannot send after transport endpoint shutdown", + ETOOMANYREFS => "Too many references: cannot splice", + ETIMEDOUT => "Connection timed out", + ECONNREFUSED => "Connection refused", + EHOSTDOWN => "Host is down", + EHOSTUNREACH => "No route to host", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ECHRNG => "Channel number out of range", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL2NSYNC => "Level 2 not synchronized", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL3HLT => "Level 3 halted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL3RST => "Level 3 reset", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELNRNG => "Link number out of range", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EUNATCH => "Protocol driver not attached", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOCSI => "No CSI structure available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EL2HLT => "Level 2 halted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADE => "Invalid exchange", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADR => "Invalid request descriptor", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EXFULL => "Exchange full", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOANO => "No anode", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADRQC => "Invalid request code", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADSLT => "Invalid slot", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBFONT => "Bad font file format", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOSTR => "Device not a stream", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENODATA => "No data available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ETIME => "Timer expired", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOSR => "Out of streams resources", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENONET => "Machine is not on the network", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOPKG => "Package not installed", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EREMOTE => "Object is remote", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOLINK => "Link has been severed", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EADV => "Advertise error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ESRMNT => "Srmount error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ECOMM => "Communication error on send", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EPROTO => "Protocol error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EMULTIHOP => "Multihop attempted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EDOTDOT => "RFS specific error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EBADMSG => "Not a data message", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + EBADMSG => "Trying to read unreadable message", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EOVERFLOW => "Value too large for defined data type", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ENOTUNIQ => "Name not unique on network", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EBADFD => "File descriptor in bad state", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EREMCHG => "Remote address changed", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBACC => "Can not access a needed shared library", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBBAD => "Accessing a corrupted shared library", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBSCN => ".lib section in a.out corrupted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBMAX => "Attempting to link in too many shared libraries", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ELIBEXEC => "Cannot exec a shared library directly", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia", target_os = "openbsd"))] + EILSEQ => "Illegal byte sequence", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ERESTART => "Interrupted system call should be restarted", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ESTRPIPE => "Streams pipe error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + EUSERS => "Too many users", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "netbsd", + target_os = "redox"))] + EOPNOTSUPP => "Operation not supported on transport endpoint", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ESTALE => "Stale file handle", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EUCLEAN => "Structure needs cleaning", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENOTNAM => "Not a XENIX named type file", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENAVAIL => "No XENIX semaphores available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EISNAM => "Is a named type file", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EREMOTEIO => "Remote I/O error", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EDQUOT => "Quota exceeded", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "openbsd", + target_os = "dragonfly"))] + ENOMEDIUM => "No medium found", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "openbsd"))] + EMEDIUMTYPE => "Wrong medium type", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "illumos", target_os = "solaris", + target_os = "fuchsia"))] + ECANCELED => "Operation canceled", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENOKEY => "Required key not available", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EKEYEXPIRED => "Key has expired", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EKEYREVOKED => "Key has been revoked", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EKEYREJECTED => "Key was rejected by service", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + EOWNERDEAD => "Owner died", + + #[cfg(any( target_os = "illumos", target_os = "solaris"))] + EOWNERDEAD => "Process died with lock", + + #[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] + ENOTRECOVERABLE => "State not recoverable", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + ENOTRECOVERABLE => "Lock is not recoverable", + + #[cfg(any(all(target_os = "linux", not(target_arch="mips")), + target_os = "fuchsia"))] + ERFKILL => "Operation not possible due to RF-kill", + + #[cfg(any(all(target_os = "linux", not(target_arch="mips")), + target_os = "fuchsia"))] + EHWPOISON => "Memory page has hardware error", + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + EDOOFUS => "Programming error", + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly", target_os = "redox"))] + EMULTIHOP => "Multihop attempted", + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly", + target_os = "redox"))] + ENOLINK => "Link has been severed", + + #[cfg(target_os = "freebsd")] + ENOTCAPABLE => "Capabilities insufficient", + + #[cfg(target_os = "freebsd")] + ECAPMODE => "Not permitted in capability mode", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + ENEEDAUTH => "Need authenticator", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox", target_os = "illumos", + target_os = "solaris"))] + EOVERFLOW => "Value too large to be stored in data type", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + EILSEQ => "Illegal byte sequence", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + ENOATTR => "Attribute not found", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EBADMSG => "Bad message", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EPROTO => "Protocol error", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd"))] + ENOTRECOVERABLE => "State not recoverable", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd"))] + EOWNERDEAD => "Previous owner died", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "illumos", target_os = "solaris"))] + ENOTSUP => "Operation not supported", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROCLIM => "Too many processes", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EUSERS => "Too many users", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox", target_os = "illumos", + target_os = "solaris"))] + EDQUOT => "Disc quota exceeded", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox", target_os = "illumos", + target_os = "solaris"))] + ESTALE => "Stale NFS file handle", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + EREMOTE => "Too many levels of remote in path", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EBADRPC => "RPC struct is bad", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + ERPCMISMATCH => "RPC version wrong", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROGUNAVAIL => "RPC prog. not avail", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROGMISMATCH => "Program version wrong", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EPROCUNAVAIL => "Bad procedure for program", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EFTYPE => "Inappropriate file type or format", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd"))] + EAUTH => "Authentication error", + + #[cfg(any(target_os = "macos", target_os = "freebsd", + target_os = "dragonfly", target_os = "ios", + target_os = "openbsd", target_os = "netbsd", + target_os = "redox"))] + ECANCELED => "Operation canceled", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EPWROFF => "Device power is off", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EDEVERR => "Device error, e.g. paper out", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EBADEXEC => "Bad executable", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EBADARCH => "Bad CPU type in executable", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + ESHLIBVERS => "Shared library version mismatch", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EBADMACHO => "Malformed Macho file", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd"))] + EMULTIHOP => "Reserved", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ENODATA => "No message available on STREAM", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd"))] + ENOLINK => "Reserved", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ENOSR => "No STREAM resources", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ENOSTR => "Not a STREAM", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "netbsd", target_os = "redox"))] + ETIME => "STREAM ioctl timeout", + + #[cfg(any(target_os = "macos", target_os = "ios", + target_os = "illumos", target_os = "solaris"))] + EOPNOTSUPP => "Operation not supported on socket", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + ENOPOLICY => "No such policy registered", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EQFULL => "Interface output queue is full", + + #[cfg(target_os = "openbsd")] + EOPNOTSUPP => "Operation not supported", + + #[cfg(target_os = "openbsd")] + EIPSEC => "IPsec processing failure", + + #[cfg(target_os = "dragonfly")] + EASYNC => "Async", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + EDEADLOCK => "Resource deadlock would occur", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + ELOCKUNMAPPED => "Locked lock was unmapped", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + ENOTACTIVE => "Facility is not active", + } +} + +#[cfg(any(target_os = "linux", target_os = "android", + target_os = "fuchsia"))] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EAGAIN = libc::EAGAIN, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EDEADLK = libc::EDEADLK, + ENAMETOOLONG = libc::ENAMETOOLONG, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + ENOTEMPTY = libc::ENOTEMPTY, + ELOOP = libc::ELOOP, + ENOMSG = libc::ENOMSG, + EIDRM = libc::EIDRM, + ECHRNG = libc::ECHRNG, + EL2NSYNC = libc::EL2NSYNC, + EL3HLT = libc::EL3HLT, + EL3RST = libc::EL3RST, + ELNRNG = libc::ELNRNG, + EUNATCH = libc::EUNATCH, + ENOCSI = libc::ENOCSI, + EL2HLT = libc::EL2HLT, + EBADE = libc::EBADE, + EBADR = libc::EBADR, + EXFULL = libc::EXFULL, + ENOANO = libc::ENOANO, + EBADRQC = libc::EBADRQC, + EBADSLT = libc::EBADSLT, + EBFONT = libc::EBFONT, + ENOSTR = libc::ENOSTR, + ENODATA = libc::ENODATA, + ETIME = libc::ETIME, + ENOSR = libc::ENOSR, + ENONET = libc::ENONET, + ENOPKG = libc::ENOPKG, + EREMOTE = libc::EREMOTE, + ENOLINK = libc::ENOLINK, + EADV = libc::EADV, + ESRMNT = libc::ESRMNT, + ECOMM = libc::ECOMM, + EPROTO = libc::EPROTO, + EMULTIHOP = libc::EMULTIHOP, + EDOTDOT = libc::EDOTDOT, + EBADMSG = libc::EBADMSG, + EOVERFLOW = libc::EOVERFLOW, + ENOTUNIQ = libc::ENOTUNIQ, + EBADFD = libc::EBADFD, + EREMCHG = libc::EREMCHG, + ELIBACC = libc::ELIBACC, + ELIBBAD = libc::ELIBBAD, + ELIBSCN = libc::ELIBSCN, + ELIBMAX = libc::ELIBMAX, + ELIBEXEC = libc::ELIBEXEC, + EILSEQ = libc::EILSEQ, + ERESTART = libc::ERESTART, + ESTRPIPE = libc::ESTRPIPE, + EUSERS = libc::EUSERS, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + EALREADY = libc::EALREADY, + EINPROGRESS = libc::EINPROGRESS, + ESTALE = libc::ESTALE, + EUCLEAN = libc::EUCLEAN, + ENOTNAM = libc::ENOTNAM, + ENAVAIL = libc::ENAVAIL, + EISNAM = libc::EISNAM, + EREMOTEIO = libc::EREMOTEIO, + EDQUOT = libc::EDQUOT, + ENOMEDIUM = libc::ENOMEDIUM, + EMEDIUMTYPE = libc::EMEDIUMTYPE, + ECANCELED = libc::ECANCELED, + ENOKEY = libc::ENOKEY, + EKEYEXPIRED = libc::EKEYEXPIRED, + EKEYREVOKED = libc::EKEYREVOKED, + EKEYREJECTED = libc::EKEYREJECTED, + EOWNERDEAD = libc::EOWNERDEAD, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + ERFKILL = libc::ERFKILL, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + EHWPOISON = libc::EHWPOISON, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ENOTSUP instead" + )] + pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; + + impl Errno { + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EAGAIN => EAGAIN, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EDEADLK => EDEADLK, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::ENOTEMPTY => ENOTEMPTY, + libc::ELOOP => ELOOP, + libc::ENOMSG => ENOMSG, + libc::EIDRM => EIDRM, + libc::ECHRNG => ECHRNG, + libc::EL2NSYNC => EL2NSYNC, + libc::EL3HLT => EL3HLT, + libc::EL3RST => EL3RST, + libc::ELNRNG => ELNRNG, + libc::EUNATCH => EUNATCH, + libc::ENOCSI => ENOCSI, + libc::EL2HLT => EL2HLT, + libc::EBADE => EBADE, + libc::EBADR => EBADR, + libc::EXFULL => EXFULL, + libc::ENOANO => ENOANO, + libc::EBADRQC => EBADRQC, + libc::EBADSLT => EBADSLT, + libc::EBFONT => EBFONT, + libc::ENOSTR => ENOSTR, + libc::ENODATA => ENODATA, + libc::ETIME => ETIME, + libc::ENOSR => ENOSR, + libc::ENONET => ENONET, + libc::ENOPKG => ENOPKG, + libc::EREMOTE => EREMOTE, + libc::ENOLINK => ENOLINK, + libc::EADV => EADV, + libc::ESRMNT => ESRMNT, + libc::ECOMM => ECOMM, + libc::EPROTO => EPROTO, + libc::EMULTIHOP => EMULTIHOP, + libc::EDOTDOT => EDOTDOT, + libc::EBADMSG => EBADMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ENOTUNIQ => ENOTUNIQ, + libc::EBADFD => EBADFD, + libc::EREMCHG => EREMCHG, + libc::ELIBACC => ELIBACC, + libc::ELIBBAD => ELIBBAD, + libc::ELIBSCN => ELIBSCN, + libc::ELIBMAX => ELIBMAX, + libc::ELIBEXEC => ELIBEXEC, + libc::EILSEQ => EILSEQ, + libc::ERESTART => ERESTART, + libc::ESTRPIPE => ESTRPIPE, + libc::EUSERS => EUSERS, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::EALREADY => EALREADY, + libc::EINPROGRESS => EINPROGRESS, + libc::ESTALE => ESTALE, + libc::EUCLEAN => EUCLEAN, + libc::ENOTNAM => ENOTNAM, + libc::ENAVAIL => ENAVAIL, + libc::EISNAM => EISNAM, + libc::EREMOTEIO => EREMOTEIO, + libc::EDQUOT => EDQUOT, + libc::ENOMEDIUM => ENOMEDIUM, + libc::EMEDIUMTYPE => EMEDIUMTYPE, + libc::ECANCELED => ECANCELED, + libc::ENOKEY => ENOKEY, + libc::EKEYEXPIRED => EKEYEXPIRED, + libc::EKEYREVOKED => EKEYREVOKED, + libc::EKEYREJECTED => EKEYREJECTED, + libc::EOWNERDEAD => EOWNERDEAD, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + libc::ERFKILL => ERFKILL, + #[cfg(not(any(target_os = "android", target_arch="mips")))] + libc::EHWPOISON => EHWPOISON, + _ => UnknownErrno, + } + } +} + +#[cfg(any(target_os = "macos", target_os = "ios"))] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EPWROFF = libc::EPWROFF, + EDEVERR = libc::EDEVERR, + EOVERFLOW = libc::EOVERFLOW, + EBADEXEC = libc::EBADEXEC, + EBADARCH = libc::EBADARCH, + ESHLIBVERS = libc::ESHLIBVERS, + EBADMACHO = libc::EBADMACHO, + ECANCELED = libc::ECANCELED, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENODATA = libc::ENODATA, + ENOLINK = libc::ENOLINK, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + EPROTO = libc::EPROTO, + ETIME = libc::ETIME, + EOPNOTSUPP = libc::EOPNOTSUPP, + ENOPOLICY = libc::ENOPOLICY, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + EQFULL = libc::EQFULL, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::EQFULL; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + + impl Errno { + pub const ELAST: Errno = Errno::EQFULL; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::ENOTSUP => ENOTSUP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EPWROFF => EPWROFF, + libc::EDEVERR => EDEVERR, + libc::EOVERFLOW => EOVERFLOW, + libc::EBADEXEC => EBADEXEC, + libc::EBADARCH => EBADARCH, + libc::ESHLIBVERS => ESHLIBVERS, + libc::EBADMACHO => EBADMACHO, + libc::ECANCELED => ECANCELED, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EILSEQ => EILSEQ, + libc::ENOATTR => ENOATTR, + libc::EBADMSG => EBADMSG, + libc::EMULTIHOP => EMULTIHOP, + libc::ENODATA => ENODATA, + libc::ENOLINK => ENOLINK, + libc::ENOSR => ENOSR, + libc::ENOSTR => ENOSTR, + libc::EPROTO => EPROTO, + libc::ETIME => ETIME, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::ENOPOLICY => ENOPOLICY, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::EOWNERDEAD => EOWNERDEAD, + libc::EQFULL => EQFULL, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "freebsd")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EDOOFUS = libc::EDOOFUS, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + ENOTCAPABLE = libc::ENOTCAPABLE, + ECAPMODE = libc::ECAPMODE, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::EOWNERDEAD; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EOPNOTSUPP instead" + )] + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + + impl Errno { + pub const ELAST: Errno = Errno::EOWNERDEAD; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::ENOTSUP => ENOTSUP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ECANCELED => ECANCELED, + libc::EILSEQ => EILSEQ, + libc::ENOATTR => ENOATTR, + libc::EDOOFUS => EDOOFUS, + libc::EBADMSG => EBADMSG, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + libc::ENOTCAPABLE => ENOTCAPABLE, + libc::ECAPMODE => ECAPMODE, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::EOWNERDEAD => EOWNERDEAD, + _ => UnknownErrno, + } + } +} + + +#[cfg(target_os = "dragonfly")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EDOOFUS = libc::EDOOFUS, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + ENOMEDIUM = libc::ENOMEDIUM, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + EASYNC = libc::EASYNC, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::EASYNC; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EOPNOTSUPP instead" + )] + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + + impl Errno { + pub const ELAST: Errno = Errno::EASYNC; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR=> EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::ENOTSUP => ENOTSUP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ECANCELED => ECANCELED, + libc::EILSEQ => EILSEQ, + libc::ENOATTR => ENOATTR, + libc::EDOOFUS => EDOOFUS, + libc::EBADMSG => EBADMSG, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + libc::ENOMEDIUM => ENOMEDIUM, + libc::EASYNC => EASYNC, + _ => UnknownErrno, + } + } +} + + +#[cfg(target_os = "openbsd")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIPSEC = libc::EIPSEC, + ENOATTR = libc::ENOATTR, + EILSEQ = libc::EILSEQ, + ENOMEDIUM = libc::ENOMEDIUM, + EMEDIUMTYPE = libc::EMEDIUMTYPE, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + ENOTSUP = libc::ENOTSUP, + EBADMSG = libc::EBADMSG, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + EPROTO = libc::EPROTO, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::ENOTSUP; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const ELAST: Errno = Errno::ENOTSUP; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIPSEC => EIPSEC, + libc::ENOATTR => ENOATTR, + libc::EILSEQ => EILSEQ, + libc::ENOMEDIUM => ENOMEDIUM, + libc::EMEDIUMTYPE => EMEDIUMTYPE, + libc::EOVERFLOW => EOVERFLOW, + libc::ECANCELED => ECANCELED, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::ENOTSUP => ENOTSUP, + libc::EBADMSG => EBADMSG, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::EOWNERDEAD => EOWNERDEAD, + libc::EPROTO => EPROTO, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "netbsd")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + EILSEQ = libc::EILSEQ, + ENOTSUP = libc::ENOTSUP, + ECANCELED = libc::ECANCELED, + EBADMSG = libc::EBADMSG, + ENODATA = libc::ENODATA, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + ETIME = libc::ETIME, + ENOATTR = libc::ENOATTR, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::ENOTSUP; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const ELAST: Errno = Errno::ENOTSUP; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::EILSEQ => EILSEQ, + libc::ENOTSUP => ENOTSUP, + libc::ECANCELED => ECANCELED, + libc::EBADMSG => EBADMSG, + libc::ENODATA => ENODATA, + libc::ENOSR => ENOSR, + libc::ENOSTR => ENOSTR, + libc::ETIME => ETIME, + libc::ENOATTR => ENOATTR, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "redox")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + EILSEQ = libc::EILSEQ, + ECANCELED = libc::ECANCELED, + EBADMSG = libc::EBADMSG, + ENODATA = libc::ENODATA, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + ETIME = libc::ETIME, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::EILSEQ => EILSEQ, + libc::ECANCELED => ECANCELED, + libc::EBADMSG => EBADMSG, + libc::ENODATA => ENODATA, + libc::ENOSR => ENOSR, + libc::ENOSTR => ENOSTR, + libc::ETIME => ETIME, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + _ => UnknownErrno, + } + } +} + +#[cfg(any(target_os = "illumos", target_os = "solaris"))] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EAGAIN = libc::EAGAIN, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + ENOMSG = libc::ENOMSG, + EIDRM = libc::EIDRM, + ECHRNG = libc::ECHRNG, + EL2NSYNC = libc::EL2NSYNC, + EL3HLT = libc::EL3HLT, + EL3RST = libc::EL3RST, + ELNRNG = libc::ELNRNG, + EUNATCH = libc::EUNATCH, + ENOCSI = libc::ENOCSI, + EL2HLT = libc::EL2HLT, + EDEADLK = libc::EDEADLK, + ENOLCK = libc::ENOLCK, + ECANCELED = libc::ECANCELED, + ENOTSUP = libc::ENOTSUP, + EDQUOT = libc::EDQUOT, + EBADE = libc::EBADE, + EBADR = libc::EBADR, + EXFULL = libc::EXFULL, + ENOANO = libc::ENOANO, + EBADRQC = libc::EBADRQC, + EBADSLT = libc::EBADSLT, + EDEADLOCK = libc::EDEADLOCK, + EBFONT = libc::EBFONT, + EOWNERDEAD = libc::EOWNERDEAD, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + ENOSTR = libc::ENOSTR, + ENODATA = libc::ENODATA, + ETIME = libc::ETIME, + ENOSR = libc::ENOSR, + ENONET = libc::ENONET, + ENOPKG = libc::ENOPKG, + EREMOTE = libc::EREMOTE, + ENOLINK = libc::ENOLINK, + EADV = libc::EADV, + ESRMNT = libc::ESRMNT, + ECOMM = libc::ECOMM, + EPROTO = libc::EPROTO, + ELOCKUNMAPPED = libc::ELOCKUNMAPPED, + ENOTACTIVE = libc::ENOTACTIVE, + EMULTIHOP = libc::EMULTIHOP, + EBADMSG = libc::EBADMSG, + ENAMETOOLONG = libc::ENAMETOOLONG, + EOVERFLOW = libc::EOVERFLOW, + ENOTUNIQ = libc::ENOTUNIQ, + EBADFD = libc::EBADFD, + EREMCHG = libc::EREMCHG, + ELIBACC = libc::ELIBACC, + ELIBBAD = libc::ELIBBAD, + ELIBSCN = libc::ELIBSCN, + ELIBMAX = libc::ELIBMAX, + ELIBEXEC = libc::ELIBEXEC, + EILSEQ = libc::EILSEQ, + ENOSYS = libc::ENOSYS, + ELOOP = libc::ELOOP, + ERESTART = libc::ERESTART, + ESTRPIPE = libc::ESTRPIPE, + ENOTEMPTY = libc::ENOTEMPTY, + EUSERS = libc::EUSERS, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + EALREADY = libc::EALREADY, + EINPROGRESS = libc::EINPROGRESS, + ESTALE = libc::ESTALE, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::ELAST; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const ELAST: Errno = Errno::ESTALE; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EAGAIN => EAGAIN, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::ENOMSG => ENOMSG, + libc::EIDRM => EIDRM, + libc::ECHRNG => ECHRNG, + libc::EL2NSYNC => EL2NSYNC, + libc::EL3HLT => EL3HLT, + libc::EL3RST => EL3RST, + libc::ELNRNG => ELNRNG, + libc::EUNATCH => EUNATCH, + libc::ENOCSI => ENOCSI, + libc::EL2HLT => EL2HLT, + libc::EDEADLK => EDEADLK, + libc::ENOLCK => ENOLCK, + libc::ECANCELED => ECANCELED, + libc::ENOTSUP => ENOTSUP, + libc::EDQUOT => EDQUOT, + libc::EBADE => EBADE, + libc::EBADR => EBADR, + libc::EXFULL => EXFULL, + libc::ENOANO => ENOANO, + libc::EBADRQC => EBADRQC, + libc::EBADSLT => EBADSLT, + libc::EDEADLOCK => EDEADLOCK, + libc::EBFONT => EBFONT, + libc::EOWNERDEAD => EOWNERDEAD, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::ENOSTR => ENOSTR, + libc::ENODATA => ENODATA, + libc::ETIME => ETIME, + libc::ENOSR => ENOSR, + libc::ENONET => ENONET, + libc::ENOPKG => ENOPKG, + libc::EREMOTE => EREMOTE, + libc::ENOLINK => ENOLINK, + libc::EADV => EADV, + libc::ESRMNT => ESRMNT, + libc::ECOMM => ECOMM, + libc::EPROTO => EPROTO, + libc::ELOCKUNMAPPED => ELOCKUNMAPPED, + libc::ENOTACTIVE => ENOTACTIVE, + libc::EMULTIHOP => EMULTIHOP, + libc::EBADMSG => EBADMSG, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EOVERFLOW => EOVERFLOW, + libc::ENOTUNIQ => ENOTUNIQ, + libc::EBADFD => EBADFD, + libc::EREMCHG => EREMCHG, + libc::ELIBACC => ELIBACC, + libc::ELIBBAD => ELIBBAD, + libc::ELIBSCN => ELIBSCN, + libc::ELIBMAX => ELIBMAX, + libc::ELIBEXEC => ELIBEXEC, + libc::EILSEQ => EILSEQ, + libc::ENOSYS => ENOSYS, + libc::ELOOP => ELOOP, + libc::ERESTART => ERESTART, + libc::ESTRPIPE => ESTRPIPE, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EUSERS => EUSERS, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::EALREADY => EALREADY, + libc::EINPROGRESS => EINPROGRESS, + libc::ESTALE => ESTALE, + _ => UnknownErrno, + } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/fcntl.rs b/bash-5.1/vendor/nix-0.24.2/src/fcntl.rs new file mode 100644 index 0000000000000000000000000000000000000000..fa64c8eaede5790d56c52a69965e85dde8ddf6f6 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/fcntl.rs @@ -0,0 +1,891 @@ +use crate::errno::Errno; +use libc::{self, c_char, c_int, c_uint, size_t, ssize_t}; +use std::ffi::OsString; +#[cfg(not(target_os = "redox"))] +use std::os::raw; +use std::os::unix::ffi::OsStringExt; +use std::os::unix::io::RawFd; + +#[cfg(any(target_os = "android", target_os = "linux"))] +use std::ptr; // For splice and copy_file_range +#[cfg(feature = "fs")] +use crate::{ + NixPath, + Result, + sys::stat::Mode +}; + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_env = "uclibc", + target_os = "freebsd" +))] +#[cfg(feature = "fs")] +pub use self::posix_fadvise::{PosixFadviseAdvice, posix_fadvise}; + +#[cfg(not(target_os = "redox"))] +#[cfg(any(feature = "fs", feature = "process"))] +libc_bitflags! { + #[cfg_attr(docsrs, doc(cfg(any(feature = "fs", feature = "process"))))] + pub struct AtFlags: c_int { + AT_REMOVEDIR; + AT_SYMLINK_FOLLOW; + AT_SYMLINK_NOFOLLOW; + #[cfg(any(target_os = "android", target_os = "linux"))] + AT_NO_AUTOMOUNT; + #[cfg(any(target_os = "android", target_os = "linux"))] + AT_EMPTY_PATH; + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + AT_EACCESS; + } +} + +#[cfg(any(feature = "fs", feature = "term"))] +libc_bitflags!( + /// Configuration options for opened files. + #[cfg_attr(docsrs, doc(cfg(any(feature = "fs", feature = "term"))))] + pub struct OFlag: c_int { + /// Mask for the access mode of the file. + O_ACCMODE; + /// Use alternate I/O semantics. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_ALT_IO; + /// Open the file in append-only mode. + O_APPEND; + /// Generate a signal when input or output becomes possible. + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_ASYNC; + /// Closes the file descriptor once an `execve` call is made. + /// + /// Also sets the file offset to the beginning of the file. + O_CLOEXEC; + /// Create the file if it does not exist. + O_CREAT; + /// Try to minimize cache effects of the I/O for this file. + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_DIRECT; + /// If the specified path isn't a directory, fail. + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_DIRECTORY; + /// Implicitly follow each `write()` with an `fdatasync()`. + #[cfg(any(target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_DSYNC; + /// Error out if a file was not created. + O_EXCL; + /// Open for execute only. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_EXEC; + /// Open with an exclusive file lock. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_EXLOCK; + /// Same as `O_SYNC`. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + all(target_os = "linux", not(target_env = "musl")), + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_FSYNC; + /// Allow files whose sizes can't be represented in an `off_t` to be opened. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_LARGEFILE; + /// Do not update the file last access time during `read(2)`s. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_NOATIME; + /// Don't attach the device as the process' controlling terminal. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_NOCTTY; + /// Same as `O_NONBLOCK`. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_NDELAY; + /// `open()` will fail if the given path is a symbolic link. + O_NOFOLLOW; + /// When possible, open the file in nonblocking mode. + O_NONBLOCK; + /// Don't deliver `SIGPIPE`. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_NOSIGPIPE; + /// Obtain a file descriptor for low-level access. + /// + /// The file itself is not opened and other file operations will fail. + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_PATH; + /// Only allow reading. + /// + /// This should not be combined with `O_WRONLY` or `O_RDWR`. + O_RDONLY; + /// Allow both reading and writing. + /// + /// This should not be combined with `O_WRONLY` or `O_RDONLY`. + O_RDWR; + /// Similar to `O_DSYNC` but applies to `read`s instead. + #[cfg(any(target_os = "linux", target_os = "netbsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_RSYNC; + /// Skip search permission checks. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_SEARCH; + /// Open with a shared file lock. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_SHLOCK; + /// Implicitly follow each `write()` with an `fsync()`. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_SYNC; + /// Create an unnamed temporary file. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_TMPFILE; + /// Truncate an existing regular file to 0 length if it allows writing. + O_TRUNC; + /// Restore default TTY attributes. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_TTY_INIT; + /// Only allow writing. + /// + /// This should not be combined with `O_RDONLY` or `O_RDWR`. + O_WRONLY; + } +); + +feature! { +#![feature = "fs"] + +// The conversion is not identical on all operating systems. +#[allow(clippy::useless_conversion)] +pub fn open(path: &P, oflag: OFlag, mode: Mode) -> Result { + let fd = path.with_nix_path(|cstr| { + unsafe { libc::open(cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) } + })?; + + Errno::result(fd) +} + +// The conversion is not identical on all operating systems. +#[allow(clippy::useless_conversion)] +#[cfg(not(target_os = "redox"))] +pub fn openat( + dirfd: RawFd, + path: &P, + oflag: OFlag, + mode: Mode, +) -> Result { + let fd = path.with_nix_path(|cstr| { + unsafe { libc::openat(dirfd, cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) } + })?; + Errno::result(fd) +} + +#[cfg(not(target_os = "redox"))] +pub fn renameat( + old_dirfd: Option, + old_path: &P1, + new_dirfd: Option, + new_path: &P2, +) -> Result<()> { + let res = old_path.with_nix_path(|old_cstr| { + new_path.with_nix_path(|new_cstr| unsafe { + libc::renameat( + at_rawfd(old_dirfd), + old_cstr.as_ptr(), + at_rawfd(new_dirfd), + new_cstr.as_ptr(), + ) + }) + })??; + Errno::result(res).map(drop) +} +} + +#[cfg(all( + target_os = "linux", + target_env = "gnu", +))] +#[cfg(feature = "fs")] +libc_bitflags! { + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub struct RenameFlags: u32 { + RENAME_EXCHANGE; + RENAME_NOREPLACE; + RENAME_WHITEOUT; + } +} + +feature! { +#![feature = "fs"] +#[cfg(all( + target_os = "linux", + target_env = "gnu", +))] +pub fn renameat2( + old_dirfd: Option, + old_path: &P1, + new_dirfd: Option, + new_path: &P2, + flags: RenameFlags, +) -> Result<()> { + let res = old_path.with_nix_path(|old_cstr| { + new_path.with_nix_path(|new_cstr| unsafe { + libc::renameat2( + at_rawfd(old_dirfd), + old_cstr.as_ptr(), + at_rawfd(new_dirfd), + new_cstr.as_ptr(), + flags.bits(), + ) + }) + })??; + Errno::result(res).map(drop) +} + +fn wrap_readlink_result(mut v: Vec, len: ssize_t) -> Result { + unsafe { v.set_len(len as usize) } + v.shrink_to_fit(); + Ok(OsString::from_vec(v.to_vec())) +} + +fn readlink_maybe_at( + dirfd: Option, + path: &P, + v: &mut Vec, +) -> Result { + path.with_nix_path(|cstr| unsafe { + match dirfd { + #[cfg(target_os = "redox")] + Some(_) => unreachable!(), + #[cfg(not(target_os = "redox"))] + Some(dirfd) => libc::readlinkat( + dirfd, + cstr.as_ptr(), + v.as_mut_ptr() as *mut c_char, + v.capacity() as size_t, + ), + None => libc::readlink( + cstr.as_ptr(), + v.as_mut_ptr() as *mut c_char, + v.capacity() as size_t, + ), + } + }) +} + +fn inner_readlink(dirfd: Option, path: &P) -> Result { + let mut v = Vec::with_capacity(libc::PATH_MAX as usize); + // simple case: result is strictly less than `PATH_MAX` + let res = readlink_maybe_at(dirfd, path, &mut v)?; + let len = Errno::result(res)?; + debug_assert!(len >= 0); + if (len as usize) < v.capacity() { + return wrap_readlink_result(v, res); + } + // Uh oh, the result is too long... + // Let's try to ask lstat how many bytes to allocate. + let reported_size = match dirfd { + #[cfg(target_os = "redox")] + Some(_) => unreachable!(), + #[cfg(any(target_os = "android", target_os = "linux"))] + Some(dirfd) => { + let flags = if path.is_empty() { AtFlags::AT_EMPTY_PATH } else { AtFlags::empty() }; + super::sys::stat::fstatat(dirfd, path, flags | AtFlags::AT_SYMLINK_NOFOLLOW) + }, + #[cfg(not(any(target_os = "android", target_os = "linux", target_os = "redox")))] + Some(dirfd) => super::sys::stat::fstatat(dirfd, path, AtFlags::AT_SYMLINK_NOFOLLOW), + None => super::sys::stat::lstat(path) + } + .map(|x| x.st_size) + .unwrap_or(0); + let mut try_size = if reported_size > 0 { + // Note: even if `lstat`'s apparently valid answer turns out to be + // wrong, we will still read the full symlink no matter what. + reported_size as usize + 1 + } else { + // If lstat doesn't cooperate, or reports an error, be a little less + // precise. + (libc::PATH_MAX as usize).max(128) << 1 + }; + loop { + v.reserve_exact(try_size); + let res = readlink_maybe_at(dirfd, path, &mut v)?; + let len = Errno::result(res)?; + debug_assert!(len >= 0); + if (len as usize) < v.capacity() { + break wrap_readlink_result(v, res); + } else { + // Ugh! Still not big enough! + match try_size.checked_shl(1) { + Some(next_size) => try_size = next_size, + // It's absurd that this would happen, but handle it sanely + // anyway. + None => break Err(Errno::ENAMETOOLONG), + } + } + } +} + +pub fn readlink(path: &P) -> Result { + inner_readlink(None, path) +} + +#[cfg(not(target_os = "redox"))] +pub fn readlinkat(dirfd: RawFd, path: &P) -> Result { + inner_readlink(Some(dirfd), path) +} + +/// Computes the raw fd consumed by a function of the form `*at`. +#[cfg(not(target_os = "redox"))] +pub(crate) fn at_rawfd(fd: Option) -> raw::c_int { + match fd { + None => libc::AT_FDCWD, + Some(fd) => fd, + } +} +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(feature = "fs")] +libc_bitflags!( + /// Additional flags for file sealing, which allows for limiting operations on a file. + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub struct SealFlag: c_int { + /// Prevents further calls to `fcntl()` with `F_ADD_SEALS`. + F_SEAL_SEAL; + /// The file cannot be reduced in size. + F_SEAL_SHRINK; + /// The size of the file cannot be increased. + F_SEAL_GROW; + /// The file contents cannot be modified. + F_SEAL_WRITE; + } +); + +#[cfg(feature = "fs")] +libc_bitflags!( + /// Additional configuration flags for `fcntl`'s `F_SETFD`. + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub struct FdFlag: c_int { + /// The file descriptor will automatically be closed during a successful `execve(2)`. + FD_CLOEXEC; + } +); + +feature! { +#![feature = "fs"] + +#[cfg(not(target_os = "redox"))] +#[derive(Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum FcntlArg<'a> { + F_DUPFD(RawFd), + F_DUPFD_CLOEXEC(RawFd), + F_GETFD, + F_SETFD(FdFlag), // FD_FLAGS + F_GETFL, + F_SETFL(OFlag), // O_NONBLOCK + F_SETLK(&'a libc::flock), + F_SETLKW(&'a libc::flock), + F_GETLK(&'a mut libc::flock), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_OFD_SETLK(&'a libc::flock), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_OFD_SETLKW(&'a libc::flock), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_OFD_GETLK(&'a mut libc::flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_ADD_SEALS(SealFlag), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_GET_SEALS, + #[cfg(any(target_os = "macos", target_os = "ios"))] + F_FULLFSYNC, + #[cfg(any(target_os = "linux", target_os = "android"))] + F_GETPIPE_SZ, + #[cfg(any(target_os = "linux", target_os = "android"))] + F_SETPIPE_SZ(c_int), + // TODO: Rest of flags +} + +#[cfg(target_os = "redox")] +#[derive(Debug, Clone, Copy, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum FcntlArg { + F_DUPFD(RawFd), + F_DUPFD_CLOEXEC(RawFd), + F_GETFD, + F_SETFD(FdFlag), // FD_FLAGS + F_GETFL, + F_SETFL(OFlag), // O_NONBLOCK +} +pub use self::FcntlArg::*; + +// TODO: Figure out how to handle value fcntl returns +pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result { + let res = unsafe { + match arg { + F_DUPFD(rawfd) => libc::fcntl(fd, libc::F_DUPFD, rawfd), + F_DUPFD_CLOEXEC(rawfd) => libc::fcntl(fd, libc::F_DUPFD_CLOEXEC, rawfd), + F_GETFD => libc::fcntl(fd, libc::F_GETFD), + F_SETFD(flag) => libc::fcntl(fd, libc::F_SETFD, flag.bits()), + F_GETFL => libc::fcntl(fd, libc::F_GETFL), + F_SETFL(flag) => libc::fcntl(fd, libc::F_SETFL, flag.bits()), + #[cfg(not(target_os = "redox"))] + F_SETLK(flock) => libc::fcntl(fd, libc::F_SETLK, flock), + #[cfg(not(target_os = "redox"))] + F_SETLKW(flock) => libc::fcntl(fd, libc::F_SETLKW, flock), + #[cfg(not(target_os = "redox"))] + F_GETLK(flock) => libc::fcntl(fd, libc::F_GETLK, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_OFD_SETLK(flock) => libc::fcntl(fd, libc::F_OFD_SETLK, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_OFD_SETLKW(flock) => libc::fcntl(fd, libc::F_OFD_SETLKW, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_OFD_GETLK(flock) => libc::fcntl(fd, libc::F_OFD_GETLK, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_ADD_SEALS(flag) => libc::fcntl(fd, libc::F_ADD_SEALS, flag.bits()), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_GET_SEALS => libc::fcntl(fd, libc::F_GET_SEALS), + #[cfg(any(target_os = "macos", target_os = "ios"))] + F_FULLFSYNC => libc::fcntl(fd, libc::F_FULLFSYNC), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_GETPIPE_SZ => libc::fcntl(fd, libc::F_GETPIPE_SZ), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_SETPIPE_SZ(size) => libc::fcntl(fd, libc::F_SETPIPE_SZ, size), + } + }; + + Errno::result(res) +} + +// TODO: convert to libc_enum +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum FlockArg { + LockShared, + LockExclusive, + Unlock, + LockSharedNonblock, + LockExclusiveNonblock, + UnlockNonblock, +} + +#[cfg(not(target_os = "redox"))] +pub fn flock(fd: RawFd, arg: FlockArg) -> Result<()> { + use self::FlockArg::*; + + let res = unsafe { + match arg { + LockShared => libc::flock(fd, libc::LOCK_SH), + LockExclusive => libc::flock(fd, libc::LOCK_EX), + Unlock => libc::flock(fd, libc::LOCK_UN), + LockSharedNonblock => libc::flock(fd, libc::LOCK_SH | libc::LOCK_NB), + LockExclusiveNonblock => libc::flock(fd, libc::LOCK_EX | libc::LOCK_NB), + UnlockNonblock => libc::flock(fd, libc::LOCK_UN | libc::LOCK_NB), + } + }; + + Errno::result(res).map(drop) +} +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(feature = "zerocopy")] +libc_bitflags! { + /// Additional flags to `splice` and friends. + #[cfg_attr(docsrs, doc(cfg(feature = "zerocopy")))] + pub struct SpliceFFlags: c_uint { + /// Request that pages be moved instead of copied. + /// + /// Not applicable to `vmsplice`. + SPLICE_F_MOVE; + /// Do not block on I/O. + SPLICE_F_NONBLOCK; + /// Hint that more data will be coming in a subsequent splice. + /// + /// Not applicable to `vmsplice`. + SPLICE_F_MORE; + /// Gift the user pages to the kernel. + /// + /// Not applicable to `splice`. + SPLICE_F_GIFT; + } +} + +feature! { +#![feature = "zerocopy"] + +/// Copy a range of data from one file to another +/// +/// The `copy_file_range` system call performs an in-kernel copy between +/// file descriptors `fd_in` and `fd_out` without the additional cost of +/// transferring data from the kernel to user space and then back into the +/// kernel. It copies up to `len` bytes of data from file descriptor `fd_in` to +/// file descriptor `fd_out`, overwriting any data that exists within the +/// requested range of the target file. +/// +/// If the `off_in` and/or `off_out` arguments are used, the values +/// will be mutated to reflect the new position within the file after +/// copying. If they are not used, the relevant filedescriptors will be seeked +/// to the new position. +/// +/// On successful completion the number of bytes actually copied will be +/// returned. +#[cfg(any(target_os = "android", target_os = "linux"))] +pub fn copy_file_range( + fd_in: RawFd, + off_in: Option<&mut libc::loff_t>, + fd_out: RawFd, + off_out: Option<&mut libc::loff_t>, + len: usize, +) -> Result { + let off_in = off_in + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + let off_out = off_out + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + + let ret = unsafe { + libc::syscall( + libc::SYS_copy_file_range, + fd_in, + off_in, + fd_out, + off_out, + len, + 0, + ) + }; + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn splice( + fd_in: RawFd, + off_in: Option<&mut libc::loff_t>, + fd_out: RawFd, + off_out: Option<&mut libc::loff_t>, + len: usize, + flags: SpliceFFlags, +) -> Result { + let off_in = off_in + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + let off_out = off_out + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + + let ret = unsafe { libc::splice(fd_in, off_in, fd_out, off_out, len, flags.bits()) }; + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn tee(fd_in: RawFd, fd_out: RawFd, len: usize, flags: SpliceFFlags) -> Result { + let ret = unsafe { libc::tee(fd_in, fd_out, len, flags.bits()) }; + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn vmsplice( + fd: RawFd, + iov: &[std::io::IoSlice<'_>], + flags: SpliceFFlags + ) -> Result +{ + let ret = unsafe { + libc::vmsplice( + fd, + iov.as_ptr() as *const libc::iovec, + iov.len(), + flags.bits(), + ) + }; + Errno::result(ret).map(|r| r as usize) +} +} + +#[cfg(any(target_os = "linux"))] +#[cfg(feature = "fs")] +libc_bitflags!( + /// Mode argument flags for fallocate determining operation performed on a given range. + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub struct FallocateFlags: c_int { + /// File size is not changed. + /// + /// offset + len can be greater than file size. + FALLOC_FL_KEEP_SIZE; + /// Deallocates space by creating a hole. + /// + /// Must be ORed with FALLOC_FL_KEEP_SIZE. Byte range starts at offset and continues for len bytes. + FALLOC_FL_PUNCH_HOLE; + /// Removes byte range from a file without leaving a hole. + /// + /// Byte range to collapse starts at offset and continues for len bytes. + FALLOC_FL_COLLAPSE_RANGE; + /// Zeroes space in specified byte range. + /// + /// Byte range starts at offset and continues for len bytes. + FALLOC_FL_ZERO_RANGE; + /// Increases file space by inserting a hole within the file size. + /// + /// Does not overwrite existing data. Hole starts at offset and continues for len bytes. + FALLOC_FL_INSERT_RANGE; + /// Shared file data extants are made private to the file. + /// + /// Gaurantees that a subsequent write will not fail due to lack of space. + FALLOC_FL_UNSHARE_RANGE; + } +); + +feature! { +#![feature = "fs"] + +/// Manipulates file space. +/// +/// Allows the caller to directly manipulate the allocated disk space for the +/// file referred to by fd. +#[cfg(any(target_os = "linux"))] +#[cfg(feature = "fs")] +pub fn fallocate( + fd: RawFd, + mode: FallocateFlags, + offset: libc::off_t, + len: libc::off_t, +) -> Result<()> { + let res = unsafe { libc::fallocate(fd, mode.bits(), offset, len) }; + Errno::result(res).map(drop) +} + +/// Argument to [`fspacectl`] describing the range to zero. The first member is +/// the file offset, and the second is the length of the region. +#[cfg(any(target_os = "freebsd"))] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct SpacectlRange(pub libc::off_t, pub libc::off_t); + +#[cfg(any(target_os = "freebsd"))] +impl SpacectlRange { + #[inline] + pub fn is_empty(&self) -> bool { + self.1 == 0 + } + + #[inline] + pub fn len(&self) -> libc::off_t { + self.1 + } + + #[inline] + pub fn offset(&self) -> libc::off_t { + self.0 + } +} + +/// Punch holes in a file. +/// +/// `fspacectl` instructs the file system to deallocate a portion of a file. +/// After a successful operation, this region of the file will return all zeroes +/// if read. If the file system supports deallocation, then it may free the +/// underlying storage, too. +/// +/// # Arguments +/// +/// - `fd` - File to operate on +/// - `range.0` - File offset at which to begin deallocation +/// - `range.1` - Length of the region to deallocate +/// +/// # Returns +/// +/// The operation may deallocate less than the entire requested region. On +/// success, it returns the region that still remains to be deallocated. The +/// caller should loop until the returned region is empty. +/// +/// # Example +/// +// no_run because it fails to link until FreeBSD 14.0 +/// ```no_run +/// # use std::io::Write; +/// # use std::os::unix::fs::FileExt; +/// # use std::os::unix::io::AsRawFd; +/// # use nix::fcntl::*; +/// # use tempfile::tempfile; +/// const INITIAL: &[u8] = b"0123456789abcdef"; +/// let mut f = tempfile().unwrap(); +/// f.write_all(INITIAL).unwrap(); +/// let mut range = SpacectlRange(3, 6); +/// while (!range.is_empty()) { +/// range = fspacectl(f.as_raw_fd(), range).unwrap(); +/// } +/// let mut buf = vec![0; INITIAL.len()]; +/// f.read_exact_at(&mut buf, 0).unwrap(); +/// assert_eq!(buf, b"012\0\0\0\0\0\09abcdef"); +/// ``` +#[cfg(target_os = "freebsd")] +pub fn fspacectl(fd: RawFd, range: SpacectlRange) -> Result { + let mut rqsr = libc::spacectl_range{r_offset: range.0, r_len: range.1}; + let res = unsafe { libc::fspacectl( + fd, + libc::SPACECTL_DEALLOC, // Only one command is supported ATM + &rqsr, + 0, // No flags are currently supported + &mut rqsr + )}; + Errno::result(res).map(|_| SpacectlRange(rqsr.r_offset, rqsr.r_len)) +} + +/// Like [`fspacectl`], but will never return incomplete. +/// +/// # Arguments +/// +/// - `fd` - File to operate on +/// - `offset` - File offset at which to begin deallocation +/// - `len` - Length of the region to deallocate +/// +/// # Returns +/// +/// Returns `()` on success. On failure, the region may or may not be partially +/// deallocated. +/// +/// # Example +/// +// no_run because it fails to link until FreeBSD 14.0 +/// ```no_run +/// # use std::io::Write; +/// # use std::os::unix::fs::FileExt; +/// # use std::os::unix::io::AsRawFd; +/// # use nix::fcntl::*; +/// # use tempfile::tempfile; +/// const INITIAL: &[u8] = b"0123456789abcdef"; +/// let mut f = tempfile().unwrap(); +/// f.write_all(INITIAL).unwrap(); +/// fspacectl_all(f.as_raw_fd(), 3, 6).unwrap(); +/// let mut buf = vec![0; INITIAL.len()]; +/// f.read_exact_at(&mut buf, 0).unwrap(); +/// assert_eq!(buf, b"012\0\0\0\0\0\09abcdef"); +/// ``` +#[cfg(target_os = "freebsd")] +pub fn fspacectl_all(fd: RawFd, offset: libc::off_t, len: libc::off_t) + -> Result<()> +{ + let mut rqsr = libc::spacectl_range{r_offset: offset, r_len: len}; + while rqsr.r_len > 0 { + let res = unsafe { libc::fspacectl( + fd, + libc::SPACECTL_DEALLOC, // Only one command is supported ATM + &rqsr, + 0, // No flags are currently supported + &mut rqsr + )}; + if let Err(e) = Errno::result(res) { + return Err(e); + } + } + Ok(()) +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_env = "uclibc", + target_os = "freebsd" +))] +mod posix_fadvise { + use crate::errno::Errno; + use std::os::unix::io::RawFd; + use crate::Result; + + #[cfg(feature = "fs")] + libc_enum! { + #[repr(i32)] + #[non_exhaustive] + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub enum PosixFadviseAdvice { + POSIX_FADV_NORMAL, + POSIX_FADV_SEQUENTIAL, + POSIX_FADV_RANDOM, + POSIX_FADV_NOREUSE, + POSIX_FADV_WILLNEED, + POSIX_FADV_DONTNEED, + } + } + + feature! { + #![feature = "fs"] + pub fn posix_fadvise( + fd: RawFd, + offset: libc::off_t, + len: libc::off_t, + advice: PosixFadviseAdvice, + ) -> Result<()> { + let res = unsafe { libc::posix_fadvise(fd, offset, len, advice as libc::c_int) }; + + if res == 0 { + Ok(()) + } else { + Err(Errno::from_i32(res)) + } + } + } +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_os = "freebsd" +))] +pub fn posix_fallocate(fd: RawFd, offset: libc::off_t, len: libc::off_t) -> Result<()> { + let res = unsafe { libc::posix_fallocate(fd, offset, len) }; + match Errno::result(res) { + Err(err) => Err(err), + Ok(0) => Ok(()), + Ok(errno) => Err(Errno::from_i32(errno)), + } +} +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/features.rs b/bash-5.1/vendor/nix-0.24.2/src/features.rs new file mode 100644 index 0000000000000000000000000000000000000000..610809861058bc0bf6ab1c87ea29bfa9db308aba --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/features.rs @@ -0,0 +1,123 @@ +//! Feature tests for OS functionality +pub use self::os::*; + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod os { + use std::os::unix::ffi::OsStrExt; + use crate::sys::utsname::uname; + use crate::Result; + + // Features: + // * atomic cloexec on socket: 2.6.27 + // * pipe2: 2.6.27 + // * accept4: 2.6.28 + + static VERS_UNKNOWN: usize = 1; + static VERS_2_6_18: usize = 2; + static VERS_2_6_27: usize = 3; + static VERS_2_6_28: usize = 4; + static VERS_3: usize = 5; + + #[inline] + fn digit(dst: &mut usize, b: u8) { + *dst *= 10; + *dst += (b - b'0') as usize; + } + + fn parse_kernel_version() -> Result { + let u = uname()?; + + let mut curr: usize = 0; + let mut major: usize = 0; + let mut minor: usize = 0; + let mut patch: usize = 0; + + for &b in u.release().as_bytes() { + if curr >= 3 { + break; + } + + match b { + b'.' | b'-' => { + curr += 1; + } + b'0'..=b'9' => { + match curr { + 0 => digit(&mut major, b), + 1 => digit(&mut minor, b), + _ => digit(&mut patch, b), + } + } + _ => break, + } + } + + Ok(if major >= 3 { + VERS_3 + } else if major >= 2 { + if minor >= 7 { + VERS_UNKNOWN + } else if minor >= 6 { + if patch >= 28 { + VERS_2_6_28 + } else if patch >= 27 { + VERS_2_6_27 + } else { + VERS_2_6_18 + } + } else { + VERS_UNKNOWN + } + } else { + VERS_UNKNOWN + }) + } + + fn kernel_version() -> Result { + static mut KERNEL_VERS: usize = 0; + + unsafe { + if KERNEL_VERS == 0 { + KERNEL_VERS = parse_kernel_version()?; + } + + Ok(KERNEL_VERS) + } + } + + /// Check if the OS supports atomic close-on-exec for sockets + pub fn socket_atomic_cloexec() -> bool { + kernel_version().map(|version| version >= VERS_2_6_27).unwrap_or(false) + } + + #[test] + pub fn test_parsing_kernel_version() { + assert!(kernel_version().unwrap() > 0); + } +} + +#[cfg(any( + target_os = "dragonfly", // Since ??? + target_os = "freebsd", // Since 10.0 + target_os = "illumos", // Since ??? + target_os = "netbsd", // Since 6.0 + target_os = "openbsd", // Since 5.7 + target_os = "redox", // Since 1-july-2020 +))] +mod os { + /// Check if the OS supports atomic close-on-exec for sockets + pub const fn socket_atomic_cloexec() -> bool { + true + } +} + +#[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "fuchsia", + target_os = "solaris"))] +mod os { + /// Check if the OS supports atomic close-on-exec for sockets + pub const fn socket_atomic_cloexec() -> bool { + false + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/ifaddrs.rs b/bash-5.1/vendor/nix-0.24.2/src/ifaddrs.rs new file mode 100644 index 0000000000000000000000000000000000000000..f834d3076272ba309c0dd7d06cde2310b344e4bf --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/ifaddrs.rs @@ -0,0 +1,147 @@ +//! Query network interface addresses +//! +//! Uses the Linux and/or BSD specific function `getifaddrs` to query the list +//! of interfaces and their associated addresses. + +use cfg_if::cfg_if; +use std::ffi; +use std::iter::Iterator; +use std::mem; +use std::option::Option; + +use crate::{Result, Errno}; +use crate::sys::socket::{SockaddrLike, SockaddrStorage}; +use crate::net::if_::*; + +/// Describes a single address for an interface as returned by `getifaddrs`. +#[derive(Clone, Debug, Eq, Hash, PartialEq)] +pub struct InterfaceAddress { + /// Name of the network interface + pub interface_name: String, + /// Flags as from `SIOCGIFFLAGS` ioctl + pub flags: InterfaceFlags, + /// Network address of this interface + pub address: Option, + /// Netmask of this interface + pub netmask: Option, + /// Broadcast address of this interface, if applicable + pub broadcast: Option, + /// Point-to-point destination address + pub destination: Option, +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))] { + fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr { + info.ifa_ifu + } + } else { + fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr { + info.ifa_dstaddr + } + } +} + +impl InterfaceAddress { + /// Create an `InterfaceAddress` from the libc struct. + fn from_libc_ifaddrs(info: &libc::ifaddrs) -> InterfaceAddress { + let ifname = unsafe { ffi::CStr::from_ptr(info.ifa_name) }; + let address = unsafe { SockaddrStorage::from_raw(info.ifa_addr, None) }; + let netmask = unsafe { SockaddrStorage::from_raw(info.ifa_netmask, None) }; + let mut addr = InterfaceAddress { + interface_name: ifname.to_string_lossy().to_string(), + flags: InterfaceFlags::from_bits_truncate(info.ifa_flags as i32), + address, + netmask, + broadcast: None, + destination: None, + }; + + let ifu = get_ifu_from_sockaddr(info); + if addr.flags.contains(InterfaceFlags::IFF_POINTOPOINT) { + addr.destination = unsafe { SockaddrStorage::from_raw(ifu, None) }; + } else if addr.flags.contains(InterfaceFlags::IFF_BROADCAST) { + addr.broadcast = unsafe { SockaddrStorage::from_raw(ifu, None) }; + } + + addr + } +} + +/// Holds the results of `getifaddrs`. +/// +/// Use the function `getifaddrs` to create this Iterator. Note that the +/// actual list of interfaces can be iterated once and will be freed as +/// soon as the Iterator goes out of scope. +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct InterfaceAddressIterator { + base: *mut libc::ifaddrs, + next: *mut libc::ifaddrs, +} + +impl Drop for InterfaceAddressIterator { + fn drop(&mut self) { + unsafe { libc::freeifaddrs(self.base) }; + } +} + +impl Iterator for InterfaceAddressIterator { + type Item = InterfaceAddress; + fn next(&mut self) -> Option<::Item> { + match unsafe { self.next.as_ref() } { + Some(ifaddr) => { + self.next = ifaddr.ifa_next; + Some(InterfaceAddress::from_libc_ifaddrs(ifaddr)) + } + None => None, + } + } +} + +/// Get interface addresses using libc's `getifaddrs` +/// +/// Note that the underlying implementation differs between OSes. Only the +/// most common address families are supported by the nix crate (due to +/// lack of time and complexity of testing). The address family is encoded +/// in the specific variant of `SockaddrStorage` returned for the fields +/// `address`, `netmask`, `broadcast`, and `destination`. For any entry not +/// supported, the returned list will contain a `None` entry. +/// +/// # Example +/// ``` +/// let addrs = nix::ifaddrs::getifaddrs().unwrap(); +/// for ifaddr in addrs { +/// match ifaddr.address { +/// Some(address) => { +/// println!("interface {} address {}", +/// ifaddr.interface_name, address); +/// }, +/// None => { +/// println!("interface {} with unsupported address family", +/// ifaddr.interface_name); +/// } +/// } +/// } +/// ``` +pub fn getifaddrs() -> Result { + let mut addrs = mem::MaybeUninit::<*mut libc::ifaddrs>::uninit(); + unsafe { + Errno::result(libc::getifaddrs(addrs.as_mut_ptr())).map(|_| { + InterfaceAddressIterator { + base: addrs.assume_init(), + next: addrs.assume_init(), + } + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + // Only checks if `getifaddrs` can be invoked without panicking. + #[test] + fn test_getifaddrs() { + let _ = getifaddrs(); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/kmod.rs b/bash-5.1/vendor/nix-0.24.2/src/kmod.rs new file mode 100644 index 0000000000000000000000000000000000000000..c42068c70a619302d121cf035eb97164b25f094d --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/kmod.rs @@ -0,0 +1,122 @@ +//! Load and unload kernel modules. +//! +//! For more details see + +use std::ffi::CStr; +use std::os::unix::io::AsRawFd; + +use crate::errno::Errno; +use crate::Result; + +/// Loads a kernel module from a buffer. +/// +/// It loads an ELF image into kernel space, +/// performs any necessary symbol relocations, +/// initializes module parameters to values provided by the caller, +/// and then runs the module's init function. +/// +/// This function requires `CAP_SYS_MODULE` privilege. +/// +/// The `module_image` argument points to a buffer containing the binary image +/// to be loaded. The buffer should contain a valid ELF image +/// built for the running kernel. +/// +/// The `param_values` argument is a string containing space-delimited specifications +/// of the values for module parameters. +/// Each of the parameter specifications has the form: +/// +/// `name[=value[,value...]]` +/// +/// # Example +/// +/// ```no_run +/// use std::fs::File; +/// use std::io::Read; +/// use std::ffi::CString; +/// use nix::kmod::init_module; +/// +/// let mut f = File::open("mykernel.ko").unwrap(); +/// let mut contents: Vec = Vec::new(); +/// f.read_to_end(&mut contents).unwrap(); +/// init_module(&mut contents, &CString::new("who=Rust when=Now,12").unwrap()).unwrap(); +/// ``` +/// +/// See [`man init_module(2)`](https://man7.org/linux/man-pages/man2/init_module.2.html) for more information. +pub fn init_module(module_image: &[u8], param_values: &CStr) -> Result<()> { + let res = unsafe { + libc::syscall( + libc::SYS_init_module, + module_image.as_ptr(), + module_image.len(), + param_values.as_ptr(), + ) + }; + + Errno::result(res).map(drop) +} + +libc_bitflags!( + /// Flags used by the `finit_module` function. + pub struct ModuleInitFlags: libc::c_uint { + /// Ignore symbol version hashes. + MODULE_INIT_IGNORE_MODVERSIONS; + /// Ignore kernel version magic. + MODULE_INIT_IGNORE_VERMAGIC; + } +); + +/// Loads a kernel module from a given file descriptor. +/// +/// # Example +/// +/// ```no_run +/// use std::fs::File; +/// use std::ffi::CString; +/// use nix::kmod::{finit_module, ModuleInitFlags}; +/// +/// let f = File::open("mymod.ko").unwrap(); +/// finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()).unwrap(); +/// ``` +/// +/// See [`man init_module(2)`](https://man7.org/linux/man-pages/man2/init_module.2.html) for more information. +pub fn finit_module(fd: &T, param_values: &CStr, flags: ModuleInitFlags) -> Result<()> { + let res = unsafe { + libc::syscall( + libc::SYS_finit_module, + fd.as_raw_fd(), + param_values.as_ptr(), + flags.bits(), + ) + }; + + Errno::result(res).map(drop) +} + +libc_bitflags!( + /// Flags used by `delete_module`. + /// + /// See [`man delete_module(2)`](https://man7.org/linux/man-pages/man2/delete_module.2.html) + /// for a detailed description how these flags work. + pub struct DeleteModuleFlags: libc::c_int { + O_NONBLOCK; + O_TRUNC; + } +); + +/// Unloads the kernel module with the given name. +/// +/// # Example +/// +/// ```no_run +/// use std::ffi::CString; +/// use nix::kmod::{delete_module, DeleteModuleFlags}; +/// +/// delete_module(&CString::new("mymod").unwrap(), DeleteModuleFlags::O_NONBLOCK).unwrap(); +/// ``` +/// +/// See [`man delete_module(2)`](https://man7.org/linux/man-pages/man2/delete_module.2.html) for more information. +pub fn delete_module(name: &CStr, flags: DeleteModuleFlags) -> Result<()> { + let res = unsafe { libc::syscall(libc::SYS_delete_module, name.as_ptr(), flags.bits()) }; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/lib.rs b/bash-5.1/vendor/nix-0.24.2/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..d4dcbc4ceb48b4589dab2a7f0b52b0636a004cc6 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/lib.rs @@ -0,0 +1,323 @@ +//! Rust friendly bindings to the various *nix system functions. +//! +//! Modules are structured according to the C header file that they would be +//! defined in. +//! +//! # Features +//! +//! Nix uses the following Cargo features to enable optional functionality. +//! They may be enabled in any combination. +//! * `acct` - Process accounting +//! * `aio` - POSIX AIO +//! * `dir` - Stuff relating to directory iteration +//! * `env` - Manipulate environment variables +//! * `event` - Event-driven APIs, like `kqueue` and `epoll` +//! * `feature` - Query characteristics of the OS at runtime +//! * `fs` - File system functionality +//! * `hostname` - Get and set the system's hostname +//! * `inotify` - Linux's `inotify` file system notification API +//! * `ioctl` - The `ioctl` syscall, and wrappers for my specific instances +//! * `kmod` - Load and unload kernel modules +//! * `mman` - Stuff relating to memory management +//! * `mount` - Mount and unmount file systems +//! * `mqueue` - POSIX message queues +//! * `net` - Networking-related functionality +//! * `personality` - Set the process execution domain +//! * `poll` - APIs like `poll` and `select` +//! * `process` - Stuff relating to running processes +//! * `pthread` - POSIX threads +//! * `ptrace` - Process tracing and debugging +//! * `quota` - File system quotas +//! * `reboot` - Reboot the system +//! * `resource` - Process resource limits +//! * `sched` - Manipulate process's scheduling +//! * `socket` - Sockets, whether for networking or local use +//! * `signal` - Send and receive signals to processes +//! * `term` - Terminal control APIs +//! * `time` - Query the operating system's clocks +//! * `ucontext` - User thread context +//! * `uio` - Vectored I/O +//! * `user` - Stuff relating to users and groups +//! * `zerocopy` - APIs like `sendfile` and `copy_file_range` +#![crate_name = "nix"] +#![cfg(unix)] +#![cfg_attr(docsrs, doc(cfg(all())))] +#![allow(non_camel_case_types)] +#![cfg_attr(test, deny(warnings))] +#![recursion_limit = "500"] +#![deny(unused)] +#![allow(unused_macros)] +#![cfg_attr(not(feature = "default"), allow(unused_imports))] +#![deny(unstable_features)] +#![deny(missing_copy_implementations)] +#![deny(missing_debug_implementations)] +#![warn(missing_docs)] + +#![cfg_attr(docsrs, feature(doc_cfg))] + +// Re-exported external crates +pub use libc; + +// Private internal modules +#[macro_use] mod macros; + +// Public crates +#[cfg(not(target_os = "redox"))] +feature! { + #![feature = "dir"] + #[allow(missing_docs)] + pub mod dir; +} +feature! { + #![feature = "env"] + pub mod env; +} +#[allow(missing_docs)] +pub mod errno; +feature! { + #![feature = "feature"] + + #[deny(missing_docs)] + pub mod features; +} +#[allow(missing_docs)] +pub mod fcntl; +feature! { + #![feature = "net"] + + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + #[deny(missing_docs)] + pub mod ifaddrs; + #[cfg(not(target_os = "redox"))] + #[deny(missing_docs)] + pub mod net; +} +#[cfg(any(target_os = "android", + target_os = "linux"))] +feature! { + #![feature = "kmod"] + #[allow(missing_docs)] + pub mod kmod; +} +#[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "linux"))] +feature! { + #![feature = "mount"] + pub mod mount; +} +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "fushsia", + target_os = "linux", + target_os = "netbsd"))] +feature! { + #![feature = "mqueue"] + #[allow(missing_docs)] + pub mod mqueue; +} +feature! { + #![feature = "poll"] + pub mod poll; +} +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +feature! { + #![feature = "term"] + #[deny(missing_docs)] + pub mod pty; +} +feature! { + #![feature = "sched"] + pub mod sched; +} +pub mod sys; +feature! { + #![feature = "time"] + #[allow(missing_docs)] + pub mod time; +} +// This can be implemented for other platforms as soon as libc +// provides bindings for them. +#[cfg(all(target_os = "linux", + any(target_arch = "s390x", target_arch = "x86", + target_arch = "x86_64")))] +feature! { + #![feature = "ucontext"] + #[allow(missing_docs)] + pub mod ucontext; +} +#[allow(missing_docs)] +pub mod unistd; + +use std::ffi::{CStr, CString, OsStr}; +use std::mem::MaybeUninit; +use std::os::unix::ffi::OsStrExt; +use std::path::{Path, PathBuf}; +use std::{ptr, result, slice}; + +use errno::Errno; + +/// Nix Result Type +pub type Result = result::Result; + +/// Nix's main error type. +/// +/// It's a wrapper around Errno. As such, it's very interoperable with +/// [`std::io::Error`], but it has the advantages of: +/// * `Clone` +/// * `Copy` +/// * `Eq` +/// * Small size +/// * Represents all of the system's errnos, instead of just the most common +/// ones. +pub type Error = Errno; + +/// Common trait used to represent file system paths by many Nix functions. +pub trait NixPath { + /// Is the path empty? + fn is_empty(&self) -> bool; + + /// Length of the path in bytes + fn len(&self) -> usize; + + /// Execute a function with this path as a `CStr`. + /// + /// Mostly used internally by Nix. + fn with_nix_path(&self, f: F) -> Result + where F: FnOnce(&CStr) -> T; +} + +impl NixPath for str { + fn is_empty(&self) -> bool { + NixPath::is_empty(OsStr::new(self)) + } + + fn len(&self) -> usize { + NixPath::len(OsStr::new(self)) + } + + fn with_nix_path(&self, f: F) -> Result + where F: FnOnce(&CStr) -> T { + OsStr::new(self).with_nix_path(f) + } +} + +impl NixPath for OsStr { + fn is_empty(&self) -> bool { + self.as_bytes().is_empty() + } + + fn len(&self) -> usize { + self.as_bytes().len() + } + + fn with_nix_path(&self, f: F) -> Result + where F: FnOnce(&CStr) -> T { + self.as_bytes().with_nix_path(f) + } +} + +impl NixPath for CStr { + fn is_empty(&self) -> bool { + self.to_bytes().is_empty() + } + + fn len(&self) -> usize { + self.to_bytes().len() + } + + fn with_nix_path(&self, f: F) -> Result + where + F: FnOnce(&CStr) -> T, + { + Ok(f(self)) + } +} + +impl NixPath for [u8] { + fn is_empty(&self) -> bool { + self.is_empty() + } + + fn len(&self) -> usize { + self.len() + } + + fn with_nix_path(&self, f: F) -> Result + where + F: FnOnce(&CStr) -> T, + { + // The real PATH_MAX is typically 4096, but it's statistically unlikely to have a path + // longer than ~300 bytes. See the the PR description to get stats for your own machine. + // https://github.com/nix-rust/nix/pull/1656 + // + // By being smaller than a memory page, we also avoid the compiler inserting a probe frame: + // https://docs.rs/compiler_builtins/latest/compiler_builtins/probestack/index.html + const MAX_STACK_ALLOCATION: usize = 1024; + + if self.len() >= MAX_STACK_ALLOCATION { + return with_nix_path_allocating(self, f); + } + + let mut buf = MaybeUninit::<[u8; MAX_STACK_ALLOCATION]>::uninit(); + let buf_ptr = buf.as_mut_ptr() as *mut u8; + + unsafe { + ptr::copy_nonoverlapping(self.as_ptr(), buf_ptr, self.len()); + buf_ptr.add(self.len()).write(0); + } + + match CStr::from_bytes_with_nul(unsafe { slice::from_raw_parts(buf_ptr, self.len() + 1) }) { + Ok(s) => Ok(f(s)), + Err(_) => Err(Errno::EINVAL), + } + } +} + +#[cold] +#[inline(never)] +fn with_nix_path_allocating(from: &[u8], f: F) -> Result +where + F: FnOnce(&CStr) -> T, +{ + match CString::new(from) { + Ok(s) => Ok(f(&s)), + Err(_) => Err(Errno::EINVAL), + } +} + +impl NixPath for Path { + fn is_empty(&self) -> bool { + NixPath::is_empty(self.as_os_str()) + } + + fn len(&self) -> usize { + NixPath::len(self.as_os_str()) + } + + fn with_nix_path(&self, f: F) -> Result where F: FnOnce(&CStr) -> T { + self.as_os_str().with_nix_path(f) + } +} + +impl NixPath for PathBuf { + fn is_empty(&self) -> bool { + NixPath::is_empty(self.as_os_str()) + } + + fn len(&self) -> usize { + NixPath::len(self.as_os_str()) + } + + fn with_nix_path(&self, f: F) -> Result where F: FnOnce(&CStr) -> T { + self.as_os_str().with_nix_path(f) + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/macros.rs b/bash-5.1/vendor/nix-0.24.2/src/macros.rs new file mode 100644 index 0000000000000000000000000000000000000000..99e0de88662fbeb77372a6c686ba5005dddcc1ba --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/macros.rs @@ -0,0 +1,328 @@ +// Thanks to Tokio for this macro +macro_rules! feature { + ( + #![$meta:meta] + $($item:item)* + ) => { + $( + #[cfg($meta)] + #[cfg_attr(docsrs, doc(cfg($meta)))] + $item + )* + } +} + +/// The `libc_bitflags!` macro helps with a common use case of defining a public bitflags type +/// with values from the libc crate. It is used the same way as the `bitflags!` macro, except +/// that only the name of the flag value has to be given. +/// +/// The `libc` crate must be in scope with the name `libc`. +/// +/// # Example +/// ```ignore +/// libc_bitflags!{ +/// pub struct ProtFlags: libc::c_int { +/// PROT_NONE; +/// PROT_READ; +/// /// PROT_WRITE enables write protect +/// PROT_WRITE; +/// PROT_EXEC; +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSDOWN; +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSUP; +/// } +/// } +/// ``` +/// +/// Example with casting, due to a mistake in libc. In this example, the +/// various flags have different types, so we cast the broken ones to the right +/// type. +/// +/// ```ignore +/// libc_bitflags!{ +/// pub struct SaFlags: libc::c_ulong { +/// SA_NOCLDSTOP as libc::c_ulong; +/// SA_NOCLDWAIT; +/// SA_NODEFER as libc::c_ulong; +/// SA_ONSTACK; +/// SA_RESETHAND as libc::c_ulong; +/// SA_RESTART as libc::c_ulong; +/// SA_SIGINFO; +/// } +/// } +/// ``` +macro_rules! libc_bitflags { + ( + $(#[$outer:meta])* + pub struct $BitFlags:ident: $T:ty { + $( + $(#[$inner:ident $($args:tt)*])* + $Flag:ident $(as $cast:ty)*; + )+ + } + ) => { + ::bitflags::bitflags! { + $(#[$outer])* + pub struct $BitFlags: $T { + $( + $(#[$inner $($args)*])* + const $Flag = libc::$Flag $(as $cast)*; + )+ + } + } + }; +} + +/// The `libc_enum!` macro helps with a common use case of defining an enum exclusively using +/// values from the `libc` crate. This macro supports both `pub` and private `enum`s. +/// +/// The `libc` crate must be in scope with the name `libc`. +/// +/// # Example +/// ```ignore +/// libc_enum!{ +/// pub enum ProtFlags { +/// PROT_NONE, +/// PROT_READ, +/// PROT_WRITE, +/// PROT_EXEC, +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSDOWN, +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSUP, +/// } +/// } +/// ``` +// Some targets don't use all rules. +#[allow(unknown_lints)] +#[allow(unused_macro_rules)] +macro_rules! libc_enum { + // Exit rule. + (@make_enum + name: $BitFlags:ident, + { + $v:vis + attrs: [$($attrs:tt)*], + entries: [$($entries:tt)*], + } + ) => { + $($attrs)* + #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + $v enum $BitFlags { + $($entries)* + } + }; + + // Exit rule including TryFrom + (@make_enum + name: $BitFlags:ident, + { + $v:vis + attrs: [$($attrs:tt)*], + entries: [$($entries:tt)*], + from_type: $repr:path, + try_froms: [$($try_froms:tt)*] + } + ) => { + $($attrs)* + #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + $v enum $BitFlags { + $($entries)* + } + impl ::std::convert::TryFrom<$repr> for $BitFlags { + type Error = $crate::Error; + #[allow(unused_doc_comments)] + fn try_from(x: $repr) -> $crate::Result { + match x { + $($try_froms)* + _ => Err($crate::Error::EINVAL) + } + } + } + }; + + // Done accumulating. + (@accumulate_entries + name: $BitFlags:ident, + { + $v:vis + attrs: $attrs:tt, + }, + $entries:tt, + $try_froms:tt; + ) => { + libc_enum! { + @make_enum + name: $BitFlags, + { + $v + attrs: $attrs, + entries: $entries, + } + } + }; + + // Done accumulating and want TryFrom + (@accumulate_entries + name: $BitFlags:ident, + { + $v:vis + attrs: $attrs:tt, + from_type: $repr:path, + }, + $entries:tt, + $try_froms:tt; + ) => { + libc_enum! { + @make_enum + name: $BitFlags, + { + $v + attrs: $attrs, + entries: $entries, + from_type: $repr, + try_froms: $try_froms + } + } + }; + + // Munch an attr. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + #[$attr:meta] $($tail:tt)* + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + #[$attr] + ], + [ + $($try_froms)* + #[$attr] + ]; + $($tail)* + } + }; + + // Munch last ident if not followed by a comma. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + $entry:ident + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + $entry = libc::$entry, + ], + [ + $($try_froms)* + libc::$entry => Ok($BitFlags::$entry), + ]; + } + }; + + // Munch an ident; covers terminating comma case. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + $entry:ident, + $($tail:tt)* + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + $entry = libc::$entry, + ], + [ + $($try_froms)* + libc::$entry => Ok($BitFlags::$entry), + ]; + $($tail)* + } + }; + + // Munch an ident and cast it to the given type; covers terminating comma. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + $entry:ident as $ty:ty, + $($tail:tt)* + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + $entry = libc::$entry as $ty, + ], + [ + $($try_froms)* + libc::$entry as $ty => Ok($BitFlags::$entry), + ]; + $($tail)* + } + }; + + // Entry rule. + ( + $(#[$attr:meta])* + $v:vis enum $BitFlags:ident { + $($vals:tt)* + } + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + { + $v + attrs: [$(#[$attr])*], + }, + [], + []; + $($vals)* + } + }; + + // Entry rule including TryFrom + ( + $(#[$attr:meta])* + $v:vis enum $BitFlags:ident { + $($vals:tt)* + } + impl TryFrom<$repr:path> + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + { + $v + attrs: [$(#[$attr])*], + from_type: $repr, + }, + [], + []; + $($vals)* + } + }; +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/mount/bsd.rs b/bash-5.1/vendor/nix-0.24.2/src/mount/bsd.rs new file mode 100644 index 0000000000000000000000000000000000000000..b4d611ee39989e0897397710a47a5fd89603f2cc --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/mount/bsd.rs @@ -0,0 +1,442 @@ +use crate::{ + Error, + Errno, + NixPath, + Result, +}; +use libc::{c_char, c_int, c_uint, c_void}; +use std::{ + borrow::Cow, + ffi::{CString, CStr}, + fmt, + io, + marker::PhantomData, +}; + + +libc_bitflags!( + /// Used with [`Nmount::nmount`]. + pub struct MntFlags: c_int { + /// ACL support enabled. + #[cfg(any(target_os = "netbsd", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_ACLS; + /// All I/O to the file system should be done asynchronously. + MNT_ASYNC; + /// dir should instead be a file system ID encoded as “FSID:val0:val1”. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_BYFSID; + /// Force a read-write mount even if the file system appears to be + /// unclean. + MNT_FORCE; + /// GEOM journal support enabled. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_GJOURNAL; + /// MAC support for objects. + #[cfg(any(target_os = "macos", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_MULTILABEL; + /// Disable read clustering. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_NOCLUSTERR; + /// Disable write clustering. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_NOCLUSTERW; + /// Enable NFS version 4 ACLs. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_NFS4ACLS; + /// Do not update access times. + MNT_NOATIME; + /// Disallow program execution. + MNT_NOEXEC; + /// Do not honor setuid or setgid bits on files when executing them. + MNT_NOSUID; + /// Do not follow symlinks. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_NOSYMFOLLOW; + /// Mount read-only. + MNT_RDONLY; + /// Causes the vfs subsystem to update its data structures pertaining to + /// the specified already mounted file system. + MNT_RELOAD; + /// Create a snapshot of the file system. + /// + /// See [mksnap_ffs(8)](https://www.freebsd.org/cgi/man.cgi?query=mksnap_ffs) + #[cfg(any(target_os = "macos", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_SNAPSHOT; + /// Using soft updates. + #[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_SOFTDEP; + /// Directories with the SUID bit set chown new files to their own + /// owner. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_SUIDDIR; + /// All I/O to the file system should be done synchronously. + MNT_SYNCHRONOUS; + /// Union with underlying fs. + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_UNION; + /// Indicates that the mount command is being applied to an already + /// mounted file system. + MNT_UPDATE; + /// Check vnode use counts. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_NONBUSY; + } +); + + +/// The Error type of [`Nmount::nmount`]. +/// +/// It wraps an [`Errno`], but also may contain an additional message returned +/// by `nmount(2)`. +#[derive(Debug)] +pub struct NmountError { + errno: Error, + errmsg: Option +} + +impl NmountError { + /// Returns the additional error string sometimes generated by `nmount(2)`. + pub fn errmsg(&self) -> Option<&str> { + self.errmsg.as_deref() + } + + /// Returns the inner [`Error`] + pub const fn error(&self) -> Error { + self.errno + } + + fn new(error: Error, errmsg: Option<&CStr>) -> Self { + Self { + errno: error, + errmsg: errmsg.map(CStr::to_string_lossy).map(Cow::into_owned) + } + } +} + +impl std::error::Error for NmountError {} + +impl fmt::Display for NmountError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if let Some(errmsg) = &self.errmsg { + write!(f, "{:?}: {}: {}", self.errno, errmsg, self.errno.desc()) + } else { + write!(f, "{:?}: {}", self.errno, self.errno.desc()) + } + } +} + +impl From for io::Error { + fn from(err: NmountError) -> Self { + err.errno.into() + } +} + +/// Result type of [`Nmount::nmount`]. +pub type NmountResult = std::result::Result<(), NmountError>; + +/// Mount a FreeBSD file system. +/// +/// The `nmount(2)` system call works similarly to the `mount(8)` program; it +/// takes its options as a series of name-value pairs. Most of the values are +/// strings, as are all of the names. The `Nmount` structure builds up an +/// argument list and then executes the syscall. +/// +/// # Examples +/// +/// To mount `target` onto `mountpoint` with `nullfs`: +/// ``` +/// # use nix::unistd::Uid; +/// # use ::sysctl::CtlValue; +/// # if !Uid::current().is_root() && CtlValue::Int(0) == ::sysctl::value("vfs.usermount").unwrap() { +/// # return; +/// # }; +/// use nix::mount::{MntFlags, Nmount, unmount}; +/// use std::ffi::CString; +/// use tempfile::tempdir; +/// +/// let mountpoint = tempdir().unwrap(); +/// let target = tempdir().unwrap(); +/// +/// let fstype = CString::new("fstype").unwrap(); +/// let nullfs = CString::new("nullfs").unwrap(); +/// Nmount::new() +/// .str_opt(&fstype, &nullfs) +/// .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) +/// .str_opt_owned("target", target.path().to_str().unwrap()) +/// .nmount(MntFlags::empty()).unwrap(); +/// +/// unmount(mountpoint.path(), MntFlags::empty()).unwrap(); +/// ``` +/// +/// # See Also +/// * [`nmount(2)`](https://www.freebsd.org/cgi/man.cgi?query=nmount) +/// * [`nullfs(5)`](https://www.freebsd.org/cgi/man.cgi?query=nullfs) +#[cfg(target_os = "freebsd")] +#[cfg_attr(docsrs, doc(cfg(all())))] +#[derive(Debug, Default)] +pub struct Nmount<'a>{ + // n.b. notgull: In reality, this is a list that contains + // both mutable and immutable pointers. + // Be careful using this. + iov: Vec, + is_owned: Vec, + marker: PhantomData<&'a ()>, +} + +#[cfg(target_os = "freebsd")] +#[cfg_attr(docsrs, doc(cfg(all())))] +impl<'a> Nmount<'a> { + /// Helper function to push a slice onto the `iov` array. + fn push_slice(&mut self, val: &'a [u8], is_owned: bool) { + self.iov.push(libc::iovec { + iov_base: val.as_ptr() as *mut _, + iov_len: val.len(), + }); + self.is_owned.push(is_owned); + } + + /// Helper function to push a pointer and its length onto the `iov` array. + fn push_pointer_and_length(&mut self, val: *const u8, len: usize, is_owned: bool) { + self.iov.push(libc::iovec { + iov_base: val as *mut _, + iov_len: len, + }); + self.is_owned.push(is_owned); + } + + /// Helper function to push a `nix` path as owned. + fn push_nix_path(&mut self, val: &P) { + val.with_nix_path(|s| { + let len = s.to_bytes_with_nul().len(); + let ptr = s.to_owned().into_raw() as *const u8; + + self.push_pointer_and_length(ptr, len, true); + }).unwrap(); + } + + /// Add an opaque mount option. + /// + /// Some file systems take binary-valued mount options. They can be set + /// with this method. + /// + /// # Safety + /// + /// Unsafe because it will cause `Nmount::nmount` to dereference a raw + /// pointer. The user is responsible for ensuring that `val` is valid and + /// its lifetime outlives `self`! An easy way to do that is to give the + /// value a larger scope than `name` + /// + /// # Examples + /// ``` + /// use libc::c_void; + /// use nix::mount::Nmount; + /// use std::ffi::CString; + /// use std::mem; + /// + /// // Note that flags outlives name + /// let mut flags: u32 = 0xdeadbeef; + /// let name = CString::new("flags").unwrap(); + /// let p = &mut flags as *mut u32 as *mut c_void; + /// let len = mem::size_of_val(&flags); + /// let mut nmount = Nmount::new(); + /// unsafe { nmount.mut_ptr_opt(&name, p, len) }; + /// ``` + pub unsafe fn mut_ptr_opt( + &mut self, + name: &'a CStr, + val: *mut c_void, + len: usize + ) -> &mut Self + { + self.push_slice(name.to_bytes_with_nul(), false); + self.push_pointer_and_length(val.cast(), len, false); + self + } + + /// Add a mount option that does not take a value. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// use std::ffi::CString; + /// + /// let read_only = CString::new("ro").unwrap(); + /// Nmount::new() + /// .null_opt(&read_only); + /// ``` + pub fn null_opt(&mut self, name: &'a CStr) -> &mut Self { + self.push_slice(name.to_bytes_with_nul(), false); + self.push_slice(&[], false); + self + } + + /// Add a mount option that does not take a value, but whose name must be + /// owned. + /// + /// + /// This has higher runtime cost than [`Nmount::null_opt`], but is useful + /// when the name's lifetime doesn't outlive the `Nmount`, or it's a + /// different string type than `CStr`. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// + /// let read_only = "ro"; + /// let mut nmount: Nmount<'static> = Nmount::new(); + /// nmount.null_opt_owned(read_only); + /// ``` + pub fn null_opt_owned(&mut self, name: &P) -> &mut Self + { + self.push_nix_path(name); + self.push_slice(&[], false); + self + } + + /// Add a mount option as a [`CStr`]. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// use std::ffi::CString; + /// + /// let fstype = CString::new("fstype").unwrap(); + /// let nullfs = CString::new("nullfs").unwrap(); + /// Nmount::new() + /// .str_opt(&fstype, &nullfs); + /// ``` + pub fn str_opt( + &mut self, + name: &'a CStr, + val: &'a CStr + ) -> &mut Self + { + self.push_slice(name.to_bytes_with_nul(), false); + self.push_slice(val.to_bytes_with_nul(), false); + self + } + + /// Add a mount option as an owned string. + /// + /// This has higher runtime cost than [`Nmount::str_opt`], but is useful + /// when the value's lifetime doesn't outlive the `Nmount`, or it's a + /// different string type than `CStr`. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// use std::path::Path; + /// + /// let mountpoint = Path::new("/mnt"); + /// Nmount::new() + /// .str_opt_owned("fspath", mountpoint.to_str().unwrap()); + /// ``` + pub fn str_opt_owned(&mut self, name: &P1, val: &P2) -> &mut Self + where P1: ?Sized + NixPath, + P2: ?Sized + NixPath + { + self.push_nix_path(name); + self.push_nix_path(val); + self + } + + /// Create a new `Nmount` struct with no options + pub fn new() -> Self { + Self::default() + } + + /// Actually mount the file system. + pub fn nmount(&mut self, flags: MntFlags) -> NmountResult { + const ERRMSG_NAME: &[u8] = b"errmsg\0"; + let mut errmsg = vec![0u8; 255]; + + // nmount can return extra error information via a "errmsg" return + // argument. + self.push_slice(ERRMSG_NAME, false); + + // SAFETY: we are pushing a mutable iovec here, so we can't use + // the above method + self.iov.push(libc::iovec { + iov_base: errmsg.as_mut_ptr() as *mut c_void, + iov_len: errmsg.len(), + }); + + let niov = self.iov.len() as c_uint; + let iovp = self.iov.as_mut_ptr() as *mut libc::iovec; + let res = unsafe { + libc::nmount(iovp, niov, flags.bits) + }; + match Errno::result(res) { + Ok(_) => Ok(()), + Err(error) => { + let errmsg = match errmsg.iter().position(|&x| x == 0) { + None => None, + Some(0) => None, + Some(n) => { + let sl = &errmsg[0..n + 1]; + Some(CStr::from_bytes_with_nul(sl).unwrap()) + } + }; + Err(NmountError::new(error, errmsg)) + } + } + } +} + +#[cfg(target_os = "freebsd")] +impl<'a> Drop for Nmount<'a> { + fn drop(&mut self) { + for (iov, is_owned) in self.iov.iter().zip(self.is_owned.iter()) { + if *is_owned { + // Free the owned string. Safe because we recorded ownership, + // and Nmount does not implement Clone. + unsafe { + drop(CString::from_raw(iov.iov_base as *mut c_char)); + } + } + } + } +} + +/// Unmount the file system mounted at `mountpoint`. +/// +/// Useful flags include +/// * `MNT_FORCE` - Unmount even if still in use. +/// * `MNT_BYFSID` - `mountpoint` is not a path, but a file system ID +/// encoded as `FSID:val0:val1`, where `val0` and `val1` +/// are the contents of the `fsid_t val[]` array in decimal. +/// The file system that has the specified file system ID +/// will be unmounted. See +/// [`statfs`](crate::sys::statfs::statfs) to determine the +/// `fsid`. +pub fn unmount

(mountpoint: &P, flags: MntFlags) -> Result<()> + where P: ?Sized + NixPath +{ + let res = mountpoint.with_nix_path(|cstr| { + unsafe { libc::unmount(cstr.as_ptr(), flags.bits) } + })?; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/mount/linux.rs b/bash-5.1/vendor/nix-0.24.2/src/mount/linux.rs new file mode 100644 index 0000000000000000000000000000000000000000..4c976dcb5a241926a5bed4fa63a07054468c597c --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/mount/linux.rs @@ -0,0 +1,112 @@ +#![allow(missing_docs)] +use libc::{self, c_ulong, c_int}; +use crate::{Result, NixPath}; +use crate::errno::Errno; + +libc_bitflags!( + pub struct MsFlags: c_ulong { + /// Mount read-only + MS_RDONLY; + /// Ignore suid and sgid bits + MS_NOSUID; + /// Disallow access to device special files + MS_NODEV; + /// Disallow program execution + MS_NOEXEC; + /// Writes are synced at once + MS_SYNCHRONOUS; + /// Alter flags of a mounted FS + MS_REMOUNT; + /// Allow mandatory locks on a FS + MS_MANDLOCK; + /// Directory modifications are synchronous + MS_DIRSYNC; + /// Do not update access times + MS_NOATIME; + /// Do not update directory access times + MS_NODIRATIME; + /// Linux 2.4.0 - Bind directory at different place + MS_BIND; + MS_MOVE; + MS_REC; + MS_SILENT; + MS_POSIXACL; + MS_UNBINDABLE; + MS_PRIVATE; + MS_SLAVE; + MS_SHARED; + MS_RELATIME; + MS_KERNMOUNT; + MS_I_VERSION; + MS_STRICTATIME; + MS_LAZYTIME; + MS_ACTIVE; + MS_NOUSER; + MS_RMT_MASK; + MS_MGC_VAL; + MS_MGC_MSK; + } +); + +libc_bitflags!( + pub struct MntFlags: c_int { + MNT_FORCE; + MNT_DETACH; + MNT_EXPIRE; + UMOUNT_NOFOLLOW; + } +); + +pub fn mount( + source: Option<&P1>, + target: &P2, + fstype: Option<&P3>, + flags: MsFlags, + data: Option<&P4>) -> Result<()> { + + fn with_opt_nix_path(p: Option<&P>, f: F) -> Result + where P: ?Sized + NixPath, + F: FnOnce(*const libc::c_char) -> T + { + match p { + Some(path) => path.with_nix_path(|p_str| f(p_str.as_ptr())), + None => Ok(f(std::ptr::null())) + } + } + + let res = with_opt_nix_path(source, |s| { + target.with_nix_path(|t| { + with_opt_nix_path(fstype, |ty| { + with_opt_nix_path(data, |d| { + unsafe { + libc::mount( + s, + t.as_ptr(), + ty, + flags.bits, + d as *const libc::c_void + ) + } + }) + }) + }) + })????; + + Errno::result(res).map(drop) +} + +pub fn umount(target: &P) -> Result<()> { + let res = target.with_nix_path(|cstr| { + unsafe { libc::umount(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) +} + +pub fn umount2(target: &P, flags: MntFlags) -> Result<()> { + let res = target.with_nix_path(|cstr| { + unsafe { libc::umount2(cstr.as_ptr(), flags.bits) } + })?; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/mount/mod.rs b/bash-5.1/vendor/nix-0.24.2/src/mount/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..e89c1a07c386c3b76adfe5080e853c9f3726657e --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/mount/mod.rs @@ -0,0 +1,23 @@ +//! Mount file systems +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod linux; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::linux::*; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod bsd; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd" + ))] +pub use self::bsd::*; diff --git a/bash-5.1/vendor/nix-0.24.2/src/mqueue.rs b/bash-5.1/vendor/nix-0.24.2/src/mqueue.rs new file mode 100644 index 0000000000000000000000000000000000000000..792a5d229398f622e9d68012dbe23730e1c7f457 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/mqueue.rs @@ -0,0 +1,231 @@ +//! Posix Message Queue functions +//! +//! # Example +//! +// no_run because a kernel module may be required. +//! ```no_run +//! # use std::ffi::CString; +//! # use nix::mqueue::*; +//! use nix::sys::stat::Mode; +//! +//! const MSG_SIZE: mq_attr_member_t = 32; +//! let mq_name= CString::new("/a_nix_test_queue").unwrap(); +//! +//! let oflag0 = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; +//! let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; +//! let mqd0 = mq_open(&mq_name, oflag0, mode, None).unwrap(); +//! let msg_to_send = b"msg_1"; +//! mq_send(&mqd0, msg_to_send, 1).unwrap(); +//! +//! let oflag1 = MQ_OFlag::O_CREAT | MQ_OFlag::O_RDONLY; +//! let mqd1 = mq_open(&mq_name, oflag1, mode, None).unwrap(); +//! let mut buf = [0u8; 32]; +//! let mut prio = 0u32; +//! let len = mq_receive(&mqd1, &mut buf, &mut prio).unwrap(); +//! assert_eq!(prio, 1); +//! assert_eq!(msg_to_send, &buf[0..len]); +//! +//! mq_close(mqd1).unwrap(); +//! mq_close(mqd0).unwrap(); +//! ``` +//! [Further reading and details on the C API](https://man7.org/linux/man-pages/man7/mq_overview.7.html) + +use crate::Result; +use crate::errno::Errno; + +use libc::{self, c_char, mqd_t, size_t}; +use std::ffi::CStr; +use crate::sys::stat::Mode; +use std::mem; + +libc_bitflags!{ + pub struct MQ_OFlag: libc::c_int { + O_RDONLY; + O_WRONLY; + O_RDWR; + O_CREAT; + O_EXCL; + O_NONBLOCK; + O_CLOEXEC; + } +} + +libc_bitflags!{ + pub struct FdFlag: libc::c_int { + FD_CLOEXEC; + } +} + +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct MqAttr { + mq_attr: libc::mq_attr, +} + +/// Identifies an open POSIX Message Queue +// A safer wrapper around libc::mqd_t, which is a pointer on some platforms +// Deliberately is not Clone to prevent use-after-close scenarios +#[repr(transparent)] +#[derive(Debug)] +#[allow(missing_copy_implementations)] +pub struct MqdT(mqd_t); + +// x32 compatibility +// See https://sourceware.org/bugzilla/show_bug.cgi?id=21279 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub type mq_attr_member_t = i64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub type mq_attr_member_t = libc::c_long; + +impl MqAttr { + pub fn new(mq_flags: mq_attr_member_t, + mq_maxmsg: mq_attr_member_t, + mq_msgsize: mq_attr_member_t, + mq_curmsgs: mq_attr_member_t) + -> MqAttr + { + let mut attr = mem::MaybeUninit::::uninit(); + unsafe { + let p = attr.as_mut_ptr(); + (*p).mq_flags = mq_flags; + (*p).mq_maxmsg = mq_maxmsg; + (*p).mq_msgsize = mq_msgsize; + (*p).mq_curmsgs = mq_curmsgs; + MqAttr { mq_attr: attr.assume_init() } + } + } + + pub const fn flags(&self) -> mq_attr_member_t { + self.mq_attr.mq_flags + } + + /// The max number of messages that can be held by the queue + pub const fn maxmsg(&self) -> mq_attr_member_t { + self.mq_attr.mq_maxmsg + } + + /// The maximum size of each message (in bytes) + pub const fn msgsize(&self) -> mq_attr_member_t { + self.mq_attr.mq_msgsize + } + + /// The number of messages currently held in the queue + pub const fn curmsgs(&self) -> mq_attr_member_t { + self.mq_attr.mq_curmsgs + } +} + + +/// Open a message queue +/// +/// See also [`mq_open(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_open.html) +// The mode.bits cast is only lossless on some OSes +#[allow(clippy::cast_lossless)] +pub fn mq_open(name: &CStr, + oflag: MQ_OFlag, + mode: Mode, + attr: Option<&MqAttr>) + -> Result { + let res = match attr { + Some(mq_attr) => unsafe { + libc::mq_open(name.as_ptr(), + oflag.bits(), + mode.bits() as libc::c_int, + &mq_attr.mq_attr as *const libc::mq_attr) + }, + None => unsafe { libc::mq_open(name.as_ptr(), oflag.bits()) }, + }; + Errno::result(res).map(MqdT) +} + +/// Remove a message queue +/// +/// See also [`mq_unlink(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_unlink.html) +pub fn mq_unlink(name: &CStr) -> Result<()> { + let res = unsafe { libc::mq_unlink(name.as_ptr()) }; + Errno::result(res).map(drop) +} + +/// Close a message queue +/// +/// See also [`mq_close(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_close.html) +pub fn mq_close(mqdes: MqdT) -> Result<()> { + let res = unsafe { libc::mq_close(mqdes.0) }; + Errno::result(res).map(drop) +} + +/// Receive a message from a message queue +/// +/// See also [`mq_receive(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_receive.html) +pub fn mq_receive(mqdes: &MqdT, message: &mut [u8], msg_prio: &mut u32) -> Result { + let len = message.len() as size_t; + let res = unsafe { + libc::mq_receive(mqdes.0, + message.as_mut_ptr() as *mut c_char, + len, + msg_prio as *mut u32) + }; + Errno::result(res).map(|r| r as usize) +} + +/// Send a message to a message queue +/// +/// See also [`mq_send(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_send.html) +pub fn mq_send(mqdes: &MqdT, message: &[u8], msq_prio: u32) -> Result<()> { + let res = unsafe { + libc::mq_send(mqdes.0, + message.as_ptr() as *const c_char, + message.len(), + msq_prio) + }; + Errno::result(res).map(drop) +} + +/// Get message queue attributes +/// +/// See also [`mq_getattr(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_getattr.html) +pub fn mq_getattr(mqd: &MqdT) -> Result { + let mut attr = mem::MaybeUninit::::uninit(); + let res = unsafe { libc::mq_getattr(mqd.0, attr.as_mut_ptr()) }; + Errno::result(res).map(|_| unsafe{MqAttr { mq_attr: attr.assume_init() }}) +} + +/// Set the attributes of the message queue. Only `O_NONBLOCK` can be set, everything else will be ignored +/// Returns the old attributes +/// It is recommend to use the `mq_set_nonblock()` and `mq_remove_nonblock()` convenience functions as they are easier to use +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_setattr.html) +pub fn mq_setattr(mqd: &MqdT, newattr: &MqAttr) -> Result { + let mut attr = mem::MaybeUninit::::uninit(); + let res = unsafe { + libc::mq_setattr(mqd.0, &newattr.mq_attr as *const libc::mq_attr, attr.as_mut_ptr()) + }; + Errno::result(res).map(|_| unsafe{ MqAttr { mq_attr: attr.assume_init() }}) +} + +/// Convenience function. +/// Sets the `O_NONBLOCK` attribute for a given message queue descriptor +/// Returns the old attributes +#[allow(clippy::useless_conversion)] // Not useless on all OSes +pub fn mq_set_nonblock(mqd: &MqdT) -> Result { + let oldattr = mq_getattr(mqd)?; + let newattr = MqAttr::new(mq_attr_member_t::from(MQ_OFlag::O_NONBLOCK.bits()), + oldattr.mq_attr.mq_maxmsg, + oldattr.mq_attr.mq_msgsize, + oldattr.mq_attr.mq_curmsgs); + mq_setattr(mqd, &newattr) +} + +/// Convenience function. +/// Removes `O_NONBLOCK` attribute for a given message queue descriptor +/// Returns the old attributes +pub fn mq_remove_nonblock(mqd: &MqdT) -> Result { + let oldattr = mq_getattr(mqd)?; + let newattr = MqAttr::new(0, + oldattr.mq_attr.mq_maxmsg, + oldattr.mq_attr.mq_msgsize, + oldattr.mq_attr.mq_curmsgs); + mq_setattr(mqd, &newattr) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/net/if_.rs b/bash-5.1/vendor/nix-0.24.2/src/net/if_.rs new file mode 100644 index 0000000000000000000000000000000000000000..ebe8bcceeb3c77c82251a4c6e8db6f82278c235d --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/net/if_.rs @@ -0,0 +1,468 @@ +//! Network interface name resolution. +//! +//! Uses Linux and/or POSIX functions to resolve interface names like "eth0" +//! or "socan1" into device numbers. + +use crate::{Error, NixPath, Result}; +use libc::c_uint; + +/// Resolve an interface into a interface number. +pub fn if_nametoindex(name: &P) -> Result { + let if_index = name.with_nix_path(|name| unsafe { libc::if_nametoindex(name.as_ptr()) })?; + + if if_index == 0 { + Err(Error::last()) + } else { + Ok(if_index) + } +} + +libc_bitflags!( + /// Standard interface flags, used by `getifaddrs` + pub struct InterfaceFlags: libc::c_int { + /// Interface is running. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_UP; + /// Valid broadcast address set. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_BROADCAST; + /// Internal debugging flag. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_DEBUG; + /// Interface is a loopback interface. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_LOOPBACK; + /// Interface is a point-to-point link. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_POINTOPOINT; + /// Avoid use of trailers. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NOTRAILERS; + /// Interface manages own routes. + #[cfg(any(target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_SMART; + /// Resources allocated. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "illumos", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_RUNNING; + /// No arp protocol, L2 destination address not set. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_NOARP; + /// Interface is in promiscuous mode. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_PROMISC; + /// Receive all multicast packets. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_ALLMULTI; + /// Master of a load balancing bundle. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_MASTER; + /// transmission in progress, tx hardware queue is full + #[cfg(any(target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_OACTIVE; + /// Protocol code on board. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_INTELLIGENT; + /// Slave of a load balancing bundle. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_SLAVE; + /// Can't hear own transmissions. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "osx"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_SIMPLEX; + /// Supports multicast. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_MULTICAST; + /// Per link layer defined bit. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_LINK0; + /// Multicast using broadcast. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_MULTI_BCAST; + /// Is able to select media type via ifmap. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_PORTSEL; + /// Per link layer defined bit. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_LINK1; + /// Non-unique address. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_UNNUMBERED; + /// Auto media selection active. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_AUTOMEDIA; + /// Per link layer defined bit. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_LINK2; + /// Use alternate physical connection. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_ALTPHYS; + /// DHCP controls interface. + #[cfg(any(target_os = "solaris", target_os = "illumos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DHCPRUNNING; + /// The addresses are lost when the interface goes down. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DYNAMIC; + /// Do not advertise. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_PRIVATE; + /// Driver signals L1 up. Volatile. + #[cfg(any(target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_LOWER_UP; + /// Interface is in polling mode. + #[cfg(any(target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_POLLING_COMPAT; + /// Unconfigurable using ioctl(2). + #[cfg(any(target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_CANTCONFIG; + /// Do not transmit packets. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NOXMIT; + /// Driver signals dormant. Volatile. + #[cfg(any(target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DORMANT; + /// User-requested promisc mode. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_PPROMISC; + /// Just on-link subnet. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NOLOCAL; + /// Echo sent packets. Volatile. + #[cfg(any(target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_ECHO; + /// User-requested monitor mode. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_MONITOR; + /// Address is deprecated. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DEPRECATED; + /// Static ARP. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_STATICARP; + /// Address from stateless addrconf. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_ADDRCONF; + /// Interface is in polling mode. + #[cfg(any(target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NPOLLING; + /// Router on interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_ROUTER; + /// Interface is in polling mode. + #[cfg(any(target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_IDIRECT; + /// Interface is winding down + #[cfg(any(target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DYING; + /// No NUD on interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NONUD; + /// Interface is being renamed + #[cfg(any(target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_RENAMING; + /// Anycast address. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_ANYCAST; + /// Don't exchange routing info. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NORTEXCH; + /// Do not provide packet information + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NO_PI as libc::c_int; + /// TUN device (no Ethernet headers) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_TUN as libc::c_int; + /// TAP device + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_TAP as libc::c_int; + /// IPv4 interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_IPV4; + /// IPv6 interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_IPV6; + /// in.mpathd test address + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NOFAILOVER; + /// Interface has failed + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_FAILED; + /// Interface is a hot-spare + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_STANDBY; + /// Functioning but not used + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_INACTIVE; + /// Interface is offline + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_OFFLINE; + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_COS_ENABLED; + /// Prefer as source addr. + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_PREFERRED; + /// RFC3041 + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_TEMPORARY; + /// MTU set with SIOCSLIFMTU + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_FIXEDMTU; + /// Cannot send / receive packets + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_VIRTUAL; + /// Local address in use + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DUPLICATE; + /// IPMP IP interface + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_IPMP; + } +); + +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod if_nameindex { + use super::*; + + use std::ffi::CStr; + use std::fmt; + use std::marker::PhantomData; + use std::ptr::NonNull; + + /// A network interface. Has a name like "eth0" or "wlp4s0" or "wlan0", as well as an index + /// (1, 2, 3, etc) that identifies it in the OS's networking stack. + #[allow(missing_copy_implementations)] + #[repr(transparent)] + pub struct Interface(libc::if_nameindex); + + impl Interface { + /// Obtain the index of this interface. + pub fn index(&self) -> c_uint { + self.0.if_index + } + + /// Obtain the name of this interface. + pub fn name(&self) -> &CStr { + unsafe { CStr::from_ptr(self.0.if_name) } + } + } + + impl fmt::Debug for Interface { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Interface") + .field("index", &self.index()) + .field("name", &self.name()) + .finish() + } + } + + /// A list of the network interfaces available on this system. Obtained from [`if_nameindex()`]. + pub struct Interfaces { + ptr: NonNull, + } + + impl Interfaces { + /// Iterate over the interfaces in this list. + #[inline] + pub fn iter(&self) -> InterfacesIter<'_> { + self.into_iter() + } + + /// Convert this to a slice of interfaces. Note that the underlying interfaces list is + /// null-terminated, so calling this calculates the length. If random access isn't needed, + /// [`Interfaces::iter()`] should be used instead. + pub fn to_slice(&self) -> &[Interface] { + let ifs = self.ptr.as_ptr() as *const Interface; + let len = self.iter().count(); + unsafe { std::slice::from_raw_parts(ifs, len) } + } + } + + impl Drop for Interfaces { + fn drop(&mut self) { + unsafe { libc::if_freenameindex(self.ptr.as_ptr()) }; + } + } + + impl fmt::Debug for Interfaces { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.to_slice().fmt(f) + } + } + + impl<'a> IntoIterator for &'a Interfaces { + type IntoIter = InterfacesIter<'a>; + type Item = &'a Interface; + #[inline] + fn into_iter(self) -> Self::IntoIter { + InterfacesIter { + ptr: self.ptr.as_ptr(), + _marker: PhantomData, + } + } + } + + /// An iterator over the interfaces in an [`Interfaces`]. + #[derive(Debug)] + pub struct InterfacesIter<'a> { + ptr: *const libc::if_nameindex, + _marker: PhantomData<&'a Interfaces>, + } + + impl<'a> Iterator for InterfacesIter<'a> { + type Item = &'a Interface; + #[inline] + fn next(&mut self) -> Option { + unsafe { + if (*self.ptr).if_index == 0 { + None + } else { + let ret = &*(self.ptr as *const Interface); + self.ptr = self.ptr.add(1); + Some(ret) + } + } + } + } + + /// Retrieve a list of the network interfaces available on the local system. + /// + /// ``` + /// let interfaces = nix::net::if_::if_nameindex().unwrap(); + /// for iface in &interfaces { + /// println!("Interface #{} is called {}", iface.index(), iface.name().to_string_lossy()); + /// } + /// ``` + pub fn if_nameindex() -> Result { + unsafe { + let ifs = libc::if_nameindex(); + let ptr = NonNull::new(ifs).ok_or_else(Error::last)?; + Ok(Interfaces { ptr }) + } + } +} +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +pub use if_nameindex::*; diff --git a/bash-5.1/vendor/nix-0.24.2/src/net/mod.rs b/bash-5.1/vendor/nix-0.24.2/src/net/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..079fcfde6fd4436e3b595295ff9e4c18f20b002c --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/net/mod.rs @@ -0,0 +1,4 @@ +//! Functionality involving network interfaces +// To avoid clashing with the keyword "if", we use "if_" as the module name. +// The original header is called "net/if.h". +pub mod if_; diff --git a/bash-5.1/vendor/nix-0.24.2/src/poll.rs b/bash-5.1/vendor/nix-0.24.2/src/poll.rs new file mode 100644 index 0000000000000000000000000000000000000000..6d332b03500138416ba3c7cfdc01d48b0686bc75 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/poll.rs @@ -0,0 +1,171 @@ +//! Wait for events to trigger on specific file descriptors +use std::os::unix::io::{AsRawFd, RawFd}; + +use crate::Result; +use crate::errno::Errno; + +/// This is a wrapper around `libc::pollfd`. +/// +/// It's meant to be used as an argument to the [`poll`](fn.poll.html) and +/// [`ppoll`](fn.ppoll.html) functions to specify the events of interest +/// for a specific file descriptor. +/// +/// After a call to `poll` or `ppoll`, the events that occurred can be +/// retrieved by calling [`revents()`](#method.revents) on the `PollFd`. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct PollFd { + pollfd: libc::pollfd, +} + +impl PollFd { + /// Creates a new `PollFd` specifying the events of interest + /// for a given file descriptor. + pub const fn new(fd: RawFd, events: PollFlags) -> PollFd { + PollFd { + pollfd: libc::pollfd { + fd, + events: events.bits(), + revents: PollFlags::empty().bits(), + }, + } + } + + /// Returns the events that occurred in the last call to `poll` or `ppoll`. Will only return + /// `None` if the kernel provides status flags that Nix does not know about. + pub fn revents(self) -> Option { + PollFlags::from_bits(self.pollfd.revents) + } + + /// The events of interest for this `PollFd`. + pub fn events(self) -> PollFlags { + PollFlags::from_bits(self.pollfd.events).unwrap() + } + + /// Modify the events of interest for this `PollFd`. + pub fn set_events(&mut self, events: PollFlags) { + self.pollfd.events = events.bits(); + } +} + +impl AsRawFd for PollFd { + fn as_raw_fd(&self) -> RawFd { + self.pollfd.fd + } +} + +libc_bitflags! { + /// These flags define the different events that can be monitored by `poll` and `ppoll` + pub struct PollFlags: libc::c_short { + /// There is data to read. + POLLIN; + /// There is some exceptional condition on the file descriptor. + /// + /// Possibilities include: + /// + /// * There is out-of-band data on a TCP socket (see + /// [tcp(7)](https://man7.org/linux/man-pages/man7/tcp.7.html)). + /// * A pseudoterminal master in packet mode has seen a state + /// change on the slave (see + /// [ioctl_tty(2)](https://man7.org/linux/man-pages/man2/ioctl_tty.2.html)). + /// * A cgroup.events file has been modified (see + /// [cgroups(7)](https://man7.org/linux/man-pages/man7/cgroups.7.html)). + POLLPRI; + /// Writing is now possible, though a write larger that the + /// available space in a socket or pipe will still block (unless + /// `O_NONBLOCK` is set). + POLLOUT; + /// Equivalent to [`POLLIN`](constant.POLLIN.html) + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + POLLRDNORM; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Equivalent to [`POLLOUT`](constant.POLLOUT.html) + POLLWRNORM; + /// Priority band data can be read (generally unused on Linux). + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + POLLRDBAND; + /// Priority data may be written. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + POLLWRBAND; + /// Error condition (only returned in + /// [`PollFd::revents`](struct.PollFd.html#method.revents); + /// ignored in [`PollFd::new`](struct.PollFd.html#method.new)). + /// This bit is also set for a file descriptor referring to the + /// write end of a pipe when the read end has been closed. + POLLERR; + /// Hang up (only returned in [`PollFd::revents`](struct.PollFd.html#method.revents); + /// ignored in [`PollFd::new`](struct.PollFd.html#method.new)). + /// Note that when reading from a channel such as a pipe or a stream + /// socket, this event merely indicates that the peer closed its + /// end of the channel. Subsequent reads from the channel will + /// return 0 (end of file) only after all outstanding data in the + /// channel has been consumed. + POLLHUP; + /// Invalid request: `fd` not open (only returned in + /// [`PollFd::revents`](struct.PollFd.html#method.revents); + /// ignored in [`PollFd::new`](struct.PollFd.html#method.new)). + POLLNVAL; + } +} + +/// `poll` waits for one of a set of file descriptors to become ready to perform I/O. +/// ([`poll(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html)) +/// +/// `fds` contains all [`PollFd`](struct.PollFd.html) to poll. +/// The function will return as soon as any event occur for any of these `PollFd`s. +/// +/// The `timeout` argument specifies the number of milliseconds that `poll()` +/// should block waiting for a file descriptor to become ready. The call +/// will block until either: +/// +/// * a file descriptor becomes ready; +/// * the call is interrupted by a signal handler; or +/// * the timeout expires. +/// +/// Note that the timeout interval will be rounded up to the system clock +/// granularity, and kernel scheduling delays mean that the blocking +/// interval may overrun by a small amount. Specifying a negative value +/// in timeout means an infinite timeout. Specifying a timeout of zero +/// causes `poll()` to return immediately, even if no file descriptors are +/// ready. +pub fn poll(fds: &mut [PollFd], timeout: libc::c_int) -> Result { + let res = unsafe { + libc::poll(fds.as_mut_ptr() as *mut libc::pollfd, + fds.len() as libc::nfds_t, + timeout) + }; + + Errno::result(res) +} + +feature! { +#![feature = "signal"] +/// `ppoll()` allows an application to safely wait until either a file +/// descriptor becomes ready or until a signal is caught. +/// ([`poll(2)`](https://man7.org/linux/man-pages/man2/poll.2.html)) +/// +/// `ppoll` behaves like `poll`, but let you specify what signals may interrupt it +/// with the `sigmask` argument. If you want `ppoll` to block indefinitely, +/// specify `None` as `timeout` (it is like `timeout = -1` for `poll`). +/// +#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux"))] +pub fn ppoll( + fds: &mut [PollFd], + timeout: Option, + sigmask: crate::sys::signal::SigSet + ) -> Result +{ + let timeout = timeout.as_ref().map_or(core::ptr::null(), |r| r.as_ref()); + let res = unsafe { + libc::ppoll(fds.as_mut_ptr() as *mut libc::pollfd, + fds.len() as libc::nfds_t, + timeout, + sigmask.as_ref()) + }; + Errno::result(res) +} +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/pty.rs b/bash-5.1/vendor/nix-0.24.2/src/pty.rs new file mode 100644 index 0000000000000000000000000000000000000000..bb266a65bb854c90e0922ef4573c7844e363ae42 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/pty.rs @@ -0,0 +1,371 @@ +//! Create master and slave virtual pseudo-terminals (PTYs) + +pub use libc::pid_t as SessionId; +pub use libc::winsize as Winsize; + +use std::ffi::CStr; +use std::io; +use std::mem; +use std::os::unix::prelude::*; + +use crate::sys::termios::Termios; +#[cfg(feature = "process")] +use crate::unistd::{ForkResult, Pid}; +use crate::{Result, fcntl, unistd}; +use crate::errno::Errno; + +/// Representation of a master/slave pty pair +/// +/// This is returned by `openpty`. Note that this type does *not* implement `Drop`, so the user +/// must manually close the file descriptors. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct OpenptyResult { + /// The master port in a virtual pty pair + pub master: RawFd, + /// The slave port in a virtual pty pair + pub slave: RawFd, +} + +feature! { +#![feature = "process"] +/// Representation of a master with a forked pty +/// +/// This is returned by `forkpty`. Note that this type does *not* implement `Drop`, so the user +/// must manually close the file descriptors. +#[derive(Clone, Copy, Debug)] +pub struct ForkptyResult { + /// The master port in a virtual pty pair + pub master: RawFd, + /// Metadata about forked process + pub fork_result: ForkResult, +} +} + + +/// Representation of the Master device in a master/slave pty pair +/// +/// While this datatype is a thin wrapper around `RawFd`, it enforces that the available PTY +/// functions are given the correct file descriptor. Additionally this type implements `Drop`, +/// so that when it's consumed or goes out of scope, it's automatically cleaned-up. +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct PtyMaster(RawFd); + +impl AsRawFd for PtyMaster { + fn as_raw_fd(&self) -> RawFd { + self.0 + } +} + +impl IntoRawFd for PtyMaster { + fn into_raw_fd(self) -> RawFd { + let fd = self.0; + mem::forget(self); + fd + } +} + +impl Drop for PtyMaster { + fn drop(&mut self) { + // On drop, we ignore errors like EINTR and EIO because there's no clear + // way to handle them, we can't return anything, and (on FreeBSD at + // least) the file descriptor is deallocated in these cases. However, + // we must panic on EBADF, because it is always an error to close an + // invalid file descriptor. That frequently indicates a double-close + // condition, which can cause confusing errors for future I/O + // operations. + let e = unistd::close(self.0); + if e == Err(Errno::EBADF) { + panic!("Closing an invalid file descriptor!"); + }; + } +} + +impl io::Read for PtyMaster { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + unistd::read(self.0, buf).map_err(io::Error::from) + } +} + +impl io::Write for PtyMaster { + fn write(&mut self, buf: &[u8]) -> io::Result { + unistd::write(self.0, buf).map_err(io::Error::from) + } + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } +} + +impl io::Read for &PtyMaster { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + unistd::read(self.0, buf).map_err(io::Error::from) + } +} + +impl io::Write for &PtyMaster { + fn write(&mut self, buf: &[u8]) -> io::Result { + unistd::write(self.0, buf).map_err(io::Error::from) + } + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } +} + +/// Grant access to a slave pseudoterminal (see +/// [`grantpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/grantpt.html)) +/// +/// `grantpt()` changes the mode and owner of the slave pseudoterminal device corresponding to the +/// master pseudoterminal referred to by `fd`. This is a necessary step towards opening the slave. +#[inline] +pub fn grantpt(fd: &PtyMaster) -> Result<()> { + if unsafe { libc::grantpt(fd.as_raw_fd()) } < 0 { + return Err(Errno::last()); + } + + Ok(()) +} + +/// Open a pseudoterminal device (see +/// [`posix_openpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_openpt.html)) +/// +/// `posix_openpt()` returns a file descriptor to an existing unused pseudoterminal master device. +/// +/// # Examples +/// +/// A common use case with this function is to open both a master and slave PTY pair. This can be +/// done as follows: +/// +/// ``` +/// use std::path::Path; +/// use nix::fcntl::{OFlag, open}; +/// use nix::pty::{grantpt, posix_openpt, ptsname, unlockpt}; +/// use nix::sys::stat::Mode; +/// +/// # #[allow(dead_code)] +/// # fn run() -> nix::Result<()> { +/// // Open a new PTY master +/// let master_fd = posix_openpt(OFlag::O_RDWR)?; +/// +/// // Allow a slave to be generated for it +/// grantpt(&master_fd)?; +/// unlockpt(&master_fd)?; +/// +/// // Get the name of the slave +/// let slave_name = unsafe { ptsname(&master_fd) }?; +/// +/// // Try to open the slave +/// let _slave_fd = open(Path::new(&slave_name), OFlag::O_RDWR, Mode::empty())?; +/// # Ok(()) +/// # } +/// ``` +#[inline] +pub fn posix_openpt(flags: fcntl::OFlag) -> Result { + let fd = unsafe { + libc::posix_openpt(flags.bits()) + }; + + if fd < 0 { + return Err(Errno::last()); + } + + Ok(PtyMaster(fd)) +} + +/// Get the name of the slave pseudoterminal (see +/// [`ptsname(3)`](https://man7.org/linux/man-pages/man3/ptsname.3.html)) +/// +/// `ptsname()` returns the name of the slave pseudoterminal device corresponding to the master +/// referred to by `fd`. +/// +/// This value is useful for opening the slave pty once the master has already been opened with +/// `posix_openpt()`. +/// +/// # Safety +/// +/// `ptsname()` mutates global variables and is *not* threadsafe. +/// Mutating global variables is always considered `unsafe` by Rust and this +/// function is marked as `unsafe` to reflect that. +/// +/// For a threadsafe and non-`unsafe` alternative on Linux, see `ptsname_r()`. +#[inline] +pub unsafe fn ptsname(fd: &PtyMaster) -> Result { + let name_ptr = libc::ptsname(fd.as_raw_fd()); + if name_ptr.is_null() { + return Err(Errno::last()); + } + + let name = CStr::from_ptr(name_ptr); + Ok(name.to_string_lossy().into_owned()) +} + +/// Get the name of the slave pseudoterminal (see +/// [`ptsname(3)`](https://man7.org/linux/man-pages/man3/ptsname.3.html)) +/// +/// `ptsname_r()` returns the name of the slave pseudoterminal device corresponding to the master +/// referred to by `fd`. This is the threadsafe version of `ptsname()`, but it is not part of the +/// POSIX standard and is instead a Linux-specific extension. +/// +/// This value is useful for opening the slave ptty once the master has already been opened with +/// `posix_openpt()`. +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +#[inline] +pub fn ptsname_r(fd: &PtyMaster) -> Result { + let mut name_buf = Vec::::with_capacity(64); + let name_buf_ptr = name_buf.as_mut_ptr(); + let cname = unsafe { + let cap = name_buf.capacity(); + if libc::ptsname_r(fd.as_raw_fd(), name_buf_ptr, cap) != 0 { + return Err(crate::Error::last()); + } + CStr::from_ptr(name_buf.as_ptr()) + }; + + let name = cname.to_string_lossy().into_owned(); + Ok(name) +} + +/// Unlock a pseudoterminal master/slave pseudoterminal pair (see +/// [`unlockpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlockpt.html)) +/// +/// `unlockpt()` unlocks the slave pseudoterminal device corresponding to the master pseudoterminal +/// referred to by `fd`. This must be called before trying to open the slave side of a +/// pseudoterminal. +#[inline] +pub fn unlockpt(fd: &PtyMaster) -> Result<()> { + if unsafe { libc::unlockpt(fd.as_raw_fd()) } < 0 { + return Err(Errno::last()); + } + + Ok(()) +} + + +/// Create a new pseudoterminal, returning the slave and master file descriptors +/// in `OpenptyResult` +/// (see [`openpty`](https://man7.org/linux/man-pages/man3/openpty.3.html)). +/// +/// If `winsize` is not `None`, the window size of the slave will be set to +/// the values in `winsize`. If `termios` is not `None`, the pseudoterminal's +/// terminal settings of the slave will be set to the values in `termios`. +#[inline] +pub fn openpty<'a, 'b, T: Into>, U: Into>>(winsize: T, termios: U) -> Result { + use std::ptr; + + let mut slave = mem::MaybeUninit::::uninit(); + let mut master = mem::MaybeUninit::::uninit(); + let ret = { + match (termios.into(), winsize.into()) { + (Some(termios), Some(winsize)) => { + let inner_termios = termios.get_libc_termios(); + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + &*inner_termios as *const libc::termios as *mut _, + winsize as *const Winsize as *mut _, + ) + } + } + (None, Some(winsize)) => { + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + ptr::null_mut(), + winsize as *const Winsize as *mut _, + ) + } + } + (Some(termios), None) => { + let inner_termios = termios.get_libc_termios(); + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + &*inner_termios as *const libc::termios as *mut _, + ptr::null_mut(), + ) + } + } + (None, None) => { + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + ptr::null_mut(), + ptr::null_mut(), + ) + } + } + } + }; + + Errno::result(ret)?; + + unsafe { + Ok(OpenptyResult { + master: master.assume_init(), + slave: slave.assume_init(), + }) + } +} + +feature! { +#![feature = "process"] +/// Create a new pseudoterminal, returning the master file descriptor and forked pid. +/// in `ForkptyResult` +/// (see [`forkpty`](https://man7.org/linux/man-pages/man3/forkpty.3.html)). +/// +/// If `winsize` is not `None`, the window size of the slave will be set to +/// the values in `winsize`. If `termios` is not `None`, the pseudoterminal's +/// terminal settings of the slave will be set to the values in `termios`. +/// +/// # Safety +/// +/// In a multithreaded program, only [async-signal-safe] functions like `pause` +/// and `_exit` may be called by the child (the parent isn't restricted). Note +/// that memory allocation may **not** be async-signal-safe and thus must be +/// prevented. +/// +/// Those functions are only a small subset of your operating system's API, so +/// special care must be taken to only invoke code you can control and audit. +/// +/// [async-signal-safe]: https://man7.org/linux/man-pages/man7/signal-safety.7.html +pub unsafe fn forkpty<'a, 'b, T: Into>, U: Into>>( + winsize: T, + termios: U, +) -> Result { + use std::ptr; + + let mut master = mem::MaybeUninit::::uninit(); + + let term = match termios.into() { + Some(termios) => { + let inner_termios = termios.get_libc_termios(); + &*inner_termios as *const libc::termios as *mut _ + }, + None => ptr::null_mut(), + }; + + let win = winsize + .into() + .map(|ws| ws as *const Winsize as *mut _) + .unwrap_or(ptr::null_mut()); + + let res = libc::forkpty(master.as_mut_ptr(), ptr::null_mut(), term, win); + + let fork_result = Errno::result(res).map(|res| match res { + 0 => ForkResult::Child, + res => ForkResult::Parent { child: Pid::from_raw(res) }, + })?; + + Ok(ForkptyResult { + master: master.assume_init(), + fork_result, + }) +} +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sched.rs b/bash-5.1/vendor/nix-0.24.2/src/sched.rs new file mode 100644 index 0000000000000000000000000000000000000000..e736f8d2493d1a94335cfebfa5026e9feff24289 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sched.rs @@ -0,0 +1,294 @@ +//! Execution scheduling +//! +//! See Also +//! [sched.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sched.h.html) +use crate::{Errno, Result}; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::sched_linux_like::*; + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod sched_linux_like { + use crate::errno::Errno; + use libc::{self, c_int, c_void}; + use std::mem; + use std::option::Option; + use std::os::unix::io::RawFd; + use crate::unistd::Pid; + use crate::Result; + + // For some functions taking with a parameter of type CloneFlags, + // only a subset of these flags have an effect. + libc_bitflags! { + /// Options for use with [`clone`] + pub struct CloneFlags: c_int { + /// The calling process and the child process run in the same + /// memory space. + CLONE_VM; + /// The caller and the child process share the same filesystem + /// information. + CLONE_FS; + /// The calling process and the child process share the same file + /// descriptor table. + CLONE_FILES; + /// The calling process and the child process share the same table + /// of signal handlers. + CLONE_SIGHAND; + /// If the calling process is being traced, then trace the child + /// also. + CLONE_PTRACE; + /// The execution of the calling process is suspended until the + /// child releases its virtual memory resources via a call to + /// execve(2) or _exit(2) (as with vfork(2)). + CLONE_VFORK; + /// The parent of the new child (as returned by getppid(2)) + /// will be the same as that of the calling process. + CLONE_PARENT; + /// The child is placed in the same thread group as the calling + /// process. + CLONE_THREAD; + /// The cloned child is started in a new mount namespace. + CLONE_NEWNS; + /// The child and the calling process share a single list of System + /// V semaphore adjustment values + CLONE_SYSVSEM; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_SETTLS; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_PARENT_SETTID; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_CHILD_CLEARTID; + /// Unused since Linux 2.6.2 + #[deprecated(since = "0.23.0", note = "Deprecated by Linux 2.6.2")] + CLONE_DETACHED; + /// A tracing process cannot force `CLONE_PTRACE` on this child + /// process. + CLONE_UNTRACED; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_CHILD_SETTID; + /// Create the process in a new cgroup namespace. + CLONE_NEWCGROUP; + /// Create the process in a new UTS namespace. + CLONE_NEWUTS; + /// Create the process in a new IPC namespace. + CLONE_NEWIPC; + /// Create the process in a new user namespace. + CLONE_NEWUSER; + /// Create the process in a new PID namespace. + CLONE_NEWPID; + /// Create the process in a new network namespace. + CLONE_NEWNET; + /// The new process shares an I/O context with the calling process. + CLONE_IO; + } + } + + /// Type for the function executed by [`clone`]. + pub type CloneCb<'a> = Box isize + 'a>; + + /// `clone` create a child process + /// ([`clone(2)`](https://man7.org/linux/man-pages/man2/clone.2.html)) + /// + /// `stack` is a reference to an array which will hold the stack of the new + /// process. Unlike when calling `clone(2)` from C, the provided stack + /// address need not be the highest address of the region. Nix will take + /// care of that requirement. The user only needs to provide a reference to + /// a normally allocated buffer. + pub fn clone( + mut cb: CloneCb, + stack: &mut [u8], + flags: CloneFlags, + signal: Option, + ) -> Result { + extern "C" fn callback(data: *mut CloneCb) -> c_int { + let cb: &mut CloneCb = unsafe { &mut *data }; + (*cb)() as c_int + } + + let res = unsafe { + let combined = flags.bits() | signal.unwrap_or(0); + let ptr = stack.as_mut_ptr().add(stack.len()); + let ptr_aligned = ptr.sub(ptr as usize % 16); + libc::clone( + mem::transmute( + callback as extern "C" fn(*mut Box isize>) -> i32, + ), + ptr_aligned as *mut c_void, + combined, + &mut cb as *mut _ as *mut c_void, + ) + }; + + Errno::result(res).map(Pid::from_raw) + } + + /// disassociate parts of the process execution context + /// + /// See also [unshare(2)](https://man7.org/linux/man-pages/man2/unshare.2.html) + pub fn unshare(flags: CloneFlags) -> Result<()> { + let res = unsafe { libc::unshare(flags.bits()) }; + + Errno::result(res).map(drop) + } + + /// reassociate thread with a namespace + /// + /// See also [setns(2)](https://man7.org/linux/man-pages/man2/setns.2.html) + pub fn setns(fd: RawFd, nstype: CloneFlags) -> Result<()> { + let res = unsafe { libc::setns(fd, nstype.bits()) }; + + Errno::result(res).map(drop) + } +} + +#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "linux"))] +pub use self::sched_affinity::*; + +#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "linux"))] +mod sched_affinity { + use crate::errno::Errno; + use std::mem; + use crate::unistd::Pid; + use crate::Result; + + /// CpuSet represent a bit-mask of CPUs. + /// CpuSets are used by sched_setaffinity and + /// sched_getaffinity for example. + /// + /// This is a wrapper around `libc::cpu_set_t`. + #[repr(C)] + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct CpuSet { + cpu_set: libc::cpu_set_t, + } + + impl CpuSet { + /// Create a new and empty CpuSet. + pub fn new() -> CpuSet { + CpuSet { + cpu_set: unsafe { mem::zeroed() }, + } + } + + /// Test to see if a CPU is in the CpuSet. + /// `field` is the CPU id to test + pub fn is_set(&self, field: usize) -> Result { + if field >= CpuSet::count() { + Err(Errno::EINVAL) + } else { + Ok(unsafe { libc::CPU_ISSET(field, &self.cpu_set) }) + } + } + + /// Add a CPU to CpuSet. + /// `field` is the CPU id to add + pub fn set(&mut self, field: usize) -> Result<()> { + if field >= CpuSet::count() { + Err(Errno::EINVAL) + } else { + unsafe { libc::CPU_SET(field, &mut self.cpu_set); } + Ok(()) + } + } + + /// Remove a CPU from CpuSet. + /// `field` is the CPU id to remove + pub fn unset(&mut self, field: usize) -> Result<()> { + if field >= CpuSet::count() { + Err(Errno::EINVAL) + } else { + unsafe { libc::CPU_CLR(field, &mut self.cpu_set);} + Ok(()) + } + } + + /// Return the maximum number of CPU in CpuSet + pub const fn count() -> usize { + 8 * mem::size_of::() + } + } + + impl Default for CpuSet { + fn default() -> Self { + Self::new() + } + } + + /// `sched_setaffinity` set a thread's CPU affinity mask + /// ([`sched_setaffinity(2)`](https://man7.org/linux/man-pages/man2/sched_setaffinity.2.html)) + /// + /// `pid` is the thread ID to update. + /// If pid is zero, then the calling thread is updated. + /// + /// The `cpuset` argument specifies the set of CPUs on which the thread + /// will be eligible to run. + /// + /// # Example + /// + /// Binding the current thread to CPU 0 can be done as follows: + /// + /// ```rust,no_run + /// use nix::sched::{CpuSet, sched_setaffinity}; + /// use nix::unistd::Pid; + /// + /// let mut cpu_set = CpuSet::new(); + /// cpu_set.set(0); + /// sched_setaffinity(Pid::from_raw(0), &cpu_set); + /// ``` + pub fn sched_setaffinity(pid: Pid, cpuset: &CpuSet) -> Result<()> { + let res = unsafe { + libc::sched_setaffinity( + pid.into(), + mem::size_of::() as libc::size_t, + &cpuset.cpu_set, + ) + }; + + Errno::result(res).map(drop) + } + + /// `sched_getaffinity` get a thread's CPU affinity mask + /// ([`sched_getaffinity(2)`](https://man7.org/linux/man-pages/man2/sched_getaffinity.2.html)) + /// + /// `pid` is the thread ID to check. + /// If pid is zero, then the calling thread is checked. + /// + /// Returned `cpuset` is the set of CPUs on which the thread + /// is eligible to run. + /// + /// # Example + /// + /// Checking if the current thread can run on CPU 0 can be done as follows: + /// + /// ```rust,no_run + /// use nix::sched::sched_getaffinity; + /// use nix::unistd::Pid; + /// + /// let cpu_set = sched_getaffinity(Pid::from_raw(0)).unwrap(); + /// if cpu_set.is_set(0).unwrap() { + /// println!("Current thread can run on CPU 0"); + /// } + /// ``` + pub fn sched_getaffinity(pid: Pid) -> Result { + let mut cpuset = CpuSet::new(); + let res = unsafe { + libc::sched_getaffinity( + pid.into(), + mem::size_of::() as libc::size_t, + &mut cpuset.cpu_set, + ) + }; + + Errno::result(res).and(Ok(cpuset)) + } +} + +/// Explicitly yield the processor to other threads. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_yield.html) +pub fn sched_yield() -> Result<()> { + let res = unsafe { libc::sched_yield() }; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/aio.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/aio.rs new file mode 100644 index 0000000000000000000000000000000000000000..4780cdee334143a623d27e154ea3349f6944857e --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/aio.rs @@ -0,0 +1,1129 @@ +// vim: tw=80 +//! POSIX Asynchronous I/O +//! +//! The POSIX AIO interface is used for asynchronous I/O on files and disk-like +//! devices. It supports [`read`](struct.AioCb.html#method.read), +//! [`write`](struct.AioCb.html#method.write), and +//! [`fsync`](struct.AioCb.html#method.fsync) operations. Completion +//! notifications can optionally be delivered via +//! [signals](../signal/enum.SigevNotify.html#variant.SigevSignal), via the +//! [`aio_suspend`](fn.aio_suspend.html) function, or via polling. Some +//! platforms support other completion +//! notifications, such as +//! [kevent](../signal/enum.SigevNotify.html#variant.SigevKevent). +//! +//! Multiple operations may be submitted in a batch with +//! [`lio_listio`](fn.lio_listio.html), though the standard does not guarantee +//! that they will be executed atomically. +//! +//! Outstanding operations may be cancelled with +//! [`cancel`](struct.AioCb.html#method.cancel) or +//! [`aio_cancel_all`](fn.aio_cancel_all.html), though the operating system may +//! not support this for all filesystems and devices. + +use crate::Result; +use crate::errno::Errno; +use std::os::unix::io::RawFd; +use libc::{c_void, off_t, size_t}; +use std::fmt; +use std::fmt::Debug; +use std::marker::PhantomData; +use std::mem; +use std::pin::Pin; +use std::ptr::{null, null_mut}; +use crate::sys::signal::*; +use std::thread; +use crate::sys::time::TimeSpec; + +libc_enum! { + /// Mode for `AioCb::fsync`. Controls whether only data or both data and + /// metadata are synced. + #[repr(i32)] + #[non_exhaustive] + pub enum AioFsyncMode { + /// do it like `fsync` + O_SYNC, + /// on supported operating systems only, do it like `fdatasync` + #[cfg(any(target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_DSYNC + } +} + +libc_enum! { + /// When used with [`lio_listio`](fn.lio_listio.html), determines whether a + /// given `aiocb` should be used for a read operation, a write operation, or + /// ignored. Has no effect for any other aio functions. + #[repr(i32)] + #[non_exhaustive] + pub enum LioOpcode { + /// No operation + LIO_NOP, + /// Write data as if by a call to [`AioCb::write`] + LIO_WRITE, + /// Write data as if by a call to [`AioCb::read`] + LIO_READ, + } +} + +libc_enum! { + /// Mode for [`lio_listio`](fn.lio_listio.html) + #[repr(i32)] + pub enum LioMode { + /// Requests that [`lio_listio`](fn.lio_listio.html) block until all + /// requested operations have been completed + LIO_WAIT, + /// Requests that [`lio_listio`](fn.lio_listio.html) return immediately + LIO_NOWAIT, + } +} + +/// Return values for [`AioCb::cancel`](struct.AioCb.html#method.cancel) and +/// [`aio_cancel_all`](fn.aio_cancel_all.html) +#[repr(i32)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum AioCancelStat { + /// All outstanding requests were canceled + AioCanceled = libc::AIO_CANCELED, + /// Some requests were not canceled. Their status should be checked with + /// `AioCb::error` + AioNotCanceled = libc::AIO_NOTCANCELED, + /// All of the requests have already finished + AioAllDone = libc::AIO_ALLDONE, +} + +/// Newtype that adds Send and Sync to libc::aiocb, which contains raw pointers +#[repr(transparent)] +struct LibcAiocb(libc::aiocb); + +unsafe impl Send for LibcAiocb {} +unsafe impl Sync for LibcAiocb {} + +/// AIO Control Block. +/// +/// The basic structure used by all aio functions. Each `AioCb` represents one +/// I/O request. +pub struct AioCb<'a> { + aiocb: LibcAiocb, + /// Tracks whether the buffer pointed to by `libc::aiocb.aio_buf` is mutable + mutable: bool, + /// Could this `AioCb` potentially have any in-kernel state? + in_progress: bool, + _buffer: std::marker::PhantomData<&'a [u8]>, + _pin: std::marker::PhantomPinned +} + +impl<'a> AioCb<'a> { + /// Returns the underlying file descriptor associated with the `AioCb` + pub fn fd(&self) -> RawFd { + self.aiocb.0.aio_fildes + } + + /// Constructs a new `AioCb` with no associated buffer. + /// + /// The resulting `AioCb` structure is suitable for use with `AioCb::fsync`. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio`. + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// + /// # Examples + /// + /// Create an `AioCb` from a raw file descriptor and use it for an + /// [`fsync`](#method.fsync) operation. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify::SigevNone; + /// # use std::{thread, time}; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// let f = tempfile().unwrap(); + /// let mut aiocb = AioCb::from_fd( f.as_raw_fd(), 0, SigevNone); + /// aiocb.fsync(AioFsyncMode::O_SYNC).expect("aio_fsync failed early"); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// aiocb.aio_return().expect("aio_fsync failed late"); + /// ``` + pub fn from_fd(fd: RawFd, prio: libc::c_int, + sigev_notify: SigevNotify) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = 0; + a.0.aio_nbytes = 0; + a.0.aio_buf = null_mut(); + + Box::pin(AioCb { + aiocb: a, + mutable: false, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + }) + } + + // Private helper + #[cfg(not(any(target_os = "ios", target_os = "macos")))] + fn from_mut_slice_unpinned(fd: RawFd, offs: off_t, buf: &'a mut [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> AioCb<'a> + { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = buf.len() as size_t; + a.0.aio_buf = buf.as_ptr() as *mut c_void; + a.0.aio_lio_opcode = opcode as libc::c_int; + + AioCb { + aiocb: a, + mutable: true, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + } + } + + /// Constructs a new `AioCb` from a mutable slice. + /// + /// The resulting `AioCb` will be suitable for both read and write + /// operations, but only if the borrow checker can guarantee that the slice + /// will outlive the `AioCb`. That will usually be the case if the `AioCb` + /// is stack-allocated. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `offs`: File offset + /// * `buf`: A memory buffer + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// * `opcode`: This field is only used for `lio_listio`. It + /// determines which operation to use for this individual + /// aiocb + /// + /// # Examples + /// + /// Create an `AioCb` from a mutable slice and read into it. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::io::Write; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const INITIAL: &[u8] = b"abcdef123456"; + /// const LEN: usize = 4; + /// let mut rbuf = vec![0; LEN]; + /// let mut f = tempfile().unwrap(); + /// f.write_all(INITIAL).unwrap(); + /// { + /// let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + /// 2, //offset + /// &mut rbuf, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.read().unwrap(); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// assert_eq!(aiocb.aio_return().unwrap() as usize, LEN); + /// } + /// assert_eq!(rbuf, b"cdef"); + /// ``` + pub fn from_mut_slice(fd: RawFd, offs: off_t, buf: &'a mut [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = buf.len() as size_t; + a.0.aio_buf = buf.as_ptr() as *mut c_void; + a.0.aio_lio_opcode = opcode as libc::c_int; + + Box::pin(AioCb { + aiocb: a, + mutable: true, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + }) + } + + /// Constructs a new `AioCb` from a mutable raw pointer + /// + /// Unlike `from_mut_slice`, this method returns a structure suitable for + /// placement on the heap. It may be used for both reads and writes. Due + /// to its unsafety, this method is not recommended. It is most useful when + /// heap allocation is required. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `offs`: File offset + /// * `buf`: Pointer to the memory buffer + /// * `len`: Length of the buffer pointed to by `buf` + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// * `opcode`: This field is only used for `lio_listio`. It + /// determines which operation to use for this individual + /// aiocb + /// + /// # Safety + /// + /// The caller must ensure that the storage pointed to by `buf` outlives the + /// `AioCb`. The lifetime checker can't help here. + pub unsafe fn from_mut_ptr(fd: RawFd, offs: off_t, + buf: *mut c_void, len: usize, + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = len; + a.0.aio_buf = buf; + a.0.aio_lio_opcode = opcode as libc::c_int; + + Box::pin(AioCb { + aiocb: a, + mutable: true, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned, + }) + } + + /// Constructs a new `AioCb` from a raw pointer. + /// + /// Unlike `from_slice`, this method returns a structure suitable for + /// placement on the heap. Due to its unsafety, this method is not + /// recommended. It is most useful when heap allocation is required. + /// + /// # Parameters + /// + /// * `fd`: File descriptor. Required for all aio functions. + /// * `offs`: File offset + /// * `buf`: Pointer to the memory buffer + /// * `len`: Length of the buffer pointed to by `buf` + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + /// * `opcode`: This field is only used for `lio_listio`. It + /// determines which operation to use for this individual + /// aiocb + /// + /// # Safety + /// + /// The caller must ensure that the storage pointed to by `buf` outlives the + /// `AioCb`. The lifetime checker can't help here. + pub unsafe fn from_ptr(fd: RawFd, offs: off_t, + buf: *const c_void, len: usize, + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin>> { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = len; + // casting a const ptr to a mutable ptr here is ok, because we set the + // AioCb's mutable field to false + a.0.aio_buf = buf as *mut c_void; + a.0.aio_lio_opcode = opcode as libc::c_int; + + Box::pin(AioCb { + aiocb: a, + mutable: false, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + }) + } + + // Private helper + fn from_slice_unpinned(fd: RawFd, offs: off_t, buf: &'a [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> AioCb + { + let mut a = AioCb::common_init(fd, prio, sigev_notify); + a.0.aio_offset = offs; + a.0.aio_nbytes = buf.len() as size_t; + // casting an immutable buffer to a mutable pointer looks unsafe, + // but technically its only unsafe to dereference it, not to create + // it. + a.0.aio_buf = buf.as_ptr() as *mut c_void; + assert!(opcode != LioOpcode::LIO_READ, "Can't read into an immutable buffer"); + a.0.aio_lio_opcode = opcode as libc::c_int; + + AioCb { + aiocb: a, + mutable: false, + in_progress: false, + _buffer: PhantomData, + _pin: std::marker::PhantomPinned + } + } + + /// Like [`AioCb::from_mut_slice`], but works on constant slices rather than + /// mutable slices. + /// + /// An `AioCb` created this way cannot be used with `read`, and its + /// `LioOpcode` cannot be set to `LIO_READ`. This method is useful when + /// writing a const buffer with `AioCb::write`, since `from_mut_slice` can't + /// work with const buffers. + /// + /// # Examples + /// + /// Construct an `AioCb` from a slice and use it for writing. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.write().unwrap(); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); + /// ``` + // Note: another solution to the problem of writing const buffers would be + // to genericize AioCb for both &mut [u8] and &[u8] buffers. AioCb::read + // could take the former and AioCb::write could take the latter. However, + // then lio_listio wouldn't work, because that function needs a slice of + // AioCb, and they must all be of the same type. + pub fn from_slice(fd: RawFd, offs: off_t, buf: &'a [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Pin> + { + Box::pin(AioCb::from_slice_unpinned(fd, offs, buf, prio, sigev_notify, + opcode)) + } + + fn common_init(fd: RawFd, prio: libc::c_int, + sigev_notify: SigevNotify) -> LibcAiocb { + // Use mem::zeroed instead of explicitly zeroing each field, because the + // number and name of reserved fields is OS-dependent. On some OSes, + // some reserved fields are used the kernel for state, and must be + // explicitly zeroed when allocated. + let mut a = unsafe { mem::zeroed::()}; + a.aio_fildes = fd; + a.aio_reqprio = prio; + a.aio_sigevent = SigEvent::new(sigev_notify).sigevent(); + LibcAiocb(a) + } + + /// Update the notification settings for an existing `aiocb` + pub fn set_sigev_notify(self: &mut Pin>, + sigev_notify: SigevNotify) + { + // Safe because we don't move any of the data + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + selfp.aiocb.0.aio_sigevent = SigEvent::new(sigev_notify).sigevent(); + } + + /// Cancels an outstanding AIO request. + /// + /// The operating system is not required to implement cancellation for all + /// file and device types. Even if it does, there is no guarantee that the + /// operation has not already completed. So the caller must check the + /// result and handle operations that were not canceled or that have already + /// completed. + /// + /// # Examples + /// + /// Cancel an outstanding aio operation. Note that we must still call + /// `aio_return` to free resources, even though we don't care about the + /// result. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::io::Write; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// let wbuf = b"CDEF"; + /// let mut f = tempfile().unwrap(); + /// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + /// 2, //offset + /// &wbuf[..], + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.write().unwrap(); + /// let cs = aiocb.cancel().unwrap(); + /// if cs == AioCancelStat::AioNotCanceled { + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// } + /// // Must call `aio_return`, but ignore the result + /// let _ = aiocb.aio_return(); + /// ``` + /// + /// # References + /// + /// [aio_cancel](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html) + pub fn cancel(self: &mut Pin>) -> Result { + let r = unsafe { + let selfp = self.as_mut().get_unchecked_mut(); + libc::aio_cancel(selfp.aiocb.0.aio_fildes, &mut selfp.aiocb.0) + }; + match r { + libc::AIO_CANCELED => Ok(AioCancelStat::AioCanceled), + libc::AIO_NOTCANCELED => Ok(AioCancelStat::AioNotCanceled), + libc::AIO_ALLDONE => Ok(AioCancelStat::AioAllDone), + -1 => Err(Errno::last()), + _ => panic!("unknown aio_cancel return value") + } + } + + fn error_unpinned(&mut self) -> Result<()> { + let r = unsafe { + libc::aio_error(&mut self.aiocb.0 as *mut libc::aiocb) + }; + match r { + 0 => Ok(()), + num if num > 0 => Err(Errno::from_i32(num)), + -1 => Err(Errno::last()), + num => panic!("unknown aio_error return value {:?}", num) + } + } + + /// Retrieve error status of an asynchronous operation. + /// + /// If the request has not yet completed, returns `EINPROGRESS`. Otherwise, + /// returns `Ok` or any other error. + /// + /// # Examples + /// + /// Issue an aio operation and use `error` to poll for completion. Polling + /// is an alternative to `aio_suspend`, used by most of the other examples. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_NOP); + /// aiocb.write().unwrap(); + /// while (aiocb.error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); + /// ``` + /// + /// # References + /// + /// [aio_error](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_error.html) + pub fn error(self: &mut Pin>) -> Result<()> { + // Safe because error_unpinned doesn't move the data + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + selfp.error_unpinned() + } + + /// An asynchronous version of `fsync(2)`. + /// + /// # References + /// + /// [aio_fsync](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_fsync.html) + pub fn fsync(self: &mut Pin>, mode: AioFsyncMode) -> Result<()> { + // Safe because we don't move the libc::aiocb + unsafe { + let selfp = self.as_mut().get_unchecked_mut(); + Errno::result({ + let p: *mut libc::aiocb = &mut selfp.aiocb.0; + libc::aio_fsync(mode as libc::c_int, p) + }).map(|_| { + selfp.in_progress = true; + }) + } + } + + /// Returns the `aiocb`'s `LioOpcode` field + /// + /// If the value cannot be represented as an `LioOpcode`, returns `None` + /// instead. + pub fn lio_opcode(&self) -> Option { + match self.aiocb.0.aio_lio_opcode { + libc::LIO_READ => Some(LioOpcode::LIO_READ), + libc::LIO_WRITE => Some(LioOpcode::LIO_WRITE), + libc::LIO_NOP => Some(LioOpcode::LIO_NOP), + _ => None + } + } + + /// Returns the requested length of the aio operation in bytes + /// + /// This method returns the *requested* length of the operation. To get the + /// number of bytes actually read or written by a completed operation, use + /// `aio_return` instead. + pub fn nbytes(&self) -> usize { + self.aiocb.0.aio_nbytes + } + + /// Returns the file offset stored in the `AioCb` + pub fn offset(&self) -> off_t { + self.aiocb.0.aio_offset + } + + /// Returns the priority of the `AioCb` + pub fn priority(&self) -> libc::c_int { + self.aiocb.0.aio_reqprio + } + + /// Asynchronously reads from a file descriptor into a buffer + /// + /// # References + /// + /// [aio_read](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_read.html) + pub fn read(self: &mut Pin>) -> Result<()> { + assert!(self.mutable, "Can't read into an immutable buffer"); + // Safe because we don't move anything + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + Errno::result({ + let p: *mut libc::aiocb = &mut selfp.aiocb.0; + unsafe { libc::aio_read(p) } + }).map(|_| { + selfp.in_progress = true; + }) + } + + /// Returns the `SigEvent` stored in the `AioCb` + pub fn sigevent(&self) -> SigEvent { + SigEvent::from(&self.aiocb.0.aio_sigevent) + } + + fn aio_return_unpinned(&mut self) -> Result { + unsafe { + let p: *mut libc::aiocb = &mut self.aiocb.0; + self.in_progress = false; + Errno::result(libc::aio_return(p)) + } + } + + /// Retrieve return status of an asynchronous operation. + /// + /// Should only be called once for each `AioCb`, after `AioCb::error` + /// indicates that it has completed. The result is the same as for the + /// synchronous `read(2)`, `write(2)`, of `fsync(2)` functions. + /// + /// # References + /// + /// [aio_return](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_return.html) + // Note: this should be just `return`, but that's a reserved word + pub fn aio_return(self: &mut Pin>) -> Result { + // Safe because aio_return_unpinned does not move the data + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + selfp.aio_return_unpinned() + } + + /// Asynchronously writes from a buffer to a file descriptor + /// + /// # References + /// + /// [aio_write](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_write.html) + pub fn write(self: &mut Pin>) -> Result<()> { + // Safe because we don't move anything + let selfp = unsafe { + self.as_mut().get_unchecked_mut() + }; + Errno::result({ + let p: *mut libc::aiocb = &mut selfp.aiocb.0; + unsafe{ libc::aio_write(p) } + }).map(|_| { + selfp.in_progress = true; + }) + } +} + +/// Cancels outstanding AIO requests for a given file descriptor. +/// +/// # Examples +/// +/// Issue an aio operation, then cancel all outstanding operations on that file +/// descriptor. +/// +/// ``` +/// # use nix::errno::Errno; +/// # use nix::Error; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use std::{thread, time}; +/// # use std::io::Write; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// let wbuf = b"CDEF"; +/// let mut f = tempfile().unwrap(); +/// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), +/// 2, //offset +/// &wbuf[..], +/// 0, //priority +/// SigevNotify::SigevNone, +/// LioOpcode::LIO_NOP); +/// aiocb.write().unwrap(); +/// let cs = aio_cancel_all(f.as_raw_fd()).unwrap(); +/// if cs == AioCancelStat::AioNotCanceled { +/// while (aiocb.error() == Err(Errno::EINPROGRESS)) { +/// thread::sleep(time::Duration::from_millis(10)); +/// } +/// } +/// // Must call `aio_return`, but ignore the result +/// let _ = aiocb.aio_return(); +/// ``` +/// +/// # References +/// +/// [`aio_cancel`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html) +pub fn aio_cancel_all(fd: RawFd) -> Result { + match unsafe { libc::aio_cancel(fd, null_mut()) } { + libc::AIO_CANCELED => Ok(AioCancelStat::AioCanceled), + libc::AIO_NOTCANCELED => Ok(AioCancelStat::AioNotCanceled), + libc::AIO_ALLDONE => Ok(AioCancelStat::AioAllDone), + -1 => Err(Errno::last()), + _ => panic!("unknown aio_cancel return value") + } +} + +/// Suspends the calling process until at least one of the specified `AioCb`s +/// has completed, a signal is delivered, or the timeout has passed. +/// +/// If `timeout` is `None`, `aio_suspend` will block indefinitely. +/// +/// # Examples +/// +/// Use `aio_suspend` to block until an aio operation completes. +/// +/// ``` +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// const WBUF: &[u8] = b"abcdef123456"; +/// let mut f = tempfile().unwrap(); +/// let mut aiocb = AioCb::from_slice( f.as_raw_fd(), +/// 2, //offset +/// WBUF, +/// 0, //priority +/// SigevNotify::SigevNone, +/// LioOpcode::LIO_NOP); +/// aiocb.write().unwrap(); +/// aio_suspend(&[aiocb.as_ref()], None).expect("aio_suspend failed"); +/// assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); +/// ``` +/// # References +/// +/// [`aio_suspend`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_suspend.html) +pub fn aio_suspend(list: &[Pin<&AioCb>], timeout: Option) -> Result<()> { + let plist = list as *const [Pin<&AioCb>] as *const [*const libc::aiocb]; + let p = plist as *const *const libc::aiocb; + let timep = match timeout { + None => null::(), + Some(x) => x.as_ref() as *const libc::timespec + }; + Errno::result(unsafe { + libc::aio_suspend(p, list.len() as i32, timep) + }).map(drop) +} + +impl<'a> Debug for AioCb<'a> { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("AioCb") + .field("aiocb", &self.aiocb.0) + .field("mutable", &self.mutable) + .field("in_progress", &self.in_progress) + .finish() + } +} + +impl<'a> Drop for AioCb<'a> { + /// If the `AioCb` has no remaining state in the kernel, just drop it. + /// Otherwise, dropping constitutes a resource leak, which is an error + fn drop(&mut self) { + assert!(thread::panicking() || !self.in_progress, + "Dropped an in-progress AioCb"); + } +} + +/// LIO Control Block. +/// +/// The basic structure used to issue multiple AIO operations simultaneously. +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub struct LioCb<'a> { + /// A collection of [`AioCb`]s. All of these will be issued simultaneously + /// by the [`listio`] method. + /// + /// [`AioCb`]: struct.AioCb.html + /// [`listio`]: #method.listio + // Their locations in memory must be fixed once they are passed to the + // kernel. So this field must be non-public so the user can't swap. + aiocbs: Box<[AioCb<'a>]>, + + /// The actual list passed to `libc::lio_listio`. + /// + /// It must live for as long as any of the operations are still being + /// processesed, because the aio subsystem uses its address as a unique + /// identifier. + list: Vec<*mut libc::aiocb>, + + /// A partial set of results. This field will get populated by + /// `listio_resubmit` when an `LioCb` is resubmitted after an error + results: Vec>> +} + +/// LioCb can't automatically impl Send and Sync just because of the raw +/// pointers in list. But that's stupid. There's no reason that raw pointers +/// should automatically be non-Send +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +unsafe impl<'a> Send for LioCb<'a> {} +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +unsafe impl<'a> Sync for LioCb<'a> {} + +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +impl<'a> LioCb<'a> { + /// Are no [`AioCb`]s contained? + pub fn is_empty(&self) -> bool { + self.aiocbs.is_empty() + } + + /// Return the number of individual [`AioCb`]s contained. + pub fn len(&self) -> usize { + self.aiocbs.len() + } + + /// Submits multiple asynchronous I/O requests with a single system call. + /// + /// They are not guaranteed to complete atomically, and the order in which + /// the requests are carried out is not specified. Reads, writes, and + /// fsyncs may be freely mixed. + /// + /// This function is useful for reducing the context-switch overhead of + /// submitting many AIO operations. It can also be used with + /// `LioMode::LIO_WAIT` to block on the result of several independent + /// operations. Used that way, it is often useful in programs that + /// otherwise make little use of AIO. + /// + /// # Examples + /// + /// Use `listio` to submit an aio operation and wait for its completion. In + /// this case, there is no need to use [`aio_suspend`] to wait or + /// [`AioCb::error`] to poll. + /// + /// ``` + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut liocb = LioCbBuilder::with_capacity(1) + /// .emplace_slice( + /// f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_WRITE + /// ).finish(); + /// liocb.listio(LioMode::LIO_WAIT, + /// SigevNotify::SigevNone).unwrap(); + /// assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + /// ``` + /// + /// # References + /// + /// [`lio_listio`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lio_listio.html) + /// + /// [`aio_suspend`]: fn.aio_suspend.html + /// [`AioCb::error`]: struct.AioCb.html#method.error + pub fn listio(&mut self, mode: LioMode, + sigev_notify: SigevNotify) -> Result<()> { + let sigev = SigEvent::new(sigev_notify); + let sigevp = &mut sigev.sigevent() as *mut libc::sigevent; + self.list.clear(); + for a in &mut self.aiocbs.iter_mut() { + a.in_progress = true; + self.list.push(a as *mut AioCb<'a> + as *mut libc::aiocb); + } + let p = self.list.as_ptr(); + Errno::result(unsafe { + libc::lio_listio(mode as i32, p, self.list.len() as i32, sigevp) + }).map(drop) + } + + /// Resubmits any incomplete operations with [`lio_listio`]. + /// + /// Sometimes, due to system resource limitations, an `lio_listio` call will + /// return `EIO`, or `EAGAIN`. Or, if a signal is received, it may return + /// `EINTR`. In any of these cases, only a subset of its constituent + /// operations will actually have been initiated. `listio_resubmit` will + /// resubmit any operations that are still uninitiated. + /// + /// After calling `listio_resubmit`, results should be collected by + /// [`LioCb::aio_return`]. + /// + /// # Examples + /// ```no_run + /// # use nix::Error; + /// # use nix::errno::Errno; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::os::unix::io::AsRawFd; + /// # use std::{thread, time}; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut liocb = LioCbBuilder::with_capacity(1) + /// .emplace_slice( + /// f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone, + /// LioOpcode::LIO_WRITE + /// ).finish(); + /// let mut err = liocb.listio(LioMode::LIO_WAIT, SigevNotify::SigevNone); + /// while err == Err(Errno::EIO) || + /// err == Err(Errno::EAGAIN) { + /// thread::sleep(time::Duration::from_millis(10)); + /// err = liocb.listio_resubmit(LioMode::LIO_WAIT, SigevNotify::SigevNone); + /// } + /// assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + /// ``` + /// + /// # References + /// + /// [`lio_listio`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lio_listio.html) + /// + /// [`lio_listio`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/lio_listio.html + /// [`LioCb::aio_return`]: struct.LioCb.html#method.aio_return + // Note: the addresses of any EINPROGRESS or EOK aiocbs _must_ not be + // changed by this method, because the kernel relies on their addresses + // being stable. + // Note: aiocbs that are Ok(()) must be finalized by aio_return, or else the + // sigev_notify will immediately refire. + pub fn listio_resubmit(&mut self, mode:LioMode, + sigev_notify: SigevNotify) -> Result<()> { + let sigev = SigEvent::new(sigev_notify); + let sigevp = &mut sigev.sigevent() as *mut libc::sigevent; + self.list.clear(); + + while self.results.len() < self.aiocbs.len() { + self.results.push(None); + } + + for (i, a) in self.aiocbs.iter_mut().enumerate() { + if self.results[i].is_some() { + // Already collected final status for this operation + continue; + } + match a.error_unpinned() { + Ok(()) => { + // aiocb is complete; collect its status and don't resubmit + self.results[i] = Some(a.aio_return_unpinned()); + }, + Err(Errno::EAGAIN) => { + self.list.push(a as *mut AioCb<'a> as *mut libc::aiocb); + }, + Err(Errno::EINPROGRESS) => { + // aiocb is was successfully queued; no need to do anything + }, + Err(Errno::EINVAL) => panic!( + "AioCb was never submitted, or already finalized"), + _ => unreachable!() + } + } + let p = self.list.as_ptr(); + Errno::result(unsafe { + libc::lio_listio(mode as i32, p, self.list.len() as i32, sigevp) + }).map(drop) + } + + /// Collect final status for an individual `AioCb` submitted as part of an + /// `LioCb`. + /// + /// This is just like [`AioCb::aio_return`], except it takes into account + /// operations that were restarted by [`LioCb::listio_resubmit`] + /// + /// [`AioCb::aio_return`]: struct.AioCb.html#method.aio_return + /// [`LioCb::listio_resubmit`]: #method.listio_resubmit + pub fn aio_return(&mut self, i: usize) -> Result { + if i >= self.results.len() || self.results[i].is_none() { + self.aiocbs[i].aio_return_unpinned() + } else { + self.results[i].unwrap() + } + } + + /// Retrieve error status of an individual `AioCb` submitted as part of an + /// `LioCb`. + /// + /// This is just like [`AioCb::error`], except it takes into account + /// operations that were restarted by [`LioCb::listio_resubmit`] + /// + /// [`AioCb::error`]: struct.AioCb.html#method.error + /// [`LioCb::listio_resubmit`]: #method.listio_resubmit + pub fn error(&mut self, i: usize) -> Result<()> { + if i >= self.results.len() || self.results[i].is_none() { + self.aiocbs[i].error_unpinned() + } else { + Ok(()) + } + } +} + +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +impl<'a> Debug for LioCb<'a> { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("LioCb") + .field("aiocbs", &self.aiocbs) + .finish() + } +} + +/// Used to construct `LioCb` +// This must be a separate class from LioCb due to pinning constraints. LioCb +// must use a boxed slice of AioCbs so they will have stable storage, but +// LioCbBuilder must use a Vec to make construction possible when the final size +// is unknown. +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +#[derive(Debug)] +pub struct LioCbBuilder<'a> { + /// A collection of [`AioCb`]s. + /// + /// [`AioCb`]: struct.AioCb.html + pub aiocbs: Vec>, +} + +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +impl<'a> LioCbBuilder<'a> { + /// Initialize an empty `LioCb` + pub fn with_capacity(capacity: usize) -> LioCbBuilder<'a> { + LioCbBuilder { + aiocbs: Vec::with_capacity(capacity), + } + } + + /// Add a new operation on an immutable slice to the [`LioCb`] under + /// construction. + /// + /// Arguments are the same as for [`AioCb::from_slice`] + /// + /// [`LioCb`]: struct.LioCb.html + /// [`AioCb::from_slice`]: struct.AioCb.html#method.from_slice + #[must_use] + pub fn emplace_slice(mut self, fd: RawFd, offs: off_t, buf: &'a [u8], + prio: libc::c_int, sigev_notify: SigevNotify, + opcode: LioOpcode) -> Self + { + self.aiocbs.push(AioCb::from_slice_unpinned(fd, offs, buf, prio, + sigev_notify, opcode)); + self + } + + /// Add a new operation on a mutable slice to the [`LioCb`] under + /// construction. + /// + /// Arguments are the same as for [`AioCb::from_mut_slice`] + /// + /// [`LioCb`]: struct.LioCb.html + /// [`AioCb::from_mut_slice`]: struct.AioCb.html#method.from_mut_slice + #[must_use] + pub fn emplace_mut_slice(mut self, fd: RawFd, offs: off_t, + buf: &'a mut [u8], prio: libc::c_int, + sigev_notify: SigevNotify, opcode: LioOpcode) + -> Self + { + self.aiocbs.push(AioCb::from_mut_slice_unpinned(fd, offs, buf, prio, + sigev_notify, opcode)); + self + } + + /// Finalize this [`LioCb`]. + /// + /// Afterwards it will be possible to issue the operations with + /// [`LioCb::listio`]. Conversely, it will no longer be possible to add new + /// operations with [`LioCbBuilder::emplace_slice`] or + /// [`LioCbBuilder::emplace_mut_slice`]. + /// + /// [`LioCb::listio`]: struct.LioCb.html#method.listio + /// [`LioCb::from_mut_slice`]: struct.LioCb.html#method.from_mut_slice + /// [`LioCb::from_slice`]: struct.LioCb.html#method.from_slice + pub fn finish(self) -> LioCb<'a> { + let len = self.aiocbs.len(); + LioCb { + aiocbs: self.aiocbs.into(), + list: Vec::with_capacity(len), + results: Vec::with_capacity(len) + } + } +} + +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg(test)] +mod t { + use super::*; + + // It's important that `LioCb` be `UnPin`. The tokio-file crate relies on + // it. + #[test] + fn liocb_is_unpin() { + use assert_impl::assert_impl; + + assert_impl!(Unpin: LioCb); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/epoll.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/epoll.rs new file mode 100644 index 0000000000000000000000000000000000000000..8141ff5cb3edd18d29b85538898598a9bc2aded6 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/epoll.rs @@ -0,0 +1,108 @@ +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_int}; +use std::os::unix::io::RawFd; +use std::ptr; +use std::mem; + +libc_bitflags!( + pub struct EpollFlags: c_int { + EPOLLIN; + EPOLLPRI; + EPOLLOUT; + EPOLLRDNORM; + EPOLLRDBAND; + EPOLLWRNORM; + EPOLLWRBAND; + EPOLLMSG; + EPOLLERR; + EPOLLHUP; + EPOLLRDHUP; + EPOLLEXCLUSIVE; + #[cfg(not(target_arch = "mips"))] + EPOLLWAKEUP; + EPOLLONESHOT; + EPOLLET; + } +); + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(i32)] +#[non_exhaustive] +pub enum EpollOp { + EpollCtlAdd = libc::EPOLL_CTL_ADD, + EpollCtlDel = libc::EPOLL_CTL_DEL, + EpollCtlMod = libc::EPOLL_CTL_MOD, +} + +libc_bitflags!{ + pub struct EpollCreateFlags: c_int { + EPOLL_CLOEXEC; + } +} + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct EpollEvent { + event: libc::epoll_event, +} + +impl EpollEvent { + pub fn new(events: EpollFlags, data: u64) -> Self { + EpollEvent { event: libc::epoll_event { events: events.bits() as u32, u64: data } } + } + + pub fn empty() -> Self { + unsafe { mem::zeroed::() } + } + + pub fn events(&self) -> EpollFlags { + EpollFlags::from_bits(self.event.events as c_int).unwrap() + } + + pub fn data(&self) -> u64 { + self.event.u64 + } +} + +#[inline] +pub fn epoll_create() -> Result { + let res = unsafe { libc::epoll_create(1024) }; + + Errno::result(res) +} + +#[inline] +pub fn epoll_create1(flags: EpollCreateFlags) -> Result { + let res = unsafe { libc::epoll_create1(flags.bits()) }; + + Errno::result(res) +} + +#[inline] +pub fn epoll_ctl<'a, T>(epfd: RawFd, op: EpollOp, fd: RawFd, event: T) -> Result<()> + where T: Into> +{ + let mut event: Option<&mut EpollEvent> = event.into(); + if event.is_none() && op != EpollOp::EpollCtlDel { + Err(Errno::EINVAL) + } else { + let res = unsafe { + if let Some(ref mut event) = event { + libc::epoll_ctl(epfd, op as c_int, fd, &mut event.event) + } else { + libc::epoll_ctl(epfd, op as c_int, fd, ptr::null_mut()) + } + }; + Errno::result(res).map(drop) + } +} + +#[inline] +pub fn epoll_wait(epfd: RawFd, events: &mut [EpollEvent], timeout_ms: isize) -> Result { + let res = unsafe { + libc::epoll_wait(epfd, events.as_mut_ptr() as *mut libc::epoll_event, events.len() as c_int, timeout_ms as c_int) + }; + + Errno::result(res).map(|r| r as usize) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/event.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/event.rs new file mode 100644 index 0000000000000000000000000000000000000000..9262accf2c9433546de5f9270df089e241124144 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/event.rs @@ -0,0 +1,347 @@ +/* TOOD: Implement for other kqueue based systems + */ + +use crate::{Errno, Result}; +#[cfg(not(target_os = "netbsd"))] +use libc::{timespec, time_t, c_int, c_long, intptr_t, uintptr_t}; +#[cfg(target_os = "netbsd")] +use libc::{timespec, time_t, c_long, intptr_t, uintptr_t, size_t}; +use std::convert::TryInto; +use std::os::unix::io::RawFd; +use std::ptr; + +// Redefine kevent in terms of programmer-friendly enums and bitfields. +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct KEvent { + kevent: libc::kevent, +} + +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "openbsd"))] +type type_of_udata = *mut libc::c_void; +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos"))] +type type_of_data = intptr_t; +#[cfg(any(target_os = "netbsd"))] +type type_of_udata = intptr_t; +#[cfg(any(target_os = "netbsd", target_os = "openbsd"))] +type type_of_data = i64; + +#[cfg(target_os = "netbsd")] +type type_of_event_filter = u32; +#[cfg(not(target_os = "netbsd"))] +type type_of_event_filter = i16; +libc_enum! { + #[cfg_attr(target_os = "netbsd", repr(u32))] + #[cfg_attr(not(target_os = "netbsd"), repr(i16))] + #[non_exhaustive] + pub enum EventFilter { + EVFILT_AIO, + /// Returns whenever there is no remaining data in the write buffer + #[cfg(target_os = "freebsd")] + EVFILT_EMPTY, + #[cfg(target_os = "dragonfly")] + EVFILT_EXCEPT, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] + EVFILT_FS, + #[cfg(target_os = "freebsd")] + EVFILT_LIO, + #[cfg(any(target_os = "ios", target_os = "macos"))] + EVFILT_MACHPORT, + EVFILT_PROC, + /// Returns events associated with the process referenced by a given + /// process descriptor, created by `pdfork()`. The events to monitor are: + /// + /// - NOTE_EXIT: the process has exited. The exit status will be stored in data. + #[cfg(target_os = "freebsd")] + EVFILT_PROCDESC, + EVFILT_READ, + /// Returns whenever an asynchronous `sendfile()` call completes. + #[cfg(target_os = "freebsd")] + EVFILT_SENDFILE, + EVFILT_SIGNAL, + EVFILT_TIMER, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] + EVFILT_USER, + #[cfg(any(target_os = "ios", target_os = "macos"))] + EVFILT_VM, + EVFILT_VNODE, + EVFILT_WRITE, + } + impl TryFrom +} + +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "openbsd"))] +pub type type_of_event_flag = u16; +#[cfg(any(target_os = "netbsd"))] +pub type type_of_event_flag = u32; +libc_bitflags!{ + pub struct EventFlag: type_of_event_flag { + EV_ADD; + EV_CLEAR; + EV_DELETE; + EV_DISABLE; + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + EV_DISPATCH; + #[cfg(target_os = "freebsd")] + EV_DROP; + EV_ENABLE; + EV_EOF; + EV_ERROR; + #[cfg(any(target_os = "macos", target_os = "ios"))] + EV_FLAG0; + EV_FLAG1; + #[cfg(target_os = "dragonfly")] + EV_NODATA; + EV_ONESHOT; + #[cfg(any(target_os = "macos", target_os = "ios"))] + EV_OOBAND; + #[cfg(any(target_os = "macos", target_os = "ios"))] + EV_POLL; + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + EV_RECEIPT; + } +} + +libc_bitflags!( + pub struct FilterFlag: u32 { + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_ABSOLUTE; + NOTE_ATTRIB; + NOTE_CHILD; + NOTE_DELETE; + #[cfg(target_os = "openbsd")] + NOTE_EOF; + NOTE_EXEC; + NOTE_EXIT; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_EXITSTATUS; + NOTE_EXTEND; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFAND; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFCOPY; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFCTRLMASK; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFLAGSMASK; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFNOP; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFOR; + NOTE_FORK; + NOTE_LINK; + NOTE_LOWAT; + #[cfg(target_os = "freebsd")] + NOTE_MSECONDS; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_NONE; + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))] + NOTE_NSECONDS; + #[cfg(target_os = "dragonfly")] + NOTE_OOB; + NOTE_PCTRLMASK; + NOTE_PDATAMASK; + NOTE_RENAME; + NOTE_REVOKE; + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))] + NOTE_SECONDS; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_SIGNAL; + NOTE_TRACK; + NOTE_TRACKERR; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_TRIGGER; + #[cfg(target_os = "openbsd")] + NOTE_TRUNCATE; + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))] + NOTE_USECONDS; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_ERROR; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_PRESSURE; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_PRESSURE_SUDDEN_TERMINATE; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_PRESSURE_TERMINATE; + NOTE_WRITE; + } +); + +pub fn kqueue() -> Result { + let res = unsafe { libc::kqueue() }; + + Errno::result(res) +} + + +// KEvent can't derive Send because on some operating systems, udata is defined +// as a void*. However, KEvent's public API always treats udata as an intptr_t, +// which is safe to Send. +unsafe impl Send for KEvent { +} + +impl KEvent { + pub fn new(ident: uintptr_t, filter: EventFilter, flags: EventFlag, + fflags:FilterFlag, data: intptr_t, udata: intptr_t) -> KEvent { + KEvent { kevent: libc::kevent { + ident, + filter: filter as type_of_event_filter, + flags: flags.bits(), + fflags: fflags.bits(), + data: data as type_of_data, + udata: udata as type_of_udata + } } + } + + pub fn ident(&self) -> uintptr_t { + self.kevent.ident + } + + pub fn filter(&self) -> Result { + self.kevent.filter.try_into() + } + + pub fn flags(&self) -> EventFlag { + EventFlag::from_bits(self.kevent.flags).unwrap() + } + + pub fn fflags(&self) -> FilterFlag { + FilterFlag::from_bits(self.kevent.fflags).unwrap() + } + + pub fn data(&self) -> intptr_t { + self.kevent.data as intptr_t + } + + pub fn udata(&self) -> intptr_t { + self.kevent.udata as intptr_t + } +} + +pub fn kevent(kq: RawFd, + changelist: &[KEvent], + eventlist: &mut [KEvent], + timeout_ms: usize) -> Result { + + // Convert ms to timespec + let timeout = timespec { + tv_sec: (timeout_ms / 1000) as time_t, + tv_nsec: ((timeout_ms % 1000) * 1_000_000) as c_long + }; + + kevent_ts(kq, changelist, eventlist, Some(timeout)) +} + +#[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd"))] +type type_of_nchanges = c_int; +#[cfg(target_os = "netbsd")] +type type_of_nchanges = size_t; + +pub fn kevent_ts(kq: RawFd, + changelist: &[KEvent], + eventlist: &mut [KEvent], + timeout_opt: Option) -> Result { + + let res = unsafe { + libc::kevent( + kq, + changelist.as_ptr() as *const libc::kevent, + changelist.len() as type_of_nchanges, + eventlist.as_mut_ptr() as *mut libc::kevent, + eventlist.len() as type_of_nchanges, + if let Some(ref timeout) = timeout_opt {timeout as *const timespec} else {ptr::null()}) + }; + + Errno::result(res).map(|r| r as usize) +} + +#[inline] +pub fn ev_set(ev: &mut KEvent, + ident: usize, + filter: EventFilter, + flags: EventFlag, + fflags: FilterFlag, + udata: intptr_t) { + + ev.kevent.ident = ident as uintptr_t; + ev.kevent.filter = filter as type_of_event_filter; + ev.kevent.flags = flags.bits(); + ev.kevent.fflags = fflags.bits(); + ev.kevent.data = 0; + ev.kevent.udata = udata as type_of_udata; +} + +#[test] +fn test_struct_kevent() { + use std::mem; + + let udata : intptr_t = 12345; + + let actual = KEvent::new(0xdead_beef, + EventFilter::EVFILT_READ, + EventFlag::EV_ONESHOT | EventFlag::EV_ADD, + FilterFlag::NOTE_CHILD | FilterFlag::NOTE_EXIT, + 0x1337, + udata); + assert_eq!(0xdead_beef, actual.ident()); + let filter = actual.kevent.filter; + assert_eq!(libc::EVFILT_READ, filter); + assert_eq!(libc::EV_ONESHOT | libc::EV_ADD, actual.flags().bits()); + assert_eq!(libc::NOTE_CHILD | libc::NOTE_EXIT, actual.fflags().bits()); + assert_eq!(0x1337, actual.data() as type_of_data); + assert_eq!(udata as type_of_udata, actual.udata() as type_of_udata); + assert_eq!(mem::size_of::(), mem::size_of::()); +} + +#[test] +fn test_kevent_filter() { + let udata : intptr_t = 12345; + + let actual = KEvent::new(0xdead_beef, + EventFilter::EVFILT_READ, + EventFlag::EV_ONESHOT | EventFlag::EV_ADD, + FilterFlag::NOTE_CHILD | FilterFlag::NOTE_EXIT, + 0x1337, + udata); + assert_eq!(EventFilter::EVFILT_READ, actual.filter().unwrap()); +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/eventfd.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/eventfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..c54f952f09a9ead9f04640ce69d374acbcf1bddd --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/eventfd.rs @@ -0,0 +1,17 @@ +use std::os::unix::io::RawFd; +use crate::Result; +use crate::errno::Errno; + +libc_bitflags! { + pub struct EfdFlags: libc::c_int { + EFD_CLOEXEC; // Since Linux 2.6.27 + EFD_NONBLOCK; // Since Linux 2.6.27 + EFD_SEMAPHORE; // Since Linux 2.6.30 + } +} + +pub fn eventfd(initval: libc::c_uint, flags: EfdFlags) -> Result { + let res = unsafe { libc::eventfd(initval, flags.bits()) }; + + Errno::result(res).map(|r| r as RawFd) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/inotify.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/inotify.rs new file mode 100644 index 0000000000000000000000000000000000000000..b19dbe12dd29562a352f588af6c07c528a46960f --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/inotify.rs @@ -0,0 +1,257 @@ +//! Monitoring API for filesystem events. +//! +//! Inotify is a Linux-only API to monitor filesystems events. +//! +//! For more documentation, please read [inotify(7)](https://man7.org/linux/man-pages/man7/inotify.7.html). +//! +//! # Examples +//! +//! Monitor all events happening in directory "test": +//! ```no_run +//! # use nix::sys::inotify::{AddWatchFlags,InitFlags,Inotify}; +//! # +//! // We create a new inotify instance. +//! let instance = Inotify::init(InitFlags::empty()).unwrap(); +//! +//! // We add a new watch on directory "test" for all events. +//! let wd = instance.add_watch("test", AddWatchFlags::IN_ALL_EVENTS).unwrap(); +//! +//! loop { +//! // We read from our inotify instance for events. +//! let events = instance.read_events().unwrap(); +//! println!("Events: {:?}", events); +//! } +//! ``` + +use libc::{ + c_char, + c_int, +}; +use std::ffi::{OsString,OsStr,CStr}; +use std::os::unix::ffi::OsStrExt; +use std::mem::{MaybeUninit, size_of}; +use std::os::unix::io::{RawFd,AsRawFd,FromRawFd}; +use std::ptr; +use crate::unistd::read; +use crate::Result; +use crate::NixPath; +use crate::errno::Errno; +use cfg_if::cfg_if; + +libc_bitflags! { + /// Configuration options for [`inotify_add_watch`](fn.inotify_add_watch.html). + pub struct AddWatchFlags: u32 { + /// File was accessed. + IN_ACCESS; + /// File was modified. + IN_MODIFY; + /// Metadata changed. + IN_ATTRIB; + /// Writable file was closed. + IN_CLOSE_WRITE; + /// Nonwritable file was closed. + IN_CLOSE_NOWRITE; + /// File was opened. + IN_OPEN; + /// File was moved from X. + IN_MOVED_FROM; + /// File was moved to Y. + IN_MOVED_TO; + /// Subfile was created. + IN_CREATE; + /// Subfile was deleted. + IN_DELETE; + /// Self was deleted. + IN_DELETE_SELF; + /// Self was moved. + IN_MOVE_SELF; + + /// Backing filesystem was unmounted. + IN_UNMOUNT; + /// Event queue overflowed. + IN_Q_OVERFLOW; + /// File was ignored. + IN_IGNORED; + + /// Combination of `IN_CLOSE_WRITE` and `IN_CLOSE_NOWRITE`. + IN_CLOSE; + /// Combination of `IN_MOVED_FROM` and `IN_MOVED_TO`. + IN_MOVE; + + /// Only watch the path if it is a directory. + IN_ONLYDIR; + /// Don't follow symlinks. + IN_DONT_FOLLOW; + + /// Event occurred against directory. + IN_ISDIR; + /// Only send event once. + IN_ONESHOT; + /// All of the events. + IN_ALL_EVENTS; + } +} + +libc_bitflags! { + /// Configuration options for [`inotify_init1`](fn.inotify_init1.html). + pub struct InitFlags: c_int { + /// Set the `FD_CLOEXEC` flag on the file descriptor. + IN_CLOEXEC; + /// Set the `O_NONBLOCK` flag on the open file description referred to by the new file descriptor. + IN_NONBLOCK; + } +} + +/// An inotify instance. This is also a file descriptor, you can feed it to +/// other interfaces consuming file descriptors, epoll for example. +#[derive(Debug, Clone, Copy)] +pub struct Inotify { + fd: RawFd +} + +/// This object is returned when you create a new watch on an inotify instance. +/// It is then returned as part of an event once triggered. It allows you to +/// know which watch triggered which event. +#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Ord, PartialOrd)] +pub struct WatchDescriptor { + wd: i32 +} + +/// A single inotify event. +/// +/// For more documentation see, [inotify(7)](https://man7.org/linux/man-pages/man7/inotify.7.html). +#[derive(Debug)] +pub struct InotifyEvent { + /// Watch descriptor. This field corresponds to the watch descriptor you + /// were issued when calling add_watch. It allows you to know which watch + /// this event comes from. + pub wd: WatchDescriptor, + /// Event mask. This field is a bitfield describing the exact event that + /// occured. + pub mask: AddWatchFlags, + /// This cookie is a number that allows you to connect related events. For + /// now only IN_MOVED_FROM and IN_MOVED_TO can be connected. + pub cookie: u32, + /// Filename. This field exists only if the event was triggered for a file + /// inside the watched directory. + pub name: Option +} + +impl Inotify { + /// Initialize a new inotify instance. + /// + /// Returns a Result containing an inotify instance. + /// + /// For more information see, [inotify_init(2)](https://man7.org/linux/man-pages/man2/inotify_init.2.html). + pub fn init(flags: InitFlags) -> Result { + let res = Errno::result(unsafe { + libc::inotify_init1(flags.bits()) + }); + + res.map(|fd| Inotify { fd }) + } + + /// Adds a new watch on the target file or directory. + /// + /// Returns a watch descriptor. This is not a File Descriptor! + /// + /// For more information see, [inotify_add_watch(2)](https://man7.org/linux/man-pages/man2/inotify_add_watch.2.html). + pub fn add_watch(self, + path: &P, + mask: AddWatchFlags) + -> Result + { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::inotify_add_watch(self.fd, cstr.as_ptr(), mask.bits()) + } + })?; + + Errno::result(res).map(|wd| WatchDescriptor { wd }) + } + + /// Removes an existing watch using the watch descriptor returned by + /// inotify_add_watch. + /// + /// Returns an EINVAL error if the watch descriptor is invalid. + /// + /// For more information see, [inotify_rm_watch(2)](https://man7.org/linux/man-pages/man2/inotify_rm_watch.2.html). + pub fn rm_watch(self, wd: WatchDescriptor) -> Result<()> { + cfg_if! { + if #[cfg(target_os = "linux")] { + let arg = wd.wd; + } else if #[cfg(target_os = "android")] { + let arg = wd.wd as u32; + } + } + let res = unsafe { libc::inotify_rm_watch(self.fd, arg) }; + + Errno::result(res).map(drop) + } + + /// Reads a collection of events from the inotify file descriptor. This call + /// can either be blocking or non blocking depending on whether IN_NONBLOCK + /// was set at initialization. + /// + /// Returns as many events as available. If the call was non blocking and no + /// events could be read then the EAGAIN error is returned. + pub fn read_events(self) -> Result> { + let header_size = size_of::(); + const BUFSIZ: usize = 4096; + let mut buffer = [0u8; BUFSIZ]; + let mut events = Vec::new(); + let mut offset = 0; + + let nread = read(self.fd, &mut buffer)?; + + while (nread - offset) >= header_size { + let event = unsafe { + let mut event = MaybeUninit::::uninit(); + ptr::copy_nonoverlapping( + buffer.as_ptr().add(offset), + event.as_mut_ptr() as *mut u8, + (BUFSIZ - offset).min(header_size) + ); + event.assume_init() + }; + + let name = match event.len { + 0 => None, + _ => { + let ptr = unsafe { + buffer + .as_ptr() + .add(offset + header_size) + as *const c_char + }; + let cstr = unsafe { CStr::from_ptr(ptr) }; + + Some(OsStr::from_bytes(cstr.to_bytes()).to_owned()) + } + }; + + events.push(InotifyEvent { + wd: WatchDescriptor { wd: event.wd }, + mask: AddWatchFlags::from_bits_truncate(event.mask), + cookie: event.cookie, + name + }); + + offset += header_size + event.len as usize; + } + + Ok(events) + } +} + +impl AsRawFd for Inotify { + fn as_raw_fd(&self) -> RawFd { + self.fd + } +} + +impl FromRawFd for Inotify { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + Inotify { fd } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/ioctl/bsd.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/ioctl/bsd.rs new file mode 100644 index 0000000000000000000000000000000000000000..4ce4d332a82696b40de169accd77618f3178de98 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/ioctl/bsd.rs @@ -0,0 +1,109 @@ +/// The datatype used for the ioctl number +#[doc(hidden)] +#[cfg(not(target_os = "illumos"))] +pub type ioctl_num_type = ::libc::c_ulong; + +#[doc(hidden)] +#[cfg(target_os = "illumos")] +pub type ioctl_num_type = ::libc::c_int; + +/// The datatype used for the 3rd argument +#[doc(hidden)] +pub type ioctl_param_type = ::libc::c_int; + +mod consts { + use crate::sys::ioctl::ioctl_num_type; + #[doc(hidden)] + pub const VOID: ioctl_num_type = 0x2000_0000; + #[doc(hidden)] + pub const OUT: ioctl_num_type = 0x4000_0000; + #[doc(hidden)] + #[allow(overflowing_literals)] + pub const IN: ioctl_num_type = 0x8000_0000; + #[doc(hidden)] + pub const INOUT: ioctl_num_type = IN|OUT; + #[doc(hidden)] + pub const IOCPARM_MASK: ioctl_num_type = 0x1fff; +} + +pub use self::consts::*; + +#[macro_export] +#[doc(hidden)] +macro_rules! ioc { + ($inout:expr, $group:expr, $num:expr, $len:expr) => ( + $inout | (($len as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::IOCPARM_MASK) << 16) | (($group as $crate::sys::ioctl::ioctl_num_type) << 8) | ($num as $crate::sys::ioctl::ioctl_num_type) + ) +} + +/// Generate an ioctl request code for a command that passes no data. +/// +/// This is equivalent to the `_IO()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_none!()` directly. +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const KVMIO: u8 = 0xAE; +/// ioctl_write_int_bad!(kvm_create_vm, request_code_none!(KVMIO, 0x03)); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! request_code_none { + ($g:expr, $n:expr) => (ioc!($crate::sys::ioctl::VOID, $g, $n, 0)) +} + +/// Generate an ioctl request code for a command that passes an integer +/// +/// This is equivalent to the `_IOWINT()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_write_int!()` directly. +#[macro_export(local_inner_macros)] +macro_rules! request_code_write_int { + ($g:expr, $n:expr) => (ioc!($crate::sys::ioctl::VOID, $g, $n, ::std::mem::size_of::<$crate::libc::c_int>())) +} + +/// Generate an ioctl request code for a command that reads. +/// +/// This is equivalent to the `_IOR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_read!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is reading and the kernel is +/// writing. +#[macro_export(local_inner_macros)] +macro_rules! request_code_read { + ($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::OUT, $g, $n, $len)) +} + +/// Generate an ioctl request code for a command that writes. +/// +/// This is equivalent to the `_IOW()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_write!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is writing and the kernel is +/// reading. +#[macro_export(local_inner_macros)] +macro_rules! request_code_write { + ($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::IN, $g, $n, $len)) +} + +/// Generate an ioctl request code for a command that reads and writes. +/// +/// This is equivalent to the `_IOWR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_readwrite!()` directly. +#[macro_export(local_inner_macros)] +macro_rules! request_code_readwrite { + ($g:expr, $n:expr, $len:expr) => (ioc!($crate::sys::ioctl::INOUT, $g, $n, $len)) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/ioctl/linux.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/ioctl/linux.rs new file mode 100644 index 0000000000000000000000000000000000000000..08cd0c33b4f22cb5c562a0f9b4c59043793edabd --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/ioctl/linux.rs @@ -0,0 +1,142 @@ +/// The datatype used for the ioctl number +#[cfg(any(target_os = "android", target_env = "musl"))] +#[doc(hidden)] +pub type ioctl_num_type = ::libc::c_int; +#[cfg(not(any(target_os = "android", target_env = "musl")))] +#[doc(hidden)] +pub type ioctl_num_type = ::libc::c_ulong; +/// The datatype used for the 3rd argument +#[doc(hidden)] +pub type ioctl_param_type = ::libc::c_ulong; + +#[doc(hidden)] +pub const NRBITS: ioctl_num_type = 8; +#[doc(hidden)] +pub const TYPEBITS: ioctl_num_type = 8; + +#[cfg(any(target_arch = "mips", target_arch = "mips64", target_arch = "powerpc", target_arch = "powerpc64", target_arch = "sparc64"))] +mod consts { + #[doc(hidden)] + pub const NONE: u8 = 1; + #[doc(hidden)] + pub const READ: u8 = 2; + #[doc(hidden)] + pub const WRITE: u8 = 4; + #[doc(hidden)] + pub const SIZEBITS: u8 = 13; + #[doc(hidden)] + pub const DIRBITS: u8 = 3; +} + +// "Generic" ioctl protocol +#[cfg(any(target_arch = "x86", + target_arch = "arm", + target_arch = "s390x", + target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "riscv32", + target_arch = "riscv64"))] +mod consts { + #[doc(hidden)] + pub const NONE: u8 = 0; + #[doc(hidden)] + pub const READ: u8 = 2; + #[doc(hidden)] + pub const WRITE: u8 = 1; + #[doc(hidden)] + pub const SIZEBITS: u8 = 14; + #[doc(hidden)] + pub const DIRBITS: u8 = 2; +} + +pub use self::consts::*; + +#[doc(hidden)] +pub const NRSHIFT: ioctl_num_type = 0; +#[doc(hidden)] +pub const TYPESHIFT: ioctl_num_type = NRSHIFT + NRBITS as ioctl_num_type; +#[doc(hidden)] +pub const SIZESHIFT: ioctl_num_type = TYPESHIFT + TYPEBITS as ioctl_num_type; +#[doc(hidden)] +pub const DIRSHIFT: ioctl_num_type = SIZESHIFT + SIZEBITS as ioctl_num_type; + +#[doc(hidden)] +pub const NRMASK: ioctl_num_type = (1 << NRBITS) - 1; +#[doc(hidden)] +pub const TYPEMASK: ioctl_num_type = (1 << TYPEBITS) - 1; +#[doc(hidden)] +pub const SIZEMASK: ioctl_num_type = (1 << SIZEBITS) - 1; +#[doc(hidden)] +pub const DIRMASK: ioctl_num_type = (1 << DIRBITS) - 1; + +/// Encode an ioctl command. +#[macro_export] +#[doc(hidden)] +macro_rules! ioc { + ($dir:expr, $ty:expr, $nr:expr, $sz:expr) => ( + (($dir as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::DIRMASK) << $crate::sys::ioctl::DIRSHIFT) | + (($ty as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::TYPEMASK) << $crate::sys::ioctl::TYPESHIFT) | + (($nr as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::NRMASK) << $crate::sys::ioctl::NRSHIFT) | + (($sz as $crate::sys::ioctl::ioctl_num_type & $crate::sys::ioctl::SIZEMASK) << $crate::sys::ioctl::SIZESHIFT)) +} + +/// Generate an ioctl request code for a command that passes no data. +/// +/// This is equivalent to the `_IO()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_none!()` directly. +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const KVMIO: u8 = 0xAE; +/// ioctl_write_int_bad!(kvm_create_vm, request_code_none!(KVMIO, 0x03)); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! request_code_none { + ($ty:expr, $nr:expr) => (ioc!($crate::sys::ioctl::NONE, $ty, $nr, 0)) +} + +/// Generate an ioctl request code for a command that reads. +/// +/// This is equivalent to the `_IOR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_read!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is reading and the kernel is +/// writing. +#[macro_export(local_inner_macros)] +macro_rules! request_code_read { + ($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::READ, $ty, $nr, $sz)) +} + +/// Generate an ioctl request code for a command that writes. +/// +/// This is equivalent to the `_IOW()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_write!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is writing and the kernel is +/// reading. +#[macro_export(local_inner_macros)] +macro_rules! request_code_write { + ($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::WRITE, $ty, $nr, $sz)) +} + +/// Generate an ioctl request code for a command that reads and writes. +/// +/// This is equivalent to the `_IOWR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_readwrite!()` directly. +#[macro_export(local_inner_macros)] +macro_rules! request_code_readwrite { + ($ty:expr, $nr:expr, $sz:expr) => (ioc!($crate::sys::ioctl::READ | $crate::sys::ioctl::WRITE, $ty, $nr, $sz)) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/ioctl/mod.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/ioctl/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..203b7d06f31f116f68bc3757bd6b4ae3ae07195e --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/ioctl/mod.rs @@ -0,0 +1,778 @@ +//! Provide helpers for making ioctl system calls. +//! +//! This library is pretty low-level and messy. `ioctl` is not fun. +//! +//! What is an `ioctl`? +//! =================== +//! +//! The `ioctl` syscall is the grab-bag syscall on POSIX systems. Don't want to add a new +//! syscall? Make it an `ioctl`! `ioctl` refers to both the syscall, and the commands that can be +//! sent with it. `ioctl` stands for "IO control", and the commands are always sent to a file +//! descriptor. +//! +//! It is common to see `ioctl`s used for the following purposes: +//! +//! * Provide read/write access to out-of-band data related to a device such as configuration +//! (for instance, setting serial port options) +//! * Provide a mechanism for performing full-duplex data transfers (for instance, xfer on SPI +//! devices). +//! * Provide access to control functions on a device (for example, on Linux you can send +//! commands like pause, resume, and eject to the CDROM device. +//! * Do whatever else the device driver creator thought made most sense. +//! +//! `ioctl`s are synchronous system calls and are similar to read and write calls in that regard. +//! They operate on file descriptors and have an identifier that specifies what the ioctl is. +//! Additionally they may read or write data and therefore need to pass along a data pointer. +//! Besides the semantics of the ioctls being confusing, the generation of this identifer can also +//! be difficult. +//! +//! Historically `ioctl` numbers were arbitrary hard-coded values. In Linux (before 2.6) and some +//! unices this has changed to a more-ordered system where the ioctl numbers are partitioned into +//! subcomponents (For linux this is documented in +//! [`Documentation/ioctl/ioctl-number.rst`](https://elixir.bootlin.com/linux/latest/source/Documentation/userspace-api/ioctl/ioctl-number.rst)): +//! +//! * Number: The actual ioctl ID +//! * Type: A grouping of ioctls for a common purpose or driver +//! * Size: The size in bytes of the data that will be transferred +//! * Direction: Whether there is any data and if it's read, write, or both +//! +//! Newer drivers should not generate complete integer identifiers for their `ioctl`s instead +//! preferring to use the 4 components above to generate the final ioctl identifier. Because of +//! how old `ioctl`s are, however, there are many hard-coded `ioctl` identifiers. These are +//! commonly referred to as "bad" in `ioctl` documentation. +//! +//! Defining `ioctl`s +//! ================= +//! +//! This library provides several `ioctl_*!` macros for binding `ioctl`s. These generate public +//! unsafe functions that can then be used for calling the ioctl. This macro has a few different +//! ways it can be used depending on the specific ioctl you're working with. +//! +//! A simple `ioctl` is `SPI_IOC_RD_MODE`. This ioctl works with the SPI interface on Linux. This +//! specific `ioctl` reads the mode of the SPI device as a `u8`. It's declared in +//! `/include/uapi/linux/spi/spidev.h` as `_IOR(SPI_IOC_MAGIC, 1, __u8)`. Since it uses the `_IOR` +//! macro, we know it's a `read` ioctl and can use the `ioctl_read!` macro as follows: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +//! const SPI_IOC_TYPE_MODE: u8 = 1; +//! ioctl_read!(spi_read_mode, SPI_IOC_MAGIC, SPI_IOC_TYPE_MODE, u8); +//! # fn main() {} +//! ``` +//! +//! This generates the function: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # use std::mem; +//! # use nix::{libc, Result}; +//! # use nix::errno::Errno; +//! # use nix::libc::c_int as c_int; +//! # const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +//! # const SPI_IOC_TYPE_MODE: u8 = 1; +//! pub unsafe fn spi_read_mode(fd: c_int, data: *mut u8) -> Result { +//! let res = libc::ioctl(fd, request_code_read!(SPI_IOC_MAGIC, SPI_IOC_TYPE_MODE, mem::size_of::()), data); +//! Errno::result(res) +//! } +//! # fn main() {} +//! ``` +//! +//! The return value for the wrapper functions generated by the `ioctl_*!` macros are `nix::Error`s. +//! These are generated by assuming the return value of the ioctl is `-1` on error and everything +//! else is a valid return value. If this is not the case, `Result::map` can be used to map some +//! of the range of "good" values (-Inf..-2, 0..Inf) into a smaller range in a helper function. +//! +//! Writing `ioctl`s generally use pointers as their data source and these should use the +//! `ioctl_write_ptr!`. But in some cases an `int` is passed directly. For these `ioctl`s use the +//! `ioctl_write_int!` macro. This variant does not take a type as the last argument: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! const HCI_IOC_MAGIC: u8 = b'k'; +//! const HCI_IOC_HCIDEVUP: u8 = 1; +//! ioctl_write_int!(hci_dev_up, HCI_IOC_MAGIC, HCI_IOC_HCIDEVUP); +//! # fn main() {} +//! ``` +//! +//! Some `ioctl`s don't transfer any data, and those should use `ioctl_none!`. This macro +//! doesn't take a type and so it is declared similar to the `write_int` variant shown above. +//! +//! The mode for a given `ioctl` should be clear from the documentation if it has good +//! documentation. Otherwise it will be clear based on the macro used to generate the `ioctl` +//! number where `_IO`, `_IOR`, `_IOW`, and `_IOWR` map to "none", "read", "write_*", and "readwrite" +//! respectively. To determine the specific `write_` variant to use you'll need to find +//! what the argument type is supposed to be. If it's an `int`, then `write_int` should be used, +//! otherwise it should be a pointer and `write_ptr` should be used. On Linux the +//! [`ioctl_list` man page](https://man7.org/linux/man-pages/man2/ioctl_list.2.html) describes a +//! large number of `ioctl`s and describes their argument data type. +//! +//! Using "bad" `ioctl`s +//! -------------------- +//! +//! As mentioned earlier, there are many old `ioctl`s that do not use the newer method of +//! generating `ioctl` numbers and instead use hardcoded values. These can be used with the +//! `ioctl_*_bad!` macros. This naming comes from the Linux kernel which refers to these +//! `ioctl`s as "bad". These are a different variant as they bypass calling the macro that generates +//! the ioctl number and instead use the defined value directly. +//! +//! For example the `TCGETS` `ioctl` reads a `termios` data structure for a given file descriptor. +//! It's defined as `0x5401` in `ioctls.h` on Linux and can be implemented as: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # #[cfg(any(target_os = "android", target_os = "linux"))] +//! # use nix::libc::TCGETS as TCGETS; +//! # #[cfg(any(target_os = "android", target_os = "linux"))] +//! # use nix::libc::termios as termios; +//! # #[cfg(any(target_os = "android", target_os = "linux"))] +//! ioctl_read_bad!(tcgets, TCGETS, termios); +//! # fn main() {} +//! ``` +//! +//! The generated function has the same form as that generated by `ioctl_read!`: +//! +//! ```text +//! pub unsafe fn tcgets(fd: c_int, data: *mut termios) -> Result; +//! ``` +//! +//! Working with Arrays +//! ------------------- +//! +//! Some `ioctl`s work with entire arrays of elements. These are supported by the `ioctl_*_buf` +//! family of macros: `ioctl_read_buf`, `ioctl_write_buf`, and `ioctl_readwrite_buf`. Note that +//! there are no "bad" versions for working with buffers. The generated functions include a `len` +//! argument to specify the number of elements (where the type of each element is specified in the +//! macro). +//! +//! Again looking to the SPI `ioctl`s on Linux for an example, there is a `SPI_IOC_MESSAGE` `ioctl` +//! that queues up multiple SPI messages by writing an entire array of `spi_ioc_transfer` structs. +//! `linux/spi/spidev.h` defines a macro to calculate the `ioctl` number like: +//! +//! ```C +//! #define SPI_IOC_MAGIC 'k' +//! #define SPI_MSGSIZE(N) ... +//! #define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)]) +//! ``` +//! +//! The `SPI_MSGSIZE(N)` calculation is already handled by the `ioctl_*!` macros, so all that's +//! needed to define this `ioctl` is: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +//! const SPI_IOC_TYPE_MESSAGE: u8 = 0; +//! # pub struct spi_ioc_transfer(u64); +//! ioctl_write_buf!(spi_transfer, SPI_IOC_MAGIC, SPI_IOC_TYPE_MESSAGE, spi_ioc_transfer); +//! # fn main() {} +//! ``` +//! +//! This generates a function like: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # use std::mem; +//! # use nix::{libc, Result}; +//! # use nix::errno::Errno; +//! # use nix::libc::c_int as c_int; +//! # const SPI_IOC_MAGIC: u8 = b'k'; +//! # const SPI_IOC_TYPE_MESSAGE: u8 = 0; +//! # pub struct spi_ioc_transfer(u64); +//! pub unsafe fn spi_message(fd: c_int, data: &mut [spi_ioc_transfer]) -> Result { +//! let res = libc::ioctl(fd, +//! request_code_write!(SPI_IOC_MAGIC, SPI_IOC_TYPE_MESSAGE, data.len() * mem::size_of::()), +//! data); +//! Errno::result(res) +//! } +//! # fn main() {} +//! ``` +//! +//! Finding `ioctl` Documentation +//! ----------------------------- +//! +//! For Linux, look at your system's headers. For example, `/usr/include/linux/input.h` has a lot +//! of lines defining macros which use `_IO`, `_IOR`, `_IOW`, `_IOC`, and `_IOWR`. Some `ioctl`s are +//! documented directly in the headers defining their constants, but others have more extensive +//! documentation in man pages (like termios' `ioctl`s which are in `tty_ioctl(4)`). +//! +//! Documenting the Generated Functions +//! =================================== +//! +//! In many cases, users will wish for the functions generated by the `ioctl` +//! macro to be public and documented. For this reason, the generated functions +//! are public by default. If you wish to hide the ioctl, you will need to put +//! them in a private module. +//! +//! For documentation, it is possible to use doc comments inside the `ioctl_*!` macros. Here is an +//! example : +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # use nix::libc::c_int; +//! ioctl_read! { +//! /// Make the given terminal the controlling terminal of the calling process. The calling +//! /// process must be a session leader and not have a controlling terminal already. If the +//! /// terminal is already the controlling terminal of a different session group then the +//! /// ioctl will fail with **EPERM**, unless the caller is root (more precisely: has the +//! /// **CAP_SYS_ADMIN** capability) and arg equals 1, in which case the terminal is stolen +//! /// and all processes that had it as controlling terminal lose it. +//! tiocsctty, b't', 19, c_int +//! } +//! +//! # fn main() {} +//! ``` +use cfg_if::cfg_if; + +#[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] +#[macro_use] +mod linux; + +#[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] +pub use self::linux::*; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +#[macro_use] +mod bsd; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +pub use self::bsd::*; + +/// Convert raw ioctl return value to a Nix result +#[macro_export] +#[doc(hidden)] +macro_rules! convert_ioctl_res { + ($w:expr) => ( + { + $crate::errno::Errno::result($w) + } + ); +} + +/// Generates a wrapper function for an ioctl that passes no data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// The `videodev2` driver on Linux defines the `log_status` `ioctl` as: +/// +/// ```C +/// #define VIDIOC_LOG_STATUS _IO('V', 70) +/// ``` +/// +/// This can be implemented in Rust like: +/// +/// ```no_run +/// # #[macro_use] extern crate nix; +/// ioctl_none!(log_status, b'V', 70); +/// fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_none { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_none!($ioty, $nr) as $crate::sys::ioctl::ioctl_num_type)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that passes no data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ```no_run +/// # #[macro_use] extern crate nix; +/// # use libc::TIOCNXCL; +/// # use std::fs::File; +/// # use std::os::unix::io::AsRawFd; +/// ioctl_none_bad!(tiocnxcl, TIOCNXCL); +/// fn main() { +/// let file = File::open("/dev/ttyUSB0").unwrap(); +/// unsafe { tiocnxcl(file.as_raw_fd()) }.unwrap(); +/// } +/// ``` +// TODO: add an example using request_code_*!() +#[macro_export(local_inner_macros)] +macro_rules! ioctl_none_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads data from the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +/// const SPI_IOC_TYPE_MODE: u8 = 1; +/// ioctl_read!(spi_read_mode, SPI_IOC_MAGIC, SPI_IOC_TYPE_MODE, u8); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_read { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_read!($ioty, $nr, ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that reads data from the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # #[cfg(any(target_os = "android", target_os = "linux"))] +/// ioctl_read_bad!(tcgets, libc::TCGETS, libc::termios); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_read_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that writes data through a pointer to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *const DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # pub struct v4l2_audio {} +/// ioctl_write_ptr!(s_audio, b'V', 34, v4l2_audio); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_ptr { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *const $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write!($ioty, $nr, ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that writes data through a pointer to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *const DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # #[cfg(any(target_os = "android", target_os = "linux"))] +/// ioctl_write_ptr_bad!(tcsets, libc::TCSETS, libc::termios); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_ptr_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *const $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +cfg_if!{ + if #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] { + /// Generates a wrapper function for a ioctl that writes an integer to the kernel. + /// + /// The arguments to this macro are: + /// + /// * The function name + /// * The ioctl identifier + /// * The ioctl sequence number + /// + /// The generated function has the following signature: + /// + /// ```rust,ignore + /// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: nix::sys::ioctl::ioctl_param_type) -> Result + /// ``` + /// + /// `nix::sys::ioctl::ioctl_param_type` depends on the OS: + /// * BSD - `libc::c_int` + /// * Linux - `libc::c_ulong` + /// + /// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). + /// + /// # Example + /// + /// ``` + /// # #[macro_use] extern crate nix; + /// ioctl_write_int!(vt_activate, b'v', 4); + /// # fn main() {} + /// ``` + #[macro_export(local_inner_macros)] + macro_rules! ioctl_write_int { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: $crate::sys::ioctl::ioctl_param_type) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write_int!($ioty, $nr) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) + } + } else { + /// Generates a wrapper function for a ioctl that writes an integer to the kernel. + /// + /// The arguments to this macro are: + /// + /// * The function name + /// * The ioctl identifier + /// * The ioctl sequence number + /// + /// The generated function has the following signature: + /// + /// ```rust,ignore + /// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: nix::sys::ioctl::ioctl_param_type) -> Result + /// ``` + /// + /// `nix::sys::ioctl::ioctl_param_type` depends on the OS: + /// * BSD - `libc::c_int` + /// * Linux - `libc::c_ulong` + /// + /// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). + /// + /// # Example + /// + /// ``` + /// # #[macro_use] extern crate nix; + /// const HCI_IOC_MAGIC: u8 = b'k'; + /// const HCI_IOC_HCIDEVUP: u8 = 1; + /// ioctl_write_int!(hci_dev_up, HCI_IOC_MAGIC, HCI_IOC_HCIDEVUP); + /// # fn main() {} + /// ``` + #[macro_export(local_inner_macros)] + macro_rules! ioctl_write_int { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: $crate::sys::ioctl::ioctl_param_type) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write!($ioty, $nr, ::std::mem::size_of::<$crate::libc::c_int>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) + } + } +} + +/// Generates a wrapper function for a "bad" ioctl that writes an integer to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: libc::c_int) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Examples +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # #[cfg(any(target_os = "android", target_os = "linux"))] +/// ioctl_write_int_bad!(tcsbrk, libc::TCSBRK); +/// # fn main() {} +/// ``` +/// +/// ```rust +/// # #[macro_use] extern crate nix; +/// const KVMIO: u8 = 0xAE; +/// ioctl_write_int_bad!(kvm_create_vm, request_code_none!(KVMIO, 0x03)); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_int_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: $crate::libc::c_int) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads and writes data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # pub struct v4l2_audio {} +/// ioctl_readwrite!(enum_audio, b'V', 65, v4l2_audio); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_readwrite { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_readwrite!($ioty, $nr, ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that reads and writes data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +// TODO: Find an example for ioctl_readwrite_bad +#[macro_export(local_inner_macros)] +macro_rules! ioctl_readwrite_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads an array of elements from the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: &mut [DATA_TYPE]) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +// TODO: Find an example for ioctl_read_buf +#[macro_export(local_inner_macros)] +macro_rules! ioctl_read_buf { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: &mut [$ty]) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_read!($ioty, $nr, data.len() * ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that writes an array of elements to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: &[DATA_TYPE]) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Examples +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +/// const SPI_IOC_TYPE_MESSAGE: u8 = 0; +/// # pub struct spi_ioc_transfer(u64); +/// ioctl_write_buf!(spi_transfer, SPI_IOC_MAGIC, SPI_IOC_TYPE_MESSAGE, spi_ioc_transfer); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_buf { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: &[$ty]) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write!($ioty, $nr, data.len() * ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads and writes an array of elements to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: &mut [DATA_TYPE]) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +// TODO: Find an example for readwrite_buf +#[macro_export(local_inner_macros)] +macro_rules! ioctl_readwrite_buf { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: &mut [$ty]) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_readwrite!($ioty, $nr, data.len() * ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/memfd.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/memfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..642676b431d07fbae2588b6239f003ad3027f425 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/memfd.rs @@ -0,0 +1,47 @@ +//! Interfaces for managing memory-backed files. + +use std::os::unix::io::RawFd; +use crate::Result; +use crate::errno::Errno; +use std::ffi::CStr; + +libc_bitflags!( + /// Options that change the behavior of [`memfd_create`]. + pub struct MemFdCreateFlag: libc::c_uint { + /// Set the close-on-exec ([`FD_CLOEXEC`]) flag on the new file descriptor. + /// + /// By default, the new file descriptor is set to remain open across an [`execve`] + /// (the `FD_CLOEXEC` flag is initially disabled). This flag can be used to change + /// this default. The file offset is set to the beginning of the file (see [`lseek`]). + /// + /// See also the description of the `O_CLOEXEC` flag in [`open(2)`]. + /// + /// [`execve`]: crate::unistd::execve + /// [`lseek`]: crate::unistd::lseek + /// [`FD_CLOEXEC`]: crate::fcntl::FdFlag::FD_CLOEXEC + /// [`open(2)`]: https://man7.org/linux/man-pages/man2/open.2.html + MFD_CLOEXEC; + /// Allow sealing operations on this file. + /// + /// See also the file sealing notes given in [`memfd_create(2)`]. + /// + /// [`memfd_create(2)`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html + MFD_ALLOW_SEALING; + } +); + +/// Creates an anonymous file that lives in memory, and return a file-descriptor to it. +/// +/// The file behaves like a regular file, and so can be modified, truncated, memory-mapped, and so on. +/// However, unlike a regular file, it lives in RAM and has a volatile backing storage. +/// +/// For more information, see [`memfd_create(2)`]. +/// +/// [`memfd_create(2)`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html +pub fn memfd_create(name: &CStr, flags: MemFdCreateFlag) -> Result { + let res = unsafe { + libc::syscall(libc::SYS_memfd_create, name.as_ptr(), flags.bits()) + }; + + Errno::result(res).map(|r| r as RawFd) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/mman.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/mman.rs new file mode 100644 index 0000000000000000000000000000000000000000..a7469a1792325be88ebfcfd4c83cb5f213d8f5a3 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/mman.rs @@ -0,0 +1,566 @@ +//! Memory management declarations. + +use crate::Result; +#[cfg(not(target_os = "android"))] +use crate::NixPath; +use crate::errno::Errno; +#[cfg(not(target_os = "android"))] +#[cfg(feature = "fs")] +use crate::{fcntl::OFlag, sys::stat::Mode}; +use libc::{self, c_int, c_void, size_t, off_t}; +use std::os::unix::io::RawFd; + +libc_bitflags!{ + /// Desired memory protection of a memory mapping. + pub struct ProtFlags: c_int { + /// Pages cannot be accessed. + PROT_NONE; + /// Pages can be read. + PROT_READ; + /// Pages can be written. + PROT_WRITE; + /// Pages can be executed + PROT_EXEC; + /// Apply protection up to the end of a mapping that grows upwards. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PROT_GROWSDOWN; + /// Apply protection down to the beginning of a mapping that grows downwards. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PROT_GROWSUP; + } +} + +libc_bitflags!{ + /// Additional parameters for [`mmap`]. + pub struct MapFlags: c_int { + /// Compatibility flag. Ignored. + MAP_FILE; + /// Share this mapping. Mutually exclusive with `MAP_PRIVATE`. + MAP_SHARED; + /// Create a private copy-on-write mapping. Mutually exclusive with `MAP_SHARED`. + MAP_PRIVATE; + /// Place the mapping at exactly the address specified in `addr`. + MAP_FIXED; + /// Place the mapping at exactly the address specified in `addr`, but never clobber an existing range. + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_FIXED_NOREPLACE; + /// To be used with `MAP_FIXED`, to forbid the system + /// to select a different address than the one specified. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_EXCL; + /// Synonym for `MAP_ANONYMOUS`. + MAP_ANON; + /// The mapping is not backed by any file. + MAP_ANONYMOUS; + /// Put the mapping into the first 2GB of the process address space. + #[cfg(any(all(any(target_os = "android", target_os = "linux"), + any(target_arch = "x86", target_arch = "x86_64")), + all(target_os = "linux", target_env = "musl", any(target_arch = "x86", target_arch = "x86_64")), + all(target_os = "freebsd", target_pointer_width = "64")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_32BIT; + /// Used for stacks; indicates to the kernel that the mapping should extend downward in memory. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_GROWSDOWN; + /// Compatibility flag. Ignored. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_DENYWRITE; + /// Compatibility flag. Ignored. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_EXECUTABLE; + /// Mark the mmaped region to be locked in the same way as `mlock(2)`. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_LOCKED; + /// Do not reserve swap space for this mapping. + /// + /// This was removed in FreeBSD 11 and is unused in DragonFlyBSD. + #[cfg(not(any(target_os = "dragonfly", target_os = "freebsd")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_NORESERVE; + /// Populate page tables for a mapping. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_POPULATE; + /// Only meaningful when used with `MAP_POPULATE`. Don't perform read-ahead. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_NONBLOCK; + /// Allocate the mapping using "huge pages." + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGETLB; + /// Make use of 64KB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_64KB; + /// Make use of 512KB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_512KB; + /// Make use of 1MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_1MB; + /// Make use of 2MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_2MB; + /// Make use of 8MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_8MB; + /// Make use of 16MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_16MB; + /// Make use of 32MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_32MB; + /// Make use of 256MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_256MB; + /// Make use of 512MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_512MB; + /// Make use of 1GB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_1GB; + /// Make use of 2GB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_2GB; + /// Make use of 16GB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_16GB; + + /// Lock the mapped region into memory as with `mlock(2)`. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_WIRED; + /// Causes dirtied data in the specified range to be flushed to disk only when necessary. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_NOSYNC; + /// Rename private pages to a file. + /// + /// This was removed in FreeBSD 11 and is unused in DragonFlyBSD. + #[cfg(any(target_os = "netbsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_RENAME; + /// Region may contain semaphores. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HASSEMAPHORE; + /// Region grows down, like a stack. + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_STACK; + /// Pages in this mapping are not retained in the kernel's memory cache. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_NOCACHE; + /// Allows the W/X bit on the page, it's necessary on aarch64 architecture. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_JIT; + /// Allows to use large pages, underlying alignment based on size. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_ALIGNED_SUPER; + /// Pages will be discarded in the core dumps. + #[cfg(target_os = "openbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_CONCEAL; + } +} + +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +libc_bitflags!{ + /// Options for [`mremap`]. + pub struct MRemapFlags: c_int { + /// Permit the kernel to relocate the mapping to a new virtual address, if necessary. + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MREMAP_MAYMOVE; + /// Place the mapping at exactly the address specified in `new_address`. + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MREMAP_FIXED; + /// Place the mapping at exactly the address specified in `new_address`. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_FIXED; + /// Allows to duplicate the mapping to be able to apply different flags on the copy. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_REMAPDUP; + } +} + +libc_enum!{ + /// Usage information for a range of memory to allow for performance optimizations by the kernel. + /// + /// Used by [`madvise`]. + #[repr(i32)] + #[non_exhaustive] + pub enum MmapAdvise { + /// No further special treatment. This is the default. + MADV_NORMAL, + /// Expect random page references. + MADV_RANDOM, + /// Expect sequential page references. + MADV_SEQUENTIAL, + /// Expect access in the near future. + MADV_WILLNEED, + /// Do not expect access in the near future. + MADV_DONTNEED, + /// Free up a given range of pages and its associated backing store. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_REMOVE, + /// Do not make pages in this range available to the child after a `fork(2)`. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_DONTFORK, + /// Undo the effect of `MADV_DONTFORK`. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_DOFORK, + /// Poison the given pages. + /// + /// Subsequent references to those pages are treated like hardware memory corruption. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_HWPOISON, + /// Enable Kernel Samepage Merging (KSM) for the given pages. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_MERGEABLE, + /// Undo the effect of `MADV_MERGEABLE` + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_UNMERGEABLE, + /// Preserve the memory of each page but offline the original page. + #[cfg(any(target_os = "android", + all(target_os = "linux", any( + target_arch = "aarch64", + target_arch = "arm", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "s390x", + target_arch = "x86", + target_arch = "x86_64", + target_arch = "sparc64"))))] + MADV_SOFT_OFFLINE, + /// Enable Transparent Huge Pages (THP) for pages in the given range. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_HUGEPAGE, + /// Undo the effect of `MADV_HUGEPAGE`. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_NOHUGEPAGE, + /// Exclude the given range from a core dump. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_DONTDUMP, + /// Undo the effect of an earlier `MADV_DONTDUMP`. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_DODUMP, + /// Specify that the application no longer needs the pages in the given range. + MADV_FREE, + /// Request that the system not flush the current range to disk unless it needs to. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_NOSYNC, + /// Undoes the effects of `MADV_NOSYNC` for any future pages dirtied within the given range. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_AUTOSYNC, + /// Region is not included in a core file. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_NOCORE, + /// Include region in a core file + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_CORE, + /// This process should not be killed when swap space is exhausted. + #[cfg(any(target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_PROTECT, + /// Invalidate the hardware page table for the given region. + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_INVAL, + /// Set the offset of the page directory page to `value` for the virtual page table. + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_SETMAP, + /// Indicates that the application will not need the data in the given range. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_ZERO_WIRED_PAGES, + /// Pages can be reused (by anyone). + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_FREE_REUSABLE, + /// Caller wants to reuse those pages. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_FREE_REUSE, + // Darwin doesn't document this flag's behavior. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + #[allow(missing_docs)] + MADV_CAN_REUSE, + } +} + +libc_bitflags!{ + /// Configuration flags for [`msync`]. + pub struct MsFlags: c_int { + /// Schedule an update but return immediately. + MS_ASYNC; + /// Invalidate all cached data. + MS_INVALIDATE; + /// Invalidate pages, but leave them mapped. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MS_KILLPAGES; + /// Deactivate pages, but leave them mapped. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MS_DEACTIVATE; + /// Perform an update and wait for it to complete. + MS_SYNC; + } +} + +libc_bitflags!{ + /// Flags for [`mlockall`]. + pub struct MlockAllFlags: c_int { + /// Lock pages that are currently mapped into the address space of the process. + MCL_CURRENT; + /// Lock pages which will become mapped into the address space of the process in the future. + MCL_FUTURE; + } +} + +/// Locks all memory pages that contain part of the address range with `length` +/// bytes starting at `addr`. +/// +/// Locked pages never move to the swap area. +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`mlock(2)`] man page. +/// +/// [`mlock(2)`]: https://man7.org/linux/man-pages/man2/mlock.2.html +pub unsafe fn mlock(addr: *const c_void, length: size_t) -> Result<()> { + Errno::result(libc::mlock(addr, length)).map(drop) +} + +/// Unlocks all memory pages that contain part of the address range with +/// `length` bytes starting at `addr`. +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`munlock(2)`] man +/// page. +/// +/// [`munlock(2)`]: https://man7.org/linux/man-pages/man2/munlock.2.html +pub unsafe fn munlock(addr: *const c_void, length: size_t) -> Result<()> { + Errno::result(libc::munlock(addr, length)).map(drop) +} + +/// Locks all memory pages mapped into this process' address space. +/// +/// Locked pages never move to the swap area. For more information, see [`mlockall(2)`]. +/// +/// [`mlockall(2)`]: https://man7.org/linux/man-pages/man2/mlockall.2.html +pub fn mlockall(flags: MlockAllFlags) -> Result<()> { + unsafe { Errno::result(libc::mlockall(flags.bits())) }.map(drop) +} + +/// Unlocks all memory pages mapped into this process' address space. +/// +/// For more information, see [`munlockall(2)`]. +/// +/// [`munlockall(2)`]: https://man7.org/linux/man-pages/man2/munlockall.2.html +pub fn munlockall() -> Result<()> { + unsafe { Errno::result(libc::munlockall()) }.map(drop) +} + +/// allocate memory, or map files or devices into memory +/// +/// # Safety +/// +/// See the [`mmap(2)`] man page for detailed requirements. +/// +/// [`mmap(2)`]: https://man7.org/linux/man-pages/man2/mmap.2.html +pub unsafe fn mmap(addr: *mut c_void, length: size_t, prot: ProtFlags, flags: MapFlags, fd: RawFd, offset: off_t) -> Result<*mut c_void> { + let ret = libc::mmap(addr, length, prot.bits(), flags.bits(), fd, offset); + + if ret == libc::MAP_FAILED { + Err(Errno::last()) + } else { + Ok(ret) + } +} + +/// Expands (or shrinks) an existing memory mapping, potentially moving it at +/// the same time. +/// +/// # Safety +/// +/// See the `mremap(2)` [man page](https://man7.org/linux/man-pages/man2/mremap.2.html) for +/// detailed requirements. +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +pub unsafe fn mremap( + addr: *mut c_void, + old_size: size_t, + new_size: size_t, + flags: MRemapFlags, + new_address: Option<* mut c_void>, +) -> Result<*mut c_void> { + #[cfg(target_os = "linux")] + let ret = libc::mremap(addr, old_size, new_size, flags.bits(), new_address.unwrap_or(std::ptr::null_mut())); + #[cfg(target_os = "netbsd")] + let ret = libc::mremap( + addr, + old_size, + new_address.unwrap_or(std::ptr::null_mut()), + new_size, + flags.bits(), + ); + + if ret == libc::MAP_FAILED { + Err(Errno::last()) + } else { + Ok(ret) + } +} + +/// remove a mapping +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`munmap(2)`] man +/// page. +/// +/// [`munmap(2)`]: https://man7.org/linux/man-pages/man2/munmap.2.html +pub unsafe fn munmap(addr: *mut c_void, len: size_t) -> Result<()> { + Errno::result(libc::munmap(addr, len)).map(drop) +} + +/// give advice about use of memory +/// +/// # Safety +/// +/// See the [`madvise(2)`] man page. Take special care when using +/// [`MmapAdvise::MADV_FREE`]. +/// +/// [`madvise(2)`]: https://man7.org/linux/man-pages/man2/madvise.2.html +pub unsafe fn madvise(addr: *mut c_void, length: size_t, advise: MmapAdvise) -> Result<()> { + Errno::result(libc::madvise(addr, length, advise as i32)).map(drop) +} + +/// Set protection of memory mapping. +/// +/// See [`mprotect(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mprotect.html) for +/// details. +/// +/// # Safety +/// +/// Calls to `mprotect` are inherently unsafe, as changes to memory protections can lead to +/// SIGSEGVs. +/// +/// ``` +/// # use nix::libc::size_t; +/// # use nix::sys::mman::{mmap, mprotect, MapFlags, ProtFlags}; +/// # use std::ptr; +/// const ONE_K: size_t = 1024; +/// let mut slice: &mut [u8] = unsafe { +/// let mem = mmap(ptr::null_mut(), ONE_K, ProtFlags::PROT_NONE, +/// MapFlags::MAP_ANON | MapFlags::MAP_PRIVATE, -1, 0).unwrap(); +/// mprotect(mem, ONE_K, ProtFlags::PROT_READ | ProtFlags::PROT_WRITE).unwrap(); +/// std::slice::from_raw_parts_mut(mem as *mut u8, ONE_K) +/// }; +/// assert_eq!(slice[0], 0x00); +/// slice[0] = 0xFF; +/// assert_eq!(slice[0], 0xFF); +/// ``` +pub unsafe fn mprotect(addr: *mut c_void, length: size_t, prot: ProtFlags) -> Result<()> { + Errno::result(libc::mprotect(addr, length, prot.bits())).map(drop) +} + +/// synchronize a mapped region +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`msync(2)`] man +/// page. +/// +/// [`msync(2)`]: https://man7.org/linux/man-pages/man2/msync.2.html +pub unsafe fn msync(addr: *mut c_void, length: size_t, flags: MsFlags) -> Result<()> { + Errno::result(libc::msync(addr, length, flags.bits())).map(drop) +} + +#[cfg(not(target_os = "android"))] +feature! { +#![feature = "fs"] +/// Creates and opens a new, or opens an existing, POSIX shared memory object. +/// +/// For more information, see [`shm_open(3)`]. +/// +/// [`shm_open(3)`]: https://man7.org/linux/man-pages/man3/shm_open.3.html +pub fn shm_open

( + name: &P, + flag: OFlag, + mode: Mode + ) -> Result + where P: ?Sized + NixPath +{ + let ret = name.with_nix_path(|cstr| { + #[cfg(any(target_os = "macos", target_os = "ios"))] + unsafe { + libc::shm_open(cstr.as_ptr(), flag.bits(), mode.bits() as libc::c_uint) + } + #[cfg(not(any(target_os = "macos", target_os = "ios")))] + unsafe { + libc::shm_open(cstr.as_ptr(), flag.bits(), mode.bits() as libc::mode_t) + } + })?; + + Errno::result(ret) +} +} + +/// Performs the converse of [`shm_open`], removing an object previously created. +/// +/// For more information, see [`shm_unlink(3)`]. +/// +/// [`shm_unlink(3)`]: https://man7.org/linux/man-pages/man3/shm_unlink.3.html +#[cfg(not(target_os = "android"))] +pub fn shm_unlink(name: &P) -> Result<()> { + let ret = name.with_nix_path(|cstr| { + unsafe { libc::shm_unlink(cstr.as_ptr()) } + })?; + + Errno::result(ret).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/mod.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..e5639f20abaa2ce249fa7fae1f0dd71f7cbfda58 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/mod.rs @@ -0,0 +1,214 @@ +//! Mostly platform-specific functionality +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + all(target_os = "linux", not(target_env = "uclibc")), + target_os = "macos", + target_os = "netbsd"))] +feature! { + #![feature = "aio"] + pub mod aio; +} + +feature! { + #![feature = "event"] + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[allow(missing_docs)] + pub mod epoll; + + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[allow(missing_docs)] + pub mod event; + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[allow(missing_docs)] + pub mod eventfd; +} + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] +#[cfg(feature = "ioctl")] +#[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] +#[macro_use] +pub mod ioctl; + +#[cfg(target_os = "linux")] +feature! { + #![feature = "fs"] + pub mod memfd; +} + +#[cfg(not(target_os = "redox"))] +feature! { + #![feature = "mman"] + pub mod mman; +} + +#[cfg(target_os = "linux")] +feature! { + #![feature = "personality"] + pub mod personality; +} + +feature! { + #![feature = "pthread"] + pub mod pthread; +} + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +feature! { + #![feature = "ptrace"] + #[allow(missing_docs)] + pub mod ptrace; +} + +#[cfg(target_os = "linux")] +feature! { + #![feature = "quota"] + pub mod quota; +} + +#[cfg(target_os = "linux")] +feature! { + #![feature = "reboot"] + pub mod reboot; +} + +#[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "illumos")))] +feature! { + #![feature = "resource"] + pub mod resource; +} + +#[cfg(not(target_os = "redox"))] +feature! { + #![feature = "poll"] + pub mod select; +} + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] +feature! { + #![feature = "zerocopy"] + pub mod sendfile; +} + +pub mod signal; + +#[cfg(any(target_os = "android", target_os = "linux"))] +feature! { + #![feature = "signal"] + #[allow(missing_docs)] + pub mod signalfd; +} + +#[cfg(not(target_os = "redox"))] +feature! { + #![feature = "socket"] + #[allow(missing_docs)] + pub mod socket; +} + +feature! { + #![feature = "fs"] + #[allow(missing_docs)] + pub mod stat; +} + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "openbsd" +))] +feature! { + #![feature = "fs"] + pub mod statfs; +} + +feature! { + #![feature = "fs"] + pub mod statvfs; +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +#[allow(missing_docs)] +pub mod sysinfo; + +feature! { + #![feature = "term"] + #[allow(missing_docs)] + pub mod termios; +} + +#[allow(missing_docs)] +pub mod time; + +feature! { + #![feature = "uio"] + pub mod uio; +} + +feature! { + #![feature = "feature"] + pub mod utsname; +} + +feature! { + #![feature = "process"] + pub mod wait; +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +feature! { + #![feature = "inotify"] + pub mod inotify; +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +feature! { + #![feature = "time"] + pub mod timerfd; +} + +#[cfg(all( + any( + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd" + ), + feature = "time", + feature = "signal" +))] +feature! { + #![feature = "time"] + pub mod timer; +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/personality.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/personality.rs new file mode 100644 index 0000000000000000000000000000000000000000..2af668782345818ae548704c39e27d13da9e3965 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/personality.rs @@ -0,0 +1,97 @@ +//! Process execution domains +use crate::Result; +use crate::errno::Errno; + +use libc::{self, c_int, c_ulong}; + +libc_bitflags! { + /// Flags used and returned by [`get()`](fn.get.html) and + /// [`set()`](fn.set.html). + pub struct Persona: c_int { + /// Provide the legacy virtual address space layout. + ADDR_COMPAT_LAYOUT; + /// Disable address-space-layout randomization. + ADDR_NO_RANDOMIZE; + /// Limit the address space to 32 bits. + ADDR_LIMIT_32BIT; + /// Use `0xc0000000` as the offset at which to search a virtual memory + /// chunk on [`mmap(2)`], otherwise use `0xffffe000`. + /// + /// [`mmap(2)`]: https://man7.org/linux/man-pages/man2/mmap.2.html + ADDR_LIMIT_3GB; + /// User-space function pointers to signal handlers point to descriptors. + #[cfg(not(any(target_env = "musl", target_env = "uclibc")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + FDPIC_FUNCPTRS; + /// Map page 0 as read-only. + MMAP_PAGE_ZERO; + /// `PROT_READ` implies `PROT_EXEC` for [`mmap(2)`]. + /// + /// [`mmap(2)`]: https://man7.org/linux/man-pages/man2/mmap.2.html + READ_IMPLIES_EXEC; + /// No effects. + SHORT_INODE; + /// [`select(2)`], [`pselect(2)`], and [`ppoll(2)`] do not modify the + /// returned timeout argument when interrupted by a signal handler. + /// + /// [`select(2)`]: https://man7.org/linux/man-pages/man2/select.2.html + /// [`pselect(2)`]: https://man7.org/linux/man-pages/man2/pselect.2.html + /// [`ppoll(2)`]: https://man7.org/linux/man-pages/man2/ppoll.2.html + STICKY_TIMEOUTS; + /// Have [`uname(2)`] report a 2.6.40+ version number rather than a 3.x + /// version number. + /// + /// [`uname(2)`]: https://man7.org/linux/man-pages/man2/uname.2.html + #[cfg(not(any(target_env = "musl", target_env = "uclibc")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + UNAME26; + /// No effects. + WHOLE_SECONDS; + } +} + +/// Retrieve the current process personality. +/// +/// Returns a Result containing a Persona instance. +/// +/// Example: +/// +/// ``` +/// # use nix::sys::personality::{self, Persona}; +/// let pers = personality::get().unwrap(); +/// assert!(!pers.contains(Persona::WHOLE_SECONDS)); +/// ``` +pub fn get() -> Result { + let res = unsafe { + libc::personality(0xFFFFFFFF) + }; + + Errno::result(res).map(Persona::from_bits_truncate) +} + +/// Set the current process personality. +/// +/// Returns a Result containing the *previous* personality for the +/// process, as a Persona. +/// +/// For more information, see [personality(2)](https://man7.org/linux/man-pages/man2/personality.2.html) +/// +/// **NOTE**: This call **replaces** the current personality entirely. +/// To **update** the personality, first call `get()` and then `set()` +/// with the modified persona. +/// +/// Example: +/// +/// ``` +/// # use nix::sys::personality::{self, Persona}; +/// let mut pers = personality::get().unwrap(); +/// assert!(!pers.contains(Persona::ADDR_NO_RANDOMIZE)); +/// personality::set(pers | Persona::ADDR_NO_RANDOMIZE); +/// ``` +pub fn set(persona: Persona) -> Result { + let res = unsafe { + libc::personality(persona.bits() as c_ulong) + }; + + Errno::result(res).map(Persona::from_bits_truncate) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/pthread.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/pthread.rs new file mode 100644 index 0000000000000000000000000000000000000000..fd81f3ed383f0c1a5cdaf35ca42ba72c3956ed3f --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/pthread.rs @@ -0,0 +1,42 @@ +//! Low level threading primitives + +#[cfg(not(target_os = "redox"))] +use crate::errno::Errno; +#[cfg(not(target_os = "redox"))] +use crate::Result; +use libc::{self, pthread_t}; + +/// Identifies an individual thread. +pub type Pthread = pthread_t; + +/// Obtain ID of the calling thread (see +/// [`pthread_self(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_self.html) +/// +/// The thread ID returned by `pthread_self()` is not the same thing as +/// the kernel thread ID returned by a call to `gettid(2)`. +#[inline] +pub fn pthread_self() -> Pthread { + unsafe { libc::pthread_self() } +} + +feature! { +#![feature = "signal"] + +/// Send a signal to a thread (see [`pthread_kill(3)`]). +/// +/// If `signal` is `None`, `pthread_kill` will only preform error checking and +/// won't send any signal. +/// +/// [`pthread_kill(3)`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_kill.html +#[cfg(not(target_os = "redox"))] +pub fn pthread_kill(thread: Pthread, signal: T) -> Result<()> + where T: Into> +{ + let sig = match signal.into() { + Some(s) => s as libc::c_int, + None => 0, + }; + let res = unsafe { libc::pthread_kill(thread, sig) }; + Errno::result(res).map(drop) +} +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/ptrace/bsd.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/ptrace/bsd.rs new file mode 100644 index 0000000000000000000000000000000000000000..c4cc74039606762960d3698701c2de493b7d12ac --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/ptrace/bsd.rs @@ -0,0 +1,187 @@ +use cfg_if::cfg_if; +use crate::errno::Errno; +use libc::{self, c_int}; +use std::ptr; +use crate::sys::signal::Signal; +use crate::unistd::Pid; +use crate::Result; + +pub type RequestType = c_int; + +cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "openbsd"))] { + #[doc(hidden)] + pub type AddressType = *mut ::libc::c_char; + } else { + #[doc(hidden)] + pub type AddressType = *mut ::libc::c_void; + } +} + +libc_enum! { + #[repr(i32)] + /// Ptrace Request enum defining the action to be taken. + #[non_exhaustive] + pub enum Request { + PT_TRACE_ME, + PT_READ_I, + PT_READ_D, + #[cfg(target_os = "macos")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PT_READ_U, + PT_WRITE_I, + PT_WRITE_D, + #[cfg(target_os = "macos")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PT_WRITE_U, + PT_CONTINUE, + PT_KILL, + #[cfg(any(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos"), + all(target_os = "openbsd", target_arch = "x86_64"), + all(target_os = "netbsd", any(target_arch = "x86_64", + target_arch = "powerpc"))))] + PT_STEP, + PT_ATTACH, + PT_DETACH, + #[cfg(target_os = "macos")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PT_SIGEXC, + #[cfg(target_os = "macos")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PT_THUPDATE, + #[cfg(target_os = "macos")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PT_ATTACHEXC + } +} + +unsafe fn ptrace_other( + request: Request, + pid: Pid, + addr: AddressType, + data: c_int, +) -> Result { + Errno::result(libc::ptrace( + request as RequestType, + libc::pid_t::from(pid), + addr, + data, + )).map(|_| 0) +} + +/// Sets the process as traceable, as with `ptrace(PT_TRACEME, ...)` +/// +/// Indicates that this process is to be traced by its parent. +/// This is the only ptrace request to be issued by the tracee. +pub fn traceme() -> Result<()> { + unsafe { ptrace_other(Request::PT_TRACE_ME, Pid::from_raw(0), ptr::null_mut(), 0).map(drop) } +} + +/// Attach to a running process, as with `ptrace(PT_ATTACH, ...)` +/// +/// Attaches to the process specified by `pid`, making it a tracee of the calling process. +pub fn attach(pid: Pid) -> Result<()> { + unsafe { ptrace_other(Request::PT_ATTACH, pid, ptr::null_mut(), 0).map(drop) } +} + +/// Detaches the current running process, as with `ptrace(PT_DETACH, ...)` +/// +/// Detaches from the process specified by `pid` allowing it to run freely, optionally delivering a +/// signal specified by `sig`. +pub fn detach>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as c_int, + None => 0, + }; + unsafe { + ptrace_other(Request::PT_DETACH, pid, ptr::null_mut(), data).map(drop) + } +} + +/// Restart the stopped tracee process, as with `ptrace(PTRACE_CONT, ...)` +/// +/// Continues the execution of the process with PID `pid`, optionally +/// delivering a signal specified by `sig`. +pub fn cont>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as c_int, + None => 0, + }; + unsafe { + // Ignore the useless return value + ptrace_other(Request::PT_CONTINUE, pid, 1 as AddressType, data).map(drop) + } +} + +/// Issues a kill request as with `ptrace(PT_KILL, ...)` +/// +/// This request is equivalent to `ptrace(PT_CONTINUE, ..., SIGKILL);` +pub fn kill(pid: Pid) -> Result<()> { + unsafe { + ptrace_other(Request::PT_KILL, pid, 0 as AddressType, 0).map(drop) + } +} + +/// Move the stopped tracee process forward by a single step as with +/// `ptrace(PT_STEP, ...)` +/// +/// Advances the execution of the process with PID `pid` by a single step optionally delivering a +/// signal specified by `sig`. +/// +/// # Example +/// ```rust +/// use nix::sys::ptrace::step; +/// use nix::unistd::Pid; +/// use nix::sys::signal::Signal; +/// use nix::sys::wait::*; +/// // If a process changes state to the stopped state because of a SIGUSR1 +/// // signal, this will step the process forward and forward the user +/// // signal to the stopped process +/// match waitpid(Pid::from_raw(-1), None) { +/// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => { +/// let _ = step(pid, Signal::SIGUSR1); +/// } +/// _ => {}, +/// } +/// ``` +#[cfg( + any( + any(target_os = "dragonfly", target_os = "freebsd", target_os = "macos"), + all(target_os = "openbsd", target_arch = "x86_64"), + all(target_os = "netbsd", + any(target_arch = "x86_64", target_arch = "powerpc") + ) + ) +)] +pub fn step>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as c_int, + None => 0, + }; + unsafe { ptrace_other(Request::PT_STEP, pid, ptr::null_mut(), data).map(drop) } +} + +/// Reads a word from a processes memory at the given address +// Technically, ptrace doesn't dereference the pointer. It passes it directly +// to the kernel. +#[allow(clippy::not_unsafe_ptr_arg_deref)] +pub fn read(pid: Pid, addr: AddressType) -> Result { + unsafe { + // Traditionally there was a difference between reading data or + // instruction memory but not in modern systems. + ptrace_other(Request::PT_READ_D, pid, addr, 0) + } +} + +/// Writes a word into the processes memory at the given address +// Technically, ptrace doesn't dereference the pointer. It passes it directly +// to the kernel. +#[allow(clippy::not_unsafe_ptr_arg_deref)] +pub fn write(pid: Pid, addr: AddressType, data: c_int) -> Result<()> { + unsafe { ptrace_other(Request::PT_WRITE_D, pid, addr, data).map(drop) } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/ptrace/linux.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/ptrace/linux.rs new file mode 100644 index 0000000000000000000000000000000000000000..24152d7d5a861e9810e1106bf2a76334f6702710 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/ptrace/linux.rs @@ -0,0 +1,483 @@ +//! For detailed description of the ptrace requests, consult `man ptrace`. + +use cfg_if::cfg_if; +use std::{mem, ptr}; +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_void, c_long, siginfo_t}; +use crate::unistd::Pid; +use crate::sys::signal::Signal; + +pub type AddressType = *mut ::libc::c_void; + +#[cfg(all( + target_os = "linux", + any(all(target_arch = "x86_64", + any(target_env = "gnu", target_env = "musl")), + all(target_arch = "x86", target_env = "gnu")) +))] +use libc::user_regs_struct; + +cfg_if! { + if #[cfg(any(all(target_os = "linux", target_arch = "s390x"), + all(target_os = "linux", target_env = "gnu"), + target_env = "uclibc"))] { + #[doc(hidden)] + pub type RequestType = ::libc::c_uint; + } else { + #[doc(hidden)] + pub type RequestType = ::libc::c_int; + } +} + +libc_enum!{ + #[cfg_attr(not(any(target_env = "musl", target_env = "uclibc", target_os = "android")), repr(u32))] + #[cfg_attr(any(target_env = "musl", target_env = "uclibc", target_os = "android"), repr(i32))] + /// Ptrace Request enum defining the action to be taken. + #[non_exhaustive] + pub enum Request { + PTRACE_TRACEME, + PTRACE_PEEKTEXT, + PTRACE_PEEKDATA, + PTRACE_PEEKUSER, + PTRACE_POKETEXT, + PTRACE_POKEDATA, + PTRACE_POKEUSER, + PTRACE_CONT, + PTRACE_KILL, + PTRACE_SINGLESTEP, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_GETREGS, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_SETREGS, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_GETFPREGS, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_SETFPREGS, + PTRACE_ATTACH, + PTRACE_DETACH, + #[cfg(all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86", + target_arch = "x86_64")))] + PTRACE_GETFPXREGS, + #[cfg(all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86", + target_arch = "x86_64")))] + PTRACE_SETFPXREGS, + PTRACE_SYSCALL, + PTRACE_SETOPTIONS, + PTRACE_GETEVENTMSG, + PTRACE_GETSIGINFO, + PTRACE_SETSIGINFO, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_GETREGSET, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_SETREGSET, + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTRACE_SEIZE, + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTRACE_INTERRUPT, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_LISTEN, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_PEEKSIGINFO, + #[cfg(all(target_os = "linux", target_env = "gnu", + any(target_arch = "x86", target_arch = "x86_64")))] + PTRACE_SYSEMU, + #[cfg(all(target_os = "linux", target_env = "gnu", + any(target_arch = "x86", target_arch = "x86_64")))] + PTRACE_SYSEMU_SINGLESTEP, + } +} + +libc_enum!{ + #[repr(i32)] + /// Using the ptrace options the tracer can configure the tracee to stop + /// at certain events. This enum is used to define those events as defined + /// in `man ptrace`. + #[non_exhaustive] + pub enum Event { + /// Event that stops before a return from fork or clone. + PTRACE_EVENT_FORK, + /// Event that stops before a return from vfork or clone. + PTRACE_EVENT_VFORK, + /// Event that stops before a return from clone. + PTRACE_EVENT_CLONE, + /// Event that stops before a return from execve. + PTRACE_EVENT_EXEC, + /// Event for a return from vfork. + PTRACE_EVENT_VFORK_DONE, + /// Event for a stop before an exit. Unlike the waitpid Exit status program. + /// registers can still be examined + PTRACE_EVENT_EXIT, + /// Stop triggered by a seccomp rule on a tracee. + PTRACE_EVENT_SECCOMP, + /// Stop triggered by the `INTERRUPT` syscall, or a group stop, + /// or when a new child is attached. + PTRACE_EVENT_STOP, + } +} + +libc_bitflags! { + /// Ptrace options used in conjunction with the PTRACE_SETOPTIONS request. + /// See `man ptrace` for more details. + pub struct Options: libc::c_int { + /// When delivering system call traps set a bit to allow tracer to + /// distinguish between normal stops or syscall stops. May not work on + /// all systems. + PTRACE_O_TRACESYSGOOD; + /// Stop tracee at next fork and start tracing the forked process. + PTRACE_O_TRACEFORK; + /// Stop tracee at next vfork call and trace the vforked process. + PTRACE_O_TRACEVFORK; + /// Stop tracee at next clone call and trace the cloned process. + PTRACE_O_TRACECLONE; + /// Stop tracee at next execve call. + PTRACE_O_TRACEEXEC; + /// Stop tracee at vfork completion. + PTRACE_O_TRACEVFORKDONE; + /// Stop tracee at next exit call. Stops before exit commences allowing + /// tracer to see location of exit and register states. + PTRACE_O_TRACEEXIT; + /// Stop tracee when a SECCOMP_RET_TRACE rule is triggered. See `man seccomp` for more + /// details. + PTRACE_O_TRACESECCOMP; + /// Send a SIGKILL to the tracee if the tracer exits. This is useful + /// for ptrace jailers to prevent tracees from escaping their control. + PTRACE_O_EXITKILL; + } +} + +fn ptrace_peek(request: Request, pid: Pid, addr: AddressType, data: *mut c_void) -> Result { + let ret = unsafe { + Errno::clear(); + libc::ptrace(request as RequestType, libc::pid_t::from(pid), addr, data) + }; + match Errno::result(ret) { + Ok(..) | Err(Errno::UnknownErrno) => Ok(ret), + err @ Err(..) => err, + } +} + +/// Get user registers, as with `ptrace(PTRACE_GETREGS, ...)` +#[cfg(all( + target_os = "linux", + any(all(target_arch = "x86_64", + any(target_env = "gnu", target_env = "musl")), + all(target_arch = "x86", target_env = "gnu")) +))] +pub fn getregs(pid: Pid) -> Result { + ptrace_get_data::(Request::PTRACE_GETREGS, pid) +} + +/// Set user registers, as with `ptrace(PTRACE_SETREGS, ...)` +#[cfg(all( + target_os = "linux", + any(all(target_arch = "x86_64", + any(target_env = "gnu", target_env = "musl")), + all(target_arch = "x86", target_env = "gnu")) +))] +pub fn setregs(pid: Pid, regs: user_regs_struct) -> Result<()> { + let res = unsafe { + libc::ptrace(Request::PTRACE_SETREGS as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + ®s as *const _ as *const c_void) + }; + Errno::result(res).map(drop) +} + +/// Function for ptrace requests that return values from the data field. +/// Some ptrace get requests populate structs or larger elements than `c_long` +/// and therefore use the data field to return values. This function handles these +/// requests. +fn ptrace_get_data(request: Request, pid: Pid) -> Result { + let mut data = mem::MaybeUninit::uninit(); + let res = unsafe { + libc::ptrace(request as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + data.as_mut_ptr() as *const _ as *const c_void) + }; + Errno::result(res)?; + Ok(unsafe{ data.assume_init() }) +} + +unsafe fn ptrace_other(request: Request, pid: Pid, addr: AddressType, data: *mut c_void) -> Result { + Errno::result(libc::ptrace(request as RequestType, libc::pid_t::from(pid), addr, data)).map(|_| 0) +} + +/// Set options, as with `ptrace(PTRACE_SETOPTIONS,...)`. +pub fn setoptions(pid: Pid, options: Options) -> Result<()> { + let res = unsafe { + libc::ptrace(Request::PTRACE_SETOPTIONS as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + options.bits() as *mut c_void) + }; + Errno::result(res).map(drop) +} + +/// Gets a ptrace event as described by `ptrace(PTRACE_GETEVENTMSG,...)` +pub fn getevent(pid: Pid) -> Result { + ptrace_get_data::(Request::PTRACE_GETEVENTMSG, pid) +} + +/// Get siginfo as with `ptrace(PTRACE_GETSIGINFO,...)` +pub fn getsiginfo(pid: Pid) -> Result { + ptrace_get_data::(Request::PTRACE_GETSIGINFO, pid) +} + +/// Set siginfo as with `ptrace(PTRACE_SETSIGINFO,...)` +pub fn setsiginfo(pid: Pid, sig: &siginfo_t) -> Result<()> { + let ret = unsafe{ + Errno::clear(); + libc::ptrace(Request::PTRACE_SETSIGINFO as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + sig as *const _ as *const c_void) + }; + match Errno::result(ret) { + Ok(_) => Ok(()), + Err(e) => Err(e), + } +} + +/// Sets the process as traceable, as with `ptrace(PTRACE_TRACEME, ...)` +/// +/// Indicates that this process is to be traced by its parent. +/// This is the only ptrace request to be issued by the tracee. +pub fn traceme() -> Result<()> { + unsafe { + ptrace_other( + Request::PTRACE_TRACEME, + Pid::from_raw(0), + ptr::null_mut(), + ptr::null_mut(), + ).map(drop) // ignore the useless return value + } +} + +/// Continue execution until the next syscall, as with `ptrace(PTRACE_SYSCALL, ...)` +/// +/// Arranges for the tracee to be stopped at the next entry to or exit from a system call, +/// optionally delivering a signal specified by `sig`. +pub fn syscall>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other( + Request::PTRACE_SYSCALL, + pid, + ptr::null_mut(), + data, + ).map(drop) // ignore the useless return value + } +} + +/// Continue execution until the next syscall, as with `ptrace(PTRACE_SYSEMU, ...)` +/// +/// In contrast to the `syscall` function, the syscall stopped at will not be executed. +/// Thus the the tracee will only be stopped once per syscall, +/// optionally delivering a signal specified by `sig`. +#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))] +pub fn sysemu>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other(Request::PTRACE_SYSEMU, pid, ptr::null_mut(), data).map(drop) + // ignore the useless return value + } +} + +/// Attach to a running process, as with `ptrace(PTRACE_ATTACH, ...)` +/// +/// Attaches to the process specified by `pid`, making it a tracee of the calling process. +pub fn attach(pid: Pid) -> Result<()> { + unsafe { + ptrace_other( + Request::PTRACE_ATTACH, + pid, + ptr::null_mut(), + ptr::null_mut(), + ).map(drop) // ignore the useless return value + } +} + +/// Attach to a running process, as with `ptrace(PTRACE_SEIZE, ...)` +/// +/// Attaches to the process specified in pid, making it a tracee of the calling process. +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn seize(pid: Pid, options: Options) -> Result<()> { + unsafe { + ptrace_other( + Request::PTRACE_SEIZE, + pid, + ptr::null_mut(), + options.bits() as *mut c_void, + ).map(drop) // ignore the useless return value + } +} + +/// Detaches the current running process, as with `ptrace(PTRACE_DETACH, ...)` +/// +/// Detaches from the process specified by `pid` allowing it to run freely, optionally delivering a +/// signal specified by `sig`. +pub fn detach>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other( + Request::PTRACE_DETACH, + pid, + ptr::null_mut(), + data + ).map(drop) + } +} + +/// Restart the stopped tracee process, as with `ptrace(PTRACE_CONT, ...)` +/// +/// Continues the execution of the process with PID `pid`, optionally +/// delivering a signal specified by `sig`. +pub fn cont>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other(Request::PTRACE_CONT, pid, ptr::null_mut(), data).map(drop) // ignore the useless return value + } +} + +/// Stop a tracee, as with `ptrace(PTRACE_INTERRUPT, ...)` +/// +/// This request is equivalent to `ptrace(PTRACE_INTERRUPT, ...)` +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn interrupt(pid: Pid) -> Result<()> { + unsafe { + ptrace_other(Request::PTRACE_INTERRUPT, pid, ptr::null_mut(), ptr::null_mut()).map(drop) + } +} + +/// Issues a kill request as with `ptrace(PTRACE_KILL, ...)` +/// +/// This request is equivalent to `ptrace(PTRACE_CONT, ..., SIGKILL);` +pub fn kill(pid: Pid) -> Result<()> { + unsafe { + ptrace_other(Request::PTRACE_KILL, pid, ptr::null_mut(), ptr::null_mut()).map(drop) + } +} + +/// Move the stopped tracee process forward by a single step as with +/// `ptrace(PTRACE_SINGLESTEP, ...)` +/// +/// Advances the execution of the process with PID `pid` by a single step optionally delivering a +/// signal specified by `sig`. +/// +/// # Example +/// ```rust +/// use nix::sys::ptrace::step; +/// use nix::unistd::Pid; +/// use nix::sys::signal::Signal; +/// use nix::sys::wait::*; +/// +/// // If a process changes state to the stopped state because of a SIGUSR1 +/// // signal, this will step the process forward and forward the user +/// // signal to the stopped process +/// match waitpid(Pid::from_raw(-1), None) { +/// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => { +/// let _ = step(pid, Signal::SIGUSR1); +/// } +/// _ => {}, +/// } +/// ``` +pub fn step>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other(Request::PTRACE_SINGLESTEP, pid, ptr::null_mut(), data).map(drop) + } +} + +/// Move the stopped tracee process forward by a single step or stop at the next syscall +/// as with `ptrace(PTRACE_SYSEMU_SINGLESTEP, ...)` +/// +/// Advances the execution by a single step or until the next syscall. +/// In case the tracee is stopped at a syscall, the syscall will not be executed. +/// Optionally, the signal specified by `sig` is delivered to the tracee upon continuation. +#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))] +pub fn sysemu_step>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other( + Request::PTRACE_SYSEMU_SINGLESTEP, + pid, + ptr::null_mut(), + data, + ) + .map(drop) // ignore the useless return value + } +} + +/// Reads a word from a processes memory at the given address +pub fn read(pid: Pid, addr: AddressType) -> Result { + ptrace_peek(Request::PTRACE_PEEKDATA, pid, addr, ptr::null_mut()) +} + +/// Writes a word into the processes memory at the given address +/// +/// # Safety +/// +/// The `data` argument is passed directly to `ptrace(2)`. Read that man page +/// for guidance. +pub unsafe fn write( + pid: Pid, + addr: AddressType, + data: *mut c_void) -> Result<()> +{ + ptrace_other(Request::PTRACE_POKEDATA, pid, addr, data).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/ptrace/mod.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/ptrace/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..782c30409bc12e9e930793924c41c3ad6137513b --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/ptrace/mod.rs @@ -0,0 +1,22 @@ +///! Provides helpers for making ptrace system calls + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod linux; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::linux::*; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +mod bsd; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd" + ))] +pub use self::bsd::*; diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/quota.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/quota.rs new file mode 100644 index 0000000000000000000000000000000000000000..6e34e38d2b720f151c24cefd84daba506123281e --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/quota.rs @@ -0,0 +1,277 @@ +//! Set and configure disk quotas for users, groups, or projects. +//! +//! # Examples +//! +//! Enabling and setting a quota: +//! +//! ```rust,no_run +//! # use nix::sys::quota::{Dqblk, quotactl_on, quotactl_set, QuotaFmt, QuotaType, QuotaValidFlags}; +//! quotactl_on(QuotaType::USRQUOTA, "/dev/sda1", QuotaFmt::QFMT_VFS_V1, "aquota.user"); +//! let mut dqblk: Dqblk = Default::default(); +//! dqblk.set_blocks_hard_limit(10000); +//! dqblk.set_blocks_soft_limit(8000); +//! quotactl_set(QuotaType::USRQUOTA, "/dev/sda1", 50, &dqblk, QuotaValidFlags::QIF_BLIMITS); +//! ``` +use std::default::Default; +use std::{mem, ptr}; +use libc::{self, c_int, c_char}; +use crate::{Result, NixPath}; +use crate::errno::Errno; + +struct QuotaCmd(QuotaSubCmd, QuotaType); + +impl QuotaCmd { + #[allow(unused_unsafe)] + fn as_int(&self) -> c_int { + unsafe { libc::QCMD(self.0 as i32, self.1 as i32) } + } +} + +// linux quota version >= 2 +libc_enum!{ + #[repr(i32)] + enum QuotaSubCmd { + Q_SYNC, + Q_QUOTAON, + Q_QUOTAOFF, + Q_GETQUOTA, + Q_SETQUOTA, + } +} + +libc_enum!{ + /// The scope of the quota. + #[repr(i32)] + #[non_exhaustive] + pub enum QuotaType { + /// Specify a user quota + USRQUOTA, + /// Specify a group quota + GRPQUOTA, + } +} + +libc_enum!{ + /// The type of quota format to use. + #[repr(i32)] + #[non_exhaustive] + pub enum QuotaFmt { + /// Use the original quota format. + QFMT_VFS_OLD, + /// Use the standard VFS v0 quota format. + /// + /// Handles 32-bit UIDs/GIDs and quota limits up to 232 bytes/232 inodes. + QFMT_VFS_V0, + /// Use the VFS v1 quota format. + /// + /// Handles 32-bit UIDs/GIDs and quota limits of 264 bytes/264 inodes. + QFMT_VFS_V1, + } +} + +libc_bitflags!( + /// Indicates the quota fields that are valid to read from. + #[derive(Default)] + pub struct QuotaValidFlags: u32 { + /// The block hard & soft limit fields. + QIF_BLIMITS; + /// The current space field. + QIF_SPACE; + /// The inode hard & soft limit fields. + QIF_ILIMITS; + /// The current inodes field. + QIF_INODES; + /// The disk use time limit field. + QIF_BTIME; + /// The file quote time limit field. + QIF_ITIME; + /// All block & inode limits. + QIF_LIMITS; + /// The space & inodes usage fields. + QIF_USAGE; + /// The time limit fields. + QIF_TIMES; + /// All fields. + QIF_ALL; + } +); + +/// Wrapper type for `if_dqblk` +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct Dqblk(libc::dqblk); + +impl Default for Dqblk { + fn default() -> Dqblk { + Dqblk(libc::dqblk { + dqb_bhardlimit: 0, + dqb_bsoftlimit: 0, + dqb_curspace: 0, + dqb_ihardlimit: 0, + dqb_isoftlimit: 0, + dqb_curinodes: 0, + dqb_btime: 0, + dqb_itime: 0, + dqb_valid: 0, + }) + } +} + +impl Dqblk { + /// The absolute limit on disk quota blocks allocated. + pub fn blocks_hard_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_BLIMITS) { + Some(self.0.dqb_bhardlimit) + } else { + None + } + } + + /// Set the absolute limit on disk quota blocks allocated. + pub fn set_blocks_hard_limit(&mut self, limit: u64) { + self.0.dqb_bhardlimit = limit; + } + + /// Preferred limit on disk quota blocks + pub fn blocks_soft_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_BLIMITS) { + Some(self.0.dqb_bsoftlimit) + } else { + None + } + } + + /// Set the preferred limit on disk quota blocks allocated. + pub fn set_blocks_soft_limit(&mut self, limit: u64) { + self.0.dqb_bsoftlimit = limit; + } + + /// Current occupied space (bytes). + pub fn occupied_space(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_SPACE) { + Some(self.0.dqb_curspace) + } else { + None + } + } + + /// Maximum number of allocated inodes. + pub fn inodes_hard_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_ILIMITS) { + Some(self.0.dqb_ihardlimit) + } else { + None + } + } + + /// Set the maximum number of allocated inodes. + pub fn set_inodes_hard_limit(&mut self, limit: u64) { + self.0.dqb_ihardlimit = limit; + } + + /// Preferred inode limit + pub fn inodes_soft_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_ILIMITS) { + Some(self.0.dqb_isoftlimit) + } else { + None + } + } + + /// Set the preferred limit of allocated inodes. + pub fn set_inodes_soft_limit(&mut self, limit: u64) { + self.0.dqb_isoftlimit = limit; + } + + /// Current number of allocated inodes. + pub fn allocated_inodes(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_INODES) { + Some(self.0.dqb_curinodes) + } else { + None + } + } + + /// Time limit for excessive disk use. + pub fn block_time_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_BTIME) { + Some(self.0.dqb_btime) + } else { + None + } + } + + /// Set the time limit for excessive disk use. + pub fn set_block_time_limit(&mut self, limit: u64) { + self.0.dqb_btime = limit; + } + + /// Time limit for excessive files. + pub fn inode_time_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_ITIME) { + Some(self.0.dqb_itime) + } else { + None + } + } + + /// Set the time limit for excessive files. + pub fn set_inode_time_limit(&mut self, limit: u64) { + self.0.dqb_itime = limit; + } +} + +fn quotactl(cmd: QuotaCmd, special: Option<&P>, id: c_int, addr: *mut c_char) -> Result<()> { + unsafe { + Errno::clear(); + let res = match special { + Some(dev) => dev.with_nix_path(|path| libc::quotactl(cmd.as_int(), path.as_ptr(), id, addr)), + None => Ok(libc::quotactl(cmd.as_int(), ptr::null(), id, addr)), + }?; + + Errno::result(res).map(drop) + } +} + +/// Turn on disk quotas for a block device. +pub fn quotactl_on(which: QuotaType, special: &P, format: QuotaFmt, quota_file: &P) -> Result<()> { + quota_file.with_nix_path(|path| { + let mut path_copy = path.to_bytes_with_nul().to_owned(); + let p: *mut c_char = path_copy.as_mut_ptr() as *mut c_char; + quotactl(QuotaCmd(QuotaSubCmd::Q_QUOTAON, which), Some(special), format as c_int, p) + })? +} + +/// Disable disk quotas for a block device. +pub fn quotactl_off(which: QuotaType, special: &P) -> Result<()> { + quotactl(QuotaCmd(QuotaSubCmd::Q_QUOTAOFF, which), Some(special), 0, ptr::null_mut()) +} + +/// Update the on-disk copy of quota usages for a filesystem. +/// +/// If `special` is `None`, then all file systems with active quotas are sync'd. +pub fn quotactl_sync(which: QuotaType, special: Option<&P>) -> Result<()> { + quotactl(QuotaCmd(QuotaSubCmd::Q_SYNC, which), special, 0, ptr::null_mut()) +} + +/// Get disk quota limits and current usage for the given user/group id. +pub fn quotactl_get(which: QuotaType, special: &P, id: c_int) -> Result { + let mut dqblk = mem::MaybeUninit::uninit(); + quotactl(QuotaCmd(QuotaSubCmd::Q_GETQUOTA, which), Some(special), id, dqblk.as_mut_ptr() as *mut c_char)?; + Ok(unsafe{ Dqblk(dqblk.assume_init())}) +} + +/// Configure quota values for the specified fields for a given user/group id. +pub fn quotactl_set(which: QuotaType, special: &P, id: c_int, dqblk: &Dqblk, fields: QuotaValidFlags) -> Result<()> { + let mut dqblk_copy = *dqblk; + dqblk_copy.0.dqb_valid = fields.bits(); + quotactl(QuotaCmd(QuotaSubCmd::Q_SETQUOTA, which), Some(special), id, &mut dqblk_copy as *mut _ as *mut c_char) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/reboot.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/reboot.rs new file mode 100644 index 0000000000000000000000000000000000000000..2a8009e4f81fb3650aaf0b9276d629a0c1346774 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/reboot.rs @@ -0,0 +1,52 @@ +//! Reboot/shutdown or enable/disable Ctrl-Alt-Delete. + +use crate::Result; +use crate::errno::Errno; +use std::convert::Infallible; +use std::mem::drop; + +libc_enum! { + /// How exactly should the system be rebooted. + /// + /// See [`set_cad_enabled()`](fn.set_cad_enabled.html) for + /// enabling/disabling Ctrl-Alt-Delete. + #[repr(i32)] + #[non_exhaustive] + pub enum RebootMode { + /// Halt the system. + RB_HALT_SYSTEM, + /// Execute a kernel that has been loaded earlier with + /// [`kexec_load(2)`](https://man7.org/linux/man-pages/man2/kexec_load.2.html). + RB_KEXEC, + /// Stop the system and switch off power, if possible. + RB_POWER_OFF, + /// Restart the system. + RB_AUTOBOOT, + // we do not support Restart2. + /// Suspend the system using software suspend. + RB_SW_SUSPEND, + } +} + +/// Reboots or shuts down the system. +pub fn reboot(how: RebootMode) -> Result { + unsafe { + libc::reboot(how as libc::c_int) + }; + Err(Errno::last()) +} + +/// Enable or disable the reboot keystroke (Ctrl-Alt-Delete). +/// +/// Corresponds to calling `reboot(RB_ENABLE_CAD)` or `reboot(RB_DISABLE_CAD)` in C. +pub fn set_cad_enabled(enable: bool) -> Result<()> { + let cmd = if enable { + libc::RB_ENABLE_CAD + } else { + libc::RB_DISABLE_CAD + }; + let res = unsafe { + libc::reboot(cmd) + }; + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/resource.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/resource.rs new file mode 100644 index 0000000000000000000000000000000000000000..76ceaf5b9053ab8c87f1ed88bcc6628583043fa8 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/resource.rs @@ -0,0 +1,263 @@ +//! Configure the process resource limits. +use cfg_if::cfg_if; + +use crate::errno::Errno; +use crate::Result; +pub use libc::rlim_t; +use std::mem; + +cfg_if! { + if #[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))]{ + use libc::{__rlimit_resource_t, rlimit}; + } else if #[cfg(any( + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "macos", + target_os = "ios", + target_os = "android", + target_os = "dragonfly", + all(target_os = "linux", not(target_env = "gnu")) + ))]{ + use libc::{c_int, rlimit}; + } +} + +libc_enum! { + /// Types of process resources. + /// + /// The Resource enum is platform dependent. Check different platform + /// manuals for more details. Some platform links have been provided for + /// easier reference (non-exhaustive). + /// + /// * [Linux](https://man7.org/linux/man-pages/man2/getrlimit.2.html) + /// * [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=setrlimit) + /// * [NetBSD](https://man.netbsd.org/setrlimit.2) + + // linux-gnu uses u_int as resource enum, which is implemented in libc as + // well. + // + // https://gcc.gnu.org/legacy-ml/gcc/2015-08/msg00441.html + // https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/linux/gnu/mod.rs + #[cfg_attr(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")), repr(u32))] + #[cfg_attr(any( + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "macos", + target_os = "ios", + target_os = "android", + target_os = "dragonfly", + all(target_os = "linux", not(any(target_env = "gnu", target_env = "uclibc"))) + ), repr(i32))] + #[non_exhaustive] + pub enum Resource { + #[cfg(not(any(target_os = "freebsd", target_os = "netbsd", target_os = "openbsd")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum amount (in bytes) of virtual memory the process is + /// allowed to map. + RLIMIT_AS, + /// The largest size (in bytes) core(5) file that may be created. + RLIMIT_CORE, + /// The maximum amount of cpu time (in seconds) to be used by each + /// process. + RLIMIT_CPU, + /// The maximum size (in bytes) of the data segment for a process + RLIMIT_DATA, + /// The largest size (in bytes) file that may be created. + RLIMIT_FSIZE, + /// The maximum number of open files for this process. + RLIMIT_NOFILE, + /// The maximum size (in bytes) of the stack segment for a process. + RLIMIT_STACK, + + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum number of kqueues this user id is allowed to create. + RLIMIT_KQUEUES, + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A limit on the combined number of flock locks and fcntl leases that + /// this process may establish. + RLIMIT_LOCKS, + + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "linux", + target_os = "netbsd" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum size (in bytes) which a process may lock into memory + /// using the mlock(2) system call. + RLIMIT_MEMLOCK, + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A limit on the number of bytes that can be allocated for POSIX + /// message queues for the real user ID of the calling process. + RLIMIT_MSGQUEUE, + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A ceiling to which the process's nice value can be raised using + /// setpriority or nice. + RLIMIT_NICE, + + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + target_os = "linux", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum number of simultaneous processes for this user id. + RLIMIT_NPROC, + + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum number of pseudo-terminals this user id is allowed to + /// create. + RLIMIT_NPTS, + + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + target_os = "linux", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// When there is memory pressure and swap is available, prioritize + /// eviction of a process' resident pages beyond this amount (in bytes). + RLIMIT_RSS, + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A ceiling on the real-time priority that may be set for this process + /// using sched_setscheduler and sched_set‐ param. + RLIMIT_RTPRIO, + + #[cfg(any(target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A limit (in microseconds) on the amount of CPU time that a process + /// scheduled under a real-time scheduling policy may con‐ sume without + /// making a blocking system call. + RLIMIT_RTTIME, + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A limit on the number of signals that may be queued for the real + /// user ID of the calling process. + RLIMIT_SIGPENDING, + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum size (in bytes) of socket buffer usage for this user. + RLIMIT_SBSIZE, + + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum size (in bytes) of the swap space that may be reserved + /// or used by all of this user id's processes. + RLIMIT_SWAP, + + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// An alias for RLIMIT_AS. + RLIMIT_VMEM, + } +} + +/// Get the current processes resource limits +/// +/// The special value `RLIM_INFINITY` indicates that no limit will be +/// enforced. +/// +/// # Parameters +/// +/// * `resource`: The [`Resource`] that we want to get the limits of. +/// +/// # Examples +/// +/// ``` +/// # use nix::sys::resource::{getrlimit, Resource}; +/// +/// let (soft_limit, hard_limit) = getrlimit(Resource::RLIMIT_NOFILE).unwrap(); +/// println!("current soft_limit: {}", soft_limit); +/// println!("current hard_limit: {}", hard_limit); +/// ``` +/// +/// # References +/// +/// [getrlimit(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html#tag_16_215) +/// +/// [`Resource`]: enum.Resource.html +pub fn getrlimit(resource: Resource) -> Result<(rlim_t, rlim_t)> { + let mut old_rlim = mem::MaybeUninit::::uninit(); + + cfg_if! { + if #[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))]{ + let res = unsafe { libc::getrlimit(resource as __rlimit_resource_t, old_rlim.as_mut_ptr()) }; + } else { + let res = unsafe { libc::getrlimit(resource as c_int, old_rlim.as_mut_ptr()) }; + } + } + + Errno::result(res).map(|_| { + let rlimit { rlim_cur, rlim_max } = unsafe { old_rlim.assume_init() }; + (rlim_cur, rlim_max) + }) +} + +/// Set the current processes resource limits +/// +/// # Parameters +/// +/// * `resource`: The [`Resource`] that we want to set the limits of. +/// * `soft_limit`: The value that the kernel enforces for the corresponding +/// resource. +/// * `hard_limit`: The ceiling for the soft limit. Must be lower or equal to +/// the current hard limit for non-root users. +/// +/// The special value `RLIM_INFINITY` indicates that no limit will be +/// enforced. +/// +/// # Examples +/// +/// ``` +/// # use nix::sys::resource::{setrlimit, Resource}; +/// +/// let soft_limit = 512; +/// let hard_limit = 1024; +/// setrlimit(Resource::RLIMIT_NOFILE, soft_limit, hard_limit).unwrap(); +/// ``` +/// +/// # References +/// +/// [setrlimit(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html#tag_16_215) +/// +/// [`Resource`]: enum.Resource.html +/// +/// Note: `setrlimit` provides a safe wrapper to libc's `setrlimit`. +pub fn setrlimit( + resource: Resource, + soft_limit: rlim_t, + hard_limit: rlim_t, +) -> Result<()> { + let new_rlim = rlimit { + rlim_cur: soft_limit, + rlim_max: hard_limit, + }; + cfg_if! { + if #[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))]{ + let res = unsafe { libc::setrlimit(resource as __rlimit_resource_t, &new_rlim as *const rlimit) }; + }else{ + let res = unsafe { libc::setrlimit(resource as c_int, &new_rlim as *const rlimit) }; + } + } + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/select.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/select.rs new file mode 100644 index 0000000000000000000000000000000000000000..ab4f68f537063c614b7e32f8bfa73e60078263dd --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/select.rs @@ -0,0 +1,434 @@ +//! Portably monitor a group of file descriptors for readiness. +use std::convert::TryFrom; +use std::iter::FusedIterator; +use std::mem; +use std::ops::Range; +use std::os::unix::io::RawFd; +use std::ptr::{null, null_mut}; +use libc::{self, c_int}; +use crate::Result; +use crate::errno::Errno; +use crate::sys::time::{TimeSpec, TimeVal}; + +pub use libc::FD_SETSIZE; + +/// Contains a set of file descriptors used by [`select`] +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct FdSet(libc::fd_set); + +fn assert_fd_valid(fd: RawFd) { + assert!( + usize::try_from(fd).map_or(false, |fd| fd < FD_SETSIZE), + "fd must be in the range 0..FD_SETSIZE", + ); +} + +impl FdSet { + /// Create an empty `FdSet` + pub fn new() -> FdSet { + let mut fdset = mem::MaybeUninit::uninit(); + unsafe { + libc::FD_ZERO(fdset.as_mut_ptr()); + FdSet(fdset.assume_init()) + } + } + + /// Add a file descriptor to an `FdSet` + pub fn insert(&mut self, fd: RawFd) { + assert_fd_valid(fd); + unsafe { libc::FD_SET(fd, &mut self.0) }; + } + + /// Remove a file descriptor from an `FdSet` + pub fn remove(&mut self, fd: RawFd) { + assert_fd_valid(fd); + unsafe { libc::FD_CLR(fd, &mut self.0) }; + } + + /// Test an `FdSet` for the presence of a certain file descriptor. + pub fn contains(&self, fd: RawFd) -> bool { + assert_fd_valid(fd); + unsafe { libc::FD_ISSET(fd, &self.0) } + } + + /// Remove all file descriptors from this `FdSet`. + pub fn clear(&mut self) { + unsafe { libc::FD_ZERO(&mut self.0) }; + } + + /// Finds the highest file descriptor in the set. + /// + /// Returns `None` if the set is empty. + /// + /// This can be used to calculate the `nfds` parameter of the [`select`] function. + /// + /// # Example + /// + /// ``` + /// # use nix::sys::select::FdSet; + /// let mut set = FdSet::new(); + /// set.insert(4); + /// set.insert(9); + /// assert_eq!(set.highest(), Some(9)); + /// ``` + /// + /// [`select`]: fn.select.html + pub fn highest(&self) -> Option { + self.fds(None).next_back() + } + + /// Returns an iterator over the file descriptors in the set. + /// + /// For performance, it takes an optional higher bound: the iterator will + /// not return any elements of the set greater than the given file + /// descriptor. + /// + /// # Examples + /// + /// ``` + /// # use nix::sys::select::FdSet; + /// # use std::os::unix::io::RawFd; + /// let mut set = FdSet::new(); + /// set.insert(4); + /// set.insert(9); + /// let fds: Vec = set.fds(None).collect(); + /// assert_eq!(fds, vec![4, 9]); + /// ``` + #[inline] + pub fn fds(&self, highest: Option) -> Fds { + Fds { + set: self, + range: 0..highest.map(|h| h as usize + 1).unwrap_or(FD_SETSIZE), + } + } +} + +impl Default for FdSet { + fn default() -> Self { + Self::new() + } +} + +/// Iterator over `FdSet`. +#[derive(Debug)] +pub struct Fds<'a> { + set: &'a FdSet, + range: Range, +} + +impl<'a> Iterator for Fds<'a> { + type Item = RawFd; + + fn next(&mut self) -> Option { + for i in &mut self.range { + if self.set.contains(i as RawFd) { + return Some(i as RawFd); + } + } + None + } + + #[inline] + fn size_hint(&self) -> (usize, Option) { + let (_, upper) = self.range.size_hint(); + (0, upper) + } +} + +impl<'a> DoubleEndedIterator for Fds<'a> { + #[inline] + fn next_back(&mut self) -> Option { + while let Some(i) = self.range.next_back() { + if self.set.contains(i as RawFd) { + return Some(i as RawFd); + } + } + None + } +} + +impl<'a> FusedIterator for Fds<'a> {} + +/// Monitors file descriptors for readiness +/// +/// Returns the total number of ready file descriptors in all sets. The sets are changed so that all +/// file descriptors that are ready for the given operation are set. +/// +/// When this function returns, `timeout` has an implementation-defined value. +/// +/// # Parameters +/// +/// * `nfds`: The highest file descriptor set in any of the passed `FdSet`s, plus 1. If `None`, this +/// is calculated automatically by calling [`FdSet::highest`] on all descriptor sets and adding 1 +/// to the maximum of that. +/// * `readfds`: File descriptors to check for being ready to read. +/// * `writefds`: File descriptors to check for being ready to write. +/// * `errorfds`: File descriptors to check for pending error conditions. +/// * `timeout`: Maximum time to wait for descriptors to become ready (`None` to block +/// indefinitely). +/// +/// # References +/// +/// [select(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/select.html) +/// +/// [`FdSet::highest`]: struct.FdSet.html#method.highest +pub fn select<'a, N, R, W, E, T>(nfds: N, + readfds: R, + writefds: W, + errorfds: E, + timeout: T) -> Result +where + N: Into>, + R: Into>, + W: Into>, + E: Into>, + T: Into>, +{ + let mut readfds = readfds.into(); + let mut writefds = writefds.into(); + let mut errorfds = errorfds.into(); + let timeout = timeout.into(); + + let nfds = nfds.into().unwrap_or_else(|| { + readfds.iter_mut() + .chain(writefds.iter_mut()) + .chain(errorfds.iter_mut()) + .map(|set| set.highest().unwrap_or(-1)) + .max() + .unwrap_or(-1) + 1 + }); + + let readfds = readfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let writefds = writefds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let errorfds = errorfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let timeout = timeout.map(|tv| tv as *mut _ as *mut libc::timeval) + .unwrap_or(null_mut()); + + let res = unsafe { + libc::select(nfds, readfds, writefds, errorfds, timeout) + }; + + Errno::result(res) +} + +feature! { +#![feature = "signal"] + +use crate::sys::signal::SigSet; + +/// Monitors file descriptors for readiness with an altered signal mask. +/// +/// Returns the total number of ready file descriptors in all sets. The sets are changed so that all +/// file descriptors that are ready for the given operation are set. +/// +/// When this function returns, the original signal mask is restored. +/// +/// Unlike [`select`](#fn.select), `pselect` does not mutate the `timeout` value. +/// +/// # Parameters +/// +/// * `nfds`: The highest file descriptor set in any of the passed `FdSet`s, plus 1. If `None`, this +/// is calculated automatically by calling [`FdSet::highest`] on all descriptor sets and adding 1 +/// to the maximum of that. +/// * `readfds`: File descriptors to check for read readiness +/// * `writefds`: File descriptors to check for write readiness +/// * `errorfds`: File descriptors to check for pending error conditions. +/// * `timeout`: Maximum time to wait for descriptors to become ready (`None` to block +/// indefinitely). +/// * `sigmask`: Signal mask to activate while waiting for file descriptors to turn +/// ready (`None` to set no alternative signal mask). +/// +/// # References +/// +/// [pselect(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pselect.html) +/// +/// [The new pselect() system call](https://lwn.net/Articles/176911/) +/// +/// [`FdSet::highest`]: struct.FdSet.html#method.highest +pub fn pselect<'a, N, R, W, E, T, S>(nfds: N, + readfds: R, + writefds: W, + errorfds: E, + timeout: T, + sigmask: S) -> Result +where + N: Into>, + R: Into>, + W: Into>, + E: Into>, + T: Into>, + S: Into>, +{ + let mut readfds = readfds.into(); + let mut writefds = writefds.into(); + let mut errorfds = errorfds.into(); + let sigmask = sigmask.into(); + let timeout = timeout.into(); + + let nfds = nfds.into().unwrap_or_else(|| { + readfds.iter_mut() + .chain(writefds.iter_mut()) + .chain(errorfds.iter_mut()) + .map(|set| set.highest().unwrap_or(-1)) + .max() + .unwrap_or(-1) + 1 + }); + + let readfds = readfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let writefds = writefds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let errorfds = errorfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let timeout = timeout.map(|ts| ts.as_ref() as *const libc::timespec).unwrap_or(null()); + let sigmask = sigmask.map(|sm| sm.as_ref() as *const libc::sigset_t).unwrap_or(null()); + + let res = unsafe { + libc::pselect(nfds, readfds, writefds, errorfds, timeout, sigmask) + }; + + Errno::result(res) +} +} + +#[cfg(test)] +mod tests { + use super::*; + use std::os::unix::io::RawFd; + use crate::sys::time::{TimeVal, TimeValLike}; + use crate::unistd::{write, pipe}; + + #[test] + fn fdset_insert() { + let mut fd_set = FdSet::new(); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + + fd_set.insert(7); + + assert!(fd_set.contains(7)); + } + + #[test] + fn fdset_remove() { + let mut fd_set = FdSet::new(); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + + fd_set.insert(7); + fd_set.remove(7); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + } + + #[test] + fn fdset_clear() { + let mut fd_set = FdSet::new(); + fd_set.insert(1); + fd_set.insert((FD_SETSIZE / 2) as RawFd); + fd_set.insert((FD_SETSIZE - 1) as RawFd); + + fd_set.clear(); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + } + + #[test] + fn fdset_highest() { + let mut set = FdSet::new(); + assert_eq!(set.highest(), None); + set.insert(0); + assert_eq!(set.highest(), Some(0)); + set.insert(90); + assert_eq!(set.highest(), Some(90)); + set.remove(0); + assert_eq!(set.highest(), Some(90)); + set.remove(90); + assert_eq!(set.highest(), None); + + set.insert(4); + set.insert(5); + set.insert(7); + assert_eq!(set.highest(), Some(7)); + } + + #[test] + fn fdset_fds() { + let mut set = FdSet::new(); + assert_eq!(set.fds(None).collect::>(), vec![]); + set.insert(0); + assert_eq!(set.fds(None).collect::>(), vec![0]); + set.insert(90); + assert_eq!(set.fds(None).collect::>(), vec![0, 90]); + + // highest limit + assert_eq!(set.fds(Some(89)).collect::>(), vec![0]); + assert_eq!(set.fds(Some(90)).collect::>(), vec![0, 90]); + } + + #[test] + fn test_select() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let mut timeout = TimeVal::seconds(10); + assert_eq!(1, select(None, + &mut fd_set, + None, + None, + &mut timeout).unwrap()); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); + } + + #[test] + fn test_select_nfds() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let mut timeout = TimeVal::seconds(10); + assert_eq!(1, select(Some(fd_set.highest().unwrap() + 1), + &mut fd_set, + None, + None, + &mut timeout).unwrap()); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); + } + + #[test] + fn test_select_nfds2() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let mut timeout = TimeVal::seconds(10); + assert_eq!(1, select(::std::cmp::max(r1, r2) + 1, + &mut fd_set, + None, + None, + &mut timeout).unwrap()); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/sendfile.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/sendfile.rs new file mode 100644 index 0000000000000000000000000000000000000000..2ebcdf48892e28288a7d91ecb3fd0098a1e1e156 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/sendfile.rs @@ -0,0 +1,277 @@ +//! Send data from a file to a socket, bypassing userland. + +use cfg_if::cfg_if; +use std::os::unix::io::RawFd; +use std::ptr; + +use libc::{self, off_t}; + +use crate::Result; +use crate::errno::Errno; + +/// Copy up to `count` bytes to `out_fd` from `in_fd` starting at `offset`. +/// +/// Returns a `Result` with the number of bytes written. +/// +/// If `offset` is `None`, `sendfile` will begin reading at the current offset of `in_fd`and will +/// update the offset of `in_fd`. If `offset` is `Some`, `sendfile` will begin at the specified +/// offset and will not update the offset of `in_fd`. Instead, it will mutate `offset` to point to +/// the byte after the last byte copied. +/// +/// `in_fd` must support `mmap`-like operations and therefore cannot be a socket. +/// +/// For more information, see [the sendfile(2) man page.](https://man7.org/linux/man-pages/man2/sendfile.2.html) +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn sendfile( + out_fd: RawFd, + in_fd: RawFd, + offset: Option<&mut off_t>, + count: usize, +) -> Result { + let offset = offset + .map(|offset| offset as *mut _) + .unwrap_or(ptr::null_mut()); + let ret = unsafe { libc::sendfile(out_fd, in_fd, offset, count) }; + Errno::result(ret).map(|r| r as usize) +} + +/// Copy up to `count` bytes to `out_fd` from `in_fd` starting at `offset`. +/// +/// Returns a `Result` with the number of bytes written. +/// +/// If `offset` is `None`, `sendfile` will begin reading at the current offset of `in_fd`and will +/// update the offset of `in_fd`. If `offset` is `Some`, `sendfile` will begin at the specified +/// offset and will not update the offset of `in_fd`. Instead, it will mutate `offset` to point to +/// the byte after the last byte copied. +/// +/// `in_fd` must support `mmap`-like operations and therefore cannot be a socket. +/// +/// For more information, see [the sendfile(2) man page.](https://man7.org/linux/man-pages/man2/sendfile.2.html) +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn sendfile64( + out_fd: RawFd, + in_fd: RawFd, + offset: Option<&mut libc::off64_t>, + count: usize, +) -> Result { + let offset = offset + .map(|offset| offset as *mut _) + .unwrap_or(ptr::null_mut()); + let ret = unsafe { libc::sendfile64(out_fd, in_fd, offset, count) }; + Errno::result(ret).map(|r| r as usize) +} + +cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] { + use std::io::IoSlice; + + #[derive(Clone, Debug)] + struct SendfileHeaderTrailer<'a>( + libc::sf_hdtr, + Option>>, + Option>>, + ); + + impl<'a> SendfileHeaderTrailer<'a> { + fn new( + headers: Option<&'a [&'a [u8]]>, + trailers: Option<&'a [&'a [u8]]> + ) -> SendfileHeaderTrailer<'a> { + let header_iovecs: Option>> = + headers.map(|s| s.iter().map(|b| IoSlice::new(b)).collect()); + let trailer_iovecs: Option>> = + trailers.map(|s| s.iter().map(|b| IoSlice::new(b)).collect()); + SendfileHeaderTrailer( + libc::sf_hdtr { + headers: { + header_iovecs + .as_ref() + .map_or(ptr::null(), |v| v.as_ptr()) as *mut libc::iovec + }, + hdr_cnt: header_iovecs.as_ref().map(|v| v.len()).unwrap_or(0) as i32, + trailers: { + trailer_iovecs + .as_ref() + .map_or(ptr::null(), |v| v.as_ptr()) as *mut libc::iovec + }, + trl_cnt: trailer_iovecs.as_ref().map(|v| v.len()).unwrap_or(0) as i32 + }, + header_iovecs, + trailer_iovecs, + ) + } + } + } +} + +cfg_if! { + if #[cfg(target_os = "freebsd")] { + use libc::c_int; + + libc_bitflags!{ + /// Configuration options for [`sendfile`.](fn.sendfile.html) + pub struct SfFlags: c_int { + /// Causes `sendfile` to return EBUSY instead of blocking when attempting to read a + /// busy page. + SF_NODISKIO; + /// Causes `sendfile` to sleep until the network stack releases its reference to the + /// VM pages read. When `sendfile` returns, the data is not guaranteed to have been + /// sent, but it is safe to modify the file. + SF_SYNC; + /// Causes `sendfile` to cache exactly the number of pages specified in the + /// `readahead` parameter, disabling caching heuristics. + SF_USER_READAHEAD; + /// Causes `sendfile` not to cache the data read. + SF_NOCACHE; + } + } + + /// Read up to `count` bytes from `in_fd` starting at `offset` and write to `out_sock`. + /// + /// Returns a `Result` and a count of bytes written. Bytes written may be non-zero even if + /// an error occurs. + /// + /// `in_fd` must describe a regular file or shared memory object. `out_sock` must describe a + /// stream socket. + /// + /// If `offset` falls past the end of the file, the function returns success and zero bytes + /// written. + /// + /// If `count` is `None` or 0, bytes will be read from `in_fd` until reaching the end of + /// file (EOF). + /// + /// `headers` and `trailers` specify optional slices of byte slices to be sent before and + /// after the data read from `in_fd`, respectively. The length of headers and trailers sent + /// is included in the returned count of bytes written. The values of `offset` and `count` + /// do not apply to headers or trailers. + /// + /// `readahead` specifies the minimum number of pages to cache in memory ahead of the page + /// currently being sent. + /// + /// For more information, see + /// [the sendfile(2) man page.](https://www.freebsd.org/cgi/man.cgi?query=sendfile&sektion=2) + #[allow(clippy::too_many_arguments)] + pub fn sendfile( + in_fd: RawFd, + out_sock: RawFd, + offset: off_t, + count: Option, + headers: Option<&[&[u8]]>, + trailers: Option<&[&[u8]]>, + flags: SfFlags, + readahead: u16 + ) -> (Result<()>, off_t) { + // Readahead goes in upper 16 bits + // Flags goes in lower 16 bits + // see `man 2 sendfile` + let ra32 = u32::from(readahead); + let flags: u32 = (ra32 << 16) | (flags.bits() as u32); + let mut bytes_sent: off_t = 0; + let hdtr = headers.or(trailers).map(|_| SendfileHeaderTrailer::new(headers, trailers)); + let hdtr_ptr = hdtr.as_ref().map_or(ptr::null(), |s| &s.0 as *const libc::sf_hdtr); + let return_code = unsafe { + libc::sendfile(in_fd, + out_sock, + offset, + count.unwrap_or(0), + hdtr_ptr as *mut libc::sf_hdtr, + &mut bytes_sent as *mut off_t, + flags as c_int) + }; + (Errno::result(return_code).and(Ok(())), bytes_sent) + } + } else if #[cfg(target_os = "dragonfly")] { + /// Read up to `count` bytes from `in_fd` starting at `offset` and write to `out_sock`. + /// + /// Returns a `Result` and a count of bytes written. Bytes written may be non-zero even if + /// an error occurs. + /// + /// `in_fd` must describe a regular file. `out_sock` must describe a stream socket. + /// + /// If `offset` falls past the end of the file, the function returns success and zero bytes + /// written. + /// + /// If `count` is `None` or 0, bytes will be read from `in_fd` until reaching the end of + /// file (EOF). + /// + /// `headers` and `trailers` specify optional slices of byte slices to be sent before and + /// after the data read from `in_fd`, respectively. The length of headers and trailers sent + /// is included in the returned count of bytes written. The values of `offset` and `count` + /// do not apply to headers or trailers. + /// + /// For more information, see + /// [the sendfile(2) man page.](https://leaf.dragonflybsd.org/cgi/web-man?command=sendfile§ion=2) + pub fn sendfile( + in_fd: RawFd, + out_sock: RawFd, + offset: off_t, + count: Option, + headers: Option<&[&[u8]]>, + trailers: Option<&[&[u8]]>, + ) -> (Result<()>, off_t) { + let mut bytes_sent: off_t = 0; + let hdtr = headers.or(trailers).map(|_| SendfileHeaderTrailer::new(headers, trailers)); + let hdtr_ptr = hdtr.as_ref().map_or(ptr::null(), |s| &s.0 as *const libc::sf_hdtr); + let return_code = unsafe { + libc::sendfile(in_fd, + out_sock, + offset, + count.unwrap_or(0), + hdtr_ptr as *mut libc::sf_hdtr, + &mut bytes_sent as *mut off_t, + 0) + }; + (Errno::result(return_code).and(Ok(())), bytes_sent) + } + } else if #[cfg(any(target_os = "ios", target_os = "macos"))] { + /// Read bytes from `in_fd` starting at `offset` and write up to `count` bytes to + /// `out_sock`. + /// + /// Returns a `Result` and a count of bytes written. Bytes written may be non-zero even if + /// an error occurs. + /// + /// `in_fd` must describe a regular file. `out_sock` must describe a stream socket. + /// + /// If `offset` falls past the end of the file, the function returns success and zero bytes + /// written. + /// + /// If `count` is `None` or 0, bytes will be read from `in_fd` until reaching the end of + /// file (EOF). + /// + /// `hdtr` specifies an optional list of headers and trailers to be sent before and after + /// the data read from `in_fd`, respectively. The length of headers and trailers sent is + /// included in the returned count of bytes written. If any headers are specified and + /// `count` is non-zero, the length of the headers will be counted in the limit of total + /// bytes sent. Trailers do not count toward the limit of bytes sent and will always be sent + /// regardless. The value of `offset` does not affect headers or trailers. + /// + /// For more information, see + /// [the sendfile(2) man page.](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man2/sendfile.2.html) + pub fn sendfile( + in_fd: RawFd, + out_sock: RawFd, + offset: off_t, + count: Option, + headers: Option<&[&[u8]]>, + trailers: Option<&[&[u8]]> + ) -> (Result<()>, off_t) { + let mut len = count.unwrap_or(0); + let hdtr = headers.or(trailers).map(|_| SendfileHeaderTrailer::new(headers, trailers)); + let hdtr_ptr = hdtr.as_ref().map_or(ptr::null(), |s| &s.0 as *const libc::sf_hdtr); + let return_code = unsafe { + libc::sendfile(in_fd, + out_sock, + offset, + &mut len as *mut off_t, + hdtr_ptr as *mut libc::sf_hdtr, + 0) + }; + (Errno::result(return_code).and(Ok(())), len) + } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/signal.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/signal.rs new file mode 100644 index 0000000000000000000000000000000000000000..f982b4e79bba4b57613d53a686a32dbf2529c7fa --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/signal.rs @@ -0,0 +1,1311 @@ +// Portions of this file are Copyright 2014 The Rust Project Developers. +// See https://www.rust-lang.org/policies/licenses. + +//! Operating system signals. + +use crate::{Error, Result}; +use crate::errno::Errno; +use std::mem; +use std::fmt; +use std::str::FromStr; +#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] +use std::os::unix::io::RawFd; +use std::ptr; +use cfg_if::cfg_if; + +#[cfg(not(any(target_os = "openbsd", target_os = "redox")))] +#[cfg(any(feature = "aio", feature = "signal"))] +pub use self::sigevent::*; + +#[cfg(any(feature = "aio", feature = "process", feature = "signal"))] +libc_enum!{ + /// Types of operating system signals + // Currently there is only one definition of c_int in libc, as well as only one + // type for signal constants. + // We would prefer to use the libc::c_int alias in the repr attribute. Unfortunately + // this is not (yet) possible. + #[repr(i32)] + #[non_exhaustive] + #[cfg_attr(docsrs, doc(cfg(any(feature = "aio", feature = "signal"))))] + pub enum Signal { + /// Hangup + SIGHUP, + /// Interrupt + SIGINT, + /// Quit + SIGQUIT, + /// Illegal instruction (not reset when caught) + SIGILL, + /// Trace trap (not reset when caught) + SIGTRAP, + /// Abort + SIGABRT, + /// Bus error + SIGBUS, + /// Floating point exception + SIGFPE, + /// Kill (cannot be caught or ignored) + SIGKILL, + /// User defined signal 1 + SIGUSR1, + /// Segmentation violation + SIGSEGV, + /// User defined signal 2 + SIGUSR2, + /// Write on a pipe with no one to read it + SIGPIPE, + /// Alarm clock + SIGALRM, + /// Software termination signal from kill + SIGTERM, + /// Stack fault (obsolete) + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] + SIGSTKFLT, + /// To parent on child stop or exit + SIGCHLD, + /// Continue a stopped process + SIGCONT, + /// Sendable stop signal not from tty + SIGSTOP, + /// Stop signal from tty + SIGTSTP, + /// To readers pgrp upon background tty read + SIGTTIN, + /// Like TTIN if (tp->t_local<OSTOP) + SIGTTOU, + /// Urgent condition on IO channel + SIGURG, + /// Exceeded CPU time limit + SIGXCPU, + /// Exceeded file size limit + SIGXFSZ, + /// Virtual time alarm + SIGVTALRM, + /// Profiling time alarm + SIGPROF, + /// Window size changes + SIGWINCH, + /// Input/output possible signal + SIGIO, + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Power failure imminent. + SIGPWR, + /// Bad system call + SIGSYS, + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Emulator trap + SIGEMT, + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Information request + SIGINFO, + } + impl TryFrom +} + +#[cfg(feature = "signal")] +impl FromStr for Signal { + type Err = Error; + fn from_str(s: &str) -> Result { + Ok(match s { + "SIGHUP" => Signal::SIGHUP, + "SIGINT" => Signal::SIGINT, + "SIGQUIT" => Signal::SIGQUIT, + "SIGILL" => Signal::SIGILL, + "SIGTRAP" => Signal::SIGTRAP, + "SIGABRT" => Signal::SIGABRT, + "SIGBUS" => Signal::SIGBUS, + "SIGFPE" => Signal::SIGFPE, + "SIGKILL" => Signal::SIGKILL, + "SIGUSR1" => Signal::SIGUSR1, + "SIGSEGV" => Signal::SIGSEGV, + "SIGUSR2" => Signal::SIGUSR2, + "SIGPIPE" => Signal::SIGPIPE, + "SIGALRM" => Signal::SIGALRM, + "SIGTERM" => Signal::SIGTERM, + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] + "SIGSTKFLT" => Signal::SIGSTKFLT, + "SIGCHLD" => Signal::SIGCHLD, + "SIGCONT" => Signal::SIGCONT, + "SIGSTOP" => Signal::SIGSTOP, + "SIGTSTP" => Signal::SIGTSTP, + "SIGTTIN" => Signal::SIGTTIN, + "SIGTTOU" => Signal::SIGTTOU, + "SIGURG" => Signal::SIGURG, + "SIGXCPU" => Signal::SIGXCPU, + "SIGXFSZ" => Signal::SIGXFSZ, + "SIGVTALRM" => Signal::SIGVTALRM, + "SIGPROF" => Signal::SIGPROF, + "SIGWINCH" => Signal::SIGWINCH, + "SIGIO" => Signal::SIGIO, + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] + "SIGPWR" => Signal::SIGPWR, + "SIGSYS" => Signal::SIGSYS, + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + "SIGEMT" => Signal::SIGEMT, + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + "SIGINFO" => Signal::SIGINFO, + _ => return Err(Errno::EINVAL), + }) + } +} + +#[cfg(feature = "signal")] +impl Signal { + /// Returns name of signal. + /// + /// This function is equivalent to `>::as_ref()`, + /// with difference that returned string is `'static` + /// and not bound to `self`'s lifetime. + pub const fn as_str(self) -> &'static str { + match self { + Signal::SIGHUP => "SIGHUP", + Signal::SIGINT => "SIGINT", + Signal::SIGQUIT => "SIGQUIT", + Signal::SIGILL => "SIGILL", + Signal::SIGTRAP => "SIGTRAP", + Signal::SIGABRT => "SIGABRT", + Signal::SIGBUS => "SIGBUS", + Signal::SIGFPE => "SIGFPE", + Signal::SIGKILL => "SIGKILL", + Signal::SIGUSR1 => "SIGUSR1", + Signal::SIGSEGV => "SIGSEGV", + Signal::SIGUSR2 => "SIGUSR2", + Signal::SIGPIPE => "SIGPIPE", + Signal::SIGALRM => "SIGALRM", + Signal::SIGTERM => "SIGTERM", + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64"))))] + Signal::SIGSTKFLT => "SIGSTKFLT", + Signal::SIGCHLD => "SIGCHLD", + Signal::SIGCONT => "SIGCONT", + Signal::SIGSTOP => "SIGSTOP", + Signal::SIGTSTP => "SIGTSTP", + Signal::SIGTTIN => "SIGTTIN", + Signal::SIGTTOU => "SIGTTOU", + Signal::SIGURG => "SIGURG", + Signal::SIGXCPU => "SIGXCPU", + Signal::SIGXFSZ => "SIGXFSZ", + Signal::SIGVTALRM => "SIGVTALRM", + Signal::SIGPROF => "SIGPROF", + Signal::SIGWINCH => "SIGWINCH", + Signal::SIGIO => "SIGIO", + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] + Signal::SIGPWR => "SIGPWR", + Signal::SIGSYS => "SIGSYS", + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + Signal::SIGEMT => "SIGEMT", + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox")))] + Signal::SIGINFO => "SIGINFO", + } + } +} + +#[cfg(feature = "signal")] +impl AsRef for Signal { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +#[cfg(feature = "signal")] +impl fmt::Display for Signal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(self.as_ref()) + } +} + +#[cfg(feature = "signal")] +pub use self::Signal::*; + +#[cfg(target_os = "redox")] +#[cfg(feature = "signal")] +const SIGNALS: [Signal; 29] = [ + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGSYS]; +#[cfg(all(any(target_os = "linux", target_os = "android", + target_os = "emscripten", target_os = "fuchsia"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] +#[cfg(feature = "signal")] +const SIGNALS: [Signal; 31] = [ + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGSTKFLT, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGPWR, + SIGSYS]; +#[cfg(all(any(target_os = "linux", target_os = "android", + target_os = "emscripten", target_os = "fuchsia"), + any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64")))] +#[cfg(feature = "signal")] +const SIGNALS: [Signal; 30] = [ + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGPWR, + SIGSYS]; +#[cfg(not(any(target_os = "linux", target_os = "android", + target_os = "fuchsia", target_os = "emscripten", + target_os = "redox")))] +#[cfg(feature = "signal")] +const SIGNALS: [Signal; 31] = [ + SIGHUP, + SIGINT, + SIGQUIT, + SIGILL, + SIGTRAP, + SIGABRT, + SIGBUS, + SIGFPE, + SIGKILL, + SIGUSR1, + SIGSEGV, + SIGUSR2, + SIGPIPE, + SIGALRM, + SIGTERM, + SIGCHLD, + SIGCONT, + SIGSTOP, + SIGTSTP, + SIGTTIN, + SIGTTOU, + SIGURG, + SIGXCPU, + SIGXFSZ, + SIGVTALRM, + SIGPROF, + SIGWINCH, + SIGIO, + SIGSYS, + SIGEMT, + SIGINFO]; + +feature! { +#![feature = "signal"] + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +/// Iterate through all signals defined by this operating system +pub struct SignalIterator { + next: usize, +} + +impl Iterator for SignalIterator { + type Item = Signal; + + fn next(&mut self) -> Option { + if self.next < SIGNALS.len() { + let next_signal = SIGNALS[self.next]; + self.next += 1; + Some(next_signal) + } else { + None + } + } +} + +impl Signal { + /// Iterate through all signals defined by this OS + pub const fn iterator() -> SignalIterator { + SignalIterator{next: 0} + } +} + +/// Alias for [`SIGABRT`] +pub const SIGIOT : Signal = SIGABRT; +/// Alias for [`SIGIO`] +pub const SIGPOLL : Signal = SIGIO; +/// Alias for [`SIGSYS`] +pub const SIGUNUSED : Signal = SIGSYS; + +cfg_if! { + if #[cfg(target_os = "redox")] { + type SaFlags_t = libc::c_ulong; + } else if #[cfg(target_env = "uclibc")] { + type SaFlags_t = libc::c_ulong; + } else { + type SaFlags_t = libc::c_int; + } +} +} + +#[cfg(feature = "signal")] +libc_bitflags!{ + /// Controls the behavior of a [`SigAction`] + #[cfg_attr(docsrs, doc(cfg(feature = "signal")))] + pub struct SaFlags: SaFlags_t { + /// When catching a [`Signal::SIGCHLD`] signal, the signal will be + /// generated only when a child process exits, not when a child process + /// stops. + SA_NOCLDSTOP; + /// When catching a [`Signal::SIGCHLD`] signal, the system will not + /// create zombie processes when children of the calling process exit. + SA_NOCLDWAIT; + /// Further occurrences of the delivered signal are not masked during + /// the execution of the handler. + SA_NODEFER; + /// The system will deliver the signal to the process on a signal stack, + /// specified by each thread with sigaltstack(2). + SA_ONSTACK; + /// The handler is reset back to the default at the moment the signal is + /// delivered. + SA_RESETHAND; + /// Requests that certain system calls restart if interrupted by this + /// signal. See the man page for complete details. + SA_RESTART; + /// This flag is controlled internally by Nix. + SA_SIGINFO; + } +} + +#[cfg(feature = "signal")] +libc_enum! { + /// Specifies how certain functions should manipulate a signal mask + #[repr(i32)] + #[non_exhaustive] + #[cfg_attr(docsrs, doc(cfg(feature = "signal")))] + pub enum SigmaskHow { + /// The new mask is the union of the current mask and the specified set. + SIG_BLOCK, + /// The new mask is the intersection of the current mask and the + /// complement of the specified set. + SIG_UNBLOCK, + /// The current mask is replaced by the specified set. + SIG_SETMASK, + } +} + +feature! { +#![feature = "signal"] + +use crate::unistd::Pid; +use std::iter::Extend; +use std::iter::FromIterator; +use std::iter::IntoIterator; + +/// Specifies a set of [`Signal`]s that may be blocked, waited for, etc. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct SigSet { + sigset: libc::sigset_t +} + +impl SigSet { + /// Initialize to include all signals. + pub fn all() -> SigSet { + let mut sigset = mem::MaybeUninit::uninit(); + let _ = unsafe { libc::sigfillset(sigset.as_mut_ptr()) }; + + unsafe{ SigSet { sigset: sigset.assume_init() } } + } + + /// Initialize to include nothing. + pub fn empty() -> SigSet { + let mut sigset = mem::MaybeUninit::uninit(); + let _ = unsafe { libc::sigemptyset(sigset.as_mut_ptr()) }; + + unsafe{ SigSet { sigset: sigset.assume_init() } } + } + + /// Add the specified signal to the set. + pub fn add(&mut self, signal: Signal) { + unsafe { libc::sigaddset(&mut self.sigset as *mut libc::sigset_t, signal as libc::c_int) }; + } + + /// Remove all signals from this set. + pub fn clear(&mut self) { + unsafe { libc::sigemptyset(&mut self.sigset as *mut libc::sigset_t) }; + } + + /// Remove the specified signal from this set. + pub fn remove(&mut self, signal: Signal) { + unsafe { libc::sigdelset(&mut self.sigset as *mut libc::sigset_t, signal as libc::c_int) }; + } + + /// Return whether this set includes the specified signal. + pub fn contains(&self, signal: Signal) -> bool { + let res = unsafe { libc::sigismember(&self.sigset as *const libc::sigset_t, signal as libc::c_int) }; + + match res { + 1 => true, + 0 => false, + _ => unreachable!("unexpected value from sigismember"), + } + } + + /// Returns an iterator that yields the signals contained in this set. + pub fn iter(&self) -> SigSetIter<'_> { + self.into_iter() + } + + /// Gets the currently blocked (masked) set of signals for the calling thread. + pub fn thread_get_mask() -> Result { + let mut oldmask = mem::MaybeUninit::uninit(); + do_pthread_sigmask(SigmaskHow::SIG_SETMASK, None, Some(oldmask.as_mut_ptr()))?; + Ok(unsafe{ SigSet{sigset: oldmask.assume_init()}}) + } + + /// Sets the set of signals as the signal mask for the calling thread. + pub fn thread_set_mask(&self) -> Result<()> { + pthread_sigmask(SigmaskHow::SIG_SETMASK, Some(self), None) + } + + /// Adds the set of signals to the signal mask for the calling thread. + pub fn thread_block(&self) -> Result<()> { + pthread_sigmask(SigmaskHow::SIG_BLOCK, Some(self), None) + } + + /// Removes the set of signals from the signal mask for the calling thread. + pub fn thread_unblock(&self) -> Result<()> { + pthread_sigmask(SigmaskHow::SIG_UNBLOCK, Some(self), None) + } + + /// Sets the set of signals as the signal mask, and returns the old mask. + pub fn thread_swap_mask(&self, how: SigmaskHow) -> Result { + let mut oldmask = mem::MaybeUninit::uninit(); + do_pthread_sigmask(how, Some(self), Some(oldmask.as_mut_ptr()))?; + Ok(unsafe{ SigSet{sigset: oldmask.assume_init()}}) + } + + /// Suspends execution of the calling thread until one of the signals in the + /// signal mask becomes pending, and returns the accepted signal. + #[cfg(not(target_os = "redox"))] // RedoxFS does not yet support sigwait + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn wait(&self) -> Result { + use std::convert::TryFrom; + + let mut signum = mem::MaybeUninit::uninit(); + let res = unsafe { libc::sigwait(&self.sigset as *const libc::sigset_t, signum.as_mut_ptr()) }; + + Errno::result(res).map(|_| unsafe { + Signal::try_from(signum.assume_init()).unwrap() + }) + } +} + +impl AsRef for SigSet { + fn as_ref(&self) -> &libc::sigset_t { + &self.sigset + } +} + +// TODO: Consider specialization for the case where T is &SigSet and libc::sigorset is available. +impl Extend for SigSet { + fn extend(&mut self, iter: T) + where T: IntoIterator { + for signal in iter { + self.add(signal); + } + } +} + +impl FromIterator for SigSet { + fn from_iter(iter: T) -> Self + where T: IntoIterator { + let mut sigset = SigSet::empty(); + sigset.extend(iter); + sigset + } +} + +/// Iterator for a [`SigSet`]. +/// +/// Call [`SigSet::iter`] to create an iterator. +#[derive(Clone, Debug)] +pub struct SigSetIter<'a> { + sigset: &'a SigSet, + inner: SignalIterator, +} + +impl Iterator for SigSetIter<'_> { + type Item = Signal; + fn next(&mut self) -> Option { + loop { + match self.inner.next() { + None => return None, + Some(signal) if self.sigset.contains(signal) => return Some(signal), + Some(_signal) => continue, + } + } + } +} + +impl<'a> IntoIterator for &'a SigSet { + type Item = Signal; + type IntoIter = SigSetIter<'a>; + fn into_iter(self) -> Self::IntoIter { + SigSetIter { sigset: self, inner: Signal::iterator() } + } +} + +/// A signal handler. +#[allow(unknown_lints)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum SigHandler { + /// Default signal handling. + SigDfl, + /// Request that the signal be ignored. + SigIgn, + /// Use the given signal-catching function, which takes in the signal. + Handler(extern fn(libc::c_int)), + /// Use the given signal-catching function, which takes in the signal, information about how + /// the signal was generated, and a pointer to the threads `ucontext_t`. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SigAction(extern fn(libc::c_int, *mut libc::siginfo_t, *mut libc::c_void)) +} + +/// Action to take on receipt of a signal. Corresponds to `sigaction`. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct SigAction { + sigaction: libc::sigaction +} + +impl SigAction { + /// Creates a new action. + /// + /// The `SA_SIGINFO` bit in the `flags` argument is ignored (it will be set only if `handler` + /// is the `SigAction` variant). `mask` specifies other signals to block during execution of + /// the signal-catching function. + pub fn new(handler: SigHandler, flags: SaFlags, mask: SigSet) -> SigAction { + unsafe fn install_sig(p: *mut libc::sigaction, handler: SigHandler) { + (*p).sa_sigaction = match handler { + SigHandler::SigDfl => libc::SIG_DFL, + SigHandler::SigIgn => libc::SIG_IGN, + SigHandler::Handler(f) => f as *const extern fn(libc::c_int) as usize, + #[cfg(not(target_os = "redox"))] + SigHandler::SigAction(f) => f as *const extern fn(libc::c_int, *mut libc::siginfo_t, *mut libc::c_void) as usize, + }; + } + + let mut s = mem::MaybeUninit::::uninit(); + unsafe { + let p = s.as_mut_ptr(); + install_sig(p, handler); + (*p).sa_flags = match handler { + #[cfg(not(target_os = "redox"))] + SigHandler::SigAction(_) => (flags | SaFlags::SA_SIGINFO).bits(), + _ => (flags - SaFlags::SA_SIGINFO).bits(), + }; + (*p).sa_mask = mask.sigset; + + SigAction { sigaction: s.assume_init() } + } + } + + /// Returns the flags set on the action. + pub fn flags(&self) -> SaFlags { + SaFlags::from_bits_truncate(self.sigaction.sa_flags) + } + + /// Returns the set of signals that are blocked during execution of the action's + /// signal-catching function. + pub fn mask(&self) -> SigSet { + SigSet { sigset: self.sigaction.sa_mask } + } + + /// Returns the action's handler. + pub fn handler(&self) -> SigHandler { + match self.sigaction.sa_sigaction { + libc::SIG_DFL => SigHandler::SigDfl, + libc::SIG_IGN => SigHandler::SigIgn, + #[cfg(not(target_os = "redox"))] + p if self.flags().contains(SaFlags::SA_SIGINFO) => + SigHandler::SigAction( + // Safe for one of two reasons: + // * The SigHandler was created by SigHandler::new, in which + // case the pointer is correct, or + // * The SigHandler was created by signal or sigaction, which + // are unsafe functions, so the caller should've somehow + // ensured that it is correctly initialized. + unsafe{ + *(&p as *const usize + as *const extern fn(_, _, _)) + } + as extern fn(_, _, _)), + p => SigHandler::Handler( + // Safe for one of two reasons: + // * The SigHandler was created by SigHandler::new, in which + // case the pointer is correct, or + // * The SigHandler was created by signal or sigaction, which + // are unsafe functions, so the caller should've somehow + // ensured that it is correctly initialized. + unsafe{ + *(&p as *const usize + as *const extern fn(libc::c_int)) + } + as extern fn(libc::c_int)), + } + } +} + +/// Changes the action taken by a process on receipt of a specific signal. +/// +/// `signal` can be any signal except `SIGKILL` or `SIGSTOP`. On success, it returns the previous +/// action for the given signal. If `sigaction` fails, no new signal handler is installed. +/// +/// # Safety +/// +/// * Signal handlers may be called at any point during execution, which limits +/// what is safe to do in the body of the signal-catching function. Be certain +/// to only make syscalls that are explicitly marked safe for signal handlers +/// and only share global data using atomics. +/// +/// * There is also no guarantee that the old signal handler was installed +/// correctly. If it was installed by this crate, it will be. But if it was +/// installed by, for example, C code, then there is no guarantee its function +/// pointer is valid. In that case, this function effectively dereferences a +/// raw pointer of unknown provenance. +pub unsafe fn sigaction(signal: Signal, sigaction: &SigAction) -> Result { + let mut oldact = mem::MaybeUninit::::uninit(); + + let res = libc::sigaction(signal as libc::c_int, + &sigaction.sigaction as *const libc::sigaction, + oldact.as_mut_ptr()); + + Errno::result(res).map(|_| SigAction { sigaction: oldact.assume_init() }) +} + +/// Signal management (see [signal(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/signal.html)) +/// +/// Installs `handler` for the given `signal`, returning the previous signal +/// handler. `signal` should only be used following another call to `signal` or +/// if the current handler is the default. The return value of `signal` is +/// undefined after setting the handler with [`sigaction`][SigActionFn]. +/// +/// # Safety +/// +/// If the pointer to the previous signal handler is invalid, undefined +/// behavior could be invoked when casting it back to a [`SigAction`][SigActionStruct]. +/// +/// # Examples +/// +/// Ignore `SIGINT`: +/// +/// ```no_run +/// # use nix::sys::signal::{self, Signal, SigHandler}; +/// unsafe { signal::signal(Signal::SIGINT, SigHandler::SigIgn) }.unwrap(); +/// ``` +/// +/// Use a signal handler to set a flag variable: +/// +/// ```no_run +/// # #[macro_use] extern crate lazy_static; +/// # use std::convert::TryFrom; +/// # use std::sync::atomic::{AtomicBool, Ordering}; +/// # use nix::sys::signal::{self, Signal, SigHandler}; +/// lazy_static! { +/// static ref SIGNALED: AtomicBool = AtomicBool::new(false); +/// } +/// +/// extern fn handle_sigint(signal: libc::c_int) { +/// let signal = Signal::try_from(signal).unwrap(); +/// SIGNALED.store(signal == Signal::SIGINT, Ordering::Relaxed); +/// } +/// +/// fn main() { +/// let handler = SigHandler::Handler(handle_sigint); +/// unsafe { signal::signal(Signal::SIGINT, handler) }.unwrap(); +/// } +/// ``` +/// +/// # Errors +/// +/// Returns [`Error(Errno::EOPNOTSUPP)`] if `handler` is +/// [`SigAction`][SigActionStruct]. Use [`sigaction`][SigActionFn] instead. +/// +/// `signal` also returns any error from `libc::signal`, such as when an attempt +/// is made to catch a signal that cannot be caught or to ignore a signal that +/// cannot be ignored. +/// +/// [`Error::UnsupportedOperation`]: ../../enum.Error.html#variant.UnsupportedOperation +/// [SigActionStruct]: struct.SigAction.html +/// [sigactionFn]: fn.sigaction.html +pub unsafe fn signal(signal: Signal, handler: SigHandler) -> Result { + let signal = signal as libc::c_int; + let res = match handler { + SigHandler::SigDfl => libc::signal(signal, libc::SIG_DFL), + SigHandler::SigIgn => libc::signal(signal, libc::SIG_IGN), + SigHandler::Handler(handler) => libc::signal(signal, handler as libc::sighandler_t), + #[cfg(not(target_os = "redox"))] + SigHandler::SigAction(_) => return Err(Errno::ENOTSUP), + }; + Errno::result(res).map(|oldhandler| { + match oldhandler { + libc::SIG_DFL => SigHandler::SigDfl, + libc::SIG_IGN => SigHandler::SigIgn, + p => SigHandler::Handler( + *(&p as *const usize + as *const extern fn(libc::c_int)) + as extern fn(libc::c_int)), + } + }) +} + +fn do_pthread_sigmask(how: SigmaskHow, + set: Option<&SigSet>, + oldset: Option<*mut libc::sigset_t>) -> Result<()> { + if set.is_none() && oldset.is_none() { + return Ok(()) + } + + let res = unsafe { + // if set or oldset is None, pass in null pointers instead + libc::pthread_sigmask(how as libc::c_int, + set.map_or_else(ptr::null::, + |s| &s.sigset as *const libc::sigset_t), + oldset.unwrap_or(ptr::null_mut()) + ) + }; + + Errno::result(res).map(drop) +} + +/// Manages the signal mask (set of blocked signals) for the calling thread. +/// +/// If the `set` parameter is `Some(..)`, then the signal mask will be updated with the signal set. +/// The `how` flag decides the type of update. If `set` is `None`, `how` will be ignored, +/// and no modification will take place. +/// +/// If the 'oldset' parameter is `Some(..)` then the current signal mask will be written into it. +/// +/// If both `set` and `oldset` is `Some(..)`, the current signal mask will be written into oldset, +/// and then it will be updated with `set`. +/// +/// If both `set` and `oldset` is None, this function is a no-op. +/// +/// For more information, visit the [`pthread_sigmask`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html), +/// or [`sigprocmask`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html) man pages. +pub fn pthread_sigmask(how: SigmaskHow, + set: Option<&SigSet>, + oldset: Option<&mut SigSet>) -> Result<()> +{ + do_pthread_sigmask(how, set, oldset.map(|os| &mut os.sigset as *mut _ )) +} + +/// Examine and change blocked signals. +/// +/// For more information see the [`sigprocmask` man +/// pages](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html). +pub fn sigprocmask(how: SigmaskHow, set: Option<&SigSet>, oldset: Option<&mut SigSet>) -> Result<()> { + if set.is_none() && oldset.is_none() { + return Ok(()) + } + + let res = unsafe { + // if set or oldset is None, pass in null pointers instead + libc::sigprocmask(how as libc::c_int, + set.map_or_else(ptr::null::, + |s| &s.sigset as *const libc::sigset_t), + oldset.map_or_else(ptr::null_mut::, + |os| &mut os.sigset as *mut libc::sigset_t)) + }; + + Errno::result(res).map(drop) +} + +/// Send a signal to a process +/// +/// # Arguments +/// +/// * `pid` - Specifies which processes should receive the signal. +/// - If positive, specifies an individual process +/// - If zero, the signal will be sent to all processes whose group +/// ID is equal to the process group ID of the sender. This is a +/// variant of [`killpg`]. +/// - If `-1` and the process has super-user privileges, the signal +/// is sent to all processes exclusing system processes. +/// - If less than `-1`, the signal is sent to all processes whose +/// process group ID is equal to the absolute value of `pid`. +/// * `signal` - Signal to send. If `None`, error checking is performed +/// but no signal is actually sent. +/// +/// See Also +/// [`kill(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html) +pub fn kill>>(pid: Pid, signal: T) -> Result<()> { + let res = unsafe { libc::kill(pid.into(), + match signal.into() { + Some(s) => s as libc::c_int, + None => 0, + }) }; + + Errno::result(res).map(drop) +} + +/// Send a signal to a process group +/// +/// # Arguments +/// +/// * `pgrp` - Process group to signal. If less then or equal 1, the behavior +/// is platform-specific. +/// * `signal` - Signal to send. If `None`, `killpg` will only preform error +/// checking and won't send any signal. +/// +/// See Also [killpg(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/killpg.html). +#[cfg(not(target_os = "fuchsia"))] +pub fn killpg>>(pgrp: Pid, signal: T) -> Result<()> { + let res = unsafe { libc::killpg(pgrp.into(), + match signal.into() { + Some(s) => s as libc::c_int, + None => 0, + }) }; + + Errno::result(res).map(drop) +} + +/// Send a signal to the current thread +/// +/// See Also [raise(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/raise.html) +pub fn raise(signal: Signal) -> Result<()> { + let res = unsafe { libc::raise(signal as libc::c_int) }; + + Errno::result(res).map(drop) +} +} + + +feature! { +#![any(feature = "aio", feature = "signal")] + +/// Identifies a thread for [`SigevNotify::SigevThreadId`] +#[cfg(target_os = "freebsd")] +pub type type_of_thread_id = libc::lwpid_t; +/// Identifies a thread for [`SigevNotify::SigevThreadId`] +#[cfg(target_os = "linux")] +pub type type_of_thread_id = libc::pid_t; + +/// Specifies the notification method used by a [`SigEvent`] +// sigval is actually a union of a int and a void*. But it's never really used +// as a pointer, because neither libc nor the kernel ever dereference it. nix +// therefore presents it as an intptr_t, which is how kevent uses it. +#[cfg(not(any(target_os = "openbsd", target_os = "redox")))] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum SigevNotify { + /// No notification will be delivered + SigevNone, + /// Notify by delivering a signal to the process. + SigevSignal { + /// Signal to deliver + signal: Signal, + /// Will be present in the `si_value` field of the [`libc::siginfo_t`] + /// structure of the queued signal. + si_value: libc::intptr_t + }, + // Note: SIGEV_THREAD is not implemented because libc::sigevent does not + // expose a way to set the union members needed by SIGEV_THREAD. + /// Notify by delivering an event to a kqueue. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SigevKevent { + /// File descriptor of the kqueue to notify. + kq: RawFd, + /// Will be contained in the kevent's `udata` field. + udata: libc::intptr_t + }, + /// Notify by delivering a signal to a thread. + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SigevThreadId { + /// Signal to send + signal: Signal, + /// LWP ID of the thread to notify + thread_id: type_of_thread_id, + /// Will be present in the `si_value` field of the [`libc::siginfo_t`] + /// structure of the queued signal. + si_value: libc::intptr_t + }, +} +} + +#[cfg(not(any(target_os = "openbsd", target_os = "redox")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod sigevent { + feature! { + #![any(feature = "aio", feature = "signal")] + + use std::mem; + use std::ptr; + use super::SigevNotify; + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + use super::type_of_thread_id; + + /// Used to request asynchronous notification of the completion of certain + /// events, such as POSIX AIO and timers. + #[repr(C)] + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct SigEvent { + sigevent: libc::sigevent + } + + impl SigEvent { + /// **Note:** this constructor does not allow the user to set the + /// `sigev_notify_kevent_flags` field. That's considered ok because on FreeBSD + /// at least those flags don't do anything useful. That field is part of a + /// union that shares space with the more genuinely useful fields. + /// + /// **Note:** This constructor also doesn't allow the caller to set the + /// `sigev_notify_function` or `sigev_notify_attributes` fields, which are + /// required for `SIGEV_THREAD`. That's considered ok because on no operating + /// system is `SIGEV_THREAD` the most efficient way to deliver AIO + /// notification. FreeBSD and DragonFly BSD programs should prefer `SIGEV_KEVENT`. + /// Linux, Solaris, and portable programs should prefer `SIGEV_THREAD_ID` or + /// `SIGEV_SIGNAL`. That field is part of a union that shares space with the + /// more genuinely useful `sigev_notify_thread_id` + // Allow invalid_value warning on Fuchsia only. + // See https://github.com/nix-rust/nix/issues/1441 + #[cfg_attr(target_os = "fuchsia", allow(invalid_value))] + pub fn new(sigev_notify: SigevNotify) -> SigEvent { + let mut sev = unsafe { mem::MaybeUninit::::zeroed().assume_init() }; + sev.sigev_notify = match sigev_notify { + SigevNotify::SigevNone => libc::SIGEV_NONE, + SigevNotify::SigevSignal{..} => libc::SIGEV_SIGNAL, + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + SigevNotify::SigevKevent{..} => libc::SIGEV_KEVENT, + #[cfg(target_os = "freebsd")] + SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID, + #[cfg(all(target_os = "linux", target_env = "gnu", not(target_arch = "mips")))] + SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID, + #[cfg(all(target_os = "linux", target_env = "uclibc"))] + SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID, + #[cfg(any(all(target_os = "linux", target_env = "musl"), target_arch = "mips"))] + SigevNotify::SigevThreadId{..} => 4 // No SIGEV_THREAD_ID defined + }; + sev.sigev_signo = match sigev_notify { + SigevNotify::SigevSignal{ signal, .. } => signal as libc::c_int, + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + SigevNotify::SigevKevent{ kq, ..} => kq, + #[cfg(any(target_os = "linux", target_os = "freebsd"))] + SigevNotify::SigevThreadId{ signal, .. } => signal as libc::c_int, + _ => 0 + }; + sev.sigev_value.sival_ptr = match sigev_notify { + SigevNotify::SigevNone => ptr::null_mut::(), + SigevNotify::SigevSignal{ si_value, .. } => si_value as *mut libc::c_void, + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + SigevNotify::SigevKevent{ udata, .. } => udata as *mut libc::c_void, + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + SigevNotify::SigevThreadId{ si_value, .. } => si_value as *mut libc::c_void, + }; + SigEvent::set_tid(&mut sev, &sigev_notify); + SigEvent{sigevent: sev} + } + + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + fn set_tid(sev: &mut libc::sigevent, sigev_notify: &SigevNotify) { + sev.sigev_notify_thread_id = match *sigev_notify { + SigevNotify::SigevThreadId { thread_id, .. } => thread_id, + _ => 0 as type_of_thread_id + }; + } + + #[cfg(not(any(target_os = "freebsd", target_os = "linux")))] + fn set_tid(_sev: &mut libc::sigevent, _sigev_notify: &SigevNotify) { + } + + /// Return a copy of the inner structure + pub fn sigevent(&self) -> libc::sigevent { + self.sigevent + } + + /// Returns a mutable pointer to the `sigevent` wrapped by `self` + pub fn as_mut_ptr(&mut self) -> *mut libc::sigevent { + &mut self.sigevent + } + } + + impl<'a> From<&'a libc::sigevent> for SigEvent { + fn from(sigevent: &libc::sigevent) -> Self { + SigEvent{ sigevent: *sigevent } + } + } + } +} + +#[cfg(test)] +mod tests { + #[cfg(not(target_os = "redox"))] + use std::thread; + use super::*; + + #[test] + fn test_contains() { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + assert!(mask.contains(SIGUSR1)); + assert!(!mask.contains(SIGUSR2)); + + let all = SigSet::all(); + assert!(all.contains(SIGUSR1)); + assert!(all.contains(SIGUSR2)); + } + + #[test] + fn test_clear() { + let mut set = SigSet::all(); + set.clear(); + for signal in Signal::iterator() { + assert!(!set.contains(signal)); + } + } + + #[test] + fn test_from_str_round_trips() { + for signal in Signal::iterator() { + assert_eq!(signal.as_ref().parse::().unwrap(), signal); + assert_eq!(signal.to_string().parse::().unwrap(), signal); + } + } + + #[test] + fn test_from_str_invalid_value() { + let errval = Err(Errno::EINVAL); + assert_eq!("NOSIGNAL".parse::(), errval); + assert_eq!("kill".parse::(), errval); + assert_eq!("9".parse::(), errval); + } + + #[test] + fn test_extend() { + let mut one_signal = SigSet::empty(); + one_signal.add(SIGUSR1); + + let mut two_signals = SigSet::empty(); + two_signals.add(SIGUSR2); + two_signals.extend(&one_signal); + + assert!(two_signals.contains(SIGUSR1)); + assert!(two_signals.contains(SIGUSR2)); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_set_mask() { + thread::spawn(|| { + let prev_mask = SigSet::thread_get_mask() + .expect("Failed to get existing signal mask!"); + + let mut test_mask = prev_mask; + test_mask.add(SIGUSR1); + + assert!(test_mask.thread_set_mask().is_ok()); + let new_mask = SigSet::thread_get_mask() + .expect("Failed to get new mask!"); + + assert!(new_mask.contains(SIGUSR1)); + assert!(!new_mask.contains(SIGUSR2)); + + prev_mask.thread_set_mask().expect("Failed to revert signal mask!"); + }).join().unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_block() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + assert!(mask.thread_block().is_ok()); + + assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); + }).join().unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_unblock() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + assert!(mask.thread_unblock().is_ok()); + + assert!(!SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); + }).join().unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_swap() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + mask.thread_block().unwrap(); + + assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); + + let mut mask2 = SigSet::empty(); + mask2.add(SIGUSR2); + + let oldmask = mask2.thread_swap_mask(SigmaskHow::SIG_SETMASK) + .unwrap(); + + assert!(oldmask.contains(SIGUSR1)); + assert!(!oldmask.contains(SIGUSR2)); + + assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR2)); + }).join().unwrap(); + } + + #[test] + fn test_from_and_into_iterator() { + let sigset = SigSet::from_iter(vec![Signal::SIGUSR1, Signal::SIGUSR2]); + let signals = sigset.into_iter().collect::>(); + assert_eq!(signals, [Signal::SIGUSR1, Signal::SIGUSR2]); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_sigaction() { + thread::spawn(|| { + extern fn test_sigaction_handler(_: libc::c_int) {} + extern fn test_sigaction_action(_: libc::c_int, + _: *mut libc::siginfo_t, _: *mut libc::c_void) {} + + let handler_sig = SigHandler::Handler(test_sigaction_handler); + + let flags = SaFlags::SA_ONSTACK | SaFlags::SA_RESTART | + SaFlags::SA_SIGINFO; + + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + let action_sig = SigAction::new(handler_sig, flags, mask); + + assert_eq!(action_sig.flags(), + SaFlags::SA_ONSTACK | SaFlags::SA_RESTART); + assert_eq!(action_sig.handler(), handler_sig); + + mask = action_sig.mask(); + assert!(mask.contains(SIGUSR1)); + assert!(!mask.contains(SIGUSR2)); + + let handler_act = SigHandler::SigAction(test_sigaction_action); + let action_act = SigAction::new(handler_act, flags, mask); + assert_eq!(action_act.handler(), handler_act); + + let action_dfl = SigAction::new(SigHandler::SigDfl, flags, mask); + assert_eq!(action_dfl.handler(), SigHandler::SigDfl); + + let action_ign = SigAction::new(SigHandler::SigIgn, flags, mask); + assert_eq!(action_ign.handler(), SigHandler::SigIgn); + }).join().unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_sigwait() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + mask.add(SIGUSR2); + mask.thread_block().unwrap(); + + raise(SIGUSR1).unwrap(); + assert_eq!(mask.wait().unwrap(), SIGUSR1); + }).join().unwrap(); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/signalfd.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/signalfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..bc4a4522439ad22789609139206caabed0e6927f --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/signalfd.rs @@ -0,0 +1,169 @@ +//! Interface for the `signalfd` syscall. +//! +//! # Signal discarding +//! When a signal can't be delivered to a process (or thread), it will become a pending signal. +//! Failure to deliver could happen if the signal is blocked by every thread in the process or if +//! the signal handler is still handling a previous signal. +//! +//! If a signal is sent to a process (or thread) that already has a pending signal of the same +//! type, it will be discarded. This means that if signals of the same type are received faster than +//! they are processed, some of those signals will be dropped. Because of this limitation, +//! `signalfd` in itself cannot be used for reliable communication between processes or threads. +//! +//! Once the signal is unblocked, or the signal handler is finished, and a signal is still pending +//! (ie. not consumed from a signalfd) it will be delivered to the signal handler. +//! +//! Please note that signal discarding is not specific to `signalfd`, but also happens with regular +//! signal handlers. +use crate::unistd; +use crate::Result; +use crate::errno::Errno; +pub use crate::sys::signal::{self, SigSet}; +pub use libc::signalfd_siginfo as siginfo; + +use std::os::unix::io::{RawFd, AsRawFd}; +use std::mem; + + +libc_bitflags!{ + pub struct SfdFlags: libc::c_int { + SFD_NONBLOCK; + SFD_CLOEXEC; + } +} + +pub const SIGNALFD_NEW: RawFd = -1; +#[deprecated(since = "0.23.0", note = "use mem::size_of::() instead")] +pub const SIGNALFD_SIGINFO_SIZE: usize = mem::size_of::(); + +/// Creates a new file descriptor for reading signals. +/// +/// **Important:** please read the module level documentation about signal discarding before using +/// this function! +/// +/// The `mask` parameter specifies the set of signals that can be accepted via this file descriptor. +/// +/// A signal must be blocked on every thread in a process, otherwise it won't be visible from +/// signalfd (the default handler will be invoked instead). +/// +/// See [the signalfd man page for more information](https://man7.org/linux/man-pages/man2/signalfd.2.html) +pub fn signalfd(fd: RawFd, mask: &SigSet, flags: SfdFlags) -> Result { + unsafe { + Errno::result(libc::signalfd(fd as libc::c_int, mask.as_ref(), flags.bits())) + } +} + +/// A helper struct for creating, reading and closing a `signalfd` instance. +/// +/// **Important:** please read the module level documentation about signal discarding before using +/// this struct! +/// +/// # Examples +/// +/// ``` +/// # use nix::sys::signalfd::*; +/// // Set the thread to block the SIGUSR1 signal, otherwise the default handler will be used +/// let mut mask = SigSet::empty(); +/// mask.add(signal::SIGUSR1); +/// mask.thread_block().unwrap(); +/// +/// // Signals are queued up on the file descriptor +/// let mut sfd = SignalFd::with_flags(&mask, SfdFlags::SFD_NONBLOCK).unwrap(); +/// +/// match sfd.read_signal() { +/// // we caught a signal +/// Ok(Some(sig)) => (), +/// // there were no signals waiting (only happens when the SFD_NONBLOCK flag is set, +/// // otherwise the read_signal call blocks) +/// Ok(None) => (), +/// Err(err) => (), // some error happend +/// } +/// ``` +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct SignalFd(RawFd); + +impl SignalFd { + pub fn new(mask: &SigSet) -> Result { + Self::with_flags(mask, SfdFlags::empty()) + } + + pub fn with_flags(mask: &SigSet, flags: SfdFlags) -> Result { + let fd = signalfd(SIGNALFD_NEW, mask, flags)?; + + Ok(SignalFd(fd)) + } + + pub fn set_mask(&mut self, mask: &SigSet) -> Result<()> { + signalfd(self.0, mask, SfdFlags::empty()).map(drop) + } + + pub fn read_signal(&mut self) -> Result> { + let mut buffer = mem::MaybeUninit::::uninit(); + + let size = mem::size_of_val(&buffer); + let res = Errno::result(unsafe { + libc::read(self.0, buffer.as_mut_ptr() as *mut libc::c_void, size) + }).map(|r| r as usize); + match res { + Ok(x) if x == size => Ok(Some(unsafe { buffer.assume_init() })), + Ok(_) => unreachable!("partial read on signalfd"), + Err(Errno::EAGAIN) => Ok(None), + Err(error) => Err(error) + } + } +} + +impl Drop for SignalFd { + fn drop(&mut self) { + let e = unistd::close(self.0); + if !std::thread::panicking() && e == Err(Errno::EBADF) { + panic!("Closing an invalid file descriptor!"); + }; + } +} + +impl AsRawFd for SignalFd { + fn as_raw_fd(&self) -> RawFd { + self.0 + } +} + +impl Iterator for SignalFd { + type Item = siginfo; + + fn next(&mut self) -> Option { + match self.read_signal() { + Ok(Some(sig)) => Some(sig), + Ok(None) | Err(_) => None, + } + } +} + + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn create_signalfd() { + let mask = SigSet::empty(); + let fd = SignalFd::new(&mask); + assert!(fd.is_ok()); + } + + #[test] + fn create_signalfd_with_opts() { + let mask = SigSet::empty(); + let fd = SignalFd::with_flags(&mask, SfdFlags::SFD_CLOEXEC | SfdFlags::SFD_NONBLOCK); + assert!(fd.is_ok()); + } + + #[test] + fn read_empty_signalfd() { + let mask = SigSet::empty(); + let mut fd = SignalFd::with_flags(&mask, SfdFlags::SFD_NONBLOCK).unwrap(); + + let res = fd.read_signal(); + assert!(res.unwrap().is_none()); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/socket/addr.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/socket/addr.rs new file mode 100644 index 0000000000000000000000000000000000000000..7a11fe556b622cb0eda8fe38fbe2f8a15fbfb4ba --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/socket/addr.rs @@ -0,0 +1,2812 @@ +use super::sa_family_t; +use cfg_if::cfg_if; +use crate::{Result, NixPath}; +use crate::errno::Errno; +use memoffset::offset_of; +use std::{fmt, mem, net, ptr, slice}; +use std::convert::TryInto; +use std::ffi::OsStr; +use std::hash::{Hash, Hasher}; +use std::path::Path; +use std::os::unix::ffi::OsStrExt; +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::sys::socket::addr::netlink::NetlinkAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::sys::socket::addr::alg::AlgAddr; +#[cfg(any(target_os = "ios", target_os = "macos"))] +use std::os::unix::io::RawFd; +#[cfg(all(feature = "ioctl", any(target_os = "ios", target_os = "macos")))] +use crate::sys::socket::addr::sys_control::SysControlAddr; +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "fuchsia"))] +#[cfg(feature = "net")] +pub use self::datalink::LinkAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::vsock::VsockAddr; + +/// Convert a std::net::Ipv4Addr into the libc form. +#[cfg(feature = "net")] +pub(crate) fn ipv4addr_to_libc(addr: net::Ipv4Addr) -> libc::in_addr { + let octets = addr.octets(); + libc::in_addr { + s_addr: u32::to_be(((octets[0] as u32) << 24) | + ((octets[1] as u32) << 16) | + ((octets[2] as u32) << 8) | + (octets[3] as u32)) + } +} + +/// Convert a std::net::Ipv6Addr into the libc form. +#[cfg(feature = "net")] +pub(crate) const fn ipv6addr_to_libc(addr: &net::Ipv6Addr) -> libc::in6_addr { + libc::in6_addr { + s6_addr: addr.octets() + } +} + +/// These constants specify the protocol family to be used +/// in [`socket`](fn.socket.html) and [`socketpair`](fn.socketpair.html) +/// +/// # References +/// +/// [address_families(7)](https://man7.org/linux/man-pages/man7/address_families.7.html) +// Should this be u8? +#[repr(i32)] +#[non_exhaustive] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] +pub enum AddressFamily { + /// Local communication (see [`unix(7)`](https://man7.org/linux/man-pages/man7/unix.7.html)) + Unix = libc::AF_UNIX, + /// IPv4 Internet protocols (see [`ip(7)`](https://man7.org/linux/man-pages/man7/ip.7.html)) + Inet = libc::AF_INET, + /// IPv6 Internet protocols (see [`ipv6(7)`](https://man7.org/linux/man-pages/man7/ipv6.7.html)) + Inet6 = libc::AF_INET6, + /// Kernel user interface device (see [`netlink(7)`](https://man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Netlink = libc::AF_NETLINK, + /// Low level packet interface (see [`packet(7)`](https://man7.org/linux/man-pages/man7/packet.7.html)) + #[cfg(any(target_os = "android", + target_os = "linux", + target_os = "illumos", + target_os = "fuchsia", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Packet = libc::AF_PACKET, + /// KEXT Controls and Notifications + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + System = libc::AF_SYSTEM, + /// Amateur radio AX.25 protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ax25 = libc::AF_AX25, + /// IPX - Novell protocols + Ipx = libc::AF_IPX, + /// AppleTalk + AppleTalk = libc::AF_APPLETALK, + /// AX.25 packet layer protocol. + /// (see [netrom(4)](https://www.unix.com/man-page/linux/4/netrom/)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetRom = libc::AF_NETROM, + /// Can't be used for creating sockets; mostly used for bridge + /// links in + /// [rtnetlink(7)](https://man7.org/linux/man-pages/man7/rtnetlink.7.html) + /// protocol commands. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Bridge = libc::AF_BRIDGE, + /// Access to raw ATM PVCs + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AtmPvc = libc::AF_ATMPVC, + /// ITU-T X.25 / ISO-8208 protocol (see [`x25(7)`](https://man7.org/linux/man-pages/man7/x25.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + X25 = libc::AF_X25, + /// RATS (Radio Amateur Telecommunications Society) Open + /// Systems environment (ROSE) AX.25 packet layer protocol. + /// (see [netrom(4)](https://www.unix.com/man-page/linux/4/netrom/)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Rose = libc::AF_ROSE, + /// DECet protocol sockets. + Decnet = libc::AF_DECnet, + /// Reserved for "802.2LLC project"; never used. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetBeui = libc::AF_NETBEUI, + /// This was a short-lived (between Linux 2.1.30 and + /// 2.1.99pre2) protocol family for firewall upcalls. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Security = libc::AF_SECURITY, + /// Key management protocol. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Key = libc::AF_KEY, + #[allow(missing_docs)] // Not documented anywhere that I can find + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ash = libc::AF_ASH, + /// Acorn Econet protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Econet = libc::AF_ECONET, + /// Access to ATM Switched Virtual Circuits + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AtmSvc = libc::AF_ATMSVC, + /// Reliable Datagram Sockets (RDS) protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Rds = libc::AF_RDS, + /// IBM SNA + Sna = libc::AF_SNA, + /// Socket interface over IrDA + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Irda = libc::AF_IRDA, + /// Generic PPP transport layer, for setting up L2 tunnels (L2TP and PPPoE) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Pppox = libc::AF_PPPOX, + /// Legacy protocol for wide area network (WAN) connectivity that was used + /// by Sangoma WAN cards + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Wanpipe = libc::AF_WANPIPE, + /// Logical link control (IEEE 802.2 LLC) protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Llc = libc::AF_LLC, + /// InfiniBand native addressing + #[cfg(all(target_os = "linux", not(target_env = "uclibc")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ib = libc::AF_IB, + /// Multiprotocol Label Switching + #[cfg(all(target_os = "linux", not(target_env = "uclibc")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Mpls = libc::AF_MPLS, + /// Controller Area Network automotive bus protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Can = libc::AF_CAN, + /// TIPC, "cluster domain sockets" protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Tipc = libc::AF_TIPC, + /// Bluetooth low-level socket protocol + #[cfg(not(any(target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Bluetooth = libc::AF_BLUETOOTH, + /// IUCV (inter-user communication vehicle) z/VM protocol for + /// hypervisor-guest interaction + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Iucv = libc::AF_IUCV, + /// Rx, Andrew File System remote procedure call protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + RxRpc = libc::AF_RXRPC, + /// New "modular ISDN" driver interface protocol + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Isdn = libc::AF_ISDN, + /// Nokia cellular modem IPC/RPC interface + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Phonet = libc::AF_PHONET, + /// IEEE 802.15.4 WPAN (wireless personal area network) raw packet protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ieee802154 = libc::AF_IEEE802154, + /// Ericsson's Communication CPU to Application CPU interface (CAIF) + /// protocol. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Caif = libc::AF_CAIF, + /// Interface to kernel crypto API + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Alg = libc::AF_ALG, + /// Near field communication + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + Nfc = libc::AF_NFC, + /// VMWare VSockets protocol for hypervisor-guest interaction. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Vsock = libc::AF_VSOCK, + /// ARPANet IMP addresses + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ImpLink = libc::AF_IMPLINK, + /// PUP protocols, e.g. BSP + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Pup = libc::AF_PUP, + /// MIT CHAOS protocols + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Chaos = libc::AF_CHAOS, + /// Novell and Xerox protocol + #[cfg(any(target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ns = libc::AF_NS, + #[allow(missing_docs)] // Not documented anywhere that I can find + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Iso = libc::AF_ISO, + /// Bell Labs virtual circuit switch ? + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Datakit = libc::AF_DATAKIT, + /// CCITT protocols, X.25 etc + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ccitt = libc::AF_CCITT, + /// DEC Direct data link interface + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Dli = libc::AF_DLI, + #[allow(missing_docs)] // Not documented anywhere that I can find + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Lat = libc::AF_LAT, + /// NSC Hyperchannel + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Hylink = libc::AF_HYLINK, + /// Link layer interface + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Link = libc::AF_LINK, + /// connection-oriented IP, aka ST II + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Coip = libc::AF_COIP, + /// Computer Network Technology + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Cnt = libc::AF_CNT, + /// Native ATM access + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Natm = libc::AF_NATM, + /// Unspecified address family, (see [`getaddrinfo(3)`](https://man7.org/linux/man-pages/man3/getaddrinfo.3.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Unspec = libc::AF_UNSPEC, +} + +impl AddressFamily { + /// Create a new `AddressFamily` from an integer value retrieved from `libc`, usually from + /// the `sa_family` field of a `sockaddr`. + /// + /// Currently only supports these address families: Unix, Inet (v4 & v6), Netlink, Link/Packet + /// and System. Returns None for unsupported or unknown address families. + pub const fn from_i32(family: i32) -> Option { + match family { + libc::AF_UNIX => Some(AddressFamily::Unix), + libc::AF_INET => Some(AddressFamily::Inet), + libc::AF_INET6 => Some(AddressFamily::Inet6), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => Some(AddressFamily::Netlink), + #[cfg(any(target_os = "macos", target_os = "macos"))] + libc::AF_SYSTEM => Some(AddressFamily::System), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_PACKET => Some(AddressFamily::Packet), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + libc::AF_LINK => Some(AddressFamily::Link), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => Some(AddressFamily::Vsock), + _ => None + } + } +} + +feature! { +#![feature = "net"] + +#[deprecated( + since = "0.24.0", + note = "use SockaddrIn, SockaddrIn6, or SockaddrStorage instead" +)] +#[allow(missing_docs)] // Since they're all deprecated anyway +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum InetAddr { + V4(libc::sockaddr_in), + V6(libc::sockaddr_in6), +} + +#[allow(missing_docs)] // It's deprecated anyway +#[allow(deprecated)] +impl InetAddr { + #[allow(clippy::needless_update)] // It isn't needless on all OSes + pub fn from_std(std: &net::SocketAddr) -> InetAddr { + match *std { + net::SocketAddr::V4(ref addr) => { + InetAddr::V4(libc::sockaddr_in { + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "hermit", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + sin_len: mem::size_of::() as u8, + sin_family: AddressFamily::Inet as sa_family_t, + sin_port: addr.port().to_be(), // network byte order + sin_addr: Ipv4Addr::from_std(addr.ip()).0, + .. unsafe { mem::zeroed() } + }) + } + net::SocketAddr::V6(ref addr) => { + InetAddr::V6(libc::sockaddr_in6 { + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "hermit", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + sin6_len: mem::size_of::() as u8, + sin6_family: AddressFamily::Inet6 as sa_family_t, + sin6_port: addr.port().to_be(), // network byte order + sin6_addr: Ipv6Addr::from_std(addr.ip()).0, + sin6_flowinfo: addr.flowinfo(), // host byte order + sin6_scope_id: addr.scope_id(), // host byte order + .. unsafe { mem::zeroed() } + }) + } + } + } + + #[allow(clippy::needless_update)] // It isn't needless on all OSes + pub fn new(ip: IpAddr, port: u16) -> InetAddr { + match ip { + IpAddr::V4(ref ip) => { + InetAddr::V4(libc::sockaddr_in { + sin_family: AddressFamily::Inet as sa_family_t, + sin_port: port.to_be(), + sin_addr: ip.0, + .. unsafe { mem::zeroed() } + }) + } + IpAddr::V6(ref ip) => { + InetAddr::V6(libc::sockaddr_in6 { + sin6_family: AddressFamily::Inet6 as sa_family_t, + sin6_port: port.to_be(), + sin6_addr: ip.0, + .. unsafe { mem::zeroed() } + }) + } + } + } + /// Gets the IP address associated with this socket address. + pub const fn ip(&self) -> IpAddr { + match *self { + InetAddr::V4(ref sa) => IpAddr::V4(Ipv4Addr(sa.sin_addr)), + InetAddr::V6(ref sa) => IpAddr::V6(Ipv6Addr(sa.sin6_addr)), + } + } + + /// Gets the port number associated with this socket address + pub const fn port(&self) -> u16 { + match *self { + InetAddr::V6(ref sa) => u16::from_be(sa.sin6_port), + InetAddr::V4(ref sa) => u16::from_be(sa.sin_port), + } + } + + pub fn to_std(&self) -> net::SocketAddr { + match *self { + InetAddr::V4(ref sa) => net::SocketAddr::V4( + net::SocketAddrV4::new( + Ipv4Addr(sa.sin_addr).to_std(), + self.port())), + InetAddr::V6(ref sa) => net::SocketAddr::V6( + net::SocketAddrV6::new( + Ipv6Addr(sa.sin6_addr).to_std(), + self.port(), + sa.sin6_flowinfo, + sa.sin6_scope_id)), + } + } + + #[deprecated(since = "0.23.0", note = "use .to_string() instead")] + pub fn to_str(&self) -> String { + format!("{}", self) + } +} + +#[allow(deprecated)] +impl fmt::Display for InetAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + InetAddr::V4(_) => write!(f, "{}:{}", self.ip(), self.port()), + InetAddr::V6(_) => write!(f, "[{}]:{}", self.ip(), self.port()), + } + } +} + +/* + * + * ===== IpAddr ===== + * + */ +#[allow(missing_docs)] // Since they're all deprecated anyway +#[allow(deprecated)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[deprecated( + since = "0.24.0", + note = "Use std::net::IpAddr instead" +)] +pub enum IpAddr { + V4(Ipv4Addr), + V6(Ipv6Addr), +} + +#[allow(deprecated)] +#[allow(missing_docs)] // Since they're all deprecated anyway +impl IpAddr { + /// Create a new IpAddr that contains an IPv4 address. + /// + /// The result will represent the IP address a.b.c.d + pub const fn new_v4(a: u8, b: u8, c: u8, d: u8) -> IpAddr { + IpAddr::V4(Ipv4Addr::new(a, b, c, d)) + } + + /// Create a new IpAddr that contains an IPv6 address. + /// + /// The result will represent the IP address a:b:c:d:e:f + #[allow(clippy::many_single_char_names)] + #[allow(clippy::too_many_arguments)] + pub const fn new_v6(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> IpAddr { + IpAddr::V6(Ipv6Addr::new(a, b, c, d, e, f, g, h)) + } + + pub fn from_std(std: &net::IpAddr) -> IpAddr { + match *std { + net::IpAddr::V4(ref std) => IpAddr::V4(Ipv4Addr::from_std(std)), + net::IpAddr::V6(ref std) => IpAddr::V6(Ipv6Addr::from_std(std)), + } + } + + pub const fn to_std(&self) -> net::IpAddr { + match *self { + IpAddr::V4(ref ip) => net::IpAddr::V4(ip.to_std()), + IpAddr::V6(ref ip) => net::IpAddr::V6(ip.to_std()), + } + } +} + +#[allow(deprecated)] +impl fmt::Display for IpAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + IpAddr::V4(ref v4) => v4.fmt(f), + IpAddr::V6(ref v6) => v6.fmt(f) + } + } +} + +/* + * + * ===== Ipv4Addr ===== + * + */ + +#[deprecated( + since = "0.24.0", + note = "Use std::net::Ipv4Addr instead" +)] +#[allow(missing_docs)] // Since they're all deprecated anyway +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct Ipv4Addr(pub libc::in_addr); + +#[allow(deprecated)] +#[allow(missing_docs)] // Since they're all deprecated anyway +impl Ipv4Addr { + #[allow(clippy::identity_op)] // More readable this way + pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr { + let ip = (((a as u32) << 24) | + ((b as u32) << 16) | + ((c as u32) << 8) | + ((d as u32) << 0)).to_be(); + + Ipv4Addr(libc::in_addr { s_addr: ip }) + } + + // Use pass by reference for symmetry with Ipv6Addr::from_std + #[allow(clippy::trivially_copy_pass_by_ref)] + pub fn from_std(std: &net::Ipv4Addr) -> Ipv4Addr { + let bits = std.octets(); + Ipv4Addr::new(bits[0], bits[1], bits[2], bits[3]) + } + + pub const fn any() -> Ipv4Addr { + Ipv4Addr(libc::in_addr { s_addr: libc::INADDR_ANY }) + } + + pub const fn octets(self) -> [u8; 4] { + let bits = u32::from_be(self.0.s_addr); + [(bits >> 24) as u8, (bits >> 16) as u8, (bits >> 8) as u8, bits as u8] + } + + pub const fn to_std(self) -> net::Ipv4Addr { + let bits = self.octets(); + net::Ipv4Addr::new(bits[0], bits[1], bits[2], bits[3]) + } +} + +#[allow(deprecated)] +impl fmt::Display for Ipv4Addr { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + let octets = self.octets(); + write!(fmt, "{}.{}.{}.{}", octets[0], octets[1], octets[2], octets[3]) + } +} + +/* + * + * ===== Ipv6Addr ===== + * + */ + +#[deprecated( + since = "0.24.0", + note = "Use std::net::Ipv6Addr instead" +)] +#[allow(missing_docs)] // Since they're all deprecated anyway +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct Ipv6Addr(pub libc::in6_addr); + +// Note that IPv6 addresses are stored in big endian order on all architectures. +// See https://tools.ietf.org/html/rfc1700 or consult your favorite search +// engine. + +macro_rules! to_u8_array { + ($($num:ident),*) => { + [ $(($num>>8) as u8, ($num&0xff) as u8,)* ] + } +} + +macro_rules! to_u16_array { + ($slf:ident, $($first:expr, $second:expr),*) => { + [$( (($slf.0.s6_addr[$first] as u16) << 8) + $slf.0.s6_addr[$second] as u16,)*] + } +} + +#[allow(deprecated)] +#[allow(missing_docs)] // Since they're all deprecated anyway +impl Ipv6Addr { + #[allow(clippy::many_single_char_names)] + #[allow(clippy::too_many_arguments)] + pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr { + Ipv6Addr(libc::in6_addr{s6_addr: to_u8_array!(a,b,c,d,e,f,g,h)}) + } + + pub fn from_std(std: &net::Ipv6Addr) -> Ipv6Addr { + let s = std.segments(); + Ipv6Addr::new(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]) + } + + /// Return the eight 16-bit segments that make up this address + pub const fn segments(&self) -> [u16; 8] { + to_u16_array!(self, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) + } + + pub const fn to_std(&self) -> net::Ipv6Addr { + let s = self.segments(); + net::Ipv6Addr::new(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]) + } +} + +#[allow(deprecated)] +impl fmt::Display for Ipv6Addr { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + self.to_std().fmt(fmt) + } +} +} + +/// A wrapper around `sockaddr_un`. +#[derive(Clone, Copy, Debug)] +#[repr(C)] +pub struct UnixAddr { + // INVARIANT: sun & sun_len are valid as defined by docs for from_raw_parts + sun: libc::sockaddr_un, + /// The length of the valid part of `sun`, including the sun_family field + /// but excluding any trailing nul. + // On the BSDs, this field is built into sun + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux" + ))] + sun_len: u8 +} + +// linux man page unix(7) says there are 3 kinds of unix socket: +// pathname: addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1 +// unnamed: addrlen = sizeof(sa_family_t) +// abstract: addren > sizeof(sa_family_t), name = sun_path[..(addrlen - sizeof(sa_family_t))] +// +// what we call path_len = addrlen - offsetof(struct sockaddr_un, sun_path) +#[derive(PartialEq, Eq, Hash)] +enum UnixAddrKind<'a> { + Pathname(&'a Path), + Unnamed, + #[cfg(any(target_os = "android", target_os = "linux"))] + Abstract(&'a [u8]), +} +impl<'a> UnixAddrKind<'a> { + /// Safety: sun & sun_len must be valid + unsafe fn get(sun: &'a libc::sockaddr_un, sun_len: u8) -> Self { + assert!(sun_len as usize >= offset_of!(libc::sockaddr_un, sun_path)); + let path_len = sun_len as usize - offset_of!(libc::sockaddr_un, sun_path); + if path_len == 0 { + return Self::Unnamed; + } + #[cfg(any(target_os = "android", target_os = "linux"))] + if sun.sun_path[0] == 0 { + let name = + slice::from_raw_parts(sun.sun_path.as_ptr().add(1) as *const u8, path_len - 1); + return Self::Abstract(name); + } + let pathname = slice::from_raw_parts(sun.sun_path.as_ptr() as *const u8, path_len); + if pathname.last() == Some(&0) { + // A trailing NUL is not considered part of the path, and it does + // not need to be included in the addrlen passed to functions like + // bind(). However, Linux adds a trailing NUL, even if one was not + // originally present, when returning addrs from functions like + // getsockname() (the BSDs do not do that). So we need to filter + // out any trailing NUL here, so sockaddrs can round-trip through + // the kernel and still compare equal. + Self::Pathname(Path::new(OsStr::from_bytes(&pathname[0..pathname.len() - 1]))) + } else { + Self::Pathname(Path::new(OsStr::from_bytes(pathname))) + } + } +} + +impl UnixAddr { + /// Create a new sockaddr_un representing a filesystem path. + pub fn new(path: &P) -> Result { + path.with_nix_path(|cstr| { + unsafe { + let mut ret = libc::sockaddr_un { + sun_family: AddressFamily::Unix as sa_family_t, + .. mem::zeroed() + }; + + let bytes = cstr.to_bytes(); + + if bytes.len() >= ret.sun_path.len() { + return Err(Errno::ENAMETOOLONG); + } + + let sun_len = (bytes.len() + + offset_of!(libc::sockaddr_un, sun_path)).try_into() + .unwrap(); + + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + { + ret.sun_len = sun_len; + } + ptr::copy_nonoverlapping(bytes.as_ptr(), + ret.sun_path.as_mut_ptr() as *mut u8, + bytes.len()); + + Ok(UnixAddr::from_raw_parts(ret, sun_len)) + } + })? + } + + /// Create a new `sockaddr_un` representing an address in the "abstract namespace". + /// + /// The leading nul byte for the abstract namespace is automatically added; + /// thus the input `path` is expected to be the bare name, not NUL-prefixed. + /// This is a Linux-specific extension, primarily used to allow chrooted + /// processes to communicate with processes having a different filesystem view. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn new_abstract(path: &[u8]) -> Result { + unsafe { + let mut ret = libc::sockaddr_un { + sun_family: AddressFamily::Unix as sa_family_t, + .. mem::zeroed() + }; + + if path.len() >= ret.sun_path.len() { + return Err(Errno::ENAMETOOLONG); + } + let sun_len = (path.len() + + 1 + + offset_of!(libc::sockaddr_un, sun_path)).try_into() + .unwrap(); + + // Abstract addresses are represented by sun_path[0] == + // b'\0', so copy starting one byte in. + ptr::copy_nonoverlapping(path.as_ptr(), + ret.sun_path.as_mut_ptr().offset(1) as *mut u8, + path.len()); + + Ok(UnixAddr::from_raw_parts(ret, sun_len)) + } + } + + /// Create a UnixAddr from a raw `sockaddr_un` struct and a size. `sun_len` + /// is the size of the valid portion of the struct, excluding any trailing + /// NUL. + /// + /// # Safety + /// This pair of sockaddr_un & sun_len must be a valid unix addr, which + /// means: + /// - sun_len >= offset_of(sockaddr_un, sun_path) + /// - sun_len <= sockaddr_un.sun_path.len() - offset_of(sockaddr_un, sun_path) + /// - if this is a unix addr with a pathname, sun.sun_path is a + /// fs path, not necessarily nul-terminated. + pub(crate) unsafe fn from_raw_parts(sun: libc::sockaddr_un, sun_len: u8) -> UnixAddr { + cfg_if!{ + if #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux" + ))] + { + UnixAddr { sun, sun_len } + } else { + assert_eq!(sun_len, sun.sun_len); + UnixAddr {sun} + } + } + } + + fn kind(&self) -> UnixAddrKind<'_> { + // SAFETY: our sockaddr is always valid because of the invariant on the struct + unsafe { UnixAddrKind::get(&self.sun, self.sun_len()) } + } + + /// If this address represents a filesystem path, return that path. + pub fn path(&self) -> Option<&Path> { + match self.kind() { + UnixAddrKind::Pathname(path) => Some(path), + _ => None, + } + } + + /// If this address represents an abstract socket, return its name. + /// + /// For abstract sockets only the bare name is returned, without the + /// leading NUL byte. `None` is returned for unnamed or path-backed sockets. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn as_abstract(&self) -> Option<&[u8]> { + match self.kind() { + UnixAddrKind::Abstract(name) => Some(name), + _ => None, + } + } + + /// Returns the addrlen of this socket - `offsetof(struct sockaddr_un, sun_path)` + #[inline] + pub fn path_len(&self) -> usize { + self.sun_len() as usize - offset_of!(libc::sockaddr_un, sun_path) + } + /// Returns a pointer to the raw `sockaddr_un` struct + #[inline] + pub fn as_ptr(&self) -> *const libc::sockaddr_un { + &self.sun + } + /// Returns a mutable pointer to the raw `sockaddr_un` struct + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut libc::sockaddr_un { + &mut self.sun + } + + fn sun_len(&self)-> u8 { + cfg_if!{ + if #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux" + ))] + { + self.sun_len + } else { + self.sun.sun_len + } + } + } +} + +impl private::SockaddrLikePriv for UnixAddr {} +impl SockaddrLike for UnixAddr { + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux" + ))] + fn len(&self) -> libc::socklen_t { + self.sun_len.into() + } + + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if (l as usize) < offset_of!(libc::sockaddr_un, sun_path) || + l > u8::MAX as libc::socklen_t + { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_UNIX as i32 { + return None; + } + let mut su: libc::sockaddr_un = mem::zeroed(); + let sup = &mut su as *mut libc::sockaddr_un as *mut u8; + cfg_if!{ + if #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux" + ))] { + let su_len = len.unwrap_or( + mem::size_of::() as libc::socklen_t + ); + } else { + let su_len = len.unwrap_or((*addr).sa_len as libc::socklen_t); + } + }; + ptr::copy(addr as *const u8, sup, su_len as usize); + Some(Self::from_raw_parts(su, su_len as u8)) + } + + fn size() -> libc::socklen_t where Self: Sized { + mem::size_of::() as libc::socklen_t + } +} + +impl AsRef for UnixAddr { + fn as_ref(&self) -> &libc::sockaddr_un { + &self.sun + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn fmt_abstract(abs: &[u8], f: &mut fmt::Formatter) -> fmt::Result { + use fmt::Write; + f.write_str("@\"")?; + for &b in abs { + use fmt::Display; + char::from(b).escape_default().fmt(f)?; + } + f.write_char('"')?; + Ok(()) +} + +impl fmt::Display for UnixAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self.kind() { + UnixAddrKind::Pathname(path) => path.display().fmt(f), + UnixAddrKind::Unnamed => f.pad(""), + #[cfg(any(target_os = "android", target_os = "linux"))] + UnixAddrKind::Abstract(name) => fmt_abstract(name, f), + } + } +} + +impl PartialEq for UnixAddr { + fn eq(&self, other: &UnixAddr) -> bool { + self.kind() == other.kind() + } +} + +impl Eq for UnixAddr {} + +impl Hash for UnixAddr { + fn hash(&self, s: &mut H) { + self.kind().hash(s) + } +} + +/// Anything that, in C, can be cast back and forth to `sockaddr`. +/// +/// Most implementors also implement `AsRef` to access their +/// inner type read-only. +#[allow(clippy::len_without_is_empty)] +pub trait SockaddrLike: private::SockaddrLikePriv { + /// Returns a raw pointer to the inner structure. Useful for FFI. + fn as_ptr(&self) -> *const libc::sockaddr { + self as *const Self as *const libc::sockaddr + } + + /// Unsafe constructor from a variable length source + /// + /// Some C APIs from provide `len`, and others do not. If it's provided it + /// will be validated. If not, it will be guessed based on the family. + /// + /// # Arguments + /// + /// - `addr`: raw pointer to something that can be cast to a + /// `libc::sockaddr`. For example, `libc::sockaddr_in`, + /// `libc::sockaddr_in6`, etc. + /// - `len`: For fixed-width types like `sockaddr_in`, it will be + /// validated if present and ignored if not. For variable-width + /// types it is required and must be the total length of valid + /// data. For example, if `addr` points to a + /// named `sockaddr_un`, then `len` must be the length of the + /// structure up to but not including the trailing NUL. + /// + /// # Safety + /// + /// `addr` must be valid for the specific type of sockaddr. `len`, if + /// present, must not exceed the length of valid data in `addr`. + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized; + + /// Return the address family of this socket + /// + /// # Examples + /// One common use is to match on the family of a union type, like this: + /// ``` + /// # use nix::sys::socket::*; + /// let fd = socket(AddressFamily::Inet, SockType::Stream, + /// SockFlag::empty(), None).unwrap(); + /// let ss: SockaddrStorage = getsockname(fd).unwrap(); + /// match ss.family().unwrap() { + /// AddressFamily::Inet => println!("{}", ss.as_sockaddr_in().unwrap()), + /// AddressFamily::Inet6 => println!("{}", ss.as_sockaddr_in6().unwrap()), + /// _ => println!("Unexpected address family") + /// } + /// ``` + fn family(&self) -> Option { + // Safe since all implementors have a sa_family field at the same + // address, and they're all repr(C) + AddressFamily::from_i32( + unsafe { + (*(self as *const Self as *const libc::sockaddr)).sa_family as i32 + } + ) + } + + cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] { + /// Return the length of valid data in the sockaddr structure. + /// + /// For fixed-size sockaddrs, this should be the size of the + /// structure. But for variable-sized types like [`UnixAddr`] it + /// may be less. + fn len(&self) -> libc::socklen_t { + // Safe since all implementors have a sa_len field at the same + // address, and they're all repr(transparent). + // Robust for all implementors. + unsafe { + (*(self as *const Self as *const libc::sockaddr)).sa_len + }.into() + } + } else { + /// Return the length of valid data in the sockaddr structure. + /// + /// For fixed-size sockaddrs, this should be the size of the + /// structure. But for variable-sized types like [`UnixAddr`] it + /// may be less. + fn len(&self) -> libc::socklen_t { + // No robust default implementation is possible without an + // sa_len field. Implementors with a variable size must + // override this method. + mem::size_of_val(self) as libc::socklen_t + } + } + } + + /// Return the available space in the structure + fn size() -> libc::socklen_t where Self: Sized { + mem::size_of::() as libc::socklen_t + } +} + +impl private::SockaddrLikePriv for () { + fn as_mut_ptr(&mut self) -> *mut libc::sockaddr { + ptr::null_mut() + } +} + +/// `()` can be used in place of a real Sockaddr when no address is expected, +/// for example for a field of `Option where S: SockaddrLike`. +// If this RFC ever stabilizes, then ! will be a better choice. +// https://github.com/rust-lang/rust/issues/35121 +impl SockaddrLike for () { + fn as_ptr(&self) -> *const libc::sockaddr { + ptr::null() + } + + unsafe fn from_raw(_: *const libc::sockaddr, _: Option) + -> Option where Self: Sized + { + None + } + + fn family(&self) -> Option { + None + } + + fn len(&self) -> libc::socklen_t { + 0 + } +} + +/// An IPv4 socket address +// This is identical to net::SocketAddrV4. But the standard library +// doesn't allow direct access to the libc fields, which we need. So we +// reimplement it here. +#[cfg(feature = "net")] +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct SockaddrIn(libc::sockaddr_in); + +#[cfg(feature = "net")] +impl SockaddrIn { + /// Returns the IP address associated with this socket address, in native + /// endian. + pub const fn ip(&self) -> libc::in_addr_t { + u32::from_be(self.0.sin_addr.s_addr) + } + + /// Creates a new socket address from IPv4 octets and a port number. + pub fn new(a: u8, b: u8, c: u8, d: u8, port: u16) -> Self { + Self(libc::sockaddr_in { + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + sin_len: Self::size() as u8, + sin_family: AddressFamily::Inet as sa_family_t, + sin_port: u16::to_be(port), + sin_addr: libc::in_addr { + s_addr: u32::from_ne_bytes([a, b, c, d]) + }, + sin_zero: unsafe{mem::zeroed()} + }) + } + + /// Returns the port number associated with this socket address, in native + /// endian. + pub const fn port(&self) -> u16 { + u16::from_be(self.0.sin_port) + } +} + +#[cfg(feature = "net")] +impl private::SockaddrLikePriv for SockaddrIn {} +#[cfg(feature = "net")] +impl SockaddrLike for SockaddrIn { + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_INET as i32 { + return None; + } + Some(SockaddrIn(*(addr as *const libc::sockaddr_in))) + } +} + +#[cfg(feature = "net")] +impl AsRef for SockaddrIn { + fn as_ref(&self) -> &libc::sockaddr_in { + &self.0 + } +} + +#[cfg(feature = "net")] +impl fmt::Display for SockaddrIn { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let ne = u32::from_be(self.0.sin_addr.s_addr); + let port = u16::from_be(self.0.sin_port); + write!(f, "{}.{}.{}.{}:{}", + ne >> 24, + (ne >> 16) & 0xFF, + (ne >> 8) & 0xFF, + ne & 0xFF, + port) + } +} + +#[cfg(feature = "net")] +impl From for SockaddrIn { + fn from(addr: net::SocketAddrV4) -> Self { + Self(libc::sockaddr_in{ + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "hermit", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + sin_len: mem::size_of::() as u8, + sin_family: AddressFamily::Inet as sa_family_t, + sin_port: addr.port().to_be(), // network byte order + sin_addr: ipv4addr_to_libc(*addr.ip()), + .. unsafe { mem::zeroed() } + }) + } +} + +#[cfg(feature = "net")] +impl std::str::FromStr for SockaddrIn { + type Err = net::AddrParseError; + + fn from_str(s: &str) -> std::result::Result { + net::SocketAddrV4::from_str(s).map(SockaddrIn::from) + } +} + +/// An IPv6 socket address +#[cfg(feature = "net")] +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct SockaddrIn6(libc::sockaddr_in6); + +#[cfg(feature = "net")] +impl SockaddrIn6 { + /// Returns the flow information associated with this address. + pub const fn flowinfo(&self) -> u32 { + self.0.sin6_flowinfo + } + + /// Returns the IP address associated with this socket address. + pub fn ip(&self) -> net::Ipv6Addr { + net::Ipv6Addr::from(self.0.sin6_addr.s6_addr) + } + + /// Returns the port number associated with this socket address, in native + /// endian. + pub const fn port(&self) -> u16 { + u16::from_be(self.0.sin6_port) + } + + /// Returns the scope ID associated with this address. + pub const fn scope_id(&self) -> u32 { + self.0.sin6_scope_id + } +} + +#[cfg(feature = "net")] +impl private::SockaddrLikePriv for SockaddrIn6 {} +#[cfg(feature = "net")] +impl SockaddrLike for SockaddrIn6 { + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_INET6 as i32 { + return None; + } + Some(SockaddrIn6(*(addr as *const libc::sockaddr_in6))) + } +} + +#[cfg(feature = "net")] +impl AsRef for SockaddrIn6 { + fn as_ref(&self) -> &libc::sockaddr_in6 { + &self.0 + } +} + +#[cfg(feature = "net")] +impl fmt::Display for SockaddrIn6 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + // These things are really hard to display properly. Easier to let std + // do it. + let std = net::SocketAddrV6::new(self.ip(), self.port(), + self.flowinfo(), self.scope_id()); + std.fmt(f) + } +} + +#[cfg(feature = "net")] +impl From for SockaddrIn6 { + fn from(addr: net::SocketAddrV6) -> Self { + #[allow(clippy::needless_update)] // It isn't needless on Illumos + Self(libc::sockaddr_in6{ + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "hermit", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + sin6_len: mem::size_of::() as u8, + sin6_family: AddressFamily::Inet6 as sa_family_t, + sin6_port: addr.port().to_be(), // network byte order + sin6_addr: ipv6addr_to_libc(addr.ip()), + sin6_flowinfo: addr.flowinfo(), // host byte order + sin6_scope_id: addr.scope_id(), // host byte order + .. unsafe { mem::zeroed() } + }) + } +} + +#[cfg(feature = "net")] +impl std::str::FromStr for SockaddrIn6 { + type Err = net::AddrParseError; + + fn from_str(s: &str) -> std::result::Result { + net::SocketAddrV6::from_str(s).map(SockaddrIn6::from) + } +} + + +/// A container for any sockaddr type +/// +/// Just like C's `sockaddr_storage`, this type is large enough to hold any type +/// of sockaddr. It can be used as an argument with functions like +/// [`bind`](super::bind) and [`getsockname`](super::getsockname). Though it is +/// a union, it can be safely accessed through the `as_*` methods. +/// +/// # Example +/// ``` +/// # use nix::sys::socket::*; +/// # use std::str::FromStr; +/// let localhost = SockaddrIn::from_str("127.0.0.1:8081").unwrap(); +/// let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), +/// None).unwrap(); +/// bind(fd, &localhost).expect("bind"); +/// let ss: SockaddrStorage = getsockname(fd).expect("getsockname"); +/// assert_eq!(&localhost, ss.as_sockaddr_in().unwrap()); +/// ``` +#[derive(Clone, Copy, Eq)] +#[repr(C)] +pub union SockaddrStorage { + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + alg: AlgAddr, + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + dl: LinkAddr, + #[cfg(any(target_os = "android", target_os = "linux"))] + nl: NetlinkAddr, + #[cfg(all(feature = "ioctl", any(target_os = "ios", target_os = "macos")))] + #[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] + sctl: SysControlAddr, + #[cfg(feature = "net")] + sin: SockaddrIn, + #[cfg(feature = "net")] + sin6: SockaddrIn6, + ss: libc::sockaddr_storage, + su: UnixAddr, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + vsock: VsockAddr +} +impl private::SockaddrLikePriv for SockaddrStorage {} +impl SockaddrLike for SockaddrStorage { + unsafe fn from_raw(addr: *const libc::sockaddr, l: Option) + -> Option where Self: Sized + { + if addr.is_null() { + return None; + } + if let Some(len) = l { + let ulen = len as usize; + if ulen < offset_of!(libc::sockaddr, sa_data) || + ulen > mem::size_of::() { + None + } else{ + let mut ss: libc::sockaddr_storage = mem::zeroed(); + let ssp = &mut ss as *mut libc::sockaddr_storage as *mut u8; + ptr::copy(addr as *const u8, ssp, len as usize); + Some(Self{ss}) + } + } else { + // If length is not available and addr is of a fixed-length type, + // copy it. If addr is of a variable length type and len is not + // available, then there's nothing we can do. + match (*addr).sa_family as i32 { + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_ALG => AlgAddr::from_raw(addr, l) + .map(|alg| Self { alg}), + #[cfg(feature = "net")] + libc::AF_INET => SockaddrIn::from_raw(addr, l) + .map(|sin| Self{ sin}), + #[cfg(feature = "net")] + libc::AF_INET6 => SockaddrIn6::from_raw(addr, l) + .map(|sin6| Self{ sin6}), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + libc::AF_LINK => LinkAddr::from_raw(addr, l) + .map(|dl| Self{ dl}), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => NetlinkAddr::from_raw(addr, l) + .map(|nl| Self{ nl }), + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg(feature = "net")] + libc::AF_PACKET => LinkAddr::from_raw(addr, l) + .map(|dl| Self{ dl}), + #[cfg(all(feature = "ioctl", + any(target_os = "ios", target_os = "macos")))] + libc::AF_SYSTEM => SysControlAddr::from_raw(addr, l) + .map(|sctl| Self {sctl}), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => VsockAddr::from_raw(addr, l) + .map(|vsock| Self{vsock}), + _ => None + } + } + } +} + +macro_rules! accessors { + ( + $fname:ident, + $fname_mut:ident, + $sockty:ty, + $family:expr, + $libc_ty:ty, + $field:ident) => + { + /// Safely and falliably downcast to an immutable reference + pub fn $fname(&self) -> Option<&$sockty> { + if self.family() == Some($family) && + self.len() >= mem::size_of::<$libc_ty>() as libc::socklen_t + { + // Safe because family and len are validated + Some(unsafe{&self.$field}) + } else { + None + } + } + + /// Safely and falliably downcast to a mutable reference + pub fn $fname_mut(&mut self) -> Option<&mut $sockty> { + if self.family() == Some($family) && + self.len() >= mem::size_of::<$libc_ty>() as libc::socklen_t + { + // Safe because family and len are validated + Some(unsafe{&mut self.$field}) + } else { + None + } + } + } +} + +impl SockaddrStorage { + #[cfg(any(target_os = "android", target_os = "linux"))] + accessors!{as_alg_addr, as_alg_addr_mut, AlgAddr, + AddressFamily::Alg, libc::sockaddr_alg, alg} + + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "linux"))] + #[cfg(feature = "net")] + accessors!{ + as_link_addr, as_link_addr_mut, LinkAddr, + AddressFamily::Packet, libc::sockaddr_ll, dl} + + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + accessors!{ + as_link_addr, as_link_addr_mut, LinkAddr, + AddressFamily::Link, libc::sockaddr_dl, dl} + + #[cfg(feature = "net")] + accessors!{ + as_sockaddr_in, as_sockaddr_in_mut, SockaddrIn, + AddressFamily::Inet, libc::sockaddr_in, sin} + + #[cfg(feature = "net")] + accessors!{ + as_sockaddr_in6, as_sockaddr_in6_mut, SockaddrIn6, + AddressFamily::Inet6, libc::sockaddr_in6, sin6} + + #[cfg(any(target_os = "android", target_os = "linux"))] + accessors!{as_netlink_addr, as_netlink_addr_mut, NetlinkAddr, + AddressFamily::Netlink, libc::sockaddr_nl, nl} + + #[cfg(all(feature = "ioctl", any(target_os = "ios", target_os = "macos")))] + #[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] + accessors!{as_sys_control_addr, as_sys_control_addr_mut, SysControlAddr, + AddressFamily::System, libc::sockaddr_ctl, sctl} + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + accessors!{as_vsock_addr, as_vsock_addr_mut, VsockAddr, + AddressFamily::Vsock, libc::sockaddr_vm, vsock} +} + +impl fmt::Debug for SockaddrStorage { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("SockaddrStorage") + // Safe because sockaddr_storage has the least specific + // field types + .field("ss", unsafe{&self.ss}) + .finish() + } +} + +impl fmt::Display for SockaddrStorage { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + unsafe { + match self.ss.ss_family as i32 { + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_ALG => self.alg.fmt(f), + #[cfg(feature = "net")] + libc::AF_INET => self.sin.fmt(f), + #[cfg(feature = "net")] + libc::AF_INET6 => self.sin6.fmt(f), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + libc::AF_LINK => self.dl.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => self.nl.fmt(f), + #[cfg(any(target_os = "android", + target_os = "linux", + target_os = "fuchsia" + ))] + #[cfg(feature = "net")] + libc::AF_PACKET => self.dl.fmt(f), + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg(feature = "ioctl")] + libc::AF_SYSTEM => self.sctl.fmt(f), + libc::AF_UNIX => self.su.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => self.vsock.fmt(f), + _ => "

".fmt(f) + } + } + } +} + +#[cfg(feature = "net")] +impl From for SockaddrStorage { + fn from(s: net::SocketAddrV4) -> Self { + unsafe { + let mut ss: Self = mem::zeroed(); + ss.sin = SockaddrIn::from(s); + ss + } + } +} + +#[cfg(feature = "net")] +impl From for SockaddrStorage { + fn from(s: net::SocketAddrV6) -> Self { + unsafe { + let mut ss: Self = mem::zeroed(); + ss.sin6 = SockaddrIn6::from(s); + ss + } + } +} + +#[cfg(feature = "net")] +impl From for SockaddrStorage { + fn from(s: net::SocketAddr) -> Self { + match s { + net::SocketAddr::V4(sa4) => Self::from(sa4), + net::SocketAddr::V6(sa6) => Self::from(sa6), + } + } +} + +impl Hash for SockaddrStorage { + fn hash(&self, s: &mut H) { + unsafe { + match self.ss.ss_family as i32 { + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_ALG => self.alg.hash(s), + #[cfg(feature = "net")] + libc::AF_INET => self.sin.hash(s), + #[cfg(feature = "net")] + libc::AF_INET6 => self.sin6.hash(s), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + libc::AF_LINK => self.dl.hash(s), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => self.nl.hash(s), + #[cfg(any(target_os = "android", + target_os = "linux", + target_os = "fuchsia" + ))] + #[cfg(feature = "net")] + libc::AF_PACKET => self.dl.hash(s), + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg(feature = "ioctl")] + libc::AF_SYSTEM => self.sctl.hash(s), + libc::AF_UNIX => self.su.hash(s), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => self.vsock.hash(s), + _ => self.ss.hash(s) + } + } + } +} + +impl PartialEq for SockaddrStorage { + fn eq(&self, other: &Self) -> bool { + unsafe { + match (self.ss.ss_family as i32, other.ss.ss_family as i32) { + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::AF_ALG, libc::AF_ALG) => self.alg == other.alg, + #[cfg(feature = "net")] + (libc::AF_INET, libc::AF_INET) => self.sin == other.sin, + #[cfg(feature = "net")] + (libc::AF_INET6, libc::AF_INET6) => self.sin6 == other.sin6, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + (libc::AF_LINK, libc::AF_LINK) => self.dl == other.dl, + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::AF_NETLINK, libc::AF_NETLINK) => self.nl == other.nl, + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg(feature = "net")] + (libc::AF_PACKET, libc::AF_PACKET) => self.dl == other.dl, + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg(feature = "ioctl")] + (libc::AF_SYSTEM, libc::AF_SYSTEM) => self.sctl == other.sctl, + (libc::AF_UNIX, libc::AF_UNIX) => self.su == other.su, + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::AF_VSOCK, libc::AF_VSOCK) => self.vsock == other.vsock, + _ => false, + } + } + } +} + +mod private { + pub trait SockaddrLikePriv { + /// Returns a mutable raw pointer to the inner structure. + /// + /// # Safety + /// + /// This method is technically safe, but modifying the inner structure's + /// `family` or `len` fields may result in violating Nix's invariants. + /// It is best to use this method only with foreign functions that do + /// not change the sockaddr type. + fn as_mut_ptr(&mut self) -> *mut libc::sockaddr { + self as *mut Self as *mut libc::sockaddr + } + } +} + +/// Represents a socket address +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[deprecated( + since = "0.24.0", + note = "use SockaddrLike or SockaddrStorage instead" +)] +#[allow(missing_docs)] // Since they're all deprecated anyway +#[allow(deprecated)] +#[non_exhaustive] +pub enum SockAddr { + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Inet(InetAddr), + Unix(UnixAddr), + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Netlink(NetlinkAddr), + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Alg(AlgAddr), + #[cfg(all(feature = "ioctl", any(target_os = "ios", target_os = "macos")))] + #[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] + SysControl(SysControlAddr), + /// Datalink address (MAC) + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Link(LinkAddr), + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Vsock(VsockAddr), +} + +#[allow(missing_docs)] // Since they're all deprecated anyway +#[allow(deprecated)] +impl SockAddr { + feature! { + #![feature = "net"] + pub fn new_inet(addr: InetAddr) -> SockAddr { + SockAddr::Inet(addr) + } + } + + pub fn new_unix(path: &P) -> Result { + Ok(SockAddr::Unix(UnixAddr::new(path)?)) + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn new_netlink(pid: u32, groups: u32) -> SockAddr { + SockAddr::Netlink(NetlinkAddr::new(pid, groups)) + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn new_alg(alg_type: &str, alg_name: &str) -> SockAddr { + SockAddr::Alg(AlgAddr::new(alg_type, alg_name)) + } + + feature! { + #![feature = "ioctl"] + #[cfg(any(target_os = "ios", target_os = "macos"))] + pub fn new_sys_control(sockfd: RawFd, name: &str, unit: u32) -> Result { + SysControlAddr::from_name(sockfd, name, unit).map(SockAddr::SysControl) + } + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn new_vsock(cid: u32, port: u32) -> SockAddr { + SockAddr::Vsock(VsockAddr::new(cid, port)) + } + + pub fn family(&self) -> AddressFamily { + match *self { + #[cfg(feature = "net")] + SockAddr::Inet(InetAddr::V4(..)) => AddressFamily::Inet, + #[cfg(feature = "net")] + SockAddr::Inet(InetAddr::V6(..)) => AddressFamily::Inet6, + SockAddr::Unix(..) => AddressFamily::Unix, + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Netlink(..) => AddressFamily::Netlink, + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Alg(..) => AddressFamily::Alg, + #[cfg(all(feature = "ioctl", + any(target_os = "ios", target_os = "macos")))] + SockAddr::SysControl(..) => AddressFamily::System, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + SockAddr::Link(..) => AddressFamily::Packet, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + #[cfg(feature = "net")] + SockAddr::Link(..) => AddressFamily::Link, + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Vsock(..) => AddressFamily::Vsock, + } + } + + #[deprecated(since = "0.23.0", note = "use .to_string() instead")] + pub fn to_str(&self) -> String { + format!("{}", self) + } + + /// Creates a `SockAddr` struct from libc's sockaddr. + /// + /// Supports only the following address families: Unix, Inet (v4 & v6), Netlink and System. + /// Returns None for unsupported families. + /// + /// # Safety + /// + /// unsafe because it takes a raw pointer as argument. The caller must + /// ensure that the pointer is valid. + #[cfg(not(target_os = "fuchsia"))] + #[cfg(feature = "net")] + pub(crate) unsafe fn from_libc_sockaddr(addr: *const libc::sockaddr) -> Option { + if addr.is_null() { + None + } else { + match AddressFamily::from_i32(i32::from((*addr).sa_family)) { + Some(AddressFamily::Unix) => None, + #[cfg(feature = "net")] + Some(AddressFamily::Inet) => Some(SockAddr::Inet( + InetAddr::V4(*(addr as *const libc::sockaddr_in)))), + #[cfg(feature = "net")] + Some(AddressFamily::Inet6) => Some(SockAddr::Inet( + InetAddr::V6(*(addr as *const libc::sockaddr_in6)))), + #[cfg(any(target_os = "android", target_os = "linux"))] + Some(AddressFamily::Netlink) => Some(SockAddr::Netlink( + NetlinkAddr(*(addr as *const libc::sockaddr_nl)))), + #[cfg(all(feature = "ioctl", + any(target_os = "ios", target_os = "macos")))] + Some(AddressFamily::System) => Some(SockAddr::SysControl( + SysControlAddr(*(addr as *const libc::sockaddr_ctl)))), + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + Some(AddressFamily::Packet) => Some(SockAddr::Link( + LinkAddr(*(addr as *const libc::sockaddr_ll)))), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + #[cfg(feature = "net")] + Some(AddressFamily::Link) => { + let ether_addr = LinkAddr(*(addr as *const libc::sockaddr_dl)); + if ether_addr.is_empty() { + None + } else { + Some(SockAddr::Link(ether_addr)) + } + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + Some(AddressFamily::Vsock) => Some(SockAddr::Vsock( + VsockAddr(*(addr as *const libc::sockaddr_vm)))), + // Other address families are currently not supported and simply yield a None + // entry instead of a proper conversion to a `SockAddr`. + Some(_) | None => None, + } + } + } + + /// Conversion from nix's SockAddr type to the underlying libc sockaddr type. + /// + /// This is useful for interfacing with other libc functions that don't yet have nix wrappers. + /// Returns a reference to the underlying data type (as a sockaddr reference) along + /// with the size of the actual data type. sockaddr is commonly used as a proxy for + /// a superclass as C doesn't support inheritance, so many functions that take + /// a sockaddr * need to take the size of the underlying type as well and then internally cast it back. + pub fn as_ffi_pair(&self) -> (&libc::sockaddr, libc::socklen_t) { + match *self { + #[cfg(feature = "net")] + SockAddr::Inet(InetAddr::V4(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_in as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + #[cfg(feature = "net")] + SockAddr::Inet(InetAddr::V6(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_in6 as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + SockAddr::Unix(ref unix_addr) => ( + // This cast is always allowed in C + unsafe { + &*(&unix_addr.sun as *const libc::sockaddr_un as *const libc::sockaddr) + }, + unix_addr.sun_len() as libc::socklen_t + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Netlink(NetlinkAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_nl as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Alg(AlgAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_alg as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + ), + #[cfg(all(feature = "ioctl", + any(target_os = "ios", target_os = "macos")))] + SockAddr::SysControl(SysControlAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_ctl as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + SockAddr::Link(LinkAddr(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_ll as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + SockAddr::Link(LinkAddr(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_dl as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Vsock(VsockAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_vm as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + ), + } + } +} + +#[allow(deprecated)] +impl fmt::Display for SockAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + #[cfg(feature = "net")] + SockAddr::Inet(ref inet) => inet.fmt(f), + SockAddr::Unix(ref unix) => unix.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Netlink(ref nl) => nl.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Alg(ref nl) => nl.fmt(f), + #[cfg(all(feature = "ioctl", + any(target_os = "ios", target_os = "macos")))] + SockAddr::SysControl(ref sc) => sc.fmt(f), + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + #[cfg(feature = "net")] + SockAddr::Link(ref ether_addr) => ether_addr.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Vsock(ref svm) => svm.fmt(f), + } + } +} + +#[cfg(not(target_os = "fuchsia"))] +#[cfg(feature = "net")] +#[allow(deprecated)] +impl private::SockaddrLikePriv for SockAddr {} +#[cfg(not(target_os = "fuchsia"))] +#[cfg(feature = "net")] +#[allow(deprecated)] +impl SockaddrLike for SockAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, _len: Option) + -> Option + { + Self::from_libc_sockaddr(addr) + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub mod netlink { + use crate::sys::socket::addr::AddressFamily; + use libc::{sa_family_t, sockaddr_nl}; + use std::{fmt, mem}; + use super::*; + + /// Address for the Linux kernel user interface device. + /// + /// # References + /// + /// [netlink(7)](https://man7.org/linux/man-pages/man7/netlink.7.html) + #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] + #[repr(transparent)] + pub struct NetlinkAddr(pub(in super::super) sockaddr_nl); + + impl NetlinkAddr { + /// Construct a new socket address from its port ID and multicast groups + /// mask. + pub fn new(pid: u32, groups: u32) -> NetlinkAddr { + let mut addr: sockaddr_nl = unsafe { mem::zeroed() }; + addr.nl_family = AddressFamily::Netlink as sa_family_t; + addr.nl_pid = pid; + addr.nl_groups = groups; + + NetlinkAddr(addr) + } + + /// Return the socket's port ID. + pub const fn pid(&self) -> u32 { + self.0.nl_pid + } + + /// Return the socket's multicast groups mask + pub const fn groups(&self) -> u32 { + self.0.nl_groups + } + } + + impl private::SockaddrLikePriv for NetlinkAddr {} + impl SockaddrLike for NetlinkAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_NETLINK as i32 { + return None; + } + Some(NetlinkAddr(*(addr as *const libc::sockaddr_nl))) + } + } + + impl AsRef for NetlinkAddr { + fn as_ref(&self) -> &libc::sockaddr_nl { + &self.0 + } + } + + impl fmt::Display for NetlinkAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "pid: {} groups: {}", self.pid(), self.groups()) + } + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub mod alg { + use libc::{AF_ALG, sockaddr_alg, c_char}; + use std::{fmt, mem, str}; + use std::hash::{Hash, Hasher}; + use std::ffi::CStr; + use super::*; + + /// Socket address for the Linux kernel crypto API + #[derive(Copy, Clone)] + #[repr(transparent)] + pub struct AlgAddr(pub(in super::super) sockaddr_alg); + + impl private::SockaddrLikePriv for AlgAddr {} + impl SockaddrLike for AlgAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, l: Option) + -> Option where Self: Sized + { + if let Some(l) = l { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_ALG as i32 { + return None; + } + Some(AlgAddr(*(addr as *const libc::sockaddr_alg))) + } + } + + impl AsRef for AlgAddr { + fn as_ref(&self) -> &libc::sockaddr_alg { + &self.0 + } + } + + // , PartialEq, Eq, Debug, Hash + impl PartialEq for AlgAddr { + fn eq(&self, other: &Self) -> bool { + let (inner, other) = (self.0, other.0); + (inner.salg_family, &inner.salg_type[..], inner.salg_feat, inner.salg_mask, &inner.salg_name[..]) == + (other.salg_family, &other.salg_type[..], other.salg_feat, other.salg_mask, &other.salg_name[..]) + } + } + + impl Eq for AlgAddr {} + + impl Hash for AlgAddr { + fn hash(&self, s: &mut H) { + let inner = self.0; + (inner.salg_family, &inner.salg_type[..], inner.salg_feat, inner.salg_mask, &inner.salg_name[..]).hash(s); + } + } + + impl AlgAddr { + /// Construct an `AF_ALG` socket from its cipher name and type. + pub fn new(alg_type: &str, alg_name: &str) -> AlgAddr { + let mut addr: sockaddr_alg = unsafe { mem::zeroed() }; + addr.salg_family = AF_ALG as u16; + addr.salg_type[..alg_type.len()].copy_from_slice(alg_type.to_string().as_bytes()); + addr.salg_name[..alg_name.len()].copy_from_slice(alg_name.to_string().as_bytes()); + + AlgAddr(addr) + } + + + /// Return the socket's cipher type, for example `hash` or `aead`. + pub fn alg_type(&self) -> &CStr { + unsafe { CStr::from_ptr(self.0.salg_type.as_ptr() as *const c_char) } + } + + /// Return the socket's cipher name, for example `sha1`. + pub fn alg_name(&self) -> &CStr { + unsafe { CStr::from_ptr(self.0.salg_name.as_ptr() as *const c_char) } + } + } + + impl fmt::Display for AlgAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "type: {} alg: {}", + self.alg_name().to_string_lossy(), + self.alg_type().to_string_lossy()) + } + } + + impl fmt::Debug for AlgAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(self, f) + } + } +} + +feature! { +#![feature = "ioctl"] +#[cfg(any(target_os = "ios", target_os = "macos"))] +pub mod sys_control { + use crate::sys::socket::addr::AddressFamily; + use libc::{self, c_uchar}; + use std::{fmt, mem}; + use std::os::unix::io::RawFd; + use crate::{Errno, Result}; + use super::{private, SockaddrLike}; + + // FIXME: Move type into `libc` + #[repr(C)] + #[derive(Clone, Copy)] + #[allow(missing_debug_implementations)] + pub struct ctl_ioc_info { + pub ctl_id: u32, + pub ctl_name: [c_uchar; MAX_KCTL_NAME], + } + + const CTL_IOC_MAGIC: u8 = b'N'; + const CTL_IOC_INFO: u8 = 3; + const MAX_KCTL_NAME: usize = 96; + + ioctl_readwrite!(ctl_info, CTL_IOC_MAGIC, CTL_IOC_INFO, ctl_ioc_info); + + /// Apple system control socket + /// + /// # References + /// + /// https://developer.apple.com/documentation/kernel/sockaddr_ctl + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + #[repr(transparent)] + pub struct SysControlAddr(pub(in super::super) libc::sockaddr_ctl); + + impl private::SockaddrLikePriv for SysControlAddr {} + impl SockaddrLike for SysControlAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_SYSTEM as i32 { + return None; + } + Some(SysControlAddr(*(addr as *const libc::sockaddr_ctl))) + } + } + + impl AsRef for SysControlAddr { + fn as_ref(&self) -> &libc::sockaddr_ctl { + &self.0 + } + } + + impl SysControlAddr { + /// Construct a new `SysControlAddr` from its kernel unique identifier + /// and unit number. + pub const fn new(id: u32, unit: u32) -> SysControlAddr { + let addr = libc::sockaddr_ctl { + sc_len: mem::size_of::() as c_uchar, + sc_family: AddressFamily::System as c_uchar, + ss_sysaddr: libc::AF_SYS_CONTROL as u16, + sc_id: id, + sc_unit: unit, + sc_reserved: [0; 5] + }; + + SysControlAddr(addr) + } + + /// Construct a new `SysControlAddr` from its human readable name and + /// unit number. + pub fn from_name(sockfd: RawFd, name: &str, unit: u32) -> Result { + if name.len() > MAX_KCTL_NAME { + return Err(Errno::ENAMETOOLONG); + } + + let mut ctl_name = [0; MAX_KCTL_NAME]; + ctl_name[..name.len()].clone_from_slice(name.as_bytes()); + let mut info = ctl_ioc_info { ctl_id: 0, ctl_name }; + + unsafe { ctl_info(sockfd, &mut info)?; } + + Ok(SysControlAddr::new(info.ctl_id, unit)) + } + + /// Return the kernel unique identifier + pub const fn id(&self) -> u32 { + self.0.sc_id + } + + /// Return the kernel controller private unit number. + pub const fn unit(&self) -> u32 { + self.0.sc_unit + } + } + + impl fmt::Display for SysControlAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Debug::fmt(self, f) + } + } +} +} + + +#[cfg(any(target_os = "android", target_os = "linux", target_os = "fuchsia"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod datalink { + feature! { + #![feature = "net"] + use super::{fmt, mem, private, SockaddrLike}; + + /// Hardware Address + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + #[repr(transparent)] + pub struct LinkAddr(pub(in super::super) libc::sockaddr_ll); + + impl LinkAddr { + /// Physical-layer protocol + pub fn protocol(&self) -> u16 { + self.0.sll_protocol + } + + /// Interface number + pub fn ifindex(&self) -> usize { + self.0.sll_ifindex as usize + } + + /// ARP hardware type + pub fn hatype(&self) -> u16 { + self.0.sll_hatype + } + + /// Packet type + pub fn pkttype(&self) -> u8 { + self.0.sll_pkttype + } + + /// Length of MAC address + pub fn halen(&self) -> usize { + self.0.sll_halen as usize + } + + /// Physical-layer address (MAC) + // Returns an Option just for cross-platform compatibility + pub fn addr(&self) -> Option<[u8; 6]> { + Some([ + self.0.sll_addr[0] as u8, + self.0.sll_addr[1] as u8, + self.0.sll_addr[2] as u8, + self.0.sll_addr[3] as u8, + self.0.sll_addr[4] as u8, + self.0.sll_addr[5] as u8, + ]) + } + } + + impl fmt::Display for LinkAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if let Some(addr) = self.addr() { + write!(f, "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}", + addr[0], + addr[1], + addr[2], + addr[3], + addr[4], + addr[5]) + } else { + Ok(()) + } + } + } + impl private::SockaddrLikePriv for LinkAddr {} + impl SockaddrLike for LinkAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, + len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_PACKET as i32 { + return None; + } + Some(LinkAddr(*(addr as *const libc::sockaddr_ll))) + } + } + + impl AsRef for LinkAddr { + fn as_ref(&self) -> &libc::sockaddr_ll { + &self.0 + } + } + + } +} + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod datalink { + feature! { + #![feature = "net"] + use super::{fmt, mem, private, SockaddrLike}; + + /// Hardware Address + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + #[repr(transparent)] + pub struct LinkAddr(pub(in super::super) libc::sockaddr_dl); + + impl LinkAddr { + /// interface index, if != 0, system given index for interface + pub fn ifindex(&self) -> usize { + self.0.sdl_index as usize + } + + /// Datalink type + pub fn datalink_type(&self) -> u8 { + self.0.sdl_type + } + + /// MAC address start position + pub fn nlen(&self) -> usize { + self.0.sdl_nlen as usize + } + + /// link level address length + pub fn alen(&self) -> usize { + self.0.sdl_alen as usize + } + + /// link layer selector length + pub fn slen(&self) -> usize { + self.0.sdl_slen as usize + } + + /// if link level address length == 0, + /// or `sdl_data` not be larger. + pub fn is_empty(&self) -> bool { + let nlen = self.nlen(); + let alen = self.alen(); + let data_len = self.0.sdl_data.len(); + + alen == 0 || nlen + alen >= data_len + } + + /// Physical-layer address (MAC) + pub fn addr(&self) -> Option<[u8; 6]> { + let nlen = self.nlen(); + let data = self.0.sdl_data; + + if self.is_empty() { + None + } else { + Some([ + data[nlen] as u8, + data[nlen + 1] as u8, + data[nlen + 2] as u8, + data[nlen + 3] as u8, + data[nlen + 4] as u8, + data[nlen + 5] as u8, + ]) + } + } + } + + impl fmt::Display for LinkAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if let Some(addr) = self.addr() { + write!(f, "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}", + addr[0], + addr[1], + addr[2], + addr[3], + addr[4], + addr[5]) + } else { + Ok(()) + } + } + } + impl private::SockaddrLikePriv for LinkAddr {} + impl SockaddrLike for LinkAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, + len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_LINK as i32 { + return None; + } + Some(LinkAddr(*(addr as *const libc::sockaddr_dl))) + } + } + + impl AsRef for LinkAddr { + fn as_ref(&self) -> &libc::sockaddr_dl { + &self.0 + } + } + + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub mod vsock { + use crate::sys::socket::addr::AddressFamily; + use libc::{sa_family_t, sockaddr_vm}; + use std::{fmt, mem}; + use std::hash::{Hash, Hasher}; + use super::*; + + /// Socket address for VMWare VSockets protocol + /// + /// # References + /// + /// [vsock(7)](https://man7.org/linux/man-pages/man7/vsock.7.html) + #[derive(Copy, Clone)] + #[repr(transparent)] + pub struct VsockAddr(pub(in super::super) sockaddr_vm); + + impl private::SockaddrLikePriv for VsockAddr {} + impl SockaddrLike for VsockAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_VSOCK as i32 { + return None; + } + Some(VsockAddr(*(addr as *const libc::sockaddr_vm))) + } + } + + impl AsRef for VsockAddr { + fn as_ref(&self) -> &libc::sockaddr_vm { + &self.0 + } + } + + impl PartialEq for VsockAddr { + fn eq(&self, other: &Self) -> bool { + let (inner, other) = (self.0, other.0); + (inner.svm_family, inner.svm_cid, inner.svm_port) == + (other.svm_family, other.svm_cid, other.svm_port) + } + } + + impl Eq for VsockAddr {} + + impl Hash for VsockAddr { + fn hash(&self, s: &mut H) { + let inner = self.0; + (inner.svm_family, inner.svm_cid, inner.svm_port).hash(s); + } + } + + /// VSOCK Address + /// + /// The address for AF_VSOCK socket is defined as a combination of a + /// 32-bit Context Identifier (CID) and a 32-bit port number. + impl VsockAddr { + /// Construct a `VsockAddr` from its raw fields. + pub fn new(cid: u32, port: u32) -> VsockAddr { + let mut addr: sockaddr_vm = unsafe { mem::zeroed() }; + addr.svm_family = AddressFamily::Vsock as sa_family_t; + addr.svm_cid = cid; + addr.svm_port = port; + + VsockAddr(addr) + } + + /// Context Identifier (CID) + pub fn cid(&self) -> u32 { + self.0.svm_cid + } + + /// Port number + pub fn port(&self) -> u32 { + self.0.svm_port + } + } + + impl fmt::Display for VsockAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "cid: {} port: {}", self.cid(), self.port()) + } + } + + impl fmt::Debug for VsockAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(self, f) + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + mod types { + use super::*; + + #[test] + fn test_ipv4addr_to_libc() { + let s = std::net::Ipv4Addr::new(1, 2, 3, 4); + let l = ipv4addr_to_libc(s); + assert_eq!(l.s_addr, u32::to_be(0x01020304)); + } + + #[test] + fn test_ipv6addr_to_libc() { + let s = std::net::Ipv6Addr::new(1, 2, 3, 4, 5, 6, 7, 8); + let l = ipv6addr_to_libc(&s); + assert_eq!(l.s6_addr, [0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8]); + } + } + + mod link { + use super::*; + #[cfg(any(target_os = "ios", + target_os = "macos", + target_os = "illumos" + ))] + use super::super::super::socklen_t; + + /// Don't panic when trying to display an empty datalink address + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[test] + fn test_datalink_display() { + use super::super::LinkAddr; + use std::mem; + + let la = LinkAddr(libc::sockaddr_dl{ + sdl_len: 56, + sdl_family: 18, + sdl_index: 5, + sdl_type: 24, + sdl_nlen: 3, + sdl_alen: 0, + sdl_slen: 0, + .. unsafe{mem::zeroed()} + }); + format!("{}", la); + } + + #[cfg(all( + any(target_os = "android", + target_os = "fuchsia", + target_os = "linux"), + target_endian = "little" + ))] + #[test] + fn linux_loopback() { + let bytes = [17u8, 0, 0, 0, 1, 0, 0, 0, 4, 3, 0, 6, 1, 2, 3, 4, 5, 6, 0, 0]; + let sa = bytes.as_ptr() as *const libc::sockaddr; + let len = None; + let sock_addr = unsafe { SockaddrStorage::from_raw(sa, len) }.unwrap(); + assert_eq!(sock_addr.family(), Some(AddressFamily::Packet)); + match sock_addr.as_link_addr() { + Some(dl) => assert_eq!(dl.addr(), Some([1, 2, 3, 4, 5, 6])), + None => panic!("Can't unwrap sockaddr storage") + } + } + + #[cfg(any(target_os = "ios", + target_os = "macos" + ))] + #[test] + fn macos_loopback() { + let bytes = [20i8, 18, 1, 0, 24, 3, 0, 0, 108, 111, 48, 0, 0, 0, 0, 0]; + let sa = bytes.as_ptr() as *const libc::sockaddr; + let len = Some(bytes.len() as socklen_t); + let sock_addr = unsafe { SockaddrStorage::from_raw(sa, len) }.unwrap(); + assert_eq!(sock_addr.family(), Some(AddressFamily::Link)); + match sock_addr.as_link_addr() { + Some(dl) => { + assert!(dl.addr().is_none()); + }, + None => panic!("Can't unwrap sockaddr storage") + } + } + + #[cfg(any(target_os = "ios", + target_os = "macos" + ))] + #[test] + fn macos_tap() { + let bytes = [20i8, 18, 7, 0, 6, 3, 6, 0, 101, 110, 48, 24, 101, -112, -35, 76, -80]; + let ptr = bytes.as_ptr(); + let sa = ptr as *const libc::sockaddr; + let len = Some(bytes.len() as socklen_t); + + let sock_addr = unsafe { SockaddrStorage::from_raw(sa, len).unwrap() }; + assert_eq!(sock_addr.family(), Some(AddressFamily::Link)); + match sock_addr.as_link_addr() { + Some(dl) => assert_eq!(dl.addr(), + Some([24u8, 101, 144, 221, 76, 176])), + None => panic!("Can't unwrap sockaddr storage") + } + } + + #[cfg(target_os = "illumos")] + #[test] + fn illumos_tap() { + let bytes = [25u8, 0, 0, 0, 6, 0, 6, 0, 24, 101, 144, 221, 76, 176]; + let ptr = bytes.as_ptr(); + let sa = ptr as *const libc::sockaddr; + let len = Some(bytes.len() as socklen_t); + let _sock_addr = unsafe { SockaddrStorage::from_raw(sa, len) }; + + assert!(_sock_addr.is_some()); + + let sock_addr = _sock_addr.unwrap(); + + assert_eq!(sock_addr.family().unwrap(), AddressFamily::Link); + + assert_eq!(sock_addr.as_link_addr().unwrap().addr(), + Some([24u8, 101, 144, 221, 76, 176])); + } + + #[test] + fn size() { + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + let l = mem::size_of::(); + #[cfg(any( + target_os = "android", + target_os = "fuchsia", + target_os = "linux"))] + let l = mem::size_of::(); + assert_eq!( LinkAddr::size() as usize, l); + } + } + + mod sockaddr_in { + use super::*; + use std::str::FromStr; + + #[test] + fn display() { + let s = "127.0.0.1:8080"; + let addr = SockaddrIn::from_str(s).unwrap(); + assert_eq!(s, format!("{}", addr)); + } + + #[test] + fn size() { + assert_eq!(mem::size_of::(), + SockaddrIn::size() as usize); + } + } + + mod sockaddr_in6 { + use super::*; + use std::str::FromStr; + + #[test] + fn display() { + let s = "[1234:5678:90ab:cdef::1111:2222]:8080"; + let addr = SockaddrIn6::from_str(s).unwrap(); + assert_eq!(s, format!("{}", addr)); + } + + #[test] + fn size() { + assert_eq!(mem::size_of::(), + SockaddrIn6::size() as usize); + } + } + + mod unixaddr { + use super::*; + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[test] + fn abstract_sun_path() { + let name = String::from("nix\0abstract\0test"); + let addr = UnixAddr::new_abstract(name.as_bytes()).unwrap(); + + let sun_path1 = unsafe { &(*addr.as_ptr()).sun_path[..addr.path_len()] }; + let sun_path2 = [0, 110, 105, 120, 0, 97, 98, 115, 116, 114, 97, 99, 116, 0, 116, 101, 115, 116]; + assert_eq!(sun_path1, sun_path2); + } + + #[test] + fn size() { + assert_eq!(mem::size_of::(), + UnixAddr::size() as usize); + } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/socket/mod.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/socket/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..c96481a45006db836e4cfa4591420682a93c9d69 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/socket/mod.rs @@ -0,0 +1,2173 @@ +//! Socket interface functions +//! +//! [Further reading](https://man7.org/linux/man-pages/man7/socket.7.html) +use cfg_if::cfg_if; +use crate::{Result, errno::Errno}; +use libc::{self, c_void, c_int, iovec, socklen_t, size_t, + CMSG_FIRSTHDR, CMSG_NXTHDR, CMSG_DATA, CMSG_LEN}; +use std::convert::TryInto; +use std::{mem, ptr, slice}; +use std::os::unix::io::RawFd; +#[cfg(feature = "net")] +use std::net; +#[cfg(target_os = "linux")] +#[cfg(feature = "uio")] +use crate::sys::time::TimeSpec; +#[cfg(feature = "uio")] +use crate::sys::time::TimeVal; +use std::io::{IoSlice, IoSliceMut}; + +#[deny(missing_docs)] +mod addr; +#[deny(missing_docs)] +pub mod sockopt; + +/* + * + * ===== Re-exports ===== + * + */ + +pub use self::addr::{SockaddrLike, SockaddrStorage}; + +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] +#[allow(deprecated)] +pub use self::addr::{ + AddressFamily, + SockAddr, + UnixAddr, +}; +#[allow(deprecated)] +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] +#[cfg(feature = "net")] +pub use self::addr::{ + InetAddr, + IpAddr, + Ipv4Addr, + Ipv6Addr, + LinkAddr, + SockaddrIn, + SockaddrIn6 +}; +#[cfg(any(target_os = "illumos", target_os = "solaris"))] +#[allow(deprecated)] +pub use self::addr::{ + AddressFamily, + SockAddr, + UnixAddr, +}; +#[allow(deprecated)] +#[cfg(any(target_os = "illumos", target_os = "solaris"))] +#[cfg(feature = "net")] +pub use self::addr::{ + InetAddr, + IpAddr, + Ipv4Addr, + Ipv6Addr, + SockaddrIn, + SockaddrIn6 +}; + +#[cfg(any(target_os = "ios", target_os = "macos"))] +#[cfg(feature = "ioctl")] +pub use crate::sys::socket::addr::sys_control::SysControlAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use crate::sys::socket::addr::netlink::NetlinkAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use crate::sys::socket::addr::alg::AlgAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use crate::sys::socket::addr::vsock::VsockAddr; + +#[cfg(feature = "uio")] +pub use libc::{cmsghdr, msghdr}; +pub use libc::{ + sa_family_t, + sockaddr, + sockaddr_storage, + sockaddr_un, +}; +#[cfg(feature = "net")] +pub use libc::{sockaddr_in, sockaddr_in6}; + +// Needed by the cmsg_space macro +#[doc(hidden)] +pub use libc::{c_uint, CMSG_SPACE}; + +#[cfg(feature = "net")] +use crate::sys::socket::addr::{ipv4addr_to_libc, ipv6addr_to_libc}; + +/// These constants are used to specify the communication semantics +/// when creating a socket with [`socket()`](fn.socket.html) +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +#[repr(i32)] +#[non_exhaustive] +pub enum SockType { + /// Provides sequenced, reliable, two-way, connection- + /// based byte streams. An out-of-band data transmission + /// mechanism may be supported. + Stream = libc::SOCK_STREAM, + /// Supports datagrams (connectionless, unreliable + /// messages of a fixed maximum length). + Datagram = libc::SOCK_DGRAM, + /// Provides a sequenced, reliable, two-way connection- + /// based data transmission path for datagrams of fixed + /// maximum length; a consumer is required to read an + /// entire packet with each input system call. + SeqPacket = libc::SOCK_SEQPACKET, + /// Provides raw network protocol access. + Raw = libc::SOCK_RAW, + /// Provides a reliable datagram layer that does not + /// guarantee ordering. + Rdm = libc::SOCK_RDM, +} + +/// Constants used in [`socket`](fn.socket.html) and [`socketpair`](fn.socketpair.html) +/// to specify the protocol to use. +#[repr(i32)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum SockProtocol { + /// TCP protocol ([ip(7)](https://man7.org/linux/man-pages/man7/ip.7.html)) + Tcp = libc::IPPROTO_TCP, + /// UDP protocol ([ip(7)](https://man7.org/linux/man-pages/man7/ip.7.html)) + Udp = libc::IPPROTO_UDP, + /// Allows applications and other KEXTs to be notified when certain kernel events occur + /// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html)) + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + KextEvent = libc::SYSPROTO_EVENT, + /// Allows applications to configure and control a KEXT + /// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html)) + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + KextControl = libc::SYSPROTO_CONTROL, + /// Receives routing and link updates and may be used to modify the routing tables (both IPv4 and IPv6), IP addresses, link + // parameters, neighbor setups, queueing disciplines, traffic classes and packet classifiers + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkRoute = libc::NETLINK_ROUTE, + /// Reserved for user-mode socket protocols + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkUserSock = libc::NETLINK_USERSOCK, + /// Query information about sockets of various protocol families from the kernel + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkSockDiag = libc::NETLINK_SOCK_DIAG, + /// SELinux event notifications. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkSELinux = libc::NETLINK_SELINUX, + /// Open-iSCSI + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkISCSI = libc::NETLINK_ISCSI, + /// Auditing + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkAudit = libc::NETLINK_AUDIT, + /// Access to FIB lookup from user space + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkFIBLookup = libc::NETLINK_FIB_LOOKUP, + /// Netfilter subsystem + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkNetFilter = libc::NETLINK_NETFILTER, + /// SCSI Transports + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkSCSITransport = libc::NETLINK_SCSITRANSPORT, + /// Infiniband RDMA + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkRDMA = libc::NETLINK_RDMA, + /// Transport IPv6 packets from netfilter to user space. Used by ip6_queue kernel module. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkIPv6Firewall = libc::NETLINK_IP6_FW, + /// DECnet routing messages + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkDECNetRoutingMessage = libc::NETLINK_DNRTMSG, + /// Kernel messages to user space + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkKObjectUEvent = libc::NETLINK_KOBJECT_UEVENT, + /// Netlink interface to request information about ciphers registered with the kernel crypto API as well as allow + /// configuration of the kernel crypto API. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkCrypto = libc::NETLINK_CRYPTO, +} + +#[cfg(any(target_os = "linux"))] +libc_bitflags! { + /// Configuration flags for `SO_TIMESTAMPING` interface + /// + /// For use with [`Timestamping`][sockopt::Timestamping]. + /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) + pub struct TimestampingFlag: c_uint { + /// Report any software timestamps when available. + SOF_TIMESTAMPING_SOFTWARE; + /// Report hardware timestamps as generated by SOF_TIMESTAMPING_TX_HARDWARE when available. + SOF_TIMESTAMPING_RAW_HARDWARE; + /// Collect transmiting timestamps as reported by hardware + SOF_TIMESTAMPING_TX_HARDWARE; + /// Collect transmiting timestamps as reported by software + SOF_TIMESTAMPING_TX_SOFTWARE; + /// Collect receiving timestamps as reported by hardware + SOF_TIMESTAMPING_RX_HARDWARE; + /// Collect receiving timestamps as reported by software + SOF_TIMESTAMPING_RX_SOFTWARE; + } +} + +libc_bitflags!{ + /// Additional socket options + pub struct SockFlag: c_int { + /// Set non-blocking mode on the new socket + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SOCK_NONBLOCK; + /// Set close-on-exec on the new descriptor + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SOCK_CLOEXEC; + /// Return `EPIPE` instead of raising `SIGPIPE` + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + SOCK_NOSIGPIPE; + /// For domains `AF_INET(6)`, only allow `connect(2)`, `sendto(2)`, or `sendmsg(2)` + /// to the DNS port (typically 53) + #[cfg(target_os = "openbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + SOCK_DNS; + } +} + +libc_bitflags!{ + /// Flags for send/recv and their relatives + pub struct MsgFlags: c_int { + /// Sends or requests out-of-band data on sockets that support this notion + /// (e.g., of type [`Stream`](enum.SockType.html)); the underlying protocol must also + /// support out-of-band data. + MSG_OOB; + /// Peeks at an incoming message. The data is treated as unread and the next + /// [`recv()`](fn.recv.html) + /// or similar function shall still return this data. + MSG_PEEK; + /// Receive operation blocks until the full amount of data can be + /// returned. The function may return smaller amount of data if a signal + /// is caught, an error or disconnect occurs. + MSG_WAITALL; + /// Enables nonblocking operation; if the operation would block, + /// `EAGAIN` or `EWOULDBLOCK` is returned. This provides similar + /// behavior to setting the `O_NONBLOCK` flag + /// (via the [`fcntl`](../../fcntl/fn.fcntl.html) + /// `F_SETFL` operation), but differs in that `MSG_DONTWAIT` is a per- + /// call option, whereas `O_NONBLOCK` is a setting on the open file + /// description (see [open(2)](https://man7.org/linux/man-pages/man2/open.2.html)), + /// which will affect all threads in + /// the calling process and as well as other processes that hold + /// file descriptors referring to the same open file description. + MSG_DONTWAIT; + /// Receive flags: Control Data was discarded (buffer too small) + MSG_CTRUNC; + /// For raw ([`Packet`](addr/enum.AddressFamily.html)), Internet datagram + /// (since Linux 2.4.27/2.6.8), + /// netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4) + /// sockets: return the real length of the packet or datagram, even + /// when it was longer than the passed buffer. Not implemented for UNIX + /// domain ([unix(7)](https://linux.die.net/man/7/unix)) sockets. + /// + /// For use with Internet stream sockets, see [tcp(7)](https://linux.die.net/man/7/tcp). + MSG_TRUNC; + /// Terminates a record (when this notion is supported, as for + /// sockets of type [`SeqPacket`](enum.SockType.html)). + MSG_EOR; + /// This flag specifies that queued errors should be received from + /// the socket error queue. (For more details, see + /// [recvfrom(2)](https://linux.die.net/man/2/recvfrom)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MSG_ERRQUEUE; + /// Set the `close-on-exec` flag for the file descriptor received via a UNIX domain + /// file descriptor using the `SCM_RIGHTS` operation (described in + /// [unix(7)](https://linux.die.net/man/7/unix)). + /// This flag is useful for the same reasons as the `O_CLOEXEC` flag of + /// [open(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html). + /// + /// Only used in [`recvmsg`](fn.recvmsg.html) function. + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MSG_CMSG_CLOEXEC; + /// Requests not to send `SIGPIPE` errors when the other end breaks the connection. + /// (For more details, see [send(2)](https://linux.die.net/man/2/send)). + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MSG_NOSIGNAL; + } +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + /// Unix credentials of the sending process. + /// + /// This struct is used with the `SO_PEERCRED` ancillary message + /// and the `SCM_CREDENTIALS` control message for UNIX sockets. + #[repr(transparent)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + pub struct UnixCredentials(libc::ucred); + + impl UnixCredentials { + /// Creates a new instance with the credentials of the current process + pub fn new() -> Self { + // Safe because these FFI functions are inherently safe + unsafe { + UnixCredentials(libc::ucred { + pid: libc::getpid(), + uid: libc::getuid(), + gid: libc::getgid() + }) + } + } + + /// Returns the process identifier + pub fn pid(&self) -> libc::pid_t { + self.0.pid + } + + /// Returns the user identifier + pub fn uid(&self) -> libc::uid_t { + self.0.uid + } + + /// Returns the group identifier + pub fn gid(&self) -> libc::gid_t { + self.0.gid + } + } + + impl Default for UnixCredentials { + fn default() -> Self { + Self::new() + } + } + + impl From for UnixCredentials { + fn from(cred: libc::ucred) -> Self { + UnixCredentials(cred) + } + } + + impl From for libc::ucred { + fn from(uc: UnixCredentials) -> Self { + uc.0 + } + } + } else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] { + /// Unix credentials of the sending process. + /// + /// This struct is used with the `SCM_CREDS` ancillary message for UNIX sockets. + #[repr(transparent)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + pub struct UnixCredentials(libc::cmsgcred); + + impl UnixCredentials { + /// Returns the process identifier + pub fn pid(&self) -> libc::pid_t { + self.0.cmcred_pid + } + + /// Returns the real user identifier + pub fn uid(&self) -> libc::uid_t { + self.0.cmcred_uid + } + + /// Returns the effective user identifier + pub fn euid(&self) -> libc::uid_t { + self.0.cmcred_euid + } + + /// Returns the real group identifier + pub fn gid(&self) -> libc::gid_t { + self.0.cmcred_gid + } + + /// Returns a list group identifiers (the first one being the effective GID) + pub fn groups(&self) -> &[libc::gid_t] { + unsafe { + slice::from_raw_parts( + self.0.cmcred_groups.as_ptr() as *const libc::gid_t, + self.0.cmcred_ngroups as _ + ) + } + } + } + + impl From for UnixCredentials { + fn from(cred: libc::cmsgcred) -> Self { + UnixCredentials(cred) + } + } + } +} + +cfg_if!{ + if #[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios" + ))] { + /// Return type of [`LocalPeerCred`](crate::sys::socket::sockopt::LocalPeerCred) + #[repr(transparent)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + pub struct XuCred(libc::xucred); + + impl XuCred { + /// Structure layout version + pub fn version(&self) -> u32 { + self.0.cr_version + } + + /// Effective user ID + pub fn uid(&self) -> libc::uid_t { + self.0.cr_uid + } + + /// Returns a list of group identifiers (the first one being the + /// effective GID) + pub fn groups(&self) -> &[libc::gid_t] { + &self.0.cr_groups + } + } + } +} + +feature! { +#![feature = "net"] +/// Request for multicast socket operations +/// +/// This is a wrapper type around `ip_mreq`. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct IpMembershipRequest(libc::ip_mreq); + +impl IpMembershipRequest { + /// Instantiate a new `IpMembershipRequest` + /// + /// If `interface` is `None`, then `Ipv4Addr::any()` will be used for the interface. + pub fn new(group: net::Ipv4Addr, interface: Option) + -> Self + { + let imr_addr = match interface { + None => net::Ipv4Addr::UNSPECIFIED, + Some(addr) => addr + }; + IpMembershipRequest(libc::ip_mreq { + imr_multiaddr: ipv4addr_to_libc(group), + imr_interface: ipv4addr_to_libc(imr_addr) + }) + } +} + +/// Request for ipv6 multicast socket operations +/// +/// This is a wrapper type around `ipv6_mreq`. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct Ipv6MembershipRequest(libc::ipv6_mreq); + +impl Ipv6MembershipRequest { + /// Instantiate a new `Ipv6MembershipRequest` + pub const fn new(group: net::Ipv6Addr) -> Self { + Ipv6MembershipRequest(libc::ipv6_mreq { + ipv6mr_multiaddr: ipv6addr_to_libc(&group), + ipv6mr_interface: 0, + }) + } +} +} + +feature! { +#![feature = "uio"] + +/// Create a buffer large enough for storing some control messages as returned +/// by [`recvmsg`](fn.recvmsg.html). +/// +/// # Examples +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # use nix::sys::time::TimeVal; +/// # use std::os::unix::io::RawFd; +/// # fn main() { +/// // Create a buffer for a `ControlMessageOwned::ScmTimestamp` message +/// let _ = cmsg_space!(TimeVal); +/// // Create a buffer big enough for a `ControlMessageOwned::ScmRights` message +/// // with two file descriptors +/// let _ = cmsg_space!([RawFd; 2]); +/// // Create a buffer big enough for a `ControlMessageOwned::ScmRights` message +/// // and a `ControlMessageOwned::ScmTimestamp` message +/// let _ = cmsg_space!(RawFd, TimeVal); +/// # } +/// ``` +// Unfortunately, CMSG_SPACE isn't a const_fn, or else we could return a +// stack-allocated array. +#[macro_export] +macro_rules! cmsg_space { + ( $( $x:ty ),* ) => { + { + let mut space = 0; + $( + // CMSG_SPACE is always safe + space += unsafe { + $crate::sys::socket::CMSG_SPACE(::std::mem::size_of::<$x>() as $crate::sys::socket::c_uint) + } as usize; + )* + Vec::::with_capacity(space) + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct RecvMsg<'a, S> { + pub bytes: usize, + cmsghdr: Option<&'a cmsghdr>, + pub address: Option, + pub flags: MsgFlags, + mhdr: msghdr, +} + +impl<'a, S> RecvMsg<'a, S> { + /// Iterate over the valid control messages pointed to by this + /// msghdr. + pub fn cmsgs(&self) -> CmsgIterator { + CmsgIterator { + cmsghdr: self.cmsghdr, + mhdr: &self.mhdr + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct CmsgIterator<'a> { + /// Control message buffer to decode from. Must adhere to cmsg alignment. + cmsghdr: Option<&'a cmsghdr>, + mhdr: &'a msghdr +} + +impl<'a> Iterator for CmsgIterator<'a> { + type Item = ControlMessageOwned; + + fn next(&mut self) -> Option { + match self.cmsghdr { + None => None, // No more messages + Some(hdr) => { + // Get the data. + // Safe if cmsghdr points to valid data returned by recvmsg(2) + let cm = unsafe { Some(ControlMessageOwned::decode_from(hdr))}; + // Advance the internal pointer. Safe if mhdr and cmsghdr point + // to valid data returned by recvmsg(2) + self.cmsghdr = unsafe { + let p = CMSG_NXTHDR(self.mhdr as *const _, hdr as *const _); + p.as_ref() + }; + cm + } + } + } +} + +/// A type-safe wrapper around a single control message, as used with +/// [`recvmsg`](#fn.recvmsg). +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/cmsg.3.html) +// Nix version 0.13.0 and earlier used ControlMessage for both recvmsg and +// sendmsg. However, on some platforms the messages returned by recvmsg may be +// unaligned. ControlMessageOwned takes those messages by copy, obviating any +// alignment issues. +// +// See https://github.com/nix-rust/nix/issues/999 +#[derive(Clone, Debug, Eq, PartialEq)] +#[non_exhaustive] +pub enum ControlMessageOwned { + /// Received version of [`ControlMessage::ScmRights`] + ScmRights(Vec), + /// Received version of [`ControlMessage::ScmCredentials`] + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ScmCredentials(UnixCredentials), + /// Received version of [`ControlMessage::ScmCreds`] + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ScmCreds(UnixCredentials), + /// A message of type `SCM_TIMESTAMP`, containing the time the + /// packet was received by the kernel. + /// + /// See the kernel's explanation in "SO_TIMESTAMP" of + /// [networking/timestamping](https://www.kernel.org/doc/Documentation/networking/timestamping.txt). + /// + /// # Examples + /// + /// ``` + /// # #[macro_use] extern crate nix; + /// # use nix::sys::socket::*; + /// # use nix::sys::time::*; + /// # use std::io::{IoSlice, IoSliceMut}; + /// # use std::time::*; + /// # use std::str::FromStr; + /// # fn main() { + /// // Set up + /// let message = "Ohayō!".as_bytes(); + /// let in_socket = socket( + /// AddressFamily::Inet, + /// SockType::Datagram, + /// SockFlag::empty(), + /// None).unwrap(); + /// setsockopt(in_socket, sockopt::ReceiveTimestamp, &true).unwrap(); + /// let localhost = SockaddrIn::from_str("127.0.0.1:0").unwrap(); + /// bind(in_socket, &localhost); + /// let address: SockaddrIn = getsockname(in_socket).unwrap(); + /// // Get initial time + /// let time0 = SystemTime::now(); + /// // Send the message + /// let iov = [IoSlice::new(message)]; + /// let flags = MsgFlags::empty(); + /// let l = sendmsg(in_socket, &iov, &[], flags, Some(&address)).unwrap(); + /// assert_eq!(message.len(), l); + /// // Receive the message + /// let mut buffer = vec![0u8; message.len()]; + /// let mut cmsgspace = cmsg_space!(TimeVal); + /// let mut iov = [IoSliceMut::new(&mut buffer)]; + /// let r = recvmsg::(in_socket, &mut iov, Some(&mut cmsgspace), flags) + /// .unwrap(); + /// let rtime = match r.cmsgs().next() { + /// Some(ControlMessageOwned::ScmTimestamp(rtime)) => rtime, + /// Some(_) => panic!("Unexpected control message"), + /// None => panic!("No control message") + /// }; + /// // Check the final time + /// let time1 = SystemTime::now(); + /// // the packet's received timestamp should lie in-between the two system + /// // times, unless the system clock was adjusted in the meantime. + /// let rduration = Duration::new(rtime.tv_sec() as u64, + /// rtime.tv_usec() as u32 * 1000); + /// assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); + /// assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); + /// // Close socket + /// nix::unistd::close(in_socket).unwrap(); + /// # } + /// ``` + ScmTimestamp(TimeVal), + /// A set of nanosecond resolution timestamps + /// + /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) + #[cfg(all(target_os = "linux"))] + ScmTimestampsns(Timestamps), + /// Nanoseconds resolution timestamp + /// + /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) + #[cfg(all(target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ScmTimestampns(TimeSpec), + #[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + ))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4PacketInfo(libc::in_pktinfo), + #[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "openbsd", + target_os = "netbsd", + ))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv6PacketInfo(libc::in6_pktinfo), + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4RecvIf(libc::sockaddr_dl), + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4RecvDstAddr(libc::in_addr), + + /// UDP Generic Receive Offload (GRO) allows receiving multiple UDP + /// packets from a single sender. + /// Fixed-size payloads are following one by one in a receive buffer. + /// This Control Message indicates the size of all smaller packets, + /// except, maybe, the last one. + /// + /// `UdpGroSegment` socket option should be enabled on a socket + /// to allow receiving GRO packets. + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + UdpGroSegments(u16), + + /// SO_RXQ_OVFL indicates that an unsigned 32 bit value + /// ancilliary msg (cmsg) should be attached to recieved + /// skbs indicating the number of packets dropped by the + /// socket between the last recieved packet and this + /// received packet. + /// + /// `RxqOvfl` socket option should be enabled on a socket + /// to allow receiving the drop counter. + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + RxqOvfl(u32), + + /// Socket error queue control messages read with the `MSG_ERRQUEUE` flag. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4RecvErr(libc::sock_extended_err, Option), + /// Socket error queue control messages read with the `MSG_ERRQUEUE` flag. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv6RecvErr(libc::sock_extended_err, Option), + + /// Catch-all variant for unimplemented cmsg types. + #[doc(hidden)] + Unknown(UnknownCmsg), +} + +/// For representing packet timestamps via `SO_TIMESTAMPING` interface +#[cfg(all(target_os = "linux"))] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub struct Timestamps { + /// software based timestamp, usually one containing data + pub system: TimeSpec, + /// legacy timestamp, usually empty + pub hw_trans: TimeSpec, + /// hardware based timestamp + pub hw_raw: TimeSpec, +} + +impl ControlMessageOwned { + /// Decodes a `ControlMessageOwned` from raw bytes. + /// + /// This is only safe to call if the data is correct for the message type + /// specified in the header. Normally, the kernel ensures that this is the + /// case. "Correct" in this case includes correct length, alignment and + /// actual content. + // Clippy complains about the pointer alignment of `p`, not understanding + // that it's being fed to a function that can handle that. + #[allow(clippy::cast_ptr_alignment)] + unsafe fn decode_from(header: &cmsghdr) -> ControlMessageOwned + { + let p = CMSG_DATA(header); + let len = header as *const _ as usize + header.cmsg_len as usize + - p as usize; + match (header.cmsg_level, header.cmsg_type) { + (libc::SOL_SOCKET, libc::SCM_RIGHTS) => { + let n = len / mem::size_of::(); + let mut fds = Vec::with_capacity(n); + for i in 0..n { + let fdp = (p as *const RawFd).add(i); + fds.push(ptr::read_unaligned(fdp)); + } + ControlMessageOwned::ScmRights(fds) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::SOL_SOCKET, libc::SCM_CREDENTIALS) => { + let cred: libc::ucred = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmCredentials(cred.into()) + } + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + (libc::SOL_SOCKET, libc::SCM_CREDS) => { + let cred: libc::cmsgcred = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmCreds(cred.into()) + } + (libc::SOL_SOCKET, libc::SCM_TIMESTAMP) => { + let tv: libc::timeval = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmTimestamp(TimeVal::from(tv)) + }, + #[cfg(all(target_os = "linux"))] + (libc::SOL_SOCKET, libc::SCM_TIMESTAMPNS) => { + let ts: libc::timespec = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmTimestampns(TimeSpec::from(ts)) + } + #[cfg(all(target_os = "linux"))] + (libc::SOL_SOCKET, libc::SCM_TIMESTAMPING) => { + let tp = p as *const libc::timespec; + let ts: libc::timespec = ptr::read_unaligned(tp); + let system = TimeSpec::from(ts); + let ts: libc::timespec = ptr::read_unaligned(tp.add(1)); + let hw_trans = TimeSpec::from(ts); + let ts: libc::timespec = ptr::read_unaligned(tp.add(2)); + let hw_raw = TimeSpec::from(ts); + let timestamping = Timestamps { system, hw_trans, hw_raw }; + ControlMessageOwned::ScmTimestampsns(timestamping) + } + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] + #[cfg(feature = "net")] + (libc::IPPROTO_IPV6, libc::IPV6_PKTINFO) => { + let info = ptr::read_unaligned(p as *const libc::in6_pktinfo); + ControlMessageOwned::Ipv6PacketInfo(info) + } + #[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + ))] + #[cfg(feature = "net")] + (libc::IPPROTO_IP, libc::IP_PKTINFO) => { + let info = ptr::read_unaligned(p as *const libc::in_pktinfo); + ControlMessageOwned::Ipv4PacketInfo(info) + } + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + #[cfg(feature = "net")] + (libc::IPPROTO_IP, libc::IP_RECVIF) => { + let dl = ptr::read_unaligned(p as *const libc::sockaddr_dl); + ControlMessageOwned::Ipv4RecvIf(dl) + }, + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + #[cfg(feature = "net")] + (libc::IPPROTO_IP, libc::IP_RECVDSTADDR) => { + let dl = ptr::read_unaligned(p as *const libc::in_addr); + ControlMessageOwned::Ipv4RecvDstAddr(dl) + }, + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + (libc::SOL_UDP, libc::UDP_GRO) => { + let gso_size: u16 = ptr::read_unaligned(p as *const _); + ControlMessageOwned::UdpGroSegments(gso_size) + }, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + (libc::SOL_SOCKET, libc::SO_RXQ_OVFL) => { + let drop_counter = ptr::read_unaligned(p as *const u32); + ControlMessageOwned::RxqOvfl(drop_counter) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + (libc::IPPROTO_IP, libc::IP_RECVERR) => { + let (err, addr) = Self::recv_err_helper::(p, len); + ControlMessageOwned::Ipv4RecvErr(err, addr) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + (libc::IPPROTO_IPV6, libc::IPV6_RECVERR) => { + let (err, addr) = Self::recv_err_helper::(p, len); + ControlMessageOwned::Ipv6RecvErr(err, addr) + }, + (_, _) => { + let sl = slice::from_raw_parts(p, len); + let ucmsg = UnknownCmsg(*header, Vec::::from(sl)); + ControlMessageOwned::Unknown(ucmsg) + } + } + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + unsafe fn recv_err_helper(p: *mut libc::c_uchar, len: usize) -> (libc::sock_extended_err, Option) { + let ee = p as *const libc::sock_extended_err; + let err = ptr::read_unaligned(ee); + + // For errors originating on the network, SO_EE_OFFENDER(ee) points inside the p[..len] + // CMSG_DATA buffer. For local errors, there is no address included in the control + // message, and SO_EE_OFFENDER(ee) points beyond the end of the buffer. So, we need to + // validate that the address object is in-bounds before we attempt to copy it. + let addrp = libc::SO_EE_OFFENDER(ee) as *const T; + + if addrp.offset(1) as usize - (p as usize) > len { + (err, None) + } else { + (err, Some(ptr::read_unaligned(addrp))) + } + } +} + +/// A type-safe zero-copy wrapper around a single control message, as used wih +/// [`sendmsg`](#fn.sendmsg). More types may be added to this enum; do not +/// exhaustively pattern-match it. +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/cmsg.3.html) +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[non_exhaustive] +pub enum ControlMessage<'a> { + /// A message of type `SCM_RIGHTS`, containing an array of file + /// descriptors passed between processes. + /// + /// See the description in the "Ancillary messages" section of the + /// [unix(7) man page](https://man7.org/linux/man-pages/man7/unix.7.html). + /// + /// Using multiple `ScmRights` messages for a single `sendmsg` call isn't + /// recommended since it causes platform-dependent behaviour: It might + /// swallow all but the first `ScmRights` message or fail with `EINVAL`. + /// Instead, you can put all fds to be passed into a single `ScmRights` + /// message. + ScmRights(&'a [RawFd]), + /// A message of type `SCM_CREDENTIALS`, containing the pid, uid and gid of + /// a process connected to the socket. + /// + /// This is similar to the socket option `SO_PEERCRED`, but requires a + /// process to explicitly send its credentials. A process running as root is + /// allowed to specify any credentials, while credentials sent by other + /// processes are verified by the kernel. + /// + /// For further information, please refer to the + /// [`unix(7)`](https://man7.org/linux/man-pages/man7/unix.7.html) man page. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ScmCredentials(&'a UnixCredentials), + /// A message of type `SCM_CREDS`, containing the pid, uid, euid, gid and groups of + /// a process connected to the socket. + /// + /// This is similar to the socket options `LOCAL_CREDS` and `LOCAL_PEERCRED`, but + /// requires a process to explicitly send its credentials. + /// + /// Credentials are always overwritten by the kernel, so this variant does have + /// any data, unlike the receive-side + /// [`ControlMessageOwned::ScmCreds`]. + /// + /// For further information, please refer to the + /// [`unix(4)`](https://www.freebsd.org/cgi/man.cgi?query=unix) man page. + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ScmCreds, + + /// Set IV for `AF_ALG` crypto API. + /// + /// For further information, please refer to the + /// [`documentation`](https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html) + #[cfg(any( + target_os = "android", + target_os = "linux", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AlgSetIv(&'a [u8]), + /// Set crypto operation for `AF_ALG` crypto API. It may be one of + /// `ALG_OP_ENCRYPT` or `ALG_OP_DECRYPT` + /// + /// For further information, please refer to the + /// [`documentation`](https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html) + #[cfg(any( + target_os = "android", + target_os = "linux", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AlgSetOp(&'a libc::c_int), + /// Set the length of associated authentication data (AAD) (applicable only to AEAD algorithms) + /// for `AF_ALG` crypto API. + /// + /// For further information, please refer to the + /// [`documentation`](https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html) + #[cfg(any( + target_os = "android", + target_os = "linux", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AlgSetAeadAssoclen(&'a u32), + + /// UDP GSO makes it possible for applications to generate network packets + /// for a virtual MTU much greater than the real one. + /// The length of the send data no longer matches the expected length on + /// the wire. + /// The size of the datagram payload as it should appear on the wire may be + /// passed through this control message. + /// Send buffer should consist of multiple fixed-size wire payloads + /// following one by one, and the last, possibly smaller one. + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + UdpGsoSegments(&'a u16), + + /// Configure the sending addressing and interface for v4 + /// + /// For further information, please refer to the + /// [`ip(7)`](https://man7.org/linux/man-pages/man7/ip.7.html) man page. + #[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4PacketInfo(&'a libc::in_pktinfo), + + /// Configure the sending addressing and interface for v6 + /// + /// For further information, please refer to the + /// [`ipv6(7)`](https://man7.org/linux/man-pages/man7/ipv6.7.html) man page. + #[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "freebsd", + target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv6PacketInfo(&'a libc::in6_pktinfo), + + /// SO_RXQ_OVFL indicates that an unsigned 32 bit value + /// ancilliary msg (cmsg) should be attached to recieved + /// skbs indicating the number of packets dropped by the + /// socket between the last recieved packet and this + /// received packet. + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + RxqOvfl(&'a u32), + + /// Configure the transmission time of packets. + /// + /// For further information, please refer to the + /// [`tc-etf(8)`](https://man7.org/linux/man-pages/man8/tc-etf.8.html) man + /// page. + #[cfg(target_os = "linux")] + TxTime(&'a u64), +} + +// An opaque structure used to prevent cmsghdr from being a public type +#[doc(hidden)] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UnknownCmsg(cmsghdr, Vec); + +impl<'a> ControlMessage<'a> { + /// The value of CMSG_SPACE on this message. + /// Safe because CMSG_SPACE is always safe + fn space(&self) -> usize { + unsafe{CMSG_SPACE(self.len() as libc::c_uint) as usize} + } + + /// The value of CMSG_LEN on this message. + /// Safe because CMSG_LEN is always safe + #[cfg(any(target_os = "android", + all(target_os = "linux", not(target_env = "musl"))))] + fn cmsg_len(&self) -> usize { + unsafe{CMSG_LEN(self.len() as libc::c_uint) as usize} + } + + #[cfg(not(any(target_os = "android", + all(target_os = "linux", not(target_env = "musl")))))] + fn cmsg_len(&self) -> libc::c_uint { + unsafe{CMSG_LEN(self.len() as libc::c_uint)} + } + + /// Return a reference to the payload data as a byte pointer + fn copy_to_cmsg_data(&self, cmsg_data: *mut u8) { + let data_ptr = match *self { + ControlMessage::ScmRights(fds) => { + fds as *const _ as *const u8 + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(creds) => { + &creds.0 as *const libc::ucred as *const u8 + } + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => { + // The kernel overwrites the data, we just zero it + // to make sure it's not uninitialized memory + unsafe { ptr::write_bytes(cmsg_data, 0, self.len()) }; + return + } + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(iv) => { + #[allow(deprecated)] // https://github.com/rust-lang/libc/issues/1501 + let af_alg_iv = libc::af_alg_iv { + ivlen: iv.len() as u32, + iv: [0u8; 0], + }; + + let size = mem::size_of_val(&af_alg_iv); + + unsafe { + ptr::copy_nonoverlapping( + &af_alg_iv as *const _ as *const u8, + cmsg_data, + size, + ); + ptr::copy_nonoverlapping( + iv.as_ptr(), + cmsg_data.add(size), + iv.len() + ); + }; + + return + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetOp(op) => { + op as *const _ as *const u8 + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetAeadAssoclen(len) => { + len as *const _ as *const u8 + }, + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + ControlMessage::UdpGsoSegments(gso_size) => { + gso_size as *const _ as *const u8 + }, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv4PacketInfo(info) => info as *const _ as *const u8, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv6PacketInfo(info) => info as *const _ as *const u8, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(drop_count) => { + drop_count as *const _ as *const u8 + }, + #[cfg(target_os = "linux")] + ControlMessage::TxTime(tx_time) => { + tx_time as *const _ as *const u8 + }, + }; + unsafe { + ptr::copy_nonoverlapping( + data_ptr, + cmsg_data, + self.len() + ) + }; + } + + /// The size of the payload, excluding its cmsghdr + fn len(&self) -> usize { + match *self { + ControlMessage::ScmRights(fds) => { + mem::size_of_val(fds) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(creds) => { + mem::size_of_val(creds) + } + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => { + mem::size_of::() + } + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(iv) => { + mem::size_of_val(&iv) + iv.len() + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetOp(op) => { + mem::size_of_val(op) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetAeadAssoclen(len) => { + mem::size_of_val(len) + }, + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + ControlMessage::UdpGsoSegments(gso_size) => { + mem::size_of_val(gso_size) + }, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv4PacketInfo(info) => mem::size_of_val(info), + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv6PacketInfo(info) => mem::size_of_val(info), + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(drop_count) => { + mem::size_of_val(drop_count) + }, + #[cfg(target_os = "linux")] + ControlMessage::TxTime(tx_time) => { + mem::size_of_val(tx_time) + }, + } + } + + /// Returns the value to put into the `cmsg_level` field of the header. + fn cmsg_level(&self) -> libc::c_int { + match *self { + ControlMessage::ScmRights(_) => libc::SOL_SOCKET, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(_) => libc::SOL_SOCKET, + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => libc::SOL_SOCKET, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(_) | ControlMessage::AlgSetOp(_) | + ControlMessage::AlgSetAeadAssoclen(_) => libc::SOL_ALG, + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + ControlMessage::UdpGsoSegments(_) => libc::SOL_UDP, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv4PacketInfo(_) => libc::IPPROTO_IP, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv6PacketInfo(_) => libc::IPPROTO_IPV6, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(_) => libc::SOL_SOCKET, + #[cfg(target_os = "linux")] + ControlMessage::TxTime(_) => libc::SOL_SOCKET, + } + } + + /// Returns the value to put into the `cmsg_type` field of the header. + fn cmsg_type(&self) -> libc::c_int { + match *self { + ControlMessage::ScmRights(_) => libc::SCM_RIGHTS, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(_) => libc::SCM_CREDENTIALS, + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => libc::SCM_CREDS, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(_) => { + libc::ALG_SET_IV + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetOp(_) => { + libc::ALG_SET_OP + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetAeadAssoclen(_) => { + libc::ALG_SET_AEAD_ASSOCLEN + }, + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + ControlMessage::UdpGsoSegments(_) => { + libc::UDP_SEGMENT + }, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv4PacketInfo(_) => libc::IP_PKTINFO, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv6PacketInfo(_) => libc::IPV6_PKTINFO, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(_) => { + libc::SO_RXQ_OVFL + }, + #[cfg(target_os = "linux")] + ControlMessage::TxTime(_) => { + libc::SCM_TXTIME + }, + } + } + + // Unsafe: cmsg must point to a valid cmsghdr with enough space to + // encode self. + unsafe fn encode_into(&self, cmsg: *mut cmsghdr) { + (*cmsg).cmsg_level = self.cmsg_level(); + (*cmsg).cmsg_type = self.cmsg_type(); + (*cmsg).cmsg_len = self.cmsg_len(); + self.copy_to_cmsg_data(CMSG_DATA(cmsg)); + } +} + + +/// Send data in scatter-gather vectors to a socket, possibly accompanied +/// by ancillary data. Optionally direct the message at the given address, +/// as with sendto. +/// +/// Allocates if cmsgs is nonempty. +/// +/// # Examples +/// When not directing to any specific address, use `()` for the generic type +/// ``` +/// # use nix::sys::socket::*; +/// # use nix::unistd::pipe; +/// # use std::io::IoSlice; +/// let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, +/// SockFlag::empty()) +/// .unwrap(); +/// let (r, w) = pipe().unwrap(); +/// +/// let iov = [IoSlice::new(b"hello")]; +/// let fds = [r]; +/// let cmsg = ControlMessage::ScmRights(&fds); +/// sendmsg::<()>(fd1, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(); +/// ``` +/// When directing to a specific address, the generic type will be inferred. +/// ``` +/// # use nix::sys::socket::*; +/// # use nix::unistd::pipe; +/// # use std::io::IoSlice; +/// # use std::str::FromStr; +/// let localhost = SockaddrIn::from_str("1.2.3.4:8080").unwrap(); +/// let fd = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), +/// None).unwrap(); +/// let (r, w) = pipe().unwrap(); +/// +/// let iov = [IoSlice::new(b"hello")]; +/// let fds = [r]; +/// let cmsg = ControlMessage::ScmRights(&fds); +/// sendmsg(fd, &iov, &[cmsg], MsgFlags::empty(), Some(&localhost)).unwrap(); +/// ``` +pub fn sendmsg(fd: RawFd, iov: &[IoSlice<'_>], cmsgs: &[ControlMessage], + flags: MsgFlags, addr: Option<&S>) -> Result + where S: SockaddrLike +{ + let capacity = cmsgs.iter().map(|c| c.space()).sum(); + + // First size the buffer needed to hold the cmsgs. It must be zeroed, + // because subsequent code will not clear the padding bytes. + let mut cmsg_buffer = vec![0u8; capacity]; + + let mhdr = pack_mhdr_to_send(&mut cmsg_buffer[..], &iov, &cmsgs, addr); + + let ret = unsafe { libc::sendmsg(fd, &mhdr, flags.bits()) }; + + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +#[derive(Debug)] +pub struct SendMmsgData<'a, I, C, S> + where + I: AsRef<[IoSlice<'a>]>, + C: AsRef<[ControlMessage<'a>]>, + S: SockaddrLike + 'a +{ + pub iov: I, + pub cmsgs: C, + pub addr: Option, + pub _lt: std::marker::PhantomData<&'a I>, +} + +/// An extension of `sendmsg` that allows the caller to transmit multiple +/// messages on a socket using a single system call. This has performance +/// benefits for some applications. +/// +/// Allocations are performed for cmsgs and to build `msghdr` buffer +/// +/// # Arguments +/// +/// * `fd`: Socket file descriptor +/// * `data`: Struct that implements `IntoIterator` with `SendMmsgData` items +/// * `flags`: Optional flags passed directly to the operating system. +/// +/// # Returns +/// `Vec` with numbers of sent bytes on each sent message. +/// +/// # References +/// [`sendmsg`](fn.sendmsg.html) +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +pub fn sendmmsg<'a, I, C, S>( + fd: RawFd, + data: impl std::iter::IntoIterator>, + flags: MsgFlags +) -> Result> + where + I: AsRef<[IoSlice<'a>]> + 'a, + C: AsRef<[ControlMessage<'a>]> + 'a, + S: SockaddrLike + 'a +{ + let iter = data.into_iter(); + + let size_hint = iter.size_hint(); + let reserve_items = size_hint.1.unwrap_or(size_hint.0); + + let mut output = Vec::::with_capacity(reserve_items); + + let mut cmsgs_buffers = Vec::>::with_capacity(reserve_items); + + for d in iter { + let capacity: usize = d.cmsgs.as_ref().iter().map(|c| c.space()).sum(); + let mut cmsgs_buffer = vec![0u8; capacity]; + + output.push(libc::mmsghdr { + msg_hdr: pack_mhdr_to_send( + &mut cmsgs_buffer, + &d.iov, + &d.cmsgs, + d.addr.as_ref() + ), + msg_len: 0, + }); + cmsgs_buffers.push(cmsgs_buffer); + }; + + let ret = unsafe { libc::sendmmsg(fd, output.as_mut_ptr(), output.len() as _, flags.bits() as _) }; + + let sent_messages = Errno::result(ret)? as usize; + let mut sent_bytes = Vec::with_capacity(sent_messages); + + for item in &output { + sent_bytes.push(item.msg_len as usize); + } + + Ok(sent_bytes) +} + + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +#[derive(Debug)] +pub struct RecvMmsgData<'a, I> + where + I: AsRef<[IoSliceMut<'a>]> + 'a, +{ + pub iov: I, + pub cmsg_buffer: Option<&'a mut Vec>, +} + +/// An extension of `recvmsg` that allows the caller to receive multiple +/// messages from a socket using a single system call. This has +/// performance benefits for some applications. +/// +/// `iov` and `cmsg_buffer` should be constructed similarly to `recvmsg` +/// +/// Multiple allocations are performed +/// +/// # Arguments +/// +/// * `fd`: Socket file descriptor +/// * `data`: Struct that implements `IntoIterator` with `RecvMmsgData` items +/// * `flags`: Optional flags passed directly to the operating system. +/// +/// # RecvMmsgData +/// +/// * `iov`: Scatter-gather list of buffers to receive the message +/// * `cmsg_buffer`: Space to receive ancillary data. Should be created by +/// [`cmsg_space!`](../../macro.cmsg_space.html) +/// +/// # Returns +/// A `Vec` with multiple `RecvMsg`, one per received message +/// +/// # References +/// - [`recvmsg`](fn.recvmsg.html) +/// - [`RecvMsg`](struct.RecvMsg.html) +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +#[allow(clippy::needless_collect)] // Complicated false positive +pub fn recvmmsg<'a, I, S>( + fd: RawFd, + data: impl std::iter::IntoIterator, + IntoIter=impl ExactSizeIterator + Iterator>>, + flags: MsgFlags, + timeout: Option +) -> Result>> + where + I: AsRef<[IoSliceMut<'a>]> + 'a, + S: Copy + SockaddrLike + 'a +{ + let iter = data.into_iter(); + + let num_messages = iter.len(); + + let mut output: Vec = Vec::with_capacity(num_messages); + + // Addresses should be pre-allocated. pack_mhdr_to_receive will store them + // as raw pointers, so we may not move them. Turn the vec into a boxed + // slice so we won't inadvertently reallocate the vec. + let mut addresses = vec![mem::MaybeUninit::uninit(); num_messages] + .into_boxed_slice(); + + let results: Vec<_> = iter.enumerate().map(|(i, d)| { + let (msg_controllen, mhdr) = unsafe { + pack_mhdr_to_receive( + d.iov.as_ref(), + &mut d.cmsg_buffer, + addresses[i].as_mut_ptr(), + ) + }; + + output.push( + libc::mmsghdr { + msg_hdr: mhdr, + msg_len: 0, + } + ); + + (msg_controllen as usize, &mut d.cmsg_buffer) + }).collect(); + + let timeout = if let Some(mut t) = timeout { + t.as_mut() as *mut libc::timespec + } else { + ptr::null_mut() + }; + + let ret = unsafe { libc::recvmmsg(fd, output.as_mut_ptr(), output.len() as _, flags.bits() as _, timeout) }; + + let _ = Errno::result(ret)?; + + Ok(output + .into_iter() + .take(ret as usize) + .zip(addresses.iter().map(|addr| unsafe{addr.assume_init()})) + .zip(results.into_iter()) + .map(|((mmsghdr, address), (msg_controllen, cmsg_buffer))| { + unsafe { + read_mhdr( + mmsghdr.msg_hdr, + mmsghdr.msg_len as isize, + msg_controllen, + address, + cmsg_buffer + ) + } + }) + .collect()) +} + +unsafe fn read_mhdr<'a, 'b, S>( + mhdr: msghdr, + r: isize, + msg_controllen: usize, + address: S, + cmsg_buffer: &'a mut Option<&'b mut Vec> +) -> RecvMsg<'b, S> + where S: SockaddrLike +{ + let cmsghdr = { + if mhdr.msg_controllen > 0 { + // got control message(s) + cmsg_buffer + .as_mut() + .unwrap() + .set_len(mhdr.msg_controllen as usize); + debug_assert!(!mhdr.msg_control.is_null()); + debug_assert!(msg_controllen >= mhdr.msg_controllen as usize); + CMSG_FIRSTHDR(&mhdr as *const msghdr) + } else { + ptr::null() + }.as_ref() + }; + + RecvMsg { + bytes: r as usize, + cmsghdr, + address: Some(address), + flags: MsgFlags::from_bits_truncate(mhdr.msg_flags), + mhdr, + } +} + +unsafe fn pack_mhdr_to_receive<'outer, 'inner, I, S>( + iov: I, + cmsg_buffer: &mut Option<&mut Vec>, + address: *mut S, +) -> (usize, msghdr) + where + I: AsRef<[IoSliceMut<'inner>]> + 'outer, + S: SockaddrLike + 'outer +{ + let (msg_control, msg_controllen) = cmsg_buffer.as_mut() + .map(|v| (v.as_mut_ptr(), v.capacity())) + .unwrap_or((ptr::null_mut(), 0)); + + let mhdr = { + // Musl's msghdr has private fields, so this is the only way to + // initialize it. + let mut mhdr = mem::MaybeUninit::::zeroed(); + let p = mhdr.as_mut_ptr(); + (*p).msg_name = (*address).as_mut_ptr() as *mut c_void; + (*p).msg_namelen = S::size(); + (*p).msg_iov = iov.as_ref().as_ptr() as *mut iovec; + (*p).msg_iovlen = iov.as_ref().len() as _; + (*p).msg_control = msg_control as *mut c_void; + (*p).msg_controllen = msg_controllen as _; + (*p).msg_flags = 0; + mhdr.assume_init() + }; + + (msg_controllen, mhdr) +} + +fn pack_mhdr_to_send<'a, I, C, S>( + cmsg_buffer: &mut [u8], + iov: I, + cmsgs: C, + addr: Option<&S> +) -> msghdr + where + I: AsRef<[IoSlice<'a>]>, + C: AsRef<[ControlMessage<'a>]>, + S: SockaddrLike + 'a +{ + let capacity = cmsg_buffer.len(); + + // The message header must be initialized before the individual cmsgs. + let cmsg_ptr = if capacity > 0 { + cmsg_buffer.as_ptr() as *mut c_void + } else { + ptr::null_mut() + }; + + let mhdr = unsafe { + // Musl's msghdr has private fields, so this is the only way to + // initialize it. + let mut mhdr = mem::MaybeUninit::::zeroed(); + let p = mhdr.as_mut_ptr(); + (*p).msg_name = addr.map(S::as_ptr).unwrap_or(ptr::null()) as *mut _; + (*p).msg_namelen = addr.map(S::len).unwrap_or(0); + // transmute iov into a mutable pointer. sendmsg doesn't really mutate + // the buffer, but the standard says that it takes a mutable pointer + (*p).msg_iov = iov.as_ref().as_ptr() as *mut _; + (*p).msg_iovlen = iov.as_ref().len() as _; + (*p).msg_control = cmsg_ptr; + (*p).msg_controllen = capacity as _; + (*p).msg_flags = 0; + mhdr.assume_init() + }; + + // Encode each cmsg. This must happen after initializing the header because + // CMSG_NEXT_HDR and friends read the msg_control and msg_controllen fields. + // CMSG_FIRSTHDR is always safe + let mut pmhdr: *mut cmsghdr = unsafe { CMSG_FIRSTHDR(&mhdr as *const msghdr) }; + for cmsg in cmsgs.as_ref() { + assert_ne!(pmhdr, ptr::null_mut()); + // Safe because we know that pmhdr is valid, and we initialized it with + // sufficient space + unsafe { cmsg.encode_into(pmhdr) }; + // Safe because mhdr is valid + pmhdr = unsafe { CMSG_NXTHDR(&mhdr as *const msghdr, pmhdr) }; + } + + mhdr +} + +/// Receive message in scatter-gather vectors from a socket, and +/// optionally receive ancillary data into the provided buffer. +/// If no ancillary data is desired, use () as the type parameter. +/// +/// # Arguments +/// +/// * `fd`: Socket file descriptor +/// * `iov`: Scatter-gather list of buffers to receive the message +/// * `cmsg_buffer`: Space to receive ancillary data. Should be created by +/// [`cmsg_space!`](../../macro.cmsg_space.html) +/// * `flags`: Optional flags passed directly to the operating system. +/// +/// # References +/// [recvmsg(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvmsg.html) +pub fn recvmsg<'a, 'outer, 'inner, S>(fd: RawFd, iov: &'outer mut [IoSliceMut<'inner>], + mut cmsg_buffer: Option<&'a mut Vec>, + flags: MsgFlags) -> Result> + where S: SockaddrLike + 'a +{ + let mut address = mem::MaybeUninit::uninit(); + + let (msg_controllen, mut mhdr) = unsafe { + pack_mhdr_to_receive::<_, S>(iov, &mut cmsg_buffer, address.as_mut_ptr()) + }; + + let ret = unsafe { libc::recvmsg(fd, &mut mhdr, flags.bits()) }; + + let r = Errno::result(ret)?; + + Ok(unsafe { read_mhdr(mhdr, r, msg_controllen, address.assume_init(), &mut cmsg_buffer) }) +} +} + + +/// Create an endpoint for communication +/// +/// The `protocol` specifies a particular protocol to be used with the +/// socket. Normally only a single protocol exists to support a +/// particular socket type within a given protocol family, in which case +/// protocol can be specified as `None`. However, it is possible that many +/// protocols may exist, in which case a particular protocol must be +/// specified in this manner. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html) +pub fn socket>>(domain: AddressFamily, ty: SockType, flags: SockFlag, protocol: T) -> Result { + let protocol = match protocol.into() { + None => 0, + Some(p) => p as c_int, + }; + + // SockFlags are usually embedded into `ty`, but we don't do that in `nix` because it's a + // little easier to understand by separating it out. So we have to merge these bitfields + // here. + let mut ty = ty as c_int; + ty |= flags.bits(); + + let res = unsafe { libc::socket(domain as c_int, ty, protocol) }; + + Errno::result(res) +} + +/// Create a pair of connected sockets +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/socketpair.html) +pub fn socketpair>>(domain: AddressFamily, ty: SockType, protocol: T, + flags: SockFlag) -> Result<(RawFd, RawFd)> { + let protocol = match protocol.into() { + None => 0, + Some(p) => p as c_int, + }; + + // SockFlags are usually embedded into `ty`, but we don't do that in `nix` because it's a + // little easier to understand by separating it out. So we have to merge these bitfields + // here. + let mut ty = ty as c_int; + ty |= flags.bits(); + + let mut fds = [-1, -1]; + + let res = unsafe { libc::socketpair(domain as c_int, ty, protocol, fds.as_mut_ptr()) }; + Errno::result(res)?; + + Ok((fds[0], fds[1])) +} + +/// Listen for connections on a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/listen.html) +pub fn listen(sockfd: RawFd, backlog: usize) -> Result<()> { + let res = unsafe { libc::listen(sockfd, backlog as c_int) }; + + Errno::result(res).map(drop) +} + +/// Bind a name to a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html) +pub fn bind(fd: RawFd, addr: &dyn SockaddrLike) -> Result<()> { + let res = unsafe { + libc::bind(fd, addr.as_ptr(), addr.len()) + }; + + Errno::result(res).map(drop) +} + +/// Accept a connection on a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/accept.html) +pub fn accept(sockfd: RawFd) -> Result { + let res = unsafe { libc::accept(sockfd, ptr::null_mut(), ptr::null_mut()) }; + + Errno::result(res) +} + +/// Accept a connection on a socket +/// +/// [Further reading](https://man7.org/linux/man-pages/man2/accept.2.html) +#[cfg(any(all( + target_os = "android", + any( + target_arch = "aarch64", + target_arch = "x86", + target_arch = "x86_64" + ) + ), + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] +pub fn accept4(sockfd: RawFd, flags: SockFlag) -> Result { + let res = unsafe { libc::accept4(sockfd, ptr::null_mut(), ptr::null_mut(), flags.bits()) }; + + Errno::result(res) +} + +/// Initiate a connection on a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html) +pub fn connect(fd: RawFd, addr: &dyn SockaddrLike) -> Result<()> { + let res = unsafe { + libc::connect(fd, addr.as_ptr(), addr.len()) + }; + + Errno::result(res).map(drop) +} + +/// Receive data from a connection-oriented socket. Returns the number of +/// bytes read +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/recv.html) +pub fn recv(sockfd: RawFd, buf: &mut [u8], flags: MsgFlags) -> Result { + unsafe { + let ret = libc::recv( + sockfd, + buf.as_ptr() as *mut c_void, + buf.len() as size_t, + flags.bits()); + + Errno::result(ret).map(|r| r as usize) + } +} + +/// Receive data from a connectionless or connection-oriented socket. Returns +/// the number of bytes read and, for connectionless sockets, the socket +/// address of the sender. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html) +pub fn recvfrom(sockfd: RawFd, buf: &mut [u8]) + -> Result<(usize, Option)> +{ + unsafe { + let mut addr = mem::MaybeUninit::::uninit(); + let mut len = mem::size_of_val(&addr) as socklen_t; + + let ret = Errno::result(libc::recvfrom( + sockfd, + buf.as_ptr() as *mut c_void, + buf.len() as size_t, + 0, + addr.as_mut_ptr() as *mut libc::sockaddr, + &mut len as *mut socklen_t))? as usize; + + Ok((ret, T::from_raw( + addr.assume_init().as_ptr() as *const libc::sockaddr, + Some(len)) + )) + } +} + +/// Send a message to a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html) +pub fn sendto(fd: RawFd, buf: &[u8], addr: &dyn SockaddrLike, flags: MsgFlags) -> Result { + let ret = unsafe { + libc::sendto( + fd, + buf.as_ptr() as *const c_void, + buf.len() as size_t, + flags.bits(), + addr.as_ptr(), + addr.len() + ) + }; + + Errno::result(ret).map(|r| r as usize) +} + +/// Send data to a connection-oriented socket. Returns the number of bytes read +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/send.html) +pub fn send(fd: RawFd, buf: &[u8], flags: MsgFlags) -> Result { + let ret = unsafe { + libc::send(fd, buf.as_ptr() as *const c_void, buf.len() as size_t, flags.bits()) + }; + + Errno::result(ret).map(|r| r as usize) +} + +/* + * + * ===== Socket Options ===== + * + */ + +/// Represents a socket option that can be retrieved. +pub trait GetSockOpt : Copy { + type Val; + + /// Look up the value of this socket option on the given socket. + fn get(&self, fd: RawFd) -> Result; +} + +/// Represents a socket option that can be set. +pub trait SetSockOpt : Clone { + type Val; + + /// Set the value of this socket option on the given socket. + fn set(&self, fd: RawFd, val: &Self::Val) -> Result<()>; +} + +/// Get the current value for the requested socket option +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html) +pub fn getsockopt(fd: RawFd, opt: O) -> Result { + opt.get(fd) +} + +/// Sets the value for the requested socket option +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html) +/// +/// # Examples +/// +/// ``` +/// use nix::sys::socket::setsockopt; +/// use nix::sys::socket::sockopt::KeepAlive; +/// use std::net::TcpListener; +/// use std::os::unix::io::AsRawFd; +/// +/// let listener = TcpListener::bind("0.0.0.0:0").unwrap(); +/// let fd = listener.as_raw_fd(); +/// let res = setsockopt(fd, KeepAlive, &true); +/// assert!(res.is_ok()); +/// ``` +pub fn setsockopt(fd: RawFd, opt: O, val: &O::Val) -> Result<()> { + opt.set(fd, val) +} + +/// Get the address of the peer connected to the socket `fd`. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpeername.html) +pub fn getpeername(fd: RawFd) -> Result { + unsafe { + let mut addr = mem::MaybeUninit::::uninit(); + let mut len = T::size(); + + let ret = libc::getpeername( + fd, + addr.as_mut_ptr() as *mut libc::sockaddr, + &mut len + ); + + Errno::result(ret)?; + + T::from_raw(addr.assume_init().as_ptr(), Some(len)) + .ok_or(Errno::EINVAL) + } +} + +/// Get the current address to which the socket `fd` is bound. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockname.html) +pub fn getsockname(fd: RawFd) -> Result { + unsafe { + let mut addr = mem::MaybeUninit::::uninit(); + let mut len = T::size(); + + let ret = libc::getsockname( + fd, + addr.as_mut_ptr() as *mut libc::sockaddr, + &mut len + ); + + Errno::result(ret)?; + + T::from_raw(addr.assume_init().as_ptr(), Some(len)) + .ok_or(Errno::EINVAL) + } +} + +/// Return the appropriate `SockAddr` type from a `sockaddr_storage` of a +/// certain size. +/// +/// In C this would usually be done by casting. The `len` argument +/// should be the number of bytes in the `sockaddr_storage` that are actually +/// allocated and valid. It must be at least as large as all the useful parts +/// of the structure. Note that in the case of a `sockaddr_un`, `len` need not +/// include the terminating null. +#[deprecated( + since = "0.24.0", + note = "use SockaddrLike or SockaddrStorage instead" +)] +#[allow(deprecated)] +pub fn sockaddr_storage_to_addr( + addr: &sockaddr_storage, + len: usize) -> Result { + + assert!(len <= mem::size_of::()); + if len < mem::size_of_val(&addr.ss_family) { + return Err(Errno::ENOTCONN); + } + + match c_int::from(addr.ss_family) { + #[cfg(feature = "net")] + libc::AF_INET => { + assert!(len as usize >= mem::size_of::()); + let sin = unsafe { + *(addr as *const sockaddr_storage as *const sockaddr_in) + }; + Ok(SockAddr::Inet(InetAddr::V4(sin))) + } + #[cfg(feature = "net")] + libc::AF_INET6 => { + assert!(len as usize >= mem::size_of::()); + let sin6 = unsafe { + *(addr as *const _ as *const sockaddr_in6) + }; + Ok(SockAddr::Inet(InetAddr::V6(sin6))) + } + libc::AF_UNIX => { + unsafe { + let sun = *(addr as *const _ as *const sockaddr_un); + let sun_len = len.try_into().unwrap(); + Ok(SockAddr::Unix(UnixAddr::from_raw_parts(sun, sun_len))) + } + } + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + libc::AF_PACKET => { + use libc::sockaddr_ll; + // Don't assert anything about the size. + // Apparently the Linux kernel can return smaller sizes when + // the value in the last element of sockaddr_ll (`sll_addr`) is + // smaller than the declared size of that field + let sll = unsafe { + *(addr as *const _ as *const sockaddr_ll) + }; + Ok(SockAddr::Link(LinkAddr(sll))) + } + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => { + use libc::sockaddr_nl; + let snl = unsafe { + *(addr as *const _ as *const sockaddr_nl) + }; + Ok(SockAddr::Netlink(NetlinkAddr(snl))) + } + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_ALG => { + use libc::sockaddr_alg; + let salg = unsafe { + *(addr as *const _ as *const sockaddr_alg) + }; + Ok(SockAddr::Alg(AlgAddr(salg))) + } + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => { + use libc::sockaddr_vm; + let svm = unsafe { + *(addr as *const _ as *const sockaddr_vm) + }; + Ok(SockAddr::Vsock(VsockAddr(svm))) + } + af => panic!("unexpected address family {}", af), + } +} + + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum Shutdown { + /// Further receptions will be disallowed. + Read, + /// Further transmissions will be disallowed. + Write, + /// Further receptions and transmissions will be disallowed. + Both, +} + +/// Shut down part of a full-duplex connection. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/shutdown.html) +pub fn shutdown(df: RawFd, how: Shutdown) -> Result<()> { + unsafe { + use libc::shutdown; + + let how = match how { + Shutdown::Read => libc::SHUT_RD, + Shutdown::Write => libc::SHUT_WR, + Shutdown::Both => libc::SHUT_RDWR, + }; + + Errno::result(shutdown(df, how)).map(drop) + } +} + +#[cfg(test)] +mod tests { + #[test] + fn can_use_cmsg_space() { + let _ = cmsg_space!(u8); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/socket/sockopt.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/socket/sockopt.rs new file mode 100644 index 0000000000000000000000000000000000000000..14fea808fc3cb66010bd31a6b3fcad08eeac71f3 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/socket/sockopt.rs @@ -0,0 +1,1011 @@ +//! Socket options as used by `setsockopt` and `getsockopt`. +use cfg_if::cfg_if; +use super::{GetSockOpt, SetSockOpt}; +use crate::Result; +use crate::errno::Errno; +use crate::sys::time::TimeVal; +use libc::{self, c_int, c_void, socklen_t}; +use std::mem::{ + self, + MaybeUninit +}; +use std::os::unix::io::RawFd; +use std::ffi::{OsStr, OsString}; +#[cfg(target_family = "unix")] +use std::os::unix::ffi::OsStrExt; + +// Constants +// TCP_CA_NAME_MAX isn't defined in user space include files +#[cfg(any(target_os = "freebsd", target_os = "linux"))] +#[cfg(feature = "net")] +const TCP_CA_NAME_MAX: usize = 16; + +/// Helper for implementing `SetSockOpt` for a given socket option. See +/// [`::sys::socket::SetSockOpt`](sys/socket/trait.SetSockOpt.html). +/// +/// This macro aims to help implementing `SetSockOpt` for different socket options that accept +/// different kinds of data to be used with `setsockopt`. +/// +/// Instead of using this macro directly consider using `sockopt_impl!`, especially if the option +/// you are implementing represents a simple type. +/// +/// # Arguments +/// +/// * `$name:ident`: name of the type you want to implement `SetSockOpt` for. +/// * `$level:expr` : socket layer, or a `protocol level`: could be *raw sockets* +/// (`libc::SOL_SOCKET`), *ip protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc::IPPROTO_TCP`), +/// and more. Please refer to your system manual for more options. Will be passed as the second +/// argument (`level`) to the `setsockopt` call. +/// * `$flag:path`: a flag name to set. Some examples: `libc::SO_REUSEADDR`, `libc::TCP_NODELAY`, +/// `libc::IP_ADD_MEMBERSHIP` and others. Will be passed as the third argument (`option_name`) +/// to the `setsockopt` call. +/// * Type of the value that you are going to set. +/// * Type that implements the `Set` trait for the type from the previous item (like `SetBool` for +/// `bool`, `SetUsize` for `usize`, etc.). +macro_rules! setsockopt_impl { + ($name:ident, $level:expr, $flag:path, $ty:ty, $setter:ty) => { + impl SetSockOpt for $name { + type Val = $ty; + + fn set(&self, fd: RawFd, val: &$ty) -> Result<()> { + unsafe { + let setter: $setter = Set::new(val); + + let res = libc::setsockopt(fd, $level, $flag, + setter.ffi_ptr(), + setter.ffi_len()); + Errno::result(res).map(drop) + } + } + } + } +} + +/// Helper for implementing `GetSockOpt` for a given socket option. See +/// [`::sys::socket::GetSockOpt`](sys/socket/trait.GetSockOpt.html). +/// +/// This macro aims to help implementing `GetSockOpt` for different socket options that accept +/// different kinds of data to be use with `getsockopt`. +/// +/// Instead of using this macro directly consider using `sockopt_impl!`, especially if the option +/// you are implementing represents a simple type. +/// +/// # Arguments +/// +/// * Name of the type you want to implement `GetSockOpt` for. +/// * Socket layer, or a `protocol level`: could be *raw sockets* (`lic::SOL_SOCKET`), *ip +/// protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc::IPPROTO_TCP`), and more. Please refer +/// to your system manual for more options. Will be passed as the second argument (`level`) to +/// the `getsockopt` call. +/// * A flag to set. Some examples: `libc::SO_REUSEADDR`, `libc::TCP_NODELAY`, +/// `libc::SO_ORIGINAL_DST` and others. Will be passed as the third argument (`option_name`) to +/// the `getsockopt` call. +/// * Type of the value that you are going to get. +/// * Type that implements the `Get` trait for the type from the previous item (`GetBool` for +/// `bool`, `GetUsize` for `usize`, etc.). +macro_rules! getsockopt_impl { + ($name:ident, $level:expr, $flag:path, $ty:ty, $getter:ty) => { + impl GetSockOpt for $name { + type Val = $ty; + + fn get(&self, fd: RawFd) -> Result<$ty> { + unsafe { + let mut getter: $getter = Get::uninit(); + + let res = libc::getsockopt(fd, $level, $flag, + getter.ffi_ptr(), + getter.ffi_len()); + Errno::result(res)?; + + Ok(getter.assume_init()) + } + } + } + } +} + +/// Helper to generate the sockopt accessors. See +/// [`::sys::socket::GetSockOpt`](sys/socket/trait.GetSockOpt.html) and +/// [`::sys::socket::SetSockOpt`](sys/socket/trait.SetSockOpt.html). +/// +/// This macro aims to help implementing `GetSockOpt` and `SetSockOpt` for different socket options +/// that accept different kinds of data to be use with `getsockopt` and `setsockopt` respectively. +/// +/// Basically this macro wraps up the [`getsockopt_impl!`](macro.getsockopt_impl.html) and +/// [`setsockopt_impl!`](macro.setsockopt_impl.html) macros. +/// +/// # Arguments +/// +/// * `GetOnly`, `SetOnly` or `Both`: whether you want to implement only getter, only setter or +/// both of them. +/// * `$name:ident`: name of type `GetSockOpt`/`SetSockOpt` will be implemented for. +/// * `$level:expr` : socket layer, or a `protocol level`: could be *raw sockets* +/// (`lic::SOL_SOCKET`), *ip protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc::IPPROTO_TCP`), +/// and more. Please refer to your system manual for more options. Will be passed as the second +/// argument (`level`) to the `getsockopt`/`setsockopt` call. +/// * `$flag:path`: a flag name to set. Some examples: `libc::SO_REUSEADDR`, `libc::TCP_NODELAY`, +/// `libc::IP_ADD_MEMBERSHIP` and others. Will be passed as the third argument (`option_name`) +/// to the `setsockopt`/`getsockopt` call. +/// * `$ty:ty`: type of the value that will be get/set. +/// * `$getter:ty`: `Get` implementation; optional; only for `GetOnly` and `Both`. +/// * `$setter:ty`: `Set` implementation; optional; only for `SetOnly` and `Both`. +// Some targets don't use all rules. +#[allow(unknown_lints)] +#[allow(unused_macro_rules)] +macro_rules! sockopt_impl { + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, bool) => { + sockopt_impl!($(#[$attr])* + $name, GetOnly, $level, $flag, bool, GetBool); + }; + + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, u8) => { + sockopt_impl!($(#[$attr])* $name, GetOnly, $level, $flag, u8, GetU8); + }; + + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, usize) => + { + sockopt_impl!($(#[$attr])* + $name, GetOnly, $level, $flag, usize, GetUsize); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, bool) => { + sockopt_impl!($(#[$attr])* + $name, SetOnly, $level, $flag, bool, SetBool); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, u8) => { + sockopt_impl!($(#[$attr])* $name, SetOnly, $level, $flag, u8, SetU8); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, usize) => + { + sockopt_impl!($(#[$attr])* + $name, SetOnly, $level, $flag, usize, SetUsize); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, bool) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, bool, GetBool, SetBool); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, u8) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, u8, GetU8, SetU8); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, usize) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, usize, GetUsize, SetUsize); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, + OsString<$array:ty>) => + { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, OsString, GetOsString<$array>, + SetOsString); + }; + + /* + * Matchers with generic getter types must be placed at the end, so + * they'll only match _after_ specialized matchers fail + */ + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, $ty:ty) => + { + sockopt_impl!($(#[$attr])* + $name, GetOnly, $level, $flag, $ty, GetStruct<$ty>); + }; + + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, $ty:ty, + $getter:ty) => + { + $(#[$attr])* + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct $name; + + getsockopt_impl!($name, $level, $flag, $ty, $getter); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, $ty:ty) => + { + sockopt_impl!($(#[$attr])* + $name, SetOnly, $level, $flag, $ty, SetStruct<$ty>); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, $ty:ty, + $setter:ty) => + { + $(#[$attr])* + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct $name; + + setsockopt_impl!($name, $level, $flag, $ty, $setter); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, $ty:ty, + $getter:ty, $setter:ty) => + { + $(#[$attr])* + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct $name; + + setsockopt_impl!($name, $level, $flag, $ty, $setter); + getsockopt_impl!($name, $level, $flag, $ty, $getter); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, $ty:ty) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, $ty, GetStruct<$ty>, + SetStruct<$ty>); + }; +} + +/* + * + * ===== Define sockopts ===== + * + */ + +sockopt_impl!( + /// Enables local address reuse + ReuseAddr, Both, libc::SOL_SOCKET, libc::SO_REUSEADDR, bool +); +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] +sockopt_impl!( + /// Permits multiple AF_INET or AF_INET6 sockets to be bound to an + /// identical socket address. + ReusePort, Both, libc::SOL_SOCKET, libc::SO_REUSEPORT, bool); +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Under most circumstances, TCP sends data when it is presented; when + /// outstanding data has not yet been acknowledged, it gathers small amounts + /// of output to be sent in a single packet once an acknowledgement is + /// received. For a small number of clients, such as window systems that + /// send a stream of mouse events which receive no replies, this + /// packetization may cause significant delays. The boolean option + /// TCP_NODELAY defeats this algorithm. + TcpNoDelay, Both, libc::IPPROTO_TCP, libc::TCP_NODELAY, bool); +sockopt_impl!( + /// When enabled, a close(2) or shutdown(2) will not return until all + /// queued messages for the socket have been successfully sent or the + /// linger timeout has been reached. + Linger, Both, libc::SOL_SOCKET, libc::SO_LINGER, libc::linger); +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Join a multicast group + IpAddMembership, SetOnly, libc::IPPROTO_IP, libc::IP_ADD_MEMBERSHIP, + super::IpMembershipRequest); +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Leave a multicast group. + IpDropMembership, SetOnly, libc::IPPROTO_IP, libc::IP_DROP_MEMBERSHIP, + super::IpMembershipRequest); +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + #[cfg(feature = "net")] + sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Join an IPv6 multicast group. + Ipv6AddMembership, SetOnly, libc::IPPROTO_IPV6, libc::IPV6_ADD_MEMBERSHIP, super::Ipv6MembershipRequest); + #[cfg(feature = "net")] + sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Leave an IPv6 multicast group. + Ipv6DropMembership, SetOnly, libc::IPPROTO_IPV6, libc::IPV6_DROP_MEMBERSHIP, super::Ipv6MembershipRequest); + } else if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] { + #[cfg(feature = "net")] + sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Join an IPv6 multicast group. + Ipv6AddMembership, SetOnly, libc::IPPROTO_IPV6, + libc::IPV6_JOIN_GROUP, super::Ipv6MembershipRequest); + #[cfg(feature = "net")] + sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Leave an IPv6 multicast group. + Ipv6DropMembership, SetOnly, libc::IPPROTO_IPV6, + libc::IPV6_LEAVE_GROUP, super::Ipv6MembershipRequest); + } +} +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Set or read the time-to-live value of outgoing multicast packets for + /// this socket. + IpMulticastTtl, Both, libc::IPPROTO_IP, libc::IP_MULTICAST_TTL, u8); +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Set or read a boolean integer argument that determines whether sent + /// multicast packets should be looped back to the local sockets. + IpMulticastLoop, Both, libc::IPPROTO_IP, libc::IP_MULTICAST_LOOP, bool); +#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// If enabled, this boolean option allows binding to an IP address that + /// is nonlocal or does not (yet) exist. + IpFreebind, Both, libc::IPPROTO_IP, libc::IP_FREEBIND, bool); +sockopt_impl!( + /// Specify the receiving timeout until reporting an error. + ReceiveTimeout, Both, libc::SOL_SOCKET, libc::SO_RCVTIMEO, TimeVal); +sockopt_impl!( + /// Specify the sending timeout until reporting an error. + SendTimeout, Both, libc::SOL_SOCKET, libc::SO_SNDTIMEO, TimeVal); +sockopt_impl!( + /// Set or get the broadcast flag. + Broadcast, Both, libc::SOL_SOCKET, libc::SO_BROADCAST, bool); +sockopt_impl!( + /// If this option is enabled, out-of-band data is directly placed into + /// the receive data stream. + OobInline, Both, libc::SOL_SOCKET, libc::SO_OOBINLINE, bool); +sockopt_impl!( + /// Get and clear the pending socket error. + SocketError, GetOnly, libc::SOL_SOCKET, libc::SO_ERROR, i32); +sockopt_impl!( + /// Enable sending of keep-alive messages on connection-oriented sockets. + KeepAlive, Both, libc::SOL_SOCKET, libc::SO_KEEPALIVE, bool); +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios" +))] +sockopt_impl!( + /// Get the credentials of the peer process of a connected unix domain + /// socket. + LocalPeerCred, GetOnly, 0, libc::LOCAL_PEERCRED, super::XuCred); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Return the credentials of the foreign process connected to this socket. + PeerCredentials, GetOnly, libc::SOL_SOCKET, libc::SO_PEERCRED, super::UnixCredentials); +#[cfg(any(target_os = "ios", + target_os = "macos"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Specify the amount of time, in seconds, that the connection must be idle + /// before keepalive probes (if enabled) are sent. + TcpKeepAlive, Both, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE, u32); +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "nacl"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The time (in seconds) the connection needs to remain idle before TCP + /// starts sending keepalive probes + TcpKeepIdle, Both, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE, u32); +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + sockopt_impl!( + /// The maximum segment size for outgoing TCP packets. + TcpMaxSeg, Both, libc::IPPROTO_TCP, libc::TCP_MAXSEG, u32); + } else { + sockopt_impl!( + /// The maximum segment size for outgoing TCP packets. + TcpMaxSeg, GetOnly, libc::IPPROTO_TCP, libc::TCP_MAXSEG, u32); + } +} +#[cfg(not(target_os = "openbsd"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The maximum number of keepalive probes TCP should send before + /// dropping the connection. + TcpKeepCount, Both, libc::IPPROTO_TCP, libc::TCP_KEEPCNT, u32); +#[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "linux"))] +sockopt_impl!( + #[allow(missing_docs)] + // Not documented by Linux! + TcpRepair, Both, libc::IPPROTO_TCP, libc::TCP_REPAIR, u32); +#[cfg(not(target_os = "openbsd"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The time (in seconds) between individual keepalive probes. + TcpKeepInterval, Both, libc::IPPROTO_TCP, libc::TCP_KEEPINTVL, u32); +#[cfg(any(target_os = "fuchsia", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Specifies the maximum amount of time in milliseconds that transmitted + /// data may remain unacknowledged before TCP will forcibly close the + /// corresponding connection + TcpUserTimeout, Both, libc::IPPROTO_TCP, libc::TCP_USER_TIMEOUT, u32); +sockopt_impl!( + /// Sets or gets the maximum socket receive buffer in bytes. + RcvBuf, Both, libc::SOL_SOCKET, libc::SO_RCVBUF, usize); +sockopt_impl!( + /// Sets or gets the maximum socket send buffer in bytes. + SndBuf, Both, libc::SOL_SOCKET, libc::SO_SNDBUF, usize); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Using this socket option, a privileged (`CAP_NET_ADMIN`) process can + /// perform the same task as `SO_RCVBUF`, but the `rmem_max limit` can be + /// overridden. + RcvBufForce, SetOnly, libc::SOL_SOCKET, libc::SO_RCVBUFFORCE, usize); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Using this socket option, a privileged (`CAP_NET_ADMIN`) process can + /// perform the same task as `SO_SNDBUF`, but the `wmem_max` limit can be + /// overridden. + SndBufForce, SetOnly, libc::SOL_SOCKET, libc::SO_SNDBUFFORCE, usize); +sockopt_impl!( + /// Gets the socket type as an integer. + SockType, GetOnly, libc::SOL_SOCKET, libc::SO_TYPE, super::SockType); +sockopt_impl!( + /// Returns a value indicating whether or not this socket has been marked to + /// accept connections with `listen(2)`. + AcceptConn, GetOnly, libc::SOL_SOCKET, libc::SO_ACCEPTCONN, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Bind this socket to a particular device like “eth0”. + BindToDevice, Both, libc::SOL_SOCKET, libc::SO_BINDTODEVICE, OsString<[u8; libc::IFNAMSIZ]>); +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + #[allow(missing_docs)] + // Not documented by Linux! + OriginalDst, GetOnly, libc::SOL_IP, libc::SO_ORIGINAL_DST, libc::sockaddr_in); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + #[allow(missing_docs)] + // Not documented by Linux! + Ip6tOriginalDst, GetOnly, libc::SOL_IPV6, libc::IP6T_SO_ORIGINAL_DST, libc::sockaddr_in6); +#[cfg(any(target_os = "linux"))] +sockopt_impl!( + /// Specifies exact type of timestamping information collected by the kernel + /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) + Timestamping, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMPING, super::TimestampingFlag); +sockopt_impl!( + /// Enable or disable the receiving of the `SO_TIMESTAMP` control message. + ReceiveTimestamp, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMP, bool); +#[cfg(all(target_os = "linux"))] +sockopt_impl!( + /// Enable or disable the receiving of the `SO_TIMESTAMPNS` control message. + ReceiveTimestampns, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMPNS, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Setting this boolean option enables transparent proxying on this socket. + IpTransparent, Both, libc::SOL_IP, libc::IP_TRANSPARENT, bool); +#[cfg(target_os = "openbsd")] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Allows the socket to be bound to addresses which are not local to the + /// machine, so it can be used to make a transparent proxy. + BindAny, Both, libc::SOL_SOCKET, libc::SO_BINDANY, bool); +#[cfg(target_os = "freebsd")] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Can `bind(2)` to any address, even one not bound to any available + /// network interface in the system. + BindAny, Both, libc::IPPROTO_IP, libc::IP_BINDANY, bool); +#[cfg(target_os = "linux")] +sockopt_impl!( + /// Set the mark for each packet sent through this socket (similar to the + /// netfilter MARK target but socket-based). + Mark, Both, libc::SOL_SOCKET, libc::SO_MARK, u32); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Enable or disable the receiving of the `SCM_CREDENTIALS` control + /// message. + PassCred, Both, libc::SOL_SOCKET, libc::SO_PASSCRED, bool); +#[cfg(any(target_os = "freebsd", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// This option allows the caller to set the TCP congestion control + /// algorithm to be used, on a per-socket basis. + TcpCongestion, Both, libc::IPPROTO_TCP, libc::TCP_CONGESTION, OsString<[u8; TCP_CA_NAME_MAX]>); +#[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", +))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Pass an `IP_PKTINFO` ancillary message that contains a pktinfo + /// structure that supplies some information about the incoming packet. + Ipv4PacketInfo, Both, libc::IPPROTO_IP, libc::IP_PKTINFO, bool); +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Set delivery of the `IPV6_PKTINFO` control message on incoming + /// datagrams. + Ipv6RecvPacketInfo, Both, libc::IPPROTO_IPV6, libc::IPV6_RECVPKTINFO, bool); +#[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The `recvmsg(2)` call returns a `struct sockaddr_dl` corresponding to + /// the interface on which the packet was received. + Ipv4RecvIf, Both, libc::IPPROTO_IP, libc::IP_RECVIF, bool); +#[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The `recvmsg(2)` call will return the destination IP address for a UDP + /// datagram. + Ipv4RecvDstAddr, Both, libc::IPPROTO_IP, libc::IP_RECVDSTADDR, bool); +#[cfg(target_os = "linux")] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + #[allow(missing_docs)] + // Not documented by Linux! + UdpGsoSegment, Both, libc::SOL_UDP, libc::UDP_SEGMENT, libc::c_int); +#[cfg(target_os = "linux")] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + #[allow(missing_docs)] + // Not documented by Linux! + UdpGroSegment, Both, libc::IPPROTO_UDP, libc::UDP_GRO, bool); +#[cfg(target_os = "linux")] +sockopt_impl!( + /// Configures the behavior of time-based transmission of packets, for use + /// with the `TxTime` control message. + TxTime, Both, libc::SOL_SOCKET, libc::SO_TXTIME, libc::sock_txtime); +#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] +sockopt_impl!( + /// Indicates that an unsigned 32-bit value ancillary message (cmsg) should + /// be attached to received skbs indicating the number of packets dropped by + /// the socket since its creation. + RxqOvfl, Both, libc::SOL_SOCKET, libc::SO_RXQ_OVFL, libc::c_int); +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The socket is restricted to sending and receiving IPv6 packets only. + Ipv6V6Only, Both, libc::IPPROTO_IPV6, libc::IPV6_V6ONLY, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Enable extended reliable error message passing. + Ipv4RecvErr, Both, libc::IPPROTO_IP, libc::IP_RECVERR, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Control receiving of asynchronous error options. + Ipv6RecvErr, Both, libc::IPPROTO_IPV6, libc::IPV6_RECVERR, bool); +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +sockopt_impl!( + /// Set or retrieve the current time-to-live field that is used in every + /// packet sent from this socket. + Ipv4Ttl, Both, libc::IPPROTO_IP, libc::IP_TTL, libc::c_int); +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +sockopt_impl!( + /// Set the unicast hop limit for the socket. + Ipv6Ttl, Both, libc::IPPROTO_IPV6, libc::IPV6_UNICAST_HOPS, libc::c_int); +#[cfg(any(target_os = "ios", target_os = "macos"))] +sockopt_impl!( + /// Set "don't fragment packet" flag on the IP packet. + IpDontFrag, Both, libc::IPPROTO_IP, libc::IP_DONTFRAG, bool); +#[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", +))] +sockopt_impl!( + /// Set "don't fragment packet" flag on the IPv6 packet. + Ipv6DontFrag, Both, libc::IPPROTO_IPV6, libc::IPV6_DONTFRAG, bool); + +#[allow(missing_docs)] +// Not documented by Linux! +#[cfg(any(target_os = "android", target_os = "linux"))] +#[derive(Copy, Clone, Debug)] +pub struct AlgSetAeadAuthSize; + +// ALG_SET_AEAD_AUTH_SIZE read the length from passed `option_len` +// See https://elixir.bootlin.com/linux/v4.4/source/crypto/af_alg.c#L222 +#[cfg(any(target_os = "android", target_os = "linux"))] +impl SetSockOpt for AlgSetAeadAuthSize { + type Val = usize; + + fn set(&self, fd: RawFd, val: &usize) -> Result<()> { + unsafe { + let res = libc::setsockopt(fd, + libc::SOL_ALG, + libc::ALG_SET_AEAD_AUTHSIZE, + ::std::ptr::null(), + *val as libc::socklen_t); + Errno::result(res).map(drop) + } + } +} + +#[allow(missing_docs)] +// Not documented by Linux! +#[cfg(any(target_os = "android", target_os = "linux"))] +#[derive(Clone, Debug)] +pub struct AlgSetKey(::std::marker::PhantomData); + +#[cfg(any(target_os = "android", target_os = "linux"))] +impl Default for AlgSetKey { + fn default() -> Self { + AlgSetKey(Default::default()) + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +impl SetSockOpt for AlgSetKey where T: AsRef<[u8]> + Clone { + type Val = T; + + fn set(&self, fd: RawFd, val: &T) -> Result<()> { + unsafe { + let res = libc::setsockopt(fd, + libc::SOL_ALG, + libc::ALG_SET_KEY, + val.as_ref().as_ptr() as *const _, + val.as_ref().len() as libc::socklen_t); + Errno::result(res).map(drop) + } + } +} + +/* + * + * ===== Accessor helpers ===== + * + */ + +/// Helper trait that describes what is expected from a `GetSockOpt` getter. +trait Get { + /// Returns an uninitialized value. + fn uninit() -> Self; + /// Returns a pointer to the stored value. This pointer will be passed to the system's + /// `getsockopt` call (`man 3p getsockopt`, argument `option_value`). + fn ffi_ptr(&mut self) -> *mut c_void; + /// Returns length of the stored value. This pointer will be passed to the system's + /// `getsockopt` call (`man 3p getsockopt`, argument `option_len`). + fn ffi_len(&mut self) -> *mut socklen_t; + /// Returns the hopefully initialized inner value. + unsafe fn assume_init(self) -> T; +} + +/// Helper trait that describes what is expected from a `SetSockOpt` setter. +trait Set<'a, T> { + /// Initialize the setter with a given value. + fn new(val: &'a T) -> Self; + /// Returns a pointer to the stored value. This pointer will be passed to the system's + /// `setsockopt` call (`man 3p setsockopt`, argument `option_value`). + fn ffi_ptr(&self) -> *const c_void; + /// Returns length of the stored value. This pointer will be passed to the system's + /// `setsockopt` call (`man 3p setsockopt`, argument `option_len`). + fn ffi_len(&self) -> socklen_t; +} + +/// Getter for an arbitrary `struct`. +struct GetStruct { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetStruct { + fn uninit() -> Self { + GetStruct { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> T { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() + } +} + +/// Setter for an arbitrary `struct`. +struct SetStruct<'a, T: 'static> { + ptr: &'a T, +} + +impl<'a, T> Set<'a, T> for SetStruct<'a, T> { + fn new(ptr: &'a T) -> SetStruct<'a, T> { + SetStruct { ptr } + } + + fn ffi_ptr(&self) -> *const c_void { + self.ptr as *const T as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for a boolean value. +struct GetBool { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetBool { + fn uninit() -> Self { + GetBool { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> bool { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() != 0 + } +} + +/// Setter for a boolean value. +struct SetBool { + val: c_int, +} + +impl<'a> Set<'a, bool> for SetBool { + fn new(val: &'a bool) -> SetBool { + SetBool { val: if *val { 1 } else { 0 } } + } + + fn ffi_ptr(&self) -> *const c_void { + &self.val as *const c_int as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for an `u8` value. +struct GetU8 { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetU8 { + fn uninit() -> Self { + GetU8 { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> u8 { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() + } +} + +/// Setter for an `u8` value. +struct SetU8 { + val: u8, +} + +impl<'a> Set<'a, u8> for SetU8 { + fn new(val: &'a u8) -> SetU8 { + SetU8 { val: *val as u8 } + } + + fn ffi_ptr(&self) -> *const c_void { + &self.val as *const u8 as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for an `usize` value. +struct GetUsize { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetUsize { + fn uninit() -> Self { + GetUsize { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> usize { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() as usize + } +} + +/// Setter for an `usize` value. +struct SetUsize { + val: c_int, +} + +impl<'a> Set<'a, usize> for SetUsize { + fn new(val: &'a usize) -> SetUsize { + SetUsize { val: *val as c_int } + } + + fn ffi_ptr(&self) -> *const c_void { + &self.val as *const c_int as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for a `OsString` value. +struct GetOsString> { + len: socklen_t, + val: MaybeUninit, +} + +impl> Get for GetOsString { + fn uninit() -> Self { + GetOsString { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> OsString { + let len = self.len as usize; + let mut v = self.val.assume_init(); + OsStr::from_bytes(&v.as_mut()[0..len]).to_owned() + } +} + +/// Setter for a `OsString` value. +struct SetOsString<'a> { + val: &'a OsStr, +} + +impl<'a> Set<'a, OsString> for SetOsString<'a> { + fn new(val: &'a OsString) -> SetOsString { + SetOsString { val: val.as_os_str() } + } + + fn ffi_ptr(&self) -> *const c_void { + self.val.as_bytes().as_ptr() as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + self.val.len() as socklen_t + } +} + + +#[cfg(test)] +mod test { + #[cfg(any(target_os = "android", target_os = "linux"))] + #[test] + fn can_get_peercred_on_unix_socket() { + use super::super::*; + + let (a, b) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()).unwrap(); + let a_cred = getsockopt(a, super::PeerCredentials).unwrap(); + let b_cred = getsockopt(b, super::PeerCredentials).unwrap(); + assert_eq!(a_cred, b_cred); + assert!(a_cred.pid() != 0); + } + + #[test] + fn is_socket_type_unix() { + use super::super::*; + use crate::unistd::close; + + let (a, b) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()).unwrap(); + let a_type = getsockopt(a, super::SockType).unwrap(); + assert_eq!(a_type, SockType::Stream); + close(a).unwrap(); + close(b).unwrap(); + } + + #[test] + fn is_socket_type_dgram() { + use super::super::*; + use crate::unistd::close; + + let s = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None).unwrap(); + let s_type = getsockopt(s, super::SockType).unwrap(); + assert_eq!(s_type, SockType::Datagram); + close(s).unwrap(); + } + + #[cfg(any(target_os = "freebsd", + target_os = "linux", + target_os = "nacl"))] + #[test] + fn can_get_listen_on_tcp_socket() { + use super::super::*; + use crate::unistd::close; + + let s = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); + let s_listening = getsockopt(s, super::AcceptConn).unwrap(); + assert!(!s_listening); + listen(s, 10).unwrap(); + let s_listening2 = getsockopt(s, super::AcceptConn).unwrap(); + assert!(s_listening2); + close(s).unwrap(); + } + +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/stat.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/stat.rs new file mode 100644 index 0000000000000000000000000000000000000000..67a1b7f7698437aa0111c911960198ba87a151f3 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/stat.rs @@ -0,0 +1,324 @@ +pub use libc::{dev_t, mode_t}; +pub use libc::stat as FileStat; + +use crate::{Result, NixPath, errno::Errno}; +#[cfg(not(target_os = "redox"))] +use crate::fcntl::{AtFlags, at_rawfd}; +use std::mem; +use std::os::unix::io::RawFd; +use crate::sys::time::{TimeSpec, TimeVal}; + +libc_bitflags!( + /// "File type" flags for `mknod` and related functions. + pub struct SFlag: mode_t { + S_IFIFO; + S_IFCHR; + S_IFDIR; + S_IFBLK; + S_IFREG; + S_IFLNK; + S_IFSOCK; + S_IFMT; + } +); + +libc_bitflags! { + /// "File mode / permissions" flags. + pub struct Mode: mode_t { + S_IRWXU; + S_IRUSR; + S_IWUSR; + S_IXUSR; + S_IRWXG; + S_IRGRP; + S_IWGRP; + S_IXGRP; + S_IRWXO; + S_IROTH; + S_IWOTH; + S_IXOTH; + S_ISUID as mode_t; + S_ISGID as mode_t; + S_ISVTX as mode_t; + } +} + +/// Create a special or ordinary file, by pathname. +pub fn mknod(path: &P, kind: SFlag, perm: Mode, dev: dev_t) -> Result<()> { + let res = path.with_nix_path(|cstr| unsafe { + libc::mknod(cstr.as_ptr(), kind.bits | perm.bits() as mode_t, dev) + })?; + + Errno::result(res).map(drop) +} + +/// Create a special or ordinary file, relative to a given directory. +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn mknodat( + dirfd: RawFd, + path: &P, + kind: SFlag, + perm: Mode, + dev: dev_t, +) -> Result<()> { + let res = path.with_nix_path(|cstr| unsafe { + libc::mknodat(dirfd, cstr.as_ptr(), kind.bits | perm.bits() as mode_t, dev) + })?; + + Errno::result(res).map(drop) +} + +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub const fn major(dev: dev_t) -> u64 { + ((dev >> 32) & 0xffff_f000) | + ((dev >> 8) & 0x0000_0fff) +} + +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub const fn minor(dev: dev_t) -> u64 { + ((dev >> 12) & 0xffff_ff00) | + ((dev ) & 0x0000_00ff) +} + +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub const fn makedev(major: u64, minor: u64) -> dev_t { + ((major & 0xffff_f000) << 32) | + ((major & 0x0000_0fff) << 8) | + ((minor & 0xffff_ff00) << 12) | + (minor & 0x0000_00ff) +} + +pub fn umask(mode: Mode) -> Mode { + let prev = unsafe { libc::umask(mode.bits() as mode_t) }; + Mode::from_bits(prev).expect("[BUG] umask returned invalid Mode") +} + +pub fn stat(path: &P) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = path.with_nix_path(|cstr| { + unsafe { + libc::stat(cstr.as_ptr(), dst.as_mut_ptr()) + } + })?; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +pub fn lstat(path: &P) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = path.with_nix_path(|cstr| { + unsafe { + libc::lstat(cstr.as_ptr(), dst.as_mut_ptr()) + } + })?; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +pub fn fstat(fd: RawFd) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = unsafe { libc::fstat(fd, dst.as_mut_ptr()) }; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn fstatat(dirfd: RawFd, pathname: &P, f: AtFlags) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = pathname.with_nix_path(|cstr| { + unsafe { libc::fstatat(dirfd, cstr.as_ptr(), dst.as_mut_ptr(), f.bits() as libc::c_int) } + })?; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +/// Change the file permission bits of the file specified by a file descriptor. +/// +/// # References +/// +/// [fchmod(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchmod.html). +pub fn fchmod(fd: RawFd, mode: Mode) -> Result<()> { + let res = unsafe { libc::fchmod(fd, mode.bits() as mode_t) }; + + Errno::result(res).map(drop) +} + +/// Flags for `fchmodat` function. +#[derive(Clone, Copy, Debug)] +pub enum FchmodatFlags { + FollowSymlink, + NoFollowSymlink, +} + +/// Change the file permission bits. +/// +/// The file to be changed is determined relative to the directory associated +/// with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. +/// +/// If `flag` is `FchmodatFlags::NoFollowSymlink` and `path` names a symbolic link, +/// then the mode of the symbolic link is changed. +/// +/// `fchmodat(None, path, mode, FchmodatFlags::FollowSymlink)` is identical to +/// a call `libc::chmod(path, mode)`. That's why `chmod` is unimplemented +/// in the `nix` crate. +/// +/// # References +/// +/// [fchmodat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchmodat.html). +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn fchmodat( + dirfd: Option, + path: &P, + mode: Mode, + flag: FchmodatFlags, +) -> Result<()> { + let atflag = + match flag { + FchmodatFlags::FollowSymlink => AtFlags::empty(), + FchmodatFlags::NoFollowSymlink => AtFlags::AT_SYMLINK_NOFOLLOW, + }; + let res = path.with_nix_path(|cstr| unsafe { + libc::fchmodat( + at_rawfd(dirfd), + cstr.as_ptr(), + mode.bits() as mode_t, + atflag.bits() as libc::c_int, + ) + })?; + + Errno::result(res).map(drop) +} + +/// Change the access and modification times of a file. +/// +/// `utimes(path, times)` is identical to +/// `utimensat(None, path, times, UtimensatFlags::FollowSymlink)`. The former +/// is a deprecated API so prefer using the latter if the platforms you care +/// about support it. +/// +/// # References +/// +/// [utimes(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimes.html). +pub fn utimes(path: &P, atime: &TimeVal, mtime: &TimeVal) -> Result<()> { + let times: [libc::timeval; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = path.with_nix_path(|cstr| unsafe { + libc::utimes(cstr.as_ptr(), ×[0]) + })?; + + Errno::result(res).map(drop) +} + +/// Change the access and modification times of a file without following symlinks. +/// +/// `lutimes(path, times)` is identical to +/// `utimensat(None, path, times, UtimensatFlags::NoFollowSymlink)`. The former +/// is a deprecated API so prefer using the latter if the platforms you care +/// about support it. +/// +/// # References +/// +/// [lutimes(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lutimes.html). +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn lutimes(path: &P, atime: &TimeVal, mtime: &TimeVal) -> Result<()> { + let times: [libc::timeval; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = path.with_nix_path(|cstr| unsafe { + libc::lutimes(cstr.as_ptr(), ×[0]) + })?; + + Errno::result(res).map(drop) +} + +/// Change the access and modification times of the file specified by a file descriptor. +/// +/// # References +/// +/// [futimens(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html). +#[inline] +pub fn futimens(fd: RawFd, atime: &TimeSpec, mtime: &TimeSpec) -> Result<()> { + let times: [libc::timespec; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = unsafe { libc::futimens(fd, ×[0]) }; + + Errno::result(res).map(drop) +} + +/// Flags for `utimensat` function. +// TODO: replace with fcntl::AtFlags +#[derive(Clone, Copy, Debug)] +pub enum UtimensatFlags { + FollowSymlink, + NoFollowSymlink, +} + +/// Change the access and modification times of a file. +/// +/// The file to be changed is determined relative to the directory associated +/// with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. +/// +/// If `flag` is `UtimensatFlags::NoFollowSymlink` and `path` names a symbolic link, +/// then the mode of the symbolic link is changed. +/// +/// `utimensat(None, path, times, UtimensatFlags::FollowSymlink)` is identical to +/// `utimes(path, times)`. The latter is a deprecated API so prefer using the +/// former if the platforms you care about support it. +/// +/// # References +/// +/// [utimensat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimens.html). +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn utimensat( + dirfd: Option, + path: &P, + atime: &TimeSpec, + mtime: &TimeSpec, + flag: UtimensatFlags +) -> Result<()> { + let atflag = + match flag { + UtimensatFlags::FollowSymlink => AtFlags::empty(), + UtimensatFlags::NoFollowSymlink => AtFlags::AT_SYMLINK_NOFOLLOW, + }; + let times: [libc::timespec; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = path.with_nix_path(|cstr| unsafe { + libc::utimensat( + at_rawfd(dirfd), + cstr.as_ptr(), + ×[0], + atflag.bits() as libc::c_int, + ) + })?; + + Errno::result(res).map(drop) +} + +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn mkdirat(fd: RawFd, path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::mkdirat(fd, cstr.as_ptr(), mode.bits() as mode_t) } + })?; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/statfs.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/statfs.rs new file mode 100644 index 0000000000000000000000000000000000000000..5a7ac11aff72af07d3f0254175182879419ac58e --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/statfs.rs @@ -0,0 +1,760 @@ +//! Get filesystem statistics, non-portably +//! +//! See [`statvfs`](crate::sys::statvfs) for a portable alternative. +use std::fmt::{self, Debug}; +use std::mem; +use std::os::unix::io::AsRawFd; +#[cfg(not(any(target_os = "linux", target_os = "android")))] +use std::ffi::CStr; + +use crate::{NixPath, Result, errno::Errno}; + +/// Identifies a mounted file system +#[cfg(target_os = "android")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub type fsid_t = libc::__fsid_t; +/// Identifies a mounted file system +#[cfg(not(target_os = "android"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub type fsid_t = libc::fsid_t; + +/// Describes a mounted file system +#[derive(Clone, Copy)] +#[repr(transparent)] +pub struct Statfs(libc::statfs); + +#[cfg(target_os = "freebsd")] +type fs_type_t = u32; +#[cfg(target_os = "android")] +type fs_type_t = libc::c_ulong; +#[cfg(all(target_os = "linux", target_arch = "s390x"))] +type fs_type_t = libc::c_uint; +#[cfg(all(target_os = "linux", target_env = "musl"))] +type fs_type_t = libc::c_ulong; +#[cfg(all(target_os = "linux", target_env = "uclibc"))] +type fs_type_t = libc::c_int; +#[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl", target_env = "uclibc"))))] +type fs_type_t = libc::__fsword_t; + +/// Describes the file system type as known by the operating system. +#[cfg(any( + target_os = "freebsd", + target_os = "android", + all(target_os = "linux", target_arch = "s390x"), + all(target_os = "linux", target_env = "musl"), + all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))), +))] +#[derive(Eq, Copy, Clone, PartialEq, Debug)] +pub struct FsType(pub fs_type_t); + +// These constants are defined without documentation in the Linux headers, so we +// can't very well document them here. +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const ADFS_SUPER_MAGIC: FsType = FsType(libc::ADFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const AFFS_SUPER_MAGIC: FsType = FsType(libc::AFFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const AFS_SUPER_MAGIC: FsType = FsType(libc::AFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const AUTOFS_SUPER_MAGIC: FsType = FsType(libc::AUTOFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const BPF_FS_MAGIC: FsType = FsType(libc::BPF_FS_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const BTRFS_SUPER_MAGIC: FsType = FsType(libc::BTRFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const CGROUP2_SUPER_MAGIC: FsType = FsType(libc::CGROUP2_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const CGROUP_SUPER_MAGIC: FsType = FsType(libc::CGROUP_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const CODA_SUPER_MAGIC: FsType = FsType(libc::CODA_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const CRAMFS_MAGIC: FsType = FsType(libc::CRAMFS_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const DEBUGFS_MAGIC: FsType = FsType(libc::DEBUGFS_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const DEVPTS_SUPER_MAGIC: FsType = FsType(libc::DEVPTS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const ECRYPTFS_SUPER_MAGIC: FsType = FsType(libc::ECRYPTFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const EFS_SUPER_MAGIC: FsType = FsType(libc::EFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const EXT2_SUPER_MAGIC: FsType = FsType(libc::EXT2_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const EXT3_SUPER_MAGIC: FsType = FsType(libc::EXT3_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const EXT4_SUPER_MAGIC: FsType = FsType(libc::EXT4_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const F2FS_SUPER_MAGIC: FsType = FsType(libc::F2FS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const FUSE_SUPER_MAGIC: FsType = FsType(libc::FUSE_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const FUTEXFS_SUPER_MAGIC: FsType = FsType(libc::FUTEXFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const HOSTFS_SUPER_MAGIC: FsType = FsType(libc::HOSTFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const HPFS_SUPER_MAGIC: FsType = FsType(libc::HPFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const HUGETLBFS_MAGIC: FsType = FsType(libc::HUGETLBFS_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const ISOFS_SUPER_MAGIC: FsType = FsType(libc::ISOFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const JFFS2_SUPER_MAGIC: FsType = FsType(libc::JFFS2_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const MINIX2_SUPER_MAGIC2: FsType = FsType(libc::MINIX2_SUPER_MAGIC2 as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const MINIX2_SUPER_MAGIC: FsType = FsType(libc::MINIX2_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const MINIX3_SUPER_MAGIC: FsType = FsType(libc::MINIX3_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const MINIX_SUPER_MAGIC2: FsType = FsType(libc::MINIX_SUPER_MAGIC2 as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const MINIX_SUPER_MAGIC: FsType = FsType(libc::MINIX_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const MSDOS_SUPER_MAGIC: FsType = FsType(libc::MSDOS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const NCP_SUPER_MAGIC: FsType = FsType(libc::NCP_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const NFS_SUPER_MAGIC: FsType = FsType(libc::NFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const NILFS_SUPER_MAGIC: FsType = FsType(libc::NILFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const OCFS2_SUPER_MAGIC: FsType = FsType(libc::OCFS2_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const OPENPROM_SUPER_MAGIC: FsType = FsType(libc::OPENPROM_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const OVERLAYFS_SUPER_MAGIC: FsType = FsType(libc::OVERLAYFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const PROC_SUPER_MAGIC: FsType = FsType(libc::PROC_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const QNX4_SUPER_MAGIC: FsType = FsType(libc::QNX4_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const QNX6_SUPER_MAGIC: FsType = FsType(libc::QNX6_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const RDTGROUP_SUPER_MAGIC: FsType = FsType(libc::RDTGROUP_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const REISERFS_SUPER_MAGIC: FsType = FsType(libc::REISERFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const SECURITYFS_MAGIC: FsType = FsType(libc::SECURITYFS_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const SELINUX_MAGIC: FsType = FsType(libc::SELINUX_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const SMACK_MAGIC: FsType = FsType(libc::SMACK_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const SMB_SUPER_MAGIC: FsType = FsType(libc::SMB_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const SYSFS_MAGIC: FsType = FsType(libc::SYSFS_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const TMPFS_MAGIC: FsType = FsType(libc::TMPFS_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const TRACEFS_MAGIC: FsType = FsType(libc::TRACEFS_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const UDF_SUPER_MAGIC: FsType = FsType(libc::UDF_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const USBDEVICE_SUPER_MAGIC: FsType = FsType(libc::USBDEVICE_SUPER_MAGIC as fs_type_t); +#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))] +#[allow(missing_docs)] +pub const XENFS_SUPER_MAGIC: FsType = FsType(libc::XENFS_SUPER_MAGIC as fs_type_t); + + +impl Statfs { + /// Magic code defining system type + #[cfg(not(any( + target_os = "openbsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos" + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn filesystem_type(&self) -> FsType { + FsType(self.0.f_type) + } + + /// Magic code defining system type + #[cfg(not(any(target_os = "linux", target_os = "android")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn filesystem_type_name(&self) -> &str { + let c_str = unsafe { CStr::from_ptr(self.0.f_fstypename.as_ptr()) }; + c_str.to_str().unwrap() + } + + /// Optimal transfer block size + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> i32 { + self.0.f_iosize + } + + /// Optimal transfer block size + #[cfg(target_os = "openbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> u32 { + self.0.f_iosize + } + + /// Optimal transfer block size + #[cfg(all(target_os = "linux", target_arch = "s390x"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> u32 { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(any( + target_os = "android", + all(target_os = "linux", target_env = "musl") + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> libc::c_ulong { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl", target_env = "uclibc"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> libc::__fsword_t { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(all(target_os = "linux", target_env = "uclibc"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> libc::c_int { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> libc::c_long { + self.0.f_iosize + } + + /// Optimal transfer block size + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> u64 { + self.0.f_iosize + } + + /// Size of a block + #[cfg(any(target_os = "ios", target_os = "macos", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> u32 { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", target_arch = "s390x"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> u32 { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", target_env = "musl"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> libc::c_ulong { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", target_env = "uclibc"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> libc::c_int { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl", target_env = "uclibc"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> libc::__fsword_t { + self.0.f_bsize + } + + /// Size of a block + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> u64 { + self.0.f_bsize + } + + /// Size of a block + #[cfg(target_os = "android")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> libc::c_ulong { + self.0.f_bsize + } + + /// Size of a block + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> libc::c_long { + self.0.f_bsize + } + + /// Maximum length of filenames + #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> u32 { + self.0.f_namemax + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", target_arch = "s390x"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> u32 { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", target_env = "musl"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> libc::c_ulong { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", target_env = "uclibc"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> libc::c_int { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl", target_env = "uclibc"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> libc::__fsword_t { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(target_os = "android")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> libc::c_ulong { + self.0.f_namelen + } + + /// Total data blocks in filesystem + #[cfg(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks(&self) -> u64 { + self.0.f_blocks + } + + /// Total data blocks in filesystem + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks(&self) -> libc::c_long { + self.0.f_blocks + } + + /// Total data blocks in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks(&self) -> u64 { + self.0.f_blocks + } + + /// Total data blocks in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks(&self) -> libc::c_ulong { + self.0.f_blocks + } + + /// Free blocks in filesystem + #[cfg(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_free(&self) -> u64 { + self.0.f_bfree + } + + /// Free blocks in filesystem + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_free(&self) -> libc::c_long { + self.0.f_bfree + } + + /// Free blocks in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_free(&self) -> u64 { + self.0.f_bfree + } + + /// Free blocks in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_free(&self) -> libc::c_ulong { + self.0.f_bfree + } + + /// Free blocks available to unprivileged user + #[cfg(any(target_os = "ios", target_os = "macos", target_os = "android"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_available(&self) -> u64 { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_available(&self) -> libc::c_long { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_available(&self) -> i64 { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_available(&self) -> u64 { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_available(&self) -> libc::c_ulong { + self.0.f_bavail + } + + /// Total file nodes in filesystem + #[cfg(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files(&self) -> u64 { + self.0.f_files + } + + /// Total file nodes in filesystem + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files(&self) -> libc::c_long { + self.0.f_files + } + + /// Total file nodes in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files(&self) -> libc::fsfilcnt_t { + self.0.f_files + } + + /// Total file nodes in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files(&self) -> libc::c_ulong { + self.0.f_files + } + + /// Free file nodes in filesystem + #[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "macos", + target_os = "openbsd" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files_free(&self) -> u64 { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files_free(&self) -> libc::c_long { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files_free(&self) -> i64 { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files_free(&self) -> libc::fsfilcnt_t { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files_free(&self) -> libc::c_ulong { + self.0.f_ffree + } + + /// Filesystem ID + pub fn filesystem_id(&self) -> fsid_t { + self.0.f_fsid + } +} + +impl Debug for Statfs { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Statfs") + .field("optimal_transfer_size", &self.optimal_transfer_size()) + .field("block_size", &self.block_size()) + .field("blocks", &self.blocks()) + .field("blocks_free", &self.blocks_free()) + .field("blocks_available", &self.blocks_available()) + .field("files", &self.files()) + .field("files_free", &self.files_free()) + .field("filesystem_id", &self.filesystem_id()) + .finish() + } +} + +/// Describes a mounted file system. +/// +/// The result is OS-dependent. For a portable alternative, see +/// [`statvfs`](crate::sys::statvfs::statvfs). +/// +/// # Arguments +/// +/// `path` - Path to any file within the file system to describe +pub fn statfs(path: &P) -> Result { + unsafe { + let mut stat = mem::MaybeUninit::::uninit(); + let res = path.with_nix_path(|path| libc::statfs(path.as_ptr(), stat.as_mut_ptr()))?; + Errno::result(res).map(|_| Statfs(stat.assume_init())) + } +} + +/// Describes a mounted file system. +/// +/// The result is OS-dependent. For a portable alternative, see +/// [`fstatvfs`](crate::sys::statvfs::fstatvfs). +/// +/// # Arguments +/// +/// `fd` - File descriptor of any open file within the file system to describe +pub fn fstatfs(fd: &T) -> Result { + unsafe { + let mut stat = mem::MaybeUninit::::uninit(); + Errno::result(libc::fstatfs(fd.as_raw_fd(), stat.as_mut_ptr())) + .map(|_| Statfs(stat.assume_init())) + } +} + +#[cfg(test)] +mod test { + use std::fs::File; + + use crate::sys::statfs::*; + use crate::sys::statvfs::*; + use std::path::Path; + + #[test] + fn statfs_call() { + check_statfs("/tmp"); + check_statfs("/dev"); + check_statfs("/run"); + check_statfs("/"); + } + + #[test] + fn fstatfs_call() { + check_fstatfs("/tmp"); + check_fstatfs("/dev"); + check_fstatfs("/run"); + check_fstatfs("/"); + } + + fn check_fstatfs(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()).unwrap(); + let file = File::open(path).unwrap(); + let fs = fstatfs(&file).unwrap(); + assert_fs_equals(fs, vfs); + } + + fn check_statfs(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()).unwrap(); + let fs = statfs(path.as_bytes()).unwrap(); + assert_fs_equals(fs, vfs); + } + + fn assert_fs_equals(fs: Statfs, vfs: Statvfs) { + assert_eq!(fs.files() as u64, vfs.files() as u64); + assert_eq!(fs.blocks() as u64, vfs.blocks() as u64); + assert_eq!(fs.block_size() as u64, vfs.fragment_size() as u64); + } + + // This test is ignored because files_free/blocks_free can change after statvfs call and before + // statfs call. + #[test] + #[ignore] + fn statfs_call_strict() { + check_statfs_strict("/tmp"); + check_statfs_strict("/dev"); + check_statfs_strict("/run"); + check_statfs_strict("/"); + } + + // This test is ignored because files_free/blocks_free can change after statvfs call and before + // fstatfs call. + #[test] + #[ignore] + fn fstatfs_call_strict() { + check_fstatfs_strict("/tmp"); + check_fstatfs_strict("/dev"); + check_fstatfs_strict("/run"); + check_fstatfs_strict("/"); + } + + fn check_fstatfs_strict(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()); + let file = File::open(path).unwrap(); + let fs = fstatfs(&file); + assert_fs_equals_strict(fs.unwrap(), vfs.unwrap()) + } + + fn check_statfs_strict(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()); + let fs = statfs(path.as_bytes()); + assert_fs_equals_strict(fs.unwrap(), vfs.unwrap()) + } + + fn assert_fs_equals_strict(fs: Statfs, vfs: Statvfs) { + assert_eq!(fs.files_free() as u64, vfs.files_free() as u64); + assert_eq!(fs.blocks_free() as u64, vfs.blocks_free() as u64); + assert_eq!(fs.blocks_available() as u64, vfs.blocks_available() as u64); + assert_eq!(fs.files() as u64, vfs.files() as u64); + assert_eq!(fs.blocks() as u64, vfs.blocks() as u64); + assert_eq!(fs.block_size() as u64, vfs.fragment_size() as u64); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/statvfs.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/statvfs.rs new file mode 100644 index 0000000000000000000000000000000000000000..ab54b4b50b9fef428769bae9be83a1f5cf8ca744 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/statvfs.rs @@ -0,0 +1,172 @@ +//! Get filesystem statistics +//! +//! See [the man pages](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fstatvfs.html) +//! for more details. +use std::mem; +use std::os::unix::io::AsRawFd; + +use libc::{self, c_ulong}; + +use crate::{Result, NixPath, errno::Errno}; + +#[cfg(not(target_os = "redox"))] +libc_bitflags!( + /// File system mount Flags + #[repr(C)] + #[derive(Default)] + pub struct FsFlags: c_ulong { + /// Read Only + ST_RDONLY; + /// Do not allow the set-uid bits to have an effect + ST_NOSUID; + /// Do not interpret character or block-special devices + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_NODEV; + /// Do not allow execution of binaries on the filesystem + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_NOEXEC; + /// All IO should be done synchronously + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_SYNCHRONOUS; + /// Allow mandatory locks on the filesystem + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_MANDLOCK; + /// Write on file/directory/symlink + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_WRITE; + /// Append-only file + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_APPEND; + /// Immutable file + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_IMMUTABLE; + /// Do not update access times on files + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_NOATIME; + /// Do not update access times on files + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_NODIRATIME; + /// Update access time relative to modify/change time + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_env = "musl"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_RELATIME; + } +); + +/// Wrapper around the POSIX `statvfs` struct +/// +/// For more information see the [`statvfs(3)` man pages](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_statvfs.h.html). +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct Statvfs(libc::statvfs); + +impl Statvfs { + /// get the file system block size + pub fn block_size(&self) -> c_ulong { + self.0.f_bsize + } + + /// Get the fundamental file system block size + pub fn fragment_size(&self) -> c_ulong { + self.0.f_frsize + } + + /// Get the number of blocks. + /// + /// Units are in units of `fragment_size()` + pub fn blocks(&self) -> libc::fsblkcnt_t { + self.0.f_blocks + } + + /// Get the number of free blocks in the file system + pub fn blocks_free(&self) -> libc::fsblkcnt_t { + self.0.f_bfree + } + + /// Get the number of free blocks for unprivileged users + pub fn blocks_available(&self) -> libc::fsblkcnt_t { + self.0.f_bavail + } + + /// Get the total number of file inodes + pub fn files(&self) -> libc::fsfilcnt_t { + self.0.f_files + } + + /// Get the number of free file inodes + pub fn files_free(&self) -> libc::fsfilcnt_t { + self.0.f_ffree + } + + /// Get the number of free file inodes for unprivileged users + pub fn files_available(&self) -> libc::fsfilcnt_t { + self.0.f_favail + } + + /// Get the file system id + pub fn filesystem_id(&self) -> c_ulong { + self.0.f_fsid + } + + /// Get the mount flags + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn flags(&self) -> FsFlags { + FsFlags::from_bits_truncate(self.0.f_flag) + } + + /// Get the maximum filename length + pub fn name_max(&self) -> c_ulong { + self.0.f_namemax + } + +} + +/// Return a `Statvfs` object with information about the `path` +pub fn statvfs(path: &P) -> Result { + unsafe { + Errno::clear(); + let mut stat = mem::MaybeUninit::::uninit(); + let res = path.with_nix_path(|path| + libc::statvfs(path.as_ptr(), stat.as_mut_ptr()) + )?; + + Errno::result(res).map(|_| Statvfs(stat.assume_init())) + } +} + +/// Return a `Statvfs` object with information about `fd` +pub fn fstatvfs(fd: &T) -> Result { + unsafe { + Errno::clear(); + let mut stat = mem::MaybeUninit::::uninit(); + Errno::result(libc::fstatvfs(fd.as_raw_fd(), stat.as_mut_ptr())) + .map(|_| Statvfs(stat.assume_init())) + } +} + +#[cfg(test)] +mod test { + use std::fs::File; + use crate::sys::statvfs::*; + + #[test] + fn statvfs_call() { + statvfs(&b"/"[..]).unwrap(); + } + + #[test] + fn fstatvfs_call() { + let root = File::open("/").unwrap(); + fstatvfs(&root).unwrap(); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/sysinfo.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/sysinfo.rs new file mode 100644 index 0000000000000000000000000000000000000000..dc943c1adce12454034a9bd31f0860a2c8dc3660 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/sysinfo.rs @@ -0,0 +1,79 @@ +use libc::{self, SI_LOAD_SHIFT}; +use std::{cmp, mem}; +use std::time::Duration; + +use crate::Result; +use crate::errno::Errno; + +/// System info structure returned by `sysinfo`. +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct SysInfo(libc::sysinfo); + +// The fields are c_ulong on 32-bit linux, u64 on 64-bit linux; x32's ulong is u32 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +type mem_blocks_t = u64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +type mem_blocks_t = libc::c_ulong; + +impl SysInfo { + /// Returns the load average tuple. + /// + /// The returned values represent the load average over time intervals of + /// 1, 5, and 15 minutes, respectively. + pub fn load_average(&self) -> (f64, f64, f64) { + ( + self.0.loads[0] as f64 / (1 << SI_LOAD_SHIFT) as f64, + self.0.loads[1] as f64 / (1 << SI_LOAD_SHIFT) as f64, + self.0.loads[2] as f64 / (1 << SI_LOAD_SHIFT) as f64, + ) + } + + /// Returns the time since system boot. + pub fn uptime(&self) -> Duration { + // Truncate negative values to 0 + Duration::from_secs(cmp::max(self.0.uptime, 0) as u64) + } + + /// Current number of processes. + pub fn process_count(&self) -> u16 { + self.0.procs + } + + /// Returns the amount of swap memory in Bytes. + pub fn swap_total(&self) -> u64 { + self.scale_mem(self.0.totalswap) + } + + /// Returns the amount of unused swap memory in Bytes. + pub fn swap_free(&self) -> u64 { + self.scale_mem(self.0.freeswap) + } + + /// Returns the total amount of installed RAM in Bytes. + pub fn ram_total(&self) -> u64 { + self.scale_mem(self.0.totalram) + } + + /// Returns the amount of completely unused RAM in Bytes. + /// + /// "Unused" in this context means that the RAM in neither actively used by + /// programs, nor by the operating system as disk cache or buffer. It is + /// "wasted" RAM since it currently serves no purpose. + pub fn ram_unused(&self) -> u64 { + self.scale_mem(self.0.freeram) + } + + fn scale_mem(&self, units: mem_blocks_t) -> u64 { + units as u64 * self.0.mem_unit as u64 + } +} + +/// Returns system information. +/// +/// [See `sysinfo(2)`](https://man7.org/linux/man-pages/man2/sysinfo.2.html). +pub fn sysinfo() -> Result { + let mut info = mem::MaybeUninit::uninit(); + let res = unsafe { libc::sysinfo(info.as_mut_ptr()) }; + Errno::result(res).map(|_| unsafe{ SysInfo(info.assume_init()) }) +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/termios.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/termios.rs new file mode 100644 index 0000000000000000000000000000000000000000..8870f6be7b30d8007ff0e8e83658394994ae56be --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/termios.rs @@ -0,0 +1,1100 @@ +//! An interface for controlling asynchronous communication ports +//! +//! This interface provides a safe wrapper around the termios subsystem defined by POSIX. The +//! underlying types are all implemented in libc for most platforms and either wrapped in safer +//! types here or exported directly. +//! +//! If you are unfamiliar with the `termios` API, you should first read the +//! [API documentation](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html) and +//! then come back to understand how `nix` safely wraps it. +//! +//! It should be noted that this API incurs some runtime overhead above the base `libc` definitions. +//! As this interface is not used with high-bandwidth information, this should be fine in most +//! cases. The primary cost when using this API is that the `Termios` datatype here duplicates the +//! standard fields of the underlying `termios` struct and uses safe type wrappers for those fields. +//! This means that when crossing the FFI interface to the underlying C library, data is first +//! copied into the underlying `termios` struct, then the operation is done, and the data is copied +//! back (with additional sanity checking) into the safe wrapper types. The `termios` struct is +//! relatively small across all platforms (on the order of 32-64 bytes). +//! +//! The following examples highlight some of the API use cases such that users coming from using C +//! or reading the standard documentation will understand how to use the safe API exposed here. +//! +//! Example disabling processing of the end-of-file control character: +//! +//! ``` +//! # use self::nix::sys::termios::SpecialCharacterIndices::VEOF; +//! # use self::nix::sys::termios::{_POSIX_VDISABLE, Termios}; +//! # let mut termios: Termios = unsafe { std::mem::zeroed() }; +//! termios.control_chars[VEOF as usize] = _POSIX_VDISABLE; +//! ``` +//! +//! The flags within `Termios` are defined as bitfields using the `bitflags` crate. This provides +//! an interface for working with bitfields that is similar to working with the raw unsigned +//! integer types but offers type safety because of the internal checking that values will always +//! be a valid combination of the defined flags. +//! +//! An example showing some of the basic operations for interacting with the control flags: +//! +//! ``` +//! # use self::nix::sys::termios::{ControlFlags, Termios}; +//! # let mut termios: Termios = unsafe { std::mem::zeroed() }; +//! termios.control_flags & ControlFlags::CSIZE == ControlFlags::CS5; +//! termios.control_flags |= ControlFlags::CS5; +//! ``` +//! +//! # Baud rates +//! +//! This API is not consistent across platforms when it comes to `BaudRate`: Android and Linux both +//! only support the rates specified by the `BaudRate` enum through their termios API while the BSDs +//! support arbitrary baud rates as the values of the `BaudRate` enum constants are the same integer +//! value of the constant (`B9600` == `9600`). Therefore the `nix::termios` API uses the following +//! conventions: +//! +//! * `cfgetispeed()` - Returns `u32` on BSDs, `BaudRate` on Android/Linux +//! * `cfgetospeed()` - Returns `u32` on BSDs, `BaudRate` on Android/Linux +//! * `cfsetispeed()` - Takes `u32` or `BaudRate` on BSDs, `BaudRate` on Android/Linux +//! * `cfsetospeed()` - Takes `u32` or `BaudRate` on BSDs, `BaudRate` on Android/Linux +//! * `cfsetspeed()` - Takes `u32` or `BaudRate` on BSDs, `BaudRate` on Android/Linux +//! +//! The most common use case of specifying a baud rate using the enum will work the same across +//! platforms: +//! +//! ```rust +//! # use nix::sys::termios::{BaudRate, cfsetispeed, cfsetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! cfsetispeed(&mut t, BaudRate::B9600); +//! cfsetospeed(&mut t, BaudRate::B9600); +//! cfsetspeed(&mut t, BaudRate::B9600); +//! # } +//! ``` +//! +//! Additionally round-tripping baud rates is consistent across platforms: +//! +//! ```rust +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetispeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, BaudRate::B9600); +//! let speed = cfgetispeed(&t); +//! assert_eq!(speed, cfgetospeed(&t)); +//! cfsetispeed(&mut t, speed); +//! # } +//! ``` +//! +//! On non-BSDs, `cfgetispeed()` and `cfgetospeed()` both return a `BaudRate`: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust,ignore")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust")] +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, BaudRate::B9600); +//! assert_eq!(cfgetispeed(&t), BaudRate::B9600); +//! assert_eq!(cfgetospeed(&t), BaudRate::B9600); +//! # } +//! ``` +//! +//! But on the BSDs, `cfgetispeed()` and `cfgetospeed()` both return `u32`s: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust,ignore")] +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, 9600u32); +//! assert_eq!(cfgetispeed(&t), 9600u32); +//! assert_eq!(cfgetospeed(&t), 9600u32); +//! # } +//! ``` +//! +//! It's trivial to convert from a `BaudRate` to a `u32` on BSDs: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust,ignore")] +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, 9600u32); +//! assert_eq!(cfgetispeed(&t), BaudRate::B9600.into()); +//! assert_eq!(u32::from(BaudRate::B9600), 9600u32); +//! # } +//! ``` +//! +//! And on BSDs you can specify arbitrary baud rates (**note** this depends on hardware support) +//! by specifying baud rates directly using `u32`s: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust,ignore")] +//! # use nix::sys::termios::{cfsetispeed, cfsetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! cfsetispeed(&mut t, 9600u32); +//! cfsetospeed(&mut t, 9600u32); +//! cfsetspeed(&mut t, 9600u32); +//! # } +//! ``` +use cfg_if::cfg_if; +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_int, tcflag_t}; +use std::cell::{Ref, RefCell}; +use std::convert::From; +use std::mem; +use std::os::unix::io::RawFd; + +#[cfg(feature = "process")] +use crate::unistd::Pid; + +/// Stores settings for the termios API +/// +/// This is a wrapper around the `libc::termios` struct that provides a safe interface for the +/// standard fields. The only safe way to obtain an instance of this struct is to extract it from +/// an open port using `tcgetattr()`. +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Termios { + inner: RefCell, + /// Input mode flags (see `termios.c_iflag` documentation) + pub input_flags: InputFlags, + /// Output mode flags (see `termios.c_oflag` documentation) + pub output_flags: OutputFlags, + /// Control mode flags (see `termios.c_cflag` documentation) + pub control_flags: ControlFlags, + /// Local mode flags (see `termios.c_lflag` documentation) + pub local_flags: LocalFlags, + /// Control characters (see `termios.c_cc` documentation) + pub control_chars: [libc::cc_t; NCCS], +} + +impl Termios { + /// Exposes an immutable reference to the underlying `libc::termios` data structure. + /// + /// This is not part of `nix`'s public API because it requires additional work to maintain type + /// safety. + pub(crate) fn get_libc_termios(&self) -> Ref { + { + let mut termios = self.inner.borrow_mut(); + termios.c_iflag = self.input_flags.bits(); + termios.c_oflag = self.output_flags.bits(); + termios.c_cflag = self.control_flags.bits(); + termios.c_lflag = self.local_flags.bits(); + termios.c_cc = self.control_chars; + } + self.inner.borrow() + } + + /// Exposes the inner `libc::termios` datastore within `Termios`. + /// + /// This is unsafe because if this is used to modify the inner `libc::termios` struct, it will + /// not automatically update the safe wrapper type around it. In this case it should also be + /// paired with a call to `update_wrapper()` so that the wrapper-type and internal + /// representation stay consistent. + pub(crate) unsafe fn get_libc_termios_mut(&mut self) -> *mut libc::termios { + { + let mut termios = self.inner.borrow_mut(); + termios.c_iflag = self.input_flags.bits(); + termios.c_oflag = self.output_flags.bits(); + termios.c_cflag = self.control_flags.bits(); + termios.c_lflag = self.local_flags.bits(); + termios.c_cc = self.control_chars; + } + self.inner.as_ptr() + } + + /// Updates the wrapper values from the internal `libc::termios` data structure. + pub(crate) fn update_wrapper(&mut self) { + let termios = *self.inner.borrow_mut(); + self.input_flags = InputFlags::from_bits_truncate(termios.c_iflag); + self.output_flags = OutputFlags::from_bits_truncate(termios.c_oflag); + self.control_flags = ControlFlags::from_bits_truncate(termios.c_cflag); + self.local_flags = LocalFlags::from_bits_truncate(termios.c_lflag); + self.control_chars = termios.c_cc; + } +} + +impl From for Termios { + fn from(termios: libc::termios) -> Self { + Termios { + inner: RefCell::new(termios), + input_flags: InputFlags::from_bits_truncate(termios.c_iflag), + output_flags: OutputFlags::from_bits_truncate(termios.c_oflag), + control_flags: ControlFlags::from_bits_truncate(termios.c_cflag), + local_flags: LocalFlags::from_bits_truncate(termios.c_lflag), + control_chars: termios.c_cc, + } + } +} + +impl From for libc::termios { + fn from(termios: Termios) -> Self { + termios.inner.into_inner() + } +} + +libc_enum!{ + /// Baud rates supported by the system. + /// + /// For the BSDs, arbitrary baud rates can be specified by using `u32`s directly instead of this + /// enum. + /// + /// B0 is special and will disable the port. + #[cfg_attr(all(any(target_os = "ios", target_os = "macos"), target_pointer_width = "64"), repr(u64))] + #[cfg_attr(not(all(any(target_os = "ios", target_os = "macos"), target_pointer_width = "64")), repr(u32))] + #[non_exhaustive] + pub enum BaudRate { + B0, + B50, + B75, + B110, + B134, + B150, + B200, + B300, + B600, + B1200, + B1800, + B2400, + B4800, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B7200, + B9600, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B14400, + B19200, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B28800, + B38400, + B57600, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B76800, + B115200, + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B153600, + B230400, + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B307200, + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B460800, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B500000, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B576000, + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B921600, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B1000000, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B1152000, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B1500000, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B2000000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B2500000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B3000000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B3500000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B4000000, + } + impl TryFrom +} + +#[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +impl From for u32 { + fn from(b: BaudRate) -> u32 { + b as u32 + } +} + +// TODO: Add TCSASOFT, which will require treating this as a bitfield. +libc_enum! { + /// Specify when a port configuration change should occur. + /// + /// Used as an argument to `tcsetattr()` + #[repr(i32)] + #[non_exhaustive] + pub enum SetArg { + /// The change will occur immediately + TCSANOW, + /// The change occurs after all output has been written + TCSADRAIN, + /// Same as `TCSADRAIN`, but will also flush the input buffer + TCSAFLUSH, + } +} + +libc_enum! { + /// Specify a combination of the input and output buffers to flush + /// + /// Used as an argument to `tcflush()`. + #[repr(i32)] + #[non_exhaustive] + pub enum FlushArg { + /// Flush data that was received but not read + TCIFLUSH, + /// Flush data written but not transmitted + TCOFLUSH, + /// Flush both received data not read and written data not transmitted + TCIOFLUSH, + } +} + +libc_enum! { + /// Specify how transmission flow should be altered + /// + /// Used as an argument to `tcflow()`. + #[repr(i32)] + #[non_exhaustive] + pub enum FlowArg { + /// Suspend transmission + TCOOFF, + /// Resume transmission + TCOON, + /// Transmit a STOP character, which should disable a connected terminal device + TCIOFF, + /// Transmit a START character, which should re-enable a connected terminal device + TCION, + } +} + +// TODO: Make this usable directly as a slice index. +libc_enum! { + /// Indices into the `termios.c_cc` array for special characters. + #[repr(usize)] + #[non_exhaustive] + pub enum SpecialCharacterIndices { + VDISCARD, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VDSUSP, + VEOF, + VEOL, + VEOL2, + VERASE, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VERASE2, + VINTR, + VKILL, + VLNEXT, + #[cfg(not(any(all(target_os = "linux", target_arch = "sparc64"), + target_os = "illumos", target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VMIN, + VQUIT, + VREPRINT, + VSTART, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VSTATUS, + VSTOP, + VSUSP, + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + VSWTC, + #[cfg(any(target_os = "haiku", target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VSWTCH, + #[cfg(not(any(all(target_os = "linux", target_arch = "sparc64"), + target_os = "illumos", target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VTIME, + VWERASE, + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + VCHECKPT, + } +} + +#[cfg(any(all(target_os = "linux", target_arch = "sparc64"), + target_os = "illumos", target_os = "solaris"))] +impl SpecialCharacterIndices { + pub const VMIN: SpecialCharacterIndices = SpecialCharacterIndices::VEOF; + pub const VTIME: SpecialCharacterIndices = SpecialCharacterIndices::VEOL; +} + +pub use libc::NCCS; +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub use libc::_POSIX_VDISABLE; + +libc_bitflags! { + /// Flags for configuring the input mode of a terminal + pub struct InputFlags: tcflag_t { + IGNBRK; + BRKINT; + IGNPAR; + PARMRK; + INPCK; + ISTRIP; + INLCR; + IGNCR; + ICRNL; + IXON; + IXOFF; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IXANY; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IMAXBEL; + #[cfg(any(target_os = "android", target_os = "linux", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IUTF8; + } +} + +libc_bitflags! { + /// Flags for configuring the output mode of a terminal + pub struct OutputFlags: tcflag_t { + OPOST; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "linux", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + OLCUC; + ONLCR; + OCRNL as tcflag_t; + ONOCR as tcflag_t; + ONLRET as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + OFILL as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + OFDEL as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NL0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NL1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CR0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CR1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CR2 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CR3 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TAB0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TAB1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TAB2 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TAB3 as tcflag_t; + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + XTABS; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BS0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BS1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VT0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VT1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + FF0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + FF1 as tcflag_t; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + OXTABS; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ONOEOT as tcflag_t; + + // Bitmasks for use with OutputFlags to select specific settings + // These should be moved to be a mask once https://github.com/rust-lang-nursery/bitflags/issues/110 + // is resolved. + + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NLDLY as tcflag_t; // FIXME: Datatype needs to be corrected in libc for mac + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CRDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TABDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BSDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VTDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + FFDLY as tcflag_t; + } +} + +libc_bitflags! { + /// Flags for setting the control mode of a terminal + pub struct ControlFlags: tcflag_t { + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CIGNORE; + CS5; + CS6; + CS7; + CS8; + CSTOPB; + CREAD; + PARENB; + PARODD; + HUPCL; + CLOCAL; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CRTSCTS; + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CBAUD; + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "mips"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CMSPAR; + #[cfg(any(target_os = "android", + all(target_os = "linux", + not(any(target_arch = "powerpc", target_arch = "powerpc64")))))] + CIBAUD; + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CBAUDEX; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MDMBUF; + #[cfg(any(target_os = "netbsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CHWFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CCTS_OFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CRTS_IFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CDTR_IFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CDSR_OFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CCAR_OFLOW; + + // Bitmasks for use with ControlFlags to select specific settings + // These should be moved to be a mask once https://github.com/rust-lang-nursery/bitflags/issues/110 + // is resolved. + + CSIZE; + } +} + +libc_bitflags! { + /// Flags for setting any local modes + pub struct LocalFlags: tcflag_t { + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ECHOKE; + ECHOE; + ECHOK; + ECHO; + ECHONL; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ECHOPRT; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ECHOCTL; + ISIG; + ICANON; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ALTWERASE; + IEXTEN; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + EXTPROC; + TOSTOP; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + FLUSHO; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NOKERNINFO; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PENDIN; + NOFLSH; + } +} + +cfg_if!{ + if #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] { + /// Get input baud rate (see + /// [cfgetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetispeed.html)). + /// + /// `cfgetispeed()` extracts the input baud rate from the given `Termios` structure. + pub fn cfgetispeed(termios: &Termios) -> u32 { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetispeed(&*inner_termios) as u32 } + } + + /// Get output baud rate (see + /// [cfgetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetospeed.html)). + /// + /// `cfgetospeed()` extracts the output baud rate from the given `Termios` structure. + pub fn cfgetospeed(termios: &Termios) -> u32 { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetospeed(&*inner_termios) as u32 } + } + + /// Set input baud rate (see + /// [cfsetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetispeed.html)). + /// + /// `cfsetispeed()` sets the intput baud rate in the given `Termios` structure. + pub fn cfsetispeed>(termios: &mut Termios, baud: T) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetispeed(inner_termios, baud.into() as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set output baud rate (see + /// [cfsetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetospeed.html)). + /// + /// `cfsetospeed()` sets the output baud rate in the given termios structure. + pub fn cfsetospeed>(termios: &mut Termios, baud: T) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetospeed(inner_termios, baud.into() as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set both the input and output baud rates (see + /// [termios(3)](https://www.freebsd.org/cgi/man.cgi?query=cfsetspeed)). + /// + /// `cfsetspeed()` sets the input and output baud rate in the given termios structure. Note that + /// this is part of the 4.4BSD standard and not part of POSIX. + pub fn cfsetspeed>(termios: &mut Termios, baud: T) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetspeed(inner_termios, baud.into() as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + } else { + use std::convert::TryInto; + + /// Get input baud rate (see + /// [cfgetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetispeed.html)). + /// + /// `cfgetispeed()` extracts the input baud rate from the given `Termios` structure. + pub fn cfgetispeed(termios: &Termios) -> BaudRate { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetispeed(&*inner_termios) }.try_into().unwrap() + } + + /// Get output baud rate (see + /// [cfgetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetospeed.html)). + /// + /// `cfgetospeed()` extracts the output baud rate from the given `Termios` structure. + pub fn cfgetospeed(termios: &Termios) -> BaudRate { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetospeed(&*inner_termios) }.try_into().unwrap() + } + + /// Set input baud rate (see + /// [cfsetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetispeed.html)). + /// + /// `cfsetispeed()` sets the intput baud rate in the given `Termios` structure. + pub fn cfsetispeed(termios: &mut Termios, baud: BaudRate) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetispeed(inner_termios, baud as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set output baud rate (see + /// [cfsetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetospeed.html)). + /// + /// `cfsetospeed()` sets the output baud rate in the given `Termios` structure. + pub fn cfsetospeed(termios: &mut Termios, baud: BaudRate) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetospeed(inner_termios, baud as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set both the input and output baud rates (see + /// [termios(3)](https://www.freebsd.org/cgi/man.cgi?query=cfsetspeed)). + /// + /// `cfsetspeed()` sets the input and output baud rate in the given `Termios` structure. Note that + /// this is part of the 4.4BSD standard and not part of POSIX. + pub fn cfsetspeed(termios: &mut Termios, baud: BaudRate) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetspeed(inner_termios, baud as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + } +} + +/// Configures the port to something like the "raw" mode of the old Version 7 terminal driver (see +/// [termios(3)](https://man7.org/linux/man-pages/man3/termios.3.html)). +/// +/// `cfmakeraw()` configures the termios structure such that input is available character-by- +/// character, echoing is disabled, and all special input and output processing is disabled. Note +/// that this is a non-standard function, but is available on Linux and BSDs. +pub fn cfmakeraw(termios: &mut Termios) { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + unsafe { + libc::cfmakeraw(inner_termios); + } + termios.update_wrapper(); +} + +/// Configures the port to "sane" mode (like the configuration of a newly created terminal) (see +/// [tcsetattr(3)](https://www.freebsd.org/cgi/man.cgi?query=tcsetattr)). +/// +/// Note that this is a non-standard function, available on FreeBSD. +#[cfg(target_os = "freebsd")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn cfmakesane(termios: &mut Termios) { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + unsafe { + libc::cfmakesane(inner_termios); + } + termios.update_wrapper(); +} + +/// Return the configuration of a port +/// [tcgetattr(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetattr.html)). +/// +/// `tcgetattr()` returns a `Termios` structure with the current configuration for a port. Modifying +/// this structure *will not* reconfigure the port, instead the modifications should be done to +/// the `Termios` structure and then the port should be reconfigured using `tcsetattr()`. +pub fn tcgetattr(fd: RawFd) -> Result { + let mut termios = mem::MaybeUninit::uninit(); + + let res = unsafe { libc::tcgetattr(fd, termios.as_mut_ptr()) }; + + Errno::result(res)?; + + unsafe { Ok(termios.assume_init().into()) } +} + +/// Set the configuration for a terminal (see +/// [tcsetattr(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetattr.html)). +/// +/// `tcsetattr()` reconfigures the given port based on a given `Termios` structure. This change +/// takes affect at a time specified by `actions`. Note that this function may return success if +/// *any* of the parameters were successfully set, not only if all were set successfully. +pub fn tcsetattr(fd: RawFd, actions: SetArg, termios: &Termios) -> Result<()> { + let inner_termios = termios.get_libc_termios(); + Errno::result(unsafe { libc::tcsetattr(fd, actions as c_int, &*inner_termios) }).map(drop) +} + +/// Block until all output data is written (see +/// [tcdrain(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcdrain.html)). +pub fn tcdrain(fd: RawFd) -> Result<()> { + Errno::result(unsafe { libc::tcdrain(fd) }).map(drop) +} + +/// Suspend or resume the transmission or reception of data (see +/// [tcflow(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcflow.html)). +/// +/// `tcflow()` suspends of resumes the transmission or reception of data for the given port +/// depending on the value of `action`. +pub fn tcflow(fd: RawFd, action: FlowArg) -> Result<()> { + Errno::result(unsafe { libc::tcflow(fd, action as c_int) }).map(drop) +} + +/// Discard data in the output or input queue (see +/// [tcflush(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcflush.html)). +/// +/// `tcflush()` will discard data for a terminal port in the input queue, output queue, or both +/// depending on the value of `action`. +pub fn tcflush(fd: RawFd, action: FlushArg) -> Result<()> { + Errno::result(unsafe { libc::tcflush(fd, action as c_int) }).map(drop) +} + +/// Send a break for a specific duration (see +/// [tcsendbreak(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsendbreak.html)). +/// +/// When using asynchronous data transmission `tcsendbreak()` will transmit a continuous stream +/// of zero-valued bits for an implementation-defined duration. +pub fn tcsendbreak(fd: RawFd, duration: c_int) -> Result<()> { + Errno::result(unsafe { libc::tcsendbreak(fd, duration) }).map(drop) +} + +feature! { +#![feature = "process"] +/// Get the session controlled by the given terminal (see +/// [tcgetsid(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetsid.html)). +pub fn tcgetsid(fd: RawFd) -> Result { + let res = unsafe { libc::tcgetsid(fd) }; + + Errno::result(res).map(Pid::from_raw) +} +} + +#[cfg(test)] +mod test { + use super::*; + use std::convert::TryFrom; + + #[test] + fn try_from() { + assert_eq!(Ok(BaudRate::B0), BaudRate::try_from(libc::B0)); + assert!(BaudRate::try_from(999999999).is_err()); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/time.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/time.rs new file mode 100644 index 0000000000000000000000000000000000000000..c29259b24a91bd5019c154837b13710b73fd8f09 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/time.rs @@ -0,0 +1,732 @@ +use std::{cmp, fmt, ops}; +use std::time::Duration; +use std::convert::From; +use libc::{timespec, timeval}; +#[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 +pub use libc::{time_t, suseconds_t}; + +#[cfg(any( + all(feature = "time", any(target_os = "android", target_os = "linux")), + all( + any( + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd" + ), + feature = "time", + feature = "signal" + ) +))] +pub(crate) mod timer { + use crate::sys::time::TimeSpec; + use bitflags::bitflags; + + #[derive(Debug, Clone, Copy)] + pub(crate) struct TimerSpec(libc::itimerspec); + + impl TimerSpec { + pub const fn none() -> Self { + Self(libc::itimerspec { + it_interval: libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + it_value: libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + }) + } + } + + impl AsMut for TimerSpec { + fn as_mut(&mut self) -> &mut libc::itimerspec { + &mut self.0 + } + } + + impl AsRef for TimerSpec { + fn as_ref(&self) -> &libc::itimerspec { + &self.0 + } + } + + impl From for TimerSpec { + fn from(expiration: Expiration) -> TimerSpec { + match expiration { + Expiration::OneShot(t) => TimerSpec(libc::itimerspec { + it_interval: libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + it_value: *t.as_ref(), + }), + Expiration::IntervalDelayed(start, interval) => TimerSpec(libc::itimerspec { + it_interval: *interval.as_ref(), + it_value: *start.as_ref(), + }), + Expiration::Interval(t) => TimerSpec(libc::itimerspec { + it_interval: *t.as_ref(), + it_value: *t.as_ref(), + }), + } + } + } + + /// An enumeration allowing the definition of the expiration time of an alarm, + /// recurring or not. + #[derive(Debug, Clone, Copy, Eq, PartialEq)] + pub enum Expiration { + /// Alarm will trigger once after the time given in `TimeSpec` + OneShot(TimeSpec), + /// Alarm will trigger after a specified delay and then every interval of + /// time. + IntervalDelayed(TimeSpec, TimeSpec), + /// Alarm will trigger every specified interval of time. + Interval(TimeSpec), + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + bitflags! { + /// Flags that are used for arming the timer. + pub struct TimerSetTimeFlags: libc::c_int { + const TFD_TIMER_ABSTIME = libc::TFD_TIMER_ABSTIME; + } + } + #[cfg(any(target_os = "freebsd", target_os = "netbsd", target_os = "dragonfly", target_os = "illumos"))] + bitflags! { + /// Flags that are used for arming the timer. + pub struct TimerSetTimeFlags: libc::c_int { + const TFD_TIMER_ABSTIME = libc::TIMER_ABSTIME; + } + } + + impl From for Expiration { + fn from(timerspec: TimerSpec) -> Expiration { + match timerspec { + TimerSpec(libc::itimerspec { + it_interval: + libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + it_value: ts, + }) => Expiration::OneShot(ts.into()), + TimerSpec(libc::itimerspec { + it_interval: int_ts, + it_value: val_ts, + }) => { + if (int_ts.tv_sec == val_ts.tv_sec) && (int_ts.tv_nsec == val_ts.tv_nsec) { + Expiration::Interval(int_ts.into()) + } else { + Expiration::IntervalDelayed(val_ts.into(), int_ts.into()) + } + } + } + } + } +} + +pub trait TimeValLike: Sized { + #[inline] + fn zero() -> Self { + Self::seconds(0) + } + + #[inline] + fn hours(hours: i64) -> Self { + let secs = hours.checked_mul(SECS_PER_HOUR) + .expect("TimeValLike::hours ouf of bounds"); + Self::seconds(secs) + } + + #[inline] + fn minutes(minutes: i64) -> Self { + let secs = minutes.checked_mul(SECS_PER_MINUTE) + .expect("TimeValLike::minutes out of bounds"); + Self::seconds(secs) + } + + fn seconds(seconds: i64) -> Self; + fn milliseconds(milliseconds: i64) -> Self; + fn microseconds(microseconds: i64) -> Self; + fn nanoseconds(nanoseconds: i64) -> Self; + + #[inline] + fn num_hours(&self) -> i64 { + self.num_seconds() / 3600 + } + + #[inline] + fn num_minutes(&self) -> i64 { + self.num_seconds() / 60 + } + + fn num_seconds(&self) -> i64; + fn num_milliseconds(&self) -> i64; + fn num_microseconds(&self) -> i64; + fn num_nanoseconds(&self) -> i64; +} + +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct TimeSpec(timespec); + +const NANOS_PER_SEC: i64 = 1_000_000_000; +const SECS_PER_MINUTE: i64 = 60; +const SECS_PER_HOUR: i64 = 3600; + +#[cfg(target_pointer_width = "64")] +const TS_MAX_SECONDS: i64 = (::std::i64::MAX / NANOS_PER_SEC) - 1; + +#[cfg(target_pointer_width = "32")] +const TS_MAX_SECONDS: i64 = ::std::isize::MAX as i64; + +const TS_MIN_SECONDS: i64 = -TS_MAX_SECONDS; + +// x32 compatibility +// See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +type timespec_tv_nsec_t = i64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +type timespec_tv_nsec_t = libc::c_long; + +impl From for TimeSpec { + fn from(ts: timespec) -> Self { + Self(ts) + } +} + +impl From for TimeSpec { + fn from(duration: Duration) -> Self { + Self::from_duration(duration) + } +} + +impl From for Duration { + fn from(timespec: TimeSpec) -> Self { + Duration::new(timespec.0.tv_sec as u64, timespec.0.tv_nsec as u32) + } +} + +impl AsRef for TimeSpec { + fn as_ref(&self) -> ×pec { + &self.0 + } +} + +impl AsMut for TimeSpec { + fn as_mut(&mut self) -> &mut timespec { + &mut self.0 + } +} + +impl Ord for TimeSpec { + // The implementation of cmp is simplified by assuming that the struct is + // normalized. That is, tv_nsec must always be within [0, 1_000_000_000) + fn cmp(&self, other: &TimeSpec) -> cmp::Ordering { + if self.tv_sec() == other.tv_sec() { + self.tv_nsec().cmp(&other.tv_nsec()) + } else { + self.tv_sec().cmp(&other.tv_sec()) + } + } +} + +impl PartialOrd for TimeSpec { + fn partial_cmp(&self, other: &TimeSpec) -> Option { + Some(self.cmp(other)) + } +} + +impl TimeValLike for TimeSpec { + #[inline] + fn seconds(seconds: i64) -> TimeSpec { + assert!((TS_MIN_SECONDS..=TS_MAX_SECONDS).contains(&seconds), + "TimeSpec out of bounds; seconds={}", seconds); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec {tv_sec: seconds as time_t, tv_nsec: 0 }) + } + + #[inline] + fn milliseconds(milliseconds: i64) -> TimeSpec { + let nanoseconds = milliseconds.checked_mul(1_000_000) + .expect("TimeSpec::milliseconds out of bounds"); + + TimeSpec::nanoseconds(nanoseconds) + } + + /// Makes a new `TimeSpec` with given number of microseconds. + #[inline] + fn microseconds(microseconds: i64) -> TimeSpec { + let nanoseconds = microseconds.checked_mul(1_000) + .expect("TimeSpec::milliseconds out of bounds"); + + TimeSpec::nanoseconds(nanoseconds) + } + + /// Makes a new `TimeSpec` with given number of nanoseconds. + #[inline] + fn nanoseconds(nanoseconds: i64) -> TimeSpec { + let (secs, nanos) = div_mod_floor_64(nanoseconds, NANOS_PER_SEC); + assert!((TS_MIN_SECONDS..=TS_MAX_SECONDS).contains(&secs), + "TimeSpec out of bounds"); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec {tv_sec: secs as time_t, + tv_nsec: nanos as timespec_tv_nsec_t }) + } + + fn num_seconds(&self) -> i64 { + if self.tv_sec() < 0 && self.tv_nsec() > 0 { + (self.tv_sec() + 1) as i64 + } else { + self.tv_sec() as i64 + } + } + + fn num_milliseconds(&self) -> i64 { + self.num_nanoseconds() / 1_000_000 + } + + fn num_microseconds(&self) -> i64 { + self.num_nanoseconds() / 1_000_000_000 + } + + fn num_nanoseconds(&self) -> i64 { + let secs = self.num_seconds() * 1_000_000_000; + let nsec = self.nanos_mod_sec(); + secs + nsec as i64 + } +} + +impl TimeSpec { + fn nanos_mod_sec(&self) -> timespec_tv_nsec_t { + if self.tv_sec() < 0 && self.tv_nsec() > 0 { + self.tv_nsec() - NANOS_PER_SEC as timespec_tv_nsec_t + } else { + self.tv_nsec() + } + } + + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + pub const fn tv_sec(&self) -> time_t { + self.0.tv_sec + } + + pub const fn tv_nsec(&self) -> timespec_tv_nsec_t { + self.0.tv_nsec + } + + pub const fn from_duration(duration: Duration) -> Self { + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec { + tv_sec: duration.as_secs() as time_t, + tv_nsec: duration.subsec_nanos() as timespec_tv_nsec_t + }) + } + + pub const fn from_timespec(timespec: timespec) -> Self { + Self(timespec) + } +} + +impl ops::Neg for TimeSpec { + type Output = TimeSpec; + + fn neg(self) -> TimeSpec { + TimeSpec::nanoseconds(-self.num_nanoseconds()) + } +} + +impl ops::Add for TimeSpec { + type Output = TimeSpec; + + fn add(self, rhs: TimeSpec) -> TimeSpec { + TimeSpec::nanoseconds( + self.num_nanoseconds() + rhs.num_nanoseconds()) + } +} + +impl ops::Sub for TimeSpec { + type Output = TimeSpec; + + fn sub(self, rhs: TimeSpec) -> TimeSpec { + TimeSpec::nanoseconds( + self.num_nanoseconds() - rhs.num_nanoseconds()) + } +} + +impl ops::Mul for TimeSpec { + type Output = TimeSpec; + + fn mul(self, rhs: i32) -> TimeSpec { + let usec = self.num_nanoseconds().checked_mul(i64::from(rhs)) + .expect("TimeSpec multiply out of bounds"); + + TimeSpec::nanoseconds(usec) + } +} + +impl ops::Div for TimeSpec { + type Output = TimeSpec; + + fn div(self, rhs: i32) -> TimeSpec { + let usec = self.num_nanoseconds() / i64::from(rhs); + TimeSpec::nanoseconds(usec) + } +} + +impl fmt::Display for TimeSpec { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let (abs, sign) = if self.tv_sec() < 0 { + (-*self, "-") + } else { + (*self, "") + }; + + let sec = abs.tv_sec(); + + write!(f, "{}", sign)?; + + if abs.tv_nsec() == 0 { + if abs.tv_sec() == 1 { + write!(f, "{} second", sec)?; + } else { + write!(f, "{} seconds", sec)?; + } + } else if abs.tv_nsec() % 1_000_000 == 0 { + write!(f, "{}.{:03} seconds", sec, abs.tv_nsec() / 1_000_000)?; + } else if abs.tv_nsec() % 1_000 == 0 { + write!(f, "{}.{:06} seconds", sec, abs.tv_nsec() / 1_000)?; + } else { + write!(f, "{}.{:09} seconds", sec, abs.tv_nsec())?; + } + + Ok(()) + } +} + + + +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct TimeVal(timeval); + +const MICROS_PER_SEC: i64 = 1_000_000; + +#[cfg(target_pointer_width = "64")] +const TV_MAX_SECONDS: i64 = (::std::i64::MAX / MICROS_PER_SEC) - 1; + +#[cfg(target_pointer_width = "32")] +const TV_MAX_SECONDS: i64 = ::std::isize::MAX as i64; + +const TV_MIN_SECONDS: i64 = -TV_MAX_SECONDS; + +impl AsRef for TimeVal { + fn as_ref(&self) -> &timeval { + &self.0 + } +} + +impl AsMut for TimeVal { + fn as_mut(&mut self) -> &mut timeval { + &mut self.0 + } +} + +impl Ord for TimeVal { + // The implementation of cmp is simplified by assuming that the struct is + // normalized. That is, tv_usec must always be within [0, 1_000_000) + fn cmp(&self, other: &TimeVal) -> cmp::Ordering { + if self.tv_sec() == other.tv_sec() { + self.tv_usec().cmp(&other.tv_usec()) + } else { + self.tv_sec().cmp(&other.tv_sec()) + } + } +} + +impl PartialOrd for TimeVal { + fn partial_cmp(&self, other: &TimeVal) -> Option { + Some(self.cmp(other)) + } +} + +impl TimeValLike for TimeVal { + #[inline] + fn seconds(seconds: i64) -> TimeVal { + assert!((TV_MIN_SECONDS..=TV_MAX_SECONDS).contains(&seconds), + "TimeVal out of bounds; seconds={}", seconds); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval {tv_sec: seconds as time_t, tv_usec: 0 }) + } + + #[inline] + fn milliseconds(milliseconds: i64) -> TimeVal { + let microseconds = milliseconds.checked_mul(1_000) + .expect("TimeVal::milliseconds out of bounds"); + + TimeVal::microseconds(microseconds) + } + + /// Makes a new `TimeVal` with given number of microseconds. + #[inline] + fn microseconds(microseconds: i64) -> TimeVal { + let (secs, micros) = div_mod_floor_64(microseconds, MICROS_PER_SEC); + assert!((TV_MIN_SECONDS..=TV_MAX_SECONDS).contains(&secs), + "TimeVal out of bounds"); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval {tv_sec: secs as time_t, + tv_usec: micros as suseconds_t }) + } + + /// Makes a new `TimeVal` with given number of nanoseconds. Some precision + /// will be lost + #[inline] + fn nanoseconds(nanoseconds: i64) -> TimeVal { + let microseconds = nanoseconds / 1000; + let (secs, micros) = div_mod_floor_64(microseconds, MICROS_PER_SEC); + assert!((TV_MIN_SECONDS..=TV_MAX_SECONDS).contains(&secs), + "TimeVal out of bounds"); + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval {tv_sec: secs as time_t, + tv_usec: micros as suseconds_t }) + } + + fn num_seconds(&self) -> i64 { + if self.tv_sec() < 0 && self.tv_usec() > 0 { + (self.tv_sec() + 1) as i64 + } else { + self.tv_sec() as i64 + } + } + + fn num_milliseconds(&self) -> i64 { + self.num_microseconds() / 1_000 + } + + fn num_microseconds(&self) -> i64 { + let secs = self.num_seconds() * 1_000_000; + let usec = self.micros_mod_sec(); + secs + usec as i64 + } + + fn num_nanoseconds(&self) -> i64 { + self.num_microseconds() * 1_000 + } +} + +impl TimeVal { + fn micros_mod_sec(&self) -> suseconds_t { + if self.tv_sec() < 0 && self.tv_usec() > 0 { + self.tv_usec() - MICROS_PER_SEC as suseconds_t + } else { + self.tv_usec() + } + } + + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + pub const fn tv_sec(&self) -> time_t { + self.0.tv_sec + } + + pub const fn tv_usec(&self) -> suseconds_t { + self.0.tv_usec + } +} + +impl ops::Neg for TimeVal { + type Output = TimeVal; + + fn neg(self) -> TimeVal { + TimeVal::microseconds(-self.num_microseconds()) + } +} + +impl ops::Add for TimeVal { + type Output = TimeVal; + + fn add(self, rhs: TimeVal) -> TimeVal { + TimeVal::microseconds( + self.num_microseconds() + rhs.num_microseconds()) + } +} + +impl ops::Sub for TimeVal { + type Output = TimeVal; + + fn sub(self, rhs: TimeVal) -> TimeVal { + TimeVal::microseconds( + self.num_microseconds() - rhs.num_microseconds()) + } +} + +impl ops::Mul for TimeVal { + type Output = TimeVal; + + fn mul(self, rhs: i32) -> TimeVal { + let usec = self.num_microseconds().checked_mul(i64::from(rhs)) + .expect("TimeVal multiply out of bounds"); + + TimeVal::microseconds(usec) + } +} + +impl ops::Div for TimeVal { + type Output = TimeVal; + + fn div(self, rhs: i32) -> TimeVal { + let usec = self.num_microseconds() / i64::from(rhs); + TimeVal::microseconds(usec) + } +} + +impl fmt::Display for TimeVal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let (abs, sign) = if self.tv_sec() < 0 { + (-*self, "-") + } else { + (*self, "") + }; + + let sec = abs.tv_sec(); + + write!(f, "{}", sign)?; + + if abs.tv_usec() == 0 { + if abs.tv_sec() == 1 { + write!(f, "{} second", sec)?; + } else { + write!(f, "{} seconds", sec)?; + } + } else if abs.tv_usec() % 1000 == 0 { + write!(f, "{}.{:03} seconds", sec, abs.tv_usec() / 1000)?; + } else { + write!(f, "{}.{:06} seconds", sec, abs.tv_usec())?; + } + + Ok(()) + } +} + +impl From for TimeVal { + fn from(tv: timeval) -> Self { + TimeVal(tv) + } +} + +#[inline] +fn div_mod_floor_64(this: i64, other: i64) -> (i64, i64) { + (div_floor_64(this, other), mod_floor_64(this, other)) +} + +#[inline] +fn div_floor_64(this: i64, other: i64) -> i64 { + match div_rem_64(this, other) { + (d, r) if (r > 0 && other < 0) + || (r < 0 && other > 0) => d - 1, + (d, _) => d, + } +} + +#[inline] +fn mod_floor_64(this: i64, other: i64) -> i64 { + match this % other { + r if (r > 0 && other < 0) + || (r < 0 && other > 0) => r + other, + r => r, + } +} + +#[inline] +fn div_rem_64(this: i64, other: i64) -> (i64, i64) { + (this / other, this % other) +} + +#[cfg(test)] +mod test { + use super::{TimeSpec, TimeVal, TimeValLike}; + use std::time::Duration; + + #[test] + pub fn test_timespec() { + assert!(TimeSpec::seconds(1) != TimeSpec::zero()); + assert_eq!(TimeSpec::seconds(1) + TimeSpec::seconds(2), + TimeSpec::seconds(3)); + assert_eq!(TimeSpec::minutes(3) + TimeSpec::seconds(2), + TimeSpec::seconds(182)); + } + + #[test] + pub fn test_timespec_from() { + let duration = Duration::new(123, 123_456_789); + let timespec = TimeSpec::nanoseconds(123_123_456_789); + + assert_eq!(TimeSpec::from(duration), timespec); + assert_eq!(Duration::from(timespec), duration); + } + + #[test] + pub fn test_timespec_neg() { + let a = TimeSpec::seconds(1) + TimeSpec::nanoseconds(123); + let b = TimeSpec::seconds(-1) + TimeSpec::nanoseconds(-123); + + assert_eq!(a, -b); + } + + #[test] + pub fn test_timespec_ord() { + assert!(TimeSpec::seconds(1) == TimeSpec::nanoseconds(1_000_000_000)); + assert!(TimeSpec::seconds(1) < TimeSpec::nanoseconds(1_000_000_001)); + assert!(TimeSpec::seconds(1) > TimeSpec::nanoseconds(999_999_999)); + assert!(TimeSpec::seconds(-1) < TimeSpec::nanoseconds(-999_999_999)); + assert!(TimeSpec::seconds(-1) > TimeSpec::nanoseconds(-1_000_000_001)); + } + + #[test] + pub fn test_timespec_fmt() { + assert_eq!(TimeSpec::zero().to_string(), "0 seconds"); + assert_eq!(TimeSpec::seconds(42).to_string(), "42 seconds"); + assert_eq!(TimeSpec::milliseconds(42).to_string(), "0.042 seconds"); + assert_eq!(TimeSpec::microseconds(42).to_string(), "0.000042 seconds"); + assert_eq!(TimeSpec::nanoseconds(42).to_string(), "0.000000042 seconds"); + assert_eq!(TimeSpec::seconds(-86401).to_string(), "-86401 seconds"); + } + + #[test] + pub fn test_timeval() { + assert!(TimeVal::seconds(1) != TimeVal::zero()); + assert_eq!(TimeVal::seconds(1) + TimeVal::seconds(2), + TimeVal::seconds(3)); + assert_eq!(TimeVal::minutes(3) + TimeVal::seconds(2), + TimeVal::seconds(182)); + } + + #[test] + pub fn test_timeval_ord() { + assert!(TimeVal::seconds(1) == TimeVal::microseconds(1_000_000)); + assert!(TimeVal::seconds(1) < TimeVal::microseconds(1_000_001)); + assert!(TimeVal::seconds(1) > TimeVal::microseconds(999_999)); + assert!(TimeVal::seconds(-1) < TimeVal::microseconds(-999_999)); + assert!(TimeVal::seconds(-1) > TimeVal::microseconds(-1_000_001)); + } + + #[test] + pub fn test_timeval_neg() { + let a = TimeVal::seconds(1) + TimeVal::microseconds(123); + let b = TimeVal::seconds(-1) + TimeVal::microseconds(-123); + + assert_eq!(a, -b); + } + + #[test] + pub fn test_timeval_fmt() { + assert_eq!(TimeVal::zero().to_string(), "0 seconds"); + assert_eq!(TimeVal::seconds(42).to_string(), "42 seconds"); + assert_eq!(TimeVal::milliseconds(42).to_string(), "0.042 seconds"); + assert_eq!(TimeVal::microseconds(42).to_string(), "0.000042 seconds"); + assert_eq!(TimeVal::nanoseconds(1402).to_string(), "0.000001 seconds"); + assert_eq!(TimeVal::seconds(-86401).to_string(), "-86401 seconds"); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/timer.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/timer.rs new file mode 100644 index 0000000000000000000000000000000000000000..349346bb10797572ba161b4464d120f6d85aed3e --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/timer.rs @@ -0,0 +1,175 @@ +//! Timer API via signals. +//! +//! Timer is a POSIX API to create timers and get expiration notifications +//! through queued Unix signals, for the current process. This is similar to +//! Linux's timerfd mechanism, except that API is specific to Linux and makes +//! use of file polling. +//! +//! For more documentation, please read [timer_create](https://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_create.html). +//! +//! # Examples +//! +//! Create an interval timer that signals SIGALARM every 250 milliseconds. +//! +//! ```no_run +//! use nix::sys::signal::{self, SigEvent, SigHandler, SigevNotify, Signal}; +//! use nix::sys::timer::{Expiration, Timer, TimerSetTimeFlags}; +//! use nix::time::ClockId; +//! use std::convert::TryFrom; +//! use std::sync::atomic::{AtomicU64, Ordering}; +//! use std::thread::yield_now; +//! use std::time::Duration; +//! +//! const SIG: Signal = Signal::SIGALRM; +//! static ALARMS: AtomicU64 = AtomicU64::new(0); +//! +//! extern "C" fn handle_alarm(signal: libc::c_int) { +//! let signal = Signal::try_from(signal).unwrap(); +//! if signal == SIG { +//! ALARMS.fetch_add(1, Ordering::Relaxed); +//! } +//! } +//! +//! fn main() { +//! let clockid = ClockId::CLOCK_MONOTONIC; +//! let sigevent = SigEvent::new(SigevNotify::SigevSignal { +//! signal: SIG, +//! si_value: 0, +//! }); +//! +//! let mut timer = Timer::new(clockid, sigevent).unwrap(); +//! let expiration = Expiration::Interval(Duration::from_millis(250).into()); +//! let flags = TimerSetTimeFlags::empty(); +//! timer.set(expiration, flags).expect("could not set timer"); +//! +//! let handler = SigHandler::Handler(handle_alarm); +//! unsafe { signal::signal(SIG, handler) }.unwrap(); +//! +//! loop { +//! let alarms = ALARMS.load(Ordering::Relaxed); +//! if alarms >= 10 { +//! println!("total alarms handled: {}", alarms); +//! break; +//! } +//! yield_now() +//! } +//! } +//! ``` +use crate::sys::signal::SigEvent; +use crate::sys::time::timer::TimerSpec; +pub use crate::sys::time::timer::{Expiration, TimerSetTimeFlags}; +use crate::time::ClockId; +use crate::{errno::Errno, Result}; +use core::mem; + +/// A Unix signal per-process timer. +#[derive(Debug)] +#[repr(transparent)] +pub struct Timer(libc::timer_t); + +impl Timer { + /// Creates a new timer based on the clock defined by `clockid`. The details + /// of the signal and its handler are defined by the passed `sigevent`. + pub fn new(clockid: ClockId, mut sigevent: SigEvent) -> Result { + let mut timer_id: mem::MaybeUninit = mem::MaybeUninit::uninit(); + Errno::result(unsafe { + libc::timer_create( + clockid.as_raw(), + sigevent.as_mut_ptr(), + timer_id.as_mut_ptr(), + ) + }) + .map(|_| { + // SAFETY: libc::timer_create is responsible for initializing + // timer_id. + unsafe { Self(timer_id.assume_init()) } + }) + } + + /// Set a new alarm on the timer. + /// + /// # Types of alarm + /// + /// There are 3 types of alarms you can set: + /// + /// - one shot: the alarm will trigger once after the specified amount of + /// time. + /// Example: I want an alarm to go off in 60s and then disable itself. + /// + /// - interval: the alarm will trigger every specified interval of time. + /// Example: I want an alarm to go off every 60s. The alarm will first + /// go off 60s after I set it and every 60s after that. The alarm will + /// not disable itself. + /// + /// - interval delayed: the alarm will trigger after a certain amount of + /// time and then trigger at a specified interval. + /// Example: I want an alarm to go off every 60s but only start in 1h. + /// The alarm will first trigger 1h after I set it and then every 60s + /// after that. The alarm will not disable itself. + /// + /// # Relative vs absolute alarm + /// + /// If you do not set any `TimerSetTimeFlags`, then the `TimeSpec` you pass + /// to the `Expiration` you want is relative. If however you want an alarm + /// to go off at a certain point in time, you can set `TFD_TIMER_ABSTIME`. + /// Then the one shot TimeSpec and the delay TimeSpec of the delayed + /// interval are going to be interpreted as absolute. + /// + /// # Disabling alarms + /// + /// Note: Only one alarm can be set for any given timer. Setting a new alarm + /// actually removes the previous one. + /// + /// Note: Setting a one shot alarm with a 0s TimeSpec disable the alarm + /// altogether. + pub fn set(&mut self, expiration: Expiration, flags: TimerSetTimeFlags) -> Result<()> { + let timerspec: TimerSpec = expiration.into(); + Errno::result(unsafe { + libc::timer_settime( + self.0, + flags.bits(), + timerspec.as_ref(), + core::ptr::null_mut(), + ) + }) + .map(drop) + } + + /// Get the parameters for the alarm currently set, if any. + pub fn get(&self) -> Result> { + let mut timerspec = TimerSpec::none(); + Errno::result(unsafe { libc::timer_gettime(self.0, timerspec.as_mut()) }).map(|_| { + if timerspec.as_ref().it_interval.tv_sec == 0 + && timerspec.as_ref().it_interval.tv_nsec == 0 + && timerspec.as_ref().it_value.tv_sec == 0 + && timerspec.as_ref().it_value.tv_nsec == 0 + { + None + } else { + Some(timerspec.into()) + } + }) + } + + /// Return the number of timers that have overrun + /// + /// Each timer is able to queue one signal to the process at a time, meaning + /// if the signal is not handled before the next expiration the timer has + /// 'overrun'. This function returns how many times that has happened to + /// this timer, up to `libc::DELAYTIMER_MAX`. If more than the maximum + /// number of overruns have happened the return is capped to the maximum. + pub fn overruns(&self) -> i32 { + unsafe { libc::timer_getoverrun(self.0) } + } +} + +impl Drop for Timer { + fn drop(&mut self) { + if !std::thread::panicking() { + let result = Errno::result(unsafe { libc::timer_delete(self.0) }); + if let Err(Errno::EINVAL) = result { + panic!("close of Timer encountered EINVAL"); + } + } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/timerfd.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/timerfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..18acbae30b1593808b2bca09a69b60ccaf270e98 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/timerfd.rs @@ -0,0 +1,201 @@ +//! Timer API via file descriptors. +//! +//! Timer FD is a Linux-only API to create timers and get expiration +//! notifications through file descriptors. +//! +//! For more documentation, please read [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html). +//! +//! # Examples +//! +//! Create a new one-shot timer that expires after 1 second. +//! ``` +//! # use std::os::unix::io::AsRawFd; +//! # use nix::sys::timerfd::{TimerFd, ClockId, TimerFlags, TimerSetTimeFlags, +//! # Expiration}; +//! # use nix::sys::time::{TimeSpec, TimeValLike}; +//! # use nix::unistd::read; +//! # +//! // We create a new monotonic timer. +//! let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()) +//! .unwrap(); +//! +//! // We set a new one-shot timer in 1 seconds. +//! timer.set( +//! Expiration::OneShot(TimeSpec::seconds(1)), +//! TimerSetTimeFlags::empty() +//! ).unwrap(); +//! +//! // We wait for the timer to expire. +//! timer.wait().unwrap(); +//! ``` +use crate::sys::time::timer::TimerSpec; +pub use crate::sys::time::timer::{Expiration, TimerSetTimeFlags}; +use crate::unistd::read; +use crate::{errno::Errno, Result}; +use libc::c_int; +use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; + +/// A timerfd instance. This is also a file descriptor, you can feed it to +/// other interfaces consuming file descriptors, epoll for example. +#[derive(Debug)] +pub struct TimerFd { + fd: RawFd, +} + +impl AsRawFd for TimerFd { + fn as_raw_fd(&self) -> RawFd { + self.fd + } +} + +impl FromRawFd for TimerFd { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + TimerFd { fd } + } +} + +libc_enum! { + /// The type of the clock used to mark the progress of the timer. For more + /// details on each kind of clock, please refer to [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html). + #[repr(i32)] + #[non_exhaustive] + pub enum ClockId { + /// A settable system-wide real-time clock. + CLOCK_REALTIME, + /// A non-settable monotonically increasing clock. + /// + /// Does not change after system startup. + /// Does not measure time while the system is suspended. + CLOCK_MONOTONIC, + /// Like `CLOCK_MONOTONIC`, except that `CLOCK_BOOTTIME` includes the time + /// that the system was suspended. + CLOCK_BOOTTIME, + /// Like `CLOCK_REALTIME`, but will wake the system if it is suspended. + CLOCK_REALTIME_ALARM, + /// Like `CLOCK_BOOTTIME`, but will wake the system if it is suspended. + CLOCK_BOOTTIME_ALARM, + } +} + +libc_bitflags! { + /// Additional flags to change the behaviour of the file descriptor at the + /// time of creation. + pub struct TimerFlags: c_int { + /// Set the `O_NONBLOCK` flag on the open file description referred to by the new file descriptor. + TFD_NONBLOCK; + /// Set the `FD_CLOEXEC` flag on the file descriptor. + TFD_CLOEXEC; + } +} + +impl TimerFd { + /// Creates a new timer based on the clock defined by `clockid`. The + /// underlying fd can be assigned specific flags with `flags` (CLOEXEC, + /// NONBLOCK). The underlying fd will be closed on drop. + pub fn new(clockid: ClockId, flags: TimerFlags) -> Result { + Errno::result(unsafe { libc::timerfd_create(clockid as i32, flags.bits()) }) + .map(|fd| Self { fd }) + } + + /// Sets a new alarm on the timer. + /// + /// # Types of alarm + /// + /// There are 3 types of alarms you can set: + /// + /// - one shot: the alarm will trigger once after the specified amount of + /// time. + /// Example: I want an alarm to go off in 60s and then disable itself. + /// + /// - interval: the alarm will trigger every specified interval of time. + /// Example: I want an alarm to go off every 60s. The alarm will first + /// go off 60s after I set it and every 60s after that. The alarm will + /// not disable itself. + /// + /// - interval delayed: the alarm will trigger after a certain amount of + /// time and then trigger at a specified interval. + /// Example: I want an alarm to go off every 60s but only start in 1h. + /// The alarm will first trigger 1h after I set it and then every 60s + /// after that. The alarm will not disable itself. + /// + /// # Relative vs absolute alarm + /// + /// If you do not set any `TimerSetTimeFlags`, then the `TimeSpec` you pass + /// to the `Expiration` you want is relative. If however you want an alarm + /// to go off at a certain point in time, you can set `TFD_TIMER_ABSTIME`. + /// Then the one shot TimeSpec and the delay TimeSpec of the delayed + /// interval are going to be interpreted as absolute. + /// + /// # Disabling alarms + /// + /// Note: Only one alarm can be set for any given timer. Setting a new alarm + /// actually removes the previous one. + /// + /// Note: Setting a one shot alarm with a 0s TimeSpec disables the alarm + /// altogether. + pub fn set(&self, expiration: Expiration, flags: TimerSetTimeFlags) -> Result<()> { + let timerspec: TimerSpec = expiration.into(); + Errno::result(unsafe { + libc::timerfd_settime( + self.fd, + flags.bits(), + timerspec.as_ref(), + std::ptr::null_mut(), + ) + }) + .map(drop) + } + + /// Get the parameters for the alarm currently set, if any. + pub fn get(&self) -> Result> { + let mut timerspec = TimerSpec::none(); + Errno::result(unsafe { libc::timerfd_gettime(self.fd, timerspec.as_mut()) }).map(|_| { + if timerspec.as_ref().it_interval.tv_sec == 0 + && timerspec.as_ref().it_interval.tv_nsec == 0 + && timerspec.as_ref().it_value.tv_sec == 0 + && timerspec.as_ref().it_value.tv_nsec == 0 + { + None + } else { + Some(timerspec.into()) + } + }) + } + + /// Remove the alarm if any is set. + pub fn unset(&self) -> Result<()> { + Errno::result(unsafe { + libc::timerfd_settime( + self.fd, + TimerSetTimeFlags::empty().bits(), + TimerSpec::none().as_ref(), + std::ptr::null_mut(), + ) + }) + .map(drop) + } + + /// Wait for the configured alarm to expire. + /// + /// Note: If the alarm is unset, then you will wait forever. + pub fn wait(&self) -> Result<()> { + while let Err(e) = read(self.fd, &mut [0u8; 8]) { + if e != Errno::EINTR { + return Err(e); + } + } + + Ok(()) + } +} + +impl Drop for TimerFd { + fn drop(&mut self) { + if !std::thread::panicking() { + let result = Errno::result(unsafe { libc::close(self.fd) }); + if let Err(Errno::EBADF) = result { + panic!("close of TimerFd encountered EBADF"); + } + } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/uio.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/uio.rs new file mode 100644 index 0000000000000000000000000000000000000000..ecad80960479c6aed40ceb2502e31035475440b8 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/uio.rs @@ -0,0 +1,270 @@ +//! Vectored I/O + +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_int, c_void, size_t, off_t}; +use std::io::{IoSlice, IoSliceMut}; +use std::marker::PhantomData; +use std::os::unix::io::RawFd; + +/// Low-level vectored write to a raw file descriptor +/// +/// See also [writev(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/writev.html) +pub fn writev(fd: RawFd, iov: &[IoSlice<'_>]) -> Result { + // SAFETY: to quote the documentation for `IoSlice`: + // + // [IoSlice] is semantically a wrapper around a &[u8], but is + // guaranteed to be ABI compatible with the iovec type on Unix + // platforms. + // + // Because it is ABI compatible, a pointer cast here is valid + let res = unsafe { libc::writev(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int) }; + + Errno::result(res).map(|r| r as usize) +} + +/// Low-level vectored read from a raw file descriptor +/// +/// See also [readv(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/readv.html) +pub fn readv(fd: RawFd, iov: &mut [IoSliceMut<'_>]) -> Result { + // SAFETY: same as in writev(), IoSliceMut is ABI-compatible with iovec + let res = unsafe { libc::readv(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int) }; + + Errno::result(res).map(|r| r as usize) +} + +/// Write to `fd` at `offset` from buffers in `iov`. +/// +/// Buffers in `iov` will be written in order until all buffers have been written +/// or an error occurs. The file offset is not changed. +/// +/// See also: [`writev`](fn.writev.html) and [`pwrite`](fn.pwrite.html) +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn pwritev(fd: RawFd, iov: &[IoSlice<'_>], + offset: off_t) -> Result { + + #[cfg(target_env = "uclibc")] + let offset = offset as libc::off64_t; // uclibc doesn't use off_t + + // SAFETY: same as in writev() + let res = unsafe { + libc::pwritev(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int, offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Read from `fd` at `offset` filling buffers in `iov`. +/// +/// Buffers in `iov` will be filled in order until all buffers have been filled, +/// no more bytes are available, or an error occurs. The file offset is not +/// changed. +/// +/// See also: [`readv`](fn.readv.html) and [`pread`](fn.pread.html) +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn preadv(fd: RawFd, iov: &mut [IoSliceMut<'_>], + offset: off_t) -> Result { + #[cfg(target_env = "uclibc")] + let offset = offset as libc::off64_t; // uclibc doesn't use off_t + + // SAFETY: same as in readv() + let res = unsafe { + libc::preadv(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int, offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Low-level write to a file, with specified offset. +/// +/// See also [pwrite(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html) +// TODO: move to unistd +pub fn pwrite(fd: RawFd, buf: &[u8], offset: off_t) -> Result { + let res = unsafe { + libc::pwrite(fd, buf.as_ptr() as *const c_void, buf.len() as size_t, + offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Low-level read from a file, with specified offset. +/// +/// See also [pread(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html) +// TODO: move to unistd +pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result{ + let res = unsafe { + libc::pread(fd, buf.as_mut_ptr() as *mut c_void, buf.len() as size_t, + offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// A slice of memory in a remote process, starting at address `base` +/// and consisting of `len` bytes. +/// +/// This is the same underlying C structure as `IoSlice`, +/// except that it refers to memory in some other process, and is +/// therefore not represented in Rust by an actual slice as `IoSlice` is. It +/// is used with [`process_vm_readv`](fn.process_vm_readv.html) +/// and [`process_vm_writev`](fn.process_vm_writev.html). +#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct RemoteIoVec { + /// The starting address of this slice (`iov_base`). + pub base: usize, + /// The number of bytes in this slice (`iov_len`). + pub len: usize, +} + +/// A vector of buffers. +/// +/// Vectored I/O methods like [`writev`] and [`readv`] use this structure for +/// both reading and writing. Each `IoVec` specifies the base address and +/// length of an area in memory. +#[deprecated( + since = "0.24.0", + note = "`IoVec` is no longer used in the public interface, use `IoSlice` or `IoSliceMut` instead" +)] +#[repr(transparent)] +#[allow(renamed_and_removed_lints)] +#[allow(clippy::unknown_clippy_lints)] +// Clippy false positive: https://github.com/rust-lang/rust-clippy/issues/8867 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct IoVec(pub(crate) libc::iovec, PhantomData); + +#[allow(deprecated)] +impl IoVec { + /// View the `IoVec` as a Rust slice. + #[deprecated( + since = "0.24.0", + note = "Use the `Deref` impl of `IoSlice` or `IoSliceMut` instead" + )] + #[inline] + pub fn as_slice(&self) -> &[u8] { + use std::slice; + + unsafe { + slice::from_raw_parts( + self.0.iov_base as *const u8, + self.0.iov_len as usize) + } + } +} + +#[allow(deprecated)] +impl<'a> IoVec<&'a [u8]> { + /// Create an `IoVec` from a Rust slice. + #[deprecated( + since = "0.24.0", + note = "Use `IoSlice::new` instead" + )] + pub fn from_slice(buf: &'a [u8]) -> IoVec<&'a [u8]> { + IoVec(libc::iovec { + iov_base: buf.as_ptr() as *mut c_void, + iov_len: buf.len() as size_t, + }, PhantomData) + } +} + +#[allow(deprecated)] +impl<'a> IoVec<&'a mut [u8]> { + /// Create an `IoVec` from a mutable Rust slice. + #[deprecated( + since = "0.24.0", + note = "Use `IoSliceMut::new` instead" + )] + pub fn from_mut_slice(buf: &'a mut [u8]) -> IoVec<&'a mut [u8]> { + IoVec(libc::iovec { + iov_base: buf.as_ptr() as *mut c_void, + iov_len: buf.len() as size_t, + }, PhantomData) + } +} + +// The only reason IoVec isn't automatically Send+Sync is because libc::iovec +// contains raw pointers. +#[allow(deprecated)] +unsafe impl Send for IoVec where T: Send {} +#[allow(deprecated)] +unsafe impl Sync for IoVec where T: Sync {} + +feature! { +#![feature = "process"] + +/// Write data directly to another process's virtual memory +/// (see [`process_vm_writev`(2)]). +/// +/// `local_iov` is a list of [`IoSlice`]s containing the data to be written, +/// and `remote_iov` is a list of [`RemoteIoVec`]s identifying where the +/// data should be written in the target process. On success, returns the +/// number of bytes written, which will always be a whole +/// number of `remote_iov` chunks. +/// +/// This requires the same permissions as debugging the process using +/// [ptrace]: you must either be a privileged process (with +/// `CAP_SYS_PTRACE`), or you must be running as the same user as the +/// target process and the OS must have unprivileged debugging enabled. +/// +/// This function is only available on Linux and Android(SDK23+). +/// +/// [`process_vm_writev`(2)]: https://man7.org/linux/man-pages/man2/process_vm_writev.2.html +/// [ptrace]: ../ptrace/index.html +/// [`IoSlice`]: https://doc.rust-lang.org/std/io/struct.IoSlice.html +/// [`RemoteIoVec`]: struct.RemoteIoVec.html +#[cfg(all(any(target_os = "linux", target_os = "android"), not(target_env = "uclibc")))] +pub fn process_vm_writev( + pid: crate::unistd::Pid, + local_iov: &[IoSlice<'_>], + remote_iov: &[RemoteIoVec]) -> Result +{ + let res = unsafe { + libc::process_vm_writev(pid.into(), + local_iov.as_ptr() as *const libc::iovec, local_iov.len() as libc::c_ulong, + remote_iov.as_ptr() as *const libc::iovec, remote_iov.len() as libc::c_ulong, 0) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Read data directly from another process's virtual memory +/// (see [`process_vm_readv`(2)]). +/// +/// `local_iov` is a list of [`IoSliceMut`]s containing the buffer to copy +/// data into, and `remote_iov` is a list of [`RemoteIoVec`]s identifying +/// where the source data is in the target process. On success, +/// returns the number of bytes written, which will always be a whole +/// number of `remote_iov` chunks. +/// +/// This requires the same permissions as debugging the process using +/// [`ptrace`]: you must either be a privileged process (with +/// `CAP_SYS_PTRACE`), or you must be running as the same user as the +/// target process and the OS must have unprivileged debugging enabled. +/// +/// This function is only available on Linux and Android(SDK23+). +/// +/// [`process_vm_readv`(2)]: https://man7.org/linux/man-pages/man2/process_vm_readv.2.html +/// [`ptrace`]: ../ptrace/index.html +/// [`IoSliceMut`]: https://doc.rust-lang.org/std/io/struct.IoSliceMut.html +/// [`RemoteIoVec`]: struct.RemoteIoVec.html +#[cfg(all(any(target_os = "linux", target_os = "android"), not(target_env = "uclibc")))] +pub fn process_vm_readv( + pid: crate::unistd::Pid, + local_iov: &mut [IoSliceMut<'_>], + remote_iov: &[RemoteIoVec]) -> Result +{ + let res = unsafe { + libc::process_vm_readv(pid.into(), + local_iov.as_ptr() as *const libc::iovec, local_iov.len() as libc::c_ulong, + remote_iov.as_ptr() as *const libc::iovec, remote_iov.len() as libc::c_ulong, 0) + }; + + Errno::result(res).map(|r| r as usize) +} +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/utsname.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/utsname.rs new file mode 100644 index 0000000000000000000000000000000000000000..5bd3a539aed3bf482e065ed458d9c9c3e8f53f00 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/utsname.rs @@ -0,0 +1,77 @@ +//! Get system identification +use std::mem; +use std::os::unix::ffi::OsStrExt; +use std::ffi::OsStr; +use libc::c_char; +use crate::{Errno, Result}; + +/// Describes the running system. Return type of [`uname`]. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct UtsName(libc::utsname); + +impl UtsName { + /// Name of the operating system implementation. + pub fn sysname(&self) -> &OsStr { + cast_and_trim(&self.0.sysname) + } + + /// Network name of this machine. + pub fn nodename(&self) -> &OsStr { + cast_and_trim(&self.0.nodename) + } + + /// Release level of the operating system. + pub fn release(&self) -> &OsStr { + cast_and_trim(&self.0.release) + } + + /// Version level of the operating system. + pub fn version(&self) -> &OsStr { + cast_and_trim(&self.0.version) + } + + /// Machine hardware platform. + pub fn machine(&self) -> &OsStr { + cast_and_trim(&self.0.machine) + } +} + +/// Get system identification +pub fn uname() -> Result { + unsafe { + let mut ret = mem::MaybeUninit::zeroed(); + Errno::result(libc::uname(ret.as_mut_ptr()))?; + Ok(UtsName(ret.assume_init())) + } +} + +fn cast_and_trim(slice: &[c_char]) -> &OsStr { + let length = slice.iter().position(|&byte| byte == 0).unwrap_or(slice.len()); + let bytes = unsafe { + std::slice::from_raw_parts(slice.as_ptr().cast(), length) + }; + + OsStr::from_bytes(bytes) +} + +#[cfg(test)] +mod test { + #[cfg(target_os = "linux")] + #[test] + pub fn test_uname_linux() { + assert_eq!(super::uname().unwrap().sysname(), "Linux"); + } + + #[cfg(any(target_os = "macos", target_os = "ios"))] + #[test] + pub fn test_uname_darwin() { + assert_eq!(super::uname().unwrap().sysname(), "Darwin"); + } + + #[cfg(target_os = "freebsd")] + #[test] + pub fn test_uname_freebsd() { + assert_eq!(super::uname().unwrap().sysname(), "FreeBSD"); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/sys/wait.rs b/bash-5.1/vendor/nix-0.24.2/src/sys/wait.rs new file mode 100644 index 0000000000000000000000000000000000000000..5fb2075fd9573c91be5c407644aa17d46b655584 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/sys/wait.rs @@ -0,0 +1,381 @@ +//! Wait for a process to change status +use crate::errno::Errno; +use crate::sys::signal::Signal; +use crate::unistd::Pid; +use crate::Result; +use cfg_if::cfg_if; +use libc::{self, c_int}; +use std::convert::TryFrom; +#[cfg(any( + target_os = "android", + all(target_os = "linux", not(target_env = "uclibc")), +))] +use std::os::unix::io::RawFd; + +libc_bitflags!( + /// Controls the behavior of [`waitpid`]. + pub struct WaitPidFlag: c_int { + /// Do not block when there are no processes wishing to report status. + WNOHANG; + /// Report the status of selected processes which are stopped due to a + /// [`SIGTTIN`](crate::sys::signal::Signal::SIGTTIN), + /// [`SIGTTOU`](crate::sys::signal::Signal::SIGTTOU), + /// [`SIGTSTP`](crate::sys::signal::Signal::SIGTSTP), or + /// [`SIGSTOP`](crate::sys::signal::Signal::SIGSTOP) signal. + WUNTRACED; + /// Report the status of selected processes which have terminated. + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + WEXITED; + /// Report the status of selected processes that have continued from a + /// job control stop by receiving a + /// [`SIGCONT`](crate::sys::signal::Signal::SIGCONT) signal. + WCONTINUED; + /// An alias for WUNTRACED. + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + WSTOPPED; + /// Don't reap, just poll status. + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + WNOWAIT; + /// Don't wait on children of other threads in this group + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + __WNOTHREAD; + /// Wait on all children, regardless of type + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + __WALL; + /// Wait for "clone" children only. + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + __WCLONE; + } +); + +/// Possible return values from `wait()` or `waitpid()`. +/// +/// Each status (other than `StillAlive`) describes a state transition +/// in a child process `Pid`, such as the process exiting or stopping, +/// plus additional data about the transition if any. +/// +/// Note that there are two Linux-specific enum variants, `PtraceEvent` +/// and `PtraceSyscall`. Portable code should avoid exhaustively +/// matching on `WaitStatus`. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum WaitStatus { + /// The process exited normally (as with `exit()` or returning from + /// `main`) with the given exit code. This case matches the C macro + /// `WIFEXITED(status)`; the second field is `WEXITSTATUS(status)`. + Exited(Pid, i32), + /// The process was killed by the given signal. The third field + /// indicates whether the signal generated a core dump. This case + /// matches the C macro `WIFSIGNALED(status)`; the last two fields + /// correspond to `WTERMSIG(status)` and `WCOREDUMP(status)`. + Signaled(Pid, Signal, bool), + /// The process is alive, but was stopped by the given signal. This + /// is only reported if `WaitPidFlag::WUNTRACED` was passed. This + /// case matches the C macro `WIFSTOPPED(status)`; the second field + /// is `WSTOPSIG(status)`. + Stopped(Pid, Signal), + /// The traced process was stopped by a `PTRACE_EVENT_*` event. See + /// [`nix::sys::ptrace`] and [`ptrace`(2)] for more information. All + /// currently-defined events use `SIGTRAP` as the signal; the third + /// field is the `PTRACE_EVENT_*` value of the event. + /// + /// [`nix::sys::ptrace`]: ../ptrace/index.html + /// [`ptrace`(2)]: https://man7.org/linux/man-pages/man2/ptrace.2.html + #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PtraceEvent(Pid, Signal, c_int), + /// The traced process was stopped by execution of a system call, + /// and `PTRACE_O_TRACESYSGOOD` is in effect. See [`ptrace`(2)] for + /// more information. + /// + /// [`ptrace`(2)]: https://man7.org/linux/man-pages/man2/ptrace.2.html + #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PtraceSyscall(Pid), + /// The process was previously stopped but has resumed execution + /// after receiving a `SIGCONT` signal. This is only reported if + /// `WaitPidFlag::WCONTINUED` was passed. This case matches the C + /// macro `WIFCONTINUED(status)`. + Continued(Pid), + /// There are currently no state changes to report in any awaited + /// child process. This is only returned if `WaitPidFlag::WNOHANG` + /// was used (otherwise `wait()` or `waitpid()` would block until + /// there was something to report). + StillAlive, +} + +impl WaitStatus { + /// Extracts the PID from the WaitStatus unless it equals StillAlive. + pub fn pid(&self) -> Option { + use self::WaitStatus::*; + match *self { + Exited(p, _) | Signaled(p, _, _) | Stopped(p, _) | Continued(p) => Some(p), + StillAlive => None, + #[cfg(any(target_os = "android", target_os = "linux"))] + PtraceEvent(p, _, _) | PtraceSyscall(p) => Some(p), + } + } +} + +fn exited(status: i32) -> bool { + libc::WIFEXITED(status) +} + +fn exit_status(status: i32) -> i32 { + libc::WEXITSTATUS(status) +} + +fn signaled(status: i32) -> bool { + libc::WIFSIGNALED(status) +} + +fn term_signal(status: i32) -> Result { + Signal::try_from(libc::WTERMSIG(status)) +} + +fn dumped_core(status: i32) -> bool { + libc::WCOREDUMP(status) +} + +fn stopped(status: i32) -> bool { + libc::WIFSTOPPED(status) +} + +fn stop_signal(status: i32) -> Result { + Signal::try_from(libc::WSTOPSIG(status)) +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn syscall_stop(status: i32) -> bool { + // From ptrace(2), setting PTRACE_O_TRACESYSGOOD has the effect + // of delivering SIGTRAP | 0x80 as the signal number for syscall + // stops. This allows easily distinguishing syscall stops from + // genuine SIGTRAP signals. + libc::WSTOPSIG(status) == libc::SIGTRAP | 0x80 +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn stop_additional(status: i32) -> c_int { + (status >> 16) as c_int +} + +fn continued(status: i32) -> bool { + libc::WIFCONTINUED(status) +} + +impl WaitStatus { + /// Convert a raw `wstatus` as returned by `waitpid`/`wait` into a `WaitStatus` + /// + /// # Errors + /// + /// Returns an `Error` corresponding to `EINVAL` for invalid status values. + /// + /// # Examples + /// + /// Convert a `wstatus` obtained from `libc::waitpid` into a `WaitStatus`: + /// + /// ``` + /// use nix::sys::wait::WaitStatus; + /// use nix::sys::signal::Signal; + /// let pid = nix::unistd::Pid::from_raw(1); + /// let status = WaitStatus::from_raw(pid, 0x0002); + /// assert_eq!(status, Ok(WaitStatus::Signaled(pid, Signal::SIGINT, false))); + /// ``` + pub fn from_raw(pid: Pid, status: i32) -> Result { + Ok(if exited(status) { + WaitStatus::Exited(pid, exit_status(status)) + } else if signaled(status) { + WaitStatus::Signaled(pid, term_signal(status)?, dumped_core(status)) + } else if stopped(status) { + cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + fn decode_stopped(pid: Pid, status: i32) -> Result { + let status_additional = stop_additional(status); + Ok(if syscall_stop(status) { + WaitStatus::PtraceSyscall(pid) + } else if status_additional == 0 { + WaitStatus::Stopped(pid, stop_signal(status)?) + } else { + WaitStatus::PtraceEvent(pid, stop_signal(status)?, + stop_additional(status)) + }) + } + } else { + fn decode_stopped(pid: Pid, status: i32) -> Result { + Ok(WaitStatus::Stopped(pid, stop_signal(status)?)) + } + } + } + return decode_stopped(pid, status); + } else { + assert!(continued(status)); + WaitStatus::Continued(pid) + }) + } + + /// Convert a `siginfo_t` as returned by `waitid` to a `WaitStatus` + /// + /// # Errors + /// + /// Returns an `Error` corresponding to `EINVAL` for invalid values. + /// + /// # Safety + /// + /// siginfo_t is actually a union, not all fields may be initialized. + /// The functions si_pid() and si_status() must be valid to call on + /// the passed siginfo_t. + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), + ))] + unsafe fn from_siginfo(siginfo: &libc::siginfo_t) -> Result { + let si_pid = siginfo.si_pid(); + if si_pid == 0 { + return Ok(WaitStatus::StillAlive); + } + + assert_eq!(siginfo.si_signo, libc::SIGCHLD); + + let pid = Pid::from_raw(si_pid); + let si_status = siginfo.si_status(); + + let status = match siginfo.si_code { + libc::CLD_EXITED => WaitStatus::Exited(pid, si_status), + libc::CLD_KILLED | libc::CLD_DUMPED => WaitStatus::Signaled( + pid, + Signal::try_from(si_status)?, + siginfo.si_code == libc::CLD_DUMPED, + ), + libc::CLD_STOPPED => WaitStatus::Stopped(pid, Signal::try_from(si_status)?), + libc::CLD_CONTINUED => WaitStatus::Continued(pid), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::CLD_TRAPPED => { + if si_status == libc::SIGTRAP | 0x80 { + WaitStatus::PtraceSyscall(pid) + } else { + WaitStatus::PtraceEvent( + pid, + Signal::try_from(si_status & 0xff)?, + (si_status >> 8) as c_int, + ) + } + } + _ => return Err(Errno::EINVAL), + }; + + Ok(status) + } +} + +/// Wait for a process to change status +/// +/// See also [waitpid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/waitpid.html) +pub fn waitpid>>(pid: P, options: Option) -> Result { + use self::WaitStatus::*; + + let mut status: i32 = 0; + + let option_bits = match options { + Some(bits) => bits.bits(), + None => 0, + }; + + let res = unsafe { + libc::waitpid( + pid.into().unwrap_or_else(|| Pid::from_raw(-1)).into(), + &mut status as *mut c_int, + option_bits, + ) + }; + + match Errno::result(res)? { + 0 => Ok(StillAlive), + res => WaitStatus::from_raw(Pid::from_raw(res), status), + } +} + +/// Wait for any child process to change status or a signal is received. +/// +/// See also [wait(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/wait.html) +pub fn wait() -> Result { + waitpid(None, None) +} + +/// The ID argument for `waitid` +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), +))] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub enum Id { + /// Wait for any child + All, + /// Wait for the child whose process ID matches the given PID + Pid(Pid), + /// Wait for the child whose process group ID matches the given PID + /// + /// If the PID is zero, the caller's process group is used since Linux 5.4. + PGid(Pid), + /// Wait for the child referred to by the given PID file descriptor + #[cfg(any(target_os = "android", target_os = "linux"))] + PIDFd(RawFd), +} + +/// Wait for a process to change status +/// +/// See also [waitid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/waitid.html) +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), +))] +pub fn waitid(id: Id, flags: WaitPidFlag) -> Result { + let (idtype, idval) = match id { + Id::All => (libc::P_ALL, 0), + Id::Pid(pid) => (libc::P_PID, pid.as_raw() as libc::id_t), + Id::PGid(pid) => (libc::P_PGID, pid.as_raw() as libc::id_t), + #[cfg(any(target_os = "android", target_os = "linux"))] + Id::PIDFd(fd) => (libc::P_PIDFD, fd as libc::id_t), + }; + + let siginfo = unsafe { + // Memory is zeroed rather than uninitialized, as not all platforms + // initialize the memory in the StillAlive case + let mut siginfo: libc::siginfo_t = std::mem::zeroed(); + Errno::result(libc::waitid(idtype, idval, &mut siginfo, flags.bits()))?; + siginfo + }; + + unsafe { WaitStatus::from_siginfo(&siginfo) } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/time.rs b/bash-5.1/vendor/nix-0.24.2/src/time.rs new file mode 100644 index 0000000000000000000000000000000000000000..6a385b90bdc8f490c2fa366980660c82cc6059f5 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/time.rs @@ -0,0 +1,269 @@ +use crate::sys::time::TimeSpec; +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +#[cfg(feature = "process")] +use crate::unistd::Pid; +use crate::{Errno, Result}; +use libc::{self, clockid_t}; +use std::mem::MaybeUninit; + +/// Clock identifier +/// +/// Newtype pattern around `clockid_t` (which is just alias). It prevents bugs caused by +/// accidentally passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] +pub struct ClockId(clockid_t); + +impl ClockId { + /// Creates `ClockId` from raw `clockid_t` + pub const fn from_raw(clk_id: clockid_t) -> Self { + ClockId(clk_id) + } + + feature! { + #![feature = "process"] + /// Returns `ClockId` of a `pid` CPU-time clock + #[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn pid_cpu_clock_id(pid: Pid) -> Result { + clock_getcpuclockid(pid) + } + } + + /// Returns resolution of the clock id + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn res(self) -> Result { + clock_getres(self) + } + + /// Returns the current time on the clock id + pub fn now(self) -> Result { + clock_gettime(self) + } + + /// Sets time to `timespec` on the clock id + #[cfg(not(any( + target_os = "macos", + target_os = "ios", + target_os = "redox", + target_os = "hermit", + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn set_time(self, timespec: TimeSpec) -> Result<()> { + clock_settime(self, timespec) + } + + /// Gets the raw `clockid_t` wrapped by `self` + pub const fn as_raw(self) -> clockid_t { + self.0 + } + + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_BOOTTIME: ClockId = ClockId(libc::CLOCK_BOOTTIME); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_BOOTTIME_ALARM: ClockId = ClockId(libc::CLOCK_BOOTTIME_ALARM); + pub const CLOCK_MONOTONIC: ClockId = ClockId(libc::CLOCK_MONOTONIC); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_MONOTONIC_COARSE: ClockId = ClockId(libc::CLOCK_MONOTONIC_COARSE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_MONOTONIC_FAST: ClockId = ClockId(libc::CLOCK_MONOTONIC_FAST); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_MONOTONIC_PRECISE: ClockId = ClockId(libc::CLOCK_MONOTONIC_PRECISE); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_MONOTONIC_RAW: ClockId = ClockId(libc::CLOCK_MONOTONIC_RAW); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "redox", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_PROCESS_CPUTIME_ID: ClockId = ClockId(libc::CLOCK_PROCESS_CPUTIME_ID); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_PROF: ClockId = ClockId(libc::CLOCK_PROF); + pub const CLOCK_REALTIME: ClockId = ClockId(libc::CLOCK_REALTIME); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_REALTIME_ALARM: ClockId = ClockId(libc::CLOCK_REALTIME_ALARM); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_REALTIME_COARSE: ClockId = ClockId(libc::CLOCK_REALTIME_COARSE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_REALTIME_FAST: ClockId = ClockId(libc::CLOCK_REALTIME_FAST); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_REALTIME_PRECISE: ClockId = ClockId(libc::CLOCK_REALTIME_PRECISE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_SECOND: ClockId = ClockId(libc::CLOCK_SECOND); + #[cfg(any( + target_os = "emscripten", + target_os = "fuchsia", + all(target_os = "linux", target_env = "musl") + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_SGI_CYCLE: ClockId = ClockId(libc::CLOCK_SGI_CYCLE); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_TAI: ClockId = ClockId(libc::CLOCK_TAI); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_THREAD_CPUTIME_ID: ClockId = ClockId(libc::CLOCK_THREAD_CPUTIME_ID); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_UPTIME: ClockId = ClockId(libc::CLOCK_UPTIME); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_UPTIME_FAST: ClockId = ClockId(libc::CLOCK_UPTIME_FAST); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_UPTIME_PRECISE: ClockId = ClockId(libc::CLOCK_UPTIME_PRECISE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_VIRTUAL: ClockId = ClockId(libc::CLOCK_VIRTUAL); +} + +impl From for clockid_t { + fn from(clock_id: ClockId) -> Self { + clock_id.as_raw() + } +} + +impl From for ClockId { + fn from(clk_id: clockid_t) -> Self { + ClockId::from_raw(clk_id) + } +} + +impl std::fmt::Display for ClockId { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + std::fmt::Display::fmt(&self.0, f) + } +} + +/// Get the resolution of the specified clock, (see +/// [clock_getres(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_getres.html)). +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn clock_getres(clock_id: ClockId) -> Result { + let mut c_time: MaybeUninit = MaybeUninit::uninit(); + let ret = unsafe { libc::clock_getres(clock_id.as_raw(), c_time.as_mut_ptr()) }; + Errno::result(ret)?; + let res = unsafe { c_time.assume_init() }; + Ok(TimeSpec::from(res)) +} + +/// Get the time of the specified clock, (see +/// [clock_gettime(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_gettime.html)). +pub fn clock_gettime(clock_id: ClockId) -> Result { + let mut c_time: MaybeUninit = MaybeUninit::uninit(); + let ret = unsafe { libc::clock_gettime(clock_id.as_raw(), c_time.as_mut_ptr()) }; + Errno::result(ret)?; + let res = unsafe { c_time.assume_init() }; + Ok(TimeSpec::from(res)) +} + +/// Set the time of the specified clock, (see +/// [clock_settime(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_settime.html)). +#[cfg(not(any( + target_os = "macos", + target_os = "ios", + target_os = "redox", + target_os = "hermit", +)))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn clock_settime(clock_id: ClockId, timespec: TimeSpec) -> Result<()> { + let ret = unsafe { libc::clock_settime(clock_id.as_raw(), timespec.as_ref()) }; + Errno::result(ret).map(drop) +} + +/// Get the clock id of the specified process id, (see +/// [clock_getcpuclockid(3)](https://pubs.opengroup.org/onlinepubs/009695399/functions/clock_getcpuclockid.html)). +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +#[cfg(feature = "process")] +#[cfg_attr(docsrs, doc(cfg(feature = "process")))] +pub fn clock_getcpuclockid(pid: Pid) -> Result { + let mut clk_id: MaybeUninit = MaybeUninit::uninit(); + let ret = unsafe { libc::clock_getcpuclockid(pid.into(), clk_id.as_mut_ptr()) }; + if ret == 0 { + let res = unsafe { clk_id.assume_init() }; + Ok(ClockId::from(res)) + } else { + Err(Errno::from_i32(ret)) + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/ucontext.rs b/bash-5.1/vendor/nix-0.24.2/src/ucontext.rs new file mode 100644 index 0000000000000000000000000000000000000000..f2338bd426ac2f731040439c4de36cbc5fdc934f --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/ucontext.rs @@ -0,0 +1,43 @@ +#[cfg(not(target_env = "musl"))] +use crate::Result; +#[cfg(not(target_env = "musl"))] +use crate::errno::Errno; +#[cfg(not(target_env = "musl"))] +use std::mem; +use crate::sys::signal::SigSet; + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct UContext { + context: libc::ucontext_t, +} + +impl UContext { + #[cfg(not(target_env = "musl"))] + pub fn get() -> Result { + let mut context = mem::MaybeUninit::::uninit(); + let res = unsafe { libc::getcontext(context.as_mut_ptr()) }; + Errno::result(res).map(|_| unsafe { + UContext { context: context.assume_init()} + }) + } + + #[cfg(not(target_env = "musl"))] + pub fn set(&self) -> Result<()> { + let res = unsafe { + libc::setcontext(&self.context as *const libc::ucontext_t) + }; + Errno::result(res).map(drop) + } + + pub fn sigmask_mut(&mut self) -> &mut SigSet { + unsafe { + &mut *(&mut self.context.uc_sigmask as *mut libc::sigset_t as *mut SigSet) + } + } + + pub fn sigmask(&self) -> &SigSet { + unsafe { + &*(&self.context.uc_sigmask as *const libc::sigset_t as *const SigSet) + } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/src/unistd.rs b/bash-5.1/vendor/nix-0.24.2/src/unistd.rs new file mode 100644 index 0000000000000000000000000000000000000000..befe489525107d87c179dca6a16ec0d33e41d041 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/src/unistd.rs @@ -0,0 +1,3236 @@ +//! Safe wrappers around functions found in libc "unistd.h" header + +#[cfg(not(target_os = "redox"))] +use cfg_if::cfg_if; +use crate::errno::{self, Errno}; +use crate::{Error, Result, NixPath}; +#[cfg(not(target_os = "redox"))] +#[cfg(feature = "fs")] +use crate::fcntl::{AtFlags, at_rawfd}; +use libc::{self, c_char, c_void, c_int, c_long, c_uint, size_t, pid_t, off_t, + uid_t, gid_t, mode_t, PATH_MAX}; +#[cfg(feature = "fs")] +use crate::fcntl::{FdFlag, OFlag, fcntl, FcntlArg::F_SETFD}; +use std::{fmt, mem, ptr}; +use std::convert::Infallible; +use std::ffi::{CStr, OsString}; +#[cfg(not(target_os = "redox"))] +use std::ffi::{CString, OsStr}; +use std::os::unix::ffi::OsStringExt; +#[cfg(not(target_os = "redox"))] +use std::os::unix::ffi::OsStrExt; +use std::os::unix::io::RawFd; +use std::path::PathBuf; +#[cfg(feature = "fs")] +use crate::sys::stat::Mode; + +feature! { + #![feature = "fs"] + #[cfg(any(target_os = "android", target_os = "linux"))] + pub use self::pivot_root::*; +} + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] +pub use self::setres::*; + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] +pub use self::getres::*; + +feature! { +#![feature = "user"] + +/// User identifier +/// +/// Newtype pattern around `uid_t` (which is just alias). It prevents bugs caused by accidentally +/// passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub struct Uid(uid_t); + +impl Uid { + /// Creates `Uid` from raw `uid_t`. + pub const fn from_raw(uid: uid_t) -> Self { + Uid(uid) + } + + /// Returns Uid of calling process. This is practically a more Rusty alias for `getuid`. + pub fn current() -> Self { + getuid() + } + + /// Returns effective Uid of calling process. This is practically a more Rusty alias for `geteuid`. + pub fn effective() -> Self { + geteuid() + } + + /// Returns true if the `Uid` represents privileged user - root. (If it equals zero.) + pub const fn is_root(self) -> bool { + self.0 == ROOT.0 + } + + /// Get the raw `uid_t` wrapped by `self`. + pub const fn as_raw(self) -> uid_t { + self.0 + } +} + +impl From for uid_t { + fn from(uid: Uid) -> Self { + uid.0 + } +} + +impl fmt::Display for Uid { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.0, f) + } +} + +/// Constant for UID = 0 +pub const ROOT: Uid = Uid(0); + +/// Group identifier +/// +/// Newtype pattern around `gid_t` (which is just alias). It prevents bugs caused by accidentally +/// passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub struct Gid(gid_t); + +impl Gid { + /// Creates `Gid` from raw `gid_t`. + pub const fn from_raw(gid: gid_t) -> Self { + Gid(gid) + } + + /// Returns Gid of calling process. This is practically a more Rusty alias for `getgid`. + pub fn current() -> Self { + getgid() + } + + /// Returns effective Gid of calling process. This is practically a more Rusty alias for `getegid`. + pub fn effective() -> Self { + getegid() + } + + /// Get the raw `gid_t` wrapped by `self`. + pub const fn as_raw(self) -> gid_t { + self.0 + } +} + +impl From for gid_t { + fn from(gid: Gid) -> Self { + gid.0 + } +} + +impl fmt::Display for Gid { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.0, f) + } +} +} + +feature! { +#![feature = "process"] +/// Process identifier +/// +/// Newtype pattern around `pid_t` (which is just alias). It prevents bugs caused by accidentally +/// passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] +pub struct Pid(pid_t); + +impl Pid { + /// Creates `Pid` from raw `pid_t`. + pub const fn from_raw(pid: pid_t) -> Self { + Pid(pid) + } + + /// Returns PID of calling process + pub fn this() -> Self { + getpid() + } + + /// Returns PID of parent of calling process + pub fn parent() -> Self { + getppid() + } + + /// Get the raw `pid_t` wrapped by `self`. + pub const fn as_raw(self) -> pid_t { + self.0 + } +} + +impl From for pid_t { + fn from(pid: Pid) -> Self { + pid.0 + } +} + +impl fmt::Display for Pid { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.0, f) + } +} + + +/// Represents the successful result of calling `fork` +/// +/// When `fork` is called, the process continues execution in the parent process +/// and in the new child. This return type can be examined to determine whether +/// you are now executing in the parent process or in the child. +#[derive(Clone, Copy, Debug)] +pub enum ForkResult { + Parent { child: Pid }, + Child, +} + +impl ForkResult { + + /// Return `true` if this is the child process of the `fork()` + #[inline] + pub fn is_child(self) -> bool { + matches!(self, ForkResult::Child) + } + + /// Returns `true` if this is the parent process of the `fork()` + #[inline] + pub fn is_parent(self) -> bool { + !self.is_child() + } +} + +/// Create a new child process duplicating the parent process ([see +/// fork(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html)). +/// +/// After successfully calling the fork system call, a second process will +/// be created which is identical to the original except for the pid and the +/// return value of this function. As an example: +/// +/// ``` +/// use nix::{sys::wait::waitpid,unistd::{fork, ForkResult, write}}; +/// +/// match unsafe{fork()} { +/// Ok(ForkResult::Parent { child, .. }) => { +/// println!("Continuing execution in parent process, new child has pid: {}", child); +/// waitpid(child, None).unwrap(); +/// } +/// Ok(ForkResult::Child) => { +/// // Unsafe to use `println!` (or `unwrap`) here. See Safety. +/// write(libc::STDOUT_FILENO, "I'm a new child process\n".as_bytes()).ok(); +/// unsafe { libc::_exit(0) }; +/// } +/// Err(_) => println!("Fork failed"), +/// } +/// ``` +/// +/// This will print something like the following (order nondeterministic). The +/// thing to note is that you end up with two processes continuing execution +/// immediately after the fork call but with different match arms. +/// +/// ```text +/// Continuing execution in parent process, new child has pid: 1234 +/// I'm a new child process +/// ``` +/// +/// # Safety +/// +/// In a multithreaded program, only [async-signal-safe] functions like `pause` +/// and `_exit` may be called by the child (the parent isn't restricted). Note +/// that memory allocation may **not** be async-signal-safe and thus must be +/// prevented. +/// +/// Those functions are only a small subset of your operating system's API, so +/// special care must be taken to only invoke code you can control and audit. +/// +/// [async-signal-safe]: https://man7.org/linux/man-pages/man7/signal-safety.7.html +#[inline] +pub unsafe fn fork() -> Result { + use self::ForkResult::*; + let res = libc::fork(); + + Errno::result(res).map(|res| match res { + 0 => Child, + res => Parent { child: Pid(res) }, + }) +} + +/// Get the pid of this process (see +/// [getpid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpid.html)). +/// +/// Since you are running code, there is always a pid to return, so there +/// is no error case that needs to be handled. +#[inline] +pub fn getpid() -> Pid { + Pid(unsafe { libc::getpid() }) +} + +/// Get the pid of this processes' parent (see +/// [getpid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getppid.html)). +/// +/// There is always a parent pid to return, so there is no error case that needs +/// to be handled. +#[inline] +pub fn getppid() -> Pid { + Pid(unsafe { libc::getppid() }) // no error handling, according to man page: "These functions are always successful." +} + +/// Set a process group ID (see +/// [setpgid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setpgid.html)). +/// +/// Set the process group id (PGID) of a particular process. If a pid of zero +/// is specified, then the pid of the calling process is used. Process groups +/// may be used to group together a set of processes in order for the OS to +/// apply some operations across the group. +/// +/// `setsid()` may be used to create a new process group. +#[inline] +pub fn setpgid(pid: Pid, pgid: Pid) -> Result<()> { + let res = unsafe { libc::setpgid(pid.into(), pgid.into()) }; + Errno::result(res).map(drop) +} +#[inline] +pub fn getpgid(pid: Option) -> Result { + let res = unsafe { libc::getpgid(pid.unwrap_or(Pid(0)).into()) }; + Errno::result(res).map(Pid) +} + +/// Create new session and set process group id (see +/// [setsid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setsid.html)). +#[inline] +pub fn setsid() -> Result { + Errno::result(unsafe { libc::setsid() }).map(Pid) +} + +/// Get the process group ID of a session leader +/// [getsid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsid.html). +/// +/// Obtain the process group ID of the process that is the session leader of the process specified +/// by pid. If pid is zero, it specifies the calling process. +#[inline] +#[cfg(not(target_os = "redox"))] +pub fn getsid(pid: Option) -> Result { + let res = unsafe { libc::getsid(pid.unwrap_or(Pid(0)).into()) }; + Errno::result(res).map(Pid) +} +} + +feature! { +#![all(feature = "process", feature = "term")] +/// Get the terminal foreground process group (see +/// [tcgetpgrp(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetpgrp.html)). +/// +/// Get the group process id (GPID) of the foreground process group on the +/// terminal associated to file descriptor (FD). +#[inline] +pub fn tcgetpgrp(fd: c_int) -> Result { + let res = unsafe { libc::tcgetpgrp(fd) }; + Errno::result(res).map(Pid) +} +/// Set the terminal foreground process group (see +/// [tcgetpgrp(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetpgrp.html)). +/// +/// Get the group process id (PGID) to the foreground process group on the +/// terminal associated to file descriptor (FD). +#[inline] +pub fn tcsetpgrp(fd: c_int, pgrp: Pid) -> Result<()> { + let res = unsafe { libc::tcsetpgrp(fd, pgrp.into()) }; + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "process"] +/// Get the group id of the calling process (see +///[getpgrp(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpgrp.html)). +/// +/// Get the process group id (PGID) of the calling process. +/// According to the man page it is always successful. +#[inline] +pub fn getpgrp() -> Pid { + Pid(unsafe { libc::getpgrp() }) +} + +/// Get the caller's thread ID (see +/// [gettid(2)](https://man7.org/linux/man-pages/man2/gettid.2.html). +/// +/// This function is only available on Linux based systems. In a single +/// threaded process, the main thread will have the same ID as the process. In +/// a multithreaded process, each thread will have a unique thread id but the +/// same process ID. +/// +/// No error handling is required as a thread id should always exist for any +/// process, even if threads are not being used. +#[cfg(any(target_os = "linux", target_os = "android"))] +#[inline] +pub fn gettid() -> Pid { + Pid(unsafe { libc::syscall(libc::SYS_gettid) as pid_t }) +} +} + +feature! { +#![feature = "fs"] +/// Create a copy of the specified file descriptor (see +/// [dup(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html)). +/// +/// The new file descriptor will be have a new index but refer to the same +/// resource as the old file descriptor and the old and new file descriptors may +/// be used interchangeably. The new and old file descriptor share the same +/// underlying resource, offset, and file status flags. The actual index used +/// for the file descriptor will be the lowest fd index that is available. +/// +/// The two file descriptors do not share file descriptor flags (e.g. `OFlag::FD_CLOEXEC`). +#[inline] +pub fn dup(oldfd: RawFd) -> Result { + let res = unsafe { libc::dup(oldfd) }; + + Errno::result(res) +} + +/// Create a copy of the specified file descriptor using the specified fd (see +/// [dup(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html)). +/// +/// This function behaves similar to `dup()` except that it will try to use the +/// specified fd instead of allocating a new one. See the man pages for more +/// detail on the exact behavior of this function. +#[inline] +pub fn dup2(oldfd: RawFd, newfd: RawFd) -> Result { + let res = unsafe { libc::dup2(oldfd, newfd) }; + + Errno::result(res) +} + +/// Create a new copy of the specified file descriptor using the specified fd +/// and flags (see [dup(2)](https://man7.org/linux/man-pages/man2/dup.2.html)). +/// +/// This function behaves similar to `dup2()` but allows for flags to be +/// specified. +pub fn dup3(oldfd: RawFd, newfd: RawFd, flags: OFlag) -> Result { + dup3_polyfill(oldfd, newfd, flags) +} + +#[inline] +fn dup3_polyfill(oldfd: RawFd, newfd: RawFd, flags: OFlag) -> Result { + if oldfd == newfd { + return Err(Errno::EINVAL); + } + + let fd = dup2(oldfd, newfd)?; + + if flags.contains(OFlag::O_CLOEXEC) { + if let Err(e) = fcntl(fd, F_SETFD(FdFlag::FD_CLOEXEC)) { + let _ = close(fd); + return Err(e); + } + } + + Ok(fd) +} + +/// Change the current working directory of the calling process (see +/// [chdir(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/chdir.html)). +/// +/// This function may fail in a number of different scenarios. See the man +/// pages for additional details on possible failure cases. +#[inline] +pub fn chdir(path: &P) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::chdir(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) +} + +/// Change the current working directory of the process to the one +/// given as an open file descriptor (see +/// [fchdir(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html)). +/// +/// This function may fail in a number of different scenarios. See the man +/// pages for additional details on possible failure cases. +#[inline] +#[cfg(not(target_os = "fuchsia"))] +pub fn fchdir(dirfd: RawFd) -> Result<()> { + let res = unsafe { libc::fchdir(dirfd) }; + + Errno::result(res).map(drop) +} + +/// Creates new directory `path` with access rights `mode`. (see [mkdir(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdir.html)) +/// +/// # Errors +/// +/// There are several situations where mkdir might fail: +/// +/// - current user has insufficient rights in the parent directory +/// - the path already exists +/// - the path name is too long (longer than `PATH_MAX`, usually 4096 on linux, 1024 on OS X) +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// use nix::sys::stat; +/// use tempfile::tempdir; +/// +/// let tmp_dir1 = tempdir().unwrap(); +/// let tmp_dir2 = tmp_dir1.path().join("new_dir"); +/// +/// // create new directory and give read, write and execute rights to the owner +/// match unistd::mkdir(&tmp_dir2, stat::Mode::S_IRWXU) { +/// Ok(_) => println!("created {:?}", tmp_dir2), +/// Err(err) => println!("Error creating directory: {}", err), +/// } +/// ``` +#[inline] +pub fn mkdir(path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::mkdir(cstr.as_ptr(), mode.bits() as mode_t) } + })?; + + Errno::result(res).map(drop) +} + +/// Creates new fifo special file (named pipe) with path `path` and access rights `mode`. +/// +/// # Errors +/// +/// There are several situations where mkfifo might fail: +/// +/// - current user has insufficient rights in the parent directory +/// - the path already exists +/// - the path name is too long (longer than `PATH_MAX`, usually 4096 on linux, 1024 on OS X) +/// +/// For a full list consult +/// [posix specification](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifo.html) +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// use nix::sys::stat; +/// use tempfile::tempdir; +/// +/// let tmp_dir = tempdir().unwrap(); +/// let fifo_path = tmp_dir.path().join("foo.pipe"); +/// +/// // create new fifo and give read, write and execute rights to the owner +/// match unistd::mkfifo(&fifo_path, stat::Mode::S_IRWXU) { +/// Ok(_) => println!("created {:?}", fifo_path), +/// Err(err) => println!("Error creating fifo: {}", err), +/// } +/// ``` +#[inline] +#[cfg(not(target_os = "redox"))] // RedoxFS does not support fifo yet +pub fn mkfifo(path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::mkfifo(cstr.as_ptr(), mode.bits() as mode_t) } + })?; + + Errno::result(res).map(drop) +} + +/// Creates new fifo special file (named pipe) with path `path` and access rights `mode`. +/// +/// If `dirfd` has a value, then `path` is relative to directory associated with the file descriptor. +/// +/// If `dirfd` is `None`, then `path` is relative to the current working directory. +/// +/// # References +/// +/// [mkfifoat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifoat.html). +// mkfifoat is not implemented in OSX or android +#[inline] +#[cfg(not(any( + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] +pub fn mkfifoat(dirfd: Option, path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| unsafe { + libc::mkfifoat(at_rawfd(dirfd), cstr.as_ptr(), mode.bits() as mode_t) + })?; + + Errno::result(res).map(drop) +} + +/// Creates a symbolic link at `path2` which points to `path1`. +/// +/// If `dirfd` has a value, then `path2` is relative to directory associated +/// with the file descriptor. +/// +/// If `dirfd` is `None`, then `path2` is relative to the current working +/// directory. This is identical to `libc::symlink(path1, path2)`. +/// +/// See also [symlinkat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/symlinkat.html). +#[cfg(not(target_os = "redox"))] +pub fn symlinkat( + path1: &P1, + dirfd: Option, + path2: &P2) -> Result<()> { + let res = + path1.with_nix_path(|path1| { + path2.with_nix_path(|path2| { + unsafe { + libc::symlinkat( + path1.as_ptr(), + dirfd.unwrap_or(libc::AT_FDCWD), + path2.as_ptr() + ) + } + }) + })??; + Errno::result(res).map(drop) +} +} + +// Double the buffer capacity up to limit. In case it already has +// reached the limit, return Errno::ERANGE. +#[cfg(any(feature = "fs", feature = "user"))] +fn reserve_double_buffer_size(buf: &mut Vec, limit: usize) -> Result<()> { + use std::cmp::min; + + if buf.capacity() >= limit { + return Err(Errno::ERANGE) + } + + let capacity = min(buf.capacity() * 2, limit); + buf.reserve(capacity); + + Ok(()) +} + +feature! { +#![feature = "fs"] + +/// Returns the current directory as a `PathBuf` +/// +/// Err is returned if the current user doesn't have the permission to read or search a component +/// of the current path. +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// +/// // assume that we are allowed to get current directory +/// let dir = unistd::getcwd().unwrap(); +/// println!("The current directory is {:?}", dir); +/// ``` +#[inline] +pub fn getcwd() -> Result { + let mut buf = Vec::with_capacity(512); + loop { + unsafe { + let ptr = buf.as_mut_ptr() as *mut c_char; + + // The buffer must be large enough to store the absolute pathname plus + // a terminating null byte, or else null is returned. + // To safely handle this we start with a reasonable size (512 bytes) + // and double the buffer size upon every error + if !libc::getcwd(ptr, buf.capacity()).is_null() { + let len = CStr::from_ptr(buf.as_ptr() as *const c_char).to_bytes().len(); + buf.set_len(len); + buf.shrink_to_fit(); + return Ok(PathBuf::from(OsString::from_vec(buf))); + } else { + let error = Errno::last(); + // ERANGE means buffer was too small to store directory name + if error != Errno::ERANGE { + return Err(error); + } + } + + // Trigger the internal buffer resizing logic. + reserve_double_buffer_size(&mut buf, PATH_MAX as usize)?; + } + } +} +} + +feature! { +#![all(feature = "user", feature = "fs")] + +/// Computes the raw UID and GID values to pass to a `*chown` call. +// The cast is not unnecessary on all platforms. +#[allow(clippy::unnecessary_cast)] +fn chown_raw_ids(owner: Option, group: Option) -> (libc::uid_t, libc::gid_t) { + // According to the POSIX specification, -1 is used to indicate that owner and group + // are not to be changed. Since uid_t and gid_t are unsigned types, we have to wrap + // around to get -1. + let uid = owner.map(Into::into) + .unwrap_or_else(|| (0 as uid_t).wrapping_sub(1)); + let gid = group.map(Into::into) + .unwrap_or_else(|| (0 as gid_t).wrapping_sub(1)); + (uid, gid) +} + +/// Change the ownership of the file at `path` to be owned by the specified +/// `owner` (user) and `group` (see +/// [chown(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html)). +/// +/// The owner/group for the provided path name will not be modified if `None` is +/// provided for that argument. Ownership change will be attempted for the path +/// only if `Some` owner/group is provided. +#[inline] +pub fn chown(path: &P, owner: Option, group: Option) -> Result<()> { + let res = path.with_nix_path(|cstr| { + let (uid, gid) = chown_raw_ids(owner, group); + unsafe { libc::chown(cstr.as_ptr(), uid, gid) } + })?; + + Errno::result(res).map(drop) +} + +/// Change the ownership of the file referred to by the open file descriptor `fd` to be owned by +/// the specified `owner` (user) and `group` (see +/// [fchown(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchown.html)). +/// +/// The owner/group for the provided file will not be modified if `None` is +/// provided for that argument. Ownership change will be attempted for the path +/// only if `Some` owner/group is provided. +#[inline] +pub fn fchown(fd: RawFd, owner: Option, group: Option) -> Result<()> { + let (uid, gid) = chown_raw_ids(owner, group); + let res = unsafe { libc::fchown(fd, uid, gid) }; + Errno::result(res).map(drop) +} + +/// Flags for `fchownat` function. +#[derive(Clone, Copy, Debug)] +pub enum FchownatFlags { + FollowSymlink, + NoFollowSymlink, +} + +/// Change the ownership of the file at `path` to be owned by the specified +/// `owner` (user) and `group`. +/// +/// The owner/group for the provided path name will not be modified if `None` is +/// provided for that argument. Ownership change will be attempted for the path +/// only if `Some` owner/group is provided. +/// +/// The file to be changed is determined relative to the directory associated +/// with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. +/// +/// If `flag` is `FchownatFlags::NoFollowSymlink` and `path` names a symbolic link, +/// then the mode of the symbolic link is changed. +/// +/// `fchownat(None, path, mode, FchownatFlags::NoFollowSymlink)` is identical to +/// a call `libc::lchown(path, mode)`. That's why `lchmod` is unimplemented in +/// the `nix` crate. +/// +/// # References +/// +/// [fchownat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchownat.html). +#[cfg(not(target_os = "redox"))] +pub fn fchownat( + dirfd: Option, + path: &P, + owner: Option, + group: Option, + flag: FchownatFlags, +) -> Result<()> { + let atflag = + match flag { + FchownatFlags::FollowSymlink => AtFlags::empty(), + FchownatFlags::NoFollowSymlink => AtFlags::AT_SYMLINK_NOFOLLOW, + }; + let res = path.with_nix_path(|cstr| unsafe { + let (uid, gid) = chown_raw_ids(owner, group); + libc::fchownat(at_rawfd(dirfd), cstr.as_ptr(), uid, gid, + atflag.bits() as libc::c_int) + })?; + + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "process"] +fn to_exec_array>(args: &[S]) -> Vec<*const c_char> { + use std::iter::once; + args.iter() + .map(|s| s.as_ref().as_ptr()) + .chain(once(ptr::null())) + .collect() +} + +/// Replace the current process image with a new one (see +/// [exec(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html)). +/// +/// See the `::nix::unistd::execve` system call for additional details. `execv` +/// performs the same action but does not allow for customization of the +/// environment for the new process. +#[inline] +pub fn execv>(path: &CStr, argv: &[S]) -> Result { + let args_p = to_exec_array(argv); + + unsafe { + libc::execv(path.as_ptr(), args_p.as_ptr()) + }; + + Err(Errno::last()) +} + + +/// Replace the current process image with a new one (see +/// [execve(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html)). +/// +/// The execve system call allows for another process to be "called" which will +/// replace the current process image. That is, this process becomes the new +/// command that is run. On success, this function will not return. Instead, +/// the new program will run until it exits. +/// +/// `::nix::unistd::execv` and `::nix::unistd::execve` take as arguments a slice +/// of `::std::ffi::CString`s for `args` and `env` (for `execve`). Each element +/// in the `args` list is an argument to the new process. Each element in the +/// `env` list should be a string in the form "key=value". +#[inline] +pub fn execve, SE: AsRef>(path: &CStr, args: &[SA], env: &[SE]) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::execve(path.as_ptr(), args_p.as_ptr(), env_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Replace the current process image with a new one and replicate shell `PATH` +/// searching behavior (see +/// [exec(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html)). +/// +/// See `::nix::unistd::execve` for additional details. `execvp` behaves the +/// same as execv except that it will examine the `PATH` environment variables +/// for file names not specified with a leading slash. For example, `execv` +/// would not work if "bash" was specified for the path argument, but `execvp` +/// would assuming that a bash executable was on the system `PATH`. +#[inline] +pub fn execvp>(filename: &CStr, args: &[S]) -> Result { + let args_p = to_exec_array(args); + + unsafe { + libc::execvp(filename.as_ptr(), args_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Replace the current process image with a new one and replicate shell `PATH` +/// searching behavior (see +/// [`execvpe(3)`](https://man7.org/linux/man-pages/man3/exec.3.html)). +/// +/// This functions like a combination of `execvp(2)` and `execve(2)` to pass an +/// environment and have a search path. See these two for additional +/// information. +#[cfg(any(target_os = "haiku", + target_os = "linux", + target_os = "openbsd"))] +pub fn execvpe, SE: AsRef>(filename: &CStr, args: &[SA], env: &[SE]) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::execvpe(filename.as_ptr(), args_p.as_ptr(), env_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Replace the current process image with a new one (see +/// [fexecve(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fexecve.html)). +/// +/// The `fexecve` function allows for another process to be "called" which will +/// replace the current process image. That is, this process becomes the new +/// command that is run. On success, this function will not return. Instead, +/// the new program will run until it exits. +/// +/// This function is similar to `execve`, except that the program to be executed +/// is referenced as a file descriptor instead of a path. +#[cfg(any(target_os = "android", + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd"))] +#[inline] +pub fn fexecve ,SE: AsRef>(fd: RawFd, args: &[SA], env: &[SE]) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::fexecve(fd, args_p.as_ptr(), env_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Execute program relative to a directory file descriptor (see +/// [execveat(2)](https://man7.org/linux/man-pages/man2/execveat.2.html)). +/// +/// The `execveat` function allows for another process to be "called" which will +/// replace the current process image. That is, this process becomes the new +/// command that is run. On success, this function will not return. Instead, +/// the new program will run until it exits. +/// +/// This function is similar to `execve`, except that the program to be executed +/// is referenced as a file descriptor to the base directory plus a path. +#[cfg(any(target_os = "android", target_os = "linux"))] +#[inline] +pub fn execveat,SE: AsRef>(dirfd: RawFd, pathname: &CStr, args: &[SA], + env: &[SE], flags: super::fcntl::AtFlags) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::syscall(libc::SYS_execveat, dirfd, pathname.as_ptr(), + args_p.as_ptr(), env_p.as_ptr(), flags); + }; + + Err(Errno::last()) +} + +/// Daemonize this process by detaching from the controlling terminal (see +/// [daemon(3)](https://man7.org/linux/man-pages/man3/daemon.3.html)). +/// +/// When a process is launched it is typically associated with a parent and it, +/// in turn, by its controlling terminal/process. In order for a process to run +/// in the "background" it must daemonize itself by detaching itself. Under +/// posix, this is done by doing the following: +/// +/// 1. Parent process (this one) forks +/// 2. Parent process exits +/// 3. Child process continues to run. +/// +/// `nochdir`: +/// +/// * `nochdir = true`: The current working directory after daemonizing will +/// be the current working directory. +/// * `nochdir = false`: The current working directory after daemonizing will +/// be the root direcory, `/`. +/// +/// `noclose`: +/// +/// * `noclose = true`: The process' current stdin, stdout, and stderr file +/// descriptors will remain identical after daemonizing. +/// * `noclose = false`: The process' stdin, stdout, and stderr will point to +/// `/dev/null` after daemonizing. +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] +pub fn daemon(nochdir: bool, noclose: bool) -> Result<()> { + let res = unsafe { libc::daemon(nochdir as c_int, noclose as c_int) }; + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "hostname"] + +/// Set the system host name (see +/// [sethostname(2)](https://man7.org/linux/man-pages/man2/gethostname.2.html)). +/// +/// Given a name, attempt to update the system host name to the given string. +/// On some systems, the host name is limited to as few as 64 bytes. An error +/// will be returned if the name is not valid or the current process does not +/// have permissions to update the host name. +#[cfg(not(target_os = "redox"))] +pub fn sethostname>(name: S) -> Result<()> { + // Handle some differences in type of the len arg across platforms. + cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "solaris", ))] { + type sethostname_len_t = c_int; + } else { + type sethostname_len_t = size_t; + } + } + let ptr = name.as_ref().as_bytes().as_ptr() as *const c_char; + let len = name.as_ref().len() as sethostname_len_t; + + let res = unsafe { libc::sethostname(ptr, len) }; + Errno::result(res).map(drop) +} + +/// Get the host name and store it in the provided buffer, returning a pointer +/// the `CStr` in that buffer on success (see +/// [gethostname(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostname.html)). +/// +/// This function call attempts to get the host name for the running system and +/// store it in a provided buffer. The buffer will be populated with bytes up +/// to the length of the provided slice including a NUL terminating byte. If +/// the hostname is longer than the length provided, no error will be provided. +/// The posix specification does not specify whether implementations will +/// null-terminate in this case, but the nix implementation will ensure that the +/// buffer is null terminated in this case. +/// +/// ```no_run +/// use nix::unistd; +/// +/// let mut buf = [0u8; 64]; +/// let hostname_cstr = unistd::gethostname(&mut buf).expect("Failed getting hostname"); +/// let hostname = hostname_cstr.to_str().expect("Hostname wasn't valid UTF-8"); +/// println!("Hostname: {}", hostname); +/// ``` +pub fn gethostname(buffer: &mut [u8]) -> Result<&CStr> { + let ptr = buffer.as_mut_ptr() as *mut c_char; + let len = buffer.len() as size_t; + + let res = unsafe { libc::gethostname(ptr, len) }; + Errno::result(res).map(|_| { + buffer[len - 1] = 0; // ensure always null-terminated + unsafe { CStr::from_ptr(buffer.as_ptr() as *const c_char) } + }) +} +} + +/// Close a raw file descriptor +/// +/// Be aware that many Rust types implicitly close-on-drop, including +/// `std::fs::File`. Explicitly closing them with this method too can result in +/// a double-close condition, which can cause confusing `EBADF` errors in +/// seemingly unrelated code. Caveat programmer. See also +/// [close(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html). +/// +/// # Examples +/// +/// ```no_run +/// use std::os::unix::io::AsRawFd; +/// use nix::unistd::close; +/// +/// let f = tempfile::tempfile().unwrap(); +/// close(f.as_raw_fd()).unwrap(); // Bad! f will also close on drop! +/// ``` +/// +/// ```rust +/// use std::os::unix::io::IntoRawFd; +/// use nix::unistd::close; +/// +/// let f = tempfile::tempfile().unwrap(); +/// close(f.into_raw_fd()).unwrap(); // Good. into_raw_fd consumes f +/// ``` +pub fn close(fd: RawFd) -> Result<()> { + let res = unsafe { libc::close(fd) }; + Errno::result(res).map(drop) +} + +/// Read from a raw file descriptor. +/// +/// See also [read(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html) +pub fn read(fd: RawFd, buf: &mut [u8]) -> Result { + let res = unsafe { libc::read(fd, buf.as_mut_ptr() as *mut c_void, buf.len() as size_t) }; + + Errno::result(res).map(|r| r as usize) +} + +/// Write to a raw file descriptor. +/// +/// See also [write(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html) +pub fn write(fd: RawFd, buf: &[u8]) -> Result { + let res = unsafe { libc::write(fd, buf.as_ptr() as *const c_void, buf.len() as size_t) }; + + Errno::result(res).map(|r| r as usize) +} + +feature! { +#![feature = "fs"] + +/// Directive that tells [`lseek`] and [`lseek64`] what the offset is relative to. +/// +/// [`lseek`]: ./fn.lseek.html +/// [`lseek64`]: ./fn.lseek64.html +#[repr(i32)] +#[derive(Clone, Copy, Debug)] +pub enum Whence { + /// Specify an offset relative to the start of the file. + SeekSet = libc::SEEK_SET, + /// Specify an offset relative to the current file location. + SeekCur = libc::SEEK_CUR, + /// Specify an offset relative to the end of the file. + SeekEnd = libc::SEEK_END, + /// Specify an offset relative to the next location in the file greater than or + /// equal to offset that contains some data. If offset points to + /// some data, then the file offset is set to offset. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "solaris"))] + SeekData = libc::SEEK_DATA, + /// Specify an offset relative to the next hole in the file greater than + /// or equal to offset. If offset points into the middle of a hole, then + /// the file offset should be set to offset. If there is no hole past offset, + /// then the file offset should be adjusted to the end of the file (i.e., there + /// is an implicit hole at the end of any file). + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "solaris"))] + SeekHole = libc::SEEK_HOLE +} + +/// Move the read/write file offset. +/// +/// See also [lseek(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html) +pub fn lseek(fd: RawFd, offset: off_t, whence: Whence) -> Result { + let res = unsafe { libc::lseek(fd, offset, whence as i32) }; + + Errno::result(res).map(|r| r as off_t) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn lseek64(fd: RawFd, offset: libc::off64_t, whence: Whence) -> Result { + let res = unsafe { libc::lseek64(fd, offset, whence as i32) }; + + Errno::result(res).map(|r| r as libc::off64_t) +} +} + +/// Create an interprocess channel. +/// +/// See also [pipe(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pipe.html) +pub fn pipe() -> std::result::Result<(RawFd, RawFd), Error> { + unsafe { + let mut fds = mem::MaybeUninit::<[c_int; 2]>::uninit(); + + let res = libc::pipe(fds.as_mut_ptr() as *mut c_int); + + Error::result(res)?; + + Ok((fds.assume_init()[0], fds.assume_init()[1])) + } +} + +feature! { +#![feature = "fs"] +/// Like `pipe`, but allows setting certain file descriptor flags. +/// +/// The following flags are supported, and will be set atomically as the pipe is +/// created: +/// +/// - `O_CLOEXEC`: Set the close-on-exec flag for the new file descriptors. +#[cfg_attr(target_os = "linux", doc = "- `O_DIRECT`: Create a pipe that performs I/O in \"packet\" mode.")] +#[cfg_attr(target_os = "netbsd", doc = "- `O_NOSIGPIPE`: Return `EPIPE` instead of raising `SIGPIPE`.")] +/// - `O_NONBLOCK`: Set the non-blocking flag for the ends of the pipe. +/// +/// See also [pipe(2)](https://man7.org/linux/man-pages/man2/pipe.2.html) +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "redox", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] +pub fn pipe2(flags: OFlag) -> Result<(RawFd, RawFd)> { + let mut fds = mem::MaybeUninit::<[c_int; 2]>::uninit(); + + let res = unsafe { + libc::pipe2(fds.as_mut_ptr() as *mut c_int, flags.bits()) + }; + + Errno::result(res)?; + + unsafe { Ok((fds.assume_init()[0], fds.assume_init()[1])) } +} + +/// Truncate a file to a specified length +/// +/// See also +/// [truncate(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html) +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +pub fn truncate(path: &P, len: off_t) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::truncate(cstr.as_ptr(), len) + } + })?; + + Errno::result(res).map(drop) +} + +/// Truncate a file to a specified length +/// +/// See also +/// [ftruncate(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html) +pub fn ftruncate(fd: RawFd, len: off_t) -> Result<()> { + Errno::result(unsafe { libc::ftruncate(fd, len) }).map(drop) +} + +pub fn isatty(fd: RawFd) -> Result { + unsafe { + // ENOTTY means `fd` is a valid file descriptor, but not a TTY, so + // we return `Ok(false)` + if libc::isatty(fd) == 1 { + Ok(true) + } else { + match Errno::last() { + Errno::ENOTTY => Ok(false), + err => Err(err), + } + } + } +} + +/// Flags for `linkat` function. +#[derive(Clone, Copy, Debug)] +pub enum LinkatFlags { + SymlinkFollow, + NoSymlinkFollow, +} + +/// Link one file to another file +/// +/// Creates a new link (directory entry) at `newpath` for the existing file at `oldpath`. In the +/// case of a relative `oldpath`, the path is interpreted relative to the directory associated +/// with file descriptor `olddirfd` instead of the current working directory and similiarly for +/// `newpath` and file descriptor `newdirfd`. In case `flag` is LinkatFlags::SymlinkFollow and +/// `oldpath` names a symoblic link, a new link for the target of the symbolic link is created. +/// If either `olddirfd` or `newdirfd` is `None`, `AT_FDCWD` is used respectively where `oldpath` +/// and/or `newpath` is then interpreted relative to the current working directory of the calling +/// process. If either `oldpath` or `newpath` is absolute, then `dirfd` is ignored. +/// +/// # References +/// See also [linkat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html) +#[cfg(not(target_os = "redox"))] // RedoxFS does not support symlinks yet +pub fn linkat( + olddirfd: Option, + oldpath: &P, + newdirfd: Option, + newpath: &P, + flag: LinkatFlags, +) -> Result<()> { + + let atflag = + match flag { + LinkatFlags::SymlinkFollow => AtFlags::AT_SYMLINK_FOLLOW, + LinkatFlags::NoSymlinkFollow => AtFlags::empty(), + }; + + let res = + oldpath.with_nix_path(|oldcstr| { + newpath.with_nix_path(|newcstr| { + unsafe { + libc::linkat( + at_rawfd(olddirfd), + oldcstr.as_ptr(), + at_rawfd(newdirfd), + newcstr.as_ptr(), + atflag.bits() as libc::c_int + ) + } + }) + })??; + Errno::result(res).map(drop) +} + + +/// Remove a directory entry +/// +/// See also [unlink(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html) +pub fn unlink(path: &P) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::unlink(cstr.as_ptr()) + } + })?; + Errno::result(res).map(drop) +} + +/// Flags for `unlinkat` function. +#[derive(Clone, Copy, Debug)] +pub enum UnlinkatFlags { + RemoveDir, + NoRemoveDir, +} + +/// Remove a directory entry +/// +/// In the case of a relative path, the directory entry to be removed is determined relative to +/// the directory associated with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. In the case of an absolute `path` `dirfd` is ignored. If `flag` is +/// `UnlinkatFlags::RemoveDir` then removal of the directory entry specified by `dirfd` and `path` +/// is performed. +/// +/// # References +/// See also [unlinkat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html) +#[cfg(not(target_os = "redox"))] +pub fn unlinkat( + dirfd: Option, + path: &P, + flag: UnlinkatFlags, +) -> Result<()> { + let atflag = + match flag { + UnlinkatFlags::RemoveDir => AtFlags::AT_REMOVEDIR, + UnlinkatFlags::NoRemoveDir => AtFlags::empty(), + }; + let res = path.with_nix_path(|cstr| { + unsafe { + libc::unlinkat(at_rawfd(dirfd), cstr.as_ptr(), atflag.bits() as libc::c_int) + } + })?; + Errno::result(res).map(drop) +} + + +#[inline] +#[cfg(not(target_os = "fuchsia"))] +pub fn chroot(path: &P) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::chroot(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) +} + +/// Commit filesystem caches to disk +/// +/// See also [sync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sync.html) +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd" +))] +pub fn sync() { + unsafe { libc::sync() }; +} + +/// Synchronize changes to a file +/// +/// See also [fsync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html) +#[inline] +pub fn fsync(fd: RawFd) -> Result<()> { + let res = unsafe { libc::fsync(fd) }; + + Errno::result(res).map(drop) +} + +/// Synchronize the data of a file +/// +/// See also +/// [fdatasync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html) +#[cfg(any(target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "netbsd", + target_os = "openbsd", + target_os = "illumos", + target_os = "solaris"))] +#[inline] +pub fn fdatasync(fd: RawFd) -> Result<()> { + let res = unsafe { libc::fdatasync(fd) }; + + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "user"] + +/// Get a real user ID +/// +/// See also [getuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getuid.html) +// POSIX requires that getuid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn getuid() -> Uid { + Uid(unsafe { libc::getuid() }) +} + +/// Get the effective user ID +/// +/// See also [geteuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/geteuid.html) +// POSIX requires that geteuid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn geteuid() -> Uid { + Uid(unsafe { libc::geteuid() }) +} + +/// Get the real group ID +/// +/// See also [getgid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getgid.html) +// POSIX requires that getgid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn getgid() -> Gid { + Gid(unsafe { libc::getgid() }) +} + +/// Get the effective group ID +/// +/// See also [getegid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getegid.html) +// POSIX requires that getegid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn getegid() -> Gid { + Gid(unsafe { libc::getegid() }) +} + +/// Set the effective user ID +/// +/// See also [seteuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/seteuid.html) +#[inline] +pub fn seteuid(euid: Uid) -> Result<()> { + let res = unsafe { libc::seteuid(euid.into()) }; + + Errno::result(res).map(drop) +} + +/// Set the effective group ID +/// +/// See also [setegid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setegid.html) +#[inline] +pub fn setegid(egid: Gid) -> Result<()> { + let res = unsafe { libc::setegid(egid.into()) }; + + Errno::result(res).map(drop) +} + +/// Set the user ID +/// +/// See also [setuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setuid.html) +#[inline] +pub fn setuid(uid: Uid) -> Result<()> { + let res = unsafe { libc::setuid(uid.into()) }; + + Errno::result(res).map(drop) +} + +/// Set the group ID +/// +/// See also [setgid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setgid.html) +#[inline] +pub fn setgid(gid: Gid) -> Result<()> { + let res = unsafe { libc::setgid(gid.into()) }; + + Errno::result(res).map(drop) +} +} + +feature! { +#![all(feature = "fs", feature = "user")] +/// Set the user identity used for filesystem checks per-thread. +/// On both success and failure, this call returns the previous filesystem user +/// ID of the caller. +/// +/// See also [setfsuid(2)](https://man7.org/linux/man-pages/man2/setfsuid.2.html) +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn setfsuid(uid: Uid) -> Uid { + let prev_fsuid = unsafe { libc::setfsuid(uid.into()) }; + Uid::from_raw(prev_fsuid as uid_t) +} + +/// Set the group identity used for filesystem checks per-thread. +/// On both success and failure, this call returns the previous filesystem group +/// ID of the caller. +/// +/// See also [setfsgid(2)](https://man7.org/linux/man-pages/man2/setfsgid.2.html) +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn setfsgid(gid: Gid) -> Gid { + let prev_fsgid = unsafe { libc::setfsgid(gid.into()) }; + Gid::from_raw(prev_fsgid as gid_t) +} +} + +feature! { +#![feature = "user"] + +/// Get the list of supplementary group IDs of the calling process. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/009695399/functions/getgroups.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, checking group membership should be achieved via communication +/// with the `opendirectoryd` service. +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +pub fn getgroups() -> Result> { + // First get the maximum number of groups. The value returned + // shall always be greater than or equal to one and less than or + // equal to the value of {NGROUPS_MAX} + 1. + let ngroups_max = match sysconf(SysconfVar::NGROUPS_MAX) { + Ok(Some(n)) => (n + 1) as usize, + Ok(None) | Err(_) => ::max_value(), + }; + + // Next, get the number of groups so we can size our Vec + let ngroups = unsafe { libc::getgroups(0, ptr::null_mut()) }; + + // If there are no supplementary groups, return early. + // This prevents a potential buffer over-read if the number of groups + // increases from zero before the next call. It would return the total + // number of groups beyond the capacity of the buffer. + if ngroups == 0 { + return Ok(Vec::new()); + } + + // Now actually get the groups. We try multiple times in case the number of + // groups has changed since the first call to getgroups() and the buffer is + // now too small. + let mut groups = Vec::::with_capacity(Errno::result(ngroups)? as usize); + loop { + // FIXME: On the platforms we currently support, the `Gid` struct has + // the same representation in memory as a bare `gid_t`. This is not + // necessarily the case on all Rust platforms, though. See RFC 1785. + let ngroups = unsafe { + libc::getgroups(groups.capacity() as c_int, groups.as_mut_ptr() as *mut gid_t) + }; + + match Errno::result(ngroups) { + Ok(s) => { + unsafe { groups.set_len(s as usize) }; + return Ok(groups); + }, + Err(Errno::EINVAL) => { + // EINVAL indicates that the buffer size was too + // small, resize it up to ngroups_max as limit. + reserve_double_buffer_size(&mut groups, ngroups_max) + .or(Err(Errno::EINVAL))?; + }, + Err(e) => return Err(e) + } + } +} + +/// Set the list of supplementary group IDs for the calling process. +/// +/// [Further reading](https://man7.org/linux/man-pages/man2/getgroups.2.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, group membership management should be achieved via communication +/// with the `opendirectoryd` service. +/// +/// # Examples +/// +/// `setgroups` can be used when dropping privileges from the root user to a +/// specific user and group. For example, given the user `www-data` with UID +/// `33` and the group `backup` with the GID `34`, one could switch the user as +/// follows: +/// +/// ```rust,no_run +/// # use std::error::Error; +/// # use nix::unistd::*; +/// # +/// # fn try_main() -> Result<(), Box> { +/// let uid = Uid::from_raw(33); +/// let gid = Gid::from_raw(34); +/// setgroups(&[gid])?; +/// setgid(gid)?; +/// setuid(uid)?; +/// # +/// # Ok(()) +/// # } +/// # +/// # try_main().unwrap(); +/// ``` +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] +pub fn setgroups(groups: &[Gid]) -> Result<()> { + cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] { + type setgroups_ngroups_t = c_int; + } else { + type setgroups_ngroups_t = size_t; + } + } + // FIXME: On the platforms we currently support, the `Gid` struct has the + // same representation in memory as a bare `gid_t`. This is not necessarily + // the case on all Rust platforms, though. See RFC 1785. + let res = unsafe { + libc::setgroups(groups.len() as setgroups_ngroups_t, groups.as_ptr() as *const gid_t) + }; + + Errno::result(res).map(drop) +} + +/// Calculate the supplementary group access list. +/// +/// Gets the group IDs of all groups that `user` is a member of. The additional +/// group `group` is also added to the list. +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/getgrouplist.3.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, checking group membership should be achieved via communication +/// with the `opendirectoryd` service. +/// +/// # Errors +/// +/// Although the `getgrouplist()` call does not return any specific +/// errors on any known platforms, this implementation will return a system +/// error of `EINVAL` if the number of groups to be fetched exceeds the +/// `NGROUPS_MAX` sysconf value. This mimics the behaviour of `getgroups()` +/// and `setgroups()`. Additionally, while some implementations will return a +/// partial list of groups when `NGROUPS_MAX` is exceeded, this implementation +/// will only ever return the complete list or else an error. +#[cfg(not(any(target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "redox")))] +pub fn getgrouplist(user: &CStr, group: Gid) -> Result> { + let ngroups_max = match sysconf(SysconfVar::NGROUPS_MAX) { + Ok(Some(n)) => n as c_int, + Ok(None) | Err(_) => ::max_value(), + }; + use std::cmp::min; + let mut groups = Vec::::with_capacity(min(ngroups_max, 8) as usize); + cfg_if! { + if #[cfg(any(target_os = "ios", target_os = "macos"))] { + type getgrouplist_group_t = c_int; + } else { + type getgrouplist_group_t = gid_t; + } + } + let gid: gid_t = group.into(); + loop { + let mut ngroups = groups.capacity() as i32; + let ret = unsafe { + libc::getgrouplist(user.as_ptr(), + gid as getgrouplist_group_t, + groups.as_mut_ptr() as *mut getgrouplist_group_t, + &mut ngroups) + }; + + // BSD systems only return 0 or -1, Linux returns ngroups on success. + if ret >= 0 { + unsafe { groups.set_len(ngroups as usize) }; + return Ok(groups); + } else if ret == -1 { + // Returns -1 if ngroups is too small, but does not set errno. + // BSD systems will still fill the groups buffer with as many + // groups as possible, but Linux manpages do not mention this + // behavior. + reserve_double_buffer_size(&mut groups, ngroups_max as usize) + .map_err(|_| Errno::EINVAL)?; + } + } +} + +/// Initialize the supplementary group access list. +/// +/// Sets the supplementary group IDs for the calling process using all groups +/// that `user` is a member of. The additional group `group` is also added to +/// the list. +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/initgroups.3.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, group membership management should be achieved via communication +/// with the `opendirectoryd` service. +/// +/// # Examples +/// +/// `initgroups` can be used when dropping privileges from the root user to +/// another user. For example, given the user `www-data`, we could look up the +/// UID and GID for the user in the system's password database (usually found +/// in `/etc/passwd`). If the `www-data` user's UID and GID were `33` and `33`, +/// respectively, one could switch the user as follows: +/// +/// ```rust,no_run +/// # use std::error::Error; +/// # use std::ffi::CString; +/// # use nix::unistd::*; +/// # +/// # fn try_main() -> Result<(), Box> { +/// let user = CString::new("www-data").unwrap(); +/// let uid = Uid::from_raw(33); +/// let gid = Gid::from_raw(33); +/// initgroups(&user, gid)?; +/// setgid(gid)?; +/// setuid(uid)?; +/// # +/// # Ok(()) +/// # } +/// # +/// # try_main().unwrap(); +/// ``` +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] +pub fn initgroups(user: &CStr, group: Gid) -> Result<()> { + cfg_if! { + if #[cfg(any(target_os = "ios", target_os = "macos"))] { + type initgroups_group_t = c_int; + } else { + type initgroups_group_t = gid_t; + } + } + let gid: gid_t = group.into(); + let res = unsafe { libc::initgroups(user.as_ptr(), gid as initgroups_group_t) }; + + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "signal"] + +/// Suspend the thread until a signal is received. +/// +/// See also [pause(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html). +#[inline] +#[cfg(not(target_os = "redox"))] +pub fn pause() { + unsafe { libc::pause() }; +} + +pub mod alarm { + //! Alarm signal scheduling. + //! + //! Scheduling an alarm will trigger a `SIGALRM` signal when the time has + //! elapsed, which has to be caught, because the default action for the + //! signal is to terminate the program. This signal also can't be ignored + //! because the system calls like `pause` will not be interrupted, see the + //! second example below. + //! + //! # Examples + //! + //! Canceling an alarm: + //! + //! ``` + //! use nix::unistd::alarm; + //! + //! // Set an alarm for 60 seconds from now. + //! alarm::set(60); + //! + //! // Cancel the above set alarm, which returns the number of seconds left + //! // of the previously set alarm. + //! assert_eq!(alarm::cancel(), Some(60)); + //! ``` + //! + //! Scheduling an alarm and waiting for the signal: + //! +#![cfg_attr(target_os = "redox", doc = " ```rust,ignore")] +#![cfg_attr(not(target_os = "redox"), doc = " ```rust")] + //! use std::time::{Duration, Instant}; + //! + //! use nix::unistd::{alarm, pause}; + //! use nix::sys::signal::*; + //! + //! // We need to setup an empty signal handler to catch the alarm signal, + //! // otherwise the program will be terminated once the signal is delivered. + //! extern fn signal_handler(_: nix::libc::c_int) { } + //! let sa = SigAction::new( + //! SigHandler::Handler(signal_handler), + //! SaFlags::SA_RESTART, + //! SigSet::empty() + //! ); + //! unsafe { + //! sigaction(Signal::SIGALRM, &sa); + //! } + //! + //! let start = Instant::now(); + //! + //! // Set an alarm for 1 second from now. + //! alarm::set(1); + //! + //! // Pause the process until the alarm signal is received. + //! let mut sigset = SigSet::empty(); + //! sigset.add(Signal::SIGALRM); + //! sigset.wait(); + //! + //! assert!(start.elapsed() >= Duration::from_secs(1)); + //! ``` + //! + //! # References + //! + //! See also [alarm(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/alarm.html). + + /// Schedule an alarm signal. + /// + /// This will cause the system to generate a `SIGALRM` signal for the + /// process after the specified number of seconds have elapsed. + /// + /// Returns the leftover time of a previously set alarm if there was one. + pub fn set(secs: libc::c_uint) -> Option { + assert!(secs != 0, "passing 0 to `alarm::set` is not allowed, to cancel an alarm use `alarm::cancel`"); + alarm(secs) + } + + /// Cancel an previously set alarm signal. + /// + /// Returns the leftover time of a previously set alarm if there was one. + pub fn cancel() -> Option { + alarm(0) + } + + fn alarm(secs: libc::c_uint) -> Option { + match unsafe { libc::alarm(secs) } { + 0 => None, + secs => Some(secs), + } + } +} +} + +/// Suspend execution for an interval of time +/// +/// See also [sleep(2)](https://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html#tag_03_705_05) +// Per POSIX, does not fail +#[inline] +pub fn sleep(seconds: c_uint) -> c_uint { + unsafe { libc::sleep(seconds) } +} + +feature! { +#![feature = "acct"] + +#[cfg(not(target_os = "redox"))] +pub mod acct { + use crate::{Result, NixPath}; + use crate::errno::Errno; + use std::ptr; + + /// Enable process accounting + /// + /// See also [acct(2)](https://linux.die.net/man/2/acct) + pub fn enable(filename: &P) -> Result<()> { + let res = filename.with_nix_path(|cstr| { + unsafe { libc::acct(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) + } + + /// Disable process accounting + pub fn disable() -> Result<()> { + let res = unsafe { libc::acct(ptr::null()) }; + + Errno::result(res).map(drop) + } +} +} + +feature! { +#![feature = "fs"] +/// Creates a regular file which persists even after process termination +/// +/// * `template`: a path whose 6 rightmost characters must be X, e.g. `/tmp/tmpfile_XXXXXX` +/// * returns: tuple of file descriptor and filename +/// +/// Err is returned either if no temporary filename could be created or the template doesn't +/// end with XXXXXX +/// +/// See also [mkstemp(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkstemp.html) +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// +/// let _ = match unistd::mkstemp("/tmp/tempfile_XXXXXX") { +/// Ok((fd, path)) => { +/// unistd::unlink(path.as_path()).unwrap(); // flag file to be deleted at app termination +/// fd +/// } +/// Err(e) => panic!("mkstemp failed: {}", e) +/// }; +/// // do something with fd +/// ``` +#[inline] +pub fn mkstemp(template: &P) -> Result<(RawFd, PathBuf)> { + let mut path = template.with_nix_path(|path| {path.to_bytes_with_nul().to_owned()})?; + let p = path.as_mut_ptr() as *mut _; + let fd = unsafe { libc::mkstemp(p) }; + let last = path.pop(); // drop the trailing nul + debug_assert!(last == Some(b'\0')); + let pathname = OsString::from_vec(path); + Errno::result(fd)?; + Ok((fd, PathBuf::from(pathname))) +} +} + +feature! { +#![all(feature = "fs", feature = "feature")] + +/// Variable names for `pathconf` +/// +/// Nix uses the same naming convention for these variables as the +/// [getconf(1)](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html) utility. +/// That is, `PathconfVar` variables have the same name as the abstract +/// variables shown in the `pathconf(2)` man page. Usually, it's the same as +/// the C variable name without the leading `_PC_`. +/// +/// POSIX 1003.1-2008 standardizes all of these variables, but some OSes choose +/// not to implement variables that cannot change at runtime. +/// +/// # References +/// +/// - [pathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html) +/// - [limits.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) +/// - [unistd.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html) +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(i32)] +#[non_exhaustive] +pub enum PathconfVar { + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "linux", + target_os = "netbsd", target_os = "openbsd", target_os = "redox"))] + /// Minimum number of bits needed to represent, as a signed integer value, + /// the maximum size of a regular file allowed in the specified directory. + #[cfg_attr(docsrs, doc(cfg(all())))] + FILESIZEBITS = libc::_PC_FILESIZEBITS, + /// Maximum number of links to a single file. + LINK_MAX = libc::_PC_LINK_MAX, + /// Maximum number of bytes in a terminal canonical input line. + MAX_CANON = libc::_PC_MAX_CANON, + /// Minimum number of bytes for which space is available in a terminal input + /// queue; therefore, the maximum number of bytes a conforming application + /// may require to be typed as input before reading them. + MAX_INPUT = libc::_PC_MAX_INPUT, + /// Maximum number of bytes in a filename (not including the terminating + /// null of a filename string). + NAME_MAX = libc::_PC_NAME_MAX, + /// Maximum number of bytes the implementation will store as a pathname in a + /// user-supplied buffer of unspecified size, including the terminating null + /// character. Minimum number the implementation will accept as the maximum + /// number of bytes in a pathname. + PATH_MAX = libc::_PC_PATH_MAX, + /// Maximum number of bytes that is guaranteed to be atomic when writing to + /// a pipe. + PIPE_BUF = libc::_PC_PIPE_BUF, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "illumos", + target_os = "linux", target_os = "netbsd", target_os = "openbsd", + target_os = "redox", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Symbolic links can be created. + POSIX2_SYMLINKS = libc::_PC_2_SYMLINKS, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Minimum number of bytes of storage actually allocated for any portion of + /// a file. + POSIX_ALLOC_SIZE_MIN = libc::_PC_ALLOC_SIZE_MIN, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Recommended increment for file transfer sizes between the + /// `POSIX_REC_MIN_XFER_SIZE` and `POSIX_REC_MAX_XFER_SIZE` values. + POSIX_REC_INCR_XFER_SIZE = libc::_PC_REC_INCR_XFER_SIZE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Maximum recommended file transfer size. + POSIX_REC_MAX_XFER_SIZE = libc::_PC_REC_MAX_XFER_SIZE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Minimum recommended file transfer size. + POSIX_REC_MIN_XFER_SIZE = libc::_PC_REC_MIN_XFER_SIZE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Recommended file transfer buffer alignment. + POSIX_REC_XFER_ALIGN = libc::_PC_REC_XFER_ALIGN, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "netbsd", + target_os = "openbsd", target_os = "redox", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Maximum number of bytes in a symbolic link. + SYMLINK_MAX = libc::_PC_SYMLINK_MAX, + /// The use of `chown` and `fchown` is restricted to a process with + /// appropriate privileges, and to changing the group ID of a file only to + /// the effective group ID of the process or to one of its supplementary + /// group IDs. + _POSIX_CHOWN_RESTRICTED = libc::_PC_CHOWN_RESTRICTED, + /// Pathname components longer than {NAME_MAX} generate an error. + _POSIX_NO_TRUNC = libc::_PC_NO_TRUNC, + /// This symbol shall be defined to be the value of a character that shall + /// disable terminal special character handling. + _POSIX_VDISABLE = libc::_PC_VDISABLE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "openbsd", + target_os = "redox", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Asynchronous input or output operations may be performed for the + /// associated file. + _POSIX_ASYNC_IO = libc::_PC_ASYNC_IO, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "openbsd", + target_os = "redox", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Prioritized input or output operations may be performed for the + /// associated file. + _POSIX_PRIO_IO = libc::_PC_PRIO_IO, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "netbsd", + target_os = "openbsd", target_os = "redox", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Synchronized input or output operations may be performed for the + /// associated file. + _POSIX_SYNC_IO = libc::_PC_SYNC_IO, + #[cfg(any(target_os = "dragonfly", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The resolution in nanoseconds for all file timestamps. + _POSIX_TIMESTAMP_RESOLUTION = libc::_PC_TIMESTAMP_RESOLUTION +} + +/// Like `pathconf`, but works with file descriptors instead of paths (see +/// [fpathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html)) +/// +/// # Parameters +/// +/// - `fd`: The file descriptor whose variable should be interrogated +/// - `var`: The pathconf variable to lookup +/// +/// # Returns +/// +/// - `Ok(Some(x))`: the variable's limit (for limit variables) or its +/// implementation level (for option variables). Implementation levels are +/// usually a decimal-coded date, such as 200112 for POSIX 2001.12 +/// - `Ok(None)`: the variable has no limit (for limit variables) or is +/// unsupported (for option variables) +/// - `Err(x)`: an error occurred +pub fn fpathconf(fd: RawFd, var: PathconfVar) -> Result> { + let raw = unsafe { + Errno::clear(); + libc::fpathconf(fd, var as c_int) + }; + if raw == -1 { + if errno::errno() == 0 { + Ok(None) + } else { + Err(Errno::last()) + } + } else { + Ok(Some(raw)) + } +} + +/// Get path-dependent configurable system variables (see +/// [pathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html)) +/// +/// Returns the value of a path-dependent configurable system variable. Most +/// supported variables also have associated compile-time constants, but POSIX +/// allows their values to change at runtime. There are generally two types of +/// `pathconf` variables: options and limits. See [pathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html) for more details. +/// +/// # Parameters +/// +/// - `path`: Lookup the value of `var` for this file or directory +/// - `var`: The `pathconf` variable to lookup +/// +/// # Returns +/// +/// - `Ok(Some(x))`: the variable's limit (for limit variables) or its +/// implementation level (for option variables). Implementation levels are +/// usually a decimal-coded date, such as 200112 for POSIX 2001.12 +/// - `Ok(None)`: the variable has no limit (for limit variables) or is +/// unsupported (for option variables) +/// - `Err(x)`: an error occurred +pub fn pathconf(path: &P, var: PathconfVar) -> Result> { + let raw = path.with_nix_path(|cstr| { + unsafe { + Errno::clear(); + libc::pathconf(cstr.as_ptr(), var as c_int) + } + })?; + if raw == -1 { + if errno::errno() == 0 { + Ok(None) + } else { + Err(Errno::last()) + } + } else { + Ok(Some(raw)) + } +} +} + +feature! { +#![feature = "feature"] + +/// Variable names for `sysconf` +/// +/// Nix uses the same naming convention for these variables as the +/// [getconf(1)](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html) utility. +/// That is, `SysconfVar` variables have the same name as the abstract variables +/// shown in the `sysconf(3)` man page. Usually, it's the same as the C +/// variable name without the leading `_SC_`. +/// +/// All of these symbols are standardized by POSIX 1003.1-2008, but haven't been +/// implemented by all platforms. +/// +/// # References +/// +/// - [sysconf(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html) +/// - [unistd.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html) +/// - [limits.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(i32)] +#[non_exhaustive] +pub enum SysconfVar { + /// Maximum number of I/O operations in a single list I/O call supported by + /// the implementation. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AIO_LISTIO_MAX = libc::_SC_AIO_LISTIO_MAX, + /// Maximum number of outstanding asynchronous I/O operations supported by + /// the implementation. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AIO_MAX = libc::_SC_AIO_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum amount by which a process can decrease its asynchronous I/O + /// priority level from its own scheduling priority. + AIO_PRIO_DELTA_MAX = libc::_SC_AIO_PRIO_DELTA_MAX, + /// Maximum length of argument to the exec functions including environment data. + ARG_MAX = libc::_SC_ARG_MAX, + /// Maximum number of functions that may be registered with `atexit`. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ATEXIT_MAX = libc::_SC_ATEXIT_MAX, + /// Maximum obase values allowed by the bc utility. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BC_BASE_MAX = libc::_SC_BC_BASE_MAX, + /// Maximum number of elements permitted in an array by the bc utility. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BC_DIM_MAX = libc::_SC_BC_DIM_MAX, + /// Maximum scale value allowed by the bc utility. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BC_SCALE_MAX = libc::_SC_BC_SCALE_MAX, + /// Maximum length of a string constant accepted by the bc utility. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BC_STRING_MAX = libc::_SC_BC_STRING_MAX, + /// Maximum number of simultaneous processes per real user ID. + CHILD_MAX = libc::_SC_CHILD_MAX, + // The number of clock ticks per second. + CLK_TCK = libc::_SC_CLK_TCK, + /// Maximum number of weights that can be assigned to an entry of the + /// LC_COLLATE order keyword in the locale definition file + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + COLL_WEIGHTS_MAX = libc::_SC_COLL_WEIGHTS_MAX, + /// Maximum number of timer expiration overruns. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + DELAYTIMER_MAX = libc::_SC_DELAYTIMER_MAX, + /// Maximum number of expressions that can be nested within parentheses by + /// the expr utility. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + EXPR_NEST_MAX = libc::_SC_EXPR_NEST_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Maximum length of a host name (not including the terminating null) as + /// returned from the `gethostname` function + HOST_NAME_MAX = libc::_SC_HOST_NAME_MAX, + /// Maximum number of iovec structures that one process has available for + /// use with `readv` or `writev`. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IOV_MAX = libc::_SC_IOV_MAX, + /// Unless otherwise noted, the maximum length, in bytes, of a utility's + /// input line (either standard input or another file), when the utility is + /// described as processing text files. The length includes room for the + /// trailing . + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + LINE_MAX = libc::_SC_LINE_MAX, + /// Maximum length of a login name. + LOGIN_NAME_MAX = libc::_SC_LOGIN_NAME_MAX, + /// Maximum number of simultaneous supplementary group IDs per process. + NGROUPS_MAX = libc::_SC_NGROUPS_MAX, + /// Initial size of `getgrgid_r` and `getgrnam_r` data buffers + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + GETGR_R_SIZE_MAX = libc::_SC_GETGR_R_SIZE_MAX, + /// Initial size of `getpwuid_r` and `getpwnam_r` data buffers + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + GETPW_R_SIZE_MAX = libc::_SC_GETPW_R_SIZE_MAX, + /// The maximum number of open message queue descriptors a process may hold. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MQ_OPEN_MAX = libc::_SC_MQ_OPEN_MAX, + /// The maximum number of message priorities supported by the implementation. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MQ_PRIO_MAX = libc::_SC_MQ_PRIO_MAX, + /// A value one greater than the maximum value that the system may assign to + /// a newly-created file descriptor. + OPEN_MAX = libc::_SC_OPEN_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Advisory Information option. + _POSIX_ADVISORY_INFO = libc::_SC_ADVISORY_INFO, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports barriers. + _POSIX_BARRIERS = libc::_SC_BARRIERS, + /// The implementation supports asynchronous input and output. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_ASYNCHRONOUS_IO = libc::_SC_ASYNCHRONOUS_IO, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports clock selection. + _POSIX_CLOCK_SELECTION = libc::_SC_CLOCK_SELECTION, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Process CPU-Time Clocks option. + _POSIX_CPUTIME = libc::_SC_CPUTIME, + /// The implementation supports the File Synchronization option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_FSYNC = libc::_SC_FSYNC, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the IPv6 option. + _POSIX_IPV6 = libc::_SC_IPV6, + /// The implementation supports job control. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_JOB_CONTROL = libc::_SC_JOB_CONTROL, + /// The implementation supports memory mapped Files. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MAPPED_FILES = libc::_SC_MAPPED_FILES, + /// The implementation supports the Process Memory Locking option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MEMLOCK = libc::_SC_MEMLOCK, + /// The implementation supports the Range Memory Locking option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MEMLOCK_RANGE = libc::_SC_MEMLOCK_RANGE, + /// The implementation supports memory protection. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MEMORY_PROTECTION = libc::_SC_MEMORY_PROTECTION, + /// The implementation supports the Message Passing option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MESSAGE_PASSING = libc::_SC_MESSAGE_PASSING, + /// The implementation supports the Monotonic Clock option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MONOTONIC_CLOCK = libc::_SC_MONOTONIC_CLOCK, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "illumos", target_os = "ios", target_os="linux", + target_os = "macos", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Prioritized Input and Output option. + _POSIX_PRIORITIZED_IO = libc::_SC_PRIORITIZED_IO, + /// The implementation supports the Process Scheduling option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_PRIORITY_SCHEDULING = libc::_SC_PRIORITY_SCHEDULING, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Raw Sockets option. + _POSIX_RAW_SOCKETS = libc::_SC_RAW_SOCKETS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports read-write locks. + _POSIX_READER_WRITER_LOCKS = libc::_SC_READER_WRITER_LOCKS, + #[cfg(any(target_os = "android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports realtime signals. + _POSIX_REALTIME_SIGNALS = libc::_SC_REALTIME_SIGNALS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Regular Expression Handling option. + _POSIX_REGEXP = libc::_SC_REGEXP, + /// Each process has a saved set-user-ID and a saved set-group-ID. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_SAVED_IDS = libc::_SC_SAVED_IDS, + /// The implementation supports semaphores. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_SEMAPHORES = libc::_SC_SEMAPHORES, + /// The implementation supports the Shared Memory Objects option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_SHARED_MEMORY_OBJECTS = libc::_SC_SHARED_MEMORY_OBJECTS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the POSIX shell. + _POSIX_SHELL = libc::_SC_SHELL, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Spawn option. + _POSIX_SPAWN = libc::_SC_SPAWN, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports spin locks. + _POSIX_SPIN_LOCKS = libc::_SC_SPIN_LOCKS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Process Sporadic Server option. + _POSIX_SPORADIC_SERVER = libc::_SC_SPORADIC_SERVER, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_SS_REPL_MAX = libc::_SC_SS_REPL_MAX, + /// The implementation supports the Synchronized Input and Output option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_SYNCHRONIZED_IO = libc::_SC_SYNCHRONIZED_IO, + /// The implementation supports the Thread Stack Address Attribute option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_ATTR_STACKADDR = libc::_SC_THREAD_ATTR_STACKADDR, + /// The implementation supports the Thread Stack Size Attribute option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_ATTR_STACKSIZE = libc::_SC_THREAD_ATTR_STACKSIZE, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Thread CPU-Time Clocks option. + _POSIX_THREAD_CPUTIME = libc::_SC_THREAD_CPUTIME, + /// The implementation supports the Non-Robust Mutex Priority Inheritance + /// option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_PRIO_INHERIT = libc::_SC_THREAD_PRIO_INHERIT, + /// The implementation supports the Non-Robust Mutex Priority Protection option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_PRIO_PROTECT = libc::_SC_THREAD_PRIO_PROTECT, + /// The implementation supports the Thread Execution Scheduling option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_PRIORITY_SCHEDULING = libc::_SC_THREAD_PRIORITY_SCHEDULING, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Thread Process-Shared Synchronization + /// option. + _POSIX_THREAD_PROCESS_SHARED = libc::_SC_THREAD_PROCESS_SHARED, + #[cfg(any(target_os="dragonfly", target_os="linux", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Robust Mutex Priority Inheritance option. + _POSIX_THREAD_ROBUST_PRIO_INHERIT = libc::_SC_THREAD_ROBUST_PRIO_INHERIT, + #[cfg(any(target_os="dragonfly", target_os="linux", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Robust Mutex Priority Protection option. + _POSIX_THREAD_ROBUST_PRIO_PROTECT = libc::_SC_THREAD_ROBUST_PRIO_PROTECT, + /// The implementation supports thread-safe functions. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_SAFE_FUNCTIONS = libc::_SC_THREAD_SAFE_FUNCTIONS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Thread Sporadic Server option. + _POSIX_THREAD_SPORADIC_SERVER = libc::_SC_THREAD_SPORADIC_SERVER, + /// The implementation supports threads. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREADS = libc::_SC_THREADS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports timeouts. + _POSIX_TIMEOUTS = libc::_SC_TIMEOUTS, + /// The implementation supports timers. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_TIMERS = libc::_SC_TIMERS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Trace option. + _POSIX_TRACE = libc::_SC_TRACE, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Trace Event Filter option. + _POSIX_TRACE_EVENT_FILTER = libc::_SC_TRACE_EVENT_FILTER, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_TRACE_EVENT_NAME_MAX = libc::_SC_TRACE_EVENT_NAME_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Trace Inherit option. + _POSIX_TRACE_INHERIT = libc::_SC_TRACE_INHERIT, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Trace Log option. + _POSIX_TRACE_LOG = libc::_SC_TRACE_LOG, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_TRACE_NAME_MAX = libc::_SC_TRACE_NAME_MAX, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_TRACE_SYS_MAX = libc::_SC_TRACE_SYS_MAX, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_TRACE_USER_EVENT_MAX = libc::_SC_TRACE_USER_EVENT_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Typed Memory Objects option. + _POSIX_TYPED_MEMORY_OBJECTS = libc::_SC_TYPED_MEMORY_OBJECTS, + /// Integer value indicating version of this standard (C-language binding) + /// to which the implementation conforms. For implementations conforming to + /// POSIX.1-2008, the value shall be 200809L. + _POSIX_VERSION = libc::_SC_VERSION, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation provides a C-language compilation environment with + /// 32-bit `int`, `long`, `pointer`, and `off_t` types. + _POSIX_V6_ILP32_OFF32 = libc::_SC_V6_ILP32_OFF32, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation provides a C-language compilation environment with + /// 32-bit `int`, `long`, and pointer types and an `off_t` type using at + /// least 64 bits. + _POSIX_V6_ILP32_OFFBIG = libc::_SC_V6_ILP32_OFFBIG, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation provides a C-language compilation environment with + /// 32-bit `int` and 64-bit `long`, `pointer`, and `off_t` types. + _POSIX_V6_LP64_OFF64 = libc::_SC_V6_LP64_OFF64, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation provides a C-language compilation environment with an + /// `int` type using at least 32 bits and `long`, pointer, and `off_t` types + /// using at least 64 bits. + _POSIX_V6_LPBIG_OFFBIG = libc::_SC_V6_LPBIG_OFFBIG, + /// The implementation supports the C-Language Binding option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_C_BIND = libc::_SC_2_C_BIND, + /// The implementation supports the C-Language Development Utilities option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_C_DEV = libc::_SC_2_C_DEV, + /// The implementation supports the Terminal Characteristics option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_CHAR_TERM = libc::_SC_2_CHAR_TERM, + /// The implementation supports the FORTRAN Development Utilities option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_FORT_DEV = libc::_SC_2_FORT_DEV, + /// The implementation supports the FORTRAN Runtime Utilities option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_FORT_RUN = libc::_SC_2_FORT_RUN, + /// The implementation supports the creation of locales by the localedef + /// utility. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_LOCALEDEF = libc::_SC_2_LOCALEDEF, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Batch Environment Services and Utilities + /// option. + _POSIX2_PBS = libc::_SC_2_PBS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Batch Accounting option. + _POSIX2_PBS_ACCOUNTING = libc::_SC_2_PBS_ACCOUNTING, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Batch Checkpoint/Restart option. + _POSIX2_PBS_CHECKPOINT = libc::_SC_2_PBS_CHECKPOINT, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Locate Batch Job Request option. + _POSIX2_PBS_LOCATE = libc::_SC_2_PBS_LOCATE, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Batch Job Message Request option. + _POSIX2_PBS_MESSAGE = libc::_SC_2_PBS_MESSAGE, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Track Batch Job Request option. + _POSIX2_PBS_TRACK = libc::_SC_2_PBS_TRACK, + /// The implementation supports the Software Development Utilities option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_SW_DEV = libc::_SC_2_SW_DEV, + /// The implementation supports the User Portability Utilities option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_UPE = libc::_SC_2_UPE, + /// Integer value indicating version of the Shell and Utilities volume of + /// POSIX.1 to which the implementation conforms. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_VERSION = libc::_SC_2_VERSION, + /// The size of a system page in bytes. + /// + /// POSIX also defines an alias named `PAGESIZE`, but Rust does not allow two + /// enum constants to have the same value, so nix omits `PAGESIZE`. + PAGE_SIZE = libc::_SC_PAGE_SIZE, + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTHREAD_DESTRUCTOR_ITERATIONS = libc::_SC_THREAD_DESTRUCTOR_ITERATIONS, + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTHREAD_KEYS_MAX = libc::_SC_THREAD_KEYS_MAX, + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTHREAD_STACK_MIN = libc::_SC_THREAD_STACK_MIN, + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTHREAD_THREADS_MAX = libc::_SC_THREAD_THREADS_MAX, + RE_DUP_MAX = libc::_SC_RE_DUP_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + RTSIG_MAX = libc::_SC_RTSIG_MAX, + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SEM_NSEMS_MAX = libc::_SC_SEM_NSEMS_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SEM_VALUE_MAX = libc::_SC_SEM_VALUE_MAX, + #[cfg(any(target_os = "android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SIGQUEUE_MAX = libc::_SC_SIGQUEUE_MAX, + STREAM_MAX = libc::_SC_STREAM_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SYMLOOP_MAX = libc::_SC_SYMLOOP_MAX, + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TIMER_MAX = libc::_SC_TIMER_MAX, + TTY_NAME_MAX = libc::_SC_TTY_NAME_MAX, + TZNAME_MAX = libc::_SC_TZNAME_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the X/Open Encryption Option Group. + _XOPEN_CRYPT = libc::_SC_XOPEN_CRYPT, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Issue 4, Version 2 Enhanced + /// Internationalization Option Group. + _XOPEN_ENH_I18N = libc::_SC_XOPEN_ENH_I18N, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _XOPEN_LEGACY = libc::_SC_XOPEN_LEGACY, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the X/Open Realtime Option Group. + _XOPEN_REALTIME = libc::_SC_XOPEN_REALTIME, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the X/Open Realtime Threads Option Group. + _XOPEN_REALTIME_THREADS = libc::_SC_XOPEN_REALTIME_THREADS, + /// The implementation supports the Issue 4, Version 2 Shared Memory Option + /// Group. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _XOPEN_SHM = libc::_SC_XOPEN_SHM, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the XSI STREAMS Option Group. + _XOPEN_STREAMS = libc::_SC_XOPEN_STREAMS, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the XSI option + _XOPEN_UNIX = libc::_SC_XOPEN_UNIX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Integer value indicating version of the X/Open Portability Guide to + /// which the implementation conforms. + _XOPEN_VERSION = libc::_SC_XOPEN_VERSION, +} + +/// Get configurable system variables (see +/// [sysconf(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html)) +/// +/// Returns the value of a configurable system variable. Most supported +/// variables also have associated compile-time constants, but POSIX +/// allows their values to change at runtime. There are generally two types of +/// sysconf variables: options and limits. See sysconf(3) for more details. +/// +/// # Returns +/// +/// - `Ok(Some(x))`: the variable's limit (for limit variables) or its +/// implementation level (for option variables). Implementation levels are +/// usually a decimal-coded date, such as 200112 for POSIX 2001.12 +/// - `Ok(None)`: the variable has no limit (for limit variables) or is +/// unsupported (for option variables) +/// - `Err(x)`: an error occurred +pub fn sysconf(var: SysconfVar) -> Result> { + let raw = unsafe { + Errno::clear(); + libc::sysconf(var as c_int) + }; + if raw == -1 { + if errno::errno() == 0 { + Ok(None) + } else { + Err(Errno::last()) + } + } else { + Ok(Some(raw)) + } +} +} + +feature! { +#![feature = "fs"] + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod pivot_root { + use crate::{Result, NixPath}; + use crate::errno::Errno; + + pub fn pivot_root( + new_root: &P1, put_old: &P2) -> Result<()> { + let res = new_root.with_nix_path(|new_root| { + put_old.with_nix_path(|put_old| { + unsafe { + libc::syscall(libc::SYS_pivot_root, new_root.as_ptr(), put_old.as_ptr()) + } + }) + })??; + + Errno::result(res).map(drop) + } +} +} + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] +mod setres { + feature! { + #![feature = "user"] + + use crate::Result; + use crate::errno::Errno; + use super::{Uid, Gid}; + + /// Sets the real, effective, and saved uid. + /// ([see setresuid(2)](https://man7.org/linux/man-pages/man2/setresuid.2.html)) + /// + /// * `ruid`: real user id + /// * `euid`: effective user id + /// * `suid`: saved user id + /// * returns: Ok or libc error code. + /// + /// Err is returned if the user doesn't have permission to set this UID. + #[inline] + pub fn setresuid(ruid: Uid, euid: Uid, suid: Uid) -> Result<()> { + let res = unsafe { libc::setresuid(ruid.into(), euid.into(), suid.into()) }; + + Errno::result(res).map(drop) + } + + /// Sets the real, effective, and saved gid. + /// ([see setresuid(2)](https://man7.org/linux/man-pages/man2/setresuid.2.html)) + /// + /// * `rgid`: real group id + /// * `egid`: effective group id + /// * `sgid`: saved group id + /// * returns: Ok or libc error code. + /// + /// Err is returned if the user doesn't have permission to set this GID. + #[inline] + pub fn setresgid(rgid: Gid, egid: Gid, sgid: Gid) -> Result<()> { + let res = unsafe { libc::setresgid(rgid.into(), egid.into(), sgid.into()) }; + + Errno::result(res).map(drop) + } + } +} + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] +mod getres { + feature! { + #![feature = "user"] + + use crate::Result; + use crate::errno::Errno; + use super::{Uid, Gid}; + + /// Real, effective and saved user IDs. + #[derive(Debug, Copy, Clone, Eq, PartialEq)] + pub struct ResUid { + pub real: Uid, + pub effective: Uid, + pub saved: Uid + } + + /// Real, effective and saved group IDs. + #[derive(Debug, Copy, Clone, Eq, PartialEq)] + pub struct ResGid { + pub real: Gid, + pub effective: Gid, + pub saved: Gid + } + + /// Gets the real, effective, and saved user IDs. + /// + /// ([see getresuid(2)](http://man7.org/linux/man-pages/man2/getresuid.2.html)) + /// + /// #Returns + /// + /// - `Ok((Uid, Uid, Uid))`: tuple of real, effective and saved uids on success. + /// - `Err(x)`: libc error code on failure. + /// + #[inline] + pub fn getresuid() -> Result { + let mut ruid = libc::uid_t::max_value(); + let mut euid = libc::uid_t::max_value(); + let mut suid = libc::uid_t::max_value(); + let res = unsafe { libc::getresuid(&mut ruid, &mut euid, &mut suid) }; + + Errno::result(res).map(|_| ResUid{ real: Uid(ruid), effective: Uid(euid), saved: Uid(suid) }) + } + + /// Gets the real, effective, and saved group IDs. + /// + /// ([see getresgid(2)](http://man7.org/linux/man-pages/man2/getresgid.2.html)) + /// + /// #Returns + /// + /// - `Ok((Gid, Gid, Gid))`: tuple of real, effective and saved gids on success. + /// - `Err(x)`: libc error code on failure. + /// + #[inline] + pub fn getresgid() -> Result { + let mut rgid = libc::gid_t::max_value(); + let mut egid = libc::gid_t::max_value(); + let mut sgid = libc::gid_t::max_value(); + let res = unsafe { libc::getresgid(&mut rgid, &mut egid, &mut sgid) }; + + Errno::result(res).map(|_| ResGid { real: Gid(rgid), effective: Gid(egid), saved: Gid(sgid) } ) + } + } +} + +#[cfg(feature = "fs")] +libc_bitflags!{ + /// Options for access() + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub struct AccessFlags : c_int { + /// Test for existence of file. + F_OK; + /// Test for read permission. + R_OK; + /// Test for write permission. + W_OK; + /// Test for execute (search) permission. + X_OK; + } +} + +feature! { +#![feature = "fs"] + +/// Checks the file named by `path` for accessibility according to the flags given by `amode` +/// See [access(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html) +pub fn access(path: &P, amode: AccessFlags) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::access(cstr.as_ptr(), amode.bits) + } + })?; + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "user"] + +/// Representation of a User, based on `libc::passwd` +/// +/// The reason some fields in this struct are `String` and others are `CString` is because some +/// fields are based on the user's locale, which could be non-UTF8, while other fields are +/// guaranteed to conform to [`NAME_REGEX`](https://serverfault.com/a/73101/407341), which only +/// contains ASCII. +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct User { + /// Username + pub name: String, + /// User password (probably encrypted) + pub passwd: CString, + /// User ID + pub uid: Uid, + /// Group ID + pub gid: Gid, + /// User information + #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] + pub gecos: CString, + /// Home directory + pub dir: PathBuf, + /// Path to shell + pub shell: PathBuf, + /// Login class + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub class: CString, + /// Last password change + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub change: libc::time_t, + /// Expiration time of account + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub expire: libc::time_t +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl From<&libc::passwd> for User { + fn from(pw: &libc::passwd) -> User { + unsafe { + User { + name: CStr::from_ptr(pw.pw_name).to_string_lossy().into_owned(), + passwd: CString::new(CStr::from_ptr(pw.pw_passwd).to_bytes()).unwrap(), + #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] + gecos: CString::new(CStr::from_ptr(pw.pw_gecos).to_bytes()).unwrap(), + dir: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_dir).to_bytes())), + shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_shell).to_bytes())), + uid: Uid::from_raw(pw.pw_uid), + gid: Gid::from_raw(pw.pw_gid), + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + class: CString::new(CStr::from_ptr(pw.pw_class).to_bytes()).unwrap(), + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + change: pw.pw_change, + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + expire: pw.pw_expire + } + } + } +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl From for libc::passwd { + fn from(u: User) -> Self { + let name = match CString::new(u.name) { + Ok(n) => n.into_raw(), + Err(_) => CString::new("").unwrap().into_raw(), + }; + let dir = match u.dir.into_os_string().into_string() { + Ok(s) => CString::new(s.as_str()).unwrap().into_raw(), + Err(_) => CString::new("").unwrap().into_raw(), + }; + let shell = match u.shell.into_os_string().into_string() { + Ok(s) => CString::new(s.as_str()).unwrap().into_raw(), + Err(_) => CString::new("").unwrap().into_raw(), + }; + Self { + pw_name: name, + pw_passwd: u.passwd.into_raw(), + #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] + pw_gecos: u.gecos.into_raw(), + pw_dir: dir, + pw_shell: shell, + pw_uid: u.uid.0, + pw_gid: u.gid.0, + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pw_class: u.class.into_raw(), + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pw_change: u.change, + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pw_expire: u.expire, + #[cfg(target_os = "illumos")] + pw_age: CString::new("").unwrap().into_raw(), + #[cfg(target_os = "illumos")] + pw_comment: CString::new("").unwrap().into_raw(), + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + pw_fields: 0, + } + } +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl User { + fn from_anything(f: F) -> Result> + where + F: Fn(*mut libc::passwd, + *mut c_char, + libc::size_t, + *mut *mut libc::passwd) -> libc::c_int + { + let buflimit = 1048576; + let bufsize = match sysconf(SysconfVar::GETPW_R_SIZE_MAX) { + Ok(Some(n)) => n as usize, + Ok(None) | Err(_) => 16384, + }; + + let mut cbuf = Vec::with_capacity(bufsize); + let mut pwd = mem::MaybeUninit::::uninit(); + let mut res = ptr::null_mut(); + + loop { + let error = f(pwd.as_mut_ptr(), cbuf.as_mut_ptr(), cbuf.capacity(), &mut res); + if error == 0 { + if res.is_null() { + return Ok(None); + } else { + let pwd = unsafe { pwd.assume_init() }; + return Ok(Some(User::from(&pwd))); + } + } else if Errno::last() == Errno::ERANGE { + // Trigger the internal buffer resizing logic. + reserve_double_buffer_size(&mut cbuf, buflimit)?; + } else { + return Err(Errno::last()); + } + } + } + + /// Get a user by UID. + /// + /// Internally, this function calls + /// [getpwuid_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + /// ``` + /// use nix::unistd::{Uid, User}; + /// // Returns an Result>, thus the double unwrap. + /// let res = User::from_uid(Uid::from_raw(0)).unwrap().unwrap(); + /// assert!(res.name == "root"); + /// ``` + pub fn from_uid(uid: Uid) -> Result> { + User::from_anything(|pwd, cbuf, cap, res| { + unsafe { libc::getpwuid_r(uid.0, pwd, cbuf, cap, res) } + }) + } + + /// Get a user by name. + /// + /// Internally, this function calls + /// [getpwnam_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + /// ``` + /// use nix::unistd::User; + /// // Returns an Result>, thus the double unwrap. + /// let res = User::from_name("root").unwrap().unwrap(); + /// assert!(res.name == "root"); + /// ``` + pub fn from_name(name: &str) -> Result> { + let name = CString::new(name).unwrap(); + User::from_anything(|pwd, cbuf, cap, res| { + unsafe { libc::getpwnam_r(name.as_ptr(), pwd, cbuf, cap, res) } + }) + } +} + +/// Representation of a Group, based on `libc::group` +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct Group { + /// Group name + pub name: String, + /// Group password + pub passwd: CString, + /// Group ID + pub gid: Gid, + /// List of Group members + pub mem: Vec +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl From<&libc::group> for Group { + fn from(gr: &libc::group) -> Group { + unsafe { + Group { + name: CStr::from_ptr(gr.gr_name).to_string_lossy().into_owned(), + passwd: CString::new(CStr::from_ptr(gr.gr_passwd).to_bytes()).unwrap(), + gid: Gid::from_raw(gr.gr_gid), + mem: Group::members(gr.gr_mem) + } + } + } +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl Group { + unsafe fn members(mem: *mut *mut c_char) -> Vec { + let mut ret = Vec::new(); + + for i in 0.. { + let u = mem.offset(i); + if (*u).is_null() { + break; + } else { + let s = CStr::from_ptr(*u).to_string_lossy().into_owned(); + ret.push(s); + } + } + + ret + } + + fn from_anything(f: F) -> Result> + where + F: Fn(*mut libc::group, + *mut c_char, + libc::size_t, + *mut *mut libc::group) -> libc::c_int + { + let buflimit = 1048576; + let bufsize = match sysconf(SysconfVar::GETGR_R_SIZE_MAX) { + Ok(Some(n)) => n as usize, + Ok(None) | Err(_) => 16384, + }; + + let mut cbuf = Vec::with_capacity(bufsize); + let mut grp = mem::MaybeUninit::::uninit(); + let mut res = ptr::null_mut(); + + loop { + let error = f(grp.as_mut_ptr(), cbuf.as_mut_ptr(), cbuf.capacity(), &mut res); + if error == 0 { + if res.is_null() { + return Ok(None); + } else { + let grp = unsafe { grp.assume_init() }; + return Ok(Some(Group::from(&grp))); + } + } else if Errno::last() == Errno::ERANGE { + // Trigger the internal buffer resizing logic. + reserve_double_buffer_size(&mut cbuf, buflimit)?; + } else { + return Err(Errno::last()); + } + } + } + + /// Get a group by GID. + /// + /// Internally, this function calls + /// [getgrgid_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + // Disable this test on all OS except Linux as root group may not exist. + #[cfg_attr(not(target_os = "linux"), doc = " ```no_run")] + #[cfg_attr(target_os = "linux", doc = " ```")] + /// use nix::unistd::{Gid, Group}; + /// // Returns an Result>, thus the double unwrap. + /// let res = Group::from_gid(Gid::from_raw(0)).unwrap().unwrap(); + /// assert!(res.name == "root"); + /// ``` + pub fn from_gid(gid: Gid) -> Result> { + Group::from_anything(|grp, cbuf, cap, res| { + unsafe { libc::getgrgid_r(gid.0, grp, cbuf, cap, res) } + }) + } + + /// Get a group by name. + /// + /// Internally, this function calls + /// [getgrnam_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + // Disable this test on all OS except Linux as root group may not exist. + #[cfg_attr(not(target_os = "linux"), doc = " ```no_run")] + #[cfg_attr(target_os = "linux", doc = " ```")] + /// use nix::unistd::Group; + /// // Returns an Result>, thus the double unwrap. + /// let res = Group::from_name("root").unwrap().unwrap(); + /// assert!(res.name == "root"); + /// ``` + pub fn from_name(name: &str) -> Result> { + let name = CString::new(name).unwrap(); + Group::from_anything(|grp, cbuf, cap, res| { + unsafe { libc::getgrnam_r(name.as_ptr(), grp, cbuf, cap, res) } + }) + } +} +} + +feature! { +#![feature = "term"] + +/// Get the name of the terminal device that is open on file descriptor fd +/// (see [`ttyname(3)`](https://man7.org/linux/man-pages/man3/ttyname.3.html)). +#[cfg(not(target_os = "fuchsia"))] +pub fn ttyname(fd: RawFd) -> Result { + const PATH_MAX: usize = libc::PATH_MAX as usize; + let mut buf = vec![0_u8; PATH_MAX]; + let c_buf = buf.as_mut_ptr() as *mut libc::c_char; + + let ret = unsafe { libc::ttyname_r(fd, c_buf, buf.len()) }; + if ret != 0 { + return Err(Errno::from_i32(ret)); + } + + let nul = buf.iter().position(|c| *c == b'\0').unwrap(); + buf.truncate(nul); + Ok(OsString::from_vec(buf).into()) +} +} + +feature! { +#![all(feature = "socket", feature = "user")] + +/// Get the effective user ID and group ID associated with a Unix domain socket. +/// +/// See also [getpeereid(3)](https://www.freebsd.org/cgi/man.cgi?query=getpeereid) +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +pub fn getpeereid(fd: RawFd) -> Result<(Uid, Gid)> { + let mut uid = 1; + let mut gid = 1; + + let ret = unsafe { libc::getpeereid(fd, &mut uid, &mut gid) }; + + Errno::result(ret).map(|_| (Uid(uid), Gid(gid))) +} +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/common/mod.rs b/bash-5.1/vendor/nix-0.24.2/test/common/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..544a1ae3f0ad4a3d917c5057082df6a5b7f5a8e2 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/common/mod.rs @@ -0,0 +1,141 @@ +use cfg_if::cfg_if; + +#[macro_export] macro_rules! skip { + ($($reason: expr),+) => { + use ::std::io::{self, Write}; + + let stderr = io::stderr(); + let mut handle = stderr.lock(); + writeln!(handle, $($reason),+).unwrap(); + return; + } +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + #[macro_export] macro_rules! require_capability { + ($name:expr, $capname:ident) => { + use ::caps::{Capability, CapSet, has_cap}; + + if !has_cap(None, CapSet::Effective, Capability::$capname) + .unwrap() + { + skip!("{} requires capability {}. Skipping test.", $name, Capability::$capname); + } + } + } + } else if #[cfg(not(target_os = "redox"))] { + #[macro_export] macro_rules! require_capability { + ($name:expr, $capname:ident) => {} + } + } +} + +/// Skip the test if we don't have the ability to mount file systems. +#[cfg(target_os = "freebsd")] +#[macro_export] macro_rules! require_mount { + ($name:expr) => { + use ::sysctl::CtlValue; + use nix::unistd::Uid; + + if !Uid::current().is_root() && CtlValue::Int(0) == ::sysctl::value("vfs.usermount").unwrap() + { + skip!("{} requires the ability to mount file systems. Skipping test.", $name); + } + } +} + +#[cfg(any(target_os = "linux", target_os= "android"))] +#[macro_export] macro_rules! skip_if_cirrus { + ($reason:expr) => { + if std::env::var_os("CIRRUS_CI").is_some() { + skip!("{}", $reason); + } + } +} + +#[cfg(target_os = "freebsd")] +#[macro_export] macro_rules! skip_if_jailed { + ($name:expr) => { + use ::sysctl::CtlValue; + + if let CtlValue::Int(1) = ::sysctl::value("security.jail.jailed") + .unwrap() + { + skip!("{} cannot run in a jail. Skipping test.", $name); + } + } +} + +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +#[macro_export] macro_rules! skip_if_not_root { + ($name:expr) => { + use nix::unistd::Uid; + + if !Uid::current().is_root() { + skip!("{} requires root privileges. Skipping test.", $name); + } + }; +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + #[macro_export] macro_rules! skip_if_seccomp { + ($name:expr) => { + if let Ok(s) = std::fs::read_to_string("/proc/self/status") { + for l in s.lines() { + let mut fields = l.split_whitespace(); + if fields.next() == Some("Seccomp:") && + fields.next() != Some("0") + { + skip!("{} cannot be run in Seccomp mode. Skipping test.", + stringify!($name)); + } + } + } + } + } + } else if #[cfg(not(target_os = "redox"))] { + #[macro_export] macro_rules! skip_if_seccomp { + ($name:expr) => {} + } + } +} + +cfg_if! { + if #[cfg(target_os = "linux")] { + #[macro_export] macro_rules! require_kernel_version { + ($name:expr, $version_requirement:expr) => { + use semver::{Version, VersionReq}; + + let version_requirement = VersionReq::parse($version_requirement) + .expect("Bad match_version provided"); + + let uname = nix::sys::utsname::uname().unwrap(); + println!("{}", uname.sysname().to_str().unwrap()); + println!("{}", uname.nodename().to_str().unwrap()); + println!("{}", uname.release().to_str().unwrap()); + println!("{}", uname.version().to_str().unwrap()); + println!("{}", uname.machine().to_str().unwrap()); + + // Fix stuff that the semver parser can't handle + let fixed_release = &uname.release().to_str().unwrap().to_string() + // Fedora 33 reports version as 4.18.el8_2.x86_64 or + // 5.18.200-fc33.x86_64. Remove the underscore. + .replace("_", "-") + // Cirrus-CI reports version as 4.19.112+ . Remove the + + .replace("+", ""); + let mut version = Version::parse(fixed_release).unwrap(); + + //Keep only numeric parts + version.pre = semver::Prerelease::EMPTY; + version.build = semver::BuildMetadata::EMPTY; + + if !version_requirement.matches(&version) { + skip!("Skip {} because kernel version `{}` doesn't match the requirement `{}`", + stringify!($name), version, version_requirement); + } + } + } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/mod.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..91c0aae708b03d9fe03d4e270724654b97e05cd2 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/mod.rs @@ -0,0 +1,47 @@ +mod test_signal; + +// NOTE: DragonFly lacks a kernel-level implementation of Posix AIO as of +// this writing. There is an user-level implementation, but whether aio +// works or not heavily depends on which pthread implementation is chosen +// by the user at link time. For this reason we do not want to run aio test +// cases on DragonFly. +#[cfg(any(target_os = "freebsd", + target_os = "ios", + all(target_os = "linux", not(target_env = "uclibc")), + target_os = "macos", + target_os = "netbsd"))] +mod test_aio; +#[cfg(not(target_os = "redox"))] +mod test_mman; +#[cfg(target_os = "linux")] +mod test_signalfd; +#[cfg(not(target_os = "redox"))] +mod test_socket; +#[cfg(not(target_os = "redox"))] +mod test_sockopt; +#[cfg(not(target_os = "redox"))] +mod test_select; +#[cfg(any(target_os = "android", target_os = "linux"))] +mod test_sysinfo; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod test_termios; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod test_ioctl; +mod test_wait; +mod test_uio; + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod test_epoll; +#[cfg(target_os = "linux")] +mod test_inotify; +mod test_pthread; +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +mod test_ptrace; +#[cfg(any(target_os = "android", target_os = "linux"))] +mod test_timerfd; diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_aio.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_aio.rs new file mode 100644 index 0000000000000000000000000000000000000000..80cd053f8defadb83b8c8dbf8cf68f4d2a20511d --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_aio.rs @@ -0,0 +1,620 @@ +use libc::{c_int, c_void}; +use nix::Result; +use nix::errno::*; +use nix::sys::aio::*; +use nix::sys::signal::{SaFlags, SigAction, sigaction, SigevNotify, SigHandler, Signal, SigSet}; +use nix::sys::time::{TimeSpec, TimeValLike}; +use std::io::{Write, Read, Seek, SeekFrom}; +use std::ops::Deref; +use std::os::unix::io::AsRawFd; +use std::pin::Pin; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::{thread, time}; +use tempfile::tempfile; + +// Helper that polls an AioCb for completion or error +fn poll_aio(aiocb: &mut Pin>) -> Result<()> { + loop { + let err = aiocb.error(); + if err != Err(Errno::EINPROGRESS) { return err; }; + thread::sleep(time::Duration::from_millis(10)); + } +} + +// Helper that polls a component of an LioCb for completion or error +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +fn poll_lio(liocb: &mut LioCb, i: usize) -> Result<()> { + loop { + let err = liocb.error(i); + if err != Err(Errno::EINPROGRESS) { return err; }; + thread::sleep(time::Duration::from_millis(10)); + } +} + +#[test] +fn test_accessors() { + let mut rbuf = vec![0; 4]; + let aiocb = AioCb::from_mut_slice( 1001, + 2, //offset + &mut rbuf, + 42, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 99 + }, + LioOpcode::LIO_NOP); + assert_eq!(1001, aiocb.fd()); + assert_eq!(Some(LioOpcode::LIO_NOP), aiocb.lio_opcode()); + assert_eq!(4, aiocb.nbytes()); + assert_eq!(2, aiocb.offset()); + assert_eq!(42, aiocb.priority()); + let sev = aiocb.sigevent().sigevent(); + assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); + assert_eq!(99, sev.sigev_value.sival_ptr as i64); +} + +// Tests AioCb.cancel. We aren't trying to test the OS's implementation, only +// our bindings. So it's sufficient to check that AioCb.cancel returned any +// AioCancelStat value. +#[test] +#[cfg_attr(target_env = "musl", ignore)] +fn test_cancel() { + let wbuf: &[u8] = b"CDEF"; + + let f = tempfile().unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 0, //offset + wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + let err = aiocb.error(); + assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); + + let cancelstat = aiocb.cancel(); + assert!(cancelstat.is_ok()); + + // Wait for aiocb to complete, but don't care whether it succeeded + let _ = poll_aio(&mut aiocb); + let _ = aiocb.aio_return(); +} + +// Tests using aio_cancel_all for all outstanding IOs. +#[test] +#[cfg_attr(target_env = "musl", ignore)] +fn test_aio_cancel_all() { + let wbuf: &[u8] = b"CDEF"; + + let f = tempfile().unwrap(); + let mut aiocb = AioCb::from_slice(f.as_raw_fd(), + 0, //offset + wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + let err = aiocb.error(); + assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); + + let cancelstat = aio_cancel_all(f.as_raw_fd()); + assert!(cancelstat.is_ok()); + + // Wait for aiocb to complete, but don't care whether it succeeded + let _ = poll_aio(&mut aiocb); + let _ = aiocb.aio_return(); +} + +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_fsync() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_fd( f.as_raw_fd(), + 0, //priority + SigevNotify::SigevNone); + let err = aiocb.fsync(AioFsyncMode::O_SYNC); + assert!(err.is_ok()); + poll_aio(&mut aiocb).unwrap(); + aiocb.aio_return().unwrap(); +} + +/// `AioCb::fsync` should not modify the `AioCb` object if `libc::aio_fsync` returns +/// an error +// Skip on Linux, because Linux's AIO implementation can't detect errors +// synchronously +#[test] +#[cfg(any(target_os = "freebsd", target_os = "macos"))] +fn test_fsync_error() { + use std::mem; + + const INITIAL: &[u8] = b"abcdef123456"; + // Create an invalid AioFsyncMode + let mode = unsafe { mem::transmute(666) }; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_fd( f.as_raw_fd(), + 0, //priority + SigevNotify::SigevNone); + let err = aiocb.fsync(mode); + assert!(err.is_err()); +} + +#[test] +// On Cirrus on Linux, this test fails due to a glibc bug. +// https://github.com/nix-rust/nix/issues/1099 +#[cfg_attr(target_os = "linux", ignore)] +// On Cirrus, aio_suspend is failing with EINVAL +// https://github.com/nix-rust/nix/issues/1361 +#[cfg_attr(target_os = "macos", ignore)] +fn test_aio_suspend() { + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEFG"; + let timeout = TimeSpec::seconds(10); + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + + let mut wcb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE); + + let mut rcb = AioCb::from_mut_slice( f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ); + wcb.write().unwrap(); + rcb.read().unwrap(); + loop { + { + let cbbuf = [wcb.as_ref(), rcb.as_ref()]; + let r = aio_suspend(&cbbuf[..], Some(timeout)); + match r { + Err(Errno::EINTR) => continue, + Err(e) => panic!("aio_suspend returned {:?}", e), + Ok(_) => () + }; + } + if rcb.error() != Err(Errno::EINPROGRESS) && + wcb.error() != Err(Errno::EINPROGRESS) { + break + } + } + + assert_eq!(wcb.aio_return().unwrap() as usize, WBUF.len()); + assert_eq!(rcb.aio_return().unwrap() as usize, rlen); +} + +// Test a simple aio operation with no completion notification. We must poll +// for completion +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_read() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + 2, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.read().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, EXPECT.len()); + } + + assert_eq!(EXPECT, rbuf.deref().deref()); +} + +/// `AioCb::read` should not modify the `AioCb` object if `libc::aio_read` +/// returns an error +// Skip on Linux, because Linux's AIO implementation can't detect errors +// synchronously +#[test] +#[cfg(any(target_os = "freebsd", target_os = "macos"))] +fn test_read_error() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + -1, //an invalid offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + assert!(aiocb.read().is_err()); +} + +// Tests from_mut_slice +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_read_into_mut_slice() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + let mut aiocb = AioCb::from_mut_slice( f.as_raw_fd(), + 2, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.read().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, EXPECT.len()); + } + + assert_eq!(rbuf, EXPECT); +} + +// Tests from_ptr +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_read_into_pointer() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + // Safety: ok because rbuf lives until after poll_aio + let mut aiocb = unsafe { + AioCb::from_mut_ptr( f.as_raw_fd(), + 2, //offset + rbuf.as_mut_ptr() as *mut c_void, + rbuf.len(), + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP) + }; + aiocb.read().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, EXPECT.len()); + } + + assert_eq!(rbuf, EXPECT); +} + +// Test reading into an immutable buffer. It should fail +// FIXME: This test fails to panic on Linux/musl +#[test] +#[should_panic(expected = "Can't read into an immutable buffer")] +#[cfg_attr(target_env = "musl", ignore)] +fn test_read_immutable_buffer() { + let rbuf: &[u8] = b"CDEF"; + let f = tempfile().unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.read().unwrap(); +} + + +// Test a simple aio operation with no completion notification. We must poll +// for completion. Unlike test_aio_read, this test uses AioCb::from_slice +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_write() { + const INITIAL: &[u8] = b"abcdef123456"; + let wbuf = "CDEF".to_string().into_bytes(); + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + &wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, wbuf.len()); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); +} + +// Tests `AioCb::from_ptr` +#[test] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_write_from_pointer() { + const INITIAL: &[u8] = b"abcdef123456"; + let wbuf = "CDEF".to_string().into_bytes(); + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + // Safety: ok because aiocb outlives poll_aio + let mut aiocb = unsafe { + AioCb::from_ptr( f.as_raw_fd(), + 2, //offset + wbuf.as_ptr() as *const c_void, + wbuf.len(), + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP) + }; + aiocb.write().unwrap(); + + let err = poll_aio(&mut aiocb); + assert_eq!(err, Ok(())); + assert_eq!(aiocb.aio_return().unwrap() as usize, wbuf.len()); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); +} + +/// `AioCb::write` should not modify the `AioCb` object if `libc::aio_write` +/// returns an error +// Skip on Linux, because Linux's AIO implementation can't detect errors +// synchronously +#[test] +#[cfg(any(target_os = "freebsd", target_os = "macos"))] +fn test_write_error() { + let wbuf = "CDEF".to_string().into_bytes(); + let mut aiocb = AioCb::from_slice( 666, // An invalid file descriptor + 0, //offset + &wbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + assert!(aiocb.write().is_err()); +} + +lazy_static! { + pub static ref SIGNALED: AtomicBool = AtomicBool::new(false); +} + +extern fn sigfunc(_: c_int) { + SIGNALED.store(true, Ordering::Relaxed); +} + +// Test an aio operation with completion delivered by a signal +// FIXME: This test is ignored on mips because of failures in qemu in CI +#[test] +#[cfg_attr(any(all(target_env = "musl", target_arch = "x86_64"), target_arch = "mips", target_arch = "mips64"), ignore)] +fn test_write_sigev_signal() { + let _m = crate::SIGNAL_MTX.lock(); + let sa = SigAction::new(SigHandler::Handler(sigfunc), + SaFlags::SA_RESETHAND, + SigSet::empty()); + SIGNALED.store(false, Ordering::Relaxed); + unsafe { sigaction(Signal::SIGUSR2, &sa) }.unwrap(); + + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 0 //TODO: validate in sigfunc + }, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); + while !SIGNALED.load(Ordering::Relaxed) { + thread::sleep(time::Duration::from_millis(10)); + } + + assert_eq!(aiocb.aio_return().unwrap() as usize, WBUF.len()); + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); +} + +// Test LioCb::listio with LIO_WAIT, so all AIO ops should be complete by the +// time listio returns. +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_liocb_listio_wait() { + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut rbuf2 = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + let mut f = tempfile().unwrap(); + + f.write_all(INITIAL).unwrap(); + + { + let mut liocb = LioCbBuilder::with_capacity(2) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE + ).emplace_mut_slice( + f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + let err = liocb.listio(LioMode::LIO_WAIT, SigevNotify::SigevNone); + err.expect("lio_listio"); + + assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + assert_eq!(liocb.aio_return(1).unwrap() as usize, rlen); + } + assert_eq!(rbuf.deref().deref(), b"3456"); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf2).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf2, EXPECT); +} + +// Test LioCb::listio with LIO_NOWAIT and no SigEvent, so we must use some other +// mechanism to check for the individual AioCb's completion. +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] +fn test_liocb_listio_nowait() { + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut rbuf2 = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + let mut f = tempfile().unwrap(); + + f.write_all(INITIAL).unwrap(); + + { + let mut liocb = LioCbBuilder::with_capacity(2) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE + ).emplace_mut_slice( + f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + let err = liocb.listio(LioMode::LIO_NOWAIT, SigevNotify::SigevNone); + err.expect("lio_listio"); + + poll_lio(&mut liocb, 0).unwrap(); + poll_lio(&mut liocb, 1).unwrap(); + assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + assert_eq!(liocb.aio_return(1).unwrap() as usize, rlen); + } + assert_eq!(rbuf.deref().deref(), b"3456"); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf2).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf2, EXPECT); +} + +// Test LioCb::listio with LIO_NOWAIT and a SigEvent to indicate when all +// AioCb's are complete. +// FIXME: This test is ignored on mips/mips64 because of failures in qemu in CI. +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[cfg_attr(any(target_arch = "mips", target_arch = "mips64", target_env = "musl"), ignore)] +fn test_liocb_listio_signal() { + let _m = crate::SIGNAL_MTX.lock(); + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut rbuf2 = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + let mut f = tempfile().unwrap(); + let sa = SigAction::new(SigHandler::Handler(sigfunc), + SaFlags::SA_RESETHAND, + SigSet::empty()); + let sigev_notify = SigevNotify::SigevSignal { signal: Signal::SIGUSR2, + si_value: 0 }; + + f.write_all(INITIAL).unwrap(); + + { + let mut liocb = LioCbBuilder::with_capacity(2) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE + ).emplace_mut_slice( + f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + SIGNALED.store(false, Ordering::Relaxed); + unsafe { sigaction(Signal::SIGUSR2, &sa) }.unwrap(); + let err = liocb.listio(LioMode::LIO_NOWAIT, sigev_notify); + err.expect("lio_listio"); + while !SIGNALED.load(Ordering::Relaxed) { + thread::sleep(time::Duration::from_millis(10)); + } + + assert_eq!(liocb.aio_return(0).unwrap() as usize, WBUF.len()); + assert_eq!(liocb.aio_return(1).unwrap() as usize, rlen); + } + assert_eq!(rbuf.deref().deref(), b"3456"); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf2).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf2, EXPECT); +} + +// Try to use LioCb::listio to read into an immutable buffer. It should fail +// FIXME: This test fails to panic on Linux/musl +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +#[should_panic(expected = "Can't read into an immutable buffer")] +#[cfg_attr(target_env = "musl", ignore)] +fn test_liocb_listio_read_immutable() { + let rbuf: &[u8] = b"abcd"; + let f = tempfile().unwrap(); + + + let mut liocb = LioCbBuilder::with_capacity(1) + .emplace_slice( + f.as_raw_fd(), + 2, //offset + rbuf, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_READ + ).finish(); + let _ = liocb.listio(LioMode::LIO_NOWAIT, SigevNotify::SigevNone); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_aio_drop.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_aio_drop.rs new file mode 100644 index 0000000000000000000000000000000000000000..f9ff97af6ced1d0ad9ab66daa78f4269e15611ba --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_aio_drop.rs @@ -0,0 +1,30 @@ +// Test dropping an AioCb that hasn't yet finished. +// This must happen in its own process, because on OSX this test seems to hose +// the AIO subsystem and causes subsequent tests to fail +#[test] +#[should_panic(expected = "Dropped an in-progress AioCb")] +#[cfg(all(not(target_env = "musl"), + not(target_env = "uclibc"), + any(target_os = "linux", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd")))] +fn test_drop() { + use nix::sys::aio::*; + use nix::sys::signal::*; + use std::os::unix::io::AsRawFd; + use tempfile::tempfile; + + const WBUF: &[u8] = b"CDEF"; + + let f = tempfile().unwrap(); + f.set_len(6).unwrap(); + let mut aiocb = AioCb::from_slice( f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_NOP); + aiocb.write().unwrap(); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_epoll.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_epoll.rs new file mode 100644 index 0000000000000000000000000000000000000000..8d44cd08f01c9be80e9c75dbecb5b85814ab083c --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_epoll.rs @@ -0,0 +1,23 @@ +use nix::sys::epoll::{EpollCreateFlags, EpollFlags, EpollOp, EpollEvent}; +use nix::sys::epoll::{epoll_create1, epoll_ctl}; +use nix::errno::Errno; + +#[test] +pub fn test_epoll_errno() { + let efd = epoll_create1(EpollCreateFlags::empty()).unwrap(); + let result = epoll_ctl(efd, EpollOp::EpollCtlDel, 1, None); + assert!(result.is_err()); + assert_eq!(result.unwrap_err(), Errno::ENOENT); + + let result = epoll_ctl(efd, EpollOp::EpollCtlAdd, 1, None); + assert!(result.is_err()); + assert_eq!(result.unwrap_err(), Errno::EINVAL); +} + +#[test] +pub fn test_epoll_ctl() { + let efd = epoll_create1(EpollCreateFlags::empty()).unwrap(); + let mut event = EpollEvent::new(EpollFlags::EPOLLIN | EpollFlags::EPOLLERR, 1); + epoll_ctl(efd, EpollOp::EpollCtlAdd, 1, &mut event).unwrap(); + epoll_ctl(efd, EpollOp::EpollCtlDel, 1, None).unwrap(); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_inotify.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_inotify.rs new file mode 100644 index 0000000000000000000000000000000000000000..137816a352086cfc17f7d3711fbfb4dd4c5a5361 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_inotify.rs @@ -0,0 +1,63 @@ +use nix::sys::inotify::{AddWatchFlags,InitFlags,Inotify}; +use nix::errno::Errno; +use std::ffi::OsString; +use std::fs::{rename, File}; + +#[test] +pub fn test_inotify() { + let instance = Inotify::init(InitFlags::IN_NONBLOCK) + .unwrap(); + let tempdir = tempfile::tempdir().unwrap(); + + instance.add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS).unwrap(); + + let events = instance.read_events(); + assert_eq!(events.unwrap_err(), Errno::EAGAIN); + + File::create(tempdir.path().join("test")).unwrap(); + + let events = instance.read_events().unwrap(); + assert_eq!(events[0].name, Some(OsString::from("test"))); +} + +#[test] +pub fn test_inotify_multi_events() { + let instance = Inotify::init(InitFlags::IN_NONBLOCK) + .unwrap(); + let tempdir = tempfile::tempdir().unwrap(); + + instance.add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS).unwrap(); + + let events = instance.read_events(); + assert_eq!(events.unwrap_err(), Errno::EAGAIN); + + File::create(tempdir.path().join("test")).unwrap(); + rename(tempdir.path().join("test"), tempdir.path().join("test2")).unwrap(); + + // Now there should be 5 events in queue: + // - IN_CREATE on test + // - IN_OPEN on test + // - IN_CLOSE_WRITE on test + // - IN_MOVED_FROM on test with a cookie + // - IN_MOVED_TO on test2 with the same cookie + + let events = instance.read_events().unwrap(); + assert_eq!(events.len(), 5); + + assert_eq!(events[0].mask, AddWatchFlags::IN_CREATE); + assert_eq!(events[0].name, Some(OsString::from("test"))); + + assert_eq!(events[1].mask, AddWatchFlags::IN_OPEN); + assert_eq!(events[1].name, Some(OsString::from("test"))); + + assert_eq!(events[2].mask, AddWatchFlags::IN_CLOSE_WRITE); + assert_eq!(events[2].name, Some(OsString::from("test"))); + + assert_eq!(events[3].mask, AddWatchFlags::IN_MOVED_FROM); + assert_eq!(events[3].name, Some(OsString::from("test"))); + + assert_eq!(events[4].mask, AddWatchFlags::IN_MOVED_TO); + assert_eq!(events[4].name, Some(OsString::from("test2"))); + + assert_eq!(events[3].cookie, events[4].cookie); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_ioctl.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_ioctl.rs new file mode 100644 index 0000000000000000000000000000000000000000..236d24268a738493ca5229e3109e9cb82a4129a6 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_ioctl.rs @@ -0,0 +1,337 @@ +#![allow(dead_code)] + +// Simple tests to ensure macro generated fns compile +ioctl_none_bad!(do_bad, 0x1234); +ioctl_read_bad!(do_bad_read, 0x1234, u16); +ioctl_write_int_bad!(do_bad_write_int, 0x1234); +ioctl_write_ptr_bad!(do_bad_write_ptr, 0x1234, u8); +ioctl_readwrite_bad!(do_bad_readwrite, 0x1234, u32); +ioctl_none!(do_none, 0, 0); +ioctl_read!(read_test, 0, 0, u32); +ioctl_write_int!(write_ptr_int, 0, 0); +ioctl_write_ptr!(write_ptr_u8, 0, 0, u8); +ioctl_write_ptr!(write_ptr_u32, 0, 0, u32); +ioctl_write_ptr!(write_ptr_u64, 0, 0, u64); +ioctl_readwrite!(readwrite_test, 0, 0, u64); +ioctl_read_buf!(readbuf_test, 0, 0, u32); +const SPI_IOC_MAGIC: u8 = b'k'; +const SPI_IOC_MESSAGE: u8 = 0; +ioctl_write_buf!(writebuf_test_consts, SPI_IOC_MAGIC, SPI_IOC_MESSAGE, u8); +ioctl_write_buf!(writebuf_test_u8, 0, 0, u8); +ioctl_write_buf!(writebuf_test_u32, 0, 0, u32); +ioctl_write_buf!(writebuf_test_u64, 0, 0, u64); +ioctl_readwrite_buf!(readwritebuf_test, 0, 0, u32); + +// See C code for source of values for op calculations (does NOT work for mips/powerpc): +// https://gist.github.com/posborne/83ea6880770a1aef332e +// +// TODO: Need a way to compute these constants at test time. Using precomputed +// values is fragile and needs to be maintained. + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod linux { + #[test] + fn test_op_none() { + if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){ + assert_eq!(request_code_none!(b'q', 10) as u32, 0x2000_710A); + assert_eq!(request_code_none!(b'a', 255) as u32, 0x2000_61FF); + } else { + assert_eq!(request_code_none!(b'q', 10) as u32, 0x0000_710A); + assert_eq!(request_code_none!(b'a', 255) as u32, 0x0000_61FF); + } + } + + #[test] + fn test_op_write() { + if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){ + assert_eq!(request_code_write!(b'z', 10, 1) as u32, 0x8001_7A0A); + assert_eq!(request_code_write!(b'z', 10, 512) as u32, 0x8200_7A0A); + } else { + assert_eq!(request_code_write!(b'z', 10, 1) as u32, 0x4001_7A0A); + assert_eq!(request_code_write!(b'z', 10, 512) as u32, 0x4200_7A0A); + } + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_write_64() { + if cfg!(any(target_arch = "mips64", target_arch="powerpc64")){ + assert_eq!(request_code_write!(b'z', 10, 1u64 << 32) as u32, + 0x8000_7A0A); + } else { + assert_eq!(request_code_write!(b'z', 10, 1u64 << 32) as u32, + 0x4000_7A0A); + } + + } + + #[test] + fn test_op_read() { + if cfg!(any(target_arch = "mips", target_arch = "mips64", target_arch="powerpc", target_arch="powerpc64")){ + assert_eq!(request_code_read!(b'z', 10, 1) as u32, 0x4001_7A0A); + assert_eq!(request_code_read!(b'z', 10, 512) as u32, 0x4200_7A0A); + } else { + assert_eq!(request_code_read!(b'z', 10, 1) as u32, 0x8001_7A0A); + assert_eq!(request_code_read!(b'z', 10, 512) as u32, 0x8200_7A0A); + } + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_64() { + if cfg!(any(target_arch = "mips64", target_arch="powerpc64")){ + assert_eq!(request_code_read!(b'z', 10, 1u64 << 32) as u32, + 0x4000_7A0A); + } else { + assert_eq!(request_code_read!(b'z', 10, 1u64 << 32) as u32, + 0x8000_7A0A); + } + } + + #[test] + fn test_op_read_write() { + assert_eq!(request_code_readwrite!(b'z', 10, 1) as u32, 0xC001_7A0A); + assert_eq!(request_code_readwrite!(b'z', 10, 512) as u32, 0xC200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_write_64() { + assert_eq!(request_code_readwrite!(b'z', 10, 1u64 << 32) as u32, + 0xC000_7A0A); + } +} + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +mod bsd { + #[test] + fn test_op_none() { + assert_eq!(request_code_none!(b'q', 10), 0x2000_710A); + assert_eq!(request_code_none!(b'a', 255), 0x2000_61FF); + } + + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[test] + fn test_op_write_int() { + assert_eq!(request_code_write_int!(b'v', 4), 0x2004_7604); + assert_eq!(request_code_write_int!(b'p', 2), 0x2004_7002); + } + + #[test] + fn test_op_write() { + assert_eq!(request_code_write!(b'z', 10, 1), 0x8001_7A0A); + assert_eq!(request_code_write!(b'z', 10, 512), 0x8200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_write_64() { + assert_eq!(request_code_write!(b'z', 10, 1u64 << 32), 0x8000_7A0A); + } + + #[test] + fn test_op_read() { + assert_eq!(request_code_read!(b'z', 10, 1), 0x4001_7A0A); + assert_eq!(request_code_read!(b'z', 10, 512), 0x4200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_64() { + assert_eq!(request_code_read!(b'z', 10, 1u64 << 32), 0x4000_7A0A); + } + + #[test] + fn test_op_read_write() { + assert_eq!(request_code_readwrite!(b'z', 10, 1), 0xC001_7A0A); + assert_eq!(request_code_readwrite!(b'z', 10, 512), 0xC200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_write_64() { + assert_eq!(request_code_readwrite!(b'z', 10, 1u64 << 32), 0xC000_7A0A); + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod linux_ioctls { + use std::mem; + use std::os::unix::io::AsRawFd; + + use tempfile::tempfile; + use libc::{TCGETS, TCSBRK, TCSETS, TIOCNXCL, termios}; + + use nix::errno::Errno; + + ioctl_none_bad!(tiocnxcl, TIOCNXCL); + #[test] + fn test_ioctl_none_bad() { + let file = tempfile().unwrap(); + let res = unsafe { tiocnxcl(file.as_raw_fd()) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_read_bad!(tcgets, TCGETS, termios); + #[test] + fn test_ioctl_read_bad() { + let file = tempfile().unwrap(); + let mut termios = unsafe { mem::zeroed() }; + let res = unsafe { tcgets(file.as_raw_fd(), &mut termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_write_int_bad!(tcsbrk, TCSBRK); + #[test] + fn test_ioctl_write_int_bad() { + let file = tempfile().unwrap(); + let res = unsafe { tcsbrk(file.as_raw_fd(), 0) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_write_ptr_bad!(tcsets, TCSETS, termios); + #[test] + fn test_ioctl_write_ptr_bad() { + let file = tempfile().unwrap(); + let termios: termios = unsafe { mem::zeroed() }; + let res = unsafe { tcsets(file.as_raw_fd(), &termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + // FIXME: Find a suitable example for `ioctl_readwrite_bad` + + // From linux/videodev2.h + ioctl_none!(log_status, b'V', 70); + #[test] + fn test_ioctl_none() { + let file = tempfile().unwrap(); + let res = unsafe { log_status(file.as_raw_fd()) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + #[repr(C)] + pub struct v4l2_audio { + index: u32, + name: [u8; 32], + capability: u32, + mode: u32, + reserved: [u32; 2], + } + + // From linux/videodev2.h + ioctl_write_ptr!(s_audio, b'V', 34, v4l2_audio); + #[test] + fn test_ioctl_write_ptr() { + let file = tempfile().unwrap(); + let data: v4l2_audio = unsafe { mem::zeroed() }; + let res = unsafe { s_audio(file.as_raw_fd(), &data) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // From linux/net/bluetooth/hci_sock.h + const HCI_IOC_MAGIC: u8 = b'H'; + const HCI_IOC_HCIDEVUP: u8 = 201; + ioctl_write_int!(hcidevup, HCI_IOC_MAGIC, HCI_IOC_HCIDEVUP); + #[test] + fn test_ioctl_write_int() { + let file = tempfile().unwrap(); + let res = unsafe { hcidevup(file.as_raw_fd(), 0) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // From linux/videodev2.h + ioctl_read!(g_audio, b'V', 33, v4l2_audio); + #[test] + fn test_ioctl_read() { + let file = tempfile().unwrap(); + let mut data: v4l2_audio = unsafe { mem::zeroed() }; + let res = unsafe { g_audio(file.as_raw_fd(), &mut data) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // From linux/videodev2.h + ioctl_readwrite!(enum_audio, b'V', 65, v4l2_audio); + #[test] + fn test_ioctl_readwrite() { + let file = tempfile().unwrap(); + let mut data: v4l2_audio = unsafe { mem::zeroed() }; + let res = unsafe { enum_audio(file.as_raw_fd(), &mut data) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // FIXME: Find a suitable example for `ioctl_read_buf`. + + #[repr(C)] + pub struct spi_ioc_transfer { + tx_buf: u64, + rx_buf: u64, + len: u32, + speed_hz: u32, + delay_usecs: u16, + bits_per_word: u8, + cs_change: u8, + tx_nbits: u8, + rx_nbits: u8, + pad: u16, + } + + // From linux/spi/spidev.h + ioctl_write_buf!(spi_ioc_message, super::SPI_IOC_MAGIC, super::SPI_IOC_MESSAGE, spi_ioc_transfer); + #[test] + fn test_ioctl_write_buf() { + let file = tempfile().unwrap(); + let data: [spi_ioc_transfer; 4] = unsafe { mem::zeroed() }; + let res = unsafe { spi_ioc_message(file.as_raw_fd(), &data[..]) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // FIXME: Find a suitable example for `ioctl_readwrite_buf`. +} + +#[cfg(target_os = "freebsd")] +mod freebsd_ioctls { + use std::mem; + use std::os::unix::io::AsRawFd; + + use tempfile::tempfile; + use libc::termios; + + use nix::errno::Errno; + + // From sys/sys/ttycom.h + const TTY_IOC_MAGIC: u8 = b't'; + const TTY_IOC_TYPE_NXCL: u8 = 14; + const TTY_IOC_TYPE_GETA: u8 = 19; + const TTY_IOC_TYPE_SETA: u8 = 20; + + ioctl_none!(tiocnxcl, TTY_IOC_MAGIC, TTY_IOC_TYPE_NXCL); + #[test] + fn test_ioctl_none() { + let file = tempfile().unwrap(); + let res = unsafe { tiocnxcl(file.as_raw_fd()) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_read!(tiocgeta, TTY_IOC_MAGIC, TTY_IOC_TYPE_GETA, termios); + #[test] + fn test_ioctl_read() { + let file = tempfile().unwrap(); + let mut termios = unsafe { mem::zeroed() }; + let res = unsafe { tiocgeta(file.as_raw_fd(), &mut termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_write_ptr!(tiocseta, TTY_IOC_MAGIC, TTY_IOC_TYPE_SETA, termios); + #[test] + fn test_ioctl_write_ptr() { + let file = tempfile().unwrap(); + let termios: termios = unsafe { mem::zeroed() }; + let res = unsafe { tiocseta(file.as_raw_fd(), &termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_lio_listio_resubmit.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_lio_listio_resubmit.rs new file mode 100644 index 0000000000000000000000000000000000000000..c9077891cb192e133c7bdbbef6b7f0cee5bec4b6 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_lio_listio_resubmit.rs @@ -0,0 +1,106 @@ +// vim: tw=80 + +// Annoyingly, Cargo is unable to conditionally build an entire test binary. So +// we must disable the test here rather than in Cargo.toml +#![cfg(target_os = "freebsd")] + +use nix::errno::*; +use nix::libc::off_t; +use nix::sys::aio::*; +use nix::sys::signal::SigevNotify; +use nix::unistd::{SysconfVar, sysconf}; +use std::os::unix::io::AsRawFd; +use std::{thread, time}; +use sysctl::CtlValue; +use tempfile::tempfile; + +const BYTES_PER_OP: usize = 512; + +/// Attempt to collect final status for all of `liocb`'s operations, freeing +/// system resources +fn finish_liocb(liocb: &mut LioCb) { + for j in 0..liocb.len() { + loop { + let e = liocb.error(j); + match e { + Ok(()) => break, + Err(Errno::EINPROGRESS) => + thread::sleep(time::Duration::from_millis(10)), + Err(x) => panic!("aio_error({:?})", x) + } + } + assert_eq!(liocb.aio_return(j).unwrap(), BYTES_PER_OP as isize); + } +} + +// Deliberately exceed system resource limits, causing lio_listio to return EIO. +// This test must run in its own process since it deliberately uses all AIO +// resources. ATM it is only enabled on FreeBSD, because I don't know how to +// check system AIO limits on other operating systems. +#[test] +fn test_lio_listio_resubmit() { + let mut resubmit_count = 0; + + // Lookup system resource limits + let alm = sysconf(SysconfVar::AIO_LISTIO_MAX) + .expect("sysconf").unwrap() as usize; + let maqpp = if let CtlValue::Int(x) = sysctl::value( + "vfs.aio.max_aio_queue_per_proc").unwrap(){ + x as usize + } else { + panic!("unknown sysctl"); + }; + + // Find lio_listio sizes that satisfy the AIO_LISTIO_MAX constraint and also + // result in a final lio_listio call that can only partially be queued + let target_ops = maqpp + alm / 2; + let num_listios = (target_ops + alm - 3) / (alm - 2); + let ops_per_listio = (target_ops + num_listios - 1) / num_listios; + assert!((num_listios - 1) * ops_per_listio < maqpp, + "the last lio_listio won't make any progress; fix the algorithm"); + println!("Using {:?} LioCbs of {:?} operations apiece", num_listios, + ops_per_listio); + + let f = tempfile().unwrap(); + let buffer_set = (0..num_listios).map(|_| { + (0..ops_per_listio).map(|_| { + vec![0u8; BYTES_PER_OP] + }).collect::>() + }).collect::>(); + + let mut liocbs = (0..num_listios).map(|i| { + let mut builder = LioCbBuilder::with_capacity(ops_per_listio); + for j in 0..ops_per_listio { + let offset = (BYTES_PER_OP * (i * ops_per_listio + j)) as off_t; + builder = builder.emplace_slice(f.as_raw_fd(), + offset, + &buffer_set[i][j][..], + 0, //priority + SigevNotify::SigevNone, + LioOpcode::LIO_WRITE); + } + let mut liocb = builder.finish(); + let mut err = liocb.listio(LioMode::LIO_NOWAIT, SigevNotify::SigevNone); + while err == Err(Errno::EIO) || + err == Err(Errno::EAGAIN) || + err == Err(Errno::EINTR) { + // + thread::sleep(time::Duration::from_millis(10)); + resubmit_count += 1; + err = liocb.listio_resubmit(LioMode::LIO_NOWAIT, + SigevNotify::SigevNone); + } + liocb + }).collect::>(); + + // Ensure that every AioCb completed + for liocb in liocbs.iter_mut() { + finish_liocb(liocb); + } + + if resubmit_count > 0 { + println!("Resubmitted {:?} times, test passed", resubmit_count); + } else { + println!("Never resubmitted. Test ambiguous"); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_mman.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_mman.rs new file mode 100644 index 0000000000000000000000000000000000000000..8858375a3c721832e19bdb40f70e9ba5cfd03f51 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_mman.rs @@ -0,0 +1,87 @@ +use nix::sys::mman::{mmap, MapFlags, ProtFlags}; + +#[test] +fn test_mmap_anonymous() { + unsafe { + let ptr = mmap(std::ptr::null_mut(), 1, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_PRIVATE | MapFlags::MAP_ANONYMOUS, -1, 0) + .unwrap() as *mut u8; + assert_eq !(*ptr, 0x00u8); + *ptr = 0xffu8; + assert_eq !(*ptr, 0xffu8); + } +} + +#[test] +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +fn test_mremap_grow() { + use nix::sys::mman::{mremap, MRemapFlags}; + use nix::libc::{c_void, size_t}; + + const ONE_K : size_t = 1024; + let slice : &mut[u8] = unsafe { + let mem = mmap(std::ptr::null_mut(), ONE_K, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, -1, 0) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) + }; + assert_eq !(slice[ONE_K - 1], 0x00); + slice[ONE_K - 1] = 0xFF; + assert_eq !(slice[ONE_K - 1], 0xFF); + + let slice : &mut[u8] = unsafe { + #[cfg(target_os = "linux")] + let mem = mremap(slice.as_mut_ptr() as * mut c_void, ONE_K, 10 * ONE_K, + MRemapFlags::MREMAP_MAYMOVE, None) + .unwrap(); + #[cfg(target_os = "netbsd")] + let mem = mremap(slice.as_mut_ptr() as * mut c_void, ONE_K, 10 * ONE_K, + MRemapFlags::MAP_REMAPDUP, None) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, 10 * ONE_K) + }; + + // The first KB should still have the old data in it. + assert_eq !(slice[ONE_K - 1], 0xFF); + + // The additional range should be zero-init'd and accessible. + assert_eq !(slice[10 * ONE_K - 1], 0x00); + slice[10 * ONE_K - 1] = 0xFF; + assert_eq !(slice[10 * ONE_K - 1], 0xFF); +} + +#[test] +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +// Segfaults for unknown reasons under QEMU for 32-bit targets +#[cfg_attr(all(target_pointer_width = "32", qemu), ignore)] +fn test_mremap_shrink() { + use nix::sys::mman::{mremap, MRemapFlags}; + use nix::libc::{c_void, size_t}; + + const ONE_K : size_t = 1024; + let slice : &mut[u8] = unsafe { + let mem = mmap(std::ptr::null_mut(), 10 * ONE_K, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, -1, 0) + .unwrap(); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) + }; + assert_eq !(slice[ONE_K - 1], 0x00); + slice[ONE_K - 1] = 0xFF; + assert_eq !(slice[ONE_K - 1], 0xFF); + + let slice : &mut[u8] = unsafe { + let mem = mremap(slice.as_mut_ptr() as * mut c_void, 10 * ONE_K, ONE_K, + MRemapFlags::empty(), None) + .unwrap(); + // Since we didn't supply MREMAP_MAYMOVE, the address should be the + // same. + assert_eq !(mem, slice.as_mut_ptr() as * mut c_void); + std::slice::from_raw_parts_mut(mem as * mut u8, ONE_K) + }; + + // The first KB should still be accessible and have the old data in it. + assert_eq !(slice[ONE_K - 1], 0xFF); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_pthread.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_pthread.rs new file mode 100644 index 0000000000000000000000000000000000000000..fa9b510e8532e64a3f7335e850bdb4b6c7fd353e --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_pthread.rs @@ -0,0 +1,22 @@ +use nix::sys::pthread::*; + +#[cfg(any(target_env = "musl", target_os = "redox"))] +#[test] +fn test_pthread_self() { + let tid = pthread_self(); + assert!(tid != ::std::ptr::null_mut()); +} + +#[cfg(not(any(target_env = "musl", target_os = "redox")))] +#[test] +fn test_pthread_self() { + let tid = pthread_self(); + assert!(tid != 0); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_pthread_kill_none() { + pthread_kill(pthread_self(), None) + .expect("Should be able to send signal to my thread."); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_ptrace.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_ptrace.rs new file mode 100644 index 0000000000000000000000000000000000000000..89c4e2ddad2c9b67182eb1df3322ca0698daab6e --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_ptrace.rs @@ -0,0 +1,219 @@ +use nix::errno::Errno; +use nix::unistd::getpid; +use nix::sys::ptrace; +#[cfg(any(target_os = "android", target_os = "linux"))] +use nix::sys::ptrace::Options; + +#[cfg(any(target_os = "android", target_os = "linux"))] +use std::mem; + +use crate::*; + +#[test] +fn test_ptrace() { + // Just make sure ptrace can be called at all, for now. + // FIXME: qemu-user doesn't implement ptrace on all arches, so permit ENOSYS + require_capability!("test_ptrace", CAP_SYS_PTRACE); + let err = ptrace::attach(getpid()).unwrap_err(); + assert!(err == Errno::EPERM || err == Errno::EINVAL || + err == Errno::ENOSYS); +} + +// Just make sure ptrace_setoptions can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_setoptions() { + require_capability!("test_ptrace_setoptions", CAP_SYS_PTRACE); + let err = ptrace::setoptions(getpid(), Options::PTRACE_O_TRACESYSGOOD).unwrap_err(); + assert!(err != Errno::EOPNOTSUPP); +} + +// Just make sure ptrace_getevent can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_getevent() { + require_capability!("test_ptrace_getevent", CAP_SYS_PTRACE); + let err = ptrace::getevent(getpid()).unwrap_err(); + assert!(err != Errno::EOPNOTSUPP); +} + +// Just make sure ptrace_getsiginfo can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_getsiginfo() { + require_capability!("test_ptrace_getsiginfo", CAP_SYS_PTRACE); + if let Err(Errno::EOPNOTSUPP) = ptrace::getsiginfo(getpid()) { + panic!("ptrace_getsiginfo returns Errno::EOPNOTSUPP!"); + } +} + +// Just make sure ptrace_setsiginfo can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_setsiginfo() { + require_capability!("test_ptrace_setsiginfo", CAP_SYS_PTRACE); + let siginfo = unsafe { mem::zeroed() }; + if let Err(Errno::EOPNOTSUPP) = ptrace::setsiginfo(getpid(), &siginfo) { + panic!("ptrace_setsiginfo returns Errno::EOPNOTSUPP!"); + } +} + + +#[test] +fn test_ptrace_cont() { + use nix::sys::ptrace; + use nix::sys::signal::{raise, Signal}; + use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus}; + use nix::unistd::fork; + use nix::unistd::ForkResult::*; + + require_capability!("test_ptrace_cont", CAP_SYS_PTRACE); + + let _m = crate::FORK_MTX.lock(); + + // FIXME: qemu-user doesn't implement ptrace on all architectures + // and returns ENOSYS in this case. + // We (ab)use this behavior to detect the affected platforms + // and skip the test then. + // On valid platforms the ptrace call should return Errno::EPERM, this + // is already tested by `test_ptrace`. + let err = ptrace::attach(getpid()).unwrap_err(); + if err == Errno::ENOSYS { + return; + } + + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + ptrace::traceme().unwrap(); + // As recommended by ptrace(2), raise SIGTRAP to pause the child + // until the parent is ready to continue + loop { + raise(Signal::SIGTRAP).unwrap(); + } + + }, + Parent { child } => { + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGTRAP))); + ptrace::cont(child, None).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGTRAP))); + ptrace::cont(child, Some(Signal::SIGKILL)).unwrap(); + match waitpid(child, None) { + Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) if pid == child => { + // FIXME It's been observed on some systems (apple) the + // tracee may not be killed but remain as a zombie process + // affecting other wait based tests. Add an extra kill just + // to make sure there are no zombies. + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + while ptrace::cont(child, Some(Signal::SIGKILL)).is_ok() { + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + } + } + _ => panic!("The process should have been killed"), + } + }, + } +} + +#[cfg(target_os = "linux")] +#[test] +fn test_ptrace_interrupt() { + use nix::sys::ptrace; + use nix::sys::signal::Signal; + use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus}; + use nix::unistd::fork; + use nix::unistd::ForkResult::*; + use std::thread::sleep; + use std::time::Duration; + + require_capability!("test_ptrace_interrupt", CAP_SYS_PTRACE); + + let _m = crate::FORK_MTX.lock(); + + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + loop { + sleep(Duration::from_millis(1000)); + } + + }, + Parent { child } => { + ptrace::seize(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap(); + ptrace::interrupt(child).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceEvent(child, Signal::SIGTRAP, 128))); + ptrace::syscall(child, None).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); + ptrace::detach(child, Some(Signal::SIGKILL)).unwrap(); + match waitpid(child, None) { + Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) if pid == child => { + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + while ptrace::cont(child, Some(Signal::SIGKILL)).is_ok() { + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + } + } + _ => panic!("The process should have been killed"), + } + }, + } +} + +// ptrace::{setoptions, getregs} are only available in these platforms +#[cfg(all(target_os = "linux", + any(target_arch = "x86_64", + target_arch = "x86"), + target_env = "gnu"))] +#[test] +fn test_ptrace_syscall() { + use nix::sys::signal::kill; + use nix::sys::ptrace; + use nix::sys::signal::Signal; + use nix::sys::wait::{waitpid, WaitStatus}; + use nix::unistd::fork; + use nix::unistd::getpid; + use nix::unistd::ForkResult::*; + + require_capability!("test_ptrace_syscall", CAP_SYS_PTRACE); + + let _m = crate::FORK_MTX.lock(); + + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + ptrace::traceme().unwrap(); + // first sigstop until parent is ready to continue + let pid = getpid(); + kill(pid, Signal::SIGSTOP).unwrap(); + kill(pid, Signal::SIGTERM).unwrap(); + unsafe { ::libc::_exit(0); } + }, + + Parent { child } => { + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGSTOP))); + + // set this option to recognize syscall-stops + ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap(); + + #[cfg(target_arch = "x86_64")] + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as libc::c_long; + + #[cfg(target_arch = "x86")] + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as libc::c_long; + + // kill entry + ptrace::syscall(child, None).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); + assert_eq!(get_syscall_id(), ::libc::SYS_kill); + + // kill exit + ptrace::syscall(child, None).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); + assert_eq!(get_syscall_id(), ::libc::SYS_kill); + + // receive signal + ptrace::syscall(child, None).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, Signal::SIGTERM))); + + // inject signal + ptrace::syscall(child, Signal::SIGTERM).unwrap(); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Signaled(child, Signal::SIGTERM, false))); + }, + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_select.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_select.rs new file mode 100644 index 0000000000000000000000000000000000000000..2f7396b1895e5bcddbd14dfd82a7775b45545285 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_select.rs @@ -0,0 +1,80 @@ +use nix::sys::select::*; +use nix::unistd::{pipe, write}; +use nix::sys::signal::SigSet; +use nix::sys::time::{TimeSpec, TimeValLike}; + +#[test] +pub fn test_pselect() { + let _mtx = crate::SIGNAL_MTX.lock(); + + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let timeout = TimeSpec::seconds(10); + let sigmask = SigSet::empty(); + assert_eq!( + 1, + pselect(None, &mut fd_set, None, None, &timeout, &sigmask).unwrap() + ); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); +} + +#[test] +pub fn test_pselect_nfds2() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let timeout = TimeSpec::seconds(10); + assert_eq!( + 1, + pselect( + ::std::cmp::max(r1, r2) + 1, + &mut fd_set, + None, + None, + &timeout, + None + ).unwrap() + ); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); +} + +macro_rules! generate_fdset_bad_fd_tests { + ($fd:expr, $($method:ident),* $(,)?) => { + $( + #[test] + #[should_panic] + fn $method() { + FdSet::new().$method($fd); + } + )* + } +} + +mod test_fdset_negative_fd { + use super::*; + generate_fdset_bad_fd_tests!(-1, insert, remove, contains); +} + +mod test_fdset_too_large_fd { + use super::*; + use std::convert::TryInto; + generate_fdset_bad_fd_tests!( + FD_SETSIZE.try_into().unwrap(), + insert, + remove, + contains, + ); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_signal.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_signal.rs new file mode 100644 index 0000000000000000000000000000000000000000..fdd2568df463be41ce7e1708df3dd1bdc25fd738 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_signal.rs @@ -0,0 +1,121 @@ +#[cfg(not(target_os = "redox"))] +use nix::errno::Errno; +use nix::sys::signal::*; +use nix::unistd::*; +use std::convert::TryFrom; +use std::sync::atomic::{AtomicBool, Ordering}; + +#[test] +fn test_kill_none() { + kill(getpid(), None).expect("Should be able to send signal to myself."); +} + +#[test] +#[cfg(not(target_os = "fuchsia"))] +fn test_killpg_none() { + killpg(getpgrp(), None) + .expect("Should be able to send signal to my process group."); +} + +#[test] +fn test_old_sigaction_flags() { + let _m = crate::SIGNAL_MTX.lock(); + + extern "C" fn handler(_: ::libc::c_int) {} + let act = SigAction::new( + SigHandler::Handler(handler), + SaFlags::empty(), + SigSet::empty(), + ); + let oact = unsafe { sigaction(SIGINT, &act) }.unwrap(); + let _flags = oact.flags(); + let oact = unsafe { sigaction(SIGINT, &act) }.unwrap(); + let _flags = oact.flags(); +} + +#[test] +fn test_sigprocmask_noop() { + sigprocmask(SigmaskHow::SIG_BLOCK, None, None) + .expect("this should be an effective noop"); +} + +#[test] +fn test_sigprocmask() { + let _m = crate::SIGNAL_MTX.lock(); + + // This needs to be a signal that rust doesn't use in the test harness. + const SIGNAL: Signal = Signal::SIGCHLD; + + let mut old_signal_set = SigSet::empty(); + sigprocmask(SigmaskHow::SIG_BLOCK, None, Some(&mut old_signal_set)) + .expect("expect to be able to retrieve old signals"); + + // Make sure the old set doesn't contain the signal, otherwise the following + // test don't make sense. + assert!(!old_signal_set.contains(SIGNAL), + "the {:?} signal is already blocked, please change to a \ + different one", SIGNAL); + + // Now block the signal. + let mut signal_set = SigSet::empty(); + signal_set.add(SIGNAL); + sigprocmask(SigmaskHow::SIG_BLOCK, Some(&signal_set), None) + .expect("expect to be able to block signals"); + + // And test it again, to make sure the change was effective. + old_signal_set.clear(); + sigprocmask(SigmaskHow::SIG_BLOCK, None, Some(&mut old_signal_set)) + .expect("expect to be able to retrieve old signals"); + assert!(old_signal_set.contains(SIGNAL), + "expected the {:?} to be blocked", SIGNAL); + + // Reset the signal. + sigprocmask(SigmaskHow::SIG_UNBLOCK, Some(&signal_set), None) + .expect("expect to be able to block signals"); +} + +lazy_static! { + static ref SIGNALED: AtomicBool = AtomicBool::new(false); +} + +extern fn test_sigaction_handler(signal: libc::c_int) { + let signal = Signal::try_from(signal).unwrap(); + SIGNALED.store(signal == Signal::SIGINT, Ordering::Relaxed); +} + +#[cfg(not(target_os = "redox"))] +extern fn test_sigaction_action(_: libc::c_int, _: *mut libc::siginfo_t, _: *mut libc::c_void) {} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_signal_sigaction() { + let _m = crate::SIGNAL_MTX.lock(); + + let action_handler = SigHandler::SigAction(test_sigaction_action); + assert_eq!(unsafe { signal(Signal::SIGINT, action_handler) }.unwrap_err(), Errno::ENOTSUP); +} + +#[test] +fn test_signal() { + let _m = crate::SIGNAL_MTX.lock(); + + unsafe { signal(Signal::SIGINT, SigHandler::SigIgn) }.unwrap(); + raise(Signal::SIGINT).unwrap(); + assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), SigHandler::SigIgn); + + let handler = SigHandler::Handler(test_sigaction_handler); + assert_eq!(unsafe { signal(Signal::SIGINT, handler) }.unwrap(), SigHandler::SigDfl); + raise(Signal::SIGINT).unwrap(); + assert!(SIGNALED.load(Ordering::Relaxed)); + + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), handler); + + // System V based OSes (e.g. illumos and Solaris) always resets the + // disposition to SIG_DFL prior to calling the signal handler + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + assert_eq!(unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), SigHandler::SigDfl); + + // Restore default signal handler + unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_signalfd.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_signalfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..b6f748b46a42b9332dca1cbc7445721a26d1d763 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_signalfd.rs @@ -0,0 +1,27 @@ +use std::convert::TryFrom; + +#[test] +fn test_signalfd() { + use nix::sys::signalfd::SignalFd; + use nix::sys::signal::{self, raise, Signal, SigSet}; + + // Grab the mutex for altering signals so we don't interfere with other tests. + let _m = crate::SIGNAL_MTX.lock(); + + // Block the SIGUSR1 signal from automatic processing for this thread + let mut mask = SigSet::empty(); + mask.add(signal::SIGUSR1); + mask.thread_block().unwrap(); + + let mut fd = SignalFd::new(&mask).unwrap(); + + // Send a SIGUSR1 signal to the current process. Note that this uses `raise` instead of `kill` + // because `kill` with `getpid` isn't correct during multi-threaded execution like during a + // cargo test session. Instead use `raise` which does the correct thing by default. + raise(signal::SIGUSR1).expect("Error: raise(SIGUSR1) failed"); + + // And now catch that same signal. + let res = fd.read_signal().unwrap().unwrap(); + let signo = Signal::try_from(res.ssi_signo as i32).unwrap(); + assert_eq!(signo, signal::SIGUSR1); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_socket.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_socket.rs new file mode 100644 index 0000000000000000000000000000000000000000..06ec228d3bc5d72195c8fef5e28b627b79ce298e --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_socket.rs @@ -0,0 +1,2064 @@ +#[allow(deprecated)] +use nix::sys::socket::InetAddr; +use nix::sys::socket::{AddressFamily, + UnixAddr, getsockname, sockaddr, sockaddr_in6}; +use std::collections::hash_map::DefaultHasher; +use std::hash::{Hash, Hasher}; +use std::mem::{self, MaybeUninit}; +use std::net::{self, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; +use std::os::unix::io::RawFd; +use std::path::Path; +use std::slice; +use std::str::FromStr; +use libc::{c_char, sockaddr_storage}; +#[cfg(any(target_os = "linux", target_os= "android"))] +use crate::*; + +#[allow(deprecated)] +#[test] +pub fn test_inetv4_addr_to_sock_addr() { + let actual: net::SocketAddr = FromStr::from_str("127.0.0.1:3000").unwrap(); + let addr = InetAddr::from_std(&actual); + + match addr { + InetAddr::V4(addr) => { + let ip: u32 = 0x7f00_0001; + let port: u16 = 3000; + let saddr = addr.sin_addr.s_addr; + + assert_eq!(saddr, ip.to_be()); + assert_eq!(addr.sin_port, port.to_be()); + } + _ => panic!("nope"), + } + + assert_eq!(addr.to_string(), "127.0.0.1:3000"); + + let inet = addr.to_std(); + assert_eq!(actual, inet); +} + +#[allow(deprecated)] +#[test] +pub fn test_inetv4_addr_roundtrip_sockaddr_storage_to_addr() { + use nix::sys::socket::{SockAddr, sockaddr_storage_to_addr}; + + let actual: net::SocketAddr = FromStr::from_str("127.0.0.1:3000").unwrap(); + let addr = InetAddr::from_std(&actual); + let sockaddr = SockAddr::new_inet(addr); + + let (storage, ffi_size) = { + let mut storage = MaybeUninit::::zeroed(); + let storage_ptr = storage.as_mut_ptr().cast::(); + let (ffi_ptr, ffi_size) = sockaddr.as_ffi_pair(); + assert_eq!(mem::size_of::(), ffi_size as usize); + unsafe { + storage_ptr.copy_from_nonoverlapping(ffi_ptr as *const sockaddr, 1); + (storage.assume_init(), ffi_size) + } + }; + + let from_storage = sockaddr_storage_to_addr(&storage, ffi_size as usize).unwrap(); + assert_eq!(from_storage, sockaddr); + let from_storage = sockaddr_storage_to_addr(&storage, mem::size_of::()).unwrap(); + assert_eq!(from_storage, sockaddr); +} + +#[cfg(any(target_os = "linux"))] +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_timestamping() { + use nix::sys::socket::{ + recvmsg, sendmsg, setsockopt, socket, sockopt::Timestamping, ControlMessageOwned, MsgFlags, + SockaddrIn, SockFlag, SockType, TimestampingFlag, + }; + use std::io::{IoSlice, IoSliceMut}; + + let sock_addr = SockaddrIn::from_str("127.0.0.1:6790").unwrap(); + + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + + let rsock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + nix::sys::socket::bind(rsock, &sock_addr).unwrap(); + + setsockopt(rsock, Timestamping, &TimestampingFlag::all()).unwrap(); + + let sbuf = [0u8; 2048]; + let mut rbuf = [0u8; 2048]; + let flags = MsgFlags::empty(); + let iov1 = [IoSlice::new(&sbuf)]; + let mut iov2 = [IoSliceMut::new(&mut rbuf)]; + + let mut cmsg = cmsg_space!(nix::sys::socket::Timestamps); + sendmsg(ssock, &iov1, &[], flags, Some(&sock_addr)).unwrap(); + let recv = recvmsg::<()>(rsock, &mut iov2, Some(&mut cmsg), flags).unwrap(); + + let mut ts = None; + for c in recv.cmsgs() { + if let ControlMessageOwned::ScmTimestampsns(timestamps) = c { + ts = Some(timestamps.system); + } + } + let ts = ts.expect("ScmTimestampns is present"); + let sys_time = ::nix::time::clock_gettime(::nix::time::ClockId::CLOCK_REALTIME).unwrap(); + let diff = if ts > sys_time { + ts - sys_time + } else { + sys_time - ts + }; + assert!(std::time::Duration::from(diff).as_secs() < 60); +} + +#[allow(deprecated)] +#[test] +pub fn test_inetv6_addr_roundtrip_sockaddr_storage_to_addr() { + use nix::sys::socket::{SockAddr, sockaddr_storage_to_addr}; + + let port: u16 = 3000; + let flowinfo: u32 = 1; + let scope_id: u32 = 2; + let ip: Ipv6Addr = "fe80::1".parse().unwrap(); + + let actual = SocketAddr::V6(SocketAddrV6::new(ip, port, flowinfo, scope_id)); + let addr = InetAddr::from_std(&actual); + let sockaddr = SockAddr::new_inet(addr); + + let (storage, ffi_size) = { + let mut storage = MaybeUninit::::zeroed(); + let storage_ptr = storage.as_mut_ptr().cast::(); + let (ffi_ptr, ffi_size) = sockaddr.as_ffi_pair(); + assert_eq!(mem::size_of::(), ffi_size as usize); + unsafe { + storage_ptr.copy_from_nonoverlapping((ffi_ptr as *const sockaddr).cast::(), 1); + (storage.assume_init(), ffi_size) + } + }; + + let from_storage = sockaddr_storage_to_addr(&storage, ffi_size as usize).unwrap(); + assert_eq!(from_storage, sockaddr); + let from_storage = sockaddr_storage_to_addr(&storage, mem::size_of::()).unwrap(); + assert_eq!(from_storage, sockaddr); +} + +#[test] +pub fn test_path_to_sock_addr() { + let path = "/foo/bar"; + let actual = Path::new(path); + let addr = UnixAddr::new(actual).unwrap(); + + let expect: &[c_char] = unsafe { + slice::from_raw_parts(path.as_ptr() as *const c_char, path.len()) + }; + assert_eq!(unsafe { &(*addr.as_ptr()).sun_path[..8] }, expect); + + assert_eq!(addr.path(), Some(actual)); +} + +fn calculate_hash(t: &T) -> u64 { + let mut s = DefaultHasher::new(); + t.hash(&mut s); + s.finish() +} + +#[test] +pub fn test_addr_equality_path() { + let path = "/foo/bar"; + let actual = Path::new(path); + let addr1 = UnixAddr::new(actual).unwrap(); + let mut addr2 = addr1; + + unsafe { (*addr2.as_mut_ptr()).sun_path[10] = 127 }; + + assert_eq!(addr1, addr2); + assert_eq!(calculate_hash(&addr1), calculate_hash(&addr2)); +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +pub fn test_abstract_sun_path_too_long() { + let name = String::from("nix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0testttttnix\0abstract\0test\0make\0sure\0this\0is\0long\0enough"); + let addr = UnixAddr::new_abstract(name.as_bytes()); + assert!(addr.is_err()); +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +pub fn test_addr_equality_abstract() { + let name = String::from("nix\0abstract\0test"); + let addr1 = UnixAddr::new_abstract(name.as_bytes()).unwrap(); + let mut addr2 = addr1; + + assert_eq!(addr1, addr2); + assert_eq!(calculate_hash(&addr1), calculate_hash(&addr2)); + + unsafe { (*addr2.as_mut_ptr()).sun_path[17] = 127 }; + assert_ne!(addr1, addr2); + assert_ne!(calculate_hash(&addr1), calculate_hash(&addr2)); +} + +// Test getting/setting abstract addresses (without unix socket creation) +#[cfg(target_os = "linux")] +#[test] +pub fn test_abstract_uds_addr() { + let empty = String::new(); + let addr = UnixAddr::new_abstract(empty.as_bytes()).unwrap(); + let sun_path: [u8; 0] = []; + assert_eq!(addr.as_abstract(), Some(&sun_path[..])); + + let name = String::from("nix\0abstract\0test"); + let addr = UnixAddr::new_abstract(name.as_bytes()).unwrap(); + let sun_path = [ + 110u8, 105, 120, 0, 97, 98, 115, 116, 114, 97, 99, 116, 0, 116, 101, 115, 116 + ]; + assert_eq!(addr.as_abstract(), Some(&sun_path[..])); + assert_eq!(addr.path(), None); + + // Internally, name is null-prefixed (abstract namespace) + assert_eq!(unsafe { (*addr.as_ptr()).sun_path[0] }, 0); +} + +#[test] +pub fn test_getsockname() { + use nix::sys::socket::{socket, AddressFamily, SockType, SockFlag}; + use nix::sys::socket::bind; + + let tempdir = tempfile::tempdir().unwrap(); + let sockname = tempdir.path().join("sock"); + let sock = socket(AddressFamily::Unix, SockType::Stream, SockFlag::empty(), None) + .expect("socket failed"); + let sockaddr = UnixAddr::new(&sockname).unwrap(); + bind(sock, &sockaddr).expect("bind failed"); + assert_eq!(sockaddr, getsockname(sock).expect("getsockname failed")); +} + +#[test] +pub fn test_socketpair() { + use nix::unistd::{read, write}; + use nix::sys::socket::{socketpair, AddressFamily, SockType, SockFlag}; + + let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); + write(fd1, b"hello").unwrap(); + let mut buf = [0;5]; + read(fd2, &mut buf).unwrap(); + + assert_eq!(&buf[..], b"hello"); +} + +mod recvfrom { + use nix::sys::socket::*; + use nix::{errno::Errno, Result}; + use std::thread; + use super::*; + + const MSG: &[u8] = b"Hello, World!"; + + fn sendrecv(rsock: RawFd, ssock: RawFd, f_send: Fs, mut f_recv: Fr) -> Option + where + Fs: Fn(RawFd, &[u8], MsgFlags) -> Result + Send + 'static, + Fr: FnMut(usize, Option), + { + let mut buf: [u8; 13] = [0u8; 13]; + let mut l = 0; + let mut from = None; + + let send_thread = thread::spawn(move || { + let mut l = 0; + while l < std::mem::size_of_val(MSG) { + l += f_send(ssock, &MSG[l..], MsgFlags::empty()).unwrap(); + } + }); + + while l < std::mem::size_of_val(MSG) { + let (len, from_) = recvfrom(rsock, &mut buf[l..]).unwrap(); + f_recv(len, from_); + from = from_; + l += len; + } + assert_eq!(&buf, MSG); + send_thread.join().unwrap(); + from + } + + #[test] + pub fn stream() { + let (fd2, fd1) = socketpair(AddressFamily::Unix, SockType::Stream, + None, SockFlag::empty()).unwrap(); + // Ignore from for stream sockets + let _ = sendrecv(fd1, fd2, |s, m, flags| { + send(s, m, flags) + }, |_, _| {}); + } + + #[test] + pub fn udp() { + let std_sa = SocketAddrV4::from_str("127.0.0.1:6789").unwrap(); + let sock_addr = SockaddrIn::from(std_sa); + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + let from = sendrecv(rsock, ssock, move |s, m, flags| { + sendto(s, m, &sock_addr, flags) + },|_, _| {}); + // UDP sockets should set the from address + assert_eq!(AddressFamily::Inet, from.unwrap().family().unwrap()); + } + + #[cfg(target_os = "linux")] + mod udp_offload { + use super::*; + use nix::sys::socket::sockopt::{UdpGroSegment, UdpGsoSegment}; + use std::io::IoSlice; + + #[test] + // Disable the test under emulation because it fails in Cirrus-CI. Lack + // of QEMU support is suspected. + #[cfg_attr(qemu, ignore)] + pub fn gso() { + require_kernel_version!(udp_offload::gso, ">= 4.18"); + + // In this test, we send the data and provide a GSO segment size. + // Since we are sending the buffer of size 13, six UDP packets + // with size 2 and two UDP packet with size 1 will be sent. + let segment_size: u16 = 2; + + let sock_addr = SockaddrIn::new(127, 0, 0, 1, 6791); + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + + setsockopt(rsock, UdpGsoSegment, &(segment_size as _)) + .expect("setsockopt UDP_SEGMENT failed"); + + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + + let mut num_packets_received: i32 = 0; + + sendrecv(rsock, ssock, move |s, m, flags| { + let iov = [IoSlice::new(m)]; + let cmsg = ControlMessage::UdpGsoSegments(&segment_size); + sendmsg(s, &iov, &[cmsg], flags, Some(&sock_addr)) + }, { + let num_packets_received_ref = &mut num_packets_received; + + move |len, _| { + // check that we receive UDP packets with payload size + // less or equal to segment size + assert!(len <= segment_size as usize); + *num_packets_received_ref += 1; + } + }); + + // Buffer size is 13, we will receive six packets of size 2, + // and one packet of size 1. + assert_eq!(7, num_packets_received); + } + + #[test] + // Disable the test on emulated platforms because it fails in Cirrus-CI. + // Lack of QEMU support is suspected. + #[cfg_attr(qemu, ignore)] + pub fn gro() { + require_kernel_version!(udp_offload::gro, ">= 5.3"); + + // It's hard to guarantee receiving GRO packets. Just checking + // that `setsockopt` doesn't fail with error + + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + + setsockopt(rsock, UdpGroSegment, &true) + .expect("setsockopt UDP_GRO failed"); + } + } + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + ))] + #[test] + pub fn udp_sendmmsg() { + use std::io::IoSlice; + + let std_sa = SocketAddrV4::from_str("127.0.0.1:6793").unwrap(); + let std_sa2 = SocketAddrV4::from_str("127.0.0.1:6794").unwrap(); + let sock_addr = SockaddrIn::from(std_sa); + let sock_addr2 = SockaddrIn::from(std_sa2); + + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + + let from = sendrecv(rsock, ssock, move |s, m, flags| { + let iov = [IoSlice::new(m)]; + let mut msgs = vec![ + SendMmsgData { + iov: &iov, + cmsgs: &[], + addr: Some(sock_addr), + _lt: Default::default(), + } + ]; + + let batch_size = 15; + + for _ in 0..batch_size { + msgs.push( + SendMmsgData { + iov: &iov, + cmsgs: &[], + addr: Some(sock_addr2), + _lt: Default::default(), + } + ); + } + sendmmsg(s, msgs.iter(), flags) + .map(move |sent_bytes| { + assert!(!sent_bytes.is_empty()); + for sent in &sent_bytes { + assert_eq!(*sent, m.len()); + } + sent_bytes.len() + }) + }, |_, _ | {}); + // UDP sockets should set the from address + assert_eq!(AddressFamily::Inet, from.unwrap().family().unwrap()); + } + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + ))] + #[test] + pub fn udp_recvmmsg() { + use std::io::IoSliceMut; + use nix::sys::socket::{MsgFlags, recvmmsg}; + + const NUM_MESSAGES_SENT: usize = 2; + const DATA: [u8; 2] = [1,2]; + + let inet_addr = SocketAddrV4::from_str("127.0.0.1:6798").unwrap(); + let sock_addr = SockaddrIn::from(inet_addr); + + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + + let send_thread = thread::spawn(move || { + for _ in 0..NUM_MESSAGES_SENT { + sendto(ssock, &DATA[..], &sock_addr, MsgFlags::empty()).unwrap(); + } + }); + + let mut msgs = std::collections::LinkedList::new(); + + // Buffers to receive exactly `NUM_MESSAGES_SENT` messages + let mut receive_buffers = [[0u8; 32]; NUM_MESSAGES_SENT]; + let iovs: Vec<_> = receive_buffers.iter_mut().map(|buf| { + [IoSliceMut::new(&mut buf[..])] + }).collect(); + + for iov in &iovs { + msgs.push_back(RecvMmsgData { + iov, + cmsg_buffer: None, + }) + }; + + let res: Vec> = recvmmsg(rsock, &mut msgs, MsgFlags::empty(), None).expect("recvmmsg"); + assert_eq!(res.len(), DATA.len()); + + for RecvMsg { address, bytes, .. } in res.into_iter() { + assert_eq!(AddressFamily::Inet, address.unwrap().family().unwrap()); + assert_eq!(DATA.len(), bytes); + } + + for buf in &receive_buffers { + assert_eq!(&buf[..DATA.len()], DATA); + } + + send_thread.join().unwrap(); + } + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + ))] + #[test] + pub fn udp_recvmmsg_dontwait_short_read() { + use nix::sys::socket::{MsgFlags, recvmmsg}; + use std::io::IoSliceMut; + + const NUM_MESSAGES_SENT: usize = 2; + const DATA: [u8; 4] = [1,2,3,4]; + + let inet_addr = SocketAddrV4::from_str("127.0.0.1:6799").unwrap(); + let sock_addr = SockaddrIn::from(inet_addr); + + let rsock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None + ).unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + + let send_thread = thread::spawn(move || { + for _ in 0..NUM_MESSAGES_SENT { + sendto(ssock, &DATA[..], &sock_addr, MsgFlags::empty()).unwrap(); + } + }); + // Ensure we've sent all the messages before continuing so `recvmmsg` + // will return right away + send_thread.join().unwrap(); + + let mut msgs = std::collections::LinkedList::new(); + + // Buffers to receive >`NUM_MESSAGES_SENT` messages to ensure `recvmmsg` + // will return when there are fewer than requested messages in the + // kernel buffers when using `MSG_DONTWAIT`. + let mut receive_buffers = [[0u8; 32]; NUM_MESSAGES_SENT + 2]; + let iovs: Vec<_> = receive_buffers.iter_mut().map(|buf| { + [IoSliceMut::new(&mut buf[..])] + }).collect(); + + for iov in &iovs { + msgs.push_back(RecvMmsgData { + iov, + cmsg_buffer: None, + }) + }; + + let res: Vec> = recvmmsg(rsock, &mut msgs, MsgFlags::MSG_DONTWAIT, None).expect("recvmmsg"); + assert_eq!(res.len(), NUM_MESSAGES_SENT); + + for RecvMsg { address, bytes, .. } in res.into_iter() { + assert_eq!(AddressFamily::Inet, address.unwrap().family().unwrap()); + assert_eq!(DATA.len(), bytes); + } + + for buf in &receive_buffers[..NUM_MESSAGES_SENT] { + assert_eq!(&buf[..DATA.len()], DATA); + } + } + + #[test] + pub fn udp_inet6() { + let addr = std::net::Ipv6Addr::from_str("::1").unwrap(); + let rport = 6789; + let rstd_sa = SocketAddrV6::new(addr, rport, 0, 0); + let raddr = SockaddrIn6::from(rstd_sa); + let sport = 6790; + let sstd_sa = SocketAddrV6::new(addr, sport, 0, 0); + let saddr = SockaddrIn6::from(sstd_sa); + let rsock = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("receive socket failed"); + match bind(rsock, &raddr) { + Err(Errno::EADDRNOTAVAIL) => { + println!("IPv6 not available, skipping test."); + return; + } + Err(e) => panic!("bind: {}", e), + Ok(()) => (), + } + let ssock = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + bind(ssock, &saddr).unwrap(); + let from = sendrecv( + rsock, + ssock, + move |s, m, flags| sendto(s, m, &raddr, flags), + |_, _| {}, + ); + assert_eq!(AddressFamily::Inet6, from.unwrap().family().unwrap()); + let osent_addr = from.unwrap(); + let sent_addr = osent_addr.as_sockaddr_in6().unwrap(); + assert_eq!(sent_addr.ip(), addr); + assert_eq!(sent_addr.port(), sport); + } +} + +// Test error handling of our recvmsg wrapper +#[test] +pub fn test_recvmsg_ebadf() { + use nix::errno::Errno; + use nix::sys::socket::{MsgFlags, recvmsg}; + use std::io::IoSliceMut; + + let mut buf = [0u8; 5]; + let mut iov = [IoSliceMut::new(&mut buf[..])]; + + let fd = -1; // Bad file descriptor + let r = recvmsg::<()>(fd, &mut iov, None, MsgFlags::empty()); + + assert_eq!(r.err().unwrap(), Errno::EBADF); +} + +// Disable the test on emulated platforms due to a bug in QEMU versions < +// 2.12.0. https://bugs.launchpad.net/qemu/+bug/1701808 +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_scm_rights() { + use nix::unistd::{pipe, read, write, close}; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, + AddressFamily, SockType, SockFlag, + ControlMessage, ControlMessageOwned, MsgFlags}; + use std::io::{IoSlice, IoSliceMut}; + + let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); + let (r, w) = pipe().unwrap(); + let mut received_r: Option = None; + + { + let iov = [IoSlice::new(b"hello")]; + let fds = [r]; + let cmsg = ControlMessage::ScmRights(&fds); + assert_eq!(sendmsg::<()>(fd1, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(), 5); + close(r).unwrap(); + close(fd1).unwrap(); + } + + { + let mut buf = [0u8; 5]; + + let mut iov = [IoSliceMut::new(&mut buf[..])]; + let mut cmsgspace = cmsg_space!([RawFd; 1]); + let msg = recvmsg::<()>(fd2, &mut iov, Some(&mut cmsgspace), MsgFlags::empty()).unwrap(); + + for cmsg in msg.cmsgs() { + if let ControlMessageOwned::ScmRights(fd) = cmsg { + assert_eq!(received_r, None); + assert_eq!(fd.len(), 1); + received_r = Some(fd[0]); + } else { + panic!("unexpected cmsg"); + } + } + assert_eq!(msg.bytes, 5); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + close(fd2).unwrap(); + } + + let received_r = received_r.expect("Did not receive passed fd"); + // Ensure that the received file descriptor works + write(w, b"world").unwrap(); + let mut buf = [0u8; 5]; + read(received_r, &mut buf).unwrap(); + assert_eq!(&buf[..], b"world"); + close(received_r).unwrap(); + close(w).unwrap(); +} + +// Disable the test on emulated platforms due to not enabled support of AF_ALG in QEMU from rust cross +#[cfg(any(target_os = "linux", target_os= "android"))] +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_af_alg_cipher() { + use nix::unistd::read; + use nix::sys::socket::{socket, sendmsg, bind, accept, setsockopt, + AddressFamily, SockType, SockFlag, AlgAddr, + ControlMessage, MsgFlags}; + use nix::sys::socket::sockopt::AlgSetKey; + use std::io::IoSlice; + + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); + // Travis's seccomp profile blocks AF_ALG + // https://docs.docker.com/engine/security/seccomp/ + skip_if_seccomp!(test_af_alg_cipher); + + let alg_type = "skcipher"; + let alg_name = "ctr-aes-aesni"; + // 256-bits secret key + let key = vec![0u8; 32]; + // 16-bytes IV + let iv_len = 16; + let iv = vec![1u8; iv_len]; + // 256-bytes plain payload + let payload_len = 256; + let payload = vec![2u8; payload_len]; + + let sock = socket(AddressFamily::Alg, SockType::SeqPacket, SockFlag::empty(), None) + .expect("socket failed"); + + let sockaddr = AlgAddr::new(alg_type, alg_name); + bind(sock, &sockaddr).expect("bind failed"); + + assert_eq!(sockaddr.alg_name().to_string_lossy(), alg_name); + assert_eq!(sockaddr.alg_type().to_string_lossy(), alg_type); + + setsockopt(sock, AlgSetKey::default(), &key).expect("setsockopt"); + let session_socket = accept(sock).expect("accept failed"); + + let msgs = [ControlMessage::AlgSetOp(&libc::ALG_OP_ENCRYPT), ControlMessage::AlgSetIv(iv.as_slice())]; + let iov = IoSlice::new(&payload); + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg encrypt"); + + // allocate buffer for encrypted data + let mut encrypted = vec![0u8; payload_len]; + let num_bytes = read(session_socket, &mut encrypted).expect("read encrypt"); + assert_eq!(num_bytes, payload_len); + + let iov = IoSlice::new(&encrypted); + + let iv = vec![1u8; iv_len]; + + let msgs = [ControlMessage::AlgSetOp(&libc::ALG_OP_DECRYPT), ControlMessage::AlgSetIv(iv.as_slice())]; + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg decrypt"); + + // allocate buffer for decrypted data + let mut decrypted = vec![0u8; payload_len]; + let num_bytes = read(session_socket, &mut decrypted).expect("read decrypt"); + + assert_eq!(num_bytes, payload_len); + assert_eq!(decrypted, payload); +} + +// Disable the test on emulated platforms due to not enabled support of AF_ALG +// in QEMU from rust cross +#[cfg(any(target_os = "linux", target_os= "android"))] +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_af_alg_aead() { + use libc::{ALG_OP_DECRYPT, ALG_OP_ENCRYPT}; + use nix::fcntl::{fcntl, FcntlArg, OFlag}; + use nix::unistd::{read, close}; + use nix::sys::socket::{socket, sendmsg, bind, accept, setsockopt, + AddressFamily, SockType, SockFlag, AlgAddr, + ControlMessage, MsgFlags}; + use nix::sys::socket::sockopt::{AlgSetKey, AlgSetAeadAuthSize}; + use std::io::IoSlice; + + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); + // Travis's seccomp profile blocks AF_ALG + // https://docs.docker.com/engine/security/seccomp/ + skip_if_seccomp!(test_af_alg_aead); + + let auth_size = 4usize; + let assoc_size = 16u32; + + let alg_type = "aead"; + let alg_name = "gcm(aes)"; + // 256-bits secret key + let key = vec![0u8; 32]; + // 12-bytes IV + let iv_len = 12; + let iv = vec![1u8; iv_len]; + // 256-bytes plain payload + let payload_len = 256; + let mut payload = vec![2u8; payload_len + (assoc_size as usize) + auth_size]; + + for i in 0..assoc_size { + payload[i as usize] = 10; + } + + let len = payload.len(); + + for i in 0..auth_size { + payload[len - 1 - i] = 0; + } + + let sock = socket(AddressFamily::Alg, SockType::SeqPacket, SockFlag::empty(), None) + .expect("socket failed"); + + let sockaddr = AlgAddr::new(alg_type, alg_name); + bind(sock, &sockaddr).expect("bind failed"); + + setsockopt(sock, AlgSetAeadAuthSize, &auth_size).expect("setsockopt AlgSetAeadAuthSize"); + setsockopt(sock, AlgSetKey::default(), &key).expect("setsockopt AlgSetKey"); + let session_socket = accept(sock).expect("accept failed"); + + let msgs = [ + ControlMessage::AlgSetOp(&ALG_OP_ENCRYPT), + ControlMessage::AlgSetIv(iv.as_slice()), + ControlMessage::AlgSetAeadAssoclen(&assoc_size)]; + + let iov = IoSlice::new(&payload); + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg encrypt"); + + // allocate buffer for encrypted data + let mut encrypted = vec![0u8; (assoc_size as usize) + payload_len + auth_size]; + let num_bytes = read(session_socket, &mut encrypted).expect("read encrypt"); + assert_eq!(num_bytes, payload_len + auth_size + (assoc_size as usize)); + close(session_socket).expect("close"); + + for i in 0..assoc_size { + encrypted[i as usize] = 10; + } + + let iov = IoSlice::new(&encrypted); + + let iv = vec![1u8; iv_len]; + + let session_socket = accept(sock).expect("accept failed"); + + let msgs = [ + ControlMessage::AlgSetOp(&ALG_OP_DECRYPT), + ControlMessage::AlgSetIv(iv.as_slice()), + ControlMessage::AlgSetAeadAssoclen(&assoc_size), + ]; + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None).expect("sendmsg decrypt"); + + // allocate buffer for decrypted data + let mut decrypted = vec![0u8; payload_len + (assoc_size as usize) + auth_size]; + // Starting with kernel 4.9, the interface changed slightly such that the + // authentication tag memory is only needed in the output buffer for encryption + // and in the input buffer for decryption. + // Do not block on read, as we may have fewer bytes than buffer size + fcntl(session_socket,FcntlArg::F_SETFL(OFlag::O_NONBLOCK)).expect("fcntl non_blocking"); + let num_bytes = read(session_socket, &mut decrypted).expect("read decrypt"); + + assert!(num_bytes >= payload_len + (assoc_size as usize)); + assert_eq!(decrypted[(assoc_size as usize)..(payload_len + (assoc_size as usize))], payload[(assoc_size as usize)..payload_len + (assoc_size as usize)]); +} + +// Verify `ControlMessage::Ipv4PacketInfo` for `sendmsg`. +// This creates a (udp) socket bound to localhost, then sends a message to +// itself but uses Ipv4PacketInfo to force the source address to be localhost. +// +// This would be a more interesting test if we could assume that the test host +// has more than one IP address (since we could select a different address to +// test from). +#[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd"))] +#[test] +pub fn test_sendmsg_ipv4packetinfo() { + use cfg_if::cfg_if; + use nix::sys::socket::{socket, sendmsg, bind, + AddressFamily, SockType, SockFlag, SockaddrIn, + ControlMessage, MsgFlags}; + use std::io::IoSlice; + + let sock = socket(AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None) + .expect("socket failed"); + + let sock_addr = SockaddrIn::new(127,0,0,1, 4000); + + bind(sock, &sock_addr).expect("bind failed"); + + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + cfg_if! { + if #[cfg(target_os = "netbsd")] { + let pi = libc::in_pktinfo { + ipi_ifindex: 0, /* Unspecified interface */ + ipi_addr: libc::in_addr { s_addr: 0 }, + }; + } else { + let pi = libc::in_pktinfo { + ipi_ifindex: 0, /* Unspecified interface */ + ipi_addr: libc::in_addr { s_addr: 0 }, + ipi_spec_dst: sock_addr.as_ref().sin_addr, + }; + } + } + + let cmsg = [ControlMessage::Ipv4PacketInfo(&pi)]; + + sendmsg(sock, &iov, &cmsg, MsgFlags::empty(), Some(&sock_addr)) + .expect("sendmsg"); +} + +// Verify `ControlMessage::Ipv6PacketInfo` for `sendmsg`. +// This creates a (udp) socket bound to ip6-localhost, then sends a message to +// itself but uses Ipv6PacketInfo to force the source address to be +// ip6-localhost. +// +// This would be a more interesting test if we could assume that the test host +// has more than one IP address (since we could select a different address to +// test from). +#[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "freebsd"))] +#[test] +pub fn test_sendmsg_ipv6packetinfo() { + use nix::errno::Errno; + use nix::sys::socket::{socket, sendmsg, bind, + AddressFamily, SockType, SockFlag, SockaddrIn6, + ControlMessage, MsgFlags}; + use std::io::IoSlice; + + let sock = socket(AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None) + .expect("socket failed"); + + let std_sa = SocketAddrV6::from_str("[::1]:6000").unwrap(); + let sock_addr: SockaddrIn6 = SockaddrIn6::from(std_sa); + + if let Err(Errno::EADDRNOTAVAIL) = bind(sock, &sock_addr) { + println!("IPv6 not available, skipping test."); + return; + } + + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + let pi = libc::in6_pktinfo { + ipi6_ifindex: 0, /* Unspecified interface */ + ipi6_addr: sock_addr.as_ref().sin6_addr, + }; + + let cmsg = [ControlMessage::Ipv6PacketInfo(&pi)]; + + sendmsg::(sock, &iov, &cmsg, MsgFlags::empty(), Some(&sock_addr)) + .expect("sendmsg"); +} + +/// Tests that passing multiple fds using a single `ControlMessage` works. +// Disable the test on emulated platforms due to a bug in QEMU versions < +// 2.12.0. https://bugs.launchpad.net/qemu/+bug/1701808 +#[cfg_attr(qemu, ignore)] +#[test] +fn test_scm_rights_single_cmsg_multiple_fds() { + use std::os::unix::net::UnixDatagram; + use std::os::unix::io::{RawFd, AsRawFd}; + use std::thread; + use nix::sys::socket::{ControlMessage, ControlMessageOwned, MsgFlags, + sendmsg, recvmsg}; + use std::io::{IoSlice, IoSliceMut}; + + let (send, receive) = UnixDatagram::pair().unwrap(); + let thread = thread::spawn(move || { + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + + let mut space = cmsg_space!([RawFd; 2]); + let msg = recvmsg::<()>( + receive.as_raw_fd(), + &mut iovec, + Some(&mut space), + MsgFlags::empty() + ).unwrap(); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + + let mut cmsgs = msg.cmsgs(); + match cmsgs.next() { + Some(ControlMessageOwned::ScmRights(fds)) => { + assert_eq!(fds.len(), 2, + "unexpected fd count (expected 2 fds, got {})", + fds.len()); + }, + _ => panic!(), + } + assert!(cmsgs.next().is_none(), "unexpected control msg"); + + assert_eq!(msg.bytes, 8); + assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); + }); + + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + let fds = [libc::STDIN_FILENO, libc::STDOUT_FILENO]; // pass stdin and stdout + let cmsg = [ControlMessage::ScmRights(&fds)]; + sendmsg::<()>(send.as_raw_fd(), &iov, &cmsg, MsgFlags::empty(), None).unwrap(); + thread.join().unwrap(); +} + +// Verify `sendmsg` builds a valid `msghdr` when passing an empty +// `cmsgs` argument. This should result in a msghdr with a nullptr +// msg_control field and a msg_controllen of 0 when calling into the +// raw `sendmsg`. +#[test] +pub fn test_sendmsg_empty_cmsgs() { + use nix::unistd::close; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, + AddressFamily, SockType, SockFlag, MsgFlags}; + use std::io::{IoSlice, IoSliceMut}; + + let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); + + { + let iov = [IoSlice::new(b"hello")]; + assert_eq!(sendmsg::<()>(fd1, &iov, &[], MsgFlags::empty(), None).unwrap(), 5); + close(fd1).unwrap(); + } + + { + let mut buf = [0u8; 5]; + let mut iov = [IoSliceMut::new(&mut buf[..])]; + + let mut cmsgspace = cmsg_space!([RawFd; 1]); + let msg = recvmsg::<()>(fd2, &mut iov, Some(&mut cmsgspace), MsgFlags::empty()).unwrap(); + + for _ in msg.cmsgs() { + panic!("unexpected cmsg"); + } + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + assert_eq!(msg.bytes, 5); + close(fd2).unwrap(); + } +} + +#[cfg(any( + target_os = "android", + target_os = "linux", + target_os = "freebsd", + target_os = "dragonfly", +))] +#[test] +fn test_scm_credentials() { + use nix::unistd::{close, getpid, getuid, getgid}; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, + AddressFamily, SockType, SockFlag, + ControlMessage, ControlMessageOwned, MsgFlags, + UnixCredentials}; + #[cfg(any(target_os = "android", target_os = "linux"))] + use nix::sys::socket::{setsockopt, sockopt::PassCred}; + use std::io::{IoSlice, IoSliceMut}; + + let (send, recv) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); + #[cfg(any(target_os = "android", target_os = "linux"))] + setsockopt(recv, PassCred, &true).unwrap(); + + { + let iov = [IoSlice::new(b"hello")]; + #[cfg(any(target_os = "android", target_os = "linux"))] + let cred = UnixCredentials::new(); + #[cfg(any(target_os = "android", target_os = "linux"))] + let cmsg = ControlMessage::ScmCredentials(&cred); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + let cmsg = ControlMessage::ScmCreds; + assert_eq!(sendmsg::<()>(send, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(), 5); + close(send).unwrap(); + } + + { + let mut buf = [0u8; 5]; + let mut iov = [IoSliceMut::new(&mut buf[..])]; + + let mut cmsgspace = cmsg_space!(UnixCredentials); + let msg = recvmsg::<()>(recv, &mut iov, Some(&mut cmsgspace), MsgFlags::empty()).unwrap(); + let mut received_cred = None; + + for cmsg in msg.cmsgs() { + let cred = match cmsg { + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessageOwned::ScmCredentials(cred) => cred, + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessageOwned::ScmCreds(cred) => cred, + other => panic!("unexpected cmsg {:?}", other), + }; + assert!(received_cred.is_none()); + assert_eq!(cred.pid(), getpid().as_raw()); + assert_eq!(cred.uid(), getuid().as_raw()); + assert_eq!(cred.gid(), getgid().as_raw()); + received_cred = Some(cred); + } + received_cred.expect("no creds received"); + assert_eq!(msg.bytes, 5); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + close(recv).unwrap(); + } +} + +/// Ensure that we can send `SCM_CREDENTIALS` and `SCM_RIGHTS` with a single +/// `sendmsg` call. +#[cfg(any(target_os = "android", target_os = "linux"))] +// qemu's handling of multiple cmsgs is bugged, ignore tests under emulation +// see https://bugs.launchpad.net/qemu/+bug/1781280 +#[cfg_attr(qemu, ignore)] +#[test] +fn test_scm_credentials_and_rights() { + let space = cmsg_space!(libc::ucred, RawFd); + test_impl_scm_credentials_and_rights(space); +} + +/// Ensure that passing a an oversized control message buffer to recvmsg +/// still works. +#[cfg(any(target_os = "android", target_os = "linux"))] +// qemu's handling of multiple cmsgs is bugged, ignore tests under emulation +// see https://bugs.launchpad.net/qemu/+bug/1781280 +#[cfg_attr(qemu, ignore)] +#[test] +fn test_too_large_cmsgspace() { + let space = vec![0u8; 1024]; + test_impl_scm_credentials_and_rights(space); +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_impl_scm_credentials_and_rights(mut space: Vec) { + use libc::ucred; + use nix::unistd::{pipe, write, close, getpid, getuid, getgid}; + use nix::sys::socket::{socketpair, sendmsg, recvmsg, setsockopt, + SockType, SockFlag, + ControlMessage, ControlMessageOwned, MsgFlags}; + use nix::sys::socket::sockopt::PassCred; + use std::io::{IoSlice, IoSliceMut}; + + let (send, recv) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()) + .unwrap(); + setsockopt(recv, PassCred, &true).unwrap(); + + let (r, w) = pipe().unwrap(); + let mut received_r: Option = None; + + { + let iov = [IoSlice::new(b"hello")]; + let cred = ucred { + pid: getpid().as_raw(), + uid: getuid().as_raw(), + gid: getgid().as_raw(), + }.into(); + let fds = [r]; + let cmsgs = [ + ControlMessage::ScmCredentials(&cred), + ControlMessage::ScmRights(&fds), + ]; + assert_eq!(sendmsg::<()>(send, &iov, &cmsgs, MsgFlags::empty(), None).unwrap(), 5); + close(r).unwrap(); + close(send).unwrap(); + } + + { + let mut buf = [0u8; 5]; + let mut iov = [IoSliceMut::new(&mut buf[..])]; + let msg = recvmsg::<()>(recv, &mut iov, Some(&mut space), MsgFlags::empty()).unwrap(); + let mut received_cred = None; + + assert_eq!(msg.cmsgs().count(), 2, "expected 2 cmsgs"); + + for cmsg in msg.cmsgs() { + match cmsg { + ControlMessageOwned::ScmRights(fds) => { + assert_eq!(received_r, None, "already received fd"); + assert_eq!(fds.len(), 1); + received_r = Some(fds[0]); + } + ControlMessageOwned::ScmCredentials(cred) => { + assert!(received_cred.is_none()); + assert_eq!(cred.pid(), getpid().as_raw()); + assert_eq!(cred.uid(), getuid().as_raw()); + assert_eq!(cred.gid(), getgid().as_raw()); + received_cred = Some(cred); + } + _ => panic!("unexpected cmsg"), + } + } + received_cred.expect("no creds received"); + assert_eq!(msg.bytes, 5); + assert!(!msg.flags.intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + close(recv).unwrap(); + } + + let received_r = received_r.expect("Did not receive passed fd"); + // Ensure that the received file descriptor works + write(w, b"world").unwrap(); + let mut buf = [0u8; 5]; + read(received_r, &mut buf).unwrap(); + assert_eq!(&buf[..], b"world"); + close(received_r).unwrap(); + close(w).unwrap(); +} + +// Test creating and using named unix domain sockets +#[test] +pub fn test_unixdomain() { + use nix::sys::socket::{SockType, SockFlag}; + use nix::sys::socket::{bind, socket, connect, listen, accept, UnixAddr}; + use nix::unistd::{read, write, close}; + use std::thread; + + let tempdir = tempfile::tempdir().unwrap(); + let sockname = tempdir.path().join("sock"); + let s1 = socket(AddressFamily::Unix, SockType::Stream, + SockFlag::empty(), None).expect("socket failed"); + let sockaddr = UnixAddr::new(&sockname).unwrap(); + bind(s1, &sockaddr).expect("bind failed"); + listen(s1, 10).expect("listen failed"); + + let thr = thread::spawn(move || { + let s2 = socket(AddressFamily::Unix, SockType::Stream, SockFlag::empty(), None) + .expect("socket failed"); + connect(s2, &sockaddr).expect("connect failed"); + write(s2, b"hello").expect("write failed"); + close(s2).unwrap(); + }); + + let s3 = accept(s1).expect("accept failed"); + + let mut buf = [0;5]; + read(s3, &mut buf).unwrap(); + close(s3).unwrap(); + close(s1).unwrap(); + thr.join().unwrap(); + + assert_eq!(&buf[..], b"hello"); +} + +// Test creating and using named system control sockets +#[cfg(any(target_os = "macos", target_os = "ios"))] +#[test] +pub fn test_syscontrol() { + use nix::errno::Errno; + use nix::sys::socket::{socket, SysControlAddr, SockType, SockFlag, SockProtocol}; + + let fd = socket(AddressFamily::System, SockType::Datagram, + SockFlag::empty(), SockProtocol::KextControl) + .expect("socket failed"); + SysControlAddr::from_name(fd, "com.apple.net.utun_control", 0) + .expect("resolving sys_control name failed"); + assert_eq!(SysControlAddr::from_name(fd, "foo.bar.lol", 0).err(), Some(Errno::ENOENT)); + + // requires root privileges + // connect(fd, &sockaddr).expect("connect failed"); +} + +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +fn loopback_address(family: AddressFamily) -> Option { + use std::io; + use std::io::Write; + use nix::ifaddrs::getifaddrs; + use nix::net::if_::*; + use nix::sys::socket::SockaddrLike; + + let addrs = match getifaddrs() { + Ok(iter) => iter, + Err(e) => { + let stdioerr = io::stderr(); + let mut handle = stdioerr.lock(); + writeln!(handle, "getifaddrs: {:?}", e).unwrap(); + return None; + }, + }; + // return first address matching family + for ifaddr in addrs { + if ifaddr.flags.contains(InterfaceFlags::IFF_LOOPBACK) && + ifaddr.address.as_ref().and_then(SockaddrLike::family) == Some(family) + { + return Some(ifaddr) + } + } + None +} + +#[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", +))] +// qemu doesn't seem to be emulating this correctly in these architectures +#[cfg_attr(all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) +), ignore)] +#[test] +pub fn test_recv_ipv4pktinfo() { + use nix::sys::socket::sockopt::Ipv4PacketInfo; + use nix::sys::socket::{bind, SockaddrIn, SockFlag, SockType}; + use nix::sys::socket::{getsockname, setsockopt, socket}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use nix::net::if_::*; + use std::io::{IoSlice, IoSliceMut}; + + let lo_ifaddr = loopback_address(AddressFamily::Inet); + let (lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => (ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface")), + None => return, + }; + let receive = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa: SockaddrIn = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv4PacketInfo, &true).expect("setsockopt failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + let send = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)).expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + + let mut space = cmsg_space!(libc::in_pktinfo); + let msg = recvmsg::<()>( + receive, + &mut iovec, + Some(&mut space), + MsgFlags::empty(), + ).expect("recvmsg failed"); + assert!( + !msg.flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC) + ); + + let mut cmsgs = msg.cmsgs(); + if let Some(ControlMessageOwned::Ipv4PacketInfo(pktinfo)) = cmsgs.next() { + let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); + assert_eq!( + pktinfo.ipi_ifindex as libc::c_uint, + i, + "unexpected ifindex (expected {}, got {})", + i, + pktinfo.ipi_ifindex + ); + } + assert!(cmsgs.next().is_none(), "unexpected additional control msg"); + assert_eq!(msg.bytes, 8); + assert_eq!( + *iovec[0], + [1u8, 2, 3, 4, 5, 6, 7, 8] + ); + } +} + +#[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +// qemu doesn't seem to be emulating this correctly in these architectures +#[cfg_attr(all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) +), ignore)] +#[test] +pub fn test_recvif() { + use nix::net::if_::*; + use nix::sys::socket::sockopt::{Ipv4RecvIf, Ipv4RecvDstAddr}; + use nix::sys::socket::{bind, SockaddrIn, SockFlag, SockType}; + use nix::sys::socket::{getsockname, setsockopt, socket}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use std::io::{IoSlice, IoSliceMut}; + + let lo_ifaddr = loopback_address(AddressFamily::Inet); + let (lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => (ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface")), + None => return, + }; + let receive = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa: SockaddrIn = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv4RecvIf, &true).expect("setsockopt IP_RECVIF failed"); + setsockopt(receive, Ipv4RecvDstAddr, &true).expect("setsockopt IP_RECVDSTADDR failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + let send = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)).expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + let mut space = cmsg_space!(libc::sockaddr_dl, libc::in_addr); + let msg = recvmsg::<()>( + receive, + &mut iovec, + Some(&mut space), + MsgFlags::empty(), + ).expect("recvmsg failed"); + assert!( + !msg.flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC) + ); + assert_eq!(msg.cmsgs().count(), 2, "expected 2 cmsgs"); + + let mut rx_recvif = false; + let mut rx_recvdstaddr = false; + for cmsg in msg.cmsgs() { + match cmsg { + ControlMessageOwned::Ipv4RecvIf(dl) => { + rx_recvif = true; + let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); + assert_eq!( + dl.sdl_index as libc::c_uint, + i, + "unexpected ifindex (expected {}, got {})", + i, + dl.sdl_index + ); + }, + ControlMessageOwned::Ipv4RecvDstAddr(addr) => { + rx_recvdstaddr = true; + if let Some(sin) = lo.as_sockaddr_in() { + assert_eq!(sin.as_ref().sin_addr.s_addr, + addr.s_addr, + "unexpected destination address (expected {}, got {})", + sin.as_ref().sin_addr.s_addr, + addr.s_addr); + } else { + panic!("unexpected Sockaddr"); + } + }, + _ => panic!("unexpected additional control msg"), + } + } + assert!(rx_recvif); + assert!(rx_recvdstaddr); + assert_eq!(msg.bytes, 8); + assert_eq!( + *iovec[0], + [1u8, 2, 3, 4, 5, 6, 7, 8] + ); + } +} + +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +// qemu doesn't seem to be emulating this correctly in these architectures +#[cfg_attr(all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) +), ignore)] +#[test] +pub fn test_recv_ipv6pktinfo() { + use nix::net::if_::*; + use nix::sys::socket::sockopt::Ipv6RecvPacketInfo; + use nix::sys::socket::{bind, SockaddrIn6, SockFlag, SockType}; + use nix::sys::socket::{getsockname, setsockopt, socket}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use std::io::{IoSlice, IoSliceMut}; + + let lo_ifaddr = loopback_address(AddressFamily::Inet6); + let (lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => ( + ifaddr.interface_name, + ifaddr.address.expect("Expect IPv6 address on interface"), + ), + None => return, + }; + let receive = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa: SockaddrIn6 = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv6RecvPacketInfo, &true).expect("setsockopt failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + let send = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ).expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)).expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + + let mut space = cmsg_space!(libc::in6_pktinfo); + let msg = recvmsg::<()>( + receive, + &mut iovec, + Some(&mut space), + MsgFlags::empty(), + ).expect("recvmsg failed"); + assert!( + !msg.flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC) + ); + + let mut cmsgs = msg.cmsgs(); + if let Some(ControlMessageOwned::Ipv6PacketInfo(pktinfo)) = cmsgs.next() + { + let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); + assert_eq!( + pktinfo.ipi6_ifindex as libc::c_uint, + i, + "unexpected ifindex (expected {}, got {})", + i, + pktinfo.ipi6_ifindex + ); + } + assert!(cmsgs.next().is_none(), "unexpected additional control msg"); + assert_eq!(msg.bytes, 8); + assert_eq!( + *iovec[0], + [1u8, 2, 3, 4, 5, 6, 7, 8] + ); + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(graviton, ignore = "Not supported by the CI environment")] +#[test] +pub fn test_vsock() { + use nix::errno::Errno; + use nix::sys::socket::{AddressFamily, socket, bind, connect, listen, + SockType, SockFlag, VsockAddr}; + use nix::unistd::{close}; + use std::thread; + + let port: u32 = 3000; + + let s1 = socket(AddressFamily::Vsock, SockType::Stream, + SockFlag::empty(), None) + .expect("socket failed"); + + // VMADDR_CID_HYPERVISOR is reserved, so we expect an EADDRNOTAVAIL error. + let sockaddr_hv = VsockAddr::new(libc::VMADDR_CID_HYPERVISOR, port); + assert_eq!(bind(s1, &sockaddr_hv).err(), + Some(Errno::EADDRNOTAVAIL)); + + let sockaddr_any = VsockAddr::new(libc::VMADDR_CID_ANY, port); + assert_eq!(bind(s1, &sockaddr_any), Ok(())); + listen(s1, 10).expect("listen failed"); + + let thr = thread::spawn(move || { + let cid: u32 = libc::VMADDR_CID_HOST; + + let s2 = socket(AddressFamily::Vsock, SockType::Stream, + SockFlag::empty(), None) + .expect("socket failed"); + + let sockaddr_host = VsockAddr::new(cid, port); + + // The current implementation does not support loopback devices, so, + // for now, we expect a failure on the connect. + assert_ne!(connect(s2, &sockaddr_host), Ok(())); + + close(s2).unwrap(); + }); + + close(s1).unwrap(); + thr.join().unwrap(); +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(all(target_os = "linux"))] +#[test] +fn test_recvmsg_timestampns() { + use nix::sys::socket::*; + use std::io::{IoSlice, IoSliceMut}; + use nix::sys::time::*; + use std::time::*; + + // Set up + let message = "Ohayō!".as_bytes(); + let in_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None).unwrap(); + setsockopt(in_socket, sockopt::ReceiveTimestampns, &true).unwrap(); + let localhost = SockaddrIn::new(127, 0, 0, 1, 0); + bind(in_socket, &localhost).unwrap(); + let address: SockaddrIn = getsockname(in_socket).unwrap(); + // Get initial time + let time0 = SystemTime::now(); + // Send the message + let iov = [IoSlice::new(message)]; + let flags = MsgFlags::empty(); + let l = sendmsg(in_socket, &iov, &[], flags, Some(&address)).unwrap(); + assert_eq!(message.len(), l); + // Receive the message + let mut buffer = vec![0u8; message.len()]; + let mut cmsgspace = nix::cmsg_space!(TimeSpec); + + let mut iov = [IoSliceMut::new(&mut buffer)]; + let r = recvmsg::<()>(in_socket, &mut iov, Some(&mut cmsgspace), flags).unwrap(); + let rtime = match r.cmsgs().next() { + Some(ControlMessageOwned::ScmTimestampns(rtime)) => rtime, + Some(_) => panic!("Unexpected control message"), + None => panic!("No control message") + }; + // Check the final time + let time1 = SystemTime::now(); + // the packet's received timestamp should lie in-between the two system + // times, unless the system clock was adjusted in the meantime. + let rduration = Duration::new(rtime.tv_sec() as u64, + rtime.tv_nsec() as u32); + assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); + assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); + // Close socket + nix::unistd::close(in_socket).unwrap(); +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(all(target_os = "linux"))] +#[test] +fn test_recvmmsg_timestampns() { + use nix::sys::socket::*; + use std::io::{IoSlice, IoSliceMut}; + use nix::sys::time::*; + use std::time::*; + + // Set up + let message = "Ohayō!".as_bytes(); + let in_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None).unwrap(); + setsockopt(in_socket, sockopt::ReceiveTimestampns, &true).unwrap(); + let localhost = SockaddrIn::from_str("127.0.0.1:0").unwrap(); + bind(in_socket, &localhost).unwrap(); + let address: SockaddrIn = getsockname(in_socket).unwrap(); + // Get initial time + let time0 = SystemTime::now(); + // Send the message + let iov = [IoSlice::new(message)]; + let flags = MsgFlags::empty(); + let l = sendmsg(in_socket, &iov, &[], flags, Some(&address)).unwrap(); + assert_eq!(message.len(), l); + // Receive the message + let mut buffer = vec![0u8; message.len()]; + let mut cmsgspace = nix::cmsg_space!(TimeSpec); + let iov = [IoSliceMut::new(&mut buffer)]; + let mut data = vec![ + RecvMmsgData { + iov, + cmsg_buffer: Some(&mut cmsgspace), + }, + ]; + let r: Vec> = recvmmsg(in_socket, &mut data, flags, None).unwrap(); + let rtime = match r[0].cmsgs().next() { + Some(ControlMessageOwned::ScmTimestampns(rtime)) => rtime, + Some(_) => panic!("Unexpected control message"), + None => panic!("No control message") + }; + // Check the final time + let time1 = SystemTime::now(); + // the packet's received timestamp should lie in-between the two system + // times, unless the system clock was adjusted in the meantime. + let rduration = Duration::new(rtime.tv_sec() as u64, + rtime.tv_nsec() as u32); + assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); + assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); + // Close socket + nix::unistd::close(in_socket).unwrap(); +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] +#[test] +fn test_recvmsg_rxq_ovfl() { + use nix::Error; + use nix::sys::socket::*; + use std::io::{IoSlice, IoSliceMut}; + use nix::sys::socket::sockopt::{RxqOvfl, RcvBuf}; + + let message = [0u8; 2048]; + let bufsize = message.len() * 2; + + let in_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None).unwrap(); + let out_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None).unwrap(); + + let localhost = SockaddrIn::from_str("127.0.0.1:0").unwrap(); + bind(in_socket, &localhost).unwrap(); + + let address: SockaddrIn = getsockname(in_socket).unwrap(); + connect(out_socket, &address).unwrap(); + + // Set SO_RXQ_OVFL flag. + setsockopt(in_socket, RxqOvfl, &1).unwrap(); + + // Set the receiver buffer size to hold only 2 messages. + setsockopt(in_socket, RcvBuf, &bufsize).unwrap(); + + let mut drop_counter = 0; + + for _ in 0..2 { + let iov = [IoSlice::new(&message)]; + let flags = MsgFlags::empty(); + + // Send the 3 messages (the receiver buffer can only hold 2 messages) + // to create an overflow. + for _ in 0..3 { + let l = sendmsg(out_socket, &iov, &[], flags, Some(&address)).unwrap(); + assert_eq!(message.len(), l); + } + + // Receive the message and check the drop counter if any. + loop { + let mut buffer = vec![0u8; message.len()]; + let mut cmsgspace = nix::cmsg_space!(u32); + + let mut iov = [IoSliceMut::new(&mut buffer)]; + + match recvmsg::<()>( + in_socket, + &mut iov, + Some(&mut cmsgspace), + MsgFlags::MSG_DONTWAIT) { + Ok(r) => { + drop_counter = match r.cmsgs().next() { + Some(ControlMessageOwned::RxqOvfl(drop_counter)) => drop_counter, + Some(_) => panic!("Unexpected control message"), + None => 0, + }; + }, + Err(Error::EAGAIN) => { break; }, + _ => { panic!("unknown recvmsg() error"); }, + } + } + } + + // One packet lost. + assert_eq!(drop_counter, 1); + + // Close sockets + nix::unistd::close(in_socket).unwrap(); + nix::unistd::close(out_socket).unwrap(); +} + +#[cfg(any( + target_os = "linux", + target_os = "android", +))] +mod linux_errqueue { + use nix::sys::socket::*; + use super::FromStr; + + // Send a UDP datagram to a bogus destination address and observe an ICMP error (v4). + // + // Disable the test on QEMU because QEMU emulation of IP_RECVERR is broken (as documented on PR + // #1514). + #[cfg_attr(qemu, ignore)] + #[test] + fn test_recverr_v4() { + #[repr(u8)] + enum IcmpTypes { + DestUnreach = 3, // ICMP_DEST_UNREACH + } + #[repr(u8)] + enum IcmpUnreachCodes { + PortUnreach = 3, // ICMP_PORT_UNREACH + } + + test_recverr_impl::( + "127.0.0.1:6800", + AddressFamily::Inet, + sockopt::Ipv4RecvErr, + libc::SO_EE_ORIGIN_ICMP, + IcmpTypes::DestUnreach as u8, + IcmpUnreachCodes::PortUnreach as u8, + // Closure handles protocol-specific testing and returns generic sock_extended_err for + // protocol-independent test impl. + |cmsg| { + if let ControlMessageOwned::Ipv4RecvErr(ext_err, err_addr) = cmsg { + if let Some(origin) = err_addr { + // Validate that our network error originated from 127.0.0.1:0. + assert_eq!(origin.sin_family, AddressFamily::Inet as _); + assert_eq!(origin.sin_addr.s_addr, u32::from_be(0x7f000001)); + assert_eq!(origin.sin_port, 0); + } else { + panic!("Expected some error origin"); + } + *ext_err + } else { + panic!("Unexpected control message {:?}", cmsg); + } + }, + ) + } + + // Essentially the same test as v4. + // + // Disable the test on QEMU because QEMU emulation of IPV6_RECVERR is broken (as documented on + // PR #1514). + #[cfg_attr(qemu, ignore)] + #[test] + fn test_recverr_v6() { + #[repr(u8)] + enum IcmpV6Types { + DestUnreach = 1, // ICMPV6_DEST_UNREACH + } + #[repr(u8)] + enum IcmpV6UnreachCodes { + PortUnreach = 4, // ICMPV6_PORT_UNREACH + } + + test_recverr_impl::( + "[::1]:6801", + AddressFamily::Inet6, + sockopt::Ipv6RecvErr, + libc::SO_EE_ORIGIN_ICMP6, + IcmpV6Types::DestUnreach as u8, + IcmpV6UnreachCodes::PortUnreach as u8, + // Closure handles protocol-specific testing and returns generic sock_extended_err for + // protocol-independent test impl. + |cmsg| { + if let ControlMessageOwned::Ipv6RecvErr(ext_err, err_addr) = cmsg { + if let Some(origin) = err_addr { + // Validate that our network error originated from localhost:0. + assert_eq!(origin.sin6_family, AddressFamily::Inet6 as _); + assert_eq!( + origin.sin6_addr.s6_addr, + std::net::Ipv6Addr::LOCALHOST.octets() + ); + assert_eq!(origin.sin6_port, 0); + } else { + panic!("Expected some error origin"); + } + *ext_err + } else { + panic!("Unexpected control message {:?}", cmsg); + } + }, + ) + } + + fn test_recverr_impl(sa: &str, + af: AddressFamily, + opt: OPT, + ee_origin: u8, + ee_type: u8, + ee_code: u8, + testf: TESTF) + where + OPT: SetSockOpt, + TESTF: FnOnce(&ControlMessageOwned) -> libc::sock_extended_err, + { + use nix::errno::Errno; + use std::io::IoSliceMut; + + const MESSAGE_CONTENTS: &str = "ABCDEF"; + let std_sa = std::net::SocketAddr::from_str(sa).unwrap(); + let sock_addr = SockaddrStorage::from(std_sa); + let sock = socket(af, SockType::Datagram, SockFlag::SOCK_CLOEXEC, None).unwrap(); + setsockopt(sock, opt, &true).unwrap(); + if let Err(e) = sendto(sock, MESSAGE_CONTENTS.as_bytes(), &sock_addr, MsgFlags::empty()) { + assert_eq!(e, Errno::EADDRNOTAVAIL); + println!("{:?} not available, skipping test.", af); + return; + } + + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + let mut cspace = cmsg_space!(libc::sock_extended_err, SA); + + let msg = recvmsg(sock, &mut iovec, Some(&mut cspace), MsgFlags::MSG_ERRQUEUE).unwrap(); + // The sent message / destination associated with the error is returned: + assert_eq!(msg.bytes, MESSAGE_CONTENTS.as_bytes().len()); + // recvmsg(2): "The original destination address of the datagram that caused the error is + // supplied via msg_name;" however, this is not literally true. E.g., an earlier version + // of this test used 0.0.0.0 (::0) as the destination address, which was mutated into + // 127.0.0.1 (::1). + assert_eq!(msg.address, Some(sock_addr)); + + // Check for expected control message. + let ext_err = match msg.cmsgs().next() { + Some(cmsg) => testf(&cmsg), + None => panic!("No control message"), + }; + + assert_eq!(ext_err.ee_errno, libc::ECONNREFUSED as u32); + assert_eq!(ext_err.ee_origin, ee_origin); + // ip(7): ee_type and ee_code are set from the type and code fields of the ICMP (ICMPv6) + // header. + assert_eq!(ext_err.ee_type, ee_type); + assert_eq!(ext_err.ee_code, ee_code); + // ip(7): ee_info contains the discovered MTU for EMSGSIZE errors. + assert_eq!(ext_err.ee_info, 0); + + let bytes = msg.bytes; + assert_eq!(&buf[..bytes], MESSAGE_CONTENTS.as_bytes()); + } +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(target_os = "linux")] +#[test] +pub fn test_txtime() { + use nix::sys::socket::{ + bind, recvmsg, sendmsg, setsockopt, socket, sockopt, ControlMessage, + MsgFlags, SockaddrIn, SockFlag, SockType, + }; + use nix::sys::time::TimeValLike; + use nix::time::{ClockId, clock_gettime}; + + require_kernel_version!(test_txtime, ">= 5.8"); + + let sock_addr = SockaddrIn::from_str("127.0.0.1:6802").unwrap(); + + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + + let txtime_cfg = libc::sock_txtime { + clockid: libc::CLOCK_MONOTONIC, + flags: 0, + }; + setsockopt(ssock, sockopt::TxTime, &txtime_cfg).unwrap(); + + let rsock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + bind(rsock, &sock_addr).unwrap(); + + let sbuf = [0u8; 2048]; + let iov1 = [std::io::IoSlice::new(&sbuf)]; + + let now = clock_gettime(ClockId::CLOCK_MONOTONIC).unwrap(); + let delay = std::time::Duration::from_secs(1).into(); + let txtime = (now + delay).num_nanoseconds() as u64; + + let cmsg = ControlMessage::TxTime(&txtime); + sendmsg(ssock, &iov1, &[cmsg], MsgFlags::empty(), Some(&sock_addr)).unwrap(); + + let mut rbuf = [0u8; 2048]; + let mut iov2 = [std::io::IoSliceMut::new(&mut rbuf)]; + recvmsg::<()>(rsock, &mut iov2, None, MsgFlags::empty()).unwrap(); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_sockopt.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_sockopt.rs new file mode 100644 index 0000000000000000000000000000000000000000..4f75e1784683bd9edeb14680314800b0c82cb733 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_sockopt.rs @@ -0,0 +1,237 @@ +use rand::{thread_rng, Rng}; +use nix::sys::socket::{socket, sockopt, getsockopt, setsockopt, AddressFamily, SockType, SockFlag, SockProtocol}; +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::*; + +// NB: FreeBSD supports LOCAL_PEERCRED for SOCK_SEQPACKET, but OSX does not. +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", +))] +#[test] +pub fn test_local_peercred_seqpacket() { + use nix::{ + unistd::{Gid, Uid}, + sys::socket::socketpair + }; + + let (fd1, _fd2) = socketpair(AddressFamily::Unix, SockType::SeqPacket, None, + SockFlag::empty()).unwrap(); + let xucred = getsockopt(fd1, sockopt::LocalPeerCred).unwrap(); + assert_eq!(xucred.version(), 0); + assert_eq!(Uid::from_raw(xucred.uid()), Uid::current()); + assert_eq!(Gid::from_raw(xucred.groups()[0]), Gid::current()); +} + +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios" +))] +#[test] +pub fn test_local_peercred_stream() { + use nix::{ + unistd::{Gid, Uid}, + sys::socket::socketpair + }; + + let (fd1, _fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, + SockFlag::empty()).unwrap(); + let xucred = getsockopt(fd1, sockopt::LocalPeerCred).unwrap(); + assert_eq!(xucred.version(), 0); + assert_eq!(Uid::from_raw(xucred.uid()), Uid::current()); + assert_eq!(Gid::from_raw(xucred.groups()[0]), Gid::current()); +} + +#[cfg(target_os = "linux")] +#[test] +fn is_so_mark_functional() { + use nix::sys::socket::sockopt; + + require_capability!("is_so_mark_functional", CAP_NET_ADMIN); + + let s = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); + setsockopt(s, sockopt::Mark, &1337).unwrap(); + let mark = getsockopt(s, sockopt::Mark).unwrap(); + assert_eq!(mark, 1337); +} + +#[test] +fn test_so_buf() { + let fd = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), SockProtocol::Udp) + .unwrap(); + let bufsize: usize = thread_rng().gen_range(4096..131_072); + setsockopt(fd, sockopt::SndBuf, &bufsize).unwrap(); + let actual = getsockopt(fd, sockopt::SndBuf).unwrap(); + assert!(actual >= bufsize); + setsockopt(fd, sockopt::RcvBuf, &bufsize).unwrap(); + let actual = getsockopt(fd, sockopt::RcvBuf).unwrap(); + assert!(actual >= bufsize); +} + +#[test] +fn test_so_tcp_maxseg() { + use std::net::SocketAddrV4; + use std::str::FromStr; + use nix::sys::socket::{accept, bind, connect, listen, SockaddrIn}; + use nix::unistd::{close, write}; + + let std_sa = SocketAddrV4::from_str("127.0.0.1:4001").unwrap(); + let sock_addr = SockaddrIn::from(std_sa); + + let rsock = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp) + .unwrap(); + bind(rsock, &sock_addr).unwrap(); + listen(rsock, 10).unwrap(); + let initial = getsockopt(rsock, sockopt::TcpMaxSeg).unwrap(); + // Initial MSS is expected to be 536 (https://tools.ietf.org/html/rfc879#section-1) but some + // platforms keep it even lower. This might fail if you've tuned your initial MSS to be larger + // than 700 + cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + let segsize: u32 = 873; + assert!(initial < segsize); + setsockopt(rsock, sockopt::TcpMaxSeg, &segsize).unwrap(); + } else { + assert!(initial < 700); + } + } + + // Connect and check the MSS that was advertised + let ssock = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp) + .unwrap(); + connect(ssock, &sock_addr).unwrap(); + let rsess = accept(rsock).unwrap(); + write(rsess, b"hello").unwrap(); + let actual = getsockopt(ssock, sockopt::TcpMaxSeg).unwrap(); + // Actual max segment size takes header lengths into account, max IPv4 options (60 bytes) + max + // TCP options (40 bytes) are subtracted from the requested maximum as a lower boundary. + cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + assert!((segsize - 100) <= actual); + assert!(actual <= segsize); + } else { + assert!(initial < actual); + assert!(536 < actual); + } + } + close(rsock).unwrap(); + close(ssock).unwrap(); +} + +// The CI doesn't supported getsockopt and setsockopt on emulated processors. +// It's believed that a QEMU issue, the tests run ok on a fully emulated system. +// Current CI just run the binary with QEMU but the Kernel remains the same as the host. +// So the syscall doesn't work properly unless the kernel is also emulated. +#[test] +#[cfg(all( + any(target_arch = "x86", target_arch = "x86_64"), + any(target_os = "freebsd", target_os = "linux") +))] +fn test_tcp_congestion() { + use std::ffi::OsString; + + let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); + + let val = getsockopt(fd, sockopt::TcpCongestion).unwrap(); + setsockopt(fd, sockopt::TcpCongestion, &val).unwrap(); + + setsockopt(fd, sockopt::TcpCongestion, &OsString::from("tcp_congestion_does_not_exist")).unwrap_err(); + + assert_eq!( + getsockopt(fd, sockopt::TcpCongestion).unwrap(), + val + ); +} + +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_bindtodevice() { + skip_if_not_root!("test_bindtodevice"); + + let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); + + let val = getsockopt(fd, sockopt::BindToDevice).unwrap(); + setsockopt(fd, sockopt::BindToDevice, &val).unwrap(); + + assert_eq!( + getsockopt(fd, sockopt::BindToDevice).unwrap(), + val + ); +} + +#[test] +fn test_so_tcp_keepalive() { + let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp).unwrap(); + setsockopt(fd, sockopt::KeepAlive, &true).unwrap(); + assert!(getsockopt(fd, sockopt::KeepAlive).unwrap()); + + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "nacl"))] { + let x = getsockopt(fd, sockopt::TcpKeepIdle).unwrap(); + setsockopt(fd, sockopt::TcpKeepIdle, &(x + 1)).unwrap(); + assert_eq!(getsockopt(fd, sockopt::TcpKeepIdle).unwrap(), x + 1); + + let x = getsockopt(fd, sockopt::TcpKeepCount).unwrap(); + setsockopt(fd, sockopt::TcpKeepCount, &(x + 1)).unwrap(); + assert_eq!(getsockopt(fd, sockopt::TcpKeepCount).unwrap(), x + 1); + + let x = getsockopt(fd, sockopt::TcpKeepInterval).unwrap(); + setsockopt(fd, sockopt::TcpKeepInterval, &(x + 1)).unwrap(); + assert_eq!(getsockopt(fd, sockopt::TcpKeepInterval).unwrap(), x + 1); + } +} + +#[test] +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +fn test_ttl_opts() { + let fd4 = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None).unwrap(); + setsockopt(fd4, sockopt::Ipv4Ttl, &1) + .expect("setting ipv4ttl on an inet socket should succeed"); + let fd6 = socket(AddressFamily::Inet6, SockType::Datagram, SockFlag::empty(), None).unwrap(); + setsockopt(fd6, sockopt::Ipv6Ttl, &1) + .expect("setting ipv6ttl on an inet6 socket should succeed"); +} + +#[test] +#[cfg(any(target_os = "ios", target_os = "macos"))] +fn test_dontfrag_opts() { + let fd4 = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp).unwrap(); + setsockopt(fd4, sockopt::IpDontFrag, &true) + .expect("setting IP_DONTFRAG on an inet stream socket should succeed"); + setsockopt(fd4, sockopt::IpDontFrag, &false) + .expect("unsetting IP_DONTFRAG on an inet stream socket should succeed"); + let fd4d = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None).unwrap(); + setsockopt(fd4d, sockopt::IpDontFrag, &true) + .expect("setting IP_DONTFRAG on an inet datagram socket should succeed"); + setsockopt(fd4d, sockopt::IpDontFrag, &false) + .expect("unsetting IP_DONTFRAG on an inet datagram socket should succeed"); +} + +#[test] +#[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + ) +)] +// Disable the test under emulation because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +fn test_v6dontfrag_opts() { + let fd6 = socket(AddressFamily::Inet6, SockType::Stream, SockFlag::empty(), SockProtocol::Tcp).unwrap(); + setsockopt(fd6, sockopt::Ipv6DontFrag, &true) + .expect("setting IPV6_DONTFRAG on an inet6 stream socket should succeed"); + setsockopt(fd6, sockopt::Ipv6DontFrag, &false) + .expect("unsetting IPV6_DONTFRAG on an inet6 stream socket should succeed"); + let fd6d = socket(AddressFamily::Inet6, SockType::Datagram, SockFlag::empty(), None).unwrap(); + setsockopt(fd6d, sockopt::Ipv6DontFrag, &true) + .expect("setting IPV6_DONTFRAG on an inet6 datagram socket should succeed"); + setsockopt(fd6d, sockopt::Ipv6DontFrag, &false) + .expect("unsetting IPV6_DONTFRAG on an inet6 datagram socket should succeed"); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_sysinfo.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_sysinfo.rs new file mode 100644 index 0000000000000000000000000000000000000000..73e6586f6223e637dd94b0b6ded6008dd4ce48f2 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_sysinfo.rs @@ -0,0 +1,18 @@ +use nix::sys::sysinfo::*; + +#[test] +fn sysinfo_works() { + let info = sysinfo().unwrap(); + + let (l1, l5, l15) = info.load_average(); + assert!(l1 >= 0.0); + assert!(l5 >= 0.0); + assert!(l15 >= 0.0); + + info.uptime(); // just test Duration construction + + assert!(info.swap_free() <= info.swap_total(), + "more swap available than installed (free: {}, total: {})", + info.swap_free(), + info.swap_total()); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_termios.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_termios.rs new file mode 100644 index 0000000000000000000000000000000000000000..4a8615437e22d7db175cf6b10373cbcea516a568 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_termios.rs @@ -0,0 +1,130 @@ +use std::os::unix::prelude::*; +use tempfile::tempfile; + +use nix::fcntl; +use nix::errno::Errno; +use nix::pty::openpty; +use nix::sys::termios::{self, LocalFlags, OutputFlags, tcgetattr}; +use nix::unistd::{read, write, close}; + +/// Helper function analogous to `std::io::Write::write_all`, but for `RawFd`s +fn write_all(f: RawFd, buf: &[u8]) { + let mut len = 0; + while len < buf.len() { + len += write(f, &buf[len..]).unwrap(); + } +} + +// Test tcgetattr on a terminal +#[test] +fn test_tcgetattr_pty() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + let pty = openpty(None, None).expect("openpty failed"); + assert!(termios::tcgetattr(pty.slave).is_ok()); + close(pty.master).expect("closing the master failed"); + close(pty.slave).expect("closing the slave failed"); +} + +// Test tcgetattr on something that isn't a terminal +#[test] +fn test_tcgetattr_enotty() { + let file = tempfile().unwrap(); + assert_eq!(termios::tcgetattr(file.as_raw_fd()).err(), + Some(Errno::ENOTTY)); +} + +// Test tcgetattr on an invalid file descriptor +#[test] +fn test_tcgetattr_ebadf() { + assert_eq!(termios::tcgetattr(-1).err(), + Some(Errno::EBADF)); +} + +// Test modifying output flags +#[test] +fn test_output_flags() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + // Open one pty to get attributes for the second one + let mut termios = { + let pty = openpty(None, None).expect("openpty failed"); + assert!(pty.master > 0); + assert!(pty.slave > 0); + let termios = tcgetattr(pty.slave).expect("tcgetattr failed"); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + termios + }; + + // Make sure postprocessing '\r' isn't specified by default or this test is useless. + assert!(!termios.output_flags.contains(OutputFlags::OPOST | OutputFlags::OCRNL)); + + // Specify that '\r' characters should be transformed to '\n' + // OPOST is specified to enable post-processing + termios.output_flags.insert(OutputFlags::OPOST | OutputFlags::OCRNL); + + // Open a pty + let pty = openpty(None, &termios).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Write into the master + let string = "foofoofoo\r"; + write_all(pty.master, string.as_bytes()); + + // Read from the slave verifying that the output has been properly transformed + let mut buf = [0u8; 10]; + crate::read_exact(pty.slave, &mut buf); + let transformed_string = "foofoofoo\n"; + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + assert_eq!(&buf, transformed_string.as_bytes()); +} + +// Test modifying local flags +#[test] +fn test_local_flags() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + // Open one pty to get attributes for the second one + let mut termios = { + let pty = openpty(None, None).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + let termios = tcgetattr(pty.slave).unwrap(); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + termios + }; + + // Make sure echo is specified by default or this test is useless. + assert!(termios.local_flags.contains(LocalFlags::ECHO)); + + // Disable local echo + termios.local_flags.remove(LocalFlags::ECHO); + + // Open a new pty with our modified termios settings + let pty = openpty(None, &termios).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Set the master is in nonblocking mode or reading will never return. + let flags = fcntl::fcntl(pty.master, fcntl::F_GETFL).unwrap(); + let new_flags = fcntl::OFlag::from_bits_truncate(flags) | fcntl::OFlag::O_NONBLOCK; + fcntl::fcntl(pty.master, fcntl::F_SETFL(new_flags)).unwrap(); + + // Write into the master + let string = "foofoofoo\r"; + write_all(pty.master, string.as_bytes()); + + // Try to read from the master, which should not have anything as echoing was disabled. + let mut buf = [0u8; 10]; + let read = read(pty.master, &mut buf).unwrap_err(); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + assert_eq!(read, Errno::EAGAIN); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_timerfd.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_timerfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..24fb2ac002e1da959a377956d04aedf13c2df4ef --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_timerfd.rs @@ -0,0 +1,61 @@ +use nix::sys::time::{TimeSpec, TimeValLike}; +use nix::sys::timerfd::{ClockId, Expiration, TimerFd, TimerFlags, TimerSetTimeFlags}; +use std::time::Instant; + +#[test] +pub fn test_timerfd_oneshot() { + let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + + let before = Instant::now(); + + timer + .set( + Expiration::OneShot(TimeSpec::seconds(1)), + TimerSetTimeFlags::empty(), + ) + .unwrap(); + + timer.wait().unwrap(); + + let millis = before.elapsed().as_millis(); + assert!(millis > 900); +} + +#[test] +pub fn test_timerfd_interval() { + let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + + let before = Instant::now(); + timer + .set( + Expiration::IntervalDelayed(TimeSpec::seconds(1), TimeSpec::seconds(2)), + TimerSetTimeFlags::empty(), + ) + .unwrap(); + + timer.wait().unwrap(); + + let start_delay = before.elapsed().as_millis(); + assert!(start_delay > 900); + + timer.wait().unwrap(); + + let interval_delay = before.elapsed().as_millis(); + assert!(interval_delay > 2900); +} + +#[test] +pub fn test_timerfd_unset() { + let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + + timer + .set( + Expiration::OneShot(TimeSpec::seconds(1)), + TimerSetTimeFlags::empty(), + ) + .unwrap(); + + timer.unset().unwrap(); + + assert!(timer.get().unwrap() == None); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_uio.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_uio.rs new file mode 100644 index 0000000000000000000000000000000000000000..7dd12a21b0d7c20af79e4f5784963ddc870b600a --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_uio.rs @@ -0,0 +1,259 @@ +use nix::sys::uio::*; +use nix::unistd::*; +use rand::{thread_rng, Rng}; +use rand::distributions::Alphanumeric; +use std::{cmp, iter}; +use std::fs::{OpenOptions}; +use std::io::IoSlice; +use std::os::unix::io::AsRawFd; + +#[cfg(not(target_os = "redox"))] +use std::io::IoSliceMut; + +#[cfg(not(target_os = "redox"))] +use tempfile::tempfile; +use tempfile::tempdir; + +#[test] +fn test_writev() { + let mut to_write = Vec::with_capacity(16 * 128); + for _ in 0..16 { + let s: String = thread_rng() + .sample_iter(&Alphanumeric) + .map(char::from) + .take(128) + .collect(); + let b = s.as_bytes(); + to_write.extend(b.iter().cloned()); + } + // Allocate and fill iovecs + let mut iovecs = Vec::new(); + let mut consumed = 0; + while consumed < to_write.len() { + let left = to_write.len() - consumed; + let slice_len = if left <= 64 { left } else { thread_rng().gen_range(64..cmp::min(256, left)) }; + let b = &to_write[consumed..consumed+slice_len]; + iovecs.push(IoSlice::new(b)); + consumed += slice_len; + } + let pipe_res = pipe(); + assert!(pipe_res.is_ok()); + let (reader, writer) = pipe_res.ok().unwrap(); + // FileDesc will close its filedesc (reader). + let mut read_buf: Vec = iter::repeat(0u8).take(128 * 16).collect(); + // Blocking io, should write all data. + let write_res = writev(writer, &iovecs); + // Successful write + assert!(write_res.is_ok()); + let written = write_res.ok().unwrap(); + // Check whether we written all data + assert_eq!(to_write.len(), written); + let read_res = read(reader, &mut read_buf[..]); + // Successful read + assert!(read_res.is_ok()); + let read = read_res.ok().unwrap() as usize; + // Check we have read as much as we written + assert_eq!(read, written); + // Check equality of written and read data + assert_eq!(&to_write, &read_buf); + let close_res = close(writer); + assert!(close_res.is_ok()); + let close_res = close(reader); + assert!(close_res.is_ok()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_readv() { + let s:String = thread_rng() + .sample_iter(&Alphanumeric) + .map(char::from) + .take(128) + .collect(); + let to_write = s.as_bytes().to_vec(); + let mut storage = Vec::new(); + let mut allocated = 0; + while allocated < to_write.len() { + let left = to_write.len() - allocated; + let vec_len = if left <= 64 { left } else { thread_rng().gen_range(64..cmp::min(256, left)) }; + let v: Vec = iter::repeat(0u8).take(vec_len).collect(); + storage.push(v); + allocated += vec_len; + } + let mut iovecs = Vec::with_capacity(storage.len()); + for v in &mut storage { + iovecs.push(IoSliceMut::new(&mut v[..])); + } + let pipe_res = pipe(); + assert!(pipe_res.is_ok()); + let (reader, writer) = pipe_res.ok().unwrap(); + // Blocking io, should write all data. + let write_res = write(writer, &to_write); + // Successful write + assert!(write_res.is_ok()); + let read_res = readv(reader, &mut iovecs[..]); + assert!(read_res.is_ok()); + let read = read_res.ok().unwrap(); + // Check whether we've read all data + assert_eq!(to_write.len(), read); + // Cccumulate data from iovecs + let mut read_buf = Vec::with_capacity(to_write.len()); + for iovec in &iovecs { + read_buf.extend(iovec.iter().cloned()); + } + // Check whether iovecs contain all written data + assert_eq!(read_buf.len(), to_write.len()); + // Check equality of written and read data + assert_eq!(&read_buf, &to_write); + let close_res = close(reader); + assert!(close_res.is_ok()); + let close_res = close(writer); + assert!(close_res.is_ok()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_pwrite() { + use std::io::Read; + + let mut file = tempfile().unwrap(); + let buf = [1u8;8]; + assert_eq!(Ok(8), pwrite(file.as_raw_fd(), &buf, 8)); + let mut file_content = Vec::new(); + file.read_to_end(&mut file_content).unwrap(); + let mut expected = vec![0u8;8]; + expected.extend(vec![1;8]); + assert_eq!(file_content, expected); +} + +#[test] +fn test_pread() { + use std::io::Write; + + let tempdir = tempdir().unwrap(); + + let path = tempdir.path().join("pread_test_file"); + let mut file = OpenOptions::new().write(true).read(true).create(true) + .truncate(true).open(path).unwrap(); + let file_content: Vec = (0..64).collect(); + file.write_all(&file_content).unwrap(); + + let mut buf = [0u8;16]; + assert_eq!(Ok(16), pread(file.as_raw_fd(), &mut buf, 16)); + let expected: Vec<_> = (16..32).collect(); + assert_eq!(&buf[..], &expected[..]); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_pwritev() { + use std::io::Read; + + let to_write: Vec = (0..128).collect(); + let expected: Vec = [vec![0;100], to_write.clone()].concat(); + + let iovecs = [ + IoSlice::new(&to_write[0..17]), + IoSlice::new(&to_write[17..64]), + IoSlice::new(&to_write[64..128]), + ]; + + let tempdir = tempdir().unwrap(); + + // pwritev them into a temporary file + let path = tempdir.path().join("pwritev_test_file"); + let mut file = OpenOptions::new().write(true).read(true).create(true) + .truncate(true).open(path).unwrap(); + + let written = pwritev(file.as_raw_fd(), &iovecs, 100).ok().unwrap(); + assert_eq!(written, to_write.len()); + + // Read the data back and make sure it matches + let mut contents = Vec::new(); + file.read_to_end(&mut contents).unwrap(); + assert_eq!(contents, expected); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_preadv() { + use std::io::Write; + + let to_write: Vec = (0..200).collect(); + let expected: Vec = (100..200).collect(); + + let tempdir = tempdir().unwrap(); + + let path = tempdir.path().join("preadv_test_file"); + + let mut file = OpenOptions::new().read(true).write(true).create(true) + .truncate(true).open(path).unwrap(); + file.write_all(&to_write).unwrap(); + + let mut buffers: Vec> = vec![ + vec![0; 24], + vec![0; 1], + vec![0; 75], + ]; + + { + // Borrow the buffers into IoVecs and preadv into them + let mut iovecs: Vec<_> = buffers.iter_mut().map( + |buf| IoSliceMut::new(&mut buf[..])).collect(); + assert_eq!(Ok(100), preadv(file.as_raw_fd(), &mut iovecs, 100)); + } + + let all = buffers.concat(); + assert_eq!(all, expected); +} + +#[test] +#[cfg(all(target_os = "linux", not(target_env = "uclibc")))] // uclibc doesn't implement process_vm_readv +// qemu-user doesn't implement process_vm_readv/writev on most arches +#[cfg_attr(qemu, ignore)] +fn test_process_vm_readv() { + use nix::unistd::ForkResult::*; + use nix::sys::signal::*; + use nix::sys::wait::*; + use crate::*; + + require_capability!("test_process_vm_readv", CAP_SYS_PTRACE); + let _m = crate::FORK_MTX.lock(); + + // Pre-allocate memory in the child, since allocation isn't safe + // post-fork (~= async-signal-safe) + let mut vector = vec![1u8, 2, 3, 4, 5]; + + let (r, w) = pipe().unwrap(); + match unsafe{fork()}.expect("Error: Fork Failed") { + Parent { child } => { + close(w).unwrap(); + // wait for child + read(r, &mut [0u8]).unwrap(); + close(r).unwrap(); + + let ptr = vector.as_ptr() as usize; + let remote_iov = RemoteIoVec { base: ptr, len: 5 }; + let mut buf = vec![0u8; 5]; + + let ret = process_vm_readv(child, + &mut [IoSliceMut::new(&mut buf)], + &[remote_iov]); + + kill(child, SIGTERM).unwrap(); + waitpid(child, None).unwrap(); + + assert_eq!(Ok(5), ret); + assert_eq!(20u8, buf.iter().sum()); + }, + Child => { + let _ = close(r); + for i in &mut vector { + *i += 1; + } + let _ = write(w, b"\0"); + let _ = close(w); + loop { let _ = pause(); } + }, + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/sys/test_wait.rs b/bash-5.1/vendor/nix-0.24.2/test/sys/test_wait.rs new file mode 100644 index 0000000000000000000000000000000000000000..90d9fcf51c673b0f279c92faabd85878309bb807 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/sys/test_wait.rs @@ -0,0 +1,221 @@ +use nix::errno::Errno; +use nix::unistd::*; +use nix::unistd::ForkResult::*; +use nix::sys::signal::*; +use nix::sys::wait::*; +use libc::_exit; + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_wait_signal() { + let _m = crate::FORK_MTX.lock(); + + // Safe: The child only calls `pause` and/or `_exit`, which are async-signal-safe. + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + pause(); + unsafe { _exit(123) } + }, + Parent { child } => { + kill(child, Some(SIGKILL)).expect("Error: Kill Failed"); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Signaled(child, SIGKILL, false))); + }, + } +} + +#[test] +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), +))] +#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))] +fn test_waitid_signal() { + let _m = crate::FORK_MTX.lock(); + + // Safe: The child only calls `pause` and/or `_exit`, which are async-signal-safe. + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => { + pause(); + unsafe { _exit(123) } + }, + Parent { child } => { + kill(child, Some(SIGKILL)).expect("Error: Kill Failed"); + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::Signaled(child, SIGKILL, false)), + ); + }, + } +} + +#[test] +fn test_wait_exit() { + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is async-signal-safe. + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => unsafe { _exit(12); }, + Parent { child } => { + assert_eq!(waitpid(child, None), Ok(WaitStatus::Exited(child, 12))); + }, + } +} + +#[test] +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), +))] +#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))] +fn test_waitid_exit() { + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is async-signal-safe. + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => unsafe { _exit(12); }, + Parent { child } => { + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::Exited(child, 12)), + ); + } + } +} + +#[test] +fn test_waitstatus_from_raw() { + let pid = Pid::from_raw(1); + assert_eq!(WaitStatus::from_raw(pid, 0x0002), Ok(WaitStatus::Signaled(pid, Signal::SIGINT, false))); + assert_eq!(WaitStatus::from_raw(pid, 0x0200), Ok(WaitStatus::Exited(pid, 2))); + assert_eq!(WaitStatus::from_raw(pid, 0x7f7f), Err(Errno::EINVAL)); +} + +#[test] +fn test_waitstatus_pid() { + let _m = crate::FORK_MTX.lock(); + + match unsafe{fork()}.unwrap() { + Child => unsafe { _exit(0) }, + Parent { child } => { + let status = waitpid(child, None).unwrap(); + assert_eq!(status.pid(), Some(child)); + } + } +} + +#[test] +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), +))] +fn test_waitid_pid() { + let _m = crate::FORK_MTX.lock(); + + match unsafe { fork() }.unwrap() { + Child => unsafe { _exit(0) }, + Parent { child } => { + let status = waitid(Id::Pid(child), WaitPidFlag::WEXITED).unwrap(); + assert_eq!(status.pid(), Some(child)); + } + } +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +// FIXME: qemu-user doesn't implement ptrace on most arches +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +mod ptrace { + use nix::sys::ptrace::{self, Options, Event}; + use nix::sys::signal::*; + use nix::sys::wait::*; + use nix::unistd::*; + use nix::unistd::ForkResult::*; + use libc::_exit; + use crate::*; + + fn ptrace_child() -> ! { + ptrace::traceme().unwrap(); + // As recommended by ptrace(2), raise SIGTRAP to pause the child + // until the parent is ready to continue + raise(SIGTRAP).unwrap(); + unsafe { _exit(0) } + } + + fn ptrace_wait_parent(child: Pid) { + // Wait for the raised SIGTRAP + assert_eq!(waitpid(child, None), Ok(WaitStatus::Stopped(child, SIGTRAP))); + // We want to test a syscall stop and a PTRACE_EVENT stop + assert!(ptrace::setoptions(child, Options::PTRACE_O_TRACESYSGOOD | Options::PTRACE_O_TRACEEXIT).is_ok()); + + // First, stop on the next system call, which will be exit() + assert!(ptrace::syscall(child, None).is_ok()); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); + // Then get the ptrace event for the process exiting + assert!(ptrace::cont(child, None).is_ok()); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceEvent(child, SIGTRAP, Event::PTRACE_EVENT_EXIT as i32))); + // Finally get the normal wait() result, now that the process has exited + assert!(ptrace::cont(child, None).is_ok()); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Exited(child, 0))); + } + + #[cfg(not(target_env = "uclibc"))] + fn ptrace_waitid_parent(child: Pid) { + // Wait for the raised SIGTRAP + // + // Unlike waitpid(), waitid() can distinguish trap events from regular + // stop events, so unlike ptrace_wait_parent(), we get a PtraceEvent here + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::PtraceEvent(child, SIGTRAP, 0)), + ); + // We want to test a syscall stop and a PTRACE_EVENT stop + assert!(ptrace::setoptions(child, Options::PTRACE_O_TRACESYSGOOD | Options::PTRACE_O_TRACEEXIT).is_ok()); + + // First, stop on the next system call, which will be exit() + assert!(ptrace::syscall(child, None).is_ok()); + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::PtraceSyscall(child)), + ); + // Then get the ptrace event for the process exiting + assert!(ptrace::cont(child, None).is_ok()); + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::PtraceEvent(child, SIGTRAP, Event::PTRACE_EVENT_EXIT as i32)), + ); + // Finally get the normal wait() result, now that the process has exited + assert!(ptrace::cont(child, None).is_ok()); + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::Exited(child, 0)), + ); + } + + #[test] + fn test_wait_ptrace() { + require_capability!("test_wait_ptrace", CAP_SYS_PTRACE); + let _m = crate::FORK_MTX.lock(); + + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => ptrace_child(), + Parent { child } => ptrace_wait_parent(child), + } + } + + #[test] + #[cfg(not(target_env = "uclibc"))] + fn test_waitid_ptrace() { + require_capability!("test_waitid_ptrace", CAP_SYS_PTRACE); + let _m = crate::FORK_MTX.lock(); + + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => ptrace_child(), + Parent { child } => ptrace_waitid_parent(child), + } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test.rs b/bash-5.1/vendor/nix-0.24.2/test/test.rs new file mode 100644 index 0000000000000000000000000000000000000000..3cac48f77f5086625acdbeb988b741372701ce66 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test.rs @@ -0,0 +1,115 @@ +#[macro_use] +extern crate cfg_if; +#[cfg_attr(not(target_os = "redox"), macro_use)] +extern crate nix; +#[macro_use] +extern crate lazy_static; + +mod common; +mod sys; +#[cfg(not(target_os = "redox"))] +mod test_dir; +mod test_fcntl; +#[cfg(any(target_os = "android", + target_os = "linux"))] +mod test_kmod; +#[cfg(target_os = "freebsd")] +mod test_nmount; +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "fushsia", + target_os = "linux", + target_os = "netbsd"))] +mod test_mq; +#[cfg(not(target_os = "redox"))] +mod test_net; +mod test_nix_path; +mod test_resource; +mod test_poll; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod test_pty; +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "linux"))] +mod test_sched; +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] +mod test_sendfile; +mod test_stat; +mod test_time; +mod test_unistd; +#[cfg(all( + any( + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd" + ), + feature = "time", + feature = "signal" +))] +mod test_timer; + +use std::os::unix::io::RawFd; +use std::path::PathBuf; +use parking_lot::{Mutex, RwLock, RwLockWriteGuard}; +use nix::unistd::{chdir, getcwd, read}; + + +/// Helper function analogous to `std::io::Read::read_exact`, but for `RawFD`s +fn read_exact(f: RawFd, buf: &mut [u8]) { + let mut len = 0; + while len < buf.len() { + // get_mut would be better than split_at_mut, but it requires nightly + let (_, remaining) = buf.split_at_mut(len); + len += read(f, remaining).unwrap(); + } +} + +lazy_static! { + /// Any test that changes the process's current working directory must grab + /// the RwLock exclusively. Any process that cares about the current + /// working directory must grab it shared. + pub static ref CWD_LOCK: RwLock<()> = RwLock::new(()); + /// Any test that creates child processes must grab this mutex, regardless + /// of what it does with those children. + pub static ref FORK_MTX: Mutex<()> = Mutex::new(()); + /// Any test that changes the process's supplementary groups must grab this + /// mutex + pub static ref GROUPS_MTX: Mutex<()> = Mutex::new(()); + /// Any tests that loads or unloads kernel modules must grab this mutex + pub static ref KMOD_MTX: Mutex<()> = Mutex::new(()); + /// Any test that calls ptsname(3) must grab this mutex. + pub static ref PTSNAME_MTX: Mutex<()> = Mutex::new(()); + /// Any test that alters signal handling must grab this mutex. + pub static ref SIGNAL_MTX: Mutex<()> = Mutex::new(()); +} + +/// RAII object that restores a test's original directory on drop +struct DirRestore<'a> { + d: PathBuf, + _g: RwLockWriteGuard<'a, ()> +} + +impl<'a> DirRestore<'a> { + fn new() -> Self { + let guard = crate::CWD_LOCK.write(); + DirRestore{ + _g: guard, + d: getcwd().unwrap(), + } + } +} + +impl<'a> Drop for DirRestore<'a> { + fn drop(&mut self) { + let r = chdir(&self.d); + if std::thread::panicking() { + r.unwrap(); + } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_clearenv.rs b/bash-5.1/vendor/nix-0.24.2/test/test_clearenv.rs new file mode 100644 index 0000000000000000000000000000000000000000..28a77680498ca5cafc041aa011b20cc6216963ee --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_clearenv.rs @@ -0,0 +1,9 @@ +use std::env; + +#[test] +fn clearenv() { + env::set_var("FOO", "BAR"); + unsafe { nix::env::clearenv() }.unwrap(); + assert_eq!(env::var("FOO").unwrap_err(), env::VarError::NotPresent); + assert_eq!(env::vars().count(), 0); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_dir.rs b/bash-5.1/vendor/nix-0.24.2/test/test_dir.rs new file mode 100644 index 0000000000000000000000000000000000000000..2940b6eafb351b27da004a431972b41d9031966c --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_dir.rs @@ -0,0 +1,56 @@ +use nix::dir::{Dir, Type}; +use nix::fcntl::OFlag; +use nix::sys::stat::Mode; +use std::fs::File; +use tempfile::tempdir; + + +#[cfg(test)] +fn flags() -> OFlag { + #[cfg(target_os = "illumos")] + let f = OFlag::O_RDONLY | OFlag::O_CLOEXEC; + + #[cfg(not(target_os = "illumos"))] + let f = OFlag::O_RDONLY | OFlag::O_CLOEXEC | OFlag::O_DIRECTORY; + + f +} + +#[test] +#[allow(clippy::unnecessary_sort_by)] // False positive +fn read() { + let tmp = tempdir().unwrap(); + File::create(&tmp.path().join("foo")).unwrap(); + ::std::os::unix::fs::symlink("foo", tmp.path().join("bar")).unwrap(); + let mut dir = Dir::open(tmp.path(), flags(), Mode::empty()).unwrap(); + let mut entries: Vec<_> = dir.iter().map(|e| e.unwrap()).collect(); + entries.sort_by(|a, b| a.file_name().cmp(b.file_name())); + let entry_names: Vec<_> = entries + .iter() + .map(|e| e.file_name().to_str().unwrap().to_owned()) + .collect(); + assert_eq!(&entry_names[..], &[".", "..", "bar", "foo"]); + + // Check file types. The system is allowed to return DT_UNKNOWN (aka None here) but if it does + // return a type, ensure it's correct. + assert!(&[Some(Type::Directory), None].contains(&entries[0].file_type())); // .: dir + assert!(&[Some(Type::Directory), None].contains(&entries[1].file_type())); // ..: dir + assert!(&[Some(Type::Symlink), None].contains(&entries[2].file_type())); // bar: symlink + assert!(&[Some(Type::File), None].contains(&entries[3].file_type())); // foo: regular file +} + +#[test] +fn rewind() { + let tmp = tempdir().unwrap(); + let mut dir = Dir::open(tmp.path(), flags(), Mode::empty()).unwrap(); + let entries1: Vec<_> = dir.iter().map(|e| e.unwrap().file_name().to_owned()).collect(); + let entries2: Vec<_> = dir.iter().map(|e| e.unwrap().file_name().to_owned()).collect(); + let entries3: Vec<_> = dir.into_iter().map(|e| e.unwrap().file_name().to_owned()).collect(); + assert_eq!(entries1, entries2); + assert_eq!(entries2, entries3); +} + +#[test] +fn ebadf() { + assert_eq!(Dir::from_fd(-1).unwrap_err(), nix::Error::EBADF); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_fcntl.rs b/bash-5.1/vendor/nix-0.24.2/test/test_fcntl.rs new file mode 100644 index 0000000000000000000000000000000000000000..ebfc43e25fc254864ccbf7ba278129ede36d452b --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_fcntl.rs @@ -0,0 +1,545 @@ +#[cfg(not(target_os = "redox"))] +use nix::errno::*; +#[cfg(not(target_os = "redox"))] +use nix::fcntl::{open, OFlag, readlink}; +#[cfg(not(target_os = "redox"))] +use nix::fcntl::{openat, readlinkat, renameat}; +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +use nix::fcntl::{RenameFlags, renameat2}; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::Mode; +#[cfg(not(target_os = "redox"))] +use nix::unistd::{close, read}; +#[cfg(not(target_os = "redox"))] +use tempfile::{self, NamedTempFile}; +#[cfg(not(target_os = "redox"))] +use std::fs::File; +#[cfg(not(target_os = "redox"))] +use std::io::prelude::*; +#[cfg(not(target_os = "redox"))] +use std::os::unix::fs; + +#[test] +#[cfg(not(target_os = "redox"))] +// QEMU does not handle openat well enough to satisfy this test +// https://gitlab.com/qemu-project/qemu/-/issues/829 +#[cfg_attr(qemu, ignore)] +fn test_openat() { + const CONTENTS: &[u8] = b"abcd"; + let mut tmp = NamedTempFile::new().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let dirfd = open(tmp.path().parent().unwrap(), + OFlag::empty(), + Mode::empty()).unwrap(); + let fd = openat(dirfd, + tmp.path().file_name().unwrap(), + OFlag::O_RDONLY, + Mode::empty()).unwrap(); + + let mut buf = [0u8; 1024]; + assert_eq!(4, read(fd, &mut buf).unwrap()); + assert_eq!(CONTENTS, &buf[0..4]); + + close(fd).unwrap(); + close(dirfd).unwrap(); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_renameat() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + File::create(&old_path).unwrap(); + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap(); + assert_eq!(renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap_err(), + Errno::ENOENT); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); + assert!(new_dir.path().join("new").exists()); +} + +#[test] +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +fn test_renameat2_behaves_like_renameat_with_no_flags() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + File::create(&old_path).unwrap(); + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::empty(), + ) + .unwrap(); + assert_eq!( + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::empty() + ) + .unwrap_err(), + Errno::ENOENT + ); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); + assert!(new_dir.path().join("new").exists()); +} + +#[test] +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +fn test_renameat2_exchange() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + { + let mut old_f = File::create(&old_path).unwrap(); + old_f.write_all(b"old").unwrap(); + } + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let new_path = new_dir.path().join("new"); + { + let mut new_f = File::create(&new_path).unwrap(); + new_f.write_all(b"new").unwrap(); + } + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::RENAME_EXCHANGE, + ) + .unwrap(); + let mut buf = String::new(); + let mut new_f = File::open(&new_path).unwrap(); + new_f.read_to_string(&mut buf).unwrap(); + assert_eq!(buf, "old"); + buf = "".to_string(); + let mut old_f = File::open(&old_path).unwrap(); + old_f.read_to_string(&mut buf).unwrap(); + assert_eq!(buf, "new"); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); +} + +#[test] +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +fn test_renameat2_noreplace() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + File::create(&old_path).unwrap(); + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let new_path = new_dir.path().join("new"); + File::create(&new_path).unwrap(); + assert_eq!( + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::RENAME_NOREPLACE + ) + .unwrap_err(), + Errno::EEXIST + ); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); + assert!(new_dir.path().join("new").exists()); + assert!(old_dir.path().join("old").exists()); +} + + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_readlink() { + let tempdir = tempfile::tempdir().unwrap(); + let src = tempdir.path().join("a"); + let dst = tempdir.path().join("b"); + println!("a: {:?}, b: {:?}", &src, &dst); + fs::symlink(&src.as_path(), &dst.as_path()).unwrap(); + let dirfd = open(tempdir.path(), + OFlag::empty(), + Mode::empty()).unwrap(); + let expected_dir = src.to_str().unwrap(); + + assert_eq!(readlink(&dst).unwrap().to_str().unwrap(), expected_dir); + assert_eq!(readlinkat(dirfd, "b").unwrap().to_str().unwrap(), expected_dir); + +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod linux_android { + use std::io::prelude::*; + use std::io::{IoSlice, SeekFrom}; + use std::os::unix::prelude::*; + use libc::loff_t; + + use nix::fcntl::*; + use nix::unistd::{close, pipe, read, write}; + + use tempfile::tempfile; + #[cfg(any(target_os = "linux"))] + use tempfile::NamedTempFile; + + use crate::*; + + /// This test creates a temporary file containing the contents + /// 'foobarbaz' and uses the `copy_file_range` call to transfer + /// 3 bytes at offset 3 (`bar`) to another empty file at offset 0. The + /// resulting file is read and should contain the contents `bar`. + /// The from_offset should be updated by the call to reflect + /// the 3 bytes read (6). + #[test] + // QEMU does not support copy_file_range. Skip under qemu + #[cfg_attr(qemu, ignore)] + fn test_copy_file_range() { + const CONTENTS: &[u8] = b"foobarbaz"; + + let mut tmp1 = tempfile().unwrap(); + let mut tmp2 = tempfile().unwrap(); + + tmp1.write_all(CONTENTS).unwrap(); + tmp1.flush().unwrap(); + + let mut from_offset: i64 = 3; + copy_file_range( + tmp1.as_raw_fd(), + Some(&mut from_offset), + tmp2.as_raw_fd(), + None, + 3, + ) + .unwrap(); + + let mut res: String = String::new(); + tmp2.seek(SeekFrom::Start(0)).unwrap(); + tmp2.read_to_string(&mut res).unwrap(); + + assert_eq!(res, String::from("bar")); + assert_eq!(from_offset, 6); + } + + #[test] + fn test_splice() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let (rd, wr) = pipe().unwrap(); + let mut offset: loff_t = 5; + let res = splice(tmp.as_raw_fd(), Some(&mut offset), + wr, None, 2, SpliceFFlags::empty()).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + assert_eq!(2, read(rd, &mut buf).unwrap()); + assert_eq!(b"f1", &buf[0..2]); + assert_eq!(7, offset); + + close(rd).unwrap(); + close(wr).unwrap(); + } + + #[test] + fn test_tee() { + let (rd1, wr1) = pipe().unwrap(); + let (rd2, wr2) = pipe().unwrap(); + + write(wr1, b"abc").unwrap(); + let res = tee(rd1, wr2, 2, SpliceFFlags::empty()).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + + // Check the tee'd bytes are at rd2. + assert_eq!(2, read(rd2, &mut buf).unwrap()); + assert_eq!(b"ab", &buf[0..2]); + + // Check all the bytes are still at rd1. + assert_eq!(3, read(rd1, &mut buf).unwrap()); + assert_eq!(b"abc", &buf[0..3]); + + close(rd1).unwrap(); + close(wr1).unwrap(); + close(rd2).unwrap(); + close(wr2).unwrap(); + } + + #[test] + fn test_vmsplice() { + let (rd, wr) = pipe().unwrap(); + + let buf1 = b"abcdef"; + let buf2 = b"defghi"; + let iovecs = vec![ + IoSlice::new(&buf1[0..3]), + IoSlice::new(&buf2[0..3]) + ]; + + let res = vmsplice(wr, &iovecs[..], SpliceFFlags::empty()).unwrap(); + + assert_eq!(6, res); + + // Check the bytes can be read at rd. + let mut buf = [0u8; 32]; + assert_eq!(6, read(rd, &mut buf).unwrap()); + assert_eq!(b"abcdef", &buf[0..6]); + + close(rd).unwrap(); + close(wr).unwrap(); + } + + #[cfg(any(target_os = "linux"))] + #[test] + fn test_fallocate() { + let tmp = NamedTempFile::new().unwrap(); + + let fd = tmp.as_raw_fd(); + fallocate(fd, FallocateFlags::empty(), 0, 100).unwrap(); + + // Check if we read exactly 100 bytes + let mut buf = [0u8; 200]; + assert_eq!(100, read(fd, &mut buf).unwrap()); + } + + // The tests below are disabled for the listed targets + // due to OFD locks not being available in the kernel/libc + // versions used in the CI environment, probably because + // they run under QEMU. + + #[test] + #[cfg(all(target_os = "linux", not(target_env = "musl")))] + #[cfg_attr(target_env = "uclibc", ignore)] // uclibc doesn't support OFD locks, but the test should still compile + fn test_ofd_write_lock() { + use nix::sys::stat::fstat; + use std::mem; + + let tmp = NamedTempFile::new().unwrap(); + + let fd = tmp.as_raw_fd(); + let statfs = nix::sys::statfs::fstatfs(&tmp).unwrap(); + if statfs.filesystem_type() == nix::sys::statfs::OVERLAYFS_SUPER_MAGIC { + // OverlayFS is a union file system. It returns one inode value in + // stat(2), but a different one shows up in /proc/locks. So we must + // skip the test. + skip!("/proc/locks does not work on overlayfs"); + } + let inode = fstat(fd).expect("fstat failed").st_ino as usize; + + let mut flock: libc::flock = unsafe { + mem::zeroed() // required for Linux/mips + }; + flock.l_type = libc::F_WRLCK as libc::c_short; + flock.l_whence = libc::SEEK_SET as libc::c_short; + flock.l_start = 0; + flock.l_len = 0; + flock.l_pid = 0; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("write lock failed"); + assert_eq!( + Some(("OFDLCK".to_string(), "WRITE".to_string())), + lock_info(inode) + ); + + flock.l_type = libc::F_UNLCK as libc::c_short; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("write unlock failed"); + assert_eq!(None, lock_info(inode)); + } + + #[test] + #[cfg(all(target_os = "linux", not(target_env = "musl")))] + #[cfg_attr(target_env = "uclibc", ignore)] // uclibc doesn't support OFD locks, but the test should still compile + fn test_ofd_read_lock() { + use nix::sys::stat::fstat; + use std::mem; + + let tmp = NamedTempFile::new().unwrap(); + + let fd = tmp.as_raw_fd(); + let statfs = nix::sys::statfs::fstatfs(&tmp).unwrap(); + if statfs.filesystem_type() == nix::sys::statfs::OVERLAYFS_SUPER_MAGIC { + // OverlayFS is a union file system. It returns one inode value in + // stat(2), but a different one shows up in /proc/locks. So we must + // skip the test. + skip!("/proc/locks does not work on overlayfs"); + } + let inode = fstat(fd).expect("fstat failed").st_ino as usize; + + let mut flock: libc::flock = unsafe { + mem::zeroed() // required for Linux/mips + }; + flock.l_type = libc::F_RDLCK as libc::c_short; + flock.l_whence = libc::SEEK_SET as libc::c_short; + flock.l_start = 0; + flock.l_len = 0; + flock.l_pid = 0; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("read lock failed"); + assert_eq!( + Some(("OFDLCK".to_string(), "READ".to_string())), + lock_info(inode) + ); + + flock.l_type = libc::F_UNLCK as libc::c_short; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("read unlock failed"); + assert_eq!(None, lock_info(inode)); + } + + #[cfg(all(target_os = "linux", not(target_env = "musl")))] + fn lock_info(inode: usize) -> Option<(String, String)> { + use std::{ + fs::File, + io::BufReader + }; + + let file = File::open("/proc/locks").expect("open /proc/locks failed"); + let buf = BufReader::new(file); + + for line in buf.lines() { + let line = line.unwrap(); + let parts: Vec<_> = line.split_whitespace().collect(); + let lock_type = parts[1]; + let lock_access = parts[3]; + let ino_parts: Vec<_> = parts[5].split(':').collect(); + let ino: usize = ino_parts[2].parse().unwrap(); + if ino == inode { + return Some((lock_type.to_string(), lock_access.to_string())); + } + } + None + } +} + +#[cfg(any(target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_env = "uclibc", + target_os = "freebsd"))] +mod test_posix_fadvise { + + use tempfile::NamedTempFile; + use std::os::unix::io::{RawFd, AsRawFd}; + use nix::errno::Errno; + use nix::fcntl::*; + use nix::unistd::pipe; + + #[test] + fn test_success() { + let tmp = NamedTempFile::new().unwrap(); + let fd = tmp.as_raw_fd(); + let res = posix_fadvise(fd, 0, 100, PosixFadviseAdvice::POSIX_FADV_WILLNEED); + + assert!(res.is_ok()); + } + + #[test] + fn test_errno() { + let (rd, _wr) = pipe().unwrap(); + let res = posix_fadvise(rd as RawFd, 0, 100, PosixFadviseAdvice::POSIX_FADV_WILLNEED); + assert_eq!(res, Err(Errno::ESPIPE)); + } +} + +#[cfg(any(target_os = "linux", + target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "fuchsia", + any(target_os = "wasi", target_env = "wasi"), + target_os = "freebsd"))] +mod test_posix_fallocate { + + use tempfile::NamedTempFile; + use std::{io::Read, os::unix::io::{RawFd, AsRawFd}}; + use nix::errno::Errno; + use nix::fcntl::*; + use nix::unistd::pipe; + + #[test] + fn success() { + const LEN: usize = 100; + let mut tmp = NamedTempFile::new().unwrap(); + let fd = tmp.as_raw_fd(); + let res = posix_fallocate(fd, 0, LEN as libc::off_t); + match res { + Ok(_) => { + let mut data = [1u8; LEN]; + assert_eq!(tmp.read(&mut data).expect("read failure"), LEN); + assert_eq!(&data[..], &[0u8; LEN][..]); + } + Err(Errno::EINVAL) => { + // POSIX requires posix_fallocate to return EINVAL both for + // invalid arguments (i.e. len < 0) and if the operation is not + // supported by the file system. + // There's no way to tell for sure whether the file system + // supports posix_fallocate, so we must pass the test if it + // returns EINVAL. + } + _ => res.unwrap(), + } + } + + #[test] + fn errno() { + let (rd, _wr) = pipe().unwrap(); + let err = posix_fallocate(rd as RawFd, 0, 100).unwrap_err(); + match err { + Errno::EINVAL | Errno::ENODEV | Errno::ESPIPE | Errno::EBADF => (), + errno => + panic!( + "unexpected errno {}", + errno, + ), + } + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_kmod/hello_mod/Makefile b/bash-5.1/vendor/nix-0.24.2/test/test_kmod/hello_mod/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..74c99b77e96e1434c00eee89f44b0baa07951760 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_kmod/hello_mod/Makefile @@ -0,0 +1,7 @@ +obj-m += hello.o + +all: + make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules + +clean: + make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_kmod/hello_mod/hello.c b/bash-5.1/vendor/nix-0.24.2/test/test_kmod/hello_mod/hello.c new file mode 100644 index 0000000000000000000000000000000000000000..1c34987d2ac399af2a498233967a425119036f71 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_kmod/hello_mod/hello.c @@ -0,0 +1,26 @@ +/* + * SPDX-License-Identifier: GPL-2.0+ or MIT + */ +#include +#include + +static int number= 1; +static char *who = "World"; + +module_param(number, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +MODULE_PARM_DESC(myint, "Just some number"); +module_param(who, charp, 0000); +MODULE_PARM_DESC(who, "Whot to greet"); + +int init_module(void) +{ + printk(KERN_INFO "Hello %s (%d)!\n", who, number); + return 0; +} + +void cleanup_module(void) +{ + printk(KERN_INFO "Goodbye %s (%d)!\n", who, number); +} + +MODULE_LICENSE("Dual MIT/GPL"); diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_kmod/mod.rs b/bash-5.1/vendor/nix-0.24.2/test/test_kmod/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..8eef5384a36e258d4970f98a67ecb055448c6222 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_kmod/mod.rs @@ -0,0 +1,164 @@ +use std::fs::copy; +use std::path::PathBuf; +use std::process::Command; +use tempfile::{tempdir, TempDir}; +use crate::*; + +fn compile_kernel_module() -> (PathBuf, String, TempDir) { + let _m = crate::FORK_MTX.lock(); + + let tmp_dir = tempdir().expect("unable to create temporary build directory"); + + copy( + "test/test_kmod/hello_mod/hello.c", + &tmp_dir.path().join("hello.c"), + ).expect("unable to copy hello.c to temporary build directory"); + copy( + "test/test_kmod/hello_mod/Makefile", + &tmp_dir.path().join("Makefile"), + ).expect("unable to copy Makefile to temporary build directory"); + + let status = Command::new("make") + .current_dir(tmp_dir.path()) + .status() + .expect("failed to run make"); + + assert!(status.success()); + + // Return the relative path of the build kernel module + (tmp_dir.path().join("hello.ko"), "hello".to_owned(), tmp_dir) +} + +use nix::errno::Errno; +use nix::kmod::{delete_module, DeleteModuleFlags}; +use nix::kmod::{finit_module, init_module, ModuleInitFlags}; +use std::ffi::CString; +use std::fs::File; +use std::io::Read; + +#[test] +fn test_finit_and_delete_module() { + require_capability!("test_finit_and_delete_module", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let f = File::open(kmod_path).expect("unable to open kernel module"); + finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()) + .expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ).expect("unable to unload kernel module"); +} + +#[test] +fn test_finit_and_delete_module_with_params() { + require_capability!("test_finit_and_delete_module_with_params", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let f = File::open(kmod_path).expect("unable to open kernel module"); + finit_module( + &f, + &CString::new("who=Rust number=2018").unwrap(), + ModuleInitFlags::empty(), + ).expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ).expect("unable to unload kernel module"); +} + +#[test] +fn test_init_and_delete_module() { + require_capability!("test_init_and_delete_module", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let mut f = File::open(kmod_path).expect("unable to open kernel module"); + let mut contents: Vec = Vec::new(); + f.read_to_end(&mut contents) + .expect("unable to read kernel module content to buffer"); + init_module(&contents, &CString::new("").unwrap()).expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ).expect("unable to unload kernel module"); +} + +#[test] +fn test_init_and_delete_module_with_params() { + require_capability!("test_init_and_delete_module_with_params", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let mut f = File::open(kmod_path).expect("unable to open kernel module"); + let mut contents: Vec = Vec::new(); + f.read_to_end(&mut contents) + .expect("unable to read kernel module content to buffer"); + init_module(&contents, &CString::new("who=Nix number=2015").unwrap()) + .expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ).expect("unable to unload kernel module"); +} + +#[test] +fn test_finit_module_invalid() { + require_capability!("test_finit_module_invalid", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let kmod_path = "/dev/zero"; + + let f = File::open(kmod_path).expect("unable to open kernel module"); + let result = finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()); + + assert_eq!(result.unwrap_err(), Errno::EINVAL); +} + +#[test] +fn test_finit_module_twice_and_delete_module() { + require_capability!("test_finit_module_twice_and_delete_module", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let f = File::open(kmod_path).expect("unable to open kernel module"); + finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()) + .expect("unable to load kernel module"); + + let result = finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()); + + assert_eq!(result.unwrap_err(), Errno::EEXIST); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ).expect("unable to unload kernel module"); +} + +#[test] +fn test_delete_module_not_loaded() { + require_capability!("test_delete_module_not_loaded", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let result = delete_module(&CString::new("hello").unwrap(), DeleteModuleFlags::empty()); + + assert_eq!(result.unwrap_err(), Errno::ENOENT); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_mount.rs b/bash-5.1/vendor/nix-0.24.2/test/test_mount.rs new file mode 100644 index 0000000000000000000000000000000000000000..1ddfcfe932e02a234395e5b43111df70ed3fd939 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_mount.rs @@ -0,0 +1,236 @@ +mod common; + +// Implementation note: to allow unprivileged users to run it, this test makes +// use of user and mount namespaces. On systems that allow unprivileged user +// namespaces (Linux >= 3.8 compiled with CONFIG_USER_NS), the test should run +// without root. + +#[cfg(target_os = "linux")] +mod test_mount { + use std::fs::{self, File}; + use std::io::{self, Read, Write}; + use std::os::unix::fs::OpenOptionsExt; + use std::os::unix::fs::PermissionsExt; + use std::process::{self, Command}; + + use libc::{EACCES, EROFS}; + + use nix::errno::Errno; + use nix::mount::{mount, umount, MsFlags}; + use nix::sched::{unshare, CloneFlags}; + use nix::sys::stat::{self, Mode}; + use nix::unistd::getuid; + + static SCRIPT_CONTENTS: &[u8] = b"#!/bin/sh +exit 23"; + + const EXPECTED_STATUS: i32 = 23; + + const NONE: Option<&'static [u8]> = None; + #[allow(clippy::bind_instead_of_map)] // False positive + pub fn test_mount_tmpfs_without_flags_allows_rwx() { + let tempdir = tempfile::tempdir().unwrap(); + + mount(NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::empty(), + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + let test_path = tempdir.path().join("test"); + + // Verify write. + fs::OpenOptions::new() + .create(true) + .write(true) + .mode((Mode::S_IRWXU | Mode::S_IRWXG | Mode::S_IRWXO).bits()) + .open(&test_path) + .or_else(|e| + if Errno::from_i32(e.raw_os_error().unwrap()) == Errno::EOVERFLOW { + // Skip tests on certain Linux kernels which have a bug + // regarding tmpfs in namespaces. + // Ubuntu 14.04 and 16.04 are known to be affected; 16.10 is + // not. There is no legitimate reason for open(2) to return + // EOVERFLOW here. + // https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1659087 + let stderr = io::stderr(); + let mut handle = stderr.lock(); + writeln!(handle, "Buggy Linux kernel detected. Skipping test.") + .unwrap(); + process::exit(0); + } else { + panic!("open failed: {}", e); + } + ) + .and_then(|mut f| f.write(SCRIPT_CONTENTS)) + .unwrap_or_else(|e| panic!("write failed: {}", e)); + + // Verify read. + let mut buf = Vec::new(); + File::open(&test_path) + .and_then(|mut f| f.read_to_end(&mut buf)) + .unwrap_or_else(|e| panic!("read failed: {}", e)); + assert_eq!(buf, SCRIPT_CONTENTS); + + // Verify execute. + assert_eq!(EXPECTED_STATUS, + Command::new(&test_path) + .status() + .unwrap_or_else(|e| panic!("exec failed: {}", e)) + .code() + .unwrap_or_else(|| panic!("child killed by signal"))); + + umount(tempdir.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + pub fn test_mount_rdonly_disallows_write() { + let tempdir = tempfile::tempdir().unwrap(); + + mount(NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::MS_RDONLY, + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + // EROFS: Read-only file system + assert_eq!(EROFS as i32, + File::create(tempdir.path().join("test")).unwrap_err().raw_os_error().unwrap()); + + umount(tempdir.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + pub fn test_mount_noexec_disallows_exec() { + let tempdir = tempfile::tempdir().unwrap(); + + mount(NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::MS_NOEXEC, + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + let test_path = tempdir.path().join("test"); + + fs::OpenOptions::new() + .create(true) + .write(true) + .mode((Mode::S_IRWXU | Mode::S_IRWXG | Mode::S_IRWXO).bits()) + .open(&test_path) + .and_then(|mut f| f.write(SCRIPT_CONTENTS)) + .unwrap_or_else(|e| panic!("write failed: {}", e)); + + // Verify that we cannot execute despite a+x permissions being set. + let mode = stat::Mode::from_bits_truncate(fs::metadata(&test_path) + .map(|md| md.permissions().mode()) + .unwrap_or_else(|e| { + panic!("metadata failed: {}", e) + })); + + assert!(mode.contains(Mode::S_IXUSR | Mode::S_IXGRP | Mode::S_IXOTH), + "{:?} did not have execute permissions", + &test_path); + + // EACCES: Permission denied + assert_eq!(EACCES as i32, + Command::new(&test_path).status().unwrap_err().raw_os_error().unwrap()); + + umount(tempdir.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + pub fn test_mount_bind() { + let tempdir = tempfile::tempdir().unwrap(); + let file_name = "test"; + + { + let mount_point = tempfile::tempdir().unwrap(); + + mount(Some(tempdir.path()), + mount_point.path(), + NONE, + MsFlags::MS_BIND, + NONE) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + fs::OpenOptions::new() + .create(true) + .write(true) + .mode((Mode::S_IRWXU | Mode::S_IRWXG | Mode::S_IRWXO).bits()) + .open(mount_point.path().join(file_name)) + .and_then(|mut f| f.write(SCRIPT_CONTENTS)) + .unwrap_or_else(|e| panic!("write failed: {}", e)); + + umount(mount_point.path()).unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + // Verify the file written in the mount shows up in source directory, even + // after unmounting. + + let mut buf = Vec::new(); + File::open(tempdir.path().join(file_name)) + .and_then(|mut f| f.read_to_end(&mut buf)) + .unwrap_or_else(|e| panic!("read failed: {}", e)); + assert_eq!(buf, SCRIPT_CONTENTS); + } + + pub fn setup_namespaces() { + // Hold on to the uid in the parent namespace. + let uid = getuid(); + + unshare(CloneFlags::CLONE_NEWNS | CloneFlags::CLONE_NEWUSER).unwrap_or_else(|e| { + let stderr = io::stderr(); + let mut handle = stderr.lock(); + writeln!(handle, + "unshare failed: {}. Are unprivileged user namespaces available?", + e).unwrap(); + writeln!(handle, "mount is not being tested").unwrap(); + // Exit with success because not all systems support unprivileged user namespaces, and + // that's not what we're testing for. + process::exit(0); + }); + + // Map user as uid 1000. + fs::OpenOptions::new() + .write(true) + .open("/proc/self/uid_map") + .and_then(|mut f| f.write(format!("1000 {} 1\n", uid).as_bytes())) + .unwrap_or_else(|e| panic!("could not write uid map: {}", e)); + } +} + + +// Test runner + +/// Mimic normal test output (hackishly). +#[cfg(target_os = "linux")] +macro_rules! run_tests { + ( $($test_fn:ident),* ) => {{ + println!(); + + $( + print!("test test_mount::{} ... ", stringify!($test_fn)); + $test_fn(); + println!("ok"); + )* + + println!(); + }} +} + +#[cfg(target_os = "linux")] +fn main() { + use test_mount::{setup_namespaces, test_mount_tmpfs_without_flags_allows_rwx, + test_mount_rdonly_disallows_write, test_mount_noexec_disallows_exec, + test_mount_bind}; + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1351"); + setup_namespaces(); + + run_tests!(test_mount_tmpfs_without_flags_allows_rwx, + test_mount_rdonly_disallows_write, + test_mount_noexec_disallows_exec, + test_mount_bind); +} + +#[cfg(not(target_os = "linux"))] +fn main() {} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_mq.rs b/bash-5.1/vendor/nix-0.24.2/test/test_mq.rs new file mode 100644 index 0000000000000000000000000000000000000000..8aff840ddc57ae2989334916130eb34e1cc84f6f --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_mq.rs @@ -0,0 +1,187 @@ +use cfg_if::cfg_if; +use std::ffi::CString; +use std::str; + +use nix::errno::Errno; +use nix::mqueue::{mq_open, mq_close, mq_send, mq_receive, mq_attr_member_t}; +use nix::mqueue::{MqAttr, MQ_OFlag}; +use nix::sys::stat::Mode; + +// Defined as a macro such that the error source is reported as the caller's location. +macro_rules! assert_attr_eq { + ($read_attr:ident, $initial_attr:ident) => { + cfg_if! { + if #[cfg(any(target_os = "dragonfly", target_os = "netbsd"))] { + // NetBSD (and others which inherit its implementation) include other flags + // in read_attr, such as those specified by oflag. Just make sure at least + // the correct bits are set. + assert_eq!($read_attr.flags() & $initial_attr.flags(), $initial_attr.flags()); + assert_eq!($read_attr.maxmsg(), $initial_attr.maxmsg()); + assert_eq!($read_attr.msgsize(), $initial_attr.msgsize()); + assert_eq!($read_attr.curmsgs(), $initial_attr.curmsgs()); + } else { + assert_eq!($read_attr, $initial_attr); + } + } + } +} + +#[test] +fn test_mq_send_and_receive() { + const MSG_SIZE: mq_attr_member_t = 32; + let attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name= &CString::new(b"/a_nix_test_queue".as_ref()).unwrap(); + + let oflag0 = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r0 = mq_open(mq_name, oflag0, mode, Some(&attr)); + if let Err(Errno::ENOSYS) = r0 { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd0 = r0.unwrap(); + let msg_to_send = "msg_1"; + mq_send(&mqd0, msg_to_send.as_bytes(), 1).unwrap(); + + let oflag1 = MQ_OFlag::O_CREAT | MQ_OFlag::O_RDONLY; + let mqd1 = mq_open(mq_name, oflag1, mode, Some(&attr)).unwrap(); + let mut buf = [0u8; 32]; + let mut prio = 0u32; + let len = mq_receive(&mqd1, &mut buf, &mut prio).unwrap(); + assert_eq!(prio, 1); + + mq_close(mqd1).unwrap(); + mq_close(mqd0).unwrap(); + assert_eq!(msg_to_send, str::from_utf8(&buf[0..len]).unwrap()); +} + + +#[test] +fn test_mq_getattr() { + use nix::mqueue::mq_getattr; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + + let read_attr = mq_getattr(&mqd).unwrap(); + assert_attr_eq!(read_attr, initial_attr); + mq_close(mqd).unwrap(); +} + +// FIXME: Fix failures for mips in QEMU +#[test] +#[cfg_attr(all( + qemu, + any(target_arch = "mips", target_arch = "mips64") + ), ignore +)] +fn test_mq_setattr() { + use nix::mqueue::{mq_getattr, mq_setattr}; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + + let new_attr = MqAttr::new(0, 20, MSG_SIZE * 2, 100); + let old_attr = mq_setattr(&mqd, &new_attr).unwrap(); + assert_attr_eq!(old_attr, initial_attr); + + // No changes here because according to the Linux man page only + // O_NONBLOCK can be set (see tests below) + #[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))] + { + let new_attr_get = mq_getattr(&mqd).unwrap(); + assert_ne!(new_attr_get, new_attr); + } + + let new_attr_non_blocking = MqAttr::new(MQ_OFlag::O_NONBLOCK.bits() as mq_attr_member_t, 10, MSG_SIZE, 0); + mq_setattr(&mqd, &new_attr_non_blocking).unwrap(); + let new_attr_get = mq_getattr(&mqd).unwrap(); + + // now the O_NONBLOCK flag has been set + #[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))] + { + assert_ne!(new_attr_get, initial_attr); + } + assert_attr_eq!(new_attr_get, new_attr_non_blocking); + mq_close(mqd).unwrap(); +} + +// FIXME: Fix failures for mips in QEMU +#[test] +#[cfg_attr(all( + qemu, + any(target_arch = "mips", target_arch = "mips64") + ), ignore +)] +fn test_mq_set_nonblocking() { + use nix::mqueue::{mq_getattr, mq_set_nonblock, mq_remove_nonblock}; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + mq_set_nonblock(&mqd).unwrap(); + let new_attr = mq_getattr(&mqd); + let o_nonblock_bits = MQ_OFlag::O_NONBLOCK.bits() as mq_attr_member_t; + assert_eq!(new_attr.unwrap().flags() & o_nonblock_bits, o_nonblock_bits); + mq_remove_nonblock(&mqd).unwrap(); + let new_attr = mq_getattr(&mqd); + assert_eq!(new_attr.unwrap().flags() & o_nonblock_bits, 0); + mq_close(mqd).unwrap(); +} + +#[test] +fn test_mq_unlink() { + use nix::mqueue::mq_unlink; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name_opened = &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); + #[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))] + let mq_name_not_opened = &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name_opened, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + + let res_unlink = mq_unlink(mq_name_opened); + assert_eq!(res_unlink, Ok(()) ); + + // NetBSD (and others which inherit its implementation) defer removing the message + // queue name until all references are closed, whereas Linux and others remove the + // message queue name immediately. + #[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))] + { + let res_unlink_not_opened = mq_unlink(mq_name_not_opened); + assert_eq!(res_unlink_not_opened, Err(Errno::ENOENT) ); + } + + mq_close(mqd).unwrap(); + let res_unlink_after_close = mq_unlink(mq_name_opened); + assert_eq!(res_unlink_after_close, Err(Errno::ENOENT) ); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_net.rs b/bash-5.1/vendor/nix-0.24.2/test/test_net.rs new file mode 100644 index 0000000000000000000000000000000000000000..40ecd6bb754fae5eb0a55d650ec64f37dc93c3d7 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_net.rs @@ -0,0 +1,12 @@ +use nix::net::if_::*; + +#[cfg(any(target_os = "android", target_os = "linux"))] +const LOOPBACK: &[u8] = b"lo"; + +#[cfg(not(any(target_os = "android", target_os = "linux")))] +const LOOPBACK: &[u8] = b"lo0"; + +#[test] +fn test_if_nametoindex() { + assert!(if_nametoindex(LOOPBACK).is_ok()); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_nix_path.rs b/bash-5.1/vendor/nix-0.24.2/test/test_nix_path.rs new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_nmount.rs b/bash-5.1/vendor/nix-0.24.2/test/test_nmount.rs new file mode 100644 index 0000000000000000000000000000000000000000..4c74ecf627330c781efcd0d0ddd601abc626da01 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_nmount.rs @@ -0,0 +1,51 @@ +use crate::*; +use nix::{ + errno::Errno, + mount::{MntFlags, Nmount, unmount} +}; +use std::{ + ffi::CString, + fs::File, + path::Path +}; +use tempfile::tempdir; + +#[test] +fn ok() { + require_mount!("nullfs"); + + let mountpoint = tempdir().unwrap(); + let target = tempdir().unwrap(); + let _sentry = File::create(target.path().join("sentry")).unwrap(); + + let fstype = CString::new("fstype").unwrap(); + let nullfs = CString::new("nullfs").unwrap(); + Nmount::new() + .str_opt(&fstype, &nullfs) + .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) + .str_opt_owned("target", target.path().to_str().unwrap()) + .nmount(MntFlags::empty()).unwrap(); + + // Now check that the sentry is visible through the mountpoint + let exists = Path::exists(&mountpoint.path().join("sentry")); + + // Cleanup the mountpoint before asserting + unmount(mountpoint.path(), MntFlags::empty()).unwrap(); + + assert!(exists); +} + +#[test] +fn bad_fstype() { + let mountpoint = tempdir().unwrap(); + let target = tempdir().unwrap(); + let _sentry = File::create(target.path().join("sentry")).unwrap(); + + let e = Nmount::new() + .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) + .str_opt_owned("target", target.path().to_str().unwrap()) + .nmount(MntFlags::empty()).unwrap_err(); + + assert_eq!(e.error(), Errno::EINVAL); + assert_eq!(e.errmsg(), Some("Invalid fstype")); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_poll.rs b/bash-5.1/vendor/nix-0.24.2/test/test_poll.rs new file mode 100644 index 0000000000000000000000000000000000000000..e4b369f3f2a0201aa984624e0831bae85a5d5268 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_poll.rs @@ -0,0 +1,82 @@ +use nix::{ + errno::Errno, + poll::{PollFlags, poll, PollFd}, + unistd::{write, pipe} +}; + +macro_rules! loop_while_eintr { + ($poll_expr: expr) => { + loop { + match $poll_expr { + Ok(nfds) => break nfds, + Err(Errno::EINTR) => (), + Err(e) => panic!("{}", e) + } + } + } +} + +#[test] +fn test_poll() { + let (r, w) = pipe().unwrap(); + let mut fds = [PollFd::new(r, PollFlags::POLLIN)]; + + // Poll an idle pipe. Should timeout + let nfds = loop_while_eintr!(poll(&mut fds, 100)); + assert_eq!(nfds, 0); + assert!(!fds[0].revents().unwrap().contains(PollFlags::POLLIN)); + + write(w, b".").unwrap(); + + // Poll a readable pipe. Should return an event. + let nfds = poll(&mut fds, 100).unwrap(); + assert_eq!(nfds, 1); + assert!(fds[0].revents().unwrap().contains(PollFlags::POLLIN)); +} + +// ppoll(2) is the same as poll except for how it handles timeouts and signals. +// Repeating the test for poll(2) should be sufficient to check that our +// bindings are correct. +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux"))] +#[test] +fn test_ppoll() { + use nix::poll::ppoll; + use nix::sys::signal::SigSet; + use nix::sys::time::{TimeSpec, TimeValLike}; + + let timeout = TimeSpec::milliseconds(1); + let (r, w) = pipe().unwrap(); + let mut fds = [PollFd::new(r, PollFlags::POLLIN)]; + + // Poll an idle pipe. Should timeout + let sigset = SigSet::empty(); + let nfds = loop_while_eintr!(ppoll(&mut fds, Some(timeout), sigset)); + assert_eq!(nfds, 0); + assert!(!fds[0].revents().unwrap().contains(PollFlags::POLLIN)); + + write(w, b".").unwrap(); + + // Poll a readable pipe. Should return an event. + let nfds = ppoll(&mut fds, Some(timeout), SigSet::empty()).unwrap(); + assert_eq!(nfds, 1); + assert!(fds[0].revents().unwrap().contains(PollFlags::POLLIN)); +} + +#[test] +fn test_pollfd_fd() { + use std::os::unix::io::AsRawFd; + + let pfd = PollFd::new(0x1234, PollFlags::empty()); + assert_eq!(pfd.as_raw_fd(), 0x1234); +} + +#[test] +fn test_pollfd_events() { + let mut pfd = PollFd::new(-1, PollFlags::POLLIN); + assert_eq!(pfd.events(), PollFlags::POLLIN); + pfd.set_events(PollFlags::POLLOUT); + assert_eq!(pfd.events(), PollFlags::POLLOUT); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_pty.rs b/bash-5.1/vendor/nix-0.24.2/test/test_pty.rs new file mode 100644 index 0000000000000000000000000000000000000000..1a7cab81a041c734b76c3e2234cbb6013a739656 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_pty.rs @@ -0,0 +1,311 @@ +use std::fs::File; +use std::io::{Read, Write}; +use std::path::Path; +use std::os::unix::prelude::*; +use tempfile::tempfile; + +use libc::{_exit, STDOUT_FILENO}; +use nix::fcntl::{OFlag, open}; +use nix::pty::*; +use nix::sys::stat; +use nix::sys::termios::*; +use nix::unistd::{write, close, pause}; + +/// Regression test for Issue #659 +/// This is the correct way to explicitly close a `PtyMaster` +#[test] +fn test_explicit_close() { + let mut f = { + let m = posix_openpt(OFlag::O_RDWR).unwrap(); + close(m.into_raw_fd()).unwrap(); + tempfile().unwrap() + }; + // This should work. But if there's been a double close, then it will + // return EBADF + f.write_all(b"whatever").unwrap(); +} + +/// Test equivalence of `ptsname` and `ptsname_r` +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_equivalence() { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name = unsafe { ptsname(&master_fd) }.unwrap() ; + let slave_name_r = ptsname_r(&master_fd).unwrap(); + assert_eq!(slave_name, slave_name_r); +} + +/// Test data copying of `ptsname` +// TODO need to run in a subprocess, since ptsname is non-reentrant +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_copy() { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name1 = unsafe { ptsname(&master_fd) }.unwrap(); + let slave_name2 = unsafe { ptsname(&master_fd) }.unwrap(); + assert_eq!(slave_name1, slave_name2); + // Also make sure that the string was actually copied and they point to different parts of + // memory. + assert!(slave_name1.as_ptr() != slave_name2.as_ptr()); +} + +/// Test data copying of `ptsname_r` +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_r_copy() { + // Open a new PTTY master + let master_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name1 = ptsname_r(&master_fd).unwrap(); + let slave_name2 = ptsname_r(&master_fd).unwrap(); + assert_eq!(slave_name1, slave_name2); + assert!(slave_name1.as_ptr() != slave_name2.as_ptr()); +} + +/// Test that `ptsname` returns different names for different devices +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_unique() { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master1_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master1_fd.as_raw_fd() > 0); + + // Open a second PTTY master + let master2_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master2_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name1 = unsafe { ptsname(&master1_fd) }.unwrap(); + let slave_name2 = unsafe { ptsname(&master2_fd) }.unwrap(); + assert!(slave_name1 != slave_name2); +} + +/// Common setup for testing PTTY pairs +fn open_ptty_pair() -> (PtyMaster, File) { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master = posix_openpt(OFlag::O_RDWR).expect("posix_openpt failed"); + + // Allow a slave to be generated for it + grantpt(&master).expect("grantpt failed"); + unlockpt(&master).expect("unlockpt failed"); + + // Get the name of the slave + let slave_name = unsafe { ptsname(&master) }.expect("ptsname failed"); + + // Open the slave device + let slave_fd = open(Path::new(&slave_name), OFlag::O_RDWR, stat::Mode::empty()).unwrap(); + + #[cfg(target_os = "illumos")] + // TODO: rewrite using ioctl! + #[allow(clippy::comparison_chain)] + { + use libc::{ioctl, I_FIND, I_PUSH}; + + // On illumos systems, as per pts(7D), one must push STREAMS modules + // after opening a device path returned from ptsname(). + let ptem = b"ptem\0"; + let ldterm = b"ldterm\0"; + let r = unsafe { ioctl(slave_fd, I_FIND, ldterm.as_ptr()) }; + if r < 0 { + panic!("I_FIND failure"); + } else if r == 0 { + if unsafe { ioctl(slave_fd, I_PUSH, ptem.as_ptr()) } < 0 { + panic!("I_PUSH ptem failure"); + } + if unsafe { ioctl(slave_fd, I_PUSH, ldterm.as_ptr()) } < 0 { + panic!("I_PUSH ldterm failure"); + } + } + } + + let slave = unsafe { File::from_raw_fd(slave_fd) }; + + (master, slave) +} + +/// Test opening a master/slave PTTY pair +/// +/// This uses a common `open_ptty_pair` because much of these functions aren't useful by +/// themselves. So for this test we perform the basic act of getting a file handle for a +/// master/slave PTTY pair, then just sanity-check the raw values. +#[test] +fn test_open_ptty_pair() { + let (master, slave) = open_ptty_pair(); + assert!(master.as_raw_fd() > 0); + assert!(slave.as_raw_fd() > 0); +} + +/// Put the terminal in raw mode. +fn make_raw(fd: RawFd) { + let mut termios = tcgetattr(fd).unwrap(); + cfmakeraw(&mut termios); + tcsetattr(fd, SetArg::TCSANOW, &termios).unwrap(); +} + +/// Test `io::Read` on the PTTY master +#[test] +fn test_read_ptty_pair() { + let (mut master, mut slave) = open_ptty_pair(); + make_raw(slave.as_raw_fd()); + + let mut buf = [0u8; 5]; + slave.write_all(b"hello").unwrap(); + master.read_exact(&mut buf).unwrap(); + assert_eq!(&buf, b"hello"); + + let mut master = &master; + slave.write_all(b"hello").unwrap(); + master.read_exact(&mut buf).unwrap(); + assert_eq!(&buf, b"hello"); +} + +/// Test `io::Write` on the PTTY master +#[test] +fn test_write_ptty_pair() { + let (mut master, mut slave) = open_ptty_pair(); + make_raw(slave.as_raw_fd()); + + let mut buf = [0u8; 5]; + master.write_all(b"adios").unwrap(); + slave.read_exact(&mut buf).unwrap(); + assert_eq!(&buf, b"adios"); + + let mut master = &master; + master.write_all(b"adios").unwrap(); + slave.read_exact(&mut buf).unwrap(); + assert_eq!(&buf, b"adios"); +} + +#[test] +fn test_openpty() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + let pty = openpty(None, None).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Writing to one should be readable on the other one + let string = "foofoofoo\n"; + let mut buf = [0u8; 10]; + write(pty.master, string.as_bytes()).unwrap(); + crate::read_exact(pty.slave, &mut buf); + + assert_eq!(&buf, string.as_bytes()); + + // Read the echo as well + let echoed_string = "foofoofoo\r\n"; + let mut buf = [0u8; 11]; + crate::read_exact(pty.master, &mut buf); + assert_eq!(&buf, echoed_string.as_bytes()); + + let string2 = "barbarbarbar\n"; + let echoed_string2 = "barbarbarbar\r\n"; + let mut buf = [0u8; 14]; + write(pty.slave, string2.as_bytes()).unwrap(); + crate::read_exact(pty.master, &mut buf); + + assert_eq!(&buf, echoed_string2.as_bytes()); + + close(pty.master).unwrap(); + close(pty.slave).unwrap(); +} + +#[test] +fn test_openpty_with_termios() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + // Open one pty to get attributes for the second one + let mut termios = { + let pty = openpty(None, None).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + let termios = tcgetattr(pty.slave).unwrap(); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + termios + }; + // Make sure newlines are not transformed so the data is preserved when sent. + termios.output_flags.remove(OutputFlags::ONLCR); + + let pty = openpty(None, &termios).unwrap(); + // Must be valid file descriptors + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Writing to one should be readable on the other one + let string = "foofoofoo\n"; + let mut buf = [0u8; 10]; + write(pty.master, string.as_bytes()).unwrap(); + crate::read_exact(pty.slave, &mut buf); + + assert_eq!(&buf, string.as_bytes()); + + // read the echo as well + let echoed_string = "foofoofoo\n"; + crate::read_exact(pty.master, &mut buf); + assert_eq!(&buf, echoed_string.as_bytes()); + + let string2 = "barbarbarbar\n"; + let echoed_string2 = "barbarbarbar\n"; + let mut buf = [0u8; 13]; + write(pty.slave, string2.as_bytes()).unwrap(); + crate::read_exact(pty.master, &mut buf); + + assert_eq!(&buf, echoed_string2.as_bytes()); + + close(pty.master).unwrap(); + close(pty.slave).unwrap(); +} + +#[test] +fn test_forkpty() { + use nix::unistd::ForkResult::*; + use nix::sys::signal::*; + use nix::sys::wait::wait; + // forkpty calls openpty which uses ptname(3) internally. + let _m0 = crate::PTSNAME_MTX.lock(); + // forkpty spawns a child process + let _m1 = crate::FORK_MTX.lock(); + + let string = "naninani\n"; + let echoed_string = "naninani\r\n"; + let pty = unsafe { + forkpty(None, None).unwrap() + }; + match pty.fork_result { + Child => { + write(STDOUT_FILENO, string.as_bytes()).unwrap(); + pause(); // we need the child to stay alive until the parent calls read + unsafe { _exit(0); } + }, + Parent { child } => { + let mut buf = [0u8; 10]; + assert!(child.as_raw() > 0); + crate::read_exact(pty.master, &mut buf); + kill(child, SIGTERM).unwrap(); + wait().unwrap(); // keep other tests using generic wait from getting our child + assert_eq!(&buf, echoed_string.as_bytes()); + close(pty.master).unwrap(); + }, + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_ptymaster_drop.rs b/bash-5.1/vendor/nix-0.24.2/test/test_ptymaster_drop.rs new file mode 100644 index 0000000000000000000000000000000000000000..a68f81ee1e24f59c387587c389d4a33245da34ca --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_ptymaster_drop.rs @@ -0,0 +1,20 @@ +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod t { + use nix::fcntl::OFlag; + use nix::pty::*; + use nix::unistd::close; + use std::os::unix::io::AsRawFd; + + /// Regression test for Issue #659 + /// + /// `PtyMaster` should panic rather than double close the file descriptor + /// This must run in its own test process because it deliberately creates a + /// race condition. + #[test] + #[should_panic(expected = "Closing an invalid file descriptor!")] + fn test_double_close() { + let m = posix_openpt(OFlag::O_RDWR).unwrap(); + close(m.as_raw_fd()).unwrap(); + drop(m); // should panic here + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_resource.rs b/bash-5.1/vendor/nix-0.24.2/test/test_resource.rs new file mode 100644 index 0000000000000000000000000000000000000000..c89d601e278970dca93a7851cfb8679f4d9ece59 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_resource.rs @@ -0,0 +1,23 @@ +#[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "illumos")))] +use nix::sys::resource::{getrlimit, setrlimit, Resource}; + +/// Tests the RLIMIT_NOFILE functionality of getrlimit(), where the resource RLIMIT_NOFILE refers +/// to the maximum file descriptor number that can be opened by the process (aka the maximum number +/// of file descriptors that the process can open, since Linux 4.5). +/// +/// We first fetch the existing file descriptor maximum values using getrlimit(), then edit the +/// soft limit to make sure it has a new and distinct value to the hard limit. We then setrlimit() +/// to put the new soft limit in effect, and then getrlimit() once more to ensure the limits have +/// been updated. +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "illumos")))] +pub fn test_resource_limits_nofile() { + let (mut soft_limit, hard_limit) = getrlimit(Resource::RLIMIT_NOFILE).unwrap(); + + soft_limit -= 1; + assert_ne!(soft_limit, hard_limit); + setrlimit(Resource::RLIMIT_NOFILE, soft_limit, hard_limit).unwrap(); + + let (new_soft_limit, _) = getrlimit(Resource::RLIMIT_NOFILE).unwrap(); + assert_eq!(new_soft_limit, soft_limit); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_sched.rs b/bash-5.1/vendor/nix-0.24.2/test/test_sched.rs new file mode 100644 index 0000000000000000000000000000000000000000..922196a3dba73b96a97b32e9227f1103b3b6ed09 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_sched.rs @@ -0,0 +1,32 @@ +use nix::sched::{sched_getaffinity, sched_setaffinity, CpuSet}; +use nix::unistd::Pid; + +#[test] +fn test_sched_affinity() { + // If pid is zero, then the mask of the calling process is returned. + let initial_affinity = sched_getaffinity(Pid::from_raw(0)).unwrap(); + let mut at_least_one_cpu = false; + let mut last_valid_cpu = 0; + for field in 0..CpuSet::count() { + if initial_affinity.is_set(field).unwrap() { + at_least_one_cpu = true; + last_valid_cpu = field; + } + } + assert!(at_least_one_cpu); + + // Now restrict the running CPU + let mut new_affinity = CpuSet::new(); + new_affinity.set(last_valid_cpu).unwrap(); + sched_setaffinity(Pid::from_raw(0), &new_affinity).unwrap(); + + // And now re-check the affinity which should be only the one we set. + let updated_affinity = sched_getaffinity(Pid::from_raw(0)).unwrap(); + for field in 0..CpuSet::count() { + // Should be set only for the CPU we set previously + assert_eq!(updated_affinity.is_set(field).unwrap(), field==last_valid_cpu) + } + + // Finally, reset the initial CPU set + sched_setaffinity(Pid::from_raw(0), &initial_affinity).unwrap(); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_sendfile.rs b/bash-5.1/vendor/nix-0.24.2/test/test_sendfile.rs new file mode 100644 index 0000000000000000000000000000000000000000..e56ff12faf7623990fd8c8ed0064e79900a42e9c --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_sendfile.rs @@ -0,0 +1,196 @@ +use std::io::prelude::*; +use std::os::unix::prelude::*; + +use libc::off_t; +use nix::sys::sendfile::*; +use tempfile::tempfile; + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + use nix::unistd::{close, pipe, read}; + } else if #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos"))] { + use std::net::Shutdown; + use std::os::unix::net::UnixStream; + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +fn test_sendfile_linux() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let (rd, wr) = pipe().unwrap(); + let mut offset: off_t = 5; + let res = sendfile(wr, tmp.as_raw_fd(), Some(&mut offset), 2).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + assert_eq!(2, read(rd, &mut buf).unwrap()); + assert_eq!(b"f1", &buf[0..2]); + assert_eq!(7, offset); + + close(rd).unwrap(); + close(wr).unwrap(); +} + +#[cfg(target_os = "linux")] +#[test] +fn test_sendfile64_linux() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let (rd, wr) = pipe().unwrap(); + let mut offset: libc::off64_t = 5; + let res = sendfile64(wr, tmp.as_raw_fd(), Some(&mut offset), 2).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + assert_eq!(2, read(rd, &mut buf).unwrap()); + assert_eq!(b"f1", &buf[0..2]); + assert_eq!(7, offset); + + close(rd).unwrap(); + close(wr).unwrap(); +} + +#[cfg(target_os = "freebsd")] +#[test] +fn test_sendfile_freebsd() { + // Declare the content + let header_strings = vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let body = "Xabcdef123456"; + let body_offset = 1; + let trailer_strings = vec!["\n", "Served by Make Believe\n"]; + + // Write the body to a file + let mut tmp = tempfile().unwrap(); + tmp.write_all(body.as_bytes()).unwrap(); + + // Prepare headers and trailers for sendfile + let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); + + // Prepare socket pair + let (mut rd, wr) = UnixStream::pair().unwrap(); + + // Call the test method + let (res, bytes_written) = sendfile( + tmp.as_raw_fd(), + wr.as_raw_fd(), + body_offset as off_t, + None, + Some(headers.as_slice()), + Some(trailers.as_slice()), + SfFlags::empty(), + 0, + ); + assert!(res.is_ok()); + wr.shutdown(Shutdown::Both).unwrap(); + + // Prepare the expected result + let expected_string = + header_strings.concat() + &body[body_offset..] + &trailer_strings.concat(); + + // Verify the message that was sent + assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); + + let mut read_string = String::new(); + let bytes_read = rd.read_to_string(&mut read_string).unwrap(); + assert_eq!(bytes_written as usize, bytes_read); + assert_eq!(expected_string, read_string); +} + +#[cfg(target_os = "dragonfly")] +#[test] +fn test_sendfile_dragonfly() { + // Declare the content + let header_strings = vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let body = "Xabcdef123456"; + let body_offset = 1; + let trailer_strings = vec!["\n", "Served by Make Believe\n"]; + + // Write the body to a file + let mut tmp = tempfile().unwrap(); + tmp.write_all(body.as_bytes()).unwrap(); + + // Prepare headers and trailers for sendfile + let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); + + // Prepare socket pair + let (mut rd, wr) = UnixStream::pair().unwrap(); + + // Call the test method + let (res, bytes_written) = sendfile( + tmp.as_raw_fd(), + wr.as_raw_fd(), + body_offset as off_t, + None, + Some(headers.as_slice()), + Some(trailers.as_slice()), + ); + assert!(res.is_ok()); + wr.shutdown(Shutdown::Both).unwrap(); + + // Prepare the expected result + let expected_string = + header_strings.concat() + &body[body_offset..] + &trailer_strings.concat(); + + // Verify the message that was sent + assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); + + let mut read_string = String::new(); + let bytes_read = rd.read_to_string(&mut read_string).unwrap(); + assert_eq!(bytes_written as usize, bytes_read); + assert_eq!(expected_string, read_string); +} + +#[cfg(any(target_os = "ios", target_os = "macos"))] +#[test] +fn test_sendfile_darwin() { + // Declare the content + let header_strings = vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let body = "Xabcdef123456"; + let body_offset = 1; + let trailer_strings = vec!["\n", "Served by Make Believe\n"]; + + // Write the body to a file + let mut tmp = tempfile().unwrap(); + tmp.write_all(body.as_bytes()).unwrap(); + + // Prepare headers and trailers for sendfile + let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); + + // Prepare socket pair + let (mut rd, wr) = UnixStream::pair().unwrap(); + + // Call the test method + let (res, bytes_written) = sendfile( + tmp.as_raw_fd(), + wr.as_raw_fd(), + body_offset as off_t, + None, + Some(headers.as_slice()), + Some(trailers.as_slice()), + ); + assert!(res.is_ok()); + wr.shutdown(Shutdown::Both).unwrap(); + + // Prepare the expected result + let expected_string = + header_strings.concat() + &body[body_offset..] + &trailer_strings.concat(); + + // Verify the message that was sent + assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); + + let mut read_string = String::new(); + let bytes_read = rd.read_to_string(&mut read_string).unwrap(); + assert_eq!(bytes_written as usize, bytes_read); + assert_eq!(expected_string, read_string); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_stat.rs b/bash-5.1/vendor/nix-0.24.2/test/test_stat.rs new file mode 100644 index 0000000000000000000000000000000000000000..8baa6555b690b16b6db637ee5f1617f588271e71 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_stat.rs @@ -0,0 +1,360 @@ +#[cfg(not(target_os = "redox"))] +use std::fs; +use std::fs::File; +#[cfg(not(target_os = "redox"))] +use std::os::unix::fs::{symlink, PermissionsExt}; +use std::os::unix::prelude::AsRawFd; +#[cfg(not(target_os = "redox"))] +use std::time::{Duration, UNIX_EPOCH}; +#[cfg(not(target_os = "redox"))] +use std::path::Path; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +use libc::{S_IFMT, S_IFLNK}; +use libc::mode_t; + +#[cfg(not(target_os = "redox"))] +use nix::fcntl; +#[cfg(not(target_os = "redox"))] +use nix::errno::Errno; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::{self, futimens, utimes}; +use nix::sys::stat::{fchmod, stat}; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::{fchmodat, utimensat, mkdirat}; +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] +use nix::sys::stat::lutimes; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::{FchmodatFlags, UtimensatFlags}; +use nix::sys::stat::Mode; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +use nix::sys::stat::FileStat; + +#[cfg(not(target_os = "redox"))] +use nix::sys::time::{TimeSpec, TimeVal, TimeValLike}; +#[cfg(not(target_os = "redox"))] +use nix::unistd::chdir; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +use nix::Result; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn assert_stat_results(stat_result: Result) { + let stats = stat_result.expect("stat call failed"); + assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_ino > 0); // inode is positive integer, exact number machine dependent + assert!(stats.st_mode > 0); // must be positive integer + assert_eq!(stats.st_nlink, 1); // there links created, must be 1 + assert_eq!(stats.st_size, 0); // size is 0 because we did not write anything to the file + assert!(stats.st_blksize > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_blocks <= 16); // Up to 16 blocks can be allocated for a blank file +} + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +// (Android's st_blocks is ulonglong which is always non-negative.) +#[cfg_attr(target_os = "android", allow(unused_comparisons))] +#[allow(clippy::absurd_extreme_comparisons)] // Not absurd on all OSes +fn assert_lstat_results(stat_result: Result) { + let stats = stat_result.expect("stat call failed"); + assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_ino > 0); // inode is positive integer, exact number machine dependent + assert!(stats.st_mode > 0); // must be positive integer + + // st_mode is c_uint (u32 on Android) while S_IFMT is mode_t + // (u16 on Android), and that will be a compile error. + // On other platforms they are the same (either both are u16 or u32). + assert_eq!((stats.st_mode as usize) & (S_IFMT as usize), S_IFLNK as usize); // should be a link + assert_eq!(stats.st_nlink, 1); // there links created, must be 1 + assert!(stats.st_size > 0); // size is > 0 because it points to another file + assert!(stats.st_blksize > 0); // must be positive integer, exact number machine dependent + + // st_blocks depends on whether the machine's file system uses fast + // or slow symlinks, so just make sure it's not negative + assert!(stats.st_blocks >= 0); +} + +#[test] +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn test_stat_and_fstat() { + use nix::sys::stat::fstat; + + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("foo.txt"); + let file = File::create(&filename).unwrap(); + + let stat_result = stat(&filename); + assert_stat_results(stat_result); + + let fstat_result = fstat(file.as_raw_fd()); + assert_stat_results(fstat_result); +} + +#[test] +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn test_fstatat() { + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("foo.txt"); + File::create(&filename).unwrap(); + let dirfd = fcntl::open(tempdir.path(), + fcntl::OFlag::empty(), + stat::Mode::empty()); + + let result = stat::fstatat(dirfd.unwrap(), + &filename, + fcntl::AtFlags::empty()); + assert_stat_results(result); +} + +#[test] +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn test_stat_fstat_lstat() { + use nix::sys::stat::{fstat, lstat}; + + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("bar.txt"); + let linkname = tempdir.path().join("barlink"); + + File::create(&filename).unwrap(); + symlink("bar.txt", &linkname).unwrap(); + let link = File::open(&linkname).unwrap(); + + // should be the same result as calling stat, + // since it's a regular file + let stat_result = stat(&filename); + assert_stat_results(stat_result); + + let lstat_result = lstat(&linkname); + assert_lstat_results(lstat_result); + + let fstat_result = fstat(link.as_raw_fd()); + assert_stat_results(fstat_result); +} + +#[test] +fn test_fchmod() { + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("foo.txt"); + let file = File::create(&filename).unwrap(); + + let mut mode1 = Mode::empty(); + mode1.insert(Mode::S_IRUSR); + mode1.insert(Mode::S_IWUSR); + fchmod(file.as_raw_fd(), mode1).unwrap(); + + let file_stat1 = stat(&filename).unwrap(); + assert_eq!(file_stat1.st_mode as mode_t & 0o7777, mode1.bits()); + + let mut mode2 = Mode::empty(); + mode2.insert(Mode::S_IROTH); + fchmod(file.as_raw_fd(), mode2).unwrap(); + + let file_stat2 = stat(&filename).unwrap(); + assert_eq!(file_stat2.st_mode as mode_t & 0o7777, mode2.bits()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_fchmodat() { + let _dr = crate::DirRestore::new(); + let tempdir = tempfile::tempdir().unwrap(); + let filename = "foo.txt"; + let fullpath = tempdir.path().join(filename); + File::create(&fullpath).unwrap(); + + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + let mut mode1 = Mode::empty(); + mode1.insert(Mode::S_IRUSR); + mode1.insert(Mode::S_IWUSR); + fchmodat(Some(dirfd), filename, mode1, FchmodatFlags::FollowSymlink).unwrap(); + + let file_stat1 = stat(&fullpath).unwrap(); + assert_eq!(file_stat1.st_mode as mode_t & 0o7777, mode1.bits()); + + chdir(tempdir.path()).unwrap(); + + let mut mode2 = Mode::empty(); + mode2.insert(Mode::S_IROTH); + fchmodat(None, filename, mode2, FchmodatFlags::FollowSymlink).unwrap(); + + let file_stat2 = stat(&fullpath).unwrap(); + assert_eq!(file_stat2.st_mode as mode_t & 0o7777, mode2.bits()); +} + +/// Asserts that the atime and mtime in a file's metadata match expected values. +/// +/// The atime and mtime are expressed with a resolution of seconds because some file systems +/// (like macOS's HFS+) do not have higher granularity. +#[cfg(not(target_os = "redox"))] +fn assert_times_eq(exp_atime_sec: u64, exp_mtime_sec: u64, attr: &fs::Metadata) { + assert_eq!( + Duration::new(exp_atime_sec, 0), + attr.accessed().unwrap().duration_since(UNIX_EPOCH).unwrap()); + assert_eq!( + Duration::new(exp_mtime_sec, 0), + attr.modified().unwrap().duration_since(UNIX_EPOCH).unwrap()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_utimes() { + let tempdir = tempfile::tempdir().unwrap(); + let fullpath = tempdir.path().join("file"); + drop(File::create(&fullpath).unwrap()); + + utimes(&fullpath, &TimeVal::seconds(9990), &TimeVal::seconds(5550)).unwrap(); + assert_times_eq(9990, 5550, &fs::metadata(&fullpath).unwrap()); +} + +#[test] +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] +fn test_lutimes() { + let tempdir = tempfile::tempdir().unwrap(); + let target = tempdir.path().join("target"); + let fullpath = tempdir.path().join("symlink"); + drop(File::create(&target).unwrap()); + symlink(&target, &fullpath).unwrap(); + + let exp_target_metadata = fs::symlink_metadata(&target).unwrap(); + lutimes(&fullpath, &TimeVal::seconds(4560), &TimeVal::seconds(1230)).unwrap(); + assert_times_eq(4560, 1230, &fs::symlink_metadata(&fullpath).unwrap()); + + let target_metadata = fs::symlink_metadata(&target).unwrap(); + assert_eq!(exp_target_metadata.accessed().unwrap(), target_metadata.accessed().unwrap(), + "atime of symlink target was unexpectedly modified"); + assert_eq!(exp_target_metadata.modified().unwrap(), target_metadata.modified().unwrap(), + "mtime of symlink target was unexpectedly modified"); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_futimens() { + let tempdir = tempfile::tempdir().unwrap(); + let fullpath = tempdir.path().join("file"); + drop(File::create(&fullpath).unwrap()); + + let fd = fcntl::open(&fullpath, fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + futimens(fd, &TimeSpec::seconds(10), &TimeSpec::seconds(20)).unwrap(); + assert_times_eq(10, 20, &fs::metadata(&fullpath).unwrap()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_utimensat() { + let _dr = crate::DirRestore::new(); + let tempdir = tempfile::tempdir().unwrap(); + let filename = "foo.txt"; + let fullpath = tempdir.path().join(filename); + drop(File::create(&fullpath).unwrap()); + + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + utimensat(Some(dirfd), filename, &TimeSpec::seconds(12345), &TimeSpec::seconds(678), + UtimensatFlags::FollowSymlink).unwrap(); + assert_times_eq(12345, 678, &fs::metadata(&fullpath).unwrap()); + + chdir(tempdir.path()).unwrap(); + + utimensat(None, filename, &TimeSpec::seconds(500), &TimeSpec::seconds(800), + UtimensatFlags::FollowSymlink).unwrap(); + assert_times_eq(500, 800, &fs::metadata(&fullpath).unwrap()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkdirat_success_path() { + let tempdir = tempfile::tempdir().unwrap(); + let filename = "example_subdir"; + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + assert!((mkdirat(dirfd, filename, Mode::S_IRWXU)).is_ok()); + assert!(Path::exists(&tempdir.path().join(filename))); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkdirat_success_mode() { + let expected_bits = stat::SFlag::S_IFDIR.bits() | stat::Mode::S_IRWXU.bits(); + let tempdir = tempfile::tempdir().unwrap(); + let filename = "example_subdir"; + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + assert!((mkdirat(dirfd, filename, Mode::S_IRWXU)).is_ok()); + let permissions = fs::metadata(tempdir.path().join(filename)).unwrap().permissions(); + let mode = permissions.mode(); + assert_eq!(mode as mode_t, expected_bits) +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkdirat_fail() { + let tempdir = tempfile::tempdir().unwrap(); + let not_dir_filename= "example_not_dir"; + let filename = "example_subdir_dir"; + let dirfd = fcntl::open(&tempdir.path().join(not_dir_filename), fcntl::OFlag::O_CREAT, + stat::Mode::empty()).unwrap(); + let result = mkdirat(dirfd, filename, Mode::S_IRWXU).unwrap_err(); + assert_eq!(result, Errno::ENOTDIR); +} + +#[test] +#[cfg(not(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "redox")))] +fn test_mknod() { + use stat::{lstat, mknod, SFlag}; + + let file_name = "test_file"; + let tempdir = tempfile::tempdir().unwrap(); + let target = tempdir.path().join(file_name); + mknod(&target, SFlag::S_IFREG, Mode::S_IRWXU, 0).unwrap(); + let mode = lstat(&target).unwrap().st_mode as mode_t; + assert!(mode & libc::S_IFREG == libc::S_IFREG); + assert!(mode & libc::S_IRWXU == libc::S_IRWXU); +} + +#[test] +#[cfg(not(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "redox")))] +fn test_mknodat() { + use fcntl::{AtFlags, OFlag}; + use nix::dir::Dir; + use stat::{fstatat, mknodat, SFlag}; + + let file_name = "test_file"; + let tempdir = tempfile::tempdir().unwrap(); + let target_dir = Dir::open(tempdir.path(), OFlag::O_DIRECTORY, Mode::S_IRWXU).unwrap(); + mknodat( + target_dir.as_raw_fd(), + file_name, + SFlag::S_IFREG, + Mode::S_IRWXU, + 0, + ) + .unwrap(); + let mode = fstatat( + target_dir.as_raw_fd(), + file_name, + AtFlags::AT_SYMLINK_NOFOLLOW, + ) + .unwrap() + .st_mode as mode_t; + assert!(mode & libc::S_IFREG == libc::S_IFREG); + assert!(mode & libc::S_IRWXU == libc::S_IRWXU); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_time.rs b/bash-5.1/vendor/nix-0.24.2/test/test_time.rs new file mode 100644 index 0000000000000000000000000000000000000000..dc307e57b3abf44eef794a6224aeceb19c81ca92 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_time.rs @@ -0,0 +1,58 @@ +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +use nix::time::clock_getcpuclockid; +use nix::time::{clock_gettime, ClockId}; + +#[cfg(not(target_os = "redox"))] +#[test] +pub fn test_clock_getres() { + assert!(nix::time::clock_getres(ClockId::CLOCK_REALTIME).is_ok()); +} + +#[test] +pub fn test_clock_gettime() { + assert!(clock_gettime(ClockId::CLOCK_REALTIME).is_ok()); +} + +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +#[test] +pub fn test_clock_getcpuclockid() { + let clock_id = clock_getcpuclockid(nix::unistd::Pid::this()).unwrap(); + assert!(clock_gettime(clock_id).is_ok()); +} + +#[cfg(not(target_os = "redox"))] +#[test] +pub fn test_clock_id_res() { + assert!(ClockId::CLOCK_REALTIME.res().is_ok()); +} + +#[test] +pub fn test_clock_id_now() { + assert!(ClockId::CLOCK_REALTIME.now().is_ok()); +} + +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +#[test] +pub fn test_clock_id_pid_cpu_clock_id() { + assert!(ClockId::pid_cpu_clock_id(nix::unistd::Pid::this()) + .map(ClockId::now) + .is_ok()); +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_timer.rs b/bash-5.1/vendor/nix-0.24.2/test/test_timer.rs new file mode 100644 index 0000000000000000000000000000000000000000..d07d9633d0ab391bfb5b6428abec8cf7f0486c44 --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_timer.rs @@ -0,0 +1,99 @@ +use nix::sys::signal::{ + sigaction, SaFlags, SigAction, SigEvent, SigHandler, SigSet, SigevNotify, Signal, +}; +use nix::sys::timer::{Expiration, Timer, TimerSetTimeFlags}; +use nix::time::ClockId; +use std::convert::TryFrom; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::thread; +use std::time::{Duration, Instant}; + +const SIG: Signal = Signal::SIGALRM; +static ALARM_CALLED: AtomicBool = AtomicBool::new(false); + +pub extern "C" fn handle_sigalarm(raw_signal: libc::c_int) { + let signal = Signal::try_from(raw_signal).unwrap(); + if signal == SIG { + ALARM_CALLED.store(true, Ordering::Release); + } +} + +#[test] +fn alarm_fires() { + // Avoid interfering with other signal using tests by taking a mutex shared + // among other tests in this crate. + let _m = crate::SIGNAL_MTX.lock(); + const TIMER_PERIOD: Duration = Duration::from_millis(100); + + // + // Setup + // + + // Create a handler for the test signal, `SIG`. The handler is responsible + // for flipping `ALARM_CALLED`. + let handler = SigHandler::Handler(handle_sigalarm); + let signal_action = SigAction::new(handler, SaFlags::SA_RESTART, SigSet::empty()); + let old_handler = + unsafe { sigaction(SIG, &signal_action).expect("unable to set signal handler for alarm") }; + + // Create the timer. We use the monotonic clock here, though any would do + // really. The timer is set to fire every 250 milliseconds with no delay for + // the initial firing. + let clockid = ClockId::CLOCK_MONOTONIC; + let sigevent = SigEvent::new(SigevNotify::SigevSignal { + signal: SIG, + si_value: 0, + }); + let mut timer = Timer::new(clockid, sigevent).expect("failed to create timer"); + let expiration = Expiration::Interval(TIMER_PERIOD.into()); + let flags = TimerSetTimeFlags::empty(); + timer.set(expiration, flags).expect("could not set timer"); + + // + // Test + // + + // Determine that there's still an expiration tracked by the + // timer. Depending on when this runs either an `Expiration::Interval` or + // `Expiration::IntervalDelayed` will be present. That is, if the timer has + // not fired yet we'll get our original `expiration`, else the one that + // represents a delay to the next expiration. We're only interested in the + // timer still being extant. + match timer.get() { + Ok(Some(exp)) => { + assert!(matches!( + exp, + Expiration::Interval(..) | Expiration::IntervalDelayed(..) + )) + } + _ => panic!("timer lost its expiration"), + } + + // Wait for 2 firings of the alarm before checking that it has fired and + // been handled at least the once. If we wait for 3 seconds and the handler + // is never called something has gone sideways and the test fails. + let starttime = Instant::now(); + loop { + thread::sleep(2 * TIMER_PERIOD); + if ALARM_CALLED.load(Ordering::Acquire) { + break; + } + if starttime.elapsed() > Duration::from_secs(3) { + panic!("Timeout waiting for SIGALRM"); + } + } + + // Cleanup: + // 1) deregister the OS's timer. + // 2) Wait for a full timer period, since POSIX does not require that + // disabling the timer will clear pending signals, and on NetBSD at least + // it does not. + // 2) Replace the old signal handler now that we've completed the test. If + // the test fails this process panics, so the fact we might not get here + // is okay. + drop(timer); + thread::sleep(TIMER_PERIOD); + unsafe { + sigaction(SIG, &old_handler).expect("unable to reset signal handler"); + } +} diff --git a/bash-5.1/vendor/nix-0.24.2/test/test_unistd.rs b/bash-5.1/vendor/nix-0.24.2/test/test_unistd.rs new file mode 100644 index 0000000000000000000000000000000000000000..0f56b929d30eb36ac3a00dad802a187689b23f9f --- /dev/null +++ b/bash-5.1/vendor/nix-0.24.2/test/test_unistd.rs @@ -0,0 +1,1154 @@ +#[cfg(not(target_os = "redox"))] +use nix::fcntl::{self, open, readlink}; +use nix::fcntl::OFlag; +use nix::unistd::*; +use nix::unistd::ForkResult::*; +#[cfg(not(target_os = "redox"))] +use nix::sys::signal::{SaFlags, SigAction, SigHandler, SigSet, Signal, sigaction}; +use nix::sys::wait::*; +use nix::sys::stat::{self, Mode, SFlag}; +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +use nix::pty::{posix_openpt, grantpt, unlockpt, ptsname}; +use nix::errno::Errno; +use std::env; +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] +use std::ffi::CString; +#[cfg(not(target_os = "redox"))] +use std::fs::DirBuilder; +use std::fs::{self, File}; +use std::io::Write; +use std::os::unix::prelude::*; +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] +use std::path::Path; +use tempfile::{tempdir, tempfile}; +use libc::{_exit, mode_t, off_t}; + +use crate::*; + +#[test] +#[cfg(not(any(target_os = "netbsd")))] +fn test_fork_and_waitpid() { + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is signal-safe + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => unsafe { _exit(0) }, + Parent { child } => { + // assert that child was created and pid > 0 + let child_raw: ::libc::pid_t = child.into(); + assert!(child_raw > 0); + let wait_status = waitpid(child, None); + match wait_status { + // assert that waitpid returned correct status and the pid is the one of the child + Ok(WaitStatus::Exited(pid_t, _)) => assert_eq!(pid_t, child), + + // panic, must never happen + s @ Ok(_) => panic!("Child exited {:?}, should never happen", s), + + // panic, waitpid should never fail + Err(s) => panic!("Error: waitpid returned Err({:?}", s) + } + + }, + } +} + +#[test] +fn test_wait() { + // Grab FORK_MTX so wait doesn't reap a different test's child process + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is signal-safe + match unsafe{fork()}.expect("Error: Fork Failed") { + Child => unsafe { _exit(0) }, + Parent { child } => { + let wait_status = wait(); + + // just assert that (any) one child returns with WaitStatus::Exited + assert_eq!(wait_status, Ok(WaitStatus::Exited(child, 0))); + }, + } +} + +#[test] +fn test_mkstemp() { + let mut path = env::temp_dir(); + path.push("nix_tempfile.XXXXXX"); + + let result = mkstemp(&path); + match result { + Ok((fd, path)) => { + close(fd).unwrap(); + unlink(path.as_path()).unwrap(); + }, + Err(e) => panic!("mkstemp failed: {}", e) + } +} + +#[test] +fn test_mkstemp_directory() { + // mkstemp should fail if a directory is given + assert!(mkstemp(&env::temp_dir()).is_err()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkfifo() { + let tempdir = tempdir().unwrap(); + let mkfifo_fifo = tempdir.path().join("mkfifo_fifo"); + + mkfifo(&mkfifo_fifo, Mode::S_IRUSR).unwrap(); + + let stats = stat::stat(&mkfifo_fifo).unwrap(); + let typ = stat::SFlag::from_bits_truncate(stats.st_mode as mode_t); + assert!(typ == SFlag::S_IFIFO); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkfifo_directory() { + // mkfifo should fail if a directory is given + assert!(mkfifo(&env::temp_dir(), Mode::S_IRUSR).is_err()); +} + +#[test] +#[cfg(not(any( + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] +fn test_mkfifoat_none() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + let mkfifoat_fifo = tempdir.path().join("mkfifoat_fifo"); + + mkfifoat(None, &mkfifoat_fifo, Mode::S_IRUSR).unwrap(); + + let stats = stat::stat(&mkfifoat_fifo).unwrap(); + let typ = stat::SFlag::from_bits_truncate(stats.st_mode); + assert_eq!(typ, SFlag::S_IFIFO); +} + +#[test] +#[cfg(not(any( + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] +fn test_mkfifoat() { + use nix::fcntl; + + let tempdir = tempdir().unwrap(); + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let mkfifoat_name = "mkfifoat_name"; + + mkfifoat(Some(dirfd), mkfifoat_name, Mode::S_IRUSR).unwrap(); + + let stats = stat::fstatat(dirfd, mkfifoat_name, fcntl::AtFlags::empty()).unwrap(); + let typ = stat::SFlag::from_bits_truncate(stats.st_mode); + assert_eq!(typ, SFlag::S_IFIFO); +} + +#[test] +#[cfg(not(any( + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] +fn test_mkfifoat_directory_none() { + let _m = crate::CWD_LOCK.read(); + + // mkfifoat should fail if a directory is given + assert!(mkfifoat(None, &env::temp_dir(), Mode::S_IRUSR).is_err()); +} + +#[test] +#[cfg(not(any( + target_os = "macos", target_os = "ios", + target_os = "android", target_os = "redox")))] +fn test_mkfifoat_directory() { + // mkfifoat should fail if a directory is given + let tempdir = tempdir().unwrap(); + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let mkfifoat_dir = "mkfifoat_dir"; + stat::mkdirat(dirfd, mkfifoat_dir, Mode::S_IRUSR).unwrap(); + + assert!(mkfifoat(Some(dirfd), mkfifoat_dir, Mode::S_IRUSR).is_err()); +} + +#[test] +fn test_getpid() { + let pid: ::libc::pid_t = getpid().into(); + let ppid: ::libc::pid_t = getppid().into(); + assert!(pid > 0); + assert!(ppid > 0); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_getsid() { + let none_sid: ::libc::pid_t = getsid(None).unwrap().into(); + let pid_sid: ::libc::pid_t = getsid(Some(getpid())).unwrap().into(); + assert!(none_sid > 0); + assert_eq!(none_sid, pid_sid); +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod linux_android { + use nix::unistd::gettid; + + #[test] + fn test_gettid() { + let tid: ::libc::pid_t = gettid().into(); + assert!(tid > 0); + } +} + +#[test] +// `getgroups()` and `setgroups()` do not behave as expected on Apple platforms +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "fuchsia")))] +fn test_setgroups() { + // Skip this test when not run as root as `setgroups()` requires root. + skip_if_not_root!("test_setgroups"); + + let _m = crate::GROUPS_MTX.lock(); + + // Save the existing groups + let old_groups = getgroups().unwrap(); + + // Set some new made up groups + let groups = [Gid::from_raw(123), Gid::from_raw(456)]; + setgroups(&groups).unwrap(); + + let new_groups = getgroups().unwrap(); + assert_eq!(new_groups, groups); + + // Revert back to the old groups + setgroups(&old_groups).unwrap(); +} + +#[test] +// `getgroups()` and `setgroups()` do not behave as expected on Apple platforms +#[cfg(not(any(target_os = "ios", + target_os = "macos", + target_os = "redox", + target_os = "fuchsia", + target_os = "illumos")))] +fn test_initgroups() { + // Skip this test when not run as root as `initgroups()` and `setgroups()` + // require root. + skip_if_not_root!("test_initgroups"); + + let _m = crate::GROUPS_MTX.lock(); + + // Save the existing groups + let old_groups = getgroups().unwrap(); + + // It doesn't matter if the root user is not called "root" or if a user + // called "root" doesn't exist. We are just checking that the extra, + // made-up group, `123`, is set. + // FIXME: Test the other half of initgroups' functionality: whether the + // groups that the user belongs to are also set. + let user = CString::new("root").unwrap(); + let group = Gid::from_raw(123); + let group_list = getgrouplist(&user, group).unwrap(); + assert!(group_list.contains(&group)); + + initgroups(&user, group).unwrap(); + + let new_groups = getgroups().unwrap(); + assert_eq!(new_groups, group_list); + + // Revert back to the old groups + setgroups(&old_groups).unwrap(); +} + +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] +macro_rules! execve_test_factory( + ($test_name:ident, $syscall:ident, $exe: expr $(, $pathname:expr, $flags:expr)*) => ( + + #[cfg(test)] + mod $test_name { + use std::ffi::CStr; + use super::*; + + const EMPTY: &'static [u8] = b"\0"; + const DASH_C: &'static [u8] = b"-c\0"; + const BIGARG: &'static [u8] = b"echo nix!!! && echo foo=$foo && echo baz=$baz\0"; + const FOO: &'static [u8] = b"foo=bar\0"; + const BAZ: &'static [u8] = b"baz=quux\0"; + + fn syscall_cstr_ref() -> Result { + $syscall( + $exe, + $(CString::new($pathname).unwrap().as_c_str(), )* + &[CStr::from_bytes_with_nul(EMPTY).unwrap(), + CStr::from_bytes_with_nul(DASH_C).unwrap(), + CStr::from_bytes_with_nul(BIGARG).unwrap()], + &[CStr::from_bytes_with_nul(FOO).unwrap(), + CStr::from_bytes_with_nul(BAZ).unwrap()] + $(, $flags)*) + } + + fn syscall_cstring() -> Result { + $syscall( + $exe, + $(CString::new($pathname).unwrap().as_c_str(), )* + &[CString::from(CStr::from_bytes_with_nul(EMPTY).unwrap()), + CString::from(CStr::from_bytes_with_nul(DASH_C).unwrap()), + CString::from(CStr::from_bytes_with_nul(BIGARG).unwrap())], + &[CString::from(CStr::from_bytes_with_nul(FOO).unwrap()), + CString::from(CStr::from_bytes_with_nul(BAZ).unwrap())] + $(, $flags)*) + } + + fn common_test(syscall: fn() -> Result) { + if "execveat" == stringify!($syscall) { + // Though undocumented, Docker's default seccomp profile seems to + // block this syscall. https://github.com/nix-rust/nix/issues/1122 + skip_if_seccomp!($test_name); + } + + let m = crate::FORK_MTX.lock(); + // The `exec`d process will write to `writer`, and we'll read that + // data from `reader`. + let (reader, writer) = pipe().unwrap(); + + // Safe: Child calls `exit`, `dup`, `close` and the provided `exec*` family function. + // NOTE: Technically, this makes the macro unsafe to use because you could pass anything. + // The tests make sure not to do that, though. + match unsafe{fork()}.unwrap() { + Child => { + // Make `writer` be the stdout of the new process. + dup2(writer, 1).unwrap(); + let r = syscall(); + let _ = std::io::stderr() + .write_all(format!("{:?}", r).as_bytes()); + // Should only get here in event of error + unsafe{ _exit(1) }; + }, + Parent { child } => { + // Wait for the child to exit. + let ws = waitpid(child, None); + drop(m); + assert_eq!(ws, Ok(WaitStatus::Exited(child, 0))); + // Read 1024 bytes. + let mut buf = [0u8; 1024]; + read(reader, &mut buf).unwrap(); + // It should contain the things we printed using `/bin/sh`. + let string = String::from_utf8_lossy(&buf); + assert!(string.contains("nix!!!")); + assert!(string.contains("foo=bar")); + assert!(string.contains("baz=quux")); + } + } + } + + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + #[cfg_attr(target_env = "musl", ignore)] + #[test] + fn test_cstr_ref() { + common_test(syscall_cstr_ref); + } + + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + #[cfg_attr(target_env = "musl", ignore)] + #[test] + fn test_cstring() { + common_test(syscall_cstring); + } + } + + ) +); + +cfg_if!{ + if #[cfg(target_os = "android")] { + execve_test_factory!(test_execve, execve, CString::new("/system/bin/sh").unwrap().as_c_str()); + execve_test_factory!(test_fexecve, fexecve, File::open("/system/bin/sh").unwrap().into_raw_fd()); + } else if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux"))] { + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + execve_test_factory!(test_execve, execve, CString::new("/bin/sh").unwrap().as_c_str()); + execve_test_factory!(test_fexecve, fexecve, File::open("/bin/sh").unwrap().into_raw_fd()); + } else if #[cfg(any(target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] { + execve_test_factory!(test_execve, execve, CString::new("/bin/sh").unwrap().as_c_str()); + // No fexecve() on ios, macos, NetBSD, OpenBSD. + } +} + +#[cfg(any(target_os = "haiku", target_os = "linux", target_os = "openbsd"))] +execve_test_factory!(test_execvpe, execvpe, &CString::new("sh").unwrap()); + +cfg_if!{ + if #[cfg(target_os = "android")] { + use nix::fcntl::AtFlags; + execve_test_factory!(test_execveat_empty, execveat, + File::open("/system/bin/sh").unwrap().into_raw_fd(), + "", AtFlags::AT_EMPTY_PATH); + execve_test_factory!(test_execveat_relative, execveat, + File::open("/system/bin/").unwrap().into_raw_fd(), + "./sh", AtFlags::empty()); + execve_test_factory!(test_execveat_absolute, execveat, + File::open("/").unwrap().into_raw_fd(), + "/system/bin/sh", AtFlags::empty()); + } else if #[cfg(all(target_os = "linux", any(target_arch ="x86_64", target_arch ="x86")))] { + use nix::fcntl::AtFlags; + execve_test_factory!(test_execveat_empty, execveat, File::open("/bin/sh").unwrap().into_raw_fd(), + "", AtFlags::AT_EMPTY_PATH); + execve_test_factory!(test_execveat_relative, execveat, File::open("/bin/").unwrap().into_raw_fd(), + "./sh", AtFlags::empty()); + execve_test_factory!(test_execveat_absolute, execveat, File::open("/").unwrap().into_raw_fd(), + "/bin/sh", AtFlags::empty()); + } +} + +#[test] +#[cfg(not(target_os = "fuchsia"))] +fn test_fchdir() { + // fchdir changes the process's cwd + let _dr = crate::DirRestore::new(); + + let tmpdir = tempdir().unwrap(); + let tmpdir_path = tmpdir.path().canonicalize().unwrap(); + let tmpdir_fd = File::open(&tmpdir_path).unwrap().into_raw_fd(); + + assert!(fchdir(tmpdir_fd).is_ok()); + assert_eq!(getcwd().unwrap(), tmpdir_path); + + assert!(close(tmpdir_fd).is_ok()); +} + +#[test] +fn test_getcwd() { + // chdir changes the process's cwd + let _dr = crate::DirRestore::new(); + + let tmpdir = tempdir().unwrap(); + let tmpdir_path = tmpdir.path().canonicalize().unwrap(); + assert!(chdir(&tmpdir_path).is_ok()); + assert_eq!(getcwd().unwrap(), tmpdir_path); + + // make path 500 chars longer so that buffer doubling in getcwd + // kicks in. Note: One path cannot be longer than 255 bytes + // (NAME_MAX) whole path cannot be longer than PATH_MAX (usually + // 4096 on linux, 1024 on macos) + let mut inner_tmp_dir = tmpdir_path; + for _ in 0..5 { + let newdir = "a".repeat(100); + inner_tmp_dir.push(newdir); + assert!(mkdir(inner_tmp_dir.as_path(), Mode::S_IRWXU).is_ok()); + } + assert!(chdir(inner_tmp_dir.as_path()).is_ok()); + assert_eq!(getcwd().unwrap(), inner_tmp_dir.as_path()); +} + +#[test] +fn test_chown() { + // Testing for anything other than our own UID/GID is hard. + let uid = Some(getuid()); + let gid = Some(getgid()); + + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + { + File::create(&path).unwrap(); + } + + chown(&path, uid, gid).unwrap(); + chown(&path, uid, None).unwrap(); + chown(&path, None, gid).unwrap(); + + fs::remove_file(&path).unwrap(); + chown(&path, uid, gid).unwrap_err(); +} + +#[test] +fn test_fchown() { + // Testing for anything other than our own UID/GID is hard. + let uid = Some(getuid()); + let gid = Some(getgid()); + + let path = tempfile().unwrap(); + let fd = path.as_raw_fd(); + + fchown(fd, uid, gid).unwrap(); + fchown(fd, uid, None).unwrap(); + fchown(fd, None, gid).unwrap(); + fchown(999999999, uid, gid).unwrap_err(); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_fchownat() { + let _dr = crate::DirRestore::new(); + // Testing for anything other than our own UID/GID is hard. + let uid = Some(getuid()); + let gid = Some(getgid()); + + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + { + File::create(&path).unwrap(); + } + + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + + fchownat(Some(dirfd), "file", uid, gid, FchownatFlags::FollowSymlink).unwrap(); + + chdir(tempdir.path()).unwrap(); + fchownat(None, "file", uid, gid, FchownatFlags::FollowSymlink).unwrap(); + + fs::remove_file(&path).unwrap(); + fchownat(None, "file", uid, gid, FchownatFlags::FollowSymlink).unwrap_err(); +} + +#[test] +fn test_lseek() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + let tmpfd = tmp.into_raw_fd(); + + let offset: off_t = 5; + lseek(tmpfd, offset, Whence::SeekSet).unwrap(); + + let mut buf = [0u8; 7]; + crate::read_exact(tmpfd, &mut buf); + assert_eq!(b"f123456", &buf); + + close(tmpfd).unwrap(); +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +#[test] +fn test_lseek64() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + let tmpfd = tmp.into_raw_fd(); + + lseek64(tmpfd, 5, Whence::SeekSet).unwrap(); + + let mut buf = [0u8; 7]; + crate::read_exact(tmpfd, &mut buf); + assert_eq!(b"f123456", &buf); + + close(tmpfd).unwrap(); +} + +cfg_if!{ + if #[cfg(any(target_os = "android", target_os = "linux"))] { + macro_rules! require_acct{ + () => { + require_capability!("test_acct", CAP_SYS_PACCT); + } + } + } else if #[cfg(target_os = "freebsd")] { + macro_rules! require_acct{ + () => { + skip_if_not_root!("test_acct"); + skip_if_jailed!("test_acct"); + } + } + } else if #[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] { + macro_rules! require_acct{ + () => { + skip_if_not_root!("test_acct"); + } + } + } +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_acct() { + use tempfile::NamedTempFile; + use std::process::Command; + use std::{thread, time}; + + let _m = crate::FORK_MTX.lock(); + require_acct!(); + + let file = NamedTempFile::new().unwrap(); + let path = file.path().to_str().unwrap(); + + acct::enable(path).unwrap(); + + loop { + Command::new("echo").arg("Hello world"); + let len = fs::metadata(path).unwrap().len(); + if len > 0 { break; } + thread::sleep(time::Duration::from_millis(10)); + } + acct::disable().unwrap(); +} + +#[test] +fn test_fpathconf_limited() { + let f = tempfile().unwrap(); + // AFAIK, PATH_MAX is limited on all platforms, so it makes a good test + let path_max = fpathconf(f.as_raw_fd(), PathconfVar::PATH_MAX); + assert!(path_max.expect("fpathconf failed").expect("PATH_MAX is unlimited") > 0); +} + +#[test] +fn test_pathconf_limited() { + // AFAIK, PATH_MAX is limited on all platforms, so it makes a good test + let path_max = pathconf("/", PathconfVar::PATH_MAX); + assert!(path_max.expect("pathconf failed").expect("PATH_MAX is unlimited") > 0); +} + +#[test] +fn test_sysconf_limited() { + // AFAIK, OPEN_MAX is limited on all platforms, so it makes a good test + let open_max = sysconf(SysconfVar::OPEN_MAX); + assert!(open_max.expect("sysconf failed").expect("OPEN_MAX is unlimited") > 0); +} + +#[cfg(target_os = "freebsd")] +#[test] +fn test_sysconf_unsupported() { + // I know of no sysconf variables that are unsupported everywhere, but + // _XOPEN_CRYPT is unsupported on FreeBSD 11.0, which is one of the platforms + // we test. + let open_max = sysconf(SysconfVar::_XOPEN_CRYPT); + assert!(open_max.expect("sysconf failed").is_none()) +} + + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] +#[test] +fn test_getresuid() { + let resuids = getresuid().unwrap(); + assert!(resuids.real.as_raw() != libc::uid_t::max_value()); + assert!(resuids.effective.as_raw() != libc::uid_t::max_value()); + assert!(resuids.saved.as_raw() != libc::uid_t::max_value()); +} + +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd"))] +#[test] +fn test_getresgid() { + let resgids = getresgid().unwrap(); + assert!(resgids.real.as_raw() != libc::gid_t::max_value()); + assert!(resgids.effective.as_raw() != libc::gid_t::max_value()); + assert!(resgids.saved.as_raw() != libc::gid_t::max_value()); +} + +// Test that we can create a pair of pipes. No need to verify that they pass +// data; that's the domain of the OS, not nix. +#[test] +fn test_pipe() { + let (fd0, fd1) = pipe().unwrap(); + let m0 = stat::SFlag::from_bits_truncate(stat::fstat(fd0).unwrap().st_mode as mode_t); + // S_IFIFO means it's a pipe + assert_eq!(m0, SFlag::S_IFIFO); + let m1 = stat::SFlag::from_bits_truncate(stat::fstat(fd1).unwrap().st_mode as mode_t); + assert_eq!(m1, SFlag::S_IFIFO); +} + +// pipe2(2) is the same as pipe(2), except it allows setting some flags. Check +// that we can set a flag. +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox", + target_os = "solaris"))] +#[test] +fn test_pipe2() { + use nix::fcntl::{fcntl, FcntlArg, FdFlag}; + + let (fd0, fd1) = pipe2(OFlag::O_CLOEXEC).unwrap(); + let f0 = FdFlag::from_bits_truncate(fcntl(fd0, FcntlArg::F_GETFD).unwrap()); + assert!(f0.contains(FdFlag::FD_CLOEXEC)); + let f1 = FdFlag::from_bits_truncate(fcntl(fd1, FcntlArg::F_GETFD).unwrap()); + assert!(f1.contains(FdFlag::FD_CLOEXEC)); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_truncate() { + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + + { + let mut tmp = File::create(&path).unwrap(); + const CONTENTS: &[u8] = b"12345678"; + tmp.write_all(CONTENTS).unwrap(); + } + + truncate(&path, 4).unwrap(); + + let metadata = fs::metadata(&path).unwrap(); + assert_eq!(4, metadata.len()); +} + +#[test] +fn test_ftruncate() { + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + + let tmpfd = { + let mut tmp = File::create(&path).unwrap(); + const CONTENTS: &[u8] = b"12345678"; + tmp.write_all(CONTENTS).unwrap(); + tmp.into_raw_fd() + }; + + ftruncate(tmpfd, 2).unwrap(); + close(tmpfd).unwrap(); + + let metadata = fs::metadata(&path).unwrap(); + assert_eq!(2, metadata.len()); +} + +// Used in `test_alarm`. +#[cfg(not(target_os = "redox"))] +static mut ALARM_CALLED: bool = false; + +// Used in `test_alarm`. +#[cfg(not(target_os = "redox"))] +pub extern fn alarm_signal_handler(raw_signal: libc::c_int) { + assert_eq!(raw_signal, libc::SIGALRM, "unexpected signal: {}", raw_signal); + unsafe { ALARM_CALLED = true }; +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_alarm() { + use std::{ + time::{Duration, Instant,}, + thread + }; + + // Maybe other tests that fork interfere with this one? + let _m = crate::SIGNAL_MTX.lock(); + + let handler = SigHandler::Handler(alarm_signal_handler); + let signal_action = SigAction::new(handler, SaFlags::SA_RESTART, SigSet::empty()); + let old_handler = unsafe { + sigaction(Signal::SIGALRM, &signal_action) + .expect("unable to set signal handler for alarm") + }; + + // Set an alarm. + assert_eq!(alarm::set(60), None); + + // Overwriting an alarm should return the old alarm. + assert_eq!(alarm::set(1), Some(60)); + + // We should be woken up after 1 second by the alarm, so we'll sleep for 3 + // seconds to be sure. + let starttime = Instant::now(); + loop { + thread::sleep(Duration::from_millis(100)); + if unsafe { ALARM_CALLED} { + break; + } + if starttime.elapsed() > Duration::from_secs(3) { + panic!("Timeout waiting for SIGALRM"); + } + } + + // Reset the signal. + unsafe { + sigaction(Signal::SIGALRM, &old_handler) + .expect("unable to set signal handler for alarm"); + } +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_canceling_alarm() { + let _m = crate::SIGNAL_MTX.lock(); + + assert_eq!(alarm::cancel(), None); + + assert_eq!(alarm::set(60), None); + assert_eq!(alarm::cancel(), Some(60)); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_symlinkat() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + + let target = tempdir.path().join("a"); + let linkpath = tempdir.path().join("b"); + symlinkat(&target, None, &linkpath).unwrap(); + assert_eq!( + readlink(&linkpath).unwrap().to_str().unwrap(), + target.to_str().unwrap() + ); + + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let target = "c"; + let linkpath = "d"; + symlinkat(target, Some(dirfd), linkpath).unwrap(); + assert_eq!( + readlink(&tempdir.path().join(linkpath)) + .unwrap() + .to_str() + .unwrap(), + target + ); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_linkat_file() { + let tempdir = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir.path().join(oldfilename); + + let newfilename = "bar.txt"; + let newfilepath = tempdir.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt hard link file at relative path + linkat(Some(dirfd), oldfilename, Some(dirfd), newfilename, LinkatFlags::SymlinkFollow).unwrap(); + assert!(newfilepath.exists()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_linkat_olddirfd_none() { + let _dr = crate::DirRestore::new(); + + let tempdir_oldfile = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir_oldfile.path().join(oldfilename); + + let tempdir_newfile = tempdir().unwrap(); + let newfilename = "bar.txt"; + let newfilepath = tempdir_newfile.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Get file descriptor for base directory of new file + let dirfd = fcntl::open(tempdir_newfile.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt hard link file using curent working directory as relative path for old file path + chdir(tempdir_oldfile.path()).unwrap(); + linkat(None, oldfilename, Some(dirfd), newfilename, LinkatFlags::SymlinkFollow).unwrap(); + assert!(newfilepath.exists()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_linkat_newdirfd_none() { + let _dr = crate::DirRestore::new(); + + let tempdir_oldfile = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir_oldfile.path().join(oldfilename); + + let tempdir_newfile = tempdir().unwrap(); + let newfilename = "bar.txt"; + let newfilepath = tempdir_newfile.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Get file descriptor for base directory of old file + let dirfd = fcntl::open(tempdir_oldfile.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt hard link file using current working directory as relative path for new file path + chdir(tempdir_newfile.path()).unwrap(); + linkat(Some(dirfd), oldfilename, None, newfilename, LinkatFlags::SymlinkFollow).unwrap(); + assert!(newfilepath.exists()); +} + +#[test] +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] +fn test_linkat_no_follow_symlink() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir.path().join(oldfilename); + + let symoldfilename = "symfoo.txt"; + let symoldfilepath = tempdir.path().join(symoldfilename); + + let newfilename = "nofollowsymbar.txt"; + let newfilepath = tempdir.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Create symlink to file + symlinkat(&oldfilepath, None, &symoldfilepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt link symlink of file at relative path + linkat(Some(dirfd), symoldfilename, Some(dirfd), newfilename, LinkatFlags::NoSymlinkFollow).unwrap(); + + // Assert newfile is actually a symlink to oldfile. + assert_eq!( + readlink(&newfilepath) + .unwrap() + .to_str() + .unwrap(), + oldfilepath.to_str().unwrap() + ); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_linkat_follow_symlink() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir.path().join(oldfilename); + + let symoldfilename = "symfoo.txt"; + let symoldfilepath = tempdir.path().join(symoldfilename); + + let newfilename = "nofollowsymbar.txt"; + let newfilepath = tempdir.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Create symlink to file + symlinkat(&oldfilepath, None, &symoldfilepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt link target of symlink of file at relative path + linkat(Some(dirfd), symoldfilename, Some(dirfd), newfilename, LinkatFlags::SymlinkFollow).unwrap(); + + let newfilestat = stat::stat(&newfilepath).unwrap(); + + // Check the file type of the new link + assert_eq!((stat::SFlag::from_bits_truncate(newfilestat.st_mode as mode_t) & SFlag::S_IFMT), + SFlag::S_IFREG + ); + + // Check the number of hard links to the original file + assert_eq!(newfilestat.st_nlink, 2); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_unlinkat_dir_noremovedir() { + let tempdir = tempdir().unwrap(); + let dirname = "foo_dir"; + let dirpath = tempdir.path().join(dirname); + + // Create dir + DirBuilder::new().recursive(true).create(&dirpath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt unlink dir at relative path without proper flag + let err_result = unlinkat(Some(dirfd), dirname, UnlinkatFlags::NoRemoveDir).unwrap_err(); + assert!(err_result == Errno::EISDIR || err_result == Errno::EPERM); + } + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_unlinkat_dir_removedir() { + let tempdir = tempdir().unwrap(); + let dirname = "foo_dir"; + let dirpath = tempdir.path().join(dirname); + + // Create dir + DirBuilder::new().recursive(true).create(&dirpath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt unlink dir at relative path with proper flag + unlinkat(Some(dirfd), dirname, UnlinkatFlags::RemoveDir).unwrap(); + assert!(!dirpath.exists()); + } + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_unlinkat_file() { + let tempdir = tempdir().unwrap(); + let filename = "foo.txt"; + let filepath = tempdir.path().join(filename); + + // Create file + File::create(&filepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()).unwrap(); + + // Attempt unlink file at relative path + unlinkat(Some(dirfd), filename, UnlinkatFlags::NoRemoveDir).unwrap(); + assert!(!filepath.exists()); + } + +#[test] +fn test_access_not_existing() { + let tempdir = tempdir().unwrap(); + let dir = tempdir.path().join("does_not_exist.txt"); + assert_eq!(access(&dir, AccessFlags::F_OK).err().unwrap(), + Errno::ENOENT); +} + +#[test] +fn test_access_file_exists() { + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("does_exist.txt"); + let _file = File::create(path.clone()).unwrap(); + assert!(access(&path, AccessFlags::R_OK | AccessFlags::W_OK).is_ok()); +} + +#[cfg(not(target_os = "redox"))] +#[test] +fn test_user_into_passwd() { + // get the UID of the "nobody" user + let nobody = User::from_name("nobody").unwrap().unwrap(); + let pwd: libc::passwd = nobody.into(); + let _: User = (&pwd).into(); +} + +/// Tests setting the filesystem UID with `setfsuid`. +#[cfg(any(target_os = "linux", target_os = "android"))] +#[test] +fn test_setfsuid() { + use std::os::unix::fs::PermissionsExt; + use std::{fs, io, thread}; + require_capability!("test_setfsuid", CAP_SETUID); + + // get the UID of the "nobody" user + let nobody = User::from_name("nobody").unwrap().unwrap(); + + // create a temporary file with permissions '-rw-r-----' + let file = tempfile::NamedTempFile::new_in("/var/tmp").unwrap(); + let temp_path = file.into_temp_path(); + dbg!(&temp_path); + let temp_path_2 = (&temp_path).to_path_buf(); + let mut permissions = fs::metadata(&temp_path).unwrap().permissions(); + permissions.set_mode(0o640); + + // spawn a new thread where to test setfsuid + thread::spawn(move || { + // set filesystem UID + let fuid = setfsuid(nobody.uid); + // trying to open the temporary file should fail with EACCES + let res = fs::File::open(&temp_path); + assert!(res.is_err()); + assert_eq!(res.err().unwrap().kind(), io::ErrorKind::PermissionDenied); + + // assert fuid actually changes + let prev_fuid = setfsuid(Uid::from_raw(-1i32 as u32)); + assert_ne!(prev_fuid, fuid); + }) + .join() + .unwrap(); + + // open the temporary file with the current thread filesystem UID + fs::File::open(temp_path_2).unwrap(); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_ttyname() { + let fd = posix_openpt(OFlag::O_RDWR).expect("posix_openpt failed"); + assert!(fd.as_raw_fd() > 0); + + // on linux, we can just call ttyname on the pty master directly, but + // apparently osx requires that ttyname is called on a slave pty (can't + // find this documented anywhere, but it seems to empirically be the case) + grantpt(&fd).expect("grantpt failed"); + unlockpt(&fd).expect("unlockpt failed"); + let sname = unsafe { ptsname(&fd) }.expect("ptsname failed"); + let fds = open( + Path::new(&sname), + OFlag::O_RDWR, + stat::Mode::empty(), + ).expect("open failed"); + assert!(fds > 0); + + let name = ttyname(fds).expect("ttyname failed"); + assert!(name.starts_with("/dev")); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_ttyname_not_pty() { + let fd = File::open("/dev/zero").unwrap(); + assert!(fd.as_raw_fd() > 0); + assert_eq!(ttyname(fd.as_raw_fd()), Err(Errno::ENOTTY)); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_ttyname_invalid_fd() { + assert_eq!(ttyname(-1), Err(Errno::EBADF)); +} + +#[test] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +fn test_getpeereid() { + use std::os::unix::net::UnixStream; + let (sock_a, sock_b) = UnixStream::pair().unwrap(); + + let (uid_a, gid_a) = getpeereid(sock_a.as_raw_fd()).unwrap(); + let (uid_b, gid_b) = getpeereid(sock_b.as_raw_fd()).unwrap(); + + let uid = geteuid(); + let gid = getegid(); + + assert_eq!(uid, uid_a); + assert_eq!(gid, gid_a); + assert_eq!(uid_a, uid_b); + assert_eq!(gid_a, gid_b); +} + +#[test] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +fn test_getpeereid_invalid_fd() { + // getpeereid is not POSIX, so error codes are inconsistent between different Unices. + assert!(getpeereid(-1).is_err()); +} diff --git a/bash-5.1/vendor/nix/.cargo-checksum.json b/bash-5.1/vendor/nix/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..21c329711ad7026901dd39c21966e3cbbf61e074 --- /dev/null +++ b/bash-5.1/vendor/nix/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"e20b4f5f1db072fdc61fd1ec040fea9f6fc6664b1d6a93cf5dc5cf00f027993f","Cargo.toml":"cede3efdf09707d6fb9fe3c1ad327ea2d0435c70b87cd9e2096be2927f122b1b","LICENSE":"66e3ee1fa7f909ad3c612d556f2a0cdabcd809ad6e66f3b0605015ac64841b70","README.md":"0bbe5a44884e8315d018df67c691cb57d059a30c3f3dd221beb3eee56cb5cf1f","src/dir.rs":"99f348b0c792d307e9c4c36793d8fb981e11e8ffc94a6801a65808a7d8e82065","src/env.rs":"028bc5e20139ebba418a655a2978a53335dc7680bf1de43d2c8333dd72cfa5c4","src/errno.rs":"3b6c568ed8c159603b21011e9b91879a20a0e46e7d94334ab323e14dfd0e2c2a","src/fcntl.rs":"1d40fecd555c94b92d97d99ec6d72a64c6c41b8d443c6db745a41d01f00cdc79","src/features.rs":"1e1e0247662466f6998d3a405c8742ce807fce3a27823575bd235e771c2392ac","src/ifaddrs.rs":"e59a7540976c7c60b89929febdf5f6384b42c6d801bd1f339236e0e9c5636b67","src/kmod.rs":"9031edb7b0a8ed1d6635163c9c32490537d5c204e9794cce9dc2db24ead60957","src/lib.rs":"1384fe677c3a53b48b3d4c41a91ade3611b2751cdd35a0712b3237d20be393fe","src/macros.rs":"e23d7d8be22ef0bf9febaaf2739585453103607c0139bd3995a324e4a16d011e","src/mount/bsd.rs":"114878b4f2ad712236965fc3ed227d37ea56f57156266709b526002c5b65aa6e","src/mount/linux.rs":"d938612abe89d2cf0d375b335a570ba4831f2009d3ef6c7e786ccbc398bf2c15","src/mount/mod.rs":"5c9d906d4760ac1a3767949e2cab69d7fa683c454c06045919c58a90689d439f","src/mqueue.rs":"8e227acb520020b06338bceb8e7e11705564e5f4d96ab51e0815dcadc01a8b4e","src/net/if_.rs":"74dcfa81b1b77303cd8047ca4e2ab60b8fcebaa4a01dc860dd0fec65ab334eb4","src/net/mod.rs":"577f70170e53d4a6de1abb70bf8f1031ec3e65c0e63ef5fcf05c907125e7ac17","src/poll.rs":"cae2182481438f27e14e4c1a88e1835ff371423c0cc8f685ffb0b479dd102e2e","src/pty.rs":"e94219e1981cb023d4f3c22edbe26c87f7508fa25b96b9f74b3b36436aebe2fb","src/sched.rs":"22ba33ee394ef23fbde7d1fca1f2f24fc487dd447b7c28d82c9165a0822b2894","src/sys/aio.rs":"9181e01eeef5ff6f89dec1eca58ba814a80df72736b955cd1b92278d5c79bea6","src/sys/epoll.rs":"6d9bcd668010ba26abb9c5ede9f3e238a56ce4949a5c51ee80853fc8e3c37607","src/sys/event.rs":"d69b7b86bed60d7bf609c636545a5d92f7f9ece7fd69db0e662f6d7e57f3237c","src/sys/eventfd.rs":"bc8009f19e8b93b03d0202896e10bd08497f34e2987bb8ce864d6cde11eab892","src/sys/inotify.rs":"215c4217f698b47f73f4418f98f331f06ca93d35e01c6f522e5fa6a156554174","src/sys/ioctl/bsd.rs":"bbd02e30b0a78c1cb22777d9b00cfcbba9c68505cffc06118ac68474cf6fea39","src/sys/ioctl/linux.rs":"028181834d119b834bf399f2b8a6176cc57e75144693f28f32059d087d8c8018","src/sys/ioctl/mod.rs":"89b20579476b2e0254e0ecb1b41830cccd7027a22cbdb816a9d4ec3924842ac1","src/sys/memfd.rs":"72a153df4da17ea0cc4ce90ee3c47c5bec24c6e32fbb4ee7c77c1a89d79efbdd","src/sys/mman.rs":"cf4970c2ec4eb668926267679bfb7b41e653190f719d7bd1ef768623e53117a3","src/sys/mod.rs":"1be43a6d0d40661851f222b305841555897168b7e75bd9bc9c7f1962bba93369","src/sys/personality.rs":"99677190a5a81e07fc2c5c2e4b9abacf0fd555776dd0eb266fa86b8f9e965dbf","src/sys/pthread.rs":"0407064036af5b1e6247eedd38157201104c51d73575ba2eaba5e89259521462","src/sys/ptrace/bsd.rs":"ca948c863fa55de1f9fc8eabd9fd7803054df08a6ee5044b2a6a7de49a321819","src/sys/ptrace/linux.rs":"ca780ecf61416252e45dd10b5ffa6120c65b22ec4362d4f2fbd554a9bcaf1084","src/sys/ptrace/mod.rs":"671a6ccac955e75d5998f7e53ffc45ed4c7b6522a0f24a0937d60141f692dd39","src/sys/quota.rs":"d3127892f419939d63f75b9326d50e0866f7bdd92c9dcbd1cb3b6890a13b016c","src/sys/reboot.rs":"dbb1faeeb6525f1952a20cb75adbd76b0681b6214501f747cc154be2bbff7594","src/sys/resource.rs":"ee83c0a39e600c496e62592b65f8ca67c761ff9f00f30bb4bfd5cd5897281dad","src/sys/select.rs":"d30e8dfcfa46f6bd8d8b86676ad09d7aa6f1d7747d2c9601b9bb4f5ccf44b59f","src/sys/sendfile.rs":"637b09a267813c6adf72b6b74235175ed5347e3816777881ba8a9ab192c3e497","src/sys/signal.rs":"485c85a0d24a20ecf13c1d35ed740ee40498d9067cb3c0228f63323f89ba4de5","src/sys/signalfd.rs":"309eb1be7d72e8391acb5ba82b07cd6cf6fb26ddb3af914373f8889add6f52dd","src/sys/socket/addr.rs":"d7799cad83df1227d964e824598493871a463f0bf3aa27898f34155653d74453","src/sys/socket/mod.rs":"81bf377feca6fb018c8e293ce91febd95c344edb965a8f1dd7e2442b5cbad233","src/sys/socket/sockopt.rs":"f1f4704307eb76e2d29c256d722b6a8d09dc18e06378487da8fbfcc104546c3b","src/sys/stat.rs":"a7b30aa54033579aea16af4c904b3935c3816a72615537178ad6366b6c8cb381","src/sys/statfs.rs":"39a71fdd995a43210a850aac09ef3c858f0179cc0417c1abe16a1cc6a79fc10b","src/sys/statvfs.rs":"1e17f417675722690354e03184de9b9bfc1ba4367d2dc5446952ed71f67a0270","src/sys/sysinfo.rs":"ee087a4c1cd5f6efb9b29eb3d4e38438157120100fad4608ff863fc7d4d75538","src/sys/termios.rs":"81a3bf2f8995fdfbb560c2cc1bdf94b193b04a4673f085f24ecf0cd5be90b40a","src/sys/time.rs":"8319069283607875a9fe23c71c64ca76bf02681447ee6a45a9f53b8aed5f737b","src/sys/timer.rs":"5bf5068e3fe0050e7b79ed674569682c57f77bd24581ea7c7d58747989343c37","src/sys/timerfd.rs":"ee960c8475d26f01edbbeebcc8e5104a91d028d95aeec1de9d73f3f779130bb8","src/sys/uio.rs":"957e5a6650bd9a7887a332d134c6c1166588dec19530c4e9dbaca6969b99020d","src/sys/utsname.rs":"7f1c75dd550c9637a023a4629df571bcd292d53feee7b18f9f80dce425e65bea","src/sys/wait.rs":"5b21039400633d85aa49e153cc927cbf32d05df33c1d6a365921af2432b9495d","src/time.rs":"63ae33f73c79a70c811f87af2edd34e21ce93a3f89b3f176e35065fa1ece3ad7","src/ucontext.rs":"863d783443be1307477daf1970a42594d17d637aba94c8e5b63d5d9a49ea624b","src/unistd.rs":"38c774652a2adb22086eb4893d0921799addcae36b4632dabc1db79f3bbb224f","test/common/mod.rs":"1d7e28e3635754664cd056f3a1079232ff5c118df619e1d0551a9972eb0b3cd6","test/sys/mod.rs":"87b2891d83067ff21f72b8ff7fde3019dc45b6877282ac278b6da151de45c7a7","test/sys/test_aio.rs":"d2d9e9eb67a1075e43321413666a47195a03b84adf4faf235785e5d0b9158d50","test/sys/test_aio_drop.rs":"614070155fa16a979b7341d001639c5ce24a1d6f632c3abce45a5a6d49c4039b","test/sys/test_epoll.rs":"ffe95e36c79e37426ef8e8ca3b137b7f35ea0333ce666a20a4b7878db17680e9","test/sys/test_inotify.rs":"a141b9a995892547b51ceeb6761a70a6b86d37e8f38d13ea2c497b81b4b0f49f","test/sys/test_ioctl.rs":"ad25e422593408e4b14c7fb8a820e9cf6a73c2a81bd988d2ba70f780315f2403","test/sys/test_mman.rs":"f66da7990aea0b61f6e1c006fcd31389a42fa2f0ce6fdb7b02dfe314a533e32d","test/sys/test_pthread.rs":"ace36a2f5587f1874854281b4fd84e4e4d892a1e3c5cc38ced57975739522ad6","test/sys/test_ptrace.rs":"0385eebc8b1b8c72f655b745769decd9143ad83018198375982da0896310456b","test/sys/test_select.rs":"54cea1c34ad28d5770a613c1c3cbc3b1064b22037ec2b9d3fcd422d3be9e60a7","test/sys/test_signal.rs":"acc9941227bd3e2afad323613c2b8c83902ed0486d3745fd72704f395924f1e4","test/sys/test_signalfd.rs":"0e1060143e2612c490bc3d0168d0bbb042ef55e3f1d91d2578b9e42e4310a14d","test/sys/test_socket.rs":"9e86d4c15f256154f2626e663163ce823645f2934dc97edd6fc99a5f1df9164f","test/sys/test_sockopt.rs":"3013425f4e4936e8b8b1f8ea46446a840dd3c7741cd67c8706db0ae1510a3c33","test/sys/test_stat.rs":"31744a0621dace45ad20b42d16b2774cb153bceb713ca1d42038f2ad115bf6c1","test/sys/test_sysinfo.rs":"ffd49bc96375914a2c4a4a59730cae8072f85771e2c4a80d3403df38d967e272","test/sys/test_termios.rs":"e5bcef10c84bd7583d600d5601835bcb3cfc88781cb283ab0185bbef5faf4327","test/sys/test_timerfd.rs":"f99dda99b6b37ff9f216abe9f17120a3a62a7ac604c2e077279c39b985b7fe74","test/sys/test_uio.rs":"32656bd0a5699e4d019aa928edf104637937179782914a82d50d37226e84c421","test/sys/test_wait.rs":"6fd59fffeeb09ff620c359baefd062ba777598982b6cb001ccc07b6bc7605493","test/test.rs":"9f43d5001eefe1fe85ce20c4dab24474296a76d127dc25b39b4d8bd8798be45c","test/test_clearenv.rs":"45ca548035b3c20ec87314715feaba2be973709a635d85b8cde46fd1d9f1ecd4","test/test_dir.rs":"46aa32e5241cab5f5d74216aeb75427efdcdef054b061b19de36c1e9e0ea6b11","test/test_fcntl.rs":"3277cc195b97cb3950eef7016e380e2450ccc4b942019e5043089a421c31490d","test/test_kmod/hello_mod/Makefile":"0219f7bce0603f97d997fb377ca071966c90333ecc665e78a54dfeb97a9c811b","test/test_kmod/hello_mod/hello.c":"bcac6b19c5bd807e1f3878c15e426acc85785a8ade9840c3bb4d068635c9188c","test/test_kmod/mod.rs":"c214eb631510ef6fd71046c77a8f99ff052cfb1ab7621d658ccd2154eeb1d51a","test/test_mount.rs":"7ffaa8a5b3c8fd66a0f9dfe82a13dbdd268f61aa6668d8e050d7cd986ef02350","test/test_mq.rs":"136071f24131aac0e65d5f29ac18e3806641dfae1164813f5570c0e3a6f70553","test/test_net.rs":"f2912327ebb2a3d37e6cff02a5ac3106cf889cc5c74404db4ef0034059ba26f1","test/test_nix_path.rs":"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b","test/test_nmount.rs":"d6c112547bb80968170b5497cda4b6cbf69dabec6f51d494bd52298995ceff18","test/test_poll.rs":"3e0b8f0397ba080785c61a3bfc3d637bc87f324bc4e52b5f1bf3ca0d32dbc9fe","test/test_pty.rs":"b26238a0783746cb31880e11eebc1913149be999ce75fbc2d6677bdd1e2731b2","test/test_ptymaster_drop.rs":"ae63c815f5028ddc67d194e86559483018ab1816316bdb917f40cee9364fd8a5","test/test_resource.rs":"40aef790ab745cec31a4b333d2ca406b462aa9bdf4a6d3756371e498b8d51e9a","test/test_sched.rs":"d2c8065cbec77d25230f03683dfde99828c0fa463969a5a8f50ebf913091d6bc","test/test_sendfile.rs":"bb41b4f3621b518e397d3a5b5ad3c5dcef3fe506afe516eab7572fbab92b77e3","test/test_stat.rs":"c407ca47a5258750076d041afad2f6add4c3563be36628bde1c5b314f5d0765d","test/test_time.rs":"f7a21b1e279e60e84909d5dadda97ded66d3326b131fe317badf9af0a1b50335","test/test_timer.rs":"3ae20d364f075d2811f3ff94eda9886682cc21d8807656007d2464fe36d1e361","test/test_unistd.rs":"8663cdb1de1d873e572f9fa08cae9f69c4cdceb0e7e3d6a5de1f24378c17513e"},"package":"e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb"} \ No newline at end of file diff --git a/bash-5.1/vendor/nix/CHANGELOG.md b/bash-5.1/vendor/nix/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..f06e412d938925d1dcda2443ba20fea95189ed25 --- /dev/null +++ b/bash-5.1/vendor/nix/CHANGELOG.md @@ -0,0 +1,1416 @@ +# Change Log + +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](https://semver.org/). + +## [0.25.0] - 2022-08-13 +### Added + +- Added `faccessat` + ([#1780](https://github.com/nix-rust/nix/pull/1780)) +- Added `memfd` on Android. + (#[1773](https://github.com/nix-rust/nix/pull/1773)) +- Added `ETH_P_ALL` to `SockProtocol` enum + (#[1768](https://github.com/nix-rust/nix/pull/1768)) +- Added four non-standard Linux `SysconfVar` variants + (#[1761](https://github.com/nix-rust/nix/pull/1761)) +- Added const constructors for `TimeSpec` and `TimeVal` + (#[1760](https://github.com/nix-rust/nix/pull/1760)) +- Added `chflags`. + (#[1758](https://github.com/nix-rust/nix/pull/1758)) +- Added `aio_writev` and `aio_readv`. + (#[1713](https://github.com/nix-rust/nix/pull/1713)) +- impl `From` for `Uid` and `From` for `Gid` + (#[1727](https://github.com/nix-rust/nix/pull/1727)) +- impl `From` for `std::net::SocketAddrV4` and + impl `From` for `std::net::SocketAddrV6`. + (#[1711](https://github.com/nix-rust/nix/pull/1711)) +- Added support for the `x86_64-unknown-haiku` target. + (#[1703](https://github.com/nix-rust/nix/pull/1703)) +- Added `ptrace::read_user` and `ptrace::write_user` for Linux. + (#[1697](https://github.com/nix-rust/nix/pull/1697)) +- Added `getrusage` and helper types `UsageWho` and `Usage` + (#[1747](https://github.com/nix-rust/nix/pull/1747)) +- Added the `DontRoute` SockOpt + (#[1752](https://github.com/nix-rust/nix/pull/1752)) +- Added `signal::SigSet::from_sigset_t_unchecked()`. + (#[1741](https://github.com/nix-rust/nix/pull/1741)) +- Added the `Ipv4OrigDstAddr` sockopt and control message. + (#[1772](https://github.com/nix-rust/nix/pull/1772)) +- Added the `Ipv6OrigDstAddr` sockopt and control message. + (#[1772](https://github.com/nix-rust/nix/pull/1772)) +- Added the `Ipv4SendSrcAddr` control message. + (#[1776](https://github.com/nix-rust/nix/pull/1776)) + +### Changed + +- Rewrote the aio module. The new module: + * Does more type checking at compile time rather than runtime. + * Gives the caller control over whether and when to `Box` an aio operation. + * Changes the type of the `priority` arguments to `i32`. + * Changes the return type of `aio_return` to `usize`. + (#[1713](https://github.com/nix-rust/nix/pull/1713)) +- `nix::poll::ppoll`: `sigmask` parameter is now optional. + (#[1739](https://github.com/nix-rust/nix/pull/1739)) +- Changed `gethostname` to return an owned `OsString`. + (#[1745](https://github.com/nix-rust/nix/pull/1745)) +- `signal:SigSet` is now marked as `repr(transparent)`. + (#[1741](https://github.com/nix-rust/nix/pull/1741)) + +### Removed + +- Removed support for resubmitting partially complete `lio_listio` operations. + It was too complicated, and didn't fit Nix's theme of zero-cost abstractions. + Instead, it can be reimplemented downstream. + (#[1713](https://github.com/nix-rust/nix/pull/1713)) + +## [0.24.2] - 2022-07-17 +### Fixed + +- Fixed buffer overflow in `nix::sys::socket::recvfrom`. + (#[1763](https://github.com/nix-rust/nix/pull/1763)) +- Enabled `SockaddrStorage::{as_link_addr, as_link_addr_mut}` for Linux-like + operating systems. + (#[1729](https://github.com/nix-rust/nix/pull/1729)) +- Fixed `SockaddrLike::from_raw` implementations for `VsockAddr` and + `SysControlAddr`. + (#[1736](https://github.com/nix-rust/nix/pull/1736)) + +## [0.24.1] - 2022-04-22 +### Fixed + +- Fixed `UnixAddr::size` on Linux-based OSes. + (#[1702](https://github.com/nix-rust/nix/pull/1702)) + +## [0.24.0] - 2022-04-21 +### Added + +- Added fine-grained features flags. Most Nix functionality can now be + conditionally enabled. By default, all features are enabled. + (#[1611](https://github.com/nix-rust/nix/pull/1611)) +- Added statfs FS type magic constants for `target_os = "android"` + and synced constants with libc v0.2.121. + (#[1690](https://github.com/nix-rust/nix/pull/1690)) +- Added `fexecve` on DragonFly. + (#[1577](https://github.com/nix-rust/nix/pull/1577)) +- `sys::uio::IoVec` is now `Send` and `Sync` + (#[1582](https://github.com/nix-rust/nix/pull/1582)) +- Added `EPOLLEXCLUSIVE` on Android. + (#[1567](https://github.com/nix-rust/nix/pull/1567)) +- Added `fdatasync` for FreeBSD, Fuchsia, NetBSD, and OpenBSD. + (#[1581](https://github.com/nix-rust/nix/pull/1581)) +- Added `sched_setaffinity` and `sched_getaffinity` on DragonFly. + (#[1537](https://github.com/nix-rust/nix/pull/1537)) +- Added `posix_fallocate` on DragonFly. + (#[1621](https://github.com/nix-rust/nix/pull/1621)) +- Added `SO_TIMESTAMPING` support + (#[1547](https://github.com/nix-rust/nix/pull/1547)) +- Added getter methods to `MqAttr` struct + (#[1619](https://github.com/nix-rust/nix/pull/1619)) +- Added the `TxTime` sockopt and control message. + (#[1564](https://github.com/nix-rust/nix/pull/1564)) +- Added POSIX per-process timer support + (#[1622](https://github.com/nix-rust/nix/pull/1622)) +- Added `sendfile` on DragonFly. + (#[1615](https://github.com/nix-rust/nix/pull/1615)) +- Added `UMOUNT_NOFOLLOW`, `FUSE_SUPER_MAGIC` on Linux. + (#[1634](https://github.com/nix-rust/nix/pull/1634)) +- Added `getresuid`, `setresuid`, `getresgid`, and `setresgid` on DragonFly, FreeBSD, and OpenBSD. + (#[1628](https://github.com/nix-rust/nix/pull/1628)) +- Added `MAP_FIXED_NOREPLACE` on Linux. + (#[1636](https://github.com/nix-rust/nix/pull/1636)) +- Added `fspacectl` on FreeBSD + (#[1640](https://github.com/nix-rust/nix/pull/1640)) +- Added `accept4` on DragonFly, Emscripten, Fuchsia, Illumos, and NetBSD. + (#[1654](https://github.com/nix-rust/nix/pull/1654)) +- Added `AsRawFd` implementation on `OwningIter`. + (#[1563](https://github.com/nix-rust/nix/pull/1563)) +- Added `process_vm_readv` and `process_vm_writev` on Android. + (#[1557](https://github.com/nix-rust/nix/pull/1557)) +- Added `nix::uncontext` module on s390x. + (#[1662](https://github.com/nix-rust/nix/pull/1662)) +- Implemented `Extend`, `FromIterator`, and `IntoIterator` for `SigSet` and + added `SigSet::iter` and `SigSetIter`. + (#[1553](https://github.com/nix-rust/nix/pull/1553)) +- Added `ENOTRECOVERABLE` and `EOWNERDEAD` error codes on DragonFly. + (#[1665](https://github.com/nix-rust/nix/pull/1665)) +- Implemented `Read` and `Write` for `&PtyMaster` + (#[1664](https://github.com/nix-rust/nix/pull/1664)) +- Added `MSG_NOSIGNAL` for Android, Dragonfly, FreeBSD, Fuchsia, Haiku, Illumos, Linux, NetBSD, OpenBSD and Solaris. + (#[1670](https://github.com/nix-rust/nix/pull/1670)) +- Added `waitid`. + (#[1584](https://github.com/nix-rust/nix/pull/1584)) +- Added `Ipv6DontFrag` for android, iOS, linux and macOS. +- Added `IpDontFrag` for iOS, macOS. + (#[1692](https://github.com/nix-rust/nix/pull/1692)) + +### Changed + +- `mqueue` functions now operate on a distinct type, `nix::mqueue::MqdT`. + Accessors take this type by reference, not by value. + (#[1639](https://github.com/nix-rust/nix/pull/1639)) +- Removed `SigSet::extend` in favor of `>::extend`. + Because of this change, you now need `use std::iter::Extend` to call `extend` + on a `SigSet`. + (#[1553](https://github.com/nix-rust/nix/pull/1553)) +- Removed the the `PATH_MAX` restriction from APIs accepting paths. Paths + will now be allocated on the heap if they are too long. In addition, large + instruction count improvements (~30x) were made to path handling. + (#[1656](https://github.com/nix-rust/nix/pull/1656)) +- Changed `getrlimit` and `setrlimit` to use `rlim_t` directly + instead of `Option`. + (#[1668](https://github.com/nix-rust/nix/pull/1668)) +- Deprecated `InetAddr` and `SockAddr` in favor of `SockaddrIn`, `SockaddrIn6`, + and `SockaddrStorage`. + (#[1684](https://github.com/nix-rust/nix/pull/1684)) +- Deprecated `IpAddr`, `Ipv4Addr`, and `Ipv6Addr` in favor of their equivalents + from the standard library. + (#[1685](https://github.com/nix-rust/nix/pull/1685)) +- `uname` now returns a `Result` instead of just a `UtsName` and + ignoring failures from libc. And getters on the `UtsName` struct now return + an `&OsStr` instead of `&str`. + (#[1672](https://github.com/nix-rust/nix/pull/1672)) +- Replaced `IoVec` with `IoSlice` and `IoSliceMut`, and replaced `IoVec::from_slice` with + `IoSlice::new`. (#[1643](https://github.com/nix-rust/nix/pull/1643)) + +### Fixed + +- `InetAddr::from_std` now sets the `sin_len`/`sin6_len` fields on the BSDs. + (#[1642](https://github.com/nix-rust/nix/pull/1642)) +- Fixed a panic in `LinkAddr::addr`. That function now returns an `Option`. + (#[1675](https://github.com/nix-rust/nix/pull/1675)) + (#[1677](https://github.com/nix-rust/nix/pull/1677)) + +### Removed + +- Removed public access to the inner fields of `NetlinkAddr`, `AlgAddr`, + `SysControlAddr`, `LinkAddr`, and `VsockAddr`. + (#[1614](https://github.com/nix-rust/nix/pull/1614)) +- Removed `EventFlag::EV_SYSFLAG`. + (#[1635](https://github.com/nix-rust/nix/pull/1635)) + +## [0.23.1] - 2021-12-16 + +### Changed + +- Relaxed the bitflags requirement from 1.3.1 to 1.1. This partially reverts + #1492. From now on, the MSRV is not guaranteed to work with all versions of + all dependencies, just with some version of all dependencies. + (#[1607](https://github.com/nix-rust/nix/pull/1607)) + +### Fixed + +- Fixed soundness issues in `FdSet::insert`, `FdSet::remove`, and + `FdSet::contains` involving file descriptors outside of the range + `0..FD_SETSIZE`. + (#[1575](https://github.com/nix-rust/nix/pull/1575)) + +## [0.23.0] - 2021-09-28 +### Added + +- Added the `LocalPeerCred` sockopt. + (#[1482](https://github.com/nix-rust/nix/pull/1482)) +- Added `TimeSpec::from_duration` and `TimeSpec::from_timespec` + (#[1465](https://github.com/nix-rust/nix/pull/1465)) +- Added `IPV6_V6ONLY` sockopt. + (#[1470](https://github.com/nix-rust/nix/pull/1470)) +- Added `impl From for libc::passwd` trait implementation to convert a `User` + into a `libc::passwd`. Consumes the `User` struct to give ownership over + the member pointers. + (#[1471](https://github.com/nix-rust/nix/pull/1471)) +- Added `pthread_kill`. + (#[1472](https://github.com/nix-rust/nix/pull/1472)) +- Added `mknodat`. + (#[1473](https://github.com/nix-rust/nix/pull/1473)) +- Added `setrlimit` and `getrlimit`. + (#[1302](https://github.com/nix-rust/nix/pull/1302)) +- Added `ptrace::interrupt` method for platforms that support `PTRACE_INTERRUPT` + (#[1422](https://github.com/nix-rust/nix/pull/1422)) +- Added `IP6T_SO_ORIGINAL_DST` sockopt. + (#[1490](https://github.com/nix-rust/nix/pull/1490)) +- Added the `PTRACE_EVENT_STOP` variant to the `sys::ptrace::Event` enum + (#[1335](https://github.com/nix-rust/nix/pull/1335)) +- Exposed `SockAddr::from_raw_sockaddr` + (#[1447](https://github.com/nix-rust/nix/pull/1447)) +- Added `TcpRepair` + (#[1503](https://github.com/nix-rust/nix/pull/1503)) +- Enabled `pwritev` and `preadv` for more operating systems. + (#[1511](https://github.com/nix-rust/nix/pull/1511)) +- Added support for `TCP_MAXSEG` TCP Maximum Segment Size socket options + (#[1292](https://github.com/nix-rust/nix/pull/1292)) +- Added `Ipv4RecvErr` and `Ipv6RecvErr` sockopts and associated control messages. + (#[1514](https://github.com/nix-rust/nix/pull/1514)) +- Added `AsRawFd` implementation on `PollFd`. + (#[1516](https://github.com/nix-rust/nix/pull/1516)) +- Added `Ipv4Ttl` and `Ipv6Ttl` sockopts. + (#[1515](https://github.com/nix-rust/nix/pull/1515)) +- Added `MAP_EXCL`, `MAP_ALIGNED_SUPER`, and `MAP_CONCEAL` mmap flags, and + exposed `MAP_ANONYMOUS` for all operating systems. + (#[1522](https://github.com/nix-rust/nix/pull/1522)) + (#[1525](https://github.com/nix-rust/nix/pull/1525)) + (#[1531](https://github.com/nix-rust/nix/pull/1531)) + (#[1534](https://github.com/nix-rust/nix/pull/1534)) +- Added read/write accessors for 'events' on `PollFd`. + (#[1517](https://github.com/nix-rust/nix/pull/1517)) + +### Changed + +- `FdSet::{contains, highest, fds}` no longer require a mutable reference. + (#[1464](https://github.com/nix-rust/nix/pull/1464)) +- `User::gecos` and corresponding `libc::passwd::pw_gecos` are supported on + 64-bit Android, change conditional compilation to include the field in + 64-bit Android builds + (#[1471](https://github.com/nix-rust/nix/pull/1471)) +- `eventfd`s are supported on Android, change conditional compilation to + include `sys::eventfd::eventfd` and `sys::eventfd::EfdFlags`for Android + builds. + (#[1481](https://github.com/nix-rust/nix/pull/1481)) +- Most enums that come from C, for example `Errno`, are now marked as + `#[non_exhaustive]`. + (#[1474](https://github.com/nix-rust/nix/pull/1474)) +- Many more functions, mostly contructors, are now `const`. + (#[1476](https://github.com/nix-rust/nix/pull/1476)) + (#[1492](https://github.com/nix-rust/nix/pull/1492)) +- `sys::event::KEvent::filter` now returns a `Result` instead of being + infalliable. The only cases where it will now return an error are cases + where it previously would've had undefined behavior. + (#[1484](https://github.com/nix-rust/nix/pull/1484)) +- Minimum supported Rust version is now 1.46.0. + ([#1492](https://github.com/nix-rust/nix/pull/1492)) +- Rework `UnixAddr` to encapsulate internals better in order to fix soundness + issues. No longer allows creating a `UnixAddr` from a raw `sockaddr_un`. + ([#1496](https://github.com/nix-rust/nix/pull/1496)) +- Raised bitflags to 1.3.0 and the MSRV to 1.46.0. + ([#1492](https://github.com/nix-rust/nix/pull/1492)) + +### Fixed + +- `posix_fadvise` now returns errors in the conventional way, rather than as a + non-zero value in `Ok()`. + (#[1538](https://github.com/nix-rust/nix/pull/1538)) +- Added more errno definitions for better backwards compatibility with + Nix 0.21.0. + (#[1467](https://github.com/nix-rust/nix/pull/1467)) +- Fixed potential undefined behavior in `Signal::try_from` on some platforms. + (#[1484](https://github.com/nix-rust/nix/pull/1484)) +- Fixed buffer overflow in `unistd::getgrouplist`. + (#[1545](https://github.com/nix-rust/nix/pull/1545)) + + +### Removed + +- Removed a couple of termios constants on redox that were never actually + supported. + (#[1483](https://github.com/nix-rust/nix/pull/1483)) +- Removed `nix::sys::signal::NSIG`. It was of dubious utility, and not correct + for all platforms. + (#[1484](https://github.com/nix-rust/nix/pull/1484)) +- Removed support for 32-bit Apple targets, since they've been dropped by both + Rustc and Xcode. + (#[1492](https://github.com/nix-rust/nix/pull/1492)) +- Deprecated `SockAddr/InetAddr::to_str` in favor of `ToString::to_string` + (#[1495](https://github.com/nix-rust/nix/pull/1495)) +- Removed `SigevNotify` on OpenBSD and Redox. + (#[1511](https://github.com/nix-rust/nix/pull/1511)) + +## [0.22.0] - 9 July 2021 +### Added +- Added `if_nameindex` (#[1445](https://github.com/nix-rust/nix/pull/1445)) +- Added `nmount` for FreeBSD. + (#[1453](https://github.com/nix-rust/nix/pull/1453)) +- Added `IpFreebind` socket option (sockopt) on Linux, Fuchsia and Android. + (#[1456](https://github.com/nix-rust/nix/pull/1456)) +- Added `TcpUserTimeout` socket option (sockopt) on Linux and Fuchsia. + (#[1457](https://github.com/nix-rust/nix/pull/1457)) +- Added `renameat2` for Linux + (#[1458](https://github.com/nix-rust/nix/pull/1458)) +- Added `RxqOvfl` support on Linux, Fuchsia and Android. + (#[1455](https://github.com/nix-rust/nix/pull/1455)) + +### Changed +- `ptsname_r` now returns a lossily-converted string in the event of bad UTF, + just like `ptsname`. + ([#1446](https://github.com/nix-rust/nix/pull/1446)) +- Nix's error type is now a simple wrapper around the platform's Errno. This + means it is now `Into`. It's also `Clone`, `Copy`, `Eq`, and + has a small fixed size. It also requires less typing. For example, the old + enum variant `nix::Error::Sys(nix::errno::Errno::EINVAL)` is now simply + `nix::Error::EINVAL`. + ([#1446](https://github.com/nix-rust/nix/pull/1446)) + +### Fixed +### Removed + +## [0.21.0] - 31 May 2021 +### Added +- Added `getresuid` and `getresgid` + (#[1430](https://github.com/nix-rust/nix/pull/1430)) +- Added TIMESTAMPNS support for linux + (#[1402](https://github.com/nix-rust/nix/pull/1402)) +- Added `sendfile64` (#[1439](https://github.com/nix-rust/nix/pull/1439)) +- Added `MS_LAZYTIME` to `MsFlags` + (#[1437](https://github.com/nix-rust/nix/pull/1437)) + +### Changed +- Made `forkpty` unsafe, like `fork` + (#[1390](https://github.com/nix-rust/nix/pull/1390)) +- Made `Uid`, `Gid` and `Pid` methods `from_raw` and `as_raw` a `const fn` + (#[1429](https://github.com/nix-rust/nix/pull/1429)) +- Made `Uid::is_root` a `const fn` + (#[1429](https://github.com/nix-rust/nix/pull/1429)) +- `AioCb` is now always pinned. Once a `libc::aiocb` gets sent to the kernel, + its address in memory must not change. Nix now enforces that by using + `std::pin`. Most users won't need to change anything, except when using + `aio_suspend`. See that method's documentation for the new usage. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- `LioCb` is now constructed using a distinct `LioCbBuilder` struct. This + avoids a soundness issue with the old `LioCb`. Usage is similar but + construction now uses the builder pattern. See the documentation for + details. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- Minimum supported Rust version is now 1.41.0. + ([#1440](https://github.com/nix-rust/nix/pull/1440)) +- Errno aliases are now associated consts on `Errno`, instead of consts in the + `errno` module. + (#[1452](https://github.com/nix-rust/nix/pull/1452)) + +### Fixed +- Allow `sockaddr_ll` size, as reported by the Linux kernel, to be smaller then it's definition + (#[1395](https://github.com/nix-rust/nix/pull/1395)) +- Fix spurious errors using `sendmmsg` with multiple cmsgs + (#[1414](https://github.com/nix-rust/nix/pull/1414)) +- Added `Errno::EOPNOTSUPP` to FreeBSD, where it was missing. + (#[1452](https://github.com/nix-rust/nix/pull/1452)) + +### Removed + +- Removed `sys::socket::accept4` from Android arm because libc removed it in + version 0.2.87. + ([#1399](https://github.com/nix-rust/nix/pull/1399)) +- `AioCb::from_boxed_slice` and `AioCb::from_boxed_mut_slice` have been + removed. They were useful with earlier versions of Rust, but should no + longer be needed now that async/await are available. `AioCb`s now work + exclusively with borrowed buffers, not owned ones. + (#[1440](https://github.com/nix-rust/nix/pull/1440)) +- Removed some Errno values from platforms where they aren't actually defined. + (#[1452](https://github.com/nix-rust/nix/pull/1452)) + +## [0.20.0] - 20 February 2021 +### Added + +- Added a `passwd` field to `Group` (#[1338](https://github.com/nix-rust/nix/pull/1338)) +- Added `mremap` (#[1306](https://github.com/nix-rust/nix/pull/1306)) +- Added `personality` (#[1331](https://github.com/nix-rust/nix/pull/1331)) +- Added limited Fuchsia support (#[1285](https://github.com/nix-rust/nix/pull/1285)) +- Added `getpeereid` (#[1342](https://github.com/nix-rust/nix/pull/1342)) +- Implemented `IntoIterator` for `Dir` + (#[1333](https://github.com/nix-rust/nix/pull/1333)). + +### Changed + +- Minimum supported Rust version is now 1.40.0. + ([#1356](https://github.com/nix-rust/nix/pull/1356)) +- i686-apple-darwin has been demoted to Tier 2 support, because it's deprecated + by Xcode. + (#[1350](https://github.com/nix-rust/nix/pull/1350)) +- Fixed calling `recvfrom` on an `AddrFamily::Packet` socket + (#[1344](https://github.com/nix-rust/nix/pull/1344)) + +### Fixed +- `TimerFd` now closes the underlying fd on drop. + ([#1381](https://github.com/nix-rust/nix/pull/1381)) +- Define `*_MAGIC` filesystem constants on Linux s390x + (#[1372](https://github.com/nix-rust/nix/pull/1372)) +- mqueue, sysinfo, timespec, statfs, test_ptrace_syscall() on x32 + (#[1366](https://github.com/nix-rust/nix/pull/1366)) + +### Removed + +- `Dir`, `SignalFd`, and `PtyMaster` are no longer `Clone`. + (#[1382](https://github.com/nix-rust/nix/pull/1382)) +- Removed `SockLevel`, which hasn't been used for a few years + (#[1362](https://github.com/nix-rust/nix/pull/1362)) +- Removed both `Copy` and `Clone` from `TimerFd`. + ([#1381](https://github.com/nix-rust/nix/pull/1381)) + +## [0.19.1] - 28 November 2020 +### Fixed +- Fixed bugs in `recvmmsg`. + (#[1341](https://github.com/nix-rust/nix/pull/1341)) + +## [0.19.0] - 6 October 2020 +### Added +- Added Netlink protocol families to the `SockProtocol` enum + (#[1289](https://github.com/nix-rust/nix/pull/1289)) +- Added `clock_gettime`, `clock_settime`, `clock_getres`, + `clock_getcpuclockid` functions and `ClockId` struct. + (#[1281](https://github.com/nix-rust/nix/pull/1281)) +- Added wrapper functions for `PTRACE_SYSEMU` and `PTRACE_SYSEMU_SINGLESTEP`. + (#[1300](https://github.com/nix-rust/nix/pull/1300)) +- Add support for Vsock on Android rather than just Linux. + (#[1301](https://github.com/nix-rust/nix/pull/1301)) +- Added `TCP_KEEPCNT` and `TCP_KEEPINTVL` TCP keepalive options. + (#[1283](https://github.com/nix-rust/nix/pull/1283)) +### Changed +- Expose `SeekData` and `SeekHole` on all Linux targets + (#[1284](https://github.com/nix-rust/nix/pull/1284)) +- Changed unistd::{execv,execve,execvp,execvpe,fexecve,execveat} to take both `&[&CStr]` and `&[CString]` as its list argument(s). + (#[1278](https://github.com/nix-rust/nix/pull/1278)) +- Made `unistd::fork` an unsafe funtion, bringing it in line with [libstd's decision](https://github.com/rust-lang/rust/pull/58059). + (#[1293](https://github.com/nix-rust/nix/pull/1293)) +### Fixed +### Removed + +## [0.18.0] - 26 July 2020 +### Added +- Added `fchown(2)` wrapper. + (#[1257](https://github.com/nix-rust/nix/pull/1257)) +- Added support on linux systems for `MAP_HUGE_`_`SIZE`_ family of flags. + (#[1211](https://github.com/nix-rust/nix/pull/1211)) +- Added support for `F_OFD_*` `fcntl` commands on Linux and Android. + (#[1195](https://github.com/nix-rust/nix/pull/1195)) +- Added `env::clearenv()`: calls `libc::clearenv` on platforms + where it's available, and clears the environment of all variables + via `std::env::vars` and `std::env::remove_var` on others. + (#[1185](https://github.com/nix-rust/nix/pull/1185)) +- `FsType` inner value made public. + (#[1187](https://github.com/nix-rust/nix/pull/1187)) +- Added `unistd::setfsuid` and `unistd::setfsgid` to set the user or group + identity for filesystem checks per-thread. + (#[1163](https://github.com/nix-rust/nix/pull/1163)) +- Derived `Ord`, `PartialOrd` for `unistd::Pid` (#[1189](https://github.com/nix-rust/nix/pull/1189)) +- Added `select::FdSet::fds` method to iterate over file descriptors in a set. + ([#1207](https://github.com/nix-rust/nix/pull/1207)) +- Added support for UDP generic segmentation offload (GSO) and generic + receive offload (GRO) ([#1209](https://github.com/nix-rust/nix/pull/1209)) +- Added support for `sendmmsg` and `recvmmsg` calls + (#[1208](https://github.com/nix-rust/nix/pull/1208)) +- Added support for `SCM_CREDS` messages (`UnixCredentials`) on FreeBSD/DragonFly + (#[1216](https://github.com/nix-rust/nix/pull/1216)) +- Added `BindToDevice` socket option (sockopt) on Linux + (#[1233](https://github.com/nix-rust/nix/pull/1233)) +- Added `EventFilter` bitflags for `EV_DISPATCH` and `EV_RECEIPT` on OpenBSD. + (#[1252](https://github.com/nix-rust/nix/pull/1252)) +- Added support for `Ipv4PacketInfo` and `Ipv6PacketInfo` to `ControlMessage`. + (#[1222](https://github.com/nix-rust/nix/pull/1222)) +- `CpuSet` and `UnixCredentials` now implement `Default`. + (#[1244](https://github.com/nix-rust/nix/pull/1244)) +- Added `unistd::ttyname` + (#[1259](https://github.com/nix-rust/nix/pull/1259)) +- Added support for `Ipv4PacketInfo` and `Ipv6PacketInfo` to `ControlMessage` for iOS and Android. + (#[1265](https://github.com/nix-rust/nix/pull/1265)) +- Added support for `TimerFd`. + (#[1261](https://github.com/nix-rust/nix/pull/1261)) + +### Changed +- Changed `fallocate` return type from `c_int` to `()` (#[1201](https://github.com/nix-rust/nix/pull/1201)) +- Enabled `sys::ptrace::setregs` and `sys::ptrace::getregs` on x86_64-unknown-linux-musl target + (#[1198](https://github.com/nix-rust/nix/pull/1198)) +- On Linux, `ptrace::write` is now an `unsafe` function. Caveat programmer. + (#[1245](https://github.com/nix-rust/nix/pull/1245)) +- `execv`, `execve`, `execvp` and `execveat` in `::nix::unistd` and `reboot` in + `::nix::sys::reboot` now return `Result` instead of `Result` (#[1239](https://github.com/nix-rust/nix/pull/1239)) +- `sys::socket::sockaddr_storage_to_addr` is no longer `unsafe`. So is + `offset_of!`. +- `sys::socket::sockaddr_storage_to_addr`, `offset_of!`, and `Errno::clear` are + no longer `unsafe`. +- `SockAddr::as_ffi_pair`,`sys::socket::sockaddr_storage_to_addr`, `offset_of!`, + and `Errno::clear` are no longer `unsafe`. + (#[1244](https://github.com/nix-rust/nix/pull/1244)) +- Several `Inotify` methods now take `self` by value instead of by reference + (#[1244](https://github.com/nix-rust/nix/pull/1244)) +- `nix::poll::ppoll`: `timeout` parameter is now optional, None is equivalent for infinite timeout. + +### Fixed + +- Fixed `getsockopt`. The old code produced UB which triggers a panic with + Rust 1.44.0. + (#[1214](https://github.com/nix-rust/nix/pull/1214)) + +- Fixed a bug in nix::unistd that would result in an infinite loop + when a group or user lookup required a buffer larger than + 16KB. (#[1198](https://github.com/nix-rust/nix/pull/1198)) +- Fixed unaligned casting of `cmsg_data` to `af_alg_iv` (#[1206](https://github.com/nix-rust/nix/pull/1206)) +- Fixed `readlink`/`readlinkat` when reading symlinks longer than `PATH_MAX` (#[1231](https://github.com/nix-rust/nix/pull/1231)) +- `PollFd`, `EpollEvent`, `IpMembershipRequest`, `Ipv6MembershipRequest`, + `TimeVal`, and `IoVec` are now `repr(transparent)`. This is required for + correctness's sake across all architectures and compilers, though now bugs + have been reported so far. + (#[1243](https://github.com/nix-rust/nix/pull/1243)) +- Fixed unaligned pointer read in `Inotify::read_events`. + (#[1244](https://github.com/nix-rust/nix/pull/1244)) + +### Removed + +- Removed `sys::socket::addr::from_libc_sockaddr` from the public API. + (#[1215](https://github.com/nix-rust/nix/pull/1215)) +- Removed `sys::termios::{get_libc_termios, get_libc_termios_mut, update_wrapper` + from the public API. These were previously hidden in the docs but still usable + by downstream. + (#[1235](https://github.com/nix-rust/nix/pull/1235)) + +- Nix no longer implements `NixPath` for `Option

where P: NixPath`. Most + Nix functions that accept `NixPath` arguments can't do anything useful with + `None`. The exceptions (`mount` and `quotactl_sync`) already take explicitly + optional arguments. + (#[1242](https://github.com/nix-rust/nix/pull/1242)) + +- Removed `unistd::daemon` and `unistd::pipe2` on OSX and ios + (#[1255](https://github.com/nix-rust/nix/pull/1255)) + +- Removed `sys::event::FilterFlag::NOTE_EXIT_REPARENTED` and + `sys::event::FilterFlag::NOTE_REAP` on OSX and ios. + (#[1255](https://github.com/nix-rust/nix/pull/1255)) + +- Removed `sys::ptrace::ptrace` on Android and Linux. + (#[1255](https://github.com/nix-rust/nix/pull/1255)) + +- Dropped support for powerpc64-unknown-linux-gnu + (#[1266](https://github.com/nix-rust/nix/pull/1268)) + +## [0.17.0] - 3 February 2020 +### Added +- Add `CLK_TCK` to `SysconfVar` + (#[1177](https://github.com/nix-rust/nix/pull/1177)) +### Changed +### Fixed +### Removed +- Removed deprecated Error::description from error types + (#[1175](https://github.com/nix-rust/nix/pull/1175)) + +## [0.16.1] - 23 December 2019 +### Added +### Changed +### Fixed + +- Fixed the build for OpenBSD + (#[1168](https://github.com/nix-rust/nix/pull/1168)) + +### Removed + +## [0.16.0] - 1 December 2019 +### Added +- Added `ptrace::seize()`: similar to `attach()` on Linux + but with better-defined semantics. + (#[1154](https://github.com/nix-rust/nix/pull/1154)) + +- Added `Signal::as_str()`: returns signal name as `&'static str` + (#[1138](https://github.com/nix-rust/nix/pull/1138)) + +- Added `posix_fallocate`. + ([#1105](https://github.com/nix-rust/nix/pull/1105)) + +- Implemented `Default` for `FdSet` + ([#1107](https://github.com/nix-rust/nix/pull/1107)) + +- Added `NixPath::is_empty`. + ([#1107](https://github.com/nix-rust/nix/pull/1107)) + +- Added `mkfifoat` + ([#1133](https://github.com/nix-rust/nix/pull/1133)) + +- Added `User::from_uid`, `User::from_name`, `User::from_gid` and + `Group::from_name`, + ([#1139](https://github.com/nix-rust/nix/pull/1139)) + +- Added `linkat` + ([#1101](https://github.com/nix-rust/nix/pull/1101)) + +- Added `sched_getaffinity`. + ([#1148](https://github.com/nix-rust/nix/pull/1148)) + +- Added optional `Signal` argument to `ptrace::{detach, syscall}` for signal + injection. ([#1083](https://github.com/nix-rust/nix/pull/1083)) + +### Changed +- `sys::termios::BaudRate` now implements `TryFrom` instead of + `From`. The old `From` implementation would panic on failure. + ([#1159](https://github.com/nix-rust/nix/pull/1159)) + +- `sys::socket::ControlMessage::ScmCredentials` and + `sys::socket::ControlMessageOwned::ScmCredentials` now wrap `UnixCredentials` + rather than `libc::ucred`. + ([#1160](https://github.com/nix-rust/nix/pull/1160)) + +- `sys::socket::recvmsg` now takes a plain `Vec` instead of a `CmsgBuffer` + implementor. If you were already using `cmsg_space!`, then you needn't worry. + ([#1156](https://github.com/nix-rust/nix/pull/1156)) + +- `sys::socket::recvfrom` now returns + `Result<(usize, Option)>` instead of `Result<(usize, SockAddr)>`. + ([#1145](https://github.com/nix-rust/nix/pull/1145)) + +- `Signal::from_c_int` has been replaced by `Signal::try_from` + ([#1113](https://github.com/nix-rust/nix/pull/1113)) + +- Changed `readlink` and `readlinkat` to return `OsString` + ([#1109](https://github.com/nix-rust/nix/pull/1109)) + + ```rust + # use nix::fcntl::{readlink, readlinkat}; + // the buffer argument of `readlink` and `readlinkat` has been removed, + // and the return value is now an owned type (`OsString`). + // Existing code can be updated by removing the buffer argument + // and removing any clone or similar operation on the output + + // old code `readlink(&path, &mut buf)` can be replaced with the following + let _: OsString = readlink(&path); + + // old code `readlinkat(dirfd, &path, &mut buf)` can be replaced with the following + let _: OsString = readlinkat(dirfd, &path); + ``` + +- Minimum supported Rust version is now 1.36.0. + ([#1108](https://github.com/nix-rust/nix/pull/1108)) + +- `Ipv4Addr::octets`, `Ipv4Addr::to_std`, `Error::as_errno`, + `ForkResult::is_child`, `ForkResult::is_parent`, `Gid::as_raw`, + `Uid::is_root`, `Uid::as_raw`, `Pid::as_raw`, and `PollFd::revents` now take + `self` by value. + ([#1107](https://github.com/nix-rust/nix/pull/1107)) + +- Type `&CString` for parameters of `exec(v|ve|vp|vpe|veat)` are changed to `&CStr`. + ([#1121](https://github.com/nix-rust/nix/pull/1121)) + +### Fixed +- Fix length of abstract socket addresses + ([#1120](https://github.com/nix-rust/nix/pull/1120)) + +- Fix initialization of msghdr in recvmsg/sendmsg when built with musl + ([#1136](https://github.com/nix-rust/nix/pull/1136)) + +### Removed +- Remove the deprecated `CmsgSpace`. + ([#1156](https://github.com/nix-rust/nix/pull/1156)) + +## [0.15.0] - 10 August 2019 +### Added +- Added `MSG_WAITALL` to `MsgFlags` in `sys::socket`. + ([#1079](https://github.com/nix-rust/nix/pull/1079)) +- Implemented `Clone`, `Copy`, `Debug`, `Eq`, `Hash`, and `PartialEq` for most + types that support them. ([#1035](https://github.com/nix-rust/nix/pull/1035)) +- Added `copy_file_range` wrapper + ([#1069](https://github.com/nix-rust/nix/pull/1069)) +- Add `mkdirat`. + ([#1084](https://github.com/nix-rust/nix/pull/1084)) +- Add `posix_fadvise`. + ([#1089](https://github.com/nix-rust/nix/pull/1089)) +- Added `AF_VSOCK` to `AddressFamily`. + ([#1091](https://github.com/nix-rust/nix/pull/1091)) +- Add `unlinkat` + ([#1058](https://github.com/nix-rust/nix/pull/1058)) +- Add `renameat`. + ([#1097](https://github.com/nix-rust/nix/pull/1097)) + +### Changed +- Support for `ifaddrs` now present when building for Android. + ([#1077](https://github.com/nix-rust/nix/pull/1077)) +- Minimum supported Rust version is now 1.31.0 + ([#1035](https://github.com/nix-rust/nix/pull/1035)) + ([#1095](https://github.com/nix-rust/nix/pull/1095)) +- Now functions `statfs()` and `fstatfs()` return result with `Statfs` wrapper + ([#928](https://github.com/nix-rust/nix/pull/928)) + +### Fixed +- Enabled `sched_yield` for all nix hosts. + ([#1090](https://github.com/nix-rust/nix/pull/1090)) + +### Removed + +## [0.14.1] - 2019-06-06 +### Added +- Macros exported by `nix` may now be imported via `use` on the Rust 2018 + edition without importing helper macros on Linux targets. + ([#1066](https://github.com/nix-rust/nix/pull/1066)) + + For example, in Rust 2018, the `ioctl_read_bad!` macro can now be imported + without importing the `convert_ioctl_res!` macro. + + ```rust + use nix::ioctl_read_bad; + + ioctl_read_bad!(tcgets, libc::TCGETS, libc::termios); + ``` + +### Changed +- Changed some public types from reexports of libc types like `uint32_t` to the + native equivalents like `u32.` + ([#1072](https://github.com/nix-rust/nix/pull/1072/commits)) + +### Fixed +- Fix the build on Android and Linux/mips with recent versions of libc. + ([#1072](https://github.com/nix-rust/nix/pull/1072/commits)) + +### Removed + +## [0.14.0] - 2019-05-21 +### Added +- Add IP_RECVIF & IP_RECVDSTADDR. Enable IP_PKTINFO and IP6_PKTINFO on netbsd/openbsd. + ([#1002](https://github.com/nix-rust/nix/pull/1002)) +- Added `inotify_init1`, `inotify_add_watch` and `inotify_rm_watch` wrappers for + Android and Linux. ([#1016](https://github.com/nix-rust/nix/pull/1016)) +- Add `ALG_SET_IV`, `ALG_SET_OP` and `ALG_SET_AEAD_ASSOCLEN` control messages and `AF_ALG` + socket types on Linux and Android ([#1031](https://github.com/nix-rust/nix/pull/1031)) +- Add killpg + ([#1034](https://github.com/nix-rust/nix/pull/1034)) +- Added ENOTSUP errno support for Linux and Android. + ([#969](https://github.com/nix-rust/nix/pull/969)) +- Add several errno constants from OpenBSD 6.2 + ([#1036](https://github.com/nix-rust/nix/pull/1036)) +- Added `from_std` and `to_std` methods for `sys::socket::IpAddr` + ([#1043](https://github.com/nix-rust/nix/pull/1043)) +- Added `nix::unistd:seteuid` and `nix::unistd::setegid` for those platforms that do + not support `setresuid` nor `setresgid` respectively. + ([#1044](https://github.com/nix-rust/nix/pull/1044)) +- Added a `access` wrapper + ([#1045](https://github.com/nix-rust/nix/pull/1045)) +- Add `forkpty` + ([#1042](https://github.com/nix-rust/nix/pull/1042)) +- Add `sched_yield` + ([#1050](https://github.com/nix-rust/nix/pull/1050)) + +### Changed +- `PollFd` event flags renamed to `PollFlags` ([#1024](https://github.com/nix-rust/nix/pull/1024/)) +- `recvmsg` now returns an Iterator over `ControlMessageOwned` objects rather + than `ControlMessage` objects. This is sadly not backwards-compatible. Fix + code like this: + ```rust + if let ControlMessage::ScmRights(&fds) = cmsg { + ``` + + By replacing it with code like this: + ```rust + if let ControlMessageOwned::ScmRights(fds) = cmsg { + ``` + ([#1020](https://github.com/nix-rust/nix/pull/1020)) +- Replaced `CmsgSpace` with the `cmsg_space` macro. + ([#1020](https://github.com/nix-rust/nix/pull/1020)) + +### Fixed +- Fixed multiple bugs when using `sendmsg` and `recvmsg` with ancillary control messages + ([#1020](https://github.com/nix-rust/nix/pull/1020)) +- Macros exported by `nix` may now be imported via `use` on the Rust 2018 + edition without importing helper macros for BSD targets. + ([#1041](https://github.com/nix-rust/nix/pull/1041)) + + For example, in Rust 2018, the `ioctl_read_bad!` macro can now be imported + without importing the `convert_ioctl_res!` macro. + + ```rust + use nix::ioctl_read_bad; + + ioctl_read_bad!(tcgets, libc::TCGETS, libc::termios); + ``` + +### Removed +- `Daemon`, `NOTE_REAP`, and `NOTE_EXIT_REPARENTED` are now deprecated on OSX + and iOS. + ([#1033](https://github.com/nix-rust/nix/pull/1033)) +- `PTRACE_GETREGS`, `PTRACE_SETREGS`, `PTRACE_GETFPREGS`, and + `PTRACE_SETFPREGS` have been removed from some platforms where they never + should've been defined in the first place. + ([#1055](https://github.com/nix-rust/nix/pull/1055)) + +## [0.13.0] - 2019-01-15 +### Added +- Added PKTINFO(V4) & V6PKTINFO cmsg support - Android/FreeBSD/iOS/Linux/MacOS. + ([#990](https://github.com/nix-rust/nix/pull/990)) +- Added support of CString type in `setsockopt`. + ([#972](https://github.com/nix-rust/nix/pull/972)) +- Added option `TCP_CONGESTION` in `setsockopt`. + ([#972](https://github.com/nix-rust/nix/pull/972)) +- Added `symlinkat` wrapper. + ([#997](https://github.com/nix-rust/nix/pull/997)) +- Added `ptrace::{getregs, setregs}`. + ([#1010](https://github.com/nix-rust/nix/pull/1010)) +- Added `nix::sys::signal::signal`. + ([#817](https://github.com/nix-rust/nix/pull/817)) +- Added an `mprotect` wrapper. + ([#991](https://github.com/nix-rust/nix/pull/991)) + +### Changed +### Fixed +- `lutimes` never worked on OpenBSD as it is not implemented on OpenBSD. It has + been removed. ([#1000](https://github.com/nix-rust/nix/pull/1000)) +- `fexecve` never worked on NetBSD or on OpenBSD as it is not implemented on + either OS. It has been removed. ([#1000](https://github.com/nix-rust/nix/pull/1000)) + +### Removed + +## [0.12.0] 2018-11-28 + +### Added +- Added `FromStr` and `Display` impls for `nix::sys::Signal` + ([#884](https://github.com/nix-rust/nix/pull/884)) +- Added a `sync` wrapper. + ([#961](https://github.com/nix-rust/nix/pull/961)) +- Added a `sysinfo` wrapper. + ([#922](https://github.com/nix-rust/nix/pull/922)) +- Support the `SO_PEERCRED` socket option and the `UnixCredentials` type on all Linux and Android targets. + ([#921](https://github.com/nix-rust/nix/pull/921)) +- Added support for `SCM_CREDENTIALS`, allowing to send process credentials over Unix sockets. + ([#923](https://github.com/nix-rust/nix/pull/923)) +- Added a `dir` module for reading directories (wraps `fdopendir`, `readdir`, and `rewinddir`). + ([#916](https://github.com/nix-rust/nix/pull/916)) +- Added `kmod` module that allows loading and unloading kernel modules on Linux. + ([#930](https://github.com/nix-rust/nix/pull/930)) +- Added `futimens` and `utimesat` wrappers ([#944](https://github.com/nix-rust/nix/pull/944)), + an `lutimes` wrapper ([#967](https://github.com/nix-rust/nix/pull/967)), + and a `utimes` wrapper ([#946](https://github.com/nix-rust/nix/pull/946)). +- Added `AF_UNSPEC` wrapper to `AddressFamily` ([#948](https://github.com/nix-rust/nix/pull/948)) +- Added the `mode_t` public alias within `sys::stat`. + ([#954](https://github.com/nix-rust/nix/pull/954)) +- Added a `truncate` wrapper. + ([#956](https://github.com/nix-rust/nix/pull/956)) +- Added a `fchownat` wrapper. + ([#955](https://github.com/nix-rust/nix/pull/955)) +- Added support for `ptrace` on BSD operating systems ([#949](https://github.com/nix-rust/nix/pull/949)) +- Added `ptrace` functions for reads and writes to tracee memory and ptrace kill + ([#949](https://github.com/nix-rust/nix/pull/949)) ([#958](https://github.com/nix-rust/nix/pull/958)) +- Added a `acct` wrapper module for enabling and disabling process accounting + ([#952](https://github.com/nix-rust/nix/pull/952)) +- Added the `time_t` and `suseconds_t` public aliases within `sys::time`. + ([#968](https://github.com/nix-rust/nix/pull/968)) +- Added `unistd::execvpe` for Haiku, Linux and OpenBSD + ([#975](https://github.com/nix-rust/nix/pull/975)) +- Added `Error::as_errno`. + ([#977](https://github.com/nix-rust/nix/pull/977)) + +### Changed +- Increased required Rust version to 1.24.1 + ([#900](https://github.com/nix-rust/nix/pull/900)) + ([#966](https://github.com/nix-rust/nix/pull/966)) + +### Fixed +- Made `preadv` take immutable slice of IoVec. + ([#914](https://github.com/nix-rust/nix/pull/914)) +- Fixed passing multiple file descriptors over Unix Sockets. + ([#918](https://github.com/nix-rust/nix/pull/918)) + +### Removed + +## [0.11.0] 2018-06-01 + +### Added +- Added `sendfile` on FreeBSD and Darwin. + ([#901](https://github.com/nix-rust/nix/pull/901)) +- Added `pselect` + ([#894](https://github.com/nix-rust/nix/pull/894)) +- Exposed `preadv` and `pwritev` on the BSDs. + ([#883](https://github.com/nix-rust/nix/pull/883)) +- Added `mlockall` and `munlockall` + ([#876](https://github.com/nix-rust/nix/pull/876)) +- Added `SO_MARK` on Linux. + ([#873](https://github.com/nix-rust/nix/pull/873)) +- Added safe support for nearly any buffer type in the `sys::aio` module. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Added `sys::aio::LioCb` as a wrapper for `libc::lio_listio`. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Added `unistd::getsid` + ([#850](https://github.com/nix-rust/nix/pull/850)) +- Added `alarm`. ([#830](https://github.com/nix-rust/nix/pull/830)) +- Added interface flags `IFF_NO_PI, IFF_TUN, IFF_TAP` on linux-like systems. + ([#853](https://github.com/nix-rust/nix/pull/853)) +- Added `statvfs` module to all MacOS and Linux architectures. + ([#832](https://github.com/nix-rust/nix/pull/832)) +- Added `EVFILT_EMPTY`, `EVFILT_PROCDESC`, and `EVFILT_SENDFILE` on FreeBSD. + ([#825](https://github.com/nix-rust/nix/pull/825)) +- Exposed `termios::cfmakesane` on FreeBSD. + ([#825](https://github.com/nix-rust/nix/pull/825)) +- Exposed `MSG_CMSG_CLOEXEC` on *BSD. + ([#825](https://github.com/nix-rust/nix/pull/825)) +- Added `fchmod`, `fchmodat`. + ([#857](https://github.com/nix-rust/nix/pull/857)) +- Added `request_code_write_int!` on FreeBSD/DragonFlyBSD + ([#833](https://github.com/nix-rust/nix/pull/833)) + +### Changed +- `Display` and `Debug` for `SysControlAddr` now includes all fields. + ([#837](https://github.com/nix-rust/nix/pull/837)) +- `ioctl!` has been replaced with a family of `ioctl_*!` macros. + ([#833](https://github.com/nix-rust/nix/pull/833)) +- `io!`, `ior!`, `iow!`, and `iorw!` has been renamed to `request_code_none!`, `request_code_read!`, + `request_code_write!`, and `request_code_readwrite!` respectively. These have also now been exposed + in the documentation. + ([#833](https://github.com/nix-rust/nix/pull/833)) +- Enabled more `ptrace::Request` definitions for uncommon Linux platforms + ([#892](https://github.com/nix-rust/nix/pull/892)) +- Emulation of `FD_CLOEXEC` and `O_NONBLOCK` was removed from `socket()`, `accept4()`, and + `socketpair()`. + ([#907](https://github.com/nix-rust/nix/pull/907)) + +### Fixed +- Fixed possible panics when using `SigAction::flags` on Linux + ([#869](https://github.com/nix-rust/nix/pull/869)) +- Properly exposed 460800 and 921600 baud rates on NetBSD + ([#837](https://github.com/nix-rust/nix/pull/837)) +- Fixed `ioctl_write_int!` on FreeBSD/DragonFlyBSD + ([#833](https://github.com/nix-rust/nix/pull/833)) +- `ioctl_write_int!` now properly supports passing a `c_ulong` as the parameter on Linux non-musl targets + ([#833](https://github.com/nix-rust/nix/pull/833)) + +### Removed +- Removed explicit support for the `bytes` crate from the `sys::aio` module. + See `sys::aio::AioCb::from_boxed_slice` examples for alternatives. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Removed `sys::aio::lio_listio`. Use `sys::aio::LioCb::listio` instead. + ([#872](https://github.com/nix-rust/nix/pull/872)) +- Removed emulated `accept4()` from macos, ios, and netbsd targets + ([#907](https://github.com/nix-rust/nix/pull/907)) +- Removed `IFF_NOTRAILERS` on OpenBSD, as it has been removed in OpenBSD 6.3 + ([#893](https://github.com/nix-rust/nix/pull/893)) + +## [0.10.0] 2018-01-26 + +### Added +- Added specialized wrapper: `sys::ptrace::step` + ([#852](https://github.com/nix-rust/nix/pull/852)) +- Added `AioCb::from_ptr` and `AioCb::from_mut_ptr` + ([#820](https://github.com/nix-rust/nix/pull/820)) +- Added specialized wrappers: `sys::ptrace::{traceme, syscall, cont, attach}`. Using the matching routines + with `sys::ptrace::ptrace` is now deprecated. +- Added `nix::poll` module for all platforms + ([#672](https://github.com/nix-rust/nix/pull/672)) +- Added `nix::ppoll` function for FreeBSD and DragonFly + ([#672](https://github.com/nix-rust/nix/pull/672)) +- Added protocol families in `AddressFamily` enum. + ([#647](https://github.com/nix-rust/nix/pull/647)) +- Added the `pid()` method to `WaitStatus` for extracting the PID. + ([#722](https://github.com/nix-rust/nix/pull/722)) +- Added `nix::unistd:fexecve`. + ([#727](https://github.com/nix-rust/nix/pull/727)) +- Expose `uname()` on all platforms. + ([#739](https://github.com/nix-rust/nix/pull/739)) +- Expose `signalfd` module on Android as well. + ([#739](https://github.com/nix-rust/nix/pull/739)) +- Added `nix::sys::ptrace::detach`. + ([#749](https://github.com/nix-rust/nix/pull/749)) +- Added timestamp socket control message variant: + `nix::sys::socket::ControlMessage::ScmTimestamp` + ([#663](https://github.com/nix-rust/nix/pull/663)) +- Added socket option variant that enables the timestamp socket + control message: `nix::sys::socket::sockopt::ReceiveTimestamp` + ([#663](https://github.com/nix-rust/nix/pull/663)) +- Added more accessor methods for `AioCb` + ([#773](https://github.com/nix-rust/nix/pull/773)) +- Add `nix::sys::fallocate` + ([#768](https:://github.com/nix-rust/nix/pull/768)) +- Added `nix::unistd::mkfifo`. + ([#602](https://github.com/nix-rust/nix/pull/774)) +- Added `ptrace::Options::PTRACE_O_EXITKILL` on Linux and Android. + ([#771](https://github.com/nix-rust/nix/pull/771)) +- Added `nix::sys::uio::{process_vm_readv, process_vm_writev}` on Linux + ([#568](https://github.com/nix-rust/nix/pull/568)) +- Added `nix::unistd::{getgroups, setgroups, getgrouplist, initgroups}`. ([#733](https://github.com/nix-rust/nix/pull/733)) +- Added `nix::sys::socket::UnixAddr::as_abstract` on Linux and Android. + ([#785](https://github.com/nix-rust/nix/pull/785)) +- Added `nix::unistd::execveat` on Linux and Android. + ([#800](https://github.com/nix-rust/nix/pull/800)) +- Added the `from_raw()` method to `WaitStatus` for converting raw status values + to `WaitStatus` independent of syscalls. + ([#741](https://github.com/nix-rust/nix/pull/741)) +- Added more standard trait implementations for various types. + ([#814](https://github.com/nix-rust/nix/pull/814)) +- Added `sigprocmask` to the signal module. + ([#826](https://github.com/nix-rust/nix/pull/826)) +- Added `nix::sys::socket::LinkAddr` on Linux and all bsdlike system. + ([#813](https://github.com/nix-rust/nix/pull/813)) +- Add socket options for `IP_TRANSPARENT` / `BIND_ANY`. + ([#835](https://github.com/nix-rust/nix/pull/835)) + +### Changed +- Exposed the `mqueue` module for all supported operating systems. + ([#834](https://github.com/nix-rust/nix/pull/834)) +- Use native `pipe2` on all BSD targets. Users should notice no difference. + ([#777](https://github.com/nix-rust/nix/pull/777)) +- Renamed existing `ptrace` wrappers to encourage namespacing ([#692](https://github.com/nix-rust/nix/pull/692)) +- Marked `sys::ptrace::ptrace` as `unsafe`. +- Changed function signature of `socket()` and `socketpair()`. The `protocol` argument + has changed type from `c_int` to `SockProtocol`. + It accepts a `None` value for default protocol that was specified with zero using `c_int`. + ([#647](https://github.com/nix-rust/nix/pull/647)) +- Made `select` easier to use, adding the ability to automatically calculate the `nfds` parameter using the new + `FdSet::highest` ([#701](https://github.com/nix-rust/nix/pull/701)) +- Exposed `unistd::setresuid` and `unistd::setresgid` on FreeBSD and OpenBSD + ([#721](https://github.com/nix-rust/nix/pull/721)) +- Refactored the `statvfs` module removing extraneous API functions and the + `statvfs::vfs` module. Additionally `(f)statvfs()` now return the struct + directly. And the returned `Statvfs` struct now exposes its data through + accessor methods. ([#729](https://github.com/nix-rust/nix/pull/729)) +- The `addr` argument to `madvise` and `msync` is now `*mut` to better match the + libc API. ([#731](https://github.com/nix-rust/nix/pull/731)) +- `shm_open` and `shm_unlink` are no longer exposed on Android targets, where + they are not officially supported. ([#731](https://github.com/nix-rust/nix/pull/731)) +- `MapFlags`, `MmapAdvise`, and `MsFlags` expose some more variants and only + officially-supported variants are provided for each target. + ([#731](https://github.com/nix-rust/nix/pull/731)) +- Marked `pty::ptsname` function as `unsafe` + ([#744](https://github.com/nix-rust/nix/pull/744)) +- Moved constants ptrace request, event and options to enums and updated ptrace functions and argument types accordingly. + ([#749](https://github.com/nix-rust/nix/pull/749)) +- `AioCb::Drop` will now panic if the `AioCb` is still in-progress ([#715](https://github.com/nix-rust/nix/pull/715)) +- Restricted `nix::sys::socket::UnixAddr::new_abstract` to Linux and Android only. + ([#785](https://github.com/nix-rust/nix/pull/785)) +- The `ucred` struct has been removed in favor of a `UserCredentials` struct that + contains only getters for its fields. + ([#814](https://github.com/nix-rust/nix/pull/814)) +- Both `ip_mreq` and `ipv6_mreq` have been replaced with `IpMembershipRequest` and + `Ipv6MembershipRequest`. + ([#814](https://github.com/nix-rust/nix/pull/814)) +- Removed return type from `pause`. + ([#829](https://github.com/nix-rust/nix/pull/829)) +- Changed the termios APIs to allow for using a `u32` instead of the `BaudRate` + enum on BSD platforms to support arbitrary baud rates. See the module docs for + `nix::sys::termios` for more details. + ([#843](https://github.com/nix-rust/nix/pull/843)) + +### Fixed +- Fix compilation and tests for OpenBSD targets + ([#688](https://github.com/nix-rust/nix/pull/688)) +- Fixed error handling in `AioCb::fsync`, `AioCb::read`, and `AioCb::write`. + It is no longer an error to drop an `AioCb` that failed to enqueue in the OS. + ([#715](https://github.com/nix-rust/nix/pull/715)) +- Fix potential memory corruption on non-Linux platforms when using + `sendmsg`/`recvmsg`, caused by mismatched `msghdr` definition. + ([#648](https://github.com/nix-rust/nix/pull/648)) + +### Removed +- `AioCb::from_boxed_slice` has been removed. It was never actually safe. Use + `from_bytes` or `from_bytes_mut` instead. + ([#820](https://github.com/nix-rust/nix/pull/820)) +- The syscall module has been removed. This only exposed enough functionality for + `memfd_create()` and `pivot_root()`, which are still exposed as separate functions. + ([#747](https://github.com/nix-rust/nix/pull/747)) +- The `Errno` variants are no longer reexported from the `errno` module. `Errno` itself is no longer reexported from the + crate root and instead must be accessed using the `errno` module. ([#696](https://github.com/nix-rust/nix/pull/696)) +- Removed `MS_VERBOSE`, `MS_NOSEC`, and `MS_BORN` from `MsFlags`. These + are internal kernel flags and should never have been exposed. + ([#814](https://github.com/nix-rust/nix/pull/814)) + + +## [0.9.0] 2017-07-23 + +### Added +- Added `sysconf`, `pathconf`, and `fpathconf` + ([#630](https://github.com/nix-rust/nix/pull/630) +- Added `sys::signal::SigAction::{ flags, mask, handler}` + ([#611](https://github.com/nix-rust/nix/pull/609) +- Added `nix::sys::pthread::pthread_self` + ([#591](https://github.com/nix-rust/nix/pull/591) +- Added `AioCb::from_boxed_slice` + ([#582](https://github.com/nix-rust/nix/pull/582) +- Added `nix::unistd::{openat, fstatat, readlink, readlinkat}` + ([#551](https://github.com/nix-rust/nix/pull/551)) +- Added `nix::pty::{grantpt, posix_openpt, ptsname/ptsname_r, unlockpt}` + ([#556](https://github.com/nix-rust/nix/pull/556) +- Added `nix::ptr::openpty` + ([#456](https://github.com/nix-rust/nix/pull/456)) +- Added `nix::ptrace::{ptrace_get_data, ptrace_getsiginfo, ptrace_setsiginfo + and nix::Error::UnsupportedOperation}` + ([#614](https://github.com/nix-rust/nix/pull/614)) +- Added `cfmakeraw`, `cfsetspeed`, and `tcgetsid`. ([#527](https://github.com/nix-rust/nix/pull/527)) +- Added "bad none", "bad write_ptr", "bad write_int", and "bad readwrite" variants to the `ioctl!` + macro. ([#670](https://github.com/nix-rust/nix/pull/670)) +- On Linux and Android, added support for receiving `PTRACE_O_TRACESYSGOOD` + events from `wait` and `waitpid` using `WaitStatus::PtraceSyscall` + ([#566](https://github.com/nix-rust/nix/pull/566)). + +### Changed +- The `ioctl!` macro and its variants now allow the generated functions to have + doccomments. ([#661](https://github.com/nix-rust/nix/pull/661)) +- Changed `ioctl!(write ...)` into `ioctl!(write_ptr ...)` and `ioctl!(write_int ..)` variants + to more clearly separate those use cases. ([#670](https://github.com/nix-rust/nix/pull/670)) +- Marked `sys::mman::{ mmap, munmap, madvise, munlock, msync }` as unsafe. + ([#559](https://github.com/nix-rust/nix/pull/559)) +- Minimum supported Rust version is now 1.13. +- Removed `revents` argument from `PollFd::new()` as it's an output argument and + will be overwritten regardless of value. + ([#542](https://github.com/nix-rust/nix/pull/542)) +- Changed type signature of `sys::select::FdSet::contains` to make `self` + immutable ([#564](https://github.com/nix-rust/nix/pull/564)) +- Introduced wrapper types for `gid_t`, `pid_t`, and `uid_t` as `Gid`, `Pid`, and `Uid` + respectively. Various functions have been changed to use these new types as + arguments. ([#629](https://github.com/nix-rust/nix/pull/629)) +- Fixed compilation on all Android and iOS targets ([#527](https://github.com/nix-rust/nix/pull/527)) + and promoted them to Tier 2 support. +- `nix::sys::statfs::{statfs,fstatfs}` uses statfs definition from `libc::statfs` instead of own linux specific type `nix::sys::Statfs`. + Also file system type constants like `nix::sys::statfs::ADFS_SUPER_MAGIC` were removed in favor of the libc equivalent. + ([#561](https://github.com/nix-rust/nix/pull/561)) +- Revised the termios API including additional tests and documentation and exposed it on iOS. ([#527](https://github.com/nix-rust/nix/pull/527)) +- `eventfd`, `signalfd`, and `pwritev`/`preadv` functionality is now included by default for all + supported platforms. ([#681](https://github.com/nix-rust/nix/pull/561)) +- The `ioctl!` macro's plain variants has been replaced with "bad read" to be consistent with + other variants. The generated functions also have more strict types for their arguments. The + "*_buf" variants also now calculate total array size and take slice references for improved type + safety. The documentation has also been dramatically improved. + ([#670](https://github.com/nix-rust/nix/pull/670)) + +### Removed +- Removed `io::Error` from `nix::Error` and the conversion from `nix::Error` to `Errno` + ([#614](https://github.com/nix-rust/nix/pull/614)) +- All feature flags have been removed in favor of conditional compilation on supported platforms. + `execvpe` is no longer supported, but this was already broken and will be added back in the next + release. ([#681](https://github.com/nix-rust/nix/pull/561)) +- Removed `ioc_*` functions and many helper constants and macros within the `ioctl` module. These + should always have been private and only the `ioctl!` should be used in public code. + ([#670](https://github.com/nix-rust/nix/pull/670)) + +### Fixed +- Fixed multiple issues compiling under different archetectures and OSes. + Now compiles on Linux/MIPS ([#538](https://github.com/nix-rust/nix/pull/538)), + `Linux/PPC` ([#553](https://github.com/nix-rust/nix/pull/553)), + `MacOS/x86_64,i686` ([#553](https://github.com/nix-rust/nix/pull/553)), + `NetBSD/x64_64` ([#538](https://github.com/nix-rust/nix/pull/538)), + `FreeBSD/x86_64,i686` ([#536](https://github.com/nix-rust/nix/pull/536)), and + `Android` ([#631](https://github.com/nix-rust/nix/pull/631)). +- `bind` and `errno_location` now work correctly on `Android` + ([#631](https://github.com/nix-rust/nix/pull/631)) +- Added `nix::ptrace` on all Linux-kernel-based platforms + [#624](https://github.com/nix-rust/nix/pull/624). Previously it was + only available on x86, x86-64, and ARM, and also not on Android. +- Fixed `sys::socket::sendmsg` with zero entry `cmsgs` parameter. + ([#623](https://github.com/nix-rust/nix/pull/623)) +- Multiple constants related to the termios API have now been properly defined for + all supported platforms. ([#527](https://github.com/nix-rust/nix/pull/527)) +- `ioctl!` macro now supports working with non-int datatypes and properly supports all platforms. + ([#670](https://github.com/nix-rust/nix/pull/670)) + +## [0.8.1] 2017-04-16 + +### Fixed +- Fixed build on FreeBSD. (Cherry-picked + [a859ee3c](https://github.com/nix-rust/nix/commit/a859ee3c9396dfdb118fcc2c8ecc697e2d303467)) + +## [0.8.0] 2017-03-02 + +### Added +- Added `::nix::sys::termios::BaudRate` enum to provide portable baudrate + values. ([#518](https://github.com/nix-rust/nix/pull/518)) +- Added a new `WaitStatus::PtraceEvent` to support ptrace events on Linux + and Android ([#438](https://github.com/nix-rust/nix/pull/438)) +- Added support for POSIX AIO + ([#483](https://github.com/nix-rust/nix/pull/483)) + ([#506](https://github.com/nix-rust/nix/pull/506)) +- Added support for XNU system control sockets + ([#478](https://github.com/nix-rust/nix/pull/478)) +- Added support for `ioctl` calls on BSD platforms + ([#478](https://github.com/nix-rust/nix/pull/478)) +- Added struct `TimeSpec` + ([#475](https://github.com/nix-rust/nix/pull/475)) + ([#483](https://github.com/nix-rust/nix/pull/483)) +- Added complete definitions for all kqueue-related constants on all supported + OSes + ([#415](https://github.com/nix-rust/nix/pull/415)) +- Added function `epoll_create1` and bitflags `EpollCreateFlags` in + `::nix::sys::epoll` in order to support `::libc::epoll_create1`. + ([#410](https://github.com/nix-rust/nix/pull/410)) +- Added `setresuid` and `setresgid` for Linux in `::nix::unistd` + ([#448](https://github.com/nix-rust/nix/pull/448)) +- Added `getpgid` in `::nix::unistd` + ([#433](https://github.com/nix-rust/nix/pull/433)) +- Added `tcgetpgrp` and `tcsetpgrp` in `::nix::unistd` + ([#451](https://github.com/nix-rust/nix/pull/451)) +- Added `CLONE_NEWCGROUP` in `::nix::sched` + ([#457](https://github.com/nix-rust/nix/pull/457)) +- Added `getpgrp` in `::nix::unistd` + ([#491](https://github.com/nix-rust/nix/pull/491)) +- Added `fchdir` in `::nix::unistd` + ([#497](https://github.com/nix-rust/nix/pull/497)) +- Added `major` and `minor` in `::nix::sys::stat` for decomposing `dev_t` + ([#508](https://github.com/nix-rust/nix/pull/508)) +- Fixed the style of many bitflags and use `libc` in more places. + ([#503](https://github.com/nix-rust/nix/pull/503)) +- Added `ppoll` in `::nix::poll` + ([#520](https://github.com/nix-rust/nix/pull/520)) +- Added support for getting and setting pipe size with fcntl(2) on Linux + ([#540](https://github.com/nix-rust/nix/pull/540)) + +### Changed +- `::nix::sys::termios::{cfgetispeed, cfsetispeed, cfgetospeed, cfsetospeed}` + switched to use `BaudRate` enum from `speed_t`. + ([#518](https://github.com/nix-rust/nix/pull/518)) +- `epoll_ctl` now could accept None as argument `event` + when op is `EpollOp::EpollCtlDel`. + ([#480](https://github.com/nix-rust/nix/pull/480)) +- Removed the `bad` keyword from the `ioctl!` macro + ([#478](https://github.com/nix-rust/nix/pull/478)) +- Changed `TimeVal` into an opaque Newtype + ([#475](https://github.com/nix-rust/nix/pull/475)) +- `kill`'s signature, defined in `::nix::sys::signal`, changed, so that the + signal parameter has type `T: Into>`. `None` as an argument + for that parameter will result in a 0 passed to libc's `kill`, while a + `Some`-argument will result in the previous behavior for the contained + `Signal`. + ([#445](https://github.com/nix-rust/nix/pull/445)) +- The minimum supported version of rustc is now 1.7.0. + ([#444](https://github.com/nix-rust/nix/pull/444)) +- Changed `KEvent` to an opaque structure that may only be modified by its + constructor and the `ev_set` method. + ([#415](https://github.com/nix-rust/nix/pull/415)) + ([#442](https://github.com/nix-rust/nix/pull/442)) + ([#463](https://github.com/nix-rust/nix/pull/463)) +- `pipe2` now calls `libc::pipe2` where available. Previously it was emulated + using `pipe`, which meant that setting `O_CLOEXEC` was not atomic. + ([#427](https://github.com/nix-rust/nix/pull/427)) +- Renamed `EpollEventKind` to `EpollFlags` in `::nix::sys::epoll` in order for + it to conform with our conventions. + ([#410](https://github.com/nix-rust/nix/pull/410)) +- `EpollEvent` in `::nix::sys::epoll` is now an opaque proxy for + `::libc::epoll_event`. The formerly public field `events` is now be read-only + accessible with the new method `events()` of `EpollEvent`. Instances of + `EpollEvent` can be constructed using the new method `new()` of EpollEvent. + ([#410](https://github.com/nix-rust/nix/pull/410)) +- `SigFlags` in `::nix::sys::signal` has be renamed to `SigmaskHow` and its type + has changed from `bitflags` to `enum` in order to conform to our conventions. + ([#460](https://github.com/nix-rust/nix/pull/460)) +- `sethostname` now takes a `&str` instead of a `&[u8]` as this provides an API + that makes more sense in normal, correct usage of the API. +- `gethostname` previously did not expose the actual length of the hostname + written from the underlying system call at all. This has been updated to + return a `&CStr` within the provided buffer that is always properly + NUL-terminated (this is not guaranteed by the call with all platforms/libc + implementations). +- Exposed all fcntl(2) operations at the module level, so they can be + imported direclty instead of via `FcntlArg` enum. + ([#541](https://github.com/nix-rust/nix/pull/541)) + +### Fixed +- Fixed multiple issues with Unix domain sockets on non-Linux OSes + ([#474](https://github.com/nix-rust/nix/pull/415)) +- Fixed using kqueue with `EVFILT_USER` on FreeBSD + ([#415](https://github.com/nix-rust/nix/pull/415)) +- Fixed the build on FreeBSD, and fixed the getsockopt, sendmsg, and recvmsg + functions on that same OS. + ([#397](https://github.com/nix-rust/nix/pull/397)) +- Fixed an off-by-one bug in `UnixAddr::new_abstract` in `::nix::sys::socket`. + ([#429](https://github.com/nix-rust/nix/pull/429)) +- Fixed clone passing a potentially unaligned stack. + ([#490](https://github.com/nix-rust/nix/pull/490)) +- Fixed mkdev not creating a `dev_t` the same way as libc. + ([#508](https://github.com/nix-rust/nix/pull/508)) + +## [0.7.0] 2016-09-09 + +### Added +- Added `lseek` and `lseek64` in `::nix::unistd` + ([#377](https://github.com/nix-rust/nix/pull/377)) +- Added `mkdir` and `getcwd` in `::nix::unistd` + ([#416](https://github.com/nix-rust/nix/pull/416)) +- Added accessors `sigmask_mut` and `sigmask` to `UContext` in + `::nix::ucontext`. + ([#370](https://github.com/nix-rust/nix/pull/370)) +- Added `WUNTRACED` to `WaitPidFlag` in `::nix::sys::wait` for non-_linux_ + targets. + ([#379](https://github.com/nix-rust/nix/pull/379)) +- Added new module `::nix::sys::reboot` with enumeration `RebootMode` and + functions `reboot` and `set_cad_enabled`. Currently for _linux_ only. + ([#386](https://github.com/nix-rust/nix/pull/386)) +- `FdSet` in `::nix::sys::select` now also implements `Clone`. + ([#405](https://github.com/nix-rust/nix/pull/405)) +- Added `F_FULLFSYNC` to `FcntlArg` in `::nix::fcntl` for _apple_ targets. + ([#407](https://github.com/nix-rust/nix/pull/407)) +- Added `CpuSet::unset` in `::nix::sched`. + ([#402](https://github.com/nix-rust/nix/pull/402)) +- Added constructor method `new()` to `PollFd` in `::nix::poll`, in order to + allow creation of objects, after removing public access to members. + ([#399](https://github.com/nix-rust/nix/pull/399)) +- Added method `revents()` to `PollFd` in `::nix::poll`, in order to provide + read access to formerly public member `revents`. + ([#399](https://github.com/nix-rust/nix/pull/399)) +- Added `MSG_CMSG_CLOEXEC` to `MsgFlags` in `::nix::sys::socket` for _linux_ only. + ([#422](https://github.com/nix-rust/nix/pull/422)) + +### Changed +- Replaced the reexported integer constants for signals by the enumeration + `Signal` in `::nix::sys::signal`. + ([#362](https://github.com/nix-rust/nix/pull/362)) +- Renamed `EventFdFlag` to `EfdFlags` in `::nix::sys::eventfd`. + ([#383](https://github.com/nix-rust/nix/pull/383)) +- Changed the result types of `CpuSet::is_set` and `CpuSet::set` in + `::nix::sched` to `Result` and `Result<()>`, respectively. They now + return `EINVAL`, if an invalid argument for the `field` parameter is passed. + ([#402](https://github.com/nix-rust/nix/pull/402)) +- `MqAttr` in `::nix::mqueue` is now an opaque proxy for `::libc::mq_attr`, + which has the same structure as the old `MqAttr`. The field `mq_flags` of + `::libc::mq_attr` is readable using the new method `flags()` of `MqAttr`. + `MqAttr` also no longer implements `Debug`. + ([#392](https://github.com/nix-rust/nix/pull/392)) +- The parameter `msq_prio` of `mq_receive` with type `u32` in `::nix::mqueue` + was replaced by a parameter named `msg_prio` with type `&mut u32`, so that + the message priority can be obtained by the caller. + ([#392](https://github.com/nix-rust/nix/pull/392)) +- The type alias `MQd` in `::nix::queue` was replaced by the type alias + `libc::mqd_t`, both of which are aliases for the same type. + ([#392](https://github.com/nix-rust/nix/pull/392)) + +### Removed +- Type alias `SigNum` from `::nix::sys::signal`. + ([#362](https://github.com/nix-rust/nix/pull/362)) +- Type alias `CpuMask` from `::nix::shed`. + ([#402](https://github.com/nix-rust/nix/pull/402)) +- Removed public fields from `PollFd` in `::nix::poll`. (See also added method + `revents()`. + ([#399](https://github.com/nix-rust/nix/pull/399)) + +### Fixed +- Fixed the build problem for NetBSD (Note, that we currently do not support + it, so it might already be broken again). + ([#389](https://github.com/nix-rust/nix/pull/389)) +- Fixed the build on FreeBSD, and fixed the getsockopt, sendmsg, and recvmsg + functions on that same OS. + ([#397](https://github.com/nix-rust/nix/pull/397)) + +## [0.6.0] 2016-06-10 + +### Added +- Added `gettid` in `::nix::unistd` for _linux_ and _android_. + ([#293](https://github.com/nix-rust/nix/pull/293)) +- Some _mips_ support in `::nix::sched` and `::nix::sys::syscall`. + ([#301](https://github.com/nix-rust/nix/pull/301)) +- Added `SIGNALFD_SIGINFO_SIZE` in `::nix::sys::signalfd`. + ([#309](https://github.com/nix-rust/nix/pull/309)) +- Added new module `::nix::ucontext` with struct `UContext`. Currently for + _linux_ only. + ([#311](https://github.com/nix-rust/nix/pull/311)) +- Added `EPOLLEXCLUSIVE` to `EpollEventKind` in `::nix::sys::epoll`. + ([#330](https://github.com/nix-rust/nix/pull/330)) +- Added `pause` to `::nix::unistd`. + ([#336](https://github.com/nix-rust/nix/pull/336)) +- Added `sleep` to `::nix::unistd`. + ([#351](https://github.com/nix-rust/nix/pull/351)) +- Added `S_IFDIR`, `S_IFLNK`, `S_IFMT` to `SFlag` in `::nix::sys::stat`. + ([#359](https://github.com/nix-rust/nix/pull/359)) +- Added `clear` and `extend` functions to `SigSet`'s implementation in + `::nix::sys::signal`. + ([#347](https://github.com/nix-rust/nix/pull/347)) +- `sockaddr_storage_to_addr` in `::nix::sys::socket` now supports `sockaddr_nl` + on _linux_ and _android_. + ([#366](https://github.com/nix-rust/nix/pull/366)) +- Added support for `SO_ORIGINAL_DST` in `::nix::sys::socket` on _linux_. + ([#367](https://github.com/nix-rust/nix/pull/367)) +- Added `SIGINFO` in `::nix::sys::signal` for the _macos_ target as well as + `SIGPWR` and `SIGSTKFLT` in `::nix::sys::signal` for non-_macos_ targets. + ([#361](https://github.com/nix-rust/nix/pull/361)) + +### Changed +- Changed the structure `IoVec` in `::nix::sys::uio`. + ([#304](https://github.com/nix-rust/nix/pull/304)) +- Replaced `CREATE_NEW_FD` by `SIGNALFD_NEW` in `::nix::sys::signalfd`. + ([#309](https://github.com/nix-rust/nix/pull/309)) +- Renamed `SaFlag` to `SaFlags` and `SigFlag` to `SigFlags` in + `::nix::sys::signal`. + ([#314](https://github.com/nix-rust/nix/pull/314)) +- Renamed `Fork` to `ForkResult` and changed its fields in `::nix::unistd`. + ([#332](https://github.com/nix-rust/nix/pull/332)) +- Added the `signal` parameter to `clone`'s signature in `::nix::sched`. + ([#344](https://github.com/nix-rust/nix/pull/344)) +- `execv`, `execve`, and `execvp` now return `Result` instead of + `Result<()>` in `::nix::unistd`. + ([#357](https://github.com/nix-rust/nix/pull/357)) + +### Fixed +- Improved the conversion from `std::net::SocketAddr` to `InetAddr` in + `::nix::sys::socket::addr`. + ([#335](https://github.com/nix-rust/nix/pull/335)) + +## [0.5.0] 2016-03-01 diff --git a/bash-5.1/vendor/nix/Cargo.toml b/bash-5.1/vendor/nix/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..21b316c656f3edf4772d56bc182f49e26c6c9e87 --- /dev/null +++ b/bash-5.1/vendor/nix/Cargo.toml @@ -0,0 +1,185 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2018" +rust-version = "1.46" +name = "nix" +version = "0.25.0" +authors = ["The nix-rust Project Developers"] +include = [ + "src/**/*", + "test/**/*", + "LICENSE", + "README.md", + "CHANGELOG.md", +] +description = "Rust friendly bindings to *nix APIs" +readme = "README.md" +categories = ["os::unix-apis"] +license = "MIT" +repository = "https://github.com/nix-rust/nix" + +[package.metadata.docs.rs] +rustdoc-args = [ + "--cfg", + "docsrs", +] +targets = [ + "x86_64-unknown-linux-gnu", + "aarch64-linux-android", + "x86_64-apple-darwin", + "aarch64-apple-ios", + "x86_64-unknown-freebsd", + "x86_64-unknown-openbsd", + "x86_64-unknown-netbsd", + "x86_64-unknown-dragonfly", + "x86_64-fuchsia", + "x86_64-unknown-redox", + "x86_64-unknown-illumos", +] + +[[test]] +name = "test" +path = "test/test.rs" + +[[test]] +name = "test-aio-drop" +path = "test/sys/test_aio_drop.rs" + +[[test]] +name = "test-clearenv" +path = "test/test_clearenv.rs" + +[[test]] +name = "test-mount" +path = "test/test_mount.rs" +harness = false + +[[test]] +name = "test-ptymaster-drop" +path = "test/test_ptymaster_drop.rs" + +[dependencies.bitflags] +version = "1.1" + +[dependencies.cfg-if] +version = "1.0" + +[dependencies.libc] +version = "0.2.127" +features = ["extra_traits"] + +[dependencies.pin-utils] +version = "0.1.0" +optional = true + +[dev-dependencies.assert-impl] +version = "0.1" + +[dev-dependencies.lazy_static] +version = "1.4" + +[dev-dependencies.parking_lot] +version = "0.11.2" + +[dev-dependencies.rand] +version = "0.8" + +[dev-dependencies.semver] +version = "1.0.7" + +[dev-dependencies.tempfile] +version = "3.3.0" + +[build-dependencies.autocfg] +version = "1.1.0" + +[features] +acct = [] +aio = ["pin-utils"] +default = [ + "acct", + "aio", + "dir", + "env", + "event", + "feature", + "fs", + "hostname", + "inotify", + "ioctl", + "kmod", + "mman", + "mount", + "mqueue", + "net", + "personality", + "poll", + "process", + "pthread", + "ptrace", + "quota", + "reboot", + "resource", + "sched", + "signal", + "socket", + "term", + "time", + "ucontext", + "uio", + "user", + "zerocopy", +] +dir = ["fs"] +env = [] +event = [] +feature = [] +fs = [] +hostname = [] +inotify = [] +ioctl = [] +kmod = [] +mman = [] +mount = ["uio"] +mqueue = ["fs"] +net = ["socket"] +personality = [] +poll = [] +process = [] +pthread = [] +ptrace = ["process"] +quota = [] +reboot = [] +resource = [] +sched = ["process"] +signal = ["process"] +socket = ["memoffset"] +term = [] +time = [] +ucontext = ["signal"] +uio = [] +user = ["feature"] +zerocopy = [ + "fs", + "uio", +] + +[target."cfg(any(target_os = \"android\", target_os = \"linux\"))".dev-dependencies.caps] +version = "0.5.3" + +[target."cfg(not(target_os = \"redox\"))".dependencies.memoffset] +version = "0.6.3" +optional = true + +[target."cfg(target_os = \"freebsd\")".dev-dependencies.sysctl] +version = "0.4" diff --git a/bash-5.1/vendor/nix/LICENSE b/bash-5.1/vendor/nix/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..aff9096fdf11d161613202fe9329fcfa5e35d212 --- /dev/null +++ b/bash-5.1/vendor/nix/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Carl Lerche + nix-rust Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/bash-5.1/vendor/nix/README.md b/bash-5.1/vendor/nix/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7c13cf201c369aafa3eb6ed75fe4dd10e0915986 --- /dev/null +++ b/bash-5.1/vendor/nix/README.md @@ -0,0 +1,105 @@ +# Rust bindings to *nix APIs + +[![Cirrus Build Status](https://api.cirrus-ci.com/github/nix-rust/nix.svg)](https://cirrus-ci.com/github/nix-rust/nix) +[![crates.io](https://img.shields.io/crates/v/nix.svg)](https://crates.io/crates/nix) + +[Documentation (Releases)](https://docs.rs/nix/) + +Nix seeks to provide friendly bindings to various *nix platform APIs (Linux, Darwin, +...). The goal is to not provide a 100% unified interface, but to unify +what can be while still providing platform specific APIs. + +For many system APIs, Nix provides a safe alternative to the unsafe APIs +exposed by the [libc crate](https://github.com/rust-lang/libc). This is done by +wrapping the libc functionality with types/abstractions that enforce legal/safe +usage. + + +As an example of what Nix provides, examine the differences between what is +exposed by libc and nix for the +[gethostname](https://man7.org/linux/man-pages/man2/gethostname.2.html) system +call: + +```rust,ignore +// libc api (unsafe, requires handling return code/errno) +pub unsafe extern fn gethostname(name: *mut c_char, len: size_t) -> c_int; + +// nix api (returns a nix::Result) +pub fn gethostname() -> Result; +``` + +## Supported Platforms + +nix target support consists of two tiers. While nix attempts to support all +platforms supported by [libc](https://github.com/rust-lang/libc), only some +platforms are actively supported due to either technical or manpower +limitations. Support for platforms is split into three tiers: + + * Tier 1 - Builds and tests for this target are run in CI. Failures of either + block the inclusion of new code. + * Tier 2 - Builds for this target are run in CI. Failures during the build + blocks the inclusion of new code. Tests may be run, but failures + in tests don't block the inclusion of new code. + * Tier 3 - Builds for this target are run in CI. Failures during the build + *do not* block the inclusion of new code. Testing may be run, but + failures in tests don't block the inclusion of new code. + +The following targets are supported by `nix`: + +Tier 1: + * aarch64-unknown-linux-gnu + * arm-unknown-linux-gnueabi + * armv7-unknown-linux-gnueabihf + * i686-unknown-freebsd + * i686-unknown-linux-gnu + * i686-unknown-linux-musl + * mips-unknown-linux-gnu + * mips64-unknown-linux-gnuabi64 + * mips64el-unknown-linux-gnuabi64 + * mipsel-unknown-linux-gnu + * powerpc64le-unknown-linux-gnu + * x86_64-apple-darwin + * x86_64-unknown-freebsd + * x86_64-unknown-linux-gnu + * x86_64-unknown-linux-musl + +Tier 2: + * aarch64-apple-darwin + * aarch64-apple-ios + * aarch64-linux-android + * arm-linux-androideabi + * arm-unknown-linux-musleabi + * armv7-linux-androideabi + * i686-linux-android + * powerpc-unknown-linux-gnu + * s390x-unknown-linux-gnu + * x86_64-apple-ios + * x86_64-linux-android + * x86_64-unknown-illumos + * x86_64-unknown-netbsd + +Tier 3: + * armv7-unknown-linux-uclibceabihf + * x86_64-fuchsia + * x86_64-unknown-dragonfly + * x86_64-unknown-haiku + * x86_64-unknown-linux-gnux32 + * x86_64-unknown-openbsd + * x86_64-unknown-redox + +## Minimum Supported Rust Version (MSRV) + +nix is supported on Rust 1.46.0 and higher. Its MSRV will not be +changed in the future without bumping the major or minor version. + +## Contributing + +Contributions are very welcome. Please See [CONTRIBUTING](CONTRIBUTING.md) for +additional details. + +Feel free to join us in [the nix-rust/nix](https://gitter.im/nix-rust/nix) channel on Gitter to +discuss `nix` development. + +## License + +Nix is licensed under the MIT license. See [LICENSE](LICENSE) for more details. diff --git a/bash-5.1/vendor/nix/src/dir.rs b/bash-5.1/vendor/nix/src/dir.rs new file mode 100644 index 0000000000000000000000000000000000000000..6d5fc3b9252c4b379d1031c2eff49567e3487e9b --- /dev/null +++ b/bash-5.1/vendor/nix/src/dir.rs @@ -0,0 +1,257 @@ +//! List directory contents + +use crate::{Error, NixPath, Result}; +use crate::errno::Errno; +use crate::fcntl::{self, OFlag}; +use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd}; +use std::ptr; +use std::ffi; +use crate::sys; +use cfg_if::cfg_if; + +#[cfg(target_os = "linux")] +use libc::{dirent64 as dirent, readdir64_r as readdir_r}; + +#[cfg(not(target_os = "linux"))] +use libc::{dirent, readdir_r}; + +/// An open directory. +/// +/// This is a lower-level interface than `std::fs::ReadDir`. Notable differences: +/// * can be opened from a file descriptor (as returned by `openat`, perhaps before knowing +/// if the path represents a file or directory). +/// * implements `AsRawFd`, so it can be passed to `fstat`, `openat`, etc. +/// The file descriptor continues to be owned by the `Dir`, so callers must not keep a `RawFd` +/// after the `Dir` is dropped. +/// * can be iterated through multiple times without closing and reopening the file +/// descriptor. Each iteration rewinds when finished. +/// * returns entries for `.` (current directory) and `..` (parent directory). +/// * returns entries' names as a `CStr` (no allocation or conversion beyond whatever libc +/// does). +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct Dir( + ptr::NonNull +); + +impl Dir { + /// Opens the given path as with `fcntl::open`. + pub fn open(path: &P, oflag: OFlag, + mode: sys::stat::Mode) -> Result { + let fd = fcntl::open(path, oflag, mode)?; + Dir::from_fd(fd) + } + + /// Opens the given path as with `fcntl::openat`. + pub fn openat(dirfd: RawFd, path: &P, oflag: OFlag, + mode: sys::stat::Mode) -> Result { + let fd = fcntl::openat(dirfd, path, oflag, mode)?; + Dir::from_fd(fd) + } + + /// Converts from a descriptor-based object, closing the descriptor on success or failure. + #[inline] + pub fn from(fd: F) -> Result { + Dir::from_fd(fd.into_raw_fd()) + } + + /// Converts from a file descriptor, closing it on success or failure. + #[cfg_attr(has_doc_alias, doc(alias("fdopendir")))] + pub fn from_fd(fd: RawFd) -> Result { + let d = ptr::NonNull::new(unsafe { libc::fdopendir(fd) }).ok_or_else(|| { + let e = Error::last(); + unsafe { libc::close(fd) }; + e + })?; + Ok(Dir(d)) + } + + /// Returns an iterator of `Result` which rewinds when finished. + pub fn iter(&mut self) -> Iter { + Iter(self) + } +} + +// `Dir` is not `Sync`. With the current implementation, it could be, but according to +// https://www.gnu.org/software/libc/manual/html_node/Reading_002fClosing-Directory.html, +// future versions of POSIX are likely to obsolete `readdir_r` and specify that it's unsafe to +// call `readdir` simultaneously from multiple threads. +// +// `Dir` is safe to pass from one thread to another, as it's not reference-counted. +unsafe impl Send for Dir {} + +impl AsRawFd for Dir { + fn as_raw_fd(&self) -> RawFd { + unsafe { libc::dirfd(self.0.as_ptr()) } + } +} + +impl Drop for Dir { + fn drop(&mut self) { + let e = Errno::result(unsafe { libc::closedir(self.0.as_ptr()) }); + if !std::thread::panicking() && e == Err(Errno::EBADF) { + panic!("Closing an invalid file descriptor!"); + }; + } +} + +fn next(dir: &mut Dir) -> Option> { + unsafe { + // Note: POSIX specifies that portable applications should dynamically allocate a + // buffer with room for a `d_name` field of size `pathconf(..., _PC_NAME_MAX)` plus 1 + // for the NUL byte. It doesn't look like the std library does this; it just uses + // fixed-sized buffers (and libc's dirent seems to be sized so this is appropriate). + // Probably fine here too then. + let mut ent = std::mem::MaybeUninit::::uninit(); + let mut result = ptr::null_mut(); + if let Err(e) = Errno::result( + readdir_r(dir.0.as_ptr(), ent.as_mut_ptr(), &mut result)) + { + return Some(Err(e)); + } + if result.is_null() { + return None; + } + assert_eq!(result, ent.as_mut_ptr()); + Some(Ok(Entry(ent.assume_init()))) + } +} + +/// Return type of [`Dir::iter`]. +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct Iter<'d>(&'d mut Dir); + +impl<'d> Iterator for Iter<'d> { + type Item = Result; + + fn next(&mut self) -> Option { + next(self.0) + } +} + +impl<'d> Drop for Iter<'d> { + fn drop(&mut self) { + unsafe { libc::rewinddir((self.0).0.as_ptr()) } + } +} + +/// The return type of [Dir::into_iter] +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct OwningIter(Dir); + +impl Iterator for OwningIter { + type Item = Result; + + fn next(&mut self) -> Option { + next(&mut self.0) + } +} + +/// The file descriptor continues to be owned by the `OwningIter`, +/// so callers must not keep a `RawFd` after the `OwningIter` is dropped. +impl AsRawFd for OwningIter { + fn as_raw_fd(&self) -> RawFd { + self.0.as_raw_fd() + } +} + +impl IntoIterator for Dir { + type Item = Result; + type IntoIter = OwningIter; + + /// Creates a owning iterator, that is, one that takes ownership of the + /// `Dir`. The `Dir` cannot be used after calling this. This can be useful + /// when you have a function that both creates a `Dir` instance and returns + /// an `Iterator`. + /// + /// Example: + /// + /// ``` + /// use nix::{dir::Dir, fcntl::OFlag, sys::stat::Mode}; + /// use std::{iter::Iterator, string::String}; + /// + /// fn ls_upper(dirname: &str) -> impl Iterator { + /// let d = Dir::open(dirname, OFlag::O_DIRECTORY, Mode::S_IXUSR).unwrap(); + /// d.into_iter().map(|x| x.unwrap().file_name().as_ref().to_string_lossy().to_ascii_uppercase()) + /// } + /// ``` + fn into_iter(self) -> Self::IntoIter { + OwningIter(self) + } +} + +/// A directory entry, similar to `std::fs::DirEntry`. +/// +/// Note that unlike the std version, this may represent the `.` or `..` entries. +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct Entry(dirent); + +/// Type of file referenced by a directory entry +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] +pub enum Type { + /// FIFO (Named pipe) + Fifo, + /// Character device + CharacterDevice, + /// Directory + Directory, + /// Block device + BlockDevice, + /// Regular file + File, + /// Symbolic link + Symlink, + /// Unix-domain socket + Socket, +} + +impl Entry { + /// Returns the inode number (`d_ino`) of the underlying `dirent`. + #[allow(clippy::useless_conversion)] // Not useless on all OSes + pub fn ino(&self) -> u64 { + cfg_if! { + if #[cfg(any(target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "ios", + target_os = "l4re", + target_os = "linux", + target_os = "macos", + target_os = "solaris"))] { + self.0.d_ino as u64 + } else { + u64::from(self.0.d_fileno) + } + } + } + + /// Returns the bare file name of this directory entry without any other leading path component. + pub fn file_name(&self) -> &ffi::CStr { + unsafe { ::std::ffi::CStr::from_ptr(self.0.d_name.as_ptr()) } + } + + /// Returns the type of this directory entry, if known. + /// + /// See platform `readdir(3)` or `dirent(5)` manpage for when the file type is known; + /// notably, some Linux filesystems don't implement this. The caller should use `stat` or + /// `fstat` if this returns `None`. + pub fn file_type(&self) -> Option { + #[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "haiku")))] + match self.0.d_type { + libc::DT_FIFO => Some(Type::Fifo), + libc::DT_CHR => Some(Type::CharacterDevice), + libc::DT_DIR => Some(Type::Directory), + libc::DT_BLK => Some(Type::BlockDevice), + libc::DT_REG => Some(Type::File), + libc::DT_LNK => Some(Type::Symlink), + libc::DT_SOCK => Some(Type::Socket), + /* libc::DT_UNKNOWN | */ _ => None, + } + + // illumos, Solaris, and Haiku systems do not have the d_type member at all: + #[cfg(any(target_os = "illumos", target_os = "solaris", target_os = "haiku"))] + None + } +} diff --git a/bash-5.1/vendor/nix/src/env.rs b/bash-5.1/vendor/nix/src/env.rs new file mode 100644 index 0000000000000000000000000000000000000000..95177a1d2a1aae9dd5126acda468679af8cd84d9 --- /dev/null +++ b/bash-5.1/vendor/nix/src/env.rs @@ -0,0 +1,64 @@ +//! Environment variables +use cfg_if::cfg_if; +use std::fmt; + +/// Indicates that [`clearenv`] failed for some unknown reason +#[derive(Clone, Copy, Debug)] +pub struct ClearEnvError; + +impl fmt::Display for ClearEnvError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "clearenv failed") + } +} + +impl std::error::Error for ClearEnvError {} + +/// Clear the environment of all name-value pairs. +/// +/// On platforms where libc provides `clearenv()`, it will be used. libc's +/// `clearenv()` is documented to return an error code but not set errno; if the +/// return value indicates a failure, this function will return +/// [`ClearEnvError`]. +/// +/// On platforms where libc does not provide `clearenv()`, a fallback +/// implementation will be used that iterates over all environment variables and +/// removes them one-by-one. +/// +/// # Safety +/// +/// This function is not threadsafe and can cause undefined behavior in +/// combination with `std::env` or other program components that access the +/// environment. See, for example, the discussion on `std::env::remove_var`; this +/// function is a case of an "inherently unsafe non-threadsafe API" dealing with +/// the environment. +/// +/// The caller must ensure no other threads access the process environment while +/// this function executes and that no raw pointers to an element of libc's +/// `environ` is currently held. The latter is not an issue if the only other +/// environment access in the program is via `std::env`, but the requirement on +/// thread safety must still be upheld. +pub unsafe fn clearenv() -> std::result::Result<(), ClearEnvError> { + cfg_if! { + if #[cfg(any(target_os = "fuchsia", + target_os = "wasi", + target_env = "uclibc", + target_os = "linux", + target_os = "android", + target_os = "emscripten"))] { + let ret = libc::clearenv(); + } else { + use std::env; + for (name, _) in env::vars_os() { + env::remove_var(name); + } + let ret = 0; + } + } + + if ret == 0 { + Ok(()) + } else { + Err(ClearEnvError) + } +} diff --git a/bash-5.1/vendor/nix/src/errno.rs b/bash-5.1/vendor/nix/src/errno.rs new file mode 100644 index 0000000000000000000000000000000000000000..912fb94f55f22a9edb30b83dc6d200402bb02eb6 --- /dev/null +++ b/bash-5.1/vendor/nix/src/errno.rs @@ -0,0 +1,3286 @@ +use crate::{Error, Result}; +use cfg_if::cfg_if; +use libc::{c_int, c_void}; +use std::convert::TryFrom; +use std::{error, fmt, io}; + +pub use self::consts::*; + +cfg_if! { + if #[cfg(any(target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] { + unsafe fn errno_location() -> *mut c_int { + libc::__error() + } + } else if #[cfg(any(target_os = "android", + target_os = "netbsd", + target_os = "openbsd"))] { + unsafe fn errno_location() -> *mut c_int { + libc::__errno() + } + } else if #[cfg(any(target_os = "linux", + target_os = "redox", + target_os = "dragonfly", + target_os = "fuchsia"))] { + unsafe fn errno_location() -> *mut c_int { + libc::__errno_location() + } + } else if #[cfg(any(target_os = "illumos", target_os = "solaris"))] { + unsafe fn errno_location() -> *mut c_int { + libc::___errno() + } + } else if #[cfg(any(target_os = "haiku",))] { + unsafe fn errno_location() -> *mut c_int { + libc::_errnop() + } + } +} + +/// Sets the platform-specific errno to no-error +fn clear() { + // Safe because errno is a thread-local variable + unsafe { + *errno_location() = 0; + } +} + +/// Returns the platform-specific value of errno +pub fn errno() -> i32 { + unsafe { (*errno_location()) as i32 } +} + +impl Errno { + /// Convert this `Error` to an [`Errno`](enum.Errno.html). + /// + /// # Example + /// + /// ``` + /// # use nix::Error; + /// # use nix::errno::Errno; + /// let e = Error::from(Errno::EPERM); + /// assert_eq!(Some(Errno::EPERM), e.as_errno()); + /// ``` + #[deprecated(since = "0.22.0", note = "It's a no-op now; just delete it.")] + pub const fn as_errno(self) -> Option { + Some(self) + } + + /// Create a nix Error from a given errno + #[deprecated(since = "0.22.0", note = "It's a no-op now; just delete it.")] + #[allow(clippy::wrong_self_convention)] // False positive + pub fn from_errno(errno: Errno) -> Error { + errno + } + + /// Create a new invalid argument error (`EINVAL`) + #[deprecated(since = "0.22.0", note = "Use Errno::EINVAL instead")] + pub const fn invalid_argument() -> Error { + Errno::EINVAL + } + + pub fn last() -> Self { + last() + } + + pub fn desc(self) -> &'static str { + desc(self) + } + + pub const fn from_i32(err: i32) -> Errno { + from_i32(err) + } + + pub fn clear() { + clear() + } + + /// Returns `Ok(value)` if it does not contain the sentinel value. This + /// should not be used when `-1` is not the errno sentinel value. + #[inline] + pub fn result>(value: S) -> Result { + if value == S::sentinel() { + Err(Self::last()) + } else { + Ok(value) + } + } + + /// Backwards compatibility hack for Nix <= 0.21.0 users + /// + /// In older versions of Nix, `Error::Sys` was an enum variant. Now it's a + /// function, which is compatible with most of the former use cases of the + /// enum variant. But you should use `Error(Errno::...)` instead. + #[deprecated(since = "0.22.0", note = "Use Errno::... instead")] + #[allow(non_snake_case)] + #[inline] + pub const fn Sys(errno: Errno) -> Error { + errno + } +} + +/// The sentinel value indicates that a function failed and more detailed +/// information about the error can be found in `errno` +pub trait ErrnoSentinel: Sized { + fn sentinel() -> Self; +} + +impl ErrnoSentinel for isize { + fn sentinel() -> Self { + -1 + } +} + +impl ErrnoSentinel for i32 { + fn sentinel() -> Self { + -1 + } +} + +impl ErrnoSentinel for i64 { + fn sentinel() -> Self { + -1 + } +} + +impl ErrnoSentinel for *mut c_void { + fn sentinel() -> Self { + -1isize as *mut c_void + } +} + +impl ErrnoSentinel for libc::sighandler_t { + fn sentinel() -> Self { + libc::SIG_ERR + } +} + +impl error::Error for Errno {} + +impl fmt::Display for Errno { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{:?}: {}", self, self.desc()) + } +} + +impl From for io::Error { + fn from(err: Errno) -> Self { + io::Error::from_raw_os_error(err as i32) + } +} + +impl TryFrom for Errno { + type Error = io::Error; + + fn try_from(ioerror: io::Error) -> std::result::Result { + ioerror.raw_os_error().map(Errno::from_i32).ok_or(ioerror) + } +} + +fn last() -> Errno { + Errno::from_i32(errno()) +} + +fn desc(errno: Errno) -> &'static str { + use self::Errno::*; + match errno { + UnknownErrno => "Unknown errno", + EPERM => "Operation not permitted", + ENOENT => "No such file or directory", + ESRCH => "No such process", + EINTR => "Interrupted system call", + EIO => "I/O error", + ENXIO => "No such device or address", + E2BIG => "Argument list too long", + ENOEXEC => "Exec format error", + EBADF => "Bad file number", + ECHILD => "No child processes", + EAGAIN => "Try again", + ENOMEM => "Out of memory", + EACCES => "Permission denied", + EFAULT => "Bad address", + #[cfg(not(target_os = "haiku"))] + ENOTBLK => "Block device required", + EBUSY => "Device or resource busy", + EEXIST => "File exists", + EXDEV => "Cross-device link", + ENODEV => "No such device", + ENOTDIR => "Not a directory", + EISDIR => "Is a directory", + EINVAL => "Invalid argument", + ENFILE => "File table overflow", + EMFILE => "Too many open files", + ENOTTY => "Not a typewriter", + ETXTBSY => "Text file busy", + EFBIG => "File too large", + ENOSPC => "No space left on device", + ESPIPE => "Illegal seek", + EROFS => "Read-only file system", + EMLINK => "Too many links", + EPIPE => "Broken pipe", + EDOM => "Math argument out of domain of func", + ERANGE => "Math result not representable", + EDEADLK => "Resource deadlock would occur", + ENAMETOOLONG => "File name too long", + ENOLCK => "No record locks available", + ENOSYS => "Function not implemented", + ENOTEMPTY => "Directory not empty", + ELOOP => "Too many symbolic links encountered", + ENOMSG => "No message of desired type", + EIDRM => "Identifier removed", + EINPROGRESS => "Operation now in progress", + EALREADY => "Operation already in progress", + ENOTSOCK => "Socket operation on non-socket", + EDESTADDRREQ => "Destination address required", + EMSGSIZE => "Message too long", + EPROTOTYPE => "Protocol wrong type for socket", + ENOPROTOOPT => "Protocol not available", + EPROTONOSUPPORT => "Protocol not supported", + #[cfg(not(target_os = "haiku"))] + ESOCKTNOSUPPORT => "Socket type not supported", + #[cfg(not(target_os = "haiku"))] + EPFNOSUPPORT => "Protocol family not supported", + #[cfg(not(target_os = "haiku"))] + EAFNOSUPPORT => "Address family not supported by protocol", + EADDRINUSE => "Address already in use", + EADDRNOTAVAIL => "Cannot assign requested address", + ENETDOWN => "Network is down", + ENETUNREACH => "Network is unreachable", + ENETRESET => "Network dropped connection because of reset", + ECONNABORTED => "Software caused connection abort", + ECONNRESET => "Connection reset by peer", + ENOBUFS => "No buffer space available", + EISCONN => "Transport endpoint is already connected", + ENOTCONN => "Transport endpoint is not connected", + ESHUTDOWN => "Cannot send after transport endpoint shutdown", + #[cfg(not(target_os = "haiku"))] + ETOOMANYREFS => "Too many references: cannot splice", + ETIMEDOUT => "Connection timed out", + ECONNREFUSED => "Connection refused", + EHOSTDOWN => "Host is down", + EHOSTUNREACH => "No route to host", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ECHRNG => "Channel number out of range", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EL2NSYNC => "Level 2 not synchronized", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EL3HLT => "Level 3 halted", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EL3RST => "Level 3 reset", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ELNRNG => "Link number out of range", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EUNATCH => "Protocol driver not attached", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ENOCSI => "No CSI structure available", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EL2HLT => "Level 2 halted", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EBADE => "Invalid exchange", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EBADR => "Invalid request descriptor", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EXFULL => "Exchange full", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ENOANO => "No anode", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EBADRQC => "Invalid request code", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EBADSLT => "Invalid slot", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EBFONT => "Bad font file format", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ENOSTR => "Device not a stream", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ENODATA => "No data available", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ETIME => "Timer expired", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ENOSR => "Out of streams resources", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ENONET => "Machine is not on the network", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ENOPKG => "Package not installed", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EREMOTE => "Object is remote", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ENOLINK => "Link has been severed", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EADV => "Advertise error", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ESRMNT => "Srmount error", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ECOMM => "Communication error on send", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EPROTO => "Protocol error", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EMULTIHOP => "Multihop attempted", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + EDOTDOT => "RFS specific error", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + EBADMSG => "Not a data message", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + EBADMSG => "Trying to read unreadable message", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia", + target_os = "haiku" + ))] + EOVERFLOW => "Value too large for defined data type", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ENOTUNIQ => "Name not unique on network", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EBADFD => "File descriptor in bad state", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EREMCHG => "Remote address changed", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ELIBACC => "Can not access a needed shared library", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ELIBBAD => "Accessing a corrupted shared library", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ELIBSCN => ".lib section in a.out corrupted", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ELIBMAX => "Attempting to link in too many shared libraries", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ELIBEXEC => "Cannot exec a shared library directly", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia", + target_os = "openbsd" + ))] + EILSEQ => "Illegal byte sequence", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ERESTART => "Interrupted system call should be restarted", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + ESTRPIPE => "Streams pipe error", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia" + ))] + EUSERS => "Too many users", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia", + target_os = "netbsd", + target_os = "redox" + ))] + EOPNOTSUPP => "Operation not supported on transport endpoint", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + ESTALE => "Stale file handle", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + EUCLEAN => "Structure needs cleaning", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + ENOTNAM => "Not a XENIX named type file", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + ENAVAIL => "No XENIX semaphores available", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + EISNAM => "Is a named type file", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + EREMOTEIO => "Remote I/O error", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + EDQUOT => "Quota exceeded", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia", + target_os = "openbsd", + target_os = "dragonfly" + ))] + ENOMEDIUM => "No medium found", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia", + target_os = "openbsd" + ))] + EMEDIUMTYPE => "Wrong medium type", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "illumos", + target_os = "solaris", + target_os = "fuchsia", + target_os = "haiku" + ))] + ECANCELED => "Operation canceled", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + ENOKEY => "Required key not available", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + EKEYEXPIRED => "Key has expired", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + EKEYREVOKED => "Key has been revoked", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + EKEYREJECTED => "Key was rejected by service", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + EOWNERDEAD => "Owner died", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + EOWNERDEAD => "Process died with lock", + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia" + ))] + ENOTRECOVERABLE => "State not recoverable", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + ENOTRECOVERABLE => "Lock is not recoverable", + + #[cfg(any( + all(target_os = "linux", not(target_arch = "mips")), + target_os = "fuchsia" + ))] + ERFKILL => "Operation not possible due to RF-kill", + + #[cfg(any( + all(target_os = "linux", not(target_arch = "mips")), + target_os = "fuchsia" + ))] + EHWPOISON => "Memory page has hardware error", + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + EDOOFUS => "Programming error", + + #[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "redox" + ))] + EMULTIHOP => "Multihop attempted", + + #[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "redox" + ))] + ENOLINK => "Link has been severed", + + #[cfg(target_os = "freebsd")] + ENOTCAPABLE => "Capabilities insufficient", + + #[cfg(target_os = "freebsd")] + ECAPMODE => "Not permitted in capability mode", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd" + ))] + ENEEDAUTH => "Need authenticator", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd", + target_os = "redox", + target_os = "illumos", + target_os = "solaris" + ))] + EOVERFLOW => "Value too large to be stored in data type", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "netbsd", + target_os = "redox", + target_os = "haiku" + ))] + EILSEQ => "Illegal byte sequence", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd", + target_os = "haiku" + ))] + ENOATTR => "Attribute not found", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd", + target_os = "redox", + target_os = "haiku" + ))] + EBADMSG => "Bad message", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd", + target_os = "redox", + target_os = "haiku" + ))] + EPROTO => "Protocol error", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd" + ))] + ENOTRECOVERABLE => "State not recoverable", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd" + ))] + EOWNERDEAD => "Previous owner died", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd", + target_os = "illumos", + target_os = "solaris", + target_os = "haiku" + ))] + ENOTSUP => "Operation not supported", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd" + ))] + EPROCLIM => "Too many processes", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd", + target_os = "redox" + ))] + EUSERS => "Too many users", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd", + target_os = "redox", + target_os = "illumos", + target_os = "solaris", + target_os = "haiku" + ))] + EDQUOT => "Disc quota exceeded", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd", + target_os = "redox", + target_os = "illumos", + target_os = "solaris", + target_os = "haiku" + ))] + ESTALE => "Stale NFS file handle", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd", + target_os = "redox" + ))] + EREMOTE => "Too many levels of remote in path", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd" + ))] + EBADRPC => "RPC struct is bad", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd" + ))] + ERPCMISMATCH => "RPC version wrong", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd" + ))] + EPROGUNAVAIL => "RPC prog. not avail", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd" + ))] + EPROGMISMATCH => "Program version wrong", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd" + ))] + EPROCUNAVAIL => "Bad procedure for program", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd" + ))] + EFTYPE => "Inappropriate file type or format", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd" + ))] + EAUTH => "Authentication error", + + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "openbsd", + target_os = "netbsd", + target_os = "redox" + ))] + ECANCELED => "Operation canceled", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EPWROFF => "Device power is off", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EDEVERR => "Device error, e.g. paper out", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EBADEXEC => "Bad executable", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EBADARCH => "Bad CPU type in executable", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + ESHLIBVERS => "Shared library version mismatch", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EBADMACHO => "Malformed Macho file", + + #[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "netbsd", + target_os = "haiku" + ))] + EMULTIHOP => "Reserved", + + #[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "netbsd", + target_os = "redox" + ))] + ENODATA => "No message available on STREAM", + + #[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "netbsd", + target_os = "haiku" + ))] + ENOLINK => "Reserved", + + #[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "netbsd", + target_os = "redox" + ))] + ENOSR => "No STREAM resources", + + #[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "netbsd", + target_os = "redox" + ))] + ENOSTR => "Not a STREAM", + + #[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "netbsd", + target_os = "redox" + ))] + ETIME => "STREAM ioctl timeout", + + #[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "illumos", + target_os = "solaris" + ))] + EOPNOTSUPP => "Operation not supported on socket", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + ENOPOLICY => "No such policy registered", + + #[cfg(any(target_os = "macos", target_os = "ios"))] + EQFULL => "Interface output queue is full", + + #[cfg(target_os = "openbsd")] + EOPNOTSUPP => "Operation not supported", + + #[cfg(target_os = "openbsd")] + EIPSEC => "IPsec processing failure", + + #[cfg(target_os = "dragonfly")] + EASYNC => "Async", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + EDEADLOCK => "Resource deadlock would occur", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + ELOCKUNMAPPED => "Locked lock was unmapped", + + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + ENOTACTIVE => "Facility is not active", + } +} + +#[cfg(any(target_os = "linux", target_os = "android", target_os = "fuchsia"))] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EAGAIN = libc::EAGAIN, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EDEADLK = libc::EDEADLK, + ENAMETOOLONG = libc::ENAMETOOLONG, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + ENOTEMPTY = libc::ENOTEMPTY, + ELOOP = libc::ELOOP, + ENOMSG = libc::ENOMSG, + EIDRM = libc::EIDRM, + ECHRNG = libc::ECHRNG, + EL2NSYNC = libc::EL2NSYNC, + EL3HLT = libc::EL3HLT, + EL3RST = libc::EL3RST, + ELNRNG = libc::ELNRNG, + EUNATCH = libc::EUNATCH, + ENOCSI = libc::ENOCSI, + EL2HLT = libc::EL2HLT, + EBADE = libc::EBADE, + EBADR = libc::EBADR, + EXFULL = libc::EXFULL, + ENOANO = libc::ENOANO, + EBADRQC = libc::EBADRQC, + EBADSLT = libc::EBADSLT, + EBFONT = libc::EBFONT, + ENOSTR = libc::ENOSTR, + ENODATA = libc::ENODATA, + ETIME = libc::ETIME, + ENOSR = libc::ENOSR, + ENONET = libc::ENONET, + ENOPKG = libc::ENOPKG, + EREMOTE = libc::EREMOTE, + ENOLINK = libc::ENOLINK, + EADV = libc::EADV, + ESRMNT = libc::ESRMNT, + ECOMM = libc::ECOMM, + EPROTO = libc::EPROTO, + EMULTIHOP = libc::EMULTIHOP, + EDOTDOT = libc::EDOTDOT, + EBADMSG = libc::EBADMSG, + EOVERFLOW = libc::EOVERFLOW, + ENOTUNIQ = libc::ENOTUNIQ, + EBADFD = libc::EBADFD, + EREMCHG = libc::EREMCHG, + ELIBACC = libc::ELIBACC, + ELIBBAD = libc::ELIBBAD, + ELIBSCN = libc::ELIBSCN, + ELIBMAX = libc::ELIBMAX, + ELIBEXEC = libc::ELIBEXEC, + EILSEQ = libc::EILSEQ, + ERESTART = libc::ERESTART, + ESTRPIPE = libc::ESTRPIPE, + EUSERS = libc::EUSERS, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + EALREADY = libc::EALREADY, + EINPROGRESS = libc::EINPROGRESS, + ESTALE = libc::ESTALE, + EUCLEAN = libc::EUCLEAN, + ENOTNAM = libc::ENOTNAM, + ENAVAIL = libc::ENAVAIL, + EISNAM = libc::EISNAM, + EREMOTEIO = libc::EREMOTEIO, + EDQUOT = libc::EDQUOT, + ENOMEDIUM = libc::ENOMEDIUM, + EMEDIUMTYPE = libc::EMEDIUMTYPE, + ECANCELED = libc::ECANCELED, + ENOKEY = libc::ENOKEY, + EKEYEXPIRED = libc::EKEYEXPIRED, + EKEYREVOKED = libc::EKEYREVOKED, + EKEYREJECTED = libc::EKEYREJECTED, + EOWNERDEAD = libc::EOWNERDEAD, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + #[cfg(not(any(target_os = "android", target_arch = "mips")))] + ERFKILL = libc::ERFKILL, + #[cfg(not(any(target_os = "android", target_arch = "mips")))] + EHWPOISON = libc::EHWPOISON, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ENOTSUP instead" + )] + pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; + + impl Errno { + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const ENOTSUP: Errno = Errno::EOPNOTSUPP; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EAGAIN => EAGAIN, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EDEADLK => EDEADLK, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::ENOTEMPTY => ENOTEMPTY, + libc::ELOOP => ELOOP, + libc::ENOMSG => ENOMSG, + libc::EIDRM => EIDRM, + libc::ECHRNG => ECHRNG, + libc::EL2NSYNC => EL2NSYNC, + libc::EL3HLT => EL3HLT, + libc::EL3RST => EL3RST, + libc::ELNRNG => ELNRNG, + libc::EUNATCH => EUNATCH, + libc::ENOCSI => ENOCSI, + libc::EL2HLT => EL2HLT, + libc::EBADE => EBADE, + libc::EBADR => EBADR, + libc::EXFULL => EXFULL, + libc::ENOANO => ENOANO, + libc::EBADRQC => EBADRQC, + libc::EBADSLT => EBADSLT, + libc::EBFONT => EBFONT, + libc::ENOSTR => ENOSTR, + libc::ENODATA => ENODATA, + libc::ETIME => ETIME, + libc::ENOSR => ENOSR, + libc::ENONET => ENONET, + libc::ENOPKG => ENOPKG, + libc::EREMOTE => EREMOTE, + libc::ENOLINK => ENOLINK, + libc::EADV => EADV, + libc::ESRMNT => ESRMNT, + libc::ECOMM => ECOMM, + libc::EPROTO => EPROTO, + libc::EMULTIHOP => EMULTIHOP, + libc::EDOTDOT => EDOTDOT, + libc::EBADMSG => EBADMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ENOTUNIQ => ENOTUNIQ, + libc::EBADFD => EBADFD, + libc::EREMCHG => EREMCHG, + libc::ELIBACC => ELIBACC, + libc::ELIBBAD => ELIBBAD, + libc::ELIBSCN => ELIBSCN, + libc::ELIBMAX => ELIBMAX, + libc::ELIBEXEC => ELIBEXEC, + libc::EILSEQ => EILSEQ, + libc::ERESTART => ERESTART, + libc::ESTRPIPE => ESTRPIPE, + libc::EUSERS => EUSERS, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::EALREADY => EALREADY, + libc::EINPROGRESS => EINPROGRESS, + libc::ESTALE => ESTALE, + libc::EUCLEAN => EUCLEAN, + libc::ENOTNAM => ENOTNAM, + libc::ENAVAIL => ENAVAIL, + libc::EISNAM => EISNAM, + libc::EREMOTEIO => EREMOTEIO, + libc::EDQUOT => EDQUOT, + libc::ENOMEDIUM => ENOMEDIUM, + libc::EMEDIUMTYPE => EMEDIUMTYPE, + libc::ECANCELED => ECANCELED, + libc::ENOKEY => ENOKEY, + libc::EKEYEXPIRED => EKEYEXPIRED, + libc::EKEYREVOKED => EKEYREVOKED, + libc::EKEYREJECTED => EKEYREJECTED, + libc::EOWNERDEAD => EOWNERDEAD, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + #[cfg(not(any(target_os = "android", target_arch = "mips")))] + libc::ERFKILL => ERFKILL, + #[cfg(not(any(target_os = "android", target_arch = "mips")))] + libc::EHWPOISON => EHWPOISON, + _ => UnknownErrno, + } + } +} + +#[cfg(any(target_os = "macos", target_os = "ios"))] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EPWROFF = libc::EPWROFF, + EDEVERR = libc::EDEVERR, + EOVERFLOW = libc::EOVERFLOW, + EBADEXEC = libc::EBADEXEC, + EBADARCH = libc::EBADARCH, + ESHLIBVERS = libc::ESHLIBVERS, + EBADMACHO = libc::EBADMACHO, + ECANCELED = libc::ECANCELED, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENODATA = libc::ENODATA, + ENOLINK = libc::ENOLINK, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + EPROTO = libc::EPROTO, + ETIME = libc::ETIME, + EOPNOTSUPP = libc::EOPNOTSUPP, + ENOPOLICY = libc::ENOPOLICY, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + EQFULL = libc::EQFULL, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::EQFULL; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + + impl Errno { + pub const ELAST: Errno = Errno::EQFULL; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::ENOTSUP => ENOTSUP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EPWROFF => EPWROFF, + libc::EDEVERR => EDEVERR, + libc::EOVERFLOW => EOVERFLOW, + libc::EBADEXEC => EBADEXEC, + libc::EBADARCH => EBADARCH, + libc::ESHLIBVERS => ESHLIBVERS, + libc::EBADMACHO => EBADMACHO, + libc::ECANCELED => ECANCELED, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EILSEQ => EILSEQ, + libc::ENOATTR => ENOATTR, + libc::EBADMSG => EBADMSG, + libc::EMULTIHOP => EMULTIHOP, + libc::ENODATA => ENODATA, + libc::ENOLINK => ENOLINK, + libc::ENOSR => ENOSR, + libc::ENOSTR => ENOSTR, + libc::EPROTO => EPROTO, + libc::ETIME => ETIME, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::ENOPOLICY => ENOPOLICY, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::EOWNERDEAD => EOWNERDEAD, + libc::EQFULL => EQFULL, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "freebsd")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EDOOFUS = libc::EDOOFUS, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + ENOTCAPABLE = libc::ENOTCAPABLE, + ECAPMODE = libc::ECAPMODE, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::EOWNERDEAD; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EOPNOTSUPP instead" + )] + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + + impl Errno { + pub const ELAST: Errno = Errno::EOWNERDEAD; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::ENOTSUP => ENOTSUP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ECANCELED => ECANCELED, + libc::EILSEQ => EILSEQ, + libc::ENOATTR => ENOATTR, + libc::EDOOFUS => EDOOFUS, + libc::EBADMSG => EBADMSG, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + libc::ENOTCAPABLE => ENOTCAPABLE, + libc::ECAPMODE => ECAPMODE, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::EOWNERDEAD => EOWNERDEAD, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "dragonfly")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + ENOTSUP = libc::ENOTSUP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EDOOFUS = libc::EDOOFUS, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + ENOMEDIUM = libc::ENOMEDIUM, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + EASYNC = libc::EASYNC, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::EASYNC; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EDEADLOCK instead" + )] + pub const EDEADLOCK: Errno = Errno::EDEADLK; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EOPNOTSUPP instead" + )] + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + + impl Errno { + pub const ELAST: Errno = Errno::EASYNC; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::ENOTSUP => ENOTSUP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ECANCELED => ECANCELED, + libc::EILSEQ => EILSEQ, + libc::ENOATTR => ENOATTR, + libc::EDOOFUS => EDOOFUS, + libc::EBADMSG => EBADMSG, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + libc::ENOMEDIUM => ENOMEDIUM, + libc::EASYNC => EASYNC, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "openbsd")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIPSEC = libc::EIPSEC, + ENOATTR = libc::ENOATTR, + EILSEQ = libc::EILSEQ, + ENOMEDIUM = libc::ENOMEDIUM, + EMEDIUMTYPE = libc::EMEDIUMTYPE, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + ENOTSUP = libc::ENOTSUP, + EBADMSG = libc::EBADMSG, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + EOWNERDEAD = libc::EOWNERDEAD, + EPROTO = libc::EPROTO, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::ENOTSUP; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const ELAST: Errno = Errno::ENOTSUP; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIPSEC => EIPSEC, + libc::ENOATTR => ENOATTR, + libc::EILSEQ => EILSEQ, + libc::ENOMEDIUM => ENOMEDIUM, + libc::EMEDIUMTYPE => EMEDIUMTYPE, + libc::EOVERFLOW => EOVERFLOW, + libc::ECANCELED => ECANCELED, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::ENOTSUP => ENOTSUP, + libc::EBADMSG => EBADMSG, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::EOWNERDEAD => EOWNERDEAD, + libc::EPROTO => EPROTO, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "netbsd")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EPROCLIM = libc::EPROCLIM, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + EBADRPC = libc::EBADRPC, + ERPCMISMATCH = libc::ERPCMISMATCH, + EPROGUNAVAIL = libc::EPROGUNAVAIL, + EPROGMISMATCH = libc::EPROGMISMATCH, + EPROCUNAVAIL = libc::EPROCUNAVAIL, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EFTYPE = libc::EFTYPE, + EAUTH = libc::EAUTH, + ENEEDAUTH = libc::ENEEDAUTH, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + EILSEQ = libc::EILSEQ, + ENOTSUP = libc::ENOTSUP, + ECANCELED = libc::ECANCELED, + EBADMSG = libc::EBADMSG, + ENODATA = libc::ENODATA, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + ETIME = libc::ETIME, + ENOATTR = libc::ENOATTR, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::ENOTSUP; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const ELAST: Errno = Errno::ENOTSUP; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EPROCLIM => EPROCLIM, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::EBADRPC => EBADRPC, + libc::ERPCMISMATCH => ERPCMISMATCH, + libc::EPROGUNAVAIL => EPROGUNAVAIL, + libc::EPROGMISMATCH => EPROGMISMATCH, + libc::EPROCUNAVAIL => EPROCUNAVAIL, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EFTYPE => EFTYPE, + libc::EAUTH => EAUTH, + libc::ENEEDAUTH => ENEEDAUTH, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::EILSEQ => EILSEQ, + libc::ENOTSUP => ENOTSUP, + libc::ECANCELED => ECANCELED, + libc::EBADMSG => EBADMSG, + libc::ENODATA => ENODATA, + libc::ENOSR => ENOSR, + libc::ENOSTR => ENOSTR, + libc::ETIME => ETIME, + libc::ENOATTR => ENOATTR, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "redox")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EUSERS = libc::EUSERS, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + EREMOTE = libc::EREMOTE, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + EILSEQ = libc::EILSEQ, + ECANCELED = libc::ECANCELED, + EBADMSG = libc::EBADMSG, + ENODATA = libc::ENODATA, + ENOSR = libc::ENOSR, + ENOSTR = libc::ENOSTR, + ETIME = libc::ETIME, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EUSERS => EUSERS, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::EREMOTE => EREMOTE, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::EILSEQ => EILSEQ, + libc::ECANCELED => ECANCELED, + libc::EBADMSG => EBADMSG, + libc::ENODATA => ENODATA, + libc::ENOSR => ENOSR, + libc::ENOSTR => ENOSTR, + libc::ETIME => ETIME, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + _ => UnknownErrno, + } + } +} + +#[cfg(any(target_os = "illumos", target_os = "solaris"))] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EAGAIN = libc::EAGAIN, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + ENOTBLK = libc::ENOTBLK, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + ENOMSG = libc::ENOMSG, + EIDRM = libc::EIDRM, + ECHRNG = libc::ECHRNG, + EL2NSYNC = libc::EL2NSYNC, + EL3HLT = libc::EL3HLT, + EL3RST = libc::EL3RST, + ELNRNG = libc::ELNRNG, + EUNATCH = libc::EUNATCH, + ENOCSI = libc::ENOCSI, + EL2HLT = libc::EL2HLT, + EDEADLK = libc::EDEADLK, + ENOLCK = libc::ENOLCK, + ECANCELED = libc::ECANCELED, + ENOTSUP = libc::ENOTSUP, + EDQUOT = libc::EDQUOT, + EBADE = libc::EBADE, + EBADR = libc::EBADR, + EXFULL = libc::EXFULL, + ENOANO = libc::ENOANO, + EBADRQC = libc::EBADRQC, + EBADSLT = libc::EBADSLT, + EDEADLOCK = libc::EDEADLOCK, + EBFONT = libc::EBFONT, + EOWNERDEAD = libc::EOWNERDEAD, + ENOTRECOVERABLE = libc::ENOTRECOVERABLE, + ENOSTR = libc::ENOSTR, + ENODATA = libc::ENODATA, + ETIME = libc::ETIME, + ENOSR = libc::ENOSR, + ENONET = libc::ENONET, + ENOPKG = libc::ENOPKG, + EREMOTE = libc::EREMOTE, + ENOLINK = libc::ENOLINK, + EADV = libc::EADV, + ESRMNT = libc::ESRMNT, + ECOMM = libc::ECOMM, + EPROTO = libc::EPROTO, + ELOCKUNMAPPED = libc::ELOCKUNMAPPED, + ENOTACTIVE = libc::ENOTACTIVE, + EMULTIHOP = libc::EMULTIHOP, + EBADMSG = libc::EBADMSG, + ENAMETOOLONG = libc::ENAMETOOLONG, + EOVERFLOW = libc::EOVERFLOW, + ENOTUNIQ = libc::ENOTUNIQ, + EBADFD = libc::EBADFD, + EREMCHG = libc::EREMCHG, + ELIBACC = libc::ELIBACC, + ELIBBAD = libc::ELIBBAD, + ELIBSCN = libc::ELIBSCN, + ELIBMAX = libc::ELIBMAX, + ELIBEXEC = libc::ELIBEXEC, + EILSEQ = libc::EILSEQ, + ENOSYS = libc::ENOSYS, + ELOOP = libc::ELOOP, + ERESTART = libc::ERESTART, + ESTRPIPE = libc::ESTRPIPE, + ENOTEMPTY = libc::ENOTEMPTY, + EUSERS = libc::EUSERS, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ESOCKTNOSUPPORT = libc::ESOCKTNOSUPPORT, + EOPNOTSUPP = libc::EOPNOTSUPP, + EPFNOSUPPORT = libc::EPFNOSUPPORT, + EAFNOSUPPORT = libc::EAFNOSUPPORT, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETOOMANYREFS = libc::ETOOMANYREFS, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + EALREADY = libc::EALREADY, + EINPROGRESS = libc::EINPROGRESS, + ESTALE = libc::ESTALE, + } + + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::ELAST instead" + )] + pub const ELAST: Errno = Errno::ELAST; + #[deprecated( + since = "0.22.1", + note = "use nix::errno::Errno::EWOULDBLOCK instead" + )] + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + + impl Errno { + pub const ELAST: Errno = Errno::ESTALE; + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EAGAIN => EAGAIN, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::ENOTBLK => ENOTBLK, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::ENOMSG => ENOMSG, + libc::EIDRM => EIDRM, + libc::ECHRNG => ECHRNG, + libc::EL2NSYNC => EL2NSYNC, + libc::EL3HLT => EL3HLT, + libc::EL3RST => EL3RST, + libc::ELNRNG => ELNRNG, + libc::EUNATCH => EUNATCH, + libc::ENOCSI => ENOCSI, + libc::EL2HLT => EL2HLT, + libc::EDEADLK => EDEADLK, + libc::ENOLCK => ENOLCK, + libc::ECANCELED => ECANCELED, + libc::ENOTSUP => ENOTSUP, + libc::EDQUOT => EDQUOT, + libc::EBADE => EBADE, + libc::EBADR => EBADR, + libc::EXFULL => EXFULL, + libc::ENOANO => ENOANO, + libc::EBADRQC => EBADRQC, + libc::EBADSLT => EBADSLT, + libc::EDEADLOCK => EDEADLOCK, + libc::EBFONT => EBFONT, + libc::EOWNERDEAD => EOWNERDEAD, + libc::ENOTRECOVERABLE => ENOTRECOVERABLE, + libc::ENOSTR => ENOSTR, + libc::ENODATA => ENODATA, + libc::ETIME => ETIME, + libc::ENOSR => ENOSR, + libc::ENONET => ENONET, + libc::ENOPKG => ENOPKG, + libc::EREMOTE => EREMOTE, + libc::ENOLINK => ENOLINK, + libc::EADV => EADV, + libc::ESRMNT => ESRMNT, + libc::ECOMM => ECOMM, + libc::EPROTO => EPROTO, + libc::ELOCKUNMAPPED => ELOCKUNMAPPED, + libc::ENOTACTIVE => ENOTACTIVE, + libc::EMULTIHOP => EMULTIHOP, + libc::EBADMSG => EBADMSG, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EOVERFLOW => EOVERFLOW, + libc::ENOTUNIQ => ENOTUNIQ, + libc::EBADFD => EBADFD, + libc::EREMCHG => EREMCHG, + libc::ELIBACC => ELIBACC, + libc::ELIBBAD => ELIBBAD, + libc::ELIBSCN => ELIBSCN, + libc::ELIBMAX => ELIBMAX, + libc::ELIBEXEC => ELIBEXEC, + libc::EILSEQ => EILSEQ, + libc::ENOSYS => ENOSYS, + libc::ELOOP => ELOOP, + libc::ERESTART => ERESTART, + libc::ESTRPIPE => ESTRPIPE, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EUSERS => EUSERS, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ESOCKTNOSUPPORT => ESOCKTNOSUPPORT, + libc::EOPNOTSUPP => EOPNOTSUPP, + libc::EPFNOSUPPORT => EPFNOSUPPORT, + libc::EAFNOSUPPORT => EAFNOSUPPORT, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETOOMANYREFS => ETOOMANYREFS, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::EALREADY => EALREADY, + libc::EINPROGRESS => EINPROGRESS, + libc::ESTALE => ESTALE, + _ => UnknownErrno, + } + } +} + +#[cfg(target_os = "haiku")] +mod consts { + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + #[repr(i32)] + #[non_exhaustive] + pub enum Errno { + UnknownErrno = 0, + EPERM = libc::EPERM, + ENOENT = libc::ENOENT, + ESRCH = libc::ESRCH, + EINTR = libc::EINTR, + EIO = libc::EIO, + ENXIO = libc::ENXIO, + E2BIG = libc::E2BIG, + ENOEXEC = libc::ENOEXEC, + EBADF = libc::EBADF, + ECHILD = libc::ECHILD, + EDEADLK = libc::EDEADLK, + ENOMEM = libc::ENOMEM, + EACCES = libc::EACCES, + EFAULT = libc::EFAULT, + EBUSY = libc::EBUSY, + EEXIST = libc::EEXIST, + EXDEV = libc::EXDEV, + ENODEV = libc::ENODEV, + ENOTDIR = libc::ENOTDIR, + EISDIR = libc::EISDIR, + EINVAL = libc::EINVAL, + ENFILE = libc::ENFILE, + EMFILE = libc::EMFILE, + ENOTTY = libc::ENOTTY, + ETXTBSY = libc::ETXTBSY, + EFBIG = libc::EFBIG, + ENOSPC = libc::ENOSPC, + ESPIPE = libc::ESPIPE, + EROFS = libc::EROFS, + EMLINK = libc::EMLINK, + EPIPE = libc::EPIPE, + EDOM = libc::EDOM, + ERANGE = libc::ERANGE, + EAGAIN = libc::EAGAIN, + EINPROGRESS = libc::EINPROGRESS, + EALREADY = libc::EALREADY, + ENOTSOCK = libc::ENOTSOCK, + EDESTADDRREQ = libc::EDESTADDRREQ, + EMSGSIZE = libc::EMSGSIZE, + EPROTOTYPE = libc::EPROTOTYPE, + ENOPROTOOPT = libc::ENOPROTOOPT, + EPROTONOSUPPORT = libc::EPROTONOSUPPORT, + ENOTSUP = libc::ENOTSUP, + EADDRINUSE = libc::EADDRINUSE, + EADDRNOTAVAIL = libc::EADDRNOTAVAIL, + ENETDOWN = libc::ENETDOWN, + ENETUNREACH = libc::ENETUNREACH, + ENETRESET = libc::ENETRESET, + ECONNABORTED = libc::ECONNABORTED, + ECONNRESET = libc::ECONNRESET, + ENOBUFS = libc::ENOBUFS, + EISCONN = libc::EISCONN, + ENOTCONN = libc::ENOTCONN, + ESHUTDOWN = libc::ESHUTDOWN, + ETIMEDOUT = libc::ETIMEDOUT, + ECONNREFUSED = libc::ECONNREFUSED, + ELOOP = libc::ELOOP, + ENAMETOOLONG = libc::ENAMETOOLONG, + EHOSTDOWN = libc::EHOSTDOWN, + EHOSTUNREACH = libc::EHOSTUNREACH, + ENOTEMPTY = libc::ENOTEMPTY, + EDQUOT = libc::EDQUOT, + ESTALE = libc::ESTALE, + ENOLCK = libc::ENOLCK, + ENOSYS = libc::ENOSYS, + EIDRM = libc::EIDRM, + ENOMSG = libc::ENOMSG, + EOVERFLOW = libc::EOVERFLOW, + ECANCELED = libc::ECANCELED, + EILSEQ = libc::EILSEQ, + ENOATTR = libc::ENOATTR, + EBADMSG = libc::EBADMSG, + EMULTIHOP = libc::EMULTIHOP, + ENOLINK = libc::ENOLINK, + EPROTO = libc::EPROTO, + } + + impl Errno { + pub const EWOULDBLOCK: Errno = Errno::EAGAIN; + pub const EDEADLOCK: Errno = Errno::EDEADLK; + pub const EOPNOTSUPP: Errno = Errno::ENOTSUP; + } + + pub const fn from_i32(e: i32) -> Errno { + use self::Errno::*; + + match e { + libc::EPERM => EPERM, + libc::ENOENT => ENOENT, + libc::ESRCH => ESRCH, + libc::EINTR => EINTR, + libc::EIO => EIO, + libc::ENXIO => ENXIO, + libc::E2BIG => E2BIG, + libc::ENOEXEC => ENOEXEC, + libc::EBADF => EBADF, + libc::ECHILD => ECHILD, + libc::EDEADLK => EDEADLK, + libc::ENOMEM => ENOMEM, + libc::EACCES => EACCES, + libc::EFAULT => EFAULT, + libc::EBUSY => EBUSY, + libc::EEXIST => EEXIST, + libc::EXDEV => EXDEV, + libc::ENODEV => ENODEV, + libc::ENOTDIR => ENOTDIR, + libc::EISDIR => EISDIR, + libc::EINVAL => EINVAL, + libc::ENFILE => ENFILE, + libc::EMFILE => EMFILE, + libc::ENOTTY => ENOTTY, + libc::ETXTBSY => ETXTBSY, + libc::EFBIG => EFBIG, + libc::ENOSPC => ENOSPC, + libc::ESPIPE => ESPIPE, + libc::EROFS => EROFS, + libc::EMLINK => EMLINK, + libc::EPIPE => EPIPE, + libc::EDOM => EDOM, + libc::ERANGE => ERANGE, + libc::EAGAIN => EAGAIN, + libc::EINPROGRESS => EINPROGRESS, + libc::EALREADY => EALREADY, + libc::ENOTSOCK => ENOTSOCK, + libc::EDESTADDRREQ => EDESTADDRREQ, + libc::EMSGSIZE => EMSGSIZE, + libc::EPROTOTYPE => EPROTOTYPE, + libc::ENOPROTOOPT => ENOPROTOOPT, + libc::EPROTONOSUPPORT => EPROTONOSUPPORT, + libc::ENOTSUP => ENOTSUP, + libc::EADDRINUSE => EADDRINUSE, + libc::EADDRNOTAVAIL => EADDRNOTAVAIL, + libc::ENETDOWN => ENETDOWN, + libc::ENETUNREACH => ENETUNREACH, + libc::ENETRESET => ENETRESET, + libc::ECONNABORTED => ECONNABORTED, + libc::ECONNRESET => ECONNRESET, + libc::ENOBUFS => ENOBUFS, + libc::EISCONN => EISCONN, + libc::ENOTCONN => ENOTCONN, + libc::ESHUTDOWN => ESHUTDOWN, + libc::ETIMEDOUT => ETIMEDOUT, + libc::ECONNREFUSED => ECONNREFUSED, + libc::ELOOP => ELOOP, + libc::ENAMETOOLONG => ENAMETOOLONG, + libc::EHOSTDOWN => EHOSTDOWN, + libc::EHOSTUNREACH => EHOSTUNREACH, + libc::ENOTEMPTY => ENOTEMPTY, + libc::EDQUOT => EDQUOT, + libc::ESTALE => ESTALE, + libc::ENOLCK => ENOLCK, + libc::ENOSYS => ENOSYS, + libc::EIDRM => EIDRM, + libc::ENOMSG => ENOMSG, + libc::EOVERFLOW => EOVERFLOW, + libc::ECANCELED => ECANCELED, + libc::EILSEQ => EILSEQ, + libc::ENOATTR => ENOATTR, + libc::EBADMSG => EBADMSG, + libc::EMULTIHOP => EMULTIHOP, + libc::ENOLINK => ENOLINK, + libc::EPROTO => EPROTO, + _ => UnknownErrno, + } + } +} diff --git a/bash-5.1/vendor/nix/src/fcntl.rs b/bash-5.1/vendor/nix/src/fcntl.rs new file mode 100644 index 0000000000000000000000000000000000000000..160b022d77add56cd119862b4c74d2af50e81462 --- /dev/null +++ b/bash-5.1/vendor/nix/src/fcntl.rs @@ -0,0 +1,884 @@ +use crate::errno::Errno; +use libc::{self, c_char, c_int, c_uint, size_t, ssize_t}; +use std::ffi::OsString; +#[cfg(not(target_os = "redox"))] +use std::os::raw; +use std::os::unix::ffi::OsStringExt; +use std::os::unix::io::RawFd; + +#[cfg(feature = "fs")] +use crate::{sys::stat::Mode, NixPath, Result}; +#[cfg(any(target_os = "android", target_os = "linux"))] +use std::ptr; // For splice and copy_file_range + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "wasi", + target_env = "uclibc", + target_os = "freebsd" +))] +#[cfg(feature = "fs")] +pub use self::posix_fadvise::{posix_fadvise, PosixFadviseAdvice}; + +#[cfg(not(target_os = "redox"))] +#[cfg(any(feature = "fs", feature = "process"))] +libc_bitflags! { + #[cfg_attr(docsrs, doc(cfg(any(feature = "fs", feature = "process"))))] + pub struct AtFlags: c_int { + AT_REMOVEDIR; + AT_SYMLINK_FOLLOW; + AT_SYMLINK_NOFOLLOW; + #[cfg(any(target_os = "android", target_os = "linux"))] + AT_NO_AUTOMOUNT; + #[cfg(any(target_os = "android", target_os = "linux"))] + AT_EMPTY_PATH; + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + AT_EACCESS; + } +} + +#[cfg(any(feature = "fs", feature = "term"))] +libc_bitflags!( + /// Configuration options for opened files. + #[cfg_attr(docsrs, doc(cfg(any(feature = "fs", feature = "term"))))] + pub struct OFlag: c_int { + /// Mask for the access mode of the file. + O_ACCMODE; + /// Use alternate I/O semantics. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_ALT_IO; + /// Open the file in append-only mode. + O_APPEND; + /// Generate a signal when input or output becomes possible. + #[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_ASYNC; + /// Closes the file descriptor once an `execve` call is made. + /// + /// Also sets the file offset to the beginning of the file. + O_CLOEXEC; + /// Create the file if it does not exist. + O_CREAT; + /// Try to minimize cache effects of the I/O for this file. + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_DIRECT; + /// If the specified path isn't a directory, fail. + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_DIRECTORY; + /// Implicitly follow each `write()` with an `fdatasync()`. + #[cfg(any(target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_DSYNC; + /// Error out if a file was not created. + O_EXCL; + /// Open for execute only. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_EXEC; + /// Open with an exclusive file lock. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_EXLOCK; + /// Same as `O_SYNC`. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + all(target_os = "linux", not(target_env = "musl")), + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_FSYNC; + /// Allow files whose sizes can't be represented in an `off_t` to be opened. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_LARGEFILE; + /// Do not update the file last access time during `read(2)`s. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_NOATIME; + /// Don't attach the device as the process' controlling terminal. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_NOCTTY; + /// Same as `O_NONBLOCK`. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_NDELAY; + /// `open()` will fail if the given path is a symbolic link. + O_NOFOLLOW; + /// When possible, open the file in nonblocking mode. + O_NONBLOCK; + /// Don't deliver `SIGPIPE`. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_NOSIGPIPE; + /// Obtain a file descriptor for low-level access. + /// + /// The file itself is not opened and other file operations will fail. + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_PATH; + /// Only allow reading. + /// + /// This should not be combined with `O_WRONLY` or `O_RDWR`. + O_RDONLY; + /// Allow both reading and writing. + /// + /// This should not be combined with `O_WRONLY` or `O_RDONLY`. + O_RDWR; + /// Similar to `O_DSYNC` but applies to `read`s instead. + #[cfg(any(target_os = "linux", target_os = "netbsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_RSYNC; + /// Skip search permission checks. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_SEARCH; + /// Open with a shared file lock. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_SHLOCK; + /// Implicitly follow each `write()` with an `fsync()`. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_SYNC; + /// Create an unnamed temporary file. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_TMPFILE; + /// Truncate an existing regular file to 0 length if it allows writing. + O_TRUNC; + /// Restore default TTY attributes. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_TTY_INIT; + /// Only allow writing. + /// + /// This should not be combined with `O_RDONLY` or `O_RDWR`. + O_WRONLY; + } +); + +feature! { +#![feature = "fs"] + +// The conversion is not identical on all operating systems. +#[allow(clippy::useless_conversion)] +pub fn open(path: &P, oflag: OFlag, mode: Mode) -> Result { + let fd = path.with_nix_path(|cstr| { + unsafe { libc::open(cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) } + })?; + + Errno::result(fd) +} + +// The conversion is not identical on all operating systems. +#[allow(clippy::useless_conversion)] +#[cfg(not(target_os = "redox"))] +pub fn openat( + dirfd: RawFd, + path: &P, + oflag: OFlag, + mode: Mode, +) -> Result { + let fd = path.with_nix_path(|cstr| { + unsafe { libc::openat(dirfd, cstr.as_ptr(), oflag.bits(), mode.bits() as c_uint) } + })?; + Errno::result(fd) +} + +#[cfg(not(target_os = "redox"))] +pub fn renameat( + old_dirfd: Option, + old_path: &P1, + new_dirfd: Option, + new_path: &P2, +) -> Result<()> { + let res = old_path.with_nix_path(|old_cstr| { + new_path.with_nix_path(|new_cstr| unsafe { + libc::renameat( + at_rawfd(old_dirfd), + old_cstr.as_ptr(), + at_rawfd(new_dirfd), + new_cstr.as_ptr(), + ) + }) + })??; + Errno::result(res).map(drop) +} +} + +#[cfg(all(target_os = "linux", target_env = "gnu",))] +#[cfg(feature = "fs")] +libc_bitflags! { + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub struct RenameFlags: u32 { + RENAME_EXCHANGE; + RENAME_NOREPLACE; + RENAME_WHITEOUT; + } +} + +feature! { +#![feature = "fs"] +#[cfg(all( + target_os = "linux", + target_env = "gnu", +))] +pub fn renameat2( + old_dirfd: Option, + old_path: &P1, + new_dirfd: Option, + new_path: &P2, + flags: RenameFlags, +) -> Result<()> { + let res = old_path.with_nix_path(|old_cstr| { + new_path.with_nix_path(|new_cstr| unsafe { + libc::renameat2( + at_rawfd(old_dirfd), + old_cstr.as_ptr(), + at_rawfd(new_dirfd), + new_cstr.as_ptr(), + flags.bits(), + ) + }) + })??; + Errno::result(res).map(drop) +} + +fn wrap_readlink_result(mut v: Vec, len: ssize_t) -> Result { + unsafe { v.set_len(len as usize) } + v.shrink_to_fit(); + Ok(OsString::from_vec(v.to_vec())) +} + +fn readlink_maybe_at( + dirfd: Option, + path: &P, + v: &mut Vec, +) -> Result { + path.with_nix_path(|cstr| unsafe { + match dirfd { + #[cfg(target_os = "redox")] + Some(_) => unreachable!(), + #[cfg(not(target_os = "redox"))] + Some(dirfd) => libc::readlinkat( + dirfd, + cstr.as_ptr(), + v.as_mut_ptr() as *mut c_char, + v.capacity() as size_t, + ), + None => libc::readlink( + cstr.as_ptr(), + v.as_mut_ptr() as *mut c_char, + v.capacity() as size_t, + ), + } + }) +} + +fn inner_readlink(dirfd: Option, path: &P) -> Result { + let mut v = Vec::with_capacity(libc::PATH_MAX as usize); + // simple case: result is strictly less than `PATH_MAX` + let res = readlink_maybe_at(dirfd, path, &mut v)?; + let len = Errno::result(res)?; + debug_assert!(len >= 0); + if (len as usize) < v.capacity() { + return wrap_readlink_result(v, res); + } + // Uh oh, the result is too long... + // Let's try to ask lstat how many bytes to allocate. + let reported_size = match dirfd { + #[cfg(target_os = "redox")] + Some(_) => unreachable!(), + #[cfg(any(target_os = "android", target_os = "linux"))] + Some(dirfd) => { + let flags = if path.is_empty() { AtFlags::AT_EMPTY_PATH } else { AtFlags::empty() }; + super::sys::stat::fstatat(dirfd, path, flags | AtFlags::AT_SYMLINK_NOFOLLOW) + }, + #[cfg(not(any(target_os = "android", target_os = "linux", target_os = "redox")))] + Some(dirfd) => super::sys::stat::fstatat(dirfd, path, AtFlags::AT_SYMLINK_NOFOLLOW), + None => super::sys::stat::lstat(path) + } + .map(|x| x.st_size) + .unwrap_or(0); + let mut try_size = if reported_size > 0 { + // Note: even if `lstat`'s apparently valid answer turns out to be + // wrong, we will still read the full symlink no matter what. + reported_size as usize + 1 + } else { + // If lstat doesn't cooperate, or reports an error, be a little less + // precise. + (libc::PATH_MAX as usize).max(128) << 1 + }; + loop { + v.reserve_exact(try_size); + let res = readlink_maybe_at(dirfd, path, &mut v)?; + let len = Errno::result(res)?; + debug_assert!(len >= 0); + if (len as usize) < v.capacity() { + break wrap_readlink_result(v, res); + } else { + // Ugh! Still not big enough! + match try_size.checked_shl(1) { + Some(next_size) => try_size = next_size, + // It's absurd that this would happen, but handle it sanely + // anyway. + None => break Err(Errno::ENAMETOOLONG), + } + } + } +} + +pub fn readlink(path: &P) -> Result { + inner_readlink(None, path) +} + +#[cfg(not(target_os = "redox"))] +pub fn readlinkat(dirfd: RawFd, path: &P) -> Result { + inner_readlink(Some(dirfd), path) +} + +/// Computes the raw fd consumed by a function of the form `*at`. +#[cfg(not(target_os = "redox"))] +pub(crate) fn at_rawfd(fd: Option) -> raw::c_int { + match fd { + None => libc::AT_FDCWD, + Some(fd) => fd, + } +} +} + +#[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd"))] +#[cfg(feature = "fs")] +libc_bitflags!( + /// Additional flags for file sealing, which allows for limiting operations on a file. + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub struct SealFlag: c_int { + /// Prevents further calls to `fcntl()` with `F_ADD_SEALS`. + F_SEAL_SEAL; + /// The file cannot be reduced in size. + F_SEAL_SHRINK; + /// The size of the file cannot be increased. + F_SEAL_GROW; + /// The file contents cannot be modified. + F_SEAL_WRITE; + } +); + +#[cfg(feature = "fs")] +libc_bitflags!( + /// Additional configuration flags for `fcntl`'s `F_SETFD`. + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub struct FdFlag: c_int { + /// The file descriptor will automatically be closed during a successful `execve(2)`. + FD_CLOEXEC; + } +); + +feature! { +#![feature = "fs"] + +#[cfg(not(target_os = "redox"))] +#[derive(Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum FcntlArg<'a> { + F_DUPFD(RawFd), + F_DUPFD_CLOEXEC(RawFd), + F_GETFD, + F_SETFD(FdFlag), // FD_FLAGS + F_GETFL, + F_SETFL(OFlag), // O_NONBLOCK + F_SETLK(&'a libc::flock), + F_SETLKW(&'a libc::flock), + F_GETLK(&'a mut libc::flock), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_OFD_SETLK(&'a libc::flock), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_OFD_SETLKW(&'a libc::flock), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_OFD_GETLK(&'a mut libc::flock), + #[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd"))] + F_ADD_SEALS(SealFlag), + #[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd"))] + F_GET_SEALS, + #[cfg(any(target_os = "macos", target_os = "ios"))] + F_FULLFSYNC, + #[cfg(any(target_os = "linux", target_os = "android"))] + F_GETPIPE_SZ, + #[cfg(any(target_os = "linux", target_os = "android"))] + F_SETPIPE_SZ(c_int), + // TODO: Rest of flags +} + +#[cfg(target_os = "redox")] +#[derive(Debug, Clone, Copy, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum FcntlArg { + F_DUPFD(RawFd), + F_DUPFD_CLOEXEC(RawFd), + F_GETFD, + F_SETFD(FdFlag), // FD_FLAGS + F_GETFL, + F_SETFL(OFlag), // O_NONBLOCK +} +pub use self::FcntlArg::*; + +// TODO: Figure out how to handle value fcntl returns +pub fn fcntl(fd: RawFd, arg: FcntlArg) -> Result { + let res = unsafe { + match arg { + F_DUPFD(rawfd) => libc::fcntl(fd, libc::F_DUPFD, rawfd), + F_DUPFD_CLOEXEC(rawfd) => libc::fcntl(fd, libc::F_DUPFD_CLOEXEC, rawfd), + F_GETFD => libc::fcntl(fd, libc::F_GETFD), + F_SETFD(flag) => libc::fcntl(fd, libc::F_SETFD, flag.bits()), + F_GETFL => libc::fcntl(fd, libc::F_GETFL), + F_SETFL(flag) => libc::fcntl(fd, libc::F_SETFL, flag.bits()), + #[cfg(not(target_os = "redox"))] + F_SETLK(flock) => libc::fcntl(fd, libc::F_SETLK, flock), + #[cfg(not(target_os = "redox"))] + F_SETLKW(flock) => libc::fcntl(fd, libc::F_SETLKW, flock), + #[cfg(not(target_os = "redox"))] + F_GETLK(flock) => libc::fcntl(fd, libc::F_GETLK, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_OFD_SETLK(flock) => libc::fcntl(fd, libc::F_OFD_SETLK, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_OFD_SETLKW(flock) => libc::fcntl(fd, libc::F_OFD_SETLKW, flock), + #[cfg(any(target_os = "android", target_os = "linux"))] + F_OFD_GETLK(flock) => libc::fcntl(fd, libc::F_OFD_GETLK, flock), + #[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd"))] + F_ADD_SEALS(flag) => libc::fcntl(fd, libc::F_ADD_SEALS, flag.bits()), + #[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd"))] + F_GET_SEALS => libc::fcntl(fd, libc::F_GET_SEALS), + #[cfg(any(target_os = "macos", target_os = "ios"))] + F_FULLFSYNC => libc::fcntl(fd, libc::F_FULLFSYNC), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_GETPIPE_SZ => libc::fcntl(fd, libc::F_GETPIPE_SZ), + #[cfg(any(target_os = "linux", target_os = "android"))] + F_SETPIPE_SZ(size) => libc::fcntl(fd, libc::F_SETPIPE_SZ, size), + } + }; + + Errno::result(res) +} + +// TODO: convert to libc_enum +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum FlockArg { + LockShared, + LockExclusive, + Unlock, + LockSharedNonblock, + LockExclusiveNonblock, + UnlockNonblock, +} + +#[cfg(not(target_os = "redox"))] +pub fn flock(fd: RawFd, arg: FlockArg) -> Result<()> { + use self::FlockArg::*; + + let res = unsafe { + match arg { + LockShared => libc::flock(fd, libc::LOCK_SH), + LockExclusive => libc::flock(fd, libc::LOCK_EX), + Unlock => libc::flock(fd, libc::LOCK_UN), + LockSharedNonblock => libc::flock(fd, libc::LOCK_SH | libc::LOCK_NB), + LockExclusiveNonblock => libc::flock(fd, libc::LOCK_EX | libc::LOCK_NB), + UnlockNonblock => libc::flock(fd, libc::LOCK_UN | libc::LOCK_NB), + } + }; + + Errno::result(res).map(drop) +} +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(feature = "zerocopy")] +libc_bitflags! { + /// Additional flags to `splice` and friends. + #[cfg_attr(docsrs, doc(cfg(feature = "zerocopy")))] + pub struct SpliceFFlags: c_uint { + /// Request that pages be moved instead of copied. + /// + /// Not applicable to `vmsplice`. + SPLICE_F_MOVE; + /// Do not block on I/O. + SPLICE_F_NONBLOCK; + /// Hint that more data will be coming in a subsequent splice. + /// + /// Not applicable to `vmsplice`. + SPLICE_F_MORE; + /// Gift the user pages to the kernel. + /// + /// Not applicable to `splice`. + SPLICE_F_GIFT; + } +} + +feature! { +#![feature = "zerocopy"] + +/// Copy a range of data from one file to another +/// +/// The `copy_file_range` system call performs an in-kernel copy between +/// file descriptors `fd_in` and `fd_out` without the additional cost of +/// transferring data from the kernel to user space and then back into the +/// kernel. It copies up to `len` bytes of data from file descriptor `fd_in` to +/// file descriptor `fd_out`, overwriting any data that exists within the +/// requested range of the target file. +/// +/// If the `off_in` and/or `off_out` arguments are used, the values +/// will be mutated to reflect the new position within the file after +/// copying. If they are not used, the relevant filedescriptors will be seeked +/// to the new position. +/// +/// On successful completion the number of bytes actually copied will be +/// returned. +#[cfg(any(target_os = "android", target_os = "linux"))] +pub fn copy_file_range( + fd_in: RawFd, + off_in: Option<&mut libc::loff_t>, + fd_out: RawFd, + off_out: Option<&mut libc::loff_t>, + len: usize, +) -> Result { + let off_in = off_in + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + let off_out = off_out + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + + let ret = unsafe { + libc::syscall( + libc::SYS_copy_file_range, + fd_in, + off_in, + fd_out, + off_out, + len, + 0, + ) + }; + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn splice( + fd_in: RawFd, + off_in: Option<&mut libc::loff_t>, + fd_out: RawFd, + off_out: Option<&mut libc::loff_t>, + len: usize, + flags: SpliceFFlags, +) -> Result { + let off_in = off_in + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + let off_out = off_out + .map(|offset| offset as *mut libc::loff_t) + .unwrap_or(ptr::null_mut()); + + let ret = unsafe { libc::splice(fd_in, off_in, fd_out, off_out, len, flags.bits()) }; + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn tee(fd_in: RawFd, fd_out: RawFd, len: usize, flags: SpliceFFlags) -> Result { + let ret = unsafe { libc::tee(fd_in, fd_out, len, flags.bits()) }; + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn vmsplice( + fd: RawFd, + iov: &[std::io::IoSlice<'_>], + flags: SpliceFFlags + ) -> Result +{ + let ret = unsafe { + libc::vmsplice( + fd, + iov.as_ptr() as *const libc::iovec, + iov.len(), + flags.bits(), + ) + }; + Errno::result(ret).map(|r| r as usize) +} +} + +#[cfg(any(target_os = "linux"))] +#[cfg(feature = "fs")] +libc_bitflags!( + /// Mode argument flags for fallocate determining operation performed on a given range. + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub struct FallocateFlags: c_int { + /// File size is not changed. + /// + /// offset + len can be greater than file size. + FALLOC_FL_KEEP_SIZE; + /// Deallocates space by creating a hole. + /// + /// Must be ORed with FALLOC_FL_KEEP_SIZE. Byte range starts at offset and continues for len bytes. + FALLOC_FL_PUNCH_HOLE; + /// Removes byte range from a file without leaving a hole. + /// + /// Byte range to collapse starts at offset and continues for len bytes. + FALLOC_FL_COLLAPSE_RANGE; + /// Zeroes space in specified byte range. + /// + /// Byte range starts at offset and continues for len bytes. + FALLOC_FL_ZERO_RANGE; + /// Increases file space by inserting a hole within the file size. + /// + /// Does not overwrite existing data. Hole starts at offset and continues for len bytes. + FALLOC_FL_INSERT_RANGE; + /// Shared file data extants are made private to the file. + /// + /// Gaurantees that a subsequent write will not fail due to lack of space. + FALLOC_FL_UNSHARE_RANGE; + } +); + +feature! { +#![feature = "fs"] + +/// Manipulates file space. +/// +/// Allows the caller to directly manipulate the allocated disk space for the +/// file referred to by fd. +#[cfg(any(target_os = "linux"))] +#[cfg(feature = "fs")] +pub fn fallocate( + fd: RawFd, + mode: FallocateFlags, + offset: libc::off_t, + len: libc::off_t, +) -> Result<()> { + let res = unsafe { libc::fallocate(fd, mode.bits(), offset, len) }; + Errno::result(res).map(drop) +} + +/// Argument to [`fspacectl`] describing the range to zero. The first member is +/// the file offset, and the second is the length of the region. +#[cfg(any(target_os = "freebsd"))] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct SpacectlRange(pub libc::off_t, pub libc::off_t); + +#[cfg(any(target_os = "freebsd"))] +impl SpacectlRange { + #[inline] + pub fn is_empty(&self) -> bool { + self.1 == 0 + } + + #[inline] + pub fn len(&self) -> libc::off_t { + self.1 + } + + #[inline] + pub fn offset(&self) -> libc::off_t { + self.0 + } +} + +/// Punch holes in a file. +/// +/// `fspacectl` instructs the file system to deallocate a portion of a file. +/// After a successful operation, this region of the file will return all zeroes +/// if read. If the file system supports deallocation, then it may free the +/// underlying storage, too. +/// +/// # Arguments +/// +/// - `fd` - File to operate on +/// - `range.0` - File offset at which to begin deallocation +/// - `range.1` - Length of the region to deallocate +/// +/// # Returns +/// +/// The operation may deallocate less than the entire requested region. On +/// success, it returns the region that still remains to be deallocated. The +/// caller should loop until the returned region is empty. +/// +/// # Example +/// +#[cfg_attr(fbsd14, doc = " ```")] +#[cfg_attr(not(fbsd14), doc = " ```no_run")] +/// # use std::io::Write; +/// # use std::os::unix::fs::FileExt; +/// # use std::os::unix::io::AsRawFd; +/// # use nix::fcntl::*; +/// # use tempfile::tempfile; +/// const INITIAL: &[u8] = b"0123456789abcdef"; +/// let mut f = tempfile().unwrap(); +/// f.write_all(INITIAL).unwrap(); +/// let mut range = SpacectlRange(3, 6); +/// while (!range.is_empty()) { +/// range = fspacectl(f.as_raw_fd(), range).unwrap(); +/// } +/// let mut buf = vec![0; INITIAL.len()]; +/// f.read_exact_at(&mut buf, 0).unwrap(); +/// assert_eq!(buf, b"012\0\0\0\0\0\09abcdef"); +/// ``` +#[cfg(target_os = "freebsd")] +pub fn fspacectl(fd: RawFd, range: SpacectlRange) -> Result { + let mut rqsr = libc::spacectl_range{r_offset: range.0, r_len: range.1}; + let res = unsafe { libc::fspacectl( + fd, + libc::SPACECTL_DEALLOC, // Only one command is supported ATM + &rqsr, + 0, // No flags are currently supported + &mut rqsr + )}; + Errno::result(res).map(|_| SpacectlRange(rqsr.r_offset, rqsr.r_len)) +} + +/// Like [`fspacectl`], but will never return incomplete. +/// +/// # Arguments +/// +/// - `fd` - File to operate on +/// - `offset` - File offset at which to begin deallocation +/// - `len` - Length of the region to deallocate +/// +/// # Returns +/// +/// Returns `()` on success. On failure, the region may or may not be partially +/// deallocated. +/// +/// # Example +/// +#[cfg_attr(fbsd14, doc = " ```")] +#[cfg_attr(not(fbsd14), doc = " ```no_run")] +/// # use std::io::Write; +/// # use std::os::unix::fs::FileExt; +/// # use std::os::unix::io::AsRawFd; +/// # use nix::fcntl::*; +/// # use tempfile::tempfile; +/// const INITIAL: &[u8] = b"0123456789abcdef"; +/// let mut f = tempfile().unwrap(); +/// f.write_all(INITIAL).unwrap(); +/// fspacectl_all(f.as_raw_fd(), 3, 6).unwrap(); +/// let mut buf = vec![0; INITIAL.len()]; +/// f.read_exact_at(&mut buf, 0).unwrap(); +/// assert_eq!(buf, b"012\0\0\0\0\0\09abcdef"); +/// ``` +#[cfg(target_os = "freebsd")] +pub fn fspacectl_all(fd: RawFd, offset: libc::off_t, len: libc::off_t) + -> Result<()> +{ + let mut rqsr = libc::spacectl_range{r_offset: offset, r_len: len}; + while rqsr.r_len > 0 { + let res = unsafe { libc::fspacectl( + fd, + libc::SPACECTL_DEALLOC, // Only one command is supported ATM + &rqsr, + 0, // No flags are currently supported + &mut rqsr + )}; + if let Err(e) = Errno::result(res) { + return Err(e); + } + } + Ok(()) +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "wasi", + target_env = "uclibc", + target_os = "freebsd" +))] +mod posix_fadvise { + use crate::errno::Errno; + use std::os::unix::io::RawFd; + use crate::Result; + + #[cfg(feature = "fs")] + libc_enum! { + #[repr(i32)] + #[non_exhaustive] + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub enum PosixFadviseAdvice { + POSIX_FADV_NORMAL, + POSIX_FADV_SEQUENTIAL, + POSIX_FADV_RANDOM, + POSIX_FADV_NOREUSE, + POSIX_FADV_WILLNEED, + POSIX_FADV_DONTNEED, + } + } + + feature! { + #![feature = "fs"] + pub fn posix_fadvise( + fd: RawFd, + offset: libc::off_t, + len: libc::off_t, + advice: PosixFadviseAdvice, + ) -> Result<()> { + let res = unsafe { libc::posix_fadvise(fd, offset, len, advice as libc::c_int) }; + + if res == 0 { + Ok(()) + } else { + Err(Errno::from_i32(res)) + } + } + } +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "wasi", + target_os = "freebsd" +))] +pub fn posix_fallocate(fd: RawFd, offset: libc::off_t, len: libc::off_t) -> Result<()> { + let res = unsafe { libc::posix_fallocate(fd, offset, len) }; + match Errno::result(res) { + Err(err) => Err(err), + Ok(0) => Ok(()), + Ok(errno) => Err(Errno::from_i32(errno)), + } +} +} diff --git a/bash-5.1/vendor/nix/src/features.rs b/bash-5.1/vendor/nix/src/features.rs new file mode 100644 index 0000000000000000000000000000000000000000..d2adc1693b665872234fad433c0589c56e8f2910 --- /dev/null +++ b/bash-5.1/vendor/nix/src/features.rs @@ -0,0 +1,124 @@ +//! Feature tests for OS functionality +pub use self::os::*; + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod os { + use std::os::unix::ffi::OsStrExt; + use crate::sys::utsname::uname; + use crate::Result; + + // Features: + // * atomic cloexec on socket: 2.6.27 + // * pipe2: 2.6.27 + // * accept4: 2.6.28 + + static VERS_UNKNOWN: usize = 1; + static VERS_2_6_18: usize = 2; + static VERS_2_6_27: usize = 3; + static VERS_2_6_28: usize = 4; + static VERS_3: usize = 5; + + #[inline] + fn digit(dst: &mut usize, b: u8) { + *dst *= 10; + *dst += (b - b'0') as usize; + } + + fn parse_kernel_version() -> Result { + let u = uname()?; + + let mut curr: usize = 0; + let mut major: usize = 0; + let mut minor: usize = 0; + let mut patch: usize = 0; + + for &b in u.release().as_bytes() { + if curr >= 3 { + break; + } + + match b { + b'.' | b'-' => { + curr += 1; + } + b'0'..=b'9' => { + match curr { + 0 => digit(&mut major, b), + 1 => digit(&mut minor, b), + _ => digit(&mut patch, b), + } + } + _ => break, + } + } + + Ok(if major >= 3 { + VERS_3 + } else if major >= 2 { + if minor >= 7 { + VERS_UNKNOWN + } else if minor >= 6 { + if patch >= 28 { + VERS_2_6_28 + } else if patch >= 27 { + VERS_2_6_27 + } else { + VERS_2_6_18 + } + } else { + VERS_UNKNOWN + } + } else { + VERS_UNKNOWN + }) + } + + fn kernel_version() -> Result { + static mut KERNEL_VERS: usize = 0; + + unsafe { + if KERNEL_VERS == 0 { + KERNEL_VERS = parse_kernel_version()?; + } + + Ok(KERNEL_VERS) + } + } + + /// Check if the OS supports atomic close-on-exec for sockets + pub fn socket_atomic_cloexec() -> bool { + kernel_version().map(|version| version >= VERS_2_6_27).unwrap_or(false) + } + + #[test] + pub fn test_parsing_kernel_version() { + assert!(kernel_version().unwrap() > 0); + } +} + +#[cfg(any( + target_os = "dragonfly", // Since ??? + target_os = "freebsd", // Since 10.0 + target_os = "illumos", // Since ??? + target_os = "netbsd", // Since 6.0 + target_os = "openbsd", // Since 5.7 + target_os = "redox", // Since 1-july-2020 +))] +mod os { + /// Check if the OS supports atomic close-on-exec for sockets + pub const fn socket_atomic_cloexec() -> bool { + true + } +} + +#[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "fuchsia", + target_os = "haiku", + target_os = "solaris"))] +mod os { + /// Check if the OS supports atomic close-on-exec for sockets + pub const fn socket_atomic_cloexec() -> bool { + false + } +} diff --git a/bash-5.1/vendor/nix/src/ifaddrs.rs b/bash-5.1/vendor/nix/src/ifaddrs.rs new file mode 100644 index 0000000000000000000000000000000000000000..f834d3076272ba309c0dd7d06cde2310b344e4bf --- /dev/null +++ b/bash-5.1/vendor/nix/src/ifaddrs.rs @@ -0,0 +1,147 @@ +//! Query network interface addresses +//! +//! Uses the Linux and/or BSD specific function `getifaddrs` to query the list +//! of interfaces and their associated addresses. + +use cfg_if::cfg_if; +use std::ffi; +use std::iter::Iterator; +use std::mem; +use std::option::Option; + +use crate::{Result, Errno}; +use crate::sys::socket::{SockaddrLike, SockaddrStorage}; +use crate::net::if_::*; + +/// Describes a single address for an interface as returned by `getifaddrs`. +#[derive(Clone, Debug, Eq, Hash, PartialEq)] +pub struct InterfaceAddress { + /// Name of the network interface + pub interface_name: String, + /// Flags as from `SIOCGIFFLAGS` ioctl + pub flags: InterfaceFlags, + /// Network address of this interface + pub address: Option, + /// Netmask of this interface + pub netmask: Option, + /// Broadcast address of this interface, if applicable + pub broadcast: Option, + /// Point-to-point destination address + pub destination: Option, +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))] { + fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr { + info.ifa_ifu + } + } else { + fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr { + info.ifa_dstaddr + } + } +} + +impl InterfaceAddress { + /// Create an `InterfaceAddress` from the libc struct. + fn from_libc_ifaddrs(info: &libc::ifaddrs) -> InterfaceAddress { + let ifname = unsafe { ffi::CStr::from_ptr(info.ifa_name) }; + let address = unsafe { SockaddrStorage::from_raw(info.ifa_addr, None) }; + let netmask = unsafe { SockaddrStorage::from_raw(info.ifa_netmask, None) }; + let mut addr = InterfaceAddress { + interface_name: ifname.to_string_lossy().to_string(), + flags: InterfaceFlags::from_bits_truncate(info.ifa_flags as i32), + address, + netmask, + broadcast: None, + destination: None, + }; + + let ifu = get_ifu_from_sockaddr(info); + if addr.flags.contains(InterfaceFlags::IFF_POINTOPOINT) { + addr.destination = unsafe { SockaddrStorage::from_raw(ifu, None) }; + } else if addr.flags.contains(InterfaceFlags::IFF_BROADCAST) { + addr.broadcast = unsafe { SockaddrStorage::from_raw(ifu, None) }; + } + + addr + } +} + +/// Holds the results of `getifaddrs`. +/// +/// Use the function `getifaddrs` to create this Iterator. Note that the +/// actual list of interfaces can be iterated once and will be freed as +/// soon as the Iterator goes out of scope. +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct InterfaceAddressIterator { + base: *mut libc::ifaddrs, + next: *mut libc::ifaddrs, +} + +impl Drop for InterfaceAddressIterator { + fn drop(&mut self) { + unsafe { libc::freeifaddrs(self.base) }; + } +} + +impl Iterator for InterfaceAddressIterator { + type Item = InterfaceAddress; + fn next(&mut self) -> Option<::Item> { + match unsafe { self.next.as_ref() } { + Some(ifaddr) => { + self.next = ifaddr.ifa_next; + Some(InterfaceAddress::from_libc_ifaddrs(ifaddr)) + } + None => None, + } + } +} + +/// Get interface addresses using libc's `getifaddrs` +/// +/// Note that the underlying implementation differs between OSes. Only the +/// most common address families are supported by the nix crate (due to +/// lack of time and complexity of testing). The address family is encoded +/// in the specific variant of `SockaddrStorage` returned for the fields +/// `address`, `netmask`, `broadcast`, and `destination`. For any entry not +/// supported, the returned list will contain a `None` entry. +/// +/// # Example +/// ``` +/// let addrs = nix::ifaddrs::getifaddrs().unwrap(); +/// for ifaddr in addrs { +/// match ifaddr.address { +/// Some(address) => { +/// println!("interface {} address {}", +/// ifaddr.interface_name, address); +/// }, +/// None => { +/// println!("interface {} with unsupported address family", +/// ifaddr.interface_name); +/// } +/// } +/// } +/// ``` +pub fn getifaddrs() -> Result { + let mut addrs = mem::MaybeUninit::<*mut libc::ifaddrs>::uninit(); + unsafe { + Errno::result(libc::getifaddrs(addrs.as_mut_ptr())).map(|_| { + InterfaceAddressIterator { + base: addrs.assume_init(), + next: addrs.assume_init(), + } + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + // Only checks if `getifaddrs` can be invoked without panicking. + #[test] + fn test_getifaddrs() { + let _ = getifaddrs(); + } +} diff --git a/bash-5.1/vendor/nix/src/kmod.rs b/bash-5.1/vendor/nix/src/kmod.rs new file mode 100644 index 0000000000000000000000000000000000000000..c42068c70a619302d121cf035eb97164b25f094d --- /dev/null +++ b/bash-5.1/vendor/nix/src/kmod.rs @@ -0,0 +1,122 @@ +//! Load and unload kernel modules. +//! +//! For more details see + +use std::ffi::CStr; +use std::os::unix::io::AsRawFd; + +use crate::errno::Errno; +use crate::Result; + +/// Loads a kernel module from a buffer. +/// +/// It loads an ELF image into kernel space, +/// performs any necessary symbol relocations, +/// initializes module parameters to values provided by the caller, +/// and then runs the module's init function. +/// +/// This function requires `CAP_SYS_MODULE` privilege. +/// +/// The `module_image` argument points to a buffer containing the binary image +/// to be loaded. The buffer should contain a valid ELF image +/// built for the running kernel. +/// +/// The `param_values` argument is a string containing space-delimited specifications +/// of the values for module parameters. +/// Each of the parameter specifications has the form: +/// +/// `name[=value[,value...]]` +/// +/// # Example +/// +/// ```no_run +/// use std::fs::File; +/// use std::io::Read; +/// use std::ffi::CString; +/// use nix::kmod::init_module; +/// +/// let mut f = File::open("mykernel.ko").unwrap(); +/// let mut contents: Vec = Vec::new(); +/// f.read_to_end(&mut contents).unwrap(); +/// init_module(&mut contents, &CString::new("who=Rust when=Now,12").unwrap()).unwrap(); +/// ``` +/// +/// See [`man init_module(2)`](https://man7.org/linux/man-pages/man2/init_module.2.html) for more information. +pub fn init_module(module_image: &[u8], param_values: &CStr) -> Result<()> { + let res = unsafe { + libc::syscall( + libc::SYS_init_module, + module_image.as_ptr(), + module_image.len(), + param_values.as_ptr(), + ) + }; + + Errno::result(res).map(drop) +} + +libc_bitflags!( + /// Flags used by the `finit_module` function. + pub struct ModuleInitFlags: libc::c_uint { + /// Ignore symbol version hashes. + MODULE_INIT_IGNORE_MODVERSIONS; + /// Ignore kernel version magic. + MODULE_INIT_IGNORE_VERMAGIC; + } +); + +/// Loads a kernel module from a given file descriptor. +/// +/// # Example +/// +/// ```no_run +/// use std::fs::File; +/// use std::ffi::CString; +/// use nix::kmod::{finit_module, ModuleInitFlags}; +/// +/// let f = File::open("mymod.ko").unwrap(); +/// finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()).unwrap(); +/// ``` +/// +/// See [`man init_module(2)`](https://man7.org/linux/man-pages/man2/init_module.2.html) for more information. +pub fn finit_module(fd: &T, param_values: &CStr, flags: ModuleInitFlags) -> Result<()> { + let res = unsafe { + libc::syscall( + libc::SYS_finit_module, + fd.as_raw_fd(), + param_values.as_ptr(), + flags.bits(), + ) + }; + + Errno::result(res).map(drop) +} + +libc_bitflags!( + /// Flags used by `delete_module`. + /// + /// See [`man delete_module(2)`](https://man7.org/linux/man-pages/man2/delete_module.2.html) + /// for a detailed description how these flags work. + pub struct DeleteModuleFlags: libc::c_int { + O_NONBLOCK; + O_TRUNC; + } +); + +/// Unloads the kernel module with the given name. +/// +/// # Example +/// +/// ```no_run +/// use std::ffi::CString; +/// use nix::kmod::{delete_module, DeleteModuleFlags}; +/// +/// delete_module(&CString::new("mymod").unwrap(), DeleteModuleFlags::O_NONBLOCK).unwrap(); +/// ``` +/// +/// See [`man delete_module(2)`](https://man7.org/linux/man-pages/man2/delete_module.2.html) for more information. +pub fn delete_module(name: &CStr, flags: DeleteModuleFlags) -> Result<()> { + let res = unsafe { libc::syscall(libc::SYS_delete_module, name.as_ptr(), flags.bits()) }; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix/src/lib.rs b/bash-5.1/vendor/nix/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..770258dd362631079a9462dd6dea9e521ac74768 --- /dev/null +++ b/bash-5.1/vendor/nix/src/lib.rs @@ -0,0 +1,334 @@ +//! Rust friendly bindings to the various *nix system functions. +//! +//! Modules are structured according to the C header file that they would be +//! defined in. +//! +//! # Features +//! +//! Nix uses the following Cargo features to enable optional functionality. +//! They may be enabled in any combination. +//! * `acct` - Process accounting +//! * `aio` - POSIX AIO +//! * `dir` - Stuff relating to directory iteration +//! * `env` - Manipulate environment variables +//! * `event` - Event-driven APIs, like `kqueue` and `epoll` +//! * `feature` - Query characteristics of the OS at runtime +//! * `fs` - File system functionality +//! * `hostname` - Get and set the system's hostname +//! * `inotify` - Linux's `inotify` file system notification API +//! * `ioctl` - The `ioctl` syscall, and wrappers for my specific instances +//! * `kmod` - Load and unload kernel modules +//! * `mman` - Stuff relating to memory management +//! * `mount` - Mount and unmount file systems +//! * `mqueue` - POSIX message queues +//! * `net` - Networking-related functionality +//! * `personality` - Set the process execution domain +//! * `poll` - APIs like `poll` and `select` +//! * `process` - Stuff relating to running processes +//! * `pthread` - POSIX threads +//! * `ptrace` - Process tracing and debugging +//! * `quota` - File system quotas +//! * `reboot` - Reboot the system +//! * `resource` - Process resource limits +//! * `sched` - Manipulate process's scheduling +//! * `socket` - Sockets, whether for networking or local use +//! * `signal` - Send and receive signals to processes +//! * `term` - Terminal control APIs +//! * `time` - Query the operating system's clocks +//! * `ucontext` - User thread context +//! * `uio` - Vectored I/O +//! * `user` - Stuff relating to users and groups +//! * `zerocopy` - APIs like `sendfile` and `copy_file_range` +#![crate_name = "nix"] +#![cfg(unix)] +#![cfg_attr(docsrs, doc(cfg(all())))] +#![allow(non_camel_case_types)] +#![cfg_attr(test, deny(warnings))] +#![recursion_limit = "500"] +#![deny(unused)] +#![allow(unused_macros)] +#![cfg_attr(not(feature = "default"), allow(unused_imports))] +#![deny(unstable_features)] +#![deny(missing_copy_implementations)] +#![deny(missing_debug_implementations)] +#![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_cfg))] +#![deny(clippy::cast_ptr_alignment)] + +// Re-exported external crates +pub use libc; + +// Private internal modules +#[macro_use] +mod macros; + +// Public crates +#[cfg(not(target_os = "redox"))] +feature! { + #![feature = "dir"] + pub mod dir; +} +feature! { + #![feature = "env"] + pub mod env; +} +#[allow(missing_docs)] +pub mod errno; +feature! { + #![feature = "feature"] + + #[deny(missing_docs)] + pub mod features; +} +#[allow(missing_docs)] +pub mod fcntl; +feature! { + #![feature = "net"] + + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + #[deny(missing_docs)] + pub mod ifaddrs; + #[cfg(not(target_os = "redox"))] + #[deny(missing_docs)] + pub mod net; +} +#[cfg(any(target_os = "android", target_os = "linux"))] +feature! { + #![feature = "kmod"] + #[allow(missing_docs)] + pub mod kmod; +} +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +feature! { + #![feature = "mount"] + pub mod mount; +} +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd" +))] +feature! { + #![feature = "mqueue"] + pub mod mqueue; +} +feature! { + #![feature = "poll"] + pub mod poll; +} +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +feature! { + #![feature = "term"] + #[deny(missing_docs)] + pub mod pty; +} +feature! { + #![feature = "sched"] + pub mod sched; +} +pub mod sys; +feature! { + #![feature = "time"] + #[allow(missing_docs)] + pub mod time; +} +// This can be implemented for other platforms as soon as libc +// provides bindings for them. +#[cfg(all( + target_os = "linux", + any(target_arch = "s390x", target_arch = "x86", target_arch = "x86_64") +))] +feature! { + #![feature = "ucontext"] + #[allow(missing_docs)] + pub mod ucontext; +} +#[allow(missing_docs)] +pub mod unistd; + +use std::ffi::{CStr, CString, OsStr}; +use std::mem::MaybeUninit; +use std::os::unix::ffi::OsStrExt; +use std::path::{Path, PathBuf}; +use std::{ptr, result, slice}; + +use errno::Errno; + +/// Nix Result Type +pub type Result = result::Result; + +/// Nix's main error type. +/// +/// It's a wrapper around Errno. As such, it's very interoperable with +/// [`std::io::Error`], but it has the advantages of: +/// * `Clone` +/// * `Copy` +/// * `Eq` +/// * Small size +/// * Represents all of the system's errnos, instead of just the most common +/// ones. +pub type Error = Errno; + +/// Common trait used to represent file system paths by many Nix functions. +pub trait NixPath { + /// Is the path empty? + fn is_empty(&self) -> bool; + + /// Length of the path in bytes + fn len(&self) -> usize; + + /// Execute a function with this path as a `CStr`. + /// + /// Mostly used internally by Nix. + fn with_nix_path(&self, f: F) -> Result + where + F: FnOnce(&CStr) -> T; +} + +impl NixPath for str { + fn is_empty(&self) -> bool { + NixPath::is_empty(OsStr::new(self)) + } + + fn len(&self) -> usize { + NixPath::len(OsStr::new(self)) + } + + fn with_nix_path(&self, f: F) -> Result + where + F: FnOnce(&CStr) -> T, + { + OsStr::new(self).with_nix_path(f) + } +} + +impl NixPath for OsStr { + fn is_empty(&self) -> bool { + self.as_bytes().is_empty() + } + + fn len(&self) -> usize { + self.as_bytes().len() + } + + fn with_nix_path(&self, f: F) -> Result + where + F: FnOnce(&CStr) -> T, + { + self.as_bytes().with_nix_path(f) + } +} + +impl NixPath for CStr { + fn is_empty(&self) -> bool { + self.to_bytes().is_empty() + } + + fn len(&self) -> usize { + self.to_bytes().len() + } + + fn with_nix_path(&self, f: F) -> Result + where + F: FnOnce(&CStr) -> T, + { + Ok(f(self)) + } +} + +impl NixPath for [u8] { + fn is_empty(&self) -> bool { + self.is_empty() + } + + fn len(&self) -> usize { + self.len() + } + + fn with_nix_path(&self, f: F) -> Result + where + F: FnOnce(&CStr) -> T, + { + // The real PATH_MAX is typically 4096, but it's statistically unlikely to have a path + // longer than ~300 bytes. See the the PR description to get stats for your own machine. + // https://github.com/nix-rust/nix/pull/1656 + // + // By being smaller than a memory page, we also avoid the compiler inserting a probe frame: + // https://docs.rs/compiler_builtins/latest/compiler_builtins/probestack/index.html + const MAX_STACK_ALLOCATION: usize = 1024; + + if self.len() >= MAX_STACK_ALLOCATION { + return with_nix_path_allocating(self, f); + } + + let mut buf = MaybeUninit::<[u8; MAX_STACK_ALLOCATION]>::uninit(); + let buf_ptr = buf.as_mut_ptr() as *mut u8; + + unsafe { + ptr::copy_nonoverlapping(self.as_ptr(), buf_ptr, self.len()); + buf_ptr.add(self.len()).write(0); + } + + match CStr::from_bytes_with_nul(unsafe { + slice::from_raw_parts(buf_ptr, self.len() + 1) + }) { + Ok(s) => Ok(f(s)), + Err(_) => Err(Errno::EINVAL), + } + } +} + +#[cold] +#[inline(never)] +fn with_nix_path_allocating(from: &[u8], f: F) -> Result +where + F: FnOnce(&CStr) -> T, +{ + match CString::new(from) { + Ok(s) => Ok(f(&s)), + Err(_) => Err(Errno::EINVAL), + } +} + +impl NixPath for Path { + fn is_empty(&self) -> bool { + NixPath::is_empty(self.as_os_str()) + } + + fn len(&self) -> usize { + NixPath::len(self.as_os_str()) + } + + fn with_nix_path(&self, f: F) -> Result + where + F: FnOnce(&CStr) -> T, + { + self.as_os_str().with_nix_path(f) + } +} + +impl NixPath for PathBuf { + fn is_empty(&self) -> bool { + NixPath::is_empty(self.as_os_str()) + } + + fn len(&self) -> usize { + NixPath::len(self.as_os_str()) + } + + fn with_nix_path(&self, f: F) -> Result + where + F: FnOnce(&CStr) -> T, + { + self.as_os_str().with_nix_path(f) + } +} diff --git a/bash-5.1/vendor/nix/src/macros.rs b/bash-5.1/vendor/nix/src/macros.rs new file mode 100644 index 0000000000000000000000000000000000000000..99e0de88662fbeb77372a6c686ba5005dddcc1ba --- /dev/null +++ b/bash-5.1/vendor/nix/src/macros.rs @@ -0,0 +1,328 @@ +// Thanks to Tokio for this macro +macro_rules! feature { + ( + #![$meta:meta] + $($item:item)* + ) => { + $( + #[cfg($meta)] + #[cfg_attr(docsrs, doc(cfg($meta)))] + $item + )* + } +} + +/// The `libc_bitflags!` macro helps with a common use case of defining a public bitflags type +/// with values from the libc crate. It is used the same way as the `bitflags!` macro, except +/// that only the name of the flag value has to be given. +/// +/// The `libc` crate must be in scope with the name `libc`. +/// +/// # Example +/// ```ignore +/// libc_bitflags!{ +/// pub struct ProtFlags: libc::c_int { +/// PROT_NONE; +/// PROT_READ; +/// /// PROT_WRITE enables write protect +/// PROT_WRITE; +/// PROT_EXEC; +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSDOWN; +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSUP; +/// } +/// } +/// ``` +/// +/// Example with casting, due to a mistake in libc. In this example, the +/// various flags have different types, so we cast the broken ones to the right +/// type. +/// +/// ```ignore +/// libc_bitflags!{ +/// pub struct SaFlags: libc::c_ulong { +/// SA_NOCLDSTOP as libc::c_ulong; +/// SA_NOCLDWAIT; +/// SA_NODEFER as libc::c_ulong; +/// SA_ONSTACK; +/// SA_RESETHAND as libc::c_ulong; +/// SA_RESTART as libc::c_ulong; +/// SA_SIGINFO; +/// } +/// } +/// ``` +macro_rules! libc_bitflags { + ( + $(#[$outer:meta])* + pub struct $BitFlags:ident: $T:ty { + $( + $(#[$inner:ident $($args:tt)*])* + $Flag:ident $(as $cast:ty)*; + )+ + } + ) => { + ::bitflags::bitflags! { + $(#[$outer])* + pub struct $BitFlags: $T { + $( + $(#[$inner $($args)*])* + const $Flag = libc::$Flag $(as $cast)*; + )+ + } + } + }; +} + +/// The `libc_enum!` macro helps with a common use case of defining an enum exclusively using +/// values from the `libc` crate. This macro supports both `pub` and private `enum`s. +/// +/// The `libc` crate must be in scope with the name `libc`. +/// +/// # Example +/// ```ignore +/// libc_enum!{ +/// pub enum ProtFlags { +/// PROT_NONE, +/// PROT_READ, +/// PROT_WRITE, +/// PROT_EXEC, +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSDOWN, +/// #[cfg(any(target_os = "linux", target_os = "android"))] +/// PROT_GROWSUP, +/// } +/// } +/// ``` +// Some targets don't use all rules. +#[allow(unknown_lints)] +#[allow(unused_macro_rules)] +macro_rules! libc_enum { + // Exit rule. + (@make_enum + name: $BitFlags:ident, + { + $v:vis + attrs: [$($attrs:tt)*], + entries: [$($entries:tt)*], + } + ) => { + $($attrs)* + #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + $v enum $BitFlags { + $($entries)* + } + }; + + // Exit rule including TryFrom + (@make_enum + name: $BitFlags:ident, + { + $v:vis + attrs: [$($attrs:tt)*], + entries: [$($entries:tt)*], + from_type: $repr:path, + try_froms: [$($try_froms:tt)*] + } + ) => { + $($attrs)* + #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] + $v enum $BitFlags { + $($entries)* + } + impl ::std::convert::TryFrom<$repr> for $BitFlags { + type Error = $crate::Error; + #[allow(unused_doc_comments)] + fn try_from(x: $repr) -> $crate::Result { + match x { + $($try_froms)* + _ => Err($crate::Error::EINVAL) + } + } + } + }; + + // Done accumulating. + (@accumulate_entries + name: $BitFlags:ident, + { + $v:vis + attrs: $attrs:tt, + }, + $entries:tt, + $try_froms:tt; + ) => { + libc_enum! { + @make_enum + name: $BitFlags, + { + $v + attrs: $attrs, + entries: $entries, + } + } + }; + + // Done accumulating and want TryFrom + (@accumulate_entries + name: $BitFlags:ident, + { + $v:vis + attrs: $attrs:tt, + from_type: $repr:path, + }, + $entries:tt, + $try_froms:tt; + ) => { + libc_enum! { + @make_enum + name: $BitFlags, + { + $v + attrs: $attrs, + entries: $entries, + from_type: $repr, + try_froms: $try_froms + } + } + }; + + // Munch an attr. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + #[$attr:meta] $($tail:tt)* + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + #[$attr] + ], + [ + $($try_froms)* + #[$attr] + ]; + $($tail)* + } + }; + + // Munch last ident if not followed by a comma. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + $entry:ident + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + $entry = libc::$entry, + ], + [ + $($try_froms)* + libc::$entry => Ok($BitFlags::$entry), + ]; + } + }; + + // Munch an ident; covers terminating comma case. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + $entry:ident, + $($tail:tt)* + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + $entry = libc::$entry, + ], + [ + $($try_froms)* + libc::$entry => Ok($BitFlags::$entry), + ]; + $($tail)* + } + }; + + // Munch an ident and cast it to the given type; covers terminating comma. + (@accumulate_entries + name: $BitFlags:ident, + $prefix:tt, + [$($entries:tt)*], + [$($try_froms:tt)*]; + $entry:ident as $ty:ty, + $($tail:tt)* + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + $prefix, + [ + $($entries)* + $entry = libc::$entry as $ty, + ], + [ + $($try_froms)* + libc::$entry as $ty => Ok($BitFlags::$entry), + ]; + $($tail)* + } + }; + + // Entry rule. + ( + $(#[$attr:meta])* + $v:vis enum $BitFlags:ident { + $($vals:tt)* + } + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + { + $v + attrs: [$(#[$attr])*], + }, + [], + []; + $($vals)* + } + }; + + // Entry rule including TryFrom + ( + $(#[$attr:meta])* + $v:vis enum $BitFlags:ident { + $($vals:tt)* + } + impl TryFrom<$repr:path> + ) => { + libc_enum! { + @accumulate_entries + name: $BitFlags, + { + $v + attrs: [$(#[$attr])*], + from_type: $repr, + }, + [], + []; + $($vals)* + } + }; +} diff --git a/bash-5.1/vendor/nix/src/mount/bsd.rs b/bash-5.1/vendor/nix/src/mount/bsd.rs new file mode 100644 index 0000000000000000000000000000000000000000..109522f9fbc25b7d3ca88f46028791871508535c --- /dev/null +++ b/bash-5.1/vendor/nix/src/mount/bsd.rs @@ -0,0 +1,443 @@ +use crate::{ + Error, + Errno, + NixPath, + Result, +}; +use libc::{c_char, c_int, c_uint, c_void}; +use std::{ + borrow::Cow, + ffi::{CString, CStr}, + fmt, + io, + marker::PhantomData, +}; + + +libc_bitflags!( + /// Used with [`Nmount::nmount`]. + pub struct MntFlags: c_int { + /// ACL support enabled. + #[cfg(any(target_os = "netbsd", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_ACLS; + /// All I/O to the file system should be done asynchronously. + MNT_ASYNC; + /// dir should instead be a file system ID encoded as “FSID:val0:val1”. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_BYFSID; + /// Force a read-write mount even if the file system appears to be + /// unclean. + MNT_FORCE; + /// GEOM journal support enabled. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_GJOURNAL; + /// MAC support for objects. + #[cfg(any(target_os = "macos", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_MULTILABEL; + /// Disable read clustering. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_NOCLUSTERR; + /// Disable write clustering. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_NOCLUSTERW; + /// Enable NFS version 4 ACLs. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_NFS4ACLS; + /// Do not update access times. + MNT_NOATIME; + /// Disallow program execution. + MNT_NOEXEC; + /// Do not honor setuid or setgid bits on files when executing them. + MNT_NOSUID; + /// Do not follow symlinks. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_NOSYMFOLLOW; + /// Mount read-only. + MNT_RDONLY; + /// Causes the vfs subsystem to update its data structures pertaining to + /// the specified already mounted file system. + MNT_RELOAD; + /// Create a snapshot of the file system. + /// + /// See [mksnap_ffs(8)](https://www.freebsd.org/cgi/man.cgi?query=mksnap_ffs) + #[cfg(any(target_os = "macos", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_SNAPSHOT; + /// Using soft updates. + #[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_SOFTDEP; + /// Directories with the SUID bit set chown new files to their own + /// owner. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_SUIDDIR; + /// All I/O to the file system should be done synchronously. + MNT_SYNCHRONOUS; + /// Union with underlying fs. + #[cfg(any( + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_UNION; + /// Indicates that the mount command is being applied to an already + /// mounted file system. + MNT_UPDATE; + /// Check vnode use counts. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MNT_NONBUSY; + } +); + + +/// The Error type of [`Nmount::nmount`]. +/// +/// It wraps an [`Errno`], but also may contain an additional message returned +/// by `nmount(2)`. +#[derive(Debug)] +pub struct NmountError { + errno: Error, + errmsg: Option +} + +impl NmountError { + /// Returns the additional error string sometimes generated by `nmount(2)`. + pub fn errmsg(&self) -> Option<&str> { + self.errmsg.as_deref() + } + + /// Returns the inner [`Error`] + pub const fn error(&self) -> Error { + self.errno + } + + fn new(error: Error, errmsg: Option<&CStr>) -> Self { + Self { + errno: error, + errmsg: errmsg.map(CStr::to_string_lossy).map(Cow::into_owned) + } + } +} + +impl std::error::Error for NmountError {} + +impl fmt::Display for NmountError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if let Some(errmsg) = &self.errmsg { + write!(f, "{:?}: {}: {}", self.errno, errmsg, self.errno.desc()) + } else { + write!(f, "{:?}: {}", self.errno, self.errno.desc()) + } + } +} + +impl From for io::Error { + fn from(err: NmountError) -> Self { + err.errno.into() + } +} + +/// Result type of [`Nmount::nmount`]. +pub type NmountResult = std::result::Result<(), NmountError>; + +/// Mount a FreeBSD file system. +/// +/// The `nmount(2)` system call works similarly to the `mount(8)` program; it +/// takes its options as a series of name-value pairs. Most of the values are +/// strings, as are all of the names. The `Nmount` structure builds up an +/// argument list and then executes the syscall. +/// +/// # Examples +/// +/// To mount `target` onto `mountpoint` with `nullfs`: +/// ``` +/// # use nix::unistd::Uid; +/// # use ::sysctl::{CtlValue, Sysctl}; +/// # let ctl = ::sysctl::Ctl::new("vfs.usermount").unwrap(); +/// # if !Uid::current().is_root() && CtlValue::Int(0) == ctl.value().unwrap() { +/// # return; +/// # }; +/// use nix::mount::{MntFlags, Nmount, unmount}; +/// use std::ffi::CString; +/// use tempfile::tempdir; +/// +/// let mountpoint = tempdir().unwrap(); +/// let target = tempdir().unwrap(); +/// +/// let fstype = CString::new("fstype").unwrap(); +/// let nullfs = CString::new("nullfs").unwrap(); +/// Nmount::new() +/// .str_opt(&fstype, &nullfs) +/// .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) +/// .str_opt_owned("target", target.path().to_str().unwrap()) +/// .nmount(MntFlags::empty()).unwrap(); +/// +/// unmount(mountpoint.path(), MntFlags::empty()).unwrap(); +/// ``` +/// +/// # See Also +/// * [`nmount(2)`](https://www.freebsd.org/cgi/man.cgi?query=nmount) +/// * [`nullfs(5)`](https://www.freebsd.org/cgi/man.cgi?query=nullfs) +#[cfg(target_os = "freebsd")] +#[cfg_attr(docsrs, doc(cfg(all())))] +#[derive(Debug, Default)] +pub struct Nmount<'a>{ + // n.b. notgull: In reality, this is a list that contains + // both mutable and immutable pointers. + // Be careful using this. + iov: Vec, + is_owned: Vec, + marker: PhantomData<&'a ()>, +} + +#[cfg(target_os = "freebsd")] +#[cfg_attr(docsrs, doc(cfg(all())))] +impl<'a> Nmount<'a> { + /// Helper function to push a slice onto the `iov` array. + fn push_slice(&mut self, val: &'a [u8], is_owned: bool) { + self.iov.push(libc::iovec { + iov_base: val.as_ptr() as *mut _, + iov_len: val.len(), + }); + self.is_owned.push(is_owned); + } + + /// Helper function to push a pointer and its length onto the `iov` array. + fn push_pointer_and_length(&mut self, val: *const u8, len: usize, is_owned: bool) { + self.iov.push(libc::iovec { + iov_base: val as *mut _, + iov_len: len, + }); + self.is_owned.push(is_owned); + } + + /// Helper function to push a `nix` path as owned. + fn push_nix_path(&mut self, val: &P) { + val.with_nix_path(|s| { + let len = s.to_bytes_with_nul().len(); + let ptr = s.to_owned().into_raw() as *const u8; + + self.push_pointer_and_length(ptr, len, true); + }).unwrap(); + } + + /// Add an opaque mount option. + /// + /// Some file systems take binary-valued mount options. They can be set + /// with this method. + /// + /// # Safety + /// + /// Unsafe because it will cause `Nmount::nmount` to dereference a raw + /// pointer. The user is responsible for ensuring that `val` is valid and + /// its lifetime outlives `self`! An easy way to do that is to give the + /// value a larger scope than `name` + /// + /// # Examples + /// ``` + /// use libc::c_void; + /// use nix::mount::Nmount; + /// use std::ffi::CString; + /// use std::mem; + /// + /// // Note that flags outlives name + /// let mut flags: u32 = 0xdeadbeef; + /// let name = CString::new("flags").unwrap(); + /// let p = &mut flags as *mut u32 as *mut c_void; + /// let len = mem::size_of_val(&flags); + /// let mut nmount = Nmount::new(); + /// unsafe { nmount.mut_ptr_opt(&name, p, len) }; + /// ``` + pub unsafe fn mut_ptr_opt( + &mut self, + name: &'a CStr, + val: *mut c_void, + len: usize + ) -> &mut Self + { + self.push_slice(name.to_bytes_with_nul(), false); + self.push_pointer_and_length(val.cast(), len, false); + self + } + + /// Add a mount option that does not take a value. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// use std::ffi::CString; + /// + /// let read_only = CString::new("ro").unwrap(); + /// Nmount::new() + /// .null_opt(&read_only); + /// ``` + pub fn null_opt(&mut self, name: &'a CStr) -> &mut Self { + self.push_slice(name.to_bytes_with_nul(), false); + self.push_slice(&[], false); + self + } + + /// Add a mount option that does not take a value, but whose name must be + /// owned. + /// + /// + /// This has higher runtime cost than [`Nmount::null_opt`], but is useful + /// when the name's lifetime doesn't outlive the `Nmount`, or it's a + /// different string type than `CStr`. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// + /// let read_only = "ro"; + /// let mut nmount: Nmount<'static> = Nmount::new(); + /// nmount.null_opt_owned(read_only); + /// ``` + pub fn null_opt_owned(&mut self, name: &P) -> &mut Self + { + self.push_nix_path(name); + self.push_slice(&[], false); + self + } + + /// Add a mount option as a [`CStr`]. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// use std::ffi::CString; + /// + /// let fstype = CString::new("fstype").unwrap(); + /// let nullfs = CString::new("nullfs").unwrap(); + /// Nmount::new() + /// .str_opt(&fstype, &nullfs); + /// ``` + pub fn str_opt( + &mut self, + name: &'a CStr, + val: &'a CStr + ) -> &mut Self + { + self.push_slice(name.to_bytes_with_nul(), false); + self.push_slice(val.to_bytes_with_nul(), false); + self + } + + /// Add a mount option as an owned string. + /// + /// This has higher runtime cost than [`Nmount::str_opt`], but is useful + /// when the value's lifetime doesn't outlive the `Nmount`, or it's a + /// different string type than `CStr`. + /// + /// # Examples + /// ``` + /// use nix::mount::Nmount; + /// use std::path::Path; + /// + /// let mountpoint = Path::new("/mnt"); + /// Nmount::new() + /// .str_opt_owned("fspath", mountpoint.to_str().unwrap()); + /// ``` + pub fn str_opt_owned(&mut self, name: &P1, val: &P2) -> &mut Self + where P1: ?Sized + NixPath, + P2: ?Sized + NixPath + { + self.push_nix_path(name); + self.push_nix_path(val); + self + } + + /// Create a new `Nmount` struct with no options + pub fn new() -> Self { + Self::default() + } + + /// Actually mount the file system. + pub fn nmount(&mut self, flags: MntFlags) -> NmountResult { + const ERRMSG_NAME: &[u8] = b"errmsg\0"; + let mut errmsg = vec![0u8; 255]; + + // nmount can return extra error information via a "errmsg" return + // argument. + self.push_slice(ERRMSG_NAME, false); + + // SAFETY: we are pushing a mutable iovec here, so we can't use + // the above method + self.iov.push(libc::iovec { + iov_base: errmsg.as_mut_ptr() as *mut c_void, + iov_len: errmsg.len(), + }); + + let niov = self.iov.len() as c_uint; + let iovp = self.iov.as_mut_ptr() as *mut libc::iovec; + let res = unsafe { + libc::nmount(iovp, niov, flags.bits) + }; + match Errno::result(res) { + Ok(_) => Ok(()), + Err(error) => { + let errmsg = match errmsg.iter().position(|&x| x == 0) { + None => None, + Some(0) => None, + Some(n) => { + let sl = &errmsg[0..n + 1]; + Some(CStr::from_bytes_with_nul(sl).unwrap()) + } + }; + Err(NmountError::new(error, errmsg)) + } + } + } +} + +#[cfg(target_os = "freebsd")] +impl<'a> Drop for Nmount<'a> { + fn drop(&mut self) { + for (iov, is_owned) in self.iov.iter().zip(self.is_owned.iter()) { + if *is_owned { + // Free the owned string. Safe because we recorded ownership, + // and Nmount does not implement Clone. + unsafe { + drop(CString::from_raw(iov.iov_base as *mut c_char)); + } + } + } + } +} + +/// Unmount the file system mounted at `mountpoint`. +/// +/// Useful flags include +/// * `MNT_FORCE` - Unmount even if still in use. +/// * `MNT_BYFSID` - `mountpoint` is not a path, but a file system ID +/// encoded as `FSID:val0:val1`, where `val0` and `val1` +/// are the contents of the `fsid_t val[]` array in decimal. +/// The file system that has the specified file system ID +/// will be unmounted. See +/// [`statfs`](crate::sys::statfs::statfs) to determine the +/// `fsid`. +pub fn unmount

(mountpoint: &P, flags: MntFlags) -> Result<()> + where P: ?Sized + NixPath +{ + let res = mountpoint.with_nix_path(|cstr| { + unsafe { libc::unmount(cstr.as_ptr(), flags.bits) } + })?; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix/src/mount/linux.rs b/bash-5.1/vendor/nix/src/mount/linux.rs new file mode 100644 index 0000000000000000000000000000000000000000..4c976dcb5a241926a5bed4fa63a07054468c597c --- /dev/null +++ b/bash-5.1/vendor/nix/src/mount/linux.rs @@ -0,0 +1,112 @@ +#![allow(missing_docs)] +use libc::{self, c_ulong, c_int}; +use crate::{Result, NixPath}; +use crate::errno::Errno; + +libc_bitflags!( + pub struct MsFlags: c_ulong { + /// Mount read-only + MS_RDONLY; + /// Ignore suid and sgid bits + MS_NOSUID; + /// Disallow access to device special files + MS_NODEV; + /// Disallow program execution + MS_NOEXEC; + /// Writes are synced at once + MS_SYNCHRONOUS; + /// Alter flags of a mounted FS + MS_REMOUNT; + /// Allow mandatory locks on a FS + MS_MANDLOCK; + /// Directory modifications are synchronous + MS_DIRSYNC; + /// Do not update access times + MS_NOATIME; + /// Do not update directory access times + MS_NODIRATIME; + /// Linux 2.4.0 - Bind directory at different place + MS_BIND; + MS_MOVE; + MS_REC; + MS_SILENT; + MS_POSIXACL; + MS_UNBINDABLE; + MS_PRIVATE; + MS_SLAVE; + MS_SHARED; + MS_RELATIME; + MS_KERNMOUNT; + MS_I_VERSION; + MS_STRICTATIME; + MS_LAZYTIME; + MS_ACTIVE; + MS_NOUSER; + MS_RMT_MASK; + MS_MGC_VAL; + MS_MGC_MSK; + } +); + +libc_bitflags!( + pub struct MntFlags: c_int { + MNT_FORCE; + MNT_DETACH; + MNT_EXPIRE; + UMOUNT_NOFOLLOW; + } +); + +pub fn mount( + source: Option<&P1>, + target: &P2, + fstype: Option<&P3>, + flags: MsFlags, + data: Option<&P4>) -> Result<()> { + + fn with_opt_nix_path(p: Option<&P>, f: F) -> Result + where P: ?Sized + NixPath, + F: FnOnce(*const libc::c_char) -> T + { + match p { + Some(path) => path.with_nix_path(|p_str| f(p_str.as_ptr())), + None => Ok(f(std::ptr::null())) + } + } + + let res = with_opt_nix_path(source, |s| { + target.with_nix_path(|t| { + with_opt_nix_path(fstype, |ty| { + with_opt_nix_path(data, |d| { + unsafe { + libc::mount( + s, + t.as_ptr(), + ty, + flags.bits, + d as *const libc::c_void + ) + } + }) + }) + }) + })????; + + Errno::result(res).map(drop) +} + +pub fn umount(target: &P) -> Result<()> { + let res = target.with_nix_path(|cstr| { + unsafe { libc::umount(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) +} + +pub fn umount2(target: &P, flags: MntFlags) -> Result<()> { + let res = target.with_nix_path(|cstr| { + unsafe { libc::umount2(cstr.as_ptr(), flags.bits) } + })?; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix/src/mount/mod.rs b/bash-5.1/vendor/nix/src/mount/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..e89c1a07c386c3b76adfe5080e853c9f3726657e --- /dev/null +++ b/bash-5.1/vendor/nix/src/mount/mod.rs @@ -0,0 +1,23 @@ +//! Mount file systems +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod linux; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::linux::*; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod bsd; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd" + ))] +pub use self::bsd::*; diff --git a/bash-5.1/vendor/nix/src/mqueue.rs b/bash-5.1/vendor/nix/src/mqueue.rs new file mode 100644 index 0000000000000000000000000000000000000000..e3c0c43eeef2fc96bbc9c3c70ac15ad80f701c35 --- /dev/null +++ b/bash-5.1/vendor/nix/src/mqueue.rs @@ -0,0 +1,248 @@ +//! Posix Message Queue functions +//! +//! # Example +//! +// no_run because a kernel module may be required. +//! ```no_run +//! # use std::ffi::CString; +//! # use nix::mqueue::*; +//! use nix::sys::stat::Mode; +//! +//! const MSG_SIZE: mq_attr_member_t = 32; +//! let mq_name= CString::new("/a_nix_test_queue").unwrap(); +//! +//! let oflag0 = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; +//! let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; +//! let mqd0 = mq_open(&mq_name, oflag0, mode, None).unwrap(); +//! let msg_to_send = b"msg_1"; +//! mq_send(&mqd0, msg_to_send, 1).unwrap(); +//! +//! let oflag1 = MQ_OFlag::O_CREAT | MQ_OFlag::O_RDONLY; +//! let mqd1 = mq_open(&mq_name, oflag1, mode, None).unwrap(); +//! let mut buf = [0u8; 32]; +//! let mut prio = 0u32; +//! let len = mq_receive(&mqd1, &mut buf, &mut prio).unwrap(); +//! assert_eq!(prio, 1); +//! assert_eq!(msg_to_send, &buf[0..len]); +//! +//! mq_close(mqd1).unwrap(); +//! mq_close(mqd0).unwrap(); +//! ``` +//! [Further reading and details on the C API](https://man7.org/linux/man-pages/man7/mq_overview.7.html) + +use crate::Result; +use crate::errno::Errno; + +use libc::{self, c_char, mqd_t, size_t}; +use std::ffi::CStr; +use crate::sys::stat::Mode; +use std::mem; + +libc_bitflags!{ + /// Used with [`mq_open`]. + pub struct MQ_OFlag: libc::c_int { + /// Open the message queue for receiving messages. + O_RDONLY; + /// Open the queue for sending messages. + O_WRONLY; + /// Open the queue for both receiving and sending messages + O_RDWR; + /// Create a message queue. + O_CREAT; + /// If set along with `O_CREAT`, `mq_open` will fail if the message + /// queue name exists. + O_EXCL; + /// `mq_send` and `mq_receive` should fail with `EAGAIN` rather than + /// wait for resources that are not currently available. + O_NONBLOCK; + /// Set the close-on-exec flag for the message queue descriptor. + O_CLOEXEC; + } +} + +/// A message-queue attribute, optionally used with [`mq_setattr`] and +/// [`mq_getattr`] and optionally [`mq_open`], +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct MqAttr { + mq_attr: libc::mq_attr, +} + +/// Identifies an open POSIX Message Queue +// A safer wrapper around libc::mqd_t, which is a pointer on some platforms +// Deliberately is not Clone to prevent use-after-close scenarios +#[repr(transparent)] +#[derive(Debug)] +#[allow(missing_copy_implementations)] +pub struct MqdT(mqd_t); + +// x32 compatibility +// See https://sourceware.org/bugzilla/show_bug.cgi?id=21279 +/// Size of a message queue attribute member +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub type mq_attr_member_t = i64; +/// Size of a message queue attribute member +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub type mq_attr_member_t = libc::c_long; + +impl MqAttr { + /// Create a new message queue attribute + /// + /// # Arguments + /// + /// - `mq_flags`: Either `0` or `O_NONBLOCK`. + /// - `mq_maxmsg`: Maximum number of messages on the queue. + /// - `mq_msgsize`: Maximum message size in bytes. + /// - `mq_curmsgs`: Number of messages currently in the queue. + pub fn new(mq_flags: mq_attr_member_t, + mq_maxmsg: mq_attr_member_t, + mq_msgsize: mq_attr_member_t, + mq_curmsgs: mq_attr_member_t) + -> MqAttr + { + let mut attr = mem::MaybeUninit::::uninit(); + unsafe { + let p = attr.as_mut_ptr(); + (*p).mq_flags = mq_flags; + (*p).mq_maxmsg = mq_maxmsg; + (*p).mq_msgsize = mq_msgsize; + (*p).mq_curmsgs = mq_curmsgs; + MqAttr { mq_attr: attr.assume_init() } + } + } + + /// The current flags, either `0` or `O_NONBLOCK`. + pub const fn flags(&self) -> mq_attr_member_t { + self.mq_attr.mq_flags + } + + /// The max number of messages that can be held by the queue + pub const fn maxmsg(&self) -> mq_attr_member_t { + self.mq_attr.mq_maxmsg + } + + /// The maximum size of each message (in bytes) + pub const fn msgsize(&self) -> mq_attr_member_t { + self.mq_attr.mq_msgsize + } + + /// The number of messages currently held in the queue + pub const fn curmsgs(&self) -> mq_attr_member_t { + self.mq_attr.mq_curmsgs + } +} + + +/// Open a message queue +/// +/// See also [`mq_open(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_open.html) +// The mode.bits cast is only lossless on some OSes +#[allow(clippy::cast_lossless)] +pub fn mq_open(name: &CStr, + oflag: MQ_OFlag, + mode: Mode, + attr: Option<&MqAttr>) + -> Result { + let res = match attr { + Some(mq_attr) => unsafe { + libc::mq_open(name.as_ptr(), + oflag.bits(), + mode.bits() as libc::c_int, + &mq_attr.mq_attr as *const libc::mq_attr) + }, + None => unsafe { libc::mq_open(name.as_ptr(), oflag.bits()) }, + }; + Errno::result(res).map(MqdT) +} + +/// Remove a message queue +/// +/// See also [`mq_unlink(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_unlink.html) +pub fn mq_unlink(name: &CStr) -> Result<()> { + let res = unsafe { libc::mq_unlink(name.as_ptr()) }; + Errno::result(res).map(drop) +} + +/// Close a message queue +/// +/// See also [`mq_close(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_close.html) +pub fn mq_close(mqdes: MqdT) -> Result<()> { + let res = unsafe { libc::mq_close(mqdes.0) }; + Errno::result(res).map(drop) +} + +/// Receive a message from a message queue +/// +/// See also [`mq_receive(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_receive.html) +pub fn mq_receive(mqdes: &MqdT, message: &mut [u8], msg_prio: &mut u32) -> Result { + let len = message.len() as size_t; + let res = unsafe { + libc::mq_receive(mqdes.0, + message.as_mut_ptr() as *mut c_char, + len, + msg_prio as *mut u32) + }; + Errno::result(res).map(|r| r as usize) +} + +/// Send a message to a message queue +/// +/// See also [`mq_send(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_send.html) +pub fn mq_send(mqdes: &MqdT, message: &[u8], msq_prio: u32) -> Result<()> { + let res = unsafe { + libc::mq_send(mqdes.0, + message.as_ptr() as *const c_char, + message.len(), + msq_prio) + }; + Errno::result(res).map(drop) +} + +/// Get message queue attributes +/// +/// See also [`mq_getattr(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_getattr.html) +pub fn mq_getattr(mqd: &MqdT) -> Result { + let mut attr = mem::MaybeUninit::::uninit(); + let res = unsafe { libc::mq_getattr(mqd.0, attr.as_mut_ptr()) }; + Errno::result(res).map(|_| unsafe{MqAttr { mq_attr: attr.assume_init() }}) +} + +/// Set the attributes of the message queue. Only `O_NONBLOCK` can be set, everything else will be ignored +/// Returns the old attributes +/// It is recommend to use the `mq_set_nonblock()` and `mq_remove_nonblock()` convenience functions as they are easier to use +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_setattr.html) +pub fn mq_setattr(mqd: &MqdT, newattr: &MqAttr) -> Result { + let mut attr = mem::MaybeUninit::::uninit(); + let res = unsafe { + libc::mq_setattr(mqd.0, &newattr.mq_attr as *const libc::mq_attr, attr.as_mut_ptr()) + }; + Errno::result(res).map(|_| unsafe{ MqAttr { mq_attr: attr.assume_init() }}) +} + +/// Convenience function. +/// Sets the `O_NONBLOCK` attribute for a given message queue descriptor +/// Returns the old attributes +#[allow(clippy::useless_conversion)] // Not useless on all OSes +pub fn mq_set_nonblock(mqd: &MqdT) -> Result { + let oldattr = mq_getattr(mqd)?; + let newattr = MqAttr::new(mq_attr_member_t::from(MQ_OFlag::O_NONBLOCK.bits()), + oldattr.mq_attr.mq_maxmsg, + oldattr.mq_attr.mq_msgsize, + oldattr.mq_attr.mq_curmsgs); + mq_setattr(mqd, &newattr) +} + +/// Convenience function. +/// Removes `O_NONBLOCK` attribute for a given message queue descriptor +/// Returns the old attributes +pub fn mq_remove_nonblock(mqd: &MqdT) -> Result { + let oldattr = mq_getattr(mqd)?; + let newattr = MqAttr::new(0, + oldattr.mq_attr.mq_maxmsg, + oldattr.mq_attr.mq_msgsize, + oldattr.mq_attr.mq_curmsgs); + mq_setattr(mqd, &newattr) +} diff --git a/bash-5.1/vendor/nix/src/net/if_.rs b/bash-5.1/vendor/nix/src/net/if_.rs new file mode 100644 index 0000000000000000000000000000000000000000..045efad9cc3fe5c5030a1ff4e9e01394e515b759 --- /dev/null +++ b/bash-5.1/vendor/nix/src/net/if_.rs @@ -0,0 +1,468 @@ +//! Network interface name resolution. +//! +//! Uses Linux and/or POSIX functions to resolve interface names like "eth0" +//! or "socan1" into device numbers. + +use crate::{Error, NixPath, Result}; +use libc::c_uint; + +/// Resolve an interface into a interface number. +pub fn if_nametoindex(name: &P) -> Result { + let if_index = name.with_nix_path(|name| unsafe { libc::if_nametoindex(name.as_ptr()) })?; + + if if_index == 0 { + Err(Error::last()) + } else { + Ok(if_index) + } +} + +libc_bitflags!( + /// Standard interface flags, used by `getifaddrs` + pub struct InterfaceFlags: libc::c_int { + /// Interface is running. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_UP; + /// Valid broadcast address set. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_BROADCAST; + /// Internal debugging flag. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(not(target_os = "haiku"))] + IFF_DEBUG; + /// Interface is a loopback interface. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_LOOPBACK; + /// Interface is a point-to-point link. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_POINTOPOINT; + /// Avoid use of trailers. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NOTRAILERS; + /// Interface manages own routes. + #[cfg(any(target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_SMART; + /// Resources allocated. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "illumos", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_RUNNING; + /// No arp protocol, L2 destination address not set. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_NOARP; + /// Interface is in promiscuous mode. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_PROMISC; + /// Receive all multicast packets. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_ALLMULTI; + /// Master of a load balancing bundle. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_MASTER; + /// transmission in progress, tx hardware queue is full + #[cfg(any(target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_OACTIVE; + /// Protocol code on board. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_INTELLIGENT; + /// Slave of a load balancing bundle. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_SLAVE; + /// Can't hear own transmissions. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_SIMPLEX; + /// Supports multicast. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + IFF_MULTICAST; + /// Per link layer defined bit. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_LINK0; + /// Multicast using broadcast. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_MULTI_BCAST; + /// Is able to select media type via ifmap. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_PORTSEL; + /// Per link layer defined bit. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_LINK1; + /// Non-unique address. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_UNNUMBERED; + /// Auto media selection active. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_AUTOMEDIA; + /// Per link layer defined bit. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "ios"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_LINK2; + /// Use alternate physical connection. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_ALTPHYS; + /// DHCP controls interface. + #[cfg(any(target_os = "solaris", target_os = "illumos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DHCPRUNNING; + /// The addresses are lost when the interface goes down. (see + /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DYNAMIC; + /// Do not advertise. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_PRIVATE; + /// Driver signals L1 up. Volatile. + #[cfg(any(target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_LOWER_UP; + /// Interface is in polling mode. + #[cfg(any(target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_POLLING_COMPAT; + /// Unconfigurable using ioctl(2). + #[cfg(any(target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_CANTCONFIG; + /// Do not transmit packets. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NOXMIT; + /// Driver signals dormant. Volatile. + #[cfg(any(target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DORMANT; + /// User-requested promisc mode. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_PPROMISC; + /// Just on-link subnet. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NOLOCAL; + /// Echo sent packets. Volatile. + #[cfg(any(target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_ECHO; + /// User-requested monitor mode. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_MONITOR; + /// Address is deprecated. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DEPRECATED; + /// Static ARP. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_STATICARP; + /// Address from stateless addrconf. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_ADDRCONF; + /// Interface is in polling mode. + #[cfg(any(target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NPOLLING; + /// Router on interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_ROUTER; + /// Interface is in polling mode. + #[cfg(any(target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_IDIRECT; + /// Interface is winding down + #[cfg(any(target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DYING; + /// No NUD on interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NONUD; + /// Interface is being renamed + #[cfg(any(target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_RENAMING; + /// Anycast address. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_ANYCAST; + /// Don't exchange routing info. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NORTEXCH; + /// Do not provide packet information + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NO_PI as libc::c_int; + /// TUN device (no Ethernet headers) + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_TUN as libc::c_int; + /// TAP device + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_TAP as libc::c_int; + /// IPv4 interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_IPV4; + /// IPv6 interface. + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_IPV6; + /// in.mpathd test address + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_NOFAILOVER; + /// Interface has failed + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_FAILED; + /// Interface is a hot-spare + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_STANDBY; + /// Functioning but not used + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_INACTIVE; + /// Interface is offline + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_OFFLINE; + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_COS_ENABLED; + /// Prefer as source addr. + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_PREFERRED; + /// RFC3041 + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_TEMPORARY; + /// MTU set with SIOCSLIFMTU + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_FIXEDMTU; + /// Cannot send / receive packets + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_VIRTUAL; + /// Local address in use + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_DUPLICATE; + /// IPMP IP interface + #[cfg(target_os = "solaris")] + #[cfg_attr(docsrs, doc(cfg(all())))] + IFF_IPMP; + } +); + +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod if_nameindex { + use super::*; + + use std::ffi::CStr; + use std::fmt; + use std::marker::PhantomData; + use std::ptr::NonNull; + + /// A network interface. Has a name like "eth0" or "wlp4s0" or "wlan0", as well as an index + /// (1, 2, 3, etc) that identifies it in the OS's networking stack. + #[allow(missing_copy_implementations)] + #[repr(transparent)] + pub struct Interface(libc::if_nameindex); + + impl Interface { + /// Obtain the index of this interface. + pub fn index(&self) -> c_uint { + self.0.if_index + } + + /// Obtain the name of this interface. + pub fn name(&self) -> &CStr { + unsafe { CStr::from_ptr(self.0.if_name) } + } + } + + impl fmt::Debug for Interface { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Interface") + .field("index", &self.index()) + .field("name", &self.name()) + .finish() + } + } + + /// A list of the network interfaces available on this system. Obtained from [`if_nameindex()`]. + pub struct Interfaces { + ptr: NonNull, + } + + impl Interfaces { + /// Iterate over the interfaces in this list. + #[inline] + pub fn iter(&self) -> InterfacesIter<'_> { + self.into_iter() + } + + /// Convert this to a slice of interfaces. Note that the underlying interfaces list is + /// null-terminated, so calling this calculates the length. If random access isn't needed, + /// [`Interfaces::iter()`] should be used instead. + pub fn to_slice(&self) -> &[Interface] { + let ifs = self.ptr.as_ptr() as *const Interface; + let len = self.iter().count(); + unsafe { std::slice::from_raw_parts(ifs, len) } + } + } + + impl Drop for Interfaces { + fn drop(&mut self) { + unsafe { libc::if_freenameindex(self.ptr.as_ptr()) }; + } + } + + impl fmt::Debug for Interfaces { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.to_slice().fmt(f) + } + } + + impl<'a> IntoIterator for &'a Interfaces { + type IntoIter = InterfacesIter<'a>; + type Item = &'a Interface; + #[inline] + fn into_iter(self) -> Self::IntoIter { + InterfacesIter { + ptr: self.ptr.as_ptr(), + _marker: PhantomData, + } + } + } + + /// An iterator over the interfaces in an [`Interfaces`]. + #[derive(Debug)] + pub struct InterfacesIter<'a> { + ptr: *const libc::if_nameindex, + _marker: PhantomData<&'a Interfaces>, + } + + impl<'a> Iterator for InterfacesIter<'a> { + type Item = &'a Interface; + #[inline] + fn next(&mut self) -> Option { + unsafe { + if (*self.ptr).if_index == 0 { + None + } else { + let ret = &*(self.ptr as *const Interface); + self.ptr = self.ptr.add(1); + Some(ret) + } + } + } + } + + /// Retrieve a list of the network interfaces available on the local system. + /// + /// ``` + /// let interfaces = nix::net::if_::if_nameindex().unwrap(); + /// for iface in &interfaces { + /// println!("Interface #{} is called {}", iface.index(), iface.name().to_string_lossy()); + /// } + /// ``` + pub fn if_nameindex() -> Result { + unsafe { + let ifs = libc::if_nameindex(); + let ptr = NonNull::new(ifs).ok_or_else(Error::last)?; + Ok(Interfaces { ptr }) + } + } +} +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +pub use if_nameindex::*; diff --git a/bash-5.1/vendor/nix/src/net/mod.rs b/bash-5.1/vendor/nix/src/net/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..079fcfde6fd4436e3b595295ff9e4c18f20b002c --- /dev/null +++ b/bash-5.1/vendor/nix/src/net/mod.rs @@ -0,0 +1,4 @@ +//! Functionality involving network interfaces +// To avoid clashing with the keyword "if", we use "if_" as the module name. +// The original header is called "net/if.h". +pub mod if_; diff --git a/bash-5.1/vendor/nix/src/poll.rs b/bash-5.1/vendor/nix/src/poll.rs new file mode 100644 index 0000000000000000000000000000000000000000..3004d24c37072fd0b9c8eacaaa306e9b5bbc0967 --- /dev/null +++ b/bash-5.1/vendor/nix/src/poll.rs @@ -0,0 +1,175 @@ +//! Wait for events to trigger on specific file descriptors +use std::os::unix::io::{AsRawFd, RawFd}; + +use crate::Result; +use crate::errno::Errno; + +/// This is a wrapper around `libc::pollfd`. +/// +/// It's meant to be used as an argument to the [`poll`](fn.poll.html) and +/// [`ppoll`](fn.ppoll.html) functions to specify the events of interest +/// for a specific file descriptor. +/// +/// After a call to `poll` or `ppoll`, the events that occurred can be +/// retrieved by calling [`revents()`](#method.revents) on the `PollFd`. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct PollFd { + pollfd: libc::pollfd, +} + +impl PollFd { + /// Creates a new `PollFd` specifying the events of interest + /// for a given file descriptor. + pub const fn new(fd: RawFd, events: PollFlags) -> PollFd { + PollFd { + pollfd: libc::pollfd { + fd, + events: events.bits(), + revents: PollFlags::empty().bits(), + }, + } + } + + /// Returns the events that occurred in the last call to `poll` or `ppoll`. Will only return + /// `None` if the kernel provides status flags that Nix does not know about. + pub fn revents(self) -> Option { + PollFlags::from_bits(self.pollfd.revents) + } + + /// The events of interest for this `PollFd`. + pub fn events(self) -> PollFlags { + PollFlags::from_bits(self.pollfd.events).unwrap() + } + + /// Modify the events of interest for this `PollFd`. + pub fn set_events(&mut self, events: PollFlags) { + self.pollfd.events = events.bits(); + } +} + +impl AsRawFd for PollFd { + fn as_raw_fd(&self) -> RawFd { + self.pollfd.fd + } +} + +libc_bitflags! { + /// These flags define the different events that can be monitored by `poll` and `ppoll` + pub struct PollFlags: libc::c_short { + /// There is data to read. + POLLIN; + /// There is some exceptional condition on the file descriptor. + /// + /// Possibilities include: + /// + /// * There is out-of-band data on a TCP socket (see + /// [tcp(7)](https://man7.org/linux/man-pages/man7/tcp.7.html)). + /// * A pseudoterminal master in packet mode has seen a state + /// change on the slave (see + /// [ioctl_tty(2)](https://man7.org/linux/man-pages/man2/ioctl_tty.2.html)). + /// * A cgroup.events file has been modified (see + /// [cgroups(7)](https://man7.org/linux/man-pages/man7/cgroups.7.html)). + POLLPRI; + /// Writing is now possible, though a write larger that the + /// available space in a socket or pipe will still block (unless + /// `O_NONBLOCK` is set). + POLLOUT; + /// Equivalent to [`POLLIN`](constant.POLLIN.html) + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + POLLRDNORM; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Equivalent to [`POLLOUT`](constant.POLLOUT.html) + POLLWRNORM; + /// Priority band data can be read (generally unused on Linux). + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + POLLRDBAND; + /// Priority data may be written. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + POLLWRBAND; + /// Error condition (only returned in + /// [`PollFd::revents`](struct.PollFd.html#method.revents); + /// ignored in [`PollFd::new`](struct.PollFd.html#method.new)). + /// This bit is also set for a file descriptor referring to the + /// write end of a pipe when the read end has been closed. + POLLERR; + /// Hang up (only returned in [`PollFd::revents`](struct.PollFd.html#method.revents); + /// ignored in [`PollFd::new`](struct.PollFd.html#method.new)). + /// Note that when reading from a channel such as a pipe or a stream + /// socket, this event merely indicates that the peer closed its + /// end of the channel. Subsequent reads from the channel will + /// return 0 (end of file) only after all outstanding data in the + /// channel has been consumed. + POLLHUP; + /// Invalid request: `fd` not open (only returned in + /// [`PollFd::revents`](struct.PollFd.html#method.revents); + /// ignored in [`PollFd::new`](struct.PollFd.html#method.new)). + POLLNVAL; + } +} + +/// `poll` waits for one of a set of file descriptors to become ready to perform I/O. +/// ([`poll(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html)) +/// +/// `fds` contains all [`PollFd`](struct.PollFd.html) to poll. +/// The function will return as soon as any event occur for any of these `PollFd`s. +/// +/// The `timeout` argument specifies the number of milliseconds that `poll()` +/// should block waiting for a file descriptor to become ready. The call +/// will block until either: +/// +/// * a file descriptor becomes ready; +/// * the call is interrupted by a signal handler; or +/// * the timeout expires. +/// +/// Note that the timeout interval will be rounded up to the system clock +/// granularity, and kernel scheduling delays mean that the blocking +/// interval may overrun by a small amount. Specifying a negative value +/// in timeout means an infinite timeout. Specifying a timeout of zero +/// causes `poll()` to return immediately, even if no file descriptors are +/// ready. +pub fn poll(fds: &mut [PollFd], timeout: libc::c_int) -> Result { + let res = unsafe { + libc::poll(fds.as_mut_ptr() as *mut libc::pollfd, + fds.len() as libc::nfds_t, + timeout) + }; + + Errno::result(res) +} + +feature! { +#![feature = "signal"] +/// `ppoll()` allows an application to safely wait until either a file +/// descriptor becomes ready or until a signal is caught. +/// ([`poll(2)`](https://man7.org/linux/man-pages/man2/poll.2.html)) +/// +/// `ppoll` behaves like `poll`, but let you specify what signals may interrupt it +/// with the `sigmask` argument. If you want `ppoll` to block indefinitely, +/// specify `None` as `timeout` (it is like `timeout = -1` for `poll`). +/// If `sigmask` is `None`, then no signal mask manipulation is performed, +/// so in that case `ppoll` differs from `poll` only in the precision of the +/// timeout argument. +/// +#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux"))] +pub fn ppoll( + fds: &mut [PollFd], + timeout: Option, + sigmask: Option + ) -> Result +{ + let timeout = timeout.as_ref().map_or(core::ptr::null(), |r| r.as_ref()); + let sigmask = sigmask.as_ref().map_or(core::ptr::null(), |r| r.as_ref()); + let res = unsafe { + libc::ppoll(fds.as_mut_ptr() as *mut libc::pollfd, + fds.len() as libc::nfds_t, + timeout, + sigmask) + }; + Errno::result(res) +} +} diff --git a/bash-5.1/vendor/nix/src/pty.rs b/bash-5.1/vendor/nix/src/pty.rs new file mode 100644 index 0000000000000000000000000000000000000000..bb266a65bb854c90e0922ef4573c7844e363ae42 --- /dev/null +++ b/bash-5.1/vendor/nix/src/pty.rs @@ -0,0 +1,371 @@ +//! Create master and slave virtual pseudo-terminals (PTYs) + +pub use libc::pid_t as SessionId; +pub use libc::winsize as Winsize; + +use std::ffi::CStr; +use std::io; +use std::mem; +use std::os::unix::prelude::*; + +use crate::sys::termios::Termios; +#[cfg(feature = "process")] +use crate::unistd::{ForkResult, Pid}; +use crate::{Result, fcntl, unistd}; +use crate::errno::Errno; + +/// Representation of a master/slave pty pair +/// +/// This is returned by `openpty`. Note that this type does *not* implement `Drop`, so the user +/// must manually close the file descriptors. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct OpenptyResult { + /// The master port in a virtual pty pair + pub master: RawFd, + /// The slave port in a virtual pty pair + pub slave: RawFd, +} + +feature! { +#![feature = "process"] +/// Representation of a master with a forked pty +/// +/// This is returned by `forkpty`. Note that this type does *not* implement `Drop`, so the user +/// must manually close the file descriptors. +#[derive(Clone, Copy, Debug)] +pub struct ForkptyResult { + /// The master port in a virtual pty pair + pub master: RawFd, + /// Metadata about forked process + pub fork_result: ForkResult, +} +} + + +/// Representation of the Master device in a master/slave pty pair +/// +/// While this datatype is a thin wrapper around `RawFd`, it enforces that the available PTY +/// functions are given the correct file descriptor. Additionally this type implements `Drop`, +/// so that when it's consumed or goes out of scope, it's automatically cleaned-up. +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct PtyMaster(RawFd); + +impl AsRawFd for PtyMaster { + fn as_raw_fd(&self) -> RawFd { + self.0 + } +} + +impl IntoRawFd for PtyMaster { + fn into_raw_fd(self) -> RawFd { + let fd = self.0; + mem::forget(self); + fd + } +} + +impl Drop for PtyMaster { + fn drop(&mut self) { + // On drop, we ignore errors like EINTR and EIO because there's no clear + // way to handle them, we can't return anything, and (on FreeBSD at + // least) the file descriptor is deallocated in these cases. However, + // we must panic on EBADF, because it is always an error to close an + // invalid file descriptor. That frequently indicates a double-close + // condition, which can cause confusing errors for future I/O + // operations. + let e = unistd::close(self.0); + if e == Err(Errno::EBADF) { + panic!("Closing an invalid file descriptor!"); + }; + } +} + +impl io::Read for PtyMaster { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + unistd::read(self.0, buf).map_err(io::Error::from) + } +} + +impl io::Write for PtyMaster { + fn write(&mut self, buf: &[u8]) -> io::Result { + unistd::write(self.0, buf).map_err(io::Error::from) + } + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } +} + +impl io::Read for &PtyMaster { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + unistd::read(self.0, buf).map_err(io::Error::from) + } +} + +impl io::Write for &PtyMaster { + fn write(&mut self, buf: &[u8]) -> io::Result { + unistd::write(self.0, buf).map_err(io::Error::from) + } + fn flush(&mut self) -> io::Result<()> { + Ok(()) + } +} + +/// Grant access to a slave pseudoterminal (see +/// [`grantpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/grantpt.html)) +/// +/// `grantpt()` changes the mode and owner of the slave pseudoterminal device corresponding to the +/// master pseudoterminal referred to by `fd`. This is a necessary step towards opening the slave. +#[inline] +pub fn grantpt(fd: &PtyMaster) -> Result<()> { + if unsafe { libc::grantpt(fd.as_raw_fd()) } < 0 { + return Err(Errno::last()); + } + + Ok(()) +} + +/// Open a pseudoterminal device (see +/// [`posix_openpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_openpt.html)) +/// +/// `posix_openpt()` returns a file descriptor to an existing unused pseudoterminal master device. +/// +/// # Examples +/// +/// A common use case with this function is to open both a master and slave PTY pair. This can be +/// done as follows: +/// +/// ``` +/// use std::path::Path; +/// use nix::fcntl::{OFlag, open}; +/// use nix::pty::{grantpt, posix_openpt, ptsname, unlockpt}; +/// use nix::sys::stat::Mode; +/// +/// # #[allow(dead_code)] +/// # fn run() -> nix::Result<()> { +/// // Open a new PTY master +/// let master_fd = posix_openpt(OFlag::O_RDWR)?; +/// +/// // Allow a slave to be generated for it +/// grantpt(&master_fd)?; +/// unlockpt(&master_fd)?; +/// +/// // Get the name of the slave +/// let slave_name = unsafe { ptsname(&master_fd) }?; +/// +/// // Try to open the slave +/// let _slave_fd = open(Path::new(&slave_name), OFlag::O_RDWR, Mode::empty())?; +/// # Ok(()) +/// # } +/// ``` +#[inline] +pub fn posix_openpt(flags: fcntl::OFlag) -> Result { + let fd = unsafe { + libc::posix_openpt(flags.bits()) + }; + + if fd < 0 { + return Err(Errno::last()); + } + + Ok(PtyMaster(fd)) +} + +/// Get the name of the slave pseudoterminal (see +/// [`ptsname(3)`](https://man7.org/linux/man-pages/man3/ptsname.3.html)) +/// +/// `ptsname()` returns the name of the slave pseudoterminal device corresponding to the master +/// referred to by `fd`. +/// +/// This value is useful for opening the slave pty once the master has already been opened with +/// `posix_openpt()`. +/// +/// # Safety +/// +/// `ptsname()` mutates global variables and is *not* threadsafe. +/// Mutating global variables is always considered `unsafe` by Rust and this +/// function is marked as `unsafe` to reflect that. +/// +/// For a threadsafe and non-`unsafe` alternative on Linux, see `ptsname_r()`. +#[inline] +pub unsafe fn ptsname(fd: &PtyMaster) -> Result { + let name_ptr = libc::ptsname(fd.as_raw_fd()); + if name_ptr.is_null() { + return Err(Errno::last()); + } + + let name = CStr::from_ptr(name_ptr); + Ok(name.to_string_lossy().into_owned()) +} + +/// Get the name of the slave pseudoterminal (see +/// [`ptsname(3)`](https://man7.org/linux/man-pages/man3/ptsname.3.html)) +/// +/// `ptsname_r()` returns the name of the slave pseudoterminal device corresponding to the master +/// referred to by `fd`. This is the threadsafe version of `ptsname()`, but it is not part of the +/// POSIX standard and is instead a Linux-specific extension. +/// +/// This value is useful for opening the slave ptty once the master has already been opened with +/// `posix_openpt()`. +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +#[inline] +pub fn ptsname_r(fd: &PtyMaster) -> Result { + let mut name_buf = Vec::::with_capacity(64); + let name_buf_ptr = name_buf.as_mut_ptr(); + let cname = unsafe { + let cap = name_buf.capacity(); + if libc::ptsname_r(fd.as_raw_fd(), name_buf_ptr, cap) != 0 { + return Err(crate::Error::last()); + } + CStr::from_ptr(name_buf.as_ptr()) + }; + + let name = cname.to_string_lossy().into_owned(); + Ok(name) +} + +/// Unlock a pseudoterminal master/slave pseudoterminal pair (see +/// [`unlockpt(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlockpt.html)) +/// +/// `unlockpt()` unlocks the slave pseudoterminal device corresponding to the master pseudoterminal +/// referred to by `fd`. This must be called before trying to open the slave side of a +/// pseudoterminal. +#[inline] +pub fn unlockpt(fd: &PtyMaster) -> Result<()> { + if unsafe { libc::unlockpt(fd.as_raw_fd()) } < 0 { + return Err(Errno::last()); + } + + Ok(()) +} + + +/// Create a new pseudoterminal, returning the slave and master file descriptors +/// in `OpenptyResult` +/// (see [`openpty`](https://man7.org/linux/man-pages/man3/openpty.3.html)). +/// +/// If `winsize` is not `None`, the window size of the slave will be set to +/// the values in `winsize`. If `termios` is not `None`, the pseudoterminal's +/// terminal settings of the slave will be set to the values in `termios`. +#[inline] +pub fn openpty<'a, 'b, T: Into>, U: Into>>(winsize: T, termios: U) -> Result { + use std::ptr; + + let mut slave = mem::MaybeUninit::::uninit(); + let mut master = mem::MaybeUninit::::uninit(); + let ret = { + match (termios.into(), winsize.into()) { + (Some(termios), Some(winsize)) => { + let inner_termios = termios.get_libc_termios(); + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + &*inner_termios as *const libc::termios as *mut _, + winsize as *const Winsize as *mut _, + ) + } + } + (None, Some(winsize)) => { + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + ptr::null_mut(), + winsize as *const Winsize as *mut _, + ) + } + } + (Some(termios), None) => { + let inner_termios = termios.get_libc_termios(); + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + &*inner_termios as *const libc::termios as *mut _, + ptr::null_mut(), + ) + } + } + (None, None) => { + unsafe { + libc::openpty( + master.as_mut_ptr(), + slave.as_mut_ptr(), + ptr::null_mut(), + ptr::null_mut(), + ptr::null_mut(), + ) + } + } + } + }; + + Errno::result(ret)?; + + unsafe { + Ok(OpenptyResult { + master: master.assume_init(), + slave: slave.assume_init(), + }) + } +} + +feature! { +#![feature = "process"] +/// Create a new pseudoterminal, returning the master file descriptor and forked pid. +/// in `ForkptyResult` +/// (see [`forkpty`](https://man7.org/linux/man-pages/man3/forkpty.3.html)). +/// +/// If `winsize` is not `None`, the window size of the slave will be set to +/// the values in `winsize`. If `termios` is not `None`, the pseudoterminal's +/// terminal settings of the slave will be set to the values in `termios`. +/// +/// # Safety +/// +/// In a multithreaded program, only [async-signal-safe] functions like `pause` +/// and `_exit` may be called by the child (the parent isn't restricted). Note +/// that memory allocation may **not** be async-signal-safe and thus must be +/// prevented. +/// +/// Those functions are only a small subset of your operating system's API, so +/// special care must be taken to only invoke code you can control and audit. +/// +/// [async-signal-safe]: https://man7.org/linux/man-pages/man7/signal-safety.7.html +pub unsafe fn forkpty<'a, 'b, T: Into>, U: Into>>( + winsize: T, + termios: U, +) -> Result { + use std::ptr; + + let mut master = mem::MaybeUninit::::uninit(); + + let term = match termios.into() { + Some(termios) => { + let inner_termios = termios.get_libc_termios(); + &*inner_termios as *const libc::termios as *mut _ + }, + None => ptr::null_mut(), + }; + + let win = winsize + .into() + .map(|ws| ws as *const Winsize as *mut _) + .unwrap_or(ptr::null_mut()); + + let res = libc::forkpty(master.as_mut_ptr(), ptr::null_mut(), term, win); + + let fork_result = Errno::result(res).map(|res| match res { + 0 => ForkResult::Child, + res => ForkResult::Parent { child: Pid::from_raw(res) }, + })?; + + Ok(ForkptyResult { + master: master.assume_init(), + fork_result, + }) +} +} diff --git a/bash-5.1/vendor/nix/src/sched.rs b/bash-5.1/vendor/nix/src/sched.rs new file mode 100644 index 0000000000000000000000000000000000000000..e9a326e261a581fb0aa4bc72125a5b0d682a308b --- /dev/null +++ b/bash-5.1/vendor/nix/src/sched.rs @@ -0,0 +1,294 @@ +//! Execution scheduling +//! +//! See Also +//! [sched.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sched.h.html) +use crate::{Errno, Result}; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::sched_linux_like::*; + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod sched_linux_like { + use crate::errno::Errno; + use libc::{self, c_int, c_void}; + use std::mem; + use std::option::Option; + use std::os::unix::io::RawFd; + use crate::unistd::Pid; + use crate::Result; + + // For some functions taking with a parameter of type CloneFlags, + // only a subset of these flags have an effect. + libc_bitflags! { + /// Options for use with [`clone`] + pub struct CloneFlags: c_int { + /// The calling process and the child process run in the same + /// memory space. + CLONE_VM; + /// The caller and the child process share the same filesystem + /// information. + CLONE_FS; + /// The calling process and the child process share the same file + /// descriptor table. + CLONE_FILES; + /// The calling process and the child process share the same table + /// of signal handlers. + CLONE_SIGHAND; + /// If the calling process is being traced, then trace the child + /// also. + CLONE_PTRACE; + /// The execution of the calling process is suspended until the + /// child releases its virtual memory resources via a call to + /// execve(2) or _exit(2) (as with vfork(2)). + CLONE_VFORK; + /// The parent of the new child (as returned by getppid(2)) + /// will be the same as that of the calling process. + CLONE_PARENT; + /// The child is placed in the same thread group as the calling + /// process. + CLONE_THREAD; + /// The cloned child is started in a new mount namespace. + CLONE_NEWNS; + /// The child and the calling process share a single list of System + /// V semaphore adjustment values + CLONE_SYSVSEM; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_SETTLS; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_PARENT_SETTID; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_CHILD_CLEARTID; + /// Unused since Linux 2.6.2 + #[deprecated(since = "0.23.0", note = "Deprecated by Linux 2.6.2")] + CLONE_DETACHED; + /// A tracing process cannot force `CLONE_PTRACE` on this child + /// process. + CLONE_UNTRACED; + // Not supported by Nix due to lack of varargs support in Rust FFI + // CLONE_CHILD_SETTID; + /// Create the process in a new cgroup namespace. + CLONE_NEWCGROUP; + /// Create the process in a new UTS namespace. + CLONE_NEWUTS; + /// Create the process in a new IPC namespace. + CLONE_NEWIPC; + /// Create the process in a new user namespace. + CLONE_NEWUSER; + /// Create the process in a new PID namespace. + CLONE_NEWPID; + /// Create the process in a new network namespace. + CLONE_NEWNET; + /// The new process shares an I/O context with the calling process. + CLONE_IO; + } + } + + /// Type for the function executed by [`clone`]. + pub type CloneCb<'a> = Box isize + 'a>; + + /// `clone` create a child process + /// ([`clone(2)`](https://man7.org/linux/man-pages/man2/clone.2.html)) + /// + /// `stack` is a reference to an array which will hold the stack of the new + /// process. Unlike when calling `clone(2)` from C, the provided stack + /// address need not be the highest address of the region. Nix will take + /// care of that requirement. The user only needs to provide a reference to + /// a normally allocated buffer. + pub fn clone( + mut cb: CloneCb, + stack: &mut [u8], + flags: CloneFlags, + signal: Option, + ) -> Result { + extern "C" fn callback(data: *mut CloneCb) -> c_int { + let cb: &mut CloneCb = unsafe { &mut *data }; + (*cb)() as c_int + } + + let res = unsafe { + let combined = flags.bits() | signal.unwrap_or(0); + let ptr = stack.as_mut_ptr().add(stack.len()); + let ptr_aligned = ptr.sub(ptr as usize % 16); + libc::clone( + mem::transmute( + callback as extern "C" fn(*mut Box isize>) -> i32, + ), + ptr_aligned as *mut c_void, + combined, + &mut cb as *mut _ as *mut c_void, + ) + }; + + Errno::result(res).map(Pid::from_raw) + } + + /// disassociate parts of the process execution context + /// + /// See also [unshare(2)](https://man7.org/linux/man-pages/man2/unshare.2.html) + pub fn unshare(flags: CloneFlags) -> Result<()> { + let res = unsafe { libc::unshare(flags.bits()) }; + + Errno::result(res).map(drop) + } + + /// reassociate thread with a namespace + /// + /// See also [setns(2)](https://man7.org/linux/man-pages/man2/setns.2.html) + pub fn setns(fd: RawFd, nstype: CloneFlags) -> Result<()> { + let res = unsafe { libc::setns(fd, nstype.bits()) }; + + Errno::result(res).map(drop) + } +} + +#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "linux"))] +pub use self::sched_affinity::*; + +#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "linux"))] +mod sched_affinity { + use crate::errno::Errno; + use std::mem; + use crate::unistd::Pid; + use crate::Result; + + /// CpuSet represent a bit-mask of CPUs. + /// CpuSets are used by sched_setaffinity and + /// sched_getaffinity for example. + /// + /// This is a wrapper around `libc::cpu_set_t`. + #[repr(C)] + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct CpuSet { + cpu_set: libc::cpu_set_t, + } + + impl CpuSet { + /// Create a new and empty CpuSet. + pub fn new() -> CpuSet { + CpuSet { + cpu_set: unsafe { mem::zeroed() }, + } + } + + /// Test to see if a CPU is in the CpuSet. + /// `field` is the CPU id to test + pub fn is_set(&self, field: usize) -> Result { + if field >= CpuSet::count() { + Err(Errno::EINVAL) + } else { + Ok(unsafe { libc::CPU_ISSET(field, &self.cpu_set) }) + } + } + + /// Add a CPU to CpuSet. + /// `field` is the CPU id to add + pub fn set(&mut self, field: usize) -> Result<()> { + if field >= CpuSet::count() { + Err(Errno::EINVAL) + } else { + unsafe { libc::CPU_SET(field, &mut self.cpu_set); } + Ok(()) + } + } + + /// Remove a CPU from CpuSet. + /// `field` is the CPU id to remove + pub fn unset(&mut self, field: usize) -> Result<()> { + if field >= CpuSet::count() { + Err(Errno::EINVAL) + } else { + unsafe { libc::CPU_CLR(field, &mut self.cpu_set);} + Ok(()) + } + } + + /// Return the maximum number of CPU in CpuSet + pub const fn count() -> usize { + 8 * mem::size_of::() + } + } + + impl Default for CpuSet { + fn default() -> Self { + Self::new() + } + } + + /// `sched_setaffinity` set a thread's CPU affinity mask + /// ([`sched_setaffinity(2)`](https://man7.org/linux/man-pages/man2/sched_setaffinity.2.html)) + /// + /// `pid` is the thread ID to update. + /// If pid is zero, then the calling thread is updated. + /// + /// The `cpuset` argument specifies the set of CPUs on which the thread + /// will be eligible to run. + /// + /// # Example + /// + /// Binding the current thread to CPU 0 can be done as follows: + /// + /// ```rust,no_run + /// use nix::sched::{CpuSet, sched_setaffinity}; + /// use nix::unistd::Pid; + /// + /// let mut cpu_set = CpuSet::new(); + /// cpu_set.set(0).unwrap(); + /// sched_setaffinity(Pid::from_raw(0), &cpu_set).unwrap(); + /// ``` + pub fn sched_setaffinity(pid: Pid, cpuset: &CpuSet) -> Result<()> { + let res = unsafe { + libc::sched_setaffinity( + pid.into(), + mem::size_of::() as libc::size_t, + &cpuset.cpu_set, + ) + }; + + Errno::result(res).map(drop) + } + + /// `sched_getaffinity` get a thread's CPU affinity mask + /// ([`sched_getaffinity(2)`](https://man7.org/linux/man-pages/man2/sched_getaffinity.2.html)) + /// + /// `pid` is the thread ID to check. + /// If pid is zero, then the calling thread is checked. + /// + /// Returned `cpuset` is the set of CPUs on which the thread + /// is eligible to run. + /// + /// # Example + /// + /// Checking if the current thread can run on CPU 0 can be done as follows: + /// + /// ```rust,no_run + /// use nix::sched::sched_getaffinity; + /// use nix::unistd::Pid; + /// + /// let cpu_set = sched_getaffinity(Pid::from_raw(0)).unwrap(); + /// if cpu_set.is_set(0).unwrap() { + /// println!("Current thread can run on CPU 0"); + /// } + /// ``` + pub fn sched_getaffinity(pid: Pid) -> Result { + let mut cpuset = CpuSet::new(); + let res = unsafe { + libc::sched_getaffinity( + pid.into(), + mem::size_of::() as libc::size_t, + &mut cpuset.cpu_set, + ) + }; + + Errno::result(res).and(Ok(cpuset)) + } +} + +/// Explicitly yield the processor to other threads. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sched_yield.html) +pub fn sched_yield() -> Result<()> { + let res = unsafe { libc::sched_yield() }; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix/src/sys/aio.rs b/bash-5.1/vendor/nix/src/sys/aio.rs new file mode 100644 index 0000000000000000000000000000000000000000..6ff88469b98368b9ca3bd92c99557185b7f882a9 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/aio.rs @@ -0,0 +1,1244 @@ +// vim: tw=80 +//! POSIX Asynchronous I/O +//! +//! The POSIX AIO interface is used for asynchronous I/O on files and disk-like +//! devices. It supports [`read`](struct.AioRead.html#method.new), +//! [`write`](struct.AioWrite.html#method.new), +//! [`fsync`](struct.AioFsync.html#method.new), +//! [`readv`](struct.AioReadv.html#method.new), and +//! [`writev`](struct.AioWritev.html#method.new), operations, subject to +//! platform support. Completion +//! notifications can optionally be delivered via +//! [signals](../signal/enum.SigevNotify.html#variant.SigevSignal), via the +//! [`aio_suspend`](fn.aio_suspend.html) function, or via polling. Some +//! platforms support other completion +//! notifications, such as +//! [kevent](../signal/enum.SigevNotify.html#variant.SigevKevent). +//! +//! Multiple operations may be submitted in a batch with +//! [`lio_listio`](fn.lio_listio.html), though the standard does not guarantee +//! that they will be executed atomically. +//! +//! Outstanding operations may be cancelled with +//! [`cancel`](trait.Aio.html#method.cancel) or +//! [`aio_cancel_all`](fn.aio_cancel_all.html), though the operating system may +//! not support this for all filesystems and devices. +#[cfg(target_os = "freebsd")] +use std::io::{IoSlice, IoSliceMut}; +use std::{ + convert::TryFrom, + fmt::{self, Debug}, + marker::{PhantomData, PhantomPinned}, + mem, + os::unix::io::RawFd, + pin::Pin, + ptr, + thread, +}; + +use libc::{c_void, off_t}; +use pin_utils::unsafe_pinned; + +use crate::{ + errno::Errno, + sys::{signal::*, time::TimeSpec}, + Result, +}; + +libc_enum! { + /// Mode for `AioCb::fsync`. Controls whether only data or both data and + /// metadata are synced. + #[repr(i32)] + #[non_exhaustive] + pub enum AioFsyncMode { + /// do it like `fsync` + O_SYNC, + /// on supported operating systems only, do it like `fdatasync` + #[cfg(any(target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + O_DSYNC + } + impl TryFrom +} + +libc_enum! { + /// Mode for [`lio_listio`](fn.lio_listio.html) + #[repr(i32)] + pub enum LioMode { + /// Requests that [`lio_listio`](fn.lio_listio.html) block until all + /// requested operations have been completed + LIO_WAIT, + /// Requests that [`lio_listio`](fn.lio_listio.html) return immediately + LIO_NOWAIT, + } +} + +/// Return values for [`AioCb::cancel`](struct.AioCb.html#method.cancel) and +/// [`aio_cancel_all`](fn.aio_cancel_all.html) +#[repr(i32)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum AioCancelStat { + /// All outstanding requests were canceled + AioCanceled = libc::AIO_CANCELED, + /// Some requests were not canceled. Their status should be checked with + /// `AioCb::error` + AioNotCanceled = libc::AIO_NOTCANCELED, + /// All of the requests have already finished + AioAllDone = libc::AIO_ALLDONE, +} + +/// Newtype that adds Send and Sync to libc::aiocb, which contains raw pointers +#[repr(transparent)] +struct LibcAiocb(libc::aiocb); + +unsafe impl Send for LibcAiocb {} +unsafe impl Sync for LibcAiocb {} + +/// Base class for all AIO operations. Should only be used directly when +/// checking for completion. +// We could create some kind of AsPinnedMut trait, and implement it for all aio +// ops, allowing the crate's users to get pinned references to `AioCb`. That +// could save some code for things like polling methods. But IMHO it would +// provide polymorphism at the wrong level. Instead, the best place for +// polymorphism is at the level of `Futures`. +#[repr(C)] +struct AioCb { + aiocb: LibcAiocb, + /// Could this `AioCb` potentially have any in-kernel state? + // It would be really nice to perform the in-progress check entirely at + // compile time. But I can't figure out how, because: + // * Future::poll takes a `Pin<&mut self>` rather than `self`, and + // * Rust's lack of an equivalent of C++'s Guaranteed Copy Elision means + // that there's no way to write an AioCb constructor that neither boxes + // the object itself, nor moves it during return. + in_progress: bool, +} + +impl AioCb { + pin_utils::unsafe_unpinned!(aiocb: LibcAiocb); + + fn aio_return(mut self: Pin<&mut Self>) -> Result { + self.in_progress = false; + unsafe { + let p: *mut libc::aiocb = &mut self.aiocb.0; + Errno::result(libc::aio_return(p)) + } + .map(|r| r as usize) + } + + fn cancel(mut self: Pin<&mut Self>) -> Result { + let r = unsafe { + libc::aio_cancel(self.aiocb.0.aio_fildes, &mut self.aiocb.0) + }; + match r { + libc::AIO_CANCELED => Ok(AioCancelStat::AioCanceled), + libc::AIO_NOTCANCELED => Ok(AioCancelStat::AioNotCanceled), + libc::AIO_ALLDONE => Ok(AioCancelStat::AioAllDone), + -1 => Err(Errno::last()), + _ => panic!("unknown aio_cancel return value"), + } + } + + fn common_init(fd: RawFd, prio: i32, sigev_notify: SigevNotify) -> Self { + // Use mem::zeroed instead of explicitly zeroing each field, because the + // number and name of reserved fields is OS-dependent. On some OSes, + // some reserved fields are used the kernel for state, and must be + // explicitly zeroed when allocated. + let mut a = unsafe { mem::zeroed::() }; + a.aio_fildes = fd; + a.aio_reqprio = prio; + a.aio_sigevent = SigEvent::new(sigev_notify).sigevent(); + AioCb { + aiocb: LibcAiocb(a), + in_progress: false, + } + } + + fn error(self: Pin<&mut Self>) -> Result<()> { + let r = unsafe { libc::aio_error(&self.aiocb().0) }; + match r { + 0 => Ok(()), + num if num > 0 => Err(Errno::from_i32(num)), + -1 => Err(Errno::last()), + num => panic!("unknown aio_error return value {:?}", num), + } + } + + fn in_progress(&self) -> bool { + self.in_progress + } + + fn set_in_progress(mut self: Pin<&mut Self>) { + self.as_mut().in_progress = true; + } + + /// Update the notification settings for an existing AIO operation that has + /// not yet been submitted. + // Takes a normal reference rather than a pinned one because this method is + // normally called before the object needs to be pinned, that is, before + // it's been submitted to the kernel. + fn set_sigev_notify(&mut self, sigev_notify: SigevNotify) { + assert!( + !self.in_progress, + "Can't change notification settings for an in-progress operation" + ); + self.aiocb.0.aio_sigevent = SigEvent::new(sigev_notify).sigevent(); + } +} + +impl Debug for AioCb { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("AioCb") + .field("aiocb", &self.aiocb.0) + .field("in_progress", &self.in_progress) + .finish() + } +} + +impl Drop for AioCb { + /// If the `AioCb` has no remaining state in the kernel, just drop it. + /// Otherwise, dropping constitutes a resource leak, which is an error + fn drop(&mut self) { + assert!( + thread::panicking() || !self.in_progress, + "Dropped an in-progress AioCb" + ); + } +} + +/// Methods common to all AIO operations +pub trait Aio { + /// The return type of [`Aio::aio_return`]. + type Output; + + /// Retrieve return status of an asynchronous operation. + /// + /// Should only be called once for each operation, after [`Aio::error`] + /// indicates that it has completed. The result is the same as for the + /// synchronous `read(2)`, `write(2)`, of `fsync(2)` functions. + /// + /// # References + /// + /// [aio_return](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_return.html) + fn aio_return(self: Pin<&mut Self>) -> Result; + + /// Cancels an outstanding AIO request. + /// + /// The operating system is not required to implement cancellation for all + /// file and device types. Even if it does, there is no guarantee that the + /// operation has not already completed. So the caller must check the + /// result and handle operations that were not canceled or that have already + /// completed. + /// + /// # Examples + /// + /// Cancel an outstanding aio operation. Note that we must still call + /// `aio_return` to free resources, even though we don't care about the + /// result. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::io::Write; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// let wbuf = b"CDEF"; + /// let mut f = tempfile().unwrap(); + /// let mut aiocb = Box::pin(AioWrite::new(f.as_raw_fd(), + /// 2, //offset + /// &wbuf[..], + /// 0, //priority + /// SigevNotify::SigevNone)); + /// aiocb.as_mut().submit().unwrap(); + /// let cs = aiocb.as_mut().cancel().unwrap(); + /// if cs == AioCancelStat::AioNotCanceled { + /// while (aiocb.as_mut().error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// } + /// // Must call `aio_return`, but ignore the result + /// let _ = aiocb.as_mut().aio_return(); + /// ``` + /// + /// # References + /// + /// [aio_cancel](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html) + fn cancel(self: Pin<&mut Self>) -> Result; + + /// Retrieve error status of an asynchronous operation. + /// + /// If the request has not yet completed, returns `EINPROGRESS`. Otherwise, + /// returns `Ok` or any other error. + /// + /// # Examples + /// + /// Issue an aio operation and use `error` to poll for completion. Polling + /// is an alternative to `aio_suspend`, used by most of the other examples. + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify; + /// # use std::{thread, time}; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// const WBUF: &[u8] = b"abcdef123456"; + /// let mut f = tempfile().unwrap(); + /// let mut aiocb = Box::pin(AioWrite::new(f.as_raw_fd(), + /// 2, //offset + /// WBUF, + /// 0, //priority + /// SigevNotify::SigevNone)); + /// aiocb.as_mut().submit().unwrap(); + /// while (aiocb.as_mut().error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// assert_eq!(aiocb.as_mut().aio_return().unwrap(), WBUF.len()); + /// ``` + /// + /// # References + /// + /// [aio_error](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_error.html) + fn error(self: Pin<&mut Self>) -> Result<()>; + + /// Returns the underlying file descriptor associated with the operation. + fn fd(&self) -> RawFd; + + /// Does this operation currently have any in-kernel state? + /// + /// Dropping an operation that does have in-kernel state constitutes a + /// resource leak. + /// + /// # Examples + /// + /// ``` + /// # use nix::errno::Errno; + /// # use nix::Error; + /// # use nix::sys::aio::*; + /// # use nix::sys::signal::SigevNotify::SigevNone; + /// # use std::{thread, time}; + /// # use std::os::unix::io::AsRawFd; + /// # use tempfile::tempfile; + /// let f = tempfile().unwrap(); + /// let mut aiof = Box::pin(AioFsync::new(f.as_raw_fd(), AioFsyncMode::O_SYNC, + /// 0, SigevNone)); + /// assert!(!aiof.as_mut().in_progress()); + /// aiof.as_mut().submit().expect("aio_fsync failed early"); + /// assert!(aiof.as_mut().in_progress()); + /// while (aiof.as_mut().error() == Err(Errno::EINPROGRESS)) { + /// thread::sleep(time::Duration::from_millis(10)); + /// } + /// aiof.as_mut().aio_return().expect("aio_fsync failed late"); + /// assert!(!aiof.as_mut().in_progress()); + /// ``` + fn in_progress(&self) -> bool; + + /// Returns the priority of the `AioCb` + fn priority(&self) -> i32; + + /// Update the notification settings for an existing AIO operation that has + /// not yet been submitted. + fn set_sigev_notify(&mut self, sev: SigevNotify); + + /// Returns the `SigEvent` that will be used for notification. + fn sigevent(&self) -> SigEvent; + + /// Actually start the I/O operation. + /// + /// After calling this method and until [`Aio::aio_return`] returns `Ok`, + /// the structure may not be moved in memory. + fn submit(self: Pin<&mut Self>) -> Result<()>; +} + +macro_rules! aio_methods { + () => { + fn cancel(self: Pin<&mut Self>) -> Result { + self.aiocb().cancel() + } + + fn error(self: Pin<&mut Self>) -> Result<()> { + self.aiocb().error() + } + + fn fd(&self) -> RawFd { + self.aiocb.aiocb.0.aio_fildes + } + + fn in_progress(&self) -> bool { + self.aiocb.in_progress() + } + + fn priority(&self) -> i32 { + self.aiocb.aiocb.0.aio_reqprio + } + + fn set_sigev_notify(&mut self, sev: SigevNotify) { + self.aiocb.set_sigev_notify(sev) + } + + fn sigevent(&self) -> SigEvent { + SigEvent::from(&self.aiocb.aiocb.0.aio_sigevent) + } + }; + ($func:ident) => { + aio_methods!(); + + fn aio_return(self: Pin<&mut Self>) -> Result<::Output> { + self.aiocb().aio_return() + } + + fn submit(mut self: Pin<&mut Self>) -> Result<()> { + let p: *mut libc::aiocb = &mut self.as_mut().aiocb().aiocb.0; + Errno::result({ unsafe { libc::$func(p) } }).map(|_| { + self.aiocb().set_in_progress(); + }) + } + }; +} + +/// An asynchronous version of `fsync(2)`. +/// +/// # References +/// +/// [aio_fsync](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_fsync.html) +/// # Examples +/// +/// ``` +/// # use nix::errno::Errno; +/// # use nix::Error; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify::SigevNone; +/// # use std::{thread, time}; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// let f = tempfile().unwrap(); +/// let mut aiof = Box::pin(AioFsync::new(f.as_raw_fd(), AioFsyncMode::O_SYNC, +/// 0, SigevNone)); +/// aiof.as_mut().submit().expect("aio_fsync failed early"); +/// while (aiof.as_mut().error() == Err(Errno::EINPROGRESS)) { +/// thread::sleep(time::Duration::from_millis(10)); +/// } +/// aiof.as_mut().aio_return().expect("aio_fsync failed late"); +/// ``` +#[derive(Debug)] +#[repr(transparent)] +pub struct AioFsync { + aiocb: AioCb, + _pin: PhantomPinned, +} + +impl AioFsync { + unsafe_pinned!(aiocb: AioCb); + + /// Returns the operation's fsync mode: data and metadata or data only? + pub fn mode(&self) -> AioFsyncMode { + AioFsyncMode::try_from(self.aiocb.aiocb.0.aio_lio_opcode).unwrap() + } + + /// Create a new `AioFsync`. + /// + /// # Arguments + /// + /// * `fd`: File descriptor to sync. + /// * `mode`: Whether to sync file metadata too, or just data. + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio`. + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + pub fn new( + fd: RawFd, + mode: AioFsyncMode, + prio: i32, + sigev_notify: SigevNotify, + ) -> Self { + let mut aiocb = AioCb::common_init(fd, prio, sigev_notify); + // To save some memory, store mode in an unused field of the AioCb. + // True it isn't very much memory, but downstream creates will likely + // create an enum containing this and other AioCb variants and pack + // those enums into data structures like Vec, so it adds up. + aiocb.aiocb.0.aio_lio_opcode = mode as libc::c_int; + AioFsync { + aiocb, + _pin: PhantomPinned, + } + } +} + +impl Aio for AioFsync { + type Output = (); + + aio_methods!(); + + fn aio_return(self: Pin<&mut Self>) -> Result<()> { + self.aiocb().aio_return().map(drop) + } + + fn submit(mut self: Pin<&mut Self>) -> Result<()> { + let aiocb = &mut self.as_mut().aiocb().aiocb.0; + let mode = mem::replace(&mut aiocb.aio_lio_opcode, 0); + let p: *mut libc::aiocb = aiocb; + Errno::result(unsafe { libc::aio_fsync(mode, p) }).map(|_| { + self.aiocb().set_in_progress(); + }) + } +} + +// AioFsync does not need AsMut, since it can't be used with lio_listio + +impl AsRef for AioFsync { + fn as_ref(&self) -> &libc::aiocb { + &self.aiocb.aiocb.0 + } +} + +/// Asynchronously reads from a file descriptor into a buffer +/// +/// # References +/// +/// [aio_read](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_read.html) +/// +/// # Examples +/// +/// +/// ``` +/// # use nix::errno::Errno; +/// # use nix::Error; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use std::{thread, time}; +/// # use std::io::Write; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// const INITIAL: &[u8] = b"abcdef123456"; +/// const LEN: usize = 4; +/// let mut rbuf = vec![0; LEN]; +/// let mut f = tempfile().unwrap(); +/// f.write_all(INITIAL).unwrap(); +/// { +/// let mut aior = Box::pin( +/// AioRead::new( +/// f.as_raw_fd(), +/// 2, //offset +/// &mut rbuf, +/// 0, //priority +/// SigevNotify::SigevNone +/// ) +/// ); +/// aior.as_mut().submit().unwrap(); +/// while (aior.as_mut().error() == Err(Errno::EINPROGRESS)) { +/// thread::sleep(time::Duration::from_millis(10)); +/// } +/// assert_eq!(aior.as_mut().aio_return().unwrap(), LEN); +/// } +/// assert_eq!(rbuf, b"cdef"); +/// ``` +#[derive(Debug)] +#[repr(transparent)] +pub struct AioRead<'a> { + aiocb: AioCb, + _data: PhantomData<&'a [u8]>, + _pin: PhantomPinned, +} + +impl<'a> AioRead<'a> { + unsafe_pinned!(aiocb: AioCb); + + /// Returns the requested length of the aio operation in bytes + /// + /// This method returns the *requested* length of the operation. To get the + /// number of bytes actually read or written by a completed operation, use + /// `aio_return` instead. + pub fn nbytes(&self) -> usize { + self.aiocb.aiocb.0.aio_nbytes + } + + /// Create a new `AioRead`, placing the data in a mutable slice. + /// + /// # Arguments + /// + /// * `fd`: File descriptor to read from + /// * `offs`: File offset + /// * `buf`: A memory buffer. It must outlive the `AioRead`. + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + pub fn new( + fd: RawFd, + offs: off_t, + buf: &'a mut [u8], + prio: i32, + sigev_notify: SigevNotify, + ) -> Self { + let mut aiocb = AioCb::common_init(fd, prio, sigev_notify); + aiocb.aiocb.0.aio_nbytes = buf.len(); + aiocb.aiocb.0.aio_buf = buf.as_mut_ptr() as *mut c_void; + aiocb.aiocb.0.aio_lio_opcode = libc::LIO_READ; + aiocb.aiocb.0.aio_offset = offs; + AioRead { + aiocb, + _data: PhantomData, + _pin: PhantomPinned, + } + } + + /// Returns the file offset of the operation. + pub fn offset(&self) -> off_t { + self.aiocb.aiocb.0.aio_offset + } +} + +impl<'a> Aio for AioRead<'a> { + type Output = usize; + + aio_methods!(aio_read); +} + +impl<'a> AsMut for AioRead<'a> { + fn as_mut(&mut self) -> &mut libc::aiocb { + &mut self.aiocb.aiocb.0 + } +} + +impl<'a> AsRef for AioRead<'a> { + fn as_ref(&self) -> &libc::aiocb { + &self.aiocb.aiocb.0 + } +} + +/// Asynchronously reads from a file descriptor into a scatter/gather list of buffers. +/// +/// # References +/// +/// [aio_readv](https://www.freebsd.org/cgi/man.cgi?query=aio_readv) +/// +/// # Examples +/// +/// +#[cfg_attr(fbsd14, doc = " ```")] +#[cfg_attr(not(fbsd14), doc = " ```no_run")] +/// # use nix::errno::Errno; +/// # use nix::Error; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use std::{thread, time}; +/// # use std::io::{IoSliceMut, Write}; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// const INITIAL: &[u8] = b"abcdef123456"; +/// let mut rbuf0 = vec![0; 4]; +/// let mut rbuf1 = vec![0; 2]; +/// let expected_len = rbuf0.len() + rbuf1.len(); +/// let mut rbufs = [IoSliceMut::new(&mut rbuf0), IoSliceMut::new(&mut rbuf1)]; +/// let mut f = tempfile().unwrap(); +/// f.write_all(INITIAL).unwrap(); +/// { +/// let mut aior = Box::pin( +/// AioReadv::new( +/// f.as_raw_fd(), +/// 2, //offset +/// &mut rbufs, +/// 0, //priority +/// SigevNotify::SigevNone +/// ) +/// ); +/// aior.as_mut().submit().unwrap(); +/// while (aior.as_mut().error() == Err(Errno::EINPROGRESS)) { +/// thread::sleep(time::Duration::from_millis(10)); +/// } +/// assert_eq!(aior.as_mut().aio_return().unwrap(), expected_len); +/// } +/// assert_eq!(rbuf0, b"cdef"); +/// assert_eq!(rbuf1, b"12"); +/// ``` +#[cfg(target_os = "freebsd")] +#[derive(Debug)] +#[repr(transparent)] +pub struct AioReadv<'a> { + aiocb: AioCb, + _data: PhantomData<&'a [&'a [u8]]>, + _pin: PhantomPinned, +} + +#[cfg(target_os = "freebsd")] +impl<'a> AioReadv<'a> { + unsafe_pinned!(aiocb: AioCb); + + /// Returns the number of buffers the operation will read into. + pub fn iovlen(&self) -> usize { + self.aiocb.aiocb.0.aio_nbytes + } + + /// Create a new `AioReadv`, placing the data in a list of mutable slices. + /// + /// # Arguments + /// + /// * `fd`: File descriptor to read from + /// * `offs`: File offset + /// * `bufs`: A scatter/gather list of memory buffers. They must + /// outlive the `AioReadv`. + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + pub fn new( + fd: RawFd, + offs: off_t, + bufs: &mut [IoSliceMut<'a>], + prio: i32, + sigev_notify: SigevNotify, + ) -> Self { + let mut aiocb = AioCb::common_init(fd, prio, sigev_notify); + // In vectored mode, aio_nbytes stores the length of the iovec array, + // not the byte count. + aiocb.aiocb.0.aio_nbytes = bufs.len(); + aiocb.aiocb.0.aio_buf = bufs.as_mut_ptr() as *mut c_void; + aiocb.aiocb.0.aio_lio_opcode = libc::LIO_READV; + aiocb.aiocb.0.aio_offset = offs; + AioReadv { + aiocb, + _data: PhantomData, + _pin: PhantomPinned, + } + } + + /// Returns the file offset of the operation. + pub fn offset(&self) -> off_t { + self.aiocb.aiocb.0.aio_offset + } +} + +#[cfg(target_os = "freebsd")] +impl<'a> Aio for AioReadv<'a> { + type Output = usize; + + aio_methods!(aio_readv); +} + +#[cfg(target_os = "freebsd")] +impl<'a> AsMut for AioReadv<'a> { + fn as_mut(&mut self) -> &mut libc::aiocb { + &mut self.aiocb.aiocb.0 + } +} + +#[cfg(target_os = "freebsd")] +impl<'a> AsRef for AioReadv<'a> { + fn as_ref(&self) -> &libc::aiocb { + &self.aiocb.aiocb.0 + } +} + +/// Asynchronously writes from a buffer to a file descriptor +/// +/// # References +/// +/// [aio_write](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_write.html) +/// +/// # Examples +/// +/// ``` +/// # use nix::errno::Errno; +/// # use nix::Error; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use std::{thread, time}; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// const WBUF: &[u8] = b"abcdef123456"; +/// let mut f = tempfile().unwrap(); +/// let mut aiow = Box::pin( +/// AioWrite::new( +/// f.as_raw_fd(), +/// 2, //offset +/// WBUF, +/// 0, //priority +/// SigevNotify::SigevNone +/// ) +/// ); +/// aiow.as_mut().submit().unwrap(); +/// while (aiow.as_mut().error() == Err(Errno::EINPROGRESS)) { +/// thread::sleep(time::Duration::from_millis(10)); +/// } +/// assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len()); +/// ``` +#[derive(Debug)] +#[repr(transparent)] +pub struct AioWrite<'a> { + aiocb: AioCb, + _data: PhantomData<&'a [u8]>, + _pin: PhantomPinned, +} + +impl<'a> AioWrite<'a> { + unsafe_pinned!(aiocb: AioCb); + + /// Returns the requested length of the aio operation in bytes + /// + /// This method returns the *requested* length of the operation. To get the + /// number of bytes actually read or written by a completed operation, use + /// `aio_return` instead. + pub fn nbytes(&self) -> usize { + self.aiocb.aiocb.0.aio_nbytes + } + + /// Construct a new `AioWrite`. + /// + /// # Arguments + /// + /// * `fd`: File descriptor to write to + /// * `offs`: File offset + /// * `buf`: A memory buffer. It must outlive the `AioWrite`. + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + pub fn new( + fd: RawFd, + offs: off_t, + buf: &'a [u8], + prio: i32, + sigev_notify: SigevNotify, + ) -> Self { + let mut aiocb = AioCb::common_init(fd, prio, sigev_notify); + aiocb.aiocb.0.aio_nbytes = buf.len(); + // casting an immutable buffer to a mutable pointer looks unsafe, + // but technically its only unsafe to dereference it, not to create + // it. Type Safety guarantees that we'll never pass aiocb to + // aio_read or aio_readv. + aiocb.aiocb.0.aio_buf = buf.as_ptr() as *mut c_void; + aiocb.aiocb.0.aio_lio_opcode = libc::LIO_WRITE; + aiocb.aiocb.0.aio_offset = offs; + AioWrite { + aiocb, + _data: PhantomData, + _pin: PhantomPinned, + } + } + + /// Returns the file offset of the operation. + pub fn offset(&self) -> off_t { + self.aiocb.aiocb.0.aio_offset + } +} + +impl<'a> Aio for AioWrite<'a> { + type Output = usize; + + aio_methods!(aio_write); +} + +impl<'a> AsMut for AioWrite<'a> { + fn as_mut(&mut self) -> &mut libc::aiocb { + &mut self.aiocb.aiocb.0 + } +} + +impl<'a> AsRef for AioWrite<'a> { + fn as_ref(&self) -> &libc::aiocb { + &self.aiocb.aiocb.0 + } +} + +/// Asynchronously writes from a scatter/gather list of buffers to a file descriptor. +/// +/// # References +/// +/// [aio_writev](https://www.freebsd.org/cgi/man.cgi?query=aio_writev) +/// +/// # Examples +/// +#[cfg_attr(fbsd14, doc = " ```")] +#[cfg_attr(not(fbsd14), doc = " ```no_run")] +/// # use nix::errno::Errno; +/// # use nix::Error; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use std::{thread, time}; +/// # use std::io::IoSlice; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// const wbuf0: &[u8] = b"abcdef"; +/// const wbuf1: &[u8] = b"123456"; +/// let len = wbuf0.len() + wbuf1.len(); +/// let wbufs = [IoSlice::new(wbuf0), IoSlice::new(wbuf1)]; +/// let mut f = tempfile().unwrap(); +/// let mut aiow = Box::pin( +/// AioWritev::new( +/// f.as_raw_fd(), +/// 2, //offset +/// &wbufs, +/// 0, //priority +/// SigevNotify::SigevNone +/// ) +/// ); +/// aiow.as_mut().submit().unwrap(); +/// while (aiow.as_mut().error() == Err(Errno::EINPROGRESS)) { +/// thread::sleep(time::Duration::from_millis(10)); +/// } +/// assert_eq!(aiow.as_mut().aio_return().unwrap(), len); +/// ``` +#[cfg(target_os = "freebsd")] +#[derive(Debug)] +#[repr(transparent)] +pub struct AioWritev<'a> { + aiocb: AioCb, + _data: PhantomData<&'a [&'a [u8]]>, + _pin: PhantomPinned, +} + +#[cfg(target_os = "freebsd")] +impl<'a> AioWritev<'a> { + unsafe_pinned!(aiocb: AioCb); + + /// Returns the number of buffers the operation will read into. + pub fn iovlen(&self) -> usize { + self.aiocb.aiocb.0.aio_nbytes + } + + /// Construct a new `AioWritev`. + /// + /// # Arguments + /// + /// * `fd`: File descriptor to write to + /// * `offs`: File offset + /// * `bufs`: A scatter/gather list of memory buffers. They must + /// outlive the `AioWritev`. + /// * `prio`: If POSIX Prioritized IO is supported, then the + /// operation will be prioritized at the process's + /// priority level minus `prio` + /// * `sigev_notify`: Determines how you will be notified of event + /// completion. + pub fn new( + fd: RawFd, + offs: off_t, + bufs: &[IoSlice<'a>], + prio: i32, + sigev_notify: SigevNotify, + ) -> Self { + let mut aiocb = AioCb::common_init(fd, prio, sigev_notify); + // In vectored mode, aio_nbytes stores the length of the iovec array, + // not the byte count. + aiocb.aiocb.0.aio_nbytes = bufs.len(); + // casting an immutable buffer to a mutable pointer looks unsafe, + // but technically its only unsafe to dereference it, not to create + // it. Type Safety guarantees that we'll never pass aiocb to + // aio_read or aio_readv. + aiocb.aiocb.0.aio_buf = bufs.as_ptr() as *mut c_void; + aiocb.aiocb.0.aio_lio_opcode = libc::LIO_WRITEV; + aiocb.aiocb.0.aio_offset = offs; + AioWritev { + aiocb, + _data: PhantomData, + _pin: PhantomPinned, + } + } + + /// Returns the file offset of the operation. + pub fn offset(&self) -> off_t { + self.aiocb.aiocb.0.aio_offset + } +} + +#[cfg(target_os = "freebsd")] +impl<'a> Aio for AioWritev<'a> { + type Output = usize; + + aio_methods!(aio_writev); +} + +#[cfg(target_os = "freebsd")] +impl<'a> AsMut for AioWritev<'a> { + fn as_mut(&mut self) -> &mut libc::aiocb { + &mut self.aiocb.aiocb.0 + } +} + +#[cfg(target_os = "freebsd")] +impl<'a> AsRef for AioWritev<'a> { + fn as_ref(&self) -> &libc::aiocb { + &self.aiocb.aiocb.0 + } +} + +/// Cancels outstanding AIO requests for a given file descriptor. +/// +/// # Examples +/// +/// Issue an aio operation, then cancel all outstanding operations on that file +/// descriptor. +/// +/// ``` +/// # use nix::errno::Errno; +/// # use nix::Error; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use std::{thread, time}; +/// # use std::io::Write; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// let wbuf = b"CDEF"; +/// let mut f = tempfile().unwrap(); +/// let mut aiocb = Box::pin(AioWrite::new(f.as_raw_fd(), +/// 2, //offset +/// &wbuf[..], +/// 0, //priority +/// SigevNotify::SigevNone)); +/// aiocb.as_mut().submit().unwrap(); +/// let cs = aio_cancel_all(f.as_raw_fd()).unwrap(); +/// if cs == AioCancelStat::AioNotCanceled { +/// while (aiocb.as_mut().error() == Err(Errno::EINPROGRESS)) { +/// thread::sleep(time::Duration::from_millis(10)); +/// } +/// } +/// // Must call `aio_return`, but ignore the result +/// let _ = aiocb.as_mut().aio_return(); +/// ``` +/// +/// # References +/// +/// [`aio_cancel`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_cancel.html) +pub fn aio_cancel_all(fd: RawFd) -> Result { + match unsafe { libc::aio_cancel(fd, ptr::null_mut()) } { + libc::AIO_CANCELED => Ok(AioCancelStat::AioCanceled), + libc::AIO_NOTCANCELED => Ok(AioCancelStat::AioNotCanceled), + libc::AIO_ALLDONE => Ok(AioCancelStat::AioAllDone), + -1 => Err(Errno::last()), + _ => panic!("unknown aio_cancel return value"), + } +} + +/// Suspends the calling process until at least one of the specified operations +/// have completed, a signal is delivered, or the timeout has passed. +/// +/// If `timeout` is `None`, `aio_suspend` will block indefinitely. +/// +/// # Examples +/// +/// Use `aio_suspend` to block until an aio operation completes. +/// +/// ``` +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use std::os::unix::io::AsRawFd; +/// # use tempfile::tempfile; +/// const WBUF: &[u8] = b"abcdef123456"; +/// let mut f = tempfile().unwrap(); +/// let mut aiocb = Box::pin(AioWrite::new(f.as_raw_fd(), +/// 2, //offset +/// WBUF, +/// 0, //priority +/// SigevNotify::SigevNone)); +/// aiocb.as_mut().submit().unwrap(); +/// aio_suspend(&[&*aiocb], None).expect("aio_suspend failed"); +/// assert_eq!(aiocb.as_mut().aio_return().unwrap() as usize, WBUF.len()); +/// ``` +/// # References +/// +/// [`aio_suspend`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/aio_suspend.html) +pub fn aio_suspend( + list: &[&dyn AsRef], + timeout: Option, +) -> Result<()> { + let p = list as *const [&dyn AsRef] + as *const [*const libc::aiocb] + as *const *const libc::aiocb; + let timep = match timeout { + None => ptr::null::(), + Some(x) => x.as_ref() as *const libc::timespec, + }; + Errno::result(unsafe { libc::aio_suspend(p, list.len() as i32, timep) }) + .map(drop) +} + +/// Submits multiple asynchronous I/O requests with a single system call. +/// +/// They are not guaranteed to complete atomically, and the order in which the +/// requests are carried out is not specified. Reads, and writes may be freely +/// mixed. +/// +/// # Examples +/// +/// Use `lio_listio` to submit an aio operation and wait for its completion. In +/// this case, there is no need to use aio_suspend to wait or `error` to poll. +/// This mode is useful for otherwise-synchronous programs that want to execute +/// a handful of I/O operations in parallel. +/// ``` +/// # use std::os::unix::io::AsRawFd; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use tempfile::tempfile; +/// const WBUF: &[u8] = b"abcdef123456"; +/// let mut f = tempfile().unwrap(); +/// let mut aiow = Box::pin(AioWrite::new( +/// f.as_raw_fd(), +/// 2, // offset +/// WBUF, +/// 0, // priority +/// SigevNotify::SigevNone +/// )); +/// lio_listio(LioMode::LIO_WAIT, &mut[aiow.as_mut()], SigevNotify::SigevNone) +/// .unwrap(); +/// // At this point, we are guaranteed that aiow is complete. +/// assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len()); +/// ``` +/// +/// Use `lio_listio` to submit multiple asynchronous operations with a single +/// syscall, but receive notification individually. This is an efficient +/// technique for reducing overall context-switch overhead, especially when +/// combined with kqueue. +/// ``` +/// # use std::os::unix::io::AsRawFd; +/// # use std::thread; +/// # use std::time; +/// # use nix::errno::Errno; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::SigevNotify; +/// # use tempfile::tempfile; +/// const WBUF: &[u8] = b"abcdef123456"; +/// let mut f = tempfile().unwrap(); +/// let mut aiow = Box::pin(AioWrite::new( +/// f.as_raw_fd(), +/// 2, // offset +/// WBUF, +/// 0, // priority +/// SigevNotify::SigevNone +/// )); +/// lio_listio(LioMode::LIO_NOWAIT, &mut[aiow.as_mut()], SigevNotify::SigevNone) +/// .unwrap(); +/// // We must wait for the completion of each individual operation +/// while (aiow.as_mut().error() == Err(Errno::EINPROGRESS)) { +/// thread::sleep(time::Duration::from_millis(10)); +/// } +/// assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len()); +/// ``` +/// +/// Use `lio_listio` to submit multiple operations, and receive notification +/// only when all of them are complete. This can be useful when there is some +/// logical relationship between the operations. But beware! Errors or system +/// resource limitations may cause `lio_listio` to return `EIO`, `EAGAIN`, or +/// `EINTR`, in which case some but not all operations may have been submitted. +/// In that case, you must check the status of each individual operation, and +/// possibly resubmit some. +/// ``` +/// # use libc::c_int; +/// # use std::os::unix::io::AsRawFd; +/// # use std::sync::atomic::{AtomicBool, Ordering}; +/// # use std::thread; +/// # use std::time; +/// # use lazy_static::lazy_static; +/// # use nix::errno::Errno; +/// # use nix::sys::aio::*; +/// # use nix::sys::signal::*; +/// # use tempfile::tempfile; +/// lazy_static! { +/// pub static ref SIGNALED: AtomicBool = AtomicBool::new(false); +/// } +/// +/// extern fn sigfunc(_: c_int) { +/// SIGNALED.store(true, Ordering::Relaxed); +/// } +/// let sa = SigAction::new(SigHandler::Handler(sigfunc), +/// SaFlags::SA_RESETHAND, +/// SigSet::empty()); +/// SIGNALED.store(false, Ordering::Relaxed); +/// unsafe { sigaction(Signal::SIGUSR2, &sa) }.unwrap(); +/// +/// const WBUF: &[u8] = b"abcdef123456"; +/// let mut f = tempfile().unwrap(); +/// let mut aiow = Box::pin(AioWrite::new( +/// f.as_raw_fd(), +/// 2, // offset +/// WBUF, +/// 0, // priority +/// SigevNotify::SigevNone +/// )); +/// let sev = SigevNotify::SigevSignal { signal: Signal::SIGUSR2, si_value: 0 }; +/// lio_listio(LioMode::LIO_NOWAIT, &mut[aiow.as_mut()], sev).unwrap(); +/// while !SIGNALED.load(Ordering::Relaxed) { +/// thread::sleep(time::Duration::from_millis(10)); +/// } +/// // At this point, since `lio_listio` returned success and delivered its +/// // notification, we know that all operations are complete. +/// assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len()); +/// ``` +pub fn lio_listio( + mode: LioMode, + list: &mut [Pin<&mut dyn AsMut>], + sigev_notify: SigevNotify, +) -> Result<()> { + let p = list as *mut [Pin<&mut dyn AsMut>] + as *mut [*mut libc::aiocb] + as *mut *mut libc::aiocb; + let sigev = SigEvent::new(sigev_notify); + let sigevp = &mut sigev.sigevent() as *mut libc::sigevent; + Errno::result(unsafe { + libc::lio_listio(mode as i32, p, list.len() as i32, sigevp) + }) + .map(drop) +} + +#[cfg(test)] +mod t { + use super::*; + + /// aio_suspend relies on casting Rust Aio* struct pointers to libc::aiocb + /// pointers. This test ensures that such casts are valid. + #[test] + fn casting() { + let sev = SigevNotify::SigevNone; + let aiof = AioFsync::new(666, AioFsyncMode::O_SYNC, 0, sev); + assert_eq!( + aiof.as_ref() as *const libc::aiocb, + &aiof as *const AioFsync as *const libc::aiocb + ); + + let mut rbuf = []; + let aior = AioRead::new(666, 0, &mut rbuf, 0, sev); + assert_eq!( + aior.as_ref() as *const libc::aiocb, + &aior as *const AioRead as *const libc::aiocb + ); + + let wbuf = []; + let aiow = AioWrite::new(666, 0, &wbuf, 0, sev); + assert_eq!( + aiow.as_ref() as *const libc::aiocb, + &aiow as *const AioWrite as *const libc::aiocb + ); + } + + #[cfg(target_os = "freebsd")] + #[test] + fn casting_vectored() { + let sev = SigevNotify::SigevNone; + + let mut rbuf = []; + let mut rbufs = [IoSliceMut::new(&mut rbuf)]; + let aiorv = AioReadv::new(666, 0, &mut rbufs[..], 0, sev); + assert_eq!( + aiorv.as_ref() as *const libc::aiocb, + &aiorv as *const AioReadv as *const libc::aiocb + ); + + let wbuf = []; + let wbufs = [IoSlice::new(&wbuf)]; + let aiowv = AioWritev::new(666, 0, &wbufs, 0, sev); + assert_eq!( + aiowv.as_ref() as *const libc::aiocb, + &aiowv as *const AioWritev as *const libc::aiocb + ); + } +} diff --git a/bash-5.1/vendor/nix/src/sys/epoll.rs b/bash-5.1/vendor/nix/src/sys/epoll.rs new file mode 100644 index 0000000000000000000000000000000000000000..8141ff5cb3edd18d29b85538898598a9bc2aded6 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/epoll.rs @@ -0,0 +1,108 @@ +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_int}; +use std::os::unix::io::RawFd; +use std::ptr; +use std::mem; + +libc_bitflags!( + pub struct EpollFlags: c_int { + EPOLLIN; + EPOLLPRI; + EPOLLOUT; + EPOLLRDNORM; + EPOLLRDBAND; + EPOLLWRNORM; + EPOLLWRBAND; + EPOLLMSG; + EPOLLERR; + EPOLLHUP; + EPOLLRDHUP; + EPOLLEXCLUSIVE; + #[cfg(not(target_arch = "mips"))] + EPOLLWAKEUP; + EPOLLONESHOT; + EPOLLET; + } +); + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(i32)] +#[non_exhaustive] +pub enum EpollOp { + EpollCtlAdd = libc::EPOLL_CTL_ADD, + EpollCtlDel = libc::EPOLL_CTL_DEL, + EpollCtlMod = libc::EPOLL_CTL_MOD, +} + +libc_bitflags!{ + pub struct EpollCreateFlags: c_int { + EPOLL_CLOEXEC; + } +} + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct EpollEvent { + event: libc::epoll_event, +} + +impl EpollEvent { + pub fn new(events: EpollFlags, data: u64) -> Self { + EpollEvent { event: libc::epoll_event { events: events.bits() as u32, u64: data } } + } + + pub fn empty() -> Self { + unsafe { mem::zeroed::() } + } + + pub fn events(&self) -> EpollFlags { + EpollFlags::from_bits(self.event.events as c_int).unwrap() + } + + pub fn data(&self) -> u64 { + self.event.u64 + } +} + +#[inline] +pub fn epoll_create() -> Result { + let res = unsafe { libc::epoll_create(1024) }; + + Errno::result(res) +} + +#[inline] +pub fn epoll_create1(flags: EpollCreateFlags) -> Result { + let res = unsafe { libc::epoll_create1(flags.bits()) }; + + Errno::result(res) +} + +#[inline] +pub fn epoll_ctl<'a, T>(epfd: RawFd, op: EpollOp, fd: RawFd, event: T) -> Result<()> + where T: Into> +{ + let mut event: Option<&mut EpollEvent> = event.into(); + if event.is_none() && op != EpollOp::EpollCtlDel { + Err(Errno::EINVAL) + } else { + let res = unsafe { + if let Some(ref mut event) = event { + libc::epoll_ctl(epfd, op as c_int, fd, &mut event.event) + } else { + libc::epoll_ctl(epfd, op as c_int, fd, ptr::null_mut()) + } + }; + Errno::result(res).map(drop) + } +} + +#[inline] +pub fn epoll_wait(epfd: RawFd, events: &mut [EpollEvent], timeout_ms: isize) -> Result { + let res = unsafe { + libc::epoll_wait(epfd, events.as_mut_ptr() as *mut libc::epoll_event, events.len() as c_int, timeout_ms as c_int) + }; + + Errno::result(res).map(|r| r as usize) +} diff --git a/bash-5.1/vendor/nix/src/sys/event.rs b/bash-5.1/vendor/nix/src/sys/event.rs new file mode 100644 index 0000000000000000000000000000000000000000..0d0d23a48feb192a791dc47d47b517523c5fc041 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/event.rs @@ -0,0 +1,346 @@ +/* TOOD: Implement for other kqueue based systems + */ + +use crate::{Errno, Result}; +#[cfg(not(target_os = "netbsd"))] +use libc::{timespec, time_t, c_int, c_long, intptr_t, uintptr_t}; +#[cfg(target_os = "netbsd")] +use libc::{timespec, time_t, c_long, intptr_t, uintptr_t, size_t}; +use std::convert::TryInto; +use std::mem; +use std::os::unix::io::RawFd; +use std::ptr; + +// Redefine kevent in terms of programmer-friendly enums and bitfields. +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct KEvent { + kevent: libc::kevent, +} + +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "openbsd"))] +type type_of_udata = *mut libc::c_void; +#[cfg(any(target_os = "netbsd"))] +type type_of_udata = intptr_t; + +#[cfg(target_os = "netbsd")] +type type_of_event_filter = u32; +#[cfg(not(target_os = "netbsd"))] +type type_of_event_filter = i16; +libc_enum! { + #[cfg_attr(target_os = "netbsd", repr(u32))] + #[cfg_attr(not(target_os = "netbsd"), repr(i16))] + #[non_exhaustive] + pub enum EventFilter { + EVFILT_AIO, + /// Returns whenever there is no remaining data in the write buffer + #[cfg(target_os = "freebsd")] + EVFILT_EMPTY, + #[cfg(target_os = "dragonfly")] + EVFILT_EXCEPT, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] + EVFILT_FS, + #[cfg(target_os = "freebsd")] + EVFILT_LIO, + #[cfg(any(target_os = "ios", target_os = "macos"))] + EVFILT_MACHPORT, + EVFILT_PROC, + /// Returns events associated with the process referenced by a given + /// process descriptor, created by `pdfork()`. The events to monitor are: + /// + /// - NOTE_EXIT: the process has exited. The exit status will be stored in data. + #[cfg(target_os = "freebsd")] + EVFILT_PROCDESC, + EVFILT_READ, + /// Returns whenever an asynchronous `sendfile()` call completes. + #[cfg(target_os = "freebsd")] + EVFILT_SENDFILE, + EVFILT_SIGNAL, + EVFILT_TIMER, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] + EVFILT_USER, + #[cfg(any(target_os = "ios", target_os = "macos"))] + EVFILT_VM, + EVFILT_VNODE, + EVFILT_WRITE, + } + impl TryFrom +} + +#[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "openbsd"))] +pub type type_of_event_flag = u16; +#[cfg(any(target_os = "netbsd"))] +pub type type_of_event_flag = u32; +libc_bitflags!{ + pub struct EventFlag: type_of_event_flag { + EV_ADD; + EV_CLEAR; + EV_DELETE; + EV_DISABLE; + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + EV_DISPATCH; + #[cfg(target_os = "freebsd")] + EV_DROP; + EV_ENABLE; + EV_EOF; + EV_ERROR; + #[cfg(any(target_os = "macos", target_os = "ios"))] + EV_FLAG0; + EV_FLAG1; + #[cfg(target_os = "dragonfly")] + EV_NODATA; + EV_ONESHOT; + #[cfg(any(target_os = "macos", target_os = "ios"))] + EV_OOBAND; + #[cfg(any(target_os = "macos", target_os = "ios"))] + EV_POLL; + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + EV_RECEIPT; + } +} + +libc_bitflags!( + pub struct FilterFlag: u32 { + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_ABSOLUTE; + NOTE_ATTRIB; + NOTE_CHILD; + NOTE_DELETE; + #[cfg(target_os = "openbsd")] + NOTE_EOF; + NOTE_EXEC; + NOTE_EXIT; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_EXITSTATUS; + NOTE_EXTEND; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFAND; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFCOPY; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFCTRLMASK; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFLAGSMASK; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFNOP; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_FFOR; + NOTE_FORK; + NOTE_LINK; + NOTE_LOWAT; + #[cfg(target_os = "freebsd")] + NOTE_MSECONDS; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_NONE; + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))] + NOTE_NSECONDS; + #[cfg(target_os = "dragonfly")] + NOTE_OOB; + NOTE_PCTRLMASK; + NOTE_PDATAMASK; + NOTE_RENAME; + NOTE_REVOKE; + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))] + NOTE_SECONDS; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_SIGNAL; + NOTE_TRACK; + NOTE_TRACKERR; + #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly"))] + NOTE_TRIGGER; + #[cfg(target_os = "openbsd")] + NOTE_TRUNCATE; + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd"))] + NOTE_USECONDS; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_ERROR; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_PRESSURE; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_PRESSURE_SUDDEN_TERMINATE; + #[cfg(any(target_os = "macos", target_os = "ios"))] + NOTE_VM_PRESSURE_TERMINATE; + NOTE_WRITE; + } +); + +pub fn kqueue() -> Result { + let res = unsafe { libc::kqueue() }; + + Errno::result(res) +} + + +// KEvent can't derive Send because on some operating systems, udata is defined +// as a void*. However, KEvent's public API always treats udata as an intptr_t, +// which is safe to Send. +unsafe impl Send for KEvent { +} + +impl KEvent { + #[allow(clippy::needless_update)] // Not needless on all platforms. + pub fn new(ident: uintptr_t, filter: EventFilter, flags: EventFlag, + fflags:FilterFlag, data: intptr_t, udata: intptr_t) -> KEvent { + KEvent { kevent: libc::kevent { + ident, + filter: filter as type_of_event_filter, + flags: flags.bits(), + fflags: fflags.bits(), + // data can be either i64 or intptr_t, depending on platform + data: data as _, + udata: udata as type_of_udata, + .. unsafe { mem::zeroed() } + } } + } + + pub fn ident(&self) -> uintptr_t { + self.kevent.ident + } + + pub fn filter(&self) -> Result { + self.kevent.filter.try_into() + } + + pub fn flags(&self) -> EventFlag { + EventFlag::from_bits(self.kevent.flags).unwrap() + } + + pub fn fflags(&self) -> FilterFlag { + FilterFlag::from_bits(self.kevent.fflags).unwrap() + } + + pub fn data(&self) -> intptr_t { + self.kevent.data as intptr_t + } + + pub fn udata(&self) -> intptr_t { + self.kevent.udata as intptr_t + } +} + +pub fn kevent(kq: RawFd, + changelist: &[KEvent], + eventlist: &mut [KEvent], + timeout_ms: usize) -> Result { + + // Convert ms to timespec + let timeout = timespec { + tv_sec: (timeout_ms / 1000) as time_t, + tv_nsec: ((timeout_ms % 1000) * 1_000_000) as c_long + }; + + kevent_ts(kq, changelist, eventlist, Some(timeout)) +} + +#[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "openbsd"))] +type type_of_nchanges = c_int; +#[cfg(target_os = "netbsd")] +type type_of_nchanges = size_t; + +pub fn kevent_ts(kq: RawFd, + changelist: &[KEvent], + eventlist: &mut [KEvent], + timeout_opt: Option) -> Result { + + let res = unsafe { + libc::kevent( + kq, + changelist.as_ptr() as *const libc::kevent, + changelist.len() as type_of_nchanges, + eventlist.as_mut_ptr() as *mut libc::kevent, + eventlist.len() as type_of_nchanges, + if let Some(ref timeout) = timeout_opt {timeout as *const timespec} else {ptr::null()}) + }; + + Errno::result(res).map(|r| r as usize) +} + +#[inline] +pub fn ev_set(ev: &mut KEvent, + ident: usize, + filter: EventFilter, + flags: EventFlag, + fflags: FilterFlag, + udata: intptr_t) { + + ev.kevent.ident = ident as uintptr_t; + ev.kevent.filter = filter as type_of_event_filter; + ev.kevent.flags = flags.bits(); + ev.kevent.fflags = fflags.bits(); + ev.kevent.data = 0; + ev.kevent.udata = udata as type_of_udata; +} + +#[test] +fn test_struct_kevent() { + use std::mem; + + let udata : intptr_t = 12345; + + let actual = KEvent::new(0xdead_beef, + EventFilter::EVFILT_READ, + EventFlag::EV_ONESHOT | EventFlag::EV_ADD, + FilterFlag::NOTE_CHILD | FilterFlag::NOTE_EXIT, + 0x1337, + udata); + assert_eq!(0xdead_beef, actual.ident()); + let filter = actual.kevent.filter; + assert_eq!(libc::EVFILT_READ, filter); + assert_eq!(libc::EV_ONESHOT | libc::EV_ADD, actual.flags().bits()); + assert_eq!(libc::NOTE_CHILD | libc::NOTE_EXIT, actual.fflags().bits()); + assert_eq!(0x1337, actual.data()); + assert_eq!(udata as type_of_udata, actual.udata() as type_of_udata); + assert_eq!(mem::size_of::(), mem::size_of::()); +} + +#[test] +fn test_kevent_filter() { + let udata : intptr_t = 12345; + + let actual = KEvent::new(0xdead_beef, + EventFilter::EVFILT_READ, + EventFlag::EV_ONESHOT | EventFlag::EV_ADD, + FilterFlag::NOTE_CHILD | FilterFlag::NOTE_EXIT, + 0x1337, + udata); + assert_eq!(EventFilter::EVFILT_READ, actual.filter().unwrap()); +} diff --git a/bash-5.1/vendor/nix/src/sys/eventfd.rs b/bash-5.1/vendor/nix/src/sys/eventfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..c54f952f09a9ead9f04640ce69d374acbcf1bddd --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/eventfd.rs @@ -0,0 +1,17 @@ +use std::os::unix::io::RawFd; +use crate::Result; +use crate::errno::Errno; + +libc_bitflags! { + pub struct EfdFlags: libc::c_int { + EFD_CLOEXEC; // Since Linux 2.6.27 + EFD_NONBLOCK; // Since Linux 2.6.27 + EFD_SEMAPHORE; // Since Linux 2.6.30 + } +} + +pub fn eventfd(initval: libc::c_uint, flags: EfdFlags) -> Result { + let res = unsafe { libc::eventfd(initval, flags.bits()) }; + + Errno::result(res).map(|r| r as RawFd) +} diff --git a/bash-5.1/vendor/nix/src/sys/inotify.rs b/bash-5.1/vendor/nix/src/sys/inotify.rs new file mode 100644 index 0000000000000000000000000000000000000000..b19dbe12dd29562a352f588af6c07c528a46960f --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/inotify.rs @@ -0,0 +1,257 @@ +//! Monitoring API for filesystem events. +//! +//! Inotify is a Linux-only API to monitor filesystems events. +//! +//! For more documentation, please read [inotify(7)](https://man7.org/linux/man-pages/man7/inotify.7.html). +//! +//! # Examples +//! +//! Monitor all events happening in directory "test": +//! ```no_run +//! # use nix::sys::inotify::{AddWatchFlags,InitFlags,Inotify}; +//! # +//! // We create a new inotify instance. +//! let instance = Inotify::init(InitFlags::empty()).unwrap(); +//! +//! // We add a new watch on directory "test" for all events. +//! let wd = instance.add_watch("test", AddWatchFlags::IN_ALL_EVENTS).unwrap(); +//! +//! loop { +//! // We read from our inotify instance for events. +//! let events = instance.read_events().unwrap(); +//! println!("Events: {:?}", events); +//! } +//! ``` + +use libc::{ + c_char, + c_int, +}; +use std::ffi::{OsString,OsStr,CStr}; +use std::os::unix::ffi::OsStrExt; +use std::mem::{MaybeUninit, size_of}; +use std::os::unix::io::{RawFd,AsRawFd,FromRawFd}; +use std::ptr; +use crate::unistd::read; +use crate::Result; +use crate::NixPath; +use crate::errno::Errno; +use cfg_if::cfg_if; + +libc_bitflags! { + /// Configuration options for [`inotify_add_watch`](fn.inotify_add_watch.html). + pub struct AddWatchFlags: u32 { + /// File was accessed. + IN_ACCESS; + /// File was modified. + IN_MODIFY; + /// Metadata changed. + IN_ATTRIB; + /// Writable file was closed. + IN_CLOSE_WRITE; + /// Nonwritable file was closed. + IN_CLOSE_NOWRITE; + /// File was opened. + IN_OPEN; + /// File was moved from X. + IN_MOVED_FROM; + /// File was moved to Y. + IN_MOVED_TO; + /// Subfile was created. + IN_CREATE; + /// Subfile was deleted. + IN_DELETE; + /// Self was deleted. + IN_DELETE_SELF; + /// Self was moved. + IN_MOVE_SELF; + + /// Backing filesystem was unmounted. + IN_UNMOUNT; + /// Event queue overflowed. + IN_Q_OVERFLOW; + /// File was ignored. + IN_IGNORED; + + /// Combination of `IN_CLOSE_WRITE` and `IN_CLOSE_NOWRITE`. + IN_CLOSE; + /// Combination of `IN_MOVED_FROM` and `IN_MOVED_TO`. + IN_MOVE; + + /// Only watch the path if it is a directory. + IN_ONLYDIR; + /// Don't follow symlinks. + IN_DONT_FOLLOW; + + /// Event occurred against directory. + IN_ISDIR; + /// Only send event once. + IN_ONESHOT; + /// All of the events. + IN_ALL_EVENTS; + } +} + +libc_bitflags! { + /// Configuration options for [`inotify_init1`](fn.inotify_init1.html). + pub struct InitFlags: c_int { + /// Set the `FD_CLOEXEC` flag on the file descriptor. + IN_CLOEXEC; + /// Set the `O_NONBLOCK` flag on the open file description referred to by the new file descriptor. + IN_NONBLOCK; + } +} + +/// An inotify instance. This is also a file descriptor, you can feed it to +/// other interfaces consuming file descriptors, epoll for example. +#[derive(Debug, Clone, Copy)] +pub struct Inotify { + fd: RawFd +} + +/// This object is returned when you create a new watch on an inotify instance. +/// It is then returned as part of an event once triggered. It allows you to +/// know which watch triggered which event. +#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Ord, PartialOrd)] +pub struct WatchDescriptor { + wd: i32 +} + +/// A single inotify event. +/// +/// For more documentation see, [inotify(7)](https://man7.org/linux/man-pages/man7/inotify.7.html). +#[derive(Debug)] +pub struct InotifyEvent { + /// Watch descriptor. This field corresponds to the watch descriptor you + /// were issued when calling add_watch. It allows you to know which watch + /// this event comes from. + pub wd: WatchDescriptor, + /// Event mask. This field is a bitfield describing the exact event that + /// occured. + pub mask: AddWatchFlags, + /// This cookie is a number that allows you to connect related events. For + /// now only IN_MOVED_FROM and IN_MOVED_TO can be connected. + pub cookie: u32, + /// Filename. This field exists only if the event was triggered for a file + /// inside the watched directory. + pub name: Option +} + +impl Inotify { + /// Initialize a new inotify instance. + /// + /// Returns a Result containing an inotify instance. + /// + /// For more information see, [inotify_init(2)](https://man7.org/linux/man-pages/man2/inotify_init.2.html). + pub fn init(flags: InitFlags) -> Result { + let res = Errno::result(unsafe { + libc::inotify_init1(flags.bits()) + }); + + res.map(|fd| Inotify { fd }) + } + + /// Adds a new watch on the target file or directory. + /// + /// Returns a watch descriptor. This is not a File Descriptor! + /// + /// For more information see, [inotify_add_watch(2)](https://man7.org/linux/man-pages/man2/inotify_add_watch.2.html). + pub fn add_watch(self, + path: &P, + mask: AddWatchFlags) + -> Result + { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::inotify_add_watch(self.fd, cstr.as_ptr(), mask.bits()) + } + })?; + + Errno::result(res).map(|wd| WatchDescriptor { wd }) + } + + /// Removes an existing watch using the watch descriptor returned by + /// inotify_add_watch. + /// + /// Returns an EINVAL error if the watch descriptor is invalid. + /// + /// For more information see, [inotify_rm_watch(2)](https://man7.org/linux/man-pages/man2/inotify_rm_watch.2.html). + pub fn rm_watch(self, wd: WatchDescriptor) -> Result<()> { + cfg_if! { + if #[cfg(target_os = "linux")] { + let arg = wd.wd; + } else if #[cfg(target_os = "android")] { + let arg = wd.wd as u32; + } + } + let res = unsafe { libc::inotify_rm_watch(self.fd, arg) }; + + Errno::result(res).map(drop) + } + + /// Reads a collection of events from the inotify file descriptor. This call + /// can either be blocking or non blocking depending on whether IN_NONBLOCK + /// was set at initialization. + /// + /// Returns as many events as available. If the call was non blocking and no + /// events could be read then the EAGAIN error is returned. + pub fn read_events(self) -> Result> { + let header_size = size_of::(); + const BUFSIZ: usize = 4096; + let mut buffer = [0u8; BUFSIZ]; + let mut events = Vec::new(); + let mut offset = 0; + + let nread = read(self.fd, &mut buffer)?; + + while (nread - offset) >= header_size { + let event = unsafe { + let mut event = MaybeUninit::::uninit(); + ptr::copy_nonoverlapping( + buffer.as_ptr().add(offset), + event.as_mut_ptr() as *mut u8, + (BUFSIZ - offset).min(header_size) + ); + event.assume_init() + }; + + let name = match event.len { + 0 => None, + _ => { + let ptr = unsafe { + buffer + .as_ptr() + .add(offset + header_size) + as *const c_char + }; + let cstr = unsafe { CStr::from_ptr(ptr) }; + + Some(OsStr::from_bytes(cstr.to_bytes()).to_owned()) + } + }; + + events.push(InotifyEvent { + wd: WatchDescriptor { wd: event.wd }, + mask: AddWatchFlags::from_bits_truncate(event.mask), + cookie: event.cookie, + name + }); + + offset += header_size + event.len as usize; + } + + Ok(events) + } +} + +impl AsRawFd for Inotify { + fn as_raw_fd(&self) -> RawFd { + self.fd + } +} + +impl FromRawFd for Inotify { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + Inotify { fd } + } +} diff --git a/bash-5.1/vendor/nix/src/sys/ioctl/bsd.rs b/bash-5.1/vendor/nix/src/sys/ioctl/bsd.rs new file mode 100644 index 0000000000000000000000000000000000000000..307994cb969f9ba6ae3bfd12aa2e636f542b0c61 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/ioctl/bsd.rs @@ -0,0 +1,129 @@ +/// The datatype used for the ioctl number +#[doc(hidden)] +#[cfg(not(target_os = "illumos"))] +pub type ioctl_num_type = ::libc::c_ulong; + +#[doc(hidden)] +#[cfg(target_os = "illumos")] +pub type ioctl_num_type = ::libc::c_int; + +/// The datatype used for the 3rd argument +#[doc(hidden)] +pub type ioctl_param_type = ::libc::c_int; + +mod consts { + use crate::sys::ioctl::ioctl_num_type; + #[doc(hidden)] + pub const VOID: ioctl_num_type = 0x2000_0000; + #[doc(hidden)] + pub const OUT: ioctl_num_type = 0x4000_0000; + #[doc(hidden)] + #[allow(overflowing_literals)] + pub const IN: ioctl_num_type = 0x8000_0000; + #[doc(hidden)] + pub const INOUT: ioctl_num_type = IN | OUT; + #[doc(hidden)] + pub const IOCPARM_MASK: ioctl_num_type = 0x1fff; +} + +pub use self::consts::*; + +#[macro_export] +#[doc(hidden)] +macro_rules! ioc { + ($inout:expr, $group:expr, $num:expr, $len:expr) => { + $inout + | (($len as $crate::sys::ioctl::ioctl_num_type + & $crate::sys::ioctl::IOCPARM_MASK) + << 16) + | (($group as $crate::sys::ioctl::ioctl_num_type) << 8) + | ($num as $crate::sys::ioctl::ioctl_num_type) + }; +} + +/// Generate an ioctl request code for a command that passes no data. +/// +/// This is equivalent to the `_IO()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_none!()` directly. +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const KVMIO: u8 = 0xAE; +/// ioctl_write_int_bad!(kvm_create_vm, request_code_none!(KVMIO, 0x03)); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! request_code_none { + ($g:expr, $n:expr) => { + ioc!($crate::sys::ioctl::VOID, $g, $n, 0) + }; +} + +/// Generate an ioctl request code for a command that passes an integer +/// +/// This is equivalent to the `_IOWINT()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_write_int!()` directly. +#[macro_export(local_inner_macros)] +macro_rules! request_code_write_int { + ($g:expr, $n:expr) => { + ioc!( + $crate::sys::ioctl::VOID, + $g, + $n, + ::std::mem::size_of::<$crate::libc::c_int>() + ) + }; +} + +/// Generate an ioctl request code for a command that reads. +/// +/// This is equivalent to the `_IOR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_read!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is reading and the kernel is +/// writing. +#[macro_export(local_inner_macros)] +macro_rules! request_code_read { + ($g:expr, $n:expr, $len:expr) => { + ioc!($crate::sys::ioctl::OUT, $g, $n, $len) + }; +} + +/// Generate an ioctl request code for a command that writes. +/// +/// This is equivalent to the `_IOW()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_write!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is writing and the kernel is +/// reading. +#[macro_export(local_inner_macros)] +macro_rules! request_code_write { + ($g:expr, $n:expr, $len:expr) => { + ioc!($crate::sys::ioctl::IN, $g, $n, $len) + }; +} + +/// Generate an ioctl request code for a command that reads and writes. +/// +/// This is equivalent to the `_IOWR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_readwrite!()` directly. +#[macro_export(local_inner_macros)] +macro_rules! request_code_readwrite { + ($g:expr, $n:expr, $len:expr) => { + ioc!($crate::sys::ioctl::INOUT, $g, $n, $len) + }; +} diff --git a/bash-5.1/vendor/nix/src/sys/ioctl/linux.rs b/bash-5.1/vendor/nix/src/sys/ioctl/linux.rs new file mode 100644 index 0000000000000000000000000000000000000000..0c0a2090538f8356e00855e7b0784fe50354bc0b --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/ioctl/linux.rs @@ -0,0 +1,172 @@ +/// The datatype used for the ioctl number +#[cfg(any(target_os = "android", target_env = "musl"))] +#[doc(hidden)] +pub type ioctl_num_type = ::libc::c_int; +#[cfg(not(any(target_os = "android", target_env = "musl")))] +#[doc(hidden)] +pub type ioctl_num_type = ::libc::c_ulong; +/// The datatype used for the 3rd argument +#[doc(hidden)] +pub type ioctl_param_type = ::libc::c_ulong; + +#[doc(hidden)] +pub const NRBITS: ioctl_num_type = 8; +#[doc(hidden)] +pub const TYPEBITS: ioctl_num_type = 8; + +#[cfg(any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "sparc64" +))] +mod consts { + #[doc(hidden)] + pub const NONE: u8 = 1; + #[doc(hidden)] + pub const READ: u8 = 2; + #[doc(hidden)] + pub const WRITE: u8 = 4; + #[doc(hidden)] + pub const SIZEBITS: u8 = 13; + #[doc(hidden)] + pub const DIRBITS: u8 = 3; +} + +// "Generic" ioctl protocol +#[cfg(any( + target_arch = "x86", + target_arch = "arm", + target_arch = "s390x", + target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "riscv32", + target_arch = "riscv64" +))] +mod consts { + #[doc(hidden)] + pub const NONE: u8 = 0; + #[doc(hidden)] + pub const READ: u8 = 2; + #[doc(hidden)] + pub const WRITE: u8 = 1; + #[doc(hidden)] + pub const SIZEBITS: u8 = 14; + #[doc(hidden)] + pub const DIRBITS: u8 = 2; +} + +pub use self::consts::*; + +#[doc(hidden)] +pub const NRSHIFT: ioctl_num_type = 0; +#[doc(hidden)] +pub const TYPESHIFT: ioctl_num_type = NRSHIFT + NRBITS as ioctl_num_type; +#[doc(hidden)] +pub const SIZESHIFT: ioctl_num_type = TYPESHIFT + TYPEBITS as ioctl_num_type; +#[doc(hidden)] +pub const DIRSHIFT: ioctl_num_type = SIZESHIFT + SIZEBITS as ioctl_num_type; + +#[doc(hidden)] +pub const NRMASK: ioctl_num_type = (1 << NRBITS) - 1; +#[doc(hidden)] +pub const TYPEMASK: ioctl_num_type = (1 << TYPEBITS) - 1; +#[doc(hidden)] +pub const SIZEMASK: ioctl_num_type = (1 << SIZEBITS) - 1; +#[doc(hidden)] +pub const DIRMASK: ioctl_num_type = (1 << DIRBITS) - 1; + +/// Encode an ioctl command. +#[macro_export] +#[doc(hidden)] +macro_rules! ioc { + ($dir:expr, $ty:expr, $nr:expr, $sz:expr) => { + (($dir as $crate::sys::ioctl::ioctl_num_type + & $crate::sys::ioctl::DIRMASK) + << $crate::sys::ioctl::DIRSHIFT) + | (($ty as $crate::sys::ioctl::ioctl_num_type + & $crate::sys::ioctl::TYPEMASK) + << $crate::sys::ioctl::TYPESHIFT) + | (($nr as $crate::sys::ioctl::ioctl_num_type + & $crate::sys::ioctl::NRMASK) + << $crate::sys::ioctl::NRSHIFT) + | (($sz as $crate::sys::ioctl::ioctl_num_type + & $crate::sys::ioctl::SIZEMASK) + << $crate::sys::ioctl::SIZESHIFT) + }; +} + +/// Generate an ioctl request code for a command that passes no data. +/// +/// This is equivalent to the `_IO()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_none!()` directly. +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const KVMIO: u8 = 0xAE; +/// ioctl_write_int_bad!(kvm_create_vm, request_code_none!(KVMIO, 0x03)); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! request_code_none { + ($ty:expr, $nr:expr) => { + ioc!($crate::sys::ioctl::NONE, $ty, $nr, 0) + }; +} + +/// Generate an ioctl request code for a command that reads. +/// +/// This is equivalent to the `_IOR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_read!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is reading and the kernel is +/// writing. +#[macro_export(local_inner_macros)] +macro_rules! request_code_read { + ($ty:expr, $nr:expr, $sz:expr) => { + ioc!($crate::sys::ioctl::READ, $ty, $nr, $sz) + }; +} + +/// Generate an ioctl request code for a command that writes. +/// +/// This is equivalent to the `_IOW()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_write!()` directly. +/// +/// The read/write direction is relative to userland, so this +/// command would be userland is writing and the kernel is +/// reading. +#[macro_export(local_inner_macros)] +macro_rules! request_code_write { + ($ty:expr, $nr:expr, $sz:expr) => { + ioc!($crate::sys::ioctl::WRITE, $ty, $nr, $sz) + }; +} + +/// Generate an ioctl request code for a command that reads and writes. +/// +/// This is equivalent to the `_IOWR()` macro exposed by the C ioctl API. +/// +/// You should only use this macro directly if the `ioctl` you're working +/// with is "bad" and you cannot use `ioctl_readwrite!()` directly. +#[macro_export(local_inner_macros)] +macro_rules! request_code_readwrite { + ($ty:expr, $nr:expr, $sz:expr) => { + ioc!( + $crate::sys::ioctl::READ | $crate::sys::ioctl::WRITE, + $ty, + $nr, + $sz + ) + }; +} diff --git a/bash-5.1/vendor/nix/src/sys/ioctl/mod.rs b/bash-5.1/vendor/nix/src/sys/ioctl/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..98d6b5c99d481f21a835a99b2886ba9b797ea878 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/ioctl/mod.rs @@ -0,0 +1,786 @@ +//! Provide helpers for making ioctl system calls. +//! +//! This library is pretty low-level and messy. `ioctl` is not fun. +//! +//! What is an `ioctl`? +//! =================== +//! +//! The `ioctl` syscall is the grab-bag syscall on POSIX systems. Don't want to add a new +//! syscall? Make it an `ioctl`! `ioctl` refers to both the syscall, and the commands that can be +//! sent with it. `ioctl` stands for "IO control", and the commands are always sent to a file +//! descriptor. +//! +//! It is common to see `ioctl`s used for the following purposes: +//! +//! * Provide read/write access to out-of-band data related to a device such as configuration +//! (for instance, setting serial port options) +//! * Provide a mechanism for performing full-duplex data transfers (for instance, xfer on SPI +//! devices). +//! * Provide access to control functions on a device (for example, on Linux you can send +//! commands like pause, resume, and eject to the CDROM device. +//! * Do whatever else the device driver creator thought made most sense. +//! +//! `ioctl`s are synchronous system calls and are similar to read and write calls in that regard. +//! They operate on file descriptors and have an identifier that specifies what the ioctl is. +//! Additionally they may read or write data and therefore need to pass along a data pointer. +//! Besides the semantics of the ioctls being confusing, the generation of this identifer can also +//! be difficult. +//! +//! Historically `ioctl` numbers were arbitrary hard-coded values. In Linux (before 2.6) and some +//! unices this has changed to a more-ordered system where the ioctl numbers are partitioned into +//! subcomponents (For linux this is documented in +//! [`Documentation/ioctl/ioctl-number.rst`](https://elixir.bootlin.com/linux/latest/source/Documentation/userspace-api/ioctl/ioctl-number.rst)): +//! +//! * Number: The actual ioctl ID +//! * Type: A grouping of ioctls for a common purpose or driver +//! * Size: The size in bytes of the data that will be transferred +//! * Direction: Whether there is any data and if it's read, write, or both +//! +//! Newer drivers should not generate complete integer identifiers for their `ioctl`s instead +//! preferring to use the 4 components above to generate the final ioctl identifier. Because of +//! how old `ioctl`s are, however, there are many hard-coded `ioctl` identifiers. These are +//! commonly referred to as "bad" in `ioctl` documentation. +//! +//! Defining `ioctl`s +//! ================= +//! +//! This library provides several `ioctl_*!` macros for binding `ioctl`s. These generate public +//! unsafe functions that can then be used for calling the ioctl. This macro has a few different +//! ways it can be used depending on the specific ioctl you're working with. +//! +//! A simple `ioctl` is `SPI_IOC_RD_MODE`. This ioctl works with the SPI interface on Linux. This +//! specific `ioctl` reads the mode of the SPI device as a `u8`. It's declared in +//! `/include/uapi/linux/spi/spidev.h` as `_IOR(SPI_IOC_MAGIC, 1, __u8)`. Since it uses the `_IOR` +//! macro, we know it's a `read` ioctl and can use the `ioctl_read!` macro as follows: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +//! const SPI_IOC_TYPE_MODE: u8 = 1; +//! ioctl_read!(spi_read_mode, SPI_IOC_MAGIC, SPI_IOC_TYPE_MODE, u8); +//! # fn main() {} +//! ``` +//! +//! This generates the function: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # use std::mem; +//! # use nix::{libc, Result}; +//! # use nix::errno::Errno; +//! # use nix::libc::c_int as c_int; +//! # const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +//! # const SPI_IOC_TYPE_MODE: u8 = 1; +//! pub unsafe fn spi_read_mode(fd: c_int, data: *mut u8) -> Result { +//! let res = libc::ioctl(fd, request_code_read!(SPI_IOC_MAGIC, SPI_IOC_TYPE_MODE, mem::size_of::()), data); +//! Errno::result(res) +//! } +//! # fn main() {} +//! ``` +//! +//! The return value for the wrapper functions generated by the `ioctl_*!` macros are `nix::Error`s. +//! These are generated by assuming the return value of the ioctl is `-1` on error and everything +//! else is a valid return value. If this is not the case, `Result::map` can be used to map some +//! of the range of "good" values (-Inf..-2, 0..Inf) into a smaller range in a helper function. +//! +//! Writing `ioctl`s generally use pointers as their data source and these should use the +//! `ioctl_write_ptr!`. But in some cases an `int` is passed directly. For these `ioctl`s use the +//! `ioctl_write_int!` macro. This variant does not take a type as the last argument: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! const HCI_IOC_MAGIC: u8 = b'k'; +//! const HCI_IOC_HCIDEVUP: u8 = 1; +//! ioctl_write_int!(hci_dev_up, HCI_IOC_MAGIC, HCI_IOC_HCIDEVUP); +//! # fn main() {} +//! ``` +//! +//! Some `ioctl`s don't transfer any data, and those should use `ioctl_none!`. This macro +//! doesn't take a type and so it is declared similar to the `write_int` variant shown above. +//! +//! The mode for a given `ioctl` should be clear from the documentation if it has good +//! documentation. Otherwise it will be clear based on the macro used to generate the `ioctl` +//! number where `_IO`, `_IOR`, `_IOW`, and `_IOWR` map to "none", "read", "write_*", and "readwrite" +//! respectively. To determine the specific `write_` variant to use you'll need to find +//! what the argument type is supposed to be. If it's an `int`, then `write_int` should be used, +//! otherwise it should be a pointer and `write_ptr` should be used. On Linux the +//! [`ioctl_list` man page](https://man7.org/linux/man-pages/man2/ioctl_list.2.html) describes a +//! large number of `ioctl`s and describes their argument data type. +//! +//! Using "bad" `ioctl`s +//! -------------------- +//! +//! As mentioned earlier, there are many old `ioctl`s that do not use the newer method of +//! generating `ioctl` numbers and instead use hardcoded values. These can be used with the +//! `ioctl_*_bad!` macros. This naming comes from the Linux kernel which refers to these +//! `ioctl`s as "bad". These are a different variant as they bypass calling the macro that generates +//! the ioctl number and instead use the defined value directly. +//! +//! For example the `TCGETS` `ioctl` reads a `termios` data structure for a given file descriptor. +//! It's defined as `0x5401` in `ioctls.h` on Linux and can be implemented as: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # #[cfg(any(target_os = "android", target_os = "linux"))] +//! # use nix::libc::TCGETS as TCGETS; +//! # #[cfg(any(target_os = "android", target_os = "linux"))] +//! # use nix::libc::termios as termios; +//! # #[cfg(any(target_os = "android", target_os = "linux"))] +//! ioctl_read_bad!(tcgets, TCGETS, termios); +//! # fn main() {} +//! ``` +//! +//! The generated function has the same form as that generated by `ioctl_read!`: +//! +//! ```text +//! pub unsafe fn tcgets(fd: c_int, data: *mut termios) -> Result; +//! ``` +//! +//! Working with Arrays +//! ------------------- +//! +//! Some `ioctl`s work with entire arrays of elements. These are supported by the `ioctl_*_buf` +//! family of macros: `ioctl_read_buf`, `ioctl_write_buf`, and `ioctl_readwrite_buf`. Note that +//! there are no "bad" versions for working with buffers. The generated functions include a `len` +//! argument to specify the number of elements (where the type of each element is specified in the +//! macro). +//! +//! Again looking to the SPI `ioctl`s on Linux for an example, there is a `SPI_IOC_MESSAGE` `ioctl` +//! that queues up multiple SPI messages by writing an entire array of `spi_ioc_transfer` structs. +//! `linux/spi/spidev.h` defines a macro to calculate the `ioctl` number like: +//! +//! ```C +//! #define SPI_IOC_MAGIC 'k' +//! #define SPI_MSGSIZE(N) ... +//! #define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)]) +//! ``` +//! +//! The `SPI_MSGSIZE(N)` calculation is already handled by the `ioctl_*!` macros, so all that's +//! needed to define this `ioctl` is: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +//! const SPI_IOC_TYPE_MESSAGE: u8 = 0; +//! # pub struct spi_ioc_transfer(u64); +//! ioctl_write_buf!(spi_transfer, SPI_IOC_MAGIC, SPI_IOC_TYPE_MESSAGE, spi_ioc_transfer); +//! # fn main() {} +//! ``` +//! +//! This generates a function like: +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # use std::mem; +//! # use nix::{libc, Result}; +//! # use nix::errno::Errno; +//! # use nix::libc::c_int as c_int; +//! # const SPI_IOC_MAGIC: u8 = b'k'; +//! # const SPI_IOC_TYPE_MESSAGE: u8 = 0; +//! # pub struct spi_ioc_transfer(u64); +//! pub unsafe fn spi_message(fd: c_int, data: &mut [spi_ioc_transfer]) -> Result { +//! let res = libc::ioctl(fd, +//! request_code_write!(SPI_IOC_MAGIC, SPI_IOC_TYPE_MESSAGE, data.len() * mem::size_of::()), +//! data); +//! Errno::result(res) +//! } +//! # fn main() {} +//! ``` +//! +//! Finding `ioctl` Documentation +//! ----------------------------- +//! +//! For Linux, look at your system's headers. For example, `/usr/include/linux/input.h` has a lot +//! of lines defining macros which use `_IO`, `_IOR`, `_IOW`, `_IOC`, and `_IOWR`. Some `ioctl`s are +//! documented directly in the headers defining their constants, but others have more extensive +//! documentation in man pages (like termios' `ioctl`s which are in `tty_ioctl(4)`). +//! +//! Documenting the Generated Functions +//! =================================== +//! +//! In many cases, users will wish for the functions generated by the `ioctl` +//! macro to be public and documented. For this reason, the generated functions +//! are public by default. If you wish to hide the ioctl, you will need to put +//! them in a private module. +//! +//! For documentation, it is possible to use doc comments inside the `ioctl_*!` macros. Here is an +//! example : +//! +//! ``` +//! # #[macro_use] extern crate nix; +//! # use nix::libc::c_int; +//! ioctl_read! { +//! /// Make the given terminal the controlling terminal of the calling process. The calling +//! /// process must be a session leader and not have a controlling terminal already. If the +//! /// terminal is already the controlling terminal of a different session group then the +//! /// ioctl will fail with **EPERM**, unless the caller is root (more precisely: has the +//! /// **CAP_SYS_ADMIN** capability) and arg equals 1, in which case the terminal is stolen +//! /// and all processes that had it as controlling terminal lose it. +//! tiocsctty, b't', 19, c_int +//! } +//! +//! # fn main() {} +//! ``` +use cfg_if::cfg_if; + +#[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] +#[macro_use] +mod linux; + +#[cfg(any( + target_os = "android", + target_os = "linux", + target_os = "redox" +))] +pub use self::linux::*; + +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "haiku", + target_os = "openbsd" +))] +#[macro_use] +mod bsd; + +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "haiku", + target_os = "openbsd" +))] +pub use self::bsd::*; + +/// Convert raw ioctl return value to a Nix result +#[macro_export] +#[doc(hidden)] +macro_rules! convert_ioctl_res { + ($w:expr) => {{ + $crate::errno::Errno::result($w) + }}; +} + +/// Generates a wrapper function for an ioctl that passes no data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// The `videodev2` driver on Linux defines the `log_status` `ioctl` as: +/// +/// ```C +/// #define VIDIOC_LOG_STATUS _IO('V', 70) +/// ``` +/// +/// This can be implemented in Rust like: +/// +/// ```no_run +/// # #[macro_use] extern crate nix; +/// ioctl_none!(log_status, b'V', 70); +/// fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_none { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_none!($ioty, $nr) as $crate::sys::ioctl::ioctl_num_type)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that passes no data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ```no_run +/// # #[macro_use] extern crate nix; +/// # use libc::TIOCNXCL; +/// # use std::fs::File; +/// # use std::os::unix::io::AsRawFd; +/// ioctl_none_bad!(tiocnxcl, TIOCNXCL); +/// fn main() { +/// let file = File::open("/dev/ttyUSB0").unwrap(); +/// unsafe { tiocnxcl(file.as_raw_fd()) }.unwrap(); +/// } +/// ``` +// TODO: add an example using request_code_*!() +#[macro_export(local_inner_macros)] +macro_rules! ioctl_none_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads data from the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +/// const SPI_IOC_TYPE_MODE: u8 = 1; +/// ioctl_read!(spi_read_mode, SPI_IOC_MAGIC, SPI_IOC_TYPE_MODE, u8); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_read { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_read!($ioty, $nr, ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that reads data from the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # #[cfg(any(target_os = "android", target_os = "linux"))] +/// ioctl_read_bad!(tcgets, libc::TCGETS, libc::termios); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_read_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that writes data through a pointer to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *const DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # pub struct v4l2_audio {} +/// ioctl_write_ptr!(s_audio, b'V', 34, v4l2_audio); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_ptr { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *const $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write!($ioty, $nr, ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that writes data through a pointer to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *const DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # #[cfg(any(target_os = "android", target_os = "linux"))] +/// ioctl_write_ptr_bad!(tcsets, libc::TCSETS, libc::termios); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_ptr_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *const $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +cfg_if! { + if #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] { + /// Generates a wrapper function for a ioctl that writes an integer to the kernel. + /// + /// The arguments to this macro are: + /// + /// * The function name + /// * The ioctl identifier + /// * The ioctl sequence number + /// + /// The generated function has the following signature: + /// + /// ```rust,ignore + /// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: nix::sys::ioctl::ioctl_param_type) -> Result + /// ``` + /// + /// `nix::sys::ioctl::ioctl_param_type` depends on the OS: + /// * BSD - `libc::c_int` + /// * Linux - `libc::c_ulong` + /// + /// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). + /// + /// # Example + /// + /// ``` + /// # #[macro_use] extern crate nix; + /// ioctl_write_int!(vt_activate, b'v', 4); + /// # fn main() {} + /// ``` + #[macro_export(local_inner_macros)] + macro_rules! ioctl_write_int { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: $crate::sys::ioctl::ioctl_param_type) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write_int!($ioty, $nr) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) + } + } else { + /// Generates a wrapper function for a ioctl that writes an integer to the kernel. + /// + /// The arguments to this macro are: + /// + /// * The function name + /// * The ioctl identifier + /// * The ioctl sequence number + /// + /// The generated function has the following signature: + /// + /// ```rust,ignore + /// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: nix::sys::ioctl::ioctl_param_type) -> Result + /// ``` + /// + /// `nix::sys::ioctl::ioctl_param_type` depends on the OS: + /// * BSD - `libc::c_int` + /// * Linux - `libc::c_ulong` + /// + /// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). + /// + /// # Example + /// + /// ``` + /// # #[macro_use] extern crate nix; + /// const HCI_IOC_MAGIC: u8 = b'k'; + /// const HCI_IOC_HCIDEVUP: u8 = 1; + /// ioctl_write_int!(hci_dev_up, HCI_IOC_MAGIC, HCI_IOC_HCIDEVUP); + /// # fn main() {} + /// ``` + #[macro_export(local_inner_macros)] + macro_rules! ioctl_write_int { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: $crate::sys::ioctl::ioctl_param_type) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write!($ioty, $nr, ::std::mem::size_of::<$crate::libc::c_int>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) + } + } +} + +/// Generates a wrapper function for a "bad" ioctl that writes an integer to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: libc::c_int) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Examples +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # #[cfg(any(target_os = "android", target_os = "linux"))] +/// ioctl_write_int_bad!(tcsbrk, libc::TCSBRK); +/// # fn main() {} +/// ``` +/// +/// ```rust +/// # #[macro_use] extern crate nix; +/// const KVMIO: u8 = 0xAE; +/// ioctl_write_int_bad!(kvm_create_vm, request_code_none!(KVMIO, 0x03)); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_int_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: $crate::libc::c_int) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads and writes data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Example +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # pub struct v4l2_audio {} +/// ioctl_readwrite!(enum_audio, b'V', 65, v4l2_audio); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_readwrite { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_readwrite!($ioty, $nr, ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for a "bad" ioctl that reads and writes data to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl request code +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: *mut DATA_TYPE) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +// TODO: Find an example for ioctl_readwrite_bad +#[macro_export(local_inner_macros)] +macro_rules! ioctl_readwrite_bad { + ($(#[$attr:meta])* $name:ident, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: *mut $ty) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, $nr as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads an array of elements from the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: &mut [DATA_TYPE]) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +// TODO: Find an example for ioctl_read_buf +#[macro_export(local_inner_macros)] +macro_rules! ioctl_read_buf { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: &mut [$ty]) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_read!($ioty, $nr, data.len() * ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that writes an array of elements to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: &[DATA_TYPE]) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +/// +/// # Examples +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// const SPI_IOC_MAGIC: u8 = b'k'; // Defined in linux/spi/spidev.h +/// const SPI_IOC_TYPE_MESSAGE: u8 = 0; +/// # pub struct spi_ioc_transfer(u64); +/// ioctl_write_buf!(spi_transfer, SPI_IOC_MAGIC, SPI_IOC_TYPE_MESSAGE, spi_ioc_transfer); +/// # fn main() {} +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! ioctl_write_buf { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: &[$ty]) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_write!($ioty, $nr, data.len() * ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} + +/// Generates a wrapper function for an ioctl that reads and writes an array of elements to the kernel. +/// +/// The arguments to this macro are: +/// +/// * The function name +/// * The ioctl identifier +/// * The ioctl sequence number +/// * The data type passed by this ioctl +/// +/// The generated function has the following signature: +/// +/// ```rust,ignore +/// pub unsafe fn FUNCTION_NAME(fd: libc::c_int, data: &mut [DATA_TYPE]) -> Result +/// ``` +/// +/// For a more in-depth explanation of ioctls, see [`::sys::ioctl`](sys/ioctl/index.html). +// TODO: Find an example for readwrite_buf +#[macro_export(local_inner_macros)] +macro_rules! ioctl_readwrite_buf { + ($(#[$attr:meta])* $name:ident, $ioty:expr, $nr:expr, $ty:ty) => ( + $(#[$attr])* + pub unsafe fn $name(fd: $crate::libc::c_int, + data: &mut [$ty]) + -> $crate::Result<$crate::libc::c_int> { + convert_ioctl_res!($crate::libc::ioctl(fd, request_code_readwrite!($ioty, $nr, data.len() * ::std::mem::size_of::<$ty>()) as $crate::sys::ioctl::ioctl_num_type, data)) + } + ) +} diff --git a/bash-5.1/vendor/nix/src/sys/memfd.rs b/bash-5.1/vendor/nix/src/sys/memfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..642676b431d07fbae2588b6239f003ad3027f425 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/memfd.rs @@ -0,0 +1,47 @@ +//! Interfaces for managing memory-backed files. + +use std::os::unix::io::RawFd; +use crate::Result; +use crate::errno::Errno; +use std::ffi::CStr; + +libc_bitflags!( + /// Options that change the behavior of [`memfd_create`]. + pub struct MemFdCreateFlag: libc::c_uint { + /// Set the close-on-exec ([`FD_CLOEXEC`]) flag on the new file descriptor. + /// + /// By default, the new file descriptor is set to remain open across an [`execve`] + /// (the `FD_CLOEXEC` flag is initially disabled). This flag can be used to change + /// this default. The file offset is set to the beginning of the file (see [`lseek`]). + /// + /// See also the description of the `O_CLOEXEC` flag in [`open(2)`]. + /// + /// [`execve`]: crate::unistd::execve + /// [`lseek`]: crate::unistd::lseek + /// [`FD_CLOEXEC`]: crate::fcntl::FdFlag::FD_CLOEXEC + /// [`open(2)`]: https://man7.org/linux/man-pages/man2/open.2.html + MFD_CLOEXEC; + /// Allow sealing operations on this file. + /// + /// See also the file sealing notes given in [`memfd_create(2)`]. + /// + /// [`memfd_create(2)`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html + MFD_ALLOW_SEALING; + } +); + +/// Creates an anonymous file that lives in memory, and return a file-descriptor to it. +/// +/// The file behaves like a regular file, and so can be modified, truncated, memory-mapped, and so on. +/// However, unlike a regular file, it lives in RAM and has a volatile backing storage. +/// +/// For more information, see [`memfd_create(2)`]. +/// +/// [`memfd_create(2)`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html +pub fn memfd_create(name: &CStr, flags: MemFdCreateFlag) -> Result { + let res = unsafe { + libc::syscall(libc::SYS_memfd_create, name.as_ptr(), flags.bits()) + }; + + Errno::result(res).map(|r| r as RawFd) +} diff --git a/bash-5.1/vendor/nix/src/sys/mman.rs b/bash-5.1/vendor/nix/src/sys/mman.rs new file mode 100644 index 0000000000000000000000000000000000000000..700e231c620dae487c4c1fa4b7cb2b09aca341ed --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/mman.rs @@ -0,0 +1,569 @@ +//! Memory management declarations. + +use crate::Result; +#[cfg(not(target_os = "android"))] +use crate::NixPath; +use crate::errno::Errno; +#[cfg(not(target_os = "android"))] +#[cfg(feature = "fs")] +use crate::{fcntl::OFlag, sys::stat::Mode}; +use libc::{self, c_int, c_void, size_t, off_t}; +use std::os::unix::io::RawFd; + +libc_bitflags!{ + /// Desired memory protection of a memory mapping. + pub struct ProtFlags: c_int { + /// Pages cannot be accessed. + PROT_NONE; + /// Pages can be read. + PROT_READ; + /// Pages can be written. + PROT_WRITE; + /// Pages can be executed + PROT_EXEC; + /// Apply protection up to the end of a mapping that grows upwards. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PROT_GROWSDOWN; + /// Apply protection down to the beginning of a mapping that grows downwards. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PROT_GROWSUP; + } +} + +libc_bitflags!{ + /// Additional parameters for [`mmap`]. + pub struct MapFlags: c_int { + /// Compatibility flag. Ignored. + MAP_FILE; + /// Share this mapping. Mutually exclusive with `MAP_PRIVATE`. + MAP_SHARED; + /// Create a private copy-on-write mapping. Mutually exclusive with `MAP_SHARED`. + MAP_PRIVATE; + /// Place the mapping at exactly the address specified in `addr`. + MAP_FIXED; + /// Place the mapping at exactly the address specified in `addr`, but never clobber an existing range. + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_FIXED_NOREPLACE; + /// To be used with `MAP_FIXED`, to forbid the system + /// to select a different address than the one specified. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_EXCL; + /// Synonym for `MAP_ANONYMOUS`. + MAP_ANON; + /// The mapping is not backed by any file. + MAP_ANONYMOUS; + /// Put the mapping into the first 2GB of the process address space. + #[cfg(any(all(any(target_os = "android", target_os = "linux"), + any(target_arch = "x86", target_arch = "x86_64")), + all(target_os = "linux", target_env = "musl", any(target_arch = "x86", target_arch = "x86_64")), + all(target_os = "freebsd", target_pointer_width = "64")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_32BIT; + /// Used for stacks; indicates to the kernel that the mapping should extend downward in memory. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_GROWSDOWN; + /// Compatibility flag. Ignored. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_DENYWRITE; + /// Compatibility flag. Ignored. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_EXECUTABLE; + /// Mark the mmaped region to be locked in the same way as `mlock(2)`. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_LOCKED; + /// Do not reserve swap space for this mapping. + /// + /// This was removed in FreeBSD 11 and is unused in DragonFlyBSD. + #[cfg(not(any(target_os = "dragonfly", target_os = "freebsd")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_NORESERVE; + /// Populate page tables for a mapping. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_POPULATE; + /// Only meaningful when used with `MAP_POPULATE`. Don't perform read-ahead. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_NONBLOCK; + /// Allocate the mapping using "huge pages." + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGETLB; + /// Make use of 64KB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_64KB; + /// Make use of 512KB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_512KB; + /// Make use of 1MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_1MB; + /// Make use of 2MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_2MB; + /// Make use of 8MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_8MB; + /// Make use of 16MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_16MB; + /// Make use of 32MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_32MB; + /// Make use of 256MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_256MB; + /// Make use of 512MB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_512MB; + /// Make use of 1GB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_1GB; + /// Make use of 2GB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_2GB; + /// Make use of 16GB huge page (must be supported by the system) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HUGE_16GB; + + /// Lock the mapped region into memory as with `mlock(2)`. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_WIRED; + /// Causes dirtied data in the specified range to be flushed to disk only when necessary. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_NOSYNC; + /// Rename private pages to a file. + /// + /// This was removed in FreeBSD 11 and is unused in DragonFlyBSD. + #[cfg(any(target_os = "netbsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_RENAME; + /// Region may contain semaphores. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_HASSEMAPHORE; + /// Region grows down, like a stack. + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_STACK; + /// Pages in this mapping are not retained in the kernel's memory cache. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_NOCACHE; + /// Allows the W/X bit on the page, it's necessary on aarch64 architecture. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_JIT; + /// Allows to use large pages, underlying alignment based on size. + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_ALIGNED_SUPER; + /// Pages will be discarded in the core dumps. + #[cfg(target_os = "openbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_CONCEAL; + } +} + +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +libc_bitflags!{ + /// Options for [`mremap`]. + pub struct MRemapFlags: c_int { + /// Permit the kernel to relocate the mapping to a new virtual address, if necessary. + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MREMAP_MAYMOVE; + /// Place the mapping at exactly the address specified in `new_address`. + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MREMAP_FIXED; + /// Place the mapping at exactly the address specified in `new_address`. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_FIXED; + /// Allows to duplicate the mapping to be able to apply different flags on the copy. + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MAP_REMAPDUP; + } +} + +libc_enum!{ + /// Usage information for a range of memory to allow for performance optimizations by the kernel. + /// + /// Used by [`madvise`]. + #[repr(i32)] + #[non_exhaustive] + pub enum MmapAdvise { + /// No further special treatment. This is the default. + MADV_NORMAL, + /// Expect random page references. + MADV_RANDOM, + /// Expect sequential page references. + MADV_SEQUENTIAL, + /// Expect access in the near future. + MADV_WILLNEED, + /// Do not expect access in the near future. + MADV_DONTNEED, + /// Free up a given range of pages and its associated backing store. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_REMOVE, + /// Do not make pages in this range available to the child after a `fork(2)`. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_DONTFORK, + /// Undo the effect of `MADV_DONTFORK`. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_DOFORK, + /// Poison the given pages. + /// + /// Subsequent references to those pages are treated like hardware memory corruption. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_HWPOISON, + /// Enable Kernel Samepage Merging (KSM) for the given pages. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_MERGEABLE, + /// Undo the effect of `MADV_MERGEABLE` + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_UNMERGEABLE, + /// Preserve the memory of each page but offline the original page. + #[cfg(any(target_os = "android", + all(target_os = "linux", any( + target_arch = "aarch64", + target_arch = "arm", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "s390x", + target_arch = "x86", + target_arch = "x86_64", + target_arch = "sparc64"))))] + MADV_SOFT_OFFLINE, + /// Enable Transparent Huge Pages (THP) for pages in the given range. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_HUGEPAGE, + /// Undo the effect of `MADV_HUGEPAGE`. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_NOHUGEPAGE, + /// Exclude the given range from a core dump. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_DONTDUMP, + /// Undo the effect of an earlier `MADV_DONTDUMP`. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_DODUMP, + /// Specify that the application no longer needs the pages in the given range. + MADV_FREE, + /// Request that the system not flush the current range to disk unless it needs to. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_NOSYNC, + /// Undoes the effects of `MADV_NOSYNC` for any future pages dirtied within the given range. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_AUTOSYNC, + /// Region is not included in a core file. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_NOCORE, + /// Include region in a core file + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_CORE, + /// This process should not be killed when swap space is exhausted. + #[cfg(any(target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_PROTECT, + /// Invalidate the hardware page table for the given region. + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_INVAL, + /// Set the offset of the page directory page to `value` for the virtual page table. + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_SETMAP, + /// Indicates that the application will not need the data in the given range. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_ZERO_WIRED_PAGES, + /// Pages can be reused (by anyone). + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_FREE_REUSABLE, + /// Caller wants to reuse those pages. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MADV_FREE_REUSE, + // Darwin doesn't document this flag's behavior. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + #[allow(missing_docs)] + MADV_CAN_REUSE, + } +} + +libc_bitflags!{ + /// Configuration flags for [`msync`]. + pub struct MsFlags: c_int { + /// Schedule an update but return immediately. + MS_ASYNC; + /// Invalidate all cached data. + MS_INVALIDATE; + /// Invalidate pages, but leave them mapped. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MS_KILLPAGES; + /// Deactivate pages, but leave them mapped. + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MS_DEACTIVATE; + /// Perform an update and wait for it to complete. + MS_SYNC; + } +} + +#[cfg(not(target_os = "haiku"))] +libc_bitflags!{ + /// Flags for [`mlockall`]. + pub struct MlockAllFlags: c_int { + /// Lock pages that are currently mapped into the address space of the process. + MCL_CURRENT; + /// Lock pages which will become mapped into the address space of the process in the future. + MCL_FUTURE; + } +} + +/// Locks all memory pages that contain part of the address range with `length` +/// bytes starting at `addr`. +/// +/// Locked pages never move to the swap area. +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`mlock(2)`] man page. +/// +/// [`mlock(2)`]: https://man7.org/linux/man-pages/man2/mlock.2.html +pub unsafe fn mlock(addr: *const c_void, length: size_t) -> Result<()> { + Errno::result(libc::mlock(addr, length)).map(drop) +} + +/// Unlocks all memory pages that contain part of the address range with +/// `length` bytes starting at `addr`. +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`munlock(2)`] man +/// page. +/// +/// [`munlock(2)`]: https://man7.org/linux/man-pages/man2/munlock.2.html +pub unsafe fn munlock(addr: *const c_void, length: size_t) -> Result<()> { + Errno::result(libc::munlock(addr, length)).map(drop) +} + +/// Locks all memory pages mapped into this process' address space. +/// +/// Locked pages never move to the swap area. For more information, see [`mlockall(2)`]. +/// +/// [`mlockall(2)`]: https://man7.org/linux/man-pages/man2/mlockall.2.html +#[cfg(not(target_os = "haiku"))] +pub fn mlockall(flags: MlockAllFlags) -> Result<()> { + unsafe { Errno::result(libc::mlockall(flags.bits())) }.map(drop) +} + +/// Unlocks all memory pages mapped into this process' address space. +/// +/// For more information, see [`munlockall(2)`]. +/// +/// [`munlockall(2)`]: https://man7.org/linux/man-pages/man2/munlockall.2.html +#[cfg(not(target_os = "haiku"))] +pub fn munlockall() -> Result<()> { + unsafe { Errno::result(libc::munlockall()) }.map(drop) +} + +/// allocate memory, or map files or devices into memory +/// +/// # Safety +/// +/// See the [`mmap(2)`] man page for detailed requirements. +/// +/// [`mmap(2)`]: https://man7.org/linux/man-pages/man2/mmap.2.html +pub unsafe fn mmap(addr: *mut c_void, length: size_t, prot: ProtFlags, flags: MapFlags, fd: RawFd, offset: off_t) -> Result<*mut c_void> { + let ret = libc::mmap(addr, length, prot.bits(), flags.bits(), fd, offset); + + if ret == libc::MAP_FAILED { + Err(Errno::last()) + } else { + Ok(ret) + } +} + +/// Expands (or shrinks) an existing memory mapping, potentially moving it at +/// the same time. +/// +/// # Safety +/// +/// See the `mremap(2)` [man page](https://man7.org/linux/man-pages/man2/mremap.2.html) for +/// detailed requirements. +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +pub unsafe fn mremap( + addr: *mut c_void, + old_size: size_t, + new_size: size_t, + flags: MRemapFlags, + new_address: Option<* mut c_void>, +) -> Result<*mut c_void> { + #[cfg(target_os = "linux")] + let ret = libc::mremap(addr, old_size, new_size, flags.bits(), new_address.unwrap_or(std::ptr::null_mut())); + #[cfg(target_os = "netbsd")] + let ret = libc::mremap( + addr, + old_size, + new_address.unwrap_or(std::ptr::null_mut()), + new_size, + flags.bits(), + ); + + if ret == libc::MAP_FAILED { + Err(Errno::last()) + } else { + Ok(ret) + } +} + +/// remove a mapping +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`munmap(2)`] man +/// page. +/// +/// [`munmap(2)`]: https://man7.org/linux/man-pages/man2/munmap.2.html +pub unsafe fn munmap(addr: *mut c_void, len: size_t) -> Result<()> { + Errno::result(libc::munmap(addr, len)).map(drop) +} + +/// give advice about use of memory +/// +/// # Safety +/// +/// See the [`madvise(2)`] man page. Take special care when using +/// [`MmapAdvise::MADV_FREE`]. +/// +/// [`madvise(2)`]: https://man7.org/linux/man-pages/man2/madvise.2.html +pub unsafe fn madvise(addr: *mut c_void, length: size_t, advise: MmapAdvise) -> Result<()> { + Errno::result(libc::madvise(addr, length, advise as i32)).map(drop) +} + +/// Set protection of memory mapping. +/// +/// See [`mprotect(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mprotect.html) for +/// details. +/// +/// # Safety +/// +/// Calls to `mprotect` are inherently unsafe, as changes to memory protections can lead to +/// SIGSEGVs. +/// +/// ``` +/// # use nix::libc::size_t; +/// # use nix::sys::mman::{mmap, mprotect, MapFlags, ProtFlags}; +/// # use std::ptr; +/// const ONE_K: size_t = 1024; +/// let mut slice: &mut [u8] = unsafe { +/// let mem = mmap(ptr::null_mut(), ONE_K, ProtFlags::PROT_NONE, +/// MapFlags::MAP_ANON | MapFlags::MAP_PRIVATE, -1, 0).unwrap(); +/// mprotect(mem, ONE_K, ProtFlags::PROT_READ | ProtFlags::PROT_WRITE).unwrap(); +/// std::slice::from_raw_parts_mut(mem as *mut u8, ONE_K) +/// }; +/// assert_eq!(slice[0], 0x00); +/// slice[0] = 0xFF; +/// assert_eq!(slice[0], 0xFF); +/// ``` +pub unsafe fn mprotect(addr: *mut c_void, length: size_t, prot: ProtFlags) -> Result<()> { + Errno::result(libc::mprotect(addr, length, prot.bits())).map(drop) +} + +/// synchronize a mapped region +/// +/// # Safety +/// +/// `addr` must meet all the requirements described in the [`msync(2)`] man +/// page. +/// +/// [`msync(2)`]: https://man7.org/linux/man-pages/man2/msync.2.html +pub unsafe fn msync(addr: *mut c_void, length: size_t, flags: MsFlags) -> Result<()> { + Errno::result(libc::msync(addr, length, flags.bits())).map(drop) +} + +#[cfg(not(target_os = "android"))] +feature! { +#![feature = "fs"] +/// Creates and opens a new, or opens an existing, POSIX shared memory object. +/// +/// For more information, see [`shm_open(3)`]. +/// +/// [`shm_open(3)`]: https://man7.org/linux/man-pages/man3/shm_open.3.html +pub fn shm_open

( + name: &P, + flag: OFlag, + mode: Mode + ) -> Result + where P: ?Sized + NixPath +{ + let ret = name.with_nix_path(|cstr| { + #[cfg(any(target_os = "macos", target_os = "ios"))] + unsafe { + libc::shm_open(cstr.as_ptr(), flag.bits(), mode.bits() as libc::c_uint) + } + #[cfg(not(any(target_os = "macos", target_os = "ios")))] + unsafe { + libc::shm_open(cstr.as_ptr(), flag.bits(), mode.bits() as libc::mode_t) + } + })?; + + Errno::result(ret) +} +} + +/// Performs the converse of [`shm_open`], removing an object previously created. +/// +/// For more information, see [`shm_unlink(3)`]. +/// +/// [`shm_unlink(3)`]: https://man7.org/linux/man-pages/man3/shm_unlink.3.html +#[cfg(not(target_os = "android"))] +pub fn shm_unlink(name: &P) -> Result<()> { + let ret = name.with_nix_path(|cstr| { + unsafe { libc::shm_unlink(cstr.as_ptr()) } + })?; + + Errno::result(ret).map(drop) +} diff --git a/bash-5.1/vendor/nix/src/sys/mod.rs b/bash-5.1/vendor/nix/src/sys/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..979d623b8987bc6013cee976a0dfdd8977a7d710 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/mod.rs @@ -0,0 +1,228 @@ +//! Mostly platform-specific functionality +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + all(target_os = "linux", not(target_env = "uclibc")), + target_os = "macos", + target_os = "netbsd" +))] +feature! { + #![feature = "aio"] + pub mod aio; +} + +feature! { + #![feature = "event"] + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[allow(missing_docs)] + pub mod epoll; + + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[allow(missing_docs)] + pub mod event; + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[allow(missing_docs)] + pub mod eventfd; +} + +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd" +))] +#[cfg(feature = "ioctl")] +#[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] +#[macro_use] +pub mod ioctl; + +#[cfg(any(target_os = "android", target_os = "linux"))] +feature! { + #![feature = "fs"] + pub mod memfd; +} + +#[cfg(not(target_os = "redox"))] +feature! { + #![feature = "mman"] + pub mod mman; +} + +#[cfg(target_os = "linux")] +feature! { + #![feature = "personality"] + pub mod personality; +} + +feature! { + #![feature = "pthread"] + pub mod pthread; +} + +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd" +))] +feature! { + #![feature = "ptrace"] + #[allow(missing_docs)] + pub mod ptrace; +} + +#[cfg(target_os = "linux")] +feature! { + #![feature = "quota"] + pub mod quota; +} + +#[cfg(target_os = "linux")] +feature! { + #![feature = "reboot"] + pub mod reboot; +} + +#[cfg(not(any( + target_os = "redox", + target_os = "fuchsia", + target_os = "illumos", + target_os = "haiku" +)))] +feature! { + #![feature = "resource"] + pub mod resource; +} + +#[cfg(not(target_os = "redox"))] +feature! { + #![feature = "poll"] + pub mod select; +} + +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos" +))] +feature! { + #![feature = "zerocopy"] + pub mod sendfile; +} + +pub mod signal; + +#[cfg(any(target_os = "android", target_os = "linux"))] +feature! { + #![feature = "signal"] + #[allow(missing_docs)] + pub mod signalfd; +} + +#[cfg(not(target_os = "redox"))] +feature! { + #![feature = "socket"] + #[allow(missing_docs)] + pub mod socket; +} + +feature! { + #![feature = "fs"] + #[allow(missing_docs)] + pub mod stat; +} + +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "openbsd" +))] +feature! { + #![feature = "fs"] + pub mod statfs; +} + +feature! { + #![feature = "fs"] + pub mod statvfs; +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +#[allow(missing_docs)] +pub mod sysinfo; + +feature! { + #![feature = "term"] + #[allow(missing_docs)] + pub mod termios; +} + +#[allow(missing_docs)] +pub mod time; + +feature! { + #![feature = "uio"] + pub mod uio; +} + +feature! { + #![feature = "feature"] + pub mod utsname; +} + +feature! { + #![feature = "process"] + pub mod wait; +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +feature! { + #![feature = "inotify"] + pub mod inotify; +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +feature! { + #![feature = "time"] + pub mod timerfd; +} + +#[cfg(all( + any( + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd" + ), + feature = "time", + feature = "signal" +))] +feature! { + #![feature = "time"] + pub mod timer; +} diff --git a/bash-5.1/vendor/nix/src/sys/personality.rs b/bash-5.1/vendor/nix/src/sys/personality.rs new file mode 100644 index 0000000000000000000000000000000000000000..9e285ae6e0c3b2162f5e8acb020e93cd123079e8 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/personality.rs @@ -0,0 +1,97 @@ +//! Process execution domains +use crate::Result; +use crate::errno::Errno; + +use libc::{self, c_int, c_ulong}; + +libc_bitflags! { + /// Flags used and returned by [`get()`](fn.get.html) and + /// [`set()`](fn.set.html). + pub struct Persona: c_int { + /// Provide the legacy virtual address space layout. + ADDR_COMPAT_LAYOUT; + /// Disable address-space-layout randomization. + ADDR_NO_RANDOMIZE; + /// Limit the address space to 32 bits. + ADDR_LIMIT_32BIT; + /// Use `0xc0000000` as the offset at which to search a virtual memory + /// chunk on [`mmap(2)`], otherwise use `0xffffe000`. + /// + /// [`mmap(2)`]: https://man7.org/linux/man-pages/man2/mmap.2.html + ADDR_LIMIT_3GB; + /// User-space function pointers to signal handlers point to descriptors. + #[cfg(not(any(target_env = "musl", target_env = "uclibc")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + FDPIC_FUNCPTRS; + /// Map page 0 as read-only. + MMAP_PAGE_ZERO; + /// `PROT_READ` implies `PROT_EXEC` for [`mmap(2)`]. + /// + /// [`mmap(2)`]: https://man7.org/linux/man-pages/man2/mmap.2.html + READ_IMPLIES_EXEC; + /// No effects. + SHORT_INODE; + /// [`select(2)`], [`pselect(2)`], and [`ppoll(2)`] do not modify the + /// returned timeout argument when interrupted by a signal handler. + /// + /// [`select(2)`]: https://man7.org/linux/man-pages/man2/select.2.html + /// [`pselect(2)`]: https://man7.org/linux/man-pages/man2/pselect.2.html + /// [`ppoll(2)`]: https://man7.org/linux/man-pages/man2/ppoll.2.html + STICKY_TIMEOUTS; + /// Have [`uname(2)`] report a 2.6.40+ version number rather than a 3.x + /// version number. + /// + /// [`uname(2)`]: https://man7.org/linux/man-pages/man2/uname.2.html + #[cfg(not(any(target_env = "musl", target_env = "uclibc")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + UNAME26; + /// No effects. + WHOLE_SECONDS; + } +} + +/// Retrieve the current process personality. +/// +/// Returns a Result containing a Persona instance. +/// +/// Example: +/// +/// ``` +/// # use nix::sys::personality::{self, Persona}; +/// let pers = personality::get().unwrap(); +/// assert!(!pers.contains(Persona::WHOLE_SECONDS)); +/// ``` +pub fn get() -> Result { + let res = unsafe { + libc::personality(0xFFFFFFFF) + }; + + Errno::result(res).map(Persona::from_bits_truncate) +} + +/// Set the current process personality. +/// +/// Returns a Result containing the *previous* personality for the +/// process, as a Persona. +/// +/// For more information, see [personality(2)](https://man7.org/linux/man-pages/man2/personality.2.html) +/// +/// **NOTE**: This call **replaces** the current personality entirely. +/// To **update** the personality, first call `get()` and then `set()` +/// with the modified persona. +/// +/// Example: +/// +/// ``` +/// # use nix::sys::personality::{self, Persona}; +/// let mut pers = personality::get().unwrap(); +/// assert!(!pers.contains(Persona::ADDR_NO_RANDOMIZE)); +/// personality::set(pers | Persona::ADDR_NO_RANDOMIZE).unwrap(); +/// ``` +pub fn set(persona: Persona) -> Result { + let res = unsafe { + libc::personality(persona.bits() as c_ulong) + }; + + Errno::result(res).map(Persona::from_bits_truncate) +} diff --git a/bash-5.1/vendor/nix/src/sys/pthread.rs b/bash-5.1/vendor/nix/src/sys/pthread.rs new file mode 100644 index 0000000000000000000000000000000000000000..fd81f3ed383f0c1a5cdaf35ca42ba72c3956ed3f --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/pthread.rs @@ -0,0 +1,42 @@ +//! Low level threading primitives + +#[cfg(not(target_os = "redox"))] +use crate::errno::Errno; +#[cfg(not(target_os = "redox"))] +use crate::Result; +use libc::{self, pthread_t}; + +/// Identifies an individual thread. +pub type Pthread = pthread_t; + +/// Obtain ID of the calling thread (see +/// [`pthread_self(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_self.html) +/// +/// The thread ID returned by `pthread_self()` is not the same thing as +/// the kernel thread ID returned by a call to `gettid(2)`. +#[inline] +pub fn pthread_self() -> Pthread { + unsafe { libc::pthread_self() } +} + +feature! { +#![feature = "signal"] + +/// Send a signal to a thread (see [`pthread_kill(3)`]). +/// +/// If `signal` is `None`, `pthread_kill` will only preform error checking and +/// won't send any signal. +/// +/// [`pthread_kill(3)`]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_kill.html +#[cfg(not(target_os = "redox"))] +pub fn pthread_kill(thread: Pthread, signal: T) -> Result<()> + where T: Into> +{ + let sig = match signal.into() { + Some(s) => s as libc::c_int, + None => 0, + }; + let res = unsafe { libc::pthread_kill(thread, sig) }; + Errno::result(res).map(drop) +} +} diff --git a/bash-5.1/vendor/nix/src/sys/ptrace/bsd.rs b/bash-5.1/vendor/nix/src/sys/ptrace/bsd.rs new file mode 100644 index 0000000000000000000000000000000000000000..c4cc74039606762960d3698701c2de493b7d12ac --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/ptrace/bsd.rs @@ -0,0 +1,187 @@ +use cfg_if::cfg_if; +use crate::errno::Errno; +use libc::{self, c_int}; +use std::ptr; +use crate::sys::signal::Signal; +use crate::unistd::Pid; +use crate::Result; + +pub type RequestType = c_int; + +cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "openbsd"))] { + #[doc(hidden)] + pub type AddressType = *mut ::libc::c_char; + } else { + #[doc(hidden)] + pub type AddressType = *mut ::libc::c_void; + } +} + +libc_enum! { + #[repr(i32)] + /// Ptrace Request enum defining the action to be taken. + #[non_exhaustive] + pub enum Request { + PT_TRACE_ME, + PT_READ_I, + PT_READ_D, + #[cfg(target_os = "macos")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PT_READ_U, + PT_WRITE_I, + PT_WRITE_D, + #[cfg(target_os = "macos")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PT_WRITE_U, + PT_CONTINUE, + PT_KILL, + #[cfg(any(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos"), + all(target_os = "openbsd", target_arch = "x86_64"), + all(target_os = "netbsd", any(target_arch = "x86_64", + target_arch = "powerpc"))))] + PT_STEP, + PT_ATTACH, + PT_DETACH, + #[cfg(target_os = "macos")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PT_SIGEXC, + #[cfg(target_os = "macos")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PT_THUPDATE, + #[cfg(target_os = "macos")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PT_ATTACHEXC + } +} + +unsafe fn ptrace_other( + request: Request, + pid: Pid, + addr: AddressType, + data: c_int, +) -> Result { + Errno::result(libc::ptrace( + request as RequestType, + libc::pid_t::from(pid), + addr, + data, + )).map(|_| 0) +} + +/// Sets the process as traceable, as with `ptrace(PT_TRACEME, ...)` +/// +/// Indicates that this process is to be traced by its parent. +/// This is the only ptrace request to be issued by the tracee. +pub fn traceme() -> Result<()> { + unsafe { ptrace_other(Request::PT_TRACE_ME, Pid::from_raw(0), ptr::null_mut(), 0).map(drop) } +} + +/// Attach to a running process, as with `ptrace(PT_ATTACH, ...)` +/// +/// Attaches to the process specified by `pid`, making it a tracee of the calling process. +pub fn attach(pid: Pid) -> Result<()> { + unsafe { ptrace_other(Request::PT_ATTACH, pid, ptr::null_mut(), 0).map(drop) } +} + +/// Detaches the current running process, as with `ptrace(PT_DETACH, ...)` +/// +/// Detaches from the process specified by `pid` allowing it to run freely, optionally delivering a +/// signal specified by `sig`. +pub fn detach>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as c_int, + None => 0, + }; + unsafe { + ptrace_other(Request::PT_DETACH, pid, ptr::null_mut(), data).map(drop) + } +} + +/// Restart the stopped tracee process, as with `ptrace(PTRACE_CONT, ...)` +/// +/// Continues the execution of the process with PID `pid`, optionally +/// delivering a signal specified by `sig`. +pub fn cont>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as c_int, + None => 0, + }; + unsafe { + // Ignore the useless return value + ptrace_other(Request::PT_CONTINUE, pid, 1 as AddressType, data).map(drop) + } +} + +/// Issues a kill request as with `ptrace(PT_KILL, ...)` +/// +/// This request is equivalent to `ptrace(PT_CONTINUE, ..., SIGKILL);` +pub fn kill(pid: Pid) -> Result<()> { + unsafe { + ptrace_other(Request::PT_KILL, pid, 0 as AddressType, 0).map(drop) + } +} + +/// Move the stopped tracee process forward by a single step as with +/// `ptrace(PT_STEP, ...)` +/// +/// Advances the execution of the process with PID `pid` by a single step optionally delivering a +/// signal specified by `sig`. +/// +/// # Example +/// ```rust +/// use nix::sys::ptrace::step; +/// use nix::unistd::Pid; +/// use nix::sys::signal::Signal; +/// use nix::sys::wait::*; +/// // If a process changes state to the stopped state because of a SIGUSR1 +/// // signal, this will step the process forward and forward the user +/// // signal to the stopped process +/// match waitpid(Pid::from_raw(-1), None) { +/// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => { +/// let _ = step(pid, Signal::SIGUSR1); +/// } +/// _ => {}, +/// } +/// ``` +#[cfg( + any( + any(target_os = "dragonfly", target_os = "freebsd", target_os = "macos"), + all(target_os = "openbsd", target_arch = "x86_64"), + all(target_os = "netbsd", + any(target_arch = "x86_64", target_arch = "powerpc") + ) + ) +)] +pub fn step>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as c_int, + None => 0, + }; + unsafe { ptrace_other(Request::PT_STEP, pid, ptr::null_mut(), data).map(drop) } +} + +/// Reads a word from a processes memory at the given address +// Technically, ptrace doesn't dereference the pointer. It passes it directly +// to the kernel. +#[allow(clippy::not_unsafe_ptr_arg_deref)] +pub fn read(pid: Pid, addr: AddressType) -> Result { + unsafe { + // Traditionally there was a difference between reading data or + // instruction memory but not in modern systems. + ptrace_other(Request::PT_READ_D, pid, addr, 0) + } +} + +/// Writes a word into the processes memory at the given address +// Technically, ptrace doesn't dereference the pointer. It passes it directly +// to the kernel. +#[allow(clippy::not_unsafe_ptr_arg_deref)] +pub fn write(pid: Pid, addr: AddressType, data: c_int) -> Result<()> { + unsafe { ptrace_other(Request::PT_WRITE_D, pid, addr, data).map(drop) } +} diff --git a/bash-5.1/vendor/nix/src/sys/ptrace/linux.rs b/bash-5.1/vendor/nix/src/sys/ptrace/linux.rs new file mode 100644 index 0000000000000000000000000000000000000000..1d9b241c1f870b6e4342036250a87874a7d31735 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/ptrace/linux.rs @@ -0,0 +1,504 @@ +//! For detailed description of the ptrace requests, consult `man ptrace`. + +use cfg_if::cfg_if; +use std::{mem, ptr}; +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_void, c_long, siginfo_t}; +use crate::unistd::Pid; +use crate::sys::signal::Signal; + +pub type AddressType = *mut ::libc::c_void; + +#[cfg(all( + target_os = "linux", + any(all(target_arch = "x86_64", + any(target_env = "gnu", target_env = "musl")), + all(target_arch = "x86", target_env = "gnu")) +))] +use libc::user_regs_struct; + +cfg_if! { + if #[cfg(any(all(target_os = "linux", target_arch = "s390x"), + all(target_os = "linux", target_env = "gnu"), + target_env = "uclibc"))] { + #[doc(hidden)] + pub type RequestType = ::libc::c_uint; + } else { + #[doc(hidden)] + pub type RequestType = ::libc::c_int; + } +} + +libc_enum!{ + #[cfg_attr(not(any(target_env = "musl", target_env = "uclibc", target_os = "android")), repr(u32))] + #[cfg_attr(any(target_env = "musl", target_env = "uclibc", target_os = "android"), repr(i32))] + /// Ptrace Request enum defining the action to be taken. + #[non_exhaustive] + pub enum Request { + PTRACE_TRACEME, + PTRACE_PEEKTEXT, + PTRACE_PEEKDATA, + PTRACE_PEEKUSER, + PTRACE_POKETEXT, + PTRACE_POKEDATA, + PTRACE_POKEUSER, + PTRACE_CONT, + PTRACE_KILL, + PTRACE_SINGLESTEP, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_GETREGS, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_SETREGS, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_GETFPREGS, + #[cfg(any(all(target_os = "android", target_pointer_width = "32"), + all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86_64", + target_pointer_width = "32"))))] + PTRACE_SETFPREGS, + PTRACE_ATTACH, + PTRACE_DETACH, + #[cfg(all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86", + target_arch = "x86_64")))] + PTRACE_GETFPXREGS, + #[cfg(all(target_os = "linux", any(target_env = "musl", + target_arch = "mips", + target_arch = "mips64", + target_arch = "x86", + target_arch = "x86_64")))] + PTRACE_SETFPXREGS, + PTRACE_SYSCALL, + PTRACE_SETOPTIONS, + PTRACE_GETEVENTMSG, + PTRACE_GETSIGINFO, + PTRACE_SETSIGINFO, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_GETREGSET, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_SETREGSET, + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTRACE_SEIZE, + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTRACE_INTERRUPT, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_LISTEN, + #[cfg(all(target_os = "linux", not(any(target_arch = "mips", + target_arch = "mips64"))))] + PTRACE_PEEKSIGINFO, + #[cfg(all(target_os = "linux", target_env = "gnu", + any(target_arch = "x86", target_arch = "x86_64")))] + PTRACE_SYSEMU, + #[cfg(all(target_os = "linux", target_env = "gnu", + any(target_arch = "x86", target_arch = "x86_64")))] + PTRACE_SYSEMU_SINGLESTEP, + } +} + +libc_enum!{ + #[repr(i32)] + /// Using the ptrace options the tracer can configure the tracee to stop + /// at certain events. This enum is used to define those events as defined + /// in `man ptrace`. + #[non_exhaustive] + pub enum Event { + /// Event that stops before a return from fork or clone. + PTRACE_EVENT_FORK, + /// Event that stops before a return from vfork or clone. + PTRACE_EVENT_VFORK, + /// Event that stops before a return from clone. + PTRACE_EVENT_CLONE, + /// Event that stops before a return from execve. + PTRACE_EVENT_EXEC, + /// Event for a return from vfork. + PTRACE_EVENT_VFORK_DONE, + /// Event for a stop before an exit. Unlike the waitpid Exit status program. + /// registers can still be examined + PTRACE_EVENT_EXIT, + /// Stop triggered by a seccomp rule on a tracee. + PTRACE_EVENT_SECCOMP, + /// Stop triggered by the `INTERRUPT` syscall, or a group stop, + /// or when a new child is attached. + PTRACE_EVENT_STOP, + } +} + +libc_bitflags! { + /// Ptrace options used in conjunction with the PTRACE_SETOPTIONS request. + /// See `man ptrace` for more details. + pub struct Options: libc::c_int { + /// When delivering system call traps set a bit to allow tracer to + /// distinguish between normal stops or syscall stops. May not work on + /// all systems. + PTRACE_O_TRACESYSGOOD; + /// Stop tracee at next fork and start tracing the forked process. + PTRACE_O_TRACEFORK; + /// Stop tracee at next vfork call and trace the vforked process. + PTRACE_O_TRACEVFORK; + /// Stop tracee at next clone call and trace the cloned process. + PTRACE_O_TRACECLONE; + /// Stop tracee at next execve call. + PTRACE_O_TRACEEXEC; + /// Stop tracee at vfork completion. + PTRACE_O_TRACEVFORKDONE; + /// Stop tracee at next exit call. Stops before exit commences allowing + /// tracer to see location of exit and register states. + PTRACE_O_TRACEEXIT; + /// Stop tracee when a SECCOMP_RET_TRACE rule is triggered. See `man seccomp` for more + /// details. + PTRACE_O_TRACESECCOMP; + /// Send a SIGKILL to the tracee if the tracer exits. This is useful + /// for ptrace jailers to prevent tracees from escaping their control. + PTRACE_O_EXITKILL; + } +} + +fn ptrace_peek(request: Request, pid: Pid, addr: AddressType, data: *mut c_void) -> Result { + let ret = unsafe { + Errno::clear(); + libc::ptrace(request as RequestType, libc::pid_t::from(pid), addr, data) + }; + match Errno::result(ret) { + Ok(..) | Err(Errno::UnknownErrno) => Ok(ret), + err @ Err(..) => err, + } +} + +/// Get user registers, as with `ptrace(PTRACE_GETREGS, ...)` +#[cfg(all( + target_os = "linux", + any(all(target_arch = "x86_64", + any(target_env = "gnu", target_env = "musl")), + all(target_arch = "x86", target_env = "gnu")) +))] +pub fn getregs(pid: Pid) -> Result { + ptrace_get_data::(Request::PTRACE_GETREGS, pid) +} + +/// Set user registers, as with `ptrace(PTRACE_SETREGS, ...)` +#[cfg(all( + target_os = "linux", + any(all(target_arch = "x86_64", + any(target_env = "gnu", target_env = "musl")), + all(target_arch = "x86", target_env = "gnu")) +))] +pub fn setregs(pid: Pid, regs: user_regs_struct) -> Result<()> { + let res = unsafe { + libc::ptrace(Request::PTRACE_SETREGS as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + ®s as *const _ as *const c_void) + }; + Errno::result(res).map(drop) +} + +/// Function for ptrace requests that return values from the data field. +/// Some ptrace get requests populate structs or larger elements than `c_long` +/// and therefore use the data field to return values. This function handles these +/// requests. +fn ptrace_get_data(request: Request, pid: Pid) -> Result { + let mut data = mem::MaybeUninit::uninit(); + let res = unsafe { + libc::ptrace(request as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + data.as_mut_ptr() as *const _ as *const c_void) + }; + Errno::result(res)?; + Ok(unsafe{ data.assume_init() }) +} + +unsafe fn ptrace_other(request: Request, pid: Pid, addr: AddressType, data: *mut c_void) -> Result { + Errno::result(libc::ptrace(request as RequestType, libc::pid_t::from(pid), addr, data)).map(|_| 0) +} + +/// Set options, as with `ptrace(PTRACE_SETOPTIONS,...)`. +pub fn setoptions(pid: Pid, options: Options) -> Result<()> { + let res = unsafe { + libc::ptrace(Request::PTRACE_SETOPTIONS as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + options.bits() as *mut c_void) + }; + Errno::result(res).map(drop) +} + +/// Gets a ptrace event as described by `ptrace(PTRACE_GETEVENTMSG,...)` +pub fn getevent(pid: Pid) -> Result { + ptrace_get_data::(Request::PTRACE_GETEVENTMSG, pid) +} + +/// Get siginfo as with `ptrace(PTRACE_GETSIGINFO,...)` +pub fn getsiginfo(pid: Pid) -> Result { + ptrace_get_data::(Request::PTRACE_GETSIGINFO, pid) +} + +/// Set siginfo as with `ptrace(PTRACE_SETSIGINFO,...)` +pub fn setsiginfo(pid: Pid, sig: &siginfo_t) -> Result<()> { + let ret = unsafe{ + Errno::clear(); + libc::ptrace(Request::PTRACE_SETSIGINFO as RequestType, + libc::pid_t::from(pid), + ptr::null_mut::(), + sig as *const _ as *const c_void) + }; + match Errno::result(ret) { + Ok(_) => Ok(()), + Err(e) => Err(e), + } +} + +/// Sets the process as traceable, as with `ptrace(PTRACE_TRACEME, ...)` +/// +/// Indicates that this process is to be traced by its parent. +/// This is the only ptrace request to be issued by the tracee. +pub fn traceme() -> Result<()> { + unsafe { + ptrace_other( + Request::PTRACE_TRACEME, + Pid::from_raw(0), + ptr::null_mut(), + ptr::null_mut(), + ).map(drop) // ignore the useless return value + } +} + +/// Continue execution until the next syscall, as with `ptrace(PTRACE_SYSCALL, ...)` +/// +/// Arranges for the tracee to be stopped at the next entry to or exit from a system call, +/// optionally delivering a signal specified by `sig`. +pub fn syscall>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other( + Request::PTRACE_SYSCALL, + pid, + ptr::null_mut(), + data, + ).map(drop) // ignore the useless return value + } +} + +/// Continue execution until the next syscall, as with `ptrace(PTRACE_SYSEMU, ...)` +/// +/// In contrast to the `syscall` function, the syscall stopped at will not be executed. +/// Thus the the tracee will only be stopped once per syscall, +/// optionally delivering a signal specified by `sig`. +#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))] +pub fn sysemu>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other(Request::PTRACE_SYSEMU, pid, ptr::null_mut(), data).map(drop) + // ignore the useless return value + } +} + +/// Attach to a running process, as with `ptrace(PTRACE_ATTACH, ...)` +/// +/// Attaches to the process specified by `pid`, making it a tracee of the calling process. +pub fn attach(pid: Pid) -> Result<()> { + unsafe { + ptrace_other( + Request::PTRACE_ATTACH, + pid, + ptr::null_mut(), + ptr::null_mut(), + ).map(drop) // ignore the useless return value + } +} + +/// Attach to a running process, as with `ptrace(PTRACE_SEIZE, ...)` +/// +/// Attaches to the process specified in pid, making it a tracee of the calling process. +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn seize(pid: Pid, options: Options) -> Result<()> { + unsafe { + ptrace_other( + Request::PTRACE_SEIZE, + pid, + ptr::null_mut(), + options.bits() as *mut c_void, + ).map(drop) // ignore the useless return value + } +} + +/// Detaches the current running process, as with `ptrace(PTRACE_DETACH, ...)` +/// +/// Detaches from the process specified by `pid` allowing it to run freely, optionally delivering a +/// signal specified by `sig`. +pub fn detach>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other( + Request::PTRACE_DETACH, + pid, + ptr::null_mut(), + data + ).map(drop) + } +} + +/// Restart the stopped tracee process, as with `ptrace(PTRACE_CONT, ...)` +/// +/// Continues the execution of the process with PID `pid`, optionally +/// delivering a signal specified by `sig`. +pub fn cont>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other(Request::PTRACE_CONT, pid, ptr::null_mut(), data).map(drop) // ignore the useless return value + } +} + +/// Stop a tracee, as with `ptrace(PTRACE_INTERRUPT, ...)` +/// +/// This request is equivalent to `ptrace(PTRACE_INTERRUPT, ...)` +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn interrupt(pid: Pid) -> Result<()> { + unsafe { + ptrace_other(Request::PTRACE_INTERRUPT, pid, ptr::null_mut(), ptr::null_mut()).map(drop) + } +} + +/// Issues a kill request as with `ptrace(PTRACE_KILL, ...)` +/// +/// This request is equivalent to `ptrace(PTRACE_CONT, ..., SIGKILL);` +pub fn kill(pid: Pid) -> Result<()> { + unsafe { + ptrace_other(Request::PTRACE_KILL, pid, ptr::null_mut(), ptr::null_mut()).map(drop) + } +} + +/// Move the stopped tracee process forward by a single step as with +/// `ptrace(PTRACE_SINGLESTEP, ...)` +/// +/// Advances the execution of the process with PID `pid` by a single step optionally delivering a +/// signal specified by `sig`. +/// +/// # Example +/// ```rust +/// use nix::sys::ptrace::step; +/// use nix::unistd::Pid; +/// use nix::sys::signal::Signal; +/// use nix::sys::wait::*; +/// +/// // If a process changes state to the stopped state because of a SIGUSR1 +/// // signal, this will step the process forward and forward the user +/// // signal to the stopped process +/// match waitpid(Pid::from_raw(-1), None) { +/// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => { +/// let _ = step(pid, Signal::SIGUSR1); +/// } +/// _ => {}, +/// } +/// ``` +pub fn step>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other(Request::PTRACE_SINGLESTEP, pid, ptr::null_mut(), data).map(drop) + } +} + +/// Move the stopped tracee process forward by a single step or stop at the next syscall +/// as with `ptrace(PTRACE_SYSEMU_SINGLESTEP, ...)` +/// +/// Advances the execution by a single step or until the next syscall. +/// In case the tracee is stopped at a syscall, the syscall will not be executed. +/// Optionally, the signal specified by `sig` is delivered to the tracee upon continuation. +#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))] +pub fn sysemu_step>>(pid: Pid, sig: T) -> Result<()> { + let data = match sig.into() { + Some(s) => s as i32 as *mut c_void, + None => ptr::null_mut(), + }; + unsafe { + ptrace_other( + Request::PTRACE_SYSEMU_SINGLESTEP, + pid, + ptr::null_mut(), + data, + ) + .map(drop) // ignore the useless return value + } +} + +/// Reads a word from a processes memory at the given address +pub fn read(pid: Pid, addr: AddressType) -> Result { + ptrace_peek(Request::PTRACE_PEEKDATA, pid, addr, ptr::null_mut()) +} + +/// Writes a word into the processes memory at the given address +/// +/// # Safety +/// +/// The `data` argument is passed directly to `ptrace(2)`. Read that man page +/// for guidance. +pub unsafe fn write( + pid: Pid, + addr: AddressType, + data: *mut c_void) -> Result<()> +{ + ptrace_other(Request::PTRACE_POKEDATA, pid, addr, data).map(drop) +} + +/// Reads a word from a user area at `offset`. +/// The user struct definition can be found in `/usr/include/sys/user.h`. +pub fn read_user(pid: Pid, offset: AddressType) -> Result { + ptrace_peek(Request::PTRACE_PEEKUSER, pid, offset, ptr::null_mut()) +} + +/// Writes a word to a user area at `offset`. +/// The user struct definition can be found in `/usr/include/sys/user.h`. +/// +/// # Safety +/// +/// The `data` argument is passed directly to `ptrace(2)`. Read that man page +/// for guidance. +pub unsafe fn write_user( + pid: Pid, + offset: AddressType, + data: *mut c_void) -> Result<()> +{ + ptrace_other(Request::PTRACE_POKEUSER, pid, offset, data).map(drop) +} diff --git a/bash-5.1/vendor/nix/src/sys/ptrace/mod.rs b/bash-5.1/vendor/nix/src/sys/ptrace/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..782c30409bc12e9e930793924c41c3ad6137513b --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/ptrace/mod.rs @@ -0,0 +1,22 @@ +///! Provides helpers for making ptrace system calls + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod linux; + +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::linux::*; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +mod bsd; + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd" + ))] +pub use self::bsd::*; diff --git a/bash-5.1/vendor/nix/src/sys/quota.rs b/bash-5.1/vendor/nix/src/sys/quota.rs new file mode 100644 index 0000000000000000000000000000000000000000..f3b4c02dee965dd8186805d2e531b7da64d65619 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/quota.rs @@ -0,0 +1,277 @@ +//! Set and configure disk quotas for users, groups, or projects. +//! +//! # Examples +//! +//! Enabling and setting a quota: +//! +//! ```rust,no_run +//! # use nix::sys::quota::{Dqblk, quotactl_on, quotactl_set, QuotaFmt, QuotaType, QuotaValidFlags}; +//! quotactl_on(QuotaType::USRQUOTA, "/dev/sda1", QuotaFmt::QFMT_VFS_V1, "aquota.user").unwrap(); +//! let mut dqblk: Dqblk = Default::default(); +//! dqblk.set_blocks_hard_limit(10000); +//! dqblk.set_blocks_soft_limit(8000); +//! quotactl_set(QuotaType::USRQUOTA, "/dev/sda1", 50, &dqblk, QuotaValidFlags::QIF_BLIMITS).unwrap(); +//! ``` +use std::default::Default; +use std::{mem, ptr}; +use libc::{self, c_int, c_char}; +use crate::{Result, NixPath}; +use crate::errno::Errno; + +struct QuotaCmd(QuotaSubCmd, QuotaType); + +impl QuotaCmd { + #[allow(unused_unsafe)] + fn as_int(&self) -> c_int { + unsafe { libc::QCMD(self.0 as i32, self.1 as i32) } + } +} + +// linux quota version >= 2 +libc_enum!{ + #[repr(i32)] + enum QuotaSubCmd { + Q_SYNC, + Q_QUOTAON, + Q_QUOTAOFF, + Q_GETQUOTA, + Q_SETQUOTA, + } +} + +libc_enum!{ + /// The scope of the quota. + #[repr(i32)] + #[non_exhaustive] + pub enum QuotaType { + /// Specify a user quota + USRQUOTA, + /// Specify a group quota + GRPQUOTA, + } +} + +libc_enum!{ + /// The type of quota format to use. + #[repr(i32)] + #[non_exhaustive] + pub enum QuotaFmt { + /// Use the original quota format. + QFMT_VFS_OLD, + /// Use the standard VFS v0 quota format. + /// + /// Handles 32-bit UIDs/GIDs and quota limits up to 232 bytes/232 inodes. + QFMT_VFS_V0, + /// Use the VFS v1 quota format. + /// + /// Handles 32-bit UIDs/GIDs and quota limits of 264 bytes/264 inodes. + QFMT_VFS_V1, + } +} + +libc_bitflags!( + /// Indicates the quota fields that are valid to read from. + #[derive(Default)] + pub struct QuotaValidFlags: u32 { + /// The block hard & soft limit fields. + QIF_BLIMITS; + /// The current space field. + QIF_SPACE; + /// The inode hard & soft limit fields. + QIF_ILIMITS; + /// The current inodes field. + QIF_INODES; + /// The disk use time limit field. + QIF_BTIME; + /// The file quote time limit field. + QIF_ITIME; + /// All block & inode limits. + QIF_LIMITS; + /// The space & inodes usage fields. + QIF_USAGE; + /// The time limit fields. + QIF_TIMES; + /// All fields. + QIF_ALL; + } +); + +/// Wrapper type for `if_dqblk` +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct Dqblk(libc::dqblk); + +impl Default for Dqblk { + fn default() -> Dqblk { + Dqblk(libc::dqblk { + dqb_bhardlimit: 0, + dqb_bsoftlimit: 0, + dqb_curspace: 0, + dqb_ihardlimit: 0, + dqb_isoftlimit: 0, + dqb_curinodes: 0, + dqb_btime: 0, + dqb_itime: 0, + dqb_valid: 0, + }) + } +} + +impl Dqblk { + /// The absolute limit on disk quota blocks allocated. + pub fn blocks_hard_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_BLIMITS) { + Some(self.0.dqb_bhardlimit) + } else { + None + } + } + + /// Set the absolute limit on disk quota blocks allocated. + pub fn set_blocks_hard_limit(&mut self, limit: u64) { + self.0.dqb_bhardlimit = limit; + } + + /// Preferred limit on disk quota blocks + pub fn blocks_soft_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_BLIMITS) { + Some(self.0.dqb_bsoftlimit) + } else { + None + } + } + + /// Set the preferred limit on disk quota blocks allocated. + pub fn set_blocks_soft_limit(&mut self, limit: u64) { + self.0.dqb_bsoftlimit = limit; + } + + /// Current occupied space (bytes). + pub fn occupied_space(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_SPACE) { + Some(self.0.dqb_curspace) + } else { + None + } + } + + /// Maximum number of allocated inodes. + pub fn inodes_hard_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_ILIMITS) { + Some(self.0.dqb_ihardlimit) + } else { + None + } + } + + /// Set the maximum number of allocated inodes. + pub fn set_inodes_hard_limit(&mut self, limit: u64) { + self.0.dqb_ihardlimit = limit; + } + + /// Preferred inode limit + pub fn inodes_soft_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_ILIMITS) { + Some(self.0.dqb_isoftlimit) + } else { + None + } + } + + /// Set the preferred limit of allocated inodes. + pub fn set_inodes_soft_limit(&mut self, limit: u64) { + self.0.dqb_isoftlimit = limit; + } + + /// Current number of allocated inodes. + pub fn allocated_inodes(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_INODES) { + Some(self.0.dqb_curinodes) + } else { + None + } + } + + /// Time limit for excessive disk use. + pub fn block_time_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_BTIME) { + Some(self.0.dqb_btime) + } else { + None + } + } + + /// Set the time limit for excessive disk use. + pub fn set_block_time_limit(&mut self, limit: u64) { + self.0.dqb_btime = limit; + } + + /// Time limit for excessive files. + pub fn inode_time_limit(&self) -> Option { + let valid_fields = QuotaValidFlags::from_bits_truncate(self.0.dqb_valid); + if valid_fields.contains(QuotaValidFlags::QIF_ITIME) { + Some(self.0.dqb_itime) + } else { + None + } + } + + /// Set the time limit for excessive files. + pub fn set_inode_time_limit(&mut self, limit: u64) { + self.0.dqb_itime = limit; + } +} + +fn quotactl(cmd: QuotaCmd, special: Option<&P>, id: c_int, addr: *mut c_char) -> Result<()> { + unsafe { + Errno::clear(); + let res = match special { + Some(dev) => dev.with_nix_path(|path| libc::quotactl(cmd.as_int(), path.as_ptr(), id, addr)), + None => Ok(libc::quotactl(cmd.as_int(), ptr::null(), id, addr)), + }?; + + Errno::result(res).map(drop) + } +} + +/// Turn on disk quotas for a block device. +pub fn quotactl_on(which: QuotaType, special: &P, format: QuotaFmt, quota_file: &P) -> Result<()> { + quota_file.with_nix_path(|path| { + let mut path_copy = path.to_bytes_with_nul().to_owned(); + let p: *mut c_char = path_copy.as_mut_ptr() as *mut c_char; + quotactl(QuotaCmd(QuotaSubCmd::Q_QUOTAON, which), Some(special), format as c_int, p) + })? +} + +/// Disable disk quotas for a block device. +pub fn quotactl_off(which: QuotaType, special: &P) -> Result<()> { + quotactl(QuotaCmd(QuotaSubCmd::Q_QUOTAOFF, which), Some(special), 0, ptr::null_mut()) +} + +/// Update the on-disk copy of quota usages for a filesystem. +/// +/// If `special` is `None`, then all file systems with active quotas are sync'd. +pub fn quotactl_sync(which: QuotaType, special: Option<&P>) -> Result<()> { + quotactl(QuotaCmd(QuotaSubCmd::Q_SYNC, which), special, 0, ptr::null_mut()) +} + +/// Get disk quota limits and current usage for the given user/group id. +pub fn quotactl_get(which: QuotaType, special: &P, id: c_int) -> Result { + let mut dqblk = mem::MaybeUninit::uninit(); + quotactl(QuotaCmd(QuotaSubCmd::Q_GETQUOTA, which), Some(special), id, dqblk.as_mut_ptr() as *mut c_char)?; + Ok(unsafe{ Dqblk(dqblk.assume_init())}) +} + +/// Configure quota values for the specified fields for a given user/group id. +pub fn quotactl_set(which: QuotaType, special: &P, id: c_int, dqblk: &Dqblk, fields: QuotaValidFlags) -> Result<()> { + let mut dqblk_copy = *dqblk; + dqblk_copy.0.dqb_valid = fields.bits(); + quotactl(QuotaCmd(QuotaSubCmd::Q_SETQUOTA, which), Some(special), id, &mut dqblk_copy as *mut _ as *mut c_char) +} diff --git a/bash-5.1/vendor/nix/src/sys/reboot.rs b/bash-5.1/vendor/nix/src/sys/reboot.rs new file mode 100644 index 0000000000000000000000000000000000000000..2a8009e4f81fb3650aaf0b9276d629a0c1346774 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/reboot.rs @@ -0,0 +1,52 @@ +//! Reboot/shutdown or enable/disable Ctrl-Alt-Delete. + +use crate::Result; +use crate::errno::Errno; +use std::convert::Infallible; +use std::mem::drop; + +libc_enum! { + /// How exactly should the system be rebooted. + /// + /// See [`set_cad_enabled()`](fn.set_cad_enabled.html) for + /// enabling/disabling Ctrl-Alt-Delete. + #[repr(i32)] + #[non_exhaustive] + pub enum RebootMode { + /// Halt the system. + RB_HALT_SYSTEM, + /// Execute a kernel that has been loaded earlier with + /// [`kexec_load(2)`](https://man7.org/linux/man-pages/man2/kexec_load.2.html). + RB_KEXEC, + /// Stop the system and switch off power, if possible. + RB_POWER_OFF, + /// Restart the system. + RB_AUTOBOOT, + // we do not support Restart2. + /// Suspend the system using software suspend. + RB_SW_SUSPEND, + } +} + +/// Reboots or shuts down the system. +pub fn reboot(how: RebootMode) -> Result { + unsafe { + libc::reboot(how as libc::c_int) + }; + Err(Errno::last()) +} + +/// Enable or disable the reboot keystroke (Ctrl-Alt-Delete). +/// +/// Corresponds to calling `reboot(RB_ENABLE_CAD)` or `reboot(RB_DISABLE_CAD)` in C. +pub fn set_cad_enabled(enable: bool) -> Result<()> { + let cmd = if enable { + libc::RB_ENABLE_CAD + } else { + libc::RB_DISABLE_CAD + }; + let res = unsafe { + libc::reboot(cmd) + }; + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix/src/sys/resource.rs b/bash-5.1/vendor/nix/src/sys/resource.rs new file mode 100644 index 0000000000000000000000000000000000000000..e9a11d95d48c34d0f8116e95e4407f71a890c09e --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/resource.rs @@ -0,0 +1,437 @@ +//! Configure the process resource limits. +use cfg_if::cfg_if; +use libc::{c_int, c_long, rusage}; + +use crate::errno::Errno; +use crate::sys::time::TimeVal; +use crate::Result; +pub use libc::rlim_t; +use std::mem; + +cfg_if! { + if #[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))]{ + use libc::{__rlimit_resource_t, rlimit}; + } else if #[cfg(any( + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "macos", + target_os = "ios", + target_os = "android", + target_os = "dragonfly", + all(target_os = "linux", not(target_env = "gnu")) + ))]{ + use libc::rlimit; + } +} + +libc_enum! { + /// Types of process resources. + /// + /// The Resource enum is platform dependent. Check different platform + /// manuals for more details. Some platform links have been provided for + /// easier reference (non-exhaustive). + /// + /// * [Linux](https://man7.org/linux/man-pages/man2/getrlimit.2.html) + /// * [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=setrlimit) + /// * [NetBSD](https://man.netbsd.org/setrlimit.2) + + // linux-gnu uses u_int as resource enum, which is implemented in libc as + // well. + // + // https://gcc.gnu.org/legacy-ml/gcc/2015-08/msg00441.html + // https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/linux/gnu/mod.rs + #[cfg_attr(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")), repr(u32))] + #[cfg_attr(any( + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "macos", + target_os = "ios", + target_os = "android", + target_os = "dragonfly", + all(target_os = "linux", not(any(target_env = "gnu", target_env = "uclibc"))) + ), repr(i32))] + #[non_exhaustive] + pub enum Resource { + #[cfg(not(any(target_os = "freebsd", target_os = "netbsd", target_os = "openbsd")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum amount (in bytes) of virtual memory the process is + /// allowed to map. + RLIMIT_AS, + /// The largest size (in bytes) core(5) file that may be created. + RLIMIT_CORE, + /// The maximum amount of cpu time (in seconds) to be used by each + /// process. + RLIMIT_CPU, + /// The maximum size (in bytes) of the data segment for a process + RLIMIT_DATA, + /// The largest size (in bytes) file that may be created. + RLIMIT_FSIZE, + /// The maximum number of open files for this process. + RLIMIT_NOFILE, + /// The maximum size (in bytes) of the stack segment for a process. + RLIMIT_STACK, + + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum number of kqueues this user id is allowed to create. + RLIMIT_KQUEUES, + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A limit on the combined number of flock locks and fcntl leases that + /// this process may establish. + RLIMIT_LOCKS, + + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "linux", + target_os = "netbsd" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum size (in bytes) which a process may lock into memory + /// using the mlock(2) system call. + RLIMIT_MEMLOCK, + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A limit on the number of bytes that can be allocated for POSIX + /// message queues for the real user ID of the calling process. + RLIMIT_MSGQUEUE, + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A ceiling to which the process's nice value can be raised using + /// setpriority or nice. + RLIMIT_NICE, + + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + target_os = "linux", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum number of simultaneous processes for this user id. + RLIMIT_NPROC, + + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum number of pseudo-terminals this user id is allowed to + /// create. + RLIMIT_NPTS, + + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd", + target_os = "linux", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// When there is memory pressure and swap is available, prioritize + /// eviction of a process' resident pages beyond this amount (in bytes). + RLIMIT_RSS, + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A ceiling on the real-time priority that may be set for this process + /// using sched_setscheduler and sched_set‐ param. + RLIMIT_RTPRIO, + + #[cfg(any(target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A limit (in microseconds) on the amount of CPU time that a process + /// scheduled under a real-time scheduling policy may con‐ sume without + /// making a blocking system call. + RLIMIT_RTTIME, + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// A limit on the number of signals that may be queued for the real + /// user ID of the calling process. + RLIMIT_SIGPENDING, + + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum size (in bytes) of socket buffer usage for this user. + RLIMIT_SBSIZE, + + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum size (in bytes) of the swap space that may be reserved + /// or used by all of this user id's processes. + RLIMIT_SWAP, + + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// An alias for RLIMIT_AS. + RLIMIT_VMEM, + } +} + +/// Get the current processes resource limits +/// +/// The special value `RLIM_INFINITY` indicates that no limit will be +/// enforced. +/// +/// # Parameters +/// +/// * `resource`: The [`Resource`] that we want to get the limits of. +/// +/// # Examples +/// +/// ``` +/// # use nix::sys::resource::{getrlimit, Resource}; +/// +/// let (soft_limit, hard_limit) = getrlimit(Resource::RLIMIT_NOFILE).unwrap(); +/// println!("current soft_limit: {}", soft_limit); +/// println!("current hard_limit: {}", hard_limit); +/// ``` +/// +/// # References +/// +/// [getrlimit(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html#tag_16_215) +/// +/// [`Resource`]: enum.Resource.html +pub fn getrlimit(resource: Resource) -> Result<(rlim_t, rlim_t)> { + let mut old_rlim = mem::MaybeUninit::::uninit(); + + cfg_if! { + if #[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))]{ + let res = unsafe { libc::getrlimit(resource as __rlimit_resource_t, old_rlim.as_mut_ptr()) }; + } else { + let res = unsafe { libc::getrlimit(resource as c_int, old_rlim.as_mut_ptr()) }; + } + } + + Errno::result(res).map(|_| { + let rlimit { rlim_cur, rlim_max } = unsafe { old_rlim.assume_init() }; + (rlim_cur, rlim_max) + }) +} + +/// Set the current processes resource limits +/// +/// # Parameters +/// +/// * `resource`: The [`Resource`] that we want to set the limits of. +/// * `soft_limit`: The value that the kernel enforces for the corresponding +/// resource. +/// * `hard_limit`: The ceiling for the soft limit. Must be lower or equal to +/// the current hard limit for non-root users. +/// +/// The special value `RLIM_INFINITY` indicates that no limit will be +/// enforced. +/// +/// # Examples +/// +/// ``` +/// # use nix::sys::resource::{setrlimit, Resource}; +/// +/// let soft_limit = 512; +/// let hard_limit = 1024; +/// setrlimit(Resource::RLIMIT_NOFILE, soft_limit, hard_limit).unwrap(); +/// ``` +/// +/// # References +/// +/// [setrlimit(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html#tag_16_215) +/// +/// [`Resource`]: enum.Resource.html +/// +/// Note: `setrlimit` provides a safe wrapper to libc's `setrlimit`. +pub fn setrlimit(resource: Resource, soft_limit: rlim_t, hard_limit: rlim_t) -> Result<()> { + let new_rlim = rlimit { + rlim_cur: soft_limit, + rlim_max: hard_limit, + }; + cfg_if! { + if #[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "uclibc")))]{ + let res = unsafe { libc::setrlimit(resource as __rlimit_resource_t, &new_rlim as *const rlimit) }; + }else{ + let res = unsafe { libc::setrlimit(resource as c_int, &new_rlim as *const rlimit) }; + } + } + + Errno::result(res).map(drop) +} + +libc_enum! { + /// Whose resource usage should be returned by [`getrusage`]. + #[repr(i32)] + #[non_exhaustive] + pub enum UsageWho { + /// Resource usage for the current process. + RUSAGE_SELF, + + /// Resource usage for all the children that have terminated and been waited for. + RUSAGE_CHILDREN, + + #[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Resource usage for the calling thread. + RUSAGE_THREAD, + } +} + +/// Output of `getrusage` with information about resource usage. Some of the fields +/// may be unused in some platforms, and will be always zeroed out. See their manuals +/// for details. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct Usage(rusage); + +impl AsRef for Usage { + fn as_ref(&self) -> &rusage { + &self.0 + } +} + +impl AsMut for Usage { + fn as_mut(&mut self) -> &mut rusage { + &mut self.0 + } +} + +impl Usage { + /// Total amount of time spent executing in user mode. + pub fn user_time(&self) -> TimeVal { + TimeVal::from(self.0.ru_utime) + } + + /// Total amount of time spent executing in kernel mode. + pub fn system_time(&self) -> TimeVal { + TimeVal::from(self.0.ru_stime) + } + + /// The resident set size at its peak, in kilobytes. + pub fn max_rss(&self) -> c_long { + self.0.ru_maxrss + } + + /// Integral value expressed in kilobytes times ticks of execution indicating + /// the amount of text memory shared with other processes. + pub fn shared_integral(&self) -> c_long { + self.0.ru_ixrss + } + + /// Integral value expressed in kilobytes times ticks of execution indicating + /// the amount of unshared memory used by data. + pub fn unshared_data_integral(&self) -> c_long { + self.0.ru_idrss + } + + /// Integral value expressed in kilobytes times ticks of execution indicating + /// the amount of unshared memory used for stack space. + pub fn unshared_stack_integral(&self) -> c_long { + self.0.ru_isrss + } + + /// Number of page faults that were served without resorting to I/O, with pages + /// that have been allocated previously by the kernel. + pub fn minor_page_faults(&self) -> c_long { + self.0.ru_minflt + } + + /// Number of page faults that were served through I/O (i.e. swap). + pub fn major_page_faults(&self) -> c_long { + self.0.ru_majflt + } + + /// Number of times all of the memory was fully swapped out. + pub fn full_swaps(&self) -> c_long { + self.0.ru_nswap + } + + /// Number of times a read was done from a block device. + pub fn block_reads(&self) -> c_long { + self.0.ru_inblock + } + + /// Number of times a write was done to a block device. + pub fn block_writes(&self) -> c_long { + self.0.ru_oublock + } + + /// Number of IPC messages sent. + pub fn ipc_sends(&self) -> c_long { + self.0.ru_msgsnd + } + + /// Number of IPC messages received. + pub fn ipc_receives(&self) -> c_long { + self.0.ru_msgrcv + } + + /// Number of signals received. + pub fn signals(&self) -> c_long { + self.0.ru_nsignals + } + + /// Number of times a context switch was voluntarily invoked. + pub fn voluntary_context_switches(&self) -> c_long { + self.0.ru_nvcsw + } + + /// Number of times a context switch was imposed by the kernel (usually due to + /// time slice expiring or preemption by a higher priority process). + pub fn involuntary_context_switches(&self) -> c_long { + self.0.ru_nivcsw + } +} + +/// Get usage information for a process, its children or the current thread +/// +/// Real time information can be obtained for either the current process or (in some +/// systems) thread, but information about children processes is only provided for +/// those that have terminated and been waited for (see [`super::wait::wait`]). +/// +/// Some information may be missing depending on the platform, and the way information +/// is provided for children may also vary. Check the manuals for details. +/// +/// # References +/// +/// * [getrusage(2)](https://pubs.opengroup.org/onlinepubs/009696699/functions/getrusage.html) +/// * [Linux](https://man7.org/linux/man-pages/man2/getrusage.2.html) +/// * [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=getrusage) +/// * [NetBSD](https://man.netbsd.org/getrusage.2) +/// * [MacOS](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getrusage.2.html) +/// +/// [`UsageWho`]: enum.UsageWho.html +/// +/// Note: `getrusage` provides a safe wrapper to libc's [`libc::getrusage`]. +pub fn getrusage(who: UsageWho) -> Result { + unsafe { + let mut rusage = mem::MaybeUninit::::uninit(); + let res = libc::getrusage(who as c_int, rusage.as_mut_ptr()); + Errno::result(res).map(|_| Usage(rusage.assume_init())) + } +} + +#[cfg(test)] +mod test { + use super::{getrusage, UsageWho}; + + #[test] + pub fn test_self_cpu_time() { + // Make sure some CPU time is used. + let mut numbers: Vec = (1..1_000_000).collect(); + numbers.iter_mut().for_each(|item| *item *= 2); + + // FIXME: this is here to help ensure the compiler does not optimize the whole + // thing away. Replace the assert with test::black_box once stabilized. + assert_eq!(numbers[100..200].iter().sum::(), 30_100); + + let usage = getrusage(UsageWho::RUSAGE_SELF).expect("Failed to call getrusage for SELF"); + let rusage = usage.as_ref(); + + let user = usage.user_time(); + assert!(user.tv_sec() > 0 || user.tv_usec() > 0); + assert_eq!(user.tv_sec(), rusage.ru_utime.tv_sec); + assert_eq!(user.tv_usec(), rusage.ru_utime.tv_usec); + } +} diff --git a/bash-5.1/vendor/nix/src/sys/select.rs b/bash-5.1/vendor/nix/src/sys/select.rs new file mode 100644 index 0000000000000000000000000000000000000000..ab4f68f537063c614b7e32f8bfa73e60078263dd --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/select.rs @@ -0,0 +1,434 @@ +//! Portably monitor a group of file descriptors for readiness. +use std::convert::TryFrom; +use std::iter::FusedIterator; +use std::mem; +use std::ops::Range; +use std::os::unix::io::RawFd; +use std::ptr::{null, null_mut}; +use libc::{self, c_int}; +use crate::Result; +use crate::errno::Errno; +use crate::sys::time::{TimeSpec, TimeVal}; + +pub use libc::FD_SETSIZE; + +/// Contains a set of file descriptors used by [`select`] +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct FdSet(libc::fd_set); + +fn assert_fd_valid(fd: RawFd) { + assert!( + usize::try_from(fd).map_or(false, |fd| fd < FD_SETSIZE), + "fd must be in the range 0..FD_SETSIZE", + ); +} + +impl FdSet { + /// Create an empty `FdSet` + pub fn new() -> FdSet { + let mut fdset = mem::MaybeUninit::uninit(); + unsafe { + libc::FD_ZERO(fdset.as_mut_ptr()); + FdSet(fdset.assume_init()) + } + } + + /// Add a file descriptor to an `FdSet` + pub fn insert(&mut self, fd: RawFd) { + assert_fd_valid(fd); + unsafe { libc::FD_SET(fd, &mut self.0) }; + } + + /// Remove a file descriptor from an `FdSet` + pub fn remove(&mut self, fd: RawFd) { + assert_fd_valid(fd); + unsafe { libc::FD_CLR(fd, &mut self.0) }; + } + + /// Test an `FdSet` for the presence of a certain file descriptor. + pub fn contains(&self, fd: RawFd) -> bool { + assert_fd_valid(fd); + unsafe { libc::FD_ISSET(fd, &self.0) } + } + + /// Remove all file descriptors from this `FdSet`. + pub fn clear(&mut self) { + unsafe { libc::FD_ZERO(&mut self.0) }; + } + + /// Finds the highest file descriptor in the set. + /// + /// Returns `None` if the set is empty. + /// + /// This can be used to calculate the `nfds` parameter of the [`select`] function. + /// + /// # Example + /// + /// ``` + /// # use nix::sys::select::FdSet; + /// let mut set = FdSet::new(); + /// set.insert(4); + /// set.insert(9); + /// assert_eq!(set.highest(), Some(9)); + /// ``` + /// + /// [`select`]: fn.select.html + pub fn highest(&self) -> Option { + self.fds(None).next_back() + } + + /// Returns an iterator over the file descriptors in the set. + /// + /// For performance, it takes an optional higher bound: the iterator will + /// not return any elements of the set greater than the given file + /// descriptor. + /// + /// # Examples + /// + /// ``` + /// # use nix::sys::select::FdSet; + /// # use std::os::unix::io::RawFd; + /// let mut set = FdSet::new(); + /// set.insert(4); + /// set.insert(9); + /// let fds: Vec = set.fds(None).collect(); + /// assert_eq!(fds, vec![4, 9]); + /// ``` + #[inline] + pub fn fds(&self, highest: Option) -> Fds { + Fds { + set: self, + range: 0..highest.map(|h| h as usize + 1).unwrap_or(FD_SETSIZE), + } + } +} + +impl Default for FdSet { + fn default() -> Self { + Self::new() + } +} + +/// Iterator over `FdSet`. +#[derive(Debug)] +pub struct Fds<'a> { + set: &'a FdSet, + range: Range, +} + +impl<'a> Iterator for Fds<'a> { + type Item = RawFd; + + fn next(&mut self) -> Option { + for i in &mut self.range { + if self.set.contains(i as RawFd) { + return Some(i as RawFd); + } + } + None + } + + #[inline] + fn size_hint(&self) -> (usize, Option) { + let (_, upper) = self.range.size_hint(); + (0, upper) + } +} + +impl<'a> DoubleEndedIterator for Fds<'a> { + #[inline] + fn next_back(&mut self) -> Option { + while let Some(i) = self.range.next_back() { + if self.set.contains(i as RawFd) { + return Some(i as RawFd); + } + } + None + } +} + +impl<'a> FusedIterator for Fds<'a> {} + +/// Monitors file descriptors for readiness +/// +/// Returns the total number of ready file descriptors in all sets. The sets are changed so that all +/// file descriptors that are ready for the given operation are set. +/// +/// When this function returns, `timeout` has an implementation-defined value. +/// +/// # Parameters +/// +/// * `nfds`: The highest file descriptor set in any of the passed `FdSet`s, plus 1. If `None`, this +/// is calculated automatically by calling [`FdSet::highest`] on all descriptor sets and adding 1 +/// to the maximum of that. +/// * `readfds`: File descriptors to check for being ready to read. +/// * `writefds`: File descriptors to check for being ready to write. +/// * `errorfds`: File descriptors to check for pending error conditions. +/// * `timeout`: Maximum time to wait for descriptors to become ready (`None` to block +/// indefinitely). +/// +/// # References +/// +/// [select(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/select.html) +/// +/// [`FdSet::highest`]: struct.FdSet.html#method.highest +pub fn select<'a, N, R, W, E, T>(nfds: N, + readfds: R, + writefds: W, + errorfds: E, + timeout: T) -> Result +where + N: Into>, + R: Into>, + W: Into>, + E: Into>, + T: Into>, +{ + let mut readfds = readfds.into(); + let mut writefds = writefds.into(); + let mut errorfds = errorfds.into(); + let timeout = timeout.into(); + + let nfds = nfds.into().unwrap_or_else(|| { + readfds.iter_mut() + .chain(writefds.iter_mut()) + .chain(errorfds.iter_mut()) + .map(|set| set.highest().unwrap_or(-1)) + .max() + .unwrap_or(-1) + 1 + }); + + let readfds = readfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let writefds = writefds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let errorfds = errorfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let timeout = timeout.map(|tv| tv as *mut _ as *mut libc::timeval) + .unwrap_or(null_mut()); + + let res = unsafe { + libc::select(nfds, readfds, writefds, errorfds, timeout) + }; + + Errno::result(res) +} + +feature! { +#![feature = "signal"] + +use crate::sys::signal::SigSet; + +/// Monitors file descriptors for readiness with an altered signal mask. +/// +/// Returns the total number of ready file descriptors in all sets. The sets are changed so that all +/// file descriptors that are ready for the given operation are set. +/// +/// When this function returns, the original signal mask is restored. +/// +/// Unlike [`select`](#fn.select), `pselect` does not mutate the `timeout` value. +/// +/// # Parameters +/// +/// * `nfds`: The highest file descriptor set in any of the passed `FdSet`s, plus 1. If `None`, this +/// is calculated automatically by calling [`FdSet::highest`] on all descriptor sets and adding 1 +/// to the maximum of that. +/// * `readfds`: File descriptors to check for read readiness +/// * `writefds`: File descriptors to check for write readiness +/// * `errorfds`: File descriptors to check for pending error conditions. +/// * `timeout`: Maximum time to wait for descriptors to become ready (`None` to block +/// indefinitely). +/// * `sigmask`: Signal mask to activate while waiting for file descriptors to turn +/// ready (`None` to set no alternative signal mask). +/// +/// # References +/// +/// [pselect(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pselect.html) +/// +/// [The new pselect() system call](https://lwn.net/Articles/176911/) +/// +/// [`FdSet::highest`]: struct.FdSet.html#method.highest +pub fn pselect<'a, N, R, W, E, T, S>(nfds: N, + readfds: R, + writefds: W, + errorfds: E, + timeout: T, + sigmask: S) -> Result +where + N: Into>, + R: Into>, + W: Into>, + E: Into>, + T: Into>, + S: Into>, +{ + let mut readfds = readfds.into(); + let mut writefds = writefds.into(); + let mut errorfds = errorfds.into(); + let sigmask = sigmask.into(); + let timeout = timeout.into(); + + let nfds = nfds.into().unwrap_or_else(|| { + readfds.iter_mut() + .chain(writefds.iter_mut()) + .chain(errorfds.iter_mut()) + .map(|set| set.highest().unwrap_or(-1)) + .max() + .unwrap_or(-1) + 1 + }); + + let readfds = readfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let writefds = writefds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let errorfds = errorfds.map(|set| set as *mut _ as *mut libc::fd_set).unwrap_or(null_mut()); + let timeout = timeout.map(|ts| ts.as_ref() as *const libc::timespec).unwrap_or(null()); + let sigmask = sigmask.map(|sm| sm.as_ref() as *const libc::sigset_t).unwrap_or(null()); + + let res = unsafe { + libc::pselect(nfds, readfds, writefds, errorfds, timeout, sigmask) + }; + + Errno::result(res) +} +} + +#[cfg(test)] +mod tests { + use super::*; + use std::os::unix::io::RawFd; + use crate::sys::time::{TimeVal, TimeValLike}; + use crate::unistd::{write, pipe}; + + #[test] + fn fdset_insert() { + let mut fd_set = FdSet::new(); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + + fd_set.insert(7); + + assert!(fd_set.contains(7)); + } + + #[test] + fn fdset_remove() { + let mut fd_set = FdSet::new(); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + + fd_set.insert(7); + fd_set.remove(7); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + } + + #[test] + fn fdset_clear() { + let mut fd_set = FdSet::new(); + fd_set.insert(1); + fd_set.insert((FD_SETSIZE / 2) as RawFd); + fd_set.insert((FD_SETSIZE - 1) as RawFd); + + fd_set.clear(); + + for i in 0..FD_SETSIZE { + assert!(!fd_set.contains(i as RawFd)); + } + } + + #[test] + fn fdset_highest() { + let mut set = FdSet::new(); + assert_eq!(set.highest(), None); + set.insert(0); + assert_eq!(set.highest(), Some(0)); + set.insert(90); + assert_eq!(set.highest(), Some(90)); + set.remove(0); + assert_eq!(set.highest(), Some(90)); + set.remove(90); + assert_eq!(set.highest(), None); + + set.insert(4); + set.insert(5); + set.insert(7); + assert_eq!(set.highest(), Some(7)); + } + + #[test] + fn fdset_fds() { + let mut set = FdSet::new(); + assert_eq!(set.fds(None).collect::>(), vec![]); + set.insert(0); + assert_eq!(set.fds(None).collect::>(), vec![0]); + set.insert(90); + assert_eq!(set.fds(None).collect::>(), vec![0, 90]); + + // highest limit + assert_eq!(set.fds(Some(89)).collect::>(), vec![0]); + assert_eq!(set.fds(Some(90)).collect::>(), vec![0, 90]); + } + + #[test] + fn test_select() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let mut timeout = TimeVal::seconds(10); + assert_eq!(1, select(None, + &mut fd_set, + None, + None, + &mut timeout).unwrap()); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); + } + + #[test] + fn test_select_nfds() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let mut timeout = TimeVal::seconds(10); + assert_eq!(1, select(Some(fd_set.highest().unwrap() + 1), + &mut fd_set, + None, + None, + &mut timeout).unwrap()); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); + } + + #[test] + fn test_select_nfds2() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let mut timeout = TimeVal::seconds(10); + assert_eq!(1, select(::std::cmp::max(r1, r2) + 1, + &mut fd_set, + None, + None, + &mut timeout).unwrap()); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); + } +} diff --git a/bash-5.1/vendor/nix/src/sys/sendfile.rs b/bash-5.1/vendor/nix/src/sys/sendfile.rs new file mode 100644 index 0000000000000000000000000000000000000000..2ebcdf48892e28288a7d91ecb3fd0098a1e1e156 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/sendfile.rs @@ -0,0 +1,277 @@ +//! Send data from a file to a socket, bypassing userland. + +use cfg_if::cfg_if; +use std::os::unix::io::RawFd; +use std::ptr; + +use libc::{self, off_t}; + +use crate::Result; +use crate::errno::Errno; + +/// Copy up to `count` bytes to `out_fd` from `in_fd` starting at `offset`. +/// +/// Returns a `Result` with the number of bytes written. +/// +/// If `offset` is `None`, `sendfile` will begin reading at the current offset of `in_fd`and will +/// update the offset of `in_fd`. If `offset` is `Some`, `sendfile` will begin at the specified +/// offset and will not update the offset of `in_fd`. Instead, it will mutate `offset` to point to +/// the byte after the last byte copied. +/// +/// `in_fd` must support `mmap`-like operations and therefore cannot be a socket. +/// +/// For more information, see [the sendfile(2) man page.](https://man7.org/linux/man-pages/man2/sendfile.2.html) +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn sendfile( + out_fd: RawFd, + in_fd: RawFd, + offset: Option<&mut off_t>, + count: usize, +) -> Result { + let offset = offset + .map(|offset| offset as *mut _) + .unwrap_or(ptr::null_mut()); + let ret = unsafe { libc::sendfile(out_fd, in_fd, offset, count) }; + Errno::result(ret).map(|r| r as usize) +} + +/// Copy up to `count` bytes to `out_fd` from `in_fd` starting at `offset`. +/// +/// Returns a `Result` with the number of bytes written. +/// +/// If `offset` is `None`, `sendfile` will begin reading at the current offset of `in_fd`and will +/// update the offset of `in_fd`. If `offset` is `Some`, `sendfile` will begin at the specified +/// offset and will not update the offset of `in_fd`. Instead, it will mutate `offset` to point to +/// the byte after the last byte copied. +/// +/// `in_fd` must support `mmap`-like operations and therefore cannot be a socket. +/// +/// For more information, see [the sendfile(2) man page.](https://man7.org/linux/man-pages/man2/sendfile.2.html) +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn sendfile64( + out_fd: RawFd, + in_fd: RawFd, + offset: Option<&mut libc::off64_t>, + count: usize, +) -> Result { + let offset = offset + .map(|offset| offset as *mut _) + .unwrap_or(ptr::null_mut()); + let ret = unsafe { libc::sendfile64(out_fd, in_fd, offset, count) }; + Errno::result(ret).map(|r| r as usize) +} + +cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos"))] { + use std::io::IoSlice; + + #[derive(Clone, Debug)] + struct SendfileHeaderTrailer<'a>( + libc::sf_hdtr, + Option>>, + Option>>, + ); + + impl<'a> SendfileHeaderTrailer<'a> { + fn new( + headers: Option<&'a [&'a [u8]]>, + trailers: Option<&'a [&'a [u8]]> + ) -> SendfileHeaderTrailer<'a> { + let header_iovecs: Option>> = + headers.map(|s| s.iter().map(|b| IoSlice::new(b)).collect()); + let trailer_iovecs: Option>> = + trailers.map(|s| s.iter().map(|b| IoSlice::new(b)).collect()); + SendfileHeaderTrailer( + libc::sf_hdtr { + headers: { + header_iovecs + .as_ref() + .map_or(ptr::null(), |v| v.as_ptr()) as *mut libc::iovec + }, + hdr_cnt: header_iovecs.as_ref().map(|v| v.len()).unwrap_or(0) as i32, + trailers: { + trailer_iovecs + .as_ref() + .map_or(ptr::null(), |v| v.as_ptr()) as *mut libc::iovec + }, + trl_cnt: trailer_iovecs.as_ref().map(|v| v.len()).unwrap_or(0) as i32 + }, + header_iovecs, + trailer_iovecs, + ) + } + } + } +} + +cfg_if! { + if #[cfg(target_os = "freebsd")] { + use libc::c_int; + + libc_bitflags!{ + /// Configuration options for [`sendfile`.](fn.sendfile.html) + pub struct SfFlags: c_int { + /// Causes `sendfile` to return EBUSY instead of blocking when attempting to read a + /// busy page. + SF_NODISKIO; + /// Causes `sendfile` to sleep until the network stack releases its reference to the + /// VM pages read. When `sendfile` returns, the data is not guaranteed to have been + /// sent, but it is safe to modify the file. + SF_SYNC; + /// Causes `sendfile` to cache exactly the number of pages specified in the + /// `readahead` parameter, disabling caching heuristics. + SF_USER_READAHEAD; + /// Causes `sendfile` not to cache the data read. + SF_NOCACHE; + } + } + + /// Read up to `count` bytes from `in_fd` starting at `offset` and write to `out_sock`. + /// + /// Returns a `Result` and a count of bytes written. Bytes written may be non-zero even if + /// an error occurs. + /// + /// `in_fd` must describe a regular file or shared memory object. `out_sock` must describe a + /// stream socket. + /// + /// If `offset` falls past the end of the file, the function returns success and zero bytes + /// written. + /// + /// If `count` is `None` or 0, bytes will be read from `in_fd` until reaching the end of + /// file (EOF). + /// + /// `headers` and `trailers` specify optional slices of byte slices to be sent before and + /// after the data read from `in_fd`, respectively. The length of headers and trailers sent + /// is included in the returned count of bytes written. The values of `offset` and `count` + /// do not apply to headers or trailers. + /// + /// `readahead` specifies the minimum number of pages to cache in memory ahead of the page + /// currently being sent. + /// + /// For more information, see + /// [the sendfile(2) man page.](https://www.freebsd.org/cgi/man.cgi?query=sendfile&sektion=2) + #[allow(clippy::too_many_arguments)] + pub fn sendfile( + in_fd: RawFd, + out_sock: RawFd, + offset: off_t, + count: Option, + headers: Option<&[&[u8]]>, + trailers: Option<&[&[u8]]>, + flags: SfFlags, + readahead: u16 + ) -> (Result<()>, off_t) { + // Readahead goes in upper 16 bits + // Flags goes in lower 16 bits + // see `man 2 sendfile` + let ra32 = u32::from(readahead); + let flags: u32 = (ra32 << 16) | (flags.bits() as u32); + let mut bytes_sent: off_t = 0; + let hdtr = headers.or(trailers).map(|_| SendfileHeaderTrailer::new(headers, trailers)); + let hdtr_ptr = hdtr.as_ref().map_or(ptr::null(), |s| &s.0 as *const libc::sf_hdtr); + let return_code = unsafe { + libc::sendfile(in_fd, + out_sock, + offset, + count.unwrap_or(0), + hdtr_ptr as *mut libc::sf_hdtr, + &mut bytes_sent as *mut off_t, + flags as c_int) + }; + (Errno::result(return_code).and(Ok(())), bytes_sent) + } + } else if #[cfg(target_os = "dragonfly")] { + /// Read up to `count` bytes from `in_fd` starting at `offset` and write to `out_sock`. + /// + /// Returns a `Result` and a count of bytes written. Bytes written may be non-zero even if + /// an error occurs. + /// + /// `in_fd` must describe a regular file. `out_sock` must describe a stream socket. + /// + /// If `offset` falls past the end of the file, the function returns success and zero bytes + /// written. + /// + /// If `count` is `None` or 0, bytes will be read from `in_fd` until reaching the end of + /// file (EOF). + /// + /// `headers` and `trailers` specify optional slices of byte slices to be sent before and + /// after the data read from `in_fd`, respectively. The length of headers and trailers sent + /// is included in the returned count of bytes written. The values of `offset` and `count` + /// do not apply to headers or trailers. + /// + /// For more information, see + /// [the sendfile(2) man page.](https://leaf.dragonflybsd.org/cgi/web-man?command=sendfile§ion=2) + pub fn sendfile( + in_fd: RawFd, + out_sock: RawFd, + offset: off_t, + count: Option, + headers: Option<&[&[u8]]>, + trailers: Option<&[&[u8]]>, + ) -> (Result<()>, off_t) { + let mut bytes_sent: off_t = 0; + let hdtr = headers.or(trailers).map(|_| SendfileHeaderTrailer::new(headers, trailers)); + let hdtr_ptr = hdtr.as_ref().map_or(ptr::null(), |s| &s.0 as *const libc::sf_hdtr); + let return_code = unsafe { + libc::sendfile(in_fd, + out_sock, + offset, + count.unwrap_or(0), + hdtr_ptr as *mut libc::sf_hdtr, + &mut bytes_sent as *mut off_t, + 0) + }; + (Errno::result(return_code).and(Ok(())), bytes_sent) + } + } else if #[cfg(any(target_os = "ios", target_os = "macos"))] { + /// Read bytes from `in_fd` starting at `offset` and write up to `count` bytes to + /// `out_sock`. + /// + /// Returns a `Result` and a count of bytes written. Bytes written may be non-zero even if + /// an error occurs. + /// + /// `in_fd` must describe a regular file. `out_sock` must describe a stream socket. + /// + /// If `offset` falls past the end of the file, the function returns success and zero bytes + /// written. + /// + /// If `count` is `None` or 0, bytes will be read from `in_fd` until reaching the end of + /// file (EOF). + /// + /// `hdtr` specifies an optional list of headers and trailers to be sent before and after + /// the data read from `in_fd`, respectively. The length of headers and trailers sent is + /// included in the returned count of bytes written. If any headers are specified and + /// `count` is non-zero, the length of the headers will be counted in the limit of total + /// bytes sent. Trailers do not count toward the limit of bytes sent and will always be sent + /// regardless. The value of `offset` does not affect headers or trailers. + /// + /// For more information, see + /// [the sendfile(2) man page.](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man2/sendfile.2.html) + pub fn sendfile( + in_fd: RawFd, + out_sock: RawFd, + offset: off_t, + count: Option, + headers: Option<&[&[u8]]>, + trailers: Option<&[&[u8]]> + ) -> (Result<()>, off_t) { + let mut len = count.unwrap_or(0); + let hdtr = headers.or(trailers).map(|_| SendfileHeaderTrailer::new(headers, trailers)); + let hdtr_ptr = hdtr.as_ref().map_or(ptr::null(), |s| &s.0 as *const libc::sf_hdtr); + let return_code = unsafe { + libc::sendfile(in_fd, + out_sock, + offset, + &mut len as *mut off_t, + hdtr_ptr as *mut libc::sf_hdtr, + 0) + }; + (Errno::result(return_code).and(Ok(())), len) + } + } +} diff --git a/bash-5.1/vendor/nix/src/sys/signal.rs b/bash-5.1/vendor/nix/src/sys/signal.rs new file mode 100644 index 0000000000000000000000000000000000000000..0da9c74ad6eea9087b02f71756deabcc688e9f39 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/signal.rs @@ -0,0 +1,1347 @@ +// Portions of this file are Copyright 2014 The Rust Project Developers. +// See https://www.rust-lang.org/policies/licenses. + +//! Operating system signals. + +use crate::errno::Errno; +use crate::{Error, Result}; +use cfg_if::cfg_if; +use std::fmt; +use std::mem; +#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] +use std::os::unix::io::RawFd; +use std::ptr; +use std::str::FromStr; + +#[cfg(not(any(target_os = "openbsd", target_os = "redox")))] +#[cfg(any(feature = "aio", feature = "signal"))] +pub use self::sigevent::*; + +#[cfg(any(feature = "aio", feature = "process", feature = "signal"))] +libc_enum! { + /// Types of operating system signals + // Currently there is only one definition of c_int in libc, as well as only one + // type for signal constants. + // We would prefer to use the libc::c_int alias in the repr attribute. Unfortunately + // this is not (yet) possible. + #[repr(i32)] + #[non_exhaustive] + #[cfg_attr(docsrs, doc(cfg(any(feature = "aio", feature = "signal"))))] + pub enum Signal { + /// Hangup + SIGHUP, + /// Interrupt + SIGINT, + /// Quit + SIGQUIT, + /// Illegal instruction (not reset when caught) + SIGILL, + /// Trace trap (not reset when caught) + SIGTRAP, + /// Abort + SIGABRT, + /// Bus error + SIGBUS, + /// Floating point exception + SIGFPE, + /// Kill (cannot be caught or ignored) + SIGKILL, + /// User defined signal 1 + SIGUSR1, + /// Segmentation violation + SIGSEGV, + /// User defined signal 2 + SIGUSR2, + /// Write on a pipe with no one to read it + SIGPIPE, + /// Alarm clock + SIGALRM, + /// Software termination signal from kill + SIGTERM, + /// Stack fault (obsolete) + #[cfg(all(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"), + not(any(target_arch = "mips", target_arch = "mips64", + target_arch = "sparc64"))))] + SIGSTKFLT, + /// To parent on child stop or exit + SIGCHLD, + /// Continue a stopped process + SIGCONT, + /// Sendable stop signal not from tty + SIGSTOP, + /// Stop signal from tty + SIGTSTP, + /// To readers pgrp upon background tty read + SIGTTIN, + /// Like TTIN if (tp->t_local<OSTOP) + SIGTTOU, + /// Urgent condition on IO channel + SIGURG, + /// Exceeded CPU time limit + SIGXCPU, + /// Exceeded file size limit + SIGXFSZ, + /// Virtual time alarm + SIGVTALRM, + /// Profiling time alarm + SIGPROF, + /// Window size changes + SIGWINCH, + /// Input/output possible signal + #[cfg(not(target_os = "haiku"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SIGIO, + #[cfg(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Power failure imminent. + SIGPWR, + /// Bad system call + SIGSYS, + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Emulator trap + SIGEMT, + #[cfg(not(any(target_os = "android", target_os = "emscripten", + target_os = "fuchsia", target_os = "linux", + target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Information request + SIGINFO, + } + impl TryFrom +} + +#[cfg(feature = "signal")] +impl FromStr for Signal { + type Err = Error; + fn from_str(s: &str) -> Result { + Ok(match s { + "SIGHUP" => Signal::SIGHUP, + "SIGINT" => Signal::SIGINT, + "SIGQUIT" => Signal::SIGQUIT, + "SIGILL" => Signal::SIGILL, + "SIGTRAP" => Signal::SIGTRAP, + "SIGABRT" => Signal::SIGABRT, + "SIGBUS" => Signal::SIGBUS, + "SIGFPE" => Signal::SIGFPE, + "SIGKILL" => Signal::SIGKILL, + "SIGUSR1" => Signal::SIGUSR1, + "SIGSEGV" => Signal::SIGSEGV, + "SIGUSR2" => Signal::SIGUSR2, + "SIGPIPE" => Signal::SIGPIPE, + "SIGALRM" => Signal::SIGALRM, + "SIGTERM" => Signal::SIGTERM, + #[cfg(all( + any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ), + not(any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "sparc64" + )) + ))] + "SIGSTKFLT" => Signal::SIGSTKFLT, + "SIGCHLD" => Signal::SIGCHLD, + "SIGCONT" => Signal::SIGCONT, + "SIGSTOP" => Signal::SIGSTOP, + "SIGTSTP" => Signal::SIGTSTP, + "SIGTTIN" => Signal::SIGTTIN, + "SIGTTOU" => Signal::SIGTTOU, + "SIGURG" => Signal::SIGURG, + "SIGXCPU" => Signal::SIGXCPU, + "SIGXFSZ" => Signal::SIGXFSZ, + "SIGVTALRM" => Signal::SIGVTALRM, + "SIGPROF" => Signal::SIGPROF, + "SIGWINCH" => Signal::SIGWINCH, + #[cfg(not(target_os = "haiku"))] + "SIGIO" => Signal::SIGIO, + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + "SIGPWR" => Signal::SIGPWR, + "SIGSYS" => Signal::SIGSYS, + #[cfg(not(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux", + target_os = "redox", + target_os = "haiku" + )))] + "SIGEMT" => Signal::SIGEMT, + #[cfg(not(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux", + target_os = "redox", + target_os = "haiku" + )))] + "SIGINFO" => Signal::SIGINFO, + _ => return Err(Errno::EINVAL), + }) + } +} + +#[cfg(feature = "signal")] +impl Signal { + /// Returns name of signal. + /// + /// This function is equivalent to `>::as_ref()`, + /// with difference that returned string is `'static` + /// and not bound to `self`'s lifetime. + pub const fn as_str(self) -> &'static str { + match self { + Signal::SIGHUP => "SIGHUP", + Signal::SIGINT => "SIGINT", + Signal::SIGQUIT => "SIGQUIT", + Signal::SIGILL => "SIGILL", + Signal::SIGTRAP => "SIGTRAP", + Signal::SIGABRT => "SIGABRT", + Signal::SIGBUS => "SIGBUS", + Signal::SIGFPE => "SIGFPE", + Signal::SIGKILL => "SIGKILL", + Signal::SIGUSR1 => "SIGUSR1", + Signal::SIGSEGV => "SIGSEGV", + Signal::SIGUSR2 => "SIGUSR2", + Signal::SIGPIPE => "SIGPIPE", + Signal::SIGALRM => "SIGALRM", + Signal::SIGTERM => "SIGTERM", + #[cfg(all( + any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ), + not(any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "sparc64" + )) + ))] + Signal::SIGSTKFLT => "SIGSTKFLT", + Signal::SIGCHLD => "SIGCHLD", + Signal::SIGCONT => "SIGCONT", + Signal::SIGSTOP => "SIGSTOP", + Signal::SIGTSTP => "SIGTSTP", + Signal::SIGTTIN => "SIGTTIN", + Signal::SIGTTOU => "SIGTTOU", + Signal::SIGURG => "SIGURG", + Signal::SIGXCPU => "SIGXCPU", + Signal::SIGXFSZ => "SIGXFSZ", + Signal::SIGVTALRM => "SIGVTALRM", + Signal::SIGPROF => "SIGPROF", + Signal::SIGWINCH => "SIGWINCH", + #[cfg(not(target_os = "haiku"))] + Signal::SIGIO => "SIGIO", + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + Signal::SIGPWR => "SIGPWR", + Signal::SIGSYS => "SIGSYS", + #[cfg(not(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux", + target_os = "redox", + target_os = "haiku" + )))] + Signal::SIGEMT => "SIGEMT", + #[cfg(not(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux", + target_os = "redox", + target_os = "haiku" + )))] + Signal::SIGINFO => "SIGINFO", + } + } +} + +#[cfg(feature = "signal")] +impl AsRef for Signal { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +#[cfg(feature = "signal")] +impl fmt::Display for Signal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(self.as_ref()) + } +} + +#[cfg(feature = "signal")] +pub use self::Signal::*; + +#[cfg(target_os = "redox")] +#[cfg(feature = "signal")] +const SIGNALS: [Signal; 29] = [ + SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, + SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, + SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, + SIGPROF, SIGWINCH, SIGIO, SIGSYS, +]; +#[cfg(target_os = "haiku")] +#[cfg(feature = "signal")] +const SIGNALS: [Signal; 28] = [ + SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, + SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, + SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, + SIGPROF, SIGWINCH, SIGSYS, +]; +#[cfg(all( + any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia" + ), + not(any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "sparc64" + )) +))] +#[cfg(feature = "signal")] +const SIGNALS: [Signal; 31] = [ + SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, + SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGSTKFLT, SIGCHLD, + SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, + SIGVTALRM, SIGPROF, SIGWINCH, SIGIO, SIGPWR, SIGSYS, +]; +#[cfg(all( + any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia" + ), + any(target_arch = "mips", target_arch = "mips64", target_arch = "sparc64") +))] +#[cfg(feature = "signal")] +const SIGNALS: [Signal; 30] = [ + SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, + SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, + SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, + SIGPROF, SIGWINCH, SIGIO, SIGPWR, SIGSYS, +]; +#[cfg(not(any( + target_os = "linux", + target_os = "android", + target_os = "fuchsia", + target_os = "emscripten", + target_os = "redox", + target_os = "haiku" +)))] +#[cfg(feature = "signal")] +const SIGNALS: [Signal; 31] = [ + SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, + SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, + SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, + SIGPROF, SIGWINCH, SIGIO, SIGSYS, SIGEMT, SIGINFO, +]; + +feature! { +#![feature = "signal"] + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +/// Iterate through all signals defined by this operating system +pub struct SignalIterator { + next: usize, +} + +impl Iterator for SignalIterator { + type Item = Signal; + + fn next(&mut self) -> Option { + if self.next < SIGNALS.len() { + let next_signal = SIGNALS[self.next]; + self.next += 1; + Some(next_signal) + } else { + None + } + } +} + +impl Signal { + /// Iterate through all signals defined by this OS + pub const fn iterator() -> SignalIterator { + SignalIterator{next: 0} + } +} + +/// Alias for [`SIGABRT`] +pub const SIGIOT : Signal = SIGABRT; +/// Alias for [`SIGIO`] +#[cfg(not(target_os = "haiku"))] +pub const SIGPOLL : Signal = SIGIO; +/// Alias for [`SIGSYS`] +pub const SIGUNUSED : Signal = SIGSYS; + +cfg_if! { + if #[cfg(target_os = "redox")] { + type SaFlags_t = libc::c_ulong; + } else if #[cfg(target_env = "uclibc")] { + type SaFlags_t = libc::c_ulong; + } else { + type SaFlags_t = libc::c_int; + } +} +} + +#[cfg(feature = "signal")] +libc_bitflags! { + /// Controls the behavior of a [`SigAction`] + #[cfg_attr(docsrs, doc(cfg(feature = "signal")))] + pub struct SaFlags: SaFlags_t { + /// When catching a [`Signal::SIGCHLD`] signal, the signal will be + /// generated only when a child process exits, not when a child process + /// stops. + SA_NOCLDSTOP; + /// When catching a [`Signal::SIGCHLD`] signal, the system will not + /// create zombie processes when children of the calling process exit. + SA_NOCLDWAIT; + /// Further occurrences of the delivered signal are not masked during + /// the execution of the handler. + SA_NODEFER; + /// The system will deliver the signal to the process on a signal stack, + /// specified by each thread with sigaltstack(2). + SA_ONSTACK; + /// The handler is reset back to the default at the moment the signal is + /// delivered. + SA_RESETHAND; + /// Requests that certain system calls restart if interrupted by this + /// signal. See the man page for complete details. + SA_RESTART; + /// This flag is controlled internally by Nix. + SA_SIGINFO; + } +} + +#[cfg(feature = "signal")] +libc_enum! { + /// Specifies how certain functions should manipulate a signal mask + #[repr(i32)] + #[non_exhaustive] + #[cfg_attr(docsrs, doc(cfg(feature = "signal")))] + pub enum SigmaskHow { + /// The new mask is the union of the current mask and the specified set. + SIG_BLOCK, + /// The new mask is the intersection of the current mask and the + /// complement of the specified set. + SIG_UNBLOCK, + /// The current mask is replaced by the specified set. + SIG_SETMASK, + } +} + +feature! { +#![feature = "signal"] + +use crate::unistd::Pid; +use std::iter::Extend; +use std::iter::FromIterator; +use std::iter::IntoIterator; + +/// Specifies a set of [`Signal`]s that may be blocked, waited for, etc. +// We are using `transparent` here to be super sure that `SigSet` +// is represented exactly like the `sigset_t` struct from C. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct SigSet { + sigset: libc::sigset_t +} + +impl SigSet { + /// Initialize to include all signals. + #[cfg_attr(has_doc_alias, doc(alias("sigfillset")))] + pub fn all() -> SigSet { + let mut sigset = mem::MaybeUninit::uninit(); + let _ = unsafe { libc::sigfillset(sigset.as_mut_ptr()) }; + + unsafe{ SigSet { sigset: sigset.assume_init() } } + } + + /// Initialize to include nothing. + #[cfg_attr(has_doc_alias, doc(alias("sigemptyset")))] + pub fn empty() -> SigSet { + let mut sigset = mem::MaybeUninit::uninit(); + let _ = unsafe { libc::sigemptyset(sigset.as_mut_ptr()) }; + + unsafe{ SigSet { sigset: sigset.assume_init() } } + } + + /// Add the specified signal to the set. + #[cfg_attr(has_doc_alias, doc(alias("sigaddset")))] + pub fn add(&mut self, signal: Signal) { + unsafe { libc::sigaddset(&mut self.sigset as *mut libc::sigset_t, signal as libc::c_int) }; + } + + /// Remove all signals from this set. + #[cfg_attr(has_doc_alias, doc(alias("sigemptyset")))] + pub fn clear(&mut self) { + unsafe { libc::sigemptyset(&mut self.sigset as *mut libc::sigset_t) }; + } + + /// Remove the specified signal from this set. + #[cfg_attr(has_doc_alias, doc(alias("sigdelset")))] + pub fn remove(&mut self, signal: Signal) { + unsafe { libc::sigdelset(&mut self.sigset as *mut libc::sigset_t, signal as libc::c_int) }; + } + + /// Return whether this set includes the specified signal. + #[cfg_attr(has_doc_alias, doc(alias("sigismember")))] + pub fn contains(&self, signal: Signal) -> bool { + let res = unsafe { libc::sigismember(&self.sigset as *const libc::sigset_t, signal as libc::c_int) }; + + match res { + 1 => true, + 0 => false, + _ => unreachable!("unexpected value from sigismember"), + } + } + + /// Returns an iterator that yields the signals contained in this set. + pub fn iter(&self) -> SigSetIter<'_> { + self.into_iter() + } + + /// Gets the currently blocked (masked) set of signals for the calling thread. + pub fn thread_get_mask() -> Result { + let mut oldmask = mem::MaybeUninit::uninit(); + do_pthread_sigmask(SigmaskHow::SIG_SETMASK, None, Some(oldmask.as_mut_ptr()))?; + Ok(unsafe{ SigSet{sigset: oldmask.assume_init()}}) + } + + /// Sets the set of signals as the signal mask for the calling thread. + pub fn thread_set_mask(&self) -> Result<()> { + pthread_sigmask(SigmaskHow::SIG_SETMASK, Some(self), None) + } + + /// Adds the set of signals to the signal mask for the calling thread. + pub fn thread_block(&self) -> Result<()> { + pthread_sigmask(SigmaskHow::SIG_BLOCK, Some(self), None) + } + + /// Removes the set of signals from the signal mask for the calling thread. + pub fn thread_unblock(&self) -> Result<()> { + pthread_sigmask(SigmaskHow::SIG_UNBLOCK, Some(self), None) + } + + /// Sets the set of signals as the signal mask, and returns the old mask. + pub fn thread_swap_mask(&self, how: SigmaskHow) -> Result { + let mut oldmask = mem::MaybeUninit::uninit(); + do_pthread_sigmask(how, Some(self), Some(oldmask.as_mut_ptr()))?; + Ok(unsafe{ SigSet{sigset: oldmask.assume_init()}}) + } + + /// Suspends execution of the calling thread until one of the signals in the + /// signal mask becomes pending, and returns the accepted signal. + #[cfg(not(target_os = "redox"))] // RedoxFS does not yet support sigwait + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn wait(&self) -> Result { + use std::convert::TryFrom; + + let mut signum = mem::MaybeUninit::uninit(); + let res = unsafe { libc::sigwait(&self.sigset as *const libc::sigset_t, signum.as_mut_ptr()) }; + + Errno::result(res).map(|_| unsafe { + Signal::try_from(signum.assume_init()).unwrap() + }) + } + + /// Converts a `libc::sigset_t` object to a [`SigSet`] without checking whether the + /// `libc::sigset_t` is already initialized. + /// + /// # Safety + /// + /// The `sigset` passed in must be a valid an initialized `libc::sigset_t` by calling either + /// [`sigemptyset(3)`](https://man7.org/linux/man-pages/man3/sigemptyset.3p.html) or + /// [`sigfillset(3)`](https://man7.org/linux/man-pages/man3/sigfillset.3p.html). + /// Otherwise, the results are undefined. + pub unsafe fn from_sigset_t_unchecked(sigset: libc::sigset_t) -> SigSet { + SigSet { sigset } + } +} + +impl AsRef for SigSet { + fn as_ref(&self) -> &libc::sigset_t { + &self.sigset + } +} + +// TODO: Consider specialization for the case where T is &SigSet and libc::sigorset is available. +impl Extend for SigSet { + fn extend(&mut self, iter: T) + where T: IntoIterator { + for signal in iter { + self.add(signal); + } + } +} + +impl FromIterator for SigSet { + fn from_iter(iter: T) -> Self + where T: IntoIterator { + let mut sigset = SigSet::empty(); + sigset.extend(iter); + sigset + } +} + +/// Iterator for a [`SigSet`]. +/// +/// Call [`SigSet::iter`] to create an iterator. +#[derive(Clone, Debug)] +pub struct SigSetIter<'a> { + sigset: &'a SigSet, + inner: SignalIterator, +} + +impl Iterator for SigSetIter<'_> { + type Item = Signal; + fn next(&mut self) -> Option { + loop { + match self.inner.next() { + None => return None, + Some(signal) if self.sigset.contains(signal) => return Some(signal), + Some(_signal) => continue, + } + } + } +} + +impl<'a> IntoIterator for &'a SigSet { + type Item = Signal; + type IntoIter = SigSetIter<'a>; + fn into_iter(self) -> Self::IntoIter { + SigSetIter { sigset: self, inner: Signal::iterator() } + } +} + +/// A signal handler. +#[allow(unknown_lints)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum SigHandler { + /// Default signal handling. + SigDfl, + /// Request that the signal be ignored. + SigIgn, + /// Use the given signal-catching function, which takes in the signal. + Handler(extern fn(libc::c_int)), + /// Use the given signal-catching function, which takes in the signal, information about how + /// the signal was generated, and a pointer to the threads `ucontext_t`. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SigAction(extern fn(libc::c_int, *mut libc::siginfo_t, *mut libc::c_void)) +} + +/// Action to take on receipt of a signal. Corresponds to `sigaction`. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct SigAction { + sigaction: libc::sigaction +} + +impl SigAction { + /// Creates a new action. + /// + /// The `SA_SIGINFO` bit in the `flags` argument is ignored (it will be set only if `handler` + /// is the `SigAction` variant). `mask` specifies other signals to block during execution of + /// the signal-catching function. + pub fn new(handler: SigHandler, flags: SaFlags, mask: SigSet) -> SigAction { + unsafe fn install_sig(p: *mut libc::sigaction, handler: SigHandler) { + (*p).sa_sigaction = match handler { + SigHandler::SigDfl => libc::SIG_DFL, + SigHandler::SigIgn => libc::SIG_IGN, + SigHandler::Handler(f) => f as *const extern fn(libc::c_int) as usize, + #[cfg(not(target_os = "redox"))] + SigHandler::SigAction(f) => f as *const extern fn(libc::c_int, *mut libc::siginfo_t, *mut libc::c_void) as usize, + }; + } + + let mut s = mem::MaybeUninit::::uninit(); + unsafe { + let p = s.as_mut_ptr(); + install_sig(p, handler); + (*p).sa_flags = match handler { + #[cfg(not(target_os = "redox"))] + SigHandler::SigAction(_) => (flags | SaFlags::SA_SIGINFO).bits(), + _ => (flags - SaFlags::SA_SIGINFO).bits(), + }; + (*p).sa_mask = mask.sigset; + + SigAction { sigaction: s.assume_init() } + } + } + + /// Returns the flags set on the action. + pub fn flags(&self) -> SaFlags { + SaFlags::from_bits_truncate(self.sigaction.sa_flags) + } + + /// Returns the set of signals that are blocked during execution of the action's + /// signal-catching function. + pub fn mask(&self) -> SigSet { + SigSet { sigset: self.sigaction.sa_mask } + } + + /// Returns the action's handler. + pub fn handler(&self) -> SigHandler { + match self.sigaction.sa_sigaction { + libc::SIG_DFL => SigHandler::SigDfl, + libc::SIG_IGN => SigHandler::SigIgn, + #[cfg(not(target_os = "redox"))] + p if self.flags().contains(SaFlags::SA_SIGINFO) => + SigHandler::SigAction( + // Safe for one of two reasons: + // * The SigHandler was created by SigHandler::new, in which + // case the pointer is correct, or + // * The SigHandler was created by signal or sigaction, which + // are unsafe functions, so the caller should've somehow + // ensured that it is correctly initialized. + unsafe{ + *(&p as *const usize + as *const extern fn(_, _, _)) + } + as extern fn(_, _, _)), + p => SigHandler::Handler( + // Safe for one of two reasons: + // * The SigHandler was created by SigHandler::new, in which + // case the pointer is correct, or + // * The SigHandler was created by signal or sigaction, which + // are unsafe functions, so the caller should've somehow + // ensured that it is correctly initialized. + unsafe{ + *(&p as *const usize + as *const extern fn(libc::c_int)) + } + as extern fn(libc::c_int)), + } + } +} + +/// Changes the action taken by a process on receipt of a specific signal. +/// +/// `signal` can be any signal except `SIGKILL` or `SIGSTOP`. On success, it returns the previous +/// action for the given signal. If `sigaction` fails, no new signal handler is installed. +/// +/// # Safety +/// +/// * Signal handlers may be called at any point during execution, which limits +/// what is safe to do in the body of the signal-catching function. Be certain +/// to only make syscalls that are explicitly marked safe for signal handlers +/// and only share global data using atomics. +/// +/// * There is also no guarantee that the old signal handler was installed +/// correctly. If it was installed by this crate, it will be. But if it was +/// installed by, for example, C code, then there is no guarantee its function +/// pointer is valid. In that case, this function effectively dereferences a +/// raw pointer of unknown provenance. +pub unsafe fn sigaction(signal: Signal, sigaction: &SigAction) -> Result { + let mut oldact = mem::MaybeUninit::::uninit(); + + let res = libc::sigaction(signal as libc::c_int, + &sigaction.sigaction as *const libc::sigaction, + oldact.as_mut_ptr()); + + Errno::result(res).map(|_| SigAction { sigaction: oldact.assume_init() }) +} + +/// Signal management (see [signal(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/signal.html)) +/// +/// Installs `handler` for the given `signal`, returning the previous signal +/// handler. `signal` should only be used following another call to `signal` or +/// if the current handler is the default. The return value of `signal` is +/// undefined after setting the handler with [`sigaction`][SigActionFn]. +/// +/// # Safety +/// +/// If the pointer to the previous signal handler is invalid, undefined +/// behavior could be invoked when casting it back to a [`SigAction`][SigActionStruct]. +/// +/// # Examples +/// +/// Ignore `SIGINT`: +/// +/// ```no_run +/// # use nix::sys::signal::{self, Signal, SigHandler}; +/// unsafe { signal::signal(Signal::SIGINT, SigHandler::SigIgn) }.unwrap(); +/// ``` +/// +/// Use a signal handler to set a flag variable: +/// +/// ```no_run +/// # #[macro_use] extern crate lazy_static; +/// # use std::convert::TryFrom; +/// # use std::sync::atomic::{AtomicBool, Ordering}; +/// # use nix::sys::signal::{self, Signal, SigHandler}; +/// lazy_static! { +/// static ref SIGNALED: AtomicBool = AtomicBool::new(false); +/// } +/// +/// extern fn handle_sigint(signal: libc::c_int) { +/// let signal = Signal::try_from(signal).unwrap(); +/// SIGNALED.store(signal == Signal::SIGINT, Ordering::Relaxed); +/// } +/// +/// fn main() { +/// let handler = SigHandler::Handler(handle_sigint); +/// unsafe { signal::signal(Signal::SIGINT, handler) }.unwrap(); +/// } +/// ``` +/// +/// # Errors +/// +/// Returns [`Error(Errno::EOPNOTSUPP)`] if `handler` is +/// [`SigAction`][SigActionStruct]. Use [`sigaction`][SigActionFn] instead. +/// +/// `signal` also returns any error from `libc::signal`, such as when an attempt +/// is made to catch a signal that cannot be caught or to ignore a signal that +/// cannot be ignored. +/// +/// [`Error::UnsupportedOperation`]: ../../enum.Error.html#variant.UnsupportedOperation +/// [SigActionStruct]: struct.SigAction.html +/// [sigactionFn]: fn.sigaction.html +pub unsafe fn signal(signal: Signal, handler: SigHandler) -> Result { + let signal = signal as libc::c_int; + let res = match handler { + SigHandler::SigDfl => libc::signal(signal, libc::SIG_DFL), + SigHandler::SigIgn => libc::signal(signal, libc::SIG_IGN), + SigHandler::Handler(handler) => libc::signal(signal, handler as libc::sighandler_t), + #[cfg(not(target_os = "redox"))] + SigHandler::SigAction(_) => return Err(Errno::ENOTSUP), + }; + Errno::result(res).map(|oldhandler| { + match oldhandler { + libc::SIG_DFL => SigHandler::SigDfl, + libc::SIG_IGN => SigHandler::SigIgn, + p => SigHandler::Handler( + *(&p as *const usize + as *const extern fn(libc::c_int)) + as extern fn(libc::c_int)), + } + }) +} + +fn do_pthread_sigmask(how: SigmaskHow, + set: Option<&SigSet>, + oldset: Option<*mut libc::sigset_t>) -> Result<()> { + if set.is_none() && oldset.is_none() { + return Ok(()) + } + + let res = unsafe { + // if set or oldset is None, pass in null pointers instead + libc::pthread_sigmask(how as libc::c_int, + set.map_or_else(ptr::null::, + |s| &s.sigset as *const libc::sigset_t), + oldset.unwrap_or(ptr::null_mut()) + ) + }; + + Errno::result(res).map(drop) +} + +/// Manages the signal mask (set of blocked signals) for the calling thread. +/// +/// If the `set` parameter is `Some(..)`, then the signal mask will be updated with the signal set. +/// The `how` flag decides the type of update. If `set` is `None`, `how` will be ignored, +/// and no modification will take place. +/// +/// If the 'oldset' parameter is `Some(..)` then the current signal mask will be written into it. +/// +/// If both `set` and `oldset` is `Some(..)`, the current signal mask will be written into oldset, +/// and then it will be updated with `set`. +/// +/// If both `set` and `oldset` is None, this function is a no-op. +/// +/// For more information, visit the [`pthread_sigmask`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html), +/// or [`sigprocmask`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html) man pages. +pub fn pthread_sigmask(how: SigmaskHow, + set: Option<&SigSet>, + oldset: Option<&mut SigSet>) -> Result<()> +{ + do_pthread_sigmask(how, set, oldset.map(|os| &mut os.sigset as *mut _ )) +} + +/// Examine and change blocked signals. +/// +/// For more information see the [`sigprocmask` man +/// pages](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html). +pub fn sigprocmask(how: SigmaskHow, set: Option<&SigSet>, oldset: Option<&mut SigSet>) -> Result<()> { + if set.is_none() && oldset.is_none() { + return Ok(()) + } + + let res = unsafe { + // if set or oldset is None, pass in null pointers instead + libc::sigprocmask(how as libc::c_int, + set.map_or_else(ptr::null::, + |s| &s.sigset as *const libc::sigset_t), + oldset.map_or_else(ptr::null_mut::, + |os| &mut os.sigset as *mut libc::sigset_t)) + }; + + Errno::result(res).map(drop) +} + +/// Send a signal to a process +/// +/// # Arguments +/// +/// * `pid` - Specifies which processes should receive the signal. +/// - If positive, specifies an individual process +/// - If zero, the signal will be sent to all processes whose group +/// ID is equal to the process group ID of the sender. This is a +/// variant of [`killpg`]. +/// - If `-1` and the process has super-user privileges, the signal +/// is sent to all processes exclusing system processes. +/// - If less than `-1`, the signal is sent to all processes whose +/// process group ID is equal to the absolute value of `pid`. +/// * `signal` - Signal to send. If `None`, error checking is performed +/// but no signal is actually sent. +/// +/// See Also +/// [`kill(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/kill.html) +pub fn kill>>(pid: Pid, signal: T) -> Result<()> { + let res = unsafe { libc::kill(pid.into(), + match signal.into() { + Some(s) => s as libc::c_int, + None => 0, + }) }; + + Errno::result(res).map(drop) +} + +/// Send a signal to a process group +/// +/// # Arguments +/// +/// * `pgrp` - Process group to signal. If less then or equal 1, the behavior +/// is platform-specific. +/// * `signal` - Signal to send. If `None`, `killpg` will only preform error +/// checking and won't send any signal. +/// +/// See Also [killpg(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/killpg.html). +#[cfg(not(target_os = "fuchsia"))] +pub fn killpg>>(pgrp: Pid, signal: T) -> Result<()> { + let res = unsafe { libc::killpg(pgrp.into(), + match signal.into() { + Some(s) => s as libc::c_int, + None => 0, + }) }; + + Errno::result(res).map(drop) +} + +/// Send a signal to the current thread +/// +/// See Also [raise(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/raise.html) +pub fn raise(signal: Signal) -> Result<()> { + let res = unsafe { libc::raise(signal as libc::c_int) }; + + Errno::result(res).map(drop) +} +} + +feature! { +#![any(feature = "aio", feature = "signal")] + +/// Identifies a thread for [`SigevNotify::SigevThreadId`] +#[cfg(target_os = "freebsd")] +pub type type_of_thread_id = libc::lwpid_t; +/// Identifies a thread for [`SigevNotify::SigevThreadId`] +#[cfg(target_os = "linux")] +pub type type_of_thread_id = libc::pid_t; + +/// Specifies the notification method used by a [`SigEvent`] +// sigval is actually a union of a int and a void*. But it's never really used +// as a pointer, because neither libc nor the kernel ever dereference it. nix +// therefore presents it as an intptr_t, which is how kevent uses it. +#[cfg(not(any(target_os = "openbsd", target_os = "redox")))] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum SigevNotify { + /// No notification will be delivered + SigevNone, + /// Notify by delivering a signal to the process. + SigevSignal { + /// Signal to deliver + signal: Signal, + /// Will be present in the `si_value` field of the [`libc::siginfo_t`] + /// structure of the queued signal. + si_value: libc::intptr_t + }, + // Note: SIGEV_THREAD is not implemented because libc::sigevent does not + // expose a way to set the union members needed by SIGEV_THREAD. + /// Notify by delivering an event to a kqueue. + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SigevKevent { + /// File descriptor of the kqueue to notify. + kq: RawFd, + /// Will be contained in the kevent's `udata` field. + udata: libc::intptr_t + }, + /// Notify by delivering a signal to a thread. + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SigevThreadId { + /// Signal to send + signal: Signal, + /// LWP ID of the thread to notify + thread_id: type_of_thread_id, + /// Will be present in the `si_value` field of the [`libc::siginfo_t`] + /// structure of the queued signal. + si_value: libc::intptr_t + }, +} +} + +#[cfg(not(any(target_os = "openbsd", target_os = "redox")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod sigevent { + feature! { + #![any(feature = "aio", feature = "signal")] + + use std::mem; + use std::ptr; + use super::SigevNotify; + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + use super::type_of_thread_id; + + /// Used to request asynchronous notification of the completion of certain + /// events, such as POSIX AIO and timers. + #[repr(C)] + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct SigEvent { + sigevent: libc::sigevent + } + + impl SigEvent { + /// **Note:** this constructor does not allow the user to set the + /// `sigev_notify_kevent_flags` field. That's considered ok because on FreeBSD + /// at least those flags don't do anything useful. That field is part of a + /// union that shares space with the more genuinely useful fields. + /// + /// **Note:** This constructor also doesn't allow the caller to set the + /// `sigev_notify_function` or `sigev_notify_attributes` fields, which are + /// required for `SIGEV_THREAD`. That's considered ok because on no operating + /// system is `SIGEV_THREAD` the most efficient way to deliver AIO + /// notification. FreeBSD and DragonFly BSD programs should prefer `SIGEV_KEVENT`. + /// Linux, Solaris, and portable programs should prefer `SIGEV_THREAD_ID` or + /// `SIGEV_SIGNAL`. That field is part of a union that shares space with the + /// more genuinely useful `sigev_notify_thread_id` + // Allow invalid_value warning on Fuchsia only. + // See https://github.com/nix-rust/nix/issues/1441 + #[cfg_attr(target_os = "fuchsia", allow(invalid_value))] + pub fn new(sigev_notify: SigevNotify) -> SigEvent { + let mut sev = unsafe { mem::MaybeUninit::::zeroed().assume_init() }; + sev.sigev_notify = match sigev_notify { + SigevNotify::SigevNone => libc::SIGEV_NONE, + SigevNotify::SigevSignal{..} => libc::SIGEV_SIGNAL, + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + SigevNotify::SigevKevent{..} => libc::SIGEV_KEVENT, + #[cfg(target_os = "freebsd")] + SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID, + #[cfg(all(target_os = "linux", target_env = "gnu", not(target_arch = "mips")))] + SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID, + #[cfg(all(target_os = "linux", target_env = "uclibc"))] + SigevNotify::SigevThreadId{..} => libc::SIGEV_THREAD_ID, + #[cfg(any(all(target_os = "linux", target_env = "musl"), target_arch = "mips"))] + SigevNotify::SigevThreadId{..} => 4 // No SIGEV_THREAD_ID defined + }; + sev.sigev_signo = match sigev_notify { + SigevNotify::SigevSignal{ signal, .. } => signal as libc::c_int, + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + SigevNotify::SigevKevent{ kq, ..} => kq, + #[cfg(any(target_os = "linux", target_os = "freebsd"))] + SigevNotify::SigevThreadId{ signal, .. } => signal as libc::c_int, + _ => 0 + }; + sev.sigev_value.sival_ptr = match sigev_notify { + SigevNotify::SigevNone => ptr::null_mut::(), + SigevNotify::SigevSignal{ si_value, .. } => si_value as *mut libc::c_void, + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + SigevNotify::SigevKevent{ udata, .. } => udata as *mut libc::c_void, + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + SigevNotify::SigevThreadId{ si_value, .. } => si_value as *mut libc::c_void, + }; + SigEvent::set_tid(&mut sev, &sigev_notify); + SigEvent{sigevent: sev} + } + + #[cfg(any(target_os = "freebsd", target_os = "linux"))] + fn set_tid(sev: &mut libc::sigevent, sigev_notify: &SigevNotify) { + sev.sigev_notify_thread_id = match *sigev_notify { + SigevNotify::SigevThreadId { thread_id, .. } => thread_id, + _ => 0 as type_of_thread_id + }; + } + + #[cfg(not(any(target_os = "freebsd", target_os = "linux")))] + fn set_tid(_sev: &mut libc::sigevent, _sigev_notify: &SigevNotify) { + } + + /// Return a copy of the inner structure + pub fn sigevent(&self) -> libc::sigevent { + self.sigevent + } + + /// Returns a mutable pointer to the `sigevent` wrapped by `self` + pub fn as_mut_ptr(&mut self) -> *mut libc::sigevent { + &mut self.sigevent + } + } + + impl<'a> From<&'a libc::sigevent> for SigEvent { + fn from(sigevent: &libc::sigevent) -> Self { + SigEvent{ sigevent: *sigevent } + } + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + #[cfg(not(target_os = "redox"))] + use std::thread; + + #[test] + fn test_contains() { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + assert!(mask.contains(SIGUSR1)); + assert!(!mask.contains(SIGUSR2)); + + let all = SigSet::all(); + assert!(all.contains(SIGUSR1)); + assert!(all.contains(SIGUSR2)); + } + + #[test] + fn test_clear() { + let mut set = SigSet::all(); + set.clear(); + for signal in Signal::iterator() { + assert!(!set.contains(signal)); + } + } + + #[test] + fn test_from_str_round_trips() { + for signal in Signal::iterator() { + assert_eq!(signal.as_ref().parse::().unwrap(), signal); + assert_eq!(signal.to_string().parse::().unwrap(), signal); + } + } + + #[test] + fn test_from_str_invalid_value() { + let errval = Err(Errno::EINVAL); + assert_eq!("NOSIGNAL".parse::(), errval); + assert_eq!("kill".parse::(), errval); + assert_eq!("9".parse::(), errval); + } + + #[test] + fn test_extend() { + let mut one_signal = SigSet::empty(); + one_signal.add(SIGUSR1); + + let mut two_signals = SigSet::empty(); + two_signals.add(SIGUSR2); + two_signals.extend(&one_signal); + + assert!(two_signals.contains(SIGUSR1)); + assert!(two_signals.contains(SIGUSR2)); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_set_mask() { + thread::spawn(|| { + let prev_mask = SigSet::thread_get_mask() + .expect("Failed to get existing signal mask!"); + + let mut test_mask = prev_mask; + test_mask.add(SIGUSR1); + + test_mask.thread_set_mask().expect("assertion failed"); + let new_mask = + SigSet::thread_get_mask().expect("Failed to get new mask!"); + + assert!(new_mask.contains(SIGUSR1)); + assert!(!new_mask.contains(SIGUSR2)); + + prev_mask + .thread_set_mask() + .expect("Failed to revert signal mask!"); + }) + .join() + .unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_block() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + mask.thread_block().expect("assertion failed"); + + assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); + }) + .join() + .unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_unblock() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + mask.thread_unblock().expect("assertion failed"); + + assert!(!SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); + }) + .join() + .unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_thread_signal_swap() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + mask.thread_block().unwrap(); + + assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR1)); + + let mut mask2 = SigSet::empty(); + mask2.add(SIGUSR2); + + let oldmask = + mask2.thread_swap_mask(SigmaskHow::SIG_SETMASK).unwrap(); + + assert!(oldmask.contains(SIGUSR1)); + assert!(!oldmask.contains(SIGUSR2)); + + assert!(SigSet::thread_get_mask().unwrap().contains(SIGUSR2)); + }) + .join() + .unwrap(); + } + + #[test] + fn test_from_and_into_iterator() { + let sigset = SigSet::from_iter(vec![Signal::SIGUSR1, Signal::SIGUSR2]); + let signals = sigset.into_iter().collect::>(); + assert_eq!(signals, [Signal::SIGUSR1, Signal::SIGUSR2]); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_sigaction() { + thread::spawn(|| { + extern "C" fn test_sigaction_handler(_: libc::c_int) {} + extern "C" fn test_sigaction_action( + _: libc::c_int, + _: *mut libc::siginfo_t, + _: *mut libc::c_void, + ) { + } + + let handler_sig = SigHandler::Handler(test_sigaction_handler); + + let flags = + SaFlags::SA_ONSTACK | SaFlags::SA_RESTART | SaFlags::SA_SIGINFO; + + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + + let action_sig = SigAction::new(handler_sig, flags, mask); + + assert_eq!( + action_sig.flags(), + SaFlags::SA_ONSTACK | SaFlags::SA_RESTART + ); + assert_eq!(action_sig.handler(), handler_sig); + + mask = action_sig.mask(); + assert!(mask.contains(SIGUSR1)); + assert!(!mask.contains(SIGUSR2)); + + let handler_act = SigHandler::SigAction(test_sigaction_action); + let action_act = SigAction::new(handler_act, flags, mask); + assert_eq!(action_act.handler(), handler_act); + + let action_dfl = SigAction::new(SigHandler::SigDfl, flags, mask); + assert_eq!(action_dfl.handler(), SigHandler::SigDfl); + + let action_ign = SigAction::new(SigHandler::SigIgn, flags, mask); + assert_eq!(action_ign.handler(), SigHandler::SigIgn); + }) + .join() + .unwrap(); + } + + #[test] + #[cfg(not(target_os = "redox"))] + fn test_sigwait() { + thread::spawn(|| { + let mut mask = SigSet::empty(); + mask.add(SIGUSR1); + mask.add(SIGUSR2); + mask.thread_block().unwrap(); + + raise(SIGUSR1).unwrap(); + assert_eq!(mask.wait().unwrap(), SIGUSR1); + }) + .join() + .unwrap(); + } + + #[test] + fn test_from_sigset_t_unchecked() { + let src_set = SigSet::empty(); + let set = unsafe { SigSet::from_sigset_t_unchecked(src_set.sigset) }; + + for signal in Signal::iterator() { + assert!(!set.contains(signal)); + } + + let src_set = SigSet::all(); + let set = unsafe { SigSet::from_sigset_t_unchecked(src_set.sigset) }; + + for signal in Signal::iterator() { + assert!(set.contains(signal)); + } + } +} diff --git a/bash-5.1/vendor/nix/src/sys/signalfd.rs b/bash-5.1/vendor/nix/src/sys/signalfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..166bb9d246c601e6fb091aa916f4f26ee2f14df3 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/signalfd.rs @@ -0,0 +1,171 @@ +//! Interface for the `signalfd` syscall. +//! +//! # Signal discarding +//! When a signal can't be delivered to a process (or thread), it will become a pending signal. +//! Failure to deliver could happen if the signal is blocked by every thread in the process or if +//! the signal handler is still handling a previous signal. +//! +//! If a signal is sent to a process (or thread) that already has a pending signal of the same +//! type, it will be discarded. This means that if signals of the same type are received faster than +//! they are processed, some of those signals will be dropped. Because of this limitation, +//! `signalfd` in itself cannot be used for reliable communication between processes or threads. +//! +//! Once the signal is unblocked, or the signal handler is finished, and a signal is still pending +//! (ie. not consumed from a signalfd) it will be delivered to the signal handler. +//! +//! Please note that signal discarding is not specific to `signalfd`, but also happens with regular +//! signal handlers. +use crate::unistd; +use crate::Result; +use crate::errno::Errno; +pub use crate::sys::signal::{self, SigSet}; +pub use libc::signalfd_siginfo as siginfo; + +use std::os::unix::io::{RawFd, AsRawFd}; +use std::mem; + + +libc_bitflags!{ + pub struct SfdFlags: libc::c_int { + SFD_NONBLOCK; + SFD_CLOEXEC; + } +} + +pub const SIGNALFD_NEW: RawFd = -1; +#[deprecated(since = "0.23.0", note = "use mem::size_of::() instead")] +pub const SIGNALFD_SIGINFO_SIZE: usize = mem::size_of::(); + +/// Creates a new file descriptor for reading signals. +/// +/// **Important:** please read the module level documentation about signal discarding before using +/// this function! +/// +/// The `mask` parameter specifies the set of signals that can be accepted via this file descriptor. +/// +/// A signal must be blocked on every thread in a process, otherwise it won't be visible from +/// signalfd (the default handler will be invoked instead). +/// +/// See [the signalfd man page for more information](https://man7.org/linux/man-pages/man2/signalfd.2.html) +pub fn signalfd(fd: RawFd, mask: &SigSet, flags: SfdFlags) -> Result { + unsafe { + Errno::result(libc::signalfd(fd as libc::c_int, mask.as_ref(), flags.bits())) + } +} + +/// A helper struct for creating, reading and closing a `signalfd` instance. +/// +/// **Important:** please read the module level documentation about signal discarding before using +/// this struct! +/// +/// # Examples +/// +/// ``` +/// # use nix::sys::signalfd::*; +/// // Set the thread to block the SIGUSR1 signal, otherwise the default handler will be used +/// let mut mask = SigSet::empty(); +/// mask.add(signal::SIGUSR1); +/// mask.thread_block().unwrap(); +/// +/// // Signals are queued up on the file descriptor +/// let mut sfd = SignalFd::with_flags(&mask, SfdFlags::SFD_NONBLOCK).unwrap(); +/// +/// match sfd.read_signal() { +/// // we caught a signal +/// Ok(Some(sig)) => (), +/// // there were no signals waiting (only happens when the SFD_NONBLOCK flag is set, +/// // otherwise the read_signal call blocks) +/// Ok(None) => (), +/// Err(err) => (), // some error happend +/// } +/// ``` +#[derive(Debug, Eq, Hash, PartialEq)] +pub struct SignalFd(RawFd); + +impl SignalFd { + pub fn new(mask: &SigSet) -> Result { + Self::with_flags(mask, SfdFlags::empty()) + } + + pub fn with_flags(mask: &SigSet, flags: SfdFlags) -> Result { + let fd = signalfd(SIGNALFD_NEW, mask, flags)?; + + Ok(SignalFd(fd)) + } + + pub fn set_mask(&mut self, mask: &SigSet) -> Result<()> { + signalfd(self.0, mask, SfdFlags::empty()).map(drop) + } + + pub fn read_signal(&mut self) -> Result> { + let mut buffer = mem::MaybeUninit::::uninit(); + + let size = mem::size_of_val(&buffer); + let res = Errno::result(unsafe { + libc::read(self.0, buffer.as_mut_ptr() as *mut libc::c_void, size) + }).map(|r| r as usize); + match res { + Ok(x) if x == size => Ok(Some(unsafe { buffer.assume_init() })), + Ok(_) => unreachable!("partial read on signalfd"), + Err(Errno::EAGAIN) => Ok(None), + Err(error) => Err(error) + } + } +} + +impl Drop for SignalFd { + fn drop(&mut self) { + let e = unistd::close(self.0); + if !std::thread::panicking() && e == Err(Errno::EBADF) { + panic!("Closing an invalid file descriptor!"); + }; + } +} + +impl AsRawFd for SignalFd { + fn as_raw_fd(&self) -> RawFd { + self.0 + } +} + +impl Iterator for SignalFd { + type Item = siginfo; + + fn next(&mut self) -> Option { + match self.read_signal() { + Ok(Some(sig)) => Some(sig), + Ok(None) | Err(_) => None, + } + } +} + + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn create_signalfd() { + let mask = SigSet::empty(); + SignalFd::new(&mask).unwrap(); + } + + #[test] + fn create_signalfd_with_opts() { + let mask = SigSet::empty(); + SignalFd::with_flags( + &mask, + SfdFlags::SFD_CLOEXEC | SfdFlags::SFD_NONBLOCK, + ) + .unwrap(); + } + + #[test] + fn read_empty_signalfd() { + let mask = SigSet::empty(); + let mut fd = SignalFd::with_flags(&mask, SfdFlags::SFD_NONBLOCK).unwrap(); + + let res = fd.read_signal(); + assert!(res.unwrap().is_none()); + } +} diff --git a/bash-5.1/vendor/nix/src/sys/socket/addr.rs b/bash-5.1/vendor/nix/src/sys/socket/addr.rs new file mode 100644 index 0000000000000000000000000000000000000000..ad917cd08feb2fd845bd1bf41e826f7cd958f13c --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/socket/addr.rs @@ -0,0 +1,2849 @@ +use super::sa_family_t; +use cfg_if::cfg_if; +use crate::{Result, NixPath}; +use crate::errno::Errno; +use memoffset::offset_of; +use std::{fmt, mem, net, ptr, slice}; +use std::convert::TryInto; +use std::ffi::OsStr; +use std::hash::{Hash, Hasher}; +use std::path::Path; +use std::os::unix::ffi::OsStrExt; +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::sys::socket::addr::netlink::NetlinkAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::sys::socket::addr::alg::AlgAddr; +#[cfg(any(target_os = "ios", target_os = "macos"))] +use std::os::unix::io::RawFd; +#[cfg(all(feature = "ioctl", any(target_os = "ios", target_os = "macos")))] +use crate::sys::socket::addr::sys_control::SysControlAddr; +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "haiku", + target_os = "fuchsia"))] +#[cfg(feature = "net")] +pub use self::datalink::LinkAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use self::vsock::VsockAddr; + +/// Convert a std::net::Ipv4Addr into the libc form. +#[cfg(feature = "net")] +pub(crate) fn ipv4addr_to_libc(addr: net::Ipv4Addr) -> libc::in_addr { + let octets = addr.octets(); + libc::in_addr { + s_addr: u32::to_be(((octets[0] as u32) << 24) | + ((octets[1] as u32) << 16) | + ((octets[2] as u32) << 8) | + (octets[3] as u32)) + } +} + +/// Convert a std::net::Ipv6Addr into the libc form. +#[cfg(feature = "net")] +pub(crate) const fn ipv6addr_to_libc(addr: &net::Ipv6Addr) -> libc::in6_addr { + libc::in6_addr { + s6_addr: addr.octets() + } +} + +/// These constants specify the protocol family to be used +/// in [`socket`](fn.socket.html) and [`socketpair`](fn.socketpair.html) +/// +/// # References +/// +/// [address_families(7)](https://man7.org/linux/man-pages/man7/address_families.7.html) +// Should this be u8? +#[repr(i32)] +#[non_exhaustive] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] +pub enum AddressFamily { + /// Local communication (see [`unix(7)`](https://man7.org/linux/man-pages/man7/unix.7.html)) + Unix = libc::AF_UNIX, + /// IPv4 Internet protocols (see [`ip(7)`](https://man7.org/linux/man-pages/man7/ip.7.html)) + Inet = libc::AF_INET, + /// IPv6 Internet protocols (see [`ipv6(7)`](https://man7.org/linux/man-pages/man7/ipv6.7.html)) + Inet6 = libc::AF_INET6, + /// Kernel user interface device (see [`netlink(7)`](https://man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Netlink = libc::AF_NETLINK, + /// Low level packet interface (see [`packet(7)`](https://man7.org/linux/man-pages/man7/packet.7.html)) + #[cfg(any(target_os = "android", + target_os = "linux", + target_os = "illumos", + target_os = "fuchsia", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Packet = libc::AF_PACKET, + /// KEXT Controls and Notifications + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + System = libc::AF_SYSTEM, + /// Amateur radio AX.25 protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ax25 = libc::AF_AX25, + /// IPX - Novell protocols + Ipx = libc::AF_IPX, + /// AppleTalk + AppleTalk = libc::AF_APPLETALK, + /// AX.25 packet layer protocol. + /// (see [netrom(4)](https://www.unix.com/man-page/linux/4/netrom/)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetRom = libc::AF_NETROM, + /// Can't be used for creating sockets; mostly used for bridge + /// links in + /// [rtnetlink(7)](https://man7.org/linux/man-pages/man7/rtnetlink.7.html) + /// protocol commands. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Bridge = libc::AF_BRIDGE, + /// Access to raw ATM PVCs + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AtmPvc = libc::AF_ATMPVC, + /// ITU-T X.25 / ISO-8208 protocol (see [`x25(7)`](https://man7.org/linux/man-pages/man7/x25.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + X25 = libc::AF_X25, + /// RATS (Radio Amateur Telecommunications Society) Open + /// Systems environment (ROSE) AX.25 packet layer protocol. + /// (see [netrom(4)](https://www.unix.com/man-page/linux/4/netrom/)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Rose = libc::AF_ROSE, + /// DECet protocol sockets. + #[cfg(not(target_os = "haiku"))] + Decnet = libc::AF_DECnet, + /// Reserved for "802.2LLC project"; never used. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetBeui = libc::AF_NETBEUI, + /// This was a short-lived (between Linux 2.1.30 and + /// 2.1.99pre2) protocol family for firewall upcalls. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Security = libc::AF_SECURITY, + /// Key management protocol. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Key = libc::AF_KEY, + #[allow(missing_docs)] // Not documented anywhere that I can find + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ash = libc::AF_ASH, + /// Acorn Econet protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Econet = libc::AF_ECONET, + /// Access to ATM Switched Virtual Circuits + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AtmSvc = libc::AF_ATMSVC, + /// Reliable Datagram Sockets (RDS) protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Rds = libc::AF_RDS, + /// IBM SNA + #[cfg(not(target_os = "haiku"))] + Sna = libc::AF_SNA, + /// Socket interface over IrDA + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Irda = libc::AF_IRDA, + /// Generic PPP transport layer, for setting up L2 tunnels (L2TP and PPPoE) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Pppox = libc::AF_PPPOX, + /// Legacy protocol for wide area network (WAN) connectivity that was used + /// by Sangoma WAN cards + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Wanpipe = libc::AF_WANPIPE, + /// Logical link control (IEEE 802.2 LLC) protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Llc = libc::AF_LLC, + /// InfiniBand native addressing + #[cfg(all(target_os = "linux", not(target_env = "uclibc")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ib = libc::AF_IB, + /// Multiprotocol Label Switching + #[cfg(all(target_os = "linux", not(target_env = "uclibc")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Mpls = libc::AF_MPLS, + /// Controller Area Network automotive bus protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Can = libc::AF_CAN, + /// TIPC, "cluster domain sockets" protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Tipc = libc::AF_TIPC, + /// Bluetooth low-level socket protocol + #[cfg(not(any(target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Bluetooth = libc::AF_BLUETOOTH, + /// IUCV (inter-user communication vehicle) z/VM protocol for + /// hypervisor-guest interaction + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Iucv = libc::AF_IUCV, + /// Rx, Andrew File System remote procedure call protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + RxRpc = libc::AF_RXRPC, + /// New "modular ISDN" driver interface protocol + #[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Isdn = libc::AF_ISDN, + /// Nokia cellular modem IPC/RPC interface + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Phonet = libc::AF_PHONET, + /// IEEE 802.15.4 WPAN (wireless personal area network) raw packet protocol + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ieee802154 = libc::AF_IEEE802154, + /// Ericsson's Communication CPU to Application CPU interface (CAIF) + /// protocol. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Caif = libc::AF_CAIF, + /// Interface to kernel crypto API + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Alg = libc::AF_ALG, + /// Near field communication + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + Nfc = libc::AF_NFC, + /// VMWare VSockets protocol for hypervisor-guest interaction. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Vsock = libc::AF_VSOCK, + /// ARPANet IMP addresses + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ImpLink = libc::AF_IMPLINK, + /// PUP protocols, e.g. BSP + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Pup = libc::AF_PUP, + /// MIT CHAOS protocols + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Chaos = libc::AF_CHAOS, + /// Novell and Xerox protocol + #[cfg(any(target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ns = libc::AF_NS, + #[allow(missing_docs)] // Not documented anywhere that I can find + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Iso = libc::AF_ISO, + /// Bell Labs virtual circuit switch ? + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Datakit = libc::AF_DATAKIT, + /// CCITT protocols, X.25 etc + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Ccitt = libc::AF_CCITT, + /// DEC Direct data link interface + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Dli = libc::AF_DLI, + #[allow(missing_docs)] // Not documented anywhere that I can find + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Lat = libc::AF_LAT, + /// NSC Hyperchannel + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Hylink = libc::AF_HYLINK, + /// Link layer interface + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Link = libc::AF_LINK, + /// connection-oriented IP, aka ST II + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Coip = libc::AF_COIP, + /// Computer Network Technology + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Cnt = libc::AF_CNT, + /// Native ATM access + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Natm = libc::AF_NATM, + /// Unspecified address family, (see [`getaddrinfo(3)`](https://man7.org/linux/man-pages/man3/getaddrinfo.3.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Unspec = libc::AF_UNSPEC, +} + +impl AddressFamily { + /// Create a new `AddressFamily` from an integer value retrieved from `libc`, usually from + /// the `sa_family` field of a `sockaddr`. + /// + /// Currently only supports these address families: Unix, Inet (v4 & v6), Netlink, Link/Packet + /// and System. Returns None for unsupported or unknown address families. + pub const fn from_i32(family: i32) -> Option { + match family { + libc::AF_UNIX => Some(AddressFamily::Unix), + libc::AF_INET => Some(AddressFamily::Inet), + libc::AF_INET6 => Some(AddressFamily::Inet6), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => Some(AddressFamily::Netlink), + #[cfg(any(target_os = "macos", target_os = "macos"))] + libc::AF_SYSTEM => Some(AddressFamily::System), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_PACKET => Some(AddressFamily::Packet), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + libc::AF_LINK => Some(AddressFamily::Link), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => Some(AddressFamily::Vsock), + _ => None + } + } +} + +feature! { +#![feature = "net"] + +#[deprecated( + since = "0.24.0", + note = "use SockaddrIn, SockaddrIn6, or SockaddrStorage instead" +)] +#[allow(missing_docs)] // Since they're all deprecated anyway +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum InetAddr { + V4(libc::sockaddr_in), + V6(libc::sockaddr_in6), +} + +#[allow(missing_docs)] // It's deprecated anyway +#[allow(deprecated)] +impl InetAddr { + #[allow(clippy::needless_update)] // It isn't needless on all OSes + pub fn from_std(std: &net::SocketAddr) -> InetAddr { + match *std { + net::SocketAddr::V4(ref addr) => { + InetAddr::V4(libc::sockaddr_in { + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "hermit", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + sin_len: mem::size_of::() as u8, + sin_family: AddressFamily::Inet as sa_family_t, + sin_port: addr.port().to_be(), // network byte order + sin_addr: Ipv4Addr::from_std(addr.ip()).0, + .. unsafe { mem::zeroed() } + }) + } + net::SocketAddr::V6(ref addr) => { + InetAddr::V6(libc::sockaddr_in6 { + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "hermit", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + sin6_len: mem::size_of::() as u8, + sin6_family: AddressFamily::Inet6 as sa_family_t, + sin6_port: addr.port().to_be(), // network byte order + sin6_addr: Ipv6Addr::from_std(addr.ip()).0, + sin6_flowinfo: addr.flowinfo(), // host byte order + sin6_scope_id: addr.scope_id(), // host byte order + .. unsafe { mem::zeroed() } + }) + } + } + } + + #[allow(clippy::needless_update)] // It isn't needless on all OSes + pub fn new(ip: IpAddr, port: u16) -> InetAddr { + match ip { + IpAddr::V4(ref ip) => { + InetAddr::V4(libc::sockaddr_in { + sin_family: AddressFamily::Inet as sa_family_t, + sin_port: port.to_be(), + sin_addr: ip.0, + .. unsafe { mem::zeroed() } + }) + } + IpAddr::V6(ref ip) => { + InetAddr::V6(libc::sockaddr_in6 { + sin6_family: AddressFamily::Inet6 as sa_family_t, + sin6_port: port.to_be(), + sin6_addr: ip.0, + .. unsafe { mem::zeroed() } + }) + } + } + } + /// Gets the IP address associated with this socket address. + pub const fn ip(&self) -> IpAddr { + match *self { + InetAddr::V4(ref sa) => IpAddr::V4(Ipv4Addr(sa.sin_addr)), + InetAddr::V6(ref sa) => IpAddr::V6(Ipv6Addr(sa.sin6_addr)), + } + } + + /// Gets the port number associated with this socket address + pub const fn port(&self) -> u16 { + match *self { + InetAddr::V6(ref sa) => u16::from_be(sa.sin6_port), + InetAddr::V4(ref sa) => u16::from_be(sa.sin_port), + } + } + + pub fn to_std(&self) -> net::SocketAddr { + match *self { + InetAddr::V4(ref sa) => net::SocketAddr::V4( + net::SocketAddrV4::new( + Ipv4Addr(sa.sin_addr).to_std(), + self.port())), + InetAddr::V6(ref sa) => net::SocketAddr::V6( + net::SocketAddrV6::new( + Ipv6Addr(sa.sin6_addr).to_std(), + self.port(), + sa.sin6_flowinfo, + sa.sin6_scope_id)), + } + } + + #[deprecated(since = "0.23.0", note = "use .to_string() instead")] + pub fn to_str(&self) -> String { + format!("{}", self) + } +} + +#[allow(deprecated)] +impl fmt::Display for InetAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + InetAddr::V4(_) => write!(f, "{}:{}", self.ip(), self.port()), + InetAddr::V6(_) => write!(f, "[{}]:{}", self.ip(), self.port()), + } + } +} + +/* + * + * ===== IpAddr ===== + * + */ +#[allow(missing_docs)] // Since they're all deprecated anyway +#[allow(deprecated)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[deprecated( + since = "0.24.0", + note = "Use std::net::IpAddr instead" +)] +pub enum IpAddr { + V4(Ipv4Addr), + V6(Ipv6Addr), +} + +#[allow(deprecated)] +#[allow(missing_docs)] // Since they're all deprecated anyway +impl IpAddr { + /// Create a new IpAddr that contains an IPv4 address. + /// + /// The result will represent the IP address a.b.c.d + pub const fn new_v4(a: u8, b: u8, c: u8, d: u8) -> IpAddr { + IpAddr::V4(Ipv4Addr::new(a, b, c, d)) + } + + /// Create a new IpAddr that contains an IPv6 address. + /// + /// The result will represent the IP address a:b:c:d:e:f + #[allow(clippy::many_single_char_names)] + #[allow(clippy::too_many_arguments)] + pub const fn new_v6(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> IpAddr { + IpAddr::V6(Ipv6Addr::new(a, b, c, d, e, f, g, h)) + } + + pub fn from_std(std: &net::IpAddr) -> IpAddr { + match *std { + net::IpAddr::V4(ref std) => IpAddr::V4(Ipv4Addr::from_std(std)), + net::IpAddr::V6(ref std) => IpAddr::V6(Ipv6Addr::from_std(std)), + } + } + + pub const fn to_std(&self) -> net::IpAddr { + match *self { + IpAddr::V4(ref ip) => net::IpAddr::V4(ip.to_std()), + IpAddr::V6(ref ip) => net::IpAddr::V6(ip.to_std()), + } + } +} + +#[allow(deprecated)] +impl fmt::Display for IpAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + IpAddr::V4(ref v4) => v4.fmt(f), + IpAddr::V6(ref v6) => v6.fmt(f) + } + } +} + +/* + * + * ===== Ipv4Addr ===== + * + */ + +#[deprecated( + since = "0.24.0", + note = "Use std::net::Ipv4Addr instead" +)] +#[allow(missing_docs)] // Since they're all deprecated anyway +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct Ipv4Addr(pub libc::in_addr); + +#[allow(deprecated)] +#[allow(missing_docs)] // Since they're all deprecated anyway +impl Ipv4Addr { + #[allow(clippy::identity_op)] // More readable this way + pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr { + let ip = (((a as u32) << 24) | + ((b as u32) << 16) | + ((c as u32) << 8) | + ((d as u32) << 0)).to_be(); + + Ipv4Addr(libc::in_addr { s_addr: ip }) + } + + // Use pass by reference for symmetry with Ipv6Addr::from_std + #[allow(clippy::trivially_copy_pass_by_ref)] + pub fn from_std(std: &net::Ipv4Addr) -> Ipv4Addr { + let bits = std.octets(); + Ipv4Addr::new(bits[0], bits[1], bits[2], bits[3]) + } + + pub const fn any() -> Ipv4Addr { + Ipv4Addr(libc::in_addr { s_addr: libc::INADDR_ANY }) + } + + pub const fn octets(self) -> [u8; 4] { + let bits = u32::from_be(self.0.s_addr); + [(bits >> 24) as u8, (bits >> 16) as u8, (bits >> 8) as u8, bits as u8] + } + + pub const fn to_std(self) -> net::Ipv4Addr { + let bits = self.octets(); + net::Ipv4Addr::new(bits[0], bits[1], bits[2], bits[3]) + } +} + +#[allow(deprecated)] +impl fmt::Display for Ipv4Addr { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + let octets = self.octets(); + write!(fmt, "{}.{}.{}.{}", octets[0], octets[1], octets[2], octets[3]) + } +} + +/* + * + * ===== Ipv6Addr ===== + * + */ + +#[deprecated( + since = "0.24.0", + note = "Use std::net::Ipv6Addr instead" +)] +#[allow(missing_docs)] // Since they're all deprecated anyway +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct Ipv6Addr(pub libc::in6_addr); + +// Note that IPv6 addresses are stored in big endian order on all architectures. +// See https://tools.ietf.org/html/rfc1700 or consult your favorite search +// engine. + +macro_rules! to_u8_array { + ($($num:ident),*) => { + [ $(($num>>8) as u8, ($num&0xff) as u8,)* ] + } +} + +macro_rules! to_u16_array { + ($slf:ident, $($first:expr, $second:expr),*) => { + [$( (($slf.0.s6_addr[$first] as u16) << 8) + $slf.0.s6_addr[$second] as u16,)*] + } +} + +#[allow(deprecated)] +#[allow(missing_docs)] // Since they're all deprecated anyway +impl Ipv6Addr { + #[allow(clippy::many_single_char_names)] + #[allow(clippy::too_many_arguments)] + pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr { + Ipv6Addr(libc::in6_addr{s6_addr: to_u8_array!(a,b,c,d,e,f,g,h)}) + } + + pub fn from_std(std: &net::Ipv6Addr) -> Ipv6Addr { + let s = std.segments(); + Ipv6Addr::new(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]) + } + + /// Return the eight 16-bit segments that make up this address + pub const fn segments(&self) -> [u16; 8] { + to_u16_array!(self, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) + } + + pub const fn to_std(&self) -> net::Ipv6Addr { + let s = self.segments(); + net::Ipv6Addr::new(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]) + } +} + +#[allow(deprecated)] +impl fmt::Display for Ipv6Addr { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + self.to_std().fmt(fmt) + } +} +} + +/// A wrapper around `sockaddr_un`. +#[derive(Clone, Copy, Debug)] +#[repr(C)] +pub struct UnixAddr { + // INVARIANT: sun & sun_len are valid as defined by docs for from_raw_parts + sun: libc::sockaddr_un, + /// The length of the valid part of `sun`, including the sun_family field + /// but excluding any trailing nul. + // On the BSDs, this field is built into sun + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux" + ))] + sun_len: u8 +} + +// linux man page unix(7) says there are 3 kinds of unix socket: +// pathname: addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1 +// unnamed: addrlen = sizeof(sa_family_t) +// abstract: addren > sizeof(sa_family_t), name = sun_path[..(addrlen - sizeof(sa_family_t))] +// +// what we call path_len = addrlen - offsetof(struct sockaddr_un, sun_path) +#[derive(PartialEq, Eq, Hash)] +enum UnixAddrKind<'a> { + Pathname(&'a Path), + Unnamed, + #[cfg(any(target_os = "android", target_os = "linux"))] + Abstract(&'a [u8]), +} +impl<'a> UnixAddrKind<'a> { + /// Safety: sun & sun_len must be valid + unsafe fn get(sun: &'a libc::sockaddr_un, sun_len: u8) -> Self { + assert!(sun_len as usize >= offset_of!(libc::sockaddr_un, sun_path)); + let path_len = sun_len as usize - offset_of!(libc::sockaddr_un, sun_path); + if path_len == 0 { + return Self::Unnamed; + } + #[cfg(any(target_os = "android", target_os = "linux"))] + if sun.sun_path[0] == 0 { + let name = + slice::from_raw_parts(sun.sun_path.as_ptr().add(1) as *const u8, path_len - 1); + return Self::Abstract(name); + } + let pathname = slice::from_raw_parts(sun.sun_path.as_ptr() as *const u8, path_len); + if pathname.last() == Some(&0) { + // A trailing NUL is not considered part of the path, and it does + // not need to be included in the addrlen passed to functions like + // bind(). However, Linux adds a trailing NUL, even if one was not + // originally present, when returning addrs from functions like + // getsockname() (the BSDs do not do that). So we need to filter + // out any trailing NUL here, so sockaddrs can round-trip through + // the kernel and still compare equal. + Self::Pathname(Path::new(OsStr::from_bytes(&pathname[0..pathname.len() - 1]))) + } else { + Self::Pathname(Path::new(OsStr::from_bytes(pathname))) + } + } +} + +impl UnixAddr { + /// Create a new sockaddr_un representing a filesystem path. + pub fn new(path: &P) -> Result { + path.with_nix_path(|cstr| { + unsafe { + let mut ret = libc::sockaddr_un { + sun_family: AddressFamily::Unix as sa_family_t, + .. mem::zeroed() + }; + + let bytes = cstr.to_bytes(); + + if bytes.len() >= ret.sun_path.len() { + return Err(Errno::ENAMETOOLONG); + } + + let sun_len = (bytes.len() + + offset_of!(libc::sockaddr_un, sun_path)).try_into() + .unwrap(); + + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + { + ret.sun_len = sun_len; + } + ptr::copy_nonoverlapping(bytes.as_ptr(), + ret.sun_path.as_mut_ptr() as *mut u8, + bytes.len()); + + Ok(UnixAddr::from_raw_parts(ret, sun_len)) + } + })? + } + + /// Create a new `sockaddr_un` representing an address in the "abstract namespace". + /// + /// The leading nul byte for the abstract namespace is automatically added; + /// thus the input `path` is expected to be the bare name, not NUL-prefixed. + /// This is a Linux-specific extension, primarily used to allow chrooted + /// processes to communicate with processes having a different filesystem view. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn new_abstract(path: &[u8]) -> Result { + unsafe { + let mut ret = libc::sockaddr_un { + sun_family: AddressFamily::Unix as sa_family_t, + .. mem::zeroed() + }; + + if path.len() >= ret.sun_path.len() { + return Err(Errno::ENAMETOOLONG); + } + let sun_len = (path.len() + + 1 + + offset_of!(libc::sockaddr_un, sun_path)).try_into() + .unwrap(); + + // Abstract addresses are represented by sun_path[0] == + // b'\0', so copy starting one byte in. + ptr::copy_nonoverlapping(path.as_ptr(), + ret.sun_path.as_mut_ptr().offset(1) as *mut u8, + path.len()); + + Ok(UnixAddr::from_raw_parts(ret, sun_len)) + } + } + + /// Create a UnixAddr from a raw `sockaddr_un` struct and a size. `sun_len` + /// is the size of the valid portion of the struct, excluding any trailing + /// NUL. + /// + /// # Safety + /// This pair of sockaddr_un & sun_len must be a valid unix addr, which + /// means: + /// - sun_len >= offset_of(sockaddr_un, sun_path) + /// - sun_len <= sockaddr_un.sun_path.len() - offset_of(sockaddr_un, sun_path) + /// - if this is a unix addr with a pathname, sun.sun_path is a + /// fs path, not necessarily nul-terminated. + pub(crate) unsafe fn from_raw_parts(sun: libc::sockaddr_un, sun_len: u8) -> UnixAddr { + cfg_if!{ + if #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux" + ))] + { + UnixAddr { sun, sun_len } + } else { + assert_eq!(sun_len, sun.sun_len); + UnixAddr {sun} + } + } + } + + fn kind(&self) -> UnixAddrKind<'_> { + // SAFETY: our sockaddr is always valid because of the invariant on the struct + unsafe { UnixAddrKind::get(&self.sun, self.sun_len()) } + } + + /// If this address represents a filesystem path, return that path. + pub fn path(&self) -> Option<&Path> { + match self.kind() { + UnixAddrKind::Pathname(path) => Some(path), + _ => None, + } + } + + /// If this address represents an abstract socket, return its name. + /// + /// For abstract sockets only the bare name is returned, without the + /// leading NUL byte. `None` is returned for unnamed or path-backed sockets. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn as_abstract(&self) -> Option<&[u8]> { + match self.kind() { + UnixAddrKind::Abstract(name) => Some(name), + _ => None, + } + } + + /// Returns the addrlen of this socket - `offsetof(struct sockaddr_un, sun_path)` + #[inline] + pub fn path_len(&self) -> usize { + self.sun_len() as usize - offset_of!(libc::sockaddr_un, sun_path) + } + /// Returns a pointer to the raw `sockaddr_un` struct + #[inline] + pub fn as_ptr(&self) -> *const libc::sockaddr_un { + &self.sun + } + /// Returns a mutable pointer to the raw `sockaddr_un` struct + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut libc::sockaddr_un { + &mut self.sun + } + + fn sun_len(&self)-> u8 { + cfg_if!{ + if #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux" + ))] + { + self.sun_len + } else { + self.sun.sun_len + } + } + } +} + +impl private::SockaddrLikePriv for UnixAddr {} +impl SockaddrLike for UnixAddr { + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux" + ))] + fn len(&self) -> libc::socklen_t { + self.sun_len.into() + } + + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if (l as usize) < offset_of!(libc::sockaddr_un, sun_path) || + l > u8::MAX as libc::socklen_t + { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_UNIX as i32 { + return None; + } + let mut su: libc::sockaddr_un = mem::zeroed(); + let sup = &mut su as *mut libc::sockaddr_un as *mut u8; + cfg_if!{ + if #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux" + ))] { + let su_len = len.unwrap_or( + mem::size_of::() as libc::socklen_t + ); + } else { + let su_len = len.unwrap_or((*addr).sa_len as libc::socklen_t); + } + }; + ptr::copy(addr as *const u8, sup, su_len as usize); + Some(Self::from_raw_parts(su, su_len as u8)) + } + + fn size() -> libc::socklen_t where Self: Sized { + mem::size_of::() as libc::socklen_t + } +} + +impl AsRef for UnixAddr { + fn as_ref(&self) -> &libc::sockaddr_un { + &self.sun + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn fmt_abstract(abs: &[u8], f: &mut fmt::Formatter) -> fmt::Result { + use fmt::Write; + f.write_str("@\"")?; + for &b in abs { + use fmt::Display; + char::from(b).escape_default().fmt(f)?; + } + f.write_char('"')?; + Ok(()) +} + +impl fmt::Display for UnixAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self.kind() { + UnixAddrKind::Pathname(path) => path.display().fmt(f), + UnixAddrKind::Unnamed => f.pad(""), + #[cfg(any(target_os = "android", target_os = "linux"))] + UnixAddrKind::Abstract(name) => fmt_abstract(name, f), + } + } +} + +impl PartialEq for UnixAddr { + fn eq(&self, other: &UnixAddr) -> bool { + self.kind() == other.kind() + } +} + +impl Eq for UnixAddr {} + +impl Hash for UnixAddr { + fn hash(&self, s: &mut H) { + self.kind().hash(s) + } +} + +/// Anything that, in C, can be cast back and forth to `sockaddr`. +/// +/// Most implementors also implement `AsRef` to access their +/// inner type read-only. +#[allow(clippy::len_without_is_empty)] +pub trait SockaddrLike: private::SockaddrLikePriv { + /// Returns a raw pointer to the inner structure. Useful for FFI. + fn as_ptr(&self) -> *const libc::sockaddr { + self as *const Self as *const libc::sockaddr + } + + /// Unsafe constructor from a variable length source + /// + /// Some C APIs from provide `len`, and others do not. If it's provided it + /// will be validated. If not, it will be guessed based on the family. + /// + /// # Arguments + /// + /// - `addr`: raw pointer to something that can be cast to a + /// `libc::sockaddr`. For example, `libc::sockaddr_in`, + /// `libc::sockaddr_in6`, etc. + /// - `len`: For fixed-width types like `sockaddr_in`, it will be + /// validated if present and ignored if not. For variable-width + /// types it is required and must be the total length of valid + /// data. For example, if `addr` points to a + /// named `sockaddr_un`, then `len` must be the length of the + /// structure up to but not including the trailing NUL. + /// + /// # Safety + /// + /// `addr` must be valid for the specific type of sockaddr. `len`, if + /// present, must not exceed the length of valid data in `addr`. + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized; + + /// Return the address family of this socket + /// + /// # Examples + /// One common use is to match on the family of a union type, like this: + /// ``` + /// # use nix::sys::socket::*; + /// let fd = socket(AddressFamily::Inet, SockType::Stream, + /// SockFlag::empty(), None).unwrap(); + /// let ss: SockaddrStorage = getsockname(fd).unwrap(); + /// match ss.family().unwrap() { + /// AddressFamily::Inet => println!("{}", ss.as_sockaddr_in().unwrap()), + /// AddressFamily::Inet6 => println!("{}", ss.as_sockaddr_in6().unwrap()), + /// _ => println!("Unexpected address family") + /// } + /// ``` + fn family(&self) -> Option { + // Safe since all implementors have a sa_family field at the same + // address, and they're all repr(C) + AddressFamily::from_i32( + unsafe { + (*(self as *const Self as *const libc::sockaddr)).sa_family as i32 + } + ) + } + + cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] { + /// Return the length of valid data in the sockaddr structure. + /// + /// For fixed-size sockaddrs, this should be the size of the + /// structure. But for variable-sized types like [`UnixAddr`] it + /// may be less. + fn len(&self) -> libc::socklen_t { + // Safe since all implementors have a sa_len field at the same + // address, and they're all repr(transparent). + // Robust for all implementors. + unsafe { + (*(self as *const Self as *const libc::sockaddr)).sa_len + }.into() + } + } else { + /// Return the length of valid data in the sockaddr structure. + /// + /// For fixed-size sockaddrs, this should be the size of the + /// structure. But for variable-sized types like [`UnixAddr`] it + /// may be less. + fn len(&self) -> libc::socklen_t { + // No robust default implementation is possible without an + // sa_len field. Implementors with a variable size must + // override this method. + mem::size_of_val(self) as libc::socklen_t + } + } + } + + /// Return the available space in the structure + fn size() -> libc::socklen_t where Self: Sized { + mem::size_of::() as libc::socklen_t + } +} + +impl private::SockaddrLikePriv for () { + fn as_mut_ptr(&mut self) -> *mut libc::sockaddr { + ptr::null_mut() + } +} + +/// `()` can be used in place of a real Sockaddr when no address is expected, +/// for example for a field of `Option where S: SockaddrLike`. +// If this RFC ever stabilizes, then ! will be a better choice. +// https://github.com/rust-lang/rust/issues/35121 +impl SockaddrLike for () { + fn as_ptr(&self) -> *const libc::sockaddr { + ptr::null() + } + + unsafe fn from_raw(_: *const libc::sockaddr, _: Option) + -> Option where Self: Sized + { + None + } + + fn family(&self) -> Option { + None + } + + fn len(&self) -> libc::socklen_t { + 0 + } +} + +/// An IPv4 socket address +// This is identical to net::SocketAddrV4. But the standard library +// doesn't allow direct access to the libc fields, which we need. So we +// reimplement it here. +#[cfg(feature = "net")] +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct SockaddrIn(libc::sockaddr_in); + +#[cfg(feature = "net")] +impl SockaddrIn { + /// Returns the IP address associated with this socket address, in native + /// endian. + pub const fn ip(&self) -> libc::in_addr_t { + u32::from_be(self.0.sin_addr.s_addr) + } + + /// Creates a new socket address from IPv4 octets and a port number. + pub fn new(a: u8, b: u8, c: u8, d: u8, port: u16) -> Self { + Self(libc::sockaddr_in { + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "haiku", + target_os = "openbsd"))] + sin_len: Self::size() as u8, + sin_family: AddressFamily::Inet as sa_family_t, + sin_port: u16::to_be(port), + sin_addr: libc::in_addr { + s_addr: u32::from_ne_bytes([a, b, c, d]) + }, + sin_zero: unsafe{mem::zeroed()} + }) + } + + /// Returns the port number associated with this socket address, in native + /// endian. + pub const fn port(&self) -> u16 { + u16::from_be(self.0.sin_port) + } +} + +#[cfg(feature = "net")] +impl private::SockaddrLikePriv for SockaddrIn {} +#[cfg(feature = "net")] +impl SockaddrLike for SockaddrIn { + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_INET as i32 { + return None; + } + Some(Self(ptr::read_unaligned(addr as *const _))) + } +} + +#[cfg(feature = "net")] +impl AsRef for SockaddrIn { + fn as_ref(&self) -> &libc::sockaddr_in { + &self.0 + } +} + +#[cfg(feature = "net")] +impl fmt::Display for SockaddrIn { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let ne = u32::from_be(self.0.sin_addr.s_addr); + let port = u16::from_be(self.0.sin_port); + write!(f, "{}.{}.{}.{}:{}", + ne >> 24, + (ne >> 16) & 0xFF, + (ne >> 8) & 0xFF, + ne & 0xFF, + port) + } +} + +#[cfg(feature = "net")] +impl From for SockaddrIn { + fn from(addr: net::SocketAddrV4) -> Self { + Self(libc::sockaddr_in{ + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "hermit", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + sin_len: mem::size_of::() as u8, + sin_family: AddressFamily::Inet as sa_family_t, + sin_port: addr.port().to_be(), // network byte order + sin_addr: ipv4addr_to_libc(*addr.ip()), + .. unsafe { mem::zeroed() } + }) + } +} + +#[cfg(feature = "net")] +impl From for net::SocketAddrV4 { + fn from(addr: SockaddrIn) -> Self { + net::SocketAddrV4::new( + net::Ipv4Addr::from(addr.0.sin_addr.s_addr.to_ne_bytes()), + u16::from_be(addr.0.sin_port) + ) + } +} + +#[cfg(feature = "net")] +impl std::str::FromStr for SockaddrIn { + type Err = net::AddrParseError; + + fn from_str(s: &str) -> std::result::Result { + net::SocketAddrV4::from_str(s).map(SockaddrIn::from) + } +} + +/// An IPv6 socket address +#[cfg(feature = "net")] +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct SockaddrIn6(libc::sockaddr_in6); + +#[cfg(feature = "net")] +impl SockaddrIn6 { + /// Returns the flow information associated with this address. + pub const fn flowinfo(&self) -> u32 { + self.0.sin6_flowinfo + } + + /// Returns the IP address associated with this socket address. + pub fn ip(&self) -> net::Ipv6Addr { + net::Ipv6Addr::from(self.0.sin6_addr.s6_addr) + } + + /// Returns the port number associated with this socket address, in native + /// endian. + pub const fn port(&self) -> u16 { + u16::from_be(self.0.sin6_port) + } + + /// Returns the scope ID associated with this address. + pub const fn scope_id(&self) -> u32 { + self.0.sin6_scope_id + } +} + +#[cfg(feature = "net")] +impl private::SockaddrLikePriv for SockaddrIn6 {} +#[cfg(feature = "net")] +impl SockaddrLike for SockaddrIn6 { + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_INET6 as i32 { + return None; + } + Some(Self(ptr::read_unaligned(addr as *const _))) + } +} + +#[cfg(feature = "net")] +impl AsRef for SockaddrIn6 { + fn as_ref(&self) -> &libc::sockaddr_in6 { + &self.0 + } +} + +#[cfg(feature = "net")] +impl fmt::Display for SockaddrIn6 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + // These things are really hard to display properly. Easier to let std + // do it. + let std = net::SocketAddrV6::new(self.ip(), self.port(), + self.flowinfo(), self.scope_id()); + std.fmt(f) + } +} + +#[cfg(feature = "net")] +impl From for SockaddrIn6 { + fn from(addr: net::SocketAddrV6) -> Self { + #[allow(clippy::needless_update)] // It isn't needless on Illumos + Self(libc::sockaddr_in6{ + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "hermit", + target_os = "ios", target_os = "macos", + target_os = "netbsd", target_os = "openbsd"))] + sin6_len: mem::size_of::() as u8, + sin6_family: AddressFamily::Inet6 as sa_family_t, + sin6_port: addr.port().to_be(), // network byte order + sin6_addr: ipv6addr_to_libc(addr.ip()), + sin6_flowinfo: addr.flowinfo(), // host byte order + sin6_scope_id: addr.scope_id(), // host byte order + .. unsafe { mem::zeroed() } + }) + } +} + +#[cfg(feature = "net")] +impl From for net::SocketAddrV6 { + fn from(addr: SockaddrIn6) -> Self { + net::SocketAddrV6::new( + net::Ipv6Addr::from(addr.0.sin6_addr.s6_addr), + u16::from_be(addr.0.sin6_port), + u32::from_be(addr.0.sin6_flowinfo), + u32::from_be(addr.0.sin6_scope_id) + ) + } +} + +#[cfg(feature = "net")] +impl std::str::FromStr for SockaddrIn6 { + type Err = net::AddrParseError; + + fn from_str(s: &str) -> std::result::Result { + net::SocketAddrV6::from_str(s).map(SockaddrIn6::from) + } +} + + +/// A container for any sockaddr type +/// +/// Just like C's `sockaddr_storage`, this type is large enough to hold any type +/// of sockaddr. It can be used as an argument with functions like +/// [`bind`](super::bind) and [`getsockname`](super::getsockname). Though it is +/// a union, it can be safely accessed through the `as_*` methods. +/// +/// # Example +/// ``` +/// # use nix::sys::socket::*; +/// # use std::str::FromStr; +/// let localhost = SockaddrIn::from_str("127.0.0.1:8081").unwrap(); +/// let fd = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), +/// None).unwrap(); +/// bind(fd, &localhost).expect("bind"); +/// let ss: SockaddrStorage = getsockname(fd).expect("getsockname"); +/// assert_eq!(&localhost, ss.as_sockaddr_in().unwrap()); +/// ``` +#[derive(Clone, Copy, Eq)] +#[repr(C)] +pub union SockaddrStorage { + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + alg: AlgAddr, + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + dl: LinkAddr, + #[cfg(any(target_os = "android", target_os = "linux"))] + nl: NetlinkAddr, + #[cfg(all(feature = "ioctl", any(target_os = "ios", target_os = "macos")))] + #[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] + sctl: SysControlAddr, + #[cfg(feature = "net")] + sin: SockaddrIn, + #[cfg(feature = "net")] + sin6: SockaddrIn6, + ss: libc::sockaddr_storage, + su: UnixAddr, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + vsock: VsockAddr +} +impl private::SockaddrLikePriv for SockaddrStorage {} +impl SockaddrLike for SockaddrStorage { + unsafe fn from_raw(addr: *const libc::sockaddr, l: Option) + -> Option where Self: Sized + { + if addr.is_null() { + return None; + } + if let Some(len) = l { + let ulen = len as usize; + if ulen < offset_of!(libc::sockaddr, sa_data) || + ulen > mem::size_of::() { + None + } else{ + let mut ss: libc::sockaddr_storage = mem::zeroed(); + let ssp = &mut ss as *mut libc::sockaddr_storage as *mut u8; + ptr::copy(addr as *const u8, ssp, len as usize); + Some(Self{ss}) + } + } else { + // If length is not available and addr is of a fixed-length type, + // copy it. If addr is of a variable length type and len is not + // available, then there's nothing we can do. + match (*addr).sa_family as i32 { + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_ALG => AlgAddr::from_raw(addr, l) + .map(|alg| Self { alg}), + #[cfg(feature = "net")] + libc::AF_INET => SockaddrIn::from_raw(addr, l) + .map(|sin| Self{ sin}), + #[cfg(feature = "net")] + libc::AF_INET6 => SockaddrIn6::from_raw(addr, l) + .map(|sin6| Self{ sin6}), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "haiku", + target_os = "openbsd"))] + #[cfg(feature = "net")] + libc::AF_LINK => LinkAddr::from_raw(addr, l) + .map(|dl| Self{ dl}), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => NetlinkAddr::from_raw(addr, l) + .map(|nl| Self{ nl }), + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg(feature = "net")] + libc::AF_PACKET => LinkAddr::from_raw(addr, l) + .map(|dl| Self{ dl}), + #[cfg(all(feature = "ioctl", + any(target_os = "ios", target_os = "macos")))] + libc::AF_SYSTEM => SysControlAddr::from_raw(addr, l) + .map(|sctl| Self {sctl}), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => VsockAddr::from_raw(addr, l) + .map(|vsock| Self{vsock}), + _ => None + } + } + } +} + +macro_rules! accessors { + ( + $fname:ident, + $fname_mut:ident, + $sockty:ty, + $family:expr, + $libc_ty:ty, + $field:ident) => + { + /// Safely and falliably downcast to an immutable reference + pub fn $fname(&self) -> Option<&$sockty> { + if self.family() == Some($family) && + self.len() >= mem::size_of::<$libc_ty>() as libc::socklen_t + { + // Safe because family and len are validated + Some(unsafe{&self.$field}) + } else { + None + } + } + + /// Safely and falliably downcast to a mutable reference + pub fn $fname_mut(&mut self) -> Option<&mut $sockty> { + if self.family() == Some($family) && + self.len() >= mem::size_of::<$libc_ty>() as libc::socklen_t + { + // Safe because family and len are validated + Some(unsafe{&mut self.$field}) + } else { + None + } + } + } +} + +impl SockaddrStorage { + #[cfg(any(target_os = "android", target_os = "linux"))] + accessors!{as_alg_addr, as_alg_addr_mut, AlgAddr, + AddressFamily::Alg, libc::sockaddr_alg, alg} + + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "linux"))] + #[cfg(feature = "net")] + accessors!{ + as_link_addr, as_link_addr_mut, LinkAddr, + AddressFamily::Packet, libc::sockaddr_ll, dl} + + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + accessors!{ + as_link_addr, as_link_addr_mut, LinkAddr, + AddressFamily::Link, libc::sockaddr_dl, dl} + + #[cfg(feature = "net")] + accessors!{ + as_sockaddr_in, as_sockaddr_in_mut, SockaddrIn, + AddressFamily::Inet, libc::sockaddr_in, sin} + + #[cfg(feature = "net")] + accessors!{ + as_sockaddr_in6, as_sockaddr_in6_mut, SockaddrIn6, + AddressFamily::Inet6, libc::sockaddr_in6, sin6} + + #[cfg(any(target_os = "android", target_os = "linux"))] + accessors!{as_netlink_addr, as_netlink_addr_mut, NetlinkAddr, + AddressFamily::Netlink, libc::sockaddr_nl, nl} + + #[cfg(all(feature = "ioctl", any(target_os = "ios", target_os = "macos")))] + #[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] + accessors!{as_sys_control_addr, as_sys_control_addr_mut, SysControlAddr, + AddressFamily::System, libc::sockaddr_ctl, sctl} + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + accessors!{as_vsock_addr, as_vsock_addr_mut, VsockAddr, + AddressFamily::Vsock, libc::sockaddr_vm, vsock} +} + +impl fmt::Debug for SockaddrStorage { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("SockaddrStorage") + // Safe because sockaddr_storage has the least specific + // field types + .field("ss", unsafe{&self.ss}) + .finish() + } +} + +impl fmt::Display for SockaddrStorage { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + unsafe { + match self.ss.ss_family as i32 { + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_ALG => self.alg.fmt(f), + #[cfg(feature = "net")] + libc::AF_INET => self.sin.fmt(f), + #[cfg(feature = "net")] + libc::AF_INET6 => self.sin6.fmt(f), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + libc::AF_LINK => self.dl.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => self.nl.fmt(f), + #[cfg(any(target_os = "android", + target_os = "linux", + target_os = "fuchsia" + ))] + #[cfg(feature = "net")] + libc::AF_PACKET => self.dl.fmt(f), + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg(feature = "ioctl")] + libc::AF_SYSTEM => self.sctl.fmt(f), + libc::AF_UNIX => self.su.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => self.vsock.fmt(f), + _ => "

".fmt(f) + } + } + } +} + +#[cfg(feature = "net")] +impl From for SockaddrStorage { + fn from(s: net::SocketAddrV4) -> Self { + unsafe { + let mut ss: Self = mem::zeroed(); + ss.sin = SockaddrIn::from(s); + ss + } + } +} + +#[cfg(feature = "net")] +impl From for SockaddrStorage { + fn from(s: net::SocketAddrV6) -> Self { + unsafe { + let mut ss: Self = mem::zeroed(); + ss.sin6 = SockaddrIn6::from(s); + ss + } + } +} + +#[cfg(feature = "net")] +impl From for SockaddrStorage { + fn from(s: net::SocketAddr) -> Self { + match s { + net::SocketAddr::V4(sa4) => Self::from(sa4), + net::SocketAddr::V6(sa6) => Self::from(sa6), + } + } +} + +impl Hash for SockaddrStorage { + fn hash(&self, s: &mut H) { + unsafe { + match self.ss.ss_family as i32 { + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_ALG => self.alg.hash(s), + #[cfg(feature = "net")] + libc::AF_INET => self.sin.hash(s), + #[cfg(feature = "net")] + libc::AF_INET6 => self.sin6.hash(s), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + libc::AF_LINK => self.dl.hash(s), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => self.nl.hash(s), + #[cfg(any(target_os = "android", + target_os = "linux", + target_os = "fuchsia" + ))] + #[cfg(feature = "net")] + libc::AF_PACKET => self.dl.hash(s), + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg(feature = "ioctl")] + libc::AF_SYSTEM => self.sctl.hash(s), + libc::AF_UNIX => self.su.hash(s), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => self.vsock.hash(s), + _ => self.ss.hash(s) + } + } + } +} + +impl PartialEq for SockaddrStorage { + fn eq(&self, other: &Self) -> bool { + unsafe { + match (self.ss.ss_family as i32, other.ss.ss_family as i32) { + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::AF_ALG, libc::AF_ALG) => self.alg == other.alg, + #[cfg(feature = "net")] + (libc::AF_INET, libc::AF_INET) => self.sin == other.sin, + #[cfg(feature = "net")] + (libc::AF_INET6, libc::AF_INET6) => self.sin6 == other.sin6, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + (libc::AF_LINK, libc::AF_LINK) => self.dl == other.dl, + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::AF_NETLINK, libc::AF_NETLINK) => self.nl == other.nl, + #[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg(feature = "net")] + (libc::AF_PACKET, libc::AF_PACKET) => self.dl == other.dl, + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg(feature = "ioctl")] + (libc::AF_SYSTEM, libc::AF_SYSTEM) => self.sctl == other.sctl, + (libc::AF_UNIX, libc::AF_UNIX) => self.su == other.su, + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::AF_VSOCK, libc::AF_VSOCK) => self.vsock == other.vsock, + _ => false, + } + } + } +} + +mod private { + pub trait SockaddrLikePriv { + /// Returns a mutable raw pointer to the inner structure. + /// + /// # Safety + /// + /// This method is technically safe, but modifying the inner structure's + /// `family` or `len` fields may result in violating Nix's invariants. + /// It is best to use this method only with foreign functions that do + /// not change the sockaddr type. + fn as_mut_ptr(&mut self) -> *mut libc::sockaddr { + self as *mut Self as *mut libc::sockaddr + } + } +} + +/// Represents a socket address +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[deprecated( + since = "0.24.0", + note = "use SockaddrLike or SockaddrStorage instead" +)] +#[allow(missing_docs)] // Since they're all deprecated anyway +#[allow(deprecated)] +#[non_exhaustive] +pub enum SockAddr { + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Inet(InetAddr), + Unix(UnixAddr), + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Netlink(NetlinkAddr), + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Alg(AlgAddr), + #[cfg(all(feature = "ioctl", any(target_os = "ios", target_os = "macos")))] + #[cfg_attr(docsrs, doc(cfg(feature = "ioctl")))] + SysControl(SysControlAddr), + /// Datalink address (MAC) + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Link(LinkAddr), + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + Vsock(VsockAddr), +} + +#[allow(missing_docs)] // Since they're all deprecated anyway +#[allow(deprecated)] +impl SockAddr { + feature! { + #![feature = "net"] + pub fn new_inet(addr: InetAddr) -> SockAddr { + SockAddr::Inet(addr) + } + } + + pub fn new_unix(path: &P) -> Result { + Ok(SockAddr::Unix(UnixAddr::new(path)?)) + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn new_netlink(pid: u32, groups: u32) -> SockAddr { + SockAddr::Netlink(NetlinkAddr::new(pid, groups)) + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn new_alg(alg_type: &str, alg_name: &str) -> SockAddr { + SockAddr::Alg(AlgAddr::new(alg_type, alg_name)) + } + + feature! { + #![feature = "ioctl"] + #[cfg(any(target_os = "ios", target_os = "macos"))] + pub fn new_sys_control(sockfd: RawFd, name: &str, unit: u32) -> Result { + SysControlAddr::from_name(sockfd, name, unit).map(SockAddr::SysControl) + } + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn new_vsock(cid: u32, port: u32) -> SockAddr { + SockAddr::Vsock(VsockAddr::new(cid, port)) + } + + pub fn family(&self) -> AddressFamily { + match *self { + #[cfg(feature = "net")] + SockAddr::Inet(InetAddr::V4(..)) => AddressFamily::Inet, + #[cfg(feature = "net")] + SockAddr::Inet(InetAddr::V6(..)) => AddressFamily::Inet6, + SockAddr::Unix(..) => AddressFamily::Unix, + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Netlink(..) => AddressFamily::Netlink, + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Alg(..) => AddressFamily::Alg, + #[cfg(all(feature = "ioctl", + any(target_os = "ios", target_os = "macos")))] + SockAddr::SysControl(..) => AddressFamily::System, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + SockAddr::Link(..) => AddressFamily::Packet, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + #[cfg(feature = "net")] + SockAddr::Link(..) => AddressFamily::Link, + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Vsock(..) => AddressFamily::Vsock, + } + } + + #[deprecated(since = "0.23.0", note = "use .to_string() instead")] + pub fn to_str(&self) -> String { + format!("{}", self) + } + + /// Creates a `SockAddr` struct from libc's sockaddr. + /// + /// Supports only the following address families: Unix, Inet (v4 & v6), Netlink and System. + /// Returns None for unsupported families. + /// + /// # Safety + /// + /// unsafe because it takes a raw pointer as argument. The caller must + /// ensure that the pointer is valid. + #[cfg(not(target_os = "fuchsia"))] + #[cfg(feature = "net")] + pub(crate) unsafe fn from_libc_sockaddr(addr: *const libc::sockaddr) -> Option { + if addr.is_null() { + None + } else { + match AddressFamily::from_i32(i32::from((*addr).sa_family)) { + Some(AddressFamily::Unix) => None, + #[cfg(feature = "net")] + Some(AddressFamily::Inet) => Some(SockAddr::Inet( + InetAddr::V4(ptr::read_unaligned(addr as *const _)))), + #[cfg(feature = "net")] + Some(AddressFamily::Inet6) => Some(SockAddr::Inet( + InetAddr::V6(ptr::read_unaligned(addr as *const _)))), + #[cfg(any(target_os = "android", target_os = "linux"))] + Some(AddressFamily::Netlink) => Some(SockAddr::Netlink( + NetlinkAddr(ptr::read_unaligned(addr as *const _)))), + #[cfg(all(feature = "ioctl", + any(target_os = "ios", target_os = "macos")))] + Some(AddressFamily::System) => Some(SockAddr::SysControl( + SysControlAddr(ptr::read_unaligned(addr as *const _)))), + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + Some(AddressFamily::Packet) => Some(SockAddr::Link( + LinkAddr(ptr::read_unaligned(addr as *const _)))), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + #[cfg(feature = "net")] + Some(AddressFamily::Link) => { + let ether_addr = LinkAddr(ptr::read_unaligned(addr as *const _)); + if ether_addr.is_empty() { + None + } else { + Some(SockAddr::Link(ether_addr)) + } + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + Some(AddressFamily::Vsock) => Some(SockAddr::Vsock( + VsockAddr(ptr::read_unaligned(addr as *const _)))), + // Other address families are currently not supported and simply yield a None + // entry instead of a proper conversion to a `SockAddr`. + Some(_) | None => None, + } + } + } + + /// Conversion from nix's SockAddr type to the underlying libc sockaddr type. + /// + /// This is useful for interfacing with other libc functions that don't yet have nix wrappers. + /// Returns a reference to the underlying data type (as a sockaddr reference) along + /// with the size of the actual data type. sockaddr is commonly used as a proxy for + /// a superclass as C doesn't support inheritance, so many functions that take + /// a sockaddr * need to take the size of the underlying type as well and then internally cast it back. + pub fn as_ffi_pair(&self) -> (&libc::sockaddr, libc::socklen_t) { + match *self { + #[cfg(feature = "net")] + SockAddr::Inet(InetAddr::V4(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_in as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + #[cfg(feature = "net")] + SockAddr::Inet(InetAddr::V6(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_in6 as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + SockAddr::Unix(ref unix_addr) => ( + // This cast is always allowed in C + unsafe { + &*(&unix_addr.sun as *const libc::sockaddr_un as *const libc::sockaddr) + }, + unix_addr.sun_len() as libc::socklen_t + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Netlink(NetlinkAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_nl as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Alg(AlgAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_alg as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + ), + #[cfg(all(feature = "ioctl", + any(target_os = "ios", target_os = "macos")))] + SockAddr::SysControl(SysControlAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_ctl as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + SockAddr::Link(LinkAddr(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_ll as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg(feature = "net")] + SockAddr::Link(LinkAddr(ref addr)) => ( + // This cast is always allowed in C + unsafe { + &*(addr as *const libc::sockaddr_dl as *const libc::sockaddr) + }, + mem::size_of_val(addr) as libc::socklen_t + ), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Vsock(VsockAddr(ref sa)) => ( + // This cast is always allowed in C + unsafe { + &*(sa as *const libc::sockaddr_vm as *const libc::sockaddr) + }, + mem::size_of_val(sa) as libc::socklen_t + ), + } + } +} + +#[allow(deprecated)] +impl fmt::Display for SockAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + #[cfg(feature = "net")] + SockAddr::Inet(ref inet) => inet.fmt(f), + SockAddr::Unix(ref unix) => unix.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Netlink(ref nl) => nl.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Alg(ref nl) => nl.fmt(f), + #[cfg(all(feature = "ioctl", + any(target_os = "ios", target_os = "macos")))] + SockAddr::SysControl(ref sc) => sc.fmt(f), + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] + #[cfg(feature = "net")] + SockAddr::Link(ref ether_addr) => ether_addr.fmt(f), + #[cfg(any(target_os = "android", target_os = "linux"))] + SockAddr::Vsock(ref svm) => svm.fmt(f), + } + } +} + +#[cfg(not(target_os = "fuchsia"))] +#[cfg(feature = "net")] +#[allow(deprecated)] +impl private::SockaddrLikePriv for SockAddr {} +#[cfg(not(target_os = "fuchsia"))] +#[cfg(feature = "net")] +#[allow(deprecated)] +impl SockaddrLike for SockAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, _len: Option) + -> Option + { + Self::from_libc_sockaddr(addr) + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub mod netlink { + use crate::sys::socket::addr::AddressFamily; + use libc::{sa_family_t, sockaddr_nl}; + use std::{fmt, mem}; + use super::*; + + /// Address for the Linux kernel user interface device. + /// + /// # References + /// + /// [netlink(7)](https://man7.org/linux/man-pages/man7/netlink.7.html) + #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] + #[repr(transparent)] + pub struct NetlinkAddr(pub(in super::super) sockaddr_nl); + + impl NetlinkAddr { + /// Construct a new socket address from its port ID and multicast groups + /// mask. + pub fn new(pid: u32, groups: u32) -> NetlinkAddr { + let mut addr: sockaddr_nl = unsafe { mem::zeroed() }; + addr.nl_family = AddressFamily::Netlink as sa_family_t; + addr.nl_pid = pid; + addr.nl_groups = groups; + + NetlinkAddr(addr) + } + + /// Return the socket's port ID. + pub const fn pid(&self) -> u32 { + self.0.nl_pid + } + + /// Return the socket's multicast groups mask + pub const fn groups(&self) -> u32 { + self.0.nl_groups + } + } + + impl private::SockaddrLikePriv for NetlinkAddr {} + impl SockaddrLike for NetlinkAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_NETLINK as i32 { + return None; + } + Some(Self(ptr::read_unaligned(addr as *const _))) + } + } + + impl AsRef for NetlinkAddr { + fn as_ref(&self) -> &libc::sockaddr_nl { + &self.0 + } + } + + impl fmt::Display for NetlinkAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "pid: {} groups: {}", self.pid(), self.groups()) + } + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub mod alg { + use libc::{AF_ALG, sockaddr_alg, c_char}; + use std::{fmt, mem, str}; + use std::hash::{Hash, Hasher}; + use std::ffi::CStr; + use super::*; + + /// Socket address for the Linux kernel crypto API + #[derive(Copy, Clone)] + #[repr(transparent)] + pub struct AlgAddr(pub(in super::super) sockaddr_alg); + + impl private::SockaddrLikePriv for AlgAddr {} + impl SockaddrLike for AlgAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, l: Option) + -> Option where Self: Sized + { + if let Some(l) = l { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_ALG as i32 { + return None; + } + Some(Self(ptr::read_unaligned(addr as *const _))) + } + } + + impl AsRef for AlgAddr { + fn as_ref(&self) -> &libc::sockaddr_alg { + &self.0 + } + } + + // , PartialEq, Eq, Debug, Hash + impl PartialEq for AlgAddr { + fn eq(&self, other: &Self) -> bool { + let (inner, other) = (self.0, other.0); + (inner.salg_family, &inner.salg_type[..], inner.salg_feat, inner.salg_mask, &inner.salg_name[..]) == + (other.salg_family, &other.salg_type[..], other.salg_feat, other.salg_mask, &other.salg_name[..]) + } + } + + impl Eq for AlgAddr {} + + impl Hash for AlgAddr { + fn hash(&self, s: &mut H) { + let inner = self.0; + (inner.salg_family, &inner.salg_type[..], inner.salg_feat, inner.salg_mask, &inner.salg_name[..]).hash(s); + } + } + + impl AlgAddr { + /// Construct an `AF_ALG` socket from its cipher name and type. + pub fn new(alg_type: &str, alg_name: &str) -> AlgAddr { + let mut addr: sockaddr_alg = unsafe { mem::zeroed() }; + addr.salg_family = AF_ALG as u16; + addr.salg_type[..alg_type.len()].copy_from_slice(alg_type.to_string().as_bytes()); + addr.salg_name[..alg_name.len()].copy_from_slice(alg_name.to_string().as_bytes()); + + AlgAddr(addr) + } + + + /// Return the socket's cipher type, for example `hash` or `aead`. + pub fn alg_type(&self) -> &CStr { + unsafe { CStr::from_ptr(self.0.salg_type.as_ptr() as *const c_char) } + } + + /// Return the socket's cipher name, for example `sha1`. + pub fn alg_name(&self) -> &CStr { + unsafe { CStr::from_ptr(self.0.salg_name.as_ptr() as *const c_char) } + } + } + + impl fmt::Display for AlgAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "type: {} alg: {}", + self.alg_name().to_string_lossy(), + self.alg_type().to_string_lossy()) + } + } + + impl fmt::Debug for AlgAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(self, f) + } + } +} + +feature! { +#![feature = "ioctl"] +#[cfg(any(target_os = "ios", target_os = "macos"))] +pub mod sys_control { + use crate::sys::socket::addr::AddressFamily; + use libc::{self, c_uchar}; + use std::{fmt, mem, ptr}; + use std::os::unix::io::RawFd; + use crate::{Errno, Result}; + use super::{private, SockaddrLike}; + + // FIXME: Move type into `libc` + #[repr(C)] + #[derive(Clone, Copy)] + #[allow(missing_debug_implementations)] + pub struct ctl_ioc_info { + pub ctl_id: u32, + pub ctl_name: [c_uchar; MAX_KCTL_NAME], + } + + const CTL_IOC_MAGIC: u8 = b'N'; + const CTL_IOC_INFO: u8 = 3; + const MAX_KCTL_NAME: usize = 96; + + ioctl_readwrite!(ctl_info, CTL_IOC_MAGIC, CTL_IOC_INFO, ctl_ioc_info); + + /// Apple system control socket + /// + /// # References + /// + /// https://developer.apple.com/documentation/kernel/sockaddr_ctl + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + #[repr(transparent)] + pub struct SysControlAddr(pub(in super::super) libc::sockaddr_ctl); + + impl private::SockaddrLikePriv for SysControlAddr {} + impl SockaddrLike for SysControlAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_SYSTEM as i32 { + return None; + } + Some(Self(ptr::read_unaligned(addr as *const _))) + } + } + + impl AsRef for SysControlAddr { + fn as_ref(&self) -> &libc::sockaddr_ctl { + &self.0 + } + } + + impl SysControlAddr { + /// Construct a new `SysControlAddr` from its kernel unique identifier + /// and unit number. + pub const fn new(id: u32, unit: u32) -> SysControlAddr { + let addr = libc::sockaddr_ctl { + sc_len: mem::size_of::() as c_uchar, + sc_family: AddressFamily::System as c_uchar, + ss_sysaddr: libc::AF_SYS_CONTROL as u16, + sc_id: id, + sc_unit: unit, + sc_reserved: [0; 5] + }; + + SysControlAddr(addr) + } + + /// Construct a new `SysControlAddr` from its human readable name and + /// unit number. + pub fn from_name(sockfd: RawFd, name: &str, unit: u32) -> Result { + if name.len() > MAX_KCTL_NAME { + return Err(Errno::ENAMETOOLONG); + } + + let mut ctl_name = [0; MAX_KCTL_NAME]; + ctl_name[..name.len()].clone_from_slice(name.as_bytes()); + let mut info = ctl_ioc_info { ctl_id: 0, ctl_name }; + + unsafe { ctl_info(sockfd, &mut info)?; } + + Ok(SysControlAddr::new(info.ctl_id, unit)) + } + + /// Return the kernel unique identifier + pub const fn id(&self) -> u32 { + self.0.sc_id + } + + /// Return the kernel controller private unit number. + pub const fn unit(&self) -> u32 { + self.0.sc_unit + } + } + + impl fmt::Display for SysControlAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Debug::fmt(self, f) + } + } +} +} + + +#[cfg(any(target_os = "android", target_os = "linux", target_os = "fuchsia"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod datalink { + feature! { + #![feature = "net"] + use super::{fmt, mem, private, ptr, SockaddrLike}; + + /// Hardware Address + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + #[repr(transparent)] + pub struct LinkAddr(pub(in super::super) libc::sockaddr_ll); + + impl LinkAddr { + /// Physical-layer protocol + pub fn protocol(&self) -> u16 { + self.0.sll_protocol + } + + /// Interface number + pub fn ifindex(&self) -> usize { + self.0.sll_ifindex as usize + } + + /// ARP hardware type + pub fn hatype(&self) -> u16 { + self.0.sll_hatype + } + + /// Packet type + pub fn pkttype(&self) -> u8 { + self.0.sll_pkttype + } + + /// Length of MAC address + pub fn halen(&self) -> usize { + self.0.sll_halen as usize + } + + /// Physical-layer address (MAC) + // Returns an Option just for cross-platform compatibility + pub fn addr(&self) -> Option<[u8; 6]> { + Some([ + self.0.sll_addr[0] as u8, + self.0.sll_addr[1] as u8, + self.0.sll_addr[2] as u8, + self.0.sll_addr[3] as u8, + self.0.sll_addr[4] as u8, + self.0.sll_addr[5] as u8, + ]) + } + } + + impl fmt::Display for LinkAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if let Some(addr) = self.addr() { + write!(f, "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}", + addr[0], + addr[1], + addr[2], + addr[3], + addr[4], + addr[5]) + } else { + Ok(()) + } + } + } + impl private::SockaddrLikePriv for LinkAddr {} + impl SockaddrLike for LinkAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, + len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_PACKET as i32 { + return None; + } + Some(Self(ptr::read_unaligned(addr as *const _))) + } + } + + impl AsRef for LinkAddr { + fn as_ref(&self) -> &libc::sockaddr_ll { + &self.0 + } + } + + } +} + +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "illumos", + target_os = "netbsd", + target_os = "haiku", + target_os = "openbsd"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +mod datalink { + feature! { + #![feature = "net"] + use super::{fmt, mem, private, ptr, SockaddrLike}; + + /// Hardware Address + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + #[repr(transparent)] + pub struct LinkAddr(pub(in super::super) libc::sockaddr_dl); + + impl LinkAddr { + /// interface index, if != 0, system given index for interface + #[cfg(not(target_os = "haiku"))] + pub fn ifindex(&self) -> usize { + self.0.sdl_index as usize + } + + /// Datalink type + #[cfg(not(target_os = "haiku"))] + pub fn datalink_type(&self) -> u8 { + self.0.sdl_type + } + + /// MAC address start position + pub fn nlen(&self) -> usize { + self.0.sdl_nlen as usize + } + + /// link level address length + pub fn alen(&self) -> usize { + self.0.sdl_alen as usize + } + + /// link layer selector length + #[cfg(not(target_os = "haiku"))] + pub fn slen(&self) -> usize { + self.0.sdl_slen as usize + } + + /// if link level address length == 0, + /// or `sdl_data` not be larger. + pub fn is_empty(&self) -> bool { + let nlen = self.nlen(); + let alen = self.alen(); + let data_len = self.0.sdl_data.len(); + + alen == 0 || nlen + alen >= data_len + } + + /// Physical-layer address (MAC) + pub fn addr(&self) -> Option<[u8; 6]> { + let nlen = self.nlen(); + let data = self.0.sdl_data; + + if self.is_empty() { + None + } else { + Some([ + data[nlen] as u8, + data[nlen + 1] as u8, + data[nlen + 2] as u8, + data[nlen + 3] as u8, + data[nlen + 4] as u8, + data[nlen + 5] as u8, + ]) + } + } + } + + impl fmt::Display for LinkAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if let Some(addr) = self.addr() { + write!(f, "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}", + addr[0], + addr[1], + addr[2], + addr[3], + addr[4], + addr[5]) + } else { + Ok(()) + } + } + } + impl private::SockaddrLikePriv for LinkAddr {} + impl SockaddrLike for LinkAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, + len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_LINK as i32 { + return None; + } + Some(Self(ptr::read_unaligned(addr as *const _))) + } + } + + impl AsRef for LinkAddr { + fn as_ref(&self) -> &libc::sockaddr_dl { + &self.0 + } + } + + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub mod vsock { + use crate::sys::socket::addr::AddressFamily; + use libc::{sa_family_t, sockaddr_vm}; + use std::{fmt, mem}; + use std::hash::{Hash, Hasher}; + use super::*; + + /// Socket address for VMWare VSockets protocol + /// + /// # References + /// + /// [vsock(7)](https://man7.org/linux/man-pages/man7/vsock.7.html) + #[derive(Copy, Clone)] + #[repr(transparent)] + pub struct VsockAddr(pub(in super::super) sockaddr_vm); + + impl private::SockaddrLikePriv for VsockAddr {} + impl SockaddrLike for VsockAddr { + unsafe fn from_raw(addr: *const libc::sockaddr, len: Option) + -> Option where Self: Sized + { + if let Some(l) = len { + if l != mem::size_of::() as libc::socklen_t { + return None; + } + } + if (*addr).sa_family as i32 != libc::AF_VSOCK as i32 { + return None; + } + Some(Self(ptr::read_unaligned(addr as *const _))) + } + } + + impl AsRef for VsockAddr { + fn as_ref(&self) -> &libc::sockaddr_vm { + &self.0 + } + } + + impl PartialEq for VsockAddr { + fn eq(&self, other: &Self) -> bool { + let (inner, other) = (self.0, other.0); + (inner.svm_family, inner.svm_cid, inner.svm_port) == + (other.svm_family, other.svm_cid, other.svm_port) + } + } + + impl Eq for VsockAddr {} + + impl Hash for VsockAddr { + fn hash(&self, s: &mut H) { + let inner = self.0; + (inner.svm_family, inner.svm_cid, inner.svm_port).hash(s); + } + } + + /// VSOCK Address + /// + /// The address for AF_VSOCK socket is defined as a combination of a + /// 32-bit Context Identifier (CID) and a 32-bit port number. + impl VsockAddr { + /// Construct a `VsockAddr` from its raw fields. + pub fn new(cid: u32, port: u32) -> VsockAddr { + let mut addr: sockaddr_vm = unsafe { mem::zeroed() }; + addr.svm_family = AddressFamily::Vsock as sa_family_t; + addr.svm_cid = cid; + addr.svm_port = port; + + VsockAddr(addr) + } + + /// Context Identifier (CID) + pub fn cid(&self) -> u32 { + self.0.svm_cid + } + + /// Port number + pub fn port(&self) -> u32 { + self.0.svm_port + } + } + + impl fmt::Display for VsockAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "cid: {} port: {}", self.cid(), self.port()) + } + } + + impl fmt::Debug for VsockAddr { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(self, f) + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + mod types { + use super::*; + + #[test] + fn test_ipv4addr_to_libc() { + let s = std::net::Ipv4Addr::new(1, 2, 3, 4); + let l = ipv4addr_to_libc(s); + assert_eq!(l.s_addr, u32::to_be(0x01020304)); + } + + #[test] + fn test_ipv6addr_to_libc() { + let s = std::net::Ipv6Addr::new(1, 2, 3, 4, 5, 6, 7, 8); + let l = ipv6addr_to_libc(&s); + assert_eq!(l.s6_addr, [0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8]); + } + } + + mod link { + #![allow(clippy::cast_ptr_alignment)] + + use super::*; + #[cfg(any(target_os = "ios", + target_os = "macos", + target_os = "illumos" + ))] + use super::super::super::socklen_t; + + /// Don't panic when trying to display an empty datalink address + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[test] + fn test_datalink_display() { + use super::super::LinkAddr; + use std::mem; + + let la = LinkAddr(libc::sockaddr_dl{ + sdl_len: 56, + sdl_family: 18, + sdl_index: 5, + sdl_type: 24, + sdl_nlen: 3, + sdl_alen: 0, + sdl_slen: 0, + .. unsafe{mem::zeroed()} + }); + format!("{}", la); + } + + #[cfg(all( + any(target_os = "android", + target_os = "fuchsia", + target_os = "linux"), + target_endian = "little" + ))] + #[test] + fn linux_loopback() { + #[repr(align(2))] + struct Raw([u8; 20]); + + let bytes = Raw([17u8, 0, 0, 0, 1, 0, 0, 0, 4, 3, 0, 6, 1, 2, 3, 4, 5, 6, 0, 0]); + let sa = bytes.0.as_ptr() as *const libc::sockaddr; + let len = None; + let sock_addr = unsafe { SockaddrStorage::from_raw(sa, len) }.unwrap(); + assert_eq!(sock_addr.family(), Some(AddressFamily::Packet)); + match sock_addr.as_link_addr() { + Some(dl) => assert_eq!(dl.addr(), Some([1, 2, 3, 4, 5, 6])), + None => panic!("Can't unwrap sockaddr storage") + } + } + + #[cfg(any(target_os = "ios", + target_os = "macos" + ))] + #[test] + fn macos_loopback() { + let bytes = [20i8, 18, 1, 0, 24, 3, 0, 0, 108, 111, 48, 0, 0, 0, 0, 0]; + let sa = bytes.as_ptr() as *const libc::sockaddr; + let len = Some(bytes.len() as socklen_t); + let sock_addr = unsafe { SockaddrStorage::from_raw(sa, len) }.unwrap(); + assert_eq!(sock_addr.family(), Some(AddressFamily::Link)); + match sock_addr.as_link_addr() { + Some(dl) => { + assert!(dl.addr().is_none()); + }, + None => panic!("Can't unwrap sockaddr storage") + } + } + + #[cfg(any(target_os = "ios", + target_os = "macos" + ))] + #[test] + fn macos_tap() { + let bytes = [20i8, 18, 7, 0, 6, 3, 6, 0, 101, 110, 48, 24, 101, -112, -35, 76, -80]; + let ptr = bytes.as_ptr(); + let sa = ptr as *const libc::sockaddr; + let len = Some(bytes.len() as socklen_t); + + let sock_addr = unsafe { SockaddrStorage::from_raw(sa, len).unwrap() }; + assert_eq!(sock_addr.family(), Some(AddressFamily::Link)); + match sock_addr.as_link_addr() { + Some(dl) => assert_eq!(dl.addr(), + Some([24u8, 101, 144, 221, 76, 176])), + None => panic!("Can't unwrap sockaddr storage") + } + } + + #[cfg(target_os = "illumos")] + #[test] + fn illumos_tap() { + let bytes = [25u8, 0, 0, 0, 6, 0, 6, 0, 24, 101, 144, 221, 76, 176]; + let ptr = bytes.as_ptr(); + let sa = ptr as *const libc::sockaddr; + let len = Some(bytes.len() as socklen_t); + let _sock_addr = unsafe { SockaddrStorage::from_raw(sa, len) }; + + assert!(_sock_addr.is_some()); + + let sock_addr = _sock_addr.unwrap(); + + assert_eq!(sock_addr.family().unwrap(), AddressFamily::Link); + + assert_eq!(sock_addr.as_link_addr().unwrap().addr(), + Some([24u8, 101, 144, 221, 76, 176])); + } + + #[test] + fn size() { + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd", + target_os = "haiku"))] + let l = mem::size_of::(); + #[cfg(any( + target_os = "android", + target_os = "fuchsia", + target_os = "linux"))] + let l = mem::size_of::(); + assert_eq!( LinkAddr::size() as usize, l); + } + } + + mod sockaddr_in { + use super::*; + use std::str::FromStr; + + #[test] + fn display() { + let s = "127.0.0.1:8080"; + let addr = SockaddrIn::from_str(s).unwrap(); + assert_eq!(s, format!("{}", addr)); + } + + #[test] + fn size() { + assert_eq!(mem::size_of::(), + SockaddrIn::size() as usize); + } + } + + mod sockaddr_in6 { + use super::*; + use std::str::FromStr; + + #[test] + fn display() { + let s = "[1234:5678:90ab:cdef::1111:2222]:8080"; + let addr = SockaddrIn6::from_str(s).unwrap(); + assert_eq!(s, format!("{}", addr)); + } + + #[test] + fn size() { + assert_eq!(mem::size_of::(), + SockaddrIn6::size() as usize); + } + } + + mod unixaddr { + use super::*; + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[test] + fn abstract_sun_path() { + let name = String::from("nix\0abstract\0test"); + let addr = UnixAddr::new_abstract(name.as_bytes()).unwrap(); + + let sun_path1 = unsafe { &(*addr.as_ptr()).sun_path[..addr.path_len()] }; + let sun_path2 = [0, 110, 105, 120, 0, 97, 98, 115, 116, 114, 97, 99, 116, 0, 116, 101, 115, 116]; + assert_eq!(sun_path1, sun_path2); + } + + #[test] + fn size() { + assert_eq!(mem::size_of::(), + UnixAddr::size() as usize); + } + } +} diff --git a/bash-5.1/vendor/nix/src/sys/socket/mod.rs b/bash-5.1/vendor/nix/src/sys/socket/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..ecbf30ad44cd65776b08d75ace84034e4ec2a58b --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/socket/mod.rs @@ -0,0 +1,2230 @@ +//! Socket interface functions +//! +//! [Further reading](https://man7.org/linux/man-pages/man7/socket.7.html) +use cfg_if::cfg_if; +use crate::{Result, errno::Errno}; +use libc::{self, c_void, c_int, iovec, socklen_t, size_t, + CMSG_FIRSTHDR, CMSG_NXTHDR, CMSG_DATA, CMSG_LEN}; +use std::convert::TryInto; +use std::{mem, ptr, slice}; +use std::os::unix::io::RawFd; +#[cfg(feature = "net")] +use std::net; +#[cfg(target_os = "linux")] +#[cfg(feature = "uio")] +use crate::sys::time::TimeSpec; +#[cfg(feature = "uio")] +use crate::sys::time::TimeVal; +use std::io::{IoSlice, IoSliceMut}; + +#[deny(missing_docs)] +mod addr; +#[deny(missing_docs)] +pub mod sockopt; + +/* + * + * ===== Re-exports ===== + * + */ + +pub use self::addr::{SockaddrLike, SockaddrStorage}; + +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] +#[allow(deprecated)] +pub use self::addr::{ + AddressFamily, + SockAddr, + UnixAddr, +}; +#[allow(deprecated)] +#[cfg(not(any(target_os = "illumos", target_os = "solaris", target_os = "haiku")))] +#[cfg(feature = "net")] +pub use self::addr::{ + InetAddr, + IpAddr, + Ipv4Addr, + Ipv6Addr, + LinkAddr, + SockaddrIn, + SockaddrIn6 +}; +#[cfg(any(target_os = "illumos", target_os = "solaris"))] +#[allow(deprecated)] +pub use self::addr::{ + AddressFamily, + SockAddr, + UnixAddr, +}; +#[allow(deprecated)] +#[cfg(any(target_os = "illumos", target_os = "solaris", target_os = "haiku"))] +#[cfg(feature = "net")] +pub use self::addr::{ + InetAddr, + IpAddr, + Ipv4Addr, + Ipv6Addr, + SockaddrIn, + SockaddrIn6 +}; + +#[cfg(any(target_os = "ios", target_os = "macos"))] +#[cfg(feature = "ioctl")] +pub use crate::sys::socket::addr::sys_control::SysControlAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use crate::sys::socket::addr::netlink::NetlinkAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use crate::sys::socket::addr::alg::AlgAddr; +#[cfg(any(target_os = "android", target_os = "linux"))] +pub use crate::sys::socket::addr::vsock::VsockAddr; + +#[cfg(feature = "uio")] +pub use libc::{cmsghdr, msghdr}; +pub use libc::{ + sa_family_t, + sockaddr, + sockaddr_storage, + sockaddr_un, +}; +#[cfg(feature = "net")] +pub use libc::{sockaddr_in, sockaddr_in6}; + +// Needed by the cmsg_space macro +#[doc(hidden)] +pub use libc::{c_uint, CMSG_SPACE}; + +#[cfg(feature = "net")] +use crate::sys::socket::addr::{ipv4addr_to_libc, ipv6addr_to_libc}; + +/// These constants are used to specify the communication semantics +/// when creating a socket with [`socket()`](fn.socket.html) +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +#[repr(i32)] +#[non_exhaustive] +pub enum SockType { + /// Provides sequenced, reliable, two-way, connection- + /// based byte streams. An out-of-band data transmission + /// mechanism may be supported. + Stream = libc::SOCK_STREAM, + /// Supports datagrams (connectionless, unreliable + /// messages of a fixed maximum length). + Datagram = libc::SOCK_DGRAM, + /// Provides a sequenced, reliable, two-way connection- + /// based data transmission path for datagrams of fixed + /// maximum length; a consumer is required to read an + /// entire packet with each input system call. + SeqPacket = libc::SOCK_SEQPACKET, + /// Provides raw network protocol access. + Raw = libc::SOCK_RAW, + /// Provides a reliable datagram layer that does not + /// guarantee ordering. + #[cfg(not(any(target_os = "haiku")))] + Rdm = libc::SOCK_RDM, +} + +/// Constants used in [`socket`](fn.socket.html) and [`socketpair`](fn.socketpair.html) +/// to specify the protocol to use. +#[repr(i32)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[non_exhaustive] +pub enum SockProtocol { + /// TCP protocol ([ip(7)](https://man7.org/linux/man-pages/man7/ip.7.html)) + Tcp = libc::IPPROTO_TCP, + /// UDP protocol ([ip(7)](https://man7.org/linux/man-pages/man7/ip.7.html)) + Udp = libc::IPPROTO_UDP, + /// Allows applications and other KEXTs to be notified when certain kernel events occur + /// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html)) + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + KextEvent = libc::SYSPROTO_EVENT, + /// Allows applications to configure and control a KEXT + /// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html)) + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + KextControl = libc::SYSPROTO_CONTROL, + /// Receives routing and link updates and may be used to modify the routing tables (both IPv4 and IPv6), IP addresses, link + // parameters, neighbor setups, queueing disciplines, traffic classes and packet classifiers + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkRoute = libc::NETLINK_ROUTE, + /// Reserved for user-mode socket protocols + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkUserSock = libc::NETLINK_USERSOCK, + /// Query information about sockets of various protocol families from the kernel + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkSockDiag = libc::NETLINK_SOCK_DIAG, + /// SELinux event notifications. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkSELinux = libc::NETLINK_SELINUX, + /// Open-iSCSI + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkISCSI = libc::NETLINK_ISCSI, + /// Auditing + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkAudit = libc::NETLINK_AUDIT, + /// Access to FIB lookup from user space + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkFIBLookup = libc::NETLINK_FIB_LOOKUP, + /// Netfilter subsystem + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkNetFilter = libc::NETLINK_NETFILTER, + /// SCSI Transports + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkSCSITransport = libc::NETLINK_SCSITRANSPORT, + /// Infiniband RDMA + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkRDMA = libc::NETLINK_RDMA, + /// Transport IPv6 packets from netfilter to user space. Used by ip6_queue kernel module. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkIPv6Firewall = libc::NETLINK_IP6_FW, + /// DECnet routing messages + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkDECNetRoutingMessage = libc::NETLINK_DNRTMSG, + /// Kernel messages to user space + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkKObjectUEvent = libc::NETLINK_KOBJECT_UEVENT, + /// Netlink interface to request information about ciphers registered with the kernel crypto API as well as allow + /// configuration of the kernel crypto API. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkCrypto = libc::NETLINK_CRYPTO, + /// Non-DIX type protocol number defined for the Ethernet IEEE 802.3 interface that allows packets of all protocols + /// defined in the interface to be received. + /// ([ref](https://man7.org/linux/man-pages/man7/packet.7.html)) + // The protocol number is fed into the socket syscall in network byte order. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + EthAll = libc::ETH_P_ALL.to_be(), +} + +#[cfg(any(target_os = "linux"))] +libc_bitflags! { + /// Configuration flags for `SO_TIMESTAMPING` interface + /// + /// For use with [`Timestamping`][sockopt::Timestamping]. + /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) + pub struct TimestampingFlag: c_uint { + /// Report any software timestamps when available. + SOF_TIMESTAMPING_SOFTWARE; + /// Report hardware timestamps as generated by SOF_TIMESTAMPING_TX_HARDWARE when available. + SOF_TIMESTAMPING_RAW_HARDWARE; + /// Collect transmiting timestamps as reported by hardware + SOF_TIMESTAMPING_TX_HARDWARE; + /// Collect transmiting timestamps as reported by software + SOF_TIMESTAMPING_TX_SOFTWARE; + /// Collect receiving timestamps as reported by hardware + SOF_TIMESTAMPING_RX_HARDWARE; + /// Collect receiving timestamps as reported by software + SOF_TIMESTAMPING_RX_SOFTWARE; + } +} + +libc_bitflags!{ + /// Additional socket options + pub struct SockFlag: c_int { + /// Set non-blocking mode on the new socket + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SOCK_NONBLOCK; + /// Set close-on-exec on the new descriptor + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SOCK_CLOEXEC; + /// Return `EPIPE` instead of raising `SIGPIPE` + #[cfg(target_os = "netbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + SOCK_NOSIGPIPE; + /// For domains `AF_INET(6)`, only allow `connect(2)`, `sendto(2)`, or `sendmsg(2)` + /// to the DNS port (typically 53) + #[cfg(target_os = "openbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + SOCK_DNS; + } +} + +libc_bitflags!{ + /// Flags for send/recv and their relatives + pub struct MsgFlags: c_int { + /// Sends or requests out-of-band data on sockets that support this notion + /// (e.g., of type [`Stream`](enum.SockType.html)); the underlying protocol must also + /// support out-of-band data. + MSG_OOB; + /// Peeks at an incoming message. The data is treated as unread and the next + /// [`recv()`](fn.recv.html) + /// or similar function shall still return this data. + MSG_PEEK; + /// Receive operation blocks until the full amount of data can be + /// returned. The function may return smaller amount of data if a signal + /// is caught, an error or disconnect occurs. + MSG_WAITALL; + /// Enables nonblocking operation; if the operation would block, + /// `EAGAIN` or `EWOULDBLOCK` is returned. This provides similar + /// behavior to setting the `O_NONBLOCK` flag + /// (via the [`fcntl`](../../fcntl/fn.fcntl.html) + /// `F_SETFL` operation), but differs in that `MSG_DONTWAIT` is a per- + /// call option, whereas `O_NONBLOCK` is a setting on the open file + /// description (see [open(2)](https://man7.org/linux/man-pages/man2/open.2.html)), + /// which will affect all threads in + /// the calling process and as well as other processes that hold + /// file descriptors referring to the same open file description. + MSG_DONTWAIT; + /// Receive flags: Control Data was discarded (buffer too small) + MSG_CTRUNC; + /// For raw ([`Packet`](addr/enum.AddressFamily.html)), Internet datagram + /// (since Linux 2.4.27/2.6.8), + /// netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4) + /// sockets: return the real length of the packet or datagram, even + /// when it was longer than the passed buffer. Not implemented for UNIX + /// domain ([unix(7)](https://linux.die.net/man/7/unix)) sockets. + /// + /// For use with Internet stream sockets, see [tcp(7)](https://linux.die.net/man/7/tcp). + MSG_TRUNC; + /// Terminates a record (when this notion is supported, as for + /// sockets of type [`SeqPacket`](enum.SockType.html)). + MSG_EOR; + /// This flag specifies that queued errors should be received from + /// the socket error queue. (For more details, see + /// [recvfrom(2)](https://linux.die.net/man/2/recvfrom)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MSG_ERRQUEUE; + /// Set the `close-on-exec` flag for the file descriptor received via a UNIX domain + /// file descriptor using the `SCM_RIGHTS` operation (described in + /// [unix(7)](https://linux.die.net/man/7/unix)). + /// This flag is useful for the same reasons as the `O_CLOEXEC` flag of + /// [open(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html). + /// + /// Only used in [`recvmsg`](fn.recvmsg.html) function. + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MSG_CMSG_CLOEXEC; + /// Requests not to send `SIGPIPE` errors when the other end breaks the connection. + /// (For more details, see [send(2)](https://linux.die.net/man/2/send)). + #[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MSG_NOSIGNAL; + } +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + /// Unix credentials of the sending process. + /// + /// This struct is used with the `SO_PEERCRED` ancillary message + /// and the `SCM_CREDENTIALS` control message for UNIX sockets. + #[repr(transparent)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + pub struct UnixCredentials(libc::ucred); + + impl UnixCredentials { + /// Creates a new instance with the credentials of the current process + pub fn new() -> Self { + // Safe because these FFI functions are inherently safe + unsafe { + UnixCredentials(libc::ucred { + pid: libc::getpid(), + uid: libc::getuid(), + gid: libc::getgid() + }) + } + } + + /// Returns the process identifier + pub fn pid(&self) -> libc::pid_t { + self.0.pid + } + + /// Returns the user identifier + pub fn uid(&self) -> libc::uid_t { + self.0.uid + } + + /// Returns the group identifier + pub fn gid(&self) -> libc::gid_t { + self.0.gid + } + } + + impl Default for UnixCredentials { + fn default() -> Self { + Self::new() + } + } + + impl From for UnixCredentials { + fn from(cred: libc::ucred) -> Self { + UnixCredentials(cred) + } + } + + impl From for libc::ucred { + fn from(uc: UnixCredentials) -> Self { + uc.0 + } + } + } else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] { + /// Unix credentials of the sending process. + /// + /// This struct is used with the `SCM_CREDS` ancillary message for UNIX sockets. + #[repr(transparent)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + pub struct UnixCredentials(libc::cmsgcred); + + impl UnixCredentials { + /// Returns the process identifier + pub fn pid(&self) -> libc::pid_t { + self.0.cmcred_pid + } + + /// Returns the real user identifier + pub fn uid(&self) -> libc::uid_t { + self.0.cmcred_uid + } + + /// Returns the effective user identifier + pub fn euid(&self) -> libc::uid_t { + self.0.cmcred_euid + } + + /// Returns the real group identifier + pub fn gid(&self) -> libc::gid_t { + self.0.cmcred_gid + } + + /// Returns a list group identifiers (the first one being the effective GID) + pub fn groups(&self) -> &[libc::gid_t] { + unsafe { + slice::from_raw_parts( + self.0.cmcred_groups.as_ptr() as *const libc::gid_t, + self.0.cmcred_ngroups as _ + ) + } + } + } + + impl From for UnixCredentials { + fn from(cred: libc::cmsgcred) -> Self { + UnixCredentials(cred) + } + } + } +} + +cfg_if!{ + if #[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios" + ))] { + /// Return type of [`LocalPeerCred`](crate::sys::socket::sockopt::LocalPeerCred) + #[repr(transparent)] + #[derive(Clone, Copy, Debug, Eq, PartialEq)] + pub struct XuCred(libc::xucred); + + impl XuCred { + /// Structure layout version + pub fn version(&self) -> u32 { + self.0.cr_version + } + + /// Effective user ID + pub fn uid(&self) -> libc::uid_t { + self.0.cr_uid + } + + /// Returns a list of group identifiers (the first one being the + /// effective GID) + pub fn groups(&self) -> &[libc::gid_t] { + &self.0.cr_groups + } + } + } +} + +feature! { +#![feature = "net"] +/// Request for multicast socket operations +/// +/// This is a wrapper type around `ip_mreq`. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct IpMembershipRequest(libc::ip_mreq); + +impl IpMembershipRequest { + /// Instantiate a new `IpMembershipRequest` + /// + /// If `interface` is `None`, then `Ipv4Addr::any()` will be used for the interface. + pub fn new(group: net::Ipv4Addr, interface: Option) + -> Self + { + let imr_addr = match interface { + None => net::Ipv4Addr::UNSPECIFIED, + Some(addr) => addr + }; + IpMembershipRequest(libc::ip_mreq { + imr_multiaddr: ipv4addr_to_libc(group), + imr_interface: ipv4addr_to_libc(imr_addr) + }) + } +} + +/// Request for ipv6 multicast socket operations +/// +/// This is a wrapper type around `ipv6_mreq`. +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct Ipv6MembershipRequest(libc::ipv6_mreq); + +impl Ipv6MembershipRequest { + /// Instantiate a new `Ipv6MembershipRequest` + pub const fn new(group: net::Ipv6Addr) -> Self { + Ipv6MembershipRequest(libc::ipv6_mreq { + ipv6mr_multiaddr: ipv6addr_to_libc(&group), + ipv6mr_interface: 0, + }) + } +} +} + +feature! { +#![feature = "uio"] + +/// Create a buffer large enough for storing some control messages as returned +/// by [`recvmsg`](fn.recvmsg.html). +/// +/// # Examples +/// +/// ``` +/// # #[macro_use] extern crate nix; +/// # use nix::sys::time::TimeVal; +/// # use std::os::unix::io::RawFd; +/// # fn main() { +/// // Create a buffer for a `ControlMessageOwned::ScmTimestamp` message +/// let _ = cmsg_space!(TimeVal); +/// // Create a buffer big enough for a `ControlMessageOwned::ScmRights` message +/// // with two file descriptors +/// let _ = cmsg_space!([RawFd; 2]); +/// // Create a buffer big enough for a `ControlMessageOwned::ScmRights` message +/// // and a `ControlMessageOwned::ScmTimestamp` message +/// let _ = cmsg_space!(RawFd, TimeVal); +/// # } +/// ``` +// Unfortunately, CMSG_SPACE isn't a const_fn, or else we could return a +// stack-allocated array. +#[macro_export] +macro_rules! cmsg_space { + ( $( $x:ty ),* ) => { + { + let mut space = 0; + $( + // CMSG_SPACE is always safe + space += unsafe { + $crate::sys::socket::CMSG_SPACE(::std::mem::size_of::<$x>() as $crate::sys::socket::c_uint) + } as usize; + )* + Vec::::with_capacity(space) + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct RecvMsg<'a, S> { + pub bytes: usize, + cmsghdr: Option<&'a cmsghdr>, + pub address: Option, + pub flags: MsgFlags, + mhdr: msghdr, +} + +impl<'a, S> RecvMsg<'a, S> { + /// Iterate over the valid control messages pointed to by this + /// msghdr. + pub fn cmsgs(&self) -> CmsgIterator { + CmsgIterator { + cmsghdr: self.cmsghdr, + mhdr: &self.mhdr + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct CmsgIterator<'a> { + /// Control message buffer to decode from. Must adhere to cmsg alignment. + cmsghdr: Option<&'a cmsghdr>, + mhdr: &'a msghdr +} + +impl<'a> Iterator for CmsgIterator<'a> { + type Item = ControlMessageOwned; + + fn next(&mut self) -> Option { + match self.cmsghdr { + None => None, // No more messages + Some(hdr) => { + // Get the data. + // Safe if cmsghdr points to valid data returned by recvmsg(2) + let cm = unsafe { Some(ControlMessageOwned::decode_from(hdr))}; + // Advance the internal pointer. Safe if mhdr and cmsghdr point + // to valid data returned by recvmsg(2) + self.cmsghdr = unsafe { + let p = CMSG_NXTHDR(self.mhdr as *const _, hdr as *const _); + p.as_ref() + }; + cm + } + } + } +} + +/// A type-safe wrapper around a single control message, as used with +/// [`recvmsg`](#fn.recvmsg). +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/cmsg.3.html) +// Nix version 0.13.0 and earlier used ControlMessage for both recvmsg and +// sendmsg. However, on some platforms the messages returned by recvmsg may be +// unaligned. ControlMessageOwned takes those messages by copy, obviating any +// alignment issues. +// +// See https://github.com/nix-rust/nix/issues/999 +#[derive(Clone, Debug, Eq, PartialEq)] +#[non_exhaustive] +pub enum ControlMessageOwned { + /// Received version of [`ControlMessage::ScmRights`] + ScmRights(Vec), + /// Received version of [`ControlMessage::ScmCredentials`] + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ScmCredentials(UnixCredentials), + /// Received version of [`ControlMessage::ScmCreds`] + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ScmCreds(UnixCredentials), + /// A message of type `SCM_TIMESTAMP`, containing the time the + /// packet was received by the kernel. + /// + /// See the kernel's explanation in "SO_TIMESTAMP" of + /// [networking/timestamping](https://www.kernel.org/doc/Documentation/networking/timestamping.txt). + /// + /// # Examples + /// + /// ``` + /// # #[macro_use] extern crate nix; + /// # use nix::sys::socket::*; + /// # use nix::sys::time::*; + /// # use std::io::{IoSlice, IoSliceMut}; + /// # use std::time::*; + /// # use std::str::FromStr; + /// # fn main() { + /// // Set up + /// let message = "Ohayō!".as_bytes(); + /// let in_socket = socket( + /// AddressFamily::Inet, + /// SockType::Datagram, + /// SockFlag::empty(), + /// None).unwrap(); + /// setsockopt(in_socket, sockopt::ReceiveTimestamp, &true).unwrap(); + /// let localhost = SockaddrIn::from_str("127.0.0.1:0").unwrap(); + /// bind(in_socket, &localhost).unwrap(); + /// let address: SockaddrIn = getsockname(in_socket).unwrap(); + /// // Get initial time + /// let time0 = SystemTime::now(); + /// // Send the message + /// let iov = [IoSlice::new(message)]; + /// let flags = MsgFlags::empty(); + /// let l = sendmsg(in_socket, &iov, &[], flags, Some(&address)).unwrap(); + /// assert_eq!(message.len(), l); + /// // Receive the message + /// let mut buffer = vec![0u8; message.len()]; + /// let mut cmsgspace = cmsg_space!(TimeVal); + /// let mut iov = [IoSliceMut::new(&mut buffer)]; + /// let r = recvmsg::(in_socket, &mut iov, Some(&mut cmsgspace), flags) + /// .unwrap(); + /// let rtime = match r.cmsgs().next() { + /// Some(ControlMessageOwned::ScmTimestamp(rtime)) => rtime, + /// Some(_) => panic!("Unexpected control message"), + /// None => panic!("No control message") + /// }; + /// // Check the final time + /// let time1 = SystemTime::now(); + /// // the packet's received timestamp should lie in-between the two system + /// // times, unless the system clock was adjusted in the meantime. + /// let rduration = Duration::new(rtime.tv_sec() as u64, + /// rtime.tv_usec() as u32 * 1000); + /// assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); + /// assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); + /// // Close socket + /// nix::unistd::close(in_socket).unwrap(); + /// # } + /// ``` + ScmTimestamp(TimeVal), + /// A set of nanosecond resolution timestamps + /// + /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) + #[cfg(all(target_os = "linux"))] + ScmTimestampsns(Timestamps), + /// Nanoseconds resolution timestamp + /// + /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) + #[cfg(all(target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ScmTimestampns(TimeSpec), + #[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + ))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4PacketInfo(libc::in_pktinfo), + #[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "openbsd", + target_os = "netbsd", + ))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv6PacketInfo(libc::in6_pktinfo), + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4RecvIf(libc::sockaddr_dl), + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4RecvDstAddr(libc::in_addr), + #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4OrigDstAddr(libc::sockaddr_in), + #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv6OrigDstAddr(libc::sockaddr_in6), + + /// UDP Generic Receive Offload (GRO) allows receiving multiple UDP + /// packets from a single sender. + /// Fixed-size payloads are following one by one in a receive buffer. + /// This Control Message indicates the size of all smaller packets, + /// except, maybe, the last one. + /// + /// `UdpGroSegment` socket option should be enabled on a socket + /// to allow receiving GRO packets. + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + UdpGroSegments(u16), + + /// SO_RXQ_OVFL indicates that an unsigned 32 bit value + /// ancilliary msg (cmsg) should be attached to recieved + /// skbs indicating the number of packets dropped by the + /// socket between the last recieved packet and this + /// received packet. + /// + /// `RxqOvfl` socket option should be enabled on a socket + /// to allow receiving the drop counter. + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + RxqOvfl(u32), + + /// Socket error queue control messages read with the `MSG_ERRQUEUE` flag. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4RecvErr(libc::sock_extended_err, Option), + /// Socket error queue control messages read with the `MSG_ERRQUEUE` flag. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv6RecvErr(libc::sock_extended_err, Option), + + /// Catch-all variant for unimplemented cmsg types. + #[doc(hidden)] + Unknown(UnknownCmsg), +} + +/// For representing packet timestamps via `SO_TIMESTAMPING` interface +#[cfg(all(target_os = "linux"))] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub struct Timestamps { + /// software based timestamp, usually one containing data + pub system: TimeSpec, + /// legacy timestamp, usually empty + pub hw_trans: TimeSpec, + /// hardware based timestamp + pub hw_raw: TimeSpec, +} + +impl ControlMessageOwned { + /// Decodes a `ControlMessageOwned` from raw bytes. + /// + /// This is only safe to call if the data is correct for the message type + /// specified in the header. Normally, the kernel ensures that this is the + /// case. "Correct" in this case includes correct length, alignment and + /// actual content. + // Clippy complains about the pointer alignment of `p`, not understanding + // that it's being fed to a function that can handle that. + #[allow(clippy::cast_ptr_alignment)] + unsafe fn decode_from(header: &cmsghdr) -> ControlMessageOwned + { + let p = CMSG_DATA(header); + let len = header as *const _ as usize + header.cmsg_len as usize + - p as usize; + match (header.cmsg_level, header.cmsg_type) { + (libc::SOL_SOCKET, libc::SCM_RIGHTS) => { + let n = len / mem::size_of::(); + let mut fds = Vec::with_capacity(n); + for i in 0..n { + let fdp = (p as *const RawFd).add(i); + fds.push(ptr::read_unaligned(fdp)); + } + ControlMessageOwned::ScmRights(fds) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + (libc::SOL_SOCKET, libc::SCM_CREDENTIALS) => { + let cred: libc::ucred = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmCredentials(cred.into()) + } + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + (libc::SOL_SOCKET, libc::SCM_CREDS) => { + let cred: libc::cmsgcred = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmCreds(cred.into()) + } + #[cfg(not(target_os = "haiku"))] + (libc::SOL_SOCKET, libc::SCM_TIMESTAMP) => { + let tv: libc::timeval = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmTimestamp(TimeVal::from(tv)) + }, + #[cfg(all(target_os = "linux"))] + (libc::SOL_SOCKET, libc::SCM_TIMESTAMPNS) => { + let ts: libc::timespec = ptr::read_unaligned(p as *const _); + ControlMessageOwned::ScmTimestampns(TimeSpec::from(ts)) + } + #[cfg(all(target_os = "linux"))] + (libc::SOL_SOCKET, libc::SCM_TIMESTAMPING) => { + let tp = p as *const libc::timespec; + let ts: libc::timespec = ptr::read_unaligned(tp); + let system = TimeSpec::from(ts); + let ts: libc::timespec = ptr::read_unaligned(tp.add(1)); + let hw_trans = TimeSpec::from(ts); + let ts: libc::timespec = ptr::read_unaligned(tp.add(2)); + let hw_raw = TimeSpec::from(ts); + let timestamping = Timestamps { system, hw_trans, hw_raw }; + ControlMessageOwned::ScmTimestampsns(timestamping) + } + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] + #[cfg(feature = "net")] + (libc::IPPROTO_IPV6, libc::IPV6_PKTINFO) => { + let info = ptr::read_unaligned(p as *const libc::in6_pktinfo); + ControlMessageOwned::Ipv6PacketInfo(info) + } + #[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + ))] + #[cfg(feature = "net")] + (libc::IPPROTO_IP, libc::IP_PKTINFO) => { + let info = ptr::read_unaligned(p as *const libc::in_pktinfo); + ControlMessageOwned::Ipv4PacketInfo(info) + } + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + #[cfg(feature = "net")] + (libc::IPPROTO_IP, libc::IP_RECVIF) => { + let dl = ptr::read_unaligned(p as *const libc::sockaddr_dl); + ControlMessageOwned::Ipv4RecvIf(dl) + }, + #[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + ))] + #[cfg(feature = "net")] + (libc::IPPROTO_IP, libc::IP_RECVDSTADDR) => { + let dl = ptr::read_unaligned(p as *const libc::in_addr); + ControlMessageOwned::Ipv4RecvDstAddr(dl) + }, + #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] + #[cfg(feature = "net")] + (libc::IPPROTO_IP, libc::IP_ORIGDSTADDR) => { + let dl = ptr::read_unaligned(p as *const libc::sockaddr_in); + ControlMessageOwned::Ipv4OrigDstAddr(dl) + }, + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + (libc::SOL_UDP, libc::UDP_GRO) => { + let gso_size: u16 = ptr::read_unaligned(p as *const _); + ControlMessageOwned::UdpGroSegments(gso_size) + }, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + (libc::SOL_SOCKET, libc::SO_RXQ_OVFL) => { + let drop_counter = ptr::read_unaligned(p as *const u32); + ControlMessageOwned::RxqOvfl(drop_counter) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + (libc::IPPROTO_IP, libc::IP_RECVERR) => { + let (err, addr) = Self::recv_err_helper::(p, len); + ControlMessageOwned::Ipv4RecvErr(err, addr) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + (libc::IPPROTO_IPV6, libc::IPV6_RECVERR) => { + let (err, addr) = Self::recv_err_helper::(p, len); + ControlMessageOwned::Ipv6RecvErr(err, addr) + }, + #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] + #[cfg(feature = "net")] + (libc::IPPROTO_IPV6, libc::IPV6_ORIGDSTADDR) => { + let dl = ptr::read_unaligned(p as *const libc::sockaddr_in6); + ControlMessageOwned::Ipv6OrigDstAddr(dl) + }, + (_, _) => { + let sl = slice::from_raw_parts(p, len); + let ucmsg = UnknownCmsg(*header, Vec::::from(sl)); + ControlMessageOwned::Unknown(ucmsg) + } + } + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + #[allow(clippy::cast_ptr_alignment)] // False positive + unsafe fn recv_err_helper(p: *mut libc::c_uchar, len: usize) -> (libc::sock_extended_err, Option) { + let ee = p as *const libc::sock_extended_err; + let err = ptr::read_unaligned(ee); + + // For errors originating on the network, SO_EE_OFFENDER(ee) points inside the p[..len] + // CMSG_DATA buffer. For local errors, there is no address included in the control + // message, and SO_EE_OFFENDER(ee) points beyond the end of the buffer. So, we need to + // validate that the address object is in-bounds before we attempt to copy it. + let addrp = libc::SO_EE_OFFENDER(ee) as *const T; + + if addrp.offset(1) as usize - (p as usize) > len { + (err, None) + } else { + (err, Some(ptr::read_unaligned(addrp))) + } + } +} + +/// A type-safe zero-copy wrapper around a single control message, as used wih +/// [`sendmsg`](#fn.sendmsg). More types may be added to this enum; do not +/// exhaustively pattern-match it. +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/cmsg.3.html) +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[non_exhaustive] +pub enum ControlMessage<'a> { + /// A message of type `SCM_RIGHTS`, containing an array of file + /// descriptors passed between processes. + /// + /// See the description in the "Ancillary messages" section of the + /// [unix(7) man page](https://man7.org/linux/man-pages/man7/unix.7.html). + /// + /// Using multiple `ScmRights` messages for a single `sendmsg` call isn't + /// recommended since it causes platform-dependent behaviour: It might + /// swallow all but the first `ScmRights` message or fail with `EINVAL`. + /// Instead, you can put all fds to be passed into a single `ScmRights` + /// message. + ScmRights(&'a [RawFd]), + /// A message of type `SCM_CREDENTIALS`, containing the pid, uid and gid of + /// a process connected to the socket. + /// + /// This is similar to the socket option `SO_PEERCRED`, but requires a + /// process to explicitly send its credentials. A process running as root is + /// allowed to specify any credentials, while credentials sent by other + /// processes are verified by the kernel. + /// + /// For further information, please refer to the + /// [`unix(7)`](https://man7.org/linux/man-pages/man7/unix.7.html) man page. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ScmCredentials(&'a UnixCredentials), + /// A message of type `SCM_CREDS`, containing the pid, uid, euid, gid and groups of + /// a process connected to the socket. + /// + /// This is similar to the socket options `LOCAL_CREDS` and `LOCAL_PEERCRED`, but + /// requires a process to explicitly send its credentials. + /// + /// Credentials are always overwritten by the kernel, so this variant does have + /// any data, unlike the receive-side + /// [`ControlMessageOwned::ScmCreds`]. + /// + /// For further information, please refer to the + /// [`unix(4)`](https://www.freebsd.org/cgi/man.cgi?query=unix) man page. + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ScmCreds, + + /// Set IV for `AF_ALG` crypto API. + /// + /// For further information, please refer to the + /// [`documentation`](https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html) + #[cfg(any( + target_os = "android", + target_os = "linux", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AlgSetIv(&'a [u8]), + /// Set crypto operation for `AF_ALG` crypto API. It may be one of + /// `ALG_OP_ENCRYPT` or `ALG_OP_DECRYPT` + /// + /// For further information, please refer to the + /// [`documentation`](https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html) + #[cfg(any( + target_os = "android", + target_os = "linux", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AlgSetOp(&'a libc::c_int), + /// Set the length of associated authentication data (AAD) (applicable only to AEAD algorithms) + /// for `AF_ALG` crypto API. + /// + /// For further information, please refer to the + /// [`documentation`](https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html) + #[cfg(any( + target_os = "android", + target_os = "linux", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AlgSetAeadAssoclen(&'a u32), + + /// UDP GSO makes it possible for applications to generate network packets + /// for a virtual MTU much greater than the real one. + /// The length of the send data no longer matches the expected length on + /// the wire. + /// The size of the datagram payload as it should appear on the wire may be + /// passed through this control message. + /// Send buffer should consist of multiple fixed-size wire payloads + /// following one by one, and the last, possibly smaller one. + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + UdpGsoSegments(&'a u16), + + /// Configure the sending addressing and interface for v4 + /// + /// For further information, please refer to the + /// [`ip(7)`](https://man7.org/linux/man-pages/man7/ip.7.html) man page. + #[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4PacketInfo(&'a libc::in_pktinfo), + + /// Configure the sending addressing and interface for v6 + /// + /// For further information, please refer to the + /// [`ipv6(7)`](https://man7.org/linux/man-pages/man7/ipv6.7.html) man page. + #[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "freebsd", + target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv6PacketInfo(&'a libc::in6_pktinfo), + + /// Configure the IPv4 source address with `IP_SENDSRCADDR`. + #[cfg(any( + target_os = "netbsd", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + ))] + #[cfg(feature = "net")] + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + Ipv4SendSrcAddr(&'a libc::in_addr), + + /// SO_RXQ_OVFL indicates that an unsigned 32 bit value + /// ancilliary msg (cmsg) should be attached to recieved + /// skbs indicating the number of packets dropped by the + /// socket between the last recieved packet and this + /// received packet. + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + RxqOvfl(&'a u32), + + /// Configure the transmission time of packets. + /// + /// For further information, please refer to the + /// [`tc-etf(8)`](https://man7.org/linux/man-pages/man8/tc-etf.8.html) man + /// page. + #[cfg(target_os = "linux")] + TxTime(&'a u64), +} + +// An opaque structure used to prevent cmsghdr from being a public type +#[doc(hidden)] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct UnknownCmsg(cmsghdr, Vec); + +impl<'a> ControlMessage<'a> { + /// The value of CMSG_SPACE on this message. + /// Safe because CMSG_SPACE is always safe + fn space(&self) -> usize { + unsafe{CMSG_SPACE(self.len() as libc::c_uint) as usize} + } + + /// The value of CMSG_LEN on this message. + /// Safe because CMSG_LEN is always safe + #[cfg(any(target_os = "android", + all(target_os = "linux", not(target_env = "musl"))))] + fn cmsg_len(&self) -> usize { + unsafe{CMSG_LEN(self.len() as libc::c_uint) as usize} + } + + #[cfg(not(any(target_os = "android", + all(target_os = "linux", not(target_env = "musl")))))] + fn cmsg_len(&self) -> libc::c_uint { + unsafe{CMSG_LEN(self.len() as libc::c_uint)} + } + + /// Return a reference to the payload data as a byte pointer + fn copy_to_cmsg_data(&self, cmsg_data: *mut u8) { + let data_ptr = match *self { + ControlMessage::ScmRights(fds) => { + fds as *const _ as *const u8 + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(creds) => { + &creds.0 as *const libc::ucred as *const u8 + } + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => { + // The kernel overwrites the data, we just zero it + // to make sure it's not uninitialized memory + unsafe { ptr::write_bytes(cmsg_data, 0, self.len()) }; + return + } + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(iv) => { + #[allow(deprecated)] // https://github.com/rust-lang/libc/issues/1501 + let af_alg_iv = libc::af_alg_iv { + ivlen: iv.len() as u32, + iv: [0u8; 0], + }; + + let size = mem::size_of_val(&af_alg_iv); + + unsafe { + ptr::copy_nonoverlapping( + &af_alg_iv as *const _ as *const u8, + cmsg_data, + size, + ); + ptr::copy_nonoverlapping( + iv.as_ptr(), + cmsg_data.add(size), + iv.len() + ); + }; + + return + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetOp(op) => { + op as *const _ as *const u8 + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetAeadAssoclen(len) => { + len as *const _ as *const u8 + }, + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + ControlMessage::UdpGsoSegments(gso_size) => { + gso_size as *const _ as *const u8 + }, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv4PacketInfo(info) => info as *const _ as *const u8, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv6PacketInfo(info) => info as *const _ as *const u8, + #[cfg(any(target_os = "netbsd", target_os = "freebsd", + target_os = "openbsd", target_os = "dragonfly"))] + #[cfg(feature = "net")] + ControlMessage::Ipv4SendSrcAddr(addr) => addr as *const _ as *const u8, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(drop_count) => { + drop_count as *const _ as *const u8 + }, + #[cfg(target_os = "linux")] + ControlMessage::TxTime(tx_time) => { + tx_time as *const _ as *const u8 + }, + }; + unsafe { + ptr::copy_nonoverlapping( + data_ptr, + cmsg_data, + self.len() + ) + }; + } + + /// The size of the payload, excluding its cmsghdr + fn len(&self) -> usize { + match *self { + ControlMessage::ScmRights(fds) => { + mem::size_of_val(fds) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(creds) => { + mem::size_of_val(creds) + } + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => { + mem::size_of::() + } + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(iv) => { + mem::size_of_val(&iv) + iv.len() + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetOp(op) => { + mem::size_of_val(op) + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetAeadAssoclen(len) => { + mem::size_of_val(len) + }, + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + ControlMessage::UdpGsoSegments(gso_size) => { + mem::size_of_val(gso_size) + }, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv4PacketInfo(info) => mem::size_of_val(info), + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv6PacketInfo(info) => mem::size_of_val(info), + #[cfg(any(target_os = "netbsd", target_os = "freebsd", + target_os = "openbsd", target_os = "dragonfly"))] + #[cfg(feature = "net")] + ControlMessage::Ipv4SendSrcAddr(addr) => mem::size_of_val(addr), + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(drop_count) => { + mem::size_of_val(drop_count) + }, + #[cfg(target_os = "linux")] + ControlMessage::TxTime(tx_time) => { + mem::size_of_val(tx_time) + }, + } + } + + /// Returns the value to put into the `cmsg_level` field of the header. + fn cmsg_level(&self) -> libc::c_int { + match *self { + ControlMessage::ScmRights(_) => libc::SOL_SOCKET, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(_) => libc::SOL_SOCKET, + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => libc::SOL_SOCKET, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(_) | ControlMessage::AlgSetOp(_) | + ControlMessage::AlgSetAeadAssoclen(_) => libc::SOL_ALG, + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + ControlMessage::UdpGsoSegments(_) => libc::SOL_UDP, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv4PacketInfo(_) => libc::IPPROTO_IP, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv6PacketInfo(_) => libc::IPPROTO_IPV6, + #[cfg(any(target_os = "netbsd", target_os = "freebsd", + target_os = "openbsd", target_os = "dragonfly"))] + #[cfg(feature = "net")] + ControlMessage::Ipv4SendSrcAddr(_) => libc::IPPROTO_IP, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(_) => libc::SOL_SOCKET, + #[cfg(target_os = "linux")] + ControlMessage::TxTime(_) => libc::SOL_SOCKET, + } + } + + /// Returns the value to put into the `cmsg_type` field of the header. + fn cmsg_type(&self) -> libc::c_int { + match *self { + ControlMessage::ScmRights(_) => libc::SCM_RIGHTS, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::ScmCredentials(_) => libc::SCM_CREDENTIALS, + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessage::ScmCreds => libc::SCM_CREDS, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetIv(_) => { + libc::ALG_SET_IV + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetOp(_) => { + libc::ALG_SET_OP + }, + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessage::AlgSetAeadAssoclen(_) => { + libc::ALG_SET_AEAD_ASSOCLEN + }, + #[cfg(target_os = "linux")] + #[cfg(feature = "net")] + ControlMessage::UdpGsoSegments(_) => { + libc::UDP_SEGMENT + }, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "android", + target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv4PacketInfo(_) => libc::IP_PKTINFO, + #[cfg(any(target_os = "linux", target_os = "macos", + target_os = "netbsd", target_os = "freebsd", + target_os = "android", target_os = "ios",))] + #[cfg(feature = "net")] + ControlMessage::Ipv6PacketInfo(_) => libc::IPV6_PKTINFO, + #[cfg(any(target_os = "netbsd", target_os = "freebsd", + target_os = "openbsd", target_os = "dragonfly"))] + #[cfg(feature = "net")] + ControlMessage::Ipv4SendSrcAddr(_) => libc::IP_SENDSRCADDR, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + ControlMessage::RxqOvfl(_) => { + libc::SO_RXQ_OVFL + }, + #[cfg(target_os = "linux")] + ControlMessage::TxTime(_) => { + libc::SCM_TXTIME + }, + } + } + + // Unsafe: cmsg must point to a valid cmsghdr with enough space to + // encode self. + unsafe fn encode_into(&self, cmsg: *mut cmsghdr) { + (*cmsg).cmsg_level = self.cmsg_level(); + (*cmsg).cmsg_type = self.cmsg_type(); + (*cmsg).cmsg_len = self.cmsg_len(); + self.copy_to_cmsg_data(CMSG_DATA(cmsg)); + } +} + + +/// Send data in scatter-gather vectors to a socket, possibly accompanied +/// by ancillary data. Optionally direct the message at the given address, +/// as with sendto. +/// +/// Allocates if cmsgs is nonempty. +/// +/// # Examples +/// When not directing to any specific address, use `()` for the generic type +/// ``` +/// # use nix::sys::socket::*; +/// # use nix::unistd::pipe; +/// # use std::io::IoSlice; +/// let (fd1, fd2) = socketpair(AddressFamily::Unix, SockType::Stream, None, +/// SockFlag::empty()) +/// .unwrap(); +/// let (r, w) = pipe().unwrap(); +/// +/// let iov = [IoSlice::new(b"hello")]; +/// let fds = [r]; +/// let cmsg = ControlMessage::ScmRights(&fds); +/// sendmsg::<()>(fd1, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(); +/// ``` +/// When directing to a specific address, the generic type will be inferred. +/// ``` +/// # use nix::sys::socket::*; +/// # use nix::unistd::pipe; +/// # use std::io::IoSlice; +/// # use std::str::FromStr; +/// let localhost = SockaddrIn::from_str("1.2.3.4:8080").unwrap(); +/// let fd = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), +/// None).unwrap(); +/// let (r, w) = pipe().unwrap(); +/// +/// let iov = [IoSlice::new(b"hello")]; +/// let fds = [r]; +/// let cmsg = ControlMessage::ScmRights(&fds); +/// sendmsg(fd, &iov, &[cmsg], MsgFlags::empty(), Some(&localhost)).unwrap(); +/// ``` +pub fn sendmsg(fd: RawFd, iov: &[IoSlice<'_>], cmsgs: &[ControlMessage], + flags: MsgFlags, addr: Option<&S>) -> Result + where S: SockaddrLike +{ + let capacity = cmsgs.iter().map(|c| c.space()).sum(); + + // First size the buffer needed to hold the cmsgs. It must be zeroed, + // because subsequent code will not clear the padding bytes. + let mut cmsg_buffer = vec![0u8; capacity]; + + let mhdr = pack_mhdr_to_send(&mut cmsg_buffer[..], &iov, &cmsgs, addr); + + let ret = unsafe { libc::sendmsg(fd, &mhdr, flags.bits()) }; + + Errno::result(ret).map(|r| r as usize) +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +#[derive(Debug)] +pub struct SendMmsgData<'a, I, C, S> + where + I: AsRef<[IoSlice<'a>]>, + C: AsRef<[ControlMessage<'a>]>, + S: SockaddrLike + 'a +{ + pub iov: I, + pub cmsgs: C, + pub addr: Option, + pub _lt: std::marker::PhantomData<&'a I>, +} + +/// An extension of `sendmsg` that allows the caller to transmit multiple +/// messages on a socket using a single system call. This has performance +/// benefits for some applications. +/// +/// Allocations are performed for cmsgs and to build `msghdr` buffer +/// +/// # Arguments +/// +/// * `fd`: Socket file descriptor +/// * `data`: Struct that implements `IntoIterator` with `SendMmsgData` items +/// * `flags`: Optional flags passed directly to the operating system. +/// +/// # Returns +/// `Vec` with numbers of sent bytes on each sent message. +/// +/// # References +/// [`sendmsg`](fn.sendmsg.html) +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +pub fn sendmmsg<'a, I, C, S>( + fd: RawFd, + data: impl std::iter::IntoIterator>, + flags: MsgFlags +) -> Result> + where + I: AsRef<[IoSlice<'a>]> + 'a, + C: AsRef<[ControlMessage<'a>]> + 'a, + S: SockaddrLike + 'a +{ + let iter = data.into_iter(); + + let size_hint = iter.size_hint(); + let reserve_items = size_hint.1.unwrap_or(size_hint.0); + + let mut output = Vec::::with_capacity(reserve_items); + + let mut cmsgs_buffers = Vec::>::with_capacity(reserve_items); + + for d in iter { + let capacity: usize = d.cmsgs.as_ref().iter().map(|c| c.space()).sum(); + let mut cmsgs_buffer = vec![0u8; capacity]; + + output.push(libc::mmsghdr { + msg_hdr: pack_mhdr_to_send( + &mut cmsgs_buffer, + &d.iov, + &d.cmsgs, + d.addr.as_ref() + ), + msg_len: 0, + }); + cmsgs_buffers.push(cmsgs_buffer); + }; + + let ret = unsafe { libc::sendmmsg(fd, output.as_mut_ptr(), output.len() as _, flags.bits() as _) }; + + let sent_messages = Errno::result(ret)? as usize; + let mut sent_bytes = Vec::with_capacity(sent_messages); + + for item in &output { + sent_bytes.push(item.msg_len as usize); + } + + Ok(sent_bytes) +} + + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +#[derive(Debug)] +pub struct RecvMmsgData<'a, I> + where + I: AsRef<[IoSliceMut<'a>]> + 'a, +{ + pub iov: I, + pub cmsg_buffer: Option<&'a mut Vec>, +} + +/// An extension of `recvmsg` that allows the caller to receive multiple +/// messages from a socket using a single system call. This has +/// performance benefits for some applications. +/// +/// `iov` and `cmsg_buffer` should be constructed similarly to `recvmsg` +/// +/// Multiple allocations are performed +/// +/// # Arguments +/// +/// * `fd`: Socket file descriptor +/// * `data`: Struct that implements `IntoIterator` with `RecvMmsgData` items +/// * `flags`: Optional flags passed directly to the operating system. +/// +/// # RecvMmsgData +/// +/// * `iov`: Scatter-gather list of buffers to receive the message +/// * `cmsg_buffer`: Space to receive ancillary data. Should be created by +/// [`cmsg_space!`](../../macro.cmsg_space.html) +/// +/// # Returns +/// A `Vec` with multiple `RecvMsg`, one per received message +/// +/// # References +/// - [`recvmsg`](fn.recvmsg.html) +/// - [`RecvMsg`](struct.RecvMsg.html) +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", +))] +#[allow(clippy::needless_collect)] // Complicated false positive +pub fn recvmmsg<'a, I, S>( + fd: RawFd, + data: impl std::iter::IntoIterator, + IntoIter=impl ExactSizeIterator + Iterator>>, + flags: MsgFlags, + timeout: Option +) -> Result>> + where + I: AsRef<[IoSliceMut<'a>]> + 'a, + S: Copy + SockaddrLike + 'a +{ + let iter = data.into_iter(); + + let num_messages = iter.len(); + + let mut output: Vec = Vec::with_capacity(num_messages); + + // Addresses should be pre-allocated. pack_mhdr_to_receive will store them + // as raw pointers, so we may not move them. Turn the vec into a boxed + // slice so we won't inadvertently reallocate the vec. + let mut addresses = vec![mem::MaybeUninit::uninit(); num_messages] + .into_boxed_slice(); + + let results: Vec<_> = iter.enumerate().map(|(i, d)| { + let (msg_controllen, mhdr) = unsafe { + pack_mhdr_to_receive( + d.iov.as_ref(), + &mut d.cmsg_buffer, + addresses[i].as_mut_ptr(), + ) + }; + + output.push( + libc::mmsghdr { + msg_hdr: mhdr, + msg_len: 0, + } + ); + + (msg_controllen as usize, &mut d.cmsg_buffer) + }).collect(); + + let timeout = if let Some(mut t) = timeout { + t.as_mut() as *mut libc::timespec + } else { + ptr::null_mut() + }; + + let ret = unsafe { libc::recvmmsg(fd, output.as_mut_ptr(), output.len() as _, flags.bits() as _, timeout) }; + + let _ = Errno::result(ret)?; + + Ok(output + .into_iter() + .take(ret as usize) + .zip(addresses.iter().map(|addr| unsafe{addr.assume_init()})) + .zip(results.into_iter()) + .map(|((mmsghdr, address), (msg_controllen, cmsg_buffer))| { + unsafe { + read_mhdr( + mmsghdr.msg_hdr, + mmsghdr.msg_len as isize, + msg_controllen, + address, + cmsg_buffer + ) + } + }) + .collect()) +} + +unsafe fn read_mhdr<'a, 'b, S>( + mhdr: msghdr, + r: isize, + msg_controllen: usize, + address: S, + cmsg_buffer: &'a mut Option<&'b mut Vec> +) -> RecvMsg<'b, S> + where S: SockaddrLike +{ + let cmsghdr = { + if mhdr.msg_controllen > 0 { + // got control message(s) + cmsg_buffer + .as_mut() + .unwrap() + .set_len(mhdr.msg_controllen as usize); + debug_assert!(!mhdr.msg_control.is_null()); + debug_assert!(msg_controllen >= mhdr.msg_controllen as usize); + CMSG_FIRSTHDR(&mhdr as *const msghdr) + } else { + ptr::null() + }.as_ref() + }; + + RecvMsg { + bytes: r as usize, + cmsghdr, + address: Some(address), + flags: MsgFlags::from_bits_truncate(mhdr.msg_flags), + mhdr, + } +} + +unsafe fn pack_mhdr_to_receive<'outer, 'inner, I, S>( + iov: I, + cmsg_buffer: &mut Option<&mut Vec>, + address: *mut S, +) -> (usize, msghdr) + where + I: AsRef<[IoSliceMut<'inner>]> + 'outer, + S: SockaddrLike + 'outer +{ + let (msg_control, msg_controllen) = cmsg_buffer.as_mut() + .map(|v| (v.as_mut_ptr(), v.capacity())) + .unwrap_or((ptr::null_mut(), 0)); + + let mhdr = { + // Musl's msghdr has private fields, so this is the only way to + // initialize it. + let mut mhdr = mem::MaybeUninit::::zeroed(); + let p = mhdr.as_mut_ptr(); + (*p).msg_name = (*address).as_mut_ptr() as *mut c_void; + (*p).msg_namelen = S::size(); + (*p).msg_iov = iov.as_ref().as_ptr() as *mut iovec; + (*p).msg_iovlen = iov.as_ref().len() as _; + (*p).msg_control = msg_control as *mut c_void; + (*p).msg_controllen = msg_controllen as _; + (*p).msg_flags = 0; + mhdr.assume_init() + }; + + (msg_controllen, mhdr) +} + +fn pack_mhdr_to_send<'a, I, C, S>( + cmsg_buffer: &mut [u8], + iov: I, + cmsgs: C, + addr: Option<&S> +) -> msghdr + where + I: AsRef<[IoSlice<'a>]>, + C: AsRef<[ControlMessage<'a>]>, + S: SockaddrLike + 'a +{ + let capacity = cmsg_buffer.len(); + + // The message header must be initialized before the individual cmsgs. + let cmsg_ptr = if capacity > 0 { + cmsg_buffer.as_ptr() as *mut c_void + } else { + ptr::null_mut() + }; + + let mhdr = unsafe { + // Musl's msghdr has private fields, so this is the only way to + // initialize it. + let mut mhdr = mem::MaybeUninit::::zeroed(); + let p = mhdr.as_mut_ptr(); + (*p).msg_name = addr.map(S::as_ptr).unwrap_or(ptr::null()) as *mut _; + (*p).msg_namelen = addr.map(S::len).unwrap_or(0); + // transmute iov into a mutable pointer. sendmsg doesn't really mutate + // the buffer, but the standard says that it takes a mutable pointer + (*p).msg_iov = iov.as_ref().as_ptr() as *mut _; + (*p).msg_iovlen = iov.as_ref().len() as _; + (*p).msg_control = cmsg_ptr; + (*p).msg_controllen = capacity as _; + (*p).msg_flags = 0; + mhdr.assume_init() + }; + + // Encode each cmsg. This must happen after initializing the header because + // CMSG_NEXT_HDR and friends read the msg_control and msg_controllen fields. + // CMSG_FIRSTHDR is always safe + let mut pmhdr: *mut cmsghdr = unsafe { CMSG_FIRSTHDR(&mhdr as *const msghdr) }; + for cmsg in cmsgs.as_ref() { + assert_ne!(pmhdr, ptr::null_mut()); + // Safe because we know that pmhdr is valid, and we initialized it with + // sufficient space + unsafe { cmsg.encode_into(pmhdr) }; + // Safe because mhdr is valid + pmhdr = unsafe { CMSG_NXTHDR(&mhdr as *const msghdr, pmhdr) }; + } + + mhdr +} + +/// Receive message in scatter-gather vectors from a socket, and +/// optionally receive ancillary data into the provided buffer. +/// If no ancillary data is desired, use () as the type parameter. +/// +/// # Arguments +/// +/// * `fd`: Socket file descriptor +/// * `iov`: Scatter-gather list of buffers to receive the message +/// * `cmsg_buffer`: Space to receive ancillary data. Should be created by +/// [`cmsg_space!`](../../macro.cmsg_space.html) +/// * `flags`: Optional flags passed directly to the operating system. +/// +/// # References +/// [recvmsg(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvmsg.html) +pub fn recvmsg<'a, 'outer, 'inner, S>(fd: RawFd, iov: &'outer mut [IoSliceMut<'inner>], + mut cmsg_buffer: Option<&'a mut Vec>, + flags: MsgFlags) -> Result> + where S: SockaddrLike + 'a +{ + let mut address = mem::MaybeUninit::uninit(); + + let (msg_controllen, mut mhdr) = unsafe { + pack_mhdr_to_receive::<_, S>(iov, &mut cmsg_buffer, address.as_mut_ptr()) + }; + + let ret = unsafe { libc::recvmsg(fd, &mut mhdr, flags.bits()) }; + + let r = Errno::result(ret)?; + + Ok(unsafe { read_mhdr(mhdr, r, msg_controllen, address.assume_init(), &mut cmsg_buffer) }) +} +} + + +/// Create an endpoint for communication +/// +/// The `protocol` specifies a particular protocol to be used with the +/// socket. Normally only a single protocol exists to support a +/// particular socket type within a given protocol family, in which case +/// protocol can be specified as `None`. However, it is possible that many +/// protocols may exist, in which case a particular protocol must be +/// specified in this manner. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html) +pub fn socket>>(domain: AddressFamily, ty: SockType, flags: SockFlag, protocol: T) -> Result { + let protocol = match protocol.into() { + None => 0, + Some(p) => p as c_int, + }; + + // SockFlags are usually embedded into `ty`, but we don't do that in `nix` because it's a + // little easier to understand by separating it out. So we have to merge these bitfields + // here. + let mut ty = ty as c_int; + ty |= flags.bits(); + + let res = unsafe { libc::socket(domain as c_int, ty, protocol) }; + + Errno::result(res) +} + +/// Create a pair of connected sockets +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/socketpair.html) +pub fn socketpair>>(domain: AddressFamily, ty: SockType, protocol: T, + flags: SockFlag) -> Result<(RawFd, RawFd)> { + let protocol = match protocol.into() { + None => 0, + Some(p) => p as c_int, + }; + + // SockFlags are usually embedded into `ty`, but we don't do that in `nix` because it's a + // little easier to understand by separating it out. So we have to merge these bitfields + // here. + let mut ty = ty as c_int; + ty |= flags.bits(); + + let mut fds = [-1, -1]; + + let res = unsafe { libc::socketpair(domain as c_int, ty, protocol, fds.as_mut_ptr()) }; + Errno::result(res)?; + + Ok((fds[0], fds[1])) +} + +/// Listen for connections on a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/listen.html) +pub fn listen(sockfd: RawFd, backlog: usize) -> Result<()> { + let res = unsafe { libc::listen(sockfd, backlog as c_int) }; + + Errno::result(res).map(drop) +} + +/// Bind a name to a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/bind.html) +pub fn bind(fd: RawFd, addr: &dyn SockaddrLike) -> Result<()> { + let res = unsafe { + libc::bind(fd, addr.as_ptr(), addr.len()) + }; + + Errno::result(res).map(drop) +} + +/// Accept a connection on a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/accept.html) +pub fn accept(sockfd: RawFd) -> Result { + let res = unsafe { libc::accept(sockfd, ptr::null_mut(), ptr::null_mut()) }; + + Errno::result(res) +} + +/// Accept a connection on a socket +/// +/// [Further reading](https://man7.org/linux/man-pages/man2/accept.2.html) +#[cfg(any(all( + target_os = "android", + any( + target_arch = "aarch64", + target_arch = "x86", + target_arch = "x86_64" + ) + ), + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd"))] +pub fn accept4(sockfd: RawFd, flags: SockFlag) -> Result { + let res = unsafe { libc::accept4(sockfd, ptr::null_mut(), ptr::null_mut(), flags.bits()) }; + + Errno::result(res) +} + +/// Initiate a connection on a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html) +pub fn connect(fd: RawFd, addr: &dyn SockaddrLike) -> Result<()> { + let res = unsafe { + libc::connect(fd, addr.as_ptr(), addr.len()) + }; + + Errno::result(res).map(drop) +} + +/// Receive data from a connection-oriented socket. Returns the number of +/// bytes read +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/recv.html) +pub fn recv(sockfd: RawFd, buf: &mut [u8], flags: MsgFlags) -> Result { + unsafe { + let ret = libc::recv( + sockfd, + buf.as_ptr() as *mut c_void, + buf.len() as size_t, + flags.bits()); + + Errno::result(ret).map(|r| r as usize) + } +} + +/// Receive data from a connectionless or connection-oriented socket. Returns +/// the number of bytes read and, for connectionless sockets, the socket +/// address of the sender. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html) +pub fn recvfrom(sockfd: RawFd, buf: &mut [u8]) + -> Result<(usize, Option)> +{ + unsafe { + let mut addr = mem::MaybeUninit::::uninit(); + let mut len = mem::size_of_val(&addr) as socklen_t; + + let ret = Errno::result(libc::recvfrom( + sockfd, + buf.as_ptr() as *mut c_void, + buf.len() as size_t, + 0, + addr.as_mut_ptr() as *mut libc::sockaddr, + &mut len as *mut socklen_t))? as usize; + + Ok((ret, T::from_raw( + addr.assume_init().as_ptr() as *const libc::sockaddr, + Some(len)) + )) + } +} + +/// Send a message to a socket +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sendto.html) +pub fn sendto(fd: RawFd, buf: &[u8], addr: &dyn SockaddrLike, flags: MsgFlags) -> Result { + let ret = unsafe { + libc::sendto( + fd, + buf.as_ptr() as *const c_void, + buf.len() as size_t, + flags.bits(), + addr.as_ptr(), + addr.len() + ) + }; + + Errno::result(ret).map(|r| r as usize) +} + +/// Send data to a connection-oriented socket. Returns the number of bytes read +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/send.html) +pub fn send(fd: RawFd, buf: &[u8], flags: MsgFlags) -> Result { + let ret = unsafe { + libc::send(fd, buf.as_ptr() as *const c_void, buf.len() as size_t, flags.bits()) + }; + + Errno::result(ret).map(|r| r as usize) +} + +/* + * + * ===== Socket Options ===== + * + */ + +/// Represents a socket option that can be retrieved. +pub trait GetSockOpt : Copy { + type Val; + + /// Look up the value of this socket option on the given socket. + fn get(&self, fd: RawFd) -> Result; +} + +/// Represents a socket option that can be set. +pub trait SetSockOpt : Clone { + type Val; + + /// Set the value of this socket option on the given socket. + fn set(&self, fd: RawFd, val: &Self::Val) -> Result<()>; +} + +/// Get the current value for the requested socket option +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html) +pub fn getsockopt(fd: RawFd, opt: O) -> Result { + opt.get(fd) +} + +/// Sets the value for the requested socket option +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setsockopt.html) +/// +/// # Examples +/// +/// ``` +/// use nix::sys::socket::setsockopt; +/// use nix::sys::socket::sockopt::KeepAlive; +/// use std::net::TcpListener; +/// use std::os::unix::io::AsRawFd; +/// +/// let listener = TcpListener::bind("0.0.0.0:0").unwrap(); +/// let fd = listener.as_raw_fd(); +/// let res = setsockopt(fd, KeepAlive, &true); +/// assert!(res.is_ok()); +/// ``` +pub fn setsockopt(fd: RawFd, opt: O, val: &O::Val) -> Result<()> { + opt.set(fd, val) +} + +/// Get the address of the peer connected to the socket `fd`. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpeername.html) +pub fn getpeername(fd: RawFd) -> Result { + unsafe { + let mut addr = mem::MaybeUninit::::uninit(); + let mut len = T::size(); + + let ret = libc::getpeername( + fd, + addr.as_mut_ptr() as *mut libc::sockaddr, + &mut len + ); + + Errno::result(ret)?; + + T::from_raw(addr.assume_init().as_ptr(), Some(len)) + .ok_or(Errno::EINVAL) + } +} + +/// Get the current address to which the socket `fd` is bound. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockname.html) +pub fn getsockname(fd: RawFd) -> Result { + unsafe { + let mut addr = mem::MaybeUninit::::uninit(); + let mut len = T::size(); + + let ret = libc::getsockname( + fd, + addr.as_mut_ptr() as *mut libc::sockaddr, + &mut len + ); + + Errno::result(ret)?; + + T::from_raw(addr.assume_init().as_ptr(), Some(len)) + .ok_or(Errno::EINVAL) + } +} + +/// Return the appropriate `SockAddr` type from a `sockaddr_storage` of a +/// certain size. +/// +/// In C this would usually be done by casting. The `len` argument +/// should be the number of bytes in the `sockaddr_storage` that are actually +/// allocated and valid. It must be at least as large as all the useful parts +/// of the structure. Note that in the case of a `sockaddr_un`, `len` need not +/// include the terminating null. +#[deprecated( + since = "0.24.0", + note = "use SockaddrLike or SockaddrStorage instead" +)] +#[allow(deprecated)] +pub fn sockaddr_storage_to_addr( + addr: &sockaddr_storage, + len: usize) -> Result { + + assert!(len <= mem::size_of::()); + if len < mem::size_of_val(&addr.ss_family) { + return Err(Errno::ENOTCONN); + } + + match c_int::from(addr.ss_family) { + #[cfg(feature = "net")] + libc::AF_INET => { + assert!(len as usize >= mem::size_of::()); + let sin = unsafe { + *(addr as *const sockaddr_storage as *const sockaddr_in) + }; + Ok(SockAddr::Inet(InetAddr::V4(sin))) + } + #[cfg(feature = "net")] + libc::AF_INET6 => { + assert!(len as usize >= mem::size_of::()); + let sin6 = unsafe { + *(addr as *const _ as *const sockaddr_in6) + }; + Ok(SockAddr::Inet(InetAddr::V6(sin6))) + } + libc::AF_UNIX => { + unsafe { + let sun = *(addr as *const _ as *const sockaddr_un); + let sun_len = len.try_into().unwrap(); + Ok(SockAddr::Unix(UnixAddr::from_raw_parts(sun, sun_len))) + } + } + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(feature = "net")] + libc::AF_PACKET => { + use libc::sockaddr_ll; + // Don't assert anything about the size. + // Apparently the Linux kernel can return smaller sizes when + // the value in the last element of sockaddr_ll (`sll_addr`) is + // smaller than the declared size of that field + let sll = unsafe { + *(addr as *const _ as *const sockaddr_ll) + }; + Ok(SockAddr::Link(LinkAddr(sll))) + } + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_NETLINK => { + use libc::sockaddr_nl; + let snl = unsafe { + *(addr as *const _ as *const sockaddr_nl) + }; + Ok(SockAddr::Netlink(NetlinkAddr(snl))) + } + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_ALG => { + use libc::sockaddr_alg; + let salg = unsafe { + *(addr as *const _ as *const sockaddr_alg) + }; + Ok(SockAddr::Alg(AlgAddr(salg))) + } + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::AF_VSOCK => { + use libc::sockaddr_vm; + let svm = unsafe { + *(addr as *const _ as *const sockaddr_vm) + }; + Ok(SockAddr::Vsock(VsockAddr(svm))) + } + af => panic!("unexpected address family {}", af), + } +} + + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum Shutdown { + /// Further receptions will be disallowed. + Read, + /// Further transmissions will be disallowed. + Write, + /// Further receptions and transmissions will be disallowed. + Both, +} + +/// Shut down part of a full-duplex connection. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/shutdown.html) +pub fn shutdown(df: RawFd, how: Shutdown) -> Result<()> { + unsafe { + use libc::shutdown; + + let how = match how { + Shutdown::Read => libc::SHUT_RD, + Shutdown::Write => libc::SHUT_WR, + Shutdown::Both => libc::SHUT_RDWR, + }; + + Errno::result(shutdown(df, how)).map(drop) + } +} + +#[cfg(test)] +mod tests { + #[test] + fn can_use_cmsg_space() { + let _ = cmsg_space!(u8); + } +} diff --git a/bash-5.1/vendor/nix/src/sys/socket/sockopt.rs b/bash-5.1/vendor/nix/src/sys/socket/sockopt.rs new file mode 100644 index 0000000000000000000000000000000000000000..1cbb223ece1fae17f3d7326f3001196180da78fc --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/socket/sockopt.rs @@ -0,0 +1,1027 @@ +//! Socket options as used by `setsockopt` and `getsockopt`. +use cfg_if::cfg_if; +use super::{GetSockOpt, SetSockOpt}; +use crate::Result; +use crate::errno::Errno; +use crate::sys::time::TimeVal; +use libc::{self, c_int, c_void, socklen_t}; +use std::mem::{ + self, + MaybeUninit +}; +use std::os::unix::io::RawFd; +use std::ffi::{OsStr, OsString}; +#[cfg(target_family = "unix")] +use std::os::unix::ffi::OsStrExt; + +// Constants +// TCP_CA_NAME_MAX isn't defined in user space include files +#[cfg(any(target_os = "freebsd", target_os = "linux"))] +#[cfg(feature = "net")] +const TCP_CA_NAME_MAX: usize = 16; + +/// Helper for implementing `SetSockOpt` for a given socket option. See +/// [`::sys::socket::SetSockOpt`](sys/socket/trait.SetSockOpt.html). +/// +/// This macro aims to help implementing `SetSockOpt` for different socket options that accept +/// different kinds of data to be used with `setsockopt`. +/// +/// Instead of using this macro directly consider using `sockopt_impl!`, especially if the option +/// you are implementing represents a simple type. +/// +/// # Arguments +/// +/// * `$name:ident`: name of the type you want to implement `SetSockOpt` for. +/// * `$level:expr` : socket layer, or a `protocol level`: could be *raw sockets* +/// (`libc::SOL_SOCKET`), *ip protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc::IPPROTO_TCP`), +/// and more. Please refer to your system manual for more options. Will be passed as the second +/// argument (`level`) to the `setsockopt` call. +/// * `$flag:path`: a flag name to set. Some examples: `libc::SO_REUSEADDR`, `libc::TCP_NODELAY`, +/// `libc::IP_ADD_MEMBERSHIP` and others. Will be passed as the third argument (`option_name`) +/// to the `setsockopt` call. +/// * Type of the value that you are going to set. +/// * Type that implements the `Set` trait for the type from the previous item (like `SetBool` for +/// `bool`, `SetUsize` for `usize`, etc.). +macro_rules! setsockopt_impl { + ($name:ident, $level:expr, $flag:path, $ty:ty, $setter:ty) => { + impl SetSockOpt for $name { + type Val = $ty; + + fn set(&self, fd: RawFd, val: &$ty) -> Result<()> { + unsafe { + let setter: $setter = Set::new(val); + + let res = libc::setsockopt(fd, $level, $flag, + setter.ffi_ptr(), + setter.ffi_len()); + Errno::result(res).map(drop) + } + } + } + } +} + +/// Helper for implementing `GetSockOpt` for a given socket option. See +/// [`::sys::socket::GetSockOpt`](sys/socket/trait.GetSockOpt.html). +/// +/// This macro aims to help implementing `GetSockOpt` for different socket options that accept +/// different kinds of data to be use with `getsockopt`. +/// +/// Instead of using this macro directly consider using `sockopt_impl!`, especially if the option +/// you are implementing represents a simple type. +/// +/// # Arguments +/// +/// * Name of the type you want to implement `GetSockOpt` for. +/// * Socket layer, or a `protocol level`: could be *raw sockets* (`lic::SOL_SOCKET`), *ip +/// protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc::IPPROTO_TCP`), and more. Please refer +/// to your system manual for more options. Will be passed as the second argument (`level`) to +/// the `getsockopt` call. +/// * A flag to set. Some examples: `libc::SO_REUSEADDR`, `libc::TCP_NODELAY`, +/// `libc::SO_ORIGINAL_DST` and others. Will be passed as the third argument (`option_name`) to +/// the `getsockopt` call. +/// * Type of the value that you are going to get. +/// * Type that implements the `Get` trait for the type from the previous item (`GetBool` for +/// `bool`, `GetUsize` for `usize`, etc.). +macro_rules! getsockopt_impl { + ($name:ident, $level:expr, $flag:path, $ty:ty, $getter:ty) => { + impl GetSockOpt for $name { + type Val = $ty; + + fn get(&self, fd: RawFd) -> Result<$ty> { + unsafe { + let mut getter: $getter = Get::uninit(); + + let res = libc::getsockopt(fd, $level, $flag, + getter.ffi_ptr(), + getter.ffi_len()); + Errno::result(res)?; + + Ok(getter.assume_init()) + } + } + } + } +} + +/// Helper to generate the sockopt accessors. See +/// [`::sys::socket::GetSockOpt`](sys/socket/trait.GetSockOpt.html) and +/// [`::sys::socket::SetSockOpt`](sys/socket/trait.SetSockOpt.html). +/// +/// This macro aims to help implementing `GetSockOpt` and `SetSockOpt` for different socket options +/// that accept different kinds of data to be use with `getsockopt` and `setsockopt` respectively. +/// +/// Basically this macro wraps up the [`getsockopt_impl!`](macro.getsockopt_impl.html) and +/// [`setsockopt_impl!`](macro.setsockopt_impl.html) macros. +/// +/// # Arguments +/// +/// * `GetOnly`, `SetOnly` or `Both`: whether you want to implement only getter, only setter or +/// both of them. +/// * `$name:ident`: name of type `GetSockOpt`/`SetSockOpt` will be implemented for. +/// * `$level:expr` : socket layer, or a `protocol level`: could be *raw sockets* +/// (`lic::SOL_SOCKET`), *ip protocol* (libc::IPPROTO_IP), *tcp protocol* (`libc::IPPROTO_TCP`), +/// and more. Please refer to your system manual for more options. Will be passed as the second +/// argument (`level`) to the `getsockopt`/`setsockopt` call. +/// * `$flag:path`: a flag name to set. Some examples: `libc::SO_REUSEADDR`, `libc::TCP_NODELAY`, +/// `libc::IP_ADD_MEMBERSHIP` and others. Will be passed as the third argument (`option_name`) +/// to the `setsockopt`/`getsockopt` call. +/// * `$ty:ty`: type of the value that will be get/set. +/// * `$getter:ty`: `Get` implementation; optional; only for `GetOnly` and `Both`. +/// * `$setter:ty`: `Set` implementation; optional; only for `SetOnly` and `Both`. +// Some targets don't use all rules. +#[allow(unknown_lints)] +#[allow(unused_macro_rules)] +macro_rules! sockopt_impl { + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, bool) => { + sockopt_impl!($(#[$attr])* + $name, GetOnly, $level, $flag, bool, GetBool); + }; + + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, u8) => { + sockopt_impl!($(#[$attr])* $name, GetOnly, $level, $flag, u8, GetU8); + }; + + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, usize) => + { + sockopt_impl!($(#[$attr])* + $name, GetOnly, $level, $flag, usize, GetUsize); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, bool) => { + sockopt_impl!($(#[$attr])* + $name, SetOnly, $level, $flag, bool, SetBool); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, u8) => { + sockopt_impl!($(#[$attr])* $name, SetOnly, $level, $flag, u8, SetU8); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, usize) => + { + sockopt_impl!($(#[$attr])* + $name, SetOnly, $level, $flag, usize, SetUsize); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, bool) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, bool, GetBool, SetBool); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, u8) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, u8, GetU8, SetU8); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, usize) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, usize, GetUsize, SetUsize); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, + OsString<$array:ty>) => + { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, OsString, GetOsString<$array>, + SetOsString); + }; + + /* + * Matchers with generic getter types must be placed at the end, so + * they'll only match _after_ specialized matchers fail + */ + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, $ty:ty) => + { + sockopt_impl!($(#[$attr])* + $name, GetOnly, $level, $flag, $ty, GetStruct<$ty>); + }; + + ($(#[$attr:meta])* $name:ident, GetOnly, $level:expr, $flag:path, $ty:ty, + $getter:ty) => + { + $(#[$attr])* + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct $name; + + getsockopt_impl!($name, $level, $flag, $ty, $getter); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, $ty:ty) => + { + sockopt_impl!($(#[$attr])* + $name, SetOnly, $level, $flag, $ty, SetStruct<$ty>); + }; + + ($(#[$attr:meta])* $name:ident, SetOnly, $level:expr, $flag:path, $ty:ty, + $setter:ty) => + { + $(#[$attr])* + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct $name; + + setsockopt_impl!($name, $level, $flag, $ty, $setter); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, $ty:ty, + $getter:ty, $setter:ty) => + { + $(#[$attr])* + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct $name; + + setsockopt_impl!($name, $level, $flag, $ty, $setter); + getsockopt_impl!($name, $level, $flag, $ty, $getter); + }; + + ($(#[$attr:meta])* $name:ident, Both, $level:expr, $flag:path, $ty:ty) => { + sockopt_impl!($(#[$attr])* + $name, Both, $level, $flag, $ty, GetStruct<$ty>, + SetStruct<$ty>); + }; +} + +/* + * + * ===== Define sockopts ===== + * + */ + +sockopt_impl!( + /// Enables local address reuse + ReuseAddr, Both, libc::SOL_SOCKET, libc::SO_REUSEADDR, bool +); +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] +sockopt_impl!( + /// Permits multiple AF_INET or AF_INET6 sockets to be bound to an + /// identical socket address. + ReusePort, Both, libc::SOL_SOCKET, libc::SO_REUSEPORT, bool); +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Under most circumstances, TCP sends data when it is presented; when + /// outstanding data has not yet been acknowledged, it gathers small amounts + /// of output to be sent in a single packet once an acknowledgement is + /// received. For a small number of clients, such as window systems that + /// send a stream of mouse events which receive no replies, this + /// packetization may cause significant delays. The boolean option + /// TCP_NODELAY defeats this algorithm. + TcpNoDelay, Both, libc::IPPROTO_TCP, libc::TCP_NODELAY, bool); +sockopt_impl!( + /// When enabled, a close(2) or shutdown(2) will not return until all + /// queued messages for the socket have been successfully sent or the + /// linger timeout has been reached. + Linger, Both, libc::SOL_SOCKET, libc::SO_LINGER, libc::linger); +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Join a multicast group + IpAddMembership, SetOnly, libc::IPPROTO_IP, libc::IP_ADD_MEMBERSHIP, + super::IpMembershipRequest); +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Leave a multicast group. + IpDropMembership, SetOnly, libc::IPPROTO_IP, libc::IP_DROP_MEMBERSHIP, + super::IpMembershipRequest); +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + #[cfg(feature = "net")] + sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Join an IPv6 multicast group. + Ipv6AddMembership, SetOnly, libc::IPPROTO_IPV6, libc::IPV6_ADD_MEMBERSHIP, super::Ipv6MembershipRequest); + #[cfg(feature = "net")] + sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Leave an IPv6 multicast group. + Ipv6DropMembership, SetOnly, libc::IPPROTO_IPV6, libc::IPV6_DROP_MEMBERSHIP, super::Ipv6MembershipRequest); + } else if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] { + #[cfg(feature = "net")] + sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Join an IPv6 multicast group. + Ipv6AddMembership, SetOnly, libc::IPPROTO_IPV6, + libc::IPV6_JOIN_GROUP, super::Ipv6MembershipRequest); + #[cfg(feature = "net")] + sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Leave an IPv6 multicast group. + Ipv6DropMembership, SetOnly, libc::IPPROTO_IPV6, + libc::IPV6_LEAVE_GROUP, super::Ipv6MembershipRequest); + } +} +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Set or read the time-to-live value of outgoing multicast packets for + /// this socket. + IpMulticastTtl, Both, libc::IPPROTO_IP, libc::IP_MULTICAST_TTL, u8); +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Set or read a boolean integer argument that determines whether sent + /// multicast packets should be looped back to the local sockets. + IpMulticastLoop, Both, libc::IPPROTO_IP, libc::IP_MULTICAST_LOOP, bool); +#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// If enabled, this boolean option allows binding to an IP address that + /// is nonlocal or does not (yet) exist. + IpFreebind, Both, libc::IPPROTO_IP, libc::IP_FREEBIND, bool); +sockopt_impl!( + /// Specify the receiving timeout until reporting an error. + ReceiveTimeout, Both, libc::SOL_SOCKET, libc::SO_RCVTIMEO, TimeVal); +sockopt_impl!( + /// Specify the sending timeout until reporting an error. + SendTimeout, Both, libc::SOL_SOCKET, libc::SO_SNDTIMEO, TimeVal); +sockopt_impl!( + /// Set or get the broadcast flag. + Broadcast, Both, libc::SOL_SOCKET, libc::SO_BROADCAST, bool); +sockopt_impl!( + /// If this option is enabled, out-of-band data is directly placed into + /// the receive data stream. + OobInline, Both, libc::SOL_SOCKET, libc::SO_OOBINLINE, bool); +sockopt_impl!( + /// Get and clear the pending socket error. + SocketError, GetOnly, libc::SOL_SOCKET, libc::SO_ERROR, i32); +sockopt_impl!( + /// Set or get the don't route flag. + DontRoute, Both, libc::SOL_SOCKET, libc::SO_DONTROUTE, bool); +sockopt_impl!( + /// Enable sending of keep-alive messages on connection-oriented sockets. + KeepAlive, Both, libc::SOL_SOCKET, libc::SO_KEEPALIVE, bool); +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios" +))] +sockopt_impl!( + /// Get the credentials of the peer process of a connected unix domain + /// socket. + LocalPeerCred, GetOnly, 0, libc::LOCAL_PEERCRED, super::XuCred); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Return the credentials of the foreign process connected to this socket. + PeerCredentials, GetOnly, libc::SOL_SOCKET, libc::SO_PEERCRED, super::UnixCredentials); +#[cfg(any(target_os = "ios", + target_os = "macos"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Specify the amount of time, in seconds, that the connection must be idle + /// before keepalive probes (if enabled) are sent. + TcpKeepAlive, Both, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE, u32); +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The time (in seconds) the connection needs to remain idle before TCP + /// starts sending keepalive probes + TcpKeepIdle, Both, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE, u32); +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + sockopt_impl!( + /// The maximum segment size for outgoing TCP packets. + TcpMaxSeg, Both, libc::IPPROTO_TCP, libc::TCP_MAXSEG, u32); + } else { + sockopt_impl!( + /// The maximum segment size for outgoing TCP packets. + TcpMaxSeg, GetOnly, libc::IPPROTO_TCP, libc::TCP_MAXSEG, u32); + } +} +#[cfg(not(any(target_os = "openbsd", target_os = "haiku")))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The maximum number of keepalive probes TCP should send before + /// dropping the connection. + TcpKeepCount, Both, libc::IPPROTO_TCP, libc::TCP_KEEPCNT, u32); +#[cfg(any(target_os = "android", + target_os = "fuchsia", + target_os = "linux"))] +sockopt_impl!( + #[allow(missing_docs)] + // Not documented by Linux! + TcpRepair, Both, libc::IPPROTO_TCP, libc::TCP_REPAIR, u32); +#[cfg(not(any(target_os = "openbsd", target_os = "haiku")))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The time (in seconds) between individual keepalive probes. + TcpKeepInterval, Both, libc::IPPROTO_TCP, libc::TCP_KEEPINTVL, u32); +#[cfg(any(target_os = "fuchsia", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Specifies the maximum amount of time in milliseconds that transmitted + /// data may remain unacknowledged before TCP will forcibly close the + /// corresponding connection + TcpUserTimeout, Both, libc::IPPROTO_TCP, libc::TCP_USER_TIMEOUT, u32); +sockopt_impl!( + /// Sets or gets the maximum socket receive buffer in bytes. + RcvBuf, Both, libc::SOL_SOCKET, libc::SO_RCVBUF, usize); +sockopt_impl!( + /// Sets or gets the maximum socket send buffer in bytes. + SndBuf, Both, libc::SOL_SOCKET, libc::SO_SNDBUF, usize); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Using this socket option, a privileged (`CAP_NET_ADMIN`) process can + /// perform the same task as `SO_RCVBUF`, but the `rmem_max limit` can be + /// overridden. + RcvBufForce, SetOnly, libc::SOL_SOCKET, libc::SO_RCVBUFFORCE, usize); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Using this socket option, a privileged (`CAP_NET_ADMIN`) process can + /// perform the same task as `SO_SNDBUF`, but the `wmem_max` limit can be + /// overridden. + SndBufForce, SetOnly, libc::SOL_SOCKET, libc::SO_SNDBUFFORCE, usize); +sockopt_impl!( + /// Gets the socket type as an integer. + SockType, GetOnly, libc::SOL_SOCKET, libc::SO_TYPE, super::SockType); +sockopt_impl!( + /// Returns a value indicating whether or not this socket has been marked to + /// accept connections with `listen(2)`. + AcceptConn, GetOnly, libc::SOL_SOCKET, libc::SO_ACCEPTCONN, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Bind this socket to a particular device like “eth0”. + BindToDevice, Both, libc::SOL_SOCKET, libc::SO_BINDTODEVICE, OsString<[u8; libc::IFNAMSIZ]>); +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + #[allow(missing_docs)] + // Not documented by Linux! + OriginalDst, GetOnly, libc::SOL_IP, libc::SO_ORIGINAL_DST, libc::sockaddr_in); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + #[allow(missing_docs)] + // Not documented by Linux! + Ip6tOriginalDst, GetOnly, libc::SOL_IPV6, libc::IP6T_SO_ORIGINAL_DST, libc::sockaddr_in6); +#[cfg(any(target_os = "linux"))] +sockopt_impl!( + /// Specifies exact type of timestamping information collected by the kernel + /// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html) + Timestamping, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMPING, super::TimestampingFlag); +#[cfg(not(target_os = "haiku"))] +sockopt_impl!( + /// Enable or disable the receiving of the `SO_TIMESTAMP` control message. + ReceiveTimestamp, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMP, bool); +#[cfg(all(target_os = "linux"))] +sockopt_impl!( + /// Enable or disable the receiving of the `SO_TIMESTAMPNS` control message. + ReceiveTimestampns, Both, libc::SOL_SOCKET, libc::SO_TIMESTAMPNS, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Setting this boolean option enables transparent proxying on this socket. + IpTransparent, Both, libc::SOL_IP, libc::IP_TRANSPARENT, bool); +#[cfg(target_os = "openbsd")] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Allows the socket to be bound to addresses which are not local to the + /// machine, so it can be used to make a transparent proxy. + BindAny, Both, libc::SOL_SOCKET, libc::SO_BINDANY, bool); +#[cfg(target_os = "freebsd")] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Can `bind(2)` to any address, even one not bound to any available + /// network interface in the system. + BindAny, Both, libc::IPPROTO_IP, libc::IP_BINDANY, bool); +#[cfg(target_os = "linux")] +sockopt_impl!( + /// Set the mark for each packet sent through this socket (similar to the + /// netfilter MARK target but socket-based). + Mark, Both, libc::SOL_SOCKET, libc::SO_MARK, u32); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Enable or disable the receiving of the `SCM_CREDENTIALS` control + /// message. + PassCred, Both, libc::SOL_SOCKET, libc::SO_PASSCRED, bool); +#[cfg(any(target_os = "freebsd", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// This option allows the caller to set the TCP congestion control + /// algorithm to be used, on a per-socket basis. + TcpCongestion, Both, libc::IPPROTO_TCP, libc::TCP_CONGESTION, OsString<[u8; TCP_CA_NAME_MAX]>); +#[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", +))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Pass an `IP_PKTINFO` ancillary message that contains a pktinfo + /// structure that supplies some information about the incoming packet. + Ipv4PacketInfo, Both, libc::IPPROTO_IP, libc::IP_PKTINFO, bool); +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Set delivery of the `IPV6_PKTINFO` control message on incoming + /// datagrams. + Ipv6RecvPacketInfo, Both, libc::IPPROTO_IPV6, libc::IPV6_RECVPKTINFO, bool); +#[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The `recvmsg(2)` call returns a `struct sockaddr_dl` corresponding to + /// the interface on which the packet was received. + Ipv4RecvIf, Both, libc::IPPROTO_IP, libc::IP_RECVIF, bool); +#[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The `recvmsg(2)` call will return the destination IP address for a UDP + /// datagram. + Ipv4RecvDstAddr, Both, libc::IPPROTO_IP, libc::IP_RECVDSTADDR, bool); +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The `recvmsg(2)` call will return the destination IP address for a UDP + /// datagram. + Ipv4OrigDstAddr, Both, libc::IPPROTO_IP, libc::IP_ORIGDSTADDR, bool); +#[cfg(target_os = "linux")] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + #[allow(missing_docs)] + // Not documented by Linux! + UdpGsoSegment, Both, libc::SOL_UDP, libc::UDP_SEGMENT, libc::c_int); +#[cfg(target_os = "linux")] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + #[allow(missing_docs)] + // Not documented by Linux! + UdpGroSegment, Both, libc::IPPROTO_UDP, libc::UDP_GRO, bool); +#[cfg(target_os = "linux")] +sockopt_impl!( + /// Configures the behavior of time-based transmission of packets, for use + /// with the `TxTime` control message. + TxTime, Both, libc::SOL_SOCKET, libc::SO_TXTIME, libc::sock_txtime); +#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] +sockopt_impl!( + /// Indicates that an unsigned 32-bit value ancillary message (cmsg) should + /// be attached to received skbs indicating the number of packets dropped by + /// the socket since its creation. + RxqOvfl, Both, libc::SOL_SOCKET, libc::SO_RXQ_OVFL, libc::c_int); +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The socket is restricted to sending and receiving IPv6 packets only. + Ipv6V6Only, Both, libc::IPPROTO_IPV6, libc::IPV6_V6ONLY, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Enable extended reliable error message passing. + Ipv4RecvErr, Both, libc::IPPROTO_IP, libc::IP_RECVERR, bool); +#[cfg(any(target_os = "android", target_os = "linux"))] +sockopt_impl!( + /// Control receiving of asynchronous error options. + Ipv6RecvErr, Both, libc::IPPROTO_IPV6, libc::IPV6_RECVERR, bool); +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +sockopt_impl!( + /// Set or retrieve the current time-to-live field that is used in every + /// packet sent from this socket. + Ipv4Ttl, Both, libc::IPPROTO_IP, libc::IP_TTL, libc::c_int); +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +sockopt_impl!( + /// Set the unicast hop limit for the socket. + Ipv6Ttl, Both, libc::IPPROTO_IPV6, libc::IPV6_UNICAST_HOPS, libc::c_int); +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// The `recvmsg(2)` call will return the destination IP address for a UDP + /// datagram. + Ipv6OrigDstAddr, Both, libc::IPPROTO_IPV6, libc::IPV6_ORIGDSTADDR, bool); +#[cfg(any(target_os = "ios", target_os = "macos"))] +sockopt_impl!( + /// Set "don't fragment packet" flag on the IP packet. + IpDontFrag, Both, libc::IPPROTO_IP, libc::IP_DONTFRAG, bool); +#[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", +))] +sockopt_impl!( + /// Set "don't fragment packet" flag on the IPv6 packet. + Ipv6DontFrag, Both, libc::IPPROTO_IPV6, libc::IPV6_DONTFRAG, bool); + +#[allow(missing_docs)] +// Not documented by Linux! +#[cfg(any(target_os = "android", target_os = "linux"))] +#[derive(Copy, Clone, Debug)] +pub struct AlgSetAeadAuthSize; + +// ALG_SET_AEAD_AUTH_SIZE read the length from passed `option_len` +// See https://elixir.bootlin.com/linux/v4.4/source/crypto/af_alg.c#L222 +#[cfg(any(target_os = "android", target_os = "linux"))] +impl SetSockOpt for AlgSetAeadAuthSize { + type Val = usize; + + fn set(&self, fd: RawFd, val: &usize) -> Result<()> { + unsafe { + let res = libc::setsockopt(fd, + libc::SOL_ALG, + libc::ALG_SET_AEAD_AUTHSIZE, + ::std::ptr::null(), + *val as libc::socklen_t); + Errno::result(res).map(drop) + } + } +} + +#[allow(missing_docs)] +// Not documented by Linux! +#[cfg(any(target_os = "android", target_os = "linux"))] +#[derive(Clone, Debug)] +pub struct AlgSetKey(::std::marker::PhantomData); + +#[cfg(any(target_os = "android", target_os = "linux"))] +impl Default for AlgSetKey { + fn default() -> Self { + AlgSetKey(Default::default()) + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +impl SetSockOpt for AlgSetKey where T: AsRef<[u8]> + Clone { + type Val = T; + + fn set(&self, fd: RawFd, val: &T) -> Result<()> { + unsafe { + let res = libc::setsockopt(fd, + libc::SOL_ALG, + libc::ALG_SET_KEY, + val.as_ref().as_ptr() as *const _, + val.as_ref().len() as libc::socklen_t); + Errno::result(res).map(drop) + } + } +} + +/* + * + * ===== Accessor helpers ===== + * + */ + +/// Helper trait that describes what is expected from a `GetSockOpt` getter. +trait Get { + /// Returns an uninitialized value. + fn uninit() -> Self; + /// Returns a pointer to the stored value. This pointer will be passed to the system's + /// `getsockopt` call (`man 3p getsockopt`, argument `option_value`). + fn ffi_ptr(&mut self) -> *mut c_void; + /// Returns length of the stored value. This pointer will be passed to the system's + /// `getsockopt` call (`man 3p getsockopt`, argument `option_len`). + fn ffi_len(&mut self) -> *mut socklen_t; + /// Returns the hopefully initialized inner value. + unsafe fn assume_init(self) -> T; +} + +/// Helper trait that describes what is expected from a `SetSockOpt` setter. +trait Set<'a, T> { + /// Initialize the setter with a given value. + fn new(val: &'a T) -> Self; + /// Returns a pointer to the stored value. This pointer will be passed to the system's + /// `setsockopt` call (`man 3p setsockopt`, argument `option_value`). + fn ffi_ptr(&self) -> *const c_void; + /// Returns length of the stored value. This pointer will be passed to the system's + /// `setsockopt` call (`man 3p setsockopt`, argument `option_len`). + fn ffi_len(&self) -> socklen_t; +} + +/// Getter for an arbitrary `struct`. +struct GetStruct { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetStruct { + fn uninit() -> Self { + GetStruct { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> T { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() + } +} + +/// Setter for an arbitrary `struct`. +struct SetStruct<'a, T: 'static> { + ptr: &'a T, +} + +impl<'a, T> Set<'a, T> for SetStruct<'a, T> { + fn new(ptr: &'a T) -> SetStruct<'a, T> { + SetStruct { ptr } + } + + fn ffi_ptr(&self) -> *const c_void { + self.ptr as *const T as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for a boolean value. +struct GetBool { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetBool { + fn uninit() -> Self { + GetBool { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> bool { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() != 0 + } +} + +/// Setter for a boolean value. +struct SetBool { + val: c_int, +} + +impl<'a> Set<'a, bool> for SetBool { + fn new(val: &'a bool) -> SetBool { + SetBool { val: if *val { 1 } else { 0 } } + } + + fn ffi_ptr(&self) -> *const c_void { + &self.val as *const c_int as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for an `u8` value. +struct GetU8 { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetU8 { + fn uninit() -> Self { + GetU8 { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> u8 { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() + } +} + +/// Setter for an `u8` value. +struct SetU8 { + val: u8, +} + +impl<'a> Set<'a, u8> for SetU8 { + fn new(val: &'a u8) -> SetU8 { + SetU8 { val: *val as u8 } + } + + fn ffi_ptr(&self) -> *const c_void { + &self.val as *const u8 as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for an `usize` value. +struct GetUsize { + len: socklen_t, + val: MaybeUninit, +} + +impl Get for GetUsize { + fn uninit() -> Self { + GetUsize { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> usize { + assert_eq!(self.len as usize, mem::size_of::(), "invalid getsockopt implementation"); + self.val.assume_init() as usize + } +} + +/// Setter for an `usize` value. +struct SetUsize { + val: c_int, +} + +impl<'a> Set<'a, usize> for SetUsize { + fn new(val: &'a usize) -> SetUsize { + SetUsize { val: *val as c_int } + } + + fn ffi_ptr(&self) -> *const c_void { + &self.val as *const c_int as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + mem::size_of::() as socklen_t + } +} + +/// Getter for a `OsString` value. +struct GetOsString> { + len: socklen_t, + val: MaybeUninit, +} + +impl> Get for GetOsString { + fn uninit() -> Self { + GetOsString { + len: mem::size_of::() as socklen_t, + val: MaybeUninit::uninit(), + } + } + + fn ffi_ptr(&mut self) -> *mut c_void { + self.val.as_mut_ptr() as *mut c_void + } + + fn ffi_len(&mut self) -> *mut socklen_t { + &mut self.len + } + + unsafe fn assume_init(self) -> OsString { + let len = self.len as usize; + let mut v = self.val.assume_init(); + OsStr::from_bytes(&v.as_mut()[0..len]).to_owned() + } +} + +/// Setter for a `OsString` value. +struct SetOsString<'a> { + val: &'a OsStr, +} + +impl<'a> Set<'a, OsString> for SetOsString<'a> { + fn new(val: &'a OsString) -> SetOsString { + SetOsString { val: val.as_os_str() } + } + + fn ffi_ptr(&self) -> *const c_void { + self.val.as_bytes().as_ptr() as *const c_void + } + + fn ffi_len(&self) -> socklen_t { + self.val.len() as socklen_t + } +} + + +#[cfg(test)] +mod test { + #[cfg(any(target_os = "android", target_os = "linux"))] + #[test] + fn can_get_peercred_on_unix_socket() { + use super::super::*; + + let (a, b) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()).unwrap(); + let a_cred = getsockopt(a, super::PeerCredentials).unwrap(); + let b_cred = getsockopt(b, super::PeerCredentials).unwrap(); + assert_eq!(a_cred, b_cred); + assert_ne!(a_cred.pid(), 0); + } + + #[test] + fn is_socket_type_unix() { + use super::super::*; + use crate::unistd::close; + + let (a, b) = socketpair(AddressFamily::Unix, SockType::Stream, None, SockFlag::empty()).unwrap(); + let a_type = getsockopt(a, super::SockType).unwrap(); + assert_eq!(a_type, SockType::Stream); + close(a).unwrap(); + close(b).unwrap(); + } + + #[test] + fn is_socket_type_dgram() { + use super::super::*; + use crate::unistd::close; + + let s = socket(AddressFamily::Inet, SockType::Datagram, SockFlag::empty(), None).unwrap(); + let s_type = getsockopt(s, super::SockType).unwrap(); + assert_eq!(s_type, SockType::Datagram); + close(s).unwrap(); + } + + #[cfg(any(target_os = "freebsd", + target_os = "linux"))] + #[test] + fn can_get_listen_on_tcp_socket() { + use super::super::*; + use crate::unistd::close; + + let s = socket(AddressFamily::Inet, SockType::Stream, SockFlag::empty(), None).unwrap(); + let s_listening = getsockopt(s, super::AcceptConn).unwrap(); + assert!(!s_listening); + listen(s, 10).unwrap(); + let s_listening2 = getsockopt(s, super::AcceptConn).unwrap(); + assert!(s_listening2); + close(s).unwrap(); + } + +} diff --git a/bash-5.1/vendor/nix/src/sys/stat.rs b/bash-5.1/vendor/nix/src/sys/stat.rs new file mode 100644 index 0000000000000000000000000000000000000000..8b7627d5bcc30fc9fccfcdb2d5cfd158b4985085 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/stat.rs @@ -0,0 +1,436 @@ +pub use libc::{dev_t, mode_t}; +#[cfg(any(target_os = "macos", target_os = "ios", target_os = "openbsd"))] +pub use libc::c_uint; +#[cfg(any( + target_os = "netbsd", + target_os = "freebsd", + target_os = "dragonfly" +))] +pub use libc::c_ulong; +pub use libc::stat as FileStat; + +use crate::{Result, NixPath, errno::Errno}; +#[cfg(not(target_os = "redox"))] +use crate::fcntl::{AtFlags, at_rawfd}; +use std::mem; +use std::os::unix::io::RawFd; +use crate::sys::time::{TimeSpec, TimeVal}; + +libc_bitflags!( + /// "File type" flags for `mknod` and related functions. + pub struct SFlag: mode_t { + S_IFIFO; + S_IFCHR; + S_IFDIR; + S_IFBLK; + S_IFREG; + S_IFLNK; + S_IFSOCK; + S_IFMT; + } +); + +libc_bitflags! { + /// "File mode / permissions" flags. + pub struct Mode: mode_t { + S_IRWXU; + S_IRUSR; + S_IWUSR; + S_IXUSR; + S_IRWXG; + S_IRGRP; + S_IWGRP; + S_IXGRP; + S_IRWXO; + S_IROTH; + S_IWOTH; + S_IXOTH; + S_ISUID as mode_t; + S_ISGID as mode_t; + S_ISVTX as mode_t; + } +} + +#[cfg(any(target_os = "macos", target_os = "ios", target_os="openbsd"))] +pub type type_of_file_flag = c_uint; +#[cfg(any( + target_os = "netbsd", + target_os = "freebsd", + target_os = "dragonfly" +))] +pub type type_of_file_flag = c_ulong; + +#[cfg(any( + target_os = "openbsd", + target_os = "netbsd", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "macos", + target_os = "ios" +))] +libc_bitflags! { + /// File flags. + #[cfg_attr(docsrs, doc(cfg(all())))] + pub struct FileFlag: type_of_file_flag { + /// The file may only be appended to. + SF_APPEND; + /// The file has been archived. + SF_ARCHIVED; + #[cfg(any(target_os = "dragonfly"))] + SF_CACHE; + /// The file may not be changed. + SF_IMMUTABLE; + /// Indicates a WAPBL journal file. + #[cfg(any(target_os = "netbsd"))] + SF_LOG; + /// Do not retain history for file + #[cfg(any(target_os = "dragonfly"))] + SF_NOHISTORY; + /// The file may not be renamed or deleted. + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + SF_NOUNLINK; + /// Mask of superuser changeable flags + SF_SETTABLE; + /// Snapshot is invalid. + #[cfg(any(target_os = "netbsd"))] + SF_SNAPINVAL; + /// The file is a snapshot file. + #[cfg(any(target_os = "netbsd", target_os = "freebsd"))] + SF_SNAPSHOT; + #[cfg(any(target_os = "dragonfly"))] + SF_XLINK; + /// The file may only be appended to. + UF_APPEND; + /// The file needs to be archived. + #[cfg(any(target_os = "freebsd"))] + UF_ARCHIVE; + #[cfg(any(target_os = "dragonfly"))] + UF_CACHE; + /// File is compressed at the file system level. + #[cfg(any(target_os = "macos", target_os = "ios"))] + UF_COMPRESSED; + /// The file may be hidden from directory listings at the application's + /// discretion. + #[cfg(any( + target_os = "freebsd", + target_os = "macos", + target_os = "ios", + ))] + UF_HIDDEN; + /// The file may not be changed. + UF_IMMUTABLE; + /// Do not dump the file. + UF_NODUMP; + #[cfg(any(target_os = "dragonfly"))] + UF_NOHISTORY; + /// The file may not be renamed or deleted. + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + UF_NOUNLINK; + /// The file is offline, or has the Windows and CIFS + /// `FILE_ATTRIBUTE_OFFLINE` attribute. + #[cfg(any(target_os = "freebsd"))] + UF_OFFLINE; + /// The directory is opaque when viewed through a union stack. + UF_OPAQUE; + /// The file is read only, and may not be written or appended. + #[cfg(any(target_os = "freebsd"))] + UF_READONLY; + /// The file contains a Windows reparse point. + #[cfg(any(target_os = "freebsd"))] + UF_REPARSE; + /// Mask of owner changeable flags. + UF_SETTABLE; + /// The file has the Windows `FILE_ATTRIBUTE_SPARSE_FILE` attribute. + #[cfg(any(target_os = "freebsd"))] + UF_SPARSE; + /// The file has the DOS, Windows and CIFS `FILE_ATTRIBUTE_SYSTEM` + /// attribute. + #[cfg(any(target_os = "freebsd"))] + UF_SYSTEM; + /// File renames and deletes are tracked. + #[cfg(any(target_os = "macos", target_os = "ios"))] + UF_TRACKED; + #[cfg(any(target_os = "dragonfly"))] + UF_XLINK; + } +} + +/// Create a special or ordinary file, by pathname. +pub fn mknod(path: &P, kind: SFlag, perm: Mode, dev: dev_t) -> Result<()> { + let res = path.with_nix_path(|cstr| unsafe { + libc::mknod(cstr.as_ptr(), kind.bits | perm.bits() as mode_t, dev) + })?; + + Errno::result(res).map(drop) +} + +/// Create a special or ordinary file, relative to a given directory. +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "haiku")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn mknodat( + dirfd: RawFd, + path: &P, + kind: SFlag, + perm: Mode, + dev: dev_t, +) -> Result<()> { + let res = path.with_nix_path(|cstr| unsafe { + libc::mknodat(dirfd, cstr.as_ptr(), kind.bits | perm.bits() as mode_t, dev) + })?; + + Errno::result(res).map(drop) +} + +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub const fn major(dev: dev_t) -> u64 { + ((dev >> 32) & 0xffff_f000) | + ((dev >> 8) & 0x0000_0fff) +} + +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub const fn minor(dev: dev_t) -> u64 { + ((dev >> 12) & 0xffff_ff00) | + ((dev ) & 0x0000_00ff) +} + +#[cfg(target_os = "linux")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub const fn makedev(major: u64, minor: u64) -> dev_t { + ((major & 0xffff_f000) << 32) | + ((major & 0x0000_0fff) << 8) | + ((minor & 0xffff_ff00) << 12) | + (minor & 0x0000_00ff) +} + +pub fn umask(mode: Mode) -> Mode { + let prev = unsafe { libc::umask(mode.bits() as mode_t) }; + Mode::from_bits(prev).expect("[BUG] umask returned invalid Mode") +} + +pub fn stat(path: &P) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = path.with_nix_path(|cstr| { + unsafe { + libc::stat(cstr.as_ptr(), dst.as_mut_ptr()) + } + })?; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +pub fn lstat(path: &P) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = path.with_nix_path(|cstr| { + unsafe { + libc::lstat(cstr.as_ptr(), dst.as_mut_ptr()) + } + })?; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +pub fn fstat(fd: RawFd) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = unsafe { libc::fstat(fd, dst.as_mut_ptr()) }; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn fstatat(dirfd: RawFd, pathname: &P, f: AtFlags) -> Result { + let mut dst = mem::MaybeUninit::uninit(); + let res = pathname.with_nix_path(|cstr| { + unsafe { libc::fstatat(dirfd, cstr.as_ptr(), dst.as_mut_ptr(), f.bits() as libc::c_int) } + })?; + + Errno::result(res)?; + + Ok(unsafe{dst.assume_init()}) +} + +/// Change the file permission bits of the file specified by a file descriptor. +/// +/// # References +/// +/// [fchmod(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchmod.html). +pub fn fchmod(fd: RawFd, mode: Mode) -> Result<()> { + let res = unsafe { libc::fchmod(fd, mode.bits() as mode_t) }; + + Errno::result(res).map(drop) +} + +/// Flags for `fchmodat` function. +#[derive(Clone, Copy, Debug)] +pub enum FchmodatFlags { + FollowSymlink, + NoFollowSymlink, +} + +/// Change the file permission bits. +/// +/// The file to be changed is determined relative to the directory associated +/// with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. +/// +/// If `flag` is `FchmodatFlags::NoFollowSymlink` and `path` names a symbolic link, +/// then the mode of the symbolic link is changed. +/// +/// `fchmodat(None, path, mode, FchmodatFlags::FollowSymlink)` is identical to +/// a call `libc::chmod(path, mode)`. That's why `chmod` is unimplemented +/// in the `nix` crate. +/// +/// # References +/// +/// [fchmodat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchmodat.html). +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn fchmodat( + dirfd: Option, + path: &P, + mode: Mode, + flag: FchmodatFlags, +) -> Result<()> { + let atflag = + match flag { + FchmodatFlags::FollowSymlink => AtFlags::empty(), + FchmodatFlags::NoFollowSymlink => AtFlags::AT_SYMLINK_NOFOLLOW, + }; + let res = path.with_nix_path(|cstr| unsafe { + libc::fchmodat( + at_rawfd(dirfd), + cstr.as_ptr(), + mode.bits() as mode_t, + atflag.bits() as libc::c_int, + ) + })?; + + Errno::result(res).map(drop) +} + +/// Change the access and modification times of a file. +/// +/// `utimes(path, times)` is identical to +/// `utimensat(None, path, times, UtimensatFlags::FollowSymlink)`. The former +/// is a deprecated API so prefer using the latter if the platforms you care +/// about support it. +/// +/// # References +/// +/// [utimes(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimes.html). +pub fn utimes(path: &P, atime: &TimeVal, mtime: &TimeVal) -> Result<()> { + let times: [libc::timeval; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = path.with_nix_path(|cstr| unsafe { + libc::utimes(cstr.as_ptr(), ×[0]) + })?; + + Errno::result(res).map(drop) +} + +/// Change the access and modification times of a file without following symlinks. +/// +/// `lutimes(path, times)` is identical to +/// `utimensat(None, path, times, UtimensatFlags::NoFollowSymlink)`. The former +/// is a deprecated API so prefer using the latter if the platforms you care +/// about support it. +/// +/// # References +/// +/// [lutimes(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lutimes.html). +#[cfg(any(target_os = "linux", + target_os = "haiku", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn lutimes(path: &P, atime: &TimeVal, mtime: &TimeVal) -> Result<()> { + let times: [libc::timeval; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = path.with_nix_path(|cstr| unsafe { + libc::lutimes(cstr.as_ptr(), ×[0]) + })?; + + Errno::result(res).map(drop) +} + +/// Change the access and modification times of the file specified by a file descriptor. +/// +/// # References +/// +/// [futimens(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html). +#[inline] +pub fn futimens(fd: RawFd, atime: &TimeSpec, mtime: &TimeSpec) -> Result<()> { + let times: [libc::timespec; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = unsafe { libc::futimens(fd, ×[0]) }; + + Errno::result(res).map(drop) +} + +/// Flags for `utimensat` function. +// TODO: replace with fcntl::AtFlags +#[derive(Clone, Copy, Debug)] +pub enum UtimensatFlags { + FollowSymlink, + NoFollowSymlink, +} + +/// Change the access and modification times of a file. +/// +/// The file to be changed is determined relative to the directory associated +/// with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. +/// +/// If `flag` is `UtimensatFlags::NoFollowSymlink` and `path` names a symbolic link, +/// then the mode of the symbolic link is changed. +/// +/// `utimensat(None, path, times, UtimensatFlags::FollowSymlink)` is identical to +/// `utimes(path, times)`. The latter is a deprecated API so prefer using the +/// former if the platforms you care about support it. +/// +/// # References +/// +/// [utimensat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimens.html). +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn utimensat( + dirfd: Option, + path: &P, + atime: &TimeSpec, + mtime: &TimeSpec, + flag: UtimensatFlags +) -> Result<()> { + let atflag = + match flag { + UtimensatFlags::FollowSymlink => AtFlags::empty(), + UtimensatFlags::NoFollowSymlink => AtFlags::AT_SYMLINK_NOFOLLOW, + }; + let times: [libc::timespec; 2] = [*atime.as_ref(), *mtime.as_ref()]; + let res = path.with_nix_path(|cstr| unsafe { + libc::utimensat( + at_rawfd(dirfd), + cstr.as_ptr(), + ×[0], + atflag.bits() as libc::c_int, + ) + })?; + + Errno::result(res).map(drop) +} + +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn mkdirat(fd: RawFd, path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::mkdirat(fd, cstr.as_ptr(), mode.bits() as mode_t) } + })?; + + Errno::result(res).map(drop) +} diff --git a/bash-5.1/vendor/nix/src/sys/statfs.rs b/bash-5.1/vendor/nix/src/sys/statfs.rs new file mode 100644 index 0000000000000000000000000000000000000000..e8c06e4e3fa27115e3deca2bc404483c75877f01 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/statfs.rs @@ -0,0 +1,760 @@ +//! Get filesystem statistics, non-portably +//! +//! See [`statvfs`](crate::sys::statvfs) for a portable alternative. +use std::fmt::{self, Debug}; +use std::mem; +use std::os::unix::io::AsRawFd; +#[cfg(not(any(target_os = "linux", target_os = "android")))] +use std::ffi::CStr; + +use crate::{NixPath, Result, errno::Errno}; + +/// Identifies a mounted file system +#[cfg(target_os = "android")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub type fsid_t = libc::__fsid_t; +/// Identifies a mounted file system +#[cfg(not(target_os = "android"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub type fsid_t = libc::fsid_t; + +/// Describes a mounted file system +#[derive(Clone, Copy)] +#[repr(transparent)] +pub struct Statfs(libc::statfs); + +#[cfg(target_os = "freebsd")] +type fs_type_t = u32; +#[cfg(target_os = "android")] +type fs_type_t = libc::c_ulong; +#[cfg(all(target_os = "linux", target_arch = "s390x"))] +type fs_type_t = libc::c_uint; +#[cfg(all(target_os = "linux", target_env = "musl"))] +type fs_type_t = libc::c_ulong; +#[cfg(all(target_os = "linux", target_env = "uclibc"))] +type fs_type_t = libc::c_int; +#[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl", target_env = "uclibc"))))] +type fs_type_t = libc::__fsword_t; + +/// Describes the file system type as known by the operating system. +#[cfg(any( + target_os = "freebsd", + target_os = "android", + all(target_os = "linux", target_arch = "s390x"), + all(target_os = "linux", target_env = "musl"), + all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl"))), +))] +#[derive(Eq, Copy, Clone, PartialEq, Debug)] +pub struct FsType(pub fs_type_t); + +// These constants are defined without documentation in the Linux headers, so we +// can't very well document them here. +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const ADFS_SUPER_MAGIC: FsType = FsType(libc::ADFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const AFFS_SUPER_MAGIC: FsType = FsType(libc::AFFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const AFS_SUPER_MAGIC: FsType = FsType(libc::AFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const AUTOFS_SUPER_MAGIC: FsType = FsType(libc::AUTOFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const BPF_FS_MAGIC: FsType = FsType(libc::BPF_FS_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const BTRFS_SUPER_MAGIC: FsType = FsType(libc::BTRFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const CGROUP2_SUPER_MAGIC: FsType = FsType(libc::CGROUP2_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const CGROUP_SUPER_MAGIC: FsType = FsType(libc::CGROUP_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const CODA_SUPER_MAGIC: FsType = FsType(libc::CODA_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const CRAMFS_MAGIC: FsType = FsType(libc::CRAMFS_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const DEBUGFS_MAGIC: FsType = FsType(libc::DEBUGFS_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const DEVPTS_SUPER_MAGIC: FsType = FsType(libc::DEVPTS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const ECRYPTFS_SUPER_MAGIC: FsType = FsType(libc::ECRYPTFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const EFS_SUPER_MAGIC: FsType = FsType(libc::EFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const EXT2_SUPER_MAGIC: FsType = FsType(libc::EXT2_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const EXT3_SUPER_MAGIC: FsType = FsType(libc::EXT3_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const EXT4_SUPER_MAGIC: FsType = FsType(libc::EXT4_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const F2FS_SUPER_MAGIC: FsType = FsType(libc::F2FS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const FUSE_SUPER_MAGIC: FsType = FsType(libc::FUSE_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const FUTEXFS_SUPER_MAGIC: FsType = FsType(libc::FUTEXFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const HOSTFS_SUPER_MAGIC: FsType = FsType(libc::HOSTFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const HPFS_SUPER_MAGIC: FsType = FsType(libc::HPFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const HUGETLBFS_MAGIC: FsType = FsType(libc::HUGETLBFS_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const ISOFS_SUPER_MAGIC: FsType = FsType(libc::ISOFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const JFFS2_SUPER_MAGIC: FsType = FsType(libc::JFFS2_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const MINIX2_SUPER_MAGIC2: FsType = FsType(libc::MINIX2_SUPER_MAGIC2 as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const MINIX2_SUPER_MAGIC: FsType = FsType(libc::MINIX2_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const MINIX3_SUPER_MAGIC: FsType = FsType(libc::MINIX3_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const MINIX_SUPER_MAGIC2: FsType = FsType(libc::MINIX_SUPER_MAGIC2 as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const MINIX_SUPER_MAGIC: FsType = FsType(libc::MINIX_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const MSDOS_SUPER_MAGIC: FsType = FsType(libc::MSDOS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const NCP_SUPER_MAGIC: FsType = FsType(libc::NCP_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const NFS_SUPER_MAGIC: FsType = FsType(libc::NFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const NILFS_SUPER_MAGIC: FsType = FsType(libc::NILFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const OCFS2_SUPER_MAGIC: FsType = FsType(libc::OCFS2_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const OPENPROM_SUPER_MAGIC: FsType = FsType(libc::OPENPROM_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const OVERLAYFS_SUPER_MAGIC: FsType = FsType(libc::OVERLAYFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const PROC_SUPER_MAGIC: FsType = FsType(libc::PROC_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const QNX4_SUPER_MAGIC: FsType = FsType(libc::QNX4_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const QNX6_SUPER_MAGIC: FsType = FsType(libc::QNX6_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const RDTGROUP_SUPER_MAGIC: FsType = FsType(libc::RDTGROUP_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const REISERFS_SUPER_MAGIC: FsType = FsType(libc::REISERFS_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const SECURITYFS_MAGIC: FsType = FsType(libc::SECURITYFS_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const SELINUX_MAGIC: FsType = FsType(libc::SELINUX_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const SMACK_MAGIC: FsType = FsType(libc::SMACK_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const SMB_SUPER_MAGIC: FsType = FsType(libc::SMB_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const SYSFS_MAGIC: FsType = FsType(libc::SYSFS_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const TMPFS_MAGIC: FsType = FsType(libc::TMPFS_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const TRACEFS_MAGIC: FsType = FsType(libc::TRACEFS_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const UDF_SUPER_MAGIC: FsType = FsType(libc::UDF_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const USBDEVICE_SUPER_MAGIC: FsType = FsType(libc::USBDEVICE_SUPER_MAGIC as fs_type_t); +#[cfg(any(target_os = "linux", target_os = "android"))] +#[allow(missing_docs)] +pub const XENFS_SUPER_MAGIC: FsType = FsType(libc::XENFS_SUPER_MAGIC as fs_type_t); + + +impl Statfs { + /// Magic code defining system type + #[cfg(not(any( + target_os = "openbsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos" + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn filesystem_type(&self) -> FsType { + FsType(self.0.f_type) + } + + /// Magic code defining system type + #[cfg(not(any(target_os = "linux", target_os = "android")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn filesystem_type_name(&self) -> &str { + let c_str = unsafe { CStr::from_ptr(self.0.f_fstypename.as_ptr()) }; + c_str.to_str().unwrap() + } + + /// Optimal transfer block size + #[cfg(any(target_os = "ios", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> i32 { + self.0.f_iosize + } + + /// Optimal transfer block size + #[cfg(target_os = "openbsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> u32 { + self.0.f_iosize + } + + /// Optimal transfer block size + #[cfg(all(target_os = "linux", target_arch = "s390x"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> u32 { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(any( + target_os = "android", + all(target_os = "linux", target_env = "musl") + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> libc::c_ulong { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl", target_env = "uclibc"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> libc::__fsword_t { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(all(target_os = "linux", target_env = "uclibc"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> libc::c_int { + self.0.f_bsize + } + + /// Optimal transfer block size + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> libc::c_long { + self.0.f_iosize + } + + /// Optimal transfer block size + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn optimal_transfer_size(&self) -> u64 { + self.0.f_iosize + } + + /// Size of a block + #[cfg(any(target_os = "ios", target_os = "macos", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> u32 { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", target_arch = "s390x"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> u32 { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", target_env = "musl"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> libc::c_ulong { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", target_env = "uclibc"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> libc::c_int { + self.0.f_bsize + } + + /// Size of a block + // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471 + #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl", target_env = "uclibc"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> libc::__fsword_t { + self.0.f_bsize + } + + /// Size of a block + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> u64 { + self.0.f_bsize + } + + /// Size of a block + #[cfg(target_os = "android")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> libc::c_ulong { + self.0.f_bsize + } + + /// Size of a block + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn block_size(&self) -> libc::c_long { + self.0.f_bsize + } + + /// Maximum length of filenames + #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> u32 { + self.0.f_namemax + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", target_arch = "s390x"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> u32 { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", target_env = "musl"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> libc::c_ulong { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", target_env = "uclibc"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> libc::c_int { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(all(target_os = "linux", not(any(target_arch = "s390x", target_env = "musl", target_env = "uclibc"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> libc::__fsword_t { + self.0.f_namelen + } + + /// Maximum length of filenames + #[cfg(target_os = "android")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn maximum_name_length(&self) -> libc::c_ulong { + self.0.f_namelen + } + + /// Total data blocks in filesystem + #[cfg(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks(&self) -> u64 { + self.0.f_blocks + } + + /// Total data blocks in filesystem + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks(&self) -> libc::c_long { + self.0.f_blocks + } + + /// Total data blocks in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks(&self) -> u64 { + self.0.f_blocks + } + + /// Total data blocks in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks(&self) -> libc::c_ulong { + self.0.f_blocks + } + + /// Free blocks in filesystem + #[cfg(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_free(&self) -> u64 { + self.0.f_bfree + } + + /// Free blocks in filesystem + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_free(&self) -> libc::c_long { + self.0.f_bfree + } + + /// Free blocks in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_free(&self) -> u64 { + self.0.f_bfree + } + + /// Free blocks in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_free(&self) -> libc::c_ulong { + self.0.f_bfree + } + + /// Free blocks available to unprivileged user + #[cfg(any(target_os = "ios", target_os = "macos", target_os = "android"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_available(&self) -> u64 { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_available(&self) -> libc::c_long { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(any(target_os = "freebsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_available(&self) -> i64 { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_available(&self) -> u64 { + self.0.f_bavail + } + + /// Free blocks available to unprivileged user + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn blocks_available(&self) -> libc::c_ulong { + self.0.f_bavail + } + + /// Total file nodes in filesystem + #[cfg(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files(&self) -> u64 { + self.0.f_files + } + + /// Total file nodes in filesystem + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files(&self) -> libc::c_long { + self.0.f_files + } + + /// Total file nodes in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files(&self) -> libc::fsfilcnt_t { + self.0.f_files + } + + /// Total file nodes in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files(&self) -> libc::c_ulong { + self.0.f_files + } + + /// Free file nodes in filesystem + #[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "macos", + target_os = "openbsd" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files_free(&self) -> u64 { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files_free(&self) -> libc::c_long { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(target_os = "freebsd")] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files_free(&self) -> i64 { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files_free(&self) -> libc::fsfilcnt_t { + self.0.f_ffree + } + + /// Free file nodes in filesystem + #[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "android", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", + all(target_os = "linux", any(target_env = "musl", target_arch = "riscv32", all(target_arch = "x86_64", target_pointer_width = "32"))) + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn files_free(&self) -> libc::c_ulong { + self.0.f_ffree + } + + /// Filesystem ID + pub fn filesystem_id(&self) -> fsid_t { + self.0.f_fsid + } +} + +impl Debug for Statfs { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Statfs") + .field("optimal_transfer_size", &self.optimal_transfer_size()) + .field("block_size", &self.block_size()) + .field("blocks", &self.blocks()) + .field("blocks_free", &self.blocks_free()) + .field("blocks_available", &self.blocks_available()) + .field("files", &self.files()) + .field("files_free", &self.files_free()) + .field("filesystem_id", &self.filesystem_id()) + .finish() + } +} + +/// Describes a mounted file system. +/// +/// The result is OS-dependent. For a portable alternative, see +/// [`statvfs`](crate::sys::statvfs::statvfs). +/// +/// # Arguments +/// +/// `path` - Path to any file within the file system to describe +pub fn statfs(path: &P) -> Result { + unsafe { + let mut stat = mem::MaybeUninit::::uninit(); + let res = path.with_nix_path(|path| libc::statfs(path.as_ptr(), stat.as_mut_ptr()))?; + Errno::result(res).map(|_| Statfs(stat.assume_init())) + } +} + +/// Describes a mounted file system. +/// +/// The result is OS-dependent. For a portable alternative, see +/// [`fstatvfs`](crate::sys::statvfs::fstatvfs). +/// +/// # Arguments +/// +/// `fd` - File descriptor of any open file within the file system to describe +pub fn fstatfs(fd: &T) -> Result { + unsafe { + let mut stat = mem::MaybeUninit::::uninit(); + Errno::result(libc::fstatfs(fd.as_raw_fd(), stat.as_mut_ptr())) + .map(|_| Statfs(stat.assume_init())) + } +} + +#[cfg(test)] +mod test { + use std::fs::File; + + use crate::sys::statfs::*; + use crate::sys::statvfs::*; + use std::path::Path; + + #[test] + fn statfs_call() { + check_statfs("/tmp"); + check_statfs("/dev"); + check_statfs("/run"); + check_statfs("/"); + } + + #[test] + fn fstatfs_call() { + check_fstatfs("/tmp"); + check_fstatfs("/dev"); + check_fstatfs("/run"); + check_fstatfs("/"); + } + + fn check_fstatfs(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()).unwrap(); + let file = File::open(path).unwrap(); + let fs = fstatfs(&file).unwrap(); + assert_fs_equals(fs, vfs); + } + + fn check_statfs(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()).unwrap(); + let fs = statfs(path.as_bytes()).unwrap(); + assert_fs_equals(fs, vfs); + } + + fn assert_fs_equals(fs: Statfs, vfs: Statvfs) { + assert_eq!(fs.files() as u64, vfs.files() as u64); + assert_eq!(fs.blocks() as u64, vfs.blocks() as u64); + assert_eq!(fs.block_size() as u64, vfs.fragment_size() as u64); + } + + // This test is ignored because files_free/blocks_free can change after statvfs call and before + // statfs call. + #[test] + #[ignore] + fn statfs_call_strict() { + check_statfs_strict("/tmp"); + check_statfs_strict("/dev"); + check_statfs_strict("/run"); + check_statfs_strict("/"); + } + + // This test is ignored because files_free/blocks_free can change after statvfs call and before + // fstatfs call. + #[test] + #[ignore] + fn fstatfs_call_strict() { + check_fstatfs_strict("/tmp"); + check_fstatfs_strict("/dev"); + check_fstatfs_strict("/run"); + check_fstatfs_strict("/"); + } + + fn check_fstatfs_strict(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()); + let file = File::open(path).unwrap(); + let fs = fstatfs(&file); + assert_fs_equals_strict(fs.unwrap(), vfs.unwrap()) + } + + fn check_statfs_strict(path: &str) { + if !Path::new(path).exists() { + return; + } + let vfs = statvfs(path.as_bytes()); + let fs = statfs(path.as_bytes()); + assert_fs_equals_strict(fs.unwrap(), vfs.unwrap()) + } + + fn assert_fs_equals_strict(fs: Statfs, vfs: Statvfs) { + assert_eq!(fs.files_free() as u64, vfs.files_free() as u64); + assert_eq!(fs.blocks_free() as u64, vfs.blocks_free() as u64); + assert_eq!(fs.blocks_available() as u64, vfs.blocks_available() as u64); + assert_eq!(fs.files() as u64, vfs.files() as u64); + assert_eq!(fs.blocks() as u64, vfs.blocks() as u64); + assert_eq!(fs.block_size() as u64, vfs.fragment_size() as u64); + } +} diff --git a/bash-5.1/vendor/nix/src/sys/statvfs.rs b/bash-5.1/vendor/nix/src/sys/statvfs.rs new file mode 100644 index 0000000000000000000000000000000000000000..38b1fdcc50af0f3932af75bd4219fd4866a8a920 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/statvfs.rs @@ -0,0 +1,174 @@ +//! Get filesystem statistics +//! +//! See [the man pages](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fstatvfs.html) +//! for more details. +use std::mem; +use std::os::unix::io::AsRawFd; + +use libc::{self, c_ulong}; + +use crate::{Result, NixPath, errno::Errno}; + +#[cfg(not(target_os = "redox"))] +libc_bitflags!( + /// File system mount Flags + #[repr(C)] + #[derive(Default)] + pub struct FsFlags: c_ulong { + /// Read Only + #[cfg(not(target_os = "haiku"))] + ST_RDONLY; + /// Do not allow the set-uid bits to have an effect + #[cfg(not(target_os = "haiku"))] + ST_NOSUID; + /// Do not interpret character or block-special devices + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_NODEV; + /// Do not allow execution of binaries on the filesystem + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_NOEXEC; + /// All IO should be done synchronously + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_SYNCHRONOUS; + /// Allow mandatory locks on the filesystem + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_MANDLOCK; + /// Write on file/directory/symlink + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_WRITE; + /// Append-only file + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_APPEND; + /// Immutable file + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_IMMUTABLE; + /// Do not update access times on files + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_NOATIME; + /// Do not update access times on files + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_NODIRATIME; + /// Update access time relative to modify/change time + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_env = "musl"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ST_RELATIME; + } +); + +/// Wrapper around the POSIX `statvfs` struct +/// +/// For more information see the [`statvfs(3)` man pages](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_statvfs.h.html). +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct Statvfs(libc::statvfs); + +impl Statvfs { + /// get the file system block size + pub fn block_size(&self) -> c_ulong { + self.0.f_bsize + } + + /// Get the fundamental file system block size + pub fn fragment_size(&self) -> c_ulong { + self.0.f_frsize + } + + /// Get the number of blocks. + /// + /// Units are in units of `fragment_size()` + pub fn blocks(&self) -> libc::fsblkcnt_t { + self.0.f_blocks + } + + /// Get the number of free blocks in the file system + pub fn blocks_free(&self) -> libc::fsblkcnt_t { + self.0.f_bfree + } + + /// Get the number of free blocks for unprivileged users + pub fn blocks_available(&self) -> libc::fsblkcnt_t { + self.0.f_bavail + } + + /// Get the total number of file inodes + pub fn files(&self) -> libc::fsfilcnt_t { + self.0.f_files + } + + /// Get the number of free file inodes + pub fn files_free(&self) -> libc::fsfilcnt_t { + self.0.f_ffree + } + + /// Get the number of free file inodes for unprivileged users + pub fn files_available(&self) -> libc::fsfilcnt_t { + self.0.f_favail + } + + /// Get the file system id + pub fn filesystem_id(&self) -> c_ulong { + self.0.f_fsid + } + + /// Get the mount flags + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn flags(&self) -> FsFlags { + FsFlags::from_bits_truncate(self.0.f_flag) + } + + /// Get the maximum filename length + pub fn name_max(&self) -> c_ulong { + self.0.f_namemax + } + +} + +/// Return a `Statvfs` object with information about the `path` +pub fn statvfs(path: &P) -> Result { + unsafe { + Errno::clear(); + let mut stat = mem::MaybeUninit::::uninit(); + let res = path.with_nix_path(|path| + libc::statvfs(path.as_ptr(), stat.as_mut_ptr()) + )?; + + Errno::result(res).map(|_| Statvfs(stat.assume_init())) + } +} + +/// Return a `Statvfs` object with information about `fd` +pub fn fstatvfs(fd: &T) -> Result { + unsafe { + Errno::clear(); + let mut stat = mem::MaybeUninit::::uninit(); + Errno::result(libc::fstatvfs(fd.as_raw_fd(), stat.as_mut_ptr())) + .map(|_| Statvfs(stat.assume_init())) + } +} + +#[cfg(test)] +mod test { + use std::fs::File; + use crate::sys::statvfs::*; + + #[test] + fn statvfs_call() { + statvfs(&b"/"[..]).unwrap(); + } + + #[test] + fn fstatvfs_call() { + let root = File::open("/").unwrap(); + fstatvfs(&root).unwrap(); + } +} diff --git a/bash-5.1/vendor/nix/src/sys/sysinfo.rs b/bash-5.1/vendor/nix/src/sys/sysinfo.rs new file mode 100644 index 0000000000000000000000000000000000000000..96f043307552739e6bc63e1aafb04f36231a966e --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/sysinfo.rs @@ -0,0 +1,79 @@ +use libc::{self, SI_LOAD_SHIFT}; +use std::time::Duration; +use std::{cmp, mem}; + +use crate::errno::Errno; +use crate::Result; + +/// System info structure returned by `sysinfo`. +#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct SysInfo(libc::sysinfo); + +// The fields are c_ulong on 32-bit linux, u64 on 64-bit linux; x32's ulong is u32 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +type mem_blocks_t = u64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +type mem_blocks_t = libc::c_ulong; + +impl SysInfo { + /// Returns the load average tuple. + /// + /// The returned values represent the load average over time intervals of + /// 1, 5, and 15 minutes, respectively. + pub fn load_average(&self) -> (f64, f64, f64) { + ( + self.0.loads[0] as f64 / (1 << SI_LOAD_SHIFT) as f64, + self.0.loads[1] as f64 / (1 << SI_LOAD_SHIFT) as f64, + self.0.loads[2] as f64 / (1 << SI_LOAD_SHIFT) as f64, + ) + } + + /// Returns the time since system boot. + pub fn uptime(&self) -> Duration { + // Truncate negative values to 0 + Duration::from_secs(cmp::max(self.0.uptime, 0) as u64) + } + + /// Current number of processes. + pub fn process_count(&self) -> u16 { + self.0.procs + } + + /// Returns the amount of swap memory in Bytes. + pub fn swap_total(&self) -> u64 { + self.scale_mem(self.0.totalswap) + } + + /// Returns the amount of unused swap memory in Bytes. + pub fn swap_free(&self) -> u64 { + self.scale_mem(self.0.freeswap) + } + + /// Returns the total amount of installed RAM in Bytes. + pub fn ram_total(&self) -> u64 { + self.scale_mem(self.0.totalram) + } + + /// Returns the amount of completely unused RAM in Bytes. + /// + /// "Unused" in this context means that the RAM in neither actively used by + /// programs, nor by the operating system as disk cache or buffer. It is + /// "wasted" RAM since it currently serves no purpose. + pub fn ram_unused(&self) -> u64 { + self.scale_mem(self.0.freeram) + } + + fn scale_mem(&self, units: mem_blocks_t) -> u64 { + units as u64 * self.0.mem_unit as u64 + } +} + +/// Returns system information. +/// +/// [See `sysinfo(2)`](https://man7.org/linux/man-pages/man2/sysinfo.2.html). +pub fn sysinfo() -> Result { + let mut info = mem::MaybeUninit::uninit(); + let res = unsafe { libc::sysinfo(info.as_mut_ptr()) }; + Errno::result(res).map(|_| unsafe { SysInfo(info.assume_init()) }) +} diff --git a/bash-5.1/vendor/nix/src/sys/termios.rs b/bash-5.1/vendor/nix/src/sys/termios.rs new file mode 100644 index 0000000000000000000000000000000000000000..c5b27d28ea0ac4b7ea59ef797a43704869ca5ac2 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/termios.rs @@ -0,0 +1,1114 @@ +//! An interface for controlling asynchronous communication ports +//! +//! This interface provides a safe wrapper around the termios subsystem defined by POSIX. The +//! underlying types are all implemented in libc for most platforms and either wrapped in safer +//! types here or exported directly. +//! +//! If you are unfamiliar with the `termios` API, you should first read the +//! [API documentation](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html) and +//! then come back to understand how `nix` safely wraps it. +//! +//! It should be noted that this API incurs some runtime overhead above the base `libc` definitions. +//! As this interface is not used with high-bandwidth information, this should be fine in most +//! cases. The primary cost when using this API is that the `Termios` datatype here duplicates the +//! standard fields of the underlying `termios` struct and uses safe type wrappers for those fields. +//! This means that when crossing the FFI interface to the underlying C library, data is first +//! copied into the underlying `termios` struct, then the operation is done, and the data is copied +//! back (with additional sanity checking) into the safe wrapper types. The `termios` struct is +//! relatively small across all platforms (on the order of 32-64 bytes). +//! +//! The following examples highlight some of the API use cases such that users coming from using C +//! or reading the standard documentation will understand how to use the safe API exposed here. +//! +//! Example disabling processing of the end-of-file control character: +//! +//! ``` +//! # use self::nix::sys::termios::SpecialCharacterIndices::VEOF; +//! # use self::nix::sys::termios::{_POSIX_VDISABLE, Termios}; +//! # let mut termios: Termios = unsafe { std::mem::zeroed() }; +//! termios.control_chars[VEOF as usize] = _POSIX_VDISABLE; +//! ``` +//! +//! The flags within `Termios` are defined as bitfields using the `bitflags` crate. This provides +//! an interface for working with bitfields that is similar to working with the raw unsigned +//! integer types but offers type safety because of the internal checking that values will always +//! be a valid combination of the defined flags. +//! +//! An example showing some of the basic operations for interacting with the control flags: +//! +//! ``` +//! # use self::nix::sys::termios::{ControlFlags, Termios}; +//! # let mut termios: Termios = unsafe { std::mem::zeroed() }; +//! termios.control_flags & ControlFlags::CSIZE == ControlFlags::CS5; +//! termios.control_flags |= ControlFlags::CS5; +//! ``` +//! +//! # Baud rates +//! +//! This API is not consistent across platforms when it comes to `BaudRate`: Android and Linux both +//! only support the rates specified by the `BaudRate` enum through their termios API while the BSDs +//! support arbitrary baud rates as the values of the `BaudRate` enum constants are the same integer +//! value of the constant (`B9600` == `9600`). Therefore the `nix::termios` API uses the following +//! conventions: +//! +//! * `cfgetispeed()` - Returns `u32` on BSDs, `BaudRate` on Android/Linux +//! * `cfgetospeed()` - Returns `u32` on BSDs, `BaudRate` on Android/Linux +//! * `cfsetispeed()` - Takes `u32` or `BaudRate` on BSDs, `BaudRate` on Android/Linux +//! * `cfsetospeed()` - Takes `u32` or `BaudRate` on BSDs, `BaudRate` on Android/Linux +//! * `cfsetspeed()` - Takes `u32` or `BaudRate` on BSDs, `BaudRate` on Android/Linux +//! +//! The most common use case of specifying a baud rate using the enum will work the same across +//! platforms: +//! +//! ```rust +//! # use nix::sys::termios::{BaudRate, cfsetispeed, cfsetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! cfsetispeed(&mut t, BaudRate::B9600).unwrap(); +//! cfsetospeed(&mut t, BaudRate::B9600).unwrap(); +//! cfsetspeed(&mut t, BaudRate::B9600).unwrap(); +//! # } +//! ``` +//! +//! Additionally round-tripping baud rates is consistent across platforms: +//! +//! ```rust +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetispeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, BaudRate::B9600).unwrap(); +//! let speed = cfgetispeed(&t); +//! assert_eq!(speed, cfgetospeed(&t)); +//! cfsetispeed(&mut t, speed).unwrap(); +//! # } +//! ``` +//! +//! On non-BSDs, `cfgetispeed()` and `cfgetospeed()` both return a `BaudRate`: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust,ignore")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust")] +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, BaudRate::B9600); +//! assert_eq!(cfgetispeed(&t), BaudRate::B9600); +//! assert_eq!(cfgetospeed(&t), BaudRate::B9600); +//! # } +//! ``` +//! +//! But on the BSDs, `cfgetispeed()` and `cfgetospeed()` both return `u32`s: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust,ignore")] +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfgetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, 9600u32); +//! assert_eq!(cfgetispeed(&t), 9600u32); +//! assert_eq!(cfgetospeed(&t), 9600u32); +//! # } +//! ``` +//! +//! It's trivial to convert from a `BaudRate` to a `u32` on BSDs: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust,ignore")] +//! # use nix::sys::termios::{BaudRate, cfgetispeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! # cfsetspeed(&mut t, 9600u32); +//! assert_eq!(cfgetispeed(&t), BaudRate::B9600.into()); +//! assert_eq!(u32::from(BaudRate::B9600), 9600u32); +//! # } +//! ``` +//! +//! And on BSDs you can specify arbitrary baud rates (**note** this depends on hardware support) +//! by specifying baud rates directly using `u32`s: +//! +#![cfg_attr(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd"), + doc = " ```rust")] +#![cfg_attr(not(any(target_os = "freebsd", target_os = "dragonfly", target_os = "ios", + target_os = "macos", target_os = "netbsd", target_os = "openbsd")), + doc = " ```rust,ignore")] +//! # use nix::sys::termios::{cfsetispeed, cfsetospeed, cfsetspeed, Termios}; +//! # fn main() { +//! # let mut t: Termios = unsafe { std::mem::zeroed() }; +//! cfsetispeed(&mut t, 9600u32); +//! cfsetospeed(&mut t, 9600u32); +//! cfsetspeed(&mut t, 9600u32); +//! # } +//! ``` +use cfg_if::cfg_if; +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_int, tcflag_t}; +use std::cell::{Ref, RefCell}; +use std::convert::From; +use std::mem; +use std::os::unix::io::RawFd; + +#[cfg(feature = "process")] +use crate::unistd::Pid; + +/// Stores settings for the termios API +/// +/// This is a wrapper around the `libc::termios` struct that provides a safe interface for the +/// standard fields. The only safe way to obtain an instance of this struct is to extract it from +/// an open port using `tcgetattr()`. +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Termios { + inner: RefCell, + /// Input mode flags (see `termios.c_iflag` documentation) + pub input_flags: InputFlags, + /// Output mode flags (see `termios.c_oflag` documentation) + pub output_flags: OutputFlags, + /// Control mode flags (see `termios.c_cflag` documentation) + pub control_flags: ControlFlags, + /// Local mode flags (see `termios.c_lflag` documentation) + pub local_flags: LocalFlags, + /// Control characters (see `termios.c_cc` documentation) + pub control_chars: [libc::cc_t; NCCS], +} + +impl Termios { + /// Exposes an immutable reference to the underlying `libc::termios` data structure. + /// + /// This is not part of `nix`'s public API because it requires additional work to maintain type + /// safety. + pub(crate) fn get_libc_termios(&self) -> Ref { + { + let mut termios = self.inner.borrow_mut(); + termios.c_iflag = self.input_flags.bits(); + termios.c_oflag = self.output_flags.bits(); + termios.c_cflag = self.control_flags.bits(); + termios.c_lflag = self.local_flags.bits(); + termios.c_cc = self.control_chars; + } + self.inner.borrow() + } + + /// Exposes the inner `libc::termios` datastore within `Termios`. + /// + /// This is unsafe because if this is used to modify the inner `libc::termios` struct, it will + /// not automatically update the safe wrapper type around it. In this case it should also be + /// paired with a call to `update_wrapper()` so that the wrapper-type and internal + /// representation stay consistent. + pub(crate) unsafe fn get_libc_termios_mut(&mut self) -> *mut libc::termios { + { + let mut termios = self.inner.borrow_mut(); + termios.c_iflag = self.input_flags.bits(); + termios.c_oflag = self.output_flags.bits(); + termios.c_cflag = self.control_flags.bits(); + termios.c_lflag = self.local_flags.bits(); + termios.c_cc = self.control_chars; + } + self.inner.as_ptr() + } + + /// Updates the wrapper values from the internal `libc::termios` data structure. + pub(crate) fn update_wrapper(&mut self) { + let termios = *self.inner.borrow_mut(); + self.input_flags = InputFlags::from_bits_truncate(termios.c_iflag); + self.output_flags = OutputFlags::from_bits_truncate(termios.c_oflag); + self.control_flags = ControlFlags::from_bits_truncate(termios.c_cflag); + self.local_flags = LocalFlags::from_bits_truncate(termios.c_lflag); + self.control_chars = termios.c_cc; + } +} + +impl From for Termios { + fn from(termios: libc::termios) -> Self { + Termios { + inner: RefCell::new(termios), + input_flags: InputFlags::from_bits_truncate(termios.c_iflag), + output_flags: OutputFlags::from_bits_truncate(termios.c_oflag), + control_flags: ControlFlags::from_bits_truncate(termios.c_cflag), + local_flags: LocalFlags::from_bits_truncate(termios.c_lflag), + control_chars: termios.c_cc, + } + } +} + +impl From for libc::termios { + fn from(termios: Termios) -> Self { + termios.inner.into_inner() + } +} + +libc_enum!{ + /// Baud rates supported by the system. + /// + /// For the BSDs, arbitrary baud rates can be specified by using `u32`s directly instead of this + /// enum. + /// + /// B0 is special and will disable the port. + #[cfg_attr(all(any(target_os = "haiku"), target_pointer_width = "64"), repr(u8))] + #[cfg_attr(all(any(target_os = "ios", target_os = "macos"), target_pointer_width = "64"), repr(u64))] + #[cfg_attr(not(all(any(target_os = "ios", target_os = "macos", target_os = "haiku"), target_pointer_width = "64")), repr(u32))] + #[non_exhaustive] + pub enum BaudRate { + B0, + B50, + B75, + B110, + B134, + B150, + B200, + B300, + B600, + B1200, + B1800, + B2400, + B4800, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B7200, + B9600, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B14400, + B19200, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B28800, + B38400, + B57600, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B76800, + B115200, + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B153600, + B230400, + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B307200, + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B460800, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B500000, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B576000, + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B921600, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B1000000, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B1152000, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B1500000, + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B2000000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B2500000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B3000000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B3500000, + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "sparc64"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + B4000000, + } + impl TryFrom +} + +#[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +impl From for u32 { + fn from(b: BaudRate) -> u32 { + b as u32 + } +} + +#[cfg(target_os = "haiku")] +impl From for u8 { + fn from(b: BaudRate) -> u8 { + b as u8 + } +} + + +// TODO: Add TCSASOFT, which will require treating this as a bitfield. +libc_enum! { + /// Specify when a port configuration change should occur. + /// + /// Used as an argument to `tcsetattr()` + #[repr(i32)] + #[non_exhaustive] + pub enum SetArg { + /// The change will occur immediately + TCSANOW, + /// The change occurs after all output has been written + TCSADRAIN, + /// Same as `TCSADRAIN`, but will also flush the input buffer + TCSAFLUSH, + } +} + +libc_enum! { + /// Specify a combination of the input and output buffers to flush + /// + /// Used as an argument to `tcflush()`. + #[repr(i32)] + #[non_exhaustive] + pub enum FlushArg { + /// Flush data that was received but not read + TCIFLUSH, + /// Flush data written but not transmitted + TCOFLUSH, + /// Flush both received data not read and written data not transmitted + TCIOFLUSH, + } +} + +libc_enum! { + /// Specify how transmission flow should be altered + /// + /// Used as an argument to `tcflow()`. + #[repr(i32)] + #[non_exhaustive] + pub enum FlowArg { + /// Suspend transmission + TCOOFF, + /// Resume transmission + TCOON, + /// Transmit a STOP character, which should disable a connected terminal device + TCIOFF, + /// Transmit a START character, which should re-enable a connected terminal device + TCION, + } +} + +// TODO: Make this usable directly as a slice index. +#[cfg(not(target_os = "haiku"))] +libc_enum! { + /// Indices into the `termios.c_cc` array for special characters. + #[repr(usize)] + #[non_exhaustive] + pub enum SpecialCharacterIndices { + VDISCARD, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VDSUSP, + VEOF, + VEOL, + VEOL2, + VERASE, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VERASE2, + VINTR, + VKILL, + VLNEXT, + #[cfg(not(any(all(target_os = "linux", target_arch = "sparc64"), + target_os = "illumos", target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VMIN, + VQUIT, + VREPRINT, + VSTART, + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VSTATUS, + VSTOP, + VSUSP, + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + VSWTC, + #[cfg(any(target_os = "haiku", target_os = "illumos", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VSWTCH, + #[cfg(not(any(all(target_os = "linux", target_arch = "sparc64"), + target_os = "illumos", target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VTIME, + VWERASE, + #[cfg(target_os = "dragonfly")] + #[cfg_attr(docsrs, doc(cfg(all())))] + VCHECKPT, + } +} + +#[cfg(any(all(target_os = "linux", target_arch = "sparc64"), + target_os = "illumos", target_os = "solaris"))] +impl SpecialCharacterIndices { + pub const VMIN: SpecialCharacterIndices = SpecialCharacterIndices::VEOF; + pub const VTIME: SpecialCharacterIndices = SpecialCharacterIndices::VEOL; +} + +pub use libc::NCCS; +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub use libc::_POSIX_VDISABLE; + +libc_bitflags! { + /// Flags for configuring the input mode of a terminal + pub struct InputFlags: tcflag_t { + IGNBRK; + BRKINT; + IGNPAR; + PARMRK; + INPCK; + ISTRIP; + INLCR; + IGNCR; + ICRNL; + IXON; + IXOFF; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IXANY; + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IMAXBEL; + #[cfg(any(target_os = "android", target_os = "linux", target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IUTF8; + } +} + +libc_bitflags! { + /// Flags for configuring the output mode of a terminal + pub struct OutputFlags: tcflag_t { + OPOST; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "linux", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + OLCUC; + ONLCR; + OCRNL as tcflag_t; + ONOCR as tcflag_t; + ONLRET as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + OFILL as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + OFDEL as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NL0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NL1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CR0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CR1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CR2 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CR3 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TAB0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TAB1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TAB2 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TAB3 as tcflag_t; + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + XTABS; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BS0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BS1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VT0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VT1 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + FF0 as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + FF1 as tcflag_t; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + OXTABS; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ONOEOT as tcflag_t; + + // Bitmasks for use with OutputFlags to select specific settings + // These should be moved to be a mask once https://github.com/rust-lang-nursery/bitflags/issues/110 + // is resolved. + + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NLDLY as tcflag_t; // FIXME: Datatype needs to be corrected in libc for mac + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CRDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TABDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BSDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + VTDLY as tcflag_t; + #[cfg(any(target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + FFDLY as tcflag_t; + } +} + +libc_bitflags! { + /// Flags for setting the control mode of a terminal + pub struct ControlFlags: tcflag_t { + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CIGNORE; + CS5; + CS6; + CS7; + CS8; + CSTOPB; + CREAD; + PARENB; + PARODD; + HUPCL; + CLOCAL; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CRTSCTS; + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CBAUD; + #[cfg(any(target_os = "android", all(target_os = "linux", not(target_arch = "mips"))))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CMSPAR; + #[cfg(any(target_os = "android", + all(target_os = "linux", + not(any(target_arch = "powerpc", target_arch = "powerpc64")))))] + CIBAUD; + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CBAUDEX; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MDMBUF; + #[cfg(any(target_os = "netbsd", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CHWFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CCTS_OFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CRTS_IFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CDTR_IFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CDSR_OFLOW; + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + CCAR_OFLOW; + + // Bitmasks for use with ControlFlags to select specific settings + // These should be moved to be a mask once https://github.com/rust-lang-nursery/bitflags/issues/110 + // is resolved. + + CSIZE; + } +} + +libc_bitflags! { + /// Flags for setting any local modes + pub struct LocalFlags: tcflag_t { + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ECHOKE; + ECHOE; + ECHOK; + ECHO; + ECHONL; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ECHOPRT; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ECHOCTL; + ISIG; + ICANON; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ALTWERASE; + IEXTEN; + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + EXTPROC; + TOSTOP; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + FLUSHO; + #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NOKERNINFO; + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PENDIN; + NOFLSH; + } +} + +cfg_if!{ + if #[cfg(any(target_os = "freebsd", + target_os = "dragonfly", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] { + /// Get input baud rate (see + /// [cfgetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetispeed.html)). + /// + /// `cfgetispeed()` extracts the input baud rate from the given `Termios` structure. + pub fn cfgetispeed(termios: &Termios) -> u32 { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetispeed(&*inner_termios) as u32 } + } + + /// Get output baud rate (see + /// [cfgetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetospeed.html)). + /// + /// `cfgetospeed()` extracts the output baud rate from the given `Termios` structure. + pub fn cfgetospeed(termios: &Termios) -> u32 { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetospeed(&*inner_termios) as u32 } + } + + /// Set input baud rate (see + /// [cfsetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetispeed.html)). + /// + /// `cfsetispeed()` sets the intput baud rate in the given `Termios` structure. + pub fn cfsetispeed>(termios: &mut Termios, baud: T) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetispeed(inner_termios, baud.into() as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set output baud rate (see + /// [cfsetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetospeed.html)). + /// + /// `cfsetospeed()` sets the output baud rate in the given termios structure. + pub fn cfsetospeed>(termios: &mut Termios, baud: T) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetospeed(inner_termios, baud.into() as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set both the input and output baud rates (see + /// [termios(3)](https://www.freebsd.org/cgi/man.cgi?query=cfsetspeed)). + /// + /// `cfsetspeed()` sets the input and output baud rate in the given termios structure. Note that + /// this is part of the 4.4BSD standard and not part of POSIX. + pub fn cfsetspeed>(termios: &mut Termios, baud: T) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetspeed(inner_termios, baud.into() as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + } else { + use std::convert::TryInto; + + /// Get input baud rate (see + /// [cfgetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetispeed.html)). + /// + /// `cfgetispeed()` extracts the input baud rate from the given `Termios` structure. + pub fn cfgetispeed(termios: &Termios) -> BaudRate { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetispeed(&*inner_termios) }.try_into().unwrap() + } + + /// Get output baud rate (see + /// [cfgetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfgetospeed.html)). + /// + /// `cfgetospeed()` extracts the output baud rate from the given `Termios` structure. + pub fn cfgetospeed(termios: &Termios) -> BaudRate { + let inner_termios = termios.get_libc_termios(); + unsafe { libc::cfgetospeed(&*inner_termios) }.try_into().unwrap() + } + + /// Set input baud rate (see + /// [cfsetispeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetispeed.html)). + /// + /// `cfsetispeed()` sets the intput baud rate in the given `Termios` structure. + pub fn cfsetispeed(termios: &mut Termios, baud: BaudRate) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetispeed(inner_termios, baud as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set output baud rate (see + /// [cfsetospeed(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetospeed.html)). + /// + /// `cfsetospeed()` sets the output baud rate in the given `Termios` structure. + pub fn cfsetospeed(termios: &mut Termios, baud: BaudRate) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetospeed(inner_termios, baud as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + + /// Set both the input and output baud rates (see + /// [termios(3)](https://www.freebsd.org/cgi/man.cgi?query=cfsetspeed)). + /// + /// `cfsetspeed()` sets the input and output baud rate in the given `Termios` structure. Note that + /// this is part of the 4.4BSD standard and not part of POSIX. + #[cfg(not(target_os = "haiku"))] + pub fn cfsetspeed(termios: &mut Termios, baud: BaudRate) -> Result<()> { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + let res = unsafe { libc::cfsetspeed(inner_termios, baud as libc::speed_t) }; + termios.update_wrapper(); + Errno::result(res).map(drop) + } + } +} + +/// Configures the port to something like the "raw" mode of the old Version 7 terminal driver (see +/// [termios(3)](https://man7.org/linux/man-pages/man3/termios.3.html)). +/// +/// `cfmakeraw()` configures the termios structure such that input is available character-by- +/// character, echoing is disabled, and all special input and output processing is disabled. Note +/// that this is a non-standard function, but is available on Linux and BSDs. +pub fn cfmakeraw(termios: &mut Termios) { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + unsafe { + libc::cfmakeraw(inner_termios); + } + termios.update_wrapper(); +} + +/// Configures the port to "sane" mode (like the configuration of a newly created terminal) (see +/// [tcsetattr(3)](https://www.freebsd.org/cgi/man.cgi?query=tcsetattr)). +/// +/// Note that this is a non-standard function, available on FreeBSD. +#[cfg(target_os = "freebsd")] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn cfmakesane(termios: &mut Termios) { + let inner_termios = unsafe { termios.get_libc_termios_mut() }; + unsafe { + libc::cfmakesane(inner_termios); + } + termios.update_wrapper(); +} + +/// Return the configuration of a port +/// [tcgetattr(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetattr.html)). +/// +/// `tcgetattr()` returns a `Termios` structure with the current configuration for a port. Modifying +/// this structure *will not* reconfigure the port, instead the modifications should be done to +/// the `Termios` structure and then the port should be reconfigured using `tcsetattr()`. +pub fn tcgetattr(fd: RawFd) -> Result { + let mut termios = mem::MaybeUninit::uninit(); + + let res = unsafe { libc::tcgetattr(fd, termios.as_mut_ptr()) }; + + Errno::result(res)?; + + unsafe { Ok(termios.assume_init().into()) } +} + +/// Set the configuration for a terminal (see +/// [tcsetattr(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetattr.html)). +/// +/// `tcsetattr()` reconfigures the given port based on a given `Termios` structure. This change +/// takes affect at a time specified by `actions`. Note that this function may return success if +/// *any* of the parameters were successfully set, not only if all were set successfully. +pub fn tcsetattr(fd: RawFd, actions: SetArg, termios: &Termios) -> Result<()> { + let inner_termios = termios.get_libc_termios(); + Errno::result(unsafe { libc::tcsetattr(fd, actions as c_int, &*inner_termios) }).map(drop) +} + +/// Block until all output data is written (see +/// [tcdrain(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcdrain.html)). +pub fn tcdrain(fd: RawFd) -> Result<()> { + Errno::result(unsafe { libc::tcdrain(fd) }).map(drop) +} + +/// Suspend or resume the transmission or reception of data (see +/// [tcflow(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcflow.html)). +/// +/// `tcflow()` suspends of resumes the transmission or reception of data for the given port +/// depending on the value of `action`. +pub fn tcflow(fd: RawFd, action: FlowArg) -> Result<()> { + Errno::result(unsafe { libc::tcflow(fd, action as c_int) }).map(drop) +} + +/// Discard data in the output or input queue (see +/// [tcflush(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcflush.html)). +/// +/// `tcflush()` will discard data for a terminal port in the input queue, output queue, or both +/// depending on the value of `action`. +pub fn tcflush(fd: RawFd, action: FlushArg) -> Result<()> { + Errno::result(unsafe { libc::tcflush(fd, action as c_int) }).map(drop) +} + +/// Send a break for a specific duration (see +/// [tcsendbreak(3p)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsendbreak.html)). +/// +/// When using asynchronous data transmission `tcsendbreak()` will transmit a continuous stream +/// of zero-valued bits for an implementation-defined duration. +pub fn tcsendbreak(fd: RawFd, duration: c_int) -> Result<()> { + Errno::result(unsafe { libc::tcsendbreak(fd, duration) }).map(drop) +} + +feature! { +#![feature = "process"] +/// Get the session controlled by the given terminal (see +/// [tcgetsid(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetsid.html)). +pub fn tcgetsid(fd: RawFd) -> Result { + let res = unsafe { libc::tcgetsid(fd) }; + + Errno::result(res).map(Pid::from_raw) +} +} + +#[cfg(test)] +mod test { + use super::*; + use std::convert::TryFrom; + + #[test] + fn try_from() { + assert_eq!(Ok(BaudRate::B0), BaudRate::try_from(libc::B0)); + #[cfg(not(target_os = "haiku"))] + BaudRate::try_from(999999999).expect_err("assertion failed"); + #[cfg(target_os = "haiku")] + BaudRate::try_from(99).expect_err("assertion failed"); + } +} diff --git a/bash-5.1/vendor/nix/src/sys/time.rs b/bash-5.1/vendor/nix/src/sys/time.rs new file mode 100644 index 0000000000000000000000000000000000000000..0cac7e8a2975dee05269edaab123954ea4606716 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/time.rs @@ -0,0 +1,805 @@ +#[cfg_attr(target_env = "musl", allow(deprecated))] +// https://github.com/rust-lang/libc/issues/1848 +pub use libc::{suseconds_t, time_t}; +use libc::{timespec, timeval}; +use std::convert::From; +use std::time::Duration; +use std::{cmp, fmt, ops}; + +#[cfg(any( + all(feature = "time", any(target_os = "android", target_os = "linux")), + all( + any( + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd" + ), + feature = "time", + feature = "signal" + ) +))] +pub(crate) mod timer { + use crate::sys::time::TimeSpec; + use bitflags::bitflags; + + #[derive(Debug, Clone, Copy)] + pub(crate) struct TimerSpec(libc::itimerspec); + + impl TimerSpec { + pub const fn none() -> Self { + Self(libc::itimerspec { + it_interval: libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + it_value: libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + }) + } + } + + impl AsMut for TimerSpec { + fn as_mut(&mut self) -> &mut libc::itimerspec { + &mut self.0 + } + } + + impl AsRef for TimerSpec { + fn as_ref(&self) -> &libc::itimerspec { + &self.0 + } + } + + impl From for TimerSpec { + fn from(expiration: Expiration) -> TimerSpec { + match expiration { + Expiration::OneShot(t) => TimerSpec(libc::itimerspec { + it_interval: libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + it_value: *t.as_ref(), + }), + Expiration::IntervalDelayed(start, interval) => { + TimerSpec(libc::itimerspec { + it_interval: *interval.as_ref(), + it_value: *start.as_ref(), + }) + } + Expiration::Interval(t) => TimerSpec(libc::itimerspec { + it_interval: *t.as_ref(), + it_value: *t.as_ref(), + }), + } + } + } + + /// An enumeration allowing the definition of the expiration time of an alarm, + /// recurring or not. + #[derive(Debug, Clone, Copy, Eq, PartialEq)] + pub enum Expiration { + /// Alarm will trigger once after the time given in `TimeSpec` + OneShot(TimeSpec), + /// Alarm will trigger after a specified delay and then every interval of + /// time. + IntervalDelayed(TimeSpec, TimeSpec), + /// Alarm will trigger every specified interval of time. + Interval(TimeSpec), + } + + #[cfg(any(target_os = "android", target_os = "linux"))] + bitflags! { + /// Flags that are used for arming the timer. + pub struct TimerSetTimeFlags: libc::c_int { + const TFD_TIMER_ABSTIME = libc::TFD_TIMER_ABSTIME; + } + } + #[cfg(any( + target_os = "freebsd", + target_os = "netbsd", + target_os = "dragonfly", + target_os = "illumos" + ))] + bitflags! { + /// Flags that are used for arming the timer. + pub struct TimerSetTimeFlags: libc::c_int { + const TFD_TIMER_ABSTIME = libc::TIMER_ABSTIME; + } + } + + impl From for Expiration { + fn from(timerspec: TimerSpec) -> Expiration { + match timerspec { + TimerSpec(libc::itimerspec { + it_interval: + libc::timespec { + tv_sec: 0, + tv_nsec: 0, + }, + it_value: ts, + }) => Expiration::OneShot(ts.into()), + TimerSpec(libc::itimerspec { + it_interval: int_ts, + it_value: val_ts, + }) => { + if (int_ts.tv_sec == val_ts.tv_sec) + && (int_ts.tv_nsec == val_ts.tv_nsec) + { + Expiration::Interval(int_ts.into()) + } else { + Expiration::IntervalDelayed( + val_ts.into(), + int_ts.into(), + ) + } + } + } + } + } +} + +pub trait TimeValLike: Sized { + #[inline] + fn zero() -> Self { + Self::seconds(0) + } + + #[inline] + fn hours(hours: i64) -> Self { + let secs = hours + .checked_mul(SECS_PER_HOUR) + .expect("TimeValLike::hours ouf of bounds"); + Self::seconds(secs) + } + + #[inline] + fn minutes(minutes: i64) -> Self { + let secs = minutes + .checked_mul(SECS_PER_MINUTE) + .expect("TimeValLike::minutes out of bounds"); + Self::seconds(secs) + } + + fn seconds(seconds: i64) -> Self; + fn milliseconds(milliseconds: i64) -> Self; + fn microseconds(microseconds: i64) -> Self; + fn nanoseconds(nanoseconds: i64) -> Self; + + #[inline] + fn num_hours(&self) -> i64 { + self.num_seconds() / 3600 + } + + #[inline] + fn num_minutes(&self) -> i64 { + self.num_seconds() / 60 + } + + fn num_seconds(&self) -> i64; + fn num_milliseconds(&self) -> i64; + fn num_microseconds(&self) -> i64; + fn num_nanoseconds(&self) -> i64; +} + +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct TimeSpec(timespec); + +const NANOS_PER_SEC: i64 = 1_000_000_000; +const SECS_PER_MINUTE: i64 = 60; +const SECS_PER_HOUR: i64 = 3600; + +#[cfg(target_pointer_width = "64")] +const TS_MAX_SECONDS: i64 = (i64::MAX / NANOS_PER_SEC) - 1; + +#[cfg(target_pointer_width = "32")] +const TS_MAX_SECONDS: i64 = isize::MAX as i64; + +const TS_MIN_SECONDS: i64 = -TS_MAX_SECONDS; + +// x32 compatibility +// See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +type timespec_tv_nsec_t = i64; +#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +type timespec_tv_nsec_t = libc::c_long; + +impl From for TimeSpec { + fn from(ts: timespec) -> Self { + Self(ts) + } +} + +impl From for TimeSpec { + fn from(duration: Duration) -> Self { + Self::from_duration(duration) + } +} + +impl From for Duration { + fn from(timespec: TimeSpec) -> Self { + Duration::new(timespec.0.tv_sec as u64, timespec.0.tv_nsec as u32) + } +} + +impl AsRef for TimeSpec { + fn as_ref(&self) -> ×pec { + &self.0 + } +} + +impl AsMut for TimeSpec { + fn as_mut(&mut self) -> &mut timespec { + &mut self.0 + } +} + +impl Ord for TimeSpec { + // The implementation of cmp is simplified by assuming that the struct is + // normalized. That is, tv_nsec must always be within [0, 1_000_000_000) + fn cmp(&self, other: &TimeSpec) -> cmp::Ordering { + if self.tv_sec() == other.tv_sec() { + self.tv_nsec().cmp(&other.tv_nsec()) + } else { + self.tv_sec().cmp(&other.tv_sec()) + } + } +} + +impl PartialOrd for TimeSpec { + fn partial_cmp(&self, other: &TimeSpec) -> Option { + Some(self.cmp(other)) + } +} + +impl TimeValLike for TimeSpec { + #[inline] + fn seconds(seconds: i64) -> TimeSpec { + assert!( + (TS_MIN_SECONDS..=TS_MAX_SECONDS).contains(&seconds), + "TimeSpec out of bounds; seconds={}", + seconds + ); + #[cfg_attr(target_env = "musl", allow(deprecated))] + // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec { + tv_sec: seconds as time_t, + tv_nsec: 0, + }) + } + + #[inline] + fn milliseconds(milliseconds: i64) -> TimeSpec { + let nanoseconds = milliseconds + .checked_mul(1_000_000) + .expect("TimeSpec::milliseconds out of bounds"); + + TimeSpec::nanoseconds(nanoseconds) + } + + /// Makes a new `TimeSpec` with given number of microseconds. + #[inline] + fn microseconds(microseconds: i64) -> TimeSpec { + let nanoseconds = microseconds + .checked_mul(1_000) + .expect("TimeSpec::milliseconds out of bounds"); + + TimeSpec::nanoseconds(nanoseconds) + } + + /// Makes a new `TimeSpec` with given number of nanoseconds. + #[inline] + fn nanoseconds(nanoseconds: i64) -> TimeSpec { + let (secs, nanos) = div_mod_floor_64(nanoseconds, NANOS_PER_SEC); + assert!( + (TS_MIN_SECONDS..=TS_MAX_SECONDS).contains(&secs), + "TimeSpec out of bounds" + ); + #[cfg_attr(target_env = "musl", allow(deprecated))] + // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec { + tv_sec: secs as time_t, + tv_nsec: nanos as timespec_tv_nsec_t, + }) + } + + fn num_seconds(&self) -> i64 { + if self.tv_sec() < 0 && self.tv_nsec() > 0 { + (self.tv_sec() + 1) as i64 + } else { + self.tv_sec() as i64 + } + } + + fn num_milliseconds(&self) -> i64 { + self.num_nanoseconds() / 1_000_000 + } + + fn num_microseconds(&self) -> i64 { + self.num_nanoseconds() / 1_000_000_000 + } + + fn num_nanoseconds(&self) -> i64 { + let secs = self.num_seconds() * 1_000_000_000; + let nsec = self.nanos_mod_sec(); + secs + nsec as i64 + } +} + +impl TimeSpec { + /// Construct a new `TimeSpec` from its components + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + pub const fn new(seconds: time_t, nanoseconds: timespec_tv_nsec_t) -> Self { + Self(timespec { + tv_sec: seconds, + tv_nsec: nanoseconds, + }) + } + + fn nanos_mod_sec(&self) -> timespec_tv_nsec_t { + if self.tv_sec() < 0 && self.tv_nsec() > 0 { + self.tv_nsec() - NANOS_PER_SEC as timespec_tv_nsec_t + } else { + self.tv_nsec() + } + } + + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + pub const fn tv_sec(&self) -> time_t { + self.0.tv_sec + } + + pub const fn tv_nsec(&self) -> timespec_tv_nsec_t { + self.0.tv_nsec + } + + pub const fn from_duration(duration: Duration) -> Self { + #[cfg_attr(target_env = "musl", allow(deprecated))] + // https://github.com/rust-lang/libc/issues/1848 + TimeSpec(timespec { + tv_sec: duration.as_secs() as time_t, + tv_nsec: duration.subsec_nanos() as timespec_tv_nsec_t, + }) + } + + pub const fn from_timespec(timespec: timespec) -> Self { + Self(timespec) + } +} + +impl ops::Neg for TimeSpec { + type Output = TimeSpec; + + fn neg(self) -> TimeSpec { + TimeSpec::nanoseconds(-self.num_nanoseconds()) + } +} + +impl ops::Add for TimeSpec { + type Output = TimeSpec; + + fn add(self, rhs: TimeSpec) -> TimeSpec { + TimeSpec::nanoseconds(self.num_nanoseconds() + rhs.num_nanoseconds()) + } +} + +impl ops::Sub for TimeSpec { + type Output = TimeSpec; + + fn sub(self, rhs: TimeSpec) -> TimeSpec { + TimeSpec::nanoseconds(self.num_nanoseconds() - rhs.num_nanoseconds()) + } +} + +impl ops::Mul for TimeSpec { + type Output = TimeSpec; + + fn mul(self, rhs: i32) -> TimeSpec { + let usec = self + .num_nanoseconds() + .checked_mul(i64::from(rhs)) + .expect("TimeSpec multiply out of bounds"); + + TimeSpec::nanoseconds(usec) + } +} + +impl ops::Div for TimeSpec { + type Output = TimeSpec; + + fn div(self, rhs: i32) -> TimeSpec { + let usec = self.num_nanoseconds() / i64::from(rhs); + TimeSpec::nanoseconds(usec) + } +} + +impl fmt::Display for TimeSpec { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let (abs, sign) = if self.tv_sec() < 0 { + (-*self, "-") + } else { + (*self, "") + }; + + let sec = abs.tv_sec(); + + write!(f, "{}", sign)?; + + if abs.tv_nsec() == 0 { + if abs.tv_sec() == 1 { + write!(f, "{} second", sec)?; + } else { + write!(f, "{} seconds", sec)?; + } + } else if abs.tv_nsec() % 1_000_000 == 0 { + write!(f, "{}.{:03} seconds", sec, abs.tv_nsec() / 1_000_000)?; + } else if abs.tv_nsec() % 1_000 == 0 { + write!(f, "{}.{:06} seconds", sec, abs.tv_nsec() / 1_000)?; + } else { + write!(f, "{}.{:09} seconds", sec, abs.tv_nsec())?; + } + + Ok(()) + } +} + +#[repr(transparent)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct TimeVal(timeval); + +const MICROS_PER_SEC: i64 = 1_000_000; + +#[cfg(target_pointer_width = "64")] +const TV_MAX_SECONDS: i64 = (i64::MAX / MICROS_PER_SEC) - 1; + +#[cfg(target_pointer_width = "32")] +const TV_MAX_SECONDS: i64 = isize::MAX as i64; + +const TV_MIN_SECONDS: i64 = -TV_MAX_SECONDS; + +impl AsRef for TimeVal { + fn as_ref(&self) -> &timeval { + &self.0 + } +} + +impl AsMut for TimeVal { + fn as_mut(&mut self) -> &mut timeval { + &mut self.0 + } +} + +impl Ord for TimeVal { + // The implementation of cmp is simplified by assuming that the struct is + // normalized. That is, tv_usec must always be within [0, 1_000_000) + fn cmp(&self, other: &TimeVal) -> cmp::Ordering { + if self.tv_sec() == other.tv_sec() { + self.tv_usec().cmp(&other.tv_usec()) + } else { + self.tv_sec().cmp(&other.tv_sec()) + } + } +} + +impl PartialOrd for TimeVal { + fn partial_cmp(&self, other: &TimeVal) -> Option { + Some(self.cmp(other)) + } +} + +impl TimeValLike for TimeVal { + #[inline] + fn seconds(seconds: i64) -> TimeVal { + assert!( + (TV_MIN_SECONDS..=TV_MAX_SECONDS).contains(&seconds), + "TimeVal out of bounds; seconds={}", + seconds + ); + #[cfg_attr(target_env = "musl", allow(deprecated))] + // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval { + tv_sec: seconds as time_t, + tv_usec: 0, + }) + } + + #[inline] + fn milliseconds(milliseconds: i64) -> TimeVal { + let microseconds = milliseconds + .checked_mul(1_000) + .expect("TimeVal::milliseconds out of bounds"); + + TimeVal::microseconds(microseconds) + } + + /// Makes a new `TimeVal` with given number of microseconds. + #[inline] + fn microseconds(microseconds: i64) -> TimeVal { + let (secs, micros) = div_mod_floor_64(microseconds, MICROS_PER_SEC); + assert!( + (TV_MIN_SECONDS..=TV_MAX_SECONDS).contains(&secs), + "TimeVal out of bounds" + ); + #[cfg_attr(target_env = "musl", allow(deprecated))] + // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval { + tv_sec: secs as time_t, + tv_usec: micros as suseconds_t, + }) + } + + /// Makes a new `TimeVal` with given number of nanoseconds. Some precision + /// will be lost + #[inline] + fn nanoseconds(nanoseconds: i64) -> TimeVal { + let microseconds = nanoseconds / 1000; + let (secs, micros) = div_mod_floor_64(microseconds, MICROS_PER_SEC); + assert!( + (TV_MIN_SECONDS..=TV_MAX_SECONDS).contains(&secs), + "TimeVal out of bounds" + ); + #[cfg_attr(target_env = "musl", allow(deprecated))] + // https://github.com/rust-lang/libc/issues/1848 + TimeVal(timeval { + tv_sec: secs as time_t, + tv_usec: micros as suseconds_t, + }) + } + + fn num_seconds(&self) -> i64 { + if self.tv_sec() < 0 && self.tv_usec() > 0 { + (self.tv_sec() + 1) as i64 + } else { + self.tv_sec() as i64 + } + } + + fn num_milliseconds(&self) -> i64 { + self.num_microseconds() / 1_000 + } + + fn num_microseconds(&self) -> i64 { + let secs = self.num_seconds() * 1_000_000; + let usec = self.micros_mod_sec(); + secs + usec as i64 + } + + fn num_nanoseconds(&self) -> i64 { + self.num_microseconds() * 1_000 + } +} + +impl TimeVal { + /// Construct a new `TimeVal` from its components + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + pub const fn new(seconds: time_t, microseconds: suseconds_t) -> Self { + Self(timeval { + tv_sec: seconds, + tv_usec: microseconds, + }) + } + + fn micros_mod_sec(&self) -> suseconds_t { + if self.tv_sec() < 0 && self.tv_usec() > 0 { + self.tv_usec() - MICROS_PER_SEC as suseconds_t + } else { + self.tv_usec() + } + } + + #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 + pub const fn tv_sec(&self) -> time_t { + self.0.tv_sec + } + + pub const fn tv_usec(&self) -> suseconds_t { + self.0.tv_usec + } +} + +impl ops::Neg for TimeVal { + type Output = TimeVal; + + fn neg(self) -> TimeVal { + TimeVal::microseconds(-self.num_microseconds()) + } +} + +impl ops::Add for TimeVal { + type Output = TimeVal; + + fn add(self, rhs: TimeVal) -> TimeVal { + TimeVal::microseconds(self.num_microseconds() + rhs.num_microseconds()) + } +} + +impl ops::Sub for TimeVal { + type Output = TimeVal; + + fn sub(self, rhs: TimeVal) -> TimeVal { + TimeVal::microseconds(self.num_microseconds() - rhs.num_microseconds()) + } +} + +impl ops::Mul for TimeVal { + type Output = TimeVal; + + fn mul(self, rhs: i32) -> TimeVal { + let usec = self + .num_microseconds() + .checked_mul(i64::from(rhs)) + .expect("TimeVal multiply out of bounds"); + + TimeVal::microseconds(usec) + } +} + +impl ops::Div for TimeVal { + type Output = TimeVal; + + fn div(self, rhs: i32) -> TimeVal { + let usec = self.num_microseconds() / i64::from(rhs); + TimeVal::microseconds(usec) + } +} + +impl fmt::Display for TimeVal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let (abs, sign) = if self.tv_sec() < 0 { + (-*self, "-") + } else { + (*self, "") + }; + + let sec = abs.tv_sec(); + + write!(f, "{}", sign)?; + + if abs.tv_usec() == 0 { + if abs.tv_sec() == 1 { + write!(f, "{} second", sec)?; + } else { + write!(f, "{} seconds", sec)?; + } + } else if abs.tv_usec() % 1000 == 0 { + write!(f, "{}.{:03} seconds", sec, abs.tv_usec() / 1000)?; + } else { + write!(f, "{}.{:06} seconds", sec, abs.tv_usec())?; + } + + Ok(()) + } +} + +impl From for TimeVal { + fn from(tv: timeval) -> Self { + TimeVal(tv) + } +} + +#[inline] +fn div_mod_floor_64(this: i64, other: i64) -> (i64, i64) { + (div_floor_64(this, other), mod_floor_64(this, other)) +} + +#[inline] +fn div_floor_64(this: i64, other: i64) -> i64 { + match div_rem_64(this, other) { + (d, r) if (r > 0 && other < 0) || (r < 0 && other > 0) => d - 1, + (d, _) => d, + } +} + +#[inline] +fn mod_floor_64(this: i64, other: i64) -> i64 { + match this % other { + r if (r > 0 && other < 0) || (r < 0 && other > 0) => r + other, + r => r, + } +} + +#[inline] +fn div_rem_64(this: i64, other: i64) -> (i64, i64) { + (this / other, this % other) +} + +#[cfg(test)] +mod test { + use super::{TimeSpec, TimeVal, TimeValLike}; + use std::time::Duration; + + #[test] + pub fn test_timespec() { + assert_ne!(TimeSpec::seconds(1), TimeSpec::zero()); + assert_eq!( + TimeSpec::seconds(1) + TimeSpec::seconds(2), + TimeSpec::seconds(3) + ); + assert_eq!( + TimeSpec::minutes(3) + TimeSpec::seconds(2), + TimeSpec::seconds(182) + ); + } + + #[test] + pub fn test_timespec_from() { + let duration = Duration::new(123, 123_456_789); + let timespec = TimeSpec::nanoseconds(123_123_456_789); + + assert_eq!(TimeSpec::from(duration), timespec); + assert_eq!(Duration::from(timespec), duration); + } + + #[test] + pub fn test_timespec_neg() { + let a = TimeSpec::seconds(1) + TimeSpec::nanoseconds(123); + let b = TimeSpec::seconds(-1) + TimeSpec::nanoseconds(-123); + + assert_eq!(a, -b); + } + + #[test] + pub fn test_timespec_ord() { + assert_eq!(TimeSpec::seconds(1), TimeSpec::nanoseconds(1_000_000_000)); + assert!(TimeSpec::seconds(1) < TimeSpec::nanoseconds(1_000_000_001)); + assert!(TimeSpec::seconds(1) > TimeSpec::nanoseconds(999_999_999)); + assert!(TimeSpec::seconds(-1) < TimeSpec::nanoseconds(-999_999_999)); + assert!(TimeSpec::seconds(-1) > TimeSpec::nanoseconds(-1_000_000_001)); + } + + #[test] + pub fn test_timespec_fmt() { + assert_eq!(TimeSpec::zero().to_string(), "0 seconds"); + assert_eq!(TimeSpec::seconds(42).to_string(), "42 seconds"); + assert_eq!(TimeSpec::milliseconds(42).to_string(), "0.042 seconds"); + assert_eq!(TimeSpec::microseconds(42).to_string(), "0.000042 seconds"); + assert_eq!( + TimeSpec::nanoseconds(42).to_string(), + "0.000000042 seconds" + ); + assert_eq!(TimeSpec::seconds(-86401).to_string(), "-86401 seconds"); + } + + #[test] + pub fn test_timeval() { + assert_ne!(TimeVal::seconds(1), TimeVal::zero()); + assert_eq!( + TimeVal::seconds(1) + TimeVal::seconds(2), + TimeVal::seconds(3) + ); + assert_eq!( + TimeVal::minutes(3) + TimeVal::seconds(2), + TimeVal::seconds(182) + ); + } + + #[test] + pub fn test_timeval_ord() { + assert_eq!(TimeVal::seconds(1), TimeVal::microseconds(1_000_000)); + assert!(TimeVal::seconds(1) < TimeVal::microseconds(1_000_001)); + assert!(TimeVal::seconds(1) > TimeVal::microseconds(999_999)); + assert!(TimeVal::seconds(-1) < TimeVal::microseconds(-999_999)); + assert!(TimeVal::seconds(-1) > TimeVal::microseconds(-1_000_001)); + } + + #[test] + pub fn test_timeval_neg() { + let a = TimeVal::seconds(1) + TimeVal::microseconds(123); + let b = TimeVal::seconds(-1) + TimeVal::microseconds(-123); + + assert_eq!(a, -b); + } + + #[test] + pub fn test_timeval_fmt() { + assert_eq!(TimeVal::zero().to_string(), "0 seconds"); + assert_eq!(TimeVal::seconds(42).to_string(), "42 seconds"); + assert_eq!(TimeVal::milliseconds(42).to_string(), "0.042 seconds"); + assert_eq!(TimeVal::microseconds(42).to_string(), "0.000042 seconds"); + assert_eq!(TimeVal::nanoseconds(1402).to_string(), "0.000001 seconds"); + assert_eq!(TimeVal::seconds(-86401).to_string(), "-86401 seconds"); + } +} diff --git a/bash-5.1/vendor/nix/src/sys/timer.rs b/bash-5.1/vendor/nix/src/sys/timer.rs new file mode 100644 index 0000000000000000000000000000000000000000..45ce0e5bf6b34998f2dfb99678744059572beb3f --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/timer.rs @@ -0,0 +1,179 @@ +//! Timer API via signals. +//! +//! Timer is a POSIX API to create timers and get expiration notifications +//! through queued Unix signals, for the current process. This is similar to +//! Linux's timerfd mechanism, except that API is specific to Linux and makes +//! use of file polling. +//! +//! For more documentation, please read [timer_create](https://pubs.opengroup.org/onlinepubs/9699919799/functions/timer_create.html). +//! +//! # Examples +//! +//! Create an interval timer that signals SIGALARM every 250 milliseconds. +//! +//! ```no_run +//! use nix::sys::signal::{self, SigEvent, SigHandler, SigevNotify, Signal}; +//! use nix::sys::timer::{Expiration, Timer, TimerSetTimeFlags}; +//! use nix::time::ClockId; +//! use std::convert::TryFrom; +//! use std::sync::atomic::{AtomicU64, Ordering}; +//! use std::thread::yield_now; +//! use std::time::Duration; +//! +//! const SIG: Signal = Signal::SIGALRM; +//! static ALARMS: AtomicU64 = AtomicU64::new(0); +//! +//! extern "C" fn handle_alarm(signal: libc::c_int) { +//! let signal = Signal::try_from(signal).unwrap(); +//! if signal == SIG { +//! ALARMS.fetch_add(1, Ordering::Relaxed); +//! } +//! } +//! +//! fn main() { +//! let clockid = ClockId::CLOCK_MONOTONIC; +//! let sigevent = SigEvent::new(SigevNotify::SigevSignal { +//! signal: SIG, +//! si_value: 0, +//! }); +//! +//! let mut timer = Timer::new(clockid, sigevent).unwrap(); +//! let expiration = Expiration::Interval(Duration::from_millis(250).into()); +//! let flags = TimerSetTimeFlags::empty(); +//! timer.set(expiration, flags).expect("could not set timer"); +//! +//! let handler = SigHandler::Handler(handle_alarm); +//! unsafe { signal::signal(SIG, handler) }.unwrap(); +//! +//! loop { +//! let alarms = ALARMS.load(Ordering::Relaxed); +//! if alarms >= 10 { +//! println!("total alarms handled: {}", alarms); +//! break; +//! } +//! yield_now() +//! } +//! } +//! ``` +use crate::sys::signal::SigEvent; +use crate::sys::time::timer::TimerSpec; +pub use crate::sys::time::timer::{Expiration, TimerSetTimeFlags}; +use crate::time::ClockId; +use crate::{errno::Errno, Result}; +use core::mem; + +/// A Unix signal per-process timer. +#[derive(Debug)] +#[repr(transparent)] +pub struct Timer(libc::timer_t); + +impl Timer { + /// Creates a new timer based on the clock defined by `clockid`. The details + /// of the signal and its handler are defined by the passed `sigevent`. + #[cfg_attr(has_doc_alias, doc(alias("timer_create")))] + pub fn new(clockid: ClockId, mut sigevent: SigEvent) -> Result { + let mut timer_id: mem::MaybeUninit = mem::MaybeUninit::uninit(); + Errno::result(unsafe { + libc::timer_create( + clockid.as_raw(), + sigevent.as_mut_ptr(), + timer_id.as_mut_ptr(), + ) + }) + .map(|_| { + // SAFETY: libc::timer_create is responsible for initializing + // timer_id. + unsafe { Self(timer_id.assume_init()) } + }) + } + + /// Set a new alarm on the timer. + /// + /// # Types of alarm + /// + /// There are 3 types of alarms you can set: + /// + /// - one shot: the alarm will trigger once after the specified amount of + /// time. + /// Example: I want an alarm to go off in 60s and then disable itself. + /// + /// - interval: the alarm will trigger every specified interval of time. + /// Example: I want an alarm to go off every 60s. The alarm will first + /// go off 60s after I set it and every 60s after that. The alarm will + /// not disable itself. + /// + /// - interval delayed: the alarm will trigger after a certain amount of + /// time and then trigger at a specified interval. + /// Example: I want an alarm to go off every 60s but only start in 1h. + /// The alarm will first trigger 1h after I set it and then every 60s + /// after that. The alarm will not disable itself. + /// + /// # Relative vs absolute alarm + /// + /// If you do not set any `TimerSetTimeFlags`, then the `TimeSpec` you pass + /// to the `Expiration` you want is relative. If however you want an alarm + /// to go off at a certain point in time, you can set `TFD_TIMER_ABSTIME`. + /// Then the one shot TimeSpec and the delay TimeSpec of the delayed + /// interval are going to be interpreted as absolute. + /// + /// # Disabling alarms + /// + /// Note: Only one alarm can be set for any given timer. Setting a new alarm + /// actually removes the previous one. + /// + /// Note: Setting a one shot alarm with a 0s TimeSpec disable the alarm + /// altogether. + #[cfg_attr(has_doc_alias, doc(alias("timer_settime")))] + pub fn set(&mut self, expiration: Expiration, flags: TimerSetTimeFlags) -> Result<()> { + let timerspec: TimerSpec = expiration.into(); + Errno::result(unsafe { + libc::timer_settime( + self.0, + flags.bits(), + timerspec.as_ref(), + core::ptr::null_mut(), + ) + }) + .map(drop) + } + + /// Get the parameters for the alarm currently set, if any. + #[cfg_attr(has_doc_alias, doc(alias("timer_gettime")))] + pub fn get(&self) -> Result> { + let mut timerspec = TimerSpec::none(); + Errno::result(unsafe { libc::timer_gettime(self.0, timerspec.as_mut()) }).map(|_| { + if timerspec.as_ref().it_interval.tv_sec == 0 + && timerspec.as_ref().it_interval.tv_nsec == 0 + && timerspec.as_ref().it_value.tv_sec == 0 + && timerspec.as_ref().it_value.tv_nsec == 0 + { + None + } else { + Some(timerspec.into()) + } + }) + } + + /// Return the number of timers that have overrun + /// + /// Each timer is able to queue one signal to the process at a time, meaning + /// if the signal is not handled before the next expiration the timer has + /// 'overrun'. This function returns how many times that has happened to + /// this timer, up to `libc::DELAYTIMER_MAX`. If more than the maximum + /// number of overruns have happened the return is capped to the maximum. + #[cfg_attr(has_doc_alias, doc(alias("timer_getoverrun")))] + pub fn overruns(&self) -> i32 { + unsafe { libc::timer_getoverrun(self.0) } + } +} + +impl Drop for Timer { + fn drop(&mut self) { + if !std::thread::panicking() { + let result = Errno::result(unsafe { libc::timer_delete(self.0) }); + if let Err(Errno::EINVAL) = result { + panic!("close of Timer encountered EINVAL"); + } + } + } +} diff --git a/bash-5.1/vendor/nix/src/sys/timerfd.rs b/bash-5.1/vendor/nix/src/sys/timerfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..42860658aa5fbf6dd50bea3780a8593223fb72d7 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/timerfd.rs @@ -0,0 +1,205 @@ +//! Timer API via file descriptors. +//! +//! Timer FD is a Linux-only API to create timers and get expiration +//! notifications through file descriptors. +//! +//! For more documentation, please read [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html). +//! +//! # Examples +//! +//! Create a new one-shot timer that expires after 1 second. +//! ``` +//! # use std::os::unix::io::AsRawFd; +//! # use nix::sys::timerfd::{TimerFd, ClockId, TimerFlags, TimerSetTimeFlags, +//! # Expiration}; +//! # use nix::sys::time::{TimeSpec, TimeValLike}; +//! # use nix::unistd::read; +//! # +//! // We create a new monotonic timer. +//! let timer = TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()) +//! .unwrap(); +//! +//! // We set a new one-shot timer in 1 seconds. +//! timer.set( +//! Expiration::OneShot(TimeSpec::seconds(1)), +//! TimerSetTimeFlags::empty() +//! ).unwrap(); +//! +//! // We wait for the timer to expire. +//! timer.wait().unwrap(); +//! ``` +use crate::sys::time::timer::TimerSpec; +pub use crate::sys::time::timer::{Expiration, TimerSetTimeFlags}; +use crate::unistd::read; +use crate::{errno::Errno, Result}; +use libc::c_int; +use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; + +/// A timerfd instance. This is also a file descriptor, you can feed it to +/// other interfaces consuming file descriptors, epoll for example. +#[derive(Debug)] +pub struct TimerFd { + fd: RawFd, +} + +impl AsRawFd for TimerFd { + fn as_raw_fd(&self) -> RawFd { + self.fd + } +} + +impl FromRawFd for TimerFd { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + TimerFd { fd } + } +} + +libc_enum! { + /// The type of the clock used to mark the progress of the timer. For more + /// details on each kind of clock, please refer to [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html). + #[repr(i32)] + #[non_exhaustive] + pub enum ClockId { + /// A settable system-wide real-time clock. + CLOCK_REALTIME, + /// A non-settable monotonically increasing clock. + /// + /// Does not change after system startup. + /// Does not measure time while the system is suspended. + CLOCK_MONOTONIC, + /// Like `CLOCK_MONOTONIC`, except that `CLOCK_BOOTTIME` includes the time + /// that the system was suspended. + CLOCK_BOOTTIME, + /// Like `CLOCK_REALTIME`, but will wake the system if it is suspended. + CLOCK_REALTIME_ALARM, + /// Like `CLOCK_BOOTTIME`, but will wake the system if it is suspended. + CLOCK_BOOTTIME_ALARM, + } +} + +libc_bitflags! { + /// Additional flags to change the behaviour of the file descriptor at the + /// time of creation. + pub struct TimerFlags: c_int { + /// Set the `O_NONBLOCK` flag on the open file description referred to by the new file descriptor. + TFD_NONBLOCK; + /// Set the `FD_CLOEXEC` flag on the file descriptor. + TFD_CLOEXEC; + } +} + +impl TimerFd { + /// Creates a new timer based on the clock defined by `clockid`. The + /// underlying fd can be assigned specific flags with `flags` (CLOEXEC, + /// NONBLOCK). The underlying fd will be closed on drop. + #[cfg_attr(has_doc_alias, doc(alias("timerfd_create")))] + pub fn new(clockid: ClockId, flags: TimerFlags) -> Result { + Errno::result(unsafe { libc::timerfd_create(clockid as i32, flags.bits()) }) + .map(|fd| Self { fd }) + } + + /// Sets a new alarm on the timer. + /// + /// # Types of alarm + /// + /// There are 3 types of alarms you can set: + /// + /// - one shot: the alarm will trigger once after the specified amount of + /// time. + /// Example: I want an alarm to go off in 60s and then disable itself. + /// + /// - interval: the alarm will trigger every specified interval of time. + /// Example: I want an alarm to go off every 60s. The alarm will first + /// go off 60s after I set it and every 60s after that. The alarm will + /// not disable itself. + /// + /// - interval delayed: the alarm will trigger after a certain amount of + /// time and then trigger at a specified interval. + /// Example: I want an alarm to go off every 60s but only start in 1h. + /// The alarm will first trigger 1h after I set it and then every 60s + /// after that. The alarm will not disable itself. + /// + /// # Relative vs absolute alarm + /// + /// If you do not set any `TimerSetTimeFlags`, then the `TimeSpec` you pass + /// to the `Expiration` you want is relative. If however you want an alarm + /// to go off at a certain point in time, you can set `TFD_TIMER_ABSTIME`. + /// Then the one shot TimeSpec and the delay TimeSpec of the delayed + /// interval are going to be interpreted as absolute. + /// + /// # Disabling alarms + /// + /// Note: Only one alarm can be set for any given timer. Setting a new alarm + /// actually removes the previous one. + /// + /// Note: Setting a one shot alarm with a 0s TimeSpec disables the alarm + /// altogether. + #[cfg_attr(has_doc_alias, doc(alias("timerfd_settime")))] + pub fn set(&self, expiration: Expiration, flags: TimerSetTimeFlags) -> Result<()> { + let timerspec: TimerSpec = expiration.into(); + Errno::result(unsafe { + libc::timerfd_settime( + self.fd, + flags.bits(), + timerspec.as_ref(), + std::ptr::null_mut(), + ) + }) + .map(drop) + } + + /// Get the parameters for the alarm currently set, if any. + #[cfg_attr(has_doc_alias, doc(alias("timerfd_gettime")))] + pub fn get(&self) -> Result> { + let mut timerspec = TimerSpec::none(); + Errno::result(unsafe { libc::timerfd_gettime(self.fd, timerspec.as_mut()) }).map(|_| { + if timerspec.as_ref().it_interval.tv_sec == 0 + && timerspec.as_ref().it_interval.tv_nsec == 0 + && timerspec.as_ref().it_value.tv_sec == 0 + && timerspec.as_ref().it_value.tv_nsec == 0 + { + None + } else { + Some(timerspec.into()) + } + }) + } + + /// Remove the alarm if any is set. + #[cfg_attr(has_doc_alias, doc(alias("timerfd_settime")))] + pub fn unset(&self) -> Result<()> { + Errno::result(unsafe { + libc::timerfd_settime( + self.fd, + TimerSetTimeFlags::empty().bits(), + TimerSpec::none().as_ref(), + std::ptr::null_mut(), + ) + }) + .map(drop) + } + + /// Wait for the configured alarm to expire. + /// + /// Note: If the alarm is unset, then you will wait forever. + pub fn wait(&self) -> Result<()> { + while let Err(e) = read(self.fd, &mut [0u8; 8]) { + if e != Errno::EINTR { + return Err(e); + } + } + + Ok(()) + } +} + +impl Drop for TimerFd { + fn drop(&mut self) { + if !std::thread::panicking() { + let result = Errno::result(unsafe { libc::close(self.fd) }); + if let Err(Errno::EBADF) = result { + panic!("close of TimerFd encountered EBADF"); + } + } + } +} diff --git a/bash-5.1/vendor/nix/src/sys/uio.rs b/bash-5.1/vendor/nix/src/sys/uio.rs new file mode 100644 index 0000000000000000000000000000000000000000..1908973b496e53c7d95322ee1e21bbf5effca269 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/uio.rs @@ -0,0 +1,270 @@ +//! Vectored I/O + +use crate::Result; +use crate::errno::Errno; +use libc::{self, c_int, c_void, size_t, off_t}; +use std::io::{IoSlice, IoSliceMut}; +use std::marker::PhantomData; +use std::os::unix::io::RawFd; + +/// Low-level vectored write to a raw file descriptor +/// +/// See also [writev(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/writev.html) +pub fn writev(fd: RawFd, iov: &[IoSlice<'_>]) -> Result { + // SAFETY: to quote the documentation for `IoSlice`: + // + // [IoSlice] is semantically a wrapper around a &[u8], but is + // guaranteed to be ABI compatible with the iovec type on Unix + // platforms. + // + // Because it is ABI compatible, a pointer cast here is valid + let res = unsafe { libc::writev(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int) }; + + Errno::result(res).map(|r| r as usize) +} + +/// Low-level vectored read from a raw file descriptor +/// +/// See also [readv(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/readv.html) +pub fn readv(fd: RawFd, iov: &mut [IoSliceMut<'_>]) -> Result { + // SAFETY: same as in writev(), IoSliceMut is ABI-compatible with iovec + let res = unsafe { libc::readv(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int) }; + + Errno::result(res).map(|r| r as usize) +} + +/// Write to `fd` at `offset` from buffers in `iov`. +/// +/// Buffers in `iov` will be written in order until all buffers have been written +/// or an error occurs. The file offset is not changed. +/// +/// See also: [`writev`](fn.writev.html) and [`pwrite`](fn.pwrite.html) +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn pwritev(fd: RawFd, iov: &[IoSlice<'_>], + offset: off_t) -> Result { + + #[cfg(target_env = "uclibc")] + let offset = offset as libc::off64_t; // uclibc doesn't use off_t + + // SAFETY: same as in writev() + let res = unsafe { + libc::pwritev(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int, offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Read from `fd` at `offset` filling buffers in `iov`. +/// +/// Buffers in `iov` will be filled in order until all buffers have been filled, +/// no more bytes are available, or an error occurs. The file offset is not +/// changed. +/// +/// See also: [`readv`](fn.readv.html) and [`pread`](fn.pread.html) +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn preadv(fd: RawFd, iov: &mut [IoSliceMut<'_>], + offset: off_t) -> Result { + #[cfg(target_env = "uclibc")] + let offset = offset as libc::off64_t; // uclibc doesn't use off_t + + // SAFETY: same as in readv() + let res = unsafe { + libc::preadv(fd, iov.as_ptr() as *const libc::iovec, iov.len() as c_int, offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Low-level write to a file, with specified offset. +/// +/// See also [pwrite(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html) +// TODO: move to unistd +pub fn pwrite(fd: RawFd, buf: &[u8], offset: off_t) -> Result { + let res = unsafe { + libc::pwrite(fd, buf.as_ptr() as *const c_void, buf.len() as size_t, + offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Low-level read from a file, with specified offset. +/// +/// See also [pread(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html) +// TODO: move to unistd +pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result{ + let res = unsafe { + libc::pread(fd, buf.as_mut_ptr() as *mut c_void, buf.len() as size_t, + offset) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// A slice of memory in a remote process, starting at address `base` +/// and consisting of `len` bytes. +/// +/// This is the same underlying C structure as `IoSlice`, +/// except that it refers to memory in some other process, and is +/// therefore not represented in Rust by an actual slice as `IoSlice` is. It +/// is used with [`process_vm_readv`](fn.process_vm_readv.html) +/// and [`process_vm_writev`](fn.process_vm_writev.html). +#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +#[repr(C)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct RemoteIoVec { + /// The starting address of this slice (`iov_base`). + pub base: usize, + /// The number of bytes in this slice (`iov_len`). + pub len: usize, +} + +/// A vector of buffers. +/// +/// Vectored I/O methods like [`writev`] and [`readv`] use this structure for +/// both reading and writing. Each `IoVec` specifies the base address and +/// length of an area in memory. +#[deprecated( + since = "0.24.0", + note = "`IoVec` is no longer used in the public interface, use `IoSlice` or `IoSliceMut` instead" +)] +#[repr(transparent)] +#[allow(renamed_and_removed_lints)] +#[allow(clippy::unknown_clippy_lints)] +// Clippy false positive: https://github.com/rust-lang/rust-clippy/issues/8867 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct IoVec(pub(crate) libc::iovec, PhantomData); + +#[allow(deprecated)] +impl IoVec { + /// View the `IoVec` as a Rust slice. + #[deprecated( + since = "0.24.0", + note = "Use the `Deref` impl of `IoSlice` or `IoSliceMut` instead" + )] + #[inline] + pub fn as_slice(&self) -> &[u8] { + use std::slice; + + unsafe { + slice::from_raw_parts( + self.0.iov_base as *const u8, + self.0.iov_len as usize) + } + } +} + +#[allow(deprecated)] +impl<'a> IoVec<&'a [u8]> { + /// Create an `IoVec` from a Rust slice. + #[deprecated( + since = "0.24.0", + note = "Use `IoSlice::new` instead" + )] + pub fn from_slice(buf: &'a [u8]) -> IoVec<&'a [u8]> { + IoVec(libc::iovec { + iov_base: buf.as_ptr() as *mut c_void, + iov_len: buf.len() as size_t, + }, PhantomData) + } +} + +#[allow(deprecated)] +impl<'a> IoVec<&'a mut [u8]> { + /// Create an `IoVec` from a mutable Rust slice. + #[deprecated( + since = "0.24.0", + note = "Use `IoSliceMut::new` instead" + )] + pub fn from_mut_slice(buf: &'a mut [u8]) -> IoVec<&'a mut [u8]> { + IoVec(libc::iovec { + iov_base: buf.as_ptr() as *mut c_void, + iov_len: buf.len() as size_t, + }, PhantomData) + } +} + +// The only reason IoVec isn't automatically Send+Sync is because libc::iovec +// contains raw pointers. +#[allow(deprecated)] +unsafe impl Send for IoVec where T: Send {} +#[allow(deprecated)] +unsafe impl Sync for IoVec where T: Sync {} + +feature! { +#![feature = "process"] + +/// Write data directly to another process's virtual memory +/// (see [`process_vm_writev`(2)]). +/// +/// `local_iov` is a list of [`IoSlice`]s containing the data to be written, +/// and `remote_iov` is a list of [`RemoteIoVec`]s identifying where the +/// data should be written in the target process. On success, returns the +/// number of bytes written, which will always be a whole +/// number of `remote_iov` chunks. +/// +/// This requires the same permissions as debugging the process using +/// [ptrace]: you must either be a privileged process (with +/// `CAP_SYS_PTRACE`), or you must be running as the same user as the +/// target process and the OS must have unprivileged debugging enabled. +/// +/// This function is only available on Linux and Android(SDK23+). +/// +/// [`process_vm_writev`(2)]: https://man7.org/linux/man-pages/man2/process_vm_writev.2.html +/// [ptrace]: ../ptrace/index.html +/// [`IoSlice`]: https://doc.rust-lang.org/std/io/struct.IoSlice.html +/// [`RemoteIoVec`]: struct.RemoteIoVec.html +#[cfg(all(any(target_os = "linux", target_os = "android"), not(target_env = "uclibc")))] +pub fn process_vm_writev( + pid: crate::unistd::Pid, + local_iov: &[IoSlice<'_>], + remote_iov: &[RemoteIoVec]) -> Result +{ + let res = unsafe { + libc::process_vm_writev(pid.into(), + local_iov.as_ptr() as *const libc::iovec, local_iov.len() as libc::c_ulong, + remote_iov.as_ptr() as *const libc::iovec, remote_iov.len() as libc::c_ulong, 0) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Read data directly from another process's virtual memory +/// (see [`process_vm_readv`(2)]). +/// +/// `local_iov` is a list of [`IoSliceMut`]s containing the buffer to copy +/// data into, and `remote_iov` is a list of [`RemoteIoVec`]s identifying +/// where the source data is in the target process. On success, +/// returns the number of bytes written, which will always be a whole +/// number of `remote_iov` chunks. +/// +/// This requires the same permissions as debugging the process using +/// [`ptrace`]: you must either be a privileged process (with +/// `CAP_SYS_PTRACE`), or you must be running as the same user as the +/// target process and the OS must have unprivileged debugging enabled. +/// +/// This function is only available on Linux and Android(SDK23+). +/// +/// [`process_vm_readv`(2)]: https://man7.org/linux/man-pages/man2/process_vm_readv.2.html +/// [`ptrace`]: ../ptrace/index.html +/// [`IoSliceMut`]: https://doc.rust-lang.org/std/io/struct.IoSliceMut.html +/// [`RemoteIoVec`]: struct.RemoteIoVec.html +#[cfg(all(any(target_os = "linux", target_os = "android"), not(target_env = "uclibc")))] +pub fn process_vm_readv( + pid: crate::unistd::Pid, + local_iov: &mut [IoSliceMut<'_>], + remote_iov: &[RemoteIoVec]) -> Result +{ + let res = unsafe { + libc::process_vm_readv(pid.into(), + local_iov.as_ptr() as *const libc::iovec, local_iov.len() as libc::c_ulong, + remote_iov.as_ptr() as *const libc::iovec, remote_iov.len() as libc::c_ulong, 0) + }; + + Errno::result(res).map(|r| r as usize) +} +} diff --git a/bash-5.1/vendor/nix/src/sys/utsname.rs b/bash-5.1/vendor/nix/src/sys/utsname.rs new file mode 100644 index 0000000000000000000000000000000000000000..5bd3a539aed3bf482e065ed458d9c9c3e8f53f00 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/utsname.rs @@ -0,0 +1,77 @@ +//! Get system identification +use std::mem; +use std::os::unix::ffi::OsStrExt; +use std::ffi::OsStr; +use libc::c_char; +use crate::{Errno, Result}; + +/// Describes the running system. Return type of [`uname`]. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(transparent)] +pub struct UtsName(libc::utsname); + +impl UtsName { + /// Name of the operating system implementation. + pub fn sysname(&self) -> &OsStr { + cast_and_trim(&self.0.sysname) + } + + /// Network name of this machine. + pub fn nodename(&self) -> &OsStr { + cast_and_trim(&self.0.nodename) + } + + /// Release level of the operating system. + pub fn release(&self) -> &OsStr { + cast_and_trim(&self.0.release) + } + + /// Version level of the operating system. + pub fn version(&self) -> &OsStr { + cast_and_trim(&self.0.version) + } + + /// Machine hardware platform. + pub fn machine(&self) -> &OsStr { + cast_and_trim(&self.0.machine) + } +} + +/// Get system identification +pub fn uname() -> Result { + unsafe { + let mut ret = mem::MaybeUninit::zeroed(); + Errno::result(libc::uname(ret.as_mut_ptr()))?; + Ok(UtsName(ret.assume_init())) + } +} + +fn cast_and_trim(slice: &[c_char]) -> &OsStr { + let length = slice.iter().position(|&byte| byte == 0).unwrap_or(slice.len()); + let bytes = unsafe { + std::slice::from_raw_parts(slice.as_ptr().cast(), length) + }; + + OsStr::from_bytes(bytes) +} + +#[cfg(test)] +mod test { + #[cfg(target_os = "linux")] + #[test] + pub fn test_uname_linux() { + assert_eq!(super::uname().unwrap().sysname(), "Linux"); + } + + #[cfg(any(target_os = "macos", target_os = "ios"))] + #[test] + pub fn test_uname_darwin() { + assert_eq!(super::uname().unwrap().sysname(), "Darwin"); + } + + #[cfg(target_os = "freebsd")] + #[test] + pub fn test_uname_freebsd() { + assert_eq!(super::uname().unwrap().sysname(), "FreeBSD"); + } +} diff --git a/bash-5.1/vendor/nix/src/sys/wait.rs b/bash-5.1/vendor/nix/src/sys/wait.rs new file mode 100644 index 0000000000000000000000000000000000000000..5fb2075fd9573c91be5c407644aa17d46b655584 --- /dev/null +++ b/bash-5.1/vendor/nix/src/sys/wait.rs @@ -0,0 +1,381 @@ +//! Wait for a process to change status +use crate::errno::Errno; +use crate::sys::signal::Signal; +use crate::unistd::Pid; +use crate::Result; +use cfg_if::cfg_if; +use libc::{self, c_int}; +use std::convert::TryFrom; +#[cfg(any( + target_os = "android", + all(target_os = "linux", not(target_env = "uclibc")), +))] +use std::os::unix::io::RawFd; + +libc_bitflags!( + /// Controls the behavior of [`waitpid`]. + pub struct WaitPidFlag: c_int { + /// Do not block when there are no processes wishing to report status. + WNOHANG; + /// Report the status of selected processes which are stopped due to a + /// [`SIGTTIN`](crate::sys::signal::Signal::SIGTTIN), + /// [`SIGTTOU`](crate::sys::signal::Signal::SIGTTOU), + /// [`SIGTSTP`](crate::sys::signal::Signal::SIGTSTP), or + /// [`SIGSTOP`](crate::sys::signal::Signal::SIGSTOP) signal. + WUNTRACED; + /// Report the status of selected processes which have terminated. + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + WEXITED; + /// Report the status of selected processes that have continued from a + /// job control stop by receiving a + /// [`SIGCONT`](crate::sys::signal::Signal::SIGCONT) signal. + WCONTINUED; + /// An alias for WUNTRACED. + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + WSTOPPED; + /// Don't reap, just poll status. + #[cfg(any(target_os = "android", + target_os = "freebsd", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "redox", + target_os = "macos", + target_os = "netbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + WNOWAIT; + /// Don't wait on children of other threads in this group + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + __WNOTHREAD; + /// Wait on all children, regardless of type + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + __WALL; + /// Wait for "clone" children only. + #[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + __WCLONE; + } +); + +/// Possible return values from `wait()` or `waitpid()`. +/// +/// Each status (other than `StillAlive`) describes a state transition +/// in a child process `Pid`, such as the process exiting or stopping, +/// plus additional data about the transition if any. +/// +/// Note that there are two Linux-specific enum variants, `PtraceEvent` +/// and `PtraceSyscall`. Portable code should avoid exhaustively +/// matching on `WaitStatus`. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub enum WaitStatus { + /// The process exited normally (as with `exit()` or returning from + /// `main`) with the given exit code. This case matches the C macro + /// `WIFEXITED(status)`; the second field is `WEXITSTATUS(status)`. + Exited(Pid, i32), + /// The process was killed by the given signal. The third field + /// indicates whether the signal generated a core dump. This case + /// matches the C macro `WIFSIGNALED(status)`; the last two fields + /// correspond to `WTERMSIG(status)` and `WCOREDUMP(status)`. + Signaled(Pid, Signal, bool), + /// The process is alive, but was stopped by the given signal. This + /// is only reported if `WaitPidFlag::WUNTRACED` was passed. This + /// case matches the C macro `WIFSTOPPED(status)`; the second field + /// is `WSTOPSIG(status)`. + Stopped(Pid, Signal), + /// The traced process was stopped by a `PTRACE_EVENT_*` event. See + /// [`nix::sys::ptrace`] and [`ptrace`(2)] for more information. All + /// currently-defined events use `SIGTRAP` as the signal; the third + /// field is the `PTRACE_EVENT_*` value of the event. + /// + /// [`nix::sys::ptrace`]: ../ptrace/index.html + /// [`ptrace`(2)]: https://man7.org/linux/man-pages/man2/ptrace.2.html + #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PtraceEvent(Pid, Signal, c_int), + /// The traced process was stopped by execution of a system call, + /// and `PTRACE_O_TRACESYSGOOD` is in effect. See [`ptrace`(2)] for + /// more information. + /// + /// [`ptrace`(2)]: https://man7.org/linux/man-pages/man2/ptrace.2.html + #[cfg(any(target_os = "linux", target_os = "android"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PtraceSyscall(Pid), + /// The process was previously stopped but has resumed execution + /// after receiving a `SIGCONT` signal. This is only reported if + /// `WaitPidFlag::WCONTINUED` was passed. This case matches the C + /// macro `WIFCONTINUED(status)`. + Continued(Pid), + /// There are currently no state changes to report in any awaited + /// child process. This is only returned if `WaitPidFlag::WNOHANG` + /// was used (otherwise `wait()` or `waitpid()` would block until + /// there was something to report). + StillAlive, +} + +impl WaitStatus { + /// Extracts the PID from the WaitStatus unless it equals StillAlive. + pub fn pid(&self) -> Option { + use self::WaitStatus::*; + match *self { + Exited(p, _) | Signaled(p, _, _) | Stopped(p, _) | Continued(p) => Some(p), + StillAlive => None, + #[cfg(any(target_os = "android", target_os = "linux"))] + PtraceEvent(p, _, _) | PtraceSyscall(p) => Some(p), + } + } +} + +fn exited(status: i32) -> bool { + libc::WIFEXITED(status) +} + +fn exit_status(status: i32) -> i32 { + libc::WEXITSTATUS(status) +} + +fn signaled(status: i32) -> bool { + libc::WIFSIGNALED(status) +} + +fn term_signal(status: i32) -> Result { + Signal::try_from(libc::WTERMSIG(status)) +} + +fn dumped_core(status: i32) -> bool { + libc::WCOREDUMP(status) +} + +fn stopped(status: i32) -> bool { + libc::WIFSTOPPED(status) +} + +fn stop_signal(status: i32) -> Result { + Signal::try_from(libc::WSTOPSIG(status)) +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn syscall_stop(status: i32) -> bool { + // From ptrace(2), setting PTRACE_O_TRACESYSGOOD has the effect + // of delivering SIGTRAP | 0x80 as the signal number for syscall + // stops. This allows easily distinguishing syscall stops from + // genuine SIGTRAP signals. + libc::WSTOPSIG(status) == libc::SIGTRAP | 0x80 +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn stop_additional(status: i32) -> c_int { + (status >> 16) as c_int +} + +fn continued(status: i32) -> bool { + libc::WIFCONTINUED(status) +} + +impl WaitStatus { + /// Convert a raw `wstatus` as returned by `waitpid`/`wait` into a `WaitStatus` + /// + /// # Errors + /// + /// Returns an `Error` corresponding to `EINVAL` for invalid status values. + /// + /// # Examples + /// + /// Convert a `wstatus` obtained from `libc::waitpid` into a `WaitStatus`: + /// + /// ``` + /// use nix::sys::wait::WaitStatus; + /// use nix::sys::signal::Signal; + /// let pid = nix::unistd::Pid::from_raw(1); + /// let status = WaitStatus::from_raw(pid, 0x0002); + /// assert_eq!(status, Ok(WaitStatus::Signaled(pid, Signal::SIGINT, false))); + /// ``` + pub fn from_raw(pid: Pid, status: i32) -> Result { + Ok(if exited(status) { + WaitStatus::Exited(pid, exit_status(status)) + } else if signaled(status) { + WaitStatus::Signaled(pid, term_signal(status)?, dumped_core(status)) + } else if stopped(status) { + cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + fn decode_stopped(pid: Pid, status: i32) -> Result { + let status_additional = stop_additional(status); + Ok(if syscall_stop(status) { + WaitStatus::PtraceSyscall(pid) + } else if status_additional == 0 { + WaitStatus::Stopped(pid, stop_signal(status)?) + } else { + WaitStatus::PtraceEvent(pid, stop_signal(status)?, + stop_additional(status)) + }) + } + } else { + fn decode_stopped(pid: Pid, status: i32) -> Result { + Ok(WaitStatus::Stopped(pid, stop_signal(status)?)) + } + } + } + return decode_stopped(pid, status); + } else { + assert!(continued(status)); + WaitStatus::Continued(pid) + }) + } + + /// Convert a `siginfo_t` as returned by `waitid` to a `WaitStatus` + /// + /// # Errors + /// + /// Returns an `Error` corresponding to `EINVAL` for invalid values. + /// + /// # Safety + /// + /// siginfo_t is actually a union, not all fields may be initialized. + /// The functions si_pid() and si_status() must be valid to call on + /// the passed siginfo_t. + #[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), + ))] + unsafe fn from_siginfo(siginfo: &libc::siginfo_t) -> Result { + let si_pid = siginfo.si_pid(); + if si_pid == 0 { + return Ok(WaitStatus::StillAlive); + } + + assert_eq!(siginfo.si_signo, libc::SIGCHLD); + + let pid = Pid::from_raw(si_pid); + let si_status = siginfo.si_status(); + + let status = match siginfo.si_code { + libc::CLD_EXITED => WaitStatus::Exited(pid, si_status), + libc::CLD_KILLED | libc::CLD_DUMPED => WaitStatus::Signaled( + pid, + Signal::try_from(si_status)?, + siginfo.si_code == libc::CLD_DUMPED, + ), + libc::CLD_STOPPED => WaitStatus::Stopped(pid, Signal::try_from(si_status)?), + libc::CLD_CONTINUED => WaitStatus::Continued(pid), + #[cfg(any(target_os = "android", target_os = "linux"))] + libc::CLD_TRAPPED => { + if si_status == libc::SIGTRAP | 0x80 { + WaitStatus::PtraceSyscall(pid) + } else { + WaitStatus::PtraceEvent( + pid, + Signal::try_from(si_status & 0xff)?, + (si_status >> 8) as c_int, + ) + } + } + _ => return Err(Errno::EINVAL), + }; + + Ok(status) + } +} + +/// Wait for a process to change status +/// +/// See also [waitpid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/waitpid.html) +pub fn waitpid>>(pid: P, options: Option) -> Result { + use self::WaitStatus::*; + + let mut status: i32 = 0; + + let option_bits = match options { + Some(bits) => bits.bits(), + None => 0, + }; + + let res = unsafe { + libc::waitpid( + pid.into().unwrap_or_else(|| Pid::from_raw(-1)).into(), + &mut status as *mut c_int, + option_bits, + ) + }; + + match Errno::result(res)? { + 0 => Ok(StillAlive), + res => WaitStatus::from_raw(Pid::from_raw(res), status), + } +} + +/// Wait for any child process to change status or a signal is received. +/// +/// See also [wait(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/wait.html) +pub fn wait() -> Result { + waitpid(None, None) +} + +/// The ID argument for `waitid` +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), +))] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub enum Id { + /// Wait for any child + All, + /// Wait for the child whose process ID matches the given PID + Pid(Pid), + /// Wait for the child whose process group ID matches the given PID + /// + /// If the PID is zero, the caller's process group is used since Linux 5.4. + PGid(Pid), + /// Wait for the child referred to by the given PID file descriptor + #[cfg(any(target_os = "android", target_os = "linux"))] + PIDFd(RawFd), +} + +/// Wait for a process to change status +/// +/// See also [waitid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/waitid.html) +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), +))] +pub fn waitid(id: Id, flags: WaitPidFlag) -> Result { + let (idtype, idval) = match id { + Id::All => (libc::P_ALL, 0), + Id::Pid(pid) => (libc::P_PID, pid.as_raw() as libc::id_t), + Id::PGid(pid) => (libc::P_PGID, pid.as_raw() as libc::id_t), + #[cfg(any(target_os = "android", target_os = "linux"))] + Id::PIDFd(fd) => (libc::P_PIDFD, fd as libc::id_t), + }; + + let siginfo = unsafe { + // Memory is zeroed rather than uninitialized, as not all platforms + // initialize the memory in the StillAlive case + let mut siginfo: libc::siginfo_t = std::mem::zeroed(); + Errno::result(libc::waitid(idtype, idval, &mut siginfo, flags.bits()))?; + siginfo + }; + + unsafe { WaitStatus::from_siginfo(&siginfo) } +} diff --git a/bash-5.1/vendor/nix/src/time.rs b/bash-5.1/vendor/nix/src/time.rs new file mode 100644 index 0000000000000000000000000000000000000000..6a385b90bdc8f490c2fa366980660c82cc6059f5 --- /dev/null +++ b/bash-5.1/vendor/nix/src/time.rs @@ -0,0 +1,269 @@ +use crate::sys::time::TimeSpec; +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +#[cfg(feature = "process")] +use crate::unistd::Pid; +use crate::{Errno, Result}; +use libc::{self, clockid_t}; +use std::mem::MaybeUninit; + +/// Clock identifier +/// +/// Newtype pattern around `clockid_t` (which is just alias). It prevents bugs caused by +/// accidentally passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] +pub struct ClockId(clockid_t); + +impl ClockId { + /// Creates `ClockId` from raw `clockid_t` + pub const fn from_raw(clk_id: clockid_t) -> Self { + ClockId(clk_id) + } + + feature! { + #![feature = "process"] + /// Returns `ClockId` of a `pid` CPU-time clock + #[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn pid_cpu_clock_id(pid: Pid) -> Result { + clock_getcpuclockid(pid) + } + } + + /// Returns resolution of the clock id + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn res(self) -> Result { + clock_getres(self) + } + + /// Returns the current time on the clock id + pub fn now(self) -> Result { + clock_gettime(self) + } + + /// Sets time to `timespec` on the clock id + #[cfg(not(any( + target_os = "macos", + target_os = "ios", + target_os = "redox", + target_os = "hermit", + )))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub fn set_time(self, timespec: TimeSpec) -> Result<()> { + clock_settime(self, timespec) + } + + /// Gets the raw `clockid_t` wrapped by `self` + pub const fn as_raw(self) -> clockid_t { + self.0 + } + + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_BOOTTIME: ClockId = ClockId(libc::CLOCK_BOOTTIME); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_BOOTTIME_ALARM: ClockId = ClockId(libc::CLOCK_BOOTTIME_ALARM); + pub const CLOCK_MONOTONIC: ClockId = ClockId(libc::CLOCK_MONOTONIC); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_MONOTONIC_COARSE: ClockId = ClockId(libc::CLOCK_MONOTONIC_COARSE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_MONOTONIC_FAST: ClockId = ClockId(libc::CLOCK_MONOTONIC_FAST); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_MONOTONIC_PRECISE: ClockId = ClockId(libc::CLOCK_MONOTONIC_PRECISE); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_MONOTONIC_RAW: ClockId = ClockId(libc::CLOCK_MONOTONIC_RAW); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "redox", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_PROCESS_CPUTIME_ID: ClockId = ClockId(libc::CLOCK_PROCESS_CPUTIME_ID); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_PROF: ClockId = ClockId(libc::CLOCK_PROF); + pub const CLOCK_REALTIME: ClockId = ClockId(libc::CLOCK_REALTIME); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_REALTIME_ALARM: ClockId = ClockId(libc::CLOCK_REALTIME_ALARM); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_REALTIME_COARSE: ClockId = ClockId(libc::CLOCK_REALTIME_COARSE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_REALTIME_FAST: ClockId = ClockId(libc::CLOCK_REALTIME_FAST); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_REALTIME_PRECISE: ClockId = ClockId(libc::CLOCK_REALTIME_PRECISE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_SECOND: ClockId = ClockId(libc::CLOCK_SECOND); + #[cfg(any( + target_os = "emscripten", + target_os = "fuchsia", + all(target_os = "linux", target_env = "musl") + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_SGI_CYCLE: ClockId = ClockId(libc::CLOCK_SGI_CYCLE); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_TAI: ClockId = ClockId(libc::CLOCK_TAI); + #[cfg(any( + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux" + ))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_THREAD_CPUTIME_ID: ClockId = ClockId(libc::CLOCK_THREAD_CPUTIME_ID); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_UPTIME: ClockId = ClockId(libc::CLOCK_UPTIME); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_UPTIME_FAST: ClockId = ClockId(libc::CLOCK_UPTIME_FAST); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_UPTIME_PRECISE: ClockId = ClockId(libc::CLOCK_UPTIME_PRECISE); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub const CLOCK_VIRTUAL: ClockId = ClockId(libc::CLOCK_VIRTUAL); +} + +impl From for clockid_t { + fn from(clock_id: ClockId) -> Self { + clock_id.as_raw() + } +} + +impl From for ClockId { + fn from(clk_id: clockid_t) -> Self { + ClockId::from_raw(clk_id) + } +} + +impl std::fmt::Display for ClockId { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + std::fmt::Display::fmt(&self.0, f) + } +} + +/// Get the resolution of the specified clock, (see +/// [clock_getres(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_getres.html)). +#[cfg(not(target_os = "redox"))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn clock_getres(clock_id: ClockId) -> Result { + let mut c_time: MaybeUninit = MaybeUninit::uninit(); + let ret = unsafe { libc::clock_getres(clock_id.as_raw(), c_time.as_mut_ptr()) }; + Errno::result(ret)?; + let res = unsafe { c_time.assume_init() }; + Ok(TimeSpec::from(res)) +} + +/// Get the time of the specified clock, (see +/// [clock_gettime(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_gettime.html)). +pub fn clock_gettime(clock_id: ClockId) -> Result { + let mut c_time: MaybeUninit = MaybeUninit::uninit(); + let ret = unsafe { libc::clock_gettime(clock_id.as_raw(), c_time.as_mut_ptr()) }; + Errno::result(ret)?; + let res = unsafe { c_time.assume_init() }; + Ok(TimeSpec::from(res)) +} + +/// Set the time of the specified clock, (see +/// [clock_settime(2)](https://pubs.opengroup.org/onlinepubs/7908799/xsh/clock_settime.html)). +#[cfg(not(any( + target_os = "macos", + target_os = "ios", + target_os = "redox", + target_os = "hermit", +)))] +#[cfg_attr(docsrs, doc(cfg(all())))] +pub fn clock_settime(clock_id: ClockId, timespec: TimeSpec) -> Result<()> { + let ret = unsafe { libc::clock_settime(clock_id.as_raw(), timespec.as_ref()) }; + Errno::result(ret).map(drop) +} + +/// Get the clock id of the specified process id, (see +/// [clock_getcpuclockid(3)](https://pubs.opengroup.org/onlinepubs/009695399/functions/clock_getcpuclockid.html)). +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +#[cfg(feature = "process")] +#[cfg_attr(docsrs, doc(cfg(feature = "process")))] +pub fn clock_getcpuclockid(pid: Pid) -> Result { + let mut clk_id: MaybeUninit = MaybeUninit::uninit(); + let ret = unsafe { libc::clock_getcpuclockid(pid.into(), clk_id.as_mut_ptr()) }; + if ret == 0 { + let res = unsafe { clk_id.assume_init() }; + Ok(ClockId::from(res)) + } else { + Err(Errno::from_i32(ret)) + } +} diff --git a/bash-5.1/vendor/nix/src/ucontext.rs b/bash-5.1/vendor/nix/src/ucontext.rs new file mode 100644 index 0000000000000000000000000000000000000000..f2338bd426ac2f731040439c4de36cbc5fdc934f --- /dev/null +++ b/bash-5.1/vendor/nix/src/ucontext.rs @@ -0,0 +1,43 @@ +#[cfg(not(target_env = "musl"))] +use crate::Result; +#[cfg(not(target_env = "musl"))] +use crate::errno::Errno; +#[cfg(not(target_env = "musl"))] +use std::mem; +use crate::sys::signal::SigSet; + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct UContext { + context: libc::ucontext_t, +} + +impl UContext { + #[cfg(not(target_env = "musl"))] + pub fn get() -> Result { + let mut context = mem::MaybeUninit::::uninit(); + let res = unsafe { libc::getcontext(context.as_mut_ptr()) }; + Errno::result(res).map(|_| unsafe { + UContext { context: context.assume_init()} + }) + } + + #[cfg(not(target_env = "musl"))] + pub fn set(&self) -> Result<()> { + let res = unsafe { + libc::setcontext(&self.context as *const libc::ucontext_t) + }; + Errno::result(res).map(drop) + } + + pub fn sigmask_mut(&mut self) -> &mut SigSet { + unsafe { + &mut *(&mut self.context.uc_sigmask as *mut libc::sigset_t as *mut SigSet) + } + } + + pub fn sigmask(&self) -> &SigSet { + unsafe { + &*(&self.context.uc_sigmask as *const libc::sigset_t as *const SigSet) + } + } +} diff --git a/bash-5.1/vendor/nix/src/unistd.rs b/bash-5.1/vendor/nix/src/unistd.rs new file mode 100644 index 0000000000000000000000000000000000000000..42e1456aabe7336f06c6974e204b3ba18b69251c --- /dev/null +++ b/bash-5.1/vendor/nix/src/unistd.rs @@ -0,0 +1,3346 @@ +//! Safe wrappers around functions found in libc "unistd.h" header + +use crate::errno::{self, Errno}; +#[cfg(not(target_os = "redox"))] +#[cfg(feature = "fs")] +use crate::fcntl::{at_rawfd, AtFlags}; +#[cfg(feature = "fs")] +use crate::fcntl::{fcntl, FcntlArg::F_SETFD, FdFlag, OFlag}; +#[cfg(all( + feature = "fs", + any( + target_os = "openbsd", + target_os = "netbsd", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "macos", + target_os = "ios" + ) +))] +use crate::sys::stat::FileFlag; +#[cfg(feature = "fs")] +use crate::sys::stat::Mode; +use crate::{Error, NixPath, Result}; +#[cfg(not(target_os = "redox"))] +use cfg_if::cfg_if; +use libc::{ + self, c_char, c_int, c_long, c_uint, c_void, gid_t, mode_t, off_t, pid_t, + size_t, uid_t, PATH_MAX, +}; +use std::convert::Infallible; +use std::ffi::{CStr, OsString}; +#[cfg(not(target_os = "redox"))] +use std::ffi::{CString, OsStr}; +#[cfg(not(target_os = "redox"))] +use std::os::unix::ffi::OsStrExt; +use std::os::unix::ffi::OsStringExt; +use std::os::unix::io::RawFd; +use std::path::PathBuf; +use std::{fmt, mem, ptr}; + +feature! { + #![feature = "fs"] + #[cfg(any(target_os = "android", target_os = "linux"))] + pub use self::pivot_root::*; +} + +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd" +))] +pub use self::setres::*; + +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd" +))] +pub use self::getres::*; + +feature! { +#![feature = "user"] + +/// User identifier +/// +/// Newtype pattern around `uid_t` (which is just alias). It prevents bugs caused by accidentally +/// passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub struct Uid(uid_t); + +impl Uid { + /// Creates `Uid` from raw `uid_t`. + pub const fn from_raw(uid: uid_t) -> Self { + Uid(uid) + } + + /// Returns Uid of calling process. This is practically a more Rusty alias for `getuid`. + #[cfg_attr(has_doc_alias, doc(alias("getuid")))] + pub fn current() -> Self { + getuid() + } + + /// Returns effective Uid of calling process. This is practically a more Rusty alias for `geteuid`. + #[cfg_attr(has_doc_alias, doc(alias("geteuid")))] + pub fn effective() -> Self { + geteuid() + } + + /// Returns true if the `Uid` represents privileged user - root. (If it equals zero.) + pub const fn is_root(self) -> bool { + self.0 == ROOT.0 + } + + /// Get the raw `uid_t` wrapped by `self`. + pub const fn as_raw(self) -> uid_t { + self.0 + } +} + +impl From for uid_t { + fn from(uid: Uid) -> Self { + uid.0 + } +} + +impl From for Uid { + fn from(uid: uid_t) -> Self { + Uid(uid) + } +} + +impl fmt::Display for Uid { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.0, f) + } +} + +/// Constant for UID = 0 +pub const ROOT: Uid = Uid(0); + +/// Group identifier +/// +/// Newtype pattern around `gid_t` (which is just alias). It prevents bugs caused by accidentally +/// passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub struct Gid(gid_t); + +impl Gid { + /// Creates `Gid` from raw `gid_t`. + pub const fn from_raw(gid: gid_t) -> Self { + Gid(gid) + } + + /// Returns Gid of calling process. This is practically a more Rusty alias for `getgid`. + #[cfg_attr(has_doc_alias, doc(alias("getgid")))] + pub fn current() -> Self { + getgid() + } + + /// Returns effective Gid of calling process. This is practically a more Rusty alias for `getegid`. + #[cfg_attr(has_doc_alias, doc(alias("getegid")))] + pub fn effective() -> Self { + getegid() + } + + /// Get the raw `gid_t` wrapped by `self`. + pub const fn as_raw(self) -> gid_t { + self.0 + } +} + +impl From for gid_t { + fn from(gid: Gid) -> Self { + gid.0 + } +} + +impl From for Gid { + fn from(gid: gid_t) -> Self { + Gid(gid) + } +} + +impl fmt::Display for Gid { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.0, f) + } +} +} + +feature! { +#![feature = "process"] +/// Process identifier +/// +/// Newtype pattern around `pid_t` (which is just alias). It prevents bugs caused by accidentally +/// passing wrong value. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] +pub struct Pid(pid_t); + +impl Pid { + /// Creates `Pid` from raw `pid_t`. + pub const fn from_raw(pid: pid_t) -> Self { + Pid(pid) + } + + /// Returns PID of calling process + #[cfg_attr(has_doc_alias, doc(alias("getpid")))] + pub fn this() -> Self { + getpid() + } + + /// Returns PID of parent of calling process + #[cfg_attr(has_doc_alias, doc(alias("getppid")))] + pub fn parent() -> Self { + getppid() + } + + /// Get the raw `pid_t` wrapped by `self`. + pub const fn as_raw(self) -> pid_t { + self.0 + } +} + +impl From for pid_t { + fn from(pid: Pid) -> Self { + pid.0 + } +} + +impl fmt::Display for Pid { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.0, f) + } +} + + +/// Represents the successful result of calling `fork` +/// +/// When `fork` is called, the process continues execution in the parent process +/// and in the new child. This return type can be examined to determine whether +/// you are now executing in the parent process or in the child. +#[derive(Clone, Copy, Debug)] +pub enum ForkResult { + Parent { child: Pid }, + Child, +} + +impl ForkResult { + + /// Return `true` if this is the child process of the `fork()` + #[inline] + pub fn is_child(self) -> bool { + matches!(self, ForkResult::Child) + } + + /// Returns `true` if this is the parent process of the `fork()` + #[inline] + pub fn is_parent(self) -> bool { + !self.is_child() + } +} + +/// Create a new child process duplicating the parent process ([see +/// fork(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html)). +/// +/// After successfully calling the fork system call, a second process will +/// be created which is identical to the original except for the pid and the +/// return value of this function. As an example: +/// +/// ``` +/// use nix::{sys::wait::waitpid,unistd::{fork, ForkResult, write}}; +/// +/// match unsafe{fork()} { +/// Ok(ForkResult::Parent { child, .. }) => { +/// println!("Continuing execution in parent process, new child has pid: {}", child); +/// waitpid(child, None).unwrap(); +/// } +/// Ok(ForkResult::Child) => { +/// // Unsafe to use `println!` (or `unwrap`) here. See Safety. +/// write(libc::STDOUT_FILENO, "I'm a new child process\n".as_bytes()).ok(); +/// unsafe { libc::_exit(0) }; +/// } +/// Err(_) => println!("Fork failed"), +/// } +/// ``` +/// +/// This will print something like the following (order nondeterministic). The +/// thing to note is that you end up with two processes continuing execution +/// immediately after the fork call but with different match arms. +/// +/// ```text +/// Continuing execution in parent process, new child has pid: 1234 +/// I'm a new child process +/// ``` +/// +/// # Safety +/// +/// In a multithreaded program, only [async-signal-safe] functions like `pause` +/// and `_exit` may be called by the child (the parent isn't restricted). Note +/// that memory allocation may **not** be async-signal-safe and thus must be +/// prevented. +/// +/// Those functions are only a small subset of your operating system's API, so +/// special care must be taken to only invoke code you can control and audit. +/// +/// [async-signal-safe]: https://man7.org/linux/man-pages/man7/signal-safety.7.html +#[inline] +pub unsafe fn fork() -> Result { + use self::ForkResult::*; + let res = libc::fork(); + + Errno::result(res).map(|res| match res { + 0 => Child, + res => Parent { child: Pid(res) }, + }) +} + +/// Get the pid of this process (see +/// [getpid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpid.html)). +/// +/// Since you are running code, there is always a pid to return, so there +/// is no error case that needs to be handled. +#[inline] +pub fn getpid() -> Pid { + Pid(unsafe { libc::getpid() }) +} + +/// Get the pid of this processes' parent (see +/// [getpid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getppid.html)). +/// +/// There is always a parent pid to return, so there is no error case that needs +/// to be handled. +#[inline] +pub fn getppid() -> Pid { + Pid(unsafe { libc::getppid() }) // no error handling, according to man page: "These functions are always successful." +} + +/// Set a process group ID (see +/// [setpgid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setpgid.html)). +/// +/// Set the process group id (PGID) of a particular process. If a pid of zero +/// is specified, then the pid of the calling process is used. Process groups +/// may be used to group together a set of processes in order for the OS to +/// apply some operations across the group. +/// +/// `setsid()` may be used to create a new process group. +#[inline] +pub fn setpgid(pid: Pid, pgid: Pid) -> Result<()> { + let res = unsafe { libc::setpgid(pid.into(), pgid.into()) }; + Errno::result(res).map(drop) +} +#[inline] +pub fn getpgid(pid: Option) -> Result { + let res = unsafe { libc::getpgid(pid.unwrap_or(Pid(0)).into()) }; + Errno::result(res).map(Pid) +} + +/// Create new session and set process group id (see +/// [setsid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setsid.html)). +#[inline] +pub fn setsid() -> Result { + Errno::result(unsafe { libc::setsid() }).map(Pid) +} + +/// Get the process group ID of a session leader +/// [getsid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsid.html). +/// +/// Obtain the process group ID of the process that is the session leader of the process specified +/// by pid. If pid is zero, it specifies the calling process. +#[inline] +#[cfg(not(target_os = "redox"))] +pub fn getsid(pid: Option) -> Result { + let res = unsafe { libc::getsid(pid.unwrap_or(Pid(0)).into()) }; + Errno::result(res).map(Pid) +} +} + +feature! { +#![all(feature = "process", feature = "term")] +/// Get the terminal foreground process group (see +/// [tcgetpgrp(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetpgrp.html)). +/// +/// Get the group process id (GPID) of the foreground process group on the +/// terminal associated to file descriptor (FD). +#[inline] +pub fn tcgetpgrp(fd: c_int) -> Result { + let res = unsafe { libc::tcgetpgrp(fd) }; + Errno::result(res).map(Pid) +} +/// Set the terminal foreground process group (see +/// [tcgetpgrp(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/tcsetpgrp.html)). +/// +/// Get the group process id (PGID) to the foreground process group on the +/// terminal associated to file descriptor (FD). +#[inline] +pub fn tcsetpgrp(fd: c_int, pgrp: Pid) -> Result<()> { + let res = unsafe { libc::tcsetpgrp(fd, pgrp.into()) }; + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "process"] +/// Get the group id of the calling process (see +///[getpgrp(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpgrp.html)). +/// +/// Get the process group id (PGID) of the calling process. +/// According to the man page it is always successful. +#[inline] +pub fn getpgrp() -> Pid { + Pid(unsafe { libc::getpgrp() }) +} + +/// Get the caller's thread ID (see +/// [gettid(2)](https://man7.org/linux/man-pages/man2/gettid.2.html). +/// +/// This function is only available on Linux based systems. In a single +/// threaded process, the main thread will have the same ID as the process. In +/// a multithreaded process, each thread will have a unique thread id but the +/// same process ID. +/// +/// No error handling is required as a thread id should always exist for any +/// process, even if threads are not being used. +#[cfg(any(target_os = "linux", target_os = "android"))] +#[inline] +pub fn gettid() -> Pid { + Pid(unsafe { libc::syscall(libc::SYS_gettid) as pid_t }) +} +} + +feature! { +#![feature = "fs"] +/// Create a copy of the specified file descriptor (see +/// [dup(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html)). +/// +/// The new file descriptor will be have a new index but refer to the same +/// resource as the old file descriptor and the old and new file descriptors may +/// be used interchangeably. The new and old file descriptor share the same +/// underlying resource, offset, and file status flags. The actual index used +/// for the file descriptor will be the lowest fd index that is available. +/// +/// The two file descriptors do not share file descriptor flags (e.g. `OFlag::FD_CLOEXEC`). +#[inline] +pub fn dup(oldfd: RawFd) -> Result { + let res = unsafe { libc::dup(oldfd) }; + + Errno::result(res) +} + +/// Create a copy of the specified file descriptor using the specified fd (see +/// [dup(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html)). +/// +/// This function behaves similar to `dup()` except that it will try to use the +/// specified fd instead of allocating a new one. See the man pages for more +/// detail on the exact behavior of this function. +#[inline] +pub fn dup2(oldfd: RawFd, newfd: RawFd) -> Result { + let res = unsafe { libc::dup2(oldfd, newfd) }; + + Errno::result(res) +} + +/// Create a new copy of the specified file descriptor using the specified fd +/// and flags (see [dup(2)](https://man7.org/linux/man-pages/man2/dup.2.html)). +/// +/// This function behaves similar to `dup2()` but allows for flags to be +/// specified. +pub fn dup3(oldfd: RawFd, newfd: RawFd, flags: OFlag) -> Result { + dup3_polyfill(oldfd, newfd, flags) +} + +#[inline] +fn dup3_polyfill(oldfd: RawFd, newfd: RawFd, flags: OFlag) -> Result { + if oldfd == newfd { + return Err(Errno::EINVAL); + } + + let fd = dup2(oldfd, newfd)?; + + if flags.contains(OFlag::O_CLOEXEC) { + if let Err(e) = fcntl(fd, F_SETFD(FdFlag::FD_CLOEXEC)) { + let _ = close(fd); + return Err(e); + } + } + + Ok(fd) +} + +/// Change the current working directory of the calling process (see +/// [chdir(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/chdir.html)). +/// +/// This function may fail in a number of different scenarios. See the man +/// pages for additional details on possible failure cases. +#[inline] +pub fn chdir(path: &P) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::chdir(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) +} + +/// Change the current working directory of the process to the one +/// given as an open file descriptor (see +/// [fchdir(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html)). +/// +/// This function may fail in a number of different scenarios. See the man +/// pages for additional details on possible failure cases. +#[inline] +#[cfg(not(target_os = "fuchsia"))] +pub fn fchdir(dirfd: RawFd) -> Result<()> { + let res = unsafe { libc::fchdir(dirfd) }; + + Errno::result(res).map(drop) +} + +/// Creates new directory `path` with access rights `mode`. (see [mkdir(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdir.html)) +/// +/// # Errors +/// +/// There are several situations where mkdir might fail: +/// +/// - current user has insufficient rights in the parent directory +/// - the path already exists +/// - the path name is too long (longer than `PATH_MAX`, usually 4096 on linux, 1024 on OS X) +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// use nix::sys::stat; +/// use tempfile::tempdir; +/// +/// let tmp_dir1 = tempdir().unwrap(); +/// let tmp_dir2 = tmp_dir1.path().join("new_dir"); +/// +/// // create new directory and give read, write and execute rights to the owner +/// match unistd::mkdir(&tmp_dir2, stat::Mode::S_IRWXU) { +/// Ok(_) => println!("created {:?}", tmp_dir2), +/// Err(err) => println!("Error creating directory: {}", err), +/// } +/// ``` +#[inline] +pub fn mkdir(path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::mkdir(cstr.as_ptr(), mode.bits() as mode_t) } + })?; + + Errno::result(res).map(drop) +} + +/// Creates new fifo special file (named pipe) with path `path` and access rights `mode`. +/// +/// # Errors +/// +/// There are several situations where mkfifo might fail: +/// +/// - current user has insufficient rights in the parent directory +/// - the path already exists +/// - the path name is too long (longer than `PATH_MAX`, usually 4096 on linux, 1024 on OS X) +/// +/// For a full list consult +/// [posix specification](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifo.html) +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// use nix::sys::stat; +/// use tempfile::tempdir; +/// +/// let tmp_dir = tempdir().unwrap(); +/// let fifo_path = tmp_dir.path().join("foo.pipe"); +/// +/// // create new fifo and give read, write and execute rights to the owner +/// match unistd::mkfifo(&fifo_path, stat::Mode::S_IRWXU) { +/// Ok(_) => println!("created {:?}", fifo_path), +/// Err(err) => println!("Error creating fifo: {}", err), +/// } +/// ``` +#[inline] +#[cfg(not(target_os = "redox"))] // RedoxFS does not support fifo yet +pub fn mkfifo(path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::mkfifo(cstr.as_ptr(), mode.bits() as mode_t) } + })?; + + Errno::result(res).map(drop) +} + +/// Creates new fifo special file (named pipe) with path `path` and access rights `mode`. +/// +/// If `dirfd` has a value, then `path` is relative to directory associated with the file descriptor. +/// +/// If `dirfd` is `None`, then `path` is relative to the current working directory. +/// +/// # References +/// +/// [mkfifoat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkfifoat.html). +// mkfifoat is not implemented in OSX or android +#[inline] +#[cfg(not(any( + target_os = "macos", target_os = "ios", target_os = "haiku", + target_os = "android", target_os = "redox")))] +pub fn mkfifoat(dirfd: Option, path: &P, mode: Mode) -> Result<()> { + let res = path.with_nix_path(|cstr| unsafe { + libc::mkfifoat(at_rawfd(dirfd), cstr.as_ptr(), mode.bits() as mode_t) + })?; + + Errno::result(res).map(drop) +} + +/// Creates a symbolic link at `path2` which points to `path1`. +/// +/// If `dirfd` has a value, then `path2` is relative to directory associated +/// with the file descriptor. +/// +/// If `dirfd` is `None`, then `path2` is relative to the current working +/// directory. This is identical to `libc::symlink(path1, path2)`. +/// +/// See also [symlinkat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/symlinkat.html). +#[cfg(not(target_os = "redox"))] +pub fn symlinkat( + path1: &P1, + dirfd: Option, + path2: &P2) -> Result<()> { + let res = + path1.with_nix_path(|path1| { + path2.with_nix_path(|path2| { + unsafe { + libc::symlinkat( + path1.as_ptr(), + dirfd.unwrap_or(libc::AT_FDCWD), + path2.as_ptr() + ) + } + }) + })??; + Errno::result(res).map(drop) +} +} + +// Double the buffer capacity up to limit. In case it already has +// reached the limit, return Errno::ERANGE. +#[cfg(any(feature = "fs", feature = "user"))] +fn reserve_double_buffer_size(buf: &mut Vec, limit: usize) -> Result<()> { + use std::cmp::min; + + if buf.capacity() >= limit { + return Err(Errno::ERANGE); + } + + let capacity = min(buf.capacity() * 2, limit); + buf.reserve(capacity); + + Ok(()) +} + +feature! { +#![feature = "fs"] + +/// Returns the current directory as a `PathBuf` +/// +/// Err is returned if the current user doesn't have the permission to read or search a component +/// of the current path. +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// +/// // assume that we are allowed to get current directory +/// let dir = unistd::getcwd().unwrap(); +/// println!("The current directory is {:?}", dir); +/// ``` +#[inline] +pub fn getcwd() -> Result { + let mut buf = Vec::with_capacity(512); + loop { + unsafe { + let ptr = buf.as_mut_ptr() as *mut c_char; + + // The buffer must be large enough to store the absolute pathname plus + // a terminating null byte, or else null is returned. + // To safely handle this we start with a reasonable size (512 bytes) + // and double the buffer size upon every error + if !libc::getcwd(ptr, buf.capacity()).is_null() { + let len = CStr::from_ptr(buf.as_ptr() as *const c_char).to_bytes().len(); + buf.set_len(len); + buf.shrink_to_fit(); + return Ok(PathBuf::from(OsString::from_vec(buf))); + } else { + let error = Errno::last(); + // ERANGE means buffer was too small to store directory name + if error != Errno::ERANGE { + return Err(error); + } + } + + // Trigger the internal buffer resizing logic. + reserve_double_buffer_size(&mut buf, PATH_MAX as usize)?; + } + } +} +} + +feature! { +#![all(feature = "user", feature = "fs")] + +/// Computes the raw UID and GID values to pass to a `*chown` call. +// The cast is not unnecessary on all platforms. +#[allow(clippy::unnecessary_cast)] +fn chown_raw_ids(owner: Option, group: Option) -> (libc::uid_t, libc::gid_t) { + // According to the POSIX specification, -1 is used to indicate that owner and group + // are not to be changed. Since uid_t and gid_t are unsigned types, we have to wrap + // around to get -1. + let uid = owner.map(Into::into) + .unwrap_or_else(|| (0 as uid_t).wrapping_sub(1)); + let gid = group.map(Into::into) + .unwrap_or_else(|| (0 as gid_t).wrapping_sub(1)); + (uid, gid) +} + +/// Change the ownership of the file at `path` to be owned by the specified +/// `owner` (user) and `group` (see +/// [chown(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html)). +/// +/// The owner/group for the provided path name will not be modified if `None` is +/// provided for that argument. Ownership change will be attempted for the path +/// only if `Some` owner/group is provided. +#[inline] +pub fn chown(path: &P, owner: Option, group: Option) -> Result<()> { + let res = path.with_nix_path(|cstr| { + let (uid, gid) = chown_raw_ids(owner, group); + unsafe { libc::chown(cstr.as_ptr(), uid, gid) } + })?; + + Errno::result(res).map(drop) +} + +/// Change the ownership of the file referred to by the open file descriptor `fd` to be owned by +/// the specified `owner` (user) and `group` (see +/// [fchown(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchown.html)). +/// +/// The owner/group for the provided file will not be modified if `None` is +/// provided for that argument. Ownership change will be attempted for the path +/// only if `Some` owner/group is provided. +#[inline] +pub fn fchown(fd: RawFd, owner: Option, group: Option) -> Result<()> { + let (uid, gid) = chown_raw_ids(owner, group); + let res = unsafe { libc::fchown(fd, uid, gid) }; + Errno::result(res).map(drop) +} + +/// Flags for `fchownat` function. +#[derive(Clone, Copy, Debug)] +pub enum FchownatFlags { + FollowSymlink, + NoFollowSymlink, +} + +/// Change the ownership of the file at `path` to be owned by the specified +/// `owner` (user) and `group`. +/// +/// The owner/group for the provided path name will not be modified if `None` is +/// provided for that argument. Ownership change will be attempted for the path +/// only if `Some` owner/group is provided. +/// +/// The file to be changed is determined relative to the directory associated +/// with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. +/// +/// If `flag` is `FchownatFlags::NoFollowSymlink` and `path` names a symbolic link, +/// then the mode of the symbolic link is changed. +/// +/// `fchownat(None, path, owner, group, FchownatFlags::NoFollowSymlink)` is identical to +/// a call `libc::lchown(path, owner, group)`. That's why `lchown` is unimplemented in +/// the `nix` crate. +/// +/// # References +/// +/// [fchownat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchownat.html). +#[cfg(not(target_os = "redox"))] +pub fn fchownat( + dirfd: Option, + path: &P, + owner: Option, + group: Option, + flag: FchownatFlags, +) -> Result<()> { + let atflag = + match flag { + FchownatFlags::FollowSymlink => AtFlags::empty(), + FchownatFlags::NoFollowSymlink => AtFlags::AT_SYMLINK_NOFOLLOW, + }; + let res = path.with_nix_path(|cstr| unsafe { + let (uid, gid) = chown_raw_ids(owner, group); + libc::fchownat(at_rawfd(dirfd), cstr.as_ptr(), uid, gid, + atflag.bits() as libc::c_int) + })?; + + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "process"] +fn to_exec_array>(args: &[S]) -> Vec<*const c_char> { + use std::iter::once; + args.iter() + .map(|s| s.as_ref().as_ptr()) + .chain(once(ptr::null())) + .collect() +} + +/// Replace the current process image with a new one (see +/// [exec(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html)). +/// +/// See the `::nix::unistd::execve` system call for additional details. `execv` +/// performs the same action but does not allow for customization of the +/// environment for the new process. +#[inline] +pub fn execv>(path: &CStr, argv: &[S]) -> Result { + let args_p = to_exec_array(argv); + + unsafe { + libc::execv(path.as_ptr(), args_p.as_ptr()) + }; + + Err(Errno::last()) +} + + +/// Replace the current process image with a new one (see +/// [execve(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html)). +/// +/// The execve system call allows for another process to be "called" which will +/// replace the current process image. That is, this process becomes the new +/// command that is run. On success, this function will not return. Instead, +/// the new program will run until it exits. +/// +/// `::nix::unistd::execv` and `::nix::unistd::execve` take as arguments a slice +/// of `::std::ffi::CString`s for `args` and `env` (for `execve`). Each element +/// in the `args` list is an argument to the new process. Each element in the +/// `env` list should be a string in the form "key=value". +#[inline] +pub fn execve, SE: AsRef>(path: &CStr, args: &[SA], env: &[SE]) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::execve(path.as_ptr(), args_p.as_ptr(), env_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Replace the current process image with a new one and replicate shell `PATH` +/// searching behavior (see +/// [exec(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html)). +/// +/// See `::nix::unistd::execve` for additional details. `execvp` behaves the +/// same as execv except that it will examine the `PATH` environment variables +/// for file names not specified with a leading slash. For example, `execv` +/// would not work if "bash" was specified for the path argument, but `execvp` +/// would assuming that a bash executable was on the system `PATH`. +#[inline] +pub fn execvp>(filename: &CStr, args: &[S]) -> Result { + let args_p = to_exec_array(args); + + unsafe { + libc::execvp(filename.as_ptr(), args_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Replace the current process image with a new one and replicate shell `PATH` +/// searching behavior (see +/// [`execvpe(3)`](https://man7.org/linux/man-pages/man3/exec.3.html)). +/// +/// This functions like a combination of `execvp(2)` and `execve(2)` to pass an +/// environment and have a search path. See these two for additional +/// information. +#[cfg(any(target_os = "haiku", + target_os = "linux", + target_os = "openbsd"))] +pub fn execvpe, SE: AsRef>(filename: &CStr, args: &[SA], env: &[SE]) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::execvpe(filename.as_ptr(), args_p.as_ptr(), env_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Replace the current process image with a new one (see +/// [fexecve(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fexecve.html)). +/// +/// The `fexecve` function allows for another process to be "called" which will +/// replace the current process image. That is, this process becomes the new +/// command that is run. On success, this function will not return. Instead, +/// the new program will run until it exits. +/// +/// This function is similar to `execve`, except that the program to be executed +/// is referenced as a file descriptor instead of a path. +#[cfg(any(target_os = "android", + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd"))] +#[inline] +pub fn fexecve ,SE: AsRef>(fd: RawFd, args: &[SA], env: &[SE]) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::fexecve(fd, args_p.as_ptr(), env_p.as_ptr()) + }; + + Err(Errno::last()) +} + +/// Execute program relative to a directory file descriptor (see +/// [execveat(2)](https://man7.org/linux/man-pages/man2/execveat.2.html)). +/// +/// The `execveat` function allows for another process to be "called" which will +/// replace the current process image. That is, this process becomes the new +/// command that is run. On success, this function will not return. Instead, +/// the new program will run until it exits. +/// +/// This function is similar to `execve`, except that the program to be executed +/// is referenced as a file descriptor to the base directory plus a path. +#[cfg(any(target_os = "android", target_os = "linux"))] +#[inline] +pub fn execveat,SE: AsRef>(dirfd: RawFd, pathname: &CStr, args: &[SA], + env: &[SE], flags: super::fcntl::AtFlags) -> Result { + let args_p = to_exec_array(args); + let env_p = to_exec_array(env); + + unsafe { + libc::syscall(libc::SYS_execveat, dirfd, pathname.as_ptr(), + args_p.as_ptr(), env_p.as_ptr(), flags); + }; + + Err(Errno::last()) +} + +/// Daemonize this process by detaching from the controlling terminal (see +/// [daemon(3)](https://man7.org/linux/man-pages/man3/daemon.3.html)). +/// +/// When a process is launched it is typically associated with a parent and it, +/// in turn, by its controlling terminal/process. In order for a process to run +/// in the "background" it must daemonize itself by detaching itself. Under +/// posix, this is done by doing the following: +/// +/// 1. Parent process (this one) forks +/// 2. Parent process exits +/// 3. Child process continues to run. +/// +/// `nochdir`: +/// +/// * `nochdir = true`: The current working directory after daemonizing will +/// be the current working directory. +/// * `nochdir = false`: The current working directory after daemonizing will +/// be the root direcory, `/`. +/// +/// `noclose`: +/// +/// * `noclose = true`: The process' current stdin, stdout, and stderr file +/// descriptors will remain identical after daemonizing. +/// * `noclose = false`: The process' stdin, stdout, and stderr will point to +/// `/dev/null` after daemonizing. +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] +pub fn daemon(nochdir: bool, noclose: bool) -> Result<()> { + let res = unsafe { libc::daemon(nochdir as c_int, noclose as c_int) }; + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "hostname"] + +/// Set the system host name (see +/// [sethostname(2)](https://man7.org/linux/man-pages/man2/gethostname.2.html)). +/// +/// Given a name, attempt to update the system host name to the given string. +/// On some systems, the host name is limited to as few as 64 bytes. An error +/// will be returned if the name is not valid or the current process does not +/// have permissions to update the host name. +#[cfg(not(target_os = "redox"))] +pub fn sethostname>(name: S) -> Result<()> { + // Handle some differences in type of the len arg across platforms. + cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "solaris", ))] { + type sethostname_len_t = c_int; + } else { + type sethostname_len_t = size_t; + } + } + let ptr = name.as_ref().as_bytes().as_ptr() as *const c_char; + let len = name.as_ref().len() as sethostname_len_t; + + let res = unsafe { libc::sethostname(ptr, len) }; + Errno::result(res).map(drop) +} + +/// Get the host name and store it in an internally allocated buffer, returning an +/// `OsString` on success (see +/// [gethostname(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostname.html)). +/// +/// This function call attempts to get the host name for the running system and +/// store it in an internal buffer, returning it as an `OsString` if successful. +/// +/// ```no_run +/// use nix::unistd; +/// +/// let hostname = unistd::gethostname().expect("Failed getting hostname"); +/// let hostname = hostname.into_string().expect("Hostname wasn't valid UTF-8"); +/// println!("Hostname: {}", hostname); +/// ``` +pub fn gethostname() -> Result { + // The capacity is the max length of a hostname plus the NUL terminator. + let mut buffer: Vec = Vec::with_capacity(256); + let ptr = buffer.as_mut_ptr() as *mut c_char; + let len = buffer.capacity() as size_t; + + let res = unsafe { libc::gethostname(ptr, len) }; + Errno::result(res).map(|_| { + unsafe { + buffer.as_mut_ptr().wrapping_add(len - 1).write(0); // ensure always null-terminated + let len = CStr::from_ptr(buffer.as_ptr() as *const c_char).len(); + buffer.set_len(len); + } + OsString::from_vec(buffer) + }) +} +} + +/// Close a raw file descriptor +/// +/// Be aware that many Rust types implicitly close-on-drop, including +/// `std::fs::File`. Explicitly closing them with this method too can result in +/// a double-close condition, which can cause confusing `EBADF` errors in +/// seemingly unrelated code. Caveat programmer. See also +/// [close(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html). +/// +/// # Examples +/// +/// ```no_run +/// use std::os::unix::io::AsRawFd; +/// use nix::unistd::close; +/// +/// let f = tempfile::tempfile().unwrap(); +/// close(f.as_raw_fd()).unwrap(); // Bad! f will also close on drop! +/// ``` +/// +/// ```rust +/// use std::os::unix::io::IntoRawFd; +/// use nix::unistd::close; +/// +/// let f = tempfile::tempfile().unwrap(); +/// close(f.into_raw_fd()).unwrap(); // Good. into_raw_fd consumes f +/// ``` +pub fn close(fd: RawFd) -> Result<()> { + let res = unsafe { libc::close(fd) }; + Errno::result(res).map(drop) +} + +/// Read from a raw file descriptor. +/// +/// See also [read(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html) +pub fn read(fd: RawFd, buf: &mut [u8]) -> Result { + let res = unsafe { + libc::read(fd, buf.as_mut_ptr() as *mut c_void, buf.len() as size_t) + }; + + Errno::result(res).map(|r| r as usize) +} + +/// Write to a raw file descriptor. +/// +/// See also [write(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html) +pub fn write(fd: RawFd, buf: &[u8]) -> Result { + let res = unsafe { + libc::write(fd, buf.as_ptr() as *const c_void, buf.len() as size_t) + }; + + Errno::result(res).map(|r| r as usize) +} + +feature! { +#![feature = "fs"] + +/// Directive that tells [`lseek`] and [`lseek64`] what the offset is relative to. +/// +/// [`lseek`]: ./fn.lseek.html +/// [`lseek64`]: ./fn.lseek64.html +#[repr(i32)] +#[derive(Clone, Copy, Debug)] +pub enum Whence { + /// Specify an offset relative to the start of the file. + SeekSet = libc::SEEK_SET, + /// Specify an offset relative to the current file location. + SeekCur = libc::SEEK_CUR, + /// Specify an offset relative to the end of the file. + SeekEnd = libc::SEEK_END, + /// Specify an offset relative to the next location in the file greater than or + /// equal to offset that contains some data. If offset points to + /// some data, then the file offset is set to offset. + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "solaris"))] + SeekData = libc::SEEK_DATA, + /// Specify an offset relative to the next hole in the file greater than + /// or equal to offset. If offset points into the middle of a hole, then + /// the file offset should be set to offset. If there is no hole past offset, + /// then the file offset should be adjusted to the end of the file (i.e., there + /// is an implicit hole at the end of any file). + #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "solaris"))] + SeekHole = libc::SEEK_HOLE +} + +/// Move the read/write file offset. +/// +/// See also [lseek(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html) +pub fn lseek(fd: RawFd, offset: off_t, whence: Whence) -> Result { + let res = unsafe { libc::lseek(fd, offset, whence as i32) }; + + Errno::result(res).map(|r| r as off_t) +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn lseek64(fd: RawFd, offset: libc::off64_t, whence: Whence) -> Result { + let res = unsafe { libc::lseek64(fd, offset, whence as i32) }; + + Errno::result(res).map(|r| r as libc::off64_t) +} +} + +/// Create an interprocess channel. +/// +/// See also [pipe(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pipe.html) +pub fn pipe() -> std::result::Result<(RawFd, RawFd), Error> { + let mut fds = mem::MaybeUninit::<[c_int; 2]>::uninit(); + + let res = unsafe { libc::pipe(fds.as_mut_ptr() as *mut c_int) }; + + Error::result(res)?; + + unsafe { Ok((fds.assume_init()[0], fds.assume_init()[1])) } +} + +feature! { +#![feature = "fs"] +/// Like `pipe`, but allows setting certain file descriptor flags. +/// +/// The following flags are supported, and will be set atomically as the pipe is +/// created: +/// +/// - `O_CLOEXEC`: Set the close-on-exec flag for the new file descriptors. +#[cfg_attr(target_os = "linux", doc = "- `O_DIRECT`: Create a pipe that performs I/O in \"packet\" mode.")] +#[cfg_attr(target_os = "netbsd", doc = "- `O_NOSIGPIPE`: Return `EPIPE` instead of raising `SIGPIPE`.")] +/// - `O_NONBLOCK`: Set the non-blocking flag for the ends of the pipe. +/// +/// See also [pipe(2)](https://man7.org/linux/man-pages/man2/pipe.2.html) +#[cfg(any(target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "redox", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] +pub fn pipe2(flags: OFlag) -> Result<(RawFd, RawFd)> { + let mut fds = mem::MaybeUninit::<[c_int; 2]>::uninit(); + + let res = unsafe { + libc::pipe2(fds.as_mut_ptr() as *mut c_int, flags.bits()) + }; + + Errno::result(res)?; + + unsafe { Ok((fds.assume_init()[0], fds.assume_init()[1])) } +} + +/// Truncate a file to a specified length +/// +/// See also +/// [truncate(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html) +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +pub fn truncate(path: &P, len: off_t) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::truncate(cstr.as_ptr(), len) + } + })?; + + Errno::result(res).map(drop) +} + +/// Truncate a file to a specified length +/// +/// See also +/// [ftruncate(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html) +pub fn ftruncate(fd: RawFd, len: off_t) -> Result<()> { + Errno::result(unsafe { libc::ftruncate(fd, len) }).map(drop) +} + +pub fn isatty(fd: RawFd) -> Result { + unsafe { + // ENOTTY means `fd` is a valid file descriptor, but not a TTY, so + // we return `Ok(false)` + if libc::isatty(fd) == 1 { + Ok(true) + } else { + match Errno::last() { + Errno::ENOTTY => Ok(false), + err => Err(err), + } + } + } +} + +/// Flags for `linkat` function. +#[derive(Clone, Copy, Debug)] +pub enum LinkatFlags { + SymlinkFollow, + NoSymlinkFollow, +} + +/// Link one file to another file +/// +/// Creates a new link (directory entry) at `newpath` for the existing file at `oldpath`. In the +/// case of a relative `oldpath`, the path is interpreted relative to the directory associated +/// with file descriptor `olddirfd` instead of the current working directory and similiarly for +/// `newpath` and file descriptor `newdirfd`. In case `flag` is LinkatFlags::SymlinkFollow and +/// `oldpath` names a symoblic link, a new link for the target of the symbolic link is created. +/// If either `olddirfd` or `newdirfd` is `None`, `AT_FDCWD` is used respectively where `oldpath` +/// and/or `newpath` is then interpreted relative to the current working directory of the calling +/// process. If either `oldpath` or `newpath` is absolute, then `dirfd` is ignored. +/// +/// # References +/// See also [linkat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html) +#[cfg(not(target_os = "redox"))] // RedoxFS does not support symlinks yet +pub fn linkat( + olddirfd: Option, + oldpath: &P, + newdirfd: Option, + newpath: &P, + flag: LinkatFlags, +) -> Result<()> { + + let atflag = + match flag { + LinkatFlags::SymlinkFollow => AtFlags::AT_SYMLINK_FOLLOW, + LinkatFlags::NoSymlinkFollow => AtFlags::empty(), + }; + + let res = + oldpath.with_nix_path(|oldcstr| { + newpath.with_nix_path(|newcstr| { + unsafe { + libc::linkat( + at_rawfd(olddirfd), + oldcstr.as_ptr(), + at_rawfd(newdirfd), + newcstr.as_ptr(), + atflag.bits() as libc::c_int + ) + } + }) + })??; + Errno::result(res).map(drop) +} + + +/// Remove a directory entry +/// +/// See also [unlink(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html) +pub fn unlink(path: &P) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::unlink(cstr.as_ptr()) + } + })?; + Errno::result(res).map(drop) +} + +/// Flags for `unlinkat` function. +#[derive(Clone, Copy, Debug)] +pub enum UnlinkatFlags { + RemoveDir, + NoRemoveDir, +} + +/// Remove a directory entry +/// +/// In the case of a relative path, the directory entry to be removed is determined relative to +/// the directory associated with the file descriptor `dirfd` or the current working directory +/// if `dirfd` is `None`. In the case of an absolute `path` `dirfd` is ignored. If `flag` is +/// `UnlinkatFlags::RemoveDir` then removal of the directory entry specified by `dirfd` and `path` +/// is performed. +/// +/// # References +/// See also [unlinkat(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlinkat.html) +#[cfg(not(target_os = "redox"))] +pub fn unlinkat( + dirfd: Option, + path: &P, + flag: UnlinkatFlags, +) -> Result<()> { + let atflag = + match flag { + UnlinkatFlags::RemoveDir => AtFlags::AT_REMOVEDIR, + UnlinkatFlags::NoRemoveDir => AtFlags::empty(), + }; + let res = path.with_nix_path(|cstr| { + unsafe { + libc::unlinkat(at_rawfd(dirfd), cstr.as_ptr(), atflag.bits() as libc::c_int) + } + })?; + Errno::result(res).map(drop) +} + + +#[inline] +#[cfg(not(target_os = "fuchsia"))] +pub fn chroot(path: &P) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { libc::chroot(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) +} + +/// Commit filesystem caches to disk +/// +/// See also [sync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sync.html) +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd" +))] +pub fn sync() { + unsafe { libc::sync() }; +} + +/// Synchronize changes to a file +/// +/// See also [fsync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html) +#[inline] +pub fn fsync(fd: RawFd) -> Result<()> { + let res = unsafe { libc::fsync(fd) }; + + Errno::result(res).map(drop) +} + +/// Synchronize the data of a file +/// +/// See also +/// [fdatasync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html) +#[cfg(any(target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "netbsd", + target_os = "openbsd", + target_os = "illumos", + target_os = "solaris"))] +#[inline] +pub fn fdatasync(fd: RawFd) -> Result<()> { + let res = unsafe { libc::fdatasync(fd) }; + + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "user"] + +/// Get a real user ID +/// +/// See also [getuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getuid.html) +// POSIX requires that getuid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn getuid() -> Uid { + Uid(unsafe { libc::getuid() }) +} + +/// Get the effective user ID +/// +/// See also [geteuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/geteuid.html) +// POSIX requires that geteuid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn geteuid() -> Uid { + Uid(unsafe { libc::geteuid() }) +} + +/// Get the real group ID +/// +/// See also [getgid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getgid.html) +// POSIX requires that getgid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn getgid() -> Gid { + Gid(unsafe { libc::getgid() }) +} + +/// Get the effective group ID +/// +/// See also [getegid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getegid.html) +// POSIX requires that getegid is always successful, so no need to check return +// value or errno. +#[inline] +pub fn getegid() -> Gid { + Gid(unsafe { libc::getegid() }) +} + +/// Set the effective user ID +/// +/// See also [seteuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/seteuid.html) +#[inline] +pub fn seteuid(euid: Uid) -> Result<()> { + let res = unsafe { libc::seteuid(euid.into()) }; + + Errno::result(res).map(drop) +} + +/// Set the effective group ID +/// +/// See also [setegid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setegid.html) +#[inline] +pub fn setegid(egid: Gid) -> Result<()> { + let res = unsafe { libc::setegid(egid.into()) }; + + Errno::result(res).map(drop) +} + +/// Set the user ID +/// +/// See also [setuid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setuid.html) +#[inline] +pub fn setuid(uid: Uid) -> Result<()> { + let res = unsafe { libc::setuid(uid.into()) }; + + Errno::result(res).map(drop) +} + +/// Set the group ID +/// +/// See also [setgid(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/setgid.html) +#[inline] +pub fn setgid(gid: Gid) -> Result<()> { + let res = unsafe { libc::setgid(gid.into()) }; + + Errno::result(res).map(drop) +} +} + +feature! { +#![all(feature = "fs", feature = "user")] +/// Set the user identity used for filesystem checks per-thread. +/// On both success and failure, this call returns the previous filesystem user +/// ID of the caller. +/// +/// See also [setfsuid(2)](https://man7.org/linux/man-pages/man2/setfsuid.2.html) +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn setfsuid(uid: Uid) -> Uid { + let prev_fsuid = unsafe { libc::setfsuid(uid.into()) }; + Uid::from_raw(prev_fsuid as uid_t) +} + +/// Set the group identity used for filesystem checks per-thread. +/// On both success and failure, this call returns the previous filesystem group +/// ID of the caller. +/// +/// See also [setfsgid(2)](https://man7.org/linux/man-pages/man2/setfsgid.2.html) +#[cfg(any(target_os = "linux", target_os = "android"))] +pub fn setfsgid(gid: Gid) -> Gid { + let prev_fsgid = unsafe { libc::setfsgid(gid.into()) }; + Gid::from_raw(prev_fsgid as gid_t) +} +} + +feature! { +#![feature = "user"] + +/// Get the list of supplementary group IDs of the calling process. +/// +/// [Further reading](https://pubs.opengroup.org/onlinepubs/009695399/functions/getgroups.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, checking group membership should be achieved via communication +/// with the `opendirectoryd` service. +#[cfg(not(any(target_os = "ios", target_os = "macos")))] +pub fn getgroups() -> Result> { + // First get the maximum number of groups. The value returned + // shall always be greater than or equal to one and less than or + // equal to the value of {NGROUPS_MAX} + 1. + let ngroups_max = match sysconf(SysconfVar::NGROUPS_MAX) { + Ok(Some(n)) => (n + 1) as usize, + Ok(None) | Err(_) => ::max_value(), + }; + + // Next, get the number of groups so we can size our Vec + let ngroups = unsafe { libc::getgroups(0, ptr::null_mut()) }; + + // If there are no supplementary groups, return early. + // This prevents a potential buffer over-read if the number of groups + // increases from zero before the next call. It would return the total + // number of groups beyond the capacity of the buffer. + if ngroups == 0 { + return Ok(Vec::new()); + } + + // Now actually get the groups. We try multiple times in case the number of + // groups has changed since the first call to getgroups() and the buffer is + // now too small. + let mut groups = Vec::::with_capacity(Errno::result(ngroups)? as usize); + loop { + // FIXME: On the platforms we currently support, the `Gid` struct has + // the same representation in memory as a bare `gid_t`. This is not + // necessarily the case on all Rust platforms, though. See RFC 1785. + let ngroups = unsafe { + libc::getgroups(groups.capacity() as c_int, groups.as_mut_ptr() as *mut gid_t) + }; + + match Errno::result(ngroups) { + Ok(s) => { + unsafe { groups.set_len(s as usize) }; + return Ok(groups); + }, + Err(Errno::EINVAL) => { + // EINVAL indicates that the buffer size was too + // small, resize it up to ngroups_max as limit. + reserve_double_buffer_size(&mut groups, ngroups_max) + .or(Err(Errno::EINVAL))?; + }, + Err(e) => return Err(e) + } + } +} + +/// Set the list of supplementary group IDs for the calling process. +/// +/// [Further reading](https://man7.org/linux/man-pages/man2/getgroups.2.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, group membership management should be achieved via communication +/// with the `opendirectoryd` service. +/// +/// # Examples +/// +/// `setgroups` can be used when dropping privileges from the root user to a +/// specific user and group. For example, given the user `www-data` with UID +/// `33` and the group `backup` with the GID `34`, one could switch the user as +/// follows: +/// +/// ```rust,no_run +/// # use std::error::Error; +/// # use nix::unistd::*; +/// # +/// # fn try_main() -> Result<(), Box> { +/// let uid = Uid::from_raw(33); +/// let gid = Gid::from_raw(34); +/// setgroups(&[gid])?; +/// setgid(gid)?; +/// setuid(uid)?; +/// # +/// # Ok(()) +/// # } +/// # +/// # try_main().unwrap(); +/// ``` +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "haiku")))] +pub fn setgroups(groups: &[Gid]) -> Result<()> { + cfg_if! { + if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "illumos", + target_os = "openbsd"))] { + type setgroups_ngroups_t = c_int; + } else { + type setgroups_ngroups_t = size_t; + } + } + // FIXME: On the platforms we currently support, the `Gid` struct has the + // same representation in memory as a bare `gid_t`. This is not necessarily + // the case on all Rust platforms, though. See RFC 1785. + let res = unsafe { + libc::setgroups(groups.len() as setgroups_ngroups_t, groups.as_ptr() as *const gid_t) + }; + + Errno::result(res).map(drop) +} + +/// Calculate the supplementary group access list. +/// +/// Gets the group IDs of all groups that `user` is a member of. The additional +/// group `group` is also added to the list. +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/getgrouplist.3.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, checking group membership should be achieved via communication +/// with the `opendirectoryd` service. +/// +/// # Errors +/// +/// Although the `getgrouplist()` call does not return any specific +/// errors on any known platforms, this implementation will return a system +/// error of `EINVAL` if the number of groups to be fetched exceeds the +/// `NGROUPS_MAX` sysconf value. This mimics the behaviour of `getgroups()` +/// and `setgroups()`. Additionally, while some implementations will return a +/// partial list of groups when `NGROUPS_MAX` is exceeded, this implementation +/// will only ever return the complete list or else an error. +#[cfg(not(any(target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "redox")))] +pub fn getgrouplist(user: &CStr, group: Gid) -> Result> { + let ngroups_max = match sysconf(SysconfVar::NGROUPS_MAX) { + Ok(Some(n)) => n as c_int, + Ok(None) | Err(_) => ::max_value(), + }; + use std::cmp::min; + let mut groups = Vec::::with_capacity(min(ngroups_max, 8) as usize); + cfg_if! { + if #[cfg(any(target_os = "ios", target_os = "macos"))] { + type getgrouplist_group_t = c_int; + } else { + type getgrouplist_group_t = gid_t; + } + } + let gid: gid_t = group.into(); + loop { + let mut ngroups = groups.capacity() as i32; + let ret = unsafe { + libc::getgrouplist(user.as_ptr(), + gid as getgrouplist_group_t, + groups.as_mut_ptr() as *mut getgrouplist_group_t, + &mut ngroups) + }; + + // BSD systems only return 0 or -1, Linux returns ngroups on success. + if ret >= 0 { + unsafe { groups.set_len(ngroups as usize) }; + return Ok(groups); + } else if ret == -1 { + // Returns -1 if ngroups is too small, but does not set errno. + // BSD systems will still fill the groups buffer with as many + // groups as possible, but Linux manpages do not mention this + // behavior. + reserve_double_buffer_size(&mut groups, ngroups_max as usize) + .map_err(|_| Errno::EINVAL)?; + } + } +} + +/// Initialize the supplementary group access list. +/// +/// Sets the supplementary group IDs for the calling process using all groups +/// that `user` is a member of. The additional group `group` is also added to +/// the list. +/// +/// [Further reading](https://man7.org/linux/man-pages/man3/initgroups.3.html) +/// +/// **Note:** This function is not available for Apple platforms. On those +/// platforms, group membership management should be achieved via communication +/// with the `opendirectoryd` service. +/// +/// # Examples +/// +/// `initgroups` can be used when dropping privileges from the root user to +/// another user. For example, given the user `www-data`, we could look up the +/// UID and GID for the user in the system's password database (usually found +/// in `/etc/passwd`). If the `www-data` user's UID and GID were `33` and `33`, +/// respectively, one could switch the user as follows: +/// +/// ```rust,no_run +/// # use std::error::Error; +/// # use std::ffi::CString; +/// # use nix::unistd::*; +/// # +/// # fn try_main() -> Result<(), Box> { +/// let user = CString::new("www-data").unwrap(); +/// let uid = Uid::from_raw(33); +/// let gid = Gid::from_raw(33); +/// initgroups(&user, gid)?; +/// setgid(gid)?; +/// setuid(uid)?; +/// # +/// # Ok(()) +/// # } +/// # +/// # try_main().unwrap(); +/// ``` +#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox", target_os = "haiku")))] +pub fn initgroups(user: &CStr, group: Gid) -> Result<()> { + cfg_if! { + if #[cfg(any(target_os = "ios", target_os = "macos"))] { + type initgroups_group_t = c_int; + } else { + type initgroups_group_t = gid_t; + } + } + let gid: gid_t = group.into(); + let res = unsafe { libc::initgroups(user.as_ptr(), gid as initgroups_group_t) }; + + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "signal"] + +/// Suspend the thread until a signal is received. +/// +/// See also [pause(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html). +#[inline] +#[cfg(not(target_os = "redox"))] +pub fn pause() { + unsafe { libc::pause() }; +} + +pub mod alarm { + //! Alarm signal scheduling. + //! + //! Scheduling an alarm will trigger a `SIGALRM` signal when the time has + //! elapsed, which has to be caught, because the default action for the + //! signal is to terminate the program. This signal also can't be ignored + //! because the system calls like `pause` will not be interrupted, see the + //! second example below. + //! + //! # Examples + //! + //! Canceling an alarm: + //! + //! ``` + //! use nix::unistd::alarm; + //! + //! // Set an alarm for 60 seconds from now. + //! alarm::set(60); + //! + //! // Cancel the above set alarm, which returns the number of seconds left + //! // of the previously set alarm. + //! assert_eq!(alarm::cancel(), Some(60)); + //! ``` + //! + //! Scheduling an alarm and waiting for the signal: + //! +#![cfg_attr(target_os = "redox", doc = " ```rust,ignore")] +#![cfg_attr(not(target_os = "redox"), doc = " ```rust")] + //! use std::time::{Duration, Instant}; + //! + //! use nix::unistd::{alarm, pause}; + //! use nix::sys::signal::*; + //! + //! // We need to setup an empty signal handler to catch the alarm signal, + //! // otherwise the program will be terminated once the signal is delivered. + //! extern fn signal_handler(_: nix::libc::c_int) { } + //! let sa = SigAction::new( + //! SigHandler::Handler(signal_handler), + //! SaFlags::SA_RESTART, + //! SigSet::empty() + //! ); + //! unsafe { + //! sigaction(Signal::SIGALRM, &sa); + //! } + //! + //! let start = Instant::now(); + //! + //! // Set an alarm for 1 second from now. + //! alarm::set(1); + //! + //! // Pause the process until the alarm signal is received. + //! let mut sigset = SigSet::empty(); + //! sigset.add(Signal::SIGALRM); + //! sigset.wait(); + //! + //! assert!(start.elapsed() >= Duration::from_secs(1)); + //! ``` + //! + //! # References + //! + //! See also [alarm(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/alarm.html). + + /// Schedule an alarm signal. + /// + /// This will cause the system to generate a `SIGALRM` signal for the + /// process after the specified number of seconds have elapsed. + /// + /// Returns the leftover time of a previously set alarm if there was one. + pub fn set(secs: libc::c_uint) -> Option { + assert!(secs != 0, "passing 0 to `alarm::set` is not allowed, to cancel an alarm use `alarm::cancel`"); + alarm(secs) + } + + /// Cancel an previously set alarm signal. + /// + /// Returns the leftover time of a previously set alarm if there was one. + pub fn cancel() -> Option { + alarm(0) + } + + fn alarm(secs: libc::c_uint) -> Option { + match unsafe { libc::alarm(secs) } { + 0 => None, + secs => Some(secs), + } + } +} +} + +/// Suspend execution for an interval of time +/// +/// See also [sleep(2)](https://pubs.opengroup.org/onlinepubs/009695399/functions/sleep.html#tag_03_705_05) +// Per POSIX, does not fail +#[inline] +pub fn sleep(seconds: c_uint) -> c_uint { + unsafe { libc::sleep(seconds) } +} + +feature! { +#![feature = "acct"] + +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +pub mod acct { + use crate::{Result, NixPath}; + use crate::errno::Errno; + use std::ptr; + + /// Enable process accounting + /// + /// See also [acct(2)](https://linux.die.net/man/2/acct) + pub fn enable(filename: &P) -> Result<()> { + let res = filename.with_nix_path(|cstr| { + unsafe { libc::acct(cstr.as_ptr()) } + })?; + + Errno::result(res).map(drop) + } + + /// Disable process accounting + pub fn disable() -> Result<()> { + let res = unsafe { libc::acct(ptr::null()) }; + + Errno::result(res).map(drop) + } +} +} + +feature! { +#![feature = "fs"] +/// Creates a regular file which persists even after process termination +/// +/// * `template`: a path whose 6 rightmost characters must be X, e.g. `/tmp/tmpfile_XXXXXX` +/// * returns: tuple of file descriptor and filename +/// +/// Err is returned either if no temporary filename could be created or the template doesn't +/// end with XXXXXX +/// +/// See also [mkstemp(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkstemp.html) +/// +/// # Example +/// +/// ```rust +/// use nix::unistd; +/// +/// let _ = match unistd::mkstemp("/tmp/tempfile_XXXXXX") { +/// Ok((fd, path)) => { +/// unistd::unlink(path.as_path()).unwrap(); // flag file to be deleted at app termination +/// fd +/// } +/// Err(e) => panic!("mkstemp failed: {}", e) +/// }; +/// // do something with fd +/// ``` +#[inline] +pub fn mkstemp(template: &P) -> Result<(RawFd, PathBuf)> { + let mut path = template.with_nix_path(|path| {path.to_bytes_with_nul().to_owned()})?; + let p = path.as_mut_ptr() as *mut _; + let fd = unsafe { libc::mkstemp(p) }; + let last = path.pop(); // drop the trailing nul + debug_assert!(last == Some(b'\0')); + let pathname = OsString::from_vec(path); + Errno::result(fd)?; + Ok((fd, PathBuf::from(pathname))) +} +} + +feature! { +#![all(feature = "fs", feature = "feature")] + +/// Variable names for `pathconf` +/// +/// Nix uses the same naming convention for these variables as the +/// [getconf(1)](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html) utility. +/// That is, `PathconfVar` variables have the same name as the abstract +/// variables shown in the `pathconf(2)` man page. Usually, it's the same as +/// the C variable name without the leading `_PC_`. +/// +/// POSIX 1003.1-2008 standardizes all of these variables, but some OSes choose +/// not to implement variables that cannot change at runtime. +/// +/// # References +/// +/// - [pathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html) +/// - [limits.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) +/// - [unistd.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html) +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(i32)] +#[non_exhaustive] +pub enum PathconfVar { + #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "linux", + target_os = "netbsd", target_os = "openbsd", target_os = "redox"))] + /// Minimum number of bits needed to represent, as a signed integer value, + /// the maximum size of a regular file allowed in the specified directory. + #[cfg_attr(docsrs, doc(cfg(all())))] + FILESIZEBITS = libc::_PC_FILESIZEBITS, + /// Maximum number of links to a single file. + LINK_MAX = libc::_PC_LINK_MAX, + /// Maximum number of bytes in a terminal canonical input line. + MAX_CANON = libc::_PC_MAX_CANON, + /// Minimum number of bytes for which space is available in a terminal input + /// queue; therefore, the maximum number of bytes a conforming application + /// may require to be typed as input before reading them. + MAX_INPUT = libc::_PC_MAX_INPUT, + /// Maximum number of bytes in a filename (not including the terminating + /// null of a filename string). + NAME_MAX = libc::_PC_NAME_MAX, + /// Maximum number of bytes the implementation will store as a pathname in a + /// user-supplied buffer of unspecified size, including the terminating null + /// character. Minimum number the implementation will accept as the maximum + /// number of bytes in a pathname. + PATH_MAX = libc::_PC_PATH_MAX, + /// Maximum number of bytes that is guaranteed to be atomic when writing to + /// a pipe. + PIPE_BUF = libc::_PC_PIPE_BUF, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "illumos", + target_os = "linux", target_os = "netbsd", target_os = "openbsd", + target_os = "redox", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Symbolic links can be created. + POSIX2_SYMLINKS = libc::_PC_2_SYMLINKS, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Minimum number of bytes of storage actually allocated for any portion of + /// a file. + POSIX_ALLOC_SIZE_MIN = libc::_PC_ALLOC_SIZE_MIN, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Recommended increment for file transfer sizes between the + /// `POSIX_REC_MIN_XFER_SIZE` and `POSIX_REC_MAX_XFER_SIZE` values. + POSIX_REC_INCR_XFER_SIZE = libc::_PC_REC_INCR_XFER_SIZE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Maximum recommended file transfer size. + POSIX_REC_MAX_XFER_SIZE = libc::_PC_REC_MAX_XFER_SIZE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Minimum recommended file transfer size. + POSIX_REC_MIN_XFER_SIZE = libc::_PC_REC_MIN_XFER_SIZE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "linux", target_os = "openbsd", target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Recommended file transfer buffer alignment. + POSIX_REC_XFER_ALIGN = libc::_PC_REC_XFER_ALIGN, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "netbsd", + target_os = "openbsd", target_os = "redox", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Maximum number of bytes in a symbolic link. + SYMLINK_MAX = libc::_PC_SYMLINK_MAX, + /// The use of `chown` and `fchown` is restricted to a process with + /// appropriate privileges, and to changing the group ID of a file only to + /// the effective group ID of the process or to one of its supplementary + /// group IDs. + _POSIX_CHOWN_RESTRICTED = libc::_PC_CHOWN_RESTRICTED, + /// Pathname components longer than {NAME_MAX} generate an error. + _POSIX_NO_TRUNC = libc::_PC_NO_TRUNC, + /// This symbol shall be defined to be the value of a character that shall + /// disable terminal special character handling. + _POSIX_VDISABLE = libc::_PC_VDISABLE, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "openbsd", + target_os = "redox", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Asynchronous input or output operations may be performed for the + /// associated file. + _POSIX_ASYNC_IO = libc::_PC_ASYNC_IO, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "openbsd", + target_os = "redox", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Prioritized input or output operations may be performed for the + /// associated file. + _POSIX_PRIO_IO = libc::_PC_PRIO_IO, + #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", + target_os = "illumos", target_os = "linux", target_os = "netbsd", + target_os = "openbsd", target_os = "redox", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Synchronized input or output operations may be performed for the + /// associated file. + _POSIX_SYNC_IO = libc::_PC_SYNC_IO, + #[cfg(any(target_os = "dragonfly", target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The resolution in nanoseconds for all file timestamps. + _POSIX_TIMESTAMP_RESOLUTION = libc::_PC_TIMESTAMP_RESOLUTION +} + +/// Like `pathconf`, but works with file descriptors instead of paths (see +/// [fpathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html)) +/// +/// # Parameters +/// +/// - `fd`: The file descriptor whose variable should be interrogated +/// - `var`: The pathconf variable to lookup +/// +/// # Returns +/// +/// - `Ok(Some(x))`: the variable's limit (for limit variables) or its +/// implementation level (for option variables). Implementation levels are +/// usually a decimal-coded date, such as 200112 for POSIX 2001.12 +/// - `Ok(None)`: the variable has no limit (for limit variables) or is +/// unsupported (for option variables) +/// - `Err(x)`: an error occurred +pub fn fpathconf(fd: RawFd, var: PathconfVar) -> Result> { + let raw = unsafe { + Errno::clear(); + libc::fpathconf(fd, var as c_int) + }; + if raw == -1 { + if errno::errno() == 0 { + Ok(None) + } else { + Err(Errno::last()) + } + } else { + Ok(Some(raw)) + } +} + +/// Get path-dependent configurable system variables (see +/// [pathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html)) +/// +/// Returns the value of a path-dependent configurable system variable. Most +/// supported variables also have associated compile-time constants, but POSIX +/// allows their values to change at runtime. There are generally two types of +/// `pathconf` variables: options and limits. See [pathconf(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pathconf.html) for more details. +/// +/// # Parameters +/// +/// - `path`: Lookup the value of `var` for this file or directory +/// - `var`: The `pathconf` variable to lookup +/// +/// # Returns +/// +/// - `Ok(Some(x))`: the variable's limit (for limit variables) or its +/// implementation level (for option variables). Implementation levels are +/// usually a decimal-coded date, such as 200112 for POSIX 2001.12 +/// - `Ok(None)`: the variable has no limit (for limit variables) or is +/// unsupported (for option variables) +/// - `Err(x)`: an error occurred +pub fn pathconf(path: &P, var: PathconfVar) -> Result> { + let raw = path.with_nix_path(|cstr| { + unsafe { + Errno::clear(); + libc::pathconf(cstr.as_ptr(), var as c_int) + } + })?; + if raw == -1 { + if errno::errno() == 0 { + Ok(None) + } else { + Err(Errno::last()) + } + } else { + Ok(Some(raw)) + } +} +} + +feature! { +#![feature = "feature"] + +/// Variable names for `sysconf` +/// +/// Nix uses the same naming convention for these variables as the +/// [getconf(1)](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html) utility. +/// That is, `SysconfVar` variables have the same name as the abstract variables +/// shown in the `sysconf(3)` man page. Usually, it's the same as the C +/// variable name without the leading `_SC_`. +/// +/// All of these symbols are standardized by POSIX 1003.1-2008, but haven't been +/// implemented by all platforms. +/// +/// # References +/// +/// - [sysconf(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html) +/// - [unistd.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html) +/// - [limits.h](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[repr(i32)] +#[non_exhaustive] +pub enum SysconfVar { + /// Maximum number of I/O operations in a single list I/O call supported by + /// the implementation. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AIO_LISTIO_MAX = libc::_SC_AIO_LISTIO_MAX, + /// Maximum number of outstanding asynchronous I/O operations supported by + /// the implementation. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + AIO_MAX = libc::_SC_AIO_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The maximum amount by which a process can decrease its asynchronous I/O + /// priority level from its own scheduling priority. + AIO_PRIO_DELTA_MAX = libc::_SC_AIO_PRIO_DELTA_MAX, + /// Maximum length of argument to the exec functions including environment data. + ARG_MAX = libc::_SC_ARG_MAX, + /// Maximum number of functions that may be registered with `atexit`. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + ATEXIT_MAX = libc::_SC_ATEXIT_MAX, + /// Maximum obase values allowed by the bc utility. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BC_BASE_MAX = libc::_SC_BC_BASE_MAX, + /// Maximum number of elements permitted in an array by the bc utility. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BC_DIM_MAX = libc::_SC_BC_DIM_MAX, + /// Maximum scale value allowed by the bc utility. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BC_SCALE_MAX = libc::_SC_BC_SCALE_MAX, + /// Maximum length of a string constant accepted by the bc utility. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + BC_STRING_MAX = libc::_SC_BC_STRING_MAX, + /// Maximum number of simultaneous processes per real user ID. + CHILD_MAX = libc::_SC_CHILD_MAX, + // The number of clock ticks per second. + CLK_TCK = libc::_SC_CLK_TCK, + /// Maximum number of weights that can be assigned to an entry of the + /// LC_COLLATE order keyword in the locale definition file + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + COLL_WEIGHTS_MAX = libc::_SC_COLL_WEIGHTS_MAX, + /// Maximum number of timer expiration overruns. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + DELAYTIMER_MAX = libc::_SC_DELAYTIMER_MAX, + /// Maximum number of expressions that can be nested within parentheses by + /// the expr utility. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + EXPR_NEST_MAX = libc::_SC_EXPR_NEST_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Maximum length of a host name (not including the terminating null) as + /// returned from the `gethostname` function + HOST_NAME_MAX = libc::_SC_HOST_NAME_MAX, + /// Maximum number of iovec structures that one process has available for + /// use with `readv` or `writev`. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + IOV_MAX = libc::_SC_IOV_MAX, + /// Unless otherwise noted, the maximum length, in bytes, of a utility's + /// input line (either standard input or another file), when the utility is + /// described as processing text files. The length includes room for the + /// trailing . + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + LINE_MAX = libc::_SC_LINE_MAX, + /// Maximum length of a login name. + #[cfg(not(target_os = "haiku"))] + LOGIN_NAME_MAX = libc::_SC_LOGIN_NAME_MAX, + /// Maximum number of simultaneous supplementary group IDs per process. + NGROUPS_MAX = libc::_SC_NGROUPS_MAX, + /// Initial size of `getgrgid_r` and `getgrnam_r` data buffers + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + GETGR_R_SIZE_MAX = libc::_SC_GETGR_R_SIZE_MAX, + /// Initial size of `getpwuid_r` and `getpwnam_r` data buffers + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + GETPW_R_SIZE_MAX = libc::_SC_GETPW_R_SIZE_MAX, + /// The maximum number of open message queue descriptors a process may hold. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MQ_OPEN_MAX = libc::_SC_MQ_OPEN_MAX, + /// The maximum number of message priorities supported by the implementation. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + MQ_PRIO_MAX = libc::_SC_MQ_PRIO_MAX, + /// A value one greater than the maximum value that the system may assign to + /// a newly-created file descriptor. + OPEN_MAX = libc::_SC_OPEN_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Advisory Information option. + _POSIX_ADVISORY_INFO = libc::_SC_ADVISORY_INFO, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports barriers. + _POSIX_BARRIERS = libc::_SC_BARRIERS, + /// The implementation supports asynchronous input and output. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_ASYNCHRONOUS_IO = libc::_SC_ASYNCHRONOUS_IO, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports clock selection. + _POSIX_CLOCK_SELECTION = libc::_SC_CLOCK_SELECTION, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Process CPU-Time Clocks option. + _POSIX_CPUTIME = libc::_SC_CPUTIME, + /// The implementation supports the File Synchronization option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_FSYNC = libc::_SC_FSYNC, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the IPv6 option. + _POSIX_IPV6 = libc::_SC_IPV6, + /// The implementation supports job control. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_JOB_CONTROL = libc::_SC_JOB_CONTROL, + /// The implementation supports memory mapped Files. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MAPPED_FILES = libc::_SC_MAPPED_FILES, + /// The implementation supports the Process Memory Locking option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MEMLOCK = libc::_SC_MEMLOCK, + /// The implementation supports the Range Memory Locking option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MEMLOCK_RANGE = libc::_SC_MEMLOCK_RANGE, + /// The implementation supports memory protection. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MEMORY_PROTECTION = libc::_SC_MEMORY_PROTECTION, + /// The implementation supports the Message Passing option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MESSAGE_PASSING = libc::_SC_MESSAGE_PASSING, + /// The implementation supports the Monotonic Clock option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_MONOTONIC_CLOCK = libc::_SC_MONOTONIC_CLOCK, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "illumos", target_os = "ios", target_os="linux", + target_os = "macos", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Prioritized Input and Output option. + _POSIX_PRIORITIZED_IO = libc::_SC_PRIORITIZED_IO, + /// The implementation supports the Process Scheduling option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_PRIORITY_SCHEDULING = libc::_SC_PRIORITY_SCHEDULING, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Raw Sockets option. + _POSIX_RAW_SOCKETS = libc::_SC_RAW_SOCKETS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports read-write locks. + _POSIX_READER_WRITER_LOCKS = libc::_SC_READER_WRITER_LOCKS, + #[cfg(any(target_os = "android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports realtime signals. + _POSIX_REALTIME_SIGNALS = libc::_SC_REALTIME_SIGNALS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "illumos", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd", target_os = "solaris"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Regular Expression Handling option. + _POSIX_REGEXP = libc::_SC_REGEXP, + /// Each process has a saved set-user-ID and a saved set-group-ID. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_SAVED_IDS = libc::_SC_SAVED_IDS, + /// The implementation supports semaphores. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_SEMAPHORES = libc::_SC_SEMAPHORES, + /// The implementation supports the Shared Memory Objects option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_SHARED_MEMORY_OBJECTS = libc::_SC_SHARED_MEMORY_OBJECTS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the POSIX shell. + _POSIX_SHELL = libc::_SC_SHELL, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Spawn option. + _POSIX_SPAWN = libc::_SC_SPAWN, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports spin locks. + _POSIX_SPIN_LOCKS = libc::_SC_SPIN_LOCKS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Process Sporadic Server option. + _POSIX_SPORADIC_SERVER = libc::_SC_SPORADIC_SERVER, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_SS_REPL_MAX = libc::_SC_SS_REPL_MAX, + /// The implementation supports the Synchronized Input and Output option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_SYNCHRONIZED_IO = libc::_SC_SYNCHRONIZED_IO, + /// The implementation supports the Thread Stack Address Attribute option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_ATTR_STACKADDR = libc::_SC_THREAD_ATTR_STACKADDR, + /// The implementation supports the Thread Stack Size Attribute option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_ATTR_STACKSIZE = libc::_SC_THREAD_ATTR_STACKSIZE, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="netbsd", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Thread CPU-Time Clocks option. + _POSIX_THREAD_CPUTIME = libc::_SC_THREAD_CPUTIME, + /// The implementation supports the Non-Robust Mutex Priority Inheritance + /// option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_PRIO_INHERIT = libc::_SC_THREAD_PRIO_INHERIT, + /// The implementation supports the Non-Robust Mutex Priority Protection option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_PRIO_PROTECT = libc::_SC_THREAD_PRIO_PROTECT, + /// The implementation supports the Thread Execution Scheduling option. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_PRIORITY_SCHEDULING = libc::_SC_THREAD_PRIORITY_SCHEDULING, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Thread Process-Shared Synchronization + /// option. + _POSIX_THREAD_PROCESS_SHARED = libc::_SC_THREAD_PROCESS_SHARED, + #[cfg(any(target_os="dragonfly", target_os="linux", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Robust Mutex Priority Inheritance option. + _POSIX_THREAD_ROBUST_PRIO_INHERIT = libc::_SC_THREAD_ROBUST_PRIO_INHERIT, + #[cfg(any(target_os="dragonfly", target_os="linux", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Robust Mutex Priority Protection option. + _POSIX_THREAD_ROBUST_PRIO_PROTECT = libc::_SC_THREAD_ROBUST_PRIO_PROTECT, + /// The implementation supports thread-safe functions. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREAD_SAFE_FUNCTIONS = libc::_SC_THREAD_SAFE_FUNCTIONS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Thread Sporadic Server option. + _POSIX_THREAD_SPORADIC_SERVER = libc::_SC_THREAD_SPORADIC_SERVER, + /// The implementation supports threads. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_THREADS = libc::_SC_THREADS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports timeouts. + _POSIX_TIMEOUTS = libc::_SC_TIMEOUTS, + /// The implementation supports timers. + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_TIMERS = libc::_SC_TIMERS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Trace option. + _POSIX_TRACE = libc::_SC_TRACE, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Trace Event Filter option. + _POSIX_TRACE_EVENT_FILTER = libc::_SC_TRACE_EVENT_FILTER, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_TRACE_EVENT_NAME_MAX = libc::_SC_TRACE_EVENT_NAME_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Trace Inherit option. + _POSIX_TRACE_INHERIT = libc::_SC_TRACE_INHERIT, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Trace Log option. + _POSIX_TRACE_LOG = libc::_SC_TRACE_LOG, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_TRACE_NAME_MAX = libc::_SC_TRACE_NAME_MAX, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_TRACE_SYS_MAX = libc::_SC_TRACE_SYS_MAX, + #[cfg(any(target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX_TRACE_USER_EVENT_MAX = libc::_SC_TRACE_USER_EVENT_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Typed Memory Objects option. + _POSIX_TYPED_MEMORY_OBJECTS = libc::_SC_TYPED_MEMORY_OBJECTS, + /// Integer value indicating version of this standard (C-language binding) + /// to which the implementation conforms. For implementations conforming to + /// POSIX.1-2008, the value shall be 200809L. + _POSIX_VERSION = libc::_SC_VERSION, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation provides a C-language compilation environment with + /// 32-bit `int`, `long`, `pointer`, and `off_t` types. + _POSIX_V6_ILP32_OFF32 = libc::_SC_V6_ILP32_OFF32, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation provides a C-language compilation environment with + /// 32-bit `int`, `long`, and pointer types and an `off_t` type using at + /// least 64 bits. + _POSIX_V6_ILP32_OFFBIG = libc::_SC_V6_ILP32_OFFBIG, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation provides a C-language compilation environment with + /// 32-bit `int` and 64-bit `long`, `pointer`, and `off_t` types. + _POSIX_V6_LP64_OFF64 = libc::_SC_V6_LP64_OFF64, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation provides a C-language compilation environment with an + /// `int` type using at least 32 bits and `long`, pointer, and `off_t` types + /// using at least 64 bits. + _POSIX_V6_LPBIG_OFFBIG = libc::_SC_V6_LPBIG_OFFBIG, + /// The implementation supports the C-Language Binding option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_C_BIND = libc::_SC_2_C_BIND, + /// The implementation supports the C-Language Development Utilities option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_C_DEV = libc::_SC_2_C_DEV, + /// The implementation supports the Terminal Characteristics option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_CHAR_TERM = libc::_SC_2_CHAR_TERM, + /// The implementation supports the FORTRAN Development Utilities option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_FORT_DEV = libc::_SC_2_FORT_DEV, + /// The implementation supports the FORTRAN Runtime Utilities option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_FORT_RUN = libc::_SC_2_FORT_RUN, + /// The implementation supports the creation of locales by the localedef + /// utility. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_LOCALEDEF = libc::_SC_2_LOCALEDEF, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Batch Environment Services and Utilities + /// option. + _POSIX2_PBS = libc::_SC_2_PBS, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Batch Accounting option. + _POSIX2_PBS_ACCOUNTING = libc::_SC_2_PBS_ACCOUNTING, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Batch Checkpoint/Restart option. + _POSIX2_PBS_CHECKPOINT = libc::_SC_2_PBS_CHECKPOINT, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Locate Batch Job Request option. + _POSIX2_PBS_LOCATE = libc::_SC_2_PBS_LOCATE, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Batch Job Message Request option. + _POSIX2_PBS_MESSAGE = libc::_SC_2_PBS_MESSAGE, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Track Batch Job Request option. + _POSIX2_PBS_TRACK = libc::_SC_2_PBS_TRACK, + /// The implementation supports the Software Development Utilities option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_SW_DEV = libc::_SC_2_SW_DEV, + /// The implementation supports the User Portability Utilities option. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_UPE = libc::_SC_2_UPE, + /// Integer value indicating version of the Shell and Utilities volume of + /// POSIX.1 to which the implementation conforms. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _POSIX2_VERSION = libc::_SC_2_VERSION, + /// The size of a system page in bytes. + /// + /// POSIX also defines an alias named `PAGESIZE`, but Rust does not allow two + /// enum constants to have the same value, so nix omits `PAGESIZE`. + PAGE_SIZE = libc::_SC_PAGE_SIZE, + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTHREAD_DESTRUCTOR_ITERATIONS = libc::_SC_THREAD_DESTRUCTOR_ITERATIONS, + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTHREAD_KEYS_MAX = libc::_SC_THREAD_KEYS_MAX, + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTHREAD_STACK_MIN = libc::_SC_THREAD_STACK_MIN, + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + PTHREAD_THREADS_MAX = libc::_SC_THREAD_THREADS_MAX, + #[cfg(not(target_os = "haiku"))] + RE_DUP_MAX = libc::_SC_RE_DUP_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + RTSIG_MAX = libc::_SC_RTSIG_MAX, + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SEM_NSEMS_MAX = libc::_SC_SEM_NSEMS_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SEM_VALUE_MAX = libc::_SC_SEM_VALUE_MAX, + #[cfg(any(target_os = "android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os = "openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SIGQUEUE_MAX = libc::_SC_SIGQUEUE_MAX, + STREAM_MAX = libc::_SC_STREAM_MAX, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="netbsd", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + SYMLOOP_MAX = libc::_SC_SYMLOOP_MAX, + #[cfg(not(target_os = "redox"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + TIMER_MAX = libc::_SC_TIMER_MAX, + TTY_NAME_MAX = libc::_SC_TTY_NAME_MAX, + TZNAME_MAX = libc::_SC_TZNAME_MAX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the X/Open Encryption Option Group. + _XOPEN_CRYPT = libc::_SC_XOPEN_CRYPT, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the Issue 4, Version 2 Enhanced + /// Internationalization Option Group. + _XOPEN_ENH_I18N = libc::_SC_XOPEN_ENH_I18N, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _XOPEN_LEGACY = libc::_SC_XOPEN_LEGACY, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the X/Open Realtime Option Group. + _XOPEN_REALTIME = libc::_SC_XOPEN_REALTIME, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the X/Open Realtime Threads Option Group. + _XOPEN_REALTIME_THREADS = libc::_SC_XOPEN_REALTIME_THREADS, + /// The implementation supports the Issue 4, Version 2 Shared Memory Option + /// Group. + #[cfg(not(any(target_os = "redox", target_os = "haiku")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + _XOPEN_SHM = libc::_SC_XOPEN_SHM, + #[cfg(any(target_os="dragonfly", target_os="freebsd", target_os = "ios", + target_os="linux", target_os = "macos", target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the XSI STREAMS Option Group. + _XOPEN_STREAMS = libc::_SC_XOPEN_STREAMS, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// The implementation supports the XSI option + _XOPEN_UNIX = libc::_SC_XOPEN_UNIX, + #[cfg(any(target_os="android", target_os="dragonfly", target_os="freebsd", + target_os = "ios", target_os="linux", target_os = "macos", + target_os="openbsd"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + /// Integer value indicating version of the X/Open Portability Guide to + /// which the implementation conforms. + _XOPEN_VERSION = libc::_SC_XOPEN_VERSION, + /// The number of pages of physical memory. Note that it is possible for + /// the product of this value to overflow. + #[cfg(any(target_os="android", target_os="linux"))] + _PHYS_PAGES = libc::_SC_PHYS_PAGES, + /// The number of currently available pages of physical memory. + #[cfg(any(target_os="android", target_os="linux"))] + _AVPHYS_PAGES = libc::_SC_AVPHYS_PAGES, + /// The number of processors configured. + #[cfg(any(target_os="android", target_os="linux"))] + _NPROCESSORS_CONF = libc::_SC_NPROCESSORS_CONF, + /// The number of processors currently online (available). + #[cfg(any(target_os="android", target_os="linux"))] + _NPROCESSORS_ONLN = libc::_SC_NPROCESSORS_ONLN, +} + +/// Get configurable system variables (see +/// [sysconf(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html)) +/// +/// Returns the value of a configurable system variable. Most supported +/// variables also have associated compile-time constants, but POSIX +/// allows their values to change at runtime. There are generally two types of +/// sysconf variables: options and limits. See sysconf(3) for more details. +/// +/// # Returns +/// +/// - `Ok(Some(x))`: the variable's limit (for limit variables) or its +/// implementation level (for option variables). Implementation levels are +/// usually a decimal-coded date, such as 200112 for POSIX 2001.12 +/// - `Ok(None)`: the variable has no limit (for limit variables) or is +/// unsupported (for option variables) +/// - `Err(x)`: an error occurred +pub fn sysconf(var: SysconfVar) -> Result> { + let raw = unsafe { + Errno::clear(); + libc::sysconf(var as c_int) + }; + if raw == -1 { + if errno::errno() == 0 { + Ok(None) + } else { + Err(Errno::last()) + } + } else { + Ok(Some(raw)) + } +} +} + +feature! { +#![feature = "fs"] + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod pivot_root { + use crate::{Result, NixPath}; + use crate::errno::Errno; + + pub fn pivot_root( + new_root: &P1, put_old: &P2) -> Result<()> { + let res = new_root.with_nix_path(|new_root| { + put_old.with_nix_path(|put_old| { + unsafe { + libc::syscall(libc::SYS_pivot_root, new_root.as_ptr(), put_old.as_ptr()) + } + }) + })??; + + Errno::result(res).map(drop) + } +} +} + +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd" +))] +mod setres { + feature! { + #![feature = "user"] + + use crate::Result; + use crate::errno::Errno; + use super::{Uid, Gid}; + + /// Sets the real, effective, and saved uid. + /// ([see setresuid(2)](https://man7.org/linux/man-pages/man2/setresuid.2.html)) + /// + /// * `ruid`: real user id + /// * `euid`: effective user id + /// * `suid`: saved user id + /// * returns: Ok or libc error code. + /// + /// Err is returned if the user doesn't have permission to set this UID. + #[inline] + pub fn setresuid(ruid: Uid, euid: Uid, suid: Uid) -> Result<()> { + let res = unsafe { libc::setresuid(ruid.into(), euid.into(), suid.into()) }; + + Errno::result(res).map(drop) + } + + /// Sets the real, effective, and saved gid. + /// ([see setresuid(2)](https://man7.org/linux/man-pages/man2/setresuid.2.html)) + /// + /// * `rgid`: real group id + /// * `egid`: effective group id + /// * `sgid`: saved group id + /// * returns: Ok or libc error code. + /// + /// Err is returned if the user doesn't have permission to set this GID. + #[inline] + pub fn setresgid(rgid: Gid, egid: Gid, sgid: Gid) -> Result<()> { + let res = unsafe { libc::setresgid(rgid.into(), egid.into(), sgid.into()) }; + + Errno::result(res).map(drop) + } + } +} + +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd" +))] +mod getres { + feature! { + #![feature = "user"] + + use crate::Result; + use crate::errno::Errno; + use super::{Uid, Gid}; + + /// Real, effective and saved user IDs. + #[derive(Debug, Copy, Clone, Eq, PartialEq)] + pub struct ResUid { + pub real: Uid, + pub effective: Uid, + pub saved: Uid + } + + /// Real, effective and saved group IDs. + #[derive(Debug, Copy, Clone, Eq, PartialEq)] + pub struct ResGid { + pub real: Gid, + pub effective: Gid, + pub saved: Gid + } + + /// Gets the real, effective, and saved user IDs. + /// + /// ([see getresuid(2)](http://man7.org/linux/man-pages/man2/getresuid.2.html)) + /// + /// #Returns + /// + /// - `Ok((Uid, Uid, Uid))`: tuple of real, effective and saved uids on success. + /// - `Err(x)`: libc error code on failure. + /// + #[inline] + pub fn getresuid() -> Result { + let mut ruid = libc::uid_t::max_value(); + let mut euid = libc::uid_t::max_value(); + let mut suid = libc::uid_t::max_value(); + let res = unsafe { libc::getresuid(&mut ruid, &mut euid, &mut suid) }; + + Errno::result(res).map(|_| ResUid{ real: Uid(ruid), effective: Uid(euid), saved: Uid(suid) }) + } + + /// Gets the real, effective, and saved group IDs. + /// + /// ([see getresgid(2)](http://man7.org/linux/man-pages/man2/getresgid.2.html)) + /// + /// #Returns + /// + /// - `Ok((Gid, Gid, Gid))`: tuple of real, effective and saved gids on success. + /// - `Err(x)`: libc error code on failure. + /// + #[inline] + pub fn getresgid() -> Result { + let mut rgid = libc::gid_t::max_value(); + let mut egid = libc::gid_t::max_value(); + let mut sgid = libc::gid_t::max_value(); + let res = unsafe { libc::getresgid(&mut rgid, &mut egid, &mut sgid) }; + + Errno::result(res).map(|_| ResGid { real: Gid(rgid), effective: Gid(egid), saved: Gid(sgid) } ) + } + } +} + +#[cfg(feature = "fs")] +libc_bitflags! { + /// Options for access() + #[cfg_attr(docsrs, doc(cfg(feature = "fs")))] + pub struct AccessFlags : c_int { + /// Test for existence of file. + F_OK; + /// Test for read permission. + R_OK; + /// Test for write permission. + W_OK; + /// Test for execute (search) permission. + X_OK; + } +} + +feature! { +#![feature = "fs"] + +/// Checks the file named by `path` for accessibility according to the flags given by `amode` +/// See [access(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html) +pub fn access(path: &P, amode: AccessFlags) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::access(cstr.as_ptr(), amode.bits) + } + })?; + Errno::result(res).map(drop) +} + +/// Checks the file named by `path` for accessibility according to the flags given by `mode` +/// +/// If `dirfd` has a value, then `path` is relative to directory associated with the file descriptor. +/// +/// If `dirfd` is `None`, then `path` is relative to the current working directory. +/// +/// # References +/// +/// [faccessat(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/faccessat.html) +// illumos: faccessat(2) appears to be supported, but the libc crate does not provide a binding. +// redox: does not appear to support the *at family of syscalls. +#[cfg(not(any(target_os = "illumos", target_os = "redox")))] +pub fn faccessat(dirfd: Option, path: &P, mode: AccessFlags, flags: AtFlags) -> Result<()> { + let res = path.with_nix_path(|cstr| { + unsafe { + libc::faccessat(at_rawfd(dirfd), cstr.as_ptr(), mode.bits(), flags.bits()) + } + })?; + Errno::result(res).map(drop) +} +} + +feature! { +#![feature = "user"] + +/// Representation of a User, based on `libc::passwd` +/// +/// The reason some fields in this struct are `String` and others are `CString` is because some +/// fields are based on the user's locale, which could be non-UTF8, while other fields are +/// guaranteed to conform to [`NAME_REGEX`](https://serverfault.com/a/73101/407341), which only +/// contains ASCII. +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct User { + /// Username + pub name: String, + /// User password (probably hashed) + pub passwd: CString, + /// User ID + pub uid: Uid, + /// Group ID + pub gid: Gid, + /// User information + #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] + pub gecos: CString, + /// Home directory + pub dir: PathBuf, + /// Path to shell + pub shell: PathBuf, + /// Login class + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub class: CString, + /// Last password change + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub change: libc::time_t, + /// Expiration time of account + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + #[cfg_attr(docsrs, doc(cfg(all())))] + pub expire: libc::time_t +} + +#[cfg(not(target_os = "redox"))] //RedoxFS does not support passwd +impl From<&libc::passwd> for User { + fn from(pw: &libc::passwd) -> User { + unsafe { + User { + name: CStr::from_ptr(pw.pw_name).to_string_lossy().into_owned(), + passwd: CString::new(CStr::from_ptr(pw.pw_passwd).to_bytes()).unwrap(), + #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] + gecos: CString::new(CStr::from_ptr(pw.pw_gecos).to_bytes()).unwrap(), + dir: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_dir).to_bytes())), + shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_shell).to_bytes())), + uid: Uid::from_raw(pw.pw_uid), + gid: Gid::from_raw(pw.pw_gid), + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + class: CString::new(CStr::from_ptr(pw.pw_class).to_bytes()).unwrap(), + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + change: pw.pw_change, + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + expire: pw.pw_expire + } + } + } +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl From for libc::passwd { + fn from(u: User) -> Self { + let name = match CString::new(u.name) { + Ok(n) => n.into_raw(), + Err(_) => CString::new("").unwrap().into_raw(), + }; + let dir = match u.dir.into_os_string().into_string() { + Ok(s) => CString::new(s.as_str()).unwrap().into_raw(), + Err(_) => CString::new("").unwrap().into_raw(), + }; + let shell = match u.shell.into_os_string().into_string() { + Ok(s) => CString::new(s.as_str()).unwrap().into_raw(), + Err(_) => CString::new("").unwrap().into_raw(), + }; + Self { + pw_name: name, + pw_passwd: u.passwd.into_raw(), + #[cfg(not(all(target_os = "android", target_pointer_width = "32")))] + pw_gecos: u.gecos.into_raw(), + pw_dir: dir, + pw_shell: shell, + pw_uid: u.uid.0, + pw_gid: u.gid.0, + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pw_class: u.class.into_raw(), + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pw_change: u.change, + #[cfg(not(any(target_os = "android", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos", + target_os = "linux", + target_os = "solaris")))] + pw_expire: u.expire, + #[cfg(target_os = "illumos")] + pw_age: CString::new("").unwrap().into_raw(), + #[cfg(target_os = "illumos")] + pw_comment: CString::new("").unwrap().into_raw(), + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + pw_fields: 0, + } + } +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl User { + fn from_anything(f: F) -> Result> + where + F: Fn(*mut libc::passwd, + *mut c_char, + libc::size_t, + *mut *mut libc::passwd) -> libc::c_int + { + let buflimit = 1048576; + let bufsize = match sysconf(SysconfVar::GETPW_R_SIZE_MAX) { + Ok(Some(n)) => n as usize, + Ok(None) | Err(_) => 16384, + }; + + let mut cbuf = Vec::with_capacity(bufsize); + let mut pwd = mem::MaybeUninit::::uninit(); + let mut res = ptr::null_mut(); + + loop { + let error = f(pwd.as_mut_ptr(), cbuf.as_mut_ptr(), cbuf.capacity(), &mut res); + if error == 0 { + if res.is_null() { + return Ok(None); + } else { + let pwd = unsafe { pwd.assume_init() }; + return Ok(Some(User::from(&pwd))); + } + } else if Errno::last() == Errno::ERANGE { + // Trigger the internal buffer resizing logic. + reserve_double_buffer_size(&mut cbuf, buflimit)?; + } else { + return Err(Errno::last()); + } + } + } + + /// Get a user by UID. + /// + /// Internally, this function calls + /// [getpwuid_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + /// ``` + /// use nix::unistd::{Uid, User}; + /// // Returns an Result>, thus the double unwrap. + /// let res = User::from_uid(Uid::from_raw(0)).unwrap().unwrap(); + /// assert_eq!(res.name, "root"); + /// ``` + pub fn from_uid(uid: Uid) -> Result> { + User::from_anything(|pwd, cbuf, cap, res| { + unsafe { libc::getpwuid_r(uid.0, pwd, cbuf, cap, res) } + }) + } + + /// Get a user by name. + /// + /// Internally, this function calls + /// [getpwnam_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + /// ``` + /// use nix::unistd::User; + /// // Returns an Result>, thus the double unwrap. + /// let res = User::from_name("root").unwrap().unwrap(); + /// assert_eq!(res.name, "root"); + /// ``` + pub fn from_name(name: &str) -> Result> { + let name = CString::new(name).unwrap(); + User::from_anything(|pwd, cbuf, cap, res| { + unsafe { libc::getpwnam_r(name.as_ptr(), pwd, cbuf, cap, res) } + }) + } +} + +/// Representation of a Group, based on `libc::group` +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct Group { + /// Group name + pub name: String, + /// Group password + pub passwd: CString, + /// Group ID + pub gid: Gid, + /// List of Group members + pub mem: Vec +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl From<&libc::group> for Group { + fn from(gr: &libc::group) -> Group { + unsafe { + Group { + name: CStr::from_ptr(gr.gr_name).to_string_lossy().into_owned(), + passwd: CString::new(CStr::from_ptr(gr.gr_passwd).to_bytes()).unwrap(), + gid: Gid::from_raw(gr.gr_gid), + mem: Group::members(gr.gr_mem) + } + } + } +} + +#[cfg(not(target_os = "redox"))] // RedoxFS does not support passwd +impl Group { + unsafe fn members(mem: *mut *mut c_char) -> Vec { + let mut ret = Vec::new(); + + for i in 0.. { + let u = mem.offset(i); + if (*u).is_null() { + break; + } else { + let s = CStr::from_ptr(*u).to_string_lossy().into_owned(); + ret.push(s); + } + } + + ret + } + + fn from_anything(f: F) -> Result> + where + F: Fn(*mut libc::group, + *mut c_char, + libc::size_t, + *mut *mut libc::group) -> libc::c_int + { + let buflimit = 1048576; + let bufsize = match sysconf(SysconfVar::GETGR_R_SIZE_MAX) { + Ok(Some(n)) => n as usize, + Ok(None) | Err(_) => 16384, + }; + + let mut cbuf = Vec::with_capacity(bufsize); + let mut grp = mem::MaybeUninit::::uninit(); + let mut res = ptr::null_mut(); + + loop { + let error = f(grp.as_mut_ptr(), cbuf.as_mut_ptr(), cbuf.capacity(), &mut res); + if error == 0 { + if res.is_null() { + return Ok(None); + } else { + let grp = unsafe { grp.assume_init() }; + return Ok(Some(Group::from(&grp))); + } + } else if Errno::last() == Errno::ERANGE { + // Trigger the internal buffer resizing logic. + reserve_double_buffer_size(&mut cbuf, buflimit)?; + } else { + return Err(Errno::last()); + } + } + } + + /// Get a group by GID. + /// + /// Internally, this function calls + /// [getgrgid_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + // Disable this test on all OS except Linux as root group may not exist. + #[cfg_attr(not(target_os = "linux"), doc = " ```no_run")] + #[cfg_attr(target_os = "linux", doc = " ```")] + /// use nix::unistd::{Gid, Group}; + /// // Returns an Result>, thus the double unwrap. + /// let res = Group::from_gid(Gid::from_raw(0)).unwrap().unwrap(); + /// assert!(res.name == "root"); + /// ``` + pub fn from_gid(gid: Gid) -> Result> { + Group::from_anything(|grp, cbuf, cap, res| { + unsafe { libc::getgrgid_r(gid.0, grp, cbuf, cap, res) } + }) + } + + /// Get a group by name. + /// + /// Internally, this function calls + /// [getgrnam_r(3)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html) + /// + /// # Examples + /// + // Disable this test on all OS except Linux as root group may not exist. + #[cfg_attr(not(target_os = "linux"), doc = " ```no_run")] + #[cfg_attr(target_os = "linux", doc = " ```")] + /// use nix::unistd::Group; + /// // Returns an Result>, thus the double unwrap. + /// let res = Group::from_name("root").unwrap().unwrap(); + /// assert!(res.name == "root"); + /// ``` + pub fn from_name(name: &str) -> Result> { + let name = CString::new(name).unwrap(); + Group::from_anything(|grp, cbuf, cap, res| { + unsafe { libc::getgrnam_r(name.as_ptr(), grp, cbuf, cap, res) } + }) + } +} +} + +feature! { +#![feature = "term"] + +/// Get the name of the terminal device that is open on file descriptor fd +/// (see [`ttyname(3)`](https://man7.org/linux/man-pages/man3/ttyname.3.html)). +#[cfg(not(target_os = "fuchsia"))] +pub fn ttyname(fd: RawFd) -> Result { + const PATH_MAX: usize = libc::PATH_MAX as usize; + let mut buf = vec![0_u8; PATH_MAX]; + let c_buf = buf.as_mut_ptr() as *mut libc::c_char; + + let ret = unsafe { libc::ttyname_r(fd, c_buf, buf.len()) }; + if ret != 0 { + return Err(Errno::from_i32(ret)); + } + + let nul = buf.iter().position(|c| *c == b'\0').unwrap(); + buf.truncate(nul); + Ok(OsString::from_vec(buf).into()) +} +} + +feature! { +#![all(feature = "socket", feature = "user")] + +/// Get the effective user ID and group ID associated with a Unix domain socket. +/// +/// See also [getpeereid(3)](https://www.freebsd.org/cgi/man.cgi?query=getpeereid) +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +pub fn getpeereid(fd: RawFd) -> Result<(Uid, Gid)> { + let mut uid = 1; + let mut gid = 1; + + let ret = unsafe { libc::getpeereid(fd, &mut uid, &mut gid) }; + + Errno::result(ret).map(|_| (Uid(uid), Gid(gid))) +} +} + +feature! { +#![all(feature = "fs")] + +/// Set the file flags. +/// +/// See also [chflags(2)](https://www.freebsd.org/cgi/man.cgi?query=chflags&sektion=2) +#[cfg(any( + target_os = "openbsd", + target_os = "netbsd", + target_os = "freebsd", + target_os = "dragonfly", + target_os = "macos", + target_os = "ios" +))] +pub fn chflags(path: &P, flags: FileFlag) -> Result<()> { + let res = path.with_nix_path(|cstr| unsafe { + libc::chflags(cstr.as_ptr(), flags.bits()) + })?; + + Errno::result(res).map(drop) +} +} diff --git a/bash-5.1/vendor/nix/test/common/mod.rs b/bash-5.1/vendor/nix/test/common/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..bb056aab87c5c637e2e1c7bcafe03fc2bf2b8f2a --- /dev/null +++ b/bash-5.1/vendor/nix/test/common/mod.rs @@ -0,0 +1,149 @@ +use cfg_if::cfg_if; + +#[macro_export] +macro_rules! skip { + ($($reason: expr),+) => { + use ::std::io::{self, Write}; + + let stderr = io::stderr(); + let mut handle = stderr.lock(); + writeln!(handle, $($reason),+).unwrap(); + return; + } +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + #[macro_export] macro_rules! require_capability { + ($name:expr, $capname:ident) => { + use ::caps::{Capability, CapSet, has_cap}; + + if !has_cap(None, CapSet::Effective, Capability::$capname) + .unwrap() + { + skip!("{} requires capability {}. Skipping test.", $name, Capability::$capname); + } + } + } + } else if #[cfg(not(target_os = "redox"))] { + #[macro_export] macro_rules! require_capability { + ($name:expr, $capname:ident) => {} + } + } +} + +/// Skip the test if we don't have the ability to mount file systems. +#[cfg(target_os = "freebsd")] +#[macro_export] +macro_rules! require_mount { + ($name:expr) => { + use ::sysctl::{CtlValue, Sysctl}; + use nix::unistd::Uid; + + let ctl = ::sysctl::Ctl::new("vfs.usermount").unwrap(); + if !Uid::current().is_root() && CtlValue::Int(0) == ctl.value().unwrap() + { + skip!( + "{} requires the ability to mount file systems. Skipping test.", + $name + ); + } + }; +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +#[macro_export] +macro_rules! skip_if_cirrus { + ($reason:expr) => { + if std::env::var_os("CIRRUS_CI").is_some() { + skip!("{}", $reason); + } + }; +} + +#[cfg(target_os = "freebsd")] +#[macro_export] +macro_rules! skip_if_jailed { + ($name:expr) => { + use ::sysctl::{CtlValue, Sysctl}; + + let ctl = ::sysctl::Ctl::new("security.jail.jailed").unwrap(); + if let CtlValue::Int(1) = ctl.value().unwrap() { + skip!("{} cannot run in a jail. Skipping test.", $name); + } + }; +} + +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +#[macro_export] +macro_rules! skip_if_not_root { + ($name:expr) => { + use nix::unistd::Uid; + + if !Uid::current().is_root() { + skip!("{} requires root privileges. Skipping test.", $name); + } + }; +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + #[macro_export] macro_rules! skip_if_seccomp { + ($name:expr) => { + if let Ok(s) = std::fs::read_to_string("/proc/self/status") { + for l in s.lines() { + let mut fields = l.split_whitespace(); + if fields.next() == Some("Seccomp:") && + fields.next() != Some("0") + { + skip!("{} cannot be run in Seccomp mode. Skipping test.", + stringify!($name)); + } + } + } + } + } + } else if #[cfg(not(target_os = "redox"))] { + #[macro_export] macro_rules! skip_if_seccomp { + ($name:expr) => {} + } + } +} + +cfg_if! { + if #[cfg(target_os = "linux")] { + #[macro_export] macro_rules! require_kernel_version { + ($name:expr, $version_requirement:expr) => { + use semver::{Version, VersionReq}; + + let version_requirement = VersionReq::parse($version_requirement) + .expect("Bad match_version provided"); + + let uname = nix::sys::utsname::uname().unwrap(); + println!("{}", uname.sysname().to_str().unwrap()); + println!("{}", uname.nodename().to_str().unwrap()); + println!("{}", uname.release().to_str().unwrap()); + println!("{}", uname.version().to_str().unwrap()); + println!("{}", uname.machine().to_str().unwrap()); + + // Fix stuff that the semver parser can't handle + let fixed_release = &uname.release().to_str().unwrap().to_string() + // Fedora 33 reports version as 4.18.el8_2.x86_64 or + // 5.18.200-fc33.x86_64. Remove the underscore. + .replace("_", "-") + // Cirrus-CI reports version as 4.19.112+ . Remove the + + .replace("+", ""); + let mut version = Version::parse(fixed_release).unwrap(); + + //Keep only numeric parts + version.pre = semver::Prerelease::EMPTY; + version.build = semver::BuildMetadata::EMPTY; + + if !version_requirement.matches(&version) { + skip!("Skip {} because kernel version `{}` doesn't match the requirement `{}`", + stringify!($name), version, version_requirement); + } + } + } + } +} diff --git a/bash-5.1/vendor/nix/test/sys/mod.rs b/bash-5.1/vendor/nix/test/sys/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..20312120a68c0e8fdae69dfeb58680f725fb40ca --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/mod.rs @@ -0,0 +1,60 @@ +mod test_signal; + +// NOTE: DragonFly lacks a kernel-level implementation of Posix AIO as of +// this writing. There is an user-level implementation, but whether aio +// works or not heavily depends on which pthread implementation is chosen +// by the user at link time. For this reason we do not want to run aio test +// cases on DragonFly. +#[cfg(any( + target_os = "freebsd", + target_os = "ios", + all(target_os = "linux", not(target_env = "uclibc")), + target_os = "macos", + target_os = "netbsd" +))] +mod test_aio; +#[cfg(not(any( + target_os = "redox", + target_os = "fuchsia", + target_os = "haiku" +)))] +mod test_ioctl; +#[cfg(not(target_os = "redox"))] +mod test_mman; +#[cfg(not(target_os = "redox"))] +mod test_select; +#[cfg(target_os = "linux")] +mod test_signalfd; +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +mod test_socket; +#[cfg(not(any(target_os = "redox")))] +mod test_sockopt; +mod test_stat; +#[cfg(any(target_os = "android", target_os = "linux"))] +mod test_sysinfo; +#[cfg(not(any( + target_os = "redox", + target_os = "fuchsia", + target_os = "haiku" +)))] +mod test_termios; +mod test_uio; +mod test_wait; + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod test_epoll; +#[cfg(target_os = "linux")] +mod test_inotify; +mod test_pthread; +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd" +))] +mod test_ptrace; +#[cfg(any(target_os = "android", target_os = "linux"))] +mod test_timerfd; diff --git a/bash-5.1/vendor/nix/test/sys/test_aio.rs b/bash-5.1/vendor/nix/test/sys/test_aio.rs new file mode 100644 index 0000000000000000000000000000000000000000..6a36f3e7cf0cbd759ef82c2923261b2e52d04c94 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_aio.rs @@ -0,0 +1,626 @@ +use std::{ + io::{Read, Seek, SeekFrom, Write}, + ops::Deref, + os::unix::io::AsRawFd, + pin::Pin, + sync::atomic::{AtomicBool, Ordering}, + thread, time, +}; + +use libc::c_int; +use nix::{ + errno::*, + sys::{ + aio::*, + signal::{ + sigaction, SaFlags, SigAction, SigHandler, SigSet, SigevNotify, + Signal, + }, + time::{TimeSpec, TimeValLike}, + }, +}; +use tempfile::tempfile; + +lazy_static! { + pub static ref SIGNALED: AtomicBool = AtomicBool::new(false); +} + +extern "C" fn sigfunc(_: c_int) { + SIGNALED.store(true, Ordering::Relaxed); +} + +// Helper that polls an AioCb for completion or error +macro_rules! poll_aio { + ($aiocb: expr) => { + loop { + let err = $aiocb.as_mut().error(); + if err != Err(Errno::EINPROGRESS) { + break err; + }; + thread::sleep(time::Duration::from_millis(10)); + } + }; +} + +mod aio_fsync { + use super::*; + + #[test] + fn test_accessors() { + let aiocb = AioFsync::new( + 1001, + AioFsyncMode::O_SYNC, + 42, + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 99, + }, + ); + assert_eq!(1001, aiocb.fd()); + assert_eq!(AioFsyncMode::O_SYNC, aiocb.mode()); + assert_eq!(42, aiocb.priority()); + let sev = aiocb.sigevent().sigevent(); + assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); + assert_eq!(99, sev.sigev_value.sival_ptr as i64); + } + + /// `AioFsync::submit` should not modify the `AioCb` object if + /// `libc::aio_fsync` returns an error + // Skip on Linux, because Linux's AIO implementation can't detect errors + // synchronously + #[test] + #[cfg(any(target_os = "freebsd", target_os = "macos"))] + fn error() { + use std::mem; + + const INITIAL: &[u8] = b"abcdef123456"; + // Create an invalid AioFsyncMode + let mode = unsafe { mem::transmute(666) }; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiof = Box::pin(AioFsync::new( + f.as_raw_fd(), + mode, + 0, + SigevNotify::SigevNone, + )); + let err = aiof.as_mut().submit(); + err.expect_err("assertion failed"); + } + + #[test] + #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] + fn ok() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let fd = f.as_raw_fd(); + let mut aiof = Box::pin(AioFsync::new( + fd, + AioFsyncMode::O_SYNC, + 0, + SigevNotify::SigevNone, + )); + aiof.as_mut().submit().unwrap(); + poll_aio!(&mut aiof).unwrap(); + aiof.as_mut().aio_return().unwrap(); + } +} + +mod aio_read { + use super::*; + + #[test] + fn test_accessors() { + let mut rbuf = vec![0; 4]; + let aiocb = AioRead::new( + 1001, + 2, //offset + &mut rbuf, + 42, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 99, + }, + ); + assert_eq!(1001, aiocb.fd()); + assert_eq!(4, aiocb.nbytes()); + assert_eq!(2, aiocb.offset()); + assert_eq!(42, aiocb.priority()); + let sev = aiocb.sigevent().sigevent(); + assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); + assert_eq!(99, sev.sigev_value.sival_ptr as i64); + } + + // Tests AioWrite.cancel. We aren't trying to test the OS's implementation, + // only our bindings. So it's sufficient to check that cancel + // returned any AioCancelStat value. + #[test] + #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] + fn cancel() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let fd = f.as_raw_fd(); + let mut aior = + Box::pin(AioRead::new(fd, 2, &mut rbuf, 0, SigevNotify::SigevNone)); + aior.as_mut().submit().unwrap(); + + aior.as_mut().cancel().unwrap(); + + // Wait for aiow to complete, but don't care whether it succeeded + let _ = poll_aio!(&mut aior); + let _ = aior.as_mut().aio_return(); + } + + /// `AioRead::submit` should not modify the `AioCb` object if + /// `libc::aio_read` returns an error + // Skip on Linux, because Linux's AIO implementation can't detect errors + // synchronously + #[test] + #[cfg(any(target_os = "freebsd", target_os = "macos"))] + fn error() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aior = Box::pin(AioRead::new( + f.as_raw_fd(), + -1, //an invalid offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + )); + aior.as_mut().submit().expect_err("assertion failed"); + } + + // Test a simple aio operation with no completion notification. We must + // poll for completion + #[test] + #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] + fn ok() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + let fd = f.as_raw_fd(); + let mut aior = Box::pin(AioRead::new( + fd, + 2, + &mut rbuf, + 0, + SigevNotify::SigevNone, + )); + aior.as_mut().submit().unwrap(); + + let err = poll_aio!(&mut aior); + assert_eq!(err, Ok(())); + assert_eq!(aior.as_mut().aio_return().unwrap(), EXPECT.len()); + } + assert_eq!(EXPECT, rbuf.deref().deref()); + } + + // Like ok, but allocates the structure on the stack. + #[test] + #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] + fn on_stack() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf = vec![0; 4]; + const EXPECT: &[u8] = b"cdef"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + let fd = f.as_raw_fd(); + let mut aior = + AioRead::new(fd, 2, &mut rbuf, 0, SigevNotify::SigevNone); + let mut aior = unsafe { Pin::new_unchecked(&mut aior) }; + aior.as_mut().submit().unwrap(); + + let err = poll_aio!(&mut aior); + assert_eq!(err, Ok(())); + assert_eq!(aior.as_mut().aio_return().unwrap(), EXPECT.len()); + } + assert_eq!(EXPECT, rbuf.deref().deref()); + } +} + +#[cfg(target_os = "freebsd")] +#[cfg(fbsd14)] +mod aio_readv { + use std::io::IoSliceMut; + + use super::*; + + #[test] + fn test_accessors() { + let mut rbuf0 = vec![0; 4]; + let mut rbuf1 = vec![0; 8]; + let mut rbufs = + [IoSliceMut::new(&mut rbuf0), IoSliceMut::new(&mut rbuf1)]; + let aiocb = AioReadv::new( + 1001, + 2, //offset + &mut rbufs, + 42, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 99, + }, + ); + assert_eq!(1001, aiocb.fd()); + assert_eq!(2, aiocb.iovlen()); + assert_eq!(2, aiocb.offset()); + assert_eq!(42, aiocb.priority()); + let sev = aiocb.sigevent().sigevent(); + assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); + assert_eq!(99, sev.sigev_value.sival_ptr as i64); + } + + #[test] + #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] + fn ok() { + const INITIAL: &[u8] = b"abcdef123456"; + let mut rbuf0 = vec![0; 4]; + let mut rbuf1 = vec![0; 2]; + let mut rbufs = + [IoSliceMut::new(&mut rbuf0), IoSliceMut::new(&mut rbuf1)]; + const EXPECT0: &[u8] = b"cdef"; + const EXPECT1: &[u8] = b"12"; + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + { + let fd = f.as_raw_fd(); + let mut aior = Box::pin(AioReadv::new( + fd, + 2, + &mut rbufs, + 0, + SigevNotify::SigevNone, + )); + aior.as_mut().submit().unwrap(); + + let err = poll_aio!(&mut aior); + assert_eq!(err, Ok(())); + assert_eq!( + aior.as_mut().aio_return().unwrap(), + EXPECT0.len() + EXPECT1.len() + ); + } + assert_eq!(&EXPECT0, &rbuf0); + assert_eq!(&EXPECT1, &rbuf1); + } +} + +mod aio_write { + use super::*; + + #[test] + fn test_accessors() { + let wbuf = vec![0; 4]; + let aiocb = AioWrite::new( + 1001, + 2, //offset + &wbuf, + 42, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 99, + }, + ); + assert_eq!(1001, aiocb.fd()); + assert_eq!(4, aiocb.nbytes()); + assert_eq!(2, aiocb.offset()); + assert_eq!(42, aiocb.priority()); + let sev = aiocb.sigevent().sigevent(); + assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); + assert_eq!(99, sev.sigev_value.sival_ptr as i64); + } + + // Tests AioWrite.cancel. We aren't trying to test the OS's implementation, + // only our bindings. So it's sufficient to check that cancel + // returned any AioCancelStat value. + #[test] + #[cfg_attr(target_env = "musl", ignore)] + fn cancel() { + let wbuf: &[u8] = b"CDEF"; + + let f = tempfile().unwrap(); + let mut aiow = Box::pin(AioWrite::new( + f.as_raw_fd(), + 0, + wbuf, + 0, + SigevNotify::SigevNone, + )); + aiow.as_mut().submit().unwrap(); + let err = aiow.as_mut().error(); + assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); + + aiow.as_mut().cancel().unwrap(); + + // Wait for aiow to complete, but don't care whether it succeeded + let _ = poll_aio!(&mut aiow); + let _ = aiow.as_mut().aio_return(); + } + + // Test a simple aio operation with no completion notification. We must + // poll for completion. + #[test] + #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] + fn ok() { + const INITIAL: &[u8] = b"abcdef123456"; + let wbuf = "CDEF".to_string().into_bytes(); + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiow = Box::pin(AioWrite::new( + f.as_raw_fd(), + 2, + &wbuf, + 0, + SigevNotify::SigevNone, + )); + aiow.as_mut().submit().unwrap(); + + let err = poll_aio!(&mut aiow); + assert_eq!(err, Ok(())); + assert_eq!(aiow.as_mut().aio_return().unwrap(), wbuf.len()); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); + } + + // Like ok, but allocates the structure on the stack. + #[test] + #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] + fn on_stack() { + const INITIAL: &[u8] = b"abcdef123456"; + let wbuf = "CDEF".to_string().into_bytes(); + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiow = AioWrite::new( + f.as_raw_fd(), + 2, //offset + &wbuf, + 0, //priority + SigevNotify::SigevNone, + ); + let mut aiow = unsafe { Pin::new_unchecked(&mut aiow) }; + aiow.as_mut().submit().unwrap(); + + let err = poll_aio!(&mut aiow); + assert_eq!(err, Ok(())); + assert_eq!(aiow.as_mut().aio_return().unwrap(), wbuf.len()); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); + } + + /// `AioWrite::write` should not modify the `AioCb` object if + /// `libc::aio_write` returns an error. + // Skip on Linux, because Linux's AIO implementation can't detect errors + // synchronously + #[test] + #[cfg(any(target_os = "freebsd", target_os = "macos"))] + fn error() { + let wbuf = "CDEF".to_string().into_bytes(); + let mut aiow = Box::pin(AioWrite::new( + 666, // An invalid file descriptor + 0, //offset + &wbuf, + 0, //priority + SigevNotify::SigevNone, + )); + aiow.as_mut().submit().expect_err("assertion failed"); + // Dropping the AioWrite at this point should not panic + } +} + +#[cfg(target_os = "freebsd")] +#[cfg(fbsd14)] +mod aio_writev { + use std::io::IoSlice; + + use super::*; + + #[test] + fn test_accessors() { + let wbuf0 = vec![0; 4]; + let wbuf1 = vec![0; 8]; + let wbufs = [IoSlice::new(&wbuf0), IoSlice::new(&wbuf1)]; + let aiocb = AioWritev::new( + 1001, + 2, //offset + &wbufs, + 42, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 99, + }, + ); + assert_eq!(1001, aiocb.fd()); + assert_eq!(2, aiocb.iovlen()); + assert_eq!(2, aiocb.offset()); + assert_eq!(42, aiocb.priority()); + let sev = aiocb.sigevent().sigevent(); + assert_eq!(Signal::SIGUSR2 as i32, sev.sigev_signo); + assert_eq!(99, sev.sigev_value.sival_ptr as i64); + } + + // Test a simple aio operation with no completion notification. We must + // poll for completion. + #[test] + #[cfg_attr(all(target_env = "musl", target_arch = "x86_64"), ignore)] + fn ok() { + const INITIAL: &[u8] = b"abcdef123456"; + let wbuf0 = b"BC"; + let wbuf1 = b"DEF"; + let wbufs = [IoSlice::new(wbuf0), IoSlice::new(wbuf1)]; + let wlen = wbuf0.len() + wbuf1.len(); + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"aBCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiow = Box::pin(AioWritev::new( + f.as_raw_fd(), + 1, + &wbufs, + 0, + SigevNotify::SigevNone, + )); + aiow.as_mut().submit().unwrap(); + + let err = poll_aio!(&mut aiow); + assert_eq!(err, Ok(())); + assert_eq!(aiow.as_mut().aio_return().unwrap(), wlen); + + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); + } +} + +// Test an aio operation with completion delivered by a signal +#[test] +#[cfg_attr( + any( + all(target_env = "musl", target_arch = "x86_64"), + target_arch = "mips", + target_arch = "mips64" + ), + ignore +)] +fn sigev_signal() { + let _m = crate::SIGNAL_MTX.lock(); + let sa = SigAction::new( + SigHandler::Handler(sigfunc), + SaFlags::SA_RESETHAND, + SigSet::empty(), + ); + SIGNALED.store(false, Ordering::Relaxed); + unsafe { sigaction(Signal::SIGUSR2, &sa) }.unwrap(); + + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEF"; + let mut rbuf = Vec::new(); + const EXPECT: &[u8] = b"abCDEF123456"; + + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + let mut aiow = Box::pin(AioWrite::new( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevSignal { + signal: Signal::SIGUSR2, + si_value: 0, //TODO: validate in sigfunc + }, + )); + aiow.as_mut().submit().unwrap(); + while !SIGNALED.load(Ordering::Relaxed) { + thread::sleep(time::Duration::from_millis(10)); + } + + assert_eq!(aiow.as_mut().aio_return().unwrap(), WBUF.len()); + f.seek(SeekFrom::Start(0)).unwrap(); + let len = f.read_to_end(&mut rbuf).unwrap(); + assert_eq!(len, EXPECT.len()); + assert_eq!(rbuf, EXPECT); +} + +// Tests using aio_cancel_all for all outstanding IOs. +#[test] +#[cfg_attr(target_env = "musl", ignore)] +fn test_aio_cancel_all() { + let wbuf: &[u8] = b"CDEF"; + + let f = tempfile().unwrap(); + let mut aiocb = Box::pin(AioWrite::new( + f.as_raw_fd(), + 0, //offset + wbuf, + 0, //priority + SigevNotify::SigevNone, + )); + aiocb.as_mut().submit().unwrap(); + let err = aiocb.as_mut().error(); + assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS)); + + aio_cancel_all(f.as_raw_fd()).unwrap(); + + // Wait for aiocb to complete, but don't care whether it succeeded + let _ = poll_aio!(&mut aiocb); + let _ = aiocb.as_mut().aio_return(); +} + +#[test] +// On Cirrus on Linux, this test fails due to a glibc bug. +// https://github.com/nix-rust/nix/issues/1099 +#[cfg_attr(target_os = "linux", ignore)] +// On Cirrus, aio_suspend is failing with EINVAL +// https://github.com/nix-rust/nix/issues/1361 +#[cfg_attr(target_os = "macos", ignore)] +fn test_aio_suspend() { + const INITIAL: &[u8] = b"abcdef123456"; + const WBUF: &[u8] = b"CDEFG"; + let timeout = TimeSpec::seconds(10); + let mut rbuf = vec![0; 4]; + let rlen = rbuf.len(); + let mut f = tempfile().unwrap(); + f.write_all(INITIAL).unwrap(); + + let mut wcb = Box::pin(AioWrite::new( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + )); + + let mut rcb = Box::pin(AioRead::new( + f.as_raw_fd(), + 8, //offset + &mut rbuf, + 0, //priority + SigevNotify::SigevNone, + )); + wcb.as_mut().submit().unwrap(); + rcb.as_mut().submit().unwrap(); + loop { + { + let cbbuf = [ + &*wcb as &dyn AsRef, + &*rcb as &dyn AsRef, + ]; + let r = aio_suspend(&cbbuf[..], Some(timeout)); + match r { + Err(Errno::EINTR) => continue, + Err(e) => panic!("aio_suspend returned {:?}", e), + Ok(_) => (), + }; + } + if rcb.as_mut().error() != Err(Errno::EINPROGRESS) + && wcb.as_mut().error() != Err(Errno::EINPROGRESS) + { + break; + } + } + + assert_eq!(wcb.as_mut().aio_return().unwrap(), WBUF.len()); + assert_eq!(rcb.as_mut().aio_return().unwrap(), rlen); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_aio_drop.rs b/bash-5.1/vendor/nix/test/sys/test_aio_drop.rs new file mode 100644 index 0000000000000000000000000000000000000000..bbe6623fd77a06a9c37f9f9352163cd92e547abb --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_aio_drop.rs @@ -0,0 +1,35 @@ +// Test dropping an AioCb that hasn't yet finished. +// This must happen in its own process, because on OSX this test seems to hose +// the AIO subsystem and causes subsequent tests to fail +#[test] +#[should_panic(expected = "Dropped an in-progress AioCb")] +#[cfg(all( + not(target_env = "musl"), + not(target_env = "uclibc"), + any( + target_os = "linux", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd" + ) +))] +fn test_drop() { + use nix::sys::aio::*; + use nix::sys::signal::*; + use std::os::unix::io::AsRawFd; + use tempfile::tempfile; + + const WBUF: &[u8] = b"CDEF"; + + let f = tempfile().unwrap(); + f.set_len(6).unwrap(); + let mut aiocb = Box::pin(AioWrite::new( + f.as_raw_fd(), + 2, //offset + WBUF, + 0, //priority + SigevNotify::SigevNone, + )); + aiocb.as_mut().submit().unwrap(); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_epoll.rs b/bash-5.1/vendor/nix/test/sys/test_epoll.rs new file mode 100644 index 0000000000000000000000000000000000000000..915691595c4f6aa1f962f4f13e54ba5235c07444 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_epoll.rs @@ -0,0 +1,24 @@ +use nix::errno::Errno; +use nix::sys::epoll::{epoll_create1, epoll_ctl}; +use nix::sys::epoll::{EpollCreateFlags, EpollEvent, EpollFlags, EpollOp}; + +#[test] +pub fn test_epoll_errno() { + let efd = epoll_create1(EpollCreateFlags::empty()).unwrap(); + let result = epoll_ctl(efd, EpollOp::EpollCtlDel, 1, None); + result.expect_err("assertion failed"); + assert_eq!(result.unwrap_err(), Errno::ENOENT); + + let result = epoll_ctl(efd, EpollOp::EpollCtlAdd, 1, None); + result.expect_err("assertion failed"); + assert_eq!(result.unwrap_err(), Errno::EINVAL); +} + +#[test] +pub fn test_epoll_ctl() { + let efd = epoll_create1(EpollCreateFlags::empty()).unwrap(); + let mut event = + EpollEvent::new(EpollFlags::EPOLLIN | EpollFlags::EPOLLERR, 1); + epoll_ctl(efd, EpollOp::EpollCtlAdd, 1, &mut event).unwrap(); + epoll_ctl(efd, EpollOp::EpollCtlDel, 1, None).unwrap(); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_inotify.rs b/bash-5.1/vendor/nix/test/sys/test_inotify.rs new file mode 100644 index 0000000000000000000000000000000000000000..bb5851a903c54f2ada91a54a4ab4ca463f8192d4 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_inotify.rs @@ -0,0 +1,65 @@ +use nix::errno::Errno; +use nix::sys::inotify::{AddWatchFlags, InitFlags, Inotify}; +use std::ffi::OsString; +use std::fs::{rename, File}; + +#[test] +pub fn test_inotify() { + let instance = Inotify::init(InitFlags::IN_NONBLOCK).unwrap(); + let tempdir = tempfile::tempdir().unwrap(); + + instance + .add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS) + .unwrap(); + + let events = instance.read_events(); + assert_eq!(events.unwrap_err(), Errno::EAGAIN); + + File::create(tempdir.path().join("test")).unwrap(); + + let events = instance.read_events().unwrap(); + assert_eq!(events[0].name, Some(OsString::from("test"))); +} + +#[test] +pub fn test_inotify_multi_events() { + let instance = Inotify::init(InitFlags::IN_NONBLOCK).unwrap(); + let tempdir = tempfile::tempdir().unwrap(); + + instance + .add_watch(tempdir.path(), AddWatchFlags::IN_ALL_EVENTS) + .unwrap(); + + let events = instance.read_events(); + assert_eq!(events.unwrap_err(), Errno::EAGAIN); + + File::create(tempdir.path().join("test")).unwrap(); + rename(tempdir.path().join("test"), tempdir.path().join("test2")).unwrap(); + + // Now there should be 5 events in queue: + // - IN_CREATE on test + // - IN_OPEN on test + // - IN_CLOSE_WRITE on test + // - IN_MOVED_FROM on test with a cookie + // - IN_MOVED_TO on test2 with the same cookie + + let events = instance.read_events().unwrap(); + assert_eq!(events.len(), 5); + + assert_eq!(events[0].mask, AddWatchFlags::IN_CREATE); + assert_eq!(events[0].name, Some(OsString::from("test"))); + + assert_eq!(events[1].mask, AddWatchFlags::IN_OPEN); + assert_eq!(events[1].name, Some(OsString::from("test"))); + + assert_eq!(events[2].mask, AddWatchFlags::IN_CLOSE_WRITE); + assert_eq!(events[2].name, Some(OsString::from("test"))); + + assert_eq!(events[3].mask, AddWatchFlags::IN_MOVED_FROM); + assert_eq!(events[3].name, Some(OsString::from("test"))); + + assert_eq!(events[4].mask, AddWatchFlags::IN_MOVED_TO); + assert_eq!(events[4].name, Some(OsString::from("test2"))); + + assert_eq!(events[3].cookie, events[4].cookie); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_ioctl.rs b/bash-5.1/vendor/nix/test/sys/test_ioctl.rs new file mode 100644 index 0000000000000000000000000000000000000000..7a603c5bbae3b8a2da228267cfcc753cdd37a078 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_ioctl.rs @@ -0,0 +1,368 @@ +#![allow(dead_code)] + +// Simple tests to ensure macro generated fns compile +ioctl_none_bad!(do_bad, 0x1234); +ioctl_read_bad!(do_bad_read, 0x1234, u16); +ioctl_write_int_bad!(do_bad_write_int, 0x1234); +ioctl_write_ptr_bad!(do_bad_write_ptr, 0x1234, u8); +ioctl_readwrite_bad!(do_bad_readwrite, 0x1234, u32); +ioctl_none!(do_none, 0, 0); +ioctl_read!(read_test, 0, 0, u32); +ioctl_write_int!(write_ptr_int, 0, 0); +ioctl_write_ptr!(write_ptr_u8, 0, 0, u8); +ioctl_write_ptr!(write_ptr_u32, 0, 0, u32); +ioctl_write_ptr!(write_ptr_u64, 0, 0, u64); +ioctl_readwrite!(readwrite_test, 0, 0, u64); +ioctl_read_buf!(readbuf_test, 0, 0, u32); +const SPI_IOC_MAGIC: u8 = b'k'; +const SPI_IOC_MESSAGE: u8 = 0; +ioctl_write_buf!(writebuf_test_consts, SPI_IOC_MAGIC, SPI_IOC_MESSAGE, u8); +ioctl_write_buf!(writebuf_test_u8, 0, 0, u8); +ioctl_write_buf!(writebuf_test_u32, 0, 0, u32); +ioctl_write_buf!(writebuf_test_u64, 0, 0, u64); +ioctl_readwrite_buf!(readwritebuf_test, 0, 0, u32); + +// See C code for source of values for op calculations (does NOT work for mips/powerpc): +// https://gist.github.com/posborne/83ea6880770a1aef332e +// +// TODO: Need a way to compute these constants at test time. Using precomputed +// values is fragile and needs to be maintained. + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod linux { + #[test] + fn test_op_none() { + if cfg!(any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc", + target_arch = "powerpc64" + )) { + assert_eq!(request_code_none!(b'q', 10) as u32, 0x2000_710A); + assert_eq!(request_code_none!(b'a', 255) as u32, 0x2000_61FF); + } else { + assert_eq!(request_code_none!(b'q', 10) as u32, 0x0000_710A); + assert_eq!(request_code_none!(b'a', 255) as u32, 0x0000_61FF); + } + } + + #[test] + fn test_op_write() { + if cfg!(any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc", + target_arch = "powerpc64" + )) { + assert_eq!(request_code_write!(b'z', 10, 1) as u32, 0x8001_7A0A); + assert_eq!(request_code_write!(b'z', 10, 512) as u32, 0x8200_7A0A); + } else { + assert_eq!(request_code_write!(b'z', 10, 1) as u32, 0x4001_7A0A); + assert_eq!(request_code_write!(b'z', 10, 512) as u32, 0x4200_7A0A); + } + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_write_64() { + if cfg!(any(target_arch = "mips64", target_arch = "powerpc64")) { + assert_eq!( + request_code_write!(b'z', 10, 1u64 << 32) as u32, + 0x8000_7A0A + ); + } else { + assert_eq!( + request_code_write!(b'z', 10, 1u64 << 32) as u32, + 0x4000_7A0A + ); + } + } + + #[test] + fn test_op_read() { + if cfg!(any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc", + target_arch = "powerpc64" + )) { + assert_eq!(request_code_read!(b'z', 10, 1) as u32, 0x4001_7A0A); + assert_eq!(request_code_read!(b'z', 10, 512) as u32, 0x4200_7A0A); + } else { + assert_eq!(request_code_read!(b'z', 10, 1) as u32, 0x8001_7A0A); + assert_eq!(request_code_read!(b'z', 10, 512) as u32, 0x8200_7A0A); + } + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_64() { + if cfg!(any(target_arch = "mips64", target_arch = "powerpc64")) { + assert_eq!( + request_code_read!(b'z', 10, 1u64 << 32) as u32, + 0x4000_7A0A + ); + } else { + assert_eq!( + request_code_read!(b'z', 10, 1u64 << 32) as u32, + 0x8000_7A0A + ); + } + } + + #[test] + fn test_op_read_write() { + assert_eq!(request_code_readwrite!(b'z', 10, 1) as u32, 0xC001_7A0A); + assert_eq!(request_code_readwrite!(b'z', 10, 512) as u32, 0xC200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_write_64() { + assert_eq!( + request_code_readwrite!(b'z', 10, 1u64 << 32) as u32, + 0xC000_7A0A + ); + } +} + +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd" +))] +mod bsd { + #[test] + fn test_op_none() { + assert_eq!(request_code_none!(b'q', 10), 0x2000_710A); + assert_eq!(request_code_none!(b'a', 255), 0x2000_61FF); + } + + #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] + #[test] + fn test_op_write_int() { + assert_eq!(request_code_write_int!(b'v', 4), 0x2004_7604); + assert_eq!(request_code_write_int!(b'p', 2), 0x2004_7002); + } + + #[test] + fn test_op_write() { + assert_eq!(request_code_write!(b'z', 10, 1), 0x8001_7A0A); + assert_eq!(request_code_write!(b'z', 10, 512), 0x8200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_write_64() { + assert_eq!(request_code_write!(b'z', 10, 1u64 << 32), 0x8000_7A0A); + } + + #[test] + fn test_op_read() { + assert_eq!(request_code_read!(b'z', 10, 1), 0x4001_7A0A); + assert_eq!(request_code_read!(b'z', 10, 512), 0x4200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_64() { + assert_eq!(request_code_read!(b'z', 10, 1u64 << 32), 0x4000_7A0A); + } + + #[test] + fn test_op_read_write() { + assert_eq!(request_code_readwrite!(b'z', 10, 1), 0xC001_7A0A); + assert_eq!(request_code_readwrite!(b'z', 10, 512), 0xC200_7A0A); + } + + #[cfg(target_pointer_width = "64")] + #[test] + fn test_op_read_write_64() { + assert_eq!(request_code_readwrite!(b'z', 10, 1u64 << 32), 0xC000_7A0A); + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +mod linux_ioctls { + use std::mem; + use std::os::unix::io::AsRawFd; + + use libc::{termios, TCGETS, TCSBRK, TCSETS, TIOCNXCL}; + use tempfile::tempfile; + + use nix::errno::Errno; + + ioctl_none_bad!(tiocnxcl, TIOCNXCL); + #[test] + fn test_ioctl_none_bad() { + let file = tempfile().unwrap(); + let res = unsafe { tiocnxcl(file.as_raw_fd()) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_read_bad!(tcgets, TCGETS, termios); + #[test] + fn test_ioctl_read_bad() { + let file = tempfile().unwrap(); + let mut termios = unsafe { mem::zeroed() }; + let res = unsafe { tcgets(file.as_raw_fd(), &mut termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_write_int_bad!(tcsbrk, TCSBRK); + #[test] + fn test_ioctl_write_int_bad() { + let file = tempfile().unwrap(); + let res = unsafe { tcsbrk(file.as_raw_fd(), 0) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_write_ptr_bad!(tcsets, TCSETS, termios); + #[test] + fn test_ioctl_write_ptr_bad() { + let file = tempfile().unwrap(); + let termios: termios = unsafe { mem::zeroed() }; + let res = unsafe { tcsets(file.as_raw_fd(), &termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + // FIXME: Find a suitable example for `ioctl_readwrite_bad` + + // From linux/videodev2.h + ioctl_none!(log_status, b'V', 70); + #[test] + fn test_ioctl_none() { + let file = tempfile().unwrap(); + let res = unsafe { log_status(file.as_raw_fd()) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + #[repr(C)] + pub struct v4l2_audio { + index: u32, + name: [u8; 32], + capability: u32, + mode: u32, + reserved: [u32; 2], + } + + // From linux/videodev2.h + ioctl_write_ptr!(s_audio, b'V', 34, v4l2_audio); + #[test] + fn test_ioctl_write_ptr() { + let file = tempfile().unwrap(); + let data: v4l2_audio = unsafe { mem::zeroed() }; + let res = unsafe { s_audio(file.as_raw_fd(), &data) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // From linux/net/bluetooth/hci_sock.h + const HCI_IOC_MAGIC: u8 = b'H'; + const HCI_IOC_HCIDEVUP: u8 = 201; + ioctl_write_int!(hcidevup, HCI_IOC_MAGIC, HCI_IOC_HCIDEVUP); + #[test] + fn test_ioctl_write_int() { + let file = tempfile().unwrap(); + let res = unsafe { hcidevup(file.as_raw_fd(), 0) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // From linux/videodev2.h + ioctl_read!(g_audio, b'V', 33, v4l2_audio); + #[test] + fn test_ioctl_read() { + let file = tempfile().unwrap(); + let mut data: v4l2_audio = unsafe { mem::zeroed() }; + let res = unsafe { g_audio(file.as_raw_fd(), &mut data) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // From linux/videodev2.h + ioctl_readwrite!(enum_audio, b'V', 65, v4l2_audio); + #[test] + fn test_ioctl_readwrite() { + let file = tempfile().unwrap(); + let mut data: v4l2_audio = unsafe { mem::zeroed() }; + let res = unsafe { enum_audio(file.as_raw_fd(), &mut data) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // FIXME: Find a suitable example for `ioctl_read_buf`. + + #[repr(C)] + pub struct spi_ioc_transfer { + tx_buf: u64, + rx_buf: u64, + len: u32, + speed_hz: u32, + delay_usecs: u16, + bits_per_word: u8, + cs_change: u8, + tx_nbits: u8, + rx_nbits: u8, + pad: u16, + } + + // From linux/spi/spidev.h + ioctl_write_buf!( + spi_ioc_message, + super::SPI_IOC_MAGIC, + super::SPI_IOC_MESSAGE, + spi_ioc_transfer + ); + #[test] + fn test_ioctl_write_buf() { + let file = tempfile().unwrap(); + let data: [spi_ioc_transfer; 4] = unsafe { mem::zeroed() }; + let res = unsafe { spi_ioc_message(file.as_raw_fd(), &data[..]) }; + assert!(res == Err(Errno::ENOTTY) || res == Err(Errno::ENOSYS)); + } + + // FIXME: Find a suitable example for `ioctl_readwrite_buf`. +} + +#[cfg(target_os = "freebsd")] +mod freebsd_ioctls { + use std::mem; + use std::os::unix::io::AsRawFd; + + use libc::termios; + use tempfile::tempfile; + + use nix::errno::Errno; + + // From sys/sys/ttycom.h + const TTY_IOC_MAGIC: u8 = b't'; + const TTY_IOC_TYPE_NXCL: u8 = 14; + const TTY_IOC_TYPE_GETA: u8 = 19; + const TTY_IOC_TYPE_SETA: u8 = 20; + + ioctl_none!(tiocnxcl, TTY_IOC_MAGIC, TTY_IOC_TYPE_NXCL); + #[test] + fn test_ioctl_none() { + let file = tempfile().unwrap(); + let res = unsafe { tiocnxcl(file.as_raw_fd()) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_read!(tiocgeta, TTY_IOC_MAGIC, TTY_IOC_TYPE_GETA, termios); + #[test] + fn test_ioctl_read() { + let file = tempfile().unwrap(); + let mut termios = unsafe { mem::zeroed() }; + let res = unsafe { tiocgeta(file.as_raw_fd(), &mut termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } + + ioctl_write_ptr!(tiocseta, TTY_IOC_MAGIC, TTY_IOC_TYPE_SETA, termios); + #[test] + fn test_ioctl_write_ptr() { + let file = tempfile().unwrap(); + let termios: termios = unsafe { mem::zeroed() }; + let res = unsafe { tiocseta(file.as_raw_fd(), &termios) }; + assert_eq!(res, Err(Errno::ENOTTY)); + } +} diff --git a/bash-5.1/vendor/nix/test/sys/test_mman.rs b/bash-5.1/vendor/nix/test/sys/test_mman.rs new file mode 100644 index 0000000000000000000000000000000000000000..75cbf6ce8cdabf57e0a5755e196c5c28f59f3611 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_mman.rs @@ -0,0 +1,117 @@ +use nix::sys::mman::{mmap, MapFlags, ProtFlags}; + +#[test] +fn test_mmap_anonymous() { + unsafe { + let ptr = mmap( + std::ptr::null_mut(), + 1, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_PRIVATE | MapFlags::MAP_ANONYMOUS, + -1, + 0, + ) + .unwrap() as *mut u8; + assert_eq!(*ptr, 0x00u8); + *ptr = 0xffu8; + assert_eq!(*ptr, 0xffu8); + } +} + +#[test] +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +fn test_mremap_grow() { + use nix::libc::{c_void, size_t}; + use nix::sys::mman::{mremap, MRemapFlags}; + + const ONE_K: size_t = 1024; + let slice: &mut [u8] = unsafe { + let mem = mmap( + std::ptr::null_mut(), + ONE_K, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, + -1, + 0, + ) + .unwrap(); + std::slice::from_raw_parts_mut(mem as *mut u8, ONE_K) + }; + assert_eq!(slice[ONE_K - 1], 0x00); + slice[ONE_K - 1] = 0xFF; + assert_eq!(slice[ONE_K - 1], 0xFF); + + let slice: &mut [u8] = unsafe { + #[cfg(target_os = "linux")] + let mem = mremap( + slice.as_mut_ptr() as *mut c_void, + ONE_K, + 10 * ONE_K, + MRemapFlags::MREMAP_MAYMOVE, + None, + ) + .unwrap(); + #[cfg(target_os = "netbsd")] + let mem = mremap( + slice.as_mut_ptr() as *mut c_void, + ONE_K, + 10 * ONE_K, + MRemapFlags::MAP_REMAPDUP, + None, + ) + .unwrap(); + std::slice::from_raw_parts_mut(mem as *mut u8, 10 * ONE_K) + }; + + // The first KB should still have the old data in it. + assert_eq!(slice[ONE_K - 1], 0xFF); + + // The additional range should be zero-init'd and accessible. + assert_eq!(slice[10 * ONE_K - 1], 0x00); + slice[10 * ONE_K - 1] = 0xFF; + assert_eq!(slice[10 * ONE_K - 1], 0xFF); +} + +#[test] +#[cfg(any(target_os = "linux", target_os = "netbsd"))] +// Segfaults for unknown reasons under QEMU for 32-bit targets +#[cfg_attr(all(target_pointer_width = "32", qemu), ignore)] +fn test_mremap_shrink() { + use nix::libc::{c_void, size_t}; + use nix::sys::mman::{mremap, MRemapFlags}; + + const ONE_K: size_t = 1024; + let slice: &mut [u8] = unsafe { + let mem = mmap( + std::ptr::null_mut(), + 10 * ONE_K, + ProtFlags::PROT_READ | ProtFlags::PROT_WRITE, + MapFlags::MAP_ANONYMOUS | MapFlags::MAP_PRIVATE, + -1, + 0, + ) + .unwrap(); + std::slice::from_raw_parts_mut(mem as *mut u8, ONE_K) + }; + assert_eq!(slice[ONE_K - 1], 0x00); + slice[ONE_K - 1] = 0xFF; + assert_eq!(slice[ONE_K - 1], 0xFF); + + let slice: &mut [u8] = unsafe { + let mem = mremap( + slice.as_mut_ptr() as *mut c_void, + 10 * ONE_K, + ONE_K, + MRemapFlags::empty(), + None, + ) + .unwrap(); + // Since we didn't supply MREMAP_MAYMOVE, the address should be the + // same. + assert_eq!(mem, slice.as_mut_ptr() as *mut c_void); + std::slice::from_raw_parts_mut(mem as *mut u8, ONE_K) + }; + + // The first KB should still be accessible and have the old data in it. + assert_eq!(slice[ONE_K - 1], 0xFF); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_pthread.rs b/bash-5.1/vendor/nix/test/sys/test_pthread.rs new file mode 100644 index 0000000000000000000000000000000000000000..ce048bae6019a3e6402e0e19c3a197ea8f6abdf9 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_pthread.rs @@ -0,0 +1,22 @@ +use nix::sys::pthread::*; + +#[cfg(any(target_env = "musl", target_os = "redox"))] +#[test] +fn test_pthread_self() { + let tid = pthread_self(); + assert!(!tid.is_null()); +} + +#[cfg(not(any(target_env = "musl", target_os = "redox")))] +#[test] +fn test_pthread_self() { + let tid = pthread_self(); + assert_ne!(tid, 0); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_pthread_kill_none() { + pthread_kill(pthread_self(), None) + .expect("Should be able to send signal to my thread."); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_ptrace.rs b/bash-5.1/vendor/nix/test/sys/test_ptrace.rs new file mode 100644 index 0000000000000000000000000000000000000000..530560fe175d815a3a288e366b05f9ad3e5cfa37 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_ptrace.rs @@ -0,0 +1,275 @@ +#[cfg(all( + target_os = "linux", + any(target_arch = "x86_64", target_arch = "x86"), + target_env = "gnu" +))] +use memoffset::offset_of; +use nix::errno::Errno; +use nix::sys::ptrace; +#[cfg(any(target_os = "android", target_os = "linux"))] +use nix::sys::ptrace::Options; +use nix::unistd::getpid; + +#[cfg(any(target_os = "android", target_os = "linux"))] +use std::mem; + +use crate::*; + +#[test] +fn test_ptrace() { + // Just make sure ptrace can be called at all, for now. + // FIXME: qemu-user doesn't implement ptrace on all arches, so permit ENOSYS + require_capability!("test_ptrace", CAP_SYS_PTRACE); + let err = ptrace::attach(getpid()).unwrap_err(); + assert!( + err == Errno::EPERM || err == Errno::EINVAL || err == Errno::ENOSYS + ); +} + +// Just make sure ptrace_setoptions can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_setoptions() { + require_capability!("test_ptrace_setoptions", CAP_SYS_PTRACE); + let err = ptrace::setoptions(getpid(), Options::PTRACE_O_TRACESYSGOOD) + .unwrap_err(); + assert_ne!(err, Errno::EOPNOTSUPP); +} + +// Just make sure ptrace_getevent can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_getevent() { + require_capability!("test_ptrace_getevent", CAP_SYS_PTRACE); + let err = ptrace::getevent(getpid()).unwrap_err(); + assert_ne!(err, Errno::EOPNOTSUPP); +} + +// Just make sure ptrace_getsiginfo can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_getsiginfo() { + require_capability!("test_ptrace_getsiginfo", CAP_SYS_PTRACE); + if let Err(Errno::EOPNOTSUPP) = ptrace::getsiginfo(getpid()) { + panic!("ptrace_getsiginfo returns Errno::EOPNOTSUPP!"); + } +} + +// Just make sure ptrace_setsiginfo can be called at all, for now. +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptrace_setsiginfo() { + require_capability!("test_ptrace_setsiginfo", CAP_SYS_PTRACE); + let siginfo = unsafe { mem::zeroed() }; + if let Err(Errno::EOPNOTSUPP) = ptrace::setsiginfo(getpid(), &siginfo) { + panic!("ptrace_setsiginfo returns Errno::EOPNOTSUPP!"); + } +} + +#[test] +fn test_ptrace_cont() { + use nix::sys::ptrace; + use nix::sys::signal::{raise, Signal}; + use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus}; + use nix::unistd::fork; + use nix::unistd::ForkResult::*; + + require_capability!("test_ptrace_cont", CAP_SYS_PTRACE); + + let _m = crate::FORK_MTX.lock(); + + // FIXME: qemu-user doesn't implement ptrace on all architectures + // and returns ENOSYS in this case. + // We (ab)use this behavior to detect the affected platforms + // and skip the test then. + // On valid platforms the ptrace call should return Errno::EPERM, this + // is already tested by `test_ptrace`. + let err = ptrace::attach(getpid()).unwrap_err(); + if err == Errno::ENOSYS { + return; + } + + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => { + ptrace::traceme().unwrap(); + // As recommended by ptrace(2), raise SIGTRAP to pause the child + // until the parent is ready to continue + loop { + raise(Signal::SIGTRAP).unwrap(); + } + } + Parent { child } => { + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::Stopped(child, Signal::SIGTRAP)) + ); + ptrace::cont(child, None).unwrap(); + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::Stopped(child, Signal::SIGTRAP)) + ); + ptrace::cont(child, Some(Signal::SIGKILL)).unwrap(); + match waitpid(child, None) { + Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) + if pid == child => + { + // FIXME It's been observed on some systems (apple) the + // tracee may not be killed but remain as a zombie process + // affecting other wait based tests. Add an extra kill just + // to make sure there are no zombies. + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + while ptrace::cont(child, Some(Signal::SIGKILL)).is_ok() { + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + } + } + _ => panic!("The process should have been killed"), + } + } + } +} + +#[cfg(target_os = "linux")] +#[test] +fn test_ptrace_interrupt() { + use nix::sys::ptrace; + use nix::sys::signal::Signal; + use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus}; + use nix::unistd::fork; + use nix::unistd::ForkResult::*; + use std::thread::sleep; + use std::time::Duration; + + require_capability!("test_ptrace_interrupt", CAP_SYS_PTRACE); + + let _m = crate::FORK_MTX.lock(); + + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => loop { + sleep(Duration::from_millis(1000)); + }, + Parent { child } => { + ptrace::seize(child, ptrace::Options::PTRACE_O_TRACESYSGOOD) + .unwrap(); + ptrace::interrupt(child).unwrap(); + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::PtraceEvent(child, Signal::SIGTRAP, 128)) + ); + ptrace::syscall(child, None).unwrap(); + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::PtraceSyscall(child)) + ); + ptrace::detach(child, Some(Signal::SIGKILL)).unwrap(); + match waitpid(child, None) { + Ok(WaitStatus::Signaled(pid, Signal::SIGKILL, _)) + if pid == child => + { + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + while ptrace::cont(child, Some(Signal::SIGKILL)).is_ok() { + let _ = waitpid(child, Some(WaitPidFlag::WNOHANG)); + } + } + _ => panic!("The process should have been killed"), + } + } + } +} + +// ptrace::{setoptions, getregs} are only available in these platforms +#[cfg(all( + target_os = "linux", + any(target_arch = "x86_64", target_arch = "x86"), + target_env = "gnu" +))] +#[test] +fn test_ptrace_syscall() { + use nix::sys::ptrace; + use nix::sys::signal::kill; + use nix::sys::signal::Signal; + use nix::sys::wait::{waitpid, WaitStatus}; + use nix::unistd::fork; + use nix::unistd::getpid; + use nix::unistd::ForkResult::*; + + require_capability!("test_ptrace_syscall", CAP_SYS_PTRACE); + + let _m = crate::FORK_MTX.lock(); + + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => { + ptrace::traceme().unwrap(); + // first sigstop until parent is ready to continue + let pid = getpid(); + kill(pid, Signal::SIGSTOP).unwrap(); + kill(pid, Signal::SIGTERM).unwrap(); + unsafe { + ::libc::_exit(0); + } + } + + Parent { child } => { + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::Stopped(child, Signal::SIGSTOP)) + ); + + // set this option to recognize syscall-stops + ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD) + .unwrap(); + + #[cfg(target_arch = "x86_64")] + let get_syscall_id = + || ptrace::getregs(child).unwrap().orig_rax as libc::c_long; + + #[cfg(target_arch = "x86")] + let get_syscall_id = + || ptrace::getregs(child).unwrap().orig_eax as libc::c_long; + + // this duplicates `get_syscall_id` for the purpose of testing `ptrace::read_user`. + #[cfg(target_arch = "x86_64")] + let rax_offset = offset_of!(libc::user_regs_struct, orig_rax); + #[cfg(target_arch = "x86")] + let rax_offset = offset_of!(libc::user_regs_struct, orig_eax); + + let get_syscall_from_user_area = || { + // Find the offset of `user.regs.rax` (or `user.regs.eax` for x86) + let rax_offset = offset_of!(libc::user, regs) + rax_offset; + ptrace::read_user(child, rax_offset as _).unwrap() + as libc::c_long + }; + + // kill entry + ptrace::syscall(child, None).unwrap(); + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::PtraceSyscall(child)) + ); + assert_eq!(get_syscall_id(), ::libc::SYS_kill); + assert_eq!(get_syscall_from_user_area(), ::libc::SYS_kill); + + // kill exit + ptrace::syscall(child, None).unwrap(); + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::PtraceSyscall(child)) + ); + assert_eq!(get_syscall_id(), ::libc::SYS_kill); + assert_eq!(get_syscall_from_user_area(), ::libc::SYS_kill); + + // receive signal + ptrace::syscall(child, None).unwrap(); + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::Stopped(child, Signal::SIGTERM)) + ); + + // inject signal + ptrace::syscall(child, Signal::SIGTERM).unwrap(); + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::Signaled(child, Signal::SIGTERM, false)) + ); + } + } +} diff --git a/bash-5.1/vendor/nix/test/sys/test_select.rs b/bash-5.1/vendor/nix/test/sys/test_select.rs new file mode 100644 index 0000000000000000000000000000000000000000..40bda4d90accabc03854b3d476525fa520b7bb94 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_select.rs @@ -0,0 +1,81 @@ +use nix::sys::select::*; +use nix::sys::signal::SigSet; +use nix::sys::time::{TimeSpec, TimeValLike}; +use nix::unistd::{pipe, write}; + +#[test] +pub fn test_pselect() { + let _mtx = crate::SIGNAL_MTX.lock(); + + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let timeout = TimeSpec::seconds(10); + let sigmask = SigSet::empty(); + assert_eq!( + 1, + pselect(None, &mut fd_set, None, None, &timeout, &sigmask).unwrap() + ); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); +} + +#[test] +pub fn test_pselect_nfds2() { + let (r1, w1) = pipe().unwrap(); + write(w1, b"hi!").unwrap(); + let (r2, _w2) = pipe().unwrap(); + + let mut fd_set = FdSet::new(); + fd_set.insert(r1); + fd_set.insert(r2); + + let timeout = TimeSpec::seconds(10); + assert_eq!( + 1, + pselect( + ::std::cmp::max(r1, r2) + 1, + &mut fd_set, + None, + None, + &timeout, + None + ) + .unwrap() + ); + assert!(fd_set.contains(r1)); + assert!(!fd_set.contains(r2)); +} + +macro_rules! generate_fdset_bad_fd_tests { + ($fd:expr, $($method:ident),* $(,)?) => { + $( + #[test] + #[should_panic] + fn $method() { + FdSet::new().$method($fd); + } + )* + } +} + +mod test_fdset_negative_fd { + use super::*; + generate_fdset_bad_fd_tests!(-1, insert, remove, contains); +} + +mod test_fdset_too_large_fd { + use super::*; + use std::convert::TryInto; + generate_fdset_bad_fd_tests!( + FD_SETSIZE.try_into().unwrap(), + insert, + remove, + contains, + ); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_signal.rs b/bash-5.1/vendor/nix/test/sys/test_signal.rs new file mode 100644 index 0000000000000000000000000000000000000000..3ad14f40c7ca97378bbed427ee3674fec877834d --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_signal.rs @@ -0,0 +1,147 @@ +#[cfg(not(target_os = "redox"))] +use nix::errno::Errno; +use nix::sys::signal::*; +use nix::unistd::*; +use std::convert::TryFrom; +use std::sync::atomic::{AtomicBool, Ordering}; + +#[test] +fn test_kill_none() { + kill(getpid(), None).expect("Should be able to send signal to myself."); +} + +#[test] +#[cfg(not(target_os = "fuchsia"))] +fn test_killpg_none() { + killpg(getpgrp(), None) + .expect("Should be able to send signal to my process group."); +} + +#[test] +fn test_old_sigaction_flags() { + let _m = crate::SIGNAL_MTX.lock(); + + extern "C" fn handler(_: ::libc::c_int) {} + let act = SigAction::new( + SigHandler::Handler(handler), + SaFlags::empty(), + SigSet::empty(), + ); + let oact = unsafe { sigaction(SIGINT, &act) }.unwrap(); + let _flags = oact.flags(); + let oact = unsafe { sigaction(SIGINT, &act) }.unwrap(); + let _flags = oact.flags(); +} + +#[test] +fn test_sigprocmask_noop() { + sigprocmask(SigmaskHow::SIG_BLOCK, None, None) + .expect("this should be an effective noop"); +} + +#[test] +fn test_sigprocmask() { + let _m = crate::SIGNAL_MTX.lock(); + + // This needs to be a signal that rust doesn't use in the test harness. + const SIGNAL: Signal = Signal::SIGCHLD; + + let mut old_signal_set = SigSet::empty(); + sigprocmask(SigmaskHow::SIG_BLOCK, None, Some(&mut old_signal_set)) + .expect("expect to be able to retrieve old signals"); + + // Make sure the old set doesn't contain the signal, otherwise the following + // test don't make sense. + assert!( + !old_signal_set.contains(SIGNAL), + "the {:?} signal is already blocked, please change to a \ + different one", + SIGNAL + ); + + // Now block the signal. + let mut signal_set = SigSet::empty(); + signal_set.add(SIGNAL); + sigprocmask(SigmaskHow::SIG_BLOCK, Some(&signal_set), None) + .expect("expect to be able to block signals"); + + // And test it again, to make sure the change was effective. + old_signal_set.clear(); + sigprocmask(SigmaskHow::SIG_BLOCK, None, Some(&mut old_signal_set)) + .expect("expect to be able to retrieve old signals"); + assert!( + old_signal_set.contains(SIGNAL), + "expected the {:?} to be blocked", + SIGNAL + ); + + // Reset the signal. + sigprocmask(SigmaskHow::SIG_UNBLOCK, Some(&signal_set), None) + .expect("expect to be able to block signals"); +} + +lazy_static! { + static ref SIGNALED: AtomicBool = AtomicBool::new(false); +} + +extern "C" fn test_sigaction_handler(signal: libc::c_int) { + let signal = Signal::try_from(signal).unwrap(); + SIGNALED.store(signal == Signal::SIGINT, Ordering::Relaxed); +} + +#[cfg(not(target_os = "redox"))] +extern "C" fn test_sigaction_action( + _: libc::c_int, + _: *mut libc::siginfo_t, + _: *mut libc::c_void, +) { +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_signal_sigaction() { + let _m = crate::SIGNAL_MTX.lock(); + + let action_handler = SigHandler::SigAction(test_sigaction_action); + assert_eq!( + unsafe { signal(Signal::SIGINT, action_handler) }.unwrap_err(), + Errno::ENOTSUP + ); +} + +#[test] +fn test_signal() { + let _m = crate::SIGNAL_MTX.lock(); + + unsafe { signal(Signal::SIGINT, SigHandler::SigIgn) }.unwrap(); + raise(Signal::SIGINT).unwrap(); + assert_eq!( + unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), + SigHandler::SigIgn + ); + + let handler = SigHandler::Handler(test_sigaction_handler); + assert_eq!( + unsafe { signal(Signal::SIGINT, handler) }.unwrap(), + SigHandler::SigDfl + ); + raise(Signal::SIGINT).unwrap(); + assert!(SIGNALED.load(Ordering::Relaxed)); + + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] + assert_eq!( + unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), + handler + ); + + // System V based OSes (e.g. illumos and Solaris) always resets the + // disposition to SIG_DFL prior to calling the signal handler + #[cfg(any(target_os = "illumos", target_os = "solaris"))] + assert_eq!( + unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(), + SigHandler::SigDfl + ); + + // Restore default signal handler + unsafe { signal(Signal::SIGINT, SigHandler::SigDfl) }.unwrap(); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_signalfd.rs b/bash-5.1/vendor/nix/test/sys/test_signalfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..87153c957204c632b3c292f0915f3c85e061fb55 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_signalfd.rs @@ -0,0 +1,27 @@ +use std::convert::TryFrom; + +#[test] +fn test_signalfd() { + use nix::sys::signal::{self, raise, SigSet, Signal}; + use nix::sys::signalfd::SignalFd; + + // Grab the mutex for altering signals so we don't interfere with other tests. + let _m = crate::SIGNAL_MTX.lock(); + + // Block the SIGUSR1 signal from automatic processing for this thread + let mut mask = SigSet::empty(); + mask.add(signal::SIGUSR1); + mask.thread_block().unwrap(); + + let mut fd = SignalFd::new(&mask).unwrap(); + + // Send a SIGUSR1 signal to the current process. Note that this uses `raise` instead of `kill` + // because `kill` with `getpid` isn't correct during multi-threaded execution like during a + // cargo test session. Instead use `raise` which does the correct thing by default. + raise(signal::SIGUSR1).expect("Error: raise(SIGUSR1) failed"); + + // And now catch that same signal. + let res = fd.read_signal().unwrap().unwrap(); + let signo = Signal::try_from(res.ssi_signo as i32).unwrap(); + assert_eq!(signo, signal::SIGUSR1); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_socket.rs b/bash-5.1/vendor/nix/test/sys/test_socket.rs new file mode 100644 index 0000000000000000000000000000000000000000..b4ca279d67bd85e81b7e09acfb50b39c5cc63df7 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_socket.rs @@ -0,0 +1,2557 @@ +#[cfg(any(target_os = "linux", target_os = "android"))] +use crate::*; +use libc::{c_char, sockaddr_storage}; +#[allow(deprecated)] +use nix::sys::socket::InetAddr; +use nix::sys::socket::{ + getsockname, sockaddr, sockaddr_in6, AddressFamily, UnixAddr, +}; +use std::collections::hash_map::DefaultHasher; +use std::hash::{Hash, Hasher}; +use std::mem::{self, MaybeUninit}; +use std::net::{self, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; +use std::os::unix::io::RawFd; +use std::path::Path; +use std::slice; +use std::str::FromStr; + +#[allow(deprecated)] +#[test] +pub fn test_inetv4_addr_to_sock_addr() { + let actual: net::SocketAddr = FromStr::from_str("127.0.0.1:3000").unwrap(); + let addr = InetAddr::from_std(&actual); + + match addr { + InetAddr::V4(addr) => { + let ip: u32 = 0x7f00_0001; + let port: u16 = 3000; + let saddr = addr.sin_addr.s_addr; + + assert_eq!(saddr, ip.to_be()); + assert_eq!(addr.sin_port, port.to_be()); + } + _ => panic!("nope"), + } + + assert_eq!(addr.to_string(), "127.0.0.1:3000"); + + let inet = addr.to_std(); + assert_eq!(actual, inet); +} + +#[allow(deprecated)] +#[test] +pub fn test_inetv4_addr_roundtrip_sockaddr_storage_to_addr() { + use nix::sys::socket::{sockaddr_storage_to_addr, SockAddr}; + + let actual: net::SocketAddr = FromStr::from_str("127.0.0.1:3000").unwrap(); + let addr = InetAddr::from_std(&actual); + let sockaddr = SockAddr::new_inet(addr); + + let (storage, ffi_size) = { + let mut storage = MaybeUninit::::zeroed(); + let storage_ptr = storage.as_mut_ptr().cast::(); + let (ffi_ptr, ffi_size) = sockaddr.as_ffi_pair(); + assert_eq!(mem::size_of::(), ffi_size as usize); + unsafe { + storage_ptr.copy_from_nonoverlapping(ffi_ptr as *const sockaddr, 1); + (storage.assume_init(), ffi_size) + } + }; + + let from_storage = + sockaddr_storage_to_addr(&storage, ffi_size as usize).unwrap(); + assert_eq!(from_storage, sockaddr); + let from_storage = + sockaddr_storage_to_addr(&storage, mem::size_of::()) + .unwrap(); + assert_eq!(from_storage, sockaddr); +} + +#[cfg(any(target_os = "linux"))] +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_timestamping() { + use nix::sys::socket::{ + recvmsg, sendmsg, setsockopt, socket, sockopt::Timestamping, + ControlMessageOwned, MsgFlags, SockFlag, SockType, SockaddrIn, + TimestampingFlag, + }; + use std::io::{IoSlice, IoSliceMut}; + + let sock_addr = SockaddrIn::from_str("127.0.0.1:6790").unwrap(); + + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + + let rsock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + nix::sys::socket::bind(rsock, &sock_addr).unwrap(); + + setsockopt(rsock, Timestamping, &TimestampingFlag::all()).unwrap(); + + let sbuf = [0u8; 2048]; + let mut rbuf = [0u8; 2048]; + let flags = MsgFlags::empty(); + let iov1 = [IoSlice::new(&sbuf)]; + let mut iov2 = [IoSliceMut::new(&mut rbuf)]; + + let mut cmsg = cmsg_space!(nix::sys::socket::Timestamps); + sendmsg(ssock, &iov1, &[], flags, Some(&sock_addr)).unwrap(); + let recv = recvmsg::<()>(rsock, &mut iov2, Some(&mut cmsg), flags).unwrap(); + + let mut ts = None; + for c in recv.cmsgs() { + if let ControlMessageOwned::ScmTimestampsns(timestamps) = c { + ts = Some(timestamps.system); + } + } + let ts = ts.expect("ScmTimestampns is present"); + let sys_time = + ::nix::time::clock_gettime(::nix::time::ClockId::CLOCK_REALTIME) + .unwrap(); + let diff = if ts > sys_time { + ts - sys_time + } else { + sys_time - ts + }; + assert!(std::time::Duration::from(diff).as_secs() < 60); +} + +#[allow(deprecated)] +#[test] +pub fn test_inetv6_addr_roundtrip_sockaddr_storage_to_addr() { + use nix::sys::socket::{sockaddr_storage_to_addr, SockAddr}; + + let port: u16 = 3000; + let flowinfo: u32 = 1; + let scope_id: u32 = 2; + let ip: Ipv6Addr = "fe80::1".parse().unwrap(); + + let actual = + SocketAddr::V6(SocketAddrV6::new(ip, port, flowinfo, scope_id)); + let addr = InetAddr::from_std(&actual); + let sockaddr = SockAddr::new_inet(addr); + + let (storage, ffi_size) = { + let mut storage = MaybeUninit::::zeroed(); + let storage_ptr = storage.as_mut_ptr().cast::(); + let (ffi_ptr, ffi_size) = sockaddr.as_ffi_pair(); + assert_eq!(mem::size_of::(), ffi_size as usize); + unsafe { + storage_ptr.copy_from_nonoverlapping( + (ffi_ptr as *const sockaddr).cast::(), + 1, + ); + (storage.assume_init(), ffi_size) + } + }; + + let from_storage = + sockaddr_storage_to_addr(&storage, ffi_size as usize).unwrap(); + assert_eq!(from_storage, sockaddr); + let from_storage = + sockaddr_storage_to_addr(&storage, mem::size_of::()) + .unwrap(); + assert_eq!(from_storage, sockaddr); +} + +#[test] +pub fn test_path_to_sock_addr() { + let path = "/foo/bar"; + let actual = Path::new(path); + let addr = UnixAddr::new(actual).unwrap(); + + let expect: &[c_char] = unsafe { + slice::from_raw_parts(path.as_ptr() as *const c_char, path.len()) + }; + assert_eq!(unsafe { &(*addr.as_ptr()).sun_path[..8] }, expect); + + assert_eq!(addr.path(), Some(actual)); +} + +fn calculate_hash(t: &T) -> u64 { + let mut s = DefaultHasher::new(); + t.hash(&mut s); + s.finish() +} + +#[test] +pub fn test_addr_equality_path() { + let path = "/foo/bar"; + let actual = Path::new(path); + let addr1 = UnixAddr::new(actual).unwrap(); + let mut addr2 = addr1; + + unsafe { (*addr2.as_mut_ptr()).sun_path[10] = 127 }; + + assert_eq!(addr1, addr2); + assert_eq!(calculate_hash(&addr1), calculate_hash(&addr2)); +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +pub fn test_abstract_sun_path_too_long() { + let name = String::from("nix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0tesnix\0abstract\0testttttnix\0abstract\0test\0make\0sure\0this\0is\0long\0enough"); + let addr = UnixAddr::new_abstract(name.as_bytes()); + addr.expect_err("assertion failed"); +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +pub fn test_addr_equality_abstract() { + let name = String::from("nix\0abstract\0test"); + let addr1 = UnixAddr::new_abstract(name.as_bytes()).unwrap(); + let mut addr2 = addr1; + + assert_eq!(addr1, addr2); + assert_eq!(calculate_hash(&addr1), calculate_hash(&addr2)); + + unsafe { (*addr2.as_mut_ptr()).sun_path[17] = 127 }; + assert_ne!(addr1, addr2); + assert_ne!(calculate_hash(&addr1), calculate_hash(&addr2)); +} + +// Test getting/setting abstract addresses (without unix socket creation) +#[cfg(target_os = "linux")] +#[test] +pub fn test_abstract_uds_addr() { + let empty = String::new(); + let addr = UnixAddr::new_abstract(empty.as_bytes()).unwrap(); + let sun_path: [u8; 0] = []; + assert_eq!(addr.as_abstract(), Some(&sun_path[..])); + + let name = String::from("nix\0abstract\0test"); + let addr = UnixAddr::new_abstract(name.as_bytes()).unwrap(); + let sun_path = [ + 110u8, 105, 120, 0, 97, 98, 115, 116, 114, 97, 99, 116, 0, 116, 101, + 115, 116, + ]; + assert_eq!(addr.as_abstract(), Some(&sun_path[..])); + assert_eq!(addr.path(), None); + + // Internally, name is null-prefixed (abstract namespace) + assert_eq!(unsafe { (*addr.as_ptr()).sun_path[0] }, 0); +} + +#[test] +pub fn test_getsockname() { + use nix::sys::socket::bind; + use nix::sys::socket::{socket, AddressFamily, SockFlag, SockType}; + + let tempdir = tempfile::tempdir().unwrap(); + let sockname = tempdir.path().join("sock"); + let sock = socket( + AddressFamily::Unix, + SockType::Stream, + SockFlag::empty(), + None, + ) + .expect("socket failed"); + let sockaddr = UnixAddr::new(&sockname).unwrap(); + bind(sock, &sockaddr).expect("bind failed"); + assert_eq!(sockaddr, getsockname(sock).expect("getsockname failed")); +} + +#[test] +pub fn test_socketpair() { + use nix::sys::socket::{socketpair, AddressFamily, SockFlag, SockType}; + use nix::unistd::{read, write}; + + let (fd1, fd2) = socketpair( + AddressFamily::Unix, + SockType::Stream, + None, + SockFlag::empty(), + ) + .unwrap(); + write(fd1, b"hello").unwrap(); + let mut buf = [0; 5]; + read(fd2, &mut buf).unwrap(); + + assert_eq!(&buf[..], b"hello"); +} + +#[test] +pub fn test_std_conversions() { + use nix::sys::socket::*; + + let std_sa = SocketAddrV4::from_str("127.0.0.1:6789").unwrap(); + let sock_addr = SockaddrIn::from(std_sa); + assert_eq!(std_sa, sock_addr.into()); + + let std_sa = SocketAddrV6::from_str("[::1]:6000").unwrap(); + let sock_addr: SockaddrIn6 = SockaddrIn6::from(std_sa); + assert_eq!(std_sa, sock_addr.into()); +} + +mod recvfrom { + use super::*; + use nix::sys::socket::*; + use nix::{errno::Errno, Result}; + use std::thread; + + const MSG: &[u8] = b"Hello, World!"; + + fn sendrecv( + rsock: RawFd, + ssock: RawFd, + f_send: Fs, + mut f_recv: Fr, + ) -> Option + where + Fs: Fn(RawFd, &[u8], MsgFlags) -> Result + Send + 'static, + Fr: FnMut(usize, Option), + { + let mut buf: [u8; 13] = [0u8; 13]; + let mut l = 0; + let mut from = None; + + let send_thread = thread::spawn(move || { + let mut l = 0; + while l < std::mem::size_of_val(MSG) { + l += f_send(ssock, &MSG[l..], MsgFlags::empty()).unwrap(); + } + }); + + while l < std::mem::size_of_val(MSG) { + let (len, from_) = recvfrom(rsock, &mut buf[l..]).unwrap(); + f_recv(len, from_); + from = from_; + l += len; + } + assert_eq!(&buf, MSG); + send_thread.join().unwrap(); + from + } + + #[test] + pub fn stream() { + let (fd2, fd1) = socketpair( + AddressFamily::Unix, + SockType::Stream, + None, + SockFlag::empty(), + ) + .unwrap(); + // Ignore from for stream sockets + let _ = sendrecv(fd1, fd2, send, |_, _| {}); + } + + #[test] + pub fn udp() { + let std_sa = SocketAddrV4::from_str("127.0.0.1:6789").unwrap(); + let sock_addr = SockaddrIn::from(std_sa); + let rsock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + let from = sendrecv( + rsock, + ssock, + move |s, m, flags| sendto(s, m, &sock_addr, flags), + |_, _| {}, + ); + // UDP sockets should set the from address + assert_eq!(AddressFamily::Inet, from.unwrap().family().unwrap()); + } + + #[cfg(target_os = "linux")] + mod udp_offload { + use super::*; + use nix::sys::socket::sockopt::{UdpGroSegment, UdpGsoSegment}; + use std::io::IoSlice; + + #[test] + // Disable the test under emulation because it fails in Cirrus-CI. Lack + // of QEMU support is suspected. + #[cfg_attr(qemu, ignore)] + pub fn gso() { + require_kernel_version!(udp_offload::gso, ">= 4.18"); + + // In this test, we send the data and provide a GSO segment size. + // Since we are sending the buffer of size 13, six UDP packets + // with size 2 and two UDP packet with size 1 will be sent. + let segment_size: u16 = 2; + + let sock_addr = SockaddrIn::new(127, 0, 0, 1, 6791); + let rsock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + + setsockopt(rsock, UdpGsoSegment, &(segment_size as _)) + .expect("setsockopt UDP_SEGMENT failed"); + + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + + let mut num_packets_received: i32 = 0; + + sendrecv( + rsock, + ssock, + move |s, m, flags| { + let iov = [IoSlice::new(m)]; + let cmsg = ControlMessage::UdpGsoSegments(&segment_size); + sendmsg(s, &iov, &[cmsg], flags, Some(&sock_addr)) + }, + { + let num_packets_received_ref = &mut num_packets_received; + + move |len, _| { + // check that we receive UDP packets with payload size + // less or equal to segment size + assert!(len <= segment_size as usize); + *num_packets_received_ref += 1; + } + }, + ); + + // Buffer size is 13, we will receive six packets of size 2, + // and one packet of size 1. + assert_eq!(7, num_packets_received); + } + + #[test] + // Disable the test on emulated platforms because it fails in Cirrus-CI. + // Lack of QEMU support is suspected. + #[cfg_attr(qemu, ignore)] + pub fn gro() { + require_kernel_version!(udp_offload::gro, ">= 5.3"); + + // It's hard to guarantee receiving GRO packets. Just checking + // that `setsockopt` doesn't fail with error + + let rsock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + + setsockopt(rsock, UdpGroSegment, &true) + .expect("setsockopt UDP_GRO failed"); + } + } + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + ))] + #[test] + pub fn udp_sendmmsg() { + use std::io::IoSlice; + + let std_sa = SocketAddrV4::from_str("127.0.0.1:6793").unwrap(); + let std_sa2 = SocketAddrV4::from_str("127.0.0.1:6794").unwrap(); + let sock_addr = SockaddrIn::from(std_sa); + let sock_addr2 = SockaddrIn::from(std_sa2); + + let rsock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + + let from = sendrecv( + rsock, + ssock, + move |s, m, flags| { + let iov = [IoSlice::new(m)]; + let mut msgs = vec![SendMmsgData { + iov: &iov, + cmsgs: &[], + addr: Some(sock_addr), + _lt: Default::default(), + }]; + + let batch_size = 15; + + for _ in 0..batch_size { + msgs.push(SendMmsgData { + iov: &iov, + cmsgs: &[], + addr: Some(sock_addr2), + _lt: Default::default(), + }); + } + sendmmsg(s, msgs.iter(), flags).map(move |sent_bytes| { + assert!(!sent_bytes.is_empty()); + for sent in &sent_bytes { + assert_eq!(*sent, m.len()); + } + sent_bytes.len() + }) + }, + |_, _| {}, + ); + // UDP sockets should set the from address + assert_eq!(AddressFamily::Inet, from.unwrap().family().unwrap()); + } + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + ))] + #[test] + pub fn udp_recvmmsg() { + use nix::sys::socket::{recvmmsg, MsgFlags}; + use std::io::IoSliceMut; + + const NUM_MESSAGES_SENT: usize = 2; + const DATA: [u8; 2] = [1, 2]; + + let inet_addr = SocketAddrV4::from_str("127.0.0.1:6798").unwrap(); + let sock_addr = SockaddrIn::from(inet_addr); + + let rsock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + + let send_thread = thread::spawn(move || { + for _ in 0..NUM_MESSAGES_SENT { + sendto(ssock, &DATA[..], &sock_addr, MsgFlags::empty()) + .unwrap(); + } + }); + + let mut msgs = std::collections::LinkedList::new(); + + // Buffers to receive exactly `NUM_MESSAGES_SENT` messages + let mut receive_buffers = [[0u8; 32]; NUM_MESSAGES_SENT]; + let iovs: Vec<_> = receive_buffers + .iter_mut() + .map(|buf| [IoSliceMut::new(&mut buf[..])]) + .collect(); + + for iov in &iovs { + msgs.push_back(RecvMmsgData { + iov, + cmsg_buffer: None, + }) + } + + let res: Vec> = + recvmmsg(rsock, &mut msgs, MsgFlags::empty(), None) + .expect("recvmmsg"); + assert_eq!(res.len(), DATA.len()); + + for RecvMsg { address, bytes, .. } in res.into_iter() { + assert_eq!(AddressFamily::Inet, address.unwrap().family().unwrap()); + assert_eq!(DATA.len(), bytes); + } + + for buf in &receive_buffers { + assert_eq!(&buf[..DATA.len()], DATA); + } + + send_thread.join().unwrap(); + } + + #[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "freebsd", + target_os = "netbsd", + ))] + #[test] + pub fn udp_recvmmsg_dontwait_short_read() { + use nix::sys::socket::{recvmmsg, MsgFlags}; + use std::io::IoSliceMut; + + const NUM_MESSAGES_SENT: usize = 2; + const DATA: [u8; 4] = [1, 2, 3, 4]; + + let inet_addr = SocketAddrV4::from_str("127.0.0.1:6799").unwrap(); + let sock_addr = SockaddrIn::from(inet_addr); + + let rsock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + bind(rsock, &sock_addr).unwrap(); + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + + let send_thread = thread::spawn(move || { + for _ in 0..NUM_MESSAGES_SENT { + sendto(ssock, &DATA[..], &sock_addr, MsgFlags::empty()) + .unwrap(); + } + }); + // Ensure we've sent all the messages before continuing so `recvmmsg` + // will return right away + send_thread.join().unwrap(); + + let mut msgs = std::collections::LinkedList::new(); + + // Buffers to receive >`NUM_MESSAGES_SENT` messages to ensure `recvmmsg` + // will return when there are fewer than requested messages in the + // kernel buffers when using `MSG_DONTWAIT`. + let mut receive_buffers = [[0u8; 32]; NUM_MESSAGES_SENT + 2]; + let iovs: Vec<_> = receive_buffers + .iter_mut() + .map(|buf| [IoSliceMut::new(&mut buf[..])]) + .collect(); + + for iov in &iovs { + msgs.push_back(RecvMmsgData { + iov, + cmsg_buffer: None, + }) + } + + let res: Vec> = + recvmmsg(rsock, &mut msgs, MsgFlags::MSG_DONTWAIT, None) + .expect("recvmmsg"); + assert_eq!(res.len(), NUM_MESSAGES_SENT); + + for RecvMsg { address, bytes, .. } in res.into_iter() { + assert_eq!(AddressFamily::Inet, address.unwrap().family().unwrap()); + assert_eq!(DATA.len(), bytes); + } + + for buf in &receive_buffers[..NUM_MESSAGES_SENT] { + assert_eq!(&buf[..DATA.len()], DATA); + } + } + + #[test] + pub fn udp_inet6() { + let addr = std::net::Ipv6Addr::from_str("::1").unwrap(); + let rport = 6789; + let rstd_sa = SocketAddrV6::new(addr, rport, 0, 0); + let raddr = SockaddrIn6::from(rstd_sa); + let sport = 6790; + let sstd_sa = SocketAddrV6::new(addr, sport, 0, 0); + let saddr = SockaddrIn6::from(sstd_sa); + let rsock = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("receive socket failed"); + match bind(rsock, &raddr) { + Err(Errno::EADDRNOTAVAIL) => { + println!("IPv6 not available, skipping test."); + return; + } + Err(e) => panic!("bind: {}", e), + Ok(()) => (), + } + let ssock = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + bind(ssock, &saddr).unwrap(); + let from = sendrecv( + rsock, + ssock, + move |s, m, flags| sendto(s, m, &raddr, flags), + |_, _| {}, + ); + assert_eq!(AddressFamily::Inet6, from.unwrap().family().unwrap()); + let osent_addr = from.unwrap(); + let sent_addr = osent_addr.as_sockaddr_in6().unwrap(); + assert_eq!(sent_addr.ip(), addr); + assert_eq!(sent_addr.port(), sport); + } +} + +// Test error handling of our recvmsg wrapper +#[test] +pub fn test_recvmsg_ebadf() { + use nix::errno::Errno; + use nix::sys::socket::{recvmsg, MsgFlags}; + use std::io::IoSliceMut; + + let mut buf = [0u8; 5]; + let mut iov = [IoSliceMut::new(&mut buf[..])]; + + let fd = -1; // Bad file descriptor + let r = recvmsg::<()>(fd, &mut iov, None, MsgFlags::empty()); + + assert_eq!(r.err().unwrap(), Errno::EBADF); +} + +// Disable the test on emulated platforms due to a bug in QEMU versions < +// 2.12.0. https://bugs.launchpad.net/qemu/+bug/1701808 +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_scm_rights() { + use nix::sys::socket::{ + recvmsg, sendmsg, socketpair, AddressFamily, ControlMessage, + ControlMessageOwned, MsgFlags, SockFlag, SockType, + }; + use nix::unistd::{close, pipe, read, write}; + use std::io::{IoSlice, IoSliceMut}; + + let (fd1, fd2) = socketpair( + AddressFamily::Unix, + SockType::Stream, + None, + SockFlag::empty(), + ) + .unwrap(); + let (r, w) = pipe().unwrap(); + let mut received_r: Option = None; + + { + let iov = [IoSlice::new(b"hello")]; + let fds = [r]; + let cmsg = ControlMessage::ScmRights(&fds); + assert_eq!( + sendmsg::<()>(fd1, &iov, &[cmsg], MsgFlags::empty(), None).unwrap(), + 5 + ); + close(r).unwrap(); + close(fd1).unwrap(); + } + + { + let mut buf = [0u8; 5]; + + let mut iov = [IoSliceMut::new(&mut buf[..])]; + let mut cmsgspace = cmsg_space!([RawFd; 1]); + let msg = recvmsg::<()>( + fd2, + &mut iov, + Some(&mut cmsgspace), + MsgFlags::empty(), + ) + .unwrap(); + + for cmsg in msg.cmsgs() { + if let ControlMessageOwned::ScmRights(fd) = cmsg { + assert_eq!(received_r, None); + assert_eq!(fd.len(), 1); + received_r = Some(fd[0]); + } else { + panic!("unexpected cmsg"); + } + } + assert_eq!(msg.bytes, 5); + assert!(!msg + .flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + close(fd2).unwrap(); + } + + let received_r = received_r.expect("Did not receive passed fd"); + // Ensure that the received file descriptor works + write(w, b"world").unwrap(); + let mut buf = [0u8; 5]; + read(received_r, &mut buf).unwrap(); + assert_eq!(&buf[..], b"world"); + close(received_r).unwrap(); + close(w).unwrap(); +} + +// Disable the test on emulated platforms due to not enabled support of AF_ALG in QEMU from rust cross +#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_af_alg_cipher() { + use nix::sys::socket::sockopt::AlgSetKey; + use nix::sys::socket::{ + accept, bind, sendmsg, setsockopt, socket, AddressFamily, AlgAddr, + ControlMessage, MsgFlags, SockFlag, SockType, + }; + use nix::unistd::read; + use std::io::IoSlice; + + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); + // Travis's seccomp profile blocks AF_ALG + // https://docs.docker.com/engine/security/seccomp/ + skip_if_seccomp!(test_af_alg_cipher); + + let alg_type = "skcipher"; + let alg_name = "ctr-aes-aesni"; + // 256-bits secret key + let key = vec![0u8; 32]; + // 16-bytes IV + let iv_len = 16; + let iv = vec![1u8; iv_len]; + // 256-bytes plain payload + let payload_len = 256; + let payload = vec![2u8; payload_len]; + + let sock = socket( + AddressFamily::Alg, + SockType::SeqPacket, + SockFlag::empty(), + None, + ) + .expect("socket failed"); + + let sockaddr = AlgAddr::new(alg_type, alg_name); + bind(sock, &sockaddr).expect("bind failed"); + + assert_eq!(sockaddr.alg_name().to_string_lossy(), alg_name); + assert_eq!(sockaddr.alg_type().to_string_lossy(), alg_type); + + setsockopt(sock, AlgSetKey::default(), &key).expect("setsockopt"); + let session_socket = accept(sock).expect("accept failed"); + + let msgs = [ + ControlMessage::AlgSetOp(&libc::ALG_OP_ENCRYPT), + ControlMessage::AlgSetIv(iv.as_slice()), + ]; + let iov = IoSlice::new(&payload); + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None) + .expect("sendmsg encrypt"); + + // allocate buffer for encrypted data + let mut encrypted = vec![0u8; payload_len]; + let num_bytes = read(session_socket, &mut encrypted).expect("read encrypt"); + assert_eq!(num_bytes, payload_len); + + let iov = IoSlice::new(&encrypted); + + let iv = vec![1u8; iv_len]; + + let msgs = [ + ControlMessage::AlgSetOp(&libc::ALG_OP_DECRYPT), + ControlMessage::AlgSetIv(iv.as_slice()), + ]; + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None) + .expect("sendmsg decrypt"); + + // allocate buffer for decrypted data + let mut decrypted = vec![0u8; payload_len]; + let num_bytes = read(session_socket, &mut decrypted).expect("read decrypt"); + + assert_eq!(num_bytes, payload_len); + assert_eq!(decrypted, payload); +} + +// Disable the test on emulated platforms due to not enabled support of AF_ALG +// in QEMU from rust cross +#[cfg(any(target_os = "linux", target_os = "android"))] +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_af_alg_aead() { + use libc::{ALG_OP_DECRYPT, ALG_OP_ENCRYPT}; + use nix::fcntl::{fcntl, FcntlArg, OFlag}; + use nix::sys::socket::sockopt::{AlgSetAeadAuthSize, AlgSetKey}; + use nix::sys::socket::{ + accept, bind, sendmsg, setsockopt, socket, AddressFamily, AlgAddr, + ControlMessage, MsgFlags, SockFlag, SockType, + }; + use nix::unistd::{close, read}; + use std::io::IoSlice; + + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1352"); + // Travis's seccomp profile blocks AF_ALG + // https://docs.docker.com/engine/security/seccomp/ + skip_if_seccomp!(test_af_alg_aead); + + let auth_size = 4usize; + let assoc_size = 16u32; + + let alg_type = "aead"; + let alg_name = "gcm(aes)"; + // 256-bits secret key + let key = vec![0u8; 32]; + // 12-bytes IV + let iv_len = 12; + let iv = vec![1u8; iv_len]; + // 256-bytes plain payload + let payload_len = 256; + let mut payload = + vec![2u8; payload_len + (assoc_size as usize) + auth_size]; + + for i in 0..assoc_size { + payload[i as usize] = 10; + } + + let len = payload.len(); + + for i in 0..auth_size { + payload[len - 1 - i] = 0; + } + + let sock = socket( + AddressFamily::Alg, + SockType::SeqPacket, + SockFlag::empty(), + None, + ) + .expect("socket failed"); + + let sockaddr = AlgAddr::new(alg_type, alg_name); + bind(sock, &sockaddr).expect("bind failed"); + + setsockopt(sock, AlgSetAeadAuthSize, &auth_size) + .expect("setsockopt AlgSetAeadAuthSize"); + setsockopt(sock, AlgSetKey::default(), &key).expect("setsockopt AlgSetKey"); + let session_socket = accept(sock).expect("accept failed"); + + let msgs = [ + ControlMessage::AlgSetOp(&ALG_OP_ENCRYPT), + ControlMessage::AlgSetIv(iv.as_slice()), + ControlMessage::AlgSetAeadAssoclen(&assoc_size), + ]; + + let iov = IoSlice::new(&payload); + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None) + .expect("sendmsg encrypt"); + + // allocate buffer for encrypted data + let mut encrypted = + vec![0u8; (assoc_size as usize) + payload_len + auth_size]; + let num_bytes = read(session_socket, &mut encrypted).expect("read encrypt"); + assert_eq!(num_bytes, payload_len + auth_size + (assoc_size as usize)); + close(session_socket).expect("close"); + + for i in 0..assoc_size { + encrypted[i as usize] = 10; + } + + let iov = IoSlice::new(&encrypted); + + let iv = vec![1u8; iv_len]; + + let session_socket = accept(sock).expect("accept failed"); + + let msgs = [ + ControlMessage::AlgSetOp(&ALG_OP_DECRYPT), + ControlMessage::AlgSetIv(iv.as_slice()), + ControlMessage::AlgSetAeadAssoclen(&assoc_size), + ]; + sendmsg::<()>(session_socket, &[iov], &msgs, MsgFlags::empty(), None) + .expect("sendmsg decrypt"); + + // allocate buffer for decrypted data + let mut decrypted = + vec![0u8; payload_len + (assoc_size as usize) + auth_size]; + // Starting with kernel 4.9, the interface changed slightly such that the + // authentication tag memory is only needed in the output buffer for encryption + // and in the input buffer for decryption. + // Do not block on read, as we may have fewer bytes than buffer size + fcntl(session_socket, FcntlArg::F_SETFL(OFlag::O_NONBLOCK)) + .expect("fcntl non_blocking"); + let num_bytes = read(session_socket, &mut decrypted).expect("read decrypt"); + + assert!(num_bytes >= payload_len + (assoc_size as usize)); + assert_eq!( + decrypted[(assoc_size as usize)..(payload_len + (assoc_size as usize))], + payload[(assoc_size as usize)..payload_len + (assoc_size as usize)] + ); +} + +// Verify `ControlMessage::Ipv4PacketInfo` for `sendmsg`. +// This creates a (udp) socket bound to localhost, then sends a message to +// itself but uses Ipv4PacketInfo to force the source address to be localhost. +// +// This would be a more interesting test if we could assume that the test host +// has more than one IP address (since we could select a different address to +// test from). +#[cfg(any(target_os = "linux", target_os = "macos", target_os = "netbsd"))] +#[test] +pub fn test_sendmsg_ipv4packetinfo() { + use cfg_if::cfg_if; + use nix::sys::socket::{ + bind, sendmsg, socket, AddressFamily, ControlMessage, MsgFlags, + SockFlag, SockType, SockaddrIn, + }; + use std::io::IoSlice; + + let sock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("socket failed"); + + let sock_addr = SockaddrIn::new(127, 0, 0, 1, 4000); + + bind(sock, &sock_addr).expect("bind failed"); + + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + cfg_if! { + if #[cfg(target_os = "netbsd")] { + let pi = libc::in_pktinfo { + ipi_ifindex: 0, /* Unspecified interface */ + ipi_addr: libc::in_addr { s_addr: 0 }, + }; + } else { + let pi = libc::in_pktinfo { + ipi_ifindex: 0, /* Unspecified interface */ + ipi_addr: libc::in_addr { s_addr: 0 }, + ipi_spec_dst: sock_addr.as_ref().sin_addr, + }; + } + } + + let cmsg = [ControlMessage::Ipv4PacketInfo(&pi)]; + + sendmsg(sock, &iov, &cmsg, MsgFlags::empty(), Some(&sock_addr)) + .expect("sendmsg"); +} + +// Verify `ControlMessage::Ipv6PacketInfo` for `sendmsg`. +// This creates a (udp) socket bound to ip6-localhost, then sends a message to +// itself but uses Ipv6PacketInfo to force the source address to be +// ip6-localhost. +// +// This would be a more interesting test if we could assume that the test host +// has more than one IP address (since we could select a different address to +// test from). +#[cfg(any( + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "freebsd" +))] +#[test] +pub fn test_sendmsg_ipv6packetinfo() { + use nix::errno::Errno; + use nix::sys::socket::{ + bind, sendmsg, socket, AddressFamily, ControlMessage, MsgFlags, + SockFlag, SockType, SockaddrIn6, + }; + use std::io::IoSlice; + + let sock = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("socket failed"); + + let std_sa = SocketAddrV6::from_str("[::1]:6000").unwrap(); + let sock_addr: SockaddrIn6 = SockaddrIn6::from(std_sa); + + if let Err(Errno::EADDRNOTAVAIL) = bind(sock, &sock_addr) { + println!("IPv6 not available, skipping test."); + return; + } + + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + let pi = libc::in6_pktinfo { + ipi6_ifindex: 0, /* Unspecified interface */ + ipi6_addr: sock_addr.as_ref().sin6_addr, + }; + + let cmsg = [ControlMessage::Ipv6PacketInfo(&pi)]; + + sendmsg::( + sock, + &iov, + &cmsg, + MsgFlags::empty(), + Some(&sock_addr), + ) + .expect("sendmsg"); +} + +// Verify that ControlMessage::Ipv4SendSrcAddr works for sendmsg. This +// creates a UDP socket bound to all local interfaces (0.0.0.0). It then +// sends message to itself at 127.0.0.1 while explicitly specifying +// 127.0.0.1 as the source address through an Ipv4SendSrcAddr +// (IP_SENDSRCADDR) control message. +// +// Note that binding to 0.0.0.0 is *required* on FreeBSD; sendmsg +// returns EINVAL otherwise. (See FreeBSD's ip(4) man page.) +#[cfg(any( + target_os = "netbsd", + target_os = "freebsd", + target_os = "openbsd", + target_os = "dragonfly", +))] +#[test] +pub fn test_sendmsg_ipv4sendsrcaddr() { + use nix::sys::socket::{ + bind, sendmsg, socket, AddressFamily, ControlMessage, MsgFlags, + SockFlag, SockType, SockaddrIn, + }; + use std::io::IoSlice; + + let sock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("socket failed"); + + let unspec_sock_addr = SockaddrIn::new(0, 0, 0, 0, 0); + bind(sock, &unspec_sock_addr).expect("bind failed"); + let bound_sock_addr: SockaddrIn = getsockname(sock).unwrap(); + let localhost_sock_addr: SockaddrIn = + SockaddrIn::new(127, 0, 0, 1, bound_sock_addr.port()); + + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + let cmsg = [ControlMessage::Ipv4SendSrcAddr( + &localhost_sock_addr.as_ref().sin_addr, + )]; + + sendmsg( + sock, + &iov, + &cmsg, + MsgFlags::empty(), + Some(&localhost_sock_addr), + ) + .expect("sendmsg"); +} + +/// Tests that passing multiple fds using a single `ControlMessage` works. +// Disable the test on emulated platforms due to a bug in QEMU versions < +// 2.12.0. https://bugs.launchpad.net/qemu/+bug/1701808 +#[cfg_attr(qemu, ignore)] +#[test] +fn test_scm_rights_single_cmsg_multiple_fds() { + use nix::sys::socket::{ + recvmsg, sendmsg, ControlMessage, ControlMessageOwned, MsgFlags, + }; + use std::io::{IoSlice, IoSliceMut}; + use std::os::unix::io::{AsRawFd, RawFd}; + use std::os::unix::net::UnixDatagram; + use std::thread; + + let (send, receive) = UnixDatagram::pair().unwrap(); + let thread = thread::spawn(move || { + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + + let mut space = cmsg_space!([RawFd; 2]); + let msg = recvmsg::<()>( + receive.as_raw_fd(), + &mut iovec, + Some(&mut space), + MsgFlags::empty(), + ) + .unwrap(); + assert!(!msg + .flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + + let mut cmsgs = msg.cmsgs(); + match cmsgs.next() { + Some(ControlMessageOwned::ScmRights(fds)) => { + assert_eq!( + fds.len(), + 2, + "unexpected fd count (expected 2 fds, got {})", + fds.len() + ); + } + _ => panic!(), + } + assert!(cmsgs.next().is_none(), "unexpected control msg"); + + assert_eq!(msg.bytes, 8); + assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); + }); + + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + let fds = [libc::STDIN_FILENO, libc::STDOUT_FILENO]; // pass stdin and stdout + let cmsg = [ControlMessage::ScmRights(&fds)]; + sendmsg::<()>(send.as_raw_fd(), &iov, &cmsg, MsgFlags::empty(), None) + .unwrap(); + thread.join().unwrap(); +} + +// Verify `sendmsg` builds a valid `msghdr` when passing an empty +// `cmsgs` argument. This should result in a msghdr with a nullptr +// msg_control field and a msg_controllen of 0 when calling into the +// raw `sendmsg`. +#[test] +pub fn test_sendmsg_empty_cmsgs() { + use nix::sys::socket::{ + recvmsg, sendmsg, socketpair, AddressFamily, MsgFlags, SockFlag, + SockType, + }; + use nix::unistd::close; + use std::io::{IoSlice, IoSliceMut}; + + let (fd1, fd2) = socketpair( + AddressFamily::Unix, + SockType::Stream, + None, + SockFlag::empty(), + ) + .unwrap(); + + { + let iov = [IoSlice::new(b"hello")]; + assert_eq!( + sendmsg::<()>(fd1, &iov, &[], MsgFlags::empty(), None).unwrap(), + 5 + ); + close(fd1).unwrap(); + } + + { + let mut buf = [0u8; 5]; + let mut iov = [IoSliceMut::new(&mut buf[..])]; + + let mut cmsgspace = cmsg_space!([RawFd; 1]); + let msg = recvmsg::<()>( + fd2, + &mut iov, + Some(&mut cmsgspace), + MsgFlags::empty(), + ) + .unwrap(); + + for _ in msg.cmsgs() { + panic!("unexpected cmsg"); + } + assert!(!msg + .flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + assert_eq!(msg.bytes, 5); + close(fd2).unwrap(); + } +} + +#[cfg(any( + target_os = "android", + target_os = "linux", + target_os = "freebsd", + target_os = "dragonfly", +))] +#[test] +fn test_scm_credentials() { + use nix::sys::socket::{ + recvmsg, sendmsg, socketpair, AddressFamily, ControlMessage, + ControlMessageOwned, MsgFlags, SockFlag, SockType, UnixCredentials, + }; + #[cfg(any(target_os = "android", target_os = "linux"))] + use nix::sys::socket::{setsockopt, sockopt::PassCred}; + use nix::unistd::{close, getgid, getpid, getuid}; + use std::io::{IoSlice, IoSliceMut}; + + let (send, recv) = socketpair( + AddressFamily::Unix, + SockType::Stream, + None, + SockFlag::empty(), + ) + .unwrap(); + #[cfg(any(target_os = "android", target_os = "linux"))] + setsockopt(recv, PassCred, &true).unwrap(); + + { + let iov = [IoSlice::new(b"hello")]; + #[cfg(any(target_os = "android", target_os = "linux"))] + let cred = UnixCredentials::new(); + #[cfg(any(target_os = "android", target_os = "linux"))] + let cmsg = ControlMessage::ScmCredentials(&cred); + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + let cmsg = ControlMessage::ScmCreds; + assert_eq!( + sendmsg::<()>(send, &iov, &[cmsg], MsgFlags::empty(), None) + .unwrap(), + 5 + ); + close(send).unwrap(); + } + + { + let mut buf = [0u8; 5]; + let mut iov = [IoSliceMut::new(&mut buf[..])]; + + let mut cmsgspace = cmsg_space!(UnixCredentials); + let msg = recvmsg::<()>( + recv, + &mut iov, + Some(&mut cmsgspace), + MsgFlags::empty(), + ) + .unwrap(); + let mut received_cred = None; + + for cmsg in msg.cmsgs() { + let cred = match cmsg { + #[cfg(any(target_os = "android", target_os = "linux"))] + ControlMessageOwned::ScmCredentials(cred) => cred, + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + ControlMessageOwned::ScmCreds(cred) => cred, + other => panic!("unexpected cmsg {:?}", other), + }; + assert!(received_cred.is_none()); + assert_eq!(cred.pid(), getpid().as_raw()); + assert_eq!(cred.uid(), getuid().as_raw()); + assert_eq!(cred.gid(), getgid().as_raw()); + received_cred = Some(cred); + } + received_cred.expect("no creds received"); + assert_eq!(msg.bytes, 5); + assert!(!msg + .flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + close(recv).unwrap(); + } +} + +/// Ensure that we can send `SCM_CREDENTIALS` and `SCM_RIGHTS` with a single +/// `sendmsg` call. +#[cfg(any(target_os = "android", target_os = "linux"))] +// qemu's handling of multiple cmsgs is bugged, ignore tests under emulation +// see https://bugs.launchpad.net/qemu/+bug/1781280 +#[cfg_attr(qemu, ignore)] +#[test] +fn test_scm_credentials_and_rights() { + let space = cmsg_space!(libc::ucred, RawFd); + test_impl_scm_credentials_and_rights(space); +} + +/// Ensure that passing a an oversized control message buffer to recvmsg +/// still works. +#[cfg(any(target_os = "android", target_os = "linux"))] +// qemu's handling of multiple cmsgs is bugged, ignore tests under emulation +// see https://bugs.launchpad.net/qemu/+bug/1781280 +#[cfg_attr(qemu, ignore)] +#[test] +fn test_too_large_cmsgspace() { + let space = vec![0u8; 1024]; + test_impl_scm_credentials_and_rights(space); +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_impl_scm_credentials_and_rights(mut space: Vec) { + use libc::ucred; + use nix::sys::socket::sockopt::PassCred; + use nix::sys::socket::{ + recvmsg, sendmsg, setsockopt, socketpair, ControlMessage, + ControlMessageOwned, MsgFlags, SockFlag, SockType, + }; + use nix::unistd::{close, getgid, getpid, getuid, pipe, write}; + use std::io::{IoSlice, IoSliceMut}; + + let (send, recv) = socketpair( + AddressFamily::Unix, + SockType::Stream, + None, + SockFlag::empty(), + ) + .unwrap(); + setsockopt(recv, PassCred, &true).unwrap(); + + let (r, w) = pipe().unwrap(); + let mut received_r: Option = None; + + { + let iov = [IoSlice::new(b"hello")]; + let cred = ucred { + pid: getpid().as_raw(), + uid: getuid().as_raw(), + gid: getgid().as_raw(), + } + .into(); + let fds = [r]; + let cmsgs = [ + ControlMessage::ScmCredentials(&cred), + ControlMessage::ScmRights(&fds), + ]; + assert_eq!( + sendmsg::<()>(send, &iov, &cmsgs, MsgFlags::empty(), None).unwrap(), + 5 + ); + close(r).unwrap(); + close(send).unwrap(); + } + + { + let mut buf = [0u8; 5]; + let mut iov = [IoSliceMut::new(&mut buf[..])]; + let msg = + recvmsg::<()>(recv, &mut iov, Some(&mut space), MsgFlags::empty()) + .unwrap(); + let mut received_cred = None; + + assert_eq!(msg.cmsgs().count(), 2, "expected 2 cmsgs"); + + for cmsg in msg.cmsgs() { + match cmsg { + ControlMessageOwned::ScmRights(fds) => { + assert_eq!(received_r, None, "already received fd"); + assert_eq!(fds.len(), 1); + received_r = Some(fds[0]); + } + ControlMessageOwned::ScmCredentials(cred) => { + assert!(received_cred.is_none()); + assert_eq!(cred.pid(), getpid().as_raw()); + assert_eq!(cred.uid(), getuid().as_raw()); + assert_eq!(cred.gid(), getgid().as_raw()); + received_cred = Some(cred); + } + _ => panic!("unexpected cmsg"), + } + } + received_cred.expect("no creds received"); + assert_eq!(msg.bytes, 5); + assert!(!msg + .flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + close(recv).unwrap(); + } + + let received_r = received_r.expect("Did not receive passed fd"); + // Ensure that the received file descriptor works + write(w, b"world").unwrap(); + let mut buf = [0u8; 5]; + read(received_r, &mut buf).unwrap(); + assert_eq!(&buf[..], b"world"); + close(received_r).unwrap(); + close(w).unwrap(); +} + +// Test creating and using named unix domain sockets +#[test] +pub fn test_unixdomain() { + use nix::sys::socket::{accept, bind, connect, listen, socket, UnixAddr}; + use nix::sys::socket::{SockFlag, SockType}; + use nix::unistd::{close, read, write}; + use std::thread; + + let tempdir = tempfile::tempdir().unwrap(); + let sockname = tempdir.path().join("sock"); + let s1 = socket( + AddressFamily::Unix, + SockType::Stream, + SockFlag::empty(), + None, + ) + .expect("socket failed"); + let sockaddr = UnixAddr::new(&sockname).unwrap(); + bind(s1, &sockaddr).expect("bind failed"); + listen(s1, 10).expect("listen failed"); + + let thr = thread::spawn(move || { + let s2 = socket( + AddressFamily::Unix, + SockType::Stream, + SockFlag::empty(), + None, + ) + .expect("socket failed"); + connect(s2, &sockaddr).expect("connect failed"); + write(s2, b"hello").expect("write failed"); + close(s2).unwrap(); + }); + + let s3 = accept(s1).expect("accept failed"); + + let mut buf = [0; 5]; + read(s3, &mut buf).unwrap(); + close(s3).unwrap(); + close(s1).unwrap(); + thr.join().unwrap(); + + assert_eq!(&buf[..], b"hello"); +} + +// Test creating and using named system control sockets +#[cfg(any(target_os = "macos", target_os = "ios"))] +#[test] +pub fn test_syscontrol() { + use nix::errno::Errno; + use nix::sys::socket::{ + socket, SockFlag, SockProtocol, SockType, SysControlAddr, + }; + + let fd = socket( + AddressFamily::System, + SockType::Datagram, + SockFlag::empty(), + SockProtocol::KextControl, + ) + .expect("socket failed"); + SysControlAddr::from_name(fd, "com.apple.net.utun_control", 0) + .expect("resolving sys_control name failed"); + assert_eq!( + SysControlAddr::from_name(fd, "foo.bar.lol", 0).err(), + Some(Errno::ENOENT) + ); + + // requires root privileges + // connect(fd, &sockaddr).expect("connect failed"); +} + +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +fn loopback_address( + family: AddressFamily, +) -> Option { + use nix::ifaddrs::getifaddrs; + use nix::net::if_::*; + use nix::sys::socket::SockaddrLike; + use std::io; + use std::io::Write; + + let mut addrs = match getifaddrs() { + Ok(iter) => iter, + Err(e) => { + let stdioerr = io::stderr(); + let mut handle = stdioerr.lock(); + writeln!(handle, "getifaddrs: {:?}", e).unwrap(); + return None; + } + }; + // return first address matching family + addrs.find(|ifaddr| { + ifaddr.flags.contains(InterfaceFlags::IFF_LOOPBACK) + && ifaddr.address.as_ref().and_then(SockaddrLike::family) + == Some(family) + }) +} + +#[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", +))] +// qemu doesn't seem to be emulating this correctly in these architectures +#[cfg_attr( + all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) + ), + ignore +)] +#[test] +pub fn test_recv_ipv4pktinfo() { + use nix::net::if_::*; + use nix::sys::socket::sockopt::Ipv4PacketInfo; + use nix::sys::socket::{bind, SockFlag, SockType, SockaddrIn}; + use nix::sys::socket::{getsockname, setsockopt, socket}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use std::io::{IoSlice, IoSliceMut}; + + let lo_ifaddr = loopback_address(AddressFamily::Inet); + let (lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => ( + ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface"), + ), + None => return, + }; + let receive = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa: SockaddrIn = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv4PacketInfo, &true).expect("setsockopt failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + let send = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)) + .expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + + let mut space = cmsg_space!(libc::in_pktinfo); + let msg = recvmsg::<()>( + receive, + &mut iovec, + Some(&mut space), + MsgFlags::empty(), + ) + .expect("recvmsg failed"); + assert!(!msg + .flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + + let mut cmsgs = msg.cmsgs(); + if let Some(ControlMessageOwned::Ipv4PacketInfo(pktinfo)) = cmsgs.next() + { + let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); + assert_eq!( + pktinfo.ipi_ifindex as libc::c_uint, i, + "unexpected ifindex (expected {}, got {})", + i, pktinfo.ipi_ifindex + ); + } + assert!(cmsgs.next().is_none(), "unexpected additional control msg"); + assert_eq!(msg.bytes, 8); + assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); + } +} + +#[cfg(any( + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +// qemu doesn't seem to be emulating this correctly in these architectures +#[cfg_attr( + all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) + ), + ignore +)] +#[test] +pub fn test_recvif() { + use nix::net::if_::*; + use nix::sys::socket::sockopt::{Ipv4RecvDstAddr, Ipv4RecvIf}; + use nix::sys::socket::{bind, SockFlag, SockType, SockaddrIn}; + use nix::sys::socket::{getsockname, setsockopt, socket}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use std::io::{IoSlice, IoSliceMut}; + + let lo_ifaddr = loopback_address(AddressFamily::Inet); + let (lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => ( + ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface"), + ), + None => return, + }; + let receive = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa: SockaddrIn = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv4RecvIf, &true) + .expect("setsockopt IP_RECVIF failed"); + setsockopt(receive, Ipv4RecvDstAddr, &true) + .expect("setsockopt IP_RECVDSTADDR failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + let send = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)) + .expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + let mut space = cmsg_space!(libc::sockaddr_dl, libc::in_addr); + let msg = recvmsg::<()>( + receive, + &mut iovec, + Some(&mut space), + MsgFlags::empty(), + ) + .expect("recvmsg failed"); + assert!(!msg + .flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + assert_eq!(msg.cmsgs().count(), 2, "expected 2 cmsgs"); + + let mut rx_recvif = false; + let mut rx_recvdstaddr = false; + for cmsg in msg.cmsgs() { + match cmsg { + ControlMessageOwned::Ipv4RecvIf(dl) => { + rx_recvif = true; + let i = if_nametoindex(lo_name.as_bytes()) + .expect("if_nametoindex"); + assert_eq!( + dl.sdl_index as libc::c_uint, i, + "unexpected ifindex (expected {}, got {})", + i, dl.sdl_index + ); + } + ControlMessageOwned::Ipv4RecvDstAddr(addr) => { + rx_recvdstaddr = true; + if let Some(sin) = lo.as_sockaddr_in() { + assert_eq!(sin.as_ref().sin_addr.s_addr, + addr.s_addr, + "unexpected destination address (expected {}, got {})", + sin.as_ref().sin_addr.s_addr, + addr.s_addr); + } else { + panic!("unexpected Sockaddr"); + } + } + _ => panic!("unexpected additional control msg"), + } + } + assert!(rx_recvif); + assert!(rx_recvdstaddr); + assert_eq!(msg.bytes, 8); + assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); + } +} + +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_recvif_ipv4() { + use nix::sys::socket::sockopt::Ipv4OrigDstAddr; + use nix::sys::socket::{bind, SockFlag, SockType, SockaddrIn}; + use nix::sys::socket::{getsockname, setsockopt, socket}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use std::io::{IoSlice, IoSliceMut}; + + let lo_ifaddr = loopback_address(AddressFamily::Inet); + let (_lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => ( + ifaddr.interface_name, + ifaddr.address.expect("Expect IPv4 address on interface"), + ), + None => return, + }; + let receive = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa: SockaddrIn = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv4OrigDstAddr, &true) + .expect("setsockopt IP_ORIGDSTADDR failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + let send = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)) + .expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + let mut space = cmsg_space!(libc::sockaddr_in); + let msg = recvmsg::<()>( + receive, + &mut iovec, + Some(&mut space), + MsgFlags::empty(), + ) + .expect("recvmsg failed"); + assert!(!msg + .flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + assert_eq!(msg.cmsgs().count(), 1, "expected 1 cmsgs"); + + let mut rx_recvorigdstaddr = false; + for cmsg in msg.cmsgs() { + match cmsg { + ControlMessageOwned::Ipv4OrigDstAddr(addr) => { + rx_recvorigdstaddr = true; + if let Some(sin) = lo.as_sockaddr_in() { + assert_eq!(sin.as_ref().sin_addr.s_addr, + addr.sin_addr.s_addr, + "unexpected destination address (expected {}, got {})", + sin.as_ref().sin_addr.s_addr, + addr.sin_addr.s_addr); + } else { + panic!("unexpected Sockaddr"); + } + } + _ => panic!("unexpected additional control msg"), + } + } + assert!(rx_recvorigdstaddr); + assert_eq!(msg.bytes, 8); + assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); + } +} + +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +#[cfg_attr(qemu, ignore)] +#[test] +pub fn test_recvif_ipv6() { + use nix::sys::socket::sockopt::Ipv6OrigDstAddr; + use nix::sys::socket::{bind, SockFlag, SockType, SockaddrIn6}; + use nix::sys::socket::{getsockname, setsockopt, socket}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use std::io::{IoSlice, IoSliceMut}; + + let lo_ifaddr = loopback_address(AddressFamily::Inet6); + let (_lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => ( + ifaddr.interface_name, + ifaddr.address.expect("Expect IPv6 address on interface"), + ), + None => return, + }; + let receive = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa: SockaddrIn6 = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv6OrigDstAddr, &true) + .expect("setsockopt IP_ORIGDSTADDR failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + let send = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)) + .expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + let mut space = cmsg_space!(libc::sockaddr_in6); + let msg = recvmsg::<()>( + receive, + &mut iovec, + Some(&mut space), + MsgFlags::empty(), + ) + .expect("recvmsg failed"); + assert!(!msg + .flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + assert_eq!(msg.cmsgs().count(), 1, "expected 1 cmsgs"); + + let mut rx_recvorigdstaddr = false; + for cmsg in msg.cmsgs() { + match cmsg { + ControlMessageOwned::Ipv6OrigDstAddr(addr) => { + rx_recvorigdstaddr = true; + if let Some(sin) = lo.as_sockaddr_in6() { + assert_eq!(sin.as_ref().sin6_addr.s6_addr, + addr.sin6_addr.s6_addr, + "unexpected destination address (expected {:?}, got {:?})", + sin.as_ref().sin6_addr.s6_addr, + addr.sin6_addr.s6_addr); + } else { + panic!("unexpected Sockaddr"); + } + } + _ => panic!("unexpected additional control msg"), + } + } + assert!(rx_recvorigdstaddr); + assert_eq!(msg.bytes, 8); + assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); + } +} + +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", +))] +// qemu doesn't seem to be emulating this correctly in these architectures +#[cfg_attr( + all( + qemu, + any( + target_arch = "mips", + target_arch = "mips64", + target_arch = "powerpc64", + ) + ), + ignore +)] +#[test] +pub fn test_recv_ipv6pktinfo() { + use nix::net::if_::*; + use nix::sys::socket::sockopt::Ipv6RecvPacketInfo; + use nix::sys::socket::{bind, SockFlag, SockType, SockaddrIn6}; + use nix::sys::socket::{getsockname, setsockopt, socket}; + use nix::sys::socket::{recvmsg, sendmsg, ControlMessageOwned, MsgFlags}; + use std::io::{IoSlice, IoSliceMut}; + + let lo_ifaddr = loopback_address(AddressFamily::Inet6); + let (lo_name, lo) = match lo_ifaddr { + Some(ifaddr) => ( + ifaddr.interface_name, + ifaddr.address.expect("Expect IPv6 address on interface"), + ), + None => return, + }; + let receive = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("receive socket failed"); + bind(receive, &lo).expect("bind failed"); + let sa: SockaddrIn6 = getsockname(receive).expect("getsockname failed"); + setsockopt(receive, Ipv6RecvPacketInfo, &true).expect("setsockopt failed"); + + { + let slice = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let iov = [IoSlice::new(&slice)]; + + let send = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + sendmsg(send, &iov, &[], MsgFlags::empty(), Some(&sa)) + .expect("sendmsg failed"); + } + + { + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + + let mut space = cmsg_space!(libc::in6_pktinfo); + let msg = recvmsg::<()>( + receive, + &mut iovec, + Some(&mut space), + MsgFlags::empty(), + ) + .expect("recvmsg failed"); + assert!(!msg + .flags + .intersects(MsgFlags::MSG_TRUNC | MsgFlags::MSG_CTRUNC)); + + let mut cmsgs = msg.cmsgs(); + if let Some(ControlMessageOwned::Ipv6PacketInfo(pktinfo)) = cmsgs.next() + { + let i = if_nametoindex(lo_name.as_bytes()).expect("if_nametoindex"); + assert_eq!( + pktinfo.ipi6_ifindex as libc::c_uint, i, + "unexpected ifindex (expected {}, got {})", + i, pktinfo.ipi6_ifindex + ); + } + assert!(cmsgs.next().is_none(), "unexpected additional control msg"); + assert_eq!(msg.bytes, 8); + assert_eq!(*iovec[0], [1u8, 2, 3, 4, 5, 6, 7, 8]); + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[cfg_attr(graviton, ignore = "Not supported by the CI environment")] +#[test] +pub fn test_vsock() { + use nix::errno::Errno; + use nix::sys::socket::{ + bind, connect, listen, socket, AddressFamily, SockFlag, SockType, + VsockAddr, + }; + use nix::unistd::close; + use std::thread; + + let port: u32 = 3000; + + let s1 = socket( + AddressFamily::Vsock, + SockType::Stream, + SockFlag::empty(), + None, + ) + .expect("socket failed"); + + // VMADDR_CID_HYPERVISOR is reserved, so we expect an EADDRNOTAVAIL error. + let sockaddr_hv = VsockAddr::new(libc::VMADDR_CID_HYPERVISOR, port); + assert_eq!(bind(s1, &sockaddr_hv).err(), Some(Errno::EADDRNOTAVAIL)); + + let sockaddr_any = VsockAddr::new(libc::VMADDR_CID_ANY, port); + assert_eq!(bind(s1, &sockaddr_any), Ok(())); + listen(s1, 10).expect("listen failed"); + + let thr = thread::spawn(move || { + let cid: u32 = libc::VMADDR_CID_HOST; + + let s2 = socket( + AddressFamily::Vsock, + SockType::Stream, + SockFlag::empty(), + None, + ) + .expect("socket failed"); + + let sockaddr_host = VsockAddr::new(cid, port); + + // The current implementation does not support loopback devices, so, + // for now, we expect a failure on the connect. + assert_ne!(connect(s2, &sockaddr_host), Ok(())); + + close(s2).unwrap(); + }); + + close(s1).unwrap(); + thr.join().unwrap(); +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(all(target_os = "linux"))] +#[test] +fn test_recvmsg_timestampns() { + use nix::sys::socket::*; + use nix::sys::time::*; + use std::io::{IoSlice, IoSliceMut}; + use std::time::*; + + // Set up + let message = "Ohayō!".as_bytes(); + let in_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + setsockopt(in_socket, sockopt::ReceiveTimestampns, &true).unwrap(); + let localhost = SockaddrIn::new(127, 0, 0, 1, 0); + bind(in_socket, &localhost).unwrap(); + let address: SockaddrIn = getsockname(in_socket).unwrap(); + // Get initial time + let time0 = SystemTime::now(); + // Send the message + let iov = [IoSlice::new(message)]; + let flags = MsgFlags::empty(); + let l = sendmsg(in_socket, &iov, &[], flags, Some(&address)).unwrap(); + assert_eq!(message.len(), l); + // Receive the message + let mut buffer = vec![0u8; message.len()]; + let mut cmsgspace = nix::cmsg_space!(TimeSpec); + + let mut iov = [IoSliceMut::new(&mut buffer)]; + let r = recvmsg::<()>(in_socket, &mut iov, Some(&mut cmsgspace), flags) + .unwrap(); + let rtime = match r.cmsgs().next() { + Some(ControlMessageOwned::ScmTimestampns(rtime)) => rtime, + Some(_) => panic!("Unexpected control message"), + None => panic!("No control message"), + }; + // Check the final time + let time1 = SystemTime::now(); + // the packet's received timestamp should lie in-between the two system + // times, unless the system clock was adjusted in the meantime. + let rduration = + Duration::new(rtime.tv_sec() as u64, rtime.tv_nsec() as u32); + assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); + assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); + // Close socket + nix::unistd::close(in_socket).unwrap(); +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(all(target_os = "linux"))] +#[test] +fn test_recvmmsg_timestampns() { + use nix::sys::socket::*; + use nix::sys::time::*; + use std::io::{IoSlice, IoSliceMut}; + use std::time::*; + + // Set up + let message = "Ohayō!".as_bytes(); + let in_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + setsockopt(in_socket, sockopt::ReceiveTimestampns, &true).unwrap(); + let localhost = SockaddrIn::from_str("127.0.0.1:0").unwrap(); + bind(in_socket, &localhost).unwrap(); + let address: SockaddrIn = getsockname(in_socket).unwrap(); + // Get initial time + let time0 = SystemTime::now(); + // Send the message + let iov = [IoSlice::new(message)]; + let flags = MsgFlags::empty(); + let l = sendmsg(in_socket, &iov, &[], flags, Some(&address)).unwrap(); + assert_eq!(message.len(), l); + // Receive the message + let mut buffer = vec![0u8; message.len()]; + let mut cmsgspace = nix::cmsg_space!(TimeSpec); + let iov = [IoSliceMut::new(&mut buffer)]; + let mut data = vec![RecvMmsgData { + iov, + cmsg_buffer: Some(&mut cmsgspace), + }]; + let r: Vec> = + recvmmsg(in_socket, &mut data, flags, None).unwrap(); + let rtime = match r[0].cmsgs().next() { + Some(ControlMessageOwned::ScmTimestampns(rtime)) => rtime, + Some(_) => panic!("Unexpected control message"), + None => panic!("No control message"), + }; + // Check the final time + let time1 = SystemTime::now(); + // the packet's received timestamp should lie in-between the two system + // times, unless the system clock was adjusted in the meantime. + let rduration = + Duration::new(rtime.tv_sec() as u64, rtime.tv_nsec() as u32); + assert!(time0.duration_since(UNIX_EPOCH).unwrap() <= rduration); + assert!(rduration <= time1.duration_since(UNIX_EPOCH).unwrap()); + // Close socket + nix::unistd::close(in_socket).unwrap(); +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] +#[test] +fn test_recvmsg_rxq_ovfl() { + use nix::sys::socket::sockopt::{RcvBuf, RxqOvfl}; + use nix::sys::socket::*; + use nix::Error; + use std::io::{IoSlice, IoSliceMut}; + + let message = [0u8; 2048]; + let bufsize = message.len() * 2; + + let in_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + let out_socket = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + + let localhost = SockaddrIn::from_str("127.0.0.1:0").unwrap(); + bind(in_socket, &localhost).unwrap(); + + let address: SockaddrIn = getsockname(in_socket).unwrap(); + connect(out_socket, &address).unwrap(); + + // Set SO_RXQ_OVFL flag. + setsockopt(in_socket, RxqOvfl, &1).unwrap(); + + // Set the receiver buffer size to hold only 2 messages. + setsockopt(in_socket, RcvBuf, &bufsize).unwrap(); + + let mut drop_counter = 0; + + for _ in 0..2 { + let iov = [IoSlice::new(&message)]; + let flags = MsgFlags::empty(); + + // Send the 3 messages (the receiver buffer can only hold 2 messages) + // to create an overflow. + for _ in 0..3 { + let l = + sendmsg(out_socket, &iov, &[], flags, Some(&address)).unwrap(); + assert_eq!(message.len(), l); + } + + // Receive the message and check the drop counter if any. + loop { + let mut buffer = vec![0u8; message.len()]; + let mut cmsgspace = nix::cmsg_space!(u32); + + let mut iov = [IoSliceMut::new(&mut buffer)]; + + match recvmsg::<()>( + in_socket, + &mut iov, + Some(&mut cmsgspace), + MsgFlags::MSG_DONTWAIT, + ) { + Ok(r) => { + drop_counter = match r.cmsgs().next() { + Some(ControlMessageOwned::RxqOvfl(drop_counter)) => { + drop_counter + } + Some(_) => panic!("Unexpected control message"), + None => 0, + }; + } + Err(Error::EAGAIN) => { + break; + } + _ => { + panic!("unknown recvmsg() error"); + } + } + } + } + + // One packet lost. + assert_eq!(drop_counter, 1); + + // Close sockets + nix::unistd::close(in_socket).unwrap(); + nix::unistd::close(out_socket).unwrap(); +} + +#[cfg(any(target_os = "linux", target_os = "android",))] +mod linux_errqueue { + use super::FromStr; + use nix::sys::socket::*; + + // Send a UDP datagram to a bogus destination address and observe an ICMP error (v4). + // + // Disable the test on QEMU because QEMU emulation of IP_RECVERR is broken (as documented on PR + // #1514). + #[cfg_attr(qemu, ignore)] + #[test] + fn test_recverr_v4() { + #[repr(u8)] + enum IcmpTypes { + DestUnreach = 3, // ICMP_DEST_UNREACH + } + #[repr(u8)] + enum IcmpUnreachCodes { + PortUnreach = 3, // ICMP_PORT_UNREACH + } + + test_recverr_impl::( + "127.0.0.1:6800", + AddressFamily::Inet, + sockopt::Ipv4RecvErr, + libc::SO_EE_ORIGIN_ICMP, + IcmpTypes::DestUnreach as u8, + IcmpUnreachCodes::PortUnreach as u8, + // Closure handles protocol-specific testing and returns generic sock_extended_err for + // protocol-independent test impl. + |cmsg| { + if let ControlMessageOwned::Ipv4RecvErr(ext_err, err_addr) = + cmsg + { + if let Some(origin) = err_addr { + // Validate that our network error originated from 127.0.0.1:0. + assert_eq!(origin.sin_family, AddressFamily::Inet as _); + assert_eq!( + origin.sin_addr.s_addr, + u32::from_be(0x7f000001) + ); + assert_eq!(origin.sin_port, 0); + } else { + panic!("Expected some error origin"); + } + *ext_err + } else { + panic!("Unexpected control message {:?}", cmsg); + } + }, + ) + } + + // Essentially the same test as v4. + // + // Disable the test on QEMU because QEMU emulation of IPV6_RECVERR is broken (as documented on + // PR #1514). + #[cfg_attr(qemu, ignore)] + #[test] + fn test_recverr_v6() { + #[repr(u8)] + enum IcmpV6Types { + DestUnreach = 1, // ICMPV6_DEST_UNREACH + } + #[repr(u8)] + enum IcmpV6UnreachCodes { + PortUnreach = 4, // ICMPV6_PORT_UNREACH + } + + test_recverr_impl::( + "[::1]:6801", + AddressFamily::Inet6, + sockopt::Ipv6RecvErr, + libc::SO_EE_ORIGIN_ICMP6, + IcmpV6Types::DestUnreach as u8, + IcmpV6UnreachCodes::PortUnreach as u8, + // Closure handles protocol-specific testing and returns generic sock_extended_err for + // protocol-independent test impl. + |cmsg| { + if let ControlMessageOwned::Ipv6RecvErr(ext_err, err_addr) = + cmsg + { + if let Some(origin) = err_addr { + // Validate that our network error originated from localhost:0. + assert_eq!( + origin.sin6_family, + AddressFamily::Inet6 as _ + ); + assert_eq!( + origin.sin6_addr.s6_addr, + std::net::Ipv6Addr::LOCALHOST.octets() + ); + assert_eq!(origin.sin6_port, 0); + } else { + panic!("Expected some error origin"); + } + *ext_err + } else { + panic!("Unexpected control message {:?}", cmsg); + } + }, + ) + } + + fn test_recverr_impl( + sa: &str, + af: AddressFamily, + opt: OPT, + ee_origin: u8, + ee_type: u8, + ee_code: u8, + testf: TESTF, + ) where + OPT: SetSockOpt, + TESTF: FnOnce(&ControlMessageOwned) -> libc::sock_extended_err, + { + use nix::errno::Errno; + use std::io::IoSliceMut; + + const MESSAGE_CONTENTS: &str = "ABCDEF"; + let std_sa = std::net::SocketAddr::from_str(sa).unwrap(); + let sock_addr = SockaddrStorage::from(std_sa); + let sock = socket(af, SockType::Datagram, SockFlag::SOCK_CLOEXEC, None) + .unwrap(); + setsockopt(sock, opt, &true).unwrap(); + if let Err(e) = sendto( + sock, + MESSAGE_CONTENTS.as_bytes(), + &sock_addr, + MsgFlags::empty(), + ) { + assert_eq!(e, Errno::EADDRNOTAVAIL); + println!("{:?} not available, skipping test.", af); + return; + } + + let mut buf = [0u8; 8]; + let mut iovec = [IoSliceMut::new(&mut buf)]; + let mut cspace = cmsg_space!(libc::sock_extended_err, SA); + + let msg = recvmsg( + sock, + &mut iovec, + Some(&mut cspace), + MsgFlags::MSG_ERRQUEUE, + ) + .unwrap(); + // The sent message / destination associated with the error is returned: + assert_eq!(msg.bytes, MESSAGE_CONTENTS.as_bytes().len()); + // recvmsg(2): "The original destination address of the datagram that caused the error is + // supplied via msg_name;" however, this is not literally true. E.g., an earlier version + // of this test used 0.0.0.0 (::0) as the destination address, which was mutated into + // 127.0.0.1 (::1). + assert_eq!(msg.address, Some(sock_addr)); + + // Check for expected control message. + let ext_err = match msg.cmsgs().next() { + Some(cmsg) => testf(&cmsg), + None => panic!("No control message"), + }; + + assert_eq!(ext_err.ee_errno, libc::ECONNREFUSED as u32); + assert_eq!(ext_err.ee_origin, ee_origin); + // ip(7): ee_type and ee_code are set from the type and code fields of the ICMP (ICMPv6) + // header. + assert_eq!(ext_err.ee_type, ee_type); + assert_eq!(ext_err.ee_code, ee_code); + // ip(7): ee_info contains the discovered MTU for EMSGSIZE errors. + assert_eq!(ext_err.ee_info, 0); + + let bytes = msg.bytes; + assert_eq!(&buf[..bytes], MESSAGE_CONTENTS.as_bytes()); + } +} + +// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +#[cfg(target_os = "linux")] +#[test] +pub fn test_txtime() { + use nix::sys::socket::{ + bind, recvmsg, sendmsg, setsockopt, socket, sockopt, ControlMessage, + MsgFlags, SockFlag, SockType, SockaddrIn, + }; + use nix::sys::time::TimeValLike; + use nix::time::{clock_gettime, ClockId}; + + require_kernel_version!(test_txtime, ">= 5.8"); + + let sock_addr = SockaddrIn::from_str("127.0.0.1:6802").unwrap(); + + let ssock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .expect("send socket failed"); + + let txtime_cfg = libc::sock_txtime { + clockid: libc::CLOCK_MONOTONIC, + flags: 0, + }; + setsockopt(ssock, sockopt::TxTime, &txtime_cfg).unwrap(); + + let rsock = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + bind(rsock, &sock_addr).unwrap(); + + let sbuf = [0u8; 2048]; + let iov1 = [std::io::IoSlice::new(&sbuf)]; + + let now = clock_gettime(ClockId::CLOCK_MONOTONIC).unwrap(); + let delay = std::time::Duration::from_secs(1).into(); + let txtime = (now + delay).num_nanoseconds() as u64; + + let cmsg = ControlMessage::TxTime(&txtime); + sendmsg(ssock, &iov1, &[cmsg], MsgFlags::empty(), Some(&sock_addr)) + .unwrap(); + + let mut rbuf = [0u8; 2048]; + let mut iov2 = [std::io::IoSliceMut::new(&mut rbuf)]; + recvmsg::<()>(rsock, &mut iov2, None, MsgFlags::empty()).unwrap(); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_sockopt.rs b/bash-5.1/vendor/nix/test/sys/test_sockopt.rs new file mode 100644 index 0000000000000000000000000000000000000000..2ddbf77b83ff766aad92c8f5b5f7b1409761772d --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_sockopt.rs @@ -0,0 +1,329 @@ +#[cfg(any(target_os = "android", target_os = "linux"))] +use crate::*; +use nix::sys::socket::{ + getsockopt, setsockopt, socket, sockopt, AddressFamily, SockFlag, + SockProtocol, SockType, +}; +use rand::{thread_rng, Rng}; + +// NB: FreeBSD supports LOCAL_PEERCRED for SOCK_SEQPACKET, but OSX does not. +#[cfg(any(target_os = "dragonfly", target_os = "freebsd",))] +#[test] +pub fn test_local_peercred_seqpacket() { + use nix::{ + sys::socket::socketpair, + unistd::{Gid, Uid}, + }; + + let (fd1, _fd2) = socketpair( + AddressFamily::Unix, + SockType::SeqPacket, + None, + SockFlag::empty(), + ) + .unwrap(); + let xucred = getsockopt(fd1, sockopt::LocalPeerCred).unwrap(); + assert_eq!(xucred.version(), 0); + assert_eq!(Uid::from_raw(xucred.uid()), Uid::current()); + assert_eq!(Gid::from_raw(xucred.groups()[0]), Gid::current()); +} + +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios" +))] +#[test] +pub fn test_local_peercred_stream() { + use nix::{ + sys::socket::socketpair, + unistd::{Gid, Uid}, + }; + + let (fd1, _fd2) = socketpair( + AddressFamily::Unix, + SockType::Stream, + None, + SockFlag::empty(), + ) + .unwrap(); + let xucred = getsockopt(fd1, sockopt::LocalPeerCred).unwrap(); + assert_eq!(xucred.version(), 0); + assert_eq!(Uid::from_raw(xucred.uid()), Uid::current()); + assert_eq!(Gid::from_raw(xucred.groups()[0]), Gid::current()); +} + +#[cfg(target_os = "linux")] +#[test] +fn is_so_mark_functional() { + use nix::sys::socket::sockopt; + + require_capability!("is_so_mark_functional", CAP_NET_ADMIN); + + let s = socket( + AddressFamily::Inet, + SockType::Stream, + SockFlag::empty(), + None, + ) + .unwrap(); + setsockopt(s, sockopt::Mark, &1337).unwrap(); + let mark = getsockopt(s, sockopt::Mark).unwrap(); + assert_eq!(mark, 1337); +} + +#[test] +fn test_so_buf() { + let fd = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + SockProtocol::Udp, + ) + .unwrap(); + let bufsize: usize = thread_rng().gen_range(4096..131_072); + setsockopt(fd, sockopt::SndBuf, &bufsize).unwrap(); + let actual = getsockopt(fd, sockopt::SndBuf).unwrap(); + assert!(actual >= bufsize); + setsockopt(fd, sockopt::RcvBuf, &bufsize).unwrap(); + let actual = getsockopt(fd, sockopt::RcvBuf).unwrap(); + assert!(actual >= bufsize); +} + +#[test] +fn test_so_tcp_maxseg() { + use nix::sys::socket::{accept, bind, connect, listen, SockaddrIn}; + use nix::unistd::{close, write}; + use std::net::SocketAddrV4; + use std::str::FromStr; + + let std_sa = SocketAddrV4::from_str("127.0.0.1:4001").unwrap(); + let sock_addr = SockaddrIn::from(std_sa); + + let rsock = socket( + AddressFamily::Inet, + SockType::Stream, + SockFlag::empty(), + SockProtocol::Tcp, + ) + .unwrap(); + bind(rsock, &sock_addr).unwrap(); + listen(rsock, 10).unwrap(); + let initial = getsockopt(rsock, sockopt::TcpMaxSeg).unwrap(); + // Initial MSS is expected to be 536 (https://tools.ietf.org/html/rfc879#section-1) but some + // platforms keep it even lower. This might fail if you've tuned your initial MSS to be larger + // than 700 + cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + let segsize: u32 = 873; + assert!(initial < segsize); + setsockopt(rsock, sockopt::TcpMaxSeg, &segsize).unwrap(); + } else { + assert!(initial < 700); + } + } + + // Connect and check the MSS that was advertised + let ssock = socket( + AddressFamily::Inet, + SockType::Stream, + SockFlag::empty(), + SockProtocol::Tcp, + ) + .unwrap(); + connect(ssock, &sock_addr).unwrap(); + let rsess = accept(rsock).unwrap(); + write(rsess, b"hello").unwrap(); + let actual = getsockopt(ssock, sockopt::TcpMaxSeg).unwrap(); + // Actual max segment size takes header lengths into account, max IPv4 options (60 bytes) + max + // TCP options (40 bytes) are subtracted from the requested maximum as a lower boundary. + cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + assert!((segsize - 100) <= actual); + assert!(actual <= segsize); + } else { + assert!(initial < actual); + assert!(536 < actual); + } + } + close(rsock).unwrap(); + close(ssock).unwrap(); +} + +// The CI doesn't supported getsockopt and setsockopt on emulated processors. +// It's believed that a QEMU issue, the tests run ok on a fully emulated system. +// Current CI just run the binary with QEMU but the Kernel remains the same as the host. +// So the syscall doesn't work properly unless the kernel is also emulated. +#[test] +#[cfg(all( + any(target_arch = "x86", target_arch = "x86_64"), + any(target_os = "freebsd", target_os = "linux") +))] +fn test_tcp_congestion() { + use std::ffi::OsString; + + let fd = socket( + AddressFamily::Inet, + SockType::Stream, + SockFlag::empty(), + None, + ) + .unwrap(); + + let val = getsockopt(fd, sockopt::TcpCongestion).unwrap(); + setsockopt(fd, sockopt::TcpCongestion, &val).unwrap(); + + setsockopt( + fd, + sockopt::TcpCongestion, + &OsString::from("tcp_congestion_does_not_exist"), + ) + .unwrap_err(); + + assert_eq!(getsockopt(fd, sockopt::TcpCongestion).unwrap(), val); +} + +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_bindtodevice() { + skip_if_not_root!("test_bindtodevice"); + + let fd = socket( + AddressFamily::Inet, + SockType::Stream, + SockFlag::empty(), + None, + ) + .unwrap(); + + let val = getsockopt(fd, sockopt::BindToDevice).unwrap(); + setsockopt(fd, sockopt::BindToDevice, &val).unwrap(); + + assert_eq!(getsockopt(fd, sockopt::BindToDevice).unwrap(), val); +} + +#[test] +fn test_so_tcp_keepalive() { + let fd = socket( + AddressFamily::Inet, + SockType::Stream, + SockFlag::empty(), + SockProtocol::Tcp, + ) + .unwrap(); + setsockopt(fd, sockopt::KeepAlive, &true).unwrap(); + assert!(getsockopt(fd, sockopt::KeepAlive).unwrap()); + + #[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux" + ))] + { + let x = getsockopt(fd, sockopt::TcpKeepIdle).unwrap(); + setsockopt(fd, sockopt::TcpKeepIdle, &(x + 1)).unwrap(); + assert_eq!(getsockopt(fd, sockopt::TcpKeepIdle).unwrap(), x + 1); + + let x = getsockopt(fd, sockopt::TcpKeepCount).unwrap(); + setsockopt(fd, sockopt::TcpKeepCount, &(x + 1)).unwrap(); + assert_eq!(getsockopt(fd, sockopt::TcpKeepCount).unwrap(), x + 1); + + let x = getsockopt(fd, sockopt::TcpKeepInterval).unwrap(); + setsockopt(fd, sockopt::TcpKeepInterval, &(x + 1)).unwrap(); + assert_eq!(getsockopt(fd, sockopt::TcpKeepInterval).unwrap(), x + 1); + } +} + +#[test] +#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] +fn test_ttl_opts() { + let fd4 = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + setsockopt(fd4, sockopt::Ipv4Ttl, &1) + .expect("setting ipv4ttl on an inet socket should succeed"); + let fd6 = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + setsockopt(fd6, sockopt::Ipv6Ttl, &1) + .expect("setting ipv6ttl on an inet6 socket should succeed"); +} + +#[test] +#[cfg(any(target_os = "ios", target_os = "macos"))] +fn test_dontfrag_opts() { + let fd4 = socket( + AddressFamily::Inet, + SockType::Stream, + SockFlag::empty(), + SockProtocol::Tcp, + ) + .unwrap(); + setsockopt(fd4, sockopt::IpDontFrag, &true) + .expect("setting IP_DONTFRAG on an inet stream socket should succeed"); + setsockopt(fd4, sockopt::IpDontFrag, &false).expect( + "unsetting IP_DONTFRAG on an inet stream socket should succeed", + ); + let fd4d = socket( + AddressFamily::Inet, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + setsockopt(fd4d, sockopt::IpDontFrag, &true).expect( + "setting IP_DONTFRAG on an inet datagram socket should succeed", + ); + setsockopt(fd4d, sockopt::IpDontFrag, &false).expect( + "unsetting IP_DONTFRAG on an inet datagram socket should succeed", + ); +} + +#[test] +#[cfg(any( + target_os = "android", + target_os = "ios", + target_os = "linux", + target_os = "macos", +))] +// Disable the test under emulation because it fails in Cirrus-CI. Lack +// of QEMU support is suspected. +#[cfg_attr(qemu, ignore)] +fn test_v6dontfrag_opts() { + let fd6 = socket( + AddressFamily::Inet6, + SockType::Stream, + SockFlag::empty(), + SockProtocol::Tcp, + ) + .unwrap(); + setsockopt(fd6, sockopt::Ipv6DontFrag, &true).expect( + "setting IPV6_DONTFRAG on an inet6 stream socket should succeed", + ); + setsockopt(fd6, sockopt::Ipv6DontFrag, &false).expect( + "unsetting IPV6_DONTFRAG on an inet6 stream socket should succeed", + ); + let fd6d = socket( + AddressFamily::Inet6, + SockType::Datagram, + SockFlag::empty(), + None, + ) + .unwrap(); + setsockopt(fd6d, sockopt::Ipv6DontFrag, &true).expect( + "setting IPV6_DONTFRAG on an inet6 datagram socket should succeed", + ); + setsockopt(fd6d, sockopt::Ipv6DontFrag, &false).expect( + "unsetting IPV6_DONTFRAG on an inet6 datagram socket should succeed", + ); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_stat.rs b/bash-5.1/vendor/nix/test/sys/test_stat.rs new file mode 100644 index 0000000000000000000000000000000000000000..2f26e789c78a8fe4f3cf3d3ce5cd105d53b69421 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_stat.rs @@ -0,0 +1,27 @@ +#[cfg(target_os = "freebsd")] +#[test] +fn test_chflags() { + use nix::{ + sys::stat::{fstat, FileFlag}, + unistd::chflags, + }; + use std::os::unix::io::AsRawFd; + use tempfile::NamedTempFile; + + let f = NamedTempFile::new().unwrap(); + + let initial = FileFlag::from_bits_truncate( + fstat(f.as_raw_fd()).unwrap().st_flags.into(), + ); + // UF_OFFLINE is preserved by all FreeBSD file systems, but not interpreted + // in any way, so it's handy for testing. + let commanded = initial ^ FileFlag::UF_OFFLINE; + + chflags(f.path(), commanded).unwrap(); + + let changed = FileFlag::from_bits_truncate( + fstat(f.as_raw_fd()).unwrap().st_flags.into(), + ); + + assert_eq!(commanded, changed); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_sysinfo.rs b/bash-5.1/vendor/nix/test/sys/test_sysinfo.rs new file mode 100644 index 0000000000000000000000000000000000000000..2897366effc905dde51ca2fc686d55f73233f026 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_sysinfo.rs @@ -0,0 +1,20 @@ +use nix::sys::sysinfo::*; + +#[test] +fn sysinfo_works() { + let info = sysinfo().unwrap(); + + let (l1, l5, l15) = info.load_average(); + assert!(l1 >= 0.0); + assert!(l5 >= 0.0); + assert!(l15 >= 0.0); + + info.uptime(); // just test Duration construction + + assert!( + info.swap_free() <= info.swap_total(), + "more swap available than installed (free: {}, total: {})", + info.swap_free(), + info.swap_total() + ); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_termios.rs b/bash-5.1/vendor/nix/test/sys/test_termios.rs new file mode 100644 index 0000000000000000000000000000000000000000..aaf00084fa050bbf346c7ab53ff959dd1164f0af --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_termios.rs @@ -0,0 +1,136 @@ +use std::os::unix::prelude::*; +use tempfile::tempfile; + +use nix::errno::Errno; +use nix::fcntl; +use nix::pty::openpty; +use nix::sys::termios::{self, tcgetattr, LocalFlags, OutputFlags}; +use nix::unistd::{close, read, write}; + +/// Helper function analogous to `std::io::Write::write_all`, but for `RawFd`s +fn write_all(f: RawFd, buf: &[u8]) { + let mut len = 0; + while len < buf.len() { + len += write(f, &buf[len..]).unwrap(); + } +} + +// Test tcgetattr on a terminal +#[test] +fn test_tcgetattr_pty() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + let pty = openpty(None, None).expect("openpty failed"); + termios::tcgetattr(pty.slave).unwrap(); + close(pty.master).expect("closing the master failed"); + close(pty.slave).expect("closing the slave failed"); +} + +// Test tcgetattr on something that isn't a terminal +#[test] +fn test_tcgetattr_enotty() { + let file = tempfile().unwrap(); + assert_eq!( + termios::tcgetattr(file.as_raw_fd()).err(), + Some(Errno::ENOTTY) + ); +} + +// Test tcgetattr on an invalid file descriptor +#[test] +fn test_tcgetattr_ebadf() { + assert_eq!(termios::tcgetattr(-1).err(), Some(Errno::EBADF)); +} + +// Test modifying output flags +#[test] +fn test_output_flags() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + // Open one pty to get attributes for the second one + let mut termios = { + let pty = openpty(None, None).expect("openpty failed"); + assert!(pty.master > 0); + assert!(pty.slave > 0); + let termios = tcgetattr(pty.slave).expect("tcgetattr failed"); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + termios + }; + + // Make sure postprocessing '\r' isn't specified by default or this test is useless. + assert!(!termios + .output_flags + .contains(OutputFlags::OPOST | OutputFlags::OCRNL)); + + // Specify that '\r' characters should be transformed to '\n' + // OPOST is specified to enable post-processing + termios + .output_flags + .insert(OutputFlags::OPOST | OutputFlags::OCRNL); + + // Open a pty + let pty = openpty(None, &termios).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Write into the master + let string = "foofoofoo\r"; + write_all(pty.master, string.as_bytes()); + + // Read from the slave verifying that the output has been properly transformed + let mut buf = [0u8; 10]; + crate::read_exact(pty.slave, &mut buf); + let transformed_string = "foofoofoo\n"; + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + assert_eq!(&buf, transformed_string.as_bytes()); +} + +// Test modifying local flags +#[test] +fn test_local_flags() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + // Open one pty to get attributes for the second one + let mut termios = { + let pty = openpty(None, None).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + let termios = tcgetattr(pty.slave).unwrap(); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + termios + }; + + // Make sure echo is specified by default or this test is useless. + assert!(termios.local_flags.contains(LocalFlags::ECHO)); + + // Disable local echo + termios.local_flags.remove(LocalFlags::ECHO); + + // Open a new pty with our modified termios settings + let pty = openpty(None, &termios).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Set the master is in nonblocking mode or reading will never return. + let flags = fcntl::fcntl(pty.master, fcntl::F_GETFL).unwrap(); + let new_flags = + fcntl::OFlag::from_bits_truncate(flags) | fcntl::OFlag::O_NONBLOCK; + fcntl::fcntl(pty.master, fcntl::F_SETFL(new_flags)).unwrap(); + + // Write into the master + let string = "foofoofoo\r"; + write_all(pty.master, string.as_bytes()); + + // Try to read from the master, which should not have anything as echoing was disabled. + let mut buf = [0u8; 10]; + let read = read(pty.master, &mut buf).unwrap_err(); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + assert_eq!(read, Errno::EAGAIN); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_timerfd.rs b/bash-5.1/vendor/nix/test/sys/test_timerfd.rs new file mode 100644 index 0000000000000000000000000000000000000000..927cc70d1d10b5bb040b24ef6a8256f6b5c387d2 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_timerfd.rs @@ -0,0 +1,69 @@ +use nix::sys::time::{TimeSpec, TimeValLike}; +use nix::sys::timerfd::{ + ClockId, Expiration, TimerFd, TimerFlags, TimerSetTimeFlags, +}; +use std::time::Instant; + +#[test] +pub fn test_timerfd_oneshot() { + let timer = + TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + + let before = Instant::now(); + + timer + .set( + Expiration::OneShot(TimeSpec::seconds(1)), + TimerSetTimeFlags::empty(), + ) + .unwrap(); + + timer.wait().unwrap(); + + let millis = before.elapsed().as_millis(); + assert!(millis > 900); +} + +#[test] +pub fn test_timerfd_interval() { + let timer = + TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + + let before = Instant::now(); + timer + .set( + Expiration::IntervalDelayed( + TimeSpec::seconds(1), + TimeSpec::seconds(2), + ), + TimerSetTimeFlags::empty(), + ) + .unwrap(); + + timer.wait().unwrap(); + + let start_delay = before.elapsed().as_millis(); + assert!(start_delay > 900); + + timer.wait().unwrap(); + + let interval_delay = before.elapsed().as_millis(); + assert!(interval_delay > 2900); +} + +#[test] +pub fn test_timerfd_unset() { + let timer = + TimerFd::new(ClockId::CLOCK_MONOTONIC, TimerFlags::empty()).unwrap(); + + timer + .set( + Expiration::OneShot(TimeSpec::seconds(1)), + TimerSetTimeFlags::empty(), + ) + .unwrap(); + + timer.unset().unwrap(); + + assert!(timer.get().unwrap() == None); +} diff --git a/bash-5.1/vendor/nix/test/sys/test_uio.rs b/bash-5.1/vendor/nix/test/sys/test_uio.rs new file mode 100644 index 0000000000000000000000000000000000000000..0f4b8a65680cc01205b7a991d080e3796f37f061 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_uio.rs @@ -0,0 +1,270 @@ +use nix::sys::uio::*; +use nix::unistd::*; +use rand::distributions::Alphanumeric; +use rand::{thread_rng, Rng}; +use std::fs::OpenOptions; +use std::io::IoSlice; +use std::os::unix::io::AsRawFd; +use std::{cmp, iter}; + +#[cfg(not(target_os = "redox"))] +use std::io::IoSliceMut; + +use tempfile::tempdir; +#[cfg(not(target_os = "redox"))] +use tempfile::tempfile; + +#[test] +fn test_writev() { + let mut to_write = Vec::with_capacity(16 * 128); + for _ in 0..16 { + let s: String = thread_rng() + .sample_iter(&Alphanumeric) + .map(char::from) + .take(128) + .collect(); + let b = s.as_bytes(); + to_write.extend(b.iter().cloned()); + } + // Allocate and fill iovecs + let mut iovecs = Vec::new(); + let mut consumed = 0; + while consumed < to_write.len() { + let left = to_write.len() - consumed; + let slice_len = if left <= 64 { + left + } else { + thread_rng().gen_range(64..cmp::min(256, left)) + }; + let b = &to_write[consumed..consumed + slice_len]; + iovecs.push(IoSlice::new(b)); + consumed += slice_len; + } + let pipe_res = pipe(); + let (reader, writer) = pipe_res.expect("Couldn't create pipe"); + // FileDesc will close its filedesc (reader). + let mut read_buf: Vec = iter::repeat(0u8).take(128 * 16).collect(); + // Blocking io, should write all data. + let write_res = writev(writer, &iovecs); + let written = write_res.expect("couldn't write"); + // Check whether we written all data + assert_eq!(to_write.len(), written); + let read_res = read(reader, &mut read_buf[..]); + let read = read_res.expect("couldn't read"); + // Check we have read as much as we written + assert_eq!(read, written); + // Check equality of written and read data + assert_eq!(&to_write, &read_buf); + close(writer).expect("closed writer"); + close(reader).expect("closed reader"); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_readv() { + let s: String = thread_rng() + .sample_iter(&Alphanumeric) + .map(char::from) + .take(128) + .collect(); + let to_write = s.as_bytes().to_vec(); + let mut storage = Vec::new(); + let mut allocated = 0; + while allocated < to_write.len() { + let left = to_write.len() - allocated; + let vec_len = if left <= 64 { + left + } else { + thread_rng().gen_range(64..cmp::min(256, left)) + }; + let v: Vec = iter::repeat(0u8).take(vec_len).collect(); + storage.push(v); + allocated += vec_len; + } + let mut iovecs = Vec::with_capacity(storage.len()); + for v in &mut storage { + iovecs.push(IoSliceMut::new(&mut v[..])); + } + let (reader, writer) = pipe().expect("couldn't create pipe"); + // Blocking io, should write all data. + write(writer, &to_write).expect("write failed"); + let read = readv(reader, &mut iovecs[..]).expect("read failed"); + // Check whether we've read all data + assert_eq!(to_write.len(), read); + // Cccumulate data from iovecs + let mut read_buf = Vec::with_capacity(to_write.len()); + for iovec in &iovecs { + read_buf.extend(iovec.iter().cloned()); + } + // Check whether iovecs contain all written data + assert_eq!(read_buf.len(), to_write.len()); + // Check equality of written and read data + assert_eq!(&read_buf, &to_write); + close(reader).expect("couldn't close reader"); + close(writer).expect("couldn't close writer"); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_pwrite() { + use std::io::Read; + + let mut file = tempfile().unwrap(); + let buf = [1u8; 8]; + assert_eq!(Ok(8), pwrite(file.as_raw_fd(), &buf, 8)); + let mut file_content = Vec::new(); + file.read_to_end(&mut file_content).unwrap(); + let mut expected = vec![0u8; 8]; + expected.extend(vec![1; 8]); + assert_eq!(file_content, expected); +} + +#[test] +fn test_pread() { + use std::io::Write; + + let tempdir = tempdir().unwrap(); + + let path = tempdir.path().join("pread_test_file"); + let mut file = OpenOptions::new() + .write(true) + .read(true) + .create(true) + .truncate(true) + .open(path) + .unwrap(); + let file_content: Vec = (0..64).collect(); + file.write_all(&file_content).unwrap(); + + let mut buf = [0u8; 16]; + assert_eq!(Ok(16), pread(file.as_raw_fd(), &mut buf, 16)); + let expected: Vec<_> = (16..32).collect(); + assert_eq!(&buf[..], &expected[..]); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_pwritev() { + use std::io::Read; + + let to_write: Vec = (0..128).collect(); + let expected: Vec = [vec![0; 100], to_write.clone()].concat(); + + let iovecs = [ + IoSlice::new(&to_write[0..17]), + IoSlice::new(&to_write[17..64]), + IoSlice::new(&to_write[64..128]), + ]; + + let tempdir = tempdir().unwrap(); + + // pwritev them into a temporary file + let path = tempdir.path().join("pwritev_test_file"); + let mut file = OpenOptions::new() + .write(true) + .read(true) + .create(true) + .truncate(true) + .open(path) + .unwrap(); + + let written = pwritev(file.as_raw_fd(), &iovecs, 100).ok().unwrap(); + assert_eq!(written, to_write.len()); + + // Read the data back and make sure it matches + let mut contents = Vec::new(); + file.read_to_end(&mut contents).unwrap(); + assert_eq!(contents, expected); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_preadv() { + use std::io::Write; + + let to_write: Vec = (0..200).collect(); + let expected: Vec = (100..200).collect(); + + let tempdir = tempdir().unwrap(); + + let path = tempdir.path().join("preadv_test_file"); + + let mut file = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .truncate(true) + .open(path) + .unwrap(); + file.write_all(&to_write).unwrap(); + + let mut buffers: Vec> = vec![vec![0; 24], vec![0; 1], vec![0; 75]]; + + { + // Borrow the buffers into IoVecs and preadv into them + let mut iovecs: Vec<_> = buffers + .iter_mut() + .map(|buf| IoSliceMut::new(&mut buf[..])) + .collect(); + assert_eq!(Ok(100), preadv(file.as_raw_fd(), &mut iovecs, 100)); + } + + let all = buffers.concat(); + assert_eq!(all, expected); +} + +#[test] +#[cfg(all(target_os = "linux", not(target_env = "uclibc")))] +// uclibc doesn't implement process_vm_readv +// qemu-user doesn't implement process_vm_readv/writev on most arches +#[cfg_attr(qemu, ignore)] +fn test_process_vm_readv() { + use crate::*; + use nix::sys::signal::*; + use nix::sys::wait::*; + use nix::unistd::ForkResult::*; + + require_capability!("test_process_vm_readv", CAP_SYS_PTRACE); + let _m = crate::FORK_MTX.lock(); + + // Pre-allocate memory in the child, since allocation isn't safe + // post-fork (~= async-signal-safe) + let mut vector = vec![1u8, 2, 3, 4, 5]; + + let (r, w) = pipe().unwrap(); + match unsafe { fork() }.expect("Error: Fork Failed") { + Parent { child } => { + close(w).unwrap(); + // wait for child + read(r, &mut [0u8]).unwrap(); + close(r).unwrap(); + + let ptr = vector.as_ptr() as usize; + let remote_iov = RemoteIoVec { base: ptr, len: 5 }; + let mut buf = vec![0u8; 5]; + + let ret = process_vm_readv( + child, + &mut [IoSliceMut::new(&mut buf)], + &[remote_iov], + ); + + kill(child, SIGTERM).unwrap(); + waitpid(child, None).unwrap(); + + assert_eq!(Ok(5), ret); + assert_eq!(20u8, buf.iter().sum()); + } + Child => { + let _ = close(r); + for i in &mut vector { + *i += 1; + } + let _ = write(w, b"\0"); + let _ = close(w); + loop { + pause(); + } + } + } +} diff --git a/bash-5.1/vendor/nix/test/sys/test_wait.rs b/bash-5.1/vendor/nix/test/sys/test_wait.rs new file mode 100644 index 0000000000000000000000000000000000000000..d472f1ec19b8817ce93ef1c483e72d34fbf1a637 --- /dev/null +++ b/bash-5.1/vendor/nix/test/sys/test_wait.rs @@ -0,0 +1,257 @@ +use libc::_exit; +use nix::errno::Errno; +use nix::sys::signal::*; +use nix::sys::wait::*; +use nix::unistd::ForkResult::*; +use nix::unistd::*; + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_wait_signal() { + let _m = crate::FORK_MTX.lock(); + + // Safe: The child only calls `pause` and/or `_exit`, which are async-signal-safe. + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => { + pause(); + unsafe { _exit(123) } + } + Parent { child } => { + kill(child, Some(SIGKILL)).expect("Error: Kill Failed"); + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::Signaled(child, SIGKILL, false)) + ); + } + } +} + +#[test] +#[cfg(any( + target_os = "android", + target_os = "freebsd", + //target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), +))] +#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))] +fn test_waitid_signal() { + let _m = crate::FORK_MTX.lock(); + + // Safe: The child only calls `pause` and/or `_exit`, which are async-signal-safe. + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => { + pause(); + unsafe { _exit(123) } + } + Parent { child } => { + kill(child, Some(SIGKILL)).expect("Error: Kill Failed"); + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::Signaled(child, SIGKILL, false)), + ); + } + } +} + +#[test] +fn test_wait_exit() { + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is async-signal-safe. + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => unsafe { + _exit(12); + }, + Parent { child } => { + assert_eq!(waitpid(child, None), Ok(WaitStatus::Exited(child, 12))); + } + } +} + +#[cfg(not(target_os = "haiku"))] +#[test] +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), +))] +#[cfg(not(any(target_arch = "mips", target_arch = "mips64")))] +fn test_waitid_exit() { + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is async-signal-safe. + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => unsafe { + _exit(12); + }, + Parent { child } => { + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::Exited(child, 12)), + ); + } + } +} + +#[test] +fn test_waitstatus_from_raw() { + let pid = Pid::from_raw(1); + assert_eq!( + WaitStatus::from_raw(pid, 0x0002), + Ok(WaitStatus::Signaled(pid, Signal::SIGINT, false)) + ); + assert_eq!( + WaitStatus::from_raw(pid, 0x0200), + Ok(WaitStatus::Exited(pid, 2)) + ); + assert_eq!(WaitStatus::from_raw(pid, 0x7f7f), Err(Errno::EINVAL)); +} + +#[test] +fn test_waitstatus_pid() { + let _m = crate::FORK_MTX.lock(); + + match unsafe { fork() }.unwrap() { + Child => unsafe { _exit(0) }, + Parent { child } => { + let status = waitpid(child, None).unwrap(); + assert_eq!(status.pid(), Some(child)); + } + } +} + +#[test] +#[cfg(any( + target_os = "android", + target_os = "freebsd", + target_os = "haiku", + all(target_os = "linux", not(target_env = "uclibc")), +))] +fn test_waitid_pid() { + let _m = crate::FORK_MTX.lock(); + + match unsafe { fork() }.unwrap() { + Child => unsafe { _exit(0) }, + Parent { child } => { + let status = waitid(Id::Pid(child), WaitPidFlag::WEXITED).unwrap(); + assert_eq!(status.pid(), Some(child)); + } + } +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +// FIXME: qemu-user doesn't implement ptrace on most arches +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +mod ptrace { + use crate::*; + use libc::_exit; + use nix::sys::ptrace::{self, Event, Options}; + use nix::sys::signal::*; + use nix::sys::wait::*; + use nix::unistd::ForkResult::*; + use nix::unistd::*; + + fn ptrace_child() -> ! { + ptrace::traceme().unwrap(); + // As recommended by ptrace(2), raise SIGTRAP to pause the child + // until the parent is ready to continue + raise(SIGTRAP).unwrap(); + unsafe { _exit(0) } + } + + fn ptrace_wait_parent(child: Pid) { + // Wait for the raised SIGTRAP + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::Stopped(child, SIGTRAP)) + ); + // We want to test a syscall stop and a PTRACE_EVENT stop + ptrace::setoptions( + child, + Options::PTRACE_O_TRACESYSGOOD | Options::PTRACE_O_TRACEEXIT, + ) + .expect("setoptions failed"); + + // First, stop on the next system call, which will be exit() + ptrace::syscall(child, None).expect("syscall failed"); + assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child))); + // Then get the ptrace event for the process exiting + ptrace::cont(child, None).expect("cont failed"); + assert_eq!( + waitpid(child, None), + Ok(WaitStatus::PtraceEvent( + child, + SIGTRAP, + Event::PTRACE_EVENT_EXIT as i32 + )) + ); + // Finally get the normal wait() result, now that the process has exited + ptrace::cont(child, None).expect("cont failed"); + assert_eq!(waitpid(child, None), Ok(WaitStatus::Exited(child, 0))); + } + + #[cfg(not(target_env = "uclibc"))] + fn ptrace_waitid_parent(child: Pid) { + // Wait for the raised SIGTRAP + // + // Unlike waitpid(), waitid() can distinguish trap events from regular + // stop events, so unlike ptrace_wait_parent(), we get a PtraceEvent here + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::PtraceEvent(child, SIGTRAP, 0)), + ); + // We want to test a syscall stop and a PTRACE_EVENT stop + ptrace::setoptions( + child, + Options::PTRACE_O_TRACESYSGOOD | Options::PTRACE_O_TRACEEXIT, + ) + .expect("setopts failed"); + + // First, stop on the next system call, which will be exit() + ptrace::syscall(child, None).expect("syscall failed"); + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::PtraceSyscall(child)), + ); + // Then get the ptrace event for the process exiting + ptrace::cont(child, None).expect("cont failed"); + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::PtraceEvent( + child, + SIGTRAP, + Event::PTRACE_EVENT_EXIT as i32 + )), + ); + // Finally get the normal wait() result, now that the process has exited + ptrace::cont(child, None).expect("cont failed"); + assert_eq!( + waitid(Id::Pid(child), WaitPidFlag::WEXITED), + Ok(WaitStatus::Exited(child, 0)), + ); + } + + #[test] + fn test_wait_ptrace() { + require_capability!("test_wait_ptrace", CAP_SYS_PTRACE); + let _m = crate::FORK_MTX.lock(); + + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => ptrace_child(), + Parent { child } => ptrace_wait_parent(child), + } + } + + #[test] + #[cfg(not(target_env = "uclibc"))] + fn test_waitid_ptrace() { + require_capability!("test_waitid_ptrace", CAP_SYS_PTRACE); + let _m = crate::FORK_MTX.lock(); + + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => ptrace_child(), + Parent { child } => ptrace_waitid_parent(child), + } + } +} diff --git a/bash-5.1/vendor/nix/test/test.rs b/bash-5.1/vendor/nix/test/test.rs new file mode 100644 index 0000000000000000000000000000000000000000..f725ef97a0807ca4fc7ccdf2db4654c20ab9f683 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test.rs @@ -0,0 +1,123 @@ +#[macro_use] +extern crate cfg_if; +#[cfg_attr(not(any(target_os = "redox", target_os = "haiku")), macro_use)] +extern crate nix; +#[macro_use] +extern crate lazy_static; + +mod common; +mod sys; +#[cfg(not(target_os = "redox"))] +mod test_dir; +mod test_fcntl; +#[cfg(any(target_os = "android", target_os = "linux"))] +mod test_kmod; +#[cfg(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "fushsia", + target_os = "linux", + target_os = "netbsd" +))] +mod test_mq; +#[cfg(not(target_os = "redox"))] +mod test_net; +mod test_nix_path; +#[cfg(target_os = "freebsd")] +mod test_nmount; +mod test_poll; +#[cfg(not(any( + target_os = "redox", + target_os = "fuchsia", + target_os = "haiku" +)))] +mod test_pty; +mod test_resource; +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "linux" +))] +mod test_sched; +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos" +))] +mod test_sendfile; +mod test_stat; +mod test_time; +#[cfg(all( + any( + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd" + ), + feature = "time", + feature = "signal" +))] +mod test_timer; +mod test_unistd; + +use nix::unistd::{chdir, getcwd, read}; +use parking_lot::{Mutex, RwLock, RwLockWriteGuard}; +use std::os::unix::io::RawFd; +use std::path::PathBuf; + +/// Helper function analogous to `std::io::Read::read_exact`, but for `RawFD`s +fn read_exact(f: RawFd, buf: &mut [u8]) { + let mut len = 0; + while len < buf.len() { + // get_mut would be better than split_at_mut, but it requires nightly + let (_, remaining) = buf.split_at_mut(len); + len += read(f, remaining).unwrap(); + } +} + +lazy_static! { + /// Any test that changes the process's current working directory must grab + /// the RwLock exclusively. Any process that cares about the current + /// working directory must grab it shared. + pub static ref CWD_LOCK: RwLock<()> = RwLock::new(()); + /// Any test that creates child processes must grab this mutex, regardless + /// of what it does with those children. + pub static ref FORK_MTX: Mutex<()> = Mutex::new(()); + /// Any test that changes the process's supplementary groups must grab this + /// mutex + pub static ref GROUPS_MTX: Mutex<()> = Mutex::new(()); + /// Any tests that loads or unloads kernel modules must grab this mutex + pub static ref KMOD_MTX: Mutex<()> = Mutex::new(()); + /// Any test that calls ptsname(3) must grab this mutex. + pub static ref PTSNAME_MTX: Mutex<()> = Mutex::new(()); + /// Any test that alters signal handling must grab this mutex. + pub static ref SIGNAL_MTX: Mutex<()> = Mutex::new(()); +} + +/// RAII object that restores a test's original directory on drop +struct DirRestore<'a> { + d: PathBuf, + _g: RwLockWriteGuard<'a, ()>, +} + +impl<'a> DirRestore<'a> { + fn new() -> Self { + let guard = crate::CWD_LOCK.write(); + DirRestore { + _g: guard, + d: getcwd().unwrap(), + } + } +} + +impl<'a> Drop for DirRestore<'a> { + fn drop(&mut self) { + let r = chdir(&self.d); + if std::thread::panicking() { + r.unwrap(); + } + } +} diff --git a/bash-5.1/vendor/nix/test/test_clearenv.rs b/bash-5.1/vendor/nix/test/test_clearenv.rs new file mode 100644 index 0000000000000000000000000000000000000000..28a77680498ca5cafc041aa011b20cc6216963ee --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_clearenv.rs @@ -0,0 +1,9 @@ +use std::env; + +#[test] +fn clearenv() { + env::set_var("FOO", "BAR"); + unsafe { nix::env::clearenv() }.unwrap(); + assert_eq!(env::var("FOO").unwrap_err(), env::VarError::NotPresent); + assert_eq!(env::vars().count(), 0); +} diff --git a/bash-5.1/vendor/nix/test/test_dir.rs b/bash-5.1/vendor/nix/test/test_dir.rs new file mode 100644 index 0000000000000000000000000000000000000000..f66299210e0eb83b10fbbe158cc12cd1dd5baa38 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_dir.rs @@ -0,0 +1,65 @@ +use nix::dir::{Dir, Type}; +use nix::fcntl::OFlag; +use nix::sys::stat::Mode; +use std::fs::File; +use tempfile::tempdir; + +#[cfg(test)] +fn flags() -> OFlag { + #[cfg(target_os = "illumos")] + let f = OFlag::O_RDONLY | OFlag::O_CLOEXEC; + + #[cfg(not(target_os = "illumos"))] + let f = OFlag::O_RDONLY | OFlag::O_CLOEXEC | OFlag::O_DIRECTORY; + + f +} + +#[test] +#[allow(clippy::unnecessary_sort_by)] // False positive +fn read() { + let tmp = tempdir().unwrap(); + File::create(&tmp.path().join("foo")).unwrap(); + std::os::unix::fs::symlink("foo", tmp.path().join("bar")).unwrap(); + let mut dir = Dir::open(tmp.path(), flags(), Mode::empty()).unwrap(); + let mut entries: Vec<_> = dir.iter().map(|e| e.unwrap()).collect(); + entries.sort_by(|a, b| a.file_name().cmp(b.file_name())); + let entry_names: Vec<_> = entries + .iter() + .map(|e| e.file_name().to_str().unwrap().to_owned()) + .collect(); + assert_eq!(&entry_names[..], &[".", "..", "bar", "foo"]); + + // Check file types. The system is allowed to return DT_UNKNOWN (aka None here) but if it does + // return a type, ensure it's correct. + assert!(&[Some(Type::Directory), None].contains(&entries[0].file_type())); // .: dir + assert!(&[Some(Type::Directory), None].contains(&entries[1].file_type())); // ..: dir + assert!(&[Some(Type::Symlink), None].contains(&entries[2].file_type())); // bar: symlink + assert!(&[Some(Type::File), None].contains(&entries[3].file_type())); // foo: regular file +} + +#[test] +fn rewind() { + let tmp = tempdir().unwrap(); + let mut dir = Dir::open(tmp.path(), flags(), Mode::empty()).unwrap(); + let entries1: Vec<_> = dir + .iter() + .map(|e| e.unwrap().file_name().to_owned()) + .collect(); + let entries2: Vec<_> = dir + .iter() + .map(|e| e.unwrap().file_name().to_owned()) + .collect(); + let entries3: Vec<_> = dir + .into_iter() + .map(|e| e.unwrap().file_name().to_owned()) + .collect(); + assert_eq!(entries1, entries2); + assert_eq!(entries2, entries3); +} + +#[cfg(not(target_os = "haiku"))] +#[test] +fn ebadf() { + assert_eq!(Dir::from_fd(-1).unwrap_err(), nix::Error::EBADF); +} diff --git a/bash-5.1/vendor/nix/test/test_fcntl.rs b/bash-5.1/vendor/nix/test/test_fcntl.rs new file mode 100644 index 0000000000000000000000000000000000000000..f4adee21fc431c39bb70cdc0b5be8f12a68df6ca --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_fcntl.rs @@ -0,0 +1,565 @@ +#[cfg(not(target_os = "redox"))] +use nix::errno::*; +#[cfg(not(target_os = "redox"))] +use nix::fcntl::{open, readlink, OFlag}; +#[cfg(not(target_os = "redox"))] +use nix::fcntl::{openat, readlinkat, renameat}; +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +use nix::fcntl::{renameat2, RenameFlags}; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::Mode; +#[cfg(not(target_os = "redox"))] +use nix::unistd::{close, read}; +#[cfg(not(target_os = "redox"))] +use std::fs::File; +#[cfg(not(target_os = "redox"))] +use std::io::prelude::*; +#[cfg(not(target_os = "redox"))] +use std::os::unix::fs; +#[cfg(not(target_os = "redox"))] +use tempfile::{self, NamedTempFile}; + +#[test] +#[cfg(not(target_os = "redox"))] +// QEMU does not handle openat well enough to satisfy this test +// https://gitlab.com/qemu-project/qemu/-/issues/829 +#[cfg_attr(qemu, ignore)] +fn test_openat() { + const CONTENTS: &[u8] = b"abcd"; + let mut tmp = NamedTempFile::new().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let dirfd = + open(tmp.path().parent().unwrap(), OFlag::empty(), Mode::empty()) + .unwrap(); + let fd = openat( + dirfd, + tmp.path().file_name().unwrap(), + OFlag::O_RDONLY, + Mode::empty(), + ) + .unwrap(); + + let mut buf = [0u8; 1024]; + assert_eq!(4, read(fd, &mut buf).unwrap()); + assert_eq!(CONTENTS, &buf[0..4]); + + close(fd).unwrap(); + close(dirfd).unwrap(); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_renameat() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = + open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + File::create(&old_path).unwrap(); + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = + open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap(); + assert_eq!( + renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap_err(), + Errno::ENOENT + ); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); + assert!(new_dir.path().join("new").exists()); +} + +#[test] +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +fn test_renameat2_behaves_like_renameat_with_no_flags() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = + open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + File::create(&old_path).unwrap(); + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = + open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::empty(), + ) + .unwrap(); + assert_eq!( + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::empty() + ) + .unwrap_err(), + Errno::ENOENT + ); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); + assert!(new_dir.path().join("new").exists()); +} + +#[test] +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +fn test_renameat2_exchange() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = + open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + { + let mut old_f = File::create(&old_path).unwrap(); + old_f.write_all(b"old").unwrap(); + } + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = + open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let new_path = new_dir.path().join("new"); + { + let mut new_f = File::create(&new_path).unwrap(); + new_f.write_all(b"new").unwrap(); + } + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::RENAME_EXCHANGE, + ) + .unwrap(); + let mut buf = String::new(); + let mut new_f = File::open(&new_path).unwrap(); + new_f.read_to_string(&mut buf).unwrap(); + assert_eq!(buf, "old"); + buf = "".to_string(); + let mut old_f = File::open(&old_path).unwrap(); + old_f.read_to_string(&mut buf).unwrap(); + assert_eq!(buf, "new"); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); +} + +#[test] +#[cfg(all( + target_os = "linux", + target_env = "gnu", + any( + target_arch = "x86_64", + target_arch = "x32", + target_arch = "powerpc", + target_arch = "s390x" + ) +))] +fn test_renameat2_noreplace() { + let old_dir = tempfile::tempdir().unwrap(); + let old_dirfd = + open(old_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let old_path = old_dir.path().join("old"); + File::create(&old_path).unwrap(); + let new_dir = tempfile::tempdir().unwrap(); + let new_dirfd = + open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let new_path = new_dir.path().join("new"); + File::create(&new_path).unwrap(); + assert_eq!( + renameat2( + Some(old_dirfd), + "old", + Some(new_dirfd), + "new", + RenameFlags::RENAME_NOREPLACE + ) + .unwrap_err(), + Errno::EEXIST + ); + close(old_dirfd).unwrap(); + close(new_dirfd).unwrap(); + assert!(new_dir.path().join("new").exists()); + assert!(old_dir.path().join("old").exists()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_readlink() { + let tempdir = tempfile::tempdir().unwrap(); + let src = tempdir.path().join("a"); + let dst = tempdir.path().join("b"); + println!("a: {:?}, b: {:?}", &src, &dst); + fs::symlink(&src.as_path(), &dst.as_path()).unwrap(); + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let expected_dir = src.to_str().unwrap(); + + assert_eq!(readlink(&dst).unwrap().to_str().unwrap(), expected_dir); + assert_eq!( + readlinkat(dirfd, "b").unwrap().to_str().unwrap(), + expected_dir + ); +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod linux_android { + use libc::loff_t; + use std::io::prelude::*; + use std::io::{IoSlice, SeekFrom}; + use std::os::unix::prelude::*; + + use nix::fcntl::*; + use nix::unistd::{close, pipe, read, write}; + + use tempfile::tempfile; + #[cfg(any(target_os = "linux"))] + use tempfile::NamedTempFile; + + use crate::*; + + /// This test creates a temporary file containing the contents + /// 'foobarbaz' and uses the `copy_file_range` call to transfer + /// 3 bytes at offset 3 (`bar`) to another empty file at offset 0. The + /// resulting file is read and should contain the contents `bar`. + /// The from_offset should be updated by the call to reflect + /// the 3 bytes read (6). + #[test] + // QEMU does not support copy_file_range. Skip under qemu + #[cfg_attr(qemu, ignore)] + fn test_copy_file_range() { + const CONTENTS: &[u8] = b"foobarbaz"; + + let mut tmp1 = tempfile().unwrap(); + let mut tmp2 = tempfile().unwrap(); + + tmp1.write_all(CONTENTS).unwrap(); + tmp1.flush().unwrap(); + + let mut from_offset: i64 = 3; + copy_file_range( + tmp1.as_raw_fd(), + Some(&mut from_offset), + tmp2.as_raw_fd(), + None, + 3, + ) + .unwrap(); + + let mut res: String = String::new(); + tmp2.seek(SeekFrom::Start(0)).unwrap(); + tmp2.read_to_string(&mut res).unwrap(); + + assert_eq!(res, String::from("bar")); + assert_eq!(from_offset, 6); + } + + #[test] + fn test_splice() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let (rd, wr) = pipe().unwrap(); + let mut offset: loff_t = 5; + let res = splice( + tmp.as_raw_fd(), + Some(&mut offset), + wr, + None, + 2, + SpliceFFlags::empty(), + ) + .unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + assert_eq!(2, read(rd, &mut buf).unwrap()); + assert_eq!(b"f1", &buf[0..2]); + assert_eq!(7, offset); + + close(rd).unwrap(); + close(wr).unwrap(); + } + + #[test] + fn test_tee() { + let (rd1, wr1) = pipe().unwrap(); + let (rd2, wr2) = pipe().unwrap(); + + write(wr1, b"abc").unwrap(); + let res = tee(rd1, wr2, 2, SpliceFFlags::empty()).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + + // Check the tee'd bytes are at rd2. + assert_eq!(2, read(rd2, &mut buf).unwrap()); + assert_eq!(b"ab", &buf[0..2]); + + // Check all the bytes are still at rd1. + assert_eq!(3, read(rd1, &mut buf).unwrap()); + assert_eq!(b"abc", &buf[0..3]); + + close(rd1).unwrap(); + close(wr1).unwrap(); + close(rd2).unwrap(); + close(wr2).unwrap(); + } + + #[test] + fn test_vmsplice() { + let (rd, wr) = pipe().unwrap(); + + let buf1 = b"abcdef"; + let buf2 = b"defghi"; + let iovecs = vec![IoSlice::new(&buf1[0..3]), IoSlice::new(&buf2[0..3])]; + + let res = vmsplice(wr, &iovecs[..], SpliceFFlags::empty()).unwrap(); + + assert_eq!(6, res); + + // Check the bytes can be read at rd. + let mut buf = [0u8; 32]; + assert_eq!(6, read(rd, &mut buf).unwrap()); + assert_eq!(b"abcdef", &buf[0..6]); + + close(rd).unwrap(); + close(wr).unwrap(); + } + + #[cfg(any(target_os = "linux"))] + #[test] + fn test_fallocate() { + let tmp = NamedTempFile::new().unwrap(); + + let fd = tmp.as_raw_fd(); + fallocate(fd, FallocateFlags::empty(), 0, 100).unwrap(); + + // Check if we read exactly 100 bytes + let mut buf = [0u8; 200]; + assert_eq!(100, read(fd, &mut buf).unwrap()); + } + + // The tests below are disabled for the listed targets + // due to OFD locks not being available in the kernel/libc + // versions used in the CI environment, probably because + // they run under QEMU. + + #[test] + #[cfg(all(target_os = "linux", not(target_env = "musl")))] + #[cfg_attr(target_env = "uclibc", ignore)] // uclibc doesn't support OFD locks, but the test should still compile + fn test_ofd_write_lock() { + use nix::sys::stat::fstat; + use std::mem; + + let tmp = NamedTempFile::new().unwrap(); + + let fd = tmp.as_raw_fd(); + let statfs = nix::sys::statfs::fstatfs(&tmp).unwrap(); + if statfs.filesystem_type() == nix::sys::statfs::OVERLAYFS_SUPER_MAGIC { + // OverlayFS is a union file system. It returns one inode value in + // stat(2), but a different one shows up in /proc/locks. So we must + // skip the test. + skip!("/proc/locks does not work on overlayfs"); + } + let inode = fstat(fd).expect("fstat failed").st_ino as usize; + + let mut flock: libc::flock = unsafe { + mem::zeroed() // required for Linux/mips + }; + flock.l_type = libc::F_WRLCK as libc::c_short; + flock.l_whence = libc::SEEK_SET as libc::c_short; + flock.l_start = 0; + flock.l_len = 0; + flock.l_pid = 0; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("write lock failed"); + assert_eq!( + Some(("OFDLCK".to_string(), "WRITE".to_string())), + lock_info(inode) + ); + + flock.l_type = libc::F_UNLCK as libc::c_short; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("write unlock failed"); + assert_eq!(None, lock_info(inode)); + } + + #[test] + #[cfg(all(target_os = "linux", not(target_env = "musl")))] + #[cfg_attr(target_env = "uclibc", ignore)] // uclibc doesn't support OFD locks, but the test should still compile + fn test_ofd_read_lock() { + use nix::sys::stat::fstat; + use std::mem; + + let tmp = NamedTempFile::new().unwrap(); + + let fd = tmp.as_raw_fd(); + let statfs = nix::sys::statfs::fstatfs(&tmp).unwrap(); + if statfs.filesystem_type() == nix::sys::statfs::OVERLAYFS_SUPER_MAGIC { + // OverlayFS is a union file system. It returns one inode value in + // stat(2), but a different one shows up in /proc/locks. So we must + // skip the test. + skip!("/proc/locks does not work on overlayfs"); + } + let inode = fstat(fd).expect("fstat failed").st_ino as usize; + + let mut flock: libc::flock = unsafe { + mem::zeroed() // required for Linux/mips + }; + flock.l_type = libc::F_RDLCK as libc::c_short; + flock.l_whence = libc::SEEK_SET as libc::c_short; + flock.l_start = 0; + flock.l_len = 0; + flock.l_pid = 0; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("read lock failed"); + assert_eq!( + Some(("OFDLCK".to_string(), "READ".to_string())), + lock_info(inode) + ); + + flock.l_type = libc::F_UNLCK as libc::c_short; + fcntl(fd, FcntlArg::F_OFD_SETLKW(&flock)).expect("read unlock failed"); + assert_eq!(None, lock_info(inode)); + } + + #[cfg(all(target_os = "linux", not(target_env = "musl")))] + fn lock_info(inode: usize) -> Option<(String, String)> { + use std::{fs::File, io::BufReader}; + + let file = File::open("/proc/locks").expect("open /proc/locks failed"); + let buf = BufReader::new(file); + + for line in buf.lines() { + let line = line.unwrap(); + let parts: Vec<_> = line.split_whitespace().collect(); + let lock_type = parts[1]; + let lock_access = parts[3]; + let ino_parts: Vec<_> = parts[5].split(':').collect(); + let ino: usize = ino_parts[2].parse().unwrap(); + if ino == inode { + return Some((lock_type.to_string(), lock_access.to_string())); + } + } + None + } +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "wasi", + target_env = "uclibc", + target_os = "freebsd" +))] +mod test_posix_fadvise { + + use nix::errno::Errno; + use nix::fcntl::*; + use nix::unistd::pipe; + use std::os::unix::io::{AsRawFd, RawFd}; + use tempfile::NamedTempFile; + + #[test] + fn test_success() { + let tmp = NamedTempFile::new().unwrap(); + let fd = tmp.as_raw_fd(); + posix_fadvise(fd, 0, 100, PosixFadviseAdvice::POSIX_FADV_WILLNEED) + .expect("posix_fadvise failed"); + } + + #[test] + fn test_errno() { + let (rd, _wr) = pipe().unwrap(); + let res = posix_fadvise( + rd as RawFd, + 0, + 100, + PosixFadviseAdvice::POSIX_FADV_WILLNEED, + ); + assert_eq!(res, Err(Errno::ESPIPE)); + } +} + +#[cfg(any( + target_os = "linux", + target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "fuchsia", + target_os = "wasi", + target_os = "freebsd" +))] +mod test_posix_fallocate { + + use nix::errno::Errno; + use nix::fcntl::*; + use nix::unistd::pipe; + use std::{ + io::Read, + os::unix::io::{AsRawFd, RawFd}, + }; + use tempfile::NamedTempFile; + + #[test] + fn success() { + const LEN: usize = 100; + let mut tmp = NamedTempFile::new().unwrap(); + let fd = tmp.as_raw_fd(); + let res = posix_fallocate(fd, 0, LEN as libc::off_t); + match res { + Ok(_) => { + let mut data = [1u8; LEN]; + assert_eq!(tmp.read(&mut data).expect("read failure"), LEN); + assert_eq!(&data[..], &[0u8; LEN][..]); + } + Err(Errno::EINVAL) => { + // POSIX requires posix_fallocate to return EINVAL both for + // invalid arguments (i.e. len < 0) and if the operation is not + // supported by the file system. + // There's no way to tell for sure whether the file system + // supports posix_fallocate, so we must pass the test if it + // returns EINVAL. + } + _ => res.unwrap(), + } + } + + #[test] + fn errno() { + let (rd, _wr) = pipe().unwrap(); + let err = posix_fallocate(rd as RawFd, 0, 100).unwrap_err(); + match err { + Errno::EINVAL | Errno::ENODEV | Errno::ESPIPE | Errno::EBADF => (), + errno => panic!("unexpected errno {}", errno,), + } + } +} diff --git a/bash-5.1/vendor/nix/test/test_kmod/hello_mod/Makefile b/bash-5.1/vendor/nix/test/test_kmod/hello_mod/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..74c99b77e96e1434c00eee89f44b0baa07951760 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_kmod/hello_mod/Makefile @@ -0,0 +1,7 @@ +obj-m += hello.o + +all: + make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules + +clean: + make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean diff --git a/bash-5.1/vendor/nix/test/test_kmod/hello_mod/hello.c b/bash-5.1/vendor/nix/test/test_kmod/hello_mod/hello.c new file mode 100644 index 0000000000000000000000000000000000000000..1c34987d2ac399af2a498233967a425119036f71 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_kmod/hello_mod/hello.c @@ -0,0 +1,26 @@ +/* + * SPDX-License-Identifier: GPL-2.0+ or MIT + */ +#include +#include + +static int number= 1; +static char *who = "World"; + +module_param(number, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +MODULE_PARM_DESC(myint, "Just some number"); +module_param(who, charp, 0000); +MODULE_PARM_DESC(who, "Whot to greet"); + +int init_module(void) +{ + printk(KERN_INFO "Hello %s (%d)!\n", who, number); + return 0; +} + +void cleanup_module(void) +{ + printk(KERN_INFO "Goodbye %s (%d)!\n", who, number); +} + +MODULE_LICENSE("Dual MIT/GPL"); diff --git a/bash-5.1/vendor/nix/test/test_kmod/mod.rs b/bash-5.1/vendor/nix/test/test_kmod/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..5ebc2423db7edb66fa81d2d3ca2b13a5f4e96100 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_kmod/mod.rs @@ -0,0 +1,188 @@ +use crate::*; +use std::fs::copy; +use std::path::PathBuf; +use std::process::Command; +use tempfile::{tempdir, TempDir}; + +fn compile_kernel_module() -> (PathBuf, String, TempDir) { + let _m = crate::FORK_MTX.lock(); + + let tmp_dir = + tempdir().expect("unable to create temporary build directory"); + + copy( + "test/test_kmod/hello_mod/hello.c", + &tmp_dir.path().join("hello.c"), + ) + .expect("unable to copy hello.c to temporary build directory"); + copy( + "test/test_kmod/hello_mod/Makefile", + &tmp_dir.path().join("Makefile"), + ) + .expect("unable to copy Makefile to temporary build directory"); + + let status = Command::new("make") + .current_dir(tmp_dir.path()) + .status() + .expect("failed to run make"); + + assert!(status.success()); + + // Return the relative path of the build kernel module + (tmp_dir.path().join("hello.ko"), "hello".to_owned(), tmp_dir) +} + +use nix::errno::Errno; +use nix::kmod::{delete_module, DeleteModuleFlags}; +use nix::kmod::{finit_module, init_module, ModuleInitFlags}; +use std::ffi::CString; +use std::fs::File; +use std::io::Read; + +#[test] +fn test_finit_and_delete_module() { + require_capability!("test_finit_and_delete_module", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let f = File::open(kmod_path).expect("unable to open kernel module"); + finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()) + .expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ) + .expect("unable to unload kernel module"); +} + +#[test] +fn test_finit_and_delete_module_with_params() { + require_capability!( + "test_finit_and_delete_module_with_params", + CAP_SYS_MODULE + ); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let f = File::open(kmod_path).expect("unable to open kernel module"); + finit_module( + &f, + &CString::new("who=Rust number=2018").unwrap(), + ModuleInitFlags::empty(), + ) + .expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ) + .expect("unable to unload kernel module"); +} + +#[test] +fn test_init_and_delete_module() { + require_capability!("test_init_and_delete_module", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let mut f = File::open(kmod_path).expect("unable to open kernel module"); + let mut contents: Vec = Vec::new(); + f.read_to_end(&mut contents) + .expect("unable to read kernel module content to buffer"); + init_module(&contents, &CString::new("").unwrap()) + .expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ) + .expect("unable to unload kernel module"); +} + +#[test] +fn test_init_and_delete_module_with_params() { + require_capability!( + "test_init_and_delete_module_with_params", + CAP_SYS_MODULE + ); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let mut f = File::open(kmod_path).expect("unable to open kernel module"); + let mut contents: Vec = Vec::new(); + f.read_to_end(&mut contents) + .expect("unable to read kernel module content to buffer"); + init_module(&contents, &CString::new("who=Nix number=2015").unwrap()) + .expect("unable to load kernel module"); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ) + .expect("unable to unload kernel module"); +} + +#[test] +fn test_finit_module_invalid() { + require_capability!("test_finit_module_invalid", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let kmod_path = "/dev/zero"; + + let f = File::open(kmod_path).expect("unable to open kernel module"); + let result = + finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()); + + assert_eq!(result.unwrap_err(), Errno::EINVAL); +} + +#[test] +fn test_finit_module_twice_and_delete_module() { + require_capability!( + "test_finit_module_twice_and_delete_module", + CAP_SYS_MODULE + ); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module(); + + let f = File::open(kmod_path).expect("unable to open kernel module"); + finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()) + .expect("unable to load kernel module"); + + let result = + finit_module(&f, &CString::new("").unwrap(), ModuleInitFlags::empty()); + + assert_eq!(result.unwrap_err(), Errno::EEXIST); + + delete_module( + &CString::new(kmod_name).unwrap(), + DeleteModuleFlags::empty(), + ) + .expect("unable to unload kernel module"); +} + +#[test] +fn test_delete_module_not_loaded() { + require_capability!("test_delete_module_not_loaded", CAP_SYS_MODULE); + let _m0 = crate::KMOD_MTX.lock(); + let _m1 = crate::CWD_LOCK.read(); + + let result = delete_module( + &CString::new("hello").unwrap(), + DeleteModuleFlags::empty(), + ); + + assert_eq!(result.unwrap_err(), Errno::ENOENT); +} diff --git a/bash-5.1/vendor/nix/test/test_mount.rs b/bash-5.1/vendor/nix/test/test_mount.rs new file mode 100644 index 0000000000000000000000000000000000000000..febcadfbca07db11ee59409d8019a05fc11b9626 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_mount.rs @@ -0,0 +1,271 @@ +mod common; + +// Implementation note: to allow unprivileged users to run it, this test makes +// use of user and mount namespaces. On systems that allow unprivileged user +// namespaces (Linux >= 3.8 compiled with CONFIG_USER_NS), the test should run +// without root. + +#[cfg(target_os = "linux")] +mod test_mount { + use std::fs::{self, File}; + use std::io::{self, Read, Write}; + use std::os::unix::fs::OpenOptionsExt; + use std::os::unix::fs::PermissionsExt; + use std::process::{self, Command}; + + use libc::{EACCES, EROFS}; + + use nix::errno::Errno; + use nix::mount::{mount, umount, MsFlags}; + use nix::sched::{unshare, CloneFlags}; + use nix::sys::stat::{self, Mode}; + use nix::unistd::getuid; + + static SCRIPT_CONTENTS: &[u8] = b"#!/bin/sh +exit 23"; + + const EXPECTED_STATUS: i32 = 23; + + const NONE: Option<&'static [u8]> = None; + #[allow(clippy::bind_instead_of_map)] // False positive + pub fn test_mount_tmpfs_without_flags_allows_rwx() { + let tempdir = tempfile::tempdir().unwrap(); + + mount( + NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::empty(), + NONE, + ) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + let test_path = tempdir.path().join("test"); + + // Verify write. + fs::OpenOptions::new() + .create(true) + .write(true) + .mode((Mode::S_IRWXU | Mode::S_IRWXG | Mode::S_IRWXO).bits()) + .open(&test_path) + .or_else(|e| { + if Errno::from_i32(e.raw_os_error().unwrap()) + == Errno::EOVERFLOW + { + // Skip tests on certain Linux kernels which have a bug + // regarding tmpfs in namespaces. + // Ubuntu 14.04 and 16.04 are known to be affected; 16.10 is + // not. There is no legitimate reason for open(2) to return + // EOVERFLOW here. + // https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1659087 + let stderr = io::stderr(); + let mut handle = stderr.lock(); + writeln!( + handle, + "Buggy Linux kernel detected. Skipping test." + ) + .unwrap(); + process::exit(0); + } else { + panic!("open failed: {}", e); + } + }) + .and_then(|mut f| f.write(SCRIPT_CONTENTS)) + .unwrap_or_else(|e| panic!("write failed: {}", e)); + + // Verify read. + let mut buf = Vec::new(); + File::open(&test_path) + .and_then(|mut f| f.read_to_end(&mut buf)) + .unwrap_or_else(|e| panic!("read failed: {}", e)); + assert_eq!(buf, SCRIPT_CONTENTS); + + // Verify execute. + assert_eq!( + EXPECTED_STATUS, + Command::new(&test_path) + .status() + .unwrap_or_else(|e| panic!("exec failed: {}", e)) + .code() + .unwrap_or_else(|| panic!("child killed by signal")) + ); + + umount(tempdir.path()) + .unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + pub fn test_mount_rdonly_disallows_write() { + let tempdir = tempfile::tempdir().unwrap(); + + mount( + NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::MS_RDONLY, + NONE, + ) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + // EROFS: Read-only file system + assert_eq!( + EROFS as i32, + File::create(tempdir.path().join("test")) + .unwrap_err() + .raw_os_error() + .unwrap() + ); + + umount(tempdir.path()) + .unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + pub fn test_mount_noexec_disallows_exec() { + let tempdir = tempfile::tempdir().unwrap(); + + mount( + NONE, + tempdir.path(), + Some(b"tmpfs".as_ref()), + MsFlags::MS_NOEXEC, + NONE, + ) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + let test_path = tempdir.path().join("test"); + + fs::OpenOptions::new() + .create(true) + .write(true) + .mode((Mode::S_IRWXU | Mode::S_IRWXG | Mode::S_IRWXO).bits()) + .open(&test_path) + .and_then(|mut f| f.write(SCRIPT_CONTENTS)) + .unwrap_or_else(|e| panic!("write failed: {}", e)); + + // Verify that we cannot execute despite a+x permissions being set. + let mode = stat::Mode::from_bits_truncate( + fs::metadata(&test_path) + .map(|md| md.permissions().mode()) + .unwrap_or_else(|e| panic!("metadata failed: {}", e)), + ); + + assert!( + mode.contains(Mode::S_IXUSR | Mode::S_IXGRP | Mode::S_IXOTH), + "{:?} did not have execute permissions", + &test_path + ); + + // EACCES: Permission denied + assert_eq!( + EACCES as i32, + Command::new(&test_path) + .status() + .unwrap_err() + .raw_os_error() + .unwrap() + ); + + umount(tempdir.path()) + .unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + pub fn test_mount_bind() { + let tempdir = tempfile::tempdir().unwrap(); + let file_name = "test"; + + { + let mount_point = tempfile::tempdir().unwrap(); + + mount( + Some(tempdir.path()), + mount_point.path(), + NONE, + MsFlags::MS_BIND, + NONE, + ) + .unwrap_or_else(|e| panic!("mount failed: {}", e)); + + fs::OpenOptions::new() + .create(true) + .write(true) + .mode((Mode::S_IRWXU | Mode::S_IRWXG | Mode::S_IRWXO).bits()) + .open(mount_point.path().join(file_name)) + .and_then(|mut f| f.write(SCRIPT_CONTENTS)) + .unwrap_or_else(|e| panic!("write failed: {}", e)); + + umount(mount_point.path()) + .unwrap_or_else(|e| panic!("umount failed: {}", e)); + } + + // Verify the file written in the mount shows up in source directory, even + // after unmounting. + + let mut buf = Vec::new(); + File::open(tempdir.path().join(file_name)) + .and_then(|mut f| f.read_to_end(&mut buf)) + .unwrap_or_else(|e| panic!("read failed: {}", e)); + assert_eq!(buf, SCRIPT_CONTENTS); + } + + pub fn setup_namespaces() { + // Hold on to the uid in the parent namespace. + let uid = getuid(); + + unshare(CloneFlags::CLONE_NEWNS | CloneFlags::CLONE_NEWUSER).unwrap_or_else(|e| { + let stderr = io::stderr(); + let mut handle = stderr.lock(); + writeln!(handle, + "unshare failed: {}. Are unprivileged user namespaces available?", + e).unwrap(); + writeln!(handle, "mount is not being tested").unwrap(); + // Exit with success because not all systems support unprivileged user namespaces, and + // that's not what we're testing for. + process::exit(0); + }); + + // Map user as uid 1000. + fs::OpenOptions::new() + .write(true) + .open("/proc/self/uid_map") + .and_then(|mut f| f.write(format!("1000 {} 1\n", uid).as_bytes())) + .unwrap_or_else(|e| panic!("could not write uid map: {}", e)); + } +} + +// Test runner + +/// Mimic normal test output (hackishly). +#[cfg(target_os = "linux")] +macro_rules! run_tests { + ( $($test_fn:ident),* ) => {{ + println!(); + + $( + print!("test test_mount::{} ... ", stringify!($test_fn)); + $test_fn(); + println!("ok"); + )* + + println!(); + }} +} + +#[cfg(target_os = "linux")] +fn main() { + use test_mount::{ + setup_namespaces, test_mount_bind, test_mount_noexec_disallows_exec, + test_mount_rdonly_disallows_write, + test_mount_tmpfs_without_flags_allows_rwx, + }; + skip_if_cirrus!("Fails for an unknown reason Cirrus CI. Bug #1351"); + setup_namespaces(); + + run_tests!( + test_mount_tmpfs_without_flags_allows_rwx, + test_mount_rdonly_disallows_write, + test_mount_noexec_disallows_exec, + test_mount_bind + ); +} + +#[cfg(not(target_os = "linux"))] +fn main() {} diff --git a/bash-5.1/vendor/nix/test/test_mq.rs b/bash-5.1/vendor/nix/test/test_mq.rs new file mode 100644 index 0000000000000000000000000000000000000000..7b48e7ac78f067c2e7f876f3087543cf7c029e2b --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_mq.rs @@ -0,0 +1,190 @@ +use cfg_if::cfg_if; +use std::ffi::CString; +use std::str; + +use nix::errno::Errno; +use nix::mqueue::{mq_attr_member_t, mq_close, mq_open, mq_receive, mq_send}; +use nix::mqueue::{MQ_OFlag, MqAttr}; +use nix::sys::stat::Mode; + +// Defined as a macro such that the error source is reported as the caller's location. +macro_rules! assert_attr_eq { + ($read_attr:ident, $initial_attr:ident) => { + cfg_if! { + if #[cfg(any(target_os = "dragonfly", target_os = "netbsd"))] { + // NetBSD (and others which inherit its implementation) include other flags + // in read_attr, such as those specified by oflag. Just make sure at least + // the correct bits are set. + assert_eq!($read_attr.flags() & $initial_attr.flags(), $initial_attr.flags()); + assert_eq!($read_attr.maxmsg(), $initial_attr.maxmsg()); + assert_eq!($read_attr.msgsize(), $initial_attr.msgsize()); + assert_eq!($read_attr.curmsgs(), $initial_attr.curmsgs()); + } else { + assert_eq!($read_attr, $initial_attr); + } + } + } +} + +#[test] +fn test_mq_send_and_receive() { + const MSG_SIZE: mq_attr_member_t = 32; + let attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name = &CString::new(b"/a_nix_test_queue".as_ref()).unwrap(); + + let oflag0 = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r0 = mq_open(mq_name, oflag0, mode, Some(&attr)); + if let Err(Errno::ENOSYS) = r0 { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd0 = r0.unwrap(); + let msg_to_send = "msg_1"; + mq_send(&mqd0, msg_to_send.as_bytes(), 1).unwrap(); + + let oflag1 = MQ_OFlag::O_CREAT | MQ_OFlag::O_RDONLY; + let mqd1 = mq_open(mq_name, oflag1, mode, Some(&attr)).unwrap(); + let mut buf = [0u8; 32]; + let mut prio = 0u32; + let len = mq_receive(&mqd1, &mut buf, &mut prio).unwrap(); + assert_eq!(prio, 1); + + mq_close(mqd1).unwrap(); + mq_close(mqd0).unwrap(); + assert_eq!(msg_to_send, str::from_utf8(&buf[0..len]).unwrap()); +} + +#[test] +fn test_mq_getattr() { + use nix::mqueue::mq_getattr; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + + let read_attr = mq_getattr(&mqd).unwrap(); + assert_attr_eq!(read_attr, initial_attr); + mq_close(mqd).unwrap(); +} + +// FIXME: Fix failures for mips in QEMU +#[test] +#[cfg_attr( + all(qemu, any(target_arch = "mips", target_arch = "mips64")), + ignore +)] +fn test_mq_setattr() { + use nix::mqueue::{mq_getattr, mq_setattr}; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + + let new_attr = MqAttr::new(0, 20, MSG_SIZE * 2, 100); + let old_attr = mq_setattr(&mqd, &new_attr).unwrap(); + assert_attr_eq!(old_attr, initial_attr); + + // No changes here because according to the Linux man page only + // O_NONBLOCK can be set (see tests below) + #[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))] + { + let new_attr_get = mq_getattr(&mqd).unwrap(); + assert_ne!(new_attr_get, new_attr); + } + + let new_attr_non_blocking = MqAttr::new( + MQ_OFlag::O_NONBLOCK.bits() as mq_attr_member_t, + 10, + MSG_SIZE, + 0, + ); + mq_setattr(&mqd, &new_attr_non_blocking).unwrap(); + let new_attr_get = mq_getattr(&mqd).unwrap(); + + // now the O_NONBLOCK flag has been set + #[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))] + { + assert_ne!(new_attr_get, initial_attr); + } + assert_attr_eq!(new_attr_get, new_attr_non_blocking); + mq_close(mqd).unwrap(); +} + +// FIXME: Fix failures for mips in QEMU +#[test] +#[cfg_attr( + all(qemu, any(target_arch = "mips", target_arch = "mips64")), + ignore +)] +fn test_mq_set_nonblocking() { + use nix::mqueue::{mq_getattr, mq_remove_nonblock, mq_set_nonblock}; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name = &CString::new(b"/attr_test_get_attr".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + mq_set_nonblock(&mqd).unwrap(); + let new_attr = mq_getattr(&mqd); + let o_nonblock_bits = MQ_OFlag::O_NONBLOCK.bits() as mq_attr_member_t; + assert_eq!(new_attr.unwrap().flags() & o_nonblock_bits, o_nonblock_bits); + mq_remove_nonblock(&mqd).unwrap(); + let new_attr = mq_getattr(&mqd); + assert_eq!(new_attr.unwrap().flags() & o_nonblock_bits, 0); + mq_close(mqd).unwrap(); +} + +#[test] +fn test_mq_unlink() { + use nix::mqueue::mq_unlink; + const MSG_SIZE: mq_attr_member_t = 32; + let initial_attr = MqAttr::new(0, 10, MSG_SIZE, 0); + let mq_name_opened = &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); + #[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))] + let mq_name_not_opened = + &CString::new(b"/mq_unlink_test".as_ref()).unwrap(); + let oflag = MQ_OFlag::O_CREAT | MQ_OFlag::O_WRONLY; + let mode = Mode::S_IWUSR | Mode::S_IRUSR | Mode::S_IRGRP | Mode::S_IROTH; + let r = mq_open(mq_name_opened, oflag, mode, Some(&initial_attr)); + if let Err(Errno::ENOSYS) = r { + println!("message queues not supported or module not loaded?"); + return; + }; + let mqd = r.unwrap(); + + let res_unlink = mq_unlink(mq_name_opened); + assert_eq!(res_unlink, Ok(())); + + // NetBSD (and others which inherit its implementation) defer removing the message + // queue name until all references are closed, whereas Linux and others remove the + // message queue name immediately. + #[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))] + { + let res_unlink_not_opened = mq_unlink(mq_name_not_opened); + assert_eq!(res_unlink_not_opened, Err(Errno::ENOENT)); + } + + mq_close(mqd).unwrap(); + let res_unlink_after_close = mq_unlink(mq_name_opened); + assert_eq!(res_unlink_after_close, Err(Errno::ENOENT)); +} diff --git a/bash-5.1/vendor/nix/test/test_net.rs b/bash-5.1/vendor/nix/test/test_net.rs new file mode 100644 index 0000000000000000000000000000000000000000..c44655a4c9b6368069c9c7e3d8dac32a0d0581d7 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_net.rs @@ -0,0 +1,19 @@ +use nix::net::if_::*; + +#[cfg(any(target_os = "android", target_os = "linux"))] +const LOOPBACK: &[u8] = b"lo"; + +#[cfg(not(any( + target_os = "android", + target_os = "linux", + target_os = "haiku" +)))] +const LOOPBACK: &[u8] = b"lo0"; + +#[cfg(target_os = "haiku")] +const LOOPBACK: &[u8] = b"loop"; + +#[test] +fn test_if_nametoindex() { + if_nametoindex(LOOPBACK).expect("assertion failed"); +} diff --git a/bash-5.1/vendor/nix/test/test_nix_path.rs b/bash-5.1/vendor/nix/test/test_nix_path.rs new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_nix_path.rs @@ -0,0 +1 @@ + diff --git a/bash-5.1/vendor/nix/test/test_nmount.rs b/bash-5.1/vendor/nix/test/test_nmount.rs new file mode 100644 index 0000000000000000000000000000000000000000..dec806a55fb1a69541b3d246faacaf2821304c40 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_nmount.rs @@ -0,0 +1,49 @@ +use crate::*; +use nix::{ + errno::Errno, + mount::{unmount, MntFlags, Nmount}, +}; +use std::{ffi::CString, fs::File, path::Path}; +use tempfile::tempdir; + +#[test] +fn ok() { + require_mount!("nullfs"); + + let mountpoint = tempdir().unwrap(); + let target = tempdir().unwrap(); + let _sentry = File::create(target.path().join("sentry")).unwrap(); + + let fstype = CString::new("fstype").unwrap(); + let nullfs = CString::new("nullfs").unwrap(); + Nmount::new() + .str_opt(&fstype, &nullfs) + .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) + .str_opt_owned("target", target.path().to_str().unwrap()) + .nmount(MntFlags::empty()) + .unwrap(); + + // Now check that the sentry is visible through the mountpoint + let exists = Path::exists(&mountpoint.path().join("sentry")); + + // Cleanup the mountpoint before asserting + unmount(mountpoint.path(), MntFlags::empty()).unwrap(); + + assert!(exists); +} + +#[test] +fn bad_fstype() { + let mountpoint = tempdir().unwrap(); + let target = tempdir().unwrap(); + let _sentry = File::create(target.path().join("sentry")).unwrap(); + + let e = Nmount::new() + .str_opt_owned("fspath", mountpoint.path().to_str().unwrap()) + .str_opt_owned("target", target.path().to_str().unwrap()) + .nmount(MntFlags::empty()) + .unwrap_err(); + + assert_eq!(e.error(), Errno::EINVAL); + assert_eq!(e.errmsg(), Some("Invalid fstype")); +} diff --git a/bash-5.1/vendor/nix/test/test_poll.rs b/bash-5.1/vendor/nix/test/test_poll.rs new file mode 100644 index 0000000000000000000000000000000000000000..53964e26bbcc5fc0589f853c216630505f329596 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_poll.rs @@ -0,0 +1,84 @@ +use nix::{ + errno::Errno, + poll::{poll, PollFd, PollFlags}, + unistd::{pipe, write}, +}; + +macro_rules! loop_while_eintr { + ($poll_expr: expr) => { + loop { + match $poll_expr { + Ok(nfds) => break nfds, + Err(Errno::EINTR) => (), + Err(e) => panic!("{}", e), + } + } + }; +} + +#[test] +fn test_poll() { + let (r, w) = pipe().unwrap(); + let mut fds = [PollFd::new(r, PollFlags::POLLIN)]; + + // Poll an idle pipe. Should timeout + let nfds = loop_while_eintr!(poll(&mut fds, 100)); + assert_eq!(nfds, 0); + assert!(!fds[0].revents().unwrap().contains(PollFlags::POLLIN)); + + write(w, b".").unwrap(); + + // Poll a readable pipe. Should return an event. + let nfds = poll(&mut fds, 100).unwrap(); + assert_eq!(nfds, 1); + assert!(fds[0].revents().unwrap().contains(PollFlags::POLLIN)); +} + +// ppoll(2) is the same as poll except for how it handles timeouts and signals. +// Repeating the test for poll(2) should be sufficient to check that our +// bindings are correct. +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux" +))] +#[test] +fn test_ppoll() { + use nix::poll::ppoll; + use nix::sys::signal::SigSet; + use nix::sys::time::{TimeSpec, TimeValLike}; + + let timeout = TimeSpec::milliseconds(1); + let (r, w) = pipe().unwrap(); + let mut fds = [PollFd::new(r, PollFlags::POLLIN)]; + + // Poll an idle pipe. Should timeout + let sigset = SigSet::empty(); + let nfds = loop_while_eintr!(ppoll(&mut fds, Some(timeout), Some(sigset))); + assert_eq!(nfds, 0); + assert!(!fds[0].revents().unwrap().contains(PollFlags::POLLIN)); + + write(w, b".").unwrap(); + + // Poll a readable pipe. Should return an event. + let nfds = ppoll(&mut fds, Some(timeout), None).unwrap(); + assert_eq!(nfds, 1); + assert!(fds[0].revents().unwrap().contains(PollFlags::POLLIN)); +} + +#[test] +fn test_pollfd_fd() { + use std::os::unix::io::AsRawFd; + + let pfd = PollFd::new(0x1234, PollFlags::empty()); + assert_eq!(pfd.as_raw_fd(), 0x1234); +} + +#[test] +fn test_pollfd_events() { + let mut pfd = PollFd::new(-1, PollFlags::POLLIN); + assert_eq!(pfd.events(), PollFlags::POLLIN); + pfd.set_events(PollFlags::POLLOUT); + assert_eq!(pfd.events(), PollFlags::POLLOUT); +} diff --git a/bash-5.1/vendor/nix/test/test_pty.rs b/bash-5.1/vendor/nix/test/test_pty.rs new file mode 100644 index 0000000000000000000000000000000000000000..5c27e2d632de8a7d66ce74ad8ffd6758c17bee90 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_pty.rs @@ -0,0 +1,313 @@ +use std::fs::File; +use std::io::{Read, Write}; +use std::os::unix::prelude::*; +use std::path::Path; +use tempfile::tempfile; + +use libc::{_exit, STDOUT_FILENO}; +use nix::fcntl::{open, OFlag}; +use nix::pty::*; +use nix::sys::stat; +use nix::sys::termios::*; +use nix::unistd::{close, pause, write}; + +/// Regression test for Issue #659 +/// This is the correct way to explicitly close a `PtyMaster` +#[test] +fn test_explicit_close() { + let mut f = { + let m = posix_openpt(OFlag::O_RDWR).unwrap(); + close(m.into_raw_fd()).unwrap(); + tempfile().unwrap() + }; + // This should work. But if there's been a double close, then it will + // return EBADF + f.write_all(b"whatever").unwrap(); +} + +/// Test equivalence of `ptsname` and `ptsname_r` +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_equivalence() { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name = unsafe { ptsname(&master_fd) }.unwrap(); + let slave_name_r = ptsname_r(&master_fd).unwrap(); + assert_eq!(slave_name, slave_name_r); +} + +/// Test data copying of `ptsname` +// TODO need to run in a subprocess, since ptsname is non-reentrant +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_copy() { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name1 = unsafe { ptsname(&master_fd) }.unwrap(); + let slave_name2 = unsafe { ptsname(&master_fd) }.unwrap(); + assert_eq!(slave_name1, slave_name2); + // Also make sure that the string was actually copied and they point to different parts of + // memory. + assert_ne!(slave_name1.as_ptr(), slave_name2.as_ptr()); +} + +/// Test data copying of `ptsname_r` +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_r_copy() { + // Open a new PTTY master + let master_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name1 = ptsname_r(&master_fd).unwrap(); + let slave_name2 = ptsname_r(&master_fd).unwrap(); + assert_eq!(slave_name1, slave_name2); + assert_ne!(slave_name1.as_ptr(), slave_name2.as_ptr()); +} + +/// Test that `ptsname` returns different names for different devices +#[test] +#[cfg(any(target_os = "android", target_os = "linux"))] +fn test_ptsname_unique() { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master1_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master1_fd.as_raw_fd() > 0); + + // Open a second PTTY master + let master2_fd = posix_openpt(OFlag::O_RDWR).unwrap(); + assert!(master2_fd.as_raw_fd() > 0); + + // Get the name of the slave + let slave_name1 = unsafe { ptsname(&master1_fd) }.unwrap(); + let slave_name2 = unsafe { ptsname(&master2_fd) }.unwrap(); + assert_ne!(slave_name1, slave_name2); +} + +/// Common setup for testing PTTY pairs +fn open_ptty_pair() -> (PtyMaster, File) { + let _m = crate::PTSNAME_MTX.lock(); + + // Open a new PTTY master + let master = posix_openpt(OFlag::O_RDWR).expect("posix_openpt failed"); + + // Allow a slave to be generated for it + grantpt(&master).expect("grantpt failed"); + unlockpt(&master).expect("unlockpt failed"); + + // Get the name of the slave + let slave_name = unsafe { ptsname(&master) }.expect("ptsname failed"); + + // Open the slave device + let slave_fd = + open(Path::new(&slave_name), OFlag::O_RDWR, stat::Mode::empty()) + .unwrap(); + + #[cfg(target_os = "illumos")] + // TODO: rewrite using ioctl! + #[allow(clippy::comparison_chain)] + { + use libc::{ioctl, I_FIND, I_PUSH}; + + // On illumos systems, as per pts(7D), one must push STREAMS modules + // after opening a device path returned from ptsname(). + let ptem = b"ptem\0"; + let ldterm = b"ldterm\0"; + let r = unsafe { ioctl(slave_fd, I_FIND, ldterm.as_ptr()) }; + if r < 0 { + panic!("I_FIND failure"); + } else if r == 0 { + if unsafe { ioctl(slave_fd, I_PUSH, ptem.as_ptr()) } < 0 { + panic!("I_PUSH ptem failure"); + } + if unsafe { ioctl(slave_fd, I_PUSH, ldterm.as_ptr()) } < 0 { + panic!("I_PUSH ldterm failure"); + } + } + } + + let slave = unsafe { File::from_raw_fd(slave_fd) }; + + (master, slave) +} + +/// Test opening a master/slave PTTY pair +/// +/// This uses a common `open_ptty_pair` because much of these functions aren't useful by +/// themselves. So for this test we perform the basic act of getting a file handle for a +/// master/slave PTTY pair, then just sanity-check the raw values. +#[test] +fn test_open_ptty_pair() { + let (master, slave) = open_ptty_pair(); + assert!(master.as_raw_fd() > 0); + assert!(slave.as_raw_fd() > 0); +} + +/// Put the terminal in raw mode. +fn make_raw(fd: RawFd) { + let mut termios = tcgetattr(fd).unwrap(); + cfmakeraw(&mut termios); + tcsetattr(fd, SetArg::TCSANOW, &termios).unwrap(); +} + +/// Test `io::Read` on the PTTY master +#[test] +fn test_read_ptty_pair() { + let (mut master, mut slave) = open_ptty_pair(); + make_raw(slave.as_raw_fd()); + + let mut buf = [0u8; 5]; + slave.write_all(b"hello").unwrap(); + master.read_exact(&mut buf).unwrap(); + assert_eq!(&buf, b"hello"); + + let mut master = &master; + slave.write_all(b"hello").unwrap(); + master.read_exact(&mut buf).unwrap(); + assert_eq!(&buf, b"hello"); +} + +/// Test `io::Write` on the PTTY master +#[test] +fn test_write_ptty_pair() { + let (mut master, mut slave) = open_ptty_pair(); + make_raw(slave.as_raw_fd()); + + let mut buf = [0u8; 5]; + master.write_all(b"adios").unwrap(); + slave.read_exact(&mut buf).unwrap(); + assert_eq!(&buf, b"adios"); + + let mut master = &master; + master.write_all(b"adios").unwrap(); + slave.read_exact(&mut buf).unwrap(); + assert_eq!(&buf, b"adios"); +} + +#[test] +fn test_openpty() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + let pty = openpty(None, None).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Writing to one should be readable on the other one + let string = "foofoofoo\n"; + let mut buf = [0u8; 10]; + write(pty.master, string.as_bytes()).unwrap(); + crate::read_exact(pty.slave, &mut buf); + + assert_eq!(&buf, string.as_bytes()); + + // Read the echo as well + let echoed_string = "foofoofoo\r\n"; + let mut buf = [0u8; 11]; + crate::read_exact(pty.master, &mut buf); + assert_eq!(&buf, echoed_string.as_bytes()); + + let string2 = "barbarbarbar\n"; + let echoed_string2 = "barbarbarbar\r\n"; + let mut buf = [0u8; 14]; + write(pty.slave, string2.as_bytes()).unwrap(); + crate::read_exact(pty.master, &mut buf); + + assert_eq!(&buf, echoed_string2.as_bytes()); + + close(pty.master).unwrap(); + close(pty.slave).unwrap(); +} + +#[test] +fn test_openpty_with_termios() { + // openpty uses ptname(3) internally + let _m = crate::PTSNAME_MTX.lock(); + + // Open one pty to get attributes for the second one + let mut termios = { + let pty = openpty(None, None).unwrap(); + assert!(pty.master > 0); + assert!(pty.slave > 0); + let termios = tcgetattr(pty.slave).unwrap(); + close(pty.master).unwrap(); + close(pty.slave).unwrap(); + termios + }; + // Make sure newlines are not transformed so the data is preserved when sent. + termios.output_flags.remove(OutputFlags::ONLCR); + + let pty = openpty(None, &termios).unwrap(); + // Must be valid file descriptors + assert!(pty.master > 0); + assert!(pty.slave > 0); + + // Writing to one should be readable on the other one + let string = "foofoofoo\n"; + let mut buf = [0u8; 10]; + write(pty.master, string.as_bytes()).unwrap(); + crate::read_exact(pty.slave, &mut buf); + + assert_eq!(&buf, string.as_bytes()); + + // read the echo as well + let echoed_string = "foofoofoo\n"; + crate::read_exact(pty.master, &mut buf); + assert_eq!(&buf, echoed_string.as_bytes()); + + let string2 = "barbarbarbar\n"; + let echoed_string2 = "barbarbarbar\n"; + let mut buf = [0u8; 13]; + write(pty.slave, string2.as_bytes()).unwrap(); + crate::read_exact(pty.master, &mut buf); + + assert_eq!(&buf, echoed_string2.as_bytes()); + + close(pty.master).unwrap(); + close(pty.slave).unwrap(); +} + +#[test] +fn test_forkpty() { + use nix::sys::signal::*; + use nix::sys::wait::wait; + use nix::unistd::ForkResult::*; + // forkpty calls openpty which uses ptname(3) internally. + let _m0 = crate::PTSNAME_MTX.lock(); + // forkpty spawns a child process + let _m1 = crate::FORK_MTX.lock(); + + let string = "naninani\n"; + let echoed_string = "naninani\r\n"; + let pty = unsafe { forkpty(None, None).unwrap() }; + match pty.fork_result { + Child => { + write(STDOUT_FILENO, string.as_bytes()).unwrap(); + pause(); // we need the child to stay alive until the parent calls read + unsafe { + _exit(0); + } + } + Parent { child } => { + let mut buf = [0u8; 10]; + assert!(child.as_raw() > 0); + crate::read_exact(pty.master, &mut buf); + kill(child, SIGTERM).unwrap(); + wait().unwrap(); // keep other tests using generic wait from getting our child + assert_eq!(&buf, echoed_string.as_bytes()); + close(pty.master).unwrap(); + } + } +} diff --git a/bash-5.1/vendor/nix/test/test_ptymaster_drop.rs b/bash-5.1/vendor/nix/test/test_ptymaster_drop.rs new file mode 100644 index 0000000000000000000000000000000000000000..ffbaa5697771ad20419a8e78f72c8546cc4e93df --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_ptymaster_drop.rs @@ -0,0 +1,20 @@ +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +mod t { + use nix::fcntl::OFlag; + use nix::pty::*; + use nix::unistd::close; + use std::os::unix::io::AsRawFd; + + /// Regression test for Issue #659 + /// + /// `PtyMaster` should panic rather than double close the file descriptor + /// This must run in its own test process because it deliberately creates a + /// race condition. + #[test] + #[should_panic(expected = "Closing an invalid file descriptor!")] + fn test_double_close() { + let m = posix_openpt(OFlag::O_RDWR).unwrap(); + close(m.as_raw_fd()).unwrap(); + drop(m); // should panic here + } +} diff --git a/bash-5.1/vendor/nix/test/test_resource.rs b/bash-5.1/vendor/nix/test/test_resource.rs new file mode 100644 index 0000000000000000000000000000000000000000..2ab581ba2940326f6a37d8abcef2eb59cb173db7 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_resource.rs @@ -0,0 +1,34 @@ +#[cfg(not(any( + target_os = "redox", + target_os = "fuchsia", + target_os = "illumos", + target_os = "haiku" +)))] +use nix::sys::resource::{getrlimit, setrlimit, Resource}; + +/// Tests the RLIMIT_NOFILE functionality of getrlimit(), where the resource RLIMIT_NOFILE refers +/// to the maximum file descriptor number that can be opened by the process (aka the maximum number +/// of file descriptors that the process can open, since Linux 4.5). +/// +/// We first fetch the existing file descriptor maximum values using getrlimit(), then edit the +/// soft limit to make sure it has a new and distinct value to the hard limit. We then setrlimit() +/// to put the new soft limit in effect, and then getrlimit() once more to ensure the limits have +/// been updated. +#[test] +#[cfg(not(any( + target_os = "redox", + target_os = "fuchsia", + target_os = "illumos", + target_os = "haiku" +)))] +pub fn test_resource_limits_nofile() { + let (mut soft_limit, hard_limit) = + getrlimit(Resource::RLIMIT_NOFILE).unwrap(); + + soft_limit -= 1; + assert_ne!(soft_limit, hard_limit); + setrlimit(Resource::RLIMIT_NOFILE, soft_limit, hard_limit).unwrap(); + + let (new_soft_limit, _) = getrlimit(Resource::RLIMIT_NOFILE).unwrap(); + assert_eq!(new_soft_limit, soft_limit); +} diff --git a/bash-5.1/vendor/nix/test/test_sched.rs b/bash-5.1/vendor/nix/test/test_sched.rs new file mode 100644 index 0000000000000000000000000000000000000000..ebf346db16d2d3d382762fb4cf2edd0dbf6c87ef --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_sched.rs @@ -0,0 +1,35 @@ +use nix::sched::{sched_getaffinity, sched_setaffinity, CpuSet}; +use nix::unistd::Pid; + +#[test] +fn test_sched_affinity() { + // If pid is zero, then the mask of the calling process is returned. + let initial_affinity = sched_getaffinity(Pid::from_raw(0)).unwrap(); + let mut at_least_one_cpu = false; + let mut last_valid_cpu = 0; + for field in 0..CpuSet::count() { + if initial_affinity.is_set(field).unwrap() { + at_least_one_cpu = true; + last_valid_cpu = field; + } + } + assert!(at_least_one_cpu); + + // Now restrict the running CPU + let mut new_affinity = CpuSet::new(); + new_affinity.set(last_valid_cpu).unwrap(); + sched_setaffinity(Pid::from_raw(0), &new_affinity).unwrap(); + + // And now re-check the affinity which should be only the one we set. + let updated_affinity = sched_getaffinity(Pid::from_raw(0)).unwrap(); + for field in 0..CpuSet::count() { + // Should be set only for the CPU we set previously + assert_eq!( + updated_affinity.is_set(field).unwrap(), + field == last_valid_cpu + ) + } + + // Finally, reset the initial CPU set + sched_setaffinity(Pid::from_raw(0), &initial_affinity).unwrap(); +} diff --git a/bash-5.1/vendor/nix/test/test_sendfile.rs b/bash-5.1/vendor/nix/test/test_sendfile.rs new file mode 100644 index 0000000000000000000000000000000000000000..f73a3b56c38b5a93361a3f911a4f7967eb06afef --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_sendfile.rs @@ -0,0 +1,208 @@ +use std::io::prelude::*; +use std::os::unix::prelude::*; + +use libc::off_t; +use nix::sys::sendfile::*; +use tempfile::tempfile; + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + use nix::unistd::{close, pipe, read}; + } else if #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos"))] { + use std::net::Shutdown; + use std::os::unix::net::UnixStream; + } +} + +#[cfg(any(target_os = "android", target_os = "linux"))] +#[test] +fn test_sendfile_linux() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let (rd, wr) = pipe().unwrap(); + let mut offset: off_t = 5; + let res = sendfile(wr, tmp.as_raw_fd(), Some(&mut offset), 2).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + assert_eq!(2, read(rd, &mut buf).unwrap()); + assert_eq!(b"f1", &buf[0..2]); + assert_eq!(7, offset); + + close(rd).unwrap(); + close(wr).unwrap(); +} + +#[cfg(target_os = "linux")] +#[test] +fn test_sendfile64_linux() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + + let (rd, wr) = pipe().unwrap(); + let mut offset: libc::off64_t = 5; + let res = sendfile64(wr, tmp.as_raw_fd(), Some(&mut offset), 2).unwrap(); + + assert_eq!(2, res); + + let mut buf = [0u8; 1024]; + assert_eq!(2, read(rd, &mut buf).unwrap()); + assert_eq!(b"f1", &buf[0..2]); + assert_eq!(7, offset); + + close(rd).unwrap(); + close(wr).unwrap(); +} + +#[cfg(target_os = "freebsd")] +#[test] +fn test_sendfile_freebsd() { + // Declare the content + let header_strings = + vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let body = "Xabcdef123456"; + let body_offset = 1; + let trailer_strings = vec!["\n", "Served by Make Believe\n"]; + + // Write the body to a file + let mut tmp = tempfile().unwrap(); + tmp.write_all(body.as_bytes()).unwrap(); + + // Prepare headers and trailers for sendfile + let headers: Vec<&[u8]> = + header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = + trailer_strings.iter().map(|s| s.as_bytes()).collect(); + + // Prepare socket pair + let (mut rd, wr) = UnixStream::pair().unwrap(); + + // Call the test method + let (res, bytes_written) = sendfile( + tmp.as_raw_fd(), + wr.as_raw_fd(), + body_offset as off_t, + None, + Some(headers.as_slice()), + Some(trailers.as_slice()), + SfFlags::empty(), + 0, + ); + assert!(res.is_ok()); + wr.shutdown(Shutdown::Both).unwrap(); + + // Prepare the expected result + let expected_string = header_strings.concat() + + &body[body_offset..] + + &trailer_strings.concat(); + + // Verify the message that was sent + assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); + + let mut read_string = String::new(); + let bytes_read = rd.read_to_string(&mut read_string).unwrap(); + assert_eq!(bytes_written as usize, bytes_read); + assert_eq!(expected_string, read_string); +} + +#[cfg(target_os = "dragonfly")] +#[test] +fn test_sendfile_dragonfly() { + // Declare the content + let header_strings = + vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let body = "Xabcdef123456"; + let body_offset = 1; + let trailer_strings = vec!["\n", "Served by Make Believe\n"]; + + // Write the body to a file + let mut tmp = tempfile().unwrap(); + tmp.write_all(body.as_bytes()).unwrap(); + + // Prepare headers and trailers for sendfile + let headers: Vec<&[u8]> = + header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = + trailer_strings.iter().map(|s| s.as_bytes()).collect(); + + // Prepare socket pair + let (mut rd, wr) = UnixStream::pair().unwrap(); + + // Call the test method + let (res, bytes_written) = sendfile( + tmp.as_raw_fd(), + wr.as_raw_fd(), + body_offset as off_t, + None, + Some(headers.as_slice()), + Some(trailers.as_slice()), + ); + assert!(res.is_ok()); + wr.shutdown(Shutdown::Both).unwrap(); + + // Prepare the expected result + let expected_string = header_strings.concat() + + &body[body_offset..] + + &trailer_strings.concat(); + + // Verify the message that was sent + assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); + + let mut read_string = String::new(); + let bytes_read = rd.read_to_string(&mut read_string).unwrap(); + assert_eq!(bytes_written as usize, bytes_read); + assert_eq!(expected_string, read_string); +} + +#[cfg(any(target_os = "ios", target_os = "macos"))] +#[test] +fn test_sendfile_darwin() { + // Declare the content + let header_strings = + vec!["HTTP/1.1 200 OK\n", "Content-Type: text/plain\n", "\n"]; + let body = "Xabcdef123456"; + let body_offset = 1; + let trailer_strings = vec!["\n", "Served by Make Believe\n"]; + + // Write the body to a file + let mut tmp = tempfile().unwrap(); + tmp.write_all(body.as_bytes()).unwrap(); + + // Prepare headers and trailers for sendfile + let headers: Vec<&[u8]> = + header_strings.iter().map(|s| s.as_bytes()).collect(); + let trailers: Vec<&[u8]> = + trailer_strings.iter().map(|s| s.as_bytes()).collect(); + + // Prepare socket pair + let (mut rd, wr) = UnixStream::pair().unwrap(); + + // Call the test method + let (res, bytes_written) = sendfile( + tmp.as_raw_fd(), + wr.as_raw_fd(), + body_offset as off_t, + None, + Some(headers.as_slice()), + Some(trailers.as_slice()), + ); + assert!(res.is_ok()); + wr.shutdown(Shutdown::Both).unwrap(); + + // Prepare the expected result + let expected_string = header_strings.concat() + + &body[body_offset..] + + &trailer_strings.concat(); + + // Verify the message that was sent + assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); + + let mut read_string = String::new(); + let bytes_read = rd.read_to_string(&mut read_string).unwrap(); + assert_eq!(bytes_written as usize, bytes_read); + assert_eq!(expected_string, read_string); +} diff --git a/bash-5.1/vendor/nix/test/test_stat.rs b/bash-5.1/vendor/nix/test/test_stat.rs new file mode 100644 index 0000000000000000000000000000000000000000..55f15c0771d0f24114fe30c9feebc4d07271e066 --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_stat.rs @@ -0,0 +1,421 @@ +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +use std::fs; +use std::fs::File; +#[cfg(not(target_os = "redox"))] +use std::os::unix::fs::symlink; +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +use std::os::unix::fs::PermissionsExt; +use std::os::unix::prelude::AsRawFd; +#[cfg(not(target_os = "redox"))] +use std::path::Path; +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +use std::time::{Duration, UNIX_EPOCH}; + +use libc::mode_t; +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +use libc::{S_IFLNK, S_IFMT}; + +#[cfg(not(target_os = "redox"))] +use nix::errno::Errno; +#[cfg(not(target_os = "redox"))] +use nix::fcntl; +#[cfg(any( + target_os = "linux", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd" +))] +use nix::sys::stat::lutimes; +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +use nix::sys::stat::utimensat; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::FchmodatFlags; +use nix::sys::stat::Mode; +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +use nix::sys::stat::UtimensatFlags; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::{self}; +use nix::sys::stat::{fchmod, stat}; +#[cfg(not(target_os = "redox"))] +use nix::sys::stat::{fchmodat, mkdirat}; +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +use nix::sys::stat::{futimens, utimes}; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +use nix::sys::stat::FileStat; + +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +use nix::sys::time::{TimeSpec, TimeVal, TimeValLike}; +#[cfg(not(target_os = "redox"))] +use nix::unistd::chdir; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +use nix::Result; + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn assert_stat_results(stat_result: Result) { + let stats = stat_result.expect("stat call failed"); + assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_ino > 0); // inode is positive integer, exact number machine dependent + assert!(stats.st_mode > 0); // must be positive integer + assert_eq!(stats.st_nlink, 1); // there links created, must be 1 + assert_eq!(stats.st_size, 0); // size is 0 because we did not write anything to the file + assert!(stats.st_blksize > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_blocks <= 16); // Up to 16 blocks can be allocated for a blank file +} + +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +// (Android's st_blocks is ulonglong which is always non-negative.) +#[cfg_attr(target_os = "android", allow(unused_comparisons))] +#[allow(clippy::absurd_extreme_comparisons)] // Not absurd on all OSes +fn assert_lstat_results(stat_result: Result) { + let stats = stat_result.expect("stat call failed"); + assert!(stats.st_dev > 0); // must be positive integer, exact number machine dependent + assert!(stats.st_ino > 0); // inode is positive integer, exact number machine dependent + assert!(stats.st_mode > 0); // must be positive integer + + // st_mode is c_uint (u32 on Android) while S_IFMT is mode_t + // (u16 on Android), and that will be a compile error. + // On other platforms they are the same (either both are u16 or u32). + assert_eq!( + (stats.st_mode as usize) & (S_IFMT as usize), + S_IFLNK as usize + ); // should be a link + assert_eq!(stats.st_nlink, 1); // there links created, must be 1 + assert!(stats.st_size > 0); // size is > 0 because it points to another file + assert!(stats.st_blksize > 0); // must be positive integer, exact number machine dependent + + // st_blocks depends on whether the machine's file system uses fast + // or slow symlinks, so just make sure it's not negative + assert!(stats.st_blocks >= 0); +} + +#[test] +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn test_stat_and_fstat() { + use nix::sys::stat::fstat; + + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("foo.txt"); + let file = File::create(&filename).unwrap(); + + let stat_result = stat(&filename); + assert_stat_results(stat_result); + + let fstat_result = fstat(file.as_raw_fd()); + assert_stat_results(fstat_result); +} + +#[test] +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn test_fstatat() { + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("foo.txt"); + File::create(&filename).unwrap(); + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()); + + let result = + stat::fstatat(dirfd.unwrap(), &filename, fcntl::AtFlags::empty()); + assert_stat_results(result); +} + +#[test] +#[cfg(not(any(target_os = "netbsd", target_os = "redox")))] +fn test_stat_fstat_lstat() { + use nix::sys::stat::{fstat, lstat}; + + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("bar.txt"); + let linkname = tempdir.path().join("barlink"); + + File::create(&filename).unwrap(); + symlink("bar.txt", &linkname).unwrap(); + let link = File::open(&linkname).unwrap(); + + // should be the same result as calling stat, + // since it's a regular file + let stat_result = stat(&filename); + assert_stat_results(stat_result); + + let lstat_result = lstat(&linkname); + assert_lstat_results(lstat_result); + + let fstat_result = fstat(link.as_raw_fd()); + assert_stat_results(fstat_result); +} + +#[test] +fn test_fchmod() { + let tempdir = tempfile::tempdir().unwrap(); + let filename = tempdir.path().join("foo.txt"); + let file = File::create(&filename).unwrap(); + + let mut mode1 = Mode::empty(); + mode1.insert(Mode::S_IRUSR); + mode1.insert(Mode::S_IWUSR); + fchmod(file.as_raw_fd(), mode1).unwrap(); + + let file_stat1 = stat(&filename).unwrap(); + assert_eq!(file_stat1.st_mode as mode_t & 0o7777, mode1.bits()); + + let mut mode2 = Mode::empty(); + mode2.insert(Mode::S_IROTH); + fchmod(file.as_raw_fd(), mode2).unwrap(); + + let file_stat2 = stat(&filename).unwrap(); + assert_eq!(file_stat2.st_mode as mode_t & 0o7777, mode2.bits()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_fchmodat() { + let _dr = crate::DirRestore::new(); + let tempdir = tempfile::tempdir().unwrap(); + let filename = "foo.txt"; + let fullpath = tempdir.path().join(filename); + File::create(&fullpath).unwrap(); + + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + + let mut mode1 = Mode::empty(); + mode1.insert(Mode::S_IRUSR); + mode1.insert(Mode::S_IWUSR); + fchmodat(Some(dirfd), filename, mode1, FchmodatFlags::FollowSymlink) + .unwrap(); + + let file_stat1 = stat(&fullpath).unwrap(); + assert_eq!(file_stat1.st_mode as mode_t & 0o7777, mode1.bits()); + + chdir(tempdir.path()).unwrap(); + + let mut mode2 = Mode::empty(); + mode2.insert(Mode::S_IROTH); + fchmodat(None, filename, mode2, FchmodatFlags::FollowSymlink).unwrap(); + + let file_stat2 = stat(&fullpath).unwrap(); + assert_eq!(file_stat2.st_mode as mode_t & 0o7777, mode2.bits()); +} + +/// Asserts that the atime and mtime in a file's metadata match expected values. +/// +/// The atime and mtime are expressed with a resolution of seconds because some file systems +/// (like macOS's HFS+) do not have higher granularity. +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn assert_times_eq( + exp_atime_sec: u64, + exp_mtime_sec: u64, + attr: &fs::Metadata, +) { + assert_eq!( + Duration::new(exp_atime_sec, 0), + attr.accessed().unwrap().duration_since(UNIX_EPOCH).unwrap() + ); + assert_eq!( + Duration::new(exp_mtime_sec, 0), + attr.modified().unwrap().duration_since(UNIX_EPOCH).unwrap() + ); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_utimes() { + let tempdir = tempfile::tempdir().unwrap(); + let fullpath = tempdir.path().join("file"); + drop(File::create(&fullpath).unwrap()); + + utimes(&fullpath, &TimeVal::seconds(9990), &TimeVal::seconds(5550)) + .unwrap(); + assert_times_eq(9990, 5550, &fs::metadata(&fullpath).unwrap()); +} + +#[test] +#[cfg(any( + target_os = "linux", + target_os = "ios", + target_os = "macos", + target_os = "freebsd", + target_os = "netbsd" +))] +fn test_lutimes() { + let tempdir = tempfile::tempdir().unwrap(); + let target = tempdir.path().join("target"); + let fullpath = tempdir.path().join("symlink"); + drop(File::create(&target).unwrap()); + symlink(&target, &fullpath).unwrap(); + + let exp_target_metadata = fs::symlink_metadata(&target).unwrap(); + lutimes(&fullpath, &TimeVal::seconds(4560), &TimeVal::seconds(1230)) + .unwrap(); + assert_times_eq(4560, 1230, &fs::symlink_metadata(&fullpath).unwrap()); + + let target_metadata = fs::symlink_metadata(&target).unwrap(); + assert_eq!( + exp_target_metadata.accessed().unwrap(), + target_metadata.accessed().unwrap(), + "atime of symlink target was unexpectedly modified" + ); + assert_eq!( + exp_target_metadata.modified().unwrap(), + target_metadata.modified().unwrap(), + "mtime of symlink target was unexpectedly modified" + ); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_futimens() { + let tempdir = tempfile::tempdir().unwrap(); + let fullpath = tempdir.path().join("file"); + drop(File::create(&fullpath).unwrap()); + + let fd = fcntl::open(&fullpath, fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + + futimens(fd, &TimeSpec::seconds(10), &TimeSpec::seconds(20)).unwrap(); + assert_times_eq(10, 20, &fs::metadata(&fullpath).unwrap()); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_utimensat() { + let _dr = crate::DirRestore::new(); + let tempdir = tempfile::tempdir().unwrap(); + let filename = "foo.txt"; + let fullpath = tempdir.path().join(filename); + drop(File::create(&fullpath).unwrap()); + + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + + utimensat( + Some(dirfd), + filename, + &TimeSpec::seconds(12345), + &TimeSpec::seconds(678), + UtimensatFlags::FollowSymlink, + ) + .unwrap(); + assert_times_eq(12345, 678, &fs::metadata(&fullpath).unwrap()); + + chdir(tempdir.path()).unwrap(); + + utimensat( + None, + filename, + &TimeSpec::seconds(500), + &TimeSpec::seconds(800), + UtimensatFlags::FollowSymlink, + ) + .unwrap(); + assert_times_eq(500, 800, &fs::metadata(&fullpath).unwrap()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkdirat_success_path() { + let tempdir = tempfile::tempdir().unwrap(); + let filename = "example_subdir"; + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + mkdirat(dirfd, filename, Mode::S_IRWXU).expect("mkdirat failed"); + assert!(Path::exists(&tempdir.path().join(filename))); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_mkdirat_success_mode() { + let expected_bits = + stat::SFlag::S_IFDIR.bits() | stat::Mode::S_IRWXU.bits(); + let tempdir = tempfile::tempdir().unwrap(); + let filename = "example_subdir"; + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + mkdirat(dirfd, filename, Mode::S_IRWXU).expect("mkdirat failed"); + let permissions = fs::metadata(tempdir.path().join(filename)) + .unwrap() + .permissions(); + let mode = permissions.mode(); + assert_eq!(mode as mode_t, expected_bits) +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkdirat_fail() { + let tempdir = tempfile::tempdir().unwrap(); + let not_dir_filename = "example_not_dir"; + let filename = "example_subdir_dir"; + let dirfd = fcntl::open( + &tempdir.path().join(not_dir_filename), + fcntl::OFlag::O_CREAT, + stat::Mode::empty(), + ) + .unwrap(); + let result = mkdirat(dirfd, filename, Mode::S_IRWXU).unwrap_err(); + assert_eq!(result, Errno::ENOTDIR); +} + +#[test] +#[cfg(not(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target_os = "haiku", + target_os = "redox" +)))] +fn test_mknod() { + use stat::{lstat, mknod, SFlag}; + + let file_name = "test_file"; + let tempdir = tempfile::tempdir().unwrap(); + let target = tempdir.path().join(file_name); + mknod(&target, SFlag::S_IFREG, Mode::S_IRWXU, 0).unwrap(); + let mode = lstat(&target).unwrap().st_mode as mode_t; + assert_eq!(mode & libc::S_IFREG, libc::S_IFREG); + assert_eq!(mode & libc::S_IRWXU, libc::S_IRWXU); +} + +#[test] +#[cfg(not(any( + target_os = "dragonfly", + target_os = "freebsd", + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "haiku", + target_os = "redox" +)))] +fn test_mknodat() { + use fcntl::{AtFlags, OFlag}; + use nix::dir::Dir; + use stat::{fstatat, mknodat, SFlag}; + + let file_name = "test_file"; + let tempdir = tempfile::tempdir().unwrap(); + let target_dir = + Dir::open(tempdir.path(), OFlag::O_DIRECTORY, Mode::S_IRWXU).unwrap(); + mknodat( + target_dir.as_raw_fd(), + file_name, + SFlag::S_IFREG, + Mode::S_IRWXU, + 0, + ) + .unwrap(); + let mode = fstatat( + target_dir.as_raw_fd(), + file_name, + AtFlags::AT_SYMLINK_NOFOLLOW, + ) + .unwrap() + .st_mode as mode_t; + assert_eq!(mode & libc::S_IFREG, libc::S_IFREG); + assert_eq!(mode & libc::S_IRWXU, libc::S_IRWXU); +} diff --git a/bash-5.1/vendor/nix/test/test_time.rs b/bash-5.1/vendor/nix/test/test_time.rs new file mode 100644 index 0000000000000000000000000000000000000000..5f76e61a2da55169bf718c7ca3ac6cb0b32c04cf --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_time.rs @@ -0,0 +1,59 @@ +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +use nix::time::clock_getcpuclockid; +use nix::time::{clock_gettime, ClockId}; + +#[cfg(not(target_os = "redox"))] +#[test] +pub fn test_clock_getres() { + nix::time::clock_getres(ClockId::CLOCK_REALTIME).expect("assertion failed"); +} + +#[test] +pub fn test_clock_gettime() { + clock_gettime(ClockId::CLOCK_REALTIME).expect("assertion failed"); +} + +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +#[test] +pub fn test_clock_getcpuclockid() { + let clock_id = clock_getcpuclockid(nix::unistd::Pid::this()).unwrap(); + clock_gettime(clock_id).unwrap(); +} + +#[cfg(not(target_os = "redox"))] +#[test] +pub fn test_clock_id_res() { + ClockId::CLOCK_REALTIME.res().unwrap(); +} + +#[test] +pub fn test_clock_id_now() { + ClockId::CLOCK_REALTIME.now().unwrap(); +} + +#[cfg(any( + target_os = "freebsd", + target_os = "dragonfly", + target_os = "linux", + target_os = "android", + target_os = "emscripten", +))] +#[test] +pub fn test_clock_id_pid_cpu_clock_id() { + ClockId::pid_cpu_clock_id(nix::unistd::Pid::this()) + .map(ClockId::now) + .unwrap() + .unwrap(); +} diff --git a/bash-5.1/vendor/nix/test/test_timer.rs b/bash-5.1/vendor/nix/test/test_timer.rs new file mode 100644 index 0000000000000000000000000000000000000000..ffd146867bd1d119c32918830c5d9a2995b8e8aa --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_timer.rs @@ -0,0 +1,102 @@ +use nix::sys::signal::{ + sigaction, SaFlags, SigAction, SigEvent, SigHandler, SigSet, SigevNotify, + Signal, +}; +use nix::sys::timer::{Expiration, Timer, TimerSetTimeFlags}; +use nix::time::ClockId; +use std::convert::TryFrom; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::thread; +use std::time::{Duration, Instant}; + +const SIG: Signal = Signal::SIGALRM; +static ALARM_CALLED: AtomicBool = AtomicBool::new(false); + +pub extern "C" fn handle_sigalarm(raw_signal: libc::c_int) { + let signal = Signal::try_from(raw_signal).unwrap(); + if signal == SIG { + ALARM_CALLED.store(true, Ordering::Release); + } +} + +#[test] +fn alarm_fires() { + // Avoid interfering with other signal using tests by taking a mutex shared + // among other tests in this crate. + let _m = crate::SIGNAL_MTX.lock(); + const TIMER_PERIOD: Duration = Duration::from_millis(100); + + // + // Setup + // + + // Create a handler for the test signal, `SIG`. The handler is responsible + // for flipping `ALARM_CALLED`. + let handler = SigHandler::Handler(handle_sigalarm); + let signal_action = + SigAction::new(handler, SaFlags::SA_RESTART, SigSet::empty()); + let old_handler = unsafe { + sigaction(SIG, &signal_action) + .expect("unable to set signal handler for alarm") + }; + + // Create the timer. We use the monotonic clock here, though any would do + // really. The timer is set to fire every 250 milliseconds with no delay for + // the initial firing. + let clockid = ClockId::CLOCK_MONOTONIC; + let sigevent = SigEvent::new(SigevNotify::SigevSignal { + signal: SIG, + si_value: 0, + }); + let mut timer = + Timer::new(clockid, sigevent).expect("failed to create timer"); + let expiration = Expiration::Interval(TIMER_PERIOD.into()); + let flags = TimerSetTimeFlags::empty(); + timer.set(expiration, flags).expect("could not set timer"); + + // + // Test + // + + // Determine that there's still an expiration tracked by the + // timer. Depending on when this runs either an `Expiration::Interval` or + // `Expiration::IntervalDelayed` will be present. That is, if the timer has + // not fired yet we'll get our original `expiration`, else the one that + // represents a delay to the next expiration. We're only interested in the + // timer still being extant. + match timer.get() { + Ok(Some(exp)) => assert!(matches!( + exp, + Expiration::Interval(..) | Expiration::IntervalDelayed(..) + )), + _ => panic!("timer lost its expiration"), + } + + // Wait for 2 firings of the alarm before checking that it has fired and + // been handled at least the once. If we wait for 3 seconds and the handler + // is never called something has gone sideways and the test fails. + let starttime = Instant::now(); + loop { + thread::sleep(2 * TIMER_PERIOD); + if ALARM_CALLED.load(Ordering::Acquire) { + break; + } + if starttime.elapsed() > Duration::from_secs(3) { + panic!("Timeout waiting for SIGALRM"); + } + } + + // Cleanup: + // 1) deregister the OS's timer. + // 2) Wait for a full timer period, since POSIX does not require that + // disabling the timer will clear pending signals, and on NetBSD at least + // it does not. + // 2) Replace the old signal handler now that we've completed the test. If + // the test fails this process panics, so the fact we might not get here + // is okay. + drop(timer); + thread::sleep(TIMER_PERIOD); + unsafe { + sigaction(SIG, &old_handler).expect("unable to reset signal handler"); + } +} diff --git a/bash-5.1/vendor/nix/test/test_unistd.rs b/bash-5.1/vendor/nix/test/test_unistd.rs new file mode 100644 index 0000000000000000000000000000000000000000..eee10103ad6b0808298a899892cebecf6932c70a --- /dev/null +++ b/bash-5.1/vendor/nix/test/test_unistd.rs @@ -0,0 +1,1378 @@ +use libc::{_exit, mode_t, off_t}; +use nix::errno::Errno; +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +use nix::fcntl::readlink; +use nix::fcntl::OFlag; +#[cfg(not(target_os = "redox"))] +use nix::fcntl::{self, open}; +#[cfg(not(any( + target_os = "redox", + target_os = "fuchsia", + target_os = "haiku" +)))] +use nix::pty::{grantpt, posix_openpt, ptsname, unlockpt}; +#[cfg(not(target_os = "redox"))] +use nix::sys::signal::{ + sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal, +}; +use nix::sys::stat::{self, Mode, SFlag}; +use nix::sys::wait::*; +use nix::unistd::ForkResult::*; +use nix::unistd::*; +use std::env; +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] +use std::ffi::CString; +#[cfg(not(target_os = "redox"))] +use std::fs::DirBuilder; +use std::fs::{self, File}; +use std::io::Write; +use std::os::unix::prelude::*; +#[cfg(not(any( + target_os = "fuchsia", + target_os = "redox", + target_os = "haiku" +)))] +use std::path::Path; +use tempfile::{tempdir, tempfile}; + +use crate::*; + +#[test] +#[cfg(not(any(target_os = "netbsd")))] +fn test_fork_and_waitpid() { + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is signal-safe + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => unsafe { _exit(0) }, + Parent { child } => { + // assert that child was created and pid > 0 + let child_raw: ::libc::pid_t = child.into(); + assert!(child_raw > 0); + let wait_status = waitpid(child, None); + match wait_status { + // assert that waitpid returned correct status and the pid is the one of the child + Ok(WaitStatus::Exited(pid_t, _)) => assert_eq!(pid_t, child), + + // panic, must never happen + s @ Ok(_) => { + panic!("Child exited {:?}, should never happen", s) + } + + // panic, waitpid should never fail + Err(s) => panic!("Error: waitpid returned Err({:?}", s), + } + } + } +} + +#[test] +fn test_wait() { + // Grab FORK_MTX so wait doesn't reap a different test's child process + let _m = crate::FORK_MTX.lock(); + + // Safe: Child only calls `_exit`, which is signal-safe + match unsafe { fork() }.expect("Error: Fork Failed") { + Child => unsafe { _exit(0) }, + Parent { child } => { + let wait_status = wait(); + + // just assert that (any) one child returns with WaitStatus::Exited + assert_eq!(wait_status, Ok(WaitStatus::Exited(child, 0))); + } + } +} + +#[test] +fn test_mkstemp() { + let mut path = env::temp_dir(); + path.push("nix_tempfile.XXXXXX"); + + let result = mkstemp(&path); + match result { + Ok((fd, path)) => { + close(fd).unwrap(); + unlink(path.as_path()).unwrap(); + } + Err(e) => panic!("mkstemp failed: {}", e), + } +} + +#[test] +fn test_mkstemp_directory() { + // mkstemp should fail if a directory is given + mkstemp(&env::temp_dir()).expect_err("assertion failed"); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkfifo() { + let tempdir = tempdir().unwrap(); + let mkfifo_fifo = tempdir.path().join("mkfifo_fifo"); + + mkfifo(&mkfifo_fifo, Mode::S_IRUSR).unwrap(); + + let stats = stat::stat(&mkfifo_fifo).unwrap(); + let typ = stat::SFlag::from_bits_truncate(stats.st_mode as mode_t); + assert_eq!(typ, SFlag::S_IFIFO); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_mkfifo_directory() { + // mkfifo should fail if a directory is given + mkfifo(&env::temp_dir(), Mode::S_IRUSR).expect_err("assertion failed"); +} + +#[test] +#[cfg(not(any( + target_os = "macos", + target_os = "ios", + target_os = "android", + target_os = "redox", + target_os = "haiku" +)))] +fn test_mkfifoat_none() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + let mkfifoat_fifo = tempdir.path().join("mkfifoat_fifo"); + + mkfifoat(None, &mkfifoat_fifo, Mode::S_IRUSR).unwrap(); + + let stats = stat::stat(&mkfifoat_fifo).unwrap(); + let typ = stat::SFlag::from_bits_truncate(stats.st_mode); + assert_eq!(typ, SFlag::S_IFIFO); +} + +#[test] +#[cfg(not(any( + target_os = "macos", + target_os = "ios", + target_os = "android", + target_os = "redox", + target_os = "haiku" +)))] +fn test_mkfifoat() { + use nix::fcntl; + + let tempdir = tempdir().unwrap(); + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let mkfifoat_name = "mkfifoat_name"; + + mkfifoat(Some(dirfd), mkfifoat_name, Mode::S_IRUSR).unwrap(); + + let stats = + stat::fstatat(dirfd, mkfifoat_name, fcntl::AtFlags::empty()).unwrap(); + let typ = stat::SFlag::from_bits_truncate(stats.st_mode); + assert_eq!(typ, SFlag::S_IFIFO); +} + +#[test] +#[cfg(not(any( + target_os = "macos", + target_os = "ios", + target_os = "android", + target_os = "redox", + target_os = "haiku" +)))] +fn test_mkfifoat_directory_none() { + let _m = crate::CWD_LOCK.read(); + + // mkfifoat should fail if a directory is given + mkfifoat(None, &env::temp_dir(), Mode::S_IRUSR) + .expect_err("assertion failed"); +} + +#[test] +#[cfg(not(any( + target_os = "macos", + target_os = "ios", + target_os = "android", + target_os = "redox", + target_os = "haiku" +)))] +fn test_mkfifoat_directory() { + // mkfifoat should fail if a directory is given + let tempdir = tempdir().unwrap(); + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let mkfifoat_dir = "mkfifoat_dir"; + stat::mkdirat(dirfd, mkfifoat_dir, Mode::S_IRUSR).unwrap(); + + mkfifoat(Some(dirfd), mkfifoat_dir, Mode::S_IRUSR) + .expect_err("assertion failed"); +} + +#[test] +fn test_getpid() { + let pid: ::libc::pid_t = getpid().into(); + let ppid: ::libc::pid_t = getppid().into(); + assert!(pid > 0); + assert!(ppid > 0); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_getsid() { + let none_sid: ::libc::pid_t = getsid(None).unwrap().into(); + let pid_sid: ::libc::pid_t = getsid(Some(getpid())).unwrap().into(); + assert!(none_sid > 0); + assert_eq!(none_sid, pid_sid); +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +mod linux_android { + use nix::unistd::gettid; + + #[test] + fn test_gettid() { + let tid: ::libc::pid_t = gettid().into(); + assert!(tid > 0); + } +} + +#[test] +// `getgroups()` and `setgroups()` do not behave as expected on Apple platforms +#[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "redox", + target_os = "fuchsia", + target_os = "haiku" +)))] +fn test_setgroups() { + // Skip this test when not run as root as `setgroups()` requires root. + skip_if_not_root!("test_setgroups"); + + let _m = crate::GROUPS_MTX.lock(); + + // Save the existing groups + let old_groups = getgroups().unwrap(); + + // Set some new made up groups + let groups = [Gid::from_raw(123), Gid::from_raw(456)]; + setgroups(&groups).unwrap(); + + let new_groups = getgroups().unwrap(); + assert_eq!(new_groups, groups); + + // Revert back to the old groups + setgroups(&old_groups).unwrap(); +} + +#[test] +// `getgroups()` and `setgroups()` do not behave as expected on Apple platforms +#[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "redox", + target_os = "fuchsia", + target_os = "haiku", + target_os = "illumos" +)))] +fn test_initgroups() { + // Skip this test when not run as root as `initgroups()` and `setgroups()` + // require root. + skip_if_not_root!("test_initgroups"); + + let _m = crate::GROUPS_MTX.lock(); + + // Save the existing groups + let old_groups = getgroups().unwrap(); + + // It doesn't matter if the root user is not called "root" or if a user + // called "root" doesn't exist. We are just checking that the extra, + // made-up group, `123`, is set. + // FIXME: Test the other half of initgroups' functionality: whether the + // groups that the user belongs to are also set. + let user = CString::new("root").unwrap(); + let group = Gid::from_raw(123); + let group_list = getgrouplist(&user, group).unwrap(); + assert!(group_list.contains(&group)); + + initgroups(&user, group).unwrap(); + + let new_groups = getgroups().unwrap(); + assert_eq!(new_groups, group_list); + + // Revert back to the old groups + setgroups(&old_groups).unwrap(); +} + +#[cfg(not(any(target_os = "fuchsia", target_os = "redox")))] +macro_rules! execve_test_factory ( + ($test_name:ident, $syscall:ident, $exe: expr $(, $pathname:expr, $flags:expr)*) => ( + + #[cfg(test)] + mod $test_name { + use std::ffi::CStr; + use super::*; + + const EMPTY: &'static [u8] = b"\0"; + const DASH_C: &'static [u8] = b"-c\0"; + const BIGARG: &'static [u8] = b"echo nix!!! && echo foo=$foo && echo baz=$baz\0"; + const FOO: &'static [u8] = b"foo=bar\0"; + const BAZ: &'static [u8] = b"baz=quux\0"; + + fn syscall_cstr_ref() -> Result { + $syscall( + $exe, + $(CString::new($pathname).unwrap().as_c_str(), )* + &[CStr::from_bytes_with_nul(EMPTY).unwrap(), + CStr::from_bytes_with_nul(DASH_C).unwrap(), + CStr::from_bytes_with_nul(BIGARG).unwrap()], + &[CStr::from_bytes_with_nul(FOO).unwrap(), + CStr::from_bytes_with_nul(BAZ).unwrap()] + $(, $flags)*) + } + + fn syscall_cstring() -> Result { + $syscall( + $exe, + $(CString::new($pathname).unwrap().as_c_str(), )* + &[CString::from(CStr::from_bytes_with_nul(EMPTY).unwrap()), + CString::from(CStr::from_bytes_with_nul(DASH_C).unwrap()), + CString::from(CStr::from_bytes_with_nul(BIGARG).unwrap())], + &[CString::from(CStr::from_bytes_with_nul(FOO).unwrap()), + CString::from(CStr::from_bytes_with_nul(BAZ).unwrap())] + $(, $flags)*) + } + + fn common_test(syscall: fn() -> Result) { + if "execveat" == stringify!($syscall) { + // Though undocumented, Docker's default seccomp profile seems to + // block this syscall. https://github.com/nix-rust/nix/issues/1122 + skip_if_seccomp!($test_name); + } + + let m = crate::FORK_MTX.lock(); + // The `exec`d process will write to `writer`, and we'll read that + // data from `reader`. + let (reader, writer) = pipe().unwrap(); + + // Safe: Child calls `exit`, `dup`, `close` and the provided `exec*` family function. + // NOTE: Technically, this makes the macro unsafe to use because you could pass anything. + // The tests make sure not to do that, though. + match unsafe{fork()}.unwrap() { + Child => { + // Make `writer` be the stdout of the new process. + dup2(writer, 1).unwrap(); + let r = syscall(); + let _ = std::io::stderr() + .write_all(format!("{:?}", r).as_bytes()); + // Should only get here in event of error + unsafe{ _exit(1) }; + }, + Parent { child } => { + // Wait for the child to exit. + let ws = waitpid(child, None); + drop(m); + assert_eq!(ws, Ok(WaitStatus::Exited(child, 0))); + // Read 1024 bytes. + let mut buf = [0u8; 1024]; + read(reader, &mut buf).unwrap(); + // It should contain the things we printed using `/bin/sh`. + let string = String::from_utf8_lossy(&buf); + assert!(string.contains("nix!!!")); + assert!(string.contains("foo=bar")); + assert!(string.contains("baz=quux")); + } + } + } + + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + #[cfg_attr(target_env = "musl", ignore)] + #[test] + fn test_cstr_ref() { + common_test(syscall_cstr_ref); + } + + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + #[cfg_attr(target_env = "musl", ignore)] + #[test] + fn test_cstring() { + common_test(syscall_cstring); + } + } + + ) +); + +cfg_if! { + if #[cfg(target_os = "android")] { + execve_test_factory!(test_execve, execve, CString::new("/system/bin/sh").unwrap().as_c_str()); + execve_test_factory!(test_fexecve, fexecve, File::open("/system/bin/sh").unwrap().into_raw_fd()); + } else if #[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux"))] { + // These tests frequently fail on musl, probably due to + // https://github.com/nix-rust/nix/issues/555 + execve_test_factory!(test_execve, execve, CString::new("/bin/sh").unwrap().as_c_str()); + execve_test_factory!(test_fexecve, fexecve, File::open("/bin/sh").unwrap().into_raw_fd()); + } else if #[cfg(any(target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "solaris"))] { + execve_test_factory!(test_execve, execve, CString::new("/bin/sh").unwrap().as_c_str()); + // No fexecve() on ios, macos, NetBSD, OpenBSD. + } +} + +#[cfg(any(target_os = "haiku", target_os = "linux", target_os = "openbsd"))] +execve_test_factory!(test_execvpe, execvpe, &CString::new("sh").unwrap()); + +cfg_if! { + if #[cfg(target_os = "android")] { + use nix::fcntl::AtFlags; + execve_test_factory!(test_execveat_empty, execveat, + File::open("/system/bin/sh").unwrap().into_raw_fd(), + "", AtFlags::AT_EMPTY_PATH); + execve_test_factory!(test_execveat_relative, execveat, + File::open("/system/bin/").unwrap().into_raw_fd(), + "./sh", AtFlags::empty()); + execve_test_factory!(test_execveat_absolute, execveat, + File::open("/").unwrap().into_raw_fd(), + "/system/bin/sh", AtFlags::empty()); + } else if #[cfg(all(target_os = "linux", any(target_arch ="x86_64", target_arch ="x86")))] { + use nix::fcntl::AtFlags; + execve_test_factory!(test_execveat_empty, execveat, File::open("/bin/sh").unwrap().into_raw_fd(), + "", AtFlags::AT_EMPTY_PATH); + execve_test_factory!(test_execveat_relative, execveat, File::open("/bin/").unwrap().into_raw_fd(), + "./sh", AtFlags::empty()); + execve_test_factory!(test_execveat_absolute, execveat, File::open("/").unwrap().into_raw_fd(), + "/bin/sh", AtFlags::empty()); + } +} + +#[test] +#[cfg(not(target_os = "fuchsia"))] +fn test_fchdir() { + // fchdir changes the process's cwd + let _dr = crate::DirRestore::new(); + + let tmpdir = tempdir().unwrap(); + let tmpdir_path = tmpdir.path().canonicalize().unwrap(); + let tmpdir_fd = File::open(&tmpdir_path).unwrap().into_raw_fd(); + + fchdir(tmpdir_fd).expect("assertion failed"); + assert_eq!(getcwd().unwrap(), tmpdir_path); + + close(tmpdir_fd).expect("assertion failed"); +} + +#[test] +fn test_getcwd() { + // chdir changes the process's cwd + let _dr = crate::DirRestore::new(); + + let tmpdir = tempdir().unwrap(); + let tmpdir_path = tmpdir.path().canonicalize().unwrap(); + chdir(&tmpdir_path).expect("assertion failed"); + assert_eq!(getcwd().unwrap(), tmpdir_path); + + // make path 500 chars longer so that buffer doubling in getcwd + // kicks in. Note: One path cannot be longer than 255 bytes + // (NAME_MAX) whole path cannot be longer than PATH_MAX (usually + // 4096 on linux, 1024 on macos) + let mut inner_tmp_dir = tmpdir_path; + for _ in 0..5 { + let newdir = "a".repeat(100); + inner_tmp_dir.push(newdir); + mkdir(inner_tmp_dir.as_path(), Mode::S_IRWXU) + .expect("assertion failed"); + } + chdir(inner_tmp_dir.as_path()).expect("assertion failed"); + assert_eq!(getcwd().unwrap(), inner_tmp_dir.as_path()); +} + +#[test] +fn test_chown() { + // Testing for anything other than our own UID/GID is hard. + let uid = Some(getuid()); + let gid = Some(getgid()); + + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + { + File::create(&path).unwrap(); + } + + chown(&path, uid, gid).unwrap(); + chown(&path, uid, None).unwrap(); + chown(&path, None, gid).unwrap(); + + fs::remove_file(&path).unwrap(); + chown(&path, uid, gid).unwrap_err(); +} + +#[test] +fn test_fchown() { + // Testing for anything other than our own UID/GID is hard. + let uid = Some(getuid()); + let gid = Some(getgid()); + + let path = tempfile().unwrap(); + let fd = path.as_raw_fd(); + + fchown(fd, uid, gid).unwrap(); + fchown(fd, uid, None).unwrap(); + fchown(fd, None, gid).unwrap(); + fchown(999999999, uid, gid).unwrap_err(); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_fchownat() { + let _dr = crate::DirRestore::new(); + // Testing for anything other than our own UID/GID is hard. + let uid = Some(getuid()); + let gid = Some(getgid()); + + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + { + File::create(&path).unwrap(); + } + + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + + fchownat(Some(dirfd), "file", uid, gid, FchownatFlags::FollowSymlink) + .unwrap(); + + chdir(tempdir.path()).unwrap(); + fchownat(None, "file", uid, gid, FchownatFlags::FollowSymlink).unwrap(); + + fs::remove_file(&path).unwrap(); + fchownat(None, "file", uid, gid, FchownatFlags::FollowSymlink).unwrap_err(); +} + +#[test] +fn test_lseek() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + let tmpfd = tmp.into_raw_fd(); + + let offset: off_t = 5; + lseek(tmpfd, offset, Whence::SeekSet).unwrap(); + + let mut buf = [0u8; 7]; + crate::read_exact(tmpfd, &mut buf); + assert_eq!(b"f123456", &buf); + + close(tmpfd).unwrap(); +} + +#[cfg(any(target_os = "linux", target_os = "android"))] +#[test] +fn test_lseek64() { + const CONTENTS: &[u8] = b"abcdef123456"; + let mut tmp = tempfile().unwrap(); + tmp.write_all(CONTENTS).unwrap(); + let tmpfd = tmp.into_raw_fd(); + + lseek64(tmpfd, 5, Whence::SeekSet).unwrap(); + + let mut buf = [0u8; 7]; + crate::read_exact(tmpfd, &mut buf); + assert_eq!(b"f123456", &buf); + + close(tmpfd).unwrap(); +} + +cfg_if! { + if #[cfg(any(target_os = "android", target_os = "linux"))] { + macro_rules! require_acct{ + () => { + require_capability!("test_acct", CAP_SYS_PACCT); + } + } + } else if #[cfg(target_os = "freebsd")] { + macro_rules! require_acct{ + () => { + skip_if_not_root!("test_acct"); + skip_if_jailed!("test_acct"); + } + } + } else if #[cfg(not(any(target_os = "redox", target_os = "fuchsia", target_os = "haiku")))] { + macro_rules! require_acct{ + () => { + skip_if_not_root!("test_acct"); + } + } + } +} + +#[test] +#[cfg(not(any( + target_os = "redox", + target_os = "fuchsia", + target_os = "haiku" +)))] +fn test_acct() { + use std::process::Command; + use std::{thread, time}; + use tempfile::NamedTempFile; + + let _m = crate::FORK_MTX.lock(); + require_acct!(); + + let file = NamedTempFile::new().unwrap(); + let path = file.path().to_str().unwrap(); + + acct::enable(path).unwrap(); + + loop { + Command::new("echo").arg("Hello world").output().unwrap(); + let len = fs::metadata(path).unwrap().len(); + if len > 0 { + break; + } + thread::sleep(time::Duration::from_millis(10)); + } + acct::disable().unwrap(); +} + +#[test] +fn test_fpathconf_limited() { + let f = tempfile().unwrap(); + // AFAIK, PATH_MAX is limited on all platforms, so it makes a good test + let path_max = fpathconf(f.as_raw_fd(), PathconfVar::PATH_MAX); + assert!( + path_max + .expect("fpathconf failed") + .expect("PATH_MAX is unlimited") + > 0 + ); +} + +#[test] +fn test_pathconf_limited() { + // AFAIK, PATH_MAX is limited on all platforms, so it makes a good test + let path_max = pathconf("/", PathconfVar::PATH_MAX); + assert!( + path_max + .expect("pathconf failed") + .expect("PATH_MAX is unlimited") + > 0 + ); +} + +#[test] +fn test_sysconf_limited() { + // AFAIK, OPEN_MAX is limited on all platforms, so it makes a good test + let open_max = sysconf(SysconfVar::OPEN_MAX); + assert!( + open_max + .expect("sysconf failed") + .expect("OPEN_MAX is unlimited") + > 0 + ); +} + +#[cfg(target_os = "freebsd")] +#[test] +fn test_sysconf_unsupported() { + // I know of no sysconf variables that are unsupported everywhere, but + // _XOPEN_CRYPT is unsupported on FreeBSD 11.0, which is one of the platforms + // we test. + let open_max = sysconf(SysconfVar::_XOPEN_CRYPT); + assert!(open_max.expect("sysconf failed").is_none()) +} + +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd" +))] +#[test] +fn test_getresuid() { + let resuids = getresuid().unwrap(); + assert_ne!(resuids.real.as_raw(), libc::uid_t::MAX); + assert_ne!(resuids.effective.as_raw(), libc::uid_t::MAX); + assert_ne!(resuids.saved.as_raw(), libc::uid_t::MAX); +} + +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "linux", + target_os = "openbsd" +))] +#[test] +fn test_getresgid() { + let resgids = getresgid().unwrap(); + assert_ne!(resgids.real.as_raw(), libc::gid_t::MAX); + assert_ne!(resgids.effective.as_raw(), libc::gid_t::MAX); + assert_ne!(resgids.saved.as_raw(), libc::gid_t::MAX); +} + +// Test that we can create a pair of pipes. No need to verify that they pass +// data; that's the domain of the OS, not nix. +#[test] +fn test_pipe() { + let (fd0, fd1) = pipe().unwrap(); + let m0 = stat::SFlag::from_bits_truncate( + stat::fstat(fd0).unwrap().st_mode as mode_t, + ); + // S_IFIFO means it's a pipe + assert_eq!(m0, SFlag::S_IFIFO); + let m1 = stat::SFlag::from_bits_truncate( + stat::fstat(fd1).unwrap().st_mode as mode_t, + ); + assert_eq!(m1, SFlag::S_IFIFO); +} + +// pipe2(2) is the same as pipe(2), except it allows setting some flags. Check +// that we can set a flag. +#[cfg(any( + target_os = "android", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "illumos", + target_os = "linux", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox", + target_os = "solaris" +))] +#[test] +fn test_pipe2() { + use nix::fcntl::{fcntl, FcntlArg, FdFlag}; + + let (fd0, fd1) = pipe2(OFlag::O_CLOEXEC).unwrap(); + let f0 = FdFlag::from_bits_truncate(fcntl(fd0, FcntlArg::F_GETFD).unwrap()); + assert!(f0.contains(FdFlag::FD_CLOEXEC)); + let f1 = FdFlag::from_bits_truncate(fcntl(fd1, FcntlArg::F_GETFD).unwrap()); + assert!(f1.contains(FdFlag::FD_CLOEXEC)); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_truncate() { + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + + { + let mut tmp = File::create(&path).unwrap(); + const CONTENTS: &[u8] = b"12345678"; + tmp.write_all(CONTENTS).unwrap(); + } + + truncate(&path, 4).unwrap(); + + let metadata = fs::metadata(&path).unwrap(); + assert_eq!(4, metadata.len()); +} + +#[test] +fn test_ftruncate() { + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("file"); + + let tmpfd = { + let mut tmp = File::create(&path).unwrap(); + const CONTENTS: &[u8] = b"12345678"; + tmp.write_all(CONTENTS).unwrap(); + tmp.into_raw_fd() + }; + + ftruncate(tmpfd, 2).unwrap(); + close(tmpfd).unwrap(); + + let metadata = fs::metadata(&path).unwrap(); + assert_eq!(2, metadata.len()); +} + +// Used in `test_alarm`. +#[cfg(not(target_os = "redox"))] +static mut ALARM_CALLED: bool = false; + +// Used in `test_alarm`. +#[cfg(not(target_os = "redox"))] +pub extern "C" fn alarm_signal_handler(raw_signal: libc::c_int) { + assert_eq!( + raw_signal, + libc::SIGALRM, + "unexpected signal: {}", + raw_signal + ); + unsafe { ALARM_CALLED = true }; +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_alarm() { + use std::{ + thread, + time::{Duration, Instant}, + }; + + // Maybe other tests that fork interfere with this one? + let _m = crate::SIGNAL_MTX.lock(); + + let handler = SigHandler::Handler(alarm_signal_handler); + let signal_action = + SigAction::new(handler, SaFlags::SA_RESTART, SigSet::empty()); + let old_handler = unsafe { + sigaction(Signal::SIGALRM, &signal_action) + .expect("unable to set signal handler for alarm") + }; + + // Set an alarm. + assert_eq!(alarm::set(60), None); + + // Overwriting an alarm should return the old alarm. + assert_eq!(alarm::set(1), Some(60)); + + // We should be woken up after 1 second by the alarm, so we'll sleep for 3 + // seconds to be sure. + let starttime = Instant::now(); + loop { + thread::sleep(Duration::from_millis(100)); + if unsafe { ALARM_CALLED } { + break; + } + if starttime.elapsed() > Duration::from_secs(3) { + panic!("Timeout waiting for SIGALRM"); + } + } + + // Reset the signal. + unsafe { + sigaction(Signal::SIGALRM, &old_handler) + .expect("unable to set signal handler for alarm"); + } +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_canceling_alarm() { + let _m = crate::SIGNAL_MTX.lock(); + + assert_eq!(alarm::cancel(), None); + + assert_eq!(alarm::set(60), None); + assert_eq!(alarm::cancel(), Some(60)); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_symlinkat() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + + let target = tempdir.path().join("a"); + let linkpath = tempdir.path().join("b"); + symlinkat(&target, None, &linkpath).unwrap(); + assert_eq!( + readlink(&linkpath).unwrap().to_str().unwrap(), + target.to_str().unwrap() + ); + + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let target = "c"; + let linkpath = "d"; + symlinkat(target, Some(dirfd), linkpath).unwrap(); + assert_eq!( + readlink(&tempdir.path().join(linkpath)) + .unwrap() + .to_str() + .unwrap(), + target + ); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_linkat_file() { + let tempdir = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir.path().join(oldfilename); + + let newfilename = "bar.txt"; + let newfilepath = tempdir.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + + // Attempt hard link file at relative path + linkat( + Some(dirfd), + oldfilename, + Some(dirfd), + newfilename, + LinkatFlags::SymlinkFollow, + ) + .unwrap(); + assert!(newfilepath.exists()); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_linkat_olddirfd_none() { + let _dr = crate::DirRestore::new(); + + let tempdir_oldfile = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir_oldfile.path().join(oldfilename); + + let tempdir_newfile = tempdir().unwrap(); + let newfilename = "bar.txt"; + let newfilepath = tempdir_newfile.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Get file descriptor for base directory of new file + let dirfd = fcntl::open( + tempdir_newfile.path(), + fcntl::OFlag::empty(), + stat::Mode::empty(), + ) + .unwrap(); + + // Attempt hard link file using curent working directory as relative path for old file path + chdir(tempdir_oldfile.path()).unwrap(); + linkat( + None, + oldfilename, + Some(dirfd), + newfilename, + LinkatFlags::SymlinkFollow, + ) + .unwrap(); + assert!(newfilepath.exists()); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_linkat_newdirfd_none() { + let _dr = crate::DirRestore::new(); + + let tempdir_oldfile = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir_oldfile.path().join(oldfilename); + + let tempdir_newfile = tempdir().unwrap(); + let newfilename = "bar.txt"; + let newfilepath = tempdir_newfile.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Get file descriptor for base directory of old file + let dirfd = fcntl::open( + tempdir_oldfile.path(), + fcntl::OFlag::empty(), + stat::Mode::empty(), + ) + .unwrap(); + + // Attempt hard link file using current working directory as relative path for new file path + chdir(tempdir_newfile.path()).unwrap(); + linkat( + Some(dirfd), + oldfilename, + None, + newfilename, + LinkatFlags::SymlinkFollow, + ) + .unwrap(); + assert!(newfilepath.exists()); +} + +#[test] +#[cfg(not(any( + target_os = "ios", + target_os = "macos", + target_os = "redox", + target_os = "haiku" +)))] +fn test_linkat_no_follow_symlink() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir.path().join(oldfilename); + + let symoldfilename = "symfoo.txt"; + let symoldfilepath = tempdir.path().join(symoldfilename); + + let newfilename = "nofollowsymbar.txt"; + let newfilepath = tempdir.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Create symlink to file + symlinkat(&oldfilepath, None, &symoldfilepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + + // Attempt link symlink of file at relative path + linkat( + Some(dirfd), + symoldfilename, + Some(dirfd), + newfilename, + LinkatFlags::NoSymlinkFollow, + ) + .unwrap(); + + // Assert newfile is actually a symlink to oldfile. + assert_eq!( + readlink(&newfilepath).unwrap().to_str().unwrap(), + oldfilepath.to_str().unwrap() + ); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "haiku")))] +fn test_linkat_follow_symlink() { + let _m = crate::CWD_LOCK.read(); + + let tempdir = tempdir().unwrap(); + let oldfilename = "foo.txt"; + let oldfilepath = tempdir.path().join(oldfilename); + + let symoldfilename = "symfoo.txt"; + let symoldfilepath = tempdir.path().join(symoldfilename); + + let newfilename = "nofollowsymbar.txt"; + let newfilepath = tempdir.path().join(newfilename); + + // Create file + File::create(&oldfilepath).unwrap(); + + // Create symlink to file + symlinkat(&oldfilepath, None, &symoldfilepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + + // Attempt link target of symlink of file at relative path + linkat( + Some(dirfd), + symoldfilename, + Some(dirfd), + newfilename, + LinkatFlags::SymlinkFollow, + ) + .unwrap(); + + let newfilestat = stat::stat(&newfilepath).unwrap(); + + // Check the file type of the new link + assert_eq!( + (stat::SFlag::from_bits_truncate(newfilestat.st_mode as mode_t) + & SFlag::S_IFMT), + SFlag::S_IFREG + ); + + // Check the number of hard links to the original file + assert_eq!(newfilestat.st_nlink, 2); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_unlinkat_dir_noremovedir() { + let tempdir = tempdir().unwrap(); + let dirname = "foo_dir"; + let dirpath = tempdir.path().join(dirname); + + // Create dir + DirBuilder::new().recursive(true).create(&dirpath).unwrap(); + + // Get file descriptor for base directory + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + + // Attempt unlink dir at relative path without proper flag + let err_result = + unlinkat(Some(dirfd), dirname, UnlinkatFlags::NoRemoveDir).unwrap_err(); + assert!(err_result == Errno::EISDIR || err_result == Errno::EPERM); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_unlinkat_dir_removedir() { + let tempdir = tempdir().unwrap(); + let dirname = "foo_dir"; + let dirpath = tempdir.path().join(dirname); + + // Create dir + DirBuilder::new().recursive(true).create(&dirpath).unwrap(); + + // Get file descriptor for base directory + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + + // Attempt unlink dir at relative path with proper flag + unlinkat(Some(dirfd), dirname, UnlinkatFlags::RemoveDir).unwrap(); + assert!(!dirpath.exists()); +} + +#[test] +#[cfg(not(target_os = "redox"))] +fn test_unlinkat_file() { + let tempdir = tempdir().unwrap(); + let filename = "foo.txt"; + let filepath = tempdir.path().join(filename); + + // Create file + File::create(&filepath).unwrap(); + + // Get file descriptor for base directory + let dirfd = + fcntl::open(tempdir.path(), fcntl::OFlag::empty(), stat::Mode::empty()) + .unwrap(); + + // Attempt unlink file at relative path + unlinkat(Some(dirfd), filename, UnlinkatFlags::NoRemoveDir).unwrap(); + assert!(!filepath.exists()); +} + +#[test] +fn test_access_not_existing() { + let tempdir = tempdir().unwrap(); + let dir = tempdir.path().join("does_not_exist.txt"); + assert_eq!( + access(&dir, AccessFlags::F_OK).err().unwrap(), + Errno::ENOENT + ); +} + +#[test] +fn test_access_file_exists() { + let tempdir = tempdir().unwrap(); + let path = tempdir.path().join("does_exist.txt"); + let _file = File::create(path.clone()).unwrap(); + access(&path, AccessFlags::R_OK | AccessFlags::W_OK) + .expect("assertion failed"); +} + +//Clippy false positive https://github.com/rust-lang/rust-clippy/issues/9111 +#[allow(clippy::needless_borrow)] +#[cfg(not(target_os = "redox"))] +#[test] +fn test_user_into_passwd() { + // get the UID of the "nobody" user + #[cfg(not(target_os = "haiku"))] + let test_username = "nobody"; + // "nobody" unavailable on haiku + #[cfg(target_os = "haiku")] + let test_username = "user"; + + let nobody = User::from_name(test_username).unwrap().unwrap(); + let pwd: libc::passwd = nobody.into(); + let _: User = (&pwd).into(); +} + +/// Tests setting the filesystem UID with `setfsuid`. +#[cfg(any(target_os = "linux", target_os = "android"))] +#[test] +fn test_setfsuid() { + use std::os::unix::fs::PermissionsExt; + use std::{fs, io, thread}; + require_capability!("test_setfsuid", CAP_SETUID); + + // get the UID of the "nobody" user + let nobody = User::from_name("nobody").unwrap().unwrap(); + + // create a temporary file with permissions '-rw-r-----' + let file = tempfile::NamedTempFile::new_in("/var/tmp").unwrap(); + let temp_path = file.into_temp_path(); + let temp_path_2 = temp_path.to_path_buf(); + let mut permissions = fs::metadata(&temp_path).unwrap().permissions(); + permissions.set_mode(0o640); + + // spawn a new thread where to test setfsuid + thread::spawn(move || { + // set filesystem UID + let fuid = setfsuid(nobody.uid); + // trying to open the temporary file should fail with EACCES + let res = fs::File::open(&temp_path); + let err = res.expect_err("assertion failed"); + assert_eq!(err.kind(), io::ErrorKind::PermissionDenied); + + // assert fuid actually changes + let prev_fuid = setfsuid(Uid::from_raw(-1i32 as u32)); + assert_ne!(prev_fuid, fuid); + }) + .join() + .unwrap(); + + // open the temporary file with the current thread filesystem UID + fs::File::open(temp_path_2).unwrap(); +} + +#[test] +#[cfg(not(any( + target_os = "redox", + target_os = "fuchsia", + target_os = "haiku" +)))] +fn test_ttyname() { + let fd = posix_openpt(OFlag::O_RDWR).expect("posix_openpt failed"); + assert!(fd.as_raw_fd() > 0); + + // on linux, we can just call ttyname on the pty master directly, but + // apparently osx requires that ttyname is called on a slave pty (can't + // find this documented anywhere, but it seems to empirically be the case) + grantpt(&fd).expect("grantpt failed"); + unlockpt(&fd).expect("unlockpt failed"); + let sname = unsafe { ptsname(&fd) }.expect("ptsname failed"); + let fds = open(Path::new(&sname), OFlag::O_RDWR, stat::Mode::empty()) + .expect("open failed"); + assert!(fds > 0); + + let name = ttyname(fds).expect("ttyname failed"); + assert!(name.starts_with("/dev")); +} + +#[test] +#[cfg(not(any(target_os = "redox", target_os = "fuchsia")))] +fn test_ttyname_not_pty() { + let fd = File::open("/dev/zero").unwrap(); + assert!(fd.as_raw_fd() > 0); + assert_eq!(ttyname(fd.as_raw_fd()), Err(Errno::ENOTTY)); +} + +#[test] +#[cfg(not(any( + target_os = "redox", + target_os = "fuchsia", + target_os = "haiku" +)))] +fn test_ttyname_invalid_fd() { + assert_eq!(ttyname(-1), Err(Errno::EBADF)); +} + +#[test] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +fn test_getpeereid() { + use std::os::unix::net::UnixStream; + let (sock_a, sock_b) = UnixStream::pair().unwrap(); + + let (uid_a, gid_a) = getpeereid(sock_a.as_raw_fd()).unwrap(); + let (uid_b, gid_b) = getpeereid(sock_b.as_raw_fd()).unwrap(); + + let uid = geteuid(); + let gid = getegid(); + + assert_eq!(uid, uid_a); + assert_eq!(gid, gid_a); + assert_eq!(uid_a, uid_b); + assert_eq!(gid_a, gid_b); +} + +#[test] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "freebsd", + target_os = "openbsd", + target_os = "netbsd", + target_os = "dragonfly", +))] +fn test_getpeereid_invalid_fd() { + // getpeereid is not POSIX, so error codes are inconsistent between different Unices. + getpeereid(-1).expect_err("assertion failed"); +} + +#[test] +#[cfg(not(any(target_os = "illumos", target_os = "redox")))] +fn test_faccessat_none_not_existing() { + use nix::fcntl::AtFlags; + let tempdir = tempfile::tempdir().unwrap(); + let dir = tempdir.path().join("does_not_exist.txt"); + assert_eq!( + faccessat(None, &dir, AccessFlags::F_OK, AtFlags::empty()) + .err() + .unwrap(), + Errno::ENOENT + ); +} + +#[test] +#[cfg(not(any(target_os = "illumos", target_os = "redox")))] +fn test_faccessat_not_existing() { + use nix::fcntl::AtFlags; + let tempdir = tempfile::tempdir().unwrap(); + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let not_exist_file = "does_not_exist.txt"; + assert_eq!( + faccessat( + Some(dirfd), + not_exist_file, + AccessFlags::F_OK, + AtFlags::empty(), + ) + .err() + .unwrap(), + Errno::ENOENT + ); +} + +#[test] +#[cfg(not(any(target_os = "illumos", target_os = "redox")))] +fn test_faccessat_none_file_exists() { + use nix::fcntl::AtFlags; + let tempdir = tempfile::tempdir().unwrap(); + let path = tempdir.path().join("does_exist.txt"); + let _file = File::create(path.clone()).unwrap(); + assert!(faccessat( + None, + &path, + AccessFlags::R_OK | AccessFlags::W_OK, + AtFlags::empty(), + ) + .is_ok()); +} + +#[test] +#[cfg(not(any(target_os = "illumos", target_os = "redox")))] +fn test_faccessat_file_exists() { + use nix::fcntl::AtFlags; + let tempdir = tempfile::tempdir().unwrap(); + let dirfd = open(tempdir.path(), OFlag::empty(), Mode::empty()).unwrap(); + let exist_file = "does_exist.txt"; + let path = tempdir.path().join(exist_file); + let _file = File::create(path.clone()).unwrap(); + assert!(faccessat( + Some(dirfd), + &path, + AccessFlags::R_OK | AccessFlags::W_OK, + AtFlags::empty(), + ) + .is_ok()); +} diff --git a/bash-5.1/vendor/pin-utils/.cargo-checksum.json b/bash-5.1/vendor/pin-utils/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..9711659437f444e330504ac231eabf54e29bfb15 --- /dev/null +++ b/bash-5.1/vendor/pin-utils/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"0f8296bda5b928d57bb84443422f21db3aa35d6873ce651297634d80c183dc6b","LICENSE-APACHE":"a4db788775cb25f2da419a7ccd3f1f89c3d2cfa8748fb25257596b88183b4c77","LICENSE-MIT":"28802412d2bfbafe432b305634413b41a984d30fba0df41d30aa2c8a2077c5b1","README.md":"1b0cfd43afdfb6bb718a65f9fa9954b8de3a2638f155ee021465b35f0ae98336","src/lib.rs":"bed1d1c013f78036a7288ac3ebbe07c097d9a5a435b1367085484529d784b4e0","src/projection.rs":"18dbf1a747c3c4eec31768a51e1cfbce2ec83dc80dc44a5a80bb67b21ac5715d","src/stack_pin.rs":"b79661dc21f5ab923d75e3ddb52d43faf68fba7c7d592ec1929d1fd5275d70d8","tests/projection.rs":"04dd66b306e9d43d01a181da38add1ae8b8dee9e1fd16a3a0f39571cbb467f62","tests/stack_pin.rs":"2b2245ef1fb99176dd7fef74601fe6b69d394831e20dcdbd73268b34e17ce032"},"package":"8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"} \ No newline at end of file diff --git a/bash-5.1/vendor/pin-utils/Cargo.toml b/bash-5.1/vendor/pin-utils/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..5e2f779d7644dd327f08d9b040af141d386846ac --- /dev/null +++ b/bash-5.1/vendor/pin-utils/Cargo.toml @@ -0,0 +1,22 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +edition = "2018" +name = "pin-utils" +version = "0.1.0" +authors = ["Josef Brandl "] +description = "Utilities for pinning\n" +documentation = "https://docs.rs/pin-utils" +readme = "README.md" +license = "MIT OR Apache-2.0" +repository = "https://github.com/rust-lang-nursery/pin-utils" diff --git a/bash-5.1/vendor/pin-utils/LICENSE-APACHE b/bash-5.1/vendor/pin-utils/LICENSE-APACHE new file mode 100644 index 0000000000000000000000000000000000000000..66ccceda5e2ea70a8eca0de32994828458938129 --- /dev/null +++ b/bash-5.1/vendor/pin-utils/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2018 The pin-utils authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/bash-5.1/vendor/pin-utils/LICENSE-MIT b/bash-5.1/vendor/pin-utils/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..06e51c428316389d4bc49d2d27b4f1dedd98b6d9 --- /dev/null +++ b/bash-5.1/vendor/pin-utils/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2018 The pin-utils authors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/bash-5.1/vendor/pin-utils/README.md b/bash-5.1/vendor/pin-utils/README.md new file mode 100644 index 0000000000000000000000000000000000000000..93fdeb6fae15d50513c6a548b7af2fef76d9c9e6 --- /dev/null +++ b/bash-5.1/vendor/pin-utils/README.md @@ -0,0 +1,42 @@ +# pin-utils + +Utilities for pinning + +[![Build Status](https://travis-ci.com/rust-lang-nursery/pin-utils.svg?branch=master)](https://travis-ci.com/rust-lang-nursery/pin-utils) +[![Crates.io](https://img.shields.io/crates/v/pin-utils.svg)](https://crates.io/crates/pin-utils) + +[Documentation](https://docs.rs/pin-utils) + +## Usage + +First, add this to your `Cargo.toml`: + +```toml +[dependencies] +pin-utils = "0.1.0-alpha.4" +``` + +Now, you can use it: + +```rust +use pin_utils::pin_mut; // And more... +``` + +The current version of pin-utils requires Rust 1.33 or later. + +# License + +This project is licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in pin-utils by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. diff --git a/bash-5.1/vendor/pin-utils/src/lib.rs b/bash-5.1/vendor/pin-utils/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..6198e9823ae683ed35450ba3bd9f4a39a9963ad8 --- /dev/null +++ b/bash-5.1/vendor/pin-utils/src/lib.rs @@ -0,0 +1,17 @@ +//! Utilities for pinning + +#![no_std] +#![warn(missing_docs, missing_debug_implementations)] +#![deny(bare_trait_objects)] +#![allow(unknown_lints)] +#![doc(html_root_url = "https://docs.rs/pin-utils/0.1.0")] + +#[doc(hidden)] +pub mod core_reexport { + pub use core::*; +} + +#[macro_use] +mod stack_pin; +#[macro_use] +mod projection; diff --git a/bash-5.1/vendor/pin-utils/src/projection.rs b/bash-5.1/vendor/pin-utils/src/projection.rs new file mode 100644 index 0000000000000000000000000000000000000000..6af90c56be4a8703e8fa2c00d2b6f090b29587c2 --- /dev/null +++ b/bash-5.1/vendor/pin-utils/src/projection.rs @@ -0,0 +1,100 @@ +/// A pinned projection of a struct field. +/// +/// # Safety +/// +/// To make using this macro safe, three things need to be ensured: +/// - If the struct implements [`Drop`], the [`drop`] method is not allowed to +/// move the value of the field. +/// - If the struct wants to implement [`Unpin`], it has to do so conditionally: +/// The struct can only implement [`Unpin`] if the field's type is [`Unpin`]. +/// - The struct must not be `#[repr(packed)]`. +/// +/// # Example +/// +/// ```rust +/// use pin_utils::unsafe_pinned; +/// use std::marker::Unpin; +/// use std::pin::Pin; +/// +/// struct Foo { +/// field: T, +/// } +/// +/// impl Foo { +/// unsafe_pinned!(field: T); +/// +/// fn baz(mut self: Pin<&mut Self>) { +/// let _: Pin<&mut T> = self.field(); // Pinned reference to the field +/// } +/// } +/// +/// impl Unpin for Foo {} // Conditional Unpin impl +/// ``` +/// +/// Note: borrowing the field multiple times requires using `.as_mut()` to +/// avoid consuming the `Pin`. +/// +/// [`Unpin`]: core::marker::Unpin +/// [`drop`]: Drop::drop +#[macro_export] +macro_rules! unsafe_pinned { + ($f:tt: $t:ty) => ( + #[allow(unsafe_code)] + fn $f<'__a>( + self: $crate::core_reexport::pin::Pin<&'__a mut Self> + ) -> $crate::core_reexport::pin::Pin<&'__a mut $t> { + unsafe { + $crate::core_reexport::pin::Pin::map_unchecked_mut( + self, |x| &mut x.$f + ) + } + } + ) +} + +/// An unpinned projection of a struct field. +/// +/// # Safety +/// +/// This macro is unsafe because it creates a method that returns a normal +/// non-pin reference to the struct field. It is up to the programmer to ensure +/// that the contained value can be considered not pinned in the current +/// context. +/// +/// # Example +/// +/// ```rust +/// use pin_utils::unsafe_unpinned; +/// use std::pin::Pin; +/// +/// struct Bar; +/// struct Foo { +/// field: Bar, +/// } +/// +/// impl Foo { +/// unsafe_unpinned!(field: Bar); +/// +/// fn baz(mut self: Pin<&mut Self>) { +/// let _: &mut Bar = self.field(); // Normal reference to the field +/// } +/// } +/// ``` +/// +/// Note: borrowing the field multiple times requires using `.as_mut()` to +/// avoid consuming the [`Pin`]. +/// +/// [`Pin`]: core::pin::Pin +#[macro_export] +macro_rules! unsafe_unpinned { + ($f:tt: $t:ty) => ( + #[allow(unsafe_code)] + fn $f<'__a>( + self: $crate::core_reexport::pin::Pin<&'__a mut Self> + ) -> &'__a mut $t { + unsafe { + &mut $crate::core_reexport::pin::Pin::get_unchecked_mut(self).$f + } + } + ) +} diff --git a/bash-5.1/vendor/pin-utils/src/stack_pin.rs b/bash-5.1/vendor/pin-utils/src/stack_pin.rs new file mode 100644 index 0000000000000000000000000000000000000000..8a1ed2c5af774eef6daad1e74d0667c18c80aa71 --- /dev/null +++ b/bash-5.1/vendor/pin-utils/src/stack_pin.rs @@ -0,0 +1,25 @@ +/// Pins a value on the stack. +/// +/// # Example +/// +/// ```rust +/// # use pin_utils::pin_mut; +/// # use core::pin::Pin; +/// # struct Foo {} +/// let foo = Foo { /* ... */ }; +/// pin_mut!(foo); +/// let _: Pin<&mut Foo> = foo; +/// ``` +#[macro_export] +macro_rules! pin_mut { + ($($x:ident),* $(,)?) => { $( + // Move the value to ensure that it is owned + let mut $x = $x; + // Shadow the original binding so that it can't be directly accessed + // ever again. + #[allow(unused_mut)] + let mut $x = unsafe { + $crate::core_reexport::pin::Pin::new_unchecked(&mut $x) + }; + )* } +} diff --git a/bash-5.1/vendor/pin-utils/tests/projection.rs b/bash-5.1/vendor/pin-utils/tests/projection.rs new file mode 100644 index 0000000000000000000000000000000000000000..492c26d9a8de5b85af24ab92c99991101967324e --- /dev/null +++ b/bash-5.1/vendor/pin-utils/tests/projection.rs @@ -0,0 +1,27 @@ +use pin_utils::{unsafe_pinned, unsafe_unpinned, pin_mut}; +use std::pin::Pin; +use std::marker::Unpin; + +struct Foo { + field1: T1, + field2: T2, +} + +impl Foo { + unsafe_pinned!(field1: T1); + unsafe_unpinned!(field2: T2); +} + +impl Unpin for Foo {} // Conditional Unpin impl + +#[test] +fn projection() { + let foo = Foo { field1: 1, field2: 2 }; + pin_mut!(foo); + + let x1: Pin<&mut i32> = foo.as_mut().field1(); + assert_eq!(*x1, 1); + + let x2: &mut i32 = foo.as_mut().field2(); + assert_eq!(*x2, 2); +} diff --git a/bash-5.1/vendor/pin-utils/tests/stack_pin.rs b/bash-5.1/vendor/pin-utils/tests/stack_pin.rs new file mode 100644 index 0000000000000000000000000000000000000000..4b6758dc123827bf24c99002e8ee90bb32f41d2f --- /dev/null +++ b/bash-5.1/vendor/pin-utils/tests/stack_pin.rs @@ -0,0 +1,21 @@ +#![forbid(unsafe_code)] // pin_mut! is completely safe. + +use pin_utils::pin_mut; +use core::pin::Pin; + +#[test] +fn stack_pin() { + struct Foo {} + let foo = Foo {}; + pin_mut!(foo); + let _: Pin<&mut Foo> = foo; + + let bar = Foo {}; + let baz = Foo {}; + pin_mut!( + bar, + baz, + ); + let _: Pin<&mut Foo> = bar; + let _: Pin<&mut Foo> = baz; +} diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/.cargo-checksum.json b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..a17fa1b9e349e207820614344d16cfde493d9617 --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"9652222664ffc7e2a26fdcdebdce0917a455b39d8fbcbf451bf0b011a3067bf7","build.rs":"4344ce95f51197e1377429cd9ef7a8e3f97d39546776705857991f2f9416f545","lib/libwinapi_aclui.a":"0fbe9d7eba9a106e90db5b015ed7751761c67f239dc6514a2cfad4e530f92490","lib/libwinapi_activeds.a":"68625fcfe4d6a203982fc319b5cc11e6ad07a57ecac442d07f0240e0aac5b28c","lib/libwinapi_advapi32.a":"9ac26b513ab07aed0435d7fe264d811a3d221619d70a34e49261fe0fa78c2cb0","lib/libwinapi_advpack.a":"52b75cb9f96fbe517c52b64bdfc12c928cfc427f4448151828e3c74460334c4d","lib/libwinapi_amsi.a":"72601859db74036937fdb75b8e7f3323f88c52261f4b49f55d1796e8f18e258f","lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a":"8be3322ca57f3b37c8a5f77455fde9f901eebc1533b3aea5783312cbecf1f7e4","lib/libwinapi_apidll.a":"5e8500ef8566b8057585cc9a442feb62487f92cd3ab44831375455138a34d824","lib/libwinapi_appmgmts.a":"c1abfaadf53df46e9e8cc53aa857ffa94f2018b2ac43d9eb9af5fb6351824aa8","lib/libwinapi_appnotify.a":"2aa211c2947c93f913e0d820adc988902664d501c6c19f024bf0c9631e237f4a","lib/libwinapi_asycfilt.a":"dcfb20c70c45f5effccea72ca1cf0ec7169437b666e08d0e6d1a1c9b1246f43e","lib/libwinapi_audioeng.a":"8fd59a757df15225867ed3a9da1fd0e89bb8510da0d864dfe7ee19c6cf8f128e","lib/libwinapi_authz.a":"c5f91aa9ed03b794b760f468122e38c321a936b851ee3127934bb7e5b3480373","lib/libwinapi_avifil32.a":"abb571ed8955cc629b21049cc26a9268d2a4b026d445472b9df13079362b7ae2","lib/libwinapi_avrt.a":"d5ffc07ffb0bcd8708982137d7707941d775d50dae8f8a48a7f34019593e32cd","lib/libwinapi_basesrv.a":"97947ae129d72d598ab1048621ed66ffdf8015c3ed48a4043b399ca5c39348f7","lib/libwinapi_bcrypt.a":"e326aa515c54b84398aefbb1f89cc25aa8e015e6de5aa9657bd520b571a3dbf8","lib/libwinapi_bluetoothapis.a":"fd0c6920651b1d2cc58aba2bd5dc2fdce24008311de9c2a64d214e759d0b5daf","lib/libwinapi_bthprops.a":"210d9ae0b3f8b5d541d247ce9f5dcc9f6f76fa742c679feddac7e734c1f67428","lib/libwinapi_cabinet.a":"0a939ce654b1da5e476ba96e3133ca91005d754ace0b8731192cef71c2aba610","lib/libwinapi_certadm.a":"fde5cbb6c17d881e9910ff1f92f6c7398fce6d9ac86e9953c22517f6efa3a95d","lib/libwinapi_certpoleng.a":"f10c0228d72cdd0d90c74710438f32874e2abc790b2147c553da0f66811b7597","lib/libwinapi_cfgmgr32.a":"d03afff062eb551659da083557e12ff0a475a910216aedf0b62c66ab2b12bca3","lib/libwinapi_chakrart.a":"68f5267b9fc1c58343c60767afac09353fed9072b1ec90de6af7ae148c588064","lib/libwinapi_cldapi.a":"f9d6edbbf01a27ebee6202a33031df41c25a0dddf4f883f5424a7e6992fe31e1","lib/libwinapi_clfsw32.a":"2e06e28b09b1e33711f3f8b26201841098c3b21b2a798c5e1f06d43d57d2dfed","lib/libwinapi_clusapi.a":"c9ff19d78cdb9ee4840c9670c50876dd592f13c1270fb47bff56ca639631a3a6","lib/libwinapi_comctl32.a":"ac22f45bcfa30dc99aca01f7bbdcc74e8c5c42174fed2433d72ab9394d874965","lib/libwinapi_comdlg32.a":"8627efe7eae1299973356102941d37717014a209d057e72a7ab0d939dac7c4df","lib/libwinapi_comppkgsup.a":"0b23a6896cbb77be7b61e2803dc813fd8045e55cebd404dafb906fd0490ef349","lib/libwinapi_compstui.a":"51d0b2a1f59132521a02e10af2456b39ad717b69584fd455f53897666a3135d2","lib/libwinapi_comsvcs.a":"850811393316175ba229824303af68b79d5e5298d139ff72739611fb6b0b51e8","lib/libwinapi_coremessaging.a":"e7f09278971204cd768d87aeaf360762a577e61487efbd506edfe98c532e5a00","lib/libwinapi_credui.a":"20f8d03a576e27450836d417d68bd2efbd95a24dd48747d628ac1f961d59dcf0","lib/libwinapi_crypt32.a":"d6636245cfaebc8dc5231782b89d720665e87c41cabce1f8bec8d16b22d3f29e","lib/libwinapi_cryptdll.a":"82c5078c0c1597a78c8ceb57b56c32c950903c30feb896811abdc56fd07dfb98","lib/libwinapi_cryptnet.a":"641416ef4ca071ecebea4df802ce962d2fa66d7d4d6fd79ebb4a5bed5a272df7","lib/libwinapi_cryptui.a":"b6cda968797c29c01fb18866cf572e07dadbba84536e57971b4f3f952111d6b4","lib/libwinapi_cryptxml.a":"a0549ca925339de1147171c3ea7a0290d5b25c11c2ba81e88967aceb6edb2bb8","lib/libwinapi_cscapi.a":"ee700f192690598942164bb7b68401941209d32a4ff7d337c4975f921b12dedf","lib/libwinapi_cscdll.a":"2c3102f7b9ece5bf5e76f31450b68f2918a49b38f423cfec4008b17926c15d1b","lib/libwinapi_d2d1.a":"2c5ef4461d9a423a70754b352df2c482a87fa9095de45117da6de9947313fa0f","lib/libwinapi_d3d10.a":"f4ab0d6f2f5fbb00b0695f2caa571fd4cfefedef0875c4dc9ec5d46b9394589e","lib/libwinapi_d3d10_1.a":"bbe5b92965a987c5ed5dd860218bc51cf2e1c8fffda4314ff608283655e53d73","lib/libwinapi_d3d11.a":"90e6d40c9faaecb427cc835b6d35f9c97b03fa6343b96254877ba1e0c5fc5be0","lib/libwinapi_d3d12.a":"78576e2db7b47ed1690d825e853e3d1674bf61b860da0efd4a4e14bd6aacbc61","lib/libwinapi_d3d9.a":"213ac512f39f2ffd714160465b86d75fba2a06fe62808c2a957f2d92b54d306e","lib/libwinapi_d3dcompiler.a":"424680ef712001ce3b9af808ceabd54c3510c3cc35a7fb65505994a3ea6f8406","lib/libwinapi_d3dcsx.a":"f85eed17ab41d79f7ffef10e586359a90ad70cecbff80cdeb51015f1440df91f","lib/libwinapi_d3dcsxd.a":"6d5e5c53acfe3eb8e292188aa2f777e07c2161fd1740d1eada9d8b0c271b3453","lib/libwinapi_davclnt.a":"0a99a29e6292f55e14a7c2d403b35d5b4de7125d77dc0ccb218f9d58de0d0f94","lib/libwinapi_dbgeng.a":"77eee9c92f9ebd54fdf746df2af14b8cc744f3e8c729d68ad7fc38af85f70fc5","lib/libwinapi_dbghelp.a":"f0ae8d1d66bee0b1d13e8699da7118a0556ba6912976544fbccaeb2d7b0a2f1c","lib/libwinapi_dciman32.a":"f22380ae622f6228d0062931ba26c5a8d6f82db059a3ef935cf568bec711734c","lib/libwinapi_dcomp.a":"2fbcba609dfbbf5be4698488c4576a6b672d05c7f7ee3596b4c7b0eaa7b5aeb2","lib/libwinapi_ddraw.a":"6c48b9705f4d8bd99c72fb046289403161e1cda68e20833c9976fbb2e7c2ad85","lib/libwinapi_deviceaccess.a":"3b304c6f3a7f608ced8ca1c1d12f80451c5c3e5c38a31ad6afbe1331def5da8c","lib/libwinapi_devmgr.a":"582335b229c0c41f117ecb231f2a3f454c1e4101a748006df5e48174063309ef","lib/libwinapi_dflayout.a":"ee4d80b5babc4e5c86a5a42c2ac81db97968b2ff0c4f90ae290893f575c0ccc3","lib/libwinapi_dhcpcsvc.a":"b56ecceb638e762306f5f1f211efdd18b00a50ff68043db24129008d22757732","lib/libwinapi_dhcpcsvc6.a":"4fcdb0360d94492060e8ff6447ac457ef574111c2ad609c93044a8e122ee9a80","lib/libwinapi_dhcpsapi.a":"d3ff30b18ba039ba0dbbb5b6ec1d72b1cb3f4dae9cbab0225ea6140e2006f58f","lib/libwinapi_difxapi.a":"bf7d9dcd82e317a49838ba62fe7a2f14bf7ac0c8532f37005eed70d3ac0a40df","lib/libwinapi_dinput8.a":"34110fbc33a44cba74d4ca6d6d929ad2ae966d94910f0219413e8940da3b2729","lib/libwinapi_dmprocessxmlfiltered.a":"44c65bfa21a4f02cb9da6ca37c6f0a9b96e8b4fa38a41ca579e89514d8c1af47","lib/libwinapi_dnsapi.a":"aa56f391dc111521f4fa1ab4f30f3ee865b62c6be8a0de8a4734058829651896","lib/libwinapi_dnsperf.a":"aefb3a4844da409f0400434521411f962865504ea7da7aa8f5d438adc518f8c5","lib/libwinapi_dnsrslvr.a":"ac9bb5a3501088c341e883bc9d57280cc27634e07f23910240cf72d190344be5","lib/libwinapi_dpx.a":"e6cee99989005e4437765d62d559abf7020c28eb153811af3044ec86472c86c9","lib/libwinapi_drt.a":"2d34b2d341f315055c4995616c3e403a512f9a082107328e0d4de3f2dfef19be","lib/libwinapi_drtprov.a":"6d843ca33dbf724a9144560c9ac102f93040aa4f497871b35b2b9f04742ec17c","lib/libwinapi_drttransport.a":"359e0e38a56303c810d0c0cde22ebb79c1d4d35b4ef05666ea4cc63b7db1b6a8","lib/libwinapi_dsound.a":"ca4ef310b1a647ac8ce805440fbec9b6ff5fa2c4cb182c9f036d5b1f722917b1","lib/libwinapi_dsprop.a":"9b6388208daa1fd6b3a9cf3b824562c080a33b3700f9ab0e900ec65bb72ac84c","lib/libwinapi_dssec.a":"67ad35bc06b48ae9fbff63ebb557ae659221ca205adc87ea0794673db3b2f5f1","lib/libwinapi_dststlog.a":"2c21e4394caba6685c241269a969e691aba2002a3a0d5231b9593e35b39ae09a","lib/libwinapi_dsuiext.a":"bffa87caa660df48f451c042bd508a0ebf42164e0d21b2fc28fa257e3176e9e3","lib/libwinapi_dwmapi.a":"90bfb9cc29ab4c1727ad5ce3d2377f4de3844a33fdef9c4fc8c1884a352366e0","lib/libwinapi_dwrite.a":"25175cc1f319922defc1250458235fc928220dc8c83ca47debc8c394c530272c","lib/libwinapi_dxgi.a":"a34fbbffc722a65e3dee7bd343922410bd967ee83312a51d012197719cebe914","lib/libwinapi_dxva2.a":"7e1e4970e62fcdd79e4da6c115cf86958f8b700d10cfe866cbf6de295b066927","lib/libwinapi_eappcfg.a":"f44b33f18ab48d02c0d0b3959d4e4b74e274ee7f16a0b379ecd2630060600eda","lib/libwinapi_eappprxy.a":"ef3613d4431002f745dfef5c86bff39bc46cfdb1a2613c08dc3bcd1c92f9cae1","lib/libwinapi_easregprov.a":"167ddbd0c62e76c61c20376abc5f3bd0a2e9a10b69b9ab406d43bb33375d15b2","lib/libwinapi_efswrt.a":"40de24aca17035eab38f9635c72304599b58df37c3ff1fabf62aefc036f31a5f","lib/libwinapi_elscore.a":"8790f716c925482c8f3a90e9f102e1cbd2a98a95d2da74e6ecb40cb213f98f72","lib/libwinapi_esent.a":"84fd8fd3a6a0a230a1932dbeded85e32e353eaa35bfbca14cb45de1c80f73bf1","lib/libwinapi_evr.a":"488b674f133d784acd30eb724f364f2ab95967be96f5644084d8909f573178ba","lib/libwinapi_faultrep.a":"a95e078bb07fe9e06a891013bcbd55eaeaba2fd08c79554803cd7f83e3a294e2","lib/libwinapi_feclient.a":"ca0dae89be31ef2cc4da0256882fb7807ef6b73d87eedd44a9199b85c19e1dae","lib/libwinapi_fhsvcctl.a":"31dd77b721e1f7e45231538d587984a2315b7e2881ae74ab078107f4ec344378","lib/libwinapi_fltlib.a":"75bc50b732fbfc074dc20a6807400d007697840414402d44f7efd8b6d80c6c3a","lib/libwinapi_fontsub.a":"32428decf64e4fc27eecd8f251ccbbfb4d5141f652f879998dbbd7bb259265ef","lib/libwinapi_framedyd.a":"bb0ab50255f033944d8193fd470344c00b8f780e37fe96a56b5e801debb2241a","lib/libwinapi_framedyn.a":"8f6c42e8c79b4e19e214136706aa4f8e45f89f46eeaefce9d3f1f37637dbc451","lib/libwinapi_fwpuclnt.a":"6f06cca6905ce91d0486dcfc14c3d855c8b04082e0d3b86995a4a54a408a9bea","lib/libwinapi_fxsutility.a":"86e20adbecb1ff711df062069687e1604ce8eedd8dc3e08e63610b60aa2e50d1","lib/libwinapi_gdi32.a":"090e67291731b23a6d72d905cfd2638007158413beba4857d822a13a99f90cbf","lib/libwinapi_gdiplus.a":"d74fc74cd1d29c5cd280a7e95a5a4d445af7bd91ab22641f3ae6299a47d1e3e0","lib/libwinapi_glmf32.a":"9906033164f6ea75e0f04794b4999584713a0fb368e026888a66650b10b99460","lib/libwinapi_glu32.a":"eff06b5b5ade0f732f52a989eb530bb4c40113272297d481187e554dc4742fdd","lib/libwinapi_gpedit.a":"a5dfaa48f7e5119fdb3aeecba3f054c3cba02bcd37976438b3214a6b383b2f3b","lib/libwinapi_hbaapi.a":"866f67233b72526add51607300951699f3898f89d6819b4aa17cc6632056588e","lib/libwinapi_hid.a":"153a556c5c938350af4a2bc4df1f365292450fd8f8587c94a397e9e2dfc10f68","lib/libwinapi_hlink.a":"2b9768209993f82cc588b9c5747834bb98332e5e2c0fe36360357e74b6477438","lib/libwinapi_hrtfapo.a":"737fab6f539c737dd6e3bc954646cd0544f779571832ee210bd6d480a2fe4a61","lib/libwinapi_httpapi.a":"06bd3ad3b5c053c25068b3a7e94f5e7f3d78640de81f2aa1ff47405eb39ce0d1","lib/libwinapi_iashlpr.a":"cd2f12894d85028c6d4f10ab126ec7e5232625ca9e5e5970d0afce9062193ece","lib/libwinapi_icm32.a":"fcfa09d72832a65d156b2bb368643cf8aad7305e503cc2a78f700fbda0585aba","lib/libwinapi_icmui.a":"b27fc55b65dd7e25ee29d164c2d419917c9d9051ed8d6ab1a014bfb44223c1ec","lib/libwinapi_icuin.a":"597ed6d86344cb2edebb6fb49a289a8c57bd2b7aef461a82e59b12fe7e7ca06e","lib/libwinapi_icuuc.a":"813ec6598db79798351b2360106b874e74891c864d238cbc2223ddba2c445a4f","lib/libwinapi_imagehlp.a":"052721c9e7c20fc720f99440b022ea8078423541e62c0ea29c977caf5c442309","lib/libwinapi_imgutil.a":"6c7e2e560c7af9de94e1564940cffebc461879f0e3ff584cdf7b455cf721d529","lib/libwinapi_imm32.a":"cd915a1cd725b687422819b3c0ae2ce44b5c7888464ff0d2ff1676688adfd60b","lib/libwinapi_infocardapi.a":"4f18800709730f89f173de9326d81d06e2073aa27c7baf8311cd7f8e6d5dd667","lib/libwinapi_inkobjcore.a":"33e0db4e11e77ed4bc6114d45ca529939b3b77bab57cf87118c9c76e6bc02cf0","lib/libwinapi_inseng.a":"d195b7f2386197d31441b3c38a54984a645af9f1bdc55478ac0203b69c694573","lib/libwinapi_iphlpapi.a":"744eb5929f23063698b334b0215366127b56355245cd13b54ca3aad43538a782","lib/libwinapi_iprop.a":"0fb9770f187923cdab0a3651073ca541c1fbe73235648bd5de294b16416a84eb","lib/libwinapi_irprops.a":"23fdc1e1a97503d3ecb0e80e2ec2dd26b976a81f314d4f68f17fd7ae0baea612","lib/libwinapi_iscsidsc.a":"6eb819c654e9e5fff54eec5bb8a92b39d83e99735279ad619d21049ba021a66c","lib/libwinapi_jsrt.a":"7c763e81a81b50fa22fa4ee8ee7c0aca94a5b4cd5dd1a3ada92a0af9a92ee191","lib/libwinapi_kernel32.a":"0388f0d48e65b04acca610f1810bef501c45d73a2262214d78ef849dfc01587d","lib/libwinapi_ksproxy.a":"542c343abc37f44ed008029b6225a45a450dea4dd44914e2f3f31b2b776d42af","lib/libwinapi_ksuser.a":"66e034242fcf78b7855ee275a55fbab76f7601b20bdc6523792f5d5728685d32","lib/libwinapi_ktmw32.a":"cb3ea9233bf46cbf14b498678af82aa5b3334629babda943ae145d35c9b9a4eb","lib/libwinapi_loadperf.a":"58ad561fcfdb9cba315222570c314e2f4ca35b385a4d50495a44ce367552b1c5","lib/libwinapi_lz32.a":"c67ea712f48e6f585fdbaca006a1a5735992d341f14f368f7a0e291ea082bdce","lib/libwinapi_magnification.a":"dc6703ab97d304c5382be388b985e22b2e1b46f32b3b522b79d7efc1935f1709","lib/libwinapi_mapi32.a":"886643d423fd9dbfb68f33cead4f3b170eb1bea241d504545dcd3e8e573c6fa4","lib/libwinapi_mciole32.a":"b698d2060864952d2bf8014aa372e664cbbf198e893768cd6739f1469fa3d149","lib/libwinapi_mdmlocalmanagement.a":"9b0c642332bff843e4ab02eec8cd00d5d08c7d2d1047b203b022601ef6785760","lib/libwinapi_mdmregistration.a":"065d25244ce5c866a3489e54b8b7772d8a1e92cd95ea39e13b838ef2d6109c31","lib/libwinapi_mf.a":"136eff680a3ed1d47826286ee61a0a77ee7776b6cbf78751ae4e7683dddcf23a","lib/libwinapi_mfcore.a":"8d086314d9f2a5d8e1facd389304de147c064b428874ec1834adebc71581614a","lib/libwinapi_mfplat.a":"f4ef284f7c5acda4ad72ea27389485b386fe1f76405981695d4387323235a6e2","lib/libwinapi_mfplay.a":"5db7d76cd8a3d4689381055685b4d2d9b03ad1e346de02fa998dd0c46d630f8f","lib/libwinapi_mfreadwrite.a":"ce1ba6835835b16445a2dea51cb8957d1fb1fe3f26c2501c4aedacf40eed2d13","lib/libwinapi_mfsensorgroup.a":"641454e135aa030f835088d98b42c1b5ed9ca1d605fe9f30da94de9bd7624e7c","lib/libwinapi_mfsrcsnk.a":"edc08719f808d2d56157647e991573222112856f1e1d26f6bc91e00bfdbb302a","lib/libwinapi_mgmtapi.a":"9605a3306379c2857226758b2feb1bfb9db5bd6ddd3c959eac818b633438c1f6","lib/libwinapi_mi.a":"2a0dca38bb4338a37c77f5b8dd964a33392db42b8d2c7b91db0ed9c3443d01f0","lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a":"0a768dd0f0cdfee293589a8d63e9831a7c0f35a3e8d21a537ea6860f924769f5","lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a":"edbeed560863d20918f95425c1ad2f2036bd0c638cd391b13685049b34761e10","lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a":"b9832dd7d7405f7a10170555afa6d34bd4589eba680da1e4e9418ab3e5dffc5c","lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a":"6dfc0a2c4d89b578d665551a7f4edf4d1f518821e74081a3cbcd79e10eb60f4c","lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a":"ddb31dfe647ed2edbbc9be435aefe222aadb9742af5986928c7d439dbd2aaa43","lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a":"b778aea784de837bbc7c5909cb30935d088aa952ff6d032ec14ff935cf6fd561","lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a":"69f925fccd8af3f57b671bf3a0df5766d9152044ee1e7417b6846241464ae914","lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a":"8cc653f70efe3f0429365811f1b135eedd70b07c485c6483dbfec4d3faf25b22","lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a":"fd818a070d14bb364d6c880ea2ff48ccb60e63739eb9be6c86c5f54d2ad000f2","lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a":"dd45c010f178a8b81c8c6c778d9e59ff2952b2cfd37caca1060b4165637936d9","lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a":"cbadd8bab30baa53143b4083ab0b51a4782585eedd34687840ac5e7b409ed0bb","lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a":"a6e126bb0f223f14951a2cd6fefc3724c94936901653d2f4054bb37723725aad","lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a":"7fe5fb93c165948f5c364d856fb247f028d001990532fac5e738cf7952e6d86b","lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a":"3881a5490d4fda0b41991ed9205b536cb2520a79855599168bbe2520612a6958","lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a":"ec0a01289b7f908e2162791e2eecb2ef36b93ed51921ec70ff2ea3231551202d","lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a":"6f2e56ef3a7715a5d2916749b87004e87f483be10f847c9ebcd1bb983cb46638","lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a":"05c6265c3d0a1fdfb345cbdafeec960ead6595fe1b0d065131dd43fd8adab78e","lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a":"d02379934fb212ec84e9df5d3b0f21b7728775134509b55b595a3c91f26d03cf","lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a":"682afd441ce478b1b7792b058934ef98690e096f3d944f7b2a52bc1158c021ec","lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a":"fa8ed8f3f501b8d87437fd1689edbc3a1b3ca5f87b007e30cb998249eb03c1c7","lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a":"406eef3acd78a7d0ed3a882a72dd5e3ecccdebaf72de13a376288525c8b5b67e","lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a":"aaf79b1f6cdc1078564041ac49e438f2603aaf432b8cfc219190994c7d23b37f","lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a":"63bebd6f1cb8a22715e72ed90ee2b5ea2d3b0eb400273775de4a6bb1533eadc8","lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a":"bae933701c0c334170e98e8d495ed06de8b0d8843cba538ab63e4f66cc27a47d","lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a":"ab106bafb84360fa31fd4326d5a1aed6cbc694682ca0997f6e780d43d0422505","lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a":"810cc1400bd09c037ebcead50b625edc80025ae4325d652af14efce21c982d3f","lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a":"1732b133cb5e7f1825546daddeccfc9848575ba92837d8fe420c06015aca4bee","lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a":"d083935f4238714d013811a5c064b0fadcffe770e37c89054fbd8467b1b28c2d","lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a":"148e266b040b29ce152a4d7627fea8081b30df0386dcf1d88be4c8bd0ff477b2","lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a":"076f2e6cb81e13f8e81df3f59c8c3b7bcfb1a1e954f3ced5684e925100e73ae7","lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a":"b60822892e24eca9a137c60b9919f6fabafd797284736e1033ea468502bf20f7","lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a":"66714b765c428ba3d48a87cb388572abe76eb370a726a201fee6ffae6b58c58a","lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a":"c0e31d6801d3ab01cbf7150b3cbd9b1f0d3de949064ac1c91cb315f199c9789c","lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a":"fe494eef68d5369999f3f955e543033ee66bddb10b220bf6752a9a1152d4e7ed","lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a":"b7655e26bd63619c3c441fc8909be9f7901bf66e68ea89744ac1b6bdc1bdd888","lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a":"0c08a4eb795089082da5f02100855804486f6456fc6490045ea2be6e8f78ffb6","lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a":"f1ae60c245a584968603acafcf39291df60575ae54a6af91346f3cd55dbe60c7","lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a":"a3c4ae167b393d11c804dfe1023011bad0355ba64dd1855764249ebd09d9546c","lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a":"e9fde2a40ec9b032fc4a368e8c20310d6381cc7cb75461c7f765b3256723b48f","lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a":"90380759dce4dc4f4d79f313313883b79ad05dcf458ca6ae707a4c5135fc62b8","lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a":"aa6b6648ccd5ed03b82f95ce236f0e515b3370389791f32c768ea5b1e9cd698b","lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a":"9f8425260a2ea46de8c1ac47f3066cb9034320713d6c0256f600e5a68fc9025d","lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a":"b80d4fe131e88cd1b7aff511f9a8801a24e8979d36ddbefd6af38e90c8b0f340","lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a":"2b8e6b1e236d1446210ae3c04478333be3b05affc61f2d87f79cc746cf3061b7","lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a":"9db8557b6d16de78ddb17aeda7a9ee53f5bab317bf8d6eda670af140613cea41","lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a":"cf24d229ed67439ba165ca88690733f6749cf96e6fc3389101744b213ce329db","lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a":"4a27c7bc16d1457f4958c11d811356b2ca8031d1294b49b0403e956476f649ff","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a":"bba88f3d4b15ebcddea1d24e5960e4b672a1ba98efa1aa4eea80cea6497ddba6","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a":"887438b3d8e0442cbc7249ebd56858914393aff5a450343355c56d2c58ec83be","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a":"9f3dab5af0070cd7803478647dfc1a302613af901bdb901012def3869e59ad0b","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a":"e821d0e25650112acbd7b4eb9e386a5a332328035b830f5cec134eacb0c86865","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a":"0db1359bfd1dccb45542ffd01cf506d3566d5c2373c3cfd2072beb3c1e6458db","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a":"fbd3c250b3903d847f12d6b532f42d55845a90f98d9ae824b4f6abea63c157f2","lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a":"d174eee6bea84eef6ec5ae42bd6b22e238914d9fa5c78debc4dd0bd1f77d3419","lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a":"93055270f2a4f829c54e6da5d183488c6e34b2f908a86c1b7b4f88cb2f7e4caf","lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a":"520bbec5c993575fb8bbcab7f0e5324d1cad7b25b02ae9e9d4c2e1a37efcb0b9","lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a":"3adce79118ad0d94c87d593ffe1d27cbe119671dc27e610d1d8376b0d228176d","lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a":"84d2733438369fd440a732bb3a253a45f36489a3b91dbbce8bcf2adbc1af64f6","lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a":"a769055d3f0d668d259b201a7cf7e5eca2ddc660c356abd3f2fd0e85cb4b2f72","lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a":"5fcf5cc4bfecb5f85d3724f6ce0efc16ebef41cfc70afe7abcfbd18741d4ce50","lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a":"2de13a8f3b4c2ee0a255979e098c20b2a887b579aa14025d4b11af1462137fbc","lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a":"6b41760bf3765dd0f23cc2e3ec7e47791c9fcd22b91bab90d6a4dff5b70ce7de","lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a":"daba67d5d58df11f17ab5ba338527d9072b50a5c993d7dfac7cf9dfa00f28252","lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a":"90ca7e44d4348b1fb7f748bdd555ebd46a13a4ed9ca5c2fcff013759a99d6bb1","lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a":"99b6b7d260adbb22cfbde40c0cf4861687683fa0d466eb987c2fc45bf034dc33","lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a":"f284ac99690d0dba0c71a130ba2b76c7b3e8613c39a4bb24d3950ce86152dfcd","lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a":"5353045a09d71f476ebc7b5bfe997f771ed9ea5175aad5d71349fd0d9b1c82f4","lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a":"3c68ee1e3dc7d727cfe7a59713388e15caf6c0bc815727687ff85c9e94fe938b","lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a":"a41d662b9aa2b75d2850a4767df778c04dc2d84a6df30bf1f54bab12ee575635","lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a":"399dca0788789249e60b9dd864d71d8492bf2fb4a40e3b7c7f1ef75e90e07a37","lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a":"5ab31736b264962e259667cbbc562f3806a565997da9f6a4a856ec61b45cba35","lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a":"dc73efb3037801cb681734dfa2bde7df449234f36cb8d96d50c8f717f20b423d","lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a":"d5a4ddca6419ef157f40bcd53e586246f9ba406792c2099bdd018ff007992c68","lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a":"0f9f5987025d2a73d7bbb781bf5ee107a9a69d334ade820e762ff825d81e36a1","lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a":"6fc2f7bcd71a503b86ca4280100db839fd7323aa54a4213626d8b39d45ae98ff","lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a":"89eefb0e50e7742bc6449e92964588c149eb709bfd66e1c650177ca7e57abaac","lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a":"1e1d445734682622d17a01c68878c0e701394fb60b67ba5ac9048406a870bb86","lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a":"00bda2cb8e87172c51f64c9e561e083342cffa5e25f47a2af9cb3ce647063aea","lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a":"1be72599a305d240d3db2a5b2d14215dc6bd7523bb50f51581318c9a8142d9a0","lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a":"8cef705b7c111f4b419b1e3501fc8238ac8fb20e23e30a58ec8003a6841822aa","lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a":"d50c3141fe9565a3d6840032fda736e661e5df6104c83747666cd48e02072138","lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a":"453e9e4a96badb784e0d78c034bd6c762b54c9fd3a868337c5ee9b867003f889","lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a":"396fc7787a3f8ed7229f764d7bef572e03ed177fbf240281e9feee523808803f","lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a":"7fe7823e6d066aee13460c2a29b7b1d87ac50c3434c03d178eb251516660becb","lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a":"13d8aaa16280287bda16a94140174e0f120acdd74d5ce9060a1af6258bb4e60f","lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a":"5bf2000f1448a7d9769a456262eed663762a757ebf9f32dc239044213e9b641c","lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a":"e96433e23e06f4bb679d6597611b29f7b5ccbc5e2017d1cccb9476611f8ee7ed","lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a":"d726f97fb99d6afe1d1b571531a91acb651ba72d6c5a88692348502c9b69fe9b","lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a":"cb3bf9f785a332aaf67b35671dede4f0c5151fc01ee12ec2c24a1d065e201615","lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a":"e14e1da2967718d7af259cc05bc92690effce83c2eff95de28201c9441df3352","lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a":"c7629e320ce40ba12d269f5d0a0e7b42c1c77c247a54609842bc935dcc289481","lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a":"7e48665fe920c9274ad9ad32efebf2cdd7c494f4e02a51a94b5c3c1fee37953a","lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a":"3933565c0fa91f18e579aa50d13f3957983e785d8fc86cab1ea4e0c32004164a","lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a":"38978f8427f5ce000c303ef76be6c8c3b53bd77232f09d57c1fd09cca3b10a96","lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a":"deb71b00625e45b52c77a86b20b6ded210231cd8393f408aca36b53f87d14777","lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a":"39430cbe7717727cf39c10d6daa268b2c6d2bd4edafb321aa47804471152894c","lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a":"023c1d785eb7eb05f68b09cdd4e705f726dcfe12132ba591ecd49a978009392a","lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a":"e3231d5b7ed82b40539d6cce58770f486be5e540e1b34074fbb71dc8434ee684","lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a":"b56a474c026fd90945b5c87ec250715abc675db7efbc9de72f05e2b81f8bb8e0","lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a":"c1bd6e9c3070c8bc1ccec1a070fb0fe4845e26f2f9319ef8d5ce2f296eeef376","lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a":"d4c9658171d702015fe1f09d189773d08f92287572ff60d9c9b5880818ed6a79","lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a":"8bc675d80fcf0c76eabbaad929696820993e8033039681bdf587e42d274bef0c","lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a":"f4f83aa4ca2fa88a9e5f30ec1a249bc3345b113b250193b5516fe0d363221b12","lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a":"96bc5168f805d40107ffcfb3240fb91cb0cc8f543f8d11fc2f44ba9b68d016f2","lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a":"961ea44da0db20c1fc5fc3b55c38ff42a21bab671e8f3c28718a81ee7d0443cb","lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a":"d741c43543343760166a79eb8ef5053f5bd3722d9b0018130352e187a3246c7f","lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a":"aceef78b2dd9a72d3166068015a5f3df6697701ff7044524af691a209e466eea","lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a":"9f67b5ecd99ebf53c56456d6ec1e8a9c8985417a0dc51b8be68980a1b8a83ae6","lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a":"24ec470de618f9dfc426e450a07cb85cab05235d81077f3477f1ffe7ce0c9e5b","lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a":"4399c090ea8eaeb449e06419afc8287ed6a56e44f0971e25d4ac6b9b0b216f4d","lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a":"5a91eb1a242a21befd15584e5a4741e25d83186a42c58aa921630d2937da1bb6","lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a":"cf9810fec10165072812b8e31a3a951e73be581720ed19a562ad82cf465c056a","lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a":"780cfad93f3fc5e95ebec5181045ccb1426bc385253ce2668c483efa39c1b404","lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a":"d837d7329ed6767d0487c814916fef36335a460fe1f62fdb85b46d36747c8d6a","lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a":"3f85f22ca21b5df8e6173522085649e67ce84da16b77e9cae3d80c9f0e3ecf66","lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a":"22e024a0968fd319b5b65df792f93e15116b50575911c0f7f1502dc1d8c70bd5","lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a":"6cb298bb1a9908a2912c331e19774fc19bf80ead0f4cb63c3fc659f79035617c","lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a":"2c6898a3d5bf294ec96de606bc608827dde28e3d3a185b741915ed9045564dd5","lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a":"a39ed9b36bb3cc0552d79ef532fc7e3cedfd67e9936e8bc08192b9c0aca2a9fb","lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a":"a27242e68654421c9b4dba80b1ff3389854dcf112258cbaeb20e5476a125d752","lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a":"d136c5fe2c00a2318b5417bacd8eca2497e3d2446fb17e88af179588110f59ff","lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a":"5f15aea882f82ee5dc2d8d754a362ea04c5a4f862f03a00f7e74b0abbae984df","lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a":"db86b02c2a0aff2984244461868a6b071b98765f4ab0b51b82c9e041eecb913f","lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a":"2c5d63db76b846b908ce0b2d3baf783c140a536030d0baf7c658ae11b3fb1d1b","lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a":"34f3af57df1e30cdaf70db34222df8e00ca72865be76b7242304aebb69c75465","lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a":"8f2a38ea004085ebc2a424842ba7bc2c8ce9b15856823ce3cef74b165be9a06a","lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a":"318c666ff4a8cd75cecb55526d5b42215f7020562c8577aa01276372e4ff213d","lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a":"a1694e7a1b3d1a3fb5b22f93f4c06f400c017fed99e137521ca02e263b70c829","lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a":"a68cd2ecff6a805f1f85200d5c2cd90e5a89745f8a78e57bfadb7442723cdbf4","lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a":"add16314ad45f91498b7a7c2da6a34c6475455c0a866f7631b8ca5326153722c","lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a":"c9eb0c4a5b7350b06e37638dcb4335cf7fe77261a89ea1a90201d066f85b1d1b","lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a":"81a070d545cf9f7f9f8923c5de7368276fc061eecba8535c5437632d96f613d6","lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a":"3bf1941875d31d4d2c7095647d366883efb613c23a983695f38de69905e22a0f","lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a":"13ec744c7560f2a192b50b5bf23ed4faa59325f1048377f7a9844a47e2087dac","lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a":"b8b7db62594b714406368918089a48868ca3b1cbfbf5e8440911a13b5bf28594","lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a":"2ee6f8b431124f281650c94b544fd734c7719071b491d7b0fafaf71a9e1fdbe2","lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a":"16a711568a8a1ee771c8eac1508a27605f240dfce72e9162f620474c3b186ffb","lib/libwinapi_mincore-authz.a":"e99db6195035386f6848a397f465d23201e5f6c132901ab2e29b179467fdea7b","lib/libwinapi_mincore-bcrypt.a":"5f4d9f4146e24ac50ac50e846bf62088f99d23b5e55cb03e6a32661057822fa4","lib/libwinapi_mincore-cabinet.a":"c1b3263b233e95742a438e628644a7ab4014ff4e3b01547850d0832f4eea2674","lib/libwinapi_mincore-crypt32.a":"e84423856f2d7b5dda7dafd0843c4d1fdfa656f1b61677bd68edfcfa3fa84658","lib/libwinapi_mincore-cryptbase.a":"3566bd4fa7a9b4f441a6ba4af984ac0567e024d01efce922b503176f0a56ea97","lib/libwinapi_mincore-cryptnet.a":"92a5d8dfb436ab9792312d397e98d91f9b95771af48cf925fd3d867ca73d2823","lib/libwinapi_mincore-dfscli.a":"da814011c527a253e71a397b76595ac7a387c86c1bdfeed8e01209a260dd4fdd","lib/libwinapi_mincore-dnsapi.a":"14a2b0ceee12116cda15871aa7e0292c35452d7e6406a51e1708b4c8484ca5df","lib/libwinapi_mincore-dsparse.a":"11cc209fd1b87a1b2a68c7124e1d89da2a4221b591cbf6ce67e338b1183baab4","lib/libwinapi_mincore-dsrole.a":"61fcffb3afee81be3f3615d9ec09e875d5a5529c2f63c182a59b6c6fcc529158","lib/libwinapi_mincore-iphlpapi.a":"835004f7cb51eca876d2f85bbe6ad43260da907e10b03e019c188ee951de1fbb","lib/libwinapi_mincore-logoncli.a":"e5dc889da62fc4baad78290998d9bd22b843e7cf119fd7845c7b9e9fe1a77e65","lib/libwinapi_mincore-mpr.a":"dd07ae245db6f88c8d29f1397b0df0e9c44b2422be551e16dcb01c5a895636bb","lib/libwinapi_mincore-mswsock.a":"f48d2a370a9d62d46cf272a08629c3713eff8b9ecd2c16052e1cb5961f10a0cf","lib/libwinapi_mincore-ncrypt.a":"9c37a0e796b74654ee8ff25ae005ffa314a845255c74ff9e2c491fcfb8ef321d","lib/libwinapi_mincore-netutils.a":"68ad06d0fb08607b070f053286fecfff083ebbb456d631b209c62db4ad117134","lib/libwinapi_mincore-oleaut32.a":"fcec9caba52ef935cc1d0aa3f5e05aa56851446f2e6a864a7c152d4ec1afd978","lib/libwinapi_mincore-rpcrt4.a":"c1e4586166db2f2a082ef1c0018c6739c58bd343962048aaf4dce07ccc47ddd8","lib/libwinapi_mincore-samcli.a":"f5063f8c04cccf85db4782020c4cb4642e66850a259f7d63ac1c3d08909a827c","lib/libwinapi_mincore-schedcli.a":"2e84730fb110f1a0c83756145ac627b80450f847a64eca8652e5ca3044c5d5b0","lib/libwinapi_mincore-srvcli.a":"a79012855d575dcc1330d2619778b26e1956dc3e7bc0f4b3684e178a7be3088a","lib/libwinapi_mincore-sspicli.a":"5541c31892701510763c94b9eec15348a3886c7f6704f7c761ed759c2782a539","lib/libwinapi_mincore-userenv.a":"f3ca99855c0220cba5a1ff522d059f88ce269ea9d3726badafd73b40e3d44883","lib/libwinapi_mincore-websocket.a":"f5ee7e537a4f7d7c1bdafb5287aa437d5411010b41fb8a8eb6205b4aacca6458","lib/libwinapi_mincore-winhttp.a":"04a5911f093e885a5f14e0907d5ab3edbcaf43b4b060d45216ea435e52b23fed","lib/libwinapi_mincore-wkscli.a":"cbaf2dbc36dc6d77889dae85012523d40aa755f1489c4687eb7054ca6b6f8048","lib/libwinapi_mincore-wldap32.a":"fa72998300a3430697b64b3cbe4bade361ac705d5dc429572e1259e66c703eba","lib/libwinapi_mincore-ws2_32.a":"9e3911f8a7bff472e039fd91fe9acdc181aed3bde9a902ecb739e56ad48c699e","lib/libwinapi_mincore.a":"6825a9caee041465fd378b5107dafca1ac6cec81e60f0de331912985da0edbb3","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a":"753630af44454ec3c92ebfb3c29d85a9590118608a111bac7657f0f06e36ed80","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a":"f40742474b39a3aa908e3c15dab78de4f73fde4b4ed9ff9cc8f38a4a3e6bb776","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a":"521d37a4d77b558db157129ec34f1a9cec364f82021f7f2c9a4c42ff6d9ea8b5","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a":"21afab5e6b411cf9f1b8839c352314229aa89af03a16cfe9d1428ba0a8941ade","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a":"c66675b5475c93e63dcbd4e3001a0e7ceb41eeeba74e3619935ba27c7511d59e","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a":"ebc30c785e96e1b2b802ca1e997fd1ec6966adfc150ef5b97c761f8aa49b7359","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a":"a5c180c4f39d4922449fc20bc72f1cf8bd30d768a56c00b12b19050ab52ce99a","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a":"f3aa55bc305ed82258dc9d21fee4395f85a3aed1de0db1931817c3e75fc70f81","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a":"2f0fceb87948246ec375e2496fea888e2c99bddc0b953a06c953666ed3082688","lib/libwinapi_mincore_downlevel.a":"3d70f323b3fca7aef18d833b72ca3fbe60d376af109a1b4a919e6bcec22d860c","lib/libwinapi_mmdevapi.a":"2d79710fe620fd4f3ed41becab17a6c4923fcd1c0929700fed0d18d6d3514e02","lib/libwinapi_mpr.a":"680c8e016f20cb6e22a2849368e55643551f0206235b668d3893fa42d2144090","lib/libwinapi_mprapi.a":"3bae5791f784d3bf157d27c021c8e594964d4651ccef317822d4b2a17b9a04ee","lib/libwinapi_mprsnap.a":"5aac04f6244a965e8c3fffdf28de78a09fd9313c69b9e127528f174eacf057ba","lib/libwinapi_mqrt.a":"ca0c39e4301366ebede9384432054b7bc69cbbb0714af59c94ccab4ded35ca00","lib/libwinapi_mrmsupport.a":"4c877ee85c1c91721983488eb58ed617f672aa007e5ca631075889c845d95e8f","lib/libwinapi_msacm32.a":"93d5738ee1d7ea8239408436b074c43d5fbfd8f459543cb730d3c79d21ef59a2","lib/libwinapi_msajapi.a":"645e84f8175f03112007c3af7b06cfe11962d8b8dda6267ee9de8239a9543019","lib/libwinapi_mscms.a":"47fe5dd1a3a5d7c3c262701341a8228c3bae0a5e7aa132a58d4e583032997054","lib/libwinapi_msctfmonitor.a":"9fd55476a28cd5fb3329d79a0c4876222187944093fbdeece837f0123dead523","lib/libwinapi_msdelta.a":"037e08c128576a4801ebe10d5399b5932698e4c50e0885e9b6555b3f97d04afe","lib/libwinapi_msdmo.a":"bfcdeaeb2ebcfacf5d77c7985b4e647601bb018c737f8778c37562dae755bd96","lib/libwinapi_msdrm.a":"66f327106d29dadebfe6263fa5f734a3c3036d989e68cf739521a5ff66bb06b1","lib/libwinapi_msi.a":"98e5ea9ec823ed5e1b44f8732d5a897ab6e5d7de1d87411d2d4a8ae6ee4db5fc","lib/libwinapi_msimg32.a":"2f2d8c1fe1cd2fcc9e0689210e8a992423e32ea50ca030f92dab5f38e28377df","lib/libwinapi_mspatcha.a":"bf373ec37fe1f869b803cae997cb9d1304e9d2014b2f36677937f4adb5728bec","lib/libwinapi_mspatchc.a":"2fef8c9ec3f4185c20d4b8c20bdf97e97c5a890b874f2e2afd927e374079e3eb","lib/libwinapi_msports.a":"bf82dbc15ac2c02eb19e32b9dd6fa7ff840e85bff591ef63c69b3f4cf1fc1aa3","lib/libwinapi_msrating.a":"45df5b0e0f916e71d591195d6e896f21075d3ee2d455bb2b6400c0c050c44453","lib/libwinapi_mstask.a":"e5722cf20ff19d01ecbad869a1f609934e17b9ae350d424c5e3c5e73d5bd779e","lib/libwinapi_msv1_0.a":"62f3792e17ee38d086f544f0e750c5a1f537b128281c1ac4f5e687e636977e59","lib/libwinapi_msvfw32.a":"742e7b83ca4abbdfe708e1f5a5028bb033b3bf7c8004f8b7b9ee5dd0827ffa3e","lib/libwinapi_mswsock.a":"fdf2482eb3b9876986d8fb8b76d98da74f2abe2e65b1ddbdb9e76a3a2ba9faf6","lib/libwinapi_mtx.a":"97ce797761704ecdb75986c0cdfec06cd942af626da3d98ca614fe90cf1b1783","lib/libwinapi_mtxdm.a":"80f87abded3d644a60c25ccb693189f785e0eba3d831d97481ac7b91970da6b3","lib/libwinapi_ncrypt.a":"64b382c756d3047a29c5cb9af53003ea639c2f216298b2a7fa867eda4147c932","lib/libwinapi_nddeapi.a":"3c316dd45fe6bb0d26a6bc18d0859654bc8ecf7a2115d0623fca8dfb3f892bf3","lib/libwinapi_ndfapi.a":"618fe36ac1a948165c197df523696e4fdfb7cbb40da53c68eb349daafb947124","lib/libwinapi_netapi32.a":"bad05df64806485c12fe425b62cd56dca9757195db23383a28f2e80a3033f0eb","lib/libwinapi_netsh.a":"93011663fee375bd21bf79955495acea760ce0982da464983ce741afc94563ba","lib/libwinapi_newdev.a":"4b4c90a7ac3abb42db40b26a4c02b4eb58ae62ff3cd58af1cc15d4349a95bdbb","lib/libwinapi_ninput.a":"ab64698e33cb680fbb68d70de33615932dc10c16d436c8097dda7ad0cd662da7","lib/libwinapi_normaliz.a":"d6feb9a233918d62f9454a71a1b7984182bd243491be1729d4f75c9e4148ad7d","lib/libwinapi_ntdll.a":"1592142cd1e0bb1d7a67e4dd5aa6d08317db172674abe24e00b4562d272fdb35","lib/libwinapi_ntdsa.a":"eac08fe7f827b4a46b19957629228c4d070e8f38592c07cd6a17d6a60ec0cf3e","lib/libwinapi_ntdsapi.a":"f304dddd7a4b9cd1c3d43f1fae4931e7512bf31f752f7e44539721b75b9ccc14","lib/libwinapi_ntdsatq.a":"9771992eaae766af41ec3f7ce6dc573542126db45bb9221f6f788ec08efaced6","lib/libwinapi_ntdsetup.a":"1f81ab7713b55bdf9ef1ad78a97cd73b2d66b4dd633282f7dfe0329d6f35ff54","lib/libwinapi_ntfrsapi.a":"2dc8b0078f2c7351acebe9b9c86c55f125a9472855c4209b07cddf71e60ba077","lib/libwinapi_ntlanman.a":"ef144c29c940a04bb2dab839b5f00cc319273e6e2f611aee2acca8e8a16c0af1","lib/libwinapi_ntmarta.a":"5e5174c266e8189fb3799666aee9a1bc1c455f36dc38b26c326fcae61c3140c2","lib/libwinapi_ntquery.a":"bfab792990bde5de31c62b4f13cbc641cac611cc9ae5245c3adb166207ec52db","lib/libwinapi_ntvdm.a":"bd6d965ab94264566b978b6e1b814ad077a4ae79cb4c0c48c4b2f4e7cfcb7d4c","lib/libwinapi_odbc32.a":"70ade3b90849ecfb16285ce0dd664d0994fe17df23438d17da4214b34e8c2013","lib/libwinapi_odbcbcp.a":"a4286035e5d4bbef4dd81f7625bf7f8dc08e18893204091d9b4ca57ee45debb2","lib/libwinapi_oemlicense.a":"0b7a4c869927a60159e6fb52e0a770edcc762d78a8527d7c13d97b315caab8e3","lib/libwinapi_ole32.a":"7b6f2c7046748c82132ef02c85e66f32d98c05f50aeae8343dd9b85cc387dcbe","lib/libwinapi_oleacc.a":"d2fa43b88db071e48699116521e257246abcfc821f5996707d60214b9df9f75a","lib/libwinapi_oleaut32.a":"5f382f9501450e65108816190e1edf8661de0b83e76476732710f6bbd080c391","lib/libwinapi_olecli32.a":"9e69e6423b631c566735c8b696d3b65d0aa81411b8fbd08c079c9b539f591cc4","lib/libwinapi_oledlg.a":"eb5b1dc4a96444011e21ab25e1ecc8346e46255ab012b8f50d340fbe1f4947d6","lib/libwinapi_olepro32.a":"c2bb05450b0d75ddb2cfd724fc2353ad052e1e6398af67ff47090d6d63ae1cb8","lib/libwinapi_olesvr32.a":"8118417ac2b6266fb92873af089a55a9a8b52b64ac61ce5a156d4bb6064a3bb5","lib/libwinapi_ondemandconnroutehelper.a":"d5f4267a2f92a18b0a9c9a62c399466dd2b5e5c6c8383d41961992f23fd89888","lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a":"7ce33ab13f8df12229ca991e33fed617cd4f9aaa9d190af14f975ae07c44062b","lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a":"9ae8b55b700c97e5c327e6b39cbcfaa66648876dbefe21b7eb5e2b159a9f18b9","lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a":"f3e4312912dc7cbb61414318a4c2966a7b0c80551be23679e0f58548864d7955","lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a":"e314b1f3fab2a56d2d6112400cd932bb7cd3e95a09be144bc665e0be5480dc43","lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a":"6aa14e1c117d293d295ee1568a3e6a81d21f15a0f155646c10c5cfa2224ae645","lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a":"a949240ab052c52430aa5349a284bbab08e790a8aad25f37cf9467537616583d","lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a":"98bd85008746e5c33aa8de5a40171fa578e33950c6c4645a965833f4c1cdd062","lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a":"b61e46a85881068c3bb64ebe00623482dc1bc96476130f9ae2b4248fdf8d1fd6","lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a":"fff26f99c7f76b1e074671efc4ceba790e555fec74a8f34c725736060c200082","lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a":"b82d11e22cb47b53cae43f7f0ddeddebcce8e7436e6353dd955ffa1b36feafe8","lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a":"9c2c3c24387d5a46885802bb080c0baa05bec2ab1b41e0f3ed003136023ab534","lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a":"97dedb121055645fd946238998374d81a8dfab4d8495a2e3e6581aa4827e88b0","lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a":"370c50c9d69d0dea47756ee9129c0358a5a0730cfd9cf16cb3bf38a293d270e2","lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a":"9164e60e37d8bc70987abce632fb608c4e804581070a244abb1e8e2c477bca91","lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a":"2032dde8a93b2fff4427eb79d561dd67ed550cafb00f066f823e4f686ebc87da","lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a":"c825d6d04a0e302786c8ed95b9a2c2da747d3eb13f90afc96b671a356d982f09","lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a":"76c7ef02046d20f400874ccbb68eb9e1653fdbf1b095cb42f95d665eabce099c","lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a":"ea26792152225541f2649c57be0431ed4c444b56121a9d30e56c9913f235ba71","lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a":"3072b4a9bad48fdd1f3ada0787b455580665f677493630e152aa6fd9d48a1af9","lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a":"2abf03e85a577726e4ab1b5daa83bb6b7d0e909857d22dd14199180b809aa463","lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a":"0439a0a7bc74a01589f3c55f2d149976c51c80fa021e72379dcfd7174fad3cbd","lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a":"584da1dfd8c18c4bb67768da13ccaf85831df644f64a6fb30e5c9a3463ddb728","lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a":"b5de61d47e252cdc6c268777c9fdd3300a1ccdb62d3049e299d986d2070773e4","lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a":"c17226cb3dc4da0b2f16ed8cc538f2f666ba5341a0a506e99ad982147a6fe278","lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a":"757fcd24354081b7d79ff164e865c1427f49de3b20948ea4170c453c460c018e","lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a":"a2db8dca687000a7e1cee4382428fb8e325a9d76edd9bdef1e0d231dce42b48a","lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a":"5d6e77c87c0429e8a22b69045b1c11be1818a1b656734bc5f84d3da355b0effe","lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a":"6b9373447d69641afa916ce0f5ddec0f29c56e20d78f8873a65d61a70b1de500","lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a":"66ca30c41fde5c4a99abfe5cc2146636e5b719d557af9abd77a90f8dc9b00032","lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a":"eb51ac48674d0f9d338cd12156a216fcc3904c9efd058c3d2a579609f3c04987","lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a":"fecea4e014a4034a23084021f068a6918ccb99f4ad495fcf93f16ab7d6c1a04a","lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a":"d126b04f4561358fe1040eeec70186530de9e6667d9eb39b8a6a87e2488c354b","lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a":"1ae79be5539951386656160661d39f0b4eef82464336a91443a7cbec41f7f3f7","lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a":"5b1251a929535a44ddf256f4c5bbe607bb1ed66d444c6630c0e936598293e21e","lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a":"2148eba5a06d1348001981c08cc4066ba7d65f4432b8aa88f0c422b80f19b36d","lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a":"6a68a5ec48ea223c786f5bcddca1e04358f63b536217f2b014554388e392dd72","lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a":"771cfff31cb38327610579cdb123522ac32432794be9f601bc4f83bfc2aac4ff","lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a":"0c3fcfa360a3163168fa0951c3f61772ea7b50cd521539ea5424e897085b7412","lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a":"c27e89c1639e2380837b01edba5fc3cbaf4bb3078c8e7a661e008a1a7ab0cda2","lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a":"ea3d8cc0c78d730a56b0d4b9ab93fc6afbf1309f2e481bd8b590d3a128011faf","lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a":"3de9d7a4ad6acc06f2a522ca536959f50ef35eb072f71991ab7e2bacf8a012eb","lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a":"d1c4172bd2996b5ef4340bdc1ad96787ced73baac1d949d6cf35d2c2a38bf31a","lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a":"0aae856a71f3126972c06a184e4550586744d0e88eda0a4007f1e2e87da984b3","lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a":"1968042df145c916017c3a7933e0014ecbd5f93e5c9065435f5e2bfcbb907820","lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a":"feffc41ff97440175ea1e188eb31a504d1e8b6e581ca2c6155f3fb859ccab2f1","lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a":"dbadd682960ea85e36d9d785684ac1bae01ad71a175d62247caec06045eda86a","lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a":"6c0414ae95319079f2deff62274cac9e41b8c677dd59c6f8db128ac395d7d89e","lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a":"34d058aa1622e922dfbb8ebcee6f64070191fd1116c85d8ab409298e9e216a1d","lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a":"bcb0745904648e1ca6c4ab1c9dc7f4222c877bfefa3f1d064a79cd7bc83cf262","lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a":"441dfb6c4d99734a6ed891497eb938d0296f40cf42a8eda197bd50c6885e163d","lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a":"cf941cffa0d3b8a888bbed9752c9f5b0c03d553b6d199ff6258c19f1452d59b1","lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a":"b293df0ca91ae8c286b46e06ad2969d8041be6fe20d5052fc20c0d57dd46bbd5","lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a":"f29e41ba33e081765dba0ff04a961d7bc0673f9cf7e49351aa3ebc2446596cb3","lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a":"4b4460884be3397e693d3ec6eae9e98e39405eb16028c2b09f7f90886d04cf38","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a":"3ac3369f2a9603d9c71b2e560c94436b58f50d144753a13cff85e1a410fd5fba","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a":"5ca6ed6ff56a1c79a55399467bd3378a2033e438a5caae478a98c4993c3ef5fd","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a":"6a493082455ec79ee94c2ec8855dbc7009f9ee0001bd0aed5e58042d6fc75efd","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a":"88fdddb5f66280d31962782a02c4763196d6e518475ba573fb1d3f069bff30df","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a":"d4a5e8cc328af09f59246f0c9b7e3d35cf0f4343946a622f39e3f920294a37db","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a":"53e09de7b3daad97ae55823d82a3b7835926499c8c05e693b6c050c39e9e69bd","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a":"510c0da995c955e2bb644eaa9216f23aaac0112feee526a0546757be2409729e","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a":"debe275148636bfb197070e7fe2c50cdf09da53ebfb5d4ee997e925157f3bcac","lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a":"595390057644c4a29afee502797c5db21cd470aee631b79e4c45320607c46b4a","lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a":"181e309b5e204ae6f024bb0179a87202b60403eda9984be1924116cfc474f212","lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a":"4c8c0b639bbfb3601c206405408fc9eee0317c50b9a4966a2dd46c87702559e0","lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a":"361bdc6179d8dd066c66e8f5c43be9f85d5119c55cd4622c61869bd94168c80c","lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a":"0db1bc8a5f3b4bef33e5443c991d3ece14833e2b28e925777ab48c5b4b716b5b","lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a":"a954ea83bb16f191fcd6c1ffa4954437c1aa587ddc370c6d0717a05aef6b3839","lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a":"ff332e34ef131f3f0fb62304e6671a507ba984be58a75ab26f52267ac6231d97","lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a":"f51f7ca530a6edd45a0bb824064a52894a511bf9bcc1cf1e81514c1e9ede7821","lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a":"e210ce2302727ea65ce9e3d651a908ddcddf0a160567fa00c0083c0f9f90aafd","lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a":"396c2c716fe85d651568681d6bc39b75754cd62d1d252a39ae3a4cc5fa50dd0e","lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a":"4d6dd4f6456cbfd5f5ab3b77a308f23dec9a13968b7e4f6cfda037708ea379d4","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a":"6457c46d1f8d693178159c9392e0fe56a4b50e27fb39b3ccfa8881e015e4306c","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a":"c0e5ae12c989f02ce1bf2057f8979afdc2627ad108848045ce5f473b475084c5","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a":"eda30a9d8d2b844e18f8e5839ca97065ae88acb569d2e060e3260ad5476f29bc","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a":"aef9dbd4d28af47fd00d96aa20d2fefa14fba4cd56b1317b03214404dfa7df3e","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a":"c3c5482c182529e3e5c8b07b40e4bc368b8eff21fa0b83342a30eca4d1bca2c4","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a":"4df545b80104e32455474f20acff7f9da59257a5d4f3c74bf1124d4f8b5d8de9","lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a":"5db78ea3889742c53e0e3882f4857d15e7db0e8e9db41bdd637d633c42d5b17e","lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a":"849fc1d4f4d82a04d496e659d2ec52521f77e20ba93744d8277ae91ba2db1a65","lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a":"4eb71e08030eca03ea393f2688f4e43899e226165348c8b0a239184fdabbf53c","lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a":"8ce5c4d7569414b3d17a92516d6b10e2a2e9d3496d36a835ea78f999d70fc909","lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a":"54293fbd0e570b6f37da02a14b02586f4c3cf1a3ed89d85e5f0aea7f4cd15c2c","lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a":"99cab897df8772fd9e5573bf8c2c9bba8ca0c89796bb22e3ea1a7d521924a50e","lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a":"1456c0f4ab7ccb9a9c67b0bb8bc6ae2ca37900f63eafc1f35cd6faa6c3f803f5","lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a":"7fc88257b8e2569f3688b52c6f796ea3e733147a951b1c3c7214e130e6f7f8aa","lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a":"61ad59ac5e91f6c99daab8495f3d0b0b977bc4bfdfa0fe4d11057a0f909783f8","lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a":"71b0dc0c564b008e7bca39ae7b68f073fe17294846c80080c5d2787d64292af1","lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a":"4d19c8751472e2cc17a367fa1c2aa3ceeb6ec2980e126e020b110e0ef7e593e9","lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a":"b5c2cb75007b2b0f0ee1f9c9222ac9b7a96d3dbf4d2cc8934541c88c9455fae1","lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a":"4c7549d5194f12429ed5caaf9e48a34f71a25bbed1de17f346fb42eeea9622f7","lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a":"171d55c0a02aac157754b2f5dae64f31759d7f72fe34b3da3ef020bb6b772daa","lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a":"a6e0932b840ffbcf397b498a73f03b08b3c364b0bee2ccb950a3d1f6256e4fd1","lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a":"d18f7d9b576d7f132ee979199aaf01b9888a6780be17a4884c068457cb461070","lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a":"6bd979768806ef4ad76f4587e11e1fb03af221e58db6bfc4e21f3458cbdf902f","lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a":"9b6e58a775abe1934b2eee8bfb3f119f868133416f40ca64ee3b21626d26c651","lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a":"401b925ff83dc5a3a351b2bdfd2806a76901a1c8a6bb55ddcfab8428dcf20106","lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a":"2b4b44dbdf98db7949e21bd950328a2513f1be268413fc732820bb1d81394c56","lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a":"f583a535849b8f45978bbe38f3ae80cd6c53dccec5e3e2425ebddd67ba15dbff","lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a":"43e5b5bbb7dbecace68a4f4a0d4b4f39df4aff180ec328dcfc0a5b37b5f5619e","lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a":"f87bf26cff6015b4b95107506627aa85da9ae63183494bdf37724cff2dc489d3","lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a":"7a2356a7e5b902f95e9d275ee11ff71be319dda03853d62d485fa38e2e4fcf54","lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a":"287444f91238567da77e5b65005df039a26ea955e753a1b396abf0b52843954d","lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a":"7478bf6e874171709669abbb4a8d6b9176995f749a66bd0916ef791ec0518421","lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a":"d9d46d5045f1729d5cca3f4e5134038307783e3c5b6e84c840c13e04861a5c93","lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a":"1e46ac200bdf5dd373e987cbec26b4eddc382dda60bde84bfe11785aeddaea37","lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a":"ca985d1b45f7cd6daa4502a4919af7312b6caf9b721c77aaaffdc30245dff83f","lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a":"31a042b0553caa596949da48b89446b8049fd41a55b5c51c81c338f64c9d82a2","lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a":"42e4da8ce6a813cde55035c7e44b18b3d3f12250a12489a54a89dec7cffcd163","lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a":"0e4b0dbd290409ae848f63e56286490f0b2b2ac4ed76fb65c81745c52046e460","lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a":"799fe6984e2413f28889bf497c659fc993f04939570652614322ef67fd606cab","lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a":"0c13cd0f1731b933452e94e5a3010a38084946d5068ea32e3e54a9e67448e585","lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a":"a62258830da75dad67ba90a38e697666eea061730b680c6f1f35ea1929e8bb60","lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a":"38cc3759687a82153c13704b82148e297439bd72427f6bfb0c0fb79a04ded5ad","lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a":"ce35d7cdebedb07195bca23616bab8d7cb209a712ef1d306b01806229e514097","lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a":"bf1b67c53946eafbe27b895a37194fe33abb697506fb2ca8deaa38f8b354633b","lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a":"008c0f90de663907480e3433d7e500907d0ceeaa8d3e08eadf029db1c632642b","lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a":"fb8f227a8978db53b29a1506dbd460f2fac8a3a09e808234772c2196ea608ab7","lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a":"ebe918eb1ee104f12c95753cfe2862caaf1bae2a8ccb4da7f35273a5dec9f31c","lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a":"72f07cfc1e27a4166d10c1737b246d4dc722018f785c64581689860af90cb089","lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a":"f13eae10c3f7a9a0bb1023e9d3426cba9b606782bd151aded523086eeba7652b","lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a":"e059034de6817aa5ddc8c2dcbf0a0efd7453f48111f84d787c77b70e0185e834","lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a":"ee3935afebd0bad19b9013de25cdec58e1d923a5ad5763cb0715233564f0a6d0","lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a":"166374b396d5767b0d405c9d4956a35eba6c817effb4f5fed5f905b41a7217da","lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a":"c3d5f969f191e92c9cffb4e454b23d75dafa859dc88c01749e169ff50e250baa","lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a":"683862e54edec7a9ef7760889cc464ddcfc85f2d032ac3539699696722ae8b31","lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a":"0c9e4393920eb49b1d9f93374313285b4687431eac6b36c298de9b2cd63d161d","lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a":"68333d231f6b90f6abcd887cfabf61264c4676083c0bcfabff09d2552565495a","lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a":"d45becb8167e3fd123eb7352ab70adca4c6fdea53ee8d7f632f623e39dc4975a","lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a":"2cdd52a7baf3a5649174cc5a1e27e209f856c7e671c738ce643a5a31a9abf973","lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a":"f7cf60bb402b7ab962a814b4706c925d5f8f36c2e9aca12de5e75797583f4a3e","lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a":"fbd3a3877515f1be804ed8bee1e8f61a7dc722de70bc9da1414f4308d45dce5d","lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a":"2d6ffeb92f9161d9e27242422705f8db162caba86f387b75fa476c71963518ab","lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a":"788419c2f5c2dbd75676d27fbb34d5a898ce0c14c196dd79abcd355e9f3a7c5a","lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a":"a3219664f76e064b676e8657ebc24bb26f0ed84da68381e38d3b547fcd5c3be3","lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a":"fc793505ed82f5e9eb13382a895c95bbf0e189c8944af6f8110eb9205b7178c8","lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a":"086b22b1bf1e6da2497362368a0e38c5092a0753d2f442d6dfd49efe058315b3","lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a":"263492b035f0d42f54997bd840d07415dcc84bf462901a20e06d337be29c3202","lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a":"0feabb26b0cff391271fd23d6c3cede97dfdd16af797ba3dd9b7c1b1285a8366","lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a":"af55dace54c25f147137e747f444f348c7ac78b0b602f41b136e24e22d9fb47a","lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a":"257c0445150a7da2c6c690f1d5d9a00eeb47b96b68a4b0ab9baa363063632c12","lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a":"f634288c210ec13680ce347935e75a272f66787c3627d1c6fe3846d991c631ac","lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a":"cd389802670d9cc261bcb07c7272c905da572f4365e87f8e691db8cd4d477d04","lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a":"f76e77406c82761f9667a810e6338d815381990de372e41304663540ad56866d","lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a":"a82268f0b237601994c56ce203191bdbbff0fb479539c569e0f2741c196b0cfc","lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a":"8f3ac9011b2a26b62d97e2ebc8f39024c31f007e2871e61c029ca65a05471bf7","lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a":"f70ab9ef523347c2b22803443fa70ccd73d45b7308c3e88832a19d7690cead78","lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a":"e5779c9294450ab4f479406bdbe01c5ec33aa3fe8ae9b9f61876b7997829a3f0","lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a":"70aa42246b091ef8d716dc90414a588b9aa25f8c77470d8bea57e5de97e9d79b","lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a":"2d6fbe48c4083874933887f0d22efcc2e30a8395da48d959593ce0d7d1e6642f","lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a":"9e3c56f2154799a69add217cd9c77a86e6a1bde64bbf33460d4e70e3687d8b9f","lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a":"525df54260b84f1b9269c87f1144f1e5a0cd89fafd65360a62c601d6ba6ddbc2","lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a":"55e4cee223037780a42484456c77eb1e9770edc17045827e81b8e919cbb85737","lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a":"5da39d2b1e8010cdf9b43227ab568c1756d0147b3dab8cb80167f5e78ededee6","lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a":"faf697a2ae01bc6b761292fcadce0560e7c53022db2bd0ae6a0f3c875fbbe435","lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a":"44bc68cde89ed432570a3a333d3ca70f6d10598075352fb81d8417caec5b51de","lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a":"d1f598a6e5f679f1c5cbf39d7aa943cedf5a6c55292e00ae18661de492f32709","lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a":"6966b4c35904d9615bbee8696aba3f00162f9384ce72fb7295a4a7f5b3a7c036","lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a":"c2992ea72fab9b721807c5c31dc0e94569540290af864d5c5bbe7adf9a154e5e","lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a":"a922f544b8205ff46043f3143b267efbbb838c8a9f13ea088c6999ff78f67eb3","lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a":"33123c82b4e595ad6a687831cf3ba94089be31bbfd23e63aaeef3fc869297399","lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a":"91fcc265a2126384e079dfab0816ef424043138880e89aa779441444271d6ff8","lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a":"46e4dcc37b939b91dfcfe917ba6f9d9ee6e607a55ff9b6bedcccf75e3c1905a6","lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a":"2d344bb7c91132a539d488ce16a683e8146c6f4ef61c5e85c3d9501b42b6d930","lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a":"6e090e7f7a713f5678abd290b2f43db5d97a4fda54dce7b1219667424292de71","lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a":"58e6da81b7f5632de81c1e1df8cba71ff4af193b930686f06613593e44f534a6","lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a":"d631fce3bf17a13ddd797a70b9cf63a144ba179511f451ab5c0bb8339970404b","lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a":"a3a5179693fd5c8125c1709c0f7da0840e357352fd2675c285a80b4d340c6072","lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a":"b3f42576a838eee69fad89e4d98bc59e6094f7e4fcb211960176f57a355e22b5","lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a":"ad9e71140c583e5a06e73fd60079e4be8a4ce5a176de88f4c92c2a73a8044d5b","lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a":"35b30ec4b0654649148fdc900550d903ba7ca6bb2557e12c2be816c2b8c402f5","lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a":"1691aea951f9e97a5630606af45ecef1d35e0405ea1732d15bd4c169b41ee819","lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a":"edff320a89daf18d86701107d734c1b0b4a8ccd1ec46d50cbd16ba9b7a0c1173","lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a":"9ced4f3c4f2336f28fa00f3f5cb5ba1dbe847f8cd60419368975a00fbc451097","lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a":"c2657a0b8af03da164208aeb2e1d1fcf81c109ab1346a48b00f60425d89a05a1","lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a":"47b3e6bc27ddc5c087a416678ea1793a30f348b3c41d6e07db7cdc9c22831c03","lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a":"0f11e4cf0225f263288544cb9a7f0ab6f591ee1be60fc42cf9406de04854c5ca","lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a":"be96a1a7edf036cd8722f9e6726463687198706db532c800ecf7c81813b66903","lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a":"94f97eb87b5bf72bf96fd7d504bfa1fde396bb34fb52b5b14b03f8a72502b6df","lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a":"c3c2475a9324e792dcd4a813c6611d1c56c8fc15b093b55095f7be62eacf3f48","lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a":"d05aa84c6342b405a1667e69545c45da23511c7395091434cb86433123905f27","lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a":"c099b2534f8225c5f459f006cef2079fe69eefc5c5c0814ad65b6266dfce6d5b","lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a":"906dcd96ef83bc1ec4960208f28d20c11d3c4b4a9285457829ea9615d5f3ebdc","lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a":"8fc5951fb7aeffe7b26121a7b5e2843def7ef2022c177280ade4d1dc5edadf6b","lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a":"3b62535868ee933138b5f51622609f2ef6993f696854353d7a32417efd4c1357","lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a":"843241145aa98032ad2607c3ff4882773dbac60c52087c107bc94ce553ae41f4","lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a":"d825cd08215e04a66d6c2b0a2bf22a8fdd459c79df96d0900de1c9357f07670e","lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a":"991613a90774d30321847f229737037e980ee4e1cf2530591bc15dd7136bd19c","lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a":"1bde30f5f2bdee0463b0a6f218760866c7d8cbbd5caa195b592366fd5c696d39","lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a":"007f08d1eb7eced643f122ddb82440bbe76e2ab2d7bc53c72fecf3715cbfb01c","lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a":"2cbbc75286c357dbb97e043ad4cb4bcd5648db803634de04e213a482f72357f3","lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a":"3ce050b1f472132076a4fc3f20355b6ed1e21d2729acc8b18f807077227287c5","lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a":"ae00a17a300e44df9e056f31676341cc3bdf008435b3ff13f2ce1509c428fdd0","lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a":"2e93b45b7e4ca0758ba473edcc4a75b068b9651187914ef4cd34623b9c04df25","lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a":"6000fdc93f1a6a6a3be35c77764f06fe25c242e84c97459199b89ef39905a9ca","lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a":"a8386c72dab1edd4001c38a8d81711bbe3fc376064b9eec14a56af3eb743e76b","lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a":"ac9524bb45b8c7ced98b7ff5884f6949b7861be9a555938c28aaafd9e838bb44","lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a":"af68dc5e041cbeaef887e4ba3fa9aeb15155f99f90fca1860c1d5fc6cf744877","lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a":"4d155455dadec07a3b3e9927d5ebc15339b74d08cbb269ac4257832e2de17654","lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a":"5444fff280642dd147181d1831dc1864a12175d928d10a1d1c66ea765771d61b","lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a":"741a704b4e6b31b07a62bb662bd762ac23d991c7287ce5eed9e68593a533dc1c","lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a":"532d5bdbf0a544f46135549a09993232c88f25702d994dbb067cdc1883e75ec4","lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a":"a7e67d849fa4be88b88f8fedd848fe139ab771520d9cab10fa3856ee121dfc21","lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a":"cd9d6e3bce83e2c81a825337285fdae77d9d59016b8dccecc9d81e7c72e0b7c7","lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a":"7bbffec6a893991136217e7677c88670faf88cc1ff6ea299bbfcbc3a442463b5","lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a":"2d24e67d5e1d8cf53cf536565eb1d2a2c66b77bfc3d86dd7d41b25f9abaa5ee5","lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a":"dc3cfa35578e93cc3c12fa34202491ff32833567d0a890390453e5ea99587c01","lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a":"19990b2d2df2193e1a11aaaf1cbd7e14627ab764428c6a3e1425f25ce36f3145","lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a":"dc8c68d4c9609d4e10432ea73d2ae81657cf4b3a46df476bc09bb8f935ed8c9d","lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a":"f0d2373f6692424d3552dea976a0a4b4a8ac4a51a9f1cbe98dfb8d4aada03741","lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a":"6068069825c12832d9238011a47b6029c26a8e4f9327fd0822fc101628669115","lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a":"b7668ae7c15d01fe3bc580ef64af32458281c249873c048c9e874d7af428643c","lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a":"43fc980cf389793c54845afa83d4cbf1d89a8b24b3a4149e8064f8072df20d57","lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a":"9f54ad31643cfc61c7ddea1b66cb04cd60c0ee0a3c16845534d52dbe4af753e5","lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a":"1a02a3670ff8446f475bb6bd060f117a6b9ced76cb7ca859ba8b7f4a0768a11c","lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a":"8e8d97698699baa2d0a4a3c6d3b7b197145b1bfd97247080bf6ba58990567ede","lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a":"f64cb18ac2baf4b1b9bc3a6fac1cca5829ebb958b2ea1864170f113e2ce085f0","lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a":"c8f7c2be5391623d4384b2e6e0c375a4fe355ab359db707aa61ec3cca651ff7f","lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a":"1f300cfb0b58d4bddf27e03b81968076f229cbab10132746c8356d62fce4b36e","lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a":"a027bcccec10f79a351e65285830cdf50d46aaa5dd8c3af0aca6116f1ab7bad7","lib/libwinapi_onecore-authz.a":"c89f36c61fc7e48696568a3d2986c52e3071457b3a742b514900ce5f22c05e55","lib/libwinapi_onecore-bcrypt.a":"f9084f955c2614f3c478590a22a3e325e9f544138f7349d3d449d1366a0893be","lib/libwinapi_onecore-cabinet.a":"ee558f2fd9798a054ab5a1968ea301321417dd2bfca9f62527564111c54866de","lib/libwinapi_onecore-crypt32.a":"cddc073ca75649a707f804d9f1b11a2a8b3b4692309348ce6d55111577b5f4da","lib/libwinapi_onecore-cryptbase.a":"287fd63dc36f7037000e56c1da96dc6bf9836d7b484b21c6d8a0484b9bcadd4d","lib/libwinapi_onecore-cryptnet.a":"9e8ea0194d504ec9d80d9b83ee75d0596a9c183429b7913a8ac9e7fe8733aa9a","lib/libwinapi_onecore-dfscli.a":"30325d84bf52b50e784bf19b367141d85efbc278271015608335b680e3dc0580","lib/libwinapi_onecore-dnsapi.a":"e707bbf995c6648d1f89bf13f1852c2e7d8c4e355d821bc7cd0f1135d7b38a8a","lib/libwinapi_onecore-dsparse.a":"a5273bdcc29806fcc3313a4fbb6a756f1f2e5eb40a966fd8bbf3890cac674981","lib/libwinapi_onecore-dsrole.a":"28303cd4189df6a713db163e3ff2d838474d7092bfe5041a4fe92d1ff2a55da6","lib/libwinapi_onecore-fltlib.a":"44152e55ca753ba58a7e368511d38460410ce3be226ad63bd677ce2a549ebfa5","lib/libwinapi_onecore-iphlpapi.a":"4f6960e63e756adda1a5dcf96e7d6f68af9180ea6f8053dae6d442dd830a4e86","lib/libwinapi_onecore-logoncli.a":"4b52c029e23daa9a599294ebe808a9fb5a03d9eb35f3a7de3dc5611a6d1d7589","lib/libwinapi_onecore-mpr.a":"68822897ad26a22e8f260e65b9fe32bc09d8a9365ecc700b3217e911893734df","lib/libwinapi_onecore-mswsock.a":"ecb16deaa836f5b044c00764d787f6085933c618f0b28767aca5193f68795625","lib/libwinapi_onecore-ncrypt.a":"724065809a811e15848f2bde0900ea72623104ea952702864075cd4dd2af12c8","lib/libwinapi_onecore-netutils.a":"55b8269a1d66d70b7737568010a9b1ec5b8cb40cd9ddfc11ba3afa932cca74af","lib/libwinapi_onecore-ntdll.a":"9713c2aba3f363c0896ce9b41452e33b89ee086cbaf4bac5767f1cb7f3063f26","lib/libwinapi_onecore-oleaut32.a":"c1e9036ef62d38e665b262a84cbda4700347f81b7c51ef34366e41349664f234","lib/libwinapi_onecore-powrprof.a":"46d90ce9de053c665ababf56198282b837da18f6baafaa23fb31ecea0006c64c","lib/libwinapi_onecore-profapi.a":"df82267198948d81c4ca40e9ad63e5a7070fda8952136aabc51ed06645262181","lib/libwinapi_onecore-rpcrt4.a":"1e09fc72e60b15ccd9bd63a9ad1157f6fd1b493b45f74bb7438fe4e1f01808e4","lib/libwinapi_onecore-samcli.a":"4084b9afc3d3fc538bb3dc38ac4e51f237358ba468170c2cc31fd676d75ad3d4","lib/libwinapi_onecore-schedcli.a":"5153ef0da92bfb66a2fd1afe65bca65e31c7197e72731d3c6ece693f6253d571","lib/libwinapi_onecore-srvcli.a":"8697381d4fc81b6b1b7495219a8222ecff52bc3a5494dbe491bc209dd30baa65","lib/libwinapi_onecore-sspicli.a":"d85433520cdb952ef3145e6b097f9da6e5aba2c4126a1aa48b77b54325deebc3","lib/libwinapi_onecore-tokenbinding.a":"e6d97f0b962ba9447e201ee8f496c619e5e4d0bc813fbcf079c0c4180eb0c6bb","lib/libwinapi_onecore-userenv.a":"f087f66aca67f1a15ff3d151f3641be41b8986f8c4a38d2530ab2762f03263d8","lib/libwinapi_onecore-websocket.a":"87b2be52bc1c38c2e3009b47d17cbb929f6b4eeba2686de82da8754e4e869ebb","lib/libwinapi_onecore-winhttp.a":"c559378240c38cbb1d5921c1f77b07d6a94ac3683ad2b58689cd7f429b76dcf4","lib/libwinapi_onecore-wkscli.a":"550d7d3456b98551ddbd0f807873a31e4277bc9ece242011a01f7fbf44f9fcc0","lib/libwinapi_onecore-wldap32.a":"503951e442826910c99adfaffad67058c7d1f5b912a7e0ab5832a95272019ee3","lib/libwinapi_onecore-ws2_32.a":"fe9591008ba78154904c03e942f3c3e80910fa8642bc3cd786a749fccf995fff","lib/libwinapi_onecore-xmllite.a":"d2c04f0a5904f91a5d738039459c3fab2a913e06a9da77d6efd3e688d2fb948b","lib/libwinapi_onecore.a":"79f5ca419b388bf58352e9a4e988306e353a07ecd8a303ae4b75b71148dc477a","lib/libwinapi_onecore_downlevel-advapi32.a":"9a1470de3f901ff6d7346be7df21c2f6ecbb7f8c7b76725529aa7e485749da19","lib/libwinapi_onecore_downlevel-apphelp.a":"0924884d9445e27828f0e9c3e60f3a66e0270eda43122e52108b37b6234128da","lib/libwinapi_onecore_downlevel-comctl32.a":"af493e0072a3bb5ef7dc58f69b96926e0381b5f71df8f7397ae24285fa4b9f68","lib/libwinapi_onecore_downlevel-comdlg32.a":"90c4c25cf1bb25540a0c8a9c9713584e4882c25bf9a0e7e706d58383faf8e57b","lib/libwinapi_onecore_downlevel-d3d10.a":"d5d6ab17b1a35597ee630ac91fdac4f34d70be9321f099c01f193a80c05f1901","lib/libwinapi_onecore_downlevel-d3d9.a":"f5afd3767aff431bf2b96d5b716e4f0171bdd50e08e76520ded95d4b0105d8a7","lib/libwinapi_onecore_downlevel-d3dx10_47.a":"1a7c23582aef6cc6a4237a4fbe47e2bd5768bc405f33822e62d89c8b2b767ed9","lib/libwinapi_onecore_downlevel-difxapi.a":"f1042623f702d415ff8ecb33ac6dfb2467139c0f469b1cd1af349018bff2ae81","lib/libwinapi_onecore_downlevel-gdi32.a":"cfe9846de5dd823bacc40a1dcc7647a47cdc3547338b79c73c70f56b582cd60b","lib/libwinapi_onecore_downlevel-input.a":"0ee64638a356f8d225de89e88a0e5e0500c748f3cd3fc34bd74401e654eb63fd","lib/libwinapi_onecore_downlevel-kernel32.a":"f12a7e4f4d3cb78c42c2465ec74ecf2175ade86e59a7c6465765c636cca842ce","lib/libwinapi_onecore_downlevel-msi.a":"2233db7b130a7d98f178e924bdbdc495d25854bf35a9af2e46d413bb67d38da8","lib/libwinapi_onecore_downlevel-newdev.a":"3e98c28ddb2b78644d0823dfc234f28d33e6e5609268f86f5e1a918ee6ad7427","lib/libwinapi_onecore_downlevel-ole32.a":"e73a2282f0d79562ac9c676276548d7cc65099cfa59dddf6890c96640fce5afc","lib/libwinapi_onecore_downlevel-oleacc.a":"167aaea317be2a53f866cfde4ac381df3cc14349b05a5f45b8025ea6dfafc504","lib/libwinapi_onecore_downlevel-oleaut32.a":"3c09885c10a0e9f5b242716cb8c54c98d84d56ecec477376294d813e98070643","lib/libwinapi_onecore_downlevel-oledlg.a":"a5058dcf256384272424dfeaebb7dfb68a0156c51a7c4cf0a4aa5509a80c3137","lib/libwinapi_onecore_downlevel-pdh.a":"c08012da446bcc019dd4677ca81c8fe8c84a690d35910858b8d5c33bd43df784","lib/libwinapi_onecore_downlevel-psapi.a":"ce0f455594f25fb5ccd1780a42bea521c497e3979ee6e38aab5ca4c5b51e56d5","lib/libwinapi_onecore_downlevel-resutils.a":"eb85ead723be66a8bcd679153240809ce3eaca19f5e09fb50916389b2ec44bf9","lib/libwinapi_onecore_downlevel-rstrtmgr.a":"5b71806cce0ef47a12f04512af24068e0b28dbf8c73c821d33f40fc53afe8185","lib/libwinapi_onecore_downlevel-secur32.a":"b9b3c0dbf3453119cf38b030f9ac7c2c8b05c9a50064e83e647604bfc2716751","lib/libwinapi_onecore_downlevel-setupapi.a":"b4f8966901324fb3dc3542b5e3b1b9b61dcae54bfa3429e36b8dd8b9ed23b0ff","lib/libwinapi_onecore_downlevel-shell32.a":"750024575945363851dd13ef5ed07085f0d393d851b5b6182d0167da93e2d9ad","lib/libwinapi_onecore_downlevel-shlwapi.a":"bdda84057a267a2c96e92ab9902ee2c106a92ae8a2d9d6f6057c70004684e8f6","lib/libwinapi_onecore_downlevel-tdh.a":"9c0ef09e849e277b0dfc7d7cd8050e656b8f8b71226d46e332bc510f68fdf8af","lib/libwinapi_onecore_downlevel-twinapi.a":"da6071d2f9383b1918bca8f8e43e068f6110e0279bd4c2bb550aa51623740196","lib/libwinapi_onecore_downlevel-user32.a":"45162b307e5d0bd8558fc9d1546c0e74a8eaba61372ac3cd645944bbe385e62b","lib/libwinapi_onecore_downlevel-uxtheme.a":"64c40a49a0f21ecb41a1192c64ef00815b785e6ee4030575ae5b1d203666a832","lib/libwinapi_onecore_downlevel-version.a":"42dbd6b1186fd4e6da3bfde88c51199414f7c2980da46da12f9d6c760fa2686a","lib/libwinapi_onecore_downlevel-winmm.a":"2a17d8e31a4131334d59ed41e0f7a7763772be02454f12ca75254d3852ed2e21","lib/libwinapi_onecore_downlevel-winspool.a":"061b6216f3b343307d156833364f433116305f5e4d3e85de6bc146d65464702c","lib/libwinapi_onecore_downlevel-wtsapi32.a":"27cfe4b37a87e4e5c15fb61e400ec5ca949999bbcb18472864d14927c88ea6dc","lib/libwinapi_onecore_downlevel-xinput1_4.a":"c68a20b83e6c2ac77d7f98be2b4fad1601aa33d8996b613caabb02bc77e02ea1","lib/libwinapi_onecore_downlevel.a":"b970765271ccbbf0a2843dfb757f678f6b6fec0404914e861f24e289656335e8","lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a":"d3c86590ac61e5d3b0d4d429a93632c2cbcb5842d84b8449e5b0a6807ba5c475","lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a":"48415e10ec3ab60fcd7185def0b8e69cf7d4f81a3b7ae0edcf4c0eb4f9aad10a","lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a":"267bdee09d1c9ebe8785ce68b65f5ca5a8664d29d0878286ce19eb145362837e","lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a":"4e3ee6e74bd59cabee0f82fb6764378d26bfc5ae3aec39de0a02e64d83bd7e69","lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a":"679c9a2425099afe8c74612d35969364b47dcad3773055c7854be1f495f6f5a2","lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a":"3f1a775d67835415d1afdb0f4034ca71bac4b51439690ec03f1b389e1b775120","lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a":"980b79f176613805271d73fd7ad35f763763858dbca5f564d2fa814a2bf31c0b","lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a":"00c8b599b3383b705a3d4c9c49ddbbd56371b4ce2b416da26219a8611e666585","lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a":"23324345965bff97ef1234889beff115969ddc2277338b22b0264deacd81e380","lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a":"c81a1d129ead2cdd57f0a8957983e63d1f88ce29877823f16d24af2999218734","lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a":"c1cb62129b8fdfa7e8fc585af0aa3737b177d2752825d9606ddb646ba5b567e3","lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a":"125a0152d091e2e3d5a5b310332e001bcd0dd8d642144bbaf3d50904c0aa3637","lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a":"1c832fbd6f8f8c5c25164afaee442578e9fa3635bb49797d7634e75a897fd3a9","lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a":"f7b1bcdc025d31db9d43b8b6c8658ae9a66eaa9aa32454cd1547fdd917634d3a","lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a":"42cc06853f79b623e08556f05ca526610fa445d6023de2595c3ec49ac0c9fd14","lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a":"68a5a7b1d92129979588aa31c42fb97958461b928dfd2f7a045d70204311f0cb","lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a":"3b7b10e05a546839a77d7c5084a78a30bff0925c90e2a4ae6d92c478027cc4a5","lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a":"7881818a8ee239d8aac81b5b2911ebe648c44cc236dbaac2173455912a5a2b88","lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a":"f3cd722d06cf0357e7c028053f40e9153e2793b201bce822dd3581d3a046e88e","lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a":"556fb78c433cfd083c07c74ca3925176f4d8b48c9a58e03daa62d19fd935397c","lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a":"011e563fbe9356ca9917ae2dc9aafd8aea4735d166aba189fe29341f3537215f","lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a":"cfbf8d52bad634cda3fc5441a5dffb72f12fc89da4a5620f390c9c70a22a2b2b","lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a":"eb7db447807c59b3f3c4a4896d16ce15e6bc4f1eee3bd6f53d1ef5e17ea5ac54","lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a":"36f22ac58c2fb1e420284e3fde54ccb0d9ca8a3eff842aa339ecea7edc51d220","lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a":"a31ad417ae86adacb47880039736845ddb7c318dd955f5f309ccb946706a8800","lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a":"db5331242f77516456e0fde1f53b3ae98cb5c9363a8e286cbf9b66c01495259a","lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a":"34789245073349fc68aa33a8ede222c967a551aadf31b3f86d56fb3915570f81","lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a":"8fde5f5f7a1a8b7bcda0b509a222c1d0ca75d97ad1b398159b3ebfecbfc603d9","lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a":"369d289445328091c31e346e78970619e77c4af3e50edd5425bc0203215b4462","lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a":"7f9093cf4d44540d295d6adbf96ec90b8ce3298aba899aad5d682ac7f4bc2fc5","lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a":"29d814a804f4778ef6fd4d1619a555c5644e5aaf7bf37ab7ad119addd721d5f4","lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a":"2f28d21147401dd8fbba19bfa040c215e7a6c62314305f527443bdb5ddf56ca3","lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a":"981daa2b794228cc1b0f5c83c08f1d2836e03ac460558fa58a3e7742f8cd2e5a","lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a":"b6e7b745b8b588189b817363e576a019067f2e30e7d00f0f941eb66078f687af","lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a":"b128dd7fb6ada26dd227ce86a98a7a096782f96178ec278be06cd04b4042b8d8","lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a":"9bb377627f9c2443f33a43c6cc3820106075cf950a9fcc02b3daf791f1ef219e","lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a":"d50709c46fbc52669a7d9896789cf4da085aba50bb1f2139f6e23b49d8100016","lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a":"ff2c9d565b71bb16f7e5bc730cfee673a469e6ff5a1ed83f33ede97c705c4fa6","lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a":"0eab57ca33867b10954c19bb791eef9d02b60edeba765f7f277301ecd5ad8659","lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a":"ea73055041fe18e9709b1094fb0c31b11b271ffb95b3a2e15fb249777adfd568","lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a":"0ae8a2d85d00854e933f163707e7773a14d49b4ede621d87d3bc5097c6378b74","lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a":"7a47049dee70562ee2070ace79a8212ec6f863c5dbcfe21aebb4fd7c1b69d9d5","lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a":"dd4beceb423668b7f214dc32e66c60575112d7dd3d51a60517318427f23baa1e","lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a":"aa8f1713e5696b03737c2591d84d23c5f0ed5143dcd198da14c67987e3711d3a","lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a":"85f8439e5786e36b585a2e2d94c4b81f23a8bc56dffcbc62270fb37066c5ab4f","lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a":"7aa9b32763e55c5c7a43b836a515b59d650ec6c09725a3b2670518bf787f77b2","lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a":"2674c264db3753cedd4c411d7b487fada1b6efbb0be8ca2d115d6f63fc1e7a31","lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a":"8173abd5dfa36041c40923e65a16f02d9d6ca1397d6989e163239ef0b02bbe7b","lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a":"3fcb04bce35545010b408f9ff4eb0ed16a0bf10be5d144f020299f87561748be","lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a":"e39429d77525812669745c72a9574f93a431a8de9477771e1b7a1c312ef48335","lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a":"091ad5944fcc5136bc162915bdf64d58381ca8ea9a63ce839348ffc53ee330c6","lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a":"0f52705fdbfdce70ba03c5c036ac5d0c0079ef3b3b4b35d2f672e64932962575","lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a":"51a677e70953b1999902ad9aa8547a0eded32a2fab3dc307ff787d00e8d61377","lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a":"bcf91b892cbf3678c6b2706e8cb7dc6797b47fc77cd449a0ffdd922e437d3c03","lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a":"4c197c4be209f216dce71d520d21261634874b54e23bc0c24cb2892e5a011137","lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a":"4d7be6925bbb3d7c0d1916fb417613e0dab2b57e6c0f2c4be0b564fbf12c51c7","lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a":"4b1a622cda0d57fe752d78c09c333883f290625f3015f7497bcb7857063a09ff","lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a":"74f765a2a11db158c10c3348adc510f29c27c725f29e3bb1069eed17c4784a0a","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a":"bc31126b29484275b43c947596bf2e08f5fef6f2d83df78a299d2962165814f9","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a":"94d5af97c1664a9e53cc2d3b85d2d02ad28231b89ed50847a90c29d21fd815ec","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a":"75eb1e9161df1fc6e58d8183c9a63016d28c28d5adcb5872875ce51662f546b2","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a":"c353ce2dd1f7c3411d83b0683215fadd3585d88667ddec2a6a8bd381ba1c2603","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a":"21b13e0ecdc7c3a14512dbdf2846f86996cc16de0797f90e0472a97201e47fa2","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a":"42b846000ee1b172d2f1520e308f3877bf60dd8fe4eb5ec71b208dd0efa98866","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a":"dfa6f81a89f7e5e8019715b74145be5fd9ae68be722d93fb0ee93c04f3045326","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a":"383b0645ed61362b0c07a7c4cfb2509eca3351b22e2bf3684d426c7622aab6c2","lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a":"3b23a209df9ab14d089bb2b5844e05b97db3a6f7b82cacf6dec70d7686e25d3d","lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a":"fcd6d6b4641fa4fc9e098218ac5e5394f4d73cb27bb008b08cce6e7f643f2ba7","lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a":"72a96e6532a6a27bae67a5ef133f03e30fb84ebdc36f4c900ad39d3e07ca3844","lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a":"d4f534c0b116466c6899ab60a86ed81983a40db61e2e92d3a37e688cddd5ad0d","lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a":"df036740da839181843676ade50cf20603b3479aefce6e793df39707a6fdf173","lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a":"8c1da62a7dae359d4bd22d63683cf0d32f4857b3ae99f68d38738efcdecef988","lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a":"1c3870806e36a4e9c588899e28f4e5c4de8106dc329d79ef90da99c863e4152d","lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a":"3fa775366f4b011dd6361cd2cebf12f9624782b69f573dce0e50102fff96b44e","lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a":"15411409b7eb5d2a1d3eec112d987a3c6d5ab106e5241f83d58c88cffd8ece0f","lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a":"325684e8db77a522ad2afba966f4a2b49f0acea66b2aed43d9ae325cfdaabb4a","lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a":"22b7c413f185dab06cffd0be7771cc721fbf6f83fbc2cea0dae7e65337f6055a","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a":"0ce9df0fc760bf6cc1aef4bfe066a76705a83066a5bec486a8514beefaaee6c3","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a":"6fdb709c20b1d43029298b014d56ab4c06b2d395a88e7518caad576b4f88398d","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a":"243cd4c16e8dc7ec9fd644013c10b4949aad0af52dd8e3db3dafb5cb2bd8eabf","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a":"f24c7f20b0ab73a80201b20f6a1eccd48b9cba236725c059c2312fce629212e4","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a":"1934abec8171e72074d5c24208313b3ec344593fbed1161176bfd125d683e620","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a":"d980764c22793fb004b9d6ad38cba6f24df6a602375d9880ebcfbdcc7379223d","lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a":"1cb14815487346aef5a3dbbd3a2b0d30940cce6bc9971f67959c5e9be379daaf","lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a":"c5de9ae7e429fbf795a23d062c52c5727137a963abdd0dc84841b31b63a636aa","lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a":"486b3f95eeb2683798486d68d11d4eecbc6c280087e41125290ca393d80a8222","lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a":"0c17ff9e0d8a23dff2fe3050b9fbb195be65b7427c04b2212b6ccee8aaf5ee60","lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a":"4b8dc31f16b2949308ed19af7cb9aca027e7895502498e545d50ebacd99366a3","lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a":"2fef444f0abe8c0920f31cce744e644ef7eb12e499d912595a7ed14222ad85d1","lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a":"4c76d9807883478f3120cd07b6cbefbdface7395579f97e0fed6f6b3a24ecc4c","lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a":"29609814bc5f82d39f4d7bb54194422bd2157e453222d19e0a6f506d08c107d4","lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a":"2f75edf68e1c98f473116442cf5d9eb2b423b9837e5adc86f92341a9ce211680","lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a":"9315a89cd14353866fd275198f8de1d1cf4f6b65061c5cc14bfdcea77e63de43","lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a":"10c02c555b6dbdda7b9ad0d92b84246e3b1184c6cbbb2d0f7084895345c05fea","lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a":"f92d83afc6664e46a881ac5fac52d4fb6964e96eee2e30cff6322cea97c0bef7","lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a":"09464dc83a12cd3c2d0853677087466a4204f31bda5dbb281988626b5e40e199","lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a":"545f03e2c75ed3c32169a6c434613a48b62302ff7331c473fb91b17b605e6cc5","lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a":"ee3e0e9a02a6ca01167b1dc76d9fb3424189407e4a847e11627d3864159bcac1","lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a":"df1b934538dc0a4f882494a1c8abdf48b0d53a4e438178efd467e1cfc4a4d81d","lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a":"ccc89a05d8d0c99105e6d0ad1fbf2bc38f2892892ae9d15f9fff407311571246","lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a":"d4cb12d32b81cf5705686ad082f02029d92db818d7efd8b207d36541764637dc","lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a":"8fd3d7ea7a813f933a361328faca0e38c8b0b16b1d5520aa267662718b1b7c57","lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a":"2f155c81b6e30343acdc75c552555dca1f9a8926c032c6b3acee14cff972f960","lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a":"5ce093dc8df1636e4cf347f5d51b8538ac857bf2d9722d3d99511143e781fd04","lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a":"38880be551d3f1f978c331e1ca5d8cc8b55cafa1e1871ee67fb739b9c612d04a","lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a":"76ef29dad970a16e1c40549ff34b0ee0b86bd584527f2a137b21be768ff7933b","lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a":"dcfd4b505c08ffe79a5757fa94e09a77b1d4de56495422f057871ba4aefbb210","lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a":"ddd3168ed388af231eec3856534213d48bab350fa7bf4066029b0467dceebe6d","lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a":"41455407280d072f955e31fe23e35cb4fc5d21b1fede9c75414a9d18533a6bdc","lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a":"d606d6b977ec5743cffa24a78023cd1689e9a49f980f384257e1f26c45202f86","lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a":"51837092eefa3cf79f2bce33634edfd16f6c2e7afc1e126b8fb2ce544eb7e598","lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a":"e5238ceec5d73cabc0dd3eafe895c225cc486ea1a50d8a06f41b841d1a10a95c","lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a":"4d6a1d3393cd4148b33d03bfabf78e4192d0b36c757b608e207a407c7e51258d","lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a":"4c0ac153ed29cbf086eba2a213618dc1bd160bc10600651a62699e71574970e0","lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a":"48b271dffbe9fd590c75a03b07b95d296846b74865a985952571a3ed767230d6","lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a":"8e5364b76783a2a057e65bde14fefef76e45d75980f95bdf73f1ae85ce0a4c2f","lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a":"c249ee18479948017c89cdc72319f06936766f6f4b67c44ca45f345846009253","lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a":"fcd5e36aa26ff5956633691bf2fcc29597e208cbf7d990f63aab6740237e3b3b","lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a":"5870b00b573a1af4c9027bbf4d85fe8a7d399567a0b12a37003c2f4c61483117","lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a":"2781431bfaf5ce5ebefcca998dd8795cbf8fcd5146c116a7c987a1354f77103d","lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a":"202e861a1b520b3240b2a29392ab6533685a4961577278d03e4a7edeb8b2ef0f","lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a":"d7658dbb5857d59b26239394cae3febae0bb3f42d08127fff44fa4ad3ecc9f6d","lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a":"aaef3a002e3861a9fde26b62a8212343c6edf5fa40133be2a559dbb5e53c9a12","lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a":"680ab1e2bc0ac585b7ea087dde64235a96e7b4f88bf9a09be2bff9705f6842ac","lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a":"f5bbe60a885264a82aa4d77b4615326038f66911a063f45859ef11a9aaec90df","lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a":"e6f0c4062d080c0a04b203b9bdb1444a19cff033fa605b90a419dc0881c4fc13","lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a":"215a69c1cbb52b067e37292b95b86de28a0648d89388ef5a15e8c40cca10f1b7","lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a":"451780a4598e947d000ff30b7eb10e360091b563bf70e20af2c94c7eec51a9c8","lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a":"1d4394e37606fa4baea5d0f6bce1da43775524b0b045d7963926e110180cc6cc","lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a":"d05d1992c5bcd95cd2ce7501625e634992c11a7211dd38c27e73a91502be2c4a","lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a":"6ea0a007e81fa48e1fa2588944deda7385ad7c095828effb01b862c31da50a43","lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a":"d9bb5b58d9300e8c02a6308ea5f00b8c4262bff684dad472a1cc2b29ea7e077f","lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a":"a86890ba722cf2d6d004566cfcec8b4af09fd47b12816312a082b36c6bf075c2","lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a":"4352877cd0720a1603f8075146fde3f099066f58aa0ec8302281321cd3d4b98d","lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a":"5f0218f025935c7e4b65961e11eeed266492bd1f0301ce6c25ac24d002b22b62","lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a":"e725dc6a2ef1d60d775efa4d343293909aa5517750cca04164bcb61d46e5916f","lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a":"ac297b8eb54fc34eafa7b759bfed04dc18c93daa7f93e7f0f2cea3a7c475a7d6","lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a":"98c68375875558c4f411a88bad4dd37a340d6e4163fc032293d711d4db0d9284","lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a":"2a2fdc4266fe6b331347d856efbed6c31aef1095a2395958dfb138a22e7e0593","lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a":"32db6c6d93a4d037b50116bcc7910c6225d6e8d2a3608cd394284e1823f62808","lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a":"67dbe9be1cdf2767f1d3b3bec1a2c9df8f3c5eb0a975524e7556b9b0ea78a2aa","lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a":"8b1afcca9eaef220bbd5d8f0cdb6e88aa9036e90fc1ee9de96c2c1111c409bc8","lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a":"47cff5f175894c712e6d20d1c404090459d35d4dae53b3497d9242ef2f2d73e3","lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a":"f1d4efcd0ec7d87bc7c8dda10663fe8240c8d48aa07197bec6652ed525690649","lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a":"b19ac8221162a0f9566c9eb87ce2b86e87a1910fe2a7881820211f38ee3aeba7","lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a":"ad138cfa5e31068274a952129ef479bb7119d3b42b34374644dd41e49458ad27","lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a":"f21e218279a75c78afc87c40d2a2b754342da2bd0cc8af897f95f8af5a288d3b","lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a":"f00cc735cc566b693c5b742bfb2d2d354108bbcfe586c65614f014170d6dffa9","lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a":"68359a6e23bc3f7e0b28649b2043636878b3ab9b51d2ea654af5cc0dd121d3a5","lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a":"be126eccd520e8277bfc8d6a19c4c46ba1fff311c26cd06edb74f9051ad99893","lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a":"42c356e09939dda837beb51b64ba7f97166eeeda2f266cdcb6df896a04de3aaf","lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a":"ba0fea23ced4dac28a60163c4e8fd09f21e01f50b7f530b54ae011052a168bc9","lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a":"052ed9804659bd50c539cde044099ef780c243485a9115a69b8f63072db7a982","lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a":"d9e70d125b57d17914aa6bc13eb016d7ab4f91e7000a2c7080b8e87e295707c0","lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a":"bbc4afbd98ce59031aee26fa274422ad398495992645d1cfced87c9190814275","lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a":"1db4d7b4c6533b76908e02d0f10c503a462cdfab31943f0dd5977cdaebe80efe","lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a":"71083395675d6a70737a536740c738fc5a78fd994f2765e805114c7abf967145","lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a":"815bde766214e8c587755e7a64b414e8c36ef5254271d349c8ccd83f572c2554","lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a":"0a81e3a58b0eea1700b4c34aa134a6331d4676af07cb95d743629486410db5f6","lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a":"d247c358caad935a249046662bd264177bc64c42bf7ee5fff3800c3bbe5a5cb4","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a":"4efad1a7223a869ac244611db554b0aedd7d71b3eceb5b1a05ca86ac227f18d9","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a":"18a5899b0514067a826165a2dc8b7269af1215fb6ebcb73f6d66ba5ac8cc6126","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a":"89fb7e6c8a71f2bd94e8b2c8582e364cb2c16bbc7ac6ccfd09a3d4928bc8e155","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a":"3018bc64cbcad0a5e4f2971d9809fde825354fd0ae26687cc3e60360305f3eb9","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a":"31ac7ba09d20175054ff31f9af80c08ad85c0a29be39cfc1635ed2b27e81eddb","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a":"636c8cd23dc6562b21eb38c5f669b24f35e6bdbcbbaa98b307e59c4f0f0a275f","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a":"b48880147bd2d1a80250763917d241d22f5a8e3a6f6e166794981b25f844d2bc","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a":"b610a885501f6cc752b489604dcba7263369c9d5bd77b2da2cab13f53b6bbb35","lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a":"d142984bd3e767cdc58fcac0424531a2c2d9b9a144a980f915f4284201853376","lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a":"4085cab48e40967e5e1e8e97e434b71ee99f6b61d37e0de094cf75e1aaac48f9","lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a":"59db977a01e378e44b99b1948c48ac05629ade8d7a765eb9bf5b907417dda47d","lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a":"673a6cd40adcdec372e4f19137bbd7313590d2b15968beeba81f621c614b0ebb","lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a":"2005e03b1501f8132abdcefcc57f67bb035980921ce5a2fd1b3b562a09317fe5","lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a":"c2c12007510ddebfd1bd0e728b5d2c22f7f3b2f1709e3292fdbef51272ea0e62","lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a":"39c656589749fdf35c69a1766d78e72f7d8752bb0160ecfb420dcd90b88aa641","lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a":"4b88fc33d145f75980a2c41c9e388a4b7306a188864bba2d691ef8e7b3b11be5","lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a":"678c64c107c4bc675c560beafd5825486b6df2a2fc188edd8486a557ad4dfabd","lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a":"bb05f6eb1f0653bb73a95f81e4ca4372cdfc4d8d5c1fd2bac77e42bcb1bba309","lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a":"4d3e3af73a57347050bcaf7fc41e6d808764fa76e4a376285bc80eb59148d7ed","lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a":"081c8645869cb668c6ad3afee70e2c34f195385415e709e9ae7535932f4da08a","lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a":"0bb03b24f02b1c7ba97178ee8e8f3b39e6bfa55afcade1f8bd8939f3b67f55f4","lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a":"db1288414b42cdc7044406f9921a81c5fb186bc73312e468749f156f6f03c40f","lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a":"2c79559696b2f870e4908288fa5408c847beb64b8dc73beb08cdcf0b1a40f6cd","lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a":"9e94fe7e1ffb578ca39bc43b0e0101205be66e6ac43a725f07f6548ed087300b","lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a":"2a063c56d77f0addd6a16e8ea6d88e1462c023c702c991b2b86736f002ffebe0","lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a":"d4cd460dcb927feceb0dce96ae90d1642c82dc529cb3ccb4589a915b25fe1c34","lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a":"025b8bcdca89ed47485c49dde4853e5970f7ed786f69b0ab5807ec06e7bba366","lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a":"7876289ee5040a3f11148aefb7b01fa202ca79cb9069da5b8caf86737b437426","lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a":"89667e7ec7dae91e79ed5fa13d891c37a8e286bb45dd8de9a8dd448a2f736dce","lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a":"5fd19100b3260241e8878141cd5bd8f3617ed4c48d6b6452e14aaf08cdd27089","lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a":"5e1cdc4cd8cec594d30db4914b729ebe6583a6f5af036ff93a177f099ad9ee53","lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a":"38dfcc7ed83bcfe38b7e905561133b27cf594dfc1fbb96fa03b80feba76ca16c","lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a":"38af3947214e5d665c024c29f9f39414c943707cd9c86b87dc2fb18d2295b0bb","lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a":"da3d65e5bd1915f53eec24d849e20091633a6b13f5a8d1be73388b0213e3439c","lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a":"0bd2282616214fb725aeda88bd59b7091059f6f5002d52ae2e8d754d7d06ae6f","lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a":"92a3e07e323a2f1614cdb421cfd140d427ec9703f8edfd2a114677246286c705","lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a":"9f93f9d9abe2634fbbec022e66b9d8adc281cbcfac531c9431e041c5cf9a89b6","lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a":"489159c1464d80c3fb0969411fab3f43b9aa1c285099a2975b61b28bb1875b64","lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a":"297a027aba604387f23060466cd5304cced64d47052f338bc86c2af9cf687b64","lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a":"fdc97903a1bacbec67e55d45b07b23bef41f4cc03a8616c5a648bf487a70e0a4","lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a":"a46a947a4eb895937163b34da1636c7409db1b1abd7062a48a36f3c35e8eabd9","lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a":"c6aa65feeda4b5f202beadaaf82e6653dfbfe50262e3945d3d82136ab3b97f11","lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a":"81d7edf1275352ac2fdd63d5ed7f7345fd264e352c9f52757de771e668b6e7a0","lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a":"7ca93f87be1e2a1d3216727b40f54af4877408697b366d7a8775fd3f0932ba05","lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a":"5013e2276a50c14ee76197c6975d5e7e49477b9b94b7731b324528a43c8d8149","lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a":"302d3b509146b4f79224111a98537bc5312f2b7462431b78041fd20180370ba2","lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a":"de568a8e22d5641b02b1ce215f40d928a994b5a812f7ddc6073ef990d14395de","lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a":"c571b5c61c89101d79153fd5e325e529746a4f935009502eccf49be2639fbcd0","lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a":"ba367b58b92a4849b9d42358e114975fa77ae61db6566ad17b64b117767b7ac2","lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a":"588c8f8e2a29ab4f8f42592a1a4b1bae39952e5e048ba009bb455241d94b9d6e","lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a":"91e9d15d917625efb826adbe249caf52b9374b73b69a3705590f9449f7a9728c","lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a":"e99e7d5084b34115b5857a0b0da2312c3b3bb35a19124a0fa9b6fb158df7a827","lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a":"29177671bb7aa2dc730255cc4e9e5a776d33627908d6fa804f613d502288fb1a","lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a":"3ccde6785b18b4ccb9954c58fcdfcbdc9ac956510fd3b6b5f673916e822a284f","lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a":"bdd276e8ee3b5bbcd4c963a125b7aeb41f09ba78f9393b9a782e75d701202cc5","lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a":"d73d1b267be96b03a77b62a0f0109ed57ca963d263c40cf0b8392376b7019737","lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a":"7db8b25fe27e4118a11ee1ce592ebc1ec02f311f24e4ad728a52c14bd57b5388","lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a":"e78d3845b2d2a998071316cf02b84cf8768b4cec8c07f61ea6529b047c02e8bb","lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a":"b39deb635c9b75ad994434ccb40a34ffa5a009537da8f2daa24be9e5f2e5b52f","lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a":"0e053bcb2dfedf93db1f0d1cc10fa6376291c74fe42d0632e446e651d4bdbfdd","lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a":"ea06cd6eb2ef5f91ce5842db474e25d932f6ea9a2308beed0987b1d87cecbe33","lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a":"7ff8b66d0cae038647b654a51971c03cb68dd2d276367494a42e12c68329e43a","lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a":"55a1489c8a5fdc42c9c8837e9a60fb8ca846437bec53f15a622c273b5383ebfc","lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a":"90fb932b6acfb04c18ad578d21e92d650bf85a533011cd0a475d0ec82a59bc2d","lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a":"a473d99ce6bb8322d7e689b15984663c800d7c1f3e67d1b3c5ccd9d96b959c88","lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a":"0ee760ace08e164fab85f820006ce8815044fc433231d68b6e9c3d159443acf6","lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a":"b5c6e51d36999fc72d7522530cc2bbb0f217828aa95b32bc6c08392ab66e8af6","lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a":"00237c5c1db6884ce4838160ed785152cb40c41375e7b1629c681aea13adcd60","lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a":"80b7b1504cc24abe588f7ecd0790eedcb8b2c211ca663cce314c076f09a1b670","lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a":"db753a291d09fe4ec26112375fb6373b0aabed532d410b70c6ed24f23a51308c","lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a":"a781ed18c9c34337d5a4371c8a462b6113513e948421ff05c66aa6e75a769ea9","lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a":"034bc5dc8aca49021307759180266ae2356027122e448881c2802950afcbfd41","lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a":"a519ae4dc74c73a907c6eacc0a139c6d711dc197bd7ca20156d0b1b0fe3fff22","lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a":"aab7256caa9592403af60bb53576826db02ab98ee3ad159f28d7cc07b3b26ff7","lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a":"e5cdb3ca221f979bf4a95b18fb6e10f37c8b5528ea2307a3aab168f05ef7d78c","lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a":"25745fd8cccea13271fb1e5bb77ce8e586fb6373083fa85c7643ca889c826cd5","lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a":"83d9460385c14ca2b1c2d31cfba4a6f458c26b50ae6a881f69a2ada5438c0d8b","lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a":"afc589549c805deb270fba1858895303b8c85009a5ea6f8a8ee851f2ec1fc435","lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a":"b55fe6d9d8fc9ae5caaf6dcd600d9e85e2565a5fd7d2ad935ac718ad071b66a8","lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a":"cff41a245275ce4997a00cbe133530bd53a2d1e11478bb0916216e04d9f3770c","lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a":"0789a760a1eff7954397e0c0bbf6a4361d207e768ebe7462408efa2bfe230245","lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a":"912b8527edc807990ebe2e9b2d897f8999d2f46afa0f18a40a1f95bbb4da7260","lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a":"f93089f8d3b65e117a7e2da3a070c21020f17ba7fd4896007b49f835db63ec65","lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a":"09a8c1c51c429f9d1372fa8da39e5347b04936ae4b91c9b42d5b7717289575b7","lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a":"818744fc89764f3cede4ce7705477aa08f9b5fae7c268f7fda7a51632eb4ba4e","lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a":"d9eae63e869b060ca7baf0d11636cd364ffed32d82e539ca49910708ac070ace","lib/libwinapi_onecoreuap-authz.a":"b0087e02bdc1ba5a6b604507ca7a0b4adc4911898edad9313fbbbe31ab5148f8","lib/libwinapi_onecoreuap-bcrypt.a":"4dfc5046f245c441eb73374f223191a4d31fe9e298f9da0c250deddf7e63fded","lib/libwinapi_onecoreuap-cabinet.a":"997c70e81fe1ee8aae77a783f8c22d113e0942364b79e6fee59ba98e88a6e28c","lib/libwinapi_onecoreuap-chakra.a":"4da85e72edbc4ab7f5f203f4721d062fa292706cb8a8e20553e5cb3f29f311d5","lib/libwinapi_onecoreuap-coremessaging.a":"e6bf985ee95bfa007e76fe4af6e692864afe304b598e284666ea99fb3e0c2e70","lib/libwinapi_onecoreuap-crypt32.a":"8f2f9990ef20feac1f86fc2fd53d0446e3bbff05e89a5db3d5040df557e129d7","lib/libwinapi_onecoreuap-cryptbase.a":"85deea089b92e7af4eb762b2d2ec37be6b7cf7becaeffbcb55b98b7e5158a959","lib/libwinapi_onecoreuap-cryptnet.a":"898938fde8b3a27249816d93ac806bdee05000fb4d154da57b66bcd9f0ef5c49","lib/libwinapi_onecoreuap-d2d1.a":"3f5e8bd1c3efed072f2b800c597b883e911a3688e008b3f61bf65329e001e230","lib/libwinapi_onecoreuap-d3d11.a":"16286d720860c65476daf0e1a2edd456a53e794881edfc9132f8f672cb6de336","lib/libwinapi_onecoreuap-d3d12.a":"275cf82ad1dadc157f6451a6e1e005115c99503a005b4b81f3c11c7e82aedc65","lib/libwinapi_onecoreuap-d3dcompiler_47.a":"69e4e84582ceda25cb6ced4da20a35f0714a174621a04eb781eb66a296ef900a","lib/libwinapi_onecoreuap-deviceaccess.a":"7e623da399c5b7ffcb22585fab44f19e9c6883730d58eaad12da4e62e683047f","lib/libwinapi_onecoreuap-dfscli.a":"ca27fe9acf7b684586eeb5adee70e3481da216d8a50fd040fa2cb90f03d8c3bc","lib/libwinapi_onecoreuap-dhcpcsvc.a":"189dc2186e79e0d69ba477ac57997d358697b6875e39068d28bb25e7487da647","lib/libwinapi_onecoreuap-dhcpcsvc6.a":"3cf7fa8066a4705acdfddf0b8807811eda2504d37e3cda9d4844b5307d0004bb","lib/libwinapi_onecoreuap-dnsapi.a":"0b23ce68f4dc3215ecd833f8fba9c0ae9dc3b65ef52eeca247dc2733c7858545","lib/libwinapi_onecoreuap-dsparse.a":"b1f3525fcc509959f68094b613f24fffa1ca79a0421e5e0700fa743fc22382e9","lib/libwinapi_onecoreuap-dsrole.a":"56a7e387412285e2be1aa2a9abeb58dea338d2fb952ca45653ed404edef4f6e5","lib/libwinapi_onecoreuap-dwrite.a":"7d70b0cea50eedc373bb21b0aedf0d37ca2073cf165a7a20024a3d8ec4b6f040","lib/libwinapi_onecoreuap-dxgi.a":"296c5520cad1dff933e00a3cce5f0c04a9bcbac7eedca01410f3cd5270cefa12","lib/libwinapi_onecoreuap-esent.a":"ca9b7ef4d8260391d985d6faa9778880d2923d5dff5808581ca15ef851c16a80","lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a":"c21683fb91594c9e41a64bf85427e4dc2841817cf28af76db288109bb98f1607","lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a":"0d6c985cb498bbad3aa7b8e4d838ce6b2e198ce51b62c411c557fd32d7ea7822","lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a":"daeeee3af2d3fc5604db26ae3944d5da419c2fe36682835199a7d67b0e9335e3","lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a":"6db0f416b2e2b41c16c13083acf107c966f878736d669f0b6bb4e434fbe56e5c","lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a":"f1a8b3c486a9deebe4ceaf19b5e6abe2854e7583565a52d00dff0e90efb82b40","lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a":"af6153478f9ecd5351c8177172037b5b88717c8cf3af620c8ad0f36655fc0fe1","lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a":"42e77d1277a6c9d8338d228776e773baa7402126ea3414e0578ca4c2812e1f83","lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a":"b0bfe4bdf945ceafd3e2555f933c6ed2890558094573b56c641468089ee2d0f8","lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a":"02f0d2d6e6389be7367468eb30d1dc8c096b6bdfcf7150799a1ec05a88094274","lib/libwinapi_onecoreuap-fltlib.a":"b888de58402865fc62b30e12161819e454edeeb81469aceb8bb537954e64ea7c","lib/libwinapi_onecoreuap-hid.a":"e721b5f6b4a14311c2989b3061daa6ac4846ef52f20ea0aa8c1cea8d452e9af1","lib/libwinapi_onecoreuap-hrtfapo.a":"e508ba82ef44b6eb4d598e7541b54f3a1d2f7dc09792b68fe9698b41844bba38","lib/libwinapi_onecoreuap-inkobjcore.a":"1e322dd27abaf96975a65c5a192ef8ee781964a15f0ce874b3c846720d768a5c","lib/libwinapi_onecoreuap-iphlpapi.a":"af8e1d386d8c772e58656d2ca189e35be48485bdd4cca82d0f0986d7cb256544","lib/libwinapi_onecoreuap-logoncli.a":"2b9fd321ddede7d228d2827338aea5f96ae3fc029791a5667389e4be89298934","lib/libwinapi_onecoreuap-mf.a":"a7eb11455bbdc1cbce6e76ae8deba2ff2063fa522378f2a6ee7fd51af60e2ec6","lib/libwinapi_onecoreuap-mfplat.a":"0c29638fd4287f7ecd0e50e3deb7f90c6ec742606301c648426b511f811e74da","lib/libwinapi_onecoreuap-mfreadwrite.a":"a8a5a490c6f5c0c65c86d0ec5b8d5e85a9490f95cb6d394270512ebd729984eb","lib/libwinapi_onecoreuap-mfsensorgroup.a":"f520843b4b52d97669beeb7ab1b909ad28d486468eeaa322692e7e46131097f6","lib/libwinapi_onecoreuap-mmdevapi.a":"45b7bf35c10cfc14a5e583befee0ea1b941f21284c1fd1e151dcc63a8dd2c0ea","lib/libwinapi_onecoreuap-mpr.a":"97a29ac8014e56c94128d495f833128fc82ec324f4a6422c9904f7be563669ac","lib/libwinapi_onecoreuap-msajapi.a":"387e2374ef7c7811f9b2fad493715bc2b4222a61c51780736ae1ff5161cf8227","lib/libwinapi_onecoreuap-mswsock.a":"fffb40fc34f6d1c814c708a8538cae9a063609ff00d303af8282f5bde64392ed","lib/libwinapi_onecoreuap-ncrypt.a":"92784794cde4bd1740b5a05c64dcc5cef5d74f9b0de75e5896f7fb93fb71793a","lib/libwinapi_onecoreuap-netutils.a":"479cb4ec40e4cfdd8922d2faeecac43574878a6aac4b79a40dab9ca4e06e8136","lib/libwinapi_onecoreuap-ntdll.a":"1d595844847f342d4aea12a72244b6a026c59cc1bcc53a22f897851ba3d7d78e","lib/libwinapi_onecoreuap-oleaut32.a":"b7cd9486d641252ff347d2789b5056eaf5e6aca133abf55f038d03bbe30b5cdd","lib/libwinapi_onecoreuap-powrprof.a":"ecbba8769819c8e4b875e811e6b16431ae72823eb1ecdc44ef6c0edd20ba251d","lib/libwinapi_onecoreuap-profapi.a":"6ca6834e6f360fba79663814de78f063cc66c91097a5022d38487d9ebeb17418","lib/libwinapi_onecoreuap-propsys.a":"06693d40f11365d3c5d02820a12438a28bb6bc303ba963de8e3db794db8b6d0a","lib/libwinapi_onecoreuap-rometadata.a":"5ce482d52f176128e7e21e21496e3a792b9aab7257d86833052f2a4d438d1881","lib/libwinapi_onecoreuap-rpcrt4.a":"a2201586d6b38834a9b5d6365f1370c223464dd00f02b4cd64f35cd6a818fdd7","lib/libwinapi_onecoreuap-samcli.a":"42de91bef47de2bacc6bbc87d8eb08539755679946a0e90b0063d85fd3271427","lib/libwinapi_onecoreuap-schedcli.a":"9b02171c8ff00202939861898e19d8b2179253174c2b13d5aa1cf7bf442136b1","lib/libwinapi_onecoreuap-srvcli.a":"5f4200132e924a3eacf5062efce801cfb013936cc2367dab171259a690aae9f8","lib/libwinapi_onecoreuap-sspicli.a":"0cb8421e125bf93af55e64d181013a57f319d6a2e789eaa01cd9bf77272ba0f1","lib/libwinapi_onecoreuap-tokenbinding.a":"4cd364aebc64795031bf77ace65846ff78b9a9b276ff98ee470ee446d2e4cc08","lib/libwinapi_onecoreuap-uiautomationcore.a":"2a3d7e26b81d7c5c16a430080a5b770ac4f29644f7fb881e073c3b5d26764105","lib/libwinapi_onecoreuap-urlmon.a":"174501cb43a18a7f888b1199f59e65417d63c77a548d0dda237ecffd5c324d17","lib/libwinapi_onecoreuap-userenv.a":"53949d2d08e0281903b926ece14d552864384875c0c2910f4b78013c59d30d78","lib/libwinapi_onecoreuap-webservices.a":"d4c2dafbd1940dd63a0650defdfe1295a52ee6578faacdfd5291f89770417e6b","lib/libwinapi_onecoreuap-websocket.a":"ef3391e989003ca6f0b2f5564cf50c96f7b7137d6a4a2f35646beba83368f474","lib/libwinapi_onecoreuap-windows.data.pdf.a":"1dd8dfa235ad8ac7dfc5bb180677a684de59f5db8ed5bc1f971504cdc2c296fd","lib/libwinapi_onecoreuap-windows.networking.a":"0efeb95876b2cdbca86d0ca4bd9f9779356a99b8ce6b79c082eb081d0ea6cb10","lib/libwinapi_onecoreuap-windowscodecs.a":"27283a7ecf13a918f0eb64dc8661098b8f4c99dd19418f23813c1f051ec16bd8","lib/libwinapi_onecoreuap-winhttp.a":"cee254504e5d88ac2fdac8a27aff6cdab52007e25ba9a88288d9e1e10b06badf","lib/libwinapi_onecoreuap-wintrust.a":"c310ffc6b7dbd2f2d94ba4f2b9be475a93e4ae2ee58fa4d0a3d01de3c12d12ef","lib/libwinapi_onecoreuap-wkscli.a":"e8831fd954aa9673eb5183d09160fd55aeee64d57ce99d93d33558d67973f371","lib/libwinapi_onecoreuap-wlanapi.a":"943692ec7c733dd0bd784f7fbc11d62d5e2f6d7372cea44d16054e92b78e650a","lib/libwinapi_onecoreuap-wldap32.a":"e589d481a5145ea87bb59092696c1208334333174e1b5e263ceaa0e4467a0cd3","lib/libwinapi_onecoreuap-wpprecorderum.a":"e79472031220317c981ee91825bab52852a0abd28cda89384cba1eb35b5c2cc6","lib/libwinapi_onecoreuap-ws2_32.a":"01d39c4c553d30d52266a44e0f6cd51aa13a4455d2ebd5ffd8aac506a572124b","lib/libwinapi_onecoreuap-xaudio2_9.a":"c26f6eb5ffcb6a9d0f6fcb1a0094940bc158bc983e18b2c4a68c78fb11921f2c","lib/libwinapi_onecoreuap-xmllite.a":"87e3282045b56f24691c48f3f317dfa1e75ccf2590cc3e64d6da0f93b9a9a961","lib/libwinapi_onecoreuap.a":"f2e1e86ce76b7aa86b93da35edf53d1811e8d52a10fe14de3c561d863834b116","lib/libwinapi_onecoreuap_downlevel-advapi32.a":"25951e37054b4a39380286855db8e8adc0faf7eaf77047129d9368fa195143d6","lib/libwinapi_onecoreuap_downlevel-apphelp.a":"08116313490555530b7b58cc3f830f95e0d8ae65dd645086be4dd379e97ca945","lib/libwinapi_onecoreuap_downlevel-comctl32.a":"86c35f513051d4f485822b57b0ff902738b818b6c6bdc1224c75db56d0a34225","lib/libwinapi_onecoreuap_downlevel-comdlg32.a":"b748579f6f3ab5976261d45247af5a3fa9295ac420d54c092cfbc97f7a207bd8","lib/libwinapi_onecoreuap_downlevel-d3d10.a":"bac5b376a858f0f2a4b95b21c44f251b114a767e58c09b8cf572fa66f93f31a3","lib/libwinapi_onecoreuap_downlevel-d3d9.a":"3824e7e31b12918efee786e170d200a1b920e19dae6a5d9e39c646cd8d3eb2c2","lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a":"81e84968bdcce883ede84bad6d495bebc3303adb1ca7d70fed9e3d74c191413a","lib/libwinapi_onecoreuap_downlevel-difxapi.a":"1bfcf44f7098ba291c6899ea4bddb95ba2f7b0b93c4ad285bc83c7bef51e0243","lib/libwinapi_onecoreuap_downlevel-gdi32.a":"62fe9be7e7ccd0e47f415567240aa3fef909a6875145987c1ab4fc331a1e0106","lib/libwinapi_onecoreuap_downlevel-input.a":"fc7400b5de73bdb9f6bf313ef474b93364cddcdfeefae79d5eec744ccf6c20f6","lib/libwinapi_onecoreuap_downlevel-kernel32.a":"56bf726b936fd50ea3050f49eb1bbd156329b492b1dc9c843b1ffdda80a9057b","lib/libwinapi_onecoreuap_downlevel-msi.a":"d15452e3e099c2a5991c0b91760f4aac5eac944fe69f286bc3c63024826263f9","lib/libwinapi_onecoreuap_downlevel-newdev.a":"4210387641e4c1bc745ff9db429c1c572c81f8014cd4379bc00d8a1c6496bb10","lib/libwinapi_onecoreuap_downlevel-ole32.a":"e67f5790d85b1ee77263149e62a0f5b661b386c1da7f240058a4518354aa9edf","lib/libwinapi_onecoreuap_downlevel-oleacc.a":"ff9536113d3213fde19cbc9d0084fe031949d9705ed28a5338c5001f0401037c","lib/libwinapi_onecoreuap_downlevel-oleaut32.a":"2706f1dee8865df8adae8719b067b89ecbc974b5778c459c109cbc08162319bd","lib/libwinapi_onecoreuap_downlevel-oledlg.a":"eecb3aab1378d1c45d7e9aa7729e43c1b5717791770de9192230347cca902eb0","lib/libwinapi_onecoreuap_downlevel-pdh.a":"73820b4cc0348960c714080473696ceb67d89f0f570258ce93d52441e029b7a2","lib/libwinapi_onecoreuap_downlevel-psapi.a":"570746d0a825bdeaa71a7dfea67bb32657a27f5afe1624944750d209329c14c0","lib/libwinapi_onecoreuap_downlevel-resutils.a":"397de845de00297801c927c5d82d0b91bbcb2a0cda70066c817fbc5236123db9","lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a":"827d5635d748a418dc1731ba057aa468725e907bfc9e60d6724adb1ce9bbd2c8","lib/libwinapi_onecoreuap_downlevel-secur32.a":"9a70ba1ced874cda827fe98af149b3d451adfb360c88c31862ed306a998f5f76","lib/libwinapi_onecoreuap_downlevel-setupapi.a":"0c82ad883260fef3f91ec1d7c2c5cb4677d26d091487fec4936f9f988462e720","lib/libwinapi_onecoreuap_downlevel-shell32.a":"bc7513e499984e3f43c2f9486f9ab68c9acb905e5f97bdfadb0f5ebbba1c4a46","lib/libwinapi_onecoreuap_downlevel-shlwapi.a":"e2b37f5820ac99c7532245623b5d16f5db7befb2e6b806070b80833ab74f1bd2","lib/libwinapi_onecoreuap_downlevel-tdh.a":"13dc97358c731f00d2a6ee35fa4cb0982b45dd4d2714048a4804d7f58e76a49d","lib/libwinapi_onecoreuap_downlevel-twinapi.a":"b86c1a5e36f38a9c0f31e682dc7f9fda58959ec0ed42cfeb9c566404c302d598","lib/libwinapi_onecoreuap_downlevel-user32.a":"c3179b1306b79d96f0b9b6c6c5626e17980514a87b805a4ccfc2857b187b92b3","lib/libwinapi_onecoreuap_downlevel-uxtheme.a":"7162baa362708a6f74d57bb41176537632aee62a1f21114e74e0d3137e28709b","lib/libwinapi_onecoreuap_downlevel-version.a":"250eb5e293a7615f14527959102ff12ba330964b81396d27c53c56231a955ed6","lib/libwinapi_onecoreuap_downlevel-winmm.a":"f5ada9831b7910c5a8242e24bd8cd212b522badfc4bfb264b703e0963a1225ae","lib/libwinapi_onecoreuap_downlevel-winspool.a":"f141ba828f5e27d4db6cb679d3bcdb27a558ee47ac1534b6ba89c199e776fd27","lib/libwinapi_onecoreuap_downlevel-wtsapi32.a":"5329f116b8eeb756c67230eb4a0e596d0a9e1ab0f13c934a0ba73f2dfb8debfd","lib/libwinapi_onecoreuap_downlevel-xinput1_4.a":"6608aab2240b67bb31862a6937f30a444f31d241ac7879db950903ea9a4dc946","lib/libwinapi_onecoreuap_downlevel.a":"27eea31922cb3fd8d246e99c301bc944cc7b533b4a7cbdf5df3576bce26f27a2","lib/libwinapi_opengl32.a":"a21d2c9027b5e12b0a301d91a342d1e0c4e09f1b17c0e9993516d6afbb8588bd","lib/libwinapi_p2p.a":"e326c9adf1a6a7463a07ab3d12d892b6e1742a68ba310bb0c79a3a3f15455336","lib/libwinapi_p2pgraph.a":"00450a6a4d2150ee58a953aff26c2aace3164774003634df2cc6cd4ed77d5917","lib/libwinapi_pathcch.a":"1afac1bcecb5829d4cdb6578781c90cd0df0e2bea8451eeae90530ef3d4572cc","lib/libwinapi_pdh.a":"d6c7f04fe2c3644b991b01158a2c4adfd7be1dbe92586a4f23a06399a6463d62","lib/libwinapi_peerdist.a":"8d76c8fdf7ce8ac440e870f58b41b6dcf40f76195f47dfe9af73dc56e14a9407","lib/libwinapi_powrprof.a":"229503fca740daf72ab00d667382ba9c7fece889e3cd1a71a3489acb75d72ddd","lib/libwinapi_prntvpt.a":"9ebba37677a82b045e82158a83c97b9f0e85c35b22d4685d56d39aa39c2b6d0c","lib/libwinapi_propsys.a":"772ef5cdd2543d6154e5ccd3e0e56238418cc26439668129a89a08018d07d323","lib/libwinapi_psapi.a":"6229c9845a705e1cf162d4d4c7d1c6963ed6984699295956e98c4c1387547328","lib/libwinapi_quartz.a":"e696d2cd3294d2440bbab92718f63af882414f7cb1df2b5a9e13a8900f327e76","lib/libwinapi_query.a":"f7db7da06e63f535f0af57a9b45e8d15c366b362afac56177765c137f46bdaa5","lib/libwinapi_qwave.a":"5454630cdf31cdd56e607f2c7bff2bba2d24ba2e00e0195e334418a7108e6f83","lib/libwinapi_rasapi32.a":"c4fac15981c0415e61104ee04de7a020735fb1ae53e684a7ced3f4be3ed95928","lib/libwinapi_rasdlg.a":"ed56000994e9e730e3926719d077e5882c316ddb440326ef7fbd77739a3f6c35","lib/libwinapi_resutils.a":"0dc8ca17810cc24f67330e7a60884a5603eac4b2701c3d7145e72ce26063523f","lib/libwinapi_rometadata.a":"112b0138a0d51f185ad2c8d7a996a96407b43509137223b9c09bf564df8d8990","lib/libwinapi_rpcexts.a":"b6ede0532c9e73afff9f4671c3047a33d43491088be0f65a9180f1e37641cec3","lib/libwinapi_rpcns4.a":"37c556274e43e069010547feecd4aabda21dba5d4ebc6ac44f8181bc72c082db","lib/libwinapi_rpcproxy.a":"081bebf46536fcc39e5a3502271c699f6954ed73ef5df0039f21b198053403b0","lib/libwinapi_rpcrt4.a":"ffa2d37f78b279cb94983f4b5bcf119b2eafc0b0eec6e454b3d314ccd79e58ea","lib/libwinapi_rstrtmgr.a":"628be186aafdaa96bc203f45a5c5f44418158886522fe48fc1c58ca2c11b1615","lib/libwinapi_rtm.a":"8e7d04db58dbb4e482fd83fb704afb44f79bb306a2671bb1cf795d75badeb52e","lib/libwinapi_rtutils.a":"4192a21edf7cbc36c094a91ad176e380ec7bd678419be3d2bc82a417485f559b","lib/libwinapi_rtworkq.a":"cf81238e5438972bee626c9a220c037f0fea65b13ab364617c35f00a2623a61a","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a":"c4e388681f040fbe1ab6553fb23004b647b5cf6162b41e2d00976a033d1288c2","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a":"1cb7108bd745cb6976f17119a2a4cf7c6e394aacb041946e9392185919589043","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a":"ea568779a9686d229b704fc0b55b09c01d231474bba2e3da89f0ac984f5c925e","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a":"3ab533f82dc0809199c2f5832c4990479dd318595db52ffd6454b4163efc043c","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a":"7a072baf8e59a84da283db866eae3759fd5b7b189b95c6fd9ddef1fc09b29b4d","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a":"d99870cde4fc641fe7fa82d9407cdf545c8418be12fc8a23c743970efbd8a458","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a":"e0a04ed845ee40af3ed6dafb8ccd6d5a4a02b62cb3fe711244c245482b168769","lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a":"0374718fe78077f795409e34ddd72ecd859531db0b8299e32fca799133cdc611","lib/libwinapi_runtimeobject.a":"72696bdf24b57c25bb32bd8c4d2673625b5c7ee72c7933e4b95f907198b85b55","lib/libwinapi_samlib.a":"60d825306f7f501eec0c814dd5083f25cdd60eea31557a158708861ce87cd9fc","lib/libwinapi_samsrv.a":"7fe3c2d10a98985f2798360f4e54dd8acf4f0cc6c595f41b6b9c349669eaf3e2","lib/libwinapi_sas.a":"671ce72d72339636993a558b07c77706a99ffa568fb9146a93dfd08c1afb79fc","lib/libwinapi_scarddlg.a":"067d27d48528d706acb69b3c5c65f54350ff60c4aba6dadd15a84ec073e5225d","lib/libwinapi_scecli.a":"6ee7ee37fe3b701239a7fd68a251926e436dcce30738911096c023923f7a5fec","lib/libwinapi_scesrv.a":"506ad42e7752933622d402b9f2a93b2df9594e72803e0b5a3d0fa59408b998e6","lib/libwinapi_schannel.a":"191033c5eba0a29d3fede1a466cce4d2e5f7ab092b26405996e4305e33e14556","lib/libwinapi_secur32.a":"da204b8aeafe5d279a7a0a0951525685316cbb9a42055d129e2e245e10b65ec1","lib/libwinapi_security.a":"1be744253e860d65ccc2e692b572b7049b86d9211a7605da32ba6d3c64519a1a","lib/libwinapi_sens.a":"693fe45c5e369acc65b45b4a9674b766e1a898169791ede962c0995e532dce3e","lib/libwinapi_sensapi.a":"4f0596c3eed566208b21900679770ad1efb8eb566f5537feb31d68d43a15bf79","lib/libwinapi_sensorsutils.a":"2ba2441022e5ec201e4241cab6231441576ec078039052a75c4e10fbe2e0fe3a","lib/libwinapi_setupapi.a":"063417b0069302c187ede7df0f60b230941d4689addcfc0485795aeda5dedd18","lib/libwinapi_sfc.a":"1e78e5a5d401237b38560a9ff6b1a8533d6090c8b3d215d81e049477698e2520","lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a":"98344bc027a9dd80dbf08a575dd1b6fc97d97e02c539c1e20f22c757a68504eb","lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a":"04c2e6d47229324177b05cbd600190d5b2abf3ed228ee6e03fafef2db892e7b1","lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a":"19eef865f78baddb60fc1f47289df74a07b72083d28ca68b85941c99ca550c80","lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a":"e166a6ec67a36b3f2918be018977a8159b8635491b55605cb5dd3167386d7e8a","lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a":"adf03c5853efb9b41d617cec9ebce4078cde77070c0bc2b3d325afd335a7fc6a","lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a":"632993df8e26c359cc5204b9e8daa13387a0aec8764f17556e41967550e4dc4b","lib/libwinapi_shcore.a":"0aae36b16b6c0fdba17f39f73cfae64d856ba9aaa06b4f1fca2437aa11c1c4c5","lib/libwinapi_shdocvw.a":"4bc14620d0cbe176991915bff0860601f62fa19fd08799b577eadf8b7587fdf6","lib/libwinapi_shell32.a":"8986ca544482cb3fa6fa4dbd0fbfa0fbd675d84623b902a6b107ff6983d0be74","lib/libwinapi_shfolder.a":"40b4ef0df707e9fe84490a5517b397bbf35df2f11845c00fd65ea5ebe327e0af","lib/libwinapi_shlwapi.a":"56f5b4b9aa857e7e2abec5e29e90cb604c30e0e378a217f5c63d0749ace2c378","lib/libwinapi_slc.a":"d1e968e1e2cd1f5517a0cb292d1bed0de352c3eb7f08a03bc256b6c9898bffde","lib/libwinapi_slcext.a":"3f435fb66d862b437381e155de17116bd25dfc3cdabbbb979e52e9f17eafcf6b","lib/libwinapi_slwga.a":"0daa0bb484b78fda78b198b0a1fe8e1ff01f2103155fb96396f76735540a392d","lib/libwinapi_snmpapi.a":"5fb36e79337358e343d2691a27e04e47b584c21869da9c4ea0cc04fecb851b4b","lib/libwinapi_spoolss.a":"4728dabac3364039ff2b3df5be911003ba6074b4022127f72b86b6d6bf792a3e","lib/libwinapi_sporder.a":"33bfc4229b72197bb74020eca4ccde0770512deb3eac0fb814cda40203969473","lib/libwinapi_srpapi.a":"2d074a6570ac4994014d7aa4f84f22353340541bdacb0d2033cea4fcac7d9f71","lib/libwinapi_ssdpapi.a":"2186218218995a2454dc5ffea0a3949f97dd4faad038ad2f22e09ad93e8e152e","lib/libwinapi_sti.a":"42835149c10ef8bb50e7e562af45009551003fc127278e9218d624d86a1ffc33","lib/libwinapi_swdevice.a":"16fa5d455edc79db45808633411d6eae89f65b6da1f99f775fb8c26e9edaa120","lib/libwinapi_synchronization.a":"46e1da98de3f92e2b8cf7d135e35978c418d4887080a4848a047eda81703c4ab","lib/libwinapi_t2embed.a":"f538b7f0a9add3796fa6bc18651c926c7ba0746f10d806f579cb98e734070d70","lib/libwinapi_tapi32.a":"bbc8dc40668a19af85e1782de0e994a55b2e2f4d3b073b75a687be4240448856","lib/libwinapi_tbs.a":"8bc36c289fcaf79f4c49ce8f10c28eb1e363c3ef63c6994b139b7c1ba95763b0","lib/libwinapi_tdh.a":"0dbd6204b039e117793145a6fbaed7109caa57fff41cec835977491ec280b538","lib/libwinapi_thunk32.a":"fdc3b4eaaf945bacdb88cbe5666c8717a0348f041858cad0f15d31d7bd83b6cc","lib/libwinapi_tokenbinding.a":"2067fb7f60368fe9ba420f13d508601e8c94e1c2abb5c7b831508fc54255e057","lib/libwinapi_traffic.a":"425d4da6b2df282bd8d0ca1e9626e419b2bc12d29e577bb3dc5a15dd1ddb9053","lib/libwinapi_tsec.a":"39071d6abdf019105c61f85eca91d578d2a0d480282856668ef0d62dcb12d9e1","lib/libwinapi_twain_32.a":"78d7b81b0353e749c36bcc8c07b3f4d1680f55fc43ee949d5ab84461f9ccbb14","lib/libwinapi_txfw32.a":"5e79373cfb16e47823a157305ca001420ba1f2f4cab5f52a79b71a3e93985c91","lib/libwinapi_ualapi.a":"48a778d2a2197f1921207badb2b07b6051e5ef2965dc816dc469b94eefe5044b","lib/libwinapi_uiautomationcore.a":"2247d182ec3eb1dc784f54c1bda305f9940b449047ab3c43f0dfddd308a22059","lib/libwinapi_umpdddi.a":"535ca1121764955e8c528ad0c8642d4c357afa5fa0ba28dbaf5e03cf5c60ddc5","lib/libwinapi_urlmon.a":"55be74bd0f8384c0bf84527cbb8b27601dc45b7c423809bc52760b729a5f86ef","lib/libwinapi_user32.a":"9d218297f1a130912c318391d3b159a487e6650c524aeff4656f4ac702dab2fc","lib/libwinapi_userenv.a":"8ff2850ba4437cd5fcf879d1dfcc9cbc5aef50ef205d9d397dd1a4700ae210da","lib/libwinapi_usp10.a":"e223cdb9e7a913eb3bc038f1a963c2cb4c669b084828bcf92539bd0595b62fde","lib/libwinapi_uxtheme.a":"d622c584adad49beeffe2d2641b72a31065340b16c16687cde46e7c41ac67b5f","lib/libwinapi_vdmdbg.a":"4f9390d8cda1b21a470724f85312e92a39edd5038621c0a1f051f2e83d776a7c","lib/libwinapi_version.a":"af226c499d3ec2f3aa9c128554b1a10a1d2c3658322f3137be0a5d4505d28c9a","lib/libwinapi_vfw32-avicap32.a":"516f00894b2cd61dc26b8a5d5ea59cbdf93c66a471f5aa5ab035d9629f187401","lib/libwinapi_vfw32-avifil32.a":"c356e4a74fbdc381143c6b84dc3edd117c43ad11b324d48619a40ab05e406b94","lib/libwinapi_vfw32-msvfw32.a":"4a3d662b600beddb1f973fea167e804965e1dd5cacb52a1433e1356e0418673d","lib/libwinapi_vfw32.a":"1f7bf15b2c0d637ef6a424ea0173f26d9adabb2bfbcc5711a95b408e060a7d96","lib/libwinapi_virtdisk.a":"f1e7237e523eef73b73cab8c7f9ee40b3df68f3003fd39dab9fb8bfd6d9a54bd","lib/libwinapi_vssapi.a":"0e0cbbeae26ab962bb1b7e738049e1b6d5cacafa01026aea553a37496bfd91fa","lib/libwinapi_wcmapi.a":"6d2f7593ba8c626b50f76072f07e1a49c249b14a3a8444e49d1932e2bad33f88","lib/libwinapi_wdsbp.a":"e904217b4f2b189b2d4cb2ef8f64896812e8a856ae3cb4eface35f1e38d3854d","lib/libwinapi_wdsclientapi.a":"47e5fcbbba5ad750586d102985f1f67cae7e7360fca331cbc866fff05ecebc00","lib/libwinapi_wdsmc.a":"97277aa23d70ff2b7d5d2f0ffbd70e6dabbe48d53fce30504a5176d6940d958e","lib/libwinapi_wdspxe.a":"a0668a171b4930c900c321d1d9d11e968fa4b2de32d36fa4238af8ebeeaf855f","lib/libwinapi_wdstptc.a":"ecd1ec06a48e3b98266d99a88797801a75bdc14956f92df90ec2d934d234fad4","lib/libwinapi_webservices.a":"889091e71202e8448edfaa7b02b299e9ffa8641635410eb85d41d4a41c592b59","lib/libwinapi_websocket.a":"b6d9f28c222fe4593b2587e95ab5f21a55ff16f96988a7843281b1d56548b105","lib/libwinapi_wecapi.a":"b206762c19af9ae83c0776754405b364f1aecc659d063b82f0f85a90e9ec39a2","lib/libwinapi_wer.a":"e69b6439516ddea86a7957de563719bc7a7e0794b70733659aed29d835ed26f1","lib/libwinapi_wevtapi.a":"da8dabe5e4a11e6a467c6b42c0bd193a7e097a2ff91c3b3743df8143e24dfe05","lib/libwinapi_wiaservc.a":"98af80f5e16013bc1f4a3da5a58debd00b879885d92a5c0fc90029229d20dd70","lib/libwinapi_winbio.a":"2f6275f01c300f097331fd3df333641453d855ec56d4cdf26586bd69b258bcfb","lib/libwinapi_windows.data.pdf.a":"78fc20ab685d930e28e113c2f26b8d8f137956d00c7a8406686543387a0a5dee","lib/libwinapi_windows.networking.a":"8e3c12ab2e0014c62c1d628fedf1fd2d7a5199a5b0324afb8d7c5715725ed59c","lib/libwinapi_windows.ui.a":"bd1c725946cabc374fdf6640c9e23550c05ec4309150e7cc7446cd13cddeff32","lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a":"c5b0f910c4f44a2b4ccbc4f1e5e7fe61441f3035c0f654b71022c3be347f1744","lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a":"921b323d3e681629b679b7afc1c83fd1c4cf8dd7b7331c59bbcaae5e42545b99","lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a":"d2677e3f095cc9b75de682c89ad058e3030ed6d572b3d4d173d8a2280ef7728b","lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a":"747263417baca3be11cd9746ecdc4a5204bae67f4e18bcb01989cd8fbcef33e4","lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a":"8911d4bef439812de4e56f48f6a1e7fb45f345d0d165ac73e37a396675886e7e","lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a":"3887370abb1c93d8086c19b79e64a20be3fd0cbe0cd18e521932a66dd29991e4","lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a":"0fed3d2349d58b01779bdccb151389118c253fc3788eb22da84e74d4f7fe1659","lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a":"79a9cc1cfc7e68b9d5fa2413887dbaa06b174c63bf70445803f9f4edbccaa5d6","lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a":"19490ac714cb91b47a0675babc6fb04b89917643fcbe748263dfb292fb3d2afa","lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a":"b7df6615a287a325a92d6aeee71b8900e56b366a06f34653be04a20803e08b68","lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a":"ef8097217b975f461e84bc49c995421e4655fa5905f45fd6ffab5b66a0a23e50","lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a":"35f73c31046c03d050648d08d33448ae03df778fbfa209fdace98e0881a97998","lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a":"9b84a711d2f9062a84a8ae10847fc6dbb55a43fef4aae5bf822513d8e86995a0","lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a":"0ea1333d7f77f97935d48cf5310fc09e21761a6bbe2ca16bf83884ab8bfabb75","lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a":"61bd430910acb86c226ef8f25922ed18e181f5ea3961e8d437199de0b93c27d2","lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a":"aae4fc49d326bcf224af545c5acc2ca73a882ee99823c010c2ce7fa4f3463934","lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a":"b91bd32bb31b3bbc11d7879afbfa3835fb9e37dd95eb3a70aeecd5d5b3fb88e8","lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a":"c7800772191799c701373b1057abef0884ad2b35d6361870c319a1929b579ca7","lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a":"f7af10fa4da9fb9784d46078d3358caed4e5fb076a4f9e4b87faf4d69d1b1f2a","lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a":"1dd99452503b5ae1b1887e6d3f4fb83b33ecd3d782a65acd776aefb208d98aa8","lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a":"c106369ed8b7893b66af9822394181cab93cd05323bf770a6d6f21e4cf61f22e","lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a":"30fca3d3c91ecba19fdfa03c07f1d0b34011c032b0f8fe4d35d6a26981a7280b","lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a":"62fec7d91958134636b0eb473d0606709a222567c7c23c3661aea9b014d84d06","lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a":"0aa99edd2c9ccfe972b8433a8d1489563ebc573524af956332257fabd8a9c162","lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a":"29990a25dc42702f3b0cb7de68616c1d95bccb352c2438e7a1fa659f0056fd4c","lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a":"4e3ad6c8b2c40e3fc18fbbf50ddac70e4dcbf8384def7004212eb1082aa717ab","lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a":"a88c1593ae4c736332b59c35d4706f08f5a3a723234f13ccf1b88e4c1f4c573f","lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a":"f79d009d3d96ec1e6141c366eab82ec9b2393a9a53d24573da11f92bdb64d8e1","lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a":"cb43ae3737d19690c7590deaaec247296b4619e297d0f10a3c675cdbfb5b0b14","lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a":"ec97314860cb28f6ac8e1c86be3d792753654b95cb97c01382719114e6bed03c","lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a":"1b901ed918a4185500efd56d6b256f6ac1f533b95588e8bd91d039cc901dd8d8","lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a":"c193e49f907ed28eadf228f1eec4f87f94ff1ded7aea62f7971ce400d9410c02","lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a":"c8965920439c950f8f5aa10d96fb47dabce00cfb583771ba3a004dcf81339d2f","lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a":"97bc9f0aabb84ac3d4f1eaccb2611ebc4c4e641057ae321823fce5bab135bb24","lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a":"f6653db4e2db6cdcf3dd5c67378a4960585b4f9d2d756d37bde43493030d6dde","lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a":"6e0c202293a3a4d82db8e7761b3be4873934e23be1cbb5ca034e16a9c5a95516","lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a":"0db40d463c43faf20da093c8adf7bcfc694d60ad39c703840bb3dfe41d87d867","lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a":"4249e889356ddb2e03c71847d5a279aa9d55ab71c33af0841a174396df75c70b","lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a":"139c4d1d6d7701c92c7235212ea18d8d41e3c80814d0009e7d2208456e19d88d","lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a":"5b3679ae87db26dcfd813fba6e7219127e0be4164174e767dea31344dc7ab2fe","lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a":"ae2f6723973befc952038c82c5ecf1ab298a12d5a67e42cbe412ecd2cc3cb237","lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a":"bcc7ff242a65f295251e799c3981ad9ecfffa94122bc5acfb806f12368dbdfb9","lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a":"7c95358ed9d08491fe9b4dcc2abe44f33a32731152aebf85600908b817aa5cdd","lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a":"5f13a5baf504172298384a4f5894c4f015181c05cff13e7649b6d91709abc173","lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a":"efc29ecfc1c177eae1b371304d809cd4c04e8c882bc9e8517315cc3024ca559d","lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a":"84a3683b612de399923e1ca199f504c5b6f07724ba1eb7cf31629a0ecf124b20","lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a":"70a9205a700f6f4692b76897a4b2af9d962b2bef4f8985a3f8d497d3fcb42df3","lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a":"5d6da3f78c52fc78b6e0e38202e7d0a14337c4e9645fcc1409d6fa8a284c340b","lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a":"dd10409d20098123b9ce8cbed2b84cd80422e7c915cc6aa558f9159918e68c25","lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a":"9477d17fd1a7fa542469845ea465551f48208d1e7a20508772eec708127171a8","lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a":"c6aa11d3471a2ac848e7f4cd166aa5c27ec40a8ee236a3041819ab95860c5ff3","lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a":"ff78df5353763aadbab865dc35fb8d341108934ecb836e4aeed6d6ed239051ed","lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a":"cb79f0638f79e94417b9260b05a511dff38a65484662facff84b90c3ab944dba","lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a":"c6af86f6b2d53ad5e919598485e76db5c573b1723c8e8aeafd987669d83a1be0","lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a":"04954fbf299df7f7a82afdfd43de1c38f3570a0e418a5d2bd15fb468641e3da8","lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a":"7390ed65bd34f830f34193e07a47a3386f2ea786adc752e9af9e667b3eae566d","lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a":"3e7d32bfe57a7abc58a6bab31ebfdb2135583a08779038169ae953b379813a21","lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a":"fec51f0b6ccf8fff21613039a69d7521e6086cfcaae762a8e5eef8ac8cccfcb9","lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a":"8de55da9f36c953a8eadd98ddbf1de68b6be21800117f5d81cd94ead505f9bc6","lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a":"22c4a7796605757145ce1ad6346f80d34f2b85ba948b6f7cf099cf8034a044e2","lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a":"abeec4e5001de5abaf99087505ad1d9db334f216d6b6f0a086f949705607aa18","lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a":"2a27d24879f73c7cf97f062d62948f92d3481cd3328af42f50fe3b9fd4593424","lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a":"9e39a5fd470276e47d539c8363e41a2990a1177b7ef50ffc8572a8901bab2daf","lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a":"9ad56c85293c2b75a8bf6f7bbc27d20cddfaf4a7f4a1864b572963717d0af10d","lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a":"dd1dbd548a66b9544931f37af2bbe883360de543ba2682e0a252308127ad16a0","lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a":"fb9f08901b2f4bd4788054ed67a5802a16b449a7ae7c8bdcef99e7baaf78958d","lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a":"a5639c7a442b6832cd55097454a35c011204919e903e69d951d959b53dcde57e","lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a":"b096b4581ece69959a8d5ebfd72fd0dfb036653f9710ad2de49952418a2769b2","lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a":"68a523bb89aa76d957a6273bd8cd3e74ae272663086125f6596d87b54f73579c","lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a":"cdc0393343eb169ef12f81fa31beb0351656dc915c93b8f23e27f08b8a1c11d5","lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a":"9316cdffcbf672f173d567f7a92d2466824140c7eb2384953107d81d3c3f348d","lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a":"301062e0fb6842804778b03340600c8ec456b88c5556926d493d8a04d5596d1b","lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a":"dddea56f7b9ce98346e62d212732813f2cb1814e55bd46b1a9590f012c9655d0","lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a":"e09456eb053d27e437f93b6cce33e53ee84235ec4bd178eede7183f914b23bbc","lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a":"ea4282c8e630531123f26680eeb0106e47151a8cc3eed133fd287579d0d6187b","lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a":"560b6d11f2bdc6cac22e1a48898c0715fa5f115fdf7ec968431fcc079fc0378c","lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a":"b1afb018e3339b40964c892a60ad60420f3be0ed09c9e881c38e4e51c0c80d8c","lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a":"8b680a4624d674a535b8c2c15a0ffda9e8895b5c8d166ba96dfe4c8a480c9705","lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-2-0.a":"c3620f180a6f35812cea5cfac3b7de6a539220622a45b1b3e9142bc4ae3067f3","lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a":"29e9e940b3a2734479127e3ea4ab5d802cd8247fb203ed8524331e238ad788f6","lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a":"0e00bce3914402e978d4b002b7a97fb2088cc22777541cf57a4709d75d619279","lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a":"aa18983363e672d6ba0e02edca860ec3e49327890920590fa84afa41cfadc966","lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a":"a4fa5e25373c7c20b4055cce63617dc5b55088fe3b791b956c66bd962dde002c","lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a":"e3339a7e092b42f837b920bd9bdbe925c2aa96524bade80249122090b93aab26","lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a":"2a61c5c41d4f8bd0a1b2a018bb598b4105694b234cb779dd043d2b6f001fee64","lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a":"07921deba9927172e88c9d7d247fafd36a80bfc3d7f56ca50e75494945b7387c","lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a":"8ef0f417775f5f71aad900bf1d88428135e78dcc2453119a13e8276940172a91","lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a":"3f77471cc4f5d6236f05afdd38d3aaec2537c73c0f77ae656a733d972c092bd2","lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a":"245f6cc49e7f28d23621cddde69613d08fcc3e9cdcb0f30f7bebb7f50a274601","lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a":"3584394f9ee238a7b232e129f3761f48ed6dc08a1357840960b18dac87915e81","lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a":"c93ba0c9b773af99e804414ae0cd5669edcd6d871c4422083586143a05694e6f","lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a":"186cf4a8e6c5f48844488ef3e55b8b971fc487a4cae5f9f4306a36a384c31831","lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a":"ea2abf3263cab4a37afe88804808c52e24f25a39bead22213448d383816bcf48","lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a":"e3a25f12131eb8efbbde17a6957b6ac91db0f218f81012bfb579c3491e600cd5","lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a":"788f5b224086241ef514a46acd048402c26d0248ba010e5751b4dbf2739fbabc","lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a":"d70660ee6f87669d5a5be3d30498a0f8db90d47e213ef4673c9b22489aa8b8e3","lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a":"792d5c8d2f043151c658a150a2275243ad6f01eea274dbcd13c811cbd74fa023","lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a":"aedb7ca0091ecbf259e56a8ebcc191390b8a2751d6421f887f39d00522ef7348","lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a":"992628a35f6cdc4e80e85b4994f0def4c4faf5b9e4065d66c180e903bfe99f69","lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a":"f47f0a3c6ccf57afb975dd87be54d9a084d3758fb719f443e759bf0ae26f5be3","lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a":"164925079d2aa31bc8d188ef464d5acaa04f557558ad227002d5ea3142498411","lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a":"abf0c280fcfd0e0a4bad6242e7684e80fbfa72aa663481a116f9b1f9b3cf2ea8","lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a":"c4f3a9e897910b6a82605e83d186294172f235db39364d22b82694f609d37e17","lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a":"dff3886a90efc4b7ed3c9c70b00353a882005e26129bb19c115ca010ebc68ff8","lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a":"a1a4c84bc894e63abef803b40aaad5e5893fc3eb270e943fcefcb4eb386f5b56","lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a":"683ecee0f94d0c6b85b8a378575bf0fdf51a6c0c6c69d3fa862beb847868b13a","lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a":"3642f35e4c5a55deda3a44986e2481d27b3d9e546ee8950ec27c3122840556ab","lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a":"e4043cd19d71c8a127fe349f024f8d61c3e73184bfc24c0826797aa94b5707d3","lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a":"6e2ab9f1b1530861419b0e33f5f3d668248d86bebc9e0c4f2245f8d3834053e8","lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a":"b527178f285e0cb4697239812bd440550c256a283bd748c2cb410fae2adf0f92","lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a":"3014d8d9ded6a717b207db72a80c6fc1f1b3f1f3f3f29c876da8771d43dd00c9","lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a":"e5944795e4f2884876ad23d27f91219357f10c7487dd814f93ea4b28c0f220ea","lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a":"05ee4a354736be759019d34b80abaacdd3e5f0baead949283ebb7568ab337e0f","lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a":"16496885611e587698b8e92908770c4cd2554a0b9e69a7c813a27c907ff15aca","lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a":"38a138b8bc2778de5f9dec25b0a617a58de6c1edf0aaeb03255c21fa694b291b","lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a":"7be997fc4193df0e92a143c5059093518215f294c3c8c32860834f9acc39511f","lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a":"81a29ddddfa1ae233ee03e8f8155a30291730d2cc6d3eb2df735026efb199c7e","lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a":"057258f17e45d83448ed3bf0f4dcf0c6b8f41b6f935e05595ca8e92da5b1e5c8","lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a":"ea2d90390134f09f9fdb25db1a912cc386b7e3b7cb9cd97ecf2570624f54dc6d","lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a":"03f6c50bc09e454a5988aa1e42eddf3efc8eb8024332feb02b066940b142a193","lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a":"68142802477c61b59281344bc37a8f9ad74c2c3af99f3043b214ffea1751b0a5","lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a":"a823078b3d1fc528b7950b508573fdd3c5536ed59d6cb15d93daf01e0d09088a","lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a":"a49fe302203c43b070ce7caac2ec2714b80f4f3349c3b763e011b2b97d347478","lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a":"88c3548c16f1d4a6904675ddc2397a20a3da0974ad020244309181b6410fcca7","lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a":"15574beb90cd18fff8d4ad3caf30eae1726b0d910b7271b7fec7251274a3f45e","lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a":"bac4066bc55c1c4ffaf883bbe621858625503b3557f252e50a87668e79f1d824","lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a":"5b5457ebf554266f90dfe8d1d802d0148ecee08fc32ddb26e4395de15d86c186","lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a":"2872f87618c9802b02c02dd526f985ba6cde3f6e7cb40c9fb020bffa40a86874","lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a":"f071517edb870d01283ff286076c4c69df68c3c3cb829bd0c7f9a963601cc09a","lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a":"cd4f492580f823ab76f767eeac8d83831f800dc7e8a7f7e3ebbe43f3a54c89b6","lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a":"67d89ae227bff24b8d9e642db5b8e0998c8904e076e3b31c5a930141a8f00b17","lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a":"b680af515fe0218cf7e604c284e2d2cc3480cd42481dfd879cef7ee70da266b7","lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a":"4854167c5d9c7b8d34f74c3b44d6b2dba2acce0b8cdc0d109a1e469b3acc5608","lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a":"6d403a8601eed410c7a7f88d6748b409510f7e97b6e3a8c90289491a5c34e4eb","lib/libwinapi_windowsapp-bcrypt.a":"973d55bc8d0b6e2e122270ae600bbb18fdcb19b358dfd2272d391fdb1dd36b39","lib/libwinapi_windowsapp-cabinet.a":"e84848066eb95f124eebff7da387586edabe953d3a57f410189bd7bdb77805ef","lib/libwinapi_windowsapp-chakra.a":"63ea1fc35871431493a0a316d91c3dd5bfe8a7d8f4717520a45beb9e936c3207","lib/libwinapi_windowsapp-coremessaging.a":"b2128fc3272977ce1d2698fa32b1392074853065c99b06fa4b8c96f5d6a5483f","lib/libwinapi_windowsapp-crypt32.a":"493f49ce5c585348fc7d3b7ea08fe0af317179b5d8978e43a4a8240589470924","lib/libwinapi_windowsapp-d2d1.a":"d19873d7c58bdbb34f5b047745e9c8a1461c5704a50f826621642c9076f7292a","lib/libwinapi_windowsapp-d3d11.a":"248e78e5913704107d3d2d04a6d949eba042eddb37a7a8823e2b9fea4cc755b5","lib/libwinapi_windowsapp-d3d12.a":"b43672fff645cdc5efbba81fe586aa71e9f4382e8f18490bca8c6a6626f80c8d","lib/libwinapi_windowsapp-d3dcompiler_47.a":"1ca1d96fe7cb943aa00d403ae96920ffe27b638b092ebe6975111c07a6481268","lib/libwinapi_windowsapp-deviceaccess.a":"e9be49e0cf5cc6e5c9eab3c31663cf6878320de064dca1fb9f91c0a24ec61363","lib/libwinapi_windowsapp-dhcpcsvc.a":"9b5f1fbaab5da120ddc0c3372d3fcdec309c6fae14c1f51480a89a39b551446e","lib/libwinapi_windowsapp-dhcpcsvc6.a":"13f15a4fd529f6fc68d910b50a7ae98a8be86a6d9d8af612cea977c610d234d1","lib/libwinapi_windowsapp-dwrite.a":"ee0478385c40b02c2b1df0d79ccc2aa224dab79f44c0db04bfcdcd5ae9af48ff","lib/libwinapi_windowsapp-dxgi.a":"d6a739e1bfa9fcb0f89717af65cce753e29d8bfc59017e2f846887805c0697bf","lib/libwinapi_windowsapp-esent.a":"037e46482a2b46da13b75048f73807cfa56d5d24ef36065ed50b279bae6ad246","lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a":"edeec625207e515fdb625b07e7e2b38c2cd73667c6b452f4456605b326a95864","lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a":"d5433d65cfa7cfe7b171d9f917a30c35cee237a807e92659f545b08d5ee8caea","lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a":"35260db55143ab8d0247cd7621a1d915f3c91dc1408aceddb77a42f5666e2285","lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a":"0ee840c8dcbddaa9ee9e48e89828c35e28b3d4bf80f699154d3ac445360feb82","lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a":"dea5a78aaf77341c658b482b907537469263e2f10c1e4270ca2ef7c3ad75e139","lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a":"6d302c7da5ba17b2d45c55a0937697545477d728adb6cdd9911fcc7d3f7fbf03","lib/libwinapi_windowsapp-hrtfapo.a":"1b02cfbe7eb71cecdd5da34b456f781f75c6eaf3e65eaed64bb786eb44c22823","lib/libwinapi_windowsapp-inkobjcore.a":"4ebaaa0305eee0c2edc21adb68da23869d6ee9ce0fe44578e650ad83369887f8","lib/libwinapi_windowsapp-iphlpapi.a":"e75029d637f81f91e51bab5b619dec0f0c58ee1dd18859d1b72290f35984f347","lib/libwinapi_windowsapp-mf.a":"2ae013b2f8c6c95fa29aaeb71781dfb5e25c87aabd5590eadbabe25556ced7d3","lib/libwinapi_windowsapp-mfplat.a":"20a7d1940ae503602322aaa57d74ed7e5f3ff344e193085d4d9eeb43e90bd759","lib/libwinapi_windowsapp-mfreadwrite.a":"9fd47afbfb271049090e26cf0d9767e2111ef74e6915ce19a417606255a80184","lib/libwinapi_windowsapp-mfsensorgroup.a":"abc64f326a4f5834dedd23e1ce3aca75c567e4afcff9a3e131837a5937e6763a","lib/libwinapi_windowsapp-mmdevapi.a":"66958af2e7ad7e872e0051440c618aede0ee623c2e3a2e1d194af18c0218a6b2","lib/libwinapi_windowsapp-msajapi.a":"e5c98e56b11c7bda04ad12acdafedd3760fe5cfd4a7162c947cba91e1e21d387","lib/libwinapi_windowsapp-mswsock.a":"9ea5245062abab4d6f986a8c22c7c8b82d253087ed16df5697aa0779dc7d2cab","lib/libwinapi_windowsapp-ncrypt.a":"26f25244ddbc526e1c09f746066b63d8c6e35ae8fa04a6c17496ecb923277710","lib/libwinapi_windowsapp-ntdll.a":"fa8044cf86e4874eee74c9469627d9c3d4b3e75b39c0a38f6cb541c778041b76","lib/libwinapi_windowsapp-oleaut32.a":"915fbe29c0d10e02ae07ce448b8e30d840dbbb9300e877419f6dd135ba1d400f","lib/libwinapi_windowsapp-propsys.a":"051a77cba76c77027e48073af393029330ae3e67910bb1bb2ab084dd0c2e1141","lib/libwinapi_windowsapp-rometadata.a":"562dac0a8fccf405618a18bbf52e12805ad2891cddef9826cf025544aef16bdb","lib/libwinapi_windowsapp-rpcrt4.a":"8f27df2bad159eefbf5220fe431a97d3b9992f11aca355468d80275a942e4065","lib/libwinapi_windowsapp-sspicli.a":"4fef993264ee3b667928d716aa7226386f8b400b9488544eae37f751dafe4db1","lib/libwinapi_windowsapp-uiautomationcore.a":"225604ed82687fd285341fd13e50a3f12ffb4fcc72e26a9a6fac89b52ff492ef","lib/libwinapi_windowsapp-urlmon.a":"107de902b8071750b28ccd2191b0fffc2e7a0d10df269debc53d6be3a218a500","lib/libwinapi_windowsapp-webservices.a":"fedf002ca88c8808428dba5e9a02e3582bd614638518bdfd450e00dff51b10fb","lib/libwinapi_windowsapp-windows.data.pdf.a":"6a5610f4886b3f3647f1ffe3aa9ef7af27e99cc35a7d819f8af4757203707440","lib/libwinapi_windowsapp-windows.networking.a":"315b0b15a77f52a734fe128cdebd993bce6370d4c08c4f9e3ddfd6788699ad1a","lib/libwinapi_windowsapp-windowscodecs.a":"5c76fcb37ebb0fb3cb9a16211d477e59c0d3550d21c169dff733cfbd8005640e","lib/libwinapi_windowsapp-ws2_32.a":"362558ef21906aa66e1e827152ef53b227667e033bcebbde8eb1216086d50889","lib/libwinapi_windowsapp-xaudio2_9.a":"b93cb26bb1c5c49b4b835ab7115695e914fbdfa8fef19bc00c998667dfb28ecb","lib/libwinapi_windowsapp-xmllite.a":"82a0624f77b63748c2cc456408ffd9da0516dfb0e23d24b06fdaf9c29b53183f","lib/libwinapi_windowsapp.a":"dfddd13a1be53af64a03d5d473a6c2c80c747fc7999e1cad7e7aad50d887a813","lib/libwinapi_windowsapp_downlevel-advapi32.a":"b15b64350cd697ed96ebd6c59716536c69c78cb589989058c83a5d2f4e8be98c","lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a":"565299f3aea03821f84e8052b1142225a8ac05d71808aa660e2aec78b115a3f5","lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a":"f4d80cc039da4a39579155f7b30298e46ace98a936a387db47dbd64eb917d064","lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a":"c941a5cfd8d2148bb8ec06c9a9b3c8a70723b37fc2634575e36c1c49d1df73cc","lib/libwinapi_windowsapp_downlevel-cabinet.a":"89a12c6584e2cdc05364aef6f6e17f77d0083769633adfab47b5d6793ad884e6","lib/libwinapi_windowsapp_downlevel-d2d1.a":"bda9d05a33ca5e056cf5937fef2a52a59b6700fe45578131391116ca4a4c5b31","lib/libwinapi_windowsapp_downlevel-d3d11.a":"151c55f421ac527340a812b669da6b35faf8e9b45d1e2d0e08deb982063a24e8","lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a":"b1377cd66a4f5e603f7713d253a8257da5942b4cdeb124f6172cc22573ec4f37","lib/libwinapi_windowsapp_downlevel-deviceaccess.a":"dae3ef67aedc2f6be5934edd881e94f0f1d557157eb120603033c3b33056b790","lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a":"71c09c6b4a7957e41326568aa5c3843e3b801e64b8402fe29c39ef722de2f2cd","lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a":"1b2e5fe6ebe47482a817032559f7f7fef399e0af20c8a65263976efa41cfad30","lib/libwinapi_windowsapp_downlevel-dwrite.a":"8ec12a94050fb6be30d9ce89e9a3a3fdf229aef3ef851e934fac59a8c805c34d","lib/libwinapi_windowsapp_downlevel-dxgi.a":"5b399ce9491ac65f985c474bf8a12c052bceaeb9ef4287f1b52276652afed04f","lib/libwinapi_windowsapp_downlevel-esent.a":"b1410b4797fa48ff20422267b1be926d59cc4857aa7b95fb6e52f4f9ce7994ff","lib/libwinapi_windowsapp_downlevel-kernel32.a":"7a7c838ea5b0cdc182a1a6d258d70817dfc160c074258ce680a2db2cf7c10578","lib/libwinapi_windowsapp_downlevel-mf.a":"fe2d036c4a667eeb030566ce65f3f89b989c1fc1abe5f83945ca44fdc0b70c13","lib/libwinapi_windowsapp_downlevel-mfplat.a":"e5bee9fab643169b89c88cf568045bac6e6f016faf293f8aa30284f88a256238","lib/libwinapi_windowsapp_downlevel-mfreadwrite.a":"c5de9e0ce1202e8352f16d8b67f9a6fe1be12fbafa0daf61538225f499f69605","lib/libwinapi_windowsapp_downlevel-mmdevapi.a":"9c981c2a505652b7ce2455ba30ee8574427948ee7b67571bf5d09a8dc97ea375","lib/libwinapi_windowsapp_downlevel-msajapi.a":"7e59dbf0b6e104a79ecdbac529f45e44b0ddcbee1d38863d8aa7cf2674eaad67","lib/libwinapi_windowsapp_downlevel-mscoree.a":"1b062a2632e68b73495c1247e5279839e3033e3de02b5f5db104cbbc68af2be4","lib/libwinapi_windowsapp_downlevel-mswsock.a":"3f58e0deac30f5a96f3f2a6b4d1a80f2496dd6b1dbbd01235bf0755d51afe986","lib/libwinapi_windowsapp_downlevel-ole32.a":"e4b79dfc1813ee67f496b671e596cc01d2e0ba1c79f0d4d6ae2d7201f56a760d","lib/libwinapi_windowsapp_downlevel-oleaut32.a":"69308892c1dea408b9384284943e45f2147da04e74caacf4ab44de11cc2d364f","lib/libwinapi_windowsapp_downlevel-propsys.a":"b8b6552d2b28a7018468994d3394519b8a7101534b3f4e50173aa1813201f853","lib/libwinapi_windowsapp_downlevel-rpcrt4.a":"8eed742ab752bd17b586d1603e796339c5555e0b0bec3ee1f1d9532521c6e52d","lib/libwinapi_windowsapp_downlevel-uiautomationcore.a":"8d467b3c25c5e390893a47b1e3f8770776e2a36372a8bf0531c25a492f1125a0","lib/libwinapi_windowsapp_downlevel-urlmon.a":"42ad1a91664810df9c2908cdbf8050729db56f14e36125fbc71cf463243f7806","lib/libwinapi_windowsapp_downlevel-webservices.a":"89fadc0f43b06e47b373e9a44632c61b14b4f7a2f2e9ee82136c3e0bbdaf1f80","lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a":"731707bc16a683848d60aa38954b1938900f089acb91a15c7e3613fa34784dfc","lib/libwinapi_windowsapp_downlevel-windows.networking.a":"3f03402c0a4dfef0d0064915f17f88604c8526edf7f03864ffc2a07838311407","lib/libwinapi_windowsapp_downlevel-windowscodecs.a":"f57a96186c4180602cdcb4ff71b3195cec7159d7f6fc32e4ef842d2616a8164d","lib/libwinapi_windowsapp_downlevel-ws2_32.a":"fbf4bee29fefae79bddfca5f7d26ef4b3fba39cd4ca38c69999ddf3b16ffc352","lib/libwinapi_windowsapp_downlevel-xaudio2_8.a":"575a6971d93bb159b37c4910495669d337e6644bae4d7b6f4148ace23d7bb89f","lib/libwinapi_windowsapp_downlevel-xinput1_4.a":"8ebe2d1cf4cc25f05f3f6cfafa9084295e07d022fb7849c655d3d29f40c65b78","lib/libwinapi_windowsapp_downlevel-xmllite.a":"499ea167ece4491d8a1e9a52344c4ba7edd04bdff77a6c79e32dacf57808a33f","lib/libwinapi_windowsapp_downlevel.a":"2194d9b733835788488e418bcb32fad827b37be22f4c4bf60ab2a9a79909b61e","lib/libwinapi_windowscodecs.a":"1d9a617d8619f0f754bd96735db2f21efec8f7c7bc4a14c5815e454b1b316d16","lib/libwinapi_winfax.a":"98cf3f776b3f05ea74eaf7fe7dc767db42e76bd07b4d253eb007349358f3cc80","lib/libwinapi_winhttp.a":"cce6f8284c2f68dd07b5cf7c5a4d1573f8a15645f8bfa465968709d2dd721920","lib/libwinapi_wininet.a":"01d3a33678e0b27ab1c07d0a160bf2382ef9069545f8a54a91e11d5c5f504228","lib/libwinapi_winmm.a":"edc07d91a9cfdb84393c2a1fd148ce6374c4c5cb8a8de8c3dbb6df0f9bf0a4aa","lib/libwinapi_winscard.a":"55058b121a5930e72c4e9b5c67b7d39b4da0af64cccc9d67e04604c1b6c6ff2d","lib/libwinapi_winspool.a":"cdb1f6a9d6b85f15e912b1e9d5cc20851297d0421bcace0f8f47ec200825055c","lib/libwinapi_winsqlite3.a":"a089b8a8083e37e93d77d3f8f94039157c7f4389026d19563cf6cc868cf1a1bb","lib/libwinapi_winsta.a":"618c97b3204cd65b588ec2c3821207207596170b7cc7bbba3f3c59db4d746d8c","lib/libwinapi_wintrust.a":"79e2228fb8ea93e0565c7b9db89bd35cbb6824ba4d384d295460495c21cad6a7","lib/libwinapi_winusb.a":"80e1e8b3ea87e67eba6d82026c611ca46e481134f65dc0a65e7cb8ab6b3cdf84","lib/libwinapi_wlanapi.a":"5efb1954fdface46feef7639ed76d1b13c0f9f38ff5d2879fc4cb7e26940466d","lib/libwinapi_wlanui.a":"990c834c28a1087962948e556e0427fd6c31e79e1dc81b34c6f744ef67c0f9be","lib/libwinapi_wldap32.a":"4c399e2d32d3d53359361a89ef059d4751412d8c68f5a0c2396462b34681e7bb","lib/libwinapi_wmip.a":"318d6e8f08041e59a05d82eb2a70e8794d123c91cd71339a65a1bff0d7b990be","lib/libwinapi_wmvcore.a":"df64a1a7af862fe93cf2cb3301504417148e5fad917e0182a41df0b3bb3dae83","lib/libwinapi_wofutil.a":"330612632e94d06d2ab63ba3e85db69e4c689b02fa14bd4602505be088c6b8b3","lib/libwinapi_wow32.a":"49bf68f714be90aa6cef22241be0b55f6553ff6405ca147824fc5653a60fda1b","lib/libwinapi_ws2_32.a":"b02a3fb740261e1e72cc6d88ae06f228565d39a253198122c23ac965b606982b","lib/libwinapi_wscapi.a":"4a9236b6557411c5bcef90c4f3062aef4377e0421fcf6f6fc7d3483014edeb92","lib/libwinapi_wsclient.a":"b3be16fa22186b2e36537feba46f81c70ec66978459d715a03600c1fa10c4baa","lib/libwinapi_wsdapi.a":"c8824e6b5d4aef2e8695b674905960fcaf1af8881965915235454d25bbb5c667","lib/libwinapi_wsmsvc.a":"11d5e8f6c72b2a16eddf3fe8c4db08932c3f70398808e57c9a797ef9ce8f548d","lib/libwinapi_wsnmp32.a":"4c8dbbe49a58aa683655b84952ec5e5dd6bc68cc4d062cdf6d000daa31a36aa2","lib/libwinapi_wsock32.a":"204c14be3fe2cc95e1ab464b4f4d86e59e56bcebd054dbda55cef49d676ea037","lib/libwinapi_wtsapi32.a":"6b0541ecba6bb1a20571ac9cf3cc6e3909c7592214128e9fe5259d8a520353b8","lib/libwinapi_xaudio2.a":"7ed568b3851cf3dea6d2a2a88b2d5f4c56899dbc8d7f6d8126a06ca7ee2ae139","lib/libwinapi_xaudio2_8.a":"d6717d6e560fa321413dba473d5b741c6d44d3730145c7089de3b996279494d8","lib/libwinapi_xinput.a":"b0edd4a52d698ca8b714ba86dc185ff75e1aa4c9179150dfdd5e01b766f93a36","lib/libwinapi_xinput9_1_0.a":"455441428a9a0bed23abf9cbf316e27bfbdb545d2eb5e7f4319eea8a02938512","lib/libwinapi_xinputuap.a":"7b9cbe2a468180055aea890071308a802d938ccdb81d324e4f904020820f29d1","lib/libwinapi_xmllite.a":"33792fc30a0332b48e0d93d90ac0cb08bcc6331c10d8d9813a5c27dff101b12f","lib/libwinapi_xolehlp.a":"23f63c0a9df8909599f487b90cbdb747781642f4fa60f2b1a2fb24beba4a01d6","lib/libwinapi_xpsdocumenttargetprint.a":"6880144760502cc9643ab5841befa150f05d59dc81be1ed530dcb582d31e6b93","lib/libwinapi_xpsprint.a":"55aef7583e713244611d79c87ff9c955760cdb9060a081fa8e28dc9cc58f27cd","src/lib.rs":"79212a91f610f8a77aa6ed4cc77212c2531eeb35630388bf07323cc328fcca42"},"package":"ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"} \ No newline at end of file diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/Cargo.toml b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..e3bd0c6bedfde9562838ecfc14dbc794bf64e6c0 --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/Cargo.toml @@ -0,0 +1,22 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g. crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +authors = ["Peter Atashian "] +build = "build.rs" +include = ["src/*", "lib/*", "Cargo.toml", "build.rs"] +description = "Import libraries for the i686-pc-windows-gnu target. Please don't use this crate directly, depend on winapi instead." +keywords = ["windows"] +license = "MIT/Apache-2.0" +repository = "https://github.com/retep998/winapi-rs" diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/build.rs b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/build.rs new file mode 100644 index 0000000000000000000000000000000000000000..7130b307eaf3878398e95fdf882008775a7492f8 --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/build.rs @@ -0,0 +1,18 @@ +// Copyright © 2016-2018 winapi-rs developers +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +fn main() { + use std::env::var; + use std::path::Path; + println!("cargo:rerun-if-env-changed=WINAPI_NO_BUNDLED_LIBRARIES"); + if var("WINAPI_NO_BUNDLED_LIBRARIES").is_ok() { + return; + } + if var("TARGET").map(|target| target == "i686-pc-windows-gnu").unwrap_or(false) { + let dir = var("CARGO_MANIFEST_DIR").unwrap(); + println!("cargo:rustc-link-search=native={}", Path::new(&dir).join("lib").display()); + } +} diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_aclui.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_aclui.a new file mode 100644 index 0000000000000000000000000000000000000000..5ccf8e52a404e08a59141c9fbcedd4a870e40c3d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_aclui.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_activeds.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_activeds.a new file mode 100644 index 0000000000000000000000000000000000000000..e9132251f3bfdaa495aa1b48a40b275f058179e2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_activeds.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_advapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_advapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..6c52a36b644253876133c032256899788e027116 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_advapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_advpack.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_advpack.a new file mode 100644 index 0000000000000000000000000000000000000000..e7eae3cdf440a2c3a5e31dd1e437153e4baa5943 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_advpack.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_amsi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_amsi.a new file mode 100644 index 0000000000000000000000000000000000000000..971e59798cd5338199b211b54a46837de8630135 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_amsi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..70f11d704c3259d6474e7b14ad296f9f26df81b9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_apidll.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_apidll.a new file mode 100644 index 0000000000000000000000000000000000000000..12f8738854d24d02bf3e78d400272c8f7b459e6f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_apidll.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_appmgmts.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_appmgmts.a new file mode 100644 index 0000000000000000000000000000000000000000..1b6c97addc7db728311e2f40cba65775d507c31e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_appmgmts.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_appnotify.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_appnotify.a new file mode 100644 index 0000000000000000000000000000000000000000..5bd2147ef0fa06736cf552ec656ee3c68b06c278 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_appnotify.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_asycfilt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_asycfilt.a new file mode 100644 index 0000000000000000000000000000000000000000..1d443dc929ea55fdcfa678a2d1e6d9468425e3e9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_asycfilt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_audioeng.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_audioeng.a new file mode 100644 index 0000000000000000000000000000000000000000..a058f8dddde14c716357af97501347e426258299 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_audioeng.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_authz.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_authz.a new file mode 100644 index 0000000000000000000000000000000000000000..ace31de74aef850f5ad232caa30ad95b6095edee Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_authz.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_avifil32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_avifil32.a new file mode 100644 index 0000000000000000000000000000000000000000..8b1033ddca38097f121a4b59065c0916a21e8db7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_avifil32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_avrt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_avrt.a new file mode 100644 index 0000000000000000000000000000000000000000..263dc0deb3faa33611fdc677184b7825a550c83f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_avrt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_basesrv.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_basesrv.a new file mode 100644 index 0000000000000000000000000000000000000000..3694b3fa1010e7db8b005506138fbad4b0114a09 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_basesrv.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_bcrypt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_bcrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..4e38eb04ff8dc2e003e18aa5361754d8c402812c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_bcrypt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_bluetoothapis.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_bluetoothapis.a new file mode 100644 index 0000000000000000000000000000000000000000..4a73919f98a7c0ae44fbafe40a64ac0a9d3b709b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_bluetoothapis.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_bthprops.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_bthprops.a new file mode 100644 index 0000000000000000000000000000000000000000..17ddc90c5f9bde2298ba7f52f2b1d19485fc43e7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_bthprops.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cabinet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..7d55bc2b78917d0e58b1c64385f5ec10f3f53ce6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cabinet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_certadm.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_certadm.a new file mode 100644 index 0000000000000000000000000000000000000000..ea4783605c9bca52a496ccf09e1acc8c49bdcd35 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_certadm.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_certpoleng.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_certpoleng.a new file mode 100644 index 0000000000000000000000000000000000000000..6a824a22f475d2adaa92411fa1bb33e38738d94e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_certpoleng.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cfgmgr32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cfgmgr32.a new file mode 100644 index 0000000000000000000000000000000000000000..8bcca8896ad7ae32fd595766ac53cc6af54c1997 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cfgmgr32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_chakrart.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_chakrart.a new file mode 100644 index 0000000000000000000000000000000000000000..edd1a2f70f3167195c4692c075b01e91d90edc83 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_chakrart.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cldapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cldapi.a new file mode 100644 index 0000000000000000000000000000000000000000..5b8b4a8bc0cd2aec8dc7d9ca565a11d9563ba5bf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cldapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_clfsw32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_clfsw32.a new file mode 100644 index 0000000000000000000000000000000000000000..6879e86a48153a06baa9c1a7419f255258bcd3b8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_clfsw32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_clusapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_clusapi.a new file mode 100644 index 0000000000000000000000000000000000000000..69ecbff393de77c16bf80639563ef03db44c90b2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_clusapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comctl32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comctl32.a new file mode 100644 index 0000000000000000000000000000000000000000..cb75459ac588538a2c289e1eca2f8907eb06612d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comctl32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comdlg32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comdlg32.a new file mode 100644 index 0000000000000000000000000000000000000000..9cfdcf660fe87296236b019680ab9dc2ad8cd2f1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comdlg32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comppkgsup.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comppkgsup.a new file mode 100644 index 0000000000000000000000000000000000000000..081ae6c9e77a8a6765b4d00469d9dd222849e985 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comppkgsup.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_compstui.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_compstui.a new file mode 100644 index 0000000000000000000000000000000000000000..f47a63865718e6c232092af400a2349fedae3e13 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_compstui.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comsvcs.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comsvcs.a new file mode 100644 index 0000000000000000000000000000000000000000..7378ba59a4373b149264f6e11c30c350da1f7b4f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_comsvcs.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_coremessaging.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_coremessaging.a new file mode 100644 index 0000000000000000000000000000000000000000..b4a6f022407623b8c3365244243ec58e9102a612 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_coremessaging.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_credui.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_credui.a new file mode 100644 index 0000000000000000000000000000000000000000..10a1e5b7c18087b03beb5e56c8b6b79872e52603 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_credui.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_crypt32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_crypt32.a new file mode 100644 index 0000000000000000000000000000000000000000..48f43dfeab836ebfc279daeaa78acac74af3b1fc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_crypt32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptdll.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptdll.a new file mode 100644 index 0000000000000000000000000000000000000000..71752c19060bbd5f710593351f2f2e333d244b5b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptdll.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptnet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptnet.a new file mode 100644 index 0000000000000000000000000000000000000000..25d046d001731fd455a490084baf9d63ac8f1733 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptnet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptui.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptui.a new file mode 100644 index 0000000000000000000000000000000000000000..104e7afba6ee0a751470e67a696eaa3f842ad462 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptui.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptxml.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptxml.a new file mode 100644 index 0000000000000000000000000000000000000000..e1d472523ef7cb662dfadb7908a5280c5b5eaef9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptxml.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cscapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cscapi.a new file mode 100644 index 0000000000000000000000000000000000000000..5c12838ffc5b108d16b9d33f61803d2de9543e60 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cscapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cscdll.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cscdll.a new file mode 100644 index 0000000000000000000000000000000000000000..25dfaad5ce6d896b16c6cff6e0ccebc33c9df5c1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_cscdll.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d2d1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d2d1.a new file mode 100644 index 0000000000000000000000000000000000000000..304db07167691eea5bee2e106e586e790bec9d14 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d2d1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10.a new file mode 100644 index 0000000000000000000000000000000000000000..dd59522bfd3dc5db9e460682d3a093de13f5330f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10_1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10_1.a new file mode 100644 index 0000000000000000000000000000000000000000..9b97e07206aef58a85747f0759eb2e0c7d451a87 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10_1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d11.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d11.a new file mode 100644 index 0000000000000000000000000000000000000000..5ef0648bcbb762162b330b92362f3fe1d81ecf1e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d11.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d12.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d12.a new file mode 100644 index 0000000000000000000000000000000000000000..af625e99de4ba9252ba9fa87780be2a8a1760dae Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d12.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d9.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d9.a new file mode 100644 index 0000000000000000000000000000000000000000..639ac8d042fc7fbacb2da2d6f06a9df7401bab49 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d9.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcompiler.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcompiler.a new file mode 100644 index 0000000000000000000000000000000000000000..1fd8e8ab13e18e51f5dc3392e81903b73ed63455 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcompiler.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsx.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsx.a new file mode 100644 index 0000000000000000000000000000000000000000..064611726dcd1b38ac1ddaf897cf9cee405e9fcb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsx.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsxd.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsxd.a new file mode 100644 index 0000000000000000000000000000000000000000..25e1db1e2441cb77eb83e78c028a821a3889aaf9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsxd.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_davclnt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_davclnt.a new file mode 100644 index 0000000000000000000000000000000000000000..b6f0b9dcd8166e80a97cbcb5222acd590d7175a3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_davclnt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dbgeng.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dbgeng.a new file mode 100644 index 0000000000000000000000000000000000000000..e23a4e6620e1cad4e63404fcec0b6b20e673b2de Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dbgeng.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dbghelp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dbghelp.a new file mode 100644 index 0000000000000000000000000000000000000000..e847dbc36d3208adbe988f2f5173ac8e33371979 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dbghelp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dciman32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dciman32.a new file mode 100644 index 0000000000000000000000000000000000000000..0c4f056d3bfd5da2693e210053b264df0a0df787 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dciman32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dcomp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dcomp.a new file mode 100644 index 0000000000000000000000000000000000000000..e38ec83f431aa313d1898cadfaf85492188a6111 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dcomp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ddraw.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ddraw.a new file mode 100644 index 0000000000000000000000000000000000000000..9b0da8b7b6823c89fce34eee35d8f92e810295b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ddraw.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_deviceaccess.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_deviceaccess.a new file mode 100644 index 0000000000000000000000000000000000000000..70a1ae3a9536218bbaaacbcc165aa7f87d559b83 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_deviceaccess.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_devmgr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_devmgr.a new file mode 100644 index 0000000000000000000000000000000000000000..83badc674c00ff10ca0904e061862ba0f04f79be Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_devmgr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dflayout.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dflayout.a new file mode 100644 index 0000000000000000000000000000000000000000..90f7f495cead357fb6c082bec3e9e713a676d738 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dflayout.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..4b9e89d8759e015435a6cca158134d3a833dceed Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a new file mode 100644 index 0000000000000000000000000000000000000000..94e7d193d6f1dda8af4fb37ce172ddf3e23832b9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpsapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..9b5f149ed9cc7e0ed1ef31c51bf2423c341ea4e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpsapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_difxapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_difxapi.a new file mode 100644 index 0000000000000000000000000000000000000000..38e0f7521ba45f864a0a68218f3cda343a19ad3e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_difxapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dinput8.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dinput8.a new file mode 100644 index 0000000000000000000000000000000000000000..0def510a7b132b0fe185e4efd64e76d1274e4d01 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dinput8.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a new file mode 100644 index 0000000000000000000000000000000000000000..4d0d6f5e1facef8537e9164e6440ce180babe172 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..32d6f44e4283a9edd001f3bf2246bc5fb2334cb3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsperf.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsperf.a new file mode 100644 index 0000000000000000000000000000000000000000..e980e4befb0d2c6e50b9899bfcbd6627b4a1c6f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsperf.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsrslvr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsrslvr.a new file mode 100644 index 0000000000000000000000000000000000000000..98fd6ec20549217eaad375403285e6726c70cc52 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsrslvr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dpx.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dpx.a new file mode 100644 index 0000000000000000000000000000000000000000..11596b424911cd17c0a3c1b1071a284497e812ef Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dpx.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_drt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_drt.a new file mode 100644 index 0000000000000000000000000000000000000000..d73c32ca60a80d11f19f9442d70500ef67843b79 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_drt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_drtprov.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_drtprov.a new file mode 100644 index 0000000000000000000000000000000000000000..e99a635976d1e3f13804a246ea763233d9bb010f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_drtprov.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_drttransport.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_drttransport.a new file mode 100644 index 0000000000000000000000000000000000000000..48975dafb6579b30321b63debe2c00dcad42f843 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_drttransport.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dsound.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dsound.a new file mode 100644 index 0000000000000000000000000000000000000000..e9bfe421e0d19fda89226236555d7ca592af0c38 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dsound.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dsprop.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dsprop.a new file mode 100644 index 0000000000000000000000000000000000000000..4b0706bb001f0f67dd5efd22d23604e821115436 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dsprop.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dssec.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dssec.a new file mode 100644 index 0000000000000000000000000000000000000000..3de363e6e5f37d3c63334362b6974609e3c4e524 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dssec.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dststlog.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dststlog.a new file mode 100644 index 0000000000000000000000000000000000000000..7a2c3e506f694928d94bf4ecb9df5c2b9c3aa3e3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dststlog.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dsuiext.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dsuiext.a new file mode 100644 index 0000000000000000000000000000000000000000..2f42acf7f2307bec3fc4cec128cc00b3a44727f1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dsuiext.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dwmapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dwmapi.a new file mode 100644 index 0000000000000000000000000000000000000000..3daa809c68f70b270fe82bf4210fd026dbb28974 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dwmapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dwrite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..57af41635e956bebfd9d45f0b9f9e44e0a46ff4d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dwrite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dxgi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dxgi.a new file mode 100644 index 0000000000000000000000000000000000000000..3bae477b7314ec9c9ef290be72fd35fc737e7878 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dxgi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dxva2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dxva2.a new file mode 100644 index 0000000000000000000000000000000000000000..d495dc49edc100e94e0f179e9f02f40cfbb96b0b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_dxva2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_eappcfg.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_eappcfg.a new file mode 100644 index 0000000000000000000000000000000000000000..3069ee95c1a60978711cedbef8ab41ba51c90cab Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_eappcfg.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_eappprxy.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_eappprxy.a new file mode 100644 index 0000000000000000000000000000000000000000..5dda01c5480925c02a9dddaab5eaad492f3af0d9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_eappprxy.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_easregprov.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_easregprov.a new file mode 100644 index 0000000000000000000000000000000000000000..4d12d5357411c3fea83ec52308f1400481815bb3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_easregprov.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_efswrt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_efswrt.a new file mode 100644 index 0000000000000000000000000000000000000000..7e1a167d717ff62054beb1a271ec0ae09b220d92 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_efswrt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_elscore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_elscore.a new file mode 100644 index 0000000000000000000000000000000000000000..1cebdc9958694d00d1d14bbcb5b611cff1e16402 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_elscore.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_esent.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_esent.a new file mode 100644 index 0000000000000000000000000000000000000000..b49e343cc588838fc973e9f16beaa22fa56b6e3d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_esent.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_evr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_evr.a new file mode 100644 index 0000000000000000000000000000000000000000..c8aa1a94674e84f29e2171d1d626c30fb348cafe Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_evr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_faultrep.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_faultrep.a new file mode 100644 index 0000000000000000000000000000000000000000..4de5c1e961214ce888c0f87084b5340c7ac981b3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_faultrep.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_feclient.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_feclient.a new file mode 100644 index 0000000000000000000000000000000000000000..0a5cc40111b94172e82a36adfb4c40f83c334363 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_feclient.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fhsvcctl.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fhsvcctl.a new file mode 100644 index 0000000000000000000000000000000000000000..88de8293cb4e2509172be4d912d50ecd2b07d1a0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fhsvcctl.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fltlib.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fltlib.a new file mode 100644 index 0000000000000000000000000000000000000000..f6a962377eec37165cec73140572110cf6d1a38b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fltlib.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fontsub.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fontsub.a new file mode 100644 index 0000000000000000000000000000000000000000..42d704e94e1d11edf4770f62404a2a109990101e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fontsub.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyd.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyd.a new file mode 100644 index 0000000000000000000000000000000000000000..ea81552448f9f6b25a6339adcb65cbc0b590c6ff Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyd.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyn.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyn.a new file mode 100644 index 0000000000000000000000000000000000000000..2913ed6f7f94e123f8127404c89395ab8dd0a00a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyn.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fwpuclnt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fwpuclnt.a new file mode 100644 index 0000000000000000000000000000000000000000..3e89cda3a0218aaaab00d0cd4f2ed3f9e51cd758 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fwpuclnt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fxsutility.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fxsutility.a new file mode 100644 index 0000000000000000000000000000000000000000..3465f81b16dd4bf0133ee38c0e7c678fcd489cc1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_fxsutility.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_gdi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_gdi32.a new file mode 100644 index 0000000000000000000000000000000000000000..5987d47415c18604e45bdce84f2bfae2c4ac998e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_gdi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_gdiplus.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_gdiplus.a new file mode 100644 index 0000000000000000000000000000000000000000..a6056e89abd2424ae2ea333c53b46e5b597fbfff Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_gdiplus.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_glmf32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_glmf32.a new file mode 100644 index 0000000000000000000000000000000000000000..32b72a9604cbafde5e88279b11fdc46c6a05e186 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_glmf32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_glu32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_glu32.a new file mode 100644 index 0000000000000000000000000000000000000000..d79482aef7d8a8c51269a028b4a986d0128cc5d9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_glu32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_gpedit.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_gpedit.a new file mode 100644 index 0000000000000000000000000000000000000000..a787bf86c45c80642782ee361ef8098608c4517b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_gpedit.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hbaapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hbaapi.a new file mode 100644 index 0000000000000000000000000000000000000000..b2a136ce93d642ecc037efa746079be608aae764 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hbaapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hid.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hid.a new file mode 100644 index 0000000000000000000000000000000000000000..6d4b4ac3d675ff95d8b0c04874bb64aa84f7a07d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hid.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hlink.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hlink.a new file mode 100644 index 0000000000000000000000000000000000000000..45734a14f444f5a9e5337a1947e7d4a2d3f12800 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hlink.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hrtfapo.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hrtfapo.a new file mode 100644 index 0000000000000000000000000000000000000000..745618b201c90cb682161cfdf6f8a26d3cc6742b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_hrtfapo.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_httpapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_httpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..f6030424b6af2e58780907487870c2cf8b0081c4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_httpapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iashlpr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iashlpr.a new file mode 100644 index 0000000000000000000000000000000000000000..ab56ad2f787afe2c388059d98f9d13e32d32dba6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iashlpr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icm32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icm32.a new file mode 100644 index 0000000000000000000000000000000000000000..13d1ef7d81615a9ca98f8f16f599d0f11626091f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icm32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icmui.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icmui.a new file mode 100644 index 0000000000000000000000000000000000000000..5ced197c8c22f938421d0d7fbaccfe0fa724eff9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icmui.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icuin.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icuin.a new file mode 100644 index 0000000000000000000000000000000000000000..2a9be36ef40ac1d01794a0abc5b466ffbf54c5c4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icuin.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icuuc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icuuc.a new file mode 100644 index 0000000000000000000000000000000000000000..a3b6948fb7899028261ffb520a4dea70297e599f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_icuuc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_imagehlp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_imagehlp.a new file mode 100644 index 0000000000000000000000000000000000000000..c01e369958f3316858d3183d60d5590d2914be85 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_imagehlp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_imgutil.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_imgutil.a new file mode 100644 index 0000000000000000000000000000000000000000..48437d97b4b3f47a2b7b253bc9db51d4c8659d18 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_imgutil.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_imm32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_imm32.a new file mode 100644 index 0000000000000000000000000000000000000000..d500ee5197b5e5d7f98698be8e22af547b2ef478 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_imm32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_infocardapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_infocardapi.a new file mode 100644 index 0000000000000000000000000000000000000000..6753ecccd2c733d7ff526a43d4b865606132b1d1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_infocardapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_inkobjcore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_inkobjcore.a new file mode 100644 index 0000000000000000000000000000000000000000..66cf097fee2d725ec068cce2f878b2f1bdbbf40a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_inkobjcore.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_inseng.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_inseng.a new file mode 100644 index 0000000000000000000000000000000000000000..00ec09731ad37f68979671031aef8979709d3f6f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_inseng.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iphlpapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iphlpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..eb66c6396b3293798f64df8877fd89d2d7bde6ba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iphlpapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iprop.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iprop.a new file mode 100644 index 0000000000000000000000000000000000000000..9a7ef164b57299bd4afe0ed7b42c7108cf97143f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iprop.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_irprops.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_irprops.a new file mode 100644 index 0000000000000000000000000000000000000000..20aeab6a73f85d55d6e30dc5dacb169f6b33fede Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_irprops.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iscsidsc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iscsidsc.a new file mode 100644 index 0000000000000000000000000000000000000000..d399a3c2d1c2c639e0370496ebaa3ea8a7b14881 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_iscsidsc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_jsrt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_jsrt.a new file mode 100644 index 0000000000000000000000000000000000000000..7e51deff62e03d0be817b2d072fba37431486106 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_jsrt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_kernel32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_kernel32.a new file mode 100644 index 0000000000000000000000000000000000000000..69a7f7dde954d8092c7c4996e90cd2c23af92656 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_kernel32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ksproxy.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ksproxy.a new file mode 100644 index 0000000000000000000000000000000000000000..9a4219fbfa2ae003f11baf0a8ff54b1bb170fa85 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ksproxy.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ksuser.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ksuser.a new file mode 100644 index 0000000000000000000000000000000000000000..5f0e47bd91ee429886bfdbd7dffac28d9cf8a97a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ksuser.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ktmw32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ktmw32.a new file mode 100644 index 0000000000000000000000000000000000000000..c158f8a852210cc65f28ba52c5ad58774ecf9c3f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ktmw32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_loadperf.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_loadperf.a new file mode 100644 index 0000000000000000000000000000000000000000..f8512d0d74d6a526f897a554d597e3c4a80a0ee5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_loadperf.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_lz32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_lz32.a new file mode 100644 index 0000000000000000000000000000000000000000..9b75f05303ee823e85c543e226e0fc86974f2b90 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_lz32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_magnification.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_magnification.a new file mode 100644 index 0000000000000000000000000000000000000000..7f3ecbb88c6bab6d6a3298b311c0f6447fe3690b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_magnification.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..74373c36dcb5cdb66618c3cab63b72c9505c3bb7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mciole32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mciole32.a new file mode 100644 index 0000000000000000000000000000000000000000..584e44beffbfa995feb6b17c062f5be4e3b35c48 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mciole32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a new file mode 100644 index 0000000000000000000000000000000000000000..c69ce2a289aef555de3d8dee0b9e46b8a8505a08 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmregistration.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmregistration.a new file mode 100644 index 0000000000000000000000000000000000000000..eb343162487121c4ed7ef54d73347d6a33fb4d79 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmregistration.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mf.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mf.a new file mode 100644 index 0000000000000000000000000000000000000000..01ea7a85ef7b4cafd8845b417d88076e1c2c191a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mf.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfcore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfcore.a new file mode 100644 index 0000000000000000000000000000000000000000..004e4778c22ca82495c7542d45a762af522228c0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfcore.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplat.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplat.a new file mode 100644 index 0000000000000000000000000000000000000000..b24669fe33675ec12ae67e95ba0cc308b4baa596 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplat.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplay.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplay.a new file mode 100644 index 0000000000000000000000000000000000000000..e3d553d077fa57791524ff49c55f334519e9ed9b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplay.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfreadwrite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfreadwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..23c1acba4c4c75fac66e0da9d3e4475e879d3792 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfreadwrite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a new file mode 100644 index 0000000000000000000000000000000000000000..a53cc65adea2e88586a2e5d8a3725a1d8fc70424 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a new file mode 100644 index 0000000000000000000000000000000000000000..6392a5fb69b39db96a820d7a732d137cce1bdb5d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mgmtapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mgmtapi.a new file mode 100644 index 0000000000000000000000000000000000000000..47b697df2c248d84286522f68f2df86219383ba5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mgmtapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mi.a new file mode 100644 index 0000000000000000000000000000000000000000..9591de892daea387df8bca81779c8bd36975412d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..14c7d2f05c0291cfb8e9e5a565a07c6420692b12 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b9b85dca20dfaf0edf1eb2dd8cff7e362fb77891 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..84e841ab8366e5e5409f4746e4b6f8fa2a70601f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c5512bafec54d588ad818397545e6a1f58be4dfd Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5cabc06730dea08e01d2748bd4726c2aa41e1516 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3d966f083f371565ab141cf5a91e85e3911ab56f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2a3267cf8e7f022e60c54253a1375dbbebc04000 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..aa3f0e7f5165edfe556de82238de7c8fc0a42ac9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8e90a74335e21cef139a03b821cc384ee0dfc1de Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7eb338f8d5d29d307452016c79f070ce24653ee9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..80283d9f67b5d13080d9fb4b79e9d85e28472b54 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..84a229a92683c5e8dec9ad01e105e806dd1b35b5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2b55ef4930f2316b415027e738d0e6e5d4cee397 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..a362e4b0aa14f8c18e987dff957c263c3dba3686 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..21d4b3070cfdce225a23c24b5467bb27e776d7a7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..374c29bd88b47016012587049443054ebd5754df Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5d0f55a943e96991d4ee3777c5c0dfb0ff84a6be Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..5dd1442d360c7cfc2197916d637517d1168991e6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..fe0d52b5c7a56ea5ff5d5bc2282c4fa1f609c38c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..9c30fabb52125d7a6c9a6819bf289d0959d0c147 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..eedee5e68c490bf87c560858b090bb239492c363 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..621f7181c6f82b3e14cfa9ce0bac6ef5926a15ad Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1f4f2a097e22c011f6aede719e07278611889cf9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..774a4f723b060001b7bbfc27d1e2a8a850583473 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e413b4cd6fd366d3de38b883d7a654b67a2ef88e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..721cd8900e1caa5010292420a410124477c8d4d6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..384a2bc1c336930243365f7d68f46b1060e624c3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c84610cac8ce720aa774b539e1969491e63f290f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..1ae7618cf7322027d185c4b5a96f6b27f3699d88 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..06c276ab660ba48c9f475ff116824a3095fb4406 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f0eb4fdd28dea2a7487b27af661713c34771c9ca Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..61041025a30ec4c5889dc99ffc93b40a78d0e3b9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ce95b8db92b2a40526be490a36661164d4e69384 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..37499453adf4719d1cd6723c9016c792db8f26cc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c9c88e6e5adaa37946cf80d7d843236801d1d12d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cee5059d6ed36312b466b529d3811e677155bb2c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..45dd5592a67a2da274c9967d1c385bdf5753544d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..30d1c51ebb75450d6a5ea1ea76e436e3c4df1b14 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1db1f247b93c40ef46de2b340269b7a3e3b0bc53 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c5175f361803e2a1c46691ad75a93dae01622800 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0154f3be50b4c9780751a20bdae0bbcfac5822ad Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..55126ff62acd2af7b096052b236cc3589fd3a8e5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d4e8e239c3f5c44b7fe4eb738e701fef81404224 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e50b351fd3295db7076b98c3e6e85cbb27c2ef32 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1eb53279245da6d789c3a4294ee5abedf8217f79 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..038cdfc5fed819ea259a48e8903d2cb7f73b680e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..64bd0e78e182bc8a0fb269ada73a7a8d764eecab Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..119c5fd64524d73c022ee5ffc7dc1c08c075732c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..81184f98ec4ca340dabd2e7d05095cd7d5675ec1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d0187b740d5f9cc9e2045892f5aeb3659bf814b9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..b91f642d138d9f80ebac4b1ef6ff3b6ef7b4aefa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..f87a247916e330d54585d4aa9ac0d6a08989b73c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 0000000000000000000000000000000000000000..2a231cb51fec1a9970ef15cc7895ff43c5a70eff Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..37ce0f1666455a030c0a2086464695c18f7e647d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..89d0f5f5a8dfb104766cb95d4a731c62d041553d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..be7983c01a9749d91b2dbd9b008b59e517bc6569 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..834c92ca160a4b383921a43a7b6aa8a76a588889 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..402354e60b72fdb48b35a01e71042d2279720b02 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0f0ebacfec095968b5c1e3ddda2a6158d2fa5caf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e758600b58b01ecaa7012f4e8951022eca634fe4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d672800a2268da359b2adbb7763cb92fec33eb2a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f39ad97d8b5b37c5ab8d3a63ff8af464fbee0d18 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..969522d0a2569de1f35836de32f46e01def59e58 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d204c52c3b6c2c4f2b84aaf423af7572c5ab874b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..fa97a528326d7b5f546a1f7215cb8f6a7fd6d0a9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f552d00855a95135307ade3cdd1eec6e2b713bc9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..757d311d14f739c0f23a99501443df4639c151fe Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1720dd8f6b9b93e4a86559dc6b24dc19342e78bd Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..239f3279223f56b22d925635cc50cc7ff56c9edb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..819ac5adde1ca5d3d067d2cbbd2d35b3eee79cf9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5f32d9584b8fcded4ad45291bb0f529df807a950 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..fa19448a17460e4f8c01eca86a5b1b041ebed9a7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..f01007837f3f75f289682e7b6bada1f68dfc3e10 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ec7063ec7da60e26cdd8b78a4e0c19157e23bd5e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4b09d25d9c5e87b1b2098d74fe1c8a7a76318718 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..c1424f57bf12aed1f3804a3760002d26c0453436 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..79670761b652eecf90506aff51dfd1e94bc1993d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..00bc726c3ebef1477d94dfc50a40b23cb47c309f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5afe8f7ff86a53a9ad556601f50008b5552bc6f9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7f23bddd782c9d2fd9eaf31c51193141d6d6e8f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6bd2f7e5cded00a4aa1c67a43b49d0d484fcc405 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..78ab95f2b2d73c7cdce689db071f6187f4ef2321 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..89e4916882a7d72b90a541e2af557eb6385db47e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f0eda0339d5a9c6ff4a976f02df1330c146cf3b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..01f5995f4af3c75086eb67b0ac169f5c99b9f666 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b7fe044893a7feddda0a4a9935911f6e97a8946a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..746ad4665fbdc481d85d446ad1b983bad01d15cd Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4e9f38e6bf189cebdbbd65af919db99f9b5d0d98 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..9cbc37b120b99ab01050640571ecec8ea4132839 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..c13288c2936d5d1285704fa94d5c1cad2b32a5ed Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 0000000000000000000000000000000000000000..ce77384f5e83af2655d4f0e87f828b1243e5245b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..595f4e46335bd42008c5fad49a49cc7c38ef0a14 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..98be2bcd2536b5b56b03e7ea1231e56de3113608 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4200883d80fbbcb9d77beabd8e5164f848d3d362 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9da785206ffadee300620fc92aa8e25402fce868 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1f35371710715a0ff786986b5bb6e7a6da29c882 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..425efa28e889c5c90dcf3d4d286a37bc6a01b388 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8f5ed3fd172690827c21493b61825fb8d75f5fc5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..f22c0fd55f10b8033c415b02ce55ff79230e7151 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..be6a6616165694fcaf4d91cd9813ffe20cf9feb2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ccf64b8efe7afc3a6fc9129d5d2259884c737937 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2810b8ee571c9387d51fcc9cc2dd26edf33eb4b4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b53b5eef50101164545cf34e366183e759bdd19b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..53a2fd9516ed72ee64d69c18bcf1ba21c0f9f0cb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a35e1439c9ccaf6e88f771f3fbc56c248332704c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..685f805f2811397545feee44d854d057fc382608 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3ada2fbd74ac9b5bc97d760b58eb322a4d172014 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f124666347f1efb6990534a8ffb2faa4de6b66d0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2face461e92ff1fe59bd06bd14bdd610010e223a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..a5e1060cb1e20bc3de3a8e90327cbd55d4ef1412 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b450a246a205b92c7453b858b048979279d028b3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..65da450ba527dc502c87165e99fc3b61647b2287 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..019825e968eecd6e6276e76924bf3b1ea0db21dc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c5aea923f4ba3b4d92d2c1eaf0c6b1e9ed0bc6e9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7c6a174f8b6aa7de7eb9618aa0629d39eca96b27 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..75c617016c2e118bb8832dbd1978d27a537ef19e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fb632e15f3957846434ae096cc3ad8a7b7c43b59 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3579e9ead1859ae81a5a1bc42a6d6f8912fe1993 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e677121f167e3734dc7d52d18a175709354aca71 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0c36fa5bc5e8036667ef861730243177c23ababe Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c14203cfc4dd5ea4fd564cffc7eb5318b0e40213 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1b632592892a34d69c5438bd336c1ad35b5faa07 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..32a362f362cc37382fbdc0d0820b33d61f31d9e0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ab6bd64c871a56a0620b1c1b99a76343f21495e3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..47962dbd719b93adf24cbda901521b805e06db15 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..f5e489014b0aaa1079efcff697e8eb856af29f89 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..52398c2422d8f67dffd721382cd451c77e5a2b9b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..70740248c221d59b88bc743f08425241a39643b7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d6a7109969ee5a6e86b4f773cea2c5d1bee3116a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..14e437d0f3f53e105e23c5a1a41461ee28bb3cc3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4d123f23d28c60315c42d88c707629c78de33ca1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ee666ae80181ce3de321ff2672711eaece25ff6f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7103b2c67787eb73861ec4dc42549b992cd610e6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..ad5dbab1d3f2faf70585a5d2391dc72b284fb793 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fb03fd94f35ea88416ef1af78b781a07e345613d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..422c9ba8ba48ee5b25c46a9cac6bf6657aa55a7b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f482472cc9e2381cb4a28d195af9f55602a401fb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-authz.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-authz.a new file mode 100644 index 0000000000000000000000000000000000000000..c30bf233b57494967dfb8dbcf0058e9c31dc5338 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-authz.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..96f403f617a829b6d91e601568cc9ae0494f90a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..91af31b2856ca9d82f1aeb0abbe84f92d996849c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a new file mode 100644 index 0000000000000000000000000000000000000000..0e9567819cf2a8188fe83ffe9ba5c4dd37c37b8b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a new file mode 100644 index 0000000000000000000000000000000000000000..e7dc455bcf67226177021957dcd30ea13ebf6c39 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a new file mode 100644 index 0000000000000000000000000000000000000000..83dac37e7f23565019015725ba036fdcdf700007 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a new file mode 100644 index 0000000000000000000000000000000000000000..6924427f8c7e83c0d5143c63b3d180183aeb4829 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..9071743b391af30b963fd38de314002036610d70 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a new file mode 100644 index 0000000000000000000000000000000000000000..2465dcb636181aec256a30f853de34394003b634 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a new file mode 100644 index 0000000000000000000000000000000000000000..7b0ca0b89d3adf2bce61896ff559091358d8dfa6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..4fed4d080a697077401787202e43d7a15d101428 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a new file mode 100644 index 0000000000000000000000000000000000000000..c2fbf6b065b9f14012780d1cfaecc049b912955e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mpr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mpr.a new file mode 100644 index 0000000000000000000000000000000000000000..7a5443738d5629d10120faf58f0e7af9497b7430 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mpr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..0fb20c11021cb00ef81facc111c5e7a40e7b6731 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..82ec8517087c2f9906476415b60007676a8ddb64 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-netutils.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-netutils.a new file mode 100644 index 0000000000000000000000000000000000000000..bcd80500e8e7c9525bdfd32bbddd133fd92f1de2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-netutils.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..e85bdfe4c1cd343c9f558d5d537c9bab1c826f83 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..76331925d37897e9aa9cdd32cc2a267af6b7b5c5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-samcli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-samcli.a new file mode 100644 index 0000000000000000000000000000000000000000..667f7e097b3ceef122742c2dc22adf219c60159b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-samcli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a new file mode 100644 index 0000000000000000000000000000000000000000..4038590b4a37a46f802a3a90f1a6c84f9372d2bb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a new file mode 100644 index 0000000000000000000000000000000000000000..6c9a31b3e0aa95fe7132fa4550a2eaa7c248289b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a new file mode 100644 index 0000000000000000000000000000000000000000..64a2993704b3cbf65cac8fd72444de0121f95b9b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-userenv.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-userenv.a new file mode 100644 index 0000000000000000000000000000000000000000..0252b877c49ae1dfa586ec94fa91681747313c80 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-userenv.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-websocket.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-websocket.a new file mode 100644 index 0000000000000000000000000000000000000000..854e4f45d1c0312efd899508aad5238d49341309 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-websocket.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a new file mode 100644 index 0000000000000000000000000000000000000000..4b4125e2af24bd907538f491c10b7202501d12e0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a new file mode 100644 index 0000000000000000000000000000000000000000..86898941e7d38b9daca3628c9347ae5fd25133a2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a new file mode 100644 index 0000000000000000000000000000000000000000..9a2fcaf80e7f42950e913e1a03ba6c0392e97b16 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..cb75167787e0d050ff0cc3cc816d6a11e2665b92 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore.a new file mode 100644 index 0000000000000000000000000000000000000000..1d283d8ab23d3886430e472a104758acb4395104 --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore.a @@ -0,0 +1,167 @@ +INPUT( +libwinapi_mincore-dfscli.a +libwinapi_mincore-api-ms-win-core-version-l1-1-1.a +libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a +libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a +libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a +libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a +libwinapi_mincore-api-ms-win-service-management-l2-1-0.a +libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a +libwinapi_mincore-ncrypt.a +libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a +libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a +libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a +libwinapi_mincore-api-ms-win-core-io-l1-1-0.a +libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a +libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a +libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a +libwinapi_mincore-dsparse.a +libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a +libwinapi_mincore-cabinet.a +libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a +libwinapi_mincore-api-ms-win-core-string-l1-1-0.a +libwinapi_mincore-wldap32.a +libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a +libwinapi_mincore-api-ms-win-core-file-l1-2-0.a +libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a +libwinapi_mincore-websocket.a +libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a +libwinapi_mincore-api-ms-win-core-string-l2-1-0.a +libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a +libwinapi_mincore-api-ms-win-core-file-l1-2-1.a +libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a +libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a +libwinapi_mincore-api-ms-win-core-path-l1-1-0.a +libwinapi_mincore-dsrole.a +libwinapi_mincore-api-ms-win-core-job-l1-1-0.a +libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a +libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a +libwinapi_mincore-api-ms-win-core-string-l2-1-1.a +libwinapi_mincore-api-ms-win-core-io-l1-1-1.a +libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a +libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a +libwinapi_mincore-api-ms-win-power-base-l1-1-0.a +libwinapi_mincore-api-ms-win-service-core-l1-1-1.a +libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a +libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a +libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a +libwinapi_mincore-api-ms-win-core-file-l1-2-2.a +libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a +libwinapi_mincore-sspicli.a +libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a +libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a +libwinapi_mincore-api-ms-win-security-base-l1-2-1.a +libwinapi_mincore-wkscli.a +libwinapi_mincore-logoncli.a +libwinapi_mincore-netutils.a +libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a +libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a +libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a +libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a +libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a +libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a +libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a +libwinapi_mincore-api-ms-win-core-version-l1-1-0.a +libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a +libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a +libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a +libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a +libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a +libwinapi_mincore-api-ms-win-security-base-l1-2-0.a +libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a +libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a +libwinapi_mincore-userenv.a +libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a +libwinapi_mincore-ws2_32.a +libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a +libwinapi_mincore-mpr.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a +libwinapi_mincore-api-ms-win-core-file-l2-1-2.a +libwinapi_mincore-api-ms-win-security-base-l1-1-0.a +libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a +libwinapi_mincore-api-ms-win-core-file-l2-1-0.a +libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a +libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a +libwinapi_mincore-samcli.a +libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a +libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a +libwinapi_mincore-api-ms-win-service-core-l1-1-2.a +libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a +libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a +libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a +libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a +libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a +libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a +libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a +libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a +libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a +libwinapi_mincore-api-ms-win-service-core-l1-1-0.a +libwinapi_mincore-iphlpapi.a +libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a +libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a +libwinapi_mincore-api-ms-win-core-file-l2-1-1.a +libwinapi_mincore-authz.a +libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a +libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a +libwinapi_mincore-dnsapi.a +libwinapi_mincore-api-ms-win-service-management-l1-1-0.a +libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a +libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a +libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a +libwinapi_mincore-api-ms-win-core-util-l1-1-1.a +libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a +libwinapi_mincore-api-ms-win-core-file-l2-1-3.a +libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a +libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a +libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a +libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a +libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a +libwinapi_mincore-api-ms-win-core-console-l1-1-0.a +libwinapi_mincore-api-ms-win-core-util-l1-1-0.a +libwinapi_mincore-cryptbase.a +libwinapi_mincore-mswsock.a +libwinapi_mincore-api-ms-win-core-com-l1-1-1.a +libwinapi_mincore-schedcli.a +libwinapi_mincore-winhttp.a +libwinapi_mincore-bcrypt.a +libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a +libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a +libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a +libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a +libwinapi_mincore-cryptnet.a +libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a +libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a +libwinapi_mincore-crypt32.a +libwinapi_mincore-api-ms-win-security-base-l1-2-2.a +libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a +libwinapi_mincore-api-ms-win-core-file-l1-1-0.a +libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a +libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a +libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a +libwinapi_mincore-srvcli.a +libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a +libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a +libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a +libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a +libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a +libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a +libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a +libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a +libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a +libwinapi_mincore-api-ms-win-core-com-l1-1-2.a +libwinapi_mincore-oleaut32.a +libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a +libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a +libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a +libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a +libwinapi_mincore-api-ms-win-core-com-l1-1-0.a +libwinapi_mincore-api-ms-win-core-console-l2-1-0.a +libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a +libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a +libwinapi_mincore-rpcrt4.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7c2897d37c4e1a67116f8c348bf03beafbc51657 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0894bd9e32613f2d8eca992a51cb2ed1b8c98193 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d683aa686cad4e5622305b4e3baa3acd1a6db688 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..05893305799077bb0a6d31a001f063cd6e066552 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6640c943de4858b2f35c4862a4805852aa83faf7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d72679f186fed581cad0a8b4c90fdd45a89ca7db Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..33cff853c506664d1cde9c3d84831944235ca571 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c5a94c910186239e5d47762b3b72827357df4467 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3507ea348834d038187ab9d37a62b4b4a2e2714a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel.a new file mode 100644 index 0000000000000000000000000000000000000000..9b663e34cdb49627058f30d5c011104686f34ae1 --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel.a @@ -0,0 +1,11 @@ +INPUT( +libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mmdevapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mmdevapi.a new file mode 100644 index 0000000000000000000000000000000000000000..a4f7bbdd35e3e236814ca9d5c7d0c38b27c6e7f9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mmdevapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mpr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mpr.a new file mode 100644 index 0000000000000000000000000000000000000000..5c41254a8dbcf6fefdcb10b980fdce3fe527a8f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mpr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mprapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mprapi.a new file mode 100644 index 0000000000000000000000000000000000000000..f343e2a572210550ec6fed7cf9c14105975a4bc5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mprapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mprsnap.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mprsnap.a new file mode 100644 index 0000000000000000000000000000000000000000..34f2f4cdcaea356c0eade17c903bdc05cad83315 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mprsnap.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mqrt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mqrt.a new file mode 100644 index 0000000000000000000000000000000000000000..f3b36dc8c12c1008c19ed9751a25071ca4664041 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mqrt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mrmsupport.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mrmsupport.a new file mode 100644 index 0000000000000000000000000000000000000000..d3318cbcf8264959e24723b00280354d85d27bd8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mrmsupport.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msacm32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msacm32.a new file mode 100644 index 0000000000000000000000000000000000000000..71095a966c3b8baed80ad68f412d213889c70824 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msacm32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msajapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msajapi.a new file mode 100644 index 0000000000000000000000000000000000000000..65d2c66d90315ee1edb696b494b4eab32708c592 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msajapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mscms.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mscms.a new file mode 100644 index 0000000000000000000000000000000000000000..ed61a87eed250e9e5972bbe159ecc273555db166 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mscms.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msctfmonitor.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msctfmonitor.a new file mode 100644 index 0000000000000000000000000000000000000000..d033b00a4c0b3fcc02d1f62fdccbfca49799aa0f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msctfmonitor.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msdelta.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msdelta.a new file mode 100644 index 0000000000000000000000000000000000000000..0f2648c61051915fa2933510404739ddfc121629 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msdelta.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msdmo.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msdmo.a new file mode 100644 index 0000000000000000000000000000000000000000..27d746e7cce53f2c79fafcf83d8ea0251f0de57a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msdmo.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msdrm.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msdrm.a new file mode 100644 index 0000000000000000000000000000000000000000..ab8eab3ff70313d491ce23f2221789f31c7ad00c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msdrm.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msi.a new file mode 100644 index 0000000000000000000000000000000000000000..84945d2e030ee80f0c256b94bde738b5b45ffef1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msimg32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msimg32.a new file mode 100644 index 0000000000000000000000000000000000000000..dddd689016a5ed8ea003d7ce96afb657597f419b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msimg32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatcha.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatcha.a new file mode 100644 index 0000000000000000000000000000000000000000..a98c3198d4951dd869157502170289a5987ef686 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatcha.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatchc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatchc.a new file mode 100644 index 0000000000000000000000000000000000000000..d3b4abe51416385d68be4a02fa0a8fa87fcc6d78 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatchc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msports.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msports.a new file mode 100644 index 0000000000000000000000000000000000000000..22712892fcdeccbba909e49f44c8ebbd1e19b2fe Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msports.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msrating.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msrating.a new file mode 100644 index 0000000000000000000000000000000000000000..4f0538f0f0124bfb16a1d772749b0e0c877715af Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msrating.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mstask.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mstask.a new file mode 100644 index 0000000000000000000000000000000000000000..aa60fc90ee625564d668dcf12d7dd5d316158da3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mstask.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msv1_0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msv1_0.a new file mode 100644 index 0000000000000000000000000000000000000000..a3942de6728a82cb53db64a5e3828644b440ee7c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msv1_0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msvfw32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msvfw32.a new file mode 100644 index 0000000000000000000000000000000000000000..af8b929d4fce980ed33fd7a9eb1bb5ef61b5daff Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_msvfw32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mswsock.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..ce52ad2ea49580a01bb086cce704b460309becc7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mswsock.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mtx.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mtx.a new file mode 100644 index 0000000000000000000000000000000000000000..d882f20ccdac8b6c755d1f15a3d37f5349cf1b4b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mtx.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mtxdm.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mtxdm.a new file mode 100644 index 0000000000000000000000000000000000000000..a2e9d8310fd7ffb3ce504eefd91493eaab7f1b37 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_mtxdm.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ncrypt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ncrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..7fc769ea0f2aa6725a1395f0df9ac6c4cce16c94 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ncrypt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_nddeapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_nddeapi.a new file mode 100644 index 0000000000000000000000000000000000000000..342763b351f49250e7eb11cb68354e6c9df5fe89 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_nddeapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ndfapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ndfapi.a new file mode 100644 index 0000000000000000000000000000000000000000..84cb302d831d9868278148788cbc741aaa6ad8b2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ndfapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_netapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_netapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..c91114872780bef3776e4c688e171cd07166f532 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_netapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_netsh.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_netsh.a new file mode 100644 index 0000000000000000000000000000000000000000..7d61716456c39068ab6f47fe0debdd397aeb1af7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_netsh.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_newdev.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_newdev.a new file mode 100644 index 0000000000000000000000000000000000000000..ab8c3876d0643da039ff82e7e45db516258ee61b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_newdev.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ninput.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ninput.a new file mode 100644 index 0000000000000000000000000000000000000000..59c4f6dce193e49e681008ef22390bdb1634a2fb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ninput.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_normaliz.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_normaliz.a new file mode 100644 index 0000000000000000000000000000000000000000..1d94079c7b171b02aeb924f472889c858200ce9b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_normaliz.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdll.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdll.a new file mode 100644 index 0000000000000000000000000000000000000000..80e70862c1f192413f623cd0c9a1adaa13ff3560 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdll.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsa.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsa.a new file mode 100644 index 0000000000000000000000000000000000000000..49ca435fde528ee83e5f84f453d8f2ba69ce8fbe Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsa.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..0680ac294c369cbd54e706ba2bf1ddd93cabfdf5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsatq.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsatq.a new file mode 100644 index 0000000000000000000000000000000000000000..6693dddc4c1bd964f132940f15a33a5a2d2616a2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsatq.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsetup.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsetup.a new file mode 100644 index 0000000000000000000000000000000000000000..cd7ec600320dce8175b6f1f08442bfeadd9356d9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsetup.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntfrsapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntfrsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..c7e9963ab530bdffa6b34c1253d647660294deeb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntfrsapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntlanman.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntlanman.a new file mode 100644 index 0000000000000000000000000000000000000000..edc6cc8fec4739aa3105c0a54f1788a87b90bdce Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntlanman.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntmarta.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntmarta.a new file mode 100644 index 0000000000000000000000000000000000000000..4ae7a31b0d44021e51685dd1cdaa81bd0071275b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntmarta.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntquery.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntquery.a new file mode 100644 index 0000000000000000000000000000000000000000..4d3de9e5619984dbe94b52cd36c035d386c03d60 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntquery.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntvdm.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntvdm.a new file mode 100644 index 0000000000000000000000000000000000000000..3e89f0401d9d006408c12fab3c902722c43f9dc5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ntvdm.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_odbc32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_odbc32.a new file mode 100644 index 0000000000000000000000000000000000000000..fd23646fdfdc46d4eacd47a1a1a773a070f98d7b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_odbc32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_odbcbcp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_odbcbcp.a new file mode 100644 index 0000000000000000000000000000000000000000..757bfe6d44466eceb3a7d649e4c4bf9bbe531635 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_odbcbcp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oemlicense.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oemlicense.a new file mode 100644 index 0000000000000000000000000000000000000000..b4fa945dcaf6989c89e1c1400b1b4d3a28602d13 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oemlicense.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ole32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ole32.a new file mode 100644 index 0000000000000000000000000000000000000000..d67b9e39e1afba4ecc6b7da627f7701eca37428b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ole32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oleacc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oleacc.a new file mode 100644 index 0000000000000000000000000000000000000000..7798bcc462f9b3d759a22492a7cf2c20867617ef Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oleacc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oleaut32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..c4ca15d878c17483f62c0f415ae01c193d8a5b91 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_olecli32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_olecli32.a new file mode 100644 index 0000000000000000000000000000000000000000..df0134c6478e9d8bf02362ae69a8bba8ecff18cb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_olecli32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oledlg.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oledlg.a new file mode 100644 index 0000000000000000000000000000000000000000..13ede5e8df4bb6bfd445cad98c4572e99d1625fb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_oledlg.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_olepro32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_olepro32.a new file mode 100644 index 0000000000000000000000000000000000000000..0d72e0a52370c79711baebfdd0286d0a8d368b5b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_olepro32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_olesvr32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_olesvr32.a new file mode 100644 index 0000000000000000000000000000000000000000..1a7bcc670898f760654b3f3e930b906bfd474f04 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_olesvr32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a new file mode 100644 index 0000000000000000000000000000000000000000..9bc7f4100a1790025f5c14299b1854934c6c2fa2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c2c4ee8637ac08ddbe44512d25276301c932c384 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7c61e51282c9c587612c16ccf4a4b528fda59d3e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2db53c20b807b757d914c98b354de5bb3f84f6d4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2ed3791a4f2a32d627bfe3c0e1e75aff7959baa8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..8c3b0a557114c567a34e1a88dc7c35972e3a5d03 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a44583d61a936e39a0ad09a886c1985a3424474b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..debbd8786e013d1670e64678cf53af27a45acd4b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..6173eda17c3af293b6f61a7bbd8a2880f894c0f0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ccfb05faf3add7ac2f4672d9cd754709760ac7f3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..513c3910d075e13f697c97b455dc160c0f8cb845 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b855681d62d98dc871e1150fb03b8209f237966d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..17292db496cfbf0b89e0e0aa27be0ce14f389fda Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..259340a26570cf96eca00805243320598b4dd794 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e975367e5a03d82e4f4a979386d61144b8d6bb5a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..8f6cf0ba1fa972772dd6c034f5aeb0be6fb52d4f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..661692ef29492f14858a63372e915b67e193adea Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..42e2427a68c36b91e8c2b50fde6d9b794cd815d1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d07ed0385d557bb47ec119f6d353ecf1158915eb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..65ddcb5f27e1df3d2003d613bcb005b020249c6a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ff137d7b59c9dc859e16e9bf0a7288e5ec1569a5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6fb51251fac76256bad29fe9bd246d4d3c649acc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..99e1e1390bfb55766005d2aa899b0a097b8cf84a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7ec7faea8c51f1810a91a17ebee0230e18f6d56a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..fddd28338079ca8933ee89087e95d7cac1939385 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..be10c872c93bce4185f69e6c8da31dc2a741914e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..58b13cfc370211fa72f3b1471401bfcd1f7719c4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d16ed5bd0820c012e3eff7b784aa51936700fc2f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b8f32c9bfa1c4295041b579bb1e909e81de40caf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6a7be5ce7ed6287c22703d0669cecd4d30c37afc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..6e4bd974bc2729712d5dfeb5e51d1caf42538441 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0ec0998b4bfa37484f1499b2e6524d67a0199300 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7b2318df293cb5dcfb604c2712a6f94ac5a30044 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..81cbf56a6ec1b4d97b47e42d4b601552f392d886 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1a28c1143d75f5da0f946be647d54b5ae340803e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3e154d8318e9be69ad0bafbde8ca19f250b536d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..09521783072d57a18f4a5db8fde1de1ed3e3fc2d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..30c22b8390f06c1bc28b430cc5ff4e6881ac78da Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..41c50e019d03656c80e34d11dc8de0cd7a25e83a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..46ee4004faff6a5ff8019e247a8b0517f3d29ac3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..6e9102c94569dd27df999147d3a7cc9fb68041f9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..85ccdbd544d9e4d88701b89419583652b394d087 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..fed64c7d8548e50d81dc1b2369d7709a7b2aaa46 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6eba74957483d7da5b6cc522fab837aa9355119e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cf11e4367fa96cee74ddb4d9426dd3b086a0c539 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fbb77981a413c7b6eb8230990892dba0b2c330ed Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..06c17f99bd12710d905ead73c2efe2362795d158 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4583e29c4a0252a7bc6d95e5e5501be080366759 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c12dcbc002bfa72b42c7a330bc2222f919ac5148 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..147347f5b8391f4d17ff85bf2fba4935d7f9c239 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cb1ba6ef63552b3c0fae03b73e10419d8a1cbaf8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..475dabda2e2a9df7f46200d48a65ba6bf15585e5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2283c4922fbb2fc1dc5d0a109ffcc90ddf0af518 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9df1ae4bca8864ca45a6be015664280520d3708c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..28001702d2c94fd0a650b417e8e16ad0411a7b0d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f68f9455cbeee9eff1eb7e746223174e40f4f913 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..99829cd76252bd26f04f7e3dd4b209846520031c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..fa8f4ca0bf3ec87218b59f0f41488cb0aa07d778 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3684462ca91026cb95e7dfa2e809a63f4a6b9992 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..f6b9b1f5c194512630047d0a9c9d8c67beeea1b9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..5bd0df1ae5aa842b98428e4426f03df8d645f46f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a new file mode 100644 index 0000000000000000000000000000000000000000..f92da9abbd56599cbb8cd832669e12acf5ed2e59 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a new file mode 100644 index 0000000000000000000000000000000000000000..b6a285639c767b5ca58b10141e9413552ba62117 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..27329df3908ec1b1fe5ed3c3bd10e532b44c5243 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..eef9876c6569ee3b3cf938816482559aba42992d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1e80258dfad0334b0ffd289b9bf61a530d7686c3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..4d3d079bf4ff8f80239decf80246b4d1d16be231 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..91f3c84969362716556960d400fb326adf0905de Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..26ce43343b35e75d928668a285a6818487214f23 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9a14a0dd33b171854dbbc2ffea885362ab9f3b76 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..83379f201b242d9ce1d9ea597ee18b7125f10067 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..fa02d66760adf2255ff6b34028fb28944c953e82 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ea220e5c4d20b41e3472e8c2eb72c1969e73071f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..87596ba4cc93abd94fdfd4814346b93452ac7d76 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..eca5a6d28057042a09262ba623e051269c90f866 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2b38223f0b97825a682fdeaf27d8743aa8d3632a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d5eff90e1d0b6c9b5dcb314a2d61431e0ca824e5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..b15224b8ae40ff7c7b79cb188299cfc7ae70dc42 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..13f8dac0703cf360de1752f9f3211a1999280365 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 0000000000000000000000000000000000000000..aacbef783e29960bb5286e1538eab7eb8a2ff8d7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5856a2d3b5e844b23feb20f81fb2ba2b81cd1922 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..cce807e74fac50b338c1cadd3f074d0998c4a7a7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..80ed8f754b5d0ce1f24e38b97705142d576c52b3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1f3847f9bebb92b1c078c0eacee4fd84404c84aa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..fbb9ae5789f2722db81b6fd66f74a6b6a973c83e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bb3a894b2d3c19930064af486ce543e01df53e75 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..37c928673475c77f269413a38d2368bb4ab728fb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..73467bfa1f02396fe1700afc8a3b77f24f322847 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d5ec99bc4af7c8ef15b6a0d75b838e30f6e66078 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bd95a8eda0e29bda33d006ecc00dbd211d6d3fad Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c315b803d3e6a3cf0211c88ac266d3a4622cb818 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e9ad789a58cfbe6458e37bcbb87a1b02422cb020 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..194897fb8a417ddc638b7ebbd3b595a03b4508b4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f9b92406ea3e2637ebd08be0b00c2befeff78664 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d76446293fa87397f252d983e3e1e3907536f5b4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1ce0f27d5b3ae7dd97d398c52ff9af63a523e49a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7cc0145890f4063b4de7cee823f1c7c63749af29 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..380b17d93be98f2855953111a110d71cb55c689a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..f83978449c1e2c46c1514d12dad6dca0836f8213 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..8184fdb9c7230c0d90a72403058fb1f11deb05d5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..adacab8850ea0e3a76f1cc9f181c5cc7ec56bcc4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..286451797c3f1367ed7c3d57488108616006a8b3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..bd182134435d7b62fd74aef4ad5ad46a2fd69468 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bf3ec6561186a82f13f613a27cb15a464a02dc52 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2fa6889764c972a2cf9e3e6e8875bfa0f12a0aa1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..921994074f621523942bd60e0d589cf7800c118c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..01cbecd49d21616e1fd6c5997e8c5a42b2617859 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1004cc7d377149a65f0317e8757abcfc3ad41324 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d57a76262867026df4379fce518501e00fd59b0b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..50bd71bd4fdbf2b62a1c9b01b27f7daab6ee664f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d0681f4140d5993ad5e87db32ecedf5353f015ba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6aa4e5e42548f9a0a3fc99455968360d63a8a2d8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..d498e105a4c4a9f7031d0e19be70241459c0c02e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..2220e0b5b11b703fc0fabab4d5af390ea9f3c1d8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ef780e1449684a88b109d666a0ff475226da1d97 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b8ebe48e5d7b8ec89bffe419e7cc968716db032d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..90f300e88a4ce039191d572e4b0b25a4653a920c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6ce9bfe0baccab2bca02d9543409d95bacdf9e7a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..689a9477b9e53d47ccfb10723f2fc01b741b8172 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..f38473fe3c2912eaf7148965533d7c6a6d54ca33 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..be660824cd6b0d4ce87fa75c8940b28441100c2b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..81d1d55637e2cfa6019ac3146f8c9f6b7c148472 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b7f3b32b1b476c4ccaff6bbfc5072ef8295dbaa0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3ac0d3ef578899a3ea5cabd7aa37882404842c66 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..802f6ab850c8a482da75fd3a007b0d593f567dbd Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6f976165bfb016bbeb3341da7d7cc1bc28180a03 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8575b1785407c5c50350e7a9cdd376af44d5083b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0cb8c5b16ae84694ba3ae8100c3d6d31aa4a4c57 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..81eb6fffaff7ef05f1aebee038c75963a52ebead Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9f7c44bcb0ed8dfb448d6de06e3da2dd5c31e45f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ddf3657f74d3b4bcc1ccc1e5f49983953f0ad900 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8869781315ac2d6e6fcc54d7cdc53a3fd91e5975 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9502df40039eb380a015f08f9f5683e1b06de710 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..32bc9b527da0dec58963c849db23e37ac8be2979 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..f7d3a71d84b36d2ddf33c942e63227ad009d2c88 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..96b44badac0332952f24ea76bd5daaaafe560707 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 0000000000000000000000000000000000000000..0bcca4577f6c91aaa5fdbe0f35f2faddf96bbb27 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0b9b3448c6c0f26950fe54fced088e2947c3c28f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ae2704a570d20835bfd80f5fad9aea80fffd1f53 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1e776e60748d74b03ae0e182b00b679d21a12e7d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..072823889f45663c697d8b9238f1c26f9c238c99 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cc8d2d1cd53afb64f1d14e1bdd4f200532704774 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b850a71b25eab5f1326f49f9d5879321e0e715cc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..5be0ae24e258e4a462ae29e78c6403d515e55a78 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4fe81e60b14e001d1ef9d39b32b9518a16a4f253 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8540db9911dfe8d6e7783b3e19ee13fdae1daa5f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4776cf04f3be175d96f1828497c038e65d8e121c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..42e9fc7a17e7019d0fbf8ea20dacf3fd6e68c300 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..cae8f2b4c560cc13c01d7bd0aaf28d3587b2b42b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..66013bb97088dbb377dc3e71d091457d0eca54f4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..d75ae32c67471ce146a13c6222693bfd54d13f83 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e7bf92dddf13f127eb5628d1c9e9b0d90ee3edd7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c1d76108fbd6582f7729e2d5e3811dc9b872f8c2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..02beef3066ca680e5939894f24638906e583f042 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..187c36d47b2f2b700d1beb89ec6a2d3390da3248 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5241405ac5abf82cee77763a27e3cc642ef5d853 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..36a836890c5baa9d3802eca3df6c08fb71f7fc40 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e04d55aa2f1e2c222e7e055f067ee007571b08df Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..58090362f5704d9f065bc1199a047216b4a2d324 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4e2fc98d48caf93a3d2ec72afbfa783e6bb3023e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..87546a3b083501978220dcf840bc48d5ab82257c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0a0efd3f77370fe41e5ceea5b71fb0060aa745de Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c4b1b7ad1e7922d2153817c1695984bcb6dfb22c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..83383b567498c9c6059f5a64b28e33bee4ec677b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..9df889c2af68bc4628ed3be48ee7e6a3c187e5f0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..2a7c92564cff71197f50474e228050bd9daa19f8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0fadeb8773c753ef61432bd941684956d20edc9c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1d7150d50bea8d1edfcb718841eac84f7ac10ccc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..6d2cc7f7c148793c9852092d27af6321955baacb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..dbd9b16c1dfc2df551fc20712fe92339d2d48229 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..48f2bfc3bffad49896c1c5acc0e17a61235e8b41 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..295bd58531b218c17ed36c1aeaa430f31e5fe3f2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..864abc42fe03fb9a212c97e7f675e2a363b969a1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c264aa5e4b29616402c733b879d16d79ada4c062 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ea213e681fd2181c3e64b611543a3d1119213927 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4d50887bb672f867021a4e97ec40c0ae2af4c509 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3b1c82dad9b6093351fffc01d13f5fdca7978089 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..71e1e7830470742ab0728f7747e5491f78a13368 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e60e2ca8a7ec1d5585a55452e0abfbcc22037147 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fc97f88cc08fb9540342310b28e8ad88ef89942f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..96300ac191c2cfd4c1078fdfa9d968917919b3f5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ad8d94c9b008cff565f59ecd197c2c5a54b9255c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1f6c661ccced8cb3413b28cde121fa84816b5692 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4984baf6e87a4c1efe5b5d97329fea46319d2a35 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4a63543fe03492b84b23f3c6a95edaa24014927a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..15a75769b282763e5f5217558a8cdfb12d0be8b5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..78fe45c0bc30e68627b3dbe92ca669f0ad25b364 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b72174dad55fdd5d8c0ad17ed9ef14ca95f203c9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7479dcbd0717e5e40cf3fd7342afee94f951da66 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5ff5c77f86cecbea7f6cca11c5105a50bc9a54cf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..01ca929ef8e4d2bcebf1dce265f1cd2ee413fbd7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0b8c4544032c72cc637b54f92f32d05de48764f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..1456aa2537a7b79b052efefda9f18c14ba34f372 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fea42bc5bd71cba51fc36cb393baf4ef02a82ed7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..05bc54f5874cd0e9feb1938f84ce807168c9d4df Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a40304e8360e210cb2dc83c82ac359f099bd20d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c7d2ac5a9adbfd2235b36228eb1fc2ba58e4e61c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ff570a4eeac5e80e2ed1d54a1a7380bfc106af38 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..70171ff3da77706f4fac1912fc5a325194eb8c2c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..130a97ad31a23b3389bf6c83b32c83b3ad3e36a7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..44769ba8c2c507b43717491d16c2e17f5f5ab1ee Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..71abeae0d6ae1afd45af0848267b6bf8f0781499 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c76980ea01c0f2189d23f21857c2ecb682134d85 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fb1ecf99cfe96871745d43ea3d4748fb53857ebf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2bf98a222a2cab19dc7cab57976c4fa5435798be Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8617b78cbee5cf45b37705a89f989103b9ca9917 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..51823b6aa2faf3268f2180481dbf3c4278afb8e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..31cc7bda9c85f68894927df35d63873a4515da55 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..08da8f9092fcce13c5dfa2149dfbcc90e12e11fa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..26e05950bd02b4d83c2475e23767f25a419b7915 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..627d39a12ffea0da6a312aa2d37ac4c8590adc64 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1565aec048a483d68caec9a471f347ca798d21be Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a52709c381e33641bb7ff60e9d33e7ca686f58eb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8640562d97de313b7ad406ce03f9a3a6e43dec75 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..21a7b25225b0fc6f4f90a29e08b3b90be0a7b3a9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..060bb7e575a5d28379347c243f7e47cee5844d96 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..16b4cfae025c8edd409bd5668992676f47dbc12b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..241fe8a03a4e7f98830160a2adb09804572adcef Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..090a76741b5d00763656be679181eba549f081e2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8ffbed652bb601362288f2cc53ee067f12059303 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..85b89e511c1d51da048900d6650d86f368ec7ea4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e5cc513f6f784017f0723f8714fefcdac9f040ba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-authz.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-authz.a new file mode 100644 index 0000000000000000000000000000000000000000..dc567b93f283c25bb02df48a00affe830b89907f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-authz.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..342fb81145cbf350ca1e94980174b9cd78dfe0cd Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..6bdc6f73c794850feeb92a54d0e880e21008ff74 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a new file mode 100644 index 0000000000000000000000000000000000000000..969e65c1f3fb0749a3a6e11dba2b65cda037fcc0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a new file mode 100644 index 0000000000000000000000000000000000000000..6ac75f375f7e8bd1faf917a6c4dcb54e548131a1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a new file mode 100644 index 0000000000000000000000000000000000000000..6902bb9d97322073ec1a73a24bcd74803512335f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a new file mode 100644 index 0000000000000000000000000000000000000000..21032cbf0d31253c8263ea33ce000b76198a4619 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..1790b3282ffcf2d7ea1714160e3def6a51044a5a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a new file mode 100644 index 0000000000000000000000000000000000000000..7f3c47304558d2a59fec5b2b8f0f6758c346d0e0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a new file mode 100644 index 0000000000000000000000000000000000000000..9a47f7322f62d4264f3e396045cd7353ab573a2b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a new file mode 100644 index 0000000000000000000000000000000000000000..64acccbc1760c6c89cbb40766d1ac3bbd5f81066 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..4a4d3810ed0fcf855e2c4562f13273d5f436c310 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a new file mode 100644 index 0000000000000000000000000000000000000000..f1bedd2be9a40b143d5624bf92052b9330f9a8aa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mpr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mpr.a new file mode 100644 index 0000000000000000000000000000000000000000..5eedf3e29c12c2bff9ffd5a19ce80943c356295c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mpr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..9628c6ecff366f0b7bb5e70ac03133453e150f99 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..8c3ce43fea0080a4dcc3ec98e2daf96f08afcb2c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-netutils.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-netutils.a new file mode 100644 index 0000000000000000000000000000000000000000..507b4265f36dcab5407b8bc7f8415ea711493b05 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-netutils.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a new file mode 100644 index 0000000000000000000000000000000000000000..80bb8a3ed1bf3cd16e016940e1819f7b0c52ef06 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..0826152908524976e6c530a14fcec54d7c214da1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a new file mode 100644 index 0000000000000000000000000000000000000000..a3c11c7111be999ec511b368ce6fe3d23aa0158a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-profapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-profapi.a new file mode 100644 index 0000000000000000000000000000000000000000..9c1963abacab967b823cdc199c13b16b413cef17 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-profapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..d31ddcf535a122b0b9180bb8630059e7650c087e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-samcli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-samcli.a new file mode 100644 index 0000000000000000000000000000000000000000..a152c1c94307a01fef5f73fa9547eb9d3cdbf9a2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-samcli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a new file mode 100644 index 0000000000000000000000000000000000000000..3710a6c20ce80e5ebefd1c8d440f2c59f3bbe7a8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a new file mode 100644 index 0000000000000000000000000000000000000000..22fedc088a992427b36b6505507866a72f38ad8c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a new file mode 100644 index 0000000000000000000000000000000000000000..0a757d80e4ee93fcbcaa910cd3c1e14f67702bd3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a new file mode 100644 index 0000000000000000000000000000000000000000..cb011b9b39b2a739c8b63b4687c6f65f2d62203f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-userenv.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-userenv.a new file mode 100644 index 0000000000000000000000000000000000000000..e7380827c0cdaa7dbdf43167ceb23b629a3d680b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-userenv.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-websocket.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-websocket.a new file mode 100644 index 0000000000000000000000000000000000000000..7132ea0e9f7e2176ecf95d15b6f5df5c8dcde7ee Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-websocket.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a new file mode 100644 index 0000000000000000000000000000000000000000..9663971cb8fd71f09b5f4066bcd3b8ee0a977b98 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a new file mode 100644 index 0000000000000000000000000000000000000000..c81dae91f1a67086cbbc34e339dec24d701d0260 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a new file mode 100644 index 0000000000000000000000000000000000000000..4204b029d10cec3b569be39f187de76f5dabe4a4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..dd6afac38a0dc6c3c9523f396951e7e2ac73d5ef Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a new file mode 100644 index 0000000000000000000000000000000000000000..11a809b47b96fe3731e56fc0dfab50b1c868baa8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore.a new file mode 100644 index 0000000000000000000000000000000000000000..c3ad6036b0cec41ad103e2d5807e1e5e59da91ee --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore.a @@ -0,0 +1,257 @@ +INPUT( +libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a +libwinapi_onecore-dsparse.a +libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a +libwinapi_onecore-api-ms-win-service-core-l1-1-1.a +libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a +libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a +libwinapi_onecore-netutils.a +libwinapi_onecore-profapi.a +libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a +libwinapi_onecore-sspicli.a +libwinapi_onecore-websocket.a +libwinapi_onecore-api-ms-win-power-base-l1-1-0.a +libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a +libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a +libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a +libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a +libwinapi_onecore-rpcrt4.a +libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a +libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-console-l1-1-0.a +libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a +libwinapi_onecore-mswsock.a +libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a +libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a +libwinapi_onecore-api-ms-win-core-version-l1-1-1.a +libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a +libwinapi_onecore-dsrole.a +libwinapi_onecore-schedcli.a +libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a +libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a +libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a +libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a +libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a +libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a +libwinapi_onecore-api-ms-win-core-com-l1-1-1.a +libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a +libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a +libwinapi_onecore-api-ms-win-service-management-l1-1-0.a +libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a +libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a +libwinapi_onecore-api-ms-win-security-base-l1-2-2.a +libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a +libwinapi_onecore-api-ms-win-security-base-l1-2-0.a +libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a +libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a +libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a +libwinapi_onecore-api-ms-win-core-file-l2-1-0.a +libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a +libwinapi_onecore-fltlib.a +libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a +libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a +libwinapi_onecore-winhttp.a +libwinapi_onecore-api-ms-win-core-file-l1-2-2.a +libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a +libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a +libwinapi_onecore-tokenbinding.a +libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a +libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a +libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a +libwinapi_onecore-srvcli.a +libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a +libwinapi_onecore-api-ms-win-core-console-l2-1-0.a +libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a +libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a +libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a +libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a +libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a +libwinapi_onecore-logoncli.a +libwinapi_onecore-api-ms-win-core-path-l1-1-0.a +libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a +libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a +libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a +libwinapi_onecore-api-ms-win-core-com-l1-1-2.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a +libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a +libwinapi_onecore-api-ms-win-service-core-l1-1-0.a +libwinapi_onecore-wldap32.a +libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a +libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a +libwinapi_onecore-api-ms-win-core-url-l1-1-0.a +libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a +libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a +libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a +libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a +libwinapi_onecore-iphlpapi.a +libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-util-l1-1-0.a +libwinapi_onecore-api-ms-win-core-job-l2-1-1.a +libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a +libwinapi_onecore-ws2_32.a +libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a +libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a +libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a +libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a +libwinapi_onecore-api-ms-win-core-file-l1-1-0.a +libwinapi_onecore-bcrypt.a +libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a +libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-console-l3-1-0.a +libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a +libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a +libwinapi_onecore-cabinet.a +libwinapi_onecore-api-ms-win-core-string-l1-1-0.a +libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a +libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a +libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a +libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a +libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a +libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a +libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a +libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a +libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a +libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a +libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a +libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a +libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a +libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a +libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a +libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a +libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a +libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a +libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a +libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a +libwinapi_onecore-api-ms-win-core-job-l1-1-0.a +libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a +libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a +libwinapi_onecore-oleaut32.a +libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a +libwinapi_onecore-api-ms-win-core-file-l1-2-1.a +libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a +libwinapi_onecore-api-ms-win-core-io-l1-1-1.a +libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a +libwinapi_onecore-userenv.a +libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a +libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a +libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a +libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a +libwinapi_onecore-api-ms-win-core-file-l2-1-2.a +libwinapi_onecore-api-ms-win-core-version-l1-1-0.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a +libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a +libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a +libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a +libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a +libwinapi_onecore-xmllite.a +libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a +libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a +libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a +libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a +libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a +libwinapi_onecore-wkscli.a +libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a +libwinapi_onecore-api-ms-win-core-file-l1-2-0.a +libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a +libwinapi_onecore-mpr.a +libwinapi_onecore-powrprof.a +libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a +libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a +libwinapi_onecore-dfscli.a +libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a +libwinapi_onecore-crypt32.a +libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a +libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a +libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a +libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a +libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a +libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a +libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a +libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a +libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a +libwinapi_onecore-api-ms-win-core-file-l2-1-1.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a +libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a +libwinapi_onecore-cryptbase.a +libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a +libwinapi_onecore-api-ms-win-core-file-l2-1-3.a +libwinapi_onecore-api-ms-win-core-util-l1-1-1.a +libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a +libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a +libwinapi_onecore-authz.a +libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a +libwinapi_onecore-cryptnet.a +libwinapi_onecore-samcli.a +libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a +libwinapi_onecore-api-ms-win-core-io-l1-1-0.a +libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a +libwinapi_onecore-api-ms-win-core-string-l2-1-0.a +libwinapi_onecore-api-ms-win-core-com-l1-1-0.a +libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a +libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a +libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a +libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a +libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a +libwinapi_onecore-api-ms-win-core-job-l2-1-0.a +libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a +libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a +libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a +libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a +libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a +libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a +libwinapi_onecore-ntdll.a +libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a +libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a +libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a +libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a +libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a +libwinapi_onecore-api-ms-win-service-core-l1-1-2.a +libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a +libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a +libwinapi_onecore-api-ms-win-security-base-l1-2-1.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a +libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a +libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a +libwinapi_onecore-api-ms-win-security-base-l1-1-0.a +libwinapi_onecore-api-ms-win-core-string-l2-1-1.a +libwinapi_onecore-dnsapi.a +libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a +libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a +libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a +libwinapi_onecore-ncrypt.a +libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a +libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a +libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a +libwinapi_onecore-api-ms-win-service-management-l2-1-0.a +libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a +libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a +libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a +libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a +libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a +libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a +libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a +libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a +libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..314d8104bcfd7c7caa13b268424cad576c226da8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a new file mode 100644 index 0000000000000000000000000000000000000000..2ef14fc3d0d66e4da41a81fe18ecf2250f074c0c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a new file mode 100644 index 0000000000000000000000000000000000000000..602b8d942e1043fb03957cbb3c3d88ec3c5bdff3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a new file mode 100644 index 0000000000000000000000000000000000000000..38f813a495bb8746c528694de7821a931d504913 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a new file mode 100644 index 0000000000000000000000000000000000000000..dd5bb6f33d78c575acae4ca33b7ae0f364b34797 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a new file mode 100644 index 0000000000000000000000000000000000000000..64b7af30266903e61833bcbb1bb19ead40bb7326 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a new file mode 100644 index 0000000000000000000000000000000000000000..58d498878e1eb201f32537437ac6b3da41f6e8f0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a new file mode 100644 index 0000000000000000000000000000000000000000..50dbbceb1b0e24d968f8daac7a17219763e98cbe Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a new file mode 100644 index 0000000000000000000000000000000000000000..add0a8ae009f7fe4d1738000f52256f835c91179 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a new file mode 100644 index 0000000000000000000000000000000000000000..04d65a598b3dfeeef9ab1ee0efcb3ef56157029c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a new file mode 100644 index 0000000000000000000000000000000000000000..684b7fe9c9db655a7ca42ff3870d1b183db87785 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a new file mode 100644 index 0000000000000000000000000000000000000000..51066ec629b0015a5e1507869f684d279be58cf4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a new file mode 100644 index 0000000000000000000000000000000000000000..6cec78021d10a3960b0527e317bb1f851d00a524 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a new file mode 100644 index 0000000000000000000000000000000000000000..dfed73c69601d033833bde0b357dd299bfc5f1f9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a new file mode 100644 index 0000000000000000000000000000000000000000..148ebb692f9b9a39e525c3597a1fbe2d3b1bea5f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..9b7ad48a2be2b1e00d854776ec3e2dd85a3da715 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a new file mode 100644 index 0000000000000000000000000000000000000000..db4cadb307ef702dcbc44f746ad001ac5ccf9736 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a new file mode 100644 index 0000000000000000000000000000000000000000..2e350945cff1763e1d03fc65bcad20275839cebd Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a new file mode 100644 index 0000000000000000000000000000000000000000..35392b55ec14df5ed3eb403c089c8d8a72070a4b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a new file mode 100644 index 0000000000000000000000000000000000000000..cef1a98fa3c0b6e091c66813c0a2cd7d2e57b54b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a new file mode 100644 index 0000000000000000000000000000000000000000..2c39e820cc89f7c58b582149fbde94648b3d8e20 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a new file mode 100644 index 0000000000000000000000000000000000000000..8fb6e17f0bd231cf1dbaae30d54acec29ab85e54 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a new file mode 100644 index 0000000000000000000000000000000000000000..8a2da409e6c1306143a601bcfc9986c70d159c0a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a new file mode 100644 index 0000000000000000000000000000000000000000..4c28c5eb5430ef3dd74a1c597f2eca034b90adab Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a new file mode 100644 index 0000000000000000000000000000000000000000..5d29e5437358cf246bc5fcb385b879a48cafa9d2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a new file mode 100644 index 0000000000000000000000000000000000000000..68c9cfcd3ae8792d100412ff2980ad52a169a41c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a new file mode 100644 index 0000000000000000000000000000000000000000..f64e27f416d58bb3cf6b4ae2230e6302eb819ac1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a new file mode 100644 index 0000000000000000000000000000000000000000..7580f0185797922e405fcd542962c69e75d21f7a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a new file mode 100644 index 0000000000000000000000000000000000000000..7c0324e1be1f3db20d8159ab17991cbb9b0fa5b0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a new file mode 100644 index 0000000000000000000000000000000000000000..96c37d5eff1a67f4d78ee154d00c06d585af1287 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a new file mode 100644 index 0000000000000000000000000000000000000000..62408c8b488b7caf9d019565587d15553cc6395a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a new file mode 100644 index 0000000000000000000000000000000000000000..310598efd564dbcec9186486590227c2b1ac3bd7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..03c219687baa96fc9793e783b41edf3e2bae944c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a new file mode 100644 index 0000000000000000000000000000000000000000..1fae183e39626612147c739777d7c446c713ffae Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel.a new file mode 100644 index 0000000000000000000000000000000000000000..1f06d2cf7c609dd67fa61c2b12e96b288124694f --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel.a @@ -0,0 +1,36 @@ +INPUT( +libwinapi_onecore_downlevel-wtsapi32.a +libwinapi_onecore_downlevel-advapi32.a +libwinapi_onecore_downlevel-rstrtmgr.a +libwinapi_onecore_downlevel-setupapi.a +libwinapi_onecore_downlevel-apphelp.a +libwinapi_onecore_downlevel-gdi32.a +libwinapi_onecore_downlevel-winmm.a +libwinapi_onecore_downlevel-d3d10.a +libwinapi_onecore_downlevel-uxtheme.a +libwinapi_onecore_downlevel-ole32.a +libwinapi_onecore_downlevel-psapi.a +libwinapi_onecore_downlevel-kernel32.a +libwinapi_onecore_downlevel-winspool.a +libwinapi_onecore_downlevel-oleaut32.a +libwinapi_onecore_downlevel-tdh.a +libwinapi_onecore_downlevel-twinapi.a +libwinapi_onecore_downlevel-secur32.a +libwinapi_onecore_downlevel-shlwapi.a +libwinapi_onecore_downlevel-newdev.a +libwinapi_onecore_downlevel-difxapi.a +libwinapi_onecore_downlevel-oledlg.a +libwinapi_onecore_downlevel-input.a +libwinapi_onecore_downlevel-d3d9.a +libwinapi_onecore_downlevel-msi.a +libwinapi_onecore_downlevel-user32.a +libwinapi_onecore_downlevel-d3dx10_47.a +libwinapi_onecore_downlevel-resutils.a +libwinapi_onecore_downlevel-shell32.a +libwinapi_onecore_downlevel-version.a +libwinapi_onecore_downlevel-xinput1_4.a +libwinapi_onecore_downlevel-comctl32.a +libwinapi_onecore_downlevel-comdlg32.a +libwinapi_onecore_downlevel-pdh.a +libwinapi_onecore_downlevel-oleacc.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..34c5cfe58ca94f165173656c13fa64c625a5d6fc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..53777240059e637e4c26b18776c3a135987e65a2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..9c2a560a6cd7d88f144a57224563e2691de09051 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..580b12189ee51451bdd92ad25642a1964989da27 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ac6ad703dac23be8a875a32e13be5fad4cb7c116 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..12c03a985caf27593ed066eedc37874757c95a5d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e651f7aaa2fad42afc4ff246e12f061168b9930b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..ef3e2831827b24014d5ea46056d46a083473b10e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..200562f761426475f4d127d5dc8c25289c95c051 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d919aa0e2c3d6a10b7c8b3bc59a0c091a3c43749 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fad1bbd0078c077955e1f5a58dd67fdda095a708 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0fbf6f0341d6c47549529f12384844122bb18496 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f93dcca1b21ff828cbb36f5c3795337652c4c634 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..86571f89fac62bb63867e734865835574fd57a5f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f05df95b4d1ce9ec10fef35e001d4afd5f3ce2e2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0fdb740c974d69e27fc6662ca2c8425d8795e5f3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..17ad076effe262fc6ab8a26a66f70198dbc380ba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ad82476af6023a835c22a69587558ab282e7f808 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d80882ca3ca93b9e491f0cf910dfe696758d9543 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..120d9c297de40578be47ca6c3384046a46c0212e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..5830e4014b5291f2d7a65f3c7fac08de5918544c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3c79b22c6dc9ce96d5ee55a367645fffa83c5255 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4a549f5723f60c350f64eb56f17a3df0f82de60b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..eeff9d755b6bf04de5683ee74eca6c37365ccd30 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4cb11c5212aef935e5c286e02f3e36c9a0688bdb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..cbf774dac5feaf3c78c9e5d2b2354c1487753efa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9eaefd33373a74fa4e31637b28edf72a0035b575 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2e09d38e8e63f65591bbacc72da3c1c36a6be60d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..c6a8116330a8ab0b58f62e5c15ca88cbef790f35 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..87b7de3e4f2a4fa50817d712e90bc21de20986da Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..934487fba796fd94f62294c32d1557265948c1d8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..59142101fd95074312e6c29b607a76e544d552fc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..34bc395fbcd8945c344926600fc5eb9910e5840a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..5be5cdc08864c7caedcd2f400620f5eb3874eb16 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..89f3886ebf5a8307ad3395c84f25d4a92e1df45d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..33455c4920cca9524a929e15d9c1521e4e56f065 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d5c537fa5019f1e6fe44263f7da6b197bbf1f386 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fd16532c4c97ed4b79b16d020c7b109a9c666a13 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d9e9d62862e0e79db699d409ecec31b28a5a44e3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..afd312af4696d539609c3a4a9731d89aab57964f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c696160b3cbb44d41d2d753115748a679827b625 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3f2827f0ec0ff9c7b6a9ab28d2cf5308668f9c34 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1a69ba4a9ff7bea52df4933edee62c13569d7215 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..a41758dcbac57d3b2b5aca611c2845b8fab2a942 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..b6b82a0a722570b89696f31ec2d1f99a7939a2ff Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..168c5d2fa0392b3ea35e68be94983ab3b13b05b0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d6d8f330d45b0c47bc11167777245c88e6588688 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a10670aa892012f26f4518a3829ce969c32c825d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..66aa0a22a81f792fc5c5d2e8cb894e895ccc7370 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fb98b8cc2473737c4555de719069609f1ab8f75f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..66e3bc317da6409cd79b2844f262a1b0adb84ede Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9e3f04a28698ac2cc5db755d746b055d5c147257 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7b25460426ecbd7165bfea5006c2529a1161c0b0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e48f18ba41f44ab760c5771529c825367710e8ff Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..46c278a1cb29f5432068f105f8c75dac347e3d6c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8a373792ae4ff871c9f6ddb1e6970b825658d42c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f6b963f246f66c1cb027af1cd81b43e49184ec3f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..57f6c65a7e536ccd13080c0411ff69fb167c27cb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bfe0a0e2d1da4edc9015d87f5f8deee1aca67408 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b7b0e5d5da1dc6336aed75edf3e562e529026eab Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..04032ed7d7893663ff54eccebdbbc7c91059c4b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..501a25d26cf18a0e04bdbed0677a50571bea7a14 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..bff675bc764f767931dc92d41da5806a0c3412d6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..80385d3641931dd274d374c55f84c54facbe3898 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a new file mode 100644 index 0000000000000000000000000000000000000000..6da5dbd1a881a8fd14e8be95fbde8d2099b5a25c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a new file mode 100644 index 0000000000000000000000000000000000000000..28392aca43220e9fd05095935267b2079a677017 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fb18a934ba5528cfabd1afbf33bdf626915c109a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cc2f7f689265c44447ffd115761a225d299263cc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4bdd3e38d75849a5f39a9f3c90192efd1fce336c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..7f5b87aa61c4901622b2571cd1f4a7f096cf8d82 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..554bd28958f813df291de422681f9ccdb84f2839 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e8e2de644b66e92ff6204fb4a8bb1e89b1145a6b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..592dfbdb18804d046cd0c8fc43f217b1a9bd3117 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2ae920cf404f537dc3a5cce1f51c22c0b6469d92 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..fe5b83ebd7bdec663a822747247b7ea64c093917 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e2802fb2206d31849c228250823a0720cae03b78 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..13ace7e9d9bc0c28e98625b9bba22f1e1da6acff Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5ea3f73395e07c187590bf34c8f47421637f5484 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ad8ab0712610fcfc444414aa7cf35dd65042ee2e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..0ebc619df2950a134625f7d7cafb2bd9ce87453e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..0cef9f3eb2edbcb4f64a7e879aefec1ff70d7029 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..753ae7713228c3cafe9d0e76cb52e5da46624930 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 0000000000000000000000000000000000000000..09c84fbc147fe90eed21b37cfe373003345f028a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f0b46fd9d9c6c22622c626983b5e8e8502d16b7f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2507b504d537b09dd59c723b51299694192b4991 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9e6286d7570c76bb333931eb4cdd38491e1a6feb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..015ee5d125487754fe94ff1e441dc5f9338ee68e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..0428af61c498649790aaccc997d33f5b41241c5a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f2cd0b13333de4dcbaa3cd2e6600238b1af59830 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cfc07843c2046de04a75fab6eca78d5b5af475ee Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5cbe569a287cc65761617e8f0f46672882c60d55 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ffa1556681143fb986971eba0a5dea4c6bd61070 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f05622b6c509fd1b77738f23d86ab4381eff3087 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..29798b6310a832b29c7fa054561cf3d090d378e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ffcd31059a14020a6d0a78b1de478b8b61a015c6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..067a60c481e9077a5e2fba4534d5399c9731a400 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..997ac98dbf1c55510f66cbcf19e74518c5241b95 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..695643a828cb2c7e8fdd14f6ee532a76e1a2cf2b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7cf42b4178a1627b7b27b05e3d441050f116e9b7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6797fde0f4ebab3c81a7e727ee071cacdd11713b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2c4338ed757fba467a2228102125ecea14010ba7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..1e3138d42e394bb495fa41513819ab07daac4a0a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..6a586c10cd1b3e0c4bbfabb3a3a5ff8eebc1d534 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..57c3695ebf10ad859582e27469cb17e15d58a2da Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..73ce0f56771a1874e36fe2f83da60bfac27a3813 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ca8506382174ab6dd67126b92fa33a85fbd5382a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b8ac1901421cf31a1d382151b7c9000240a9e76e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ad8a3a44cb1dadd58648e7527d2565c12604e5ce Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9ea89d75a08ea726199b36abe823ff3671026de6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..10c384dc28131fa00e8d14f35c79229555d77f97 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d5834e0205349aebd27826b6dbbe89774400f821 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..66c5c94903b97c6a29c7c24ba71f8d630ca386e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..26b7c19c506c553e4c173ea001bec0790ddd8ba7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c9f33f5614556b3b2718efadc492595c58677a0d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..e59b5ec5699bd4e486982ac2e23438ab6195f97f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ce96bf8e5b1885632725c6c0b2d608417505aacf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..5a91f1674b77bab2900ec171988980acf217e1a8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..1f0820d6554a3dd9b9802db7f61759a7b5cb91a9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fdcbb87d77f4af7ec67a44df12ab151665344831 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3145e29fafb6beb504e3f35bbe932be66543074d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e8cf8178dc00503ca6c5532bf48598f71c566d99 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ea1726f0709fdb6bf580c3dc3dddc0b712d4ef42 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..beeee46a18a3eae8de2893bc0fa908f7ee20b895 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ba74c11dd9bdd99e6b2c63799fee5aaf53516593 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..28def184396c33b5994d518f63b64b68651bcbea Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..aebb07b2814e008eb0cfc2c4d850999b0396c254 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ffc11e7ff61d2d66fd79fe83e6c580887fcd9846 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e72a4857f6c779b4b9b1b891de8bfd393de9d07a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fcd0eb3e97db8c2b540f30de69e69eebbe0f1f6f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..da27e7703ce19f266bd810e48609a6b86fb909cf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4e99c1df4d07fc1da0d9b3bba88814d29ede0fa6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..d08cd3ccc244556622b5107bb25af74adfc91bdb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..59a2f6fb542fef3d6f49f54c75e1a7e66df85d00 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5639c68a6933384a8c85f335123a8f66091cb4aa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..65827d54bb3eea8b00e23a41ba95a2fc3703cbde Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..afe68202d86d0e6436358ab0232948824d9a4fe6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2619859810f833519ebd70682c9eea9e9f9fcb35 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ed4e679c9cfa607639a18f02f4557ae07aa78591 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b04ac45108ce659693d370933798f9d9bf526182 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..cfc8edf7f736bd100013bcb2af28c749db9cc7af Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..cf1d7023800878debad26f4e91168cbacb38d4fc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 0000000000000000000000000000000000000000..59178e5bf75720d03d120dcaed87e7c4036f64a2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3200d4f101663aee4fb1e7a9b25503b18b852997 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..45a2304bd6d8d094d1bd0ac989210366f55d4c1a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..505b8f7b08e230db10b4d292878aaf4647734fef Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..16cda2fe92057e64be85fb3c76381904078c7613 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7d171d4c7229482a5a26a6c385a44e207f326b6e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f7f1ad7c7fd8b3013bb3afb575005734dec39aab Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..53787d3b1f69bd8f6aca705b291621ec3ad8a67b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c19d288d5b0332951ae3071eb996f15fb604e5ea Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fcd1bc1907a677a2049b09e4d7a2a06742555409 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e5117f9fde558ceebaef3df7939f57392837aeeb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7dd490afedd86a6d38caf200ed29a3d7192ac3c7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3eb5e6b22d9a815bd01bffe27c28343ac2aeeab8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..389f92c0c7aa275af2bc4feec100bf49abe3a90a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3a293c6e18bb1be03276d503ab8e7d10a619c5ef Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1c463abd09317121f341cb5302d606c0f2493f49 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..deeae06964a7251a833fe1e4f70b7d6cd9bfed19 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..61584e6ccc2418d9884b4f5c537a24224e4277ae Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..9bc4437eb09fef45149106da55a6107789d10b66 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..132ab0fadd39256bcac5986bac1f0abf546d11ba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b9cddf3e83375b3f9ae2a323a7a37e1b523b6268 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5ad35884550df14a4d89f13564b4c0ab422f04dc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e04bfdb19bc916790d0eaf3f17aa21527069db60 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..680d316f96b5e7d270b729151fcb697b4c8f89ba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e55af956ccc23528676e6dedf91c605514b72a0e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..254594c89bf0e6f3840b2800357add35f5ece24d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..6c44c618c9bcc1d2180656c98793200b3b74ed05 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f14b696d647d5c847d16960b40ea89f62697faa7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..f2dc119b6cc87307eca0faa59c5fa1970ff0aede Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d9c378d9f73c39884cfa6d12b2e4def7a9cf2653 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6990a64a9b1f3e199d81f881ff550a42be96e977 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..bc33f190a854d285b9a84849b945912100cdab6d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..23a26f1e77cefae54559d52a12e012eaff8aeb50 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..382765c51c40145134fbd9bb1f174ed31ec6d5ba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c8b3f5f7a161a4c614720fc6ce90336f70caca20 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ecf299c3e3f98e54cf1c7af88a8097f35ddf94ee Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..63ea82fc012156afb35dbe03c99a7e11da5b6044 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..e73c4a1cca9c14bf1b56b58487c9c89d16205dc5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..7403a4868f71971aed71fb0b32fefb00f442bb79 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..a1b5ed07d8fc751b7b3349d5697eb9fc3f5ed200 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0802e2e6ff2ff887c11bf3be8dc647e5ae84380a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..016d9467332178ac054f18741dc62f414c5e171c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..a98c8f49bf8af56dcbbdd66507429535e3869708 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..21d20813881a207ea2b17e0be4fcd58715eaf303 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d4efbca8bb448771b842c02d40e35a9a8b5fe7a4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..aaa254bf98f9fc8a4198a98c7a8a2eb1f32958f4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..847c7e2d1044c570cdc6c50362e4180e9981bf1b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..10e36b7df8052c6c485c1b48edbb8dd0dadd7089 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1a8fe0490577b4ddf22a9ddfacfda9fa9d4a499c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..95fd7d19420c427238c205d2b5e74a5bf2077de3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..597ff128beadc8ae195ca4aef842e60d5ef175e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..a56a94c8e4014d51a8b6e36fa8439771a91554e9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c561c1ea37f118ef94f036aa94212a3f351bdc67 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..05cdb00729df985840ba1340098a66822076b5ff Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..086b68d82ccd4f7b2dcd740fa52af8e7b7ac66d6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..20c3f1895c15ad89fed0ee94c89dba631d32f379 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..c2aa06c2d865cf0f98c99a9f3e1572df2672d423 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0a091d0c1bfd62b34898a83fd7e236a1cf79861f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..358062ec4dfc10d7b693dd081f347b7a2beac4b7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fa768e316e9b52e1d111c0722d826539f7eaaed3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..463e22e4e05536934e75d52a712d86e55f4ee7d6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fd432fe69fe1da89ae9402a4161359bbf6f73fb4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bdb658f24fbf9d3052790423f59e664716922fa9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..203bbfd86da8f6cbe1ae6ff2f090b31be4b20baf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e4643147e811849f01490d4e8b569cb1d2164dfc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ce2b637cc71d9d8a870bdf39d44c0283342b201b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1958f31b6ec2c794adf21735c12c057b26b463b2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..42efc5761dcfa8f5200143cd65a378d4b7662993 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..435d0db512b75d1c814e59712e5cab9a628e43cc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..aafc8b226adfb78ec71bb1d69c25b9d718f85e2b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..55e2f9caa5c0bd8079aff16769f48201427f6aba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f8469acec31e4bfc613af98b72a3802e7f49be36 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..378796767f0e9d1b65eaff3d864a22670a569db5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0365228d84e43b5fbbcb1be18024e71b430fe55a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..9eedb802b89cf3e24717e1332a0cd30a62ce3509 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..74754a1a10947f08c72fa02141a0fd41f3539067 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8c0a7ae1fe1585412889be4bb327fc2effd319d1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..84764c31ecc627690fc3da121965ea7e02c79216 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8c238855de56ef37f0d9cb21d6968d065c0de67a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..de674107626311691fac4daa90af4d5832122388 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8578e07df07076d20d247debc64599394d1d5be3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1d7e632d92f19a502eae32ef76a2bb2f226ee03f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..229e9bdc647ecc0ae2bfe4bbabf836667ec40963 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c7b6cfb12931bb5f8d9ffc94a44ef67e98af0db0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..dad1909501587230def63e4a9c5bac116c020ae1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ad3581f81cd1f87e55dac7b67cfd43ca2b2135c5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..51ea417f0129700adf00c2679f6e99a0a425c1e6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..dedd04889665f7ed2e2f6a9d24f314ee75d46f2c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..562e9aaf8c666c7be1d5a76984d611c947814fb5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..a21bf926dc04677ff090e264c0426de17f740da2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..ea0f2b7f7392ac4fbcc3bea4387bcb685f7df1d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b93de07cf7d03b0638e421986e56e3168c126ec6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..92798e0304f8e1664233e7a0e553406f47a19636 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6026a1a152e82ba25ff08ef9348d12f72a8c404a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0a1043f6f0aa0a50aed0ab7e375dd481c88f8ba6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..60f02631bef05318106f1376d614123a6aed3783 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c3a335ec605cd7d4c8a089b6539a1eb390a924e9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c557cb3772fd4fec9e76e8e2b4814e193e3b990a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b52b7a72c91e49db49d7479c4fe0ce6b82c355c9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d3ac5aab5289750f12339961d19e3c064197d2b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1eb84843a392447cfa813a0926cb2542568bff72 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b612206c98367033ef746c66f8c8c5b7e7353f34 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..243f042289edeec54234c9537889c259156382c9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9efb3c539e31cfc42e4438f81d60bbeadd7bc254 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bad59d1bf4be42e6aa4bfede2e2190a624112b9d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a new file mode 100644 index 0000000000000000000000000000000000000000..15e9e11b679d478d41f685a0914a662d844b1f5b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..c30fef3bde602ccd7264979f44816589290435ba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..53a60d562611fbc852d9d7ae0f12a3be96f15acf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a new file mode 100644 index 0000000000000000000000000000000000000000..e841d04b55ad69083c51622d56b7be8bcc48164c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a new file mode 100644 index 0000000000000000000000000000000000000000..c668dfff08494e6ba220bd930cab5cf5c611661a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a new file mode 100644 index 0000000000000000000000000000000000000000..7a737060ce70dd5e1d6421d07c8c0fed6e4d551f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a new file mode 100644 index 0000000000000000000000000000000000000000..aa9f7fc7f982714787ecfc212c237776c912183e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a new file mode 100644 index 0000000000000000000000000000000000000000..c01378c80ba43c422fd5c31ccd0954baedb05274 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a new file mode 100644 index 0000000000000000000000000000000000000000..49e871a1e31fa057a22a8dc14c5df43e2ab9137d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a new file mode 100644 index 0000000000000000000000000000000000000000..724c339f4f23758412c1016753c82ea88e386717 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a new file mode 100644 index 0000000000000000000000000000000000000000..4e3dbea68c14b4a9e39c85c1ba074eba10c5fa1a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a new file mode 100644 index 0000000000000000000000000000000000000000..b9e8ee3ceb05c7f2073695727fe1e47ddf32117d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a new file mode 100644 index 0000000000000000000000000000000000000000..af67121a1e446a5733429a3300e755b6e00b7aca Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a new file mode 100644 index 0000000000000000000000000000000000000000..df1fb51c4a0dbb037b71a2736957785a2b0e89e9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..398abcfe38bd0ac16bd0774ad4f4ad08c849c412 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a new file mode 100644 index 0000000000000000000000000000000000000000..31094646cf8e978c760061ef925a8d18ef4d2324 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..ea78b924f952955ccc2f154f59b2ca719aa53762 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a new file mode 100644 index 0000000000000000000000000000000000000000..89e3c740fc49dc451f95dd2060b50e9dd8bfc841 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a new file mode 100644 index 0000000000000000000000000000000000000000..45fe803414951e990a5278694e45cdd0c30d8244 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..228a1ad359d82d66a7f5f4b232e9f5d7396555c5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a new file mode 100644 index 0000000000000000000000000000000000000000..28bf741c8e569a05f01b53df67c1f531cb3290d2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a new file mode 100644 index 0000000000000000000000000000000000000000..0d4ee9ed3064137377de2f41b9f4c1ec538829ed Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2eee14c06b399c2098445f23294fd6abf4fccafa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8a7a3374d6784405064b8e1fa025952445da534a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c5aa6024154964d4e8aa0b64365b1132703a1672 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c19278c2c9915acb76db5fdd0aff434cb6b7fb86 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..cb0a327736749384d4ace761d21a9146fa625e17 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4843b04814166dc86ddea666b682347836924e14 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..796dfb84b0591558d53692c3db5251eb1233faec Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..fbc7a9dc0930b37458caa9918b2151dcab7ee5aa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..faba24e9ae94863256b8268ea5e308b170d9c73c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a new file mode 100644 index 0000000000000000000000000000000000000000..5c928ba0f13f981fee270015759793ed028908cc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a new file mode 100644 index 0000000000000000000000000000000000000000..8a037ee47be1b2867fc12e236d4f00873a111ccc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a new file mode 100644 index 0000000000000000000000000000000000000000..706490874958a7c65cf515b80d9cfb0f061e76a0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a new file mode 100644 index 0000000000000000000000000000000000000000..0bdd645e13c21ea5140375c47dd8f93804407dce Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..304b43b5130a57b997d31bb88108c324916524e1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a new file mode 100644 index 0000000000000000000000000000000000000000..cb66132f94037a43e8974107d53676a36285c23d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a new file mode 100644 index 0000000000000000000000000000000000000000..d445b01892a46f2bfa1e7a47d1a912074849bb8f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a new file mode 100644 index 0000000000000000000000000000000000000000..14b1ec1ed9ca085c4e1b0d9ebde5e2aaf357524c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..e26c89056c77de8a4314820a29963b99f36a3c51 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a new file mode 100644 index 0000000000000000000000000000000000000000..54e931a58ca507534fc1d867b242b94096a7c0b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a new file mode 100644 index 0000000000000000000000000000000000000000..f011a721d207d4f3aad23094e868a12b1297441f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a new file mode 100644 index 0000000000000000000000000000000000000000..ce3a0876d44213745639db04f9dd0539e9073704 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a new file mode 100644 index 0000000000000000000000000000000000000000..6bc3728d7843e8e344e36fe574f8fc1a864650d0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..a35a24b405c1ca63a5e2bb42096034f234577830 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..d674404fba41374610b1965d28bbc17afb2bfaf5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a new file mode 100644 index 0000000000000000000000000000000000000000..ce2fe89517133aae333b4ab77715572979a1694e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a new file mode 100644 index 0000000000000000000000000000000000000000..06b17d0dac03d4fbad538d882fd0995dce5368fc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..1060a64d23bf90c0fb4b60ba1104c7dc542a4d5e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a new file mode 100644 index 0000000000000000000000000000000000000000..443bb25a083032126d1d4155c1dbe474b80b3ccb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a new file mode 100644 index 0000000000000000000000000000000000000000..ac0c5f6427322a1c06cbc6a4618d0c0989a99a6a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a new file mode 100644 index 0000000000000000000000000000000000000000..cf72a6d0bce7e3aa9e093d50d403eaa9b175c707 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a new file mode 100644 index 0000000000000000000000000000000000000000..29fde97465dc66635cd35d01c7052b90661abf64 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..dbd709f06260827a261353f84504732a4770224f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a new file mode 100644 index 0000000000000000000000000000000000000000..003b052ebf41a2d2f0e9c4a007386f916f8479d4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a new file mode 100644 index 0000000000000000000000000000000000000000..3be2e78492abf7e056f0424a0354deaf95040e4f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a new file mode 100644 index 0000000000000000000000000000000000000000..8bc846c1647e97cba816f60049a29333d575fe2e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a new file mode 100644 index 0000000000000000000000000000000000000000..06fb1b80d981c9f0cdbc3c9298e1b864ecc6eb74 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a new file mode 100644 index 0000000000000000000000000000000000000000..16458195d379729f4e0d22005ac2ff7e41c2aac4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a new file mode 100644 index 0000000000000000000000000000000000000000..a58c9c8440a998ad44e51a4479cd035eb5af4ba1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a new file mode 100644 index 0000000000000000000000000000000000000000..3c2f720087d9651f81fceccded5ca3cb896e4d71 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a new file mode 100644 index 0000000000000000000000000000000000000000..deeb4b7c73ebb167e4db50704ce6d036b33da661 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a new file mode 100644 index 0000000000000000000000000000000000000000..30db0a197a41a60e2942f1cfbefcae8ea02193b7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a new file mode 100644 index 0000000000000000000000000000000000000000..3fa52c59631c6ee901d5c118538691b3f0a1e6c5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a new file mode 100644 index 0000000000000000000000000000000000000000..31121fdcfe21981be05491c9865756ae2c658482 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a new file mode 100644 index 0000000000000000000000000000000000000000..3a2bb93fcd1a6e395dfc161c7b20bbc3a512c684 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a new file mode 100644 index 0000000000000000000000000000000000000000..60ac153a96e603b3cd09cbfe2fbf81c7ab8d1044 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a new file mode 100644 index 0000000000000000000000000000000000000000..29e107117b00df876972b2f3f195a0720a9d7be5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a new file mode 100644 index 0000000000000000000000000000000000000000..97a1b02f34a396a4086c12ff957b564c77899d06 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a new file mode 100644 index 0000000000000000000000000000000000000000..50a2e38cbae70a19f0535be9fa456a271d4c70c5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a new file mode 100644 index 0000000000000000000000000000000000000000..f4cc8dcb4d50aed976f6bcf3e167f50ddd5c6227 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a new file mode 100644 index 0000000000000000000000000000000000000000..bec0b25ab70afe977e71fdc02e6bb1d2b5bbf781 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a new file mode 100644 index 0000000000000000000000000000000000000000..78027e1e6e1b7181ccacdea035fa66af62b0a603 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..f4a89328ff5c248ffcd3d1cdfff01a6161343764 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a new file mode 100644 index 0000000000000000000000000000000000000000..ce5e291a1327e485f605dd376a9315de168dd955 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a new file mode 100644 index 0000000000000000000000000000000000000000..df91aadbade0a3220a7ef88cb432f1db2538fa75 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap.a new file mode 100644 index 0000000000000000000000000000000000000000..34c606fa64d3f94ed3cace916e1fadc80cce42b2 --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap.a @@ -0,0 +1,324 @@ +INPUT( +libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a +libwinapi_onecoreuap-esent.a +libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a +libwinapi_onecoreuap-wkscli.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a +libwinapi_onecoreuap-ws2_32.a +libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a +libwinapi_onecoreuap-logoncli.a +libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a +libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a +libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a +libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a +libwinapi_onecoreuap-winhttp.a +libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a +libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a +libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a +libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a +libwinapi_onecoreuap-xmllite.a +libwinapi_onecoreuap-dsparse.a +libwinapi_onecoreuap-cabinet.a +libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a +libwinapi_onecoreuap-mswsock.a +libwinapi_onecoreuap-mpr.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a +libwinapi_onecoreuap-coremessaging.a +libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a +libwinapi_onecoreuap-powrprof.a +libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a +libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a +libwinapi_onecoreuap-dsrole.a +libwinapi_onecoreuap-dnsapi.a +libwinapi_onecoreuap-wldap32.a +libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a +libwinapi_onecoreuap-dfscli.a +libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a +libwinapi_onecoreuap-crypt32.a +libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a +libwinapi_onecoreuap-netutils.a +libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a +libwinapi_onecoreuap-cryptbase.a +libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a +libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a +libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a +libwinapi_onecoreuap-samcli.a +libwinapi_onecoreuap-authz.a +libwinapi_onecoreuap-ntdll.a +libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a +libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a +libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a +libwinapi_onecoreuap-oleaut32.a +libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a +libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a +libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a +libwinapi_onecoreuap-tokenbinding.a +libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a +libwinapi_onecoreuap-d3d12.a +libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a +libwinapi_onecoreuap-d3dcompiler_47.a +libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a +libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a +libwinapi_onecoreuap-d3d11.a +libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a +libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a +libwinapi_onecoreuap-mfplat.a +libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a +libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a +libwinapi_onecoreuap-urlmon.a +libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a +libwinapi_onecoreuap-inkobjcore.a +libwinapi_onecoreuap-windows.networking.a +libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a +libwinapi_onecoreuap-ncrypt.a +libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a +libwinapi_onecoreuap-dwrite.a +libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a +libwinapi_onecoreuap-chakra.a +libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a +libwinapi_onecoreuap-d2d1.a +libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a +libwinapi_onecoreuap-hid.a +libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a +libwinapi_onecoreuap-srvcli.a +libwinapi_onecoreuap-dxgi.a +libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a +libwinapi_onecoreuap-wpprecorderum.a +libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a +libwinapi_onecoreuap-bcrypt.a +libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a +libwinapi_onecoreuap-sspicli.a +libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a +libwinapi_onecoreuap-xaudio2_9.a +libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a +libwinapi_onecoreuap-rometadata.a +libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a +libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a +libwinapi_onecoreuap-msajapi.a +libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a +libwinapi_onecoreuap-mf.a +libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a +libwinapi_onecoreuap-userenv.a +libwinapi_onecoreuap-websocket.a +libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a +libwinapi_onecoreuap-wintrust.a +libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a +libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a +libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a +libwinapi_onecoreuap-mmdevapi.a +libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a +libwinapi_onecoreuap-rpcrt4.a +libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a +libwinapi_onecoreuap-iphlpapi.a +libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a +libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a +libwinapi_onecoreuap-propsys.a +libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a +libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a +libwinapi_onecoreuap-profapi.a +libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a +libwinapi_onecoreuap-cryptnet.a +libwinapi_onecoreuap-schedcli.a +libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a +libwinapi_onecoreuap-deviceaccess.a +libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a +libwinapi_onecoreuap-windows.data.pdf.a +libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a +libwinapi_onecoreuap-uiautomationcore.a +libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a +libwinapi_onecoreuap-webservices.a +libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a +libwinapi_onecoreuap-fltlib.a +libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a +libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a +libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a +libwinapi_onecoreuap-dhcpcsvc6.a +libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a +libwinapi_onecoreuap-mfreadwrite.a +libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a +libwinapi_onecoreuap-windowscodecs.a +libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a +libwinapi_onecoreuap-dhcpcsvc.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a +libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a +libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a +libwinapi_onecoreuap-hrtfapo.a +libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a +libwinapi_onecoreuap-mfsensorgroup.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a +libwinapi_onecoreuap-wlanapi.a +libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a +libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a +libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a +libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a +libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..dc845446aa5b7e997623be7a7df4629669f576c5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a new file mode 100644 index 0000000000000000000000000000000000000000..bde9a7631249496b119f425ed002b6e0a11afa1d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a new file mode 100644 index 0000000000000000000000000000000000000000..85ecf8a2f32288157da64b9d6b182aca08b5a38d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a new file mode 100644 index 0000000000000000000000000000000000000000..b18f4b75483535f57b0f77dcdb0cce62f7e7032e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a new file mode 100644 index 0000000000000000000000000000000000000000..405c24e81c75e9144561e490e90b32a844722f61 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a new file mode 100644 index 0000000000000000000000000000000000000000..27b5d931c2e63a44de2ddbff4777a4e48c388a37 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a new file mode 100644 index 0000000000000000000000000000000000000000..d633b8c12a3a149c9428906f0af390092f05c362 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a new file mode 100644 index 0000000000000000000000000000000000000000..64916fd74cb73cd0c9779bc19b3146267649a1d1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a new file mode 100644 index 0000000000000000000000000000000000000000..958b3dc92fdd68d96a5e79715dea1bcc5c8cad16 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a new file mode 100644 index 0000000000000000000000000000000000000000..074e846f3e2c8008d6dd49f55cfa4be379907a2b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a new file mode 100644 index 0000000000000000000000000000000000000000..cf794256738f13796c8ade6ce143469b7702b78e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a new file mode 100644 index 0000000000000000000000000000000000000000..49400a3ac5f02cead54fd7111609103bd9634ddf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a new file mode 100644 index 0000000000000000000000000000000000000000..b26457f7290b726576c882a02ef18287285d7918 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a new file mode 100644 index 0000000000000000000000000000000000000000..f7101ca6de8dcb9fd1cfd689a1d9a0b8743c1391 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a new file mode 100644 index 0000000000000000000000000000000000000000..f899180a0eccd596fa83bd997e368a8a341092dc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..51763a70bb696dbbdd9ff4993c833af1ca8a02f5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a new file mode 100644 index 0000000000000000000000000000000000000000..0e12e1334d0ea13ff34c9c6720374fc24cbe55bf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a new file mode 100644 index 0000000000000000000000000000000000000000..65e2049daf388a1e7a6c52d07c5791cd0e87771c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a new file mode 100644 index 0000000000000000000000000000000000000000..166288977e29e167600e9cb9d7e8f331cf75bdc5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a new file mode 100644 index 0000000000000000000000000000000000000000..7fda090ae27a9d9d16c40ca9e8d1d44830040440 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a new file mode 100644 index 0000000000000000000000000000000000000000..8aaa20854c3ec53540058e2bf3985b610ef05a56 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a new file mode 100644 index 0000000000000000000000000000000000000000..61b62484bf9a2156462e2f3fad679047704efac2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a new file mode 100644 index 0000000000000000000000000000000000000000..7b6420481d02db9e4b3da9e0f0a1b57ab7510418 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a new file mode 100644 index 0000000000000000000000000000000000000000..e1e2f262c623c31dc8b33dd3decdd8bae15a7091 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a new file mode 100644 index 0000000000000000000000000000000000000000..82c6bf3076d85bfe6f258b0472243d88e1b481aa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a new file mode 100644 index 0000000000000000000000000000000000000000..37677ab7b86a8be39b3e6dae06c0327800eac5da Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a new file mode 100644 index 0000000000000000000000000000000000000000..d01bb8d29d2c66dd1c43ab95e51e31ff98adaa50 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a new file mode 100644 index 0000000000000000000000000000000000000000..ebe75803f7c0b9aa9366e9ba479f843f3d0c7543 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a new file mode 100644 index 0000000000000000000000000000000000000000..6e72a4dc31bdb1d1e26162e5bfdd38047f3a6452 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a new file mode 100644 index 0000000000000000000000000000000000000000..f6abea7634a6a23d887add0d51df5b9366ad881c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a new file mode 100644 index 0000000000000000000000000000000000000000..8f325ebe3c2d1e3749fcb60cab3b4fc7c12a48a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a new file mode 100644 index 0000000000000000000000000000000000000000..89d1b70414a545d3b8a2dfa9c813ac417ddc3b43 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..42f49714fb96f00e6cada862973d6b5601a424a9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a new file mode 100644 index 0000000000000000000000000000000000000000..3fe875be396b88a6daa876a3cefc9c282a71f104 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel.a new file mode 100644 index 0000000000000000000000000000000000000000..0d94fe2711f04519a5cf766c275eb0059349ffc9 --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel.a @@ -0,0 +1,36 @@ +INPUT( +libwinapi_onecoreuap_downlevel-uxtheme.a +libwinapi_onecoreuap_downlevel-pdh.a +libwinapi_onecoreuap_downlevel-psapi.a +libwinapi_onecoreuap_downlevel-shlwapi.a +libwinapi_onecoreuap_downlevel-advapi32.a +libwinapi_onecoreuap_downlevel-wtsapi32.a +libwinapi_onecoreuap_downlevel-xinput1_4.a +libwinapi_onecoreuap_downlevel-difxapi.a +libwinapi_onecoreuap_downlevel-d3d10.a +libwinapi_onecoreuap_downlevel-newdev.a +libwinapi_onecoreuap_downlevel-setupapi.a +libwinapi_onecoreuap_downlevel-user32.a +libwinapi_onecoreuap_downlevel-secur32.a +libwinapi_onecoreuap_downlevel-oledlg.a +libwinapi_onecoreuap_downlevel-winmm.a +libwinapi_onecoreuap_downlevel-apphelp.a +libwinapi_onecoreuap_downlevel-shell32.a +libwinapi_onecoreuap_downlevel-ole32.a +libwinapi_onecoreuap_downlevel-resutils.a +libwinapi_onecoreuap_downlevel-winspool.a +libwinapi_onecoreuap_downlevel-comdlg32.a +libwinapi_onecoreuap_downlevel-d3dx10_47.a +libwinapi_onecoreuap_downlevel-comctl32.a +libwinapi_onecoreuap_downlevel-gdi32.a +libwinapi_onecoreuap_downlevel-twinapi.a +libwinapi_onecoreuap_downlevel-version.a +libwinapi_onecoreuap_downlevel-tdh.a +libwinapi_onecoreuap_downlevel-d3d9.a +libwinapi_onecoreuap_downlevel-kernel32.a +libwinapi_onecoreuap_downlevel-oleacc.a +libwinapi_onecoreuap_downlevel-rstrtmgr.a +libwinapi_onecoreuap_downlevel-input.a +libwinapi_onecoreuap_downlevel-msi.a +libwinapi_onecoreuap_downlevel-oleaut32.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_opengl32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_opengl32.a new file mode 100644 index 0000000000000000000000000000000000000000..5ca150b1998ad38659bfdae18148e65b31aa0dc8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_opengl32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_p2p.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_p2p.a new file mode 100644 index 0000000000000000000000000000000000000000..2f7bcc9ca2023aa6a137cc35389b38d639966afc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_p2p.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_p2pgraph.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_p2pgraph.a new file mode 100644 index 0000000000000000000000000000000000000000..c6e0cd9ab847b488a8bddc85c05d04d8a4a689c9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_p2pgraph.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_pathcch.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_pathcch.a new file mode 100644 index 0000000000000000000000000000000000000000..54462ace821c959c184213b559128a12463c1799 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_pathcch.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_pdh.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_pdh.a new file mode 100644 index 0000000000000000000000000000000000000000..f74b21e3d609e36f2e443b5f90eb66e436fd62be Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_pdh.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_peerdist.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_peerdist.a new file mode 100644 index 0000000000000000000000000000000000000000..ffc8f0b0b38cd4c7dc2580ec162b53ce2669bdc4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_peerdist.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_powrprof.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_powrprof.a new file mode 100644 index 0000000000000000000000000000000000000000..23cd940c472f17827a5add277b040c365d4c9c70 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_powrprof.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_prntvpt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_prntvpt.a new file mode 100644 index 0000000000000000000000000000000000000000..245f275ae091be08008970c25d81ca56550e9222 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_prntvpt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_propsys.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_propsys.a new file mode 100644 index 0000000000000000000000000000000000000000..2fadbd9391543046a09773fc609e71182601bb4e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_propsys.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_psapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_psapi.a new file mode 100644 index 0000000000000000000000000000000000000000..b3a875fbece7ec6c1fde7b2dc75218b56d291ee9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_psapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_quartz.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_quartz.a new file mode 100644 index 0000000000000000000000000000000000000000..49fc68bf46901e7cbb7547774c1c3049cc48abed Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_quartz.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_query.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_query.a new file mode 100644 index 0000000000000000000000000000000000000000..4f0bdc0ce071dc7230f9e77ff0159c45ce42ad9a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_query.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_qwave.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_qwave.a new file mode 100644 index 0000000000000000000000000000000000000000..fc74f80c26c27021890e65825328e7e1b2efcd52 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_qwave.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rasapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rasapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..6b9f89da14a3cfed92a6a6823d73ce53f801adf6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rasapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rasdlg.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rasdlg.a new file mode 100644 index 0000000000000000000000000000000000000000..6f014fe267bd7f0d01ed68368e105fd757fa8cae Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rasdlg.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_resutils.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_resutils.a new file mode 100644 index 0000000000000000000000000000000000000000..520d7b71b1de50638306ed25ff6b072f2406e7b7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_resutils.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rometadata.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rometadata.a new file mode 100644 index 0000000000000000000000000000000000000000..d473f439cb1968619aa3b2e774315e59498bba31 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rometadata.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcexts.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcexts.a new file mode 100644 index 0000000000000000000000000000000000000000..ee44784f420ca4c229c07a32ea9cc90ea4bd8daa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcexts.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcns4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcns4.a new file mode 100644 index 0000000000000000000000000000000000000000..d52203d3129e7b0a93acf5d4415a41bf6f3a1ac3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcns4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcproxy.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcproxy.a new file mode 100644 index 0000000000000000000000000000000000000000..cc6381e6ff08e6ae43ed3fb72ccffb2b683506bb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcproxy.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcrt4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..54394856191eaf59a073eabf22825f0f792a5aec Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rstrtmgr.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rstrtmgr.a new file mode 100644 index 0000000000000000000000000000000000000000..a523d23078a6d912898f1b904494ec31b711f35c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rstrtmgr.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rtm.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rtm.a new file mode 100644 index 0000000000000000000000000000000000000000..fbfeeb883bbae0c3a751c113ab2f11282ab5cd1a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rtm.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rtutils.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rtutils.a new file mode 100644 index 0000000000000000000000000000000000000000..b10358ec0e1e1d70312b3cec46839c849cbe55e8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rtutils.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rtworkq.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rtworkq.a new file mode 100644 index 0000000000000000000000000000000000000000..e9a7dbfd57b7895e9e1cdf561d91db02a7f1e843 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_rtworkq.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bc13dd410a48a2dd6ddb15e4e74d1c032d9531b5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..08f54f607d7599f89c42ae6033c947e15d289607 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..19c21a5c07f5eb743d9f817e6cb5dc04b63ac673 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..808c7d47d7780887d3b8fde4b4184d4118466722 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e8b73394cccb1bdacc6f32d508b2562682da5fe8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b1c2c40d54b9464cc9e30d6c89470847707427a5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..54d59d7d9b792b4fc1d59cab02dc52160f00d037 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..504848a14edaddba1e09b2c37808262a541d5019 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject.a new file mode 100644 index 0000000000000000000000000000000000000000..57114fb6c3845b35d13e176de5ce6e82444b5c59 --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject.a @@ -0,0 +1,10 @@ +INPUT( +libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a +libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_samlib.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_samlib.a new file mode 100644 index 0000000000000000000000000000000000000000..4ec0af002999a30ddda7370cf3bdb9e473b66bb1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_samlib.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_samsrv.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_samsrv.a new file mode 100644 index 0000000000000000000000000000000000000000..8cf2e63dc77a42429fe295f4006a987964514aab Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_samsrv.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sas.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sas.a new file mode 100644 index 0000000000000000000000000000000000000000..ab8cc477476a307d55710f3f5a8c0b7a1e80d9d8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sas.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_scarddlg.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_scarddlg.a new file mode 100644 index 0000000000000000000000000000000000000000..2514139822826e6f2dcc62928f0079676ee57880 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_scarddlg.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_scecli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_scecli.a new file mode 100644 index 0000000000000000000000000000000000000000..955ecfd41351295751eec705066aa68d53137f42 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_scecli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_scesrv.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_scesrv.a new file mode 100644 index 0000000000000000000000000000000000000000..fbd750c0e8d85f5d8712606d6b0076aa5dd7dbb2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_scesrv.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_schannel.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_schannel.a new file mode 100644 index 0000000000000000000000000000000000000000..067b6f532a28780a04adc4b8e7a42f0100cb9165 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_schannel.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_secur32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_secur32.a new file mode 100644 index 0000000000000000000000000000000000000000..53671d1caf160724f830247e7333c4112f9dedf1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_secur32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_security.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_security.a new file mode 100644 index 0000000000000000000000000000000000000000..c86e022d61e5de52f447cf4dca17099205e1c966 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_security.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sens.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sens.a new file mode 100644 index 0000000000000000000000000000000000000000..934408694f4dd7908d8aa63e6da3506abacc7acc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sens.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sensapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sensapi.a new file mode 100644 index 0000000000000000000000000000000000000000..d7e09d9524e435a27701e815288b65d7cb0e7408 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sensapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sensorsutils.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sensorsutils.a new file mode 100644 index 0000000000000000000000000000000000000000..2b29363f02f4e32cad5f41985a91256177fadbb1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sensorsutils.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_setupapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_setupapi.a new file mode 100644 index 0000000000000000000000000000000000000000..dce8dea208e1faf73ef3214c7af94ef9974f29a1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_setupapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sfc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sfc.a new file mode 100644 index 0000000000000000000000000000000000000000..857ca87b0cdcb5689a57a4418e1de8fb0af48d8a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sfc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1b06b896305a98c81adc0fbc2032ee611f1ca455 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..11d544d00b90065f4addead694dffb5d9ae05443 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b2d21eaf6812a9f1297bd7fc70f52fa25202a616 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1681ba1d10ca88da89f44da3684bba443910b66e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..724b88d86d322baad351bf1fc2da9732bc510080 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8b5c5679ad719b499a94cdf7eeaea33a210e62b9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore.a new file mode 100644 index 0000000000000000000000000000000000000000..e0cb94213f48323e30ff420af1496a0d3ae37923 --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore.a @@ -0,0 +1,8 @@ +INPUT( +libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a +libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a +libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a +libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a +libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a +libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shdocvw.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shdocvw.a new file mode 100644 index 0000000000000000000000000000000000000000..7ce2c214bae72825b47c018e10e5e60b4aa36491 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shdocvw.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shell32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shell32.a new file mode 100644 index 0000000000000000000000000000000000000000..9b36306d7652c925f61cfffa7ef55305a762925d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shell32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shfolder.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shfolder.a new file mode 100644 index 0000000000000000000000000000000000000000..a254a364400ffe78a97fa7bf953cae00fdcefc07 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shfolder.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shlwapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shlwapi.a new file mode 100644 index 0000000000000000000000000000000000000000..c3dd5fdb8451ed338446f34bf0ef6afc3f33a1d8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_shlwapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_slc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_slc.a new file mode 100644 index 0000000000000000000000000000000000000000..d785e65eb1fd2fbb6e9c1ad1b262d48dd2a976e9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_slc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_slcext.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_slcext.a new file mode 100644 index 0000000000000000000000000000000000000000..43f3b625c3cdaedf2685960e764922d8f64fa437 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_slcext.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_slwga.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_slwga.a new file mode 100644 index 0000000000000000000000000000000000000000..8d10f0de4d7d0d43309ef106d0528032159d7da4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_slwga.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_snmpapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_snmpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..4c17ec13ba6553bb09ea3a7f5a2cac5828cc9609 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_snmpapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_spoolss.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_spoolss.a new file mode 100644 index 0000000000000000000000000000000000000000..a05c7dd7dac04e9d2a2363a8a22130f66b349287 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_spoolss.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sporder.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sporder.a new file mode 100644 index 0000000000000000000000000000000000000000..6366f0d4982307edca5679f48be35a3c0a90bb9d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sporder.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_srpapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_srpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..502075424d2ad69ff717721b7aa0da6f127e025a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_srpapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ssdpapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ssdpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..5e54d889786081c769e9a7109b4578b1fbbb1f9e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ssdpapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sti.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sti.a new file mode 100644 index 0000000000000000000000000000000000000000..8375b1bd4024dae70403da388a9f82946e6b3f11 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_sti.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_swdevice.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_swdevice.a new file mode 100644 index 0000000000000000000000000000000000000000..6934d38518649ae7738c243b76da4c3ab2e8892d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_swdevice.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_synchronization.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_synchronization.a new file mode 100644 index 0000000000000000000000000000000000000000..99a0914887d1df1453bcb7d991a875fa5e21f1a0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_synchronization.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_t2embed.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_t2embed.a new file mode 100644 index 0000000000000000000000000000000000000000..c8348f27cfd8ab9dbac54e60a3935bb70bcd85a1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_t2embed.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..36123f3f8d89d1cb5f9092b859805ab0d6e92763 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tbs.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tbs.a new file mode 100644 index 0000000000000000000000000000000000000000..f61e08de804b367a7523c229702e119e74f0c253 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tbs.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tdh.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tdh.a new file mode 100644 index 0000000000000000000000000000000000000000..879c4c24108dc589141c42092d4fb26a0351cb7d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tdh.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_thunk32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_thunk32.a new file mode 100644 index 0000000000000000000000000000000000000000..0fcb4abfebaf2d7824cb6ad21566093128ee7faa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_thunk32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tokenbinding.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tokenbinding.a new file mode 100644 index 0000000000000000000000000000000000000000..c42846dc19d9c4730917a5076e879e80b8d607c3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tokenbinding.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_traffic.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_traffic.a new file mode 100644 index 0000000000000000000000000000000000000000..29426250c3e3305870fffc6e25cd4497d7ebac28 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_traffic.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tsec.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tsec.a new file mode 100644 index 0000000000000000000000000000000000000000..17dfcbba017f4a720e48258b9e8cfd08c15ae1f9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_tsec.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_twain_32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_twain_32.a new file mode 100644 index 0000000000000000000000000000000000000000..c23fa15727b7ab84f874b44af9a2a6298b4dc0e5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_twain_32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_txfw32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_txfw32.a new file mode 100644 index 0000000000000000000000000000000000000000..f0eb04dcb3bb955759da466ffcdc943b6b29a86f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_txfw32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ualapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ualapi.a new file mode 100644 index 0000000000000000000000000000000000000000..850c8c6765c222f6cc519e3268ef880ea23a83b7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ualapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_uiautomationcore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_uiautomationcore.a new file mode 100644 index 0000000000000000000000000000000000000000..7fd55e2f542d71fcd518e319f4bc16941ddacdd3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_uiautomationcore.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_umpdddi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_umpdddi.a new file mode 100644 index 0000000000000000000000000000000000000000..3978c02866bad7720cdb01c9814c0a155c2c7b53 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_umpdddi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_urlmon.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_urlmon.a new file mode 100644 index 0000000000000000000000000000000000000000..4be27178f0ebf7ed1edf5a1a47d9630baa6c8f7d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_urlmon.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_user32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_user32.a new file mode 100644 index 0000000000000000000000000000000000000000..433c99125fd8700baf7c02531eb26a86c6b6096e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_user32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_userenv.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_userenv.a new file mode 100644 index 0000000000000000000000000000000000000000..157037f1145d42001170160e3e83613be82ebe91 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_userenv.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_usp10.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_usp10.a new file mode 100644 index 0000000000000000000000000000000000000000..6f7c99f527eb92120842d8ddcbcc54e8a5761f01 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_usp10.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_uxtheme.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_uxtheme.a new file mode 100644 index 0000000000000000000000000000000000000000..e7535e4573357c3a7fd8e018b2ac21b5abd10bb1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_uxtheme.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vdmdbg.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vdmdbg.a new file mode 100644 index 0000000000000000000000000000000000000000..3fffa465dfd2168b1093182a5e0c0ccdbecd840c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vdmdbg.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_version.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_version.a new file mode 100644 index 0000000000000000000000000000000000000000..ced80c6d225f3bcd6db7e6e77c3bb7e49d268bd8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_version.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a new file mode 100644 index 0000000000000000000000000000000000000000..e5aa9322ef64cc5e4cec0b40214cab4302bdbfb3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a new file mode 100644 index 0000000000000000000000000000000000000000..203a54e49e46f1cb2896b4e6951a3f7a7cbb4fe4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a new file mode 100644 index 0000000000000000000000000000000000000000..ce9faa04b0e8d63c6533f90e8eb696b1acc6dbf9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32.a new file mode 100644 index 0000000000000000000000000000000000000000..4ee8733361c0dba78487aef54adcd19db78b9f4a --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32.a @@ -0,0 +1,5 @@ +INPUT( +libwinapi_vfw32-msvfw32.a +libwinapi_vfw32-avicap32.a +libwinapi_vfw32-avifil32.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_virtdisk.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_virtdisk.a new file mode 100644 index 0000000000000000000000000000000000000000..fedb81337d5148799f3690102953492f00e7ed45 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_virtdisk.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vssapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vssapi.a new file mode 100644 index 0000000000000000000000000000000000000000..16394ae1dc69d01a8cfa9b729d7e5498e6358888 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_vssapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wcmapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wcmapi.a new file mode 100644 index 0000000000000000000000000000000000000000..1aa71796a582a28563bdfdc60e0f9074862d2631 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wcmapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsbp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsbp.a new file mode 100644 index 0000000000000000000000000000000000000000..920e6b4edc1d52a3b4352c6d21f0cca86e51aef7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsbp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsclientapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsclientapi.a new file mode 100644 index 0000000000000000000000000000000000000000..2680c98e561828bc3b105d23f4deafde1877d294 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsclientapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsmc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsmc.a new file mode 100644 index 0000000000000000000000000000000000000000..597419a4ca74d678957afc21a1275c7bc6e7ea14 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsmc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdspxe.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdspxe.a new file mode 100644 index 0000000000000000000000000000000000000000..d02e02f9a97cfe0a56365b1dd55293684d7374c4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdspxe.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdstptc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdstptc.a new file mode 100644 index 0000000000000000000000000000000000000000..713cd9cfc7d48d54d58253d584fe4fde68b950e5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wdstptc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_webservices.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_webservices.a new file mode 100644 index 0000000000000000000000000000000000000000..4b78f3ca185194fafbbb5339ed73b2d94e5bd0c6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_webservices.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_websocket.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_websocket.a new file mode 100644 index 0000000000000000000000000000000000000000..44718580ee654ecd9f2fb99ea72a03d1040685e9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_websocket.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wecapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wecapi.a new file mode 100644 index 0000000000000000000000000000000000000000..3bf0a96eda774d90f865454ba4091a3cfb7940eb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wecapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wer.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wer.a new file mode 100644 index 0000000000000000000000000000000000000000..cd69a4c9fcba2ec19f972f4f67bad475dff8155d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wer.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wevtapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wevtapi.a new file mode 100644 index 0000000000000000000000000000000000000000..79387dcee07748624735ec746620484edc1e090a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wevtapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wiaservc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wiaservc.a new file mode 100644 index 0000000000000000000000000000000000000000..d5ff213608e9bfea2cf4f7444aec16bc7ee1ba0d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wiaservc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winbio.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winbio.a new file mode 100644 index 0000000000000000000000000000000000000000..ae9822813f4bba6f53018f2ed482e4dbc2cbfbce Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winbio.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a new file mode 100644 index 0000000000000000000000000000000000000000..18779a820d3a99e4498928d93c02a90d79913703 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.networking.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.networking.a new file mode 100644 index 0000000000000000000000000000000000000000..31fbef11eac966346df83aee72f35153b3f72187 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.networking.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.ui.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.ui.a new file mode 100644 index 0000000000000000000000000000000000000000..cda5fbe41513cfceff5ab77cb8b010e1301141ef Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.ui.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7d94e04c77643682251f9f0b707185b8f318d080 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..f8be94441065937cb5048eeb9c76eb6aba9e0552 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..735ac6523a9fd491f4c3f377c5a67704c9d6f345 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4bed1b1e5fd5adb97b0ca4b1a1ceac5d1d50f257 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..f776baaa822b6307c4d7722cbb90796065e76172 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..01292a5a0aeaa865ba42f9533684fe407a7161ae Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..16a1296da2e8b8d81146ad46d4001a6583dedc1d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..5371ddab7876bc346e13ea31fe895eaf1e79a02c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2f1c4141c2287c47f3f00dcb0d471625de3537c7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1e4e42c813cbd752441819976e50d8f2d0901eec Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3e26ac7480db0e443caf638454ba6e399b6e2d1a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..58e50e5f090a32a28b3fea23f2941f659018acdc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..56a3e3623a8227c74db4b9030007f47c6e8193d7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3d67aed4535a1ae862ffc4530a9575c4317649cb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..dad567be537b9f771b34ce239d27cf0d719e49fc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b2cb11e9eb4b6a4b94f8fd6d969ede72b3f0fd87 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d5697b9d367c2900158d75c931accc8f03012edc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..11be6da92bc146b7b16253d33f66e207ec70198a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..2718e4666e45c6a6b6874ff306deb26dd5f22976 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..220a68cdda912627da46221aae695f64c333d9cf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..f660315570f90af3f0b5e6a549b13975607d995e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e762f5221a3ab302d10735cffd08cb2a19bc2783 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4faeaa1f26c81a94c23744363ce061230d7ed726 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fe26c3d3af783fcb57e21e44a6300daa261b7113 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8effb1970d330deaaf634e5fdb42b6fdb61e265e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d6527fd974657679897d2a7353be697b0a6887f2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..44e462bb91ee6e6e8fc6e1544f8dae591e3e31ba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..17706d845d2367d7acec0447d32b8d6ff177cd6e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..55954cd192b26e8ebb26c01952bfb0e5f8cc8340 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..918697f656b410c11d1a2b86f7acbca8896b6ebd Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7907b3b75d324c64e244f23e7c0029adaf7fd4da Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..a6d25991e4661391596b32d8e9feb4d6f02ab6e3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..eb3d5fa196f988ce74842ca647fcd4cec26a7095 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1cd50fc1e04137d4b9cdb81588820e6f02deaef4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5ba6e4e1d5e19f0833444db207215dd08c8f98b0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9f3412518c2c7113a1882e2c33f96c463a1fc44c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d1fdf0a341c430ebf9d9d3eccf99559fd5afca29 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..13808fc7a2082eaeb565ba04efb23d6cbbc3819a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..af43d3cffeb970a1d0a0351f9a3fca7b6643c564 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..9a00e8232257f6ffbfbacf4c0bd1686111075b46 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a851e732eb78cbdd5927ea346649de2826ee2db7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..95527be34145c9e1104a4a2f775181729414e250 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..90fde2e4784917211db1fdf074f2ff78b99173d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e2d23b9f4030cb3c660a1315331559d67f042888 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0757c26ea501c9d5e332787ec93ebb158667d8ed Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6a3e88e583ce7b22a409955c39c811bf583d39a2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..77ed2712c472e4d85062f8222cd4227950a601d5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..974c1c1c2c53d15bc0272007ccd7d58cfe2eea9f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..0ca1500fad22d9430b73f5607647276334e6b6c4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0b23b2b118ef03eaf47f8f6e4919455e890858e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3c36c785c39aac507614e5a4f9570ffb54cca7e8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ebfbc923d103fc8e0e4e8146ba9e1cf1b97c7422 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..bb694d4af01c65e2779e46006ff5eb6cde959c68 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..24be928bb27889d264e91fc68c8d0e66cce53f90 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..98eb6cda89549b95ba578820d7ab81aa4a399d86 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d2bca079d1af0dd98c5bca965198f5ec8e188354 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c9ae77c84f8cb718531208e5694023f0e851e85e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1e51efd73f7c93d56749740411d54aa93f602fbb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..91a4e62a2c6cb46f303988adbce1109c3bca82c1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..8d4fd3433cf0ad78fa54bf0112e134524900da9f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ed77b26afb77a92900b0535de9d0c5f631685d4d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..79323d2f92af818a28148271157fd54920f47851 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a55ddae947f3e89d50d2c75d456855c5517493e6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d46c94dea201df62a6c755aede3b7154fdadd1ca Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8f36637dde6e063dcb24af58f86487f53f268737 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2fe002262d6d1eeaca7694c64fbc493d4accbb39 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..d0cca93e766442c3a0da064bee4fa604a286bafe Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3ecc222b65d223987df62d7afbdabd63dc38dd13 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..696ae36bf229e5128af18f909d9392df735fd9f8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..84bc77d7d0b2a8030f983200dd1bf98ac6c3ebfc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c3612ca7d6e0ff0050b0462f6fc8579b392725c0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a159c319a949f6e7b476de138ea318614538b0d1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..460e619899e4d9f9004af81b4be2de303efbb3c2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0a86c5b619973000dd512c65e86999685d76de3b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c4d1ba2b64c8ea7e1d1d804d6a3c860459c8c7ff Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2d4b41f15401f04b235320d108b72e68806acdb7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..6b7d9cd0196dc2175d51ae67b0de62cb15ae8478 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..95bdd3c0d2327dde538d60f8bcbba319cdb2beb3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ade2b499e1d2862f8634b9240945a0e5df46f50c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8f61e693dbc09bf63bb8baa6e4488d5739cfcff9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ecb2735633964881176a9a7e13763f92ef0bcf31 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5501d11b7a830d0c02ec04407cf78554306844a3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..da73411f9a0facaed8dce777f2cc67a441c99104 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cf630b5ddbbf2b9be4d629fbc4ca14624c7ad211 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..d40773368bf70dab0e5eba66d5edbc809c38b5c3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..977ac4e7fb534fd0d24f57618d71e1afa7447a3c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..34833cbb0bce7324efd9b27c075dd169b8ce349e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 0000000000000000000000000000000000000000..57858f28676e65df5a4530b27f947447c39be59f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..21f7322af2461de2ce9415e44c71a4a5103bea46 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cec79cb626b5eb7103dec758775427fec856d13c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c7163a6245e82d6cf751e4cbe90970aa926959c3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b6d8cc74385085431b15f1b778a3e65e0b536966 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6105470f008a96c438aa8563f0cae36120ced151 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cd19c2fb519597208ee88423e28e60ff971f748d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..00d75526d99f031bbc9db99dffa100ae2f7c1bbb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ef34952cc30382be57e296ce2e60d5009c5878aa Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ca2761f5c341dec9a39aa024d563b97bb6e2a168 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..105f5c80adfb66ca0ff472f978ac5d14d176e1f8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5a140137f4a871f005be1fb4e3a234ad8ebebddb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4e49d674921312ab6dcc016d8ab98f75d5e7dd97 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d0ec877f8f5967861e84a1c4507668c1e9da396b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..95a9bfb30ff9299ed8c207adfb0bc19117ebae86 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..067a348e81cb62c102abad24f07e3cdfcb914e26 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..dae18e8771331f4cb6eebe50e588e325444b1666 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a5115c3df5d6090028e197de68578af25b56008b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..38b2821d7ac84a5486ef2dab519da6d08217cf74 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..91f059966753c798b8033fe5eb5aff93abf07473 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9f00d28f5de29532374ff18c4886661c0c2347ee Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9fa8e24f7211f8db73d319393403ffdc0db1f227 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..59ae3527bb23b7c11a9a9bbaaa377c37946a8e67 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..02d4560d3194bbf5a72b369242612b63f5e62380 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f81e6ceee133afc38132af4e55b4d5b3ec4aaf63 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..15596e5ce39cb96f5f24e17f72ebeb59f9ae09f1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fb4d21015484a793de75f23f76a208df0eff5e45 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9c4c74b85933c4427ce2f56e9d6c50730a916590 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..da49791a42382e14fd33bfe4258a5b7f5dfd4945 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1362a96d10a941b3a45a20a428cafd3ed4f3f86d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4b46f36024a8b088d20748a4f065f7b8b80ba695 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..e5fc8cf292da4f5cefee6c0a0ad905a9075672a5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..90c47260355f4fa6e0f0273709b4c19d07e3187c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..05b5b8aba5a35211b7adcd0d8471b936067ec305 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..be4994ce9dede65da5bd7ef098493075f8ef43bf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..51e89caa4abf0db0f0fe9634891114f60cea05d8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..493442d3eba13bc6f4a0b3fd151f2d00ae6fb6f5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b5cd1aa78c151048c9ce96bff2e779edb588b14a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a8c6c09d3d94956128e81b7c4eb8dd9fb0ccc2ee Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0b6588461254711829b268cdbba267c30018c0fc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3bc3b947ef7af72d3fd3bf84fd410a1c27f74700 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fb8c8ec5c4a98ed9efa43f2bd0e08d9329124266 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..83b64c00baa2fc5446406821ffa2af53821cb0b7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..953406dcbc01664876c16ef13d8b8a19f971e6a1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3c758ff97fc7acbbb5f7a7d38c35ae5a394b00fe Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9ce4fd9b418b2442b5ea1fe775f8abec662db8d4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..86bbbcba8bd6c48a9b19dca0eda539bd9900d9d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..5951094033b7c5eeb860dcb457e2c1e49bec68d7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..8dfa306b1a172d68df858126b5fa1fcb7da205f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a new file mode 100644 index 0000000000000000000000000000000000000000..c6073e63626207fb854eaafba9bbe4dc5893b0fc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a new file mode 100644 index 0000000000000000000000000000000000000000..c29811ac1795c279a623159b391d3dd407f95cc3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a new file mode 100644 index 0000000000000000000000000000000000000000..08a1b26ac72661c6f1553d4f475af5b0033d7843 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a new file mode 100644 index 0000000000000000000000000000000000000000..f1e64913d20011822189278223ed459fd8eb73f1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a new file mode 100644 index 0000000000000000000000000000000000000000..424039b22d2e44a6a0de0d29a5eb7e42684f2a6c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a new file mode 100644 index 0000000000000000000000000000000000000000..b9c76f561fc118fceb26b544dafa7ad5d1d516c1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a new file mode 100644 index 0000000000000000000000000000000000000000..4338e8e5b6dd0922ee1d7b1901ebf2de15042ec5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a new file mode 100644 index 0000000000000000000000000000000000000000..e79507902d6633ceded592c0423b2f3ea780a93c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..4e96e11b59334cb3e09eff1fed5715e557b717c3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a new file mode 100644 index 0000000000000000000000000000000000000000..d4af08b87b9a2edaee35d95a85e19ea7a8269409 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..252c2782f600c0fc04d88273c4146c10ff4f46c0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a new file mode 100644 index 0000000000000000000000000000000000000000..7bc0efef202796f76ebea375186497e25051d8f8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a new file mode 100644 index 0000000000000000000000000000000000000000..4ea456eaf7d1901bb7706e71d7ec94fc7bc63338 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..79b13d5d0100ac931633f62d008b495fc514c8e2 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..23a078cf7c1393377a2e6dc612b2e82b58ab01fc Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9b91355791261484f9d27ed0a2063844056604ed Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..89e6572f03a42160796276449d12c6a12975734e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..75f3516013d57da007f56890f6a78ee495de292d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..3b79a34140593eaa0d6db6a0787d732847a689e9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a new file mode 100644 index 0000000000000000000000000000000000000000..0072969aa89265b16aad80997e0462bfc05f80ba Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a new file mode 100644 index 0000000000000000000000000000000000000000..88e4a44a4fe0407473fceb057e434f27c08c84fe Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..33947ec83bbf599edf969d46431e7e41287f1708 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a new file mode 100644 index 0000000000000000000000000000000000000000..737149a46186bf10f0ce854de846f08586cf5677 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a new file mode 100644 index 0000000000000000000000000000000000000000..c86f9a562deb0bbd2ff97b0ed40bd4bed8db2434 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..ea2bce6fc05c1375faf2f6247c15c519f6fbc0ab Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a new file mode 100644 index 0000000000000000000000000000000000000000..44aedc1f99a273dd91e9e842602a9777a6990ee8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a new file mode 100644 index 0000000000000000000000000000000000000000..50ea8b50589ffe115a89d097e3171af73760d6ae Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a new file mode 100644 index 0000000000000000000000000000000000000000..0ade38276832cf9f2eaddcfb1d578515575c8985 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..c0b608983d331406f87a6a64a3b14b1113113b15 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..c92ecc94b5d33351ade25b41063f9b22f639c66a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a new file mode 100644 index 0000000000000000000000000000000000000000..55d704d5ea25f408e04ebd2095ba9d822e295e1e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..7fd7ed3edc784902a35172ced46be9c431a3ac24 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a new file mode 100644 index 0000000000000000000000000000000000000000..d3e929e1ceabb89e253c069e302d48b84bf7797f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a new file mode 100644 index 0000000000000000000000000000000000000000..1f039103f5f50a10e2242f6a8f273a6c79563e65 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..ccd98d679a888d39995aef09789981e2ea086d1b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a new file mode 100644 index 0000000000000000000000000000000000000000..7e24e2be1472ca71e36797ed314ae21d222dc1f3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a new file mode 100644 index 0000000000000000000000000000000000000000..d6ffecd5707434c711358737b78c0dc5953bb93f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a new file mode 100644 index 0000000000000000000000000000000000000000..38650736989b6c9f76fd1c6a2294f0e5b3d77268 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a new file mode 100644 index 0000000000000000000000000000000000000000..c782f15120ae1122d4455c8aaa8a2a2424cc8c4e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a new file mode 100644 index 0000000000000000000000000000000000000000..f0e48b304eb109df53749bdcaec92c228b1a2025 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a new file mode 100644 index 0000000000000000000000000000000000000000..131affb37ddecb370143b44368c5cdb76eea5812 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a new file mode 100644 index 0000000000000000000000000000000000000000..f7f0abe2c5bfcf0e16c4679e6c441ad1e4e94eca Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..321fd2fc26c9a3823ca69b7dcf0d25464af2b3dd Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a new file mode 100644 index 0000000000000000000000000000000000000000..b0f72c9a730fd67ce3da6a2382b3576a5aea25c4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a new file mode 100644 index 0000000000000000000000000000000000000000..e4e04628dd2f641bc4a1dc1d8c566aee82337f04 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp.a new file mode 100644 index 0000000000000000000000000000000000000000..5ef765fd1b2c3a3afd5bf02a0f90eabd4482122f --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp.a @@ -0,0 +1,183 @@ +INPUT( +libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a +libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a +libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a +libwinapi_windowsapp-ws2_32.a +libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a +libwinapi_windowsapp-d3dcompiler_47.a +libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a +libwinapi_windowsapp-mswsock.a +libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a +libwinapi_windowsapp-msajapi.a +libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a +libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a +libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a +libwinapi_windowsapp-xmllite.a +libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a +libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a +libwinapi_windowsapp-d2d1.a +libwinapi_windowsapp-propsys.a +libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a +libwinapi_windowsapp-ntdll.a +libwinapi_windowsapp-rpcrt4.a +libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a +libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a +libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a +libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a +libwinapi_windowsapp-windows.networking.a +libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a +libwinapi_windowsapp-bcrypt.a +libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a +libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a +libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a +libwinapi_windowsapp-d3d12.a +libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a +libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a +libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a +libwinapi_windowsapp-xaudio2_9.a +libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a +libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a +libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a +libwinapi_windowsapp-esent.a +libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a +libwinapi_windowsapp-coremessaging.a +libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a +libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a +libwinapi_windowsapp-dxgi.a +libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a +libwinapi_windowsapp-deviceaccess.a +libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a +libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a +libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a +libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a +libwinapi_windowsapp-oleaut32.a +libwinapi_windowsapp-webservices.a +libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a +libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a +libwinapi_windowsapp-crypt32.a +libwinapi_windowsapp-windows.data.pdf.a +libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a +libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a +libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a +libwinapi_windowsapp-d3d11.a +libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a +libwinapi_windowsapp-rometadata.a +libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a +libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a +libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a +libwinapi_windowsapp-cabinet.a +libwinapi_windowsapp-mfreadwrite.a +libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a +libwinapi_windowsapp-dwrite.a +libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a +libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a +libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a +libwinapi_windowsapp-windowscodecs.a +libwinapi_windowsapp-uiautomationcore.a +libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a +libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a +libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a +libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a +libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a +libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a +libwinapi_windowsapp-ncrypt.a +libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a +libwinapi_windowsapp-mf.a +libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a +libwinapi_windowsapp-inkobjcore.a +libwinapi_windowsapp-sspicli.a +libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a +libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a +libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a +libwinapi_windowsapp-dhcpcsvc.a +libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a +libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a +libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a +libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a +libwinapi_windowsapp-dhcpcsvc6.a +libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a +libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a +libwinapi_windowsapp-urlmon.a +libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a +libwinapi_windowsapp-mfsensorgroup.a +libwinapi_windowsapp-iphlpapi.a +libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a +libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a +libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a +libwinapi_windowsapp-chakra.a +libwinapi_windowsapp-hrtfapo.a +libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a +libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a +libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a +libwinapi_windowsapp-mfplat.a +libwinapi_windowsapp-mmdevapi.a +libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a +libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a +libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a +libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a +libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..2608a19b32e2de1d7c6111f42a50558054c27be9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7222809302e4c367c437ec634d0f8c7ee150c47f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b8f9f7a78eddaba6db41e96dc8de4b81e0eef3a7 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..91bc763bf97cd0ab30b00584eacc119742111bee Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..eb78e07bdb5d90c7c318c58e2fd9f6241474055f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a new file mode 100644 index 0000000000000000000000000000000000000000..0929639e2849daae7aff326ce8bea75dfa38fdfb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a new file mode 100644 index 0000000000000000000000000000000000000000..8f16d8437e57b840bbc4a88fa345112f56b5382a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a new file mode 100644 index 0000000000000000000000000000000000000000..5bcd5873812d8840ba40e11a6ce1fa83c88eaca1 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a new file mode 100644 index 0000000000000000000000000000000000000000..f20bd440de2e5b8d8bf737a123969a2b6cd2718b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..71c58f876948cde3febee36cb01311850256e961 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a new file mode 100644 index 0000000000000000000000000000000000000000..1a91cd7c658ba14125ed9f9200352ea359220740 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..a16a066adaf7bd40c37a8af1070576395066baa9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a new file mode 100644 index 0000000000000000000000000000000000000000..6846f7ef63dcd144264b22d24deca9e0529d62af Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a new file mode 100644 index 0000000000000000000000000000000000000000..2cd8067c0adf725a0b230170a01136ff316530b9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a new file mode 100644 index 0000000000000000000000000000000000000000..14873d309c899deb6e039e95156bac5102f34999 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a new file mode 100644 index 0000000000000000000000000000000000000000..f0e11a0597d59cbb2b866904219de8c3e37e567e Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a new file mode 100644 index 0000000000000000000000000000000000000000..74c7c8ac0cf1b5e3c42df9c31d5f16a5dc7372ce Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..61958f3d4ffeb8aacc196bb0d1a0f7e963675521 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a new file mode 100644 index 0000000000000000000000000000000000000000..1fa5240c3885b190da597e585ce3f66a45c1c619 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a new file mode 100644 index 0000000000000000000000000000000000000000..d74c3142edc861365b62365849f0ea613ae2ca54 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a new file mode 100644 index 0000000000000000000000000000000000000000..52227cbfd2318367c950f69e360585516e800111 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..5c8d0016ea0f392a6d0b7ea677ffdba1609a43a4 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a new file mode 100644 index 0000000000000000000000000000000000000000..680423855c39f7c71f461cd7d6924f0038460b7c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..30c5ad1ee9ccd0c7c70744b125c45454ed2c2b6c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a new file mode 100644 index 0000000000000000000000000000000000000000..b1712ab05f8f3bd22b6f91bff6cbba4fcdaa06cf Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..4099340134b61b62797a58f6e8306412adec626c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a new file mode 100644 index 0000000000000000000000000000000000000000..8e19c7f8712be836e5869cc1acf486aad7b30b26 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a new file mode 100644 index 0000000000000000000000000000000000000000..bc09346bbc4c0c4fa666310fe59e284d8a760137 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a new file mode 100644 index 0000000000000000000000000000000000000000..bf1e18b9fa06bbe7c1447bbdb38ce095ea11ed71 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a new file mode 100644 index 0000000000000000000000000000000000000000..b1264634091ad9eb50bb3a86a8e2acd4959eb785 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a new file mode 100644 index 0000000000000000000000000000000000000000..d47881198263893442e8028bcddf0007fa820b12 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a new file mode 100644 index 0000000000000000000000000000000000000000..8421f86046b92b5e8472042bafa8f435fb35ed6d Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..710f54b093c15af86fc06f9464490809c1908168 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a new file mode 100644 index 0000000000000000000000000000000000000000..3ce3d6bac32fc9c967943d44090e0a1d9301d732 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a new file mode 100644 index 0000000000000000000000000000000000000000..ab91188d70f95f960e6f6400ff637999119fadb6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a new file mode 100644 index 0000000000000000000000000000000000000000..aa9979690dcfc342de8265ed87b4902b8fb67db8 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel.a new file mode 100644 index 0000000000000000000000000000000000000000..f6c44ec0224dc2566b27a34d23f8daf210ff51cb --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel.a @@ -0,0 +1,38 @@ +INPUT( +libwinapi_windowsapp_downlevel-dhcpcsvc.a +libwinapi_windowsapp_downlevel-rpcrt4.a +libwinapi_windowsapp_downlevel-esent.a +libwinapi_windowsapp_downlevel-dwrite.a +libwinapi_windowsapp_downlevel-d3dcompiler_47.a +libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a +libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a +libwinapi_windowsapp_downlevel-dhcpcsvc6.a +libwinapi_windowsapp_downlevel-urlmon.a +libwinapi_windowsapp_downlevel-mfreadwrite.a +libwinapi_windowsapp_downlevel-propsys.a +libwinapi_windowsapp_downlevel-cabinet.a +libwinapi_windowsapp_downlevel-kernel32.a +libwinapi_windowsapp_downlevel-msajapi.a +libwinapi_windowsapp_downlevel-mscoree.a +libwinapi_windowsapp_downlevel-xinput1_4.a +libwinapi_windowsapp_downlevel-xmllite.a +libwinapi_windowsapp_downlevel-mmdevapi.a +libwinapi_windowsapp_downlevel-xaudio2_8.a +libwinapi_windowsapp_downlevel-oleaut32.a +libwinapi_windowsapp_downlevel-ws2_32.a +libwinapi_windowsapp_downlevel-uiautomationcore.a +libwinapi_windowsapp_downlevel-d2d1.a +libwinapi_windowsapp_downlevel-windows.networking.a +libwinapi_windowsapp_downlevel-windowscodecs.a +libwinapi_windowsapp_downlevel-webservices.a +libwinapi_windowsapp_downlevel-windows.data.pdf.a +libwinapi_windowsapp_downlevel-mf.a +libwinapi_windowsapp_downlevel-d3d11.a +libwinapi_windowsapp_downlevel-ole32.a +libwinapi_windowsapp_downlevel-dxgi.a +libwinapi_windowsapp_downlevel-deviceaccess.a +libwinapi_windowsapp_downlevel-advapi32.a +libwinapi_windowsapp_downlevel-mfplat.a +libwinapi_windowsapp_downlevel-mswsock.a +libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a +) diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowscodecs.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowscodecs.a new file mode 100644 index 0000000000000000000000000000000000000000..42ee6724e6c063bcdc60cfe45a663d401e8320fe Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_windowscodecs.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winfax.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winfax.a new file mode 100644 index 0000000000000000000000000000000000000000..e482dcdb9d5bbd83181d15af6d5dd96353bcbbed Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winfax.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winhttp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winhttp.a new file mode 100644 index 0000000000000000000000000000000000000000..8d6ae883e04946edec7f004f190706607fad7a7a Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winhttp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wininet.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wininet.a new file mode 100644 index 0000000000000000000000000000000000000000..dfcd544586aa3939f4ecd790c1b6280d2a7ade39 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wininet.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winmm.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winmm.a new file mode 100644 index 0000000000000000000000000000000000000000..7ddc07bfa5276b4b34ac67e21eb468a3a3cfa5f5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winmm.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winscard.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winscard.a new file mode 100644 index 0000000000000000000000000000000000000000..31e9f209a29d917260035553ef0754255c49b8c9 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winscard.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winspool.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winspool.a new file mode 100644 index 0000000000000000000000000000000000000000..c99f8301dd2e0b7c51042ea31592750d86039a35 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winspool.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winsqlite3.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winsqlite3.a new file mode 100644 index 0000000000000000000000000000000000000000..2f5f94114a6a824a667f9e1604d9439b392778be Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winsqlite3.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winsta.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winsta.a new file mode 100644 index 0000000000000000000000000000000000000000..8faad470e448c010bfb92bd1cedfe00f65319b48 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winsta.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wintrust.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wintrust.a new file mode 100644 index 0000000000000000000000000000000000000000..066e7a88b811a2611ed3a34555a140df70c56a0b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wintrust.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winusb.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winusb.a new file mode 100644 index 0000000000000000000000000000000000000000..7e2cd8775334b1b4818eecd0d350ed4fe4142a68 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_winusb.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanapi.a new file mode 100644 index 0000000000000000000000000000000000000000..dd0d898d45fdda915ff98f30fbbfb30affeb26bb Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanui.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanui.a new file mode 100644 index 0000000000000000000000000000000000000000..1e9ead8061e1ddc58238e2025c0504ed02e58e44 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanui.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wldap32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wldap32.a new file mode 100644 index 0000000000000000000000000000000000000000..70e88d9cd4f9b85e83f36c77ac94f906b04177f0 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wldap32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wmip.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wmip.a new file mode 100644 index 0000000000000000000000000000000000000000..1acabc325c942d0768a678dcf30b47550e082b56 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wmip.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wmvcore.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wmvcore.a new file mode 100644 index 0000000000000000000000000000000000000000..3c06a11b6f0dee5b8a76025b5d54a3d4e1520e03 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wmvcore.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wofutil.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wofutil.a new file mode 100644 index 0000000000000000000000000000000000000000..d5c38d21b9b497ffeda35c1197f3d5d3de0c951c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wofutil.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wow32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wow32.a new file mode 100644 index 0000000000000000000000000000000000000000..0b0c43171835019008c2b64446664ae0a41cfa83 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wow32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ws2_32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..55cc1be967777535c6dbb9040505c62691e83805 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wscapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wscapi.a new file mode 100644 index 0000000000000000000000000000000000000000..8394bdf4e3b46b4a6e1a15fd8cc8991beb75f68f Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wscapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsclient.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsclient.a new file mode 100644 index 0000000000000000000000000000000000000000..7a00a571e195b0e5a01eb82680c3daaca291c569 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsclient.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsdapi.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsdapi.a new file mode 100644 index 0000000000000000000000000000000000000000..51e05419017cf6a9790b870f6c5fd8da5ea63888 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsdapi.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsmsvc.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsmsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..2b0490cee39b88fa28cf851f95b1fb8cbff0dce6 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsmsvc.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsnmp32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsnmp32.a new file mode 100644 index 0000000000000000000000000000000000000000..87bf3dee8680a4887ca54806fd28de0a5b42de60 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsnmp32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsock32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsock32.a new file mode 100644 index 0000000000000000000000000000000000000000..97ce32f58da9adf8596f07fff301e8664e2d5fad Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wsock32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wtsapi32.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wtsapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..5f3988cdaaa601b3f56e9cab7007838e06a7ff67 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_wtsapi32.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2.a new file mode 100644 index 0000000000000000000000000000000000000000..04a0a068540a71229904f2b18a63eaf6e007a379 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2_8.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2_8.a new file mode 100644 index 0000000000000000000000000000000000000000..52d46423bb37e2e02a5471fa200edadda53a2f42 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2_8.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput.a new file mode 100644 index 0000000000000000000000000000000000000000..46ee0c7c68afbbd9cf99690b4c0dd4715175ba5b Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a new file mode 100644 index 0000000000000000000000000000000000000000..93bb330bb167f8575ea503924e47dd942e66e2e5 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xinputuap.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xinputuap.a new file mode 100644 index 0000000000000000000000000000000000000000..9976a4bcc171c2a5eefc5c45222d0ed3deea454c Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xinputuap.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xmllite.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xmllite.a new file mode 100644 index 0000000000000000000000000000000000000000..b65232dc139320789b638afce70c2045c84ef6b3 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xmllite.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xolehlp.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xolehlp.a new file mode 100644 index 0000000000000000000000000000000000000000..7e0af573e08612584a489c7d86993f143214e145 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xolehlp.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a new file mode 100644 index 0000000000000000000000000000000000000000..e65dd685a8ec094c660b6ab0dfb51dde85c60570 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsprint.a b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsprint.a new file mode 100644 index 0000000000000000000000000000000000000000..3101fb6cef87c4ff5c88d28e0f5d612da4b15940 Binary files /dev/null and b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsprint.a differ diff --git a/bash-5.1/vendor/winapi-i686-pc-windows-gnu/src/lib.rs b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..3b7f827d8f03ed1b991c9f149288bd73569a3177 --- /dev/null +++ b/bash-5.1/vendor/winapi-i686-pc-windows-gnu/src/lib.rs @@ -0,0 +1,7 @@ +// Copyright © 2016 winapi-rs developers +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +#![no_std] diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/.cargo-checksum.json b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..10b18520269dade5a5e6e355b3e9cc47026bb7b1 --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"a88605a11db5def9b6cf73398e83b3edb72228cb43ea935729fac5cd33cec22c","build.rs":"b4ab421e1dc98159dd4440813cdaf7d9ea98278324bc6118d0f7cf378933f371","lib/libwinapi_aclui.a":"276ddeb3f36f3bce5c1b65d6244c5d814ea6212a443023fd9f1755b815ab0183","lib/libwinapi_activeds.a":"f2a3162aafe48121cdd8f10092a5eec4ec1facba87f7a543e90f2fa79b8d5aa0","lib/libwinapi_advapi32.a":"61cea4489a1fd706ef7d8e67b836fd77b2d9d39167edba3a51fe4b0a3ead5640","lib/libwinapi_advpack.a":"d448fd3029b9bf1fed6da3259053abecc7481fe21392fd5218b61495e1bfa1bb","lib/libwinapi_amsi.a":"7549daec74980b0b0f5d9bd1b4f314433dc0ce0a170128a0c1aae6fc2526193d","lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a":"1fe5ca42932d19191127555040e4ad2aa59636f9c17f9f3a3afaa1438cf9fdb3","lib/libwinapi_appmgmts.a":"7a4747e1d307d3b8bd50b1d0611c4f0454cf30bebee6de2bbd3e9bf3f66fcb2b","lib/libwinapi_appnotify.a":"b1a62c3d0a87866aded8f4bc3dd31cf52972a91f5c4bdb966f7b8a2432a50443","lib/libwinapi_audioeng.a":"73b5de7d57738e4067ceefea0cf654ae05e50a59d044461ccd5c79eb7feb6532","lib/libwinapi_authz.a":"adfe67282df67cd3a52d81407a98cc1ce8466d6b67bafa3a884b688b5624045d","lib/libwinapi_avifil32.a":"d80ede7f93091fe3670019291695183142eca029c4b2359b9b1d760803682554","lib/libwinapi_avrt.a":"246c2c6892823de74fb0dfc1ef889798d01e28f110498723a1b33120fa393d72","lib/libwinapi_basesrv.a":"73044d5e44b30581e91d6f3341ee98f99f0ed77d577a4210aa0e9f097e5f68b9","lib/libwinapi_bcrypt.a":"0c19e9a1b649b7226b6954948060edcdf4e4052e0f9e56c218a52b5d36014a99","lib/libwinapi_bluetoothapis.a":"f9178dc2281ca623497f7f83280c3a4d150fb8a55cf7d9efb0bc5c7d41d01ac2","lib/libwinapi_bthprops.a":"dd2aec07378487dc47ff1640b0c91458c90fd8991847c5bde3c97b2bedb801ef","lib/libwinapi_cabinet.a":"6ceb101c96c4bdc62be7362f45c62e9cf1469d5d81bd1bc282b2284b55855582","lib/libwinapi_certadm.a":"d3302510a8197ab0c513101c10cb92dc004f64c039843047bd382f96eb7edf6b","lib/libwinapi_certpoleng.a":"5081b94579847f972dd9549570ff12b78aef42ca10f90981d3de886fa7f0cafa","lib/libwinapi_cfgmgr32.a":"3b18b12d0bbe4e5bc3ef7683beb3fda64b32f459f8dbc78f44a40233e694b2be","lib/libwinapi_chakrart.a":"f1936dfcbd3357255735ca59df3c076a55a676abb9f1a883e0500fef36f26842","lib/libwinapi_cldapi.a":"985226ad1768a637d0ed6b4b868617033d655f1bcac8a0d6e0fd43e3c7f4977d","lib/libwinapi_clfsw32.a":"14a16bacc58aedd81521aa1b2902814cbe335b148662a58f859c520470ed7626","lib/libwinapi_clusapi.a":"dd4f925f888246934353bc109df338f545e5e79e7114fcd7d4b5ba98d39f7f83","lib/libwinapi_comctl32.a":"21b6ebe43ffe405d6be881741423d04e1b5d76c264fea3a131652be307ce17e6","lib/libwinapi_comdlg32.a":"62009b40ffcf2fcc5c4ba0f43922c6c386ccdc42db09c7fa598fe72330a44f1b","lib/libwinapi_comppkgsup.a":"fbea5db62858b6abe5411c9ef5f1ca87876807bb18d10db2cdccca4d0f8989db","lib/libwinapi_compstui.a":"71c05683ff02d0d1963ac72e9e22a1c21e72dc3e8465bd5d6f0d01fea2237b3f","lib/libwinapi_comsvcs.a":"a685111c8104c2c4c4dc20475c3c30e6d1e1ece855b2d35631a3ffe42ed8b2b3","lib/libwinapi_coremessaging.a":"467d27a2c2f3268ae91d37e825d3d54cea24212265c7b6011b3b38002074d459","lib/libwinapi_credui.a":"b965b731004fafe74539c0c9c4f8966ffdf856bf24b5dd584a5e9fe6e0dee7fa","lib/libwinapi_crypt32.a":"d12a2c398e5fa6fb366f768ab11d2e0b5e06ac3c0a5237dc822f291d2ca2e540","lib/libwinapi_cryptdll.a":"29d24bd4ee508988ff5839ded74e41b1849fb24383b45efb308eab935979888c","lib/libwinapi_cryptnet.a":"292ed55e95c5487af424aaf81c8b66f6f007fd3adbef2b85e66e687d1ab4628e","lib/libwinapi_cryptui.a":"c8dd855f6c16395b122eea8f1144e52837e49fc7887fdfe86cd29cbd34133f3b","lib/libwinapi_cryptxml.a":"0454ab761f153936ee26ea36013bdf0612c9b44449d617ee0bffd7b5ec9006b3","lib/libwinapi_cscapi.a":"b0cf26d0ee575dfdb761244e9e0b1b5255a8a56716c2eb01d4a0428709eff88e","lib/libwinapi_cscdll.a":"faa2988a37bf527a964c1772901de933660824bfd13fbe428a0eaa3a5f7cfb4a","lib/libwinapi_d2d1.a":"542b8de881286d507bf96791b68fa94a9529734e891e78dd839aeafc77373fb6","lib/libwinapi_d3d10.a":"287e4ab2b679444dae0254f047a7d2ac326d4110e72a603c0223ccb1a6b97ad9","lib/libwinapi_d3d10_1.a":"95141cf53dce108d49e60728740fa9f32be925bb3f5c07fea1b3e134870d090a","lib/libwinapi_d3d11.a":"792513e2b6829c7a003c24612b8c6440d90fc3dafea80cc0bf4782c0050131df","lib/libwinapi_d3d12.a":"d86f53d148ba6f7fc35518706ea9e8bafc63c39e9ab6bb65790ed1f413bbfaf5","lib/libwinapi_d3d9.a":"e9ddfdb0f0962d18fe6dccc1d6d5d6d1fd2cdcd9b3f070b98af23e6bafc66670","lib/libwinapi_d3dcompiler.a":"a945ee212af78ce62089be910300d251e3b29c52daabe7a5588e5ef87b3c01b4","lib/libwinapi_d3dcsx.a":"60f643b18f4f918c417f4f7258ee4c0dc4a359152952e0d98dd9de344b0d7480","lib/libwinapi_d3dcsxd.a":"062715028b50b17bed4fa0d7c5258f813b19fe09155f9fb3589e55b6c587fb01","lib/libwinapi_davclnt.a":"a050ad2a4c81336bbddc606e4be755c69ffea0dc37aeca118f03155b18d1fbec","lib/libwinapi_dbgeng.a":"4ea8c7e5caf3f437636c7c30df9760d7778646e482047afeed952de0f0c57398","lib/libwinapi_dbghelp.a":"430c90a39ebca43ef942d1794b542df388d0efb7b83793ec5f992feba2af3bed","lib/libwinapi_dciman32.a":"d0d4e849fb3ddc991a7e85d48089860a04d38365d7eb3e78c21fa1a4b386bc13","lib/libwinapi_dcomp.a":"d3c9ca747f96c899880b33b6bd58e3ad288f6e0c069d8cc97429178d841d9555","lib/libwinapi_ddraw.a":"dce5230d762bbd5e9ee997965187219893136cd7c0c800333284b3ad1c317ae5","lib/libwinapi_deviceaccess.a":"7f6ec4878c7d5294c28f9254258596b98722ac859618883a80817c4d7057740d","lib/libwinapi_devmgr.a":"0faf91b6fbdd85be3403477dfed36072ed0525543d4b8d9ed6a7b68a1f7fbb77","lib/libwinapi_dflayout.a":"82690fd574097cc7717707c3b6ed30317f326a906acde16004430265d1985d81","lib/libwinapi_dhcpcsvc.a":"20b578bc8abafd130d53145608d1daccf4c128fd7fba4cc58d815a1dfc2b1ac6","lib/libwinapi_dhcpcsvc6.a":"c620c2ab946015c9cd2a8e4fdad3d40bb70fbd765d12fe0ec14de932d80631b2","lib/libwinapi_dhcpsapi.a":"5408133e6e424729f957755ff13b0fd032998ad4e6eccf03ae3ab8795b21862a","lib/libwinapi_difxapi.a":"5944ce1a74924fbfbc6f15aa8832e1e3583f9f0bfa3cb37daa23ae001e9d9aee","lib/libwinapi_dinput8.a":"809cc0fd5bb0395cf9688e4bf72471c60df69c707cbb0f0ca2d76a347c292b5d","lib/libwinapi_dmprocessxmlfiltered.a":"02bbdef0b20fd01f80e53d64ffb7fe7ff1162134ab8032394b5a1ee4ea673e36","lib/libwinapi_dnsapi.a":"206041acf0e47cbbc1a9966d1e39cea349f3681edea8391c8b8bc59683144249","lib/libwinapi_dnsperf.a":"b79b560261e6d314cc5d8f4bed92ba3df4a8154ab0f720c9aaa8a21880b5d25e","lib/libwinapi_dnsrslvr.a":"6c22ba18a82dcc9abe3acb084481da21087203dce52ac90a6908198f9f782148","lib/libwinapi_dpx.a":"1d0705704952e7f3b482f14520f1ee9e0ca0241bff565f90c595a2a3b95c5b8b","lib/libwinapi_drt.a":"9c7a21f7b4d7b1cfb113d3bd8ca6070f6087727102b5ed02488bcf457cb66a26","lib/libwinapi_drtprov.a":"21fbb117f8d5ae07ce008e72b263461103ec3e94bfecff343ef68cdefdd17d12","lib/libwinapi_drttransport.a":"c3219661e16a06b0a7236cbcdb29f2dce052f404bd171713566a95b9185e34b8","lib/libwinapi_dsound.a":"971f74621612a1e7bfa746502732d5a744ced5fa9ccdb696ebfb9502b3c19141","lib/libwinapi_dsprop.a":"fee99d28a0831bfcab736c62b5ec94ef0b007088865074a9a0989bbb7186fc32","lib/libwinapi_dssec.a":"bddb5274732250390e746874ea74a8aa5088a62eb092d68d71966f7e476f27af","lib/libwinapi_dststlog.a":"4da2f1146cd9882f7e96c1e534b46f8c458480fad5fcb9d1c067d4dda218d04c","lib/libwinapi_dsuiext.a":"6ee8892083f731bee1e8f233bb58a43e5329252625435305a1d27bd6d8b0b900","lib/libwinapi_dwmapi.a":"d55cbdecc52c5051616383fb037ad0fd09947a5f45d1522cea2c443e3affbe4d","lib/libwinapi_dwrite.a":"ac3c297df0e44ecd5123d47a997bc5f2de73934d9808a429132c0f1cf299feba","lib/libwinapi_dxgi.a":"91ad18a2778be45cdcf701d357b32224879432da3f32d14f8717fc238ce2d02b","lib/libwinapi_dxva2.a":"34aa513c106f1deda9f71795ebaecfc01bb800b41993846a0503691c0acc3739","lib/libwinapi_eappcfg.a":"2b7cbebd80a61019356e7168fa57c68dbc5633ffdf3f566593d54b14104d637d","lib/libwinapi_eappprxy.a":"86f2289e79ffa1509ce41293bee75785851d87be7e657126e497c1c9d9a52005","lib/libwinapi_easregprov.a":"be44f53e21b54075aa3b24a45481eccf24219f6991d4551e41e3dd97538b862a","lib/libwinapi_efswrt.a":"5394eea8d86fc66f4df8cd5a8675ddaa39954164d89b7d9c96fd48a43dfd84b9","lib/libwinapi_elscore.a":"46a1f20b5e0616af5b8dc0a7f8db8aa837ea32fe4f8118016d6a2a10f15852c6","lib/libwinapi_esent.a":"e5fa9fd1095dc6c3980191f7665523e72c421e443a474500f41f8403402bf208","lib/libwinapi_evr.a":"b29f7e7997e8bfadcc81d247c2032381f21897d0a2a5ad0304e84945f7e913b2","lib/libwinapi_faultrep.a":"d332eeac469e87925e44ee9ed41408196e87ed1f8972e81540a19f20b1485102","lib/libwinapi_feclient.a":"9abe648543524e3a6024a63a454f7d36b6758d2fc5994efb4b9a513e06348041","lib/libwinapi_fhsvcctl.a":"8f26fdf62798fc19f0aa118e9887c4f5fd715b3505df723cdf87c9341d6600de","lib/libwinapi_fltlib.a":"0681ffdc1f4e87810dbfd664dcaf50592c96b07b9935bc49342982ed90b26a1f","lib/libwinapi_fontsub.a":"07676e49f5a46143fb9c5183e1177cac26c709db1daffc839a36fc72d32e9760","lib/libwinapi_framedyd.a":"cb13a8b7974bb247d497f56f1322a9d9926bfa7b0d3f083a323415e6f78704ab","lib/libwinapi_framedyn.a":"38ad80dd8f8b3fc5d881dc24ae6ae58bf641b3bc24702d205d7a1a8769d89c83","lib/libwinapi_fwpuclnt.a":"bf9d1fe3fe94b35d019ca51e30b0c3b4df085f7ec1a8626c917a4e07eb1bd887","lib/libwinapi_fxsutility.a":"4d2baf6d2d794039e34d07b876afab8963c7847fb90dc8b00150e699a5a88350","lib/libwinapi_gdi32.a":"2b3a916c16e4f91a2cd09386a52c2824bdc4d651166644d72ef5c85c767e6c10","lib/libwinapi_gdiplus.a":"9b1fee0f9f1b6237d0d62fd121e6a6dbf9e37de5690e84e9d41a1c27faee9867","lib/libwinapi_glmf32.a":"d3124a868592e0c37a9beb8e2b6c7b3d2b94c07ae687289a6f0669132072119c","lib/libwinapi_glu32.a":"ddb53f0d0c5f4c2d411e9fded6ae8e0be2b8f9a8a1c5962806f46e9ec03e70df","lib/libwinapi_gpedit.a":"d34919000fefbb37c6f6168fed15261506b6bbc025cb195fa5420f2257c3d4c7","lib/libwinapi_hbaapi.a":"a33dfefc4280c5e0e2b8b57a3ad3266a37bad1a2cef18a308d9f6378e76751b0","lib/libwinapi_hid.a":"6f15a85717f22156e2fb9b208beca41d1c10f90a77f85a54373ad8eee9cd0e2b","lib/libwinapi_hlink.a":"5ee9abfba000d2330a8b8eecbe7264e6a75eaa769314e509d87263574fabdf10","lib/libwinapi_hrtfapo.a":"5fc399db01ea1c885f967666ec3bf784be0ca743207863f4741973b1c57a734d","lib/libwinapi_httpapi.a":"01011dc404f7c79d1dda41cc07cf61a4aeedd4bdc5d7c5e9951a48fe263a169a","lib/libwinapi_iashlpr.a":"a3f8e4a9e57bc6c4ee9b2648e810b495b6d91b9a65388c9be203e44295a52364","lib/libwinapi_icm32.a":"38f11c45477be5e7a9db97803c777be7e897f624a038ee0aa963fb94b585b767","lib/libwinapi_icmui.a":"e44009b1e129de72112e85c305c07c97891590513427866eaebeef000686dcb5","lib/libwinapi_icuin.a":"8f8e4211c97344c7e18b2dc916311be77fdd2f57277d84d66e2fc747134da2a4","lib/libwinapi_icuuc.a":"6673008d48e04f68995c9312417693a97df0f509e06771e5f8fe463526a2ead5","lib/libwinapi_imagehlp.a":"a809cff5d98cbedef8a5c6c7e42f38d3c7dfc8c11d6a9faee124315aa59018b4","lib/libwinapi_imgutil.a":"cfb14abb38c53b4260c38984aadf719f47a1bec9ef649d8a27c3a7ef0c0242f3","lib/libwinapi_imm32.a":"f26dda47a3459748d872bd930aec687840a8d13b7f4831e05a4416e7333960af","lib/libwinapi_infocardapi.a":"1856c6b82964e75147dee0e9f44f7a212cf7352bf99e34d7be3ba9e889e96061","lib/libwinapi_inkobjcore.a":"136437815a0ea7de686880b3dc93c9f15acb99df63017b50c1b6b131d6fbf1e5","lib/libwinapi_inseng.a":"41df87d43fcdf2273da7fe5bb1a569d016b4bff77b1be9b18a0805230df77a2a","lib/libwinapi_iphlpapi.a":"2fd06dd2698d0943b0395ac431ae48df4317503ac8d1c35e127cb498ac6365df","lib/libwinapi_iprop.a":"cdae05efccc1fb56df272f9b4368db1943e23f299fdefa106fd8522c33935a2b","lib/libwinapi_irprops.a":"ca9d940ec3e8d4a15cf3650fa76665f7037fa9c1019c4eada59c867057c8c972","lib/libwinapi_iscsidsc.a":"12ffbd3ff5b6fa6e35dbed15920f9ee71a844b974c04752220585a4c69af4bc4","lib/libwinapi_jsrt.a":"d84cd2be85df653a0ebc2160559a955e9ff565989ea2d4916f1fabee4b96177b","lib/libwinapi_kernel32.a":"95d9ea840920496d039eab257c28b8ade71088d3f4a57aaf038207055231fc9a","lib/libwinapi_ksproxy.a":"1e5bf114bcab137b6c40b779509fe0db92b31456ec6a5f52df14d029ff53047e","lib/libwinapi_ksuser.a":"c0e457ec782e0ee328b26e84d4aadcec7a4764eff69311788820352b11a4a340","lib/libwinapi_ktmw32.a":"d500f383a098291825867758d7c6a00334ceb9aa5497894fce4532aa91405f6a","lib/libwinapi_loadperf.a":"82d539c5665e285f6842b282f872a73408cbe34e251a7c650864c0a1dafd6d69","lib/libwinapi_lz32.a":"359d76f02d09f9edc08322b2121dd683d2478ef696d861802797e46e0e213095","lib/libwinapi_magnification.a":"780c596bba6a4662eed52ccd123316d4d5c06ffb906f483aa8a3440cd50b7bc0","lib/libwinapi_mapi32.a":"287653cfedaf4d85e34de3ccf8f42297d02e8ff53407750d82efd6d264661188","lib/libwinapi_mciole32.a":"a7f54b102fd8e249be177c0afef73245a2ff750a6ba096b7fe51c5611f88fcba","lib/libwinapi_mdmlocalmanagement.a":"aa0cc66939649aacd882ca1263c778fb14b7779f6d2d0182d1a6519d3b7cd9ca","lib/libwinapi_mdmregistration.a":"8e51628bbae7b499509b45b72666b3a7593e00924aed10a4532f08529b19a958","lib/libwinapi_mf.a":"680d1931e07461ab845c17b126f59897c31d68bdb929e3d85cca347f5d5412f3","lib/libwinapi_mfcore.a":"2b20dc1c73b1a7e3f69b1ff003ed7147a58f3469911b25b2124ce9c64c9c8719","lib/libwinapi_mfplat.a":"986fefa67121059fb0e94f9dbea92641cf7bdd168e4a1d6aa99fef6d398c2c5e","lib/libwinapi_mfplay.a":"2570b1aae5f1e4f1f5354ffc14e63b164036c07814ea4d5c7dcd077e7901183c","lib/libwinapi_mfreadwrite.a":"11d82e73075a6c7eb134dc9007b082a98c66ed4e47b7afa48de2ee14b2862ae9","lib/libwinapi_mfsensorgroup.a":"517e80d135e00bfb906ce0836a1ef6a20d7dda394f07658f033b3aa9c60034eb","lib/libwinapi_mfsrcsnk.a":"510a26b17eaca78752fad354028568bfaa6aef06f77a1cdadfb425a785f5ed33","lib/libwinapi_mgmtapi.a":"982226ffd60eae1231da0ebd8bbe6178de804554a76c32777f75820113d137a2","lib/libwinapi_mi.a":"dfa3d4f68e432b3f1601fabc3425ec5d97c3afff14177721122d6444d34caced","lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a":"76485df97f6a262297e42b7da5e4e0d8f4909d35c170e202454a1c60b7476c2f","lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a":"ce95bce7429e6f6438ca9796350761679985297870763366bd24a7481742cd11","lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a":"dc4ee3eee502ebb86eb6f254b1e8b9054b9ed4f8e10183f1c8279289ff67f528","lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a":"115f4ee281b2ec9b44c2c7d9ee36404a319324825acdd839a95bd5827e15672f","lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a":"11da992cddf9437b7962f503392cdbc324a015a4eb339462ffe490424a290e59","lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a":"d0ed125830b0d1f10d897d1ec50da10c5f9b2fc7add84c6eeb225eb604cb6292","lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a":"d4083302dacd0bae7f3ad447e67277d537647df23ddf44a399fe327f430793b6","lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a":"495cb87554da1f912c999261f5be4cddfa3e0b8af8669625d1ed3e9625d26eb7","lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a":"131bcd3b2e44bc48d739b78a6a2c162d86b4db93423ec58163ca8ebf0f4b1127","lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a":"16c8fedfa7b80e8208b99538e439d6b77348668560241978842b65fa820a18d9","lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a":"af6dc27b8170b4b05ccb15734310c6a0c5eed201e86e2bbc6772ac9e215efb8b","lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a":"55ed7347bf664967590340f71d6bc0cc8387fe76a056a809a2942410c0d5a747","lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a":"3a4f57fbd03af27049b080f6845acfac07e3c3c7bed85abfee1a3d5b9fe2a762","lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a":"b225bb3ce5569915eb0a263069ba085bfaeaf45c470f04288b41f9f8521617c6","lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a":"d81c5c1dc60979c59b7eff1b223055295343cf3845d2a0517e17035a14dd0880","lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a":"e7bbb5f9e98f85df4db9b7aeec6039c481d039c7a268ad5923c5810673c4ca69","lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a":"f10fc3c99ecbb414a1d5389b9f3d3a340f0496500914678b11565003a882fb7e","lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a":"ddd872dd19a575e3dbd8ec25b2b34c2951ccfcdd61b38427126cf0a65f4a0cb4","lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a":"7d599b936357f4ac8f38582874345ed12215252f359988c751cc60cd32a8db17","lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a":"337ffa10980babe0b17cfb17f4e44c1d243d4483ed8cac16bdbc213a99e2373e","lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a":"fe878234568e92961e718322c3c081e3c0989eeafd6e5b0ee545bfc68eb81d44","lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a":"e24ca6fd32df62cf49a7a8d616c350b344c22a0c8cb6d8627c675f201f4d9904","lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a":"a97938a9e8f5eaa5b6fb2f489f93bb4f4fc58871f2d8d6269e14e19a337a53fb","lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a":"37f05a0469dfe19cff5ece1406f4e959a063a981440cfcf3a5916e17a4e382dd","lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a":"3569117f29b0d08505df253e61c0fcee12cf5b12177793a32e7af80d2d56a2f4","lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a":"68d39750dc408b28594269d5d6ec80a5984dee8ae001b1b025002bd84e770085","lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a":"207be2f5cdbedd2fcf0e6e67b5680adcc32b8e9117837716dbce43aa5ca4b165","lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a":"ae5feb37150c28b3c344c0d395be86a28a484f4acd0b496ce183bcdcbf1eec0e","lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a":"b494cb791848ece954b1972e99e530b2ad48b4b0a4d05cba7b77bd2beff46096","lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a":"c5bee07c3af2b8a191caa6c95fd047f2081b701c3a32fcb60e979c83f8a83fa8","lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a":"d37f2e483f7ce07ea1f13da2bd6d11fd90b3d6e74b2eab16dd6675701d925dec","lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a":"4e4db210d18e80f5eab092933076a52378240696125d7e438555286fbea7bfa1","lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a":"a63ce183e48c98a1f03eb7e81d49431567e6a9e1434b950390038cd86d0c58ca","lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a":"d37b86d396eed705ff66ca7a15b9790cc771cca3781f9afe30595556b5b2e516","lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a":"ee2d2f445d8340bb7079a9a0ebfac3e776350bf06714b04d2d71f44f39c31ee5","lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a":"20a24186dcf33096ba39ecaa06144e16fa8e13508c4070fe2f4787e02a10b678","lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a":"1a7e2901d936cfb930c10b5bd01e1cb174e155d63e389b9d0f93a67fe7767e7f","lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a":"c2031a37160d4cc6cd10c7a1bb146242bd97bede479e38591514ca28f1c34052","lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a":"2c6e24c3f21548b2a672cababc065f49dd6e8c77f5ca9c0931ea3cb842dffe2f","lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a":"de5b19aad7597b6ff8676d50cb57080a96314aa4a57e483b470fe27fcdc467a2","lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a":"0b082aa3bd4acbfdc92b698512b102d4e0f90e5d1853da62d0acf74fdb5b672c","lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a":"5989b4597e769277940c2f6c0492753c09c12292b28c932cfb5aba5f4fb24faa","lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a":"074fcc7d7d03cf010f4c536a97447b2ea8b20d709b1001270cbea88240e43624","lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a":"25ffcd1067b026bccfafedf7d20505eec04632eb6af16698bfda0b7b62f93d9e","lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a":"9b2d7399e10336891b842516659ddc64a8d3d56ba014b5695c71c432d1d33d8c","lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a":"fedcced3e72d1353f075d4be8ec105b6860dca592c181ab240288fcb8595e0c0","lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a":"bf89dd69e8c7b6606b6b2978fcbedff972984423912489c955a2bd16ec421bc1","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a":"b2e414d41d55a770b1ee5510f26e49658acde1a905da2699828d74e70f1a0911","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a":"d8bd0584274bab01eafde0a2d345c795733f4f02687ba57c7732a796f6c615e1","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a":"72048537dc3a79da7c288b317d1aada14a94b0c0ed81949b2a847265da04d68c","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a":"c88dbc65f56198c6fb8b13dde3d831731c19062594ecc76d64ebd6519eaddb91","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a":"503ab8fb1df38b8c92af9084bc04970b96210820f8453a4f0a8c393dad6648fe","lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a":"7092d745039c3614851ee3be3f3515104cd868d1135bfaeef67f3ae29d400ced","lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a":"5a16f49d70f33f4a199722985ce6e006c9a7272865f12ddad38b4624c4939326","lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a":"e7bee4535d9795e94a9acd93e70a771774f827c0bcc277b7363558a02243159c","lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a":"df7e86061d0cb4f6564f0f7c0d6ecb41d3b1b37ff41804c3a340ba3046b0099a","lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a":"8970229a62f4132de23f5801940eba485dfdd1809546cebe7a18d7c0184c48ac","lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a":"91b50dd2d0c32a1aaf298f893cad0cdfb6685e20fba44dea649b89c50ed4c9a6","lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a":"3e59f3ae56977fca3e452d1c7077fbd79ba4618378d6b3f6338670da2264b318","lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a":"ba69dcc28276bc983a1bd59feda56528408c79fe18b2bc2f7245e2fbc3e8d75a","lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a":"bb0e5002cbce0a6cad7a0af82f456acfef3a7573de25ab4f2c76360185e1371a","lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a":"77067e3e43fb1db6d711b01c3ca6ee076a0ef87d96409ddba4be9732723cc2ba","lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a":"2c2e7b7ce85816c7974f605510cafc16ec3500876b490da4f462dcc967c6ad40","lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a":"af21a90245d69e44b82b66857797168b206b282a1e54cda6ca8cdd6e0c64912a","lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a":"a364ce3355f5c3a2719e3ecbe42f5b0e9e0d6b87146f7c762bd6752f0f3c9534","lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a":"9fdde1b7df00b8677e2f2978ceca2b9ef3e1539756f48fa5ed527c3d3229937b","lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a":"a9b8f92be12fc12ab7f278c5751dfbafe8a1c6c70b8a7895c601bcde27a49e4b","lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a":"28af76aedcbe8e5d2fb1e3d71cb401381a3400bb802d0f61137509ddab50ceea","lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a":"1a3d2f2a9cf9c43d2425b0200ec3985f3e411a89f90778beedeeacb7edb0929e","lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a":"4f15f699337cd42650bd16f8503984aedb70a3f1ba581c0e131a6f798f3968c9","lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a":"2602a72063a047c5767aa1d20248d701b81ce3ccde8c4ef07a6a107a9c3de9af","lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a":"3a06e02a57871cb36caecfb78fd4139ca851b66474ca5bfb5b3b2a6037682d29","lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a":"7faf55c7bb4c862a269bd5fe2be72c8858dd54b5b949399beb2892d7d4f891f9","lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a":"798c2464d813e306d061741351a2a56f570b8e363e550223f62be1c1608cffe8","lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a":"d165ef00b715eba2a96248ce2aab275d39c7d5c927c71fc2bc70cebed43b85f7","lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a":"92115b5933781d78b2d615b141732a6b8ef08a084bb97010aa844f75058ec465","lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a":"25d6790ed18e0921a38c57e1e390152a24f709e121b9b7296153720f2306e523","lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a":"2b3ef6c250e8be66cfb026436bff96f4c3ab04d9b8970fbf19cda9d24cd53889","lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a":"b549a555192a445540c93480d7c547fab359fcbb49254b75b58a6b624194d526","lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a":"c68db7f4c33cabd2818d0d1b47167672b1ee612ea70e0a88726f818b5f75a537","lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a":"e6c31d64254c944e35513b540a525cefaf4b58665d6909a8e8964415453be06c","lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a":"b218af872027015c5848985f7fb9cc6ede8cbb5451e85aaf8c51744a3acf2439","lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a":"3c7be7fc72f0e3c21668c3ea854f2d097bc8c9e2f1592ab81480e03b17fd9649","lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a":"3662cf22a2ff4e0be5e95d7aea716ad92f5ffbc3d241556353658995885e2729","lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a":"ec56d87919192c2aa2c3babe67c2dae04afa31075ba3e89bc3941c00ac3280bf","lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a":"a6583348b7e00a8b291a70c17f5290251e43c8741937b134f8fd3a56460ef88c","lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a":"bbdd30605debb51d2f2d94688716024e5d75770500205f566080006a5d556ca4","lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a":"9ae56c06c30361106526eeea1d5db47082b838cacaf8b54d46c285bbc4b6e6e6","lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a":"0349a394597567544c5ea204ed880b54861f2760876e2ccda4176900c8a8352b","lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a":"ee54a2da3a078b1d1332b1ec5a1a053e816f7a3b6ace3c01f508282e985f5c67","lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a":"0d2db7aaf08e283c04022b23d616e39f9403d7886af8ddddc02597ca3bdf42b2","lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a":"c7befe692a33c5c2c3e1f273ba2513f649502b93012ea6da895131f8eb648f8b","lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a":"d441a2feb8334a5680a8d5d354fc5a69aa63d89623d1be13f4ff600cb93dbf9c","lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a":"beaf292dd62a83315423fd580d057adec9b78aa3ba5ee08e35e9e785d0297ddd","lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a":"775a51aa310c249d057df10cf67a05a85246a0be6df6e2889b64d640ab811d6b","lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a":"5d3fbb17a4fb24d10279ebb137d11ec31b1fc3a6dc0e830bcd44e73330dfa92b","lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a":"4885b71ff3c5fa95eca7a29bc0f4a9261ee57eb77c9b5a21705a394a6b888cb7","lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a":"575b5e9d97ccbc3c4dac43496d6753209f5ee20103ff7c52c107a65236c174f9","lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a":"1796148f6e9724cb3d4059b8b79f22f901de240bc460057250a3f4dd62cf450e","lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a":"f6c9542def9f9be896602499debd7debb72808bc41e6c735ef189b29e0cac421","lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a":"464f39672be5e9ecc1a95e9074a46bb3d1beb1abdf6cc4e705e95ac656bcd027","lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a":"a0c9ea99fd5fda8a20591f2c88cf8eb52733be1520da706c636c08883578854a","lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a":"b5bed34136bdd91e155dd0b347321ef8c9189544cf5dd94f93fce3092ae8d4c9","lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a":"7426f42dd85d665bea5fc7bc7c1433d8005468902f8608b6b9ea8cb0698e2c3b","lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a":"1f7b9a3be312c964092aab8b85f2241e348ffae828447be09804fa35f040770d","lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a":"7133822afea480f54c3b6ce36cc000cff40bc50ee25c292711c14d0dd48dda30","lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a":"02a87ebca8f6206f65e958ddeafb020672cb7c68d907098e056df0ac48ccb5ef","lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a":"cdae8ce3826b8e94e76f3948eb386feb4145113d3c84d5159efc2aebb49a3822","lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a":"b494ac0d24d2da51a6bebf16be7823e09952a3fc4beb60faed04d853304429af","lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a":"90c7065fe698f38b2f24c2d4abdcd0ffc5e968c2aa9c77c40116297a71671bc2","lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a":"1de3c7cac5fb4e6e4586afc825dd2ea308a0c008e7ffc5a9a3dc964a67af481e","lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a":"799d9550b9c6f19636b9becf563b4fa134df2f038a8054d86ec3468fb6003249","lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a":"56c9013e02a91971a55e3a8f7317eca162d73187e07749e4f2e6a2cab1be28c0","lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a":"14ad208d3a557860b153480c8ccb779ff94febe333fb9ced466371a81249250e","lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a":"7611317eddaeb55896baba49e4500a2bbd27542c461747cb0ada9dd9e8f88740","lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a":"44693253b456e6e88051fae853cf6abac787f1317361237a4129466ac0460f56","lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a":"2218e4b6463c52ac282b2cbdb4fd8710b6944db59bbcf938ccc502f9f87587f6","lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a":"cb9801e38e8de95efc6c9e7b751568d21cba1de5e1e3e1150753d290aa6c1e5c","lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a":"147c26ebb856c0d66418d65b579aa9bdcdad35b76ddaea8e9eb51c1cbe9c4ad6","lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a":"293099241adaea5ddb48e81d00b692f26959d8b1b81a4dd8fdfab78d5cd51eb5","lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a":"2a3e535ca1c92f9421a5259c07d534585682d4f6648b95507c24f478b1fe243f","lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a":"75579f3ab3bf8aa738ce064a3fc93ea2a77c3a07be84b2fc8c465cfbef884fe4","lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a":"3f967e6487e80799c080e8b9750960c3133d115f8c7974ee5ab70d71ae38b52e","lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a":"bd3ff6b57beabe52f0bf678e560b412d530bffa64515393235e0fc65aa712121","lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a":"1d0184140d34f7c7b0e28ab71d16cd2b996e8bb4eb423b95ea83cd1eda494f11","lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a":"639bf97214b059e78d4fd683a13ebfb79effabd2f3c38a86ceb20d98d1a848f8","lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a":"9a7e3a5e1b55f82d12a9a2e927658ee9fd925658e8586cded710d79c9d979e57","lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a":"04ff7d0965ef4f55369eb1fed1334a6b25e5e7e0767da732cfd43a70b18a180b","lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a":"9f06f963a86647f8e5454b1e5a30dc4edacaae156eed0fb22ab322a71072102f","lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a":"b39db949209210603da7c0f15ade2d206e92b8b519cc3a4d909d30d93531f79f","lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a":"8c2e5f4cd8d7b65f0107464206636579dc23de724fc082442234a501068623e9","lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a":"d4058a3f1d3680a81c151b15d33c73a4b5e912120ffcdc176ab7e4c7a1570b25","lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a":"a358042a13a9815582fa09b992ed9ca94c28c4de0c8345faf1852cf7579922fe","lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a":"e53544c3ce3f33431748dbff6e04e718868f1941ddbab5757b332d0bd42acec3","lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a":"6bfc8493bda22dbd82cb0ea3e3dbf34cd37988cb593480d0527d97324e5820c5","lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a":"b867beeac24056d3f25d5d7047a2b864e63db9b257e625513079ce0e172402af","lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a":"d29586bdb7382582f07ec2f66309f10e5ea36783c0c7d5a400bbb3889807c588","lib/libwinapi_mincore-authz.a":"78c90a4f4fdfab54ec3c9cdaaed95bcdfc1d5a904bc939d663c415ca4138ab1a","lib/libwinapi_mincore-bcrypt.a":"8028ddda07a33cfa4c1d0b1557a7fba85ea809c0f714532cb4222df561f7a1df","lib/libwinapi_mincore-cabinet.a":"99074d908dfa970113bfc9075dd05f6125982eed3f201588b7cba7e46d530146","lib/libwinapi_mincore-crypt32.a":"96efd8c18f1842c08f5c00c1e8781b6abe66db706d1f8bd7e4ad80727d13bdea","lib/libwinapi_mincore-cryptbase.a":"e4cae4a43dc43263c3189b607d6a28bb379b741e874802c6e867571a4c617a34","lib/libwinapi_mincore-cryptnet.a":"ec5d7b695f29b86a185ee392050a6845c19890afbd7ff517746ba51b833e0b61","lib/libwinapi_mincore-dfscli.a":"59392a64972249a746bc6fa9aee7ec2f43bd90f7edf96621874e7b1572b9a27d","lib/libwinapi_mincore-dnsapi.a":"c2b4aa0db97117ecd9ce97dc07647dd63d35167e91c5af0b078e4e37db3b9d35","lib/libwinapi_mincore-dsparse.a":"a016dd7f536dbd25316223eb51a55b4efbebf6e01e0e258a5f3b7d891d92e763","lib/libwinapi_mincore-dsrole.a":"7170af583eb32cc16cfeed9ac04de800c9ca29ab9e4f8eda3179c9f2ba14e5ed","lib/libwinapi_mincore-iphlpapi.a":"9a62c837eb80f1f18658fba4b0b3d4f2da9715b72301e7c714c8616c566183c7","lib/libwinapi_mincore-logoncli.a":"5ff77d42dc2c4ea94a04821d923ba949c9dcadd1c67806698ce5777f55894179","lib/libwinapi_mincore-mpr.a":"5bd99b5c3a615bd12ff81a6b25a33acd47ababb0f53b0b72b8f32f0c3ba18647","lib/libwinapi_mincore-mswsock.a":"b059e1eee395e608bbbfd95c4206041c9746652c19bdbb0bad0863950e9763e5","lib/libwinapi_mincore-ncrypt.a":"8e4014e7528270f379ccb28b1e18a623497e3a98177f3b6d0ef1f49106417c8b","lib/libwinapi_mincore-netutils.a":"78345bb6becd68887936be88abc58a258f6bf20156fb8ae4f0560d44eeebda90","lib/libwinapi_mincore-oleaut32.a":"49b78e0b2562aef799df49a8ea32a43ec593498ee0b6477f74b24f4eeadde287","lib/libwinapi_mincore-rpcrt4.a":"e8f651a7e06a3f4d2f5c3a6ede9f19c710229b18e66b0463abb937501e487150","lib/libwinapi_mincore-samcli.a":"7ae6ea2a6fc33eb2e664817fff4ac87002657b628a6bd05d596b6d05d8c2c891","lib/libwinapi_mincore-schedcli.a":"5e260d4c0a255d422cca310cca1e9c44d15479b07931aa50d99b90a45b9e9728","lib/libwinapi_mincore-srvcli.a":"2627f35c6e08b2180c91fccc2e44f3d38e905150a716175e263b83b41bc27db0","lib/libwinapi_mincore-sspicli.a":"7906f8cd451f63d520328db6bfccf85997e569b65f21585036a33cbd80dee600","lib/libwinapi_mincore-userenv.a":"46a3e75f2b40c32186d6c6f153127d5953d457ca39dab64d981e5e67eda27159","lib/libwinapi_mincore-websocket.a":"257a0439a55f732fe53a81c116a917e00aa7639dc5c422b126845fc847c501fc","lib/libwinapi_mincore-winhttp.a":"a227894d136c0c0c251f9fb385b1508226b7330b446010b4f9aa394b8c8192a1","lib/libwinapi_mincore-wkscli.a":"a744cd61255baabfe96463b3df9427e48af630b8946cc5ccbdcb2fbd61b70713","lib/libwinapi_mincore-wldap32.a":"433bedfc97cba10ab1069ad965653762a5529e37689197dfae8b40832a96a057","lib/libwinapi_mincore-ws2_32.a":"0bcd38e75dd94bc11c1a05ccec976bd2c9dd2ff65d01649b983f6be1b58cfb26","lib/libwinapi_mincore.a":"bbd52720f360b925bd6d3838a10407029f4b3659771bb22dfcabfe5dd914e97f","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a":"c028b2a23e1134089d5b3e63d7ccd3e7d6984b17fb837755cb3569162cdc92ff","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a":"be31168bd95083953baecbc47c6e31a6563353d4dee2d378db4c7de0da119847","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a":"42812dc895f6489f96cef6e05131083afe8305a97eeac2aa580291831206d44f","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a":"0bc587f2d6418e987a6f9c07e6cf57cd2bc5d2fbe76a94f558e91d5dbcf9d18c","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a":"a9d7438cc5e37c1bd98d7a3cdc8e587b6a03310f289003aafeac05a4d5d6e205","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a":"55237a627af67ff560fe0a008270b4d408aed6192d5c1fa53bec4b7f0bbd1559","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a":"9d5731e369dae3f6a7ea57f9fbc94cf9500a2b283507f53038c8e089c1c9f797","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a":"fe02038c2d5eda74736dc4efcd6c9139464f680c1d6b74fde9fa4532b2edd894","lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a":"53b0522c269674cf18f43b64755dc378c90e15adbaa4e17021fd7e5793c24696","lib/libwinapi_mincore_downlevel.a":"36d63238be9e28ba41d89c21b6e4883b8bd01c7205e7f32d71848c9c762fe5ec","lib/libwinapi_mmdevapi.a":"56e34422597206e90ad3f7174837231f60652ac407f3645da6d08ddbec20df01","lib/libwinapi_mpr.a":"7406a65ace451acbd8974ceee8286f20e9159f3d2a164602afecd9bcedab8204","lib/libwinapi_mprapi.a":"ceb642c2aeec33437df6c092ca94273e3bcfdd859a484a4a2d7a7968a37e411b","lib/libwinapi_mprsnap.a":"cc44baa98a5414a6a5ccbda8a0de5a2e618e8beff3a241cd9002739eb051cde1","lib/libwinapi_mqrt.a":"9892fe3cc11c52076f8d9f5cbdcea5a5206bff0d217dc65d0828c65005f4b533","lib/libwinapi_mrmsupport.a":"63cdebd6fe466661f10a0c6bc3404d0e54e64d692e94ab007e95805c492aecaf","lib/libwinapi_msacm32.a":"f60a75b3408003c0d8b5d46d1cbfd5a8c992dc42adb1e763d58528df25fafa49","lib/libwinapi_msajapi.a":"a0b46a7d600516877f94edc4548586b7f073d4e6ae84433ef69b351b9837c069","lib/libwinapi_mscms.a":"b5fc1891c4e13744871a8b7b47445ab1fe5c142c1edb469d842f3b9fe977bbcd","lib/libwinapi_msctfmonitor.a":"510636f80e65611b8b234c15daf0756e23d00e6b2c33e10250ac03d892393a4c","lib/libwinapi_msdelta.a":"f45d9f984ead08c81c82aa6eaa972f76406e121110d276d735013194847b056d","lib/libwinapi_msdmo.a":"aa3b4a716b8c0d6d7bd5d3adc4709660dccc9145e202a3d9d666d099899ae37f","lib/libwinapi_msdrm.a":"3c52ccff324fe4f064930b829c5076a74780a0ed82c7bf717e5aacb034d11885","lib/libwinapi_msi.a":"0c6aadc211fd5619b0d49ad64281a158caaee1660613fbfa2e608029c00cd725","lib/libwinapi_msimg32.a":"b957bfe3b092087c037931bc32af15b6f34796b749935f3c47ee255c7ecbc624","lib/libwinapi_mspatcha.a":"4c3bbfd791c2d2c518de608139bee2795a2c17f654326d95c2e554d86d946c29","lib/libwinapi_mspatchc.a":"601f4995cd4c734203f4ed75266dd89a2cc5066b5c0a3048767d05e66b21e679","lib/libwinapi_msports.a":"fc87678647395a4dedaae3af5766b4c5f4f394fd542377b565684aa0144c7d24","lib/libwinapi_msrating.a":"6c9acbc1d3426bb5e71f2107a229a152f81d0ef7d71c61a508aae7f847e6d957","lib/libwinapi_mstask.a":"9b32f0e7ad02309bdc681dcd48fc5c471b312db307778a1021571752f75663fb","lib/libwinapi_msv1_0.a":"93a80a8ac2130ebc3cc35b120f79391a34c83daee7ef33e11f0f6dab113292bf","lib/libwinapi_msvfw32.a":"3cf557fa7f9f31f23d8f498add4930b6ffc304a055d371ff6d59c64824134e87","lib/libwinapi_mswsock.a":"381afc6ec584272549384654be6f1e52139a3d6768a6d9d101258bf92e711c2d","lib/libwinapi_mtx.a":"7f94c16ae24a21d23cee0914d0bc1fe96e680c54d40ec5ebf47007c16748f4e7","lib/libwinapi_mtxdm.a":"08081c65d362502423aa0e9113658f9df0f4022f87be81592b5b059fb3dfb66e","lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-0.a":"423f0645557c42b13ac439544e73ab721577fdea996615604d641c30f111b86f","lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-1.a":"61df616253b837284b9541c67086d902162dff7b2c915f8b059abdca33a48779","lib/libwinapi_nanosrv-clfsw32.a":"3b4d6434f3a4fd39e6d1bf4530e25d654bd24e37e685a22de23fc2cd378a57e4","lib/libwinapi_nanosrv-clusapi.a":"e55758fba6a73cde2f06124b8014860a39946df814158d8c0d6328b266b9a090","lib/libwinapi_nanosrv-cryptxml.a":"1d8444463051db7479bb541da43ccdb303f581ca8da74bd7c3fe5d4f5ee124b0","lib/libwinapi_nanosrv-dbgeng.a":"c2229ccb5959f07cc33a3553a2b96257379b601ee5c934fc2dc3173dede7fa95","lib/libwinapi_nanosrv-dbghelp.a":"4c5aa4edfb424c9b646f69e61f046e830a576a3cbc299d959b9b68e33834d5f3","lib/libwinapi_nanosrv-dnsperf.a":"51df95c4624745ca014c4064f9791d5f5a87f8e140e751b631078369cd951b67","lib/libwinapi_nanosrv-esent.a":"a27c8b50358d89cc85b5c5660520a912d5cc553d58acf03ac68f61d687a5c4d9","lib/libwinapi_nanosrv-faultrep.a":"9bddb8af62f936b76c9ab737b5e1a4fd71fe50e7d593d0226749f5fdf6b9753f","lib/libwinapi_nanosrv-framedynos.a":"ad8888d9f3426524fbb7ba5642ecf9173a2c8c972e6dc8a37ef7be3c36fa7fab","lib/libwinapi_nanosrv-fwpuclnt.a":"fe0e1f4ab2120396508cf4c61599cab66b8d1cb6e23b874a3f6f97879dd6f904","lib/libwinapi_nanosrv-hbaapi.a":"b9da44f2995f25608cb3eac7bc128e5ee5081e95382fbfbb79c3d9a126c2393f","lib/libwinapi_nanosrv-httpapi.a":"b58e460ef867312f210a6c914b74645eba848c957fb915bf75f0a06164cc438b","lib/libwinapi_nanosrv-iscsidsc.a":"780bed8fed327ff5169fdb6d9d261bd2d13cd8e41615ec7a2630a2ec1d366bb8","lib/libwinapi_nanosrv-ktmw32.a":"a266994f59e7dd4100a7434a10359af18bc06d65e24da38cb67b4869fe449004","lib/libwinapi_nanosrv-loadperf.a":"a2dfbb2b3328fd5484a1297ba7559fca69456fe5185b1b9966b49985bf4fe3c5","lib/libwinapi_nanosrv-mprapi.a":"dd1e92fdecc614bb55400cad71e05748d035a30ccc8be3112a896dc10ae3d256","lib/libwinapi_nanosrv-netsh.a":"508ed31e1dcff117a481e22b1a9cf715603e39797b1be841c285fac1242bb111","lib/libwinapi_nanosrv-ntdsapi.a":"da6b41c87a140aa5955e12146450c06ee69def0b4403df08fff03ab360691f03","lib/libwinapi_nanosrv-ntlanman.a":"e388f2e52d7725a131458fdc5b3819ccfa4b9693ee744ea60774b55ee8b1d97f","lib/libwinapi_nanosrv-pdh.a":"0293a1dc8cf65943d752591bab9fc7e35e52d8d3e434caffe01501efa12c7725","lib/libwinapi_nanosrv-resutils.a":"d07b9ae21e09e9fd1cf2a34e29d15083b4488cd379e86450e43fe96c94fa7c1a","lib/libwinapi_nanosrv-snmpapi.a":"23801069b59bfa63e1ddc1215952bc7cdf5c3759d737391b3f0022e3447fa342","lib/libwinapi_nanosrv-tbs.a":"0b238cecb91ac3f3009dadcd6ba5ab97966dd8ffb04fb2f02192b9d684572cc9","lib/libwinapi_nanosrv-traffic.a":"f785453c167afc1c307ccfdfe118623dbd76da7eca57693f8c3b0b48f5c99f54","lib/libwinapi_nanosrv-virtdisk.a":"e00fa531feb4605d0c57bd0fe666013cacb32f6a6f3b507783db1e6fc30bd5bc","lib/libwinapi_nanosrv-vssapi.a":"3f2d034551025175703eed381e2c7a57f066c338d03df1e928d65824cfd66a4c","lib/libwinapi_nanosrv-webservices.a":"2ae64d017c4e93543315c80651b85c50fe657a436dfa4981ccba86267fb1a27a","lib/libwinapi_nanosrv-wer.a":"63a98d54282376fc4164514ea6b3d0e52b24af62b2061e2f4470e4ddbee524f7","lib/libwinapi_nanosrv-wevtapi.a":"a92de1acd31bb0de7561d0639d43758d52a21b36e4bf31301e0b6684c7f2bb72","lib/libwinapi_nanosrv-wintrust.a":"b64d805e86062b99e3c91852e0d3b06cc730275353c6a0f5e73d37035a2d4452","lib/libwinapi_nanosrv-wnvapi.a":"4e9cc9f9c40c69cd8a35b347c65281340f8fee3a62c95589c4af382904b7113e","lib/libwinapi_nanosrv-wsmsvc.a":"ebf84b310b64ac901848e585bb2dc70052555685e327de26af717bde7d4edeb4","lib/libwinapi_nanosrv.a":"466d7a38f0751d8d45510cf885835ada4c6b620f04010bfe78088cc3af4466a3","lib/libwinapi_ncrypt.a":"9528d1ea3137810ff543e4a400e45694b3012bd020dc4d16d822bdd4c849c345","lib/libwinapi_nddeapi.a":"925181b8f854a2d3d1199c295973e72ccd41c6305d0e02acd14531f19a08e2c0","lib/libwinapi_ndfapi.a":"5ec4360cbb064903a5efedd5396b57a10233c377e823e69b95766d843023e11e","lib/libwinapi_netapi32.a":"feef4a95ccf8733c20ad24c3cd7ca44637663714121a5bc94ec52d0f7bb10613","lib/libwinapi_netsh.a":"72aaf2d1b4ce73e1b61d60fc82c7e9e4f2d02767bf25981012f3359ca7cf2114","lib/libwinapi_newdev.a":"90773a4fd90abb7e64c3bc5dbccbe070ef0035bc66c5747187d683c933ef2c55","lib/libwinapi_ninput.a":"34a426eb6ad23e4d5b6e0d947d6e10ef0dc119157d6d762be4926bfc0893c96c","lib/libwinapi_normaliz.a":"7e1b6bc02ace0c902a18244e907446411155a5fe5dbeb8f160bc5198c804266c","lib/libwinapi_ntdll.a":"3f2d8d2a13023b62c490611cb24585a8a5cafacf794e9ee5655a90678de03fe0","lib/libwinapi_ntdsa.a":"4137b9f3447a798fed0f916bcaa82d9413ac98fa1a7bc6dceaeb4e0ae7f45bb1","lib/libwinapi_ntdsapi.a":"b8671ed8ce19dc28f5daaefd891f6e621610523f180c70588764107b57ffae5c","lib/libwinapi_ntdsatq.a":"d2c39463900a5bcf52561dcac9fc8527f3a0348f61183f1b1e4e3b6e782eb8e4","lib/libwinapi_ntdsetup.a":"9d786bc32c3f4f9ad534cafdc07e81a9c375618eb6e1f342f7a89b9d1258f184","lib/libwinapi_ntfrsapi.a":"9c3095b92625fef6531bce0d2d08536f83fca0f8ee28d495f95976bbe73619f9","lib/libwinapi_ntlanman.a":"1bc7aa39f5d6bb0af7b3863d4902027af95414b9246b244d6b40c306b6dcb74c","lib/libwinapi_ntmarta.a":"cf146621e756a21cd45bb9ab5f4d8a016fa2081dbf4e108861b2b131dfde5d9f","lib/libwinapi_ntquery.a":"652de6a12f9d4bc5fe4462f1b476f1ad559d8407eafc28e0080bc59a3ad57a4d","lib/libwinapi_odbc32.a":"5d8ec8c2a587a5eb00eb8f6f08d7d7e00ed1e03cfaca2070efb1d0f4da6a9562","lib/libwinapi_odbcbcp.a":"8c99d188cd45f740a2a58ff7281b611ffdcf651be2bbb5af15543b60f872f6ea","lib/libwinapi_oemlicense.a":"bc88d3b4bb4a91945e8c288539e415d2a1ce5db6d3c342f3ec5860ba1e300df1","lib/libwinapi_ole32.a":"7ef3b297c9d0c5cdf5ed7517247829466da34fcd19d8348f3f2d6c775ca3ff65","lib/libwinapi_oleacc.a":"ed4c0afe844de194371ed21f8f2e18b48c80eb42377c143baba7e70dbc556456","lib/libwinapi_oleaut32.a":"b25824f0023161a0610e9c7d6d9731ebe7b541c6a31c34fa7bbe552b6754540d","lib/libwinapi_olecli32.a":"b3dd8c5f9dc52bbc832c7bf850a3e738ebd9de7b0fffca03b272721ecb687886","lib/libwinapi_oledlg.a":"3ab9a3c0688897d538e66926b1f01ad88719ac959fbda99be2f661baa9c24097","lib/libwinapi_olesvr32.a":"cb7cfb28a777c5f9e8cde3067d98fad5ccb3526acc5d9bbdd5d2d1bf981c37e0","lib/libwinapi_ondemandconnroutehelper.a":"0bcb234cde4260ffce27aafb540bd893cf99415dfc9ebf1060876e06987fbfa9","lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a":"0812399abc86ab0215582f2f91886652038a12af419cbeadf0a1ae52168f5467","lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a":"74994ed6e3beab0a6a2a7ac5c47c0f965305447c1a94db08c9475be3918dbd34","lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a":"11a832d46628bf355e710643dbf7a4497fad47b22c2a5510fbce5bd1619fba05","lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a":"553270f375f8be0fc596cb2e1435cc96b54a8270cc2898d6118e926c7a4131e7","lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a":"94ac798c39cb9beb94082a6a62d55cf28a1122d3d81e982f2727a5548e96d27e","lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a":"000e19cab23d0aaf80f3d0421f217df0855fe6406418d898261125947c806b30","lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a":"c2f2465b2f801de6e60611e2341b7f6fd5816042fb0406edc8d6c283331b70ff","lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a":"512d357839150ce54a7e49d33f51492015a553babdc33cb4f38a60e61f6ae5d8","lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a":"6aaaac3062b71b8c27397b362d1cd37f5ce0dd95bbf59f8993498dedfc960f4e","lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a":"11714e54306dc6aa754da51731b711211bcce620d8f353ce58d4138e396237e0","lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a":"e772713586ca9e3760e48d3c582742e68a06753f0f9417f9013a4393c5267fa5","lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a":"d730564120a07cff27689d061caffe675421c109f48325a734c268afcb86ffa2","lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a":"225560d62b6c7ed4cd540a98e7a13bed54860adc230390b182a8636f91739b63","lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a":"aa94d82f882c7de0ca31a5120bd50387bb8cfb1bf46b37d667562d31a5035153","lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a":"f229e2c630e9f0ed6393a116562b55f32a9eccd82db8ae7bb7dc59da6030d711","lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a":"e9a5c6d8fa217a81afb3265c8eb25d879f714974bc8893f3487ea82b996bf19f","lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a":"3ca35a5579d682998fd8165c7297e7897e878d314d8e4d36c9cad977b1bcf16f","lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a":"af5b2c57682045533e88c3b0cc2f135a18a70e92f1aef01d63d7004ec967e779","lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a":"99f6670388088ca1887fb5dd1c9137431bda35f9a745c2a1c44c799aa48644d5","lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a":"f573eb9a19338214d65bb2761ef980505f8e2c5baa1dd12e7c5b42ece09f3c49","lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a":"3cadda78b2cf277479cb4a02e46239cc21758571f3624e95eada3f7ed1bb2cba","lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a":"dec9e42133f0bee3d7401ef0b5047b4f256a9e04a93e009a6bdc74b604815b33","lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a":"3bc506d06a39131955c3b4e29649f46ab06151c3fa4fedbf869d8c679530929f","lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a":"14799617aaf44690708c4fcfaff49a70e773fb9b8943b88211a96c26f1a01280","lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a":"52c25a2c52724b98857d34dc5aad36282823fbb932e51f86c9d5712d9aec5df2","lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a":"252bb3e39ed81e47c3f149119859ec65ceb2d1e65e7288e0a0bd0f552d56b597","lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a":"e2df929933e2c413b3b8dd9c9f16abe5e2543ba89b9cd74a427a10a759453220","lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a":"04cd671c6e0dc98b930c832db1c26a90a49c9073b8051dc23817cb56c59c559f","lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a":"36501ad8bb5fa4f78dd28471ceb93b98e211c1dd550c0e3466ac97470fa7a3ff","lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a":"0337bae492fd8e18731498095ac2a0ce523fe048eeff4d2159b4704bba32d7ad","lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a":"d59ddaa31a6c62b75b6ebccb0f85c6fd454e87165127b1e4bc6bd3f7493c0410","lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a":"4cb5b72b4737b3c953ac5d46d6a7438745f4f0c1d0d71dc7a05f3926293d3739","lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a":"9e7c0db27b3362214c1b2d18ae63bb4d77b66b6aa4a26e104faf176a9584da05","lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a":"386beeddd388cfd272c8d851e1a16f70f6c2e0fd467407651f548c90edbc2ff8","lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a":"a51ece2c03202c0abc6b8a85f1ec7a6ef459cea1d1305e87bd61820a0b80151b","lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a":"3256c7a1b9a18162d1e087c01833decfb3b423d9bdc798d024c0181add03279a","lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a":"0cc7df4c4e9b351e98f855fa535705aa2e66b57419e21f5bee873e37f428cef7","lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a":"d10c5a1bb1ea57a670cdd1963cee2634162e2609b603f13f0540ac6820d99639","lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a":"6c280211556cbea0f974ae0184f97d9d77062e2005068f017db1a37355acd452","lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a":"11199d60fb9f6ff631401da8add46a90420c36bdc5fa9f775026984c514ce1f2","lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a":"0e33bd2b47ab2abd61e9c8192b5bd6b74b709aa88eac9e6543e144435c233ab6","lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a":"51f3f8a48bdf98220863dd08254cf13bacd3565b775c277a579a995b42ef8511","lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a":"0c5ba3b62f84a3c09f9fd96d7cfb095c32ea239945df75105b8ae3c8d4d68d5d","lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a":"5274984398f2722c8bd9de4379f861dfb459e9996adb161161f097477a12996b","lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a":"9b740168c4b0c590322d58c04a4a03399a6fa5a4fb3417c7a22d536b13d62258","lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a":"3cb8d04859c3d52d7fca1ec72ce333dc80f57edd6d6a2e4469f906572af2cbfe","lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a":"a46949618369e6ca98b4ecbf9a7ba11e0a499875a57b7d3823e2d47cdad51ed7","lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a":"ef84da9b01bd67d9ca5e4cb6e7cb940b0c87e328433ae21622493cfba643bad4","lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a":"f1885d437d2c71a165dbe1acec1004e9c0e46d867b99c98f2b8672ba3fa65d0b","lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a":"00e3af3b885ebe7168dd41ed22ce70ed0d86c8b3e177d5e75cfdea6b7c58f10a","lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a":"f625df3356c5b38ee99a3b333b64711e44a624994995a9e10934668df93097f9","lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a":"ee0ac0735a10054b65f4938215d7e41ef644f9b2e5e81af6659868673c318cb0","lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a":"903ea43d84e08de9d666196caa15153b08e662a928ee2e18215833fea3c11f39","lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a":"37c8fa3a59f8f90ecefed722ba2c803b9673f3946d0ad978ef9a0de85399f448","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a":"0866b4788c59fe3bffdc96eef646b2f478ec36d24933fbaa8a8f33f92f97e428","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a":"c81e555151a68d16ff8e04ceb9683c0d892ac05194a4d69819c60e5ac2c7a764","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a":"f53901accee09d4bb6a1a9cd9bbe02b7c064885c4134e7ba41921264a057d1af","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a":"2da3e0c1b26cbed327d20ea42595819e6c4f35ddcf891539adb76c222a51572c","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a":"95c16a2c24de3bc76574937ef81202d79506a8cd02ac9fad8ed0b2b8cc6b4986","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a":"fe9f7eabb02c5db5bab6f22e76843e93b9a7a1885435ffc51a50e5010bbd584b","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a":"adc4ccf4230b51f7b8a52af5076f9a236817234dbdcfcf3d4268c35d9601b982","lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a":"b758191d8a9d730f571b6022d466ddefa3309ac2980a4da350bf48ba424386d8","lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a":"a22ba51cf66d25f83d07ea6eac7e7dec65c084ae74046e7247c5e3dc2e2140f6","lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a":"68677b52813aa0b0ea5ef424b7855f96dae57ce90df274c58d602a5ca43909fb","lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a":"4e39c567d18195f2ad4da9a8f0bc2b78118ebf674f2d28435c2cad4ec0f118f6","lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a":"09f3783f156e9aafef1513f82b111e153d4742b8060e811234d08ce4cd7f9df5","lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a":"a690308b96b335744482dc37e8e60946ff9e2ae1010c5c35547a1f4d03464e00","lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a":"4f1aa0006bb4f60f02a8202006ae9e28330330f1a7bf43a5c1a84eaa55e64ae0","lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a":"4dd512fa973a9af26b48beb0cbaebd4a0e0fdbb86e5e39cfec515e4e59915766","lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a":"36b1ad3787f9e65956608eac3851959246de8440f84cb6714dce8b97bb340eb2","lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a":"bbb7f176f1bd373f4344722d6800b27d3aad7e47e8ab588ce204d04e616c4488","lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a":"ae00c55870a9b20bee701ea81e9886bb34dce92581780b12d523b46f6b2fa2b1","lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a":"d31290baa301772ce4aa988d2d5b8f299c199b5bfa887fbd5473102cb3babc07","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a":"5240bbda416bb5ec960f7bbf79f08d475f5506000f72f1d9cfc9cd66596a06cb","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a":"bd7235df3b99350337da93eed158cca56c4e78f3642b93e3d5ddcb0e9cef34c9","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a":"2e6a99934abbd9efabdcbf881a5a98aebe2fa66ad8666c8441a68255de78d95c","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a":"04b4aa2f4348cdb534d9b6acb5928ad215dcbf3bfea9a722be3dd0ba9f6082e4","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a":"ce3cb40fe7191c017aadadb8014e4350151566c1a8699604c104e9853c63c828","lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a":"7d57f64caf57b70d1f608c9c4232405203217721d20ba21addccad59a255e860","lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a":"91cdd0ea0d8ab1b7c6a8f6d14860d465b1906dab20a087da0e056531bed9b544","lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a":"7378bc3ed7e88fc2f6183fb98e455fd749d14eef8a4af1247625ffb187862a8a","lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a":"556b0d07663cd467eddab9f790f0a0c74e4dab4c032a0ae2d2f9f43d7e07c9a0","lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a":"72a85c923fc506a03ce0004e0c8b1e4e52518ee8ac820b8ebb00da4d6a3ef9d2","lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a":"89bc3d4b973fdafec0c0d3c3f90d5aaeef251151159c492b74893dd395fd6818","lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a":"94334cbaa4d5be581a2dde5355703c7fd15ca8073b782566d8723b5ab5346875","lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a":"7a66ecb0556eafd9eb5df60d1f803b2b8aadd97b774f9411531a4a3a61ec6bd6","lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a":"0f267f6e3eef425ac76f6e7c0bdf112093f41aaef21865658ee8f745979042f8","lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a":"6e79e97e807cdefc677bc39f2021a72f35089a454c3f5ac7338851bad48e0e0c","lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a":"2f58c2aa61bc159d13daacf746353279e959b2543c48f32ac0c848eba2a66c53","lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a":"6bd0917eb64474d9759928e9a8573bfad27ce0100b5d0b135e6fd8764dec52bf","lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a":"d99e384c885a50e3eaa338fdd3622b203f3be5bb27963ce885ec43def000e887","lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a":"324b59dceb78356919f696843114145930f8c4e8f9d927a7bd7bd1b4ce29ab11","lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a":"446fdd1a3f8d9e761022248c8442e7c9db0950e50eedbb9ee7839c10cdd021ce","lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a":"94490242107b24a541305dbbd617e8b04619ea688e28269ab0a685daec51a054","lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a":"c4556ba06d127b26cb13af4c60f5a35a13e7ff78ec63fcc2e5a7f0edd13af81f","lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a":"ace2860be9a90df5c430acbfaed6054a27a978f9e98f4a0604ee4b2796982741","lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a":"1234e12026f9f68bd59227aa20c5be4324d2f04eb9983a8fc99ab8e8dd39a8ec","lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a":"7fca19a6df8946d2be7f55ebdcf85cdc6a267b9ef5bc9fa26f47867d3fa4c132","lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a":"909e60143db5394c1207eaf8ceddc6df9be08cf595e012611d1f3f5211cc53bc","lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a":"d1143e676ad231352b8b00bed0b485091860bc3ce6f5e0f8b137a3580ea3d4c2","lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a":"ebbe6e1ba85d1433cf9d9026e40a104b102241ebf947c025a4859e91e0694343","lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a":"e119951f4458646e6ed9c43bbb8de80e7036e62ff455f98e1a9aee25d2e28cd6","lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a":"e85b0a4602e1e77c8de8bdf7f9e9b13e57240d1496e28304d9e8a092e4e1c12d","lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a":"98fd2d3982e8e4713beb48f99974e73fd544cc4c2aff54e50109db2a07c14e15","lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a":"bb00b81fd4fb193c85a6437b7ee986cf2e60362fb32831ca88f7dfea345c29e5","lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a":"dfd8122b210a76758087e8c07b1ecc52f869d615d98ba3e4e76a90005448d5b2","lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a":"b3b71a4db59b0c5419869cb5cf92c14fc17381b110b17cd4cfc8f5c4c74479a2","lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a":"ad90128213421e6758c154b3e84c259dfb6d04db1986926342258a933266684a","lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a":"1684a81e385a25f8690233b4b2e66695a955b516bed25c0da4ee59ddae5e79ce","lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a":"bd31c35d7daec22904c6f08ed6ff684eba9b8e0f1b51ab22c60aa41667b4c3ec","lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a":"75e7e87e3f11ec241326ee839455f3e347771d56649390ffccededc021ba543c","lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a":"c20fbea2b3cdbc0226a08468a264354da50434ac664c737496fc9d6c9f84e2e1","lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a":"750b3188270989da73a237cb9a0d1f50cdc9e14711076161882f909bc98b0b5a","lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a":"f01e53c0fc755a96177623988e55f1b90cfaa5ab461ae94a30522a52a3cc626e","lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a":"ffe64e3fe1cf8b31250e77499e0dc7a7effaa0e9c8975affeb23cc6ad9e62e1a","lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a":"b9bcba8e05a69402ed0d42c42d9f3a0b02a78f049a3414866c4cb612e52d3d44","lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a":"1378aebbd3383751ac51943e258afe8cec4ca0642a7de787eabb867900beeeec","lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a":"8415bd37b28325d9f12ba022ecad9cced0a1a53cb98bd2d7bf5ca08f434af9cb","lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a":"5a386dbb47081c4835d4c712b5530c7ee8d2307d0d04c85d473011d20933826c","lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a":"4694382000fbb05b54077132f0a5022a90a2eedd7973fa9d6e73ed71cb1a0350","lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a":"95cb9ab35d06338b411cd22232df3f4ab7ef0a10782859f5bd861a2d3762c6b6","lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a":"6d104770540533f00fb9b96ee8416a86483c692bef598804a55d73a8b7c56130","lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a":"099570484acd8b263271b80cd6027f1a0ae98d2970acd686f63db6790834a55b","lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a":"6f1090d7736991cadfc84ee9a6bda4410059142255d338990d3065d335e3de85","lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a":"cf77b087474ef60964614f323df7b94cc3f2a915860a7543ff3f35d9e773718b","lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a":"934ab5b1cd5a2a1bacb740e06d7bb028845d17185775106ee02456320d154c87","lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a":"5fe3329d1602f505c2336841d3984b3a894ad551dc4a0935d08035fa85d1e4d3","lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a":"65d6ceb10e4bcd2d49e539f2cd92e0eb598a74ccddff21b72c55d184b9eda1f9","lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a":"ed400709404d9f5a06929518da72eb212768ff315c08a66a07f3ad2b40a04310","lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a":"3eec255608b4a09359e6213d3222fe2bf21a6eb3584e2efa40bdfeae1ec2eef6","lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a":"7795df40583158c625c53dbc6a567ac6074fcb89524207233915a42e6b192842","lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a":"540a4ca86c9a10b5279437858fe0b8aa3265ada2c362ef60adfdf4abd8617fc1","lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a":"ea94de89764b714a3b8ed0798f727699172cb496b91eaa217afa064def19d268","lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a":"6f20ed61a65bb14ca16df5c3036cd919b5a41cb437b8b685a0c496d794255d5c","lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a":"5400ee8df09fa91470514c59b0c2d3862f19ec17c2ac53ab7cbeafef87e53a89","lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a":"3c261a651b256e46bfa7bc518ab3c13783b3347ebcc8e02605f602d9ee0da1c9","lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a":"a622795b6f3ba89aac17004549109f56eabaac6ae39ab3a92bc036210c3c39ec","lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a":"0c4a4d58b42e982a269654a9b2a532f365e6ef6c2008dd30d4a9d255f3d24f1c","lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a":"cad2d51ce58c2ebeedad4cdb2d5cc5fe29fd4541d95a506185c40ea05e0782ef","lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a":"8034dad817b3b416added42802f7113a4ebe3262d22caeccbe436915a59e1df5","lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a":"7e0f32bddb29e8243718fdb75d0484d6ab22ff190bc18464106f2f36984ba71a","lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a":"5bb0e5476698fa8705032534cf4a14dc78967966b0d85f73b4ac6a47f683d173","lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a":"406e1630f1f21547269a90b3d924320f21b0283a852c63be6e219a24489aed3f","lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a":"a7fd5be6b75d6331126d56347a04f5325999d768dbea3fe41765bdbfab15a393","lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a":"b373c42a81ed6e05ef9f6974d02d84b7a62f05982c6c91d2248457b2e75d7c58","lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a":"318e7f0eb69f65a6541c73604ccb86acea6b8a057e2e3f2b992d7d5251c73ee0","lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a":"80b563faec0b94b2c03418f91a5cbc4561b37054b70699bf931872f208e1e2f0","lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a":"8503c18952cd31a1d98a917a4611ad9bcca9885d1b269b55ef411466d5d5d92f","lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a":"e8ebcd5e4b1d1c01315f7574af5240c107fba23655dd47e49adcb241abc5d4d7","lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a":"cc4532d656729f50dd0cf42fcbb8d6cb4023803afbd3c6ccb71543b1a54ab472","lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a":"3f7c40c879b153cd9f66bd4c18137ac0d6aafeb17ed157439beb8f8591a3edd3","lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a":"cc4059edc72485280ce47980ae015ce4152f621367897065b2cb9a5509b235fd","lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a":"b1abe2529852fc309b692bea80d8c60611a40f48068ea6a9e7f19134611501a2","lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a":"ede7bf4ecfad8d0a9fc58fddd308b06ca815da52d6177cb531052c549134684c","lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a":"3c2c0ca0e39ea6d7e376ebf309020ced4d2222975a33ed95547e4dd161d39f61","lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a":"df55987015d91bbd5dd22763b011ad3f78dcf78fef76ce019a96d694361b9f24","lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a":"4685cde798ecfc1e51915ef4c958f506dc881ffcbef15d544b9e6d3cfa973b4e","lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a":"7f777f480dc4be64729cc3675029b92bce019d498f6f70f05b32b9cfdcd416bb","lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a":"678aeed581412d7f57d7f5952a3fd26711743a0316c13c048b225f93dc416d63","lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a":"2d490f02015684e8bdc4513d0e98a0f4e2a7a137d4707b680d496fe32d5b08b5","lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a":"17729e054168b9fff9d59aa70808e237561bf6bf6681c7c9a254e40e05a3dd8e","lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a":"efa6a01c28f7087c559b2c3a62d89c2349f31b4bf26ed5b3bd96481852315ac9","lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a":"eb8473b785c6f7a15c73a46f08b8244c3b50096464555bea8cdf5d97150d20af","lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a":"a2580ddc6724143c43623d5a8616a631fce81b215537ea01a7debf0a7d0df4dc","lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a":"0fb50f5b9fb8db51e3b10fa2751ce2d13c15a11476049062a7d765c82e296cb3","lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a":"59273163fbd4bf35b5c77030b8eeb90deb24400690c3709497198e4bc82fa2c7","lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a":"56cc37d116f3b1c33f994507e20745702f160576f6f2405cc96eb501947aa6d0","lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a":"4c09217fc1f3e02608a71a36374f484697f7f7b7b4358be96653e6e3bad62234","lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a":"0900989505caab7232ed73b5226dcbc30aad0c8a368ba6e8d733005c7f29b5f8","lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a":"97c280911041c2f23ddfa24495d6c93f3e1184a732c05d3e6c873bbe67bb00ef","lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a":"15b91234bd09670b2568c5e7b55b4aec80973f3b202bf59825437c60b37b45f8","lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a":"502d877f0201f26732fc4a248049104e795b9f9f092d3b3f386ee148393da278","lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a":"8684bb1e5507cf59e72cdb6b5c6adf60763657da95cd10207a72043e582e533d","lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a":"090323e98c1beda70440b499b27c360f8302e0ba5ae1fab8d48ba0f3037cb349","lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a":"fc67ebc5ac0848e4a33266f88f6d78c5b4b86f52a43a909449d9f17cd44a85de","lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a":"9c3d8b7093047bb97af5c27b5094a85b4782dd40a65e4d09c32bfae29504b341","lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a":"9d083184f86b32bbf9f39339c8212db340bcc7204752749b91baba95ee0613d0","lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a":"591aa0488133e53750db593dc0b5c1582dd1edddce9b3c07c645196bd15d80c6","lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a":"ac2eb3fedac7b16eb1137872aa10b3afda45f28a32ee7aa8f4e925014830c047","lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a":"8d31f4c9ce21d88d0331e1d721b4cca1e4dbedf193205f06ea857d2009367e7a","lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a":"65d2fbbb95fcb8a3b9dd3f383f3512a0ce4184a6e55168da3c43f2ae4de2f5d0","lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a":"f7dcae744e4e547b4c03974cda3cfca00b4c2eded5d288a01b622b1f1c8dee0e","lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a":"ff1ff30822a8ae0489f71da371548569fd77c9d9fc7545090449a46c5a8289e8","lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a":"59f2e3ceefa32e21b581421d8f53e4c6fdfda9cd9023d59a799e74d887b7d692","lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a":"0b429639fea442d6355d39b873ab8f2a4b434da2584be7813e4342a3029f2cf1","lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a":"349e6ca3c5b4bb467986317ba926f4a758384fe307229509579eabd973ba5797","lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a":"2d2c1cb17bff1c13883b801aa7670f1794dd6035952427f50791c46090967d07","lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a":"8369a1aa014110ffba11e84e0700c0006f9408677a4642bd1d4b9ef122734b21","lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a":"00af2a7b42aadd401a9d8365ed0c8b544bb8ac62ffb2575c0611fe52a0eb77db","lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a":"c0e7042956cf6bd167299086cbe250445a398f00417b5867a072c2a7a53cad56","lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a":"1c74d3623c867e670dd3a43f6d9604a294d49ca10c8b584736775f988b7d7be8","lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a":"e4ae626216830d21353522e0505d97bb41432a50798bb9ae2695ee4ea2d734a0","lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a":"e2144642234de5f25bae8b719fbdccd34f0e83c7095f3909484f6bb572b8cd5e","lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a":"fe82598cf64786f69ebbe50262c92ee2e47303965cabfd46dddf52d3c29b3181","lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a":"eafca150987c4555dda05254c24454d0c035678d9dd9874a53e75614e32cbfe2","lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a":"83b8bfb3724bfec221da2d5375675c1d972c1f65c88ce76260b4cce04ad0a90b","lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a":"b3d93de7b83c76989e5be54a88fef493788b42e0269cdddb2035af5157644ab4","lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a":"196fc35c8341a1e6964e164d98bcc1c1865f7751fa9b0f55445b885348d40729","lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a":"4b0f69acab66ce2afae8ed1a3bb44def669c3ec3e79eb1bed600eb66a8f5510c","lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a":"3607832456f9dc634c54f62f9015f6367a39c98545d0d1b60d76a2cb625ab38d","lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a":"1b9998bae9a3f0c528cf798bcf8289912bd2747b1036739f3a421b9903e5008a","lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a":"46452b33c2b9072de7931697b171c2f1c3a9f59184a1a7a728c4476a71612a95","lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a":"05f8bf2312e31fb15777f123e78be2635e99e9c8400bebf6858420990d82b24d","lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a":"a214ee3ca07f06379f6ed1e7fe8492acade3dbac987bb9e05762ad61401477f4","lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a":"1db42bfbc9470319a9e8fe161b22e174b06ef2f2ec2d98b3e6855160fd6d584d","lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a":"963d16a443487762259857c127a1e93b455bdd659c831d601070d84fc165b597","lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a":"381be039e2b937716a9378b04811b7f2d203043355aa0a6d665e60a16030a237","lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a":"535892bc1cbfb57e6790d29dce29762de300187bf6711c129994360e8bc1af25","lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a":"4676abab985cdcc5bfc05793431085ce090755767dad44e9d0f56917042161db","lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a":"03e0749be1872a53c158eef8b9dcba7edef537034f82950527fc2d078e798e7e","lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a":"8507ec80f896c4cd292135beb33a39fc206873df7b0f85aa4efabacccd7965d8","lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a":"03ebefd78e4e29d993adfb90e5adb2e674a91777d9e05981d7212fd515e2ae8b","lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a":"dbf5f6b9e2c97a864dc064ebbbf34ee7f4c876fe50791894fbb825007bc41698","lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a":"0b2d927ced5e272176d05ae2abfa458c2c1e8e1c7d402f3dc37c3b7cc113ff57","lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a":"29c15701fa34edad9f07ebc62844ff8e0c7da7eb7879c2dcf790656729648657","lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a":"823bb058035b58960d43dca45129e1c2d89c302281735e9f7397c3804700c98a","lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a":"bd89d9adea94b9f60b74164b5c1c5552055263649399acfa4740d0326bc6fad5","lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a":"998dd225c130263e62b1422f1c6a07b9d6d99e761c80c2f4a22104f635166e86","lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a":"ffb5112c8111c6f53c8d40f28833f9cd9b3e7f1037b6081883c9bcf956654406","lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a":"a6e0a2beb10da108f4346e44e551b65fb117a3b30db64d1dcbefc07dc498aced","lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a":"21d0bdfc474eea6cc0d54794591e7dffa35e3cbd46100d2d0c9af0d5fd9ace20","lib/libwinapi_onecore-authz.a":"49a58f5609fa0cce0ea9264c9e84e1901675696685a74a9e747a3924c63fbf1d","lib/libwinapi_onecore-bcrypt.a":"717fed5354b9505899ad794a2c9c01aaba0e566deaafeec46d6719b74c583ea7","lib/libwinapi_onecore-cabinet.a":"12116c8eb10af853d0e8154ae7cb0b53b4240a5084115fb24d82df6f13cbd9fb","lib/libwinapi_onecore-crypt32.a":"2319a22c1112ef3bc4f7992812945ef87593e4e42a1e1a72c70d06a30e9170af","lib/libwinapi_onecore-cryptbase.a":"acf88705ff0ebd208c17547ff41b35b5f489f59e4c37f5c8e31638dd6ca4ffb2","lib/libwinapi_onecore-cryptnet.a":"c3ce7255256fd6f0feb10879ea437c8b1caf54854d19e4c43746dd02924c39b7","lib/libwinapi_onecore-dfscli.a":"a1c83b4b2eeb361dbd82e7aa806182caa1f7386049b512764fa2b100f648329b","lib/libwinapi_onecore-dnsapi.a":"19aa00039284a9963e3e7b93f06e9f6f22f4e2f509d892bb91511b83925f9de9","lib/libwinapi_onecore-dsparse.a":"360b6e2a94e4e3f00917c4355b3181b97d965e3cfd567bf771c5f553b1e44252","lib/libwinapi_onecore-dsrole.a":"e44f0a3c7c012f3ff6e1a9074569939a596459ce865a32f346b2f192d80ec561","lib/libwinapi_onecore-fltlib.a":"431ce9d5a8a04b4538bb78e9f022720ed937c7aa255a32a803723225952d2832","lib/libwinapi_onecore-iphlpapi.a":"aafd64df92275cb714a16e5e7c3b89098c8a9b7222dd61986a6861d2f31adc00","lib/libwinapi_onecore-logoncli.a":"1a7b0a7cbe4427c403656addaff583ffa46cb3d3b21e8a293f9d36dab8e6fb71","lib/libwinapi_onecore-mpr.a":"d9851af2203bd2e135bfdcf07b30b699bf359e2552b580177c047bfc83ec4aba","lib/libwinapi_onecore-mswsock.a":"25311be32bf6762e7ce0afbbee1dcabd4d0671f25eacc81ef0df1bbda038673e","lib/libwinapi_onecore-ncrypt.a":"087dfe8b0de2be412397868c6ac3c22302f5062c49a35adf02049bfc39d7466c","lib/libwinapi_onecore-netutils.a":"a438a3673029c25ec1b11c518bb1f5998b8306df0aa57e23b860013e84c6536a","lib/libwinapi_onecore-ntdll.a":"ff8d3e71e411a1d8f93b62ff37e5aee91fc1141bb4a2d341c95badbfbfda8a71","lib/libwinapi_onecore-oleaut32.a":"bc4eda49c1613e15278f4d8a3f60aa01c59a871ad839d72fff3e93bad379552c","lib/libwinapi_onecore-powrprof.a":"ded544f89c79bbbaac63283a479bbfe0f6eda8695e3f03993538f837228586b9","lib/libwinapi_onecore-profapi.a":"58f6975302c178463b97388f58d13b5761a546c9d5d17ec77645c1a3c6196a06","lib/libwinapi_onecore-rpcrt4.a":"ed8143d7a2ebefad19460a937dbe08381346a208fc56bdc179f556385f44c2f5","lib/libwinapi_onecore-samcli.a":"3b4e5e362a4f4ca2cf09c505ade1feb5adef669c4d0e39a6efa0e258e4a45ab2","lib/libwinapi_onecore-schedcli.a":"f5d15c598ec6d8716457523b86d41ddfd012aed591f17237bd4190c1f22f7360","lib/libwinapi_onecore-srvcli.a":"fda98b9f248725979155b3bcde4118475bbeb9ac20b949632b6e25f81004e787","lib/libwinapi_onecore-sspicli.a":"ed3f3ca04a6b5b0f3c83785e40d75d9d73f4d5907c2ac62b90b0d37c304c2be2","lib/libwinapi_onecore-tokenbinding.a":"1fec2c3a85c528c8ac756c2b590446805886ce333de57fcc24a29f976177cf27","lib/libwinapi_onecore-userenv.a":"aa8e86961ec9dad96e8af293b535b18e43779cc99cf6a3262cc6ca96c18a91c7","lib/libwinapi_onecore-websocket.a":"a3192322098b110272dc4bd604ce2d90feab14393ce444358bd7cc9c2951d2f6","lib/libwinapi_onecore-winhttp.a":"ec3c64ef5b250ec3721b9c8a500e580f0e52873a0ab3071ad9a07717e898243b","lib/libwinapi_onecore-wkscli.a":"c07edd7e8b0efd63a31ae95d776f29700d8240355bda5982aa4cba1a4903b3d9","lib/libwinapi_onecore-wldap32.a":"f98ec840c25a4682b2bf3b27d7eeeedfc88182b76689bd5aa6767aaa5b31e404","lib/libwinapi_onecore-ws2_32.a":"b188d2e13765f6de978f53389512053bd9ba79434a86bcaa78151aecd1c79f45","lib/libwinapi_onecore-xmllite.a":"20e6eb39eeee75e3ef15b9a69ad11e6d665d3163686968c1a0d1a482fb26314b","lib/libwinapi_onecore.a":"b1b438f02522fa8511e7b61620d7cbe3841cecd575f9ce2d9487433413d6482c","lib/libwinapi_onecore_downlevel-advapi32.a":"48dc1206ddb4d6340addd0a57e485c20d73df8e9472c48b63d948830aadafb14","lib/libwinapi_onecore_downlevel-apphelp.a":"d861b0c9d0a9ec3429b789c491399b7f4f05552f5558a4d962e74f9a20491ebb","lib/libwinapi_onecore_downlevel-comctl32.a":"21c56dd6d89207523a0e54fa70e5610d26dac00f5f7c09845c3d1d321f9fa584","lib/libwinapi_onecore_downlevel-comdlg32.a":"0efb7387918178f59bb1a22b819a0a7f3f4c38772f633769d981df78bad33997","lib/libwinapi_onecore_downlevel-d3d10.a":"fb03e4884e8c89b2b2594389a979df0a15788b28e70e6c9141eeb273577ab4f6","lib/libwinapi_onecore_downlevel-d3d9.a":"8a7f5a3567e085d59181f1e1f9913aad3deab24248be70d7d89ee3946750a195","lib/libwinapi_onecore_downlevel-d3dx10_47.a":"da96a15d9ed6f5fc08a9fe19d4c1284af3a31714c9bcf7a90eb3607cdfc29dd4","lib/libwinapi_onecore_downlevel-difxapi.a":"20d592d0b07b753c35555e5aea48b71f199273e4cd41fed4d30e770cdb731dab","lib/libwinapi_onecore_downlevel-gdi32.a":"3b45e6f50209f32b1b00c222e57376bd1e22731bd334949eb8bb44126dc6d358","lib/libwinapi_onecore_downlevel-input.a":"d8021ed7e5dc1fe11b966a32e581c52ba672c020254870626947108c06d213b4","lib/libwinapi_onecore_downlevel-kernel32.a":"7f1a8b6870b6b5a117fe0b9ccbcd1a6b9133173baf6b0fdd91daf32ff2f3a920","lib/libwinapi_onecore_downlevel-msi.a":"3950469b8eabd579f17707f38029ff1d1d9485711b02ec516a95b99bdb1fba05","lib/libwinapi_onecore_downlevel-newdev.a":"0369225398f2d772410b3943a6635c26d5117f6711e03e49dde13a5f0db44f2b","lib/libwinapi_onecore_downlevel-ole32.a":"b5579a04a5777a471687c6e3fce7d8ebc87be0e3f3dfba3f358eb7dc3cd4c715","lib/libwinapi_onecore_downlevel-oleacc.a":"856fb87b2bcfedcfe10a104ec8a0e4275840f042efdce23e3aeea8fb90b3622a","lib/libwinapi_onecore_downlevel-oleaut32.a":"a9461245046a904f1e8ff78b7bdf00534746756a83b3e4de04e889c8c1df2244","lib/libwinapi_onecore_downlevel-oledlg.a":"d460a3f03bca729456a5e315e75af9b4cf3e79343c2bd81d827d377a4d4b05d0","lib/libwinapi_onecore_downlevel-pdh.a":"208131ebe23e8bcd31f03af369900ce7956b9a1e51bcf8be6e46ec1ff24576d7","lib/libwinapi_onecore_downlevel-psapi.a":"ca31fdd6661f575ddd7e15cf68a6cb97fa405677d01cfa00b70364ffc138ae81","lib/libwinapi_onecore_downlevel-resutils.a":"07e1b645395bef6352820aeb6867498dfecf1c576436be218e81db12fe8a3602","lib/libwinapi_onecore_downlevel-rstrtmgr.a":"87bfdc17145dce5ca717dbdd007970ab1139f7dfa7ecc17c9cb3c8cbdbaeaa58","lib/libwinapi_onecore_downlevel-secur32.a":"90d6b2fa7ff6b2e9555718c8a088614a461c5f5276fd2586cef7ee2058301e67","lib/libwinapi_onecore_downlevel-setupapi.a":"6af80ea73c581f1e21f5ac714f5da3b33ed50e9d1a9cac19e020ad24986202a8","lib/libwinapi_onecore_downlevel-shell32.a":"4b86e0540f359563ff2a81880f9fc4b40ce7f52409bcadeda2e678e1e28b3657","lib/libwinapi_onecore_downlevel-shlwapi.a":"3dbbe36f2d6473e88b1b2b6e71eefcb82bdfcbd85a09d5b96d618b0bad63d99a","lib/libwinapi_onecore_downlevel-tdh.a":"ba341ea2345143d5b1b55f264366aa72ea707ec955b1b079f47f00eabf4d51bc","lib/libwinapi_onecore_downlevel-twinapi.a":"7b18b95de7696d38c6a2bd24ab02301a95d6c856705a8ae4eb0206e293e1d8df","lib/libwinapi_onecore_downlevel-user32.a":"bcc698c26293e631b93825aa8d1ed5a3eccd0ba99db635cef2b95dfcc476a680","lib/libwinapi_onecore_downlevel-uxtheme.a":"788dffd0226fe85f4bc0f43ddf7d6d69e35e028742a8094c44c065a5a796d7e9","lib/libwinapi_onecore_downlevel-version.a":"706c173ea490ede7d5d8a3cf8a207f0a84efd3a045f8ec6e5111a36c569706f9","lib/libwinapi_onecore_downlevel-winmm.a":"b2fe34c14402f41101d658964d62f5abca5be0106f4dfb27ba630cd35d127277","lib/libwinapi_onecore_downlevel-winspool.a":"f7b78470b47ddc11240de3ab2a153e91620e281c0ca499e82a9c25dfbc68e80e","lib/libwinapi_onecore_downlevel-wtsapi32.a":"ec17d91e47de2d55dd4043318800415591832c9424cf9ed0350a4cb17c6eced2","lib/libwinapi_onecore_downlevel-xinput1_4.a":"3e0a8d45e88418b3c61455fdf91f39057108f9cd39dd5b00c41ec86c31f05f27","lib/libwinapi_onecore_downlevel.a":"9350efe517d660865703d03a12d0aea519ce286a1b90f8655f8211ba9e5d1176","lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a":"208882e4e2230dd12d8b317d7a093f0bcbdc8179665778bc552fcbb898e9ee5b","lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a":"91790658be1a8be50ddcde5ac956a1a56ca774dc7a690b2ef75021e9c3330951","lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a":"6d7aa69999def908cd89ef1249f6c1116d418a11e897293e1aa1a716a74ef7a4","lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a":"f2489b312e02e70ff3b347f5a95b92fbf94ce4d4cac8dc8d2430a3ce07bce8b5","lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a":"1b1897310842d69519c547af2d07da04a432eeaee55809fe844cfe3bab463079","lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a":"ed5f934a0b2317af63fdc5140cc369dfb6cc54f0c2ed6e6108f77c2db49120e9","lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a":"9caf1ed02c8944e21ee329661d6e86525d48adcb30a0262e8bc651126fac05d0","lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a":"2d0f0a22bede0f52df0eb87983690bafadab0a8cc3ab055e774f0b7e81faac9f","lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a":"bd93ea942b8ace1884d16040fbbe418d7aabcce933d9a769173dcbbfef2ffcae","lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a":"0cecd6ca334de304c25b825732ecbcc4ae1f0903b92fbb07642f2b60b6e32ab0","lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a":"5dd747af301bd8a87a169fb4be5b27f35fe8d641e442da9650a681bb1ebca5fe","lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a":"4af23fb67510708febfca2ab3c88b049cfa72dc8209ce3b10073345a2cc90ad4","lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a":"0d5642a37f8c438e8af493d14ce2e76dfce51fb77aa9e657b28883d6dfef105b","lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a":"6b8a4dab5532b978cc0b78a75d7e617041f70275ffec6c3ab2e09bd257490df3","lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a":"9b43334c98f0355bade21041cd010435f87f4a9f8ae2ff2da1daa77a1c58c7c6","lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a":"ae6bcfebc7a6e9d24a91f712e67e345c3716174ac13a1b086139d0dd42fc3aa4","lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a":"def26a1441d88fcf69a0cf71f2f37f585585027b181453ecd66b500869c1325e","lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a":"796cb7d7094c8cad58a4feb4d23659aa9931a4006fad2d95cbff1821f4590844","lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a":"81937e6fa94d1212375e5c14e3dbc5b9259f693bd657c198f1294e84670cbf83","lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a":"1e4421bc92825052e1c6da76c5fb9f0b3b7b9e59e8297acf476e264a50f79b59","lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a":"57b9316068a5a96938f30e7f6f23e720d4812e46a7cc4802135ff09284177f21","lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a":"780fc66e5b9309f137092b8b0a4d0bdaa2b8f45d89d9ae8b0e9f2bc29e69c424","lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a":"6e350ff7b3c6329df2be85d6d709fe666742318019079a88e385a180500793bb","lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a":"3e718e8e2364bdcd6730ae57e138c09234583a2e5ae232228f383e3d040af377","lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a":"97552843d0f8b760db838172f22d443a491bc4885c35de15f4b3d579b373fd31","lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a":"cd81f5d09d6fb6f4125fc2770ec5086838ee72f0daf8368c392d51f5320e66ba","lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a":"f5b5904942ebb75a537ed4618b917b0d8b762dac20da0a0c0de7e57036fe72cf","lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a":"eed735344f097f222c660379acb00aeea935e730abf2253f9a4a26993c8fd344","lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a":"b3690a5e72008de4c4a8f82b1f5e352ae987f11229df791f6fdfc7e0ee862837","lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a":"4495bcbe1eccbf406b59a8cb55d3afbb8af8db728808c5f30d2a6be9727e91b0","lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a":"43e391c884a4a4f2b49c27a211d69161c24f6b916e9da7d171da447e8916493c","lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a":"1f8415d190ccb338224387f5319edb3c99942e77ff78808b8e2d07bf878889d8","lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a":"da3f54a70d3ae49cd4f1720af4a60f17840f813903cf906ebbc30959396173c8","lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a":"b0216bbabbd686401ad98754a5c049d8960d57541ae77a3d20358a66ff9adcba","lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a":"d45a173aa1f26ec0a4e43d6c27da3a7dc7a96917f9004f1b7b79ab612ca28975","lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a":"eabd8fde033e5a57b6c0b9a7c12c260de1d83394bc89d12c189f8e5717870e13","lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a":"fb58299452583cd8a8ac33d4bc5e9b7ebb9ac1e3f2028bdae5359cda166b3f1d","lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a":"ad8c10b9fd3fc027585c1d687b79b0e69d70600d44b9ce90aef6a66655a5d8e8","lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a":"199c464c17bce4d3dd0bceab0451a0cadca8aa1e2437be72f2f7ea6ed3fa93b1","lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a":"6d356b9052c0239a2ac548b2df4dbff1b4e6dbff31044ce2c0327753983e8e50","lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a":"4cc9d17c3a077bd35e3828510d1909898881d0b25c3affba7f456ddf113c63c3","lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a":"51501263dd66fc8121864da921eb14c0900b189a822ca1adfe47f1311b902792","lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a":"ab6f71c8c65ea6e7d513750a01626faf3175339e222ea54968e0ff0ad90a8b45","lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a":"b9314710e7a45bc933aea2aa0e57ec45167ab20fa09d747aedbeb097ab36da5e","lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a":"70479bdc939f5817083356c93964e10ec375829b1863ab538886b39b00aef7db","lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a":"9127441476b674a7a73f3222accb5be3dcfa63fcb7f1b95b6edcc93e6a652f48","lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a":"14c5e5fae456396c87d962a22cee320231ac759ce842de4bcf9a457b22cb0eac","lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a":"7a5de073a89c411e4679f8b6796a7201a9f276bde8119392584efd788b3f8e89","lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a":"1370ad95210fa9dd3e3aad0ab7caff8439ca05d0ccb6b3941fd7d26cd03ba6f6","lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a":"7a497a59068adc9757ff546a78dcfd5c27184ff4ac566334baaee95cabeaed97","lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a":"0f64537add3fac2532141036a963fe64a98b5046804df3b685bf30986a0c2f0c","lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a":"0d196cf294402e3b8a50eaa3413756b034680294c6b91bdda7547f3cf6f9c579","lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a":"ca050c2d460caba9e6978b1745b22e0932c0ac148a06c1a1612eb08e512eec75","lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a":"ff28edf42698b4bc72ddbd143062132908c614536d60a732ba3000940b5a85f0","lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a":"93780a27ddfc82d162d7ab804a760faa78b5904471d8c36af19937d967457829","lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a":"a97523d85a93bcb4a6c857f115931afe45020769d7667759ee7038304b955311","lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a":"c44d11b52b83661540fa32202b7c7b425aee93b94381821325c292c2f6124fd9","lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a":"8325c8020cc66fd1baaa9e2d2c2275b14ca6245183a5fd2c38aa67ac69a2d99a","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a":"f25ff2bd0c4f841a4d48895c22b0a883eff15adc3494075d3a481724ba904998","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a":"3348ace857245ff8567ee5eef16d0874da46e154a34db8045c2ebbedd6148e15","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a":"9a753479c78dfd40aa71452860e294ef02204828d7743d18552bff78417eecc7","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a":"6ebd97e5c62c047022a761b3293d51c864c40744473cd26bb14d24dcbe5028f6","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a":"036f12e35650d8c350496613a856c27da923a24ab802c0d9657d7af8fc0cabd5","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a":"a30a9756ec2296c149c0a463af96addff7cb6c0d00db847a5c9f77f1bcd6b655","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a":"979f0d08708b6f80d1aa452a5a387f0d4311c76d88b5dbcadffe66d638cde66a","lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a":"edc5f8763d03d84025dc7e083d698893cff79920e36f239de7e18f91bad6ef99","lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a":"e36f5ef88232466f1bfe08402d21c6ff1562bcd2d630387d45ad1187dc3345b1","lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a":"caca648ad69b3f52c628e977c18f149087f5777cf0079546f92a2414887b2d05","lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a":"93ec184d7ab34060ef1db49cd2270e80e95ee217bb5fc481946b51dba7c75339","lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a":"c5b4969372c801175c789b3b90f23d296b48922084fb2a3e6de34bc76f0c4452","lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a":"1a85b7be572525b0cd28edaee04b97c1027090e6d67273328113894c7d9d60f5","lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a":"e1b13deb0d9f7aa240295a87cdcc398edb816e0c2b8d72261e259b17577d0496","lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a":"8c7dbfc3176c0bb0487c7ba7a9d04036b5600c7f124cab8ac3e4ddacf013c875","lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a":"34b04e8150846ee19c15ac417555cfd3a712cb4fadc564d6a9cc7ecd6c174f23","lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a":"fec9c576052f90d882c90e0e2dfdb717f94a5cfae111db76246e560501dc9c81","lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a":"edc59db7005da93b96bb2e1eff6e6de2796f5fd6d0fb02a95ead84ad3d679996","lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a":"2b9eebd89310ac43ed54dbb9553172b36757a5a51b59ee5e14c31cfc8210d78e","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a":"097862322accbc132b0b753698cdfd33cc68b22643f994bcf5b2fcf02c0a3dd8","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a":"fafb08266b6465d3b283b5dfcc1924507e84bc0c0d658f3b111a237e88284791","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a":"4d0dc0b85d99ec900d64193039f6442886e2f7cb57a45ca7de62b9c1c5738860","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a":"40a6455f8fa2d5124cc69bc89de96a238b6ab3c83583c5ece746b281c70dc426","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a":"59da5b17fec35fd627ef32ec5333c93bfc3cf71be9c78fc714ae0c695d628cee","lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a":"d104bccd2274b6bc0f51c06489822ed46d3395c77ea421276f33a4be45847867","lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a":"d8530787e73d174403d40232a09d0f01bae47f8d83c39cd6d818e8afed18d640","lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a":"acb7f179f7c58f93457d17ac57feaf18deecc7c43a718c9e73bb895e7433244d","lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a":"1a099dba3ab2aff0de9b82afde85e02d8f52ce39a5fc049ffcf9c0e6055e1be0","lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a":"daf2d469a631f337a749317cc282f8ce30f84cba094fc61506472bc2418784a8","lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a":"76594e230e567f5f12379b7319e35ee1add83f51625b156908e87a63ae781895","lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a":"2df4f0d625e6313eb906f7fffe85e951d877d6bb063d6e51b93a317be2b7b474","lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a":"088eeee18edd58dedbfceef865fc38c32024eb9bf59b960b657893d89b242e46","lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a":"396abf7a271322dbc05f49e9b2018d8d2bddb0cdaa8d8885f5d1f1ba0103b188","lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a":"d9beb78fe6740ec2c31d8a6982da695fdb293aa0bd26726a1e73b0a71605fc9e","lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a":"d8c8f703a295f6c1d6e5a6cc7eaa06f254ca31eb02f5acf2b3189d98724b11c8","lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a":"44e2595ba027013f8638b3964bf49051e1c873fb9e43bf869967701074b001c9","lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a":"c32cc3af4fe8f1df5e4f14e3a0a9751a7493fca87cf2aad5c7009ed2667ab9bf","lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a":"42c74a8f731111df9aa02616708a9773b53d354898588d46a9592e6431bddc0a","lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a":"994978a054487a2549dc794a0135ad806ae747085bb46b169850c19feaf48f0d","lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a":"d32d2b2a6fb33136b6f982b03526efd6357fa95e8e68e0c24c429f906e2133dc","lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a":"999d3c142a4f09d58897dd1862f0e3f3d01adc6426ed6858ae14c64cad2abe1a","lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a":"9900f0ab25eca8d5ecdabcdcdd24c2d741f8be6cac29e7fb137d47bb303f1942","lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a":"42c4aae5bb149898ffdf1db738ed2eb34564b2aaabd3580a44f4c40670cea7d3","lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a":"cbc354e5975489e90efe70d05fa7eaedc5625b48de0d8d7c42834a8c72d350db","lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a":"d7787f9e7e25a936dbaf33e1f768ed9edbd76a45bec7898a802e3b46f5046294","lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a":"0ee0eb2dfdbdf642645168cbf4df1004c8514dbcf4fcf68455170830039918bf","lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a":"fc787ca7ea17bd41447e8c7856f58ce1463132a7f9197cbd16fd21d51d626455","lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a":"3610f5a44c1696800b731cabd502ab9d674ae5e466e77e8cffd752449def98bf","lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a":"8175c06e4065023e1d83a794458f668b575829a462859c4a9cdb1b317c417100","lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a":"cf60483967f15bb48a8104fea73abf63c96bee46db6436c5be5baada0bd65b5a","lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a":"ddcd4ed25ba23c6719b4d3143299bd3a0d3319aa66bcaf8209e91edc31e33f77","lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a":"05ecfb5ce0f45ba854917356d2a90b8c8933d4697a34aa7ed3df424ad5777f68","lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a":"4c8f9adf440d7d69732e0f8caedc22e8cc1e6aa3e9949084f2ad6d3cfac40202","lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a":"923e8bc57d1196eb3acb217a0f73b09886b1e0c8656de744bfeb3b4226028d6e","lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a":"36b66d1781bef9d74b1996b194642cfb12e21e503fbc796e5ad27e08e858e13b","lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a":"85e2bb960d2cb17a6fdfd14d745cffa998c5c16de55e0e5399009c0da9bdfb7d","lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a":"b21f1b497c03ba20cc30b9cf5c53824c93e542e74d05b8f8e7803c8fed674946","lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a":"f9fd25609615daa0c846bbccb1e1afb9df97457f3523928f18879cfc144bdb90","lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a":"029da1015d4150f207086cb60e457e4cd0a34dbf7a3b264b9b8bd348791dda05","lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a":"4e782b6afe5855007f30450045e421a35a1bbb61dbe1cd435ad228797b221895","lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a":"1af46b02de30fc3183bdc8186a7ecc81461748cf22d05ad375ca3b436782d9ee","lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a":"0fd519fe8af39e22c1a39ec37690b52d114591cb79e289351ed2e0d230dcecf8","lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a":"74c170e870b9c767c3d0908f7c02f172dea37b2c2309701bc456f7a9ba24f6f7","lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a":"28007b4f34f31ac5d0a340e759957598b945d7315b2ffb5fcfdef34831498899","lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a":"584dc53a4aaad360864d643575b1197dabedf3366002c62fded126aa1ceb2794","lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a":"2bb92bb8c085be0d875b73c8b0dd923862827cb1f8ffe775dc5bbb54aec8a3cb","lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a":"993aa0e559d8f069fe0e0a1179dee06e597e2bd3d02876f1a0082f37c729a30a","lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a":"badb929faa6993e9f2bb6b7fa26259ad8c7abbda8ba3d42d2e8ecfa453fb7eea","lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a":"f320eefb3763cc503aac9fbcc0489f38a939e3b38db1d39719e570717ea3e476","lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a":"f3037f023ee2c8578417e29cd698be3f7df598a62f3e6369978e7037be7fcd62","lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a":"c0757666e6a507d0c4fbc0b50902326712ce6cc2f4a365f94a890b564c9a94ef","lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a":"fac6581561dbf5794fb62c8fc43267274ca07a08213c4c93bdccb405ee23bcc4","lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a":"a1cdb22e603571bcec39c1a5547600528cf89d28ed87d3e9dbf8caddc28aac7b","lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a":"e66d86dbf902d9dd57734339a2129f921bc62d490ff524a5bb8c490f1d994425","lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a":"7d9dddea1019f027215c65209127ccce9c221ea4cfab79405502920bf97fec17","lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a":"c9c244acba6d4fa1b367d6d6e6f2673b4c256e2f6e02cd0b651f254ef1da78b6","lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a":"291d20badb0ed98dcfee4b61a87ca7de71d91cc2f5fd5210c64e0495610ea422","lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a":"2891ffc03c3859f46872611e6003078443a0f05245dcf5bb9d77f8dd3748686e","lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a":"a7a8108a8c26843eff1c9a48c28b600c42f8431a488e13fc8c0839671fd0666a","lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a":"52e2a89087c219765f2dd2fb898466a01df2f9fdaef7a84e6e0a16b144121940","lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a":"1b107fa62b4b75121f42f9bfda4f304d1febbd83193309f0585dfeecdd207d29","lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a":"1af830ba3ae3c3790c77add6643305401172fc4e8a088bc9f6be4a888c9072bd","lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a":"b33a8c59f35e5843d016b58c6edbe9a58a9c81aec1324847fd86a612cb038e24","lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a":"fcf4b87d9d11784559a9bc4c5b06366dd9784be852ec7a0235a3e247ee506df3","lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a":"7e07a6e2854593a0edf944ae6d993ca9fafee53fb5185ef70b0ca9765dd4a288","lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a":"6ede88a05d440fa2d9d5ee26e8645a2d31e5e05662b975b4e1c54dced4d21d91","lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a":"be01809a2c48a1be2311cab632ab5979983f2d15e84161b44734fc9372fca2c9","lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a":"ad6c73e76b6e6af4746968e218bad365d42b3882c5352d449071b14743307ce6","lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a":"59b4bf42c2cb3243cc36728b6612f98956fdd99aa774acdfc277e393cc70011e","lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a":"4587831f353137ea730c40920e0a2d19645a868e76c41242462d734c6acd9756","lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a":"92aa37a2a7b14d0142d591e5f34dc2f15d19ca8073140e97a8bbd251017b3c98","lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a":"d7fdea9b8e4f30d68c3457952429670b7fa85c88ffab3652517d6b86e24d552a","lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a":"6f5cbf84f6bc55c73a4d3bfe56ee7cea780a66647d8f9c4859fabd59e97952f0","lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a":"5c768687034e6bc0bb740ddf3399cac95bb78e81cef1c195562c36c2198f1abe","lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a":"9d549df648d09ca88023c8270d1039564ed6033f2c834b98ae5b8de81f6350c7","lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a":"fcfa3edeef60bb20e4de99753123b69ce693f7a33b1b25ab9c998f7b4f4af7e7","lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a":"aa56a4aabbad386571997c850488f8024f079ab10cf29c3f5018435e74280739","lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a":"bc9e01a2e3e557cce8d365f54f0a1c4467e6da12524574f6884b1ff772fe3fa1","lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a":"b5037bebdccdc4636afb830078aa6fc78d142d5f4e4c069462a400106590c29c","lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a":"442a64c404179f700fca3b620f4aeaefeb2f761d45fea88f8c289658355a56a5","lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a":"8cb856aa014e3176b38f81cb98455b137597dd454aba9994544bd8d06808e0ad","lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a":"bbf701fbf1a80d36acad75ba68f840623027872e8d0885c98932238ffe8b5c12","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a":"a5317cc287f2d8e822e2cf5c2c3d906b39f13603bfd001f83ba16c8cff2e5667","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a":"3c861782bc5bc28c0332e3d3a9fb1a82dd625fe0622af2ae8c6ce355fdc97b64","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a":"024505f5b3606fd9c6a6e6b9f1f2375a961e87ea2955f251ba7c87f665bab7ab","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a":"311a0cd15ff274e5da94d1450635e2ac1ff80c769f4d6bb248a1d1c627f98165","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a":"fc830efa784cec9681b78ba985e7676948004763c3e005daf5dbf4a76f7fff2a","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a":"e85de983d19dbf0eca5d8ba1f15c22a4345fb5ee91b1b5f17bf54592e83823d2","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a":"60c9ef2a7ff31e2c329add49379ee3df011f97d28f08b86a00d8dfb6af3937ff","lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a":"d277c8f1d589ae2135519b5dcfaa4da6f3e81430e7e0b653637684e81750d414","lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a":"43ed6811af9baffcbe6563cbfcf7098fe882d57c4de63f6f020a190cdb372f49","lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a":"37bfa87f4004ed6e9d485815f858ecf87da18bc004e4e5b6195d5da8e9628e7c","lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a":"b0bb3c836cf3f6b5079881fbc13d7ae0a29bb183121428c616400beaabc002a1","lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a":"41eaa65110287a9464924629fd20efc322a72682f7497eca0691ce8253f5d37c","lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a":"791f257672dd55fa79dda0009a63ee6239045fb973df8ad1130c00303dd808ce","lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a":"95df360f764e15b615fbce0cc242b0ae6a3065928de31be6d0f3d4e3e3e3ee9e","lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a":"a554ea50453252787740f501cd7a40985070da4c6b5b097933f96d01b20e8f3f","lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a":"298fb5fe0a10116fe88c405f42a3e7bc21c051b6a87de9e80438577319f635fc","lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a":"058b5f62ad4dfa972e1d45797e1a8693508c082c3a7ad66713c98d4cc0703689","lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a":"3da5018232fbdb7d941e248e167d5f2c19585cf6bd872a12c32de58d55eb7c30","lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a":"f032334d1603206c061405a6878a8baab0b7acf002fa537dbdba1ec3bfaa1818","lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a":"5eef46c15cba4181037e204b498803516eb7a6ec18af4fc43e229395bf2a6b1a","lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a":"e6c8abd4a28d996ff487e32ef92d606ab3c84f45fc9926e3ef548695d9efb5f7","lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a":"a69661d64a7c2398c03d521e0213f851bdf8cb969f02a99051e26a5c540cca47","lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a":"a96ce246518f17897a2d1e7427d0c3efed740e53cb743eea81b16472c675046d","lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a":"7146a9646aa0031bd7a368879da07d30c27e922f11de8d36acd08a7ebe1938ba","lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a":"1b0ed3d9c8ba0b3486d3ace7e91d6a9cf59be0f59e6db299ef2a832270d0d799","lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a":"e0a32a81dbbde1b9b641e68603a9c160b7bd1e6b07c5325c681c590697977610","lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a":"b9ee4fa1e5adcdc9cfdafec75d75fa42eda21ad976017ddabedf94e8df60ba68","lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a":"70d16559b1a3706d53a787e0735bdaedd7dfdb6c594d72ede3b437e953de2598","lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a":"5ac9ae5f9757476280440b30a65e9e7cf99e72d7daf9b010cd39afe5b6d9165b","lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a":"9b2c3120ab0d4ea1d3542f50f4224e8da43e807fbdaa7f6b9e77310c3e875698","lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a":"1e0bfd59214f3c0342d704d74b72b9668e6898388c9163fc5efbd7f10e05fa9f","lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a":"41261c397970104547f4abfd1be9247021d69f74176e22fb2de9f28e6a954e43","lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a":"012e835e10cff03ded37b67e60de23983e131125dbc9581a8002a0cdca177f6f","lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a":"5d59468964dbd7ab046296e4f6486e77ff111fa845ced7de61c5a0883255b2b8","lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a":"2d4b4edd5057460d3896749eb75d009ec7adf15be62f878d792757ea785216c3","lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a":"80412694d39f6110a5d1104839c3e750dca6ec1ddb1904e832564fdef92a55a5","lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a":"fbe27441bd2787d535874abacdf2d31700a9f5334d708e3186f3067e651d9b6a","lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a":"e1d5380c0b980bb1b07726d3cf4f2a02fcbc0ab88e954b4d1baf7f6d7a733474","lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a":"50d5e4e1e9659baee3d1225659c102deea61d72ce812593715d49f35f4c1b090","lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a":"6627afb481b3acfcb47045321aaa5e643aff3788490ced6a503fc973b6d701d6","lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a":"83d3cc59c5623f446ed2f4d21f5daaeab0e375b2d601576553e4da193e657d96","lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a":"34376861728ccb4680372402c3e1f469d21a00dc396d4df143d5185aa8f529e9","lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a":"e7a060c94e7076d45a4a4091825ef970869d2a54b3627bc670bfb8092a20d725","lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a":"2a44f39da22ab5b0ed37dc5e9562d42db9cc9d7e600b37ab0adfc4364bfd82a4","lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a":"002f4467b7f58d7620b389ebd6d3983562ed859d527274bbc844d293539a1490","lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a":"792efb6916e2cb05f7a443fca19d03943495e939b9aeea702ffeadfb399523d9","lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a":"e561f70c0420c63f20d1aec5ff2af3e744bcf4a8bfca6a1fca49bdf16e8f9e62","lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a":"40dae4c8443ad5839f8d04f82c293998b9ae1f8ac42a71924bae9d6c8a0ea0dd","lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a":"f38422e9864a986d4779217c30e6be45e01c31255f7e46c79442d2db191d50a2","lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a":"fb464a3682905b034a28e87d7c3fa52fe40b3d8974c5ff2f2a8366bd09a44773","lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a":"97e800780d16a3f303f192160406bc0718d5b0489cbdd9ee0051f02bcb9bc32b","lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a":"e7d2ca5998a14e92f06b0545918f42537d2463a7f90aeb8bacdea553c94582ad","lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a":"8ff1ee61e01a1a7c5c5be07aa83c79eacc0987ca9d136bd64e183cb43c6b496c","lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a":"1aa8bd19d74445826bb01cd74fa35fe9c4fba40a14388d9f179bfdf17ebe6f26","lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a":"5afeadeef24773505904bc67250964fcc0c34bc5090088866a85e0dd463c5943","lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a":"47dc7722b5899f6784d0de8799739885836f4c7753b2997f0692ebcadc7bdb0b","lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a":"0ff5ca478d2d34c9e54ddb2b19a95351b342d64cc110045b2cac78e1cf3525f2","lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a":"c4efab90162893f22bcb1537ec564183b15917df952f81343a6315a99f014816","lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a":"66d1d8b4c1d84ac76730df213a3f069e5bfebba5c338b9d7c17a51254ad6b780","lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a":"ad470f69c2d9486c92a96ec928fcefea6a2974855cc381309ca03f0f9078ccb7","lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a":"0165762604948743fd61ee01b032fb7c8c6ef7dcb9f1edb109cf1dfcb11b82d4","lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a":"e005dd2fd576330c8b4625219ee0014902ca6f990a92dac83be1a53722c80f4b","lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a":"5ab8ea352510350036e7550d4b3ce6ff6cc49785063b65cbfe164bc7582b9b34","lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a":"eadd184eeed25c2f689548611c17795c4ec7f14826fa9ebaf4181e9b14a410df","lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a":"03559b78a5214ed4f83dd341c0202700d69ff4acfe577ae6b92d4c862af590f8","lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a":"e04b7ac2b9aafe32392f30d03ecc836b39ab2956f98f4b6f13ea45e7cb9083de","lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a":"12123b9729c86c8f4bf2e924908ed751e2f6a984c62141acff9858a3ea3da1f1","lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a":"70189c4736b78d0b9835feefbc77278f4a1fb79630d3bd8c79e85595b4a4e8a6","lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a":"a372303d42971dcfc465e226c5bf635e23dbb7a4df8a100e6b1ae668efcfc30e","lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a":"f9c50e32ff811decf56451868b8f2a08ec60fed80b5b6abb2b1b37dab442479b","lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a":"793d6d2e5d708b611c8c51b995eb26447f034c2f8f71804f26ab3b7eb5b4ea7f","lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a":"83e215dbdf6191426ec5974569fdac9725377933761ad73d51c0733f5312f160","lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a":"2d7240b34c6ab9b95d0b0c638baa254e7e174767d64d98a179e7b246a4cf5ac3","lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a":"060d20b241b8c0bfd28ea2ecb5a4efba76e2e77afc4388c42450ba18012c8f20","lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a":"5e50383f61a8fdad9d0fba5e001933a17269a37d873428d3467b667c56bc6f14","lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a":"b121dcdc4e0bc485026d367c6b8f2322a02708b5a9aff2d156d6af3ed643c0a0","lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a":"59cbe50f08a2c522a39d119ca3a3e9fb58cebd802b43f0a9d1e30165865f2cfd","lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a":"bb99fca97f8654df71f7d39835cf067027a13f494c727c088f5bb24fb8e7914b","lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a":"132711f478eeeb8c13178eae7a4333a1dabe173cb290dafc1e63029d8ed3bf30","lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a":"c101777b4e550af3154997d7084e011535fe1fcff63fc1f308b56d5460a61da6","lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a":"851ad8f0e7e429ce19970c01c153847ac623331654477ca2471702afcda7c824","lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a":"4beba4de71ef8d8e594d4eb11847a4b4f0b4af39065ab2d0514dbc21d6ece6b0","lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a":"903b8e5f31b2c0a7a51a1025068e776239f84d5576998e34b59a6c8c26b9076b","lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a":"664a323b72d24e364c71ed70882f5cb88c3bcdbecab910a8011bb1d9b3db03a4","lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a":"8d834943307f112bb5aafeba5a827220d46c2a98c3b3265db42c5c59208f1455","lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a":"b2e7c8daf52e57e635ddd1968a5772a19d0224479d1a3e968c4c9ef388b113be","lib/libwinapi_onecoreuap-authz.a":"e0f0da30836359036e4eec83e11a38a613a91607b98372d3dca8d1df132d49e5","lib/libwinapi_onecoreuap-bcrypt.a":"b868acfe9f72de551803d49fa3cc69e4d96144d056a2b5d504453a17fef5972f","lib/libwinapi_onecoreuap-cabinet.a":"8542118dbca3daaf1c20059b5cf51fc217bc8d07f9be9371b73008a850eaf2a9","lib/libwinapi_onecoreuap-chakra.a":"996172c0c7155ff516e495530d1ac6acbd121dca5c1d31470c6d4ad0b8d50ed1","lib/libwinapi_onecoreuap-coremessaging.a":"4cd12df5bf31689a1a6224ae0c5b33c2d163de405343e496e6b878dd2d1f61fa","lib/libwinapi_onecoreuap-crypt32.a":"cf03822b1d0a289625f4ca5808763128bdfdf3211a7d98acbc70e351161c6de2","lib/libwinapi_onecoreuap-cryptbase.a":"669510bf3c470a2dd3d1006df48570af0b955a7db9fba70a7e3258e08a499c29","lib/libwinapi_onecoreuap-cryptnet.a":"881273b4aaf2d960a204125ab8effafb218a3b0c5c9ed015f00b23939ca825d6","lib/libwinapi_onecoreuap-d2d1.a":"5f241921ed594d78c66a70e2b8c81502a2ded3924f5ccd3a1b26599ef9128038","lib/libwinapi_onecoreuap-d3d11.a":"1b65a3d086ebd9ceae0060310a2336eae0df09e46d3e2ea3ad6415a99e4366e7","lib/libwinapi_onecoreuap-d3d12.a":"63ff81940648454813139c1f03ab0d4bcebc1b00a3a695cab8a31e0519e58aa0","lib/libwinapi_onecoreuap-d3dcompiler_47.a":"d1e48f68f3fd48eac3c440f3d47c4415fba29840f9cafce61b6f9ee5ed2d6701","lib/libwinapi_onecoreuap-deviceaccess.a":"426276a40e8cf0f39c15b6696e3877391599420894a4372c127375eb30acc4ed","lib/libwinapi_onecoreuap-dfscli.a":"a952b4318eff08d4bb48418b2a7f9fe47c342d29130d82d0fdda4b35b939d574","lib/libwinapi_onecoreuap-dhcpcsvc.a":"e14fa60521ec4281a5563bc541009ea65eca6ae8f2b27bfbb905f98a882e9200","lib/libwinapi_onecoreuap-dhcpcsvc6.a":"9307eb9eafac5e56eb8736e0460ccfabbeb7033c22370f6d63dbec15750c2c7d","lib/libwinapi_onecoreuap-dnsapi.a":"4e9cc60fff43de5e6bc12d0aee71780efde002c73b1a2b3e4d7f43849ffab9e1","lib/libwinapi_onecoreuap-dsparse.a":"7bcca65477240d1c54454f202f6415a2f349c8df0720b95c1396c75f109d96e1","lib/libwinapi_onecoreuap-dsrole.a":"750f331c4aea4e08e0bf57517eb5cf83f965320a40278aae5bb81a44f2e6a370","lib/libwinapi_onecoreuap-dwrite.a":"49281a37b0aee062ceb2d19efbcb065c64acf4c9a3ccf7fb53ae5e3bdb3f93fc","lib/libwinapi_onecoreuap-dxgi.a":"b978adb600527a5fa0e13033c0bd0550451543223e39b2eb55448e24283fcdde","lib/libwinapi_onecoreuap-esent.a":"44bddaf8c8a5c2c487583477978f1c726472cecf578b96a90ef9d5d94d10767a","lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a":"15077a429ee981c3889f5f80f0d80908403032e9374923065d18dc5bb5f0cc21","lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a":"d748bce05acf164423b9f51af34d27e156c3410b11a9124472dc754b125a227b","lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a":"04a60651bd9c7ac36c123da5385cf803be1493f5cb24c44d653dbfa99aaadf95","lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a":"a499bd46bc48917584d8b2a787936f61d1de854c2fafbc079505fbc4f25eb662","lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a":"111fca4ebf3213be20875af33b7347bcd93a183a81ab25e11d2cdb54bf73e6a3","lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a":"82bff3ea77bf75b0a77c0c425c8a421a50f25daca665216919ea39ce56af6ad1","lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a":"4d43bfe29e7456fd1c2564dcacdd87257376ca49a8cb99c0a3cd9c5a227959ce","lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a":"aa5222069f5cf71d21576f8d163996a1a3f1911075027c8eaaec6cb48035e52a","lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a":"8861213886555fa0c546526d976f5bd49eef5b08de37aef719e2de567da217f6","lib/libwinapi_onecoreuap-fltlib.a":"911feb95d3b46095c2590284fd4e88c281332573c16d8d72503d766e3536460d","lib/libwinapi_onecoreuap-hid.a":"b8cef8cbabee8fbe7268f574fd480b3bf02c45a600b72113f3024ceee0c47ad2","lib/libwinapi_onecoreuap-hrtfapo.a":"10a3665b5176bc622b462f1716b0a60ba83df18d63bdc960e90bb6400da78d19","lib/libwinapi_onecoreuap-inkobjcore.a":"058b9849faf46a66e49661b8f898803f440de328037ab7815fbe0d95ccc2ed66","lib/libwinapi_onecoreuap-iphlpapi.a":"7c85f15f4bf6b7fe151b274255c9ad03db1743397616ec68f90c1f4d30bdc5ec","lib/libwinapi_onecoreuap-logoncli.a":"10741f4518a7afb84b9db379c00a5331d5c4b28496f079a3eddc71871752782d","lib/libwinapi_onecoreuap-mf.a":"86f4f4346b4370da7717db46685fc92558c1fca013e8610c3cef8c10a0fb1bf2","lib/libwinapi_onecoreuap-mfplat.a":"a9dc0e798d2cc9dc4a5e75d308a9d839b105960b8152624359ac61d28085a482","lib/libwinapi_onecoreuap-mfreadwrite.a":"d91b57b8fb1babcc90f2e2a1e1fcfa893917ead5827fbc1a22fc55a6b4635488","lib/libwinapi_onecoreuap-mfsensorgroup.a":"def6ddf843cf014ed2d160b35f3a25dbb252eb95c22b4e1844df78214bc8d1a8","lib/libwinapi_onecoreuap-mmdevapi.a":"51b3a515eae39cce8d75ca9bf918373b42ea43c5c33e98195d1ba57e4b3d9c4a","lib/libwinapi_onecoreuap-mpr.a":"1b4b7839d796c512c1ea75e0317dfbb16f4b450eb939927132009e8911ead967","lib/libwinapi_onecoreuap-msajapi.a":"c5af226bc61eb42442d4ccfa0de3ae9e10c64fae32e99cae4f955b5cce83d2ac","lib/libwinapi_onecoreuap-mswsock.a":"99dba4dac3253cd88010bb41dee7d614451e02e1f97c5c4ab1d6e6741a40a371","lib/libwinapi_onecoreuap-ncrypt.a":"0325fad3e5e48c0b38c06ced23f902803ae756e977a8dcbddfe375972a56a40e","lib/libwinapi_onecoreuap-netutils.a":"495bf6025aa07914547714e9d40c41e5e849aae50d8a62076059180b17b0f8cd","lib/libwinapi_onecoreuap-ntdll.a":"42edae05c46b040e6602b48f41d9d2e2d634ee1b19702045dfb3ed6a948c3526","lib/libwinapi_onecoreuap-oleaut32.a":"67c0810d64b9aaf7d5acc2ad2177aa21c3422a32fda8f8dfc98370dd3443613a","lib/libwinapi_onecoreuap-powrprof.a":"cb06fc8b9ed56f4d14e29ec5914ef51bd2edf8a61e25ecfce3b2d6be6fb368f8","lib/libwinapi_onecoreuap-profapi.a":"edf98a33a7377ea7affa0847479cdce329af615a9ff90ce271e4311a275a4cdd","lib/libwinapi_onecoreuap-propsys.a":"e91eeeeb49bc5703934a86dfbbb2a458c77c11841583af037f771c068680739a","lib/libwinapi_onecoreuap-rometadata.a":"a36bf05aff08f2d227a96d0b0178d401c68a8a289f53a84dfb41c3f47f105cc5","lib/libwinapi_onecoreuap-rpcrt4.a":"e0fbd8c5a2374c45601de615672f568204dea9e700669c7c8aa5f57661b3e8f3","lib/libwinapi_onecoreuap-samcli.a":"87afe7ca91002af17023dc87fca3273ea7e1b8c528ddef4090bdf999b52c8286","lib/libwinapi_onecoreuap-schedcli.a":"926f2b3f46e738c629fc0c25d638f21265db4935fa0e88ea0534bc034f8461fa","lib/libwinapi_onecoreuap-srvcli.a":"97440b0de6f0d6c44f5cb164bd0bd003439aae65010d9776a15943755e03b4ac","lib/libwinapi_onecoreuap-sspicli.a":"f76d297919833bce142c60628afd8262001ced9167ddf0e5a4a88e0fd4bb3132","lib/libwinapi_onecoreuap-tokenbinding.a":"367436cc51ea44815e6787f36c94cc79d000695064a1af10d4838960df8ae23a","lib/libwinapi_onecoreuap-uiautomationcore.a":"8478851f63c4aaf3d4ebec90d401f600a1d5d766ace095f37e8a9e92806ae06c","lib/libwinapi_onecoreuap-urlmon.a":"377442751f9e9f60a975a719d64a218a6a6ef395705b81d24769f449a4045098","lib/libwinapi_onecoreuap-userenv.a":"e4521774b639d11c5f44a34f8d3e6e5dbe6d23b1dd96d8c7708334aa46bbc23e","lib/libwinapi_onecoreuap-webservices.a":"60ac62ece62892bb6ae6c56a59d75cbfb9e3cae4f93e043a45f7cabde83545c3","lib/libwinapi_onecoreuap-websocket.a":"1a05bc66523baac5824c146aa8926c35b6b2acfe1df2ab830e0897c44dcbd25b","lib/libwinapi_onecoreuap-windows.data.pdf.a":"26a379975426aabe528ff0fc7ea303618f72549f8db06c3c7e01e76d78b3bced","lib/libwinapi_onecoreuap-windows.networking.a":"d8a72775acb279a2506861da526f3157576a663eb3accc17cf9526d0c88724a2","lib/libwinapi_onecoreuap-windowscodecs.a":"7efa18011d3656e3fdbc212275e4d18dfbd0e761209eea62cb0a63607d473fe8","lib/libwinapi_onecoreuap-winhttp.a":"45349940a99a4be7bf19b3b62a8e9f422807bf49790c9af88cd7421b462da425","lib/libwinapi_onecoreuap-wintrust.a":"c0b468f69150163c919d067fa65adce769dc2c3b03a19b4b3146d6d677a0ad1b","lib/libwinapi_onecoreuap-wkscli.a":"eb5b920b6f24c96a0cf522adc25fe75f511ccf765f1d8ca35bb617f89397812a","lib/libwinapi_onecoreuap-wlanapi.a":"213899a6dc7d4c4429e297b633758e85fc416a90de41878661c14ed252734f1a","lib/libwinapi_onecoreuap-wldap32.a":"afcd3b76aa882d56bb07ca241fe82c5c44cb93c222002419d28469bcb662309e","lib/libwinapi_onecoreuap-wpprecorderum.a":"e0e7813d542aa825d4f8146c7c7532ba83586d2a28a05315fdf43b81b1d34c86","lib/libwinapi_onecoreuap-ws2_32.a":"d4b7bc67a1b2ef2c3b454cf47ccfef81539bed541bc7a254bf6de379082e6a96","lib/libwinapi_onecoreuap-xaudio2_9.a":"983acf7b29684338c3cfac1009d1f3ea1f0ce12e826018f8297e5aff40474343","lib/libwinapi_onecoreuap-xmllite.a":"15a707fbd4170432fe2f8d8ab1befc7621f67dc1f89d229feab79f551a44de85","lib/libwinapi_onecoreuap.a":"4e300d7c78faa2b7d468aa0a6638fc58c670537dce77cd5a2eb6ddb02b56d052","lib/libwinapi_onecoreuap_downlevel-advapi32.a":"446b131e441165d435585c347444f55eb11086da6d23e58e2cef7bac5de0ea1d","lib/libwinapi_onecoreuap_downlevel-apphelp.a":"6f450c64be21886b051f4110a30771fc5cdfe4c9494424ec5bd9add3c15efe90","lib/libwinapi_onecoreuap_downlevel-comctl32.a":"a5f4814e9854f7185466e0161ae4627d5a081d070c2e2598d4cc73794d098e25","lib/libwinapi_onecoreuap_downlevel-comdlg32.a":"ee490f9621d47e6adf6ee7e2a713829936f90808c6a09941a09a4c1e224b201f","lib/libwinapi_onecoreuap_downlevel-d3d10.a":"9ba34746f018aeb00629d1d9690d341e09770e0fd5f10dfbb81b63f6eed35e42","lib/libwinapi_onecoreuap_downlevel-d3d9.a":"a2a97b7dcda9519a50206b3cabb04517a7de6e5dcc51201eef932e5bcede3b73","lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a":"3a964f22faa80576bca7d2d4d4b73fb0448dc87ba1c293e7e711b301705666fa","lib/libwinapi_onecoreuap_downlevel-difxapi.a":"f99ed8c8c4386ca76a0e0d09f8711577a636768b76a24a4586c294ef52784ab9","lib/libwinapi_onecoreuap_downlevel-gdi32.a":"f546864a2563ecef8edc6b1789ce4fe392e00f23c4e5b18dd572172b4d762d4d","lib/libwinapi_onecoreuap_downlevel-input.a":"8f059f86c0ba3e9f7352e01e6d19a40b0666aed67c464ebc2e8b4eaa132037c7","lib/libwinapi_onecoreuap_downlevel-kernel32.a":"f68ce42f050eaf7dde5a36de2f073e3a7021e13d0715b4c5a9b9b29c0bc0ad42","lib/libwinapi_onecoreuap_downlevel-msi.a":"727a6ad9ef23c36ba9dc511b39e6b5d08f8a06fb97357b70a3741dbf6196688b","lib/libwinapi_onecoreuap_downlevel-newdev.a":"1494c911ef6039ec297ed14800aac6aa694f4a75d80fd8ac3d7218b5dbf851fb","lib/libwinapi_onecoreuap_downlevel-ole32.a":"99934cc9b0f520238540aee73c345390fb657b51bd8d1a66723086a647ea3310","lib/libwinapi_onecoreuap_downlevel-oleacc.a":"2fb46c4eb802dcbcd767f81505f3ef2972be7133290ee38ea117338784a3d5a4","lib/libwinapi_onecoreuap_downlevel-oleaut32.a":"0085bfcb320c8129a2612f556fc7045ef71f2b521923292855574b7f10792e3a","lib/libwinapi_onecoreuap_downlevel-oledlg.a":"b2ca13d5a826424c60fbe47db98164fcc0c566acc9c52a5cd2eeeb4bdf305fe2","lib/libwinapi_onecoreuap_downlevel-pdh.a":"3a3083755e865e489cb362dcb5a13cad45f399dea58ae9509ee91a7e79b79e5c","lib/libwinapi_onecoreuap_downlevel-psapi.a":"6fd037774d3b2cf0c40e4b2a023f96133eb7d29d2adc2e95354c8fad39debf7b","lib/libwinapi_onecoreuap_downlevel-resutils.a":"36d52efc86720df0876fddd88d806c41f69809880e69239317d736f681a48951","lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a":"fb4efcbc9c0d907c829fada91abb26cb922f1a2790fb01852fea812f18534257","lib/libwinapi_onecoreuap_downlevel-secur32.a":"3e7351302d67974e1c613d3734ef43db2aaa5ebd73f2b8a775b175db47741b8f","lib/libwinapi_onecoreuap_downlevel-setupapi.a":"fa6597834a8abe76e05dfed0a3e016929fcb077d6ea9c0200ec00b6cd9f1c6b1","lib/libwinapi_onecoreuap_downlevel-shell32.a":"94ec337fc06b86503f2418e483cb768ca16da2b63f8317cb84ac75fba9475f37","lib/libwinapi_onecoreuap_downlevel-shlwapi.a":"30021f8e94ed49fba0d48c496a9240424010b09c571a8f7cbcb4f94158f10e0d","lib/libwinapi_onecoreuap_downlevel-tdh.a":"2d9e5f8ec479e7cc72b88ca8a7eb1204dbafee1363c02c7451b83c191fd3ed1b","lib/libwinapi_onecoreuap_downlevel-twinapi.a":"0900ea4abb2b66ecef125c036aa1fe992f3ec77371c229743bd70e01d0af8346","lib/libwinapi_onecoreuap_downlevel-user32.a":"362b2072ff4c99501bff9bc5dc6aeb1f5808f78e3eb78c7c75f5a1af3363ac29","lib/libwinapi_onecoreuap_downlevel-uxtheme.a":"29b3faa13cfe3b390d8ebf41b9c08d56c84aa801c71cbdc5d9173381e61152d7","lib/libwinapi_onecoreuap_downlevel-version.a":"b03dcf6bf1ba34ba56b620ea8022a7179c7bddc967dedfdc8b60d3346db0f9e0","lib/libwinapi_onecoreuap_downlevel-winmm.a":"853ec28ba94036b193c79c85d1dad2b4db5fd913f737c6b796bc983c7ba17c99","lib/libwinapi_onecoreuap_downlevel-winspool.a":"510d3b0f0f11d3c51cb88bd6eac65c9a96b118550ea8d243493d5cd8ced4db43","lib/libwinapi_onecoreuap_downlevel-wtsapi32.a":"6306d9a9027228ef56769312823ff6e9631e4878ae7787e97bd10a8c321a3f64","lib/libwinapi_onecoreuap_downlevel-xinput1_4.a":"2dd8563974547350ad927aa5ae72b8286137685c91235a3e9657fb454780f64f","lib/libwinapi_onecoreuap_downlevel.a":"6122e2af86381e597496cae0a138331539bbc7ef6056086e4700e17cf7da3614","lib/libwinapi_opengl32.a":"cd61467bd26c2f04263a328e8f24a0eab68b5b4aadbfbe3783434ea3863a84e8","lib/libwinapi_opmxbox.a":"17754f6ac6a65ee1ad76cd4f9736a861900899e4b6e8d933158a9d9e7a356b60","lib/libwinapi_p2p.a":"6080dc0993d44a7fcb3d7823771389b94a1e6d98ea6c246d54b3a072d7e4c7ec","lib/libwinapi_p2pgraph.a":"8ba6ce395e5a033aa787a01caa231ff21e76cd474b8dc2a006252c41f5bcaf48","lib/libwinapi_pathcch.a":"ee5b051516e4c8ca29cfd16f0faf0ee38699be03f76c0eb2d16a7dc48fa2e10c","lib/libwinapi_pdh.a":"c38a909863a22830824d9970dbc026354846b5b54674694544c3928d25469f85","lib/libwinapi_peerdist.a":"c73e4b074e62add8b4030c6e2534ab2388ed5a4c8ba628284c65d27c5c64a777","lib/libwinapi_powrprof.a":"4c15dfa756dcab2e0433b76de463e0ee1ad68531a047bce5ea27e055d1f5f537","lib/libwinapi_prntvpt.a":"1c9516faafb35dfc21d52982cafb9dab98bd8f6942251ba7a4343445d711bc22","lib/libwinapi_propsys.a":"20757cbaec15022c8ed44b465a99f88f9d0bb42936fdc7751330df8dfe13442c","lib/libwinapi_psapi.a":"f6f67c5beee3e36eef891343bb7a93eed84735ea39e45097087830d775dbb651","lib/libwinapi_quartz.a":"173172c1bec299b8c6483950e531f5ad0d7716d2033e06b82aaa16149fd5b6f9","lib/libwinapi_query.a":"d78614fd2084f15e1c832ac41799cdbee92c98580323b4cf47a1344c41eccd05","lib/libwinapi_qwave.a":"8b393b0d5e937d30f57f649b389e6f4f654b5edbbdfe8bc60d7acbf5a44797f9","lib/libwinapi_rasapi32.a":"b1acb42a2631daafc18eb694619288b49fa47cc37f64be62313de9319b3c1d64","lib/libwinapi_rasdlg.a":"00391874f0541e15c9060d07c1035046669c122d2c620dd4ce1c08c0f2750b5a","lib/libwinapi_resutils.a":"d58453d2906d115579550ce88b3d34873262a600eb103f9130ef95356b748044","lib/libwinapi_rometadata.a":"5fd852779025837e7b66422dd543b4f8fdfb188b6f7fc5a6d758aed4f666043d","lib/libwinapi_rpcexts.a":"dcfb0696cb99c7c4fb66e614f991e9f5e6093557a88afd5da3d557d3d47f0262","lib/libwinapi_rpcns4.a":"7c642bd1aa5f392a8167459f84f942d60ce5ddea53f7e65d1cefc35b90313c89","lib/libwinapi_rpcproxy.a":"744bac498456a0d486cb1250390c57708479d815d1d028fb88222a45bbb9a31c","lib/libwinapi_rpcrt4.a":"81ad88b3cb4bda2a013695376a32d39d20a8c847fac82c1a640fb14ac2874cb4","lib/libwinapi_rstrtmgr.a":"58695aa1de3f1a45a3551e337d2278363e99e8994fde5bb7429ca91bf01eb670","lib/libwinapi_rtm.a":"e279ed0560e4e178a1e16c2f017b401bf4709f15f0bf48bbe5705edde7ed4ea9","lib/libwinapi_rtutils.a":"e4fbdd5ce86a67f0839adeaacddc5e3fb4dc1a44e443f51f79366311a27e8641","lib/libwinapi_rtworkq.a":"558abac8f635cfddae0806bca089faf1103b84222c7677c258e6d18325eee0aa","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a":"3c22240ddf62dfa3d893adc44e25040b26b3a38ebe772854e6bc9fea4628013d","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a":"cfda587f4371f9e7e0bdea96859b98d874ae18daa437b75725563d5c423e99e8","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a":"907707ad032da229b20bbae0d25c7306d22e996a7f977b3097c3a01d5317f261","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a":"49618d57bd1a24aae006acf0103ae8095b9e66421a631e1e9ed384a7197d07f8","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a":"70581a27d058901a5a9bbf41a16aa5d16bf72f65b12af4fb85984bb48e3ee1dc","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a":"07200e5f0379ae3cfbde9b851ddd5d91183b4b1994aa3e4b5b0484e302341612","lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a":"fffd7d400e5dfead0b73981ed370ea2b082382b07ebb93fc7232f374de10eadc","lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a":"48a032b080076be0ea91bc87e0a0a6f7415e8091b9db50fab0c6baca209e3a95","lib/libwinapi_runtimeobject.a":"7a0548c5ef5fc5788025e031aa642d18ea94559299b48fca507d3f52ef2e4b9a","lib/libwinapi_samlib.a":"91ee9a8d2bdb3501c6766343d1bb6bae46c39a20fc587812c78830173f1396a3","lib/libwinapi_samsrv.a":"d08bf3016166a2f335d04301a3064c433853db5466f5bf5a86653e42e93c5d2a","lib/libwinapi_sas.a":"405d7376cb9c77f67cfd5670bcea8a01cc16b19be6c74a7d1df53a7b9c42017d","lib/libwinapi_scarddlg.a":"fcc2ce4de77b26febb5d4775a1d8ded0509663f0ed17a8e79348cbcece2b7e1d","lib/libwinapi_scecli.a":"da81628253676a97948a59b44c0c16e760a34bc3b7ae87191dc235f07960c0d9","lib/libwinapi_scesrv.a":"639df7dce2b17166d0258e7368712e1024035a51293a2c169b42ccecdfe11aa4","lib/libwinapi_schannel.a":"e9f5890a84dc3b8314ec11f29301ff8471d94b5937d46d25d3ed6081c2ab8073","lib/libwinapi_secur32.a":"ea9cb6b2cf08d69c851ba23894cded1f7c4d832264af7fe91be7b9e862f8d20e","lib/libwinapi_security.a":"ff008080e458fcc7ffbfbd79bfa4da9dfe867c88015490f2b01424afe20086b7","lib/libwinapi_sens.a":"44b53c350bca96699a47e731c60996bfb7a441b49eeb37baa7c3d0d6fef559d9","lib/libwinapi_sensapi.a":"19841a881728565c15ef3c431e7e317f8301813e6b046146f01203cca0fc3292","lib/libwinapi_sensorsutils.a":"e4073214a0d131b4a6429606a07ce59d90367b7700ec1a642813b8f62ee65c4f","lib/libwinapi_setupapi.a":"ca332f657ed83d5a06a576d90529c1519d90fbeafa93c71f3542d4cf6b03eb3b","lib/libwinapi_sfc.a":"2dc50bb6cb53e5424a6ffef118fdc727ad22964687da87d0a101659b08984139","lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a":"fffb49f303f5b25760ca8aa705ef97be92f642e647346687fab8aeb1883ecc8a","lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a":"47e523efb180adc869d72e03c084b895ebe56ae5120b49a9cec6c6883fd687ad","lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a":"0f4d8acbe62d2437d856d45e09bac00f65f0ade09dc5c326581d9704957fd75f","lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a":"d244e9560e96e214d80806f8598e71e98ba9103b653d372dbde5f45fa33a117b","lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a":"b2e1d7ae641a34f3c1049b788300044c1bfaa5504533cc57e046d9a13e386ec0","lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a":"4c3a88da7377928ff249a0620741cd949355f7ae8c3a11db78c3a1b375a8eb89","lib/libwinapi_shcore.a":"e2d0fa7e9c0d06bfec41008a6f41c47769cd4ba6ca839efdb99bc2e0cf4e1a39","lib/libwinapi_shdocvw.a":"1e0f3f43046b0ea779d69a3c46ef31450386baf3a135f8198a2299f9e6531fe5","lib/libwinapi_shell32.a":"342bbf0eac1dc3441526dbda7ba79e269219a5820a9a54a6c41050e8b28b4d5a","lib/libwinapi_shfolder.a":"64695b29cf965c9de61fa26aacf27acc43d9653166edcf47cce011a4bc171f27","lib/libwinapi_shlwapi.a":"e111842c79bb11433d74b9f52d51a74ae8f78527470bfc401565847b9c59c5ba","lib/libwinapi_slc.a":"9841bf76a2366a73b33d7d14c220813aefd2cf0462f090231f0ab44e7b5bfdc2","lib/libwinapi_slcext.a":"f5141e0529d6788add8b0bd0fdd0b4268f25deafee8d2dd59f427fed82f63b6c","lib/libwinapi_slwga.a":"3a32c92e0d192e675b1aeb8a71272dc14608cc62b26aa6b9db0ec1c3fb6ff556","lib/libwinapi_snmpapi.a":"a1456434d462c80e906523d7c389792be7ea5eaa17dd0d162e65a1b543368e57","lib/libwinapi_spoolss.a":"f53249a979dfed0e0038db4e8f4a8536b1f6382998112429e2d0bfbb0bae6bde","lib/libwinapi_sporder.a":"c18d86b92469bed1231057ce4c2dd76be4fa325e5576cab1828ef04b11af0e26","lib/libwinapi_srpapi.a":"d9301c3d6778da6efd7fc82b081931548ac0f9cc0fa0985bceab6fdb533abada","lib/libwinapi_ssdpapi.a":"66300e9a08686873fb992c8398284c80b40d8a28b8d55cb9455024b8e3888acd","lib/libwinapi_sti.a":"1a674eeb27c4a0854d01a14b50ca2fec8cf116662087887c485f93315440072e","lib/libwinapi_swdevice.a":"1d6363c447b68581d2a9f0cf6b874c6296878f974f239e9ac1808eea1a2b9d06","lib/libwinapi_synchronization.a":"fdc8df30efc2b7fe58d83d4eefa6245f35f2e534bfa6357c069e061da91aaef1","lib/libwinapi_t2embed.a":"79a7a2ded05e377b286fe3319ff30840632c8e6b08cfebe619aed4ef18dcd701","lib/libwinapi_tapi32.a":"b92b8648e4d8024f6457a84f80432048c83e3946a069e3ee241fe7a0188e1329","lib/libwinapi_tbs.a":"85a9741c2789221e90d4677df38f12ca837235c46b6ca765d1516e5dd9b8b89f","lib/libwinapi_tdh.a":"7a40b11938eb4c888283edb75b523ce58ba7bc80598dacea4c9ccb674bf71603","lib/libwinapi_tokenbinding.a":"faa88b4ca04226baedacd9b34d9dc46bc332c1e8aa87a2bf1a7f152c106623a3","lib/libwinapi_traffic.a":"7838ad22ff777a4de867353c5f2960ada912bc502b421c70d2c1ab814af37696","lib/libwinapi_tsec.a":"94d58b06c649ac6febd1be8c0a14ad112871fdcad75122ef4bc39ee52d2744af","lib/libwinapi_txfw32.a":"630f274d67e4956ab9d066d3cf79cba5de57b173fa8988c242520be574ae0f2c","lib/libwinapi_ualapi.a":"dafc0cc5db2358020464598f1750ed79fb5deef00eff70332d134d922e08bea2","lib/libwinapi_uiautomationcore.a":"9386c67bc47a45637e8ad963133f2bef11adb1ba0f7744200378b7cad245a571","lib/libwinapi_umpdddi.a":"6917cd155ea1efc89df72102d9b240d5deebfd09d8131b1376fc30e44bd4cefc","lib/libwinapi_urlmon.a":"15500bc9703d990df5c76e9fc982549eff5137e912901833c36731cbb1ef03cd","lib/libwinapi_user32.a":"cab4ffa1522d2cd626585ef27f0355b89ca2cf6a1af208cb0a08a851be676c2a","lib/libwinapi_userenv.a":"490004a87dc9a33eaa5178d4e0f9d4e2e5704f227c28eab018c9ebdb329ad003","lib/libwinapi_usp10.a":"9388553f5594b2cb0fb5de349f86462945969b215baae6ec3563ef422c0ff236","lib/libwinapi_uxtheme.a":"e79890801a208f5a97a032527f1b6580860fc170fcad13f60af7025bc55816c9","lib/libwinapi_version.a":"9b39a94cd041c08006833571ef2c5010ad002580bd7a7f959ccae4b7bb2a53a2","lib/libwinapi_vertdll.a":"2d9e673b14ac040402fb01b7cae7c38a8f069de117f24ee528c48d2200dc046b","lib/libwinapi_vfw32-avicap32.a":"6539084f6426499412e3e227a60ade3f66c9c7cfc0c3b56574c247ad8ab20b6b","lib/libwinapi_vfw32-avifil32.a":"a46baae68ee4545847d0f943217b607b3db4c0e98c8f636bd0e6cb5358385f53","lib/libwinapi_vfw32-msvfw32.a":"df741fa382f893f72277d9c9c61186252df1b3a53fd46fef0bd4054eea583dbe","lib/libwinapi_vfw32.a":"1f7bf15b2c0d637ef6a424ea0173f26d9adabb2bfbcc5711a95b408e060a7d96","lib/libwinapi_virtdisk.a":"b49c9ad313c8f3721d471aa92efbb671a9033104d9b455fc001e7d51fe554c03","lib/libwinapi_vssapi.a":"b6419c12a1aa251b7afe503b506b3cc2d2110bfe7b63329974915535f7ffcba8","lib/libwinapi_wcmapi.a":"d7d5892554e47394023a11be4073dd8d37d68bae06445fae9031d9c4fe25550d","lib/libwinapi_wdsbp.a":"d66a854206703421d8047aab169c0164f5601d72b18aa9995866023df455ea5d","lib/libwinapi_wdsclientapi.a":"28cb87834670a97daee6b59bd2e3f93d7054591fa8534dc31b496c57c45605c8","lib/libwinapi_wdsmc.a":"64197d80127a7f2fd6d2a86dce0d22d279859bc30cc50990acc484e1f2268def","lib/libwinapi_wdspxe.a":"44a2932596e7332447c45e60d361bf2fcf07e4d80dd505e4d9154e1c104abed9","lib/libwinapi_wdstptc.a":"c080d87fc9aa5c90d9eb936a4c4087a90703b612109c415b319533e6b32aedaf","lib/libwinapi_webservices.a":"bbd4e2a1d1129f2402faa311d232b16d5459b8a735cf08172677e83e19eb232c","lib/libwinapi_websocket.a":"c43b8eda7cde0a8040732b4ac093a1197fc4e2408ee9b8014659da745c25829b","lib/libwinapi_wecapi.a":"88a7259bae69e5c6ecef972a56b529d50151170b5886503216010e3f0bda4b1f","lib/libwinapi_wer.a":"a345247b177870607ee9f53653ac31618b258f2167b08fd1f4e064f4bf7eb9b4","lib/libwinapi_wevtapi.a":"83f302ff302968a7baf739ba768669e4b9a4173377ca00ae2f9f273ed7f7a494","lib/libwinapi_wiaservc.a":"acdd02371456418233a310bc6c9f3b89679b1f404189610c4c8e4b2dc391289a","lib/libwinapi_winbio.a":"849ebb2527d786c4b9e7c003c1d0b3d6870760af55fb459d95b5ec5a9ac23841","lib/libwinapi_windows.data.pdf.a":"3bfaa6d9063849a48231a0f0389bff1d943fa8731e8f9dd0f44e60a1fe83b273","lib/libwinapi_windows.networking.a":"4779dcaaf565e38ba1b70de811a7b054f71b8518560aa197b31cda6e19dea6f2","lib/libwinapi_windows.ui.a":"ceacde478768ba266891473df34530edcbace3f0d2f63fd4ebc77f2db5ae035e","lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a":"ae5a529ae45288b871632f3ec12db35ce4dc1ce8535963928263e57a9b00e938","lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a":"83b45b3b1764b8bade36adf6be1e7b4129000deb8fa6a74da66010c2e1972d3b","lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a":"4e371b5c9bc78e90de4bccfb5f8591f1a00ea52dcf3ebb5ac28d42cebd5323e4","lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a":"508fdae146d10f709f241b72e50538b806411365bfd25d0b058f930087d48468","lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a":"eb431ce92e4089fb2b4041beb5a1c6cb5b3a6b260f7c7b5b2cc939163842709d","lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a":"7732e7fb9cbcc6f7420942491e7e6ffda9d4d342df6cdc6d6ce8ba703db38280","lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a":"2854591f2764af61e6e9d0eecded807cd4d1bf1105c11d8443149f63faca95f6","lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a":"cb8d5769116f8bbfebf7ee76d5dd0328a07bd40c5fafedf9f77ab4233cbf0145","lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a":"47cee44464b1b6ab8f830bed46a74268588123fb2fefbab2f995a5f4ecc6b05a","lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a":"d1d821fbfa3dbd91b8e979132a8f8489a027ff012bef7dd966ae84887b264207","lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a":"2d7c594d910f03157c45bd42746da0270fef7908068cc30700d07f6bf3549e0e","lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a":"68d751df1f53f2076de469949b57bd90bb6ebc5b146835b43aa786bc6235a6fd","lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a":"09381a9efd95ddf5eeee4bb4f9a726f930c7de0cd33c559e5f18306d56ae97ac","lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a":"3d346fa6b1fe9d9a73b0f8d0b9444cf57917bf59bce6ffa3579932788a8e11be","lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a":"a2feab35eb695d0f9e6b2cd7ca5889831353ba5cf7e6a7101ccf7a054f97f2c8","lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a":"567dafb75dbef76c3c323fccb2a0b53a2a38c22f4e62a9d67f59df122a1fb5ee","lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a":"1759d5d8488b35db38e39328b66608ab3e253deb3a1241e14e79e7b329da024d","lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a":"23fc0a3663b50a1961af9d96f6765cdb5fbab4093a5d39181ca0eb244f44478c","lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a":"b4cfaf6b55bb108a94a5e68124d2e9e0c674390fd7a35b9b3c625ea5798b2774","lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a":"74f32a510cce263ff575350680506802c6e3bb23d7088db7d0308725cd9da80b","lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a":"363e8d61b1012f11ff747e76c23d271b3115dcd50b8c0269d7407c77e1792b7b","lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a":"e3a89400ce02e583cdaa8fa4de050d8e65ee0339b13ea82f73d5096de7cda622","lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a":"00e98c96b9ed76b067c279fe68582d292476186b4c2f2bbbe3ef414e89848571","lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a":"96c54ff9391a8c24f3c3437d1dc25ab3c84c360d3159f7ccd0d0e8c7f351d9e5","lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a":"a7aabc370c4945162648ad40feb159defa54ea457c6d6def04e2bae1935bea5b","lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a":"fe2f464e89d569e63bd5d87ceceb81beb440bba950b89e537a067f36319f92a2","lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a":"6f9530c4aac755d101bd7d3106c44fa5ea3244e33f4a3c19a75d9a9407934d94","lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a":"199bee21f074cbefa33b60301865ba5e4f1376f75c912147f13b55c7dea05610","lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a":"1f5673e6408eb3f6bca799abd9296c32ef0cd32d97f5d9ca4133a99611dbd8c3","lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a":"c37cb5b9d56b54b02d5938bbe8143637267d4c36dcb923e641fcac497c1b3f17","lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a":"677786bc9efc8691621ef64dffb264bc16b7b1163efe6baaeafeb7c6e36ba389","lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a":"a9a139d309cb0c125c4fa65307fafd2638786f336f0e6d6fd1a7449eee13da49","lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a":"26caaf18006bc0abbe3d56a73ff96a9698111d9f4b98fb1f0e790f4447d5ba59","lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a":"bfd091b593c6be02e8d274c3d175b0c220fd2984837dd87d135c351159e201b3","lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a":"73ea930467212eb507cfc65b6aa44d0afda3d61944d985f75b931e457087a8ab","lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a":"ef5e4130be7b1a1b883df609dbefc06f9e54672ea9f4a24bcda165b2e9037cbe","lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a":"394b682dd8369924304efac3c96c0725ff708e9347aca12bcb0507bc1b12d9cd","lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a":"21d8e69b6b3c0d0842ead7195e4eeae70235eb4efd83672d370eb68c30230eb3","lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a":"b2226ebecc94545b17792169b91fd2b9c484ef3fc57c2f2ee7fc8c24732b93d2","lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a":"fb8c39c016226f510786f877ecf22aa3a0aad36035f43bf52e38eeb1d1d0dc2f","lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a":"075f58aefa7fb31879599afc6307ed2d6d21877106741cfc60198a6cdaaf47db","lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a":"dfc425b74e9c9b8a9ce0ac16d6b07720eb27039bb82d24b1d6f73f31453c7700","lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a":"c842bd5d226d538229d7fa7b354c5ed80ab9e16abe4d05d687c7b5aa6166a7bc","lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a":"dd46e937f2215d3b8066a73fb33dcf31612cd4c74aabe86cb17ba7dfb6c3541d","lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a":"e19d3c11346e736ced16193b8419f6c887d7bc19d0b77bf64445467f8da453c1","lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a":"1b4eba533a023b9b2c1a0489fd4a8e1dabe129772414c8784b939c6b209a8393","lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a":"63b4a889f279bbcce34503874b546c12b610af3c336e94ab1b12a321af219da9","lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a":"798a833babb6b8901ae06ea1621a1d14ff4d573c9dd80be964ab2895ba1763d8","lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a":"25dcc0836462742853efb4b704e709ff182935495e7a4b6c385cfa30cf7b771e","lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a":"1e448b81a7d1ee34ca4915917f11762550fb0895619bd6aa8ce11522798abfcc","lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a":"ea08db7dbadd651054597951dc0114e71563df15ccf39e770d7f70b73967db9a","lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a":"5c1b0121f7cc1578b79aa592f3a5a157d471d367e1337ea599281e1df7b308ff","lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a":"a2ec02ac776bb5f3dfcde0bef2478f8ca681c9d62a7ae7396eac3b3bdb5e0018","lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a":"7d3c77019c63c86e19d4a9d007687d2cf32d6c4c3a69597b52fab704bdb9380a","lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a":"bd87331f4656c12e21be4f809d3e6c15dfd3f5f623a26ab1eb816814cb229de5","lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a":"679cf926529bfe1745149cf17072ae8842da2d8d43d51d595e47e50b7cc3ad88","lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a":"f88640101f58332a336fb473ea273e400075bbdfb339c74936491e8d871dbc8e","lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a":"ef8ee63a4f86b293b8da715f5879a5a68e1473aca6e9d9def7f80703652586f8","lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a":"8b5111199eabcd7bed60691e5f0560e2fb8cbbef259cc6aeba814036dde1d64c","lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a":"40bcff81cf7fb2dd08bf472a1c20cb5a68366563ef63ee377c2955c0b712eec8","lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a":"53308d6bc82db5f0b8df19e8c2d0d3cc8ad175491f4afe3ad43d3f2459fa37ad","lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a":"fd98443ae36986e88870d302b821de44f253b812846204c3b320936e94b9dcb8","lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a":"74e7e75117b012a700079e7a8f6bc7dd772fa1b045426476ac4aa285510e8033","lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a":"f0f658a64b32553cb31da782c975c2c10c89e9b0c4d2db8647c04419ac5afca1","lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a":"2a1c018da98ba81eae3c952d3e2246dabd2815d6ecfa9c299597af31f41bc8b0","lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a":"af8ee6bcb56f69f6e8cae367d3e5ca7a7e5767a65ef025ab73444cc4cd84f2c5","lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a":"61283492150d56f27b1565ab137446329db98cab4d8a4686ddbe601f78533199","lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a":"2f3d245f6f1306f1982b9bc6b9f7f189478578475c74ccce41c74e2d0f9fdc71","lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a":"e1ec06ed7a57190a3b362ddae83a2d1673654780aaab2669e4ffa98148392388","lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a":"0b8045cba487a094bdc9968ac70e7c74a06203ffdee79dc7f7161235beb7c3e0","lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a":"a21d40fa108dd467e7a1a33f28b275f747a101efc4207e8edf07ea043bd7e89e","lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a":"d7e300765ebe2b9023a5212fe76fce6da4bf1811f9311c8753694cd4e4340f53","lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a":"bc28e602fb4600315fc2e1c84520eac7ec1e3d21d31cd68b1f21ec2fa0967839","lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a":"5205a816830618555705303c76171e70e4427f6eade4cf2f0b9925de49f971f5","lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a":"94c517e63ad80396976472250b833a63918768b56fae0a560e9d0f2b7de8e043","lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a":"a6162bad2c4390849f390725e9bc9300960f654c86ea4764d8a7abefa0dc15eb","lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a":"44fde3a07b7f045e20eb7c93d26f760fbe7c77602a829c5393a7cb991383f837","lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a":"662a900b3f217c0355ce0b6f9946d39c84b2fa9ae94d0a485c8c52d28ce1f3af","lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a":"da1a0bf48aac28cc96e29822c62333777787193394e9e7fa0aea17ad232a4940","lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a":"02cb9f55b872652c53b2533ee92e75eb327c2dd52cbb2d327f336ef009f9e93c","lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a":"d46dc40c1ccb40880bb4052aa17a458c858388da0da7cc9eb96da8aa09b5231a","lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a":"677778edda4531176ae134475b895cda615e51df45576642dc932c8d8c9a10ee","lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a":"0d3cceadee76b329dc30d501c2d73755bc6276cafeee2697085b4586c544d06e","lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a":"a35894c59b361b4f35bead6a917a8a210508c1c96001826e0a96cc7baa1c842f","lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a":"369718cfbdf91609efc62cf9605c8d81de831ff5f1f4fdd0f62df54f832df758","lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a":"bce191f0587c8f9d7f676be1b5190de2de4f996a0910e4c76048e018930e8e88","lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a":"f61f1d99bcfb7b5e8d96a56c52fb725d9a36bedfc7ed08cfd7a3bf1e2311a577","lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a":"2f51b21fe9a60b81b3c16709fd36d0cae88ff3b8f55c0816872c5c11fb423271","lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a":"945698b1a3027bd6d13127847635311f4918f47797c2cdf00dce03e12beebda5","lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a":"1053a4ea528bc28aa1c0100eeab95f608f12c6783bfbca11f907a243f7bbce9b","lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a":"a1655c5410387c0051a553c1b1742553c4773a7eba8e53cf25ce24f886961a13","lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a":"5df21a1d47100128914dee705e4911b34970157ac74ac254858089396367e281","lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a":"7aed54533b4709f6bdc9f097465bcb4a71b819431239978d5963fb48f83adab2","lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a":"e806b412b7373abe95852102fdf75a2f0a6bbb95f01611154e6e135fe783d54c","lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a":"5ba4d916eed3e36d665efb99922c3e975d12f31ad838f72352b5116dc4adc054","lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a":"ab9513a9773ce626974fc0cd1d024361461396e343589753384e6dd098271d93","lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a":"ddc5f1e9c7748223abfb6b1254a29976c13ffa9b62eeebf4704b6ce778fbec53","lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a":"ec0c3b1bd8ecad5411ae6b7f626132a682795a5d495e5cb8cf8456dacae1fdb9","lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a":"bdcd1862f07ca2fa628fe32c850f02ec51fe31bb4c7169a320b0b3636715d27c","lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a":"074094d4fb9d8cfa85bcf9eb55610b7635cedc0446d7d4bbba23ec29ee81fa23","lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a":"1aae3b87b4daa4ab1646dac2e2ec947c883f33fa5105c2b74a97eec98bf51aba","lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a":"45e0c6cc9374dbb69e0a2e4258f3a9372e0eba7165590f52cd8ca7279f38a33b","lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a":"13f13a875a47020f343c5e8f45e607da17e865f930c10d7d1bb20e58c7d8d319","lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a":"100007c54b80e4b063e81b9cf74e0031a2b7875557a2d39e4c66bb1c6fededc7","lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a":"dc96f89d7d7d2fc4d011835bf72efad31bfaa396450d3bafb60b7b8c3cc3a29f","lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a":"a94abe923e2e1e62e00ee6271c9493c9996d1866ddef1d6ae4baa31e3e193452","lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a":"4cc2d512c93c466801ff1aba3b269eb6cd8bb5e068fb3997702d7e9de6d69e7b","lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a":"0d2bfdf7f4e6bfacce139de90bef4e7b9be2247e46b590f43472bf512f9cd547","lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a":"f87ff616008bf1f362e6a0d3db8327108ed823f9705ed6d0becc09bd812c4321","lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a":"dfc34fcafd7474b13c89c85e12d65f45e54c5c039b409587cd57d86da103fc37","lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a":"f1815af1a3878fe4ef29e9faa11662adc1695d2f20fd1fc4440ac30a3634a519","lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a":"c6dd8bef4e2c33ade7eea1fc40ec9b953f99ff67b6fa7a7af3a2f6b092256832","lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a":"d4b20d678a7c9fcdea471ade884d25f65604267f9f0ecdfa12216c6739787fde","lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a":"833f719b840c9dc743a859a0c307c6cd6c6135834c861d88d65039ae46e862dd","lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a":"3a56df33b86c8b4120f684f596cacfd9aeb549e04828bf421cd0386e87cfcbd1","lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a":"a61a0f2491b6e8709a77e6f3c2355d699c8c3d66177d88b619219447991475a2","lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a":"c15d3c10174bb320025e4783e7c0325b018454f7c2a5362a522a6c3c81ac2e15","lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a":"e1893322b38da323190f399dcf6fa6a0bf1211d81604ccac0053d7bad8faa2e3","lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a":"9b5b10583e46bdde128c7cdc4eee470fe00e53faa060ea43240d599ea4acb714","lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a":"70ed16b31f947bd7dbad9a2e8ec9ca4b1989dec49114e547a7fedaf0050853d6","lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a":"efb7105f66e30d6b47a4d7c4e4bc855bc93700cffc85c4fcb88c5ed01924c08f","lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a":"bf3ae73201b0ca57f9e72ff63fc4bb02c8688be9bc1b26f03e7ec8625adce8c1","lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a":"708c5b394d77eef855e38e5def7c20dc68c5eb3f42559da9a2410216b0dc804b","lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a":"f6d0415df84733fbb00367d7ce8a58503b1ae82f00084b4017f43891e260d273","lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a":"08b92bbca14b3caa2800a1c6cb8a422d987453fc79e03f6bba2be6f321955788","lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a":"02cd4b104d098858228c9da7d98223aebd6c7cfe79fe04dd92e95b1acac90170","lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a":"713e02a43329a4f7b1b89dcdb6b0978f70ee3f881c2e57b6f2089597afec02f3","lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a":"e0c00d82c9c8b644eb66728a31911c0b46aa9bbbeeaf76d1e52a634dc6420489","lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a":"7949eb398bea0952d589f520b863c16b905b1f7336564bce2c56fc7504660116","lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a":"563c511de536d18586425400a822d23237fb08641fb7cf162064a318f68ada9d","lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a":"d6f995485514312d425e618253d66c4e86577dab76338651be5e399b8f8319fa","lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a":"0dc02e652b522c1322a92bdc26969509e8abb4dc8afbb38ceb4b313fd7453691","lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a":"a519bd8308ca63cd953624bc125861be000013815936a6a493fd54e5ad7003de","lib/libwinapi_windowsapp-bcrypt.a":"ec1329fa5a61a3b6cd84a3073aaada7b8785a77f63ac11f1d360caa1ae202bff","lib/libwinapi_windowsapp-cabinet.a":"7e29bea56ad7adb0179764acaf5f6b4def59c165c7558d593f63fda86ba368aa","lib/libwinapi_windowsapp-chakra.a":"bde73d3211bb74985a77de624a0f2a69a3a9ef75301651149eaa186111b2b7be","lib/libwinapi_windowsapp-coremessaging.a":"d72d946e4944c83e35a863db105b6f11410d013a4bd773b3e843ad9d53c15e51","lib/libwinapi_windowsapp-crypt32.a":"9b9536ccfc119865a0bdfc0abbc5292aeab79167663ab3667dd9a91453ef6f62","lib/libwinapi_windowsapp-d2d1.a":"4e5448b5f5062deadca8f55eec73dafa579fc8a23d55848700b7056847291429","lib/libwinapi_windowsapp-d3d11.a":"b811cce64afcdb1a0423633d197eb4a03e15a7ebf91026652e7792c69cc1acaf","lib/libwinapi_windowsapp-d3d12.a":"091aaa8fab3b7de11a9af54152575825dc8fac430ae033f4d4723d04b0399e11","lib/libwinapi_windowsapp-d3dcompiler_47.a":"fd94740862b56f0cac0810a6a7e88d625f5760ddf722d782c3d0b538fd357b31","lib/libwinapi_windowsapp-deviceaccess.a":"782f1edafaf4f507b5d6fc225c43442bbbc1392090c225c36b812c78b4008dcd","lib/libwinapi_windowsapp-dhcpcsvc.a":"3f3236df207c9500f86e8983523dffb321dd8e2be5eb046c2af02b7072c59f66","lib/libwinapi_windowsapp-dhcpcsvc6.a":"84770cc3af6607f00cfcc2bc78d7d360d34b1d01dc8b263bbe41fe78b4399111","lib/libwinapi_windowsapp-dwrite.a":"594f8cca0f490d89792bee1d520cd1fc8869fa33f26fd6efc99c2a365f6dab08","lib/libwinapi_windowsapp-dxgi.a":"9c4917fb8ce4fab92b7e5e0ef279935525a5a17ed6954a49a53e4c6cdb61fd6a","lib/libwinapi_windowsapp-esent.a":"c837999f299f9f404032de4e5d5cd8ae21f821ee7c296098be6e0c1290cbc7f2","lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a":"e174067c0f98d3fe42821d200b6788071ce59a723336f5d351c7dc64073eec81","lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a":"f6ff8db9b176d291809a8de91313a284dbfbbd9392c25ff960983c442f43d658","lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a":"1ddd5c48bf3ff80947f67273494508f03e61867c2c9d7304554edb748515abe1","lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a":"8c218ad73c7cdd0494021fd5bc0b44e2482000b33fa25df544b9f6587c324c17","lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a":"32d41a927d75a74f71490ba8dd8740b3a9a3e76c0dbe2b5203dfef80f75f5c8e","lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a":"16acf3d5961624c5e4056ea513529ff0d8a6635b8f78b7aa102dfc6e6ad4e685","lib/libwinapi_windowsapp-hrtfapo.a":"f7eb622e5c5f03683f8dec62a38d1f4bd5b98df2a43b513ab052a04e14a050e0","lib/libwinapi_windowsapp-inkobjcore.a":"cccafb5cf43ee4a4613d05c638d7fd561548860b9a887fc76023ad628259f154","lib/libwinapi_windowsapp-iphlpapi.a":"bcc5cc9e14d4f47c573a00e4ab1031c13ce24cf68e865ffacf815f1535e3b6e6","lib/libwinapi_windowsapp-mf.a":"a7436da8e6d45c25a13f79b223543dfb073b82052e8abe588d26e92b97aa907e","lib/libwinapi_windowsapp-mfplat.a":"e00177157715c5759d1e35004a84983e3f3356305e64816a9edd066bb3b79b77","lib/libwinapi_windowsapp-mfreadwrite.a":"553ee451e5cfe200ac9b840fe35f234d1aff83ca48ab6f0318e7122bdb8cd957","lib/libwinapi_windowsapp-mfsensorgroup.a":"003bade21115ea520a913c452bc0af48a73ba60dbeea163d82f0127a992647a3","lib/libwinapi_windowsapp-mmdevapi.a":"b702a9ce7e2478d529d879afc7deb90ccb17b48029efddd28e0ecaa458648963","lib/libwinapi_windowsapp-msajapi.a":"81ff5804db8a0db27c57d56b1d238d7db0235dcc1193da621451684e8d94d89f","lib/libwinapi_windowsapp-mswsock.a":"74617292fa905a61eca74ada1440187607e5a0937a35e89290e7d8e1f64851f4","lib/libwinapi_windowsapp-ncrypt.a":"947d9d8dddd3cfcd9645be2f13204e7ef5629e78acba8f528899289c5b1a29a7","lib/libwinapi_windowsapp-ntdll.a":"035272f422deaabaedac61ce9c115ef21895b4eaeedaff7083195a84c01947c7","lib/libwinapi_windowsapp-oleaut32.a":"872e3c75ba251f3f78aa3dd7f392a0c33d285f6c995f6505944e75a4322f7a1b","lib/libwinapi_windowsapp-propsys.a":"3e95866b05f3b7fd53c2d49a4f53c0c2b702db430bce1a3fa8f88ed2f03f094f","lib/libwinapi_windowsapp-rometadata.a":"23d445f9a97153afda848b972af65633e02cfa35efa38c8872d1df88570ed6db","lib/libwinapi_windowsapp-rpcrt4.a":"6577a81b2b25becb9f90706779b716e0b6c2dfe6b1f6cadf7bd10542e46874a4","lib/libwinapi_windowsapp-sspicli.a":"f62ba19b2e0825f21a1fdf9cdaaf6bdda9dc40d0535f3fcb1228e325043156c4","lib/libwinapi_windowsapp-uiautomationcore.a":"542c44f951e5af5b0bcc6b2a6962d68eb8ed3c3cdfb09904b127a7638b1f9a0b","lib/libwinapi_windowsapp-urlmon.a":"de3d0611b244af770ab9e65857039151337d51119202b7483ed85ee84bb3dc78","lib/libwinapi_windowsapp-webservices.a":"ff53c0fb8d4e865aa2b37e689c84e0a6279f817a61289e0e6281c0a0684c2efd","lib/libwinapi_windowsapp-windows.data.pdf.a":"f9b822e9af43233a0a8be75d7b3d4cc6b2690fc292d68768e3ef61faaf9722c3","lib/libwinapi_windowsapp-windows.networking.a":"6aa6690420aaccb3a167cbb70ea8a6a76032872f22fe171934d57c39b3e0600f","lib/libwinapi_windowsapp-windowscodecs.a":"0e80cb4d48197baa7dc382662c8cf4162493605b67c1697ac89b2582ac995bc1","lib/libwinapi_windowsapp-ws2_32.a":"b3068fc789e498347385db2f729b73a0ccfb94170359e350d9169174b6a81c4a","lib/libwinapi_windowsapp-xaudio2_9.a":"ff8b1bfc160dc731a02537f2fce9c64cde48a7fae63232f9cc5c1d9c742f0fdc","lib/libwinapi_windowsapp-xmllite.a":"c99e2624f2c1039902293a13f83fbbafe69171e290b5116b113c1162892469d3","lib/libwinapi_windowsapp.a":"15a0928f6c65e96bddf217bc5fab9166d5bcf4ae7b1618e73ce5ae357f65a78d","lib/libwinapi_windowsapp_downlevel-advapi32.a":"d804e9388eb15e702e31b474c9e64ba16677965fdf5caba76de23a0fb624c026","lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a":"cebc37539a6264bc56267d7f246bf944a409d7290ae2335aeb47be08cd4691a8","lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a":"8c279b034b05b79e0cba7558b761075e46de1410553efaf276c8461a37705ee5","lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a":"d6e47b4dada0dd89213ddc74ee9543f3cdbe94f91740c05f5e8b8a8b6ac4275d","lib/libwinapi_windowsapp_downlevel-cabinet.a":"ea49a1a0c093425d6e0c322f20701f403a0e30cd2b9b4156fe09b548a7676c06","lib/libwinapi_windowsapp_downlevel-d2d1.a":"c9a1d9bbb75339aa8c5c65ab3ca4e34851b5e49745053434ebe8a526fdb1cf6e","lib/libwinapi_windowsapp_downlevel-d3d11.a":"edee3ff52dcef25cd1c2de9d94dbabd37935c3c6b5ec68d319752a99d44ca238","lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a":"07be895fb60a47c0630f70019181994c23fa703be133eb92970f3f8ebc268507","lib/libwinapi_windowsapp_downlevel-deviceaccess.a":"54f1efb0754195ef80008a74e3dc7b80ad6ba7e6408f9f5870826df93e10859d","lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a":"9bb795163a31c0c40fe4bb43c2a08a4bdafff513f0fc4d5370c21158e83519a1","lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a":"3146a9987752eff657fdd33e18e1cf8290ddb927253f06113991796c8fb6a330","lib/libwinapi_windowsapp_downlevel-dwrite.a":"75f782fc139938ff2c321a64e23796febba0bb06bc3476572108fd42e7ae7465","lib/libwinapi_windowsapp_downlevel-dxgi.a":"660dcabf3d62a3d17ef66c226363539a2ee816b40311da7424bcbf9f36c8086c","lib/libwinapi_windowsapp_downlevel-esent.a":"b2decb268c245ed92163af4fe6b78d3bbc68bc8b00a67af963fd62184c674e91","lib/libwinapi_windowsapp_downlevel-kernel32.a":"39c37ea812c53ed3fc5478286cc2b056af45d89f21ca381154126350ca347350","lib/libwinapi_windowsapp_downlevel-mf.a":"e342dd811d7aa4284e29af405382ba79d38a40b3a68422bd4855ec8d1cd90b85","lib/libwinapi_windowsapp_downlevel-mfplat.a":"4229ff3fc4ea43992bd43cf62134571d29abc3cbde12f123ea5ff3109b543084","lib/libwinapi_windowsapp_downlevel-mfreadwrite.a":"ec48614cfcf6cdc3b176d3b5503bff913b5a484f028081ec37c4a10e3b9b52e1","lib/libwinapi_windowsapp_downlevel-mmdevapi.a":"3efa1a3536fe519e8e0956f1e388f592359304dc552a71b4d8b76a22f19585c4","lib/libwinapi_windowsapp_downlevel-msajapi.a":"f6abb91151be743fbe8df9aa317f1901bf64bc1784737b1d627222690daa91fe","lib/libwinapi_windowsapp_downlevel-mscoree.a":"cb5aedee76fe7c835dfba5b3b8a177f6d9a8babbba35a68151d27cd38ec88ab0","lib/libwinapi_windowsapp_downlevel-mswsock.a":"2969f7e7ba5ee53df84f0f55197662ba3be0e469d03d41fe7fb27df743b8fb6f","lib/libwinapi_windowsapp_downlevel-ole32.a":"0e4a0fe7f48178d172f2d65ebf65dadb81c5c6374ea636f57312ac1a25e7fecb","lib/libwinapi_windowsapp_downlevel-oleaut32.a":"df90f481709e792326553f4f0dd9cf5bef8819a7b83cfcaaa0159e94a15a39e0","lib/libwinapi_windowsapp_downlevel-propsys.a":"548af9a83ee1edd4d5e31eac1b73f80360372457f5e7d7ecda76f0ed00828eb6","lib/libwinapi_windowsapp_downlevel-rpcrt4.a":"50ed6864d1407224c0d24fa18704b4a5a0da7a290f7cd43774bc0f9a9b4339b3","lib/libwinapi_windowsapp_downlevel-uiautomationcore.a":"e8a14b5378ce7033982cf5492ed6f533f59cc6831958b24f09ad6cc5331774cb","lib/libwinapi_windowsapp_downlevel-urlmon.a":"ec850a21e8f13934a8aa241558c446bf066f84fe3dd9244af65dc16b8d98a876","lib/libwinapi_windowsapp_downlevel-webservices.a":"59034d8d9f7a7d84470af85a1ff8be61f7bcb8dbb9bb71c8216dc27adbdc1f3d","lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a":"db3815d61dde72d54181491438f985c6bfc798daf94fc2c52b6dcacad753a000","lib/libwinapi_windowsapp_downlevel-windows.networking.a":"c2729b8d6f689c7c5e5837692b94c29e9686e10b28c313af92dd4ee5e2d93ade","lib/libwinapi_windowsapp_downlevel-windowscodecs.a":"7ff7bc125c1bf161d75266274063fe1284f1dbe206cc3e77af9c563f293ea16a","lib/libwinapi_windowsapp_downlevel-ws2_32.a":"c45dab0dd9b2b7a93f727e510e16f63bb1f917b7e20030e6a25c43dae6190aad","lib/libwinapi_windowsapp_downlevel-xaudio2_8.a":"01fa2a11e747d8b54ff562ce005d2ea0600cca6a8bd4769a3f5d0201e8766b08","lib/libwinapi_windowsapp_downlevel-xinput1_4.a":"716a44b40028af673877f3cd3af9a172c2c294c5b0037d2416a577f8d9f0baf4","lib/libwinapi_windowsapp_downlevel-xmllite.a":"af8ad4904f954f829e79b67743d9b412b9aeb34432ec6148bff6bddea254bd0f","lib/libwinapi_windowsapp_downlevel.a":"fd622c0c778e135e02d0e387ad4075c68aa1f564de4c39a2677d87478ab0496e","lib/libwinapi_windowscodecs.a":"2b3a50daec478e8d6c5586d131c3da93b667ab98a3d1874d157887aab05a869b","lib/libwinapi_winfax.a":"009b2d2f2bfa7620b515504c8b9551eca3b4a58d118c59555db0891306c51669","lib/libwinapi_winhttp.a":"0572b9da9ee2740f4074d58030acd3c0235f0087a3ad3da138d22184d361e29f","lib/libwinapi_wininet.a":"c23ef20a00fdfb68052715a00bf17a368eef28359a2f3fccda73d4aae0c7d9f3","lib/libwinapi_winmm.a":"ea571535c90557ca7b9331f70aa04271a77b0f38e85929da604a1472e9ae45be","lib/libwinapi_winscard.a":"07996dd9c98ae95fbb9797a87fbba1b1435c9e148e1401d482ccab08dea91824","lib/libwinapi_winspool.a":"f92b3b0a67b4c598e6cc583e9c9aefd1ed473b3202bdfaec606300a20a58d746","lib/libwinapi_winsqlite3.a":"63e42c08e791103952b60e72b634a43213dfe07f87d4e09f93a1a73c7053e45a","lib/libwinapi_winsta.a":"ac53400d8e9dedc1039a04734048d0260f93bc23b102cf6ab76aef81b2c71a2a","lib/libwinapi_wintrust.a":"2f0db077618eaddc9889ccff5cebe02f61914d689a613852e5c043bd7890df65","lib/libwinapi_winusb.a":"3115eb3c732d9bedec71dc257526f3c6a694c5844f8a5cd4c035b887aaf837ec","lib/libwinapi_wlanapi.a":"ace6c67a6e9b8cda60a4a9fd002191affc37ce729d69bce3a2f7e2ea145219e4","lib/libwinapi_wlanui.a":"a132997ec3188c2faeb13e21a9de81c663830c1d42902817a2c8471360dc031e","lib/libwinapi_wldap32.a":"828be18ed9d8e50d4bdab88630ba0e897914955639b9b45c785408fd3ed6d5c5","lib/libwinapi_wmip.a":"b48306f4382ec01e198eeffa8f9dc29475548838c1b3ac0fb9913c17c5125325","lib/libwinapi_wmvcore.a":"4f7ca2d39f4d3350ffaebd1f5967fa60f32b596cc232284c48de9ed10a033d30","lib/libwinapi_wnvapi.a":"1ebab5c51f70165c898a44801c6aca50e23c81ceaab77a691d14211344de8b69","lib/libwinapi_wofutil.a":"cd804de66b5dfaea2f78175c341e0498799256d20e91a14333fd81deb697115e","lib/libwinapi_ws2_32.a":"eb8c67a0fd619b75d4a097da6c535e36092dc31833da11976f4ea9737736c27c","lib/libwinapi_wscapi.a":"59237ea2addf8ae27350a3a26b56f2d2e1b88ec696f860671f6a9a54df7307b9","lib/libwinapi_wsclient.a":"dfc4151c51d6ac1b2f6f1c6c9ac4ab616109e84670a9dd35fedd0174211d97c2","lib/libwinapi_wsdapi.a":"7deeb90e59f8f8b769ccf07d180a4fa8566b41590e3826199ab7cec1a841cf75","lib/libwinapi_wsmsvc.a":"4eaa3ee281f0112883577efcf46f07592e4b2902e8373447d84c349bda041fda","lib/libwinapi_wsnmp32.a":"0388baf7ca8c080b56f8278069231d88c39bf205833c8f9dbbbd7d20a8974a5e","lib/libwinapi_wsock32.a":"933e7c6f7958ce14f8916fbc4076ebb7a962576e54eb14679a866044e018455d","lib/libwinapi_wtsapi32.a":"1d1f30f69eeaa5ee0f16b247766a14e37379a563554a3aafc2c75a5c916c9327","lib/libwinapi_xaudio2.a":"a93fd7427990945f365a570e5063cfc37cf168319a191c9cced99fd4ac7412c8","lib/libwinapi_xaudio2_8.a":"d81aa8d4571feb7d88662232611a35327d6e794762d86c88ab3bfc00fc1380b2","lib/libwinapi_xinput.a":"60c83153e2a71755e4f1d23871502a0bb63581e5d50f7bace76c72d1097a6080","lib/libwinapi_xinput9_1_0.a":"48419ab7aee0fdacf664322a6c4c4d194dbf27a47395acf6df6711ed9305af6f","lib/libwinapi_xinputuap.a":"a240c14282237577ecedb7e90fffdc990784299690ed0e2d47609a54991b0331","lib/libwinapi_xmllite.a":"74b5c91747bcc207f29b48f55e4592b6d87507cccc769b821568995712ccab19","lib/libwinapi_xolehlp.a":"43d442e8dddca465980518f23769550e2e57f942e97a0bbafb570466de0fb66c","lib/libwinapi_xpsdocumenttargetprint.a":"72ccc29f8c73be0c982ae0107654281cbe304b7e4e494a9dc73589f6cb61c615","lib/libwinapi_xpsprint.a":"15ce739546fda5e2ded348552001a3afe31458aa4d3debe88a7856cc525eb286","src/lib.rs":"79212a91f610f8a77aa6ed4cc77212c2531eeb35630388bf07323cc328fcca42"},"package":"712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"} \ No newline at end of file diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/Cargo.toml b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..7e1341b081913ca51af07605e25797069ba77753 --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/Cargo.toml @@ -0,0 +1,22 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g. crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +authors = ["Peter Atashian "] +build = "build.rs" +include = ["src/*", "lib/*", "Cargo.toml", "build.rs"] +description = "Import libraries for the x86_64-pc-windows-gnu target. Please don't use this crate directly, depend on winapi instead." +keywords = ["windows"] +license = "MIT/Apache-2.0" +repository = "https://github.com/retep998/winapi-rs" diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/build.rs b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/build.rs new file mode 100644 index 0000000000000000000000000000000000000000..a655b7c9e0797586874273c7c96c64e90f0c331a --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/build.rs @@ -0,0 +1,18 @@ +// Copyright © 2016-2018 winapi-rs developers +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +fn main() { + use std::env::var; + use std::path::Path; + println!("cargo:rerun-if-env-changed=WINAPI_NO_BUNDLED_LIBRARIES"); + if var("WINAPI_NO_BUNDLED_LIBRARIES").is_ok() { + return; + } + if var("TARGET").map(|target| target == "x86_64-pc-windows-gnu").unwrap_or(false) { + let dir = var("CARGO_MANIFEST_DIR").unwrap(); + println!("cargo:rustc-link-search=native={}", Path::new(&dir).join("lib").display()); + } +} diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_aclui.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_aclui.a new file mode 100644 index 0000000000000000000000000000000000000000..9b5c0173acd5d5589db62ac18dd76583de4cfccd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_aclui.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_activeds.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_activeds.a new file mode 100644 index 0000000000000000000000000000000000000000..aec05b5112104048ed72091c422c949fde6337ed Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_activeds.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..ef376d2d5b4ffc15bd8641adfd2e8cb2aaedb257 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advpack.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advpack.a new file mode 100644 index 0000000000000000000000000000000000000000..9296b800b7a2a3b6bf6f49b28de949b4034f1632 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advpack.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_amsi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_amsi.a new file mode 100644 index 0000000000000000000000000000000000000000..6311be601b31d0f6f0ee08d8f66bcac9e6c6c877 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_amsi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f5fc53fcf13e3c522500b2d3c51f03ba6f33abfa Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appmgmts.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appmgmts.a new file mode 100644 index 0000000000000000000000000000000000000000..6af015f7001bc8e004857bb090573131a13a16d6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appmgmts.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appnotify.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appnotify.a new file mode 100644 index 0000000000000000000000000000000000000000..9a78ee410d23eab3a08f5661596746b2c445f917 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appnotify.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_audioeng.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_audioeng.a new file mode 100644 index 0000000000000000000000000000000000000000..f1e748948d689bff0760d30cf7ee7725526033f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_audioeng.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_authz.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_authz.a new file mode 100644 index 0000000000000000000000000000000000000000..1b810a4c8ffccbed1b41695bcedf93cbb770a34d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_authz.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avifil32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avifil32.a new file mode 100644 index 0000000000000000000000000000000000000000..7b52eea5e10a795c6c399f37935ab70988941ab5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avifil32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avrt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avrt.a new file mode 100644 index 0000000000000000000000000000000000000000..70b6218f2b49c301251420bb0b66de0a4c42c73a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avrt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_basesrv.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_basesrv.a new file mode 100644 index 0000000000000000000000000000000000000000..2f811091b4a154c40ad28b6ac77760d7c9f0f7c6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_basesrv.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bcrypt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bcrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..a27364dc79617c6575a3631457cb36ac59ae6226 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bcrypt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bluetoothapis.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bluetoothapis.a new file mode 100644 index 0000000000000000000000000000000000000000..b5f9f37acfbfae7934a4e86d7b8d334b17855fef Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bluetoothapis.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bthprops.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bthprops.a new file mode 100644 index 0000000000000000000000000000000000000000..948b32cc2c20203c13d250e014152e66f50c45f5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bthprops.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cabinet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..cbea8a25b7083489b609607c41bf392ae732b4c8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cabinet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certadm.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certadm.a new file mode 100644 index 0000000000000000000000000000000000000000..ec28d7ca5c65c687dfbbda41d22cc7e274e309d7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certadm.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certpoleng.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certpoleng.a new file mode 100644 index 0000000000000000000000000000000000000000..042dce5bfa527e5479ab2f241bfb7cd12fb569ab Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certpoleng.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cfgmgr32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cfgmgr32.a new file mode 100644 index 0000000000000000000000000000000000000000..a32bb200300d93680adb259163f119eccc218603 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cfgmgr32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_chakrart.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_chakrart.a new file mode 100644 index 0000000000000000000000000000000000000000..6102ad9da65c9bd38502affd3236aabfbd3739a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_chakrart.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cldapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cldapi.a new file mode 100644 index 0000000000000000000000000000000000000000..e82b0651e4f1315efb5c725f00f24f82b71ba265 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cldapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clfsw32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clfsw32.a new file mode 100644 index 0000000000000000000000000000000000000000..0d2fb6f5cdc93bf659e8cabc03bb30c112758ab7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clfsw32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clusapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clusapi.a new file mode 100644 index 0000000000000000000000000000000000000000..feedc402844c420e6334db7c5ee56d4de2c17618 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clusapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comctl32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comctl32.a new file mode 100644 index 0000000000000000000000000000000000000000..cfc918a39dcf426a56c3cae4eafd9739c4a2786b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comctl32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comdlg32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comdlg32.a new file mode 100644 index 0000000000000000000000000000000000000000..f7f87b6effd9ba978bd71ef3a985dacba973d589 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comdlg32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comppkgsup.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comppkgsup.a new file mode 100644 index 0000000000000000000000000000000000000000..9835482196bac31c37b7b8f822ab50b32081417c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comppkgsup.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_compstui.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_compstui.a new file mode 100644 index 0000000000000000000000000000000000000000..fd7b71886441cc1a87568ce18fbc5afbab8e7401 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_compstui.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comsvcs.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comsvcs.a new file mode 100644 index 0000000000000000000000000000000000000000..cf09bc49d4318b4b8044b6c534893f4ec85129a1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comsvcs.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_coremessaging.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_coremessaging.a new file mode 100644 index 0000000000000000000000000000000000000000..7ff290d0cadcf7ae0419009397070068a0630371 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_coremessaging.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_credui.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_credui.a new file mode 100644 index 0000000000000000000000000000000000000000..e0eb5967ef318d72f9a834c433ba368b2c4dbc8b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_credui.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_crypt32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_crypt32.a new file mode 100644 index 0000000000000000000000000000000000000000..85a898c2e865acffa2384476f277ae52fa679fb5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_crypt32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptdll.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptdll.a new file mode 100644 index 0000000000000000000000000000000000000000..7073c94b330158e9db817ddf80dd2ad5be560e40 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptdll.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptnet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptnet.a new file mode 100644 index 0000000000000000000000000000000000000000..79322ae284d8780c9d7fd59f9a9c1b4423c72ea5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptnet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptui.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptui.a new file mode 100644 index 0000000000000000000000000000000000000000..6d508374e5528d9dd8f664b185959c24700e5541 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptui.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptxml.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptxml.a new file mode 100644 index 0000000000000000000000000000000000000000..d94b99a80f1c0e0a6ea3567ba99820c59650f060 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptxml.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscapi.a new file mode 100644 index 0000000000000000000000000000000000000000..0bb61ac7d81399feb874c5adb25222e996d2bcfc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscdll.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscdll.a new file mode 100644 index 0000000000000000000000000000000000000000..9cb80ea64c0bbad643cfa42f01c835af5edd46fd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscdll.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d2d1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d2d1.a new file mode 100644 index 0000000000000000000000000000000000000000..fb4876377719bb77363203c75d1bc3c7419827a7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d2d1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10.a new file mode 100644 index 0000000000000000000000000000000000000000..5d2982a041d881a0c947b25fea780e176c91a0b1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10_1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10_1.a new file mode 100644 index 0000000000000000000000000000000000000000..f23896dfbfecbd2494b2160017146b8f04d467d5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10_1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d11.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d11.a new file mode 100644 index 0000000000000000000000000000000000000000..07bdcf7b72d1e1e279319aa4e2141428fdeec833 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d11.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d12.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d12.a new file mode 100644 index 0000000000000000000000000000000000000000..d77ff38dfbd93dc0b5d75ba8c09e41e942b5f7a3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d12.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d9.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d9.a new file mode 100644 index 0000000000000000000000000000000000000000..76a789fe41adc9f58a14a7ccb02d6e7e75b28141 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d9.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcompiler.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcompiler.a new file mode 100644 index 0000000000000000000000000000000000000000..7202ff53be7f05efc54f253e48b2ded6caa24929 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcompiler.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsx.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsx.a new file mode 100644 index 0000000000000000000000000000000000000000..5632c6a5fda044075ec6f2e9c923cbd2327415a8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsx.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsxd.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsxd.a new file mode 100644 index 0000000000000000000000000000000000000000..2f687f88ae17211d4cf4ba96f9ccd6d491563e64 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsxd.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_davclnt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_davclnt.a new file mode 100644 index 0000000000000000000000000000000000000000..5fbc21695fb239b774308c5702839ae501151911 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_davclnt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbgeng.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbgeng.a new file mode 100644 index 0000000000000000000000000000000000000000..e32cf057ae8fc0bfcccfe0f21413cada822f3083 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbgeng.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbghelp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbghelp.a new file mode 100644 index 0000000000000000000000000000000000000000..68af1dfa6a1659e819cd94a6041e57bdc38c92a3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbghelp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dciman32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dciman32.a new file mode 100644 index 0000000000000000000000000000000000000000..e73db18bdf07b03b6d23a4c6b2b690a342e1a2f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dciman32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dcomp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dcomp.a new file mode 100644 index 0000000000000000000000000000000000000000..beeeef276d91cf5f63773291c81362ec0e404108 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dcomp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ddraw.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ddraw.a new file mode 100644 index 0000000000000000000000000000000000000000..0ef6fe93c6b063ea1501f45130530593cd378d7a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ddraw.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_deviceaccess.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_deviceaccess.a new file mode 100644 index 0000000000000000000000000000000000000000..8b46a2f122d0ccc4719173bd76388510399411bb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_deviceaccess.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_devmgr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_devmgr.a new file mode 100644 index 0000000000000000000000000000000000000000..d7eac596229a0f8e53c24a97c44018060509f6b5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_devmgr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dflayout.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dflayout.a new file mode 100644 index 0000000000000000000000000000000000000000..0725743b530a53642321ba45503b401dea0f0cbd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dflayout.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..28d840c1c5f4fdbc8bb762cab9ff0caae31c2b3c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a new file mode 100644 index 0000000000000000000000000000000000000000..32d2a6d64f086022af18d358df77157ebaac901b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpsapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..39cda252053b6a1cac54527935ef0e0099301cf3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpsapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_difxapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_difxapi.a new file mode 100644 index 0000000000000000000000000000000000000000..14af019ce1b5c9b031c730bcd294ce67da411251 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_difxapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dinput8.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dinput8.a new file mode 100644 index 0000000000000000000000000000000000000000..7107b8f504f17e6a67f8d0fe71ef86f5045120d2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dinput8.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a new file mode 100644 index 0000000000000000000000000000000000000000..44850a831a42fb0ec8933848f4a88b3f6aff38df Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..4c84067a4cc4b495192bcc0fe2ce66eb571b005a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsperf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsperf.a new file mode 100644 index 0000000000000000000000000000000000000000..8ee91a67d6718ff31ae8c0f0fb7a1d5c6a985fa5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsperf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsrslvr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsrslvr.a new file mode 100644 index 0000000000000000000000000000000000000000..2b484ea7cbe4ae292bceb1be0a7583fc80671916 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsrslvr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dpx.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dpx.a new file mode 100644 index 0000000000000000000000000000000000000000..afa99f26b22caecaa0dde094064cd659145309b1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dpx.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drt.a new file mode 100644 index 0000000000000000000000000000000000000000..aba232d52290b6e47c4b45589b51561a1fe1a032 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drtprov.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drtprov.a new file mode 100644 index 0000000000000000000000000000000000000000..4748b2d88cf10ee26048cb59189e454327039151 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drtprov.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drttransport.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drttransport.a new file mode 100644 index 0000000000000000000000000000000000000000..7f0175f8e0bfca0b7b072e178e3ae3dfa0a1007b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drttransport.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsound.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsound.a new file mode 100644 index 0000000000000000000000000000000000000000..8954c2adf2dede34f6a56b666242322c67adc201 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsound.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsprop.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsprop.a new file mode 100644 index 0000000000000000000000000000000000000000..9a921eb9f9c8ee4f64a7f863512e639aaebacf34 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsprop.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dssec.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dssec.a new file mode 100644 index 0000000000000000000000000000000000000000..8cf29e97721dc9bcde4ace8d0da50d003c8d6fca Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dssec.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dststlog.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dststlog.a new file mode 100644 index 0000000000000000000000000000000000000000..a1ba612d74b57698bda372a3667166fd6d4bd363 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dststlog.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsuiext.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsuiext.a new file mode 100644 index 0000000000000000000000000000000000000000..f574c83c28885e60e59f0ecf3f507ba13fe3ec69 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsuiext.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwmapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwmapi.a new file mode 100644 index 0000000000000000000000000000000000000000..244f217bea860343296516beef542dcab251c976 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwmapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwrite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..58d885edba1e097c6236a77b501d95334ee34fcb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwrite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxgi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxgi.a new file mode 100644 index 0000000000000000000000000000000000000000..3816b811937bd85fb95c8568842bdedc08ed95db Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxgi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxva2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxva2.a new file mode 100644 index 0000000000000000000000000000000000000000..30f262bb8f4393724a1ea83c590307f5bdf56978 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxva2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappcfg.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappcfg.a new file mode 100644 index 0000000000000000000000000000000000000000..7fbba3aae05e0dd7eb9f9f0f4a788765bf4178cb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappcfg.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappprxy.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappprxy.a new file mode 100644 index 0000000000000000000000000000000000000000..5f46d3d04d9e03bff41f7add90be8d94f90d51a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappprxy.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_easregprov.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_easregprov.a new file mode 100644 index 0000000000000000000000000000000000000000..4a5711f9d44eae96681d92b0077274948b82d4de Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_easregprov.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_efswrt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_efswrt.a new file mode 100644 index 0000000000000000000000000000000000000000..4d6b046251688e7cf453db9de6434d5c41d6e603 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_efswrt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_elscore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_elscore.a new file mode 100644 index 0000000000000000000000000000000000000000..883a09f85b101cf4a11efc23c6e04668bbec0edd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_elscore.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_esent.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_esent.a new file mode 100644 index 0000000000000000000000000000000000000000..2167897faa3e6e114be7a837310001099f361024 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_esent.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_evr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_evr.a new file mode 100644 index 0000000000000000000000000000000000000000..4c81d178907e2b8048dcb3eb88f6537bddcd9f01 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_evr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_faultrep.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_faultrep.a new file mode 100644 index 0000000000000000000000000000000000000000..f57e082e8798c06c68d95a67ae06c8089bd636ab Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_faultrep.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_feclient.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_feclient.a new file mode 100644 index 0000000000000000000000000000000000000000..a8893cec6c1d3bd1d05f6c3c3804a52a527acd11 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_feclient.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fhsvcctl.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fhsvcctl.a new file mode 100644 index 0000000000000000000000000000000000000000..56caa245b7a8d01c7c70755c4df7e25354714ecb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fhsvcctl.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fltlib.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fltlib.a new file mode 100644 index 0000000000000000000000000000000000000000..11b8dbb473bf87d624742be3ca364efe19cedcce Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fltlib.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fontsub.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fontsub.a new file mode 100644 index 0000000000000000000000000000000000000000..7fd6358cc610e792262562447504200e003d7c7a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fontsub.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyd.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyd.a new file mode 100644 index 0000000000000000000000000000000000000000..24dc14b705ebedc849d644ed17e7045d8e6955fb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyd.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyn.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyn.a new file mode 100644 index 0000000000000000000000000000000000000000..45576b38e47e7d551df4db0f50bbff26fd199d04 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyn.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fwpuclnt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fwpuclnt.a new file mode 100644 index 0000000000000000000000000000000000000000..66e8bc280e672d9c4a8584d5d98c8d25113a4f27 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fwpuclnt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fxsutility.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fxsutility.a new file mode 100644 index 0000000000000000000000000000000000000000..6d0559b9195ddd9b3a9fb7b03e70038933d23083 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fxsutility.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdi32.a new file mode 100644 index 0000000000000000000000000000000000000000..219b37dbc03188dc79997dbd597e41bf1f389093 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdiplus.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdiplus.a new file mode 100644 index 0000000000000000000000000000000000000000..6210e26e850514461a95e995a3f05c45ce4f00dd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdiplus.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glmf32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glmf32.a new file mode 100644 index 0000000000000000000000000000000000000000..8798334aaa643f92bcf30cf03261efd6ab4ea35f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glmf32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glu32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glu32.a new file mode 100644 index 0000000000000000000000000000000000000000..3853089acd5e73863e693512693f99aba6a37daf Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glu32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gpedit.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gpedit.a new file mode 100644 index 0000000000000000000000000000000000000000..eb249e3443449ba612af66661f80701fe1ab9e6e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gpedit.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hbaapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hbaapi.a new file mode 100644 index 0000000000000000000000000000000000000000..5677beaf15fd33b1981a1d278cd5e2544b030f4f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hbaapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hid.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hid.a new file mode 100644 index 0000000000000000000000000000000000000000..3c741a1f526c785dbaca20a1d604e67d5bc28cc6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hid.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hlink.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hlink.a new file mode 100644 index 0000000000000000000000000000000000000000..e5b21ff65acb8c00fb82c945edca6ca6fba4de4e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hlink.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hrtfapo.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hrtfapo.a new file mode 100644 index 0000000000000000000000000000000000000000..d8eb49b0584a97426e4d23fc69843467f5299eee Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hrtfapo.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_httpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_httpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..63e0d0eccd983ad8ffbb34c07dc1e5f7bb6a1e41 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_httpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iashlpr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iashlpr.a new file mode 100644 index 0000000000000000000000000000000000000000..1500ab018bbca58c2fdadaa79c6ead3c5678196d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iashlpr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icm32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icm32.a new file mode 100644 index 0000000000000000000000000000000000000000..68363f9b0db369a43e5e05cd109044950b1e078e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icm32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icmui.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icmui.a new file mode 100644 index 0000000000000000000000000000000000000000..5088584c8a46df9f2e646c29018941850afce836 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icmui.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuin.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuin.a new file mode 100644 index 0000000000000000000000000000000000000000..b80e877f9502584e7514513a80b0c5b3d9fc930c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuin.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuuc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuuc.a new file mode 100644 index 0000000000000000000000000000000000000000..095530465ced7a29d87ec5e077023d67470cf1a7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuuc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imagehlp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imagehlp.a new file mode 100644 index 0000000000000000000000000000000000000000..1f9bbc4edf13554da320e34ba7954a0d05d2b8b3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imagehlp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imgutil.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imgutil.a new file mode 100644 index 0000000000000000000000000000000000000000..e150dfdb13357c3303da1e76f72401ded2297d08 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imgutil.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imm32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imm32.a new file mode 100644 index 0000000000000000000000000000000000000000..aa94bb38749e0f84cd2d34f4b7e7047ee0ce550c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imm32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_infocardapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_infocardapi.a new file mode 100644 index 0000000000000000000000000000000000000000..4d10d47425aa3bce5dfbd0cb6863fd8f103fb184 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_infocardapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inkobjcore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inkobjcore.a new file mode 100644 index 0000000000000000000000000000000000000000..efa3184d1cbfcaddfd9fa99b40a922936c38e579 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inkobjcore.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inseng.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inseng.a new file mode 100644 index 0000000000000000000000000000000000000000..e537a534aca3afad230ed2067c141323cc4b6e80 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inseng.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iphlpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iphlpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..9eb2b30d0291e18502569ac9d703b9640389684d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iphlpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iprop.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iprop.a new file mode 100644 index 0000000000000000000000000000000000000000..b8f9a99e8631094c1427b25a0ff5aff56cbaebbc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iprop.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_irprops.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_irprops.a new file mode 100644 index 0000000000000000000000000000000000000000..afb2defed29d0b0fc808af799068face7344b67d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_irprops.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iscsidsc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iscsidsc.a new file mode 100644 index 0000000000000000000000000000000000000000..6338c772fef11583356462a5ee60f53bbe779099 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iscsidsc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_jsrt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_jsrt.a new file mode 100644 index 0000000000000000000000000000000000000000..0ab246cbda6ac32f2d080d5be9d72960cfd354d5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_jsrt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_kernel32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_kernel32.a new file mode 100644 index 0000000000000000000000000000000000000000..daa363d559e076fe9864b9f921296290e1c3a8d2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_kernel32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksproxy.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksproxy.a new file mode 100644 index 0000000000000000000000000000000000000000..8100ca91c762f6b8a629babc5cc2e7607eaae5f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksproxy.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksuser.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksuser.a new file mode 100644 index 0000000000000000000000000000000000000000..dd661f68fbc3292ea7f60031e69d0a1b85045b95 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksuser.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ktmw32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ktmw32.a new file mode 100644 index 0000000000000000000000000000000000000000..c661f4f335330c0b2864046ab344e6410b628f66 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ktmw32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_loadperf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_loadperf.a new file mode 100644 index 0000000000000000000000000000000000000000..8a53f99acdda77d9488b3a12e77a52550a0a0feb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_loadperf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_lz32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_lz32.a new file mode 100644 index 0000000000000000000000000000000000000000..b480294261eb838cdc3836687a506a0bea6a5c37 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_lz32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_magnification.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_magnification.a new file mode 100644 index 0000000000000000000000000000000000000000..5c3940708a4dff25c1ca19b6c582819b2058e294 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_magnification.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..684e4d20bfcd6bc3b0961fb1007ab434da9beafc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mciole32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mciole32.a new file mode 100644 index 0000000000000000000000000000000000000000..37dabbe164d0be74c239713b4376025a51e40b7a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mciole32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a new file mode 100644 index 0000000000000000000000000000000000000000..2c32aa8812cadcde9d840899f96998bbc317c140 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmregistration.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmregistration.a new file mode 100644 index 0000000000000000000000000000000000000000..1b0714811cb5fde9678399c3bca32d28ac3bd832 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmregistration.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mf.a new file mode 100644 index 0000000000000000000000000000000000000000..3dba8641315859a77a9494c3a46f20d14e81383e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfcore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfcore.a new file mode 100644 index 0000000000000000000000000000000000000000..a74394b12b55d637747657be9b34a8d53bd4bc06 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfcore.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplat.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplat.a new file mode 100644 index 0000000000000000000000000000000000000000..66ecb3c0ac73879cef55ae914824043fd14d3a67 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplat.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplay.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplay.a new file mode 100644 index 0000000000000000000000000000000000000000..948ad9cbabc5ce9d43f9e178e8091f5fba78a5d9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplay.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfreadwrite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfreadwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..3e1222d0517d56a2090635b3342a91faea2bef2c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfreadwrite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a new file mode 100644 index 0000000000000000000000000000000000000000..92bf2ed4a1507904b01ef90b7389c69054d5674c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a new file mode 100644 index 0000000000000000000000000000000000000000..19172ea067e3fb2e171530f793ae9c07b2802627 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mgmtapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mgmtapi.a new file mode 100644 index 0000000000000000000000000000000000000000..a6bc0fa92667a282f756a53cb35a5329a6c15242 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mgmtapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mi.a new file mode 100644 index 0000000000000000000000000000000000000000..53c14c3b65680b9a4e50a07387359c38e0c6d69e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ff29df6b45b606b022c9d2527446b8177d7fd2bb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..fa66286f87b9325913c342111bf73df050adf770 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..1bf4b64512b91c0bb21da1fb8ac7d5c427ea0699 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..58f6877e9a607532b238584e0b6e7f5ca2595858 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8e03f00fe2ad9490524850957a3709f0f81289be Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..942ee910a0d35965a6b06ec4bb57af231b6c9dfd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..53db5fc1653994f3aa9062652c74f1185e2abf65 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6ee38d90262a945431bc57df492875c09cb09415 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e322d603637d73d982774c9d4ab996a08dbb5495 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1d82ba3e072f22ab3f0f054dfba9c21dae81aa71 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..db27f3cb410dbdcc36c7bdbf3c4c5a2c9b5198ee Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0b3c0f81bc6bcb9a28d22e79a1f4079483e7a291 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4af2e6a03de20e3e2774c1fff569e68d5f2c8113 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..2787d98611dc6d45ea60dbc942e772678be49818 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2db9431421936aea8c3069fb9f279afc78e008b9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..cce97dad6e115117f27b5b1a066304ed2255bee3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2baa86b2924e9cd8089abc3fb6282aec48141e03 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e4b19a2b2acb9b5a7c027386410f108c1aa3b180 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..edc77198af3c4f3cc66fe44a8d75229ce5dc3824 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..1ed424bee070f7eb651d21b90a41f37654eee6f4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4c8539bf9e85e218b662f4288607a85f3b888680 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..a70dd0a179b056c99cbefbf24be8d8366b8ee31a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..88899bb5e4ddf398f7fc434152ff92430ca9a20a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..42c47ed1c87b5649ae02d1d9b6967bc7e8e8bfbd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..70465e32564669d05aeadad7fa42a9619962d314 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..6db054b2feb48d6b28cfd3cd6aadb79b6bff07e8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9bae7605512b321a0fd5363866e1f358e4478e95 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2c1477dc250121e5e565fa34ba828b1dd5340239 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3669aea3fb1e001cf6e18f26133b6ea039fa4f90 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..2f010487ed403bd58620e7b829ccb3fe694a4e0f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5e82569d81a00d1b6647d2e0f3737557490e794c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..38deb42a9024f77b43e6878236813cbba9b7cd6a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7933e694f9d4cee1731edf88a1fb3bc383f92373 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..99dd8b17b2eb5fd078f8584728e547de252d6128 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..98cae3e316186e1d5d892f5c866c7d08d0ec063a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7812f4f01d0cb459c2939d72ef51926efd8f21b8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8493346e5b4874bae7fe00cd2a1457b7fe0063cd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..d9e0459569412cdcc16095c707569fe232afb959 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ab252344b9522b9ecf85c5eff0c0944bcfe3f6a8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..68fe5a8b1c074de3bfe08aedd42e6904a3b29658 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..576cd02360298884ee9c18006e6e38d6293b0065 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..e19671209db7575aacdb4bbfb5465b00e1d575cb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8dfc823013a9d3371d1ac3ca068fb4b5f1b1526b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0f50d4fe12683b67079542063013e4617eb2152e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..abbba99f57e08adc6146691c18a245912d32228d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..c4e4b03a4da65516d7b5bea8d5e4a4e4f2089d3b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..144278b21fc9226697546b2c2fd8246e0da33e20 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..06d3dc060032960b3c4d21485278f20405d1b93d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8638ee6683958f24117504f412bb5d32d30d0245 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3ac8927bb4a9bfc6759711eb423d839e3e7cc7a5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..f98e53b086ac2dd79b786b357560a8374c6e2060 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..aa2709da363865bfdf7b2849676616c5ab1c6a69 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 0000000000000000000000000000000000000000..c2b513d96668c4bc0a0b32579e214e816bff890a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..28ad4178eab8e3cb053a632d582190f49b1ef5b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..a142db391ec0515a705d6fd9bfc855ebeb9eb3c8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..e642b55bd084257ae53cd7e61451fa310ed6a20f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..35ddf2f5a14fc13d61b113401e7aa3d7cc770655 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6672ce64fd30416df934e2cb3306b290dc3f1f67 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4ec4511ed4e2c37b157b2b4d70fb18dd4319aeb3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b19f1c5c5e427f2cd9e9c00ee39e1e414c26bc9e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..da758877f6a60c35c9d9e165ed074897f2f071df Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..62c713df0df5075c3c96e77d6e39524bf21f8192 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..08ae7e9bd10b15fd3092a0506ffb24721f4028ef Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..e307074c9de39843e37217f5d479074dc9723cfd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..d6f945d69a7ca276f68a968cf34f2491ba8b42b7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2ee0571f16a3c0af4f510beadc1a7947a64c6ab6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..392084e0193a85eee35fc8acfe909f3cb21fb9df Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..caa36ab6350df7f0cdba0117b16083ef8d394cbe Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e3c333fef6b76b4db24e66eb18c7d11f329a5fae Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..99ea62b5f81e1e15cf5b60cfb8bec1b0ec2fd09b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ab0a13af42d2cdff06eedac8cd971fc25ab6a76f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..6d577ead5dd004be525a3b8c5b8c8fd4e8b99d21 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..8927baeb219b15f0d67d0db6c87819b472181c80 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8b5c539ab2d54b5ef9498fd11c1dde0f103251c4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..dcebe9c6ba1102a66cde90a3e4c573c8b391daa8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..a3b907ff46b55acd30065ba5d9730a0a2207504b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f67d7b4d6ee687fc7cff8c8ac8a11c86dfecbabc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..011f72aa20f294ca610b84372b0cd09abf0d05cf Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..37d79bb475063642fefc8060c045e71839a0fac5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ca540049b0ace3d8aaca56d5d192dfe75bb57438 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..18325564f724b07ba501c942574e7a951196fdfa Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7d0c64d83f180366f7b894cfd0c735cf8fc346f5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..6ce5a9f4403acf294f2abc78e2e9a1e91759828a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ff4e9155c7729ab52703bb56f1dc3c3776c9436a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7c0b81e43c9cca2f1313118c7deea7c3cae424e1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..342c2f8d7a5fbe920d8c48644cb08ee376cc65f0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7e23224cd11d58fd95bf486f9640692f5a1219b3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a6f94e3544f6364f025a571f45a849b5c12599b1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..62ca5f70d7ce48b770766e90ab10f7a8b5aef08e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..ddfaba8b2c8a5ad111fcf7ee7bdcd3ee131f913b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 0000000000000000000000000000000000000000..65e9a3091a3caef3efc668534a60db4806b07a8e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b5e62b0ca753a9931b22e21effa24bcb493fce8b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..5ddac425c226959ff3ee2a8238a13c6d78e3f445 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2517dc2e1ca39bbea00c8f768e10416a89114746 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..047cde3210d029cb81e1c312cb9d14225c4fbd96 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..38005fc5adc87a264377b615979926121cb721b8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..71966efd17159efd715702c4a998f1f0b90cb806 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..102b71396a9652051c083cbce0afffd6e9de778f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3d5f9d9133615bf20d0fde1e8fc0626baae4a257 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e7003e17e86603bc2653c739f5244e44acdb282d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ac4bd5d806b98bbd7b300ded7009b699e6db33c0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9a083ac858374174cd40d4aa3c91d41e0630cdd0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bce4a2b30dd796bbfa51081fa84f5fc29c607dd3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..6d4a41317bad91a6e33c185cbe42829f595928be Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e3f0112faa4bdc9658ff0783ab6d4c8e392e6fc6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0b33c8a8c6de0c685bef2578d4ee147137757263 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..4396b1c460fb2c65e19083f59c4ed93b45d47707 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ebf7e082589be50a93c9f7b4fadf6ac06d7be399 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b2999aad158affe724b909bf7a800b2fd1df4236 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..31855cd9bb39e353f13f42704d645a92bc1efc56 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8ac5491a8b04d84c27f31721a4256817aea83db5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e99797bdb2c5a684444d1761b9cad3c44f87e7d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..6a518b4e85ba9b630f895d8149acc21af60bd0db Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c10cebcbf593c4bce5e92eeb3bfe0b7ddd114410 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..d4b95d5c7c0bb9ead13fc4019c2a8b5658d086a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..352a38048a85906b755beee5cf3f344c445f780a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ceeaf1541460ea66c049437b7b4db1a6a3c00184 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..d56e26fe0d8ecf1203c2153574ad6d4631a9b446 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..baafaee3b808313b8d8d949d5f6486512b7e50f5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..949f6e7507d5d4f19df2a3e6c54a688de57da3d6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9c977b6e048e403febbbff2fd1bef86b1bc02928 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5a649b77680eefcfd1b20c0d0f8451f87b79b4e0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..87de26636fe3b8abb0ff2f743857ba9c1e252c71 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9a3b5ea806eb54ba0140548b14d70f87da8026f3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8487b79cdb25069bad728de0f7e9b780266e8ede Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2cd8af89ca99ab4142c033ccc0b99ea903f467aa Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..1c98d99581c153843816abd52dc6c8812168b2fd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ef9a25a30df2a40f61699d96bdbdd79197395fa6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..716ef4edade78f1d962d2d92494611b100091817 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..06c3727be8b8770fb61c0e084d5390fdfded6a68 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..14e680b4c2162109f3e483cf4b9429774998b2e6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..811d6778678ddd2af55dbfca2d556a0942a6bcec Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..eead8f1547ec87c720fe43ad50b81aa4748a3710 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3710d1ea835b5e01a0972fa4f659a4b7d55d18e5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..612254a08742680cdddbbba9ba8c5907c762209d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..48f1c67302521023944fbad1d2b0614e43ae9097 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d310e5a91bcb60e470e199e44282228312f65463 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-authz.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-authz.a new file mode 100644 index 0000000000000000000000000000000000000000..a8ced6abc66be23768105b9c5d028c0c3f7fe48d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-authz.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..e05b33b706624cd4133045c892ad7e1d115d1a8f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..349ef848fd5df56accfdbde4adde2fabab930cda Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a new file mode 100644 index 0000000000000000000000000000000000000000..3ba6b61af6aef66e91dea0aa1c8c57b4693d6b89 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a new file mode 100644 index 0000000000000000000000000000000000000000..1de2709e18f55646d032c8d0a3663e860b36a736 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a new file mode 100644 index 0000000000000000000000000000000000000000..05253736f9a622772d01d20c2393056113ba1192 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a new file mode 100644 index 0000000000000000000000000000000000000000..043ca84eb1675cacb4c341711c6abe9fd5d713a8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..72eb94adc691fd40eabfe095eab755bcdc322e2d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a new file mode 100644 index 0000000000000000000000000000000000000000..de7169cc6c824a400467f751c2b588f82fe5147a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a new file mode 100644 index 0000000000000000000000000000000000000000..3ede30198eb0cca2344d636e9cbae412fa8c6564 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..d536a7181c8007b9acd067fce14fa847f53c55eb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a new file mode 100644 index 0000000000000000000000000000000000000000..a2ce88ff9827bdecb67211518fceea94256cd994 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mpr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mpr.a new file mode 100644 index 0000000000000000000000000000000000000000..7a962d8a957787ca0758b97ab1bdad40d7ed4ca4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mpr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..156ec1a7210c381a08a7f6fc99df126405cb0215 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..123c440325284ffa9b5029fc1f78b864d8b8638d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-netutils.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-netutils.a new file mode 100644 index 0000000000000000000000000000000000000000..076855636abca872c570d18fbab5223384f380ef Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-netutils.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..daf7ad3e560db86d06c669842083db1518c94397 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..ccddf3fac374259d3306333497d0c20eda15e64f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-samcli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-samcli.a new file mode 100644 index 0000000000000000000000000000000000000000..7cf01dce16d0c9cc02ee1e4cd04b1d3ff77c5628 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-samcli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a new file mode 100644 index 0000000000000000000000000000000000000000..87343675f67c98e4071c0c9543d919855214eb8a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a new file mode 100644 index 0000000000000000000000000000000000000000..10efc0ef2ab51a92b77b88ee4d8cdfa7a5a5f985 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a new file mode 100644 index 0000000000000000000000000000000000000000..cd66704f1f8862f6509d54fc1f190756ee00e75d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-userenv.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-userenv.a new file mode 100644 index 0000000000000000000000000000000000000000..d739a9bb33b11410427881558e2305cea52dce80 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-userenv.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-websocket.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-websocket.a new file mode 100644 index 0000000000000000000000000000000000000000..b95d43388921b7c98efb2da99592dc4bfbde96d9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-websocket.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a new file mode 100644 index 0000000000000000000000000000000000000000..77167844ca502f9725d8e6fdeebbb1e3cd051bc7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a new file mode 100644 index 0000000000000000000000000000000000000000..8cfa67224fdb401a7251ade236d3a05d246465fa Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a new file mode 100644 index 0000000000000000000000000000000000000000..bd1859d96f35f6b7a8744daa7b9f1e6bb2a646bd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..9826b939090452bebbac6e8d2ac8b72126cdecdc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore.a new file mode 100644 index 0000000000000000000000000000000000000000..d2e567dd2292417a75fd84cb7b1db1c42bbe4c49 --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore.a @@ -0,0 +1,167 @@ +INPUT( +libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a +libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a +libwinapi_mincore-wkscli.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a +libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a +libwinapi_mincore-websocket.a +libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a +libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a +libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a +libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a +libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a +libwinapi_mincore-api-ms-win-security-base-l1-1-0.a +libwinapi_mincore-oleaut32.a +libwinapi_mincore-api-ms-win-security-base-l1-2-2.a +libwinapi_mincore-api-ms-win-core-util-l1-1-0.a +libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a +libwinapi_mincore-iphlpapi.a +libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a +libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a +libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a +libwinapi_mincore-winhttp.a +libwinapi_mincore-crypt32.a +libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a +libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a +libwinapi_mincore-api-ms-win-core-path-l1-1-0.a +libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a +libwinapi_mincore-schedcli.a +libwinapi_mincore-samcli.a +libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a +libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a +libwinapi_mincore-api-ms-win-core-file-l2-1-1.a +libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a +libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a +libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a +libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a +libwinapi_mincore-dfscli.a +libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a +libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a +libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a +libwinapi_mincore-ws2_32.a +libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a +libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a +libwinapi_mincore-srvcli.a +libwinapi_mincore-api-ms-win-core-file-l2-1-0.a +libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a +libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a +libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a +libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a +libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a +libwinapi_mincore-netutils.a +libwinapi_mincore-api-ms-win-service-core-l1-1-2.a +libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a +libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a +libwinapi_mincore-api-ms-win-service-management-l2-1-0.a +libwinapi_mincore-dsparse.a +libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a +libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a +libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a +libwinapi_mincore-api-ms-win-core-string-l2-1-0.a +libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a +libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a +libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a +libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a +libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a +libwinapi_mincore-api-ms-win-core-console-l1-1-0.a +libwinapi_mincore-api-ms-win-service-core-l1-1-1.a +libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a +libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a +libwinapi_mincore-wldap32.a +libwinapi_mincore-api-ms-win-service-management-l1-1-0.a +libwinapi_mincore-api-ms-win-core-file-l1-2-0.a +libwinapi_mincore-cryptbase.a +libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a +libwinapi_mincore-api-ms-win-core-io-l1-1-0.a +libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a +libwinapi_mincore-mswsock.a +libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a +libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a +libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a +libwinapi_mincore-api-ms-win-service-core-l1-1-0.a +libwinapi_mincore-api-ms-win-core-io-l1-1-1.a +libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a +libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a +libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a +libwinapi_mincore-api-ms-win-security-base-l1-2-1.a +libwinapi_mincore-api-ms-win-core-file-l2-1-3.a +libwinapi_mincore-cabinet.a +libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a +libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a +libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a +libwinapi_mincore-api-ms-win-core-string-l2-1-1.a +libwinapi_mincore-api-ms-win-security-base-l1-2-0.a +libwinapi_mincore-cryptnet.a +libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a +libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a +libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a +libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a +libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a +libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a +libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a +libwinapi_mincore-api-ms-win-core-util-l1-1-1.a +libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a +libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a +libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a +libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a +libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a +libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a +libwinapi_mincore-api-ms-win-core-file-l1-1-0.a +libwinapi_mincore-dsrole.a +libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a +libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a +libwinapi_mincore-sspicli.a +libwinapi_mincore-authz.a +libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a +libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a +libwinapi_mincore-api-ms-win-core-job-l1-1-0.a +libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a +libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a +libwinapi_mincore-api-ms-win-core-com-l1-1-2.a +libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a +libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a +libwinapi_mincore-api-ms-win-core-string-l1-1-0.a +libwinapi_mincore-ncrypt.a +libwinapi_mincore-api-ms-win-core-com-l1-1-1.a +libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a +libwinapi_mincore-api-ms-win-core-version-l1-1-0.a +libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a +libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a +libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a +libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a +libwinapi_mincore-mpr.a +libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a +libwinapi_mincore-bcrypt.a +libwinapi_mincore-api-ms-win-core-version-l1-1-1.a +libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a +libwinapi_mincore-dnsapi.a +libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a +libwinapi_mincore-logoncli.a +libwinapi_mincore-rpcrt4.a +libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a +libwinapi_mincore-api-ms-win-core-file-l1-2-2.a +libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a +libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a +libwinapi_mincore-api-ms-win-core-file-l1-2-1.a +libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a +libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a +libwinapi_mincore-userenv.a +libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a +libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a +libwinapi_mincore-api-ms-win-power-base-l1-1-0.a +libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a +libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a +libwinapi_mincore-api-ms-win-core-com-l1-1-0.a +libwinapi_mincore-api-ms-win-core-console-l2-1-0.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a +libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a +libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a +libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a +libwinapi_mincore-api-ms-win-core-file-l2-1-2.a +libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a +libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a +libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7b4de17c621fc27335bbbdc99f8c4396dd67beed Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..09b85891225c7277cf47c1e0a572ba157ad4985b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..75725543af2fc9f7fa9660c651e54171e39c0fc2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..df8fd9399a7252b450e2d27fe82b6382f94a4b35 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b1aeac5f4cad6e3482b42c277e99257a6bcb5771 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0608aab456c7d1a6cefbda26c11761965207a455 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..eaf6123064557c644fc1a9a7aae54367f6a008a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..99be014d35d753407a80863d24cedcabadca7d0c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b313ab075cffba82df46afb4f5db96245eefec80 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel.a new file mode 100644 index 0000000000000000000000000000000000000000..fb6659917489f57381ba59d3bbf460eb107c94d6 --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel.a @@ -0,0 +1,11 @@ +INPUT( +libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a +libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mmdevapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mmdevapi.a new file mode 100644 index 0000000000000000000000000000000000000000..a127d296da7ade3afe9945b59280d1972f892e60 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mmdevapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mpr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mpr.a new file mode 100644 index 0000000000000000000000000000000000000000..9d0e79300866285741eb236903e260cb14424b11 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mpr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprapi.a new file mode 100644 index 0000000000000000000000000000000000000000..959ae673702d1bb23c521f4f9e2ea68d0ade6476 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprsnap.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprsnap.a new file mode 100644 index 0000000000000000000000000000000000000000..8d324ca2f680eb89e2c4d6c5830a66a323293dd7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprsnap.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mqrt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mqrt.a new file mode 100644 index 0000000000000000000000000000000000000000..66b280bf25c237e0f8f0719d0f9adc60af43c4cb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mqrt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mrmsupport.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mrmsupport.a new file mode 100644 index 0000000000000000000000000000000000000000..8be378e4e376214f3ca0de720b9b97ff35ce19b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mrmsupport.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msacm32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msacm32.a new file mode 100644 index 0000000000000000000000000000000000000000..abf9a53a3246417b58052876af20d772b6e8acf5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msacm32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msajapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msajapi.a new file mode 100644 index 0000000000000000000000000000000000000000..05382a40ef92b2187080d8688eec3f40a421e504 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msajapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mscms.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mscms.a new file mode 100644 index 0000000000000000000000000000000000000000..c4008925fd8194538a2676b82fd10f409c13fd2b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mscms.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msctfmonitor.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msctfmonitor.a new file mode 100644 index 0000000000000000000000000000000000000000..afe449bad6b8fa80b6608fa899fa541d23e9d4fb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msctfmonitor.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdelta.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdelta.a new file mode 100644 index 0000000000000000000000000000000000000000..5a53a36ba10926e7df59b431ffd13791637d2a55 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdelta.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdmo.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdmo.a new file mode 100644 index 0000000000000000000000000000000000000000..56ee4bcfe8a67e70b1aedd4bb0e3f064c71d3456 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdmo.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdrm.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdrm.a new file mode 100644 index 0000000000000000000000000000000000000000..ee83b3a278e33e7a98a950e33ac7b44562362814 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdrm.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msi.a new file mode 100644 index 0000000000000000000000000000000000000000..64f1cffe3715aebfbdae609497a7a435e5b6bb72 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msimg32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msimg32.a new file mode 100644 index 0000000000000000000000000000000000000000..2f704d35dc49ebfec9351b5f9721e3c2baa46dd8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msimg32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatcha.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatcha.a new file mode 100644 index 0000000000000000000000000000000000000000..43cc5150c40ed440f448df10131dd7711aa177b7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatcha.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatchc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatchc.a new file mode 100644 index 0000000000000000000000000000000000000000..14b103d294e753d225ac57833db1424c85770478 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatchc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msports.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msports.a new file mode 100644 index 0000000000000000000000000000000000000000..58749ed3a722932fda33fbad96dbc6d4d84bbabc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msports.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msrating.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msrating.a new file mode 100644 index 0000000000000000000000000000000000000000..790a965c9ebcf5f5c06faa7e4d8ee6188951b10d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msrating.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mstask.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mstask.a new file mode 100644 index 0000000000000000000000000000000000000000..7603a13ae4a373c8f320a43d195579e96b15063f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mstask.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msv1_0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msv1_0.a new file mode 100644 index 0000000000000000000000000000000000000000..b2d85d6d863c59892a66d046620bfcc9d3c281a1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msv1_0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msvfw32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msvfw32.a new file mode 100644 index 0000000000000000000000000000000000000000..11c75ab3cf7e2bf23c759e0d4c010db0b5b4a156 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msvfw32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mswsock.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..89a098485c3a83df6e462c2448a54aa369256a02 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mswsock.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtx.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtx.a new file mode 100644 index 0000000000000000000000000000000000000000..4d4e2b06139965f1953ff919c0bc7fbd4b8e9826 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtx.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtxdm.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtxdm.a new file mode 100644 index 0000000000000000000000000000000000000000..2650cd8ead1841f18b10f549c2d825fdf59be4ea Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtxdm.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e09d66bae604f30eee6d3cf3838fc9031586d1ee Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0def121b1a1bd170be4f3b20ede4fee90743ae4f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clfsw32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clfsw32.a new file mode 100644 index 0000000000000000000000000000000000000000..cfd9dd287df75e2d8827916035ac24f93243e705 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clfsw32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clusapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clusapi.a new file mode 100644 index 0000000000000000000000000000000000000000..5970ee3449f19e4b74370a5d3aec9581e906d68b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clusapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-cryptxml.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-cryptxml.a new file mode 100644 index 0000000000000000000000000000000000000000..74fba9086b8400b3722c31097b49b1df10889dcc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-cryptxml.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbgeng.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbgeng.a new file mode 100644 index 0000000000000000000000000000000000000000..8bf77341eb60cab1d80ff734f4adcdbee0d2f33a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbgeng.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbghelp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbghelp.a new file mode 100644 index 0000000000000000000000000000000000000000..d945fb6348634957f6deb9dbdddfd7311ad3622d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbghelp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dnsperf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dnsperf.a new file mode 100644 index 0000000000000000000000000000000000000000..cbf3fd63aa97442c465d2ad0d12eacec4decd8de Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dnsperf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-esent.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-esent.a new file mode 100644 index 0000000000000000000000000000000000000000..6fe9290cd9455355825e4a7860c29775c01d18a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-esent.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-faultrep.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-faultrep.a new file mode 100644 index 0000000000000000000000000000000000000000..5bb5feaf496e6145b7282866d6448604024e21da Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-faultrep.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-framedynos.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-framedynos.a new file mode 100644 index 0000000000000000000000000000000000000000..355f44dd8480d243f96a6b0603d86ea7ba630d83 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-framedynos.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-fwpuclnt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-fwpuclnt.a new file mode 100644 index 0000000000000000000000000000000000000000..9080983230fe169fe2f26d8bae32b7d25882ce98 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-fwpuclnt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-hbaapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-hbaapi.a new file mode 100644 index 0000000000000000000000000000000000000000..9fc81e257193616121d8118257e47580647d5c45 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-hbaapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-httpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-httpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..38fc2076f8565293626043d7e77bf6859a5dec3b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-httpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-iscsidsc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-iscsidsc.a new file mode 100644 index 0000000000000000000000000000000000000000..671cc8f229e0d612ff9cdb096e1f32d86137e57b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-iscsidsc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ktmw32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ktmw32.a new file mode 100644 index 0000000000000000000000000000000000000000..f65813edf685f70435d5a31d9fd53d31d8dd5c40 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ktmw32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-loadperf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-loadperf.a new file mode 100644 index 0000000000000000000000000000000000000000..e67b3765bad346e1b1bbe625f591384b01dab767 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-loadperf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-mprapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-mprapi.a new file mode 100644 index 0000000000000000000000000000000000000000..668f7f70ead609a949e6ea85f518b8618bbcd401 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-mprapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-netsh.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-netsh.a new file mode 100644 index 0000000000000000000000000000000000000000..22bf2b07656836c8590881fe4bfa7ee8894a7543 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-netsh.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntdsapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntdsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..3af56297beffd3cdca6c25d359b472e3326ddd09 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntdsapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntlanman.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntlanman.a new file mode 100644 index 0000000000000000000000000000000000000000..aa0dab8914bb4acafc641391354b5e34eb563ae9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntlanman.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-pdh.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-pdh.a new file mode 100644 index 0000000000000000000000000000000000000000..5fcc9470a583d2e201375bfef326ed90c8c8909e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-pdh.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-resutils.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-resutils.a new file mode 100644 index 0000000000000000000000000000000000000000..33e44cef1a62609535b8d82094065834b60f31dc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-resutils.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-snmpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-snmpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..532dd1a90e94cf18ee87d085b075f6ea89d15f34 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-snmpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-tbs.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-tbs.a new file mode 100644 index 0000000000000000000000000000000000000000..475f3bf03b014e09563b51300b4ef7eae4cc3658 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-tbs.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-traffic.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-traffic.a new file mode 100644 index 0000000000000000000000000000000000000000..40bfd336b87c615e9adb4d193a9da3aeb4d68240 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-traffic.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-virtdisk.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-virtdisk.a new file mode 100644 index 0000000000000000000000000000000000000000..92cab8b604c8939a918ca7bc2272d502062fdc8e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-virtdisk.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-vssapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-vssapi.a new file mode 100644 index 0000000000000000000000000000000000000000..8fb796ad6ded8a1c60e88804dfce941b9ab8cdb5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-vssapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-webservices.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-webservices.a new file mode 100644 index 0000000000000000000000000000000000000000..b3ca8f0956b3c6b70030faba8938d4d20be96e85 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-webservices.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wer.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wer.a new file mode 100644 index 0000000000000000000000000000000000000000..4e2227e7735784e6590257b439148a4d3f750597 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wer.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wevtapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wevtapi.a new file mode 100644 index 0000000000000000000000000000000000000000..04f8e436ea095df05d1666b060e83f1ab66ee136 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wevtapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wintrust.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wintrust.a new file mode 100644 index 0000000000000000000000000000000000000000..1f79b33450949920a25ee9e902d3ebef57641429 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wintrust.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wnvapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wnvapi.a new file mode 100644 index 0000000000000000000000000000000000000000..bb9e17d7aa7762410326f586adb261d5202321b2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wnvapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wsmsvc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wsmsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..b0189ea94180a8fb30ce26a484c3980b9249a3d6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wsmsvc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv.a new file mode 100644 index 0000000000000000000000000000000000000000..0cd62da1e98ac203d3d202bf2f81c145bd912b92 --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv.a @@ -0,0 +1,36 @@ +INPUT( +libwinapi_nanosrv-netsh.a +libwinapi_nanosrv-hbaapi.a +libwinapi_nanosrv-virtdisk.a +libwinapi_nanosrv-ntdsapi.a +libwinapi_nanosrv-vssapi.a +libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-1.a +libwinapi_nanosrv-dbgeng.a +libwinapi_nanosrv-pdh.a +libwinapi_nanosrv-ktmw32.a +libwinapi_nanosrv-clusapi.a +libwinapi_nanosrv-wer.a +libwinapi_nanosrv-httpapi.a +libwinapi_nanosrv-snmpapi.a +libwinapi_nanosrv-clfsw32.a +libwinapi_nanosrv-esent.a +libwinapi_nanosrv-wintrust.a +libwinapi_nanosrv-mprapi.a +libwinapi_nanosrv-traffic.a +libwinapi_nanosrv-tbs.a +libwinapi_nanosrv-ntlanman.a +libwinapi_nanosrv-iscsidsc.a +libwinapi_nanosrv-faultrep.a +libwinapi_nanosrv-dnsperf.a +libwinapi_nanosrv-wevtapi.a +libwinapi_nanosrv-resutils.a +libwinapi_nanosrv-wsmsvc.a +libwinapi_nanosrv-dbghelp.a +libwinapi_nanosrv-loadperf.a +libwinapi_nanosrv-wnvapi.a +libwinapi_nanosrv-fwpuclnt.a +libwinapi_nanosrv-cryptxml.a +libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-0.a +libwinapi_nanosrv-framedynos.a +libwinapi_nanosrv-webservices.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ncrypt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ncrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..ea1cf5acde8636a91523d3951a3efa428fd9464c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ncrypt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nddeapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nddeapi.a new file mode 100644 index 0000000000000000000000000000000000000000..1fc19b2dd4fd825ac40ec96e0fcc444ddd5f946e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nddeapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ndfapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ndfapi.a new file mode 100644 index 0000000000000000000000000000000000000000..c63db8a5f4aa97be24d1e6109dc204c44b041476 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ndfapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..ed625a45b7c741af90cfb27c4e0ac5f0f28361bc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netsh.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netsh.a new file mode 100644 index 0000000000000000000000000000000000000000..9bd1f99a592f3ae60f844f39bfd31219f06d84f0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netsh.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_newdev.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_newdev.a new file mode 100644 index 0000000000000000000000000000000000000000..c6b4305f6f423d8642ddaff3fb53fd5c0f533661 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_newdev.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ninput.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ninput.a new file mode 100644 index 0000000000000000000000000000000000000000..efc374939a6afe2e31699eb4ae6a64c0320dfa66 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ninput.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_normaliz.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_normaliz.a new file mode 100644 index 0000000000000000000000000000000000000000..c09e9531609f205fb072bc8fd6ac7f6c0f2fb43f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_normaliz.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdll.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdll.a new file mode 100644 index 0000000000000000000000000000000000000000..a8115e6f5d92e492bfe1216713a2b5fa7756f969 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdll.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsa.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsa.a new file mode 100644 index 0000000000000000000000000000000000000000..f83d7bee98d57cd4419e4f82b1d550115ab1598e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsa.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..b2f0c7a05d1f8ba8122c584e2ae35e00e2ae771a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsatq.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsatq.a new file mode 100644 index 0000000000000000000000000000000000000000..05fe28856bb2cd885ea6d9c81ff0685b82db041f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsatq.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsetup.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsetup.a new file mode 100644 index 0000000000000000000000000000000000000000..6d339a7171bbdb4595c6302b4309e3f0bfbc04d0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsetup.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntfrsapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntfrsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..ac632dbce1f49a3cc9f27641bc28ea33d6ea1137 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntfrsapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntlanman.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntlanman.a new file mode 100644 index 0000000000000000000000000000000000000000..e96d7fa99398c5dff68b9825c06a519a812413d4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntlanman.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntmarta.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntmarta.a new file mode 100644 index 0000000000000000000000000000000000000000..8e615be6ec6f91935679b402c3b1539529b78653 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntmarta.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntquery.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntquery.a new file mode 100644 index 0000000000000000000000000000000000000000..7eabf2e2957889fd2f2c5d6fde8520a563ab78e3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntquery.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbc32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbc32.a new file mode 100644 index 0000000000000000000000000000000000000000..a9deb72bd5c63e1e97af84b2cc0cc32e66da70ea Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbc32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbcbcp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbcbcp.a new file mode 100644 index 0000000000000000000000000000000000000000..58e32ba6fac2b014bda5c8079e848d6f3cc68967 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbcbcp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oemlicense.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oemlicense.a new file mode 100644 index 0000000000000000000000000000000000000000..0a15b7f19e28000d657b5195059cde4779fa1dd9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oemlicense.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ole32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ole32.a new file mode 100644 index 0000000000000000000000000000000000000000..9e63fccac64e88980236648aa80704e6b95fc3ef Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ole32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleacc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleacc.a new file mode 100644 index 0000000000000000000000000000000000000000..37941832108bd81948d24f6ed509fc6cd1ecd69f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleacc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleaut32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..1ba67064c1d7d103825405dace135612cba17694 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olecli32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olecli32.a new file mode 100644 index 0000000000000000000000000000000000000000..a601f642405afe61a1ae80c8aa00ce4764a5acf8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olecli32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oledlg.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oledlg.a new file mode 100644 index 0000000000000000000000000000000000000000..51e77ac863bc5e5962599c77a1f0d65afa9f278e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oledlg.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olesvr32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olesvr32.a new file mode 100644 index 0000000000000000000000000000000000000000..3b97242267e55911f2d3562d03fb6e5faa0d9dfe Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olesvr32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a new file mode 100644 index 0000000000000000000000000000000000000000..f2f6cec1fe28b3cf10315f0dd19c2562b595d6eb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..87920a19bec152be8841a4fbc7be35e2f52fbe4d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..edd5b98d105fe541816cfdad51a9efcfd81ca793 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8f47df2dd2774a2965c806b8f57a354e551f66a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..53dd13b2d366a3bc11ed33e4f8c9ecb72c244814 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..dbb682ab721340086701dc5e168ba3be31fc1c23 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8bfce595c27bf5834280bbbc15102caa86649090 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bf188d6a7cd5dacbe26e499334ee1c409e5f413d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b5c267ca3acd40affb184a9dd9245a23b3b95579 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..61b9123dafa9c3d7506595b8891e9a9f08dc7513 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..baeb6f41aa20cdbd44979f4d96be1328ff5b21ad Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f6e4ba445ad52250ceb3985affa0aff0759faa78 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..73e3cc05e282b472ad436a9b6576dadbfd9a728c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2e5d78c8bbe14c32b537400fdc7dfc62637052c0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0cde1efd8cf5896888cd32a7aee9bd9390fc190a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d7bb8596cfa6643cea3b18ccb6ebc55303edab02 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0dfe6ddd864b5ed69e57fd3c916b48f6778e8bf6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..624c7c4a313e9f43593bb116d3227cfca0dcba8f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..8578294fbd2571bd5a6ea48cfa51a1b7fb4f8eb9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..922e68c71210806ae31e783ae909974284619a11 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..aace11e8565a60dd00ce7ad0015133646386bec0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4370369de5ed5574b386972bccb482ec1dd9bea3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..fde61e0b8e94f6ce2f2608930961b3f84c99e8d1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8d475ad5aacfafbb94aef7daa347a36b945df38d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7fca348f961abcc327f5258c4426f5bd576239f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..5ea3df17af0174529c31863fffac225d13d23c20 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..b28b72167a3dca2f118b205014a902301616675d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..95063510d07020805d45a027bd88bb5ae8e30833 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..50a0eed246bbf3fc63bc411782141616d9164b06 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..eae9ed9fbab81009185655d9b02e82df11349f43 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..9f0a7f8c951138dea952016a9354099e38419848 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5d4ce9e5c12cfbcf5f52704012f5158bded88548 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..fdccf67ab691b64cde7b4d57c8b8f21233f115e1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..632c71ecad6dc0e52519341ee92611ce2b42461b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8d990887f88a3a085861e7151274c24b74d84077 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ba40d51e9a10d09fbca68862d2a366a0595bde70 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f8f32b9195610b98ff4242a4c4f3d97f256dd661 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8765f8957e0c7de241a2cb643b6e8172c467a0fe Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..cfe9892d31ac6b6faeb30289e45cd0b5d2c9ce9c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fc4f3f57af3ae456e18a355e3ccd36ec04f85ba9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2e05450492dff2a6e1d44c02a1902e98f658c84e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..75c9289c83f7c3532dade47fbb79617b030f789a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..c0adc7b3338934bc35cf2122fad523df952924b4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..dd7467729cf2ad60c2ac0a3703c39e2fbcc3b7a9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..94f2b88e68fc89e50826ec00f229768fd40b3537 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7bf1cf1aad6ab0185b1d2b5effd8d8628017941b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..14aae16d7112b3aa805675ed86d768c8d9d5d495 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f95a32617db3d0e6e8dd2e434723f1188fc4169e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..046c4b9ec5eced25cdbc12be082e0cd5e13f93ec Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5fcacf222a82fd7748be0ff61e9f738cab5b701d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8158b7cc6dd320ce0f5a477ffce6623dc956178d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3f235e3851249af9c3dbc295deba9413315ab4e8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a88281b0eb7b470513665b517331660d51df62d2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0aa221c3ac66387a6a1dc19c114f0fec3cbce5ca Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..904f87ef52fc22ec16707a87f6b96e2380b912bd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e1cf8eb3d8b811ab1b751d450e2ba638857915c1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a6ade328d077dc5462d6abf3a1b811008777cacd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..155b2b36cc56e7515742fd6474fd3cd61a3ae38c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..6e3debc6a64a3ae2035e7b3b878bb01811f3ba37 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..ef9d17e6d70a422d6661cc7d0f944d323d0ba4e0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..db5c54e761e1fc89070788294c0fafcc2006a899 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a new file mode 100644 index 0000000000000000000000000000000000000000..ffca9df9e31f703a61c08ce66eab4ae42b283494 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a new file mode 100644 index 0000000000000000000000000000000000000000..e87e40442c1f810f35d4a112d56985718f834ba6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2def2c8644530a8762d386df6b2b4712e6141acf Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e390a2c91289c31596971018eb79e3e7968d47f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7e32220f0f917d15a90f7e872cadbf32d63c5580 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..c03ba146368c0285adb8b7e382320cb6d133dc89 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1f762983bf91b82f7a176d131203e10b461284c5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a5450e1aef73b25cc301714cb49d61923bb309b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ec19275b0dbb543aa6720e6b1980f4d086875076 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..04db6c79cf78bdc2846eacc80b0a438f274d1929 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..e01b733eadee5dd095d462e2c596f4272d43f45b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7bb9faedf2c9332c77c98179772d6234cd00bdf8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..29c100c707c14495e6d199523739f709266ab374 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..427587639b12aaf004c6ab3b000e547d5d70ce72 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0140955402c19dc458933518aa85907892e6b5fc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..447c6861d1d429de88ab85f548358b7b004aa7be Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..e5eec8c73f18065cb8352550e73b6f45400bd437 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..adf5eec4f98ce65775c217d5acd1669004aa3b56 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 0000000000000000000000000000000000000000..3231b19a4db8dc5d5d17d7367aca68051102e553 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6660b2951f926d3846eba181b7dd1fd05eac1113 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..38ab3fbdcc9a8e7a1e84e8002e7975c59b4e5d46 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..286097f325a3f3069bf46ecbb4cb959060cdee86 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..a15a95b094862b3eb7b388a25b85a7eab9a09a64 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..c431e08fd1f3698d089385a128a67a3907422fc0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..70d421d3a9a2d75482564196899c42e112433a53 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8283513747f0ec7c490eb4470a8493c65d8b04a2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..311a01c526d8f44ea0d2d442eb8b587ba0d91b07 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..888789a1b333575add8b3693e59e9ad84041f7fe Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cd52aa5b8252a8299ff94a3e5397b300e1e7c2e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4cae32813b8b2c4b9b6b1b908bb5a933276cb04b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7cc315e9b81ad16dc4f87655bdea00bde45430bf Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..eeb1202f12598c526625b7cc58eb3211c49ae755 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9abe0b82f581e851a11128ba99a7d994683b755a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7ea0422b8dae6dc5ae0d983b415c70e42370ddb5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0529465c9cb72a182c71a50469c4d06620b95682 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..30835b444ca3e28be30f9c5befbc332c8feb3745 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..6b5192e1f38a21e953ffc2c51545ef434720662b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..f488b0342b7828ec095c7d14cd534940c28f927f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..7a057aed09d10c1f56d8787044eefc520ebce24e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4947d659cd9129795162f1899d6ad928346be1bb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9b6e6bebfe56fad8f113599c359f95125e800d17 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..5c8d995a30de0488d8f15d4d336ac9b300b76d6b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1c5420daf7e78f8d9fc22bc13558938dd65f0d13 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e4e209c384e2498228ce33a5ed025efef1edda19 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f32e75e30b35c1628237ede4f8814a31362dd1c3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5004db8b2d0b0b2f42dd475e00b359539b8f0c58 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..886d7f2165ce3941d2f6b873690608bee8115c91 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b8fb9103a14d308337cf1eaa4f9bfd7a3bd3d158 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8480840517cc468cf6390681640fbc81a3b4a6f5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..994fad528139562c7df0571fd77183bc67b3ba51 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cb78933c3cc14367d4fe5efd6f518a0a4957b09b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..eb40f9d2ac33ccc4bf6e8fade6cf067b8735dfc4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..5b2e934b71f308a41a1fe37069097c9fddd452dd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6218d2d15fddece02dae438ea428726a61f503df Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..72c270eab5dfce9dba6c1ef6c31828282265cf61 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..81481f017aa608f82916d73d143b25341bb6f65f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b21ca1d66c548c2f4c53a76969dba94e1e82f782 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..613818cf79f24db6033b5ef2182ecdf8e1cdf761 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..bc850271679e68ec8e0de148f6c8ff7cdfb2b148 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..96440d17b65f62adae609f6a7b23041b5f1f7872 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ea1a271f1dce464aa9e13ac0b587a60345f76cf5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d9cdc6db84a7542592a8d1a84f604fa39f62d05f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0e793032d1b14ffb49ecb63cbf3614f32341ea73 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4ed0527f14d303a6bc5419632c46773d490cef6f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f3ea41414657ddcce92a902298b15ae2322199cd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..bb61bd6db4904facb5f5e5e1e2d7285b3d04d031 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fefe50cc0f9058e7eeeb91b509eb36db1ba86cbb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a8eb122b5f3d8828b14cda5245ce0e24a9822a41 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..35b239c01121bf18628989a6a101943806908985 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..01b5f0ef9b9f42cadfbc1602f8eecb4c288c51d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..10c68e304ea0ad22558704eacbebee370074b075 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c418749a122a29437740524854960362dccae96d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ac2422348822ffea2a4a1d078e0054f74a79ac76 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e32f5ea6bf44826c17a9659d39f41350bbf97c0a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..e8ed02e053964d637149aabc909ef454158e75c2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 0000000000000000000000000000000000000000..48cd52ec8cbda084d6c335e172477e02980ed3df Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b2f7c2c4e6d50a87f6ba7473b938648ab9522330 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e8c768f366225e6d06531e9d6bf2179a8e3d8255 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..697b0f04d1a92fc9ef9b8db2a69a207a5a1386d9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..894669ec169b8f06bc4e7096797497423c3b4dc6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..107277e69c2b7f688eab7ee090043cdc2b4fc2cd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..35ad9efcada72b30be2bc9245e4af159c29625ee Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..424f12176c92cafb5c541488700d4a00f839a0b0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..32047b93a35ca0909731a328021e71f00953cec4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3facd6d13b8fec5b2c0dd604b251a6068acfd4b1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0032a54e8e5a807713e0ad7c29d9df594b77ecdb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cf48fa521cf4f170d3074f8b8cb49b3ef5c2113e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0005443ea73dcb8b5d62a3c75bef15378923a47d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5ee03434b001bad8b55d0d3c0cb6232798974114 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..56512f461401a2ddd03a6be84f9d06b9a9ded274 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..840ad3d3405847bf2b2ae714bad240d1895c345c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cf72ff523afcd77342ff2c616a5c647de9a3865e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..158c2ddc285d273d0e3ac6828b6f336fa92eadfd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..482c8df248f93626a18a0c4acc8c1110d0d7261a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6c3369fdf09bba45790bdc42f257e5f5c2bd595e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0c48c43b1da73ad35bea87a408476b1c1e988311 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a619e5f5a736138cec41d5dfb7b340383bdac8b2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8eefbaf191949ddec9b1d686f9112be4b8fd8dd5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..42c56f64f428ef8ac54850d01526c56d6b173910 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c5d853d285f142cf23b0b201b105da0f95077b33 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8bebbf25ff49e97bf35c7870d7d7575e9a857192 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0081ed25c01abd0788824bd10c91087dfc20d050 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7bd6ddf0c3c4335365ee1e59527a08618205c68d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3d76d2e9ebf60971fc901004f8b873f56c9158d1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..a0c0a797a70f8a085fadba1adb5039b578cd390d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f4f87ec35029fc5fce7b118aabb780ac52e66bcf Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1b194666e883e88b91f585afad9e51f510632cb5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..98b54d37cb00efe4e953969fbd12a3795f9eb19a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cf03890fcef8c27457164d0b2f13a7fcd473376f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c501e6ae14b6daece3c6ab363aa86fd1b329d23a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3d6883c58f356b225fbb8cb2ccf27421a05019a5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ffdf7de274b4f3954772569a8a2f575182048fd1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..f53689edca0fe3c7c0161987c401bb6db58e8f9b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0cb309ebd362e8142087f36bef8c2768d36e5b72 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..586b878ddcbb4c428b017ce13a5c322282e12b51 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7098deaf4ca3cb46ce4453f25ba39fc5a567d44f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f47eea56e0830b815b27bc4df5af93aec1b075be Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..14cac294290d430f0ae79ddc5e90ba4f7658c79c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..29458f64fb6607e5dfd32e9b18622e3cb7ee3c9a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0919a9c504597aa89ce2537803294bbfcda7ab3b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6b65168f65c1aa3903d7d3e63e28e8bc0fa6bbda Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..df4b909f0c31e0ec2f65666c41e5c3a14f0bef03 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..18cc39fcb46d19dbca001dbe8022b6331072b813 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..75f77bab730dbc96f06e2fbecbd0091156f2535c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2e67a71dd8158cf47ae9271b86bbae57c0bfcbe2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f5f2f1e4168ffd08d97f63ccbc3324492ce26619 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c666323515f82bfbc16db0c783228440d2d1ec18 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9ebf89a1d39a93623ac035557b51946801e6c04c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..48e50afef90ca55e706941ce540595ba301276fc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5433b74ac95f7093c8c3b4b04677a3d41fc0dfce Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..dc931453c5f80b9d5c24735e5617aa3aecb83541 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..7b979d275b1eea5128d2e6fc5c6113f6023aeb43 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7f60c70924b797543463ee1e3abf918adf21be74 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..da060497e85f2f2d3f4a1f89364ee6aadc743113 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..94293b4357555c084e332a29795ec4ee3e703404 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f9b23c5b4548698d0258b2d758b9d78d6d329ffa Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0f4f177358b8533119f976b8d422477e4d0f49e2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..30b94934f79ff72c06eb78a1baea92ca44cfd2cf Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3878a0640d0bf20a918547ddbbdca35a5fc23f56 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..83b2ce9daf76368bcae2cb7dd20b64760c2efcce Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ba1e9d6fe5f6bdced3e145d7b19a1406f251a0c2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..806feca25db8e57af52132342fb441ced074f15f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8ba25735393969115d3b51a3d93c514ecae264e9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..676481b3b6b677d12386cae92cbc8045aaaa0557 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..5f44695a92efd16ac0cf989a1482714c4aae55b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5f839c327933c8cb1040f66b4e992b07612a3118 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..a675a9860e3a8945344eccb621134abc543678c9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..78191e9336a5a04ca59dc3a5eff061061abd6520 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..095c6f7257867387bb1cff7c81d332433d273092 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..42f56be1317b13db4eb0227cd2aa5ca31edbb788 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..022bfde9f9b79b6d72227e740a9a1d7943cc2b07 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..78d88c5720451988bc23846a95cd7d9c81c1b1f0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..23a761873dddb7610f17ccd33c6e45e741254c7d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1b4f5f4a7d3d8b305da6767f61a61b5be15e9e1e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c0727cb09915cdcda73b62068a0a660f82894e36 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4dff840c442db0ca466af9a3fae00b8ccfac5d31 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d5b5a8c64cef1ff8e3918901500dd47d78b78e92 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b1db71514a942c0ca66a2f5e1afaa7ac75e8509e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..863c254e6c23ce09168eeafbe955b73c40b4792e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..79ea315d2e5b4afc120ebc6feb0ade58211d97dc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4303612e482fef766586ed7113339e2f23914e4f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-authz.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-authz.a new file mode 100644 index 0000000000000000000000000000000000000000..ed3b2dbe1cc6fccc311963fd791c8d65daffee34 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-authz.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..404271f352fdd96220912bba9bec5e5cda29b18f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..19e8cc8eed283db1483cca9f05e7841e0d4c544f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a new file mode 100644 index 0000000000000000000000000000000000000000..e6415b25bbfb90b7d7a794cf167250f6607d5c1a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a new file mode 100644 index 0000000000000000000000000000000000000000..3af9a71973450431116f66433cdad3816ab1c48e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a new file mode 100644 index 0000000000000000000000000000000000000000..9d7a1481386d3ee7057178e3730b5735169f0583 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a new file mode 100644 index 0000000000000000000000000000000000000000..01bb89afa0febda4b88a66f542e4b58b71d12659 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..fc0c71f1cf218051eaf60111288ae6a7919dba75 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a new file mode 100644 index 0000000000000000000000000000000000000000..c650e9d10f9fe9bd6d84309d5cfb55a5add0591c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a new file mode 100644 index 0000000000000000000000000000000000000000..24ce85ae51ba6cea7b7151d14dbdcb88571e47b8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a new file mode 100644 index 0000000000000000000000000000000000000000..f225936b7fe6fc0ad2985d3072f23dc9b453e361 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..9a565f3283a440c4854bea3252f215216e6d8dd8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a new file mode 100644 index 0000000000000000000000000000000000000000..223150a2919cfd08031210b49f52df054a724045 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mpr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mpr.a new file mode 100644 index 0000000000000000000000000000000000000000..5c6d8511b69922d02919eef7ad4bf24dd383e008 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mpr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..1513278c839a0d57f3b3c199d096c389d67709eb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..8c0346dfc70d297bfb3bba14dc83fa2819b8411e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-netutils.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-netutils.a new file mode 100644 index 0000000000000000000000000000000000000000..742b903d76c50ae1222e65e6cc0e495ac4468413 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-netutils.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a new file mode 100644 index 0000000000000000000000000000000000000000..7713ea74842e8226150c41205628c6b18aa89157 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..f4d0be66c6d4ce60e8619892dd055c3e42685dbd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a new file mode 100644 index 0000000000000000000000000000000000000000..7c2fc90e4e4bad7c221bd6acb4c7cd151c5b33c4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-profapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-profapi.a new file mode 100644 index 0000000000000000000000000000000000000000..b0f7ac0ed88f2c99affd45933c6093bed3d79799 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-profapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..07d1abc588984d508e950a8140063df29047e815 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-samcli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-samcli.a new file mode 100644 index 0000000000000000000000000000000000000000..bbbb1eaafd7cbcd8128e5a421ffd9a8086087c81 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-samcli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a new file mode 100644 index 0000000000000000000000000000000000000000..7a558b27f99b456d2fe54f46b2b48614f889bce5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a new file mode 100644 index 0000000000000000000000000000000000000000..e0bd55b8fcfee22bd6335ea601807faec53c72aa Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a new file mode 100644 index 0000000000000000000000000000000000000000..f37191215b53facd409a00656faaf9a83a3446a3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a new file mode 100644 index 0000000000000000000000000000000000000000..c9e8a97e495744d0adb0292319dbcb6196668ede Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-userenv.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-userenv.a new file mode 100644 index 0000000000000000000000000000000000000000..53b72e18aa0a8caa9d7d4c0dfcd9183b029d0df4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-userenv.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-websocket.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-websocket.a new file mode 100644 index 0000000000000000000000000000000000000000..1e1426fb17c3d854228eb502bd8a297098ab1209 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-websocket.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a new file mode 100644 index 0000000000000000000000000000000000000000..71812a4e6f99349f94627c7d06b212f74e873db0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a new file mode 100644 index 0000000000000000000000000000000000000000..2c5a0bc4f49c725a66d2795109f8190ec9e7c89d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a new file mode 100644 index 0000000000000000000000000000000000000000..822dba5c3fdd89abf3db543710a83e4f417463fa Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..740404c3e5be9b7a3fb3119a0b6beec0e2ec0b5c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a new file mode 100644 index 0000000000000000000000000000000000000000..cde101e72266400e09a465a28854bb996782e8c7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore.a new file mode 100644 index 0000000000000000000000000000000000000000..73de4a1a64cc5831806add8150d3bcd67939488e --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore.a @@ -0,0 +1,257 @@ +INPUT( +libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a +libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a +libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a +libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a +libwinapi_onecore-api-ms-win-core-io-l1-1-1.a +libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a +libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-service-management-l2-1-0.a +libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a +libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a +libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a +libwinapi_onecore-api-ms-win-core-io-l1-1-0.a +libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a +libwinapi_onecore-dsparse.a +libwinapi_onecore-wkscli.a +libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a +libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a +libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a +libwinapi_onecore-api-ms-win-core-util-l1-1-1.a +libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a +libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a +libwinapi_onecore-api-ms-win-service-core-l1-1-1.a +libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a +libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a +libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-util-l1-1-0.a +libwinapi_onecore-api-ms-win-core-file-l1-2-1.a +libwinapi_onecore-cryptbase.a +libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a +libwinapi_onecore-api-ms-win-core-version-l1-1-0.a +libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a +libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a +libwinapi_onecore-ws2_32.a +libwinapi_onecore-api-ms-win-security-base-l1-2-0.a +libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a +libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a +libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a +libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a +libwinapi_onecore-api-ms-win-core-job-l2-1-1.a +libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a +libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a +libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a +libwinapi_onecore-api-ms-win-service-core-l1-1-2.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a +libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a +libwinapi_onecore-api-ms-win-security-base-l1-2-2.a +libwinapi_onecore-api-ms-win-core-console-l1-1-0.a +libwinapi_onecore-api-ms-win-core-string-l1-1-0.a +libwinapi_onecore-srvcli.a +libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a +libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a +libwinapi_onecore-userenv.a +libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a +libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a +libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a +libwinapi_onecore-api-ms-win-core-file-l1-1-0.a +libwinapi_onecore-api-ms-win-core-console-l3-1-0.a +libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a +libwinapi_onecore-api-ms-win-core-console-l2-1-0.a +libwinapi_onecore-ntdll.a +libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a +libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a +libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a +libwinapi_onecore-authz.a +libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a +libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a +libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a +libwinapi_onecore-api-ms-win-core-file-l1-2-2.a +libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a +libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a +libwinapi_onecore-dsrole.a +libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a +libwinapi_onecore-xmllite.a +libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a +libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a +libwinapi_onecore-api-ms-win-core-job-l1-1-0.a +libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a +libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a +libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a +libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a +libwinapi_onecore-api-ms-win-core-file-l1-2-0.a +libwinapi_onecore-api-ms-win-security-base-l1-1-0.a +libwinapi_onecore-fltlib.a +libwinapi_onecore-mswsock.a +libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a +libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a +libwinapi_onecore-cryptnet.a +libwinapi_onecore-iphlpapi.a +libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a +libwinapi_onecore-oleaut32.a +libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a +libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a +libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a +libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a +libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a +libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a +libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a +libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a +libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a +libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a +libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a +libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a +libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a +libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a +libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a +libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a +libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a +libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a +libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a +libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a +libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a +libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a +libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a +libwinapi_onecore-logoncli.a +libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a +libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a +libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a +libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a +libwinapi_onecore-sspicli.a +libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a +libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a +libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a +libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a +libwinapi_onecore-api-ms-win-core-job-l2-1-0.a +libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a +libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a +libwinapi_onecore-samcli.a +libwinapi_onecore-crypt32.a +libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a +libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a +libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a +libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a +libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a +libwinapi_onecore-api-ms-win-core-file-l2-1-1.a +libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a +libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a +libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a +libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a +libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a +libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a +libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a +libwinapi_onecore-schedcli.a +libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a +libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a +libwinapi_onecore-profapi.a +libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a +libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a +libwinapi_onecore-api-ms-win-core-string-l2-1-1.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a +libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a +libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a +libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-file-l2-1-2.a +libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a +libwinapi_onecore-api-ms-win-security-base-l1-2-1.a +libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a +libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a +libwinapi_onecore-tokenbinding.a +libwinapi_onecore-rpcrt4.a +libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a +libwinapi_onecore-powrprof.a +libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a +libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a +libwinapi_onecore-dnsapi.a +libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a +libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a +libwinapi_onecore-api-ms-win-core-file-l2-1-0.a +libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a +libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a +libwinapi_onecore-api-ms-win-core-version-l1-1-1.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a +libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a +libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a +libwinapi_onecore-api-ms-win-service-core-l1-1-0.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a +libwinapi_onecore-mpr.a +libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a +libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a +libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a +libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a +libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a +libwinapi_onecore-api-ms-win-service-management-l1-1-0.a +libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a +libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a +libwinapi_onecore-api-ms-win-core-path-l1-1-0.a +libwinapi_onecore-api-ms-win-core-url-l1-1-0.a +libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a +libwinapi_onecore-websocket.a +libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a +libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a +libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a +libwinapi_onecore-cabinet.a +libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a +libwinapi_onecore-netutils.a +libwinapi_onecore-api-ms-win-core-string-l2-1-0.a +libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a +libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a +libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a +libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a +libwinapi_onecore-api-ms-win-core-file-l2-1-3.a +libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a +libwinapi_onecore-api-ms-win-core-com-l1-1-0.a +libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a +libwinapi_onecore-api-ms-win-core-com-l1-1-1.a +libwinapi_onecore-bcrypt.a +libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a +libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a +libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a +libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a +libwinapi_onecore-winhttp.a +libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a +libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a +libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a +libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a +libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a +libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a +libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a +libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a +libwinapi_onecore-ncrypt.a +libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a +libwinapi_onecore-dfscli.a +libwinapi_onecore-api-ms-win-power-base-l1-1-0.a +libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a +libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a +libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a +libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a +libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a +libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a +libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a +libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a +libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a +libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a +libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a +libwinapi_onecore-wldap32.a +libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a +libwinapi_onecore-api-ms-win-core-com-l1-1-2.a +libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..13b6ff73df2111120409ded62a2fd1220907422b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a new file mode 100644 index 0000000000000000000000000000000000000000..7fb130920febb24aea543114e4f52b8ca538196a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a new file mode 100644 index 0000000000000000000000000000000000000000..2ef0585ae7a0b2697cdaeffacaa9bcb2303bb886 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a new file mode 100644 index 0000000000000000000000000000000000000000..01f2d7c4f95da64242c082b0d3dc27d29256ae74 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a new file mode 100644 index 0000000000000000000000000000000000000000..a4a11a8d83781f20b24d83471f7e0df3484d8a17 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a new file mode 100644 index 0000000000000000000000000000000000000000..07f693af7a35c93cd2e6361f181a158495a197a0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a new file mode 100644 index 0000000000000000000000000000000000000000..f1525b30c9b2a46af95554686c3631a15eec560d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a new file mode 100644 index 0000000000000000000000000000000000000000..4fc85dbb67c80fc7c4906e4957a795016577de19 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a new file mode 100644 index 0000000000000000000000000000000000000000..0aaead0e2aa9c5d9875b49ad42b9d088e7db7358 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a new file mode 100644 index 0000000000000000000000000000000000000000..33824c8f416cfd9f1756f00229d65d15f75146e2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a new file mode 100644 index 0000000000000000000000000000000000000000..c6aa4b1f64685023e9163c2128ff209f0b48c13b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a new file mode 100644 index 0000000000000000000000000000000000000000..ccad8d47d528c663553e366bf449fef4ac382a4e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a new file mode 100644 index 0000000000000000000000000000000000000000..23b79e18c60122ec1408a07f65c1012ff3f25d1d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a new file mode 100644 index 0000000000000000000000000000000000000000..5d32d2d2562f95ec38ee48f03cc4829557c5909e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a new file mode 100644 index 0000000000000000000000000000000000000000..456ecfe88d55c95d5185febfaa1c6beef4f4673c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..4fec75c4a400939440801856f8c7d322010566ea Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a new file mode 100644 index 0000000000000000000000000000000000000000..27f2a8f471738c869ed0cc8b19bbfb7dd90e3576 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a new file mode 100644 index 0000000000000000000000000000000000000000..9cdfffbb0d47d9a9b5bc964533e4a16a0ceab4f6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a new file mode 100644 index 0000000000000000000000000000000000000000..a13c23a7398afc3c000b25872915f7743f2ce0e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a new file mode 100644 index 0000000000000000000000000000000000000000..45ca5d57dd4d5fe9b107fdf7261796b16330cc22 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a new file mode 100644 index 0000000000000000000000000000000000000000..c7ad535ec9968ff761e5444ce0d94645837e983c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a new file mode 100644 index 0000000000000000000000000000000000000000..dd5a816586250541663157a4da2bea67e38f2f13 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a new file mode 100644 index 0000000000000000000000000000000000000000..440f89c8819ce9baee1060ed474625ab7428f79b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a new file mode 100644 index 0000000000000000000000000000000000000000..80bd7346030d34243487748021d06b2174ba64f3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a new file mode 100644 index 0000000000000000000000000000000000000000..b4f9a916a1fa764859f9b11ce48637d70072daa3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a new file mode 100644 index 0000000000000000000000000000000000000000..deb433a285697b31a98d1c615c8136e5d0fd55d2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a new file mode 100644 index 0000000000000000000000000000000000000000..24d40ed5a850635b9ba8b6dcc7371783f0cfad5c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a new file mode 100644 index 0000000000000000000000000000000000000000..57c2392a23eaa569fd2a95ac2a1855787468bd2f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a new file mode 100644 index 0000000000000000000000000000000000000000..d70e49282524035ef51807288cceacf7b81459ba Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a new file mode 100644 index 0000000000000000000000000000000000000000..b6f5f4ffabaeb2344646b2920c218d3d14f73c44 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a new file mode 100644 index 0000000000000000000000000000000000000000..2504470f742418554603da4773f0a6bd91e95e29 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a new file mode 100644 index 0000000000000000000000000000000000000000..b719e9eef7cb97839441cc1c713d1b61e0d6e108 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..bc6b087b973cd2de282b3edf6d0411eae588a56f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a new file mode 100644 index 0000000000000000000000000000000000000000..d40324e1ff263810726993bf264015640c0a9203 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel.a new file mode 100644 index 0000000000000000000000000000000000000000..d9d2e7fb4f7dc9bfb81f58fffdb0135d052e3a48 --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel.a @@ -0,0 +1,36 @@ +INPUT( +libwinapi_onecore_downlevel-d3d9.a +libwinapi_onecore_downlevel-resutils.a +libwinapi_onecore_downlevel-wtsapi32.a +libwinapi_onecore_downlevel-rstrtmgr.a +libwinapi_onecore_downlevel-input.a +libwinapi_onecore_downlevel-d3d10.a +libwinapi_onecore_downlevel-setupapi.a +libwinapi_onecore_downlevel-d3dx10_47.a +libwinapi_onecore_downlevel-gdi32.a +libwinapi_onecore_downlevel-user32.a +libwinapi_onecore_downlevel-newdev.a +libwinapi_onecore_downlevel-comctl32.a +libwinapi_onecore_downlevel-kernel32.a +libwinapi_onecore_downlevel-winspool.a +libwinapi_onecore_downlevel-secur32.a +libwinapi_onecore_downlevel-uxtheme.a +libwinapi_onecore_downlevel-oleacc.a +libwinapi_onecore_downlevel-oledlg.a +libwinapi_onecore_downlevel-oleaut32.a +libwinapi_onecore_downlevel-pdh.a +libwinapi_onecore_downlevel-apphelp.a +libwinapi_onecore_downlevel-difxapi.a +libwinapi_onecore_downlevel-psapi.a +libwinapi_onecore_downlevel-tdh.a +libwinapi_onecore_downlevel-comdlg32.a +libwinapi_onecore_downlevel-winmm.a +libwinapi_onecore_downlevel-twinapi.a +libwinapi_onecore_downlevel-advapi32.a +libwinapi_onecore_downlevel-ole32.a +libwinapi_onecore_downlevel-xinput1_4.a +libwinapi_onecore_downlevel-version.a +libwinapi_onecore_downlevel-shlwapi.a +libwinapi_onecore_downlevel-shell32.a +libwinapi_onecore_downlevel-msi.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4b60a8dbdc7193f79b0a00a0f1a73d85e3141365 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..37796dd79ddda3cf3e2384e9fac3747041b7f1fc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3c8e1bd41a06705a706dfdf813e38192d2cc04a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bd8771bd87093859221c4b846239dad8bc3887f5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f3de0ed9601d5a942ad6168ac13ca9249b0b30de Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..23886f81656558c66d57ce4c67c923590cc30b1a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b69e68d6512e85d1e8945ca93f9045a98f910367 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..7965562e2d4d3002acb2e6aca7c67cc0dc20856f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..79c95c6e89311c9759fad1e98a9c7564de902cc8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6ebfb7dda506f4047ae9bdb06f4ebf928ebecf87 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..75e8159fa16502685ba3c51c98461fb8d5bb6a19 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3b30281a7f18923dd9f233734b6e7054505886a7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..96e1b51af54248988145ecfccc9c8ac8e9d031a8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..38d587fb0039617d4e844967ac04c590b1cf490f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..eab795a2b959ff4cf6a0e8bdea49087917f8c098 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8ea73550c962a50616193f5bf350c0943edc6ad8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e3acd5554576401e9d60bab18ab1a5fe8e3b5883 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..813b54b6d1ac8f58951b7875c65e69e74fe58486 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..02f67a6c453ce55dabcd0a1fcd4a678a8fe8db01 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..afb379d072b73711f2bac5f766a3907fe5160c91 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b1e71080639dc677a14f7c7b9dbf539185e370f1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..5ed0238f8aea70a0e1ebd781d00f4ab0b5292a7a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bffab6b1524539b05cd2f69444cc0d303fa532df Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..624dc474cc35782811677b66c323c3ee476d7892 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a245ec1993d46a68ad0e32c71748ad945a230dc8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..dd4595fcacd5b411b8f1f993e60c93af789bcfb7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4b637732e78b4d18958c535247a192517eb79f15 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..d0fe7e13bd2831a87cb8306f12972118bd0dec8f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..f2fce256963e12994e78bce7d7d277b38942f1d2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..99f64f26836f567c3ef761e59dd7fe8d4e247470 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..885eb7f5ea8ffbadcf81535510e50ab80170c743 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7f8b0772c342c6cb5ac598d8837aaa559b7e7a25 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e4d2df1b830d127587566fea023c501d791e793a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..bcb9cfb4020b3cf60cd07ca1bca564005a66ada0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..36ccc1aef73b2f7309699a61063babd659929a5e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b08e2df1b14bd4af91476fb3f8d8f2ecc96ff541 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a1c8e5b735f4d1da0df13d977954fdd0b2c8d25e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b96341b93c6236b1b3bdb20e1b02c2848dc429c0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ba013a7d57e8a36840ef3aa8997077aa9fc7f77e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fd67434d1f72e763d715ccb03e02869f85fbac65 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..40a8d28f3f3f71dcb03ed70fde0723725b84472a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..ee9b5c634bf533dd86b6206ad5de39fe2be54d36 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..81afd31355f6e64bc502dcfd65a3b270fb34be4e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..67353c0dad6141e9a8bee1d65a908379c1dfc6d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..68dc69588b6147ad5af444ad9ac4dfcfbce4b709 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..be482816a14c8dd6533dea24f897d5ab6e7c191c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d3694d14c63b33f15dbda65020352800a227f9dc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..77c9101043174f97e1a016c779fd89d5777c747d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2dc7874fd5cf638cf711cc5c4641e1062bf0ccac Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7ead0552818d92d01263743bb52843729051909a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e718fdddac2cf12ffe71aa78dd8530df6eed93d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..15adb8bcd4e345507f36b4efc97f189d380d3bda Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..752ff637236d01311310f333b02daf228620388b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e8d8ac028493510a2682753cbd24f718065fd13e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8e7f8b1d135e0fe97715baeb2bc4209d2f1ef77c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9d442cf6e504ada30bec61be1123772b09cc7190 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d78ed971b1381b7b9eb46f22521fe93cacb1aff2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..54128f3e70ef2123175fa2f0695ba4a77d6dafb4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..98bc76370dbfae39f88eb66235fdac8cb8780a39 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cdd52232996a330e3f04d3a532f3bb176ed6b851 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..bb3e669ffb66619fba4aacf317aacda22ea70872 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..babbd4be4ce85ac1a7e3c05f0cfddf30801ca969 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..57aaed69eeb6329e709b197030c930aa7797c1f4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..3e4629f1f1c21113609551b0b93f6344c8d71157 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a new file mode 100644 index 0000000000000000000000000000000000000000..c62d4e4d9a357893100a77176da29e1a00cad0bc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a new file mode 100644 index 0000000000000000000000000000000000000000..48ff45e2a9343450c7fd3a2f5a752c254fc43345 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5be8cc82aba11846a04f462f242b366838c76101 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8f9d8cc5dd4cabb060630c8dc80ab8281633dcff Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0dbcbdecc9eb264e2da52b1ab180aaf77478a71b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..ba93a511f2baf04ba76115a6a5c3ec354d92305c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5beddeb8371206355500e244821f7c097f8362e6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fe53ca1b8b1096ac318f0ab5ca366b7248c45d7a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6b6f3ab14945f6c315cf2f5776d42509426da6cd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..597a7341bd4287d98d28a096f37efceb02aff874 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..ff3a73bc67896b847cf109f2b902cced6863ec5f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..73068c9454ef316bbba04fa97721a6738720512b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e184b1406cc6aee6ad66c3b310817f120af29a65 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d482db391a2f2e93d5447cc4ed831462fc789389 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..85bb2828fd00b4abaac377156272d8f270dcbe4b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..35c5b4e67776957b126c26b9f77abc80bccccf46 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..057d2181fd04e3d71d70576bedf821db3b49543d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..9ec4f1ed50e76a72cfdad9f8d29e64be4487c40a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 0000000000000000000000000000000000000000..2779da82329f476262b40f369237ece21864dfd1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..830399c8c0db5a701c74b23d79716e6f469caea8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e5b93eb3b832e52cacad86a045db6b51f12ffe7d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..32892823ca1a891036616d5485da052a4b4436d9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..a6cf11f46cfd6b848ebd87faa613177328447903 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..d010b489644f6818875ed4df2fea105c2ff8952c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..62b4a79174ad4209aa4d8eacf634a474d350ff72 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..716f5ff42e912c0ebd74be20ff6c19dde117d639 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e9813e3c6a1698783eaf56d505636fe8ab3eac72 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..df203084ebb6b1aeb8d8c718e509070924193335 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..709550e2b587ff75a2d063d2c76c1dd7bce02e29 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f03bf5b5b7e9147fefbbfcb6e81f61a877fe6e30 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7a5433325315a6d35b8339aeff24c323b9f3b6c2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3a5497b61339c739d19d5e9f08d2a2700ba850fe Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e2dac0623478018889fddd0970f823a1e781b5fe Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..300ebbd0f3419584008445b79df925437718d530 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c3529dbc6f5a4caa25a89cf5aef0989303f82b1f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a31d61f4513e06053bbd53cd533477ac23cbbb80 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4139db2257d9f98dd8a014603cf4eb6008d5f7c2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..b261a17f16f41874706c18f995146f9e4e0c7072 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..6b5ac6a34504a45228c6ce6b24c79cbfb946b7c8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3660d62b29672ff0b8f68d10170e58254ca1374c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c022a8d23b5592fb5dce58e71dab5d6eb0a0ba6d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e450b83dc2e6ca1ac7eeeed5ca9a786b08b6b546 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5e63038a4c63fc0069ba7cd6177e32dce90ac435 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f2df8d7e9233826b03f03e45242582362c95bfd1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..145f005d1bc3c1533440d5b72088a65be15d5f79 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c213a69e7d3cf4e6b40cbe22083649e0d7bde3fc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8dfc0ab106fa67f5bbb5dca1211ef0406edf9c7c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..2e935e166b824d17a00134eab3ec99656f873e3c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5d00a3e838b8095fd234f586bbb042816cc1ac9c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4fddfeb9843b075df459fd54e8adb1f59e5cf464 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3cc9213a758c715d598fa98cd5568be1660d8ea2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..109b4ee8273e6c6d0a2590b064e22161bde943f2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b90ba3d034d69d8e1c0851cc3fe4daa541cc6650 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..de745de7fad70e112f75f3eb4185fc1172f9a1d0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4c586ad7bdc7d63dbf79efec4466bb660ba7a935 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0ba540ab8601e851f232c8a0846dbc1c6b394b04 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e5541c3d3d60992e41186eccd50c2e242e351fd0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0be5f13c068b5f2bc6488980e4de96b1bd4fe0f9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7c1dc698bd8b1bf011152440dfa8ee8372bd8d63 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..9faf458e760b5491f41ef34c7626c18ef0579787 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cbdd35968686315c0c23dfb6541426451b7ef5b0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cdcb0616364e0be6a92a50f42daca0c2603be2d8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a525c4fa275f1582d8c3c5b23475434e8b5fa65f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fb526b6e9e6cba49458b36a54280ccc37f63e5a2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1f4b85129585334be4086321fd1b7109230047db Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1f782cdd79a6c33005c661e67ba6ac0230faed80 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9e05ef6df89cd011300e418df7ccbdb621abbb36 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..022212bcfdea368f05567fc55c8bc6150ece9ce3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..019e70e9fed218f4910be1d103216363bde8e40e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e0af344ebfa74ad0377ac5ae2d77bb14a79c3d73 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3992b7d99af405112eda1c169b68a3699699920d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..50be97b402f5c6b62623c2f056cef5e0d21b787b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..939e55f8d2238c6087c9a7d9a4fabb0172b0d3f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1fe3ad0c0422629edb9d6cc83396d8e8bb5df3b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6df87048b842b4f03293dfd1b9b2323607994543 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..31c58dcac56b055f78930848adacc5e125b6334f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..eff78043d08dede12919f388f2d4976efa192f5a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 0000000000000000000000000000000000000000..67abc3c62ca94508a0f6e4b7b0f33c03efc683d0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..130c974253da4055bfc9d8caea118bacfe1b6c02 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..10259ec69817046ebdd169c130c6a022e41aec5a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..614cac530a86ed3faa10587cb961054530b052b3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a1ca3fe8ff3cc4c89e80dcf03390d6c3d8788f38 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..244ecea2a04b5a311719ab63f3947d8d0af14a93 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b273fc924d0a30937182a3308590a9b8b097f1ef Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..561916f30fef8ce8e5320487bb62aaaece4413bc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6c0b50e3838e5c82b00b2413fad6d7fe4aee2ed2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8a156fdfe8b73483fffbb9857278f9320d8ecd47 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b96b6c88672dfaf91f404d43d299f366f4bf18fc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2d157704fa43cc541d71099ba9382d26ab4b8d55 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..dade58d6cdc1530f02c6685ef0727a9a54a44c63 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cd166998f44921c43ed3f74a730ad9b837a2a73e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..95111af22f42611c4260e4f36972eeec868501e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..21e50b203cfa837a14a46c6678ac7a5c10ded68b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..36a62c64e61803e8c951a6d9412d8a862c52515d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..1658383d0c3b10f763a2340f209b39ad5dab1103 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..1c8f1bdd5c2e706c7adabf8742e74efae5b76752 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..749a8cc9a7799d6c95d9cd11c24e19535deb0d2d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7a0c18f96a49a6f5badca65fb1dd6a80d2464b72 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cec82e90dfacfd9c1afe4e94d80d51c586a6849a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a8e03e711e0fc89f69a118ddf9087a8150a35141 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bc51a0a9fee61aacf3ad2cafb3b9c4c71f968235 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4de28a730a88e2eb7533c016a70e0eee8aa4350b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3b9e69d726827deb160a253388723c0f1f75c6e6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3b559d7b1159ce994b1314d35aa6d136b9f4d0e2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bb8d5f0c1a94c8b066ca210084695ec39d6debd9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4a1bb3c2024ba3ec6b218a1e23d7dfd38aafd329 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..a1cd338a9fb64311cf736f94bef892a66a1fa678 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f52fb737a000f70ac1d4ee855fbee256db2c8cc6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..129a71daf60b2d87368668fc0463f297d92456cb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..7437b4607cc9334c3ed8152df99b06213439b954 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5231128282a350e84b9680379b5c23a5c5c09aae Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..b7d359a9b2afddb8a1510796c618ee8d4b400e6f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6b36a729f15b0ca2dfc788369054de054a7ede46 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0eb01e37270bf7252c25cd043e812c11f54008f2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..8658e4216c8a506aab6ee3e845c50588459bd340 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..245d2d85cde25901fb4c3a0ead109b6fc98a8617 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..66598aefa7afd7ffc737388108bef549f7485526 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ec27513b853a75d1068ada64dee64eb000b14799 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d86ed7f7c53b3fb39be145385debc6408f793529 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..cbc8cf9738de6c46736ec6ae084f4326f631e74c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..dce5d5b79ebe2ec38ea4a4d1775c83c52a25e9f4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bb5d05f2658a5aead4cd191cc00e5d0ae481462e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..de185eac4611f8720f89488f5974ced07ec43f2d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1ffddea918ef7e8ece4a412a888336ca88cebc6c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..90325013ccbe7f5428f414e6575c39cb1c56b4da Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..95bdab5947b65af24f2d1acfbfd2fdf4bd10138e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6a6ef393bbf722c63c73c65808731e2984b0ce78 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2ab5d417f9f3b77666bea6926b4308fd42fa5ac4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7274d76b70ee9c224e05bd8b885d7963602ca2a7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..da9d062d6b47dbbbfaa3701c808a830b7a7f568f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..9d610fe184bbdd3ca64a4cd512e415c7542d5f15 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..ef080536093b731f40d73d58a90500903210f034 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..681fdd0184c375f192e1853f354f30616e00c626 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..7f55f5ee335679bc4f2b785f02f04e74c0f48bc5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a4fbccff1994fbf245a4123668fe22b6263ac6ea Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..96e382d1ae9d30d6b8c98dd551e31194b5d4b6fc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b62fbec1fc61c5ef8ec6091ffa769a65aba6eeeb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..48785f2a6f58d9757695e6120a0dd370c947f3dd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f5d17523ceeebfb85c21a3499305881e740aea60 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b3185966578c0be65b95d60072bbf84680c84def Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3eca8943437ab71f7b6dbdfe7de24b4ca8dc4eff Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bce843c403bb3400b30a10bfefe37f5e54e66e5e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..343e40d1b8ec5e90cd7a35770f64669693ebc6d0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2f2f9fe6536f9bafd2c9f2b76a034301dcaf74bb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..416beb740a4399065b5c0dd2911d0f5db50f80a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..02c3c401540d808ce9f68f212a9318b56f0d0b2a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e4c8e7662fa81e7df37f5f4774d48c3e62f4a612 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..883e43b8a3d40a40670fb492a1c5fc926d5d560b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4852884c32ac086137ec4ee3026d2cbe80ae1371 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0c2049c39afa8d80af772fd276eb35b8bdbdae9e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ae1b072915d857a7eb6e04a6ec90e19d4ce9fa19 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..9a1ae24cbc1feac1adb3af185901599b3617e496 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3412dd272df636632f3b441fa4979d0d06263bc8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1ad14296af9af9ae2594c45d401095a2b0370598 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f3920778552551daa1f3363af55aaafb6d87b5ef Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..02dc0e4d8ce2798ffe5b4ac7c448897d2da51de1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1c49d625c51700c11c8cc8df0a7a7f1d5e1262f3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..fb8bb052eab787f042cec1fc0924361e1be2b0ae Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9a7c5a14b58c7bb57e4544580eb9e505a32f8465 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..673f4d5223c070e328a5ca76d425821f414395ea Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e11adfe34bc3b70b615fb3114b42ae36d4307bbd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a7d7272dff808e58e25661296100f0789fd1c1c1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..29b71e1da7a8c80e43011fe7ae6a6a2b804c117c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2bc4656b341bb9b4553264b6fa7ecd16361e417d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..56625cf506f2bd82efb3415c6beb7d308d866029 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..87b629605d5bc674526c7b9c19ef9eb1cdc4c345 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..53a32622f04bf6397c2093e0cc930d7e448ff4cc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..103d4752cba9635f46fe4cbe7c306499abb3f0bb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..db48c5febc6465cb6283519598060b20cdb1165c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..58f7df3ef7b32dc0dab29f53359aba971c2895d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2b0db2c5e3ce550c57a7b29baab05f6096764b1a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7f76679162d989dfbcff29412cea3ed97cdc354a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fba58aabb08dadd865faab35ed1d3244d16bb6ab Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..23e421b2c8ba0b452a3e1f4ec22275560df575e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..214063d57e1ecbf0ea7acf546258b5ef34703f48 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..d01e791f0cbf5877ebf027be335257fa29be35be Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..847b7574c515a733b67a999892c237484f2157e9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..eebc1b76381f9d5947040306a862ba3ae1f744f8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..918694333ffdabdb66e1012de7774906800d5044 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8d0c8acd96ee3e706538d81c50d85d25b1daa3c3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a9927de6ec278fe32cba2b52a35270f369a640e7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..68f7f5cde578a460f5d84cac3db4be43c7be12a0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a new file mode 100644 index 0000000000000000000000000000000000000000..e8a4dc2b04c87e62511e9ee7365d67e74c682e3b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..ee8432fa4f71b7b08d5fb120d927f2f98a92f9d4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..06a76bfeca123ffeadf27d1e90db7335fdf2c5a7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a new file mode 100644 index 0000000000000000000000000000000000000000..8cc5a476fdcd6a8f9b0eaadebb6617f3cad4eeca Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a new file mode 100644 index 0000000000000000000000000000000000000000..9d5b919a1f5ebb6cd0c3eae843bc1fb207fec011 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a new file mode 100644 index 0000000000000000000000000000000000000000..25d1f16056470cbc8a966fcdf587f16ed23443cf Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a new file mode 100644 index 0000000000000000000000000000000000000000..79492c6d792f982a02754377dd582496e69f6db4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a new file mode 100644 index 0000000000000000000000000000000000000000..1e3317d57da816408bc0900c3ab84859f59b457a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a new file mode 100644 index 0000000000000000000000000000000000000000..2e7c373b7fe35109180b07fef77a20fae96b066a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a new file mode 100644 index 0000000000000000000000000000000000000000..185ed02761cccde4282f7e61e15dae5a2c48acf3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a new file mode 100644 index 0000000000000000000000000000000000000000..ab43f596eae23796aad2d12f8bb887d8319be7fc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a new file mode 100644 index 0000000000000000000000000000000000000000..d058b1e1e39e0d42ef55133744c8dd39f65a5d50 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a new file mode 100644 index 0000000000000000000000000000000000000000..ded2380f187005f9d9c565e5c9619c13b7be7dd3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a new file mode 100644 index 0000000000000000000000000000000000000000..03cae087acfb792917499a11e9b1d11e43dafcd9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..c9298997f670b4b25703f85a69cf84fb063ef306 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a new file mode 100644 index 0000000000000000000000000000000000000000..60c5b5896b88e4200b0c076e5d874de31297dac5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a new file mode 100644 index 0000000000000000000000000000000000000000..628d219a3a9899f293a780178c9abb16d3a05d20 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a new file mode 100644 index 0000000000000000000000000000000000000000..56c7261a3056629c2d27533888b552585bf45337 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a new file mode 100644 index 0000000000000000000000000000000000000000..67c8734f3beab01402c44e988f4b6658b98c5262 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..671f2bfc2cc2366973af29cf1a098be133418619 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a new file mode 100644 index 0000000000000000000000000000000000000000..15771d972de0f4959d47be5859e485595684f7d4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a new file mode 100644 index 0000000000000000000000000000000000000000..cd95792e69a5b47c1260ecc776c2d12e9787d22c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..28eb32dd1dc34c9f9804e012d9b06c1ac3cb916c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7f295e4d666e94dc14f8ded528eaf6a2be7d0241 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a274bf57ebe15d27e71012847edc395b148b4b3b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c2f7ff4f677eeb80a5e390e0162076fcd89b566a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..77efe4b61fcd727d438e1689f73e111a58834fdb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7b968d583bc3f208565182b56e11860717ab7645 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c7b52d2468f7ce58738fc985db0a08ffebef01b0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3d44de25cf9b168319b45f2d61d7770e81c22e5a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..37624df3215e87ee4ce61669854d1364dc21e99d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a new file mode 100644 index 0000000000000000000000000000000000000000..7bae6bda3ad0f6e5ca7a8ab8016091cf7b2faa4b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a new file mode 100644 index 0000000000000000000000000000000000000000..580cbac3a12a913e47c0719bd4a9ad9daa66b585 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a new file mode 100644 index 0000000000000000000000000000000000000000..f20f592d347039562eff06b79be69f61c13b058e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a new file mode 100644 index 0000000000000000000000000000000000000000..f46c4884bd90c0a78fed62b7ffebbba4a1d81f42 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..fa5a85c9081a4761cd4c881edfa17a8ff14c84fe Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a new file mode 100644 index 0000000000000000000000000000000000000000..32864e9b62967897800596a479e305e7ad9b1184 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a new file mode 100644 index 0000000000000000000000000000000000000000..c7d76bb831266435b192b37769454003e6ae862d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a new file mode 100644 index 0000000000000000000000000000000000000000..2dc6733ac0e546d5a59f959beb85733e1df5b872 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..89a4eb56b6e353100a2c75bd09106e9997534b5d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a new file mode 100644 index 0000000000000000000000000000000000000000..ae5de25fc491b02d232413d3751af22dea69ae0f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a new file mode 100644 index 0000000000000000000000000000000000000000..18de81d8594e2b48641ea1560def855cbdbee9b9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a new file mode 100644 index 0000000000000000000000000000000000000000..e1d81baf6fd72afd80fa4859b4271d39a0cc3881 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a new file mode 100644 index 0000000000000000000000000000000000000000..77c0f0c3905215f868145078e424ff6544543fdd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..126b7a9143e27e4a33237dc441041187137d7a7d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..63beb7820f73b492f144c406bb25d4bd61150d6c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a new file mode 100644 index 0000000000000000000000000000000000000000..db37a10e06a4ee5894faa07fb8584a39d051091e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a new file mode 100644 index 0000000000000000000000000000000000000000..4c43b2d6dcec9a5681970fcd6a621a19b55a7dde Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..d1dbb033a8f894489321b6add098dca092fca578 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a new file mode 100644 index 0000000000000000000000000000000000000000..667c2bceee23d434d090bac6f0a8fb70b6b852d4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a new file mode 100644 index 0000000000000000000000000000000000000000..31668fe0486f35182226973ca51afa576dbed8e1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a new file mode 100644 index 0000000000000000000000000000000000000000..2bc2a70db47a8e2ff5437ae26df874cbb852c074 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a new file mode 100644 index 0000000000000000000000000000000000000000..8808e748f66fda699e8596268917b03845bd6a98 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..a689c15c46113b21f6f916ae318c90706563bbf1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a new file mode 100644 index 0000000000000000000000000000000000000000..625e3414c8ac9c96342cd1917ffcc864fff251c7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a new file mode 100644 index 0000000000000000000000000000000000000000..04a19c1bccc5e8140e2aacdf62ef4e5a185a9ca5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a new file mode 100644 index 0000000000000000000000000000000000000000..fd4a96b59da8e046e044f519ab71de3fc0fe533b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a new file mode 100644 index 0000000000000000000000000000000000000000..f631e9c3261d1a0e5e26ec1723f44169ae074fad Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a new file mode 100644 index 0000000000000000000000000000000000000000..22e4d166f9ca6c61438a7350649fd1368db8b7b6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a new file mode 100644 index 0000000000000000000000000000000000000000..c143cb715529830fabcc8b555fc36d8e3c8a2416 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a new file mode 100644 index 0000000000000000000000000000000000000000..d8aaf37fe3c65a42aaafb1b1c71e3be4e07d2d2d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a new file mode 100644 index 0000000000000000000000000000000000000000..d61f5d74f85269a3c1761f70006f3365e4c5fb6d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a new file mode 100644 index 0000000000000000000000000000000000000000..86b5f17692ce1c129fcd8a39e0edc5c2b15eeb5e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a new file mode 100644 index 0000000000000000000000000000000000000000..972de6e8360f21c3aab27bdd3fa378a09fe08ff9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a new file mode 100644 index 0000000000000000000000000000000000000000..cca1b802b8e898cb27ad2429288a854c823daf10 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a new file mode 100644 index 0000000000000000000000000000000000000000..de73a8b63d5e77be1a57dea88e67adc56dd87a53 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a new file mode 100644 index 0000000000000000000000000000000000000000..4e054e2333c7c02a5b5fe1a9d42396bc3956c003 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a new file mode 100644 index 0000000000000000000000000000000000000000..d5573c434b6158ae881e387987e90743bb404aad Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a new file mode 100644 index 0000000000000000000000000000000000000000..927cf9a2a1dc277263c00ad0556b0d84076ae6f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a new file mode 100644 index 0000000000000000000000000000000000000000..fd517c2767a4dd4e3fa666ff523825af1348d61c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a new file mode 100644 index 0000000000000000000000000000000000000000..7c4faa1ad5123625487e5d105483aeab9676a8ea Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a new file mode 100644 index 0000000000000000000000000000000000000000..e78cb6c4efc483cd0a2882b4d8873f01f925bbff Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a new file mode 100644 index 0000000000000000000000000000000000000000..f0b68b86c05ad8cd396c8bbc68328dbd77ef39ef Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..aa9aeb8d7e6723e4a2954e4a8e9b66d5bdca6a91 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a new file mode 100644 index 0000000000000000000000000000000000000000..560f3162316a6c9ff67d2e60fbf5521e78d17c9b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a new file mode 100644 index 0000000000000000000000000000000000000000..cd8228c74c64ce3a2b5a96a40c2a92b81880b826 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap.a new file mode 100644 index 0000000000000000000000000000000000000000..8e19e5165e32e8b31e2eb0523950555ba48c5178 --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap.a @@ -0,0 +1,324 @@ +INPUT( +libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a +libwinapi_onecoreuap-d3d12.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a +libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a +libwinapi_onecoreuap-mf.a +libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a +libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a +libwinapi_onecoreuap-chakra.a +libwinapi_onecoreuap-esent.a +libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a +libwinapi_onecoreuap-hid.a +libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a +libwinapi_onecoreuap-wintrust.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a +libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a +libwinapi_onecoreuap-wldap32.a +libwinapi_onecoreuap-mfreadwrite.a +libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a +libwinapi_onecoreuap-profapi.a +libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a +libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a +libwinapi_onecoreuap-netutils.a +libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a +libwinapi_onecoreuap-bcrypt.a +libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a +libwinapi_onecoreuap-cryptnet.a +libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a +libwinapi_onecoreuap-logoncli.a +libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a +libwinapi_onecoreuap-rpcrt4.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a +libwinapi_onecoreuap-mpr.a +libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a +libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a +libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a +libwinapi_onecoreuap-winhttp.a +libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a +libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a +libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a +libwinapi_onecoreuap-mfplat.a +libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a +libwinapi_onecoreuap-xaudio2_9.a +libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a +libwinapi_onecoreuap-dnsapi.a +libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a +libwinapi_onecoreuap-fltlib.a +libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a +libwinapi_onecoreuap-inkobjcore.a +libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a +libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a +libwinapi_onecoreuap-ncrypt.a +libwinapi_onecoreuap-webservices.a +libwinapi_onecoreuap-crypt32.a +libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a +libwinapi_onecoreuap-coremessaging.a +libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a +libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a +libwinapi_onecoreuap-mswsock.a +libwinapi_onecoreuap-sspicli.a +libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a +libwinapi_onecoreuap-windows.data.pdf.a +libwinapi_onecoreuap-srvcli.a +libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a +libwinapi_onecoreuap-uiautomationcore.a +libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a +libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a +libwinapi_onecoreuap-ws2_32.a +libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a +libwinapi_onecoreuap-dxgi.a +libwinapi_onecoreuap-dfscli.a +libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a +libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a +libwinapi_onecoreuap-urlmon.a +libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a +libwinapi_onecoreuap-authz.a +libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a +libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a +libwinapi_onecoreuap-d2d1.a +libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a +libwinapi_onecoreuap-d3d11.a +libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a +libwinapi_onecoreuap-wkscli.a +libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a +libwinapi_onecoreuap-mfsensorgroup.a +libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a +libwinapi_onecoreuap-hrtfapo.a +libwinapi_onecoreuap-rometadata.a +libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a +libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a +libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a +libwinapi_onecoreuap-oleaut32.a +libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a +libwinapi_onecoreuap-cryptbase.a +libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a +libwinapi_onecoreuap-xmllite.a +libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a +libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a +libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a +libwinapi_onecoreuap-cabinet.a +libwinapi_onecoreuap-userenv.a +libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a +libwinapi_onecoreuap-windowscodecs.a +libwinapi_onecoreuap-schedcli.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a +libwinapi_onecoreuap-wpprecorderum.a +libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a +libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a +libwinapi_onecoreuap-deviceaccess.a +libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a +libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a +libwinapi_onecoreuap-tokenbinding.a +libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a +libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a +libwinapi_onecoreuap-msajapi.a +libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a +libwinapi_onecoreuap-dsparse.a +libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a +libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a +libwinapi_onecoreuap-d3dcompiler_47.a +libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a +libwinapi_onecoreuap-samcli.a +libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a +libwinapi_onecoreuap-dhcpcsvc.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a +libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a +libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a +libwinapi_onecoreuap-dwrite.a +libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a +libwinapi_onecoreuap-iphlpapi.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a +libwinapi_onecoreuap-propsys.a +libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a +libwinapi_onecoreuap-wlanapi.a +libwinapi_onecoreuap-mmdevapi.a +libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a +libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a +libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a +libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a +libwinapi_onecoreuap-dhcpcsvc6.a +libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a +libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a +libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a +libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a +libwinapi_onecoreuap-ntdll.a +libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a +libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a +libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a +libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a +libwinapi_onecoreuap-windows.networking.a +libwinapi_onecoreuap-powrprof.a +libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a +libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a +libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a +libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a +libwinapi_onecoreuap-dsrole.a +libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a +libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a +libwinapi_onecoreuap-websocket.a +libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..d5fdc1da0aea73d774d3cc17b6bfe39853db1ceb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a new file mode 100644 index 0000000000000000000000000000000000000000..1fab811276c0a813318d4c770048db19b63d2976 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a new file mode 100644 index 0000000000000000000000000000000000000000..09acba71749fda4e7e13b9864c6a4b31e48f36dc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a new file mode 100644 index 0000000000000000000000000000000000000000..641f77b518482937b9bf667963c7e300114e0511 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a new file mode 100644 index 0000000000000000000000000000000000000000..edee55c0be745710f327f3f640888755b294f0e1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a new file mode 100644 index 0000000000000000000000000000000000000000..73dc282ca4e904a38e2a2b280c34037f9854808c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a new file mode 100644 index 0000000000000000000000000000000000000000..2785192d31d21ee4af76506eece7860b876eb96d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a new file mode 100644 index 0000000000000000000000000000000000000000..a8adedc1467461938a8c484480f8bb79668011f8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a new file mode 100644 index 0000000000000000000000000000000000000000..29a649c94e0cc69e7a0bc722385e0fd8afda4572 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a new file mode 100644 index 0000000000000000000000000000000000000000..ded06ded0fca459f04c9f678cdf80a24baf60947 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a new file mode 100644 index 0000000000000000000000000000000000000000..b6a50005bfff7dbf633a39b39b1e452efbf9e253 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a new file mode 100644 index 0000000000000000000000000000000000000000..e3cffbcafcf5c3aba7b9a409f6d04360fbfe8441 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a new file mode 100644 index 0000000000000000000000000000000000000000..c5038ac1b9b64ad2270a843367e9f46cc031abcf Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a new file mode 100644 index 0000000000000000000000000000000000000000..a987556d29f424340ec9a7759cd9e310e2a70c82 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a new file mode 100644 index 0000000000000000000000000000000000000000..49f6a39d3b848ca19d146665e2419ad74baaf2db Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..8370d6a4cdf345337dc47faabe66933b9c0dda1f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a new file mode 100644 index 0000000000000000000000000000000000000000..6bb7fe4adcd32e5801f4ec77500843ed608c7d84 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a new file mode 100644 index 0000000000000000000000000000000000000000..44fbc7801a20254126afab735426f7b76aba921e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a new file mode 100644 index 0000000000000000000000000000000000000000..d3782543d3f009cff892138463b3435a70b19e98 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a new file mode 100644 index 0000000000000000000000000000000000000000..bd9e367ba19ea1913d52ba85f99ffe0733fee78a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a new file mode 100644 index 0000000000000000000000000000000000000000..5f361602a50d0eb28d9fd59851295225a98f995d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a new file mode 100644 index 0000000000000000000000000000000000000000..af61a3a174455b7bf4a8a4519552a99211578091 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a new file mode 100644 index 0000000000000000000000000000000000000000..2d1f9c1f97254639ef239f7a5343acf6c9ee55fb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a new file mode 100644 index 0000000000000000000000000000000000000000..fc53fd233756256dca3ecc85093d98d97890ac00 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a new file mode 100644 index 0000000000000000000000000000000000000000..cc44364a3d611d8454f4fcfaa538bd95b78ecffc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a new file mode 100644 index 0000000000000000000000000000000000000000..246ce3ba8af45c2c3b7c808336de7ed91d768e03 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a new file mode 100644 index 0000000000000000000000000000000000000000..208fe4e2e31fb5130b3de7d49f16622147beb96f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a new file mode 100644 index 0000000000000000000000000000000000000000..2486aac745881167205640be078301098fdb7ff1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a new file mode 100644 index 0000000000000000000000000000000000000000..37922ca6db352bbec7e9555e5326361e965e4a56 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a new file mode 100644 index 0000000000000000000000000000000000000000..9ffb0e7ba0f62b6775910fb24f5c3c170839d3f2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a new file mode 100644 index 0000000000000000000000000000000000000000..5e36466c9bad01ee4d966496e6196f1890b8a55c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a new file mode 100644 index 0000000000000000000000000000000000000000..78d09429d05ba3666f4e9988d5eff26463653e94 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..f13249d273d81bd79e785b512fbe751be5564bb3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a new file mode 100644 index 0000000000000000000000000000000000000000..82aec5e7f0a201f239a053c6f3727ba7d8a989af Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel.a new file mode 100644 index 0000000000000000000000000000000000000000..a412d18132e5366cfa70ab5f4f0d7455c1420003 --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel.a @@ -0,0 +1,36 @@ +INPUT( +libwinapi_onecoreuap_downlevel-advapi32.a +libwinapi_onecoreuap_downlevel-version.a +libwinapi_onecoreuap_downlevel-winspool.a +libwinapi_onecoreuap_downlevel-shell32.a +libwinapi_onecoreuap_downlevel-xinput1_4.a +libwinapi_onecoreuap_downlevel-tdh.a +libwinapi_onecoreuap_downlevel-msi.a +libwinapi_onecoreuap_downlevel-winmm.a +libwinapi_onecoreuap_downlevel-oleaut32.a +libwinapi_onecoreuap_downlevel-d3d10.a +libwinapi_onecoreuap_downlevel-setupapi.a +libwinapi_onecoreuap_downlevel-psapi.a +libwinapi_onecoreuap_downlevel-oleacc.a +libwinapi_onecoreuap_downlevel-rstrtmgr.a +libwinapi_onecoreuap_downlevel-resutils.a +libwinapi_onecoreuap_downlevel-apphelp.a +libwinapi_onecoreuap_downlevel-comctl32.a +libwinapi_onecoreuap_downlevel-user32.a +libwinapi_onecoreuap_downlevel-newdev.a +libwinapi_onecoreuap_downlevel-d3dx10_47.a +libwinapi_onecoreuap_downlevel-shlwapi.a +libwinapi_onecoreuap_downlevel-uxtheme.a +libwinapi_onecoreuap_downlevel-wtsapi32.a +libwinapi_onecoreuap_downlevel-ole32.a +libwinapi_onecoreuap_downlevel-oledlg.a +libwinapi_onecoreuap_downlevel-secur32.a +libwinapi_onecoreuap_downlevel-d3d9.a +libwinapi_onecoreuap_downlevel-pdh.a +libwinapi_onecoreuap_downlevel-comdlg32.a +libwinapi_onecoreuap_downlevel-input.a +libwinapi_onecoreuap_downlevel-difxapi.a +libwinapi_onecoreuap_downlevel-kernel32.a +libwinapi_onecoreuap_downlevel-twinapi.a +libwinapi_onecoreuap_downlevel-gdi32.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opengl32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opengl32.a new file mode 100644 index 0000000000000000000000000000000000000000..ffc45dc7fdc8a8933fbaf926b40ea8142d192265 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opengl32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opmxbox.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opmxbox.a new file mode 100644 index 0000000000000000000000000000000000000000..c88f52ee0fa601462644821cd93f52999038fb02 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opmxbox.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2p.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2p.a new file mode 100644 index 0000000000000000000000000000000000000000..9daf2588776f87992490a9a5d8c08e93e011f318 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2p.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2pgraph.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2pgraph.a new file mode 100644 index 0000000000000000000000000000000000000000..38235cd5f76180f76b302751822d6eb6b57b3e28 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2pgraph.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pathcch.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pathcch.a new file mode 100644 index 0000000000000000000000000000000000000000..75520ffe0576b48810637abe9e63167d1173cc66 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pathcch.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pdh.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pdh.a new file mode 100644 index 0000000000000000000000000000000000000000..1cd6167d1b93e9cc2626ef3b1098585180c50cd6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pdh.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_peerdist.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_peerdist.a new file mode 100644 index 0000000000000000000000000000000000000000..7469347b93564a512bbabfb587cb3efe65a6a499 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_peerdist.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_powrprof.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_powrprof.a new file mode 100644 index 0000000000000000000000000000000000000000..31e03e4cb9f0430cba3d65e17ef31189f85e831e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_powrprof.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_prntvpt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_prntvpt.a new file mode 100644 index 0000000000000000000000000000000000000000..f4f187e3d4416f191e0eadaf2d58beb836accb1a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_prntvpt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_propsys.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_propsys.a new file mode 100644 index 0000000000000000000000000000000000000000..995c244cb8dbc142b7829a2291d4fe9b0c4a0232 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_propsys.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_psapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_psapi.a new file mode 100644 index 0000000000000000000000000000000000000000..faaf0c4b0a513b653ed5e588fe49c4f74fdaec00 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_psapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_quartz.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_quartz.a new file mode 100644 index 0000000000000000000000000000000000000000..062b1b2c007888fa686bd1de025164ce5505859d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_quartz.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_query.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_query.a new file mode 100644 index 0000000000000000000000000000000000000000..24c36813da4b2e87662717de319dff0b6fddde22 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_query.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_qwave.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_qwave.a new file mode 100644 index 0000000000000000000000000000000000000000..e61f5dc9f3be6fe082abf323505a02eb48af6737 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_qwave.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..580468f798486b1d91417e96091f573e55aa2afa Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasdlg.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasdlg.a new file mode 100644 index 0000000000000000000000000000000000000000..c1ae17924cec37eaabfdc2fda318a9694083037c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasdlg.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_resutils.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_resutils.a new file mode 100644 index 0000000000000000000000000000000000000000..9817f08e5d5c3c6c51d9bdc37215101d596d5d93 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_resutils.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rometadata.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rometadata.a new file mode 100644 index 0000000000000000000000000000000000000000..95487014ca6c97d9db8b89009b3a96b3e3b4b7ea Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rometadata.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcexts.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcexts.a new file mode 100644 index 0000000000000000000000000000000000000000..1de9056e957bd85780c08dee8ab5d91b3dd53b04 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcexts.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcns4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcns4.a new file mode 100644 index 0000000000000000000000000000000000000000..f65bfa0e5578d798a942dd1b177942e0c8c59839 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcns4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcproxy.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcproxy.a new file mode 100644 index 0000000000000000000000000000000000000000..ed10fc6c6d4cb26a4487903feef41ff51fb3deb2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcproxy.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcrt4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..1c275df7fa8ba0195e3a5ce74884bef25cbd9da5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rstrtmgr.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rstrtmgr.a new file mode 100644 index 0000000000000000000000000000000000000000..b13b6d219ac497716766c501e57e67aa16a7e34c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rstrtmgr.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtm.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtm.a new file mode 100644 index 0000000000000000000000000000000000000000..818088fb5e9122365d0dadc0c65fc0c33943e934 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtm.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtutils.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtutils.a new file mode 100644 index 0000000000000000000000000000000000000000..c98f447a300eb57192813f218e4fcd439b0a4c79 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtutils.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtworkq.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtworkq.a new file mode 100644 index 0000000000000000000000000000000000000000..4b5f7ee8c511d025db3325db4f6b36c56557ffa6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtworkq.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1801c6705c0135106181a605524088ab4edd84db Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..da5c0652e21aaacaaed183f547ca96eba5c7b390 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3a96659eabe2fcfb491d7c2730854c2485d10d27 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5c961d18eb527fcb808dc1ed1b4d810694460f33 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5b8da42faae5d662f7507c839e9a35acebeaeeda Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..53f6fe0ed9a177a1d36c99d9d61f7af5c9e2090b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d689c065d33bae7ae7706abeec7beac67e010a88 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..79b665b9b7998aa5a7f2ebb928ccddb32c80b332 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject.a new file mode 100644 index 0000000000000000000000000000000000000000..bf368a20f1f29f8f93ec1887566d1d16be334c1b --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject.a @@ -0,0 +1,10 @@ +INPUT( +libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a +libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a +libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samlib.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samlib.a new file mode 100644 index 0000000000000000000000000000000000000000..b9525b0c6eb6fac73d04feff984ee481d8910c33 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samlib.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samsrv.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samsrv.a new file mode 100644 index 0000000000000000000000000000000000000000..478283872451922bfaa31b13b7f53d8b8f8b3b3f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samsrv.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sas.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sas.a new file mode 100644 index 0000000000000000000000000000000000000000..54259657209ce1a29f42c4daeba3a7051ae0322f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sas.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scarddlg.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scarddlg.a new file mode 100644 index 0000000000000000000000000000000000000000..acf33106cda029a12a878066c9ae916ea6a4b08f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scarddlg.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scecli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scecli.a new file mode 100644 index 0000000000000000000000000000000000000000..5811d572533d1a2c33894e87a83a45363d68f517 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scecli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scesrv.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scesrv.a new file mode 100644 index 0000000000000000000000000000000000000000..909f4b99e765d167af2a7b957734e6a0e1882a3f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scesrv.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_schannel.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_schannel.a new file mode 100644 index 0000000000000000000000000000000000000000..aea8ed1f2d08177adb60eb3b790bd1c345e35ec9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_schannel.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_secur32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_secur32.a new file mode 100644 index 0000000000000000000000000000000000000000..e6c8ad803577998bb11a489cf1179a00ec914f9a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_secur32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_security.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_security.a new file mode 100644 index 0000000000000000000000000000000000000000..6544213f7c43be3a143d8945533eb38af19d098f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_security.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sens.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sens.a new file mode 100644 index 0000000000000000000000000000000000000000..17a72cb5fcf2624dbf2b1dbee6a125970f378f84 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sens.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensapi.a new file mode 100644 index 0000000000000000000000000000000000000000..93cf942dd4d284481de68cce941b3e6a042aa43d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensorsutils.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensorsutils.a new file mode 100644 index 0000000000000000000000000000000000000000..4f86fa7c18d652224dc62b30d90a20cd41fec6f4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensorsutils.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_setupapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_setupapi.a new file mode 100644 index 0000000000000000000000000000000000000000..1d657d512781970aafc5f1e8201f1e4fb10165f0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_setupapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sfc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sfc.a new file mode 100644 index 0000000000000000000000000000000000000000..b4fc6a6cf6c87bd50268caab2e07c5b3ab276aa6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sfc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a4e75b9db94e3aed9a2f511a1cf1b1372b628046 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c4b902bfd3ae45236836a54ad698f3e1151976ed Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1925c13d0faac63b843b9036ca99a7e36df902b0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..7c1f77ba65ac19585b90111d75f605b449f519ed Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..3f53c733e2362c4b6bf8343694cdd01a294a7b5a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..47c152cdec43e5bfcb5806bf33c314058984aacc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore.a new file mode 100644 index 0000000000000000000000000000000000000000..2c5f78672f2e14ba3e8b8d68de2748f1bdad7ad2 --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore.a @@ -0,0 +1,8 @@ +INPUT( +libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a +libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a +libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a +libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a +libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a +libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shdocvw.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shdocvw.a new file mode 100644 index 0000000000000000000000000000000000000000..5d8cad8a11a0350a9b7d742b4f29d2823d156742 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shdocvw.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shell32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shell32.a new file mode 100644 index 0000000000000000000000000000000000000000..98cf7d259cef4853f83710f093f2cd19cd5c44d9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shell32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shfolder.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shfolder.a new file mode 100644 index 0000000000000000000000000000000000000000..326fefdd05156fe44cb182c98dbe1a2260474fbf Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shfolder.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shlwapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shlwapi.a new file mode 100644 index 0000000000000000000000000000000000000000..30656c1189736b491fffef159bd18170e669ed61 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shlwapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slc.a new file mode 100644 index 0000000000000000000000000000000000000000..1e636724f39f6e5eb91d384d35725edf8370c091 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slcext.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slcext.a new file mode 100644 index 0000000000000000000000000000000000000000..5865ad6bf2800a8ed452b2c903f628f066b53fdc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slcext.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slwga.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slwga.a new file mode 100644 index 0000000000000000000000000000000000000000..eeed243ba6a25cb86449834ebb128035d05a1b7c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slwga.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_snmpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_snmpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..38258ee3de437c6329065d4a0a45281420ed038f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_snmpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_spoolss.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_spoolss.a new file mode 100644 index 0000000000000000000000000000000000000000..95ed86048b0203714913f0f31b4751bacb04239a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_spoolss.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sporder.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sporder.a new file mode 100644 index 0000000000000000000000000000000000000000..3383fe39593907688aa22ecebaf32611a0f9d1d2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sporder.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_srpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_srpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..8de830f22b278111d3363fd4a89ef0f7d7c1f5ce Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_srpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ssdpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ssdpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..7d267809e64a7b225d434dec790fe07ad92323f4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ssdpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sti.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sti.a new file mode 100644 index 0000000000000000000000000000000000000000..03201e9699b7390d17bd2066fc314c161618515a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sti.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_swdevice.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_swdevice.a new file mode 100644 index 0000000000000000000000000000000000000000..793ba3a53fdce1ac990798cefed3b47f8016fefd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_swdevice.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_synchronization.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_synchronization.a new file mode 100644 index 0000000000000000000000000000000000000000..4e3b2af68b44c32560860afc7aeb1e2a8f40daa4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_synchronization.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_t2embed.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_t2embed.a new file mode 100644 index 0000000000000000000000000000000000000000..1c44954ed665b9c241c0ca61ed703cfac8cf2443 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_t2embed.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..558700280f3c15fe1e813a55aa96f2dfb347683b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tbs.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tbs.a new file mode 100644 index 0000000000000000000000000000000000000000..11a57b55813c3d190f0497a77afd5dc13c9da412 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tbs.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tdh.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tdh.a new file mode 100644 index 0000000000000000000000000000000000000000..2dc5dc9b2b1171ff0dcd6f49ddf4315dc8bcb87e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tdh.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tokenbinding.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tokenbinding.a new file mode 100644 index 0000000000000000000000000000000000000000..883b23175c1366cbe8641857b009507b5ee933fb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tokenbinding.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_traffic.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_traffic.a new file mode 100644 index 0000000000000000000000000000000000000000..a1bb1674f6ae68b64b668e99de0d21d1963e795b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_traffic.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tsec.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tsec.a new file mode 100644 index 0000000000000000000000000000000000000000..a0257340f851e01bfa1339205d6c5a7584945c08 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tsec.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_txfw32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_txfw32.a new file mode 100644 index 0000000000000000000000000000000000000000..097b8e4d26a881ffbb0b6635be8e8251506b8006 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_txfw32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ualapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ualapi.a new file mode 100644 index 0000000000000000000000000000000000000000..a97b24cc77c12c7e54ca1cbeec70ab062d15cbb8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ualapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uiautomationcore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uiautomationcore.a new file mode 100644 index 0000000000000000000000000000000000000000..fa32a1c45574b445ba12e5918aa856fc1f870294 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uiautomationcore.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_umpdddi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_umpdddi.a new file mode 100644 index 0000000000000000000000000000000000000000..36cbb19b2dfc636d6c350594d2693f88d1a42d49 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_umpdddi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_urlmon.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_urlmon.a new file mode 100644 index 0000000000000000000000000000000000000000..060ebc5f8364a474978756a3e5c8bc26805b8b08 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_urlmon.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_user32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_user32.a new file mode 100644 index 0000000000000000000000000000000000000000..63ce1cd93c2af826287596f1b62bd4708c0673b4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_user32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_userenv.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_userenv.a new file mode 100644 index 0000000000000000000000000000000000000000..354fdd7cefb5b29ed19c951dc5e7c28daea92d8b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_userenv.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_usp10.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_usp10.a new file mode 100644 index 0000000000000000000000000000000000000000..bd0e21c965a7058582109ef751c077efad355887 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_usp10.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uxtheme.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uxtheme.a new file mode 100644 index 0000000000000000000000000000000000000000..fc162f2375c6a4bf256e30f6a4f4fbc537f4af15 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uxtheme.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_version.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_version.a new file mode 100644 index 0000000000000000000000000000000000000000..634cf670c1a656d6fe36d3ff6628d9f4c7f53a73 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_version.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vertdll.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vertdll.a new file mode 100644 index 0000000000000000000000000000000000000000..7b1ca446b3d81f60330added8c639270e92667a6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vertdll.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a new file mode 100644 index 0000000000000000000000000000000000000000..7d346d9d92facd9e79b76b53488bf7d7ede979a3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a new file mode 100644 index 0000000000000000000000000000000000000000..169484edc7e83e57a527b0ea6002b7fa84cf9ad9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a new file mode 100644 index 0000000000000000000000000000000000000000..27f29f58e9f04cfa419a46a0d3fe3be9b0a3b81b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32.a new file mode 100644 index 0000000000000000000000000000000000000000..4ee8733361c0dba78487aef54adcd19db78b9f4a --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32.a @@ -0,0 +1,5 @@ +INPUT( +libwinapi_vfw32-msvfw32.a +libwinapi_vfw32-avicap32.a +libwinapi_vfw32-avifil32.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_virtdisk.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_virtdisk.a new file mode 100644 index 0000000000000000000000000000000000000000..e2da0b6671cd79e5764701ee5a57d1aa5d5bca25 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_virtdisk.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vssapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vssapi.a new file mode 100644 index 0000000000000000000000000000000000000000..c3ee9a6a9097fea39761246e70c44802a6d41f8a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vssapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wcmapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wcmapi.a new file mode 100644 index 0000000000000000000000000000000000000000..829682c3fd33b91fe6b0ce161e51a53085a0c4bb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wcmapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsbp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsbp.a new file mode 100644 index 0000000000000000000000000000000000000000..d62c5d111a850e7b0df41a49e4045b5ed06479c2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsbp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsclientapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsclientapi.a new file mode 100644 index 0000000000000000000000000000000000000000..24475656ff2cc9d66bbeb9566f4e315534fb78e1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsclientapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsmc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsmc.a new file mode 100644 index 0000000000000000000000000000000000000000..e869d40185e1470514603571e036097e7ce97090 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsmc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdspxe.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdspxe.a new file mode 100644 index 0000000000000000000000000000000000000000..67e2f2d2658c08b4309b47502da0e081706d483b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdspxe.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdstptc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdstptc.a new file mode 100644 index 0000000000000000000000000000000000000000..f0e2dd98d88adb9113964b9fde537961222990f4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdstptc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_webservices.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_webservices.a new file mode 100644 index 0000000000000000000000000000000000000000..dbb557b99cab805ab32dd4c4c0f03b1cd5de45a0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_webservices.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_websocket.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_websocket.a new file mode 100644 index 0000000000000000000000000000000000000000..3db218f6901c030232ca5db9063cdfa2db362c58 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_websocket.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wecapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wecapi.a new file mode 100644 index 0000000000000000000000000000000000000000..77817cce40aba413664401be8bf456f87f6ac265 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wecapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wer.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wer.a new file mode 100644 index 0000000000000000000000000000000000000000..24f470aaa2383344bcc935f80c531a5adb32a866 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wer.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wevtapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wevtapi.a new file mode 100644 index 0000000000000000000000000000000000000000..f6b9852b9b61a23b83baeee758009fd18afa035a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wevtapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wiaservc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wiaservc.a new file mode 100644 index 0000000000000000000000000000000000000000..0328e92019875625eed0d3b7971c528310db4008 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wiaservc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winbio.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winbio.a new file mode 100644 index 0000000000000000000000000000000000000000..392c61548101557cefe747ee7178f2a777319a76 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winbio.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a new file mode 100644 index 0000000000000000000000000000000000000000..d23124b34ee34c7a7f7a7f4c83b3fc5e1dcea7ad Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.networking.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.networking.a new file mode 100644 index 0000000000000000000000000000000000000000..24ee9664707ddbed66f7b9ca7ea89210c5274a62 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.networking.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.ui.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.ui.a new file mode 100644 index 0000000000000000000000000000000000000000..594416df0057c3fc988d1955c05f20b55f40eeda Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.ui.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..376dc934b1cf8ee11d0fe6cd721602bbde47899b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4fb57229eb6b1b65d0705cbabe72a8e099ec8a65 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7f91042386f9f8763ef555d72a8a1daaf393802e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8dcb2257d9187b77a27b4077c2206c85e02e645f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..667c2d288b8877ed460d3c1c65592788252673bc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..16d7f6e2232a43775507dfb37542777f1fb1877b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e8e919bdbb6757260613f52f5e0ede0bd5c47dd6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..c197afecce4244e8303eb9f51b2167a8179b4de6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7b0609a2a8d91c9f46b159c6201265a885f3b8bd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..cf05f2bbded5ced68ed74bd1604bffa98420a9d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..76347e732828fa800d83da425d1c67b42b2f1137 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..57cef70375c96ad7b6ac379baebacb2fc9863706 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f540772648625623718386380d566bf153a21bb5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f56e67f7828bcf550e595cac3ab928e418a314fd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..816e82ff6b8104058dc3448beaf052edca217678 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..04311d4a3300c258e51dfb22340766dc35fc3720 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..85a80d3043f6423a34925db83789bb1d2ec677ad Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..c4248e6bc82185971545c030e72793bdb3a8335a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..fa7974e2468dadae8e5243f350189b0de5578c9b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f6ba05e49fba5f17fa9bc973ca2f5dedc03e96cd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..330cc42e5df4c0085c482b6517285f4f72568136 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..70c994fb31de55a27867d2e9d9acc7a21fcf682a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..5f69666abe390c147bd1b56625b8677d83c7e9f4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e51c23bfe8a0913c24820adae90b8c431759a74a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..4f5a52f24221794e558da093fd520e09588d8abb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..436bf76f382b1e4c554202ad64b8b5da132eaaba Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b7549f8ee46f1f57e137f9d809de358ed9a1bb51 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..af7bed7d323bf3d85e3eaad8c1d3fb81a88a4bf1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..c05ebeb81d5ff744a6bf47d78815082dfa7a709d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..aa87bb85c52aab17c0283324119e013395cd7d98 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..af5188d617324b820d10423c133396af044b5d65 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..b030a9e96dc2f305a7fc6e5a7a714d6fff5666ba Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6b25481df09438796a90360b9c65b049be39286b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0cd981eb345162712a024305ff9df52d7bcf44c1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8a8c4decf52e215a6b6f6c4757c9f4a24bdb8f03 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..aae89c55454ec02abf2fb0fcfce486543a2bb790 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..25055ffd2ff21396a96e7f1a28b46f5d31890042 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d1e7cbf58e926b5898ea0ebd46439236b5f3ca8e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9f25dbf96135321bb4218ad6db02a99fb305d21c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..fd60dbdf1894cf8fc5e9f64c8e6a2b0a2efe3898 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..d25acbe0d151b3f200b4b478da3ca9546ae4a22c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1c07faeb5930dbd74d284286668bf18c18fb65df Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..58ae12d9c940917c9fb589df99e417667b201ac5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..05f0e1e415fb63f69f534e11e75deded50a84964 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0af2c3890dd532c4ab59599a69354b9450aa91e0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..42d1bd6745729e47034f83f8dd01d3f85339349f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..aebd13d6e4c04f80de658fb8710496b227894800 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ddd7680c33b7affe83e52b82ccf23438658ec131 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..03396118c163fba3fd44f30221b5318282a3b46b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..805324866dc38946922e57ff034c6a50e1d58ec9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6bcde9268a11bfbbcd871087db5886902ea250ab Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..080203d4cec2bd4ff5187ab0140d059ba9930623 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..0eabec9ce5754d3012f7b29b4a03c94da55879de Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..121bf61ca1e917daad0f6b4c5006f6d80881f5c6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..f620651e257e7f9d0d0225512284fb161c27e965 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..9b112fc9ab312cbaca92ebbf6c1fe8164cd797c9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..cf45466d72b25e94fbcdfc1d4278dc5c8dd28995 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..04822e149c6a5ba345698a65bbbaef1a4ca761ab Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..a63de1481f0ad0eeb917c5730ee22e5fd8e07710 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 0000000000000000000000000000000000000000..05741b0f66ad7ee20404920e4a9a4565acc15d65 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f29fc1aeb5b14acd58504b78c66cd894f3fabcb1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..14da17ea5ad7e16498d89ea8f7e1d7f1832d9f30 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2446d347997a4d89110b056563f5091c032d3661 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1767c2f043e9824a4a0c402e314f14e84dcd949b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7bcf4de975c5d89389ad338b4daefb1d41518ca8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0ef867096d23f995c0697ad38625f84f5d3deaa3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..8e3594c51485869cc73b9d07846aa6380f932c9f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..e885e26d804994554f1eac1eab7619bf29f50229 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..4a68e2e17ec7d9f46660683554e6690342136e8d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0b44ad2473e7c81a05a441de6860709811248696 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..367a07ac4bdc2067dad65167096d910e069815e4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ac268c6a44b937397c4525589813f11b7f821ec2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6cbeeffbecc5515f31bec71bd56a4854ab70990e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..371a4c7dd689a4e836dec09708facf734e9bad9e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5bf499972bfd50c73a9fa681f17213818bdc8575 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..11ddaa64428d148f8e3a5140231dfa313449ef73 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..e93a81ca8f0022566953d4293dfa6a98fbdc39c0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f36978948e3d3f798117ffc6b94795b287f6ad56 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..42b61dfae4b557cdd1a09bb505a91b764a459a9a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..698ddaddbd621b947a0c28ddf22c4be24f8db50b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0ef6bbfba36121ee46f4b285f36e793de5669480 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..070964696469a0b21af905b88bdeb2a3a383d146 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b268543c77a143c215c6197c65bcac14827f689b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..e789bba166329f639f094343ee528bde2299f3f2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..80f9c9cb76e5cea94a5e3e607610cdf2a936f3df Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2fcf88567702b0ab32e6f75c65b37a9933756a4c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 0000000000000000000000000000000000000000..03d507f8f95b3e4328e3b31fc2e812d9dfcf2de2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e20a3b80c256a598202fe069e1c6685e01000ea1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a94e2d0f6c4c090c42d8b12b56849f91641f8786 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0f9d699462cadc8696e77e135580e59e426915eb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8279d72014b11daee0448a39026f495da1831d0f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f34b40a2b9fcb1331fca5ef4d0ad8dfd869ec621 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..fa6483ca09b736afb071b5954ea756bd11aed0b9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1507037cf2ae2b90ea29c66f9a0b1b01dc85b7f5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..febb56731e6b363c757ae860cc940fe4a26c45a2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..6499d7d6ee8582ad6a61f9ba471cee991852e9a1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..fb9c0d43b3437ac9b349c94feb20638e22e256c6 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..8f1751fbfd6da3bdb351006f0a864eef7b24e3ac Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..25a56ca7044f1d123fedad9576fe2d6350579a42 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ab32b872c749800421662a45efa89cf4b666b2ad Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0a0cfad05234ba335fea5a78e05d2768ad420998 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..469de78c22de8e14bd4b17d955f9741fe9bae00f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b8f36b0cf1c7b56f819d8e7c8f5f5374c99159eb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4acaa7d65e84f1c95ebc6288cad266b851cf6c70 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..0cf2878acc55d9ada3443db0bc7ec16a083103a1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3384e15602cefb7be4a656ae2a9ef7b1576e316e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f4f0e8be09ba367689c6fbba6e89d7b063b86b80 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..1368f89b7bb1ab8161886a527b6468e4fd59ce06 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7d03ec5d120081ce65bfa0ea1e99f1fc8acc5870 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3ba774b68f571096cd16f625316eb0b87996e77f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..673e82cb9f23255e4222c69882dabe8620e34916 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..7d08bb6977881ff91718cb6a3be85ee8fa5c7eb0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4c85c1f46519b945c208823920321d5984662d3e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..54f72382d0271374e83717d6f2b1fcf30256b799 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..616a29d6ef71e06417db73149c0464076e0cc0c7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..601f05a50f8e46043f6a12eac0a15d64d01a5c62 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..ca1e9b8de96f26c9b2751f5694c9a80052550626 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..117874faa971e5f4aa406e69e8e38f956502b444 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..694a4092f030276df271cf7c8d0333fcaf6d1d87 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a new file mode 100644 index 0000000000000000000000000000000000000000..7eef865259116949793ac258b404aca0b9fc7266 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..6b3d0c62d7d41b04598941aff419d0926628f690 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..62581e48defa78521134acc26a4b8e74e3e1003f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..be5df7e47c4efaa9bcff03dac56b35b1238962d1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 0000000000000000000000000000000000000000..3f7c7fbae9f0451a12275e8d1aee1307e31d2c13 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..70fd9fc94b44cb007ca9ad063178249dca14de69 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3c8658c455422cc8f65016370d3096621b513149 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..f24a5299975ddf9bdcfa010420de6bc17360923c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..46c5f2f17ff8e5082297ccd3f7fc67b1cd9920d5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..4d5c84bd65f66e284a7b036fcc5d6eb1182f9e16 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..5124e6019b2bbeb8dc8488ffbb61aacbef45b966 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2a4cf7835bb49f3968bc02ee618b5c4cec880259 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..e2a7cc44d70642edc07733a45a94d7d178961dfd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..a75e822db5f7239bea1cb15b5c5e07aaffc7150f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..2a6a511dba5d8df2844bf85a5e021a0731c9d5f7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..e320391c086648e61d398a1026624c82dc74fb46 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a new file mode 100644 index 0000000000000000000000000000000000000000..7ac6d0b05d15e9265c027672f6d541483d22062f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a new file mode 100644 index 0000000000000000000000000000000000000000..dcff55abc8ec29f4fcc68c75d0ffa19ffcce5611 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a new file mode 100644 index 0000000000000000000000000000000000000000..e6c125e8d98213f9c8a76d8a53cbd0d4dee48cae Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a new file mode 100644 index 0000000000000000000000000000000000000000..711f95bf47cfee8d314af23bb309d6c401eac9ba Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a new file mode 100644 index 0000000000000000000000000000000000000000..01871914180b158ff261e1e099bff3e832175660 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a new file mode 100644 index 0000000000000000000000000000000000000000..983d997823f68af8aa3c4aff6077078e75317429 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a new file mode 100644 index 0000000000000000000000000000000000000000..675d1569d97066f364bbfbe1d220f649d8a8f384 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a new file mode 100644 index 0000000000000000000000000000000000000000..0cfcf385faaa773fd5b6622a178b5f32c4a34fda Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..19e57e18c18e75c8231b825a0c24646db1b48de2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a new file mode 100644 index 0000000000000000000000000000000000000000..acf659f93945237fef953592b66576b03e93c151 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..242e438057fbd4584d857c1bb3f19ab286f42252 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a new file mode 100644 index 0000000000000000000000000000000000000000..c0dc910fc7f5481773570393c2791388fb2a8442 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a new file mode 100644 index 0000000000000000000000000000000000000000..660716933f3eb4c9fcdde3ab69ebea755dc1b9ae Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..3e22034427aed22db6e216171c03434bd981f8bc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..b06b03e4bfc79598d06e7147f0c86a0f491725ec Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..ea046a48c721a01c18aa90004eb3c5a195e60f47 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a new file mode 100644 index 0000000000000000000000000000000000000000..bbfb183d69cafdf276ef5d7a5ab1ca75cf903e0b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a new file mode 100644 index 0000000000000000000000000000000000000000..6bcc88188a14008a84cc0a5782195c04a7288f92 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a new file mode 100644 index 0000000000000000000000000000000000000000..e8c2809325824d047bdc6ca9c672e1baa9f9309e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a new file mode 100644 index 0000000000000000000000000000000000000000..a629a8cbcc559d0a55f8f502bb62c981a5dc2838 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a new file mode 100644 index 0000000000000000000000000000000000000000..82d731bf3a980d39ce178e1a5450a877187fdd9b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a new file mode 100644 index 0000000000000000000000000000000000000000..42d054f6478e08e7a9caf1e390a2cf049a725a48 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a new file mode 100644 index 0000000000000000000000000000000000000000..a484762d5759caf50c7095da2e5ab23903031484 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a new file mode 100644 index 0000000000000000000000000000000000000000..02e07972882f1a99a95d492637d276a67844ab2c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..61f695b7360e4a70dec23f410e51907de35a3eeb Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a new file mode 100644 index 0000000000000000000000000000000000000000..b56d74314468927a7b826cae92b43a767ec35706 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a new file mode 100644 index 0000000000000000000000000000000000000000..a2d7db18e67ffc5e78c12123c65c68a530d7cf12 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a new file mode 100644 index 0000000000000000000000000000000000000000..722445a564d4091cecf666fa607e7685528ef68f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..e26526079725e92e9e3d3fb3f0de9c75eeffeaad Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a new file mode 100644 index 0000000000000000000000000000000000000000..230fd2afb1f34ed5f1d13198bdc0fb256cfa43bc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a new file mode 100644 index 0000000000000000000000000000000000000000..9ab94f4ebbae451146aca9a2185f7558ba026159 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..39e7d2c62772713dfcf68fb91551ba4fb9842fd1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a new file mode 100644 index 0000000000000000000000000000000000000000..bc9642191bb1ef2096dec4be03edb81d75be9eb9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a new file mode 100644 index 0000000000000000000000000000000000000000..8a8eef5812f2afe2483a779e459b8a8eb36104ff Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..ac77cc6d0fb6af42e55c5248dec592246ac1ae4b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a new file mode 100644 index 0000000000000000000000000000000000000000..9760833eeb322bcaf2e8030d51cb962038ea08e7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a new file mode 100644 index 0000000000000000000000000000000000000000..fdc6b996b3a1076191d66c70a0a1dfce8e6ae8c8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a new file mode 100644 index 0000000000000000000000000000000000000000..0a4aad3755e5558bc46e84c887314b2d4aad9d51 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a new file mode 100644 index 0000000000000000000000000000000000000000..4a4442f4b877b7846fdda16da98ca3fa1dcbe40d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a new file mode 100644 index 0000000000000000000000000000000000000000..16ea84ec05e43717d2035548b4ab0991327cecdf Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a new file mode 100644 index 0000000000000000000000000000000000000000..3c383d000f151ac50dd4958dbdad80b62b4eea4b Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a new file mode 100644 index 0000000000000000000000000000000000000000..994c633fce7d5586ada9787ddec21ba8dfd3f4d3 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..81770cab631ce1465d48f113ac8589055a316045 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a new file mode 100644 index 0000000000000000000000000000000000000000..4578472e820642225c672e343fc96ef7a5a7c00e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a new file mode 100644 index 0000000000000000000000000000000000000000..3a8aa60184a46a5a4a901e8767db5288fbd2d705 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp.a new file mode 100644 index 0000000000000000000000000000000000000000..a85aad83110a6396ae9ea221d3b1909104b9d59d --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp.a @@ -0,0 +1,182 @@ +INPUT( +libwinapi_windowsapp-dhcpcsvc6.a +libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a +libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a +libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a +libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a +libwinapi_windowsapp-windowscodecs.a +libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a +libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a +libwinapi_windowsapp-sspicli.a +libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a +libwinapi_windowsapp-urlmon.a +libwinapi_windowsapp-mswsock.a +libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a +libwinapi_windowsapp-ntdll.a +libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a +libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a +libwinapi_windowsapp-ws2_32.a +libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a +libwinapi_windowsapp-dwrite.a +libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a +libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a +libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a +libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a +libwinapi_windowsapp-cabinet.a +libwinapi_windowsapp-oleaut32.a +libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a +libwinapi_windowsapp-d2d1.a +libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a +libwinapi_windowsapp-mfplat.a +libwinapi_windowsapp-ncrypt.a +libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a +libwinapi_windowsapp-d3dcompiler_47.a +libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a +libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a +libwinapi_windowsapp-xmllite.a +libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a +libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a +libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a +libwinapi_windowsapp-mf.a +libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a +libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a +libwinapi_windowsapp-webservices.a +libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a +libwinapi_windowsapp-xaudio2_9.a +libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a +libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a +libwinapi_windowsapp-inkobjcore.a +libwinapi_windowsapp-uiautomationcore.a +libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a +libwinapi_windowsapp-iphlpapi.a +libwinapi_windowsapp-rometadata.a +libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a +libwinapi_windowsapp-rpcrt4.a +libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a +libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a +libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a +libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a +libwinapi_windowsapp-bcrypt.a +libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a +libwinapi_windowsapp-windows.data.pdf.a +libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a +libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a +libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a +libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a +libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a +libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a +libwinapi_windowsapp-d3d12.a +libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a +libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a +libwinapi_windowsapp-d3d11.a +libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a +libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a +libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a +libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a +libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a +libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a +libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a +libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a +libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a +libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a +libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a +libwinapi_windowsapp-hrtfapo.a +libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a +libwinapi_windowsapp-dxgi.a +libwinapi_windowsapp-deviceaccess.a +libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a +libwinapi_windowsapp-msajapi.a +libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a +libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a +libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a +libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a +libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a +libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a +libwinapi_windowsapp-crypt32.a +libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a +libwinapi_windowsapp-mmdevapi.a +libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a +libwinapi_windowsapp-windows.networking.a +libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a +libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a +libwinapi_windowsapp-coremessaging.a +libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a +libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a +libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a +libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a +libwinapi_windowsapp-esent.a +libwinapi_windowsapp-mfsensorgroup.a +libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a +libwinapi_windowsapp-propsys.a +libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a +libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a +libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a +libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a +libwinapi_windowsapp-mfreadwrite.a +libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a +libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a +libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a +libwinapi_windowsapp-dhcpcsvc.a +libwinapi_windowsapp-chakra.a +libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a +libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a +libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..68131012c73ca6903b1f163c93449959ef721170 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 0000000000000000000000000000000000000000..2a07b48d9bd99dbcc8698b60b462a47ed211c11c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..891b09e5966b45cbf01b9b9702a7cea8896621b1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 0000000000000000000000000000000000000000..bf98a4142501ea4331675494ffa1abeb40edaeed Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a new file mode 100644 index 0000000000000000000000000000000000000000..40f0062389af5baf9d774798cd87d29e99120fd5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a new file mode 100644 index 0000000000000000000000000000000000000000..96bc6aa1ed643a83a6c2698122d91f4f09de2227 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a new file mode 100644 index 0000000000000000000000000000000000000000..ddf0ff9ba275170a866ac769cb23cda6217ac311 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a new file mode 100644 index 0000000000000000000000000000000000000000..dc2ef2d484205bd687128932891366f821e01489 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a new file mode 100644 index 0000000000000000000000000000000000000000..6a6ca8944cfaa08db696ff243183a9d1c3b33e42 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..4319f0ae9130b3775ca8ade1f97ee50c2568f02a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a new file mode 100644 index 0000000000000000000000000000000000000000..7350198f7a579b979e483f2ba332f71e6818c8e5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..68a3c24d783117d099a09ca4822495c8e2464c84 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a new file mode 100644 index 0000000000000000000000000000000000000000..4c41bfcdea17e86f612c9162de591599dc050ba8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a new file mode 100644 index 0000000000000000000000000000000000000000..df960f5e662977e5ee9493d8e859298f7f91b71e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a new file mode 100644 index 0000000000000000000000000000000000000000..4818f293140d9407f1edfe012240393e10e853e2 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a new file mode 100644 index 0000000000000000000000000000000000000000..df6d5327fb69c28d1bd6087700282bdd5d5179ec Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a new file mode 100644 index 0000000000000000000000000000000000000000..95a95c6dd29f157de01c88ba44083ef5037d1f06 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a new file mode 100644 index 0000000000000000000000000000000000000000..3b64b76d1c8c9d8bc57ca5e83274bd6acf7cebcd Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a new file mode 100644 index 0000000000000000000000000000000000000000..3af3528b3fa1b39da5d7d4ddf9dbbf3ff4fe2c61 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a new file mode 100644 index 0000000000000000000000000000000000000000..593538e1c5330999cf9c8efaf0956eca598b4317 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a new file mode 100644 index 0000000000000000000000000000000000000000..b220187cd787bcc6481f4ff0cad6cc469d6e2a26 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a new file mode 100644 index 0000000000000000000000000000000000000000..f3dba4ff9bdac2ec0ead39b7c8c9b9ccad1e74ef Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a new file mode 100644 index 0000000000000000000000000000000000000000..3685c4d1d53790a969f79d256ae79cd47412bfd1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a new file mode 100644 index 0000000000000000000000000000000000000000..dfbadd78077d312013e9b8fe71f51426e9b5a242 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a new file mode 100644 index 0000000000000000000000000000000000000000..f6ca5724c9dc702484e4aa8b24525ac43e006e0e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a new file mode 100644 index 0000000000000000000000000000000000000000..8c88d3317463c45f2711b27aac6372c84afc4f7a Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a new file mode 100644 index 0000000000000000000000000000000000000000..8bef6ebecb421f323b7330e63d9ad95acd0e2dff Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a new file mode 100644 index 0000000000000000000000000000000000000000..d4590326b3cdc55bbabf14ea8b3027bba5bca939 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a new file mode 100644 index 0000000000000000000000000000000000000000..ce2f0d2c9c447a74a20efebab89f3f00e77ea9d8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a new file mode 100644 index 0000000000000000000000000000000000000000..5b1679cd9311d06223e303f5c37439f6a551c4fc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a new file mode 100644 index 0000000000000000000000000000000000000000..30c12b70852fdf9630e828693cf98599d232e169 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a new file mode 100644 index 0000000000000000000000000000000000000000..bfb543e5d1d4cd397784747ba36f4e0e42a41ab9 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..c557407ffdad794f257d8608af00a94af239e00e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a new file mode 100644 index 0000000000000000000000000000000000000000..0c21219c90159c8c8ac25e25aa01e1c73d0944fe Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a new file mode 100644 index 0000000000000000000000000000000000000000..abf088d472b1a8554f25dbe7193dd8e1b27148e0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a new file mode 100644 index 0000000000000000000000000000000000000000..1f95da652e57b43f014b56635019542c7e52d64e Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel.a new file mode 100644 index 0000000000000000000000000000000000000000..83a2d27f710cdafcefd5cd48ff4a7e0b7a4960cf --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel.a @@ -0,0 +1,38 @@ +INPUT( +libwinapi_windowsapp_downlevel-dhcpcsvc.a +libwinapi_windowsapp_downlevel-urlmon.a +libwinapi_windowsapp_downlevel-dhcpcsvc6.a +libwinapi_windowsapp_downlevel-mscoree.a +libwinapi_windowsapp_downlevel-ole32.a +libwinapi_windowsapp_downlevel-esent.a +libwinapi_windowsapp_downlevel-windows.networking.a +libwinapi_windowsapp_downlevel-oleaut32.a +libwinapi_windowsapp_downlevel-dxgi.a +libwinapi_windowsapp_downlevel-xmllite.a +libwinapi_windowsapp_downlevel-xinput1_4.a +libwinapi_windowsapp_downlevel-deviceaccess.a +libwinapi_windowsapp_downlevel-d3d11.a +libwinapi_windowsapp_downlevel-dwrite.a +libwinapi_windowsapp_downlevel-propsys.a +libwinapi_windowsapp_downlevel-kernel32.a +libwinapi_windowsapp_downlevel-mf.a +libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a +libwinapi_windowsapp_downlevel-d3dcompiler_47.a +libwinapi_windowsapp_downlevel-windowscodecs.a +libwinapi_windowsapp_downlevel-mfplat.a +libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a +libwinapi_windowsapp_downlevel-d2d1.a +libwinapi_windowsapp_downlevel-msajapi.a +libwinapi_windowsapp_downlevel-uiautomationcore.a +libwinapi_windowsapp_downlevel-mfreadwrite.a +libwinapi_windowsapp_downlevel-webservices.a +libwinapi_windowsapp_downlevel-ws2_32.a +libwinapi_windowsapp_downlevel-advapi32.a +libwinapi_windowsapp_downlevel-rpcrt4.a +libwinapi_windowsapp_downlevel-windows.data.pdf.a +libwinapi_windowsapp_downlevel-xaudio2_8.a +libwinapi_windowsapp_downlevel-mmdevapi.a +libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a +libwinapi_windowsapp_downlevel-mswsock.a +libwinapi_windowsapp_downlevel-cabinet.a +) diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowscodecs.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowscodecs.a new file mode 100644 index 0000000000000000000000000000000000000000..bf44edd12db72e1deb6c8048f3bfe69651d25336 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowscodecs.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winfax.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winfax.a new file mode 100644 index 0000000000000000000000000000000000000000..1ad799c8fec49a333a396a51f58b673f237a8f61 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winfax.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winhttp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winhttp.a new file mode 100644 index 0000000000000000000000000000000000000000..afea448f23c77e97c9a09b6aee239a20baa076af Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winhttp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wininet.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wininet.a new file mode 100644 index 0000000000000000000000000000000000000000..360fbca430734dee489591c5054c98883da87245 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wininet.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winmm.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winmm.a new file mode 100644 index 0000000000000000000000000000000000000000..20a0aedda7d7f2e1871e48f88cf48aa51fd36a88 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winmm.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winscard.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winscard.a new file mode 100644 index 0000000000000000000000000000000000000000..4ddddbcf3fefd1da5aed5cabbb1786e5fc73daa5 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winscard.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winspool.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winspool.a new file mode 100644 index 0000000000000000000000000000000000000000..a8302fdd9d5f16c4a2d553e7ac5eb0c833c0770f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winspool.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsqlite3.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsqlite3.a new file mode 100644 index 0000000000000000000000000000000000000000..d681e08eaa73b136db38e035cae22e6e8f996a36 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsqlite3.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsta.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsta.a new file mode 100644 index 0000000000000000000000000000000000000000..a7cdc5144eaee16cf46bdff27a85498da5178463 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsta.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wintrust.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wintrust.a new file mode 100644 index 0000000000000000000000000000000000000000..b5d435a2c970e8741e9e3303a00368f230c2ef02 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wintrust.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winusb.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winusb.a new file mode 100644 index 0000000000000000000000000000000000000000..5dfdad4b19c28c23697bbbd0f2a21113fb9a9631 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winusb.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanapi.a new file mode 100644 index 0000000000000000000000000000000000000000..a7e75b5517958b768df3de0bb8737ec4e1a41a0d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanui.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanui.a new file mode 100644 index 0000000000000000000000000000000000000000..7018a298e0dc048a6097550a31c9eb88e82b6c38 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanui.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wldap32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wldap32.a new file mode 100644 index 0000000000000000000000000000000000000000..20dc6d78ad9b18bf70543bf84ac354ea735062f4 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wldap32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmip.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmip.a new file mode 100644 index 0000000000000000000000000000000000000000..1243b415b132dbb40441e7074d701ecb92706aed Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmip.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmvcore.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmvcore.a new file mode 100644 index 0000000000000000000000000000000000000000..41a5a9c706fe19dfae627da5367c736048b700dc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmvcore.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wnvapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wnvapi.a new file mode 100644 index 0000000000000000000000000000000000000000..8770cee5992813595d5bf4904474b5b3c218e9ce Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wnvapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wofutil.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wofutil.a new file mode 100644 index 0000000000000000000000000000000000000000..d4a89ff388e3e57466216480d00e265dd7b81adc Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wofutil.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ws2_32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ws2_32.a new file mode 100644 index 0000000000000000000000000000000000000000..d61898aaaa9a9965f80944a2f9be99c150a0cf36 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ws2_32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wscapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wscapi.a new file mode 100644 index 0000000000000000000000000000000000000000..6e4f3dc0867e693f5d73371128c59ae3098dabe8 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wscapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsclient.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsclient.a new file mode 100644 index 0000000000000000000000000000000000000000..4a01997bfaeb6cc4383e5d584e310c1861bcda97 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsclient.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsdapi.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsdapi.a new file mode 100644 index 0000000000000000000000000000000000000000..24c1c707c850c98ae5c3b9d8ba9cd530d4237847 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsdapi.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsmsvc.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsmsvc.a new file mode 100644 index 0000000000000000000000000000000000000000..783acfa0b6c7dc1286913867cc3e1faa280fc263 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsmsvc.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsnmp32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsnmp32.a new file mode 100644 index 0000000000000000000000000000000000000000..e9bffd1262f8940141eda425e01a6e8fb5d428e7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsnmp32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsock32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsock32.a new file mode 100644 index 0000000000000000000000000000000000000000..8d128304535b04a16cd3ea71ede96567d66209a0 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsock32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wtsapi32.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wtsapi32.a new file mode 100644 index 0000000000000000000000000000000000000000..07dabb9974c88204823a0f1b49f3a1076d0aba8d Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wtsapi32.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2.a new file mode 100644 index 0000000000000000000000000000000000000000..ab285476ff7b57c76d7bade82383c63de46f38ff Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2_8.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2_8.a new file mode 100644 index 0000000000000000000000000000000000000000..36dcc81e9c91edfd6d41ea4345844a8b2058918f Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2_8.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput.a new file mode 100644 index 0000000000000000000000000000000000000000..8fcf22fd5b0385a49ef990cb3c1f0e641dee8824 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a new file mode 100644 index 0000000000000000000000000000000000000000..8409ae4555cce13312e82757e653d8d1dd747456 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinputuap.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinputuap.a new file mode 100644 index 0000000000000000000000000000000000000000..8f778e31773fa89b7be6ce9956c80e6f9bf6e955 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinputuap.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xmllite.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xmllite.a new file mode 100644 index 0000000000000000000000000000000000000000..4da29d07ee824588d379ca6bc205aac706236ba7 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xmllite.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xolehlp.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xolehlp.a new file mode 100644 index 0000000000000000000000000000000000000000..524c5fe17f1b5fd4cbfbf0fdced8252bfed84626 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xolehlp.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a new file mode 100644 index 0000000000000000000000000000000000000000..07d7d9b626b455c9f13905854994efb179d5985c Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsprint.a b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsprint.a new file mode 100644 index 0000000000000000000000000000000000000000..22cf10158f0d8860741a5c4d0cb7be15a22214b1 Binary files /dev/null and b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsprint.a differ diff --git a/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/src/lib.rs b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..3b7f827d8f03ed1b991c9f149288bd73569a3177 --- /dev/null +++ b/bash-5.1/vendor/winapi-x86_64-pc-windows-gnu/src/lib.rs @@ -0,0 +1,7 @@ +// Copyright © 2016 winapi-rs developers +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +#![no_std] diff --git a/bash-5.1/vendor/winapi/.cargo-checksum.json b/bash-5.1/vendor/winapi/.cargo-checksum.json new file mode 100644 index 0000000000000000000000000000000000000000..badbe0514dd83af7c99a20516d406ce9b8bc119a --- /dev/null +++ b/bash-5.1/vendor/winapi/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"d25b7c71c515a1869c75b3ff957bf845386bec03bcb407532e3726919f0b36c7","LICENSE-APACHE":"b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1","LICENSE-MIT":"ce7bc3499fee93d5022ef430d5e4201e79a6d9154f3974e42f41349f0569e09b","README.md":"00b1b016c128806ebf40e8648cbbf984baffc2eb90160fa47293fb4d4835c3f0","build.rs":"fa1782968d33345772093666220c7841c2fb4f6dd32fa47951c68a3a400a1a98","src/km/d3dkmthk.rs":"5fcafcbcf558bb9d7a1dde128dcb34f6b69bc6e8f8f5ff2017044bb64ad3a7c4","src/km/mod.rs":"d93c57482cc3a011f87b8d95d8da8fc52a1c5c053b9a143d781c276871cd1dd1","src/lib.rs":"2ed57f0c077ca9064dbe2269eada5ba310e0adf06bdbfdecb1e4b331345e0c2d","src/macros.rs":"529d00ecca3966e234fd15499072fb125580563ea40157e89b90acd1e5b4c650","src/shared/basetsd.rs":"82ba6ee78e4ebbf097529708b48bac2e15e0f013d6727d2bd3485a545a42f883","src/shared/bcrypt.rs":"fdf4f601cf9ed10d1968e719d55164920520aaef0ba3ed98e4323bb10f53a15e","src/shared/bthdef.rs":"7441eaefe97c5040c5e35c35b82a7d2ac9a537daa29d07e07f08932378c971b5","src/shared/bthioctl.rs":"27d5e0683812a986e27eb6750cf6e7f1a6cf43e16f0146f9b25c862053243857","src/shared/bthsdpdef.rs":"5afc812a716305a50b3e68433c2e82188138ead84bab054ecadeb8e69e71b2dd","src/shared/bugcodes.rs":"cd953c51b2840aa2038a4796f880b2757ba5617be41e527944d95a3d8e8a3be0","src/shared/cderr.rs":"e7a6f1bae38bf7c250cdfd62e78fa14c8c802a474a5af37a7d66843bd414b9f1","src/shared/cfg.rs":"44ad361ebeaf518407e1e503fdb266954001c725257ff6f2227e2b8057e7b740","src/shared/d3d9.rs":"69fc61ad552bef9be90f5a78ffdd6c6cb4823451994c8fcea21afd912e052a37","src/shared/d3d9caps.rs":"29019590dbbda387c6996727d0a997d975cbd384e650b75c80c1c5bf01d92380","src/shared/d3d9types.rs":"b6d81f06499632376bef88e6285a45b2de197bd656f8a7195f5ed5c172a351ca","src/shared/d3dkmdt.rs":"50d8f2845a30cdc771d1415125d2904717932e1a0a9befbc0cd2915272580f22","src/shared/d3dukmdt.rs":"08168cd51dc5ce587631ed7bd3c227093e2eec0b2ccd9a568d807e74c9f73fd2","src/shared/dcomptypes.rs":"5cde7f756a06f387968e68079dafc589d85a550d9919828947abbf1fd1c95844","src/shared/devguid.rs":"20adafca4117d5aa0cd69f7f8d73d30085e80c6213946e50a8c7a05017132d8c","src/shared/devpkey.rs":"e5005b0155a06494aa97a912310d78c420e8cfa9305149b5f61400b9614aaf88","src/shared/devpropdef.rs":"f1b625bb946801689461c212afb8576d55652765729707931451d306650ad0ef","src/shared/dinputd.rs":"a9a2122adc1638076e85f135bdc2d2871072b6e2592fc86df03e26854f9d42e6","src/shared/dxgi.rs":"6d0404a4aef7be936bf9ebc8ac661c780ea678184f514ae0e69e463a60d34e66","src/shared/dxgi1_2.rs":"58cf2ec110852dfb3b05b0cb4a470852b645d5067df6931382a2d7c564dfd12b","src/shared/dxgi1_3.rs":"b612bf52e4028cf9b975a1984d30081893bd59f61fdbdc8c8f69245301af1e74","src/shared/dxgi1_4.rs":"e8fb0c4d7fbfd6c6dfc82e689c6d621fe03ae6581727c92e4d1850ef4232affa","src/shared/dxgi1_5.rs":"02f876b56707c7b7ff4357235ba423d3fba804aee024b87bdd68ba72ce24f896","src/shared/dxgi1_6.rs":"fac06d941ad2a79144988ef8c2106afcfa4049043853f2e31b13c79baa572d5f","src/shared/dxgiformat.rs":"746cb2e9c719c6d07e68305e047f56a90b7309e76bca236727d1ffeada56c2e9","src/shared/dxgitype.rs":"37c007614096e034dffd149ef479c38accf56475f9539d441b287bcfde9204bb","src/shared/evntprov.rs":"abf75f0a63b569603b8de45bc3891778831f62b9b76294cc888e32ac19fc0002","src/shared/evntrace.rs":"f09226bdba29311259a338e082fb9641c9a7c59dbaf0bc8a6e432b4dff88b341","src/shared/guiddef.rs":"3fd75e1ec6583325b7b50afb5e04cd1dbedec19b66c92349df82104b19edd2d6","src/shared/hidclass.rs":"6dcc661b29596c64ffdd17d6ff3d08c4072aae59c6f083ea1ec8cd145b800b20","src/shared/hidpi.rs":"7429e18c49bd3358edbce4d9fa0bc2236ef7be9423267748cd4a7d340c61529c","src/shared/hidsdi.rs":"27043582707d242c8483dce865b8463c0b8e0ed0f9bb5eff62aba019ed014fd5","src/shared/hidusage.rs":"23f6fceb8901da93b95637439892f52132bf072966a8e577d22b94a460031b27","src/shared/ifdef.rs":"a19ff4794b3796510111e84207336ec8721346ce2b08251cb17e405872600711","src/shared/ifmib.rs":"9bbc3aa6a44cb0406479cfd85acc5c7fc82701069e0e2b7cb44fdbba7e8fc9c5","src/shared/in6addr.rs":"9abbea2bffbbfcab94c466394b400c07f8fe95abbee4b5ddf26831c5303a9c12","src/shared/inaddr.rs":"f768866d57c9691166193cbc239eeefbe802dad50daff40d65f6e5c6c4b53426","src/shared/intsafe.rs":"030ad79543efe5bae6c6dfaff77077458a4bc876582a201f3155129a684cb1d1","src/shared/ipifcons.rs":"97745b882ce71c05f5d4b5c0b82deba66a5b98724abc45635d9094d91c86aeb0","src/shared/ipmib.rs":"b725f5700a7fc6a623ec76a46907147a038c1fb3fe7bc5feffbd26b8b0d5c9f3","src/shared/iprtrmib.rs":"0a606dd0c40c8475a972c23655d742af31d0aaae8b912fdf7e3c149c21b77196","src/shared/ks.rs":"90b4f80d97a1c914bbecb7ae11eb11ad45959f80540014bf70518e5688a514a0","src/shared/ksmedia.rs":"258dfaba65bbc2c76e567d41b96d5d10c2eb07281bf35b246bbeb9e918a053b4","src/shared/ktmtypes.rs":"6434171e5657c236ea20603113a8fe19ad465da8d92ef152831604cfe8d14aa9","src/shared/lmcons.rs":"a730be5fd0ef2d682986547cbeada8d6343fc9e72c063cd900b747f22cc08d34","src/shared/minwindef.rs":"08960523fa4c5c883536d88c458b2f01c3a3e611587d9eabe0fa3bf0f3cd6672","src/shared/mmreg.rs":"b9364cfe8c392fb1b791e62907df3c77426fa8c96ac78df2e991bcce667c718f","src/shared/mod.rs":"73be8564d0db924bb6c610145d0d9d21c308a74dab7e0eac7ba36b5e80a492e0","src/shared/mprapidef.rs":"3e18cbc9eb65e34175f929aa06cef01f9d892a110fb0003a9d4a575e317adce2","src/shared/mstcpip.rs":"b500e6c96dab2ffc9ab0b11be1159d768cc737252e446b65674130792a42abbe","src/shared/mswsockdef.rs":"275c695b2d98535af9250cf343ee414bbf71e186dddf80b68767d96342c31f1d","src/shared/netioapi.rs":"7bcddbae54f985c262b4b2e1369147e82772d700dbd847ee6eb7315957ed3151","src/shared/nldef.rs":"e19c5807790252a89b8a5c5706b6857aee42494f45ba2a9cdd7d8e93f1b84e20","src/shared/ntddndis.rs":"b61f6c6e1ec4ea7b37912d05afb752797831ddd3dbae1add051e508877427c4f","src/shared/ntddscsi.rs":"66315951d06d45695fe706e559872d7fc91857dcff03d1a6450c7885cea896f5","src/shared/ntddser.rs":"0c34546f7d3fdb2d3db72703b0c9f1a138ed1ef60f332f32efdceb3ed0632e85","src/shared/ntdef.rs":"30593e5099589d8cd5c3e70efd22fb00fa6d678d1b618f6eae1091eb5bec4aee","src/shared/ntstatus.rs":"e7363938783f8ccd66bfa2c74a4b070e31eeeb452cabdb12b686fff9fa54938f","src/shared/qos.rs":"a57fe6c5a46f203391d61040a6f0cd39fc7f440092e9155e9425785e5d816687","src/shared/rpc.rs":"ac52ba80fbbabf2e259bb815658ef4505e9e2c06b53247f666f23439c4d0e4d8","src/shared/rpcdce.rs":"f80b7b5425fde8f3da4941a7e2ce7802ae35eb6801641baf97e9deb6a4ab77b1","src/shared/rpcndr.rs":"2cc5b29942edf284544c7301c913fdbe324348111d7438a7ee2aa7031d5b6bf0","src/shared/sddl.rs":"2a542f70ee6bc4476060cfe7568bf33331dbcb4a698fece44686d4ac03eae1d6","src/shared/sspi.rs":"a347b97201ae645638ffaf7b5ab198a7710b45dcfc4246d5df24fab31ab367bf","src/shared/stralign.rs":"7f9c793ccdbd1a7d0b495a56824803c88ad9aa84fc4fc33af646befa10ca75e1","src/shared/tcpestats.rs":"8ee0af215cbb4e6fd4e948f0cdaf52347e49abc955895fcdf7dc300474363c7d","src/shared/tcpmib.rs":"1c077fe7752e3c0d1b52164d30933ac3f51ca81d1d2aaeffb1d427ba8669ae04","src/shared/transportsettingcommon.rs":"0791e5ddad518fa316f30bde5139a87343189a8c582e33b376e87923b6edf42b","src/shared/tvout.rs":"0a5b43d53916c9dd3a6e1637eb230068d91bf5de517b38eaefd1fb759470e551","src/shared/udpmib.rs":"9900dc067ec0621f84f647a606c3997f43c77e30fa83ea6373ed61270b03a226","src/shared/usb.rs":"1fee88fe372172058d52365bc764c21ad189084991b1de2ba94c1d863007f9e7","src/shared/usbioctl.rs":"2355ce43a186c16bc1d8ddf5fa98b9a5ad7dff801831b8cea449fcd78892712e","src/shared/usbiodef.rs":"358f69cf2e847cc822ea8fc6a8bebc7dce2dbe9ab4383a327b5da4dc93f64bf4","src/shared/usbscan.rs":"acf307d90a973a60fac1343083baec607c76f61fb24f9e47c4d267a79a9d3cba","src/shared/usbspec.rs":"e787df4b0f7bb8b92fff4354689a1b3ed332d54f777c79560b7bba3db04273c1","src/shared/windef.rs":"3b0fa697ec4a57f9016c0bfb01df1768636c1eb6c8c4bfd5a9f16ba7d6bfee68","src/shared/windot11.rs":"ce1703a75de462372cb0e40743e7cd55eb0b798e540c852ece5e88887aff7444","src/shared/windowsx.rs":"72e7f99f70a1a30f34f00bff8147e7837d2be8a9b93f005fecf1bddcd20f7988","src/shared/winerror.rs":"07890d7360fde1c5df53685024fc289476c22aff8ad23eeda3013e4866a7b951","src/shared/winusbio.rs":"871b050e4dec58e371542ab6c8277a5c6f57b9364bee08b1f3b7b0d9117b9cda","src/shared/wlantypes.rs":"9dac0c6dc091d143ae8f53b02a0094ff1cb975911836b02e3a29609806490af3","src/shared/wmistr.rs":"0a5431b57488503975d0c6c3aebbf2f56bffae2462b4c89e22220b100a52f70d","src/shared/wnnc.rs":"7e893b55d96fe43280cb39a6568773ff2c747cbfce13e201619d8ffaa3936cb1","src/shared/ws2def.rs":"62293f8c9211e01a9596b82dc186f9caf706f2d7ebd50a19b2bbdeaee965fb8a","src/shared/ws2ipdef.rs":"3b2a23effc89b48200d5852652f62fd5a4364f4f788cad1e42ad2200c0a3f69d","src/shared/wtypes.rs":"d7788392196e15d52a5c8331e85272dde9f1c6857dc0a06b41ae5ac21502de60","src/shared/wtypesbase.rs":"d4d98d3777d6a581827fb8b96d5d57b531e80df49ec013ecf962a0aa8809b6f7","src/ucrt/corecrt.rs":"a463e7d509d8cc926444f81c78fcf2f4ff8751482fbcd80b1d6d2d042e6387b1","src/ucrt/mod.rs":"e844158da7d64fb620df10344ec2c5eb8e66ef8b7f5b91042291624159d4a409","src/um/accctrl.rs":"679b937a10fa0017ef9fb7cd34996431f5fe0fa679d7abcfd6f4bbab80c8982b","src/um/aclapi.rs":"7867f7668606c0f258ccb238f49f560d42fd54da2a757d52fa42bb4c051aa730","src/um/adhoc.rs":"e8235ffdfe80f1d329dad13cd734deb24298d31afe64a708a4f3cd4e0468c61e","src/um/appmgmt.rs":"613882eefac180d2d35d944d4164047febc773bf2ebe6a4008f11ed160b68c5c","src/um/audioclient.rs":"75ceab15c1aa67b7b1998064f42080d82a45d93003b98e700bc2733f3de959be","src/um/audiosessiontypes.rs":"ddf7a9bc055c3ebe2e15a7c338b881cceca6409f4798e164f655f619be7ba49a","src/um/avrt.rs":"b89918c5abd0397b6aa84f7fa6aa79561968a09ebc391bfe03aa706893a95980","src/um/bits.rs":"a191ee7f82ca76e46cac004e313221fa02d8f8e6c8e46d90636ba7252eb85a71","src/um/bits10_1.rs":"e0b31c2567c51d01d615b369749f694829124f17f1767b8a2281a15584c1e5d6","src/um/bits1_5.rs":"f6a93879e400d4a4c055454c3a06d764f7b8852955bfbf09d62d33bc2677bca8","src/um/bits2_0.rs":"528aa9c961c6c7162e7fffdd24e5db1c2e5f9af152d57e7376f630c723d6fc9e","src/um/bits2_5.rs":"7a9198eff2e158d1acb94d7f595ffa0e368c119b39d193e269222b5545b44409","src/um/bits3_0.rs":"5a15c736b866d9254cb7dddc687f5fa1a7f58afa58abd9112e2a6875f44a0b31","src/um/bits4_0.rs":"65b44b5f7f20e4d0717b7e8d9f2f3a5294366f5afe3afdb8757fceafa1a05aa7","src/um/bits5_0.rs":"f0c20fba6e3f5715e17f29df6d38e8fbb9ddaecdd628ac9c1de894abc413a74f","src/um/bitscfg.rs":"450b47c52b56b11be7162b8a011544d655aba324646809aa2e3c314257c07b1a","src/um/bitsmsg.rs":"a2f363a63c5b8e8321b07bc21801e1f30ab440651f653dc90bcb168d73ed62b9","src/um/bluetoothapis.rs":"8a54cd097c4497b1ce6d79824f0aaa2710e192c0df61bb50089b247120a75c10","src/um/bluetoothleapis.rs":"18f400319c73a827c161da5db18a8dbcf6d09242dbee43e199c72ab5026fdb4e","src/um/bthledef.rs":"6681986618978443c684e46105818c9a1ec1e901903a759bd50e72f8a3c7cb92","src/um/cfgmgr32.rs":"a792fca9294f5a66982394aa4d2891a46f99c062932eb91227b4b63ac23e7fcd","src/um/cguid.rs":"f4fdbb78adfde4741072cf234929275bd90e29be4d66d348c5d18bbdae592930","src/um/combaseapi.rs":"1d9fb12901320c2200384f67851f52557aa4e996acc35dd186440acea1d40fdf","src/um/coml2api.rs":"bed0e0a3845595c559e5d314cb2c46c0bce98366045c7d8e8e36f8020eaba106","src/um/commapi.rs":"cb63fa3cd67f36cbcc93f904ecffa72fd5fb13c1b56b84de9a0764b5c868acd2","src/um/commctrl.rs":"b8dac58631110565f645b2262f2c15bca9037dedeca3bf4272def73aff500ac6","src/um/commdlg.rs":"c4b1a110f12d6151a3b064e8f3a4bf151f3f672545ef8fb11d74591f595e4827","src/um/commoncontrols.rs":"cd7f16faad2c6c12a2e7ffe71a7772b1376ee671f79e4f38d2fd92bb36e343db","src/um/consoleapi.rs":"4ec6603dff08256ad987fa3dca69d80d1e9253df77383cb4e3b228e8332959f1","src/um/corsym.rs":"8898dae9630572cd97221ab5a96790c53b9c0dd186a0c6d17c4541c671a48c4f","src/um/d2d1.rs":"16537910e193935f8c2ad95aa00761811e0ce798273ab944b7939fc06a299ef3","src/um/d2d1_1.rs":"072997a09f1eeee65fafe4f1b56184b9e384ff319afa1e3d7a1b39d5c31c252b","src/um/d2d1_2.rs":"5f8dbf676cf1c5967b92af1cc6ced54fe0dd66d2336ea89f9a3b7b371193fec6","src/um/d2d1_3.rs":"1c0571ca7fa43e028df63525ee50cc4edb9bfa60408c7c5c116aa827d65fdfac","src/um/d2d1effectauthor.rs":"6c3bc41c58079ef0eb1b3724c009cbc229bbdf3e87d0734fc1c38ed5c74d3d6a","src/um/d2d1effects.rs":"f175c39ca436e56f42e1040aadc283ded95d9020961a8f46cd70ff9bc134fdc4","src/um/d2d1effects_1.rs":"686ec154074f5d18f15cc2c1fd20cc374679a530efef9cc172fb7deb3f31cd1d","src/um/d2d1effects_2.rs":"88d71ac86e022eaf2a177553ecfdf62eeee7635d3ca701765939923a4527be69","src/um/d2d1svg.rs":"1c53c6471356d5aee85a386cbd10588de785bd3525e82d26c21bc47b9122ca19","src/um/d2dbasetypes.rs":"0e12de4e806b447dfd49bb8c26d5d7ef6eb37b04dab27949e2ca081b3cf7c6c4","src/um/d3d.rs":"7dd42d427b88371a9400ba94648872d8d7bb93b223c502de0ac1b2fd28226d7e","src/um/d3d10.rs":"3b078996204e310684bb287ac47bff1eb2bd9ff88c0660798943ddba7cd14bc4","src/um/d3d10_1.rs":"d03b2b0cd59ef6596291b4aede08722428f86493c2c849b0bcf8692f2560c4db","src/um/d3d10_1shader.rs":"a4e38cc140251776487dc74c2d66f75e5fea649663d057044e433f75063edf05","src/um/d3d10effect.rs":"e832315707a4b46b33f7c0e33dce3b6f17616c62ac5b50b45cbd24436280e3d3","src/um/d3d10misc.rs":"e7e6722dcc500b83ef6ce3b1a57872a224c9f8a6abd0c2b77b2f88ac9f66a2ec","src/um/d3d10sdklayers.rs":"3a9aa4930464a256700c00b46c9ee82480072e715ebfbd70a3c5fe25fe427850","src/um/d3d10shader.rs":"413d9d1fde20be1e260ead840425dfa19fad2afa6d71a07a3e7f629413052ab0","src/um/d3d11.rs":"5f63dccd77c60c98d5fdd7f61e54ec734e4dad50fc7dcebdb354e65454a4262e","src/um/d3d11_1.rs":"e8a356a54a538dec4ad6716afe603dfe5e33a53950912dc82701fb6d029444f1","src/um/d3d11_2.rs":"a45ee94622c66f41919987c512ff39221236f8d0380161842b2a94a7b4ed44d4","src/um/d3d11_3.rs":"cce13ed510b82328ca99d15baeddd2e50743f24bd522cd7be36da47aa7c8f1d1","src/um/d3d11_4.rs":"c90bb2813303236339b405b05965964e5773efd505b20461cd008b12cff7b4ac","src/um/d3d11on12.rs":"07125e00377b771baefd110e0f0aafdd45dd859e04b2451d00b0a896a98c30bd","src/um/d3d11sdklayers.rs":"2287f35dd5a0758dfc4fde881db7482a12b6250082ff4515e84e73ecaa5cc8e2","src/um/d3d11shader.rs":"04d51f2e0ebccab2cc4581f9d4b3871d7fb93671c09f4f5ba683882e717410fd","src/um/d3d11tokenizedprogramformat.rs":"931c419de79725c804b70234622fc660629f65e5e1e566d49a4b75b3a8d224bc","src/um/d3d12.rs":"bd21d87e6d94cd85ff3d399016a66a0891c45fa5faa59bf952c29c450105cbc8","src/um/d3d12sdklayers.rs":"86ab09318bf76a09f74c6b2d9358d327d84d6d2d94f1b8f274385633138e480a","src/um/d3d12shader.rs":"8467f66d0f42d8690c92c236c376fde937bf349c6bb3307ade3b2682b0e7d89a","src/um/d3dcommon.rs":"0b06fab050a6df0f9b2e19bbf0278dbc7de6177dfa706e6548daf0283e26d0d7","src/um/d3dcompiler.rs":"d753cfcc79d25ddec5774ff3ac8204265a86d5a0411b77087525874d4bcf52a3","src/um/d3dcsx.rs":"090aef3c9249996b4a510b6a5a47761a4f2dd45f035b8828f153b7c09e72bd6b","src/um/d3dx10core.rs":"9f2972e822a060c0d48f6d21ea9438d98729799f4fff4db5b01c2ac89ee421ca","src/um/d3dx10math.rs":"5ce6ca6e6aaa7062ae44ce28aefcd2b63d4fef32816168875affd1c8f33664a2","src/um/d3dx10mesh.rs":"2db94de70109544e45357ae31a71ee6262baa9d8f58e806e1014b047d12e1316","src/um/datetimeapi.rs":"18bfa8543eca805077c58d7316c1acaa7de20cf212dc2ba1337a06fb0cb250dd","src/um/davclnt.rs":"c902c7042a4550795c938f3d241219ff8fae09c13bcd3595d2e2e90306922c31","src/um/dbghelp.rs":"d89b4715913e3178f5137f03052bf27b6368e1d6c87d732484b8715e0df5f005","src/um/dbt.rs":"2b584edc0f8676ad5248d556169a7b7a305c3418775c93d99be3e643ad2121a3","src/um/dcommon.rs":"677e479b28423b9d7123430176255e97a16eb25f3bb3b402dc3c1faff6072c88","src/um/dcomp.rs":"b40233a4c47663ea8f556ae1049bd19c733e958f77a88fbc7d6cbd8e0e29138b","src/um/dcompanimation.rs":"9329be3851035cedcf4abe8c87db0742004d4e8c0cae281cbb11a6f3b9087ef1","src/um/dde.rs":"da038629b562c93c12b4d638be66cd82685aaf7156f2d27dc20daa74ef77886d","src/um/ddraw.rs":"a1e3da10e1e592bc65b7262a4c4556b7c3786d42422d123a8ef31c163cc67035","src/um/ddrawi.rs":"c18a8b17635a90fa513f2fba7b582e4756b3633b04908fc2a8e471a6c462e7fc","src/um/ddrawint.rs":"fbcf216bb1541d329f8e7a503965011c98cfffb86790d71cb78022560b0890cc","src/um/debugapi.rs":"a8ca228fcb6219c703f9b13b7931eb9f39662f523949a8e6addcb6cae0f9425e","src/um/devicetopology.rs":"c3f568fe855315f24e73738e7b4782befd9486f898aafcc12193d8b5d470e312","src/um/dinput.rs":"921b0281b24af2e4d9ba915313ed52203d4db5c89a0ef230b9ba36b494c220f4","src/um/dispex.rs":"7590032e356e878881cb75b4206ea09e13fbb1943891da8f31bb1513ba896d6e","src/um/dmksctl.rs":"0eb12a9812509d29c4294dbb6e75f9c0a0a4cd02a6a3979aec4cced465e891cd","src/um/dmusicc.rs":"d35c225338948b3a5fc7b183e31075597d600562cf2ea2b78f8950e923394f5f","src/um/docobj.rs":"c69b5ca5c250ef13cdc3aa0998111e49d3460b653633e96eac1202ab1e489976","src/um/documenttarget.rs":"8bfa4bf273def86bf1347d094a683be9ef39a588a9e27e968d49109988ca57e6","src/um/dot1x.rs":"0f9b3e8ca5ae6e2dead7d89c64e085d5bebfbf295c7faf146c1db6fd4e98209b","src/um/dpa_dsa.rs":"79d53e29ad2239b69e13f2a96d7546d0f3ea4611a1b1730a703a51afc0933dc0","src/um/dpapi.rs":"04508bd13782b6c64308acd53aefab1edcaee4ec89d7ccba0e30591f42d80493","src/um/dsgetdc.rs":"1d8cc7685b05023ba9698f169dd211aa0692afb608d570c6aa84de40e864c7ae","src/um/dsound.rs":"79e1e9efdc647eb998f0e9806c7b7281962f766a64532c270adc30a64037bb7d","src/um/dsrole.rs":"3fd27de63346253cab1a25900414a208a23656416c21141aaa6a2d33e7ee1ded","src/um/dvp.rs":"eb6297c5f943fd25a143c3285f0d9197b674df76f2342810d407772ba1223322","src/um/dwmapi.rs":"d0bcf2b922b8fc00d261577470e5068fd87fe534b27880402ec7a43de76f017d","src/um/dwrite.rs":"b9922cd2a72d643b44991325632a0b13a2f71e1971a601c2f23f17970a678129","src/um/dwrite_1.rs":"052df22764399d9ae66bb1348f3aad281785494afa2abab17c0a0fc15f7a2142","src/um/dwrite_2.rs":"d6a161504e838133591e0c75c0b0846c81de413b257383168153b81ebea5afdc","src/um/dwrite_3.rs":"b32293ccf2d1a8bfc1a4de5127e1355ca726f87216cff1502f2e748e01d09c62","src/um/dxdiag.rs":"0204000ad50bcbc3f9a1924aa382b40c3690f838eaa3cede2afb26bd853940be","src/um/dxfile.rs":"ea74680af320a259178219e420e6748d3c3751d1f9f8210cbfe46390ecb11fd8","src/um/dxgidebug.rs":"42b61771af0c558e8703646c97882f19638c12e02a97d1256379d6ba01e36b22","src/um/dxva2api.rs":"c05c03c249c8c91bf0fd6ca24a68c6fafd634b682c83b544f2c2b3c98b6dc89c","src/um/dxvahd.rs":"7510f79d0e72199ee5307f6880297bec7e5d47c908b9aaeac85cc4cc010511b3","src/um/eaptypes.rs":"367440e4ae77c6f0903ae71f2c1cc20980db69c8de359715be63d52387c38bf4","src/um/enclaveapi.rs":"25c4f026ece797f73dc5fca45d965f220c62de94056c8e137b2cdf6e7db1e403","src/um/endpointvolume.rs":"ed3373501104fdb22e0fcd724e537ea36e79592579f5902f4ed4c67cfc071826","src/um/errhandlingapi.rs":"7ea8bee9bf4462335f25995b6e0215c06cd0149f2e55f5af46fbb40cbccc0e1e","src/um/evntcons.rs":"297bbdf96b7f9bdbcd6b7a8696e4b65fff7731b5fba52257387d03cdaeed25f9","src/um/exdisp.rs":"e479ef946e3e2b79dd6464ba474bac01721fd333cbe3d40bb34361d4c383373f","src/um/fibersapi.rs":"3d6e922f8abccdc2c505c30be99be39476915b97d6a428ec112ae9eab870e5ba","src/um/fileapi.rs":"8d7bb66047dd3d599097d1191d4d7ea6f27133c8a29c8420e0e36a817902c3e5","src/um/functiondiscoverykeys_devpkey.rs":"7c5cdd3c82a50942e6e7523d837d330f3891d1ed647f7af82bb27aa76b9765d7","src/um/gl/gl.rs":"39805ae68cd88b7e4bd81a8ce8d9805d3f9cb1b84616967796f76d188b3d8caf","src/um/gl/mod.rs":"b1b873c59fb0900c783949b5132738cf102357a19d2485a89b984f72d73c9288","src/um/handleapi.rs":"de90727411aef9ccc9c0f6a75c739dd682f66165ca85321bc8db6736e85253f7","src/um/heapapi.rs":"9d6bb1e3c05af574fd719ca3f8098c39dc637a2913a16a30e3a23ea4a822885f","src/um/highlevelmonitorconfigurationapi.rs":"b9ec30fd83407e0ba371e95c1cfcc91059607db6f67b5d2506f4f95871b2bcac","src/um/http.rs":"979f40d379cd05b63458b8771f42ee7889337aee64ffb9a0e71c44822f162ae1","src/um/imm.rs":"1272b7f59ea87c4923cbf7aa5f35c1454db56f4d5a5cd97dbe6a3f407e50ff7d","src/um/interlockedapi.rs":"e6f8149b979099dc50816487d893f1943f1004cd9a6b1ee56eb564c7783c5cf6","src/um/ioapiset.rs":"871a1d24183a5e54ce29b86921cbe493d26a5c815f4c498c9068bb1eb92a67de","src/um/ipexport.rs":"d09456f77016470679ef22ee7884d2dd8f0f283bebcab191053977c39f22948f","src/um/iphlpapi.rs":"f71a88cedc4f820155f24264dd5b8d833c3f3fef26498ece72e080d6bd60b447","src/um/iptypes.rs":"2d918e66d6cdfed287d665f0e323ab9628526a26c1bf24d47e50018213feaf94","src/um/jobapi.rs":"4d5e4e86461b66be148fc2e4760fd01a9a54042a1c95ed5f3b89e000f4ceaef5","src/um/jobapi2.rs":"dadff8f24ab1d6847c0c234a8ff013906c3f7fa8523f2c5173d19bd13a7b1b55","src/um/knownfolders.rs":"5e5d204d5dcf3ec3098e6d3f1f1d660a63f43b691773cca946899b8b19bc196a","src/um/ktmw32.rs":"70ca3f285930c526fbaf5820e8b33d4132c6ecccaa4c4acf1dea506b6c8f5cb4","src/um/l2cmn.rs":"70780cea636f76fa249076ec24940ee9d25b59b8c58f21169558397e2cd17450","src/um/libloaderapi.rs":"cf640966ffe68af913b06acfeddedae01c47d334dbb51a5c1ff91f7ec94efb98","src/um/lmaccess.rs":"a90e1c06527257b243d5f3cdf6981823977f994f0d19159dc8fd79d48ac333e2","src/um/lmalert.rs":"78804ca021fa4c75bd0f6ceedc4f3ab7e8cf75cfec8a84e1bde7ecc639b823e5","src/um/lmapibuf.rs":"2530a2918f2b37cd0657802b40f890538ff2eccd94258b4b1154a666120ec652","src/um/lmat.rs":"0b1db5e4432a7eb77eff4655e814f510d7d30cd3189c44a52a938876ee863134","src/um/lmdfs.rs":"31c278a63e3f25d8bbf2e3d43c5ced5a64db18d20514a4bf5d4098a5fb0564fd","src/um/lmerrlog.rs":"ca8316152fdb7ce03ce6575b3784764f55a8c17461ac9e8f50f0770ac527d9db","src/um/lmjoin.rs":"c5e5ecf52d711a6d31b8256752b86652c26f2371994437b30f4a7ba2b56ba8c1","src/um/lmmsg.rs":"902f78f089287fa6bf31cefe7d523de9a963950add1a4847f474f537e30bcaed","src/um/lmremutl.rs":"901c1dc5bd48e4f554fbd28834c8e069ca6aa0758cf700277eaab0dddfd5979c","src/um/lmrepl.rs":"2aca07f6c3c0b9f7b25568a350073243d38e6d30ed6c358dcb63168709d424ff","src/um/lmserver.rs":"e06dc9db8cb4999074385ea7b31a6c9760ec4c607fe897278305e429d19a5df2","src/um/lmshare.rs":"788dc0d46a491ec312a343a835c9e16993ec31688c97a3eb8c6947a56a358a5f","src/um/lmstats.rs":"8f30ce095997e7fc91b3114814bacdc9bcd1555540aa803c77ec760711d2abb5","src/um/lmsvc.rs":"e21bbd4514df2a4034ad7000e7c7705994c762dbd55f1acd7ad018108476546e","src/um/lmuse.rs":"cd6b1bcbd7cc483c8e0a9a6530a15d7bf1dc15125a2b6867fae21c805f4c4481","src/um/lmwksta.rs":"48f7a141d071feff3e89a0951134fc3c3693bf8419db144b1ecf79277b759901","src/um/lowlevelmonitorconfigurationapi.rs":"443b99e0ce868417230fa137a7a0ac419e4ac916e70f4cd493e8644c4fbb1604","src/um/lsalookup.rs":"e590e29feef6ed1c650fa37d2838139cb3f24b17dfa353b9ed05b375ecbf5740","src/um/memoryapi.rs":"3c98dc6862515a2fa1d5fe1fe07029df757a0812503f1ad185c909104b6b086b","src/um/minschannel.rs":"f61ee574a448f587283c05476bfc64cd427f19fb8d24c34b5fe4dbdc87db3a3d","src/um/minwinbase.rs":"8f0b8c595b472cda996d76bc1738471f5bc0bdb7ddd55f76b7ca7f75d143f27b","src/um/mmdeviceapi.rs":"95119649cdf7aecfca2efd4f2d5062c59c0a1b13419dff61469aed26394aa5ff","src/um/mmeapi.rs":"88a4119036d9386c96af4018c11ef95f247ea0eaeb54f6626b2dbd7ea5862b1a","src/um/mmsystem.rs":"ffefe67a61f7f89bfe7331eb85abc8bdb4b72f95ffe7a26b25db7f5b746c5aad","src/um/mod.rs":"563d54f2a76c95a12a3c3142051bf0b4d8a656a1de7c51dfc80030e0a4325944","src/um/msaatext.rs":"b2cfbe373634bad9a5dd365279d8c5c3a541c99ae0379ed140d4551a3e8b3d10","src/um/mscat.rs":"ddeef0621b10396c91d9aa340fa4480d0ed70e0e2579f95ae18f805c54309498","src/um/mschapp.rs":"4a18fade84eb823c950aa175ec082217bf08c6f4b5a64af996b7fcdaf12cce5b","src/um/mssip.rs":"6e2d7a112939a3cd00ff07009a3966c926136ffbdf888a0dc61ecf5a32d438d4","src/um/mswsock.rs":"9d6c5d32a974415a71a279deaa41674377aa639d01db044359c5e9226488002f","src/um/namedpipeapi.rs":"37d84469cb27291b5e2649273fc51fa34609fa988823034efcd42751aef80748","src/um/namespaceapi.rs":"8b68775a6f52d33b19f450b5dc47a0d9d7e0b50f2623b78dc21b74721913dfd7","src/um/nb30.rs":"ef375c5ef62de9846f884cc572c124dfa478dac3e3a582fa6b6ff8e9fedce92e","src/um/ncrypt.rs":"87bf4e6422462efa5b201fef64e6938b900ceacac699c724c8b22581dc419243","src/um/ntlsa.rs":"62af59c8f68dc511ccccc2f4e071dd3fdf3bc5c8a5e79f7c251f7815bd95d712","src/um/ntsecapi.rs":"e9626865a9dbfb45503f6c211f2af4763476ece0951a31065081ee610eef275f","src/um/oaidl.rs":"7527a16e8ffc5852b7ba8a507708127066298d8d89f1381b1b2e49aac413a8f0","src/um/objbase.rs":"05c2cec2b50a1381569fa5fed7a7224e3c996ba6d6de281a94c698541f53ef9d","src/um/objidl.rs":"783c4d26f8ab73a39a06d9070fe8e5dfb441cbb98383096770bdf5d7ecdc242d","src/um/objidlbase.rs":"0868d95ab7554e0e99445f32e4ba19ef41703aae7d1f88b5ccfb65fc69cd246e","src/um/ocidl.rs":"bff12022b3564a323932e9807c225409fa701bda37b1037a94ecb99aa4c38dd0","src/um/ole2.rs":"1ae2519d7b3bec95faa463e78bcc696c3648582e1586c0874781500479385200","src/um/oleauto.rs":"b373333a0467327256a17a2815e37e6288ba186a74a3acb29bb26f6303c38dac","src/um/olectl.rs":"1deff809b5e01f256828425847d2222024f99e95de47bdb8900ccd9771f5000a","src/um/oleidl.rs":"4f3697c1d0d46b637032c5c510eca203b35eadfc484d2f2d96ac918406214ac2","src/um/opmapi.rs":"2bd12e1ac2d8070962ddca7b3bb1871b7ae40171e3f8ff1edee0559c9dec8ce5","src/um/pdh.rs":"165cf4703fa7215f025dad77da06beaa0f9a00df5bef246bc381ac24e8f06d89","src/um/perflib.rs":"c3a672382f25960aac899cafaec54f99a963230aea48b3bc7a025333b67b1428","src/um/physicalmonitorenumerationapi.rs":"cbb8d7ec3ef5492004fe032d3140f6043b9f86f12e68fb5815b9b08e9ff07191","src/um/playsoundapi.rs":"ef3dd57bb0aaf43020f1c9a9e5919a48d09b0a02b3fcf471847ea7f83623ad0e","src/um/portabledevice.rs":"deea01e14db3588de59863b7906491db91e9d23d35563c95a45fc1ad8f005f35","src/um/portabledeviceapi.rs":"941d33a939e45d3d72cbac2a7815ec68b30b9cb15258e406cfe2c7154abd86d4","src/um/portabledevicetypes.rs":"3c617d453009f216a13670cb122987b6f7b1cea8d745e12ec1dfb12a567a37de","src/um/powerbase.rs":"dc146d82e3475cfa589494d56ab37b79a9045df41f7ac04d1cf6179b7905630a","src/um/powersetting.rs":"995763ac42347af74958ba3b8d6988dc7a232c12e376df089a035de872754bcb","src/um/powrprof.rs":"913f90486eb7bbfece23cc31ab7dea639a9b5bd26125c43ed556d20a49d36588","src/um/processenv.rs":"08c210447fe68eb7a2d109f6cb972d180b4d4c5a5ff9afc0effa2be4d4afb17a","src/um/processsnapshot.rs":"64ab19f429bfabc4e34c311e77e71b1130a908f87905ed5444128aa28afd94d1","src/um/processthreadsapi.rs":"fe6ed629796cecbec847a3acb49a3a61499df951fce53f73f64b2069ef622848","src/um/processtopologyapi.rs":"6585d8016bcce106c61a93ffef27d292d194390014f572f39e11108c9237fc7c","src/um/profileapi.rs":"acd4bade4ea7700a87dc7cb1de1f2d507222a1f180d630bb7d3f833b9fb9e66b","src/um/propidl.rs":"5fc5bd30aae34b2c4ccb895e6f4cd18ad1f76fada5c43ff2bf7b1bfbc95bed3b","src/um/propkey.rs":"f643f0c82914623bf4f8dac89444923e4ce9d1e817839f504d26d1f2678b5bc5","src/um/propkeydef.rs":"4ad252db7f7e2ef6036fc1038626e4d2aee87df969c291b8b56cf52e2c263c73","src/um/propsys.rs":"ce3a51c6a459c862d34b4230a8574b72885bff5d691b4fe0ad233ca74e155f19","src/um/prsht.rs":"8ec88e21b0b631cfacdbec2a372f149bf08e161f7ac497b492a68dee65b8a5de","src/um/psapi.rs":"b809d780525a29e7a637a5a780defee09ee4804c1231e3adcb63a69bfe5c3bc9","src/um/realtimeapiset.rs":"9d81b0be632bc47792b64200f53265f10566d23e1c1c553b7dffea735df0cf4a","src/um/reason.rs":"549d332c627a67e685feacf78422ff1a0344c5702fb80b3c59aeebf445e3219a","src/um/restartmanager.rs":"3927a5474e00ac780136f13d34299098a55cf62824660aed0afdf7cd8f595d6f","src/um/restrictederrorinfo.rs":"92b894ebcdd96bbf103e5fd7bc1788dc6a0c3122b92c792ff82f9805d96d8f0f","src/um/rmxfguid.rs":"daa2c44163ff6f561d449e4d80e9da0720367d254d699d0d1e70b8f8dc4753b6","src/um/rtinfo.rs":"a46d9c535bc59bf06e307345e7bb360a9aebebab4de0db98b698155eb6842e0f","src/um/sapi.rs":"b1bcf84ddf76b2276a4f297f9cebf02da17b9f4a218a861da1cf4e941ccea6d8","src/um/sapi51.rs":"9312df143531e651017bbfb15e5214ed562522a779f52b71c83eea3628f321dd","src/um/sapi53.rs":"52e5dfe376218af9ef61475e007a420a855e32e4ee50bc3a2448cc746ffdc5ae","src/um/sapiddk.rs":"9a02d38c3d7d8de18e50e4625a58870a3f60ab6d30af05f32d2f72aafb1227fa","src/um/sapiddk51.rs":"7b4f2fca16380588265e1040b86252a797bd52a0f57672b7a558370659ba827f","src/um/schannel.rs":"877a45c94d58aa2c1cb391082efdfcc637798f1608d9c7b7fad3df6ed21e85a6","src/um/securityappcontainer.rs":"da4f8a62469551df54895954f1b5a3213ce3b30c696d213099a9d84bc4c6cc28","src/um/securitybaseapi.rs":"3bef5511f753cd421046d218e72fc11f2d030e45dab41ac0ceeb12dce247b6c4","src/um/servprov.rs":"078e0fb30bbe7f98bf1f7a149a54d47fd94a343eb0c9c8e4b7db01b1acee8a94","src/um/setupapi.rs":"041d74c2f2b89ea490684c3578e6624552c3f0fce46641b9b515cef57aae7d75","src/um/shellapi.rs":"7821b1d66b1e5f1d0c14c289f201108f32e4784d9eed6a2d20e7a9207670e3a7","src/um/shellscalingapi.rs":"f71f7e28f50788072dafc774e1d596c1f3be5e141770647c3662e0a9e3382f5b","src/um/shlobj.rs":"2401dd1b5115aa3aa77071b2b3f865693a6c4a329782c56f2409eb2f811e3e38","src/um/shobjidl.rs":"8b32148c8d6f27ebad97b7befca2818a13392dbae0c0008ef6cc306df32265b1","src/um/shobjidl_core.rs":"9aee926f12dd520484146fe75e1f00944699bfa98736786abe8cbb3e41f0bbb8","src/um/shtypes.rs":"56ecaf1a140ced304f72ffad40cc039c9441cf23a6769c316cf1b208ab969911","src/um/softpub.rs":"5441354118ea187c16e5ca1fa74e2095c27f50a638ee5efe386d11fb3bd10042","src/um/spapidef.rs":"33c5640efed3a3a2fff39a8ce6f6b7116d782bb5c6e14dfdd28fa99d34e2a163","src/um/spellcheck.rs":"e503bc995ff697992c75dfac32821fe6e8e05fee3183a3f3114e854430b0642c","src/um/sporder.rs":"231daffd462139a12f82154a7d86269fba81769c9fac1ce6004d249fa004e83f","src/um/sql.rs":"796be1297cbddd6dedc4f50fb6c23be7aeb62d4e99a2bafd9c1ef4491c542899","src/um/sqlext.rs":"53a0a990ed2a07c3cd3ecdb9151c1a1324cdfcb073fce137844c13e1ffdd683e","src/um/sqltypes.rs":"d612b65d1a1e693e7aa524fa1017e46faccfbd9cf8b054f40d18edaeb2360237","src/um/sqlucode.rs":"98f702ff84f471b54d0085d8e8cdf48b240dcd357166d19f4bad36886f592816","src/um/sspi.rs":"ebdada76c11c250e5a86c01ce4d4645180f81ef0b0f798511b2db18039d0251e","src/um/stringapiset.rs":"d2189a2af906f0fd38ac646eabb77558205e45c04f366c5bffc840b74cfe0aa1","src/um/strmif.rs":"feaddd73ce6cf17f8f0d7f48ebc2e5e2c25b6e9407e812bc31d048c66918c1d1","src/um/subauth.rs":"35200a700b6530cd4740b1e06021e8feece191dc25fd511bbba595a76541f39d","src/um/synchapi.rs":"6fc3c10bc643dfbaefb404614ca1b56aff506651c0a5f74db48fa682e919f510","src/um/sysinfoapi.rs":"0d46b6ec5932d7660993d6d8aab3a35b5548a34e2c072bdaf69e11a7cc1250cf","src/um/systemtopologyapi.rs":"324eadb5b5c63f8d39b7f1609e95ba9141cca74d775f8e7d4da9e0c3a6793340","src/um/taskschd.rs":"4d6bd2126245da589d120391419f7b2e21ef2cb1003c8119cf7d697883c53e00","src/um/textstor.rs":"df98ffff6afd789ed1d745547ffb8f0b9602ffa756c6afaa1b582249eee37e40","src/um/threadpoolapiset.rs":"8592e647532c79a730e01a6d7c9fbc95ef03b27c05add10b657d2df2c9f8f485","src/um/threadpoollegacyapiset.rs":"e1984f442cca48c1b706778f458a1631fa783883a6999ecf66aea2845b578f19","src/um/timeapi.rs":"71dafc528d31466af0ec57e1be6697410e859f377d791b20f059c874ebb2b974","src/um/timezoneapi.rs":"67e11f24f28651e9739cd203ae8801d283740d6ae8243e76f2af85b041475551","src/um/tlhelp32.rs":"7c7e52a1bb0b9e1e158c311f2a49fd71fe469c390e95adb81a9a5c81044b1404","src/um/unknwnbase.rs":"56f8a56b7adbb7510bb990e92c626af46df884a356d5f8f2be776c2245d00f19","src/um/urlhist.rs":"ea0619e685ed7ea8f7f602ba142789f2bada3e397352a998999a8399b5b2120e","src/um/urlmon.rs":"8b2bf7cf12742cc8679f381961ab98551e0fa87abd96c8381b47f5feebaf3132","src/um/userenv.rs":"87624ffe6dead461a24302281eeba755d5af8f6a854211e9749d9ecb3e2f0094","src/um/usp10.rs":"cfba2b23a1e140592d4fa6f8c4a0b243cde12c5000a130d91e9a712f85a94d27","src/um/utilapiset.rs":"860578b704b208e3b7714834ada6e02f6cc0505fdac0ae6214ce6cdc01c0d3c8","src/um/uxtheme.rs":"30d4231c974cd1147ae650b0f5a34d0cb2df3ec64c1b9794c85ce83b9a54ef11","src/um/vsbackup.rs":"a6688644b9034a1d830b672fb3c0f7d38158ecd63af53392870629906c9a8c7e","src/um/vss.rs":"d1731203e029d0a5c23a427f2dabc8f789f512ef1f1bdd15ebd7c7322c7cea4f","src/um/vsserror.rs":"f35c941c9cb034667e6c344bb0ebd2935baf9ecbf32ef7d5988f19d8f3df089a","src/um/vswriter.rs":"9e48f7ecbeadf0db7bae2476f577a4895bcf04843dd4ac4fbdb7db6bd03926a4","src/um/wbemads.rs":"9d2ae66e77f4c0bc50ccb1cccd269ca515d799e298d437ce06085d7b81dd443d","src/um/wbemcli.rs":"9af6eba597f1ed8081d2f5ea3ccadcb17b40d63c8134d6fe40b3eda06b5a3c8f","src/um/wbemdisp.rs":"f6d45ad8a9ec8d9a5c86c74d3163e7fb2d180a09ea96782a6c6a69797128c61a","src/um/wbemprov.rs":"13e29281c2d6a930068754cefdf699ba9d59826b8b3d39c0726fa2e9d680a3a3","src/um/wbemtran.rs":"e5abd15d360926810b06f9b2486223ad7416fbf0884f3a701faab29dbd250023","src/um/wct.rs":"0db574400292a398f026385517d7c5c17e9a2a5dae75898438cdd98ea8ef50a2","src/um/werapi.rs":"f88fe4bcee326c3761871ea28e9c60624f14ae0a932f28eb49b4be2edbb7a0e0","src/um/winbase.rs":"543fbea7c4e3a2882cd798dfe02a763dd67ee52f12e351963a6ebadd03bed49b","src/um/wincodec.rs":"e6154a593974593ca992a9ee3752617f1abd6a6270bc21b1d5b1b2bd92c35c1a","src/um/wincodecsdk.rs":"f62c504e1f49e385eace2e92f7a11435615c3b95d2eb03adf03dd9b4816952fe","src/um/wincon.rs":"26709392100dcb843e239c72f0740cafa7504e68fd0f9a77441d0153742dc3ee","src/um/wincontypes.rs":"1d0977849850bc937a9a7dfc853ee732bbb7c0aa54c14c74de9635afb8db304d","src/um/wincred.rs":"e28c7f7cf7c2b317823e76bac4bb7b640007be339a93925abb8bc77a0983341e","src/um/wincrypt.rs":"47e1c68038a38dff8e89fdfc22e895327dc26cacf7bd1c75004a2fb08f095e3b","src/um/windowsceip.rs":"754fc7ccea015c4c00e1bcf19b92d16801f50ce37c1fc889fbc7494f8634c9d3","src/um/winefs.rs":"4684a567089f70db9372cd4bbe8875e04d6668d537b1e1ef1a70b3f47d1ea0f1","src/um/winevt.rs":"d11dd7357b0d6d55e2fb6b0ad692eab9d5668a35ac9a19e5d5887aa9d7373c33","src/um/wingdi.rs":"c8ef4d859a990e8758123b88b49a66db461529f444f373566a87eaec68d9a2c3","src/um/winhttp.rs":"a28b7d5b45e215faeca04f7fc25ffc0369e1cbcde12b61980276307e1c67a245","src/um/wininet.rs":"501cd35f233de092c45fef2c0003fd864670122dd7b63702d7fe6c1d7b3dc7f9","src/um/winineti.rs":"b6288aa923100568c09e4350ac9340dcf582629f52e91eb6b195ffbca1619549","src/um/winioctl.rs":"744fc84e30f198995db261d1de09d4a13e2937be5325d7888c840aa0d60ad7be","src/um/winnetwk.rs":"b0153509998e107790099ce1a160e38bd095b2b6bac9ddf7d1b2490db609f3b6","src/um/winnls.rs":"d55d3470239da9551b61a58abd47e71ab7cd55a13223baffba33fde6a44c677b","src/um/winnt.rs":"00802d8ab4f5b4abcc8386ac0b4726737c874365d9f01660290e189f325256d7","src/um/winreg.rs":"87565aa55796b74442546039313609a9a0f7be4159b9200824f1be1479d6c2c9","src/um/winsafer.rs":"4680859e90029ad4447ac226f667f3290d99c7a0bff8e17c595f2bdca2d63fd3","src/um/winscard.rs":"3e55793eb45ac8770adb94227b0a9431fb3545bbe1b46e40234ad51d9432152c","src/um/winsmcrd.rs":"622c977577ec7a1820b94bba1d1b34686a406c7516d03683c6e89177a5d580a6","src/um/winsock2.rs":"00494aec15b71ed6a58377caf45d33cda7feacdc15cf7cfbc0503a20be48303d","src/um/winspool.rs":"4f47ab86631ac3dffd5ed34d3d0183bb931e05aa8cb9c1f8c2c1511bcd3c7b49","src/um/winsvc.rs":"fce2ee26123706c1bf812037d68c8d39f4edce7bf06b3263fce2e8aa7697ed27","src/um/wintrust.rs":"6dc5269a1a24c0fb9807bdee91d728e329eaa4ef432164cb04063708383cda99","src/um/winusb.rs":"8c7ac644694d02166f531e1b2d1f6363347703a8f3a75fc30df4e30f8886c8a8","src/um/winuser.rs":"cfdce5ad8d688b172bc2bb8cd59ff5686f8d7c28c3fb948b5ab976a546ad6554","src/um/winver.rs":"aa2b3097709177507db69887e905cca198371edf4338c6a4264442bf09b85c13","src/um/wlanapi.rs":"ed587ead7551434215ac0dfb9c18338bff2fdf9fbb3b587bece80917563551a9","src/um/wlanihv.rs":"4e6e093f8382f89eb61f2637400c753fabeb415c1bdb5665f3617fe2cbec12e4","src/um/wlanihvtypes.rs":"90db67bdefb917f9c0528f85d81f80546ed46965881908166ba5eb49c7c1a072","src/um/wlclient.rs":"b046614a7c9fa57d8350faaeb6e7f68ee25b7fccccac5736bb688548d75839fc","src/um/wow64apiset.rs":"f696bfbc85a0a6aff12834a97995eb788ca6f6c374aa011d1c86c4bf652cee5f","src/um/wpdmtpextensions.rs":"443482e1c3e56846a770beaab9da0e2cd0d316671d9c09a29551938cee426058","src/um/ws2bth.rs":"f32fbac09b121d61075afecef889910d72c6de32329d385b319fd5820160737e","src/um/ws2spi.rs":"09ace81f4cabba4a6b823cf7956d2b64dc05556b498525758969ee76d6c2b328","src/um/ws2tcpip.rs":"11ef57db8079c80808d66c690a9939445bd7b426a3eabcbfb024056110cebe94","src/um/wtsapi32.rs":"ac361d720c244decdeea8df3b2e3be1265d029476adfe4defce76f4f1cf73c7f","src/um/xinput.rs":"6a45e87158f792bb7ba134ee3018d39e5d617dc09478104530acb6b83b5a0e17","src/vc/excpt.rs":"2185de9facc033bb12513f0c2c851bae67d7999d92eef93a7b548450f8327f30","src/vc/limits.rs":"d185e499e763ca8d44a25bc0436d89bbd0449ce2d8d462ab769b771ab6037b9b","src/vc/mod.rs":"83e90f960b0bb188ccb564014c0331c205faca0ab1631b1f97424c9f301ac133","src/vc/vadefs.rs":"922df6214f27177b5a260196a3ef8423afcf2c4684948f527b24bae35a6371e8","src/vc/vcruntime.rs":"f56e53bca9d825c72a8f184ff1094931eca11a28ae504be7030e0cea29e5ac3f","src/winrt/activation.rs":"8815db03763114f8f70473e851aa32f998c9d6640edf2b46449035f4d0a21099","src/winrt/hstring.rs":"80373e386d521e69703fdd21e809633f6a7cbbab569dfa4fb186d85b451bb817","src/winrt/inspectable.rs":"6ead05e5c87d59c7c01636a1fcfda188747c35f95d9bf0d557c2d10f3332bf2e","src/winrt/mod.rs":"98cbd2088dd2f7c25a1d9b608fe49b5fc90bafcec94eb80fd8da4b3437ea47c8","src/winrt/roapi.rs":"7590576112f23d17650ad716785a801eab0ebc2db7b65829f57c0fe704ab583b","src/winrt/robuffer.rs":"5000d5cb33ebf77f801ab68f55ad14f36fb55663f0d4a203b26669445040cff3","src/winrt/roerrorapi.rs":"716b0ef60d9d9d0538f894e9c7d5413b398de33280f3308186873b993024c0b0","src/winrt/winstring.rs":"d7318e090000ca3bc644a6310d36a27179e3cc5624a1e35c20ec0dc332057b53"},"package":"5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"} \ No newline at end of file diff --git a/bash-5.1/vendor/winapi/Cargo.toml b/bash-5.1/vendor/winapi/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..beeaf338567547fefa05df1ecbd61f8c60eb856c --- /dev/null +++ b/bash-5.1/vendor/winapi/Cargo.toml @@ -0,0 +1,434 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +name = "winapi" +version = "0.3.9" +authors = ["Peter Atashian "] +build = "build.rs" +include = ["/src/**/*", "/Cargo.toml", "/LICENSE-MIT", "/LICENSE-APACHE", "/build.rs", "/README.md"] +description = "Raw FFI bindings for all of Windows API." +documentation = "https://docs.rs/winapi/" +readme = "README.md" +keywords = ["windows", "ffi", "win32", "com", "directx"] +categories = ["external-ffi-bindings", "no-std", "os::windows-apis"] +license = "MIT/Apache-2.0" +repository = "https://github.com/retep998/winapi-rs" +[package.metadata.docs.rs] +default-target = "x86_64-pc-windows-msvc" +features = ["everything", "impl-debug", "impl-default"] +targets = ["aarch64-pc-windows-msvc", "i686-pc-windows-msvc", "x86_64-pc-windows-msvc"] + +[features] +accctrl = [] +aclapi = [] +activation = [] +adhoc = [] +appmgmt = [] +audioclient = [] +audiosessiontypes = [] +avrt = [] +basetsd = [] +bcrypt = [] +bits = [] +bits10_1 = [] +bits1_5 = [] +bits2_0 = [] +bits2_5 = [] +bits3_0 = [] +bits4_0 = [] +bits5_0 = [] +bitscfg = [] +bitsmsg = [] +bluetoothapis = [] +bluetoothleapis = [] +bthdef = [] +bthioctl = [] +bthledef = [] +bthsdpdef = [] +bugcodes = [] +cderr = [] +cfg = [] +cfgmgr32 = [] +cguid = [] +combaseapi = [] +coml2api = [] +commapi = [] +commctrl = [] +commdlg = [] +commoncontrols = [] +consoleapi = [] +corecrt = [] +corsym = [] +d2d1 = [] +d2d1_1 = [] +d2d1_2 = [] +d2d1_3 = [] +d2d1effectauthor = [] +d2d1effects = [] +d2d1effects_1 = [] +d2d1effects_2 = [] +d2d1svg = [] +d2dbasetypes = [] +d3d = [] +d3d10 = [] +d3d10_1 = [] +d3d10_1shader = [] +d3d10effect = [] +d3d10misc = [] +d3d10sdklayers = [] +d3d10shader = [] +d3d11 = [] +d3d11_1 = [] +d3d11_2 = [] +d3d11_3 = [] +d3d11_4 = [] +d3d11on12 = [] +d3d11sdklayers = [] +d3d11shader = [] +d3d11tokenizedprogramformat = [] +d3d12 = [] +d3d12sdklayers = [] +d3d12shader = [] +d3d9 = [] +d3d9caps = [] +d3d9types = [] +d3dcommon = [] +d3dcompiler = [] +d3dcsx = [] +d3dkmdt = [] +d3dkmthk = [] +d3dukmdt = [] +d3dx10core = [] +d3dx10math = [] +d3dx10mesh = [] +datetimeapi = [] +davclnt = [] +dbghelp = [] +dbt = [] +dcommon = [] +dcomp = [] +dcompanimation = [] +dcomptypes = [] +dde = [] +ddraw = [] +ddrawi = [] +ddrawint = [] +debug = ["impl-debug"] +debugapi = [] +devguid = [] +devicetopology = [] +devpkey = [] +devpropdef = [] +dinput = [] +dinputd = [] +dispex = [] +dmksctl = [] +dmusicc = [] +docobj = [] +documenttarget = [] +dot1x = [] +dpa_dsa = [] +dpapi = [] +dsgetdc = [] +dsound = [] +dsrole = [] +dvp = [] +dwmapi = [] +dwrite = [] +dwrite_1 = [] +dwrite_2 = [] +dwrite_3 = [] +dxdiag = [] +dxfile = [] +dxgi = [] +dxgi1_2 = [] +dxgi1_3 = [] +dxgi1_4 = [] +dxgi1_5 = [] +dxgi1_6 = [] +dxgidebug = [] +dxgiformat = [] +dxgitype = [] +dxva2api = [] +dxvahd = [] +eaptypes = [] +enclaveapi = [] +endpointvolume = [] +errhandlingapi = [] +everything = [] +evntcons = [] +evntprov = [] +evntrace = [] +excpt = [] +exdisp = [] +fibersapi = [] +fileapi = [] +functiondiscoverykeys_devpkey = [] +gl-gl = [] +guiddef = [] +handleapi = [] +heapapi = [] +hidclass = [] +hidpi = [] +hidsdi = [] +hidusage = [] +highlevelmonitorconfigurationapi = [] +hstring = [] +http = [] +ifdef = [] +ifmib = [] +imm = [] +impl-debug = [] +impl-default = [] +in6addr = [] +inaddr = [] +inspectable = [] +interlockedapi = [] +intsafe = [] +ioapiset = [] +ipexport = [] +iphlpapi = [] +ipifcons = [] +ipmib = [] +iprtrmib = [] +iptypes = [] +jobapi = [] +jobapi2 = [] +knownfolders = [] +ks = [] +ksmedia = [] +ktmtypes = [] +ktmw32 = [] +l2cmn = [] +libloaderapi = [] +limits = [] +lmaccess = [] +lmalert = [] +lmapibuf = [] +lmat = [] +lmcons = [] +lmdfs = [] +lmerrlog = [] +lmjoin = [] +lmmsg = [] +lmremutl = [] +lmrepl = [] +lmserver = [] +lmshare = [] +lmstats = [] +lmsvc = [] +lmuse = [] +lmwksta = [] +lowlevelmonitorconfigurationapi = [] +lsalookup = [] +memoryapi = [] +minschannel = [] +minwinbase = [] +minwindef = [] +mmdeviceapi = [] +mmeapi = [] +mmreg = [] +mmsystem = [] +mprapidef = [] +msaatext = [] +mscat = [] +mschapp = [] +mssip = [] +mstcpip = [] +mswsock = [] +mswsockdef = [] +namedpipeapi = [] +namespaceapi = [] +nb30 = [] +ncrypt = [] +netioapi = [] +nldef = [] +ntddndis = [] +ntddscsi = [] +ntddser = [] +ntdef = [] +ntlsa = [] +ntsecapi = [] +ntstatus = [] +oaidl = [] +objbase = [] +objidl = [] +objidlbase = [] +ocidl = [] +ole2 = [] +oleauto = [] +olectl = [] +oleidl = [] +opmapi = [] +pdh = [] +perflib = [] +physicalmonitorenumerationapi = [] +playsoundapi = [] +portabledevice = [] +portabledeviceapi = [] +portabledevicetypes = [] +powerbase = [] +powersetting = [] +powrprof = [] +processenv = [] +processsnapshot = [] +processthreadsapi = [] +processtopologyapi = [] +profileapi = [] +propidl = [] +propkey = [] +propkeydef = [] +propsys = [] +prsht = [] +psapi = [] +qos = [] +realtimeapiset = [] +reason = [] +restartmanager = [] +restrictederrorinfo = [] +rmxfguid = [] +roapi = [] +robuffer = [] +roerrorapi = [] +rpc = [] +rpcdce = [] +rpcndr = [] +rtinfo = [] +sapi = [] +sapi51 = [] +sapi53 = [] +sapiddk = [] +sapiddk51 = [] +schannel = [] +sddl = [] +securityappcontainer = [] +securitybaseapi = [] +servprov = [] +setupapi = [] +shellapi = [] +shellscalingapi = [] +shlobj = [] +shobjidl = [] +shobjidl_core = [] +shtypes = [] +softpub = [] +spapidef = [] +spellcheck = [] +sporder = [] +sql = [] +sqlext = [] +sqltypes = [] +sqlucode = [] +sspi = [] +std = [] +stralign = [] +stringapiset = [] +strmif = [] +subauth = [] +synchapi = [] +sysinfoapi = [] +systemtopologyapi = [] +taskschd = [] +tcpestats = [] +tcpmib = [] +textstor = [] +threadpoolapiset = [] +threadpoollegacyapiset = [] +timeapi = [] +timezoneapi = [] +tlhelp32 = [] +transportsettingcommon = [] +tvout = [] +udpmib = [] +unknwnbase = [] +urlhist = [] +urlmon = [] +usb = [] +usbioctl = [] +usbiodef = [] +usbscan = [] +usbspec = [] +userenv = [] +usp10 = [] +utilapiset = [] +uxtheme = [] +vadefs = [] +vcruntime = [] +vsbackup = [] +vss = [] +vsserror = [] +vswriter = [] +wbemads = [] +wbemcli = [] +wbemdisp = [] +wbemprov = [] +wbemtran = [] +wct = [] +werapi = [] +winbase = [] +wincodec = [] +wincodecsdk = [] +wincon = [] +wincontypes = [] +wincred = [] +wincrypt = [] +windef = [] +windot11 = [] +windowsceip = [] +windowsx = [] +winefs = [] +winerror = [] +winevt = [] +wingdi = [] +winhttp = [] +wininet = [] +winineti = [] +winioctl = [] +winnetwk = [] +winnls = [] +winnt = [] +winreg = [] +winsafer = [] +winscard = [] +winsmcrd = [] +winsock2 = [] +winspool = [] +winstring = [] +winsvc = [] +wintrust = [] +winusb = [] +winusbio = [] +winuser = [] +winver = [] +wlanapi = [] +wlanihv = [] +wlanihvtypes = [] +wlantypes = [] +wlclient = [] +wmistr = [] +wnnc = [] +wow64apiset = [] +wpdmtpextensions = [] +ws2bth = [] +ws2def = [] +ws2ipdef = [] +ws2spi = [] +ws2tcpip = [] +wtsapi32 = [] +wtypes = [] +wtypesbase = [] +xinput = [] +[target.i686-pc-windows-gnu.dependencies.winapi-i686-pc-windows-gnu] +version = "0.4" +[target.x86_64-pc-windows-gnu.dependencies.winapi-x86_64-pc-windows-gnu] +version = "0.4" diff --git a/bash-5.1/vendor/winapi/LICENSE-APACHE b/bash-5.1/vendor/winapi/LICENSE-APACHE new file mode 100644 index 0000000000000000000000000000000000000000..8dada3edaf50dbc082c9a125058f25def75e625a --- /dev/null +++ b/bash-5.1/vendor/winapi/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bash-5.1/vendor/winapi/LICENSE-MIT b/bash-5.1/vendor/winapi/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..6f1b4c850cd2bd0d165f122c0274afc95e10a851 --- /dev/null +++ b/bash-5.1/vendor/winapi/LICENSE-MIT @@ -0,0 +1,19 @@ +Copyright (c) 2015-2018 The winapi-rs Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/bash-5.1/vendor/winapi/README.md b/bash-5.1/vendor/winapi/README.md new file mode 100644 index 0000000000000000000000000000000000000000..18664493332b4db852705321bf184acb7947e947 --- /dev/null +++ b/bash-5.1/vendor/winapi/README.md @@ -0,0 +1,90 @@ +# winapi-rs +[![Build status](https://github.com/retep998/winapi-rs/workflows/Rust/badge.svg)](https://github.com/retep998/winapi-rs/actions) +[![Build status](https://ci.appveyor.com/api/projects/status/i47oonf5e7qm5utq/branch/0.3?svg=true)](https://ci.appveyor.com/project/retep998/winapi-rs/branch/0.3) +[![Build Status](https://travis-ci.org/retep998/winapi-rs.svg?branch=0.3)](https://travis-ci.org/retep998/winapi-rs) +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/retep998/winapi-rs) +[![Crates.io](https://img.shields.io/crates/v/winapi.svg)](https://crates.io/crates/winapi) +![Lines of Code](https://tokei.rs/b1/github/retep998/winapi-rs) +![100% unsafe](https://img.shields.io/badge/unsafe-100%25-blue.svg) +[![Open issues](https://img.shields.io/github/issues-raw/retep998/winapi-rs.svg)](https://github.com/retep998/winapi-rs/issues) +[![License](https://img.shields.io/crates/l/winapi.svg)](https://github.com/retep998/winapi-rs) + + +[Documentation](https://docs.rs/winapi/) + +Official communication channel: #windows-dev on the [Rust Community Discord](https://discord.gg/aVESxV8) + +This crate provides raw FFI bindings to all of Windows API. They are gathered by hand using the Windows 10 SDK from Microsoft. I aim to replace all existing Windows FFI in other crates with this crate through the "[Embrace, extend, and extinguish](https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish)" technique. + +If this crate is missing something you need, feel free to create an issue, open a pull request, or contact me via [other means](https://www.rustaceans.org/retep998). + +This crate depends on Rust 1.6 or newer on Windows. On other platforms this crate is a no-op and should compile with Rust 1.2 or newer. + +## Frequently asked questions ## + +### How do I create an instance of a union? + +Use `std::mem::zeroed()` to create an instance of the union, and then assign the value you want using one of the variant methods. + +### Why am I getting errors about unresolved imports? + +Each module is gated on a feature flag, so you must enable the appropriate feature to gain access to those items. For example, if you want to use something from `winapi::um::winuser` you must enable the `winuser` feature. + +### How do I know which module an item is defined in? + +You can use the search functionality in the [documentation](https://docs.rs/winapi/) to find where items are defined. + +### Why is there no documentation on how to use anything? + +This crate is nothing more than raw bindings to Windows API. If you wish to know how to use the various functionality in Windows API, you can look up the various items on [MSDN](https://msdn.microsoft.com/en-us/library/windows/desktop/aa906039) which is full of detailed documentation. + +### Can I use this library in `no_std` projects? + +Yes, absolutely! By default the `std` feature of `winapi` is disabled, allowing you to write Windows applications using nothing but `core` and `winapi`. + +### Why is `winapi`'s `HANDLE` incompatible with `std`'s `HANDLE`? + +Because `winapi` does not depend on `std` by default, it has to define `c_void` itself instead of using `std::os::raw::c_void`. However, if you enable the `std` feature of `winapi` then it will re-export `c_void` from `std` and cause `winapi`'s `HANDLE` to be the same type as `std`'s `HANDLE`. + +### Should I still use those `-sys` crates such as `kernel32-sys`? + +No. Those crates are a legacy of how `winapi` 0.2 was organized. Starting with `winapi` 0.3 all definitions are directly in `winapi` itself, and so there is no longer any need to use those `-sys` crates. + +## Example ## + +Cargo.toml: +```toml +[target.'cfg(windows)'.dependencies] +winapi = { version = "0.3", features = ["winuser"] } +``` +main.rs: +```Rust +#[cfg(windows)] extern crate winapi; +use std::io::Error; + +#[cfg(windows)] +fn print_message(msg: &str) -> Result { + use std::ffi::OsStr; + use std::iter::once; + use std::os::windows::ffi::OsStrExt; + use std::ptr::null_mut; + use winapi::um::winuser::{MB_OK, MessageBoxW}; + let wide: Vec = OsStr::new(msg).encode_wide().chain(once(0)).collect(); + let ret = unsafe { + MessageBoxW(null_mut(), wide.as_ptr(), wide.as_ptr(), MB_OK) + }; + if ret == 0 { Err(Error::last_os_error()) } + else { Ok(ret) } +} +#[cfg(not(windows))] +fn print_message(msg: &str) -> Result<(), Error> { + println!("{}", msg); + Ok(()) +} +fn main() { + print_message("Hello, world!").unwrap(); +} +``` + +## Financial Support +Do you use `winapi` in your projects? If so, you may be interested in financially supporting me on [Patreon](https://www.patreon.com/retep998). Companies in particular are especially encouraged to donate (I'm looking at you [Microsoft](https://github.com/Azure/iotedge/tree/master/edgelet)). diff --git a/bash-5.1/vendor/winapi/build.rs b/bash-5.1/vendor/winapi/build.rs new file mode 100644 index 0000000000000000000000000000000000000000..6220504953186f7f34af76489ffe69e7aefbeb42 --- /dev/null +++ b/bash-5.1/vendor/winapi/build.rs @@ -0,0 +1,527 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use std::cell::Cell; +use std::collections::HashMap; +use std::env::var; +// (header name, &[header dependencies], &[library dependencies]) +const DATA: &'static [(&'static str, &'static [&'static str], &'static [&'static str])] = &[ + // km + ("d3dkmthk", &["basetsd", "d3dukmdt", "minwindef", "ntdef", "windef"], &[]), + // mmos + // shared + ("basetsd", &[], &[]), + ("bcrypt", &["minwindef", "winnt"], &["bcrypt"]), + ("bthdef", &["bthsdpdef", "guiddef", "minwindef", "ntdef"], &[]), + ("bthioctl", &["bthdef", "bthsdpdef", "minwindef", "ntdef", "winioctl"], &[]), + ("bthsdpdef", &["guiddef", "minwindef", "ntdef"], &[]), + ("bugcodes", &["ntdef"], &[]), + ("cderr", &["minwindef"], &[]), + ("cfg", &["minwindef"], &[]), + ("d3d9", &["basetsd", "d3d9caps", "d3d9types", "guiddef", "minwindef", "unknwnbase", "windef", "wingdi", "winnt"], &["d3d9"]), + ("d3d9caps", &["d3d9types", "guiddef", "minwindef", "winnt"], &[]), + ("d3d9types", &["basetsd", "guiddef", "minwindef", "windef", "winnt"], &[]), + ("d3dkmdt", &["basetsd", "minwindef", "ntdef"], &[]), + ("d3dukmdt", &["basetsd", "guiddef", "minwindef", "ntdef"], &[]), + ("dcomptypes", &["dxgitype", "minwindef", "winnt"], &[]), + ("devguid", &[], &[]), + ("devpkey", &["devpropdef"], &[]), + ("devpropdef", &["guiddef", "minwindef", "winnt"], &[]), + ("dinputd", &[], &[]), + ("dxgi", &["basetsd", "dxgiformat", "dxgitype", "guiddef", "minwindef", "unknwnbase", "windef", "winnt"], &["dxgi"]), + ("dxgi1_2", &["basetsd", "dxgi", "dxgiformat", "dxgitype", "guiddef", "minwinbase", "minwindef", "unknwnbase", "windef", "winnt"], &[]), + ("dxgi1_3", &["dxgi", "dxgi1_2", "dxgiformat", "guiddef", "minwindef", "unknwnbase", "windef", "winnt"], &["dxgi"]), + ("dxgi1_4", &["basetsd", "dxgi1_2", "dxgi1_3", "dxgiformat", "dxgitype", "guiddef", "minwindef", "unknwnbase", "winnt"], &[]), + ("dxgi1_5", &["basetsd", "dxgi", "dxgi1_2", "dxgi1_3", "dxgi1_4", "dxgiformat", "minwindef", "unknwnbase", "winnt"], &[]), + ("dxgi1_6", &["basetsd", "dxgi1_2", "dxgi1_4", "dxgi1_5", "dxgitype", "guiddef", "minwindef", "windef", "winnt"], &[]), + ("dxgiformat", &[], &[]), + ("dxgitype", &["d3d9types", "dxgiformat", "minwindef"], &[]), + ("enclaveapi", &["basetsd", "minwinbase", "minwindef", "ntdef", "winnt"], &["kernel32"]), + ("evntprov", &["basetsd", "guiddef", "minwindef", "winnt"], &["advapi32"]), + ("evntrace", &["basetsd", "evntcons", "evntprov", "guiddef", "handleapi", "minwindef", "timezoneapi", "vadefs", "winnt", "wmistr"], &["advapi32"]), + ("guiddef", &[], &[]), + ("hidclass", &["guiddef", "minwindef", "winioctl", "winnt"], &[]), + ("hidpi", &["hidusage", "minwindef", "ntdef", "ntstatus", "winnt"], &["hid"]), + ("hidsdi", &["guiddef", "hidpi", "minwindef", "winnt"], &["hid"]), + ("hidusage", &["minwindef"], &[]), + ("ifdef", &["basetsd", "guiddef", "ntdef"], &[]), + ("ifmib", &["ifdef", "ipifcons", "minwindef", "ntdef"], &[]), + ("in6addr", &["minwindef"], &[]), + ("inaddr", &["minwindef"], &[]), + ("intsafe", &[], &[]), + ("ipifcons", &["minwindef"], &[]), + ("ipmib", &["ifdef", "ifmib", "minwindef", "nldef", "ntdef"], &[]), + ("iprtrmib", &["ipmib", "minwindef", "ntdef"], &[]), + ("ks", &[], &[]), + ("ksmedia", &["minwindef"], &[]), + ("ktmtypes", &["guiddef", "minwindef", "winnt"], &[]), + ("lmcons", &["minwindef", "winnt"], &[]), + ("minwindef", &["basetsd", "ntdef"], &[]), + ("mmreg", &["guiddef", "minwindef"], &[]), + ("mprapidef", &[], &[]), + ("mstcpip", &["basetsd", "guiddef", "in6addr", "inaddr", "minwindef", "winnt", "ws2def"], &["ntdll"]), + ("mswsockdef", &["minwindef", "winnt", "ws2def"], &[]), + ("netioapi", &["basetsd", "guiddef", "ifdef", "ipifcons", "minwindef", "nldef", "ntddndis", "ntdef", "ws2def", "ws2ipdef"], &["iphlpapi"]), + ("nldef", &["basetsd", "minwindef", "ntdef"], &[]), + ("ntddndis", &["ifdef", "minwindef"], &[]), + ("ntddscsi", &["basetsd", "minwindef", "ntdef", "winioctl", "winnt"], &[]), + ("ntddser", &["devpropdef"], &[]), + ("ntdef", &["basetsd", "guiddef"], &[]), + ("ntstatus", &["ntdef"], &[]), + ("qos", &["minwindef"], &[]), + ("rpc", &[], &[]), + ("rpcdce", &["guiddef", "minwindef", "rpc"], &[]), + ("rpcndr", &[], &[]), + ("sddl", &["basetsd", "minwindef", "winnt"], &["advapi32"]), + ("sspi", &["basetsd", "guiddef", "minwindef", "subauth", "wincred", "winnt"], &["credui", "secur32"]), + ("stralign", &["vcruntime", "winnt"], &["kernel32"]), + ("tcpestats", &["basetsd", "ntdef"], &[]), + ("tcpmib", &["basetsd", "in6addr", "minwindef", "ntdef"], &[]), + ("transportsettingcommon", &["guiddef"], &[]), + ("tvout", &["guiddef", "minwindef"], &[]), + ("udpmib", &["basetsd", "in6addr", "minwindef", "ntdef"], &[]), + ("usb", &["minwindef", "usbspec", "winnt"], &[]), + ("usbioctl", &["basetsd", "guiddef", "minwindef", "ntdef", "usb", "usbiodef", "usbspec", "winioctl"], &[]), + ("usbiodef", &["guiddef", "minwindef", "winioctl", "winnt"], &[]), + ("usbscan", &["ntdef", "winioctl"], &[]), + ("usbspec", &["basetsd", "guiddef", "minwindef", "winnt"], &[]), + ("windef", &["minwindef", "winnt"], &[]), + ("windot11", &["basetsd", "minwindef", "ntddndis", "winnt", "wlantypes"], &[]), + ("windowsx", &["minwindef"], &[]), + ("winerror", &["minwindef", "wtypesbase"], &[]), + ("winusbio", &["minwindef", "usb"], &[]), + ("wlantypes", &["basetsd", "minwindef"], &[]), + ("wmistr", &["basetsd", "guiddef", "minwindef", "winnt"], &[]), + ("wnnc", &["minwindef"], &[]), + ("ws2def", &["basetsd", "guiddef", "inaddr", "minwindef", "vcruntime", "winnt"], &[]), + ("ws2ipdef", &["in6addr", "inaddr", "minwindef", "ws2def"], &[]), + ("wtypes", &["guiddef", "minwindef", "ntdef", "rpcndr", "wingdi", "wtypesbase"], &[]), + ("wtypesbase", &["minwindef", "rpcndr", "winnt"], &[]), + // ucrt + ("corecrt", &[], &[]), + // um + ("accctrl", &["guiddef", "minwindef", "winbase", "winnt"], &[]), + ("aclapi", &["accctrl", "guiddef", "minwindef", "winnt"], &["advapi32"]), + ("adhoc", &["guiddef", "minwindef", "unknwnbase", "winnt"], &[]), + ("appmgmt", &["guiddef", "minwindef", "winnt"], &["advapi32"]), + ("audioclient", &["audiosessiontypes", "basetsd", "guiddef", "minwindef", "mmreg", "strmif", "unknwnbase", "winerror", "winnt", "wtypesbase"], &[]), + ("audiosessiontypes", &["minwindef"], &[]), + ("avrt", &["guiddef", "minwindef", "winnt"], &["avrt"]), + ("bits", &["basetsd", "guiddef", "minwindef", "unknwnbase", "winnt"], &[]), + ("bits10_1", &["basetsd", "bits", "bits2_0", "bits3_0", "bits5_0", "minwindef", "winnt"], &[]), + ("bits1_5", &["basetsd", "bits", "rpcndr", "winnt"], &[]), + ("bits2_0", &["basetsd", "bits", "bits1_5", "minwindef", "winnt"], &[]), + ("bits2_5", &["minwindef", "rpcndr", "unknwnbase", "winnt"], &[]), + ("bits3_0", &["basetsd", "bits", "bits2_0", "guiddef", "minwindef", "unknwnbase", "winnt"], &[]), + ("bits4_0", &["basetsd", "bits3_0", "minwindef", "unknwnbase", "winnt"], &[]), + ("bits5_0", &["basetsd", "bits1_5", "bits3_0", "bits4_0", "guiddef", "minwindef", "winnt"], &[]), + ("bitscfg", &["guiddef", "oaidl", "unknwnbase", "winnt", "wtypes"], &["oleaut32"]), + ("bitsmsg", &["minwindef"], &[]), + ("bluetoothapis", &["bthdef", "bthsdpdef", "guiddef", "minwinbase", "minwindef", "windef", "winnt"], &["bthprops"]), + ("bluetoothleapis", &["bthledef", "minwindef", "winerror", "winnt"], &["bluetoothapis"]), + ("bthledef", &["basetsd", "guiddef", "minwindef", "winnt"], &[]), + ("cfgmgr32", &["basetsd", "cfg", "devpropdef", "guiddef", "minwindef", "winnt", "winreg"], &["cfgmgr32"]), + ("cguid", &[], &[]), + ("combaseapi", &["basetsd", "guiddef", "minwindef", "objidl", "objidlbase", "propidl", "rpcdce", "unknwnbase", "winnt", "wtypesbase"], &["ole32"]), + ("coml2api", &["minwindef"], &[]), + ("commapi", &["minwinbase", "minwindef", "winbase", "winnt"], &["kernel32"]), + ("commctrl", &["basetsd", "commoncontrols", "guiddef", "minwinbase", "minwindef", "vcruntime", "windef", "winnt", "winuser"], &["comctl32"]), + ("commdlg", &["basetsd", "minwindef", "prsht", "unknwnbase", "windef", "wingdi", "winnt", "winuser"], &["comdlg32"]), + ("commoncontrols", &["commctrl", "guiddef", "minwindef", "unknwnbase", "windef", "winnt"], &["comctl32"]), + ("consoleapi", &["minwindef", "wincon", "wincontypes", "winnt"], &["kernel32"]), + ("corsym", &["basetsd", "objidlbase", "unknwnbase", "winnt"], &[]), + ("d2d1", &["basetsd", "d2dbasetypes", "d3dcommon", "dcommon", "dwrite", "dxgi", "guiddef", "minwindef", "unknwnbase", "wincodec", "windef", "winnt"], &["d2d1"]), + ("d2d1_1", &["basetsd", "d2d1", "d2d1effectauthor", "d2dbasetypes", "dcommon", "documenttarget", "dwrite", "dxgi", "dxgiformat", "guiddef", "minwindef", "objidlbase", "unknwnbase", "wincodec", "winnt"], &["d2d1"]), + ("d2d1_2", &["d2d1", "d2d1_1", "dxgi", "minwindef", "winnt"], &["d2d1"]), + ("d2d1_3", &["basetsd", "d2d1", "d2d1_1", "d2d1_2", "d2d1effects", "d2d1svg", "dcommon", "dwrite", "dxgi", "dxgitype", "minwindef", "ntdef", "objidlbase", "wincodec", "winerror"], &["d2d1"]), + ("d2d1effectauthor", &["basetsd", "d2d1", "d2d1_1", "d2dbasetypes", "d3dcommon", "dxgiformat", "guiddef", "minwindef", "ntdef", "unknwnbase", "wincodec"], &[]), + ("d2d1effects", &[], &[]), + ("d2d1effects_1", &[], &[]), + ("d2d1effects_2", &[], &[]), + ("d2d1svg", &["basetsd", "d2d1", "d2d1_1", "guiddef", "minwindef", "ntdef", "objidlbase", "winerror"], &[]), + ("d2dbasetypes", &["d3d9types", "dcommon"], &[]), + ("d3d", &[], &[]), + ("d3d10", &["d3dcommon"], &[]), + ("d3d10_1", &[], &[]), + ("d3d10_1shader", &[], &[]), + ("d3d10effect", &[], &[]), + ("d3d10misc", &[], &[]), + ("d3d10sdklayers", &[], &[]), + ("d3d10shader", &["d3d10", "d3dcommon", "minwindef", "unknwnbase", "winnt"], &[]), + ("d3d11", &["basetsd", "d3dcommon", "dxgi", "dxgiformat", "dxgitype", "guiddef", "minwindef", "unknwnbase", "windef", "winnt"], &["d3d11"]), + ("d3d11_1", &["basetsd", "d3d11", "d3dcommon", "dxgiformat", "dxgitype", "guiddef", "minwindef", "unknwnbase", "winnt"], &[]), + ("d3d11_2", &["basetsd", "d3d11", "d3d11_1", "dxgiformat", "minwindef", "winnt"], &[]), + ("d3d11_3", &[], &[]), + ("d3d11_4", &[], &[]), + ("d3d11on12", &["d3d11", "d3d12", "d3dcommon", "guiddef", "minwindef", "unknwnbase", "winnt"], &["d3d11"]), + ("d3d11sdklayers", &["basetsd", "d3d11", "dxgi", "minwindef", "unknwnbase", "winnt"], &[]), + ("d3d11shader", &["basetsd", "d3dcommon", "minwindef", "unknwnbase", "winnt"], &[]), + ("d3d11tokenizedprogramformat", &["minwindef"], &[]), + ("d3d12", &["basetsd", "d3dcommon", "dxgiformat", "dxgitype", "guiddef", "minwinbase", "minwindef", "unknwnbase", "windef", "winnt"], &["d3d12"]), + ("d3d12sdklayers", &["basetsd", "d3d12", "minwindef", "unknwnbase", "winnt"], &[]), + ("d3d12shader", &["basetsd", "d3dcommon", "minwindef", "unknwnbase", "winnt"], &[]), + ("d3dcommon", &["basetsd", "minwindef", "unknwnbase", "winnt"], &[]), + ("d3dcompiler", &["basetsd", "d3d11shader", "d3dcommon", "guiddef", "minwindef", "winnt"], &["d3dcompiler"]), + ("d3dcsx", &[], &[]), + ("d3dx10core", &[], &[]), + ("d3dx10math", &[], &[]), + ("d3dx10mesh", &[], &[]), + ("datetimeapi", &["minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("davclnt", &["minwindef", "winnt"], &["netapi32"]), + ("dbghelp", &["basetsd", "guiddef", "minwindef", "vcruntime", "winnt"], &["dbghelp"]), + ("dbt", &["basetsd", "guiddef", "minwindef", "winnt", "winuser"], &[]), + ("dcommon", &["basetsd", "dxgiformat", "minwindef", "windef"], &[]), + ("dcomp", &["d2d1", "d2d1_1", "d2d1effects", "d2dbasetypes", "d3d9types", "d3dcommon", "dcompanimation", "dcomptypes", "dxgi", "dxgi1_2", "dxgiformat", "guiddef", "minwinbase", "minwindef", "ntdef", "unknwnbase", "windef"], &["dcomp"]), + ("dcompanimation", &["ntdef", "unknwnbase"], &[]), + ("dde", &["basetsd", "minwindef"], &["user32"]), + ("ddraw", &[], &[]), + ("ddrawi", &[], &[]), + ("ddrawint", &[], &[]), + ("debugapi", &["minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("devicetopology", &["guiddef", "minwindef", "unknwnbase", "windef", "winnt", "wtypes"], &[]), + ("dinput", &[], &[]), + ("dispex", &["basetsd", "guiddef", "minwindef", "oaidl", "servprov", "unknwnbase", "winerror", "winnt", "wtypes"], &[]), + ("dmksctl", &[], &[]), + ("dmusicc", &[], &[]), + ("docobj", &["guiddef", "minwindef", "oaidl", "unknwnbase", "winnt"], &[]), + ("documenttarget", &["basetsd", "guiddef", "ntdef", "unknwnbase"], &[]), + ("dot1x", &["eaptypes", "guiddef", "l2cmn", "minwindef", "winnt"], &[]), + ("dpa_dsa", &["basetsd", "minwindef", "winnt"], &["comctl32"]), + ("dpapi", &["minwindef", "wincrypt", "windef", "winnt"], &["crypt32"]), + ("dsgetdc", &["guiddef", "minwindef", "ntsecapi", "winnt", "ws2def"], &["netapi32"]), + ("dsound", &["guiddef", "minwindef", "mmsystem", "unknwnbase", "windef", "winerror", "winnt"], &["dsound"]), + ("dsrole", &["guiddef", "minwindef", "winnt"], &["netapi32"]), + ("dvp", &[], &[]), + ("dwmapi", &["basetsd", "minwindef", "uxtheme", "windef", "winnt"], &["dwmapi"]), + ("dwrite", &["basetsd", "d2d1", "dcommon", "guiddef", "minwindef", "unknwnbase", "windef", "winerror", "wingdi", "winnt"], &["dwrite"]), + ("dwrite_1", &["basetsd", "dcommon", "dwrite", "minwindef", "winnt"], &[]), + ("dwrite_2", &["basetsd", "d3d9types", "dcommon", "dwrite", "dwrite_1", "minwindef", "unknwnbase", "winnt"], &[]), + ("dwrite_3", &["basetsd", "dcommon", "dwrite", "dwrite_1", "dwrite_2", "minwindef", "unknwnbase", "wingdi", "winnt"], &[]), + ("dxdiag", &[], &[]), + ("dxfile", &[], &[]), + ("dxgidebug", &["basetsd", "guiddef", "minwindef", "unknwnbase", "winnt"], &["dxgi"]), + ("dxva2api", &["basetsd", "d3d9", "d3d9types", "guiddef", "minwindef", "unknwnbase", "windef", "winnt"], &["dxva2"]), + ("dxvahd", &["d3d9", "d3d9types", "guiddef", "minwindef", "unknwnbase", "windef", "winnt"], &["dxva2"]), + ("eaptypes", &["guiddef", "minwindef", "winnt"], &[]), + ("endpointvolume", &["basetsd", "guiddef", "minwindef", "unknwnbase", "winnt"], &[]), + ("errhandlingapi", &["basetsd", "minwindef", "winnt"], &["kernel32"]), + ("evntcons", &["basetsd", "evntprov", "evntrace", "guiddef", "minwindef", "winnt"], &["advapi32"]), + ("exdisp", &["basetsd", "docobj", "oaidl", "ocidl", "winnt", "wtypes"], &[]), + ("fibersapi", &["minwindef", "winnt"], &["kernel32"]), + ("fileapi", &["minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("functiondiscoverykeys_devpkey", &["wtypes"], &[]), + ("gl-gl", &[], &["opengl32"]), + ("handleapi", &["minwindef", "winnt"], &["kernel32"]), + ("heapapi", &["basetsd", "minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("highlevelmonitorconfigurationapi", &["minwindef", "physicalmonitorenumerationapi", "winnt"], &["dxva2"]), + ("http", &["guiddef", "minwinbase", "minwindef", "sspi", "winnt", "ws2def"], &["httpapi"]), + ("imm", &["minwindef", "windef"], &["imm32"]), + ("interlockedapi", &["minwindef", "winnt"], &["kernel32"]), + ("ioapiset", &["basetsd", "minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("ipexport", &["basetsd", "in6addr", "ntdef"], &[]), + ("iphlpapi", &["basetsd", "ifdef", "ifmib", "ipexport", "ipmib", "iprtrmib", "iptypes", "minwinbase", "minwindef", "ntdef", "tcpestats", "tcpmib", "udpmib", "ws2def", "ws2ipdef"], &["iphlpapi"]), + ("iptypes", &["basetsd", "corecrt", "guiddef", "ifdef", "ipifcons", "minwindef", "nldef", "ntdef", "ws2def"], &[]), + ("jobapi", &["minwindef", "winnt"], &["kernel32"]), + ("jobapi2", &["basetsd", "minwinbase", "minwindef", "ntdef", "winnt"], &["kernel32"]), + ("knownfolders", &[], &[]), + ("ktmw32", &["guiddef", "minwinbase", "minwindef", "winnt"], &["ktmw32"]), + ("l2cmn", &["guiddef", "minwindef", "winnt"], &[]), + ("libloaderapi", &["basetsd", "minwindef", "winnt"], &["kernel32", "user32"]), + ("lmaccess", &["basetsd", "lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmalert", &["lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmapibuf", &["lmcons", "minwindef"], &["netapi32"]), + ("lmat", &["basetsd", "lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmdfs", &["guiddef", "lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmerrlog", &["minwindef", "winnt"], &[]), + ("lmjoin", &["lmcons", "minwindef", "wincrypt", "winnt"], &["netapi32"]), + ("lmmsg", &["lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmremutl", &["lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmrepl", &["lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmserver", &["guiddef", "lmcons", "minwindef", "winnt", "winsvc"], &["advapi32", "netapi32"]), + ("lmshare", &["basetsd", "guiddef", "lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmstats", &["lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmsvc", &["lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmuse", &["lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lmwksta", &["lmcons", "minwindef", "winnt"], &["netapi32"]), + ("lowlevelmonitorconfigurationapi", &["minwindef", "physicalmonitorenumerationapi", "winnt"], &["dxva2"]), + ("lsalookup", &["guiddef", "minwindef", "ntdef", "winnt"], &["advapi32"]), + ("memoryapi", &["basetsd", "minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("minschannel", &["guiddef", "minwindef", "wincrypt", "winnt"], &[]), + ("minwinbase", &["basetsd", "minwindef", "ntstatus", "winnt"], &[]), + ("mmdeviceapi", &["guiddef", "minwindef", "propidl", "propsys", "unknwnbase", "winnt", "wtypes"], &["mmdevapi"]), + ("mmeapi", &["basetsd", "imm", "minwindef", "mmsystem", "winnt"], &["winmm"]), + ("mmsystem", &["basetsd", "minwindef", "mmreg", "winnt"], &[]), + ("msaatext", &[], &[]), + ("mscat", &["guiddef", "minwindef", "mssip", "wincrypt", "winnt"], &[]), + ("mschapp", &["basetsd", "minwindef", "winnt"], &["advapi32"]), + ("mssip", &["guiddef", "minwindef", "mscat", "wincrypt", "winnt"], &["crypt32"]), + ("mswsock", &["minwinbase", "minwindef", "mswsockdef", "winnt", "winsock2", "ws2def"], &["mswsock"]), + ("namedpipeapi", &["minwinbase", "minwindef", "winnt"], &["advapi32", "kernel32"]), + ("namespaceapi", &["minwinbase", "minwindef", "ntdef", "winnt"], &["kernel32"]), + ("nb30", &["minwindef", "winnt"], &["netapi32"]), + ("ncrypt", &["basetsd", "bcrypt", "minwindef", "winnt"], &["ncrypt"]), + ("ntlsa", &["basetsd", "guiddef", "lsalookup", "minwindef", "ntdef", "ntsecapi", "subauth", "winnt"], &["advapi32"]), + ("ntsecapi", &["basetsd", "guiddef", "lsalookup", "minwindef", "ntdef", "sspi", "subauth", "winnt"], &["advapi32"]), + ("oaidl", &["basetsd", "guiddef", "minwindef", "rpcndr", "unknwnbase", "winnt", "wtypes", "wtypesbase"], &[]), + ("objbase", &["combaseapi", "minwindef", "winnt"], &["ole32"]), + ("objidl", &["basetsd", "guiddef", "minwindef", "ntdef", "objidlbase", "unknwnbase", "windef", "winnt", "wtypes", "wtypesbase"], &[]), + ("objidlbase", &["basetsd", "guiddef", "minwindef", "unknwnbase", "winnt", "wtypesbase"], &[]), + ("ocidl", &["guiddef", "minwindef", "ntdef", "oaidl", "unknwnbase", "wtypes", "wtypesbase"], &[]), + ("ole2", &["minwindef", "oleidl", "windef", "winnt"], &["ole32"]), + ("oleauto", &["basetsd", "minwinbase", "minwindef", "oaidl", "winnt", "wtypes", "wtypesbase"], &["oleaut32"]), + ("olectl", &["winerror", "winnt"], &[]), + ("oleidl", &["minwindef", "ntdef", "objidl", "unknwnbase", "windef"], &[]), + ("opmapi", &["basetsd", "d3d9", "d3d9types", "dxva2api", "guiddef", "minwindef", "unknwnbase", "windef", "winnt"], &["dxva2"]), + ("pdh", &["basetsd", "guiddef", "minwindef", "windef", "winnt"], &["pdh"]), + ("perflib", &["basetsd", "guiddef", "minwinbase", "minwindef", "winnt"], &["advapi32"]), + ("physicalmonitorenumerationapi", &["d3d9", "minwindef", "windef", "winnt"], &["dxva2"]), + ("playsoundapi", &["minwindef", "winnt"], &["winmm"]), + ("portabledevice", &["basetsd", "wtypes"], &[]), + ("portabledeviceapi", &["guiddef", "minwindef", "objidlbase", "portabledevicetypes", "propkeydef", "unknwnbase", "winnt"], &[]), + ("portabledevicetypes", &["guiddef", "minwindef", "propidl", "propkeydef", "propsys", "unknwnbase", "winnt", "wtypes"], &[]), + ("powerbase", &["minwindef", "winnt", "winuser"], &["powrprof"]), + ("powersetting", &["guiddef", "minwindef", "winnt", "winuser"], &["powrprof"]), + ("powrprof", &["guiddef", "minwindef", "winnt", "winreg"], &["powrprof"]), + ("processenv", &["minwindef", "winnt"], &["kernel32"]), + ("processsnapshot", &["basetsd", "minwindef", "winnt"], &["kernel32"]), + ("processthreadsapi", &["basetsd", "guiddef", "minwinbase", "minwindef", "winnt"], &["advapi32", "kernel32"]), + ("processtopologyapi", &["minwindef", "winnt"], &["kernel32"]), + ("profileapi", &["minwindef", "winnt"], &["kernel32"]), + ("propidl", &["guiddef", "minwindef", "ntdef", "oaidl", "objidlbase", "unknwnbase", "wtypes", "wtypesbase"], &["ole32"]), + ("propkey", &["minwindef", "ntdef", "wtypes"], &[]), + ("propkeydef", &["guiddef", "wtypes"], &[]), + ("propsys", &["minwindef", "propidl", "propkeydef", "unknwnbase", "winnt", "wtypes"], &[]), + ("prsht", &["basetsd", "minwindef", "windef", "winnt", "winuser"], &["comctl32"]), + ("psapi", &["basetsd", "minwindef", "winnt"], &["kernel32", "psapi"]), + ("realtimeapiset", &["basetsd", "minwindef", "winnt"], &["kernel32"]), + ("reason", &["minwindef"], &[]), + ("restartmanager", &["minwindef", "winnt"], &["rstrtmgr"]), + ("restrictederrorinfo", &["unknwnbase", "winnt", "wtypes"], &[]), + ("rmxfguid", &[], &[]), + ("rtinfo", &["basetsd"], &[]), + ("sapi", &["guiddef", "minwindef", "sapi53", "unknwnbase", "winnt"], &[]), + ("sapi51", &["guiddef", "minwindef", "mmreg", "oaidl", "objidlbase", "rpcndr", "servprov", "unknwnbase", "windef", "winnt", "wtypes", "wtypesbase"], &[]), + ("sapi53", &["guiddef", "minwindef", "oaidl", "sapi51", "unknwnbase", "urlmon", "winnt", "wtypes"], &[]), + ("sapiddk", &["guiddef", "minwindef", "sapi", "sapiddk51", "unknwnbase", "winnt"], &[]), + ("sapiddk51", &["guiddef", "minwindef", "mmreg", "oaidl", "objidlbase", "sapi", "unknwnbase", "windef", "winnt"], &[]), + ("schannel", &["guiddef", "minwindef", "wincrypt", "windef", "winnt"], &[]), + ("securityappcontainer", &["minwindef", "winnt"], &["kernel32"]), + ("securitybaseapi", &["guiddef", "minwinbase", "minwindef", "winnt"], &["advapi32", "kernel32"]), + ("servprov", &["guiddef", "unknwnbase", "winnt"], &[]), + ("setupapi", &["basetsd", "commctrl", "devpropdef", "guiddef", "minwindef", "prsht", "spapidef", "windef", "winnt", "winreg"], &["setupapi"]), + ("shellapi", &["basetsd", "guiddef", "minwinbase", "minwindef", "processthreadsapi", "windef", "winnt", "winuser"], &["shell32", "shlwapi"]), + ("shellscalingapi", &["minwindef", "windef", "winnt"], &["shcore"]), + ("shlobj", &["guiddef", "minwinbase", "minwindef", "shtypes", "windef", "winnt"], &["shell32"]), + ("shobjidl", &["guiddef", "minwindef", "propsys", "shobjidl_core", "shtypes", "unknwnbase", "windef", "winnt"], &[]), + ("shobjidl_core", &["commctrl", "guiddef", "minwinbase", "minwindef", "objidl", "propkeydef", "propsys", "shtypes", "unknwnbase", "windef", "winnt"], &[]), + ("shtypes", &["guiddef", "minwindef", "winnt"], &[]), + ("softpub", &[], &[]), + ("spapidef", &["minwindef", "winnt"], &[]), + ("spellcheck", &["minwindef", "ntdef", "objidlbase", "unknwnbase", "winerror"], &[]), + ("sporder", &["guiddef", "minwindef"], &["sporder"]), + ("sql", &["sqltypes"], &["odbc32"]), + ("sqlext", &["sql", "sqltypes"], &[]), + ("sqltypes", &["basetsd", "guiddef", "windef"], &[]), + ("sqlucode", &["sqltypes"], &["odbc32"]), + ("stringapiset", &["minwindef", "winnls", "winnt"], &["kernel32"]), + ("strmif", &["winnt"], &[]), + ("subauth", &["minwindef", "winnt"], &[]), + ("synchapi", &["basetsd", "minwinbase", "minwindef", "winnt"], &["kernel32", "synchronization"]), + ("sysinfoapi", &["basetsd", "minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("systemtopologyapi", &["minwindef", "winnt"], &["kernel32"]), + ("taskschd", &["minwinbase", "minwindef", "oaidl", "unknwnbase", "winnt", "wtypes"], &[]), + ("textstor", &[], &[]), + ("threadpoolapiset", &["basetsd", "minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("threadpoollegacyapiset", &["minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("timeapi", &["minwindef", "mmsystem"], &["winmm"]), + ("timezoneapi", &["minwinbase", "minwindef", "winnt"], &["advapi32", "kernel32"]), + ("tlhelp32", &["basetsd", "minwindef", "winnt"], &["kernel32"]), + ("unknwnbase", &["guiddef", "minwindef", "winnt"], &[]), + ("urlhist", &["docobj", "guiddef", "minwindef", "unknwnbase", "winnt", "wtypesbase"], &[]), + ("urlmon", &["minwindef", "unknwnbase", "winnt"], &[]), + ("userenv", &["minwindef", "winnt", "winreg"], &["userenv"]), + ("usp10", &["minwindef", "ntdef", "windef", "winerror", "wingdi", "winnt"], &["usp10"]), + ("utilapiset", &["minwindef", "ntdef"], &["kernel32"]), + ("uxtheme", &["commctrl", "minwindef", "windef", "wingdi", "winnt"], &["uxtheme"]), + ("vsbackup", &["guiddef", "minwindef", "unknwnbase", "vss", "vswriter", "winnt", "wtypes"], &["vssapi"]), + ("vss", &["guiddef", "minwindef", "unknwnbase", "winnt"], &[]), + ("vsserror", &["winnt"], &[]), + ("vswriter", &["minwindef", "unknwnbase", "vss", "winnt", "wtypes"], &[]), + ("wbemads", &["oaidl", "wbemdisp", "winerror", "wtypes"], &[]), + ("wbemcli", &["minwindef", "oaidl", "rpcndr", "unknwnbase", "winerror", "winnt", "wtypes"], &[]), + ("wbemdisp", &["oaidl", "unknwnbase", "winerror", "wtypes"], &[]), + ("wbemprov", &["minwindef", "oaidl", "unknwnbase", "wbemcli", "winerror", "winnt", "wtypes"], &[]), + ("wbemtran", &["guiddef", "minwindef", "unknwnbase", "wbemcli", "winerror", "winnt", "wtypes"], &[]), + ("wct", &["basetsd", "guiddef", "minwindef", "winnt"], &["advapi32"]), + ("werapi", &["minwindef", "winnt"], &["kernel32", "wer"]), + ("winbase", &["basetsd", "cfgmgr32", "fileapi", "guiddef", "libloaderapi", "minwinbase", "minwindef", "processthreadsapi", "vadefs", "windef", "winnt"], &["kernel32"]), + ("wincodec", &["basetsd", "d2d1", "d2d1_1", "dcommon", "dxgiformat", "dxgitype", "guiddef", "minwindef", "ntdef", "objidlbase", "ocidl", "propidl", "unknwnbase", "windef", "winerror", "winnt"], &["windowscodecs"]), + ("wincodecsdk", &["guiddef", "minwindef", "oaidl", "objidl", "objidlbase", "ocidl", "propidl", "unknwnbase", "wincodec", "winnt", "wtypes"], &["ole32", "oleaut32", "windowscodecs"]), + ("wincon", &["minwinbase", "minwindef", "wincontypes", "windef", "wingdi", "winnt"], &["kernel32"]), + ("wincontypes", &["minwindef", "winnt"], &[]), + ("wincred", &["minwindef", "sspi", "windef", "winnt"], &["advapi32", "credui"]), + ("wincrypt", &["basetsd", "bcrypt", "guiddef", "minwinbase", "minwindef", "ncrypt", "vcruntime", "winnt"], &["advapi32", "crypt32", "cryptnet"]), + ("windowsceip", &["minwindef"], &["kernel32"]), + ("winefs", &["basetsd", "minwinbase", "minwindef", "wincrypt", "winnt"], &["advapi32"]), + ("winevt", &["basetsd", "guiddef", "minwinbase", "minwindef", "vcruntime", "winnt"], &["wevtapi"]), + ("wingdi", &["basetsd", "minwindef", "windef", "winnt"], &["gdi32", "msimg32", "opengl32", "winspool"]), + ("winhttp", &["basetsd", "minwinbase", "minwindef", "winnt"], &["winhttp"]), + ("wininet", &["basetsd", "minwinbase", "minwindef", "ntdef", "windef", "winineti", "winnt"], &["wininet"]), + ("winineti", &["minwindef"], &[]), + ("winioctl", &["basetsd", "devpropdef", "guiddef", "minwindef", "winnt"], &[]), + ("winnetwk", &["basetsd", "minwindef", "windef", "winerror", "winnt"], &["mpr"]), + ("winnls", &["basetsd", "guiddef", "minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("winnt", &["basetsd", "excpt", "guiddef", "ktmtypes", "minwindef", "ntdef", "vcruntime"], &["kernel32"]), + ("winreg", &["basetsd", "minwinbase", "minwindef", "reason", "winnt"], &["advapi32"]), + ("winsafer", &["basetsd", "guiddef", "minwindef", "wincrypt", "windef", "winnt"], &["advapi32"]), + ("winscard", &["basetsd", "guiddef", "minwindef", "rpcdce", "windef", "winnt", "winsmcrd"], &["winscard"]), + ("winsmcrd", &["minwindef", "winioctl"], &[]), + ("winsock2", &["basetsd", "guiddef", "inaddr", "minwinbase", "minwindef", "qos", "winbase", "windef", "winerror", "winnt", "ws2def", "wtypesbase"], &["ws2_32"]), + ("winspool", &["guiddef", "minwinbase", "minwindef", "vcruntime", "windef", "winerror", "wingdi", "winnt"], &["winspool"]), + ("winsvc", &["minwindef", "winnt"], &["advapi32"]), + ("wintrust", &["guiddef", "minwindef", "ntdef", "wincrypt", "windef"], &["wintrust"]), + ("winusb", &["minwinbase", "minwindef", "usb", "usbspec", "winnt", "winusbio"], &["winusb"]), + ("winuser", &["basetsd", "guiddef", "limits", "minwinbase", "minwindef", "vadefs", "windef", "wingdi", "winnt"], &["user32"]), + ("winver", &["minwindef", "winnt"], &["kernel32", "version"]), + ("wlanapi", &["devpropdef", "eaptypes", "guiddef", "l2cmn", "minwindef", "windef", "windot11", "winnt", "wlantypes"], &["wlanapi"]), + ("wlanihv", &["basetsd", "dot1x", "eaptypes", "guiddef", "l2cmn", "minwindef", "windot11", "winnt", "winuser", "wlanihvtypes", "wlantypes", "wlclient"], &[]), + ("wlanihvtypes", &["eaptypes", "guiddef", "minwindef", "winnt", "wlantypes"], &[]), + ("wlclient", &["guiddef", "minwindef", "windot11", "winnt"], &[]), + ("wow64apiset", &["minwindef", "winnt"], &["kernel32"]), + ("wpdmtpextensions", &["wtypes"], &[]), + ("ws2bth", &["bthdef", "bthsdpdef", "guiddef", "minwindef", "winnt", "ws2def"], &[]), + ("ws2spi", &["basetsd", "guiddef", "minwindef", "vcruntime", "windef", "winnt", "winsock2", "ws2def", "wtypesbase"], &["ws2_32"]), + ("ws2tcpip", &["guiddef", "minwinbase", "minwindef", "mstcpip", "vcruntime", "winerror", "winnt", "winsock2", "ws2def", "wtypesbase"], &["fwpuclnt", "ws2_32"]), + ("wtsapi32", &["minwindef", "ntdef"], &["wtsapi32"]), + ("xinput", &["guiddef", "minwindef", "winnt"], &["xinput"]), + // vc + ("excpt", &[], &[]), + ("limits", &[], &[]), + ("vadefs", &[], &[]), + ("vcruntime", &[], &[]), + // winrt + ("activation", &["inspectable", "winnt"], &[]), + ("hstring", &["winnt"], &[]), + ("inspectable", &["guiddef", "hstring", "minwindef", "unknwnbase", "winnt"], &[]), + ("roapi", &["activation", "basetsd", "guiddef", "hstring", "inspectable", "objidl", "winnt"], &["runtimeobject"]), + ("robuffer", &["objidl", "winnt"], &["runtimeobject"]), + ("roerrorapi", &["basetsd", "hstring", "minwindef", "restrictederrorinfo", "unknwnbase", "winnt"], &["runtimeobject"]), + ("winstring", &["basetsd", "hstring", "minwindef", "winnt"], &["runtimeobject"]), +]; +struct Header { + required: bool, + included: Cell, + dependencies: &'static [&'static str], + libraries: &'static [&'static str], +} +struct Graph(HashMap<&'static str, Header>); +impl Graph { + fn generate() -> Graph { + Graph(DATA.iter().map(|&(name, dependencies, libraries)| { + let header = Header { + required: false, + included: Cell::new(false), + dependencies: dependencies, + libraries: libraries, + }; + (name, header) + }).collect()) + } + fn identify_required(&mut self) { + for (name, header) in &mut self.0 { + if let Ok(_) = var(&format!("CARGO_FEATURE_{}", name.to_uppercase())) { + header.required = true; + header.included.set(true); + } + } + } + fn check_everything(&self) { + if let Ok(_) = var("CARGO_FEATURE_EVERYTHING") { + for (_, header) in &self.0 { + header.included.set(true); + } + } + } + fn resolve_dependencies(&self) { + let mut done = false; + while !done { + done = true; + for (_, header) in &self.0 { + if header.included.get() { + for dep in header.dependencies { + let dep = &self.0.get(dep).expect(dep); + if !dep.included.get() { + done = false; + dep.included.set(true); + } + } + } + } + } + } + fn emit_features(&self) { + for (name, header) in &self.0 { + if header.included.get() && !header.required { + println!("cargo:rustc-cfg=feature=\"{}\"", name); + } + } + } + fn emit_libraries(&self) { + let mut libs = self.0.iter().filter(|&(_, header)| { + header.included.get() + }).flat_map(|(_, header)| { + header.libraries.iter() + }).collect::>(); + libs.sort(); + libs.dedup(); + // FIXME Temporary hacks until build script is redesigned. + libs.retain(|&&lib| match &*var("TARGET").unwrap() { + "aarch64-pc-windows-msvc" | "aarch64-uwp-windows-msvc" | "thumbv7a-pc-windows-msvc" => { + if lib == "opengl32" { false } + else { true } + }, + _ => true, + }); + let prefix = library_prefix(); + let kind = library_kind(); + for lib in libs { + println!("cargo:rustc-link-lib={}={}{}", kind, prefix, lib); + } + } +} +fn library_prefix() -> &'static str { + if var("TARGET").map(|target| + target == "i686-pc-windows-gnu" || target == "x86_64-pc-windows-gnu" + ).unwrap_or(false) && var("WINAPI_NO_BUNDLED_LIBRARIES").is_err() { + "winapi_" + } else { + "" + } +} +fn library_kind() -> &'static str { + if var("WINAPI_STATIC_NOBUNDLE").is_ok() { + "static-nobundle" + } else { + "dylib" + } +} +fn try_everything() { + let mut graph = Graph::generate(); + graph.identify_required(); + graph.check_everything(); + graph.resolve_dependencies(); + graph.emit_features(); + graph.emit_libraries(); +} +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-env-changed=WINAPI_NO_BUNDLED_LIBRARIES"); + println!("cargo:rerun-if-env-changed=WINAPI_STATIC_NOBUNDLE"); + let target = var("TARGET").unwrap(); + let target: Vec<_> = target.split('-').collect(); + if target.get(2) == Some(&"windows") { + try_everything(); + } +} diff --git a/bash-5.1/vendor/winapi/src/km/d3dkmthk.rs b/bash-5.1/vendor/winapi/src/km/d3dkmthk.rs new file mode 100644 index 0000000000000000000000000000000000000000..9ac551cee7d95e8078e91ea15679d0096681507c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/km/d3dkmthk.rs @@ -0,0 +1,312 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! longhorn display driver model kernel mode thunk interfaces +use shared::basetsd::{UINT32, UINT64}; +use shared::d3dukmdt::{ + D3DDDICB_SIGNALFLAGS, D3DDDI_ALLOCATIONLIST, D3DDDI_CREATECONTEXTFLAGS, + D3DDDI_MAX_BROADCAST_CONTEXT, D3DDDI_MAX_OBJECT_SIGNALED, D3DDDI_MAX_OBJECT_WAITED_ON, + D3DDDI_PATCHLOCATIONLIST, D3DDDI_SYNCHRONIZATIONOBJECTINFO, + D3DDDI_SYNCHRONIZATIONOBJECTINFO2, D3DDDI_VIDEO_PRESENT_SOURCE_ID, D3DGPU_VIRTUAL_ADDRESS, + D3DKMT_HANDLE, +}; +use shared::minwindef::{BOOL, UCHAR, UINT, ULONG}; +use shared::ntdef::{HANDLE, LUID, PCWSTR, ULONGLONG, VOID, WCHAR}; +use shared::windef::HDC; +STRUCT!{struct D3DKMT_CREATEDEVICEFLAGS { + bitfield: UINT, +}} +BITFIELD!{D3DKMT_CREATEDEVICEFLAGS bitfield: UINT [ + LegacyMode set_LegacyMode[0..1], + RequestVSync set_RequestVSync[1..2], + DisableGpuTimeout set_DisableGpuTimeout[2..3], + Reserved set_Reserved[3..32], +]} +UNION!{union D3DKMT_CREATEDEVICE_u { + [usize; 1], + hAdapter hAdapter_mut: D3DKMT_HANDLE, + pAdapter pAdapter_mut: *mut VOID, +}} +STRUCT!{struct D3DKMT_CREATEDEVICE { + u: D3DKMT_CREATEDEVICE_u, + Flags: D3DKMT_CREATEDEVICEFLAGS, + hDevice: D3DKMT_HANDLE, + pCommandBuffer: *mut VOID, + CommandBufferSize: UINT, + pAllocationList: *mut D3DDDI_ALLOCATIONLIST, + AllocationListSize: UINT, + pPatchLocationList: *mut D3DDDI_PATCHLOCATIONLIST, + PatchLocationListSize: UINT, +}} +STRUCT!{struct D3DKMT_DESTROYDEVICE { + hDevice: D3DKMT_HANDLE, +}} +ENUM!{enum D3DKMT_CLIENTHINT { + D3DKMT_CLIENTHINT_UNKNOWN = 0, + D3DKMT_CLIENTHINT_OPENGL = 1, + D3DKMT_CLIENTHINT_CDD = 2, + D3DKMT_CLIENTHINT_DX7 = 7, + D3DKMT_CLIENTHINT_DX8 = 8, + D3DKMT_CLIENTHINT_DX9 = 9, + D3DKMT_CLIENTHINT_DX10 = 10, +}} +STRUCT!{struct D3DKMT_CREATECONTEXT { + hDevice: D3DKMT_HANDLE, + NodeOrdinal: UINT, + EngineAffinity: UINT, + Flags: D3DDDI_CREATECONTEXTFLAGS, + pPrivateDriverData: *mut VOID, + PrivateDriverDataSize: UINT, + ClientHint: D3DKMT_CLIENTHINT, + hContext: D3DKMT_HANDLE, + pCommandBuffer: *mut VOID, + CommandBufferSize: UINT, + pAllocationList: *mut D3DDDI_ALLOCATIONLIST, + AllocationListSize: UINT, + pPatchLocationList: *mut D3DDDI_PATCHLOCATIONLIST, + PatchLocationListSize: UINT, + CommandBuffer: D3DGPU_VIRTUAL_ADDRESS, +}} +STRUCT!{struct D3DKMT_DESTROYCONTEXT { + hContext: D3DKMT_HANDLE, +}} +STRUCT!{struct D3DKMT_CREATESYNCHRONIZATIONOBJECT { + hDevice: D3DKMT_HANDLE, + Info: D3DDDI_SYNCHRONIZATIONOBJECTINFO, + hSyncObject: D3DKMT_HANDLE, +}} +STRUCT!{struct D3DKMT_CREATESYNCHRONIZATIONOBJECT2 { + hDevice: D3DKMT_HANDLE, + Info: D3DDDI_SYNCHRONIZATIONOBJECTINFO2, + hSyncObject: D3DKMT_HANDLE, +}} +STRUCT!{struct D3DKMT_DESTROYSYNCHRONIZATIONOBJECT { + hSyncObject: D3DKMT_HANDLE, +}} +STRUCT!{struct D3DKMT_OPENSYNCHRONIZATIONOBJECT { + hSharedHandle: D3DKMT_HANDLE, + hSyncObject: D3DKMT_HANDLE, + Reserved: [UINT64; 8], +}} +STRUCT!{struct D3DKMT_WAITFORSYNCHRONIZATIONOBJECT { + hContext: D3DKMT_HANDLE, + ObjectCount: UINT, + ObjectHandleArray: [D3DKMT_HANDLE; D3DDDI_MAX_OBJECT_WAITED_ON], +}} +STRUCT!{struct D3DKMT_WAITFORSYNCHRONIZATIONOBJECT2_Fence { + FenceValue: UINT64, +}} +UNION!{union D3DKMT_WAITFORSYNCHRONIZATIONOBJECT2_u { + [u64; 8], + Fence Fence_mut: D3DKMT_WAITFORSYNCHRONIZATIONOBJECT2_Fence, + Reserved Reserved_mut: [UINT64; 8], +}} +STRUCT!{struct D3DKMT_WAITFORSYNCHRONIZATIONOBJECT2 { + hContext: D3DKMT_HANDLE, + ObjectCount: UINT, + ObjectHandleArray: [D3DKMT_HANDLE; D3DDDI_MAX_OBJECT_WAITED_ON], + u: D3DKMT_WAITFORSYNCHRONIZATIONOBJECT2_u, +}} +STRUCT!{struct D3DKMT_SIGNALSYNCHRONIZATIONOBJECT { + hContext: D3DKMT_HANDLE, + ObjectCount: UINT, + ObjectHandleArray: [D3DKMT_HANDLE; D3DDDI_MAX_OBJECT_SIGNALED], + Flags: D3DDDICB_SIGNALFLAGS, +}} +STRUCT!{struct D3DKMT_SIGNALSYNCHRONIZATIONOBJECT2_Fence { + FenceValue: UINT64, +}} +UNION!{union D3DKMT_SIGNALSYNCHRONIZATIONOBJECT2_u { + [u64; 8], + Fence Fence_mut: D3DKMT_SIGNALSYNCHRONIZATIONOBJECT2_Fence, + CpuEventHandle CpuEventHandle_mut: HANDLE, + Reserved Reserved_mut: [UINT64; 8], +}} +STRUCT!{struct D3DKMT_SIGNALSYNCHRONIZATIONOBJECT2 { + hContext: D3DKMT_HANDLE, + ObjectCount: UINT, + ObjectHandleArray: [D3DKMT_HANDLE; D3DDDI_MAX_OBJECT_SIGNALED], + Flags: D3DDDICB_SIGNALFLAGS, + BroadcastContextCount: ULONG, + BroadcastContext: [D3DKMT_HANDLE; D3DDDI_MAX_BROADCAST_CONTEXT], + u: D3DKMT_SIGNALSYNCHRONIZATIONOBJECT2_u, +}} +//1512 +STRUCT!{struct D3DKMT_SEGMENTSIZEINFO { + DedicatedVideoMemorySize: ULONGLONG, + DedicatedSystemMemorySize: ULONGLONG, + SharedSystemMemorySize: ULONGLONG, +}} +//1617 +STRUCT!{struct D3DKMT_ADAPTERTYPE { + Value: UINT, +}} +BITFIELD!{D3DKMT_ADAPTERTYPE Value: UINT [ + RenderSupported set_RenderSupported[0..1], + DisplaySupported set_DisplaySupported[1..2], + SoftwareDevice set_SoftwareDevice[2..3], + PostDevice set_PostDevice[3..4], + HybridDiscrete set_HybridDiscrete[4..5], + HybridIntegrated set_HybridIntegrated[5..6], + IndirectDisplayDevice set_IndirectDisplayDevice[6..7], + Paravirtualized set_Paravirtualized[7..8], + ACGSupported set_ACGSupported[8..9], + SupportSetTimingsFromVidPn set_SupportSetTimingsFromVidPn[9..10], + Detachable set_Detachable[10..11], + Reserved set_Reserved[11..32], +]} +//1852 +STRUCT!{struct D3DKMT_NODE_PERFDATA { + NodeOrdinal: UINT32, + PhysicalAdapterIndex: UINT32, + Frequency: ULONGLONG, + MaxFrequency: ULONGLONG, + MaxFrequencyOC: ULONGLONG, + Voltage: ULONG, + VoltageMax: ULONG, + VoltageMaxOC: ULONG, + MaxTransitionLatency: ULONGLONG, +}} +STRUCT!{struct D3DKMT_ADAPTER_PERFDATA { + PhysicalAdapterIndex: UINT32, + MemoryFrequency: ULONGLONG, + MaxMemoryFrequency: ULONGLONG, + MaxMemoryFrequencyOC: ULONGLONG, + MemoryBandwidth: ULONGLONG, + PCIEBandwidth: ULONGLONG, + FanRPM: ULONG, + Power: ULONG, + Temperature: ULONG, + PowerStateOverride: UCHAR, +}} +STRUCT!{struct D3DKMT_ADAPTER_PERFDATACAPS { + PhysicalAdapterIndex: UINT32, + MaxMemoryBandwidth: ULONGLONG, + MaxPCIEBandwidth: ULONGLONG, + MaxFanRPM: ULONG, + TemperatureMax: ULONG, + TemperatureWarning: ULONG, +}} +pub const DXGK_MAX_GPUVERSION_NAME_LENGTH: usize = 32; +STRUCT!{struct D3DKMT_GPUVERSION { + PhysicalAdapterIndex: UINT32, + BiosVersion: [WCHAR; DXGK_MAX_GPUVERSION_NAME_LENGTH], + GpuArchitecture: [WCHAR; DXGK_MAX_GPUVERSION_NAME_LENGTH], +}} +ENUM!{enum KMTQUERYADAPTERINFOTYPE { + KMTQAITYPE_UMDRIVERPRIVATE = 0, + KMTQAITYPE_UMDRIVERNAME = 1, + KMTQAITYPE_UMOPENGLINFO = 2, + KMTQAITYPE_GETSEGMENTSIZE = 3, + KMTQAITYPE_ADAPTERGUID = 4, + KMTQAITYPE_FLIPQUEUEINFO = 5, + KMTQAITYPE_ADAPTERADDRESS = 6, + KMTQAITYPE_SETWORKINGSETINFO = 7, + KMTQAITYPE_ADAPTERREGISTRYINFO = 8, + KMTQAITYPE_CURRENTDISPLAYMODE = 9, + KMTQAITYPE_MODELIST = 10, + KMTQAITYPE_CHECKDRIVERUPDATESTATUS = 11, + KMTQAITYPE_VIRTUALADDRESSINFO = 12, + KMTQAITYPE_DRIVERVERSION = 13, + KMTQAITYPE_ADAPTERTYPE = 15, + KMTQAITYPE_OUTPUTDUPLCONTEXTSCOUNT = 16, + KMTQAITYPE_WDDM_1_2_CAPS = 17, + KMTQAITYPE_UMD_DRIVER_VERSION = 18, + KMTQAITYPE_DIRECTFLIP_SUPPORT = 19, + KMTQAITYPE_MULTIPLANEOVERLAY_SUPPORT = 20, + KMTQAITYPE_DLIST_DRIVER_NAME = 21, + KMTQAITYPE_WDDM_1_3_CAPS = 22, + KMTQAITYPE_MULTIPLANEOVERLAY_HUD_SUPPORT = 23, + KMTQAITYPE_WDDM_2_0_CAPS = 24, + KMTQAITYPE_NODEMETADATA = 25, + KMTQAITYPE_CPDRIVERNAME = 26, + KMTQAITYPE_XBOX = 27, + KMTQAITYPE_INDEPENDENTFLIP_SUPPORT = 28, + KMTQAITYPE_MIRACASTCOMPANIONDRIVERNAME = 29, + KMTQAITYPE_PHYSICALADAPTERCOUNT = 30, + KMTQAITYPE_PHYSICALADAPTERDEVICEIDS = 31, + KMTQAITYPE_DRIVERCAPS_EXT = 32, + KMTQAITYPE_QUERY_MIRACAST_DRIVER_TYPE = 33, + KMTQAITYPE_QUERY_GPUMMU_CAPS = 34, + KMTQAITYPE_QUERY_MULTIPLANEOVERLAY_DECODE_SUPPORT = 35, + KMTQAITYPE_QUERY_HW_PROTECTION_TEARDOWN_COUNT = 36, + KMTQAITYPE_QUERY_ISBADDRIVERFORHWPROTECTIONDISABLED = 37, + KMTQAITYPE_MULTIPLANEOVERLAY_SECONDARY_SUPPORT = 38, + KMTQAITYPE_INDEPENDENTFLIP_SECONDARY_SUPPORT = 39, + KMTQAITYPE_PANELFITTER_SUPPORT = 40, + KMTQAITYPE_PHYSICALADAPTERPNPKEY = 41, + KMTQAITYPE_GETSEGMENTGROUPSIZE = 42, + KMTQAITYPE_MPO3DDI_SUPPORT = 43, + KMTQAITYPE_HWDRM_SUPPORT = 44, + KMTQAITYPE_MPOKERNELCAPS_SUPPORT = 45, + KMTQAITYPE_MULTIPLANEOVERLAY_STRETCH_SUPPORT = 46, + KMTQAITYPE_GET_DEVICE_VIDPN_OWNERSHIP_INFO = 47, + KMTQAITYPE_QUERYREGISTRY = 48, + KMTQAITYPE_KMD_DRIVER_VERSION = 49, + KMTQAITYPE_BLOCKLIST_KERNEL = 50, + KMTQAITYPE_BLOCKLIST_RUNTIME = 51, + KMTQAITYPE_ADAPTERGUID_RENDER = 52, + KMTQAITYPE_ADAPTERADDRESS_RENDER = 53, + KMTQAITYPE_ADAPTERREGISTRYINFO_RENDER = 54, + KMTQAITYPE_CHECKDRIVERUPDATESTATUS_RENDER = 55, + KMTQAITYPE_DRIVERVERSION_RENDER = 56, + KMTQAITYPE_ADAPTERTYPE_RENDER = 57, + KMTQAITYPE_WDDM_1_2_CAPS_RENDER = 58, + KMTQAITYPE_WDDM_1_3_CAPS_RENDER = 59, + KMTQAITYPE_QUERY_ADAPTER_UNIQUE_GUID = 60, + KMTQAITYPE_NODEPERFDATA = 61, + KMTQAITYPE_ADAPTERPERFDATA = 62, + KMTQAITYPE_ADAPTERPERFDATA_CAPS = 63, + KMTQUITYPE_GPUVERSION = 64, +}} +STRUCT!{struct D3DKMT_QUERYADAPTERINFO { + hAdapter: D3DKMT_HANDLE, + Type: KMTQUERYADAPTERINFOTYPE, + pPrivateDriverData: *mut VOID, + PrivateDriverDataSize: UINT, +}} +STRUCT!{struct D3DKMT_OPENADAPTERFROMHDC { + hDc: HDC, + hAdapter: D3DKMT_HANDLE, + AdapterLuid: LUID, + VidPnSourceId: D3DDDI_VIDEO_PRESENT_SOURCE_ID, +}} +STRUCT!{struct D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME { + DeviceName: [WCHAR; 32], + hAdapter: D3DKMT_HANDLE, + AdapterLuid: LUID, + VidPnSourceId: D3DDDI_VIDEO_PRESENT_SOURCE_ID, +}} +STRUCT!{struct D3DKMT_OPENADAPTERFROMDEVICENAME { + pDeviceName: PCWSTR, + hAdapter: D3DKMT_HANDLE, + AdapterLuid: LUID, +}} +pub const MAX_ENUM_ADAPTERS: usize = 16; +STRUCT!{struct D3DKMT_ADAPTERINFO { + hAdapter: D3DKMT_HANDLE, + AdapterLuid: LUID, + NumOfSources: ULONG, + bPresentMoveRegionsPreferred: BOOL, +}} +STRUCT!{struct D3DKMT_ENUMADAPTERS { + NumAdapters: ULONG, + Adapters: [D3DKMT_ADAPTERINFO; MAX_ENUM_ADAPTERS], +}} +STRUCT!{struct D3DKMT_ENUMADAPTERS2 { + NumAdapters: ULONG, + pAdapters: *mut D3DKMT_ADAPTERINFO, +}} +STRUCT!{struct D3DKMT_OPENADAPTERFROMLUID { + AdapterLuid: LUID, + hAdapter: D3DKMT_HANDLE, +}} +STRUCT!{struct D3DKMT_QUERYREMOTEVIDPNSOURCEFROMGDIDISPLAYNAME { + DeviceName: [WCHAR; 32], + VidPnSourceId: D3DDDI_VIDEO_PRESENT_SOURCE_ID, +}} +STRUCT!{struct D3DKMT_CLOSEADAPTER { + hAdapter: D3DKMT_HANDLE, +}} diff --git a/bash-5.1/vendor/winapi/src/km/mod.rs b/bash-5.1/vendor/winapi/src/km/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..480f1950f75ddc1fc41910c326499cb686eb6c2e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/km/mod.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Headers for kernel mode +#[cfg(feature = "d3dkmthk")] pub mod d3dkmthk; diff --git a/bash-5.1/vendor/winapi/src/lib.rs b/bash-5.1/vendor/winapi/src/lib.rs new file mode 100644 index 0000000000000000000000000000000000000000..cf2d938fe091e210e28d8228b4f51c4e493cdc88 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/lib.rs @@ -0,0 +1,71 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +#![cfg(windows)] +#![deny(unused, unused_qualifications)] +#![warn(unused_attributes)] +#![allow(bad_style, overflowing_literals, unused_macros, deprecated, unused_crate_dependencies)] +#![recursion_limit = "2563"] +#![no_std] +//Uncomment as needed or once minimum Rust version is bumped to 1.18 +//#![cfg_attr(feature = "cargo-clippy", warn(clippy::pedantic))] +//#![cfg_attr(feature = "cargo-clippy", allow(clippy::absurd_extreme_comparisons, clippy::cast_lossless, clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::cast_precision_loss, clippy::cast_ptr_alignment, clippy::cast_sign_loss, clippy::doc_markdown, clippy::empty_enum, clippy::erasing_op, clippy::excessive_precision, clippy::expl_impl_clone_on_copy, clippy::identity_op, clippy::if_not_else, clippy::many_single_char_names, clippy::module_inception, clippy::cast_possible_truncation, clippy::too_many_arguments, clippy::transmute_int_to_float, clippy::trivially_copy_pass_by_ref, clippy::unreadable_literal, clippy::unseparated_literal_suffix, clippy::used_underscore_binding, clippy::redundant_static_lifetimes, clippy::missing_safety_doc))] + +#[cfg(feature = "std")] +extern crate std; + +/// Hack for exported macros +#[doc(hidden)] +pub extern crate core as _core; + +// Modules +#[macro_use] +mod macros; +pub mod km; +pub mod shared; +pub mod ucrt; +pub mod um; +pub mod vc; +pub mod winrt; + +/// Built in primitive types provided by the C language +pub mod ctypes { + #[cfg(feature = "std")] + pub use std::os::raw::c_void; + #[cfg(not(feature = "std"))] + pub enum c_void {} + pub type c_char = i8; + pub type c_schar = i8; + pub type c_uchar = u8; + pub type c_short = i16; + pub type c_ushort = u16; + pub type c_int = i32; + pub type c_uint = u32; + pub type c_long = i32; + pub type c_ulong = u32; + pub type c_longlong = i64; + pub type c_ulonglong = u64; + pub type c_float = f32; + pub type c_double = f64; + pub type __int8 = i8; + pub type __uint8 = u8; + pub type __int16 = i16; + pub type __uint16 = u16; + pub type __int32 = i32; + pub type __uint32 = u32; + pub type __int64 = i64; + pub type __uint64 = u64; + pub type wchar_t = u16; +} +// This trait should be implemented for all COM interfaces +pub trait Interface { + // Returns the IID of the Interface + fn uuidof() -> shared::guiddef::GUID; +} +// This trait should be implemented for all COM classes +pub trait Class { + // Returns the CLSID of the Class + fn uuidof() -> shared::guiddef::GUID; +} diff --git a/bash-5.1/vendor/winapi/src/macros.rs b/bash-5.1/vendor/winapi/src/macros.rs new file mode 100644 index 0000000000000000000000000000000000000000..d6b133f028e543e45df1c7a0da817ee3ff585a69 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/macros.rs @@ -0,0 +1,440 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Macros to make things easier to define +macro_rules! DECLARE_HANDLE { + ($name:ident, $inner:ident) => { + pub enum $inner {} + pub type $name = *mut $inner; + }; +} +macro_rules! MAKE_HRESULT { + ($sev:expr, $fac:expr, $code:expr) => { + ($sev << 31) | ($fac << 16) | $code + } +} +macro_rules! MAKE_SCODE { + ($sev:expr, $fac:expr, $code:expr) => { + ($sev << 31) | ($fac << 16) | $code + } +} +macro_rules! HIDP_ERROR_CODES { + ($sev:expr, $code:expr) => { + ($sev << 28) | (FACILITY_HID_ERROR_CODE << 16) | $code + } +} +macro_rules! MAKEFOURCC { + ($a:expr, $b:expr, $c:expr, $d:expr) => { + ($a as u32) | (($b as u32) << 8) | (($c as u32) << 16) | (($d as u32) << 24) + } +} +#[macro_export] +macro_rules! DEFINE_GUID { + ( + $name:ident, $l:expr, $w1:expr, $w2:expr, + $b1:expr, $b2:expr, $b3:expr, $b4:expr, $b5:expr, $b6:expr, $b7:expr, $b8:expr + ) => { + pub const $name: $crate::shared::guiddef::GUID = $crate::shared::guiddef::GUID { + Data1: $l, + Data2: $w1, + Data3: $w2, + Data4: [$b1, $b2, $b3, $b4, $b5, $b6, $b7, $b8], + }; + } +} +macro_rules! DEFINE_BLUETOOTH_UUID128 { + ($name:ident, $shortId:expr) => { + DEFINE_GUID!{$name, + $shortId as u32, 0x0000, 0x1000, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB} + } +} +#[macro_export] +macro_rules! DEFINE_PROPERTYKEY { + ( + $name:ident, $l:expr, $w1:expr, $w2:expr, + $b1:expr, $b2:expr, $b3:expr, $b4:expr, $b5:expr, $b6:expr, $b7:expr, $b8:expr, + $pid:expr + ) => { + pub const $name: PROPERTYKEY + = PROPERTYKEY { + fmtid: $crate::shared::guiddef::GUID { + Data1: $l, + Data2: $w1, + Data3: $w2, + Data4: [$b1, $b2, $b3, $b4, $b5, $b6, $b7, $b8], + }, + pid: $pid, + }; + } +} +#[macro_export] +macro_rules! DEFINE_DEVPROPKEY { + ( + $name:ident, $l:expr, $w1:expr, $w2:expr, + $b1:expr, $b2:expr, $b3:expr, $b4:expr, $b5:expr, $b6:expr, $b7:expr, $b8:expr, + $pid:expr + ) => { + pub const $name: DEVPROPKEY = DEVPROPKEY { + fmtid: $crate::shared::guiddef::GUID { + Data1: $l, + Data2: $w1, + Data3: $w2, + Data4: [$b1, $b2, $b3, $b4, $b5, $b6, $b7, $b8], + }, + pid: $pid, + }; + } +} +macro_rules! CTL_CODE { + ($DeviceType:expr, $Function:expr, $Method:expr, $Access:expr) => { + ($DeviceType << 16) | ($Access << 14) | ($Function << 2) | $Method + } +} +macro_rules! BTH_CTL { + ($id:expr) => { + CTL_CODE!(FILE_DEVICE_BLUETOOTH, $id, METHOD_BUFFERED, FILE_ANY_ACCESS) + }; +} +macro_rules! BTH_KERNEL_CTL { + ($id:expr) => { + CTL_CODE!(FILE_DEVICE_BLUETOOTH, $id, METHOD_NEITHER, FILE_ANY_ACCESS) + }; +} +macro_rules! HID_CTL_CODE { + ($id:expr) => { + CTL_CODE!(FILE_DEVICE_KEYBOARD, $id, METHOD_NEITHER, FILE_ANY_ACCESS) + } +} +macro_rules! HID_BUFFER_CTL_CODE { + ($id:expr) => { + CTL_CODE!(FILE_DEVICE_KEYBOARD, $id, METHOD_BUFFERED, FILE_ANY_ACCESS) + } +} +macro_rules! HID_IN_CTL_CODE { + ($id:expr) => { + CTL_CODE!(FILE_DEVICE_KEYBOARD, $id, METHOD_IN_DIRECT, FILE_ANY_ACCESS) + } +} +macro_rules! HID_OUT_CTL_CODE { + ($id:expr) => { + CTL_CODE!(FILE_DEVICE_KEYBOARD, $id, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + } +} +macro_rules! AUDCLNT_ERR { + ($n:expr) => { + MAKE_HRESULT!(SEVERITY_ERROR, FACILITY_AUDCLNT, $n) + }; +} +macro_rules! AUDCLNT_SUCCESS { + ($n:expr) => { + MAKE_SCODE!(SEVERITY_SUCCESS, FACILITY_AUDCLNT, $n) + }; +} +macro_rules! BCRYPT_MAKE_INTERFACE_VERSION { + ($major:expr, $minor:expr) => { + $crate::shared::bcrypt::BCRYPT_INTERFACE_VERSION { + MajorVersion: $major, MinorVersion: $minor, + } + } +} +macro_rules! MAKEINTRESOURCE { + ($i:expr) => { $i as u16 as usize as LPWSTR } +} +#[macro_export] +macro_rules! RIDL { + (#[uuid($l:expr, $w1:expr, $w2:expr, + $b1:expr, $b2:expr, $b3:expr, $b4:expr, $b5:expr, $b6:expr, $b7:expr, $b8:expr)] + class $class:ident;) => ( + pub enum $class {} + impl $crate::Class for $class { + #[inline] + fn uuidof() -> $crate::shared::guiddef::GUID { + $crate::shared::guiddef::GUID { + Data1: $l, + Data2: $w1, + Data3: $w2, + Data4: [$b1, $b2, $b3, $b4, $b5, $b6, $b7, $b8], + } + } + } + ); + (#[uuid($($uuid:expr),+)] + interface $interface:ident ($vtbl:ident) {$( + $(#[$($attrs:tt)*])* fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty, + )+}) => ( + RIDL!{@vtbl $interface $vtbl () $( + $(#[$($attrs)*])* fn $method($($p: $t,)*) -> $rtr, + )+} + #[repr(C)] + pub struct $interface { + pub lpVtbl: *const $vtbl, + } + impl $interface { + $(RIDL!{@method $(#[$($attrs)*])* fn $method($($p: $t,)*) -> $rtr})+ + } + RIDL!{@uuid $interface $($uuid),+} + ); + (#[uuid($($uuid:expr),+)] + interface $interface:ident ($vtbl:ident) : $pinterface:ident ($pvtbl:ident) {}) => ( + RIDL!{@vtbl $interface $vtbl (pub parent: $pvtbl,)} + #[repr(C)] + pub struct $interface { + pub lpVtbl: *const $vtbl, + } + RIDL!{@deref $interface $pinterface} + RIDL!{@uuid $interface $($uuid),+} + ); + (#[uuid($($uuid:expr),+)] + interface $interface:ident ($vtbl:ident) : $pinterface:ident ($pvtbl:ident) {$( + $(#[$($attrs:tt)*])* fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty, + )+}) => ( + RIDL!{@vtbl $interface $vtbl (pub parent: $pvtbl,) $( + $(#[$($attrs)*])* fn $method($($p: $t,)*) -> $rtr, + )+} + #[repr(C)] + pub struct $interface { + pub lpVtbl: *const $vtbl, + } + impl $interface { + $(RIDL!{@method $(#[$($attrs)*])* fn $method($($p: $t,)*) -> $rtr})+ + } + RIDL!{@deref $interface $pinterface} + RIDL!{@uuid $interface $($uuid),+} + ); + (@deref $interface:ident $pinterface:ident) => ( + impl $crate::_core::ops::Deref for $interface { + type Target = $pinterface; + #[inline] + fn deref(&self) -> &$pinterface { + unsafe { &*(self as *const $interface as *const $pinterface) } + } + } + ); + (@method fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty) => ( + #[inline] pub unsafe fn $method(&self, $($p: $t,)*) -> $rtr { + ((*self.lpVtbl).$method)(self as *const _ as *mut _, $($p,)*) + } + ); + (@method #[fixme] fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty) => ( + #[inline] pub unsafe fn $method(&self, $($p: $t,)*) -> $rtr { + let mut ret = $crate::_core::mem::uninitialized(); + ((*self.lpVtbl).$method)(self as *const _ as *mut _, &mut ret, $($p,)*); + ret + } + ); + (@vtbl $interface:ident $vtbl:ident ($($fields:tt)*) + $(fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty,)* + ) => ( + RIDL!{@item #[repr(C)] + pub struct $vtbl { + $($fields)* + $(pub $method: unsafe extern "system" fn( + This: *mut $interface, + $($p: $t,)* + ) -> $rtr,)* + }} + ); + (@vtbl $interface:ident $vtbl:ident ($($fields:tt)*) + fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty, + $($tail:tt)*) => ( + RIDL!{@vtbl $interface $vtbl ( + $($fields)* + pub $method: unsafe extern "system" fn( + This: *mut $interface, + $($p: $t,)* + ) -> $rtr, + ) $($tail)*} + ); + (@vtbl $interface:ident $vtbl:ident ($($fields:tt)*) + #[fixme] fn $method:ident($($p:ident : $t:ty,)*) -> $rtr:ty, + $($tail:tt)*) => ( + RIDL!{@vtbl $interface $vtbl ( + $($fields)* + pub $method: unsafe extern "system" fn( + This: *mut $interface, + ret: *mut $rtr, + $($p: $t,)* + ) -> *mut $rtr, + ) $($tail)*} + ); + (@uuid $interface:ident + $l:expr, $w1:expr, $w2:expr, + $b1:expr, $b2:expr, $b3:expr, $b4:expr, $b5:expr, $b6:expr, $b7:expr, $b8:expr + ) => ( + impl $crate::Interface for $interface { + #[inline] + fn uuidof() -> $crate::shared::guiddef::GUID { + $crate::shared::guiddef::GUID { + Data1: $l, + Data2: $w1, + Data3: $w2, + Data4: [$b1, $b2, $b3, $b4, $b5, $b6, $b7, $b8], + } + } + } + ); + (@item $thing:item) => ($thing); +} +macro_rules! UNION { + ($(#[$attrs:meta])* union $name:ident { + [$stype:ty; $ssize:expr], + $($variant:ident $variant_mut:ident: $ftype:ty,)+ + }) => ( + #[repr(C)] $(#[$attrs])* + pub struct $name([$stype; $ssize]); + impl Copy for $name {} + impl Clone for $name { + #[inline] + fn clone(&self) -> $name { *self } + } + #[cfg(feature = "impl-default")] + impl Default for $name { + #[inline] + fn default() -> $name { unsafe { $crate::_core::mem::zeroed() } } + } + impl $name {$( + #[inline] + pub unsafe fn $variant(&self) -> &$ftype { + &*(self as *const _ as *const $ftype) + } + #[inline] + pub unsafe fn $variant_mut(&mut self) -> &mut $ftype { + &mut *(self as *mut _ as *mut $ftype) + } + )+} + ); + ($(#[$attrs:meta])* union $name:ident { + [$stype32:ty; $ssize32:expr] [$stype64:ty; $ssize64:expr], + $($variant:ident $variant_mut:ident: $ftype:ty,)+ + }) => ( + #[repr(C)] $(#[$attrs])* #[cfg(target_pointer_width = "32")] + pub struct $name([$stype32; $ssize32]); + #[repr(C)] $(#[$attrs])* #[cfg(target_pointer_width = "64")] + pub struct $name([$stype64; $ssize64]); + impl Copy for $name {} + impl Clone for $name { + #[inline] + fn clone(&self) -> $name { *self } + } + #[cfg(feature = "impl-default")] + impl Default for $name { + #[inline] + fn default() -> $name { unsafe { $crate::_core::mem::zeroed() } } + } + impl $name {$( + #[inline] + pub unsafe fn $variant(&self) -> &$ftype { + &*(self as *const _ as *const $ftype) + } + #[inline] + pub unsafe fn $variant_mut(&mut self) -> &mut $ftype { + &mut *(self as *mut _ as *mut $ftype) + } + )+} + ); +} +macro_rules! BITFIELD { + ($base:ident $field:ident: $fieldtype:ty [ + $($thing:ident $set_thing:ident[$r:expr],)+ + ]) => { + impl $base {$( + #[inline] + pub fn $thing(&self) -> $fieldtype { + let size = $crate::core::mem::size_of::<$fieldtype>() * 8; + self.$field << (size - $r.end) >> (size - $r.end + $r.start) + } + #[inline] + pub fn $set_thing(&mut self, val: $fieldtype) { + let mask = ((1 << ($r.end - $r.start)) - 1) << $r.start; + self.$field &= !mask; + self.$field |= (val << $r.start) & mask; + } + )+} + } +} +#[macro_export] +macro_rules! ENUM { + {enum $name:ident { $($variant:ident = $value:expr,)+ }} => { + pub type $name = u32; + $(pub const $variant: $name = $value;)+ + }; + {enum $name:ident { $variant:ident = $value:expr, $($rest:tt)* }} => { + pub type $name = u32; + pub const $variant: $name = $value; + ENUM!{@gen $name $variant, $($rest)*} + }; + {enum $name:ident { $variant:ident, $($rest:tt)* }} => { + ENUM!{enum $name { $variant = 0, $($rest)* }} + }; + {@gen $name:ident $base:ident,} => {}; + {@gen $name:ident $base:ident, $variant:ident = $value:expr, $($rest:tt)*} => { + pub const $variant: $name = $value; + ENUM!{@gen $name $variant, $($rest)*} + }; + {@gen $name:ident $base:ident, $variant:ident, $($rest:tt)*} => { + pub const $variant: $name = $base + 1u32; + ENUM!{@gen $name $variant, $($rest)*} + }; +} +#[macro_export] +macro_rules! STRUCT { + (#[debug] $($rest:tt)*) => ( + STRUCT!{#[cfg_attr(feature = "impl-debug", derive(Debug))] $($rest)*} + ); + ($(#[$attrs:meta])* struct $name:ident { + $($field:ident: $ftype:ty,)+ + }) => ( + #[repr(C)] #[derive(Copy)] $(#[$attrs])* + pub struct $name { + $(pub $field: $ftype,)+ + } + impl Clone for $name { + #[inline] + fn clone(&self) -> $name { *self } + } + #[cfg(feature = "impl-default")] + impl Default for $name { + #[inline] + fn default() -> $name { unsafe { $crate::_core::mem::zeroed() } } + } + ); +} +macro_rules! IFDEF { + ($($thing:item)*) => ($($thing)*) +} +macro_rules! FN { + (stdcall $func:ident($($t:ty,)*) -> $ret:ty) => ( + pub type $func = Option $ret>; + ); + (stdcall $func:ident($($p:ident: $t:ty,)*) -> $ret:ty) => ( + pub type $func = Option $ret>; + ); + (cdecl $func:ident($($t:ty,)*) -> $ret:ty) => ( + pub type $func = Option $ret>; + ); + (cdecl $func:ident($($p:ident: $t:ty,)*) -> $ret:ty) => ( + pub type $func = Option $ret>; + ); +} +macro_rules! _WSAIO { + ($x:expr, $y:expr) => { + $crate::shared::ws2def::IOC_VOID | $x | $y + } +} +macro_rules! _WSAIOR { + ($x:expr, $y:expr) => { + $crate::shared::ws2def::IOC_OUT | $x | $y + } +} +macro_rules! _WSAIOW { + ($x:expr, $y:expr) => { + $crate::shared::ws2def::IOC_IN | $x | $y + } +} +macro_rules! _WSAIORW { + ($x:expr, $y:expr) => { + $crate::shared::ws2def::IOC_INOUT | $x | $y + } +} diff --git a/bash-5.1/vendor/winapi/src/shared/basetsd.rs b/bash-5.1/vendor/winapi/src/shared/basetsd.rs new file mode 100644 index 0000000000000000000000000000000000000000..b3b7123236b2d367c888c890faf3f6a22e20b90b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/basetsd.rs @@ -0,0 +1,70 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Type definitions for the basic sized types. +use ctypes::{__int64, __uint64, c_int, c_schar, c_short, c_uchar, c_uint, c_ushort}; +pub type POINTER_64_INT = usize; +pub type INT8 = c_schar; +pub type PINT8 = *mut c_schar; +pub type INT16 = c_short; +pub type PINT16 = *mut c_short; +pub type INT32 = c_int; +pub type PINT32 = *mut c_int; +pub type INT64 = __int64; +pub type PINT64 = *mut __int64; +pub type UINT8 = c_uchar; +pub type PUINT8 = *mut c_uchar; +pub type UINT16 = c_ushort; +pub type PUINT16 = *mut c_ushort; +pub type UINT32 = c_uint; +pub type PUINT32 = *mut c_uint; +pub type UINT64 = __uint64; +pub type PUINT64 = *mut __uint64; +pub type LONG32 = c_int; +pub type PLONG32 = *mut c_int; +pub type ULONG32 = c_uint; +pub type PULONG32 = *mut c_uint; +pub type DWORD32 = c_uint; +pub type PDWORD32 = *mut c_uint; +pub type INT_PTR = isize; +pub type PINT_PTR = *mut isize; +pub type UINT_PTR = usize; +pub type PUINT_PTR = *mut usize; +pub type LONG_PTR = isize; +pub type PLONG_PTR = *mut isize; +pub type ULONG_PTR = usize; +pub type PULONG_PTR = *mut usize; +pub type SHANDLE_PTR = isize; +pub type HANDLE_PTR = usize; +#[cfg(target_pointer_width = "32")] +pub type UHALF_PTR = c_ushort; +#[cfg(target_pointer_width = "64")] +pub type UHALF_PTR = c_uint; +#[cfg(target_pointer_width = "32")] +pub type PUHALF_PTR = *mut c_ushort; +#[cfg(target_pointer_width = "64")] +pub type PUHALF_PTR = *mut c_uint; +#[cfg(target_pointer_width = "32")] +pub type HALF_PTR = c_short; +#[cfg(target_pointer_width = "64")] +pub type HALF_PTR = c_int; +#[cfg(target_pointer_width = "32")] +pub type PHALF_PTR = *mut c_short; +#[cfg(target_pointer_width = "64")] +pub type PHALF_PTR = *mut c_int; +pub type SIZE_T = ULONG_PTR; +pub type PSIZE_T = *mut ULONG_PTR; +pub type SSIZE_T = LONG_PTR; +pub type PSSIZE_T = *mut LONG_PTR; +pub type DWORD_PTR = ULONG_PTR; +pub type PDWORD_PTR = *mut ULONG_PTR; +pub type LONG64 = __int64; +pub type PLONG64 = *mut __int64; +pub type ULONG64 = __uint64; +pub type PULONG64 = *mut __uint64; +pub type DWORD64 = __uint64; +pub type PDWORD64 = *mut __uint64; +pub type KAFFINITY = ULONG_PTR; +pub type PKAFFINITY = *mut KAFFINITY; diff --git a/bash-5.1/vendor/winapi/src/shared/bcrypt.rs b/bash-5.1/vendor/winapi/src/shared/bcrypt.rs new file mode 100644 index 0000000000000000000000000000000000000000..4fa88ef8fdb87e5f95ee424a399253f0755f511a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/bcrypt.rs @@ -0,0 +1,1001 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Cryptographic Primitive API Prototypes and Definitions +use shared::minwindef::{PUCHAR, UCHAR, ULONG, USHORT}; +use um::winnt::{BOOLEAN, HANDLE, LONG, LPCWSTR, LPWSTR, PVOID, PWSTR, ULONGLONG, VOID}; +pub type NTSTATUS = LONG; +pub type PNTSTATUS = *mut NTSTATUS; +#[inline] +pub fn BCRYPT_SUCCESS(Status: NTSTATUS) -> bool { + Status >= 0 +} +pub const BCRYPT_OBJECT_ALIGNMENT: usize = 16; +pub const BCRYPT_KDF_HASH: &'static str = "HASH"; +pub const BCRYPT_KDF_HMAC: &'static str = "HMAC"; +pub const BCRYPT_KDF_TLS_PRF: &'static str = "TLS_PRF"; +pub const BCRYPT_KDF_SP80056A_CONCAT: &'static str = "SP800_56A_CONCAT"; +pub const BCRYPT_KDF_RAW_SECRET: &'static str = "TRUNCATE"; +pub const KDF_HASH_ALGORITHM: ULONG = 0x0; +pub const KDF_SECRET_PREPEND: ULONG = 0x1; +pub const KDF_SECRET_APPEND: ULONG = 0x2; +pub const KDF_HMAC_KEY: ULONG = 0x3; +pub const KDF_TLS_PRF_LABEL: ULONG = 0x4; +pub const KDF_TLS_PRF_SEED: ULONG = 0x5; +pub const KDF_SECRET_HANDLE: ULONG = 0x6; +pub const KDF_TLS_PRF_PROTOCOL: ULONG = 0x7; +pub const KDF_ALGORITHMID: ULONG = 0x8; +pub const KDF_PARTYUINFO: ULONG = 0x9; +pub const KDF_PARTYVINFO: ULONG = 0xA; +pub const KDF_SUPPPUBINFO: ULONG = 0xB; +pub const KDF_SUPPPRIVINFO: ULONG = 0xC; +pub const KDF_LABEL: ULONG = 0xD; +pub const KDF_CONTEXT: ULONG = 0xE; +pub const KDF_SALT: ULONG = 0xF; +pub const KDF_ITERATION_COUNT: ULONG = 0x10; +pub const KDF_GENERIC_PARAMETER: ULONG = 0x11; +pub const KDF_KEYBITLENGTH: ULONG = 0x12; +pub const KDF_USE_SECRET_AS_HMAC_KEY_FLAG: ULONG = 0x1; +STRUCT!{struct BCRYPT_KEY_LENGTHS_STRUCT { + dwMinLength: ULONG, + dwMaxLength: ULONG, + dwIncrement: ULONG, +}} +pub type BCRYPT_AUTH_TAG_LENGTHS_STRUCT = BCRYPT_KEY_LENGTHS_STRUCT; +STRUCT!{struct BCRYPT_OID { + cbOID: ULONG, + pbOID: PUCHAR, +}} +STRUCT!{struct BCRYPT_OID_LIST { + dwOIDCount: ULONG, + pOIDs: *mut BCRYPT_OID, +}} +STRUCT!{struct BCRYPT_PKCS1_PADDING_INFO { + pszAlgId: LPCWSTR, +}} +STRUCT!{struct BCRYPT_PSS_PADDING_INFO { + pszAlgId: LPCWSTR, + cbSalt: ULONG, +}} +STRUCT!{struct BCRYPT_OAEP_PADDING_INFO { + pszAlgId: LPCWSTR, + pbLabel: PUCHAR, + cbLabel: ULONG, +}} +pub const BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION: ULONG = 1; +pub const BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG: ULONG = 0x00000001; +pub const BCRYPT_AUTH_MODE_IN_PROGRESS_FLAG: ULONG = 0x00000002; +STRUCT!{struct BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO { + cbSize: ULONG, + dwInfoVersion: ULONG, + pbNonce: PUCHAR, + cbNonce: ULONG, + pbAuthData: PUCHAR, + cbAuthData: ULONG, + pbTag: PUCHAR, + cbTag: ULONG, + pbMacContext: PUCHAR, + cbMacContext: ULONG, + cbAAD: ULONG, + cbData: ULONGLONG, + dwFlags: ULONG, +}} +pub type PBCRYPT_AUTHENTICATED_CIPHER_MODE_INFO = *mut BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO; +pub const BCRYPT_OPAQUE_KEY_BLOB: &'static str = "OpaqueKeyBlob"; +pub const BCRYPT_KEY_DATA_BLOB: &'static str = "KeyDataBlob"; +pub const BCRYPT_AES_WRAP_KEY_BLOB: &'static str = "Rfc3565KeyWrapBlob"; +pub const BCRYPT_OBJECT_LENGTH: &'static str = "ObjectLength"; +pub const BCRYPT_ALGORITHM_NAME: &'static str = "AlgorithmName"; +pub const BCRYPT_PROVIDER_HANDLE: &'static str = "ProviderHandle"; +pub const BCRYPT_CHAINING_MODE: &'static str = "ChainingMode"; +pub const BCRYPT_BLOCK_LENGTH: &'static str = "BlockLength"; +pub const BCRYPT_KEY_LENGTH: &'static str = "KeyLength"; +pub const BCRYPT_KEY_OBJECT_LENGTH: &'static str = "KeyObjectLength"; +pub const BCRYPT_KEY_STRENGTH: &'static str = "KeyStrength"; +pub const BCRYPT_KEY_LENGTHS: &'static str = "KeyLengths"; +pub const BCRYPT_BLOCK_SIZE_LIST: &'static str = "BlockSizeList"; +pub const BCRYPT_EFFECTIVE_KEY_LENGTH: &'static str = "EffectiveKeyLength"; +pub const BCRYPT_HASH_LENGTH: &'static str = "HashDigestLength"; +pub const BCRYPT_HASH_OID_LIST: &'static str = "HashOIDList"; +pub const BCRYPT_PADDING_SCHEMES: &'static str = "PaddingSchemes"; +pub const BCRYPT_SIGNATURE_LENGTH: &'static str = "SignatureLength"; +pub const BCRYPT_HASH_BLOCK_LENGTH: &'static str = "HashBlockLength"; +pub const BCRYPT_AUTH_TAG_LENGTH: &'static str = "AuthTagLength"; +pub const BCRYPT_PRIMITIVE_TYPE: &'static str = "PrimitiveType"; +pub const BCRYPT_IS_KEYED_HASH: &'static str = "IsKeyedHash"; +pub const BCRYPT_IS_REUSABLE_HASH: &'static str = "IsReusableHash"; +pub const BCRYPT_MESSAGE_BLOCK_LENGTH: &'static str = "MessageBlockLength"; +pub const BCRYPT_PUBLIC_KEY_LENGTH: &'static str = "PublicKeyLength"; +pub const BCRYPT_PCP_PLATFORM_TYPE_PROPERTY: &'static str = "PCP_PLATFORM_TYPE"; +pub const BCRYPT_PCP_PROVIDER_VERSION_PROPERTY: &'static str = "PCP_PROVIDER_VERSION"; +pub const BCRYPT_MULTI_OBJECT_LENGTH: &'static str = "MultiObjectLength"; +pub const BCRYPT_INITIALIZATION_VECTOR: &'static str = "IV"; +pub const BCRYPT_CHAIN_MODE_NA: &'static str = "ChainingModeN/A"; +pub const BCRYPT_CHAIN_MODE_CBC: &'static str = "ChainingModeCBC"; +pub const BCRYPT_CHAIN_MODE_ECB: &'static str = "ChainingModeECB"; +pub const BCRYPT_CHAIN_MODE_CFB: &'static str = "ChainingModeCFB"; +pub const BCRYPT_CHAIN_MODE_CCM: &'static str = "ChainingModeCCM"; +pub const BCRYPT_CHAIN_MODE_GCM: &'static str = "ChainingModeGCM"; +pub const BCRYPT_PROV_DISPATCH: ULONG = 0x00000001; +pub const BCRYPT_BLOCK_PADDING: ULONG = 0x00000001; +pub const BCRYPT_PAD_NONE: ULONG = 0x00000001; +pub const BCRYPT_PAD_PKCS1: ULONG = 0x00000002; +pub const BCRYPT_PAD_OAEP: ULONG = 0x00000004; +pub const BCRYPT_PAD_PSS: ULONG = 0x00000008; +pub const BCRYPT_PAD_PKCS1_OPTIONAL_HASH_OID: ULONG = 0x00000010; +pub const BCRYPTBUFFER_VERSION: ULONG = 0; +STRUCT!{struct BCryptBuffer { + cbBuffer: ULONG, + BufferType: ULONG, + pvBuffer: PVOID, +}} +pub type PBCryptBuffer = *mut BCryptBuffer; +STRUCT!{struct BCryptBufferDesc { + ulVersion: ULONG, + cBuffers: ULONG, + pBuffers: PBCryptBuffer, +}} +pub type PBCryptBufferDesc = *mut BCryptBufferDesc; +pub type BCRYPT_HANDLE = PVOID; +pub type BCRYPT_ALG_HANDLE = PVOID; +pub type BCRYPT_KEY_HANDLE = PVOID; +pub type BCRYPT_HASH_HANDLE = PVOID; +pub type BCRYPT_SECRET_HANDLE = PVOID; +pub const BCRYPT_PUBLIC_KEY_BLOB: &'static str = "PUBLICBLOB"; +pub const BCRYPT_PRIVATE_KEY_BLOB: &'static str = "PRIVATEBLOB"; +STRUCT!{struct BCRYPT_KEY_BLOB { + Magic: ULONG, +}} +pub const BCRYPT_RSAPUBLIC_BLOB: &'static str = "RSAPUBLICBLOB"; +pub const BCRYPT_RSAPRIVATE_BLOB: &'static str = "RSAPRIVATEBLOB"; +pub const LEGACY_RSAPUBLIC_BLOB: &'static str = "CAPIPUBLICBLOB"; +pub const LEGACY_RSAPRIVATE_BLOB: &'static str = "CAPIPRIVATEBLOB"; +pub const BCRYPT_RSAPUBLIC_MAGIC: ULONG = 0x31415352; +pub const BCRYPT_RSAPRIVATE_MAGIC: ULONG = 0x32415352; +STRUCT!{struct BCRYPT_RSAKEY_BLOB { + Magic: ULONG, + BitLength: ULONG, + cbPublicExp: ULONG, + cbModulus: ULONG, + cbPrime1: ULONG, + cbPrime2: ULONG, +}} +pub const BCRYPT_RSAFULLPRIVATE_BLOB: &'static str = "RSAFULLPRIVATEBLOB"; +pub const BCRYPT_RSAFULLPRIVATE_MAGIC: ULONG = 0x33415352; +pub const BCRYPT_GLOBAL_PARAMETERS: &'static str = "SecretAgreementParam"; +pub const BCRYPT_PRIVATE_KEY: &'static str = "PrivKeyVal"; +pub const BCRYPT_ECCPUBLIC_BLOB: &'static str = "ECCPUBLICBLOB"; +pub const BCRYPT_ECCPRIVATE_BLOB: &'static str = "ECCPRIVATEBLOB"; +pub const BCRYPT_ECCFULLPUBLIC_BLOB: &'static str = "ECCFULLPUBLICBLOB"; +pub const BCRYPT_ECCFULLPRIVATE_BLOB: &'static str = "ECCFULLPRIVATEBLOB"; +pub const SSL_ECCPUBLIC_BLOB: &'static str = "SSLECCPUBLICBLOB"; +pub const BCRYPT_ECDH_PUBLIC_P256_MAGIC: ULONG = 0x314B4345; +pub const BCRYPT_ECDH_PRIVATE_P256_MAGIC: ULONG = 0x324B4345; +pub const BCRYPT_ECDH_PUBLIC_P384_MAGIC: ULONG = 0x334B4345; +pub const BCRYPT_ECDH_PRIVATE_P384_MAGIC: ULONG = 0x344B4345; +pub const BCRYPT_ECDH_PUBLIC_P521_MAGIC: ULONG = 0x354B4345; +pub const BCRYPT_ECDH_PRIVATE_P521_MAGIC: ULONG = 0x364B4345; +pub const BCRYPT_ECDH_PUBLIC_GENERIC_MAGIC: ULONG = 0x504B4345; +pub const BCRYPT_ECDH_PRIVATE_GENERIC_MAGIC: ULONG = 0x564B4345; +pub const BCRYPT_ECDSA_PUBLIC_P256_MAGIC: ULONG = 0x31534345; +pub const BCRYPT_ECDSA_PRIVATE_P256_MAGIC: ULONG = 0x32534345; +pub const BCRYPT_ECDSA_PUBLIC_P384_MAGIC: ULONG = 0x33534345; +pub const BCRYPT_ECDSA_PRIVATE_P384_MAGIC: ULONG = 0x34534345; +pub const BCRYPT_ECDSA_PUBLIC_P521_MAGIC: ULONG = 0x35534345; +pub const BCRYPT_ECDSA_PRIVATE_P521_MAGIC: ULONG = 0x36534345; +pub const BCRYPT_ECDSA_PUBLIC_GENERIC_MAGIC: ULONG = 0x50444345; +pub const BCRYPT_ECDSA_PRIVATE_GENERIC_MAGIC: ULONG = 0x56444345; +STRUCT!{struct BCRYPT_ECCKEY_BLOB { + dwMagic: ULONG, + cbKey: ULONG, +}} +pub type PBCRYPT_ECCKEY_BLOB = *mut BCRYPT_ECCKEY_BLOB; +STRUCT!{struct SSL_ECCKEY_BLOB { + dwCurveType: ULONG, + cbKey: ULONG, +}} +pub type PSSL_ECCKEY_BLOB = *mut SSL_ECCKEY_BLOB; +pub const BCRYPT_ECC_FULLKEY_BLOB_V1: ULONG = 0x1; +ENUM!{enum ECC_CURVE_TYPE_ENUM { + BCRYPT_ECC_PRIME_SHORT_WEIERSTRASS_CURVE = 0x1, + BCRYPT_ECC_PRIME_TWISTED_EDWARDS_CURVE = 0x2, + BCRYPT_ECC_PRIME_MONTGOMERY_CURVE = 0x3, +}} +ENUM!{enum ECC_CURVE_ALG_ID_ENUM { + BCRYPT_NO_CURVE_GENERATION_ALG_ID = 0x0, +}} +STRUCT!{struct BCRYPT_ECCFULLKEY_BLOB { + dwMagic: ULONG, + dwVersion: ULONG, + dwCurveType: ECC_CURVE_TYPE_ENUM, + dwCurveGenerationAlgId: ECC_CURVE_ALG_ID_ENUM, + cbFieldLength: ULONG, + cbSubgroupOrder: ULONG, + cbCofactor: ULONG, + cbSeed: ULONG, +}} +pub type PBCRYPT_ECCFULLKEY_BLOB = *mut BCRYPT_ECCFULLKEY_BLOB; +pub const BCRYPT_DH_PUBLIC_BLOB: &'static str = "DHPUBLICBLOB"; +pub const BCRYPT_DH_PRIVATE_BLOB: &'static str = "DHPRIVATEBLOB"; +pub const LEGACY_DH_PUBLIC_BLOB: &'static str = "CAPIDHPUBLICBLOB"; +pub const LEGACY_DH_PRIVATE_BLOB: &'static str = "CAPIDHPRIVATEBLOB"; +pub const BCRYPT_DH_PUBLIC_MAGIC: ULONG = 0x42504844; +pub const BCRYPT_DH_PRIVATE_MAGIC: ULONG = 0x56504844; +STRUCT!{struct BCRYPT_DH_KEY_BLOB { + dwMagic: ULONG, + cbKey: ULONG, +}} +pub type PBCRYPT_DH_KEY_BLOB = *mut BCRYPT_DH_KEY_BLOB; +pub const BCRYPT_DH_PARAMETERS: &'static str = "DHParameters"; +pub const BCRYPT_DH_PARAMETERS_MAGIC: ULONG = 0x4d504844; +STRUCT!{struct BCRYPT_DH_PARAMETER_HEADER { + cbLength: ULONG, + dwMagic: ULONG, + cbKeyLength: ULONG, +}} +pub const BCRYPT_DSA_PUBLIC_BLOB: &'static str = "DSAPUBLICBLOB"; +pub const BCRYPT_DSA_PRIVATE_BLOB: &'static str = "DSAPRIVATEBLOB"; +pub const LEGACY_DSA_PUBLIC_BLOB: &'static str = "CAPIDSAPUBLICBLOB"; +pub const LEGACY_DSA_PRIVATE_BLOB: &'static str = "CAPIDSAPRIVATEBLOB"; +pub const LEGACY_DSA_V2_PUBLIC_BLOB: &'static str = "V2CAPIDSAPUBLICBLOB"; +pub const LEGACY_DSA_V2_PRIVATE_BLOB: &'static str = "V2CAPIDSAPRIVATEBLOB"; +pub const BCRYPT_DSA_PUBLIC_MAGIC: ULONG = 0x42505344; +pub const BCRYPT_DSA_PRIVATE_MAGIC: ULONG = 0x56505344; +pub const BCRYPT_DSA_PUBLIC_MAGIC_V2: ULONG = 0x32425044; +pub const BCRYPT_DSA_PRIVATE_MAGIC_V2: ULONG = 0x32565044; +STRUCT!{struct BCRYPT_DSA_KEY_BLOB { + dwMagic: ULONG, + cbKey: ULONG, + Count: [UCHAR; 4], + Seed: [UCHAR; 20], + q: [UCHAR; 20], +}} +pub type PBCRYPT_DSA_KEY_BLOB = *mut BCRYPT_DSA_KEY_BLOB; +ENUM!{enum HASHALGORITHM_ENUM { + DSA_HASH_ALGORITHM_SHA1, + DSA_HASH_ALGORITHM_SHA256, + DSA_HASH_ALGORITHM_SHA512, +}} +ENUM!{enum DSAFIPSVERSION_ENUM { + DSA_FIPS186_2, + DSA_FIPS186_3, +}} +STRUCT!{struct BCRYPT_DSA_KEY_BLOB_V2 { + dwMagic: ULONG, + cbKey: ULONG, + hashAlgorithm: HASHALGORITHM_ENUM, + standardVersion: DSAFIPSVERSION_ENUM, + cbSeedLength: ULONG, + cbGroupSize: ULONG, + Count: [UCHAR; 4], +}} +pub type PBCRYPT_DSA_KEY_BLOB_V2 = *mut BCRYPT_DSA_KEY_BLOB_V2; +STRUCT!{struct BCRYPT_KEY_DATA_BLOB_HEADER { + dwMagic: ULONG, + dwVersion: ULONG, + cbKeyData: ULONG, +}} +pub type PBCRYPT_KEY_DATA_BLOB_HEADER = *mut BCRYPT_KEY_DATA_BLOB_HEADER; +pub const BCRYPT_KEY_DATA_BLOB_MAGIC: ULONG = 0x4d42444b; +pub const BCRYPT_KEY_DATA_BLOB_VERSION1: ULONG = 0x1; +pub const BCRYPT_DSA_PARAMETERS: &'static str = "DSAParameters"; +pub const BCRYPT_DSA_PARAMETERS_MAGIC: ULONG = 0x4d505344; +pub const BCRYPT_DSA_PARAMETERS_MAGIC_V2: ULONG = 0x324d5044; +STRUCT!{struct BCRYPT_DSA_PARAMETER_HEADER { + cbLength: ULONG, + dwMagic: ULONG, + cbKeyLength: ULONG, + Count: [UCHAR; 4], + Seed: [UCHAR; 20], + q: [UCHAR; 20], +}} +STRUCT!{struct BCRYPT_DSA_PARAMETER_HEADER_V2 { + cbLength: ULONG, + dwMagic: ULONG, + cbKeyLength: ULONG, + hashAlgorithm: HASHALGORITHM_ENUM, + standardVersion: DSAFIPSVERSION_ENUM, + cbSeedLength: ULONG, + cbGroupSize: ULONG, + Count: [UCHAR; 4], +}} +pub const BCRYPT_ECC_PARAMETERS: &'static str = "ECCParameters"; +pub const BCRYPT_ECC_CURVE_NAME: &'static str = "ECCCurveName"; +pub const BCRYPT_ECC_CURVE_NAME_LIST: &'static str = "ECCCurveNameList"; +pub const BCRYPT_ECC_PARAMETERS_MAGIC: ULONG = 0x50434345; +STRUCT!{struct BCRYPT_ECC_CURVE_NAMES { + dwEccCurveNames: ULONG, + pEccCurveNames: LPWSTR, +}} +pub const BCRYPT_ECC_CURVE_BRAINPOOLP160R1: &'static str = "brainpoolP160r1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP160T1: &'static str = "brainpoolP160t1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP192R1: &'static str = "brainpoolP192r1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP192T1: &'static str = "brainpoolP192t1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP224R1: &'static str = "brainpoolP224r1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP224T1: &'static str = "brainpoolP224t1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP256R1: &'static str = "brainpoolP256r1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP256T1: &'static str = "brainpoolP256t1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP320R1: &'static str = "brainpoolP320r1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP320T1: &'static str = "brainpoolP320t1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP384R1: &'static str = "brainpoolP384r1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP384T1: &'static str = "brainpoolP384t1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP512R1: &'static str = "brainpoolP512r1"; +pub const BCRYPT_ECC_CURVE_BRAINPOOLP512T1: &'static str = "brainpoolP512t1"; +pub const BCRYPT_ECC_CURVE_25519: &'static str = "curve25519"; +pub const BCRYPT_ECC_CURVE_EC192WAPI: &'static str = "ec192wapi"; +pub const BCRYPT_ECC_CURVE_NISTP192: &'static str = "nistP192"; +pub const BCRYPT_ECC_CURVE_NISTP224: &'static str = "nistP224"; +pub const BCRYPT_ECC_CURVE_NISTP256: &'static str = "nistP256"; +pub const BCRYPT_ECC_CURVE_NISTP384: &'static str = "nistP384"; +pub const BCRYPT_ECC_CURVE_NISTP521: &'static str = "nistP521"; +pub const BCRYPT_ECC_CURVE_NUMSP256T1: &'static str = "numsP256t1"; +pub const BCRYPT_ECC_CURVE_NUMSP384T1: &'static str = "numsP384t1"; +pub const BCRYPT_ECC_CURVE_NUMSP512T1: &'static str = "numsP512t1"; +pub const BCRYPT_ECC_CURVE_SECP160K1: &'static str = "secP160k1"; +pub const BCRYPT_ECC_CURVE_SECP160R1: &'static str = "secP160r1"; +pub const BCRYPT_ECC_CURVE_SECP160R2: &'static str = "secP160r2"; +pub const BCRYPT_ECC_CURVE_SECP192K1: &'static str = "secP192k1"; +pub const BCRYPT_ECC_CURVE_SECP192R1: &'static str = "secP192r1"; +pub const BCRYPT_ECC_CURVE_SECP224K1: &'static str = "secP224k1"; +pub const BCRYPT_ECC_CURVE_SECP224R1: &'static str = "secP224r1"; +pub const BCRYPT_ECC_CURVE_SECP256K1: &'static str = "secP256k1"; +pub const BCRYPT_ECC_CURVE_SECP256R1: &'static str = "secP256r1"; +pub const BCRYPT_ECC_CURVE_SECP384R1: &'static str = "secP384r1"; +pub const BCRYPT_ECC_CURVE_SECP521R1: &'static str = "secP521r1"; +pub const BCRYPT_ECC_CURVE_WTLS7: &'static str = "wtls7"; +pub const BCRYPT_ECC_CURVE_WTLS9: &'static str = "wtls9"; +pub const BCRYPT_ECC_CURVE_WTLS12: &'static str = "wtls12"; +pub const BCRYPT_ECC_CURVE_X962P192V1: &'static str = "x962P192v1"; +pub const BCRYPT_ECC_CURVE_X962P192V2: &'static str = "x962P192v2"; +pub const BCRYPT_ECC_CURVE_X962P192V3: &'static str = "x962P192v3"; +pub const BCRYPT_ECC_CURVE_X962P239V1: &'static str = "x962P239v1"; +pub const BCRYPT_ECC_CURVE_X962P239V2: &'static str = "x962P239v2"; +pub const BCRYPT_ECC_CURVE_X962P239V3: &'static str = "x962P239v3"; +pub const BCRYPT_ECC_CURVE_X962P256V1: &'static str = "x962P256v1"; +ENUM!{enum BCRYPT_HASH_OPERATION_TYPE { + BCRYPT_HASH_OPERATION_HASH_DATA = 1, + BCRYPT_HASH_OPERATION_FINISH_HASH = 2, +}} +STRUCT!{struct BCRYPT_MULTI_HASH_OPERATION { + iHash: ULONG, + hashOperation: BCRYPT_HASH_OPERATION_TYPE, + pbBuffer: PUCHAR, + cbBuffer: ULONG, +}} +ENUM!{enum BCRYPT_MULTI_OPERATION_TYPE { + BCRYPT_OPERATION_TYPE_HASH = 1, +}} +STRUCT!{struct BCRYPT_MULTI_OBJECT_LENGTH_STRUCT { + cbPerObject: ULONG, + cbPerElement: ULONG, +}} +pub const MS_PRIMITIVE_PROVIDER: &'static str = "Microsoft Primitive Provider"; +pub const MS_PLATFORM_CRYPTO_PROVIDER: &'static str = "Microsoft Platform Crypto Provider"; +pub const BCRYPT_RSA_ALGORITHM: &'static str = "RSA"; +pub const BCRYPT_RSA_SIGN_ALGORITHM: &'static str = "RSA_SIGN"; +pub const BCRYPT_DH_ALGORITHM: &'static str = "DH"; +pub const BCRYPT_DSA_ALGORITHM: &'static str = "DSA"; +pub const BCRYPT_RC2_ALGORITHM: &'static str = "RC2"; +pub const BCRYPT_RC4_ALGORITHM: &'static str = "RC4"; +pub const BCRYPT_AES_ALGORITHM: &'static str = "AES"; +pub const BCRYPT_DES_ALGORITHM: &'static str = "DES"; +pub const BCRYPT_DESX_ALGORITHM: &'static str = "DESX"; +pub const BCRYPT_3DES_ALGORITHM: &'static str = "3DES"; +pub const BCRYPT_3DES_112_ALGORITHM: &'static str = "3DES_112"; +pub const BCRYPT_MD2_ALGORITHM: &'static str = "MD2"; +pub const BCRYPT_MD4_ALGORITHM: &'static str = "MD4"; +pub const BCRYPT_MD5_ALGORITHM: &'static str = "MD5"; +pub const BCRYPT_SHA1_ALGORITHM: &'static str = "SHA1"; +pub const BCRYPT_SHA256_ALGORITHM: &'static str = "SHA256"; +pub const BCRYPT_SHA384_ALGORITHM: &'static str = "SHA384"; +pub const BCRYPT_SHA512_ALGORITHM: &'static str = "SHA512"; +pub const BCRYPT_AES_GMAC_ALGORITHM: &'static str = "AES-GMAC"; +pub const BCRYPT_AES_CMAC_ALGORITHM: &'static str = "AES-CMAC"; +pub const BCRYPT_ECDSA_P256_ALGORITHM: &'static str = "ECDSA_P256"; +pub const BCRYPT_ECDSA_P384_ALGORITHM: &'static str = "ECDSA_P384"; +pub const BCRYPT_ECDSA_P521_ALGORITHM: &'static str = "ECDSA_P521"; +pub const BCRYPT_ECDH_P256_ALGORITHM: &'static str = "ECDH_P256"; +pub const BCRYPT_ECDH_P384_ALGORITHM: &'static str = "ECDH_P384"; +pub const BCRYPT_ECDH_P521_ALGORITHM: &'static str = "ECDH_P521"; +pub const BCRYPT_RNG_ALGORITHM: &'static str = "RNG"; +pub const BCRYPT_RNG_FIPS186_DSA_ALGORITHM: &'static str = "FIPS186DSARNG"; +pub const BCRYPT_RNG_DUAL_EC_ALGORITHM: &'static str = "DUALECRNG"; +pub const BCRYPT_SP800108_CTR_HMAC_ALGORITHM: &'static str = "SP800_108_CTR_HMAC"; +pub const BCRYPT_SP80056A_CONCAT_ALGORITHM: &'static str = "SP800_56A_CONCAT"; +pub const BCRYPT_PBKDF2_ALGORITHM: &'static str = "PBKDF2"; +pub const BCRYPT_CAPI_KDF_ALGORITHM: &'static str = "CAPI_KDF"; +pub const BCRYPT_TLS1_1_KDF_ALGORITHM: &'static str = "TLS1_1_KDF"; +pub const BCRYPT_TLS1_2_KDF_ALGORITHM: &'static str = "TLS1_2_KDF"; +pub const BCRYPT_ECDSA_ALGORITHM: &'static str = "ECDSA"; +pub const BCRYPT_ECDH_ALGORITHM: &'static str = "ECDH"; +pub const BCRYPT_XTS_AES_ALGORITHM: &'static str = "XTS-AES"; +pub const BCRYPT_CIPHER_INTERFACE: ULONG = 0x00000001; +pub const BCRYPT_HASH_INTERFACE: ULONG = 0x00000002; +pub const BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE: ULONG = 0x00000003; +pub const BCRYPT_SECRET_AGREEMENT_INTERFACE: ULONG = 0x00000004; +pub const BCRYPT_SIGNATURE_INTERFACE: ULONG = 0x00000005; +pub const BCRYPT_RNG_INTERFACE: ULONG = 0x00000006; +pub const BCRYPT_KEY_DERIVATION_INTERFACE: ULONG = 0x00000007; +pub const BCRYPT_MD2_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000001 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_MD4_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000011 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_MD5_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000021 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_SHA1_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000031 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_SHA256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000041 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_SHA384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000051 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_SHA512_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000061 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_RC4_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000071 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_RNG_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000081 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_HMAC_MD5_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000091 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_HMAC_SHA1_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000a1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_HMAC_SHA256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000b1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_HMAC_SHA384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000c1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_HMAC_SHA512_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000d1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_RSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000e1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_ECDSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000f1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_AES_CMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000101 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_AES_GMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000111 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_HMAC_MD2_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000121 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_HMAC_MD4_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000131 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_3DES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000141 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_3DES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000151 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_3DES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000161 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_3DES_112_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000171 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_3DES_112_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000181 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_3DES_112_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000191 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_AES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001a1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_AES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001b1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_AES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001c1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_AES_CCM_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001d1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_AES_GCM_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001e1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_DES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001f1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_DES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000201 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_DES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000211 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_DESX_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000221 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_DESX_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000231 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_DESX_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000241 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_RC2_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000251 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_RC2_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000261 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_RC2_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000271 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_DH_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000281 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_ECDH_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000291 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_ECDH_P256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002a1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_ECDH_P384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002b1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_ECDH_P521_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002c1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_DSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002d1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_ECDSA_P256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002e1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_ECDSA_P384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002f1 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_ECDSA_P521_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000301 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_RSA_SIGN_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000311 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_CAPI_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000321 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_PBKDF2_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000331 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_SP800108_CTR_HMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000341 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_SP80056A_CONCAT_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000351 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_TLS1_1_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000361 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_TLS1_2_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000371 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_XTS_AES_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000381 as BCRYPT_ALG_HANDLE; +pub const BCRYPT_ALG_HANDLE_HMAC_FLAG: ULONG = 0x00000008; +pub const BCRYPT_CAPI_AES_FLAG: ULONG = 0x00000010; +pub const BCRYPT_HASH_REUSABLE_FLAG: ULONG = 0x00000020; +pub const BCRYPT_BUFFERS_LOCKED_FLAG: ULONG = 0x00000040; +pub const BCRYPT_EXTENDED_KEYSIZE: ULONG = 0x00000080; +pub const BCRYPT_ENABLE_INCOMPATIBLE_FIPS_CHECKS: ULONG = 0x00000100; +extern "system" { + pub fn BCryptOpenAlgorithmProvider( + phAlgorithm: *mut BCRYPT_ALG_HANDLE, + pszAlgId: LPCWSTR, + pszImplementation: LPCWSTR, + dwFlags: ULONG, + ) -> NTSTATUS; +} +pub const BCRYPT_CIPHER_OPERATION: ULONG = 0x00000001; +pub const BCRYPT_HASH_OPERATION: ULONG = 0x00000002; +pub const BCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION: ULONG = 0x00000004; +pub const BCRYPT_SECRET_AGREEMENT_OPERATION: ULONG = 0x00000008; +pub const BCRYPT_SIGNATURE_OPERATION: ULONG = 0x00000010; +pub const BCRYPT_RNG_OPERATION: ULONG = 0x00000020; +pub const BCRYPT_KEY_DERIVATION_OPERATION: ULONG = 0x00000040; +STRUCT!{struct BCRYPT_ALGORITHM_IDENTIFIER { + pszName: LPWSTR, + dwClass: ULONG, + dwFlags: ULONG, +}} +extern "system" { + pub fn BCryptEnumAlgorithms( + dwAlgOperations: ULONG, + pAlgCount: *mut ULONG, + ppAlgList: *mut *mut BCRYPT_ALGORITHM_IDENTIFIER, + dwFlags: ULONG, + ) -> NTSTATUS; +} +STRUCT!{struct BCRYPT_PROVIDER_NAME { + pszProviderName: LPWSTR, +}} +extern "system" { + pub fn BCryptEnumProviders( + pszAlgId: LPCWSTR, + pImplCount: *mut ULONG, + ppImplList: *mut *mut BCRYPT_PROVIDER_NAME, + dwFlags: ULONG, + ) -> NTSTATUS; +} +pub const BCRYPT_PUBLIC_KEY_FLAG: ULONG = 0x00000001; +pub const BCRYPT_PRIVATE_KEY_FLAG: ULONG = 0x00000002; +extern "system" { + pub fn BCryptGetProperty( + hObject: BCRYPT_HANDLE, + pszProperty: LPCWSTR, + pbOutput: PUCHAR, + cbOutput: ULONG, + pcbResult: *mut ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptSetProperty( + hObject: BCRYPT_HANDLE, + pszProperty: LPCWSTR, + pbInput: PUCHAR, + cbInput: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptCloseAlgorithmProvider( + hAlgorithm: BCRYPT_ALG_HANDLE, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptFreeBuffer( + pvBuffer: PVOID, + ); + pub fn BCryptGenerateSymmetricKey( + hAlgorithm: BCRYPT_ALG_HANDLE, + phKey: *mut BCRYPT_KEY_HANDLE, + pbKeyObject: PUCHAR, + cbKeyObject: ULONG, + pbSecret: PUCHAR, + cbSecret: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptGenerateKeyPair( + hAlgorithm: BCRYPT_ALG_HANDLE, + phKey: *mut BCRYPT_KEY_HANDLE, + dwLength: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptEncrypt( + hKey: BCRYPT_KEY_HANDLE, + pbInput: PUCHAR, + cbInput: ULONG, + pPaddingInfo: *mut VOID, + pbIV: PUCHAR, + cbIV: ULONG, + pbOutput: PUCHAR, + cbOutput: ULONG, + pcbResult: *mut ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptDecrypt( + hKey: BCRYPT_KEY_HANDLE, + pbInput: PUCHAR, + cbInput: ULONG, + pPaddingInfo: *mut VOID, + pbIV: PUCHAR, + cbIV: ULONG, + pbOutput: PUCHAR, + cbOutput: ULONG, + pcbResult: *mut ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptExportKey( + hKey: BCRYPT_KEY_HANDLE, + hExportKey: BCRYPT_KEY_HANDLE, + pszBlobType: LPCWSTR, + pbOutput: PUCHAR, + cbOutput: ULONG, + pcbResult: *mut ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptImportKey( + hAlgorithm: BCRYPT_ALG_HANDLE, + hImportKey: BCRYPT_KEY_HANDLE, + pszBlobType: LPCWSTR, + phKey: *mut BCRYPT_KEY_HANDLE, + pbKeyObject: PUCHAR, + cbKeyObject: ULONG, + pbInput: PUCHAR, + cbInput: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; +} +pub const BCRYPT_NO_KEY_VALIDATION: ULONG = 0x00000008; +extern "system" { + pub fn BCryptImportKeyPair( + hAlgorithm: BCRYPT_ALG_HANDLE, + hImportKey: BCRYPT_KEY_HANDLE, + pszBlobType: LPCWSTR, + phKey: *mut BCRYPT_KEY_HANDLE, + pbInput: PUCHAR, + cbInput: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptDuplicateKey( + hKey: BCRYPT_KEY_HANDLE, + phNewKey: *mut BCRYPT_KEY_HANDLE, + pbKeyObject: PUCHAR, + cbKeyObject: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptFinalizeKeyPair( + hKey: BCRYPT_KEY_HANDLE, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptDestroyKey( + hKey: BCRYPT_KEY_HANDLE, + ) -> NTSTATUS; + pub fn BCryptDestroySecret( + hSecret: BCRYPT_SECRET_HANDLE, + ) -> NTSTATUS; + pub fn BCryptSignHash( + hKey: BCRYPT_KEY_HANDLE, + pPaddingInfo: *mut VOID, + pbInput: PUCHAR, + cbInput: ULONG, + pbOutput: PUCHAR, + cbOutput: ULONG, + pcbResult: *mut ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptVerifySignature( + hKey: BCRYPT_KEY_HANDLE, + pPaddingInfo: *mut VOID, + pbHash: PUCHAR, + cbHash: ULONG, + pbSignature: PUCHAR, + cbSignature: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptSecretAgreement( + hPrivKey: BCRYPT_KEY_HANDLE, + hPubKey: BCRYPT_KEY_HANDLE, + phAgreedSecret: *mut BCRYPT_SECRET_HANDLE, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptDeriveKey( + hSharedSecret: BCRYPT_SECRET_HANDLE, + pwszKDF: LPCWSTR, + pParameterList: *mut BCryptBufferDesc, + pbDerivedKey: PUCHAR, + cbDerivedKey: ULONG, + pcbResult: *mut ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptKeyDerivation( + hKey: BCRYPT_KEY_HANDLE, + pParameterList: *mut BCryptBufferDesc, + pbDerivedKey: PUCHAR, + cbDerivedKey: ULONG, + pcbResult: *mut ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptCreateHash( + hAlgorithm: BCRYPT_ALG_HANDLE, + phHash: *mut BCRYPT_HASH_HANDLE, + pbHashObject: PUCHAR, + cbHashObject: ULONG, + pbSecret: PUCHAR, + cbSecret: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptHashData( + hHash: BCRYPT_HASH_HANDLE, + pbInput: PUCHAR, + cbInput: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptFinishHash( + hHash: BCRYPT_HASH_HANDLE, + pbOutput: PUCHAR, + cbOutput: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptCreateMultiHash( + hAlgorithm: BCRYPT_ALG_HANDLE, + phHash: *mut BCRYPT_HASH_HANDLE, + nHashes: ULONG, + pbHashObject: PUCHAR, + cbHashObject: ULONG, + pbSecret: PUCHAR, + cbSecret: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptProcessMultiOperations( + hObject: BCRYPT_HANDLE, + operationType: BCRYPT_MULTI_OPERATION_TYPE, + pOperations: PVOID, + cbOperations: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptDuplicateHash( + hHash: BCRYPT_HASH_HANDLE, + phNewHash: *mut BCRYPT_HASH_HANDLE, + pbHashObject: PUCHAR, + cbHashObject: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptDestroyHash( + hHash: BCRYPT_HASH_HANDLE, + ) -> NTSTATUS; + pub fn BCryptHash( + hAlgorithm: BCRYPT_ALG_HANDLE, + pbSecret: PUCHAR, + cbSecret: ULONG, + pbInput: PUCHAR, + cbInput: ULONG, + pbOutput: PUCHAR, + cbOutput: ULONG, + ) -> NTSTATUS; +} +pub const BCRYPT_RNG_USE_ENTROPY_IN_BUFFER: ULONG = 0x00000001; +pub const BCRYPT_USE_SYSTEM_PREFERRED_RNG: ULONG = 0x00000002; +extern "system" { + pub fn BCryptGenRandom( + hAlgorithm: BCRYPT_ALG_HANDLE, + pbBuffer: PUCHAR, + cbBuffer: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptDeriveKeyCapi( + hHash: BCRYPT_HASH_HANDLE, + hTargetAlg: BCRYPT_ALG_HANDLE, + pbDerivedKey: PUCHAR, + cbDerivedKey: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; + pub fn BCryptDeriveKeyPBKDF2( + hPrf: BCRYPT_ALG_HANDLE, + pbPassword: PUCHAR, + cbPassword: ULONG, + pbSalt: PUCHAR, + cbSalt: ULONG, + cIterations: ULONGLONG, + pbDerivedKey: PUCHAR, + cbDerivedKey: ULONG, + dwFlags: ULONG, + ) -> NTSTATUS; +} +STRUCT!{struct BCRYPT_INTERFACE_VERSION { + MajorVersion: USHORT, + MinorVersion: USHORT, +}} +pub type PBCRYPT_INTERFACE_VERSION = *mut BCRYPT_INTERFACE_VERSION; +#[inline] +pub fn BCRYPT_IS_INTERFACE_VERSION_COMPATIBLE( + loader: BCRYPT_INTERFACE_VERSION, + provider: BCRYPT_INTERFACE_VERSION, +) -> bool { + loader.MajorVersion <= provider.MajorVersion +} +pub const BCRYPT_CIPHER_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION = + BCRYPT_MAKE_INTERFACE_VERSION!(1, 0); +pub const BCRYPT_HASH_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION = + BCRYPT_MAKE_INTERFACE_VERSION!(1, 0); +pub const BCRYPT_HASH_INTERFACE_MAJORVERSION_2: USHORT = 2; +pub const BCRYPT_HASH_INTERFACE_VERSION_2: BCRYPT_INTERFACE_VERSION = + BCRYPT_MAKE_INTERFACE_VERSION!(BCRYPT_HASH_INTERFACE_MAJORVERSION_2, 0); +pub const BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION = + BCRYPT_MAKE_INTERFACE_VERSION!(1, 0); +pub const BCRYPT_SECRET_AGREEMENT_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION = + BCRYPT_MAKE_INTERFACE_VERSION!(1, 0); +pub const BCRYPT_SIGNATURE_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION = + BCRYPT_MAKE_INTERFACE_VERSION!(1, 0); +pub const BCRYPT_RNG_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION = + BCRYPT_MAKE_INTERFACE_VERSION!(1, 0); +pub const CRYPT_MIN_DEPENDENCIES: ULONG = 0x00000001; +pub const CRYPT_PROCESS_ISOLATE: ULONG = 0x00010000; +pub const CRYPT_UM: ULONG = 0x00000001; +pub const CRYPT_KM: ULONG = 0x00000002; +pub const CRYPT_MM: ULONG = 0x00000003; +pub const CRYPT_ANY: ULONG = 0x00000004; +pub const CRYPT_OVERWRITE: ULONG = 0x00000001; +pub const CRYPT_LOCAL: ULONG = 0x00000001; +pub const CRYPT_DOMAIN: ULONG = 0x00000002; +pub const CRYPT_EXCLUSIVE: ULONG = 0x00000001; +pub const CRYPT_OVERRIDE: ULONG = 0x00010000; +pub const CRYPT_ALL_FUNCTIONS: ULONG = 0x00000001; +pub const CRYPT_ALL_PROVIDERS: ULONG = 0x00000002; +pub const CRYPT_PRIORITY_TOP: ULONG = 0x00000000; +pub const CRYPT_PRIORITY_BOTTOM: ULONG = 0xFFFFFFFF; +pub const CRYPT_DEFAULT_CONTEXT: &'static str = "Default"; +STRUCT!{struct CRYPT_INTERFACE_REG { + dwInterface: ULONG, + dwFlags: ULONG, + cFunctions: ULONG, + rgpszFunctions: *mut PWSTR, +}} +pub type PCRYPT_INTERFACE_REG = *mut CRYPT_INTERFACE_REG; +STRUCT!{struct CRYPT_IMAGE_REG { + pszImage: PWSTR, + cInterfaces: ULONG, + rgpInterfaces: *mut PCRYPT_INTERFACE_REG, +}} +pub type PCRYPT_IMAGE_REG = *mut CRYPT_IMAGE_REG; +STRUCT!{struct CRYPT_PROVIDER_REG { + cAliases: ULONG, + rgpszAliases: *mut PWSTR, + pUM: PCRYPT_IMAGE_REG, + pKM: PCRYPT_IMAGE_REG, +}} +pub type PCRYPT_PROVIDER_REG = *mut CRYPT_PROVIDER_REG; +STRUCT!{struct CRYPT_PROVIDERS { + cProviders: ULONG, + rgpszProviders: *mut PWSTR, +}} +pub type PCRYPT_PROVIDERS = *mut CRYPT_PROVIDERS; +STRUCT!{struct CRYPT_CONTEXT_CONFIG { + dwFlags: ULONG, + dwReserved: ULONG, +}} +pub type PCRYPT_CONTEXT_CONFIG = *mut CRYPT_CONTEXT_CONFIG; +STRUCT!{struct CRYPT_CONTEXT_FUNCTION_CONFIG { + dwFlags: ULONG, + dwReserved: ULONG, +}} +pub type PCRYPT_CONTEXT_FUNCTION_CONFIG = *mut CRYPT_CONTEXT_FUNCTION_CONFIG; +STRUCT!{struct CRYPT_CONTEXTS { + cContexts: ULONG, + rgpszContexts: *mut PWSTR, +}} +pub type PCRYPT_CONTEXTS = *mut CRYPT_CONTEXTS; +STRUCT!{struct CRYPT_CONTEXT_FUNCTIONS { + cFunctions: ULONG, + rgpszFunctions: *mut PWSTR, +}} +pub type PCRYPT_CONTEXT_FUNCTIONS = *mut CRYPT_CONTEXT_FUNCTIONS; +STRUCT!{struct CRYPT_CONTEXT_FUNCTION_PROVIDERS { + cProviders: ULONG, + rgpszProviders: *mut PWSTR, +}} +pub type PCRYPT_CONTEXT_FUNCTION_PROVIDERS = *mut CRYPT_CONTEXT_FUNCTION_PROVIDERS; +STRUCT!{struct CRYPT_PROPERTY_REF { + pszProperty: PWSTR, + cbValue: ULONG, + pbValue: PUCHAR, +}} +pub type PCRYPT_PROPERTY_REF = *mut CRYPT_PROPERTY_REF; +STRUCT!{struct CRYPT_IMAGE_REF { + pszImage: PWSTR, + dwFlags: ULONG, +}} +pub type PCRYPT_IMAGE_REF = *mut CRYPT_IMAGE_REF; +STRUCT!{struct CRYPT_PROVIDER_REF { + dwInterface: ULONG, + pszFunction: PWSTR, + pszProvider: PWSTR, + cProperties: ULONG, + rgpProperties: *mut PCRYPT_PROPERTY_REF, + pUM: PCRYPT_IMAGE_REF, + pKM: PCRYPT_IMAGE_REF, +}} +pub type PCRYPT_PROVIDER_REF = *mut CRYPT_PROVIDER_REF; +STRUCT!{struct CRYPT_PROVIDER_REFS { + cProviders: ULONG, + rgpProviders: *mut PCRYPT_PROVIDER_REF, +}} +pub type PCRYPT_PROVIDER_REFS = *mut CRYPT_PROVIDER_REFS; +extern "system" { + pub fn BCryptQueryProviderRegistration( + pszProvider: LPCWSTR, + dwMode: ULONG, + dwInterface: ULONG, + pcbBuffer: *mut ULONG, + ppBuffer: *mut PCRYPT_PROVIDER_REG, + ) -> NTSTATUS; + pub fn BCryptEnumRegisteredProviders( + pcbBuffer: *mut ULONG, + ppBuffer: *mut PCRYPT_PROVIDERS, + ) -> NTSTATUS; + pub fn BCryptCreateContext( + dwTable: ULONG, + pszContext: LPCWSTR, + pConfig: PCRYPT_CONTEXT_CONFIG, + ) -> NTSTATUS; + pub fn BCryptDeleteContext( + dwTable: ULONG, + pszContext: LPCWSTR, + ) -> NTSTATUS; + pub fn BCryptEnumContexts( + dwTable: ULONG, + pcbBuffer: *mut ULONG, + ppBuffer: *mut PCRYPT_CONTEXTS, + ) -> NTSTATUS; + pub fn BCryptConfigureContext( + dwTable: ULONG, + pszContext: LPCWSTR, + pConfig: PCRYPT_CONTEXT_CONFIG, + ) -> NTSTATUS; + pub fn BCryptQueryContextConfiguration( + dwTable: ULONG, + pszContext: LPCWSTR, + pcbBuffer: *mut ULONG, + ppBuffer: *mut PCRYPT_CONTEXT_CONFIG, + ) -> NTSTATUS; + pub fn BCryptAddContextFunction( + dwTable: ULONG, + pszContext: LPCWSTR, + dwInterface: ULONG, + pszFunction: LPCWSTR, + dwPosition: ULONG, + ) -> NTSTATUS; + pub fn BCryptRemoveContextFunction( + dwTable: ULONG, + pszContext: LPCWSTR, + dwInterface: ULONG, + pszFunction: LPCWSTR, + ) -> NTSTATUS; + pub fn BCryptEnumContextFunctions( + dwTable: ULONG, + pszContext: LPCWSTR, + dwInterface: ULONG, + pcbBuffer: *mut ULONG, + ppBuffer: *mut PCRYPT_CONTEXT_FUNCTIONS, + ) -> NTSTATUS; + pub fn BCryptConfigureContextFunction( + dwTable: ULONG, + pszContext: LPCWSTR, + dwInterface: ULONG, + pszFunction: LPCWSTR, + pConfig: PCRYPT_CONTEXT_FUNCTION_CONFIG, + ) -> NTSTATUS; + pub fn BCryptQueryContextFunctionConfiguration( + dwTable: ULONG, + pszContext: LPCWSTR, + dwInterface: ULONG, + pszFunction: LPCWSTR, + pcbBuffer: *mut ULONG, + ppBuffer: *mut PCRYPT_CONTEXT_FUNCTION_CONFIG, + ) -> NTSTATUS; + pub fn BCryptEnumContextFunctionProviders( + dwTable: ULONG, + pszContext: LPCWSTR, + dwInterface: ULONG, + pszFunction: LPCWSTR, + pcbBuffer: *mut ULONG, + ppBuffer: *mut PCRYPT_CONTEXT_FUNCTION_PROVIDERS, + ) -> NTSTATUS; + pub fn BCryptSetContextFunctionProperty( + dwTable: ULONG, + pszContext: LPCWSTR, + dwInterface: ULONG, + pszFunction: LPCWSTR, + pszProperty: LPCWSTR, + cbValue: ULONG, + pbValue: PUCHAR, + ) -> NTSTATUS; + pub fn BCryptQueryContextFunctionProperty( + dwTable: ULONG, + pszContext: LPCWSTR, + dwInterface: ULONG, + pszFunction: LPCWSTR, + pszProperty: LPCWSTR, + pcbValue: *mut ULONG, + ppbValue: *mut PUCHAR, + ) -> NTSTATUS; + pub fn BCryptRegisterConfigChangeNotify( + phEvent: *mut HANDLE, + ) -> NTSTATUS; + pub fn BCryptUnregisterConfigChangeNotify( + hEvent: HANDLE, + ) -> NTSTATUS; + pub fn BCryptResolveProviders( + pszContext: LPCWSTR, + dwInterface: ULONG, + pszFunction: LPCWSTR, + pszProvider: LPCWSTR, + dwMode: ULONG, + dwFlags: ULONG, + pcbBuffer: *mut ULONG, + ppBuffer: *mut PCRYPT_PROVIDER_REFS, + ) -> NTSTATUS; + pub fn BCryptGetFipsAlgorithmMode( + pfEnabled: *mut BOOLEAN, + ) -> NTSTATUS; + pub fn CngGetFipsAlgorithmMode() -> BOOLEAN; +} diff --git a/bash-5.1/vendor/winapi/src/shared/bthdef.rs b/bash-5.1/vendor/winapi/src/shared/bthdef.rs new file mode 100644 index 0000000000000000000000000000000000000000..42a797cb6ab257233d8d75ab404c49f4c5c34ae9 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/bthdef.rs @@ -0,0 +1,1103 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::bthsdpdef::SDP_ERROR; +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, UCHAR, ULONG, USHORT}; +use shared::ntdef::{CHAR, ULONGLONG}; +pub const BTH_MAJORVERSION: DWORD = 2; +pub const BTH_MINORVERSION: DWORD = 1; +DEFINE_GUID!{GUID_BTHPORT_DEVICE_INTERFACE, + 0x850302a, 0xb344, 0x4fda, 0x9b, 0xe9, 0x90, 0x57, 0x6b, 0x8d, 0x46, 0xf0} +DEFINE_GUID!{GUID_BTH_RFCOMM_SERVICE_DEVICE_INTERFACE, + 0xb142fc3e, 0xfa4e, 0x460b, 0x8a, 0xbc, 0x07, 0x2b, 0x62, 0x8b, 0x3c, 0x70} +DEFINE_GUID!{GUID_BLUETOOTH_RADIO_IN_RANGE, + 0xea3b5b82, 0x26ee, 0x450e, 0xb0, 0xd8, 0xd2, 0x6f, 0xe3, 0x0a, 0x38, 0x69} +DEFINE_GUID!{GUID_BLUETOOTH_RADIO_OUT_OF_RANGE, + 0xe28867c9, 0xc2aa, 0x4ced, 0xb9, 0x69, 0x45, 0x70, 0x86, 0x60, 0x37, 0xc4} +DEFINE_GUID!{GUID_BLUETOOTH_L2CAP_EVENT, + 0x7eae4030, 0xb709, 0x4aa8, 0xac, 0x55, 0xe9, 0x53, 0x82, 0x9c, 0x9d, 0xaa} +DEFINE_GUID!{GUID_BLUETOOTH_HCI_EVENT, + 0xfc240062, 0x1541, 0x49be, 0xb4, 0x63, 0x84, 0xc4, 0xdc, 0xd7, 0xbf, 0x7f} +DEFINE_GUID!{GUID_BLUETOOTH_AUTHENTICATION_REQUEST, + 0x5DC9136D, 0x996C, 0x46DB, 0x84, 0xF5, 0x32, 0xC0, 0xA3, 0xF4, 0x73, 0x52} +DEFINE_GUID!{GUID_BLUETOOTH_KEYPRESS_EVENT, + 0xD668DFCD, 0x0F4E, 0x4EFC, 0xBF, 0xE0, 0x39, 0x2E, 0xEE, 0xC5, 0x10, 0x9C} +DEFINE_GUID!{GUID_BLUETOOTH_HCI_VENDOR_EVENT, + 0x547247e6, 0x45bb, 0x4c33, 0xaf, 0x8c, 0xc0, 0x0e, 0xfe, 0x15, 0xa7, 0x1d} +DEFINE_GUID!{Bluetooth_Base_UUID, + 0x00000000, 0x0000, 0x1000, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB} +pub const SDP_PROTOCOL_UUID16: USHORT = 0x0001; +pub const UDP_PROTOCOL_UUID16: USHORT = 0x0002; +pub const RFCOMM_PROTOCOL_UUID16: USHORT = 0x0003; +pub const TCP_PROTOCOL_UUID16: USHORT = 0x0004; +pub const TCSBIN_PROTOCOL_UUID16: USHORT = 0x0005; +pub const TCSAT_PROTOCOL_UUID16: USHORT = 0x0006; +pub const ATT_PROTOCOL_UUID16: USHORT = 0x0007; +pub const OBEX_PROTOCOL_UUID16: USHORT = 0x0008; +pub const IP_PROTOCOL_UUID16: USHORT = 0x0009; +pub const FTP_PROTOCOL_UUID16: USHORT = 0x000A; +pub const HTTP_PROTOCOL_UUID16: USHORT = 0x000C; +pub const WSP_PROTOCOL_UUID16: USHORT = 0x000E; +pub const BNEP_PROTOCOL_UUID16: USHORT = 0x000F; +pub const UPNP_PROTOCOL_UUID16: USHORT = 0x0010; +pub const HID_PROTOCOL_UUID16: USHORT = 0x0011; +pub const HCCC_PROTOCOL_UUID16: USHORT = 0x0012; +pub const HCDC_PROTOCOL_UUID16: USHORT = 0x0014; +pub const HCN_PROTOCOL_UUID16: USHORT = 0x0016; +pub const AVCTP_PROTOCOL_UUID16: USHORT = 0x0017; +pub const AVDTP_PROTOCOL_UUID16: USHORT = 0x0019; +pub const CMPT_PROTOCOL_UUID16: USHORT = 0x001B; +pub const UDI_C_PLANE_PROTOCOL_UUID16: USHORT = 0x001D; +pub const L2CAP_PROTOCOL_UUID16: USHORT = 0x0100; +DEFINE_BLUETOOTH_UUID128!{SDP_PROTOCOL_UUID, SDP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{UDP_PROTOCOL_UUID, UDP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{RFCOMM_PROTOCOL_UUID, RFCOMM_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{TCP_PROTOCOL_UUID, TCP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{TCSBIN_PROTOCOL_UUID, TCSBIN_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{TCSAT_PROTOCOL_UUID, TCSAT_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{ATT_PROTOCOL_UUID, ATT_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{OBEX_PROTOCOL_UUID, OBEX_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{IP_PROTOCOL_UUID, IP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{FTP_PROTOCOL_UUID, FTP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{HTTP_PROTOCOL_UUID, HTTP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{WSP_PROTOCOL_UUID, WSP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{BNEP_PROTOCOL_UUID, BNEP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{UPNP_PROTOCOL_UUID, UPNP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{HID_PROTOCOL_UUID, HID_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{HCCC_PROTOCOL_UUID, HCCC_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{HCDC_PROTOCOL_UUID, HCDC_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{HCN_PROTOCOL_UUID, HCN_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{AVCTP_PROTOCOL_UUID, AVCTP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{AVDTP_PROTOCOL_UUID, AVDTP_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{CMPT_PROTOCOL_UUID, CMPT_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{UDI_C_PLANE_PROTOCOL_UUID, UDI_C_PLANE_PROTOCOL_UUID16} +DEFINE_BLUETOOTH_UUID128!{L2CAP_PROTOCOL_UUID, L2CAP_PROTOCOL_UUID16} +pub const ServiceDiscoveryServerServiceClassID_UUID16: USHORT = 0x1000; +pub const BrowseGroupDescriptorServiceClassID_UUID16: USHORT = 0x1001; +pub const PublicBrowseGroupServiceClassID_UUID16: USHORT = 0x1002; +pub const SerialPortServiceClassID_UUID16: USHORT = 0x1101; +pub const LANAccessUsingPPPServiceClassID_UUID16: USHORT = 0x1102; +pub const DialupNetworkingServiceClassID_UUID16: USHORT = 0x1103; +pub const IrMCSyncServiceClassID_UUID16: USHORT = 0x1104; +pub const OBEXObjectPushServiceClassID_UUID16: USHORT = 0x1105; +pub const OBEXFileTransferServiceClassID_UUID16: USHORT = 0x1106; +pub const IrMcSyncCommandServiceClassID_UUID16: USHORT = 0x1107; +pub const HeadsetServiceClassID_UUID16: USHORT = 0x1108; +pub const CordlessTelephonyServiceClassID_UUID16: USHORT = 0x1109; +pub const AudioSourceServiceClassID_UUID16: USHORT = 0x110A; +pub const AudioSinkServiceClassID_UUID16: USHORT = 0x110B; +pub const AVRemoteControlTargetServiceClassID_UUID16: USHORT = 0x110C; +pub const AVRemoteControlServiceClassID_UUID16: USHORT = 0x110E; +pub const AVRemoteControlControllerServiceClass_UUID16: USHORT = 0x110F; +pub const IntercomServiceClassID_UUID16: USHORT = 0x1110; +pub const FaxServiceClassID_UUID16: USHORT = 0x1111; +pub const HeadsetAudioGatewayServiceClassID_UUID16: USHORT = 0x1112; +pub const WAPServiceClassID_UUID16: USHORT = 0x1113; +pub const WAPClientServiceClassID_UUID16: USHORT = 0x1114; +pub const PANUServiceClassID_UUID16: USHORT = 0x1115; +pub const NAPServiceClassID_UUID16: USHORT = 0x1116; +pub const GNServiceClassID_UUID16: USHORT = 0x1117; +pub const DirectPrintingServiceClassID_UUID16: USHORT = 0x1118; +pub const ReferencePrintingServiceClassID_UUID16: USHORT = 0x1119; +pub const ImagingResponderServiceClassID_UUID16: USHORT = 0x111B; +pub const ImagingAutomaticArchiveServiceClassID_UUID16: USHORT = 0x111C; +pub const ImagingReferenceObjectsServiceClassID_UUID16: USHORT = 0x111D; +pub const HandsfreeServiceClassID_UUID16: USHORT = 0x111E; +pub const HandsfreeAudioGatewayServiceClassID_UUID16: USHORT = 0x111F; +pub const DirectPrintingReferenceObjectsServiceClassID_UUID16: USHORT = 0x1120; +pub const ReflectsUIServiceClassID_UUID16: USHORT = 0x1121; +pub const PrintingStatusServiceClassID_UUID16: USHORT = 0x1123; +pub const HumanInterfaceDeviceServiceClassID_UUID16: USHORT = 0x1124; +pub const HCRPrintServiceClassID_UUID16: USHORT = 0x1126; +pub const HCRScanServiceClassID_UUID16: USHORT = 0x1127; +pub const CommonISDNAccessServiceClassID_UUID16: USHORT = 0x1128; +pub const VideoConferencingGWServiceClassID_UUID16: USHORT = 0x1129; +pub const UDIMTServiceClassID_UUID16: USHORT = 0x112A; +pub const UDITAServiceClassID_UUID16: USHORT = 0x112B; +pub const AudioVideoServiceClassID_UUID16: USHORT = 0x112C; +pub const SimAccessServiceClassID_UUID16: USHORT = 0x112D; +pub const PhonebookAccessPceServiceClassID_UUID16: USHORT = 0x112E; +pub const PhonebookAccessPseServiceClassID_UUID16: USHORT = 0x112F; +pub const HeadsetHSServiceClassID_UUID16: USHORT = 0x1131; +pub const MessageAccessServerServiceClassID_UUID16: USHORT = 0x1132; +pub const MessageNotificationServerServiceClassID_UUID16: USHORT = 0x1133; +pub const GNSSServerServiceClassID_UUID16: USHORT = 0x1136; +pub const ThreeDimensionalDisplayServiceClassID_UUID16: USHORT = 0x1137; +pub const ThreeDimensionalGlassesServiceClassID_UUID16: USHORT = 0x1138; +pub const MPSServiceClassID_UUID16: USHORT = 0x113B; +pub const CTNAccessServiceClassID_UUID16: USHORT = 0x113C; +pub const CTNNotificationServiceClassID_UUID16: USHORT = 0x113D; +pub const PnPInformationServiceClassID_UUID16: USHORT = 0x1200; +pub const GenericNetworkingServiceClassID_UUID16: USHORT = 0x1201; +pub const GenericFileTransferServiceClassID_UUID16: USHORT = 0x1202; +pub const GenericAudioServiceClassID_UUID16: USHORT = 0x1203; +pub const GenericTelephonyServiceClassID_UUID16: USHORT = 0x1204; +pub const UPnpServiceClassID_UUID16: USHORT = 0x1205; +pub const UPnpIpServiceClassID_UUID16: USHORT = 0x1206; +pub const ESdpUpnpIpPanServiceClassID_UUID16: USHORT = 0x1300; +pub const ESdpUpnpIpLapServiceClassID_UUID16: USHORT = 0x1301; +pub const ESdpUpnpL2capServiceClassID_UUID16: USHORT = 0x1302; +pub const VideoSourceServiceClassID_UUID16: USHORT = 0x1303; +pub const VideoSinkServiceClassID_UUID16: USHORT = 0x1304; +pub const HealthDeviceProfileSourceServiceClassID_UUID16: USHORT = 0x1401; +pub const HealthDeviceProfileSinkServiceClassID_UUID16: USHORT = 0x1402; +DEFINE_BLUETOOTH_UUID128!{ServiceDiscoveryServerServiceClassID_UUID, + ServiceDiscoveryServerServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{BrowseGroupDescriptorServiceClassID_UUID, + BrowseGroupDescriptorServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{PublicBrowseGroupServiceClass_UUID, + PublicBrowseGroupServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{SerialPortServiceClass_UUID, + SerialPortServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{LANAccessUsingPPPServiceClass_UUID, + LANAccessUsingPPPServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{DialupNetworkingServiceClass_UUID, + DialupNetworkingServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{IrMCSyncServiceClass_UUID, + IrMCSyncServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{OBEXObjectPushServiceClass_UUID, + OBEXObjectPushServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{OBEXFileTransferServiceClass_UUID, + OBEXFileTransferServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{IrMCSyncCommandServiceClass_UUID, + IrMcSyncCommandServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HeadsetServiceClass_UUID, + HeadsetServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{CordlessTelephonyServiceClass_UUID, + CordlessTelephonyServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{AudioSourceServiceClass_UUID, + AudioSourceServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{AudioSinkServiceClass_UUID, + AudioSinkServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{AVRemoteControlTargetServiceClass_UUID, + AVRemoteControlTargetServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{AVRemoteControlServiceClass_UUID, + AVRemoteControlServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{AVRemoteControlControllerServiceClass_UUID, + AVRemoteControlControllerServiceClass_UUID16} +DEFINE_BLUETOOTH_UUID128!{IntercomServiceClass_UUID, + IntercomServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{FaxServiceClass_UUID, + FaxServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HeadsetAudioGatewayServiceClass_UUID, + HeadsetAudioGatewayServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{WAPServiceClass_UUID, + WAPServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{WAPClientServiceClass_UUID, + WAPClientServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{PANUServiceClass_UUID, + PANUServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{NAPServiceClass_UUID, + NAPServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{GNServiceClass_UUID, + GNServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{DirectPrintingServiceClass_UUID, + DirectPrintingServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ReferencePrintingServiceClass_UUID, + ReferencePrintingServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ImagingResponderServiceClass_UUID, + ImagingResponderServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ImagingAutomaticArchiveServiceClass_UUID, + ImagingAutomaticArchiveServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ImagingReferenceObjectsServiceClass_UUID, + ImagingReferenceObjectsServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HandsfreeServiceClass_UUID, + HandsfreeServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HandsfreeAudioGatewayServiceClass_UUID, + HandsfreeAudioGatewayServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{DirectPrintingReferenceObjectsServiceClass_UUID, + DirectPrintingReferenceObjectsServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ReflectedUIServiceClass_UUID, + ReflectsUIServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{PrintingStatusServiceClass_UUID, + PrintingStatusServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HumanInterfaceDeviceServiceClass_UUID, + HumanInterfaceDeviceServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HCRPrintServiceClass_UUID, + HCRPrintServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HCRScanServiceClass_UUID, + HCRScanServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{CommonISDNAccessServiceClass_UUID, + CommonISDNAccessServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{VideoConferencingGWServiceClass_UUID, + VideoConferencingGWServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{UDIMTServiceClass_UUID, + UDIMTServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{UDITAServiceClass_UUID, + UDITAServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{AudioVideoServiceClass_UUID, + AudioVideoServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{SimAccessServiceClass_UUID, + SimAccessServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{PhonebookAccessPceServiceClass_UUID, + PhonebookAccessPceServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{PhonebookAccessPseServiceClass_UUID, + PhonebookAccessPseServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HeadsetHSServiceClass_UUID, + HeadsetHSServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{MessageAccessServerServiceClass_UUID, + MessageAccessServerServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{MessageNotificationServerServiceClass_UUID, + MessageNotificationServerServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{GNSSServerServiceClass_UUID, + GNSSServerServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ThreeDimensionalDisplayServiceClass_UUID, + ThreeDimensionalDisplayServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ThreeDimensionalGlassesServiceClass_UUID, + ThreeDimensionalGlassesServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{MPSServiceClass_UUID, + MPSServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{CTNAccessServiceClass_UUID, + CTNAccessServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{CTNNotificationServiceClass_UUID, + CTNNotificationServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{PnPInformationServiceClass_UUID, + PnPInformationServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{GenericNetworkingServiceClass_UUID, + GenericNetworkingServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{GenericFileTransferServiceClass_UUID, + GenericFileTransferServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{GenericAudioServiceClass_UUID, + GenericAudioServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{GenericTelephonyServiceClass_UUID, + GenericTelephonyServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{UPnpServiceClass_UUID, + UPnpServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{UPnpIpServiceClass_UUID, + UPnpIpServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ESdpUpnpIpPanServiceClass_UUID, + ESdpUpnpIpPanServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ESdpUpnpIpLapServiceClass_UUID, + ESdpUpnpIpLapServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ESdpUpnpL2capServiceClass_UUID, + ESdpUpnpL2capServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{VideoSourceServiceClass_UUID, + VideoSourceServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{VideoSinkServiceClass_UUID, + VideoSinkServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HealthDeviceProfileSourceServiceClass_UUID, + HealthDeviceProfileSourceServiceClassID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HealthDeviceProfileSinkServiceClass_UUID, + HealthDeviceProfileSinkServiceClassID_UUID16} +pub const AdvancedAudioDistributionProfileID_UUID16: USHORT = 0x110D; +pub const ImagingServiceProfileID_UUID16: USHORT = 0x111A; +pub const BasicPrintingProfileID_UUID16: USHORT = 0x1122; +pub const HardcopyCableReplacementProfileID_UUID16: USHORT = 0x1125; +pub const PhonebookAccessProfileID_UUID16: USHORT = 0x1130; +pub const MessageAccessProfileID_UUID16: USHORT = 0x1134; +pub const GNSSProfileID_UUID16: USHORT = 0x1135; +pub const ThreeDimensionalSynchronizationProfileID_UUID16: USHORT = 0x1139; +pub const MPSProfileID_UUID16: USHORT = 0x113A; +pub const CTNProfileID_UUID16: USHORT = 0x113E; +pub const VideoDistributionProfileID_UUID16: USHORT = 0x1305; +pub const HealthDeviceProfileID_UUID16: USHORT = 0x1400; +DEFINE_BLUETOOTH_UUID128!{AdvancedAudioDistributionProfile_UUID, + AdvancedAudioDistributionProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ImagingServiceProfile_UUID, + ImagingServiceProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{BasicPrintingProfile_UUID, + BasicPrintingProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HardcopyCableReplacementProfile_UUID, + HardcopyCableReplacementProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{PhonebookAccessProfile_UUID, + PhonebookAccessProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{MessageAccessProfile_UUID, + MessageAccessProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{GNSSProfile_UUID, + GNSSProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{ThreeDimensionalSynchronizationProfile_UUID, + ThreeDimensionalSynchronizationProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{MPSProfile_UUID, + MPSProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{CTNProfile_UUID, + CTNProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{VideoDistributionProfile_UUID, + VideoDistributionProfileID_UUID16} +DEFINE_BLUETOOTH_UUID128!{HealthDeviceProfile_UUID, + HealthDeviceProfileID_UUID16} +pub const VideoConferencingServiceClass_UUID: GUID = AVRemoteControlControllerServiceClass_UUID; +pub const VideoConferencingServiceClassID_UUID16: USHORT + = AVRemoteControlControllerServiceClass_UUID16; +pub const HN_PROTOCOL_UUID: GUID = HCN_PROTOCOL_UUID; +pub const BasicPringingServiceClass_UUID: GUID = BasicPrintingProfile_UUID; +pub const CommonISDNAccessServiceClass_UUID16: USHORT = CommonISDNAccessServiceClassID_UUID16; +pub const VideoConferencingGWServiceClass_UUID16: USHORT + = VideoConferencingGWServiceClassID_UUID16; +pub const UDIMTServiceClass_UUID16: USHORT = UDIMTServiceClassID_UUID16; +pub const UDITAServiceClass_UUID16: USHORT = UDITAServiceClassID_UUID16; +pub const AudioVideoServiceClass_UUID16: USHORT = AudioVideoServiceClassID_UUID16; +pub const CordlessServiceClassID_UUID16: USHORT = CordlessTelephonyServiceClassID_UUID16; +pub const AudioSinkSourceServiceClassID_UUID16: USHORT = AudioSinkServiceClassID_UUID16; +pub const AdvancedAudioDistributionServiceClassID_UUID16: USHORT + = AdvancedAudioDistributionProfileID_UUID16; +pub const ImagingServiceClassID_UUID16: USHORT = ImagingServiceProfileID_UUID16; +pub const BasicPrintingServiceClassID_UUID16: USHORT = BasicPrintingProfileID_UUID16; +pub const HardcopyCableReplacementServiceClassID_UUID16: USHORT + = HardcopyCableReplacementProfileID_UUID16; +pub const AdvancedAudioDistributionServiceClass_UUID: GUID = AdvancedAudioDistributionProfile_UUID; +pub const ImagingServiceClass_UUID: GUID = ImagingServiceProfile_UUID; +pub const BasicPrintingServiceClass_UUID: GUID = BasicPrintingProfile_UUID; +pub const HardcopyCableReplacementServiceClass_UUID: GUID = HardcopyCableReplacementProfile_UUID; +pub const VideoDistributionServiceClass_UUID: GUID = VideoDistributionProfile_UUID; +pub const BTH_MAX_NAME_SIZE: usize = 248; +pub const BTH_MAX_PIN_SIZE: usize = 16; +pub const BTH_LINK_KEY_LENGTH: usize = 16; +pub const BTH_MFG_ERICSSON: u16 = 0; +pub const BTH_MFG_NOKIA: u16 = 1; +pub const BTH_MFG_INTEL: u16 = 2; +pub const BTH_MFG_IBM: u16 = 3; +pub const BTH_MFG_TOSHIBA: u16 = 4; +pub const BTH_MFG_3COM: u16 = 5; +pub const BTH_MFG_MICROSOFT: u16 = 6; +pub const BTH_MFG_LUCENT: u16 = 7; +pub const BTH_MFG_MOTOROLA: u16 = 8; +pub const BTH_MFG_INFINEON: u16 = 9; +pub const BTH_MFG_CSR: u16 = 10; +pub const BTH_MFG_SILICONWAVE: u16 = 11; +pub const BTH_MFG_DIGIANSWER: u16 = 12; +pub const BTH_MFG_TI: u16 = 13; +pub const BTH_MFG_PARTHUS: u16 = 14; +pub const BTH_MFG_BROADCOM: u16 = 15; +pub const BTH_MFG_MITEL: u16 = 16; +pub const BTH_MFG_WIDCOMM: u16 = 17; +pub const BTH_MFG_ZEEVO: u16 = 18; +pub const BTH_MFG_ATMEL: u16 = 19; +pub const BTH_MFG_MITSIBUSHI: u16 = 20; +pub const BTH_MFG_RTX_TELECOM: u16 = 21; +pub const BTH_MFG_KC_TECHNOLOGY: u16 = 22; +pub const BTH_MFG_NEWLOGIC: u16 = 23; +pub const BTH_MFG_TRANSILICA: u16 = 24; +pub const BTH_MFG_ROHDE_SCHWARZ: u16 = 25; +pub const BTH_MFG_TTPCOM: u16 = 26; +pub const BTH_MFG_SIGNIA: u16 = 27; +pub const BTH_MFG_CONEXANT: u16 = 28; +pub const BTH_MFG_QUALCOMM: u16 = 29; +pub const BTH_MFG_INVENTEL: u16 = 30; +pub const BTH_MFG_AVM_BERLIN: u16 = 31; +pub const BTH_MFG_BANDSPEED: u16 = 32; +pub const BTH_MFG_MANSELLA: u16 = 33; +pub const BTH_MFG_NEC: u16 = 34; +pub const BTH_MFG_WAVEPLUS_TECHNOLOGY_CO: u16 = 35; +pub const BTH_MFG_ALCATEL: u16 = 36; +pub const BTH_MFG_PHILIPS_SEMICONDUCTOR: u16 = 37; +pub const BTH_MFG_C_TECHNOLOGIES: u16 = 38; +pub const BTH_MFG_OPEN_INTERFACE: u16 = 39; +pub const BTH_MFG_RF_MICRO_DEVICES: u16 = 40; +pub const BTH_MFG_HITACHI: u16 = 41; +pub const BTH_MFG_SYMBOL_TECHNOLOGIES: u16 = 42; +pub const BTH_MFG_TENOVIS: u16 = 43; +pub const BTH_MFG_MACRONIX_INTERNATIONAL: u16 = 44; +pub const BTH_MFG_APPLE: u16 = 76; +pub const BTH_MFG_NORDIC_SEMICONDUCTORS_ASA: u16 = 89; +pub const BTH_MFG_ARUBA_NETWORKS: u16 = 283; +pub const BTH_MFG_INTERNAL_USE: u16 = 65535; +pub type BTH_ADDR = ULONGLONG; +pub type PBTH_ADDR = *mut ULONGLONG; +pub type BTH_COD = ULONG; +pub type PBTH_COD = *mut ULONG; +pub type BTH_LAP = ULONG; +pub type PBTH_LAP = *mut ULONG; +pub const BTH_ADDR_NULL: BTH_ADDR = 0x0000000000000000; +pub const NAP_MASK: u64 = 0xFFFF00000000; +pub const SAP_MASK: u64 = 0x0000FFFFFFFF; +pub const NAP_BIT_OFFSET: u8 = 8 * 4; +pub const SAP_BIT_OFFSET: u8 = 0; +#[inline] +pub fn GET_NAP(addr: BTH_ADDR) -> u16 { + ((addr & NAP_MASK) >> NAP_BIT_OFFSET) as u16 +} +#[inline] +pub fn GET_SAP(addr: BTH_ADDR) -> u32 { + ((addr & SAP_MASK) >> SAP_BIT_OFFSET) as u32 +} +#[inline] +pub fn SET_NAP(nap: u16) -> BTH_ADDR { + (nap as u64) << NAP_BIT_OFFSET +} +#[inline] +pub fn SET_SAP(sap: u32) -> BTH_ADDR { + (sap as u64) << SAP_BIT_OFFSET +} +#[inline] +pub fn SET_NAP_SAP(nap: u16, sap: u32) -> BTH_ADDR { + SET_NAP(nap) | SET_SAP(sap) +} +pub const COD_FORMAT_BIT_OFFSET: u8 = 0; +pub const COD_MINOR_BIT_OFFSET: u8 = 2; +pub const COD_MAJOR_BIT_OFFSET: u8 = 8 * 1; +pub const COD_SERVICE_BIT_OFFSET: u8 = 8 * 1 + 5; +pub const COD_FORMAT_MASK: u32 = 0x000003; +pub const COD_MINOR_MASK: u32 = 0x0000FC; +pub const COD_MAJOR_MASK: u32 = 0x001F00; +pub const COD_SERVICE_MASK: u32 = 0xFFE000; +#[inline] +pub fn GET_COD_FORMAT(cod: BTH_COD) -> u8 { + ((cod & COD_FORMAT_MASK) >> COD_FORMAT_BIT_OFFSET) as u8 +} +#[inline] +pub fn GET_COD_MINOR(cod: BTH_COD) -> u8 { + ((cod & COD_MINOR_MASK) >> COD_MINOR_BIT_OFFSET) as u8 +} +#[inline] +pub fn GET_COD_MAJOR(cod: BTH_COD) -> u8 { + ((cod & COD_MAJOR_MASK) >> COD_MAJOR_BIT_OFFSET) as u8 +} +#[inline] +pub fn GET_COD_SERVICE(cod: BTH_COD) -> u16 { + ((cod & COD_SERVICE_MASK) >> COD_SERVICE_BIT_OFFSET) as u16 +} +#[inline] +pub fn SET_COD_MINOR(cod: BTH_COD, minor: u8) -> BTH_COD { + (cod & !COD_MINOR_MASK) | ((minor as u32) << COD_MINOR_BIT_OFFSET) +} +#[inline] +pub fn SET_COD_MAJOR(cod: BTH_COD, major: u8) -> BTH_COD { + (cod & !COD_MAJOR_MASK) | ((major as u32) << COD_MAJOR_BIT_OFFSET) +} +#[inline] +pub fn SET_COD_SERVICE(cod: BTH_COD, service: u16) -> BTH_COD { + (cod & !COD_SERVICE_MASK) | ((service as u32) << COD_SERVICE_BIT_OFFSET) +} +pub const COD_VERSION: u32 = 0x0; +pub const COD_SERVICE_LIMITED: u16 = 0x0001; +pub const COD_SERVICE_POSITIONING: u16 = 0x0008; +pub const COD_SERVICE_NETWORKING: u16 = 0x0010; +pub const COD_SERVICE_RENDERING: u16 = 0x0020; +pub const COD_SERVICE_CAPTURING: u16 = 0x0040; +pub const COD_SERVICE_OBJECT_XFER: u16 = 0x0080; +pub const COD_SERVICE_AUDIO: u16 = 0x0100; +pub const COD_SERVICE_TELEPHONY: u16 = 0x0200; +pub const COD_SERVICE_INFORMATION: u16 = 0x0400; +pub const COD_SERVICE_VALID_MASK: u16 = COD_SERVICE_LIMITED | COD_SERVICE_POSITIONING + | COD_SERVICE_NETWORKING | COD_SERVICE_RENDERING | COD_SERVICE_CAPTURING + | COD_SERVICE_OBJECT_XFER | COD_SERVICE_AUDIO | COD_SERVICE_TELEPHONY + | COD_SERVICE_INFORMATION; +pub const COD_SERVICE_MAX_COUNT: usize = 9; +pub const COD_MAJOR_MISCELLANEOUS: u8 = 0x00; +pub const COD_MAJOR_COMPUTER: u8 = 0x01; +pub const COD_MAJOR_PHONE: u8 = 0x02; +pub const COD_MAJOR_LAN_ACCESS: u8 = 0x03; +pub const COD_MAJOR_AUDIO: u8 = 0x04; +pub const COD_MAJOR_PERIPHERAL: u8 = 0x05; +pub const COD_MAJOR_IMAGING: u8 = 0x06; +pub const COD_MAJOR_WEARABLE: u8 = 0x07; +pub const COD_MAJOR_TOY: u8 = 0x08; +pub const COD_MAJOR_HEALTH: u8 = 0x09; +pub const COD_MAJOR_UNCLASSIFIED: u8 = 0x1F; +pub const COD_COMPUTER_MINOR_UNCLASSIFIED: u8 = 0x00; +pub const COD_COMPUTER_MINOR_DESKTOP: u8 = 0x01; +pub const COD_COMPUTER_MINOR_SERVER: u8 = 0x02; +pub const COD_COMPUTER_MINOR_LAPTOP: u8 = 0x03; +pub const COD_COMPUTER_MINOR_HANDHELD: u8 = 0x04; +pub const COD_COMPUTER_MINOR_PALM: u8 = 0x05; +pub const COD_COMPUTER_MINOR_WEARABLE: u8 = 0x06; +pub const COD_PHONE_MINOR_UNCLASSIFIED: u8 = 0x00; +pub const COD_PHONE_MINOR_CELLULAR: u8 = 0x01; +pub const COD_PHONE_MINOR_CORDLESS: u8 = 0x02; +pub const COD_PHONE_MINOR_SMART: u8 = 0x03; +pub const COD_PHONE_MINOR_WIRED_MODEM: u8 = 0x04; +pub const COD_AUDIO_MINOR_UNCLASSIFIED: u8 = 0x00; +pub const COD_AUDIO_MINOR_HEADSET: u8 = 0x01; +pub const COD_AUDIO_MINOR_HANDS_FREE: u8 = 0x02; +pub const COD_AUDIO_MINOR_HEADSET_HANDS_FREE: u8 = 0x03; +pub const COD_AUDIO_MINOR_MICROPHONE: u8 = 0x04; +pub const COD_AUDIO_MINOR_LOUDSPEAKER: u8 = 0x05; +pub const COD_AUDIO_MINOR_HEADPHONES: u8 = 0x06; +pub const COD_AUDIO_MINOR_PORTABLE_AUDIO: u8 = 0x07; +pub const COD_AUDIO_MINOR_CAR_AUDIO: u8 = 0x08; +pub const COD_AUDIO_MINOR_SET_TOP_BOX: u8 = 0x09; +pub const COD_AUDIO_MINOR_HIFI_AUDIO: u8 = 0x0A; +pub const COD_AUDIO_MINOR_VCR: u8 = 0x0B; +pub const COD_AUDIO_MINOR_VIDEO_CAMERA: u8 = 0x0C; +pub const COD_AUDIO_MINOR_CAMCORDER: u8 = 0x0D; +pub const COD_AUDIO_MINOR_VIDEO_MONITOR: u8 = 0x0E; +pub const COD_AUDIO_MINOR_VIDEO_DISPLAY_LOUDSPEAKER: u8 = 0x0F; +pub const COD_AUDIO_MINOR_VIDEO_DISPLAY_CONFERENCING: u8 = 0x10; +pub const COD_AUDIO_MINOR_GAMING_TOY: u8 = 0x12; +pub const COD_PERIPHERAL_MINOR_KEYBOARD_MASK: u8 = 0x10; +pub const COD_PERIPHERAL_MINOR_POINTER_MASK: u8 = 0x20; +pub const COD_PERIPHERAL_MINOR_NO_CATEGORY: u8 = 0x00; +pub const COD_PERIPHERAL_MINOR_JOYSTICK: u8 = 0x01; +pub const COD_PERIPHERAL_MINOR_GAMEPAD: u8 = 0x02; +pub const COD_PERIPHERAL_MINOR_REMOTE_CONTROL: u8 = 0x03; +pub const COD_PERIPHERAL_MINOR_SENSING: u8 = 0x04; +pub const COD_IMAGING_MINOR_DISPLAY_MASK: u8 = 0x04; +pub const COD_IMAGING_MINOR_CAMERA_MASK: u8 = 0x08; +pub const COD_IMAGING_MINOR_SCANNER_MASK: u8 = 0x10; +pub const COD_IMAGING_MINOR_PRINTER_MASK: u8 = 0x20; +pub const COD_WEARABLE_MINOR_WRIST_WATCH: u8 = 0x01; +pub const COD_WEARABLE_MINOR_PAGER: u8 = 0x02; +pub const COD_WEARABLE_MINOR_JACKET: u8 = 0x03; +pub const COD_WEARABLE_MINOR_HELMET: u8 = 0x04; +pub const COD_WEARABLE_MINOR_GLASSES: u8 = 0x05; +pub const COD_TOY_MINOR_ROBOT: u8 = 0x01; +pub const COD_TOY_MINOR_VEHICLE: u8 = 0x02; +pub const COD_TOY_MINOR_DOLL_ACTION_FIGURE: u8 = 0x03; +pub const COD_TOY_MINOR_CONTROLLER: u8 = 0x04; +pub const COD_TOY_MINOR_GAME: u8 = 0x05; +pub const COD_HEALTH_MINOR_BLOOD_PRESSURE_MONITOR: u8 = 0x01; +pub const COD_HEALTH_MINOR_THERMOMETER: u8 = 0x02; +pub const COD_HEALTH_MINOR_WEIGHING_SCALE: u8 = 0x03; +pub const COD_HEALTH_MINOR_GLUCOSE_METER: u8 = 0x04; +pub const COD_HEALTH_MINOR_PULSE_OXIMETER: u8 = 0x05; +pub const COD_HEALTH_MINOR_HEART_PULSE_MONITOR: u8 = 0x06; +pub const COD_HEALTH_MINOR_HEALTH_DATA_DISPLAY: u8 = 0x07; +pub const COD_HEALTH_MINOR_STEP_COUNTER: u8 = 0x08; +pub const COD_LAN_ACCESS_BIT_OFFSET: u8 = 5; +pub const COD_LAN_MINOR_MASK: u32 = 0x00001C; +pub const COD_LAN_ACCESS_MASK: u32 = 0x0000E0; +#[inline] +pub fn GET_COD_LAN_MINOR(cod: BTH_COD) -> u8 { + ((cod & COD_LAN_MINOR_MASK) >> COD_MINOR_BIT_OFFSET) as u8 +} +#[inline] +pub fn GET_COD_LAN_ACCESS(cod: BTH_COD) -> u8 { + ((cod & COD_LAN_ACCESS_MASK) >> COD_LAN_ACCESS_BIT_OFFSET) as u8 +} +pub const COD_LAN_MINOR_UNCLASSIFIED: u8 = 0x00; +pub const COD_LAN_ACCESS_0_USED: u8 = 0x00; +pub const COD_LAN_ACCESS_17_USED: u8 = 0x01; +pub const COD_LAN_ACCESS_33_USED: u8 = 0x02; +pub const COD_LAN_ACCESS_50_USED: u8 = 0x03; +pub const COD_LAN_ACCESS_67_USED: u8 = 0x04; +pub const COD_LAN_ACCESS_83_USED: u8 = 0x05; +pub const COD_LAN_ACCESS_99_USED: u8 = 0x06; +pub const COD_LAN_ACCESS_FULL: u8 = 0x07; +pub const BTH_EIR_FLAGS_ID: u8 = 0x01; +pub const BTH_EIR_16_UUIDS_PARTIAL_ID: u8 = 0x02; +pub const BTH_EIR_16_UUIDS_COMPLETE_ID: u8 = 0x03; +pub const BTH_EIR_32_UUIDS_PARTIAL_ID: u8 = 0x04; +pub const BTH_EIR_32_UUIDS_COMPLETE_ID: u8 = 0x05; +pub const BTH_EIR_128_UUIDS_PARTIAL_ID: u8 = 0x06; +pub const BTH_EIR_128_UUIDS_COMPLETE_ID: u8 = 0x07; +pub const BTH_EIR_LOCAL_NAME_PARTIAL_ID: u8 = 0x08; +pub const BTH_EIR_LOCAL_NAME_COMPLETE_ID: u8 = 0x09; +pub const BTH_EIR_TX_POWER_LEVEL_ID: u8 = 0x0A; +pub const BTH_EIR_OOB_OPT_DATA_LEN_ID: u8 = 0x0B; +pub const BTH_EIR_OOB_BD_ADDR_ID: u8 = 0x0C; +pub const BTH_EIR_OOB_COD_ID: u8 = 0x0D; +pub const BTH_EIR_OOB_SP_HASH_ID: u8 = 0x0E; +pub const BTH_EIR_OOB_SP_RANDOMIZER_ID: u8 = 0x0F; +pub const BTH_EIR_MANUFACTURER_ID: u8 = 0xFF; +pub const BTH_EIR_SIZE: usize = 240; +// #define LAP_GIAC_INIT { 0x33, 0x8B, 0x9E } +// #define LAP_LIAC_INIT { 0x00, 0x8B, 0x9E } +pub const LAP_GIAC_VALUE: BTH_LAP = 0x009E8B33; +pub const LAP_LIAC_VALUE: BTH_LAP = 0x009E8B00; +pub const BTH_ADDR_IAC_FIRST: BTH_ADDR = 0x9E8B00; +pub const BTH_ADDR_IAC_LAST: BTH_ADDR = 0x9E8B3f; +pub const BTH_ADDR_LIAC: BTH_ADDR = 0x9E8B00; +pub const BTH_ADDR_GIAC: BTH_ADDR = 0x9E8B33; +pub type BTHSTATUS = UCHAR; +pub type PBTHSTATUS = *mut UCHAR; +#[inline] +pub fn BTH_ERROR(btStatus: BTHSTATUS) -> bool { + btStatus != BTH_ERROR_SUCCESS +} +#[inline] +pub fn BTH_SUCCESS(btStatus: BTHSTATUS) -> bool { + btStatus == BTH_ERROR_SUCCESS +} +pub const BTH_ERROR_SUCCESS: BTHSTATUS = 0x00; +pub const BTH_ERROR_UNKNOWN_HCI_COMMAND: BTHSTATUS = 0x01; +pub const BTH_ERROR_NO_CONNECTION: BTHSTATUS = 0x02; +pub const BTH_ERROR_HARDWARE_FAILURE: BTHSTATUS = 0x03; +pub const BTH_ERROR_PAGE_TIMEOUT: BTHSTATUS = 0x04; +pub const BTH_ERROR_AUTHENTICATION_FAILURE: BTHSTATUS = 0x05; +pub const BTH_ERROR_KEY_MISSING: BTHSTATUS = 0x06; +pub const BTH_ERROR_MEMORY_FULL: BTHSTATUS = 0x07; +pub const BTH_ERROR_CONNECTION_TIMEOUT: BTHSTATUS = 0x08; +pub const BTH_ERROR_MAX_NUMBER_OF_CONNECTIONS: BTHSTATUS = 0x09; +pub const BTH_ERROR_MAX_NUMBER_OF_SCO_CONNECTIONS: BTHSTATUS = 0x0a; +pub const BTH_ERROR_ACL_CONNECTION_ALREADY_EXISTS: BTHSTATUS = 0x0b; +pub const BTH_ERROR_COMMAND_DISALLOWED: BTHSTATUS = 0x0c; +pub const BTH_ERROR_HOST_REJECTED_LIMITED_RESOURCES: BTHSTATUS = 0x0d; +pub const BTH_ERROR_HOST_REJECTED_SECURITY_REASONS: BTHSTATUS = 0x0e; +pub const BTH_ERROR_HOST_REJECTED_PERSONAL_DEVICE: BTHSTATUS = 0x0f; +pub const BTH_ERROR_HOST_TIMEOUT: BTHSTATUS = 0x10; +pub const BTH_ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER: BTHSTATUS = 0x11; +pub const BTH_ERROR_INVALID_HCI_PARAMETER: BTHSTATUS = 0x12; +pub const BTH_ERROR_REMOTE_USER_ENDED_CONNECTION: BTHSTATUS = 0x13; +pub const BTH_ERROR_REMOTE_LOW_RESOURCES: BTHSTATUS = 0x14; +pub const BTH_ERROR_REMOTE_POWERING_OFF: BTHSTATUS = 0x15; +pub const BTH_ERROR_LOCAL_HOST_TERMINATED_CONNECTION: BTHSTATUS = 0x16; +pub const BTH_ERROR_REPEATED_ATTEMPTS: BTHSTATUS = 0x17; +pub const BTH_ERROR_PAIRING_NOT_ALLOWED: BTHSTATUS = 0x18; +pub const BTH_ERROR_UKNOWN_LMP_PDU: BTHSTATUS = 0x19; +pub const BTH_ERROR_UNSUPPORTED_REMOTE_FEATURE: BTHSTATUS = 0x1a; +pub const BTH_ERROR_SCO_OFFSET_REJECTED: BTHSTATUS = 0x1b; +pub const BTH_ERROR_SCO_INTERVAL_REJECTED: BTHSTATUS = 0x1c; +pub const BTH_ERROR_SCO_AIRMODE_REJECTED: BTHSTATUS = 0x1d; +pub const BTH_ERROR_INVALID_LMP_PARAMETERS: BTHSTATUS = 0x1e; +pub const BTH_ERROR_UNSPECIFIED_ERROR: BTHSTATUS = 0x1f; +pub const BTH_ERROR_UNSUPPORTED_LMP_PARM_VALUE: BTHSTATUS = 0x20; +pub const BTH_ERROR_ROLE_CHANGE_NOT_ALLOWED: BTHSTATUS = 0x21; +pub const BTH_ERROR_LMP_RESPONSE_TIMEOUT: BTHSTATUS = 0x22; +pub const BTH_ERROR_LMP_TRANSACTION_COLLISION: BTHSTATUS = 0x23; +pub const BTH_ERROR_LMP_PDU_NOT_ALLOWED: BTHSTATUS = 0x24; +pub const BTH_ERROR_ENCRYPTION_MODE_NOT_ACCEPTABLE: BTHSTATUS = 0x25; +pub const BTH_ERROR_UNIT_KEY_NOT_USED: BTHSTATUS = 0x26; +pub const BTH_ERROR_QOS_IS_NOT_SUPPORTED: BTHSTATUS = 0x27; +pub const BTH_ERROR_INSTANT_PASSED: BTHSTATUS = 0x28; +pub const BTH_ERROR_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED: BTHSTATUS = 0x29; +pub const BTH_ERROR_DIFFERENT_TRANSACTION_COLLISION: BTHSTATUS = 0x2a; +pub const BTH_ERROR_QOS_UNACCEPTABLE_PARAMETER: BTHSTATUS = 0x2c; +pub const BTH_ERROR_QOS_REJECTED: BTHSTATUS = 0x2d; +pub const BTH_ERROR_CHANNEL_CLASSIFICATION_NOT_SUPPORTED: BTHSTATUS = 0x2e; +pub const BTH_ERROR_INSUFFICIENT_SECURITY: BTHSTATUS = 0x2f; +pub const BTH_ERROR_PARAMETER_OUT_OF_MANDATORY_RANGE: BTHSTATUS = 0x30; +pub const BTH_ERROR_ROLE_SWITCH_PENDING: BTHSTATUS = 0x32; +pub const BTH_ERROR_RESERVED_SLOT_VIOLATION: BTHSTATUS = 0x34; +pub const BTH_ERROR_ROLE_SWITCH_FAILED: BTHSTATUS = 0x35; +pub const BTH_ERROR_EXTENDED_INQUIRY_RESPONSE_TOO_LARGE: BTHSTATUS = 0x36; +pub const BTH_ERROR_SECURE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST: BTHSTATUS = 0x37; +pub const BTH_ERROR_HOST_BUSY_PAIRING: BTHSTATUS = 0x38; +pub const BTH_ERROR_CONNECTION_REJECTED_DUE_TO_NO_SUITABLE_CHANNEL_FOUND: BTHSTATUS = 0x39; +pub const BTH_ERROR_CONTROLLER_BUSY: BTHSTATUS = 0x3a; +pub const BTH_ERROR_UNACCEPTABLE_CONNECTION_INTERVAL: BTHSTATUS = 0x3b; +pub const BTH_ERROR_DIRECTED_ADVERTISING_TIMEOUT: BTHSTATUS = 0x3c; +pub const BTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE: BTHSTATUS = 0x3d; +pub const BTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED: BTHSTATUS = 0x3e; +pub const BTH_ERROR_MAC_CONNECTION_FAILED: BTHSTATUS = 0x3f; +pub const BTH_ERROR_UNSPECIFIED: BTHSTATUS = 0xFF; +pub const L2CAP_MIN_MTU: u16 = 48; +pub const L2CAP_MAX_MTU: u16 = 0xFFFF; +pub const L2CAP_DEFAULT_MTU: u16 = 672; +pub const MAX_L2CAP_PING_DATA_LENGTH: usize = 44; +pub const MAX_L2CAP_INFO_DATA_LENGTH: usize = 44; +pub const BDIF_ADDRESS: u32 = 0x00000001; +pub const BDIF_COD: u32 = 0x00000002; +pub const BDIF_NAME: u32 = 0x00000004; +pub const BDIF_PAIRED: u32 = 0x00000008; +pub const BDIF_PERSONAL: u32 = 0x00000010; +pub const BDIF_CONNECTED: u32 = 0x00000020; +pub const BDIF_SHORT_NAME: u32 = 0x00000040; +pub const BDIF_VISIBLE: u32 = 0x00000080; +pub const BDIF_SSP_SUPPORTED: u32 = 0x00000100; +pub const BDIF_SSP_PAIRED: u32 = 0x00000200; +pub const BDIF_SSP_MITM_PROTECTED: u32 = 0x00000400; +pub const BDIF_RSSI: u32 = 0x00001000; +pub const BDIF_EIR: u32 = 0x00002000; +pub const BDIF_BR: u32 = 0x00004000; +pub const BDIF_LE: u32 = 0x00008000; +pub const BDIF_LE_PAIRED: u32 = 0x00010000; +pub const BDIF_LE_PERSONAL: u32 = 0x00020000; +pub const BDIF_LE_MITM_PROTECTED: u32 = 0x00040000; +pub const BDIF_LE_PRIVACY_ENABLED: u32 = 0x00080000; +pub const BDIF_LE_RANDOM_ADDRESS_TYPE: u32 = 0x00100000; +pub const BDIF_LE_DISCOVERABLE: u32 = 0x00200000; +pub const BDIF_LE_NAME: u32 = 0x00400000; +pub const BDIF_LE_VISIBLE: u32 = 0x00800000; +pub const BDIF_LE_CONNECTED: u32 = 0x01000000; +pub const BDIF_LE_CONNECTABLE: u32 = 0x02000000; +pub const BDIF_CONNECTION_INBOUND: u32 = 0x04000000; +pub const BDIF_BR_SECURE_CONNECTION_PAIRED: u32 = 0x08000000; +pub const BDIF_LE_SECURE_CONNECTION_PAIRED: u32 = 0x10000000; +pub const BDIF_VALID_FLAGS: u32 = BDIF_ADDRESS | BDIF_COD | BDIF_NAME | BDIF_PAIRED + | BDIF_PERSONAL | BDIF_CONNECTED | BDIF_SHORT_NAME | BDIF_VISIBLE | BDIF_RSSI | BDIF_EIR + | BDIF_SSP_PAIRED | BDIF_SSP_MITM_PROTECTED | BDIF_BR | BDIF_LE | BDIF_LE_PAIRED + | BDIF_LE_PERSONAL | BDIF_LE_MITM_PROTECTED | BDIF_LE_PRIVACY_ENABLED + | BDIF_LE_RANDOM_ADDRESS_TYPE | BDIF_LE_DISCOVERABLE | BDIF_LE_NAME | BDIF_LE_VISIBLE + | BDIF_LE_CONNECTED | BDIF_LE_CONNECTABLE | BDIF_CONNECTION_INBOUND + | BDIF_BR_SECURE_CONNECTION_PAIRED | BDIF_LE_SECURE_CONNECTION_PAIRED; +STRUCT!{struct BTH_DEVICE_INFO { + flags: ULONG, + address: BTH_ADDR, + classOfDevice: BTH_COD, + name: [CHAR; BTH_MAX_NAME_SIZE], +}} +pub type PBTH_DEVICE_INFO = *mut BTH_DEVICE_INFO; +STRUCT!{struct BTH_RADIO_IN_RANGE { + deviceInfo: BTH_DEVICE_INFO, + previousDeviceFlags: ULONG, +}} +pub type PBTH_RADIO_IN_RANGE = *mut BTH_RADIO_IN_RANGE; +STRUCT!{struct BTH_L2CAP_EVENT_INFO { + bthAddress: BTH_ADDR, + psm: USHORT, + connected: UCHAR, + initiated: UCHAR, +}} +pub type PBTH_L2CAP_EVENT_INFO = *mut BTH_L2CAP_EVENT_INFO; +pub const HCI_CONNECTION_TYPE_ACL: u8 = 1; +pub const HCI_CONNECTION_TYPE_SCO: u8 = 2; +pub const HCI_CONNECTION_TYPE_LE: u8 = 3; +pub const HCI_CONNNECTION_TYPE_ACL: u8 = HCI_CONNECTION_TYPE_ACL; +pub const HCI_CONNNECTION_TYPE_SCO: u8 = HCI_CONNECTION_TYPE_SCO; +STRUCT!{struct BTH_HCI_EVENT_INFO { + bthAddress: BTH_ADDR, + connectionType: UCHAR, + connected: UCHAR, +}} +pub type PBTH_HCI_EVENT_INFO = *mut BTH_HCI_EVENT_INFO; +ENUM!{enum IO_CAPABILITY { + IoCaps_DisplayOnly = 0x00, + IoCaps_DisplayYesNo = 0x01, + IoCaps_KeyboardOnly = 0x02, + IoCaps_NoInputNoOutput = 0x03, + IoCaps_Undefined = 0xff, +}} +ENUM!{enum AUTHENTICATION_REQUIREMENTS { + MITMProtectionNotRequired = 0x00, + MITMProtectionRequired = 0x01, + MITMProtectionNotRequiredBonding = 0x02, + MITMProtectionRequiredBonding = 0x03, + MITMProtectionNotRequiredGeneralBonding = 0x04, + MITMProtectionRequiredGeneralBonding = 0x05, + MITMProtectionNotDefined = 0xff, +}} +#[inline] +pub fn IsMITMProtectionRequired(requirements: AUTHENTICATION_REQUIREMENTS) -> bool { + MITMProtectionRequired == requirements || MITMProtectionRequiredBonding == requirements + || MITMProtectionRequiredGeneralBonding == requirements +} +pub const BTH_MAX_SERVICE_NAME_SIZE: usize = 256; +pub const MAX_UUIDS_IN_QUERY: usize = 12; +pub const BTH_VID_DEFAULT_VALUE: u16 = 0xFFFF; +pub const SDP_ERROR_INVALID_SDP_VERSION: u16 = 0x0001; +pub const SDP_ERROR_INVALID_RECORD_HANDLE: u16 = 0x0002; +pub const SDP_ERROR_INVALID_REQUEST_SYNTAX: u16 = 0x0003; +pub const SDP_ERROR_INVALID_PDU_SIZE: u16 = 0x0004; +pub const SDP_ERROR_INVALID_CONTINUATION_STATE: u16 = 0x0005; +pub const SDP_ERROR_INSUFFICIENT_RESOURCES: u16 = 0x0006; +pub const SDP_ERROR_SUCCESS: SDP_ERROR = 0x0000; +pub const SDP_ERROR_SERVER_INVALID_RESPONSE: SDP_ERROR = 0x0100; +pub const SDP_ERROR_SERVER_RESPONSE_DID_NOT_PARSE: SDP_ERROR = 0x0200; +pub const SDP_ERROR_SERVER_BAD_FORMAT: SDP_ERROR = 0x0300; +pub const SDP_ERROR_COULD_NOT_SEND_CONTINUE: SDP_ERROR = 0x0400; +pub const SDP_ERROR_RESPONSE_TOO_LARGE: SDP_ERROR = 0x0500; +pub const SDP_ATTRIB_RECORD_HANDLE: u16 = 0x0000; +pub const SDP_ATTRIB_CLASS_ID_LIST: u16 = 0x0001; +pub const SDP_ATTRIB_RECORD_STATE: u16 = 0x0002; +pub const SDP_ATTRIB_SERVICE_ID: u16 = 0x0003; +pub const SDP_ATTRIB_PROTOCOL_DESCRIPTOR_LIST: u16 = 0x0004; +pub const SDP_ATTRIB_BROWSE_GROUP_LIST: u16 = 0x0005; +pub const SDP_ATTRIB_LANG_BASE_ATTRIB_ID_LIST: u16 = 0x0006; +pub const SDP_ATTRIB_INFO_TIME_TO_LIVE: u16 = 0x0007; +pub const SDP_ATTRIB_AVAILABILITY: u16 = 0x0008; +pub const SDP_ATTRIB_PROFILE_DESCRIPTOR_LIST: u16 = 0x0009; +pub const SDP_ATTRIB_DOCUMENTATION_URL: u16 = 0x000A; +pub const SDP_ATTRIB_CLIENT_EXECUTABLE_URL: u16 = 0x000B; +pub const SDP_ATTRIB_ICON_URL: u16 = 0x000C; +pub const SDP_ATTRIB_ADDITIONAL_PROTOCOL_DESCRIPTOR_LIST: u16 = 0x000D; +pub const SDP_ATTRIB_PROFILE_SPECIFIC: u16 = 0x0200; +pub const LANG_BASE_LANGUAGE_INDEX: u16 = 0x0000; +pub const LANG_BASE_ENCODING_INDEX: u16 = 0x0001; +pub const LANG_BASE_OFFSET_INDEX: u16 = 0x0002; +pub const LANG_DEFAULT_ID: u16 = 0x0100; +pub const LANGUAGE_EN_US: u16 = 0x656E; +pub const ENCODING_UTF_8: u16 = 0x006A; +pub const STRING_NAME_OFFSET: u16 = 0x0000; +pub const STRING_DESCRIPTION_OFFSET: u16 = 0x0001; +pub const STRING_PROVIDER_NAME_OFFSET: u16 = 0x0002; +pub const SDP_ATTRIB_SDP_VERSION_NUMBER_LIST: u16 = 0x0200; +pub const SDP_ATTRIB_SDP_DATABASE_STATE: u16 = 0x0201; +pub const SDP_ATTRIB_BROWSE_GROUP_ID: u16 = 0x0200; +pub const SDP_ATTRIB_CORDLESS_EXTERNAL_NETWORK: u16 = 0x0301; +pub const SDP_ATTRIB_FAX_CLASS_1_SUPPORT: u16 = 0x0302; +pub const SDP_ATTRIB_FAX_CLASS_2_0_SUPPORT: u16 = 0x0303; +pub const SDP_ATTRIB_FAX_CLASS_2_SUPPORT: u16 = 0x0304; +pub const SDP_ATTRIB_FAX_AUDIO_FEEDBACK_SUPPORT: u16 = 0x0305; +pub const SDP_ATTRIB_HEADSET_REMOTE_AUDIO_VOLUME_CONTROL: u16 = 0x0302; +pub const SDP_ATTRIB_LAN_LPSUBNET: u16 = 0x0200; +pub const SDP_ATTRIB_OBJECT_PUSH_SUPPORTED_FORMATS_LIST: u16 = 0x0303; +pub const SDP_ATTRIB_SYNCH_SUPPORTED_DATA_STORES_LIST: u16 = 0x0301; +pub const SDP_ATTRIB_SERVICE_VERSION: u16 = 0x0300; +pub const SDP_ATTRIB_PAN_NETWORK_ADDRESS: u16 = 0x0306; +pub const SDP_ATTRIB_PAN_WAP_GATEWAY: u16 = 0x0307; +pub const SDP_ATTRIB_PAN_HOME_PAGE_URL: u16 = 0x0308; +pub const SDP_ATTRIB_PAN_WAP_STACK_TYPE: u16 = 0x0309; +pub const SDP_ATTRIB_PAN_SECURITY_DESCRIPTION: u16 = 0x030A; +pub const SDP_ATTRIB_PAN_NET_ACCESS_TYPE: u16 = 0x030B; +pub const SDP_ATTRIB_PAN_MAX_NET_ACCESS_RATE: u16 = 0x030C; +pub const SDP_ATTRIB_IMAGING_SUPPORTED_CAPABILITIES: u16 = 0x0310; +pub const SDP_ATTRIB_IMAGING_SUPPORTED_FEATURES: u16 = 0x0311; +pub const SDP_ATTRIB_IMAGING_SUPPORTED_FUNCTIONS: u16 = 0x0312; +pub const SDP_ATTRIB_IMAGING_TOTAL_DATA_CAPACITY: u16 = 0x0313; +pub const SDP_ATTRIB_DI_SPECIFICATION_ID: u16 = 0x0200; +pub const SDP_ATTRIB_DI_VENDOR_ID: u16 = 0x0201; +pub const SDP_ATTRIB_DI_PRODUCT_ID: u16 = 0x0202; +pub const SDP_ATTRIB_DI_VERSION: u16 = 0x0203; +pub const SDP_ATTRIB_DI_PRIMARY_RECORD: u16 = 0x0204; +pub const SDP_ATTRIB_DI_VENDOR_ID_SOURCE: u16 = 0x0205; +pub const SDP_ATTRIB_HID_DEVICE_RELEASE_NUMBER: u16 = 0x0200; +pub const SDP_ATTRIB_HID_PARSER_VERSION: u16 = 0x0201; +pub const SDP_ATTRIB_HID_DEVICE_SUBCLASS: u16 = 0x0202; +pub const SDP_ATTRIB_HID_COUNTRY_CODE: u16 = 0x0203; +pub const SDP_ATTRIB_HID_VIRTUAL_CABLE: u16 = 0x0204; +pub const SDP_ATTRIB_HID_RECONNECT_INITIATE: u16 = 0x0205; +pub const SDP_ATTRIB_HID_DESCRIPTOR_LIST: u16 = 0x0206; +pub const SDP_ATTRIB_HID_LANG_ID_BASE_LIST: u16 = 0x0207; +pub const SDP_ATTRIB_HID_SDP_DISABLE: u16 = 0x0208; +pub const SDP_ATTRIB_HID_BATTERY_POWER: u16 = 0x0209; +pub const SDP_ATTRIB_HID_REMOTE_WAKE: u16 = 0x020A; +pub const SDP_ATTRIB_HID_PROFILE_VERSION: u16 = 0x020B; +pub const SDP_ATTRIB_HID_SUPERVISION_TIMEOUT: u16 = 0x020C; +pub const SDP_ATTRIB_HID_NORMALLY_CONNECTABLE: u16 = 0x020D; +pub const SDP_ATTRIB_HID_BOOT_DEVICE: u16 = 0x020E; +pub const SDP_ATTRIB_HID_SSR_HOST_MAX_LATENCY: u16 = 0x020F; +pub const SDP_ATTRIB_HID_SSR_HOST_MIN_TIMEOUT: u16 = 0x0210; +pub const CORDLESS_EXTERNAL_NETWORK_PSTN: u8 = 0x01; +pub const CORDLESS_EXTERNAL_NETWORK_ISDN: u8 = 0x02; +pub const CORDLESS_EXTERNAL_NETWORK_GSM: u8 = 0x03; +pub const CORDLESS_EXTERNAL_NETWORK_CDMA: u8 = 0x04; +pub const CORDLESS_EXTERNAL_NETWORK_ANALOG_CELLULAR: u8 = 0x05; +pub const CORDLESS_EXTERNAL_NETWORK_PACKET_SWITCHED: u8 = 0x06; +pub const CORDLESS_EXTERNAL_NETWORK_OTHER: u8 = 0x07; +pub const OBJECT_PUSH_FORMAT_VCARD_2_1: u8 = 0x01; +pub const OBJECT_PUSH_FORMAT_VCARD_3_0: u8 = 0x02; +pub const OBJECT_PUSH_FORMAT_VCAL_1_0: u8 = 0x03; +pub const OBJECT_PUSH_FORMAT_ICAL_2_0: u8 = 0x04; +pub const OBJECT_PUSH_FORMAT_VNOTE: u8 = 0x05; +pub const OBJECT_PUSH_FORMAT_VMESSAGE: u8 = 0x06; +pub const OBJECT_PUSH_FORMAT_ANY: u8 = 0xFF; +pub const SYNCH_DATA_STORE_PHONEBOOK: u8 = 0x01; +pub const SYNCH_DATA_STORE_CALENDAR: u8 = 0x03; +pub const SYNCH_DATA_STORE_NOTES: u8 = 0x05; +pub const SYNCH_DATA_STORE_MESSAGES: u8 = 0x06; +pub const DI_VENDOR_ID_SOURCE_BLUETOOTH_SIG: u16 = 0x0001; +pub const DI_VENDOR_ID_SOURCE_USB_IF: u16 = 0x0002; +pub const PSM_SDP: u16 = 0x0001; +pub const PSM_RFCOMM: u16 = 0x0003; +pub const PSM_TCS_BIN: u16 = 0x0005; +pub const PSM_TCS_BIN_CORDLESS: u16 = 0x0007; +pub const PSM_BNEP: u16 = 0x000F; +pub const PSM_HID_CONTROL: u16 = 0x0011; +pub const PSM_HID_INTERRUPT: u16 = 0x0013; +pub const PSM_UPNP: u16 = 0x0015; +pub const PSM_AVCTP: u16 = 0x0017; +pub const PSM_AVDTP: u16 = 0x0019; +pub const PSM_AVCTP_BROWSE: u16 = 0x001B; +pub const PSM_UDI_C_PLANE: u16 = 0x001D; +pub const PSM_ATT: u16 = 0x001F; +pub const PSM_3DSP: u16 = 0x0021; +pub const PSM_LE_IPSP: u16 = 0x0023; +pub const STR_ADDR_FMTA: &'static str = "(%02x:%02x:%02x:%02x:%02x:%02x)\0"; +// #define STR_ADDR_FMTW L"(%02x:%02x:%02x:%02x:%02x:%02x)" +pub const STR_ADDR_SHORT_FMTA: &'static str = "%04x%08x\0"; +// #define STR_ADDR_SHORT_FMTW L"%04x%08x" +pub const STR_USBHCI_CLASS_HARDWAREIDA: &'static str = "USB\\Class_E0&SubClass_01&Prot_01\0"; +// #define STR_USBHCI_CLASS_HARDWAREIDW L"USB\\Class_E0&SubClass_01&Prot_01" +#[inline] +pub fn GET_BITS(field: u64, offset: u8, mask: u64) -> u64 { + (field >> offset) & mask +} +#[inline] +pub fn GET_BIT(field: u64, offset: u8) -> u64 { + GET_BITS(field, offset, 1) +} +#[inline] +pub fn LMP_3_SLOT_PACKETS(x: u64) -> u64 { + GET_BIT(x, 0) +} +#[inline] +pub fn LMP_5_SLOT_PACKETS(x: u64) -> u64 { + GET_BIT(x, 1) +} +#[inline] +pub fn LMP_ENCRYPTION(x: u64) -> u64 { + GET_BIT(x, 2) +} +#[inline] +pub fn LMP_SLOT_OFFSET(x: u64) -> u64 { + GET_BIT(x, 3) +} +#[inline] +pub fn LMP_TIMING_ACCURACY(x: u64) -> u64 { + GET_BIT(x, 4) +} +#[inline] +pub fn LMP_SWITCH(x: u64) -> u64 { + GET_BIT(x, 5) +} +#[inline] +pub fn LMP_HOLD_MODE(x: u64) -> u64 { + GET_BIT(x, 6) +} +#[inline] +pub fn LMP_SNIFF_MODE(x: u64) -> u64 { + GET_BIT(x, 7) +} +#[inline] +pub fn LMP_PARK_MODE(x: u64) -> u64 { + GET_BIT(x, 8) +} +#[inline] +pub fn LMP_RSSI(x: u64) -> u64 { + GET_BIT(x, 9) +} +#[inline] +pub fn LMP_CHANNEL_QUALITY_DRIVEN_MODE(x: u64) -> u64 { + GET_BIT(x, 10) +} +#[inline] +pub fn LMP_SCO_LINK(x: u64) -> u64 { + GET_BIT(x, 11) +} +#[inline] +pub fn LMP_HV2_PACKETS(x: u64) -> u64 { + GET_BIT(x, 12) +} +#[inline] +pub fn LMP_HV3_PACKETS(x: u64) -> u64 { + GET_BIT(x, 13) +} +#[inline] +pub fn LMP_MU_LAW_LOG(x: u64) -> u64 { + GET_BIT(x, 14) +} +#[inline] +pub fn LMP_A_LAW_LOG(x: u64) -> u64 { + GET_BIT(x, 15) +} +#[inline] +pub fn LMP_CVSD(x: u64) -> u64 { + GET_BIT(x, 16) +} +#[inline] +pub fn LMP_PAGING_SCHEME(x: u64) -> u64 { + GET_BIT(x, 17) +} +#[inline] +pub fn LMP_POWER_CONTROL(x: u64) -> u64 { + GET_BIT(x, 18) +} +#[inline] +pub fn LMP_TRANSPARENT_SCO_DATA(x: u64) -> u64 { + GET_BIT(x, 19) +} +#[inline] +pub fn LMP_FLOW_CONTROL_LAG(x: u64) -> u64 { + GET_BITS(x, 20, 0x3) +} +#[inline] +pub fn LMP_BROADCAST_ENCRYPTION(x: u64) -> u64 { + GET_BIT(x, 23) +} +#[inline] +pub fn LMP_ENHANCED_DATA_RATE_ACL_2MBPS_MODE(x: u64) -> u64 { + GET_BIT(x, 25) +} +#[inline] +pub fn LMP_ENHANCED_DATA_RATE_ACL_3MBPS_MODE(x: u64) -> u64 { + GET_BIT(x, 26) +} +#[inline] +pub fn LMP_ENHANCED_INQUIRY_SCAN(x: u64) -> u64 { + GET_BIT(x, 27) +} +#[inline] +pub fn LMP_INTERLACED_INQUIRY_SCAN(x: u64) -> u64 { + GET_BIT(x, 28) +} +#[inline] +pub fn LMP_INTERLACED_PAGE_SCAN(x: u64) -> u64 { + GET_BIT(x, 29) +} +#[inline] +pub fn LMP_RSSI_WITH_INQUIRY_RESULTS(x: u64) -> u64 { + GET_BIT(x, 30) +} +#[inline] +pub fn LMP_ESCO_LINK(x: u64) -> u64 { + GET_BIT(x, 31) +} +#[inline] +pub fn LMP_EV4_PACKETS(x: u64) -> u64 { + GET_BIT(x, 32) +} +#[inline] +pub fn LMP_EV5_PACKETS(x: u64) -> u64 { + GET_BIT(x, 33) +} +#[inline] +pub fn LMP_AFH_CAPABLE_SLAVE(x: u64) -> u64 { + GET_BIT(x, 35) +} +#[inline] +pub fn LMP_AFH_CLASSIFICATION_SLAVE(x: u64) -> u64 { + GET_BIT(x, 36) +} +#[inline] +pub fn LMP_BR_EDR_NOT_SUPPORTED(x: u64) -> u64 { + GET_BIT(x, 37) +} +#[inline] +pub fn LMP_LE_SUPPORTED(x: u64) -> u64 { + GET_BIT(x, 38) +} +#[inline] +pub fn LMP_3SLOT_EDR_ACL_PACKETS(x: u64) -> u64 { + GET_BIT(x, 39) +} +#[inline] +pub fn LMP_5SLOT_EDR_ACL_PACKETS(x: u64) -> u64 { + GET_BIT(x, 40) +} +#[inline] +pub fn LMP_SNIFF_SUBRATING(x: u64) -> u64 { + GET_BIT(x, 41) +} +#[inline] +pub fn LMP_PAUSE_ENCRYPTION(x: u64) -> u64 { + GET_BIT(x, 42) +} +#[inline] +pub fn LMP_AFH_CAPABLE_MASTER(x: u64) -> u64 { + GET_BIT(x, 43) +} +#[inline] +pub fn LMP_AFH_CLASSIFICATION_MASTER(x: u64) -> u64 { + GET_BIT(x, 44) +} +#[inline] +pub fn LMP_EDR_ESCO_2MBPS_MODE(x: u64) -> u64 { + GET_BIT(x, 45) +} +#[inline] +pub fn LMP_EDR_ESCO_3MBPS_MODE(x: u64) -> u64 { + GET_BIT(x, 46) +} +#[inline] +pub fn LMP_3SLOT_EDR_ESCO_PACKETS(x: u64) -> u64 { + GET_BIT(x, 47) +} +#[inline] +pub fn LMP_EXTENDED_INQUIRY_RESPONSE(x: u64) -> u64 { + GET_BIT(x, 48) +} +#[inline] +pub fn LMP_SIMULT_LE_BR_TO_SAME_DEV(x: u64) -> u64 { + GET_BIT(x, 49) +} +#[inline] +pub fn LMP_SECURE_SIMPLE_PAIRING(x: u64) -> u64 { + GET_BIT(x, 51) +} +#[inline] +pub fn LMP_ENCAPSULATED_PDU(x: u64) -> u64 { + GET_BIT(x, 52) +} +#[inline] +pub fn LMP_ERRONEOUS_DATA_REPORTING(x: u64) -> u64 { + GET_BIT(x, 53) +} +#[inline] +pub fn LMP_NON_FLUSHABLE_PACKET_BOUNDARY_FLAG(x: u64) -> u64 { + GET_BIT(x, 54) +} +#[inline] +pub fn LMP_LINK_SUPERVISION_TIMEOUT_CHANGED_EVENT(x: u64) -> u64 { + GET_BIT(x, 56) +} +#[inline] +pub fn LMP_INQUIRY_RESPONSE_TX_POWER_LEVEL(x: u64) -> u64 { + GET_BIT(x, 57) +} +#[inline] +pub fn LMP_EXTENDED_FEATURES(x: u64) -> u64 { + GET_BIT(x, 63) +} diff --git a/bash-5.1/vendor/winapi/src/shared/bthioctl.rs b/bash-5.1/vendor/winapi/src/shared/bthioctl.rs new file mode 100644 index 0000000000000000000000000000000000000000..78ca6b76b43ac3fca5a8043c6699171b3b201389 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/bthioctl.rs @@ -0,0 +1,151 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::bthdef::{BTH_ADDR, BTH_DEVICE_INFO, MAX_UUIDS_IN_QUERY}; +use shared::bthsdpdef::{SdpAttributeRange, SdpQueryUuid}; +use shared::minwindef::{DWORD, UCHAR, ULONG, USHORT}; +use shared::ntdef::{BOOLEAN, ULONGLONG}; +use um::winioctl::{FILE_ANY_ACCESS, FILE_DEVICE_BLUETOOTH, METHOD_BUFFERED, METHOD_NEITHER}; +pub const BTH_IOCTL_BASE: DWORD = 0; +pub const IOCTL_INTERNAL_BTH_SUBMIT_BRB: DWORD = BTH_KERNEL_CTL!(BTH_IOCTL_BASE + 0x00); +pub const IOCTL_INTERNAL_BTHENUM_GET_ENUMINFO: DWORD = BTH_KERNEL_CTL!(BTH_IOCTL_BASE + 0x01); +pub const IOCTL_INTERNAL_BTHENUM_GET_DEVINFO: DWORD = BTH_KERNEL_CTL!(BTH_IOCTL_BASE + 0x02); +pub const IOCTL_BTH_GET_LOCAL_INFO: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x00); +pub const IOCTL_BTH_GET_RADIO_INFO: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x01); +pub const IOCTL_BTH_GET_DEVICE_INFO: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x02); +pub const IOCTL_BTH_DISCONNECT_DEVICE: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x03); +pub const IOCTL_BTH_HCI_VENDOR_COMMAND: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x14); +pub const IOCTL_BTH_SDP_CONNECT: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x80); +pub const IOCTL_BTH_SDP_DISCONNECT: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x81); +pub const IOCTL_BTH_SDP_SERVICE_SEARCH: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x82); +pub const IOCTL_BTH_SDP_ATTRIBUTE_SEARCH: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x83); +pub const IOCTL_BTH_SDP_SERVICE_ATTRIBUTE_SEARCH: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x84); +pub const IOCTL_BTH_SDP_SUBMIT_RECORD: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x85); +pub const IOCTL_BTH_SDP_REMOVE_RECORD: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x86); +pub const IOCTL_BTH_SDP_SUBMIT_RECORD_WITH_INFO: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x87); +pub const IOCTL_BTH_GET_HOST_SUPPORTED_FEATURES: DWORD = BTH_CTL!(BTH_IOCTL_BASE + 0x88); +STRUCT!{#[repr(packed)] struct BTH_DEVICE_INFO_LIST { + numOfDevices: ULONG, + deviceList: [BTH_DEVICE_INFO; 1], +}} +pub type PBTH_DEVICE_INFO_LIST = *mut BTH_DEVICE_INFO_LIST; +STRUCT!{#[repr(packed)] struct BTH_RADIO_INFO { + lmpSupportedFeatures: ULONGLONG, + mfg: USHORT, + lmpSubversion: USHORT, + lmpVersion: UCHAR, +}} +pub type PBTH_RADIO_INFO = *mut BTH_RADIO_INFO; +STRUCT!{#[repr(packed)] struct BTH_LOCAL_RADIO_INFO { + localInfo: BTH_DEVICE_INFO, + flags: ULONG, + hciRevision: USHORT, + hciVersion: UCHAR, + radioInfo: BTH_RADIO_INFO, +}} +pub type PBTH_LOCAL_RADIO_INFO = *mut BTH_LOCAL_RADIO_INFO; +pub const SDP_CONNECT_CACHE: ULONG = 0x00000001; +pub const SDP_CONNECT_ALLOW_PIN: ULONG = 0x00000002; +pub const SDP_REQUEST_TO_DEFAULT: UCHAR = 0; +pub const SDP_REQUEST_TO_MIN: UCHAR = 10; +pub const SDP_REQUEST_TO_MAX: UCHAR = 45; +pub const SERVICE_OPTION_DO_NOT_PUBLISH: ULONG = 0x00000002; +pub const SERVICE_OPTION_NO_PUBLIC_BROWSE: ULONG = 0x00000004; +pub const SERVICE_OPTION_DO_NOT_PUBLISH_EIR: ULONG = 0x00000008; +pub const SERVICE_SECURITY_USE_DEFAULTS: ULONG = 0x00000000; +pub const SERVICE_SECURITY_NONE: ULONG = 0x00000001; +pub const SERVICE_SECURITY_AUTHORIZE: ULONG = 0x00000002; +pub const SERVICE_SECURITY_AUTHENTICATE: ULONG = 0x00000004; +pub const SERVICE_SECURITY_ENCRYPT_REQUIRED: ULONG = 0x00000010; +pub const SERVICE_SECURITY_ENCRYPT_OPTIONAL: ULONG = 0x00000020; +pub const SERVICE_SECURITY_DISABLED: ULONG = 0x10000000; +pub const SERVICE_SECURITY_NO_ASK: ULONG = 0x20000000; +pub const SDP_SEARCH_NO_PARSE_CHECK: ULONG = 0x00000001; +pub const SDP_SEARCH_NO_FORMAT_CHECK: ULONG = 0x00000002; +pub type HANDLE_SDP = ULONGLONG; +pub type PHANDLE_SDP = *mut ULONGLONG; +pub type HANDLE_SDP_TYPE = HANDLE_SDP; +pub const HANDLE_SDP_NULL: HANDLE_SDP = 0x0; +pub const HANDLE_SDP_LOCAL: HANDLE_SDP = -2i64 as u64; +STRUCT!{#[repr(packed)] struct BTH_SDP_CONNECT { + bthAddress: BTH_ADDR, + fSdpConnect: ULONG, + hConnection: HANDLE_SDP_TYPE, + requestTimeout: UCHAR, +}} +pub type PBTH_SDP_CONNECT = *mut BTH_SDP_CONNECT; +STRUCT!{#[repr(packed)] struct BTH_SDP_DISCONNECT { + hConnection: HANDLE_SDP_TYPE, +}} +pub type PBTH_SDP_DISCONNECT = *mut BTH_SDP_DISCONNECT; +STRUCT!{#[repr(packed)] struct BTH_SDP_RECORD { + fSecurity: ULONG, + fOptions: ULONG, + fCodService: ULONG, + recordLength: ULONG, + record: [UCHAR; 1], +}} +pub type PBTH_SDP_RECORD = *mut BTH_SDP_RECORD; +STRUCT!{#[repr(packed)] struct BTH_SDP_SERVICE_SEARCH_REQUEST { + hConnection: HANDLE_SDP_TYPE, + uuids: [SdpQueryUuid; MAX_UUIDS_IN_QUERY], +}} +pub type PBTH_SDP_SERVICE_SEARCH_REQUEST = *mut BTH_SDP_SERVICE_SEARCH_REQUEST; +STRUCT!{#[repr(packed)] struct BTH_SDP_ATTRIBUTE_SEARCH_REQUEST { + hConnection: HANDLE_SDP_TYPE, + searchFlags: ULONG, + recordHandle: ULONG, + range: [SdpAttributeRange; 1], +}} +pub type PBTH_SDP_ATTRIBUTE_SEARCH_REQUEST = *mut BTH_SDP_ATTRIBUTE_SEARCH_REQUEST; +STRUCT!{#[repr(packed)] struct BTH_SDP_SERVICE_ATTRIBUTE_SEARCH_REQUEST { + hConnection: HANDLE_SDP_TYPE, + searchFlags: ULONG, + uuids: [SdpQueryUuid; MAX_UUIDS_IN_QUERY], + range: [SdpAttributeRange; 1], +}} +pub type PBTH_SDP_SERVICE_ATTRIBUTE_SEARCH_REQUEST = *mut BTH_SDP_SERVICE_ATTRIBUTE_SEARCH_REQUEST; +STRUCT!{#[repr(packed)] struct BTH_SDP_STREAM_RESPONSE { + requiredSize: ULONG, + responseSize: ULONG, + response: [UCHAR; 1], +}} +pub type PBTH_SDP_STREAM_RESPONSE = *mut BTH_SDP_STREAM_RESPONSE; +STRUCT!{#[repr(packed)] struct BTH_COMMAND_HEADER { + OpCode: USHORT, + TotalParameterLength: UCHAR, +}} +pub type PBTH_COMMAND_HEADER = *mut BTH_COMMAND_HEADER; +STRUCT!{#[repr(packed)] struct BTH_VENDOR_SPECIFIC_COMMAND { + ManufacturerId: ULONG, + LmpVersion: UCHAR, + MatchAnySinglePattern: BOOLEAN, + HciHeader: BTH_COMMAND_HEADER, + Data: [UCHAR; 1], +}} +pub type PBTH_VENDOR_SPECIFIC_COMMAND = *mut BTH_VENDOR_SPECIFIC_COMMAND; +STRUCT!{#[repr(packed)] struct BTH_VENDOR_PATTERN { + Offset: UCHAR, + Size: UCHAR, + Pattern: [UCHAR; 1], +}} +pub type PBTH_VENDOR_PATTERN = *mut BTH_VENDOR_PATTERN; +STRUCT!{#[repr(packed)] struct BTH_VENDOR_EVENT_INFO { + BthAddress: BTH_ADDR, + EventSize: ULONG, + EventInfo: [UCHAR; 1], +}} +pub type PBTH_VENDOR_EVENT_INFO = *mut BTH_VENDOR_EVENT_INFO; +pub const BTH_HOST_FEATURE_ENHANCED_RETRANSMISSION_MODE: ULONGLONG = 0x0000000000000001; +pub const BTH_HOST_FEATURE_STREAMING_MODE: ULONGLONG = 0x0000000000000002; +pub const BTH_HOST_FEATURE_LOW_ENERGY: ULONGLONG = 0x0000000000000004; +pub const BTH_HOST_FEATURE_SCO_HCI: ULONGLONG = 0x0000000000000008; +pub const BTH_HOST_FEATURE_SCO_HCIBYPASS: ULONGLONG = 0x0000000000000010; +STRUCT!{#[repr(packed)] struct BTH_HOST_FEATURE_MASK { + Mask: ULONGLONG, + Reserved1: ULONGLONG, + Reserved2: ULONGLONG, +}} +pub type PBTH_HOST_FEATURE_MASK = *mut BTH_HOST_FEATURE_MASK; diff --git a/bash-5.1/vendor/winapi/src/shared/bthsdpdef.rs b/bash-5.1/vendor/winapi/src/shared/bthsdpdef.rs new file mode 100644 index 0000000000000000000000000000000000000000..4416fab053a5be15b5e1f3dd6e870776eadb690d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/bthsdpdef.rs @@ -0,0 +1,68 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::{ULONG, USHORT}; +use shared::ntdef::{LONGLONG, ULONGLONG}; +STRUCT!{struct SDP_LARGE_INTEGER_16 { + LowPart: ULONGLONG, + HighPart: LONGLONG, +}} +STRUCT!{struct SDP_ULARGE_INTEGER_16 { + LowPart: ULONGLONG, + HighPart: ULONGLONG, +}} +pub type PSDP_ULARGE_INTEGER_16 = *mut SDP_ULARGE_INTEGER_16; +pub type LPSDP_ULARGE_INTEGER_16 = *mut SDP_ULARGE_INTEGER_16; +pub type PSDP_LARGE_INTEGER_16 = *mut SDP_LARGE_INTEGER_16; +pub type LPSDP_LARGE_INTEGER_16 = *mut SDP_LARGE_INTEGER_16; +ENUM!{enum NodeContainerType { + NodeContainerTypeSequence, + NodeContainerTypeAlternative, +}} +pub type SDP_ERROR = USHORT; +pub type PSDP_ERROR = *mut USHORT; +ENUM!{enum SDP_TYPE { + SDP_TYPE_NIL = 0x00, + SDP_TYPE_UINT = 0x01, + SDP_TYPE_INT = 0x02, + SDP_TYPE_UUID = 0x03, + SDP_TYPE_STRING = 0x04, + SDP_TYPE_BOOLEAN = 0x05, + SDP_TYPE_SEQUENCE = 0x06, + SDP_TYPE_ALTERNATIVE = 0x07, + SDP_TYPE_URL = 0x08, + SDP_TYPE_CONTAINER = 0x20, +}} +ENUM!{enum SDP_SPECIFICTYPE { + SDP_ST_NONE = 0x0000, + SDP_ST_UINT8 = 0x0010, + SDP_ST_UINT16 = 0x0110, + SDP_ST_UINT32 = 0x0210, + SDP_ST_UINT64 = 0x0310, + SDP_ST_UINT128 = 0x0410, + SDP_ST_INT8 = 0x0020, + SDP_ST_INT16 = 0x0120, + SDP_ST_INT32 = 0x0220, + SDP_ST_INT64 = 0x0320, + SDP_ST_INT128 = 0x0420, + SDP_ST_UUID16 = 0x0130, + SDP_ST_UUID32 = 0x0220, + SDP_ST_UUID128 = 0x0430, +}} +STRUCT!{struct SdpAttributeRange { + minAttribute: USHORT, + maxAttribute: USHORT, +}} +UNION!{union SdpQueryUuidUnion { + [u32; 4], + uuid128 uuid128_mut: GUID, + uuid32 uuid32_mut: ULONG, + uuid16 uuid16_mut: USHORT, +}} +STRUCT!{struct SdpQueryUuid { + u: SdpQueryUuidUnion, + uuidType: USHORT, +}} diff --git a/bash-5.1/vendor/winapi/src/shared/bugcodes.rs b/bash-5.1/vendor/winapi/src/shared/bugcodes.rs new file mode 100644 index 0000000000000000000000000000000000000000..3e2bd4954bc8c1045e69e71397059d209f0389a6 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/bugcodes.rs @@ -0,0 +1,456 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Definitions of system bug check codes +use shared::ntdef::ULONG; +pub const HARDWARE_PROFILE_UNDOCKED_STRING: ULONG = 0x40010001; +pub const HARDWARE_PROFILE_DOCKED_STRING: ULONG = 0x40010002; +pub const HARDWARE_PROFILE_UNKNOWN_STRING: ULONG = 0x40010003; +pub const WINDOWS_NT_BANNER: ULONG = 0x4000007E; +pub const WINDOWS_NT_CSD_STRING: ULONG = 0x40000087; +pub const WINDOWS_NT_INFO_STRING: ULONG = 0x40000088; +pub const WINDOWS_NT_MP_STRING: ULONG = 0x40000089; +pub const THREAD_TERMINATE_HELD_MUTEX: ULONG = 0x4000008A; +pub const WINDOWS_NT_INFO_STRING_PLURAL: ULONG = 0x4000009D; +pub const WINDOWS_NT_RC_STRING: ULONG = 0x4000009E; +pub const APC_INDEX_MISMATCH: ULONG = 0x00000001; +pub const DEVICE_QUEUE_NOT_BUSY: ULONG = 0x00000002; +pub const INVALID_AFFINITY_SET: ULONG = 0x00000003; +pub const INVALID_DATA_ACCESS_TRAP: ULONG = 0x00000004; +pub const INVALID_PROCESS_ATTACH_ATTEMPT: ULONG = 0x00000005; +pub const INVALID_PROCESS_DETACH_ATTEMPT: ULONG = 0x00000006; +pub const INVALID_SOFTWARE_INTERRUPT: ULONG = 0x00000007; +pub const IRQL_NOT_DISPATCH_LEVEL: ULONG = 0x00000008; +pub const IRQL_NOT_GREATER_OR_EQUAL: ULONG = 0x00000009; +pub const IRQL_NOT_LESS_OR_EQUAL: ULONG = 0x0000000A; +pub const NO_EXCEPTION_HANDLING_SUPPORT: ULONG = 0x0000000B; +pub const MAXIMUM_WAIT_OBJECTS_EXCEEDED: ULONG = 0x0000000C; +pub const MUTEX_LEVEL_NUMBER_VIOLATION: ULONG = 0x0000000D; +pub const NO_USER_MODE_CONTEXT: ULONG = 0x0000000E; +pub const SPIN_LOCK_ALREADY_OWNED: ULONG = 0x0000000F; +pub const SPIN_LOCK_NOT_OWNED: ULONG = 0x00000010; +pub const THREAD_NOT_MUTEX_OWNER: ULONG = 0x00000011; +pub const TRAP_CAUSE_UNKNOWN: ULONG = 0x00000012; +pub const EMPTY_THREAD_REAPER_LIST: ULONG = 0x00000013; +pub const CREATE_DELETE_LOCK_NOT_LOCKED: ULONG = 0x00000014; +pub const LAST_CHANCE_CALLED_FROM_KMODE: ULONG = 0x00000015; +pub const CID_HANDLE_CREATION: ULONG = 0x00000016; +pub const CID_HANDLE_DELETION: ULONG = 0x00000017; +pub const REFERENCE_BY_POINTER: ULONG = 0x00000018; +pub const BAD_POOL_HEADER: ULONG = 0x00000019; +pub const MEMORY_MANAGEMENT: ULONG = 0x0000001A; +pub const PFN_SHARE_COUNT: ULONG = 0x0000001B; +pub const PFN_REFERENCE_COUNT: ULONG = 0x0000001C; +pub const NO_SPIN_LOCK_AVAILABLE: ULONG = 0x0000001D; +pub const KMODE_EXCEPTION_NOT_HANDLED: ULONG = 0x0000001E; +pub const SHARED_RESOURCE_CONV_ERROR: ULONG = 0x0000001F; +pub const KERNEL_APC_PENDING_DURING_EXIT: ULONG = 0x00000020; +pub const QUOTA_UNDERFLOW: ULONG = 0x00000021; +pub const FILE_SYSTEM: ULONG = 0x00000022; +pub const FAT_FILE_SYSTEM: ULONG = 0x00000023; +pub const NTFS_FILE_SYSTEM: ULONG = 0x00000024; +pub const NPFS_FILE_SYSTEM: ULONG = 0x00000025; +pub const CDFS_FILE_SYSTEM: ULONG = 0x00000026; +pub const RDR_FILE_SYSTEM: ULONG = 0x00000027; +pub const CORRUPT_ACCESS_TOKEN: ULONG = 0x00000028; +pub const SECURITY_SYSTEM: ULONG = 0x00000029; +pub const INCONSISTENT_IRP: ULONG = 0x0000002A; +pub const PANIC_STACK_SWITCH: ULONG = 0x0000002B; +pub const PORT_DRIVER_INTERNAL: ULONG = 0x0000002C; +pub const SCSI_DISK_DRIVER_INTERNAL: ULONG = 0x0000002D; +pub const DATA_BUS_ERROR: ULONG = 0x0000002E; +pub const INSTRUCTION_BUS_ERROR: ULONG = 0x0000002F; +pub const SET_OF_INVALID_CONTEXT: ULONG = 0x00000030; +pub const PHASE0_INITIALIZATION_FAILED: ULONG = 0x00000031; +pub const PHASE1_INITIALIZATION_FAILED: ULONG = 0x00000032; +pub const UNEXPECTED_INITIALIZATION_CALL: ULONG = 0x00000033; +pub const CACHE_MANAGER: ULONG = 0x00000034; +pub const NO_MORE_IRP_STACK_LOCATIONS: ULONG = 0x00000035; +pub const DEVICE_REFERENCE_COUNT_NOT_ZERO: ULONG = 0x00000036; +pub const FLOPPY_INTERNAL_ERROR: ULONG = 0x00000037; +pub const SERIAL_DRIVER_INTERNAL: ULONG = 0x00000038; +pub const SYSTEM_EXIT_OWNED_MUTEX: ULONG = 0x00000039; +pub const SYSTEM_UNWIND_PREVIOUS_USER: ULONG = 0x0000003A; +pub const SYSTEM_SERVICE_EXCEPTION: ULONG = 0x0000003B; +pub const INTERRUPT_UNWIND_ATTEMPTED: ULONG = 0x0000003C; +pub const INTERRUPT_EXCEPTION_NOT_HANDLED: ULONG = 0x0000003D; +pub const MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED: ULONG = 0x0000003E; +pub const NO_MORE_SYSTEM_PTES: ULONG = 0x0000003F; +pub const TARGET_MDL_TOO_SMALL: ULONG = 0x00000040; +pub const MUST_SUCCEED_POOL_EMPTY: ULONG = 0x00000041; +pub const ATDISK_DRIVER_INTERNAL: ULONG = 0x00000042; +pub const NO_SUCH_PARTITION: ULONG = 0x00000043; +pub const MULTIPLE_IRP_COMPLETE_REQUESTS: ULONG = 0x00000044; +pub const INSUFFICIENT_SYSTEM_MAP_REGS: ULONG = 0x00000045; +pub const DEREF_UNKNOWN_LOGON_SESSION: ULONG = 0x00000046; +pub const REF_UNKNOWN_LOGON_SESSION: ULONG = 0x00000047; +pub const CANCEL_STATE_IN_COMPLETED_IRP: ULONG = 0x00000048; +pub const PAGE_FAULT_WITH_INTERRUPTS_OFF: ULONG = 0x00000049; +pub const IRQL_GT_ZERO_AT_SYSTEM_SERVICE: ULONG = 0x0000004A; +pub const STREAMS_INTERNAL_ERROR: ULONG = 0x0000004B; +pub const FATAL_UNHANDLED_HARD_ERROR: ULONG = 0x0000004C; +pub const NO_PAGES_AVAILABLE: ULONG = 0x0000004D; +pub const PFN_LIST_CORRUPT: ULONG = 0x0000004E; +pub const NDIS_INTERNAL_ERROR: ULONG = 0x0000004F; +pub const PAGE_FAULT_IN_NONPAGED_AREA: ULONG = 0x00000050; +pub const PAGE_FAULT_IN_NONPAGED_AREA_M: ULONG = 0x10000050; +pub const REGISTRY_ERROR: ULONG = 0x00000051; +pub const MAILSLOT_FILE_SYSTEM: ULONG = 0x00000052; +pub const NO_BOOT_DEVICE: ULONG = 0x00000053; +pub const LM_SERVER_INTERNAL_ERROR: ULONG = 0x00000054; +pub const DATA_COHERENCY_EXCEPTION: ULONG = 0x00000055; +pub const INSTRUCTION_COHERENCY_EXCEPTION: ULONG = 0x00000056; +pub const XNS_INTERNAL_ERROR: ULONG = 0x00000057; +pub const VOLMGRX_INTERNAL_ERROR: ULONG = 0x00000058; +pub const PINBALL_FILE_SYSTEM: ULONG = 0x00000059; +pub const CRITICAL_SERVICE_FAILED: ULONG = 0x0000005A; +pub const SET_ENV_VAR_FAILED: ULONG = 0x0000005B; +pub const HAL_INITIALIZATION_FAILED: ULONG = 0x0000005C; +pub const UNSUPPORTED_PROCESSOR: ULONG = 0x0000005D; +pub const OBJECT_INITIALIZATION_FAILED: ULONG = 0x0000005E; +pub const SECURITY_INITIALIZATION_FAILED: ULONG = 0x0000005F; +pub const PROCESS_INITIALIZATION_FAILED: ULONG = 0x00000060; +pub const HAL1_INITIALIZATION_FAILED: ULONG = 0x00000061; +pub const OBJECT1_INITIALIZATION_FAILED: ULONG = 0x00000062; +pub const SECURITY1_INITIALIZATION_FAILED: ULONG = 0x00000063; +pub const SYMBOLIC_INITIALIZATION_FAILED: ULONG = 0x00000064; +pub const MEMORY1_INITIALIZATION_FAILED: ULONG = 0x00000065; +pub const CACHE_INITIALIZATION_FAILED: ULONG = 0x00000066; +pub const CONFIG_INITIALIZATION_FAILED: ULONG = 0x00000067; +pub const FILE_INITIALIZATION_FAILED: ULONG = 0x00000068; +pub const IO1_INITIALIZATION_FAILED: ULONG = 0x00000069; +pub const LPC_INITIALIZATION_FAILED: ULONG = 0x0000006A; +pub const PROCESS1_INITIALIZATION_FAILED: ULONG = 0x0000006B; +pub const REFMON_INITIALIZATION_FAILED: ULONG = 0x0000006C; +pub const SESSION1_INITIALIZATION_FAILED: ULONG = 0x0000006D; +pub const BOOTPROC_INITIALIZATION_FAILED: ULONG = 0x0000006E; +pub const VSL_INITIALIZATION_FAILED: ULONG = 0x0000006F; +pub const SOFT_RESTART_FATAL_ERROR: ULONG = 0x00000070; +pub const ASSIGN_DRIVE_LETTERS_FAILED: ULONG = 0x00000072; +pub const CONFIG_LIST_FAILED: ULONG = 0x00000073; +pub const BAD_SYSTEM_CONFIG_INFO: ULONG = 0x00000074; +pub const CANNOT_WRITE_CONFIGURATION: ULONG = 0x00000075; +pub const PROCESS_HAS_LOCKED_PAGES: ULONG = 0x00000076; +pub const KERNEL_STACK_INPAGE_ERROR: ULONG = 0x00000077; +pub const PHASE0_EXCEPTION: ULONG = 0x00000078; +pub const MISMATCHED_HAL: ULONG = 0x00000079; +pub const KERNEL_DATA_INPAGE_ERROR: ULONG = 0x0000007A; +pub const INACCESSIBLE_BOOT_DEVICE: ULONG = 0x0000007B; +pub const BUGCODE_NDIS_DRIVER: ULONG = 0x0000007C; +pub const INSTALL_MORE_MEMORY: ULONG = 0x0000007D; +pub const SYSTEM_THREAD_EXCEPTION_NOT_HANDLED: ULONG = 0x0000007E; +pub const SYSTEM_THREAD_EXCEPTION_NOT_HANDLED_M: ULONG = 0x1000007E; +pub const UNEXPECTED_KERNEL_MODE_TRAP: ULONG = 0x0000007F; +pub const UNEXPECTED_KERNEL_MODE_TRAP_M: ULONG = 0x1000007F; +pub const NMI_HARDWARE_FAILURE: ULONG = 0x00000080; +pub const SPIN_LOCK_INIT_FAILURE: ULONG = 0x00000081; +pub const DFS_FILE_SYSTEM: ULONG = 0x00000082; +pub const OFS_FILE_SYSTEM: ULONG = 0x00000083; +pub const RECOM_DRIVER: ULONG = 0x00000084; +pub const SETUP_FAILURE: ULONG = 0x00000085; +pub const AUDIT_FAILURE: ULONG = 0x00000086; +pub const MBR_CHECKSUM_MISMATCH: ULONG = 0x0000008B; +pub const KERNEL_MODE_EXCEPTION_NOT_HANDLED: ULONG = 0x0000008E; +pub const KERNEL_MODE_EXCEPTION_NOT_HANDLED_M: ULONG = 0x1000008E; +pub const PP0_INITIALIZATION_FAILED: ULONG = 0x0000008F; +pub const PP1_INITIALIZATION_FAILED: ULONG = 0x00000090; +pub const WIN32K_INIT_OR_RIT_FAILURE: ULONG = 0x00000091; +pub const UP_DRIVER_ON_MP_SYSTEM: ULONG = 0x00000092; +pub const INVALID_KERNEL_HANDLE: ULONG = 0x00000093; +pub const KERNEL_STACK_LOCKED_AT_EXIT: ULONG = 0x00000094; +pub const PNP_INTERNAL_ERROR: ULONG = 0x00000095; +pub const INVALID_WORK_QUEUE_ITEM: ULONG = 0x00000096; +pub const BOUND_IMAGE_UNSUPPORTED: ULONG = 0x00000097; +pub const END_OF_NT_EVALUATION_PERIOD: ULONG = 0x00000098; +pub const INVALID_REGION_OR_SEGMENT: ULONG = 0x00000099; +pub const SYSTEM_LICENSE_VIOLATION: ULONG = 0x0000009A; +pub const UDFS_FILE_SYSTEM: ULONG = 0x0000009B; +pub const MACHINE_CHECK_EXCEPTION: ULONG = 0x0000009C; +pub const USER_MODE_HEALTH_MONITOR: ULONG = 0x0000009E; +pub const DRIVER_POWER_STATE_FAILURE: ULONG = 0x0000009F; +pub const INTERNAL_POWER_ERROR: ULONG = 0x000000A0; +pub const PCI_BUS_DRIVER_INTERNAL: ULONG = 0x000000A1; +pub const MEMORY_IMAGE_CORRUPT: ULONG = 0x000000A2; +pub const ACPI_DRIVER_INTERNAL: ULONG = 0x000000A3; +pub const CNSS_FILE_SYSTEM_FILTER: ULONG = 0x000000A4; +pub const ACPI_BIOS_ERROR: ULONG = 0x000000A5; +pub const FP_EMULATION_ERROR: ULONG = 0x000000A6; +pub const BAD_EXHANDLE: ULONG = 0x000000A7; +pub const BOOTING_IN_SAFEMODE_MINIMAL: ULONG = 0x000000A8; +pub const BOOTING_IN_SAFEMODE_NETWORK: ULONG = 0x000000A9; +pub const BOOTING_IN_SAFEMODE_DSREPAIR: ULONG = 0x000000AA; +pub const SESSION_HAS_VALID_POOL_ON_EXIT: ULONG = 0x000000AB; +pub const HAL_MEMORY_ALLOCATION: ULONG = 0x000000AC; +pub const VIDEO_DRIVER_DEBUG_REPORT_REQUEST: ULONG = 0x400000AD; +pub const BGI_DETECTED_VIOLATION: ULONG = 0x000000B1; +pub const VIDEO_DRIVER_INIT_FAILURE: ULONG = 0x000000B4; +pub const BOOTLOG_LOADED: ULONG = 0x000000B5; +pub const BOOTLOG_NOT_LOADED: ULONG = 0x000000B6; +pub const BOOTLOG_ENABLED: ULONG = 0x000000B7; +pub const ATTEMPTED_SWITCH_FROM_DPC: ULONG = 0x000000B8; +pub const CHIPSET_DETECTED_ERROR: ULONG = 0x000000B9; +pub const SESSION_HAS_VALID_VIEWS_ON_EXIT: ULONG = 0x000000BA; +pub const NETWORK_BOOT_INITIALIZATION_FAILED: ULONG = 0x000000BB; +pub const NETWORK_BOOT_DUPLICATE_ADDRESS: ULONG = 0x000000BC; +pub const INVALID_HIBERNATED_STATE: ULONG = 0x000000BD; +pub const ATTEMPTED_WRITE_TO_READONLY_MEMORY: ULONG = 0x000000BE; +pub const MUTEX_ALREADY_OWNED: ULONG = 0x000000BF; +pub const PCI_CONFIG_SPACE_ACCESS_FAILURE: ULONG = 0x000000C0; +pub const SPECIAL_POOL_DETECTED_MEMORY_CORRUPTION: ULONG = 0x000000C1; +pub const BAD_POOL_CALLER: ULONG = 0x000000C2; +pub const SYSTEM_IMAGE_BAD_SIGNATURE: ULONG = 0x000000C3; +pub const DRIVER_VERIFIER_DETECTED_VIOLATION: ULONG = 0x000000C4; +pub const DRIVER_CORRUPTED_EXPOOL: ULONG = 0x000000C5; +pub const DRIVER_CAUGHT_MODIFYING_FREED_POOL: ULONG = 0x000000C6; +pub const TIMER_OR_DPC_INVALID: ULONG = 0x000000C7; +pub const IRQL_UNEXPECTED_VALUE: ULONG = 0x000000C8; +pub const DRIVER_VERIFIER_IOMANAGER_VIOLATION: ULONG = 0x000000C9; +pub const PNP_DETECTED_FATAL_ERROR: ULONG = 0x000000CA; +pub const DRIVER_LEFT_LOCKED_PAGES_IN_PROCESS: ULONG = 0x000000CB; +pub const PAGE_FAULT_IN_FREED_SPECIAL_POOL: ULONG = 0x000000CC; +pub const PAGE_FAULT_BEYOND_END_OF_ALLOCATION: ULONG = 0x000000CD; +pub const DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS: ULONG = 0x000000CE; +pub const TERMINAL_SERVER_DRIVER_MADE_INCORRECT_MEMORY_REFERENCE: ULONG = 0x000000CF; +pub const DRIVER_CORRUPTED_MMPOOL: ULONG = 0x000000D0; +pub const DRIVER_IRQL_NOT_LESS_OR_EQUAL: ULONG = 0x000000D1; +pub const BUGCODE_ID_DRIVER: ULONG = 0x000000D2; +pub const DRIVER_PORTION_MUST_BE_NONPAGED: ULONG = 0x000000D3; +pub const SYSTEM_SCAN_AT_RAISED_IRQL_CAUGHT_IMPROPER_DRIVER_UNLOAD: ULONG = 0x000000D4; +pub const DRIVER_PAGE_FAULT_IN_FREED_SPECIAL_POOL: ULONG = 0x000000D5; +pub const DRIVER_PAGE_FAULT_BEYOND_END_OF_ALLOCATION: ULONG = 0x000000D6; +pub const DRIVER_PAGE_FAULT_BEYOND_END_OF_ALLOCATION_M: ULONG = 0x100000D6; +pub const DRIVER_UNMAPPING_INVALID_VIEW: ULONG = 0x000000D7; +pub const DRIVER_USED_EXCESSIVE_PTES: ULONG = 0x000000D8; +pub const LOCKED_PAGES_TRACKER_CORRUPTION: ULONG = 0x000000D9; +pub const SYSTEM_PTE_MISUSE: ULONG = 0x000000DA; +pub const DRIVER_CORRUPTED_SYSPTES: ULONG = 0x000000DB; +pub const DRIVER_INVALID_STACK_ACCESS: ULONG = 0x000000DC; +pub const POOL_CORRUPTION_IN_FILE_AREA: ULONG = 0x000000DE; +pub const IMPERSONATING_WORKER_THREAD: ULONG = 0x000000DF; +pub const ACPI_BIOS_FATAL_ERROR: ULONG = 0x000000E0; +pub const WORKER_THREAD_RETURNED_AT_BAD_IRQL: ULONG = 0x000000E1; +pub const MANUALLY_INITIATED_CRASH: ULONG = 0x000000E2; +pub const RESOURCE_NOT_OWNED: ULONG = 0x000000E3; +pub const WORKER_INVALID: ULONG = 0x000000E4; +pub const POWER_FAILURE_SIMULATE: ULONG = 0x000000E5; +pub const DRIVER_VERIFIER_DMA_VIOLATION: ULONG = 0x000000E6; +pub const INVALID_FLOATING_POINT_STATE: ULONG = 0x000000E7; +pub const INVALID_CANCEL_OF_FILE_OPEN: ULONG = 0x000000E8; +pub const ACTIVE_EX_WORKER_THREAD_TERMINATION: ULONG = 0x000000E9; +pub const SAVER_UNSPECIFIED: ULONG = 0x0000F000; +pub const SAVER_BLANKSCREEN: ULONG = 0x0000F002; +pub const SAVER_INPUT: ULONG = 0x0000F003; +pub const SAVER_WATCHDOG: ULONG = 0x0000F004; +pub const SAVER_STARTNOTVISIBLE: ULONG = 0x0000F005; +pub const SAVER_NAVIGATIONMODEL: ULONG = 0x0000F006; +pub const SAVER_OUTOFMEMORY: ULONG = 0x0000F007; +pub const SAVER_GRAPHICS: ULONG = 0x0000F008; +pub const SAVER_NAVSERVERTIMEOUT: ULONG = 0x0000F009; +pub const SAVER_CHROMEPROCESSCRASH: ULONG = 0x0000F00A; +pub const SAVER_NOTIFICATIONDISMISSAL: ULONG = 0x0000F00B; +pub const SAVER_SPEECHDISMISSAL: ULONG = 0x0000F00C; +pub const SAVER_CALLDISMISSAL: ULONG = 0x0000F00D; +pub const SAVER_APPBARDISMISSAL: ULONG = 0x0000F00E; +pub const SAVER_RILADAPTATIONCRASH: ULONG = 0x0000F00F; +pub const SAVER_APPLISTUNREACHABLE: ULONG = 0x0000F010; +pub const SAVER_REPORTNOTIFICATIONFAILURE: ULONG = 0x0000F011; +pub const SAVER_UNEXPECTEDSHUTDOWN: ULONG = 0x0000F012; +pub const SAVER_RPCFAILURE: ULONG = 0x0000F013; +pub const SAVER_AUXILIARYFULLDUMP: ULONG = 0x0000F014; +pub const SAVER_ACCOUNTPROVSVCINITFAILURE: ULONG = 0x0000F015; +pub const SAVER_MTBFCOMMANDTIMEOUT: ULONG = 0x00000315; +pub const SAVER_MTBFCOMMANDHANG: ULONG = 0x0000F101; +pub const SAVER_MTBFPASSBUGCHECK: ULONG = 0x0000F102; +pub const SAVER_MTBFIOERROR: ULONG = 0x0000F103; +pub const SAVER_RENDERTHREADHANG: ULONG = 0x0000F200; +pub const SAVER_RENDERMOBILEUIOOM: ULONG = 0x0000F201; +pub const SAVER_DEVICEUPDATEUNSPECIFIED: ULONG = 0x0000F300; +pub const SAVER_AUDIODRIVERHANG: ULONG = 0x0000F400; +pub const SAVER_BATTERYPULLOUT: ULONG = 0x0000F500; +pub const SAVER_MEDIACORETESTHANG: ULONG = 0x0000F600; +pub const SAVER_RESOURCEMANAGEMENT: ULONG = 0x0000F700; +pub const SAVER_CAPTURESERVICE: ULONG = 0x0000F800; +pub const SAVER_WAITFORSHELLREADY: ULONG = 0x0000F900; +pub const SAVER_NONRESPONSIVEPROCESS: ULONG = 0x00000194; +pub const SAVER_SICKAPPLICATION: ULONG = 0x00008866; +pub const THREAD_STUCK_IN_DEVICE_DRIVER: ULONG = 0x000000EA; +pub const THREAD_STUCK_IN_DEVICE_DRIVER_M: ULONG = 0x100000EA; +pub const DIRTY_MAPPED_PAGES_CONGESTION: ULONG = 0x000000EB; +pub const SESSION_HAS_VALID_SPECIAL_POOL_ON_EXIT: ULONG = 0x000000EC; +pub const UNMOUNTABLE_BOOT_VOLUME: ULONG = 0x000000ED; +pub const CRITICAL_PROCESS_DIED: ULONG = 0x000000EF; +pub const STORAGE_MINIPORT_ERROR: ULONG = 0x000000F0; +pub const SCSI_VERIFIER_DETECTED_VIOLATION: ULONG = 0x000000F1; +pub const HARDWARE_INTERRUPT_STORM: ULONG = 0x000000F2; +pub const DISORDERLY_SHUTDOWN: ULONG = 0x000000F3; +pub const CRITICAL_OBJECT_TERMINATION: ULONG = 0x000000F4; +pub const FLTMGR_FILE_SYSTEM: ULONG = 0x000000F5; +pub const PCI_VERIFIER_DETECTED_VIOLATION: ULONG = 0x000000F6; +pub const DRIVER_OVERRAN_STACK_BUFFER: ULONG = 0x000000F7; +pub const RAMDISK_BOOT_INITIALIZATION_FAILED: ULONG = 0x000000F8; +pub const DRIVER_RETURNED_STATUS_REPARSE_FOR_VOLUME_OPEN: ULONG = 0x000000F9; +pub const HTTP_DRIVER_CORRUPTED: ULONG = 0x000000FA; +pub const RECURSIVE_MACHINE_CHECK: ULONG = 0x000000FB; +pub const ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY: ULONG = 0x000000FC; +pub const DIRTY_NOWRITE_PAGES_CONGESTION: ULONG = 0x000000FD; +pub const BUGCODE_USB_DRIVER: ULONG = 0x000000FE; +pub const BC_BLUETOOTH_VERIFIER_FAULT: ULONG = 0x00000BFE; +pub const BC_BTHMINI_VERIFIER_FAULT: ULONG = 0x00000BFF; +pub const RESERVE_QUEUE_OVERFLOW: ULONG = 0x000000FF; +pub const LOADER_BLOCK_MISMATCH: ULONG = 0x00000100; +pub const CLOCK_WATCHDOG_TIMEOUT: ULONG = 0x00000101; +pub const DPC_WATCHDOG_TIMEOUT: ULONG = 0x00000102; +pub const MUP_FILE_SYSTEM: ULONG = 0x00000103; +pub const AGP_INVALID_ACCESS: ULONG = 0x00000104; +pub const AGP_GART_CORRUPTION: ULONG = 0x00000105; +pub const AGP_ILLEGALLY_REPROGRAMMED: ULONG = 0x00000106; +pub const KERNEL_EXPAND_STACK_ACTIVE: ULONG = 0x00000107; +pub const THIRD_PARTY_FILE_SYSTEM_FAILURE: ULONG = 0x00000108; +pub const CRITICAL_STRUCTURE_CORRUPTION: ULONG = 0x00000109; +pub const APP_TAGGING_INITIALIZATION_FAILED: ULONG = 0x0000010A; +pub const DFSC_FILE_SYSTEM: ULONG = 0x0000010B; +pub const FSRTL_EXTRA_CREATE_PARAMETER_VIOLATION: ULONG = 0x0000010C; +pub const WDF_VIOLATION: ULONG = 0x0000010D; +pub const VIDEO_MEMORY_MANAGEMENT_INTERNAL: ULONG = 0x0000010E; +pub const DRIVER_INVALID_CRUNTIME_PARAMETER: ULONG = 0x00000110; +pub const RECURSIVE_NMI: ULONG = 0x00000111; +pub const MSRPC_STATE_VIOLATION: ULONG = 0x00000112; +pub const VIDEO_DXGKRNL_FATAL_ERROR: ULONG = 0x00000113; +pub const VIDEO_SHADOW_DRIVER_FATAL_ERROR: ULONG = 0x00000114; +pub const AGP_INTERNAL: ULONG = 0x00000115; +pub const VIDEO_TDR_FAILURE: ULONG = 0x00000116; +pub const VIDEO_TDR_TIMEOUT_DETECTED: ULONG = 0x00000117; +pub const NTHV_GUEST_ERROR: ULONG = 0x00000118; +pub const VIDEO_SCHEDULER_INTERNAL_ERROR: ULONG = 0x00000119; +pub const EM_INITIALIZATION_ERROR: ULONG = 0x0000011A; +pub const DRIVER_RETURNED_HOLDING_CANCEL_LOCK: ULONG = 0x0000011B; +pub const ATTEMPTED_WRITE_TO_CM_PROTECTED_STORAGE: ULONG = 0x0000011C; +pub const EVENT_TRACING_FATAL_ERROR: ULONG = 0x0000011D; +pub const TOO_MANY_RECURSIVE_FAULTS: ULONG = 0x0000011E; +pub const INVALID_DRIVER_HANDLE: ULONG = 0x0000011F; +pub const BITLOCKER_FATAL_ERROR: ULONG = 0x00000120; +pub const DRIVER_VIOLATION: ULONG = 0x00000121; +pub const WHEA_INTERNAL_ERROR: ULONG = 0x00000122; +pub const CRYPTO_SELF_TEST_FAILURE: ULONG = 0x00000123; +pub const WHEA_UNCORRECTABLE_ERROR: ULONG = 0x00000124; +pub const NMR_INVALID_STATE: ULONG = 0x00000125; +pub const NETIO_INVALID_POOL_CALLER: ULONG = 0x00000126; +pub const PAGE_NOT_ZERO: ULONG = 0x00000127; +pub const WORKER_THREAD_RETURNED_WITH_BAD_IO_PRIORITY: ULONG = 0x00000128; +pub const WORKER_THREAD_RETURNED_WITH_BAD_PAGING_IO_PRIORITY: ULONG = 0x00000129; +pub const MUI_NO_VALID_SYSTEM_LANGUAGE: ULONG = 0x0000012A; +pub const FAULTY_HARDWARE_CORRUPTED_PAGE: ULONG = 0x0000012B; +pub const EXFAT_FILE_SYSTEM: ULONG = 0x0000012C; +pub const VOLSNAP_OVERLAPPED_TABLE_ACCESS: ULONG = 0x0000012D; +pub const INVALID_MDL_RANGE: ULONG = 0x0000012E; +pub const VHD_BOOT_INITIALIZATION_FAILED: ULONG = 0x0000012F; +pub const DYNAMIC_ADD_PROCESSOR_MISMATCH: ULONG = 0x00000130; +pub const INVALID_EXTENDED_PROCESSOR_STATE: ULONG = 0x00000131; +pub const RESOURCE_OWNER_POINTER_INVALID: ULONG = 0x00000132; +pub const DPC_WATCHDOG_VIOLATION: ULONG = 0x00000133; +pub const DRIVE_EXTENDER: ULONG = 0x00000134; +pub const REGISTRY_FILTER_DRIVER_EXCEPTION: ULONG = 0x00000135; +pub const VHD_BOOT_HOST_VOLUME_NOT_ENOUGH_SPACE: ULONG = 0x00000136; +pub const WIN32K_HANDLE_MANAGER: ULONG = 0x00000137; +pub const GPIO_CONTROLLER_DRIVER_ERROR: ULONG = 0x00000138; +pub const KERNEL_SECURITY_CHECK_FAILURE: ULONG = 0x00000139; +pub const KERNEL_MODE_HEAP_CORRUPTION: ULONG = 0x0000013A; +pub const PASSIVE_INTERRUPT_ERROR: ULONG = 0x0000013B; +pub const INVALID_IO_BOOST_STATE: ULONG = 0x0000013C; +pub const CRITICAL_INITIALIZATION_FAILURE: ULONG = 0x0000013D; +pub const ERRATA_WORKAROUND_UNSUCCESSFUL: ULONG = 0x0000013E; +pub const STORAGE_DEVICE_ABNORMALITY_DETECTED: ULONG = 0x00000140; +pub const VIDEO_ENGINE_TIMEOUT_DETECTED: ULONG = 0x00000141; +pub const VIDEO_TDR_APPLICATION_BLOCKED: ULONG = 0x00000142; +pub const PROCESSOR_DRIVER_INTERNAL: ULONG = 0x00000143; +pub const BUGCODE_USB3_DRIVER: ULONG = 0x00000144; +pub const SECURE_BOOT_VIOLATION: ULONG = 0x00000145; +pub const NDIS_NET_BUFFER_LIST_INFO_ILLEGALLY_TRANSFERRED: ULONG = 0x00000146; +pub const ABNORMAL_RESET_DETECTED: ULONG = 0x00000147; +pub const IO_OBJECT_INVALID: ULONG = 0x00000148; +pub const REFS_FILE_SYSTEM: ULONG = 0x00000149; +pub const KERNEL_WMI_INTERNAL: ULONG = 0x0000014A; +pub const SOC_SUBSYSTEM_FAILURE: ULONG = 0x0000014B; +pub const FATAL_ABNORMAL_RESET_ERROR: ULONG = 0x0000014C; +pub const EXCEPTION_SCOPE_INVALID: ULONG = 0x0000014D; +pub const SOC_CRITICAL_DEVICE_REMOVED: ULONG = 0x0000014E; +pub const PDC_WATCHDOG_TIMEOUT: ULONG = 0x0000014F; +pub const TCPIP_AOAC_NIC_ACTIVE_REFERENCE_LEAK: ULONG = 0x00000150; +pub const UNSUPPORTED_INSTRUCTION_MODE: ULONG = 0x00000151; +pub const INVALID_PUSH_LOCK_FLAGS: ULONG = 0x00000152; +pub const KERNEL_LOCK_ENTRY_LEAKED_ON_THREAD_TERMINATION: ULONG = 0x00000153; +pub const UNEXPECTED_STORE_EXCEPTION: ULONG = 0x00000154; +pub const OS_DATA_TAMPERING: ULONG = 0x00000155; +pub const WINSOCK_DETECTED_HUNG_CLOSESOCKET_LIVEDUMP: ULONG = 0x00000156; +pub const KERNEL_THREAD_PRIORITY_FLOOR_VIOLATION: ULONG = 0x00000157; +pub const ILLEGAL_IOMMU_PAGE_FAULT: ULONG = 0x00000158; +pub const HAL_ILLEGAL_IOMMU_PAGE_FAULT: ULONG = 0x00000159; +pub const SDBUS_INTERNAL_ERROR: ULONG = 0x0000015A; +pub const WORKER_THREAD_RETURNED_WITH_SYSTEM_PAGE_PRIORITY_ACTIVE: ULONG = 0x0000015B; +pub const PDC_WATCHDOG_TIMEOUT_LIVEDUMP: ULONG = 0x0000015C; +pub const SOC_SUBSYSTEM_FAILURE_LIVEDUMP: ULONG = 0x0000015D; +pub const BUGCODE_NDIS_DRIVER_LIVE_DUMP: ULONG = 0x0000015E; +pub const CONNECTED_STANDBY_WATCHDOG_TIMEOUT_LIVEDUMP: ULONG = 0x0000015F; +pub const WIN32K_ATOMIC_CHECK_FAILURE: ULONG = 0x00000160; +pub const LIVE_SYSTEM_DUMP: ULONG = 0x00000161; +pub const KERNEL_AUTO_BOOST_INVALID_LOCK_RELEASE: ULONG = 0x00000162; +pub const WORKER_THREAD_TEST_CONDITION: ULONG = 0x00000163; +pub const WIN32K_CRITICAL_FAILURE: ULONG = 0x00000164; +pub const CLUSTER_CSV_STATUS_IO_TIMEOUT_LIVEDUMP: ULONG = 0x00000165; +pub const CLUSTER_RESOURCE_CALL_TIMEOUT_LIVEDUMP: ULONG = 0x00000166; +pub const CLUSTER_CSV_SNAPSHOT_DEVICE_INFO_TIMEOUT_LIVEDUMP: ULONG = 0x00000167; +pub const CLUSTER_CSV_STATE_TRANSITION_TIMEOUT_LIVEDUMP: ULONG = 0x00000168; +pub const CLUSTER_CSV_VOLUME_ARRIVAL_LIVEDUMP: ULONG = 0x00000169; +pub const CLUSTER_CSV_VOLUME_REMOVAL_LIVEDUMP: ULONG = 0x0000016A; +pub const CLUSTER_CSV_CLUSTER_WATCHDOG_LIVEDUMP: ULONG = 0x0000016B; +pub const INVALID_RUNDOWN_PROTECTION_FLAGS: ULONG = 0x0000016C; +pub const INVALID_SLOT_ALLOCATOR_FLAGS: ULONG = 0x0000016D; +pub const ERESOURCE_INVALID_RELEASE: ULONG = 0x0000016E; +pub const CLUSTER_CSV_STATE_TRANSITION_INTERVAL_TIMEOUT_LIVEDUMP: ULONG = 0x0000016F; +pub const CLUSTER_CSV_CLUSSVC_DISCONNECT_WATCHDOG: ULONG = 0x00000170; +pub const CRYPTO_LIBRARY_INTERNAL_ERROR: ULONG = 0x00000171; +pub const COREMSGCALL_INTERNAL_ERROR: ULONG = 0x00000173; +pub const COREMSG_INTERNAL_ERROR: ULONG = 0x00000174; +pub const PREVIOUS_FATAL_ABNORMAL_RESET_ERROR: ULONG = 0x00000175; +pub const ELAM_DRIVER_DETECTED_FATAL_ERROR: ULONG = 0x00000178; +pub const PDC_LOCK_WATCHDOG_LIVEDUMP: ULONG = 0x0000017C; +pub const PDC_UNEXPECTED_REVOCATION_LIVEDUMP: ULONG = 0x0000017D; +pub const WVR_LIVEDUMP_REPLICATION_IOCONTEXT_TIMEOUT: ULONG = 0x00000180; +pub const WVR_LIVEDUMP_STATE_TRANSITION_TIMEOUT: ULONG = 0x00000181; +pub const WVR_LIVEDUMP_RECOVERY_IOCONTEXT_TIMEOUT: ULONG = 0x00000182; +pub const WVR_LIVEDUMP_APP_IO_TIMEOUT: ULONG = 0x00000183; +pub const WVR_LIVEDUMP_MANUALLY_INITIATED: ULONG = 0x00000184; +pub const WVR_LIVEDUMP_STATE_FAILURE: ULONG = 0x00000185; +pub const WVR_LIVEDUMP_CRITICAL_ERROR: ULONG = 0x00000186; +pub const VIDEO_DWMINIT_TIMEOUT_FALLBACK_BDD: ULONG = 0x00000187; +pub const CLUSTER_CSVFS_LIVEDUMP: ULONG = 0x00000188; +pub const BAD_OBJECT_HEADER: ULONG = 0x00000189; +pub const SILO_CORRUPT: ULONG = 0x0000018A; +pub const SECURE_KERNEL_ERROR: ULONG = 0x0000018B; +pub const HYPERGUARD_VIOLATION: ULONG = 0x0000018C; +pub const WIN32K_CRITICAL_FAILURE_LIVEDUMP: ULONG = 0x00000190; +pub const PF_DETECTED_CORRUPTION: ULONG = 0x00000191; +pub const KERNEL_AUTO_BOOST_LOCK_ACQUISITION_WITH_RAISED_IRQL: ULONG = 0x00000192; +pub const VIDEO_DXGKRNL_LIVEDUMP: ULONG = 0x00000193; +pub const KERNEL_STORAGE_SLOT_IN_USE: ULONG = 0x00000199; +pub const SMB_SERVER_LIVEDUMP: ULONG = 0x00000195; +pub const LOADER_ROLLBACK_DETECTED: ULONG = 0x00000196; +pub const WIN32K_SECURITY_FAILURE: ULONG = 0x00000197; +pub const UFX_LIVEDUMP: ULONG = 0x00000198; +pub const WORKER_THREAD_RETURNED_WHILE_ATTACHED_TO_SILO: ULONG = 0x0000019A; +pub const TTM_FATAL_ERROR: ULONG = 0x0000019B; +pub const WIN32K_POWER_WATCHDOG_TIMEOUT: ULONG = 0x0000019C; +pub const CLUSTER_SVHDX_LIVEDUMP: ULONG = 0x0000019D; +pub const DRIVER_VERIFIER_DETECTED_VIOLATION_LIVEDUMP: ULONG = 0x000001C4; +pub const IO_THREADPOOL_DEADLOCK_LIVEDUMP: ULONG = 0x000001C5; +pub const XBOX_CORRUPTED_IMAGE: ULONG = 0x00000357; +pub const XBOX_INVERTED_FUNCTION_TABLE_OVERFLOW: ULONG = 0x00000358; +pub const XBOX_CORRUPTED_IMAGE_BASE: ULONG = 0x00000359; +pub const XBOX_360_SYSTEM_CRASH: ULONG = 0x00000360; +pub const XBOX_360_SYSTEM_CRASH_RESERVED: ULONG = 0x00000420; +pub const HYPERVISOR_ERROR: ULONG = 0x00020001; +pub const WINLOGON_FATAL_ERROR: ULONG = 0xC000021A; +pub const MANUALLY_INITIATED_CRASH1: ULONG = 0xDEADDEAD; +pub const BUGCHECK_CONTEXT_MODIFIER: ULONG = 0x80000000; diff --git a/bash-5.1/vendor/winapi/src/shared/cderr.rs b/bash-5.1/vendor/winapi/src/shared/cderr.rs new file mode 100644 index 0000000000000000000000000000000000000000..07ea187ece8ef6fd69276a2f96e6d1bfca16ab8c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/cderr.rs @@ -0,0 +1,44 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Common dialog error return codes +use shared::minwindef::DWORD; +pub const CDERR_DIALOGFAILURE: DWORD = 0xFFFF; +pub const CDERR_GENERALCODES: DWORD = 0x0000; +pub const CDERR_STRUCTSIZE: DWORD = 0x0001; +pub const CDERR_INITIALIZATION: DWORD = 0x0002; +pub const CDERR_NOTEMPLATE: DWORD = 0x0003; +pub const CDERR_NOHINSTANCE: DWORD = 0x0004; +pub const CDERR_LOADSTRFAILURE: DWORD = 0x0005; +pub const CDERR_FINDRESFAILURE: DWORD = 0x0006; +pub const CDERR_LOADRESFAILURE: DWORD = 0x0007; +pub const CDERR_LOCKRESFAILURE: DWORD = 0x0008; +pub const CDERR_MEMALLOCFAILURE: DWORD = 0x0009; +pub const CDERR_MEMLOCKFAILURE: DWORD = 0x000A; +pub const CDERR_NOHOOK: DWORD = 0x000B; +pub const CDERR_REGISTERMSGFAIL: DWORD = 0x000C; +pub const PDERR_PRINTERCODES: DWORD = 0x1000; +pub const PDERR_SETUPFAILURE: DWORD = 0x1001; +pub const PDERR_PARSEFAILURE: DWORD = 0x1002; +pub const PDERR_RETDEFFAILURE: DWORD = 0x1003; +pub const PDERR_LOADDRVFAILURE: DWORD = 0x1004; +pub const PDERR_GETDEVMODEFAIL: DWORD = 0x1005; +pub const PDERR_INITFAILURE: DWORD = 0x1006; +pub const PDERR_NODEVICES: DWORD = 0x1007; +pub const PDERR_NODEFAULTPRN: DWORD = 0x1008; +pub const PDERR_DNDMMISMATCH: DWORD = 0x1009; +pub const PDERR_CREATEICFAILURE: DWORD = 0x100A; +pub const PDERR_PRINTERNOTFOUND: DWORD = 0x100B; +pub const PDERR_DEFAULTDIFFERENT: DWORD = 0x100C; +pub const CFERR_CHOOSEFONTCODES: DWORD = 0x2000; +pub const CFERR_NOFONTS: DWORD = 0x2001; +pub const CFERR_MAXLESSTHANMIN: DWORD = 0x2002; +pub const FNERR_FILENAMECODES: DWORD = 0x3000; +pub const FNERR_SUBCLASSFAILURE: DWORD = 0x3001; +pub const FNERR_INVALIDFILENAME: DWORD = 0x3002; +pub const FNERR_BUFFERTOOSMALL: DWORD = 0x3003; +pub const FRERR_FINDREPLACECODES: DWORD = 0x4000; +pub const FRERR_BUFFERLENGTHZERO: DWORD = 0x4001; +pub const CCERR_CHOOSECOLORCODES: DWORD = 0x5000; diff --git a/bash-5.1/vendor/winapi/src/shared/cfg.rs b/bash-5.1/vendor/winapi/src/shared/cfg.rs new file mode 100644 index 0000000000000000000000000000000000000000..4abe3838bfbb6064bd83e6c68dd6003d4af10cab --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/cfg.rs @@ -0,0 +1,138 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! common Configuration Manager definitions for both user mode and kernel mode code +use shared::minwindef::{DWORD, ULONG}; +ENUM!{enum PNP_VETO_TYPE { + PNP_VetoTypeUnknown, + PNP_VetoLegacyDevice, + PNP_VetoPendingClose, + PNP_VetoWindowsApp, + PNP_VetoWindowsService, + PNP_VetoOutstandingOpen, + PNP_VetoDevice, + PNP_VetoDriver, + PNP_VetoIllegalDeviceRequest, + PNP_VetoInsufficientPower, + PNP_VetoNonDisableable, + PNP_VetoLegacyDriver, + PNP_VetoInsufficientRights, +}} +pub type PPNP_VETO_TYPE = *mut PNP_VETO_TYPE; +pub const CM_PROB_NOT_CONFIGURED: DWORD = 0x00000001; +pub const CM_PROB_DEVLOADER_FAILED: DWORD = 0x00000002; +pub const CM_PROB_OUT_OF_MEMORY: DWORD = 0x00000003; +pub const CM_PROB_ENTRY_IS_WRONG_TYPE: DWORD = 0x00000004; +pub const CM_PROB_LACKED_ARBITRATOR: DWORD = 0x00000005; +pub const CM_PROB_BOOT_CONFIG_CONFLICT: DWORD = 0x00000006; +pub const CM_PROB_FAILED_FILTER: DWORD = 0x00000007; +pub const CM_PROB_DEVLOADER_NOT_FOUND: DWORD = 0x00000008; +pub const CM_PROB_INVALID_DATA: DWORD = 0x00000009; +pub const CM_PROB_FAILED_START: DWORD = 0x0000000A; +pub const CM_PROB_LIAR: DWORD = 0x0000000B; +pub const CM_PROB_NORMAL_CONFLICT: DWORD = 0x0000000C; +pub const CM_PROB_NOT_VERIFIED: DWORD = 0x0000000D; +pub const CM_PROB_NEED_RESTART: DWORD = 0x0000000E; +pub const CM_PROB_REENUMERATION: DWORD = 0x0000000F; +pub const CM_PROB_PARTIAL_LOG_CONF: DWORD = 0x00000010; +pub const CM_PROB_UNKNOWN_RESOURCE: DWORD = 0x00000011; +pub const CM_PROB_REINSTALL: DWORD = 0x00000012; +pub const CM_PROB_REGISTRY: DWORD = 0x00000013; +pub const CM_PROB_VXDLDR: DWORD = 0x00000014; +pub const CM_PROB_WILL_BE_REMOVED: DWORD = 0x00000015; +pub const CM_PROB_DISABLED: DWORD = 0x00000016; +pub const CM_PROB_DEVLOADER_NOT_READY: DWORD = 0x00000017; +pub const CM_PROB_DEVICE_NOT_THERE: DWORD = 0x00000018; +pub const CM_PROB_MOVED: DWORD = 0x00000019; +pub const CM_PROB_TOO_EARLY: DWORD = 0x0000001A; +pub const CM_PROB_NO_VALID_LOG_CONF: DWORD = 0x0000001B; +pub const CM_PROB_FAILED_INSTALL: DWORD = 0x0000001C; +pub const CM_PROB_HARDWARE_DISABLED: DWORD = 0x0000001D; +pub const CM_PROB_CANT_SHARE_IRQ: DWORD = 0x0000001E; +pub const CM_PROB_FAILED_ADD: DWORD = 0x0000001F; +pub const CM_PROB_DISABLED_SERVICE: DWORD = 0x00000020; +pub const CM_PROB_TRANSLATION_FAILED: DWORD = 0x00000021; +pub const CM_PROB_NO_SOFTCONFIG: DWORD = 0x00000022; +pub const CM_PROB_BIOS_TABLE: DWORD = 0x00000023; +pub const CM_PROB_IRQ_TRANSLATION_FAILED: DWORD = 0x00000024; +pub const CM_PROB_FAILED_DRIVER_ENTRY: DWORD = 0x00000025; +pub const CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD: DWORD = 0x00000026; +pub const CM_PROB_DRIVER_FAILED_LOAD: DWORD = 0x00000027; +pub const CM_PROB_DRIVER_SERVICE_KEY_INVALID: DWORD = 0x00000028; +pub const CM_PROB_LEGACY_SERVICE_NO_DEVICES: DWORD = 0x00000029; +pub const CM_PROB_DUPLICATE_DEVICE: DWORD = 0x0000002A; +pub const CM_PROB_FAILED_POST_START: DWORD = 0x0000002B; +pub const CM_PROB_HALTED: DWORD = 0x0000002C; +pub const CM_PROB_PHANTOM: DWORD = 0x0000002D; +pub const CM_PROB_SYSTEM_SHUTDOWN: DWORD = 0x0000002E; +pub const CM_PROB_HELD_FOR_EJECT: DWORD = 0x0000002F; +pub const CM_PROB_DRIVER_BLOCKED: DWORD = 0x00000030; +pub const CM_PROB_REGISTRY_TOO_LARGE: DWORD = 0x00000031; +pub const CM_PROB_SETPROPERTIES_FAILED: DWORD = 0x00000032; +pub const CM_PROB_WAITING_ON_DEPENDENCY: DWORD = 0x00000033; +pub const CM_PROB_UNSIGNED_DRIVER: DWORD = 0x00000034; +pub const CM_PROB_USED_BY_DEBUGGER: DWORD = 0x00000035; +pub const NUM_CM_PROB_V1: DWORD = 0x00000025; +pub const NUM_CM_PROB_V2: DWORD = 0x00000032; +pub const NUM_CM_PROB_V3: DWORD = 0x00000033; +pub const NUM_CM_PROB_V4: DWORD = 0x00000034; +pub const NUM_CM_PROB_V5: DWORD = 0x00000035; +pub const NUM_CM_PROB_V6: DWORD = 0x00000036; +pub const DN_ROOT_ENUMERATED: DWORD = 0x00000001; +pub const DN_DRIVER_LOADED: DWORD = 0x00000002; +pub const DN_ENUM_LOADED: DWORD = 0x00000004; +pub const DN_STARTED: DWORD = 0x00000008; +pub const DN_MANUAL: DWORD = 0x00000010; +pub const DN_NEED_TO_ENUM: DWORD = 0x00000020; +pub const DN_NOT_FIRST_TIME: DWORD = 0x00000040; +pub const DN_HARDWARE_ENUM: DWORD = 0x00000080; +pub const DN_LIAR: DWORD = 0x00000100; +pub const DN_HAS_MARK: DWORD = 0x00000200; +pub const DN_HAS_PROBLEM: DWORD = 0x00000400; +pub const DN_FILTERED: DWORD = 0x00000800; +pub const DN_MOVED: DWORD = 0x00001000; +pub const DN_DISABLEABLE: DWORD = 0x00002000; +pub const DN_REMOVABLE: DWORD = 0x00004000; +pub const DN_PRIVATE_PROBLEM: DWORD = 0x00008000; +pub const DN_MF_PARENT: DWORD = 0x00010000; +pub const DN_MF_CHILD: DWORD = 0x00020000; +pub const DN_WILL_BE_REMOVED: DWORD = 0x00040000; +pub const DN_NOT_FIRST_TIMEE: DWORD = 0x00080000; +pub const DN_STOP_FREE_RES: DWORD = 0x00100000; +pub const DN_REBAL_CANDIDATE: DWORD = 0x00200000; +pub const DN_BAD_PARTIAL: DWORD = 0x00400000; +pub const DN_NT_ENUMERATOR: DWORD = 0x00800000; +pub const DN_NT_DRIVER: DWORD = 0x01000000; +pub const DN_NEEDS_LOCKING: DWORD = 0x02000000; +pub const DN_ARM_WAKEUP: DWORD = 0x04000000; +pub const DN_APM_ENUMERATOR: DWORD = 0x08000000; +pub const DN_APM_DRIVER: DWORD = 0x10000000; +pub const DN_SILENT_INSTALL: DWORD = 0x20000000; +pub const DN_NO_SHOW_IN_DM: DWORD = 0x40000000; +pub const DN_BOOT_LOG_PROB: DWORD = 0x80000000; +pub const DN_NEED_RESTART: DWORD = DN_LIAR; +pub const DN_DRIVER_BLOCKED: DWORD = DN_NOT_FIRST_TIME; +pub const DN_LEGACY_DRIVER: DWORD = DN_MOVED; +pub const DN_CHILD_WITH_INVALID_ID: DWORD = DN_HAS_MARK; +pub const DN_DEVICE_DISCONNECTED: DWORD = DN_NEEDS_LOCKING; +pub const DN_CHANGEABLE_FLAGS: DWORD = DN_NOT_FIRST_TIME + DN_HARDWARE_ENUM + DN_HAS_MARK + + DN_DISABLEABLE + DN_REMOVABLE + DN_MF_CHILD + DN_MF_PARENT + DN_NOT_FIRST_TIMEE + + DN_STOP_FREE_RES + DN_REBAL_CANDIDATE + DN_NT_ENUMERATOR + DN_NT_DRIVER + DN_SILENT_INSTALL + + DN_NO_SHOW_IN_DM; +pub const LCPRI_FORCECONFIG: ULONG = 0x00000000; +pub const LCPRI_BOOTCONFIG: ULONG = 0x00000001; +pub const LCPRI_DESIRED: ULONG = 0x00002000; +pub const LCPRI_NORMAL: ULONG = 0x00003000; +pub const LCPRI_LASTBESTCONFIG: ULONG = 0x00003FFF; +pub const LCPRI_SUBOPTIMAL: ULONG = 0x00005000; +pub const LCPRI_LASTSOFTCONFIG: ULONG = 0x00007FFF; +pub const LCPRI_RESTART: ULONG = 0x00008000; +pub const LCPRI_REBOOT: ULONG = 0x00009000; +pub const LCPRI_POWEROFF: ULONG = 0x0000A000; +pub const LCPRI_HARDRECONFIG: ULONG = 0x0000C000; +pub const LCPRI_HARDWIRED: ULONG = 0x0000E000; +pub const LCPRI_IMPOSSIBLE: ULONG = 0x0000F000; +pub const LCPRI_DISABLED: ULONG = 0x0000FFFF; +pub const MAX_LCPRI: ULONG = 0x0000FFFF; diff --git a/bash-5.1/vendor/winapi/src/shared/d3d9.rs b/bash-5.1/vendor/winapi/src/shared/d3d9.rs new file mode 100644 index 0000000000000000000000000000000000000000..437c81111933e84bf255c1dacda6c7f8b998c5af --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/d3d9.rs @@ -0,0 +1,1268 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Direct3D include file +use shared::basetsd::UINT32; +use shared::d3d9caps::{D3DCAPS9, D3DCONTENTPROTECTIONCAPS, D3DOVERLAYCAPS}; +use shared::d3d9types::{ + D3DADAPTER_IDENTIFIER9, D3DAUTHENTICATEDCHANNELTYPE, D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT, + D3DBACKBUFFER_TYPE, D3DBOX, D3DCLIPSTATUS9, D3DCOLOR, D3DCOMPOSERECTSOP, D3DCUBEMAP_FACES, + D3DDEVICE_CREATION_PARAMETERS, D3DDEVTYPE, D3DDISPLAYMODE, D3DDISPLAYMODEEX, + D3DDISPLAYMODEFILTER, D3DDISPLAYROTATION, D3DENCRYPTED_BLOCK_INFO, D3DFORMAT, D3DGAMMARAMP, + D3DINDEXBUFFER_DESC, D3DLIGHT9, D3DLOCKED_BOX, D3DLOCKED_RECT, D3DMATERIAL9, D3DMATRIX, + D3DMULTISAMPLE_TYPE, D3DPOOL, D3DPRESENTSTATS, D3DPRESENT_PARAMETERS, D3DPRIMITIVETYPE, + D3DQUERYTYPE, D3DRASTER_STATUS, D3DRECT, D3DRECTPATCH_INFO, D3DRENDERSTATETYPE, + D3DRESOURCETYPE, D3DSAMPLERSTATETYPE, D3DSTATEBLOCKTYPE, D3DSURFACE_DESC, D3DTEXTUREFILTERTYPE, + D3DTEXTURESTAGESTATETYPE, D3DTRANSFORMSTATETYPE, D3DTRIPATCH_INFO, D3DVERTEXBUFFER_DESC, + D3DVERTEXELEMENT9, D3DVIEWPORT9, D3DVOLUME_DESC, +}; +use shared::guiddef::{GUID, IID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT, INT, UINT}; +use shared::windef::{HDC, HMONITOR, HWND, POINT, RECT}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::wingdi::{PALETTEENTRY, RGNDATA}; +use um::winnt::{HANDLE, HRESULT, LPCWSTR, LUID, VOID}; +pub const D3D_SDK_VERSION: DWORD = 32; +pub const D3D9b_SDK_VERSION: DWORD = 31; +DEFINE_GUID!{IID_IDirect3D9, + 0x81bdcbca, 0x64d4, 0x426d, 0xae, 0x8d, 0xad, 0x01, 0x47, 0xf4, 0x27, 0x5c} +DEFINE_GUID!{IID_IDirect3DDevice9, + 0xd0223b96, 0xbf7a, 0x43fd, 0x92, 0xbd, 0xa4, 0x3b, 0x0d, 0x82, 0xb9, 0xeb} +DEFINE_GUID!{IID_IDirect3DResource9, + 0x05eec05d, 0x8f7d, 0x4362, 0xb9, 0x99, 0xd1, 0xba, 0xf3, 0x57, 0xc7, 0x04} +DEFINE_GUID!{IID_IDirect3DBaseTexture9, + 0x580ca87e, 0x1d3c, 0x4d54, 0x99, 0x1d, 0xb7, 0xd3, 0xe3, 0xc2, 0x98, 0xce} +DEFINE_GUID!{IID_IDirect3DTexture9, + 0x85c31227, 0x3de5, 0x4f00, 0x9b, 0x3a, 0xf1, 0x1a, 0xc3, 0x8c, 0x18, 0xb5} +DEFINE_GUID!{IID_IDirect3DCubeTexture9, + 0xfff32f81, 0xd953, 0x473a, 0x92, 0x23, 0x93, 0xd6, 0x52, 0xab, 0xa9, 0x3f} +DEFINE_GUID!{IID_IDirect3DVolumeTexture9, + 0x2518526c, 0xe789, 0x4111, 0xa7, 0xb9, 0x47, 0xef, 0x32, 0x8d, 0x13, 0xe6} +DEFINE_GUID!{IID_IDirect3DVertexBuffer9, + 0xb64bb1b5, 0xfd70, 0x4df6, 0xbf, 0x91, 0x19, 0xd0, 0xa1, 0x24, 0x55, 0xe3} +DEFINE_GUID!{IID_IDirect3DIndexBuffer9, + 0x7c9dd65e, 0xd3f7, 0x4529, 0xac, 0xee, 0x78, 0x58, 0x30, 0xac, 0xde, 0x35} +DEFINE_GUID!{IID_IDirect3DSurface9, + 0x0cfbaf3a, 0x9ff6, 0x429a, 0x99, 0xb3, 0xa2, 0x79, 0x6a, 0xf8, 0xb8, 0x9b} +DEFINE_GUID!{IID_IDirect3DVolume9, + 0x24f416e6, 0x1f67, 0x4aa7, 0xb8, 0x8e, 0xd3, 0x3f, 0x6f, 0x31, 0x28, 0xa1} +DEFINE_GUID!{IID_IDirect3DSwapChain9, + 0x794950f2, 0xadfc, 0x458a, 0x90, 0x5e, 0x10, 0xa1, 0x0b, 0x0b, 0x50, 0x3b} +DEFINE_GUID!{IID_IDirect3DVertexDeclaration9, + 0xdd13c59c, 0x36fa, 0x4098, 0xa8, 0xfb, 0xc7, 0xed, 0x39, 0xdc, 0x85, 0x46} +DEFINE_GUID!{IID_IDirect3DVertexShader9, + 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36} +DEFINE_GUID!{IID_IDirect3DPixelShader9, + 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89} +DEFINE_GUID!{IID_IDirect3DStateBlock9, + 0xb07c4fe5, 0x310d, 0x4ba8, 0xa2, 0x3c, 0x4f, 0x0f, 0x20, 0x6f, 0x21, 0x8b} +DEFINE_GUID!{IID_IDirect3DQuery9, + 0xd9771460, 0xa695, 0x4f26, 0xbb, 0xd3, 0x27, 0xb8, 0x40, 0xb5, 0x41, 0xcc} +DEFINE_GUID!{IID_HelperName, + 0xe4a36723, 0xfdfe, 0x4b22, 0xb1, 0x46, 0x3c, 0x04, 0xc0, 0x7f, 0x4c, 0xc8} +DEFINE_GUID!{IID_IDirect3D9Ex, + 0x02177241, 0x69fc, 0x400c, 0x8f, 0xf1, 0x93, 0xa4, 0x4d, 0xf6, 0x86, 0x1d} +DEFINE_GUID!{IID_IDirect3DDevice9Ex, + 0xb18b10ce, 0x2649, 0x405a, 0x87, 0x0f, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a} +DEFINE_GUID!{IID_IDirect3DSwapChain9Ex, + 0x91886caf, 0x1c3d, 0x4d2e, 0xa0, 0xab, 0x3e, 0x4c, 0x7d, 0x8d, 0x33, 0x03} +DEFINE_GUID!{IID_IDirect3D9ExOverlayExtension, + 0x187aeb13, 0xaaf5, 0x4c59, 0x87, 0x6d, 0xe0, 0x59, 0x08, 0x8c, 0x0d, 0xf8} +DEFINE_GUID!{IID_IDirect3DDevice9Video, + 0x26dc4561, 0xa1ee, 0x4ae7, 0x96, 0xda, 0x11, 0x8a, 0x36, 0xc0, 0xec, 0x95} +DEFINE_GUID!{IID_IDirect3DAuthenticatedChannel9, + 0xff24beee, 0xda21, 0x4beb, 0x98, 0xb5, 0xd2, 0xf8, 0x99, 0xf9, 0x8a, 0xf9} +DEFINE_GUID!{IID_IDirect3DCryptoSession9, + 0xfa0ab799, 0x7a9c, 0x48ca, 0x8c, 0x5b, 0x23, 0x7e, 0x71, 0xa5, 0x44, 0x34} +extern "system" { + pub fn Direct3DCreate9( + SDKVersion: UINT, + ) -> *mut IDirect3D9; + pub fn D3DPERF_BeginEvent( + col: D3DCOLOR, + wszName: LPCWSTR, + ) -> INT; + pub fn D3DPERF_EndEvent() -> INT; + pub fn D3DPERF_SetMarker( + col: D3DCOLOR, + wszName: LPCWSTR, + ) -> (); + pub fn D3DPERF_SetRegion( + col: D3DCOLOR, + wszName: LPCWSTR, + ) -> (); + pub fn D3DPERF_QueryRepeatFrame() -> BOOL; + pub fn D3DPERF_SetOptions( + dwOptions: DWORD, + ) -> (); + pub fn D3DPERF_GetStatus() -> DWORD; +} +RIDL!{#[uuid(0x81bdcbca, 0x64d4, 0x426d, 0xae, 0x8d, 0xad, 0x1, 0x47, 0xf4, 0x27, 0x5c)] +interface IDirect3D9(IDirect3D9Vtbl): IUnknown(IUnknownVtbl) { + fn RegisterSoftwareDevice( + pInitializeFunction: *mut VOID, + ) -> HRESULT, + fn GetAdapterCount() -> UINT, + fn GetAdapterIdentifier( + Adapter: UINT, + Flags: DWORD, + pIdentifier: *mut D3DADAPTER_IDENTIFIER9, + ) -> HRESULT, + fn GetAdapterModeCount( + Adapter: UINT, + Format: D3DFORMAT, + ) -> UINT, + fn EnumAdapterModes( + Adapter: UINT, + Format: D3DFORMAT, + Mode: UINT, + pMode: *mut D3DDISPLAYMODE, + ) -> HRESULT, + fn GetAdapterDisplayMode( + Adapter: UINT, + pMode: *mut D3DDISPLAYMODE, + ) -> HRESULT, + fn CheckDeviceType( + Adapter: UINT, + DevType: D3DDEVTYPE, + AdapterFormat: D3DFORMAT, + BackBufferFormat: D3DFORMAT, + bWindowed: BOOL, + ) -> HRESULT, + fn CheckDeviceFormat( + Adapter: UINT, + DeviceType: D3DDEVTYPE, + AdapterFormat: D3DFORMAT, + Usage: DWORD, + RType: D3DRESOURCETYPE, + CheckFormat: D3DFORMAT, + ) -> HRESULT, + fn CheckDeviceMultiSampleType( + Adapter: UINT, + DeviceType: D3DDEVTYPE, + SurfaceFormat: D3DFORMAT, + Windowed: BOOL, + MultiSampleType: D3DMULTISAMPLE_TYPE, + pQualityLevels: *mut DWORD, + ) -> HRESULT, + fn CheckDepthStencilMatch( + Adapter: UINT, + DeviceType: D3DDEVTYPE, + AdapterFormat: D3DFORMAT, + RenderTargetFormat: D3DFORMAT, + DepthStencilFormat: D3DFORMAT, + ) -> HRESULT, + fn CheckDeviceFormatConversion( + Adapter: UINT, + DeviceType: D3DDEVTYPE, + SourceFormat: D3DFORMAT, + TargetFormat: D3DFORMAT, + ) -> HRESULT, + fn GetDeviceCaps( + Adapter: UINT, + DeviceType: D3DDEVTYPE, + pCaps: *mut D3DCAPS9, + ) -> HRESULT, + fn GetAdapterMonitor( + Adapter: UINT, + ) -> HMONITOR, + fn CreateDevice( + Adapter: UINT, + DeviceType: D3DDEVTYPE, + hFocusWindow: HWND, + BehaviorFlags: DWORD, + pPresentationParameters: *mut D3DPRESENT_PARAMETERS, + ppReturnedDeviceInterface: *mut *mut IDirect3DDevice9, + ) -> HRESULT, +}} +pub type LPDIRECT3D9 = *mut IDirect3D9; +pub type PDIRECT3D9 = *mut IDirect3D9; +RIDL!{#[uuid(0xd0223b96, 0xbf7a, 0x43fd, 0x92, 0xbd, 0xa4, 0x3b, 0xd, 0x82, 0xb9, 0xeb)] +interface IDirect3DDevice9(IDirect3DDevice9Vtbl): IUnknown(IUnknownVtbl) { + fn TestCooperativeLevel() -> HRESULT, + fn GetAvailableTextureMem() -> UINT, + fn EvictManagedResources() -> HRESULT, + fn GetDirect3D( + ppD3D9: *mut *mut IDirect3D9, + ) -> HRESULT, + fn GetDeviceCaps( + pCaps: *mut D3DCAPS9, + ) -> HRESULT, + fn GetDisplayMode( + iSwapChain: UINT, + pMode: *mut D3DDISPLAYMODE, + ) -> HRESULT, + fn GetCreationParameters( + pParameters: *mut D3DDEVICE_CREATION_PARAMETERS, + ) -> HRESULT, + fn SetCursorProperties( + XHotSpot: UINT, + YHotSpot: UINT, + pCursorBitmap: *mut IDirect3DSurface9, + ) -> HRESULT, + fn SetCursorPosition( + X: INT, + Y: INT, + Flags: DWORD, + ) -> (), + fn ShowCursor( + bShow: BOOL, + ) -> BOOL, + fn CreateAdditionalSwapChain( + pPresentationParameters: *mut D3DPRESENT_PARAMETERS, + pSwapChain: *mut *mut IDirect3DSwapChain9, + ) -> HRESULT, + fn GetSwapChain( + iSwapChain: UINT, + pSwapChain: *mut *mut IDirect3DSwapChain9, + ) -> HRESULT, + fn GetNumberOfSwapChains() -> UINT, + fn Reset( + pPresentationParameters: *mut D3DPRESENT_PARAMETERS, + ) -> HRESULT, + fn Present( + pSourceRect: *const RECT, + pDestRect: *const RECT, + hDestWindowOverride: HWND, + pDirtyRegion: *const RGNDATA, + ) -> HRESULT, + fn GetBackBuffer( + iSwapChain: UINT, + iBackBuffer: UINT, + Type: D3DBACKBUFFER_TYPE, + ppBackBuffer: *mut *mut IDirect3DSurface9, + ) -> HRESULT, + fn GetRasterStatus( + iSwapChain: UINT, + pRasterStatus: *mut D3DRASTER_STATUS, + ) -> HRESULT, + fn SetDialogBoxMode( + bEnableDialogs: BOOL, + ) -> HRESULT, + fn SetGammaRamp( + iSwapChain: UINT, + Flags: DWORD, + pRamp: *const D3DGAMMARAMP, + ) -> (), + fn GetGammaRamp( + iSwapChain: UINT, + pRamp: *mut D3DGAMMARAMP, + ) -> (), + fn CreateTexture( + Width: UINT, + Height: UINT, + Levels: UINT, + Usage: DWORD, + Format: D3DFORMAT, + Pool: D3DPOOL, + ppTexture: *mut *mut IDirect3DTexture9, + pSharedHandle: *mut HANDLE, + ) -> HRESULT, + fn CreateVolumeTexture( + Width: UINT, + Height: UINT, + Depth: UINT, + Levels: UINT, + Usage: DWORD, + Format: D3DFORMAT, + Pool: D3DPOOL, + ppVolumeTexture: *mut *mut IDirect3DVolumeTexture9, + pSharedHandle: *mut HANDLE, + ) -> HRESULT, + fn CreateCubeTexture( + EdgeLength: UINT, + Levels: UINT, + Usage: DWORD, + Format: D3DFORMAT, + Pool: D3DPOOL, + ppCubeTexture: *mut *mut IDirect3DCubeTexture9, + pSharedHandle: *mut HANDLE, + ) -> HRESULT, + fn CreateVertexBuffer( + Length: UINT, + Usage: DWORD, + FVF: DWORD, + Pool: D3DPOOL, + ppVertexBuffer: *mut *mut IDirect3DVertexBuffer9, + pSharedHandle: *mut HANDLE, + ) -> HRESULT, + fn CreateIndexBuffer( + Length: UINT, + Usage: DWORD, + Format: D3DFORMAT, + Pool: D3DPOOL, + ppIndexBuffer: *mut *mut IDirect3DIndexBuffer9, + pSharedHandle: *mut HANDLE, + ) -> HRESULT, + fn CreateRenderTarget( + Width: UINT, + Height: UINT, + Format: D3DFORMAT, + MultiSample: D3DMULTISAMPLE_TYPE, + MultisampleQuality: DWORD, + Lockable: BOOL, + ppSurface: *mut *mut IDirect3DSurface9, + pSharedHandle: *mut HANDLE, + ) -> HRESULT, + fn CreateDepthStencilSurface( + Width: UINT, + Height: UINT, + Format: D3DFORMAT, + MultiSample: D3DMULTISAMPLE_TYPE, + MultisampleQuality: DWORD, + Discard: BOOL, + ppSurface: *mut *mut IDirect3DSurface9, + pSharedHandle: *mut HANDLE, + ) -> HRESULT, + fn UpdateSurface( + pSourceSurface: *mut IDirect3DSurface9, + pSourceRect: *const RECT, + pDestinationSurface: *mut IDirect3DSurface9, + pDestPoint: *const POINT, + ) -> HRESULT, + fn UpdateTexture( + pSourceTexture: *mut IDirect3DBaseTexture9, + pDestinationTexture: *mut IDirect3DBaseTexture9, + ) -> HRESULT, + fn GetRenderTargetData( + pRenderTarget: *mut IDirect3DSurface9, + pDestSurface: *mut IDirect3DSurface9, + ) -> HRESULT, + fn GetFrontBufferData( + iSwapChain: UINT, + pDestSurface: *mut IDirect3DSurface9, + ) -> HRESULT, + fn StretchRect( + pSourceSurface: *mut IDirect3DSurface9, + pSourceRect: *const RECT, + pDestSurface: *mut IDirect3DSurface9, + pDestRect: *const RECT, + Filter: D3DTEXTUREFILTERTYPE, + ) -> HRESULT, + fn ColorFill( + pSurface: *mut IDirect3DSurface9, + pRect: *const RECT, + color: D3DCOLOR, + ) -> HRESULT, + fn CreateOffscreenPlainSurface( + Width: UINT, + Height: UINT, + Format: D3DFORMAT, + Pool: D3DPOOL, + ppSurface: *mut *mut IDirect3DSurface9, + pSharedHandle: *mut HANDLE, + ) -> HRESULT, + fn SetRenderTarget( + RenderTargetIndex: DWORD, + pRenderTarget: *mut IDirect3DSurface9, + ) -> HRESULT, + fn GetRenderTarget( + RenderTargetIndex: DWORD, + ppRenderTarget: *mut *mut IDirect3DSurface9, + ) -> HRESULT, + fn SetDepthStencilSurface( + pNewZStencil: *mut IDirect3DSurface9, + ) -> HRESULT, + fn GetDepthStencilSurface( + ppZStencilSurface: *mut *mut IDirect3DSurface9, + ) -> HRESULT, + fn BeginScene() -> HRESULT, + fn EndScene() -> HRESULT, + fn Clear( + Count: DWORD, + pRects: *const D3DRECT, + Flags: DWORD, + Color: D3DCOLOR, + Z: FLOAT, + Stencil: DWORD, + ) -> HRESULT, + fn SetTransform( + State: D3DTRANSFORMSTATETYPE, + pMatrix: *const D3DMATRIX, + ) -> HRESULT, + fn GetTransform( + State: D3DTRANSFORMSTATETYPE, + pMatrix: *mut D3DMATRIX, + ) -> HRESULT, + fn MultiplyTransform( + arg1: D3DTRANSFORMSTATETYPE, + arg2: *const D3DMATRIX, + ) -> HRESULT, + fn SetViewport( + pViewport: *const D3DVIEWPORT9, + ) -> HRESULT, + fn GetViewport( + pViewport: *mut D3DVIEWPORT9, + ) -> HRESULT, + fn SetMaterial( + pMaterial: *const D3DMATERIAL9, + ) -> HRESULT, + fn GetMaterial( + pMaterial: *mut D3DMATERIAL9, + ) -> HRESULT, + fn SetLight( + Index: DWORD, + arg1: *const D3DLIGHT9, + ) -> HRESULT, + fn GetLight( + Index: DWORD, + arg1: *mut D3DLIGHT9, + ) -> HRESULT, + fn LightEnable( + Index: DWORD, + Enable: BOOL, + ) -> HRESULT, + fn GetLightEnable( + Index: DWORD, + pEnable: *mut BOOL, + ) -> HRESULT, + fn SetClipPlane( + Index: DWORD, + pPlane: *const FLOAT, + ) -> HRESULT, + fn GetClipPlane( + Index: DWORD, + pPlane: *mut FLOAT, + ) -> HRESULT, + fn SetRenderState( + State: D3DRENDERSTATETYPE, + Value: DWORD, + ) -> HRESULT, + fn GetRenderState( + State: D3DRENDERSTATETYPE, + pValue: *mut DWORD, + ) -> HRESULT, + fn CreateStateBlock( + Type: D3DSTATEBLOCKTYPE, + ppSB: *mut *mut IDirect3DStateBlock9, + ) -> HRESULT, + fn BeginStateBlock() -> HRESULT, + fn EndStateBlock( + ppSB: *mut *mut IDirect3DStateBlock9, + ) -> HRESULT, + fn SetClipStatus( + pClipStatus: *const D3DCLIPSTATUS9, + ) -> HRESULT, + fn GetClipStatus( + pClipStatus: *mut D3DCLIPSTATUS9, + ) -> HRESULT, + fn GetTexture( + Stage: DWORD, + ppTexture: *mut *mut IDirect3DBaseTexture9, + ) -> HRESULT, + fn SetTexture( + Stage: DWORD, + pTexture: *mut IDirect3DBaseTexture9, + ) -> HRESULT, + fn GetTextureStageState( + Stage: DWORD, + Type: D3DTEXTURESTAGESTATETYPE, + pValue: *mut DWORD, + ) -> HRESULT, + fn SetTextureStageState( + Stage: DWORD, + Type: D3DTEXTURESTAGESTATETYPE, + Value: DWORD, + ) -> HRESULT, + fn GetSamplerState( + Sampler: DWORD, + Type: D3DSAMPLERSTATETYPE, + pValue: *mut DWORD, + ) -> HRESULT, + fn SetSamplerState( + Sampler: DWORD, + Type: D3DSAMPLERSTATETYPE, + Value: DWORD, + ) -> HRESULT, + fn ValidateDevice( + pNumPasses: *mut DWORD, + ) -> HRESULT, + fn SetPaletteEntries( + PaletteNumber: UINT, + pEntries: *const PALETTEENTRY, + ) -> HRESULT, + fn GetPaletteEntries( + PaletteNumber: UINT, + pEntries: *mut PALETTEENTRY, + ) -> HRESULT, + fn SetCurrentTexturePalette( + PaletteNumber: UINT, + ) -> HRESULT, + fn GetCurrentTexturePalette( + PaletteNumber: *mut UINT, + ) -> HRESULT, + fn SetScissorRect( + pRect: *const RECT, + ) -> HRESULT, + fn GetScissorRect( + pRect: *mut RECT, + ) -> HRESULT, + fn SetSoftwareVertexProcessing( + bSoftware: BOOL, + ) -> HRESULT, + fn GetSoftwareVertexProcessing() -> BOOL, + fn SetNPatchMode( + nSegments: FLOAT, + ) -> HRESULT, + fn GetNPatchMode() -> FLOAT, + fn DrawPrimitive( + PrimitiveType: D3DPRIMITIVETYPE, + StartVertex: UINT, + PrimitiveCount: UINT, + ) -> HRESULT, + fn DrawIndexedPrimitive( + arg1: D3DPRIMITIVETYPE, + BaseVertexIndex: INT, + MinVertexIndex: UINT, + NumVertices: UINT, + startIndex: UINT, + primCount: UINT, + ) -> HRESULT, + fn DrawPrimitiveUP( + PrimitiveType: D3DPRIMITIVETYPE, + PrimitiveCount: UINT, + pVertexStreamZeroData: *const VOID, + VertexStreamZeroStride: UINT, + ) -> HRESULT, + fn DrawIndexedPrimitiveUP( + PrimitiveType: D3DPRIMITIVETYPE, + MinVertexIndex: UINT, + NumVertices: UINT, + PrimitiveCount: UINT, + pIndexData: *const VOID, + IndexDataFormat: D3DFORMAT, + pVertexStreamZeroData: *const VOID, + VertexStreamZeroStride: UINT, + ) -> HRESULT, + fn ProcessVertices( + SrcStartIndex: UINT, + DestIndex: UINT, + VertexCount: UINT, + pDestBuffer: *mut IDirect3DVertexBuffer9, + pVertexDecl: *mut IDirect3DVertexDeclaration9, + Flags: DWORD, + ) -> HRESULT, + fn CreateVertexDeclaration( + pVertexElements: *const D3DVERTEXELEMENT9, + ppDecl: *mut *mut IDirect3DVertexDeclaration9, + ) -> HRESULT, + fn SetVertexDeclaration( + pDecl: *mut IDirect3DVertexDeclaration9, + ) -> HRESULT, + fn GetVertexDeclaration( + ppDecl: *mut *mut IDirect3DVertexDeclaration9, + ) -> HRESULT, + fn SetFVF( + FVF: DWORD, + ) -> HRESULT, + fn GetFVF( + pFVF: *mut DWORD, + ) -> HRESULT, + fn CreateVertexShader( + pFunction: *const DWORD, + ppShader: *mut *mut IDirect3DVertexShader9, + ) -> HRESULT, + fn SetVertexShader( + pShader: *mut IDirect3DVertexShader9, + ) -> HRESULT, + fn GetVertexShader( + ppShader: *mut *mut IDirect3DVertexShader9, + ) -> HRESULT, + fn SetVertexShaderConstantF( + StartRegister: UINT, + pConstantData: *const FLOAT, + Vector4fCount: UINT, + ) -> HRESULT, + fn GetVertexShaderConstantF( + StartRegister: UINT, + pConstantData: *mut FLOAT, + Vector4fCount: UINT, + ) -> HRESULT, + fn SetVertexShaderConstantI( + StartRegister: UINT, + pConstantData: *const INT, + Vector4iCount: UINT, + ) -> HRESULT, + fn GetVertexShaderConstantI( + StartRegister: UINT, + pConstantData: *mut INT, + Vector4iCount: UINT, + ) -> HRESULT, + fn SetVertexShaderConstantB( + StartRegister: UINT, + pConstantData: *const BOOL, + BoolCount: UINT, + ) -> HRESULT, + fn GetVertexShaderConstantB( + StartRegister: UINT, + pConstantData: *mut BOOL, + BoolCount: UINT, + ) -> HRESULT, + fn SetStreamSource( + StreamNumber: UINT, + pStreamData: *mut IDirect3DVertexBuffer9, + OffsetInBytes: UINT, + Stride: UINT, + ) -> HRESULT, + fn GetStreamSource( + StreamNumber: UINT, + ppStreamData: *mut *mut IDirect3DVertexBuffer9, + pOffsetInBytes: *mut UINT, + pStride: *mut UINT, + ) -> HRESULT, + fn SetStreamSourceFreq( + StreamNumber: UINT, + Setting: UINT, + ) -> HRESULT, + fn GetStreamSourceFreq( + StreamNumber: UINT, + pSetting: *mut UINT, + ) -> HRESULT, + fn SetIndices( + pIndexData: *mut IDirect3DIndexBuffer9, + ) -> HRESULT, + fn GetIndices( + ppIndexData: *mut *mut IDirect3DIndexBuffer9, + ) -> HRESULT, + fn CreatePixelShader( + pFunction: *const DWORD, + ppShader: *mut *mut IDirect3DPixelShader9, + ) -> HRESULT, + fn SetPixelShader( + pShader: *mut IDirect3DPixelShader9, + ) -> HRESULT, + fn GetPixelShader( + ppShader: *mut *mut IDirect3DPixelShader9, + ) -> HRESULT, + fn SetPixelShaderConstantF( + StartRegister: UINT, + pConstantData: *const FLOAT, + Vector4fCount: UINT, + ) -> HRESULT, + fn GetPixelShaderConstantF( + StartRegister: UINT, + pConstantData: *mut FLOAT, + Vector4fCount: UINT, + ) -> HRESULT, + fn SetPixelShaderConstantI( + StartRegister: UINT, + pConstantData: *const INT, + Vector4iCount: UINT, + ) -> HRESULT, + fn GetPixelShaderConstantI( + StartRegister: UINT, + pConstantData: *mut INT, + Vector4iCount: UINT, + ) -> HRESULT, + fn SetPixelShaderConstantB( + StartRegister: UINT, + pConstantData: *const BOOL, + BoolCount: UINT, + ) -> HRESULT, + fn GetPixelShaderConstantB( + StartRegister: UINT, + pConstantData: *mut BOOL, + BoolCount: UINT, + ) -> HRESULT, + fn DrawRectPatch( + Handle: UINT, + pNumSegs: *const FLOAT, + pRectPatchInfo: *const D3DRECTPATCH_INFO, + ) -> HRESULT, + fn DrawTriPatch( + Handle: UINT, + pNumSegs: *const FLOAT, + pTriPatchInfo: *const D3DTRIPATCH_INFO, + ) -> HRESULT, + fn DeletePatch( + Handle: UINT, + ) -> HRESULT, + fn CreateQuery( + Type: D3DQUERYTYPE, + ppQuery: *mut *mut IDirect3DQuery9, + ) -> HRESULT, +}} +pub type LPDIRECT3DDEVICE9 = *mut IDirect3DDevice9; +pub type PDIRECT3DDEVICE9 = *mut IDirect3DDevice9; +RIDL!{#[uuid(0xb07c4fe5, 0x310d, 0x4ba8, 0xa2, 0x3c, 0x4f, 0xf, 0x20, 0x6f, 0x21, 0x8b)] +interface IDirect3DStateBlock9(IDirect3DStateBlock9Vtbl): IUnknown(IUnknownVtbl) { + fn GetDevice( + ppDevice: *mut *mut IDirect3DDevice9, + ) -> HRESULT, + fn Capture() -> HRESULT, + fn Apply() -> HRESULT, +}} +pub type LPDIRECT3DSTATEBLOCK9 = *mut IDirect3DStateBlock9; +pub type PDIRECT3DSTATEBLOCK9 = *mut IDirect3DStateBlock9; +RIDL!{#[uuid(0x794950f2, 0xadfc, 0x458a, 0x90, 0x5e, 0x10, 0xa1, 0xb, 0xb, 0x50, 0x3b)] +interface IDirect3DSwapChain9(IDirect3DSwapChain9Vtbl): IUnknown(IUnknownVtbl) { + fn Present( + pSourceRect: *const RECT, + pDestRect: *const RECT, + hDestWindowOverride: HWND, + pDirtyRegion: *const RGNDATA, + dwFlags: DWORD, + ) -> HRESULT, + fn GetFrontBufferData( + pDestSurface: *mut IDirect3DSurface9, + ) -> HRESULT, + fn GetBackBuffer( + iBackBuffer: UINT, + Type: D3DBACKBUFFER_TYPE, + ppBackBuffer: *mut *mut IDirect3DSurface9, + ) -> HRESULT, + fn GetRasterStatus( + pRasterStatus: *mut D3DRASTER_STATUS, + ) -> HRESULT, + fn GetDisplayMode( + pMode: *mut D3DDISPLAYMODE, + ) -> HRESULT, + fn GetDevice( + ppDevice: *mut *mut IDirect3DDevice9, + ) -> HRESULT, + fn GetPresentParameters( + pPresentationParameters: *mut D3DPRESENT_PARAMETERS, + ) -> HRESULT, +}} +pub type LPDIRECT3DSWAPCHAIN9 = *mut IDirect3DSwapChain9; +pub type PDIRECT3DSWAPCHAIN9 = *mut IDirect3DSwapChain9; +RIDL!{#[uuid(0x5eec05d, 0x8f7d, 0x4362, 0xb9, 0x99, 0xd1, 0xba, 0xf3, 0x57, 0xc7, 0x4)] +interface IDirect3DResource9(IDirect3DResource9Vtbl): IUnknown(IUnknownVtbl) { + fn GetDevice( + ppDevice: *mut *mut IDirect3DDevice9, + ) -> HRESULT, + fn SetPrivateData( + refguid: *const GUID, + pData: *const VOID, + SizeOfData: DWORD, + Flags: DWORD, + ) -> HRESULT, + fn GetPrivateData( + refguid: *const GUID, + pData: *mut VOID, + pSizeOfData: *mut DWORD, + ) -> HRESULT, + fn FreePrivateData( + refguid: *const GUID, + ) -> HRESULT, + fn SetPriority( + PriorityNew: DWORD, + ) -> DWORD, + fn GetPriority() -> DWORD, + fn PreLoad() -> (), + fn GetType() -> D3DRESOURCETYPE, +}} +pub type LPDIRECT3DRESOURCE9 = *mut IDirect3DResource9; +pub type PDIRECT3DRESOURCE9 = *mut IDirect3DResource9; +RIDL!{#[uuid(0xdd13c59c, 0x36fa, 0x4098, 0xa8, 0xfb, 0xc7, 0xed, 0x39, 0xdc, 0x85, 0x46)] +interface IDirect3DVertexDeclaration9(IDirect3DVertexDeclaration9Vtbl): IUnknown(IUnknownVtbl) { + fn GetDevice( + ppDevice: *mut *mut IDirect3DDevice9, + ) -> HRESULT, + fn GetDeclaration( + pElement: *mut D3DVERTEXELEMENT9, + pNumElements: *mut UINT, + ) -> HRESULT, +}} +pub type LPDIRECT3DVERTEXDECLARATION9 = *mut IDirect3DVertexDeclaration9; +pub type PDIRECT3DVERTEXDECLARATION9 = *mut IDirect3DVertexDeclaration9; +RIDL!{#[uuid(0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36)] +interface IDirect3DVertexShader9(IDirect3DVertexShader9Vtbl): IUnknown(IUnknownVtbl) { + fn GetDevice( + ppDevice: *mut *mut IDirect3DDevice9, + ) -> HRESULT, + fn GetFunction( + arg1: *mut VOID, + pSizeOfData: *mut UINT, + ) -> HRESULT, +}} +pub type LPDIRECT3DVERTEXSHADER9 = *mut IDirect3DVertexShader9; +pub type PDIRECT3DVERTEXSHADER9 = *mut IDirect3DVertexShader9; +RIDL!{#[uuid(0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89)] +interface IDirect3DPixelShader9(IDirect3DPixelShader9Vtbl): IUnknown(IUnknownVtbl) { + fn GetDevice( + ppDevice: *mut *mut IDirect3DDevice9, + ) -> HRESULT, + fn GetFunction( + arg1: *mut VOID, + pSizeOfData: *mut UINT, + ) -> HRESULT, +}} +pub type LPDIRECT3DPIXELSHADER9 = *mut IDirect3DPixelShader9; +pub type PDIRECT3DPIXELSHADER9 = *mut IDirect3DPixelShader9; +RIDL!{#[uuid(0x580ca87e, 0x1d3c, 0x4d54, 0x99, 0x1d, 0xb7, 0xd3, 0xe3, 0xc2, 0x98, 0xce)] +interface IDirect3DBaseTexture9(IDirect3DBaseTexture9Vtbl): + IDirect3DResource9(IDirect3DResource9Vtbl) { + fn SetLOD( + LODNew: DWORD, + ) -> DWORD, + fn GetLOD() -> DWORD, + fn GetLevelCount() -> DWORD, + fn SetAutoGenFilterType( + FilterType: D3DTEXTUREFILTERTYPE, + ) -> HRESULT, + fn GetAutoGenFilterType() -> D3DTEXTUREFILTERTYPE, + fn GenerateMipSubLevels() -> (), +}} +pub type LPDIRECT3DBASETEXTURE9 = *mut IDirect3DBaseTexture9; +pub type PDIRECT3DBASETEXTURE9 = *mut IDirect3DBaseTexture9; +RIDL!{#[uuid(0x85c31227, 0x3de5, 0x4f00, 0x9b, 0x3a, 0xf1, 0x1a, 0xc3, 0x8c, 0x18, 0xb5)] +interface IDirect3DTexture9(IDirect3DTexture9Vtbl): + IDirect3DBaseTexture9(IDirect3DBaseTexture9Vtbl) { + fn GetLevelDesc( + Level: UINT, + pDesc: *mut D3DSURFACE_DESC, + ) -> HRESULT, + fn GetSurfaceLevel( + Level: UINT, + ppSurfaceLevel: *mut *mut IDirect3DSurface9, + ) -> HRESULT, + fn LockRect( + Level: UINT, + pLockedRect: *mut D3DLOCKED_RECT, + pRect: *const RECT, + Flags: DWORD, + ) -> HRESULT, + fn UnlockRect( + Level: UINT, + ) -> HRESULT, + fn AddDirtyRect( + pDirtyRect: *const RECT, + ) -> HRESULT, +}} +pub type LPDIRECT3DTEXTURE9 = *mut IDirect3DTexture9; +pub type PDIRECT3DTEXTURE9 = *mut IDirect3DTexture9; +RIDL!{#[uuid(0x2518526c, 0xe789, 0x4111, 0xa7, 0xb9, 0x47, 0xef, 0x32, 0x8d, 0x13, 0xe6)] +interface IDirect3DVolumeTexture9(IDirect3DVolumeTexture9Vtbl): + IDirect3DBaseTexture9(IDirect3DBaseTexture9Vtbl) { + fn GetLevelDesc( + Level: UINT, + pDesc: *mut D3DVOLUME_DESC, + ) -> HRESULT, + fn GetVolumeLevel( + Level: UINT, + ppVolumeLevel: *mut *mut IDirect3DVolume9, + ) -> HRESULT, + fn LockBox( + Level: UINT, + pLockedVolume: *mut D3DLOCKED_BOX, + pBox: *const D3DBOX, + Flags: DWORD, + ) -> HRESULT, + fn UnlockBox( + Level: UINT, + ) -> HRESULT, + fn AddDirtyBox( + pDirtyBox: *const D3DBOX, + ) -> HRESULT, +}} +pub type LPDIRECT3DVOLUMETEXTURE9 = *mut IDirect3DVolumeTexture9; +pub type PDIRECT3DVOLUMETEXTURE9 = *mut IDirect3DVolumeTexture9; +RIDL!{#[uuid(0xfff32f81, 0xd953, 0x473a, 0x92, 0x23, 0x93, 0xd6, 0x52, 0xab, 0xa9, 0x3f)] +interface IDirect3DCubeTexture9(IDirect3DCubeTexture9Vtbl): + IDirect3DBaseTexture9(IDirect3DBaseTexture9Vtbl) { + fn GetLevelDesc( + Level: UINT, + pDesc: *mut D3DSURFACE_DESC, + ) -> HRESULT, + fn GetCubeMapSurface( + FaceType: D3DCUBEMAP_FACES, + Level: UINT, + ppCubeMapSurface: *mut *mut IDirect3DSurface9, + ) -> HRESULT, + fn LockRect( + FaceType: D3DCUBEMAP_FACES, + Level: UINT, + pLockedRect: *mut D3DLOCKED_RECT, + pRect: *const RECT, + Flags: DWORD, + ) -> HRESULT, + fn UnlockRect( + FaceType: D3DCUBEMAP_FACES, + Level: UINT, + ) -> HRESULT, + fn AddDirtyRect( + FaceType: D3DCUBEMAP_FACES, + pDirtyRect: *const RECT, + ) -> HRESULT, +}} +pub type LPDIRECT3DCUBETEXTURE9 = *mut IDirect3DCubeTexture9; +pub type PDIRECT3DCUBETEXTURE9 = *mut IDirect3DCubeTexture9; +RIDL!{#[uuid(0xb64bb1b5, 0xfd70, 0x4df6, 0xbf, 0x91, 0x19, 0xd0, 0xa1, 0x24, 0x55, 0xe3)] +interface IDirect3DVertexBuffer9(IDirect3DVertexBuffer9Vtbl): + IDirect3DResource9(IDirect3DResource9Vtbl) { + fn Lock( + OffsetToLock: UINT, + SizeToLock: UINT, + ppbData: *mut *mut VOID, + Flags: DWORD, + ) -> HRESULT, + fn Unlock() -> HRESULT, + fn GetDesc( + pDesc: *mut D3DVERTEXBUFFER_DESC, + ) -> HRESULT, +}} +pub type LPDIRECT3DVERTEXBUFFER9 = *mut IDirect3DVertexBuffer9; +pub type PDIRECT3DVERTEXBUFFER9 = *mut IDirect3DVertexBuffer9; +RIDL!{#[uuid(0x7c9dd65e, 0xd3f7, 0x4529, 0xac, 0xee, 0x78, 0x58, 0x30, 0xac, 0xde, 0x35)] +interface IDirect3DIndexBuffer9(IDirect3DIndexBuffer9Vtbl): + IDirect3DResource9(IDirect3DResource9Vtbl) { + fn Lock( + OffsetToLock: UINT, + SizeToLock: UINT, + ppbData: *mut *mut VOID, + Flags: DWORD, + ) -> HRESULT, + fn Unlock() -> HRESULT, + fn GetDesc( + pDesc: *mut D3DINDEXBUFFER_DESC, + ) -> HRESULT, +}} +pub type LPDIRECT3DINDEXBUFFER9 = *mut IDirect3DIndexBuffer9; +pub type PDIRECT3DINDEXBUFFER9 = *mut IDirect3DIndexBuffer9; +RIDL!{#[uuid(0xcfbaf3a, 0x9ff6, 0x429a, 0x99, 0xb3, 0xa2, 0x79, 0x6a, 0xf8, 0xb8, 0x9b)] +interface IDirect3DSurface9(IDirect3DSurface9Vtbl): IDirect3DResource9(IDirect3DResource9Vtbl) { + fn GetContainer( + riid: *const IID, + ppContainer: *mut *mut VOID, + ) -> HRESULT, + fn GetDesc( + pDesc: *mut D3DSURFACE_DESC, + ) -> HRESULT, + fn LockRect( + pLockedRect: *mut D3DLOCKED_RECT, + pRect: *const RECT, + Flags: DWORD, + ) -> HRESULT, + fn UnlockRect() -> HRESULT, + fn GetDC( + phdc: *mut HDC, + ) -> HRESULT, + fn ReleaseDC( + hdc: HDC, + ) -> HRESULT, +}} +pub type LPDIRECT3DSURFACE9 = *mut IDirect3DSurface9; +pub type PDIRECT3DSURFACE9 = *mut IDirect3DSurface9; +RIDL!{#[uuid(0x24f416e6, 0x1f67, 0x4aa7, 0xb8, 0x8e, 0xd3, 0x3f, 0x6f, 0x31, 0x28, 0xa1)] +interface IDirect3DVolume9(IDirect3DVolume9Vtbl): IUnknown(IUnknownVtbl) { + fn GetDevice( + ppDevice: *mut *mut IDirect3DDevice9, + ) -> HRESULT, + fn SetPrivateData( + refguid: *const GUID, + pData: *const VOID, + SizeOfData: DWORD, + Flags: DWORD, + ) -> HRESULT, + fn GetPrivateData( + refguid: *const GUID, + pData: *mut VOID, + pSizeOfData: *mut DWORD, + ) -> HRESULT, + fn FreePrivateData( + refguid: *const GUID, + ) -> HRESULT, + fn GetContainer( + riid: *const IID, + ppContainer: *mut *mut VOID, + ) -> HRESULT, + fn GetDesc( + pDesc: *mut D3DVOLUME_DESC, + ) -> HRESULT, + fn LockBox( + pLockedVolume: *mut D3DLOCKED_BOX, + pBox: *const D3DBOX, + Flags: DWORD, + ) -> HRESULT, + fn UnlockBox() -> HRESULT, +}} +pub type LPDIRECT3DVOLUME9 = *mut IDirect3DVolume9; +pub type PDIRECT3DVOLUME9 = *mut IDirect3DVolume9; +RIDL!{#[uuid(0xd9771460, 0xa695, 0x4f26, 0xbb, 0xd3, 0x27, 0xb8, 0x40, 0xb5, 0x41, 0xcc)] +interface IDirect3DQuery9(IDirect3DQuery9Vtbl): IUnknown(IUnknownVtbl) { + fn GetDevice( + ppDevice: *mut *mut IDirect3DDevice9, + ) -> HRESULT, + fn GetType() -> D3DRESOURCETYPE, + fn GetDataSize() -> DWORD, + fn Issue( + dwIssueFlags: DWORD, + ) -> HRESULT, + fn GetData( + pData: *mut VOID, + dwSize: DWORD, + dwGetDataFlags: DWORD, + ) -> HRESULT, +}} +pub type LPDIRECT3DQUERY9 = *mut IDirect3DQuery9; +pub type PDIRECT3DQUERY9 = *mut IDirect3DQuery9; +pub const D3DCREATE_FPU_PRESERVE: DWORD = 0x2; +pub const D3DCREATE_MULTITHREADED: DWORD = 0x4; +pub const D3DCREATE_PUREDEVICE: DWORD = 0x10; +pub const D3DCREATE_SOFTWARE_VERTEXPROCESSING: DWORD = 0x20; +pub const D3DCREATE_HARDWARE_VERTEXPROCESSING: DWORD = 0x40; +pub const D3DCREATE_MIXED_VERTEXPROCESSING: DWORD = 0x80; +pub const D3DCREATE_DISABLE_DRIVER_MANAGEMENT: DWORD = 0x100; +pub const D3DCREATE_ADAPTERGROUP_DEVICE: DWORD = 0x200; +pub const D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX: DWORD = 0x400; +pub const D3DCREATE_NOWINDOWCHANGES: DWORD = 0x800; +pub const D3DCREATE_DISABLE_PSGP_THREADING: DWORD = 0x2000; +pub const D3DCREATE_ENABLE_PRESENTSTATS: DWORD = 0x4000; +pub const D3DCREATE_DISABLE_PRESENTSTATS: DWORD = 0x8000; +pub const D3DCREATE_SCREENSAVER: DWORD = 0x10000000; +pub const D3DADAPTER_DEFAULT: DWORD = 0; +extern "system" { + pub fn Direct3DCreate9Ex( + SDKVersion: UINT, + arg1: *mut *mut IDirect3D9Ex, + ) -> HRESULT; +} +RIDL!{#[uuid(0x02177241, 0x69fc, 0x400c, 0x8f, 0xf1, 0x93, 0xa4, 0x4d, 0xf6, 0x86, 0x1d)] +interface IDirect3D9Ex(IDirect3D9ExVtbl): IDirect3D9(IDirect3D9Vtbl) { + fn GetAdapterModeCountEx( + Adapter: UINT, + pFilter: *const D3DDISPLAYMODEFILTER, + ) -> UINT, + fn EnumAdapterModesEx( + Adapter: UINT, + pFilter: *const D3DDISPLAYMODEFILTER, + Mode: UINT, + pMode: *mut D3DDISPLAYMODEEX, + ) -> HRESULT, + fn GetAdapterDisplayModeEx( + Adapter: UINT, + pMode: *mut D3DDISPLAYMODEEX, + pRotation: *mut D3DDISPLAYROTATION, + ) -> HRESULT, + fn CreateDeviceEx( + Adapter: UINT, + DeviceType: D3DDEVTYPE, + hFocusWindow: HWND, + BehaviorFlags: DWORD, + pPresentationParameters: *mut D3DPRESENT_PARAMETERS, + pFullscreenDisplayMode: *mut D3DDISPLAYMODEEX, + ppReturnedDeviceInterface: *mut *mut IDirect3DDevice9Ex, + ) -> HRESULT, + fn GetAdapterLUID( + Adapter: UINT, + pLUID: *mut LUID, + ) -> HRESULT, +}} +pub type LPDIRECT3D9EX = *mut IDirect3D9Ex; +pub type PDIRECT3D9EX = *mut IDirect3D9Ex; +RIDL!{#[uuid(0xb18b10ce, 0x2649, 0x405a, 0x87, 0xf, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a)] +interface IDirect3DDevice9Ex(IDirect3DDevice9ExVtbl): IDirect3DDevice9(IDirect3DDevice9Vtbl) { + fn SetConvolutionMonoKernel( + width: UINT, + height: UINT, + rows: *mut FLOAT, + columns: *mut FLOAT, + ) -> HRESULT, + fn ComposeRects( + pSrc: *mut IDirect3DSurface9, + pDst: *mut IDirect3DSurface9, + pSrcRectDescs: *mut IDirect3DVertexBuffer9, + NumRects: UINT, + pDstRectDescs: *mut IDirect3DVertexBuffer9, + Operation: D3DCOMPOSERECTSOP, + Xoffset: INT, + Yoffset: INT, + ) -> HRESULT, + fn PresentEx( + pSourceRect: *const RECT, + pDestRect: *const RECT, + hDestWindowOverride: HWND, + pDirtyRegion: *const RGNDATA, + dwFlags: DWORD, + ) -> HRESULT, + fn GetGPUThreadPriority( + pPriority: *mut INT, + ) -> HRESULT, + fn SetGPUThreadPriority( + Priority: INT, + ) -> HRESULT, + fn WaitForVBlank( + iSwapChain: UINT, + ) -> HRESULT, + fn CheckResourceResidency( + pResourceArray: *mut *mut IDirect3DResource9, + NumResources: UINT32, + ) -> HRESULT, + fn SetMaximumFrameLatency( + MaxLatency: UINT, + ) -> HRESULT, + fn GetMaximumFrameLatency( + pMaxLatency: *mut UINT, + ) -> HRESULT, + fn CheckDeviceState( + hDestinationWindow: HWND, + ) -> HRESULT, + fn CreateRenderTargetEx( + Width: UINT, + Height: UINT, + Format: D3DFORMAT, + MultiSample: D3DMULTISAMPLE_TYPE, + MultisampleQuality: DWORD, + Lockable: BOOL, + ppSurface: *mut *mut IDirect3DSurface9, + pSharedHandle: *mut HANDLE, + Usage: DWORD, + ) -> HRESULT, + fn CreateOffscreenPlainSurfaceEx( + Width: UINT, + Height: UINT, + Format: D3DFORMAT, + Pool: D3DPOOL, + ppSurface: *mut *mut IDirect3DSurface9, + pSharedHandle: *mut HANDLE, + Usage: DWORD, + ) -> HRESULT, + fn CreateDepthStencilSurfaceEx( + Width: UINT, + Height: UINT, + Format: D3DFORMAT, + MultiSample: D3DMULTISAMPLE_TYPE, + MultisampleQuality: DWORD, + Discard: BOOL, + ppSurface: *mut *mut IDirect3DSurface9, + pSharedHandle: *mut HANDLE, + Usage: DWORD, + ) -> HRESULT, + fn ResetEx( + pPresentationParameters: *mut D3DPRESENT_PARAMETERS, + pFullscreenDisplayMode: *mut D3DDISPLAYMODEEX, + ) -> HRESULT, + fn GetDisplayModeEx( + iSwapChain: UINT, + pMode: *mut D3DDISPLAYMODEEX, + pRotation: *mut D3DDISPLAYROTATION, + ) -> HRESULT, +}} +pub type LPDIRECT3DDEVICE9EX = *mut IDirect3DDevice9Ex; +pub type PDIRECT3DDEVICE9EX = *mut IDirect3DDevice9Ex; +RIDL!{#[uuid(0x91886caf, 0x1c3d, 0x4d2e, 0xa0, 0xab, 0x3e, 0x4c, 0x7d, 0x8d, 0x33, 0x3)] +interface IDirect3DSwapChain9Ex(IDirect3DSwapChain9ExVtbl): + IDirect3DSwapChain9(IDirect3DSwapChain9Vtbl) { + fn GetLastPresentCount( + pLastPresentCount: *mut UINT, + ) -> HRESULT, + fn GetPresentStats( + pPresentationStatistics: *mut D3DPRESENTSTATS, + ) -> HRESULT, + fn GetDisplayModeEx( + pMode: *mut D3DDISPLAYMODEEX, + pRotation: *mut D3DDISPLAYROTATION, + ) -> HRESULT, +}} +pub type LPDIRECT3DSWAPCHAIN9EX = *mut IDirect3DSwapChain9Ex; +pub type PDIRECT3DSWAPCHAIN9EX = *mut IDirect3DSwapChain9Ex; +RIDL!{#[uuid(0x187aeb13, 0xaaf5, 0x4c59, 0x87, 0x6d, 0xe0, 0x59, 0x8, 0x8c, 0xd, 0xf8)] +interface IDirect3D9ExOverlayExtension(IDirect3D9ExOverlayExtensionVtbl): IUnknown(IUnknownVtbl) { + fn CheckDeviceOverlayType( + Adapter: UINT, + DevType: D3DDEVTYPE, + OverlayWidth: UINT, + OverlayHeight: UINT, + OverlayFormat: D3DFORMAT, + pDisplayMode: *mut D3DDISPLAYMODEEX, + DisplayRotation: D3DDISPLAYROTATION, + pOverlayCaps: *mut D3DOVERLAYCAPS, + ) -> HRESULT, +}} +pub type LPDIRECT3D9EXOVERLAYEXTENSION = *mut IDirect3D9ExOverlayExtension; +pub type PDIRECT3D9EXOVERLAYEXTENSION = *mut IDirect3D9ExOverlayExtension; +RIDL!{#[uuid(0x26dc4561, 0xa1ee, 0x4ae7, 0x96, 0xda, 0x11, 0x8a, 0x36, 0xc0, 0xec, 0x95)] +interface IDirect3DDevice9Video(IDirect3DDevice9VideoVtbl): IUnknown(IUnknownVtbl) { + fn GetContentProtectionCaps( + pCryptoType: *const GUID, + pDecodeProfile: *const GUID, + pCaps: *mut D3DCONTENTPROTECTIONCAPS, + ) -> HRESULT, + fn CreateAuthenticatedChannel( + ChannelType: D3DAUTHENTICATEDCHANNELTYPE, + ppAuthenticatedChannel: *mut *mut IDirect3DAuthenticatedChannel9, + pChannelHandle: *mut HANDLE, + ) -> HRESULT, + fn CreateCryptoSession( + pCryptoType: *const GUID, + pDecodeProfile: *const GUID, + ppCryptoSession: *mut *mut IDirect3DCryptoSession9, + pCryptoHandle: *mut HANDLE, + ) -> HRESULT, +}} +pub type LPDIRECT3DDEVICE9VIDEO = *mut IDirect3DDevice9Video; +pub type PDIRECT3DDEVICE9VIDEO = *mut IDirect3DDevice9Video; +RIDL!{#[uuid(0xff24beee, 0xda21, 0x4beb, 0x98, 0xb5, 0xd2, 0xf8, 0x99, 0xf9, 0x8a, 0xf9)] +interface IDirect3DAuthenticatedChannel9(IDirect3DAuthenticatedChannel9Vtbl): + IUnknown(IUnknownVtbl) { + fn GetCertificateSize( + pCertificateSize: *mut UINT, + ) -> HRESULT, + fn GetCertificate( + CertifacteSize: UINT, + ppCertificate: *mut BYTE, + ) -> HRESULT, + fn NegotiateKeyExchange( + DataSize: UINT, + pData: *mut VOID, + ) -> HRESULT, + fn Query( + InputSize: UINT, + pInput: *const VOID, + OutputSize: UINT, + pOutput: *mut VOID, + ) -> HRESULT, + fn Configure( + InputSize: UINT, + pInput: *const VOID, + pOutput: *mut D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT, + ) -> HRESULT, +}} +pub type LPDIRECT3DAUTHENTICATEDCHANNEL9 = *mut IDirect3DAuthenticatedChannel9; +pub type PDIRECT3DAUTHENTICATEDCHANNEL9 = *mut IDirect3DAuthenticatedChannel9; +RIDL!{#[uuid(0xfa0ab799, 0x7a9c, 0x48ca, 0x8c, 0x5b, 0x23, 0x7e, 0x71, 0xa5, 0x44, 0x34)] +interface IDirect3DCryptoSession9(IDirect3DCryptoSession9Vtbl): IUnknown(IUnknownVtbl) { + fn GetCertificateSize( + pCertificateSize: *mut UINT, + ) -> HRESULT, + fn GetCertificate( + CertifacteSize: UINT, + ppCertificate: *mut BYTE, + ) -> HRESULT, + fn NegotiateKeyExchange( + DataSize: UINT, + pData: *mut VOID, + ) -> HRESULT, + fn EncryptionBlt( + pSrcSurface: *mut IDirect3DSurface9, + pDstSurface: *mut IDirect3DSurface9, + DstSurfaceSize: UINT, + pIV: *mut VOID, + ) -> HRESULT, + fn DecryptionBlt( + pSrcSurface: *mut IDirect3DSurface9, + pDstSurface: *mut IDirect3DSurface9, + SrcSurfaceSize: UINT, + pEncryptedBlockInfo: *mut D3DENCRYPTED_BLOCK_INFO, + pContentKey: *mut VOID, + pIV: *mut VOID, + ) -> HRESULT, + fn GetSurfacePitch( + pSrcSurface: *mut IDirect3DSurface9, + pSurfacePitch: *mut UINT, + ) -> HRESULT, + fn StartSessionKeyRefresh( + pRandomNumber: *mut VOID, + RandomNumberSize: UINT, + ) -> HRESULT, + fn FinishSessionKeyRefresh() -> HRESULT, + fn GetEncryptionBltKey( + pReadbackKey: *mut VOID, + KeySize: UINT, + ) -> HRESULT, +}} +pub type LPDIRECT3DCRYPTOSESSION9 = *mut IDirect3DCryptoSession9; +pub type PDIRECT3DCRYPTOSESSION9 = *mut IDirect3DCryptoSession9; diff --git a/bash-5.1/vendor/winapi/src/shared/d3d9caps.rs b/bash-5.1/vendor/winapi/src/shared/d3d9caps.rs new file mode 100644 index 0000000000000000000000000000000000000000..e806e08b7e35d5dc1f9f7785967140e51205a968 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/d3d9caps.rs @@ -0,0 +1,366 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Direct3D capabilities include file +use ctypes::c_float; +use shared::d3d9types::D3DDEVTYPE; +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, INT, UINT}; +use um::winnt::ULONGLONG; +STRUCT!{struct D3DVSHADERCAPS2_0 { + Caps: DWORD, + DynamicFlowControlDepth: INT, + NumTemps: INT, + StaticFlowControlDepth: INT, +}} +pub const D3DVS20CAPS_PREDICATION: DWORD = 1 << 0; +pub const D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH: DWORD = 24; +pub const D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH: DWORD = 0; +pub const D3DVS20_MAX_NUMTEMPS: DWORD = 32; +pub const D3DVS20_MIN_NUMTEMPS: DWORD = 12; +pub const D3DVS20_MAX_STATICFLOWCONTROLDEPTH: DWORD = 4; +pub const D3DVS20_MIN_STATICFLOWCONTROLDEPTH: DWORD = 1; +STRUCT!{struct D3DPSHADERCAPS2_0 { + Caps: DWORD, + DynamicFlowControlDepth: INT, + NumTemps: INT, + StaticFlowControlDepth: INT, + NumInstructionSlots: INT, +}} +pub const D3DPS20CAPS_ARBITRARYSWIZZLE: DWORD = 1 << 0; +pub const D3DPS20CAPS_GRADIENTINSTRUCTIONS: DWORD = 1 << 1; +pub const D3DPS20CAPS_PREDICATION: DWORD = 1 << 2; +pub const D3DPS20CAPS_NODEPENDENTREADLIMIT: DWORD = 1 << 3; +pub const D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT: DWORD = 1 << 4; +pub const D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH: DWORD = 24; +pub const D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH: DWORD = 0; +pub const D3DPS20_MAX_NUMTEMPS: DWORD = 32; +pub const D3DPS20_MIN_NUMTEMPS: DWORD = 12; +pub const D3DPS20_MAX_STATICFLOWCONTROLDEPTH: DWORD = 4; +pub const D3DPS20_MIN_STATICFLOWCONTROLDEPTH: DWORD = 0; +pub const D3DPS20_MAX_NUMINSTRUCTIONSLOTS: DWORD = 512; +pub const D3DPS20_MIN_NUMINSTRUCTIONSLOTS: DWORD = 96; +pub const D3DMIN30SHADERINSTRUCTIONS: DWORD = 512; +pub const D3DMAX30SHADERINSTRUCTIONS: DWORD = 32768; +STRUCT!{struct D3DOVERLAYCAPS { + Caps: UINT, + MaxOverlayDisplayWidth: UINT, + MaxOverlayDisplayHeight: UINT, +}} +pub const D3DOVERLAYCAPS_FULLRANGERGB: DWORD = 0x00000001; +pub const D3DOVERLAYCAPS_LIMITEDRANGERGB: DWORD = 0x00000002; +pub const D3DOVERLAYCAPS_YCbCr_BT601: DWORD = 0x00000004; +pub const D3DOVERLAYCAPS_YCbCr_BT709: DWORD = 0x00000008; +pub const D3DOVERLAYCAPS_YCbCr_BT601_xvYCC: DWORD = 0x00000010; +pub const D3DOVERLAYCAPS_YCbCr_BT709_xvYCC: DWORD = 0x00000020; +pub const D3DOVERLAYCAPS_STRETCHX: DWORD = 0x00000040; +pub const D3DOVERLAYCAPS_STRETCHY: DWORD = 0x00000080; +// FIXME packed(4) +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct D3DCONTENTPROTECTIONCAPS { + Caps: DWORD, + KeyExchangeType: GUID, + BufferAlignmentStart: UINT, + BlockAlignmentSize: UINT, + ProtectedMemorySize: ULONGLONG, +}} +pub const D3DCPCAPS_SOFTWARE: DWORD = 0x00000001; +pub const D3DCPCAPS_HARDWARE: DWORD = 0x00000002; +pub const D3DCPCAPS_PROTECTIONALWAYSON: DWORD = 0x00000004; +pub const D3DCPCAPS_PARTIALDECRYPTION: DWORD = 0x00000008; +pub const D3DCPCAPS_CONTENTKEY: DWORD = 0x00000010; +pub const D3DCPCAPS_FRESHENSESSIONKEY: DWORD = 0x00000020; +pub const D3DCPCAPS_ENCRYPTEDREADBACK: DWORD = 0x00000040; +pub const D3DCPCAPS_ENCRYPTEDREADBACKKEY: DWORD = 0x00000080; +pub const D3DCPCAPS_SEQUENTIAL_CTR_IV: DWORD = 0x00000100; +pub const D3DCPCAPS_ENCRYPTSLICEDATAONLY: DWORD = 0x00000200; +DEFINE_GUID!{D3DCRYPTOTYPE_AES128_CTR, + 0x9b6bd711, 0x4f74, 0x41c9, 0x9e, 0x7b, 0x0b, 0xe2, 0xd7, 0xd9, 0x3b, 0x4f} +DEFINE_GUID!{D3DCRYPTOTYPE_PROPRIETARY, + 0xab4e9afd, 0x1d1c, 0x46e6, 0xa7, 0x2f, 0x08, 0x69, 0x91, 0x7b, 0x0d, 0xe8} +DEFINE_GUID!{D3DKEYEXCHANGE_RSAES_OAEP, + 0xc1949895, 0xd72a, 0x4a1d, 0x8e, 0x5d, 0xed, 0x85, 0x7d, 0x17, 0x15, 0x20} +DEFINE_GUID!{D3DKEYEXCHANGE_DXVA, + 0x43d3775c, 0x38e5, 0x4924, 0x8d, 0x86, 0xd3, 0xfc, 0xcf, 0x15, 0x3e, 0x9b} +STRUCT!{struct D3DCAPS9 { + DeviceType: D3DDEVTYPE, + AdapterOrdinal: UINT, + Caps: DWORD, + Caps2: DWORD, + Caps3: DWORD, + PresentationIntervals: DWORD, + CursorCaps: DWORD, + DevCaps: DWORD, + PrimitiveMiscCaps: DWORD, + RasterCaps: DWORD, + ZCmpCaps: DWORD, + SrcBlendCaps: DWORD, + DestBlendCaps: DWORD, + AlphaCmpCaps: DWORD, + ShadeCaps: DWORD, + TextureCaps: DWORD, + TextureFilterCaps: DWORD, + CubeTextureFilterCaps: DWORD, + VolumeTextureFilterCaps: DWORD, + TextureAddressCaps: DWORD, + VolumeTextureAddressCaps: DWORD, + LineCaps: DWORD, + MaxTextureWidth: DWORD, + MaxTextureHeight: DWORD, + MaxVolumeExtent: DWORD, + MaxTextureRepeat: DWORD, + MaxTextureAspectRatio: DWORD, + MaxAnisotropy: DWORD, + MaxVertexW: c_float, + GuardBandLeft: c_float, + GuardBandTop: c_float, + GuardBandRight: c_float, + GuardBandBottom: c_float, + ExtentsAdjust: c_float, + StencilCaps: DWORD, + FVFCaps: DWORD, + TextureOpCaps: DWORD, + MaxTextureBlendStages: DWORD, + MaxSimultaneousTextures: DWORD, + VertexProcessingCaps: DWORD, + MaxActiveLights: DWORD, + MaxUserClipPlanes: DWORD, + MaxVertexBlendMatrices: DWORD, + MaxVertexBlendMatrixIndex: DWORD, + MaxPointSize: c_float, + MaxPrimitiveCount: DWORD, + MaxVertexIndex: DWORD, + MaxStreams: DWORD, + MaxStreamStride: DWORD, + VertexShaderVersion: DWORD, + MaxVertexShaderConst: DWORD, + PixelShaderVersion: DWORD, + PixelShader1xMaxValue: c_float, + DevCaps2: DWORD, + MaxNpatchTessellationLevel: c_float, + Reserved5: DWORD, + MasterAdapterOrdinal: UINT, + AdapterOrdinalInGroup: UINT, + NumberOfAdaptersInGroup: UINT, + DeclTypes: DWORD, + NumSimultaneousRTs: DWORD, + StretchRectFilterCaps: DWORD, + VS20Caps: D3DVSHADERCAPS2_0, + PS20Caps: D3DPSHADERCAPS2_0, + VertexTextureFilterCaps: DWORD, + MaxVShaderInstructionsExecuted: DWORD, + MaxPShaderInstructionsExecuted: DWORD, + MaxVertexShader30InstructionSlots: DWORD, + MaxPixelShader30InstructionSlots: DWORD, +}} +pub const D3DCAPS_OVERLAY: DWORD = 0x00000800; +pub const D3DCAPS_READ_SCANLINE: DWORD = 0x00020000; +pub const D3DCAPS2_FULLSCREENGAMMA: DWORD = 0x00020000; +pub const D3DCAPS2_CANCALIBRATEGAMMA: DWORD = 0x00100000; +pub const D3DCAPS2_RESERVED: DWORD = 0x02000000; +pub const D3DCAPS2_CANMANAGERESOURCE: DWORD = 0x10000000; +pub const D3DCAPS2_DYNAMICTEXTURES: DWORD = 0x20000000; +pub const D3DCAPS2_CANAUTOGENMIPMAP: DWORD = 0x40000000; +pub const D3DCAPS2_CANSHARERESOURCE: DWORD = 0x80000000; +pub const D3DCAPS3_RESERVED: DWORD = 0x8000001f; +pub const D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD: DWORD = 0x00000020; +pub const D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION: DWORD = 0x00000080; +pub const D3DCAPS3_COPY_TO_VIDMEM: DWORD = 0x00000100; +pub const D3DCAPS3_COPY_TO_SYSTEMMEM: DWORD = 0x00000200; +pub const D3DCAPS3_DXVAHD: DWORD = 0x00000400; +pub const D3DCAPS3_DXVAHD_LIMITED: DWORD = 0x00000800; +pub const D3DPRESENT_INTERVAL_DEFAULT: DWORD = 0x00000000; +pub const D3DPRESENT_INTERVAL_ONE: DWORD = 0x00000001; +pub const D3DPRESENT_INTERVAL_TWO: DWORD = 0x00000002; +pub const D3DPRESENT_INTERVAL_THREE: DWORD = 0x00000004; +pub const D3DPRESENT_INTERVAL_FOUR: DWORD = 0x00000008; +pub const D3DPRESENT_INTERVAL_IMMEDIATE: DWORD = 0x80000000; +pub const D3DCURSORCAPS_COLOR: DWORD = 0x00000001; +pub const D3DCURSORCAPS_LOWRES: DWORD = 0x00000002; +pub const D3DDEVCAPS_EXECUTESYSTEMMEMORY: DWORD = 0x00000010; +pub const D3DDEVCAPS_EXECUTEVIDEOMEMORY: DWORD = 0x00000020; +pub const D3DDEVCAPS_TLVERTEXSYSTEMMEMORY: DWORD = 0x00000040; +pub const D3DDEVCAPS_TLVERTEXVIDEOMEMORY: DWORD = 0x00000080; +pub const D3DDEVCAPS_TEXTURESYSTEMMEMORY: DWORD = 0x00000100; +pub const D3DDEVCAPS_TEXTUREVIDEOMEMORY: DWORD = 0x00000200; +pub const D3DDEVCAPS_DRAWPRIMTLVERTEX: DWORD = 0x00000400; +pub const D3DDEVCAPS_CANRENDERAFTERFLIP: DWORD = 0x00000800; +pub const D3DDEVCAPS_TEXTURENONLOCALVIDMEM: DWORD = 0x00001000; +pub const D3DDEVCAPS_DRAWPRIMITIVES2: DWORD = 0x00002000; +pub const D3DDEVCAPS_SEPARATETEXTUREMEMORIES: DWORD = 0x00004000; +pub const D3DDEVCAPS_DRAWPRIMITIVES2EX: DWORD = 0x00008000; +pub const D3DDEVCAPS_HWTRANSFORMANDLIGHT: DWORD = 0x00010000; +pub const D3DDEVCAPS_CANBLTSYSTONONLOCAL: DWORD = 0x00020000; +pub const D3DDEVCAPS_HWRASTERIZATION: DWORD = 0x00080000; +pub const D3DDEVCAPS_PUREDEVICE: DWORD = 0x00100000; +pub const D3DDEVCAPS_QUINTICRTPATCHES: DWORD = 0x00200000; +pub const D3DDEVCAPS_RTPATCHES: DWORD = 0x00400000; +pub const D3DDEVCAPS_RTPATCHHANDLEZERO: DWORD = 0x00800000; +pub const D3DDEVCAPS_NPATCHES: DWORD = 0x01000000; +pub const D3DPMISCCAPS_MASKZ: DWORD = 0x00000002; +pub const D3DPMISCCAPS_CULLNONE: DWORD = 0x00000010; +pub const D3DPMISCCAPS_CULLCW: DWORD = 0x00000020; +pub const D3DPMISCCAPS_CULLCCW: DWORD = 0x00000040; +pub const D3DPMISCCAPS_COLORWRITEENABLE: DWORD = 0x00000080; +pub const D3DPMISCCAPS_CLIPPLANESCALEDPOINTS: DWORD = 0x00000100; +pub const D3DPMISCCAPS_CLIPTLVERTS: DWORD = 0x00000200; +pub const D3DPMISCCAPS_TSSARGTEMP: DWORD = 0x00000400; +pub const D3DPMISCCAPS_BLENDOP: DWORD = 0x00000800; +pub const D3DPMISCCAPS_NULLREFERENCE: DWORD = 0x00001000; +pub const D3DPMISCCAPS_INDEPENDENTWRITEMASKS: DWORD = 0x00004000; +pub const D3DPMISCCAPS_PERSTAGECONSTANT: DWORD = 0x00008000; +pub const D3DPMISCCAPS_FOGANDSPECULARALPHA: DWORD = 0x00010000; +pub const D3DPMISCCAPS_SEPARATEALPHABLEND: DWORD = 0x00020000; +pub const D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS: DWORD = 0x00040000; +pub const D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING: DWORD = 0x00080000; +pub const D3DPMISCCAPS_FOGVERTEXCLAMPED: DWORD = 0x00100000; +pub const D3DPMISCCAPS_POSTBLENDSRGBCONVERT: DWORD = 0x00200000; +pub const D3DLINECAPS_TEXTURE: DWORD = 0x00000001; +pub const D3DLINECAPS_ZTEST: DWORD = 0x00000002; +pub const D3DLINECAPS_BLEND: DWORD = 0x00000004; +pub const D3DLINECAPS_ALPHACMP: DWORD = 0x00000008; +pub const D3DLINECAPS_FOG: DWORD = 0x00000010; +pub const D3DLINECAPS_ANTIALIAS: DWORD = 0x00000020; +pub const D3DPRASTERCAPS_DITHER: DWORD = 0x00000001; +pub const D3DPRASTERCAPS_ZTEST: DWORD = 0x00000010; +pub const D3DPRASTERCAPS_FOGVERTEX: DWORD = 0x00000080; +pub const D3DPRASTERCAPS_FOGTABLE: DWORD = 0x00000100; +pub const D3DPRASTERCAPS_MIPMAPLODBIAS: DWORD = 0x00002000; +pub const D3DPRASTERCAPS_ZBUFFERLESSHSR: DWORD = 0x00008000; +pub const D3DPRASTERCAPS_FOGRANGE: DWORD = 0x00010000; +pub const D3DPRASTERCAPS_ANISOTROPY: DWORD = 0x00020000; +pub const D3DPRASTERCAPS_WBUFFER: DWORD = 0x00040000; +pub const D3DPRASTERCAPS_WFOG: DWORD = 0x00100000; +pub const D3DPRASTERCAPS_ZFOG: DWORD = 0x00200000; +pub const D3DPRASTERCAPS_COLORPERSPECTIVE: DWORD = 0x00400000; +pub const D3DPRASTERCAPS_SCISSORTEST: DWORD = 0x01000000; +pub const D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS: DWORD = 0x02000000; +pub const D3DPRASTERCAPS_DEPTHBIAS: DWORD = 0x04000000; +pub const D3DPRASTERCAPS_MULTISAMPLE_TOGGLE: DWORD = 0x08000000; +pub const D3DPCMPCAPS_NEVER: DWORD = 0x00000001; +pub const D3DPCMPCAPS_LESS: DWORD = 0x00000002; +pub const D3DPCMPCAPS_EQUAL: DWORD = 0x00000004; +pub const D3DPCMPCAPS_LESSEQUAL: DWORD = 0x00000008; +pub const D3DPCMPCAPS_GREATER: DWORD = 0x00000010; +pub const D3DPCMPCAPS_NOTEQUAL: DWORD = 0x00000020; +pub const D3DPCMPCAPS_GREATEREQUAL: DWORD = 0x00000040; +pub const D3DPCMPCAPS_ALWAYS: DWORD = 0x00000080; +pub const D3DPBLENDCAPS_ZERO: DWORD = 0x00000001; +pub const D3DPBLENDCAPS_ONE: DWORD = 0x00000002; +pub const D3DPBLENDCAPS_SRCCOLOR: DWORD = 0x00000004; +pub const D3DPBLENDCAPS_INVSRCCOLOR: DWORD = 0x00000008; +pub const D3DPBLENDCAPS_SRCALPHA: DWORD = 0x00000010; +pub const D3DPBLENDCAPS_INVSRCALPHA: DWORD = 0x00000020; +pub const D3DPBLENDCAPS_DESTALPHA: DWORD = 0x00000040; +pub const D3DPBLENDCAPS_INVDESTALPHA: DWORD = 0x00000080; +pub const D3DPBLENDCAPS_DESTCOLOR: DWORD = 0x00000100; +pub const D3DPBLENDCAPS_INVDESTCOLOR: DWORD = 0x00000200; +pub const D3DPBLENDCAPS_SRCALPHASAT: DWORD = 0x00000400; +pub const D3DPBLENDCAPS_BOTHSRCALPHA: DWORD = 0x00000800; +pub const D3DPBLENDCAPS_BOTHINVSRCALPHA: DWORD = 0x00001000; +pub const D3DPBLENDCAPS_BLENDFACTOR: DWORD = 0x00002000; +pub const D3DPBLENDCAPS_SRCCOLOR2: DWORD = 0x00004000; +pub const D3DPBLENDCAPS_INVSRCCOLOR2: DWORD = 0x00008000; +pub const D3DPSHADECAPS_COLORGOURAUDRGB: DWORD = 0x00000008; +pub const D3DPSHADECAPS_SPECULARGOURAUDRGB: DWORD = 0x00000200; +pub const D3DPSHADECAPS_ALPHAGOURAUDBLEND: DWORD = 0x00004000; +pub const D3DPSHADECAPS_FOGGOURAUD: DWORD = 0x00080000; +pub const D3DPTEXTURECAPS_PERSPECTIVE: DWORD = 0x00000001; +pub const D3DPTEXTURECAPS_POW2: DWORD = 0x00000002; +pub const D3DPTEXTURECAPS_ALPHA: DWORD = 0x00000004; +pub const D3DPTEXTURECAPS_SQUAREONLY: DWORD = 0x00000020; +pub const D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE: DWORD = 0x00000040; +pub const D3DPTEXTURECAPS_ALPHAPALETTE: DWORD = 0x00000080; +pub const D3DPTEXTURECAPS_NONPOW2CONDITIONAL: DWORD = 0x00000100; +pub const D3DPTEXTURECAPS_PROJECTED: DWORD = 0x00000400; +pub const D3DPTEXTURECAPS_CUBEMAP: DWORD = 0x00000800; +pub const D3DPTEXTURECAPS_VOLUMEMAP: DWORD = 0x00002000; +pub const D3DPTEXTURECAPS_MIPMAP: DWORD = 0x00004000; +pub const D3DPTEXTURECAPS_MIPVOLUMEMAP: DWORD = 0x00008000; +pub const D3DPTEXTURECAPS_MIPCUBEMAP: DWORD = 0x00010000; +pub const D3DPTEXTURECAPS_CUBEMAP_POW2: DWORD = 0x00020000; +pub const D3DPTEXTURECAPS_VOLUMEMAP_POW2: DWORD = 0x00040000; +pub const D3DPTEXTURECAPS_NOPROJECTEDBUMPENV: DWORD = 0x00200000; +pub const D3DPTFILTERCAPS_MINFPOINT: DWORD = 0x00000100; +pub const D3DPTFILTERCAPS_MINFLINEAR: DWORD = 0x00000200; +pub const D3DPTFILTERCAPS_MINFANISOTROPIC: DWORD = 0x00000400; +pub const D3DPTFILTERCAPS_MINFPYRAMIDALQUAD: DWORD = 0x00000800; +pub const D3DPTFILTERCAPS_MINFGAUSSIANQUAD: DWORD = 0x00001000; +pub const D3DPTFILTERCAPS_MIPFPOINT: DWORD = 0x00010000; +pub const D3DPTFILTERCAPS_MIPFLINEAR: DWORD = 0x00020000; +pub const D3DPTFILTERCAPS_CONVOLUTIONMONO: DWORD = 0x00040000; +pub const D3DPTFILTERCAPS_MAGFPOINT: DWORD = 0x01000000; +pub const D3DPTFILTERCAPS_MAGFLINEAR: DWORD = 0x02000000; +pub const D3DPTFILTERCAPS_MAGFANISOTROPIC: DWORD = 0x04000000; +pub const D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD: DWORD = 0x08000000; +pub const D3DPTFILTERCAPS_MAGFGAUSSIANQUAD: DWORD = 0x10000000; +pub const D3DPTADDRESSCAPS_WRAP: DWORD = 0x00000001; +pub const D3DPTADDRESSCAPS_MIRROR: DWORD = 0x00000002; +pub const D3DPTADDRESSCAPS_CLAMP: DWORD = 0x00000004; +pub const D3DPTADDRESSCAPS_BORDER: DWORD = 0x00000008; +pub const D3DPTADDRESSCAPS_INDEPENDENTUV: DWORD = 0x00000010; +pub const D3DPTADDRESSCAPS_MIRRORONCE: DWORD = 0x00000020; +pub const D3DSTENCILCAPS_KEEP: DWORD = 0x00000001; +pub const D3DSTENCILCAPS_ZERO: DWORD = 0x00000002; +pub const D3DSTENCILCAPS_REPLACE: DWORD = 0x00000004; +pub const D3DSTENCILCAPS_INCRSAT: DWORD = 0x00000008; +pub const D3DSTENCILCAPS_DECRSAT: DWORD = 0x00000010; +pub const D3DSTENCILCAPS_INVERT: DWORD = 0x00000020; +pub const D3DSTENCILCAPS_INCR: DWORD = 0x00000040; +pub const D3DSTENCILCAPS_DECR: DWORD = 0x00000080; +pub const D3DSTENCILCAPS_TWOSIDED: DWORD = 0x00000100; +pub const D3DTEXOPCAPS_DISABLE: DWORD = 0x00000001; +pub const D3DTEXOPCAPS_SELECTARG1: DWORD = 0x00000002; +pub const D3DTEXOPCAPS_SELECTARG2: DWORD = 0x00000004; +pub const D3DTEXOPCAPS_MODULATE: DWORD = 0x00000008; +pub const D3DTEXOPCAPS_MODULATE2X: DWORD = 0x00000010; +pub const D3DTEXOPCAPS_MODULATE4X: DWORD = 0x00000020; +pub const D3DTEXOPCAPS_ADD: DWORD = 0x00000040; +pub const D3DTEXOPCAPS_ADDSIGNED: DWORD = 0x00000080; +pub const D3DTEXOPCAPS_ADDSIGNED2X: DWORD = 0x00000100; +pub const D3DTEXOPCAPS_SUBTRACT: DWORD = 0x00000200; +pub const D3DTEXOPCAPS_ADDSMOOTH: DWORD = 0x00000400; +pub const D3DTEXOPCAPS_BLENDDIFFUSEALPHA: DWORD = 0x00000800; +pub const D3DTEXOPCAPS_BLENDTEXTUREALPHA: DWORD = 0x00001000; +pub const D3DTEXOPCAPS_BLENDFACTORALPHA: DWORD = 0x00002000; +pub const D3DTEXOPCAPS_BLENDTEXTUREALPHAPM: DWORD = 0x00004000; +pub const D3DTEXOPCAPS_BLENDCURRENTALPHA: DWORD = 0x00008000; +pub const D3DTEXOPCAPS_PREMODULATE: DWORD = 0x00010000; +pub const D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR: DWORD = 0x00020000; +pub const D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA: DWORD = 0x00040000; +pub const D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR: DWORD = 0x00080000; +pub const D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA: DWORD = 0x00100000; +pub const D3DTEXOPCAPS_BUMPENVMAP: DWORD = 0x00200000; +pub const D3DTEXOPCAPS_BUMPENVMAPLUMINANCE: DWORD = 0x00400000; +pub const D3DTEXOPCAPS_DOTPRODUCT3: DWORD = 0x00800000; +pub const D3DTEXOPCAPS_MULTIPLYADD: DWORD = 0x01000000; +pub const D3DTEXOPCAPS_LERP: DWORD = 0x02000000; +pub const D3DFVFCAPS_TEXCOORDCOUNTMASK: DWORD = 0x0000ffff; +pub const D3DFVFCAPS_DONOTSTRIPELEMENTS: DWORD = 0x00080000; +pub const D3DFVFCAPS_PSIZE: DWORD = 0x00100000; +pub const D3DVTXPCAPS_TEXGEN: DWORD = 0x00000001; +pub const D3DVTXPCAPS_MATERIALSOURCE7: DWORD = 0x00000002; +pub const D3DVTXPCAPS_DIRECTIONALLIGHTS: DWORD = 0x00000008; +pub const D3DVTXPCAPS_POSITIONALLIGHTS: DWORD = 0x00000010; +pub const D3DVTXPCAPS_LOCALVIEWER: DWORD = 0x00000020; +pub const D3DVTXPCAPS_TWEENING: DWORD = 0x00000040; +pub const D3DVTXPCAPS_TEXGEN_SPHEREMAP: DWORD = 0x00000100; +pub const D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER: DWORD = 0x00000200; +pub const D3DDEVCAPS2_STREAMOFFSET: DWORD = 0x00000001; +pub const D3DDEVCAPS2_DMAPNPATCH: DWORD = 0x00000002; +pub const D3DDEVCAPS2_ADAPTIVETESSRTPATCH: DWORD = 0x00000004; +pub const D3DDEVCAPS2_ADAPTIVETESSNPATCH: DWORD = 0x00000008; +pub const D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES: DWORD = 0x00000010; +pub const D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH: DWORD = 0x00000020; +pub const D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET: DWORD = 0x00000040; +pub const D3DDTCAPS_UBYTE4: DWORD = 0x00000001; +pub const D3DDTCAPS_UBYTE4N: DWORD = 0x00000002; +pub const D3DDTCAPS_SHORT2N: DWORD = 0x00000004; +pub const D3DDTCAPS_SHORT4N: DWORD = 0x00000008; +pub const D3DDTCAPS_USHORT2N: DWORD = 0x00000010; +pub const D3DDTCAPS_USHORT4N: DWORD = 0x00000020; +pub const D3DDTCAPS_UDEC3: DWORD = 0x00000040; +pub const D3DDTCAPS_DEC3N: DWORD = 0x00000080; +pub const D3DDTCAPS_FLOAT16_2: DWORD = 0x00000100; +pub const D3DDTCAPS_FLOAT16_4: DWORD = 0x00000200; diff --git a/bash-5.1/vendor/winapi/src/shared/d3d9types.rs b/bash-5.1/vendor/winapi/src/shared/d3d9types.rs new file mode 100644 index 0000000000000000000000000000000000000000..e794d2731f133bb45b33d23c3074bcca82563ccb --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/d3d9types.rs @@ -0,0 +1,1487 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Direct3D capabilities include file +use ctypes::{c_char, c_float, c_void}; +use shared::basetsd::UINT64; +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT, INT, UINT, USHORT, WORD}; +use shared::windef::HWND; +use um::winnt::{HANDLE, HRESULT, LARGE_INTEGER, LONG, SHORT}; +pub type D3DCOLOR = DWORD; +#[inline] +pub fn D3DCOLOR_ARGB(a: DWORD, r: DWORD, g: DWORD, b: DWORD) -> D3DCOLOR { + (((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff)) as D3DCOLOR +} +#[inline] +pub fn D3DCOLOR_RGBA(r: DWORD, g: DWORD, b: DWORD, a: DWORD) -> D3DCOLOR { + D3DCOLOR_ARGB(a, r, g, b) +} +#[inline] +pub fn D3DCOLOR_XRGB(r: DWORD, g: DWORD, b: DWORD) -> D3DCOLOR { + D3DCOLOR_ARGB(0xff, r, g, b) +} +#[inline] +pub fn D3DCOLOR_XYUV(y: DWORD, u: DWORD, v: DWORD) -> D3DCOLOR { + D3DCOLOR_ARGB(0xff, y, u, v) +} +#[inline] +pub fn D3DCOLOR_AYUV(a: DWORD, y: DWORD, u: DWORD, v: DWORD) -> D3DCOLOR { + D3DCOLOR_ARGB(a, y, u, v) +} +#[inline] +pub fn D3DCOLOR_COLORVALUE(r: f32, g: f32, b: f32, a: f32) -> D3DCOLOR { + D3DCOLOR_ARGB( + (r * 255f32) as DWORD, + (g * 255f32) as DWORD, + (b * 255f32) as DWORD, + (a * 255f32) as DWORD, + ) +} +STRUCT!{struct D3DVECTOR { + x: c_float, + y: c_float, + z: c_float, +}} +STRUCT!{struct D3DCOLORVALUE { + r: c_float, + g: c_float, + b: c_float, + a: c_float, +}} +STRUCT!{struct D3DRECT { + x1: LONG, + y1: LONG, + x2: LONG, + y2: LONG, +}} +STRUCT!{struct D3DMATRIX { + m: [[c_float; 4]; 4], +}} +STRUCT!{struct D3DVIEWPORT9 { + X: DWORD, + Y: DWORD, + Width: DWORD, + Height: DWORD, + MinZ: c_float, + MaxZ: c_float, +}} +pub const D3DMAXUSERCLIPPLANES: DWORD = 32; +pub const D3DCLIPPLANE0: DWORD = 1 << 0; +pub const D3DCLIPPLANE1: DWORD = 1 << 1; +pub const D3DCLIPPLANE2: DWORD = 1 << 2; +pub const D3DCLIPPLANE3: DWORD = 1 << 3; +pub const D3DCLIPPLANE4: DWORD = 1 << 4; +pub const D3DCLIPPLANE5: DWORD = 1 << 5; +pub const D3DCS_LEFT: DWORD = 0x00000001; +pub const D3DCS_RIGHT: DWORD = 0x00000002; +pub const D3DCS_TOP: DWORD = 0x00000004; +pub const D3DCS_BOTTOM: DWORD = 0x00000008; +pub const D3DCS_FRONT: DWORD = 0x00000010; +pub const D3DCS_BACK: DWORD = 0x00000020; +pub const D3DCS_PLANE0: DWORD = 0x00000040; +pub const D3DCS_PLANE1: DWORD = 0x00000080; +pub const D3DCS_PLANE2: DWORD = 0x00000100; +pub const D3DCS_PLANE3: DWORD = 0x00000200; +pub const D3DCS_PLANE4: DWORD = 0x00000400; +pub const D3DCS_PLANE5: DWORD = 0x00000800; +pub const D3DCS_ALL: DWORD = D3DCS_LEFT | D3DCS_RIGHT | D3DCS_TOP | D3DCS_BOTTOM | D3DCS_FRONT + | D3DCS_BACK | D3DCS_PLANE0 | D3DCS_PLANE1 | D3DCS_PLANE2 | D3DCS_PLANE3 | D3DCS_PLANE4 + | D3DCS_PLANE5; +STRUCT!{struct D3DCLIPSTATUS9 { + ClipUnion: DWORD, + ClipIntersection: DWORD, +}} +STRUCT!{struct D3DMATERIAL9 { + Diffuse: D3DCOLORVALUE, + Ambient: D3DCOLORVALUE, + Specular: D3DCOLORVALUE, + Emissive: D3DCOLORVALUE, + Power: c_float, +}} +ENUM!{enum D3DLIGHTTYPE { + D3DLIGHT_POINT = 1, + D3DLIGHT_SPOT = 2, + D3DLIGHT_DIRECTIONAL = 3, +}} +STRUCT!{struct D3DLIGHT9 { + Type: D3DLIGHTTYPE, + Diffuse: D3DCOLORVALUE, + Specular: D3DCOLORVALUE, + Ambient: D3DCOLORVALUE, + Position: D3DVECTOR, + Direction: D3DVECTOR, + Range: c_float, + Falloff: c_float, + Attenuation0: c_float, + Attenuation1: c_float, + Attenuation2: c_float, + Theta: c_float, + Phi: c_float, +}} +pub const D3DCLEAR_TARGET: DWORD = 0x00000001; +pub const D3DCLEAR_ZBUFFER: DWORD = 0x00000002; +pub const D3DCLEAR_STENCIL: DWORD = 0x00000004; +ENUM!{enum D3DSHADEMODE { + D3DSHADE_FLAT = 1, + D3DSHADE_GOURAUD = 2, + D3DSHADE_PHONG = 3, +}} +ENUM!{enum D3DFILLMODE { + D3DFILL_POINT = 1, + D3DFILL_WIREFRAME = 2, + D3DFILL_SOLID = 3, +}} +ENUM!{enum D3DBLEND { + D3DBLEND_ZERO = 1, + D3DBLEND_ONE = 2, + D3DBLEND_SRCCOLOR = 3, + D3DBLEND_INVSRCCOLOR = 4, + D3DBLEND_SRCALPHA = 5, + D3DBLEND_INVSRCALPHA = 6, + D3DBLEND_DESTALPHA = 7, + D3DBLEND_INVDESTALPHA = 8, + D3DBLEND_DESTCOLOR = 9, + D3DBLEND_INVDESTCOLOR = 10, + D3DBLEND_SRCALPHASAT = 11, + D3DBLEND_BOTHSRCALPHA = 12, + D3DBLEND_BOTHINVSRCALPHA = 13, + D3DBLEND_BLENDFACTOR = 14, + D3DBLEND_INVBLENDFACTOR = 15, + D3DBLEND_SRCCOLOR2 = 16, + D3DBLEND_INVSRCCOLOR2 = 17, +}} +ENUM!{enum D3DBLENDOP { + D3DBLENDOP_ADD = 1, + D3DBLENDOP_SUBTRACT = 2, + D3DBLENDOP_REVSUBTRACT = 3, + D3DBLENDOP_MIN = 4, + D3DBLENDOP_MAX = 5, +}} +ENUM!{enum D3DTEXTUREADDRESS { + D3DTADDRESS_WRAP = 1, + D3DTADDRESS_MIRROR = 2, + D3DTADDRESS_CLAMP = 3, + D3DTADDRESS_BORDER = 4, + D3DTADDRESS_MIRRORONCE = 5, +}} +ENUM!{enum D3DCULL { + D3DCULL_NONE = 1, + D3DCULL_CW = 2, + D3DCULL_CCW = 3, +}} +ENUM!{enum D3DCMPFUNC { + D3DCMP_NEVER = 1, + D3DCMP_LESS = 2, + D3DCMP_EQUAL = 3, + D3DCMP_LESSEQUAL = 4, + D3DCMP_GREATER = 5, + D3DCMP_NOTEQUAL = 6, + D3DCMP_GREATEREQUAL = 7, + D3DCMP_ALWAYS = 8, +}} +ENUM!{enum D3DSTENCILOP { + D3DSTENCILOP_KEEP = 1, + D3DSTENCILOP_ZERO = 2, + D3DSTENCILOP_REPLACE = 3, + D3DSTENCILOP_INCRSAT = 4, + D3DSTENCILOP_DECRSAT = 5, + D3DSTENCILOP_INVERT = 6, + D3DSTENCILOP_INCR = 7, + D3DSTENCILOP_DECR = 8, +}} +ENUM!{enum D3DFOGMODE { + D3DFOG_NONE = 0, + D3DFOG_EXP = 1, + D3DFOG_EXP2 = 2, + D3DFOG_LINEAR = 3, +}} +ENUM!{enum D3DZBUFFERTYPE { + D3DZB_FALSE = 0, + D3DZB_TRUE = 1, + D3DZB_USEW = 2, +}} +ENUM!{enum D3DPRIMITIVETYPE { + D3DPT_POINTLIST = 1, + D3DPT_LINELIST = 2, + D3DPT_LINESTRIP = 3, + D3DPT_TRIANGLELIST = 4, + D3DPT_TRIANGLESTRIP = 5, + D3DPT_TRIANGLEFAN = 6, +}} +ENUM!{enum D3DTRANSFORMSTATETYPE { + D3DTS_VIEW = 2, + D3DTS_PROJECTION = 3, + D3DTS_TEXTURE0 = 16, + D3DTS_TEXTURE1 = 17, + D3DTS_TEXTURE2 = 18, + D3DTS_TEXTURE3 = 19, + D3DTS_TEXTURE4 = 20, + D3DTS_TEXTURE5 = 21, + D3DTS_TEXTURE6 = 22, + D3DTS_TEXTURE7 = 23, +}} +macro_rules! D3DTS_WORLDMATRIX { + ($index:expr) => ($index + 256) +} +pub const D3DTS_WORLD: D3DTRANSFORMSTATETYPE = D3DTS_WORLDMATRIX!(0); +pub const D3DTS_WORLD1: D3DTRANSFORMSTATETYPE = D3DTS_WORLDMATRIX!(1); +pub const D3DTS_WORLD2: D3DTRANSFORMSTATETYPE = D3DTS_WORLDMATRIX!(2); +pub const D3DTS_WORLD3: D3DTRANSFORMSTATETYPE = D3DTS_WORLDMATRIX!(3); +ENUM!{enum D3DRENDERSTATETYPE { + D3DRS_ZENABLE = 7, + D3DRS_FILLMODE = 8, + D3DRS_SHADEMODE = 9, + D3DRS_ZWRITEENABLE = 14, + D3DRS_ALPHATESTENABLE = 15, + D3DRS_LASTPIXEL = 16, + D3DRS_SRCBLEND = 19, + D3DRS_DESTBLEND = 20, + D3DRS_CULLMODE = 22, + D3DRS_ZFUNC = 23, + D3DRS_ALPHAREF = 24, + D3DRS_ALPHAFUNC = 25, + D3DRS_DITHERENABLE = 26, + D3DRS_ALPHABLENDENABLE = 27, + D3DRS_FOGENABLE = 28, + D3DRS_SPECULARENABLE = 29, + D3DRS_FOGCOLOR = 34, + D3DRS_FOGTABLEMODE = 35, + D3DRS_FOGSTART = 36, + D3DRS_FOGEND = 37, + D3DRS_FOGDENSITY = 38, + D3DRS_RANGEFOGENABLE = 48, + D3DRS_STENCILENABLE = 52, + D3DRS_STENCILFAIL = 53, + D3DRS_STENCILZFAIL = 54, + D3DRS_STENCILPASS = 55, + D3DRS_STENCILFUNC = 56, + D3DRS_STENCILREF = 57, + D3DRS_STENCILMASK = 58, + D3DRS_STENCILWRITEMASK = 59, + D3DRS_TEXTUREFACTOR = 60, + D3DRS_WRAP0 = 128, + D3DRS_WRAP1 = 129, + D3DRS_WRAP2 = 130, + D3DRS_WRAP3 = 131, + D3DRS_WRAP4 = 132, + D3DRS_WRAP5 = 133, + D3DRS_WRAP6 = 134, + D3DRS_WRAP7 = 135, + D3DRS_CLIPPING = 136, + D3DRS_LIGHTING = 137, + D3DRS_AMBIENT = 139, + D3DRS_FOGVERTEXMODE = 140, + D3DRS_COLORVERTEX = 141, + D3DRS_LOCALVIEWER = 142, + D3DRS_NORMALIZENORMALS = 143, + D3DRS_DIFFUSEMATERIALSOURCE = 145, + D3DRS_SPECULARMATERIALSOURCE = 146, + D3DRS_AMBIENTMATERIALSOURCE = 147, + D3DRS_EMISSIVEMATERIALSOURCE = 148, + D3DRS_VERTEXBLEND = 151, + D3DRS_CLIPPLANEENABLE = 152, + D3DRS_POINTSIZE = 154, + D3DRS_POINTSIZE_MIN = 155, + D3DRS_POINTSPRITEENABLE = 156, + D3DRS_POINTSCALEENABLE = 157, + D3DRS_POINTSCALE_A = 158, + D3DRS_POINTSCALE_B = 159, + D3DRS_POINTSCALE_C = 160, + D3DRS_MULTISAMPLEANTIALIAS = 161, + D3DRS_MULTISAMPLEMASK = 162, + D3DRS_PATCHEDGESTYLE = 163, + D3DRS_DEBUGMONITORTOKEN = 165, + D3DRS_POINTSIZE_MAX = 166, + D3DRS_INDEXEDVERTEXBLENDENABLE = 167, + D3DRS_COLORWRITEENABLE = 168, + D3DRS_TWEENFACTOR = 170, + D3DRS_BLENDOP = 171, + D3DRS_POSITIONDEGREE = 172, + D3DRS_NORMALDEGREE = 173, + D3DRS_SCISSORTESTENABLE = 174, + D3DRS_SLOPESCALEDEPTHBIAS = 175, + D3DRS_ANTIALIASEDLINEENABLE = 176, + D3DRS_MINTESSELLATIONLEVEL = 178, + D3DRS_MAXTESSELLATIONLEVEL = 179, + D3DRS_ADAPTIVETESS_X = 180, + D3DRS_ADAPTIVETESS_Y = 181, + D3DRS_ADAPTIVETESS_Z = 182, + D3DRS_ADAPTIVETESS_W = 183, + D3DRS_ENABLEADAPTIVETESSELLATION = 184, + D3DRS_TWOSIDEDSTENCILMODE = 185, + D3DRS_CCW_STENCILFAIL = 186, + D3DRS_CCW_STENCILZFAIL = 187, + D3DRS_CCW_STENCILPASS = 188, + D3DRS_CCW_STENCILFUNC = 189, + D3DRS_COLORWRITEENABLE1 = 190, + D3DRS_COLORWRITEENABLE2 = 191, + D3DRS_COLORWRITEENABLE3 = 192, + D3DRS_BLENDFACTOR = 193, + D3DRS_SRGBWRITEENABLE = 194, + D3DRS_DEPTHBIAS = 195, + D3DRS_WRAP8 = 198, + D3DRS_WRAP9 = 199, + D3DRS_WRAP10 = 200, + D3DRS_WRAP11 = 201, + D3DRS_WRAP12 = 202, + D3DRS_WRAP13 = 203, + D3DRS_WRAP14 = 204, + D3DRS_WRAP15 = 205, + D3DRS_SEPARATEALPHABLENDENABLE = 206, + D3DRS_SRCBLENDALPHA = 207, + D3DRS_DESTBLENDALPHA = 208, + D3DRS_BLENDOPALPHA = 209, +}} +pub const D3D_MAX_SIMULTANEOUS_RENDERTARGETS: DWORD = 4; +ENUM!{enum D3DMATERIALCOLORSOURCE { + D3DMCS_MATERIAL = 0, + D3DMCS_COLOR1 = 1, + D3DMCS_COLOR2 = 2, +}} +pub const D3DRENDERSTATE_WRAPBIAS: DWORD = 128; +pub const D3DWRAP_U: DWORD = 0x00000001; +pub const D3DWRAP_V: DWORD = 0x00000002; +pub const D3DWRAP_W: DWORD = 0x00000004; +pub const D3DWRAPCOORD_0: DWORD = 0x00000001; +pub const D3DWRAPCOORD_1: DWORD = 0x00000002; +pub const D3DWRAPCOORD_2: DWORD = 0x00000004; +pub const D3DWRAPCOORD_3: DWORD = 0x00000008; +pub const D3DCOLORWRITEENABLE_RED: DWORD = 1 << 0; +pub const D3DCOLORWRITEENABLE_GREEN: DWORD = 1 << 1; +pub const D3DCOLORWRITEENABLE_BLUE: DWORD = 1 << 2; +pub const D3DCOLORWRITEENABLE_ALPHA: DWORD = 1 << 3; +ENUM!{enum D3DTEXTURESTAGESTATETYPE { + D3DTSS_COLOROP = 1, + D3DTSS_COLORARG1 = 2, + D3DTSS_COLORARG2 = 3, + D3DTSS_ALPHAOP = 4, + D3DTSS_ALPHAARG1 = 5, + D3DTSS_ALPHAARG2 = 6, + D3DTSS_BUMPENVMAT00 = 7, + D3DTSS_BUMPENVMAT01 = 8, + D3DTSS_BUMPENVMAT10 = 9, + D3DTSS_BUMPENVMAT11 = 10, + D3DTSS_TEXCOORDINDEX = 11, + D3DTSS_BUMPENVLSCALE = 22, + D3DTSS_BUMPENVLOFFSET = 23, + D3DTSS_TEXTURETRANSFORMFLAGS = 24, + D3DTSS_COLORARG0 = 26, + D3DTSS_ALPHAARG0 = 27, + D3DTSS_RESULTARG = 28, + D3DTSS_CONSTANT = 32, +}} +ENUM!{enum D3DSAMPLERSTATETYPE { + D3DSAMP_ADDRESSU = 1, + D3DSAMP_ADDRESSV = 2, + D3DSAMP_ADDRESSW = 3, + D3DSAMP_BORDERCOLOR = 4, + D3DSAMP_MAGFILTER = 5, + D3DSAMP_MINFILTER = 6, + D3DSAMP_MIPFILTER = 7, + D3DSAMP_MIPMAPLODBIAS = 8, + D3DSAMP_MAXMIPLEVEL = 9, + D3DSAMP_MAXANISOTROPY = 10, + D3DSAMP_SRGBTEXTURE = 11, + D3DSAMP_ELEMENTINDEX = 12, + D3DSAMP_DMAPOFFSET = 13, +}} +pub const D3DDMAPSAMPLER: DWORD = 256; +pub const D3DVERTEXTEXTURESAMPLER0: DWORD = D3DDMAPSAMPLER + 1; +pub const D3DVERTEXTEXTURESAMPLER1: DWORD = D3DDMAPSAMPLER + 2; +pub const D3DVERTEXTEXTURESAMPLER2: DWORD = D3DDMAPSAMPLER + 3; +pub const D3DVERTEXTEXTURESAMPLER3: DWORD = D3DDMAPSAMPLER + 4; +pub const D3DTSS_TCI_PASSTHRU: DWORD = 0x00000000; +pub const D3DTSS_TCI_CAMERASPACENORMAL: DWORD = 0x00010000; +pub const D3DTSS_TCI_CAMERASPACEPOSITION: DWORD = 0x00020000; +pub const D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR: DWORD = 0x00030000; +pub const D3DTSS_TCI_SPHEREMAP: DWORD = 0x00040000; +ENUM!{enum D3DTEXTUREOP { + D3DTOP_DISABLE = 1, + D3DTOP_SELECTARG1 = 2, + D3DTOP_SELECTARG2 = 3, + D3DTOP_MODULATE = 4, + D3DTOP_MODULATE2X = 5, + D3DTOP_MODULATE4X = 6, + D3DTOP_ADD = 7, + D3DTOP_ADDSIGNED = 8, + D3DTOP_ADDSIGNED2X = 9, + D3DTOP_SUBTRACT = 10, + D3DTOP_ADDSMOOTH = 11, + D3DTOP_BLENDDIFFUSEALPHA = 12, + D3DTOP_BLENDTEXTUREALPHA = 13, + D3DTOP_BLENDFACTORALPHA = 14, + D3DTOP_BLENDTEXTUREALPHAPM = 15, + D3DTOP_BLENDCURRENTALPHA = 16, + D3DTOP_PREMODULATE = 17, + D3DTOP_MODULATEALPHA_ADDCOLOR = 18, + D3DTOP_MODULATECOLOR_ADDALPHA = 19, + D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, + D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, + D3DTOP_BUMPENVMAP = 22, + D3DTOP_BUMPENVMAPLUMINANCE = 23, + D3DTOP_DOTPRODUCT3 = 24, + D3DTOP_MULTIPLYADD = 25, + D3DTOP_LERP = 26, +}} +pub const D3DTA_SELECTMASK: DWORD = 0x0000000f; +pub const D3DTA_DIFFUSE: DWORD = 0x00000000; +pub const D3DTA_CURRENT: DWORD = 0x00000001; +pub const D3DTA_TEXTURE: DWORD = 0x00000002; +pub const D3DTA_TFACTOR: DWORD = 0x00000003; +pub const D3DTA_SPECULAR: DWORD = 0x00000004; +pub const D3DTA_TEMP: DWORD = 0x00000005; +pub const D3DTA_CONSTANT: DWORD = 0x00000006; +pub const D3DTA_COMPLEMENT: DWORD = 0x00000010; +pub const D3DTA_ALPHAREPLICATE: DWORD = 0x00000020; +ENUM!{enum D3DTEXTUREFILTERTYPE { + D3DTEXF_NONE = 0, + D3DTEXF_POINT = 1, + D3DTEXF_LINEAR = 2, + D3DTEXF_ANISOTROPIC = 3, + D3DTEXF_PYRAMIDALQUAD = 6, + D3DTEXF_GAUSSIANQUAD = 7, + D3DTEXF_CONVOLUTIONMONO = 8, +}} +pub const D3DPV_DONOTCOPYDATA: DWORD = 1 << 0; +pub const D3DFVF_RESERVED0: DWORD = 0x001; +pub const D3DFVF_POSITION_MASK: DWORD = 0x400E; +pub const D3DFVF_XYZ: DWORD = 0x002; +pub const D3DFVF_XYZRHW: DWORD = 0x004; +pub const D3DFVF_XYZB1: DWORD = 0x006; +pub const D3DFVF_XYZB2: DWORD = 0x008; +pub const D3DFVF_XYZB3: DWORD = 0x00a; +pub const D3DFVF_XYZB4: DWORD = 0x00c; +pub const D3DFVF_XYZB5: DWORD = 0x00e; +pub const D3DFVF_XYZW: DWORD = 0x4002; +pub const D3DFVF_NORMAL: DWORD = 0x010; +pub const D3DFVF_PSIZE: DWORD = 0x020; +pub const D3DFVF_DIFFUSE: DWORD = 0x040; +pub const D3DFVF_SPECULAR: DWORD = 0x080; +pub const D3DFVF_TEXCOUNT_MASK: DWORD = 0xf00; +pub const D3DFVF_TEXCOUNT_SHIFT: DWORD = 8; +pub const D3DFVF_TEX0: DWORD = 0x000; +pub const D3DFVF_TEX1: DWORD = 0x100; +pub const D3DFVF_TEX2: DWORD = 0x200; +pub const D3DFVF_TEX3: DWORD = 0x300; +pub const D3DFVF_TEX4: DWORD = 0x400; +pub const D3DFVF_TEX5: DWORD = 0x500; +pub const D3DFVF_TEX6: DWORD = 0x600; +pub const D3DFVF_TEX7: DWORD = 0x700; +pub const D3DFVF_TEX8: DWORD = 0x800; +pub const D3DFVF_LASTBETA_UBYTE4: DWORD = 0x1000; +pub const D3DFVF_LASTBETA_D3DCOLOR: DWORD = 0x8000; +pub const D3DFVF_RESERVED2: DWORD = 0x6000; +ENUM!{enum D3DDECLUSAGE { + D3DDECLUSAGE_POSITION = 0, + D3DDECLUSAGE_BLENDWEIGHT, + D3DDECLUSAGE_BLENDINDICES, + D3DDECLUSAGE_NORMAL, + D3DDECLUSAGE_PSIZE, + D3DDECLUSAGE_TEXCOORD, + D3DDECLUSAGE_TANGENT, + D3DDECLUSAGE_BINORMAL, + D3DDECLUSAGE_TESSFACTOR, + D3DDECLUSAGE_POSITIONT, + D3DDECLUSAGE_COLOR, + D3DDECLUSAGE_FOG, + D3DDECLUSAGE_DEPTH, + D3DDECLUSAGE_SAMPLE, +}} +pub const MAXD3DDECLUSAGE: D3DDECLUSAGE = D3DDECLUSAGE_SAMPLE; +pub const MAXD3DDECLUSAGEINDEX: DWORD = 15; +pub const MAXD3DDECLLENGTH: DWORD = 64; +ENUM!{enum D3DDECLMETHOD { + D3DDECLMETHOD_DEFAULT = 0, + D3DDECLMETHOD_PARTIALU, + D3DDECLMETHOD_PARTIALV, + D3DDECLMETHOD_CROSSUV, + D3DDECLMETHOD_UV, + D3DDECLMETHOD_LOOKUP, + D3DDECLMETHOD_LOOKUPPRESAMPLED, +}} +pub const MAXD3DDECLMETHOD: D3DDECLMETHOD = D3DDECLMETHOD_LOOKUPPRESAMPLED; +ENUM!{enum D3DDECLTYPE { + D3DDECLTYPE_FLOAT1 = 0, + D3DDECLTYPE_FLOAT2 = 1, + D3DDECLTYPE_FLOAT3 = 2, + D3DDECLTYPE_FLOAT4 = 3, + D3DDECLTYPE_D3DCOLOR = 4, + D3DDECLTYPE_UBYTE4 = 5, + D3DDECLTYPE_SHORT2 = 6, + D3DDECLTYPE_SHORT4 = 7, + D3DDECLTYPE_UBYTE4N = 8, + D3DDECLTYPE_SHORT2N = 9, + D3DDECLTYPE_SHORT4N = 10, + D3DDECLTYPE_USHORT2N = 11, + D3DDECLTYPE_USHORT4N = 12, + D3DDECLTYPE_UDEC3 = 13, + D3DDECLTYPE_DEC3N = 14, + D3DDECLTYPE_FLOAT16_2 = 15, + D3DDECLTYPE_FLOAT16_4 = 16, + D3DDECLTYPE_UNUSED = 17, +}} +pub const MAXD3DDECLTYPE: D3DDECLTYPE = D3DDECLTYPE_UNUSED; +STRUCT!{struct D3DVERTEXELEMENT9 { + Stream: WORD, + Offset: WORD, + Type: BYTE, + Method: BYTE, + Usage: BYTE, + UsageIndex: BYTE, +}} +pub type LPD3DVERTEXELEMENT9 = *mut D3DVERTEXELEMENT9; +pub const D3DDECL_END: D3DVERTEXELEMENT9 = D3DVERTEXELEMENT9 { + Stream: 0xFF, + Offset: 0, + Type: D3DDECLTYPE_UNUSED as BYTE, + Method: 0, + Usage: 0, + UsageIndex: 0, +}; +pub const D3DDP_MAXTEXCOORD: DWORD = 8; +pub const D3DSTREAMSOURCE_INDEXEDDATA: DWORD = 1 << 30; +pub const D3DSTREAMSOURCE_INSTANCEDATA: DWORD = 2 << 30; +pub const D3DSI_OPCODE_MASK: DWORD = 0x0000FFFF; +pub const D3DSI_INSTLENGTH_MASK: DWORD = 0x0F000000; +pub const D3DSI_INSTLENGTH_SHIFT: DWORD = 24; +ENUM!{enum D3DSHADER_INSTRUCTION_OPCODE_TYPE { + D3DSIO_NOP = 0, + D3DSIO_MOV, + D3DSIO_ADD, + D3DSIO_SUB, + D3DSIO_MAD, + D3DSIO_MUL, + D3DSIO_RCP, + D3DSIO_RSQ, + D3DSIO_DP3, + D3DSIO_DP4, + D3DSIO_MIN, + D3DSIO_MAX, + D3DSIO_SLT, + D3DSIO_SGE, + D3DSIO_EXP, + D3DSIO_LOG, + D3DSIO_LIT, + D3DSIO_DST, + D3DSIO_LRP, + D3DSIO_FRC, + D3DSIO_M4x4, + D3DSIO_M4x3, + D3DSIO_M3x4, + D3DSIO_M3x3, + D3DSIO_M3x2, + D3DSIO_CALL, + D3DSIO_CALLNZ, + D3DSIO_LOOP, + D3DSIO_RET, + D3DSIO_ENDLOOP, + D3DSIO_LABEL, + D3DSIO_DCL, + D3DSIO_POW, + D3DSIO_CRS, + D3DSIO_SGN, + D3DSIO_ABS, + D3DSIO_NRM, + D3DSIO_SINCOS, + D3DSIO_REP, + D3DSIO_ENDREP, + D3DSIO_IF, + D3DSIO_IFC, + D3DSIO_ELSE, + D3DSIO_ENDIF, + D3DSIO_BREAK, + D3DSIO_BREAKC, + D3DSIO_MOVA, + D3DSIO_DEFB, + D3DSIO_DEFI, + D3DSIO_TEXCOORD = 64, + D3DSIO_TEXKILL, + D3DSIO_TEX, + D3DSIO_TEXBEM, + D3DSIO_TEXBEML, + D3DSIO_TEXREG2AR, + D3DSIO_TEXREG2GB, + D3DSIO_TEXM3x2PAD, + D3DSIO_TEXM3x2TEX, + D3DSIO_TEXM3x3PAD, + D3DSIO_TEXM3x3TEX, + D3DSIO_RESERVED0, + D3DSIO_TEXM3x3SPEC, + D3DSIO_TEXM3x3VSPEC, + D3DSIO_EXPP, + D3DSIO_LOGP, + D3DSIO_CND, + D3DSIO_DEF, + D3DSIO_TEXREG2RGB, + D3DSIO_TEXDP3TEX, + D3DSIO_TEXM3x2DEPTH, + D3DSIO_TEXDP3, + D3DSIO_TEXM3x3, + D3DSIO_TEXDEPTH, + D3DSIO_CMP, + D3DSIO_BEM, + D3DSIO_DP2ADD, + D3DSIO_DSX, + D3DSIO_DSY, + D3DSIO_TEXLDD, + D3DSIO_SETP, + D3DSIO_TEXLDL, + D3DSIO_BREAKP, + D3DSIO_PHASE = 0xFFFD, + D3DSIO_COMMENT = 0xFFFE, + D3DSIO_END = 0xFFFF, +}} +pub const D3DSI_COISSUE: DWORD = 0x40000000; +pub const D3DSP_OPCODESPECIFICCONTROL_MASK: DWORD = 0x00ff0000; +pub const D3DSP_OPCODESPECIFICCONTROL_SHIFT: DWORD = 16; +pub const D3DSI_TEXLD_PROJECT: DWORD = 0x01 << D3DSP_OPCODESPECIFICCONTROL_SHIFT; +pub const D3DSI_TEXLD_BIAS: DWORD = 0x02 << D3DSP_OPCODESPECIFICCONTROL_SHIFT; +ENUM!{enum D3DSHADER_COMPARISON { + D3DSPC_RESERVED0 = 0, + D3DSPC_GT = 1, + D3DSPC_EQ = 2, + D3DSPC_GE = 3, + D3DSPC_LT = 4, + D3DSPC_NE = 5, + D3DSPC_LE = 6, + D3DSPC_RESERVED1 = 7, +}} +pub const D3DSHADER_COMPARISON_SHIFT: DWORD = D3DSP_OPCODESPECIFICCONTROL_SHIFT; +pub const D3DSHADER_COMPARISON_MASK: DWORD = 0x7 << D3DSHADER_COMPARISON_SHIFT; +pub const D3DSHADER_INSTRUCTION_PREDICATED: DWORD = 0x1 << 28; +pub const D3DSP_DCL_USAGE_SHIFT: DWORD = 0; +pub const D3DSP_DCL_USAGE_MASK: DWORD = 0x0000000f; +pub const D3DSP_DCL_USAGEINDEX_SHIFT: DWORD = 16; +pub const D3DSP_DCL_USAGEINDEX_MASK: DWORD = 0x000f0000; +pub const D3DSP_TEXTURETYPE_SHIFT: DWORD = 27; +pub const D3DSP_TEXTURETYPE_MASK: DWORD = 0x78000000; +ENUM!{enum D3DSAMPLER_TEXTURE_TYPE { + D3DSTT_UNKNOWN = 0 << D3DSP_TEXTURETYPE_SHIFT, + D3DSTT_2D = 2 << D3DSP_TEXTURETYPE_SHIFT, + D3DSTT_CUBE = 3 << D3DSP_TEXTURETYPE_SHIFT, + D3DSTT_VOLUME = 4 << D3DSP_TEXTURETYPE_SHIFT, +}} +pub const D3DSP_REGNUM_MASK: DWORD = 0x000007FF; +pub const D3DSP_WRITEMASK_0: DWORD = 0x00010000; +pub const D3DSP_WRITEMASK_1: DWORD = 0x00020000; +pub const D3DSP_WRITEMASK_2: DWORD = 0x00040000; +pub const D3DSP_WRITEMASK_3: DWORD = 0x00080000; +pub const D3DSP_WRITEMASK_ALL: DWORD = 0x000F0000; +pub const D3DSP_DSTMOD_SHIFT: DWORD = 20; +pub const D3DSP_DSTMOD_MASK: DWORD = 0x00F00000; +pub const D3DSPDM_NONE: DWORD = 0 << D3DSP_DSTMOD_SHIFT; +pub const D3DSPDM_SATURATE: DWORD = 1 << D3DSP_DSTMOD_SHIFT; +pub const D3DSPDM_PARTIALPRECISION: DWORD = 2 << D3DSP_DSTMOD_SHIFT; +pub const D3DSPDM_MSAMPCENTROID: DWORD = 4 << D3DSP_DSTMOD_SHIFT; +pub const D3DSP_DSTSHIFT_SHIFT: DWORD = 24; +pub const D3DSP_DSTSHIFT_MASK: DWORD = 0x0F000000; +pub const D3DSP_REGTYPE_SHIFT: DWORD = 28; +pub const D3DSP_REGTYPE_SHIFT2: DWORD = 8; +pub const D3DSP_REGTYPE_MASK: DWORD = 0x70000000; +pub const D3DSP_REGTYPE_MASK2: DWORD = 0x00001800; +ENUM!{enum D3DSHADER_PARAM_REGISTER_TYPE { + D3DSPR_TEMP = 0, + D3DSPR_INPUT = 1, + D3DSPR_CONST = 2, + D3DSPR_ADDR = 3, + D3DSPR_TEXTURE = 3, + D3DSPR_RASTOUT = 4, + D3DSPR_ATTROUT = 5, + D3DSPR_TEXCRDOUT = 6, + D3DSPR_OUTPUT = 6, + D3DSPR_CONSTINT = 7, + D3DSPR_COLOROUT = 8, + D3DSPR_DEPTHOUT = 9, + D3DSPR_SAMPLER = 10, + D3DSPR_CONST2 = 11, + D3DSPR_CONST3 = 12, + D3DSPR_CONST4 = 13, + D3DSPR_CONSTBOOL = 14, + D3DSPR_LOOP = 15, + D3DSPR_TEMPFLOAT16 = 16, + D3DSPR_MISCTYPE = 17, + D3DSPR_LABEL = 18, + D3DSPR_PREDICATE = 19, +}} +ENUM!{enum D3DSHADER_MISCTYPE_OFFSETS { + D3DSMO_POSITION = 0, + D3DSMO_FACE = 1, +}} +ENUM!{enum D3DVS_RASTOUT_OFFSETS { + D3DSRO_POSITION = 0, + D3DSRO_FOG, + D3DSRO_POINT_SIZE, +}} +pub const D3DVS_ADDRESSMODE_SHIFT: DWORD = 13; +pub const D3DVS_ADDRESSMODE_MASK: DWORD = 1 << D3DVS_ADDRESSMODE_SHIFT; +ENUM!{enum D3DVS_ADDRESSMODE_TYPE { + D3DVS_ADDRMODE_ABSOLUTE = 0 << D3DVS_ADDRESSMODE_SHIFT, + D3DVS_ADDRMODE_RELATIVE = 1 << D3DVS_ADDRESSMODE_SHIFT, +}} +pub const D3DSHADER_ADDRESSMODE_SHIFT: DWORD = 13; +pub const D3DSHADER_ADDRESSMODE_MASK: DWORD = 1 << D3DSHADER_ADDRESSMODE_SHIFT; +ENUM!{enum D3DSHADER_ADDRESSMODE_TYPE { + D3DSHADER_ADDRMODE_ABSOLUTE = 0 << D3DSHADER_ADDRESSMODE_SHIFT, + D3DSHADER_ADDRMODE_RELATIVE = 1 << D3DSHADER_ADDRESSMODE_SHIFT, +}} +pub const D3DVS_SWIZZLE_SHIFT: DWORD = 16; +pub const D3DVS_SWIZZLE_MASK: DWORD = 0x00FF0000; +pub const D3DVS_X_X: DWORD = 0 << D3DVS_SWIZZLE_SHIFT; +pub const D3DVS_X_Y: DWORD = 1 << D3DVS_SWIZZLE_SHIFT; +pub const D3DVS_X_Z: DWORD = 2 << D3DVS_SWIZZLE_SHIFT; +pub const D3DVS_X_W: DWORD = 3 << D3DVS_SWIZZLE_SHIFT; +pub const D3DVS_Y_X: DWORD = 0 << (D3DVS_SWIZZLE_SHIFT + 2); +pub const D3DVS_Y_Y: DWORD = 1 << (D3DVS_SWIZZLE_SHIFT + 2); +pub const D3DVS_Y_Z: DWORD = 2 << (D3DVS_SWIZZLE_SHIFT + 2); +pub const D3DVS_Y_W: DWORD = 3 << (D3DVS_SWIZZLE_SHIFT + 2); +pub const D3DVS_Z_X: DWORD = 0 << (D3DVS_SWIZZLE_SHIFT + 4); +pub const D3DVS_Z_Y: DWORD = 1 << (D3DVS_SWIZZLE_SHIFT + 4); +pub const D3DVS_Z_Z: DWORD = 2 << (D3DVS_SWIZZLE_SHIFT + 4); +pub const D3DVS_Z_W: DWORD = 3 << (D3DVS_SWIZZLE_SHIFT + 4); +pub const D3DVS_W_X: DWORD = 0 << (D3DVS_SWIZZLE_SHIFT + 6); +pub const D3DVS_W_Y: DWORD = 1 << (D3DVS_SWIZZLE_SHIFT + 6); +pub const D3DVS_W_Z: DWORD = 2 << (D3DVS_SWIZZLE_SHIFT + 6); +pub const D3DVS_W_W: DWORD = 3 << (D3DVS_SWIZZLE_SHIFT + 6); +pub const D3DVS_NOSWIZZLE: DWORD = D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W; +pub const D3DSP_SWIZZLE_SHIFT: DWORD = 16; +pub const D3DSP_SWIZZLE_MASK: DWORD = 0x00FF0000; +pub const D3DSP_NOSWIZZLE: DWORD = (0 << (D3DSP_SWIZZLE_SHIFT + 0)) + | (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | (2 << (D3DSP_SWIZZLE_SHIFT + 4)) + | (3 << (D3DSP_SWIZZLE_SHIFT + 6)); +pub const D3DSP_REPLICATERED: DWORD = (0 << (D3DSP_SWIZZLE_SHIFT + 0)) + | (0 << (D3DSP_SWIZZLE_SHIFT + 2)) | (0 << (D3DSP_SWIZZLE_SHIFT + 4)) + | (0 << (D3DSP_SWIZZLE_SHIFT + 6)); +pub const D3DSP_REPLICATEGREEN: DWORD = (1 << (D3DSP_SWIZZLE_SHIFT + 0)) + | (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | (1 << (D3DSP_SWIZZLE_SHIFT + 4)) + | (1 << (D3DSP_SWIZZLE_SHIFT + 6)); +pub const D3DSP_REPLICATEBLUE: DWORD = (2 << (D3DSP_SWIZZLE_SHIFT + 0)) + | (2 << (D3DSP_SWIZZLE_SHIFT + 2)) | (2 << (D3DSP_SWIZZLE_SHIFT + 4)) + | (2 << (D3DSP_SWIZZLE_SHIFT + 6)); +pub const D3DSP_REPLICATEALPHA: DWORD = (3 << (D3DSP_SWIZZLE_SHIFT + 0)) + | (3 << (D3DSP_SWIZZLE_SHIFT + 2)) | (3 << (D3DSP_SWIZZLE_SHIFT + 4)) + | (3 << (D3DSP_SWIZZLE_SHIFT + 6)); +pub const D3DSP_SRCMOD_SHIFT: DWORD = 24; +pub const D3DSP_SRCMOD_MASK: DWORD = 0x0F000000; +ENUM!{enum D3DSHADER_PARAM_SRCMOD_TYPE { + D3DSPSM_NONE = 0 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_NEG = 1 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_BIAS = 2 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_BIASNEG = 3 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_SIGN = 4 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_SIGNNEG = 5 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_COMP = 6 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_X2 = 7 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_X2NEG = 8 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_DZ = 9 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_DW = 10 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_ABS = 11 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_ABSNEG = 12 << D3DSP_SRCMOD_SHIFT, + D3DSPSM_NOT = 13 << D3DSP_SRCMOD_SHIFT, +}} +pub const D3DSP_MIN_PRECISION_SHIFT: DWORD = 14; +pub const D3DSP_MIN_PRECISION_MASK: DWORD = 0x0000C000; +ENUM!{enum D3DSHADER_MIN_PRECISION { + D3DMP_DEFAULT = 0, + D3DMP_16 = 1, + D3DMP_2_8 = 2, +}} +pub const D3DSI_COMMENTSIZE_SHIFT: DWORD = 16; +pub const D3DSI_COMMENTSIZE_MASK: DWORD = 0x7FFF0000; +pub const D3DPS_END: DWORD = 0x0000FFFF; +pub const D3DVS_END: DWORD = 0x0000FFFF; +ENUM!{enum D3DBASISTYPE { + D3DBASIS_BEZIER = 0, + D3DBASIS_BSPLINE = 1, + D3DBASIS_CATMULL_ROM = 2, +}} +ENUM!{enum D3DDEGREETYPE { + D3DDEGREE_LINEAR = 1, + D3DDEGREE_QUADRATIC = 2, + D3DDEGREE_CUBIC = 3, + D3DDEGREE_QUINTIC = 5, +}} +ENUM!{enum D3DPATCHEDGESTYLE { + D3DPATCHEDGE_DISCRETE = 0, + D3DPATCHEDGE_CONTINUOUS = 1, +}} +ENUM!{enum D3DSTATEBLOCKTYPE { + D3DSBT_ALL = 1, + D3DSBT_PIXELSTATE = 2, + D3DSBT_VERTEXSTATE = 3, +}} +ENUM!{enum D3DVERTEXBLENDFLAGS { + D3DVBF_DISABLE = 0, + D3DVBF_1WEIGHTS = 1, + D3DVBF_2WEIGHTS = 2, + D3DVBF_3WEIGHTS = 3, + D3DVBF_TWEENING = 255, + D3DVBF_0WEIGHTS = 256, +}} +ENUM!{enum D3DTEXTURETRANSFORMFLAGS { + D3DTTFF_DISABLE = 0, + D3DTTFF_COUNT1 = 1, + D3DTTFF_COUNT2 = 2, + D3DTTFF_COUNT3 = 3, + D3DTTFF_COUNT4 = 4, + D3DTTFF_PROJECTED = 256, +}} +pub const D3DFVF_TEXTUREFORMAT2: DWORD = 0; +pub const D3DFVF_TEXTUREFORMAT1: DWORD = 3; +pub const D3DFVF_TEXTUREFORMAT3: DWORD = 1; +pub const D3DFVF_TEXTUREFORMAT4: DWORD = 2; +ENUM!{enum D3DDEVTYPE { + D3DDEVTYPE_HAL = 1, + D3DDEVTYPE_REF = 2, + D3DDEVTYPE_SW = 3, + D3DDEVTYPE_NULLREF = 4, +}} +ENUM!{enum D3DMULTISAMPLE_TYPE { + D3DMULTISAMPLE_NONE = 0, + D3DMULTISAMPLE_NONMASKABLE = 1, + D3DMULTISAMPLE_2_SAMPLES = 2, + D3DMULTISAMPLE_3_SAMPLES = 3, + D3DMULTISAMPLE_4_SAMPLES = 4, + D3DMULTISAMPLE_5_SAMPLES = 5, + D3DMULTISAMPLE_6_SAMPLES = 6, + D3DMULTISAMPLE_7_SAMPLES = 7, + D3DMULTISAMPLE_8_SAMPLES = 8, + D3DMULTISAMPLE_9_SAMPLES = 9, + D3DMULTISAMPLE_10_SAMPLES = 10, + D3DMULTISAMPLE_11_SAMPLES = 11, + D3DMULTISAMPLE_12_SAMPLES = 12, + D3DMULTISAMPLE_13_SAMPLES = 13, + D3DMULTISAMPLE_14_SAMPLES = 14, + D3DMULTISAMPLE_15_SAMPLES = 15, + D3DMULTISAMPLE_16_SAMPLES = 16, +}} +ENUM!{enum D3DFORMAT { + D3DFMT_UNKNOWN = 0, + D3DFMT_R8G8B8 = 20, + D3DFMT_A8R8G8B8 = 21, + D3DFMT_X8R8G8B8 = 22, + D3DFMT_R5G6B5 = 23, + D3DFMT_X1R5G5B5 = 24, + D3DFMT_A1R5G5B5 = 25, + D3DFMT_A4R4G4B4 = 26, + D3DFMT_R3G3B2 = 27, + D3DFMT_A8 = 28, + D3DFMT_A8R3G3B2 = 29, + D3DFMT_X4R4G4B4 = 30, + D3DFMT_A2B10G10R10 = 31, + D3DFMT_A8B8G8R8 = 32, + D3DFMT_X8B8G8R8 = 33, + D3DFMT_G16R16 = 34, + D3DFMT_A2R10G10B10 = 35, + D3DFMT_A16B16G16R16 = 36, + D3DFMT_A8P8 = 40, + D3DFMT_P8 = 41, + D3DFMT_L8 = 50, + D3DFMT_A8L8 = 51, + D3DFMT_A4L4 = 52, + D3DFMT_V8U8 = 60, + D3DFMT_L6V5U5 = 61, + D3DFMT_X8L8V8U8 = 62, + D3DFMT_Q8W8V8U8 = 63, + D3DFMT_V16U16 = 64, + D3DFMT_A2W10V10U10 = 67, + D3DFMT_UYVY = MAKEFOURCC!(b'U', b'Y', b'V', b'Y'), + D3DFMT_R8G8_B8G8 = MAKEFOURCC!(b'R', b'G', b'B', b'G'), + D3DFMT_YUY2 = MAKEFOURCC!(b'Y', b'U', b'Y', b'2'), + D3DFMT_G8R8_G8B8 = MAKEFOURCC!(b'G', b'R', b'G', b'B'), + D3DFMT_DXT1 = MAKEFOURCC!(b'D', b'X', b'T', b'1'), + D3DFMT_DXT2 = MAKEFOURCC!(b'D', b'X', b'T', b'2'), + D3DFMT_DXT3 = MAKEFOURCC!(b'D', b'X', b'T', b'3'), + D3DFMT_DXT4 = MAKEFOURCC!(b'D', b'X', b'T', b'4'), + D3DFMT_DXT5 = MAKEFOURCC!(b'D', b'X', b'T', b'5'), + D3DFMT_D16_LOCKABLE = 70, + D3DFMT_D32 = 71, + D3DFMT_D15S1 = 73, + D3DFMT_D24S8 = 75, + D3DFMT_D24X8 = 77, + D3DFMT_D24X4S4 = 79, + D3DFMT_D16 = 80, + D3DFMT_D32F_LOCKABLE = 82, + D3DFMT_D24FS8 = 83, + D3DFMT_D32_LOCKABLE = 84, + D3DFMT_S8_LOCKABLE = 85, + D3DFMT_L16 = 81, + D3DFMT_VERTEXDATA = 100, + D3DFMT_INDEX16 = 101, + D3DFMT_INDEX32 = 102, + D3DFMT_Q16W16V16U16 = 110, + D3DFMT_MULTI2_ARGB8 = MAKEFOURCC!(b'M', b'E', b'T', b'1'), + D3DFMT_R16F = 111, + D3DFMT_G16R16F = 112, + D3DFMT_A16B16G16R16F = 113, + D3DFMT_R32F = 114, + D3DFMT_G32R32F = 115, + D3DFMT_A32B32G32R32F = 116, + D3DFMT_CxV8U8 = 117, + D3DFMT_A1 = 118, + D3DFMT_A2B10G10R10_XR_BIAS = 119, + D3DFMT_BINARYBUFFER = 199, +}} +STRUCT!{struct D3DDISPLAYMODE { + Width: UINT, + Height: UINT, + RefreshRate: UINT, + Format: D3DFORMAT, +}} +STRUCT!{struct D3DDEVICE_CREATION_PARAMETERS { + AdapterOrdinal: UINT, + DeviceType: D3DDEVTYPE, + hFocusWindow: HWND, + BehaviorFlags: DWORD, +}} +ENUM!{enum D3DSWAPEFFECT { + D3DSWAPEFFECT_DISCARD = 1, + D3DSWAPEFFECT_FLIP = 2, + D3DSWAPEFFECT_COPY = 3, + D3DSWAPEFFECT_OVERLAY = 4, + D3DSWAPEFFECT_FLIPEX = 5, +}} +ENUM!{enum D3DPOOL { + D3DPOOL_DEFAULT = 0, + D3DPOOL_MANAGED = 1, + D3DPOOL_SYSTEMMEM = 2, + D3DPOOL_SCRATCH = 3, +}} +pub const D3DPRESENT_RATE_DEFAULT: DWORD = 0x00000000; +STRUCT!{struct D3DPRESENT_PARAMETERS { + BackBufferWidth: UINT, + BackBufferHeight: UINT, + BackBufferFormat: D3DFORMAT, + BackBufferCount: UINT, + MultiSampleType: D3DMULTISAMPLE_TYPE, + MultiSampleQuality: DWORD, + SwapEffect: D3DSWAPEFFECT, + hDeviceWindow: HWND, + Windowed: BOOL, + EnableAutoDepthStencil: BOOL, + AutoDepthStencilFormat: D3DFORMAT, + Flags: DWORD, + FullScreen_RefreshRateInHz: UINT, + PresentationInterval: UINT, +}} +pub const D3DPRESENTFLAG_LOCKABLE_BACKBUFFER: DWORD = 0x00000001; +pub const D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL: DWORD = 0x00000002; +pub const D3DPRESENTFLAG_DEVICECLIP: DWORD = 0x00000004; +pub const D3DPRESENTFLAG_VIDEO: DWORD = 0x00000010; +pub const D3DPRESENTFLAG_NOAUTOROTATE: DWORD = 0x00000020; +pub const D3DPRESENTFLAG_UNPRUNEDMODE: DWORD = 0x00000040; +pub const D3DPRESENTFLAG_OVERLAY_LIMITEDRGB: DWORD = 0x00000080; +pub const D3DPRESENTFLAG_OVERLAY_YCbCr_BT709: DWORD = 0x00000100; +pub const D3DPRESENTFLAG_OVERLAY_YCbCr_xvYCC: DWORD = 0x00000200; +pub const D3DPRESENTFLAG_RESTRICTED_CONTENT: DWORD = 0x00000400; +pub const D3DPRESENTFLAG_RESTRICT_SHARED_RESOURCE_DRIVER: DWORD = 0x00000800; +STRUCT!{struct D3DGAMMARAMP { + red: [WORD; 256], + green: [WORD; 256], + blue: [WORD; 256], +}} +ENUM!{enum D3DBACKBUFFER_TYPE { + D3DBACKBUFFER_TYPE_MONO = 0, + D3DBACKBUFFER_TYPE_LEFT = 1, + D3DBACKBUFFER_TYPE_RIGHT = 2, +}} +ENUM!{enum D3DRESOURCETYPE { + D3DRTYPE_SURFACE = 1, + D3DRTYPE_VOLUME = 2, + D3DRTYPE_TEXTURE = 3, + D3DRTYPE_VOLUMETEXTURE = 4, + D3DRTYPE_CUBETEXTURE = 5, + D3DRTYPE_VERTEXBUFFER = 6, + D3DRTYPE_INDEXBUFFER = 7, +}} +pub const D3DUSAGE_RENDERTARGET: DWORD = 0x00000001; +pub const D3DUSAGE_DEPTHSTENCIL: DWORD = 0x00000002; +pub const D3DUSAGE_DYNAMIC: DWORD = 0x00000200; +pub const D3DUSAGE_NONSECURE: DWORD = 0x00800000; +pub const D3DUSAGE_AUTOGENMIPMAP: DWORD = 0x00000400; +pub const D3DUSAGE_DMAP: DWORD = 0x00004000; +pub const D3DUSAGE_QUERY_LEGACYBUMPMAP: DWORD = 0x00008000; +pub const D3DUSAGE_QUERY_SRGBREAD: DWORD = 0x00010000; +pub const D3DUSAGE_QUERY_FILTER: DWORD = 0x00020000; +pub const D3DUSAGE_QUERY_SRGBWRITE: DWORD = 0x00040000; +pub const D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING: DWORD = 0x00080000; +pub const D3DUSAGE_QUERY_VERTEXTEXTURE: DWORD = 0x00100000; +pub const D3DUSAGE_QUERY_WRAPANDMIP: DWORD = 0x00200000; +pub const D3DUSAGE_WRITEONLY: DWORD = 0x00000008; +pub const D3DUSAGE_SOFTWAREPROCESSING: DWORD = 0x00000010; +pub const D3DUSAGE_DONOTCLIP: DWORD = 0x00000020; +pub const D3DUSAGE_POINTS: DWORD = 0x00000040; +pub const D3DUSAGE_RTPATCHES: DWORD = 0x00000080; +pub const D3DUSAGE_NPATCHES: DWORD = 0x00000100; +pub const D3DUSAGE_TEXTAPI: DWORD = 0x10000000; +pub const D3DUSAGE_RESTRICTED_CONTENT: DWORD = 0x00000800; +pub const D3DUSAGE_RESTRICT_SHARED_RESOURCE: DWORD = 0x00002000; +pub const D3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER: DWORD = 0x00001000; +ENUM!{enum D3DCUBEMAP_FACES { + D3DCUBEMAP_FACE_POSITIVE_X = 0, + D3DCUBEMAP_FACE_NEGATIVE_X = 1, + D3DCUBEMAP_FACE_POSITIVE_Y = 2, + D3DCUBEMAP_FACE_NEGATIVE_Y = 3, + D3DCUBEMAP_FACE_POSITIVE_Z = 4, + D3DCUBEMAP_FACE_NEGATIVE_Z = 5, +}} +pub const D3DLOCK_READONLY: DWORD = 0x00000010; +pub const D3DLOCK_DISCARD: DWORD = 0x00002000; +pub const D3DLOCK_NOOVERWRITE: DWORD = 0x00001000; +pub const D3DLOCK_NOSYSLOCK: DWORD = 0x00000800; +pub const D3DLOCK_DONOTWAIT: DWORD = 0x00004000; +pub const D3DLOCK_NO_DIRTY_UPDATE: DWORD = 0x00008000; +STRUCT!{struct D3DVERTEXBUFFER_DESC { + Format: D3DFORMAT, + Type: D3DRESOURCETYPE, + Usage: DWORD, + Pool: D3DPOOL, + Size: UINT, + FVF: DWORD, +}} +STRUCT!{struct D3DINDEXBUFFER_DESC { + Format: D3DFORMAT, + Type: D3DRESOURCETYPE, + Usage: DWORD, + Pool: D3DPOOL, + Size: UINT, +}} +STRUCT!{struct D3DSURFACE_DESC { + Format: D3DFORMAT, + Type: D3DRESOURCETYPE, + Usage: DWORD, + Pool: D3DPOOL, + MultiSampleType: D3DMULTISAMPLE_TYPE, + MultiSampleQuality: DWORD, + Width: UINT, + Height: UINT, +}} +STRUCT!{struct D3DVOLUME_DESC { + Format: D3DFORMAT, + Type: D3DRESOURCETYPE, + Usage: DWORD, + Pool: D3DPOOL, + Width: UINT, + Height: UINT, + Depth: UINT, +}} +STRUCT!{struct D3DLOCKED_RECT { + Pitch: INT, + pBits: *mut c_void, +}} +STRUCT!{struct D3DBOX { + Left: UINT, + Top: UINT, + Right: UINT, + Bottom: UINT, + Front: UINT, + Back: UINT, +}} +STRUCT!{struct D3DLOCKED_BOX { + RowPitch: INT, + SlicePitch: INT, + pBits: *mut c_void, +}} +STRUCT!{struct D3DRANGE { + Offset: UINT, + Size: UINT, +}} +STRUCT!{struct D3DRECTPATCH_INFO { + StartVertexOffsetWidth: UINT, + StartVertexOffsetHeight: UINT, + Width: UINT, + Height: UINT, + Stride: UINT, + Basis: D3DBASISTYPE, + Degree: D3DDEGREETYPE, +}} +STRUCT!{struct D3DTRIPATCH_INFO { + StartVertexOffset: UINT, + NumVertices: UINT, + Basis: D3DBASISTYPE, + Degree: D3DDEGREETYPE, +}} +pub const MAX_DEVICE_IDENTIFIER_STRING: usize = 512; +// FIXME packed(4) +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct D3DADAPTER_IDENTIFIER9 { + Driver: [c_char; MAX_DEVICE_IDENTIFIER_STRING], + Description: [c_char; MAX_DEVICE_IDENTIFIER_STRING], + DeviceName: [c_char; 32], + DriverVersion: LARGE_INTEGER, + VendorId: DWORD, + DeviceId: DWORD, + SubSysId: DWORD, + Revision: DWORD, + DeviceIdentifier: GUID, + WHQLLevel: DWORD, +}} +STRUCT!{struct D3DRASTER_STATUS { + InVBlank: BOOL, + ScanLine: UINT, +}} +ENUM!{enum D3DDEBUGMONITORTOKENS { + D3DDMT_ENABLE = 0, + D3DDMT_DISABLE = 1, +}} +ENUM!{enum D3DQUERYTYPE { + D3DQUERYTYPE_VCACHE = 4, + D3DQUERYTYPE_RESOURCEMANAGER = 5, + D3DQUERYTYPE_VERTEXSTATS = 6, + D3DQUERYTYPE_EVENT = 8, + D3DQUERYTYPE_OCCLUSION = 9, + D3DQUERYTYPE_TIMESTAMP = 10, + D3DQUERYTYPE_TIMESTAMPDISJOINT = 11, + D3DQUERYTYPE_TIMESTAMPFREQ = 12, + D3DQUERYTYPE_PIPELINETIMINGS = 13, + D3DQUERYTYPE_INTERFACETIMINGS = 14, + D3DQUERYTYPE_VERTEXTIMINGS = 15, + D3DQUERYTYPE_PIXELTIMINGS = 16, + D3DQUERYTYPE_BANDWIDTHTIMINGS = 17, + D3DQUERYTYPE_CACHEUTILIZATION = 18, + D3DQUERYTYPE_MEMORYPRESSURE = 19, +}} +pub const D3DISSUE_END: DWORD = 1 << 0; +pub const D3DISSUE_BEGIN: DWORD = 1 << 1; +pub const D3DGETDATA_FLUSH: DWORD = 1 << 0; +STRUCT!{struct D3DRESOURCESTATS { + bThrashing: BOOL, + ApproxBytesDownloaded: DWORD, + NumEvicts: DWORD, + NumVidCreates: DWORD, + LastPri: DWORD, + NumUsed: DWORD, + NumUsedInVidMem: DWORD, + WorkingSet: DWORD, + WorkingSetBytes: DWORD, + TotalManaged: DWORD, + TotalBytes: DWORD, +}} +pub const D3DRTYPECOUNT: usize = D3DRTYPE_INDEXBUFFER as usize + 1; +STRUCT!{struct D3DDEVINFO_RESOURCEMANAGER { + stats: [D3DRESOURCESTATS; D3DRTYPECOUNT], +}} +pub type LPD3DDEVINFO_RESOURCEMANAGER = *mut D3DDEVINFO_RESOURCEMANAGER; +STRUCT!{struct D3DDEVINFO_D3DVERTEXSTATS { + NumRenderedTriangles: DWORD, + NumExtraClippingTriangles: DWORD, +}} +pub type LPD3DDEVINFO_D3DVERTEXSTATS = *mut D3DDEVINFO_D3DVERTEXSTATS; +STRUCT!{struct D3DDEVINFO_VCACHE { + Pattern: DWORD, + OptMethod: DWORD, + CacheSize: DWORD, + MagicNumber: DWORD, +}} +pub type LPD3DDEVINFO_VCACHE = *mut D3DDEVINFO_VCACHE; +STRUCT!{struct D3DDEVINFO_D3D9PIPELINETIMINGS { + VertexProcessingTimePercent: FLOAT, + PixelProcessingTimePercent: FLOAT, + OtherGPUProcessingTimePercent: FLOAT, + GPUIdleTimePercent: FLOAT, +}} +STRUCT!{struct D3DDEVINFO_D3D9INTERFACETIMINGS { + WaitingForGPUToUseApplicationResourceTimePercent: FLOAT, + WaitingForGPUToAcceptMoreCommandsTimePercent: FLOAT, + WaitingForGPUToStayWithinLatencyTimePercent: FLOAT, + WaitingForGPUExclusiveResourceTimePercent: FLOAT, + WaitingForGPUOtherTimePercent: FLOAT, +}} +STRUCT!{struct D3DDEVINFO_D3D9STAGETIMINGS { + MemoryProcessingPercent: FLOAT, + ComputationProcessingPercent: FLOAT, +}} +STRUCT!{struct D3DDEVINFO_D3D9BANDWIDTHTIMINGS { + MaxBandwidthUtilized: FLOAT, + FrontEndUploadMemoryUtilizedPercent: FLOAT, + VertexRateUtilizedPercent: FLOAT, + TriangleSetupRateUtilizedPercent: FLOAT, + FillRateUtilizedPercent: FLOAT, +}} +STRUCT!{struct D3DDEVINFO_D3D9CACHEUTILIZATION { + TextureCacheHitRate: FLOAT, + PostTransformVertexCacheHitRate: FLOAT, +}} +// FIXME packed(4) +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct D3DMEMORYPRESSURE { + BytesEvictedFromProcess: UINT64, + SizeOfInefficientAllocation: UINT64, + LevelOfEfficiency: DWORD, +}} +ENUM!{enum D3DCOMPOSERECTSOP { + D3DCOMPOSERECTS_COPY = 1, + D3DCOMPOSERECTS_OR = 2, + D3DCOMPOSERECTS_AND = 3, + D3DCOMPOSERECTS_NEG = 4, +}} +STRUCT!{struct D3DCOMPOSERECTDESC { + X: USHORT, + Y: USHORT, + Width: USHORT, + Height: USHORT, +}} +STRUCT!{struct D3DCOMPOSERECTDESTINATION { + SrcRectIndex: USHORT, + Reserved: USHORT, + X: SHORT, + Y: SHORT, +}} +pub const D3DCOMPOSERECTS_MAXNUMRECTS: DWORD = 0xFFFF; +pub const D3DCONVOLUTIONMONO_MAXWIDTH: DWORD = 7; +pub const D3DCONVOLUTIONMONO_MAXHEIGHT: DWORD = D3DCONVOLUTIONMONO_MAXWIDTH; +pub const D3DFMT_A1_SURFACE_MAXWIDTH: DWORD = 8192; +pub const D3DFMT_A1_SURFACE_MAXHEIGHT: DWORD = 2048; +// FIXME packed(4) +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct D3DPRESENTSTATS { + PresentCount: UINT, + PresentRefreshCount: UINT, + SyncRefreshCount: UINT, + SyncQPCTime: LARGE_INTEGER, + SyncGPUTime: LARGE_INTEGER, +}} +ENUM!{enum D3DSCANLINEORDERING { + D3DSCANLINEORDERING_UNKNOWN = 0, + D3DSCANLINEORDERING_PROGRESSIVE = 1, + D3DSCANLINEORDERING_INTERLACED = 2, +}} +STRUCT!{struct D3DDISPLAYMODEEX { + Size: UINT, + Width: UINT, + Height: UINT, + RefreshRate: UINT, + Format: D3DFORMAT, + ScanLineOrdering: D3DSCANLINEORDERING, +}} +STRUCT!{struct D3DDISPLAYMODEFILTER { + Size: UINT, + Format: D3DFORMAT, + ScanLineOrdering: D3DSCANLINEORDERING, +}} +ENUM!{enum D3DDISPLAYROTATION { + D3DDISPLAYROTATION_IDENTITY = 1, + D3DDISPLAYROTATION_90 = 2, + D3DDISPLAYROTATION_180 = 3, + D3DDISPLAYROTATION_270 = 4, +}} +pub const D3D9_RESOURCE_PRIORITY_MINIMUM: DWORD = 0x28000000; +pub const D3D9_RESOURCE_PRIORITY_LOW: DWORD = 0x50000000; +pub const D3D9_RESOURCE_PRIORITY_NORMAL: DWORD = 0x78000000; +pub const D3D9_RESOURCE_PRIORITY_HIGH: DWORD = 0xa0000000; +pub const D3D9_RESOURCE_PRIORITY_MAXIMUM: DWORD = 0xc8000000; +pub const D3D_OMAC_SIZE: usize = 16; +STRUCT!{struct D3D_OMAC { + Omac: [BYTE; D3D_OMAC_SIZE], +}} +ENUM!{enum D3DAUTHENTICATEDCHANNELTYPE { + D3DAUTHENTICATEDCHANNEL_D3D9 = 1, + D3DAUTHENTICATEDCHANNEL_DRIVER_SOFTWARE = 2, + D3DAUTHENTICATEDCHANNEL_DRIVER_HARDWARE = 3, +}} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERY_INPUT { + QueryType: GUID, + hChannel: HANDLE, + SequenceNumber: UINT, +}} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT { + omac: D3D_OMAC, + QueryType: GUID, + hChannel: HANDLE, + SequenceNumber: UINT, + ReturnCode: HRESULT, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_PROTECTION, + 0xa84eb584, 0xc495, 0x48aa, 0xb9, 0x4d, 0x8b, 0xd2, 0xd6, 0xfb, 0xce, 0x5} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS { + Value: UINT, +}} +BITFIELD!{D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS Value: UINT [ + ProtectionEnabled set_ProtectionEnabled[0..1], + OverlayOrFullscreenRequired set_OverlayOrFullscreenRequired[1..2], +]} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYPROTECTION_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + ProtectionFlags: D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_CHANNELTYPE, + 0xbc1b18a5, 0xb1fb, 0x42ab, 0xbd, 0x94, 0xb5, 0x82, 0x8b, 0x4b, 0xf7, 0xbe} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYCHANNELTYPE_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + ChannelType: D3DAUTHENTICATEDCHANNELTYPE, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_DEVICEHANDLE, + 0xec1c539d, 0x8cff, 0x4e2a, 0xbc, 0xc4, 0xf5, 0x69, 0x2f, 0x99, 0xf4, 0x80} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYDEVICEHANDLE_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + DeviceHandle: HANDLE, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_CRYPTOSESSION, + 0x2634499e, 0xd018, 0x4d74, 0xac, 0x17, 0x7f, 0x72, 0x40, 0x59, 0x52, 0x8d} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYCRYPTOSESSION_INPUT { + Input: D3DAUTHENTICATEDCHANNEL_QUERY_INPUT, + DXVA2DecodeHandle: HANDLE, +}} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYCRYPTOSESSION_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + DXVA2DecodeHandle: HANDLE, + CryptoSessionHandle: HANDLE, + DeviceHandle: HANDLE, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_RESTRICTEDSHAREDRESOURCEPROCESSCOUNT, + 0xdb207b3, 0x9450, 0x46a6, 0x82, 0xde, 0x1b, 0x96, 0xd4, 0x4f, 0x9c, 0xf2} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESSCOUNT_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + NumRestrictedSharedResourceProcesses: UINT, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_RESTRICTEDSHAREDRESOURCEPROCESS, + 0x649bbadb, 0xf0f4, 0x4639, 0xa1, 0x5b, 0x24, 0x39, 0x3f, 0xc3, 0xab, 0xac} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESS_INPUT { + Input: D3DAUTHENTICATEDCHANNEL_QUERY_INPUT, + ProcessIndex: UINT, +}} +ENUM!{enum D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE { + PROCESSIDTYPE_UNKNOWN = 0, + PROCESSIDTYPE_DWM = 1, + PROCESSIDTYPE_HANDLE = 2, +}} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYRESTRICTEDSHAREDRESOURCEPROCESS_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + ProcessIndex: UINT, + ProcessIdentifer: D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE, + ProcessHandle: HANDLE, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_UNRESTRICTEDPROTECTEDSHAREDRESOURCECOUNT, + 0x12f0bd6, 0xe662, 0x4474, 0xbe, 0xfd, 0xaa, 0x53, 0xe5, 0x14, 0x3c, 0x6d} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYUNRESTRICTEDPROTECTEDSHAREDRESOURCECOUNT_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + NumUnrestrictedProtectedSharedResources: UINT, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_OUTPUTIDCOUNT, + 0x2c042b5e, 0x8c07, 0x46d5, 0xaa, 0xbe, 0x8f, 0x75, 0xcb, 0xad, 0x4c, 0x31} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTIDCOUNT_INPUT { + Input: D3DAUTHENTICATEDCHANNEL_QUERY_INPUT, + DeviceHandle: HANDLE, + CryptoSessionHandle: HANDLE, +}} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTIDCOUNT_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + DeviceHandle: HANDLE, + CryptoSessionHandle: HANDLE, + NumOutputIDs: UINT, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_OUTPUTID, + 0x839ddca3, 0x9b4e, 0x41e4, 0xb0, 0x53, 0x89, 0x2b, 0xd2, 0xa1, 0x1e, 0xe7} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTID_INPUT { + Input: D3DAUTHENTICATEDCHANNEL_QUERY_INPUT, + DeviceHandle: HANDLE, + CryptoSessionHandle: HANDLE, + OutputIDIndex: UINT, +}} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYOUTPUTID_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + DeviceHandle: HANDLE, + CryptoSessionHandle: HANDLE, + OutputIDIndex: UINT, + OutputID: UINT64, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_ACCESSIBILITYATTRIBUTES, + 0x6214d9d2, 0x432c, 0x4abb, 0x9f, 0xce, 0x21, 0x6e, 0xea, 0x26, 0x9e, 0x3b} +ENUM!{enum D3DBUSTYPE { + D3DBUSTYPE_OTHER = 0x00000000, + D3DBUSTYPE_PCI = 0x00000001, + D3DBUSTYPE_PCIX = 0x00000002, + D3DBUSTYPE_PCIEXPRESS = 0x00000003, + D3DBUSTYPE_AGP = 0x00000004, + D3DBUSIMPL_MODIFIER_INSIDE_OF_CHIPSET = 0x00010000, + MD3DBUSIMPL_ODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP = 0x00020000, + D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET = 0x00030000, + D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR = 0x00040000, + D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE = 0x00050000, + D3DBUSIMPL_MODIFIER_NON_STANDARD = 0x80000000, +}} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYINFOBUSTYPE_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + BusType: D3DBUSTYPE, + bAccessibleInContiguousBlocks: BOOL, + bAccessibleInNonContiguousBlocks: BOOL, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_ENCRYPTIONWHENACCESSIBLEGUIDCOUNT, + 0xb30f7066, 0x203c, 0x4b07, 0x93, 0xfc, 0xce, 0xaa, 0xfd, 0x61, 0x24, 0x1e} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUIDCOUNT_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + NumEncryptionGuids: UINT, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_ENCRYPTIONWHENACCESSIBLEGUID, + 0xf83a5958, 0xe986, 0x4bda, 0xbe, 0xb0, 0x41, 0x1f, 0x6a, 0x7a, 0x1, 0xb7} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUID_INPUT { + Input: D3DAUTHENTICATEDCHANNEL_QUERY_INPUT, + EncryptionGuidIndex: UINT, +}} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYEVICTIONENCRYPTIONGUID_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + EncryptionGuidIndex: UINT, + EncryptionGuid: GUID, +}} +DEFINE_GUID!{D3DAUTHENTICATEDQUERY_CURRENTENCRYPTIONWHENACCESSIBLE, + 0xec1791c7, 0xdad3, 0x4f15, 0x9e, 0xc3, 0xfa, 0xa9, 0x3d, 0x60, 0xd4, 0xf0} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_QUERYUNCOMPRESSEDENCRYPTIONLEVEL_OUTPUT { + Output: D3DAUTHENTICATEDCHANNEL_QUERY_OUTPUT, + EncryptionGuid: GUID, +}} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT { + omac: D3D_OMAC, + ConfigureType: GUID, + hChannel: HANDLE, + SequenceNumber: UINT, +}} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT { + omac: D3D_OMAC, + ConfigureType: GUID, + hChannel: HANDLE, + SequenceNumber: UINT, + ReturnCode: HRESULT, +}} +DEFINE_GUID!{D3DAUTHENTICATEDCONFIGURE_INITIALIZE, + 0x6114bdb, 0x3523, 0x470a, 0x8d, 0xca, 0xfb, 0xc2, 0x84, 0x51, 0x54, 0xf0} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_CONFIGUREINITIALIZE { + Parameters: D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT, + StartSequenceQuery: UINT, + StartSequenceConfigure: UINT, +}} +DEFINE_GUID!{D3DAUTHENTICATEDCONFIGURE_PROTECTION, + 0x50455658, 0x3f47, 0x4362, 0xbf, 0x99, 0xbf, 0xdf, 0xcd, 0xe9, 0xed, 0x29} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION { + Parameters: D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT, + Protections: D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS, +}} +DEFINE_GUID!{D3DAUTHENTICATEDCONFIGURE_CRYPTOSESSION, + 0x6346cc54, 0x2cfc, 0x4ad4, 0x82, 0x24, 0xd1, 0x58, 0x37, 0xde, 0x77, 0x0} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_CONFIGURECRYPTOSESSION { + Parameters: D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT, + DXVA2DecodeHandle: HANDLE, + CryptoSessionHandle: HANDLE, + DeviceHandle: HANDLE, +}} +DEFINE_GUID!{D3DAUTHENTICATEDCONFIGURE_SHAREDRESOURCE, + 0x772d047, 0x1b40, 0x48e8, 0x9c, 0xa6, 0xb5, 0xf5, 0x10, 0xde, 0x9f, 0x1} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_CONFIGURESHAREDRESOURCE { + Parameters: D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT, + ProcessIdentiferType: D3DAUTHENTICATEDCHANNEL_PROCESSIDENTIFIERTYPE, + ProcessHandle: HANDLE, + AllowAccess: BOOL, +}} +DEFINE_GUID!{D3DAUTHENTICATEDCONFIGURE_ENCRYPTIONWHENACCESSIBLE, + 0x41fff286, 0x6ae0, 0x4d43, 0x9d, 0x55, 0xa4, 0x6e, 0x9e, 0xfd, 0x15, 0x8a} +STRUCT!{struct D3DAUTHENTICATEDCHANNEL_CONFIGUREUNCOMPRESSEDENCRYPTION { + Parameters: D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT, + EncryptionGuid: GUID, +}} +STRUCT!{struct D3DENCRYPTED_BLOCK_INFO { + NumEncryptedBytesAtBeginning: UINT, + NumBytesInSkipPattern: UINT, + NumBytesInEncryptPattern: UINT, +}} +STRUCT!{struct D3DAES_CTR_IV { + IV: UINT64, + Count: UINT64, +}} diff --git a/bash-5.1/vendor/winapi/src/shared/d3dkmdt.rs b/bash-5.1/vendor/winapi/src/shared/d3dkmdt.rs new file mode 100644 index 0000000000000000000000000000000000000000..89d574f12f3051c7671ef6c672d0c92377aec5a0 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/d3dkmdt.rs @@ -0,0 +1,45 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Longhorn Display Driver Model (LDDM) kernel mode data type definitions +use shared::basetsd::UINT32; +use shared::minwindef::UINT; +use shared::ntdef::{BOOLEAN, WCHAR}; +//1932 +pub const DXGK_MAX_METADATA_NAME_LENGTH: usize = 32; +ENUM!{enum DXGK_ENGINE_TYPE { + DXGK_ENGINE_TYPE_OTHER, + DXGK_ENGINE_TYPE_3D, + DXGK_ENGINE_TYPE_VIDEO_DECODE, + DXGK_ENGINE_TYPE_VIDEO_ENCODE, + DXGK_ENGINE_TYPE_VIDEO_PROCESSING, + DXGK_ENGINE_TYPE_SCENE_ASSEMBLY, + DXGK_ENGINE_TYPE_COPY, + DXGK_ENGINE_TYPE_OVERLAY, + DXGK_ENGINE_TYPE_CRYPTO, + DXGK_ENGINE_TYPE_MAX, +}} +STRUCT!{#[repr(packed)] struct DXGK_NODEMETADATA_FLAGS { + Value: UINT32, +}} +BITFIELD!{DXGK_NODEMETADATA_FLAGS Value: UINT32 [ + ContextSchedulingSupported set_ContextSchedulingSupported[0..1], + RingBufferFenceRelease set_RingBufferFenceRelease[1..2], + SupportTrackedWorkload set_SupportTrackedWorkload[2..3], + Reserved set_Reserved[3..16], + MaxInFlightHwQueueBuffers set_MaxInFlightHwQueueBuffers[16..32], +]} +STRUCT!{#[repr(packed)] struct DXGK_NODEMETADATA { + EngineType: DXGK_ENGINE_TYPE, + FriendlyName: [WCHAR; DXGK_MAX_METADATA_NAME_LENGTH], + Flags: DXGK_NODEMETADATA_FLAGS, + GpuMmuSupported: BOOLEAN, + IoMmuSupported: BOOLEAN, +}} +//2100 +STRUCT!{#[repr(packed)] struct D3DKMT_NODEMETADATA { + NodeOrdinalAndAdapterIndex: UINT, + NodeData: DXGK_NODEMETADATA, +}} diff --git a/bash-5.1/vendor/winapi/src/shared/d3dukmdt.rs b/bash-5.1/vendor/winapi/src/shared/d3dukmdt.rs new file mode 100644 index 0000000000000000000000000000000000000000..24bfc5064aaec0512cc5cacb095af9dcec735d6d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/d3dukmdt.rs @@ -0,0 +1,413 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Longhorn Display Driver Model (LDDM) user/kernel mode shared data type definitions. +use shared::basetsd::{UINT64, ULONG_PTR}; +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, UINT, ULONG}; +use shared::ntdef::{HANDLE, LUID, ULONGLONG, VOID}; +pub const DXGKDDI_INTERFACE_VERSION_VISTA: ULONG = 0x1052; +pub const DXGKDDI_INTERFACE_VERSION_VISTA_SP1: ULONG = 0x1053; +pub const DXGKDDI_INTERFACE_VERSION_WIN7: ULONG = 0x2005; +pub const DXGKDDI_INTERFACE_VERSION_WIN8: ULONG = 0x300E; +pub const DXGKDDI_INTERFACE_VERSION_WDDM1_3: ULONG = 0x4002; +pub const DXGKDDI_INTERFACE_VERSION_WDDM1_3_PATH_INDEPENDENT_ROTATION: ULONG = 0x4003; +pub const DXGKDDI_INTERFACE_VERSION_WDDM2_0: ULONG = 0x5023; +pub const DXGKDDI_INTERFACE_VERSION_WDDM2_1: ULONG = 0x6003; +pub const DXGKDDI_INTERFACE_VERSION_WDDM2_1_5: ULONG = 0x6010; +pub const DXGKDDI_INTERFACE_VERSION_WDDM2_2: ULONG = 0x700A; +pub const DXGKDDI_INTERFACE_VERSION_WDDM2_3: ULONG = 0x8001; +pub const DXGKDDI_INTERFACE_VERSION_WDDM2_4: ULONG = 0x9006; +pub const DXGKDDI_INTERFACE_VERSION_WDDM2_5: ULONG = 0xA00B; +#[inline] +pub fn IS_OFFICIAL_DDI_INTERFACE_VERSION(version: ULONG) -> bool { + (version == DXGKDDI_INTERFACE_VERSION_VISTA) || + (version == DXGKDDI_INTERFACE_VERSION_VISTA_SP1) || + (version == DXGKDDI_INTERFACE_VERSION_WIN7) || + (version == DXGKDDI_INTERFACE_VERSION_WIN8) || + (version == DXGKDDI_INTERFACE_VERSION_WDDM1_3) || + (version == DXGKDDI_INTERFACE_VERSION_WDDM1_3_PATH_INDEPENDENT_ROTATION) || + (version == DXGKDDI_INTERFACE_VERSION_WDDM2_0) || + (version == DXGKDDI_INTERFACE_VERSION_WDDM2_1) || + (version == DXGKDDI_INTERFACE_VERSION_WDDM2_1_5) || + (version == DXGKDDI_INTERFACE_VERSION_WDDM2_2) || + (version == DXGKDDI_INTERFACE_VERSION_WDDM2_3) || + (version == DXGKDDI_INTERFACE_VERSION_WDDM2_4) || + (version == DXGKDDI_INTERFACE_VERSION_WDDM2_5) +} +pub const DXGKDDI_INTERFACE_VERSION: ULONG = DXGKDDI_INTERFACE_VERSION_WDDM2_5; +pub const D3D_UMD_INTERFACE_VERSION_VISTA: ULONG = 0x000C; +pub const D3D_UMD_INTERFACE_VERSION_WIN7: ULONG = 0x2003; +pub const D3D_UMD_INTERFACE_VERSION_WIN8_M3: ULONG = 0x3001; +pub const D3D_UMD_INTERFACE_VERSION_WIN8_CP: ULONG = 0x3002; +pub const D3D_UMD_INTERFACE_VERSION_WIN8_RC: ULONG = 0x3003; +pub const D3D_UMD_INTERFACE_VERSION_WIN8: ULONG = 0x3004; +pub const D3D_UMD_INTERFACE_VERSION_WDDM1_3: ULONG = 0x4002; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_0_M1: ULONG = 0x5000; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_0_M1_3: ULONG = 0x5001; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_0_M2_2: ULONG = 0x5002; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_0: ULONG = 0x5002; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_1_1: ULONG = 0x6000; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_1_2: ULONG = 0x6001; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_1_3: ULONG = 0x6002; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_1_4: ULONG = 0x6003; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_1: ULONG = D3D_UMD_INTERFACE_VERSION_WDDM2_1_4; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_2_1: ULONG = 0x7000; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_2_2: ULONG = 0x7001; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_2: ULONG = D3D_UMD_INTERFACE_VERSION_WDDM2_2_2; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_3_1: ULONG = 0x8000; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_3_2: ULONG = 0x8001; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_3: ULONG = D3D_UMD_INTERFACE_VERSION_WDDM2_3_2; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_4_1: ULONG = 0x9000; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_4_2: ULONG = 0x9001; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_4: ULONG = D3D_UMD_INTERFACE_VERSION_WDDM2_4_2; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_5_1: ULONG = 0xA000; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_5_2: ULONG = 0xA001; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_5_3: ULONG = 0xA002; +pub const D3D_UMD_INTERFACE_VERSION_WDDM2_5: ULONG = D3D_UMD_INTERFACE_VERSION_WDDM2_5_3; +pub const D3D_UMD_INTERFACE_VERSION: ULONG = D3D_UMD_INTERFACE_VERSION_WDDM2_5; +pub type D3DGPU_VIRTUAL_ADDRESS = ULONGLONG; +pub type D3DGPU_SIZE_T = ULONGLONG; +pub const D3DGPU_UNIQUE_DRIVER_PROTECTION: ULONGLONG = 0x8000000000000000; +pub const DXGK_MAX_PAGE_TABLE_LEVEL_COUNT: UINT = 6; +pub const DXGK_MIN_PAGE_TABLE_LEVEL_COUNT: UINT = 2; +STRUCT!{struct GPUP_DRIVER_ESCAPE_INPUT { + vfLUID: LUID, +}} +pub type PGPUP_DRIVER_ESCAPE_INPUT = *mut GPUP_DRIVER_ESCAPE_INPUT; +ENUM!{enum DXGKVGPU_ESCAPE_TYPE { + DXGKVGPU_ESCAPE_TYPE_READ_PCI_CONFIG = 0, + DXGKVGPU_ESCAPE_TYPE_WRITE_PCI_CONFIG = 1, + DXGKVGPU_ESCAPE_TYPE_INITIALIZE = 2, + DXGKVGPU_ESCAPE_TYPE_RELEASE = 3, + DXGKVGPU_ESCAPE_TYPE_GET_VGPU_TYPE = 4, + DXGKVGPU_ESCAPE_TYPE_POWERTRANSITIONCOMPLETE = 5, +}} +STRUCT!{struct DXGKVGPU_ESCAPE_HEAD { + Luid: GPUP_DRIVER_ESCAPE_INPUT, + Type: DXGKVGPU_ESCAPE_TYPE, +}} +STRUCT!{struct DXGKVGPU_ESCAPE_READ_PCI_CONFIG { + Header: DXGKVGPU_ESCAPE_HEAD, + Offset: UINT, + Size: UINT, +}} +STRUCT!{struct DXGKVGPU_ESCAPE_WRITE_PCI_CONFIG { + Header: DXGKVGPU_ESCAPE_HEAD, + Offset: UINT, + Size: UINT, +}} +STRUCT!{struct DXGKVGPU_ESCAPE_READ_VGPU_TYPE { + Header: DXGKVGPU_ESCAPE_HEAD, +}} +STRUCT!{struct DXGKVGPU_ESCAPE_POWERTRANSITIONCOMPLETE { + Header: DXGKVGPU_ESCAPE_HEAD, + PowerState: UINT, +}} +STRUCT!{struct DXGKVGPU_ESCAPE_INITIALIZE { + Header: DXGKVGPU_ESCAPE_HEAD, + VmGuid: GUID, +}} +STRUCT!{struct DXGKVGPU_ESCAPE_RELEASE { + Header: DXGKVGPU_ESCAPE_HEAD, +}} +ENUM!{enum DXGK_PTE_PAGE_SIZE { + DXGK_PTE_PAGE_TABLE_PAGE_4KB = 0, + DXGK_PTE_PAGE_TABLE_PAGE_64KB = 1, +}} +UNION!{union DXGK_PTE_u { + [u64; 1], + PageAddress PageAddress_mut: ULONGLONG, + PageTableAddress PageTableAddress_mut: ULONGLONG, +}} +STRUCT!{struct DXGK_PTE { + Flags: ULONGLONG, + u: DXGK_PTE_u, +}} +BITFIELD!{DXGK_PTE Flags: ULONGLONG [ + Valid set_Valid[0..1], + Zero set_Zero[1..2], + CacheCoherent set_CacheCoherent[2..3], + ReadOnly set_ReadOnly[3..4], + NoExecute set_NoExecute[4..5], + Segment set_Segment[5..10], + LargePage set_LargePage[10..11], + PhysicalAdapterIndex set_PhysicalAdapterIndex[11..17], + PageTablePageSize set_PageTablePageSize[17..19], + SystemReserved0 set_SystemReserved0[19..20], + Reserved set_Reserved[20..64], +]} +pub const D3DGPU_NULL: D3DGPU_VIRTUAL_ADDRESS = 0; +pub const D3DDDI_MAX_WRITTEN_PRIMARIES: usize = 16; +pub const D3DDDI_MAX_MPO_PRESENT_DIRTY_RECTS: usize = 0xFFF; +STRUCT!{struct D3DGPU_PHYSICAL_ADDRESS { + SegmentId: UINT, + SegmentOffset: UINT64, +}} +pub type D3DDDI_VIDEO_PRESENT_SOURCE_ID = UINT; +pub type D3DDDI_VIDEO_PRESENT_TARGET_ID = UINT; +pub type D3DKMT_HANDLE = UINT; +STRUCT!{struct D3DDDI_RATIONAL { + Numerator: UINT, + Denominator: UINT, +}} +STRUCT!{struct D3DDDI_ALLOCATIONINFO { + hAllocation: D3DKMT_HANDLE, + pSystemMem: *const VOID, + pPrivateDriverData: *mut VOID, + PrivateDriverDataSize: UINT, + VidPnSourceId: D3DDDI_VIDEO_PRESENT_SOURCE_ID, + Flags: UINT, +}} +BITFIELD!{D3DDDI_ALLOCATIONINFO Flags: UINT [ + Primary set_Primary[0..1], + Stereo set_Stereo[1..2], + Reserved set_Reserved[2..32], +]} +UNION!{union D3DDDI_ALLOCATIONINFO2_u1 { + [usize; 1], + hSection hSection_mut: HANDLE, + pSystemMem pSystemMem_mut: *const VOID, +}} +UNION!{union D3DDDI_ALLOCATIONINFO2_u2 { + [usize; 1], + Priority Priority_mut: UINT, + Unused Unused_mut: ULONG_PTR, +}} +STRUCT!{struct D3DDDI_ALLOCATIONINFO2 { + hAllocation: D3DKMT_HANDLE, + u1: D3DDDI_ALLOCATIONINFO2_u1, + pPrivateDriverData: *mut VOID, + PrivateDriverDataSize: UINT, + VidPnSourceId: D3DDDI_VIDEO_PRESENT_SOURCE_ID, + Flags: UINT, + GpuVirtualAddress: D3DGPU_VIRTUAL_ADDRESS, + u2: D3DDDI_ALLOCATIONINFO2_u2, + Reserved: [ULONG_PTR; 5], +}} +BITFIELD!{D3DDDI_ALLOCATIONINFO2 Flags: UINT [ + Primary set_Primary[0..1], + Stereo set_Stereo[1..2], + OverridePriority set_OverridePriority[2..3], + Reserved set_Reserved[3..32], +]} +STRUCT!{struct D3DDDI_OPENALLOCATIONINFO { + hAllocation: D3DKMT_HANDLE, + pPrivateDriverData: *const VOID, + PrivateDriverDataSize: UINT, +}} +STRUCT!{struct D3DDDI_OPENALLOCATIONINFO2 { + hAllocation: D3DKMT_HANDLE, + pPrivateDriverData: *const VOID, + PrivateDriverDataSize: UINT, + GpuVirtualAddress: D3DGPU_VIRTUAL_ADDRESS, + Reserved: [ULONG_PTR; 6], +}} +ENUM!{enum D3DDDI_OFFER_PRIORITY { + D3DDDI_OFFER_PRIORITY_NONE = 0, + D3DDDI_OFFER_PRIORITY_LOW = 1, + D3DDDI_OFFER_PRIORITY_NORMAL, + D3DDDI_OFFER_PRIORITY_HIGH, + D3DDDI_OFFER_PRIORITY_AUTO, +}} +STRUCT!{struct D3DDDI_ALLOCATIONLIST { + hAllocation: D3DKMT_HANDLE, + Value: UINT, +}} +BITFIELD!{D3DDDI_ALLOCATIONLIST Value: UINT [ + WriteOperation set_WriteOperation[0..1], + DoNotRetireInstance set_DoNotRetireInstance[1..2], + OfferPriority set_OfferPriority[2..5], + Reserved set_Reserved[5..32], +]} +STRUCT!{struct D3DDDI_PATCHLOCATIONLIST { + AllocationIndex: UINT, + Value: UINT, + DriverId: UINT, + AllocationOffset: UINT, + PatchOffset: UINT, + SplitOffset: UINT, +}} +BITFIELD!{D3DDDI_PATCHLOCATIONLIST Value: UINT [ + SlotId set_SlotId[0..24], + Reserved set_Reserved[24..32], +]} +STRUCT!{struct D3DDDICB_LOCKFLAGS { + Value: UINT, +}} +BITFIELD!{D3DDDICB_LOCKFLAGS Value: UINT [ + ReadOnly set_ReadOnly[0..1], + WriteOnly set_WriteOnly[1..2], + DonotWait set_DonotWait[2..3], + IgnoreSync set_IgnoreSync[3..4], + LockEntire set_LockEntire[4..5], + DonotEvict set_DonotEvict[5..6], + AcquireAperture set_AcquireAperture[6..7], + Discard set_Discard[7..8], + NoExistingReference set_NoExistingReference[8..9], + UseAlternateVA set_UseAlternateVA[9..10], + IgnoreReadSync set_IgnoreReadSync[10..11], + Reserved set_Reserved[11..32], +]} +STRUCT!{struct D3DDDICB_LOCK2FLAGS { + Value: UINT, +}} +STRUCT!{struct D3DDDICB_DESTROYALLOCATION2FLAGS { + Value: UINT, +}} +BITFIELD!{D3DDDICB_DESTROYALLOCATION2FLAGS Value: UINT [ + AssumeNotInUse set_AssumeNotInUse[0..1], + SynchronousDestroy set_SynchronousDestroy[1..2], + Reserved set_Reserved[2..31], + SystemUseOnly set_SystemUseOnly[31..32], +]} +STRUCT!{struct D3DDDI_ESCAPEFLAGS { + Value: UINT, +}} +BITFIELD!{D3DDDI_ESCAPEFLAGS Value: UINT [ + HardwareAccess set_HardwareAccess[0..1], + DeviceStatusQuery set_DeviceStatusQuery[1..2], + ChangeFrameLatency set_ChangeFrameLatency[2..3], + NoAdapterSynchronization set_NoAdapterSynchronization[3..4], + Reserved set_Reserved[4..5], + VirtualMachineData set_VirtualMachineData[5..6], + DriverKnownEscape set_DriverKnownEscape[6..7], + DriverCommonEscape set_DriverCommonEscape[7..8], + Reserved2 set_Reserved2[8..24], +]} +ENUM!{enum D3DDDI_DRIVERESCAPETYPE { + D3DDDI_DRIVERESCAPETYPE_TRANSLATEALLOCATIONHANDLE = 0, + D3DDDI_DRIVERESCAPETYPE_TRANSLATERESOURCEHANDLE = 1, + D3DDDI_DRIVERESCAPETYPE_MAX, +}} +STRUCT!{struct D3DDDI_DRIVERESCAPE_TRANSLATEALLOCATIONEHANDLE { + EscapeType: D3DDDI_DRIVERESCAPETYPE, + hAllocation: D3DKMT_HANDLE, +}} +STRUCT!{struct D3DDDI_DRIVERESCAPE_TRANSLATERESOURCEHANDLE { + EscapeType: D3DDDI_DRIVERESCAPETYPE, + hResource: D3DKMT_HANDLE, +}} +STRUCT!{struct D3DDDI_CREATECONTEXTFLAGS { + Value: UINT, +}} +BITFIELD!{D3DDDI_CREATECONTEXTFLAGS Value: UINT [ + NullRendering set_NullRendering[0..1], + InitialData set_InitialData[1..2], + DisableGpuTimeout set_DisableGpuTimeout[2..3], + SynchronizationOnly set_SynchronizationOnly[3..4], + HwQueueSupported set_HwQueueSupported[4..5], + Reserved set_Reserved[5..32], +]} +//1188 +STRUCT!{struct D3DDDICB_SIGNALFLAGS { + Value: UINT, +}} +BITFIELD!{D3DDDICB_SIGNALFLAGS Value: UINT [ + SignalAtSubmission set_SignalAtSubmission[0..1], + EnqueueCpuEvent set_EnqueueCpuEvent[1..2], + AllowFenceRewind set_AllowFenceRewind[2..3], + Reserved set_Reserved[3..31], + DXGK_SIGNAL_FLAG_INTERNAL0 set_DXGK_SIGNAL_FLAG_INTERNAL0[31..32], +]} +pub const D3DDDI_MAX_OBJECT_WAITED_ON: usize = 32; +pub const D3DDDI_MAX_OBJECT_SIGNALED: usize = 32; +ENUM!{enum D3DDDI_SYNCHRONIZATIONOBJECT_TYPE { + D3DDDI_SYNCHRONIZATION_MUTEX = 1, + D3DDDI_SEMAPHORE = 2, + D3DDDI_FENCE = 3, + D3DDDI_CPU_NOTIFICATION = 4, + D3DDDI_MONITORED_FENCE = 5, + D3DDDI_PERIODIC_MONITORED_FENCE = 6, + D3DDDI_SYNCHRONIZATION_TYPE_LIMIT, +}} +//1553 +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO_u_SynchronizationMutex { + InitialState: BOOL, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO_u_Semaphore { + MaxCount: UINT, + InitialCount: UINT, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO_u_Reserved { + Reserved: [UINT; 16], +}} +UNION!{union D3DDDI_SYNCHRONIZATIONOBJECTINFO_u { + [u32; 16], + SynchronizationMutex SynchronizationMutex_mut: + D3DDDI_SYNCHRONIZATIONOBJECTINFO_u_SynchronizationMutex, + Semaphore Semaphore_mut: D3DDDI_SYNCHRONIZATIONOBJECTINFO_u_Semaphore, + Reserved Reserved_mut: D3DDDI_SYNCHRONIZATIONOBJECTINFO_u_Reserved, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO { + Type: D3DDDI_SYNCHRONIZATIONOBJECT_TYPE, + u: D3DDDI_SYNCHRONIZATIONOBJECTINFO_u, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECT_FLAGS { + Value: UINT, +}} +BITFIELD!{D3DDDI_SYNCHRONIZATIONOBJECT_FLAGS Value: UINT [ + Shared set_Shared[0..1], + NtSecuritySharing set_NtSecuritySharing[1..2], + CrossAdapter set_CrossAdapter[2..3], + TopOfPipeline set_TopOfPipeline[3..4], + NoSignal set_NoSignal[4..5], + NoWait set_NoWait[5..6], + NoSignalMaxValueOnTdr set_NoSignalMaxValueOnTdr[6..7], + NoGPUAccess set_NoGPUAccess[7..8], + Reserved set_Reserved[8..31], + D3DDDI_SYNCHRONIZATIONOBJECT_FLAGS_RESERVED0 + set_D3DDDI_SYNCHRONIZATIONOBJECT_FLAGS_RESERVED0[31..32], +]} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_SynchronizationMutex { + InitialState: BOOL, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_Semaphore { + MaxCount: UINT, + InitialCount: UINT, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_Fence { + FenceValue: UINT64, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_CPUNotification { + Event: HANDLE, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_MonitoredFence { + InitialFenceValue: UINT64, + FenceValueCPUVirtualAddress: *mut VOID, + FenceValueGPUVirtualAddress: D3DGPU_VIRTUAL_ADDRESS, + EngineAffinity: UINT, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_PeriodicMonitoredFence { + hAdapter: D3DKMT_HANDLE, + VidPnTargetId: D3DDDI_VIDEO_PRESENT_TARGET_ID, + Time: UINT64, + FenceValueCPUVirtualAddress: *mut VOID, + FenceValueGPUVirtualAddress: D3DGPU_VIRTUAL_ADDRESS, + EngineAffinity: UINT, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_Reserved { + Reserved: [UINT64; 8], +}} +UNION!{union D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u { + [u64; 8], + SynchronizationMutex SynchronizationMutex_mut: + D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_SynchronizationMutex, + Semaphore Semaphore_mut: D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_Semaphore, + Fence Fence_mut: D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_Fence, + CPUNotification CPUNotification_mut: D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_CPUNotification, + MonitoredFence MonitoredFence_mut: D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_MonitoredFence, + PeriodicMonitoredFence PeriodicMonitoredFence_mut: + D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_PeriodicMonitoredFence, + Reserved Reserved_mut: D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u_Reserved, +}} +STRUCT!{struct D3DDDI_SYNCHRONIZATIONOBJECTINFO2 { + Type: D3DDDI_SYNCHRONIZATIONOBJECT_TYPE, + Flags: D3DDDI_SYNCHRONIZATIONOBJECT_FLAGS, + u: D3DDDI_SYNCHRONIZATIONOBJECTINFO2_u, + SharedHandle: D3DKMT_HANDLE, +}} +//1778 +pub const D3DDDI_MAX_BROADCAST_CONTEXT: usize = 64; diff --git a/bash-5.1/vendor/winapi/src/shared/dcomptypes.rs b/bash-5.1/vendor/winapi/src/shared/dcomptypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..4d45d3c90a52add6ef43a89df46b2515e3b2d452 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/dcomptypes.rs @@ -0,0 +1,50 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dcomptypes.h +use shared::dxgitype::DXGI_RATIONAL; +use shared::minwindef::DWORD; +use um::winnt::LARGE_INTEGER; +ENUM!{enum DCOMPOSITION_BITMAP_INTERPOLATION_MODE { + DCOMPOSITION_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, + DCOMPOSITION_BITMAP_INTERPOLATION_MODE_LINEAR = 1, + DCOMPOSITION_BITMAP_INTERPOLATION_MODE_INHERIT = 0xffffffff, +}} +ENUM!{enum DCOMPOSITION_BORDER_MODE { + DCOMPOSITION_BORDER_MODE_SOFT = 0, + DCOMPOSITION_BORDER_MODE_HARD = 1, + DCOMPOSITION_BORDER_MODE_INHERIT = 0xffffffff, +}} +ENUM!{enum DCOMPOSITION_COMPOSITE_MODE { + DCOMPOSITION_COMPOSITE_MODE_SOURCE_OVER = 0, + DCOMPOSITION_COMPOSITE_MODE_DESTINATION_INVERT = 1, + DCOMPOSITION_COMPOSITE_MODE_MIN_BLEND = 2, + DCOMPOSITION_COMPOSITE_MODE_INHERIT = 0xffffffff, +}} +ENUM!{enum DCOMPOSITION_BACKFACE_VISIBILITY { + DCOMPOSITION_BACKFACE_VISIBILITY_VISIBLE = 0, + DCOMPOSITION_BACKFACE_VISIBILITY_HIDDEN = 1, + DCOMPOSITION_BACKFACE_VISIBILITY_INHERIT = 0xffffffff, +}} +ENUM!{enum DCOMPOSITION_OPACITY_MODE { + DCOMPOSITION_OPACITY_MODE_LAYER = 0, + DCOMPOSITION_OPACITY_MODE_MULTIPLY = 1, + DCOMPOSITION_OPACITY_MODE_INHERIT = 0xffffffff, +}} +ENUM!{enum DCOMPOSITION_DEPTH_MODE { + DCOMPOSITION_DEPTH_MODE_TREE = 0, + DCOMPOSITION_DEPTH_MODE_SPATIAL = 1, + DCOMPOSITION_DEPTH_MODE_INHERIT = 0xffffffff, +}} +STRUCT!{struct DCOMPOSITION_FRAME_STATISTICS { + lastFrameTime: LARGE_INTEGER, + currentCompositionRate: DXGI_RATIONAL, + currentTime: LARGE_INTEGER, + timeFrequency: LARGE_INTEGER, + nextEstimatedFrameTime: LARGE_INTEGER, +}} +pub const COMPOSITIONOBJECT_READ: DWORD = 0x0001; +pub const COMPOSITIONOBJECT_WRITE: DWORD = 0x0002; +pub const COMPOSITIONOBJECT_ALL_ACCESS: DWORD = COMPOSITIONOBJECT_READ | COMPOSITIONOBJECT_WRITE; diff --git a/bash-5.1/vendor/winapi/src/shared/devguid.rs b/bash-5.1/vendor/winapi/src/shared/devguid.rs new file mode 100644 index 0000000000000000000000000000000000000000..f163037b8d7464349a55965e7aa74486c5b0e668 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/devguid.rs @@ -0,0 +1,178 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Defines GUIDs for device classes used in Plug & Play. +DEFINE_GUID!{GUID_DEVCLASS_1394, + 0x6bdd1fc1, 0x810f, 0x11d0, 0xbe, 0xc7, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f} +DEFINE_GUID!{GUID_DEVCLASS_1394DEBUG, + 0x66f250d6, 0x7801, 0x4a64, 0xb1, 0x39, 0xee, 0xa8, 0x0a, 0x45, 0x0b, 0x24} +DEFINE_GUID!{GUID_DEVCLASS_61883, + 0x7ebefbc0, 0x3200, 0x11d2, 0xb4, 0xc2, 0x00, 0xa0, 0xc9, 0x69, 0x7d, 0x07} +DEFINE_GUID!{GUID_DEVCLASS_ADAPTER, + 0x4d36e964, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_APMSUPPORT, + 0xd45b1c18, 0xc8fa, 0x11d1, 0x9f, 0x77, 0x00, 0x00, 0xf8, 0x05, 0xf5, 0x30} +DEFINE_GUID!{GUID_DEVCLASS_AVC, + 0xc06ff265, 0xae09, 0x48f0, 0x81, 0x2c, 0x16, 0x75, 0x3d, 0x7c, 0xba, 0x83} +DEFINE_GUID!{GUID_DEVCLASS_BATTERY, + 0x72631e54, 0x78a4, 0x11d0, 0xbc, 0xf7, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a} +DEFINE_GUID!{GUID_DEVCLASS_BIOMETRIC, + 0x53d29ef7, 0x377c, 0x4d14, 0x86, 0x4b, 0xeb, 0x3a, 0x85, 0x76, 0x93, 0x59} +DEFINE_GUID!{GUID_DEVCLASS_BLUETOOTH, + 0xe0cbf06c, 0xcd8b, 0x4647, 0xbb, 0x8a, 0x26, 0x3b, 0x43, 0xf0, 0xf9, 0x74} +DEFINE_GUID!{GUID_DEVCLASS_CDROM, + 0x4d36e965, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_COMPUTER, + 0x4d36e966, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_DECODER, + 0x6bdd1fc2, 0x810f, 0x11d0, 0xbe, 0xc7, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f} +DEFINE_GUID!{GUID_DEVCLASS_DISKDRIVE, + 0x4d36e967, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_DISPLAY, + 0x4d36e968, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_DOT4, + 0x48721b56, 0x6795, 0x11d2, 0xb1, 0xa8, 0x00, 0x80, 0xc7, 0x2e, 0x74, 0xa2} +DEFINE_GUID!{GUID_DEVCLASS_DOT4PRINT, + 0x49ce6ac8, 0x6f86, 0x11d2, 0xb1, 0xe5, 0x00, 0x80, 0xc7, 0x2e, 0x74, 0xa2} +DEFINE_GUID!{GUID_DEVCLASS_ENUM1394, + 0xc459df55, 0xdb08, 0x11d1, 0xb0, 0x09, 0x00, 0xa0, 0xc9, 0x08, 0x1f, 0xf6} +DEFINE_GUID!{GUID_DEVCLASS_FDC, + 0x4d36e969, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_FLOPPYDISK, + 0x4d36e980, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_GPS, + 0x6bdd1fc3, 0x810f, 0x11d0, 0xbe, 0xc7, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f} +DEFINE_GUID!{GUID_DEVCLASS_HDC, + 0x4d36e96a, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_HIDCLASS, + 0x745a17a0, 0x74d3, 0x11d0, 0xb6, 0xfe, 0x00, 0xa0, 0xc9, 0x0f, 0x57, 0xda} +DEFINE_GUID!{GUID_DEVCLASS_IMAGE, + 0x6bdd1fc6, 0x810f, 0x11d0, 0xbe, 0xc7, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f} +DEFINE_GUID!{GUID_DEVCLASS_INFINIBAND, + 0x30ef7132, 0xd858, 0x4a0c, 0xac, 0x24, 0xb9, 0x02, 0x8a, 0x5c, 0xca, 0x3f} +DEFINE_GUID!{GUID_DEVCLASS_INFRARED, + 0x6bdd1fc5, 0x810f, 0x11d0, 0xbe, 0xc7, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f} +DEFINE_GUID!{GUID_DEVCLASS_KEYBOARD, + 0x4d36e96b, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_LEGACYDRIVER, + 0x8ecc055d, 0x047f, 0x11d1, 0xa5, 0x37, 0x00, 0x00, 0xf8, 0x75, 0x3e, 0xd1} +DEFINE_GUID!{GUID_DEVCLASS_MEDIA, + 0x4d36e96c, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_MEDIUM_CHANGER, + 0xce5939ae, 0xebde, 0x11d0, 0xb1, 0x81, 0x00, 0x00, 0xf8, 0x75, 0x3e, 0xc4} +DEFINE_GUID!{GUID_DEVCLASS_MODEM, + 0x4d36e96d, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_MEMORY, + 0x5099944a, 0xf6b9, 0x4057, 0xa0, 0x56, 0x8c, 0x55, 0x02, 0x28, 0x54, 0x4c} +DEFINE_GUID!{GUID_DEVCLASS_MONITOR, + 0x4d36e96e, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_MOUSE, + 0x4d36e96f, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_MTD, + 0x4d36e970, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_MULTIFUNCTION, + 0x4d36e971, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_MULTIPORTSERIAL, + 0x50906cb8, 0xba12, 0x11d1, 0xbf, 0x5d, 0x00, 0x00, 0xf8, 0x05, 0xf5, 0x30} +DEFINE_GUID!{GUID_DEVCLASS_NET, + 0x4d36e972, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_NETCLIENT, + 0x4d36e973, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_NETSERVICE, + 0x4d36e974, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_NETTRANS, + 0x4d36e975, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_NODRIVER, + 0x4d36e976, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_PCMCIA, + 0x4d36e977, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_PNPPRINTERS, + 0x4658ee7e, 0xf050, 0x11d1, 0xb6, 0xbd, 0x00, 0xc0, 0x4f, 0xa3, 0x72, 0xa7} +DEFINE_GUID!{GUID_DEVCLASS_PORTS, + 0x4d36e978, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_PRINTER, + 0x4d36e979, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_PRINTERUPGRADE, + 0x4d36e97a, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_PROCESSOR, + 0x50127dc3, 0x0f36, 0x415e, 0xa6, 0xcc, 0x4c, 0xb3, 0xbe, 0x91, 0x0B, 0x65} +DEFINE_GUID!{GUID_DEVCLASS_SBP2, + 0xd48179be, 0xec20, 0x11d1, 0xb6, 0xb8, 0x00, 0xc0, 0x4f, 0xa3, 0x72, 0xa7} +DEFINE_GUID!{GUID_DEVCLASS_SCSIADAPTER, + 0x4d36e97b, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_SECURITYACCELERATOR, + 0x268c95a1, 0xedfe, 0x11d3, 0x95, 0xc3, 0x00, 0x10, 0xdc, 0x40, 0x50, 0xa5} +DEFINE_GUID!{GUID_DEVCLASS_SENSOR, + 0x5175d334, 0xc371, 0x4806, 0xb3, 0xba, 0x71, 0xfd, 0x53, 0xc9, 0x25, 0x8d} +DEFINE_GUID!{GUID_DEVCLASS_SIDESHOW, + 0x997b5d8d, 0xc442, 0x4f2e, 0xba, 0xf3, 0x9c, 0x8e, 0x67, 0x1e, 0x9e, 0x21} +DEFINE_GUID!{GUID_DEVCLASS_SMARTCARDREADER, + 0x50dd5230, 0xba8a, 0x11d1, 0xbf, 0x5d, 0x00, 0x00, 0xf8, 0x05, 0xf5, 0x30} +DEFINE_GUID!{GUID_DEVCLASS_SOUND, + 0x4d36e97c, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_SYSTEM, + 0x4d36e97d, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_TAPEDRIVE, + 0x6d807884, 0x7d21, 0x11cf, 0x80, 0x1c, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_UNKNOWN, + 0x4d36e97e, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_DEVCLASS_USB, + 0x36fc9e60, 0xc465, 0x11cf, 0x80, 0x56, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_DEVCLASS_VOLUME, + 0x71a27cdd, 0x812a, 0x11d0, 0xbe, 0xc7, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f} +DEFINE_GUID!{GUID_DEVCLASS_VOLUMESNAPSHOT, + 0x533c5b84, 0xec70, 0x11d2, 0x95, 0x05, 0x00, 0xc0, 0x4f, 0x79, 0xde, 0xaf} +DEFINE_GUID!{GUID_DEVCLASS_WCEUSBS, + 0x25dbce51, 0x6c8f, 0x4a72, 0x8a, 0x6d, 0xb5, 0x4c, 0x2b, 0x4f, 0xc8, 0x35} +DEFINE_GUID!{GUID_DEVCLASS_WPD, + 0xeec5ad98, 0x8080, 0x425f, 0x92, 0x2a, 0xda, 0xbf, 0x3d, 0xe3, 0xf6, 0x9a} +DEFINE_GUID!{GUID_DEVCLASS_EHSTORAGESILO, + 0x9da2b80f, 0xf89f, 0x4a49, 0xa5, 0xc2, 0x51, 0x1b, 0x08, 0x5b, 0x9e, 0x8a} +DEFINE_GUID!{GUID_DEVCLASS_FIRMWARE, + 0xf2e7dd72, 0x6468, 0x4e36, 0xb6, 0xf1, 0x64, 0x88, 0xf4, 0x2c, 0x1b, 0x52} +DEFINE_GUID!{GUID_DEVCLASS_EXTENSION, + 0xe2f84ce7, 0x8efa, 0x411c, 0xaa, 0x69, 0x97, 0x45, 0x4c, 0xa4, 0xcb, 0x57} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_TOP, + 0xb369baf4, 0x5568, 0x4e82, 0xa8, 0x7e, 0xa9, 0x3e, 0xb1, 0x6b, 0xca, 0x87} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_ACTIVITYMONITOR, + 0xb86dff51, 0xa31e, 0x4bac, 0xb3, 0xcf, 0xe8, 0xcf, 0xe7, 0x5c, 0x9f, 0xc2} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_UNDELETE, + 0xfe8f1572, 0xc67a, 0x48c0, 0xbb, 0xac, 0x0b, 0x5c, 0x6d, 0x66, 0xca, 0xfb} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_ANTIVIRUS, + 0xb1d1a169, 0xc54f, 0x4379, 0x81, 0xdb, 0xbe, 0xe7, 0xd8, 0x8d, 0x74, 0x54} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_REPLICATION, + 0x48d3ebc4, 0x4cf8, 0x48ff, 0xb8, 0x69, 0x9c, 0x68, 0xad, 0x42, 0xeb, 0x9f} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_CONTINUOUSBACKUP, + 0x71aa14f8, 0x6fad, 0x4622, 0xad, 0x77, 0x92, 0xbb, 0x9d, 0x7e, 0x69, 0x47} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_CONTENTSCREENER, + 0x3e3f0674, 0xc83c, 0x4558, 0xbb, 0x26, 0x98, 0x20, 0xe1, 0xeb, 0xa5, 0xc5} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_QUOTAMANAGEMENT, + 0x8503c911, 0xa6c7, 0x4919, 0x8f, 0x79, 0x50, 0x28, 0xf5, 0x86, 0x6b, 0x0c} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_SYSTEMRECOVERY, + 0x2db15374, 0x706e, 0x4131, 0xa0, 0xc7, 0xd7, 0xc7, 0x8e, 0xb0, 0x28, 0x9a} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_CFSMETADATASERVER, + 0xcdcf0939, 0xb75b, 0x4630, 0xbf, 0x76, 0x80, 0xf7, 0xba, 0x65, 0x58, 0x84} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_HSM, + 0xd546500a, 0x2aeb, 0x45f6, 0x94, 0x82, 0xf4, 0xb1, 0x79, 0x9c, 0x31, 0x77} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_COMPRESSION, + 0xf3586baf, 0xb5aa, 0x49b5, 0x8d, 0x6c, 0x05, 0x69, 0x28, 0x4c, 0x63, 0x9f} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_ENCRYPTION, + 0xa0a701c0, 0xa511, 0x42ff, 0xaa, 0x6c, 0x06, 0xdc, 0x03, 0x95, 0x57, 0x6f} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_VIRTUALIZATION, + 0xf75a86c0, 0x10d8, 0x4c3a, 0xb2, 0x33, 0xed, 0x60, 0xe4, 0xcd, 0xfa, 0xac} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_PHYSICALQUOTAMANAGEMENT, + 0x6a0a8e78, 0xbba6, 0x4fc4, 0xa7, 0x09, 0x1e, 0x33, 0xcd, 0x09, 0xd6, 0x7e} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_OPENFILEBACKUP, + 0xf8ecafa6, 0x66d1, 0x41a5, 0x89, 0x9b, 0x66, 0x58, 0x5d, 0x72, 0x16, 0xb7} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_SECURITYENHANCER, + 0xd02bc3da, 0x0c8e, 0x4945, 0x9b, 0xd5, 0xf1, 0x88, 0x3c, 0x22, 0x6c, 0x8c} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_COPYPROTECTION, + 0x89786ff1, 0x9c12, 0x402f, 0x9c, 0x9e, 0x17, 0x75, 0x3c, 0x7f, 0x43, 0x75} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_BOTTOM, + 0x37765ea0, 0x5958, 0x4fc9, 0xb0, 0x4b, 0x2f, 0xdf, 0xef, 0x97, 0xe5, 0x9e} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_SYSTEM, + 0x5d1b9aaa, 0x01e2, 0x46af, 0x84, 0x9f, 0x27, 0x2b, 0x3f, 0x32, 0x4c, 0x46} +DEFINE_GUID!{GUID_DEVCLASS_FSFILTER_INFRASTRUCTURE, + 0xe55fa6f9, 0x128c, 0x4d04, 0xab, 0xab, 0x63, 0x0c, 0x74, 0xb1, 0x45, 0x3a} diff --git a/bash-5.1/vendor/winapi/src/shared/devpkey.rs b/bash-5.1/vendor/winapi/src/shared/devpkey.rs new file mode 100644 index 0000000000000000000000000000000000000000..db6855796453c5656038629855c8091b45c5734b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/devpkey.rs @@ -0,0 +1,401 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! Defines property keys for the Plug and Play Device Property API. +use shared::devpropdef::DEVPROPKEY; +DEFINE_DEVPROPKEY!{DEVPKEY_NAME, + 0xb725f130, 0x47ef, 0x101a, 0xa5, 0xf1, 0x02, 0x60, 0x8c, 0x9e, 0xeb, 0xac, 10} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DeviceDesc, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_HardwareIds, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_CompatibleIds, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 4} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Service, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 6} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Class, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 9} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ClassGuid, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 10} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Driver, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 11} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ConfigFlags, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 12} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Manufacturer, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 13} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_FriendlyName, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_LocationInfo, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 15} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_PDOName, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 16} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Capabilities, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 17} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_UINumber, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 18} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_UpperFilters, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 19} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_LowerFilters, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 20} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_BusTypeGuid, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 21} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_LegacyBusType, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 22} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_BusNumber, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 23} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_EnumeratorName, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 24} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Security, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 25} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_SecuritySDS, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 26} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DevType, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 27} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Exclusive, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 28} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Characteristics, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 29} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Address, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 30} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_UINumberDescFormat, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 31} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_PowerData, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 32} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_RemovalPolicy, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 33} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_RemovalPolicyDefault, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 34} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_RemovalPolicyOverride, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 35} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_InstallState, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 36} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_LocationPaths, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 37} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_BaseContainerId, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 38} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_InstanceId, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 256} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DevNodeStatus, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ProblemCode, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_EjectionRelations, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 4} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_RemovalRelations, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 5} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_PowerRelations, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 6} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_BusRelations, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 7} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Parent, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 8} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Children, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 9} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Siblings, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 10} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_TransportRelations, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 11} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ProblemStatus, + 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 12} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Reported, + 0x80497100, 0x8c73, 0x48b9, 0xaa, 0xd9, 0xce, 0x38, 0x7e, 0x19, 0xc5, 0x6e, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Legacy, + 0x80497100, 0x8c73, 0x48b9, 0xaa, 0xd9, 0xce, 0x38, 0x7e, 0x19, 0xc5, 0x6e, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ContainerId, + 0x8c7ed206, 0x3f8a, 0x4827, 0xb3, 0xab, 0xae, 0x9e, 0x1f, 0xae, 0xfc, 0x6c, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_InLocalMachineContainer, + 0x8c7ed206, 0x3f8a, 0x4827, 0xb3, 0xab, 0xae, 0x9e, 0x1f, 0xae, 0xfc, 0x6c, 4} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Model, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 39} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ModelId, + 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_FriendlyNameAttributes, + 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ManufacturerAttributes, + 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 4} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_PresenceNotForDevice, + 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 5} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_SignalStrength, + 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 6} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_IsAssociateableByUserAction, + 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 7} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ShowInUninstallUI, + 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 8} +pub const DEVPKEY_Numa_Proximity_Domain: DEVPROPKEY = DEVPKEY_Device_Numa_Proximity_Domain; +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Numa_Proximity_Domain, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 1} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DHP_Rebalance_Policy, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Numa_Node, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_BusReportedDeviceDesc, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 4} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_IsPresent, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 5} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_HasProblem, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 6} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ConfigurationId, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 7} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ReportedDeviceIdsHash, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 8} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_PhysicalDeviceLocation, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 9} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_BiosDeviceName, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 10} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverProblemDesc, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 11} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DebuggerSafe, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 12} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_PostInstallInProgress, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 13} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_Stack, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 14} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ExtendedConfigurationIds, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 15} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_IsRebootRequired, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 16} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_FirmwareDate, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 17} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_FirmwareVersion, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 18} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_FirmwareRevision, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 19} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DependencyProviders, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 20} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DependencyDependents, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 21} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_SoftRestartSupported, + 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 22} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_SessionId, + 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 6} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_InstallDate, + 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 100} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_FirstInstallDate, + 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 101} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_LastArrivalDate, + 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 102} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_LastRemovalDate, + 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 103} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverDate, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverVersion, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverDesc, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 4} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverInfPath, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 5} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverInfSection, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 6} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverInfSectionExt, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 7} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_MatchingDeviceId, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 8} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverProvider, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 9} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverPropPageProvider, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 10} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverCoInstallers, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 11} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ResourcePickerTags, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 12} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_ResourcePickerExceptions, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 13} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverRank, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 14} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_DriverLogoLevel, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 15} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_NoConnectSound, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 17} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_GenericDriverInstalled, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 18} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_AdditionalSoftwareRequested, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 19} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_SafeRemovalRequired, + 0xafd97640, 0x86a3, 0x4210, 0xb6, 0x7c, 0x28, 0x9c, 0x41, 0xaa, 0xbe, 0x55, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_Device_SafeRemovalRequiredOverride, + 0xafd97640, 0x86a3, 0x4210, 0xb6, 0x7c, 0x28, 0x9c, 0x41, 0xaa, 0xbe, 0x55, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_DrvPkg_Model, + 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_DrvPkg_VendorWebSite, + 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_DrvPkg_DetailedDescription, + 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 4} +DEFINE_DEVPROPKEY!{DEVPKEY_DrvPkg_DocumentationLink, + 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 5} +DEFINE_DEVPROPKEY!{DEVPKEY_DrvPkg_Icon, + 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 6} +DEFINE_DEVPROPKEY!{DEVPKEY_DrvPkg_BrandingIcon, + 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 7} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_UpperFilters, + 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 19} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_LowerFilters, + 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 20} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_Security, + 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 25} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_SecuritySDS, + 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 26} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_DevType, + 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 27} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_Exclusive, + 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 28} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_Characteristics, + 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 29} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_Name, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_ClassName, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_Icon, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 4} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_ClassInstaller, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 5} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_PropPageProvider, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 6} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_NoInstallClass, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 7} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_NoDisplayClass, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 8} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_SilentInstall, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 9} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_NoUseClass, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 10} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_DefaultService, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 11} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_IconPath, + 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 12} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_DHPRebalanceOptOut, + 0xd14d3ef3, 0x66cf, 0x4ba2, 0x9d, 0x38, 0x0d, 0xdb, 0x37, 0xab, 0x47, 0x01, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceClass_ClassCoInstallers, + 0x713d1703, 0xa2e2, 0x49f5, 0x92, 0x14, 0x56, 0x47, 0x2e, 0xf3, 0xda, 0x5c, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceInterface_FriendlyName, + 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceInterface_Enabled, + 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceInterface_ClassGuid, + 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 4} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceInterface_ReferenceString, + 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 5} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceInterface_Restricted, + 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 6} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceInterfaceClass_DefaultInterface, + 0x14c83a99, 0x0b3f, 0x44b7, 0xbe, 0x4c, 0xa1, 0x78, 0xd3, 0x99, 0x05, 0x64, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceInterfaceClass_Name, + 0x14c83a99, 0x0b3f, 0x44b7, 0xbe, 0x4c, 0xa1, 0x78, 0xd3, 0x99, 0x05, 0x64, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_Address, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 51} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_DiscoveryMethod, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 52} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsEncrypted, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 53} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsAuthenticated, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 54} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsConnected, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 55} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsPaired, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 56} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_Icon, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 57} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_Version, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 65} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_Last_Seen, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 66} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_Last_Connected, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 67} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsShowInDisconnectedState, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 68} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsLocalMachine, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 70} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_MetadataPath, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 71} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsMetadataSearchInProgress, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 72} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_MetadataChecksum, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 73} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsNotInterestingForDisplay, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 74} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_LaunchDeviceStageOnDeviceConnect, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 76} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_LaunchDeviceStageFromExplorer, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 77} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_BaselineExperienceId, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 78} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsDeviceUniquelyIdentifiable, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 79} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_AssociationArray, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 80} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_DeviceDescription1, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 81} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_DeviceDescription2, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 82} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_HasProblem, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 83} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsSharedDevice, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 84} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsNetworkDevice, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 85} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsDefaultDevice, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 86} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_MetadataCabinet, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 87} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_RequiresPairingElevation, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 88} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_ExperienceId, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 89} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_Category, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 90} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_Category_Desc_Singular, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 91} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_Category_Desc_Plural, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 92} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_Category_Icon, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 93} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_CategoryGroup_Desc, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 94} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_CategoryGroup_Icon, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 95} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_PrimaryCategory, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 97} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_UnpairUninstall, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 98} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_RequiresUninstallElevation, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 99} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_DeviceFunctionSubRank, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 100} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_AlwaysShowDeviceAsConnected, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 101} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_ConfigFlags, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 105} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_PrivilegedPackageFamilyNames, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 106} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_CustomPrivilegedPackageFamilyNames, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 107} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_IsRebootRequired, + 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 108} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_FriendlyName, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 12288} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_Manufacturer, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8192} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_ModelName, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8194} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_ModelNumber, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8195} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceContainer_InstallInProgress, + 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 9} +pub const DEVPKEY_DeviceDisplay_DiscoveryMethod: DEVPROPKEY + = DEVPKEY_DeviceContainer_DiscoveryMethod; +pub const DEVPKEY_DeviceDisplay_IsShowInDisconnectedState: DEVPROPKEY + = DEVPKEY_DeviceContainer_IsShowInDisconnectedState; +pub const DEVPKEY_DeviceDisplay_IsNotInterestingForDisplay: DEVPROPKEY + = DEVPKEY_DeviceContainer_IsNotInterestingForDisplay; +pub const DEVPKEY_DeviceDisplay_IsNetworkDevice: DEVPROPKEY + = DEVPKEY_DeviceContainer_IsNetworkDevice; +pub const DEVPKEY_DeviceDisplay_Category: DEVPROPKEY = DEVPKEY_DeviceContainer_Category; +pub const DEVPKEY_DeviceDisplay_UnpairUninstall: DEVPROPKEY + = DEVPKEY_DeviceContainer_UnpairUninstall; +pub const DEVPKEY_DeviceDisplay_RequiresUninstallElevation: DEVPROPKEY + = DEVPKEY_DeviceContainer_RequiresUninstallElevation; +pub const DEVPKEY_DeviceDisplay_AlwaysShowDeviceAsConnected: DEVPROPKEY + = DEVPKEY_DeviceContainer_AlwaysShowDeviceAsConnected; +DEFINE_DEVPROPKEY!{DEVPKEY_DevQuery_ObjectType, + 0x13673f42, 0xa3d6, 0x49f6, 0xb4, 0xda, 0xae, 0x46, 0xe0, 0xc5, 0x23, 0x7c, 2} diff --git a/bash-5.1/vendor/winapi/src/shared/devpropdef.rs b/bash-5.1/vendor/winapi/src/shared/devpropdef.rs new file mode 100644 index 0000000000000000000000000000000000000000..1e9388a4411c94d2c795da47e8d93dff1df82e55 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/devpropdef.rs @@ -0,0 +1,83 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Defines property types and keys for the Plug and Play Device Property API +use shared::guiddef::{GUID, IsEqualGUID}; +use shared::minwindef::ULONG; +use um::winnt::{CHAR, PCWSTR, PVOID}; +pub type DEVPROPTYPE = ULONG; +pub type PDEVPROPTYPE = *mut ULONG; +pub const DEVPROP_TYPEMOD_ARRAY: DEVPROPTYPE = 0x00001000; +pub const DEVPROP_TYPEMOD_LIST: DEVPROPTYPE = 0x00002000; +pub const DEVPROP_TYPE_EMPTY: DEVPROPTYPE = 0x00000000; +pub const DEVPROP_TYPE_NULL: DEVPROPTYPE = 0x00000001; +pub const DEVPROP_TYPE_SBYTE: DEVPROPTYPE = 0x00000002; +pub const DEVPROP_TYPE_BYTE: DEVPROPTYPE = 0x00000003; +pub const DEVPROP_TYPE_INT16: DEVPROPTYPE = 0x00000004; +pub const DEVPROP_TYPE_UINT16: DEVPROPTYPE = 0x00000005; +pub const DEVPROP_TYPE_INT32: DEVPROPTYPE = 0x00000006; +pub const DEVPROP_TYPE_UINT32: DEVPROPTYPE = 0x00000007; +pub const DEVPROP_TYPE_INT64: DEVPROPTYPE = 0x00000008; +pub const DEVPROP_TYPE_UINT64: DEVPROPTYPE = 0x00000009; +pub const DEVPROP_TYPE_FLOAT: DEVPROPTYPE = 0x0000000A; +pub const DEVPROP_TYPE_DOUBLE: DEVPROPTYPE = 0x0000000B; +pub const DEVPROP_TYPE_DECIMAL: DEVPROPTYPE = 0x0000000C; +pub const DEVPROP_TYPE_GUID: DEVPROPTYPE = 0x0000000D; +pub const DEVPROP_TYPE_CURRENCY: DEVPROPTYPE = 0x0000000E; +pub const DEVPROP_TYPE_DATE: DEVPROPTYPE = 0x0000000F; +pub const DEVPROP_TYPE_FILETIME: DEVPROPTYPE = 0x00000010; +pub const DEVPROP_TYPE_BOOLEAN: DEVPROPTYPE = 0x00000011; +pub const DEVPROP_TYPE_STRING: DEVPROPTYPE = 0x00000012; +pub const DEVPROP_TYPE_STRING_LIST: DEVPROPTYPE = DEVPROP_TYPE_STRING | DEVPROP_TYPEMOD_LIST; +pub const DEVPROP_TYPE_SECURITY_DESCRIPTOR: DEVPROPTYPE = 0x00000013; +pub const DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING: DEVPROPTYPE = 0x00000014; +pub const DEVPROP_TYPE_DEVPROPKEY: DEVPROPTYPE = 0x00000015; +pub const DEVPROP_TYPE_DEVPROPTYPE: DEVPROPTYPE = 0x00000016; +pub const DEVPROP_TYPE_BINARY: DEVPROPTYPE = DEVPROP_TYPE_BYTE | DEVPROP_TYPEMOD_ARRAY; +pub const DEVPROP_TYPE_ERROR: DEVPROPTYPE = 0x00000017; +pub const DEVPROP_TYPE_NTSTATUS: DEVPROPTYPE = 0x00000018; +pub const DEVPROP_TYPE_STRING_INDIRECT: DEVPROPTYPE = 0x00000019; +pub const MAX_DEVPROP_TYPE: DEVPROPTYPE = 0x00000019; +pub const MAX_DEVPROP_TYPEMOD: DEVPROPTYPE = 0x00002000; +pub const DEVPROP_MASK_TYPE: DEVPROPTYPE = 0x00000FFF; +pub const DEVPROP_MASK_TYPEMOD: DEVPROPTYPE = 0x0000F000; +pub type DEVPROP_BOOLEAN = CHAR; +pub type PDEVPROP_BOOLEAN = *mut CHAR; +pub const DEVPROP_TRUE: DEVPROP_BOOLEAN = -1; +pub const DEVPROP_FALSE: DEVPROP_BOOLEAN = 0; +pub type DEVPROPGUID = GUID; +pub type PDEVPROPGUID = *mut GUID; +pub type DEVPROPID = ULONG; +pub type PDEVPROPID = *mut ULONG; +STRUCT!{struct DEVPROPKEY { + fmtid: DEVPROPGUID, + pid: DEVPROPID, +}} +pub type PDEVPROPKEY = *mut DEVPROPKEY; +#[inline] +pub fn IsEqualDevPropKey(a: &DEVPROPKEY, b: &DEVPROPKEY) -> bool { + (a.pid == b.pid) && IsEqualGUID(&a.fmtid, &b.fmtid) +} +ENUM!{enum DEVPROPSTORE { + DEVPROP_STORE_SYSTEM, + DEVPROP_STORE_USER, +}} +pub type PDEVPROPSTORE = *mut DEVPROPSTORE; +STRUCT!{struct DEVPROPCOMPKEY { + Key: DEVPROPKEY, + Store: DEVPROPSTORE, + LocaleName: PCWSTR, +}} +pub type PDEVPROPCOMPKEY = *mut DEVPROPCOMPKEY; +// IsEqualLocaleName +// IsEqualDevPropCompKey +STRUCT!{struct DEVPROPERTY { + CompKey: DEVPROPCOMPKEY, + Type: DEVPROPTYPE, + BufferSize: ULONG, + Buffer: PVOID, +}} +pub type PDEVPROPERTY = *mut DEVPROPERTY; +pub const DEVPROPID_FIRST_USABLE: DEVPROPID = 2; diff --git a/bash-5.1/vendor/winapi/src/shared/dinputd.rs b/bash-5.1/vendor/winapi/src/shared/dinputd.rs new file mode 100644 index 0000000000000000000000000000000000000000..ceb9ffd992a8a0ba613a1b72015b6913d2eaad87 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/dinputd.rs @@ -0,0 +1,21 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_IDirectInputEffectDriver, + 0x02538130, 0x898f, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{IID_IDirectInputJoyConfig, + 0x1de12ab1, 0xc9f5, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{IID_IDirectInputPIDDriver, + 0xeec6993a, 0xb3fd, 0x11d2, 0xa9, 0x16, 0x00, 0xc0, 0x4f, 0xb9, 0x86, 0x38} +DEFINE_GUID!{IID_IDirectInputJoyConfig8, + 0xeb0d7dfa, 0x1990, 0x4f27, 0xb4, 0xd6, 0xed, 0xf2, 0xee, 0xc4, 0xa4, 0x4c} +DEFINE_GUID!{GUID_KeyboardClass, + 0x4d36e96b, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_MediaClass, + 0x4d36e96c, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_MouseClass, + 0x4d36e96f, 0xe325, 0x11ce, 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18} +DEFINE_GUID!{GUID_HIDClass, + 0x745a17a0, 0x74d3, 0x11d0, 0xb6, 0xfe, 0x00, 0xa0, 0xc9, 0x0f, 0x57, 0xda} diff --git a/bash-5.1/vendor/winapi/src/shared/dxgi.rs b/bash-5.1/vendor/winapi/src/shared/dxgi.rs new file mode 100644 index 0000000000000000000000000000000000000000..0e878586e077b094d73368638e5565d49cc7eaf0 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/dxgi.rs @@ -0,0 +1,411 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dxgi.h +use ctypes::c_void; +use shared::basetsd::{SIZE_T, UINT64}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::dxgitype::{ + DXGI_GAMMA_CONTROL, DXGI_GAMMA_CONTROL_CAPABILITIES, DXGI_MODE_DESC, DXGI_MODE_ROTATION, + DXGI_SAMPLE_DESC, DXGI_USAGE, +}; +use shared::guiddef::{REFGUID, REFIID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT, HMODULE, UINT}; +use shared::windef::{HDC, HMONITOR, HWND, RECT}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, INT, LARGE_INTEGER, LUID, WCHAR}; +STRUCT!{struct DXGI_FRAME_STATISTICS { + PresentCount: UINT, + PresentRefreshCount: UINT, + SyncRefreshCount: UINT, + SyncQPCTime: LARGE_INTEGER, + SyncGPUTime: LARGE_INTEGER, +}} +STRUCT!{struct DXGI_MAPPED_RECT { + Pitch: INT, + pBits: *mut BYTE, +}} +STRUCT!{struct DXGI_ADAPTER_DESC { + Description: [WCHAR; 128], + VendorId: UINT, + DeviceId: UINT, + SubSysId: UINT, + Revision: UINT, + DedicatedVideoMemory: SIZE_T, + DedicatedSystemMemory: SIZE_T, + SharedSystemMemory: SIZE_T, + AdapterLuid: LUID, +}} +STRUCT!{struct DXGI_OUTPUT_DESC { + DeviceName: [WCHAR; 32], + DesktopCoordinates: RECT, + AttachedToDesktop: BOOL, + Rotation: DXGI_MODE_ROTATION, + Monitor: HMONITOR, +}} +STRUCT!{struct DXGI_SHARED_RESOURCE { + Handle: HANDLE, +}} +pub const DXGI_RESOURCE_PRIORITY_MINIMUM: DWORD = 0x28000000; +pub const DXGI_RESOURCE_PRIORITY_LOW: DWORD = 0x50000000; +pub const DXGI_RESOURCE_PRIORITY_NORMAL: DWORD = 0x78000000; +pub const DXGI_RESOURCE_PRIORITY_HIGH: DWORD = 0xa0000000; +pub const DXGI_RESOURCE_PRIORITY_MAXIMUM: DWORD = 0xc8000000; +ENUM!{enum DXGI_RESIDENCY { + DXGI_RESIDENCY_FULLY_RESIDENT = 1, + DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2, + DXGI_RESIDENCY_EVICTED_TO_DISK = 3, +}} +STRUCT!{struct DXGI_SURFACE_DESC { + Width: UINT, + Height: UINT, + Format: DXGI_FORMAT, + SampleDesc: DXGI_SAMPLE_DESC, +}} +ENUM!{enum DXGI_SWAP_EFFECT { + DXGI_SWAP_EFFECT_DISCARD = 0, + DXGI_SWAP_EFFECT_SEQUENTIAL = 1, + DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL = 3, + DXGI_SWAP_EFFECT_FLIP_DISCARD = 4, +}} +ENUM!{enum DXGI_SWAP_CHAIN_FLAG { + DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1, + DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2, + DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4, + DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT = 8, + DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER = 16, + DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY = 32, + DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT = 64, + DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER = 128, + DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO = 256, + DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO = 512, + DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED = 1024, + DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING = 2048, +}} +STRUCT!{struct DXGI_SWAP_CHAIN_DESC { + BufferDesc: DXGI_MODE_DESC, + SampleDesc: DXGI_SAMPLE_DESC, + BufferUsage: DXGI_USAGE, + BufferCount: UINT, + OutputWindow: HWND, + Windowed: BOOL, + SwapEffect: DXGI_SWAP_EFFECT, + Flags: UINT, +}} +RIDL!{#[uuid(0xaec22fb8, 0x76f3, 0x4639, 0x9b, 0xe0, 0x28, 0xeb, 0x43, 0xa6, 0x7a, 0x2e)] +interface IDXGIObject(IDXGIObjectVtbl): IUnknown(IUnknownVtbl) { + fn SetPrivateData( + Name: REFGUID, + DataSize: UINT, + pData: *const c_void, + ) -> HRESULT, + fn SetPrivateDataInterface( + Name: REFGUID, + pUnknown: *const IUnknown, + ) -> HRESULT, + fn GetPrivateData( + Name: REFGUID, + pDataSize: *mut UINT, + pData: *mut c_void, + ) -> HRESULT, + fn GetParent( + riid: REFIID, + ppParent: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3d3e0379, 0xf9de, 0x4d58, 0xbb, 0x6c, 0x18, 0xd6, 0x29, 0x92, 0xf1, 0xa6)] +interface IDXGIDeviceSubObject(IDXGIDeviceSubObjectVtbl): IDXGIObject(IDXGIObjectVtbl) { + fn GetDevice( + riid: REFIID, + ppDevice: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x035f3ab4, 0x482e, 0x4e50, 0xb4, 0x1f, 0x8a, 0x7f, 0x8b, 0xd8, 0x96, 0x0b)] +interface IDXGIResource(IDXGIResourceVtbl): IDXGIDeviceSubObject(IDXGIDeviceSubObjectVtbl) { + fn GetSharedHandle( + pSharedHandle: *mut HANDLE, + ) -> HRESULT, + fn GetUsage( + pUsage: *mut DXGI_USAGE, + ) -> HRESULT, + fn SetEvictionPriority( + EvictionPriority: UINT, + ) -> HRESULT, + fn GetEvictionPriority( + pEvictionPriority: *mut UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9d8e1289, 0xd7b3, 0x465f, 0x81, 0x26, 0x25, 0x0e, 0x34, 0x9a, 0xf8, 0x5d)] +interface IDXGIKeyedMutex(IDXGIKeyedMutexVtbl): IDXGIDeviceSubObject(IDXGIDeviceSubObjectVtbl) { + fn AcquireSync( + Key: UINT64, + dwMilliseconds: DWORD, + ) -> HRESULT, + fn ReleaseSync( + Key: UINT64, + ) -> HRESULT, +}} +pub const DXGI_MAP_READ: UINT = 1; +pub const DXGI_MAP_WRITE: UINT = 2; +pub const DXGI_MAP_DISCARD: UINT = 4; +RIDL!{#[uuid(0xcafcb56c, 0x6ac3, 0x4889, 0xbf, 0x47, 0x9e, 0x23, 0xbb, 0xd2, 0x60, 0xec)] +interface IDXGISurface(IDXGISurfaceVtbl): IDXGIDeviceSubObject(IDXGIDeviceSubObjectVtbl) { + fn GetDesc( + pDesc: *mut DXGI_SURFACE_DESC, + ) -> HRESULT, + fn Map( + pLockedRect: *mut DXGI_MAPPED_RECT, + MapFlags: UINT, + ) -> HRESULT, + fn Unmap() -> HRESULT, +}} +RIDL!{#[uuid(0x4ae63092, 0x6327, 0x4c1b, 0x80, 0xae, 0xbf, 0xe1, 0x2e, 0xa3, 0x2b, 0x86)] +interface IDXGISurface1(IDXGISurface1Vtbl): IDXGISurface(IDXGISurfaceVtbl) { + fn GetDC( + Discard: BOOL, + phdc: *mut HDC, + ) -> HRESULT, + fn ReleaseDC( + pDirtyRect: *mut RECT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2411e7e1, 0x12ac, 0x4ccf, 0xbd, 0x14, 0x97, 0x98, 0xe8, 0x53, 0x4d, 0xc0)] +interface IDXGIAdapter(IDXGIAdapterVtbl): IDXGIObject(IDXGIObjectVtbl) { + fn EnumOutputs( + Output: UINT, + ppOutput: *mut *mut IDXGIOutput, + ) -> HRESULT, + fn GetDesc( + pDesc: *mut DXGI_ADAPTER_DESC, + ) -> HRESULT, + fn CheckInterfaceSupport( + InterfaceName: REFGUID, + pUMDVersion: *mut LARGE_INTEGER, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xae02eedb, 0xc735, 0x4690, 0x8d, 0x52, 0x5a, 0x8d, 0xc2, 0x02, 0x13, 0xaa)] +interface IDXGIOutput(IDXGIOutputVtbl): IDXGIObject(IDXGIObjectVtbl) { + fn GetDesc( + pDesc: *mut DXGI_OUTPUT_DESC, + ) -> HRESULT, + fn GetDisplayModeList( + EnumFormat: DXGI_FORMAT, + Flags: UINT, + pNumModes: *mut UINT, + pDesc: *mut DXGI_MODE_DESC, + ) -> HRESULT, + fn FindClosestMatchingMode( + pModeToMatch: *const DXGI_MODE_DESC, + pClosestMatch: *mut DXGI_MODE_DESC, + pConcernedDevice: *mut IUnknown, + ) -> HRESULT, + fn WaitForVBlank() -> HRESULT, + fn TakeOwnership( + pDevice: *mut IUnknown, + Exclusive: BOOL, + ) -> HRESULT, + fn ReleaseOwnership() -> (), + fn GetGammaControlCapabilities( + pGammaCaps: *mut DXGI_GAMMA_CONTROL_CAPABILITIES, + ) -> HRESULT, + fn SetGammaControl( + pArray: *const DXGI_GAMMA_CONTROL, + ) -> HRESULT, + fn GetGammaControl( + pArray: *mut DXGI_GAMMA_CONTROL, + ) -> HRESULT, + fn SetDisplaySurface( + pScanoutSurface: *mut IDXGISurface, + ) -> HRESULT, + fn GetDisplaySurfaceData( + pDestination: *mut IDXGISurface, + ) -> HRESULT, + fn GetFrameStatistics( + pStats: *mut DXGI_FRAME_STATISTICS, + ) -> HRESULT, +}} +pub const DXGI_MAX_SWAP_CHAIN_BUFFERS: DWORD = 16; +pub const DXGI_PRESENT_TEST: DWORD = 0x00000001; +pub const DXGI_PRESENT_DO_NOT_SEQUENCE: DWORD = 0x00000002; +pub const DXGI_PRESENT_RESTART: DWORD = 0x00000004; +pub const DXGI_PRESENT_DO_NOT_WAIT: DWORD = 0x00000008; +pub const DXGI_PRESENT_STEREO_PREFER_RIGHT: DWORD = 0x00000010; +pub const DXGI_PRESENT_STEREO_TEMPORARY_MONO: DWORD = 0x00000020; +pub const DXGI_PRESENT_RESTRICT_TO_OUTPUT: DWORD = 0x00000040; +pub const DXGI_PRESENT_USE_DURATION: DWORD = 0x00000100; +pub const DXGI_PRESENT_ALLOW_TEARING: DWORD = 0x00000200; +pub const DXGI_ENUM_MODES_INTERLACED: UINT = 1; +pub const DXGI_ENUM_MODES_SCALING: UINT = 2; +RIDL!{#[uuid(0x310d36a0, 0xd2e7, 0x4c0a, 0xaa, 0x04, 0x6a, 0x9d, 0x23, 0xb8, 0x88, 0x6a)] +interface IDXGISwapChain(IDXGISwapChainVtbl): IDXGIDeviceSubObject(IDXGIDeviceSubObjectVtbl) { + fn Present( + SyncInterval: UINT, + Flags: UINT, + ) -> HRESULT, + fn GetBuffer( + Buffer: UINT, + riid: REFIID, + ppSurface: *mut *mut c_void, + ) -> HRESULT, + fn SetFullscreenState( + Fullscreen: BOOL, + pTarget: *mut IDXGIOutput, + ) -> HRESULT, + fn GetFullscreenState( + pFullscreen: *mut BOOL, + ppTarget: *mut *mut IDXGIOutput, + ) -> HRESULT, + fn GetDesc( + pDesc: *mut DXGI_SWAP_CHAIN_DESC, + ) -> HRESULT, + fn ResizeBuffers( + BufferCount: UINT, + Width: UINT, + Height: UINT, + NewFormat: DXGI_FORMAT, + SwapChainFlags: UINT, + ) -> HRESULT, + fn ResizeTarget( + pNewTargetParameters: *const DXGI_MODE_DESC, + ) -> HRESULT, + fn GetContainingOutput( + ppOutput: *mut *mut IDXGIOutput, + ) -> HRESULT, + fn GetFrameStatistics( + pStats: *mut DXGI_FRAME_STATISTICS, + ) -> HRESULT, + fn GetLastPresentCount( + pLastPresentCount: *mut UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7b7166ec, 0x21c7, 0x44ae, 0xb2, 0x1a, 0xc9, 0xae, 0x32, 0x1a, 0xe3, 0x69)] +interface IDXGIFactory(IDXGIFactoryVtbl): IDXGIObject(IDXGIObjectVtbl) { + fn EnumAdapters( + Adapter: UINT, + ppAdapter: *mut *mut IDXGIAdapter, + ) -> HRESULT, + fn MakeWindowAssociation( + WindowHandle: HWND, + Flags: UINT, + ) -> HRESULT, + fn GetWindowAssociation( + pWindowHandle: *mut HWND, + ) -> HRESULT, + fn CreateSwapChain( + pDevice: *mut IUnknown, + pDesc: *mut DXGI_SWAP_CHAIN_DESC, + ppSwapChain: *mut *mut IDXGISwapChain, + ) -> HRESULT, + fn CreateSoftwareAdapter( + Module: HMODULE, + ppAdapter: *mut *mut IDXGIAdapter, + ) -> HRESULT, +}} +extern "system" { + pub fn CreateDXGIFactory( + riid: REFIID, + ppFactory: *mut *mut c_void, + ) -> HRESULT; + pub fn CreateDXGIFactory1( + riid: REFIID, + ppFactory: *mut *mut c_void, + ) -> HRESULT; +} +RIDL!{#[uuid(0x54ec77fa, 0x1377, 0x44e6, 0x8c, 0x32, 0x88, 0xfd, 0x5f, 0x44, 0xc8, 0x4c)] +interface IDXGIDevice(IDXGIDeviceVtbl): IDXGIObject(IDXGIObjectVtbl) { + fn GetAdapter( + pAdapter: *mut *mut IDXGIAdapter, + ) -> HRESULT, + fn CreateSurface( + pDesc: *const DXGI_SURFACE_DESC, + NumSurfaces: UINT, + Usage: DXGI_USAGE, + pSharedResource: *const DXGI_SHARED_RESOURCE, + ppSurface: *mut *mut IDXGISurface, + ) -> HRESULT, + fn QueryResourceResidency( + ppResources: *const *mut IUnknown, + pResidencyStatus: *mut DXGI_RESIDENCY, + NumResources: UINT, + ) -> HRESULT, + fn SetGPUThreadPriority( + Priority: INT, + ) -> HRESULT, + fn GetGPUThreadPriority( + pPriority: *mut INT, + ) -> HRESULT, +}} +ENUM!{enum DXGI_ADAPTER_FLAG { + DXGI_ADAPTER_FLAG_NONE, + DXGI_ADAPTER_FLAG_REMOTE, + DXGI_ADAPTER_FLAG_SOFTWARE, +}} +STRUCT!{struct DXGI_ADAPTER_DESC1 { + Description: [WCHAR; 128], + VendorId: UINT, + DeviceId: UINT, + SubSysId: UINT, + Revision: UINT, + DedicatedVideoMemory: SIZE_T, + DedicatedSystemMemory: SIZE_T, + SharedSystemMemory: SIZE_T, + AdapterLuid: LUID, + Flags: UINT, +}} +STRUCT!{struct DXGI_DISPLAY_COLOR_SPACE { + PrimaryCoordinates: [[FLOAT; 2]; 8], + WhitePoints: [[FLOAT; 2]; 16], +}} +RIDL!{#[uuid(0x770aae78, 0xf26f, 0x4dba, 0xa8, 0x29, 0x25, 0x3c, 0x83, 0xd1, 0xb3, 0x87)] +interface IDXGIFactory1(IDXGIFactory1Vtbl): IDXGIFactory(IDXGIFactoryVtbl) { + fn EnumAdapters1( + Adapter: UINT, + ppAdapter: *mut *mut IDXGIAdapter1, + ) -> HRESULT, + fn IsCurrent() -> BOOL, +}} +RIDL!{#[uuid(0x29038f61, 0x3839, 0x4626, 0x91, 0xfd, 0x08, 0x68, 0x79, 0x01, 0x1a, 0x05)] +interface IDXGIAdapter1(IDXGIAdapter1Vtbl): IDXGIAdapter(IDXGIAdapterVtbl) { + fn GetDesc1( + pDesc: *mut DXGI_ADAPTER_DESC1, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x77db970f, 0x6276, 0x48ba, 0xba, 0x28, 0x07, 0x01, 0x43, 0xb4, 0x39, 0x2c)] +interface IDXGIDevice1(IDXGIDevice1Vtbl): IDXGIDevice(IDXGIDeviceVtbl) { + fn SetMaximumFrameLatency( + MaxLatency: UINT, + ) -> HRESULT, + fn GetMaximumFrameLatency( + pMaxLatency: *mut UINT, + ) -> HRESULT, +}} +DEFINE_GUID!{IID_IDXGIObject, + 0xaec22fb8, 0x76f3, 0x4639, 0x9b, 0xe0, 0x28, 0xeb, 0x43, 0xa6, 0x7a, 0x2e} +DEFINE_GUID!{IID_IDXGIDeviceSubObject, + 0x3d3e0379, 0xf9de, 0x4d58, 0xbb, 0x6c, 0x18, 0xd6, 0x29, 0x92, 0xf1, 0xa6} +DEFINE_GUID!{IID_IDXGIResource, + 0x035f3ab4, 0x482e, 0x4e50, 0xb4, 0x1f, 0x8a, 0x7f, 0x8b, 0xd8, 0x96, 0x0b} +DEFINE_GUID!{IID_IDXGIKeyedMutex, + 0x9d8e1289, 0xd7b3, 0x465f, 0x81, 0x26, 0x25, 0x0e, 0x34, 0x9a, 0xf8, 0x5d} +DEFINE_GUID!{IID_IDXGISurface, + 0xcafcb56c, 0x6ac3, 0x4889, 0xbf, 0x47, 0x9e, 0x23, 0xbb, 0xd2, 0x60, 0xec} +DEFINE_GUID!{IID_IDXGISurface1, + 0x4ae63092, 0x6327, 0x4c1b, 0x80, 0xae, 0xbf, 0xe1, 0x2e, 0xa3, 0x2b, 0x86} +DEFINE_GUID!{IID_IDXGIAdapter, + 0x2411e7e1, 0x12ac, 0x4ccf, 0xbd, 0x14, 0x97, 0x98, 0xe8, 0x53, 0x4d, 0xc0} +DEFINE_GUID!{IID_IDXGIOutput, + 0xae02eedb, 0xc735, 0x4690, 0x8d, 0x52, 0x5a, 0x8d, 0xc2, 0x02, 0x13, 0xaa} +DEFINE_GUID!{IID_IDXGISwapChain, + 0x310d36a0, 0xd2e7, 0x4c0a, 0xaa, 0x04, 0x6a, 0x9d, 0x23, 0xb8, 0x88, 0x6a} +DEFINE_GUID!{IID_IDXGIFactory, + 0x7b7166ec, 0x21c7, 0x44ae, 0xb2, 0x1a, 0xc9, 0xae, 0x32, 0x1a, 0xe3, 0x69} +DEFINE_GUID!{IID_IDXGIDevice, + 0x54ec77fa, 0x1377, 0x44e6, 0x8c, 0x32, 0x88, 0xfd, 0x5f, 0x44, 0xc8, 0x4c} +DEFINE_GUID!{IID_IDXGIFactory1, + 0x770aae78, 0xf26f, 0x4dba, 0xa8, 0x29, 0x25, 0x3c, 0x83, 0xd1, 0xb3, 0x87} +DEFINE_GUID!{IID_IDXGIAdapter1, + 0x29038f61, 0x3839, 0x4626, 0x91, 0xfd, 0x08, 0x68, 0x79, 0x01, 0x1a, 0x05} +DEFINE_GUID!{IID_IDXGIDevice1, + 0x77db970f, 0x6276, 0x48ba, 0xba, 0x28, 0x07, 0x01, 0x43, 0xb4, 0x39, 0x2c} diff --git a/bash-5.1/vendor/winapi/src/shared/dxgi1_2.rs b/bash-5.1/vendor/winapi/src/shared/dxgi1_2.rs new file mode 100644 index 0000000000000000000000000000000000000000..941f15e98937e6e10875f06fb4622573bb43126e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/dxgi1_2.rs @@ -0,0 +1,355 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dxgi1_2.h +use ctypes::c_void; +use shared::basetsd::SIZE_T; +use shared::dxgi::{ + DXGI_MAPPED_RECT, DXGI_SWAP_EFFECT, IDXGIAdapter1, IDXGIAdapter1Vtbl, IDXGIDevice1, + IDXGIDevice1Vtbl, IDXGIFactory1, IDXGIFactory1Vtbl, IDXGIObject, IDXGIObjectVtbl, IDXGIOutput, + IDXGIOutputVtbl, IDXGIResource, IDXGIResourceVtbl, IDXGISurface1, IDXGISurface1Vtbl, + IDXGISwapChain, IDXGISwapChainVtbl, +}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::dxgitype::{ + DXGI_MODE_DESC, DXGI_MODE_ROTATION, DXGI_MODE_SCALING, DXGI_MODE_SCANLINE_ORDER, DXGI_RATIONAL, + DXGI_RGBA, DXGI_SAMPLE_DESC, DXGI_USAGE, +}; +use shared::guiddef::REFGUID; +use shared::minwindef::{BOOL, DWORD, UINT}; +use shared::windef::{HWND, POINT, RECT}; +use um::minwinbase::SECURITY_ATTRIBUTES; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, LARGE_INTEGER, LPCWSTR, LUID, WCHAR}; +ENUM!{enum DXGI_ALPHA_MODE { + DXGI_ALPHA_MODE_UNSPECIFIED = 0, + DXGI_ALPHA_MODE_PREMULTIPLIED = 1, + DXGI_ALPHA_MODE_STRAIGHT = 2, + DXGI_ALPHA_MODE_IGNORE = 3, + DXGI_ALPHA_MODE_FORCE_DWORD = 0xFFFFFFFF, +}} +ENUM!{enum DXGI_COMPUTE_PREEMPTION_GRANULARITY { + DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY = 0, + DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY = 1, + DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY = 2, + DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY = 3, + DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY = 4, +}} +ENUM!{enum DXGI_GRAPHICS_PREEMPTION_GRANULARITY { + DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY = 0, + DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY = 1, + DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY = 2, + DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY = 3, + DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY = 4, +}} +ENUM!{enum DXGI_OUTDUPL_POINTER_SHAPE_TYPE { + DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME = 1, + DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR = 2, + DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR = 4, +}} +ENUM!{enum DXGI_SCALING { + DXGI_SCALING_STRETCH = 0, + DXGI_SCALING_NONE = 1, + DXGI_SCALING_ASPECT_RATIO_STRETCH = 2, +}} +ENUM!{enum _DXGI_OFFER_RESOURCE_PRIORITY { + DXGI_OFFER_RESOURCE_PRIORITY_LOW = 1, + DXGI_OFFER_RESOURCE_PRIORITY_NORMAL = 2, + DXGI_OFFER_RESOURCE_PRIORITY_HIGH = 3, +}} +STRUCT!{struct DXGI_ADAPTER_DESC2 { + Description: [WCHAR; 128], + VendorId: UINT, + DeviceId: UINT, + SubSysId: UINT, + Revision: UINT, + DedicatedVideoMemory: SIZE_T, + DedicatedSystemMemory: SIZE_T, + SharedSystemMemory: SIZE_T, + AdapterLuid: LUID, + Flags: UINT, + GraphicsPreemptionGranularity: DXGI_GRAPHICS_PREEMPTION_GRANULARITY, + ComputePreemptionGranularity: DXGI_COMPUTE_PREEMPTION_GRANULARITY, +}} +STRUCT!{struct DXGI_MODE_DESC1 { + Width: UINT, + Height: UINT, + RefreshRate: DXGI_RATIONAL, + Format: DXGI_FORMAT, + ScanlineOrdering: DXGI_MODE_SCANLINE_ORDER, + Scaling: DXGI_MODE_SCALING, + Stereo: BOOL, +}} +STRUCT!{struct DXGI_OUTDUPL_DESC { + ModeDesc: DXGI_MODE_DESC, + Rotation: DXGI_MODE_ROTATION, + DesktopImageInSystemMemory: BOOL, +}} +STRUCT!{struct DXGI_OUTDUPL_FRAME_INFO { + LastPresentTime: LARGE_INTEGER, + LastMouseUpdateTime: LARGE_INTEGER, + AccumulatedFrames: UINT, + RectsCoalesced: BOOL, + ProtectedContentMaskedOut: BOOL, + PointerPosition: DXGI_OUTDUPL_POINTER_POSITION, + TotalMetadataBufferSize: UINT, + PointerShapeBufferSize: UINT, +}} +STRUCT!{struct DXGI_OUTDUPL_MOVE_RECT { + SourcePoint: POINT, + DestinationRect: RECT, +}} +STRUCT!{struct DXGI_OUTDUPL_POINTER_POSITION { + Position: POINT, + Visible: BOOL, +}} +STRUCT!{struct DXGI_OUTDUPL_POINTER_SHAPE_INFO { + Type: UINT, + Width: UINT, + Height: UINT, + Pitch: UINT, + HotSpot: POINT, +}} +STRUCT!{struct DXGI_PRESENT_PARAMETERS { + DirtyRectsCount: UINT, + pDirtyRects: *mut RECT, + pScrollRect: *mut RECT, + pScrollOffset: *mut POINT, +}} +STRUCT!{struct DXGI_SWAP_CHAIN_DESC1 { + Width: UINT, + Height: UINT, + Format: DXGI_FORMAT, + Stereo: BOOL, + SampleDesc: DXGI_SAMPLE_DESC, + BufferUsage: DXGI_USAGE, + BufferCount: UINT, + Scaling: DXGI_SCALING, + SwapEffect: DXGI_SWAP_EFFECT, + AlphaMode: DXGI_ALPHA_MODE, + Flags: UINT, +}} +STRUCT!{struct DXGI_SWAP_CHAIN_FULLSCREEN_DESC { + RefreshRate: DXGI_RATIONAL, + ScanlineOrdering: DXGI_MODE_SCANLINE_ORDER, + Scaling: DXGI_MODE_SCALING, + Windowed: BOOL, +}} +RIDL!{#[uuid(0x0aa1ae0a, 0xfa0e, 0x4b84, 0x86, 0x44, 0xe0, 0x5f, 0xf8, 0xe5, 0xac, 0xb5)] +interface IDXGIAdapter2(IDXGIAdapter2Vtbl): IDXGIAdapter1(IDXGIAdapter1Vtbl) { + fn GetDesc2( + pDesc: *mut DXGI_ADAPTER_DESC2, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x05008617, 0xfbfd, 0x4051, 0xa7, 0x90, 0x14, 0x48, 0x84, 0xb4, 0xf6, 0xa9)] +interface IDXGIDevice2(IDXGIDevice2Vtbl): IDXGIDevice1(IDXGIDevice1Vtbl) { + fn OfferResources( + NumResources: UINT, + ppResources: *mut *mut IDXGIResource, + Priority: DXGI_OFFER_RESOURCE_PRIORITY, + ) -> HRESULT, + fn ReclaimResources( + NumResources: UINT, + ppResources: *mut *mut IDXGIResource, + pDiscarded: *mut BOOL, + ) -> HRESULT, + fn EnqueueSetEvent( + hEvent: HANDLE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xea9dbf1a, 0xc88e, 0x4486, 0x85, 0x4a, 0x98, 0xaa, 0x01, 0x38, 0xf3, 0x0c)] +interface IDXGIDisplayControl(IDXGIDisplayControlVtbl): IUnknown(IUnknownVtbl) { + fn IsStereoEnabled() -> BOOL, + fn SetStereoEnabled( + enabled: BOOL, + ) -> (), +}} +RIDL!{#[uuid(0x50c83a1c, 0xe072, 0x4c48, 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0)] +interface IDXGIFactory2(IDXGIFactory2Vtbl): IDXGIFactory1(IDXGIFactory1Vtbl) { + fn IsWindowedStereoEnabled() -> BOOL, + fn CreateSwapChainForHwnd( + pDevice: *mut IUnknown, + hWnd: HWND, + pDesc: *const DXGI_SWAP_CHAIN_DESC1, + pFullscreenDesc: *const DXGI_SWAP_CHAIN_FULLSCREEN_DESC, + pRestrictToOutput: *mut IDXGIOutput, + ppSwapChain: *mut *mut IDXGISwapChain1, + ) -> HRESULT, + fn CreateSwapChainForCoreWindow( + pDevice: *mut IUnknown, + pWindow: *mut IUnknown, + pDesc: *const DXGI_SWAP_CHAIN_DESC1, + pRestrictToOutput: *mut IDXGIOutput, + ppSwapChain: *mut *mut IDXGISwapChain1, + ) -> HRESULT, + fn GetSharedResourceAdapterLuid( + hResource: HANDLE, + pLuid: *mut LUID, + ) -> HRESULT, + fn RegisterStereoStatusWindow( + WindowHandle: HWND, + wMsg: UINT, + pdwCookie: *mut DWORD, + ) -> HRESULT, + fn RegisterStereoStatusEvent( + hEvent: HANDLE, + pdwCookie: *mut DWORD, + ) -> HRESULT, + fn UnregisterStereoStatus( + dwCookie: DWORD, + ) -> (), + fn RegisterOcclusionStatusWindow( + WindowHandle: HWND, + wMsg: UINT, + pdwCookie: *mut DWORD, + ) -> HRESULT, + fn RegisterOcclusionStatusEvent( + hEvent: HANDLE, + pdwCookie: *mut DWORD, + ) -> HRESULT, + fn UnregisterOcclusionStatus( + dwCookie: DWORD, + ) -> (), + fn CreateSwapChainForComposition( + pDevice: *mut IUnknown, + pDesc: *const DXGI_SWAP_CHAIN_DESC1, + pRestrictToOutput: *mut IDXGIOutput, + ppSwapChain: *mut *mut IDXGISwapChain1, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00cddea8, 0x939b, 0x4b83, 0xa3, 0x40, 0xa6, 0x85, 0x22, 0x66, 0x66, 0xcc)] +interface IDXGIOutput1(IDXGIOutput1Vtbl): IDXGIOutput(IDXGIOutputVtbl) { + fn GetDisplayModeList1( + EnumFormat: DXGI_FORMAT, + Flags: UINT, + pNumModes: *mut UINT, + pDesc: *mut DXGI_MODE_DESC1, + ) -> HRESULT, + fn FindClosestMatchingMode1( + pModeToMatch: *const DXGI_MODE_DESC1, + pClosestMatch: *mut DXGI_MODE_DESC1, + pConcernedDevice: *mut IUnknown, + ) -> HRESULT, + fn GetDisplaySurfaceData1( + pDestination: *mut IDXGIResource, + ) -> HRESULT, + fn DuplicateOutput( + pDevice: *mut IUnknown, + ppOutputDuplication: *mut *mut IDXGIOutputDuplication, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x191cfac3, 0xa341, 0x470d, 0xb2, 0x6e, 0xa8, 0x64, 0xf4, 0x28, 0x31, 0x9c)] +interface IDXGIOutputDuplication(IDXGIOutputDuplicationVtbl): IDXGIObject(IDXGIObjectVtbl) { + fn GetDesc( + pDesc: *mut DXGI_OUTDUPL_DESC, + ) -> (), + fn AcquireNextFrame( + TimeoutInMilliseconds: UINT, + pFrameInfo: *mut DXGI_OUTDUPL_FRAME_INFO, + ppDesktopResource: *mut *mut IDXGIResource, + ) -> HRESULT, + fn GetFrameDirtyRects( + DirtyRectsBufferSize: UINT, + pDirtyRectsBuffer: *mut RECT, + pDirtyRectsBufferSizeRequired: *mut UINT, + ) -> HRESULT, + fn GetFrameMoveRects( + MoveRectsBufferSize: UINT, + pMoveRectBuffer: *mut DXGI_OUTDUPL_MOVE_RECT, + pMoveRectsBufferSizeRequired: *mut UINT, + ) -> HRESULT, + fn GetFramePointerShape( + PointerShapeBufferSize: UINT, + pPointerShapeBuffer: *mut c_void, + pPointerShapeBufferSizeRequired: *mut UINT, + pPointerShapeInfo: *mut DXGI_OUTDUPL_POINTER_SHAPE_INFO, + ) -> HRESULT, + fn MapDesktopSurface( + pLockedRect: *mut DXGI_MAPPED_RECT, + ) -> HRESULT, + fn UnMapDesktopSurface() -> HRESULT, + fn ReleaseFrame() -> HRESULT, +}} +RIDL!{#[uuid(0x30961379, 0x4609, 0x4a41, 0x99, 0x8e, 0x54, 0xfe, 0x56, 0x7e, 0xe0, 0xc1)] +interface IDXGIResource1(IDXGIResource1Vtbl): IDXGIResource(IDXGIResourceVtbl) { + fn CreateSubresourceSurface( + index: UINT, + ppSurface: *mut *mut IDXGISurface2, + ) -> HRESULT, + fn CreateSharedHandle( + pAttributes: *const SECURITY_ATTRIBUTES, + dwAccess: DWORD, + lpName: LPCWSTR, + pHandle: *mut HANDLE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xaba496dd, 0xb617, 0x4cb8, 0xa8, 0x66, 0xbc, 0x44, 0xd7, 0xeb, 0x1f, 0xa2)] +interface IDXGISurface2(IDXGISurface2Vtbl): IDXGISurface1(IDXGISurface1Vtbl) { + fn GetResource( + riid: REFGUID, + ppParentResource: *mut *mut c_void, + pSubresourceIndex: *mut UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x790a45f7, 0x0d42, 0x4876, 0x98, 0x3a, 0x0a, 0x55, 0xcf, 0xe6, 0xf4, 0xaa)] +interface IDXGISwapChain1(IDXGISwapChain1Vtbl): IDXGISwapChain(IDXGISwapChainVtbl) { + fn GetDesc1( + pDesc: *mut DXGI_SWAP_CHAIN_DESC1, + ) -> HRESULT, + fn GetFullscreenDesc( + pDesc: *mut DXGI_SWAP_CHAIN_FULLSCREEN_DESC, + ) -> HRESULT, + fn GetHwnd( + pHwnd: *mut HWND, + ) -> HRESULT, + fn GetCoreWindow( + refiid: REFGUID, + ppUnk: *mut *mut c_void, + ) -> HRESULT, + fn Present1( + SyncInterval: UINT, + PresentFlags: UINT, + pPresentParameters: *const DXGI_PRESENT_PARAMETERS, + ) -> HRESULT, + fn IsTemporaryMonoSupported() -> BOOL, + fn GetRestrictToOutput( + ppRestrictToOutput: *mut *mut IDXGIOutput, + ) -> HRESULT, + fn SetBackgroundColor( + pColor: *const DXGI_RGBA, + ) -> HRESULT, + fn GetBackgroundColor( + pColor: *mut DXGI_RGBA, + ) -> HRESULT, + fn SetRotation( + Rotation: DXGI_MODE_ROTATION, + ) -> HRESULT, + fn GetRotation( + pRotation: *mut DXGI_MODE_ROTATION, + ) -> HRESULT, +}} +pub type DXGI_OFFER_RESOURCE_PRIORITY = _DXGI_OFFER_RESOURCE_PRIORITY; +pub const DXGI_ENUM_MODES_DISABLED_STEREO: UINT = 8; +pub const DXGI_ENUM_MODES_STEREO: UINT = 4; +pub const DXGI_SHARED_RESOURCE_READ: UINT = 0x80000000; +pub const DXGI_SHARED_RESOURCE_WRITE: UINT = 1; +DEFINE_GUID!{IID_IDXGIDisplayControl, + 0xea9dbf1a, 0xc88e, 0x4486, 0x85, 0x4a, 0x98, 0xaa, 0x01, 0x38, 0xf3, 0x0c} +DEFINE_GUID!{IID_IDXGIOutputDuplication, + 0x191cfac3, 0xa341, 0x470d, 0xb2, 0x6e, 0xa8, 0x64, 0xf4, 0x28, 0x31, 0x9c} +DEFINE_GUID!{IID_IDXGISurface2, + 0xaba496dd, 0xb617, 0x4cb8, 0xa8, 0x66, 0xbc, 0x44, 0xd7, 0xeb, 0x1f, 0xa2} +DEFINE_GUID!{IID_IDXGIResource1, + 0x30961379, 0x4609, 0x4a41, 0x99, 0x8e, 0x54, 0xfe, 0x56, 0x7e, 0xe0, 0xc1} +DEFINE_GUID!{IID_IDXGIDevice2, + 0x05008617, 0xfbfd, 0x4051, 0xa7, 0x90, 0x14, 0x48, 0x84, 0xb4, 0xf6, 0xa9} +DEFINE_GUID!{IID_IDXGISwapChain1, + 0x790a45f7, 0x0d42, 0x4876, 0x98, 0x3a, 0x0a, 0x55, 0xcf, 0xe6, 0xf4, 0xaa} +DEFINE_GUID!{IID_IDXGIFactory2, + 0x50c83a1c, 0xe072, 0x4c48, 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0} +DEFINE_GUID!{IID_IDXGIAdapter2, + 0x0aa1ae0a, 0xfa0e, 0x4b84, 0x86, 0x44, 0xe0, 0x5f, 0xf8, 0xe5, 0xac, 0xb5} +DEFINE_GUID!{IID_IDXGIOutput1, + 0x00cddea8, 0x939b, 0x4b83, 0xa3, 0x40, 0xa6, 0x85, 0x22, 0x66, 0x66, 0xcc} diff --git a/bash-5.1/vendor/winapi/src/shared/dxgi1_3.rs b/bash-5.1/vendor/winapi/src/shared/dxgi1_3.rs new file mode 100644 index 0000000000000000000000000000000000000000..caf346a6178745e52cbc7452ff4bb8a042a5a760 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/dxgi1_3.rs @@ -0,0 +1,190 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dxgi1_3.h +use ctypes::c_void; +use shared::dxgi::{IDXGIOutput, IDXGIResource}; +use shared::dxgi1_2::{ + DXGI_SWAP_CHAIN_DESC1, IDXGIDevice2, IDXGIDevice2Vtbl, IDXGIFactory2, IDXGIFactory2Vtbl, + IDXGIOutput1, IDXGIOutput1Vtbl, IDXGISwapChain1, IDXGISwapChain1Vtbl, +}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::guiddef::REFIID; +use shared::minwindef::{BOOL, FLOAT, UINT}; +use shared::windef::RECT; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, LARGE_INTEGER}; +ENUM!{enum DXGI_FRAME_PRESENTATION_MODE { + DXGI_FRAME_PRESENTATION_MODE_COMPOSED = 0, + DXGI_FRAME_PRESENTATION_MODE_OVERLAY = 1, + DXGI_FRAME_PRESENTATION_MODE_NONE = 2, + DXGI_FRAME_PRESENTATION_MODE_COMPOSITION_FAILURE = 3, +}} +ENUM!{enum DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS { + DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_NOMINAL_RANGE = 0x1, + DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_BT709 = 0x2, + DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_xvYCC = 0x4, +}} +ENUM!{enum DXGI_OVERLAY_SUPPORT_FLAG { + DXGI_OVERLAY_SUPPORT_FLAG_DIRECT = 0x1, + DXGI_OVERLAY_SUPPORT_FLAG_SCALING = 0x2, +}} +STRUCT!{struct DXGI_DECODE_SWAP_CHAIN_DESC { + Flags: UINT, +}} +STRUCT!{struct DXGI_FRAME_STATISTICS_MEDIA { + PresentCount: UINT, + PresentRefreshCount: UINT, + SyncRefreshCount: UINT, + SyncQPCTime: LARGE_INTEGER, + SyncGPUTime: LARGE_INTEGER, + CompositionMode: DXGI_FRAME_PRESENTATION_MODE, + ApprovedPresentDuration: UINT, +}} +STRUCT!{struct DXGI_MATRIX_3X2_F { + _11: FLOAT, + _12: FLOAT, + _21: FLOAT, + _22: FLOAT, + _31: FLOAT, + _32: FLOAT, +}} +RIDL!{#[uuid(0x2633066b, 0x4514, 0x4c7a, 0x8f, 0xd8, 0x12, 0xea, 0x98, 0x05, 0x9d, 0x18)] +interface IDXGIDecodeSwapChain(IDXGIDecodeSwapChainVtbl): IUnknown(IUnknownVtbl) { + fn PresentBuffer( + BufferToPresent: UINT, + SyncInterval: UINT, + Flags: UINT, + ) -> HRESULT, + fn SetSourceRect( + pRect: *const RECT, + ) -> HRESULT, + fn SetTargetRect( + pRect: *const RECT, + ) -> HRESULT, + fn SetDestSize( + Width: UINT, + Height: UINT, + ) -> HRESULT, + fn GetSourceRect( + pRect: *mut RECT, + ) -> HRESULT, + fn GetTargetRect( + pRect: *mut RECT, + ) -> HRESULT, + fn GetDestSize( + pWidth: *mut UINT, + pHeight: *mut UINT, + ) -> HRESULT, + fn SetColorSpace( + ColorSpace: DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS, + ) -> HRESULT, + fn GetColorSpace() -> DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS, +}} +extern "system" { + pub fn CreateDXGIFactory2( + Flags: UINT, + riid: REFIID, + ppFactory: *mut *mut c_void, + ) -> HRESULT; + pub fn DXGIGetDebugInterface1( + Flags: UINT, + riid: REFIID, + pDebug: *mut *mut c_void, + ) -> HRESULT; +} +RIDL!{#[uuid(0x6007896c, 0x3244, 0x4afd, 0xbf, 0x18, 0xa6, 0xd3, 0xbe, 0xda, 0x50, 0x23)] +interface IDXGIDevice3(IDXGIDevice3Vtbl): IDXGIDevice2(IDXGIDevice2Vtbl) { + fn Trim() -> (), +}} +RIDL!{#[uuid(0x25483823, 0xcd46, 0x4c7d, 0x86, 0xca, 0x47, 0xaa, 0x95, 0xb8, 0x37, 0xbd)] +interface IDXGIFactory3(IDXGIFactory3Vtbl): IDXGIFactory2(IDXGIFactory2Vtbl) { + fn GetCreationFlags() -> UINT, +}} +RIDL!{#[uuid(0x41e7d1f2, 0xa591, 0x4f7b, 0xa2, 0xe5, 0xfa, 0x9c, 0x84, 0x3e, 0x1c, 0x12)] +interface IDXGIFactoryMedia(IDXGIFactoryMediaVtbl): IUnknown(IUnknownVtbl) { + fn CreateSwapChainForCompositionSurfaceHandle( + pDevice: *mut IUnknown, + hSurface: HANDLE, + pDesc: *const DXGI_SWAP_CHAIN_DESC1, + pRestrictToOutput: *mut IDXGIOutput, + ppSwapChain: *mut *mut IDXGISwapChain1, + ) -> HRESULT, + fn CreateDecodeSwapChainForCompositionSurfaceHandle( + pDevice: *mut IUnknown, + hSurface: HANDLE, + pDesc: *mut DXGI_DECODE_SWAP_CHAIN_DESC, + pYuvDecodeBuffers: *mut IDXGIResource, + pRestrictToOutput: *mut IDXGIOutput, + ppSwapChain: *mut *mut IDXGIDecodeSwapChain, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x595e39d1, 0x2724, 0x4663, 0x99, 0xb1, 0xda, 0x96, 0x9d, 0xe2, 0x83, 0x64)] +interface IDXGIOutput2(IDXGIOutput2Vtbl): IDXGIOutput1(IDXGIOutput1Vtbl) { + fn SupportsOverlays() -> BOOL, +}} +RIDL!{#[uuid(0x8a6bb301, 0x7e7e, 0x41f4, 0xa8, 0xe0, 0x5b, 0x32, 0xf7, 0xf9, 0x9b, 0x18)] +interface IDXGIOutput3(IDXGIOutput3Vtbl): IDXGIOutput2(IDXGIOutput2Vtbl) { + fn CheckOverlaySupport( + EnumFormat: DXGI_FORMAT, + pConcernedDevice: *mut IUnknown, + pFlags: *mut UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa8be2ac4, 0x199f, 0x4946, 0xb3, 0x31, 0x79, 0x59, 0x9f, 0xb9, 0x8d, 0xe7)] +interface IDXGISwapChain2(IDXGISwapChain2Vtbl): IDXGISwapChain1(IDXGISwapChain1Vtbl) { + fn SetSourceSize( + Width: UINT, + Height: UINT, + ) -> HRESULT, + fn GetSourceSize( + pWidth: *mut UINT, + pHeight: *mut UINT, + ) -> HRESULT, + fn SetMaximumFrameLatency( + MaxLatency: UINT, + ) -> HRESULT, + fn GetMaximumFrameLatency( + pMaxLatency: *mut UINT, + ) -> HRESULT, + fn GetFrameLatencyWaitableObject() -> HANDLE, + fn SetMatrixTransform( + pMatrix: *const DXGI_MATRIX_3X2_F, + ) -> HRESULT, + fn GetMatrixTransform( + pMatrix: *mut DXGI_MATRIX_3X2_F, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdd95b90b, 0xf05f, 0x4f6a, 0xbd, 0x65, 0x25, 0xbf, 0xb2, 0x64, 0xbd, 0x84)] +interface IDXGISwapChainMedia(IDXGISwapChainMediaVtbl): IUnknown(IUnknownVtbl) { + fn GetFrameStatisticsMedia( + pStats: *mut DXGI_FRAME_STATISTICS_MEDIA, + ) -> HRESULT, + fn SetPresentDuration( + Duration: UINT, + ) -> HRESULT, + fn CheckPresentDurationSupport( + DesiredPresentDuration: UINT, + pClosestSmallerPresentDuration: *mut UINT, + pClosestLargerPresentDuration: *mut UINT, + ) -> HRESULT, +}} +pub const DXGI_CREATE_FACTORY_DEBUG: UINT = 0x1; +DEFINE_GUID!{IID_IDXGIDevice3, + 0x6007896c, 0x3244, 0x4afd, 0xbf, 0x18, 0xa6, 0xd3, 0xbe, 0xda, 0x50, 0x23} +DEFINE_GUID!{IID_IDXGISwapChain2, + 0xa8be2ac4, 0x199f, 0x4946, 0xb3, 0x31, 0x79, 0x59, 0x9f, 0xb9, 0x8d, 0xe7} +DEFINE_GUID!{IID_IDXGIOutput2, + 0x595e39d1, 0x2724, 0x4663, 0x99, 0xb1, 0xda, 0x96, 0x9d, 0xe2, 0x83, 0x64} +DEFINE_GUID!{IID_IDXGIFactory3, + 0x25483823, 0xcd46, 0x4c7d, 0x86, 0xca, 0x47, 0xaa, 0x95, 0xb8, 0x37, 0xbd} +DEFINE_GUID!{IID_IDXGIDecodeSwapChain, + 0x2633066b, 0x4514, 0x4c7a, 0x8f, 0xd8, 0x12, 0xea, 0x98, 0x05, 0x9d, 0x18} +DEFINE_GUID!{IID_IDXGIFactoryMedia, + 0x41e7d1f2, 0xa591, 0x4f7b, 0xa2, 0xe5, 0xfa, 0x9c, 0x84, 0x3e, 0x1c, 0x12} +DEFINE_GUID!{IID_IDXGISwapChainMedia, + 0xdd95b90b, 0xf05f, 0x4f6a, 0xbd, 0x65, 0x25, 0xbf, 0xb2, 0x64, 0xbd, 0x84} +DEFINE_GUID!{IID_IDXGIOutput3, + 0x8a6bb301, 0x7e7e, 0x41f4, 0xa8, 0xe0, 0x5b, 0x32, 0xf7, 0xf9, 0x9b, 0x18} diff --git a/bash-5.1/vendor/winapi/src/shared/dxgi1_4.rs b/bash-5.1/vendor/winapi/src/shared/dxgi1_4.rs new file mode 100644 index 0000000000000000000000000000000000000000..53269e88ddd8ea2ce683fa0037be9dba5ebbdcb2 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/dxgi1_4.rs @@ -0,0 +1,112 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dxgi1_4.h +use ctypes::c_void; +use shared::basetsd::UINT64; +use shared::dxgi1_2::{IDXGIAdapter2, IDXGIAdapter2Vtbl}; +use shared::dxgi1_3::{ + IDXGIFactory3, IDXGIFactory3Vtbl, IDXGIOutput3, IDXGIOutput3Vtbl, IDXGISwapChain2, + IDXGISwapChain2Vtbl, +}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::dxgitype::DXGI_COLOR_SPACE_TYPE; +use shared::guiddef::REFGUID; +use shared::minwindef::{DWORD, UINT}; +use um::unknwnbase::IUnknown; +use um::winnt::{HANDLE, HRESULT, LUID}; +ENUM!{enum DXGI_MEMORY_SEGMENT_GROUP { + DXGI_MEMORY_SEGMENT_GROUP_LOCAL = 0, + DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL = 1, +}} +ENUM!{enum DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG { + DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG_PRESENT = 0x1, +}} +ENUM!{enum DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG { + DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT = 0x1, + DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_OVERLAY_PRESENT = 0x2, +}} +STRUCT!{struct DXGI_QUERY_VIDEO_MEMORY_INFO { + Budget: UINT64, + CurrentUsage: UINT64, + AvailableForReservation: UINT64, + CurrentReservation: UINT64, +}} +RIDL!{#[uuid(0x645967a4, 0x1392, 0x4310, 0xa7, 0x98, 0x80, 0x53, 0xce, 0x3e, 0x93, 0xfd)] +interface IDXGIAdapter3(IDXGIAdapter3Vtbl): IDXGIAdapter2(IDXGIAdapter2Vtbl) { + fn RegisterHardwareContentProtectionTeardownStatusEvent( + hEvent: HANDLE, + pdwCookie: *mut DWORD, + ) -> HRESULT, + fn UnregisterHardwareContentProtectionTeardownStatus( + dwCookie: DWORD, + ) -> (), + fn QueryVideoMemoryInfo( + NodeIndex: UINT, + MemorySegmentGroup: DXGI_MEMORY_SEGMENT_GROUP, + pVideoMemoryInfo: *mut DXGI_QUERY_VIDEO_MEMORY_INFO, + ) -> HRESULT, + fn SetVideoMemoryReservation( + NodeIndex: UINT, + MemorySegmentGroup: DXGI_MEMORY_SEGMENT_GROUP, + Reservation: UINT64, + ) -> HRESULT, + fn RegisterVideoMemoryBudgetChangeNotificationEvent( + hEvent: HANDLE, + pdwCookie: *mut DWORD, + ) -> HRESULT, + fn UnregisterVideoMemoryBudgetChangeNotification( + dwCookie: DWORD, + ) -> (), +}} +RIDL!{#[uuid(0x1bc6ea02, 0xef36, 0x464f, 0xbf, 0x0c, 0x21, 0xca, 0x39, 0xe5, 0x16, 0x8a)] +interface IDXGIFactory4(IDXGIFactory4Vtbl): IDXGIFactory3(IDXGIFactory3Vtbl) { + fn EnumAdapterByLuid( + AdapterLuid: LUID, + riid: REFGUID, + ppvAdapter: *mut *mut c_void, + ) -> HRESULT, + fn EnumWarpAdapter( + riid: REFGUID, + ppvAdapter: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdc7dca35, 0x2196, 0x414d, 0x9f, 0x53, 0x61, 0x78, 0x84, 0x03, 0x2a, 0x60)] +interface IDXGIOutput4(IDXGIOutput4Vtbl): IDXGIOutput3(IDXGIOutput3Vtbl) { + fn CheckOverlayColorSpaceSupport( + Format: DXGI_FORMAT, + ColorSpace: DXGI_COLOR_SPACE_TYPE, + pConcernedDevice: *mut IUnknown, + pFlags: *mut UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x94d99bdb, 0xf1f8, 0x4ab0, 0xb2, 0x36, 0x7d, 0xa0, 0x17, 0x0e, 0xda, 0xb1)] +interface IDXGISwapChain3(IDXGISwapChain3Vtbl): IDXGISwapChain2(IDXGISwapChain2Vtbl) { + fn GetCurrentBackBufferIndex() -> UINT, + fn CheckColorSpaceSupport( + ColorSpace: DXGI_COLOR_SPACE_TYPE, + pColorSpaceSupport: *mut UINT, + ) -> HRESULT, + fn SetColorSpace1( + ColorSpace: DXGI_COLOR_SPACE_TYPE, + ) -> HRESULT, + fn ResizeBuffers1( + BufferCount: UINT, + Width: UINT, + Height: UINT, + Format: DXGI_FORMAT, + SwapChainFlags: UINT, + pCreationNodeMask: *const UINT, + ppPresentQueue: *mut *mut IUnknown, + ) -> HRESULT, +}} +DEFINE_GUID!{IID_IDXGISwapChain3, + 0x94d99bdb, 0xf1f8, 0x4ab0, 0xb2, 0x36, 0x7d, 0xa0, 0x17, 0x0e, 0xda, 0xb1} +DEFINE_GUID!{IID_IDXGIOutput4, + 0xdc7dca35, 0x2196, 0x414d, 0x9f, 0x53, 0x61, 0x78, 0x84, 0x03, 0x2a, 0x60} +DEFINE_GUID!{IID_IDXGIFactory4, + 0x1bc6ea02, 0xef36, 0x464f, 0xbf, 0x0c, 0x21, 0xca, 0x39, 0xe5, 0x16, 0x8a} +DEFINE_GUID!{IID_IDXGIAdapter3, + 0x645967a4, 0x1392, 0x4310, 0xa7, 0x98, 0x80, 0x53, 0xce, 0x3e, 0x93, 0xfd} diff --git a/bash-5.1/vendor/winapi/src/shared/dxgi1_5.rs b/bash-5.1/vendor/winapi/src/shared/dxgi1_5.rs new file mode 100644 index 0000000000000000000000000000000000000000..a0500a247885315b8d33779a6f17676346c9bf20 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/dxgi1_5.rs @@ -0,0 +1,92 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dxgi1_5.h +use ctypes::c_void; +use shared::basetsd::UINT16; +use shared::dxgi::IDXGIResource; +use shared::dxgi1_2::{DXGI_OFFER_RESOURCE_PRIORITY, IDXGIOutputDuplication}; +use shared::dxgi1_3::{IDXGIDevice3, IDXGIDevice3Vtbl}; +use shared::dxgi1_4::{ + IDXGIFactory4, IDXGIFactory4Vtbl, IDXGIOutput4, IDXGIOutput4Vtbl, IDXGISwapChain3, + IDXGISwapChain3Vtbl, +}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::minwindef::UINT; +use um::unknwnbase::IUnknown; +use um::winnt::HRESULT; +RIDL!{#[uuid(0x80a07424, 0xab52, 0x42eb, 0x83, 0x3c, 0x0c, 0x42, 0xfd, 0x28, 0x2d, 0x98)] +interface IDXGIOutput5(IDXGIOutput5Vtbl): IDXGIOutput4(IDXGIOutput4Vtbl) { + fn DuplicateOutput1( + pDevice: *mut IUnknown, + Flags: UINT, + SupportedFormatsCount: UINT, + pSupportedFormats: *const DXGI_FORMAT, + ppOutputDuplication: *mut *mut IDXGIOutputDuplication, + )-> HRESULT, +}} +ENUM!{enum DXGI_HDR_METADATA_TYPE { + DXGI_HDR_METADATA_TYPE_NONE = 0, + DXGI_HDR_METADATA_TYPE_HDR10 = 1, +}} +STRUCT!{struct DXGI_HDR_METADATA_HDR10 { + RedPrimary: [UINT16; 2], + GreenPrimary: [UINT16; 2], + BluePrimary: [UINT16; 2], + WhitePoint: [UINT16; 2], + MaxMasteringLuminance: UINT, + MinMasteringLuminance: UINT, + MaxContentLightLevel: UINT16, + MaxFrameAverageLightLevel: UINT16, +}} +RIDL!{#[uuid(0x3d585d5a, 0xbd4a, 0x489e, 0xb1, 0xf4, 0x3d, 0xbc, 0xb6, 0x45, 0x2f, 0xfb)] +interface IDXGISwapChain4(IDXGISwapChain4Vtbl): IDXGISwapChain3(IDXGISwapChain3Vtbl) { + fn SetHDRMetaData( + Type: DXGI_HDR_METADATA_TYPE, + Size: UINT, + pMetaData: *mut c_void, + )-> HRESULT, +}} +ENUM!{enum DXGI_OFFER_RESOURCE_FLAGS { + DXGI_OFFER_RESOURCE_FLAG_ALLOW_DECOMMIT = 0x1, +}} +ENUM!{enum DXGI_RECLAIM_RESOURCE_RESULTS { + DXGI_RECLAIM_RESOURCE_RESULT_OK = 0, + DXGI_RECLAIM_RESOURCE_RESULT_DISCARDED = 1, + DXGI_RECLAIM_RESOURCE_RESULT_NOT_COMMITTED = 2, +}} +RIDL!{#[uuid(0x95b4f95f, 0xd8da, 0x4ca4, 0x9e, 0xe6, 0x3b, 0x76, 0xd5, 0x96, 0x8a, 0x10)] +interface IDXGIDevice4(IDXGIDevice4Vtbl): IDXGIDevice3(IDXGIDevice3Vtbl) { + fn OfferResources1( + NumResources: UINT, + ppResources: *mut *mut IDXGIResource, + Priority: DXGI_OFFER_RESOURCE_PRIORITY, + Flags: UINT, + ) -> HRESULT, + fn ReclaimResources1( + NumResources: UINT, + ppResources: *mut *mut IDXGIResource, + pResults: *mut DXGI_RECLAIM_RESOURCE_RESULTS, + ) -> HRESULT, +}} +ENUM!{enum DXGI_FEATURE { + DXGI_FEATURE_PRESENT_ALLOW_TEARING = 0, +}} +RIDL!{#[uuid(0x7632e1f5, 0xee65, 0x4dca, 0x87, 0xfd, 0x84, 0xcd, 0x75, 0xf8, 0x83, 0x8d)] +interface IDXGIFactory5(IDXGIFactory5Vtbl): IDXGIFactory4(IDXGIFactory4Vtbl) { + fn CheckFeatureSupport( + Feature: DXGI_FEATURE, + pFeatureSupportData: *mut c_void, + FeatureSupportDataSize: UINT, + ) -> HRESULT, +}} +DEFINE_GUID!{IID_IDXGIOutput5, + 0x80A07424, 0xAB52, 0x42EB, 0x83, 0x3C, 0x0C, 0x42, 0xFD, 0x28, 0x2D, 0x98} +DEFINE_GUID!{IID_IDXGISwapChain4, + 0x3D585D5A, 0xBD4A, 0x489E, 0xB1, 0xF4, 0x3D, 0xBC, 0xB6, 0x45, 0x2F, 0xFB} +DEFINE_GUID!{IID_IDXGIDevice4, + 0x95B4F95F, 0xD8DA, 0x4CA4, 0x9E, 0xE6, 0x3B, 0x76, 0xD5, 0x96, 0x8A, 0x10} +DEFINE_GUID!{IID_IDXGIFactory5, + 0x7632e1f5, 0xee65, 0x4dca, 0x87, 0xfd, 0x84, 0xcd, 0x75, 0xf8, 0x83, 0x8d} diff --git a/bash-5.1/vendor/winapi/src/shared/dxgi1_6.rs b/bash-5.1/vendor/winapi/src/shared/dxgi1_6.rs new file mode 100644 index 0000000000000000000000000000000000000000..30af205193f1c09c962da13405365385341fde51 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/dxgi1_6.rs @@ -0,0 +1,98 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dxgi1_6.h +use ctypes::c_void; +use shared::basetsd::SIZE_T; +use shared::dxgi1_2::{ + DXGI_COMPUTE_PREEMPTION_GRANULARITY, DXGI_GRAPHICS_PREEMPTION_GRANULARITY, +}; +use shared::dxgi1_4::{IDXGIAdapter3, IDXGIAdapter3Vtbl}; +use shared::dxgi1_5::{IDXGIFactory5, IDXGIFactory5Vtbl, IDXGIOutput5, IDXGIOutput5Vtbl}; +use shared::dxgitype::{DXGI_COLOR_SPACE_TYPE, DXGI_MODE_ROTATION}; +use shared::guiddef::REFIID; +use shared::minwindef::{BOOL, FLOAT, UINT}; +use shared::windef::{HMONITOR, RECT}; +use um::winnt::{HRESULT, LUID, WCHAR}; +ENUM!{enum DXGI_ADAPTER_FLAG3 { + DXGI_ADAPTER_FLAG3_NONE = 0, + DXGI_ADAPTER_FLAG3_REMOTE = 1, + DXGI_ADAPTER_FLAG3_SOFTWARE = 2, + DXGI_ADAPTER_FLAG3_ACG_COMPATIBLE = 4, + DXGI_ADAPTER_FLAG3_SUPPORT_MONITORED_FENCES = 8, + DXGI_ADAPTER_FLAG3_SUPPORT_NON_MONITORED_FENCES = 0x10, + DXGI_ADAPTER_FLAG3_KEYED_MUTEX_CONFORMANCE = 0x20, + DXGI_ADAPTER_FLAG3_FORCE_DWORD = 0xFFFFFFFF, +}} +STRUCT!{struct DXGI_ADAPTER_DESC3 { + Description: [WCHAR; 128], + VendorID: UINT, + DeviceID: UINT, + SubSysID: UINT, + Revision: UINT, + DedicatedVideoMemory: SIZE_T, + DedicatedSystemMemory: SIZE_T, + SharedSystemMemory: SIZE_T, + AdapterLuid: LUID, + Flags: DXGI_ADAPTER_FLAG3, + GraphicsPreemptionGranularity: DXGI_GRAPHICS_PREEMPTION_GRANULARITY, + ComputePreemptionGranularity: DXGI_COMPUTE_PREEMPTION_GRANULARITY, +}} +RIDL!{#[uuid(0x3c8d99d1, 0x4fbf, 0x4181, 0xa8, 0x2c, 0xaf, 0x66, 0xbf, 0x7b, 0xd2, 0x4e)] +interface IDXGIAdapter4(IDXGIAdapter4Vtbl): IDXGIAdapter3(IDXGIAdapter3Vtbl) { + fn GetDesc3( + pDesc: *mut DXGI_ADAPTER_DESC3, + ) -> HRESULT, +}} +STRUCT!{struct DXGI_OUTPUT_DESC1 { + DeviceName: [WCHAR; 32], + DesktopCoordinates: RECT, + AttachedToDesktop: BOOL, + Rotation: DXGI_MODE_ROTATION, + Monitor: HMONITOR, + BitsPerColor: UINT, + ColorSpace: DXGI_COLOR_SPACE_TYPE, + RedPrimary: [FLOAT; 2], + GreenPrimary: [FLOAT; 2], + BluePrimary: [FLOAT; 2], + WhitePoint: [FLOAT; 2], + MinLuminance: FLOAT, + MaxLuminance: FLOAT, + MaxFullFrameLuminance: FLOAT, +}} +ENUM!{enum DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS { + DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_FULLSCREEN = 1, + DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_WINDOWED = 2, + DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_CURSOR_STRETCHED = 4, +}} +RIDL!{#[uuid(0x068346e8, 0xaaec, 0x4b84, 0xad, 0xd7, 0x13, 0x7f, 0x51, 0x3f, 0x77, 0xa1)] +interface IDXGIOutput6(IDXGIOutput6Vtbl): IDXGIOutput5(IDXGIOutput5Vtbl) { + fn GetDesc1( + pDesc: *mut DXGI_OUTPUT_DESC1, + ) -> HRESULT, + fn CheckHardwareCompositionSupport( + pFlags: *mut UINT, + ) -> HRESULT, +}} +ENUM!{enum DXGI_GPU_PREFERENCE { + DXGI_GPU_PREFERENCE_UNSPECIFIED = 0, + DXGI_GPU_PREFERENCE_MINIMUM_POWER = 1, + DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE = 2, +}} +RIDL!{#[uuid(0xc1b6694f, 0xff09, 0x44a9, 0xb0, 0x3c, 0x77, 0x90, 0x0a, 0x0a, 0x1d, 0x17)] +interface IDXGIFactory6(IDXGIFactory6Vtbl): IDXGIFactory5(IDXGIFactory5Vtbl) { + fn EnumAdapterByGpuPreference( + Adapter: UINT, + GpuPreference: DXGI_GPU_PREFERENCE, + riid: REFIID, + ppvAdapter: *mut *mut c_void, + ) -> HRESULT, +}} +DEFINE_GUID!{IID_IDXGIAdapter4, + 0x3c8d99d1, 0x4fbf, 0x4181, 0xa8, 0x2c, 0xaf, 0x66, 0xbf, 0x7b, 0xd2, 0x4e} +DEFINE_GUID!{IID_IDXGIOutput6, + 0x068346e8, 0xaaec, 0x4b84, 0xad, 0xd7, 0x13, 0x7f, 0x51, 0x3f, 0x77, 0xa1} +DEFINE_GUID!{IID_IDXGIFactory6, + 0xc1b6694f, 0xff09, 0x44a9, 0xb0, 0x3c, 0x77, 0x90, 0x0a, 0x0a, 0x1d, 0x17} diff --git a/bash-5.1/vendor/winapi/src/shared/dxgiformat.rs b/bash-5.1/vendor/winapi/src/shared/dxgiformat.rs new file mode 100644 index 0000000000000000000000000000000000000000..84cd23fa2994c6182145b7d4c50144efc052db1a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/dxgiformat.rs @@ -0,0 +1,127 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dxgiformat.h +ENUM!{enum DXGI_FORMAT { + DXGI_FORMAT_UNKNOWN = 0, + DXGI_FORMAT_R32G32B32A32_TYPELESS = 1, + DXGI_FORMAT_R32G32B32A32_FLOAT = 2, + DXGI_FORMAT_R32G32B32A32_UINT = 3, + DXGI_FORMAT_R32G32B32A32_SINT = 4, + DXGI_FORMAT_R32G32B32_TYPELESS = 5, + DXGI_FORMAT_R32G32B32_FLOAT = 6, + DXGI_FORMAT_R32G32B32_UINT = 7, + DXGI_FORMAT_R32G32B32_SINT = 8, + DXGI_FORMAT_R16G16B16A16_TYPELESS = 9, + DXGI_FORMAT_R16G16B16A16_FLOAT = 10, + DXGI_FORMAT_R16G16B16A16_UNORM = 11, + DXGI_FORMAT_R16G16B16A16_UINT = 12, + DXGI_FORMAT_R16G16B16A16_SNORM = 13, + DXGI_FORMAT_R16G16B16A16_SINT = 14, + DXGI_FORMAT_R32G32_TYPELESS = 15, + DXGI_FORMAT_R32G32_FLOAT = 16, + DXGI_FORMAT_R32G32_UINT = 17, + DXGI_FORMAT_R32G32_SINT = 18, + DXGI_FORMAT_R32G8X24_TYPELESS = 19, + DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20, + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21, + DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22, + DXGI_FORMAT_R10G10B10A2_TYPELESS = 23, + DXGI_FORMAT_R10G10B10A2_UNORM = 24, + DXGI_FORMAT_R10G10B10A2_UINT = 25, + DXGI_FORMAT_R11G11B10_FLOAT = 26, + DXGI_FORMAT_R8G8B8A8_TYPELESS = 27, + DXGI_FORMAT_R8G8B8A8_UNORM = 28, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29, + DXGI_FORMAT_R8G8B8A8_UINT = 30, + DXGI_FORMAT_R8G8B8A8_SNORM = 31, + DXGI_FORMAT_R8G8B8A8_SINT = 32, + DXGI_FORMAT_R16G16_TYPELESS = 33, + DXGI_FORMAT_R16G16_FLOAT = 34, + DXGI_FORMAT_R16G16_UNORM = 35, + DXGI_FORMAT_R16G16_UINT = 36, + DXGI_FORMAT_R16G16_SNORM = 37, + DXGI_FORMAT_R16G16_SINT = 38, + DXGI_FORMAT_R32_TYPELESS = 39, + DXGI_FORMAT_D32_FLOAT = 40, + DXGI_FORMAT_R32_FLOAT = 41, + DXGI_FORMAT_R32_UINT = 42, + DXGI_FORMAT_R32_SINT = 43, + DXGI_FORMAT_R24G8_TYPELESS = 44, + DXGI_FORMAT_D24_UNORM_S8_UINT = 45, + DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46, + DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47, + DXGI_FORMAT_R8G8_TYPELESS = 48, + DXGI_FORMAT_R8G8_UNORM = 49, + DXGI_FORMAT_R8G8_UINT = 50, + DXGI_FORMAT_R8G8_SNORM = 51, + DXGI_FORMAT_R8G8_SINT = 52, + DXGI_FORMAT_R16_TYPELESS = 53, + DXGI_FORMAT_R16_FLOAT = 54, + DXGI_FORMAT_D16_UNORM = 55, + DXGI_FORMAT_R16_UNORM = 56, + DXGI_FORMAT_R16_UINT = 57, + DXGI_FORMAT_R16_SNORM = 58, + DXGI_FORMAT_R16_SINT = 59, + DXGI_FORMAT_R8_TYPELESS = 60, + DXGI_FORMAT_R8_UNORM = 61, + DXGI_FORMAT_R8_UINT = 62, + DXGI_FORMAT_R8_SNORM = 63, + DXGI_FORMAT_R8_SINT = 64, + DXGI_FORMAT_A8_UNORM = 65, + DXGI_FORMAT_R1_UNORM = 66, + DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67, + DXGI_FORMAT_R8G8_B8G8_UNORM = 68, + DXGI_FORMAT_G8R8_G8B8_UNORM = 69, + DXGI_FORMAT_BC1_TYPELESS = 70, + DXGI_FORMAT_BC1_UNORM = 71, + DXGI_FORMAT_BC1_UNORM_SRGB = 72, + DXGI_FORMAT_BC2_TYPELESS = 73, + DXGI_FORMAT_BC2_UNORM = 74, + DXGI_FORMAT_BC2_UNORM_SRGB = 75, + DXGI_FORMAT_BC3_TYPELESS = 76, + DXGI_FORMAT_BC3_UNORM = 77, + DXGI_FORMAT_BC3_UNORM_SRGB = 78, + DXGI_FORMAT_BC4_TYPELESS = 79, + DXGI_FORMAT_BC4_UNORM = 80, + DXGI_FORMAT_BC4_SNORM = 81, + DXGI_FORMAT_BC5_TYPELESS = 82, + DXGI_FORMAT_BC5_UNORM = 83, + DXGI_FORMAT_BC5_SNORM = 84, + DXGI_FORMAT_B5G6R5_UNORM = 85, + DXGI_FORMAT_B5G5R5A1_UNORM = 86, + DXGI_FORMAT_B8G8R8A8_UNORM = 87, + DXGI_FORMAT_B8G8R8X8_UNORM = 88, + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89, + DXGI_FORMAT_B8G8R8A8_TYPELESS = 90, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91, + DXGI_FORMAT_B8G8R8X8_TYPELESS = 92, + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93, + DXGI_FORMAT_BC6H_TYPELESS = 94, + DXGI_FORMAT_BC6H_UF16 = 95, + DXGI_FORMAT_BC6H_SF16 = 96, + DXGI_FORMAT_BC7_TYPELESS = 97, + DXGI_FORMAT_BC7_UNORM = 98, + DXGI_FORMAT_BC7_UNORM_SRGB = 99, + DXGI_FORMAT_AYUV = 100, + DXGI_FORMAT_Y410 = 101, + DXGI_FORMAT_Y416 = 102, + DXGI_FORMAT_NV12 = 103, + DXGI_FORMAT_P010 = 104, + DXGI_FORMAT_P016 = 105, + DXGI_FORMAT_420_OPAQUE = 106, + DXGI_FORMAT_YUY2 = 107, + DXGI_FORMAT_Y210 = 108, + DXGI_FORMAT_Y216 = 109, + DXGI_FORMAT_NV11 = 110, + DXGI_FORMAT_AI44 = 111, + DXGI_FORMAT_IA44 = 112, + DXGI_FORMAT_P8 = 113, + DXGI_FORMAT_A8P8 = 114, + DXGI_FORMAT_B4G4R4A4_UNORM = 115, + DXGI_FORMAT_P208 = 130, + DXGI_FORMAT_V208 = 131, + DXGI_FORMAT_V408 = 132, +}} diff --git a/bash-5.1/vendor/winapi/src/shared/dxgitype.rs b/bash-5.1/vendor/winapi/src/shared/dxgitype.rs new file mode 100644 index 0000000000000000000000000000000000000000..d09dccde5e6fedb966dba52163c6345ac58dc420 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/dxgitype.rs @@ -0,0 +1,109 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dxgitype.h +use shared::d3d9types::D3DCOLORVALUE; +use shared::dxgiformat::DXGI_FORMAT; +use shared::minwindef::{BOOL, BYTE, DWORD, UINT}; +pub const DXGI_CPU_ACCESS_NONE: DWORD = 0; +pub const DXGI_CPU_ACCESS_DYNAMIC: DWORD = 1; +pub const DXGI_CPU_ACCESS_READ_WRITE: DWORD = 2; +pub const DXGI_CPU_ACCESS_SCRATCH: DWORD = 3; +pub const DXGI_CPU_ACCESS_FIELD: DWORD = 15; +ENUM!{enum DXGI_USAGE { + DXGI_USAGE_SHADER_INPUT = 1 << (0 + 4), + DXGI_USAGE_RENDER_TARGET_OUTPUT = 1 << (1 + 4), + DXGI_USAGE_BACK_BUFFER = 1 << (2 + 4), + DXGI_USAGE_SHARED = 1 << (3 + 4), + DXGI_USAGE_READ_ONLY = 1 << (4 + 4), + DXGI_USAGE_DISCARD_ON_PRESENT = 1 << (5 + 4), + DXGI_USAGE_UNORDERED_ACCESS = 1 << (6 + 4), +}} +STRUCT!{struct DXGI_RGB { + Red: f32, + Green: f32, + Blue: f32, +}} +pub type DXGI_RGBA = D3DCOLORVALUE; +STRUCT!{struct DXGI_GAMMA_CONTROL { + Scale: DXGI_RGB, + Offset: DXGI_RGB, + GammaCurve: [DXGI_RGB; 1025], +}} +STRUCT!{struct DXGI_GAMMA_CONTROL_CAPABILITIES { + ScaleAndOffsetSupported: BOOL, + MaxConvertedValue: f32, + MinConvertedValue: f32, + NumGammaControlPoints: UINT, + ControlPointPositions: [f32; 1025], +}} +STRUCT!{struct DXGI_RATIONAL { + Numerator: UINT, + Denominator: UINT, +}} +ENUM!{enum DXGI_MODE_SCANLINE_ORDER { + DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED, + DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE, + DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST, + DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST, +}} +ENUM!{enum DXGI_MODE_SCALING { + DXGI_MODE_SCALING_UNSPECIFIED, + DXGI_MODE_SCALING_CENTERED, + DXGI_MODE_SCALING_STRETCHED, +}} +ENUM!{enum DXGI_MODE_ROTATION { + DXGI_MODE_ROTATION_UNSPECIFIED, + DXGI_MODE_ROTATION_IDENTITY, + DXGI_MODE_ROTATION_ROTATE90, + DXGI_MODE_ROTATION_ROTATE180, + DXGI_MODE_ROTATION_ROTATE270, +}} +STRUCT!{struct DXGI_MODE_DESC { + Width: UINT, + Height: UINT, + RefreshRate: DXGI_RATIONAL, + Format: DXGI_FORMAT, + ScanlineOrdering: DXGI_MODE_SCANLINE_ORDER, + Scaling: DXGI_MODE_SCALING, +}} +STRUCT!{struct DXGI_SAMPLE_DESC { + Count: UINT, + Quality: UINT, +}} +STRUCT!{struct DXGI_JPEG_DC_HUFFMAN_TABLE { + CodeCounts: [BYTE; 12], + CodeValues: [BYTE; 12], +}} +STRUCT!{struct DXGI_JPEG_AC_HUFFMAN_TABLE { + CodeCounts: [BYTE; 16], + CodeValues: [BYTE; 162], +}} +STRUCT!{struct DXGI_JPEG_QUANTIZATION_TABLE { + Elements: [BYTE; 64], +}} +ENUM!{enum DXGI_COLOR_SPACE_TYPE { + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0, + DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 1, + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 2, + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 3, + DXGI_COLOR_SPACE_RESERVED = 4, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 5, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 6, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 7, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 8, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 9, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 10, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 11, + DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 = 12, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 = 13, + DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 = 14, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 = 15, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 16, + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 = 17, + DXGI_COLOR_SPACE_CUSTOM = 0xFFFFFFFF, +}} +pub const DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN: UINT = 0xfffffffe; +pub const DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN: UINT = 0xffffffff; diff --git a/bash-5.1/vendor/winapi/src/shared/evntprov.rs b/bash-5.1/vendor/winapi/src/shared/evntprov.rs new file mode 100644 index 0000000000000000000000000000000000000000..455ff5d2924ee815a580ba8e66be0339cefb3c34 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/evntprov.rs @@ -0,0 +1,309 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{SIZE_T, ULONG64}; +use shared::guiddef::{LPCGUID, LPGUID}; +use shared::minwindef::{UCHAR, ULONG, USHORT}; +use um::winnt::{ANYSIZE_ARRAY, BOOLEAN, PCWSTR, PVOID, ULONGLONG, VOID}; +pub const EVENT_MIN_LEVEL: UCHAR = 0; +pub const EVENT_MAX_LEVEL: UCHAR = 0xff; +pub const EVENT_ACTIVITY_CTRL_GET_ID: ULONG = 1; +pub const EVENT_ACTIVITY_CTRL_SET_ID: ULONG = 2; +pub const EVENT_ACTIVITY_CTRL_CREATE_ID: ULONG = 3; +pub const EVENT_ACTIVITY_CTRL_GET_SET_ID: ULONG = 4; +pub const EVENT_ACTIVITY_CTRL_CREATE_SET_ID: ULONG = 5; +pub const MAX_EVENT_DATA_DESCRIPTORS: SIZE_T = 128; +pub const MAX_EVENT_FILTER_DATA_SIZE: SIZE_T = 1024; +pub const MAX_EVENT_FILTER_PAYLOAD_SIZE: SIZE_T = 4096; +pub const MAX_EVENT_FILTER_EVENT_NAME_SIZE: SIZE_T = 4096; +pub const MAX_EVENT_FILTERS_COUNT: SIZE_T = 8; +pub const MAX_EVENT_FILTER_PID_COUNT: SIZE_T = 8; +pub const MAX_EVENT_FILTER_EVENT_ID_COUNT: SIZE_T = 64; +pub const EVENT_FILTER_TYPE_NONE: ULONG = 0x00000000; +pub const EVENT_FILTER_TYPE_SCHEMATIZED: ULONG = 0x80000000; +pub const EVENT_FILTER_TYPE_SYSTEM_FLAGS: ULONG = 0x80000001; +pub const EVENT_FILTER_TYPE_TRACEHANDLE: ULONG = 0x80000002; +pub const EVENT_FILTER_TYPE_PID: ULONG = 0x80000004; +pub const EVENT_FILTER_TYPE_EXECUTABLE_NAME: ULONG = 0x80000008; +pub const EVENT_FILTER_TYPE_PACKAGE_ID: ULONG = 0x80000010; +pub const EVENT_FILTER_TYPE_PACKAGE_APP_ID: ULONG = 0x80000020; +pub const EVENT_FILTER_TYPE_PAYLOAD: ULONG = 0x80000100; +pub const EVENT_FILTER_TYPE_EVENT_ID: ULONG = 0x80000200; +pub const EVENT_FILTER_TYPE_EVENT_NAME: ULONG = 0x80000400; +pub const EVENT_FILTER_TYPE_STACKWALK: ULONG = 0x80001000; +pub const EVENT_FILTER_TYPE_STACKWALK_NAME: ULONG = 0x80001000; +pub const EVENT_FILTER_TYPE_STACKWALK_LEVEL_KW: ULONG = 0x80004000; +pub const EVENT_DATA_DESCRIPTOR_TYPE_NONE: UCHAR = 0; +pub const EVENT_DATA_DESCRIPTOR_TYPE_EVENT_METADATA: UCHAR = 1; +pub const EVENT_DATA_DESCRIPTOR_TYPE_PROVIDER_METADATA: UCHAR = 2; +pub const EVENT_DATA_DESCRIPTOR_TYPE_TIMESTAMP_OVERRIDE: UCHAR = 3; +pub const EVENT_WRITE_FLAG_NO_FAULTING: ULONG = 0x00000001; +pub const EVENT_WRITE_FLAG_INPRIVATE: ULONG = 0x00000002; +pub type REGHANDLE = ULONGLONG; +pub type PREGHANDLE = *mut REGHANDLE; +STRUCT!{struct EVENT_DATA_DESCRIPTOR_u_s { + Type: UCHAR, + Reserved1: UCHAR, + Reserved2: USHORT, +}} +UNION!{union EVENT_DATA_DESCRIPTOR_u { + [u32; 1], + Reserved Reserved_mut: ULONG, + s s_mut: EVENT_DATA_DESCRIPTOR_u_s, +}} +STRUCT!{struct EVENT_DATA_DESCRIPTOR { + Ptr: ULONGLONG, + Size: ULONG, + u: EVENT_DATA_DESCRIPTOR_u, +}} +pub type PEVENT_DATA_DESCRIPTOR = *mut EVENT_DATA_DESCRIPTOR; +STRUCT!{struct EVENT_DESCRIPTOR { + Id: USHORT, + Version: UCHAR, + Channel: UCHAR, + Level: UCHAR, + Opcode: UCHAR, + Task: USHORT, + Keyword: ULONGLONG, +}} +pub type PEVENT_DESCRIPTOR = *mut EVENT_DESCRIPTOR; +pub type PCEVENT_DESCRIPTOR = *const EVENT_DESCRIPTOR; +STRUCT!{struct EVENT_FILTER_DESCRIPTOR { + Ptr: ULONGLONG, + Size: ULONG, + Type: ULONG, +}} +pub type PEVENT_FILTER_DESCRIPTOR = *mut EVENT_FILTER_DESCRIPTOR; +STRUCT!{struct EVENT_FILTER_HEADER { + Id: USHORT, + Version: UCHAR, + Reserved: [UCHAR; 5], + InstanceId: ULONGLONG, + Size: ULONG, + NextOffset: ULONG, +}} +pub type PEVENT_FILTER_HEADER = *mut EVENT_FILTER_HEADER; +STRUCT!{struct EVENT_FILTER_EVENT_ID { + FilterIn: BOOLEAN, + Reserved: UCHAR, + Count: USHORT, + Events: [USHORT; ANYSIZE_ARRAY], +}} +pub type PEVENT_FILTER_EVENT_ID = *mut EVENT_FILTER_EVENT_ID; +STRUCT!{struct EVENT_FILTER_EVENT_NAME { + MatchAnyKeyword: ULONGLONG, + MatchAllKeyword: ULONGLONG, + Level: UCHAR, + FilterIn: BOOLEAN, + NameCount: USHORT, + Names: [UCHAR; ANYSIZE_ARRAY], +}} +pub type PEVENT_FILTER_EVENT_NAME = *mut EVENT_FILTER_EVENT_NAME; +STRUCT!{struct EVENT_FILTER_LEVEL_KW { + MatchAnyKeyword: ULONGLONG, + MatchAllKeyword: ULONGLONG, + Level: UCHAR, + FilterIn: BOOLEAN, +}} +ENUM!{enum EVENT_INFO_CLASS { + EventProviderBinaryTrackInfo, + EventProviderSetReserved1, + EventProviderSetTraits, + EventProviderUseDescriptorType, + MaxEventInfo, +}} +FN!{stdcall PENABLECALLBACK( + SourceId: LPCGUID, + IsEnabled: ULONG, + Level: UCHAR, + MatchAnyKeyword: ULONGLONG, + MatchAllKeyword: ULONGLONG, + FilterData: PEVENT_FILTER_DESCRIPTOR, + CallbackContext: PVOID, +) -> ()} +extern "system" { + pub fn EventRegister( + ProviderId: LPCGUID, + EnableCallback: PENABLECALLBACK, + CallbackContext: PVOID, + RegHandle: PREGHANDLE, + ) -> ULONG; + pub fn EventUnregister( + RegHandle: REGHANDLE, + ) -> ULONG; + pub fn EventSetInformation( + RegHandle: REGHANDLE, + InformationClass: EVENT_INFO_CLASS, + EventInformation: PVOID, + InformationLength: ULONG, + ) -> ULONG; + pub fn EventEnabled( + RegHandle: REGHANDLE, + EventDescriptor: PCEVENT_DESCRIPTOR, + ) -> BOOLEAN; + pub fn EventProviderEnabled( + RegHandle: REGHANDLE, + Level: UCHAR, + Keyword: ULONGLONG, + ) -> BOOLEAN; + pub fn EventWrite( + RegHandle: REGHANDLE, + EventDescriptor: PCEVENT_DESCRIPTOR, + UserDataCount: ULONG, + UserData: PEVENT_DATA_DESCRIPTOR, + ) -> ULONG; + pub fn EventWriteTransfer( + RegHandle: REGHANDLE, + EventDescriptor: PCEVENT_DESCRIPTOR, + ActivityId: LPCGUID, + RelatedActivityId: LPCGUID, + UserDataCount: ULONG, + UserData: PEVENT_DATA_DESCRIPTOR, + ) -> ULONG; + pub fn EventWriteEx( + RegHandle: REGHANDLE, + EventDescriptor: PCEVENT_DESCRIPTOR, + Filter: ULONG64, + Flags: ULONG, + ActivityId: LPCGUID, + RelatedActivityId: LPCGUID, + UserDataCount: ULONG, + UserData: PEVENT_DATA_DESCRIPTOR, + ) -> ULONG; + pub fn EventWriteString( + RegHandle: REGHANDLE, + Level: UCHAR, + Keyword: ULONGLONG, + EventString: PCWSTR, + ) -> ULONG; + pub fn EventActivityIdControl( + ControlCode: ULONG, + ActivityId: LPGUID, + ) -> ULONG; +} +#[inline] +pub unsafe fn EventDataDescCreate( + EventDataDescriptor: PEVENT_DATA_DESCRIPTOR, + DataPtr: *const VOID, + DataSize: ULONG, +) { + (*EventDataDescriptor).Ptr = DataPtr as ULONGLONG; + (*EventDataDescriptor).Size = DataSize; + *(*EventDataDescriptor).u.Reserved_mut() = 0; +} +#[inline] +pub unsafe fn EventDescCreate( + EventDescriptor: PEVENT_DESCRIPTOR, + Id: USHORT, + Version: UCHAR, + Channel: UCHAR, + Level: UCHAR, + Task: USHORT, + Opcode: UCHAR, + Keyword: ULONGLONG, +) { + (*EventDescriptor).Id = Id; + (*EventDescriptor).Version = Version; + (*EventDescriptor).Channel = Channel; + (*EventDescriptor).Level = Level; + (*EventDescriptor).Task = Task; + (*EventDescriptor).Opcode = Opcode; + (*EventDescriptor).Keyword = Keyword; +} +#[inline] +pub unsafe fn EventDescZero(EventDescriptor: PEVENT_DESCRIPTOR) { + use core::ptr::write_bytes; + // FIXME: 16 = sizeof::() + write_bytes(EventDescriptor, 0, 16); +} +#[inline] +pub unsafe fn EventDescGetId(EventDescriptor: PCEVENT_DESCRIPTOR) -> USHORT { + (*EventDescriptor).Id +} +#[inline] +pub unsafe fn EventDescGetVersion(EventDescriptor: PCEVENT_DESCRIPTOR) -> UCHAR { + (*EventDescriptor).Version +} +#[inline] +pub unsafe fn EventDescGetTask(EventDescriptor: PCEVENT_DESCRIPTOR) -> USHORT { + (*EventDescriptor).Task +} +#[inline] +pub unsafe fn EventDescGetOpcode(EventDescriptor: PCEVENT_DESCRIPTOR) -> UCHAR { + (*EventDescriptor).Opcode +} +#[inline] +pub unsafe fn EventDescGetChannel(EventDescriptor: PCEVENT_DESCRIPTOR) -> UCHAR { + (*EventDescriptor).Channel +} +#[inline] +pub unsafe fn EventDescGetLevel(EventDescriptor: PCEVENT_DESCRIPTOR) -> UCHAR { + (*EventDescriptor).Level +} +#[inline] +pub unsafe fn EventDescGetKeyword(EventDescriptor: PCEVENT_DESCRIPTOR) -> ULONGLONG { + (*EventDescriptor).Keyword +} +#[inline] +pub unsafe fn EventDescSetId(EventDescriptor: PEVENT_DESCRIPTOR, Id: USHORT) -> PEVENT_DESCRIPTOR { + (*EventDescriptor).Id = Id; + EventDescriptor +} +#[inline] +pub unsafe fn EventDescSetVersion( + EventDescriptor: PEVENT_DESCRIPTOR, + Version: UCHAR, +) -> PEVENT_DESCRIPTOR { + (*EventDescriptor).Version = Version; + EventDescriptor +} +#[inline] +pub unsafe fn EventDescSetTask( + EventDescriptor: PEVENT_DESCRIPTOR, + Task: USHORT, +) -> PEVENT_DESCRIPTOR { + (*EventDescriptor).Task = Task; + EventDescriptor +} +#[inline] +pub unsafe fn EventDescSetOpcode( + EventDescriptor: PEVENT_DESCRIPTOR, + Opcode: UCHAR, +) -> PEVENT_DESCRIPTOR { + (*EventDescriptor).Opcode = Opcode; + EventDescriptor +} +#[inline] +pub unsafe fn EventDescSetLevel( + EventDescriptor: PEVENT_DESCRIPTOR, + Level: UCHAR, +) -> PEVENT_DESCRIPTOR { + (*EventDescriptor).Level = Level; + EventDescriptor +} +#[inline] +pub unsafe fn EventDescSetChannel( + EventDescriptor: PEVENT_DESCRIPTOR, + Channel: UCHAR, +) -> PEVENT_DESCRIPTOR { + (*EventDescriptor).Channel = Channel; + EventDescriptor +} +#[inline] +pub unsafe fn EventDescSetKeyword( + EventDescriptor: PEVENT_DESCRIPTOR, + Keyword: ULONGLONG, +) -> PEVENT_DESCRIPTOR { + (*EventDescriptor).Keyword = Keyword; + EventDescriptor +} +#[inline] +pub unsafe fn EventDescOrKeyword( + EventDescriptor: PEVENT_DESCRIPTOR, + Keyword: ULONGLONG, +) -> PEVENT_DESCRIPTOR { + (*EventDescriptor).Keyword |= Keyword; + EventDescriptor +} diff --git a/bash-5.1/vendor/winapi/src/shared/evntrace.rs b/bash-5.1/vendor/winapi/src/shared/evntrace.rs new file mode 100644 index 0000000000000000000000000000000000000000..23a93eec31ccc19c504647c1ecbf9dbe3ca7eee7 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/evntrace.rs @@ -0,0 +1,990 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{SIZE_T, ULONG32, ULONG64}; +use shared::evntprov::PEVENT_FILTER_DESCRIPTOR; +use shared::guiddef::{GUID, LPCGUID, LPGUID}; +use shared::minwindef::{DWORD, LPFILETIME, PULONG, UCHAR, UINT, ULONG, USHORT}; +use shared::wmistr::{WMIDPREQUESTCODE, WNODE_HEADER}; +use um::evntcons::PEVENT_RECORD; +use um::handleapi::INVALID_HANDLE_VALUE; +use um::timezoneapi::TIME_ZONE_INFORMATION; +use um::winnt::{ + ANYSIZE_ARRAY, BOOLEAN, HANDLE, LARGE_INTEGER, LONG, LONGLONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, + PVOID, ULONGLONG, WCHAR +}; +use vc::vadefs::va_list; +DEFINE_GUID!{EventTraceGuid, + 0x68fdd900, 0x4a3e, 0x11d1, 0x84, 0xf4, 0x00, 0x00, 0xf8, 0x04, 0x64, 0xe3} +DEFINE_GUID!{SystemTraceControlGuid, + 0x9e814aad, 0x3204, 0x11d2, 0x9a, 0x82, 0x00, 0x60, 0x08, 0xa8, 0x69, 0x39} +DEFINE_GUID!{EventTraceConfigGuid, + 0x01853a65, 0x418f, 0x4f36, 0xae, 0xfc, 0xdc, 0x0f, 0x1d, 0x2f, 0xd2, 0x35} +DEFINE_GUID!{DefaultTraceSecurityGuid, + 0x0811c1af, 0x7a07, 0x4a06, 0x82, 0xed, 0x86, 0x94, 0x55, 0xcd, 0xf7, 0x13} +DEFINE_GUID!{PrivateLoggerNotificationGuid, + 0x3595ab5c, 0x042a, 0x4c8e, 0xb9, 0x42, 0x2d, 0x05, 0x9b, 0xfe, 0xb1, 0xb1} +pub const KERNEL_LOGGER_NAME: &'static str = "NT Kernel Logger"; +pub const GLOBAL_LOGGER_NAME: &'static str = "GlobalLogger"; +pub const EVENT_LOGGER_NAME: &'static str = "EventLog"; +pub const DIAG_LOGGER_NAME: &'static str = "DiagLog"; +pub const MAX_MOF_FIELDS: SIZE_T = 16; +DECLARE_HANDLE!{TRACEHANDLE, __TRACEHANDLE} +pub type PTRACEHANDLE = *mut TRACEHANDLE; +pub const EVENT_TRACE_TYPE_INFO: DWORD = 0x00; +pub const EVENT_TRACE_TYPE_START: DWORD = 0x01; +pub const EVENT_TRACE_TYPE_END: DWORD = 0x02; +pub const EVENT_TRACE_TYPE_STOP: DWORD = 0x02; +pub const EVENT_TRACE_TYPE_DC_START: DWORD = 0x03; +pub const EVENT_TRACE_TYPE_DC_END: DWORD = 0x04; +pub const EVENT_TRACE_TYPE_EXTENSION: DWORD = 0x05; +pub const EVENT_TRACE_TYPE_REPLY: DWORD = 0x06; +pub const EVENT_TRACE_TYPE_DEQUEUE: DWORD = 0x07; +pub const EVENT_TRACE_TYPE_RESUME: DWORD = 0x07; +pub const EVENT_TRACE_TYPE_CHECKPOINT: DWORD = 0x08; +pub const EVENT_TRACE_TYPE_SUSPEND: DWORD = 0x08; +pub const EVENT_TRACE_TYPE_WINEVT_SEND: DWORD = 0x09; +pub const EVENT_TRACE_TYPE_WINEVT_RECEIVE: DWORD = 0xF0; +pub const TRACE_LEVEL_CRITICAL: UCHAR = 1; +pub const TRACE_LEVEL_ERROR: UCHAR = 2; +pub const TRACE_LEVEL_WARNING: UCHAR = 3; +pub const TRACE_LEVEL_INFORMATION: UCHAR = 4; +pub const TRACE_LEVEL_VERBOSE: UCHAR = 5; +pub const TRACE_LEVEL_RESERVED6: UCHAR = 6; +pub const TRACE_LEVEL_RESERVED7: UCHAR = 7; +pub const TRACE_LEVEL_RESERVED8: UCHAR = 8; +pub const TRACE_LEVEL_RESERVED9: UCHAR = 9; +pub const EVENT_TRACE_TYPE_LOAD: DWORD = 0x0A; +pub const EVENT_TRACE_TYPE_TERMINATE: DWORD = 0x0B; +pub const EVENT_TRACE_TYPE_IO_READ: DWORD = 0x0A; +pub const EVENT_TRACE_TYPE_IO_WRITE: DWORD = 0x0B; +pub const EVENT_TRACE_TYPE_IO_READ_INIT: DWORD = 0x0C; +pub const EVENT_TRACE_TYPE_IO_WRITE_INIT: DWORD = 0x0D; +pub const EVENT_TRACE_TYPE_IO_FLUSH: DWORD = 0x0E; +pub const EVENT_TRACE_TYPE_IO_FLUSH_INIT: DWORD = 0x0F; +pub const EVENT_TRACE_TYPE_IO_REDIRECTED_INIT: DWORD = 0x10; +pub const EVENT_TRACE_TYPE_MM_TF: DWORD = 0x0A; +pub const EVENT_TRACE_TYPE_MM_DZF: DWORD = 0x0B; +pub const EVENT_TRACE_TYPE_MM_COW: DWORD = 0x0C; +pub const EVENT_TRACE_TYPE_MM_GPF: DWORD = 0x0D; +pub const EVENT_TRACE_TYPE_MM_HPF: DWORD = 0x0E; +pub const EVENT_TRACE_TYPE_MM_AV: DWORD = 0x0F; +pub const EVENT_TRACE_TYPE_SEND: DWORD = 0x0A; +pub const EVENT_TRACE_TYPE_RECEIVE: DWORD = 0x0B; +pub const EVENT_TRACE_TYPE_CONNECT: DWORD = 0x0C; +pub const EVENT_TRACE_TYPE_DISCONNECT: DWORD = 0x0D; +pub const EVENT_TRACE_TYPE_RETRANSMIT: DWORD = 0x0E; +pub const EVENT_TRACE_TYPE_ACCEPT: DWORD = 0x0F; +pub const EVENT_TRACE_TYPE_RECONNECT: DWORD = 0x10; +pub const EVENT_TRACE_TYPE_CONNFAIL: DWORD = 0x11; +pub const EVENT_TRACE_TYPE_COPY_TCP: DWORD = 0x12; +pub const EVENT_TRACE_TYPE_COPY_ARP: DWORD = 0x13; +pub const EVENT_TRACE_TYPE_ACKFULL: DWORD = 0x14; +pub const EVENT_TRACE_TYPE_ACKPART: DWORD = 0x15; +pub const EVENT_TRACE_TYPE_ACKDUP: DWORD = 0x16; +pub const EVENT_TRACE_TYPE_GUIDMAP: DWORD = 0x0A; +pub const EVENT_TRACE_TYPE_CONFIG: DWORD = 0x0B; +pub const EVENT_TRACE_TYPE_SIDINFO: DWORD = 0x0C; +pub const EVENT_TRACE_TYPE_SECURITY: DWORD = 0x0D; +pub const EVENT_TRACE_TYPE_DBGID_RSDS: DWORD = 0x40; +pub const EVENT_TRACE_TYPE_REGCREATE: DWORD = 0x0A; +pub const EVENT_TRACE_TYPE_REGOPEN: DWORD = 0x0B; +pub const EVENT_TRACE_TYPE_REGDELETE: DWORD = 0x0C; +pub const EVENT_TRACE_TYPE_REGQUERY: DWORD = 0x0D; +pub const EVENT_TRACE_TYPE_REGSETVALUE: DWORD = 0x0E; +pub const EVENT_TRACE_TYPE_REGDELETEVALUE: DWORD = 0x0F; +pub const EVENT_TRACE_TYPE_REGQUERYVALUE: DWORD = 0x10; +pub const EVENT_TRACE_TYPE_REGENUMERATEKEY: DWORD = 0x11; +pub const EVENT_TRACE_TYPE_REGENUMERATEVALUEKEY: DWORD = 0x12; +pub const EVENT_TRACE_TYPE_REGQUERYMULTIPLEVALUE: DWORD = 0x13; +pub const EVENT_TRACE_TYPE_REGSETINFORMATION: DWORD = 0x14; +pub const EVENT_TRACE_TYPE_REGFLUSH: DWORD = 0x15; +pub const EVENT_TRACE_TYPE_REGKCBCREATE: DWORD = 0x16; +pub const EVENT_TRACE_TYPE_REGKCBDELETE: DWORD = 0x17; +pub const EVENT_TRACE_TYPE_REGKCBRUNDOWNBEGIN: DWORD = 0x18; +pub const EVENT_TRACE_TYPE_REGKCBRUNDOWNEND: DWORD = 0x19; +pub const EVENT_TRACE_TYPE_REGVIRTUALIZE: DWORD = 0x1A; +pub const EVENT_TRACE_TYPE_REGCLOSE: DWORD = 0x1B; +pub const EVENT_TRACE_TYPE_REGSETSECURITY: DWORD = 0x1C; +pub const EVENT_TRACE_TYPE_REGQUERYSECURITY: DWORD = 0x1D; +pub const EVENT_TRACE_TYPE_REGCOMMIT: DWORD = 0x1E; +pub const EVENT_TRACE_TYPE_REGPREPARE: DWORD = 0x1F; +pub const EVENT_TRACE_TYPE_REGROLLBACK: DWORD = 0x20; +pub const EVENT_TRACE_TYPE_REGMOUNTHIVE: DWORD = 0x21; +pub const EVENT_TRACE_TYPE_CONFIG_CPU: DWORD = 0x0A; +pub const EVENT_TRACE_TYPE_CONFIG_PHYSICALDISK: DWORD = 0x0B; +pub const EVENT_TRACE_TYPE_CONFIG_LOGICALDISK: DWORD = 0x0C; +pub const EVENT_TRACE_TYPE_CONFIG_NIC: DWORD = 0x0D; +pub const EVENT_TRACE_TYPE_CONFIG_VIDEO: DWORD = 0x0E; +pub const EVENT_TRACE_TYPE_CONFIG_SERVICES: DWORD = 0x0F; +pub const EVENT_TRACE_TYPE_CONFIG_POWER: DWORD = 0x10; +pub const EVENT_TRACE_TYPE_CONFIG_NETINFO: DWORD = 0x11; +pub const EVENT_TRACE_TYPE_CONFIG_OPTICALMEDIA: DWORD = 0x12; +pub const EVENT_TRACE_TYPE_CONFIG_IRQ: DWORD = 0x15; +pub const EVENT_TRACE_TYPE_CONFIG_PNP: DWORD = 0x16; +pub const EVENT_TRACE_TYPE_CONFIG_IDECHANNEL: DWORD = 0x17; +pub const EVENT_TRACE_TYPE_CONFIG_NUMANODE: DWORD = 0x18; +pub const EVENT_TRACE_TYPE_CONFIG_PLATFORM: DWORD = 0x19; +pub const EVENT_TRACE_TYPE_CONFIG_PROCESSORGROUP: DWORD = 0x1A; +pub const EVENT_TRACE_TYPE_CONFIG_PROCESSORNUMBER: DWORD = 0x1B; +pub const EVENT_TRACE_TYPE_CONFIG_DPI: DWORD = 0x1C; +pub const EVENT_TRACE_TYPE_CONFIG_CI_INFO: DWORD = 0x1D; +pub const EVENT_TRACE_TYPE_CONFIG_MACHINEID: DWORD = 0x1E; +pub const EVENT_TRACE_TYPE_CONFIG_DEFRAG: DWORD = 0x1F; +pub const EVENT_TRACE_TYPE_CONFIG_MOBILEPLATFORM: DWORD = 0x20; +pub const EVENT_TRACE_TYPE_CONFIG_DEVICEFAMILY: DWORD = 0x21; +pub const EVENT_TRACE_TYPE_CONFIG_FLIGHTID: DWORD = 0x22; +pub const EVENT_TRACE_TYPE_CONFIG_PROCESSOR: DWORD = 0x23; +pub const EVENT_TRACE_TYPE_OPTICAL_IO_READ: DWORD = 0x37; +pub const EVENT_TRACE_TYPE_OPTICAL_IO_WRITE: DWORD = 0x38; +pub const EVENT_TRACE_TYPE_OPTICAL_IO_FLUSH: DWORD = 0x39; +pub const EVENT_TRACE_TYPE_OPTICAL_IO_READ_INIT: DWORD = 0x3a; +pub const EVENT_TRACE_TYPE_OPTICAL_IO_WRITE_INIT: DWORD = 0x3b; +pub const EVENT_TRACE_TYPE_OPTICAL_IO_FLUSH_INIT: DWORD = 0x3c; +pub const EVENT_TRACE_TYPE_FLT_PREOP_INIT: DWORD = 0x60; +pub const EVENT_TRACE_TYPE_FLT_POSTOP_INIT: DWORD = 0x61; +pub const EVENT_TRACE_TYPE_FLT_PREOP_COMPLETION: DWORD = 0x62; +pub const EVENT_TRACE_TYPE_FLT_POSTOP_COMPLETION: DWORD = 0x63; +pub const EVENT_TRACE_TYPE_FLT_PREOP_FAILURE: DWORD = 0x64; +pub const EVENT_TRACE_TYPE_FLT_POSTOP_FAILURE: DWORD = 0x65; +pub const EVENT_TRACE_FLAG_PROCESS: DWORD = 0x00000001; +pub const EVENT_TRACE_FLAG_THREAD: DWORD = 0x00000002; +pub const EVENT_TRACE_FLAG_IMAGE_LOAD: DWORD = 0x00000004; +pub const EVENT_TRACE_FLAG_DISK_IO: DWORD = 0x00000100; +pub const EVENT_TRACE_FLAG_DISK_FILE_IO: DWORD = 0x00000200; +pub const EVENT_TRACE_FLAG_MEMORY_PAGE_FAULTS: DWORD = 0x00001000; +pub const EVENT_TRACE_FLAG_MEMORY_HARD_FAULTS: DWORD = 0x00002000; +pub const EVENT_TRACE_FLAG_NETWORK_TCPIP: DWORD = 0x00010000; +pub const EVENT_TRACE_FLAG_REGISTRY: DWORD = 0x00020000; +pub const EVENT_TRACE_FLAG_DBGPRINT: DWORD = 0x00040000; +pub const EVENT_TRACE_FLAG_PROCESS_COUNTERS: DWORD = 0x00000008; +pub const EVENT_TRACE_FLAG_CSWITCH: DWORD = 0x00000010; +pub const EVENT_TRACE_FLAG_DPC: DWORD = 0x00000020; +pub const EVENT_TRACE_FLAG_INTERRUPT: DWORD = 0x00000040; +pub const EVENT_TRACE_FLAG_SYSTEMCALL: DWORD = 0x00000080; +pub const EVENT_TRACE_FLAG_DISK_IO_INIT: DWORD = 0x00000400; +pub const EVENT_TRACE_FLAG_ALPC: DWORD = 0x00100000; +pub const EVENT_TRACE_FLAG_SPLIT_IO: DWORD = 0x00200000; +pub const EVENT_TRACE_FLAG_DRIVER: DWORD = 0x00800000; +pub const EVENT_TRACE_FLAG_PROFILE: DWORD = 0x01000000; +pub const EVENT_TRACE_FLAG_FILE_IO: DWORD = 0x02000000; +pub const EVENT_TRACE_FLAG_FILE_IO_INIT: DWORD = 0x04000000; +pub const EVENT_TRACE_FLAG_DISPATCHER: DWORD = 0x00000800; +pub const EVENT_TRACE_FLAG_VIRTUAL_ALLOC: DWORD = 0x00004000; +pub const EVENT_TRACE_FLAG_VAMAP: DWORD = 0x00008000; +pub const EVENT_TRACE_FLAG_NO_SYSCONFIG: DWORD = 0x10000000; +pub const EVENT_TRACE_FLAG_JOB: DWORD = 0x00080000; +pub const EVENT_TRACE_FLAG_DEBUG_EVENTS: DWORD = 0x00400000; +pub const EVENT_TRACE_FLAG_EXTENSION: DWORD = 0x80000000; +pub const EVENT_TRACE_FLAG_FORWARD_WMI: DWORD = 0x40000000; +pub const EVENT_TRACE_FLAG_ENABLE_RESERVE: DWORD = 0x20000000; +pub const EVENT_TRACE_FILE_MODE_NONE: DWORD = 0x00000000; +pub const EVENT_TRACE_FILE_MODE_SEQUENTIAL: DWORD = 0x00000001; +pub const EVENT_TRACE_FILE_MODE_CIRCULAR: DWORD = 0x00000002; +pub const EVENT_TRACE_FILE_MODE_APPEND: DWORD = 0x00000004; +pub const EVENT_TRACE_REAL_TIME_MODE: DWORD = 0x00000100; +pub const EVENT_TRACE_DELAY_OPEN_FILE_MODE: DWORD = 0x00000200; +pub const EVENT_TRACE_BUFFERING_MODE: DWORD = 0x00000400; +pub const EVENT_TRACE_PRIVATE_LOGGER_MODE: DWORD = 0x00000800; +pub const EVENT_TRACE_ADD_HEADER_MODE: DWORD = 0x00001000; +pub const EVENT_TRACE_USE_GLOBAL_SEQUENCE: DWORD = 0x00004000; +pub const EVENT_TRACE_USE_LOCAL_SEQUENCE: DWORD = 0x00008000; +pub const EVENT_TRACE_RELOG_MODE: DWORD = 0x00010000; +pub const EVENT_TRACE_USE_PAGED_MEMORY: DWORD = 0x01000000; +pub const EVENT_TRACE_FILE_MODE_NEWFILE: DWORD = 0x00000008; +pub const EVENT_TRACE_FILE_MODE_PREALLOCATE: DWORD = 0x00000020; +pub const EVENT_TRACE_NONSTOPPABLE_MODE: DWORD = 0x00000040; +pub const EVENT_TRACE_SECURE_MODE: DWORD = 0x00000080; +pub const EVENT_TRACE_USE_KBYTES_FOR_SIZE: DWORD = 0x00002000; +pub const EVENT_TRACE_PRIVATE_IN_PROC: DWORD = 0x00020000; +pub const EVENT_TRACE_MODE_RESERVED: DWORD = 0x00100000; +pub const EVENT_TRACE_NO_PER_PROCESSOR_BUFFERING: DWORD = 0x10000000; +pub const EVENT_TRACE_SYSTEM_LOGGER_MODE: DWORD = 0x02000000; +pub const EVENT_TRACE_ADDTO_TRIAGE_DUMP: DWORD = 0x80000000; +pub const EVENT_TRACE_STOP_ON_HYBRID_SHUTDOWN: DWORD = 0x00400000; +pub const EVENT_TRACE_PERSIST_ON_HYBRID_SHUTDOWN: DWORD = 0x00800000; +pub const EVENT_TRACE_INDEPENDENT_SESSION_MODE: DWORD = 0x08000000; +pub const EVENT_TRACE_COMPRESSED_MODE: DWORD = 0x04000000; +pub const EVENT_TRACE_CONTROL_QUERY: DWORD = 0; +pub const EVENT_TRACE_CONTROL_STOP: DWORD = 1; +pub const EVENT_TRACE_CONTROL_UPDATE: DWORD = 2; +pub const EVENT_TRACE_CONTROL_FLUSH: DWORD = 3; +pub const TRACE_MESSAGE_SEQUENCE: DWORD = 1; +pub const TRACE_MESSAGE_GUID: DWORD = 2; +pub const TRACE_MESSAGE_COMPONENTID: DWORD = 4; +pub const TRACE_MESSAGE_TIMESTAMP: DWORD = 8; +pub const TRACE_MESSAGE_PERFORMANCE_TIMESTAMP: DWORD = 16; +pub const TRACE_MESSAGE_SYSTEMINFO: DWORD = 32; +pub const TRACE_MESSAGE_POINTER32: DWORD = 0x0040; +pub const TRACE_MESSAGE_POINTER64: DWORD = 0x0080; +pub const TRACE_MESSAGE_FLAG_MASK: DWORD = 0xFFFF; +pub const TRACE_MESSAGE_MAXIMUM_SIZE: SIZE_T = 64 * 1024; +pub const EVENT_TRACE_USE_PROCTIME: DWORD = 0x0001; +pub const EVENT_TRACE_USE_NOCPUTIME: DWORD = 0x0002; +pub const TRACE_HEADER_FLAG_USE_TIMESTAMP: DWORD = 0x00000200; +pub const TRACE_HEADER_FLAG_TRACED_GUID: DWORD = 0x00020000; +pub const TRACE_HEADER_FLAG_LOG_WNODE: DWORD = 0x00040000; +pub const TRACE_HEADER_FLAG_USE_GUID_PTR: DWORD = 0x00080000; +pub const TRACE_HEADER_FLAG_USE_MOF_PTR: DWORD = 0x00100000; +ENUM!{enum ETW_COMPRESSION_RESUMPTION_MODE { + EtwCompressionModeRestart = 0, + EtwCompressionModeNoDisable = 1, + EtwCompressionModeNoRestart = 2, +}} +STRUCT!{struct EVENT_TRACE_HEADER_u1_s { + HeaderType: UCHAR, + MarkerFlags: UCHAR, +}} +UNION!{union EVENT_TRACE_HEADER_u1 { + [u16; 1], + FieldTypeFlags FieldTypeFlags_mut: USHORT, + s s_mut: EVENT_TRACE_HEADER_u1_s, +}} +STRUCT!{struct EVENT_TRACE_HEADER_u2_CLASS { + Type: UCHAR, + Level: UCHAR, + Version: USHORT, +}} +UNION!{union EVENT_TRACE_HEADER_u2 { + [u32; 1], + Version Version_mut: ULONG, + Class Class_mut: EVENT_TRACE_HEADER_u2_CLASS, +}} +UNION!{union EVENT_TRACE_HEADER_u3 { + [u64; 2], + Guid Guid_mut: GUID, + GuidPtr GuidPtr_mut: ULONGLONG, +}} +STRUCT!{struct EVENT_TRACE_HEADER_u4_s1 { + ClientContext: ULONG, + Flags: ULONG, +}} +STRUCT!{struct EVENT_TRACE_HEADER_u4_s2 { + KernelTime: ULONG, + UserTime: ULONG, +}} +UNION!{union EVENT_TRACE_HEADER_u4 { + [u64; 1], + s1 s1_mut: EVENT_TRACE_HEADER_u4_s1, + s2 s2_mut: EVENT_TRACE_HEADER_u4_s2, + ProcessorTime ProcessorTime_mut: ULONG64, +}} +STRUCT!{struct EVENT_TRACE_HEADER { + Size: USHORT, + u1: EVENT_TRACE_HEADER_u1, + u2: EVENT_TRACE_HEADER_u2, + ThreadId: ULONG, + ProcessId: ULONG, + TimeStamp: LARGE_INTEGER, + u3: EVENT_TRACE_HEADER_u3, + u4: EVENT_TRACE_HEADER_u4, +}} +pub type PEVENT_TRACE_HEADER = *mut EVENT_TRACE_HEADER; +STRUCT!{struct EVENT_INSTANCE_HEADER_u1_s { + HeaderType: UCHAR, + MarkerFlags: UCHAR, +}} +UNION!{union EVENT_INSTANCE_HEADER_u1 { + [u16; 1], + FieldTypeFlags FieldTypeFlags_mut: USHORT, + s s_mut: EVENT_INSTANCE_HEADER_u1_s, +}} +STRUCT!{struct EVENT_INSTANCE_HEADER_u2_CLASS { + Type: UCHAR, + Level: UCHAR, + Version: USHORT, +}} +UNION!{union EVENT_INSTANCE_HEADER_u2 { + [u32; 1], + Version Version_mut: ULONG, + Class Class_mut: EVENT_INSTANCE_HEADER_u2_CLASS, +}} +STRUCT!{struct EVENT_INSTANCE_HEADER_u3_s1 { + KernelTime: ULONG, + UserTime: ULONG, +}} +STRUCT!{struct EVENT_INSTANCE_HEADER_u3_s2 { + EventId: ULONG, + Flags: ULONG, +}} +UNION!{union EVENT_INSTANCE_HEADER_u3 { + [u64; 1], + s1 s1_mut: EVENT_INSTANCE_HEADER_u3_s1, + ProcessorTime ProcessorTime_mut: ULONG64, + s2 s2_mut: EVENT_INSTANCE_HEADER_u3_s2, +}} +STRUCT!{struct EVENT_INSTANCE_HEADER { + Size: USHORT, + u1: EVENT_INSTANCE_HEADER_u1, + u2: EVENT_INSTANCE_HEADER_u2, + ThreadId: ULONG, + ProcessId: ULONG, + TimeStamp: LARGE_INTEGER, + RegHandle: ULONGLONG, + InstanceId: ULONG, + ParentInstanceId: ULONG, + u3: EVENT_INSTANCE_HEADER_u3, + ParentRegHandle: ULONGLONG, +}} +pub type PEVENT_INSTANCE_HEADER = *mut EVENT_INSTANCE_HEADER; +pub const ETW_NULL_TYPE_VALUE: ULONG = 0; +pub const ETW_OBJECT_TYPE_VALUE: ULONG = 1; +pub const ETW_STRING_TYPE_VALUE: ULONG = 2; +pub const ETW_SBYTE_TYPE_VALUE: ULONG = 3; +pub const ETW_BYTE_TYPE_VALUE: ULONG = 4; +pub const ETW_INT16_TYPE_VALUE: ULONG = 5; +pub const ETW_UINT16_TYPE_VALUE: ULONG = 6; +pub const ETW_INT32_TYPE_VALUE: ULONG = 7; +pub const ETW_UINT32_TYPE_VALUE: ULONG = 8; +pub const ETW_INT64_TYPE_VALUE: ULONG = 9; +pub const ETW_UINT64_TYPE_VALUE: ULONG = 10; +pub const ETW_CHAR_TYPE_VALUE: ULONG = 11; +pub const ETW_SINGLE_TYPE_VALUE: ULONG = 12; +pub const ETW_DOUBLE_TYPE_VALUE: ULONG = 13; +pub const ETW_BOOLEAN_TYPE_VALUE: ULONG = 14; +pub const ETW_DECIMAL_TYPE_VALUE: ULONG = 15; +pub const ETW_GUID_TYPE_VALUE: ULONG = 101; +pub const ETW_ASCIICHAR_TYPE_VALUE: ULONG = 102; +pub const ETW_ASCIISTRING_TYPE_VALUE: ULONG = 103; +pub const ETW_COUNTED_STRING_TYPE_VALUE: ULONG = 104; +pub const ETW_POINTER_TYPE_VALUE: ULONG = 105; +pub const ETW_SIZET_TYPE_VALUE: ULONG = 106; +pub const ETW_HIDDEN_TYPE_VALUE: ULONG = 107; +pub const ETW_BOOL_TYPE_VALUE: ULONG = 108; +pub const ETW_COUNTED_ANSISTRING_TYPE_VALUE: ULONG = 109; +pub const ETW_REVERSED_COUNTED_STRING_TYPE_VALUE: ULONG = 110; +pub const ETW_REVERSED_COUNTED_ANSISTRING_TYPE_VALUE: ULONG = 111; +pub const ETW_NON_NULL_TERMINATED_STRING_TYPE_VALUE: ULONG = 112; +pub const ETW_REDUCED_ANSISTRING_TYPE_VALUE: ULONG = 113; +pub const ETW_REDUCED_STRING_TYPE_VALUE: ULONG = 114; +pub const ETW_SID_TYPE_VALUE: ULONG = 115; +pub const ETW_VARIANT_TYPE_VALUE: ULONG = 116; +pub const ETW_PTVECTOR_TYPE_VALUE: ULONG = 117; +pub const ETW_WMITIME_TYPE_VALUE: ULONG = 118; +pub const ETW_DATETIME_TYPE_VALUE: ULONG = 119; +pub const ETW_REFRENCE_TYPE_VALUE: ULONG = 120; +// TODO: DEFINE_TRACE_MOF_FIELD +STRUCT!{struct MOF_FIELD { + DataPtr: ULONG64, + Length: ULONG, + DataType: ULONG, +}} +pub type PMOF_FIELD = *mut MOF_FIELD; +STRUCT!{struct TRACE_LOGFILE_HEADER_u1_VERSIONDETAIL { + MajorVersion: UCHAR, + MinorVersion: UCHAR, + SubVersion: UCHAR, + SubMinorVersion: UCHAR, +}} +UNION!{union TRACE_LOGFILE_HEADER_u1 { + [u32; 1], + Version Version_mut: ULONG, + VersionDetail VersionDetail_mut: TRACE_LOGFILE_HEADER_u1_VERSIONDETAIL, +}} +STRUCT!{struct TRACE_LOGFILE_HEADER_u2_s { + StartBuffers: ULONG, + PointerSize: ULONG, + EventsLost: ULONG, + CpuSpeedInMHz: ULONG, +}} +UNION!{union TRACE_LOGFILE_HEADER_u2 { + [u32; 4], + LogInstanceGuid LogInstanceGuid_mut: GUID, + s s_mut: TRACE_LOGFILE_HEADER_u2_s, +}} +STRUCT!{struct TRACE_LOGFILE_HEADER { + BufferSize: ULONG, + u1: TRACE_LOGFILE_HEADER_u1, + ProviderVersion: ULONG, + NumberOfProcessors: ULONG, + EndTime: LARGE_INTEGER, + TimerResolution: ULONG, + MaximumFileSize: ULONG, + LogFileMode: ULONG, + BuffersWritten: ULONG, + u2: TRACE_LOGFILE_HEADER_u2, + LoggerName: LPWSTR, + LogFileName: LPWSTR, + TimeZone: TIME_ZONE_INFORMATION, + BootTime: LARGE_INTEGER, + PrefFreq: LARGE_INTEGER, + StartTime: LARGE_INTEGER, + ReservedFlags: ULONG, + BuffersLost: ULONG, +}} +pub type PTRACE_LOGFILE_HEADER = *mut TRACE_LOGFILE_HEADER; +STRUCT!{struct TRACE_LOGFILE_HEADER32 { + BufferSize: ULONG, + u1: TRACE_LOGFILE_HEADER_u1, + ProviderVersion: ULONG, + NumberOfProcessors: ULONG, + EndTime: LARGE_INTEGER, + TimerResolution: ULONG, + MaximumFileSize: ULONG, + LogFileMode: ULONG, + BuffersWritten: ULONG, + u2: TRACE_LOGFILE_HEADER_u2, + LoggerName: ULONG32, + LogFileName: ULONG32, + TimeZone: TIME_ZONE_INFORMATION, + BootTime: LARGE_INTEGER, + PrefFreq: LARGE_INTEGER, + StartTime: LARGE_INTEGER, + ReservedFlags: ULONG, + BuffersLost: ULONG, +}} +pub type PTRACE_LOGFILE_HEADER32 = *mut TRACE_LOGFILE_HEADER32; +STRUCT!{struct TRACE_LOGFILE_HEADER64 { + BufferSize: ULONG, + u1: TRACE_LOGFILE_HEADER_u1, + ProviderVersion: ULONG, + NumberOfProcessors: ULONG, + EndTime: LARGE_INTEGER, + TimerResolution: ULONG, + MaximumFileSize: ULONG, + LogFileMode: ULONG, + BuffersWritten: ULONG, + u2: TRACE_LOGFILE_HEADER_u2, + LoggerName: ULONG64, + LogFileName: ULONG64, + TimeZone: TIME_ZONE_INFORMATION, + BootTime: LARGE_INTEGER, + PrefFreq: LARGE_INTEGER, + StartTime: LARGE_INTEGER, + ReservedFlags: ULONG, + BuffersLost: ULONG, +}} +pub type PTRACE_LOGFILE_HEADER64 = *mut TRACE_LOGFILE_HEADER64; +STRUCT!{struct EVENT_INSTANCE_INFO { + RegHandle: HANDLE, + InstanceId: ULONG, +}} +pub type PEVENT_INSTANCE_INFO = *mut EVENT_INSTANCE_INFO; +UNION!{union EVENT_TRACE_PROPERTIES_u { + [u32; 1], + AgeLimit AgeLimit_mut: LONG, + FlushThreshold FlushThreshold_mut: LONG, +}} +STRUCT!{struct EVENT_TRACE_PROPERTIES { + Wnode: WNODE_HEADER, + BufferSize: ULONG, + MinimumBuffers: ULONG, + MaximumBuffers: ULONG, + MaximumFileSize: ULONG, + LogFileMode: ULONG, + FlushTimer: ULONG, + EnableFlags: ULONG, + u: EVENT_TRACE_PROPERTIES_u, + NumberOfBuffers: ULONG, + FreeBuffers: ULONG, + EventsLost: ULONG, + BuffersWritten: ULONG, + LogBuffersLost: ULONG, + RealTimeBuffersLost: ULONG, + LoggerThreadId: HANDLE, + LogFileNameOffset: ULONG, + LoggerNameOffset: ULONG, +}} +pub type PEVENT_TRACE_PROPERTIES = *mut EVENT_TRACE_PROPERTIES; +UNION!{union EVENT_TRACE_PROPERTIES_V2_u1 { + [u32; 1], + AgeLimit AgeLimit_mut: LONG, + FlushThreshold FlushThreshold_mut: LONG, +}} +STRUCT!{struct EVENT_TRACE_PROPERTIES_V2_u2_s { + bitfield: ULONG, +}} +BITFIELD!{EVENT_TRACE_PROPERTIES_V2_u2_s bitfield: ULONG [ + VersionNumber set_VersionNumber[0..8], +]} +UNION!{union EVENT_TRACE_PROPERTIES_V2_u2 { + [u32; 1], + s s_mut: EVENT_TRACE_PROPERTIES_V2_u2_s, + V2Control V2Control_mut: ULONG, +}} +STRUCT!{struct EVENT_TRACE_PROPERTIES_V2_u3_s { + bitfield: ULONG, +}} +BITFIELD!{EVENT_TRACE_PROPERTIES_V2_u3_s bitfield: ULONG [ + Wow set_Wow[0..1], +]} +UNION!{union EVENT_TRACE_PROPERTIES_V2_u3 { + [u64; 1], + s s_mut: EVENT_TRACE_PROPERTIES_V2_u3_s, + V2Options V2Options_mut: ULONG64, +}} +STRUCT!{struct EVENT_TRACE_PROPERTIES_V2 { + Wnode: WNODE_HEADER, + BufferSize: ULONG, + MinimumBuffers: ULONG, + MaximumBuffers: ULONG, + MaximumFileSize: ULONG, + LogFileMode: ULONG, + FlushTimer: ULONG, + EnableFlags: ULONG, + u1: EVENT_TRACE_PROPERTIES_u, + NumberOfBuffers: ULONG, + FreeBuffers: ULONG, + EventsLost: ULONG, + BuffersWritten: ULONG, + LogBuffersLost: ULONG, + RealTimeBuffersLost: ULONG, + LoggerThreadId: HANDLE, + LogFileNameOffset: ULONG, + LoggerNameOffset: ULONG, + u2: EVENT_TRACE_PROPERTIES_V2_u2, + FilterDescCount: ULONG, + FilterDesc: PEVENT_FILTER_DESCRIPTOR, + u3: EVENT_TRACE_PROPERTIES_V2_u3, +}} +pub type PEVENT_TRACE_PROPERTIES_V2 = *mut EVENT_TRACE_PROPERTIES_V2; +STRUCT!{struct TRACE_GUID_REGISTRATION { + Guid: LPCGUID, + RegHandle: HANDLE, +}} +pub type PTRACE_GUID_REGISTRATION = *mut TRACE_GUID_REGISTRATION; +STRUCT!{struct TRACE_GUID_PROPERTIES { + Guid: GUID, + GuidType: ULONG, + LoggerId: ULONG, + EnableLevel: ULONG, + EnableFlags: ULONG, + IsEnable: BOOLEAN, +}} +pub type PTRACE_GUID_PROPERTIES = *mut TRACE_GUID_PROPERTIES; +STRUCT!{struct ETW_BUFFER_CONTEXT_u_s { + ProcessorNumber: UCHAR, + Alignment: UCHAR, +}} +UNION!{union ETW_BUFFER_CONTEXT_u { + [u16; 1], + s s_mut: ETW_BUFFER_CONTEXT_u_s, + ProcessorIndex ProcessorIndex_mut: USHORT, +}} +STRUCT!{struct ETW_BUFFER_CONTEXT { + u: ETW_BUFFER_CONTEXT_u, + LoggerId: USHORT, +}} +pub type PETW_BUFFER_CONTEXT = *mut ETW_BUFFER_CONTEXT; +pub const TRACE_PROVIDER_FLAG_LEGACY: ULONG = 0x00000001; +pub const TRACE_PROVIDER_FLAG_PRE_ENABLE: ULONG = 0x00000002; +STRUCT!{struct TRACE_ENABLE_INFO { + IsEnabled: ULONG, + Level: UCHAR, + Reserved1: UCHAR, + LoggerId: USHORT, + EnabledProperty: ULONG, + Reserved2: ULONG, + MatchAnyKeyword: ULONGLONG, + MatchAllKeyword: ULONGLONG, +}} +pub type PTRACE_ENABLE_INFO = *mut TRACE_ENABLE_INFO; +STRUCT!{struct TRACE_PROVIDER_INSTANCE_INFO { + NameOffset: ULONG, + EnableCount: ULONG, + Pid: ULONG, + Flags: ULONG, +}} +pub type PTRACE_PROVIDER_INSTANCE_INFO = *mut TRACE_PROVIDER_INSTANCE_INFO; +STRUCT!{struct TRACE_GUID_INFO { + InstanceCount: ULONG, + Reserved: ULONG, +}} +pub type PTRACE_GUID_INFO = *mut TRACE_GUID_INFO; +STRUCT!{struct PROFILE_SOURCE_INFO { + NextEntryOffset: ULONG, + Source: ULONG, + MinInterval: ULONG, + MaxInterval: ULONG, + Reserved: ULONG64, + Description: [WCHAR; ANYSIZE_ARRAY], +}} +pub type PPROFILE_SOURCE_INFO = *mut PROFILE_SOURCE_INFO; +UNION!{union EVENT_TRACE_u { + [u32; 1], + ClientContext ClientContext_mut: ULONG, + BufferContext BufferContext_mut: ETW_BUFFER_CONTEXT, +}} +STRUCT!{struct EVENT_TRACE { + Header: EVENT_TRACE_HEADER, + InstanceId: ULONG, + ParentInstanceId: ULONG, + ParentGuid: GUID, + MofData: PVOID, + MofLength: ULONG, + u: EVENT_TRACE_u, +}} +pub type PEVENT_TRACE = *mut EVENT_TRACE; +pub const EVENT_CONTROL_CODE_DISABLE_PROVIDER: ULONG = 0; +pub const EVENT_CONTROL_CODE_ENABLE_PROVIDER: ULONG = 1; +pub const EVENT_CONTROL_CODE_CAPTURE_STATE: ULONG = 2; +FN!{stdcall PEVENT_TRACE_BUFFER_CALLBACKW( + PEVENT_TRACE_LOGFILEW, +) -> ULONG} +FN!{stdcall PEVENT_TRACE_BUFFER_CALLBACKA( + PEVENT_TRACE_LOGFILEA, +) -> ULONG} +FN!{stdcall PEVENT_CALLBACK( + pEvent: PEVENT_TRACE, +) -> ()} +FN!{stdcall PEVENT_RECORD_CALLBACK( + EventRecord: PEVENT_RECORD, +) -> ()} +FN!{stdcall WMIDPREQUEST( + RequestCode: WMIDPREQUESTCODE, + RequestContext: PVOID, + BufferSize: *mut ULONG, + Buffer: PVOID, +) -> ULONG} +UNION!{union EVENT_TRACE_LOGFILE_u1 { + [u32; 1], + LogFileMode LogFileMode_mut: ULONG, + ProcessTraceMode ProcessTraceMode_mut: ULONG, +}} +UNION!{union EVENT_TRACE_LOGFILE_u2 { + [u32; 1] [u64; 1], + EventCallback EventCallback_mut: PEVENT_CALLBACK, + EventRecordCallback EventRecordCallback_mut: PEVENT_RECORD_CALLBACK, +}} +STRUCT!{struct EVENT_TRACE_LOGFILEW { + LogFileName: LPWSTR, + LoggerName: LPWSTR, + CurrentTime: LONGLONG, + BuffersRead: ULONG, + u1: EVENT_TRACE_LOGFILE_u1, + CurrentEvent: EVENT_TRACE, + LogfileHeader: TRACE_LOGFILE_HEADER, + BufferCallback: PEVENT_TRACE_BUFFER_CALLBACKW, + BufferSize: ULONG, + Filled: ULONG, + EventsLost: ULONG, + u2: EVENT_TRACE_LOGFILE_u2, + IsKernelTrace: ULONG, + Context: PVOID, +}} +pub type PEVENT_TRACE_LOGFILEW = *mut EVENT_TRACE_LOGFILEW; +STRUCT!{struct EVENT_TRACE_LOGFILEA { + LogFileName: LPSTR, + LoggerName: LPSTR, + CurrentTime: LONGLONG, + BuffersRead: ULONG, + u1: EVENT_TRACE_LOGFILE_u1, + CurrentEvent: EVENT_TRACE, + LogfileHeader: TRACE_LOGFILE_HEADER, + BufferCallback: PEVENT_TRACE_BUFFER_CALLBACKA, + BufferSize: ULONG, + Filled: ULONG, + EventsLost: ULONG, + u2: EVENT_TRACE_LOGFILE_u2, + IsKernelTrace: ULONG, + Context: PVOID, +}} +pub type PEVENT_TRACE_LOGFILEA = *mut EVENT_TRACE_LOGFILEA; +extern "system" { + pub fn StartTraceW( + SessionHandle: PTRACEHANDLE, + SessionName: LPCWSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ) -> ULONG; + pub fn StartTraceA( + SessionHandle: PTRACEHANDLE, + SessionName: LPCSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ) -> ULONG; + pub fn StopTraceW( + SessionHandle: TRACEHANDLE, + SessionName: LPCWSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ) -> ULONG; + pub fn StopTraceA( + SessionHandle: TRACEHANDLE, + SessionName: LPCSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ) -> ULONG; + pub fn QueryTraceW( + SessionHandle: TRACEHANDLE, + SessionName: LPCWSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ) -> ULONG; + pub fn QueryTraceA( + SessionHandle: TRACEHANDLE, + SessionName: LPCSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ) -> ULONG; + pub fn UpdateTraceW( + SessionHandle: TRACEHANDLE, + SessionName: LPCWSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ) -> ULONG; + pub fn UpdateTraceA( + SessionHandle: TRACEHANDLE, + SessionName: LPCSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ) -> ULONG; + pub fn FlushTraceW( + SessionHandle: TRACEHANDLE, + SessionName: LPCWSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ) -> ULONG; + pub fn FlushTraceA( + SessionHandle: TRACEHANDLE, + SessionName: LPCSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ) -> ULONG; + pub fn ControlTraceW( + SessionHandle: TRACEHANDLE, + SessionName: LPCWSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ControlCode: ULONG, + ) -> ULONG; + pub fn ControlTraceA( + SessionHandle: TRACEHANDLE, + SessionName: LPCSTR, + Properties: PEVENT_TRACE_PROPERTIES, + ControlCode: ULONG, + ) -> ULONG; + pub fn QueryAllTracesW( + PropertyArray: *mut PEVENT_TRACE_PROPERTIES, + PropertyArrayCount: ULONG, + SessionCount: PULONG, + ) -> ULONG; + pub fn QueryAllTracesA( + PropertyArray: *mut PEVENT_TRACE_PROPERTIES, + PropertyArrayCount: ULONG, + SessionCount: PULONG, + ) -> ULONG; + pub fn EnableTrace( + Enable: ULONG, + EnableFlag: ULONG, + EnableLevel: ULONG, + ControlGuid: LPCGUID, + SessionHandle: TRACEHANDLE, + ) -> ULONG; + pub fn EnableTraceEx( + ProviderId: LPCGUID, + SourceId: LPCGUID, + TraceHandle: TRACEHANDLE, + IsEnabled: ULONG, + Level: UCHAR, + MatchAnyKeyword: ULONGLONG, + MatchAllKeyword: ULONGLONG, + EnableProperty: ULONG, + EnableFilterDesc: PEVENT_FILTER_DESCRIPTOR, + ) -> ULONG; +} +pub const ENABLE_TRACE_PARAMETERS_VERSION: ULONG = 1; +pub const ENABLE_TRACE_PARAMETERS_VERSION_2: ULONG = 2; +STRUCT!{struct ENABLE_TRACE_PARAMETERS_V1 { + Version: ULONG, + EnableProperty: ULONG, + ControlFlags: ULONG, + SourceId: GUID, + EnableFilterDesc: PEVENT_FILTER_DESCRIPTOR, +}} +pub type PENABLE_TRACE_PARAMETERS_V1 = *mut ENABLE_TRACE_PARAMETERS_V1; +STRUCT!{struct ENABLE_TRACE_PARAMETERS { + Version: ULONG, + EnableProperty: ULONG, + ControlFlags: ULONG, + SourceId: GUID, + EnableFilterDesc: PEVENT_FILTER_DESCRIPTOR, + FilterDescCount: ULONG, +}} +pub type PENABLE_TRACE_PARAMETERS = *mut ENABLE_TRACE_PARAMETERS; +extern "system" { + pub fn EnableTraceEx2( + TraceHandle: TRACEHANDLE, + ProviderId: LPCGUID, + ControlCode: ULONG, + Level: UCHAR, + MatchAnyKeyword: ULONGLONG, + MatchAllKeyword: ULONGLONG, + Timeout: ULONG, + EnableParameters: PENABLE_TRACE_PARAMETERS, + ) -> ULONG; +} +ENUM!{enum TRACE_QUERY_INFO_CLASS { + TraceGuidQueryList, + TraceGuidQueryInfo, + TraceGuidQueryProcess, + TraceStackTracingInfo, + TraceSystemTraceEnableFlagsInfo, + TraceSampledProfileIntervalInfo, + TraceProfileSourceConfigInfo, + TraceProfileSourceListInfo, + TracePmcEventListInfo, + TracePmcCounterListInfo, + TraceSetDisallowList, + TraceVersionInfo, + TraceGroupQueryList, + TraceGroupQueryInfo, + TraceDisallowListQuery, + TraceCompressionInfo, + TracePeriodicCaptureStateListInfo, + TracePeriodicCaptureStateInfo, + TraceProviderBinaryTracking, + TraceMaxLoggersQuery, + MaxTraceSetInfoClass, +}} +pub type TRACE_INFO_CLASS = TRACE_QUERY_INFO_CLASS; +extern "system" { + pub fn EnumerateTraceGuidsEx( + TraceQueryInfoClass: TRACE_QUERY_INFO_CLASS, + InBuffer: PVOID, + InBufferSize: ULONG, + OutBuffer: PVOID, + OutBufferSize: ULONG, + ReturnLength: PULONG, + ) -> ULONG; +} +STRUCT!{struct CLASSIC_EVENT_ID { + EventGuid: GUID, + Type: UCHAR, + Reserved: [UCHAR; 7], +}} +pub type PCLASSIC_EVENT_ID = *mut CLASSIC_EVENT_ID; +STRUCT!{struct TRACE_PROFILE_INTERVAL { + Source: ULONG, + Interval: ULONG, +}} +pub type PTRACE_PROFILE_INTERVAL = *mut TRACE_PROFILE_INTERVAL; +STRUCT!{struct TRACE_VERSION_INFO { + EtwTraceProcessingVersion: UINT, + Reserved: UINT, +}} +pub type PTRACE_VERSION_INFO = *mut TRACE_VERSION_INFO; +STRUCT!{struct TRACE_PERIODIC_CAPTURE_STATE_INFO { + CaptureStateFrequencyInSeconds: ULONG, + ProviderCount: USHORT, + Reserved: USHORT, +}} +pub type PTRACE_PERIODIC_CAPTURE_STATE_INFO = *mut TRACE_PERIODIC_CAPTURE_STATE_INFO; +extern "system" { + pub fn TraceSetInformation( + SessionHandle: TRACEHANDLE, + InformationClass: TRACE_INFO_CLASS, + TraceInformation: PVOID, + InformationLength: ULONG, + ) -> ULONG; + pub fn TraceQueryInformation( + SessionHandle: TRACEHANDLE, + InformationClass: TRACE_QUERY_INFO_CLASS, + TraceInformation: PVOID, + InformationLength: ULONG, + ReturnLength: PULONG, + ) -> ULONG; + pub fn CreateTraceInstanceId( + RegHandle: HANDLE, + pInstInfo: PEVENT_INSTANCE_INFO, + ) -> ULONG; + pub fn TraceEvent( + SessionHandle: TRACEHANDLE, + EventTrace: PEVENT_TRACE_HEADER, + ) -> ULONG; + pub fn TraceEventInstance( + SessionHandle: TRACEHANDLE, + EventTrace: PEVENT_TRACE_HEADER, + pInstInfo: PEVENT_INSTANCE_INFO, + pParentInstInfo: PEVENT_INSTANCE_INFO, + ) -> ULONG; + pub fn RegisterTraceGuidsW( + RequestAddress: WMIDPREQUEST, + RequestContext: PVOID, + ControlGuid: LPCGUID, + GuidCount: ULONG, + TraceGuidReg: PTRACE_GUID_REGISTRATION, + MofImagePath: LPCWSTR, + MofResourceName: LPCWSTR, + RegistrationHandle: PTRACEHANDLE, + ) -> ULONG; + pub fn RegisterTraceGuidsA( + RequestAddress: WMIDPREQUEST, + RequestContext: PVOID, + ControlGuid: LPCGUID, + GuidCount: ULONG, + TraceGuidReg: PTRACE_GUID_REGISTRATION, + MofImagePath: LPCSTR, + MofResourceName: LPCSTR, + RegistrationHandle: PTRACEHANDLE, + ) -> ULONG; + pub fn EnumerateTraceGuids( + GuidPropertiesArray: *mut PTRACE_GUID_PROPERTIES, + PropertyArrayCount: ULONG, + GuidCount: PULONG, + ) -> ULONG; + pub fn UnregisterTraceGuids( + RegistrationHandle: TRACEHANDLE, + ) -> ULONG; + pub fn GetTraceLoggerHandle( + Buffer: PVOID, + ) -> TRACEHANDLE; + pub fn GetTraceEnableLevel( + SessionHandle: TRACEHANDLE, + ) -> UCHAR; + pub fn GetTraceEnableFlags( + SessionHandle: TRACEHANDLE, + ) -> ULONG; + pub fn OpenTraceW( + Logfile: PEVENT_TRACE_LOGFILEW, + ) -> TRACEHANDLE; + pub fn ProcessTrace( + HandleArray: PTRACEHANDLE, + HandleCount: ULONG, + StartTime: LPFILETIME, + EndTime: LPFILETIME, + ) -> ULONG; + pub fn CloseTrace( + TraceHandle: TRACEHANDLE, + ) -> ULONG; +} +ENUM!{enum ETW_PROCESS_HANDLE_INFO_TYPE { + EtwQueryPartitionInformation = 1, + EtwQueryProcessHandleInfoMax, +}} +STRUCT!{struct ETW_TRACE_PARTITION_INFORMATION { + PartitionId: GUID, + ParentId: GUID, + Reserved: ULONG64, + PartitionType: ULONG, +}} +pub type PETW_TRACE_PARTITION_INFORMATION = *mut ETW_TRACE_PARTITION_INFORMATION; +extern "system" { + pub fn QueryTraceProcessingHandle( + ProcessingHandle: TRACEHANDLE, + InformationClass: ETW_PROCESS_HANDLE_INFO_TYPE, + InBuffer: PVOID, + InBufferSize: ULONG, + OutBuffer: PVOID, + OutBufferSize: ULONG, + ReturnLength: PULONG, + ) -> ULONG; + pub fn OpenTraceA( + Logfile: PEVENT_TRACE_LOGFILEA, + ) -> TRACEHANDLE; + pub fn SetTraceCallback( + pGuid: LPCGUID, + EventCallback: PEVENT_CALLBACK, + ) -> ULONG; + pub fn RemoveTraceCallback( + pGuid: LPCGUID, + ) -> ULONG; +} +extern "C" { + pub fn TraceMessage( + SessionHandle: TRACEHANDLE, + MessageFlags: ULONG, + MessageGuid: LPGUID, + MessageNumber: USHORT, + ... + ) -> ULONG; + pub fn TraceMessageVa( + SessionHandle: TRACEHANDLE, + MessageFlags: ULONG, + MessageGuid: LPGUID, + MessageNumber: USHORT, + MessageArgList: va_list, + ); +} +pub const INVALID_PROCESSTRACE_HANDLE: TRACEHANDLE = INVALID_HANDLE_VALUE as TRACEHANDLE; diff --git a/bash-5.1/vendor/winapi/src/shared/guiddef.rs b/bash-5.1/vendor/winapi/src/shared/guiddef.rs new file mode 100644 index 0000000000000000000000000000000000000000..dcd39dcc440965e241d9b5f6e754de28a8a71dc0 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/guiddef.rs @@ -0,0 +1,36 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! GUID definition +use ctypes::{c_uchar, c_ulong, c_ushort}; +STRUCT!{#[debug] struct GUID { + Data1: c_ulong, + Data2: c_ushort, + Data3: c_ushort, + Data4: [c_uchar; 8], +}} +pub type LPGUID = *mut GUID; +pub type LPCGUID = *const GUID; +pub type IID = GUID; +pub type LPIID = *mut IID; +pub use self::IsEqualGUID as IsEqualIID; +pub type CLSID = GUID; +pub type LPCLSID = *mut CLSID; +pub use self::IsEqualGUID as IsEqualCLSID; +pub type FMTID = GUID; +pub type LPFMTID = *mut FMTID; +pub use self::IsEqualGUID as IsEqualFMTID; +pub type REFGUID = *const GUID; +pub type REFIID = *const IID; +pub type REFCLSID = *const IID; +pub type REFFMTID = *const IID; +DEFINE_GUID!{IID_NULL, + 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} +#[inline] +pub fn IsEqualGUID(g1: &GUID, g2: &GUID) -> bool { + let a = unsafe { &*(g1 as *const _ as *const [u32; 4]) }; + let b = unsafe { &*(g2 as *const _ as *const [u32; 4]) }; + a[0] == b[0] && a[1] == b[1] && a[2] == b[2] && a[3] == b[3] +} diff --git a/bash-5.1/vendor/winapi/src/shared/hidclass.rs b/bash-5.1/vendor/winapi/src/shared/hidclass.rs new file mode 100644 index 0000000000000000000000000000000000000000..c65c14faf6880126d5c79fdd6f20c65132d4014d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/hidclass.rs @@ -0,0 +1,68 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, PUCHAR, UCHAR, ULONG, USHORT}; +use um::winioctl::{ + FILE_ANY_ACCESS, FILE_DEVICE_KEYBOARD, METHOD_BUFFERED, METHOD_IN_DIRECT, METHOD_NEITHER, + METHOD_OUT_DIRECT, +}; +use um::winnt::BOOLEAN; +DEFINE_GUID!{GUID_DEVINTERFACE_HID, + 0x4D1E55B2, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30} +pub const GUID_CLASS_INPUT: GUID = GUID_DEVINTERFACE_HID; +DEFINE_GUID!{GUID_HID_INTERFACE_NOTIFY, + 0x2c4e2e88, 0x25e6, 0x4c33, 0x88, 0x2f, 0x3d, 0x82, 0xe6, 0x07, 0x36, 0x81} +DEFINE_GUID!{GUID_HID_INTERFACE_HIDPARSE, + 0xf5c315a5, 0x69ac, 0x4bc2, 0x92, 0x79, 0xd0, 0xb6, 0x45, 0x76, 0xf4, 0x4b} +// FIXME devpropkey stuff +pub const HID_REVISION: DWORD = 0x00000001; +pub const IOCTL_HID_GET_DRIVER_CONFIG: DWORD = HID_BUFFER_CTL_CODE!(100); +pub const IOCTL_HID_SET_DRIVER_CONFIG: DWORD = HID_BUFFER_CTL_CODE!(101); +pub const IOCTL_HID_GET_POLL_FREQUENCY_MSEC: DWORD = HID_BUFFER_CTL_CODE!(102); +pub const IOCTL_HID_SET_POLL_FREQUENCY_MSEC: DWORD = HID_BUFFER_CTL_CODE!(103); +pub const IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS: DWORD = HID_BUFFER_CTL_CODE!(104); +pub const IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS: DWORD = HID_BUFFER_CTL_CODE!(105); +pub const IOCTL_HID_GET_COLLECTION_INFORMATION: DWORD = HID_BUFFER_CTL_CODE!(106); +pub const IOCTL_HID_ENABLE_WAKE_ON_SX: DWORD = HID_BUFFER_CTL_CODE!(107); +pub const IOCTL_HID_SET_S0_IDLE_TIMEOUT: DWORD = HID_BUFFER_CTL_CODE!(108); +pub const IOCTL_HID_GET_COLLECTION_DESCRIPTOR: DWORD = HID_CTL_CODE!(100); +pub const IOCTL_HID_FLUSH_QUEUE: DWORD = HID_CTL_CODE!(101); +pub const IOCTL_HID_SET_FEATURE: DWORD = HID_IN_CTL_CODE!(100); +pub const IOCTL_HID_SET_OUTPUT_REPORT: DWORD = HID_IN_CTL_CODE!(101); +pub const IOCTL_HID_GET_FEATURE: DWORD = HID_OUT_CTL_CODE!(100); +pub const IOCTL_GET_PHYSICAL_DESCRIPTOR: DWORD = HID_OUT_CTL_CODE!(102); +pub const IOCTL_HID_GET_HARDWARE_ID: DWORD = HID_OUT_CTL_CODE!(103); +pub const IOCTL_HID_GET_INPUT_REPORT: DWORD = HID_OUT_CTL_CODE!(104); +pub const IOCTL_HID_GET_OUTPUT_REPORT: DWORD = HID_OUT_CTL_CODE!(105); +pub const IOCTL_HID_GET_MANUFACTURER_STRING: DWORD = HID_OUT_CTL_CODE!(110); +pub const IOCTL_HID_GET_PRODUCT_STRING: DWORD = HID_OUT_CTL_CODE!(111); +pub const IOCTL_HID_GET_SERIALNUMBER_STRING: DWORD = HID_OUT_CTL_CODE!(112); +pub const IOCTL_HID_GET_INDEXED_STRING: DWORD = HID_OUT_CTL_CODE!(120); +pub const IOCTL_HID_GET_MS_GENRE_DESCRIPTOR: DWORD = HID_OUT_CTL_CODE!(121); +pub const IOCTL_HID_ENABLE_SECURE_READ: DWORD = HID_CTL_CODE!(130); +pub const IOCTL_HID_DISABLE_SECURE_READ: DWORD = HID_CTL_CODE!(131); +pub const IOCTL_HID_DEVICERESET_NOTIFICATION: DWORD = HID_CTL_CODE!(140); +STRUCT!{struct HID_XFER_PACKET { + reportBuffer: PUCHAR, + reportBufferLen: ULONG, + reportId: UCHAR, +}} +pub type PHID_XFER_PACKET = *mut HID_XFER_PACKET; +//FIXME Stuff for NT_INCLUDED +STRUCT!{struct HID_COLLECTION_INFORMATION { + DescriptorSize: ULONG, + Polled: BOOLEAN, + Reserved1: [UCHAR; 1], + VendorID: USHORT, + ProductID: USHORT, + VersionNumber: USHORT, +}} +pub type PHID_COLLECTION_INFORMATION = *mut HID_COLLECTION_INFORMATION; +STRUCT!{struct HID_DRIVER_CONFIG { + Size: ULONG, + RingBufferSize: ULONG, +}} +pub type PHID_DRIVER_CONFIG = *mut HID_DRIVER_CONFIG; diff --git a/bash-5.1/vendor/winapi/src/shared/hidpi.rs b/bash-5.1/vendor/winapi/src/shared/hidpi.rs new file mode 100644 index 0000000000000000000000000000000000000000..ea022925361fa943985da309c240bfb59194ed8e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/hidpi.rs @@ -0,0 +1,393 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::hidusage::{PUSAGE, USAGE}; +use shared::minwindef::{PUCHAR, PULONG, PUSHORT, UCHAR, ULONG, USHORT}; +use shared::ntdef::NTSTATUS; +use shared::ntstatus::FACILITY_HID_ERROR_CODE; +use um::winnt::{BOOLEAN, LONG, PCHAR, PLONG, PVOID}; +pub const HIDP_LINK_COLLECTION_ROOT: USHORT = -1i16 as u16; +pub const HIDP_LINK_COLLECTION_UNSPECIFIED: USHORT = 0; +ENUM!{enum HIDP_REPORT_TYPE { + HidP_Input, + HidP_Output, + HidP_Feature, +}} +STRUCT!{struct USAGE_AND_PAGE { + Usage: USAGE, + UsagePage: USAGE, +}} +pub type PUSAGE_AND_PAGE = *mut USAGE_AND_PAGE; +// HidP_IsSameUsageAndPage +STRUCT!{struct HIDP_CAPS_Range { + UsageMin: USAGE, + UsageMax: USAGE, + StringMin: USHORT, + StringMax: USHORT, + DesignatorMin: USHORT, + DesignatorMax: USHORT, + DataIndexMin: USHORT, + DataIndexMax: USHORT, +}} +STRUCT!{struct HIDP_CAPS_NotRange { + Usage: USAGE, + Reserved1: USAGE, + StringIndex: USHORT, + Reserved2: USHORT, + DesignatorIndex: USHORT, + Reserved3: USHORT, + DataIndex: USHORT, + Reserved4: USHORT, +}} +UNION!{union HIDP_CAPS_u { + [u16; 8], + Range Range_mut: HIDP_CAPS_Range, + NotRange NotRange_mut: HIDP_CAPS_NotRange, +}} +STRUCT!{struct HIDP_BUTTON_CAPS { + UsagePage: USAGE, + ReportID: UCHAR, + IsAlias: BOOLEAN, + BitField: USHORT, + LinkCollection: USHORT, + LinkUsage: USAGE, + LinkUsagePage: USAGE, + IsRange: BOOLEAN, + IsStringRange: BOOLEAN, + IsDesignatorRange: BOOLEAN, + IsAbsolute: BOOLEAN, + Reserved: [ULONG; 10], + u: HIDP_CAPS_u, +}} +pub type PHIDP_BUTTON_CAPS = *mut HIDP_BUTTON_CAPS; +STRUCT!{struct HIDP_VALUE_CAPS { + UsagePage: USAGE, + ReportID: UCHAR, + IsAlias: BOOLEAN, + BitField: USHORT, + LinkCollection: USHORT, + LinkUsage: USAGE, + LinkUsagePage: USAGE, + IsRange: BOOLEAN, + IsStringRange: BOOLEAN, + IsDesignatorRange: BOOLEAN, + IsAbsolute: BOOLEAN, + HasNull: BOOLEAN, + Reserved: UCHAR, + BitSize: USHORT, + ReportCount: USHORT, + Reserved2: [USHORT; 5], + UnitsExp: ULONG, + Units: ULONG, + LogicalMin: LONG, + LogicalMax: LONG, + PhysicalMin: LONG, + PhysicalMax: LONG, + u: HIDP_CAPS_u, +}} +pub type PHIDP_VALUE_CAPS = *mut HIDP_VALUE_CAPS; +STRUCT!{struct HIDP_LINK_COLLECTION_NODE { + LinkUsage: USAGE, + LinkUsagePage: USAGE, + Parent: USHORT, + NumberOfChildren: USHORT, + NextSibling: USHORT, + FirstChild: USHORT, + bit_fields: ULONG, + UserContext: PVOID, +}} +BITFIELD!{HIDP_LINK_COLLECTION_NODE bit_fields: ULONG [ + CollectionType set_CollectionType[0..8], + IsAlias set_IsAlias[8..9], +]} +pub type PHIDP_LINK_COLLECTION_NODE = *mut HIDP_LINK_COLLECTION_NODE; +pub type PHIDP_REPORT_DESCRIPTOR = PUCHAR; +pub enum HIDP_PREPARSED_DATA {} +pub type PHIDP_PREPARSED_DATA = *mut HIDP_PREPARSED_DATA; +STRUCT!{struct HIDP_CAPS { + Usage: USAGE, + UsagePage: USAGE, + InputReportByteLength: USHORT, + OutputReportByteLength: USHORT, + FeatureReportByteLength: USHORT, + Reserved: [USHORT; 17], + NumberLinkCollectionNodes: USHORT, + NumberInputButtonCaps: USHORT, + NumberInputValueCaps: USHORT, + NumberInputDataIndices: USHORT, + NumberOutputButtonCaps: USHORT, + NumberOutputValueCaps: USHORT, + NumberOutputDataIndices: USHORT, + NumberFeatureButtonCaps: USHORT, + NumberFeatureValueCaps: USHORT, + NumberFeatureDataIndices: USHORT, +}} +pub type PHIDP_CAPS = *mut HIDP_CAPS; +UNION!{union HIDP_DATA_u { + [u32; 1], + RawValue RawValue_mut: ULONG, + On On_mut: BOOLEAN, +}} +STRUCT!{struct HIDP_DATA { + DataIndex: USHORT, + Reserved: USHORT, + u: HIDP_DATA_u, +}} +pub type PHIDP_DATA = *mut HIDP_DATA; +STRUCT!{struct HIDP_UNKNOWN_TOKEN { + Token: UCHAR, + Reserved: [UCHAR; 3], + BitField: ULONG, +}} +pub type PHIDP_UNKNOWN_TOKEN = *mut HIDP_UNKNOWN_TOKEN; +STRUCT!{struct HIDP_EXTENDED_ATTRIBUTES { + NumGlobalUnknowns: UCHAR, + Reserved: [UCHAR; 3], + GlobalUnknowns: PHIDP_UNKNOWN_TOKEN, + Data: [ULONG; 1], +}} +pub type PHIDP_EXTENDED_ATTRIBUTES = *mut HIDP_EXTENDED_ATTRIBUTES; +extern "system" { + pub fn HidP_GetCaps( + PreparsedData: PHIDP_PREPARSED_DATA, + Capabilities: PHIDP_CAPS, + ) -> NTSTATUS; + pub fn HidP_GetLinkCollectionNodes( + LinkCollectionNodes: PHIDP_LINK_COLLECTION_NODE, + LinkCollectionNodesLength: PULONG, + PreparsedData: PHIDP_PREPARSED_DATA, + ) -> NTSTATUS; + pub fn HidP_GetSpecificButtonCaps( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + Usage: USAGE, + ButtonCaps: PHIDP_BUTTON_CAPS, + ButtonCapsLength: PUSHORT, + PreparsedData: PHIDP_PREPARSED_DATA, + ) -> NTSTATUS; + pub fn HidP_GetButtonCaps( + ReportType: HIDP_REPORT_TYPE, + ButtonCaps: PHIDP_BUTTON_CAPS, + ButtonCapsLength: PUSHORT, + PreparsedData: PHIDP_PREPARSED_DATA, + ) -> NTSTATUS; + pub fn HidP_GetSpecificValueCaps( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + Usage: USAGE, + ValueCaps: PHIDP_VALUE_CAPS, + ValueCapsLength: PUSHORT, + PreparsedData: PHIDP_PREPARSED_DATA, + ) -> NTSTATUS; + pub fn HidP_GetValueCaps( + ReportType: HIDP_REPORT_TYPE, + ValueCaps: PHIDP_VALUE_CAPS, + ValueCapsLength: PUSHORT, + PreparsedData: PHIDP_PREPARSED_DATA, + ) -> NTSTATUS; + pub fn HidP_GetExtendedAttributes( + ReportType: HIDP_REPORT_TYPE, + DataIndex: USHORT, + PreparsedData: PHIDP_PREPARSED_DATA, + Attributes: PHIDP_EXTENDED_ATTRIBUTES, + LengthAttributes: PULONG, + ) -> NTSTATUS; + pub fn HidP_InitializeReportForID( + ReportType: HIDP_REPORT_TYPE, + ReportID: UCHAR, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_SetData( + ReportType: HIDP_REPORT_TYPE, + DataList: PHIDP_DATA, + DataLength: PULONG, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_GetData( + ReportType: HIDP_REPORT_TYPE, + DataList: PHIDP_DATA, + DataLength: PULONG, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_MaxDataListLength( + ReportType: HIDP_REPORT_TYPE, + PreparsedData: PHIDP_PREPARSED_DATA, + ) -> ULONG; + pub fn HidP_SetUsages( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + UsageList: PUSAGE, + UsageLength: PULONG, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_UnsetUsages( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + UsageList: PUSAGE, + UsageLength: PULONG, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_GetUsages( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + UsageList: PUSAGE, + UsageLength: PULONG, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_GetUsagesEx( + ReportType: HIDP_REPORT_TYPE, + LinkCollection: USHORT, + ButtonList: PUSAGE_AND_PAGE, + UsageLength: *mut ULONG, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_MaxUsageListLength( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + PreparsedData: PHIDP_PREPARSED_DATA, + ) -> ULONG; + pub fn HidP_SetUsageValue( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + Usage: USAGE, + UsageValue: ULONG, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_SetScaledUsageValue( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + Usage: USAGE, + UsageValue: LONG, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_SetUsageValueArray( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + Usage: USAGE, + UsageValue: PCHAR, + UsageValueByteLength: USHORT, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_GetUsageValue( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + Usage: USAGE, + UsageValue: PULONG, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_GetScaledUsageValue( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + Usage: USAGE, + UsageValue: PLONG, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_GetUsageValueArray( + ReportType: HIDP_REPORT_TYPE, + UsagePage: USAGE, + LinkCollection: USHORT, + Usage: USAGE, + UsageValue: PCHAR, + UsageValueByteLength: USHORT, + PreparsedData: PHIDP_PREPARSED_DATA, + Report: PCHAR, + ReportLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_UsageListDifference( + PreviousUsageList: PUSAGE, + CurrentUsageList: PUSAGE, + BreakUsageList: PUSAGE, + MakeUsageList: PUSAGE, + UsageListLength: ULONG, + ) -> NTSTATUS; + pub fn HidP_TranslateUsagesToI8042ScanCodes( + ChangedUsageList: PUSAGE, + UsageListLength: ULONG, + KeyAction: HIDP_KEYBOARD_DIRECTION, + ModifierState: PHIDP_KEYBOARD_MODIFIER_STATE, + InsertCodesProcedure: PHIDP_INSERT_SCANCODES, + InsertCodesContext: PVOID, + ) -> NTSTATUS; +} +ENUM!{enum HIDP_KEYBOARD_DIRECTION { + HidP_Keyboard_Break, + HidP_Keyboard_Make, +}} +STRUCT!{struct HIDP_KEYBOARD_MODIFIER_STATE { + ul: ULONG, +}} +BITFIELD!{HIDP_KEYBOARD_MODIFIER_STATE ul: ULONG [ + LeftControl set_LeftControl[0..1], + LeftShift set_LeftShift[1..2], + LeftAlt set_LeftAlt[2..3], + LeftGUI set_LeftGUI[3..4], + RightControl set_RightControl[4..5], + RightShift set_RightShift[5..6], + RightAlt set_RightAlt[6..7], + RigthGUI set_RigthGUI[7..8], + CapsLock set_CapsLock[8..9], + ScollLock set_ScollLock[9..10], + NumLock set_NumLock[10..11], +]} +pub type PHIDP_KEYBOARD_MODIFIER_STATE = *mut HIDP_KEYBOARD_MODIFIER_STATE; +FN!{stdcall PHIDP_INSERT_SCANCODES( + Context: PVOID, + NewScanCodes: PCHAR, + Length: ULONG, +) -> BOOLEAN} +pub const HIDP_STATUS_SUCCESS: NTSTATUS = HIDP_ERROR_CODES!(0x0, 0); +pub const HIDP_STATUS_NULL: NTSTATUS = HIDP_ERROR_CODES!(0x8, 1); +pub const HIDP_STATUS_INVALID_PREPARSED_DATA: NTSTATUS = HIDP_ERROR_CODES!(0xC, 1); +pub const HIDP_STATUS_INVALID_REPORT_TYPE: NTSTATUS = HIDP_ERROR_CODES!(0xC, 2); +pub const HIDP_STATUS_INVALID_REPORT_LENGTH: NTSTATUS = HIDP_ERROR_CODES!(0xC, 3); +pub const HIDP_STATUS_USAGE_NOT_FOUND: NTSTATUS = HIDP_ERROR_CODES!(0xC, 4); +pub const HIDP_STATUS_VALUE_OUT_OF_RANGE: NTSTATUS = HIDP_ERROR_CODES!(0xC, 5); +pub const HIDP_STATUS_BAD_LOG_PHY_VALUES: NTSTATUS = HIDP_ERROR_CODES!(0xC, 6); +pub const HIDP_STATUS_BUFFER_TOO_SMALL: NTSTATUS = HIDP_ERROR_CODES!(0xC, 7); +pub const HIDP_STATUS_INTERNAL_ERROR: NTSTATUS = HIDP_ERROR_CODES!(0xC, 8); +pub const HIDP_STATUS_I8042_TRANS_UNKNOWN: NTSTATUS = HIDP_ERROR_CODES!(0xC, 9); +pub const HIDP_STATUS_INCOMPATIBLE_REPORT_ID: NTSTATUS = HIDP_ERROR_CODES!(0xC, 0xA); +pub const HIDP_STATUS_NOT_VALUE_ARRAY: NTSTATUS = HIDP_ERROR_CODES!(0xC, 0xB); +pub const HIDP_STATUS_IS_VALUE_ARRAY: NTSTATUS = HIDP_ERROR_CODES!(0xC, 0xC); +pub const HIDP_STATUS_DATA_INDEX_NOT_FOUND: NTSTATUS = HIDP_ERROR_CODES!(0xC, 0xD); +pub const HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE: NTSTATUS = HIDP_ERROR_CODES!(0xC, 0xE); +pub const HIDP_STATUS_BUTTON_NOT_PRESSED: NTSTATUS = HIDP_ERROR_CODES!(0xC, 0xF); +pub const HIDP_STATUS_REPORT_DOES_NOT_EXIST: NTSTATUS = HIDP_ERROR_CODES!(0xC, 0x10); +pub const HIDP_STATUS_NOT_IMPLEMENTED: NTSTATUS = HIDP_ERROR_CODES!(0xC, 0x20); +pub const HIDP_STATUS_I8242_TRANS_UNKNOWN: NTSTATUS = HIDP_STATUS_I8042_TRANS_UNKNOWN; diff --git a/bash-5.1/vendor/winapi/src/shared/hidsdi.rs b/bash-5.1/vendor/winapi/src/shared/hidsdi.rs new file mode 100644 index 0000000000000000000000000000000000000000..ebdd3ed4fbd65ee4d2c3d8c7c460347fe7d9f7f4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/hidsdi.rs @@ -0,0 +1,110 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::LPGUID; +use shared::hidpi::PHIDP_PREPARSED_DATA; +use shared::minwindef::{PULONG, ULONG, USHORT}; +use um::winnt::{BOOLEAN, HANDLE, PVOID}; +STRUCT!{struct HIDD_CONFIGURATION { + cookie: PVOID, + size: ULONG, + RingBufferSize: ULONG, +}} +pub type PHIDD_CONFIGURATION = *mut HIDD_CONFIGURATION; +STRUCT!{struct HIDD_ATTRIBUTES { + Size: ULONG, + VendorID: USHORT, + ProductID: USHORT, + VersionNumber: USHORT, +}} +pub type PHIDD_ATTRIBUTES = *mut HIDD_ATTRIBUTES; +extern "system" { + pub fn HidD_GetAttributes( + HidDeviceObject: HANDLE, + Attributes: PHIDD_ATTRIBUTES, + ) -> BOOLEAN; + pub fn HidD_GetHidGuid( + HidGuid: LPGUID, + ); + pub fn HidD_GetPreparsedData( + HidDeviceObject: HANDLE, + PreparsedData: *mut PHIDP_PREPARSED_DATA, + ) -> BOOLEAN; + pub fn HidD_FreePreparsedData( + PreparsedData: PHIDP_PREPARSED_DATA, + ) -> BOOLEAN; + pub fn HidD_FlushQueue( + HidDeviceObject: HANDLE, + ) -> BOOLEAN; + pub fn HidD_GetConfiguration( + HidDeviceObject: HANDLE, + Configuration: PHIDD_CONFIGURATION, + ConfigurationLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_SetConfiguration( + HidDeviceObject: HANDLE, + Configuration: PHIDD_CONFIGURATION, + ConfigurationLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_GetFeature( + HidDeviceObject: HANDLE, + ReportBuffer: PVOID, + ReportBufferLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_SetFeature( + HidDeviceObject: HANDLE, + ReportBuffer: PVOID, + ReportBufferLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_GetInputReport( + HidDeviceObject: HANDLE, + ReportBuffer: PVOID, + ReportBufferLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_SetOutputReport( + HidDeviceObject: HANDLE, + ReportBuffer: PVOID, + ReportBufferLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_GetNumInputBuffers( + HidDeviceObject: HANDLE, + NumberBuffers: PULONG, + ) -> BOOLEAN; + pub fn HidD_SetNumInputBuffers( + HidDeviceObject: HANDLE, + NumberBuffers: ULONG, + ) -> BOOLEAN; + pub fn HidD_GetPhysicalDescriptor( + HidDeviceObject: HANDLE, + Buffer: PVOID, + BufferLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_GetManufacturerString( + HidDeviceObject: HANDLE, + Buffer: PVOID, + BufferLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_GetProductString( + HidDeviceObject: HANDLE, + Buffer: PVOID, + BufferLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_GetIndexedString( + HidDeviceObject: HANDLE, + StringIndex: ULONG, + Buffer: PVOID, + BufferLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_GetSerialNumberString( + HidDeviceObject: HANDLE, + Buffer: PVOID, + BufferLength: ULONG, + ) -> BOOLEAN; + pub fn HidD_GetMsGenreDescriptor( + HidDeviceObject: HANDLE, + Buffer: PVOID, + BufferLength: ULONG, + ) -> BOOLEAN; +} diff --git a/bash-5.1/vendor/winapi/src/shared/hidusage.rs b/bash-5.1/vendor/winapi/src/shared/hidusage.rs new file mode 100644 index 0000000000000000000000000000000000000000..a483bf27d979a256d2078c02758b8e59e39c7494 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/hidusage.rs @@ -0,0 +1,274 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::USHORT; +pub type USAGE = USHORT; +pub type PUSAGE = *mut USAGE; +pub const HID_USAGE_PAGE_UNDEFINED: USAGE = 0x00; +pub const HID_USAGE_PAGE_GENERIC: USAGE = 0x01; +pub const HID_USAGE_PAGE_SIMULATION: USAGE = 0x02; +pub const HID_USAGE_PAGE_VR: USAGE = 0x03; +pub const HID_USAGE_PAGE_SPORT: USAGE = 0x04; +pub const HID_USAGE_PAGE_GAME: USAGE = 0x05; +pub const HID_USAGE_PAGE_KEYBOARD: USAGE = 0x07; +pub const HID_USAGE_PAGE_LED: USAGE = 0x08; +pub const HID_USAGE_PAGE_BUTTON: USAGE = 0x09; +pub const HID_USAGE_PAGE_ORDINAL: USAGE = 0x0A; +pub const HID_USAGE_PAGE_TELEPHONY: USAGE = 0x0B; +pub const HID_USAGE_PAGE_CONSUMER: USAGE = 0x0C; +pub const HID_USAGE_PAGE_DIGITIZER: USAGE = 0x0D; +pub const HID_USAGE_PAGE_UNICODE: USAGE = 0x10; +pub const HID_USAGE_PAGE_ALPHANUMERIC: USAGE = 0x14; +pub const HID_USAGE_PAGE_SENSOR: USAGE = 0x20; +pub const HID_USAGE_PAGE_BARCODE_SCANNER: USAGE = 0x8C; +pub const HID_USAGE_PAGE_WEIGHING_DEVICE: USAGE = 0x8D; +pub const HID_USAGE_PAGE_MAGNETIC_STRIPE_READER: USAGE = 0x8E; +pub const HID_USAGE_PAGE_CAMERA_CONTROL: USAGE = 0x90; +pub const HID_USAGE_PAGE_MICROSOFT_BLUETOOTH_HANDSFREE: USAGE = 0xFFF3; +pub const HID_USAGE_PAGE_VENDOR_DEFINED_BEGIN: USAGE = 0xFF00; +pub const HID_USAGE_PAGE_VENDOR_DEFINED_END: USAGE = 0xFFFF; +pub const HID_USAGE_GENERIC_POINTER: USAGE = 0x01; +pub const HID_USAGE_GENERIC_MOUSE: USAGE = 0x02; +pub const HID_USAGE_GENERIC_JOYSTICK: USAGE = 0x04; +pub const HID_USAGE_GENERIC_GAMEPAD: USAGE = 0x05; +pub const HID_USAGE_GENERIC_KEYBOARD: USAGE = 0x06; +pub const HID_USAGE_GENERIC_KEYPAD: USAGE = 0x07; +pub const HID_USAGE_GENERIC_PORTABLE_DEVICE_CONTROL: USAGE = 0x0D; +pub const HID_USAGE_GENERIC_SYSTEM_CTL: USAGE = 0x80; +pub const HID_USAGE_GENERIC_X: USAGE = 0x30; +pub const HID_USAGE_GENERIC_Y: USAGE = 0x31; +pub const HID_USAGE_GENERIC_Z: USAGE = 0x32; +pub const HID_USAGE_GENERIC_RX: USAGE = 0x33; +pub const HID_USAGE_GENERIC_RY: USAGE = 0x34; +pub const HID_USAGE_GENERIC_RZ: USAGE = 0x35; +pub const HID_USAGE_GENERIC_SLIDER: USAGE = 0x36; +pub const HID_USAGE_GENERIC_DIAL: USAGE = 0x37; +pub const HID_USAGE_GENERIC_WHEEL: USAGE = 0x38; +pub const HID_USAGE_GENERIC_HATSWITCH: USAGE = 0x39; +pub const HID_USAGE_GENERIC_COUNTED_BUFFER: USAGE = 0x3A; +pub const HID_USAGE_GENERIC_BYTE_COUNT: USAGE = 0x3B; +pub const HID_USAGE_GENERIC_MOTION_WAKEUP: USAGE = 0x3C; +pub const HID_USAGE_GENERIC_VX: USAGE = 0x40; +pub const HID_USAGE_GENERIC_VY: USAGE = 0x41; +pub const HID_USAGE_GENERIC_VZ: USAGE = 0x42; +pub const HID_USAGE_GENERIC_VBRX: USAGE = 0x43; +pub const HID_USAGE_GENERIC_VBRY: USAGE = 0x44; +pub const HID_USAGE_GENERIC_VBRZ: USAGE = 0x45; +pub const HID_USAGE_GENERIC_VNO: USAGE = 0x46; +pub const HID_USAGE_GENERIC_RESOLUTION_MULTIPLIER: USAGE = 0x48; +pub const HID_USAGE_GENERIC_SYSCTL_POWER: USAGE = 0x81; +pub const HID_USAGE_GENERIC_SYSCTL_SLEEP: USAGE = 0x82; +pub const HID_USAGE_GENERIC_SYSCTL_WAKE: USAGE = 0x83; +pub const HID_USAGE_GENERIC_SYSCTL_CONTEXT_MENU: USAGE = 0x84; +pub const HID_USAGE_GENERIC_SYSCTL_MAIN_MENU: USAGE = 0x85; +pub const HID_USAGE_GENERIC_SYSCTL_APP_MENU: USAGE = 0x86; +pub const HID_USAGE_GENERIC_SYSCTL_HELP_MENU: USAGE = 0x87; +pub const HID_USAGE_GENERIC_SYSCTL_MENU_EXIT: USAGE = 0x88; +pub const HID_USAGE_GENERIC_SYSCTL_MENU_SELECT: USAGE = 0x89; +pub const HID_USAGE_GENERIC_SYSCTL_MENU_RIGHT: USAGE = 0x8A; +pub const HID_USAGE_GENERIC_SYSCTL_MENU_LEFT: USAGE = 0x8B; +pub const HID_USAGE_GENERIC_SYSCTL_MENU_UP: USAGE = 0x8C; +pub const HID_USAGE_GENERIC_SYSCTL_MENU_DOWN: USAGE = 0x8D; +pub const HID_USAGE_GENERIC_SYSTEM_DISPLAY_ROTATION_LOCK_BUTTON: USAGE = 0xC9; +pub const HID_USAGE_GENERIC_SYSTEM_DISPLAY_ROTATION_LOCK_SLIDER_SWITCH: USAGE = 0xCA; +pub const HID_USAGE_GENERIC_CONTROL_ENABLE: USAGE = 0xCB; +pub const HID_USAGE_SIMULATION_RUDDER: USAGE = 0xBA; +pub const HID_USAGE_SIMULATION_THROTTLE: USAGE = 0xBB; +pub const HID_USAGE_KEYBOARD_NOEVENT: USAGE = 0x00; +pub const HID_USAGE_KEYBOARD_ROLLOVER: USAGE = 0x01; +pub const HID_USAGE_KEYBOARD_POSTFAIL: USAGE = 0x02; +pub const HID_USAGE_KEYBOARD_UNDEFINED: USAGE = 0x03; +pub const HID_USAGE_KEYBOARD_aA: USAGE = 0x04; +pub const HID_USAGE_KEYBOARD_zZ: USAGE = 0x1D; +pub const HID_USAGE_KEYBOARD_ONE: USAGE = 0x1E; +pub const HID_USAGE_KEYBOARD_ZERO: USAGE = 0x27; +pub const HID_USAGE_KEYBOARD_LCTRL: USAGE = 0xE0; +pub const HID_USAGE_KEYBOARD_LSHFT: USAGE = 0xE1; +pub const HID_USAGE_KEYBOARD_LALT: USAGE = 0xE2; +pub const HID_USAGE_KEYBOARD_LGUI: USAGE = 0xE3; +pub const HID_USAGE_KEYBOARD_RCTRL: USAGE = 0xE4; +pub const HID_USAGE_KEYBOARD_RSHFT: USAGE = 0xE5; +pub const HID_USAGE_KEYBOARD_RALT: USAGE = 0xE6; +pub const HID_USAGE_KEYBOARD_RGUI: USAGE = 0xE7; +pub const HID_USAGE_KEYBOARD_SCROLL_LOCK: USAGE = 0x47; +pub const HID_USAGE_KEYBOARD_NUM_LOCK: USAGE = 0x53; +pub const HID_USAGE_KEYBOARD_CAPS_LOCK: USAGE = 0x39; +pub const HID_USAGE_KEYBOARD_F1: USAGE = 0x3A; +pub const HID_USAGE_KEYBOARD_F2: USAGE = 0x3B; +pub const HID_USAGE_KEYBOARD_F3: USAGE = 0x3C; +pub const HID_USAGE_KEYBOARD_F4: USAGE = 0x3D; +pub const HID_USAGE_KEYBOARD_F5: USAGE = 0x3E; +pub const HID_USAGE_KEYBOARD_F6: USAGE = 0x3F; +pub const HID_USAGE_KEYBOARD_F7: USAGE = 0x40; +pub const HID_USAGE_KEYBOARD_F8: USAGE = 0x41; +pub const HID_USAGE_KEYBOARD_F9: USAGE = 0x42; +pub const HID_USAGE_KEYBOARD_F10: USAGE = 0x43; +pub const HID_USAGE_KEYBOARD_F11: USAGE = 0x44; +pub const HID_USAGE_KEYBOARD_F12: USAGE = 0x45; +pub const HID_USAGE_KEYBOARD_F13: USAGE = 0x68; +pub const HID_USAGE_KEYBOARD_F14: USAGE = 0x69; +pub const HID_USAGE_KEYBOARD_F15: USAGE = 0x6A; +pub const HID_USAGE_KEYBOARD_F16: USAGE = 0x6B; +pub const HID_USAGE_KEYBOARD_F17: USAGE = 0x6C; +pub const HID_USAGE_KEYBOARD_F18: USAGE = 0x6D; +pub const HID_USAGE_KEYBOARD_F19: USAGE = 0x6E; +pub const HID_USAGE_KEYBOARD_F20: USAGE = 0x6F; +pub const HID_USAGE_KEYBOARD_F21: USAGE = 0x70; +pub const HID_USAGE_KEYBOARD_F22: USAGE = 0x71; +pub const HID_USAGE_KEYBOARD_F23: USAGE = 0x72; +pub const HID_USAGE_KEYBOARD_F24: USAGE = 0x73; +pub const HID_USAGE_KEYBOARD_RETURN: USAGE = 0x28; +pub const HID_USAGE_KEYBOARD_ESCAPE: USAGE = 0x29; +pub const HID_USAGE_KEYBOARD_DELETE: USAGE = 0x2A; +pub const HID_USAGE_KEYBOARD_PRINT_SCREEN: USAGE = 0x46; +pub const HID_USAGE_KEYBOARD_DELETE_FORWARD: USAGE = 0x4C; +pub const HID_USAGE_LED_NUM_LOCK: USAGE = 0x01; +pub const HID_USAGE_LED_CAPS_LOCK: USAGE = 0x02; +pub const HID_USAGE_LED_SCROLL_LOCK: USAGE = 0x03; +pub const HID_USAGE_LED_COMPOSE: USAGE = 0x04; +pub const HID_USAGE_LED_KANA: USAGE = 0x05; +pub const HID_USAGE_LED_POWER: USAGE = 0x06; +pub const HID_USAGE_LED_SHIFT: USAGE = 0x07; +pub const HID_USAGE_LED_DO_NOT_DISTURB: USAGE = 0x08; +pub const HID_USAGE_LED_MUTE: USAGE = 0x09; +pub const HID_USAGE_LED_TONE_ENABLE: USAGE = 0x0A; +pub const HID_USAGE_LED_HIGH_CUT_FILTER: USAGE = 0x0B; +pub const HID_USAGE_LED_LOW_CUT_FILTER: USAGE = 0x0C; +pub const HID_USAGE_LED_EQUALIZER_ENABLE: USAGE = 0x0D; +pub const HID_USAGE_LED_SOUND_FIELD_ON: USAGE = 0x0E; +pub const HID_USAGE_LED_SURROUND_FIELD_ON: USAGE = 0x0F; +pub const HID_USAGE_LED_REPEAT: USAGE = 0x10; +pub const HID_USAGE_LED_STEREO: USAGE = 0x11; +pub const HID_USAGE_LED_SAMPLING_RATE_DETECT: USAGE = 0x12; +pub const HID_USAGE_LED_SPINNING: USAGE = 0x13; +pub const HID_USAGE_LED_CAV: USAGE = 0x14; +pub const HID_USAGE_LED_CLV: USAGE = 0x15; +pub const HID_USAGE_LED_RECORDING_FORMAT_DET: USAGE = 0x16; +pub const HID_USAGE_LED_OFF_HOOK: USAGE = 0x17; +pub const HID_USAGE_LED_RING: USAGE = 0x18; +pub const HID_USAGE_LED_MESSAGE_WAITING: USAGE = 0x19; +pub const HID_USAGE_LED_DATA_MODE: USAGE = 0x1A; +pub const HID_USAGE_LED_BATTERY_OPERATION: USAGE = 0x1B; +pub const HID_USAGE_LED_BATTERY_OK: USAGE = 0x1C; +pub const HID_USAGE_LED_BATTERY_LOW: USAGE = 0x1D; +pub const HID_USAGE_LED_SPEAKER: USAGE = 0x1E; +pub const HID_USAGE_LED_HEAD_SET: USAGE = 0x1F; +pub const HID_USAGE_LED_HOLD: USAGE = 0x20; +pub const HID_USAGE_LED_MICROPHONE: USAGE = 0x21; +pub const HID_USAGE_LED_COVERAGE: USAGE = 0x22; +pub const HID_USAGE_LED_NIGHT_MODE: USAGE = 0x23; +pub const HID_USAGE_LED_SEND_CALLS: USAGE = 0x24; +pub const HID_USAGE_LED_CALL_PICKUP: USAGE = 0x25; +pub const HID_USAGE_LED_CONFERENCE: USAGE = 0x26; +pub const HID_USAGE_LED_STAND_BY: USAGE = 0x27; +pub const HID_USAGE_LED_CAMERA_ON: USAGE = 0x28; +pub const HID_USAGE_LED_CAMERA_OFF: USAGE = 0x29; +pub const HID_USAGE_LED_ON_LINE: USAGE = 0x2A; +pub const HID_USAGE_LED_OFF_LINE: USAGE = 0x2B; +pub const HID_USAGE_LED_BUSY: USAGE = 0x2C; +pub const HID_USAGE_LED_READY: USAGE = 0x2D; +pub const HID_USAGE_LED_PAPER_OUT: USAGE = 0x2E; +pub const HID_USAGE_LED_PAPER_JAM: USAGE = 0x2F; +pub const HID_USAGE_LED_REMOTE: USAGE = 0x30; +pub const HID_USAGE_LED_FORWARD: USAGE = 0x31; +pub const HID_USAGE_LED_REVERSE: USAGE = 0x32; +pub const HID_USAGE_LED_STOP: USAGE = 0x33; +pub const HID_USAGE_LED_REWIND: USAGE = 0x34; +pub const HID_USAGE_LED_FAST_FORWARD: USAGE = 0x35; +pub const HID_USAGE_LED_PLAY: USAGE = 0x36; +pub const HID_USAGE_LED_PAUSE: USAGE = 0x37; +pub const HID_USAGE_LED_RECORD: USAGE = 0x38; +pub const HID_USAGE_LED_ERROR: USAGE = 0x39; +pub const HID_USAGE_LED_SELECTED_INDICATOR: USAGE = 0x3A; +pub const HID_USAGE_LED_IN_USE_INDICATOR: USAGE = 0x3B; +pub const HID_USAGE_LED_MULTI_MODE_INDICATOR: USAGE = 0x3C; +pub const HID_USAGE_LED_INDICATOR_ON: USAGE = 0x3D; +pub const HID_USAGE_LED_INDICATOR_FLASH: USAGE = 0x3E; +pub const HID_USAGE_LED_INDICATOR_SLOW_BLINK: USAGE = 0x3F; +pub const HID_USAGE_LED_INDICATOR_FAST_BLINK: USAGE = 0x40; +pub const HID_USAGE_LED_INDICATOR_OFF: USAGE = 0x41; +pub const HID_USAGE_LED_FLASH_ON_TIME: USAGE = 0x42; +pub const HID_USAGE_LED_SLOW_BLINK_ON_TIME: USAGE = 0x43; +pub const HID_USAGE_LED_SLOW_BLINK_OFF_TIME: USAGE = 0x44; +pub const HID_USAGE_LED_FAST_BLINK_ON_TIME: USAGE = 0x45; +pub const HID_USAGE_LED_FAST_BLINK_OFF_TIME: USAGE = 0x46; +pub const HID_USAGE_LED_INDICATOR_COLOR: USAGE = 0x47; +pub const HID_USAGE_LED_RED: USAGE = 0x48; +pub const HID_USAGE_LED_GREEN: USAGE = 0x49; +pub const HID_USAGE_LED_AMBER: USAGE = 0x4A; +pub const HID_USAGE_LED_GENERIC_INDICATOR: USAGE = 0x4B; +pub const HID_USAGE_TELEPHONY_PHONE: USAGE = 0x01; +pub const HID_USAGE_TELEPHONY_ANSWERING_MACHINE: USAGE = 0x02; +pub const HID_USAGE_TELEPHONY_MESSAGE_CONTROLS: USAGE = 0x03; +pub const HID_USAGE_TELEPHONY_HANDSET: USAGE = 0x04; +pub const HID_USAGE_TELEPHONY_HEADSET: USAGE = 0x05; +pub const HID_USAGE_TELEPHONY_KEYPAD: USAGE = 0x06; +pub const HID_USAGE_TELEPHONY_PROGRAMMABLE_BUTTON: USAGE = 0x07; +pub const HID_USAGE_TELEPHONY_REDIAL: USAGE = 0x24; +pub const HID_USAGE_TELEPHONY_TRANSFER: USAGE = 0x25; +pub const HID_USAGE_TELEPHONY_DROP: USAGE = 0x26; +pub const HID_USAGE_TELEPHONY_LINE: USAGE = 0x2A; +pub const HID_USAGE_TELEPHONY_RING_ENABLE: USAGE = 0x2D; +pub const HID_USAGE_TELEPHONY_SEND: USAGE = 0x31; +pub const HID_USAGE_TELEPHONY_KEYPAD_0: USAGE = 0xB0; +pub const HID_USAGE_TELEPHONY_KEYPAD_D: USAGE = 0xBF; +pub const HID_USAGE_TELEPHONY_HOST_AVAILABLE: USAGE = 0xF1; +pub const HID_USAGE_CONSUMERCTRL: USAGE = 0x01; +pub const HID_USAGE_CONSUMER_CHANNEL_INCREMENT: USAGE = 0x9C; +pub const HID_USAGE_CONSUMER_CHANNEL_DECREMENT: USAGE = 0x9D; +pub const HID_USAGE_CONSUMER_PLAY: USAGE = 0xB0; +pub const HID_USAGE_CONSUMER_PAUSE: USAGE = 0xB1; +pub const HID_USAGE_CONSUMER_RECORD: USAGE = 0xB2; +pub const HID_USAGE_CONSUMER_FAST_FORWARD: USAGE = 0xB3; +pub const HID_USAGE_CONSUMER_REWIND: USAGE = 0xB4; +pub const HID_USAGE_CONSUMER_SCAN_NEXT_TRACK: USAGE = 0xB5; +pub const HID_USAGE_CONSUMER_SCAN_PREV_TRACK: USAGE = 0xB6; +pub const HID_USAGE_CONSUMER_STOP: USAGE = 0xB7; +pub const HID_USAGE_CONSUMER_PLAY_PAUSE: USAGE = 0xCD; +pub const HID_USAGE_CONSUMER_VOLUME: USAGE = 0xE0; +pub const HID_USAGE_CONSUMER_BALANCE: USAGE = 0xE1; +pub const HID_USAGE_CONSUMER_MUTE: USAGE = 0xE2; +pub const HID_USAGE_CONSUMER_BASS: USAGE = 0xE3; +pub const HID_USAGE_CONSUMER_TREBLE: USAGE = 0xE4; +pub const HID_USAGE_CONSUMER_BASS_BOOST: USAGE = 0xE5; +pub const HID_USAGE_CONSUMER_SURROUND_MODE: USAGE = 0xE6; +pub const HID_USAGE_CONSUMER_LOUDNESS: USAGE = 0xE7; +pub const HID_USAGE_CONSUMER_MPX: USAGE = 0xE8; +pub const HID_USAGE_CONSUMER_VOLUME_INCREMENT: USAGE = 0xE9; +pub const HID_USAGE_CONSUMER_VOLUME_DECREMENT: USAGE = 0xEA; +pub const HID_USAGE_CONSUMER_BASS_INCREMENT: USAGE = 0x152; +pub const HID_USAGE_CONSUMER_BASS_DECREMENT: USAGE = 0x153; +pub const HID_USAGE_CONSUMER_TREBLE_INCREMENT: USAGE = 0x154; +pub const HID_USAGE_CONSUMER_TREBLE_DECREMENT: USAGE = 0x155; +pub const HID_USAGE_CONSUMER_AL_CONFIGURATION: USAGE = 0x183; +pub const HID_USAGE_CONSUMER_AL_EMAIL: USAGE = 0x18A; +pub const HID_USAGE_CONSUMER_AL_CALCULATOR: USAGE = 0x192; +pub const HID_USAGE_CONSUMER_AL_BROWSER: USAGE = 0x194; +pub const HID_USAGE_CONSUMER_AC_SEARCH: USAGE = 0x221; +pub const HID_USAGE_CONSUMER_AC_GOTO: USAGE = 0x222; +pub const HID_USAGE_CONSUMER_AC_HOME: USAGE = 0x223; +pub const HID_USAGE_CONSUMER_AC_BACK: USAGE = 0x224; +pub const HID_USAGE_CONSUMER_AC_FORWARD: USAGE = 0x225; +pub const HID_USAGE_CONSUMER_AC_STOP: USAGE = 0x226; +pub const HID_USAGE_CONSUMER_AC_REFRESH: USAGE = 0x227; +pub const HID_USAGE_CONSUMER_AC_PREVIOUS: USAGE = 0x228; +pub const HID_USAGE_CONSUMER_AC_NEXT: USAGE = 0x229; +pub const HID_USAGE_CONSUMER_AC_BOOKMARKS: USAGE = 0x22A; +pub const HID_USAGE_CONSUMER_AC_PAN: USAGE = 0x238; +pub const HID_USAGE_CONSUMER_EXTENDED_KEYBOARD_ATTRIBUTES_COLLECTION: USAGE = 0x2C0; +pub const HID_USAGE_CONSUMER_KEYBOARD_FORM_FACTOR: USAGE = 0x2C1; +pub const HID_USAGE_CONSUMER_KEYBOARD_KEY_TYPE: USAGE = 0x2C2; +pub const HID_USAGE_CONSUMER_KEYBOARD_PHYSICAL_LAYOUT: USAGE = 0x2C3; +pub const HID_USAGE_CONSUMER_VENDOR_SPECIFIC_KEYBOARD_PHYSICAL_LAYOUT: USAGE = 0x2C4; +pub const HID_USAGE_CONSUMER_KEYBOARD_IETF_LANGUAGE_TAG_INDEX: USAGE = 0x2C5; +pub const HID_USAGE_CONSUMER_IMPLEMENTED_KEYBOARD_INPUT_ASSIST_CONTROLS: USAGE = 0x2C6; +pub const HID_USAGE_DIGITIZER_PEN: USAGE = 0x02; +pub const HID_USAGE_DIGITIZER_IN_RANGE: USAGE = 0x32; +pub const HID_USAGE_DIGITIZER_TIP_SWITCH: USAGE = 0x42; +pub const HID_USAGE_DIGITIZER_BARREL_SWITCH: USAGE = 0x44; +pub const HID_USAGE_CAMERA_AUTO_FOCUS: USAGE = 0x20; +pub const HID_USAGE_CAMERA_SHUTTER: USAGE = 0x21; +pub const HID_USAGE_MS_BTH_HF_DIALNUMBER: USAGE = 0x21; +pub const HID_USAGE_MS_BTH_HF_DIALMEMORY: USAGE = 0x22; diff --git a/bash-5.1/vendor/winapi/src/shared/ifdef.rs b/bash-5.1/vendor/winapi/src/shared/ifdef.rs new file mode 100644 index 0000000000000000000000000000000000000000..fa1e1bcef807cf9557352a14d42704ed6a919d95 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ifdef.rs @@ -0,0 +1,208 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{UINT16, UINT32, ULONG32, ULONG64}; +use shared::guiddef::GUID; +use shared::ntdef::{BOOLEAN, UCHAR, ULONG, USHORT, WCHAR}; +pub type NET_IF_COMPARTMENT_ID = UINT32; +pub type PNET_IF_COMPARTMENT_ID = *mut NET_IF_COMPARTMENT_ID; +pub const NET_IF_COMPARTMENT_ID_UNSPECIFIED: NET_IF_COMPARTMENT_ID = 0; +pub const NET_IF_COMPARTMENT_ID_PRIMARY: NET_IF_COMPARTMENT_ID = 1; +pub type NET_IF_NETWORK_GUID = GUID; +pub type PNET_IF_NETWORK_GUID = *mut NET_IF_NETWORK_GUID; +ENUM!{enum NET_IF_OPER_STATUS { + NET_IF_OPER_STATUS_UP = 1, + NET_IF_OPER_STATUS_DOWN = 2, + NET_IF_OPER_STATUS_TESTING = 3, + NET_IF_OPER_STATUS_UNKNOWN = 4, + NET_IF_OPER_STATUS_DORMANT = 5, + NET_IF_OPER_STATUS_NOT_PRESENT = 6, + NET_IF_OPER_STATUS_LOWER_LAYER_DOWN = 7, +}} +pub type PNET_IF_OPER_STATUS = *mut NET_IF_OPER_STATUS; +pub type NET_IF_OBJECT_ID = ULONG32; +pub type PNET_IF_OBJECT_ID = *mut NET_IF_OBJECT_ID; +ENUM!{enum NET_IF_ADMIN_STATUS { + NET_IF_ADMIN_STATUS_UP = 1, + NET_IF_ADMIN_STATUS_DOWN = 2, + NET_IF_ADMIN_STATUS_TESTING = 3, +}} +pub type PNET_IF_ADMIN_STATUS = *mut NET_IF_ADMIN_STATUS; +pub type NET_IF_COMPARTMENT_SCOPE = UINT32; +pub type PNET_IF_COMPARTMENT_SCOPE = *mut NET_IF_COMPARTMENT_SCOPE; +pub const NET_IF_COMPARTMENT_SCOPE_UNSPECIFIED: NET_IF_COMPARTMENT_SCOPE = 0; +pub const NET_IF_COMPARTMENT_SCOPE_ALL: NET_IF_COMPARTMENT_SCOPE = -1i32 as u32; +ENUM!{enum NET_IF_RCV_ADDRESS_TYPE { + NET_IF_RCV_ADDRESS_TYPE_OTHER = 1, + NET_IF_RCV_ADDRESS_TYPE_VOLATILE = 2, + NET_IF_RCV_ADDRESS_TYPE_NON_VOLATILE = 3, +}} +pub type PNET_IF_RCV_ADDRESS_TYPE = *mut NET_IF_RCV_ADDRESS_TYPE; +STRUCT!{struct NET_IF_RCV_ADDRESS_LH { + ifRcvAddressType: NET_IF_RCV_ADDRESS_TYPE, + ifRcvAddressLength: USHORT, + ifRcvAddressOffset: USHORT, +}} +pub type PNET_IF_RCV_ADDRESS_LH = *mut NET_IF_RCV_ADDRESS_LH; +STRUCT!{struct NET_IF_ALIAS_LH { + ifAliasLength: USHORT, + ifAliasOffset: USHORT, +}} +pub type PNET_IF_ALIAS_LH = *mut NET_IF_ALIAS_LH; +// FIXME: Switch to union version in 0.4 +// STRUCT!{struct NET_LUID_LH_Info { +// bitfield: ULONG64, +// }} +// BITFIELD!{NET_LUID_LH_Info bitfield: ULONG64 [ +// Reserved set_Reserved[0..24], +// NetLuidIndex set_NetLuidIndex[24..48], +// IfType set_IfType[48..64], +// ]} +// UNION!{struct NET_LUID_LH { +// [u64; 1], +// Value Value_mut: ULONG64, +// Info Info_mut: NET_LUID_LH_Info, +// }} +STRUCT!{struct NET_LUID_LH { + Value: ULONG64, +}} +BITFIELD!{NET_LUID_LH Value: ULONG64 [ + Reserved set_Reserved[0..24], + NetLuidIndex set_NetLuidIndex[24..48], + IfType set_IfType[48..64], +]} +pub type PNET_LUID_LH = *mut NET_LUID_LH; +pub type NET_IF_RCV_ADDRESS = NET_IF_RCV_ADDRESS_LH; +pub type PNET_IF_RCV_ADDRESS = *mut NET_IF_RCV_ADDRESS; +pub type NET_IF_ALIAS = NET_IF_ALIAS_LH; +pub type PNET_IF_ALIAS = *mut NET_IF_ALIAS; +pub type NET_LUID = NET_LUID_LH; +pub type PNET_LUID = *mut NET_LUID; +pub type IF_LUID = NET_LUID; +pub type PIF_LUID = *mut NET_LUID; +pub type NET_IFINDEX = ULONG; +pub type PNET_IFINDEX = *mut NET_IFINDEX; +pub type NET_IFTYPE = UINT16; +pub type PNET_IFTYPE = *mut NET_IFTYPE; +pub type IF_INDEX = NET_IFINDEX; +pub type PIF_INDEX = *mut NET_IFINDEX; +ENUM!{enum NET_IF_CONNECTION_TYPE { + NET_IF_CONNECTION_DEDICATED = 1, + NET_IF_CONNECTION_PASSIVE = 2, + NET_IF_CONNECTION_DEMAND = 3, + NET_IF_CONNECTION_MAXIMUM = 4, +}} +pub type PNET_IF_CONNECTION_TYPE = *mut NET_IF_CONNECTION_TYPE; +ENUM!{enum TUNNEL_TYPE { + TUNNEL_TYPE_NONE = 0, + TUNNEL_TYPE_OTHER = 1, + TUNNEL_TYPE_DIRECT = 2, + TUNNEL_TYPE_6TO4 = 11, + TUNNEL_TYPE_ISATAP = 13, + TUNNEL_TYPE_TEREDO = 14, + TUNNEL_TYPE_IPHTTPS = 15, +}} +pub type PTUNNEL_TYPE = *mut TUNNEL_TYPE; +ENUM!{enum NET_IF_ACCESS_TYPE { + NET_IF_ACCESS_LOOPBACK = 1, + NET_IF_ACCESS_BROADCAST = 2, + NET_IF_ACCESS_POINT_TO_POINT = 3, + NET_IF_ACCESS_POINT_TO_MULTI_POINT = 4, + NET_IF_ACCESS_MAXIMUM = 5, +}} +pub type PNET_IF_ACCESS_TYPE = *mut NET_IF_ACCESS_TYPE; +ENUM!{enum NET_IF_DIRECTION_TYPE { + NET_IF_DIRECTION_SENDRECEIVE, + NET_IF_DIRECTION_SENDONLY, + NET_IF_DIRECTION_RECEIVEONLY, + NET_IF_DIRECTION_MAXIMUM, +}} +pub type PNET_IF_DIRECTION_TYPE = *mut NET_IF_DIRECTION_TYPE; +ENUM!{enum NET_IF_MEDIA_CONNECT_STATE { + MediaConnectStateUnknown, + MediaConnectStateConnected, + MediaConnectStateDisconnected, +}} +pub type PNET_IF_MEDIA_CONNECT_STATE = *mut NET_IF_MEDIA_CONNECT_STATE; +ENUM!{enum NET_IF_MEDIA_DUPLEX_STATE { + MediaDuplexStateUnknown = 0, + MediaDuplexStateHalf = 1, + MediaDuplexStateFull = 2, +}} +pub type PNET_IF_MEDIA_DUPLEX_STATE = *mut NET_IF_MEDIA_DUPLEX_STATE; +STRUCT!{struct NET_PHYSICAL_LOCATION_LH { + BusNumber: ULONG, + SlotNumber: ULONG, + FunctionNumber: ULONG, +}} +pub type PNET_PHYSICAL_LOCATION_LH = *mut NET_PHYSICAL_LOCATION_LH; +pub const IF_MAX_STRING_SIZE: usize = 256; +pub const IF_MAX_PHYS_ADDRESS_LENGTH: usize = 32; +STRUCT!{struct IF_COUNTED_STRING_LH { + Length: USHORT, + String: [WCHAR; IF_MAX_STRING_SIZE + 1], +}} +pub type PIF_COUNTED_STRING_LH = *mut IF_COUNTED_STRING_LH; +STRUCT!{struct IF_PHYSICAL_ADDRESS_LH { + Length: USHORT, + Address: [UCHAR; IF_MAX_PHYS_ADDRESS_LENGTH], +}} +pub type PIF_PHYSICAL_ADDRESS_LH = *mut IF_PHYSICAL_ADDRESS_LH; +pub type NET_PHYSICAL_LOCATION = NET_PHYSICAL_LOCATION_LH; +pub type PNET_PHYSICAL_LOCATION = *mut NET_PHYSICAL_LOCATION; +pub type IF_COUNTED_STRING = IF_COUNTED_STRING_LH; +pub type PIF_COUNTED_STRING = *mut IF_COUNTED_STRING; +pub type IF_PHYSICAL_ADDRESS = IF_PHYSICAL_ADDRESS_LH; +pub type PIF_PHYSICAL_ADDRESS = *mut IF_PHYSICAL_ADDRESS; +ENUM!{enum IF_ADMINISTRATIVE_STATE { + IF_ADMINISTRATIVE_DISABLED = 0, + IF_ADMINISTRATIVE_ENABLED = 1, + IF_ADMINISTRATIVE_DEMANDDIAL = 2, +}} +pub type PIF_ADMINISTRATIVE_STATE = *mut IF_ADMINISTRATIVE_STATE; +ENUM!{enum IF_OPER_STATUS { + IfOperStatusUp = 1, + IfOperStatusDown, + IfOperStatusTesting, + IfOperStatusUnknown, + IfOperStatusDormant, + IfOperStatusNotPresent, + IfOperStatusLowerLayerDown, +}} +STRUCT!{struct NDIS_INTERFACE_INFORMATION { + ifOperStatus: NET_IF_OPER_STATUS, + ifOperStatusFlags: ULONG, + MediaConnectState: NET_IF_MEDIA_CONNECT_STATE, + MediaDuplexState: NET_IF_MEDIA_DUPLEX_STATE, + ifMtu: ULONG, + ifPromiscuousMode: BOOLEAN, + ifDeviceWakeUpEnable: BOOLEAN, + XmitLinkSpeed: ULONG64, + RcvLinkSpeed: ULONG64, + ifLastChange: ULONG64, + ifCounterDiscontinuityTime: ULONG64, + ifInUnknownProtos: ULONG64, + ifInDiscards: ULONG64, + ifInErrors: ULONG64, + ifHCInOctets: ULONG64, + ifHCInUcastPkts: ULONG64, + ifHCInMulticastPkts: ULONG64, + ifHCInBroadcastPkts: ULONG64, + ifHCOutOctets: ULONG64, + ifHCOutUcastPkts: ULONG64, + ifHCOutMulticastPkts: ULONG64, + ifHCOutBroadcastPkts: ULONG64, + ifOutErrors: ULONG64, + ifOutDiscards: ULONG64, + ifHCInUcastOctets: ULONG64, + ifHCInMulticastOctets: ULONG64, + ifHCInBroadcastOctets: ULONG64, + ifHCOutUcastOctets: ULONG64, + ifHCOutMulticastOctets: ULONG64, + ifHCOutBroadcastOctets: ULONG64, + CompartmentId: NET_IF_COMPARTMENT_ID, + SupportedStatistics: ULONG, +}} +pub type PNDIS_INTERFACE_INFORMATION = *mut NDIS_INTERFACE_INFORMATION; diff --git a/bash-5.1/vendor/winapi/src/shared/ifmib.rs b/bash-5.1/vendor/winapi/src/shared/ifmib.rs new file mode 100644 index 0000000000000000000000000000000000000000..855b147f61fdd4011e4229cae0855deab558de79 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ifmib.rs @@ -0,0 +1,53 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Contains the public definitions and structures for the non-TCP/IP specific parts of MIB-II. +// #include +// #include +use shared::ifdef::IF_INDEX; +use shared::ipifcons::{IFTYPE, INTERNAL_IF_OPER_STATUS}; +use shared::minwindef::DWORD; +use shared::ntdef::{UCHAR, WCHAR}; +const ANY_SIZE: usize = 1; +STRUCT!{struct MIB_IFNUMBER { + dwValue: DWORD, +}} +pub type PMIB_IFNUMBER = *mut MIB_IFNUMBER; +pub const MAXLEN_PHYSADDR: usize = 8; +pub const MAXLEN_IFDESCR: usize = 256; +pub const MAX_INTERFACE_NAME_LEN: usize = 256; +STRUCT!{struct MIB_IFROW { + wszName: [WCHAR; MAX_INTERFACE_NAME_LEN], + dwIndex: IF_INDEX, + dwType: IFTYPE, + dwMtu: DWORD, + dwSpeed: DWORD, + dwPhysAddrLen: DWORD, + bPhysAddr: [UCHAR; MAXLEN_PHYSADDR], + dwAdminStatus: DWORD, + dwOperStatus: INTERNAL_IF_OPER_STATUS, + dwLastChange: DWORD, + dwInOctets: DWORD, + dwInUcastPkts: DWORD, + dwInNUcastPkts: DWORD, + dwInDiscards: DWORD, + dwInErrors: DWORD, + dwInUnknownProtos: DWORD, + dwOutOctets: DWORD, + dwOutUcastPkts: DWORD, + dwOutNUcastPkts: DWORD, + dwOutDiscards: DWORD, + dwOutErrors: DWORD, + dwOutQLen: DWORD, + dwDescrLen: DWORD, + bDescr: [UCHAR; MAXLEN_IFDESCR], +}} +pub type PMIB_IFROW = *mut MIB_IFROW; +STRUCT!{struct MIB_IFTABLE { + dwNumEntries: DWORD, + table: [MIB_IFROW; ANY_SIZE], +}} +pub type PMIB_IFTABLE = *mut MIB_IFTABLE; +// FIXME: SIZEOF_IFTABLE(x) diff --git a/bash-5.1/vendor/winapi/src/shared/in6addr.rs b/bash-5.1/vendor/winapi/src/shared/in6addr.rs new file mode 100644 index 0000000000000000000000000000000000000000..ea7eb75bec75b9f49f32f154e89b573c8a105e16 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/in6addr.rs @@ -0,0 +1,18 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! IPv6 Internet address, 'on-wire' format structure. +use shared::minwindef::{UCHAR, USHORT}; +UNION!{union in6_addr_u { + [u16; 8], + Byte Byte_mut: [UCHAR; 16], + Word Word_mut: [USHORT; 8], +}} +STRUCT!{struct in6_addr { + u: in6_addr_u, +}} +pub type IN6_ADDR = in6_addr; +pub type PIN6_ADDR = *mut IN6_ADDR; +pub type LPIN6_ADDR = *mut IN6_ADDR; diff --git a/bash-5.1/vendor/winapi/src/shared/inaddr.rs b/bash-5.1/vendor/winapi/src/shared/inaddr.rs new file mode 100644 index 0000000000000000000000000000000000000000..830dd0505dddd7223738bfd84ab0469cf18409d5 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/inaddr.rs @@ -0,0 +1,29 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! IPv4 Internet address, 'on-wire' format structure. +use shared::minwindef::{UCHAR, ULONG, USHORT}; +STRUCT!{struct in_addr_S_un_b { + s_b1: UCHAR, + s_b2: UCHAR, + s_b3: UCHAR, + s_b4: UCHAR, +}} +STRUCT!{struct in_addr_S_un_w { + s_w1: USHORT, + s_w2: USHORT, +}} +UNION!{union in_addr_S_un { + [u32; 1], + S_un_b S_un_b_mut: in_addr_S_un_b, + S_un_w S_un_w_mut: in_addr_S_un_w, + S_addr S_addr_mut: ULONG, +}} +STRUCT!{struct in_addr { + S_un: in_addr_S_un, +}} +pub type IN_ADDR = in_addr; +pub type PIN_ADDR = *mut in_addr; +pub type LPIN_ADDR = *mut in_addr; diff --git a/bash-5.1/vendor/winapi/src/shared/intsafe.rs b/bash-5.1/vendor/winapi/src/shared/intsafe.rs new file mode 100644 index 0000000000000000000000000000000000000000..916dc0e1aa0c1a425bdf6452d773bd1dfdc17bc5 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/intsafe.rs @@ -0,0 +1,5 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. diff --git a/bash-5.1/vendor/winapi/src/shared/ipifcons.rs b/bash-5.1/vendor/winapi/src/shared/ipifcons.rs new file mode 100644 index 0000000000000000000000000000000000000000..c500e2cec5690e693d584f4bc084149a21bf83bd --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ipifcons.rs @@ -0,0 +1,244 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Constants needed for the Interface Object +// #include +use shared::minwindef::ULONG; +pub type IFTYPE = ULONG; +pub const MIN_IF_TYPE: IFTYPE = 1; +pub const IF_TYPE_OTHER: IFTYPE = 1; +pub const IF_TYPE_REGULAR_1822: IFTYPE = 2; +pub const IF_TYPE_HDH_1822: IFTYPE = 3; +pub const IF_TYPE_DDN_X25: IFTYPE = 4; +pub const IF_TYPE_RFC877_X25: IFTYPE = 5; +pub const IF_TYPE_ETHERNET_CSMACD: IFTYPE = 6; +pub const IF_TYPE_IS088023_CSMACD: IFTYPE = 7; +pub const IF_TYPE_ISO88024_TOKENBUS: IFTYPE = 8; +pub const IF_TYPE_ISO88025_TOKENRING: IFTYPE = 9; +pub const IF_TYPE_ISO88026_MAN: IFTYPE = 10; +pub const IF_TYPE_STARLAN: IFTYPE = 11; +pub const IF_TYPE_PROTEON_10MBIT: IFTYPE = 12; +pub const IF_TYPE_PROTEON_80MBIT: IFTYPE = 13; +pub const IF_TYPE_HYPERCHANNEL: IFTYPE = 14; +pub const IF_TYPE_FDDI: IFTYPE = 15; +pub const IF_TYPE_LAP_B: IFTYPE = 16; +pub const IF_TYPE_SDLC: IFTYPE = 17; +pub const IF_TYPE_DS1: IFTYPE = 18; +pub const IF_TYPE_E1: IFTYPE = 19; +pub const IF_TYPE_BASIC_ISDN: IFTYPE = 20; +pub const IF_TYPE_PRIMARY_ISDN: IFTYPE = 21; +pub const IF_TYPE_PROP_POINT2POINT_SERIAL: IFTYPE = 22; +pub const IF_TYPE_PPP: IFTYPE = 23; +pub const IF_TYPE_SOFTWARE_LOOPBACK: IFTYPE = 24; +pub const IF_TYPE_EON: IFTYPE = 25; +pub const IF_TYPE_ETHERNET_3MBIT: IFTYPE = 26; +pub const IF_TYPE_NSIP: IFTYPE = 27; +pub const IF_TYPE_SLIP: IFTYPE = 28; +pub const IF_TYPE_ULTRA: IFTYPE = 29; +pub const IF_TYPE_DS3: IFTYPE = 30; +pub const IF_TYPE_SIP: IFTYPE = 31; +pub const IF_TYPE_FRAMERELAY: IFTYPE = 32; +pub const IF_TYPE_RS232: IFTYPE = 33; +pub const IF_TYPE_PARA: IFTYPE = 34; +pub const IF_TYPE_ARCNET: IFTYPE = 35; +pub const IF_TYPE_ARCNET_PLUS: IFTYPE = 36; +pub const IF_TYPE_ATM: IFTYPE = 37; +pub const IF_TYPE_MIO_X25: IFTYPE = 38; +pub const IF_TYPE_SONET: IFTYPE = 39; +pub const IF_TYPE_X25_PLE: IFTYPE = 40; +pub const IF_TYPE_ISO88022_LLC: IFTYPE = 41; +pub const IF_TYPE_LOCALTALK: IFTYPE = 42; +pub const IF_TYPE_SMDS_DXI: IFTYPE = 43; +pub const IF_TYPE_FRAMERELAY_SERVICE: IFTYPE = 44; +pub const IF_TYPE_V35: IFTYPE = 45; +pub const IF_TYPE_HSSI: IFTYPE = 46; +pub const IF_TYPE_HIPPI: IFTYPE = 47; +pub const IF_TYPE_MODEM: IFTYPE = 48; +pub const IF_TYPE_AAL5: IFTYPE = 49; +pub const IF_TYPE_SONET_PATH: IFTYPE = 50; +pub const IF_TYPE_SONET_VT: IFTYPE = 51; +pub const IF_TYPE_SMDS_ICIP: IFTYPE = 52; +pub const IF_TYPE_PROP_VIRTUAL: IFTYPE = 53; +pub const IF_TYPE_PROP_MULTIPLEXOR: IFTYPE = 54; +pub const IF_TYPE_IEEE80212: IFTYPE = 55; +pub const IF_TYPE_FIBRECHANNEL: IFTYPE = 56; +pub const IF_TYPE_HIPPIINTERFACE: IFTYPE = 57; +pub const IF_TYPE_FRAMERELAY_INTERCONNECT: IFTYPE = 58; +pub const IF_TYPE_AFLANE_8023: IFTYPE = 59; +pub const IF_TYPE_AFLANE_8025: IFTYPE = 60; +pub const IF_TYPE_CCTEMUL: IFTYPE = 61; +pub const IF_TYPE_FASTETHER: IFTYPE = 62; +pub const IF_TYPE_ISDN: IFTYPE = 63; +pub const IF_TYPE_V11: IFTYPE = 64; +pub const IF_TYPE_V36: IFTYPE = 65; +pub const IF_TYPE_G703_64K: IFTYPE = 66; +pub const IF_TYPE_G703_2MB: IFTYPE = 67; +pub const IF_TYPE_QLLC: IFTYPE = 68; +pub const IF_TYPE_FASTETHER_FX: IFTYPE = 69; +pub const IF_TYPE_CHANNEL: IFTYPE = 70; +pub const IF_TYPE_IEEE80211: IFTYPE = 71; +pub const IF_TYPE_IBM370PARCHAN: IFTYPE = 72; +pub const IF_TYPE_ESCON: IFTYPE = 73; +pub const IF_TYPE_DLSW: IFTYPE = 74; +pub const IF_TYPE_ISDN_S: IFTYPE = 75; +pub const IF_TYPE_ISDN_U: IFTYPE = 76; +pub const IF_TYPE_LAP_D: IFTYPE = 77; +pub const IF_TYPE_IPSWITCH: IFTYPE = 78; +pub const IF_TYPE_RSRB: IFTYPE = 79; +pub const IF_TYPE_ATM_LOGICAL: IFTYPE = 80; +pub const IF_TYPE_DS0: IFTYPE = 81; +pub const IF_TYPE_DS0_BUNDLE: IFTYPE = 82; +pub const IF_TYPE_BSC: IFTYPE = 83; +pub const IF_TYPE_ASYNC: IFTYPE = 84; +pub const IF_TYPE_CNR: IFTYPE = 85; +pub const IF_TYPE_ISO88025R_DTR: IFTYPE = 86; +pub const IF_TYPE_EPLRS: IFTYPE = 87; +pub const IF_TYPE_ARAP: IFTYPE = 88; +pub const IF_TYPE_PROP_CNLS: IFTYPE = 89; +pub const IF_TYPE_HOSTPAD: IFTYPE = 90; +pub const IF_TYPE_TERMPAD: IFTYPE = 91; +pub const IF_TYPE_FRAMERELAY_MPI: IFTYPE = 92; +pub const IF_TYPE_X213: IFTYPE = 93; +pub const IF_TYPE_ADSL: IFTYPE = 94; +pub const IF_TYPE_RADSL: IFTYPE = 95; +pub const IF_TYPE_SDSL: IFTYPE = 96; +pub const IF_TYPE_VDSL: IFTYPE = 97; +pub const IF_TYPE_ISO88025_CRFPRINT: IFTYPE = 98; +pub const IF_TYPE_MYRINET: IFTYPE = 99; +pub const IF_TYPE_VOICE_EM: IFTYPE = 100; +pub const IF_TYPE_VOICE_FXO: IFTYPE = 101; +pub const IF_TYPE_VOICE_FXS: IFTYPE = 102; +pub const IF_TYPE_VOICE_ENCAP: IFTYPE = 103; +pub const IF_TYPE_VOICE_OVERIP: IFTYPE = 104; +pub const IF_TYPE_ATM_DXI: IFTYPE = 105; +pub const IF_TYPE_ATM_FUNI: IFTYPE = 106; +pub const IF_TYPE_ATM_IMA: IFTYPE = 107; +pub const IF_TYPE_PPPMULTILINKBUNDLE: IFTYPE = 108; +pub const IF_TYPE_IPOVER_CDLC: IFTYPE = 109; +pub const IF_TYPE_IPOVER_CLAW: IFTYPE = 110; +pub const IF_TYPE_STACKTOSTACK: IFTYPE = 111; +pub const IF_TYPE_VIRTUALIPADDRESS: IFTYPE = 112; +pub const IF_TYPE_MPC: IFTYPE = 113; +pub const IF_TYPE_IPOVER_ATM: IFTYPE = 114; +pub const IF_TYPE_ISO88025_FIBER: IFTYPE = 115; +pub const IF_TYPE_TDLC: IFTYPE = 116; +pub const IF_TYPE_GIGABITETHERNET: IFTYPE = 117; +pub const IF_TYPE_HDLC: IFTYPE = 118; +pub const IF_TYPE_LAP_F: IFTYPE = 119; +pub const IF_TYPE_V37: IFTYPE = 120; +pub const IF_TYPE_X25_MLP: IFTYPE = 121; +pub const IF_TYPE_X25_HUNTGROUP: IFTYPE = 122; +pub const IF_TYPE_TRANSPHDLC: IFTYPE = 123; +pub const IF_TYPE_INTERLEAVE: IFTYPE = 124; +pub const IF_TYPE_FAST: IFTYPE = 125; +pub const IF_TYPE_IP: IFTYPE = 126; +pub const IF_TYPE_DOCSCABLE_MACLAYER: IFTYPE = 127; +pub const IF_TYPE_DOCSCABLE_DOWNSTREAM: IFTYPE = 128; +pub const IF_TYPE_DOCSCABLE_UPSTREAM: IFTYPE = 129; +pub const IF_TYPE_A12MPPSWITCH: IFTYPE = 130; +pub const IF_TYPE_TUNNEL: IFTYPE = 131; +pub const IF_TYPE_COFFEE: IFTYPE = 132; +pub const IF_TYPE_CES: IFTYPE = 133; +pub const IF_TYPE_ATM_SUBINTERFACE: IFTYPE = 134; +pub const IF_TYPE_L2_VLAN: IFTYPE = 135; +pub const IF_TYPE_L3_IPVLAN: IFTYPE = 136; +pub const IF_TYPE_L3_IPXVLAN: IFTYPE = 137; +pub const IF_TYPE_DIGITALPOWERLINE: IFTYPE = 138; +pub const IF_TYPE_MEDIAMAILOVERIP: IFTYPE = 139; +pub const IF_TYPE_DTM: IFTYPE = 140; +pub const IF_TYPE_DCN: IFTYPE = 141; +pub const IF_TYPE_IPFORWARD: IFTYPE = 142; +pub const IF_TYPE_MSDSL: IFTYPE = 143; +pub const IF_TYPE_IEEE1394: IFTYPE = 144; +pub const IF_TYPE_IF_GSN: IFTYPE = 145; +pub const IF_TYPE_DVBRCC_MACLAYER: IFTYPE = 146; +pub const IF_TYPE_DVBRCC_DOWNSTREAM: IFTYPE = 147; +pub const IF_TYPE_DVBRCC_UPSTREAM: IFTYPE = 148; +pub const IF_TYPE_ATM_VIRTUAL: IFTYPE = 149; +pub const IF_TYPE_MPLS_TUNNEL: IFTYPE = 150; +pub const IF_TYPE_SRP: IFTYPE = 151; +pub const IF_TYPE_VOICEOVERATM: IFTYPE = 152; +pub const IF_TYPE_VOICEOVERFRAMERELAY: IFTYPE = 153; +pub const IF_TYPE_IDSL: IFTYPE = 154; +pub const IF_TYPE_COMPOSITELINK: IFTYPE = 155; +pub const IF_TYPE_SS7_SIGLINK: IFTYPE = 156; +pub const IF_TYPE_PROP_WIRELESS_P2P: IFTYPE = 157; +pub const IF_TYPE_FR_FORWARD: IFTYPE = 158; +pub const IF_TYPE_RFC1483: IFTYPE = 159; +pub const IF_TYPE_USB: IFTYPE = 160; +pub const IF_TYPE_IEEE8023AD_LAG: IFTYPE = 161; +pub const IF_TYPE_BGP_POLICY_ACCOUNTING: IFTYPE = 162; +pub const IF_TYPE_FRF16_MFR_BUNDLE: IFTYPE = 163; +pub const IF_TYPE_H323_GATEKEEPER: IFTYPE = 164; +pub const IF_TYPE_H323_PROXY: IFTYPE = 165; +pub const IF_TYPE_MPLS: IFTYPE = 166; +pub const IF_TYPE_MF_SIGLINK: IFTYPE = 167; +pub const IF_TYPE_HDSL2: IFTYPE = 168; +pub const IF_TYPE_SHDSL: IFTYPE = 169; +pub const IF_TYPE_DS1_FDL: IFTYPE = 170; +pub const IF_TYPE_POS: IFTYPE = 171; +pub const IF_TYPE_DVB_ASI_IN: IFTYPE = 172; +pub const IF_TYPE_DVB_ASI_OUT: IFTYPE = 173; +pub const IF_TYPE_PLC: IFTYPE = 174; +pub const IF_TYPE_NFAS: IFTYPE = 175; +pub const IF_TYPE_TR008: IFTYPE = 176; +pub const IF_TYPE_GR303_RDT: IFTYPE = 177; +pub const IF_TYPE_GR303_IDT: IFTYPE = 178; +pub const IF_TYPE_ISUP: IFTYPE = 179; +pub const IF_TYPE_PROP_DOCS_WIRELESS_MACLAYER: IFTYPE = 180; +pub const IF_TYPE_PROP_DOCS_WIRELESS_DOWNSTREAM: IFTYPE = 181; +pub const IF_TYPE_PROP_DOCS_WIRELESS_UPSTREAM: IFTYPE = 182; +pub const IF_TYPE_HIPERLAN2: IFTYPE = 183; +pub const IF_TYPE_PROP_BWA_P2MP: IFTYPE = 184; +pub const IF_TYPE_SONET_OVERHEAD_CHANNEL: IFTYPE = 185; +pub const IF_TYPE_DIGITAL_WRAPPER_OVERHEAD_CHANNEL: IFTYPE = 186; +pub const IF_TYPE_AAL2: IFTYPE = 187; +pub const IF_TYPE_RADIO_MAC: IFTYPE = 188; +pub const IF_TYPE_ATM_RADIO: IFTYPE = 189; +pub const IF_TYPE_IMT: IFTYPE = 190; +pub const IF_TYPE_MVL: IFTYPE = 191; +pub const IF_TYPE_REACH_DSL: IFTYPE = 192; +pub const IF_TYPE_FR_DLCI_ENDPT: IFTYPE = 193; +pub const IF_TYPE_ATM_VCI_ENDPT: IFTYPE = 194; +pub const IF_TYPE_OPTICAL_CHANNEL: IFTYPE = 195; +pub const IF_TYPE_OPTICAL_TRANSPORT: IFTYPE = 196; +pub const IF_TYPE_IEEE80216_WMAN: IFTYPE = 237; +pub const IF_TYPE_WWANPP: IFTYPE = 243; +pub const IF_TYPE_WWANPP2: IFTYPE = 244; +pub const IF_TYPE_IEEE802154: IFTYPE = 259; +pub const IF_TYPE_XBOX_WIRELESS: IFTYPE = 281; +pub const MAX_IF_TYPE: IFTYPE = 281; +ENUM!{enum IF_ACCESS_TYPE { + IF_ACCESS_LOOPBACK = 1, + IF_ACCESS_BROADCAST = 2, + IF_ACCESS_POINT_TO_POINT = 3, + IF_ACCESS_POINTTOPOINT = 3, + IF_ACCESS_POINT_TO_MULTI_POINT = 4, + IF_ACCESS_POINTTOMULTIPOINT = 4, +}} +ENUM!{enum INTERNAL_IF_OPER_STATUS { + IF_OPER_STATUS_NON_OPERATIONAL = 0, + IF_OPER_STATUS_UNREACHABLE = 1, + IF_OPER_STATUS_DISCONNECTED = 2, + IF_OPER_STATUS_CONNECTING = 3, + IF_OPER_STATUS_CONNECTED = 4, + IF_OPER_STATUS_OPERATIONAL = 5, +}} +pub const MIB_IF_TYPE_OTHER: IFTYPE = 1; +pub const MIB_IF_TYPE_ETHERNET: IFTYPE = 6; +pub const MIB_IF_TYPE_TOKENRING: IFTYPE = 9; +pub const MIB_IF_TYPE_FDDI: IFTYPE = 15; +pub const MIB_IF_TYPE_PPP: IFTYPE = 23; +pub const MIB_IF_TYPE_LOOPBACK: IFTYPE = 24; +pub const MIB_IF_TYPE_SLIP: IFTYPE = 28; +pub const MIB_IF_ADMIN_STATUS_UP: IFTYPE = 1; +pub const MIB_IF_ADMIN_STATUS_DOWN: IFTYPE = 2; +pub const MIB_IF_ADMIN_STATUS_TESTING: IFTYPE = 3; +pub const MIB_IF_OPER_STATUS_NON_OPERATIONAL: INTERNAL_IF_OPER_STATUS = 0; +pub const MIB_IF_OPER_STATUS_UNREACHABLE: INTERNAL_IF_OPER_STATUS = 1; +pub const MIB_IF_OPER_STATUS_DISCONNECTED: INTERNAL_IF_OPER_STATUS = 2; +pub const MIB_IF_OPER_STATUS_CONNECTING: INTERNAL_IF_OPER_STATUS = 3; +pub const MIB_IF_OPER_STATUS_CONNECTED: INTERNAL_IF_OPER_STATUS = 4; +pub const MIB_IF_OPER_STATUS_OPERATIONAL: INTERNAL_IF_OPER_STATUS = 5; diff --git a/bash-5.1/vendor/winapi/src/shared/ipmib.rs b/bash-5.1/vendor/winapi/src/shared/ipmib.rs new file mode 100644 index 0000000000000000000000000000000000000000..cddd8f61a41e26977d397e728cb7e33ea1bfc357 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ipmib.rs @@ -0,0 +1,381 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::ifdef::IF_INDEX; +use shared::ifmib::MAXLEN_PHYSADDR; +use shared::minwindef::DWORD; +use shared::nldef::NL_ROUTE_PROTOCOL; +use shared::ntdef::{PVOID, UCHAR, ULONG, USHORT}; +const ANY_SIZE: usize = 1; +STRUCT!{struct MIB_IPADDRROW_XP { + dwAddr: DWORD, + dwIndex: IF_INDEX, + dwMask: DWORD, + dwBCastAddr: DWORD, + dwReasmSize: DWORD, + unused1: USHORT, + wType: USHORT, +}} +pub type PMIB_IPADDRROW_XP = *mut MIB_IPADDRROW_XP; +STRUCT!{struct MIB_IPADDRROW_W2K { + dwAddr: DWORD, + dwIndex: DWORD, + dwMask: DWORD, + dwBCastAddr: DWORD, + dwReasmSize: DWORD, + unused1: USHORT, + unused2: USHORT, +}} +pub type PMIB_IPADDRROW_W2K = *mut MIB_IPADDRROW_W2K; +pub type MIB_IPADDRROW = MIB_IPADDRROW_XP; +pub type PMIB_IPADDRROW = *mut MIB_IPADDRROW; +STRUCT!{struct MIB_IPADDRTABLE { + dwNumEntries: DWORD, + table: [MIB_IPADDRROW; ANY_SIZE], +}} +pub type PMIB_IPADDRTABLE = *mut MIB_IPADDRTABLE; +// FIXME: SIZEOF_IPADDRTABLE(x) +STRUCT!{struct MIB_IPFORWARDNUMBER { + dwValue: DWORD, +}} +pub type PMIB_IPFORWARDNUMBER = *mut MIB_IPFORWARDNUMBER; +pub type MIB_IPFORWARD_PROTO = NL_ROUTE_PROTOCOL; +ENUM!{enum MIB_IPFORWARD_TYPE { + MIB_IPROUTE_TYPE_OTHER = 1, + MIB_IPROUTE_TYPE_INVALID = 2, + MIB_IPROUTE_TYPE_DIRECT = 3, + MIB_IPROUTE_TYPE_INDIRECT = 4, +}} +STRUCT!{struct MIB_IPFORWARDROW { + dwForwardDest: DWORD, + dwForwardMask: DWORD, + dwForwardPolicy: DWORD, + dwForwardNextHop: DWORD, + dwForwardIfIndex: IF_INDEX, + ForwardType: MIB_IPFORWARD_TYPE, + ForwardProto: MIB_IPFORWARD_PROTO, + dwForwardAge: DWORD, + dwForwardNextHopAS: DWORD, + dwForwardMetric1: DWORD, + dwForwardMetric2: DWORD, + dwForwardMetric3: DWORD, + dwForwardMetric4: DWORD, + dwForwardMetric5: DWORD, +}} +pub type PMIB_IPFORWARDROW = *mut MIB_IPFORWARDROW; +STRUCT!{struct MIB_IPFORWARDTABLE { + dwNumEntries: DWORD, + table: [MIB_IPFORWARDROW; ANY_SIZE], +}} +pub type PMIB_IPFORWARDTABLE = *mut MIB_IPFORWARDTABLE; +// FIXME: SIZEOF_IPFORWARDTABLE(x) +ENUM!{enum MIB_IPNET_TYPE { + MIB_IPNET_TYPE_OTHER = 1, + MIB_IPNET_TYPE_INVALID = 2, + MIB_IPNET_TYPE_DYNAMIC = 3, + MIB_IPNET_TYPE_STATIC = 4, +}} +STRUCT!{struct MIB_IPNETROW_LH { + dwIndex: IF_INDEX, + dwPhysAddrLen: DWORD, + bPhysAddr: [UCHAR; MAXLEN_PHYSADDR], + dwAddr: DWORD, + Type: MIB_IPNET_TYPE, +}} +pub type PMIB_IPNETROW_LH = *mut MIB_IPNETROW_LH; +STRUCT!{struct MIB_IPNETROW_W2K { + dwIndex: IF_INDEX, + dwPhysAddrLen: DWORD, + bPhysAddr: [UCHAR; MAXLEN_PHYSADDR], + dwAddr: DWORD, + dwType: DWORD, +}} +pub type PMIB_IPNETROW_W2K = *mut MIB_IPNETROW_W2K; +pub type MIB_IPNETROW = MIB_IPNETROW_LH; +pub type PMIB_IPNETROW = *mut MIB_IPNETROW; +STRUCT!{struct MIB_IPNETTABLE { + dwNumEntries: DWORD, + table: [MIB_IPNETROW; ANY_SIZE], +}} +pub type PMIB_IPNETTABLE = *mut MIB_IPNETTABLE; +// FIXME: SIZEOF_IPNETTABLE(x) +ENUM!{enum MIB_IPSTATS_FORWARDING { + MIB_IP_FORWARDING = 1, + MIB_IP_NOT_FORWARDING = 2, +}} +pub type PMIB_IPSTATS_FORWARDING = *mut MIB_IPSTATS_FORWARDING; +STRUCT!{struct MIB_IPSTATS_LH { + Forwarding: MIB_IPSTATS_FORWARDING, + dwDefaultTTL: DWORD, + dwInReceives: DWORD, + dwInHdrErrors: DWORD, + dwInAddrErrors: DWORD, + dwForwDatagrams: DWORD, + dwInUnknownProtos: DWORD, + dwInDiscards: DWORD, + dwInDelivers: DWORD, + dwOutRequests: DWORD, + dwRoutingDiscards: DWORD, + dwOutDiscards: DWORD, + dwOutNoRoutes: DWORD, + dwReasmTimeout: DWORD, + dwReasmReqds: DWORD, + dwReasmOks: DWORD, + dwReasmFails: DWORD, + dwFragOks: DWORD, + dwFragFails: DWORD, + dwFragCreates: DWORD, + dwNumIf: DWORD, + dwNumAddr: DWORD, + dwNumRoutes: DWORD, +}} +pub type PMIB_IPSTATS_LH = *mut MIB_IPSTATS_LH; +STRUCT!{struct MIB_IPSTATS_W2K { + dwForwarding: DWORD, + dwDefaultTTL: DWORD, + dwInReceives: DWORD, + dwInHdrErrors: DWORD, + dwInAddrErrors: DWORD, + dwForwDatagrams: DWORD, + dwInUnknownProtos: DWORD, + dwInDiscards: DWORD, + dwInDelivers: DWORD, + dwOutRequests: DWORD, + dwRoutingDiscards: DWORD, + dwOutDiscards: DWORD, + dwOutNoRoutes: DWORD, + dwReasmTimeout: DWORD, + dwReasmReqds: DWORD, + dwReasmOks: DWORD, + dwReasmFails: DWORD, + dwFragOks: DWORD, + dwFragFails: DWORD, + dwFragCreates: DWORD, + dwNumIf: DWORD, + dwNumAddr: DWORD, + dwNumRoutes: DWORD, +}} +pub type PMIB_IPSTATS_W2K = *mut MIB_IPSTATS_W2K; +pub type MIB_IPSTATS = MIB_IPSTATS_LH; +pub type PMIB_IPSTATS = *mut MIB_IPSTATS; +STRUCT!{struct MIBICMPSTATS { + dwMsgs: DWORD, + dwErrors: DWORD, + dwDestUnreachs: DWORD, + dwTimeExcds: DWORD, + dwParmProbs: DWORD, + dwSrcQuenchs: DWORD, + dwRedirects: DWORD, + dwEchos: DWORD, + dwEchoReps: DWORD, + dwTimestamps: DWORD, + dwTimestampReps: DWORD, + dwAddrMasks: DWORD, + dwAddrMaskReps: DWORD, +}} +pub type PMIBICMPSTATS = *mut MIBICMPSTATS; +STRUCT!{struct MIBICMPINFO { + icmpInStats: MIBICMPSTATS, + icmpOutStats: MIBICMPSTATS, +}} +STRUCT!{struct MIB_ICMP { + stats: MIBICMPINFO, +}} +pub type PMIB_ICMP = *mut MIB_ICMP; +STRUCT!{struct MIBICMPSTATS_EX_XPSP1 { + dwMsgs: DWORD, + dwErrors: DWORD, + rgdwTypeCount: [DWORD; 256], +}} +pub type PMIBICMPSTATS_EX_XPSP1 = *mut MIBICMPSTATS_EX_XPSP1; +pub type MIBICMPSTATS_EX = MIBICMPSTATS_EX_XPSP1; +pub type PMIBICMPSTATS_EX = *mut MIBICMPSTATS_EX_XPSP1; +STRUCT!{struct MIB_ICMP_EX_XPSP1 { + icmpInStats: MIBICMPSTATS_EX, + icmpOutStats: MIBICMPSTATS_EX, +}} +pub type PMIB_ICMP_EX_XPSP1 = *mut MIB_ICMP_EX_XPSP1; +pub type MIB_ICMP_EX = MIB_ICMP_EX_XPSP1; +pub type PMIB_ICMP_EX = *mut MIB_ICMP_EX_XPSP1; +ENUM!{enum ICMP6_TYPE { + ICMP6_DST_UNREACH = 1, + ICMP6_PACKET_TOO_BIG = 2, + ICMP6_TIME_EXCEEDED = 3, + ICMP6_PARAM_PROB = 4, + ICMP6_ECHO_REQUEST = 128, + ICMP6_ECHO_REPLY = 129, + ICMP6_MEMBERSHIP_QUERY = 130, + ICMP6_MEMBERSHIP_REPORT = 131, + ICMP6_MEMBERSHIP_REDUCTION = 132, + ND_ROUTER_SOLICIT = 133, + ND_ROUTER_ADVERT = 134, + ND_NEIGHBOR_SOLICIT = 135, + ND_NEIGHBOR_ADVERT = 136, + ND_REDIRECT = 137, + ICMP6_V2_MEMBERSHIP_REPORT = 143, +}} +pub type PICMP6_TYPE = *mut ICMP6_TYPE; +ENUM!{enum ICMP4_TYPE { + ICMP4_ECHO_REPLY = 0, + ICMP4_DST_UNREACH = 3, + ICMP4_SOURCE_QUENCH = 4, + ICMP4_REDIRECT = 5, + ICMP4_ECHO_REQUEST = 8, + ICMP4_ROUTER_ADVERT = 9, + ICMP4_ROUTER_SOLICIT = 10, + ICMP4_TIME_EXCEEDED = 11, + ICMP4_PARAM_PROB = 12, + ICMP4_TIMESTAMP_REQUEST = 13, + ICMP4_TIMESTAMP_REPLY = 14, + ICMP4_MASK_REQUEST = 17, + ICMP4_MASK_REPLY = 18, +}} +pub type PICMP4_TYPE = *mut ICMP4_TYPE; +STRUCT!{struct MIB_IPMCAST_OIF_XP { + dwOutIfIndex: DWORD, + dwNextHopAddr: DWORD, + dwReserved: DWORD, + dwReserved1: DWORD, +}} +pub type PMIB_IPMCAST_OIF_XP = *mut MIB_IPMCAST_OIF_XP; +STRUCT!{struct MIB_IPMCAST_OIF_W2K { + dwOutIfIndex: DWORD, + dwNextHopAddr: DWORD, + pvReserved: PVOID, + dwReserved: DWORD, +}} +pub type PMIB_IPMCAST_OIF_W2K = *mut MIB_IPMCAST_OIF_W2K; +pub type MIB_IPMCAST_OIF = MIB_IPMCAST_OIF_XP; +pub type PMIB_IPMCAST_OIF = *mut MIB_IPMCAST_OIF; +STRUCT!{struct MIB_IPMCAST_MFE { + dwGroup: DWORD, + dwSource: DWORD, + dwSrcMask: DWORD, + dwUpStrmNgbr: DWORD, + dwInIfIndex: DWORD, + dwInIfProtocol: DWORD, + dwRouteProtocol: DWORD, + dwRouteNetwork: DWORD, + dwRouteMask: DWORD, + ulUpTime: ULONG, + ulExpiryTime: ULONG, + ulTimeOut: ULONG, + ulNumOutIf: ULONG, + fFlags: DWORD, + dwReserved: DWORD, + rgmioOutInfo: [MIB_IPMCAST_OIF; ANY_SIZE], +}} +pub type PMIB_IPMCAST_MFE = *mut MIB_IPMCAST_MFE; +STRUCT!{struct MIB_MFE_TABLE { + dwNumEntries: DWORD, + table: [MIB_IPMCAST_MFE; ANY_SIZE], +}} +pub type PMIB_MFE_TABLE = *mut MIB_MFE_TABLE; +// FIXME: SIZEOF_BASIC_MIB_MFE +// FIXME: SIZEOF_MIB_MFE(x) +STRUCT!{struct MIB_IPMCAST_OIF_STATS_LH { + dwOutIfIndex: DWORD, + dwNextHopAddr: DWORD, + dwDialContext: DWORD, + ulTtlTooLow: ULONG, + ulFragNeeded: ULONG, + ulOutPackets: ULONG, + ulOutDiscards: ULONG, +}} +pub type PMIB_IPMCAST_OIF_STATS_LH = *mut MIB_IPMCAST_OIF_STATS_LH; +STRUCT!{struct MIB_IPMCAST_OIF_STATS_W2K { + dwOutIfIndex: DWORD, + dwNextHopAddr: DWORD, + pvDialContext: PVOID, + ulTtlTooLow: ULONG, + ulFragNeeded: ULONG, + ulOutPackets: ULONG, + ulOutDiscards: ULONG, +}} +pub type PMIB_IPMCAST_OIF_STATS_W2K = *mut MIB_IPMCAST_OIF_STATS_W2K; +pub type MIB_IPMCAST_OIF_STATS = MIB_IPMCAST_OIF_STATS_LH; +pub type PMIB_IPMCAST_OIF_STATS = *mut MIB_IPMCAST_OIF_STATS; +STRUCT!{struct MIB_IPMCAST_MFE_STATS { + dwGroup: DWORD, + dwSource: DWORD, + dwSrcMask: DWORD, + dwUpStrmNgbr: DWORD, + dwInIfIndex: DWORD, + dwInIfProtocol: DWORD, + dwRouteProtocol: DWORD, + dwRouteNetwork: DWORD, + dwRouteMask: DWORD, + ulUpTime: ULONG, + ulExpiryTime: ULONG, + ulNumOutIf: ULONG, + ulInPkts: ULONG, + ulInOctets: ULONG, + ulPktsDifferentIf: ULONG, + ulQueueOverflow: ULONG, + rgmiosOutStats: [MIB_IPMCAST_OIF_STATS; ANY_SIZE], +}} +pub type PMIB_IPMCAST_MFE_STATS = *mut MIB_IPMCAST_MFE_STATS; +STRUCT!{struct MIB_MFE_STATS_TABLE { + dwNumEntries: DWORD, + table: [MIB_IPMCAST_MFE_STATS; ANY_SIZE], +}} +pub type PMIB_MFE_STATS_TABLE = *mut MIB_MFE_STATS_TABLE; +// FIXME: SIZEOF_BASIC_MIB_MFE_STATS +// FIXME: SIZEOF_MIB_MFE_STATS(x) +STRUCT!{struct MIB_IPMCAST_MFE_STATS_EX_XP { + dwGroup: DWORD, + dwSource: DWORD, + dwSrcMask: DWORD, + dwUpStrmNgbr: DWORD, + dwInIfIndex: DWORD, + dwInIfProtocol: DWORD, + dwRouteProtocol: DWORD, + dwRouteNetwork: DWORD, + dwRouteMask: DWORD, + ulUpTime: ULONG, + ulExpiryTime: ULONG, + ulNumOutIf: ULONG, + ulInPkts: ULONG, + ulInOctets: ULONG, + ulPktsDifferentIf: ULONG, + ulQueueOverflow: ULONG, + ulUninitMfe: ULONG, + ulNegativeMfe: ULONG, + ulInDiscards: ULONG, + ulInHdrErrors: ULONG, + ulTotalOutPackets: ULONG, + rgmiosOutStats: [MIB_IPMCAST_OIF_STATS; ANY_SIZE], +}} +pub type PMIB_IPMCAST_MFE_STATS_EX_XP = *mut MIB_IPMCAST_MFE_STATS_EX_XP; +pub type MIB_IPMCAST_MFE_STATS_EX = MIB_IPMCAST_MFE_STATS_EX_XP; +pub type PMIB_IPMCAST_MFE_STATS_EX = *mut MIB_IPMCAST_MFE_STATS_EX; +STRUCT!{struct MIB_MFE_STATS_TABLE_EX_XP { + dwNumEntries: DWORD, + table: [PMIB_IPMCAST_MFE_STATS_EX_XP; ANY_SIZE], +}} +pub type PMIB_MFE_STATS_TABLE_EX_XP = *mut MIB_MFE_STATS_TABLE_EX_XP; +pub type MIB_MFE_STATS_TABLE_EX = MIB_MFE_STATS_TABLE_EX_XP; +pub type PMIB_MFE_STATS_TABLE_EX = *mut MIB_MFE_STATS_TABLE_EX; +// FIXME: SIZEOF_BASIC_MIB_MFE_STATS_EX +// FIXME: SIZEOF_MIB_MFE_STATS_EX(x) +STRUCT!{struct MIB_IPMCAST_GLOBAL { + dwEnable: DWORD, +}} +pub type PMIB_IPMCAST_GLOBAL = *mut MIB_IPMCAST_GLOBAL; +STRUCT!{struct MIB_IPMCAST_IF_ENTRY { + dwIfIndex: DWORD, + dwTtl: DWORD, + dwProtocol: DWORD, + dwRateLimit: DWORD, + ulInMcastOctets: ULONG, + ulOutMcastOctets: ULONG, +}} +pub type PMIB_IPMCAST_IF_ENTRY = *mut MIB_IPMCAST_IF_ENTRY; +STRUCT!{struct MIB_IPMCAST_IF_TABLE { + dwNumEntries: DWORD, + table: [MIB_IPMCAST_IF_ENTRY; ANY_SIZE], +}} +pub type PMIB_IPMCAST_IF_TABLE = *mut MIB_IPMCAST_IF_TABLE; +// FIXME: SIZEOF_MCAST_IF_TABLE(x) diff --git a/bash-5.1/vendor/winapi/src/shared/iprtrmib.rs b/bash-5.1/vendor/winapi/src/shared/iprtrmib.rs new file mode 100644 index 0000000000000000000000000000000000000000..cc47767fe326fba52da1d8210890c8671aa87c22 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/iprtrmib.rs @@ -0,0 +1,125 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// #include +// #include +// #include +// #include +// #include +// #include +use shared::ipmib::MIB_IPFORWARDROW; +use shared::minwindef::{BOOL, BYTE, DWORD}; +use shared::ntdef::{PWCHAR, ULONGLONG, WCHAR}; +pub const MAX_SCOPE_NAME_LEN: usize = 255; +pub const MAX_MIB_OFFSET: usize = 8; +const ANY_SIZE: usize = 1; +STRUCT!{struct MIB_OPAQUE_QUERY { + dwVarId: DWORD, + rgdwVarIndex: [DWORD; ANY_SIZE], +}} +pub type PMIB_OPAQUE_QUERY = *mut MIB_OPAQUE_QUERY; +ENUM!{enum TCP_TABLE_CLASS { + TCP_TABLE_BASIC_LISTENER = 0, + TCP_TABLE_BASIC_CONNECTIONS = 1, + TCP_TABLE_BASIC_ALL = 2, + TCP_TABLE_OWNER_PID_LISTENER = 3, + TCP_TABLE_OWNER_PID_CONNECTIONS = 4, + TCP_TABLE_OWNER_PID_ALL = 5, + TCP_TABLE_OWNER_MODULE_LISTENER = 6, + TCP_TABLE_OWNER_MODULE_CONNECTIONS = 7, + TCP_TABLE_OWNER_MODULE_ALL = 8, +}} +pub type PTCP_TABLE_CLASS = *mut TCP_TABLE_CLASS; +ENUM!{enum UDP_TABLE_CLASS { + UDP_TABLE_BASIC = 0, + UDP_TABLE_OWNER_PID = 1, + UDP_TABLE_OWNER_MODULE = 2, +}} +pub type PUDP_TABLE_CLASS = *mut UDP_TABLE_CLASS; +ENUM!{enum TCPIP_OWNER_MODULE_INFO_CLASS { + TCPIP_OWNER_MODULE_INFO_BASIC = 0, +}} +pub type PTCPIP_OWNER_MODULE_INFO_CLASS = *mut TCPIP_OWNER_MODULE_INFO_CLASS; +STRUCT!{struct TCPIP_OWNER_MODULE_BASIC_INFO { + pModuleName: PWCHAR, + pModulePath: PWCHAR, +}} +pub type PTCPIP_OWNER_MODULE_BASIC_INFO = *mut TCPIP_OWNER_MODULE_BASIC_INFO; +STRUCT!{struct MIB_IPMCAST_BOUNDARY { + dwIfIndex: DWORD, + dwGroupAddress: DWORD, + dwGroupMask: DWORD, + dwStatus: DWORD, +}} +pub type PMIB_IPMCAST_BOUNDARY = *mut MIB_IPMCAST_BOUNDARY; +STRUCT!{struct MIB_IPMCAST_BOUNDARY_TABLE { + dwNumEntries: DWORD, + table: [MIB_IPMCAST_BOUNDARY; ANY_SIZE], +}} +pub type PMIB_IPMCAST_BOUNDARY_TABLE = *mut MIB_IPMCAST_BOUNDARY_TABLE; +STRUCT!{struct MIB_BOUNDARYROW { + dwGroupAddress: DWORD, + dwGroupMask: DWORD, +}} +pub type PMIB_BOUNDARYROW = *mut MIB_BOUNDARYROW; +STRUCT!{struct MIB_MCAST_LIMIT_ROW { + dwTtl: DWORD, + dwRateLimit: DWORD, +}} +pub type PMIB_MCAST_LIMIT_ROW = *mut MIB_MCAST_LIMIT_ROW; +pub type SN_CHAR = WCHAR; +pub type SCOPE_NAME_BUFFER = [SN_CHAR; MAX_SCOPE_NAME_LEN + 1]; +pub type SCOPE_NAME = *mut SCOPE_NAME_BUFFER; +STRUCT!{struct MIB_IPMCAST_SCOPE { + dwGroupAddress: DWORD, + dwGroupMask: DWORD, + snNameBuffer: SCOPE_NAME_BUFFER, + dwStatus: DWORD, +}} +pub type PMIB_IPMCAST_SCOPE = *mut MIB_IPMCAST_SCOPE; +STRUCT!{struct MIB_IPDESTROW { + ForwardRow: MIB_IPFORWARDROW, + dwForwardPreference: DWORD, + dwForwardViewSet: DWORD, +}} +pub type PMIB_IPDESTROW = *mut MIB_IPDESTROW; +STRUCT!{struct MIB_IPDESTTABLE { + dwNumEntries: DWORD, + table: [MIB_IPDESTROW; ANY_SIZE], +}} +pub type PMIB_IPDESTTABLE = *mut MIB_IPDESTTABLE; +STRUCT!{struct MIB_BEST_IF { + dwDestAddr: DWORD, + dwIfIndex: DWORD, +}} +pub type PMIB_BEST_IF = *mut MIB_BEST_IF; +STRUCT!{struct MIB_PROXYARP { + dwAddress: DWORD, + dwMask: DWORD, + dwIfIndex: DWORD, +}} +pub type PMIB_PROXYARP = *mut MIB_PROXYARP; +STRUCT!{struct MIB_IFSTATUS { + dwIfIndex: DWORD, + dwAdminStatus: DWORD, + dwOperationalStatus: DWORD, + bMHbeatActive: BOOL, + bMHbeatAlive: BOOL, +}} +pub type PMIB_IFSTATUS = *mut MIB_IFSTATUS; +STRUCT!{struct MIB_ROUTESTATE { + bRoutesSetToStack: BOOL, +}} +pub type PMIB_ROUTESTATE = *mut MIB_ROUTESTATE; +UNION!{union MIB_OPAQUE_INFO_u { + [u64; 1], + ullAlign ullAlign_mut: ULONGLONG, + rgbyData rgbyData_mut: [BYTE; 1], +}} +STRUCT!{struct MIB_OPAQUE_INFO { + dwId: DWORD, + u: MIB_OPAQUE_INFO_u, +}} +pub type PMIB_OPAQUE_INFO = *mut MIB_OPAQUE_INFO; diff --git a/bash-5.1/vendor/winapi/src/shared/ks.rs b/bash-5.1/vendor/winapi/src/shared/ks.rs new file mode 100644 index 0000000000000000000000000000000000000000..3a2ab103cd8f9491e01015da286e4ae074ff7e8e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ks.rs @@ -0,0 +1,63 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +// Licensed under the MIT License +//! Mappings for the contents of ks.h +DEFINE_GUID!{KSCATEGORY_BRIDGE, + 0x085AFF00, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00} +DEFINE_GUID!{KSCATEGORY_CAPTURE, + 0x65E8773D, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_VIDEO_CAMERA, + 0xe5323777, 0xf976, 0x4f5b, 0x9b, 0x55, 0xb9, 0x46, 0x99, 0xc4, 0x6e, 0x44} +DEFINE_GUID!{KSCATEGORY_SENSOR_CAMERA, + 0x24e552d7, 0x6523, 0x47f7, 0xa6, 0x47, 0xd3, 0x46, 0x5b, 0xf1, 0xf5, 0xca} +DEFINE_GUID!{KSCATEGORY_SENSOR_GROUP, + 0x669C7214, 0x0A88, 0x4311, 0xA7, 0xF3, 0x4E, 0x79, 0x82, 0x0E, 0x33, 0xBD} +DEFINE_GUID!{KSCATEGORY_RENDER, + 0x65E8773E, 0x8F56, 0x11D0, 0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_MIXER, + 0xAD809C00, 0x7B88, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00} +DEFINE_GUID!{KSCATEGORY_SPLITTER, + 0x0A4252A0, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00} +DEFINE_GUID!{KSCATEGORY_DATACOMPRESSOR, + 0x1E84C900, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00} +DEFINE_GUID!{KSCATEGORY_DATADECOMPRESSOR, + 0x2721AE20, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00} +DEFINE_GUID!{KSCATEGORY_DATATRANSFORM, + 0x2EB07EA0, 0x7E70, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00} +DEFINE_GUID!{KSMFT_CATEGORY_VIDEO_DECODER, + 0xd6c02d4b, 0x6833, 0x45b4, 0x97, 0x1a, 0x05, 0xa4, 0xb0, 0x4b, 0xab, 0x91} +DEFINE_GUID!{KSMFT_CATEGORY_VIDEO_ENCODER, + 0xf79eac7d, 0xe545, 0x4387, 0xbd, 0xee, 0xd6, 0x47, 0xd7, 0xbd, 0xe4, 0x2a} +DEFINE_GUID!{KSMFT_CATEGORY_VIDEO_EFFECT, + 0x12e17c21, 0x532c, 0x4a6e, 0x8a, 0x1c, 0x40, 0x82, 0x5a, 0x73, 0x63, 0x97} +DEFINE_GUID!{KSMFT_CATEGORY_MULTIPLEXER, + 0x059c561e, 0x05ae, 0x4b61, 0xb6, 0x9d, 0x55, 0xb6, 0x1e, 0xe5, 0x4a, 0x7b} +DEFINE_GUID!{KSMFT_CATEGORY_DEMULTIPLEXER, + 0xa8700a7a, 0x939b, 0x44c5, 0x99, 0xd7, 0x76, 0x22, 0x6b, 0x23, 0xb3, 0xf1} +DEFINE_GUID!{KSMFT_CATEGORY_AUDIO_DECODER, + 0x9ea73fb4, 0xef7a, 0x4559, 0x8d, 0x5d, 0x71, 0x9d, 0x8f, 0x04, 0x26, 0xc7} +DEFINE_GUID!{KSMFT_CATEGORY_AUDIO_ENCODER, + 0x91c64bd0, 0xf91e, 0x4d8c, 0x92, 0x76, 0xdb, 0x24, 0x82, 0x79, 0xd9, 0x75} +DEFINE_GUID!{KSMFT_CATEGORY_AUDIO_EFFECT, + 0x11064c48, 0x3648, 0x4ed0, 0x93, 0x2e, 0x05, 0xce, 0x8a, 0xc8, 0x11, 0xb7} +DEFINE_GUID!{KSMFT_CATEGORY_VIDEO_PROCESSOR, + 0x302ea3fc, 0xaa5f, 0x47f9, 0x9f, 0x7a, 0xc2, 0x18, 0x8b, 0xb1, 0x63, 0x02} +DEFINE_GUID!{KSMFT_CATEGORY_OTHER, + 0x90175d57, 0xb7ea, 0x4901, 0xae, 0xb3, 0x93, 0x3a, 0x87, 0x47, 0x75, 0x6f} +DEFINE_GUID!{KSCATEGORY_COMMUNICATIONSTRANSFORM, + 0xCF1DDA2C, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_INTERFACETRANSFORM, + 0xCF1DDA2D, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_MEDIUMTRANSFORM, + 0xCF1DDA2E, 0x9743, 0x11D0, 0xA3, 0xEE, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_FILESYSTEM, + 0x760FED5E, 0x9357, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_CLOCK, + 0x53172480, 0x4791, 0x11D0, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00} +DEFINE_GUID!{KSCATEGORY_PROXY, + 0x97EBAACA, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_QUALITY, + 0x97EBAACB, 0x95BD, 0x11D0, 0xA3, 0xEA, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} diff --git a/bash-5.1/vendor/winapi/src/shared/ksmedia.rs b/bash-5.1/vendor/winapi/src/shared/ksmedia.rs new file mode 100644 index 0000000000000000000000000000000000000000..cd640376e63d9f26d64478d5f12b34fbab25b3a9 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ksmedia.rs @@ -0,0 +1,110 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +// Licensed under the MIT License +//! Mappings for the contents of ksmedia.h +use shared::minwindef::DWORD; +DEFINE_GUID!{KSCATEGORY_AUDIO, + 0x6994AD04, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_VIDEO, + 0x6994AD05, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_REALTIME, + 0xEB115FFC, 0x10C8, 0x4964, 0x83, 0x1D, 0x6D, 0xCB, 0x02, 0xE6, 0xF2, 0x3F} +DEFINE_GUID!{KSCATEGORY_TEXT, + 0x6994AD06, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_NETWORK, + 0x67C9CC3C, 0x69C4, 0x11D2, 0x87, 0x59, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_TOPOLOGY, + 0xDDA54A40, 0x1E4C, 0x11D1, 0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00} +DEFINE_GUID!{KSCATEGORY_VIRTUAL, + 0x3503EAC4, 0x1F26, 0x11D1, 0x8A, 0xB0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSCATEGORY_ACOUSTIC_ECHO_CANCEL, + 0xBF963D80, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1} +DEFINE_GUID!{KSCATEGORY_SYSAUDIO, + 0xA7C7A5B1, 0x5AF3, 0x11D1, 0x9C, 0xED, 0x00, 0xA0, 0x24, 0xBF, 0x04, 0x07} +DEFINE_GUID!{KSCATEGORY_WDMAUD, + 0x3E227E76, 0x690D, 0x11D2, 0x81, 0x61, 0x00, 0x00, 0xF8, 0x77, 0x5B, 0xF1} +DEFINE_GUID!{KSCATEGORY_AUDIO_GFX, + 0x9BAF9572, 0x340C, 0x11D3, 0xAB, 0xDC, 0x00, 0xA0, 0xC9, 0x0A, 0xB1, 0x6F} +DEFINE_GUID!{KSCATEGORY_AUDIO_SPLITTER, + 0x9EA331FA, 0xB91B, 0x45F8, 0x92, 0x85, 0xBD, 0x2B, 0xC7, 0x7A, 0xFC, 0xDE} +DEFINE_GUID!{KSCATEGORY_AUDIO_DEVICE, + 0xFBF6F530, 0x07B9, 0x11D2, 0xA7, 0x1E, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88} +DEFINE_GUID!{KSCATEGORY_PREFERRED_WAVEOUT_DEVICE, + 0xD6C5066E, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88} +DEFINE_GUID!{KSCATEGORY_PREFERRED_WAVEIN_DEVICE, + 0xD6C50671, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88} +DEFINE_GUID!{KSCATEGORY_PREFERRED_MIDIOUT_DEVICE, + 0xD6C50674, 0x72C1, 0x11D2, 0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88} +DEFINE_GUID!{KSCATEGORY_WDMAUD_USE_PIN_NAME, + 0x47A4FA20, 0xA251, 0x11D1, 0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88} +DEFINE_GUID!{KSCATEGORY_ESCALANTE_PLATFORM_DRIVER, + 0x74F3AEA8, 0x9768, 0x11D1, 0x8E, 0x07, 0x00, 0xA0, 0xC9, 0x5E, 0xC2, 0x2E} +DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_ANALOG, + 0x6DBA3190, 0x67BD, 0x11CF, 0xA0, 0xF7, 0x00, 0x20, 0xAF, 0xD1, 0x56, 0xE4} +DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_PCM, + 0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71} +DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, + 0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71} +DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_DRM, + 0x00000009, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71} +DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_ALAW, + 0x00000006, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71} +DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_MULAW, + 0x00000007, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71} +DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_ADPCM, + 0x00000002, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71} +DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_MPEG, + 0x00000050, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71} +//1720 +pub const SPEAKER_FRONT_LEFT: DWORD = 0x1; +pub const SPEAKER_FRONT_RIGHT: DWORD = 0x2; +pub const SPEAKER_FRONT_CENTER: DWORD = 0x4; +pub const SPEAKER_LOW_FREQUENCY: DWORD = 0x8; +pub const SPEAKER_BACK_LEFT: DWORD = 0x10; +pub const SPEAKER_BACK_RIGHT: DWORD = 0x20; +pub const SPEAKER_FRONT_LEFT_OF_CENTER: DWORD = 0x40; +pub const SPEAKER_FRONT_RIGHT_OF_CENTER: DWORD = 0x80; +pub const SPEAKER_BACK_CENTER: DWORD = 0x100; +pub const SPEAKER_SIDE_LEFT: DWORD = 0x200; +pub const SPEAKER_SIDE_RIGHT: DWORD = 0x400; +pub const SPEAKER_TOP_CENTER: DWORD = 0x800; +pub const SPEAKER_TOP_FRONT_LEFT: DWORD = 0x1000; +pub const SPEAKER_TOP_FRONT_CENTER: DWORD = 0x2000; +pub const SPEAKER_TOP_FRONT_RIGHT: DWORD = 0x4000; +pub const SPEAKER_TOP_BACK_LEFT: DWORD = 0x8000; +pub const SPEAKER_TOP_BACK_CENTER: DWORD = 0x10000; +pub const SPEAKER_TOP_BACK_RIGHT: DWORD = 0x20000; +pub const SPEAKER_RESERVED: DWORD = 0x7FFC0000; +pub const SPEAKER_ALL: DWORD = 0x80000000; +pub const KSAUDIO_SPEAKER_DIRECTOUT: DWORD = 0; +pub const KSAUDIO_SPEAKER_MONO: DWORD = SPEAKER_FRONT_CENTER; +pub const KSAUDIO_SPEAKER_1POINT1: DWORD = SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY; +pub const KSAUDIO_SPEAKER_STEREO: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; +pub const KSAUDIO_SPEAKER_2POINT1: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_LOW_FREQUENCY; +pub const KSAUDIO_SPEAKER_3POINT0: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_FRONT_CENTER; +pub const KSAUDIO_SPEAKER_3POINT1: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY; +pub const KSAUDIO_SPEAKER_QUAD: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT; +pub const KSAUDIO_SPEAKER_SURROUND: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER; +pub const KSAUDIO_SPEAKER_5POINT0: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_FRONT_CENTER | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT; +pub const KSAUDIO_SPEAKER_5POINT1: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT; +pub const KSAUDIO_SPEAKER_7POINT0: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_FRONT_CENTER | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT + | SPEAKER_SIDE_RIGHT; +pub const KSAUDIO_SPEAKER_7POINT1: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT + | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER; +pub const KSAUDIO_SPEAKER_5POINT1_SURROUND: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT; +pub const KSAUDIO_SPEAKER_7POINT1_SURROUND: DWORD = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT + | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT + | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT; diff --git a/bash-5.1/vendor/winapi/src/shared/ktmtypes.rs b/bash-5.1/vendor/winapi/src/shared/ktmtypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..77394e2d54c8099d286743fe5d8563735419cf62 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ktmtypes.rs @@ -0,0 +1,138 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Common types for KTM exposed at both the Nt- and Win32-layer +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, ULONG}; +use um::winnt::{LARGE_INTEGER, PVOID, WCHAR}; +pub type UOW = GUID; +pub type PUOW = *mut GUID; +pub type CRM_PROTOCOL_ID = GUID; +pub type PCRM_PROTOCOL_ID = *mut GUID; +pub const TRANSACTION_MANAGER_VOLATILE: ULONG = 0x00000001; +pub const TRANSACTION_MANAGER_COMMIT_DEFAULT: ULONG = 0x00000000; +pub const TRANSACTION_MANAGER_COMMIT_SYSTEM_VOLUME: ULONG = 0x00000002; +pub const TRANSACTION_MANAGER_COMMIT_SYSTEM_HIVES: ULONG = 0x00000004; +pub const TRANSACTION_MANAGER_COMMIT_LOWEST: ULONG = 0x00000008; +pub const TRANSACTION_MANAGER_CORRUPT_FOR_RECOVERY: ULONG = 0x00000010; +pub const TRANSACTION_MANAGER_CORRUPT_FOR_PROGRESS: ULONG = 0x00000020; +pub const TRANSACTION_MANAGER_MAXIMUM_OPTION: ULONG = 0x0000003F; +pub const TRANSACTION_DO_NOT_PROMOTE: DWORD = 0x00000001; +pub const TRANSACTION_MAXIMUM_OPTION: DWORD = 0x00000001; +pub const RESOURCE_MANAGER_VOLATILE: DWORD = 0x00000001; +pub const RESOURCE_MANAGER_COMMUNICATION: DWORD = 0x00000002; +pub const RESOURCE_MANAGER_MAXIMUM_OPTION: DWORD = 0x00000003; +pub const CRM_PROTOCOL_EXPLICIT_MARSHAL_ONLY: DWORD = 0x00000001; +pub const CRM_PROTOCOL_DYNAMIC_MARSHAL_INFO: DWORD = 0x00000002; +pub const CRM_PROTOCOL_MAXIMUM_OPTION: DWORD = 0x00000003; +pub const ENLISTMENT_SUPERIOR: ULONG = 0x00000001; +pub const ENLISTMENT_MAXIMUM_OPTION: ULONG = 0x00000001; +pub type NOTIFICATION_MASK = ULONG; +pub const TRANSACTION_NOTIFY_MASK: ULONG = 0x3FFFFFFF; +pub const TRANSACTION_NOTIFY_PREPREPARE: ULONG = 0x00000001; +pub const TRANSACTION_NOTIFY_PREPARE: ULONG = 0x00000002; +pub const TRANSACTION_NOTIFY_COMMIT: ULONG = 0x00000004; +pub const TRANSACTION_NOTIFY_ROLLBACK: ULONG = 0x00000008; +pub const TRANSACTION_NOTIFY_PREPREPARE_COMPLETE: ULONG = 0x00000010; +pub const TRANSACTION_NOTIFY_PREPARE_COMPLETE: ULONG = 0x00000020; +pub const TRANSACTION_NOTIFY_COMMIT_COMPLETE: ULONG = 0x00000040; +pub const TRANSACTION_NOTIFY_ROLLBACK_COMPLETE: ULONG = 0x00000080; +pub const TRANSACTION_NOTIFY_RECOVER: ULONG = 0x00000100; +pub const TRANSACTION_NOTIFY_SINGLE_PHASE_COMMIT: ULONG = 0x00000200; +pub const TRANSACTION_NOTIFY_DELEGATE_COMMIT: ULONG = 0x00000400; +pub const TRANSACTION_NOTIFY_RECOVER_QUERY: ULONG = 0x00000800; +pub const TRANSACTION_NOTIFY_ENLIST_PREPREPARE: ULONG = 0x00001000; +pub const TRANSACTION_NOTIFY_LAST_RECOVER: ULONG = 0x00002000; +pub const TRANSACTION_NOTIFY_INDOUBT: ULONG = 0x00004000; +pub const TRANSACTION_NOTIFY_PROPAGATE_PULL: ULONG = 0x00008000; +pub const TRANSACTION_NOTIFY_PROPAGATE_PUSH: ULONG = 0x00010000; +pub const TRANSACTION_NOTIFY_MARSHAL: ULONG = 0x00020000; +pub const TRANSACTION_NOTIFY_ENLIST_MASK: ULONG = 0x00040000; +pub const TRANSACTION_NOTIFY_RM_DISCONNECTED: ULONG = 0x01000000; +pub const TRANSACTION_NOTIFY_TM_ONLINE: ULONG = 0x02000000; +pub const TRANSACTION_NOTIFY_COMMIT_REQUEST: ULONG = 0x04000000; +pub const TRANSACTION_NOTIFY_PROMOTE: ULONG = 0x08000000; +pub const TRANSACTION_NOTIFY_PROMOTE_NEW: ULONG = 0x10000000; +pub const TRANSACTION_NOTIFY_REQUEST_OUTCOME: ULONG = 0x20000000; +pub const TRANSACTION_NOTIFY_COMMIT_FINALIZE: ULONG = 0x40000000; +pub const TRANSACTIONMANAGER_OBJECT_PATH: &'static str = "\\TransactionManager\\"; +pub const TRANSACTION_OBJECT_PATH: &'static str = "\\Transaction\\"; +pub const ENLISTMENT_OBJECT_PATH: &'static str = "\\Enlistment\\"; +pub const RESOURCE_MANAGER_OBJECT_PATH: &'static str = "\\ResourceManager\\"; +STRUCT!{struct TRANSACTION_NOTIFICATION { + TransactionKey: PVOID, + TransactionNotification: ULONG, + TmVirtualClock: LARGE_INTEGER, + ArgumentLength: ULONG, +}} +pub type PTRANSACTION_NOTIFICATION = *mut TRANSACTION_NOTIFICATION; +STRUCT!{struct TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT { + EnlistmentId: GUID, + UOW: UOW, +}} +pub type PTRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT + = *mut TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT; +pub const TRANSACTION_NOTIFICATION_TM_ONLINE_FLAG_IS_CLUSTERED: ULONG = 0x1; +STRUCT!{struct TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT { + TmIdentity: GUID, + Flags: ULONG, +}} +pub type PTRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT + = *mut TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT; +pub type SAVEPOINT_ID = ULONG; +pub type PSAVEPOINT_ID = *mut ULONG; +STRUCT!{struct TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT { + SavepointId: SAVEPOINT_ID, +}} +pub type PTRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT + = *mut TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT; +STRUCT!{struct TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT { + PropagationCookie: ULONG, + UOW: GUID, + TmIdentity: GUID, + BufferLength: ULONG, +}} +pub type PTRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT + = *mut TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT; +STRUCT!{struct TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT { + MarshalCookie: ULONG, + UOW: GUID, +}} +pub type PTRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT + = *mut TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT; +pub type TRANSACTION_NOTIFICATION_PROMOTE_ARGUMENT = TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT; +pub type PTRANSACTION_NOTIFICATION_PROMOTE_ARGUMENT + = *mut TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT; +pub const KTM_MARSHAL_BLOB_VERSION_MAJOR: ULONG = 1; +pub const KTM_MARSHAL_BLOB_VERSION_MINOR: ULONG = 1; +pub const MAX_TRANSACTION_DESCRIPTION_LENGTH: usize = 64; +pub const MAX_RESOURCEMANAGER_DESCRIPTION_LENGTH: usize = 64; +STRUCT!{struct KCRM_MARSHAL_HEADER { + VersionMajor: ULONG, + VersionMinor: ULONG, + NumProtocols: ULONG, + Unused: ULONG, +}} +pub type PKCRM_MARSHAL_HEADER = *mut KCRM_MARSHAL_HEADER; +pub type PRKCRM_MARSHAL_HEADER = *mut KCRM_MARSHAL_HEADER; +STRUCT!{struct KCRM_TRANSACTION_BLOB { + UOW: UOW, + TmIdentity: GUID, + IsolationLevel: ULONG, + IsolationFlags: ULONG, + Timeout: ULONG, + Description: [WCHAR; MAX_TRANSACTION_DESCRIPTION_LENGTH], +}} +pub type PKCRM_TRANSACTION_BLOB = *mut KCRM_TRANSACTION_BLOB; +pub type PRKCRM_TRANSACTION_BLOB = *mut KCRM_TRANSACTION_BLOB; +STRUCT!{struct KCRM_PROTOCOL_BLOB { + ProtocolId: CRM_PROTOCOL_ID, + StaticInfoLength: ULONG, + TransactionIdInfoLength: ULONG, + Unused1: ULONG, + Unused2: ULONG, +}} +pub type PKCRM_PROTOCOL_BLOB = *mut KCRM_PROTOCOL_BLOB; +pub type PRKCRM_PROTOCOL_BLOB = *mut KCRM_PROTOCOL_BLOB; diff --git a/bash-5.1/vendor/winapi/src/shared/lmcons.rs b/bash-5.1/vendor/winapi/src/shared/lmcons.rs new file mode 100644 index 0000000000000000000000000000000000000000..ca2819b4ff103b8715202bb8f1503b0663f0aa60 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/lmcons.rs @@ -0,0 +1,60 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This file contains constants used throughout the LAN Manager API header files. +use shared::minwindef::DWORD; +use um::winnt::{LPCWSTR, LPWSTR}; +pub const CNLEN: DWORD = 15; +pub const LM20_CNLEN: DWORD = 15; +pub const DNLEN: DWORD = CNLEN; +pub const LM20_DNLEN: DWORD = LM20_CNLEN; +pub const UNCLEN: DWORD = CNLEN + 2; +pub const LM20_UNCLEN: DWORD = LM20_CNLEN + 2; +pub const NNLEN: DWORD = 80; +pub const LM20_NNLEN: DWORD = 12; +pub const RMLEN: DWORD = UNCLEN + 1 + NNLEN; +pub const LM20_RMLEN: DWORD = LM20_UNCLEN + 1 + LM20_NNLEN; +pub const SNLEN: usize = 80; +pub const LM20_SNLEN: DWORD = 15; +pub const STXTLEN: DWORD = 256; +pub const LM20_STXTLEN: DWORD = 63; +pub const PATHLEN: DWORD = 256; +pub const LM20_PATHLEN: DWORD = 256; +pub const DEVLEN: DWORD = 80; +pub const LM20_DEVLEN: DWORD = 8; +pub const EVLEN: usize = 16; +pub const UNLEN: DWORD = 256; +pub const LM20_UNLEN: DWORD = 20; +pub const GNLEN: DWORD = UNLEN; +pub const LM20_GNLEN: DWORD = LM20_UNLEN; +pub const PWLEN: DWORD = 256; +pub const LM20_PWLEN: DWORD = 14; +pub const SHPWLEN: DWORD = 8; +pub const CLTYPE_LEN: DWORD = 12; +pub const MAXCOMMENTSZ: DWORD = 256; +pub const LM20_MAXCOMMENTSZ: DWORD = 48; +pub const QNLEN: DWORD = NNLEN; +pub const LM20_QNLEN: DWORD = LM20_NNLEN; +pub const ALERTSZ: DWORD = 128; +pub const MAXDEVENTRIES: DWORD = 4 * 8; // FIXME: sizeof(int) instead of 4 +pub const NETBIOS_NAME_LEN: DWORD = 16; +pub const MAX_PREFERRED_LENGTH: DWORD = -1i32 as u32; +pub const CRYPT_KEY_LEN: DWORD = 7; +pub const CRYPT_TXT_LEN: DWORD = 8; +pub const ENCRYPTED_PWLEN: usize = 16; +pub const SESSION_PWLEN: DWORD = 24; +pub const SESSION_CRYPT_KLEN: DWORD = 21; +pub const PARM_ERROR_UNKNOWN: DWORD = -1i32 as u32; +pub const PARM_ERROR_NONE: DWORD = 0; +pub const PARMNUM_BASE_INFOLEVEL: DWORD = 1000; +pub type LMSTR = LPWSTR; +pub type LMCSTR = LPCWSTR; +pub type NET_API_STATUS = DWORD; +pub type API_RET_TYPE = NET_API_STATUS; +pub const PLATFORM_ID_DOS: DWORD = 300; +pub const PLATFORM_ID_OS2: DWORD = 400; +pub const PLATFORM_ID_NT: DWORD = 500; +pub const PLATFORM_ID_OSF: DWORD = 600; +pub const PLATFORM_ID_VMS: DWORD = 700; diff --git a/bash-5.1/vendor/winapi/src/shared/minwindef.rs b/bash-5.1/vendor/winapi/src/shared/minwindef.rs new file mode 100644 index 0000000000000000000000000000000000000000..6c2e38d2ca37c80b75b0416deeb0858207444814 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/minwindef.rs @@ -0,0 +1,102 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Basic Windows Type Definitions for minwin partition +use ctypes::{c_char, c_float, c_int, c_long, c_uchar, c_uint, c_ulong, c_ushort, c_void}; +use shared::basetsd::{LONG_PTR, UINT_PTR}; +use shared::ntdef::{HANDLE, LONG}; +pub type ULONG = c_ulong; +pub type PULONG = *mut ULONG; +pub type USHORT = c_ushort; +pub type PUSHORT = *mut USHORT; +pub type UCHAR = c_uchar; +pub type PUCHAR = *mut UCHAR; +pub type PSZ = *mut c_char; +pub const MAX_PATH: usize = 260; +pub const FALSE: BOOL = 0; +pub const TRUE: BOOL = 1; +pub type DWORD = c_ulong; +pub type BOOL = c_int; +pub type BYTE = c_uchar; +pub type WORD = c_ushort; +pub type FLOAT = c_float; +pub type PFLOAT = *mut FLOAT; +pub type PBOOL = *mut BOOL; +pub type LPBOOL = *mut BOOL; +pub type PBYTE = *mut BYTE; +pub type LPBYTE = *mut BYTE; +pub type PINT = *mut c_int; +pub type LPINT = *mut c_int; +pub type PWORD = *mut WORD; +pub type LPWORD = *mut WORD; +pub type LPLONG = *mut c_long; +pub type PDWORD = *mut DWORD; +pub type LPDWORD = *mut DWORD; +pub type LPVOID = *mut c_void; +pub type LPCVOID = *const c_void; +pub type INT = c_int; +pub type UINT = c_uint; +pub type PUINT = *mut c_uint; +pub type WPARAM = UINT_PTR; +pub type LPARAM = LONG_PTR; +pub type LRESULT = LONG_PTR; +#[inline] +pub fn MAKEWORD(a: BYTE, b: BYTE) -> WORD { + (a as WORD) | ((b as WORD) << 8) +} +#[inline] +pub fn MAKELONG(a: WORD, b: WORD) -> LONG { + ((a as DWORD) | ((b as DWORD) << 16)) as LONG +} +#[inline] +pub fn LOWORD(l: DWORD) -> WORD { + (l & 0xffff) as WORD +} +#[inline] +pub fn HIWORD(l: DWORD) -> WORD { + ((l >> 16) & 0xffff) as WORD +} +#[inline] +pub fn LOBYTE(l: WORD) -> BYTE { + (l & 0xff) as BYTE +} +#[inline] +pub fn HIBYTE(l: WORD) -> BYTE { + ((l >> 8) & 0xff) as BYTE +} +pub type SPHANDLE = *mut HANDLE; +pub type LPHANDLE = *mut HANDLE; +pub type HGLOBAL = HANDLE; +pub type HLOCAL = HANDLE; +pub type GLOBALHANDLE = HANDLE; +pub type LOCALHANDLE = HANDLE; +pub enum __some_function {} +/// Pointer to a function with unknown type signature. +pub type FARPROC = *mut __some_function; +/// Pointer to a function with unknown type signature. +pub type NEARPROC = *mut __some_function; +/// Pointer to a function with unknown type signature. +pub type PROC = *mut __some_function; +pub type ATOM = WORD; +DECLARE_HANDLE!{HKEY, HKEY__} +pub type PHKEY = *mut HKEY; +DECLARE_HANDLE!{HMETAFILE, HMETAFILE__} +DECLARE_HANDLE!{HINSTANCE, HINSTANCE__} +pub type HMODULE = HINSTANCE; +DECLARE_HANDLE!{HRGN, HRGN__} +DECLARE_HANDLE!{HRSRC, HRSRC__} +DECLARE_HANDLE!{HSPRITE, HSPRITE__} +DECLARE_HANDLE!{HLSURF, HLSURF__} +DECLARE_HANDLE!{HSTR, HSTR__} +DECLARE_HANDLE!{HTASK, HTASK__} +DECLARE_HANDLE!{HWINSTA, HWINSTA__} +DECLARE_HANDLE!{HKL, HKL__} +pub type HFILE = c_int; +STRUCT!{#[debug] struct FILETIME { + dwLowDateTime: DWORD, + dwHighDateTime: DWORD, +}} +pub type PFILETIME = *mut FILETIME; +pub type LPFILETIME = *mut FILETIME; diff --git a/bash-5.1/vendor/winapi/src/shared/mmreg.rs b/bash-5.1/vendor/winapi/src/shared/mmreg.rs new file mode 100644 index 0000000000000000000000000000000000000000..06ad900f2223068b599b19b2fc3d37d6de7c194a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/mmreg.rs @@ -0,0 +1,309 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, WORD}; +pub const WAVE_FORMAT_UNKNOWN: WORD = 0x0000; +pub const WAVE_FORMAT_PCM: WORD = 0x0001; +pub const WAVE_FORMAT_ADPCM: WORD = 0x0002; +pub const WAVE_FORMAT_IEEE_FLOAT: WORD = 0x0003; +pub const WAVE_FORMAT_VSELP: WORD = 0x0004; +pub const WAVE_FORMAT_IBM_CVSD: WORD = 0x0005; +pub const WAVE_FORMAT_ALAW: WORD = 0x0006; +pub const WAVE_FORMAT_MULAW: WORD = 0x0007; +pub const WAVE_FORMAT_DTS: WORD = 0x0008; +pub const WAVE_FORMAT_DRM: WORD = 0x0009; +pub const WAVE_FORMAT_WMAVOICE9: WORD = 0x000A; +pub const WAVE_FORMAT_WMAVOICE10: WORD = 0x000B; +pub const WAVE_FORMAT_OKI_ADPCM: WORD = 0x0010; +pub const WAVE_FORMAT_DVI_ADPCM: WORD = 0x0011; +pub const WAVE_FORMAT_IMA_ADPCM: WORD = WAVE_FORMAT_DVI_ADPCM; +pub const WAVE_FORMAT_MEDIASPACE_ADPCM: WORD = 0x0012; +pub const WAVE_FORMAT_SIERRA_ADPCM: WORD = 0x0013; +pub const WAVE_FORMAT_G723_ADPCM: WORD = 0x0014; +pub const WAVE_FORMAT_DIGISTD: WORD = 0x0015; +pub const WAVE_FORMAT_DIGIFIX: WORD = 0x0016; +pub const WAVE_FORMAT_DIALOGIC_OKI_ADPCM: WORD = 0x0017; +pub const WAVE_FORMAT_MEDIAVISION_ADPCM: WORD = 0x0018; +pub const WAVE_FORMAT_CU_CODEC: WORD = 0x0019; +pub const WAVE_FORMAT_HP_DYN_VOICE: WORD = 0x001A; +pub const WAVE_FORMAT_YAMAHA_ADPCM: WORD = 0x0020; +pub const WAVE_FORMAT_SONARC: WORD = 0x0021; +pub const WAVE_FORMAT_DSPGROUP_TRUESPEECH: WORD = 0x0022; +pub const WAVE_FORMAT_ECHOSC1: WORD = 0x0023; +pub const WAVE_FORMAT_AUDIOFILE_AF36: WORD = 0x0024; +pub const WAVE_FORMAT_APTX: WORD = 0x0025; +pub const WAVE_FORMAT_AUDIOFILE_AF10: WORD = 0x0026; +pub const WAVE_FORMAT_PROSODY_1612: WORD = 0x0027; +pub const WAVE_FORMAT_LRC: WORD = 0x0028; +pub const WAVE_FORMAT_DOLBY_AC2: WORD = 0x0030; +pub const WAVE_FORMAT_GSM610: WORD = 0x0031; +pub const WAVE_FORMAT_MSNAUDIO: WORD = 0x0032; +pub const WAVE_FORMAT_ANTEX_ADPCME: WORD = 0x0033; +pub const WAVE_FORMAT_CONTROL_RES_VQLPC: WORD = 0x0034; +pub const WAVE_FORMAT_DIGIREAL: WORD = 0x0035; +pub const WAVE_FORMAT_DIGIADPCM: WORD = 0x0036; +pub const WAVE_FORMAT_CONTROL_RES_CR10: WORD = 0x0037; +pub const WAVE_FORMAT_NMS_VBXADPCM: WORD = 0x0038; +pub const WAVE_FORMAT_CS_IMAADPCM: WORD = 0x0039; +pub const WAVE_FORMAT_ECHOSC3: WORD = 0x003A; +pub const WAVE_FORMAT_ROCKWELL_ADPCM: WORD = 0x003B; +pub const WAVE_FORMAT_ROCKWELL_DIGITALK: WORD = 0x003C; +pub const WAVE_FORMAT_XEBEC: WORD = 0x003D; +pub const WAVE_FORMAT_G721_ADPCM: WORD = 0x0040; +pub const WAVE_FORMAT_G728_CELP: WORD = 0x0041; +pub const WAVE_FORMAT_MSG723: WORD = 0x0042; +pub const WAVE_FORMAT_INTEL_G723_1: WORD = 0x0043; +pub const WAVE_FORMAT_INTEL_G729: WORD = 0x0044; +pub const WAVE_FORMAT_SHARP_G726: WORD = 0x0045; +pub const WAVE_FORMAT_MPEG: WORD = 0x0050; +pub const WAVE_FORMAT_RT24: WORD = 0x0052; +pub const WAVE_FORMAT_PAC: WORD = 0x0053; +pub const WAVE_FORMAT_MPEGLAYER3: WORD = 0x0055; +pub const WAVE_FORMAT_LUCENT_G723: WORD = 0x0059; +pub const WAVE_FORMAT_CIRRUS: WORD = 0x0060; +pub const WAVE_FORMAT_ESPCM: WORD = 0x0061; +pub const WAVE_FORMAT_VOXWARE: WORD = 0x0062; +pub const WAVE_FORMAT_CANOPUS_ATRAC: WORD = 0x0063; +pub const WAVE_FORMAT_G726_ADPCM: WORD = 0x0064; +pub const WAVE_FORMAT_G722_ADPCM: WORD = 0x0065; +pub const WAVE_FORMAT_DSAT: WORD = 0x0066; +pub const WAVE_FORMAT_DSAT_DISPLAY: WORD = 0x0067; +pub const WAVE_FORMAT_VOXWARE_BYTE_ALIGNED: WORD = 0x0069; +pub const WAVE_FORMAT_VOXWARE_AC8: WORD = 0x0070; +pub const WAVE_FORMAT_VOXWARE_AC10: WORD = 0x0071; +pub const WAVE_FORMAT_VOXWARE_AC16: WORD = 0x0072; +pub const WAVE_FORMAT_VOXWARE_AC20: WORD = 0x0073; +pub const WAVE_FORMAT_VOXWARE_RT24: WORD = 0x0074; +pub const WAVE_FORMAT_VOXWARE_RT29: WORD = 0x0075; +pub const WAVE_FORMAT_VOXWARE_RT29HW: WORD = 0x0076; +pub const WAVE_FORMAT_VOXWARE_VR12: WORD = 0x0077; +pub const WAVE_FORMAT_VOXWARE_VR18: WORD = 0x0078; +pub const WAVE_FORMAT_VOXWARE_TQ40: WORD = 0x0079; +pub const WAVE_FORMAT_VOXWARE_SC3: WORD = 0x007A; +pub const WAVE_FORMAT_VOXWARE_SC3_1: WORD = 0x007B; +pub const WAVE_FORMAT_SOFTSOUND: WORD = 0x0080; +pub const WAVE_FORMAT_VOXWARE_TQ60: WORD = 0x0081; +pub const WAVE_FORMAT_MSRT24: WORD = 0x0082; +pub const WAVE_FORMAT_G729A: WORD = 0x0083; +pub const WAVE_FORMAT_MVI_MVI2: WORD = 0x0084; +pub const WAVE_FORMAT_DF_G726: WORD = 0x0085; +pub const WAVE_FORMAT_DF_GSM610: WORD = 0x0086; +pub const WAVE_FORMAT_ISIAUDIO: WORD = 0x0088; +pub const WAVE_FORMAT_ONLIVE: WORD = 0x0089; +pub const WAVE_FORMAT_MULTITUDE_FT_SX20: WORD = 0x008A; +pub const WAVE_FORMAT_INFOCOM_ITS_G721_ADPCM: WORD = 0x008B; +pub const WAVE_FORMAT_CONVEDIA_G729: WORD = 0x008C; +pub const WAVE_FORMAT_CONGRUENCY: WORD = 0x008D; +pub const WAVE_FORMAT_SBC24: WORD = 0x0091; +pub const WAVE_FORMAT_DOLBY_AC3_SPDIF: WORD = 0x0092; +pub const WAVE_FORMAT_MEDIASONIC_G723: WORD = 0x0093; +pub const WAVE_FORMAT_PROSODY_8KBPS: WORD = 0x0094; +pub const WAVE_FORMAT_ZYXEL_ADPCM: WORD = 0x0097; +pub const WAVE_FORMAT_PHILIPS_LPCBB: WORD = 0x0098; +pub const WAVE_FORMAT_PACKED: WORD = 0x0099; +pub const WAVE_FORMAT_MALDEN_PHONYTALK: WORD = 0x00A0; +pub const WAVE_FORMAT_RACAL_RECORDER_GSM: WORD = 0x00A1; +pub const WAVE_FORMAT_RACAL_RECORDER_G720_A: WORD = 0x00A2; +pub const WAVE_FORMAT_RACAL_RECORDER_G723_1: WORD = 0x00A3; +pub const WAVE_FORMAT_RACAL_RECORDER_TETRA_ACELP: WORD = 0x00A4; +pub const WAVE_FORMAT_NEC_AAC: WORD = 0x00B0; +pub const WAVE_FORMAT_RAW_AAC1: WORD = 0x00FF; +pub const WAVE_FORMAT_RHETOREX_ADPCM: WORD = 0x0100; +pub const WAVE_FORMAT_IRAT: WORD = 0x0101; +pub const WAVE_FORMAT_VIVO_G723: WORD = 0x0111; +pub const WAVE_FORMAT_VIVO_SIREN: WORD = 0x0112; +pub const WAVE_FORMAT_PHILIPS_CELP: WORD = 0x0120; +pub const WAVE_FORMAT_PHILIPS_GRUNDIG: WORD = 0x0121; +pub const WAVE_FORMAT_DIGITAL_G723: WORD = 0x0123; +pub const WAVE_FORMAT_SANYO_LD_ADPCM: WORD = 0x0125; +pub const WAVE_FORMAT_SIPROLAB_ACEPLNET: WORD = 0x0130; +pub const WAVE_FORMAT_SIPROLAB_ACELP4800: WORD = 0x0131; +pub const WAVE_FORMAT_SIPROLAB_ACELP8V3: WORD = 0x0132; +pub const WAVE_FORMAT_SIPROLAB_G729: WORD = 0x0133; +pub const WAVE_FORMAT_SIPROLAB_G729A: WORD = 0x0134; +pub const WAVE_FORMAT_SIPROLAB_KELVIN: WORD = 0x0135; +pub const WAVE_FORMAT_VOICEAGE_AMR: WORD = 0x0136; +pub const WAVE_FORMAT_G726ADPCM: WORD = 0x0140; +pub const WAVE_FORMAT_DICTAPHONE_CELP68: WORD = 0x0141; +pub const WAVE_FORMAT_DICTAPHONE_CELP54: WORD = 0x0142; +pub const WAVE_FORMAT_QUALCOMM_PUREVOICE: WORD = 0x0150; +pub const WAVE_FORMAT_QUALCOMM_HALFRATE: WORD = 0x0151; +pub const WAVE_FORMAT_TUBGSM: WORD = 0x0155; +pub const WAVE_FORMAT_MSAUDIO1: WORD = 0x0160; +pub const WAVE_FORMAT_WMAUDIO2: WORD = 0x0161; +pub const WAVE_FORMAT_WMAUDIO3: WORD = 0x0162; +pub const WAVE_FORMAT_WMAUDIO_LOSSLESS: WORD = 0x0163; +pub const WAVE_FORMAT_WMASPDIF: WORD = 0x0164; +pub const WAVE_FORMAT_UNISYS_NAP_ADPCM: WORD = 0x0170; +pub const WAVE_FORMAT_UNISYS_NAP_ULAW: WORD = 0x0171; +pub const WAVE_FORMAT_UNISYS_NAP_ALAW: WORD = 0x0172; +pub const WAVE_FORMAT_UNISYS_NAP_16K: WORD = 0x0173; +pub const WAVE_FORMAT_SYCOM_ACM_SYC008: WORD = 0x0174; +pub const WAVE_FORMAT_SYCOM_ACM_SYC701_G726L: WORD = 0x0175; +pub const WAVE_FORMAT_SYCOM_ACM_SYC701_CELP54: WORD = 0x0176; +pub const WAVE_FORMAT_SYCOM_ACM_SYC701_CELP68: WORD = 0x0177; +pub const WAVE_FORMAT_KNOWLEDGE_ADVENTURE_ADPCM: WORD = 0x0178; +pub const WAVE_FORMAT_FRAUNHOFER_IIS_MPEG2_AAC: WORD = 0x0180; +pub const WAVE_FORMAT_DTS_DS: WORD = 0x0190; +pub const WAVE_FORMAT_CREATIVE_ADPCM: WORD = 0x0200; +pub const WAVE_FORMAT_CREATIVE_FASTSPEECH8: WORD = 0x0202; +pub const WAVE_FORMAT_CREATIVE_FASTSPEECH10: WORD = 0x0203; +pub const WAVE_FORMAT_UHER_ADPCM: WORD = 0x0210; +pub const WAVE_FORMAT_ULEAD_DV_AUDIO: WORD = 0x0215; +pub const WAVE_FORMAT_ULEAD_DV_AUDIO_1: WORD = 0x0216; +pub const WAVE_FORMAT_QUARTERDECK: WORD = 0x0220; +pub const WAVE_FORMAT_ILINK_VC: WORD = 0x0230; +pub const WAVE_FORMAT_RAW_SPORT: WORD = 0x0240; +pub const WAVE_FORMAT_ESST_AC3: WORD = 0x0241; +pub const WAVE_FORMAT_GENERIC_PASSTHRU: WORD = 0x0249; +pub const WAVE_FORMAT_IPI_HSX: WORD = 0x0250; +pub const WAVE_FORMAT_IPI_RPELP: WORD = 0x0251; +pub const WAVE_FORMAT_CS2: WORD = 0x0260; +pub const WAVE_FORMAT_SONY_SCX: WORD = 0x0270; +pub const WAVE_FORMAT_SONY_SCY: WORD = 0x0271; +pub const WAVE_FORMAT_SONY_ATRAC3: WORD = 0x0272; +pub const WAVE_FORMAT_SONY_SPC: WORD = 0x0273; +pub const WAVE_FORMAT_TELUM_AUDIO: WORD = 0x0280; +pub const WAVE_FORMAT_TELUM_IA_AUDIO: WORD = 0x0281; +pub const WAVE_FORMAT_NORCOM_VOICE_SYSTEMS_ADPCM: WORD = 0x0285; +pub const WAVE_FORMAT_FM_TOWNS_SND: WORD = 0x0300; +pub const WAVE_FORMAT_MICRONAS: WORD = 0x0350; +pub const WAVE_FORMAT_MICRONAS_CELP833: WORD = 0x0351; +pub const WAVE_FORMAT_BTV_DIGITAL: WORD = 0x0400; +pub const WAVE_FORMAT_INTEL_MUSIC_CODER: WORD = 0x0401; +pub const WAVE_FORMAT_INDEO_AUDIO: WORD = 0x0402; +pub const WAVE_FORMAT_QDESIGN_MUSIC: WORD = 0x0450; +pub const WAVE_FORMAT_ON2_VP7_AUDIO: WORD = 0x0500; +pub const WAVE_FORMAT_ON2_VP6_AUDIO: WORD = 0x0501; +pub const WAVE_FORMAT_VME_VMPCM: WORD = 0x0680; +pub const WAVE_FORMAT_TPC: WORD = 0x0681; +pub const WAVE_FORMAT_LIGHTWAVE_LOSSLESS: WORD = 0x08AE; +pub const WAVE_FORMAT_OLIGSM: WORD = 0x1000; +pub const WAVE_FORMAT_OLIADPCM: WORD = 0x1001; +pub const WAVE_FORMAT_OLICELP: WORD = 0x1002; +pub const WAVE_FORMAT_OLISBC: WORD = 0x1003; +pub const WAVE_FORMAT_OLIOPR: WORD = 0x1004; +pub const WAVE_FORMAT_LH_CODEC: WORD = 0x1100; +pub const WAVE_FORMAT_LH_CODEC_CELP: WORD = 0x1101; +pub const WAVE_FORMAT_LH_CODEC_SBC8: WORD = 0x1102; +pub const WAVE_FORMAT_LH_CODEC_SBC12: WORD = 0x1103; +pub const WAVE_FORMAT_LH_CODEC_SBC16: WORD = 0x1104; +pub const WAVE_FORMAT_NORRIS: WORD = 0x1400; +pub const WAVE_FORMAT_ISIAUDIO_2: WORD = 0x1401; +pub const WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS: WORD = 0x1500; +pub const WAVE_FORMAT_MPEG_ADTS_AAC: WORD = 0x1600; +pub const WAVE_FORMAT_MPEG_RAW_AAC: WORD = 0x1601; +pub const WAVE_FORMAT_MPEG_LOAS: WORD = 0x1602; +pub const WAVE_FORMAT_NOKIA_MPEG_ADTS_AAC: WORD = 0x1608; +pub const WAVE_FORMAT_NOKIA_MPEG_RAW_AAC: WORD = 0x1609; +pub const WAVE_FORMAT_VODAFONE_MPEG_ADTS_AAC: WORD = 0x160A; +pub const WAVE_FORMAT_VODAFONE_MPEG_RAW_AAC: WORD = 0x160B; +pub const WAVE_FORMAT_MPEG_HEAAC: WORD = 0x1610; +pub const WAVE_FORMAT_VOXWARE_RT24_SPEECH: WORD = 0x181C; +pub const WAVE_FORMAT_SONICFOUNDRY_LOSSLESS: WORD = 0x1971; +pub const WAVE_FORMAT_INNINGS_TELECOM_ADPCM: WORD = 0x1979; +pub const WAVE_FORMAT_LUCENT_SX8300P: WORD = 0x1C07; +pub const WAVE_FORMAT_LUCENT_SX5363S: WORD = 0x1C0C; +pub const WAVE_FORMAT_CUSEEME: WORD = 0x1F03; +pub const WAVE_FORMAT_NTCSOFT_ALF2CM_ACM: WORD = 0x1FC4; +pub const WAVE_FORMAT_DVM: WORD = 0x2000; +pub const WAVE_FORMAT_DTS2: WORD = 0x2001; +pub const WAVE_FORMAT_MAKEAVIS: WORD = 0x3313; +pub const WAVE_FORMAT_DIVIO_MPEG4_AAC: WORD = 0x4143; +pub const WAVE_FORMAT_NOKIA_ADAPTIVE_MULTIRATE: WORD = 0x4201; +pub const WAVE_FORMAT_DIVIO_G726: WORD = 0x4243; +pub const WAVE_FORMAT_LEAD_SPEECH: WORD = 0x434C; +pub const WAVE_FORMAT_LEAD_VORBIS: WORD = 0x564C; +pub const WAVE_FORMAT_WAVPACK_AUDIO: WORD = 0x5756; +pub const WAVE_FORMAT_OGG_VORBIS_MODE_1: WORD = 0x674F; +pub const WAVE_FORMAT_OGG_VORBIS_MODE_2: WORD = 0x6750; +pub const WAVE_FORMAT_OGG_VORBIS_MODE_3: WORD = 0x6751; +pub const WAVE_FORMAT_OGG_VORBIS_MODE_1_PLUS: WORD = 0x676F; +pub const WAVE_FORMAT_OGG_VORBIS_MODE_2_PLUS: WORD = 0x6770; +pub const WAVE_FORMAT_OGG_VORBIS_MODE_3_PLUS: WORD = 0x6771; +pub const WAVE_FORMAT_3COM_NBX: WORD = 0x7000; +pub const WAVE_FORMAT_FAAD_AAC: WORD = 0x706D; +pub const WAVE_FORMAT_AMR_NB: WORD = 0x7361; +pub const WAVE_FORMAT_AMR_WB: WORD = 0x7362; +pub const WAVE_FORMAT_AMR_WP: WORD = 0x7363; +pub const WAVE_FORMAT_GSM_AMR_CBR: WORD = 0x7A21; +pub const WAVE_FORMAT_GSM_AMR_VBR_SID: WORD = 0x7A22; +pub const WAVE_FORMAT_COMVERSE_INFOSYS_G723_1: WORD = 0xA100; +pub const WAVE_FORMAT_COMVERSE_INFOSYS_AVQSBC: WORD = 0xA101; +pub const WAVE_FORMAT_COMVERSE_INFOSYS_SBC: WORD = 0xA102; +pub const WAVE_FORMAT_SYMBOL_G729_A: WORD = 0xA103; +pub const WAVE_FORMAT_VOICEAGE_AMR_WB: WORD = 0xA104; +pub const WAVE_FORMAT_INGENIENT_G726: WORD = 0xA105; +pub const WAVE_FORMAT_MPEG4_AAC: WORD = 0xA106; +pub const WAVE_FORMAT_ENCORE_G726: WORD = 0xA107; +pub const WAVE_FORMAT_ZOLL_ASAO: WORD = 0xA108; +pub const WAVE_FORMAT_SPEEX_VOICE: WORD = 0xA109; +pub const WAVE_FORMAT_VIANIX_MASC: WORD = 0xA10A; +pub const WAVE_FORMAT_WM9_SPECTRUM_ANALYZER: WORD = 0xA10B; +pub const WAVE_FORMAT_WMF_SPECTRUM_ANAYZER: WORD = 0xA10C; +pub const WAVE_FORMAT_GSM_610: WORD = 0xA10D; +pub const WAVE_FORMAT_GSM_620: WORD = 0xA10E; +pub const WAVE_FORMAT_GSM_660: WORD = 0xA10F; +pub const WAVE_FORMAT_GSM_690: WORD = 0xA110; +pub const WAVE_FORMAT_GSM_ADAPTIVE_MULTIRATE_WB: WORD = 0xA111; +pub const WAVE_FORMAT_POLYCOM_G722: WORD = 0xA112; +pub const WAVE_FORMAT_POLYCOM_G728: WORD = 0xA113; +pub const WAVE_FORMAT_POLYCOM_G729_A: WORD = 0xA114; +pub const WAVE_FORMAT_POLYCOM_SIREN: WORD = 0xA115; +pub const WAVE_FORMAT_GLOBAL_IP_ILBC: WORD = 0xA116; +pub const WAVE_FORMAT_RADIOTIME_TIME_SHIFT_RADIO: WORD = 0xA117; +pub const WAVE_FORMAT_NICE_ACA: WORD = 0xA118; +pub const WAVE_FORMAT_NICE_ADPCM: WORD = 0xA119; +pub const WAVE_FORMAT_VOCORD_G721: WORD = 0xA11A; +pub const WAVE_FORMAT_VOCORD_G726: WORD = 0xA11B; +pub const WAVE_FORMAT_VOCORD_G722_1: WORD = 0xA11C; +pub const WAVE_FORMAT_VOCORD_G728: WORD = 0xA11D; +pub const WAVE_FORMAT_VOCORD_G729: WORD = 0xA11E; +pub const WAVE_FORMAT_VOCORD_G729_A: WORD = 0xA11F; +pub const WAVE_FORMAT_VOCORD_G723_1: WORD = 0xA120; +pub const WAVE_FORMAT_VOCORD_LBC: WORD = 0xA121; +pub const WAVE_FORMAT_NICE_G728: WORD = 0xA122; +pub const WAVE_FORMAT_FRACE_TELECOM_G729: WORD = 0xA123; +pub const WAVE_FORMAT_CODIAN: WORD = 0xA124; +pub const WAVE_FORMAT_FLAC: WORD = 0xF1AC; +pub const WAVE_FORMAT_EXTENSIBLE: WORD = 0xFFFE; +pub const WAVE_FORMAT_DEVELOPMENT: WORD = 0xFFFF; +//2557 +pub const SPEAKER_FRONT_LEFT: DWORD = 0x1; +pub const SPEAKER_FRONT_RIGHT: DWORD = 0x2; +pub const SPEAKER_FRONT_CENTER: DWORD = 0x4; +pub const SPEAKER_LOW_FREQUENCY: DWORD = 0x8; +pub const SPEAKER_BACK_LEFT: DWORD = 0x10; +pub const SPEAKER_BACK_RIGHT: DWORD = 0x20; +pub const SPEAKER_FRONT_LEFT_OF_CENTER: DWORD = 0x40; +pub const SPEAKER_FRONT_RIGHT_OF_CENTER: DWORD = 0x80; +pub const SPEAKER_BACK_CENTER: DWORD = 0x100; +pub const SPEAKER_SIDE_LEFT: DWORD = 0x200; +pub const SPEAKER_SIDE_RIGHT: DWORD = 0x400; +pub const SPEAKER_TOP_CENTER: DWORD = 0x800; +pub const SPEAKER_TOP_FRONT_LEFT: DWORD = 0x1000; +pub const SPEAKER_TOP_FRONT_CENTER: DWORD = 0x2000; +pub const SPEAKER_TOP_FRONT_RIGHT: DWORD = 0x4000; +pub const SPEAKER_TOP_BACK_LEFT: DWORD = 0x8000; +pub const SPEAKER_TOP_BACK_CENTER: DWORD = 0x10000; +pub const SPEAKER_TOP_BACK_RIGHT: DWORD = 0x20000; +pub const SPEAKER_RESERVED: DWORD = 0x7FFC0000; +pub const SPEAKER_ALL: DWORD = 0x80000000; +STRUCT!{#[repr(packed)] struct WAVEFORMATEX { + wFormatTag: WORD, + nChannels: WORD, + nSamplesPerSec: DWORD, + nAvgBytesPerSec: DWORD, + nBlockAlign: WORD, + wBitsPerSample: WORD, + cbSize: WORD, +}} +STRUCT!{#[repr(packed)] struct WAVEFORMATEXTENSIBLE { + Format: WAVEFORMATEX, + Samples: WORD, + dwChannelMask: DWORD, + SubFormat: GUID, +}} diff --git a/bash-5.1/vendor/winapi/src/shared/mod.rs b/bash-5.1/vendor/winapi/src/shared/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..8924f7b1ef71624dc1a133434bc151a48bdc7fe1 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/mod.rs @@ -0,0 +1,92 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Headers shared between user mode and kernel mode +#[cfg(feature = "basetsd")] pub mod basetsd; +#[cfg(feature = "bcrypt")] pub mod bcrypt; +#[cfg(feature = "bthdef")] pub mod bthdef; +#[cfg(feature = "bthioctl")] pub mod bthioctl; +#[cfg(feature = "bthsdpdef")] pub mod bthsdpdef; +#[cfg(feature = "bugcodes")] pub mod bugcodes; +#[cfg(feature = "cderr")] pub mod cderr; +#[cfg(feature = "cfg")] pub mod cfg; +#[cfg(feature = "d3d9")] pub mod d3d9; +#[cfg(feature = "d3d9caps")] pub mod d3d9caps; +#[cfg(feature = "d3d9types")] pub mod d3d9types; +#[cfg(feature = "d3dkmdt")] pub mod d3dkmdt; +#[cfg(feature = "d3dukmdt")] pub mod d3dukmdt; +#[cfg(feature = "dcomptypes")] pub mod dcomptypes; +#[cfg(feature = "devguid")] pub mod devguid; +#[cfg(feature = "devpkey")] pub mod devpkey; +#[cfg(feature = "devpropdef")] pub mod devpropdef; +#[cfg(feature = "dinputd")] pub mod dinputd; +#[cfg(feature = "dxgi")] pub mod dxgi; +#[cfg(feature = "dxgi1_2")] pub mod dxgi1_2; +#[cfg(feature = "dxgi1_3")] pub mod dxgi1_3; +#[cfg(feature = "dxgi1_4")] pub mod dxgi1_4; +#[cfg(feature = "dxgi1_5")] pub mod dxgi1_5; +#[cfg(feature = "dxgi1_6")] pub mod dxgi1_6; +#[cfg(feature = "dxgiformat")] pub mod dxgiformat; +#[cfg(feature = "dxgitype")] pub mod dxgitype; +#[cfg(feature = "evntprov")] pub mod evntprov; +#[cfg(feature = "evntrace")] pub mod evntrace; +pub mod guiddef; +#[cfg(feature = "hidclass")] pub mod hidclass; +#[cfg(feature = "hidpi")] pub mod hidpi; +#[cfg(feature = "hidsdi")] pub mod hidsdi; +#[cfg(feature = "hidusage")] pub mod hidusage; +#[cfg(feature = "ifdef")] pub mod ifdef; +#[cfg(feature = "ifmib")] pub mod ifmib; +#[cfg(feature = "in6addr")] pub mod in6addr; +#[cfg(feature = "inaddr")] pub mod inaddr; +#[cfg(feature = "intsafe")] pub mod intsafe; +#[cfg(feature = "ipifcons")] pub mod ipifcons; +#[cfg(feature = "ipmib")] pub mod ipmib; +#[cfg(feature = "iprtrmib")] pub mod iprtrmib; +#[cfg(feature = "ks")] pub mod ks; +#[cfg(feature = "ksmedia")] pub mod ksmedia; +#[cfg(feature = "ktmtypes")] pub mod ktmtypes; +#[cfg(feature = "lmcons")] pub mod lmcons; +#[cfg(feature = "minwindef")] pub mod minwindef; +#[cfg(feature = "mmreg")] pub mod mmreg; +#[cfg(feature = "mprapidef")] pub mod mprapidef; +#[cfg(feature = "mstcpip")] pub mod mstcpip; +#[cfg(feature = "mswsockdef")] pub mod mswsockdef; +#[cfg(feature = "netioapi")] pub mod netioapi; +#[cfg(feature = "nldef")] pub mod nldef; +#[cfg(feature = "ntddndis")] pub mod ntddndis; +#[cfg(feature = "ntddscsi")] pub mod ntddscsi; +#[cfg(feature = "ntddser")] pub mod ntddser; +#[cfg(feature = "ntdef")] pub mod ntdef; +#[cfg(feature = "ntstatus")] pub mod ntstatus; +#[cfg(feature = "qos")] pub mod qos; +#[cfg(feature = "rpc")] pub mod rpc; +#[cfg(feature = "rpcdce")] pub mod rpcdce; +#[cfg(feature = "rpcndr")] pub mod rpcndr; +#[cfg(feature = "sddl")] pub mod sddl; +#[cfg(feature = "sspi")] pub mod sspi; +#[cfg(feature = "stralign")] pub mod stralign; +#[cfg(feature = "tcpestats")] pub mod tcpestats; +#[cfg(feature = "tcpmib")] pub mod tcpmib; +#[cfg(feature = "transportsettingcommon")] pub mod transportsettingcommon; +#[cfg(feature = "tvout")] pub mod tvout; +#[cfg(feature = "udpmib")] pub mod udpmib; +#[cfg(feature = "usb")] pub mod usb; +#[cfg(feature = "usbioctl")] pub mod usbioctl; +#[cfg(feature = "usbiodef")] pub mod usbiodef; +#[cfg(feature = "usbscan")] pub mod usbscan; +#[cfg(feature = "usbspec")] pub mod usbspec; +#[cfg(feature = "windef")] pub mod windef; +#[cfg(feature = "windot11")] pub mod windot11; +#[cfg(feature = "windowsx")] pub mod windowsx; +#[cfg(feature = "winerror")] pub mod winerror; +#[cfg(feature = "winusbio")] pub mod winusbio; +#[cfg(feature = "wlantypes")] pub mod wlantypes; +#[cfg(feature = "wmistr")] pub mod wmistr; +#[cfg(feature = "wnnc")] pub mod wnnc; +#[cfg(feature = "ws2def")] pub mod ws2def; +#[cfg(feature = "ws2ipdef")] pub mod ws2ipdef; +#[cfg(feature = "wtypes")] pub mod wtypes; +#[cfg(feature = "wtypesbase")] pub mod wtypesbase; diff --git a/bash-5.1/vendor/winapi/src/shared/mprapidef.rs b/bash-5.1/vendor/winapi/src/shared/mprapidef.rs new file mode 100644 index 0000000000000000000000000000000000000000..db5c1696df4dac19a520144065e587665d44e8f8 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/mprapidef.rs @@ -0,0 +1,14 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! MPR (Multiple Provider Router) definitions +// #include +pub const MAX_INTERFACE_NAME_LEN: usize = 256; +pub const MAX_TRANSPORT_NAME_LEN: usize = 40; +pub const MAX_MEDIA_NAME: usize = 16; +pub const MAX_PORT_NAME: usize = 16; +pub const MAX_DEVICE_NAME: usize = 128; +pub const MAX_PHONE_NUMBER_LEN: usize = 128; +pub const MAX_DEVICETYPE_NAME: usize = 16; diff --git a/bash-5.1/vendor/winapi/src/shared/mstcpip.rs b/bash-5.1/vendor/winapi/src/shared/mstcpip.rs new file mode 100644 index 0000000000000000000000000000000000000000..fe2072544d0e4a6995f55ccc23cd9941b5e4f649 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/mstcpip.rs @@ -0,0 +1,492 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! This module contains Microsoft-specific extensions to the core Winsock definitions. +use ctypes::wchar_t; +use shared::basetsd::{UINT32, UINT64, ULONG64}; +use shared::guiddef::GUID; +use shared::in6addr::IN6_ADDR; +use shared::inaddr::IN_ADDR; +use shared::minwindef::{DWORD, PULONG, PUSHORT, UCHAR, ULONG, USHORT}; +use shared::ws2def::{ + INADDR_ANY, INADDR_BROADCAST, INADDR_NONE, IOC_VENDOR, SOCKADDR_IN, + SOCKADDR_STORAGE, +}; +use um::winnt::{BOOLEAN, LONG, LPCWSTR, PCSTR, PCWSTR, PSTR, PWSTR}; +DEFINE_GUID!{SOCKET_DEFAULT2_QM_POLICY, + 0xaec2ef9c, 0x3a4d, 0x4d3e, 0x88, 0x42, 0x23, 0x99, 0x42, 0xe3, 0x9a, 0x47} +DEFINE_GUID!{REAL_TIME_NOTIFICATION_CAPABILITY, + 0x6b59819a, 0x5cae, 0x492d, 0xa9, 0x01, 0x2a, 0x3c, 0x2c, 0x50, 0x16, 0x4f} +DEFINE_GUID!{REAL_TIME_NOTIFICATION_CAPABILITY_EX, + 0x6843da03, 0x154a, 0x4616, 0xa5, 0x08, 0x44, 0x37, 0x12, 0x95, 0xf9, 0x6b} +DEFINE_GUID!{ASSOCIATE_NAMERES_CONTEXT, + 0x59a38b67, 0xd4fe, 0x46e1, 0xba, 0x3c, 0x87, 0xea, 0x74, 0xca, 0x30, 0x49} +ENUM!{enum TCPSTATE { + TCPSTATE_CLOSED, + TCPSTATE_LISTEN, + TCPSTATE_SYN_SENT, + TCPSTATE_SYN_RCVD, + TCPSTATE_ESTABLISHED, + TCPSTATE_FIN_WAIT_1, + TCPSTATE_FIN_WAIT_2, + TCPSTATE_CLOSE_WAIT, + TCPSTATE_CLOSING, + TCPSTATE_LAST_ACK, + TCPSTATE_TIME_WAIT, + TCPSTATE_MAX, +}} +STRUCT!{struct TRANSPORT_SETTING_ID { + Guid: GUID, +}} +pub type PTRANSPORT_SETTING_ID = *mut TRANSPORT_SETTING_ID; +STRUCT!{struct tcp_keepalive { + onoff: ULONG, + keepalivetime: ULONG, + keepaliveinterval: ULONG, +}} +ENUM!{enum CONTROL_CHANNEL_TRIGGER_STATUS { + CONTROL_CHANNEL_TRIGGER_STATUS_INVALID = 0, + CONTROL_CHANNEL_TRIGGER_STATUS_SOFTWARE_SLOT_ALLOCATED = 1, + CONTROL_CHANNEL_TRIGGER_STATUS_HARDWARE_SLOT_ALLOCATED = 2, + CONTROL_CHANNEL_TRIGGER_STATUS_POLICY_ERROR = 3, + CONTROL_CHANNEL_TRIGGER_STATUS_SYSTEM_ERROR = 4, + CONTROL_CHANNEL_TRIGGER_STATUS_TRANSPORT_DISCONNECTED = 5, + CONTROL_CHANNEL_TRIGGER_STATUS_SERVICE_UNAVAILABLE = 6, +}} +pub type PCONTROL_CHANNEL_TRIGGER_STATUS = *mut CONTROL_CHANNEL_TRIGGER_STATUS; +pub const CONTROL_CHANNEL_TRIGGER_STATUS_MAX: u32 = CONTROL_CHANNEL_TRIGGER_STATUS_SYSTEM_ERROR; +STRUCT!{struct REAL_TIME_NOTIFICATION_SETTING_INPUT { + TransportSettingId: TRANSPORT_SETTING_ID, + BrokerEventGuid: GUID, +}} +pub type PREAL_TIME_NOTIFICATION_SETTING_INPUT = *mut REAL_TIME_NOTIFICATION_SETTING_INPUT; +STRUCT!{struct REAL_TIME_NOTIFICATION_SETTING_INPUT_EX { + TransportSettingId: TRANSPORT_SETTING_ID, + BrokerEventGuid: GUID, + Unmark: BOOLEAN, +}} +pub type PREAL_TIME_NOTIFICATION_SETTING_INPUT_EX = *mut REAL_TIME_NOTIFICATION_SETTING_INPUT_EX; +STRUCT!{struct REAL_TIME_NOTIFICATION_SETTING_OUTPUT { + ChannelStatus: CONTROL_CHANNEL_TRIGGER_STATUS, +}} +pub type PREAL_TIME_NOTIFICATION_SETTING_OUTPUT = *mut REAL_TIME_NOTIFICATION_SETTING_OUTPUT; +STRUCT!{struct ASSOCIATE_NAMERES_CONTEXT_INPUT { + TransportSettingId: TRANSPORT_SETTING_ID, + Handle: UINT64, +}} +pub type PASSOCIATE_NAMERES_CONTEXT_INPUT = *mut ASSOCIATE_NAMERES_CONTEXT_INPUT; +pub const SIO_RCVALL: DWORD = _WSAIOW!(IOC_VENDOR,1); +pub const SIO_RCVALL_MCAST: DWORD = _WSAIOW!(IOC_VENDOR,2); +pub const SIO_RCVALL_IGMPMCAST: DWORD = _WSAIOW!(IOC_VENDOR,3); +pub const SIO_KEEPALIVE_VALS: DWORD = _WSAIOW!(IOC_VENDOR,4); +pub const SIO_ABSORB_RTRALERT: DWORD = _WSAIOW!(IOC_VENDOR,5); +pub const SIO_UCAST_IF: DWORD = _WSAIOW!(IOC_VENDOR,6); +pub const SIO_LIMIT_BROADCASTS: DWORD = _WSAIOW!(IOC_VENDOR,7); +pub const SIO_INDEX_BIND: DWORD = _WSAIOW!(IOC_VENDOR,8); +pub const SIO_INDEX_MCASTIF: DWORD = _WSAIOW!(IOC_VENDOR,9); +pub const SIO_INDEX_ADD_MCAST: DWORD = _WSAIOW!(IOC_VENDOR,10); +pub const SIO_INDEX_DEL_MCAST: DWORD = _WSAIOW!(IOC_VENDOR,11); +pub const SIO_RCVALL_MCAST_IF: DWORD = _WSAIOW!(IOC_VENDOR,13); +pub const SIO_RCVALL_IF: DWORD = _WSAIOW!(IOC_VENDOR,14); +pub const SIO_LOOPBACK_FAST_PATH: DWORD = _WSAIOW!(IOC_VENDOR,16); +pub const SIO_TCP_INITIAL_RTO: DWORD = _WSAIOW!(IOC_VENDOR,17); +pub const SIO_APPLY_TRANSPORT_SETTING: DWORD = _WSAIOW!(IOC_VENDOR,19); +pub const SIO_QUERY_TRANSPORT_SETTING: DWORD = _WSAIOW!(IOC_VENDOR,20); +pub const SIO_TCP_SET_ICW: DWORD = _WSAIOW!(IOC_VENDOR,22); +pub const SIO_TCP_SET_ACK_FREQUENCY: DWORD = _WSAIOW!(IOC_VENDOR,23); +pub const SIO_TCP_INFO: DWORD = _WSAIORW!(IOC_VENDOR,39); +ENUM!{enum RCVALL_VALUE { + RCVALL_OFF = 0, + RCVALL_ON = 1, + RCVALL_SOCKETLEVELONLY = 2, + RCVALL_IPLEVEL = 3, +}} +pub type PRCVALL_VALUE = *mut RCVALL_VALUE; +STRUCT!{struct RCVALL_IF { + Mode: RCVALL_VALUE, + Interface: ULONG, +}} +pub type PRCVALL_IF = *mut RCVALL_IF; +pub const TCP_INITIAL_RTO_UNSPECIFIED_RTT: USHORT = -1i16 as u16; +pub const TCP_INITIAL_RTO_UNSPECIFIED_MAX_SYN_RETRANSMISSIONS: UCHAR = -1i8 as u8; +pub const TCP_INITIAL_RTO_DEFAULT_RTT: USHORT = 0; +pub const TCP_INITIAL_RTO_DEFAULT_MAX_SYN_RETRANSMISSIONS: UCHAR = 0; +STRUCT!{struct TCP_INITIAL_RTO_PARAMETERS { + Rtt: USHORT, + MaxSynRetransmissions: UCHAR, +}} +pub type PTCP_INITIAL_RTO_PARAMETERS = *mut TCP_INITIAL_RTO_PARAMETERS; +ENUM!{enum TCP_ICW_LEVEL { + TCP_ICW_LEVEL_DEFAULT = 0, + TCP_ICW_LEVEL_HIGH = 1, + TCP_ICW_LEVEL_VERY_HIGH = 2, + TCP_ICW_LEVEL_AGGRESSIVE = 3, + TCP_ICW_LEVEL_EXPERIMENTAL = 4, + TCP_ICW_LEVEL_COMPAT = 254, + TCP_ICW_LEVEL_MAX = 255, +}} +pub type PTCP_ICW_LEVEL = *mut TCP_ICW_LEVEL; +STRUCT!{struct TCP_ICW_PARAMETERS { + Level: TCP_ICW_LEVEL, +}} +pub type PTCP_ICW_PARAMETERS = *mut TCP_ICW_PARAMETERS; +STRUCT!{struct TCP_ACK_FREQUENCY_PARAMETERS { + TcpDelayedAckFrequency: UCHAR, +}} +pub type PTCP_ACK_FREQUENCY_PARAMETERS = *mut TCP_ACK_FREQUENCY_PARAMETERS; +STRUCT!{struct TCP_INFO_v0 { + State: TCPSTATE, + Mss: ULONG, + ConnectionTimeMs: ULONG64, + TimestampsEnabled: BOOLEAN, + RttUs: ULONG, + MinRttUs: ULONG, + BytesInFlight: ULONG, + Cwnd: ULONG, + SndWnd: ULONG, + RcvWnd: ULONG, + RcvBuf: ULONG, + BytesOut: ULONG64, + BytesIn: ULONG64, + BytesReordered: ULONG, + BytesRetrans: ULONG, + FastRetrans: ULONG, + DupAcksIn: ULONG, + TimeoutEpisodes: ULONG, + SynRetrans: UCHAR, +}} +pub type PTCP_INFO_v0 = *mut TCP_INFO_v0; +pub const SIO_ACQUIRE_PORT_RESERVATION: DWORD = _WSAIOW!(IOC_VENDOR, 100); +pub const SIO_RELEASE_PORT_RESERVATION: DWORD = _WSAIOW!(IOC_VENDOR, 101); +pub const SIO_ASSOCIATE_PORT_RESERVATION: DWORD = _WSAIOW!(IOC_VENDOR, 102); +STRUCT!{struct INET_PORT_RANGE { + StartPort: USHORT, + NumberOfPorts: USHORT, +}} +pub type PINET_PORT_RANGE = *mut INET_PORT_RANGE; +pub type INET_PORT_RESERVATION = INET_PORT_RANGE; +pub type PINET_PORT_RESERVATION = *mut INET_PORT_RANGE; +STRUCT!{struct INET_PORT_RESERVATION_TOKEN { + Token: ULONG64, +}} +pub type PINET_PORT_RESERVATION_TOKEN = *mut INET_PORT_RESERVATION_TOKEN; +STRUCT!{struct INET_PORT_RESERVATION_INSTANCE { + Reservation: INET_PORT_RESERVATION, + Token: INET_PORT_RESERVATION_TOKEN, +}} +pub type PINET_PORT_RESERVATION_INSTANCE = *mut INET_PORT_RESERVATION_INSTANCE; +STRUCT!{struct INET_PORT_RESERVATION_INFORMATION { + OwningPid: ULONG, +}} +pub type PINET_PORT_RESERVATION_INFORMATION = *mut INET_PORT_RESERVATION_INFORMATION; +pub const SIO_SET_SECURITY: DWORD = _WSAIOW!(IOC_VENDOR, 200); +pub const SIO_QUERY_SECURITY: DWORD = _WSAIORW!(IOC_VENDOR, 201); +pub const SIO_SET_PEER_TARGET_NAME: DWORD = _WSAIOW!(IOC_VENDOR, 202); +pub const SIO_DELETE_PEER_TARGET_NAME: DWORD = _WSAIOW!(IOC_VENDOR, 203); +pub const SIO_QUERY_WFP_CONNECTION_REDIRECT_RECORDS: DWORD = _WSAIOW!(IOC_VENDOR, 220); +pub const SIO_QUERY_WFP_CONNECTION_REDIRECT_CONTEXT: DWORD = _WSAIOW!(IOC_VENDOR, 221); +pub const SIO_SET_WFP_CONNECTION_REDIRECT_RECORDS: DWORD = _WSAIOW!(IOC_VENDOR, 222); +pub const SIO_SOCKET_USAGE_NOTIFICATION: DWORD = _WSAIOW!(IOC_VENDOR, 204); +ENUM!{enum SOCKET_USAGE_TYPE { + SYSTEM_CRITICAL_SOCKET = 1, +}} +ENUM!{enum SOCKET_SECURITY_PROTOCOL { + SOCKET_SECURITY_PROTOCOL_DEFAULT, + SOCKET_SECURITY_PROTOCOL_IPSEC, + SOCKET_SECURITY_PROTOCOL_IPSEC2, + SOCKET_SECURITY_PROTOCOL_INVALID, +}} +STRUCT!{struct SOCKET_SECURITY_SETTINGS { + SecurityProtocol: SOCKET_SECURITY_PROTOCOL, + SecurityFlags: ULONG, +}} +pub const SOCKET_SETTINGS_IPSEC_SKIP_FILTER_INSTANTIATION: ULONG = 0x1; +pub const SOCKET_SETTINGS_IPSEC_OPTIONAL_PEER_NAME_VERIFICATION: ULONG = 0x2; +pub const SOCKET_SETTINGS_IPSEC_ALLOW_FIRST_INBOUND_PKT_UNENCRYPTED: ULONG = 0x4; +pub const SOCKET_SETTINGS_IPSEC_PEER_NAME_IS_RAW_FORMAT: ULONG = 0x8; +STRUCT!{struct SOCKET_SECURITY_SETTINGS_IPSEC { + SecurityProtocol: SOCKET_SECURITY_PROTOCOL, + SecurityFlags: ULONG, + IpsecFlags: ULONG, + AuthipMMPolicyKey: GUID, + AuthipQMPolicyKey: GUID, + Reserved: GUID, + Reserved2: UINT64, + UserNameStringLen: ULONG, + DomainNameStringLen: ULONG, + PasswordStringLen: ULONG, + AllStrings: [wchar_t; 0], +}} +STRUCT!{struct SOCKET_PEER_TARGET_NAME { + SecurityProtocol: SOCKET_SECURITY_PROTOCOL, + PeerAddress: SOCKADDR_STORAGE, + PeerTargetNameStringLen: ULONG, + AllStrings: [wchar_t; 0], +}} +STRUCT!{struct SOCKET_SECURITY_QUERY_TEMPLATE { + SecurityProtocol: SOCKET_SECURITY_PROTOCOL, + PeerAddress: SOCKADDR_STORAGE, + PeerTokenAccessMask: ULONG, +}} +pub const SOCKET_QUERY_IPSEC2_ABORT_CONNECTION_ON_FIELD_CHANGE: ULONG = 0x1; +pub const SOCKET_QUERY_IPSEC2_FIELD_MASK_MM_SA_ID: ULONG = 0x1; +pub const SOCKET_QUERY_IPSEC2_FIELD_MASK_QM_SA_ID: ULONG = 0x2; +STRUCT!{struct SOCKET_SECURITY_QUERY_TEMPLATE_IPSEC2 { + SecurityProtocol: SOCKET_SECURITY_PROTOCOL, + PeerAddress: SOCKADDR_STORAGE, + PeerTokenAccessMask: ULONG, + Flags: ULONG, + FieldMask: ULONG, +}} +pub const SOCKET_INFO_CONNECTION_SECURED: ULONG = 0x1; +pub const SOCKET_INFO_CONNECTION_ENCRYPTED: ULONG = 0x2; +pub const SOCKET_INFO_CONNECTION_IMPERSONATED: ULONG = 0x4; +STRUCT!{struct SOCKET_SECURITY_QUERY_INFO { + SecurityProtocol: SOCKET_SECURITY_PROTOCOL, + Flags: ULONG, + PeerApplicationAccessTokenHandle: UINT64, + PeerMachineAccessTokenHandle: UINT64, +}} +STRUCT!{struct SOCKET_SECURITY_QUERY_INFO_IPSEC2 { + SecurityProtocol: SOCKET_SECURITY_PROTOCOL, + Flags: ULONG, + PeerApplicationAccessTokenHandle: UINT64, + PeerMachineAccessTokenHandle: UINT64, + MmSaId: UINT64, + QmSaId: UINT64, + NegotiationWinerr: UINT32, + SaLookupContext: GUID, +}} +pub const SIO_QUERY_WFP_ALE_ENDPOINT_HANDLE: DWORD = _WSAIOR!(IOC_VENDOR, 205); +pub const SIO_QUERY_RSS_SCALABILITY_INFO: DWORD = _WSAIOR!(IOC_VENDOR, 210); +STRUCT!{struct RSS_SCALABILITY_INFO { + RssEnabled: BOOLEAN, +}} +pub type PRSS_SCALABILITY_INFO = *mut RSS_SCALABILITY_INFO; +#[inline] +pub fn IN4_CLASSA(i: LONG) -> bool { + (i & 0x80) == 0 +} +#[inline] +pub fn IN4_CLASSB(i: LONG) -> bool { + (i & 0xc0) == 0x80 +} +#[inline] +pub fn IN4_CLASSC(i: LONG) -> bool { + (i & 0xe0) == 0xc0 +} +#[inline] +pub fn IN4_CLASSD(i: LONG) -> bool { + (i & 0xf0) == 0xe0 +} +#[inline] +pub fn IN4_MULTICAST(i: LONG) -> bool { + IN4_CLASSD(i) +} +pub const IN4ADDR_ANY: ULONG = INADDR_ANY; +pub const IN4ADDR_LOOPBACK: ULONG = 0x0100007f; +pub const IN4ADDR_BROADCAST: ULONG = INADDR_BROADCAST; +pub const IN4ADDR_NONE: ULONG = INADDR_NONE; +pub const IN4ADDR_LOOPBACKPREFIX_LENGTH: usize = 8; +pub const IN4ADDR_LINKLOCALPREFIX_LENGTH: usize = 16; +pub const IN4ADDR_MULTICASTPREFIX_LENGTH: usize = 4; +#[inline] +pub fn IN4_ADDR_EQUAL(a: &IN_ADDR, b: &IN_ADDR) -> bool { + unsafe { *a.S_un.S_addr() == *b.S_un.S_addr() } +} +#[inline] +pub fn IN4_UNALIGNED_ADDR_EQUAL(a: &IN_ADDR, b: &IN_ADDR) -> bool { + unsafe { *a.S_un.S_addr() == *b.S_un.S_addr() } +} +#[inline] +pub fn IN4_IS_ADDR_UNSPECIFIED(a: &IN_ADDR) -> bool { + unsafe { *a.S_un.S_addr() == IN4ADDR_ANY } +} +#[inline] +pub fn IN4_IS_UNALIGNED_ADDR_UNSPECIFIED(a: &IN_ADDR) -> bool { + unsafe { *a.S_un.S_addr() == IN4ADDR_ANY } +} +#[inline] +pub fn IN4_IS_ADDR_LOOPBACK(a: &IN_ADDR) -> bool { + unsafe { a.S_un.S_un_b().s_b1 == 0x7f } +} +#[inline] +pub fn IN4_IS_UNALIGNED_ADDR_LOOPBACK(a: &IN_ADDR) -> bool { + unsafe { a.S_un.S_un_b().s_b1 == 0x7f } +} +#[inline] +pub fn IN4_IS_ADDR_BROADCAST(a: &IN_ADDR) -> bool { + unsafe { *a.S_un.S_addr() == IN4ADDR_BROADCAST } +} +#[inline] +pub fn IN4_IS_UNALIGNED_ADDR_BROADCAST(a: &IN_ADDR) -> bool { + unsafe { *a.S_un.S_addr() == IN4ADDR_BROADCAST } +} +#[inline] +pub fn IN4_IS_ADDR_MULTICAST(a: &IN_ADDR) -> bool { + IN4_MULTICAST(unsafe { *a.S_un.S_addr() as LONG }) +} +#[inline] +pub fn IN4_IS_UNALIGNED_ADDR_MULTICAST(a: &IN_ADDR) -> bool { + IN4_MULTICAST(unsafe { *a.S_un.S_addr() as LONG }) +} +#[inline] +pub fn IN4_IS_ADDR_LINKLOCAL(a: &IN_ADDR) -> bool { + unsafe { (*a.S_un.S_addr() & 0xffff) == 0xfea9 } +} +#[inline] +pub fn IN4_IS_UNALIGNED_ADDR_LINKLOCAL(a: &IN_ADDR) -> bool { + unsafe { (*a.S_un.S_addr() & 0xffff) == 0xfea9 } +} +#[inline] +pub fn IN4_IS_ADDR_SITELOCAL(_: &IN_ADDR) -> bool { + false +} +#[inline] +pub fn IN4_IS_UNALIGNED_ADDR_SITELOCAL(_: &IN_ADDR) -> bool { + false +} +#[inline] +pub fn IN4_IS_ADDR_RFC1918(a: &IN_ADDR) -> bool { + let s_addr = unsafe { *a.S_un.S_addr() }; + ((s_addr & 0x00ff) == 0x0a) || ((s_addr & 0xf0ff) == 0x10ac) || ((s_addr & 0xffff) == 0xa8c0) +} +#[inline] +pub fn IN4_IS_UNALIGNED_ADDR_RFC1918(a: &IN_ADDR) -> bool { + IN4_IS_ADDR_RFC1918(a) +} +#[inline] +pub fn IN4_IS_ADDR_MC_LINKLOCAL(a: &IN_ADDR) -> bool { + unsafe { (*a.S_un.S_addr() & 0xffffff) == 0xe0 } +} +#[inline] +pub fn IN4_IS_ADDR_MC_ADMINLOCAL(a: &IN_ADDR) -> bool { + unsafe { (*a.S_un.S_addr() & 0xffff) == 0xffef } +} +#[inline] +pub fn IN4_IS_ADDR_MC_SITELOCAL(a: &IN_ADDR) -> bool { + let first = unsafe { (*a.S_un.S_addr() & 0xff) == 0xef }; + first && !IN4_IS_ADDR_MC_ADMINLOCAL(a) +} +#[inline] +pub fn IN4ADDR_ISANY(a: &SOCKADDR_IN) -> bool { + IN4_IS_ADDR_UNSPECIFIED(&a.sin_addr) +} +#[inline] +pub fn IN4ADDR_ISLOOPBACK(a: &SOCKADDR_IN) -> bool { + IN4_IS_ADDR_LOOPBACK(&a.sin_addr) +} +extern "system" { + pub fn RtlIpv4AddressToStringA( + Addr: *const IN_ADDR, + S: PSTR, + ) -> PSTR; + pub fn RtlIpv4AddressToStringExA( + Address: *const IN_ADDR, + Port: USHORT, + AddressString: PSTR, + AddressStringLength: PULONG, + ) -> LONG; + pub fn RtlIpv4AddressToStringW( + Addr: *const IN_ADDR, + S: PWSTR, + ) -> PWSTR; + pub fn RtlIpv4AddressToStringExW( + Address: *const IN_ADDR, + Port: USHORT, + AddressString: PWSTR, + AddressStringLength: PULONG, + ) -> LONG; + pub fn RtlIpv4StringToAddressA( + S: PCSTR, + Strict: BOOLEAN, + Terminator: *mut PCSTR, + Addr: *mut IN_ADDR, + ) -> LONG; + pub fn RtlIpv4StringToAddressExA( + AddressString: PCSTR, + Strict: BOOLEAN, + Address: *mut IN_ADDR, + Port: PUSHORT, + ) -> LONG; + pub fn RtlIpv4StringToAddressW( + S: PCWSTR, + Strict: BOOLEAN, + Terminator: *mut LPCWSTR, + Addr: *mut IN_ADDR, + ) -> LONG; + pub fn RtlIpv4StringToAddressExW( + AddressString: PCWSTR, + Strict: BOOLEAN, + Address: *mut IN_ADDR, + Port: PUSHORT, + ) -> LONG; + pub fn RtlIpv6AddressToStringA( + Addr: *const IN6_ADDR, + S: PSTR, + ) -> PSTR; + pub fn RtlIpv6AddressToStringExA( + Address: *const IN6_ADDR, + ScopeId: ULONG, + Port: USHORT, + AddressString: PSTR, + AddressStringLength: PULONG, + ) -> LONG; + pub fn RtlIpv6AddressToStringW( + Addr: *const IN6_ADDR, + S: PWSTR, + ) -> PWSTR; + pub fn RtlIpv6AddressToStringExW( + Address: *const IN6_ADDR, + ScopeId: ULONG, + Port: USHORT, + AddressString: PWSTR, + AddressStringLength: PULONG, + ) -> LONG; + pub fn RtlIpv6StringToAddressA( + S: PCSTR, + Terminator: *mut PCSTR, + Addr: *mut IN6_ADDR, + ) -> LONG; + pub fn RtlIpv6StringToAddressExA( + AddressString: PCSTR, + Address: *mut IN6_ADDR, + ScopeId: PULONG, + Port: PUSHORT, + ) -> LONG; + pub fn RtlIpv6StringToAddressW( + S: PCWSTR, + Terminator: *mut PCWSTR, + Addr: *mut IN6_ADDR, + ) -> LONG; + pub fn RtlIpv6StringToAddressExW( + AddressString: PCWSTR, + Address: *mut IN6_ADDR, + ScopeId: PULONG, + Port: PUSHORT, + ) -> LONG; +} +DECLARE_HANDLE!{DL_EUI48, _DL_EUI48} +pub type PDL_EUI48 = *mut DL_EUI48; +extern "system" { + pub fn RtlEthernetAddressToStringA( + Addr: *const DL_EUI48, + S: PSTR, + ) -> PSTR; + pub fn RtlEthernetAddressToStringW( + Addr: *const DL_EUI48, + S: PWSTR, + ) -> PWSTR; + pub fn RtlEthernetStringToAddressA( + S: PCSTR, + Terminator: *mut PCSTR, + Addr: *mut DL_EUI48, + ) -> LONG; + pub fn RtlEthernetStringToAddressW( + S: PCWSTR, + Terminator: *mut LPCWSTR, + Addr: *mut DL_EUI48, + ) -> LONG; +} diff --git a/bash-5.1/vendor/winapi/src/shared/mswsockdef.rs b/bash-5.1/vendor/winapi/src/shared/mswsockdef.rs new file mode 100644 index 0000000000000000000000000000000000000000..b62cf299d07182a7c5fb629baac458b84ce78d7b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/mswsockdef.rs @@ -0,0 +1,48 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{DWORD, ULONG}; +use shared::ws2def::IOC_VENDOR; +use um::winnt::{LONG, PVOID, ULONGLONG}; +pub const SIO_SET_COMPATIBILITY_MODE: DWORD = _WSAIOW!(IOC_VENDOR, 300); +ENUM!{enum WSA_COMPATIBILITY_BEHAVIOR_ID { + WsaBehaviorAll = 0, + WsaBehaviorReceiveBuffering, + WsaBehaviorAutoTuning, +}} +pub type PWSA_COMPATIBILITY_BEHAVIOR_ID = *mut WSA_COMPATIBILITY_BEHAVIOR_ID; +STRUCT!{struct WSA_COMPATIBILITY_MODE { + BehaviorId: WSA_COMPATIBILITY_BEHAVIOR_ID, + TargetOsVersion: ULONG, +}} +pub type PWSA_COMPATIBILITY_MODE = *mut WSA_COMPATIBILITY_MODE; +pub type RIO_BUFFERID = PVOID; +pub type PRIO_BUFFERID = *mut PVOID; +pub type RIO_CQ = PVOID; +pub type PRIO_CQ = *mut PVOID; +pub type RIO_RQ = PVOID; +pub type PRIO_RQ = *mut PVOID; +STRUCT!{struct RIORESULT { + Status: LONG, + BytesTransferred: ULONG, + SocketContext: ULONGLONG, + RequestContext: ULONGLONG, +}} +pub type PRIORESULT = *mut RIORESULT; +STRUCT!{struct RIO_BUF { + BufferId: RIO_BUFFERID, + Offset: ULONG, + Length: ULONG, +}} +pub type PRIO_BUF = *mut RIO_BUF; +pub const RIO_MSG_DONT_NOTIFY: DWORD = 0x00000001; +pub const RIO_MSG_DEFER: DWORD = 0x00000002; +pub const RIO_MSG_WAITALL: DWORD = 0x00000004; +pub const RIO_MSG_COMMIT_ONLY: DWORD = 0x00000008; +pub const RIO_INVALID_BUFFERID: RIO_BUFFERID = 0xFFFFFFFF as RIO_BUFFERID; +pub const RIO_INVALID_CQ: RIO_CQ = 0 as RIO_CQ; +pub const RIO_INVALID_RQ: RIO_RQ = 0 as RIO_RQ; +pub const RIO_MAX_CQ_SIZE: DWORD = 0x8000000; +pub const RIO_CORRUPT_CQ: ULONG = 0xFFFFFFFF; diff --git a/bash-5.1/vendor/winapi/src/shared/netioapi.rs b/bash-5.1/vendor/winapi/src/shared/netioapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..9098b704930035f57d3a8f116b1df2a962df81ad --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/netioapi.rs @@ -0,0 +1,702 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{PUINT8, SIZE_T, UINT8, ULONG64}; +use shared::guiddef::GUID; +use shared::ifdef::{ + IF_MAX_PHYS_ADDRESS_LENGTH, IF_MAX_STRING_SIZE, IF_OPER_STATUS, NET_IFINDEX, + NET_IF_ACCESS_TYPE, NET_IF_ADMIN_STATUS, NET_IF_COMPARTMENT_ID, NET_IF_COMPARTMENT_SCOPE, + NET_IF_CONNECTION_TYPE, NET_IF_DIRECTION_TYPE, NET_IF_MEDIA_CONNECT_STATE, NET_IF_NETWORK_GUID, + NET_LUID, PNET_IFINDEX, PNET_IF_COMPARTMENT_ID, PNET_IF_COMPARTMENT_SCOPE, PNET_LUID, + TUNNEL_TYPE, +}; +use shared::ipifcons::IFTYPE; +use shared::minwindef::{BYTE, DWORD, PULONG, UCHAR, ULONG, USHORT}; +use shared::nldef::{ + NL_BANDWIDTH_INFORMATION, NL_DAD_STATE, NL_INTERFACE_OFFLOAD_ROD, + NL_LINK_LOCAL_ADDRESS_BEHAVIOR, NL_NEIGHBOR_STATE, NL_PREFIX_ORIGIN, + NL_ROUTER_DISCOVERY_BEHAVIOR, NL_ROUTE_ORIGIN, NL_ROUTE_PROTOCOL, NL_SUFFIX_ORIGIN, +}; +use shared::ntddndis::{NDIS_MEDIUM, NDIS_PHYSICAL_MEDIUM}; +use shared::ntdef::{ + BOOLEAN, CHAR, HANDLE, LARGE_INTEGER, PCHAR, PCSTR, PSTR, PVOID, PWCHAR, PWSTR, WCHAR, +}; +use shared::ws2def::{ADDRESS_FAMILY, SCOPE_ID, ScopeLevelCount}; +use shared::ws2ipdef::{PSOCKADDR_IN6_PAIR, SOCKADDR_IN6, SOCKADDR_INET}; +const ANY_SIZE: usize = 1; +pub type NETIO_STATUS = DWORD; +pub type NETIOAPI_API = NETIO_STATUS; +ENUM!{enum MIB_NOTIFICATION_TYPE { + MibParameterNotification, + MibAddInstance, + MibDeleteInstance, + MibInitialNotification, +}} +pub type PMIB_NOTIFICATION_TYPE = *mut MIB_NOTIFICATION_TYPE; +STRUCT!{struct MIB_IF_ROW2_InterfaceAndOperStatusFlags { + bitfield: BYTE, +}} +BITFIELD!{MIB_IF_ROW2_InterfaceAndOperStatusFlags bitfield: BOOLEAN [ + HardwareInterface set_HardwareInterface[0..1], + FilterInterface set_FilterInterface[1..2], + ConnectorPresent set_ConnectorPresent[2..3], + NotAuthenticated set_NotAuthenticated[3..4], + NotMediaConnected set_NotMediaConnected[4..5], + Paused set_Paused[5..6], + LowPower set_LowPower[6..7], + EndPointInterface set_EndPointInterface[7..8], +]} +STRUCT!{struct MIB_IF_ROW2 { + InterfaceLuid: NET_LUID, + InterfaceIndex: NET_IFINDEX, + InterfaceGuid: GUID, + Alias: [WCHAR; IF_MAX_STRING_SIZE + 1], + Description: [WCHAR; IF_MAX_STRING_SIZE + 1], + PhysicalAddressLength: ULONG, + PhysicalAddress: [UCHAR; IF_MAX_PHYS_ADDRESS_LENGTH], + PermanentPhysicalAddress: [UCHAR; IF_MAX_PHYS_ADDRESS_LENGTH], + Mtu: ULONG, + Type: IFTYPE, + TunnelType: TUNNEL_TYPE, + MediaType: NDIS_MEDIUM, + PhysicalMediumType: NDIS_PHYSICAL_MEDIUM, + AccessType: NET_IF_ACCESS_TYPE, + DirectionType: NET_IF_DIRECTION_TYPE, + InterfaceAndOperStatusFlags: MIB_IF_ROW2_InterfaceAndOperStatusFlags, + OperStatus: IF_OPER_STATUS, + AdminStatus: NET_IF_ADMIN_STATUS, + MediaConnectState: NET_IF_MEDIA_CONNECT_STATE, + NetworkGuid: NET_IF_NETWORK_GUID, + ConnectionType: NET_IF_CONNECTION_TYPE, + TransmitLinkSpeed: ULONG64, + ReceiveLinkSpeed: ULONG64, + InOctets: ULONG64, + InUcastPkts: ULONG64, + InNUcastPkts: ULONG64, + InDiscards: ULONG64, + InErrors: ULONG64, + InUnknownProtos: ULONG64, + InUcastOctets: ULONG64, + InMulticastOctets: ULONG64, + InBroadcastOctets: ULONG64, + OutOctets: ULONG64, + OutUcastPkts: ULONG64, + OutNUcastPkts: ULONG64, + OutDiscards: ULONG64, + OutErrors: ULONG64, + OutUcastOctets: ULONG64, + OutMulticastOctets: ULONG64, + OutBroadcastOctets: ULONG64, + OutQLen: ULONG64, +}} +pub type PMIB_IF_ROW2 = *mut MIB_IF_ROW2; +STRUCT!{struct MIB_IF_TABLE2 { + NumEntries: ULONG, + Table: [MIB_IF_ROW2; ANY_SIZE], +}} +pub type PMIB_IF_TABLE2 = *mut MIB_IF_TABLE2; +extern "system" { + pub fn GetIfEntry2( + Row: PMIB_IF_ROW2, + ) -> NETIOAPI_API; +} +ENUM!{enum MIB_IF_ENTRY_LEVEL { + MibIfEntryNormal = 0, + MibIfEntryNormalWithoutStatistics = 2, +}} +pub type PMIB_IF_ENTRY_LEVEL = *mut MIB_IF_ENTRY_LEVEL; +extern "system" { + pub fn GetIfEntry2Ex( + Level: MIB_IF_ENTRY_LEVEL, + Row: PMIB_IF_ROW2, + ) -> NETIOAPI_API; + pub fn GetIfTable2( + Table: *mut PMIB_IF_TABLE2, + ) -> NETIOAPI_API; +} +ENUM!{enum MIB_IF_TABLE_LEVEL { + MibIfTableNormal = 0, + MibIfTableRaw = 1, + MibIfTableNormalWithoutStatistics = 2, +}} +pub type PMIB_IF_TABLE_LEVEL = *mut MIB_IF_TABLE_LEVEL; +extern "system" { + pub fn GetIfTable2Ex( + Level: MIB_IF_TABLE_LEVEL, + Table: *mut PMIB_IF_TABLE2, + ) -> NETIOAPI_API; +} +STRUCT!{struct MIB_IPINTERFACE_ROW { + Family: ADDRESS_FAMILY, + InterfaceLuid: NET_LUID, + InterfaceIndex: NET_IFINDEX, + MaxReassemblySize: ULONG, + InterfaceIdentifier: ULONG64, + MinRouterAdvertisementInterval: ULONG, + MaxRouterAdvertisementInterval: ULONG, + AdvertisingEnabled: BOOLEAN, + ForwardingEnabled: BOOLEAN, + WeakHostSend: BOOLEAN, + WeakHostReceive: BOOLEAN, + UseAutomaticMetric: BOOLEAN, + UseNeighborUnreachabilityDetection: BOOLEAN, + ManagedAddressConfigurationSupported: BOOLEAN, + OtherStatefulConfigurationSupported: BOOLEAN, + AdvertiseDefaultRoute: BOOLEAN, + RouterDiscoveryBehavior: NL_ROUTER_DISCOVERY_BEHAVIOR, + DadTransmits: ULONG, // DupAddrDetectTransmits in RFC 2462. + BaseReachableTime: ULONG, + RetransmitTime: ULONG, + PathMtuDiscoveryTimeout: ULONG, // Path MTU discovery timeout (in ms). + LinkLocalAddressBehavior: NL_LINK_LOCAL_ADDRESS_BEHAVIOR, + LinkLocalAddressTimeout: ULONG, // In ms. + ZoneIndices: [ULONG; ScopeLevelCount as usize], // Zone part of a SCOPE_ID. + SitePrefixLength: ULONG, + Metric: ULONG, + NlMtu: ULONG, + Connected: BOOLEAN, + SupportsWakeUpPatterns: BOOLEAN, + SupportsNeighborDiscovery: BOOLEAN, + SupportsRouterDiscovery: BOOLEAN, + ReachableTime: ULONG, + TransmitOffload: NL_INTERFACE_OFFLOAD_ROD, + ReceiveOffload: NL_INTERFACE_OFFLOAD_ROD, + DisableDefaultRoutes: BOOLEAN, +}} +pub type PMIB_IPINTERFACE_ROW = *mut MIB_IPINTERFACE_ROW; +STRUCT!{struct MIB_IPINTERFACE_TABLE { + NumEntries: ULONG, + Table: [MIB_IPINTERFACE_ROW; ANY_SIZE], +}} +pub type PMIB_IPINTERFACE_TABLE = *mut MIB_IPINTERFACE_TABLE; +STRUCT!{struct MIB_IFSTACK_ROW { + HigherLayerInterfaceIndex: NET_IFINDEX, + LowerLayerInterfaceIndex: NET_IFINDEX, +}} +pub type PMIB_IFSTACK_ROW = *mut MIB_IFSTACK_ROW; +STRUCT!{struct MIB_INVERTEDIFSTACK_ROW { + LowerLayerInterfaceIndex: NET_IFINDEX, + HigherLayerInterfaceIndex: NET_IFINDEX, +}} +pub type PMIB_INVERTEDIFSTACK_ROW = *mut MIB_INVERTEDIFSTACK_ROW; +STRUCT!{struct MIB_IFSTACK_TABLE { + NumEntries: ULONG, + Table: [MIB_IFSTACK_ROW; ANY_SIZE], +}} +pub type PMIB_IFSTACK_TABLE = *mut MIB_IFSTACK_TABLE; +STRUCT!{struct MIB_INVERTEDIFSTACK_TABLE { + NumEntries: ULONG, + Table: [MIB_INVERTEDIFSTACK_ROW; ANY_SIZE], +}} +pub type PMIB_INVERTEDIFSTACK_TABLE = *mut MIB_INVERTEDIFSTACK_TABLE; +FN!{stdcall PIPINTERFACE_CHANGE_CALLBACK( + CallerContext: PVOID, + Row: PMIB_IPINTERFACE_ROW, + NotificationType: MIB_NOTIFICATION_TYPE, +) -> ()} +STRUCT!{struct MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES { + InboundBandwidthInformation: NL_BANDWIDTH_INFORMATION, + OutboundBandwidthInformation: NL_BANDWIDTH_INFORMATION, +}} +pub type PMIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES = *mut + MIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES; +extern "system" { + pub fn GetIfStackTable( + Table: *mut PMIB_IFSTACK_TABLE, + ) -> NETIOAPI_API; + pub fn GetInvertedIfStackTable( + Table: *mut PMIB_INVERTEDIFSTACK_TABLE, + ) -> NETIOAPI_API; + pub fn GetIpInterfaceEntry( + Row: PMIB_IPINTERFACE_ROW, + ) -> NETIOAPI_API; + pub fn GetIpInterfaceTable( + Family: ADDRESS_FAMILY, + Table: *mut PMIB_IPINTERFACE_TABLE, + ) -> NETIOAPI_API; + pub fn InitializeIpInterfaceEntry( + Row: PMIB_IPINTERFACE_ROW, + ); + pub fn NotifyIpInterfaceChange( + Family: ADDRESS_FAMILY, + Callback: PIPINTERFACE_CHANGE_CALLBACK, + CallerContext: PVOID, + InitialNotification: BOOLEAN, + NotificationHandle: *mut HANDLE + ) -> NETIOAPI_API; + pub fn SetIpInterfaceEntry( + Row: PMIB_IPINTERFACE_ROW, + ) -> NETIOAPI_API; + pub fn GetIpNetworkConnectionBandwidthEstimates( + InterfaceIndex: NET_IFINDEX, + AddressFamily: ADDRESS_FAMILY, + BandwidthEstimates: PMIB_IP_NETWORK_CONNECTION_BANDWIDTH_ESTIMATES, + ) -> NETIOAPI_API; +} +STRUCT!{struct MIB_UNICASTIPADDRESS_ROW { + Address: SOCKADDR_INET, + InterfaceLuid: NET_LUID, + InterfaceIndex: NET_IFINDEX, + PrefixOrigin: NL_PREFIX_ORIGIN, + SuffixOrigin: NL_SUFFIX_ORIGIN, + ValidLifetime: ULONG, + PreferredLifetime: ULONG, + OnLinkPrefixLength: UINT8, + SkipAsSource: BOOLEAN, + DadState: NL_DAD_STATE, + ScopeId: SCOPE_ID, + CreationTimeStamp: LARGE_INTEGER, +}} +pub type PMIB_UNICASTIPADDRESS_ROW = *mut MIB_UNICASTIPADDRESS_ROW; +STRUCT!{struct MIB_UNICASTIPADDRESS_TABLE { + NumEntries: ULONG, + Table: [MIB_UNICASTIPADDRESS_ROW; ANY_SIZE], +}} +pub type PMIB_UNICASTIPADDRESS_TABLE = *mut MIB_UNICASTIPADDRESS_TABLE; +FN!{stdcall PUNICAST_IPADDRESS_CHANGE_CALLBACK( + CallerContext: PVOID, + Row: PMIB_UNICASTIPADDRESS_ROW, + NotificationType: MIB_NOTIFICATION_TYPE, +) -> ()} +extern "system" { + pub fn CreateUnicastIpAddressEntry( + Row: *const MIB_UNICASTIPADDRESS_ROW, + ) -> NETIOAPI_API; + pub fn DeleteUnicastIpAddressEntry( + Row: *const MIB_UNICASTIPADDRESS_ROW, + ) -> NETIOAPI_API; + pub fn GetUnicastIpAddressEntry( + Row: PMIB_UNICASTIPADDRESS_ROW + ) -> NETIOAPI_API; + pub fn GetUnicastIpAddressTable( + Family: ADDRESS_FAMILY, + Table: *mut PMIB_UNICASTIPADDRESS_TABLE, + ) -> NETIOAPI_API; + pub fn InitializeUnicastIpAddressEntry( + Row: PMIB_UNICASTIPADDRESS_ROW, + ); + pub fn NotifyUnicastIpAddressChange( + Family: ADDRESS_FAMILY, + Callback: PUNICAST_IPADDRESS_CHANGE_CALLBACK, + CallerContext: PVOID, + InitialNotification: BOOLEAN, + NotificationHandle: *mut HANDLE, + ) -> NETIOAPI_API; +} +FN!{stdcall PSTABLE_UNICAST_IPADDRESS_TABLE_CALLBACK( + CallerContext: PVOID, + AddressTable: PMIB_UNICASTIPADDRESS_TABLE, +) -> ()} +extern "system" { + pub fn NotifyStableUnicastIpAddressTable( + Family: ADDRESS_FAMILY, + Table: *mut PMIB_UNICASTIPADDRESS_TABLE, + CallerCallback: PSTABLE_UNICAST_IPADDRESS_TABLE_CALLBACK, + CallerContext: PVOID, + NotificationHandle: *mut HANDLE, + ) -> NETIOAPI_API; + pub fn SetUnicastIpAddressEntry( + Row: *const MIB_UNICASTIPADDRESS_ROW, + ) -> NETIOAPI_API; +} +STRUCT!{struct MIB_ANYCASTIPADDRESS_ROW { + Address: SOCKADDR_INET, + InterfaceLuid: NET_LUID, + InterfaceIndex: NET_IFINDEX, + ScopeId: SCOPE_ID, +}} +pub type PMIB_ANYCASTIPADDRESS_ROW = *mut MIB_ANYCASTIPADDRESS_ROW; +STRUCT!{struct MIB_ANYCASTIPADDRESS_TABLE { + NumEntries: ULONG, + Table: [MIB_ANYCASTIPADDRESS_ROW; ANY_SIZE], +}} +pub type PMIB_ANYCASTIPADDRESS_TABLE = *mut MIB_ANYCASTIPADDRESS_TABLE; +extern "system" { + pub fn CreateAnycastIpAddressEntry( + Row: *const MIB_ANYCASTIPADDRESS_ROW, + ) -> NETIOAPI_API; + pub fn DeleteAnycastIpAddressEntry( + Row: *const MIB_ANYCASTIPADDRESS_ROW, + ) -> NETIOAPI_API; + pub fn GetAnycastIpAddressEntry( + Row: PMIB_ANYCASTIPADDRESS_ROW, + ) -> NETIOAPI_API; + pub fn GetAnycastIpAddressTable( + Family: ADDRESS_FAMILY, + Table: *mut PMIB_ANYCASTIPADDRESS_TABLE, + ) -> NETIOAPI_API; +} +STRUCT!{struct MIB_MULTICASTIPADDRESS_ROW { + Address: SOCKADDR_INET, + InterfaceIndex: NET_IFINDEX, + InterfaceLuid: NET_LUID, + ScopeId: SCOPE_ID, +}} +pub type PMIB_MULTICASTIPADDRESS_ROW = *mut MIB_MULTICASTIPADDRESS_ROW; +STRUCT!{struct MIB_MULTICASTIPADDRESS_TABLE { + NumEntries: ULONG, + Table: [MIB_MULTICASTIPADDRESS_ROW; ANY_SIZE], +}} +pub type PMIB_MULTICASTIPADDRESS_TABLE = *mut MIB_MULTICASTIPADDRESS_TABLE; +extern "system" { + pub fn GetMulticastIpAddressEntry( + Row: PMIB_MULTICASTIPADDRESS_ROW, + ) -> NETIOAPI_API; + pub fn GetMulticastIpAddressTable( + Family: ADDRESS_FAMILY, + Table: *mut PMIB_MULTICASTIPADDRESS_TABLE, + ) -> NETIOAPI_API; +} +STRUCT!{struct IP_ADDRESS_PREFIX { + Prefix: SOCKADDR_INET, + PrefixLength: UINT8, +}} +pub type PIP_ADDRESS_PREFIX = *mut IP_ADDRESS_PREFIX; +STRUCT!{struct MIB_IPFORWARD_ROW2 { + InterfaceLuid: NET_LUID, + InterfaceIndex: NET_IFINDEX, + DestinationPrefix: IP_ADDRESS_PREFIX, + NextHop: SOCKADDR_INET, + SitePrefixLength: UCHAR, + ValidLifetime: ULONG, + PreferredLifetime: ULONG, + Metric: ULONG, + Protocol: NL_ROUTE_PROTOCOL, + Loopback: BOOLEAN, + AutoconfigureAddress: BOOLEAN, + Publish: BOOLEAN, + Immortal: BOOLEAN, + Age: ULONG, + Origin: NL_ROUTE_ORIGIN, +}} +pub type PMIB_IPFORWARD_ROW2 = *mut MIB_IPFORWARD_ROW2; +STRUCT!{struct MIB_IPFORWARD_TABLE2 { + NumEntries: ULONG, + Table: [MIB_IPFORWARD_ROW2; ANY_SIZE], +}} +pub type PMIB_IPFORWARD_TABLE2 = *mut MIB_IPFORWARD_TABLE2; +FN!{stdcall PIPFORWARD_CHANGE_CALLBACK( + CallerContext: PVOID, + Row: PMIB_IPFORWARD_ROW2, + NotificationType: MIB_NOTIFICATION_TYPE, +) -> ()} +extern "system" { + pub fn CreateIpForwardEntry2( + Row: *const MIB_IPFORWARD_ROW2, + ) -> NETIOAPI_API; + pub fn DeleteIpForwardEntry2( + Row: *const MIB_IPFORWARD_ROW2, + ) -> NETIOAPI_API; + pub fn GetBestRoute2( + InterfaceLuid: *mut NET_LUID, + InterfaceIndex: NET_IFINDEX, + SourceAddress: *const SOCKADDR_INET, + DestinationAddress: *const SOCKADDR_INET, + AddressSortOptions: ULONG, + BestRoute: PMIB_IPFORWARD_ROW2, + BestSourceAddress: *mut SOCKADDR_INET, + ) -> NETIOAPI_API; + pub fn GetIpForwardEntry2( + Row: PMIB_IPFORWARD_ROW2, + ) -> NETIOAPI_API; + pub fn GetIpForwardTable2( + Family: ADDRESS_FAMILY, + Table: *mut PMIB_IPFORWARD_TABLE2, + ) -> NETIOAPI_API; + pub fn InitializeIpForwardEntry( + Row: PMIB_IPFORWARD_ROW2, + ); + pub fn NotifyRouteChange2( + AddressFamily: ADDRESS_FAMILY, + Callback: PIPFORWARD_CHANGE_CALLBACK, + CallerContext: PVOID, + InitialNotification: BOOLEAN, + NotificationHandle: *mut HANDLE, + ) -> NETIOAPI_API; + pub fn SetIpForwardEntry2( + Route: *const MIB_IPFORWARD_ROW2, + ) -> NETIOAPI_API; +} +UNION!{union MIB_IPPATH_ROW_u { + [u32; 1], + LastReachable LastReachable_mut: ULONG, // Milliseconds. + LastUnreachable LastUnreachable_mut: ULONG, // Milliseconds. +}} +STRUCT!{struct MIB_IPPATH_ROW { + Source: SOCKADDR_INET, + Destination: SOCKADDR_INET, + InterfaceLuid: NET_LUID, + InterfaceIndex: NET_IFINDEX, + CurrentNextHop: SOCKADDR_INET, + PathMtu: ULONG, + RttMean: ULONG, + RttDeviation: ULONG, + u: MIB_IPPATH_ROW_u, + IsReachable: BOOLEAN, + LinkTransmitSpeed: ULONG64, + LinkReceiveSpeed: ULONG64, +}} +pub type PMIB_IPPATH_ROW = *mut MIB_IPPATH_ROW; +STRUCT!{struct MIB_IPPATH_TABLE { + NumEntries: ULONG, + Table: [MIB_IPPATH_ROW; ANY_SIZE], +}} +pub type PMIB_IPPATH_TABLE = *mut MIB_IPPATH_TABLE; +extern "system" { + pub fn FlushIpPathTable( + Family: ADDRESS_FAMILY, + ) -> NETIOAPI_API; + pub fn GetIpPathEntry( + Row: PMIB_IPPATH_ROW, + ) -> NETIOAPI_API; + pub fn GetIpPathTable( + Family: ADDRESS_FAMILY, + Table: *mut PMIB_IPPATH_TABLE, + ) -> NETIOAPI_API; +} +STRUCT!{struct MIB_IPNET_ROW2_s { + Flags: UCHAR, +}} +BITFIELD!{MIB_IPNET_ROW2_s Flags: UCHAR [ + IsRouter set_IsRouter[0..1], + IsUnreachable set_IsUnreachable[1..2], + Reserved set_Reserved[2..8], +]} +UNION!{union MIB_IPNET_ROW2_ReachabilityTime { + [u32; 1], + LastReachable LastReachable_mut: ULONG, + LastUnreachable LastUnreachable_mut: ULONG, +}} +STRUCT!{struct MIB_IPNET_ROW2 { + Address: SOCKADDR_INET, + InterfaceIndex: NET_IFINDEX, + InterfaceLuid: NET_LUID, + PhysicalAddress: [UCHAR; IF_MAX_PHYS_ADDRESS_LENGTH], + PhysicalAddressLength: ULONG, + State: NL_NEIGHBOR_STATE, + s: MIB_IPNET_ROW2_s, + ReachabilityTime: MIB_IPNET_ROW2_ReachabilityTime, +}} +pub type PMIB_IPNET_ROW2 = *mut MIB_IPNET_ROW2; +STRUCT!{struct MIB_IPNET_TABLE2 { + NumEntries: ULONG, + Table: [MIB_IPNET_ROW2; ANY_SIZE], +}} +pub type PMIB_IPNET_TABLE2 = *mut MIB_IPNET_TABLE2; +extern "system" { + pub fn CreateIpNetEntry2( + Row: *const MIB_IPNET_ROW2, + ) -> NETIOAPI_API; + pub fn DeleteIpNetEntry2( + Row: *const MIB_IPNET_ROW2, + ) -> NETIOAPI_API; + pub fn FlushIpNetTable2( + Family: ADDRESS_FAMILY, + InterfaceIndex: NET_IFINDEX, + ) -> NETIOAPI_API; + pub fn GetIpNetEntry2( + Row: PMIB_IPNET_ROW2, + ) -> NETIOAPI_API; + pub fn GetIpNetTable2( + Family: ADDRESS_FAMILY, + Table: *mut PMIB_IPNET_TABLE2, + ) -> NETIOAPI_API; + pub fn ResolveIpNetEntry2( + Row: PMIB_IPNET_ROW2, + SourceAddress: *const SOCKADDR_INET, + ) -> NETIOAPI_API; + pub fn SetIpNetEntry2( + Row: PMIB_IPNET_ROW2, + ) -> NETIOAPI_API; +} +pub const MIB_INVALID_TEREDO_PORT_NUMBER: USHORT = 0; +FN!{stdcall PTEREDO_PORT_CHANGE_CALLBACK( + CallerContext: PVOID, + Port: USHORT, + NotificationType: MIB_NOTIFICATION_TYPE, +) -> ()} +extern "system" { + pub fn NotifyTeredoPortChange( + Callback: PTEREDO_PORT_CHANGE_CALLBACK, + CallerContext: PVOID, + InitialNotification: BOOLEAN, + NotificationHandle: *mut HANDLE, + ) -> NETIOAPI_API; + pub fn GetTeredoPort( + Port: *mut USHORT, + ) -> NETIOAPI_API; + pub fn CancelMibChangeNotify2( + NotificationHandle: HANDLE, + ) -> NETIOAPI_API; + pub fn FreeMibTable( + Memory: PVOID, + ); + pub fn CreateSortedAddressPairs( + SourceAddressList: *const SOCKADDR_IN6, + SourceAddressCount: ULONG, + DestinationAddressList: *const SOCKADDR_IN6, + DestinationAddressCount: ULONG, + AddressSortOptions: ULONG, + SortedAddressPairList: *mut PSOCKADDR_IN6_PAIR, + SortedAddressPairCount: *mut ULONG, + ) -> NETIOAPI_API; + pub fn ConvertCompartmentGuidToId( + CompartmentGuid: *const GUID, + CompartmentId: PNET_IF_COMPARTMENT_ID, + ) -> NETIOAPI_API; + pub fn ConvertCompartmentIdToGuid( + CompartmentId: NET_IF_COMPARTMENT_ID, + CompartmentGuid: *mut GUID, + ) -> NETIOAPI_API; + pub fn ConvertInterfaceNameToLuidA( + InterfaceName: *const CHAR, + InterfaceLuid: *mut NET_LUID, + ) -> NETIOAPI_API; + pub fn ConvertInterfaceNameToLuidW( + InterfaceName: *const WCHAR, + InterfaceLuid: *mut NET_LUID, + ) -> NETIOAPI_API; + pub fn ConvertInterfaceLuidToNameA( + InterfaceLuid: *const NET_LUID, + InterfaceName: PSTR, + Length: SIZE_T, + ) -> NETIOAPI_API; + pub fn ConvertInterfaceLuidToNameW( + InterfaceLuid: *const NET_LUID, + InterfaceName: PWSTR, + Length: SIZE_T, + ) -> NETIOAPI_API; + pub fn ConvertInterfaceLuidToIndex( + InterfaceLuid: *const NET_LUID, + InterfaceIndex: PNET_IFINDEX, + ) -> NETIOAPI_API; + pub fn ConvertInterfaceIndexToLuid( + InterfaceIndex: NET_IFINDEX, + InterfaceLuid: PNET_LUID, + ) -> NETIOAPI_API; + pub fn ConvertInterfaceLuidToAlias( + InterfaceLuid: *const NET_LUID, + InterfaceAlias: PWSTR, + Length: SIZE_T, + ) -> NETIOAPI_API; + pub fn ConvertInterfaceAliasToLuid( + InterfaceAlias: *const WCHAR, + InterfaceLuid: PNET_LUID, + ) -> NETIOAPI_API; + pub fn ConvertInterfaceLuidToGuid( + InterfaceLuid: *const NET_LUID, + InterfaceGuid: *mut GUID, + ) -> NETIOAPI_API; + pub fn ConvertInterfaceGuidToLuid( + InterfaceGuid: *const GUID, + InterfaceLuid: PNET_LUID, + ) -> NETIOAPI_API; + pub fn if_nametoindex( + InterfaceName: PCSTR, + ) -> NET_IFINDEX; + pub fn if_indextoname( + InterfaceIndex: NET_IFINDEX, + InterfaceName: PCHAR, + ) -> PCHAR; + pub fn GetCurrentThreadCompartmentId() -> NET_IF_COMPARTMENT_ID; + pub fn SetCurrentThreadCompartmentId( + CompartmentId: NET_IF_COMPARTMENT_ID + ) -> NETIOAPI_API; + pub fn GetCurrentThreadCompartmentScope( + CompartmentScope: PNET_IF_COMPARTMENT_SCOPE, + CompartmentId: PNET_IF_COMPARTMENT_ID, + ); + pub fn SetCurrentThreadCompartmentScope( + CompartmentScope: NET_IF_COMPARTMENT_SCOPE, + ) -> NETIOAPI_API; + pub fn GetJobCompartmentId( + JobHandle: HANDLE, + ) -> NET_IF_COMPARTMENT_ID; + pub fn SetJobCompartmentId( + JobHandle: HANDLE, + CompartmentId: NET_IF_COMPARTMENT_ID, + ) -> NETIOAPI_API; + pub fn GetSessionCompartmentId( + SessionId: ULONG, + ) -> NET_IF_COMPARTMENT_ID; + pub fn SetSessionCompartmentId( + SessionId: ULONG, + CompartmentId: NET_IF_COMPARTMENT_ID, + ) -> NETIOAPI_API; + pub fn GetDefaultCompartmentId() -> NET_IF_COMPARTMENT_ID; + pub fn GetNetworkInformation( + NetworkGuid: *const NET_IF_NETWORK_GUID, + CompartmentId: PNET_IF_COMPARTMENT_ID, + SiteId: PULONG, + NetworkName: PWCHAR, + Length: ULONG, + ) -> NETIOAPI_API; + pub fn SetNetworkInformation( + NetworkGuid: *const NET_IF_NETWORK_GUID, + CompartmentId: NET_IF_COMPARTMENT_ID, + NetworkName: *const WCHAR, + ) -> NETIOAPI_API; + pub fn ConvertLengthToIpv4Mask( + MaskLength: ULONG, + Mask: PULONG, + ) -> NETIOAPI_API; + pub fn ConvertIpv4MaskToLength( + Mask: ULONG, + MaskLength: PUINT8, + ) -> NETIOAPI_API; +} +pub const DNS_SETTINGS_VERSION1: ULONG = 0x0001; +pub const DNS_INTERFACE_SETTINGS_VERSION1: ULONG = 0x0001; +pub const DNS_SETTING_IPV6: ULONG64 = 0x0001; +pub const DNS_SETTING_NAMESERVER: ULONG64 = 0x0002; +pub const DNS_SETTING_SEARCHLIST: ULONG64 = 0x0004; +pub const DNS_SETTING_REGISTRATION_ENABLED: ULONG64 = 0x0008; +pub const DNS_SETTING_REGISTER_ADAPTER_NAME: ULONG64 = 0x0010; +pub const DNS_SETTING_DOMAIN: ULONG64 = 0x0020; +pub const DNS_SETTING_HOSTNAME: ULONG64 = 0x0040; +pub const DNS_SETTINGS_ENABLE_LLMNR: ULONG64 = 0x0080; +pub const DNS_SETTINGS_QUERY_ADAPTER_NAME: ULONG64 = 0x0100; +pub const DNS_SETTING_PROFILE_NAMESERVER: ULONG64 = 0x0200; +STRUCT!{struct DNS_SETTINGS { + Version: ULONG, + Flags: ULONG64, + Hostname: PWSTR, + Domain: PWSTR, + SearchList: PWSTR, +}} +STRUCT!{struct DNS_INTERFACE_SETTINGS { + Version: ULONG, + Flags: ULONG64, + Domain: PWSTR, + NameServer: PWSTR, + SearchList: PWSTR, + RegistrationEnabled: ULONG, + RegisterAdapterName: ULONG, + EnableLLMNR: ULONG, + QueryAdapterName: ULONG, + ProfileNameServer: PWSTR, +}} +extern "system" { + pub fn GetDnsSettings( + Settings: *mut DNS_SETTINGS, + ) -> NETIOAPI_API; + pub fn FreeDnsSettings( + Settings: *mut DNS_SETTINGS, + ); + pub fn SetDnsSettings( + Settings: *const DNS_SETTINGS, + ) -> NETIOAPI_API; + pub fn GetInterfaceDnsSettings( + Interface: GUID, + Settings: *mut DNS_INTERFACE_SETTINGS, + ) -> NETIOAPI_API; + pub fn FreeInterfaceDnsSettings( + Settings: *mut DNS_INTERFACE_SETTINGS, + ); + pub fn SetInterfaceDnsSettings( + Interface: GUID, + Settings: *const DNS_INTERFACE_SETTINGS, + ) -> NETIOAPI_API; +} diff --git a/bash-5.1/vendor/winapi/src/shared/nldef.rs b/bash-5.1/vendor/winapi/src/shared/nldef.rs new file mode 100644 index 0000000000000000000000000000000000000000..2805e593d84e0a7dc405e72287af20e518eccf09 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/nldef.rs @@ -0,0 +1,204 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::ULONG64; +use shared::minwindef::ULONG; +use shared::ntdef::BOOLEAN; +ENUM!{enum NL_PREFIX_ORIGIN { + IpPrefixOriginOther = 0, + IpPrefixOriginManual, + IpPrefixOriginWellKnown, + IpPrefixOriginDhcp, + IpPrefixOriginRouterAdvertisement, + IpPrefixOriginUnchanged = 1 << 4, +}} +pub const NlpoOther: NL_PREFIX_ORIGIN = IpPrefixOriginOther; +pub const NlpoManual: NL_PREFIX_ORIGIN = IpPrefixOriginManual; +pub const NlpoWellKnown: NL_PREFIX_ORIGIN = IpPrefixOriginWellKnown; +pub const NlpoDhcp: NL_PREFIX_ORIGIN = IpPrefixOriginDhcp; +pub const NlpoRouterAdvertisement: NL_PREFIX_ORIGIN = IpPrefixOriginRouterAdvertisement; +ENUM!{enum NL_SUFFIX_ORIGIN { + NlsoOther = 0, + NlsoManual, + NlsoWellKnown, + NlsoDhcp, + NlsoLinkLayerAddress, + NlsoRandom, + IpSuffixOriginOther = 0, + IpSuffixOriginManual, + IpSuffixOriginWellKnown, + IpSuffixOriginDhcp, + IpSuffixOriginLinkLayerAddress, + IpSuffixOriginRandom, + IpSuffixOriginUnchanged = 1 << 4, +}} +ENUM!{enum NL_DAD_STATE { + NldsInvalid, + NldsTentative, + NldsDuplicate, + NldsDeprecated, + NldsPreferred, + IpDadStateInvalid = 0, + IpDadStateTentative, + IpDadStateDuplicate, + IpDadStateDeprecated, + IpDadStatePreferred, +}} +pub const NL_MAX_METRIC_COMPONENT: ULONG = (1u32 << 31) - 1; +ENUM!{enum NL_ROUTE_PROTOCOL { + RouteProtocolOther = 1, + RouteProtocolLocal = 2, + RouteProtocolNetMgmt = 3, + RouteProtocolIcmp = 4, + RouteProtocolEgp = 5, + RouteProtocolGgp = 6, + RouteProtocolHello = 7, + RouteProtocolRip = 8, + RouteProtocolIsIs = 9, + RouteProtocolEsIs = 10, + RouteProtocolCisco = 11, + RouteProtocolBbn = 12, + RouteProtocolOspf = 13, + RouteProtocolBgp = 14, + RouteProtocolIdpr = 15, + RouteProtocolEigrp = 16, + RouteProtocolDvmrp = 17, + RouteProtocolRpl = 18, + RouteProtocolDhcp = 19, + MIB_IPPROTO_OTHER = 1, + PROTO_IP_OTHER = 1, + MIB_IPPROTO_LOCAL = 2, + PROTO_IP_LOCAL = 2, + MIB_IPPROTO_NETMGMT = 3, + PROTO_IP_NETMGMT = 3, + MIB_IPPROTO_ICMP = 4, + PROTO_IP_ICMP = 4, + MIB_IPPROTO_EGP = 5, + PROTO_IP_EGP = 5, + MIB_IPPROTO_GGP = 6, + PROTO_IP_GGP = 6, + MIB_IPPROTO_HELLO = 7, + PROTO_IP_HELLO = 7, + MIB_IPPROTO_RIP = 8, + PROTO_IP_RIP = 8, + MIB_IPPROTO_IS_IS = 9, + PROTO_IP_IS_IS = 9, + MIB_IPPROTO_ES_IS = 10, + PROTO_IP_ES_IS = 10, + MIB_IPPROTO_CISCO = 11, + PROTO_IP_CISCO = 11, + MIB_IPPROTO_BBN = 12, + PROTO_IP_BBN = 12, + MIB_IPPROTO_OSPF = 13, + PROTO_IP_OSPF = 13, + MIB_IPPROTO_BGP = 14, + PROTO_IP_BGP = 14, + MIB_IPPROTO_IDPR = 15, + PROTO_IP_IDPR = 15, + MIB_IPPROTO_EIGRP = 16, + PROTO_IP_EIGRP = 16, + MIB_IPPROTO_DVMRP = 17, + PROTO_IP_DVMRP = 17, + MIB_IPPROTO_RPL = 18, + PROTO_IP_RPL = 18, + MIB_IPPROTO_DHCP = 19, + PROTO_IP_DHCP = 19, + MIB_IPPROTO_NT_AUTOSTATIC = 10002, + PROTO_IP_NT_AUTOSTATIC = 10002, + MIB_IPPROTO_NT_STATIC = 10006, + PROTO_IP_NT_STATIC = 10006, + MIB_IPPROTO_NT_STATIC_NON_DOD = 10007, + PROTO_IP_NT_STATIC_NON_DOD = 10007, +}} +pub type PNL_ROUTE_PROTOCOL = *mut NL_ROUTE_PROTOCOL; +ENUM!{enum NL_ADDRESS_TYPE { + NlatUnspecified = 0, + NlatUnicast = 1, + NlatAnycast = 2, + NlatMulticast = 3, + NlatBroadcast = 4, + NlatInvalid = 5, +}} +pub type PNL_ADDRESS_TYPE = *mut NL_ADDRESS_TYPE; +ENUM!{enum NL_ROUTE_ORIGIN { + NlroManual = 0, + NlroWellKnown = 1, + NlroDHCP = 2, + NlroRouterAdvertisement = 3, + Nlro6to4 = 4, +}} +pub type PNL_ROUTE_ORIGIN = *mut NL_ROUTE_ORIGIN; +ENUM!{enum NL_NEIGHBOR_STATE { + NlnsUnreachable = 0, + NlnsIncomplete = 1, + NlnsProbe = 2, + NlnsDelay = 3, + NlnsStale = 4, + NlnsReachable = 5, + NlnsPermanent = 6, + NlnsMaximum = 7, +}} +pub type PNL_NEIGHBOR_STATE = *mut NL_NEIGHBOR_STATE; +ENUM!{enum NL_LINK_LOCAL_ADDRESS_BEHAVIOR { + LinkLocalAlwaysOff = 0, + LinkLocalDelayed = 1, + LinkLocalAlwaysOn = 2, + LinkLocalUnchanged = -1i32 as u32, +}} +STRUCT!{struct NL_INTERFACE_OFFLOAD_ROD { + bitfield: BOOLEAN, +}} +BITFIELD!{NL_INTERFACE_OFFLOAD_ROD bitfield: BOOLEAN [ + NlChecksumSupported set_NlChecksumSupported[0..1], + NlOptionsSupported set_NlOptionsSupported[1..2], + TlDatagramChecksumSupported set_TlDatagramChecksumSupported[2..3], + TlStreamChecksumSupported set_TlStreamChecksumSupported[3..4], + TlStreamOptionsSupported set_TlStreamOptionsSupported[4..5], + FastPathCompatible set_FastPathCompatible[5..6], + TlLargeSendOffloadSupported set_TlLargeSendOffloadSupported[6..7], + TlGiantSendOffloadSupported set_TlGiantSendOffloadSupported[7..8], +]} +pub type PNL_INTERFACE_OFFLOAD_ROD = *mut NL_INTERFACE_OFFLOAD_ROD; +ENUM!{enum NL_ROUTER_DISCOVERY_BEHAVIOR { + RouterDiscoveryDisabled = 0, + RouterDiscoveryEnabled = 1, + RouterDiscoveryDhcp = 2, + RouterDiscoveryUnchanged = -1i32 as u32, +}} +ENUM!{enum NL_BANDWIDTH_FLAG { + NlbwDisabled = 0, + NlbwEnabled = 1, + NlbwUnchanged = -1i32 as u32, +}} +pub type PNL_BANDWIDTH_FLAG = *mut NL_BANDWIDTH_FLAG; +STRUCT!{struct NL_PATH_BANDWIDTH_ROD { + Bandwidth: ULONG64, + Instability: ULONG64, + BandwidthPeaked: BOOLEAN, +}} +pub type PNL_PATH_BANDWIDTH_ROD = *mut NL_PATH_BANDWIDTH_ROD; +ENUM!{enum NL_NETWORK_CATEGORY { + NetworkCategoryPublic = 0, + NetworkCategoryPrivate = 1, + NetworkCategoryDomainAuthenticated = 2, + NetworkCategoryUnchanged = -1i32 as u32, + NetworkCategoryUnknown = -1i32 as u32, +}} +pub type PNL_NETWORK_CATEGORY = *mut NL_NETWORK_CATEGORY; +ENUM!{enum NL_INTERFACE_NETWORK_CATEGORY_STATE { + NlincCategoryUnknown = 0, + NlincPublic = 1, + NlincPrivate = 2, + NlincDomainAuthenticated = 3, + NlincCategoryStateMax = 4, +}} +pub type PNL_INTERFACE_NETWORK_CATEGORY_STATE = *mut NL_INTERFACE_NETWORK_CATEGORY_STATE; +pub const NET_IF_CURRENT_SESSION: ULONG = -1i32 as u32; +STRUCT!{struct NL_BANDWIDTH_INFORMATION { + Bandwidth: ULONG64, + Instability: ULONG64, + BandwidthPeaked: BOOLEAN, +}} +pub type PNL_BANDWIDTH_INFORMATION = *mut NL_BANDWIDTH_INFORMATION; diff --git a/bash-5.1/vendor/winapi/src/shared/ntddndis.rs b/bash-5.1/vendor/winapi/src/shared/ntddndis.rs new file mode 100644 index 0000000000000000000000000000000000000000..d519cb25522a0d9129bf22e4c4048f094e213fa7 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ntddndis.rs @@ -0,0 +1,75 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_int; +use shared::ifdef::IF_MAX_STRING_SIZE; +use shared::minwindef::{UCHAR, USHORT}; +//290 +STRUCT!{struct NDIS_OBJECT_HEADER { + Type: UCHAR, + Revision: UCHAR, + Size: USHORT, +}} +pub type PNDIS_OBJECT_HEADER = *mut NDIS_OBJECT_HEADER; +//2274 +ENUM!{enum NDIS_MEDIUM { + NdisMedium802_3 = 0, + NdisMedium802_5 = 1, + NdisMediumFddi = 2, + NdisMediumWan = 3, + NdisMediumLocalTalk = 4, + NdisMediumDix = 5, + NdisMediumArcnetRaw = 6, + NdisMediumArcnet878_2 = 7, + NdisMediumAtm = 8, + NdisMediumWirelessWan = 9, + NdisMediumIrda = 10, + NdisMediumBpc = 11, + NdisMediumCoWan = 12, + NdisMedium1394 = 13, + NdisMediumInfiniBand = 14, + NdisMediumTunnel = 15, + NdisMediumNative802_11 = 16, + NdisMediumLoopback = 17, + NdisMediumWiMAX = 18, + NdisMediumIP = 19, + NdisMediumMax = 20, +}} +pub type PNDIS_MEDIUM = *mut NDIS_MEDIUM; +ENUM!{enum NDIS_PHYSICAL_MEDIUM { + NdisPhysicalMediumUnspecified = 0, + NdisPhysicalMediumWirelessLan = 1, + NdisPhysicalMediumCableModem = 2, + NdisPhysicalMediumPhoneLine = 3, + NdisPhysicalMediumPowerLine = 4, + NdisPhysicalMediumDSL = 5, + NdisPhysicalMediumFibreChannel = 6, + NdisPhysicalMedium1394 = 7, + NdisPhysicalMediumWirelessWan = 8, + NdisPhysicalMediumNative802_11 = 9, + NdisPhysicalMediumBluetooth = 10, + NdisPhysicalMediumInfiniband = 11, + NdisPhysicalMediumWiMax = 12, + NdisPhysicalMediumUWB = 13, + NdisPhysicalMedium802_3 = 14, + NdisPhysicalMedium802_5 = 15, + NdisPhysicalMediumIrda = 16, + NdisPhysicalMediumWiredWAN = 17, + NdisPhysicalMediumWiredCoWan = 18, + NdisPhysicalMediumOther = 19, + NdisPhysicalMediumMax = 20, +}} +pub type PNDIS_PHYSICAL_MEDIUM = *mut NDIS_PHYSICAL_MEDIUM; +//2691 +pub type NDIS_STATUS = c_int; +pub type PNDIS_STATUS = *mut c_int; +//2736 +pub const NDIS_PACKET_TYPE_DIRECTED: u32 = 0x00000001; +pub const NDIS_PACKET_TYPE_MULTICAST: u32 = 0x00000002; +pub const NDIS_PACKET_TYPE_ALL_MULTICAST: u32 = 0x00000004; +pub const NDIS_PACKET_TYPE_BROADCAST: u32 = 0x00000008; +pub const NDIS_PACKET_TYPE_PROMISCUOUS: u32 = 0x00000020; +//2835 +pub const NDIS_IF_MAX_STRING_SIZE: usize = IF_MAX_STRING_SIZE; diff --git a/bash-5.1/vendor/winapi/src/shared/ntddscsi.rs b/bash-5.1/vendor/winapi/src/shared/ntddscsi.rs new file mode 100644 index 0000000000000000000000000000000000000000..c2e4f2c682a828a2b7a226bc31c438f0833ab3f8 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ntddscsi.rs @@ -0,0 +1,834 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Constants and types for accessing SCSI port adapters. +use shared::basetsd::{ULONG32, ULONG_PTR}; +use shared::minwindef::{UCHAR, ULONG, USHORT}; +use shared::ntdef::{LARGE_INTEGER, LONG, LONGLONG, PVOID, ULONGLONG, VOID, WCHAR}; +use um::winioctl::{ + DEVICE_TYPE, FILE_ANY_ACCESS, FILE_DEVICE_CONTROLLER, FILE_READ_ACCESS, + FILE_WRITE_ACCESS, METHOD_BUFFERED +}; +use um::winnt::{ANYSIZE_ARRAY, BOOLEAN, PBOOLEAN}; +DEFINE_GUID!{ScsiRawInterfaceGuid, + 0x53f56309, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{WmiScsiAddressGuid, + 0x53f5630f, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +pub const IOCTL_SCSI_BASE: DEVICE_TYPE = FILE_DEVICE_CONTROLLER; +pub const FILE_DEVICE_SCSI: ULONG = 0x0000001; +pub const DD_SCSI_DEVICE_NAME: &'static str = "\\Device\\ScsiPort"; +pub const IOCTL_SCSI_PASS_THROUGH: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_SCSI_MINIPORT: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_SCSI_GET_INQUIRY_DATA: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0403, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SCSI_GET_CAPABILITIES: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0404, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SCSI_PASS_THROUGH_DIRECT: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_SCSI_GET_ADDRESS: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0406, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SCSI_RESCAN_BUS: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0407, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SCSI_GET_DUMP_POINTERS: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0408, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SCSI_FREE_DUMP_POINTERS: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0409, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_IDE_PASS_THROUGH: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x040a, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_ATA_PASS_THROUGH: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x040b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_ATA_PASS_THROUGH_DIRECT: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x040c, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_ATA_MINIPORT: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x040d, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_MINIPORT_PROCESS_SERVICE_IRP: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x040e, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_MPIO_PASS_THROUGH_PATH: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x040f, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_MPIO_PASS_THROUGH_PATH_DIRECT: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0410, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_SCSI_PASS_THROUGH_EX: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0411, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_SCSI_PASS_THROUGH_DIRECT_EX: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0412, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_MPIO_PASS_THROUGH_PATH_EX: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0413, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_MPIO_PASS_THROUGH_PATH_DIRECT_EX: ULONG = + CTL_CODE!(IOCTL_SCSI_BASE, 0x0414, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_SCSI_MINIPORT_NVCACHE: ULONG = (FILE_DEVICE_SCSI << 16) + 0x0600; +pub const IOCTL_SCSI_MINIPORT_HYBRID: ULONG = (FILE_DEVICE_SCSI << 16) + 0x0620; +pub const IOCTL_SCSI_MINIPORT_FIRMWARE: ULONG = (FILE_DEVICE_SCSI << 16) + 0x0780; +STRUCT!{struct SCSI_PASS_THROUGH { + Length: USHORT, + ScsiStatus: UCHAR, + PathId: UCHAR, + TargetId: UCHAR, + Lun: UCHAR, + CdbLength: UCHAR, + SenseInfoLength: UCHAR, + DataIn: UCHAR, + DataTransferLength: ULONG, + TimeOutValue: ULONG, + DataBufferOffset: ULONG_PTR, + SenseInfoOffset: ULONG, + Cdb: [UCHAR; 16], +}} +pub type PSCSI_PASS_THROUGH = *mut SCSI_PASS_THROUGH; +STRUCT!{struct SCSI_PASS_THROUGH_DIRECT { + Length: USHORT, + ScsiStatus: UCHAR, + PathId: UCHAR, + TargetId: UCHAR, + Lun: UCHAR, + CdbLength: UCHAR, + SenseInfoLength: UCHAR, + DataIn: UCHAR, + DataTransferLength: ULONG, + TimeOutValue: ULONG, + DataBuffer: PVOID, + SenseInfoOffset: ULONG, + Cdb: [UCHAR; 16], +}} +pub type PSCSI_PASS_THROUGH_DIRECT = *mut SCSI_PASS_THROUGH_DIRECT; +STRUCT!{struct SCSI_PASS_THROUGH32 { + Length: USHORT, + ScsiStatus: UCHAR, + PathId: UCHAR, + TargetId: UCHAR, + Lun: UCHAR, + CdbLength: UCHAR, + SenseInfoLength: UCHAR, + DataIn: UCHAR, + DataTransferLength: ULONG, + TimeOutValue: ULONG, + DataBufferOffset: ULONG32, + SenseInfoOffset: ULONG, + Cdb: [UCHAR; 16], +}} +#[cfg(target_arch = "x86_64")] +IFDEF!{ +pub type PSCSI_PASS_THROUGH32 = *mut SCSI_PASS_THROUGH32; +STRUCT!{struct SCSI_PASS_THROUGH_DIRECT32 { + Length: USHORT, + ScsiStatus: UCHAR, + PathId: UCHAR, + TargetId: UCHAR, + Lun: UCHAR, + CdbLength: UCHAR, + SenseInfoLength: UCHAR, + DataIn: UCHAR, + DataTransferLength: ULONG, + TimeOutValue: ULONG, + DataBuffer: ULONG32, // Rust doesn't have anything like __ptr32 + SenseInfoOffset: ULONG, + Cdb: [UCHAR; 16], +}} +pub type PSCSI_PASS_THROUGH_DIRECT32 = *mut SCSI_PASS_THROUGH_DIRECT32; +} +STRUCT!{struct SCSI_PASS_THROUGH_EX { + Version: ULONG, + Length: ULONG, + CdbLength: ULONG, + StorAddressLength: ULONG, + ScsiStatus: UCHAR, + SenseInfolength: UCHAR, + DataDirection: UCHAR, + Reserved: UCHAR, + TimeOutValue: ULONG, + StorAddressOffset: ULONG, + SenseInfoOffset: ULONG, + DataOutTransferLength: ULONG, + DataInTransferLength: ULONG, + DataOutBufferOffset: ULONG_PTR, + DataInBufferOffset: ULONG_PTR, + Cdb: [UCHAR; ANYSIZE_ARRAY], +}} +pub type PSCSI_PASS_THROUGH_EX = *mut SCSI_PASS_THROUGH_EX; +STRUCT!{struct SCSI_PASS_THROUGH_DIRECT_EX { + Version: ULONG, + Length: ULONG, + CdbLength: ULONG, + StorAddressLength: ULONG, + ScsiStatus: UCHAR, + SenseInfolength: UCHAR, + DataDirection: UCHAR, + Reserved: UCHAR, + TimeOutValue: ULONG, + StorAddressOffset: ULONG, + SenseInfoOffset: ULONG, + DataOutTransferLength: ULONG, + DataInTransferLength: ULONG, + DataOutBuffer: *mut VOID, + DataInBuffer: *mut VOID, + Cdb: [UCHAR; ANYSIZE_ARRAY], +}} +pub type PSCSI_PASS_THROUGH_DIRECT_EX = *mut SCSI_PASS_THROUGH_DIRECT_EX; +#[cfg(target_arch = "x86_64")] +IFDEF!{ +STRUCT!{struct SCSI_PASS_THROUGH32_EX { + Version: ULONG, + Length: ULONG, + CdbLength: ULONG, + StorAddressLength: ULONG, + ScsiStatus: UCHAR, + SenseInfolength: UCHAR, + DataDirection: UCHAR, + Reserved: UCHAR, + TimeOutValue: ULONG, + StorAddressOffset: ULONG, + SenseInfoOffset: ULONG, + DataOutTransferLength: ULONG, + DataInTransferLength: ULONG, + DataOutBufferOffset: ULONG32, + DataInBufferOffset: ULONG32, + Cdb: [UCHAR; ANYSIZE_ARRAY], +}} +pub type PSCSI_PASS_THROUGH32_EX = *mut SCSI_PASS_THROUGH32_EX; +STRUCT!{struct SCSI_PASS_THROUGH_DIRECT32_EX { + Version: ULONG, + Length: ULONG, + CdbLength: ULONG, + StorAddressLength: ULONG, + ScsiStatus: UCHAR, + SenseInfolength: UCHAR, + DataDirection: UCHAR, + Reserved: UCHAR, + TimeOutValue: ULONG, + StorAddressOffset: ULONG, + SenseInfoOffset: ULONG, + DataOutTransferLength: ULONG, + DataInTransferLength: ULONG, + DataOutBuffer: ULONG32, + DataInBuffer: ULONG32, + Cdb: [UCHAR; ANYSIZE_ARRAY], +}} +pub type PSCSI_PASS_THROUGH_DIRECT32_EX = *mut SCSI_PASS_THROUGH_DIRECT32_EX; +} +STRUCT!{struct ATA_PASS_THROUGH_EX { + Length: USHORT, + AtaFlags: USHORT, + PathId: UCHAR, + TargetId: UCHAR, + Lun: UCHAR, + ReservedAsUchar: UCHAR, + DataTransferLength: ULONG, + TimeOutValue: ULONG, + ReservedAsUlong: ULONG, + DataBufferOffset: ULONG_PTR, + PreviousTaskFile: [UCHAR; 8], + CurrentTaskFile: [UCHAR; 8], +}} +pub type PATA_PASS_THROUGH_EX = *mut ATA_PASS_THROUGH_EX; +STRUCT!{struct ATA_PASS_THROUGH_DIRECT { + Length: USHORT, + AtaFlags: USHORT, + PathId: UCHAR, + TargetId: UCHAR, + Lun: UCHAR, + ReservedAsUchar: UCHAR, + DataTransferLength: ULONG, + TimeOutValue: ULONG, + ReservedAsUlong: ULONG, + DataBuffer: PVOID, + PreviousTaskFile: [UCHAR; 8], + CurrentTaskFile: [UCHAR; 8], +}} +pub type PATA_PASS_THROUGH_DIRECT = *mut ATA_PASS_THROUGH_DIRECT; +#[cfg(target_arch = "x86_64")] +IFDEF!{ +STRUCT!{struct ATA_PASS_THROUGH_EX32 { + Length: USHORT, + AtaFlags: USHORT, + PathId: UCHAR, + TargetId: UCHAR, + Lun: UCHAR, + ReservedAsUchar: UCHAR, + DataTransferLength: ULONG, + TimeOutValue: ULONG, + ReservedAsUlong: ULONG, + DataBufferOffset: ULONG32, + PreviousTaskFile: [UCHAR; 8], + CurrentTaskFile: [UCHAR; 8], +}} +pub type PATA_PASS_THROUGH_EX32 = *mut ATA_PASS_THROUGH_EX32; +STRUCT!{struct ATA_PASS_THROUGH_DIRECT32 { + Length: USHORT, + AtaFlags: USHORT, + PathId: UCHAR, + TargetId: UCHAR, + Lun: UCHAR, + ReservedAsUchar: UCHAR, + DataTransferLength: ULONG, + TimeOutValue: ULONG, + ReservedAsUlong: ULONG, + DataBuffer: ULONG32, + PreviousTaskFile: [UCHAR; 8], + CurrentTaskFile: [UCHAR; 8], +}} +pub type PATA_PASS_THROUGH_DIRECT32 = *mut ATA_PASS_THROUGH_DIRECT32; +} +pub const ATA_FLAGS_DRDY_REQUIRED: USHORT = 1 << 0; +pub const ATA_FLAGS_DATA_IN: USHORT = 1 << 1; +pub const ATA_FLAGS_DATA_OUT: USHORT = 1 << 2; +pub const ATA_FLAGS_48BIT_COMMAND: USHORT = 1 << 3; +pub const ATA_FLAGS_USE_DMA: USHORT = 1 << 4; +pub const ATA_FLAGS_NO_MULTIPLE: USHORT = 1 << 5; +STRUCT!{struct IDE_IO_CONTROL { + HeaderLength: ULONG, + Signature: [UCHAR; 8], + Timeout: ULONG, + ControlCode: ULONG, + ReturnStatus: ULONG, + DataLength: ULONG, +}} +pub type PIDE_IO_CONTROL = *mut IDE_IO_CONTROL; +STRUCT!{struct MPIO_PASS_THROUGH_PATH { + PassThrough: SCSI_PASS_THROUGH, + Version: ULONG, + Length: USHORT, + Flags: UCHAR, + PortNumber: UCHAR, + MpioPathId: ULONGLONG, +}} +pub type PMPIO_PASS_THROUGH_PATH = *mut MPIO_PASS_THROUGH_PATH; +STRUCT!{struct MPIO_PASS_THROUGH_PATH_DIRECT { + PassThrough: SCSI_PASS_THROUGH_DIRECT, + Version: ULONG, + Length: USHORT, + Flags: UCHAR, + PortNumber: UCHAR, + MpioPathId: ULONGLONG, +}} +pub type PMPIO_PASS_THROUGH_PATH_DIRECT = *mut MPIO_PASS_THROUGH_PATH_DIRECT; +STRUCT!{struct MPIO_PASS_THROUGH_PATH_EX { + PassThroughOffset: ULONG, + Version: ULONG, + Length: USHORT, + Flags: UCHAR, + PortNumber: UCHAR, + MpioPathId: ULONGLONG, +}} +pub type PMPIO_PASS_THROUGH_PATH_EX = *mut MPIO_PASS_THROUGH_PATH_EX; +STRUCT!{struct MPIO_PASS_THROUGH_PATH_DIRECT_EX { + PassThroughOffset: ULONG, + Version: ULONG, + Length: USHORT, + Flags: UCHAR, + PortNumber: UCHAR, + MpioPathId: ULONGLONG, +}} +pub type PMPIO_PASS_THROUGH_PATH_DIRECT_EX = *mut MPIO_PASS_THROUGH_PATH_DIRECT_EX; +#[cfg(target_arch = "x86_64")] +IFDEF!{ +STRUCT!{struct MPIO_PASS_THROUGH_PATH32 { + PassThrough: SCSI_PASS_THROUGH32, + Version: ULONG, + Length: USHORT, + Flags: UCHAR, + PortNumber: UCHAR, + MpioPathId: ULONGLONG, +}} +pub type PMPIO_PASS_THROUGH_PATH32 = *mut MPIO_PASS_THROUGH_PATH32; +STRUCT!{struct MPIO_PASS_THROUGH_PATH_DIRECT32 { + PassThrough: SCSI_PASS_THROUGH_DIRECT32, + Version: ULONG, + Length: USHORT, + Flags: UCHAR, + PortNumber: UCHAR, + MpioPathId: ULONGLONG, +}} +pub type PMPIO_PASS_THROUGH_PATH_DIRECT32 = *mut MPIO_PASS_THROUGH_PATH_DIRECT32; +STRUCT!{struct MPIO_PASS_THROUGH_PATH32_EX { + PassThroughOffset: ULONG, + Version: ULONG, + Length: USHORT, + Flags: UCHAR, + PortNumber: UCHAR, + MpioPathId: ULONGLONG, +}} +pub type PMPIO_PASS_THROUGH_PATH32_EX = *mut MPIO_PASS_THROUGH_PATH32_EX; +STRUCT!{struct MPIO_PASS_THROUGH_PATH_DIRECT32_EX { + PassThroughOffset: ULONG, + Version: ULONG, + Length: USHORT, + Flags: UCHAR, + PortNumber: UCHAR, + MpioPathId: ULONGLONG, +}} +pub type PMPIO_PASS_THROUGH_PATH_DIRECT32_EX = *mut MPIO_PASS_THROUGH_PATH_DIRECT32_EX; +} +STRUCT!{struct SCSI_BUS_DATA { + NumberOfLogicalUnits: UCHAR, + InitiatorBusId: UCHAR, + InquiryDataOffset: ULONG, +}} +pub type PSCSI_BUS_DATA = *mut SCSI_BUS_DATA; +STRUCT!{struct SCSI_ADAPTER_BUS_INFO { + NumberOfBuses: UCHAR, + BusData: [SCSI_BUS_DATA; 1], +}} +pub type PSCSI_ADAPTER_BUS_INFO = *mut SCSI_ADAPTER_BUS_INFO; +STRUCT!{struct SCSI_INQUIRY_DATA { + PathId: UCHAR, + TargetId: UCHAR, + Lun: UCHAR, + DeviceClaimed: BOOLEAN, + InquiryDataLength: ULONG, + NextInquiryDataOffset: ULONG, + InquiryData: [UCHAR; 1], +}} +pub type PSCSI_INQUIRY_DATA = *mut SCSI_INQUIRY_DATA; +pub const IOCTL_MINIPORT_SIGNATURE_SCSIDISK: &'static str = "SCSIDISK"; +pub const IOCTL_MINIPORT_SIGNATURE_HYBRDISK: &'static str = "HYBRDISK"; +pub const IOCTL_MINIPORT_SIGNATURE_DSM_NOTIFICATION: &'static str = "MPDSM "; +pub const IOCTL_MINIPORT_SIGNATURE_DSM_GENERAL: &'static str = "MPDSMGEN"; +pub const IOCTL_MINIPORT_SIGNATURE_FIRMWARE: &'static str = "FIRMWARE"; +pub const IOCTL_MINIPORT_SIGNATURE_QUERY_PROTOCOL: &'static str = "PROTOCOL"; +pub const IOCTL_MINIPORT_SIGNATURE_QUERY_TEMPERATURE: &'static str = "TEMPERAT"; +pub const IOCTL_MINIPORT_SIGNATURE_SET_TEMPERATURE_THRESHOLD: &'static str = "SETTEMPT"; +pub const IOCTL_MINIPORT_SIGNATURE_QUERY_PHYSICAL_TOPOLOGY: &'static str = "TOPOLOGY"; +STRUCT!{struct SRB_IO_CONTROL { + HeaderLength: ULONG, + Signature: [UCHAR; 8], + Timeout: ULONG, + ControlCode: ULONG, + ReturnCode: ULONG, + Length: ULONG, +}} +pub type PSRB_IO_CONTROL = *mut SRB_IO_CONTROL; +STRUCT!{struct NVCACHE_REQUEST_BLOCK { + NRBSize: ULONG, + Function: USHORT, + NRBFlags: ULONG, + NRBStatus: ULONG, + Count: ULONG, + LBA: ULONGLONG, + DataBufSize: ULONG, + NVCacheStatus: ULONG, + NVCacheSubStatus: ULONG, +}} +pub type PNVCACHE_REQUEST_BLOCK = *mut NVCACHE_REQUEST_BLOCK; +pub const NRB_FUNCTION_NVCACHE_INFO: USHORT = 0xEC; +pub const NRB_FUNCTION_SPINDLE_STATUS: USHORT = 0xE5; +pub const NRB_FUNCTION_NVCACHE_POWER_MODE_SET: USHORT = 0x00; +pub const NRB_FUNCTION_NVCACHE_POWER_MODE_RETURN: USHORT = 0x01; +pub const NRB_FUNCTION_FLUSH_NVCACHE: USHORT = 0x14; +pub const NRB_FUNCTION_QUERY_PINNED_SET: USHORT = 0x12; +pub const NRB_FUNCTION_QUERY_CACHE_MISS: USHORT = 0x13; +pub const NRB_FUNCTION_ADD_LBAS_PINNED_SET: USHORT = 0x10; +pub const NRB_FUNCTION_REMOVE_LBAS_PINNED_SET: USHORT = 0x11; +pub const NRB_FUNCTION_QUERY_ASCENDER_STATUS: USHORT = 0xD0; +pub const NRB_FUNCTION_QUERY_HYBRID_DISK_STATUS: USHORT = 0xD1; +pub const NRB_FUNCTION_PASS_HINT_PAYLOAD: USHORT = 0xE0; +pub const NRB_FUNCTION_NVSEPARATED_INFO: USHORT = 0xc0; +pub const NRB_FUNCTION_NVSEPARATED_FLUSH: USHORT = 0xc1; +pub const NRB_FUNCTION_NVSEPARATED_WB_DISABLE: USHORT = 0xc2; +pub const NRB_FUNCTION_NVSEPARATED_WB_REVERT_DEFAULT: USHORT = 0xc3; +pub const NRB_SUCCESS: ULONG = 0; +pub const NRB_ILLEGAL_REQUEST: ULONG = 1; +pub const NRB_INVALID_PARAMETER: ULONG = 2; +pub const NRB_INPUT_DATA_OVERRUN: ULONG = 3; +pub const NRB_INPUT_DATA_UNDERRUN: ULONG = 4; +pub const NRB_OUTPUT_DATA_OVERRUN: ULONG = 5; +pub const NRB_OUTPUT_DATA_UNDERRUN: ULONG = 6; +STRUCT!{struct NV_FEATURE_PARAMETER { + NVPowerModeEnabled: USHORT, + NVParameterReserv1: USHORT, + NVCmdEnabled: USHORT, + NVParameterReserv2: USHORT, + NVPowerModeVer: USHORT, + NVCmdVer: USHORT, + NVSize: ULONG, + NVReadSpeed: USHORT, + NVWrtSpeed: USHORT, + DeviceSpinUpTime: ULONG, +}} +pub type PNV_FEATURE_PARAMETER = *mut NV_FEATURE_PARAMETER; +STRUCT!{struct NVCACHE_HINT_PAYLOAD { + Command: UCHAR, + Feature7_0: UCHAR, + Feature15_8: UCHAR, + Count15_8: UCHAR, + LBA7_0: UCHAR, + LBA15_8: UCHAR, + LBA23_16: UCHAR, + LBA31_24: UCHAR, + LBA39_32: UCHAR, + LBA47_40: UCHAR, + Auxiliary7_0: UCHAR, + Auxiliary23_16: UCHAR, + Reserved: [UCHAR; 4], +}} +pub type PNVCACHE_HINT_PAYLOAD = *mut NVCACHE_HINT_PAYLOAD; +STRUCT!{struct NV_SEP_CACHE_PARAMETER { + Version: ULONG, + Size: ULONG, + Flags: NV_SEP_CACHE_PARAMETER_Flags, + WriteCacheType: UCHAR, + WriteCacheTypeEffective: UCHAR, + ParameterReserve1: [UCHAR; 3], +}} +pub type PNV_SEP_CACHE_PARAMETER = *mut NV_SEP_CACHE_PARAMETER; +UNION!{union NV_SEP_CACHE_PARAMETER_Flags { + [u8; 1], + CacheFlags CacheFlags_mut: NV_SEP_CACHE_PARAMETER_Flags_CacheFlags, + CacheFlagsSet CacheFlagsSet_mut: UCHAR, +}} +STRUCT!{struct NV_SEP_CACHE_PARAMETER_Flags_CacheFlags { + Bitfield: UCHAR, +}} +BITFIELD!{NV_SEP_CACHE_PARAMETER_Flags_CacheFlags Bitfield: UCHAR [ + WriteCacheEnabled set_WriteCacheEnabled[0..1], + WriteCacheChangeable set_WriteCacheChangeable[1..2], + WriteThroughIOSupported set_WriteThroughIOSupported[2..3], + FlushCacheSupported set_FlushCacheSupported[3..4], + ReservedBits set_ReservedBits[4..8], +]} +pub const NV_SEP_CACHE_PARAMETER_VERSION_1: ULONG = 1; +pub const NV_SEP_CACHE_PARAMETER_VERSION: ULONG = NV_SEP_CACHE_PARAMETER_VERSION_1; +ENUM!{enum NV_SEP_WRITE_CACHE_TYPE { + NVSEPWriteCacheTypeUnknown = 0, + NVSEPWriteCacheTypeNone = 1, + NVSEPWriteCacheTypeWriteBack = 2, + NVSEPWriteCacheTypeWriteThrough = 3, +}} +pub type PNV_SEP_WRITE_CACHE_TYPE = *mut NV_SEP_WRITE_CACHE_TYPE; +STRUCT!{struct MP_DEVICE_DATA_SET_RANGE { + StartingOffset: LONGLONG, + LengthInBytes: ULONGLONG, +}} +pub type PMP_DEVICE_DATA_SET_RANGE = *mut MP_DEVICE_DATA_SET_RANGE; +STRUCT!{struct DSM_NOTIFICATION_REQUEST_BLOCK { + Size: ULONG, + Version: ULONG, + NotifyFlags: ULONG, + DataSetProfile: ULONG, + Reserved: [ULONG; 3], + DataSetRangesCount: ULONG, + DataSetRanges: [MP_DEVICE_DATA_SET_RANGE; ANYSIZE_ARRAY], +}} +pub type PDSM_NOTIFICATION_REQUEST_BLOCK = *mut DSM_NOTIFICATION_REQUEST_BLOCK; +pub const MINIPORT_DSM_NOTIFICATION_VERSION_1: ULONG = 1; +pub const MINIPORT_DSM_NOTIFICATION_VERSION: ULONG = MINIPORT_DSM_NOTIFICATION_VERSION_1; +pub const MINIPORT_DSM_PROFILE_UNKNOWN: ULONG = 0; +pub const MINIPORT_DSM_PROFILE_PAGE_FILE: ULONG = 1; +pub const MINIPORT_DSM_PROFILE_HIBERNATION_FILE: ULONG = 2; +pub const MINIPORT_DSM_PROFILE_CRASHDUMP_FILE: ULONG = 3; +pub const MINIPORT_DSM_NOTIFY_FLAG_BEGIN: ULONG = 0x00000001; +pub const MINIPORT_DSM_NOTIFY_FLAG_END: ULONG = 0x00000002; +pub const HYBRID_FUNCTION_GET_INFO: ULONG = 0x01; +pub const HYBRID_FUNCTION_DISABLE_CACHING_MEDIUM: ULONG = 0x10; +pub const HYBRID_FUNCTION_ENABLE_CACHING_MEDIUM: ULONG = 0x11; +pub const HYBRID_FUNCTION_SET_DIRTY_THRESHOLD: ULONG = 0x12; +pub const HYBRID_FUNCTION_DEMOTE_BY_SIZE: ULONG = 0x13; +pub const HYBRID_STATUS_SUCCESS: ULONG = 0x0; +pub const HYBRID_STATUS_ILLEGAL_REQUEST: ULONG = 0x1; +pub const HYBRID_STATUS_INVALID_PARAMETER: ULONG = 0x2; +pub const HYBRID_STATUS_OUTPUT_BUFFER_TOO_SMALL: ULONG = 0x3; +pub const HYBRID_STATUS_ENABLE_REFCOUNT_HOLD: ULONG = 0x10; +pub const HYBRID_REQUEST_BLOCK_STRUCTURE_VERSION: ULONG = 0x1; +STRUCT!{struct HYBRID_REQUEST_BLOCK { + Version: ULONG, + Size: ULONG, + Function: ULONG, + Flags: ULONG, + DataBufferOffset: ULONG, + DataBufferLength: ULONG, +}} +pub type PHYBRID_REQUEST_BLOCK = *mut HYBRID_REQUEST_BLOCK; +ENUM!{enum NVCACHE_TYPE { + NvCacheTypeUnknown = 0, + NvCacheTypeNone = 1, + NvCacheTypeWriteBack = 2, + NvCacheTypeWriteThrough = 3, +}} +ENUM!{enum NVCACHE_STATUS { + NvCacheStatusUnknown = 0, + NvCacheStatusDisabling = 1, + NvCacheStatusDisabled = 2, + NvCacheStatusEnabled = 3, +}} +STRUCT!{struct NVCACHE_PRIORITY_LEVEL_DESCRIPTOR { + PriorityLevel: UCHAR, + Reserved0: [UCHAR; 3], + ConsumedNVMSizeFraction: ULONG, + ConsumedMappingResourcesFraction: ULONG, + ConsumedNVMSizeForDirtyDataFraction: ULONG, + ConsumedMappingResourcesForDirtyDataFraction: ULONG, + Reserved1: ULONG, +}} +pub type PNVCACHE_PRIORITY_LEVEL_DESCRIPTOR = *mut NVCACHE_PRIORITY_LEVEL_DESCRIPTOR; +pub const HYBRID_REQUEST_INFO_STRUCTURE_VERSION: ULONG = 1; +STRUCT!{struct HYBRID_INFORMATION { + Version: ULONG, + Size: ULONG, + HybridSupported: BOOLEAN, + Status: NVCACHE_STATUS, + CacheTypeEffective: NVCACHE_TYPE, + CacheTypeDefault: NVCACHE_TYPE, + FractionBase: ULONG, + CacheSize: ULONGLONG, + Attributes: HYBRID_INFORMATION_Attributes, + Priorities: HYBRID_INFORMATION_Priorities, +}} +pub type PHYBRID_INFORMATION = *mut HYBRID_INFORMATION; +STRUCT!{struct HYBRID_INFORMATION_Attributes { + Bitfield: ULONG, +}} +BITFIELD!{HYBRID_INFORMATION_Attributes Bitfield: ULONG [ + WriteCacheChangeable set_WriteCacheChangeable[0..1], + WriteThroughIoSupported set_WriteThroughIoSupported[1..2], + FlushCacheSupported set_FlushCacheSupported[2..3], + Removable set_Removable[3..4], + ReservedBits set_ReservedBits[4..32], +]} +STRUCT!{struct HYBRID_INFORMATION_Priorities { + PriorityLevelCount: UCHAR, + MaxPriorityBehavior: BOOLEAN, + OptimalWriteGranularity: UCHAR, + Reserved: UCHAR, + DirtyThresholdLow: ULONG, + DirtyThresholdHigh: ULONG, + SupportedCommands: HYBRID_INFORMATION_Priorities_SupportedCommands, + Priority: [NVCACHE_PRIORITY_LEVEL_DESCRIPTOR; 0], +}} +STRUCT!{struct HYBRID_INFORMATION_Priorities_SupportedCommands { + Bitfield: ULONG, + MaxEvictCommands: ULONG, + MaxLbaRangeCountForEvict: ULONG, + MaxLbaRangeCountForChangeLba: ULONG, +}} +BITFIELD!{HYBRID_INFORMATION_Priorities_SupportedCommands Bitfield: ULONG [ + CacheDisable set_CacheDisable[0..1], + SetDirtyThreshold set_SetDirtyThreshold[1..2], + PriorityDemoteBySize set_PriorityDemoteBySize[2..3], + PriorityChangeByLbaRange set_PriorityChangeByLbaRange[3..4], + Evict set_Evict[4..5], + ReservedBits set_ReservedBits[5..32], +]} +STRUCT!{struct HYBRID_DIRTY_THRESHOLDS { + Version: ULONG, + Size: ULONG, + DirtyLowThreshold: ULONG, + DirtyHighThreshold: ULONG, +}} +pub type PHYBRID_DIRTY_THRESHOLDS = *mut HYBRID_DIRTY_THRESHOLDS; +STRUCT!{struct HYBRID_DEMOTE_BY_SIZE { + Version: ULONG, + Size: ULONG, + SourcePriority: UCHAR, + TargetPriority: UCHAR, + Reserved0: USHORT, + Reserved1: ULONG, + LbaCount: ULONGLONG, +}} +pub type PHYBRID_DEMOTE_BY_SIZE = *mut HYBRID_DEMOTE_BY_SIZE; +pub const FIRMWARE_FUNCTION_GET_INFO: ULONG = 0x01; +pub const FIRMWARE_FUNCTION_DOWNLOAD: ULONG = 0x02; +pub const FIRMWARE_FUNCTION_ACTIVATE: ULONG = 0x03; +pub const FIRMWARE_STATUS_SUCCESS: ULONG = 0x0; +pub const FIRMWARE_STATUS_ERROR: ULONG = 0x1; +pub const FIRMWARE_STATUS_ILLEGAL_REQUEST: ULONG = 0x2; +pub const FIRMWARE_STATUS_INVALID_PARAMETER: ULONG = 0x3; +pub const FIRMWARE_STATUS_INPUT_BUFFER_TOO_BIG: ULONG = 0x4; +pub const FIRMWARE_STATUS_OUTPUT_BUFFER_TOO_SMALL: ULONG = 0x5; +pub const FIRMWARE_STATUS_INVALID_SLOT: ULONG = 0x6; +pub const FIRMWARE_STATUS_INVALID_IMAGE: ULONG = 0x7; +pub const FIRMWARE_STATUS_CONTROLLER_ERROR: ULONG = 0x10; +pub const FIRMWARE_STATUS_POWER_CYCLE_REQUIRED: ULONG = 0x20; +pub const FIRMWARE_STATUS_DEVICE_ERROR: ULONG = 0x40; +pub const FIRMWARE_STATUS_INTERFACE_CRC_ERROR: ULONG = 0x80; +pub const FIRMWARE_STATUS_UNCORRECTABLE_DATA_ERROR: ULONG = 0x81; +pub const FIRMWARE_STATUS_MEDIA_CHANGE: ULONG = 0x82; +pub const FIRMWARE_STATUS_ID_NOT_FOUND: ULONG = 0x83; +pub const FIRMWARE_STATUS_MEDIA_CHANGE_REQUEST: ULONG = 0x84; +pub const FIRMWARE_STATUS_COMMAND_ABORT: ULONG = 0x85; +pub const FIRMWARE_STATUS_END_OF_MEDIA: ULONG = 0x86; +pub const FIRMWARE_STATUS_ILLEGAL_LENGTH: ULONG = 0x87; +pub const FIRMWARE_REQUEST_BLOCK_STRUCTURE_VERSION: ULONG = 0x1; +STRUCT!{struct FIRMWARE_REQUEST_BLOCK { + Version: ULONG, + Size: ULONG, + Function: ULONG, + Flags: ULONG, + DataBufferOffset: ULONG, + DataBufferLength: ULONG, +}} +pub type PFIRMWARE_REQUEST_BLOCK = *mut FIRMWARE_REQUEST_BLOCK; +pub const FIRMWARE_REQUEST_FLAG_CONTROLLER: ULONG = 0x00000001; +pub const FIRMWARE_REQUEST_FLAG_LAST_SEGMENT: ULONG = 0x00000002; +pub const FIRMWARE_REQUEST_FLAG_SWITCH_TO_EXISTING_FIRMWARE: ULONG = 0x80000000; +pub const STORAGE_FIRMWARE_INFO_STRUCTURE_VERSION: ULONG = 0x1; +pub const STORAGE_FIRMWARE_INFO_STRUCTURE_VERSION_V2: ULONG = 0x2; +pub const STORAGE_FIRMWARE_INFO_INVALID_SLOT: UCHAR = 0xFF; +STRUCT!{struct STORAGE_FIRMWARE_SLOT_INFO { + SlotNumber: UCHAR, + ReadOnly: BOOLEAN, + Reserved: [UCHAR; 6], + Revision: STORAGE_FIRMWARE_SLOT_INFO_Revision, +}} +pub type PSTORAGE_FIRMWARE_SLOT_INFO = *mut STORAGE_FIRMWARE_SLOT_INFO; +UNION!{union STORAGE_FIRMWARE_SLOT_INFO_Revision { + [u64; 1], + Info Info_mut: [UCHAR; 8], + AsUlonglong AsUlonglong_mut: ULONGLONG, +}} +pub const STORAGE_FIRMWARE_SLOT_INFO_V2_REVISION_LENGTH: usize = 16; +STRUCT!{struct STORAGE_FIRMWARE_SLOT_INFO_V2 { + SlotNumber: UCHAR, + ReadOnly: BOOLEAN, + Reserved: [UCHAR; 6], + Revision: [UCHAR; STORAGE_FIRMWARE_SLOT_INFO_V2_REVISION_LENGTH], +}} +pub type PSTORAGE_FIRMWARE_SLOT_INFO_V2 = *mut STORAGE_FIRMWARE_SLOT_INFO_V2; +STRUCT!{struct STORAGE_FIRMWARE_INFO { + Version: ULONG, + Size: ULONG, + UpgradeSupport: BOOLEAN, + SlotCount: UCHAR, + ActiveSlot: UCHAR, + PendingActivateSlot: UCHAR, + Reserved: ULONG, + Slot: [STORAGE_FIRMWARE_SLOT_INFO; 0], +}} +pub type PSTORAGE_FIRMWARE_INFO = *mut STORAGE_FIRMWARE_INFO; +STRUCT!{struct STORAGE_FIRMWARE_INFO_V2 { + Version: ULONG, + Size: ULONG, + UpgradeSupport: BOOLEAN, + SlotCount: UCHAR, + ActiveSlot: UCHAR, + PendingActivateSlot: UCHAR, + FirmwareShared: BOOLEAN, + Reserved: [UCHAR; 3], + ImagePayloadAlignment: ULONG, + ImagePayloadMaxSize: ULONG, + Slot: [STORAGE_FIRMWARE_SLOT_INFO_V2; 0], +}} +pub type PSTORAGE_FIRMWARE_INFO_V2 = *mut STORAGE_FIRMWARE_INFO_V2; +pub const STORAGE_FIRMWARE_DOWNLOAD_STRUCTURE_VERSION: ULONG = 0x1; +pub const STORAGE_FIRMWARE_DOWNLOAD_STRUCTURE_VERSION_V2: ULONG = 0x2; +STRUCT!{struct STORAGE_FIRMWARE_DOWNLOAD { + Version: ULONG, + Size: ULONG, + Offset: ULONGLONG, + BufferSize: ULONGLONG, + ImageBuffer: [UCHAR; 0], +}} +pub type PSTORAGE_FIRMWARE_DOWNLOAD = *mut STORAGE_FIRMWARE_DOWNLOAD; +STRUCT!{struct STORAGE_FIRMWARE_DOWNLOAD_V2 { + Version: ULONG, + Size: ULONG, + Offset: ULONGLONG, + BufferSize: ULONGLONG, + Slot: UCHAR, + Reserved: [UCHAR; 7], + ImageBuffer: [UCHAR; 0], +}} +pub type PSTORAGE_FIRMWARE_DOWNLOAD_V2 = *mut STORAGE_FIRMWARE_DOWNLOAD_V2; +pub const STORAGE_FIRMWARE_ACTIVATE_STRUCTURE_VERSION: ULONG = 0x1; +STRUCT!{struct STORAGE_FIRMWARE_ACTIVATE { + Version: ULONG, + Size: ULONG, + SlotToActivate: UCHAR, + Reserved0: [UCHAR; 3], +}} +pub type PSTORAGE_FIRMWARE_ACTIVATE = *mut STORAGE_FIRMWARE_ACTIVATE; +STRUCT!{struct IO_SCSI_CAPABILITIES { + Length: ULONG, + MaximumTransferLength: ULONG, + MaximumPhysicalPages: ULONG, + SupportedAsynchronousEvents: ULONG, + AlignmentMask: ULONG, + TaggedQueuing: BOOLEAN, + AdapterScansDown: BOOLEAN, + AdapterUsesPio: BOOLEAN, +}} +pub type PIO_SCSI_CAPABILITIES = *mut IO_SCSI_CAPABILITIES; +STRUCT!{struct SCSI_ADDRESS { + Length: ULONG, + PortNumber: UCHAR, + PathId: UCHAR, + TargetId: UCHAR, + Lun: UCHAR, +}} +pub type PSCSI_ADDRESS = *mut SCSI_ADDRESS; +pub const DUMP_POINTERS_VERSION_1: ULONG = 1; +pub const DUMP_POINTERS_VERSION_2: ULONG = 2; +pub const DUMP_POINTERS_VERSION_3: ULONG = 3; +pub const DUMP_POINTERS_VERSION_4: ULONG = 4; +pub const DUMP_DRIVER_NAME_LENGTH: usize = 15; +FN!{cdecl DUMP_DEVICE_POWERON_ROUTINE( + Context: PVOID, +) -> LONG} +pub type PDUMP_DEVICE_POWERON_ROUTINE = *mut DUMP_DEVICE_POWERON_ROUTINE; +STRUCT!{struct DUMP_POINTERS_VERSION { + Version: ULONG, + Size: ULONG, +}} +pub type PDUMP_POINTERS_VERSION = *mut DUMP_POINTERS_VERSION; +STRUCT!{struct DUMP_POINTERS { + AdapterObject: PVOID, // struct _ADAPTER_OBJECT * + MappedRegisterBase: PVOID, + DumpData: PVOID, + CommonBufferVa: PVOID, + CommonBufferPa: LARGE_INTEGER, + CommonBufferSize: ULONG, + AllocateCommonBuffers: BOOLEAN, + UseDiskDump: BOOLEAN, + Spare1: [UCHAR; 2], + DeviceObject: PVOID, +}} +pub type PDUMP_POINTERS = *mut DUMP_POINTERS; +STRUCT!{struct DUMP_POINTERS_EX { + Header: DUMP_POINTERS_VERSION, + DumpData: PVOID, + CommonBufferVa: PVOID, + CommonBufferSize: ULONG, + AllocateCommonBuffers: BOOLEAN, + DeviceObject: PVOID, + DriverList: PVOID, + dwPortFlags: ULONG, + MaxDeviceDumpSectionSize: ULONG, + MaxDeviceDumpLevel: ULONG, + MaxTransferSize: ULONG, + AdapterObject: PVOID, + MappedRegisterBase: PVOID, + DeviceReady: PBOOLEAN, + DumpDevicePowerOn: PDUMP_DEVICE_POWERON_ROUTINE, + DumpDevicePowerOnContext: PVOID, +}} +pub type PDUMP_POINTERS_EX = *mut DUMP_POINTERS_EX; +// TODO: Revisit these definitions when const size_of and offset_of! arrive. +#[cfg(target_pointer_width = "32")] +IFDEF!{ +pub const DUMP_POINTERS_EX_V2_SIZE: ULONG = 32; +pub const DUMP_POINTERS_EX_V3_SIZE: ULONG = 60; +pub const DUMP_POINTERS_EX_V4_SIZE: ULONG = 68; +} +#[cfg(target_pointer_width = "64")] +IFDEF!{ +pub const DUMP_POINTERS_EX_V2_SIZE: ULONG = 48; +pub const DUMP_POINTERS_EX_V3_SIZE: ULONG = 88; +pub const DUMP_POINTERS_EX_V4_SIZE: ULONG = 104; +} +pub const DUMP_EX_FLAG_SUPPORT_64BITMEMORY: ULONG = 0x00000001; +pub const DUMP_EX_FLAG_SUPPORT_DD_TELEMETRY: ULONG = 0x00000002; +pub const DUMP_EX_FLAG_RESUME_SUPPORT: ULONG = 0x00000004; +STRUCT!{struct DUMP_DRIVER { + DumpDriverList: PVOID, + DriverName: [WCHAR; DUMP_DRIVER_NAME_LENGTH], + BaseName: [WCHAR; DUMP_DRIVER_NAME_LENGTH], +}} +pub type PDUMP_DRIVER = *mut DUMP_DRIVER; +pub const SCSI_IOCTL_DATA_OUT: UCHAR = 0; +pub const SCSI_IOCTL_DATA_IN: UCHAR = 1; +pub const SCSI_IOCTL_DATA_UNSPECIFIED: UCHAR = 2; +pub const SCSI_IOCTL_DATA_BIDIRECTIONAL: UCHAR = 3; +pub const MPIO_IOCTL_FLAG_USE_PATHID: UCHAR = 1; +pub const MPIO_IOCTL_FLAG_USE_SCSIADDRESS: UCHAR = 2; +pub const MPIO_IOCTL_FLAG_INVOLVE_DSM: UCHAR = 4; diff --git a/bash-5.1/vendor/winapi/src/shared/ntddser.rs b/bash-5.1/vendor/winapi/src/shared/ntddser.rs new file mode 100644 index 0000000000000000000000000000000000000000..d37b7f6ae6f58516300755e95835afacf4d457fb --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ntddser.rs @@ -0,0 +1,17 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! This is the include file that defines all constants and types for accessing the Serial device. +use shared::devpropdef::DEVPROPKEY; +DEFINE_GUID!{GUID_DEVINTERFACE_COMPORT, + 0x86E0D1E0, 0x8089, 0x11D0, 0x9C, 0xE4, 0x08, 0x00, 0x3E, 0x30, 0x1F, 0x73} +DEFINE_GUID!{GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, + 0x4D36E978, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceInterface_Serial_UsbVendorId, + 0x4C6BF15C, 0x4C03, 0x4AAC, 0x91, 0xF5, 0x64, 0xC0, 0xF8, 0x52, 0xBC, 0xF4, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceInterface_Serial_UsbProductId, + 0x4C6BF15C, 0x4C03, 0x4AAC, 0x91, 0xF5, 0x64, 0xC0, 0xF8, 0x52, 0xBC, 0xF4, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_DeviceInterface_Serial_PortName, + 0x4C6BF15C, 0x4C03, 0x4AAC, 0x91, 0xF5, 0x64, 0xC0, 0xF8, 0x52, 0xBC, 0xF4, 4} diff --git a/bash-5.1/vendor/winapi/src/shared/ntdef.rs b/bash-5.1/vendor/winapi/src/shared/ntdef.rs new file mode 100644 index 0000000000000000000000000000000000000000..c2860b741ee0c157705852bb2ad5d377561165de --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ntdef.rs @@ -0,0 +1,1083 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Type definitions for the basic types. +use ctypes::{ + __int64, __uint64, c_char, c_double, c_int, c_long, c_schar, c_short, c_uchar, c_ulong, + c_ushort, c_void, wchar_t +}; +use shared::basetsd::{KAFFINITY, LONG_PTR, ULONG64, ULONG_PTR}; +use shared::guiddef::GUID; +#[cfg(target_arch = "x86_64")] +IFDEF!{ +pub const MAX_NATURAL_ALIGNMENT: usize = 8; +pub const MEMORY_ALLOCATION_ALIGNMENT: usize = 16; +} +#[cfg(not(target_arch = "x86_64"))] +IFDEF!{ +pub const MAX_NATURAL_ALIGNMENT: usize = 4; +pub const MEMORY_ALLOCATION_ALIGNMENT: usize = 8; +} +#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] +pub const SYSTEM_CACHE_ALIGNMENT_SIZE: usize = 64; +#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))] +pub const SYSTEM_CACHE_ALIGNMENT_SIZE: usize = 128; +pub type PVOID = *mut c_void; +pub type PVOID64 = u64; // This is a 64-bit pointer, even when in 32-bit +pub type VOID = c_void; +pub type CHAR = c_char; +pub type SHORT = c_short; +pub type LONG = c_long; +pub type INT = c_int; +pub type WCHAR = wchar_t; +pub type PWCHAR = *mut WCHAR; +pub type LPWCH = *mut WCHAR; +pub type PWCH = *mut WCHAR; +pub type LPCWCH = *const WCHAR; +pub type PCWCH = *const WCHAR; +pub type NWPSTR = *mut WCHAR; +pub type LPWSTR = *mut WCHAR; +pub type LPTSTR = LPSTR; +pub type PWSTR = *mut WCHAR; +pub type PZPWSTR = *mut PWSTR; +pub type PCZPWSTR = *const PWSTR; +pub type LPUWSTR = *mut WCHAR; // Unaligned pointer +pub type PUWSTR = *mut WCHAR; // Unaligned pointer +pub type LPCWSTR = *const WCHAR; +pub type PCWSTR = *const WCHAR; +pub type PZPCWSTR = *mut PCWSTR; +pub type PCZPCWSTR = *const PCWSTR; +pub type LPCUWSTR = *const WCHAR; // Unaligned pointer +pub type PCUWSTR = *const WCHAR; // Unaligned pointer +pub type PZZWSTR = *mut WCHAR; +pub type PCZZWSTR = *const WCHAR; +pub type PUZZWSTR = *mut WCHAR; // Unaligned pointer +pub type PCUZZWSTR = *const WCHAR; // Unaligned pointer +pub type PNZWCH = *mut WCHAR; +pub type PCNZWCH = *const WCHAR; +pub type PUNZWCH = *mut WCHAR; // Unaligned pointer +pub type PCUNZWCH = *const WCHAR; // Unaligned pointer +pub type LPCWCHAR = *const WCHAR; +pub type PCWCHAR = *const WCHAR; +pub type LPCUWCHAR = *const WCHAR; // Unaligned pointer +pub type PCUWCHAR = *const WCHAR; // Unaligned pointer +pub type UCSCHAR = c_ulong; +pub const UCSCHAR_INVALID_CHARACTER: UCSCHAR = 0xffffffff; +pub const MIN_UCSCHAR: UCSCHAR = 0; +pub const MAX_UCSCHAR: UCSCHAR = 0x0010FFFF; +pub type PUCSCHAR = *mut UCSCHAR; +pub type PCUCSCHAR = *const UCSCHAR; +pub type PUCSSTR = *mut UCSCHAR; +pub type PUUCSSTR = *mut UCSCHAR; // Unaligned pointer +pub type PCUCSSTR = *const UCSCHAR; +pub type PCUUCSSTR = *const UCSCHAR; // Unaligned pointer +pub type PUUCSCHAR = *mut UCSCHAR; // Unaligned pointer +pub type PCUUCSCHAR = *const UCSCHAR; // Unaligned pointer +pub type PCHAR = *mut CHAR; +pub type LPCH = *mut CHAR; +pub type PCH = *mut CHAR; +pub type LPCCH = *const CHAR; +pub type PCCH = *const CHAR; +pub type NPSTR = *mut CHAR; +pub type LPSTR = *mut CHAR; +pub type PSTR = *mut CHAR; +pub type PZPSTR = *mut PSTR; +pub type PCZPSTR = *const PSTR; +pub type LPCSTR = *const CHAR; +pub type PCSTR = *const CHAR; +pub type PZPCSTR = *mut PCSTR; +pub type PCZPCSTR = *const PCSTR; +pub type PZZSTR = *mut CHAR; +pub type PCZZSTR = *const CHAR; +pub type PNZCH = *mut CHAR; +pub type PCNZCH = *const CHAR; +// Skipping TCHAR things +pub type DOUBLE = c_double; +STRUCT!{struct QUAD { + UseThisFieldToCopy: __int64, +}} +pub type PSHORT = *mut SHORT; +pub type PLONG = *mut LONG; +pub type PQUAD = *mut QUAD; +pub type UCHAR = c_uchar; +pub type USHORT = c_ushort; +pub type ULONG = c_ulong; +pub type UQUAD = QUAD; +pub type PUCHAR = *mut UCHAR; +pub type PUSHORT = *mut USHORT; +pub type PULONG = *mut ULONG; +pub type PUQUAD = *mut UQUAD; +pub type PCUCHAR = *const UCHAR; +pub type PCUSHORT = *const USHORT; +pub type PCULONG = *const ULONG; +pub type PCUQUAD = *const UQUAD; +pub type SCHAR = c_schar; +pub type PSCHAR = *mut SCHAR; +pub type PCSCHAR = *const SCHAR; +pub const ALL_PROCESSOR_GROUPS: USHORT = 0xffff; +STRUCT!{struct PROCESSOR_NUMBER { + Group: USHORT, + Number: UCHAR, + Reserved: UCHAR, +}} +pub type PPROCESSOR_NUMBER = *mut PROCESSOR_NUMBER; +STRUCT!{struct GROUP_AFFINITY { + Mask: KAFFINITY, + Group: USHORT, + Reserved: [USHORT; 3], +}} +pub type PGROUP_AFFINITY = *mut GROUP_AFFINITY; +#[cfg(target_arch = "x86_64")] +pub const MAXIMUM_PROC_PER_GROUP: UCHAR = 64; +#[cfg(not(target_arch = "x86_64"))] +pub const MAXIMUM_PROC_PER_GROUP: UCHAR = 32; +pub const MAXIMUM_PROCESSORS: UCHAR = MAXIMUM_PROC_PER_GROUP; +pub type HANDLE = *mut c_void; +pub type PHANDLE = *mut HANDLE; +pub type FCHAR = UCHAR; +pub type FSHORT = USHORT; +pub type FLONG = ULONG; +pub type HRESULT = c_long; +pub const OBJ_HANDLE_TAGBITS: usize = 0x00000003; +pub type CCHAR = c_char; +pub type CSHORT = c_short; +pub type CLONG = ULONG; +pub type PCCHAR = *mut CCHAR; +pub type PCSHORT = *mut CSHORT; +pub type PCLONG = *mut CLONG; +pub type LCID = ULONG; +pub type PLCID = PULONG; +pub type LANGID = USHORT; +ENUM!{enum COMPARTMENT_ID { + UNSPECIFIED_COMPARTMENT_ID = 0, + DEFAULT_COMPARTMENT_ID, +}} +pub type PCOMPARTMENT_ID = *mut COMPARTMENT_ID; +pub type LOGICAL = ULONG; +pub type PLOGICAL = *mut ULONG; +pub type NTSTATUS = LONG; +pub type PNTSTATUS = *mut NTSTATUS; +pub type PCNTSTATUS = *const NTSTATUS; +#[inline] +pub fn NT_SUCCESS(Status: NTSTATUS) -> bool { + Status >= 0 +} +#[inline] +pub fn NT_INFORMATION(Status: NTSTATUS) -> bool { + ((Status as ULONG) >> 30) == 1 +} +#[inline] +pub fn NT_WARNING(Status: NTSTATUS) -> bool { + ((Status as ULONG) >> 30) == 2 +} +#[inline] +pub fn NT_ERROR(Status: NTSTATUS) -> bool { + ((Status as ULONG) >> 30) == 3 +} +pub const APPLICATION_ERROR_MASK: ULONG = 0x20000000; +pub const ERROR_SEVERITY_SUCCESS: ULONG = 0x00000000; +pub const ERROR_SEVERITY_INFORMATIONAL: ULONG = 0x40000000; +pub const ERROR_SEVERITY_WARNING: ULONG = 0x80000000; +pub const ERROR_SEVERITY_ERROR: ULONG = 0xC0000000; +pub type SECURITY_STATUS = c_long; +pub type TIME = LARGE_INTEGER; +pub type PTIME = *mut TIME; +STRUCT!{struct FLOAT128 { + LowPart: __int64, + HighPart: __int64, +}} +pub type PFLOAT128 = *mut FLOAT128; +pub type LONGLONG = __int64; +pub type ULONGLONG = __uint64; +pub const MAXLONGLONG: LONGLONG = 0x7fffffffffffffff; +pub type PLONGLONG = *mut LONGLONG; +pub type PULONGLONG = *mut ULONGLONG; +pub type USN = LONGLONG; +UNION!{union LARGE_INTEGER { + [i64; 1], + s s_mut: LARGE_INTEGER_s, + u u_mut: LARGE_INTEGER_u, + QuadPart QuadPart_mut: LONGLONG, +}} +STRUCT!{struct LARGE_INTEGER_s { + LowPart: ULONG, + HighPart: LONG, +}} +STRUCT!{struct LARGE_INTEGER_u { + LowPart: ULONG, + HighPart: LONG, +}} +pub type PLARGE_INTEGER = *mut LARGE_INTEGER; +UNION!{union ULARGE_INTEGER { + [u64; 1], + s s_mut: ULARGE_INTEGER_s, + u u_mut: ULARGE_INTEGER_s, + QuadPart QuadPart_mut: ULONGLONG, +}} +STRUCT!{struct ULARGE_INTEGER_s { + LowPart: ULONG, + HighPart: ULONG, +}} +STRUCT!{struct ULARGE_INTEGER_u { + LowPart: ULONG, + HighPart: ULONG, +}} +pub type PULARGE_INTEGER = *mut ULARGE_INTEGER; +pub type RTL_REFERENCE_COUNT = LONG_PTR; +pub type PRTL_REFERENCE_COUNT = *mut RTL_REFERENCE_COUNT; +STRUCT!{struct LUID { + LowPart: ULONG, + HighPart: LONG, +}} +pub type PLUID = *mut LUID; +pub type DWORDLONG = ULONGLONG; +pub type PDWORDLONG = *mut DWORDLONG; +pub type PHYSICAL_ADDRESS = LARGE_INTEGER; +pub type PPHYSICAL_ADDRESS = *mut PHYSICAL_ADDRESS; +ENUM!{enum EVENT_TYPE { + NotificationEvent, + SynchronizationEvent, +}} +ENUM!{enum TIMER_TYPE { + NotificationTimer, + SynchronizationTimer, +}} +ENUM!{enum WAIT_TYPE { + WaitAll, + WaitAny, + WaitNotification, + WaitDequeue, +}} +pub type PSZ = *mut CHAR; +pub type PCSZ = *const c_char; +pub type RTL_STRING_LENGTH_TYPE = USHORT; +STRUCT!{struct STRING { + Length: USHORT, + MaximumLength: USHORT, + Buffer: PCHAR, +}} +pub type PSTRING = *mut STRING; +pub type ANSI_STRING = STRING; +pub type PANSI_STRING = PSTRING; +pub type OEM_STRING = STRING; +pub type POEM_STRING = PSTRING; +pub type PCOEM_STRING = *const STRING; +STRUCT!{struct CSTRING { + Length: USHORT, + MaximumLength: USHORT, + Buffer: *const c_char, +}} +pub type PCSTRING = *mut CSTRING; +pub const ANSI_NULL: CHAR = 0; +pub type CANSI_STRING = STRING; +pub type PCANSI_STRING = PSTRING; +STRUCT!{struct UNICODE_STRING { + Length: USHORT, + MaximumLength: USHORT, + Buffer: PWCH, +}} +pub type PUNICODE_STRING = *mut UNICODE_STRING; +pub type PCUNICODE_STRING = *const UNICODE_STRING; +pub const UNICODE_NULL: WCHAR = 0; +pub const UNICODE_STRING_MAX_BYTES: USHORT = 65534; +pub const UNICODE_STRING_MAX_CHARS: usize = 32767; +pub type BOOLEAN = UCHAR; +pub type PBOOLEAN = *mut BOOLEAN; +STRUCT!{struct LIST_ENTRY { + Flink: *mut LIST_ENTRY, + Blink: *mut LIST_ENTRY, +}} +pub type PLIST_ENTRY = *mut LIST_ENTRY; +pub type PRLIST_ENTRY = *mut LIST_ENTRY; // Restricted pointer +STRUCT!{struct SINGLE_LIST_ENTRY { + Next: *mut SINGLE_LIST_ENTRY, +}} +pub type PSINGLE_LIST_ENTRY = *mut SINGLE_LIST_ENTRY; +STRUCT!{struct RTL_BALANCED_NODE { + u: RTL_BALANCED_NODE_u, + ParentValue: ULONG_PTR, +}} +UNION!{union RTL_BALANCED_NODE_u { + [usize; 2], + Children Children_mut: [*mut RTL_BALANCED_NODE; 2], + s s_mut: RTL_BALANCED_NODE_s, +}} +STRUCT!{struct RTL_BALANCED_NODE_s { + Left: *mut RTL_BALANCED_NODE, + Right: *mut RTL_BALANCED_NODE, +}} +pub const RTL_BALANCED_NODE_RESERVED_PARENT_MASK: ULONG_PTR = 3; +pub type PRTL_BALANCED_NODE = *mut RTL_BALANCED_NODE; +#[inline] +pub unsafe fn RTL_BALANCED_NODE_GET_PARENT_POINTER( + Node: PRTL_BALANCED_NODE, +) -> PRTL_BALANCED_NODE { + ((*Node).ParentValue & !RTL_BALANCED_NODE_RESERVED_PARENT_MASK) as *mut RTL_BALANCED_NODE +} +STRUCT!{struct LIST_ENTRY32 { + Flink: ULONG, + Blink: ULONG, +}} +pub type PLIST_ENTRY32 = *mut LIST_ENTRY32; +STRUCT!{struct LIST_ENTRY64 { + Flink: ULONGLONG, + Blink: ULONGLONG, +}} +pub type PLIST_ENTRY64 = *mut LIST_ENTRY64; +STRUCT!{struct SINGLE_LIST_ENTRY32 { + Next: ULONG, +}} +pub type PSINGLE_LIST_ENTRY32 = *mut SINGLE_LIST_ENTRY32; +#[inline] +pub unsafe fn ListEntry32To64(l32: PLIST_ENTRY32, l64: PLIST_ENTRY64) { + (*l64).Flink = (*l32).Flink as ULONGLONG; + (*l64).Blink = (*l32).Blink as ULONGLONG; +} +#[inline] +pub unsafe fn ListEntry64To32(l64: PLIST_ENTRY64, l32: PLIST_ENTRY32) { + (*l32).Flink = (*l64).Flink as ULONG; + (*l32).Blink = (*l64).Blink as ULONG; +} +STRUCT!{struct WNF_STATE_NAME { + Data: [ULONG; 2], +}} +pub type PWNF_STATE_NAME = *mut WNF_STATE_NAME; +pub type PCWNF_STATE_NAME = *const WNF_STATE_NAME; +STRUCT!{struct STRING32 { + Length: USHORT, + MaximumLength: USHORT, + Buffer: ULONG, +}} +pub type PSTRING32 = *mut STRING32; +pub type UNICODE_STRING32 = STRING32; +pub type PUNICODE_STRING32 = *mut UNICODE_STRING32; +pub type ANSI_STRING32 = STRING32; +pub type PANSI_STRING32 = *mut ANSI_STRING32; +STRUCT!{struct STRING64 { + Length: USHORT, + MaximumLength: USHORT, + Buffer: ULONGLONG, +}} +pub type PSTRING64 = *mut STRING64; +pub type UNICODE_STRING64 = STRING64; +pub type PUNICODE_STRING64 = *mut UNICODE_STRING64; +pub type ANSI_STRING64 = STRING64; +pub type PANSI_STRING64 = *mut ANSI_STRING64; +pub const OBJ_INHERIT: ULONG = 0x00000002; +pub const OBJ_PERMANENT: ULONG = 0x00000010; +pub const OBJ_EXCLUSIVE: ULONG = 0x00000020; +pub const OBJ_CASE_INSENSITIVE: ULONG = 0x00000040; +pub const OBJ_OPENIF: ULONG = 0x00000080; +pub const OBJ_OPENLINK: ULONG = 0x00000100; +pub const OBJ_KERNEL_HANDLE: ULONG = 0x00000200; +pub const OBJ_FORCE_ACCESS_CHECK: ULONG = 0x00000400; +pub const OBJ_IGNORE_IMPERSONATED_DEVICEMAP: ULONG = 0x00000800; +pub const OBJ_DONT_REPARSE: ULONG = 0x00001000; +pub const OBJ_VALID_ATTRIBUTES: ULONG = 0x00001FF2; +STRUCT!{struct OBJECT_ATTRIBUTES64 { + Length: ULONG, + RootDirectory: ULONG64, + ObjectName: ULONG64, + Attributes: ULONG, + SecurityDescriptor: ULONG64, + SecurityQualityOfService: ULONG64, +}} +pub type POBJECT_ATTRIBUTES64 = *mut OBJECT_ATTRIBUTES64; +pub type PCOBJECT_ATTRIBUTES64 = *const OBJECT_ATTRIBUTES64; +STRUCT!{struct OBJECT_ATTRIBUTES32 { + Length: ULONG, + RootDirectory: ULONG, + ObjectName: ULONG, + Attributes: ULONG, + SecurityDescriptor: ULONG, + SecurityQualityOfService: ULONG, +}} +pub type POBJECT_ATTRIBUTES32 = *mut OBJECT_ATTRIBUTES32; +pub type PCOBJECT_ATTRIBUTES32 = *const OBJECT_ATTRIBUTES32; +STRUCT!{struct OBJECT_ATTRIBUTES { + Length: ULONG, + RootDirectory: HANDLE, + ObjectName: PUNICODE_STRING, + Attributes: ULONG, + SecurityDescriptor: PVOID, + SecurityQualityOfService: PVOID, +}} +pub type POBJECT_ATTRIBUTES = *mut OBJECT_ATTRIBUTES; +pub type PCOBJECT_ATTRIBUTES = *const OBJECT_ATTRIBUTES; +#[inline] +pub unsafe fn InitializeObjectAttributes( + p: POBJECT_ATTRIBUTES, + n: PUNICODE_STRING, + a: ULONG, + r: HANDLE, + s: PVOID, +) { + use core::mem::size_of; + (*p).Length = size_of::() as ULONG; + (*p).RootDirectory = r; + (*p).Attributes = a; + (*p).ObjectName = n; + (*p).SecurityDescriptor = s; + (*p).SecurityQualityOfService = NULL; +} +pub const FALSE: BOOLEAN = 0; +pub const TRUE: BOOLEAN = 1; +pub const NULL: PVOID = 0 as PVOID; +pub const NULL64: PVOID64 = 0; +STRUCT!{struct OBJECTID { + Lineage: GUID, + Uniquifier: ULONG, +}} +pub const MINCHAR: CHAR = 0x80; +pub const MAXCHAR: CHAR = 0x7f; +pub const MINSHORT: SHORT = 0x8000; +pub const MAXSHORT: SHORT = 0x7fff; +pub const MINLONG: LONG = 0x80000000; +pub const MAXLONG: LONG = 0x7fffffff; +pub const MAXUCHAR: UCHAR = 0xff; +pub const MAXUSHORT: USHORT = 0xffff; +pub const MAXULONG: ULONG = 0xffffffff; +// PEXCEPTION_ROUTINE: Can't define here, because it needs EXCEPTION_RECORD and CONTEXT. +pub type KIRQL = UCHAR; +pub type PKIRQL = *mut KIRQL; +ENUM!{enum NT_PRODUCT_TYPE { + NtProductWinNt = 1, + NtProductLanManNt, + NtProductServer, +}} +pub type PNT_PRODUCT_TYPE = *mut NT_PRODUCT_TYPE; +ENUM!{enum SUITE_TYPE { + SmallBusiness, + Enterprise, + BackOffice, + CommunicationServer, + TerminalServer, + SmallBusinessRestricted, + EmbeddedNT, + DataCenter, + SingleUserTS, + Personal, + Blade, + EmbeddedRestricted, + SecurityAppliance, + StorageServer, + ComputeServer, + WHServer, + PhoneNT, + MaxSuiteType, +}} +pub const VER_SERVER_NT: ULONG = 0x80000000; +pub const VER_WORKSTATION_NT: ULONG = 0x40000000; +pub const VER_SUITE_SMALLBUSINESS: ULONG = 0x00000001; +pub const VER_SUITE_ENTERPRISE: ULONG = 0x00000002; +pub const VER_SUITE_BACKOFFICE: ULONG = 0x00000004; +pub const VER_SUITE_COMMUNICATIONS: ULONG = 0x00000008; +pub const VER_SUITE_TERMINAL: ULONG = 0x00000010; +pub const VER_SUITE_SMALLBUSINESS_RESTRICTED: ULONG = 0x00000020; +pub const VER_SUITE_EMBEDDEDNT: ULONG = 0x00000040; +pub const VER_SUITE_DATACENTER: ULONG = 0x00000080; +pub const VER_SUITE_SINGLEUSERTS: ULONG = 0x00000100; +pub const VER_SUITE_PERSONAL: ULONG = 0x00000200; +pub const VER_SUITE_BLADE: ULONG = 0x00000400; +pub const VER_SUITE_EMBEDDED_RESTRICTED: ULONG = 0x00000800; +pub const VER_SUITE_SECURITY_APPLIANCE: ULONG = 0x00001000; +pub const VER_SUITE_STORAGE_SERVER: ULONG = 0x00002000; +pub const VER_SUITE_COMPUTE_SERVER: ULONG = 0x00004000; +pub const VER_SUITE_WH_SERVER: ULONG = 0x00008000; +pub const PRODUCT_UNDEFINED: ULONG = 0x00000000; +pub const PRODUCT_ULTIMATE: ULONG = 0x00000001; +pub const PRODUCT_HOME_BASIC: ULONG = 0x00000002; +pub const PRODUCT_HOME_PREMIUM: ULONG = 0x00000003; +pub const PRODUCT_ENTERPRISE: ULONG = 0x00000004; +pub const PRODUCT_HOME_BASIC_N: ULONG = 0x00000005; +pub const PRODUCT_BUSINESS: ULONG = 0x00000006; +pub const PRODUCT_STANDARD_SERVER: ULONG = 0x00000007; +pub const PRODUCT_DATACENTER_SERVER: ULONG = 0x00000008; +pub const PRODUCT_SMALLBUSINESS_SERVER: ULONG = 0x00000009; +pub const PRODUCT_ENTERPRISE_SERVER: ULONG = 0x0000000A; +pub const PRODUCT_STARTER: ULONG = 0x0000000B; +pub const PRODUCT_DATACENTER_SERVER_CORE: ULONG = 0x0000000C; +pub const PRODUCT_STANDARD_SERVER_CORE: ULONG = 0x0000000D; +pub const PRODUCT_ENTERPRISE_SERVER_CORE: ULONG = 0x0000000E; +pub const PRODUCT_ENTERPRISE_SERVER_IA64: ULONG = 0x0000000F; +pub const PRODUCT_BUSINESS_N: ULONG = 0x00000010; +pub const PRODUCT_WEB_SERVER: ULONG = 0x00000011; +pub const PRODUCT_CLUSTER_SERVER: ULONG = 0x00000012; +pub const PRODUCT_HOME_SERVER: ULONG = 0x00000013; +pub const PRODUCT_STORAGE_EXPRESS_SERVER: ULONG = 0x00000014; +pub const PRODUCT_STORAGE_STANDARD_SERVER: ULONG = 0x00000015; +pub const PRODUCT_STORAGE_WORKGROUP_SERVER: ULONG = 0x00000016; +pub const PRODUCT_STORAGE_ENTERPRISE_SERVER: ULONG = 0x00000017; +pub const PRODUCT_SERVER_FOR_SMALLBUSINESS: ULONG = 0x00000018; +pub const PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: ULONG = 0x00000019; +pub const PRODUCT_HOME_PREMIUM_N: ULONG = 0x0000001A; +pub const PRODUCT_ENTERPRISE_N: ULONG = 0x0000001B; +pub const PRODUCT_ULTIMATE_N: ULONG = 0x0000001C; +pub const PRODUCT_WEB_SERVER_CORE: ULONG = 0x0000001D; +pub const PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT: ULONG = 0x0000001E; +pub const PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY: ULONG = 0x0000001F; +pub const PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING: ULONG = 0x00000020; +pub const PRODUCT_SERVER_FOUNDATION: ULONG = 0x00000021; +pub const PRODUCT_HOME_PREMIUM_SERVER: ULONG = 0x00000022; +pub const PRODUCT_SERVER_FOR_SMALLBUSINESS_V: ULONG = 0x00000023; +pub const PRODUCT_STANDARD_SERVER_V: ULONG = 0x00000024; +pub const PRODUCT_DATACENTER_SERVER_V: ULONG = 0x00000025; +pub const PRODUCT_ENTERPRISE_SERVER_V: ULONG = 0x00000026; +pub const PRODUCT_DATACENTER_SERVER_CORE_V: ULONG = 0x00000027; +pub const PRODUCT_STANDARD_SERVER_CORE_V: ULONG = 0x00000028; +pub const PRODUCT_ENTERPRISE_SERVER_CORE_V: ULONG = 0x00000029; +pub const PRODUCT_HYPERV: ULONG = 0x0000002A; +pub const PRODUCT_STORAGE_EXPRESS_SERVER_CORE: ULONG = 0x0000002B; +pub const PRODUCT_STORAGE_STANDARD_SERVER_CORE: ULONG = 0x0000002C; +pub const PRODUCT_STORAGE_WORKGROUP_SERVER_CORE: ULONG = 0x0000002D; +pub const PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE: ULONG = 0x0000002E; +pub const PRODUCT_STARTER_N: ULONG = 0x0000002F; +pub const PRODUCT_PROFESSIONAL: ULONG = 0x00000030; +pub const PRODUCT_PROFESSIONAL_N: ULONG = 0x00000031; +pub const PRODUCT_SB_SOLUTION_SERVER: ULONG = 0x00000032; +pub const PRODUCT_SERVER_FOR_SB_SOLUTIONS: ULONG = 0x00000033; +pub const PRODUCT_STANDARD_SERVER_SOLUTIONS: ULONG = 0x00000034; +pub const PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE: ULONG = 0x00000035; +pub const PRODUCT_SB_SOLUTION_SERVER_EM: ULONG = 0x00000036; +pub const PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM: ULONG = 0x00000037; +pub const PRODUCT_SOLUTION_EMBEDDEDSERVER: ULONG = 0x00000038; +pub const PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE: ULONG = 0x00000039; +pub const PRODUCT_PROFESSIONAL_EMBEDDED: ULONG = 0x0000003A; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT: ULONG = 0x0000003B; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL: ULONG = 0x0000003C; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC: ULONG = 0x0000003D; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC: ULONG = 0x0000003E; +pub const PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE: ULONG = 0x0000003F; +pub const PRODUCT_CLUSTER_SERVER_V: ULONG = 0x00000040; +pub const PRODUCT_EMBEDDED: ULONG = 0x00000041; +pub const PRODUCT_STARTER_E: ULONG = 0x00000042; +pub const PRODUCT_HOME_BASIC_E: ULONG = 0x00000043; +pub const PRODUCT_HOME_PREMIUM_E: ULONG = 0x00000044; +pub const PRODUCT_PROFESSIONAL_E: ULONG = 0x00000045; +pub const PRODUCT_ENTERPRISE_E: ULONG = 0x00000046; +pub const PRODUCT_ULTIMATE_E: ULONG = 0x00000047; +pub const PRODUCT_ENTERPRISE_EVALUATION: ULONG = 0x00000048; +pub const PRODUCT_MULTIPOINT_STANDARD_SERVER: ULONG = 0x0000004C; +pub const PRODUCT_MULTIPOINT_PREMIUM_SERVER: ULONG = 0x0000004D; +pub const PRODUCT_STANDARD_EVALUATION_SERVER: ULONG = 0x0000004F; +pub const PRODUCT_DATACENTER_EVALUATION_SERVER: ULONG = 0x00000050; +pub const PRODUCT_ENTERPRISE_N_EVALUATION: ULONG = 0x00000054; +pub const PRODUCT_EMBEDDED_AUTOMOTIVE: ULONG = 0x00000055; +pub const PRODUCT_EMBEDDED_INDUSTRY_A: ULONG = 0x00000056; +pub const PRODUCT_THINPC: ULONG = 0x00000057; +pub const PRODUCT_EMBEDDED_A: ULONG = 0x00000058; +pub const PRODUCT_EMBEDDED_INDUSTRY: ULONG = 0x00000059; +pub const PRODUCT_EMBEDDED_E: ULONG = 0x0000005A; +pub const PRODUCT_EMBEDDED_INDUSTRY_E: ULONG = 0x0000005B; +pub const PRODUCT_EMBEDDED_INDUSTRY_A_E: ULONG = 0x0000005C; +pub const PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER: ULONG = 0x0000005F; +pub const PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER: ULONG = 0x00000060; +pub const PRODUCT_CORE_ARM: ULONG = 0x00000061; +pub const PRODUCT_CORE_N: ULONG = 0x00000062; +pub const PRODUCT_CORE_COUNTRYSPECIFIC: ULONG = 0x00000063; +pub const PRODUCT_CORE_SINGLELANGUAGE: ULONG = 0x00000064; +pub const PRODUCT_CORE: ULONG = 0x00000065; +pub const PRODUCT_PROFESSIONAL_WMC: ULONG = 0x00000067; +pub const PRODUCT_MOBILE_CORE: ULONG = 0x00000068; +pub const PRODUCT_EMBEDDED_INDUSTRY_EVAL: ULONG = 0x00000069; +pub const PRODUCT_EMBEDDED_INDUSTRY_E_EVAL: ULONG = 0x0000006A; +pub const PRODUCT_EMBEDDED_EVAL: ULONG = 0x0000006B; +pub const PRODUCT_EMBEDDED_E_EVAL: ULONG = 0x0000006C; +pub const PRODUCT_NANO_SERVER: ULONG = 0x0000006D; +pub const PRODUCT_CLOUD_STORAGE_SERVER: ULONG = 0x0000006E; +pub const PRODUCT_CORE_CONNECTED: ULONG = 0x0000006F; +pub const PRODUCT_PROFESSIONAL_STUDENT: ULONG = 0x00000070; +pub const PRODUCT_CORE_CONNECTED_N: ULONG = 0x00000071; +pub const PRODUCT_PROFESSIONAL_STUDENT_N: ULONG = 0x00000072; +pub const PRODUCT_CORE_CONNECTED_SINGLELANGUAGE: ULONG = 0x00000073; +pub const PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC: ULONG = 0x00000074; +pub const PRODUCT_CONNECTED_CAR: ULONG = 0x00000075; +pub const PRODUCT_INDUSTRY_HANDHELD: ULONG = 0x00000076; +pub const PRODUCT_PPI_PRO: ULONG = 0x00000077; +pub const PRODUCT_ARM64_SERVER: ULONG = 0x00000078; +pub const PRODUCT_EDUCATION: ULONG = 0x00000079; +pub const PRODUCT_EDUCATION_N: ULONG = 0x0000007A; +pub const PRODUCT_IOTUAP: ULONG = 0x0000007B; +pub const PRODUCT_CLOUD_HOST_INFRASTRUCTURE_SERVER: ULONG = 0x0000007C; +pub const PRODUCT_ENTERPRISE_S: ULONG = 0x0000007D; +pub const PRODUCT_ENTERPRISE_S_N: ULONG = 0x0000007E; +pub const PRODUCT_PROFESSIONAL_S: ULONG = 0x0000007F; +pub const PRODUCT_PROFESSIONAL_S_N: ULONG = 0x00000080; +pub const PRODUCT_ENTERPRISE_S_EVALUATION: ULONG = 0x00000081; +pub const PRODUCT_ENTERPRISE_S_N_EVALUATION: ULONG = 0x00000082; +pub const PRODUCT_HOLOGRAPHIC: ULONG = 0x00000087; +pub const PRODUCT_PRO_SINGLE_LANGUAGE: ULONG = 0x0000008A; +pub const PRODUCT_PRO_CHINA: ULONG = 0x0000008B; +pub const PRODUCT_ENTERPRISE_SUBSCRIPTION: ULONG = 0x0000008C; +pub const PRODUCT_ENTERPRISE_SUBSCRIPTION_N: ULONG = 0x0000008D; +pub const PRODUCT_DATACENTER_NANO_SERVER: ULONG = 0x0000008F; +pub const PRODUCT_STANDARD_NANO_SERVER: ULONG = 0x00000090; +pub const PRODUCT_DATACENTER_A_SERVER_CORE: ULONG = 0x00000091; +pub const PRODUCT_STANDARD_A_SERVER_CORE: ULONG = 0x00000092; +pub const PRODUCT_DATACENTER_WS_SERVER_CORE: ULONG = 0x00000093; +pub const PRODUCT_STANDARD_WS_SERVER_CORE: ULONG = 0x00000094; +pub const PRODUCT_UTILITY_VM: ULONG = 0x00000095; +pub const PRODUCT_DATACENTER_EVALUATION_SERVER_CORE: ULONG = 0x0000009F; +pub const PRODUCT_STANDARD_EVALUATION_SERVER_CORE: ULONG = 0x000000A0; +pub const PRODUCT_PRO_WORKSTATION: ULONG = 0x000000A1; +pub const PRODUCT_PRO_WORKSTATION_N: ULONG = 0x000000A2; +pub const PRODUCT_PRO_FOR_EDUCATION: ULONG = 0x000000A4; +pub const PRODUCT_PRO_FOR_EDUCATION_N: ULONG = 0x000000A5; +pub const PRODUCT_AZURE_SERVER_CORE: ULONG = 0x000000A8; +pub const PRODUCT_AZURE_NANO_SERVER: ULONG = 0x000000A9; +pub const PRODUCT_UNLICENSED: ULONG = 0xABCDABCD; +pub const LANG_NEUTRAL: USHORT = 0x00; +pub const LANG_INVARIANT: USHORT = 0x7f; +pub const LANG_AFRIKAANS: USHORT = 0x36; +pub const LANG_ALBANIAN: USHORT = 0x1c; +pub const LANG_ALSATIAN: USHORT = 0x84; +pub const LANG_AMHARIC: USHORT = 0x5e; +pub const LANG_ARABIC: USHORT = 0x01; +pub const LANG_ARMENIAN: USHORT = 0x2b; +pub const LANG_ASSAMESE: USHORT = 0x4d; +pub const LANG_AZERI: USHORT = 0x2c; +pub const LANG_AZERBAIJANI: USHORT = 0x2c; +pub const LANG_BANGLA: USHORT = 0x45; +pub const LANG_BASHKIR: USHORT = 0x6d; +pub const LANG_BASQUE: USHORT = 0x2d; +pub const LANG_BELARUSIAN: USHORT = 0x23; +pub const LANG_BENGALI: USHORT = 0x45; +pub const LANG_BRETON: USHORT = 0x7e; +pub const LANG_BOSNIAN: USHORT = 0x1a; +pub const LANG_BOSNIAN_NEUTRAL: USHORT = 0x781a; +pub const LANG_BULGARIAN: USHORT = 0x02; +pub const LANG_CATALAN: USHORT = 0x03; +pub const LANG_CENTRAL_KURDISH: USHORT = 0x92; +pub const LANG_CHEROKEE: USHORT = 0x5c; +pub const LANG_CHINESE: USHORT = 0x04; +pub const LANG_CHINESE_SIMPLIFIED: USHORT = 0x04; +pub const LANG_CHINESE_TRADITIONAL: USHORT = 0x7c04; +pub const LANG_CORSICAN: USHORT = 0x83; +pub const LANG_CROATIAN: USHORT = 0x1a; +pub const LANG_CZECH: USHORT = 0x05; +pub const LANG_DANISH: USHORT = 0x06; +pub const LANG_DARI: USHORT = 0x8c; +pub const LANG_DIVEHI: USHORT = 0x65; +pub const LANG_DUTCH: USHORT = 0x13; +pub const LANG_ENGLISH: USHORT = 0x09; +pub const LANG_ESTONIAN: USHORT = 0x25; +pub const LANG_FAEROESE: USHORT = 0x38; +pub const LANG_FARSI: USHORT = 0x29; +pub const LANG_FILIPINO: USHORT = 0x64; +pub const LANG_FINNISH: USHORT = 0x0b; +pub const LANG_FRENCH: USHORT = 0x0c; +pub const LANG_FRISIAN: USHORT = 0x62; +pub const LANG_FULAH: USHORT = 0x67; +pub const LANG_GALICIAN: USHORT = 0x56; +pub const LANG_GEORGIAN: USHORT = 0x37; +pub const LANG_GERMAN: USHORT = 0x07; +pub const LANG_GREEK: USHORT = 0x08; +pub const LANG_GREENLANDIC: USHORT = 0x6f; +pub const LANG_GUJARATI: USHORT = 0x47; +pub const LANG_HAUSA: USHORT = 0x68; +pub const LANG_HAWAIIAN: USHORT = 0x75; +pub const LANG_HEBREW: USHORT = 0x0d; +pub const LANG_HINDI: USHORT = 0x39; +pub const LANG_HUNGARIAN: USHORT = 0x0e; +pub const LANG_ICELANDIC: USHORT = 0x0f; +pub const LANG_IGBO: USHORT = 0x70; +pub const LANG_INDONESIAN: USHORT = 0x21; +pub const LANG_INUKTITUT: USHORT = 0x5d; +pub const LANG_IRISH: USHORT = 0x3c; +pub const LANG_ITALIAN: USHORT = 0x10; +pub const LANG_JAPANESE: USHORT = 0x11; +pub const LANG_KANNADA: USHORT = 0x4b; +pub const LANG_KASHMIRI: USHORT = 0x60; +pub const LANG_KAZAK: USHORT = 0x3f; +pub const LANG_KHMER: USHORT = 0x53; +pub const LANG_KICHE: USHORT = 0x86; +pub const LANG_KINYARWANDA: USHORT = 0x87; +pub const LANG_KONKANI: USHORT = 0x57; +pub const LANG_KOREAN: USHORT = 0x12; +pub const LANG_KYRGYZ: USHORT = 0x40; +pub const LANG_LAO: USHORT = 0x54; +pub const LANG_LATVIAN: USHORT = 0x26; +pub const LANG_LITHUANIAN: USHORT = 0x27; +pub const LANG_LOWER_SORBIAN: USHORT = 0x2e; +pub const LANG_LUXEMBOURGISH: USHORT = 0x6e; +pub const LANG_MACEDONIAN: USHORT = 0x2f; +pub const LANG_MALAY: USHORT = 0x3e; +pub const LANG_MALAYALAM: USHORT = 0x4c; +pub const LANG_MALTESE: USHORT = 0x3a; +pub const LANG_MANIPURI: USHORT = 0x58; +pub const LANG_MAORI: USHORT = 0x81; +pub const LANG_MAPUDUNGUN: USHORT = 0x7a; +pub const LANG_MARATHI: USHORT = 0x4e; +pub const LANG_MOHAWK: USHORT = 0x7c; +pub const LANG_MONGOLIAN: USHORT = 0x50; +pub const LANG_NEPALI: USHORT = 0x61; +pub const LANG_NORWEGIAN: USHORT = 0x14; +pub const LANG_OCCITAN: USHORT = 0x82; +pub const LANG_ODIA: USHORT = 0x48; +pub const LANG_ORIYA: USHORT = 0x48; +pub const LANG_PASHTO: USHORT = 0x63; +pub const LANG_PERSIAN: USHORT = 0x29; +pub const LANG_POLISH: USHORT = 0x15; +pub const LANG_PORTUGUESE: USHORT = 0x16; +pub const LANG_PULAR: USHORT = 0x67; +pub const LANG_PUNJABI: USHORT = 0x46; +pub const LANG_QUECHUA: USHORT = 0x6b; +pub const LANG_ROMANIAN: USHORT = 0x18; +pub const LANG_ROMANSH: USHORT = 0x17; +pub const LANG_RUSSIAN: USHORT = 0x19; +pub const LANG_SAKHA: USHORT = 0x85; +pub const LANG_SAMI: USHORT = 0x3b; +pub const LANG_SANSKRIT: USHORT = 0x4f; +pub const LANG_SCOTTISH_GAELIC: USHORT = 0x91; +pub const LANG_SERBIAN: USHORT = 0x1a; +pub const LANG_SERBIAN_NEUTRAL: USHORT = 0x7c1a; +pub const LANG_SINDHI: USHORT = 0x59; +pub const LANG_SINHALESE: USHORT = 0x5b; +pub const LANG_SLOVAK: USHORT = 0x1b; +pub const LANG_SLOVENIAN: USHORT = 0x24; +pub const LANG_SOTHO: USHORT = 0x6c; +pub const LANG_SPANISH: USHORT = 0x0a; +pub const LANG_SWAHILI: USHORT = 0x41; +pub const LANG_SWEDISH: USHORT = 0x1d; +pub const LANG_SYRIAC: USHORT = 0x5a; +pub const LANG_TAJIK: USHORT = 0x28; +pub const LANG_TAMAZIGHT: USHORT = 0x5f; +pub const LANG_TAMIL: USHORT = 0x49; +pub const LANG_TATAR: USHORT = 0x44; +pub const LANG_TELUGU: USHORT = 0x4a; +pub const LANG_THAI: USHORT = 0x1e; +pub const LANG_TIBETAN: USHORT = 0x51; +pub const LANG_TIGRIGNA: USHORT = 0x73; +pub const LANG_TIGRINYA: USHORT = 0x73; +pub const LANG_TSWANA: USHORT = 0x32; +pub const LANG_TURKISH: USHORT = 0x1f; +pub const LANG_TURKMEN: USHORT = 0x42; +pub const LANG_UIGHUR: USHORT = 0x80; +pub const LANG_UKRAINIAN: USHORT = 0x22; +pub const LANG_UPPER_SORBIAN: USHORT = 0x2e; +pub const LANG_URDU: USHORT = 0x20; +pub const LANG_UZBEK: USHORT = 0x43; +pub const LANG_VALENCIAN: USHORT = 0x03; +pub const LANG_VIETNAMESE: USHORT = 0x2a; +pub const LANG_WELSH: USHORT = 0x52; +pub const LANG_WOLOF: USHORT = 0x88; +pub const LANG_XHOSA: USHORT = 0x34; +pub const LANG_YAKUT: USHORT = 0x85; +pub const LANG_YI: USHORT = 0x78; +pub const LANG_YORUBA: USHORT = 0x6a; +pub const LANG_ZULU: USHORT = 0x35; +pub const SUBLANG_NEUTRAL: USHORT = 0x00; +pub const SUBLANG_DEFAULT: USHORT = 0x01; +pub const SUBLANG_SYS_DEFAULT: USHORT = 0x02; +pub const SUBLANG_CUSTOM_DEFAULT: USHORT = 0x03; +pub const SUBLANG_CUSTOM_UNSPECIFIED: USHORT = 0x04; +pub const SUBLANG_UI_CUSTOM_DEFAULT: USHORT = 0x05; +pub const SUBLANG_AFRIKAANS_SOUTH_AFRICA: USHORT = 0x01; +pub const SUBLANG_ALBANIAN_ALBANIA: USHORT = 0x01; +pub const SUBLANG_ALSATIAN_FRANCE: USHORT = 0x01; +pub const SUBLANG_AMHARIC_ETHIOPIA: USHORT = 0x01; +pub const SUBLANG_ARABIC_SAUDI_ARABIA: USHORT = 0x01; +pub const SUBLANG_ARABIC_IRAQ: USHORT = 0x02; +pub const SUBLANG_ARABIC_EGYPT: USHORT = 0x03; +pub const SUBLANG_ARABIC_LIBYA: USHORT = 0x04; +pub const SUBLANG_ARABIC_ALGERIA: USHORT = 0x05; +pub const SUBLANG_ARABIC_MOROCCO: USHORT = 0x06; +pub const SUBLANG_ARABIC_TUNISIA: USHORT = 0x07; +pub const SUBLANG_ARABIC_OMAN: USHORT = 0x08; +pub const SUBLANG_ARABIC_YEMEN: USHORT = 0x09; +pub const SUBLANG_ARABIC_SYRIA: USHORT = 0x0a; +pub const SUBLANG_ARABIC_JORDAN: USHORT = 0x0b; +pub const SUBLANG_ARABIC_LEBANON: USHORT = 0x0c; +pub const SUBLANG_ARABIC_KUWAIT: USHORT = 0x0d; +pub const SUBLANG_ARABIC_UAE: USHORT = 0x0e; +pub const SUBLANG_ARABIC_BAHRAIN: USHORT = 0x0f; +pub const SUBLANG_ARABIC_QATAR: USHORT = 0x10; +pub const SUBLANG_ARMENIAN_ARMENIA: USHORT = 0x01; +pub const SUBLANG_ASSAMESE_INDIA: USHORT = 0x01; +pub const SUBLANG_AZERI_LATIN: USHORT = 0x01; +pub const SUBLANG_AZERI_CYRILLIC: USHORT = 0x02; +pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN: USHORT = 0x01; +pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC: USHORT = 0x02; +pub const SUBLANG_BANGLA_INDIA: USHORT = 0x01; +pub const SUBLANG_BANGLA_BANGLADESH: USHORT = 0x02; +pub const SUBLANG_BASHKIR_RUSSIA: USHORT = 0x01; +pub const SUBLANG_BASQUE_BASQUE: USHORT = 0x01; +pub const SUBLANG_BELARUSIAN_BELARUS: USHORT = 0x01; +pub const SUBLANG_BENGALI_INDIA: USHORT = 0x01; +pub const SUBLANG_BENGALI_BANGLADESH: USHORT = 0x02; +pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN: USHORT = 0x05; +pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC: USHORT = 0x08; +pub const SUBLANG_BRETON_FRANCE: USHORT = 0x01; +pub const SUBLANG_BULGARIAN_BULGARIA: USHORT = 0x01; +pub const SUBLANG_CATALAN_CATALAN: USHORT = 0x01; +pub const SUBLANG_CENTRAL_KURDISH_IRAQ: USHORT = 0x01; +pub const SUBLANG_CHEROKEE_CHEROKEE: USHORT = 0x01; +pub const SUBLANG_CHINESE_TRADITIONAL: USHORT = 0x01; +pub const SUBLANG_CHINESE_SIMPLIFIED: USHORT = 0x02; +pub const SUBLANG_CHINESE_HONGKONG: USHORT = 0x03; +pub const SUBLANG_CHINESE_SINGAPORE: USHORT = 0x04; +pub const SUBLANG_CHINESE_MACAU: USHORT = 0x05; +pub const SUBLANG_CORSICAN_FRANCE: USHORT = 0x01; +pub const SUBLANG_CZECH_CZECH_REPUBLIC: USHORT = 0x01; +pub const SUBLANG_CROATIAN_CROATIA: USHORT = 0x01; +pub const SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN: USHORT = 0x04; +pub const SUBLANG_DANISH_DENMARK: USHORT = 0x01; +pub const SUBLANG_DARI_AFGHANISTAN: USHORT = 0x01; +pub const SUBLANG_DIVEHI_MALDIVES: USHORT = 0x01; +pub const SUBLANG_DUTCH: USHORT = 0x01; +pub const SUBLANG_DUTCH_BELGIAN: USHORT = 0x02; +pub const SUBLANG_ENGLISH_US: USHORT = 0x01; +pub const SUBLANG_ENGLISH_UK: USHORT = 0x02; +pub const SUBLANG_ENGLISH_AUS: USHORT = 0x03; +pub const SUBLANG_ENGLISH_CAN: USHORT = 0x04; +pub const SUBLANG_ENGLISH_NZ: USHORT = 0x05; +pub const SUBLANG_ENGLISH_EIRE: USHORT = 0x06; +pub const SUBLANG_ENGLISH_SOUTH_AFRICA: USHORT = 0x07; +pub const SUBLANG_ENGLISH_JAMAICA: USHORT = 0x08; +pub const SUBLANG_ENGLISH_CARIBBEAN: USHORT = 0x09; +pub const SUBLANG_ENGLISH_BELIZE: USHORT = 0x0a; +pub const SUBLANG_ENGLISH_TRINIDAD: USHORT = 0x0b; +pub const SUBLANG_ENGLISH_ZIMBABWE: USHORT = 0x0c; +pub const SUBLANG_ENGLISH_PHILIPPINES: USHORT = 0x0d; +pub const SUBLANG_ENGLISH_INDIA: USHORT = 0x10; +pub const SUBLANG_ENGLISH_MALAYSIA: USHORT = 0x11; +pub const SUBLANG_ENGLISH_SINGAPORE: USHORT = 0x12; +pub const SUBLANG_ESTONIAN_ESTONIA: USHORT = 0x01; +pub const SUBLANG_FAEROESE_FAROE_ISLANDS: USHORT = 0x01; +pub const SUBLANG_FILIPINO_PHILIPPINES: USHORT = 0x01; +pub const SUBLANG_FINNISH_FINLAND: USHORT = 0x01; +pub const SUBLANG_FRENCH: USHORT = 0x01; +pub const SUBLANG_FRENCH_BELGIAN: USHORT = 0x02; +pub const SUBLANG_FRENCH_CANADIAN: USHORT = 0x03; +pub const SUBLANG_FRENCH_SWISS: USHORT = 0x04; +pub const SUBLANG_FRENCH_LUXEMBOURG: USHORT = 0x05; +pub const SUBLANG_FRENCH_MONACO: USHORT = 0x06; +pub const SUBLANG_FRISIAN_NETHERLANDS: USHORT = 0x01; +pub const SUBLANG_FULAH_SENEGAL: USHORT = 0x02; +pub const SUBLANG_GALICIAN_GALICIAN: USHORT = 0x01; +pub const SUBLANG_GEORGIAN_GEORGIA: USHORT = 0x01; +pub const SUBLANG_GERMAN: USHORT = 0x01; +pub const SUBLANG_GERMAN_SWISS: USHORT = 0x02; +pub const SUBLANG_GERMAN_AUSTRIAN: USHORT = 0x03; +pub const SUBLANG_GERMAN_LUXEMBOURG: USHORT = 0x04; +pub const SUBLANG_GERMAN_LIECHTENSTEIN: USHORT = 0x05; +pub const SUBLANG_GREEK_GREECE: USHORT = 0x01; +pub const SUBLANG_GREENLANDIC_GREENLAND: USHORT = 0x01; +pub const SUBLANG_GUJARATI_INDIA: USHORT = 0x01; +pub const SUBLANG_HAUSA_NIGERIA_LATIN: USHORT = 0x01; +pub const SUBLANG_HAWAIIAN_US: USHORT = 0x01; +pub const SUBLANG_HEBREW_ISRAEL: USHORT = 0x01; +pub const SUBLANG_HINDI_INDIA: USHORT = 0x01; +pub const SUBLANG_HUNGARIAN_HUNGARY: USHORT = 0x01; +pub const SUBLANG_ICELANDIC_ICELAND: USHORT = 0x01; +pub const SUBLANG_IGBO_NIGERIA: USHORT = 0x01; +pub const SUBLANG_INDONESIAN_INDONESIA: USHORT = 0x01; +pub const SUBLANG_INUKTITUT_CANADA: USHORT = 0x01; +pub const SUBLANG_INUKTITUT_CANADA_LATIN: USHORT = 0x02; +pub const SUBLANG_IRISH_IRELAND: USHORT = 0x02; +pub const SUBLANG_ITALIAN: USHORT = 0x01; +pub const SUBLANG_ITALIAN_SWISS: USHORT = 0x02; +pub const SUBLANG_JAPANESE_JAPAN: USHORT = 0x01; +pub const SUBLANG_KANNADA_INDIA: USHORT = 0x01; +pub const SUBLANG_KASHMIRI_SASIA: USHORT = 0x02; +pub const SUBLANG_KASHMIRI_INDIA: USHORT = 0x02; +pub const SUBLANG_KAZAK_KAZAKHSTAN: USHORT = 0x01; +pub const SUBLANG_KHMER_CAMBODIA: USHORT = 0x01; +pub const SUBLANG_KICHE_GUATEMALA: USHORT = 0x01; +pub const SUBLANG_KINYARWANDA_RWANDA: USHORT = 0x01; +pub const SUBLANG_KONKANI_INDIA: USHORT = 0x01; +pub const SUBLANG_KOREAN: USHORT = 0x01; +pub const SUBLANG_KYRGYZ_KYRGYZSTAN: USHORT = 0x01; +pub const SUBLANG_LAO_LAO: USHORT = 0x01; +pub const SUBLANG_LATVIAN_LATVIA: USHORT = 0x01; +pub const SUBLANG_LITHUANIAN: USHORT = 0x01; +pub const SUBLANG_LOWER_SORBIAN_GERMANY: USHORT = 0x02; +pub const SUBLANG_LUXEMBOURGISH_LUXEMBOURG: USHORT = 0x01; +pub const SUBLANG_MACEDONIAN_MACEDONIA: USHORT = 0x01; +pub const SUBLANG_MALAY_MALAYSIA: USHORT = 0x01; +pub const SUBLANG_MALAY_BRUNEI_DARUSSALAM: USHORT = 0x02; +pub const SUBLANG_MALAYALAM_INDIA: USHORT = 0x01; +pub const SUBLANG_MALTESE_MALTA: USHORT = 0x01; +pub const SUBLANG_MAORI_NEW_ZEALAND: USHORT = 0x01; +pub const SUBLANG_MAPUDUNGUN_CHILE: USHORT = 0x01; +pub const SUBLANG_MARATHI_INDIA: USHORT = 0x01; +pub const SUBLANG_MOHAWK_MOHAWK: USHORT = 0x01; +pub const SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA: USHORT = 0x01; +pub const SUBLANG_MONGOLIAN_PRC: USHORT = 0x02; +pub const SUBLANG_NEPALI_INDIA: USHORT = 0x02; +pub const SUBLANG_NEPALI_NEPAL: USHORT = 0x01; +pub const SUBLANG_NORWEGIAN_BOKMAL: USHORT = 0x01; +pub const SUBLANG_NORWEGIAN_NYNORSK: USHORT = 0x02; +pub const SUBLANG_OCCITAN_FRANCE: USHORT = 0x01; +pub const SUBLANG_ODIA_INDIA: USHORT = 0x01; +pub const SUBLANG_ORIYA_INDIA: USHORT = 0x01; +pub const SUBLANG_PASHTO_AFGHANISTAN: USHORT = 0x01; +pub const SUBLANG_PERSIAN_IRAN: USHORT = 0x01; +pub const SUBLANG_POLISH_POLAND: USHORT = 0x01; +pub const SUBLANG_PORTUGUESE: USHORT = 0x02; +pub const SUBLANG_PORTUGUESE_BRAZILIAN: USHORT = 0x01; +pub const SUBLANG_PULAR_SENEGAL: USHORT = 0x02; +pub const SUBLANG_PUNJABI_INDIA: USHORT = 0x01; +pub const SUBLANG_PUNJABI_PAKISTAN: USHORT = 0x02; +pub const SUBLANG_QUECHUA_BOLIVIA: USHORT = 0x01; +pub const SUBLANG_QUECHUA_ECUADOR: USHORT = 0x02; +pub const SUBLANG_QUECHUA_PERU: USHORT = 0x03; +pub const SUBLANG_ROMANIAN_ROMANIA: USHORT = 0x01; +pub const SUBLANG_ROMANSH_SWITZERLAND: USHORT = 0x01; +pub const SUBLANG_RUSSIAN_RUSSIA: USHORT = 0x01; +pub const SUBLANG_SAKHA_RUSSIA: USHORT = 0x01; +pub const SUBLANG_SAMI_NORTHERN_NORWAY: USHORT = 0x01; +pub const SUBLANG_SAMI_NORTHERN_SWEDEN: USHORT = 0x02; +pub const SUBLANG_SAMI_NORTHERN_FINLAND: USHORT = 0x03; +pub const SUBLANG_SAMI_LULE_NORWAY: USHORT = 0x04; +pub const SUBLANG_SAMI_LULE_SWEDEN: USHORT = 0x05; +pub const SUBLANG_SAMI_SOUTHERN_NORWAY: USHORT = 0x06; +pub const SUBLANG_SAMI_SOUTHERN_SWEDEN: USHORT = 0x07; +pub const SUBLANG_SAMI_SKOLT_FINLAND: USHORT = 0x08; +pub const SUBLANG_SAMI_INARI_FINLAND: USHORT = 0x09; +pub const SUBLANG_SANSKRIT_INDIA: USHORT = 0x01; +pub const SUBLANG_SCOTTISH_GAELIC: USHORT = 0x01; +pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN: USHORT = 0x06; +pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC: USHORT = 0x07; +pub const SUBLANG_SERBIAN_MONTENEGRO_LATIN: USHORT = 0x0b; +pub const SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC: USHORT = 0x0c; +pub const SUBLANG_SERBIAN_SERBIA_LATIN: USHORT = 0x09; +pub const SUBLANG_SERBIAN_SERBIA_CYRILLIC: USHORT = 0x0a; +pub const SUBLANG_SERBIAN_CROATIA: USHORT = 0x01; +pub const SUBLANG_SERBIAN_LATIN: USHORT = 0x02; +pub const SUBLANG_SERBIAN_CYRILLIC: USHORT = 0x03; +pub const SUBLANG_SINDHI_INDIA: USHORT = 0x01; +pub const SUBLANG_SINDHI_PAKISTAN: USHORT = 0x02; +pub const SUBLANG_SINDHI_AFGHANISTAN: USHORT = 0x02; +pub const SUBLANG_SINHALESE_SRI_LANKA: USHORT = 0x01; +pub const SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA: USHORT = 0x01; +pub const SUBLANG_SLOVAK_SLOVAKIA: USHORT = 0x01; +pub const SUBLANG_SLOVENIAN_SLOVENIA: USHORT = 0x01; +pub const SUBLANG_SPANISH: USHORT = 0x01; +pub const SUBLANG_SPANISH_MEXICAN: USHORT = 0x02; +pub const SUBLANG_SPANISH_MODERN: USHORT = 0x03; +pub const SUBLANG_SPANISH_GUATEMALA: USHORT = 0x04; +pub const SUBLANG_SPANISH_COSTA_RICA: USHORT = 0x05; +pub const SUBLANG_SPANISH_PANAMA: USHORT = 0x06; +pub const SUBLANG_SPANISH_DOMINICAN_REPUBLIC: USHORT = 0x07; +pub const SUBLANG_SPANISH_VENEZUELA: USHORT = 0x08; +pub const SUBLANG_SPANISH_COLOMBIA: USHORT = 0x09; +pub const SUBLANG_SPANISH_PERU: USHORT = 0x0a; +pub const SUBLANG_SPANISH_ARGENTINA: USHORT = 0x0b; +pub const SUBLANG_SPANISH_ECUADOR: USHORT = 0x0c; +pub const SUBLANG_SPANISH_CHILE: USHORT = 0x0d; +pub const SUBLANG_SPANISH_URUGUAY: USHORT = 0x0e; +pub const SUBLANG_SPANISH_PARAGUAY: USHORT = 0x0f; +pub const SUBLANG_SPANISH_BOLIVIA: USHORT = 0x10; +pub const SUBLANG_SPANISH_EL_SALVADOR: USHORT = 0x11; +pub const SUBLANG_SPANISH_HONDURAS: USHORT = 0x12; +pub const SUBLANG_SPANISH_NICARAGUA: USHORT = 0x13; +pub const SUBLANG_SPANISH_PUERTO_RICO: USHORT = 0x14; +pub const SUBLANG_SPANISH_US: USHORT = 0x15; +pub const SUBLANG_SWAHILI_KENYA: USHORT = 0x01; +pub const SUBLANG_SWEDISH: USHORT = 0x01; +pub const SUBLANG_SWEDISH_FINLAND: USHORT = 0x02; +pub const SUBLANG_SYRIAC_SYRIA: USHORT = 0x01; +pub const SUBLANG_TAJIK_TAJIKISTAN: USHORT = 0x01; +pub const SUBLANG_TAMAZIGHT_ALGERIA_LATIN: USHORT = 0x02; +pub const SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH: USHORT = 0x04; +pub const SUBLANG_TAMIL_INDIA: USHORT = 0x01; +pub const SUBLANG_TAMIL_SRI_LANKA: USHORT = 0x02; +pub const SUBLANG_TATAR_RUSSIA: USHORT = 0x01; +pub const SUBLANG_TELUGU_INDIA: USHORT = 0x01; +pub const SUBLANG_THAI_THAILAND: USHORT = 0x01; +pub const SUBLANG_TIBETAN_PRC: USHORT = 0x01; +pub const SUBLANG_TIGRIGNA_ERITREA: USHORT = 0x02; +pub const SUBLANG_TIGRINYA_ERITREA: USHORT = 0x02; +pub const SUBLANG_TIGRINYA_ETHIOPIA: USHORT = 0x01; +pub const SUBLANG_TSWANA_BOTSWANA: USHORT = 0x02; +pub const SUBLANG_TSWANA_SOUTH_AFRICA: USHORT = 0x01; +pub const SUBLANG_TURKISH_TURKEY: USHORT = 0x01; +pub const SUBLANG_TURKMEN_TURKMENISTAN: USHORT = 0x01; +pub const SUBLANG_UIGHUR_PRC: USHORT = 0x01; +pub const SUBLANG_UKRAINIAN_UKRAINE: USHORT = 0x01; +pub const SUBLANG_UPPER_SORBIAN_GERMANY: USHORT = 0x01; +pub const SUBLANG_URDU_PAKISTAN: USHORT = 0x01; +pub const SUBLANG_URDU_INDIA: USHORT = 0x02; +pub const SUBLANG_UZBEK_LATIN: USHORT = 0x01; +pub const SUBLANG_UZBEK_CYRILLIC: USHORT = 0x02; +pub const SUBLANG_VALENCIAN_VALENCIA: USHORT = 0x02; +pub const SUBLANG_VIETNAMESE_VIETNAM: USHORT = 0x01; +pub const SUBLANG_WELSH_UNITED_KINGDOM: USHORT = 0x01; +pub const SUBLANG_WOLOF_SENEGAL: USHORT = 0x01; +pub const SUBLANG_XHOSA_SOUTH_AFRICA: USHORT = 0x01; +pub const SUBLANG_YAKUT_RUSSIA: USHORT = 0x01; +pub const SUBLANG_YI_PRC: USHORT = 0x01; +pub const SUBLANG_YORUBA_NIGERIA: USHORT = 0x01; +pub const SUBLANG_ZULU_SOUTH_AFRICA: USHORT = 0x01; +pub const SORT_DEFAULT: USHORT = 0x0; +pub const SORT_INVARIANT_MATH: USHORT = 0x1; +pub const SORT_JAPANESE_XJIS: USHORT = 0x0; +pub const SORT_JAPANESE_UNICODE: USHORT = 0x1; +pub const SORT_JAPANESE_RADICALSTROKE: USHORT = 0x4; +pub const SORT_CHINESE_BIG5: USHORT = 0x0; +pub const SORT_CHINESE_PRCP: USHORT = 0x0; +pub const SORT_CHINESE_UNICODE: USHORT = 0x1; +pub const SORT_CHINESE_PRC: USHORT = 0x2; +pub const SORT_CHINESE_BOPOMOFO: USHORT = 0x3; +pub const SORT_CHINESE_RADICALSTROKE: USHORT = 0x4; +pub const SORT_KOREAN_KSC: USHORT = 0x0; +pub const SORT_KOREAN_UNICODE: USHORT = 0x1; +pub const SORT_GERMAN_PHONE_BOOK: USHORT = 0x1; +pub const SORT_HUNGARIAN_DEFAULT: USHORT = 0x0; +pub const SORT_HUNGARIAN_TECHNICAL: USHORT = 0x1; +pub const SORT_GEORGIAN_TRADITIONAL: USHORT = 0x0; +pub const SORT_GEORGIAN_MODERN: USHORT = 0x1; +macro_rules! MAKELANGID { + ($p:expr, $s:expr) => { + (($s as USHORT) << 10) | ($p as USHORT) + } +} +#[inline] +pub fn MAKELANGID(p: USHORT, s: USHORT) -> LANGID { (s << 10) | p } +#[inline] +pub fn PRIMARYLANGID(lgid: LANGID) -> USHORT { lgid & 0x3ff } +#[inline] +pub fn SUBLANGID(lgid: LANGID) -> USHORT { lgid >> 10 } +pub const NLS_VALID_LOCALE_MASK: ULONG = 0x000fffff; +macro_rules! MAKELCID { + ($lgid:expr, $srtid:expr) => { + (($srtid as ULONG) << 16) | ($lgid as ULONG) + } +} +#[inline] +pub fn MAKELCID(lgid: LANGID, srtid: USHORT) -> LCID { + ((srtid as ULONG) << 16) | (lgid as ULONG) +} +#[inline] +pub fn MAKESORTLCID(lgid: LANGID, srtid: USHORT, ver: USHORT) -> LCID { + MAKELCID(lgid, srtid) | ((ver as ULONG) << 20) +} +#[inline] +pub fn LANGIDFROMLCID(lcid: LCID) -> LANGID { lcid as LANGID } +#[inline] +pub fn SORTIDFROMLCID(lcid: LCID) -> USHORT { ((lcid >> 16) & 0xf) as USHORT } +#[inline] +pub fn SORTVERSIONFROMLCID(lcid: LCID) -> USHORT { ((lcid >> 16) & 0xf) as USHORT } +pub const LOCALE_NAME_MAX_LENGTH: usize = 85; +pub const LANG_SYSTEM_DEFAULT: LANGID = MAKELANGID!(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT); +pub const LANG_USER_DEFAULT: LANGID = MAKELANGID!(LANG_NEUTRAL, SUBLANG_DEFAULT); +pub const LOCALE_SYSTEM_DEFAULT: LCID = MAKELCID!(LANG_SYSTEM_DEFAULT, SORT_DEFAULT); +pub const LOCALE_USER_DEFAULT: LCID = MAKELCID!(LANG_USER_DEFAULT, SORT_DEFAULT); +pub const LOCALE_CUSTOM_DEFAULT: LCID + = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT); +pub const LOCALE_CUSTOM_UNSPECIFIED: LCID + = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT); +pub const LOCALE_CUSTOM_UI_DEFAULT: LCID + = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_UI_CUSTOM_DEFAULT), SORT_DEFAULT); +pub const LOCALE_NEUTRAL: LCID + = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT); +pub const LOCALE_INVARIANT: LCID + = MAKELCID!(MAKELANGID!(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT); +pub const LOCALE_TRANSIENT_KEYBOARD1: LCID = 0x2000; +pub const LOCALE_TRANSIENT_KEYBOARD2: LCID = 0x2400; +pub const LOCALE_TRANSIENT_KEYBOARD3: LCID = 0x2800; +pub const LOCALE_TRANSIENT_KEYBOARD4: LCID = 0x2c00; +pub const LOCALE_UNASSIGNED_LCID: LCID = LOCALE_CUSTOM_UNSPECIFIED; diff --git a/bash-5.1/vendor/winapi/src/shared/ntstatus.rs b/bash-5.1/vendor/winapi/src/shared/ntstatus.rs new file mode 100644 index 0000000000000000000000000000000000000000..c369c22fc90e1c69419e69576c8d2a138b0397bc --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ntstatus.rs @@ -0,0 +1,2574 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Constant definitions for the NTSTATUS values. +use shared::ntdef::NTSTATUS; +pub const STATUS_WAIT_0: NTSTATUS = 0x00000000; +pub const FACILITY_VSM: NTSTATUS = 0x45; +pub const FACILITY_VOLSNAP: NTSTATUS = 0x50; +pub const FACILITY_VOLMGR: NTSTATUS = 0x38; +pub const FACILITY_VIRTUALIZATION: NTSTATUS = 0x37; +pub const FACILITY_VIDEO: NTSTATUS = 0x1B; +pub const FACILITY_USB_ERROR_CODE: NTSTATUS = 0x10; +pub const FACILITY_TRANSACTION: NTSTATUS = 0x19; +pub const FACILITY_TPM: NTSTATUS = 0x29; +pub const FACILITY_TERMINAL_SERVER: NTSTATUS = 0xA; +pub const FACILITY_SXS_ERROR_CODE: NTSTATUS = 0x15; +pub const FACILITY_NTSSPI: NTSTATUS = 0x9; +pub const FACILITY_SPACES: NTSTATUS = 0xE7; +pub const FACILITY_SMB: NTSTATUS = 0x5D; +pub const FACILITY_SYSTEM_INTEGRITY: NTSTATUS = 0xE9; +pub const FACILITY_SHARED_VHDX: NTSTATUS = 0x5C; +pub const FACILITY_SECUREBOOT: NTSTATUS = 0x43; +pub const FACILITY_SECURITY_CORE: NTSTATUS = 0xE8; +pub const FACILITY_SDBUS: NTSTATUS = 0x51; +pub const FACILITY_RTPM: NTSTATUS = 0x2A; +pub const FACILITY_RPC_STUBS: NTSTATUS = 0x3; +pub const FACILITY_RPC_RUNTIME: NTSTATUS = 0x2; +pub const FACILITY_RESUME_KEY_FILTER: NTSTATUS = 0x40; +pub const FACILITY_RDBSS: NTSTATUS = 0x41; +pub const FACILITY_PLATFORM_MANIFEST: NTSTATUS = 0xEB; +pub const FACILITY_NTWIN32: NTSTATUS = 0x7; +pub const FACILITY_WIN32K_NTUSER: NTSTATUS = 0x3E; +pub const FACILITY_WIN32K_NTGDI: NTSTATUS = 0x3F; +pub const FACILITY_NDIS_ERROR_CODE: NTSTATUS = 0x23; +pub const FACILTIY_MUI_ERROR_CODE: NTSTATUS = 0xB; +pub const FACILITY_MONITOR: NTSTATUS = 0x1D; +pub const FACILITY_MAXIMUM_VALUE: NTSTATUS = 0xEC; +pub const FACILITY_LICENSING: NTSTATUS = 0xEA; +pub const FACILITY_IPSEC: NTSTATUS = 0x36; +pub const FACILITY_IO_ERROR_CODE: NTSTATUS = 0x4; +pub const FACILITY_INTERIX: NTSTATUS = 0x99; +pub const FACILITY_HYPERVISOR: NTSTATUS = 0x35; +pub const FACILITY_HID_ERROR_CODE: NTSTATUS = 0x11; +pub const FACILITY_GRAPHICS_KERNEL: NTSTATUS = 0x1E; +pub const FACILITY_FWP_ERROR_CODE: NTSTATUS = 0x22; +pub const FACILITY_FVE_ERROR_CODE: NTSTATUS = 0x21; +pub const FACILITY_FIREWIRE_ERROR_CODE: NTSTATUS = 0x12; +pub const FACILITY_FILTER_MANAGER: NTSTATUS = 0x1C; +pub const FACILITY_DRIVER_FRAMEWORK: NTSTATUS = 0x20; +pub const FACILITY_DEBUGGER: NTSTATUS = 0x1; +pub const FACILITY_COMMONLOG: NTSTATUS = 0x1A; +pub const FACILITY_CODCLASS_ERROR_CODE: NTSTATUS = 0x6; +pub const FACILITY_CLUSTER_ERROR_CODE: NTSTATUS = 0x13; +pub const FACILITY_NTCERT: NTSTATUS = 0x8; +pub const FACILITY_BTH_ATT: NTSTATUS = 0x42; +pub const FACILITY_BCD_ERROR_CODE: NTSTATUS = 0x39; +pub const FACILITY_AUDIO_KERNEL: NTSTATUS = 0x44; +pub const FACILITY_ACPI_ERROR_CODE: NTSTATUS = 0x14; +pub const STATUS_SEVERITY_WARNING: NTSTATUS = 0x2; +pub const STATUS_SEVERITY_SUCCESS: NTSTATUS = 0x0; +pub const STATUS_SEVERITY_INFORMATIONAL: NTSTATUS = 0x1; +pub const STATUS_SEVERITY_ERROR: NTSTATUS = 0x3; +pub const STATUS_SUCCESS: NTSTATUS = 0x00000000; +pub const STATUS_WAIT_1: NTSTATUS = 0x00000001; +pub const STATUS_WAIT_2: NTSTATUS = 0x00000002; +pub const STATUS_WAIT_3: NTSTATUS = 0x00000003; +pub const STATUS_WAIT_63: NTSTATUS = 0x0000003F; +pub const STATUS_ABANDONED: NTSTATUS = 0x00000080; +pub const STATUS_ABANDONED_WAIT_0: NTSTATUS = 0x00000080; +pub const STATUS_ABANDONED_WAIT_63: NTSTATUS = 0x000000BF; +pub const STATUS_USER_APC: NTSTATUS = 0x000000C0; +pub const STATUS_ALREADY_COMPLETE: NTSTATUS = 0x000000FF; +pub const STATUS_KERNEL_APC: NTSTATUS = 0x00000100; +pub const STATUS_ALERTED: NTSTATUS = 0x00000101; +pub const STATUS_TIMEOUT: NTSTATUS = 0x00000102; +pub const STATUS_PENDING: NTSTATUS = 0x00000103; +pub const STATUS_REPARSE: NTSTATUS = 0x00000104; +pub const STATUS_MORE_ENTRIES: NTSTATUS = 0x00000105; +pub const STATUS_NOT_ALL_ASSIGNED: NTSTATUS = 0x00000106; +pub const STATUS_SOME_NOT_MAPPED: NTSTATUS = 0x00000107; +pub const STATUS_OPLOCK_BREAK_IN_PROGRESS: NTSTATUS = 0x00000108; +pub const STATUS_VOLUME_MOUNTED: NTSTATUS = 0x00000109; +pub const STATUS_RXACT_COMMITTED: NTSTATUS = 0x0000010A; +pub const STATUS_NOTIFY_CLEANUP: NTSTATUS = 0x0000010B; +pub const STATUS_NOTIFY_ENUM_DIR: NTSTATUS = 0x0000010C; +pub const STATUS_NO_QUOTAS_FOR_ACCOUNT: NTSTATUS = 0x0000010D; +pub const STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED: NTSTATUS = 0x0000010E; +pub const STATUS_PAGE_FAULT_TRANSITION: NTSTATUS = 0x00000110; +pub const STATUS_PAGE_FAULT_DEMAND_ZERO: NTSTATUS = 0x00000111; +pub const STATUS_PAGE_FAULT_COPY_ON_WRITE: NTSTATUS = 0x00000112; +pub const STATUS_PAGE_FAULT_GUARD_PAGE: NTSTATUS = 0x00000113; +pub const STATUS_PAGE_FAULT_PAGING_FILE: NTSTATUS = 0x00000114; +pub const STATUS_CACHE_PAGE_LOCKED: NTSTATUS = 0x00000115; +pub const STATUS_CRASH_DUMP: NTSTATUS = 0x00000116; +pub const STATUS_BUFFER_ALL_ZEROS: NTSTATUS = 0x00000117; +pub const STATUS_REPARSE_OBJECT: NTSTATUS = 0x00000118; +pub const STATUS_RESOURCE_REQUIREMENTS_CHANGED: NTSTATUS = 0x00000119; +pub const STATUS_TRANSLATION_COMPLETE: NTSTATUS = 0x00000120; +pub const STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY: NTSTATUS = 0x00000121; +pub const STATUS_NOTHING_TO_TERMINATE: NTSTATUS = 0x00000122; +pub const STATUS_PROCESS_NOT_IN_JOB: NTSTATUS = 0x00000123; +pub const STATUS_PROCESS_IN_JOB: NTSTATUS = 0x00000124; +pub const STATUS_VOLSNAP_HIBERNATE_READY: NTSTATUS = 0x00000125; +pub const STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY: NTSTATUS = 0x00000126; +pub const STATUS_INTERRUPT_VECTOR_ALREADY_CONNECTED: NTSTATUS = 0x00000127; +pub const STATUS_INTERRUPT_STILL_CONNECTED: NTSTATUS = 0x00000128; +pub const STATUS_PROCESS_CLONED: NTSTATUS = 0x00000129; +pub const STATUS_FILE_LOCKED_WITH_ONLY_READERS: NTSTATUS = 0x0000012A; +pub const STATUS_FILE_LOCKED_WITH_WRITERS: NTSTATUS = 0x0000012B; +pub const STATUS_VALID_IMAGE_HASH: NTSTATUS = 0x0000012C; +pub const STATUS_VALID_CATALOG_HASH: NTSTATUS = 0x0000012D; +pub const STATUS_VALID_STRONG_CODE_HASH: NTSTATUS = 0x0000012E; +pub const STATUS_GHOSTED: NTSTATUS = 0x0000012F; +pub const STATUS_RESOURCEMANAGER_READ_ONLY: NTSTATUS = 0x00000202; +pub const STATUS_RING_PREVIOUSLY_EMPTY: NTSTATUS = 0x00000210; +pub const STATUS_RING_PREVIOUSLY_FULL: NTSTATUS = 0x00000211; +pub const STATUS_RING_PREVIOUSLY_ABOVE_QUOTA: NTSTATUS = 0x00000212; +pub const STATUS_RING_NEWLY_EMPTY: NTSTATUS = 0x00000213; +pub const STATUS_RING_SIGNAL_OPPOSITE_ENDPOINT: NTSTATUS = 0x00000214; +pub const STATUS_OPLOCK_SWITCHED_TO_NEW_HANDLE: NTSTATUS = 0x00000215; +pub const STATUS_OPLOCK_HANDLE_CLOSED: NTSTATUS = 0x00000216; +pub const STATUS_WAIT_FOR_OPLOCK: NTSTATUS = 0x00000367; +pub const STATUS_REPARSE_GLOBAL: NTSTATUS = 0x00000368; +pub const DBG_EXCEPTION_HANDLED: NTSTATUS = 0x00010001; +pub const DBG_CONTINUE: NTSTATUS = 0x00010002; +pub const STATUS_FLT_IO_COMPLETE: NTSTATUS = 0x001C0001; +pub const STATUS_OBJECT_NAME_EXISTS: NTSTATUS = 0x40000000; +pub const STATUS_THREAD_WAS_SUSPENDED: NTSTATUS = 0x40000001; +pub const STATUS_WORKING_SET_LIMIT_RANGE: NTSTATUS = 0x40000002; +pub const STATUS_IMAGE_NOT_AT_BASE: NTSTATUS = 0x40000003; +pub const STATUS_RXACT_STATE_CREATED: NTSTATUS = 0x40000004; +pub const STATUS_SEGMENT_NOTIFICATION: NTSTATUS = 0x40000005; +pub const STATUS_LOCAL_USER_SESSION_KEY: NTSTATUS = 0x40000006; +pub const STATUS_BAD_CURRENT_DIRECTORY: NTSTATUS = 0x40000007; +pub const STATUS_SERIAL_MORE_WRITES: NTSTATUS = 0x40000008; +pub const STATUS_REGISTRY_RECOVERED: NTSTATUS = 0x40000009; +pub const STATUS_FT_READ_RECOVERY_FROM_BACKUP: NTSTATUS = 0x4000000A; +pub const STATUS_FT_WRITE_RECOVERY: NTSTATUS = 0x4000000B; +pub const STATUS_SERIAL_COUNTER_TIMEOUT: NTSTATUS = 0x4000000C; +pub const STATUS_NULL_LM_PASSWORD: NTSTATUS = 0x4000000D; +pub const STATUS_IMAGE_MACHINE_TYPE_MISMATCH: NTSTATUS = 0x4000000E; +pub const STATUS_RECEIVE_PARTIAL: NTSTATUS = 0x4000000F; +pub const STATUS_RECEIVE_EXPEDITED: NTSTATUS = 0x40000010; +pub const STATUS_RECEIVE_PARTIAL_EXPEDITED: NTSTATUS = 0x40000011; +pub const STATUS_EVENT_DONE: NTSTATUS = 0x40000012; +pub const STATUS_EVENT_PENDING: NTSTATUS = 0x40000013; +pub const STATUS_CHECKING_FILE_SYSTEM: NTSTATUS = 0x40000014; +pub const STATUS_FATAL_APP_EXIT: NTSTATUS = 0x40000015; +pub const STATUS_PREDEFINED_HANDLE: NTSTATUS = 0x40000016; +pub const STATUS_WAS_UNLOCKED: NTSTATUS = 0x40000017; +pub const STATUS_SERVICE_NOTIFICATION: NTSTATUS = 0x40000018; +pub const STATUS_WAS_LOCKED: NTSTATUS = 0x40000019; +pub const STATUS_LOG_HARD_ERROR: NTSTATUS = 0x4000001A; +pub const STATUS_ALREADY_WIN32: NTSTATUS = 0x4000001B; +pub const STATUS_WX86_UNSIMULATE: NTSTATUS = 0x4000001C; +pub const STATUS_WX86_CONTINUE: NTSTATUS = 0x4000001D; +pub const STATUS_WX86_SINGLE_STEP: NTSTATUS = 0x4000001E; +pub const STATUS_WX86_BREAKPOINT: NTSTATUS = 0x4000001F; +pub const STATUS_WX86_EXCEPTION_CONTINUE: NTSTATUS = 0x40000020; +pub const STATUS_WX86_EXCEPTION_LASTCHANCE: NTSTATUS = 0x40000021; +pub const STATUS_WX86_EXCEPTION_CHAIN: NTSTATUS = 0x40000022; +pub const STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE: NTSTATUS = 0x40000023; +pub const STATUS_NO_YIELD_PERFORMED: NTSTATUS = 0x40000024; +pub const STATUS_TIMER_RESUME_IGNORED: NTSTATUS = 0x40000025; +pub const STATUS_ARBITRATION_UNHANDLED: NTSTATUS = 0x40000026; +pub const STATUS_CARDBUS_NOT_SUPPORTED: NTSTATUS = 0x40000027; +pub const STATUS_WX86_CREATEWX86TIB: NTSTATUS = 0x40000028; +pub const STATUS_MP_PROCESSOR_MISMATCH: NTSTATUS = 0x40000029; +pub const STATUS_HIBERNATED: NTSTATUS = 0x4000002A; +pub const STATUS_RESUME_HIBERNATION: NTSTATUS = 0x4000002B; +pub const STATUS_FIRMWARE_UPDATED: NTSTATUS = 0x4000002C; +pub const STATUS_DRIVERS_LEAKING_LOCKED_PAGES: NTSTATUS = 0x4000002D; +pub const STATUS_MESSAGE_RETRIEVED: NTSTATUS = 0x4000002E; +pub const STATUS_SYSTEM_POWERSTATE_TRANSITION: NTSTATUS = 0x4000002F; +pub const STATUS_ALPC_CHECK_COMPLETION_LIST: NTSTATUS = 0x40000030; +pub const STATUS_SYSTEM_POWERSTATE_COMPLEX_TRANSITION: NTSTATUS = 0x40000031; +pub const STATUS_ACCESS_AUDIT_BY_POLICY: NTSTATUS = 0x40000032; +pub const STATUS_ABANDON_HIBERFILE: NTSTATUS = 0x40000033; +pub const STATUS_BIZRULES_NOT_ENABLED: NTSTATUS = 0x40000034; +pub const STATUS_FT_READ_FROM_COPY: NTSTATUS = 0x40000035; +pub const STATUS_IMAGE_AT_DIFFERENT_BASE: NTSTATUS = 0x40000036; +pub const DBG_REPLY_LATER: NTSTATUS = 0x40010001; +pub const DBG_UNABLE_TO_PROVIDE_HANDLE: NTSTATUS = 0x40010002; +pub const DBG_TERMINATE_THREAD: NTSTATUS = 0x40010003; +pub const DBG_TERMINATE_PROCESS: NTSTATUS = 0x40010004; +pub const DBG_CONTROL_C: NTSTATUS = 0x40010005; +pub const DBG_PRINTEXCEPTION_C: NTSTATUS = 0x40010006; +pub const DBG_RIPEXCEPTION: NTSTATUS = 0x40010007; +pub const DBG_CONTROL_BREAK: NTSTATUS = 0x40010008; +pub const DBG_COMMAND_EXCEPTION: NTSTATUS = 0x40010009; +pub const DBG_PRINTEXCEPTION_WIDE_C: NTSTATUS = 0x4001000A; +pub const STATUS_HEURISTIC_DAMAGE_POSSIBLE: NTSTATUS = 0x40190001; +pub const STATUS_GUARD_PAGE_VIOLATION: NTSTATUS = 0x80000001; +pub const STATUS_DATATYPE_MISALIGNMENT: NTSTATUS = 0x80000002; +pub const STATUS_BREAKPOINT: NTSTATUS = 0x80000003; +pub const STATUS_SINGLE_STEP: NTSTATUS = 0x80000004; +pub const STATUS_BUFFER_OVERFLOW: NTSTATUS = 0x80000005; +pub const STATUS_NO_MORE_FILES: NTSTATUS = 0x80000006; +pub const STATUS_WAKE_SYSTEM_DEBUGGER: NTSTATUS = 0x80000007; +pub const STATUS_HANDLES_CLOSED: NTSTATUS = 0x8000000A; +pub const STATUS_NO_INHERITANCE: NTSTATUS = 0x8000000B; +pub const STATUS_GUID_SUBSTITUTION_MADE: NTSTATUS = 0x8000000C; +pub const STATUS_PARTIAL_COPY: NTSTATUS = 0x8000000D; +pub const STATUS_DEVICE_PAPER_EMPTY: NTSTATUS = 0x8000000E; +pub const STATUS_DEVICE_POWERED_OFF: NTSTATUS = 0x8000000F; +pub const STATUS_DEVICE_OFF_LINE: NTSTATUS = 0x80000010; +pub const STATUS_DEVICE_BUSY: NTSTATUS = 0x80000011; +pub const STATUS_NO_MORE_EAS: NTSTATUS = 0x80000012; +pub const STATUS_INVALID_EA_NAME: NTSTATUS = 0x80000013; +pub const STATUS_EA_LIST_INCONSISTENT: NTSTATUS = 0x80000014; +pub const STATUS_INVALID_EA_FLAG: NTSTATUS = 0x80000015; +pub const STATUS_VERIFY_REQUIRED: NTSTATUS = 0x80000016; +pub const STATUS_EXTRANEOUS_INFORMATION: NTSTATUS = 0x80000017; +pub const STATUS_RXACT_COMMIT_NECESSARY: NTSTATUS = 0x80000018; +pub const STATUS_NO_MORE_ENTRIES: NTSTATUS = 0x8000001A; +pub const STATUS_FILEMARK_DETECTED: NTSTATUS = 0x8000001B; +pub const STATUS_MEDIA_CHANGED: NTSTATUS = 0x8000001C; +pub const STATUS_BUS_RESET: NTSTATUS = 0x8000001D; +pub const STATUS_END_OF_MEDIA: NTSTATUS = 0x8000001E; +pub const STATUS_BEGINNING_OF_MEDIA: NTSTATUS = 0x8000001F; +pub const STATUS_MEDIA_CHECK: NTSTATUS = 0x80000020; +pub const STATUS_SETMARK_DETECTED: NTSTATUS = 0x80000021; +pub const STATUS_NO_DATA_DETECTED: NTSTATUS = 0x80000022; +pub const STATUS_REDIRECTOR_HAS_OPEN_HANDLES: NTSTATUS = 0x80000023; +pub const STATUS_SERVER_HAS_OPEN_HANDLES: NTSTATUS = 0x80000024; +pub const STATUS_ALREADY_DISCONNECTED: NTSTATUS = 0x80000025; +pub const STATUS_LONGJUMP: NTSTATUS = 0x80000026; +pub const STATUS_CLEANER_CARTRIDGE_INSTALLED: NTSTATUS = 0x80000027; +pub const STATUS_PLUGPLAY_QUERY_VETOED: NTSTATUS = 0x80000028; +pub const STATUS_UNWIND_CONSOLIDATE: NTSTATUS = 0x80000029; +pub const STATUS_REGISTRY_HIVE_RECOVERED: NTSTATUS = 0x8000002A; +pub const STATUS_DLL_MIGHT_BE_INSECURE: NTSTATUS = 0x8000002B; +pub const STATUS_DLL_MIGHT_BE_INCOMPATIBLE: NTSTATUS = 0x8000002C; +pub const STATUS_STOPPED_ON_SYMLINK: NTSTATUS = 0x8000002D; +pub const STATUS_CANNOT_GRANT_REQUESTED_OPLOCK: NTSTATUS = 0x8000002E; +pub const STATUS_NO_ACE_CONDITION: NTSTATUS = 0x8000002F; +pub const STATUS_DEVICE_SUPPORT_IN_PROGRESS: NTSTATUS = 0x80000030; +pub const STATUS_DEVICE_POWER_CYCLE_REQUIRED: NTSTATUS = 0x80000031; +pub const STATUS_NO_WORK_DONE: NTSTATUS = 0x80000032; +pub const DBG_EXCEPTION_NOT_HANDLED: NTSTATUS = 0x80010001; +pub const STATUS_CLUSTER_NODE_ALREADY_UP: NTSTATUS = 0x80130001; +pub const STATUS_CLUSTER_NODE_ALREADY_DOWN: NTSTATUS = 0x80130002; +pub const STATUS_CLUSTER_NETWORK_ALREADY_ONLINE: NTSTATUS = 0x80130003; +pub const STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE: NTSTATUS = 0x80130004; +pub const STATUS_CLUSTER_NODE_ALREADY_MEMBER: NTSTATUS = 0x80130005; +pub const STATUS_FLT_BUFFER_TOO_SMALL: NTSTATUS = 0x801C0001; +pub const STATUS_FVE_PARTIAL_METADATA: NTSTATUS = 0x80210001; +pub const STATUS_FVE_TRANSIENT_STATE: NTSTATUS = 0x80210002; +pub const STATUS_CLOUD_FILE_PROPERTY_BLOB_CHECKSUM_MISMATCH: NTSTATUS = 0x8000CF00; +pub const STATUS_UNSUCCESSFUL: NTSTATUS = 0xC0000001; +pub const STATUS_NOT_IMPLEMENTED: NTSTATUS = 0xC0000002; +pub const STATUS_INVALID_INFO_CLASS: NTSTATUS = 0xC0000003; +pub const STATUS_INFO_LENGTH_MISMATCH: NTSTATUS = 0xC0000004; +pub const STATUS_ACCESS_VIOLATION: NTSTATUS = 0xC0000005; +pub const STATUS_IN_PAGE_ERROR: NTSTATUS = 0xC0000006; +pub const STATUS_PAGEFILE_QUOTA: NTSTATUS = 0xC0000007; +pub const STATUS_INVALID_HANDLE: NTSTATUS = 0xC0000008; +pub const STATUS_BAD_INITIAL_STACK: NTSTATUS = 0xC0000009; +pub const STATUS_BAD_INITIAL_PC: NTSTATUS = 0xC000000A; +pub const STATUS_INVALID_CID: NTSTATUS = 0xC000000B; +pub const STATUS_TIMER_NOT_CANCELED: NTSTATUS = 0xC000000C; +pub const STATUS_INVALID_PARAMETER: NTSTATUS = 0xC000000D; +pub const STATUS_NO_SUCH_DEVICE: NTSTATUS = 0xC000000E; +pub const STATUS_NO_SUCH_FILE: NTSTATUS = 0xC000000F; +pub const STATUS_INVALID_DEVICE_REQUEST: NTSTATUS = 0xC0000010; +pub const STATUS_END_OF_FILE: NTSTATUS = 0xC0000011; +pub const STATUS_WRONG_VOLUME: NTSTATUS = 0xC0000012; +pub const STATUS_NO_MEDIA_IN_DEVICE: NTSTATUS = 0xC0000013; +pub const STATUS_UNRECOGNIZED_MEDIA: NTSTATUS = 0xC0000014; +pub const STATUS_NONEXISTENT_SECTOR: NTSTATUS = 0xC0000015; +pub const STATUS_MORE_PROCESSING_REQUIRED: NTSTATUS = 0xC0000016; +pub const STATUS_NO_MEMORY: NTSTATUS = 0xC0000017; +pub const STATUS_CONFLICTING_ADDRESSES: NTSTATUS = 0xC0000018; +pub const STATUS_NOT_MAPPED_VIEW: NTSTATUS = 0xC0000019; +pub const STATUS_UNABLE_TO_FREE_VM: NTSTATUS = 0xC000001A; +pub const STATUS_UNABLE_TO_DELETE_SECTION: NTSTATUS = 0xC000001B; +pub const STATUS_INVALID_SYSTEM_SERVICE: NTSTATUS = 0xC000001C; +pub const STATUS_ILLEGAL_INSTRUCTION: NTSTATUS = 0xC000001D; +pub const STATUS_INVALID_LOCK_SEQUENCE: NTSTATUS = 0xC000001E; +pub const STATUS_INVALID_VIEW_SIZE: NTSTATUS = 0xC000001F; +pub const STATUS_INVALID_FILE_FOR_SECTION: NTSTATUS = 0xC0000020; +pub const STATUS_ALREADY_COMMITTED: NTSTATUS = 0xC0000021; +pub const STATUS_ACCESS_DENIED: NTSTATUS = 0xC0000022; +pub const STATUS_BUFFER_TOO_SMALL: NTSTATUS = 0xC0000023; +pub const STATUS_OBJECT_TYPE_MISMATCH: NTSTATUS = 0xC0000024; +pub const STATUS_NONCONTINUABLE_EXCEPTION: NTSTATUS = 0xC0000025; +pub const STATUS_INVALID_DISPOSITION: NTSTATUS = 0xC0000026; +pub const STATUS_UNWIND: NTSTATUS = 0xC0000027; +pub const STATUS_BAD_STACK: NTSTATUS = 0xC0000028; +pub const STATUS_INVALID_UNWIND_TARGET: NTSTATUS = 0xC0000029; +pub const STATUS_NOT_LOCKED: NTSTATUS = 0xC000002A; +pub const STATUS_PARITY_ERROR: NTSTATUS = 0xC000002B; +pub const STATUS_UNABLE_TO_DECOMMIT_VM: NTSTATUS = 0xC000002C; +pub const STATUS_NOT_COMMITTED: NTSTATUS = 0xC000002D; +pub const STATUS_INVALID_PORT_ATTRIBUTES: NTSTATUS = 0xC000002E; +pub const STATUS_PORT_MESSAGE_TOO_LONG: NTSTATUS = 0xC000002F; +pub const STATUS_INVALID_PARAMETER_MIX: NTSTATUS = 0xC0000030; +pub const STATUS_INVALID_QUOTA_LOWER: NTSTATUS = 0xC0000031; +pub const STATUS_DISK_CORRUPT_ERROR: NTSTATUS = 0xC0000032; +pub const STATUS_OBJECT_NAME_INVALID: NTSTATUS = 0xC0000033; +pub const STATUS_OBJECT_NAME_NOT_FOUND: NTSTATUS = 0xC0000034; +pub const STATUS_OBJECT_NAME_COLLISION: NTSTATUS = 0xC0000035; +pub const STATUS_PORT_DO_NOT_DISTURB: NTSTATUS = 0xC0000036; +pub const STATUS_PORT_DISCONNECTED: NTSTATUS = 0xC0000037; +pub const STATUS_DEVICE_ALREADY_ATTACHED: NTSTATUS = 0xC0000038; +pub const STATUS_OBJECT_PATH_INVALID: NTSTATUS = 0xC0000039; +pub const STATUS_OBJECT_PATH_NOT_FOUND: NTSTATUS = 0xC000003A; +pub const STATUS_OBJECT_PATH_SYNTAX_BAD: NTSTATUS = 0xC000003B; +pub const STATUS_DATA_OVERRUN: NTSTATUS = 0xC000003C; +pub const STATUS_DATA_LATE_ERROR: NTSTATUS = 0xC000003D; +pub const STATUS_DATA_ERROR: NTSTATUS = 0xC000003E; +pub const STATUS_CRC_ERROR: NTSTATUS = 0xC000003F; +pub const STATUS_SECTION_TOO_BIG: NTSTATUS = 0xC0000040; +pub const STATUS_PORT_CONNECTION_REFUSED: NTSTATUS = 0xC0000041; +pub const STATUS_INVALID_PORT_HANDLE: NTSTATUS = 0xC0000042; +pub const STATUS_SHARING_VIOLATION: NTSTATUS = 0xC0000043; +pub const STATUS_QUOTA_EXCEEDED: NTSTATUS = 0xC0000044; +pub const STATUS_INVALID_PAGE_PROTECTION: NTSTATUS = 0xC0000045; +pub const STATUS_MUTANT_NOT_OWNED: NTSTATUS = 0xC0000046; +pub const STATUS_SEMAPHORE_LIMIT_EXCEEDED: NTSTATUS = 0xC0000047; +pub const STATUS_PORT_ALREADY_SET: NTSTATUS = 0xC0000048; +pub const STATUS_SECTION_NOT_IMAGE: NTSTATUS = 0xC0000049; +pub const STATUS_SUSPEND_COUNT_EXCEEDED: NTSTATUS = 0xC000004A; +pub const STATUS_THREAD_IS_TERMINATING: NTSTATUS = 0xC000004B; +pub const STATUS_BAD_WORKING_SET_LIMIT: NTSTATUS = 0xC000004C; +pub const STATUS_INCOMPATIBLE_FILE_MAP: NTSTATUS = 0xC000004D; +pub const STATUS_SECTION_PROTECTION: NTSTATUS = 0xC000004E; +pub const STATUS_EAS_NOT_SUPPORTED: NTSTATUS = 0xC000004F; +pub const STATUS_EA_TOO_LARGE: NTSTATUS = 0xC0000050; +pub const STATUS_NONEXISTENT_EA_ENTRY: NTSTATUS = 0xC0000051; +pub const STATUS_NO_EAS_ON_FILE: NTSTATUS = 0xC0000052; +pub const STATUS_EA_CORRUPT_ERROR: NTSTATUS = 0xC0000053; +pub const STATUS_FILE_LOCK_CONFLICT: NTSTATUS = 0xC0000054; +pub const STATUS_LOCK_NOT_GRANTED: NTSTATUS = 0xC0000055; +pub const STATUS_DELETE_PENDING: NTSTATUS = 0xC0000056; +pub const STATUS_CTL_FILE_NOT_SUPPORTED: NTSTATUS = 0xC0000057; +pub const STATUS_UNKNOWN_REVISION: NTSTATUS = 0xC0000058; +pub const STATUS_REVISION_MISMATCH: NTSTATUS = 0xC0000059; +pub const STATUS_INVALID_OWNER: NTSTATUS = 0xC000005A; +pub const STATUS_INVALID_PRIMARY_GROUP: NTSTATUS = 0xC000005B; +pub const STATUS_NO_IMPERSONATION_TOKEN: NTSTATUS = 0xC000005C; +pub const STATUS_CANT_DISABLE_MANDATORY: NTSTATUS = 0xC000005D; +pub const STATUS_NO_LOGON_SERVERS: NTSTATUS = 0xC000005E; +pub const STATUS_NO_SUCH_LOGON_SESSION: NTSTATUS = 0xC000005F; +pub const STATUS_NO_SUCH_PRIVILEGE: NTSTATUS = 0xC0000060; +pub const STATUS_PRIVILEGE_NOT_HELD: NTSTATUS = 0xC0000061; +pub const STATUS_INVALID_ACCOUNT_NAME: NTSTATUS = 0xC0000062; +pub const STATUS_USER_EXISTS: NTSTATUS = 0xC0000063; +pub const STATUS_NO_SUCH_USER: NTSTATUS = 0xC0000064; +pub const STATUS_GROUP_EXISTS: NTSTATUS = 0xC0000065; +pub const STATUS_NO_SUCH_GROUP: NTSTATUS = 0xC0000066; +pub const STATUS_MEMBER_IN_GROUP: NTSTATUS = 0xC0000067; +pub const STATUS_MEMBER_NOT_IN_GROUP: NTSTATUS = 0xC0000068; +pub const STATUS_LAST_ADMIN: NTSTATUS = 0xC0000069; +pub const STATUS_WRONG_PASSWORD: NTSTATUS = 0xC000006A; +pub const STATUS_ILL_FORMED_PASSWORD: NTSTATUS = 0xC000006B; +pub const STATUS_PASSWORD_RESTRICTION: NTSTATUS = 0xC000006C; +pub const STATUS_LOGON_FAILURE: NTSTATUS = 0xC000006D; +pub const STATUS_ACCOUNT_RESTRICTION: NTSTATUS = 0xC000006E; +pub const STATUS_INVALID_LOGON_HOURS: NTSTATUS = 0xC000006F; +pub const STATUS_INVALID_WORKSTATION: NTSTATUS = 0xC0000070; +pub const STATUS_PASSWORD_EXPIRED: NTSTATUS = 0xC0000071; +pub const STATUS_ACCOUNT_DISABLED: NTSTATUS = 0xC0000072; +pub const STATUS_NONE_MAPPED: NTSTATUS = 0xC0000073; +pub const STATUS_TOO_MANY_LUIDS_REQUESTED: NTSTATUS = 0xC0000074; +pub const STATUS_LUIDS_EXHAUSTED: NTSTATUS = 0xC0000075; +pub const STATUS_INVALID_SUB_AUTHORITY: NTSTATUS = 0xC0000076; +pub const STATUS_INVALID_ACL: NTSTATUS = 0xC0000077; +pub const STATUS_INVALID_SID: NTSTATUS = 0xC0000078; +pub const STATUS_INVALID_SECURITY_DESCR: NTSTATUS = 0xC0000079; +pub const STATUS_PROCEDURE_NOT_FOUND: NTSTATUS = 0xC000007A; +pub const STATUS_INVALID_IMAGE_FORMAT: NTSTATUS = 0xC000007B; +pub const STATUS_NO_TOKEN: NTSTATUS = 0xC000007C; +pub const STATUS_BAD_INHERITANCE_ACL: NTSTATUS = 0xC000007D; +pub const STATUS_RANGE_NOT_LOCKED: NTSTATUS = 0xC000007E; +pub const STATUS_DISK_FULL: NTSTATUS = 0xC000007F; +pub const STATUS_SERVER_DISABLED: NTSTATUS = 0xC0000080; +pub const STATUS_SERVER_NOT_DISABLED: NTSTATUS = 0xC0000081; +pub const STATUS_TOO_MANY_GUIDS_REQUESTED: NTSTATUS = 0xC0000082; +pub const STATUS_GUIDS_EXHAUSTED: NTSTATUS = 0xC0000083; +pub const STATUS_INVALID_ID_AUTHORITY: NTSTATUS = 0xC0000084; +pub const STATUS_AGENTS_EXHAUSTED: NTSTATUS = 0xC0000085; +pub const STATUS_INVALID_VOLUME_LABEL: NTSTATUS = 0xC0000086; +pub const STATUS_SECTION_NOT_EXTENDED: NTSTATUS = 0xC0000087; +pub const STATUS_NOT_MAPPED_DATA: NTSTATUS = 0xC0000088; +pub const STATUS_RESOURCE_DATA_NOT_FOUND: NTSTATUS = 0xC0000089; +pub const STATUS_RESOURCE_TYPE_NOT_FOUND: NTSTATUS = 0xC000008A; +pub const STATUS_RESOURCE_NAME_NOT_FOUND: NTSTATUS = 0xC000008B; +pub const STATUS_ARRAY_BOUNDS_EXCEEDED: NTSTATUS = 0xC000008C; +pub const STATUS_FLOAT_DENORMAL_OPERAND: NTSTATUS = 0xC000008D; +pub const STATUS_FLOAT_DIVIDE_BY_ZERO: NTSTATUS = 0xC000008E; +pub const STATUS_FLOAT_INEXACT_RESULT: NTSTATUS = 0xC000008F; +pub const STATUS_FLOAT_INVALID_OPERATION: NTSTATUS = 0xC0000090; +pub const STATUS_FLOAT_OVERFLOW: NTSTATUS = 0xC0000091; +pub const STATUS_FLOAT_STACK_CHECK: NTSTATUS = 0xC0000092; +pub const STATUS_FLOAT_UNDERFLOW: NTSTATUS = 0xC0000093; +pub const STATUS_INTEGER_DIVIDE_BY_ZERO: NTSTATUS = 0xC0000094; +pub const STATUS_INTEGER_OVERFLOW: NTSTATUS = 0xC0000095; +pub const STATUS_PRIVILEGED_INSTRUCTION: NTSTATUS = 0xC0000096; +pub const STATUS_TOO_MANY_PAGING_FILES: NTSTATUS = 0xC0000097; +pub const STATUS_FILE_INVALID: NTSTATUS = 0xC0000098; +pub const STATUS_ALLOTTED_SPACE_EXCEEDED: NTSTATUS = 0xC0000099; +pub const STATUS_INSUFFICIENT_RESOURCES: NTSTATUS = 0xC000009A; +pub const STATUS_DFS_EXIT_PATH_FOUND: NTSTATUS = 0xC000009B; +pub const STATUS_DEVICE_DATA_ERROR: NTSTATUS = 0xC000009C; +pub const STATUS_DEVICE_NOT_CONNECTED: NTSTATUS = 0xC000009D; +pub const STATUS_DEVICE_POWER_FAILURE: NTSTATUS = 0xC000009E; +pub const STATUS_FREE_VM_NOT_AT_BASE: NTSTATUS = 0xC000009F; +pub const STATUS_MEMORY_NOT_ALLOCATED: NTSTATUS = 0xC00000A0; +pub const STATUS_WORKING_SET_QUOTA: NTSTATUS = 0xC00000A1; +pub const STATUS_MEDIA_WRITE_PROTECTED: NTSTATUS = 0xC00000A2; +pub const STATUS_DEVICE_NOT_READY: NTSTATUS = 0xC00000A3; +pub const STATUS_INVALID_GROUP_ATTRIBUTES: NTSTATUS = 0xC00000A4; +pub const STATUS_BAD_IMPERSONATION_LEVEL: NTSTATUS = 0xC00000A5; +pub const STATUS_CANT_OPEN_ANONYMOUS: NTSTATUS = 0xC00000A6; +pub const STATUS_BAD_VALIDATION_CLASS: NTSTATUS = 0xC00000A7; +pub const STATUS_BAD_TOKEN_TYPE: NTSTATUS = 0xC00000A8; +pub const STATUS_BAD_MASTER_BOOT_RECORD: NTSTATUS = 0xC00000A9; +pub const STATUS_INSTRUCTION_MISALIGNMENT: NTSTATUS = 0xC00000AA; +pub const STATUS_INSTANCE_NOT_AVAILABLE: NTSTATUS = 0xC00000AB; +pub const STATUS_PIPE_NOT_AVAILABLE: NTSTATUS = 0xC00000AC; +pub const STATUS_INVALID_PIPE_STATE: NTSTATUS = 0xC00000AD; +pub const STATUS_PIPE_BUSY: NTSTATUS = 0xC00000AE; +pub const STATUS_ILLEGAL_FUNCTION: NTSTATUS = 0xC00000AF; +pub const STATUS_PIPE_DISCONNECTED: NTSTATUS = 0xC00000B0; +pub const STATUS_PIPE_CLOSING: NTSTATUS = 0xC00000B1; +pub const STATUS_PIPE_CONNECTED: NTSTATUS = 0xC00000B2; +pub const STATUS_PIPE_LISTENING: NTSTATUS = 0xC00000B3; +pub const STATUS_INVALID_READ_MODE: NTSTATUS = 0xC00000B4; +pub const STATUS_IO_TIMEOUT: NTSTATUS = 0xC00000B5; +pub const STATUS_FILE_FORCED_CLOSED: NTSTATUS = 0xC00000B6; +pub const STATUS_PROFILING_NOT_STARTED: NTSTATUS = 0xC00000B7; +pub const STATUS_PROFILING_NOT_STOPPED: NTSTATUS = 0xC00000B8; +pub const STATUS_COULD_NOT_INTERPRET: NTSTATUS = 0xC00000B9; +pub const STATUS_FILE_IS_A_DIRECTORY: NTSTATUS = 0xC00000BA; +pub const STATUS_NOT_SUPPORTED: NTSTATUS = 0xC00000BB; +pub const STATUS_REMOTE_NOT_LISTENING: NTSTATUS = 0xC00000BC; +pub const STATUS_DUPLICATE_NAME: NTSTATUS = 0xC00000BD; +pub const STATUS_BAD_NETWORK_PATH: NTSTATUS = 0xC00000BE; +pub const STATUS_NETWORK_BUSY: NTSTATUS = 0xC00000BF; +pub const STATUS_DEVICE_DOES_NOT_EXIST: NTSTATUS = 0xC00000C0; +pub const STATUS_TOO_MANY_COMMANDS: NTSTATUS = 0xC00000C1; +pub const STATUS_ADAPTER_HARDWARE_ERROR: NTSTATUS = 0xC00000C2; +pub const STATUS_INVALID_NETWORK_RESPONSE: NTSTATUS = 0xC00000C3; +pub const STATUS_UNEXPECTED_NETWORK_ERROR: NTSTATUS = 0xC00000C4; +pub const STATUS_BAD_REMOTE_ADAPTER: NTSTATUS = 0xC00000C5; +pub const STATUS_PRINT_QUEUE_FULL: NTSTATUS = 0xC00000C6; +pub const STATUS_NO_SPOOL_SPACE: NTSTATUS = 0xC00000C7; +pub const STATUS_PRINT_CANCELLED: NTSTATUS = 0xC00000C8; +pub const STATUS_NETWORK_NAME_DELETED: NTSTATUS = 0xC00000C9; +pub const STATUS_NETWORK_ACCESS_DENIED: NTSTATUS = 0xC00000CA; +pub const STATUS_BAD_DEVICE_TYPE: NTSTATUS = 0xC00000CB; +pub const STATUS_BAD_NETWORK_NAME: NTSTATUS = 0xC00000CC; +pub const STATUS_TOO_MANY_NAMES: NTSTATUS = 0xC00000CD; +pub const STATUS_TOO_MANY_SESSIONS: NTSTATUS = 0xC00000CE; +pub const STATUS_SHARING_PAUSED: NTSTATUS = 0xC00000CF; +pub const STATUS_REQUEST_NOT_ACCEPTED: NTSTATUS = 0xC00000D0; +pub const STATUS_REDIRECTOR_PAUSED: NTSTATUS = 0xC00000D1; +pub const STATUS_NET_WRITE_FAULT: NTSTATUS = 0xC00000D2; +pub const STATUS_PROFILING_AT_LIMIT: NTSTATUS = 0xC00000D3; +pub const STATUS_NOT_SAME_DEVICE: NTSTATUS = 0xC00000D4; +pub const STATUS_FILE_RENAMED: NTSTATUS = 0xC00000D5; +pub const STATUS_VIRTUAL_CIRCUIT_CLOSED: NTSTATUS = 0xC00000D6; +pub const STATUS_NO_SECURITY_ON_OBJECT: NTSTATUS = 0xC00000D7; +pub const STATUS_CANT_WAIT: NTSTATUS = 0xC00000D8; +pub const STATUS_PIPE_EMPTY: NTSTATUS = 0xC00000D9; +pub const STATUS_CANT_ACCESS_DOMAIN_INFO: NTSTATUS = 0xC00000DA; +pub const STATUS_CANT_TERMINATE_SELF: NTSTATUS = 0xC00000DB; +pub const STATUS_INVALID_SERVER_STATE: NTSTATUS = 0xC00000DC; +pub const STATUS_INVALID_DOMAIN_STATE: NTSTATUS = 0xC00000DD; +pub const STATUS_INVALID_DOMAIN_ROLE: NTSTATUS = 0xC00000DE; +pub const STATUS_NO_SUCH_DOMAIN: NTSTATUS = 0xC00000DF; +pub const STATUS_DOMAIN_EXISTS: NTSTATUS = 0xC00000E0; +pub const STATUS_DOMAIN_LIMIT_EXCEEDED: NTSTATUS = 0xC00000E1; +pub const STATUS_OPLOCK_NOT_GRANTED: NTSTATUS = 0xC00000E2; +pub const STATUS_INVALID_OPLOCK_PROTOCOL: NTSTATUS = 0xC00000E3; +pub const STATUS_INTERNAL_DB_CORRUPTION: NTSTATUS = 0xC00000E4; +pub const STATUS_INTERNAL_ERROR: NTSTATUS = 0xC00000E5; +pub const STATUS_GENERIC_NOT_MAPPED: NTSTATUS = 0xC00000E6; +pub const STATUS_BAD_DESCRIPTOR_FORMAT: NTSTATUS = 0xC00000E7; +pub const STATUS_INVALID_USER_BUFFER: NTSTATUS = 0xC00000E8; +pub const STATUS_UNEXPECTED_IO_ERROR: NTSTATUS = 0xC00000E9; +pub const STATUS_UNEXPECTED_MM_CREATE_ERR: NTSTATUS = 0xC00000EA; +pub const STATUS_UNEXPECTED_MM_MAP_ERROR: NTSTATUS = 0xC00000EB; +pub const STATUS_UNEXPECTED_MM_EXTEND_ERR: NTSTATUS = 0xC00000EC; +pub const STATUS_NOT_LOGON_PROCESS: NTSTATUS = 0xC00000ED; +pub const STATUS_LOGON_SESSION_EXISTS: NTSTATUS = 0xC00000EE; +pub const STATUS_INVALID_PARAMETER_1: NTSTATUS = 0xC00000EF; +pub const STATUS_INVALID_PARAMETER_2: NTSTATUS = 0xC00000F0; +pub const STATUS_INVALID_PARAMETER_3: NTSTATUS = 0xC00000F1; +pub const STATUS_INVALID_PARAMETER_4: NTSTATUS = 0xC00000F2; +pub const STATUS_INVALID_PARAMETER_5: NTSTATUS = 0xC00000F3; +pub const STATUS_INVALID_PARAMETER_6: NTSTATUS = 0xC00000F4; +pub const STATUS_INVALID_PARAMETER_7: NTSTATUS = 0xC00000F5; +pub const STATUS_INVALID_PARAMETER_8: NTSTATUS = 0xC00000F6; +pub const STATUS_INVALID_PARAMETER_9: NTSTATUS = 0xC00000F7; +pub const STATUS_INVALID_PARAMETER_10: NTSTATUS = 0xC00000F8; +pub const STATUS_INVALID_PARAMETER_11: NTSTATUS = 0xC00000F9; +pub const STATUS_INVALID_PARAMETER_12: NTSTATUS = 0xC00000FA; +pub const STATUS_REDIRECTOR_NOT_STARTED: NTSTATUS = 0xC00000FB; +pub const STATUS_REDIRECTOR_STARTED: NTSTATUS = 0xC00000FC; +pub const STATUS_STACK_OVERFLOW: NTSTATUS = 0xC00000FD; +pub const STATUS_NO_SUCH_PACKAGE: NTSTATUS = 0xC00000FE; +pub const STATUS_BAD_FUNCTION_TABLE: NTSTATUS = 0xC00000FF; +pub const STATUS_VARIABLE_NOT_FOUND: NTSTATUS = 0xC0000100; +pub const STATUS_DIRECTORY_NOT_EMPTY: NTSTATUS = 0xC0000101; +pub const STATUS_FILE_CORRUPT_ERROR: NTSTATUS = 0xC0000102; +pub const STATUS_NOT_A_DIRECTORY: NTSTATUS = 0xC0000103; +pub const STATUS_BAD_LOGON_SESSION_STATE: NTSTATUS = 0xC0000104; +pub const STATUS_LOGON_SESSION_COLLISION: NTSTATUS = 0xC0000105; +pub const STATUS_NAME_TOO_LONG: NTSTATUS = 0xC0000106; +pub const STATUS_FILES_OPEN: NTSTATUS = 0xC0000107; +pub const STATUS_CONNECTION_IN_USE: NTSTATUS = 0xC0000108; +pub const STATUS_MESSAGE_NOT_FOUND: NTSTATUS = 0xC0000109; +pub const STATUS_PROCESS_IS_TERMINATING: NTSTATUS = 0xC000010A; +pub const STATUS_INVALID_LOGON_TYPE: NTSTATUS = 0xC000010B; +pub const STATUS_NO_GUID_TRANSLATION: NTSTATUS = 0xC000010C; +pub const STATUS_CANNOT_IMPERSONATE: NTSTATUS = 0xC000010D; +pub const STATUS_IMAGE_ALREADY_LOADED: NTSTATUS = 0xC000010E; +pub const STATUS_ABIOS_NOT_PRESENT: NTSTATUS = 0xC000010F; +pub const STATUS_ABIOS_LID_NOT_EXIST: NTSTATUS = 0xC0000110; +pub const STATUS_ABIOS_LID_ALREADY_OWNED: NTSTATUS = 0xC0000111; +pub const STATUS_ABIOS_NOT_LID_OWNER: NTSTATUS = 0xC0000112; +pub const STATUS_ABIOS_INVALID_COMMAND: NTSTATUS = 0xC0000113; +pub const STATUS_ABIOS_INVALID_LID: NTSTATUS = 0xC0000114; +pub const STATUS_ABIOS_SELECTOR_NOT_AVAILABLE: NTSTATUS = 0xC0000115; +pub const STATUS_ABIOS_INVALID_SELECTOR: NTSTATUS = 0xC0000116; +pub const STATUS_NO_LDT: NTSTATUS = 0xC0000117; +pub const STATUS_INVALID_LDT_SIZE: NTSTATUS = 0xC0000118; +pub const STATUS_INVALID_LDT_OFFSET: NTSTATUS = 0xC0000119; +pub const STATUS_INVALID_LDT_DESCRIPTOR: NTSTATUS = 0xC000011A; +pub const STATUS_INVALID_IMAGE_NE_FORMAT: NTSTATUS = 0xC000011B; +pub const STATUS_RXACT_INVALID_STATE: NTSTATUS = 0xC000011C; +pub const STATUS_RXACT_COMMIT_FAILURE: NTSTATUS = 0xC000011D; +pub const STATUS_MAPPED_FILE_SIZE_ZERO: NTSTATUS = 0xC000011E; +pub const STATUS_TOO_MANY_OPENED_FILES: NTSTATUS = 0xC000011F; +pub const STATUS_CANCELLED: NTSTATUS = 0xC0000120; +pub const STATUS_CANNOT_DELETE: NTSTATUS = 0xC0000121; +pub const STATUS_INVALID_COMPUTER_NAME: NTSTATUS = 0xC0000122; +pub const STATUS_FILE_DELETED: NTSTATUS = 0xC0000123; +pub const STATUS_SPECIAL_ACCOUNT: NTSTATUS = 0xC0000124; +pub const STATUS_SPECIAL_GROUP: NTSTATUS = 0xC0000125; +pub const STATUS_SPECIAL_USER: NTSTATUS = 0xC0000126; +pub const STATUS_MEMBERS_PRIMARY_GROUP: NTSTATUS = 0xC0000127; +pub const STATUS_FILE_CLOSED: NTSTATUS = 0xC0000128; +pub const STATUS_TOO_MANY_THREADS: NTSTATUS = 0xC0000129; +pub const STATUS_THREAD_NOT_IN_PROCESS: NTSTATUS = 0xC000012A; +pub const STATUS_TOKEN_ALREADY_IN_USE: NTSTATUS = 0xC000012B; +pub const STATUS_PAGEFILE_QUOTA_EXCEEDED: NTSTATUS = 0xC000012C; +pub const STATUS_COMMITMENT_LIMIT: NTSTATUS = 0xC000012D; +pub const STATUS_INVALID_IMAGE_LE_FORMAT: NTSTATUS = 0xC000012E; +pub const STATUS_INVALID_IMAGE_NOT_MZ: NTSTATUS = 0xC000012F; +pub const STATUS_INVALID_IMAGE_PROTECT: NTSTATUS = 0xC0000130; +pub const STATUS_INVALID_IMAGE_WIN_16: NTSTATUS = 0xC0000131; +pub const STATUS_LOGON_SERVER_CONFLICT: NTSTATUS = 0xC0000132; +pub const STATUS_TIME_DIFFERENCE_AT_DC: NTSTATUS = 0xC0000133; +pub const STATUS_SYNCHRONIZATION_REQUIRED: NTSTATUS = 0xC0000134; +pub const STATUS_DLL_NOT_FOUND: NTSTATUS = 0xC0000135; +pub const STATUS_OPEN_FAILED: NTSTATUS = 0xC0000136; +pub const STATUS_IO_PRIVILEGE_FAILED: NTSTATUS = 0xC0000137; +pub const STATUS_ORDINAL_NOT_FOUND: NTSTATUS = 0xC0000138; +pub const STATUS_ENTRYPOINT_NOT_FOUND: NTSTATUS = 0xC0000139; +pub const STATUS_CONTROL_C_EXIT: NTSTATUS = 0xC000013A; +pub const STATUS_LOCAL_DISCONNECT: NTSTATUS = 0xC000013B; +pub const STATUS_REMOTE_DISCONNECT: NTSTATUS = 0xC000013C; +pub const STATUS_REMOTE_RESOURCES: NTSTATUS = 0xC000013D; +pub const STATUS_LINK_FAILED: NTSTATUS = 0xC000013E; +pub const STATUS_LINK_TIMEOUT: NTSTATUS = 0xC000013F; +pub const STATUS_INVALID_CONNECTION: NTSTATUS = 0xC0000140; +pub const STATUS_INVALID_ADDRESS: NTSTATUS = 0xC0000141; +pub const STATUS_DLL_INIT_FAILED: NTSTATUS = 0xC0000142; +pub const STATUS_MISSING_SYSTEMFILE: NTSTATUS = 0xC0000143; +pub const STATUS_UNHANDLED_EXCEPTION: NTSTATUS = 0xC0000144; +pub const STATUS_APP_INIT_FAILURE: NTSTATUS = 0xC0000145; +pub const STATUS_PAGEFILE_CREATE_FAILED: NTSTATUS = 0xC0000146; +pub const STATUS_NO_PAGEFILE: NTSTATUS = 0xC0000147; +pub const STATUS_INVALID_LEVEL: NTSTATUS = 0xC0000148; +pub const STATUS_WRONG_PASSWORD_CORE: NTSTATUS = 0xC0000149; +pub const STATUS_ILLEGAL_FLOAT_CONTEXT: NTSTATUS = 0xC000014A; +pub const STATUS_PIPE_BROKEN: NTSTATUS = 0xC000014B; +pub const STATUS_REGISTRY_CORRUPT: NTSTATUS = 0xC000014C; +pub const STATUS_REGISTRY_IO_FAILED: NTSTATUS = 0xC000014D; +pub const STATUS_NO_EVENT_PAIR: NTSTATUS = 0xC000014E; +pub const STATUS_UNRECOGNIZED_VOLUME: NTSTATUS = 0xC000014F; +pub const STATUS_SERIAL_NO_DEVICE_INITED: NTSTATUS = 0xC0000150; +pub const STATUS_NO_SUCH_ALIAS: NTSTATUS = 0xC0000151; +pub const STATUS_MEMBER_NOT_IN_ALIAS: NTSTATUS = 0xC0000152; +pub const STATUS_MEMBER_IN_ALIAS: NTSTATUS = 0xC0000153; +pub const STATUS_ALIAS_EXISTS: NTSTATUS = 0xC0000154; +pub const STATUS_LOGON_NOT_GRANTED: NTSTATUS = 0xC0000155; +pub const STATUS_TOO_MANY_SECRETS: NTSTATUS = 0xC0000156; +pub const STATUS_SECRET_TOO_LONG: NTSTATUS = 0xC0000157; +pub const STATUS_INTERNAL_DB_ERROR: NTSTATUS = 0xC0000158; +pub const STATUS_FULLSCREEN_MODE: NTSTATUS = 0xC0000159; +pub const STATUS_TOO_MANY_CONTEXT_IDS: NTSTATUS = 0xC000015A; +pub const STATUS_LOGON_TYPE_NOT_GRANTED: NTSTATUS = 0xC000015B; +pub const STATUS_NOT_REGISTRY_FILE: NTSTATUS = 0xC000015C; +pub const STATUS_NT_CROSS_ENCRYPTION_REQUIRED: NTSTATUS = 0xC000015D; +pub const STATUS_DOMAIN_CTRLR_CONFIG_ERROR: NTSTATUS = 0xC000015E; +pub const STATUS_FT_MISSING_MEMBER: NTSTATUS = 0xC000015F; +pub const STATUS_ILL_FORMED_SERVICE_ENTRY: NTSTATUS = 0xC0000160; +pub const STATUS_ILLEGAL_CHARACTER: NTSTATUS = 0xC0000161; +pub const STATUS_UNMAPPABLE_CHARACTER: NTSTATUS = 0xC0000162; +pub const STATUS_UNDEFINED_CHARACTER: NTSTATUS = 0xC0000163; +pub const STATUS_FLOPPY_VOLUME: NTSTATUS = 0xC0000164; +pub const STATUS_FLOPPY_ID_MARK_NOT_FOUND: NTSTATUS = 0xC0000165; +pub const STATUS_FLOPPY_WRONG_CYLINDER: NTSTATUS = 0xC0000166; +pub const STATUS_FLOPPY_UNKNOWN_ERROR: NTSTATUS = 0xC0000167; +pub const STATUS_FLOPPY_BAD_REGISTERS: NTSTATUS = 0xC0000168; +pub const STATUS_DISK_RECALIBRATE_FAILED: NTSTATUS = 0xC0000169; +pub const STATUS_DISK_OPERATION_FAILED: NTSTATUS = 0xC000016A; +pub const STATUS_DISK_RESET_FAILED: NTSTATUS = 0xC000016B; +pub const STATUS_SHARED_IRQ_BUSY: NTSTATUS = 0xC000016C; +pub const STATUS_FT_ORPHANING: NTSTATUS = 0xC000016D; +pub const STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT: NTSTATUS = 0xC000016E; +pub const STATUS_PARTITION_FAILURE: NTSTATUS = 0xC0000172; +pub const STATUS_INVALID_BLOCK_LENGTH: NTSTATUS = 0xC0000173; +pub const STATUS_DEVICE_NOT_PARTITIONED: NTSTATUS = 0xC0000174; +pub const STATUS_UNABLE_TO_LOCK_MEDIA: NTSTATUS = 0xC0000175; +pub const STATUS_UNABLE_TO_UNLOAD_MEDIA: NTSTATUS = 0xC0000176; +pub const STATUS_EOM_OVERFLOW: NTSTATUS = 0xC0000177; +pub const STATUS_NO_MEDIA: NTSTATUS = 0xC0000178; +pub const STATUS_NO_SUCH_MEMBER: NTSTATUS = 0xC000017A; +pub const STATUS_INVALID_MEMBER: NTSTATUS = 0xC000017B; +pub const STATUS_KEY_DELETED: NTSTATUS = 0xC000017C; +pub const STATUS_NO_LOG_SPACE: NTSTATUS = 0xC000017D; +pub const STATUS_TOO_MANY_SIDS: NTSTATUS = 0xC000017E; +pub const STATUS_LM_CROSS_ENCRYPTION_REQUIRED: NTSTATUS = 0xC000017F; +pub const STATUS_KEY_HAS_CHILDREN: NTSTATUS = 0xC0000180; +pub const STATUS_CHILD_MUST_BE_VOLATILE: NTSTATUS = 0xC0000181; +pub const STATUS_DEVICE_CONFIGURATION_ERROR: NTSTATUS = 0xC0000182; +pub const STATUS_DRIVER_INTERNAL_ERROR: NTSTATUS = 0xC0000183; +pub const STATUS_INVALID_DEVICE_STATE: NTSTATUS = 0xC0000184; +pub const STATUS_IO_DEVICE_ERROR: NTSTATUS = 0xC0000185; +pub const STATUS_DEVICE_PROTOCOL_ERROR: NTSTATUS = 0xC0000186; +pub const STATUS_BACKUP_CONTROLLER: NTSTATUS = 0xC0000187; +pub const STATUS_LOG_FILE_FULL: NTSTATUS = 0xC0000188; +pub const STATUS_TOO_LATE: NTSTATUS = 0xC0000189; +pub const STATUS_NO_TRUST_LSA_SECRET: NTSTATUS = 0xC000018A; +pub const STATUS_NO_TRUST_SAM_ACCOUNT: NTSTATUS = 0xC000018B; +pub const STATUS_TRUSTED_DOMAIN_FAILURE: NTSTATUS = 0xC000018C; +pub const STATUS_TRUSTED_RELATIONSHIP_FAILURE: NTSTATUS = 0xC000018D; +pub const STATUS_EVENTLOG_FILE_CORRUPT: NTSTATUS = 0xC000018E; +pub const STATUS_EVENTLOG_CANT_START: NTSTATUS = 0xC000018F; +pub const STATUS_TRUST_FAILURE: NTSTATUS = 0xC0000190; +pub const STATUS_MUTANT_LIMIT_EXCEEDED: NTSTATUS = 0xC0000191; +pub const STATUS_NETLOGON_NOT_STARTED: NTSTATUS = 0xC0000192; +pub const STATUS_ACCOUNT_EXPIRED: NTSTATUS = 0xC0000193; +pub const STATUS_POSSIBLE_DEADLOCK: NTSTATUS = 0xC0000194; +pub const STATUS_NETWORK_CREDENTIAL_CONFLICT: NTSTATUS = 0xC0000195; +pub const STATUS_REMOTE_SESSION_LIMIT: NTSTATUS = 0xC0000196; +pub const STATUS_EVENTLOG_FILE_CHANGED: NTSTATUS = 0xC0000197; +pub const STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT: NTSTATUS = 0xC0000198; +pub const STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT: NTSTATUS = 0xC0000199; +pub const STATUS_NOLOGON_SERVER_TRUST_ACCOUNT: NTSTATUS = 0xC000019A; +pub const STATUS_DOMAIN_TRUST_INCONSISTENT: NTSTATUS = 0xC000019B; +pub const STATUS_FS_DRIVER_REQUIRED: NTSTATUS = 0xC000019C; +pub const STATUS_IMAGE_ALREADY_LOADED_AS_DLL: NTSTATUS = 0xC000019D; +pub const STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING: NTSTATUS + = 0xC000019E; +pub const STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME: NTSTATUS = 0xC000019F; +pub const STATUS_SECURITY_STREAM_IS_INCONSISTENT: NTSTATUS = 0xC00001A0; +pub const STATUS_INVALID_LOCK_RANGE: NTSTATUS = 0xC00001A1; +pub const STATUS_INVALID_ACE_CONDITION: NTSTATUS = 0xC00001A2; +pub const STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT: NTSTATUS = 0xC00001A3; +pub const STATUS_NOTIFICATION_GUID_ALREADY_DEFINED: NTSTATUS = 0xC00001A4; +pub const STATUS_INVALID_EXCEPTION_HANDLER: NTSTATUS = 0xC00001A5; +pub const STATUS_DUPLICATE_PRIVILEGES: NTSTATUS = 0xC00001A6; +pub const STATUS_NOT_ALLOWED_ON_SYSTEM_FILE: NTSTATUS = 0xC00001A7; +pub const STATUS_REPAIR_NEEDED: NTSTATUS = 0xC00001A8; +pub const STATUS_QUOTA_NOT_ENABLED: NTSTATUS = 0xC00001A9; +pub const STATUS_NO_APPLICATION_PACKAGE: NTSTATUS = 0xC00001AA; +pub const STATUS_FILE_METADATA_OPTIMIZATION_IN_PROGRESS: NTSTATUS = 0xC00001AB; +pub const STATUS_NOT_SAME_OBJECT: NTSTATUS = 0xC00001AC; +pub const STATUS_FATAL_MEMORY_EXHAUSTION: NTSTATUS = 0xC00001AD; +pub const STATUS_ERROR_PROCESS_NOT_IN_JOB: NTSTATUS = 0xC00001AE; +pub const STATUS_CPU_SET_INVALID: NTSTATUS = 0xC00001AF; +pub const STATUS_NETWORK_OPEN_RESTRICTION: NTSTATUS = 0xC0000201; +pub const STATUS_NO_USER_SESSION_KEY: NTSTATUS = 0xC0000202; +pub const STATUS_USER_SESSION_DELETED: NTSTATUS = 0xC0000203; +pub const STATUS_RESOURCE_LANG_NOT_FOUND: NTSTATUS = 0xC0000204; +pub const STATUS_INSUFF_SERVER_RESOURCES: NTSTATUS = 0xC0000205; +pub const STATUS_INVALID_BUFFER_SIZE: NTSTATUS = 0xC0000206; +pub const STATUS_INVALID_ADDRESS_COMPONENT: NTSTATUS = 0xC0000207; +pub const STATUS_INVALID_ADDRESS_WILDCARD: NTSTATUS = 0xC0000208; +pub const STATUS_TOO_MANY_ADDRESSES: NTSTATUS = 0xC0000209; +pub const STATUS_ADDRESS_ALREADY_EXISTS: NTSTATUS = 0xC000020A; +pub const STATUS_ADDRESS_CLOSED: NTSTATUS = 0xC000020B; +pub const STATUS_CONNECTION_DISCONNECTED: NTSTATUS = 0xC000020C; +pub const STATUS_CONNECTION_RESET: NTSTATUS = 0xC000020D; +pub const STATUS_TOO_MANY_NODES: NTSTATUS = 0xC000020E; +pub const STATUS_TRANSACTION_ABORTED: NTSTATUS = 0xC000020F; +pub const STATUS_TRANSACTION_TIMED_OUT: NTSTATUS = 0xC0000210; +pub const STATUS_TRANSACTION_NO_RELEASE: NTSTATUS = 0xC0000211; +pub const STATUS_TRANSACTION_NO_MATCH: NTSTATUS = 0xC0000212; +pub const STATUS_TRANSACTION_RESPONDED: NTSTATUS = 0xC0000213; +pub const STATUS_TRANSACTION_INVALID_ID: NTSTATUS = 0xC0000214; +pub const STATUS_TRANSACTION_INVALID_TYPE: NTSTATUS = 0xC0000215; +pub const STATUS_NOT_SERVER_SESSION: NTSTATUS = 0xC0000216; +pub const STATUS_NOT_CLIENT_SESSION: NTSTATUS = 0xC0000217; +pub const STATUS_CANNOT_LOAD_REGISTRY_FILE: NTSTATUS = 0xC0000218; +pub const STATUS_DEBUG_ATTACH_FAILED: NTSTATUS = 0xC0000219; +pub const STATUS_SYSTEM_PROCESS_TERMINATED: NTSTATUS = 0xC000021A; +pub const STATUS_DATA_NOT_ACCEPTED: NTSTATUS = 0xC000021B; +pub const STATUS_NO_BROWSER_SERVERS_FOUND: NTSTATUS = 0xC000021C; +pub const STATUS_VDM_HARD_ERROR: NTSTATUS = 0xC000021D; +pub const STATUS_DRIVER_CANCEL_TIMEOUT: NTSTATUS = 0xC000021E; +pub const STATUS_REPLY_MESSAGE_MISMATCH: NTSTATUS = 0xC000021F; +pub const STATUS_MAPPED_ALIGNMENT: NTSTATUS = 0xC0000220; +pub const STATUS_IMAGE_CHECKSUM_MISMATCH: NTSTATUS = 0xC0000221; +pub const STATUS_LOST_WRITEBEHIND_DATA: NTSTATUS = 0xC0000222; +pub const STATUS_CLIENT_SERVER_PARAMETERS_INVALID: NTSTATUS = 0xC0000223; +pub const STATUS_PASSWORD_MUST_CHANGE: NTSTATUS = 0xC0000224; +pub const STATUS_NOT_FOUND: NTSTATUS = 0xC0000225; +pub const STATUS_NOT_TINY_STREAM: NTSTATUS = 0xC0000226; +pub const STATUS_RECOVERY_FAILURE: NTSTATUS = 0xC0000227; +pub const STATUS_STACK_OVERFLOW_READ: NTSTATUS = 0xC0000228; +pub const STATUS_FAIL_CHECK: NTSTATUS = 0xC0000229; +pub const STATUS_DUPLICATE_OBJECTID: NTSTATUS = 0xC000022A; +pub const STATUS_OBJECTID_EXISTS: NTSTATUS = 0xC000022B; +pub const STATUS_CONVERT_TO_LARGE: NTSTATUS = 0xC000022C; +pub const STATUS_RETRY: NTSTATUS = 0xC000022D; +pub const STATUS_FOUND_OUT_OF_SCOPE: NTSTATUS = 0xC000022E; +pub const STATUS_ALLOCATE_BUCKET: NTSTATUS = 0xC000022F; +pub const STATUS_PROPSET_NOT_FOUND: NTSTATUS = 0xC0000230; +pub const STATUS_MARSHALL_OVERFLOW: NTSTATUS = 0xC0000231; +pub const STATUS_INVALID_VARIANT: NTSTATUS = 0xC0000232; +pub const STATUS_DOMAIN_CONTROLLER_NOT_FOUND: NTSTATUS = 0xC0000233; +pub const STATUS_ACCOUNT_LOCKED_OUT: NTSTATUS = 0xC0000234; +pub const STATUS_HANDLE_NOT_CLOSABLE: NTSTATUS = 0xC0000235; +pub const STATUS_CONNECTION_REFUSED: NTSTATUS = 0xC0000236; +pub const STATUS_GRACEFUL_DISCONNECT: NTSTATUS = 0xC0000237; +pub const STATUS_ADDRESS_ALREADY_ASSOCIATED: NTSTATUS = 0xC0000238; +pub const STATUS_ADDRESS_NOT_ASSOCIATED: NTSTATUS = 0xC0000239; +pub const STATUS_CONNECTION_INVALID: NTSTATUS = 0xC000023A; +pub const STATUS_CONNECTION_ACTIVE: NTSTATUS = 0xC000023B; +pub const STATUS_NETWORK_UNREACHABLE: NTSTATUS = 0xC000023C; +pub const STATUS_HOST_UNREACHABLE: NTSTATUS = 0xC000023D; +pub const STATUS_PROTOCOL_UNREACHABLE: NTSTATUS = 0xC000023E; +pub const STATUS_PORT_UNREACHABLE: NTSTATUS = 0xC000023F; +pub const STATUS_REQUEST_ABORTED: NTSTATUS = 0xC0000240; +pub const STATUS_CONNECTION_ABORTED: NTSTATUS = 0xC0000241; +pub const STATUS_BAD_COMPRESSION_BUFFER: NTSTATUS = 0xC0000242; +pub const STATUS_USER_MAPPED_FILE: NTSTATUS = 0xC0000243; +pub const STATUS_AUDIT_FAILED: NTSTATUS = 0xC0000244; +pub const STATUS_TIMER_RESOLUTION_NOT_SET: NTSTATUS = 0xC0000245; +pub const STATUS_CONNECTION_COUNT_LIMIT: NTSTATUS = 0xC0000246; +pub const STATUS_LOGIN_TIME_RESTRICTION: NTSTATUS = 0xC0000247; +pub const STATUS_LOGIN_WKSTA_RESTRICTION: NTSTATUS = 0xC0000248; +pub const STATUS_IMAGE_MP_UP_MISMATCH: NTSTATUS = 0xC0000249; +pub const STATUS_INSUFFICIENT_LOGON_INFO: NTSTATUS = 0xC0000250; +pub const STATUS_BAD_DLL_ENTRYPOINT: NTSTATUS = 0xC0000251; +pub const STATUS_BAD_SERVICE_ENTRYPOINT: NTSTATUS = 0xC0000252; +pub const STATUS_LPC_REPLY_LOST: NTSTATUS = 0xC0000253; +pub const STATUS_IP_ADDRESS_CONFLICT1: NTSTATUS = 0xC0000254; +pub const STATUS_IP_ADDRESS_CONFLICT2: NTSTATUS = 0xC0000255; +pub const STATUS_REGISTRY_QUOTA_LIMIT: NTSTATUS = 0xC0000256; +pub const STATUS_PATH_NOT_COVERED: NTSTATUS = 0xC0000257; +pub const STATUS_NO_CALLBACK_ACTIVE: NTSTATUS = 0xC0000258; +pub const STATUS_LICENSE_QUOTA_EXCEEDED: NTSTATUS = 0xC0000259; +pub const STATUS_PWD_TOO_SHORT: NTSTATUS = 0xC000025A; +pub const STATUS_PWD_TOO_RECENT: NTSTATUS = 0xC000025B; +pub const STATUS_PWD_HISTORY_CONFLICT: NTSTATUS = 0xC000025C; +pub const STATUS_PLUGPLAY_NO_DEVICE: NTSTATUS = 0xC000025E; +pub const STATUS_UNSUPPORTED_COMPRESSION: NTSTATUS = 0xC000025F; +pub const STATUS_INVALID_HW_PROFILE: NTSTATUS = 0xC0000260; +pub const STATUS_INVALID_PLUGPLAY_DEVICE_PATH: NTSTATUS = 0xC0000261; +pub const STATUS_DRIVER_ORDINAL_NOT_FOUND: NTSTATUS = 0xC0000262; +pub const STATUS_DRIVER_ENTRYPOINT_NOT_FOUND: NTSTATUS = 0xC0000263; +pub const STATUS_RESOURCE_NOT_OWNED: NTSTATUS = 0xC0000264; +pub const STATUS_TOO_MANY_LINKS: NTSTATUS = 0xC0000265; +pub const STATUS_QUOTA_LIST_INCONSISTENT: NTSTATUS = 0xC0000266; +pub const STATUS_FILE_IS_OFFLINE: NTSTATUS = 0xC0000267; +pub const STATUS_EVALUATION_EXPIRATION: NTSTATUS = 0xC0000268; +pub const STATUS_ILLEGAL_DLL_RELOCATION: NTSTATUS = 0xC0000269; +pub const STATUS_LICENSE_VIOLATION: NTSTATUS = 0xC000026A; +pub const STATUS_DLL_INIT_FAILED_LOGOFF: NTSTATUS = 0xC000026B; +pub const STATUS_DRIVER_UNABLE_TO_LOAD: NTSTATUS = 0xC000026C; +pub const STATUS_DFS_UNAVAILABLE: NTSTATUS = 0xC000026D; +pub const STATUS_VOLUME_DISMOUNTED: NTSTATUS = 0xC000026E; +pub const STATUS_WX86_INTERNAL_ERROR: NTSTATUS = 0xC000026F; +pub const STATUS_WX86_FLOAT_STACK_CHECK: NTSTATUS = 0xC0000270; +pub const STATUS_VALIDATE_CONTINUE: NTSTATUS = 0xC0000271; +pub const STATUS_NO_MATCH: NTSTATUS = 0xC0000272; +pub const STATUS_NO_MORE_MATCHES: NTSTATUS = 0xC0000273; +pub const STATUS_NOT_A_REPARSE_POINT: NTSTATUS = 0xC0000275; +pub const STATUS_IO_REPARSE_TAG_INVALID: NTSTATUS = 0xC0000276; +pub const STATUS_IO_REPARSE_TAG_MISMATCH: NTSTATUS = 0xC0000277; +pub const STATUS_IO_REPARSE_DATA_INVALID: NTSTATUS = 0xC0000278; +pub const STATUS_IO_REPARSE_TAG_NOT_HANDLED: NTSTATUS = 0xC0000279; +pub const STATUS_PWD_TOO_LONG: NTSTATUS = 0xC000027A; +pub const STATUS_STOWED_EXCEPTION: NTSTATUS = 0xC000027B; +pub const STATUS_REPARSE_POINT_NOT_RESOLVED: NTSTATUS = 0xC0000280; +pub const STATUS_DIRECTORY_IS_A_REPARSE_POINT: NTSTATUS = 0xC0000281; +pub const STATUS_RANGE_LIST_CONFLICT: NTSTATUS = 0xC0000282; +pub const STATUS_SOURCE_ELEMENT_EMPTY: NTSTATUS = 0xC0000283; +pub const STATUS_DESTINATION_ELEMENT_FULL: NTSTATUS = 0xC0000284; +pub const STATUS_ILLEGAL_ELEMENT_ADDRESS: NTSTATUS = 0xC0000285; +pub const STATUS_MAGAZINE_NOT_PRESENT: NTSTATUS = 0xC0000286; +pub const STATUS_REINITIALIZATION_NEEDED: NTSTATUS = 0xC0000287; +pub const STATUS_DEVICE_REQUIRES_CLEANING: NTSTATUS = 0x80000288; +pub const STATUS_DEVICE_DOOR_OPEN: NTSTATUS = 0x80000289; +pub const STATUS_ENCRYPTION_FAILED: NTSTATUS = 0xC000028A; +pub const STATUS_DECRYPTION_FAILED: NTSTATUS = 0xC000028B; +pub const STATUS_RANGE_NOT_FOUND: NTSTATUS = 0xC000028C; +pub const STATUS_NO_RECOVERY_POLICY: NTSTATUS = 0xC000028D; +pub const STATUS_NO_EFS: NTSTATUS = 0xC000028E; +pub const STATUS_WRONG_EFS: NTSTATUS = 0xC000028F; +pub const STATUS_NO_USER_KEYS: NTSTATUS = 0xC0000290; +pub const STATUS_FILE_NOT_ENCRYPTED: NTSTATUS = 0xC0000291; +pub const STATUS_NOT_EXPORT_FORMAT: NTSTATUS = 0xC0000292; +pub const STATUS_FILE_ENCRYPTED: NTSTATUS = 0xC0000293; +pub const STATUS_WAKE_SYSTEM: NTSTATUS = 0x40000294; +pub const STATUS_WMI_GUID_NOT_FOUND: NTSTATUS = 0xC0000295; +pub const STATUS_WMI_INSTANCE_NOT_FOUND: NTSTATUS = 0xC0000296; +pub const STATUS_WMI_ITEMID_NOT_FOUND: NTSTATUS = 0xC0000297; +pub const STATUS_WMI_TRY_AGAIN: NTSTATUS = 0xC0000298; +pub const STATUS_SHARED_POLICY: NTSTATUS = 0xC0000299; +pub const STATUS_POLICY_OBJECT_NOT_FOUND: NTSTATUS = 0xC000029A; +pub const STATUS_POLICY_ONLY_IN_DS: NTSTATUS = 0xC000029B; +pub const STATUS_VOLUME_NOT_UPGRADED: NTSTATUS = 0xC000029C; +pub const STATUS_REMOTE_STORAGE_NOT_ACTIVE: NTSTATUS = 0xC000029D; +pub const STATUS_REMOTE_STORAGE_MEDIA_ERROR: NTSTATUS = 0xC000029E; +pub const STATUS_NO_TRACKING_SERVICE: NTSTATUS = 0xC000029F; +pub const STATUS_SERVER_SID_MISMATCH: NTSTATUS = 0xC00002A0; +pub const STATUS_DS_NO_ATTRIBUTE_OR_VALUE: NTSTATUS = 0xC00002A1; +pub const STATUS_DS_INVALID_ATTRIBUTE_SYNTAX: NTSTATUS = 0xC00002A2; +pub const STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED: NTSTATUS = 0xC00002A3; +pub const STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS: NTSTATUS = 0xC00002A4; +pub const STATUS_DS_BUSY: NTSTATUS = 0xC00002A5; +pub const STATUS_DS_UNAVAILABLE: NTSTATUS = 0xC00002A6; +pub const STATUS_DS_NO_RIDS_ALLOCATED: NTSTATUS = 0xC00002A7; +pub const STATUS_DS_NO_MORE_RIDS: NTSTATUS = 0xC00002A8; +pub const STATUS_DS_INCORRECT_ROLE_OWNER: NTSTATUS = 0xC00002A9; +pub const STATUS_DS_RIDMGR_INIT_ERROR: NTSTATUS = 0xC00002AA; +pub const STATUS_DS_OBJ_CLASS_VIOLATION: NTSTATUS = 0xC00002AB; +pub const STATUS_DS_CANT_ON_NON_LEAF: NTSTATUS = 0xC00002AC; +pub const STATUS_DS_CANT_ON_RDN: NTSTATUS = 0xC00002AD; +pub const STATUS_DS_CANT_MOD_OBJ_CLASS: NTSTATUS = 0xC00002AE; +pub const STATUS_DS_CROSS_DOM_MOVE_FAILED: NTSTATUS = 0xC00002AF; +pub const STATUS_DS_GC_NOT_AVAILABLE: NTSTATUS = 0xC00002B0; +pub const STATUS_DIRECTORY_SERVICE_REQUIRED: NTSTATUS = 0xC00002B1; +pub const STATUS_REPARSE_ATTRIBUTE_CONFLICT: NTSTATUS = 0xC00002B2; +pub const STATUS_CANT_ENABLE_DENY_ONLY: NTSTATUS = 0xC00002B3; +pub const STATUS_FLOAT_MULTIPLE_FAULTS: NTSTATUS = 0xC00002B4; +pub const STATUS_FLOAT_MULTIPLE_TRAPS: NTSTATUS = 0xC00002B5; +pub const STATUS_DEVICE_REMOVED: NTSTATUS = 0xC00002B6; +pub const STATUS_JOURNAL_DELETE_IN_PROGRESS: NTSTATUS = 0xC00002B7; +pub const STATUS_JOURNAL_NOT_ACTIVE: NTSTATUS = 0xC00002B8; +pub const STATUS_NOINTERFACE: NTSTATUS = 0xC00002B9; +pub const STATUS_DS_RIDMGR_DISABLED: NTSTATUS = 0xC00002BA; +pub const STATUS_DS_ADMIN_LIMIT_EXCEEDED: NTSTATUS = 0xC00002C1; +pub const STATUS_DRIVER_FAILED_SLEEP: NTSTATUS = 0xC00002C2; +pub const STATUS_MUTUAL_AUTHENTICATION_FAILED: NTSTATUS = 0xC00002C3; +pub const STATUS_CORRUPT_SYSTEM_FILE: NTSTATUS = 0xC00002C4; +pub const STATUS_DATATYPE_MISALIGNMENT_ERROR: NTSTATUS = 0xC00002C5; +pub const STATUS_WMI_READ_ONLY: NTSTATUS = 0xC00002C6; +pub const STATUS_WMI_SET_FAILURE: NTSTATUS = 0xC00002C7; +pub const STATUS_COMMITMENT_MINIMUM: NTSTATUS = 0xC00002C8; +pub const STATUS_REG_NAT_CONSUMPTION: NTSTATUS = 0xC00002C9; +pub const STATUS_TRANSPORT_FULL: NTSTATUS = 0xC00002CA; +pub const STATUS_DS_SAM_INIT_FAILURE: NTSTATUS = 0xC00002CB; +pub const STATUS_ONLY_IF_CONNECTED: NTSTATUS = 0xC00002CC; +pub const STATUS_DS_SENSITIVE_GROUP_VIOLATION: NTSTATUS = 0xC00002CD; +pub const STATUS_PNP_RESTART_ENUMERATION: NTSTATUS = 0xC00002CE; +pub const STATUS_JOURNAL_ENTRY_DELETED: NTSTATUS = 0xC00002CF; +pub const STATUS_DS_CANT_MOD_PRIMARYGROUPID: NTSTATUS = 0xC00002D0; +pub const STATUS_SYSTEM_IMAGE_BAD_SIGNATURE: NTSTATUS = 0xC00002D1; +pub const STATUS_PNP_REBOOT_REQUIRED: NTSTATUS = 0xC00002D2; +pub const STATUS_POWER_STATE_INVALID: NTSTATUS = 0xC00002D3; +pub const STATUS_DS_INVALID_GROUP_TYPE: NTSTATUS = 0xC00002D4; +pub const STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN: NTSTATUS = 0xC00002D5; +pub const STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN: NTSTATUS = 0xC00002D6; +pub const STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER: NTSTATUS = 0xC00002D7; +pub const STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER: NTSTATUS = 0xC00002D8; +pub const STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER: NTSTATUS = 0xC00002D9; +pub const STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER: NTSTATUS = 0xC00002DA; +pub const STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER: NTSTATUS = 0xC00002DB; +pub const STATUS_DS_HAVE_PRIMARY_MEMBERS: NTSTATUS = 0xC00002DC; +pub const STATUS_WMI_NOT_SUPPORTED: NTSTATUS = 0xC00002DD; +pub const STATUS_INSUFFICIENT_POWER: NTSTATUS = 0xC00002DE; +pub const STATUS_SAM_NEED_BOOTKEY_PASSWORD: NTSTATUS = 0xC00002DF; +pub const STATUS_SAM_NEED_BOOTKEY_FLOPPY: NTSTATUS = 0xC00002E0; +pub const STATUS_DS_CANT_START: NTSTATUS = 0xC00002E1; +pub const STATUS_DS_INIT_FAILURE: NTSTATUS = 0xC00002E2; +pub const STATUS_SAM_INIT_FAILURE: NTSTATUS = 0xC00002E3; +pub const STATUS_DS_GC_REQUIRED: NTSTATUS = 0xC00002E4; +pub const STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY: NTSTATUS = 0xC00002E5; +pub const STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS: NTSTATUS = 0xC00002E6; +pub const STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED: NTSTATUS = 0xC00002E7; +pub const STATUS_MULTIPLE_FAULT_VIOLATION: NTSTATUS = 0xC00002E8; +pub const STATUS_CURRENT_DOMAIN_NOT_ALLOWED: NTSTATUS = 0xC00002E9; +pub const STATUS_CANNOT_MAKE: NTSTATUS = 0xC00002EA; +pub const STATUS_SYSTEM_SHUTDOWN: NTSTATUS = 0xC00002EB; +pub const STATUS_DS_INIT_FAILURE_CONSOLE: NTSTATUS = 0xC00002EC; +pub const STATUS_DS_SAM_INIT_FAILURE_CONSOLE: NTSTATUS = 0xC00002ED; +pub const STATUS_UNFINISHED_CONTEXT_DELETED: NTSTATUS = 0xC00002EE; +pub const STATUS_NO_TGT_REPLY: NTSTATUS = 0xC00002EF; +pub const STATUS_OBJECTID_NOT_FOUND: NTSTATUS = 0xC00002F0; +pub const STATUS_NO_IP_ADDRESSES: NTSTATUS = 0xC00002F1; +pub const STATUS_WRONG_CREDENTIAL_HANDLE: NTSTATUS = 0xC00002F2; +pub const STATUS_CRYPTO_SYSTEM_INVALID: NTSTATUS = 0xC00002F3; +pub const STATUS_MAX_REFERRALS_EXCEEDED: NTSTATUS = 0xC00002F4; +pub const STATUS_MUST_BE_KDC: NTSTATUS = 0xC00002F5; +pub const STATUS_STRONG_CRYPTO_NOT_SUPPORTED: NTSTATUS = 0xC00002F6; +pub const STATUS_TOO_MANY_PRINCIPALS: NTSTATUS = 0xC00002F7; +pub const STATUS_NO_PA_DATA: NTSTATUS = 0xC00002F8; +pub const STATUS_PKINIT_NAME_MISMATCH: NTSTATUS = 0xC00002F9; +pub const STATUS_SMARTCARD_LOGON_REQUIRED: NTSTATUS = 0xC00002FA; +pub const STATUS_KDC_INVALID_REQUEST: NTSTATUS = 0xC00002FB; +pub const STATUS_KDC_UNABLE_TO_REFER: NTSTATUS = 0xC00002FC; +pub const STATUS_KDC_UNKNOWN_ETYPE: NTSTATUS = 0xC00002FD; +pub const STATUS_SHUTDOWN_IN_PROGRESS: NTSTATUS = 0xC00002FE; +pub const STATUS_SERVER_SHUTDOWN_IN_PROGRESS: NTSTATUS = 0xC00002FF; +pub const STATUS_NOT_SUPPORTED_ON_SBS: NTSTATUS = 0xC0000300; +pub const STATUS_WMI_GUID_DISCONNECTED: NTSTATUS = 0xC0000301; +pub const STATUS_WMI_ALREADY_DISABLED: NTSTATUS = 0xC0000302; +pub const STATUS_WMI_ALREADY_ENABLED: NTSTATUS = 0xC0000303; +pub const STATUS_MFT_TOO_FRAGMENTED: NTSTATUS = 0xC0000304; +pub const STATUS_COPY_PROTECTION_FAILURE: NTSTATUS = 0xC0000305; +pub const STATUS_CSS_AUTHENTICATION_FAILURE: NTSTATUS = 0xC0000306; +pub const STATUS_CSS_KEY_NOT_PRESENT: NTSTATUS = 0xC0000307; +pub const STATUS_CSS_KEY_NOT_ESTABLISHED: NTSTATUS = 0xC0000308; +pub const STATUS_CSS_SCRAMBLED_SECTOR: NTSTATUS = 0xC0000309; +pub const STATUS_CSS_REGION_MISMATCH: NTSTATUS = 0xC000030A; +pub const STATUS_CSS_RESETS_EXHAUSTED: NTSTATUS = 0xC000030B; +pub const STATUS_PASSWORD_CHANGE_REQUIRED: NTSTATUS = 0xC000030C; +pub const STATUS_PKINIT_FAILURE: NTSTATUS = 0xC0000320; +pub const STATUS_SMARTCARD_SUBSYSTEM_FAILURE: NTSTATUS = 0xC0000321; +pub const STATUS_NO_KERB_KEY: NTSTATUS = 0xC0000322; +pub const STATUS_HOST_DOWN: NTSTATUS = 0xC0000350; +pub const STATUS_UNSUPPORTED_PREAUTH: NTSTATUS = 0xC0000351; +pub const STATUS_EFS_ALG_BLOB_TOO_BIG: NTSTATUS = 0xC0000352; +pub const STATUS_PORT_NOT_SET: NTSTATUS = 0xC0000353; +pub const STATUS_DEBUGGER_INACTIVE: NTSTATUS = 0xC0000354; +pub const STATUS_DS_VERSION_CHECK_FAILURE: NTSTATUS = 0xC0000355; +pub const STATUS_AUDITING_DISABLED: NTSTATUS = 0xC0000356; +pub const STATUS_PRENT4_MACHINE_ACCOUNT: NTSTATUS = 0xC0000357; +pub const STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER: NTSTATUS = 0xC0000358; +pub const STATUS_INVALID_IMAGE_WIN_32: NTSTATUS = 0xC0000359; +pub const STATUS_INVALID_IMAGE_WIN_64: NTSTATUS = 0xC000035A; +pub const STATUS_BAD_BINDINGS: NTSTATUS = 0xC000035B; +pub const STATUS_NETWORK_SESSION_EXPIRED: NTSTATUS = 0xC000035C; +pub const STATUS_APPHELP_BLOCK: NTSTATUS = 0xC000035D; +pub const STATUS_ALL_SIDS_FILTERED: NTSTATUS = 0xC000035E; +pub const STATUS_NOT_SAFE_MODE_DRIVER: NTSTATUS = 0xC000035F; +pub const STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT: NTSTATUS = 0xC0000361; +pub const STATUS_ACCESS_DISABLED_BY_POLICY_PATH: NTSTATUS = 0xC0000362; +pub const STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER: NTSTATUS = 0xC0000363; +pub const STATUS_ACCESS_DISABLED_BY_POLICY_OTHER: NTSTATUS = 0xC0000364; +pub const STATUS_FAILED_DRIVER_ENTRY: NTSTATUS = 0xC0000365; +pub const STATUS_DEVICE_ENUMERATION_ERROR: NTSTATUS = 0xC0000366; +pub const STATUS_MOUNT_POINT_NOT_RESOLVED: NTSTATUS = 0xC0000368; +pub const STATUS_INVALID_DEVICE_OBJECT_PARAMETER: NTSTATUS = 0xC0000369; +pub const STATUS_MCA_OCCURED: NTSTATUS = 0xC000036A; +pub const STATUS_DRIVER_BLOCKED_CRITICAL: NTSTATUS = 0xC000036B; +pub const STATUS_DRIVER_BLOCKED: NTSTATUS = 0xC000036C; +pub const STATUS_DRIVER_DATABASE_ERROR: NTSTATUS = 0xC000036D; +pub const STATUS_SYSTEM_HIVE_TOO_LARGE: NTSTATUS = 0xC000036E; +pub const STATUS_INVALID_IMPORT_OF_NON_DLL: NTSTATUS = 0xC000036F; +pub const STATUS_DS_SHUTTING_DOWN: NTSTATUS = 0x40000370; +pub const STATUS_NO_SECRETS: NTSTATUS = 0xC0000371; +pub const STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY: NTSTATUS = 0xC0000372; +pub const STATUS_FAILED_STACK_SWITCH: NTSTATUS = 0xC0000373; +pub const STATUS_HEAP_CORRUPTION: NTSTATUS = 0xC0000374; +pub const STATUS_SMARTCARD_WRONG_PIN: NTSTATUS = 0xC0000380; +pub const STATUS_SMARTCARD_CARD_BLOCKED: NTSTATUS = 0xC0000381; +pub const STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED: NTSTATUS = 0xC0000382; +pub const STATUS_SMARTCARD_NO_CARD: NTSTATUS = 0xC0000383; +pub const STATUS_SMARTCARD_NO_KEY_CONTAINER: NTSTATUS = 0xC0000384; +pub const STATUS_SMARTCARD_NO_CERTIFICATE: NTSTATUS = 0xC0000385; +pub const STATUS_SMARTCARD_NO_KEYSET: NTSTATUS = 0xC0000386; +pub const STATUS_SMARTCARD_IO_ERROR: NTSTATUS = 0xC0000387; +pub const STATUS_DOWNGRADE_DETECTED: NTSTATUS = 0xC0000388; +pub const STATUS_SMARTCARD_CERT_REVOKED: NTSTATUS = 0xC0000389; +pub const STATUS_ISSUING_CA_UNTRUSTED: NTSTATUS = 0xC000038A; +pub const STATUS_REVOCATION_OFFLINE_C: NTSTATUS = 0xC000038B; +pub const STATUS_PKINIT_CLIENT_FAILURE: NTSTATUS = 0xC000038C; +pub const STATUS_SMARTCARD_CERT_EXPIRED: NTSTATUS = 0xC000038D; +pub const STATUS_DRIVER_FAILED_PRIOR_UNLOAD: NTSTATUS = 0xC000038E; +pub const STATUS_SMARTCARD_SILENT_CONTEXT: NTSTATUS = 0xC000038F; +pub const STATUS_PER_USER_TRUST_QUOTA_EXCEEDED: NTSTATUS = 0xC0000401; +pub const STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED: NTSTATUS = 0xC0000402; +pub const STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED: NTSTATUS = 0xC0000403; +pub const STATUS_DS_NAME_NOT_UNIQUE: NTSTATUS = 0xC0000404; +pub const STATUS_DS_DUPLICATE_ID_FOUND: NTSTATUS = 0xC0000405; +pub const STATUS_DS_GROUP_CONVERSION_ERROR: NTSTATUS = 0xC0000406; +pub const STATUS_VOLSNAP_PREPARE_HIBERNATE: NTSTATUS = 0xC0000407; +pub const STATUS_USER2USER_REQUIRED: NTSTATUS = 0xC0000408; +pub const STATUS_STACK_BUFFER_OVERRUN: NTSTATUS = 0xC0000409; +pub const STATUS_NO_S4U_PROT_SUPPORT: NTSTATUS = 0xC000040A; +pub const STATUS_CROSSREALM_DELEGATION_FAILURE: NTSTATUS = 0xC000040B; +pub const STATUS_REVOCATION_OFFLINE_KDC: NTSTATUS = 0xC000040C; +pub const STATUS_ISSUING_CA_UNTRUSTED_KDC: NTSTATUS = 0xC000040D; +pub const STATUS_KDC_CERT_EXPIRED: NTSTATUS = 0xC000040E; +pub const STATUS_KDC_CERT_REVOKED: NTSTATUS = 0xC000040F; +pub const STATUS_PARAMETER_QUOTA_EXCEEDED: NTSTATUS = 0xC0000410; +pub const STATUS_HIBERNATION_FAILURE: NTSTATUS = 0xC0000411; +pub const STATUS_DELAY_LOAD_FAILED: NTSTATUS = 0xC0000412; +pub const STATUS_AUTHENTICATION_FIREWALL_FAILED: NTSTATUS = 0xC0000413; +pub const STATUS_VDM_DISALLOWED: NTSTATUS = 0xC0000414; +pub const STATUS_HUNG_DISPLAY_DRIVER_THREAD: NTSTATUS = 0xC0000415; +pub const STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE: NTSTATUS + = 0xC0000416; +pub const STATUS_INVALID_CRUNTIME_PARAMETER: NTSTATUS = 0xC0000417; +pub const STATUS_NTLM_BLOCKED: NTSTATUS = 0xC0000418; +pub const STATUS_DS_SRC_SID_EXISTS_IN_FOREST: NTSTATUS = 0xC0000419; +pub const STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST: NTSTATUS = 0xC000041A; +pub const STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST: NTSTATUS = 0xC000041B; +pub const STATUS_INVALID_USER_PRINCIPAL_NAME: NTSTATUS = 0xC000041C; +pub const STATUS_FATAL_USER_CALLBACK_EXCEPTION: NTSTATUS = 0xC000041D; +pub const STATUS_ASSERTION_FAILURE: NTSTATUS = 0xC0000420; +pub const STATUS_VERIFIER_STOP: NTSTATUS = 0xC0000421; +pub const STATUS_CALLBACK_POP_STACK: NTSTATUS = 0xC0000423; +pub const STATUS_INCOMPATIBLE_DRIVER_BLOCKED: NTSTATUS = 0xC0000424; +pub const STATUS_HIVE_UNLOADED: NTSTATUS = 0xC0000425; +pub const STATUS_COMPRESSION_DISABLED: NTSTATUS = 0xC0000426; +pub const STATUS_FILE_SYSTEM_LIMITATION: NTSTATUS = 0xC0000427; +pub const STATUS_INVALID_IMAGE_HASH: NTSTATUS = 0xC0000428; +pub const STATUS_NOT_CAPABLE: NTSTATUS = 0xC0000429; +pub const STATUS_REQUEST_OUT_OF_SEQUENCE: NTSTATUS = 0xC000042A; +pub const STATUS_IMPLEMENTATION_LIMIT: NTSTATUS = 0xC000042B; +pub const STATUS_ELEVATION_REQUIRED: NTSTATUS = 0xC000042C; +pub const STATUS_NO_SECURITY_CONTEXT: NTSTATUS = 0xC000042D; +pub const STATUS_PKU2U_CERT_FAILURE: NTSTATUS = 0xC000042F; +pub const STATUS_BEYOND_VDL: NTSTATUS = 0xC0000432; +pub const STATUS_ENCOUNTERED_WRITE_IN_PROGRESS: NTSTATUS = 0xC0000433; +pub const STATUS_PTE_CHANGED: NTSTATUS = 0xC0000434; +pub const STATUS_PURGE_FAILED: NTSTATUS = 0xC0000435; +pub const STATUS_CRED_REQUIRES_CONFIRMATION: NTSTATUS = 0xC0000440; +pub const STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE: NTSTATUS = 0xC0000441; +pub const STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER: NTSTATUS = 0xC0000442; +pub const STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE: NTSTATUS = 0xC0000443; +pub const STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE: NTSTATUS = 0xC0000444; +pub const STATUS_CS_ENCRYPTION_FILE_NOT_CSE: NTSTATUS = 0xC0000445; +pub const STATUS_INVALID_LABEL: NTSTATUS = 0xC0000446; +pub const STATUS_DRIVER_PROCESS_TERMINATED: NTSTATUS = 0xC0000450; +pub const STATUS_AMBIGUOUS_SYSTEM_DEVICE: NTSTATUS = 0xC0000451; +pub const STATUS_SYSTEM_DEVICE_NOT_FOUND: NTSTATUS = 0xC0000452; +pub const STATUS_RESTART_BOOT_APPLICATION: NTSTATUS = 0xC0000453; +pub const STATUS_INSUFFICIENT_NVRAM_RESOURCES: NTSTATUS = 0xC0000454; +pub const STATUS_INVALID_SESSION: NTSTATUS = 0xC0000455; +pub const STATUS_THREAD_ALREADY_IN_SESSION: NTSTATUS = 0xC0000456; +pub const STATUS_THREAD_NOT_IN_SESSION: NTSTATUS = 0xC0000457; +pub const STATUS_INVALID_WEIGHT: NTSTATUS = 0xC0000458; +pub const STATUS_REQUEST_PAUSED: NTSTATUS = 0xC0000459; +pub const STATUS_NO_RANGES_PROCESSED: NTSTATUS = 0xC0000460; +pub const STATUS_DISK_RESOURCES_EXHAUSTED: NTSTATUS = 0xC0000461; +pub const STATUS_NEEDS_REMEDIATION: NTSTATUS = 0xC0000462; +pub const STATUS_DEVICE_FEATURE_NOT_SUPPORTED: NTSTATUS = 0xC0000463; +pub const STATUS_DEVICE_UNREACHABLE: NTSTATUS = 0xC0000464; +pub const STATUS_INVALID_TOKEN: NTSTATUS = 0xC0000465; +pub const STATUS_SERVER_UNAVAILABLE: NTSTATUS = 0xC0000466; +pub const STATUS_FILE_NOT_AVAILABLE: NTSTATUS = 0xC0000467; +pub const STATUS_DEVICE_INSUFFICIENT_RESOURCES: NTSTATUS = 0xC0000468; +pub const STATUS_PACKAGE_UPDATING: NTSTATUS = 0xC0000469; +pub const STATUS_NOT_READ_FROM_COPY: NTSTATUS = 0xC000046A; +pub const STATUS_FT_WRITE_FAILURE: NTSTATUS = 0xC000046B; +pub const STATUS_FT_DI_SCAN_REQUIRED: NTSTATUS = 0xC000046C; +pub const STATUS_OBJECT_NOT_EXTERNALLY_BACKED: NTSTATUS = 0xC000046D; +pub const STATUS_EXTERNAL_BACKING_PROVIDER_UNKNOWN: NTSTATUS = 0xC000046E; +pub const STATUS_COMPRESSION_NOT_BENEFICIAL: NTSTATUS = 0xC000046F; +pub const STATUS_DATA_CHECKSUM_ERROR: NTSTATUS = 0xC0000470; +pub const STATUS_INTERMIXED_KERNEL_EA_OPERATION: NTSTATUS = 0xC0000471; +pub const STATUS_TRIM_READ_ZERO_NOT_SUPPORTED: NTSTATUS = 0xC0000472; +pub const STATUS_TOO_MANY_SEGMENT_DESCRIPTORS: NTSTATUS = 0xC0000473; +pub const STATUS_INVALID_OFFSET_ALIGNMENT: NTSTATUS = 0xC0000474; +pub const STATUS_INVALID_FIELD_IN_PARAMETER_LIST: NTSTATUS = 0xC0000475; +pub const STATUS_OPERATION_IN_PROGRESS: NTSTATUS = 0xC0000476; +pub const STATUS_INVALID_INITIATOR_TARGET_PATH: NTSTATUS = 0xC0000477; +pub const STATUS_SCRUB_DATA_DISABLED: NTSTATUS = 0xC0000478; +pub const STATUS_NOT_REDUNDANT_STORAGE: NTSTATUS = 0xC0000479; +pub const STATUS_RESIDENT_FILE_NOT_SUPPORTED: NTSTATUS = 0xC000047A; +pub const STATUS_COMPRESSED_FILE_NOT_SUPPORTED: NTSTATUS = 0xC000047B; +pub const STATUS_DIRECTORY_NOT_SUPPORTED: NTSTATUS = 0xC000047C; +pub const STATUS_IO_OPERATION_TIMEOUT: NTSTATUS = 0xC000047D; +pub const STATUS_SYSTEM_NEEDS_REMEDIATION: NTSTATUS = 0xC000047E; +pub const STATUS_APPX_INTEGRITY_FAILURE_CLR_NGEN: NTSTATUS = 0xC000047F; +pub const STATUS_SHARE_UNAVAILABLE: NTSTATUS = 0xC0000480; +pub const STATUS_APISET_NOT_HOSTED: NTSTATUS = 0xC0000481; +pub const STATUS_APISET_NOT_PRESENT: NTSTATUS = 0xC0000482; +pub const STATUS_DEVICE_HARDWARE_ERROR: NTSTATUS = 0xC0000483; +pub const STATUS_FIRMWARE_SLOT_INVALID: NTSTATUS = 0xC0000484; +pub const STATUS_FIRMWARE_IMAGE_INVALID: NTSTATUS = 0xC0000485; +pub const STATUS_STORAGE_TOPOLOGY_ID_MISMATCH: NTSTATUS = 0xC0000486; +pub const STATUS_WIM_NOT_BOOTABLE: NTSTATUS = 0xC0000487; +pub const STATUS_BLOCKED_BY_PARENTAL_CONTROLS: NTSTATUS = 0xC0000488; +pub const STATUS_NEEDS_REGISTRATION: NTSTATUS = 0xC0000489; +pub const STATUS_QUOTA_ACTIVITY: NTSTATUS = 0xC000048A; +pub const STATUS_CALLBACK_INVOKE_INLINE: NTSTATUS = 0xC000048B; +pub const STATUS_BLOCK_TOO_MANY_REFERENCES: NTSTATUS = 0xC000048C; +pub const STATUS_MARKED_TO_DISALLOW_WRITES: NTSTATUS = 0xC000048D; +pub const STATUS_NETWORK_ACCESS_DENIED_EDP: NTSTATUS = 0xC000048E; +pub const STATUS_ENCLAVE_FAILURE: NTSTATUS = 0xC000048F; +pub const STATUS_PNP_NO_COMPAT_DRIVERS: NTSTATUS = 0xC0000490; +pub const STATUS_PNP_DRIVER_PACKAGE_NOT_FOUND: NTSTATUS = 0xC0000491; +pub const STATUS_PNP_DRIVER_CONFIGURATION_NOT_FOUND: NTSTATUS = 0xC0000492; +pub const STATUS_PNP_DRIVER_CONFIGURATION_INCOMPLETE: NTSTATUS = 0xC0000493; +pub const STATUS_PNP_FUNCTION_DRIVER_REQUIRED: NTSTATUS = 0xC0000494; +pub const STATUS_PNP_DEVICE_CONFIGURATION_PENDING: NTSTATUS = 0xC0000495; +pub const STATUS_DEVICE_HINT_NAME_BUFFER_TOO_SMALL: NTSTATUS = 0xC0000496; +pub const STATUS_PACKAGE_NOT_AVAILABLE: NTSTATUS = 0xC0000497; +pub const STATUS_DEVICE_IN_MAINTENANCE: NTSTATUS = 0xC0000499; +pub const STATUS_NOT_SUPPORTED_ON_DAX: NTSTATUS = 0xC000049A; +pub const STATUS_FREE_SPACE_TOO_FRAGMENTED: NTSTATUS = 0xC000049B; +pub const STATUS_DAX_MAPPING_EXISTS: NTSTATUS = 0xC000049C; +pub const STATUS_CHILD_PROCESS_BLOCKED: NTSTATUS = 0xC000049D; +pub const STATUS_STORAGE_LOST_DATA_PERSISTENCE: NTSTATUS = 0xC000049E; +pub const STATUS_INVALID_TASK_NAME: NTSTATUS = 0xC0000500; +pub const STATUS_INVALID_TASK_INDEX: NTSTATUS = 0xC0000501; +pub const STATUS_THREAD_ALREADY_IN_TASK: NTSTATUS = 0xC0000502; +pub const STATUS_CALLBACK_BYPASS: NTSTATUS = 0xC0000503; +pub const STATUS_UNDEFINED_SCOPE: NTSTATUS = 0xC0000504; +pub const STATUS_INVALID_CAP: NTSTATUS = 0xC0000505; +pub const STATUS_NOT_GUI_PROCESS: NTSTATUS = 0xC0000506; +pub const STATUS_DEVICE_HUNG: NTSTATUS = 0xC0000507; +pub const STATUS_CONTAINER_ASSIGNED: NTSTATUS = 0xC0000508; +pub const STATUS_JOB_NO_CONTAINER: NTSTATUS = 0xC0000509; +pub const STATUS_DEVICE_UNRESPONSIVE: NTSTATUS = 0xC000050A; +pub const STATUS_REPARSE_POINT_ENCOUNTERED: NTSTATUS = 0xC000050B; +pub const STATUS_FAIL_FAST_EXCEPTION: NTSTATUS = 0xC0000602; +pub const STATUS_IMAGE_CERT_REVOKED: NTSTATUS = 0xC0000603; +pub const STATUS_DYNAMIC_CODE_BLOCKED: NTSTATUS = 0xC0000604; +pub const STATUS_IMAGE_CERT_EXPIRED: NTSTATUS = 0xC0000605; +pub const STATUS_PORT_CLOSED: NTSTATUS = 0xC0000700; +pub const STATUS_MESSAGE_LOST: NTSTATUS = 0xC0000701; +pub const STATUS_INVALID_MESSAGE: NTSTATUS = 0xC0000702; +pub const STATUS_REQUEST_CANCELED: NTSTATUS = 0xC0000703; +pub const STATUS_RECURSIVE_DISPATCH: NTSTATUS = 0xC0000704; +pub const STATUS_LPC_RECEIVE_BUFFER_EXPECTED: NTSTATUS = 0xC0000705; +pub const STATUS_LPC_INVALID_CONNECTION_USAGE: NTSTATUS = 0xC0000706; +pub const STATUS_LPC_REQUESTS_NOT_ALLOWED: NTSTATUS = 0xC0000707; +pub const STATUS_RESOURCE_IN_USE: NTSTATUS = 0xC0000708; +pub const STATUS_HARDWARE_MEMORY_ERROR: NTSTATUS = 0xC0000709; +pub const STATUS_THREADPOOL_HANDLE_EXCEPTION: NTSTATUS = 0xC000070A; +pub const STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED: NTSTATUS = 0xC000070B; +pub const STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED: NTSTATUS + = 0xC000070C; +pub const STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED: NTSTATUS = 0xC000070D; +pub const STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED: NTSTATUS = 0xC000070E; +pub const STATUS_THREADPOOL_RELEASED_DURING_OPERATION: NTSTATUS = 0xC000070F; +pub const STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING: NTSTATUS = 0xC0000710; +pub const STATUS_APC_RETURNED_WHILE_IMPERSONATING: NTSTATUS = 0xC0000711; +pub const STATUS_PROCESS_IS_PROTECTED: NTSTATUS = 0xC0000712; +pub const STATUS_MCA_EXCEPTION: NTSTATUS = 0xC0000713; +pub const STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE: NTSTATUS = 0xC0000714; +pub const STATUS_SYMLINK_CLASS_DISABLED: NTSTATUS = 0xC0000715; +pub const STATUS_INVALID_IDN_NORMALIZATION: NTSTATUS = 0xC0000716; +pub const STATUS_NO_UNICODE_TRANSLATION: NTSTATUS = 0xC0000717; +pub const STATUS_ALREADY_REGISTERED: NTSTATUS = 0xC0000718; +pub const STATUS_CONTEXT_MISMATCH: NTSTATUS = 0xC0000719; +pub const STATUS_PORT_ALREADY_HAS_COMPLETION_LIST: NTSTATUS = 0xC000071A; +pub const STATUS_CALLBACK_RETURNED_THREAD_PRIORITY: NTSTATUS = 0xC000071B; +pub const STATUS_INVALID_THREAD: NTSTATUS = 0xC000071C; +pub const STATUS_CALLBACK_RETURNED_TRANSACTION: NTSTATUS = 0xC000071D; +pub const STATUS_CALLBACK_RETURNED_LDR_LOCK: NTSTATUS = 0xC000071E; +pub const STATUS_CALLBACK_RETURNED_LANG: NTSTATUS = 0xC000071F; +pub const STATUS_CALLBACK_RETURNED_PRI_BACK: NTSTATUS = 0xC0000720; +pub const STATUS_CALLBACK_RETURNED_THREAD_AFFINITY: NTSTATUS = 0xC0000721; +pub const STATUS_LPC_HANDLE_COUNT_EXCEEDED: NTSTATUS = 0xC0000722; +pub const STATUS_DISK_REPAIR_DISABLED: NTSTATUS = 0xC0000800; +pub const STATUS_DS_DOMAIN_RENAME_IN_PROGRESS: NTSTATUS = 0xC0000801; +pub const STATUS_DISK_QUOTA_EXCEEDED: NTSTATUS = 0xC0000802; +pub const STATUS_DATA_LOST_REPAIR: NTSTATUS = 0x80000803; +pub const STATUS_CONTENT_BLOCKED: NTSTATUS = 0xC0000804; +pub const STATUS_BAD_CLUSTERS: NTSTATUS = 0xC0000805; +pub const STATUS_VOLUME_DIRTY: NTSTATUS = 0xC0000806; +pub const STATUS_DISK_REPAIR_REDIRECTED: NTSTATUS = 0x40000807; +pub const STATUS_DISK_REPAIR_UNSUCCESSFUL: NTSTATUS = 0xC0000808; +pub const STATUS_CORRUPT_LOG_OVERFULL: NTSTATUS = 0xC0000809; +pub const STATUS_CORRUPT_LOG_CORRUPTED: NTSTATUS = 0xC000080A; +pub const STATUS_CORRUPT_LOG_UNAVAILABLE: NTSTATUS = 0xC000080B; +pub const STATUS_CORRUPT_LOG_DELETED_FULL: NTSTATUS = 0xC000080C; +pub const STATUS_CORRUPT_LOG_CLEARED: NTSTATUS = 0xC000080D; +pub const STATUS_ORPHAN_NAME_EXHAUSTED: NTSTATUS = 0xC000080E; +pub const STATUS_PROACTIVE_SCAN_IN_PROGRESS: NTSTATUS = 0xC000080F; +pub const STATUS_ENCRYPTED_IO_NOT_POSSIBLE: NTSTATUS = 0xC0000810; +pub const STATUS_CORRUPT_LOG_UPLEVEL_RECORDS: NTSTATUS = 0xC0000811; +pub const STATUS_FILE_CHECKED_OUT: NTSTATUS = 0xC0000901; +pub const STATUS_CHECKOUT_REQUIRED: NTSTATUS = 0xC0000902; +pub const STATUS_BAD_FILE_TYPE: NTSTATUS = 0xC0000903; +pub const STATUS_FILE_TOO_LARGE: NTSTATUS = 0xC0000904; +pub const STATUS_FORMS_AUTH_REQUIRED: NTSTATUS = 0xC0000905; +pub const STATUS_VIRUS_INFECTED: NTSTATUS = 0xC0000906; +pub const STATUS_VIRUS_DELETED: NTSTATUS = 0xC0000907; +pub const STATUS_BAD_MCFG_TABLE: NTSTATUS = 0xC0000908; +pub const STATUS_CANNOT_BREAK_OPLOCK: NTSTATUS = 0xC0000909; +pub const STATUS_BAD_KEY: NTSTATUS = 0xC000090A; +pub const STATUS_BAD_DATA: NTSTATUS = 0xC000090B; +pub const STATUS_NO_KEY: NTSTATUS = 0xC000090C; +pub const STATUS_FILE_HANDLE_REVOKED: NTSTATUS = 0xC0000910; +pub const STATUS_WOW_ASSERTION: NTSTATUS = 0xC0009898; +pub const STATUS_INVALID_SIGNATURE: NTSTATUS = 0xC000A000; +pub const STATUS_HMAC_NOT_SUPPORTED: NTSTATUS = 0xC000A001; +pub const STATUS_AUTH_TAG_MISMATCH: NTSTATUS = 0xC000A002; +pub const STATUS_INVALID_STATE_TRANSITION: NTSTATUS = 0xC000A003; +pub const STATUS_INVALID_KERNEL_INFO_VERSION: NTSTATUS = 0xC000A004; +pub const STATUS_INVALID_PEP_INFO_VERSION: NTSTATUS = 0xC000A005; +pub const STATUS_HANDLE_REVOKED: NTSTATUS = 0xC000A006; +pub const STATUS_EOF_ON_GHOSTED_RANGE: NTSTATUS = 0xC000A007; +pub const STATUS_IPSEC_QUEUE_OVERFLOW: NTSTATUS = 0xC000A010; +pub const STATUS_ND_QUEUE_OVERFLOW: NTSTATUS = 0xC000A011; +pub const STATUS_HOPLIMIT_EXCEEDED: NTSTATUS = 0xC000A012; +pub const STATUS_PROTOCOL_NOT_SUPPORTED: NTSTATUS = 0xC000A013; +pub const STATUS_FASTPATH_REJECTED: NTSTATUS = 0xC000A014; +pub const STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED: NTSTATUS = 0xC000A080; +pub const STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR: NTSTATUS = 0xC000A081; +pub const STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR: NTSTATUS = 0xC000A082; +pub const STATUS_XML_PARSE_ERROR: NTSTATUS = 0xC000A083; +pub const STATUS_XMLDSIG_ERROR: NTSTATUS = 0xC000A084; +pub const STATUS_WRONG_COMPARTMENT: NTSTATUS = 0xC000A085; +pub const STATUS_AUTHIP_FAILURE: NTSTATUS = 0xC000A086; +pub const STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS: NTSTATUS = 0xC000A087; +pub const STATUS_DS_OID_NOT_FOUND: NTSTATUS = 0xC000A088; +pub const STATUS_INCORRECT_ACCOUNT_TYPE: NTSTATUS = 0xC000A089; +pub const STATUS_HASH_NOT_SUPPORTED: NTSTATUS = 0xC000A100; +pub const STATUS_HASH_NOT_PRESENT: NTSTATUS = 0xC000A101; +pub const STATUS_SECONDARY_IC_PROVIDER_NOT_REGISTERED: NTSTATUS = 0xC000A121; +pub const STATUS_GPIO_CLIENT_INFORMATION_INVALID: NTSTATUS = 0xC000A122; +pub const STATUS_GPIO_VERSION_NOT_SUPPORTED: NTSTATUS = 0xC000A123; +pub const STATUS_GPIO_INVALID_REGISTRATION_PACKET: NTSTATUS = 0xC000A124; +pub const STATUS_GPIO_OPERATION_DENIED: NTSTATUS = 0xC000A125; +pub const STATUS_GPIO_INCOMPATIBLE_CONNECT_MODE: NTSTATUS = 0xC000A126; +pub const STATUS_GPIO_INTERRUPT_ALREADY_UNMASKED: NTSTATUS = 0x8000A127; +pub const STATUS_CANNOT_SWITCH_RUNLEVEL: NTSTATUS = 0xC000A141; +pub const STATUS_INVALID_RUNLEVEL_SETTING: NTSTATUS = 0xC000A142; +pub const STATUS_RUNLEVEL_SWITCH_TIMEOUT: NTSTATUS = 0xC000A143; +pub const STATUS_SERVICES_FAILED_AUTOSTART: NTSTATUS = 0x4000A144; +pub const STATUS_RUNLEVEL_SWITCH_AGENT_TIMEOUT: NTSTATUS = 0xC000A145; +pub const STATUS_RUNLEVEL_SWITCH_IN_PROGRESS: NTSTATUS = 0xC000A146; +pub const STATUS_NOT_APPCONTAINER: NTSTATUS = 0xC000A200; +pub const STATUS_NOT_SUPPORTED_IN_APPCONTAINER: NTSTATUS = 0xC000A201; +pub const STATUS_INVALID_PACKAGE_SID_LENGTH: NTSTATUS = 0xC000A202; +pub const STATUS_APP_DATA_NOT_FOUND: NTSTATUS = 0xC000A281; +pub const STATUS_APP_DATA_EXPIRED: NTSTATUS = 0xC000A282; +pub const STATUS_APP_DATA_CORRUPT: NTSTATUS = 0xC000A283; +pub const STATUS_APP_DATA_LIMIT_EXCEEDED: NTSTATUS = 0xC000A284; +pub const STATUS_APP_DATA_REBOOT_REQUIRED: NTSTATUS = 0xC000A285; +pub const STATUS_OFFLOAD_READ_FLT_NOT_SUPPORTED: NTSTATUS = 0xC000A2A1; +pub const STATUS_OFFLOAD_WRITE_FLT_NOT_SUPPORTED: NTSTATUS = 0xC000A2A2; +pub const STATUS_OFFLOAD_READ_FILE_NOT_SUPPORTED: NTSTATUS = 0xC000A2A3; +pub const STATUS_OFFLOAD_WRITE_FILE_NOT_SUPPORTED: NTSTATUS = 0xC000A2A4; +pub const STATUS_CLOUD_FILE_PROVIDER_UNKNOWN: NTSTATUS = 0xC000CF00; +pub const STATUS_CLOUD_FILE_PROVIDER_NOT_RUNNING: NTSTATUS = 0xC000CF01; +pub const STATUS_CLOUD_FILE_METADATA_CORRUPT: NTSTATUS = 0xC000CF02; +pub const STATUS_CLOUD_FILE_METADATA_TOO_LARGE: NTSTATUS = 0xC000CF03; +pub const STATUS_CLOUD_FILE_PROPERTY_BLOB_TOO_LARGE: NTSTATUS = 0x8000CF04; +pub const DBG_NO_STATE_CHANGE: NTSTATUS = 0xC0010001; +pub const DBG_APP_NOT_IDLE: NTSTATUS = 0xC0010002; +pub const RPC_NT_INVALID_STRING_BINDING: NTSTATUS = 0xC0020001; +pub const RPC_NT_WRONG_KIND_OF_BINDING: NTSTATUS = 0xC0020002; +pub const RPC_NT_INVALID_BINDING: NTSTATUS = 0xC0020003; +pub const RPC_NT_PROTSEQ_NOT_SUPPORTED: NTSTATUS = 0xC0020004; +pub const RPC_NT_INVALID_RPC_PROTSEQ: NTSTATUS = 0xC0020005; +pub const RPC_NT_INVALID_STRING_UUID: NTSTATUS = 0xC0020006; +pub const RPC_NT_INVALID_ENDPOINT_FORMAT: NTSTATUS = 0xC0020007; +pub const RPC_NT_INVALID_NET_ADDR: NTSTATUS = 0xC0020008; +pub const RPC_NT_NO_ENDPOINT_FOUND: NTSTATUS = 0xC0020009; +pub const RPC_NT_INVALID_TIMEOUT: NTSTATUS = 0xC002000A; +pub const RPC_NT_OBJECT_NOT_FOUND: NTSTATUS = 0xC002000B; +pub const RPC_NT_ALREADY_REGISTERED: NTSTATUS = 0xC002000C; +pub const RPC_NT_TYPE_ALREADY_REGISTERED: NTSTATUS = 0xC002000D; +pub const RPC_NT_ALREADY_LISTENING: NTSTATUS = 0xC002000E; +pub const RPC_NT_NO_PROTSEQS_REGISTERED: NTSTATUS = 0xC002000F; +pub const RPC_NT_NOT_LISTENING: NTSTATUS = 0xC0020010; +pub const RPC_NT_UNKNOWN_MGR_TYPE: NTSTATUS = 0xC0020011; +pub const RPC_NT_UNKNOWN_IF: NTSTATUS = 0xC0020012; +pub const RPC_NT_NO_BINDINGS: NTSTATUS = 0xC0020013; +pub const RPC_NT_NO_PROTSEQS: NTSTATUS = 0xC0020014; +pub const RPC_NT_CANT_CREATE_ENDPOINT: NTSTATUS = 0xC0020015; +pub const RPC_NT_OUT_OF_RESOURCES: NTSTATUS = 0xC0020016; +pub const RPC_NT_SERVER_UNAVAILABLE: NTSTATUS = 0xC0020017; +pub const RPC_NT_SERVER_TOO_BUSY: NTSTATUS = 0xC0020018; +pub const RPC_NT_INVALID_NETWORK_OPTIONS: NTSTATUS = 0xC0020019; +pub const RPC_NT_NO_CALL_ACTIVE: NTSTATUS = 0xC002001A; +pub const RPC_NT_CALL_FAILED: NTSTATUS = 0xC002001B; +pub const RPC_NT_CALL_FAILED_DNE: NTSTATUS = 0xC002001C; +pub const RPC_NT_PROTOCOL_ERROR: NTSTATUS = 0xC002001D; +pub const RPC_NT_UNSUPPORTED_TRANS_SYN: NTSTATUS = 0xC002001F; +pub const RPC_NT_UNSUPPORTED_TYPE: NTSTATUS = 0xC0020021; +pub const RPC_NT_INVALID_TAG: NTSTATUS = 0xC0020022; +pub const RPC_NT_INVALID_BOUND: NTSTATUS = 0xC0020023; +pub const RPC_NT_NO_ENTRY_NAME: NTSTATUS = 0xC0020024; +pub const RPC_NT_INVALID_NAME_SYNTAX: NTSTATUS = 0xC0020025; +pub const RPC_NT_UNSUPPORTED_NAME_SYNTAX: NTSTATUS = 0xC0020026; +pub const RPC_NT_UUID_NO_ADDRESS: NTSTATUS = 0xC0020028; +pub const RPC_NT_DUPLICATE_ENDPOINT: NTSTATUS = 0xC0020029; +pub const RPC_NT_UNKNOWN_AUTHN_TYPE: NTSTATUS = 0xC002002A; +pub const RPC_NT_MAX_CALLS_TOO_SMALL: NTSTATUS = 0xC002002B; +pub const RPC_NT_STRING_TOO_LONG: NTSTATUS = 0xC002002C; +pub const RPC_NT_PROTSEQ_NOT_FOUND: NTSTATUS = 0xC002002D; +pub const RPC_NT_PROCNUM_OUT_OF_RANGE: NTSTATUS = 0xC002002E; +pub const RPC_NT_BINDING_HAS_NO_AUTH: NTSTATUS = 0xC002002F; +pub const RPC_NT_UNKNOWN_AUTHN_SERVICE: NTSTATUS = 0xC0020030; +pub const RPC_NT_UNKNOWN_AUTHN_LEVEL: NTSTATUS = 0xC0020031; +pub const RPC_NT_INVALID_AUTH_IDENTITY: NTSTATUS = 0xC0020032; +pub const RPC_NT_UNKNOWN_AUTHZ_SERVICE: NTSTATUS = 0xC0020033; +pub const EPT_NT_INVALID_ENTRY: NTSTATUS = 0xC0020034; +pub const EPT_NT_CANT_PERFORM_OP: NTSTATUS = 0xC0020035; +pub const EPT_NT_NOT_REGISTERED: NTSTATUS = 0xC0020036; +pub const RPC_NT_NOTHING_TO_EXPORT: NTSTATUS = 0xC0020037; +pub const RPC_NT_INCOMPLETE_NAME: NTSTATUS = 0xC0020038; +pub const RPC_NT_INVALID_VERS_OPTION: NTSTATUS = 0xC0020039; +pub const RPC_NT_NO_MORE_MEMBERS: NTSTATUS = 0xC002003A; +pub const RPC_NT_NOT_ALL_OBJS_UNEXPORTED: NTSTATUS = 0xC002003B; +pub const RPC_NT_INTERFACE_NOT_FOUND: NTSTATUS = 0xC002003C; +pub const RPC_NT_ENTRY_ALREADY_EXISTS: NTSTATUS = 0xC002003D; +pub const RPC_NT_ENTRY_NOT_FOUND: NTSTATUS = 0xC002003E; +pub const RPC_NT_NAME_SERVICE_UNAVAILABLE: NTSTATUS = 0xC002003F; +pub const RPC_NT_INVALID_NAF_ID: NTSTATUS = 0xC0020040; +pub const RPC_NT_CANNOT_SUPPORT: NTSTATUS = 0xC0020041; +pub const RPC_NT_NO_CONTEXT_AVAILABLE: NTSTATUS = 0xC0020042; +pub const RPC_NT_INTERNAL_ERROR: NTSTATUS = 0xC0020043; +pub const RPC_NT_ZERO_DIVIDE: NTSTATUS = 0xC0020044; +pub const RPC_NT_ADDRESS_ERROR: NTSTATUS = 0xC0020045; +pub const RPC_NT_FP_DIV_ZERO: NTSTATUS = 0xC0020046; +pub const RPC_NT_FP_UNDERFLOW: NTSTATUS = 0xC0020047; +pub const RPC_NT_FP_OVERFLOW: NTSTATUS = 0xC0020048; +pub const RPC_NT_NO_MORE_ENTRIES: NTSTATUS = 0xC0030001; +pub const RPC_NT_SS_CHAR_TRANS_OPEN_FAIL: NTSTATUS = 0xC0030002; +pub const RPC_NT_SS_CHAR_TRANS_SHORT_FILE: NTSTATUS = 0xC0030003; +pub const RPC_NT_SS_IN_NULL_CONTEXT: NTSTATUS = 0xC0030004; +pub const RPC_NT_SS_CONTEXT_MISMATCH: NTSTATUS = 0xC0030005; +pub const RPC_NT_SS_CONTEXT_DAMAGED: NTSTATUS = 0xC0030006; +pub const RPC_NT_SS_HANDLES_MISMATCH: NTSTATUS = 0xC0030007; +pub const RPC_NT_SS_CANNOT_GET_CALL_HANDLE: NTSTATUS = 0xC0030008; +pub const RPC_NT_NULL_REF_POINTER: NTSTATUS = 0xC0030009; +pub const RPC_NT_ENUM_VALUE_OUT_OF_RANGE: NTSTATUS = 0xC003000A; +pub const RPC_NT_BYTE_COUNT_TOO_SMALL: NTSTATUS = 0xC003000B; +pub const RPC_NT_BAD_STUB_DATA: NTSTATUS = 0xC003000C; +pub const RPC_NT_CALL_IN_PROGRESS: NTSTATUS = 0xC0020049; +pub const RPC_NT_NO_MORE_BINDINGS: NTSTATUS = 0xC002004A; +pub const RPC_NT_GROUP_MEMBER_NOT_FOUND: NTSTATUS = 0xC002004B; +pub const EPT_NT_CANT_CREATE: NTSTATUS = 0xC002004C; +pub const RPC_NT_INVALID_OBJECT: NTSTATUS = 0xC002004D; +pub const RPC_NT_NO_INTERFACES: NTSTATUS = 0xC002004F; +pub const RPC_NT_CALL_CANCELLED: NTSTATUS = 0xC0020050; +pub const RPC_NT_BINDING_INCOMPLETE: NTSTATUS = 0xC0020051; +pub const RPC_NT_COMM_FAILURE: NTSTATUS = 0xC0020052; +pub const RPC_NT_UNSUPPORTED_AUTHN_LEVEL: NTSTATUS = 0xC0020053; +pub const RPC_NT_NO_PRINC_NAME: NTSTATUS = 0xC0020054; +pub const RPC_NT_NOT_RPC_ERROR: NTSTATUS = 0xC0020055; +pub const RPC_NT_UUID_LOCAL_ONLY: NTSTATUS = 0x40020056; +pub const RPC_NT_SEC_PKG_ERROR: NTSTATUS = 0xC0020057; +pub const RPC_NT_NOT_CANCELLED: NTSTATUS = 0xC0020058; +pub const RPC_NT_INVALID_ES_ACTION: NTSTATUS = 0xC0030059; +pub const RPC_NT_WRONG_ES_VERSION: NTSTATUS = 0xC003005A; +pub const RPC_NT_WRONG_STUB_VERSION: NTSTATUS = 0xC003005B; +pub const RPC_NT_INVALID_PIPE_OBJECT: NTSTATUS = 0xC003005C; +pub const RPC_NT_INVALID_PIPE_OPERATION: NTSTATUS = 0xC003005D; +pub const RPC_NT_WRONG_PIPE_VERSION: NTSTATUS = 0xC003005E; +pub const RPC_NT_PIPE_CLOSED: NTSTATUS = 0xC003005F; +pub const RPC_NT_PIPE_DISCIPLINE_ERROR: NTSTATUS = 0xC0030060; +pub const RPC_NT_PIPE_EMPTY: NTSTATUS = 0xC0030061; +pub const RPC_NT_INVALID_ASYNC_HANDLE: NTSTATUS = 0xC0020062; +pub const RPC_NT_INVALID_ASYNC_CALL: NTSTATUS = 0xC0020063; +pub const RPC_NT_PROXY_ACCESS_DENIED: NTSTATUS = 0xC0020064; +pub const RPC_NT_COOKIE_AUTH_FAILED: NTSTATUS = 0xC0020065; +pub const RPC_NT_SEND_INCOMPLETE: NTSTATUS = 0x400200AF; +pub const STATUS_ACPI_INVALID_OPCODE: NTSTATUS = 0xC0140001; +pub const STATUS_ACPI_STACK_OVERFLOW: NTSTATUS = 0xC0140002; +pub const STATUS_ACPI_ASSERT_FAILED: NTSTATUS = 0xC0140003; +pub const STATUS_ACPI_INVALID_INDEX: NTSTATUS = 0xC0140004; +pub const STATUS_ACPI_INVALID_ARGUMENT: NTSTATUS = 0xC0140005; +pub const STATUS_ACPI_FATAL: NTSTATUS = 0xC0140006; +pub const STATUS_ACPI_INVALID_SUPERNAME: NTSTATUS = 0xC0140007; +pub const STATUS_ACPI_INVALID_ARGTYPE: NTSTATUS = 0xC0140008; +pub const STATUS_ACPI_INVALID_OBJTYPE: NTSTATUS = 0xC0140009; +pub const STATUS_ACPI_INVALID_TARGETTYPE: NTSTATUS = 0xC014000A; +pub const STATUS_ACPI_INCORRECT_ARGUMENT_COUNT: NTSTATUS = 0xC014000B; +pub const STATUS_ACPI_ADDRESS_NOT_MAPPED: NTSTATUS = 0xC014000C; +pub const STATUS_ACPI_INVALID_EVENTTYPE: NTSTATUS = 0xC014000D; +pub const STATUS_ACPI_HANDLER_COLLISION: NTSTATUS = 0xC014000E; +pub const STATUS_ACPI_INVALID_DATA: NTSTATUS = 0xC014000F; +pub const STATUS_ACPI_INVALID_REGION: NTSTATUS = 0xC0140010; +pub const STATUS_ACPI_INVALID_ACCESS_SIZE: NTSTATUS = 0xC0140011; +pub const STATUS_ACPI_ACQUIRE_GLOBAL_LOCK: NTSTATUS = 0xC0140012; +pub const STATUS_ACPI_ALREADY_INITIALIZED: NTSTATUS = 0xC0140013; +pub const STATUS_ACPI_NOT_INITIALIZED: NTSTATUS = 0xC0140014; +pub const STATUS_ACPI_INVALID_MUTEX_LEVEL: NTSTATUS = 0xC0140015; +pub const STATUS_ACPI_MUTEX_NOT_OWNED: NTSTATUS = 0xC0140016; +pub const STATUS_ACPI_MUTEX_NOT_OWNER: NTSTATUS = 0xC0140017; +pub const STATUS_ACPI_RS_ACCESS: NTSTATUS = 0xC0140018; +pub const STATUS_ACPI_INVALID_TABLE: NTSTATUS = 0xC0140019; +pub const STATUS_ACPI_REG_HANDLER_FAILED: NTSTATUS = 0xC0140020; +pub const STATUS_ACPI_POWER_REQUEST_FAILED: NTSTATUS = 0xC0140021; +pub const STATUS_CTX_WINSTATION_NAME_INVALID: NTSTATUS = 0xC00A0001; +pub const STATUS_CTX_INVALID_PD: NTSTATUS = 0xC00A0002; +pub const STATUS_CTX_PD_NOT_FOUND: NTSTATUS = 0xC00A0003; +pub const STATUS_CTX_CDM_CONNECT: NTSTATUS = 0x400A0004; +pub const STATUS_CTX_CDM_DISCONNECT: NTSTATUS = 0x400A0005; +pub const STATUS_CTX_CLOSE_PENDING: NTSTATUS = 0xC00A0006; +pub const STATUS_CTX_NO_OUTBUF: NTSTATUS = 0xC00A0007; +pub const STATUS_CTX_MODEM_INF_NOT_FOUND: NTSTATUS = 0xC00A0008; +pub const STATUS_CTX_INVALID_MODEMNAME: NTSTATUS = 0xC00A0009; +pub const STATUS_CTX_RESPONSE_ERROR: NTSTATUS = 0xC00A000A; +pub const STATUS_CTX_MODEM_RESPONSE_TIMEOUT: NTSTATUS = 0xC00A000B; +pub const STATUS_CTX_MODEM_RESPONSE_NO_CARRIER: NTSTATUS = 0xC00A000C; +pub const STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE: NTSTATUS = 0xC00A000D; +pub const STATUS_CTX_MODEM_RESPONSE_BUSY: NTSTATUS = 0xC00A000E; +pub const STATUS_CTX_MODEM_RESPONSE_VOICE: NTSTATUS = 0xC00A000F; +pub const STATUS_CTX_TD_ERROR: NTSTATUS = 0xC00A0010; +pub const STATUS_CTX_LICENSE_CLIENT_INVALID: NTSTATUS = 0xC00A0012; +pub const STATUS_CTX_LICENSE_NOT_AVAILABLE: NTSTATUS = 0xC00A0013; +pub const STATUS_CTX_LICENSE_EXPIRED: NTSTATUS = 0xC00A0014; +pub const STATUS_CTX_WINSTATION_NOT_FOUND: NTSTATUS = 0xC00A0015; +pub const STATUS_CTX_WINSTATION_NAME_COLLISION: NTSTATUS = 0xC00A0016; +pub const STATUS_CTX_WINSTATION_BUSY: NTSTATUS = 0xC00A0017; +pub const STATUS_CTX_BAD_VIDEO_MODE: NTSTATUS = 0xC00A0018; +pub const STATUS_CTX_GRAPHICS_INVALID: NTSTATUS = 0xC00A0022; +pub const STATUS_CTX_NOT_CONSOLE: NTSTATUS = 0xC00A0024; +pub const STATUS_CTX_CLIENT_QUERY_TIMEOUT: NTSTATUS = 0xC00A0026; +pub const STATUS_CTX_CONSOLE_DISCONNECT: NTSTATUS = 0xC00A0027; +pub const STATUS_CTX_CONSOLE_CONNECT: NTSTATUS = 0xC00A0028; +pub const STATUS_CTX_SHADOW_DENIED: NTSTATUS = 0xC00A002A; +pub const STATUS_CTX_WINSTATION_ACCESS_DENIED: NTSTATUS = 0xC00A002B; +pub const STATUS_CTX_INVALID_WD: NTSTATUS = 0xC00A002E; +pub const STATUS_CTX_WD_NOT_FOUND: NTSTATUS = 0xC00A002F; +pub const STATUS_CTX_SHADOW_INVALID: NTSTATUS = 0xC00A0030; +pub const STATUS_CTX_SHADOW_DISABLED: NTSTATUS = 0xC00A0031; +pub const STATUS_RDP_PROTOCOL_ERROR: NTSTATUS = 0xC00A0032; +pub const STATUS_CTX_CLIENT_LICENSE_NOT_SET: NTSTATUS = 0xC00A0033; +pub const STATUS_CTX_CLIENT_LICENSE_IN_USE: NTSTATUS = 0xC00A0034; +pub const STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE: NTSTATUS = 0xC00A0035; +pub const STATUS_CTX_SHADOW_NOT_RUNNING: NTSTATUS = 0xC00A0036; +pub const STATUS_CTX_LOGON_DISABLED: NTSTATUS = 0xC00A0037; +pub const STATUS_CTX_SECURITY_LAYER_ERROR: NTSTATUS = 0xC00A0038; +pub const STATUS_TS_INCOMPATIBLE_SESSIONS: NTSTATUS = 0xC00A0039; +pub const STATUS_TS_VIDEO_SUBSYSTEM_ERROR: NTSTATUS = 0xC00A003A; +pub const STATUS_PNP_BAD_MPS_TABLE: NTSTATUS = 0xC0040035; +pub const STATUS_PNP_TRANSLATION_FAILED: NTSTATUS = 0xC0040036; +pub const STATUS_PNP_IRQ_TRANSLATION_FAILED: NTSTATUS = 0xC0040037; +pub const STATUS_PNP_INVALID_ID: NTSTATUS = 0xC0040038; +pub const STATUS_IO_REISSUE_AS_CACHED: NTSTATUS = 0xC0040039; +pub const STATUS_MUI_FILE_NOT_FOUND: NTSTATUS = 0xC00B0001; +pub const STATUS_MUI_INVALID_FILE: NTSTATUS = 0xC00B0002; +pub const STATUS_MUI_INVALID_RC_CONFIG: NTSTATUS = 0xC00B0003; +pub const STATUS_MUI_INVALID_LOCALE_NAME: NTSTATUS = 0xC00B0004; +pub const STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME: NTSTATUS = 0xC00B0005; +pub const STATUS_MUI_FILE_NOT_LOADED: NTSTATUS = 0xC00B0006; +pub const STATUS_RESOURCE_ENUM_USER_STOP: NTSTATUS = 0xC00B0007; +//FILTER_FLT_NTSTATUS_FROM_HRESULT +pub const STATUS_FLT_NO_HANDLER_DEFINED: NTSTATUS = 0xC01C0001; +pub const STATUS_FLT_CONTEXT_ALREADY_DEFINED: NTSTATUS = 0xC01C0002; +pub const STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST: NTSTATUS = 0xC01C0003; +pub const STATUS_FLT_DISALLOW_FAST_IO: NTSTATUS = 0xC01C0004; +pub const STATUS_FLT_INVALID_NAME_REQUEST: NTSTATUS = 0xC01C0005; +pub const STATUS_FLT_NOT_SAFE_TO_POST_OPERATION: NTSTATUS = 0xC01C0006; +pub const STATUS_FLT_NOT_INITIALIZED: NTSTATUS = 0xC01C0007; +pub const STATUS_FLT_FILTER_NOT_READY: NTSTATUS = 0xC01C0008; +pub const STATUS_FLT_POST_OPERATION_CLEANUP: NTSTATUS = 0xC01C0009; +pub const STATUS_FLT_INTERNAL_ERROR: NTSTATUS = 0xC01C000A; +pub const STATUS_FLT_DELETING_OBJECT: NTSTATUS = 0xC01C000B; +pub const STATUS_FLT_MUST_BE_NONPAGED_POOL: NTSTATUS = 0xC01C000C; +pub const STATUS_FLT_DUPLICATE_ENTRY: NTSTATUS = 0xC01C000D; +pub const STATUS_FLT_CBDQ_DISABLED: NTSTATUS = 0xC01C000E; +pub const STATUS_FLT_DO_NOT_ATTACH: NTSTATUS = 0xC01C000F; +pub const STATUS_FLT_DO_NOT_DETACH: NTSTATUS = 0xC01C0010; +pub const STATUS_FLT_INSTANCE_ALTITUDE_COLLISION: NTSTATUS = 0xC01C0011; +pub const STATUS_FLT_INSTANCE_NAME_COLLISION: NTSTATUS = 0xC01C0012; +pub const STATUS_FLT_FILTER_NOT_FOUND: NTSTATUS = 0xC01C0013; +pub const STATUS_FLT_VOLUME_NOT_FOUND: NTSTATUS = 0xC01C0014; +pub const STATUS_FLT_INSTANCE_NOT_FOUND: NTSTATUS = 0xC01C0015; +pub const STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND: NTSTATUS = 0xC01C0016; +pub const STATUS_FLT_INVALID_CONTEXT_REGISTRATION: NTSTATUS = 0xC01C0017; +pub const STATUS_FLT_NAME_CACHE_MISS: NTSTATUS = 0xC01C0018; +pub const STATUS_FLT_NO_DEVICE_OBJECT: NTSTATUS = 0xC01C0019; +pub const STATUS_FLT_VOLUME_ALREADY_MOUNTED: NTSTATUS = 0xC01C001A; +pub const STATUS_FLT_ALREADY_ENLISTED: NTSTATUS = 0xC01C001B; +pub const STATUS_FLT_CONTEXT_ALREADY_LINKED: NTSTATUS = 0xC01C001C; +pub const STATUS_FLT_NO_WAITER_FOR_REPLY: NTSTATUS = 0xC01C0020; +pub const STATUS_FLT_REGISTRATION_BUSY: NTSTATUS = 0xC01C0023; +pub const STATUS_SXS_SECTION_NOT_FOUND: NTSTATUS = 0xC0150001; +pub const STATUS_SXS_CANT_GEN_ACTCTX: NTSTATUS = 0xC0150002; +pub const STATUS_SXS_INVALID_ACTCTXDATA_FORMAT: NTSTATUS = 0xC0150003; +pub const STATUS_SXS_ASSEMBLY_NOT_FOUND: NTSTATUS = 0xC0150004; +pub const STATUS_SXS_MANIFEST_FORMAT_ERROR: NTSTATUS = 0xC0150005; +pub const STATUS_SXS_MANIFEST_PARSE_ERROR: NTSTATUS = 0xC0150006; +pub const STATUS_SXS_ACTIVATION_CONTEXT_DISABLED: NTSTATUS = 0xC0150007; +pub const STATUS_SXS_KEY_NOT_FOUND: NTSTATUS = 0xC0150008; +pub const STATUS_SXS_VERSION_CONFLICT: NTSTATUS = 0xC0150009; +pub const STATUS_SXS_WRONG_SECTION_TYPE: NTSTATUS = 0xC015000A; +pub const STATUS_SXS_THREAD_QUERIES_DISABLED: NTSTATUS = 0xC015000B; +pub const STATUS_SXS_ASSEMBLY_MISSING: NTSTATUS = 0xC015000C; +pub const STATUS_SXS_RELEASE_ACTIVATION_CONTEXT: NTSTATUS = 0x4015000D; +pub const STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET: NTSTATUS = 0xC015000E; +pub const STATUS_SXS_EARLY_DEACTIVATION: NTSTATUS = 0xC015000F; +pub const STATUS_SXS_INVALID_DEACTIVATION: NTSTATUS = 0xC0150010; +pub const STATUS_SXS_MULTIPLE_DEACTIVATION: NTSTATUS = 0xC0150011; +pub const STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY: NTSTATUS = 0xC0150012; +pub const STATUS_SXS_PROCESS_TERMINATION_REQUESTED: NTSTATUS = 0xC0150013; +pub const STATUS_SXS_CORRUPT_ACTIVATION_STACK: NTSTATUS = 0xC0150014; +pub const STATUS_SXS_CORRUPTION: NTSTATUS = 0xC0150015; +pub const STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE: NTSTATUS = 0xC0150016; +pub const STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME: NTSTATUS = 0xC0150017; +pub const STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE: NTSTATUS = 0xC0150018; +pub const STATUS_SXS_IDENTITY_PARSE_ERROR: NTSTATUS = 0xC0150019; +pub const STATUS_SXS_COMPONENT_STORE_CORRUPT: NTSTATUS = 0xC015001A; +pub const STATUS_SXS_FILE_HASH_MISMATCH: NTSTATUS = 0xC015001B; +pub const STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT: NTSTATUS + = 0xC015001C; +pub const STATUS_SXS_IDENTITIES_DIFFERENT: NTSTATUS = 0xC015001D; +pub const STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT: NTSTATUS = 0xC015001E; +pub const STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY: NTSTATUS = 0xC015001F; +pub const STATUS_ADVANCED_INSTALLER_FAILED: NTSTATUS = 0xC0150020; +pub const STATUS_XML_ENCODING_MISMATCH: NTSTATUS = 0xC0150021; +pub const STATUS_SXS_MANIFEST_TOO_BIG: NTSTATUS = 0xC0150022; +pub const STATUS_SXS_SETTING_NOT_REGISTERED: NTSTATUS = 0xC0150023; +pub const STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE: NTSTATUS = 0xC0150024; +pub const STATUS_SMI_PRIMITIVE_INSTALLER_FAILED: NTSTATUS = 0xC0150025; +pub const STATUS_GENERIC_COMMAND_FAILED: NTSTATUS = 0xC0150026; +pub const STATUS_SXS_FILE_HASH_MISSING: NTSTATUS = 0xC0150027; +pub const STATUS_CLUSTER_INVALID_NODE: NTSTATUS = 0xC0130001; +pub const STATUS_CLUSTER_NODE_EXISTS: NTSTATUS = 0xC0130002; +pub const STATUS_CLUSTER_JOIN_IN_PROGRESS: NTSTATUS = 0xC0130003; +pub const STATUS_CLUSTER_NODE_NOT_FOUND: NTSTATUS = 0xC0130004; +pub const STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND: NTSTATUS = 0xC0130005; +pub const STATUS_CLUSTER_NETWORK_EXISTS: NTSTATUS = 0xC0130006; +pub const STATUS_CLUSTER_NETWORK_NOT_FOUND: NTSTATUS = 0xC0130007; +pub const STATUS_CLUSTER_NETINTERFACE_EXISTS: NTSTATUS = 0xC0130008; +pub const STATUS_CLUSTER_NETINTERFACE_NOT_FOUND: NTSTATUS = 0xC0130009; +pub const STATUS_CLUSTER_INVALID_REQUEST: NTSTATUS = 0xC013000A; +pub const STATUS_CLUSTER_INVALID_NETWORK_PROVIDER: NTSTATUS = 0xC013000B; +pub const STATUS_CLUSTER_NODE_DOWN: NTSTATUS = 0xC013000C; +pub const STATUS_CLUSTER_NODE_UNREACHABLE: NTSTATUS = 0xC013000D; +pub const STATUS_CLUSTER_NODE_NOT_MEMBER: NTSTATUS = 0xC013000E; +pub const STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS: NTSTATUS = 0xC013000F; +pub const STATUS_CLUSTER_INVALID_NETWORK: NTSTATUS = 0xC0130010; +pub const STATUS_CLUSTER_NO_NET_ADAPTERS: NTSTATUS = 0xC0130011; +pub const STATUS_CLUSTER_NODE_UP: NTSTATUS = 0xC0130012; +pub const STATUS_CLUSTER_NODE_PAUSED: NTSTATUS = 0xC0130013; +pub const STATUS_CLUSTER_NODE_NOT_PAUSED: NTSTATUS = 0xC0130014; +pub const STATUS_CLUSTER_NO_SECURITY_CONTEXT: NTSTATUS = 0xC0130015; +pub const STATUS_CLUSTER_NETWORK_NOT_INTERNAL: NTSTATUS = 0xC0130016; +pub const STATUS_CLUSTER_POISONED: NTSTATUS = 0xC0130017; +pub const STATUS_CLUSTER_NON_CSV_PATH: NTSTATUS = 0xC0130018; +pub const STATUS_CLUSTER_CSV_VOLUME_NOT_LOCAL: NTSTATUS = 0xC0130019; +pub const STATUS_CLUSTER_CSV_READ_OPLOCK_BREAK_IN_PROGRESS: NTSTATUS = 0xC0130020; +pub const STATUS_CLUSTER_CSV_AUTO_PAUSE_ERROR: NTSTATUS = 0xC0130021; +pub const STATUS_CLUSTER_CSV_REDIRECTED: NTSTATUS = 0xC0130022; +pub const STATUS_CLUSTER_CSV_NOT_REDIRECTED: NTSTATUS = 0xC0130023; +pub const STATUS_CLUSTER_CSV_VOLUME_DRAINING: NTSTATUS = 0xC0130024; +pub const STATUS_CLUSTER_CSV_SNAPSHOT_CREATION_IN_PROGRESS: NTSTATUS = 0xC0130025; +pub const STATUS_CLUSTER_CSV_VOLUME_DRAINING_SUCCEEDED_DOWNLEVEL: NTSTATUS = 0xC0130026; +pub const STATUS_CLUSTER_CSV_NO_SNAPSHOTS: NTSTATUS = 0xC0130027; +pub const STATUS_CSV_IO_PAUSE_TIMEOUT: NTSTATUS = 0xC0130028; +pub const STATUS_CLUSTER_CSV_INVALID_HANDLE: NTSTATUS = 0xC0130029; +pub const STATUS_CLUSTER_CSV_SUPPORTED_ONLY_ON_COORDINATOR: NTSTATUS = 0xC0130030; +pub const STATUS_TRANSACTIONAL_CONFLICT: NTSTATUS = 0xC0190001; +pub const STATUS_INVALID_TRANSACTION: NTSTATUS = 0xC0190002; +pub const STATUS_TRANSACTION_NOT_ACTIVE: NTSTATUS = 0xC0190003; +pub const STATUS_TM_INITIALIZATION_FAILED: NTSTATUS = 0xC0190004; +pub const STATUS_RM_NOT_ACTIVE: NTSTATUS = 0xC0190005; +pub const STATUS_RM_METADATA_CORRUPT: NTSTATUS = 0xC0190006; +pub const STATUS_TRANSACTION_NOT_JOINED: NTSTATUS = 0xC0190007; +pub const STATUS_DIRECTORY_NOT_RM: NTSTATUS = 0xC0190008; +pub const STATUS_COULD_NOT_RESIZE_LOG: NTSTATUS = 0x80190009; +pub const STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE: NTSTATUS = 0xC019000A; +pub const STATUS_LOG_RESIZE_INVALID_SIZE: NTSTATUS = 0xC019000B; +pub const STATUS_REMOTE_FILE_VERSION_MISMATCH: NTSTATUS = 0xC019000C; +pub const STATUS_CRM_PROTOCOL_ALREADY_EXISTS: NTSTATUS = 0xC019000F; +pub const STATUS_TRANSACTION_PROPAGATION_FAILED: NTSTATUS = 0xC0190010; +pub const STATUS_CRM_PROTOCOL_NOT_FOUND: NTSTATUS = 0xC0190011; +pub const STATUS_TRANSACTION_SUPERIOR_EXISTS: NTSTATUS = 0xC0190012; +pub const STATUS_TRANSACTION_REQUEST_NOT_VALID: NTSTATUS = 0xC0190013; +pub const STATUS_TRANSACTION_NOT_REQUESTED: NTSTATUS = 0xC0190014; +pub const STATUS_TRANSACTION_ALREADY_ABORTED: NTSTATUS = 0xC0190015; +pub const STATUS_TRANSACTION_ALREADY_COMMITTED: NTSTATUS = 0xC0190016; +pub const STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER: NTSTATUS = 0xC0190017; +pub const STATUS_CURRENT_TRANSACTION_NOT_VALID: NTSTATUS = 0xC0190018; +pub const STATUS_LOG_GROWTH_FAILED: NTSTATUS = 0xC0190019; +pub const STATUS_OBJECT_NO_LONGER_EXISTS: NTSTATUS = 0xC0190021; +pub const STATUS_STREAM_MINIVERSION_NOT_FOUND: NTSTATUS = 0xC0190022; +pub const STATUS_STREAM_MINIVERSION_NOT_VALID: NTSTATUS = 0xC0190023; +pub const STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION: NTSTATUS + = 0xC0190024; +pub const STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT: NTSTATUS = 0xC0190025; +pub const STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS: NTSTATUS = 0xC0190026; +pub const STATUS_HANDLE_NO_LONGER_VALID: NTSTATUS = 0xC0190028; +pub const STATUS_NO_TXF_METADATA: NTSTATUS = 0x80190029; +pub const STATUS_LOG_CORRUPTION_DETECTED: NTSTATUS = 0xC0190030; +pub const STATUS_CANT_RECOVER_WITH_HANDLE_OPEN: NTSTATUS = 0x80190031; +pub const STATUS_RM_DISCONNECTED: NTSTATUS = 0xC0190032; +pub const STATUS_ENLISTMENT_NOT_SUPERIOR: NTSTATUS = 0xC0190033; +pub const STATUS_RECOVERY_NOT_NEEDED: NTSTATUS = 0x40190034; +pub const STATUS_RM_ALREADY_STARTED: NTSTATUS = 0x40190035; +pub const STATUS_FILE_IDENTITY_NOT_PERSISTENT: NTSTATUS = 0xC0190036; +pub const STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY: NTSTATUS = 0xC0190037; +pub const STATUS_CANT_CROSS_RM_BOUNDARY: NTSTATUS = 0xC0190038; +pub const STATUS_TXF_DIR_NOT_EMPTY: NTSTATUS = 0xC0190039; +pub const STATUS_INDOUBT_TRANSACTIONS_EXIST: NTSTATUS = 0xC019003A; +pub const STATUS_TM_VOLATILE: NTSTATUS = 0xC019003B; +pub const STATUS_ROLLBACK_TIMER_EXPIRED: NTSTATUS = 0xC019003C; +pub const STATUS_TXF_ATTRIBUTE_CORRUPT: NTSTATUS = 0xC019003D; +pub const STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION: NTSTATUS = 0xC019003E; +pub const STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED: NTSTATUS = 0xC019003F; +pub const STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE: NTSTATUS = 0xC0190040; +pub const STATUS_TXF_METADATA_ALREADY_PRESENT: NTSTATUS = 0x80190041; +pub const STATUS_TRANSACTION_SCOPE_CALLBACKS_NOT_SET: NTSTATUS = 0x80190042; +pub const STATUS_TRANSACTION_REQUIRED_PROMOTION: NTSTATUS = 0xC0190043; +pub const STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION: NTSTATUS = 0xC0190044; +pub const STATUS_TRANSACTIONS_NOT_FROZEN: NTSTATUS = 0xC0190045; +pub const STATUS_TRANSACTION_FREEZE_IN_PROGRESS: NTSTATUS = 0xC0190046; +pub const STATUS_NOT_SNAPSHOT_VOLUME: NTSTATUS = 0xC0190047; +pub const STATUS_NO_SAVEPOINT_WITH_OPEN_FILES: NTSTATUS = 0xC0190048; +pub const STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION: NTSTATUS = 0xC0190049; +pub const STATUS_TM_IDENTITY_MISMATCH: NTSTATUS = 0xC019004A; +pub const STATUS_FLOATED_SECTION: NTSTATUS = 0xC019004B; +pub const STATUS_CANNOT_ACCEPT_TRANSACTED_WORK: NTSTATUS = 0xC019004C; +pub const STATUS_CANNOT_ABORT_TRANSACTIONS: NTSTATUS = 0xC019004D; +pub const STATUS_TRANSACTION_NOT_FOUND: NTSTATUS = 0xC019004E; +pub const STATUS_RESOURCEMANAGER_NOT_FOUND: NTSTATUS = 0xC019004F; +pub const STATUS_ENLISTMENT_NOT_FOUND: NTSTATUS = 0xC0190050; +pub const STATUS_TRANSACTIONMANAGER_NOT_FOUND: NTSTATUS = 0xC0190051; +pub const STATUS_TRANSACTIONMANAGER_NOT_ONLINE: NTSTATUS = 0xC0190052; +pub const STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION: NTSTATUS = 0xC0190053; +pub const STATUS_TRANSACTION_NOT_ROOT: NTSTATUS = 0xC0190054; +pub const STATUS_TRANSACTION_OBJECT_EXPIRED: NTSTATUS = 0xC0190055; +pub const STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION: NTSTATUS = 0xC0190056; +pub const STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED: NTSTATUS = 0xC0190057; +pub const STATUS_TRANSACTION_RECORD_TOO_LONG: NTSTATUS = 0xC0190058; +pub const STATUS_NO_LINK_TRACKING_IN_TRANSACTION: NTSTATUS = 0xC0190059; +pub const STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION: NTSTATUS = 0xC019005A; +pub const STATUS_TRANSACTION_INTEGRITY_VIOLATED: NTSTATUS = 0xC019005B; +pub const STATUS_TRANSACTIONMANAGER_IDENTITY_MISMATCH: NTSTATUS = 0xC019005C; +pub const STATUS_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT: NTSTATUS = 0xC019005D; +pub const STATUS_TRANSACTION_MUST_WRITETHROUGH: NTSTATUS = 0xC019005E; +pub const STATUS_TRANSACTION_NO_SUPERIOR: NTSTATUS = 0xC019005F; +pub const STATUS_EXPIRED_HANDLE: NTSTATUS = 0xC0190060; +pub const STATUS_TRANSACTION_NOT_ENLISTED: NTSTATUS = 0xC0190061; +pub const STATUS_LOG_SECTOR_INVALID: NTSTATUS = 0xC01A0001; +pub const STATUS_LOG_SECTOR_PARITY_INVALID: NTSTATUS = 0xC01A0002; +pub const STATUS_LOG_SECTOR_REMAPPED: NTSTATUS = 0xC01A0003; +pub const STATUS_LOG_BLOCK_INCOMPLETE: NTSTATUS = 0xC01A0004; +pub const STATUS_LOG_INVALID_RANGE: NTSTATUS = 0xC01A0005; +pub const STATUS_LOG_BLOCKS_EXHAUSTED: NTSTATUS = 0xC01A0006; +pub const STATUS_LOG_READ_CONTEXT_INVALID: NTSTATUS = 0xC01A0007; +pub const STATUS_LOG_RESTART_INVALID: NTSTATUS = 0xC01A0008; +pub const STATUS_LOG_BLOCK_VERSION: NTSTATUS = 0xC01A0009; +pub const STATUS_LOG_BLOCK_INVALID: NTSTATUS = 0xC01A000A; +pub const STATUS_LOG_READ_MODE_INVALID: NTSTATUS = 0xC01A000B; +pub const STATUS_LOG_NO_RESTART: NTSTATUS = 0x401A000C; +pub const STATUS_LOG_METADATA_CORRUPT: NTSTATUS = 0xC01A000D; +pub const STATUS_LOG_METADATA_INVALID: NTSTATUS = 0xC01A000E; +pub const STATUS_LOG_METADATA_INCONSISTENT: NTSTATUS = 0xC01A000F; +pub const STATUS_LOG_RESERVATION_INVALID: NTSTATUS = 0xC01A0010; +pub const STATUS_LOG_CANT_DELETE: NTSTATUS = 0xC01A0011; +pub const STATUS_LOG_CONTAINER_LIMIT_EXCEEDED: NTSTATUS = 0xC01A0012; +pub const STATUS_LOG_START_OF_LOG: NTSTATUS = 0xC01A0013; +pub const STATUS_LOG_POLICY_ALREADY_INSTALLED: NTSTATUS = 0xC01A0014; +pub const STATUS_LOG_POLICY_NOT_INSTALLED: NTSTATUS = 0xC01A0015; +pub const STATUS_LOG_POLICY_INVALID: NTSTATUS = 0xC01A0016; +pub const STATUS_LOG_POLICY_CONFLICT: NTSTATUS = 0xC01A0017; +pub const STATUS_LOG_PINNED_ARCHIVE_TAIL: NTSTATUS = 0xC01A0018; +pub const STATUS_LOG_RECORD_NONEXISTENT: NTSTATUS = 0xC01A0019; +pub const STATUS_LOG_RECORDS_RESERVED_INVALID: NTSTATUS = 0xC01A001A; +pub const STATUS_LOG_SPACE_RESERVED_INVALID: NTSTATUS = 0xC01A001B; +pub const STATUS_LOG_TAIL_INVALID: NTSTATUS = 0xC01A001C; +pub const STATUS_LOG_FULL: NTSTATUS = 0xC01A001D; +pub const STATUS_LOG_MULTIPLEXED: NTSTATUS = 0xC01A001E; +pub const STATUS_LOG_DEDICATED: NTSTATUS = 0xC01A001F; +pub const STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS: NTSTATUS = 0xC01A0020; +pub const STATUS_LOG_ARCHIVE_IN_PROGRESS: NTSTATUS = 0xC01A0021; +pub const STATUS_LOG_EPHEMERAL: NTSTATUS = 0xC01A0022; +pub const STATUS_LOG_NOT_ENOUGH_CONTAINERS: NTSTATUS = 0xC01A0023; +pub const STATUS_LOG_CLIENT_ALREADY_REGISTERED: NTSTATUS = 0xC01A0024; +pub const STATUS_LOG_CLIENT_NOT_REGISTERED: NTSTATUS = 0xC01A0025; +pub const STATUS_LOG_FULL_HANDLER_IN_PROGRESS: NTSTATUS = 0xC01A0026; +pub const STATUS_LOG_CONTAINER_READ_FAILED: NTSTATUS = 0xC01A0027; +pub const STATUS_LOG_CONTAINER_WRITE_FAILED: NTSTATUS = 0xC01A0028; +pub const STATUS_LOG_CONTAINER_OPEN_FAILED: NTSTATUS = 0xC01A0029; +pub const STATUS_LOG_CONTAINER_STATE_INVALID: NTSTATUS = 0xC01A002A; +pub const STATUS_LOG_STATE_INVALID: NTSTATUS = 0xC01A002B; +pub const STATUS_LOG_PINNED: NTSTATUS = 0xC01A002C; +pub const STATUS_LOG_METADATA_FLUSH_FAILED: NTSTATUS = 0xC01A002D; +pub const STATUS_LOG_INCONSISTENT_SECURITY: NTSTATUS = 0xC01A002E; +pub const STATUS_LOG_APPENDED_FLUSH_FAILED: NTSTATUS = 0xC01A002F; +pub const STATUS_LOG_PINNED_RESERVATION: NTSTATUS = 0xC01A0030; +pub const STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD: NTSTATUS = 0xC01B00EA; +pub const STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD_RECOVERED: NTSTATUS = 0x801B00EB; +pub const STATUS_VIDEO_DRIVER_DEBUG_REPORT_REQUEST: NTSTATUS = 0x401B00EC; +pub const STATUS_MONITOR_NO_DESCRIPTOR: NTSTATUS = 0xC01D0001; +pub const STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT: NTSTATUS = 0xC01D0002; +pub const STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM: NTSTATUS = 0xC01D0003; +pub const STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK: NTSTATUS = 0xC01D0004; +pub const STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED: NTSTATUS = 0xC01D0005; +pub const STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK: NTSTATUS = 0xC01D0006; +pub const STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK: NTSTATUS = 0xC01D0007; +pub const STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA: NTSTATUS = 0xC01D0008; +pub const STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK: NTSTATUS = 0xC01D0009; +pub const STATUS_MONITOR_INVALID_MANUFACTURE_DATE: NTSTATUS = 0xC01D000A; +pub const STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER: NTSTATUS = 0xC01E0000; +pub const STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER: NTSTATUS = 0xC01E0001; +pub const STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER: NTSTATUS = 0xC01E0002; +pub const STATUS_GRAPHICS_ADAPTER_WAS_RESET: NTSTATUS = 0xC01E0003; +pub const STATUS_GRAPHICS_INVALID_DRIVER_MODEL: NTSTATUS = 0xC01E0004; +pub const STATUS_GRAPHICS_PRESENT_MODE_CHANGED: NTSTATUS = 0xC01E0005; +pub const STATUS_GRAPHICS_PRESENT_OCCLUDED: NTSTATUS = 0xC01E0006; +pub const STATUS_GRAPHICS_PRESENT_DENIED: NTSTATUS = 0xC01E0007; +pub const STATUS_GRAPHICS_CANNOTCOLORCONVERT: NTSTATUS = 0xC01E0008; +pub const STATUS_GRAPHICS_DRIVER_MISMATCH: NTSTATUS = 0xC01E0009; +pub const STATUS_GRAPHICS_PARTIAL_DATA_POPULATED: NTSTATUS = 0x401E000A; +pub const STATUS_GRAPHICS_PRESENT_REDIRECTION_DISABLED: NTSTATUS = 0xC01E000B; +pub const STATUS_GRAPHICS_PRESENT_UNOCCLUDED: NTSTATUS = 0xC01E000C; +pub const STATUS_GRAPHICS_WINDOWDC_NOT_AVAILABLE: NTSTATUS = 0xC01E000D; +pub const STATUS_GRAPHICS_WINDOWLESS_PRESENT_DISABLED: NTSTATUS = 0xC01E000E; +pub const STATUS_GRAPHICS_NO_VIDEO_MEMORY: NTSTATUS = 0xC01E0100; +pub const STATUS_GRAPHICS_CANT_LOCK_MEMORY: NTSTATUS = 0xC01E0101; +pub const STATUS_GRAPHICS_ALLOCATION_BUSY: NTSTATUS = 0xC01E0102; +pub const STATUS_GRAPHICS_TOO_MANY_REFERENCES: NTSTATUS = 0xC01E0103; +pub const STATUS_GRAPHICS_TRY_AGAIN_LATER: NTSTATUS = 0xC01E0104; +pub const STATUS_GRAPHICS_TRY_AGAIN_NOW: NTSTATUS = 0xC01E0105; +pub const STATUS_GRAPHICS_ALLOCATION_INVALID: NTSTATUS = 0xC01E0106; +pub const STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE: NTSTATUS = 0xC01E0107; +pub const STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED: NTSTATUS = 0xC01E0108; +pub const STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION: NTSTATUS = 0xC01E0109; +pub const STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE: NTSTATUS = 0xC01E0110; +pub const STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION: NTSTATUS = 0xC01E0111; +pub const STATUS_GRAPHICS_ALLOCATION_CLOSED: NTSTATUS = 0xC01E0112; +pub const STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE: NTSTATUS = 0xC01E0113; +pub const STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE: NTSTATUS = 0xC01E0114; +pub const STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE: NTSTATUS = 0xC01E0115; +pub const STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST: NTSTATUS = 0xC01E0116; +pub const STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE: NTSTATUS = 0xC01E0200; +pub const STATUS_GRAPHICS_SKIP_ALLOCATION_PREPARATION: NTSTATUS = 0x401E0201; +pub const STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY: NTSTATUS = 0xC01E0300; +pub const STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED: NTSTATUS = 0xC01E0301; +pub const STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED: NTSTATUS = 0xC01E0302; +pub const STATUS_GRAPHICS_INVALID_VIDPN: NTSTATUS = 0xC01E0303; +pub const STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE: NTSTATUS = 0xC01E0304; +pub const STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET: NTSTATUS = 0xC01E0305; +pub const STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED: NTSTATUS = 0xC01E0306; +pub const STATUS_GRAPHICS_MODE_NOT_PINNED: NTSTATUS = 0x401E0307; +pub const STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET: NTSTATUS = 0xC01E0308; +pub const STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET: NTSTATUS = 0xC01E0309; +pub const STATUS_GRAPHICS_INVALID_FREQUENCY: NTSTATUS = 0xC01E030A; +pub const STATUS_GRAPHICS_INVALID_ACTIVE_REGION: NTSTATUS = 0xC01E030B; +pub const STATUS_GRAPHICS_INVALID_TOTAL_REGION: NTSTATUS = 0xC01E030C; +pub const STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE: NTSTATUS = 0xC01E0310; +pub const STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE: NTSTATUS = 0xC01E0311; +pub const STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET: NTSTATUS = 0xC01E0312; +pub const STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY: NTSTATUS = 0xC01E0313; +pub const STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET: NTSTATUS = 0xC01E0314; +pub const STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET: NTSTATUS = 0xC01E0315; +pub const STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET: NTSTATUS = 0xC01E0316; +pub const STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET: NTSTATUS = 0xC01E0317; +pub const STATUS_GRAPHICS_TARGET_ALREADY_IN_SET: NTSTATUS = 0xC01E0318; +pub const STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH: NTSTATUS = 0xC01E0319; +pub const STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY: NTSTATUS = 0xC01E031A; +pub const STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET: NTSTATUS = 0xC01E031B; +pub const STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE: NTSTATUS = 0xC01E031C; +pub const STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET: NTSTATUS = 0xC01E031D; +pub const STATUS_GRAPHICS_NO_PREFERRED_MODE: NTSTATUS = 0x401E031E; +pub const STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET: NTSTATUS = 0xC01E031F; +pub const STATUS_GRAPHICS_STALE_MODESET: NTSTATUS = 0xC01E0320; +pub const STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET: NTSTATUS = 0xC01E0321; +pub const STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE: NTSTATUS = 0xC01E0322; +pub const STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN: NTSTATUS = 0xC01E0323; +pub const STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE: NTSTATUS = 0xC01E0324; +pub const STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION: NTSTATUS + = 0xC01E0325; +pub const STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES: NTSTATUS = 0xC01E0326; +pub const STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY: NTSTATUS = 0xC01E0327; +pub const STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE: NTSTATUS = 0xC01E0328; +pub const STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET: NTSTATUS = 0xC01E0329; +pub const STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET: NTSTATUS = 0xC01E032A; +pub const STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR: NTSTATUS = 0xC01E032B; +pub const STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET: NTSTATUS = 0xC01E032C; +pub const STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET: NTSTATUS = 0xC01E032D; +pub const STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE: NTSTATUS = 0xC01E032E; +pub const STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE: NTSTATUS = 0xC01E032F; +pub const STATUS_GRAPHICS_RESOURCES_NOT_RELATED: NTSTATUS = 0xC01E0330; +pub const STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE: NTSTATUS = 0xC01E0331; +pub const STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE: NTSTATUS = 0xC01E0332; +pub const STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET: NTSTATUS = 0xC01E0333; +pub const STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER: NTSTATUS + = 0xC01E0334; +pub const STATUS_GRAPHICS_NO_VIDPNMGR: NTSTATUS = 0xC01E0335; +pub const STATUS_GRAPHICS_NO_ACTIVE_VIDPN: NTSTATUS = 0xC01E0336; +pub const STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY: NTSTATUS = 0xC01E0337; +pub const STATUS_GRAPHICS_MONITOR_NOT_CONNECTED: NTSTATUS = 0xC01E0338; +pub const STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY: NTSTATUS = 0xC01E0339; +pub const STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE: NTSTATUS = 0xC01E033A; +pub const STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE: NTSTATUS = 0xC01E033B; +pub const STATUS_GRAPHICS_INVALID_STRIDE: NTSTATUS = 0xC01E033C; +pub const STATUS_GRAPHICS_INVALID_PIXELFORMAT: NTSTATUS = 0xC01E033D; +pub const STATUS_GRAPHICS_INVALID_COLORBASIS: NTSTATUS = 0xC01E033E; +pub const STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE: NTSTATUS = 0xC01E033F; +pub const STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY: NTSTATUS = 0xC01E0340; +pub const STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT: NTSTATUS = 0xC01E0341; +pub const STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE: NTSTATUS = 0xC01E0342; +pub const STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN: NTSTATUS = 0xC01E0343; +pub const STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL: NTSTATUS = 0xC01E0344; +pub const STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION: NTSTATUS + = 0xC01E0345; +pub const STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED: NTSTATUS + = 0xC01E0346; +pub const STATUS_GRAPHICS_INVALID_GAMMA_RAMP: NTSTATUS = 0xC01E0347; +pub const STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED: NTSTATUS = 0xC01E0348; +pub const STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED: NTSTATUS = 0xC01E0349; +pub const STATUS_GRAPHICS_MODE_NOT_IN_MODESET: NTSTATUS = 0xC01E034A; +pub const STATUS_GRAPHICS_DATASET_IS_EMPTY: NTSTATUS = 0x401E034B; +pub const STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET: NTSTATUS = 0x401E034C; +pub const STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON: NTSTATUS + = 0xC01E034D; +pub const STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE: NTSTATUS = 0xC01E034E; +pub const STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE: NTSTATUS = 0xC01E034F; +pub const STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS: NTSTATUS = 0xC01E0350; +pub const STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_PINNED: NTSTATUS = 0x401E0351; +pub const STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING: NTSTATUS = 0xC01E0352; +pub const STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED: NTSTATUS = 0xC01E0353; +pub const STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS: NTSTATUS = 0xC01E0354; +pub const STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT: NTSTATUS = 0xC01E0355; +pub const STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM: NTSTATUS = 0xC01E0356; +pub const STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN: NTSTATUS = 0xC01E0357; +pub const STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT: NTSTATUS + = 0xC01E0358; +pub const STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED: NTSTATUS = 0xC01E0359; +pub const STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION: NTSTATUS = 0xC01E035A; +pub const STATUS_GRAPHICS_INVALID_CLIENT_TYPE: NTSTATUS = 0xC01E035B; +pub const STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET: NTSTATUS = 0xC01E035C; +pub const STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED: NTSTATUS = 0xC01E0400; +pub const STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED: NTSTATUS = 0xC01E0401; +pub const STATUS_GRAPHICS_UNKNOWN_CHILD_STATUS: NTSTATUS = 0x401E042F; +pub const STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER: NTSTATUS = 0xC01E0430; +pub const STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED: NTSTATUS = 0xC01E0431; +pub const STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED: NTSTATUS = 0xC01E0432; +pub const STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY: NTSTATUS = 0xC01E0433; +pub const STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED: NTSTATUS = 0xC01E0434; +pub const STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON: NTSTATUS = 0xC01E0435; +pub const STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE: NTSTATUS = 0xC01E0436; +pub const STATUS_GRAPHICS_LEADLINK_START_DEFERRED: NTSTATUS = 0x401E0437; +pub const STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER: NTSTATUS = 0xC01E0438; +pub const STATUS_GRAPHICS_POLLING_TOO_FREQUENTLY: NTSTATUS = 0x401E0439; +pub const STATUS_GRAPHICS_START_DEFERRED: NTSTATUS = 0x401E043A; +pub const STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED: NTSTATUS = 0xC01E043B; +pub const STATUS_GRAPHICS_DEPENDABLE_CHILD_STATUS: NTSTATUS = 0x401E043C; +pub const STATUS_GRAPHICS_OPM_NOT_SUPPORTED: NTSTATUS = 0xC01E0500; +pub const STATUS_GRAPHICS_COPP_NOT_SUPPORTED: NTSTATUS = 0xC01E0501; +pub const STATUS_GRAPHICS_UAB_NOT_SUPPORTED: NTSTATUS = 0xC01E0502; +pub const STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS: NTSTATUS = 0xC01E0503; +pub const STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST: NTSTATUS = 0xC01E0505; +pub const STATUS_GRAPHICS_OPM_INTERNAL_ERROR: NTSTATUS = 0xC01E050B; +pub const STATUS_GRAPHICS_OPM_INVALID_HANDLE: NTSTATUS = 0xC01E050C; +pub const STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH: NTSTATUS = 0xC01E050E; +pub const STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED: NTSTATUS = 0xC01E050F; +pub const STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED: NTSTATUS = 0xC01E0510; +pub const STATUS_GRAPHICS_PVP_HFS_FAILED: NTSTATUS = 0xC01E0511; +pub const STATUS_GRAPHICS_OPM_INVALID_SRM: NTSTATUS = 0xC01E0512; +pub const STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP: NTSTATUS = 0xC01E0513; +pub const STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP: NTSTATUS = 0xC01E0514; +pub const STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA: NTSTATUS = 0xC01E0515; +pub const STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET: NTSTATUS = 0xC01E0516; +pub const STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH: NTSTATUS = 0xC01E0517; +pub const STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE: NTSTATUS = 0xC01E0518; +pub const STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS: NTSTATUS = 0xC01E051A; +pub const STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS: NTSTATUS + = 0xC01E051C; +pub const STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST: NTSTATUS = 0xC01E051D; +pub const STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR: NTSTATUS = 0xC01E051E; +pub const STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS: NTSTATUS + = 0xC01E051F; +pub const STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED: NTSTATUS = 0xC01E0520; +pub const STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST: NTSTATUS = 0xC01E0521; +pub const STATUS_GRAPHICS_I2C_NOT_SUPPORTED: NTSTATUS = 0xC01E0580; +pub const STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST: NTSTATUS = 0xC01E0581; +pub const STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA: NTSTATUS = 0xC01E0582; +pub const STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA: NTSTATUS = 0xC01E0583; +pub const STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED: NTSTATUS = 0xC01E0584; +pub const STATUS_GRAPHICS_DDCCI_INVALID_DATA: NTSTATUS = 0xC01E0585; +pub const STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE: NTSTATUS + = 0xC01E0586; +pub const STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING: NTSTATUS = 0xC01E0587; +pub const STATUS_GRAPHICS_MCA_INTERNAL_ERROR: NTSTATUS = 0xC01E0588; +pub const STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND: NTSTATUS = 0xC01E0589; +pub const STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH: NTSTATUS = 0xC01E058A; +pub const STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM: NTSTATUS = 0xC01E058B; +pub const STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE: NTSTATUS = 0xC01E058C; +pub const STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS: NTSTATUS = 0xC01E058D; +pub const STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED: NTSTATUS = 0xC01E05E0; +pub const STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME: NTSTATUS = 0xC01E05E1; +pub const STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP: NTSTATUS = 0xC01E05E2; +pub const STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED: NTSTATUS = 0xC01E05E3; +pub const STATUS_GRAPHICS_INVALID_POINTER: NTSTATUS = 0xC01E05E4; +pub const STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE: NTSTATUS + = 0xC01E05E5; +pub const STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL: NTSTATUS = 0xC01E05E6; +pub const STATUS_GRAPHICS_INTERNAL_ERROR: NTSTATUS = 0xC01E05E7; +pub const STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS: NTSTATUS = 0xC01E05E8; +pub const STATUS_FVE_LOCKED_VOLUME: NTSTATUS = 0xC0210000; +pub const STATUS_FVE_NOT_ENCRYPTED: NTSTATUS = 0xC0210001; +pub const STATUS_FVE_BAD_INFORMATION: NTSTATUS = 0xC0210002; +pub const STATUS_FVE_TOO_SMALL: NTSTATUS = 0xC0210003; +pub const STATUS_FVE_FAILED_WRONG_FS: NTSTATUS = 0xC0210004; +pub const STATUS_FVE_BAD_PARTITION_SIZE: NTSTATUS = 0xC0210005; +pub const STATUS_FVE_FS_NOT_EXTENDED: NTSTATUS = 0xC0210006; +pub const STATUS_FVE_FS_MOUNTED: NTSTATUS = 0xC0210007; +pub const STATUS_FVE_NO_LICENSE: NTSTATUS = 0xC0210008; +pub const STATUS_FVE_ACTION_NOT_ALLOWED: NTSTATUS = 0xC0210009; +pub const STATUS_FVE_BAD_DATA: NTSTATUS = 0xC021000A; +pub const STATUS_FVE_VOLUME_NOT_BOUND: NTSTATUS = 0xC021000B; +pub const STATUS_FVE_NOT_DATA_VOLUME: NTSTATUS = 0xC021000C; +pub const STATUS_FVE_CONV_READ_ERROR: NTSTATUS = 0xC021000D; +pub const STATUS_FVE_CONV_WRITE_ERROR: NTSTATUS = 0xC021000E; +pub const STATUS_FVE_OVERLAPPED_UPDATE: NTSTATUS = 0xC021000F; +pub const STATUS_FVE_FAILED_SECTOR_SIZE: NTSTATUS = 0xC0210010; +pub const STATUS_FVE_FAILED_AUTHENTICATION: NTSTATUS = 0xC0210011; +pub const STATUS_FVE_NOT_OS_VOLUME: NTSTATUS = 0xC0210012; +pub const STATUS_FVE_KEYFILE_NOT_FOUND: NTSTATUS = 0xC0210013; +pub const STATUS_FVE_KEYFILE_INVALID: NTSTATUS = 0xC0210014; +pub const STATUS_FVE_KEYFILE_NO_VMK: NTSTATUS = 0xC0210015; +pub const STATUS_FVE_TPM_DISABLED: NTSTATUS = 0xC0210016; +pub const STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO: NTSTATUS = 0xC0210017; +pub const STATUS_FVE_TPM_INVALID_PCR: NTSTATUS = 0xC0210018; +pub const STATUS_FVE_TPM_NO_VMK: NTSTATUS = 0xC0210019; +pub const STATUS_FVE_PIN_INVALID: NTSTATUS = 0xC021001A; +pub const STATUS_FVE_AUTH_INVALID_APPLICATION: NTSTATUS = 0xC021001B; +pub const STATUS_FVE_AUTH_INVALID_CONFIG: NTSTATUS = 0xC021001C; +pub const STATUS_FVE_DEBUGGER_ENABLED: NTSTATUS = 0xC021001D; +pub const STATUS_FVE_DRY_RUN_FAILED: NTSTATUS = 0xC021001E; +pub const STATUS_FVE_BAD_METADATA_POINTER: NTSTATUS = 0xC021001F; +pub const STATUS_FVE_OLD_METADATA_COPY: NTSTATUS = 0xC0210020; +pub const STATUS_FVE_REBOOT_REQUIRED: NTSTATUS = 0xC0210021; +pub const STATUS_FVE_RAW_ACCESS: NTSTATUS = 0xC0210022; +pub const STATUS_FVE_RAW_BLOCKED: NTSTATUS = 0xC0210023; +pub const STATUS_FVE_NO_AUTOUNLOCK_MASTER_KEY: NTSTATUS = 0xC0210024; +pub const STATUS_FVE_MOR_FAILED: NTSTATUS = 0xC0210025; +pub const STATUS_FVE_NO_FEATURE_LICENSE: NTSTATUS = 0xC0210026; +pub const STATUS_FVE_POLICY_USER_DISABLE_RDV_NOT_ALLOWED: NTSTATUS = 0xC0210027; +pub const STATUS_FVE_CONV_RECOVERY_FAILED: NTSTATUS = 0xC0210028; +pub const STATUS_FVE_VIRTUALIZED_SPACE_TOO_BIG: NTSTATUS = 0xC0210029; +pub const STATUS_FVE_INVALID_DATUM_TYPE: NTSTATUS = 0xC021002A; +pub const STATUS_FVE_VOLUME_TOO_SMALL: NTSTATUS = 0xC0210030; +pub const STATUS_FVE_ENH_PIN_INVALID: NTSTATUS = 0xC0210031; +pub const STATUS_FVE_FULL_ENCRYPTION_NOT_ALLOWED_ON_TP_STORAGE: NTSTATUS = 0xC0210032; +pub const STATUS_FVE_WIPE_NOT_ALLOWED_ON_TP_STORAGE: NTSTATUS = 0xC0210033; +pub const STATUS_FVE_NOT_ALLOWED_ON_CSV_STACK: NTSTATUS = 0xC0210034; +pub const STATUS_FVE_NOT_ALLOWED_ON_CLUSTER: NTSTATUS = 0xC0210035; +pub const STATUS_FVE_NOT_ALLOWED_TO_UPGRADE_WHILE_CONVERTING: NTSTATUS = 0xC0210036; +pub const STATUS_FVE_WIPE_CANCEL_NOT_APPLICABLE: NTSTATUS = 0xC0210037; +pub const STATUS_FVE_EDRIVE_DRY_RUN_FAILED: NTSTATUS = 0xC0210038; +pub const STATUS_FVE_SECUREBOOT_DISABLED: NTSTATUS = 0xC0210039; +pub const STATUS_FVE_SECUREBOOT_CONFIG_CHANGE: NTSTATUS = 0xC021003A; +pub const STATUS_FVE_DEVICE_LOCKEDOUT: NTSTATUS = 0xC021003B; +pub const STATUS_FVE_VOLUME_EXTEND_PREVENTS_EOW_DECRYPT: NTSTATUS = 0xC021003C; +pub const STATUS_FVE_NOT_DE_VOLUME: NTSTATUS = 0xC021003D; +pub const STATUS_FVE_PROTECTION_DISABLED: NTSTATUS = 0xC021003E; +pub const STATUS_FVE_PROTECTION_CANNOT_BE_DISABLED: NTSTATUS = 0xC021003F; +pub const STATUS_FWP_CALLOUT_NOT_FOUND: NTSTATUS = 0xC0220001; +pub const STATUS_FWP_CONDITION_NOT_FOUND: NTSTATUS = 0xC0220002; +pub const STATUS_FWP_FILTER_NOT_FOUND: NTSTATUS = 0xC0220003; +pub const STATUS_FWP_LAYER_NOT_FOUND: NTSTATUS = 0xC0220004; +pub const STATUS_FWP_PROVIDER_NOT_FOUND: NTSTATUS = 0xC0220005; +pub const STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND: NTSTATUS = 0xC0220006; +pub const STATUS_FWP_SUBLAYER_NOT_FOUND: NTSTATUS = 0xC0220007; +pub const STATUS_FWP_NOT_FOUND: NTSTATUS = 0xC0220008; +pub const STATUS_FWP_ALREADY_EXISTS: NTSTATUS = 0xC0220009; +pub const STATUS_FWP_IN_USE: NTSTATUS = 0xC022000A; +pub const STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS: NTSTATUS = 0xC022000B; +pub const STATUS_FWP_WRONG_SESSION: NTSTATUS = 0xC022000C; +pub const STATUS_FWP_NO_TXN_IN_PROGRESS: NTSTATUS = 0xC022000D; +pub const STATUS_FWP_TXN_IN_PROGRESS: NTSTATUS = 0xC022000E; +pub const STATUS_FWP_TXN_ABORTED: NTSTATUS = 0xC022000F; +pub const STATUS_FWP_SESSION_ABORTED: NTSTATUS = 0xC0220010; +pub const STATUS_FWP_INCOMPATIBLE_TXN: NTSTATUS = 0xC0220011; +pub const STATUS_FWP_TIMEOUT: NTSTATUS = 0xC0220012; +pub const STATUS_FWP_NET_EVENTS_DISABLED: NTSTATUS = 0xC0220013; +pub const STATUS_FWP_INCOMPATIBLE_LAYER: NTSTATUS = 0xC0220014; +pub const STATUS_FWP_KM_CLIENTS_ONLY: NTSTATUS = 0xC0220015; +pub const STATUS_FWP_LIFETIME_MISMATCH: NTSTATUS = 0xC0220016; +pub const STATUS_FWP_BUILTIN_OBJECT: NTSTATUS = 0xC0220017; +pub const STATUS_FWP_TOO_MANY_CALLOUTS: NTSTATUS = 0xC0220018; +pub const STATUS_FWP_NOTIFICATION_DROPPED: NTSTATUS = 0xC0220019; +pub const STATUS_FWP_TRAFFIC_MISMATCH: NTSTATUS = 0xC022001A; +pub const STATUS_FWP_INCOMPATIBLE_SA_STATE: NTSTATUS = 0xC022001B; +pub const STATUS_FWP_NULL_POINTER: NTSTATUS = 0xC022001C; +pub const STATUS_FWP_INVALID_ENUMERATOR: NTSTATUS = 0xC022001D; +pub const STATUS_FWP_INVALID_FLAGS: NTSTATUS = 0xC022001E; +pub const STATUS_FWP_INVALID_NET_MASK: NTSTATUS = 0xC022001F; +pub const STATUS_FWP_INVALID_RANGE: NTSTATUS = 0xC0220020; +pub const STATUS_FWP_INVALID_INTERVAL: NTSTATUS = 0xC0220021; +pub const STATUS_FWP_ZERO_LENGTH_ARRAY: NTSTATUS = 0xC0220022; +pub const STATUS_FWP_NULL_DISPLAY_NAME: NTSTATUS = 0xC0220023; +pub const STATUS_FWP_INVALID_ACTION_TYPE: NTSTATUS = 0xC0220024; +pub const STATUS_FWP_INVALID_WEIGHT: NTSTATUS = 0xC0220025; +pub const STATUS_FWP_MATCH_TYPE_MISMATCH: NTSTATUS = 0xC0220026; +pub const STATUS_FWP_TYPE_MISMATCH: NTSTATUS = 0xC0220027; +pub const STATUS_FWP_OUT_OF_BOUNDS: NTSTATUS = 0xC0220028; +pub const STATUS_FWP_RESERVED: NTSTATUS = 0xC0220029; +pub const STATUS_FWP_DUPLICATE_CONDITION: NTSTATUS = 0xC022002A; +pub const STATUS_FWP_DUPLICATE_KEYMOD: NTSTATUS = 0xC022002B; +pub const STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER: NTSTATUS = 0xC022002C; +pub const STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER: NTSTATUS = 0xC022002D; +pub const STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER: NTSTATUS = 0xC022002E; +pub const STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT: NTSTATUS = 0xC022002F; +pub const STATUS_FWP_INCOMPATIBLE_AUTH_METHOD: NTSTATUS = 0xC0220030; +pub const STATUS_FWP_INCOMPATIBLE_DH_GROUP: NTSTATUS = 0xC0220031; +pub const STATUS_FWP_EM_NOT_SUPPORTED: NTSTATUS = 0xC0220032; +pub const STATUS_FWP_NEVER_MATCH: NTSTATUS = 0xC0220033; +pub const STATUS_FWP_PROVIDER_CONTEXT_MISMATCH: NTSTATUS = 0xC0220034; +pub const STATUS_FWP_INVALID_PARAMETER: NTSTATUS = 0xC0220035; +pub const STATUS_FWP_TOO_MANY_SUBLAYERS: NTSTATUS = 0xC0220036; +pub const STATUS_FWP_CALLOUT_NOTIFICATION_FAILED: NTSTATUS = 0xC0220037; +pub const STATUS_FWP_INVALID_AUTH_TRANSFORM: NTSTATUS = 0xC0220038; +pub const STATUS_FWP_INVALID_CIPHER_TRANSFORM: NTSTATUS = 0xC0220039; +pub const STATUS_FWP_INCOMPATIBLE_CIPHER_TRANSFORM: NTSTATUS = 0xC022003A; +pub const STATUS_FWP_INVALID_TRANSFORM_COMBINATION: NTSTATUS = 0xC022003B; +pub const STATUS_FWP_DUPLICATE_AUTH_METHOD: NTSTATUS = 0xC022003C; +pub const STATUS_FWP_INVALID_TUNNEL_ENDPOINT: NTSTATUS = 0xC022003D; +pub const STATUS_FWP_L2_DRIVER_NOT_READY: NTSTATUS = 0xC022003E; +pub const STATUS_FWP_KEY_DICTATOR_ALREADY_REGISTERED: NTSTATUS = 0xC022003F; +pub const STATUS_FWP_KEY_DICTATION_INVALID_KEYING_MATERIAL: NTSTATUS = 0xC0220040; +pub const STATUS_FWP_CONNECTIONS_DISABLED: NTSTATUS = 0xC0220041; +pub const STATUS_FWP_INVALID_DNS_NAME: NTSTATUS = 0xC0220042; +pub const STATUS_FWP_STILL_ON: NTSTATUS = 0xC0220043; +pub const STATUS_FWP_IKEEXT_NOT_RUNNING: NTSTATUS = 0xC0220044; +pub const STATUS_FWP_TCPIP_NOT_READY: NTSTATUS = 0xC0220100; +pub const STATUS_FWP_INJECT_HANDLE_CLOSING: NTSTATUS = 0xC0220101; +pub const STATUS_FWP_INJECT_HANDLE_STALE: NTSTATUS = 0xC0220102; +pub const STATUS_FWP_CANNOT_PEND: NTSTATUS = 0xC0220103; +pub const STATUS_FWP_DROP_NOICMP: NTSTATUS = 0xC0220104; +pub const STATUS_NDIS_CLOSING: NTSTATUS = 0xC0230002; +pub const STATUS_NDIS_BAD_VERSION: NTSTATUS = 0xC0230004; +pub const STATUS_NDIS_BAD_CHARACTERISTICS: NTSTATUS = 0xC0230005; +pub const STATUS_NDIS_ADAPTER_NOT_FOUND: NTSTATUS = 0xC0230006; +pub const STATUS_NDIS_OPEN_FAILED: NTSTATUS = 0xC0230007; +pub const STATUS_NDIS_DEVICE_FAILED: NTSTATUS = 0xC0230008; +pub const STATUS_NDIS_MULTICAST_FULL: NTSTATUS = 0xC0230009; +pub const STATUS_NDIS_MULTICAST_EXISTS: NTSTATUS = 0xC023000A; +pub const STATUS_NDIS_MULTICAST_NOT_FOUND: NTSTATUS = 0xC023000B; +pub const STATUS_NDIS_REQUEST_ABORTED: NTSTATUS = 0xC023000C; +pub const STATUS_NDIS_RESET_IN_PROGRESS: NTSTATUS = 0xC023000D; +pub const STATUS_NDIS_NOT_SUPPORTED: NTSTATUS = 0xC02300BB; +pub const STATUS_NDIS_INVALID_PACKET: NTSTATUS = 0xC023000F; +pub const STATUS_NDIS_ADAPTER_NOT_READY: NTSTATUS = 0xC0230011; +pub const STATUS_NDIS_INVALID_LENGTH: NTSTATUS = 0xC0230014; +pub const STATUS_NDIS_INVALID_DATA: NTSTATUS = 0xC0230015; +pub const STATUS_NDIS_BUFFER_TOO_SHORT: NTSTATUS = 0xC0230016; +pub const STATUS_NDIS_INVALID_OID: NTSTATUS = 0xC0230017; +pub const STATUS_NDIS_ADAPTER_REMOVED: NTSTATUS = 0xC0230018; +pub const STATUS_NDIS_UNSUPPORTED_MEDIA: NTSTATUS = 0xC0230019; +pub const STATUS_NDIS_GROUP_ADDRESS_IN_USE: NTSTATUS = 0xC023001A; +pub const STATUS_NDIS_FILE_NOT_FOUND: NTSTATUS = 0xC023001B; +pub const STATUS_NDIS_ERROR_READING_FILE: NTSTATUS = 0xC023001C; +pub const STATUS_NDIS_ALREADY_MAPPED: NTSTATUS = 0xC023001D; +pub const STATUS_NDIS_RESOURCE_CONFLICT: NTSTATUS = 0xC023001E; +pub const STATUS_NDIS_MEDIA_DISCONNECTED: NTSTATUS = 0xC023001F; +pub const STATUS_NDIS_INVALID_ADDRESS: NTSTATUS = 0xC0230022; +pub const STATUS_NDIS_INVALID_DEVICE_REQUEST: NTSTATUS = 0xC0230010; +pub const STATUS_NDIS_PAUSED: NTSTATUS = 0xC023002A; +pub const STATUS_NDIS_INTERFACE_NOT_FOUND: NTSTATUS = 0xC023002B; +pub const STATUS_NDIS_UNSUPPORTED_REVISION: NTSTATUS = 0xC023002C; +pub const STATUS_NDIS_INVALID_PORT: NTSTATUS = 0xC023002D; +pub const STATUS_NDIS_INVALID_PORT_STATE: NTSTATUS = 0xC023002E; +pub const STATUS_NDIS_LOW_POWER_STATE: NTSTATUS = 0xC023002F; +pub const STATUS_NDIS_REINIT_REQUIRED: NTSTATUS = 0xC0230030; +pub const STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED: NTSTATUS = 0xC0232000; +pub const STATUS_NDIS_DOT11_MEDIA_IN_USE: NTSTATUS = 0xC0232001; +pub const STATUS_NDIS_DOT11_POWER_STATE_INVALID: NTSTATUS = 0xC0232002; +pub const STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL: NTSTATUS = 0xC0232003; +pub const STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL: NTSTATUS = 0xC0232004; +pub const STATUS_NDIS_DOT11_AP_CHANNEL_CURRENTLY_NOT_AVAILABLE: NTSTATUS = 0xC0232005; +pub const STATUS_NDIS_DOT11_AP_BAND_CURRENTLY_NOT_AVAILABLE: NTSTATUS = 0xC0232006; +pub const STATUS_NDIS_DOT11_AP_CHANNEL_NOT_ALLOWED: NTSTATUS = 0xC0232007; +pub const STATUS_NDIS_DOT11_AP_BAND_NOT_ALLOWED: NTSTATUS = 0xC0232008; +pub const STATUS_NDIS_INDICATION_REQUIRED: NTSTATUS = 0x40230001; +pub const STATUS_NDIS_OFFLOAD_POLICY: NTSTATUS = 0xC023100F; +pub const STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED: NTSTATUS = 0xC0231012; +pub const STATUS_NDIS_OFFLOAD_PATH_REJECTED: NTSTATUS = 0xC0231013; +pub const STATUS_TPM_ERROR_MASK: NTSTATUS = 0xC0290000; +pub const STATUS_TPM_AUTHFAIL: NTSTATUS = 0xC0290001; +pub const STATUS_TPM_BADINDEX: NTSTATUS = 0xC0290002; +pub const STATUS_TPM_BAD_PARAMETER: NTSTATUS = 0xC0290003; +pub const STATUS_TPM_AUDITFAILURE: NTSTATUS = 0xC0290004; +pub const STATUS_TPM_CLEAR_DISABLED: NTSTATUS = 0xC0290005; +pub const STATUS_TPM_DEACTIVATED: NTSTATUS = 0xC0290006; +pub const STATUS_TPM_DISABLED: NTSTATUS = 0xC0290007; +pub const STATUS_TPM_DISABLED_CMD: NTSTATUS = 0xC0290008; +pub const STATUS_TPM_FAIL: NTSTATUS = 0xC0290009; +pub const STATUS_TPM_BAD_ORDINAL: NTSTATUS = 0xC029000A; +pub const STATUS_TPM_INSTALL_DISABLED: NTSTATUS = 0xC029000B; +pub const STATUS_TPM_INVALID_KEYHANDLE: NTSTATUS = 0xC029000C; +pub const STATUS_TPM_KEYNOTFOUND: NTSTATUS = 0xC029000D; +pub const STATUS_TPM_INAPPROPRIATE_ENC: NTSTATUS = 0xC029000E; +pub const STATUS_TPM_MIGRATEFAIL: NTSTATUS = 0xC029000F; +pub const STATUS_TPM_INVALID_PCR_INFO: NTSTATUS = 0xC0290010; +pub const STATUS_TPM_NOSPACE: NTSTATUS = 0xC0290011; +pub const STATUS_TPM_NOSRK: NTSTATUS = 0xC0290012; +pub const STATUS_TPM_NOTSEALED_BLOB: NTSTATUS = 0xC0290013; +pub const STATUS_TPM_OWNER_SET: NTSTATUS = 0xC0290014; +pub const STATUS_TPM_RESOURCES: NTSTATUS = 0xC0290015; +pub const STATUS_TPM_SHORTRANDOM: NTSTATUS = 0xC0290016; +pub const STATUS_TPM_SIZE: NTSTATUS = 0xC0290017; +pub const STATUS_TPM_WRONGPCRVAL: NTSTATUS = 0xC0290018; +pub const STATUS_TPM_BAD_PARAM_SIZE: NTSTATUS = 0xC0290019; +pub const STATUS_TPM_SHA_THREAD: NTSTATUS = 0xC029001A; +pub const STATUS_TPM_SHA_ERROR: NTSTATUS = 0xC029001B; +pub const STATUS_TPM_FAILEDSELFTEST: NTSTATUS = 0xC029001C; +pub const STATUS_TPM_AUTH2FAIL: NTSTATUS = 0xC029001D; +pub const STATUS_TPM_BADTAG: NTSTATUS = 0xC029001E; +pub const STATUS_TPM_IOERROR: NTSTATUS = 0xC029001F; +pub const STATUS_TPM_ENCRYPT_ERROR: NTSTATUS = 0xC0290020; +pub const STATUS_TPM_DECRYPT_ERROR: NTSTATUS = 0xC0290021; +pub const STATUS_TPM_INVALID_AUTHHANDLE: NTSTATUS = 0xC0290022; +pub const STATUS_TPM_NO_ENDORSEMENT: NTSTATUS = 0xC0290023; +pub const STATUS_TPM_INVALID_KEYUSAGE: NTSTATUS = 0xC0290024; +pub const STATUS_TPM_WRONG_ENTITYTYPE: NTSTATUS = 0xC0290025; +pub const STATUS_TPM_INVALID_POSTINIT: NTSTATUS = 0xC0290026; +pub const STATUS_TPM_INAPPROPRIATE_SIG: NTSTATUS = 0xC0290027; +pub const STATUS_TPM_BAD_KEY_PROPERTY: NTSTATUS = 0xC0290028; +pub const STATUS_TPM_BAD_MIGRATION: NTSTATUS = 0xC0290029; +pub const STATUS_TPM_BAD_SCHEME: NTSTATUS = 0xC029002A; +pub const STATUS_TPM_BAD_DATASIZE: NTSTATUS = 0xC029002B; +pub const STATUS_TPM_BAD_MODE: NTSTATUS = 0xC029002C; +pub const STATUS_TPM_BAD_PRESENCE: NTSTATUS = 0xC029002D; +pub const STATUS_TPM_BAD_VERSION: NTSTATUS = 0xC029002E; +pub const STATUS_TPM_NO_WRAP_TRANSPORT: NTSTATUS = 0xC029002F; +pub const STATUS_TPM_AUDITFAIL_UNSUCCESSFUL: NTSTATUS = 0xC0290030; +pub const STATUS_TPM_AUDITFAIL_SUCCESSFUL: NTSTATUS = 0xC0290031; +pub const STATUS_TPM_NOTRESETABLE: NTSTATUS = 0xC0290032; +pub const STATUS_TPM_NOTLOCAL: NTSTATUS = 0xC0290033; +pub const STATUS_TPM_BAD_TYPE: NTSTATUS = 0xC0290034; +pub const STATUS_TPM_INVALID_RESOURCE: NTSTATUS = 0xC0290035; +pub const STATUS_TPM_NOTFIPS: NTSTATUS = 0xC0290036; +pub const STATUS_TPM_INVALID_FAMILY: NTSTATUS = 0xC0290037; +pub const STATUS_TPM_NO_NV_PERMISSION: NTSTATUS = 0xC0290038; +pub const STATUS_TPM_REQUIRES_SIGN: NTSTATUS = 0xC0290039; +pub const STATUS_TPM_KEY_NOTSUPPORTED: NTSTATUS = 0xC029003A; +pub const STATUS_TPM_AUTH_CONFLICT: NTSTATUS = 0xC029003B; +pub const STATUS_TPM_AREA_LOCKED: NTSTATUS = 0xC029003C; +pub const STATUS_TPM_BAD_LOCALITY: NTSTATUS = 0xC029003D; +pub const STATUS_TPM_READ_ONLY: NTSTATUS = 0xC029003E; +pub const STATUS_TPM_PER_NOWRITE: NTSTATUS = 0xC029003F; +pub const STATUS_TPM_FAMILYCOUNT: NTSTATUS = 0xC0290040; +pub const STATUS_TPM_WRITE_LOCKED: NTSTATUS = 0xC0290041; +pub const STATUS_TPM_BAD_ATTRIBUTES: NTSTATUS = 0xC0290042; +pub const STATUS_TPM_INVALID_STRUCTURE: NTSTATUS = 0xC0290043; +pub const STATUS_TPM_KEY_OWNER_CONTROL: NTSTATUS = 0xC0290044; +pub const STATUS_TPM_BAD_COUNTER: NTSTATUS = 0xC0290045; +pub const STATUS_TPM_NOT_FULLWRITE: NTSTATUS = 0xC0290046; +pub const STATUS_TPM_CONTEXT_GAP: NTSTATUS = 0xC0290047; +pub const STATUS_TPM_MAXNVWRITES: NTSTATUS = 0xC0290048; +pub const STATUS_TPM_NOOPERATOR: NTSTATUS = 0xC0290049; +pub const STATUS_TPM_RESOURCEMISSING: NTSTATUS = 0xC029004A; +pub const STATUS_TPM_DELEGATE_LOCK: NTSTATUS = 0xC029004B; +pub const STATUS_TPM_DELEGATE_FAMILY: NTSTATUS = 0xC029004C; +pub const STATUS_TPM_DELEGATE_ADMIN: NTSTATUS = 0xC029004D; +pub const STATUS_TPM_TRANSPORT_NOTEXCLUSIVE: NTSTATUS = 0xC029004E; +pub const STATUS_TPM_OWNER_CONTROL: NTSTATUS = 0xC029004F; +pub const STATUS_TPM_DAA_RESOURCES: NTSTATUS = 0xC0290050; +pub const STATUS_TPM_DAA_INPUT_DATA0: NTSTATUS = 0xC0290051; +pub const STATUS_TPM_DAA_INPUT_DATA1: NTSTATUS = 0xC0290052; +pub const STATUS_TPM_DAA_ISSUER_SETTINGS: NTSTATUS = 0xC0290053; +pub const STATUS_TPM_DAA_TPM_SETTINGS: NTSTATUS = 0xC0290054; +pub const STATUS_TPM_DAA_STAGE: NTSTATUS = 0xC0290055; +pub const STATUS_TPM_DAA_ISSUER_VALIDITY: NTSTATUS = 0xC0290056; +pub const STATUS_TPM_DAA_WRONG_W: NTSTATUS = 0xC0290057; +pub const STATUS_TPM_BAD_HANDLE: NTSTATUS = 0xC0290058; +pub const STATUS_TPM_BAD_DELEGATE: NTSTATUS = 0xC0290059; +pub const STATUS_TPM_BADCONTEXT: NTSTATUS = 0xC029005A; +pub const STATUS_TPM_TOOMANYCONTEXTS: NTSTATUS = 0xC029005B; +pub const STATUS_TPM_MA_TICKET_SIGNATURE: NTSTATUS = 0xC029005C; +pub const STATUS_TPM_MA_DESTINATION: NTSTATUS = 0xC029005D; +pub const STATUS_TPM_MA_SOURCE: NTSTATUS = 0xC029005E; +pub const STATUS_TPM_MA_AUTHORITY: NTSTATUS = 0xC029005F; +pub const STATUS_TPM_PERMANENTEK: NTSTATUS = 0xC0290061; +pub const STATUS_TPM_BAD_SIGNATURE: NTSTATUS = 0xC0290062; +pub const STATUS_TPM_NOCONTEXTSPACE: NTSTATUS = 0xC0290063; +pub const STATUS_TPM_COMMAND_BLOCKED: NTSTATUS = 0xC0290400; +pub const STATUS_TPM_INVALID_HANDLE: NTSTATUS = 0xC0290401; +pub const STATUS_TPM_DUPLICATE_VHANDLE: NTSTATUS = 0xC0290402; +pub const STATUS_TPM_EMBEDDED_COMMAND_BLOCKED: NTSTATUS = 0xC0290403; +pub const STATUS_TPM_EMBEDDED_COMMAND_UNSUPPORTED: NTSTATUS = 0xC0290404; +pub const STATUS_TPM_RETRY: NTSTATUS = 0xC0290800; +pub const STATUS_TPM_NEEDS_SELFTEST: NTSTATUS = 0xC0290801; +pub const STATUS_TPM_DOING_SELFTEST: NTSTATUS = 0xC0290802; +pub const STATUS_TPM_DEFEND_LOCK_RUNNING: NTSTATUS = 0xC0290803; +pub const STATUS_TPM_COMMAND_CANCELED: NTSTATUS = 0xC0291001; +pub const STATUS_TPM_TOO_MANY_CONTEXTS: NTSTATUS = 0xC0291002; +pub const STATUS_TPM_NOT_FOUND: NTSTATUS = 0xC0291003; +pub const STATUS_TPM_ACCESS_DENIED: NTSTATUS = 0xC0291004; +pub const STATUS_TPM_INSUFFICIENT_BUFFER: NTSTATUS = 0xC0291005; +pub const STATUS_TPM_PPI_FUNCTION_UNSUPPORTED: NTSTATUS = 0xC0291006; +pub const STATUS_PCP_ERROR_MASK: NTSTATUS = 0xC0292000; +pub const STATUS_PCP_DEVICE_NOT_READY: NTSTATUS = 0xC0292001; +pub const STATUS_PCP_INVALID_HANDLE: NTSTATUS = 0xC0292002; +pub const STATUS_PCP_INVALID_PARAMETER: NTSTATUS = 0xC0292003; +pub const STATUS_PCP_FLAG_NOT_SUPPORTED: NTSTATUS = 0xC0292004; +pub const STATUS_PCP_NOT_SUPPORTED: NTSTATUS = 0xC0292005; +pub const STATUS_PCP_BUFFER_TOO_SMALL: NTSTATUS = 0xC0292006; +pub const STATUS_PCP_INTERNAL_ERROR: NTSTATUS = 0xC0292007; +pub const STATUS_PCP_AUTHENTICATION_FAILED: NTSTATUS = 0xC0292008; +pub const STATUS_PCP_AUTHENTICATION_IGNORED: NTSTATUS = 0xC0292009; +pub const STATUS_PCP_POLICY_NOT_FOUND: NTSTATUS = 0xC029200A; +pub const STATUS_PCP_PROFILE_NOT_FOUND: NTSTATUS = 0xC029200B; +pub const STATUS_PCP_VALIDATION_FAILED: NTSTATUS = 0xC029200C; +pub const STATUS_PCP_DEVICE_NOT_FOUND: NTSTATUS = 0xC029200D; +pub const STATUS_RTPM_CONTEXT_CONTINUE: NTSTATUS = 0x00293000; +pub const STATUS_RTPM_CONTEXT_COMPLETE: NTSTATUS = 0x00293001; +pub const STATUS_RTPM_NO_RESULT: NTSTATUS = 0xC0293002; +pub const STATUS_RTPM_PCR_READ_INCOMPLETE: NTSTATUS = 0xC0293003; +pub const STATUS_RTPM_INVALID_CONTEXT: NTSTATUS = 0xC0293004; +pub const STATUS_RTPM_UNSUPPORTED_CMD: NTSTATUS = 0xC0293005; +pub const STATUS_HV_INVALID_HYPERCALL_CODE: NTSTATUS = 0xC0350002; +pub const STATUS_HV_INVALID_HYPERCALL_INPUT: NTSTATUS = 0xC0350003; +pub const STATUS_HV_INVALID_ALIGNMENT: NTSTATUS = 0xC0350004; +pub const STATUS_HV_INVALID_PARAMETER: NTSTATUS = 0xC0350005; +pub const STATUS_HV_ACCESS_DENIED: NTSTATUS = 0xC0350006; +pub const STATUS_HV_INVALID_PARTITION_STATE: NTSTATUS = 0xC0350007; +pub const STATUS_HV_OPERATION_DENIED: NTSTATUS = 0xC0350008; +pub const STATUS_HV_UNKNOWN_PROPERTY: NTSTATUS = 0xC0350009; +pub const STATUS_HV_PROPERTY_VALUE_OUT_OF_RANGE: NTSTATUS = 0xC035000A; +pub const STATUS_HV_INSUFFICIENT_MEMORY: NTSTATUS = 0xC035000B; +pub const STATUS_HV_PARTITION_TOO_DEEP: NTSTATUS = 0xC035000C; +pub const STATUS_HV_INVALID_PARTITION_ID: NTSTATUS = 0xC035000D; +pub const STATUS_HV_INVALID_VP_INDEX: NTSTATUS = 0xC035000E; +pub const STATUS_HV_INVALID_PORT_ID: NTSTATUS = 0xC0350011; +pub const STATUS_HV_INVALID_CONNECTION_ID: NTSTATUS = 0xC0350012; +pub const STATUS_HV_INSUFFICIENT_BUFFERS: NTSTATUS = 0xC0350013; +pub const STATUS_HV_NOT_ACKNOWLEDGED: NTSTATUS = 0xC0350014; +pub const STATUS_HV_INVALID_VP_STATE: NTSTATUS = 0xC0350015; +pub const STATUS_HV_ACKNOWLEDGED: NTSTATUS = 0xC0350016; +pub const STATUS_HV_INVALID_SAVE_RESTORE_STATE: NTSTATUS = 0xC0350017; +pub const STATUS_HV_INVALID_SYNIC_STATE: NTSTATUS = 0xC0350018; +pub const STATUS_HV_OBJECT_IN_USE: NTSTATUS = 0xC0350019; +pub const STATUS_HV_INVALID_PROXIMITY_DOMAIN_INFO: NTSTATUS = 0xC035001A; +pub const STATUS_HV_NO_DATA: NTSTATUS = 0xC035001B; +pub const STATUS_HV_INACTIVE: NTSTATUS = 0xC035001C; +pub const STATUS_HV_NO_RESOURCES: NTSTATUS = 0xC035001D; +pub const STATUS_HV_FEATURE_UNAVAILABLE: NTSTATUS = 0xC035001E; +pub const STATUS_HV_INSUFFICIENT_BUFFER: NTSTATUS = 0xC0350033; +pub const STATUS_HV_INSUFFICIENT_DEVICE_DOMAINS: NTSTATUS = 0xC0350038; +pub const STATUS_HV_CPUID_FEATURE_VALIDATION_ERROR: NTSTATUS = 0xC035003C; +pub const STATUS_HV_CPUID_XSAVE_FEATURE_VALIDATION_ERROR: NTSTATUS = 0xC035003D; +pub const STATUS_HV_PROCESSOR_STARTUP_TIMEOUT: NTSTATUS = 0xC035003E; +pub const STATUS_HV_SMX_ENABLED: NTSTATUS = 0xC035003F; +pub const STATUS_HV_INVALID_LP_INDEX: NTSTATUS = 0xC0350041; +pub const STATUS_HV_INVALID_REGISTER_VALUE: NTSTATUS = 0xC0350050; +pub const STATUS_HV_INVALID_VTL_STATE: NTSTATUS = 0xC0350051; +pub const STATUS_HV_NX_NOT_DETECTED: NTSTATUS = 0xC0350055; +pub const STATUS_HV_INVALID_DEVICE_ID: NTSTATUS = 0xC0350057; +pub const STATUS_HV_INVALID_DEVICE_STATE: NTSTATUS = 0xC0350058; +pub const STATUS_HV_PENDING_PAGE_REQUESTS: NTSTATUS = 0x00350059; +pub const STATUS_HV_PAGE_REQUEST_INVALID: NTSTATUS = 0xC0350060; +pub const STATUS_HV_INVALID_CPU_GROUP_ID: NTSTATUS = 0xC035006F; +pub const STATUS_HV_INVALID_CPU_GROUP_STATE: NTSTATUS = 0xC0350070; +pub const STATUS_HV_NOT_ALLOWED_WITH_NESTED_VIRT_ACTIVE: NTSTATUS = 0xC0350071; +pub const STATUS_HV_NOT_PRESENT: NTSTATUS = 0xC0351000; +pub const STATUS_VID_DUPLICATE_HANDLER: NTSTATUS = 0xC0370001; +pub const STATUS_VID_TOO_MANY_HANDLERS: NTSTATUS = 0xC0370002; +pub const STATUS_VID_QUEUE_FULL: NTSTATUS = 0xC0370003; +pub const STATUS_VID_HANDLER_NOT_PRESENT: NTSTATUS = 0xC0370004; +pub const STATUS_VID_INVALID_OBJECT_NAME: NTSTATUS = 0xC0370005; +pub const STATUS_VID_PARTITION_NAME_TOO_LONG: NTSTATUS = 0xC0370006; +pub const STATUS_VID_MESSAGE_QUEUE_NAME_TOO_LONG: NTSTATUS = 0xC0370007; +pub const STATUS_VID_PARTITION_ALREADY_EXISTS: NTSTATUS = 0xC0370008; +pub const STATUS_VID_PARTITION_DOES_NOT_EXIST: NTSTATUS = 0xC0370009; +pub const STATUS_VID_PARTITION_NAME_NOT_FOUND: NTSTATUS = 0xC037000A; +pub const STATUS_VID_MESSAGE_QUEUE_ALREADY_EXISTS: NTSTATUS = 0xC037000B; +pub const STATUS_VID_EXCEEDED_MBP_ENTRY_MAP_LIMIT: NTSTATUS = 0xC037000C; +pub const STATUS_VID_MB_STILL_REFERENCED: NTSTATUS = 0xC037000D; +pub const STATUS_VID_CHILD_GPA_PAGE_SET_CORRUPTED: NTSTATUS = 0xC037000E; +pub const STATUS_VID_INVALID_NUMA_SETTINGS: NTSTATUS = 0xC037000F; +pub const STATUS_VID_INVALID_NUMA_NODE_INDEX: NTSTATUS = 0xC0370010; +pub const STATUS_VID_NOTIFICATION_QUEUE_ALREADY_ASSOCIATED: NTSTATUS = 0xC0370011; +pub const STATUS_VID_INVALID_MEMORY_BLOCK_HANDLE: NTSTATUS = 0xC0370012; +pub const STATUS_VID_PAGE_RANGE_OVERFLOW: NTSTATUS = 0xC0370013; +pub const STATUS_VID_INVALID_MESSAGE_QUEUE_HANDLE: NTSTATUS = 0xC0370014; +pub const STATUS_VID_INVALID_GPA_RANGE_HANDLE: NTSTATUS = 0xC0370015; +pub const STATUS_VID_NO_MEMORY_BLOCK_NOTIFICATION_QUEUE: NTSTATUS = 0xC0370016; +pub const STATUS_VID_MEMORY_BLOCK_LOCK_COUNT_EXCEEDED: NTSTATUS = 0xC0370017; +pub const STATUS_VID_INVALID_PPM_HANDLE: NTSTATUS = 0xC0370018; +pub const STATUS_VID_MBPS_ARE_LOCKED: NTSTATUS = 0xC0370019; +pub const STATUS_VID_MESSAGE_QUEUE_CLOSED: NTSTATUS = 0xC037001A; +pub const STATUS_VID_VIRTUAL_PROCESSOR_LIMIT_EXCEEDED: NTSTATUS = 0xC037001B; +pub const STATUS_VID_STOP_PENDING: NTSTATUS = 0xC037001C; +pub const STATUS_VID_INVALID_PROCESSOR_STATE: NTSTATUS = 0xC037001D; +pub const STATUS_VID_EXCEEDED_KM_CONTEXT_COUNT_LIMIT: NTSTATUS = 0xC037001E; +pub const STATUS_VID_KM_INTERFACE_ALREADY_INITIALIZED: NTSTATUS = 0xC037001F; +pub const STATUS_VID_MB_PROPERTY_ALREADY_SET_RESET: NTSTATUS = 0xC0370020; +pub const STATUS_VID_MMIO_RANGE_DESTROYED: NTSTATUS = 0xC0370021; +pub const STATUS_VID_INVALID_CHILD_GPA_PAGE_SET: NTSTATUS = 0xC0370022; +pub const STATUS_VID_RESERVE_PAGE_SET_IS_BEING_USED: NTSTATUS = 0xC0370023; +pub const STATUS_VID_RESERVE_PAGE_SET_TOO_SMALL: NTSTATUS = 0xC0370024; +pub const STATUS_VID_MBP_ALREADY_LOCKED_USING_RESERVED_PAGE: NTSTATUS = 0xC0370025; +pub const STATUS_VID_MBP_COUNT_EXCEEDED_LIMIT: NTSTATUS = 0xC0370026; +pub const STATUS_VID_SAVED_STATE_CORRUPT: NTSTATUS = 0xC0370027; +pub const STATUS_VID_SAVED_STATE_UNRECOGNIZED_ITEM: NTSTATUS = 0xC0370028; +pub const STATUS_VID_SAVED_STATE_INCOMPATIBLE: NTSTATUS = 0xC0370029; +pub const STATUS_VID_VTL_ACCESS_DENIED: NTSTATUS = 0xC037002A; +pub const STATUS_VID_REMOTE_NODE_PARENT_GPA_PAGES_USED: NTSTATUS = 0x80370001; +pub const STATUS_IPSEC_BAD_SPI: NTSTATUS = 0xC0360001; +pub const STATUS_IPSEC_SA_LIFETIME_EXPIRED: NTSTATUS = 0xC0360002; +pub const STATUS_IPSEC_WRONG_SA: NTSTATUS = 0xC0360003; +pub const STATUS_IPSEC_REPLAY_CHECK_FAILED: NTSTATUS = 0xC0360004; +pub const STATUS_IPSEC_INVALID_PACKET: NTSTATUS = 0xC0360005; +pub const STATUS_IPSEC_INTEGRITY_CHECK_FAILED: NTSTATUS = 0xC0360006; +pub const STATUS_IPSEC_CLEAR_TEXT_DROP: NTSTATUS = 0xC0360007; +pub const STATUS_IPSEC_AUTH_FIREWALL_DROP: NTSTATUS = 0xC0360008; +pub const STATUS_IPSEC_THROTTLE_DROP: NTSTATUS = 0xC0360009; +pub const STATUS_IPSEC_DOSP_BLOCK: NTSTATUS = 0xC0368000; +pub const STATUS_IPSEC_DOSP_RECEIVED_MULTICAST: NTSTATUS = 0xC0368001; +pub const STATUS_IPSEC_DOSP_INVALID_PACKET: NTSTATUS = 0xC0368002; +pub const STATUS_IPSEC_DOSP_STATE_LOOKUP_FAILED: NTSTATUS = 0xC0368003; +pub const STATUS_IPSEC_DOSP_MAX_ENTRIES: NTSTATUS = 0xC0368004; +pub const STATUS_IPSEC_DOSP_KEYMOD_NOT_ALLOWED: NTSTATUS = 0xC0368005; +pub const STATUS_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES: NTSTATUS = 0xC0368006; +pub const STATUS_VOLMGR_INCOMPLETE_REGENERATION: NTSTATUS = 0x80380001; +pub const STATUS_VOLMGR_INCOMPLETE_DISK_MIGRATION: NTSTATUS = 0x80380002; +pub const STATUS_VOLMGR_DATABASE_FULL: NTSTATUS = 0xC0380001; +pub const STATUS_VOLMGR_DISK_CONFIGURATION_CORRUPTED: NTSTATUS = 0xC0380002; +pub const STATUS_VOLMGR_DISK_CONFIGURATION_NOT_IN_SYNC: NTSTATUS = 0xC0380003; +pub const STATUS_VOLMGR_PACK_CONFIG_UPDATE_FAILED: NTSTATUS = 0xC0380004; +pub const STATUS_VOLMGR_DISK_CONTAINS_NON_SIMPLE_VOLUME: NTSTATUS = 0xC0380005; +pub const STATUS_VOLMGR_DISK_DUPLICATE: NTSTATUS = 0xC0380006; +pub const STATUS_VOLMGR_DISK_DYNAMIC: NTSTATUS = 0xC0380007; +pub const STATUS_VOLMGR_DISK_ID_INVALID: NTSTATUS = 0xC0380008; +pub const STATUS_VOLMGR_DISK_INVALID: NTSTATUS = 0xC0380009; +pub const STATUS_VOLMGR_DISK_LAST_VOTER: NTSTATUS = 0xC038000A; +pub const STATUS_VOLMGR_DISK_LAYOUT_INVALID: NTSTATUS = 0xC038000B; +pub const STATUS_VOLMGR_DISK_LAYOUT_NON_BASIC_BETWEEN_BASIC_PARTITIONS: NTSTATUS + = 0xC038000C; +pub const STATUS_VOLMGR_DISK_LAYOUT_NOT_CYLINDER_ALIGNED: NTSTATUS = 0xC038000D; +pub const STATUS_VOLMGR_DISK_LAYOUT_PARTITIONS_TOO_SMALL: NTSTATUS = 0xC038000E; +pub const STATUS_VOLMGR_DISK_LAYOUT_PRIMARY_BETWEEN_LOGICAL_PARTITIONS: NTSTATUS + = 0xC038000F; +pub const STATUS_VOLMGR_DISK_LAYOUT_TOO_MANY_PARTITIONS: NTSTATUS = 0xC0380010; +pub const STATUS_VOLMGR_DISK_MISSING: NTSTATUS = 0xC0380011; +pub const STATUS_VOLMGR_DISK_NOT_EMPTY: NTSTATUS = 0xC0380012; +pub const STATUS_VOLMGR_DISK_NOT_ENOUGH_SPACE: NTSTATUS = 0xC0380013; +pub const STATUS_VOLMGR_DISK_REVECTORING_FAILED: NTSTATUS = 0xC0380014; +pub const STATUS_VOLMGR_DISK_SECTOR_SIZE_INVALID: NTSTATUS = 0xC0380015; +pub const STATUS_VOLMGR_DISK_SET_NOT_CONTAINED: NTSTATUS = 0xC0380016; +pub const STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_MEMBERS: NTSTATUS = 0xC0380017; +pub const STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_PLEXES: NTSTATUS = 0xC0380018; +pub const STATUS_VOLMGR_DYNAMIC_DISK_NOT_SUPPORTED: NTSTATUS = 0xC0380019; +pub const STATUS_VOLMGR_EXTENT_ALREADY_USED: NTSTATUS = 0xC038001A; +pub const STATUS_VOLMGR_EXTENT_NOT_CONTIGUOUS: NTSTATUS = 0xC038001B; +pub const STATUS_VOLMGR_EXTENT_NOT_IN_PUBLIC_REGION: NTSTATUS = 0xC038001C; +pub const STATUS_VOLMGR_EXTENT_NOT_SECTOR_ALIGNED: NTSTATUS = 0xC038001D; +pub const STATUS_VOLMGR_EXTENT_OVERLAPS_EBR_PARTITION: NTSTATUS = 0xC038001E; +pub const STATUS_VOLMGR_EXTENT_VOLUME_LENGTHS_DO_NOT_MATCH: NTSTATUS = 0xC038001F; +pub const STATUS_VOLMGR_FAULT_TOLERANT_NOT_SUPPORTED: NTSTATUS = 0xC0380020; +pub const STATUS_VOLMGR_INTERLEAVE_LENGTH_INVALID: NTSTATUS = 0xC0380021; +pub const STATUS_VOLMGR_MAXIMUM_REGISTERED_USERS: NTSTATUS = 0xC0380022; +pub const STATUS_VOLMGR_MEMBER_IN_SYNC: NTSTATUS = 0xC0380023; +pub const STATUS_VOLMGR_MEMBER_INDEX_DUPLICATE: NTSTATUS = 0xC0380024; +pub const STATUS_VOLMGR_MEMBER_INDEX_INVALID: NTSTATUS = 0xC0380025; +pub const STATUS_VOLMGR_MEMBER_MISSING: NTSTATUS = 0xC0380026; +pub const STATUS_VOLMGR_MEMBER_NOT_DETACHED: NTSTATUS = 0xC0380027; +pub const STATUS_VOLMGR_MEMBER_REGENERATING: NTSTATUS = 0xC0380028; +pub const STATUS_VOLMGR_ALL_DISKS_FAILED: NTSTATUS = 0xC0380029; +pub const STATUS_VOLMGR_NO_REGISTERED_USERS: NTSTATUS = 0xC038002A; +pub const STATUS_VOLMGR_NO_SUCH_USER: NTSTATUS = 0xC038002B; +pub const STATUS_VOLMGR_NOTIFICATION_RESET: NTSTATUS = 0xC038002C; +pub const STATUS_VOLMGR_NUMBER_OF_MEMBERS_INVALID: NTSTATUS = 0xC038002D; +pub const STATUS_VOLMGR_NUMBER_OF_PLEXES_INVALID: NTSTATUS = 0xC038002E; +pub const STATUS_VOLMGR_PACK_DUPLICATE: NTSTATUS = 0xC038002F; +pub const STATUS_VOLMGR_PACK_ID_INVALID: NTSTATUS = 0xC0380030; +pub const STATUS_VOLMGR_PACK_INVALID: NTSTATUS = 0xC0380031; +pub const STATUS_VOLMGR_PACK_NAME_INVALID: NTSTATUS = 0xC0380032; +pub const STATUS_VOLMGR_PACK_OFFLINE: NTSTATUS = 0xC0380033; +pub const STATUS_VOLMGR_PACK_HAS_QUORUM: NTSTATUS = 0xC0380034; +pub const STATUS_VOLMGR_PACK_WITHOUT_QUORUM: NTSTATUS = 0xC0380035; +pub const STATUS_VOLMGR_PARTITION_STYLE_INVALID: NTSTATUS = 0xC0380036; +pub const STATUS_VOLMGR_PARTITION_UPDATE_FAILED: NTSTATUS = 0xC0380037; +pub const STATUS_VOLMGR_PLEX_IN_SYNC: NTSTATUS = 0xC0380038; +pub const STATUS_VOLMGR_PLEX_INDEX_DUPLICATE: NTSTATUS = 0xC0380039; +pub const STATUS_VOLMGR_PLEX_INDEX_INVALID: NTSTATUS = 0xC038003A; +pub const STATUS_VOLMGR_PLEX_LAST_ACTIVE: NTSTATUS = 0xC038003B; +pub const STATUS_VOLMGR_PLEX_MISSING: NTSTATUS = 0xC038003C; +pub const STATUS_VOLMGR_PLEX_REGENERATING: NTSTATUS = 0xC038003D; +pub const STATUS_VOLMGR_PLEX_TYPE_INVALID: NTSTATUS = 0xC038003E; +pub const STATUS_VOLMGR_PLEX_NOT_RAID5: NTSTATUS = 0xC038003F; +pub const STATUS_VOLMGR_PLEX_NOT_SIMPLE: NTSTATUS = 0xC0380040; +pub const STATUS_VOLMGR_STRUCTURE_SIZE_INVALID: NTSTATUS = 0xC0380041; +pub const STATUS_VOLMGR_TOO_MANY_NOTIFICATION_REQUESTS: NTSTATUS = 0xC0380042; +pub const STATUS_VOLMGR_TRANSACTION_IN_PROGRESS: NTSTATUS = 0xC0380043; +pub const STATUS_VOLMGR_UNEXPECTED_DISK_LAYOUT_CHANGE: NTSTATUS = 0xC0380044; +pub const STATUS_VOLMGR_VOLUME_CONTAINS_MISSING_DISK: NTSTATUS = 0xC0380045; +pub const STATUS_VOLMGR_VOLUME_ID_INVALID: NTSTATUS = 0xC0380046; +pub const STATUS_VOLMGR_VOLUME_LENGTH_INVALID: NTSTATUS = 0xC0380047; +pub const STATUS_VOLMGR_VOLUME_LENGTH_NOT_SECTOR_SIZE_MULTIPLE: NTSTATUS = 0xC0380048; +pub const STATUS_VOLMGR_VOLUME_NOT_MIRRORED: NTSTATUS = 0xC0380049; +pub const STATUS_VOLMGR_VOLUME_NOT_RETAINED: NTSTATUS = 0xC038004A; +pub const STATUS_VOLMGR_VOLUME_OFFLINE: NTSTATUS = 0xC038004B; +pub const STATUS_VOLMGR_VOLUME_RETAINED: NTSTATUS = 0xC038004C; +pub const STATUS_VOLMGR_NUMBER_OF_EXTENTS_INVALID: NTSTATUS = 0xC038004D; +pub const STATUS_VOLMGR_DIFFERENT_SECTOR_SIZE: NTSTATUS = 0xC038004E; +pub const STATUS_VOLMGR_BAD_BOOT_DISK: NTSTATUS = 0xC038004F; +pub const STATUS_VOLMGR_PACK_CONFIG_OFFLINE: NTSTATUS = 0xC0380050; +pub const STATUS_VOLMGR_PACK_CONFIG_ONLINE: NTSTATUS = 0xC0380051; +pub const STATUS_VOLMGR_NOT_PRIMARY_PACK: NTSTATUS = 0xC0380052; +pub const STATUS_VOLMGR_PACK_LOG_UPDATE_FAILED: NTSTATUS = 0xC0380053; +pub const STATUS_VOLMGR_NUMBER_OF_DISKS_IN_PLEX_INVALID: NTSTATUS = 0xC0380054; +pub const STATUS_VOLMGR_NUMBER_OF_DISKS_IN_MEMBER_INVALID: NTSTATUS = 0xC0380055; +pub const STATUS_VOLMGR_VOLUME_MIRRORED: NTSTATUS = 0xC0380056; +pub const STATUS_VOLMGR_PLEX_NOT_SIMPLE_SPANNED: NTSTATUS = 0xC0380057; +pub const STATUS_VOLMGR_NO_VALID_LOG_COPIES: NTSTATUS = 0xC0380058; +pub const STATUS_VOLMGR_PRIMARY_PACK_PRESENT: NTSTATUS = 0xC0380059; +pub const STATUS_VOLMGR_NUMBER_OF_DISKS_INVALID: NTSTATUS = 0xC038005A; +pub const STATUS_VOLMGR_MIRROR_NOT_SUPPORTED: NTSTATUS = 0xC038005B; +pub const STATUS_VOLMGR_RAID5_NOT_SUPPORTED: NTSTATUS = 0xC038005C; +pub const STATUS_BCD_NOT_ALL_ENTRIES_IMPORTED: NTSTATUS = 0x80390001; +pub const STATUS_BCD_TOO_MANY_ELEMENTS: NTSTATUS = 0xC0390002; +pub const STATUS_BCD_NOT_ALL_ENTRIES_SYNCHRONIZED: NTSTATUS = 0x80390003; +pub const STATUS_VHD_DRIVE_FOOTER_MISSING: NTSTATUS = 0xC03A0001; +pub const STATUS_VHD_DRIVE_FOOTER_CHECKSUM_MISMATCH: NTSTATUS = 0xC03A0002; +pub const STATUS_VHD_DRIVE_FOOTER_CORRUPT: NTSTATUS = 0xC03A0003; +pub const STATUS_VHD_FORMAT_UNKNOWN: NTSTATUS = 0xC03A0004; +pub const STATUS_VHD_FORMAT_UNSUPPORTED_VERSION: NTSTATUS = 0xC03A0005; +pub const STATUS_VHD_SPARSE_HEADER_CHECKSUM_MISMATCH: NTSTATUS = 0xC03A0006; +pub const STATUS_VHD_SPARSE_HEADER_UNSUPPORTED_VERSION: NTSTATUS = 0xC03A0007; +pub const STATUS_VHD_SPARSE_HEADER_CORRUPT: NTSTATUS = 0xC03A0008; +pub const STATUS_VHD_BLOCK_ALLOCATION_FAILURE: NTSTATUS = 0xC03A0009; +pub const STATUS_VHD_BLOCK_ALLOCATION_TABLE_CORRUPT: NTSTATUS = 0xC03A000A; +pub const STATUS_VHD_INVALID_BLOCK_SIZE: NTSTATUS = 0xC03A000B; +pub const STATUS_VHD_BITMAP_MISMATCH: NTSTATUS = 0xC03A000C; +pub const STATUS_VHD_PARENT_VHD_NOT_FOUND: NTSTATUS = 0xC03A000D; +pub const STATUS_VHD_CHILD_PARENT_ID_MISMATCH: NTSTATUS = 0xC03A000E; +pub const STATUS_VHD_CHILD_PARENT_TIMESTAMP_MISMATCH: NTSTATUS = 0xC03A000F; +pub const STATUS_VHD_METADATA_READ_FAILURE: NTSTATUS = 0xC03A0010; +pub const STATUS_VHD_METADATA_WRITE_FAILURE: NTSTATUS = 0xC03A0011; +pub const STATUS_VHD_INVALID_SIZE: NTSTATUS = 0xC03A0012; +pub const STATUS_VHD_INVALID_FILE_SIZE: NTSTATUS = 0xC03A0013; +pub const STATUS_VIRTDISK_PROVIDER_NOT_FOUND: NTSTATUS = 0xC03A0014; +pub const STATUS_VIRTDISK_NOT_VIRTUAL_DISK: NTSTATUS = 0xC03A0015; +pub const STATUS_VHD_PARENT_VHD_ACCESS_DENIED: NTSTATUS = 0xC03A0016; +pub const STATUS_VHD_CHILD_PARENT_SIZE_MISMATCH: NTSTATUS = 0xC03A0017; +pub const STATUS_VHD_DIFFERENCING_CHAIN_CYCLE_DETECTED: NTSTATUS = 0xC03A0018; +pub const STATUS_VHD_DIFFERENCING_CHAIN_ERROR_IN_PARENT: NTSTATUS = 0xC03A0019; +pub const STATUS_VIRTUAL_DISK_LIMITATION: NTSTATUS = 0xC03A001A; +pub const STATUS_VHD_INVALID_TYPE: NTSTATUS = 0xC03A001B; +pub const STATUS_VHD_INVALID_STATE: NTSTATUS = 0xC03A001C; +pub const STATUS_VIRTDISK_UNSUPPORTED_DISK_SECTOR_SIZE: NTSTATUS = 0xC03A001D; +pub const STATUS_VIRTDISK_DISK_ALREADY_OWNED: NTSTATUS = 0xC03A001E; +pub const STATUS_VIRTDISK_DISK_ONLINE_AND_WRITABLE: NTSTATUS = 0xC03A001F; +pub const STATUS_CTLOG_TRACKING_NOT_INITIALIZED: NTSTATUS = 0xC03A0020; +pub const STATUS_CTLOG_LOGFILE_SIZE_EXCEEDED_MAXSIZE: NTSTATUS = 0xC03A0021; +pub const STATUS_CTLOG_VHD_CHANGED_OFFLINE: NTSTATUS = 0xC03A0022; +pub const STATUS_CTLOG_INVALID_TRACKING_STATE: NTSTATUS = 0xC03A0023; +pub const STATUS_CTLOG_INCONSISTENT_TRACKING_FILE: NTSTATUS = 0xC03A0024; +pub const STATUS_VHD_METADATA_FULL: NTSTATUS = 0xC03A0028; +pub const STATUS_VHD_INVALID_CHANGE_TRACKING_ID: NTSTATUS = 0xC03A0029; +pub const STATUS_VHD_CHANGE_TRACKING_DISABLED: NTSTATUS = 0xC03A002A; +pub const STATUS_VHD_MISSING_CHANGE_TRACKING_INFORMATION: NTSTATUS = 0xC03A0030; +pub const STATUS_VHD_RESIZE_WOULD_TRUNCATE_DATA: NTSTATUS = 0xC03A0031; +pub const STATUS_VHD_COULD_NOT_COMPUTE_MINIMUM_VIRTUAL_SIZE: NTSTATUS = 0xC03A0032; +pub const STATUS_VHD_ALREADY_AT_OR_BELOW_MINIMUM_VIRTUAL_SIZE: NTSTATUS = 0xC03A0033; +pub const STATUS_QUERY_STORAGE_ERROR: NTSTATUS = 0x803A0001; +pub const STATUS_RKF_KEY_NOT_FOUND: NTSTATUS = 0xC0400001; +pub const STATUS_RKF_DUPLICATE_KEY: NTSTATUS = 0xC0400002; +pub const STATUS_RKF_BLOB_FULL: NTSTATUS = 0xC0400003; +pub const STATUS_RKF_STORE_FULL: NTSTATUS = 0xC0400004; +pub const STATUS_RKF_FILE_BLOCKED: NTSTATUS = 0xC0400005; +pub const STATUS_RKF_ACTIVE_KEY: NTSTATUS = 0xC0400006; +pub const STATUS_RDBSS_RESTART_OPERATION: NTSTATUS = 0xC0410001; +pub const STATUS_RDBSS_CONTINUE_OPERATION: NTSTATUS = 0xC0410002; +pub const STATUS_RDBSS_POST_OPERATION: NTSTATUS = 0xC0410003; +pub const STATUS_BTH_ATT_INVALID_HANDLE: NTSTATUS = 0xC0420001; +pub const STATUS_BTH_ATT_READ_NOT_PERMITTED: NTSTATUS = 0xC0420002; +pub const STATUS_BTH_ATT_WRITE_NOT_PERMITTED: NTSTATUS = 0xC0420003; +pub const STATUS_BTH_ATT_INVALID_PDU: NTSTATUS = 0xC0420004; +pub const STATUS_BTH_ATT_INSUFFICIENT_AUTHENTICATION: NTSTATUS = 0xC0420005; +pub const STATUS_BTH_ATT_REQUEST_NOT_SUPPORTED: NTSTATUS = 0xC0420006; +pub const STATUS_BTH_ATT_INVALID_OFFSET: NTSTATUS = 0xC0420007; +pub const STATUS_BTH_ATT_INSUFFICIENT_AUTHORIZATION: NTSTATUS = 0xC0420008; +pub const STATUS_BTH_ATT_PREPARE_QUEUE_FULL: NTSTATUS = 0xC0420009; +pub const STATUS_BTH_ATT_ATTRIBUTE_NOT_FOUND: NTSTATUS = 0xC042000A; +pub const STATUS_BTH_ATT_ATTRIBUTE_NOT_LONG: NTSTATUS = 0xC042000B; +pub const STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE: NTSTATUS = 0xC042000C; +pub const STATUS_BTH_ATT_INVALID_ATTRIBUTE_VALUE_LENGTH: NTSTATUS = 0xC042000D; +pub const STATUS_BTH_ATT_UNLIKELY: NTSTATUS = 0xC042000E; +pub const STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION: NTSTATUS = 0xC042000F; +pub const STATUS_BTH_ATT_UNSUPPORTED_GROUP_TYPE: NTSTATUS = 0xC0420010; +pub const STATUS_BTH_ATT_INSUFFICIENT_RESOURCES: NTSTATUS = 0xC0420011; +pub const STATUS_BTH_ATT_UNKNOWN_ERROR: NTSTATUS = 0xC0421000; +pub const STATUS_SECUREBOOT_ROLLBACK_DETECTED: NTSTATUS = 0xC0430001; +pub const STATUS_SECUREBOOT_POLICY_VIOLATION: NTSTATUS = 0xC0430002; +pub const STATUS_SECUREBOOT_INVALID_POLICY: NTSTATUS = 0xC0430003; +pub const STATUS_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND: NTSTATUS = 0xC0430004; +pub const STATUS_SECUREBOOT_POLICY_NOT_SIGNED: NTSTATUS = 0xC0430005; +pub const STATUS_SECUREBOOT_NOT_ENABLED: NTSTATUS = 0x80430006; +pub const STATUS_SECUREBOOT_FILE_REPLACED: NTSTATUS = 0xC0430007; +pub const STATUS_SECUREBOOT_POLICY_NOT_AUTHORIZED: NTSTATUS = 0xC0430008; +pub const STATUS_SECUREBOOT_POLICY_UNKNOWN: NTSTATUS = 0xC0430009; +pub const STATUS_SECUREBOOT_POLICY_MISSING_ANTIROLLBACKVERSION: NTSTATUS = 0xC043000A; +pub const STATUS_SECUREBOOT_PLATFORM_ID_MISMATCH: NTSTATUS = 0xC043000B; +pub const STATUS_SECUREBOOT_POLICY_ROLLBACK_DETECTED: NTSTATUS = 0xC043000C; +pub const STATUS_SECUREBOOT_POLICY_UPGRADE_MISMATCH: NTSTATUS = 0xC043000D; +pub const STATUS_SECUREBOOT_REQUIRED_POLICY_FILE_MISSING: NTSTATUS = 0xC043000E; +pub const STATUS_SECUREBOOT_NOT_BASE_POLICY: NTSTATUS = 0xC043000F; +pub const STATUS_SECUREBOOT_NOT_SUPPLEMENTAL_POLICY: NTSTATUS = 0xC0430010; +pub const STATUS_PLATFORM_MANIFEST_NOT_AUTHORIZED: NTSTATUS = 0xC0EB0001; +pub const STATUS_PLATFORM_MANIFEST_INVALID: NTSTATUS = 0xC0EB0002; +pub const STATUS_PLATFORM_MANIFEST_FILE_NOT_AUTHORIZED: NTSTATUS = 0xC0EB0003; +pub const STATUS_PLATFORM_MANIFEST_CATALOG_NOT_AUTHORIZED: NTSTATUS = 0xC0EB0004; +pub const STATUS_PLATFORM_MANIFEST_BINARY_ID_NOT_FOUND: NTSTATUS = 0xC0EB0005; +pub const STATUS_PLATFORM_MANIFEST_NOT_ACTIVE: NTSTATUS = 0xC0EB0006; +pub const STATUS_PLATFORM_MANIFEST_NOT_SIGNED: NTSTATUS = 0xC0EB0007; +pub const STATUS_SYSTEM_INTEGRITY_ROLLBACK_DETECTED: NTSTATUS = 0xC0E90001; +pub const STATUS_SYSTEM_INTEGRITY_POLICY_VIOLATION: NTSTATUS = 0xC0E90002; +pub const STATUS_SYSTEM_INTEGRITY_INVALID_POLICY: NTSTATUS = 0xC0E90003; +pub const STATUS_SYSTEM_INTEGRITY_POLICY_NOT_SIGNED: NTSTATUS = 0xC0E90004; +pub const STATUS_NO_APPLICABLE_APP_LICENSES_FOUND: NTSTATUS = 0xC0EA0001; +pub const STATUS_CLIP_LICENSE_NOT_FOUND: NTSTATUS = 0xC0EA0002; +pub const STATUS_CLIP_DEVICE_LICENSE_MISSING: NTSTATUS = 0xC0EA0003; +pub const STATUS_CLIP_LICENSE_INVALID_SIGNATURE: NTSTATUS = 0xC0EA0004; +pub const STATUS_CLIP_KEYHOLDER_LICENSE_MISSING_OR_INVALID: NTSTATUS = 0xC0EA0005; +pub const STATUS_CLIP_LICENSE_EXPIRED: NTSTATUS = 0xC0EA0006; +pub const STATUS_CLIP_LICENSE_SIGNED_BY_UNKNOWN_SOURCE: NTSTATUS = 0xC0EA0007; +pub const STATUS_CLIP_LICENSE_NOT_SIGNED: NTSTATUS = 0xC0EA0008; +pub const STATUS_CLIP_LICENSE_HARDWARE_ID_OUT_OF_TOLERANCE: NTSTATUS = 0xC0EA0009; +pub const STATUS_CLIP_LICENSE_DEVICE_ID_MISMATCH: NTSTATUS = 0xC0EA000A; +pub const STATUS_AUDIO_ENGINE_NODE_NOT_FOUND: NTSTATUS = 0xC0440001; +pub const STATUS_HDAUDIO_EMPTY_CONNECTION_LIST: NTSTATUS = 0xC0440002; +pub const STATUS_HDAUDIO_CONNECTION_LIST_NOT_SUPPORTED: NTSTATUS = 0xC0440003; +pub const STATUS_HDAUDIO_NO_LOGICAL_DEVICES_CREATED: NTSTATUS = 0xC0440004; +pub const STATUS_HDAUDIO_NULL_LINKED_LIST_ENTRY: NTSTATUS = 0xC0440005; +pub const STATUS_SPACES_REPAIRED: NTSTATUS = 0x00E70000; +pub const STATUS_SPACES_PAUSE: NTSTATUS = 0x00E70001; +pub const STATUS_SPACES_COMPLETE: NTSTATUS = 0x00E70002; +pub const STATUS_SPACES_FAULT_DOMAIN_TYPE_INVALID: NTSTATUS = 0xC0E70001; +pub const STATUS_SPACES_RESILIENCY_TYPE_INVALID: NTSTATUS = 0xC0E70003; +pub const STATUS_SPACES_DRIVE_SECTOR_SIZE_INVALID: NTSTATUS = 0xC0E70004; +pub const STATUS_SPACES_DRIVE_REDUNDANCY_INVALID: NTSTATUS = 0xC0E70006; +pub const STATUS_SPACES_NUMBER_OF_DATA_COPIES_INVALID: NTSTATUS = 0xC0E70007; +pub const STATUS_SPACES_INTERLEAVE_LENGTH_INVALID: NTSTATUS = 0xC0E70009; +pub const STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID: NTSTATUS = 0xC0E7000A; +pub const STATUS_SPACES_NOT_ENOUGH_DRIVES: NTSTATUS = 0xC0E7000B; +pub const STATUS_SPACES_EXTENDED_ERROR: NTSTATUS = 0xC0E7000C; +pub const STATUS_SPACES_PROVISIONING_TYPE_INVALID: NTSTATUS = 0xC0E7000D; +pub const STATUS_SPACES_ALLOCATION_SIZE_INVALID: NTSTATUS = 0xC0E7000E; +pub const STATUS_SPACES_ENCLOSURE_AWARE_INVALID: NTSTATUS = 0xC0E7000F; +pub const STATUS_SPACES_WRITE_CACHE_SIZE_INVALID: NTSTATUS = 0xC0E70010; +pub const STATUS_SPACES_NUMBER_OF_GROUPS_INVALID: NTSTATUS = 0xC0E70011; +pub const STATUS_SPACES_DRIVE_OPERATIONAL_STATE_INVALID: NTSTATUS = 0xC0E70012; +pub const STATUS_SPACES_UPDATE_COLUMN_STATE: NTSTATUS = 0xC0E70013; +pub const STATUS_SPACES_MAP_REQUIRED: NTSTATUS = 0xC0E70014; +pub const STATUS_SPACES_UNSUPPORTED_VERSION: NTSTATUS = 0xC0E70015; +pub const STATUS_SPACES_CORRUPT_METADATA: NTSTATUS = 0xC0E70016; +pub const STATUS_SPACES_DRT_FULL: NTSTATUS = 0xC0E70017; +pub const STATUS_SPACES_INCONSISTENCY: NTSTATUS = 0xC0E70018; +pub const STATUS_SPACES_LOG_NOT_READY: NTSTATUS = 0xC0E70019; +pub const STATUS_SPACES_NO_REDUNDANCY: NTSTATUS = 0xC0E7001A; +pub const STATUS_SPACES_DRIVE_NOT_READY: NTSTATUS = 0xC0E7001B; +pub const STATUS_SPACES_DRIVE_SPLIT: NTSTATUS = 0xC0E7001C; +pub const STATUS_SPACES_DRIVE_LOST_DATA: NTSTATUS = 0xC0E7001D; +pub const STATUS_VOLSNAP_BOOTFILE_NOT_VALID: NTSTATUS = 0xC0500003; +pub const STATUS_VOLSNAP_ACTIVATION_TIMEOUT: NTSTATUS = 0xC0500004; +pub const STATUS_IO_PREEMPTED: NTSTATUS = 0xC0510001; +pub const STATUS_SVHDX_ERROR_STORED: NTSTATUS = 0xC05C0000; +pub const STATUS_SVHDX_ERROR_NOT_AVAILABLE: NTSTATUS = 0xC05CFF00; +pub const STATUS_SVHDX_UNIT_ATTENTION_AVAILABLE: NTSTATUS = 0xC05CFF01; +pub const STATUS_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED: NTSTATUS = 0xC05CFF02; +pub const STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED: NTSTATUS = 0xC05CFF03; +pub const STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED: NTSTATUS = 0xC05CFF04; +pub const STATUS_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED: NTSTATUS = 0xC05CFF05; +pub const STATUS_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED: NTSTATUS + = 0xC05CFF06; +pub const STATUS_SVHDX_RESERVATION_CONFLICT: NTSTATUS = 0xC05CFF07; +pub const STATUS_SVHDX_WRONG_FILE_TYPE: NTSTATUS = 0xC05CFF08; +pub const STATUS_SVHDX_VERSION_MISMATCH: NTSTATUS = 0xC05CFF09; +pub const STATUS_VHD_SHARED: NTSTATUS = 0xC05CFF0A; +pub const STATUS_SVHDX_NO_INITIATOR: NTSTATUS = 0xC05CFF0B; +pub const STATUS_VHDSET_BACKING_STORAGE_NOT_FOUND: NTSTATUS = 0xC05CFF0C; +pub const STATUS_SMB_NO_PREAUTH_INTEGRITY_HASH_OVERLAP: NTSTATUS = 0xC05D0000; +pub const STATUS_SMB_BAD_CLUSTER_DIALECT: NTSTATUS = 0xC05D0001; +pub const STATUS_SMB_GUEST_LOGON_BLOCKED: NTSTATUS = 0xC05D0002; +pub const STATUS_SECCORE_INVALID_COMMAND: NTSTATUS = 0xC0E80000; +pub const STATUS_VSM_NOT_INITIALIZED: NTSTATUS = 0xC0450000; +pub const STATUS_VSM_DMA_PROTECTION_NOT_IN_USE: NTSTATUS = 0xC0450001; diff --git a/bash-5.1/vendor/winapi/src/shared/qos.rs b/bash-5.1/vendor/winapi/src/shared/qos.rs new file mode 100644 index 0000000000000000000000000000000000000000..5117bd26a09e15639332755d8ded295d83e154f9 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/qos.rs @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! QoS definitions for NDIS components. +use shared::minwindef::ULONG; +pub type SERVICETYPE = ULONG; +STRUCT!{struct FLOWSPEC { + TokenRate: ULONG, + TokenBucketSize: ULONG, + PeakBandwidth: ULONG, + Latency: ULONG, + DelayVariation: ULONG, + ServiceType: SERVICETYPE, + MaxSduSize: ULONG, + MinimumPolicedSize: ULONG, +}} +pub type PFLOWSPEC = *mut FLOWSPEC; +pub type LPFLOWSPEC = *mut FLOWSPEC; diff --git a/bash-5.1/vendor/winapi/src/shared/rpc.rs b/bash-5.1/vendor/winapi/src/shared/rpc.rs new file mode 100644 index 0000000000000000000000000000000000000000..5af7e095d31293c729db451f0e23fe2269e1b3a5 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/rpc.rs @@ -0,0 +1,9 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Master include file for RPC applications. +use ctypes::{c_long, c_void}; +pub type I_RPC_HANDLE = *mut c_void; +pub type RPC_STATUS = c_long; diff --git a/bash-5.1/vendor/winapi/src/shared/rpcdce.rs b/bash-5.1/vendor/winapi/src/shared/rpcdce.rs new file mode 100644 index 0000000000000000000000000000000000000000..ab2879d92afa23af97df09e85a1932a7f9c6989b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/rpcdce.rs @@ -0,0 +1,563 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module contains the DCE RPC runtime APIs. +use ctypes::{c_int, c_uchar, c_uint, c_ulong, c_ushort, c_void, wchar_t}; +use shared::guiddef::GUID; +use shared::minwindef::DWORD; +use shared::rpc::{I_RPC_HANDLE, RPC_STATUS}; +pub type RPC_CSTR = *mut c_uchar; +pub type RPC_WSTR = *mut wchar_t; +pub type RPC_CWSTR = *const wchar_t; +pub type RPC_BINDING_HANDLE = I_RPC_HANDLE; +pub type handle_t = RPC_BINDING_HANDLE; +pub type rpc_binding_handle_t = RPC_BINDING_HANDLE; +pub type UUID = GUID; +pub type uuid_t = UUID; +STRUCT!{struct RPC_BINDING_VECTOR { + Count: c_ulong, + BindingH: [RPC_BINDING_HANDLE; 1], +}} +pub type rpc_binding_vector_t = RPC_BINDING_VECTOR; +STRUCT!{struct UUID_VECTOR { + Count: c_ulong, + Uuid: [*mut UUID; 1], +}} +pub type uuid_vector_t = UUID_VECTOR; +pub type RPC_IF_HANDLE = *mut c_void; +STRUCT!{struct RPC_IF_ID { + Uuid: UUID, + VersMajor: c_ushort, + VersMinor: c_ushort, +}} +pub const RPC_C_BINDING_INFINITE_TIMEOUT: DWORD = 10; +pub const RPC_C_BINDING_MIN_TIMEOUT: DWORD = 0; +pub const RPC_C_BINDING_DEFAULT_TIMEOUT: DWORD = 5; +pub const RPC_C_BINDING_MAX_TIMEOUT: DWORD = 9; +pub const RPC_C_CANCEL_INFINITE_TIMEOUT: c_int = -1; +pub const RPC_C_LISTEN_MAX_CALLS_DEFAULT: DWORD = 1234; +pub const RPC_C_PROTSEQ_MAX_REQS_DEFAULT: DWORD = 10; +pub const RPC_C_BIND_TO_ALL_NICS: DWORD = 1; +pub const RPC_C_USE_INTERNET_PORT: DWORD = 0x1; +pub const RPC_C_USE_INTRANET_PORT: DWORD = 0x2; +pub const RPC_C_DONT_FAIL: DWORD = 0x4; +pub const RPC_C_RPCHTTP_USE_LOAD_BALANCE: DWORD = 0x8; +pub const RPC_C_MQ_TEMPORARY: DWORD = 0x0000; +pub const RPC_C_MQ_PERMANENT: DWORD = 0x0001; +pub const RPC_C_MQ_CLEAR_ON_OPEN: DWORD = 0x0002; +pub const RPC_C_MQ_USE_EXISTING_SECURITY: DWORD = 0x0004; +pub const RPC_C_MQ_AUTHN_LEVEL_NONE: DWORD = 0x0000; +pub const RPC_C_MQ_AUTHN_LEVEL_PKT_INTEGRITY: DWORD = 0x0008; +pub const RPC_C_MQ_AUTHN_LEVEL_PKT_PRIVACY: DWORD = 0x0010; +pub const RPC_C_OPT_MQ_DELIVERY: DWORD = 1; +pub const RPC_C_OPT_MQ_PRIORITY: DWORD = 2; +pub const RPC_C_OPT_MQ_JOURNAL: DWORD = 3; +pub const RPC_C_OPT_MQ_ACKNOWLEDGE: DWORD = 4; +pub const RPC_C_OPT_MQ_AUTHN_SERVICE: DWORD = 5; +pub const RPC_C_OPT_MQ_AUTHN_LEVEL: DWORD = 6; +pub const RPC_C_OPT_MQ_TIME_TO_REACH_QUEUE: DWORD = 7; +pub const RPC_C_OPT_MQ_TIME_TO_BE_RECEIVED: DWORD = 8; +pub const RPC_C_OPT_BINDING_NONCAUSAL: DWORD = 9; +pub const RPC_C_OPT_SECURITY_CALLBACK: DWORD = 10; +pub const RPC_C_OPT_UNIQUE_BINDING: DWORD = 11; +pub const RPC_C_OPT_CALL_TIMEOUT: DWORD = 12; +pub const RPC_C_OPT_DONT_LINGER: DWORD = 13; +pub const RPC_C_OPT_TRUST_PEER: DWORD = 14; +pub const RPC_C_OPT_ASYNC_BLOCK: DWORD = 15; +pub const RPC_C_OPT_OPTIMIZE_TIME: DWORD = 16; +pub const RPC_C_OPT_MAX_OPTIONS: DWORD = 17; +pub const RPC_C_MQ_EXPRESS: DWORD = 0; +pub const RPC_C_MQ_RECOVERABLE: DWORD = 1; +pub const RPC_C_MQ_JOURNAL_NONE: DWORD = 0; +pub const RPC_C_MQ_JOURNAL_DEADLETTER: DWORD = 1; +pub const RPC_C_MQ_JOURNAL_ALWAYS: DWORD = 2; +pub const RPC_C_FULL_CERT_CHAIN: DWORD = 0x0001; +STRUCT!{struct RPC_PROTSEQ_VECTORA { + Count: c_uint, + Protseq: [*mut c_uchar; 1], +}} +STRUCT!{struct RPC_PROTSEQ_VECTORW { + Count: c_uint, + Protseq: [*mut c_ushort; 1], +}} +STRUCT!{struct RPC_POLICY { + Length: c_uint, + EndpointFlags: c_ulong, + NICFlags: c_ulong, +}} +pub type PRPC_POLICY = *mut RPC_POLICY; +FN!{stdcall RPC_OBJECT_INQ_FN( + ObjectUuid: *mut UUID, + TypeUuid: *mut UUID, + Status: *mut RPC_STATUS, +) -> ()} +FN!{stdcall RPC_IF_CALLBACK_FN( + InterfaceUuid: RPC_IF_HANDLE, + Context: *mut c_void, +) -> RPC_STATUS} +FN!{stdcall RPC_SECURITY_CALLBACK_FN( + Context: *mut c_void, +) -> ()} +pub type RPC_MGR_EPV = c_void; +STRUCT!{struct RPC_STATS_VECTOR { + Count: c_uint, + Stats: [c_ulong; 1], +}} +pub const RPC_C_STATS_CALLS_IN: c_ulong = 0; +pub const RPC_C_STATS_CALLS_OUT: c_ulong = 1; +pub const RPC_C_STATS_PKTS_IN: c_ulong = 2; +pub const RPC_C_STATS_PKTS_OUT: c_ulong = 3; +STRUCT!{struct RPC_IF_ID_VECTOR { + Count: c_ulong, + IfId: [*mut RPC_IF_ID; 1], +}} +pub type RPC_AUTH_IDENTITY_HANDLE = *mut c_void; +pub type RPC_AUTHZ_HANDLE = *mut c_void; +pub const RPC_C_AUTHN_LEVEL_DEFAULT: DWORD = 0; +pub const RPC_C_AUTHN_LEVEL_NONE: DWORD = 1; +pub const RPC_C_AUTHN_LEVEL_CONNECT: DWORD = 2; +pub const RPC_C_AUTHN_LEVEL_CALL: DWORD = 3; +pub const RPC_C_AUTHN_LEVEL_PKT: DWORD = 4; +pub const RPC_C_AUTHN_LEVEL_PKT_INTEGRITY: DWORD = 5; +pub const RPC_C_AUTHN_LEVEL_PKT_PRIVACY: DWORD = 6; +pub const RPC_C_IMP_LEVEL_DEFAULT: DWORD = 0; +pub const RPC_C_IMP_LEVEL_ANONYMOUS: DWORD = 1; +pub const RPC_C_IMP_LEVEL_IDENTIFY: DWORD = 2; +pub const RPC_C_IMP_LEVEL_IMPERSONATE: DWORD = 3; +pub const RPC_C_IMP_LEVEL_DELEGATE: DWORD = 4; +pub const RPC_C_QOS_IDENTITY_STATIC: DWORD = 0; +pub const RPC_C_QOS_IDENTITY_DYNAMIC: DWORD = 1; +pub const RPC_C_QOS_CAPABILITIES_DEFAULT: DWORD = 0x0; +pub const RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH: DWORD = 0x1; +pub const RPC_C_QOS_CAPABILITIES_MAKE_FULLSIC: DWORD = 0x2; +pub const RPC_C_QOS_CAPABILITIES_ANY_AUTHORITY: DWORD = 0x4; +pub const RPC_C_QOS_CAPABILITIES_IGNORE_DELEGATE_FAILURE: DWORD = 0x8; +pub const RPC_C_QOS_CAPABILITIES_LOCAL_MA_HINT: DWORD = 0x10; +pub const RPC_C_QOS_CAPABILITIES_SCHANNEL_FULL_AUTH_IDENTITY: DWORD = 0x20; +pub const RPC_C_PROTECT_LEVEL_DEFAULT: DWORD = RPC_C_AUTHN_LEVEL_DEFAULT; +pub const RPC_C_PROTECT_LEVEL_NONE: DWORD = RPC_C_AUTHN_LEVEL_NONE; +pub const RPC_C_PROTECT_LEVEL_CONNECT: DWORD = RPC_C_AUTHN_LEVEL_CONNECT; +pub const RPC_C_PROTECT_LEVEL_CALL: DWORD = RPC_C_AUTHN_LEVEL_CALL; +pub const RPC_C_PROTECT_LEVEL_PKT: DWORD = RPC_C_AUTHN_LEVEL_PKT; +pub const RPC_C_PROTECT_LEVEL_PKT_INTEGRITY: DWORD = RPC_C_AUTHN_LEVEL_PKT_INTEGRITY; +pub const RPC_C_PROTECT_LEVEL_PKT_PRIVACY: DWORD = RPC_C_AUTHN_LEVEL_PKT_PRIVACY; +pub const RPC_C_AUTHN_NONE: DWORD = 0; +pub const RPC_C_AUTHN_DCE_PRIVATE: DWORD = 1; +pub const RPC_C_AUTHN_DCE_PUBLIC: DWORD = 2; +pub const RPC_C_AUTHN_DEC_PUBLIC: DWORD = 4; +pub const RPC_C_AUTHN_GSS_NEGOTIATE: DWORD = 9; +pub const RPC_C_AUTHN_WINNT: DWORD = 10; +pub const RPC_C_AUTHN_GSS_SCHANNEL: DWORD = 14; +pub const RPC_C_AUTHN_GSS_KERBEROS: DWORD = 16; +pub const RPC_C_AUTHN_DPA: DWORD = 17; +pub const RPC_C_AUTHN_MSN: DWORD = 18; +pub const RPC_C_AUTHN_DIGEST: DWORD = 21; +pub const RPC_C_AUTHN_KERNEL: DWORD = 20; +pub const RPC_C_AUTHN_NEGO_EXTENDER: DWORD = 30; +pub const RPC_C_AUTHN_PKU2U: DWORD = 31; +pub const RPC_C_AUTHN_LIVE_SSP: DWORD = 32; +pub const RPC_C_AUTHN_LIVEXP_SSP: DWORD = 35; +pub const RPC_C_AUTHN_MSONLINE: DWORD = 82; +pub const RPC_C_AUTHN_MQ: DWORD = 100; +pub const RPC_C_AUTHN_DEFAULT: DWORD = 0xFFFFFFFF; +pub const RPC_C_NO_CREDENTIALS: DWORD = 0xFFFFFFFF; +pub const RPC_C_SECURITY_QOS_VERSION: DWORD = 1; +pub const RPC_C_SECURITY_QOS_VERSION_1: DWORD = 1; +STRUCT!{struct RPC_SECURITY_QOS { + Version: c_ulong, + Capabilities: c_ulong, + IdentityTracking: c_ulong, + ImpersonationType: c_ulong, +}} +pub type PRPC_SECURITY_QOS = *mut RPC_SECURITY_QOS; +STRUCT!{struct SEC_WINNT_AUTH_IDENTITY_W { + User: *mut c_ushort, + UserLength: c_ulong, + Domain: *mut c_ushort, + DomainLength: c_ulong, + Password: *mut c_ushort, + PasswordLength: c_ulong, + Flags: c_ulong, +}} +pub type PSEC_WINNT_AUTH_IDENTITY_W = *mut SEC_WINNT_AUTH_IDENTITY_W; +STRUCT!{struct SEC_WINNT_AUTH_IDENTITY_A { + User: *mut c_uchar, + UserLength: c_ulong, + Domain: *mut c_uchar, + DomainLength: c_ulong, + Password: *mut c_uchar, + PasswordLength: c_ulong, + Flags: c_ulong, +}} +pub type PSEC_WINNT_AUTH_IDENTITY_A = *mut SEC_WINNT_AUTH_IDENTITY_A; +pub const RPC_C_AUTHN_INFO_TYPE_HTTP: c_ulong = 1; +pub const RPC_C_HTTP_AUTHN_TARGET_SERVER: c_ulong = 1; +pub const RPC_C_HTTP_AUTHN_TARGET_PROXY: c_ulong = 2; +pub const RPC_C_HTTP_AUTHN_SCHEME_BASIC: c_ulong = 0x00000001; +pub const RPC_C_HTTP_AUTHN_SCHEME_NTLM: c_ulong = 0x00000002; +pub const RPC_C_HTTP_AUTHN_SCHEME_PASSPORT: c_ulong = 0x00000004; +pub const RPC_C_HTTP_AUTHN_SCHEME_DIGEST: c_ulong = 0x00000008; +pub const RPC_C_HTTP_AUTHN_SCHEME_NEGOTIATE: c_ulong = 0x00000010; +pub const RPC_C_HTTP_AUTHN_SCHEME_CERT: c_ulong = 0x00010000; +pub const RPC_C_HTTP_FLAG_USE_SSL: c_ulong = 1; +pub const RPC_C_HTTP_FLAG_USE_FIRST_AUTH_SCHEME: c_ulong = 2; +pub const RPC_C_HTTP_FLAG_IGNORE_CERT_CN_INVALID: c_ulong = 8; +pub const RPC_C_HTTP_FLAG_ENABLE_CERT_REVOCATION_CHECK: c_ulong = 16; +STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_W { + TransportCredentials: *mut SEC_WINNT_AUTH_IDENTITY_W, + Flags: c_ulong, + AuthenticationTarget: c_ulong, + NumberOfAuthnSchemes: c_ulong, + AuthnSchemes: *mut c_ulong, + ServerCertificateSubject: *mut c_ushort, +}} +pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_W = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_W; +STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_A { + TransportCredentials: *mut SEC_WINNT_AUTH_IDENTITY_A, + Flags: c_ulong, + AuthenticationTarget: c_ulong, + NumberOfAuthnSchemes: c_ulong, + AuthnSchemes: *mut c_ulong, + ServerCertificateSubject: *mut c_uchar, +}} +pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_A = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_A; +STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_V2_W { + TransportCredentials: *mut SEC_WINNT_AUTH_IDENTITY_W, + Flags: c_ulong, + AuthenticationTarget: c_ulong, + NumberOfAuthnSchemes: c_ulong, + AuthnSchemes: *mut c_ulong, + ServerCertificateSubject: *mut c_ushort, + ProxyCredentials: *mut SEC_WINNT_AUTH_IDENTITY_W, + NumberOfProxyAuthnSchemes: c_ulong, + ProxyAuthnSchemes: *mut c_ulong, +}} +pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_V2_W = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_V2_W; +STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_V2_A { + TransportCredentials: *mut SEC_WINNT_AUTH_IDENTITY_A, + Flags: c_ulong, + AuthenticationTarget: c_ulong, + NumberOfAuthnSchemes: c_ulong, + AuthnSchemes: *mut c_ulong, + ServerCertificateSubject: *mut c_uchar, + ProxyCredentials: *mut SEC_WINNT_AUTH_IDENTITY_A, + NumberOfProxyAuthnSchemes: c_ulong, + ProxyAuthnSchemes: *mut c_ulong, +}} +pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_V2_A = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_V2_A; +STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_V3_W { + TransportCredentials: RPC_AUTH_IDENTITY_HANDLE, + Flags: c_ulong, + AuthenticationTarget: c_ulong, + NumberOfAuthnSchemes: c_ulong, + AuthnSchemes: *mut c_ulong, + ServerCertificateSubject: *mut c_ushort, + ProxyCredentials: *mut RPC_AUTH_IDENTITY_HANDLE, + NumberOfProxyAuthnSchemes: c_ulong, + ProxyAuthnSchemes: *mut c_ulong, +}} +pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_V3_W = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_V3_W; +STRUCT!{struct RPC_HTTP_TRANSPORT_CREDENTIALS_V3_A { + TransportCredentials: RPC_AUTH_IDENTITY_HANDLE, + Flags: c_ulong, + AuthenticationTarget: c_ulong, + NumberOfAuthnSchemes: c_ulong, + AuthnSchemes: *mut c_ulong, + ServerCertificateSubject: *mut c_uchar, + ProxyCredentials: *mut RPC_AUTH_IDENTITY_HANDLE, + NumberOfProxyAuthnSchemes: c_ulong, + ProxyAuthnSchemes: *mut c_ulong, +}} +pub type PRPC_HTTP_TRANSPORT_CREDENTIALS_V3_A = *mut RPC_HTTP_TRANSPORT_CREDENTIALS_V3_A; +STRUCT!{struct RPC_SECURITY_QOS_V2_W_union { + HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_W, +}} +STRUCT!{struct RPC_SECURITY_QOS_V2_W { + Version: c_ulong, + Capabilities: c_ulong, + IdentityTracking: c_ulong, + ImpersonationType: c_ulong, + AdditionalSecurityInfoType: c_ulong, + u: RPC_SECURITY_QOS_V2_W_union, +}} +pub type PRPC_SECURITY_QOS_V2_W = *mut RPC_SECURITY_QOS_V2_W; +STRUCT!{struct RPC_SECURITY_QOS_V2_A_union { + HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_A, +}} +STRUCT!{struct RPC_SECURITY_QOS_V2_A { + Version: c_ulong, + Capabilities: c_ulong, + IdentityTracking: c_ulong, + ImpersonationType: c_ulong, + AdditionalSecurityInfoType: c_ulong, + u: RPC_SECURITY_QOS_V2_A_union, +}} +pub type PRPC_SECURITY_QOS_V2_A = *mut RPC_SECURITY_QOS_V2_A; +STRUCT!{struct RPC_SECURITY_QOS_V3_W_union { + HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_W, +}} +STRUCT!{struct RPC_SECURITY_QOS_V3_W { + Version: c_ulong, + Capabilities: c_ulong, + IdentityTracking: c_ulong, + ImpersonationType: c_ulong, + AdditionalSecurityInfoType: c_ulong, + u: RPC_SECURITY_QOS_V3_W_union, + Sid: *mut c_void, +}} +pub type PRPC_SECURITY_QOS_V3_W = *mut RPC_SECURITY_QOS_V3_W; +STRUCT!{struct RPC_SECURITY_QOS_V3_A_union { + HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_A, +}} +STRUCT!{struct RPC_SECURITY_QOS_V3_A { + Version: c_ulong, + Capabilities: c_ulong, + IdentityTracking: c_ulong, + ImpersonationType: c_ulong, + AdditionalSecurityInfoType: c_ulong, + u: RPC_SECURITY_QOS_V3_A_union, + Sid: *mut c_void, +}} +pub type PRPC_SECURITY_QOS_V3_A = *mut RPC_SECURITY_QOS_V3_A; +STRUCT!{struct RPC_SECURITY_QOS_V4_W_union { + HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_W, +}} +STRUCT!{struct RPC_SECURITY_QOS_V4_W { + Version: c_ulong, + Capabilities: c_ulong, + IdentityTracking: c_ulong, + ImpersonationType: c_ulong, + AdditionalSecurityInfoType: c_ulong, + u: RPC_SECURITY_QOS_V4_W_union, + Sid: *mut c_void, + EffectiveOnly: c_uint, +}} +pub type PRPC_SECURITY_QOS_V4_W = *mut RPC_SECURITY_QOS_V4_W; +STRUCT!{struct RPC_SECURITY_QOS_V4_A_union { + HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_A, +}} +STRUCT!{struct RPC_SECURITY_QOS_V4_A { + Version: c_ulong, + Capabilities: c_ulong, + IdentityTracking: c_ulong, + ImpersonationType: c_ulong, + AdditionalSecurityInfoType: c_ulong, + u: RPC_SECURITY_QOS_V4_A_union, + Sid: *mut c_void, + EffectiveOnly: c_uint, +}} +pub type PRPC_SECURITY_QOS_V4_A = *mut RPC_SECURITY_QOS_V4_A; +STRUCT!{struct RPC_SECURITY_QOS_V5_W_union { + HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_W, +}} +STRUCT!{struct RPC_SECURITY_QOS_V5_W { + Version: c_ulong, + Capabilities: c_ulong, + IdentityTracking: c_ulong, + ImpersonationType: c_ulong, + AdditionalSecurityInfoType: c_ulong, + u: RPC_SECURITY_QOS_V5_W_union, + Sid: *mut c_void, + EffectiveOnly: c_uint, + ServerSecurityDescriptor: *mut c_void, +}} +pub type PRPC_SECURITY_QOS_V5_W = *mut RPC_SECURITY_QOS_V5_W; +STRUCT!{struct RPC_SECURITY_QOS_V5_A_union { + HttpCredentials: *mut RPC_HTTP_TRANSPORT_CREDENTIALS_A, +}} +STRUCT!{struct RPC_SECURITY_QOS_V5_A { + Version: c_ulong, + Capabilities: c_ulong, + IdentityTracking: c_ulong, + ImpersonationType: c_ulong, + AdditionalSecurityInfoType: c_ulong, + u: RPC_SECURITY_QOS_V5_A_union, + Sid: *mut c_void, + EffectiveOnly: c_uint, + ServerSecurityDescriptor: *mut c_void, +}} +pub type PRPC_SECURITY_QOS_V5_A = *mut RPC_SECURITY_QOS_V5_A; +pub const RPC_PROTSEQ_TCP: c_ulong = 0x1; +pub const RPC_PROTSEQ_NMP: c_ulong = 0x2; +pub const RPC_PROTSEQ_LRPC: c_ulong = 0x3; +pub const RPC_PROTSEQ_HTTP: c_ulong = 0x4; +pub const RPC_BHT_OBJECT_UUID_VALID: c_ulong = 0x1; +pub const RPC_BHO_NONCAUSAL: c_ulong = 0x1; +pub const RPC_BHO_DONTLINGER: c_ulong = 0x2; +pub const RPC_BHO_EXCLUSIVE_AND_GUARANTEED: c_ulong = 0x4; +STRUCT!{struct RPC_BINDING_HANDLE_TEMPLATE_V1_W_union { + Reserved: *mut c_ushort, +}} +STRUCT!{struct RPC_BINDING_HANDLE_TEMPLATE_V1_W { + Version: c_ulong, + Flags: c_ulong, + ProtocolSequence: c_ulong, + NetworkAddress: *mut c_ushort, + StringEndpoint: *mut c_ushort, + u1: RPC_BINDING_HANDLE_TEMPLATE_V1_W_union, + ObjectUuid: UUID, +}} +pub type PRPC_BINDING_HANDLE_TEMPLATE_V1_W = *mut RPC_BINDING_HANDLE_TEMPLATE_V1_W; +STRUCT!{struct RPC_BINDING_HANDLE_TEMPLATE_V1_A_union { + Reserved: *mut c_uchar, +}} +STRUCT!{struct RPC_BINDING_HANDLE_TEMPLATE_V1_A { + Version: c_ulong, + Flags: c_ulong, + ProtocolSequence: c_ulong, + NetworkAddress: *mut c_uchar, + StringEndpoint: *mut c_uchar, + u1: RPC_BINDING_HANDLE_TEMPLATE_V1_A_union, + ObjectUuid: UUID, +}} +pub type PRPC_BINDING_HANDLE_TEMPLATE_V1_A = *mut RPC_BINDING_HANDLE_TEMPLATE_V1_A; +STRUCT!{struct RPC_BINDING_HANDLE_SECURITY_V1_W { + Version: c_ulong, + ServerPrincName: *mut c_ushort, + AuthnLevel: c_ulong, + AuthnSvc: c_ulong, + AuthIdentity: *mut SEC_WINNT_AUTH_IDENTITY_W, + SecurityQos: *mut RPC_SECURITY_QOS, +}} +pub type PRPC_BINDING_HANDLE_SECURITY_V1_W = *mut RPC_BINDING_HANDLE_SECURITY_V1_W; +STRUCT!{struct RPC_BINDING_HANDLE_SECURITY_V1_A { + Version: c_ulong, + ServerPrincName: *mut c_uchar, + AuthnLevel: c_ulong, + AuthnSvc: c_ulong, + AuthIdentity: *mut SEC_WINNT_AUTH_IDENTITY_A, + SecurityQos: *mut RPC_SECURITY_QOS, +}} +pub type PRPC_BINDING_HANDLE_SECURITY_V1_A = *mut RPC_BINDING_HANDLE_SECURITY_V1_A; +STRUCT!{struct RPC_BINDING_HANDLE_OPTIONS_V1 { + Version: c_ulong, + Flags: c_ulong, + ComTimeout: c_ulong, + CallTimeout: c_ulong, +}} +pub type PRPC_BINDING_HANDLE_OPTIONS_V1 = *mut RPC_BINDING_HANDLE_OPTIONS_V1; +ENUM!{enum RPC_HTTP_REDIRECTOR_STAGE { + RPCHTTP_RS_REDIRECT = 1, + RPCHTTP_RS_ACCESS_1, + RPCHTTP_RS_SESSION, + RPCHTTP_RS_ACCESS_2, + RPCHTTP_RS_INTERFACE, +}} +FN!{stdcall RPC_NEW_HTTP_PROXY_CHANNEL( + RedirectorStage: RPC_HTTP_REDIRECTOR_STAGE, + ServerName: RPC_WSTR, + ServerPort: RPC_WSTR, + RemoteUser: RPC_WSTR, + AuthType: RPC_WSTR, + ResourceUuid: *mut c_void, + SessionId: *mut c_void, + Interface: *mut c_void, + Reserved: *mut c_void, + Flags: c_ulong, + NewServerName: *mut RPC_WSTR, + NewServerPort: *mut RPC_WSTR, +) -> RPC_STATUS} +FN!{stdcall RPC_HTTP_PROXY_FREE_STRING( + String: RPC_WSTR, +) -> ()} +pub const RPC_C_AUTHZ_NONE: DWORD = 0; +pub const RPC_C_AUTHZ_NAME: DWORD = 1; +pub const RPC_C_AUTHZ_DCE: DWORD = 2; +pub const RPC_C_AUTHZ_DEFAULT: DWORD = 0xffffffff; +FN!{stdcall RPC_AUTH_KEY_RETRIEVAL_FN( + Arg: *mut c_void, + ServerPrincName: RPC_WSTR, + KeyVer: c_ulong, + Key: *mut *mut c_void, + Status: *mut RPC_STATUS, +) -> ()} +STRUCT!{struct RPC_CLIENT_INFORMATION1 { + UserName: *mut c_uchar, + ComputerName: *mut c_uchar, + Privilege: c_ushort, + AuthFlags: c_ulong, +}} +pub type PRPC_CLIENT_INFORMATION1 = *mut RPC_CLIENT_INFORMATION1; +pub type RPC_EP_INQ_HANDLE = *mut I_RPC_HANDLE; +pub const RPC_C_EP_ALL_ELTS: c_ulong = 0; +pub const RPC_C_EP_MATCH_BY_IF: c_ulong = 1; +pub const RPC_C_EP_MATCH_BY_OBJ: c_ulong = 2; +pub const RPC_C_EP_MATCH_BY_BOTH: c_ulong = 3; +pub const RPC_C_VERS_ALL: c_ulong = 1; +pub const RPC_C_VERS_COMPATIBLE: c_ulong = 2; +pub const RPC_C_VERS_EXACT: c_ulong = 3; +pub const RPC_C_VERS_MAJOR_ONLY: c_ulong = 4; +pub const RPC_C_VERS_UPTO: c_ulong = 5; +FN!{stdcall RPC_MGMT_AUTHORIZATION_FN( + ClientBinding: RPC_BINDING_HANDLE, + RequestedMgmtOperation: c_ulong, + Status: *mut RPC_STATUS, +) -> c_int} +pub const RPC_C_MGMT_INQ_IF_IDS: c_ulong = 0; +pub const RPC_C_MGMT_INQ_PRINC_NAME: c_ulong = 1; +pub const RPC_C_MGMT_INQ_STATS: c_ulong = 2; +pub const RPC_C_MGMT_IS_SERVER_LISTEN: c_ulong = 3; +pub const RPC_C_MGMT_STOP_SERVER_LISTEN: c_ulong = 4; +pub const RPC_IF_AUTOLISTEN: c_uint = 0x0001; +pub const RPC_IF_OLE: c_uint = 0x0002; +pub const RPC_IF_ALLOW_UNKNOWN_AUTHORITY: c_uint = 0x0004; +pub const RPC_IF_ALLOW_SECURE_ONLY: c_uint = 0x0008; +pub const RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH: c_uint = 0x0010; +pub const RPC_IF_ALLOW_LOCAL_ONLY: c_uint = 0x0020; +pub const RPC_IF_SEC_NO_CACHE: c_uint = 0x0040; +pub const RPC_IF_SEC_CACHE_PER_PROC: c_uint = 0x0080; +pub const RPC_IF_ASYNC_CALLBACK: c_uint = 0x0100; +pub const RPC_FW_IF_FLAG_DCOM: c_uint = 0x0001; +pub type RPC_INTERFACE_GROUP = *mut c_void; +pub type PRPC_INTERFACE_GROUP = *mut *mut c_void; +STRUCT!{struct RPC_ENDPOINT_TEMPLATEW { + Version: c_ulong, + ProtSeq: RPC_WSTR, + Endpoint: RPC_WSTR, + SecurityDescriptor: *mut c_void, + Backlog: c_ulong, +}} +pub type PRPC_ENDPOINT_TEMPLATEW = *mut RPC_ENDPOINT_TEMPLATEW; +STRUCT!{struct RPC_ENDPOINT_TEMPLATEA { + Version: c_ulong, + ProtSeq: RPC_CSTR, + Endpoint: RPC_CSTR, + SecurityDescriptor: *mut c_void, + Backlog: c_ulong, +}} +pub type PRPC_ENDPOINT_TEMPLATEA = *mut RPC_ENDPOINT_TEMPLATEA; +STRUCT!{struct RPC_INTERFACE_TEMPLATEA { + Version: c_ulong, + IfSpec: RPC_IF_HANDLE, + MgrTypeUuid: *mut UUID, + MgrEpv: *mut RPC_MGR_EPV, + Flags: c_uint, + MaxCalls: c_uint, + MaxRpcSize: c_uint, + IfCallback: *mut RPC_IF_CALLBACK_FN, + UuidVector: *mut UUID_VECTOR, + Annotation: RPC_CSTR, + SecurityDescriptor: *mut c_void, +}} +pub type PRPC_INTERFACE_TEMPLATEA = *mut RPC_INTERFACE_TEMPLATEA; +STRUCT!{struct RPC_INTERFACE_TEMPLATEW { + Version: c_ulong, + IfSpec: RPC_IF_HANDLE, + MgrTypeUuid: *mut UUID, + MgrEpv: *mut RPC_MGR_EPV, + Flags: c_uint, + MaxCalls: c_uint, + MaxRpcSize: c_uint, + IfCallback: *mut RPC_IF_CALLBACK_FN, + UuidVector: *mut UUID_VECTOR, + Annotation: RPC_WSTR, + SecurityDescriptor: *mut c_void, +}} +pub type PRPC_INTERFACE_TEMPLATEW = *mut RPC_INTERFACE_TEMPLATEW; +FN!{stdcall RPC_INTERFACE_GROUP_IDLE_CALLBACK_FN( + IfGroup: RPC_INTERFACE_GROUP, + IdleCallbackContext: *mut c_void, + IsGroupIdle: c_ulong, +) -> ()} diff --git a/bash-5.1/vendor/winapi/src/shared/rpcndr.rs b/bash-5.1/vendor/winapi/src/shared/rpcndr.rs new file mode 100644 index 0000000000000000000000000000000000000000..b65a3da05619ba36b4e323a2df75fd6969594e3d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/rpcndr.rs @@ -0,0 +1,25 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{__int64, __uint64, c_char, c_uchar, c_ulong}; +pub const NDR_CHAR_REP_MASK: c_ulong = 0x0000000F; +pub const NDR_INT_REP_MASK: c_ulong = 0x000000F0; +pub const NDR_FLOAT_REP_MASK: c_ulong = 0x0000FF00; +pub const NDR_LITTLE_ENDIAN: c_ulong = 0x00000010; +pub const NDR_BIG_ENDIAN: c_ulong = 0x00000000; +pub const NDR_IEEE_FLOAT: c_ulong = 0x00000000; +pub const NDR_VAX_FLOAT: c_ulong = 0x00000100; +pub const NDR_IBM_FLOAT: c_ulong = 0x00000300; +pub const NDR_ASCII_CHAR: c_ulong = 0x00000000; +pub const NDR_EBCDIC_CHAR: c_ulong = 0x00000001; +pub const NDR_LOCAL_DATA_REPRESENTATION: c_ulong = 0x00000010; +pub const NDR_LOCAL_ENDIAN: c_ulong = NDR_LITTLE_ENDIAN; +pub type small = c_char; +pub type byte = c_uchar; +pub type cs_byte = byte; +pub type boolean = c_uchar; +pub type hyper = __int64; +pub type MIDL_uhyper = __uint64; +// TODO Finish the rest diff --git a/bash-5.1/vendor/winapi/src/shared/sddl.rs b/bash-5.1/vendor/winapi/src/shared/sddl.rs new file mode 100644 index 0000000000000000000000000000000000000000..cf64387a4b4144c874b002756e30f10a5231837f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/sddl.rs @@ -0,0 +1,217 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::SIZE_T; +use shared::minwindef::{BOOL, DWORD, PULONG, UCHAR}; +use um::winnt::{LPCSTR, LPCWSTR, LPSTR, LPWSTR, PSECURITY_DESCRIPTOR, PSID, SECURITY_INFORMATION}; +pub const SDDL_REVISION_1: UCHAR = 1; +pub const SDDL_REVISION: UCHAR = SDDL_REVISION_1; +pub const SDDL_OWNER: &'static str = "O"; +pub const SDDL_GROUP: &'static str = "G"; +pub const SDDL_DACL: &'static str = "D"; +pub const SDDL_SACL: &'static str = "S"; +pub const SDDL_PROTECTED: &'static str = "P"; +pub const SDDL_AUTO_INHERIT_REQ: &'static str = "AR"; +pub const SDDL_AUTO_INHERITED: &'static str = "AI"; +pub const SDDL_NULL_ACL: &'static str = "NO_ACCESS_CONTROL"; +pub const SDDL_ACCESS_ALLOWED: &'static str = "A"; +pub const SDDL_ACCESS_DENIED: &'static str = "D"; +pub const SDDL_OBJECT_ACCESS_ALLOWED: &'static str = "OA"; +pub const SDDL_OBJECT_ACCESS_DENIED: &'static str = "OD"; +pub const SDDL_AUDIT: &'static str = "AU"; +pub const SDDL_ALARM: &'static str = "AL"; +pub const SDDL_OBJECT_AUDIT: &'static str = "OU"; +pub const SDDL_OBJECT_ALARM: &'static str = "OL"; +pub const SDDL_MANDATORY_LABEL: &'static str = "ML"; +pub const SDDL_PROCESS_TRUST_LABEL: &'static str = "TL"; +pub const SDDL_CALLBACK_ACCESS_ALLOWED: &'static str = "XA"; +pub const SDDL_CALLBACK_ACCESS_DENIED: &'static str = "XD"; +pub const SDDL_RESOURCE_ATTRIBUTE: &'static str = "RA"; +pub const SDDL_SCOPED_POLICY_ID: &'static str = "SP"; +pub const SDDL_CALLBACK_AUDIT: &'static str = "XU"; +pub const SDDL_CALLBACK_OBJECT_ACCESS_ALLOWED: &'static str = "ZA"; +pub const SDDL_ACCESS_FILTER: &'static str = "FL"; +pub const SDDL_INT: &'static str = "TI"; +pub const SDDL_UINT: &'static str = "TU"; +pub const SDDL_WSTRING: &'static str = "TS"; +pub const SDDL_SID: &'static str = "TD"; +pub const SDDL_BLOB: &'static str = "TX"; +pub const SDDL_BOOLEAN: &'static str = "TB"; +pub const SDDL_CONTAINER_INHERIT: &'static str = "CI"; +pub const SDDL_OBJECT_INHERIT: &'static str = "OI"; +pub const SDDL_NO_PROPAGATE: &'static str = "NP"; +pub const SDDL_INHERIT_ONLY: &'static str = "IO"; +pub const SDDL_INHERITED: &'static str = "ID"; +pub const SDDL_TRUST_PROTECTED_FILTER: &'static str = "TP"; +pub const SDDL_AUDIT_SUCCESS: &'static str = "SA"; +pub const SDDL_AUDIT_FAILURE: &'static str = "FA"; +pub const SDDL_READ_PROPERTY: &'static str = "RP"; +pub const SDDL_WRITE_PROPERTY: &'static str = "WP"; +pub const SDDL_CREATE_CHILD: &'static str = "CC"; +pub const SDDL_DELETE_CHILD: &'static str = "DC"; +pub const SDDL_LIST_CHILDREN: &'static str = "LC"; +pub const SDDL_SELF_WRITE: &'static str = "SW"; +pub const SDDL_LIST_OBJECT: &'static str = "LO"; +pub const SDDL_DELETE_TREE: &'static str = "DT"; +pub const SDDL_CONTROL_ACCESS: &'static str = "CR"; +pub const SDDL_READ_CONTROL: &'static str = "RC"; +pub const SDDL_WRITE_DAC: &'static str = "WD"; +pub const SDDL_WRITE_OWNER: &'static str = "WO"; +pub const SDDL_STANDARD_DELETE: &'static str = "SD"; +pub const SDDL_GENERIC_ALL: &'static str = "GA"; +pub const SDDL_GENERIC_READ: &'static str = "GR"; +pub const SDDL_GENERIC_WRITE: &'static str = "GW"; +pub const SDDL_GENERIC_EXECUTE: &'static str = "GX"; +pub const SDDL_FILE_ALL: &'static str = "FA"; +pub const SDDL_FILE_READ: &'static str = "FR"; +pub const SDDL_FILE_WRITE: &'static str = "FW"; +pub const SDDL_FILE_EXECUTE: &'static str = "FX"; +pub const SDDL_KEY_ALL: &'static str = "KA"; +pub const SDDL_KEY_READ: &'static str = "KR"; +pub const SDDL_KEY_WRITE: &'static str = "KW"; +pub const SDDL_KEY_EXECUTE: &'static str = "KX"; +pub const SDDL_NO_WRITE_UP: &'static str = "NW"; +pub const SDDL_NO_READ_UP: &'static str = "NR"; +pub const SDDL_NO_EXECUTE_UP: &'static str = "NX"; +pub const SDDL_ALIAS_SIZE: SIZE_T = 2; +pub const SDDL_DOMAIN_ADMINISTRATORS: &'static str = "DA"; +pub const SDDL_DOMAIN_GUESTS: &'static str = "DG"; +pub const SDDL_DOMAIN_USERS: &'static str = "DU"; +pub const SDDL_ENTERPRISE_DOMAIN_CONTROLLERS: &'static str = "ED"; +pub const SDDL_DOMAIN_DOMAIN_CONTROLLERS: &'static str = "DD"; +pub const SDDL_DOMAIN_COMPUTERS: &'static str = "DC"; +pub const SDDL_BUILTIN_ADMINISTRATORS: &'static str = "BA"; +pub const SDDL_BUILTIN_GUESTS: &'static str = "BG"; +pub const SDDL_BUILTIN_USERS: &'static str = "BU"; +pub const SDDL_LOCAL_ADMIN: &'static str = "LA"; +pub const SDDL_LOCAL_GUEST: &'static str = "LG"; +pub const SDDL_ACCOUNT_OPERATORS: &'static str = "AO"; +pub const SDDL_BACKUP_OPERATORS: &'static str = "BO"; +pub const SDDL_PRINTER_OPERATORS: &'static str = "PO"; +pub const SDDL_SERVER_OPERATORS: &'static str = "SO"; +pub const SDDL_AUTHENTICATED_USERS: &'static str = "AU"; +pub const SDDL_PERSONAL_SELF: &'static str = "PS"; +pub const SDDL_CREATOR_OWNER: &'static str = "CO"; +pub const SDDL_CREATOR_GROUP: &'static str = "CG"; +pub const SDDL_LOCAL_SYSTEM: &'static str = "SY"; +pub const SDDL_POWER_USERS: &'static str = "PU"; +pub const SDDL_EVERYONE: &'static str = "WD"; +pub const SDDL_REPLICATOR: &'static str = "RE"; +pub const SDDL_INTERACTIVE: &'static str = "IU"; +pub const SDDL_NETWORK: &'static str = "NU"; +pub const SDDL_SERVICE: &'static str = "SU"; +pub const SDDL_RESTRICTED_CODE: &'static str = "RC"; +pub const SDDL_WRITE_RESTRICTED_CODE: &'static str = "WR"; +pub const SDDL_ANONYMOUS: &'static str = "AN"; +pub const SDDL_SCHEMA_ADMINISTRATORS: &'static str = "SA"; +pub const SDDL_CERT_SERV_ADMINISTRATORS: &'static str = "CA"; +pub const SDDL_RAS_SERVERS: &'static str = "RS"; +pub const SDDL_ENTERPRISE_ADMINS: &'static str = "EA"; +pub const SDDL_GROUP_POLICY_ADMINS: &'static str = "PA"; +pub const SDDL_ALIAS_PREW2KCOMPACC: &'static str = "RU"; +pub const SDDL_LOCAL_SERVICE: &'static str = "LS"; +pub const SDDL_NETWORK_SERVICE: &'static str = "NS"; +pub const SDDL_REMOTE_DESKTOP: &'static str = "RD"; +pub const SDDL_NETWORK_CONFIGURATION_OPS: &'static str = "NO"; +pub const SDDL_PERFMON_USERS: &'static str = "MU"; +pub const SDDL_PERFLOG_USERS: &'static str = "LU"; +pub const SDDL_IIS_USERS: &'static str = "IS"; +pub const SDDL_CRYPTO_OPERATORS: &'static str = "CY"; +pub const SDDL_OWNER_RIGHTS: &'static str = "OW"; +pub const SDDL_EVENT_LOG_READERS: &'static str = "ER"; +pub const SDDL_ENTERPRISE_RO_DCs: &'static str = "RO"; +pub const SDDL_CERTSVC_DCOM_ACCESS: &'static str = "CD"; +pub const SDDL_ALL_APP_PACKAGES: &'static str = "AC"; +pub const SDDL_RDS_REMOTE_ACCESS_SERVERS: &'static str = "RA"; +pub const SDDL_RDS_ENDPOINT_SERVERS: &'static str = "ES"; +pub const SDDL_RDS_MANAGEMENT_SERVERS: &'static str = "MS"; +pub const SDDL_USER_MODE_DRIVERS: &'static str = "UD"; +pub const SDDL_HYPER_V_ADMINS: &'static str = "HA"; +pub const SDDL_CLONEABLE_CONTROLLERS: &'static str = "CN"; +pub const SDDL_ACCESS_CONTROL_ASSISTANCE_OPS: &'static str = "AA"; +pub const SDDL_REMOTE_MANAGEMENT_USERS: &'static str = "RM"; +pub const SDDL_AUTHORITY_ASSERTED: &'static str = "AS"; +pub const SDDL_SERVICE_ASSERTED: &'static str = "SS"; +pub const SDDL_PROTECTED_USERS: &'static str = "AP"; +pub const SDDL_KEY_ADMINS: &'static str = "KA"; +pub const SDDL_ENTERPRISE_KEY_ADMINS: &'static str = "EK"; +pub const SDDL_ML_LOW: &'static str = "LW"; +pub const SDDL_ML_MEDIUM: &'static str = "ME"; +pub const SDDL_ML_MEDIUM_PLUS: &'static str = "MP"; +pub const SDDL_ML_HIGH: &'static str = "HI"; +pub const SDDL_ML_SYSTEM: &'static str = "SI"; +pub const SDDL_SEPERATORC: char = ';'; +pub const SDDL_DELIMINATORC: char = ':'; +pub const SDDL_ACE_BEGINC: char = '('; +pub const SDDL_ACE_ENDC: char = ')'; +pub const SDDL_SPACEC: char = ' '; +pub const SDDL_ACE_COND_BEGINC: char = '('; +pub const SDDL_ACE_COND_ENDC: char = ')'; +pub const SDDL_ACE_COND_STRING_BEGINC: char = '"'; +pub const SDDL_ACE_COND_STRING_ENDC: char = '"'; +pub const SDDL_ACE_COND_COMPOSITEVALUE_BEGINC: char = '{'; +pub const SDDL_ACE_COND_COMPOSITEVALUE_ENDC: char = '}'; +pub const SDDL_ACE_COND_COMPOSITEVALUE_SEPERATORC: char = ','; +pub const SDDL_ACE_COND_BLOB_PREFIXC: char = '#'; +pub const SDDL_ACE_COND_SID_BEGINC: char = '('; +pub const SDDL_ACE_COND_SID_ENDC: char = ')'; +pub const SDDL_SEPERATOR: &'static str = ";"; +pub const SDDL_DELIMINATOR: &'static str = ":"; +pub const SDDL_ACE_BEGIN: &'static str = "("; +pub const SDDL_ACE_END: &'static str = ")"; +pub const SDDL_ACE_COND_BEGIN: &'static str = "("; +pub const SDDL_ACE_COND_END: &'static str = ")"; +pub const SDDL_SPACE: &'static str = " "; +pub const SDDL_ACE_COND_BLOB_PREFIX: &'static str = "#"; +pub const SDDL_ACE_COND_SID_PREFIX: &'static str = "SID"; +pub const SDDL_ACE_COND_ATTRIBUTE_PREFIX: &'static str = "@"; +pub const SDDL_ACE_COND_USER_ATTRIBUTE_PREFIX: &'static str = "@USER."; +pub const SDDL_ACE_COND_RESOURCE_ATTRIBUTE_PREFIX: &'static str = "@RESOURCE."; +pub const SDDL_ACE_COND_DEVICE_ATTRIBUTE_PREFIX: &'static str = "@DEVICE."; +pub const SDDL_ACE_COND_TOKEN_ATTRIBUTE_PREFIX: &'static str = "@TOKEN."; +extern "system" { + pub fn ConvertSidToStringSidA( + Sid: PSID, + StringSid: *mut LPSTR, + ) -> BOOL; + pub fn ConvertSidToStringSidW( + Sid: PSID, + StringSid: *mut LPWSTR, + ) -> BOOL; + pub fn ConvertStringSidToSidA( + StringSid: LPCSTR, + Sid: *mut PSID, + ) -> BOOL; + pub fn ConvertStringSidToSidW( + StringSid: LPCWSTR, + Sid: *mut PSID, + ) -> BOOL; + pub fn ConvertStringSecurityDescriptorToSecurityDescriptorA( + StringSecurityDescriptor: LPCSTR, + StringSDRevision: DWORD, + SecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + SecurityDescriptorSize: PULONG, + ) -> BOOL; + pub fn ConvertStringSecurityDescriptorToSecurityDescriptorW( + StringSecurityDescriptor: LPCWSTR, + StringSDRevision: DWORD, + SecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + SecurityDescriptorSize: PULONG, + ) -> BOOL; + pub fn ConvertSecurityDescriptorToStringSecurityDescriptorA( + SecurityDescriptor: PSECURITY_DESCRIPTOR, + RequestedStringSDRevision: DWORD, + SecurityInformation: SECURITY_INFORMATION, + StringSecurityDescriptor: *mut LPSTR, + StringSecurityDescriptorLen: PULONG, + ) -> BOOL; + pub fn ConvertSecurityDescriptorToStringSecurityDescriptorW( + SecurityDescriptor: PSECURITY_DESCRIPTOR, + RequestedStringSDRevision: DWORD, + SecurityInformation: SECURITY_INFORMATION, + StringSecurityDescriptor: *mut LPWSTR, + StringSecurityDescriptorLen: PULONG, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/shared/sspi.rs b/bash-5.1/vendor/winapi/src/shared/sspi.rs new file mode 100644 index 0000000000000000000000000000000000000000..3b7c2d68a5e59df887f7a3433bc13db3f1740f16 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/sspi.rs @@ -0,0 +1,1074 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Security Support Provider Interface Prototypes and structure definitions +use ctypes::{c_char, c_int, c_uchar, c_ulong, c_ushort, c_void}; +use shared::basetsd::ULONG_PTR; +use shared::guiddef::GUID; +use shared::minwindef::{PUCHAR, ULONG, USHORT}; +use um::subauth::PUNICODE_STRING; +use um::wincred::{PCREDUI_INFOA, PCREDUI_INFOW}; +use um::winnt::{ + ANYSIZE_ARRAY, BOOLEAN, CHAR, HANDLE, LARGE_INTEGER, LONG, LPSTR, LPWSTR, LUID, PCSTR, PCWSTR, + PVOID, WCHAR +}; +pub type SEC_WCHAR = WCHAR; +pub type SEC_CHAR = CHAR; +pub type SECURITY_STATUS = LONG; +STRUCT!{struct SecHandle { + dwLower: ULONG_PTR, + dwUpper: ULONG_PTR, +}} +pub type PSecHandle = *mut SecHandle; +pub const SEC_DELETED_HANDLE: ULONG_PTR = 2; +pub type CredHandle = SecHandle; +pub type PCredHandle = PSecHandle; +pub type CtxtHandle = SecHandle; +pub type PCtxtHandle = PSecHandle; +pub type SECURITY_INTEGER = LARGE_INTEGER; +pub type PSECURITY_INTEGER = *mut LARGE_INTEGER; +pub type TimeStamp = SECURITY_INTEGER; +pub type PTimeStamp = *mut SECURITY_INTEGER; +STRUCT!{struct SECURITY_STRING { + Length: c_ushort, + MaximumLength: c_ushort, + Buffer: *mut c_ushort, +}} +pub type PSECURITY_STRING = *mut SECURITY_STRING; +STRUCT!{struct SecPkgInfoW { + fCapabilities: c_ulong, + wVersion: c_ushort, + wRPCID: c_ushort, + cbMaxToken: c_ulong, + Name: *mut SEC_WCHAR, + Comment: *mut SEC_WCHAR, +}} +pub type PSecPkgInfoW = *mut SecPkgInfoW; +STRUCT!{struct SecPkgInfoA { + fCapabilities: c_ulong, + wVersion: c_ushort, + wRPCID: c_ushort, + cbMaxToken: c_ulong, + Name: *mut SEC_CHAR, + Comment: *mut SEC_CHAR, +}} +pub type PSecPkgInfoA = *mut SecPkgInfoA; +pub const SECPKG_FLAG_INTEGRITY: c_ulong = 0x00000001; +pub const SECPKG_FLAG_PRIVACY: c_ulong = 0x00000002; +pub const SECPKG_FLAG_TOKEN_ONLY: c_ulong = 0x00000004; +pub const SECPKG_FLAG_DATAGRAM: c_ulong = 0x00000008; +pub const SECPKG_FLAG_CONNECTION: c_ulong = 0x00000010; +pub const SECPKG_FLAG_MULTI_REQUIRED: c_ulong = 0x00000020; +pub const SECPKG_FLAG_CLIENT_ONLY: c_ulong = 0x00000040; +pub const SECPKG_FLAG_EXTENDED_ERROR: c_ulong = 0x00000080; +pub const SECPKG_FLAG_IMPERSONATION: c_ulong = 0x00000100; +pub const SECPKG_FLAG_ACCEPT_WIN32_NAME: c_ulong = 0x00000200; +pub const SECPKG_FLAG_STREAM: c_ulong = 0x00000400; +pub const SECPKG_FLAG_NEGOTIABLE: c_ulong = 0x00000800; +pub const SECPKG_FLAG_GSS_COMPATIBLE: c_ulong = 0x00001000; +pub const SECPKG_FLAG_LOGON: c_ulong = 0x00002000; +pub const SECPKG_FLAG_ASCII_BUFFERS: c_ulong = 0x00004000; +pub const SECPKG_FLAG_FRAGMENT: c_ulong = 0x00008000; +pub const SECPKG_FLAG_MUTUAL_AUTH: c_ulong = 0x00010000; +pub const SECPKG_FLAG_DELEGATION: c_ulong = 0x00020000; +pub const SECPKG_FLAG_READONLY_WITH_CHECKSUM: c_ulong = 0x00040000; +pub const SECPKG_FLAG_RESTRICTED_TOKENS: c_ulong = 0x00080000; +pub const SECPKG_FLAG_NEGO_EXTENDER: c_ulong = 0x00100000; +pub const SECPKG_FLAG_NEGOTIABLE2: c_ulong = 0x00200000; +pub const SECPKG_FLAG_APPCONTAINER_PASSTHROUGH: c_ulong = 0x00400000; +pub const SECPKG_FLAG_APPCONTAINER_CHECKS: c_ulong = 0x00800000; +pub const SECPKG_ID_NONE: c_ulong = 0xFFFF; +pub const SECPKG_CALLFLAGS_APPCONTAINER: c_ulong = 0x00000001; +pub const SECPKG_CALLFLAGS_APPCONTAINER_AUTHCAPABLE: c_ulong = 0x00000002; +pub const SECPKG_CALLFLAGS_FORCE_SUPPLIED: c_ulong = 0x00000004; +STRUCT!{struct SecBuffer { + cbBuffer: c_ulong, + BufferType: c_ulong, + pvBuffer: *mut c_void, +}} +pub type PSecBuffer = *mut SecBuffer; +STRUCT!{struct SecBufferDesc { + ulVersion: c_ulong, + cBuffers: c_ulong, + pBuffers: PSecBuffer, +}} +pub type PSecBufferDesc = *mut SecBufferDesc; +pub const SECBUFFER_VERSION: c_ulong = 0; +pub const SECBUFFER_EMPTY: c_ulong = 0; +pub const SECBUFFER_DATA: c_ulong = 1; +pub const SECBUFFER_TOKEN: c_ulong = 2; +pub const SECBUFFER_PKG_PARAMS: c_ulong = 3; +pub const SECBUFFER_MISSING: c_ulong = 4; +pub const SECBUFFER_EXTRA: c_ulong = 5; +pub const SECBUFFER_STREAM_TRAILER: c_ulong = 6; +pub const SECBUFFER_STREAM_HEADER: c_ulong = 7; +pub const SECBUFFER_NEGOTIATION_INFO: c_ulong = 8; +pub const SECBUFFER_PADDING: c_ulong = 9; +pub const SECBUFFER_STREAM: c_ulong = 10; +pub const SECBUFFER_MECHLIST: c_ulong = 11; +pub const SECBUFFER_MECHLIST_SIGNATURE: c_ulong = 12; +pub const SECBUFFER_TARGET: c_ulong = 13; +pub const SECBUFFER_CHANNEL_BINDINGS: c_ulong = 14; +pub const SECBUFFER_CHANGE_PASS_RESPONSE: c_ulong = 15; +pub const SECBUFFER_TARGET_HOST: c_ulong = 16; +pub const SECBUFFER_ALERT: c_ulong = 17; +pub const SECBUFFER_APPLICATION_PROTOCOLS: c_ulong = 18; +pub const SECBUFFER_ATTRMASK: c_ulong = 0xF0000000; +pub const SECBUFFER_READONLY: c_ulong = 0x80000000; +pub const SECBUFFER_READONLY_WITH_CHECKSUM: c_ulong = 0x10000000; +pub const SECBUFFER_RESERVED: c_ulong = 0x60000000; +STRUCT!{struct SEC_NEGOTIATION_INFO { + Size: c_ulong, + NameLength: c_ulong, + Name: *mut SEC_WCHAR, + Reserved: *mut c_void, +}} +pub type PSEC_NEGOTIATION_INFO = *mut SEC_NEGOTIATION_INFO; +STRUCT!{struct SEC_CHANNEL_BINDINGS { + dwInitiatorAddrType: c_ulong, + cbInitiatorLength: c_ulong, + dwInitiatorOffset: c_ulong, + dwAcceptorAddrType: c_ulong, + cbAcceptorLength: c_ulong, + dwAcceptorOffset: c_ulong, + cbApplicationDataLength: c_ulong, + dwApplicationDataOffset: c_ulong, +}} +pub type PSEC_CHANNEL_BINDINGS = *mut SEC_CHANNEL_BINDINGS; +ENUM!{enum SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT { + SecApplicationProtocolNegotiationExt_None, + SecApplicationProtocolNegotiationExt_NPN, + SecApplicationProtocolNegotiationExt_ALPN, +}} +pub type PSEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT = *mut SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT; +STRUCT!{struct SEC_APPLICATION_PROTOCOL_LIST { + ProtoNegoExt: SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT, + ProtocolListSize: c_ushort, + ProtocolList: [c_uchar; 0], +}} +pub type PSEC_APPLICATION_PROTOCOL_LIST = *mut SEC_APPLICATION_PROTOCOL_LIST; +STRUCT!{struct SEC_APPLICATION_PROTOCOLS { + ProtocolListsSize: c_ulong, + ProtocolLists: [SEC_APPLICATION_PROTOCOL_LIST; ANYSIZE_ARRAY], +}} +pub type PSEC_APPLICATION_PROTOCOLS = *mut SEC_APPLICATION_PROTOCOLS; +pub const SECURITY_NATIVE_DREP: c_ulong = 0x00000010; +pub const SECURITY_NETWORK_DREP: c_ulong = 0x00000000; +pub const SECPKG_CRED_INBOUND: c_ulong = 0x00000001; +pub const SECPKG_CRED_OUTBOUND: c_ulong = 0x00000002; +pub const SECPKG_CRED_BOTH: c_ulong = 0x00000003; +pub const SECPKG_CRED_DEFAULT: c_ulong = 0x00000004; +pub const SECPKG_CRED_RESERVED: c_ulong = 0xF0000000; +pub const SECPKG_CRED_AUTOLOGON_RESTRICTED: c_ulong = 0x00000010; +pub const SECPKG_CRED_PROCESS_POLICY_ONLY: c_ulong = 0x00000020; +pub const ISC_REQ_DELEGATE: c_ulong = 0x00000001; +pub const ISC_REQ_MUTUAL_AUTH: c_ulong = 0x00000002; +pub const ISC_REQ_REPLAY_DETECT: c_ulong = 0x00000004; +pub const ISC_REQ_SEQUENCE_DETECT: c_ulong = 0x00000008; +pub const ISC_REQ_CONFIDENTIALITY: c_ulong = 0x00000010; +pub const ISC_REQ_USE_SESSION_KEY: c_ulong = 0x00000020; +pub const ISC_REQ_PROMPT_FOR_CREDS: c_ulong = 0x00000040; +pub const ISC_REQ_USE_SUPPLIED_CREDS: c_ulong = 0x00000080; +pub const ISC_REQ_ALLOCATE_MEMORY: c_ulong = 0x00000100; +pub const ISC_REQ_USE_DCE_STYLE: c_ulong = 0x00000200; +pub const ISC_REQ_DATAGRAM: c_ulong = 0x00000400; +pub const ISC_REQ_CONNECTION: c_ulong = 0x00000800; +pub const ISC_REQ_CALL_LEVEL: c_ulong = 0x00001000; +pub const ISC_REQ_FRAGMENT_SUPPLIED: c_ulong = 0x00002000; +pub const ISC_REQ_EXTENDED_ERROR: c_ulong = 0x00004000; +pub const ISC_REQ_STREAM: c_ulong = 0x00008000; +pub const ISC_REQ_INTEGRITY: c_ulong = 0x00010000; +pub const ISC_REQ_IDENTIFY: c_ulong = 0x00020000; +pub const ISC_REQ_NULL_SESSION: c_ulong = 0x00040000; +pub const ISC_REQ_MANUAL_CRED_VALIDATION: c_ulong = 0x00080000; +pub const ISC_REQ_RESERVED1: c_ulong = 0x00100000; +pub const ISC_REQ_FRAGMENT_TO_FIT: c_ulong = 0x00200000; +pub const ISC_REQ_FORWARD_CREDENTIALS: c_ulong = 0x00400000; +pub const ISC_REQ_NO_INTEGRITY: c_ulong = 0x00800000; +pub const ISC_REQ_USE_HTTP_STYLE: c_ulong = 0x01000000; +pub const ISC_REQ_UNVERIFIED_TARGET_NAME: c_ulong = 0x20000000; +pub const ISC_REQ_CONFIDENTIALITY_ONLY: c_ulong = 0x40000000; +pub const ISC_RET_DELEGATE: c_ulong = 0x00000001; +pub const ISC_RET_MUTUAL_AUTH: c_ulong = 0x00000002; +pub const ISC_RET_REPLAY_DETECT: c_ulong = 0x00000004; +pub const ISC_RET_SEQUENCE_DETECT: c_ulong = 0x00000008; +pub const ISC_RET_CONFIDENTIALITY: c_ulong = 0x00000010; +pub const ISC_RET_USE_SESSION_KEY: c_ulong = 0x00000020; +pub const ISC_RET_USED_COLLECTED_CREDS: c_ulong = 0x00000040; +pub const ISC_RET_USED_SUPPLIED_CREDS: c_ulong = 0x00000080; +pub const ISC_RET_ALLOCATED_MEMORY: c_ulong = 0x00000100; +pub const ISC_RET_USED_DCE_STYLE: c_ulong = 0x00000200; +pub const ISC_RET_DATAGRAM: c_ulong = 0x00000400; +pub const ISC_RET_CONNECTION: c_ulong = 0x00000800; +pub const ISC_RET_INTERMEDIATE_RETURN: c_ulong = 0x00001000; +pub const ISC_RET_CALL_LEVEL: c_ulong = 0x00002000; +pub const ISC_RET_EXTENDED_ERROR: c_ulong = 0x00004000; +pub const ISC_RET_STREAM: c_ulong = 0x00008000; +pub const ISC_RET_INTEGRITY: c_ulong = 0x00010000; +pub const ISC_RET_IDENTIFY: c_ulong = 0x00020000; +pub const ISC_RET_NULL_SESSION: c_ulong = 0x00040000; +pub const ISC_RET_MANUAL_CRED_VALIDATION: c_ulong = 0x00080000; +pub const ISC_RET_RESERVED1: c_ulong = 0x00100000; +pub const ISC_RET_FRAGMENT_ONLY: c_ulong = 0x00200000; +pub const ISC_RET_FORWARD_CREDENTIALS: c_ulong = 0x00400000; +pub const ISC_RET_USED_HTTP_STYLE: c_ulong = 0x01000000; +pub const ISC_RET_NO_ADDITIONAL_TOKEN: c_ulong = 0x02000000; +pub const ISC_RET_REAUTHENTICATION: c_ulong = 0x08000000; +pub const ISC_RET_CONFIDENTIALITY_ONLY: c_ulong = 0x40000000; +pub const ASC_REQ_DELEGATE: c_ulong = 0x00000001; +pub const ASC_REQ_MUTUAL_AUTH: c_ulong = 0x00000002; +pub const ASC_REQ_REPLAY_DETECT: c_ulong = 0x00000004; +pub const ASC_REQ_SEQUENCE_DETECT: c_ulong = 0x00000008; +pub const ASC_REQ_CONFIDENTIALITY: c_ulong = 0x00000010; +pub const ASC_REQ_USE_SESSION_KEY: c_ulong = 0x00000020; +pub const ASC_REQ_SESSION_TICKET: c_ulong = 0x00000040; +pub const ASC_REQ_ALLOCATE_MEMORY: c_ulong = 0x00000100; +pub const ASC_REQ_USE_DCE_STYLE: c_ulong = 0x00000200; +pub const ASC_REQ_DATAGRAM: c_ulong = 0x00000400; +pub const ASC_REQ_CONNECTION: c_ulong = 0x00000800; +pub const ASC_REQ_CALL_LEVEL: c_ulong = 0x00001000; +pub const ASC_REQ_EXTENDED_ERROR: c_ulong = 0x00008000; +pub const ASC_REQ_STREAM: c_ulong = 0x00010000; +pub const ASC_REQ_INTEGRITY: c_ulong = 0x00020000; +pub const ASC_REQ_LICENSING: c_ulong = 0x00040000; +pub const ASC_REQ_IDENTIFY: c_ulong = 0x00080000; +pub const ASC_REQ_ALLOW_NULL_SESSION: c_ulong = 0x00100000; +pub const ASC_REQ_ALLOW_NON_USER_LOGONS: c_ulong = 0x00200000; +pub const ASC_REQ_ALLOW_CONTEXT_REPLAY: c_ulong = 0x00400000; +pub const ASC_REQ_FRAGMENT_TO_FIT: c_ulong = 0x00800000; +pub const ASC_REQ_FRAGMENT_SUPPLIED: c_ulong = 0x00002000; +pub const ASC_REQ_NO_TOKEN: c_ulong = 0x01000000; +pub const ASC_REQ_PROXY_BINDINGS: c_ulong = 0x04000000; +pub const ASC_REQ_ALLOW_MISSING_BINDINGS: c_ulong = 0x10000000; +pub const ASC_RET_DELEGATE: c_ulong = 0x00000001; +pub const ASC_RET_MUTUAL_AUTH: c_ulong = 0x00000002; +pub const ASC_RET_REPLAY_DETECT: c_ulong = 0x00000004; +pub const ASC_RET_SEQUENCE_DETECT: c_ulong = 0x00000008; +pub const ASC_RET_CONFIDENTIALITY: c_ulong = 0x00000010; +pub const ASC_RET_USE_SESSION_KEY: c_ulong = 0x00000020; +pub const ASC_RET_SESSION_TICKET: c_ulong = 0x00000040; +pub const ASC_RET_ALLOCATED_MEMORY: c_ulong = 0x00000100; +pub const ASC_RET_USED_DCE_STYLE: c_ulong = 0x00000200; +pub const ASC_RET_DATAGRAM: c_ulong = 0x00000400; +pub const ASC_RET_CONNECTION: c_ulong = 0x00000800; +pub const ASC_RET_CALL_LEVEL: c_ulong = 0x00002000; +pub const ASC_RET_THIRD_LEG_FAILED: c_ulong = 0x00004000; +pub const ASC_RET_EXTENDED_ERROR: c_ulong = 0x00008000; +pub const ASC_RET_STREAM: c_ulong = 0x00010000; +pub const ASC_RET_INTEGRITY: c_ulong = 0x00020000; +pub const ASC_RET_LICENSING: c_ulong = 0x00040000; +pub const ASC_RET_IDENTIFY: c_ulong = 0x00080000; +pub const ASC_RET_NULL_SESSION: c_ulong = 0x00100000; +pub const ASC_RET_ALLOW_NON_USER_LOGONS: c_ulong = 0x00200000; +pub const ASC_RET_ALLOW_CONTEXT_REPLAY: c_ulong = 0x00400000; +pub const ASC_RET_FRAGMENT_ONLY: c_ulong = 0x00800000; +pub const ASC_RET_NO_TOKEN: c_ulong = 0x01000000; +pub const ASC_RET_NO_ADDITIONAL_TOKEN: c_ulong = 0x02000000; +pub const SECPKG_CRED_ATTR_NAMES: c_ulong = 1; +pub const SECPKG_CRED_ATTR_SSI_PROVIDER: c_ulong = 2; +pub const SECPKG_CRED_ATTR_KDC_PROXY_SETTINGS: c_ulong = 3; +pub const SECPKG_CRED_ATTR_CERT: c_ulong = 4; +STRUCT!{struct SecPkgCredentials_NamesW { + sUserName: *mut SEC_WCHAR, +}} +pub type PSecPkgCredentials_NamesW = *mut SecPkgCredentials_NamesW; +STRUCT!{struct SecPkgCredentials_NamesA { + sUserName: *mut SEC_CHAR, +}} +pub type PSecPkgCredentials_NamesA = *mut SecPkgCredentials_NamesA; +STRUCT!{struct SecPkgCredentials_SSIProviderW { + sProviderName: *mut SEC_WCHAR, + ProviderInfoLength: c_ulong, + ProviderInfo: *mut c_char, +}} +pub type PSecPkgCredentials_SSIProviderW = *mut SecPkgCredentials_SSIProviderW; +STRUCT!{struct SecPkgCredentials_SSIProviderA { + sProviderName: *mut SEC_CHAR, + ProviderInfoLength: c_ulong, + ProviderInfo: *mut c_char, +}} +pub type PSecPkgCredentials_SSIProviderA = *mut SecPkgCredentials_SSIProviderA; +pub const KDC_PROXY_SETTINGS_V1: ULONG = 1; +pub const KDC_PROXY_SETTINGS_FLAGS_FORCEPROXY: ULONG = 0x1; +STRUCT!{struct SecPkgCredentials_KdcProxySettingsW { + Version: ULONG, + Flags: ULONG, + ProxyServerOffset: USHORT, + ProxyServerLength: USHORT, + ClientTlsCredOffset: USHORT, + ClientTlsCredLength: USHORT, +}} +pub type PSecPkgCredentials_KdcProxySettingsW = *mut SecPkgCredentials_KdcProxySettingsW; +STRUCT!{struct SecPkgCredentials_Cert { + EncodedCertSize: c_ulong, + EncodedCert: *mut c_uchar, +}} +pub type PSecPkgCredentials_Cert = *mut SecPkgCredentials_Cert; +pub const SECPKG_ATTR_SIZES: c_ulong = 0; +pub const SECPKG_ATTR_NAMES: c_ulong = 1; +pub const SECPKG_ATTR_LIFESPAN: c_ulong = 2; +pub const SECPKG_ATTR_DCE_INFO: c_ulong = 3; +pub const SECPKG_ATTR_STREAM_SIZES: c_ulong = 4; +pub const SECPKG_ATTR_KEY_INFO: c_ulong = 5; +pub const SECPKG_ATTR_AUTHORITY: c_ulong = 6; +pub const SECPKG_ATTR_PROTO_INFO: c_ulong = 7; +pub const SECPKG_ATTR_PASSWORD_EXPIRY: c_ulong = 8; +pub const SECPKG_ATTR_SESSION_KEY: c_ulong = 9; +pub const SECPKG_ATTR_PACKAGE_INFO: c_ulong = 10; +pub const SECPKG_ATTR_USER_FLAGS: c_ulong = 11; +pub const SECPKG_ATTR_NEGOTIATION_INFO: c_ulong = 12; +pub const SECPKG_ATTR_NATIVE_NAMES: c_ulong = 13; +pub const SECPKG_ATTR_FLAGS: c_ulong = 14; +pub const SECPKG_ATTR_USE_VALIDATED: c_ulong = 15; +pub const SECPKG_ATTR_CREDENTIAL_NAME: c_ulong = 16; +pub const SECPKG_ATTR_TARGET_INFORMATION: c_ulong = 17; +pub const SECPKG_ATTR_ACCESS_TOKEN: c_ulong = 18; +pub const SECPKG_ATTR_TARGET: c_ulong = 19; +pub const SECPKG_ATTR_AUTHENTICATION_ID: c_ulong = 20; +pub const SECPKG_ATTR_LOGOFF_TIME: c_ulong = 21; +pub const SECPKG_ATTR_NEGO_KEYS: c_ulong = 22; +pub const SECPKG_ATTR_PROMPTING_NEEDED: c_ulong = 24; +pub const SECPKG_ATTR_UNIQUE_BINDINGS: c_ulong = 25; +pub const SECPKG_ATTR_ENDPOINT_BINDINGS: c_ulong = 26; +pub const SECPKG_ATTR_CLIENT_SPECIFIED_TARGET: c_ulong = 27; +pub const SECPKG_ATTR_LAST_CLIENT_TOKEN_STATUS: c_ulong = 30; +pub const SECPKG_ATTR_NEGO_PKG_INFO: c_ulong = 31; +pub const SECPKG_ATTR_NEGO_STATUS: c_ulong = 32; +pub const SECPKG_ATTR_CONTEXT_DELETED: c_ulong = 33; +pub const SECPKG_ATTR_DTLS_MTU: c_ulong = 34; +pub const SECPKG_ATTR_DATAGRAM_SIZES: c_ulong = SECPKG_ATTR_STREAM_SIZES; +pub const SECPKG_ATTR_SUBJECT_SECURITY_ATTRIBUTES: c_ulong = 128; +pub const SECPKG_ATTR_APPLICATION_PROTOCOL: c_ulong = 35; +STRUCT!{struct SecPkgContext_SubjectAttributes { + AttributeInfo: *mut c_void, +}} +pub type PSecPkgContext_SubjectAttributes = *mut SecPkgContext_SubjectAttributes; +pub const SECPKG_ATTR_NEGO_INFO_FLAG_NO_KERBEROS: c_ulong = 0x1; +pub const SECPKG_ATTR_NEGO_INFO_FLAG_NO_NTLM: c_ulong = 0x2; +ENUM!{enum SECPKG_CRED_CLASS { + SecPkgCredClass_None = 0, + SecPkgCredClass_Ephemeral = 10, + SecPkgCredClass_PersistedGeneric = 20, + SecPkgCredClass_PersistedSpecific = 30, + SecPkgCredClass_Explicit = 40, +}} +pub type PSECPKG_CRED_CLASS = *mut SECPKG_CRED_CLASS; +STRUCT!{struct SecPkgContext_CredInfo { + CredClass: SECPKG_CRED_CLASS, + IsPromptingNeeded: c_ulong, +}} +pub type PSecPkgContext_CredInfo = *mut SecPkgContext_CredInfo; +STRUCT!{struct SecPkgContext_NegoPackageInfo { + PackageMask: c_ulong, +}} +pub type PSecPkgContext_NegoPackageInfo = *mut SecPkgContext_NegoPackageInfo; +STRUCT!{struct SecPkgContext_NegoStatus { + LastStatus: c_ulong, +}} +pub type PSecPkgContext_NegoStatus = *mut SecPkgContext_NegoStatus; +STRUCT!{struct SecPkgContext_Sizes { + cbMaxToken: c_ulong, + cbMaxSignature: c_ulong, + cbBlockSize: c_ulong, + cbSecurityTrailer: c_ulong, +}} +pub type PSecPkgContext_Sizes = *mut SecPkgContext_Sizes; +STRUCT!{struct SecPkgContext_StreamSizes { + cbHeader: c_ulong, + cbTrailer: c_ulong, + cbMaximumMessage: c_ulong, + cBuffers: c_ulong, + cbBlockSize: c_ulong, +}} +pub type PSecPkgContext_StreamSizes = *mut SecPkgContext_StreamSizes; +pub type SecPkgContext_DatagramSizes = SecPkgContext_StreamSizes; +pub type PSecPkgContext_DatagramSizes = PSecPkgContext_StreamSizes; +STRUCT!{struct SecPkgContext_NamesW { + sUserName: *mut SEC_WCHAR, +}} +pub type PSecPkgContext_NamesW = *mut SecPkgContext_NamesW; +ENUM!{enum SECPKG_ATTR_LCT_STATUS { + SecPkgAttrLastClientTokenYes, + SecPkgAttrLastClientTokenNo, + SecPkgAttrLastClientTokenMaybe, +}} +pub type PSECPKG_ATTR_LCT_STATUS = *mut SECPKG_ATTR_LCT_STATUS; +STRUCT!{struct SecPkgContext_LastClientTokenStatus { + LastClientTokenStatus: SECPKG_ATTR_LCT_STATUS, +}} +pub type PSecPkgContext_LastClientTokenStatus = *mut SecPkgContext_LastClientTokenStatus; +STRUCT!{struct SecPkgContext_NamesA { + sUserName: *mut SEC_CHAR, +}} +pub type PSecPkgContext_NamesA = *mut SecPkgContext_NamesA; +STRUCT!{struct SecPkgContext_Lifespan { + tsStart: TimeStamp, + tsExpiry: TimeStamp, +}} +pub type PSecPkgContext_Lifespan = *mut SecPkgContext_Lifespan; +STRUCT!{struct SecPkgContext_DceInfo { + AuthzSvc: c_ulong, + pPac: *mut c_void, +}} +pub type PSecPkgContext_DceInfo = *mut SecPkgContext_DceInfo; +STRUCT!{struct SecPkgContext_KeyInfoA { + sSignatureAlgorithmName: *mut SEC_CHAR, + sEncryptAlgorithmName: *mut SEC_CHAR, + KeySize: c_ulong, + SignatureAlgorithm: c_ulong, + EncryptAlgorithm: c_ulong, +}} +pub type PSecPkgContext_KeyInfoA = *mut SecPkgContext_KeyInfoA; +STRUCT!{struct SecPkgContext_KeyInfoW { + sSignatureAlgorithmName: *mut SEC_WCHAR, + sEncryptAlgorithmName: *mut SEC_WCHAR, + KeySize: c_ulong, + SignatureAlgorithm: c_ulong, + EncryptAlgorithm: c_ulong, +}} +pub type PSecPkgContext_KeyInfoW = *mut SecPkgContext_KeyInfoW; +STRUCT!{struct SecPkgContext_AuthorityA { + sAuthorityName: *mut SEC_CHAR, +}} +pub type PSecPkgContext_AuthorityA = *mut SecPkgContext_AuthorityA; +STRUCT!{struct SecPkgContext_AuthorityW { + sAuthorityName: *mut SEC_WCHAR, +}} +pub type PSecPkgContext_AuthorityW = *mut SecPkgContext_AuthorityW; +STRUCT!{struct SecPkgContext_ProtoInfoA { + sProtocolName: *mut SEC_CHAR, + majorVersion: c_ulong, + minorVersion: c_ulong, +}} +pub type PSecPkgContext_ProtoInfoA = *mut SecPkgContext_ProtoInfoA; +STRUCT!{struct SecPkgContext_ProtoInfoW { + sProtocolName: *mut SEC_WCHAR, + majorVersion: c_ulong, + minorVersion: c_ulong, +}} +pub type PSecPkgContext_ProtoInfoW = *mut SecPkgContext_ProtoInfoW; +STRUCT!{struct SecPkgContext_PasswordExpiry { + tsPasswordExpires: TimeStamp, +}} +pub type PSecPkgContext_PasswordExpiry = *mut SecPkgContext_PasswordExpiry; +STRUCT!{struct SecPkgContext_LogoffTime { + tsLogoffTime: TimeStamp, +}} +pub type PSecPkgContext_LogoffTime = *mut SecPkgContext_LogoffTime; +STRUCT!{struct SecPkgContext_SessionKey { + SessionKeyLength: c_ulong, + SessionKey: *mut c_uchar, +}} +pub type PSecPkgContext_SessionKey = *mut SecPkgContext_SessionKey; +STRUCT!{struct SecPkgContext_NegoKeys { + KeyType: c_ulong, + KeyLength: c_ushort, + KeyValue: *mut c_uchar, + VerifyKeyType: c_ulong, + VerifyKeyLength: c_ushort, + VerifyKeyValue: *mut c_uchar, +}} +pub type PSecPkgContext_NegoKeys = *mut SecPkgContext_NegoKeys; +STRUCT!{struct SecPkgContext_PackageInfoW { + PackageInfo: PSecPkgInfoW, +}} +pub type PSecPkgContext_PackageInfoW = *mut SecPkgContext_PackageInfoW; +STRUCT!{struct SecPkgContext_PackageInfoA { + PackageInfo: PSecPkgInfoA, +}} +pub type PSecPkgContext_PackageInfoA = *mut SecPkgContext_PackageInfoA; +STRUCT!{struct SecPkgContext_UserFlags { + UserFlags: c_ulong, +}} +pub type PSecPkgContext_UserFlags = *mut SecPkgContext_UserFlags; +STRUCT!{struct SecPkgContext_Flags { + Flags: c_ulong, +}} +pub type PSecPkgContext_Flags = *mut SecPkgContext_Flags; +STRUCT!{struct SecPkgContext_NegotiationInfoA { + PackageInfo: PSecPkgInfoA, + NegotiationState: c_ulong, +}} +pub type PSecPkgContext_NegotiationInfoA = *mut SecPkgContext_NegotiationInfoA; +STRUCT!{struct SecPkgContext_NegotiationInfoW { + PackageInfo: PSecPkgInfoW, + NegotiationState: c_ulong, +}} +pub type PSecPkgContext_NegotiationInfoW = *mut SecPkgContext_NegotiationInfoW; +pub const SECPKG_NEGOTIATION_COMPLETE: c_ulong = 0; +pub const SECPKG_NEGOTIATION_OPTIMISTIC: c_ulong = 1; +pub const SECPKG_NEGOTIATION_IN_PROGRESS: c_ulong = 2; +pub const SECPKG_NEGOTIATION_DIRECT: c_ulong = 3; +pub const SECPKG_NEGOTIATION_TRY_MULTICRED: c_ulong = 4; +STRUCT!{struct SecPkgContext_NativeNamesW { + sClientName: *mut SEC_WCHAR, + sServerName: *mut SEC_WCHAR, +}} +pub type PSecPkgContext_NativeNamesW = *mut SecPkgContext_NativeNamesW; +STRUCT!{struct SecPkgContext_NativeNamesA { + sClientName: *mut SEC_CHAR, + sServerName: *mut SEC_CHAR, +}} +pub type PSecPkgContext_NativeNamesA = *mut SecPkgContext_NativeNamesA; +STRUCT!{struct SecPkgContext_CredentialNameW { + CredentialType: c_ulong, + sCredentialName: *mut SEC_WCHAR, +}} +pub type PSecPkgContext_CredentialNameW = *mut SecPkgContext_CredentialNameW; +STRUCT!{struct SecPkgContext_CredentialNameA { + CredentialType: c_ulong, + sCredentialName: *mut SEC_CHAR, +}} +pub type PSecPkgContext_CredentialNameA = *mut SecPkgContext_CredentialNameA; +STRUCT!{struct SecPkgContext_AccessToken { + AccessToken: *mut c_void, +}} +pub type PSecPkgContext_AccessToken = *mut SecPkgContext_AccessToken; +STRUCT!{struct SecPkgContext_TargetInformation { + MarshalledTargetInfoLength: c_ulong, + MarshalledTargetInfo: *mut c_uchar, +}} +pub type PSecPkgContext_TargetInformation = *mut SecPkgContext_TargetInformation; +STRUCT!{struct SecPkgContext_AuthzID { + AuthzIDLength: c_ulong, + AuthzID: *mut c_char, +}} +pub type PSecPkgContext_AuthzID = *mut SecPkgContext_AuthzID; +STRUCT!{struct SecPkgContext_Target { + TargetLength: c_ulong, + Target: *mut c_char, +}} +pub type PSecPkgContext_Target = *mut SecPkgContext_Target; +STRUCT!{struct SecPkgContext_ClientSpecifiedTarget { + sTargetName: *mut SEC_WCHAR, +}} +pub type PSecPkgContext_ClientSpecifiedTarget = *mut SecPkgContext_ClientSpecifiedTarget; +STRUCT!{struct SecPkgContext_Bindings { + BindingsLength: c_ulong, + Bindings: *mut SEC_CHANNEL_BINDINGS, +}} +pub type PSecPkgContext_Bindings = *mut SecPkgContext_Bindings; +ENUM!{enum SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS { + SecApplicationProtocolNegotiationStatus_None, + SecApplicationProtocolNegotiationStatus_Success, + SecApplicationProtocolNegotiationStatus_SelectedClientOnly, +}} +pub type PSEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS = + *mut SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS; +pub const MAX_PROTOCOL_ID_SIZE: usize = 0xff; +STRUCT!{struct SecPkgContext_ApplicationProtocol { + ProtoNegoStatus: SEC_APPLICATION_PROTOCOL_NEGOTIATION_STATUS, + ProtoNegoExt: SEC_APPLICATION_PROTOCOL_NEGOTIATION_EXT, + ProtocolIdSize: c_uchar, + ProtocolId: [c_uchar; MAX_PROTOCOL_ID_SIZE], +}} +pub type PSecPkgContext_ApplicationProtocol = *mut SecPkgContext_ApplicationProtocol; +FN!{stdcall SEC_GET_KEY_FN( + Arg: *mut c_void, + Principal: *mut c_void, + KeyVer: c_ulong, + Key: *mut *mut c_void, + Status: *mut SECURITY_STATUS, +) -> ()} +pub const SECPKG_CONTEXT_EXPORT_RESET_NEW: c_ulong = 0x00000001; +pub const SECPKG_CONTEXT_EXPORT_DELETE_OLD: c_ulong = 0x00000002; +pub const SECPKG_CONTEXT_EXPORT_TO_KERNEL: c_ulong = 0x00000004; +extern "system" { + pub fn AcquireCredentialsHandleW( + pszPrincipal: LPWSTR, + pszPackage: LPWSTR, + fCredentialUse: c_ulong, + pvLogonId: *mut c_void, + pAuthData: *mut c_void, + pGetKeyFn: SEC_GET_KEY_FN, + pvGetKeyArgument: *mut c_void, + phCredential: PCredHandle, + ptsExpiry: PTimeStamp, + ) -> SECURITY_STATUS; +} +FN!{stdcall ACQUIRE_CREDENTIALS_HANDLE_FN_W( + *mut SEC_WCHAR, + *mut SEC_WCHAR, + c_ulong, + *mut c_void, + *mut c_void, + SEC_GET_KEY_FN, + *mut c_void, + PCredHandle, + PTimeStamp, +) -> SECURITY_STATUS} +extern "system" { + pub fn AcquireCredentialsHandleA( + pszPrincipal: LPSTR, + pszPackage: LPSTR, + fCredentialUse: c_ulong, + pvLogonId: *mut c_void, + pAuthData: *mut c_void, + pGetKeyFn: SEC_GET_KEY_FN, + pvGetKeyArgument: *mut c_void, + phCredential: PCredHandle, + ptsExpiry: PTimeStamp, + ) -> SECURITY_STATUS; +} +FN!{stdcall ACQUIRE_CREDENTIALS_HANDLE_FN_A( + *mut SEC_CHAR, + *mut SEC_CHAR, + c_ulong, + *mut c_void, + *mut c_void, + SEC_GET_KEY_FN, + *mut c_void, + PCredHandle, + PTimeStamp, +) -> SECURITY_STATUS} +extern "system" { + pub fn FreeCredentialsHandle( + phCredential: PCredHandle, + ) -> SECURITY_STATUS; +} +FN!{stdcall FREE_CREDENTIALS_HANDLE_FN( + PCredHandle, +) -> SECURITY_STATUS} +extern "system" { + pub fn AddCredentialsW( + hCredentials: PCredHandle, + pszPrincipal: LPWSTR, + pszPackage: LPWSTR, + fCredentialUse: c_ulong, + pAuthData: *mut c_void, + pGetKeyFn: SEC_GET_KEY_FN, + pvGetKeyArgument: *mut c_void, + ptsExpiry: PTimeStamp, + ) -> SECURITY_STATUS; +} +FN!{stdcall ADD_CREDENTIALS_FN_W( + PCredHandle, + *mut SEC_WCHAR, + *mut SEC_WCHAR, + c_ulong, + *mut c_void, + SEC_GET_KEY_FN, + *mut c_void, + PTimeStamp, +) -> SECURITY_STATUS} +extern "system" { + pub fn AddCredentialsA( + hCredentials: PCredHandle, + pszPrincipal: LPSTR, + pszPackage: LPSTR, + fCredentialUse: c_ulong, + pAuthData: *mut c_void, + pGetKeyFn: SEC_GET_KEY_FN, + pvGetKeyArgument: *mut c_void, + ptsExpiry: PTimeStamp, + ) -> SECURITY_STATUS; +} +FN!{stdcall ADD_CREDENTIALS_FN_A( + PCredHandle, + *mut SEC_CHAR, + *mut SEC_CHAR, + c_ulong, + *mut c_void, + SEC_GET_KEY_FN, + *mut c_void, + PTimeStamp, +) -> SECURITY_STATUS} +extern "system" { + // pub fn spiCreateAsyncContext(); + // pub fn SspiFreeAsyncContext(); + // pub fn SspiReinitAsyncContext(); + // pub fn SspiSetAsyncNotifyCallback(); + // pub fn SspiAsyncContextRequiresNotify(); + // pub fn SspiGetAsyncCallStatus(); + // pub fn SspiAcquireCredentialsHandleAsyncW(); + // pub fn SspiAcquireCredentialsHandleAsyncA(); + // pub fn SspiInitializeSecurityContextAsyncW(); + // pub fn SspiInitializeSecurityContextAsyncA(); + // pub fn SspiAcceptSecurityContextAsync(); + // pub fn SspiFreeCredentialsHandleAsync(); + // pub fn SspiDeleteSecurityContextAsync(); + pub fn ChangeAccountPasswordW( + pszPackageName: *mut SEC_WCHAR, + pszDomainName: *mut SEC_WCHAR, + pszAccountName: *mut SEC_WCHAR, + pszOldPassword: *mut SEC_WCHAR, + pszNewPassword: *mut SEC_WCHAR, + bImpersonating: BOOLEAN, + dwReserved: c_ulong, + pOutput: PSecBufferDesc, + ) -> SECURITY_STATUS; +} +FN!{stdcall CHANGE_PASSWORD_FN_W( + *mut SEC_WCHAR, + *mut SEC_WCHAR, + *mut SEC_WCHAR, + *mut SEC_WCHAR, + *mut SEC_WCHAR, + BOOLEAN, + c_ulong, + PSecBufferDesc, +) -> SECURITY_STATUS} +extern "system" { + pub fn ChangeAccountPasswordA( + pszPackageName: *mut SEC_CHAR, + pszDomainName: *mut SEC_CHAR, + pszAccountName: *mut SEC_CHAR, + pszOldPassword: *mut SEC_CHAR, + pszNewPassword: *mut SEC_CHAR, + bImpersonating: BOOLEAN, + dwReserved: c_ulong, + pOutput: PSecBufferDesc, + ) -> SECURITY_STATUS; +} +FN!{stdcall CHANGE_PASSWORD_FN_A( + *mut SEC_CHAR, + *mut SEC_CHAR, + *mut SEC_CHAR, + *mut SEC_CHAR, + *mut SEC_CHAR, + BOOLEAN, + c_ulong, + PSecBufferDesc, +) -> SECURITY_STATUS} +extern "system" { + pub fn InitializeSecurityContextW( + phCredential: PCredHandle, + phContext: PCtxtHandle, + pszTargetName: *mut SEC_WCHAR, + fContextReq: c_ulong, + Reserved1: c_ulong, + TargetDataRep: c_ulong, + pInput: PSecBufferDesc, + Reserved2: c_ulong, + phNewContext: PCtxtHandle, + pOutput: PSecBufferDesc, + pfContextAttr: *mut c_ulong, + ptsExpiry: PTimeStamp, + ) -> SECURITY_STATUS; +} +// INITIALIZE_SECURITY_CONTEXT_FN_W +extern "system" { + pub fn InitializeSecurityContextA( + phCredential: PCredHandle, + phContext: PCtxtHandle, + pszTargetName: *mut SEC_CHAR, + fContextReq: c_ulong, + Reserved1: c_ulong, + TargetDataRep: c_ulong, + pInput: PSecBufferDesc, + Reserved2: c_ulong, + phNewContext: PCtxtHandle, + pOutput: PSecBufferDesc, + pfContextAttr: *mut c_ulong, + ptsExpiry: PTimeStamp, + ) -> SECURITY_STATUS; + pub fn AcceptSecurityContext( + phCredential: PCredHandle, + phContext: PCtxtHandle, + pInput: PSecBufferDesc, + fContextReq: c_ulong, + TargetDataRep: c_ulong, + phNewContext: PCtxtHandle, + pOutput: PSecBufferDesc, + pfContextAttr: *mut c_ulong, + ptsExpiry: PTimeStamp, + ) -> SECURITY_STATUS; + pub fn CompleteAuthToken( + phContext: PCtxtHandle, + pToken: PSecBufferDesc, + ) -> SECURITY_STATUS; + pub fn ImpersonateSecurityContext( + phContext: PCtxtHandle, + ) -> SECURITY_STATUS; + pub fn RevertSecurityContext( + phContext: PCtxtHandle, + ) -> SECURITY_STATUS; + pub fn QuerySecurityContextToken( + phContext: PCtxtHandle, + Token: *mut *mut c_void, + ) -> SECURITY_STATUS; + pub fn DeleteSecurityContext( + phContext: PCtxtHandle, + ) -> SECURITY_STATUS; + pub fn ApplyControlToken( + phContext: PCtxtHandle, + pInput: PSecBufferDesc, + ) -> SECURITY_STATUS; + pub fn QueryContextAttributesW( + phContext: PCtxtHandle, + ulAttribute: c_ulong, + pBuffer: *mut c_void, + ) -> SECURITY_STATUS; + // pub fn QueryContextAttributesExW(); + pub fn QueryContextAttributesA( + phContext: PCtxtHandle, + ulAttribute: c_ulong, + pBuffer: *mut c_void, + ) -> SECURITY_STATUS; + // pub fn QueryContextAttributesExA(); + pub fn SetContextAttributesW( + phContext: PCtxtHandle, + ulAttribute: c_ulong, + pBuffer: *mut c_void, + cbBuffer: c_ulong, + ) -> SECURITY_STATUS; + pub fn SetContextAttributesA( + phContext: PCtxtHandle, + ulAttribute: c_ulong, + pBuffer: *mut c_void, + cbBuffer: c_ulong, + ) -> SECURITY_STATUS; + pub fn QueryCredentialsAttributesW( + phCredential: PCredHandle, + ulAttribute: c_ulong, + pBuffer: *mut c_void, + ) -> SECURITY_STATUS; + // pub fn QueryCredentialsAttributesExW(); + pub fn QueryCredentialsAttributesA( + phCredential: PCredHandle, + ulAttribute: c_ulong, + pBuffer: *mut c_void, + ) -> SECURITY_STATUS; + // pub fn QueryCredentialsAttributesExA(); + pub fn SetCredentialsAttributesW( + phCredential: PCredHandle, + ulAttribute: c_ulong, + pBuffer: *mut c_void, + cbBuffer: c_ulong, + ) -> SECURITY_STATUS; + pub fn SetCredentialsAttributesA( + phCredential: PCredHandle, + ulAttribute: c_ulong, + pBuffer: *mut c_void, + cbBuffer: c_ulong, + ) -> SECURITY_STATUS; + pub fn FreeContextBuffer( + pvContextBuffer: PVOID, + ) -> SECURITY_STATUS; + pub fn MakeSignature( + phContext: PCtxtHandle, + fQOP: c_ulong, + pMessage: PSecBufferDesc, + MessageSeqNo: c_ulong, + ) -> SECURITY_STATUS; + pub fn VerifySignature( + phContext: PCtxtHandle, + pMessage: PSecBufferDesc, + MessageSeqNo: c_ulong, + pfQOP: *mut c_ulong, + ) -> SECURITY_STATUS; + pub fn EncryptMessage( + phContext: PCtxtHandle, + fQOP: c_ulong, + pMessage: PSecBufferDesc, + MessageSeqNo: c_ulong, + ) -> SECURITY_STATUS; + pub fn DecryptMessage( + phContext: PCtxtHandle, + pMessage: PSecBufferDesc, + MessageSeqNo: c_ulong, + pfQOP: *mut c_ulong, + ) -> SECURITY_STATUS; + pub fn EnumerateSecurityPackagesW( + pcPackages: *mut c_ulong, + ppPackageInfo: *mut PSecPkgInfoW, + ) -> SECURITY_STATUS; + pub fn EnumerateSecurityPackagesA( + pcPackages: *mut c_ulong, + ppPackageInfo: *mut PSecPkgInfoA, + ) -> SECURITY_STATUS; + pub fn QuerySecurityPackageInfoW( + pszPackageName: LPWSTR, + ppPackageInfo: *mut PSecPkgInfoW, + ) -> SECURITY_STATUS; + pub fn QuerySecurityPackageInfoA( + pszPackageName: LPSTR, + ppPackageInfo: *mut PSecPkgInfoA, + ) -> SECURITY_STATUS; +} +ENUM!{enum SecDelegationType { + SecFull, + SecService, + SecTree, + SecDirectory, + SecObject, +}} +pub type PSecDelegationType = *mut SecDelegationType; +extern "system" { + // pub fn DelegateSecurityContext(); + pub fn ExportSecurityContext( + phContext: PCtxtHandle, + fFlags: ULONG, + pPackedContext: PSecBuffer, + pToken: *mut *mut c_void, + ) -> SECURITY_STATUS; + pub fn ImportSecurityContextW( + pszPackage: LPWSTR, + pPackedContext: PSecBuffer, + Token: *mut c_void, + phContext: PCtxtHandle, + ) -> SECURITY_STATUS; + pub fn ImportSecurityContextA( + pszPackage: LPSTR, + pPackedContext: PSecBuffer, + Token: *mut c_void, + phContext: PCtxtHandle, + ) -> SECURITY_STATUS; +// pub fn SecMakeSPN(); +// pub fn SecMakeSPNEx(); +// pub fn SecMakeSPNEx2(); +// pub fn SecLookupAccountSid(); +// pub fn SecLookupAccountName(); +// pub fn SecLookupWellKnownSid(); +} +extern "system" { + // pub fn InitSecurityInterfaceA(); + // pub fn InitSecurityInterfaceW(); + // pub fn SaslEnumerateProfilesA(); + // pub fn SaslEnumerateProfilesW(); + // pub fn SaslGetProfilePackageA(); + // pub fn SaslGetProfilePackageW(); + // pub fn SaslIdentifyPackageA(); + // pub fn SaslIdentifyPackageW(); + // pub fn SaslInitializeSecurityContextW(); + // pub fn SaslInitializeSecurityContextA(); + // pub fn SaslAcceptSecurityContext(); + // pub fn SaslSetContextOption(); + // pub fn SaslGetContextOption(); +} +pub type PSEC_WINNT_AUTH_IDENTITY_OPAQUE = PVOID; +extern "system" { + pub fn SspiPromptForCredentialsW( + pszTargetName: PCWSTR, + pUiInfo: PCREDUI_INFOW, + dwAuthError: c_ulong, + pszPackage: PCWSTR, + pInputAuthIdentity: PSEC_WINNT_AUTH_IDENTITY_OPAQUE, + ppAuthIdentity: *mut PSEC_WINNT_AUTH_IDENTITY_OPAQUE, + pfSave: *mut c_int, + dwFlags: c_ulong, + ) -> c_ulong; + pub fn SspiPromptForCredentialsA( + pszTargetName: PCSTR, + pUiInfo: PCREDUI_INFOA, + dwAuthError: c_ulong, + pszPackage: PCSTR, + pInputAuthIdentity: PSEC_WINNT_AUTH_IDENTITY_OPAQUE, + ppAuthIdentity: *mut PSEC_WINNT_AUTH_IDENTITY_OPAQUE, + pfSave: *mut c_int, + dwFlags: c_ulong, + ) -> c_ulong; +} +STRUCT!{struct SEC_WINNT_AUTH_BYTE_VECTOR { + ByteArrayOffset: c_ulong, + ByteArrayLength: c_ushort, +}} +pub type PSEC_WINNT_AUTH_BYTE_VECTOR = *mut SEC_WINNT_AUTH_BYTE_VECTOR; +STRUCT!{struct SEC_WINNT_AUTH_DATA { + CredType: GUID, + CredData: SEC_WINNT_AUTH_BYTE_VECTOR, +}} +pub type PSEC_WINNT_AUTH_DATA = *mut SEC_WINNT_AUTH_DATA; +STRUCT!{struct SEC_WINNT_AUTH_PACKED_CREDENTIALS { + cbHeaderLength: c_ushort, + cbStructureLength: c_ushort, + AuthData: SEC_WINNT_AUTH_DATA, +}} +pub type PSEC_WINNT_AUTH_PACKED_CREDENTIALS = *mut SEC_WINNT_AUTH_PACKED_CREDENTIALS; +DEFINE_GUID!{SEC_WINNT_AUTH_DATA_TYPE_PASSWORD, + 0x28bfc32f, 0x10f6, 0x4738, 0x98, 0xd1, 0x1a, 0xc0, 0x61, 0xdf, 0x71, 0x6a} +DEFINE_GUID!{SEC_WINNT_AUTH_DATA_TYPE_CERT, + 0x235f69ad, 0x73fb, 0x4dbc, 0x82, 0x3, 0x6, 0x29, 0xe7, 0x39, 0x33, 0x9b} +STRUCT!{struct SEC_WINNT_AUTH_DATA_PASSWORD { + UnicodePassword: SEC_WINNT_AUTH_BYTE_VECTOR, +}} +pub type PSEC_WINNT_AUTH_DATA_PASSWORD = *mut SEC_WINNT_AUTH_DATA_PASSWORD; +DEFINE_GUID!{SEC_WINNT_AUTH_DATA_TYPE_CSP_DATA, + 0x68fd9879, 0x79c, 0x4dfe, 0x82, 0x81, 0x57, 0x8a, 0xad, 0xc1, 0xc1, 0x0} +// GUID SEC_WINNT_AUTH_DATA_TYPE_SMARTCARD_CONTEXTS +STRUCT!{struct SEC_WINNT_AUTH_CERTIFICATE_DATA { + cbHeaderLength: c_ushort, + cbStructureLength: c_ushort, + Certificate: SEC_WINNT_AUTH_BYTE_VECTOR, +}} +pub type PSEC_WINNT_AUTH_CERTIFICATE_DATA = *mut SEC_WINNT_AUTH_CERTIFICATE_DATA; +STRUCT!{struct SEC_WINNT_CREDUI_CONTEXT_VECTOR { + CredUIContextArrayOffset: ULONG, + CredUIContextCount: USHORT, +}} +pub type PSEC_WINNT_CREDUI_CONTEXT_VECTOR = *mut SEC_WINNT_CREDUI_CONTEXT_VECTOR; +STRUCT!{struct SEC_WINNT_AUTH_SHORT_VECTOR { + ShortArrayOffset: ULONG, + ShortArrayCount: USHORT, +}} +pub type PSEC_WINNT_AUTH_SHORT_VECTOR = *mut SEC_WINNT_AUTH_SHORT_VECTOR; +extern "system" { + pub fn SspiGetCredUIContext( + ContextHandle: HANDLE, + CredType: *mut GUID, + LogonId: *mut LUID, + CredUIContexts: *mut PSEC_WINNT_CREDUI_CONTEXT_VECTOR, + TokenHandle: *mut HANDLE, + ) -> SECURITY_STATUS; + pub fn SspiUpdateCredentials( + ContextHandle: HANDLE, + CredType: *mut GUID, + FlatCredUIContextLength: ULONG, + FlatCredUIContext: PUCHAR, + ) -> SECURITY_STATUS; +} +STRUCT!{struct CREDUIWIN_MARSHALED_CONTEXT { + StructureType: GUID, + cbHeaderLength: USHORT, + LogonId: LUID, + MarshaledDataType: GUID, + MarshaledDataOffset: ULONG, + MarshaledDataLength: USHORT, +}} +pub type PCREDUIWIN_MARSHALED_CONTEXT = *mut CREDUIWIN_MARSHALED_CONTEXT; +STRUCT!{struct SEC_WINNT_CREDUI_CONTEXT { + cbHeaderLength: USHORT, + CredUIContextHandle: HANDLE, + UIInfo: PCREDUI_INFOW, + dwAuthError: ULONG, + pInputAuthIdentity: PSEC_WINNT_AUTH_IDENTITY_OPAQUE, + TargetName: PUNICODE_STRING, +}} +pub type PSEC_WINNT_CREDUI_CONTEXT = *mut SEC_WINNT_CREDUI_CONTEXT; +// GUID CREDUIWIN_STRUCTURE_TYPE_SSPIPFC +// GUID SSPIPFC_STRUCTURE_TYPE_CREDUI_CONTEXT +extern "system" { + pub fn SspiUnmarshalCredUIContext( + MarshaledCredUIContext: PUCHAR, + MarshaledCredUIContextLength: ULONG, + CredUIContext: *mut PSEC_WINNT_CREDUI_CONTEXT, + ) -> SECURITY_STATUS; + // pub fn SspiPrepareForCredRead(); + // pub fn SspiPrepareForCredWrite(); + // pub fn SspiEncryptAuthIdentity(); + // pub fn SspiEncryptAuthIdentityEx(); + // pub fn SspiDecryptAuthIdentity(); + // pub fn SspiDecryptAuthIdentityEx(); + // pub fn SspiIsAuthIdentityEncrypted(); + // pub fn SspiEncodeAuthIdentityAsStrings(); + // pub fn SspiValidateAuthIdentity(); + // pub fn SspiCopyAuthIdentity(); + // pub fn SspiFreeAuthIdentity(); + // pub fn SspiZeroAuthIdentity(); + // pub fn SspiLocalFree(); + // pub fn SspiEncodeStringsAsAuthIdentity(); + // pub fn SspiCompareAuthIdentities(); + // pub fn SspiMarshalAuthIdentity(); + // pub fn SspiUnmarshalAuthIdentity(); + pub fn SspiIsPromptingNeeded( + ErrorOrNtStatus: c_ulong, + ) -> BOOLEAN; + // pub fn SspiGetTargetHostName(); + // pub fn SspiExcludePackage(); + // pub fn AddSecurityPackageA(); + // pub fn AddSecurityPackageW(); + // pub fn DeleteSecurityPackageA(); + // pub fn DeleteSecurityPackageW(); +} diff --git a/bash-5.1/vendor/winapi/src/shared/stralign.rs b/bash-5.1/vendor/winapi/src/shared/stralign.rs new file mode 100644 index 0000000000000000000000000000000000000000..2e2a703fe667e7e939138abc45d788f0a31e2f42 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/stralign.rs @@ -0,0 +1,40 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_int; +use um::winnt::{LPCUWSTR, PCUWSTR, PUWSTR, WCHAR}; +use vc::vcruntime::size_t; +extern "system" { + pub fn uaw_lstrcmpW( + String1: PCUWSTR, + String2: PCUWSTR, + ) -> c_int; + pub fn uaw_lstrcmpiW( + String1: PCUWSTR, + String2: PCUWSTR, + ) -> c_int; + pub fn uaw_lstrlenW( + String: LPCUWSTR, + ) -> c_int; + pub fn uaw_wcschr( + String: PCUWSTR, + Character: WCHAR, + ) -> PUWSTR; + pub fn uaw_wcscpy( + Destination: PUWSTR, + Source: PCUWSTR, + ) -> PUWSTR; + pub fn uaw_wcsicmp( + String1: PCUWSTR, + String2: PCUWSTR, + ) -> c_int; + pub fn uaw_wcslen( + String: PCUWSTR, + ) -> size_t; + pub fn uaw_wcsrchr( + String: PCUWSTR, + Character: WCHAR, + ) -> PUWSTR; +} diff --git a/bash-5.1/vendor/winapi/src/shared/tcpestats.rs b/bash-5.1/vendor/winapi/src/shared/tcpestats.rs new file mode 100644 index 0000000000000000000000000000000000000000..7ddbd9645c0ea13e921fdea0af3cc3225a0ec643 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/tcpestats.rs @@ -0,0 +1,211 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// #include +use shared::basetsd::{SIZE_T, ULONG64}; +use shared::ntdef::{BOOLEAN, UCHAR, ULONG}; +ENUM!{enum TCP_ESTATS_TYPE { + TcpConnectionEstatsSynOpts = 0, + TcpConnectionEstatsData = 1, + TcpConnectionEstatsSndCong = 2, + TcpConnectionEstatsPath = 3, + TcpConnectionEstatsSendBuff = 4, + TcpConnectionEstatsRec = 5, + TcpConnectionEstatsObsRec = 6, + TcpConnectionEstatsBandwidth = 7, + TcpConnectionEstatsFineRtt = 8, + TcpConnectionEstatsMaximum = 9, +}} +pub type PTCP_ESTATS_TYPE = *mut TCP_ESTATS_TYPE; +ENUM!{enum TCP_BOOLEAN_OPTIONAL { + TcpBoolOptDisabled = 0, + TcpBoolOptEnabled = 1, + TcpBoolOptUnchanged = -1i32 as u32, +}} +pub type PTCP_BOOLEAN_OPTIONAL = *mut TCP_BOOLEAN_OPTIONAL; +STRUCT!{struct TCP_ESTATS_SYN_OPTS_ROS_v0 { + ActiveOpen: BOOLEAN, + MssRcvd: ULONG, + MssSent: ULONG, +}} +pub type PTCP_ESTATS_SYN_OPTS_ROS_v0 = *mut TCP_ESTATS_SYN_OPTS_ROS_v0; +ENUM!{enum TCP_SOFT_ERROR { + TcpErrorNone = 0, + TcpErrorBelowDataWindow = 1, + TcpErrorAboveDataWindow = 2, + TcpErrorBelowAckWindow = 3, + TcpErrorAboveAckWindow = 4, + TcpErrorBelowTsWindow = 5, + TcpErrorAboveTsWindow = 6, + TcpErrorDataChecksumError = 7, + TcpErrorDataLengthError = 8, + TcpErrorMaxSoftError = 9, +}} +pub type PTCP_SOFT_ERROR = *mut TCP_SOFT_ERROR; +STRUCT!{struct TCP_ESTATS_DATA_ROD_v0 { + DataBytesOut: ULONG64, + DataSegsOut: ULONG64, + DataBytesIn: ULONG64, + DataSegsIn: ULONG64, + SegsOut: ULONG64, + SegsIn: ULONG64, + SoftErrors: ULONG, + SoftErrorReason: ULONG, + SndUna: ULONG, + SndNxt: ULONG, + SndMax: ULONG, + ThruBytesAcked: ULONG64, + RcvNxt: ULONG, + ThruBytesReceived: ULONG64, +}} +pub type PTCP_ESTATS_DATA_ROD_v0 = *mut TCP_ESTATS_DATA_ROD_v0; +STRUCT!{struct TCP_ESTATS_DATA_RW_v0 { + EnableCollection: BOOLEAN, +}} +pub type PTCP_ESTATS_DATA_RW_v0 = TCP_ESTATS_DATA_RW_v0; +STRUCT!{struct TCP_ESTATS_SND_CONG_ROD_v0 { + SndLimTransRwin: ULONG, + SndLimTimeRwin: ULONG, + SndLimBytesRwin: SIZE_T, + SndLimTransCwnd: ULONG, + SndLimTimeCwnd: ULONG, + SndLimBytesCwnd: SIZE_T, + SndLimTransSnd: ULONG, + SndLimTimeSnd: ULONG, + SndLimBytesSnd: SIZE_T, + SlowStart: ULONG, + CongAvoid: ULONG, + OtherReductions: ULONG, + CurCwnd: ULONG, + MaxSsCwnd: ULONG, + MaxCaCwnd: ULONG, + CurSsthresh: ULONG, + MaxSsthresh: ULONG, + MinSsthresh: ULONG, +}} +pub type PTCP_ESTATS_SND_CONG_ROD_v0 = *mut TCP_ESTATS_SND_CONG_ROD_v0; +STRUCT!{struct TCP_ESTATS_SND_CONG_ROS_v0 { + LimCwnd: ULONG, +}} +pub type PTCP_ESTATS_SND_CONG_ROS_v0 = *mut TCP_ESTATS_SND_CONG_ROS_v0; +STRUCT!{struct TCP_ESTATS_SND_CONG_RW_v0 { + EnableCollection: BOOLEAN, +}} +pub type PTCP_ESTATS_SND_CONG_RW_v0 = *mut TCP_ESTATS_SND_CONG_RW_v0; +STRUCT!{struct TCP_ESTATS_PATH_ROD_v0 { + FastRetran: ULONG, + Timeouts: ULONG, + SubsequentTimeouts: ULONG, + CurTimeoutCount: ULONG, + AbruptTimeouts: ULONG, + PktsRetrans: ULONG, + BytesRetrans: ULONG, + DupAcksIn: ULONG, + SacksRcvd: ULONG, + SackBlocksRcvd: ULONG, + CongSignals: ULONG, + PreCongSumCwnd: ULONG, + PreCongSumRtt: ULONG, + PostCongSumRtt: ULONG, + PostCongCountRtt: ULONG, + EcnSignals: ULONG, + EceRcvd: ULONG, + SendStall: ULONG, + QuenchRcvd: ULONG, + RetranThresh: ULONG, + SndDupAckEpisodes: ULONG, + SumBytesReordered: ULONG, + NonRecovDa: ULONG, + NonRecovDaEpisodes: ULONG, + AckAfterFr: ULONG, + DsackDups: ULONG, + SampleRtt: ULONG, + SmoothedRtt: ULONG, + RttVar: ULONG, + MaxRtt: ULONG, + MinRtt: ULONG, + SumRtt: ULONG, + CountRtt: ULONG, + CurRto: ULONG, + MaxRto: ULONG, + MinRto: ULONG, + CurMss: ULONG, + MaxMss: ULONG, + MinMss: ULONG, + SpuriousRtoDetections: ULONG, +}} +pub type PTCP_ESTATS_PATH_ROD_v0 = *mut TCP_ESTATS_PATH_ROD_v0; +STRUCT!{struct TCP_ESTATS_PATH_RW_v0 { + EnableCollection: BOOLEAN, +}} +pub type PTCP_ESTATS_PATH_RW_v0 = *mut TCP_ESTATS_PATH_RW_v0; +STRUCT!{struct TCP_ESTATS_SEND_BUFF_ROD_v0 { + CurRetxQueue: SIZE_T, + MaxRetxQueue: SIZE_T, + CurAppWQueue: SIZE_T, + MaxAppWQueue: SIZE_T, +}} +pub type PTCP_ESTATS_SEND_BUFF_ROD_v0 = *mut TCP_ESTATS_SEND_BUFF_ROD_v0; +STRUCT!{struct TCP_ESTATS_SEND_BUFF_RW_v0 { + EnableCollection: BOOLEAN, +}} +pub type PTCP_ESTATS_SEND_BUFF_RW_v0 = *mut TCP_ESTATS_SEND_BUFF_RW_v0; +STRUCT!{struct TCP_ESTATS_REC_ROD_v0 { + CurRwinSent: ULONG, + MaxRwinSent: ULONG, + MinRwinSent: ULONG, + LimRwin: ULONG, + DupAckEpisodes: ULONG, + DupAcksOut: ULONG, + CeRcvd: ULONG, + EcnSent: ULONG, + EcnNoncesRcvd: ULONG, + CurReasmQueue: ULONG, + MaxReasmQueue: ULONG, + CurAppRQueue: SIZE_T, + MaxAppRQueue: SIZE_T, + WinScaleSent: UCHAR, +}} +pub type PTCP_ESTATS_REC_ROD_v0 = *mut TCP_ESTATS_REC_ROD_v0; +STRUCT!{struct TCP_ESTATS_REC_RW_v0 { + EnableCollection: BOOLEAN, +}} +pub type PTCP_ESTATS_REC_RW_v0 = *mut TCP_ESTATS_REC_RW_v0; +STRUCT!{struct TCP_ESTATS_OBS_REC_ROD_v0 { + CurRwinRcvd: ULONG, + MaxRwinRcvd: ULONG, + MinRwinRcvd: ULONG, + WinScaleRcvd: UCHAR, +}} +pub type PTCP_ESTATS_OBS_REC_ROD_v0 = *mut TCP_ESTATS_OBS_REC_ROD_v0; +STRUCT!{struct TCP_ESTATS_OBS_REC_RW_v0 { + EnableCollection: BOOLEAN, +}} +pub type PTCP_ESTATS_OBS_REC_RW_v0 = *mut TCP_ESTATS_OBS_REC_RW_v0; +STRUCT!{struct TCP_ESTATS_BANDWIDTH_RW_v0 { + EnableCollectionOutbound: TCP_BOOLEAN_OPTIONAL, + EnableCollectionInbound: TCP_BOOLEAN_OPTIONAL, +}} +pub type PTCP_ESTATS_BANDWIDTH_RW_v0 = *mut TCP_ESTATS_BANDWIDTH_RW_v0; +STRUCT!{struct TCP_ESTATS_BANDWIDTH_ROD_v0 { + OutboundBandwidth: ULONG64, + InboundBandwidth: ULONG64, + OutboundInstability: ULONG64, + InboundInstability: ULONG64, + OutboundBandwidthPeaked: BOOLEAN, + InboundBandwidthPeaked: BOOLEAN, +}} +pub type PTCP_ESTATS_BANDWIDTH_ROD_v0 = *mut TCP_ESTATS_BANDWIDTH_ROD_v0; +STRUCT!{struct TCP_ESTATS_FINE_RTT_RW_v0 { + EnableCollection: BOOLEAN, +}} +pub type PTCP_ESTATS_FINE_RTT_RW_v0 = *mut TCP_ESTATS_FINE_RTT_RW_v0; +STRUCT!{struct TCP_ESTATS_FINE_RTT_ROD_v0 { + RttVar: ULONG, + MaxRtt: ULONG, + MinRtt: ULONG, + SumRtt: ULONG, +}} +pub type PTCP_ESTATS_FINE_RTT_ROD_v0 = *mut TCP_ESTATS_FINE_RTT_ROD_v0; diff --git a/bash-5.1/vendor/winapi/src/shared/tcpmib.rs b/bash-5.1/vendor/winapi/src/shared/tcpmib.rs new file mode 100644 index 0000000000000000000000000000000000000000..63ae7965a954d2fc62ea8e3b51e1201ca4abe90d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/tcpmib.rs @@ -0,0 +1,244 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// #include +use shared::basetsd::DWORD64; +use shared::in6addr::IN6_ADDR; +use shared::minwindef::DWORD; +use shared::ntdef::{LARGE_INTEGER, UCHAR, ULONGLONG}; +const ANY_SIZE: usize = 1; +pub const TCPIP_OWNING_MODULE_SIZE: usize = 16; +ENUM!{enum MIB_TCP_STATE { + MIB_TCP_STATE_CLOSED = 1, + MIB_TCP_STATE_LISTEN = 2, + MIB_TCP_STATE_SYN_SENT = 3, + MIB_TCP_STATE_SYN_RCVD = 4, + MIB_TCP_STATE_ESTAB = 5, + MIB_TCP_STATE_FIN_WAIT1 = 6, + MIB_TCP_STATE_FIN_WAIT2 = 7, + MIB_TCP_STATE_CLOSE_WAIT = 8, + MIB_TCP_STATE_CLOSING = 9, + MIB_TCP_STATE_LAST_ACK = 10, + MIB_TCP_STATE_TIME_WAIT = 11, + MIB_TCP_STATE_DELETE_TCB = 12, + MIB_TCP_STATE_RESERVED = 100, +}} +ENUM!{enum TCP_CONNECTION_OFFLOAD_STATE { + TcpConnectionOffloadStateInHost = 0, + TcpConnectionOffloadStateOffloading = 1, + TcpConnectionOffloadStateOffloaded = 2, + TcpConnectionOffloadStateUploading = 3, + TcpConnectionOffloadStateMax = 4, +}} +pub type PTCP_CONNECTION_OFFLOAD_STATE = *mut TCP_CONNECTION_OFFLOAD_STATE; +STRUCT!{struct MIB_TCPROW_LH { + State: MIB_TCP_STATE, + dwLocalAddr: DWORD, + dwLocalPort: DWORD, + dwRemoteAddr: DWORD, + dwRemotePort: DWORD, +}} +pub type PMIB_TCPROW_LH = *mut MIB_TCPROW_LH; +STRUCT!{struct MIB_TCPROW_W2K { + dwState: DWORD, + dwLocalAddr: DWORD, + dwLocalPort: DWORD, + dwRemoteAddr: DWORD, + dwRemotePort: DWORD, +}} +pub type PMIB_TCPROW_W2K = *mut MIB_TCPROW_W2K; +pub type MIB_TCPROW = MIB_TCPROW_LH; +pub type PMIB_TCPROW = *mut MIB_TCPROW; +STRUCT!{struct MIB_TCPTABLE { + dwNumEntries: DWORD, + table: [MIB_TCPROW; ANY_SIZE], +}} +pub type PMIB_TCPTABLE = *mut MIB_TCPTABLE; +// FIXME: SIZEOF_TCPTABLE(x) +STRUCT!{struct MIB_TCPROW2 { + dwState: DWORD, + dwLocalAddr: DWORD, + dwLocalPort: DWORD, + dwRemoteAddr: DWORD, + dwRemotePort: DWORD, + dwOwningPid: DWORD, + dwOffloadState: TCP_CONNECTION_OFFLOAD_STATE, +}} +pub type PMIB_TCPROW2 = *mut MIB_TCPROW2; +STRUCT!{struct MIB_TCPTABLE2 { + dwNumEntries: DWORD, + table: [MIB_TCPROW2; ANY_SIZE], +}} +pub type PMIB_TCPTABLE2 = *mut MIB_TCPTABLE2; +// FIXME: SIZEOF_TCPTABLE2(x) +STRUCT!{struct MIB_TCPROW_OWNER_PID { + dwState: DWORD, + dwLocalAddr: DWORD, + dwLocalPort: DWORD, + dwRemoteAddr: DWORD, + dwRemotePort: DWORD, + dwOwningPid: DWORD, +}} +pub type PMIB_TCPROW_OWNER_PID = *mut MIB_TCPROW_OWNER_PID; +STRUCT!{struct MIB_TCPTABLE_OWNER_PID { + dwNumEntries: DWORD, + table: [MIB_TCPROW_OWNER_PID; ANY_SIZE], +}} +pub type PMIB_TCPTABLE_OWNER_PID = *mut MIB_TCPTABLE_OWNER_PID; +// FIXME: SIZEOF_TCPTABLE_OWNER_PID(x) +STRUCT!{struct MIB_TCPROW_OWNER_MODULE { + dwState: DWORD, + dwLocalAddr: DWORD, + dwLocalPort: DWORD, + dwRemoteAddr: DWORD, + dwRemotePort: DWORD, + dwOwningPid: DWORD, + liCreateTimestamp: LARGE_INTEGER, + OwningModuleInfo: [ULONGLONG; TCPIP_OWNING_MODULE_SIZE], +}} +pub type PMIB_TCPROW_OWNER_MODULE = *mut MIB_TCPROW_OWNER_MODULE; +STRUCT!{struct MIB_TCPTABLE_OWNER_MODULE { + dwNumEntries: DWORD, + table: [MIB_TCPROW_OWNER_MODULE; ANY_SIZE], +}} +pub type PMIB_TCPTABLE_OWNER_MODULE = *mut MIB_TCPTABLE_OWNER_MODULE; +// FIXME: SIZEOF_TCPTABLE_OWNER_MODULE(x) +STRUCT!{struct MIB_TCP6ROW { + State: MIB_TCP_STATE, + LocalAddr: IN6_ADDR, + dwLocalScopeId: DWORD, + dwLocalPort: DWORD, + RemoteAddr: IN6_ADDR, + dwRemoteScopeId: DWORD, + dwRemotePort: DWORD, +}} +pub type PMIB_TCP6ROW = *mut MIB_TCP6ROW; +STRUCT!{struct MIB_TCP6TABLE { + dwNumEntries: DWORD, + table: [MIB_TCP6ROW; ANY_SIZE], +}} +pub type PMIB_TCP6TABLE = *mut MIB_TCP6TABLE; +// FIXME: SIZEOF_TCP6TABLE(x) +STRUCT!{struct MIB_TCP6ROW2 { + LocalAddr: IN6_ADDR, + dwLocalScopeId: DWORD, + dwLocalPort: DWORD, + RemoteAddr: IN6_ADDR, + dwRemoteScopeId: DWORD, + dwRemotePort: DWORD, + State: MIB_TCP_STATE, + dwOwningPid: DWORD, + dwOffloadState: TCP_CONNECTION_OFFLOAD_STATE, +}} +pub type PMIB_TCP6ROW2 = *mut MIB_TCP6ROW2; +STRUCT!{struct MIB_TCP6TABLE2 { + dwNumEntries: DWORD, + table: [MIB_TCP6ROW2; ANY_SIZE], +}} +pub type PMIB_TCP6TABLE2 = *mut MIB_TCP6TABLE2; +// FIXME: SIZEOF_TCP6TABLE2(x) +STRUCT!{struct MIB_TCP6ROW_OWNER_PID { + ucLocalAddr: [UCHAR; 16], + dwLocalScopeId: DWORD, + dwLocalPort: DWORD, + ucRemoteAddr: [UCHAR; 16], + dwRemoteScopeId: DWORD, + dwRemotePort: DWORD, + dwState: DWORD, + dwOwningPid: DWORD, +}} +pub type PMIB_TCP6ROW_OWNER_PID = *mut MIB_TCP6ROW_OWNER_PID; +STRUCT!{struct MIB_TCP6TABLE_OWNER_PID { + dwNumEntries: DWORD, + table: [MIB_TCP6ROW_OWNER_PID; ANY_SIZE], +}} +pub type PMIB_TCP6TABLE_OWNER_PID = *mut MIB_TCP6TABLE_OWNER_PID; +// FIXME: SIZEOF_TCP6TABLE_OWNER_PID(x) +STRUCT!{struct MIB_TCP6ROW_OWNER_MODULE { + ucLocalAddr: [UCHAR; 16], + dwLocalScopeId: DWORD, + dwLocalPort: DWORD, + ucRemoteAddr: [UCHAR; 16], + dwRemoteScopeId: DWORD, + dwRemotePort: DWORD, + dwState: DWORD, + dwOwningPid: DWORD, + liCreateTimestamp: LARGE_INTEGER, + OwningModuleInfo: [ULONGLONG; TCPIP_OWNING_MODULE_SIZE], +}} +pub type PMIB_TCP6ROW_OWNER_MODULE = *mut MIB_TCP6ROW_OWNER_MODULE; +STRUCT!{struct MIB_TCP6TABLE_OWNER_MODULE { + dwNumEntries: DWORD, + table: [MIB_TCP6ROW_OWNER_MODULE; ANY_SIZE], +}} +pub type PMIB_TCP6TABLE_OWNER_MODULE = *mut MIB_TCP6TABLE_OWNER_MODULE; +// FIXME: SIZEOF_TCP6TABLE_OWNER_MODULE(x) +ENUM!{enum TCP_RTO_ALGORITHM { + TcpRtoAlgorithmOther = 1, + TcpRtoAlgorithmConstant = 2, + TcpRtoAlgorithmRsre = 3, + TcpRtoAlgorithmVanj = 4, + MIB_TCP_RTO_OTHER = 1, + MIB_TCP_RTO_CONSTANT = 2, + MIB_TCP_RTO_RSRE = 3, + MIB_TCP_RTO_VANJ = 4, +}} +pub type PTCP_RTO_ALGORITHM = *mut TCP_RTO_ALGORITHM; +STRUCT!{struct MIB_TCPSTATS_LH { + RtoAlgorithm: TCP_RTO_ALGORITHM, + dwRtoMin: DWORD, + dwRtoMax: DWORD, + dwMaxConn: DWORD, + dwActiveOpens: DWORD, + dwPassiveOpens: DWORD, + dwAttemptFails: DWORD, + dwEstabResets: DWORD, + dwCurrEstab: DWORD, + dwInSegs: DWORD, + dwOutSegs: DWORD, + dwRetransSegs: DWORD, + dwInErrs: DWORD, + dwOutRsts: DWORD, + dwNumConns: DWORD, +}} +pub type PMIB_TCPSTATS_LH = *mut MIB_TCPSTATS_LH; +STRUCT!{struct MIB_TCPSTATS_W2K { + dwRtoAlgorithm: DWORD, + dwRtoMin: DWORD, + dwRtoMax: DWORD, + dwMaxConn: DWORD, + dwActiveOpens: DWORD, + dwPassiveOpens: DWORD, + dwAttemptFails: DWORD, + dwEstabResets: DWORD, + dwCurrEstab: DWORD, + dwInSegs: DWORD, + dwOutSegs: DWORD, + dwRetransSegs: DWORD, + dwInErrs: DWORD, + dwOutRsts: DWORD, + dwNumConns: DWORD, +}} +pub type PMIB_TCPSTATS_W2K = *mut MIB_TCPSTATS_W2K; +pub type MIB_TCPSTATS = MIB_TCPSTATS_LH; +pub type PMIB_TCPSTATS = *mut MIB_TCPSTATS; +STRUCT!{struct MIB_TCPSTATS2 { + RtoAlgorithm: TCP_RTO_ALGORITHM, + dwRtoMin: DWORD, + dwRtoMax: DWORD, + dwMaxConn: DWORD, + dwActiveOpens: DWORD, + dwPassiveOpens: DWORD, + dwAttemptFails: DWORD, + dwEstabResets: DWORD, + dwCurrEstab: DWORD, + dw64InSegs: DWORD64, + dw64OutSegs: DWORD64, + dwRetransSegs: DWORD, + dwInErrs: DWORD, + dwOutRsts: DWORD, + dwNumConns: DWORD, +}} +pub type PMIB_TCPSTATS2 = *mut MIB_TCPSTATS2; diff --git a/bash-5.1/vendor/winapi/src/shared/transportsettingcommon.rs b/bash-5.1/vendor/winapi/src/shared/transportsettingcommon.rs new file mode 100644 index 0000000000000000000000000000000000000000..2f5f6fb6c129a67ad3c0c74f1a930430344a6ae3 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/transportsettingcommon.rs @@ -0,0 +1,10 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +STRUCT!{struct TRANSPORT_SETTING_ID { + Guid: GUID, +}} +pub type PTRANSPORT_SETTING_ID = *mut TRANSPORT_SETTING_ID; diff --git a/bash-5.1/vendor/winapi/src/shared/tvout.rs b/bash-5.1/vendor/winapi/src/shared/tvout.rs new file mode 100644 index 0000000000000000000000000000000000000000..f691bdf32a4f72db63103d9859d612ea10e56784 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/tvout.rs @@ -0,0 +1,72 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::{UCHAR, ULONG}; +STRUCT!{struct VIDEOPARAMETERS { + Guid: GUID, + dwOffset: ULONG, + dwCommand: ULONG, + dwFlags: ULONG, + dwMode: ULONG, + dwTVStandard: ULONG, + dwAvailableModes: ULONG, + dwAvailableTVStandard: ULONG, + dwFlickerFilter: ULONG, + dwOverScanX: ULONG, + dwOverScanY: ULONG, + dwMaxUnscaledX: ULONG, + dwMaxUnscaledY: ULONG, + dwPositionX: ULONG, + dwPositionY: ULONG, + dwBrightness: ULONG, + dwContrast: ULONG, + dwCPType: ULONG, + dwCPCommand: ULONG, + dwCPStandard: ULONG, + dwCPKey: ULONG, + bCP_APSTriggerBits: ULONG, + bOEMCopyProtection: [UCHAR; 256], +}} +pub type PVIDEOPARAMETERS = *mut VIDEOPARAMETERS; +pub type LPVIDEOPARAMETERS = *mut VIDEOPARAMETERS; +pub const VP_COMMAND_GET: ULONG = 0x0001; +pub const VP_COMMAND_SET: ULONG = 0x0002; +pub const VP_FLAGS_TV_MODE: ULONG = 0x0001; +pub const VP_FLAGS_TV_STANDARD: ULONG = 0x0002; +pub const VP_FLAGS_FLICKER: ULONG = 0x0004; +pub const VP_FLAGS_OVERSCAN: ULONG = 0x0008; +pub const VP_FLAGS_MAX_UNSCALED: ULONG = 0x0010; +pub const VP_FLAGS_POSITION: ULONG = 0x0020; +pub const VP_FLAGS_BRIGHTNESS: ULONG = 0x0040; +pub const VP_FLAGS_CONTRAST: ULONG = 0x0080; +pub const VP_FLAGS_COPYPROTECT: ULONG = 0x0100; +pub const VP_MODE_WIN_GRAPHICS: ULONG = 0x0001; +pub const VP_MODE_TV_PLAYBACK: ULONG = 0x0002; +pub const VP_TV_STANDARD_NTSC_M: ULONG = 0x0001; +pub const VP_TV_STANDARD_NTSC_M_J: ULONG = 0x0002; +pub const VP_TV_STANDARD_PAL_B: ULONG = 0x0004; +pub const VP_TV_STANDARD_PAL_D: ULONG = 0x0008; +pub const VP_TV_STANDARD_PAL_H: ULONG = 0x0010; +pub const VP_TV_STANDARD_PAL_I: ULONG = 0x0020; +pub const VP_TV_STANDARD_PAL_M: ULONG = 0x0040; +pub const VP_TV_STANDARD_PAL_N: ULONG = 0x0080; +pub const VP_TV_STANDARD_SECAM_B: ULONG = 0x0100; +pub const VP_TV_STANDARD_SECAM_D: ULONG = 0x0200; +pub const VP_TV_STANDARD_SECAM_G: ULONG = 0x0400; +pub const VP_TV_STANDARD_SECAM_H: ULONG = 0x0800; +pub const VP_TV_STANDARD_SECAM_K: ULONG = 0x1000; +pub const VP_TV_STANDARD_SECAM_K1: ULONG = 0x2000; +pub const VP_TV_STANDARD_SECAM_L: ULONG = 0x4000; +pub const VP_TV_STANDARD_WIN_VGA: ULONG = 0x8000; +pub const VP_TV_STANDARD_NTSC_433: ULONG = 0x00010000; +pub const VP_TV_STANDARD_PAL_G: ULONG = 0x00020000; +pub const VP_TV_STANDARD_PAL_60: ULONG = 0x00040000; +pub const VP_TV_STANDARD_SECAM_L1: ULONG = 0x00080000; +pub const VP_CP_TYPE_APS_TRIGGER: ULONG = 0x0001; +pub const VP_CP_TYPE_MACROVISION: ULONG = 0x0002; +pub const VP_CP_CMD_ACTIVATE: ULONG = 0x0001; +pub const VP_CP_CMD_DEACTIVATE: ULONG = 0x0002; +pub const VP_CP_CMD_CHANGE: ULONG = 0x0004; diff --git a/bash-5.1/vendor/winapi/src/shared/udpmib.rs b/bash-5.1/vendor/winapi/src/shared/udpmib.rs new file mode 100644 index 0000000000000000000000000000000000000000..e5a73a20ce1c3eb562924f1298567a1612ef1a85 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/udpmib.rs @@ -0,0 +1,130 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Contains the public definitions and structures for the UDP-specific parts of MIB-II +// #include +use shared::basetsd::DWORD64; +use shared::in6addr::IN6_ADDR; +use shared::minwindef::DWORD; +use shared::ntdef::{INT, LARGE_INTEGER, UCHAR, ULONGLONG}; +const ANY_SIZE: usize = 1; +pub const TCPIP_OWNING_MODULE_SIZE: usize = 16; +STRUCT!{struct MIB_UDPROW { + dwLocalAddr: DWORD, + dwLocalPort: DWORD, +}} +pub type PMIB_UDPROW = *mut MIB_UDPROW; +STRUCT!{struct MIB_UDPTABLE { + dwNumEntries: DWORD, + table: [MIB_UDPROW; ANY_SIZE], +}} +pub type PMIB_UDPTABLE = *mut MIB_UDPTABLE; +// FIXME: SIZEOF_UDPTABLE(x) +STRUCT!{struct MIB_UDPROW_OWNER_PID { + dwLocalAddr: DWORD, + dwLocalPort: DWORD, + dwOwningPid: DWORD, +}} +pub type PMIB_UDPROW_OWNER_PID = *mut MIB_UDPROW_OWNER_PID; +STRUCT!{struct MIB_UDPTABLE_OWNER_PID { + dwNumEntries: DWORD, + table: [MIB_UDPROW_OWNER_PID; ANY_SIZE], +}} +pub type PMIB_UDPTABLE_OWNER_PID = *mut MIB_UDPTABLE_OWNER_PID; +// FIXME: SIZEOF_UDPTABLE_OWNER_PID(x) +STRUCT!{struct MIB_UDPROW_OWNER_MODULE_u_s { + bitfield: INT, +}} +BITFIELD!{MIB_UDPROW_OWNER_MODULE_u_s bitfield: INT [ + SpecificPortBind set_SpecificPortBind[0..1], +]} +UNION!{union MIB_UDPROW_OWNER_MODULE_u { + [i32; 1], + s s_mut: MIB_UDPROW_OWNER_MODULE_u_s, + dwFlags dwFlags_mut: INT, +}} +STRUCT!{struct MIB_UDPROW_OWNER_MODULE { + dwLocalAddr: DWORD, + dwLocalPort: DWORD, + dwOwningPid: DWORD, + liCreateTimestamp: LARGE_INTEGER, + u: MIB_UDPROW_OWNER_MODULE_u, + OwningModuleInfo: [ULONGLONG; TCPIP_OWNING_MODULE_SIZE], +}} +pub type PMIB_UDPROW_OWNER_MODULE = *mut MIB_UDPROW_OWNER_MODULE; +STRUCT!{struct MIB_UDPTABLE_OWNER_MODULE { + dwNumEntries: DWORD, + table: [MIB_UDPROW_OWNER_MODULE; ANY_SIZE], +}} +pub type PMIB_UDPTABLE_OWNER_MODULE = *mut MIB_UDPTABLE_OWNER_MODULE; +// FIXME: SIZEOF_UDPTABLE_OWNER_MODULE(x) +STRUCT!{struct MIB_UDP6ROW { + dwLocalAddr: IN6_ADDR, + dwLocalScopeId: DWORD, + dwLocalPort: DWORD, +}} +pub type PMIB_UDP6ROW = *mut MIB_UDP6ROW; +STRUCT!{struct MIB_UDP6TABLE { + dwNumEntries: DWORD, + table: [MIB_UDP6ROW; ANY_SIZE], +}} +pub type PMIB_UDP6TABLE = *mut MIB_UDP6TABLE; +// FIXME: SIZEOF_UDP6TABLE(x) +STRUCT!{struct MIB_UDP6ROW_OWNER_PID { + ucLocalAddr: [UCHAR; 16], + dwLocalScopeId: DWORD, + dwLocalPort: DWORD, + dwOwningPid: DWORD, +}} +pub type PMIB_UDP6ROW_OWNER_PID = *mut MIB_UDP6ROW_OWNER_PID; +STRUCT!{struct MIB_UDP6TABLE_OWNER_PID { + dwNumEntries: DWORD, + table: [MIB_UDP6ROW_OWNER_PID; ANY_SIZE], +}} +pub type PMIB_UDP6TABLE_OWNER_PID = *mut MIB_UDP6TABLE_OWNER_PID; +// FIXME: SIZEOF_UDP6TABLE_OWNER_PID(x) +STRUCT!{struct MIB_UDP6ROW_OWNER_MODULE_u_s { + bitfield: INT, +}} +BITFIELD!{MIB_UDP6ROW_OWNER_MODULE_u_s bitfield: INT [ + SpecificPortBind set_SpecificPortBind[0..1], +]} +UNION!{union MIB_UDP6ROW_OWNER_MODULE_u { + [i32; 1], + s s_mut: INT, + dwFlags dwFlags_mut: INT, +}} +STRUCT!{struct MIB_UDP6ROW_OWNER_MODULE { + ucLocalAddr: [UCHAR; 16], + dwLocalScopeId: DWORD, + dwLocalPort: DWORD, + dwOwningPid: DWORD, + liCreateTimestamp: LARGE_INTEGER, + u: MIB_UDP6ROW_OWNER_MODULE_u, + OwningModuleInfo: [ULONGLONG; TCPIP_OWNING_MODULE_SIZE], +}} +pub type PMIB_UDP6ROW_OWNER_MODULE = *mut MIB_UDP6ROW_OWNER_MODULE; +STRUCT!{struct MIB_UDP6TABLE_OWNER_MODULE { + dwNumEntries: DWORD, + table: [MIB_UDP6ROW_OWNER_MODULE; ANY_SIZE], +}} +pub type PMIB_UDP6TABLE_OWNER_MODULE = *mut MIB_UDP6TABLE_OWNER_MODULE; +// FIXME: SIZEOF_UDP6TABLE_OWNER_MODULE(x) +STRUCT!{struct MIB_UDPSTATS { + dwInDatagrams: DWORD, + dwNoPorts: DWORD, + dwInErrors: DWORD, + dwOutDatagrams: DWORD, + dwNumAddrs: DWORD, +}} +pub type PMIB_UDPSTATS = *mut MIB_UDPSTATS; +STRUCT!{struct MIB_UDPSTATS2 { + dw64InDatagrams: DWORD64, + dwNoPorts: DWORD, + dwInErrors: DWORD, + dw64OutDatagrams: DWORD64, + dwNumAddrs: DWORD, +}} +pub type PMIB_UDPSTATS2 = *mut MIB_UDPSTATS2; diff --git a/bash-5.1/vendor/winapi/src/shared/usb.rs b/bash-5.1/vendor/winapi/src/shared/usb.rs new file mode 100644 index 0000000000000000000000000000000000000000..f6bd3b77ee4751bde0590e1033aaef2d6b15eb45 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/usb.rs @@ -0,0 +1,523 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! USB Definitions. +use shared::minwindef::{UCHAR, ULONG, USHORT}; +use shared::usbspec::{ + PUSB_CONFIGURATION_DESCRIPTOR, USB_DEVICE_DESCRIPTOR, USB_ENDPOINT_DIRECTION_MASK, +}; +use um::winnt::{LONG, PVOID, WCHAR}; +pub type PRIP = PVOID; +pub type PMDL = PVOID; +pub const USBDI_VERSION: ULONG = 0x00000600; +pub const USB_PORTATTR_NO_CONNECTOR: ULONG = 0x00000001; +pub const USB_PORTATTR_SHARED_USB2: ULONG = 0x00000002; +pub const USB_PORTATTR_MINI_CONNECTOR: ULONG = 0x00000004; +pub const USB_PORTATTR_OEM_CONNECTOR: ULONG = 0x00000008; +pub const USB_PORTATTR_OWNED_BY_CC: ULONG = 0x01000000; +pub const USB_PORTATTR_NO_OVERCURRENT_UI: ULONG = 0x02000000; +ENUM!{enum USB_CONTROLLER_FLAVOR { + USB_HcGeneric = 0, + OHCI_Generic = 100, + OHCI_Hydra, + OHCI_NEC, + UHCI_Generic = 200, + UHCI_Piix4 = 201, + UHCI_Piix3 = 202, + UHCI_Ich2 = 203, + UHCI_Reserved204 = 204, + UHCI_Ich1 = 205, + UHCI_Ich3m = 206, + UHCI_Ich4 = 207, + UHCI_Ich5 = 208, + UHCI_Ich6 = 209, + UHCI_Intel = 249, + UHCI_VIA = 250, + UHCI_VIA_x01 = 251, + UHCI_VIA_x02 = 252, + UHCI_VIA_x03 = 253, + UHCI_VIA_x04 = 254, + UHCI_VIA_x0E_FIFO = 264, + EHCI_Generic = 1000, + EHCI_NEC = 2000, + EHCI_Lucent = 3000, + EHCI_NVIDIA_Tegra2 = 4000, + EHCI_NVIDIA_Tegra3 = 4001, + EHCI_Intel_Medfield = 5001, +}} +pub const USB_DEFAULT_DEVICE_ADDRESS: UCHAR = 0; +pub const USB_DEFAULT_ENDPOINT_ADDRESS: UCHAR = 0; +pub const USB_DEFAULT_MAX_PACKET: USHORT = 64; +pub const URB_FUNCTION_SELECT_CONFIGURATION: USHORT = 0x0000; +pub const URB_FUNCTION_SELECT_INTERFACE: USHORT = 0x0001; +pub const URB_FUNCTION_ABORT_PIPE: USHORT = 0x0002; +pub const URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL: USHORT = 0x0003; +pub const URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL: USHORT = 0x0004; +pub const URB_FUNCTION_GET_FRAME_LENGTH: USHORT = 0x0005; +pub const URB_FUNCTION_SET_FRAME_LENGTH: USHORT = 0x0006; +pub const URB_FUNCTION_GET_CURRENT_FRAME_NUMBER: USHORT = 0x0007; +pub const URB_FUNCTION_CONTROL_TRANSFER: USHORT = 0x0008; +pub const URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: USHORT = 0x0009; +pub const URB_FUNCTION_ISOCH_TRANSFER: USHORT = 0x000A; +pub const URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE: USHORT = 0x000B; +pub const URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE: USHORT = 0x000C; +pub const URB_FUNCTION_SET_FEATURE_TO_DEVICE: USHORT = 0x000D; +pub const URB_FUNCTION_SET_FEATURE_TO_INTERFACE: USHORT = 0x000E; +pub const URB_FUNCTION_SET_FEATURE_TO_ENDPOINT: USHORT = 0x000F; +pub const URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE: USHORT = 0x0010; +pub const URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE: USHORT = 0x0011; +pub const URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT: USHORT = 0x0012; +pub const URB_FUNCTION_GET_STATUS_FROM_DEVICE: USHORT = 0x0013; +pub const URB_FUNCTION_GET_STATUS_FROM_INTERFACE: USHORT = 0x0014; +pub const URB_FUNCTION_GET_STATUS_FROM_ENDPOINT: USHORT = 0x0015; +pub const URB_FUNCTION_RESERVED_0X0016: USHORT = 0x0016; +pub const URB_FUNCTION_VENDOR_DEVICE: USHORT = 0x0017; +pub const URB_FUNCTION_VENDOR_INTERFACE: USHORT = 0x0018; +pub const URB_FUNCTION_VENDOR_ENDPOINT: USHORT = 0x0019; +pub const URB_FUNCTION_CLASS_DEVICE: USHORT = 0x001A; +pub const URB_FUNCTION_CLASS_INTERFACE: USHORT = 0x001B; +pub const URB_FUNCTION_CLASS_ENDPOINT: USHORT = 0x001C; +pub const URB_FUNCTION_RESERVE_0X001D: USHORT = 0x001D; +pub const URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL: USHORT = 0x001E; +pub const URB_FUNCTION_CLASS_OTHER: USHORT = 0x001F; +pub const URB_FUNCTION_VENDOR_OTHER: USHORT = 0x0020; +pub const URB_FUNCTION_GET_STATUS_FROM_OTHER: USHORT = 0x0021; +pub const URB_FUNCTION_CLEAR_FEATURE_TO_OTHER: USHORT = 0x0022; +pub const URB_FUNCTION_SET_FEATURE_TO_OTHER: USHORT = 0x0023; +pub const URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT: USHORT = 0x0024; +pub const URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT: USHORT = 0x0025; +pub const URB_FUNCTION_GET_CONFIGURATION: USHORT = 0x0026; +pub const URB_FUNCTION_GET_INTERFACE: USHORT = 0x0027; +pub const URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE: USHORT = 0x0028; +pub const URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE: USHORT = 0x0029; +pub const URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR: USHORT = 0x002A; +pub const URB_FUNCTION_SYNC_RESET_PIPE: USHORT = 0x0030; +pub const URB_FUNCTION_SYNC_CLEAR_STALL: USHORT = 0x0031; +pub const URB_FUNCTION_CONTROL_TRANSFER_EX: USHORT = 0x0032; +pub const URB_FUNCTION_RESERVE_0X0033: USHORT = 0x0033; +pub const URB_FUNCTION_RESERVE_0X0034: USHORT = 0x0034; +pub const URB_FUNCTION_OPEN_STATIC_STREAMS: USHORT = 0x0035; +pub const URB_FUNCTION_CLOSE_STATIC_STREAMS: USHORT = 0x0036; +pub const URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER_USING_CHAINED_MDL: USHORT = 0x0037; +pub const URB_FUNCTION_ISOCH_TRANSFER_USING_CHAINED_MDL: USHORT = 0x0038; +pub const URB_FUNCTION_RESERVE_0X002B: USHORT = 0x002B; +pub const URB_FUNCTION_RESERVE_0X002C: USHORT = 0x002C; +pub const URB_FUNCTION_RESERVE_0X002D: USHORT = 0x002D; +pub const URB_FUNCTION_RESERVE_0X002E: USHORT = 0x002E; +pub const URB_FUNCTION_RESERVE_0X002F: USHORT = 0x002F; +pub const URB_FUNCTION_RESET_PIPE: USHORT = URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL; +pub const USBD_SHORT_TRANSFER_OK: ULONG = 0x00000002; +pub const USBD_START_ISO_TRANSFER_ASAP: ULONG = 0x00000004; +pub const USBD_DEFAULT_PIPE_TRANSFER: ULONG = 0x00000008; +pub const USBD_TRANSFER_DIRECTION_OUT: ULONG = 0; +pub const USBD_TRANSFER_DIRECTION_IN: ULONG = 1; +pub const USBD_TRANSFER_DIRECTION: ULONG = USBD_TRANSFER_DIRECTION_IN; +#[inline] +pub fn USBD_TRANSFER_DIRECTION_FLAG(flags: ULONG) -> ULONG { + flags & USBD_TRANSFER_DIRECTION +} +pub const VALID_TRANSFER_FLAGS_MASK: ULONG = USBD_SHORT_TRANSFER_OK | USBD_TRANSFER_DIRECTION + | USBD_START_ISO_TRANSFER_ASAP | USBD_DEFAULT_PIPE_TRANSFER; +pub const USBD_ISO_START_FRAME_RANGE: ULONG = 1024; +pub type USBD_STATUS = LONG; +#[inline] +pub fn USBD_SUCCESS(Status: USBD_STATUS) -> bool { + Status >= 0 +} +#[inline] +pub fn USBD_PENDING(Status: ULONG) -> bool { + (Status >> 30) == 1 +} +pub const USBD_STATUS_SUCCESS: USBD_STATUS = 0x00000000; +pub const USBD_STATUS_PORT_OPERATION_PENDING: USBD_STATUS = 0x00000001; +pub const USBD_STATUS_PENDING: USBD_STATUS = 0x40000000; +pub const USBD_STATUS_CRC: USBD_STATUS = 0xC0000001; +pub const USBD_STATUS_BTSTUFF: USBD_STATUS = 0xC0000002; +pub const USBD_STATUS_DATA_TOGGLE_MISMATCH: USBD_STATUS = 0xC0000003; +pub const USBD_STATUS_STALL_PID: USBD_STATUS = 0xC0000004; +pub const USBD_STATUS_DEV_NOT_RESPONDING: USBD_STATUS = 0xC0000005; +pub const USBD_STATUS_PID_CHECK_FAILURE: USBD_STATUS = 0xC0000006; +pub const USBD_STATUS_UNEXPECTED_PID: USBD_STATUS = 0xC0000007; +pub const USBD_STATUS_DATA_OVERRUN: USBD_STATUS = 0xC0000008; +pub const USBD_STATUS_DATA_UNDERRUN: USBD_STATUS = 0xC0000009; +pub const USBD_STATUS_RESERVED1: USBD_STATUS = 0xC000000A; +pub const USBD_STATUS_RESERVED2: USBD_STATUS = 0xC000000B; +pub const USBD_STATUS_BUFFER_OVERRUN: USBD_STATUS = 0xC000000C; +pub const USBD_STATUS_BUFFER_UNDERRUN: USBD_STATUS = 0xC000000D; +pub const USBD_STATUS_NOT_ACCESSED: USBD_STATUS = 0xC000000F; +pub const USBD_STATUS_FIFO: USBD_STATUS = 0xC0000010; +pub const USBD_STATUS_XACT_ERROR: USBD_STATUS = 0xC0000011; +pub const USBD_STATUS_BABBLE_DETECTED: USBD_STATUS = 0xC0000012; +pub const USBD_STATUS_DATA_BUFFER_ERROR: USBD_STATUS = 0xC0000013; +pub const USBD_STATUS_NO_PING_RESPONSE: USBD_STATUS = 0xC0000014; +pub const USBD_STATUS_INVALID_STREAM_TYPE: USBD_STATUS = 0xC0000015; +pub const USBD_STATUS_INVALID_STREAM_ID: USBD_STATUS = 0xC0000016; +pub const USBD_STATUS_ENDPOINT_HALTED: USBD_STATUS = 0xC0000030; +pub const USBD_STATUS_INVALID_URB_FUNCTION: USBD_STATUS = 0x80000200; +pub const USBD_STATUS_INVALID_PARAMETER: USBD_STATUS = 0x80000300; +pub const USBD_STATUS_ERROR_BUSY: USBD_STATUS = 0x80000400; +pub const USBD_STATUS_INVALID_PIPE_HANDLE: USBD_STATUS = 0x80000600; +pub const USBD_STATUS_NO_BANDWIDTH: USBD_STATUS = 0x80000700; +pub const USBD_STATUS_INTERNAL_HC_ERROR: USBD_STATUS = 0x80000800; +pub const USBD_STATUS_ERROR_SHORT_TRANSFER: USBD_STATUS = 0x80000900; +pub const USBD_STATUS_BAD_START_FRAME: USBD_STATUS = 0xC0000A00; +pub const USBD_STATUS_ISOCH_REQUEST_FAILED: USBD_STATUS = 0xC0000B00; +pub const USBD_STATUS_FRAME_CONTROL_OWNED: USBD_STATUS = 0xC0000C00; +pub const USBD_STATUS_FRAME_CONTROL_NOT_OWNED: USBD_STATUS = 0xC0000D00; +pub const USBD_STATUS_NOT_SUPPORTED: USBD_STATUS = 0xC0000E00; +pub const USBD_STATUS_INAVLID_CONFIGURATION_DESCRIPTOR: USBD_STATUS = 0xC0000F00; +pub const USBD_STATUS_INVALID_CONFIGURATION_DESCRIPTOR: USBD_STATUS = 0xC0000F00; +pub const USBD_STATUS_INSUFFICIENT_RESOURCES: USBD_STATUS = 0xC0001000; +pub const USBD_STATUS_SET_CONFIG_FAILED: USBD_STATUS = 0xC0002000; +pub const USBD_STATUS_BUFFER_TOO_SMALL: USBD_STATUS = 0xC0003000; +pub const USBD_STATUS_INTERFACE_NOT_FOUND: USBD_STATUS = 0xC0004000; +pub const USBD_STATUS_INAVLID_PIPE_FLAGS: USBD_STATUS = 0xC0005000; +pub const USBD_STATUS_TIMEOUT: USBD_STATUS = 0xC0006000; +pub const USBD_STATUS_DEVICE_GONE: USBD_STATUS = 0xC0007000; +pub const USBD_STATUS_STATUS_NOT_MAPPED: USBD_STATUS = 0xC0008000; +pub const USBD_STATUS_HUB_INTERNAL_ERROR: USBD_STATUS = 0xC0009000; +pub const USBD_STATUS_CANCELED: USBD_STATUS = 0xC0010000; +pub const USBD_STATUS_ISO_NOT_ACCESSED_BY_HW: USBD_STATUS = 0xC0020000; +pub const USBD_STATUS_ISO_TD_ERROR: USBD_STATUS = 0xC0030000; +pub const USBD_STATUS_ISO_NA_LATE_USBPORT: USBD_STATUS = 0xC0040000; +pub const USBD_STATUS_ISO_NOT_ACCESSED_LATE: USBD_STATUS = 0xC0050000; +pub const USBD_STATUS_BAD_DESCRIPTOR: USBD_STATUS = 0xC0100000; +pub const USBD_STATUS_BAD_DESCRIPTOR_BLEN: USBD_STATUS = 0xC0100001; +pub const USBD_STATUS_BAD_DESCRIPTOR_TYPE: USBD_STATUS = 0xC0100002; +pub const USBD_STATUS_BAD_INTERFACE_DESCRIPTOR: USBD_STATUS = 0xC0100003; +pub const USBD_STATUS_BAD_ENDPOINT_DESCRIPTOR: USBD_STATUS = 0xC0100004; +pub const USBD_STATUS_BAD_INTERFACE_ASSOC_DESCRIPTOR: USBD_STATUS = 0xC0100005; +pub const USBD_STATUS_BAD_CONFIG_DESC_LENGTH: USBD_STATUS = 0xC0100006; +pub const USBD_STATUS_BAD_NUMBER_OF_INTERFACES: USBD_STATUS = 0xC0100007; +pub const USBD_STATUS_BAD_NUMBER_OF_ENDPOINTS: USBD_STATUS = 0xC0100008; +pub const USBD_STATUS_BAD_ENDPOINT_ADDRESS: USBD_STATUS = 0xC0100009; +pub type USBD_PIPE_HANDLE = PVOID; +pub type USBD_CONFIGURATION_HANDLE = PVOID; +pub type USBD_INTERFACE_HANDLE = PVOID; +pub const USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE: ULONG = 0xFFFFFFFF; +STRUCT!{struct USBD_VERSION_INFORMATION { + USBDI_Version: ULONG, + Supported_USB_Version: ULONG, +}} +pub type PUSBD_VERSION_INFORMATION = *mut USBD_VERSION_INFORMATION; +ENUM!{enum USBD_PIPE_TYPE { + UsbdPipeTypeControl, + UsbdPipeTypeIsochronous, + UsbdPipeTypeBulk, + UsbdPipeTypeInterrupt, +}} +#[inline] +pub fn USBD_PIPE_DIRECTION_IN(pipeInformation: &USBD_PIPE_INFORMATION) -> UCHAR { + pipeInformation.EndpointAddress & USB_ENDPOINT_DIRECTION_MASK +} +STRUCT!{struct USBD_DEVICE_INFORMATION { + OffsetNext: ULONG, + UsbdDeviceHandle: PVOID, + DeviceDescriptor: USB_DEVICE_DESCRIPTOR, +}} +pub type PUSBD_DEVICE_INFORMATION = *mut USBD_DEVICE_INFORMATION; +STRUCT!{struct USBD_PIPE_INFORMATION { + MaximumPacketSize: USHORT, + EndpointAddress: UCHAR, + Interval: UCHAR, + PipeType: USBD_PIPE_TYPE, + PipeHandle: USBD_PIPE_HANDLE, + MaximumTransferSize: ULONG, + PipeFlags: ULONG, +}} +pub type PUSBD_PIPE_INFORMATION = *mut USBD_PIPE_INFORMATION; +pub const USBD_PF_CHANGE_MAX_PACKET: ULONG = 0x00000001; +pub const USBD_PF_SHORT_PACKET_OPT: ULONG = 0x00000002; +pub const USBD_PF_ENABLE_RT_THREAD_ACCESS: ULONG = 0x00000004; +pub const USBD_PF_MAP_ADD_TRANSFERS: ULONG = 0x00000008; +pub const USBD_PF_VALID_MASK: ULONG = USBD_PF_CHANGE_MAX_PACKET | USBD_PF_SHORT_PACKET_OPT + | USBD_PF_ENABLE_RT_THREAD_ACCESS | USBD_PF_MAP_ADD_TRANSFERS; +STRUCT!{struct USBD_INTERFACE_INFORMATION { + Length: USHORT, + InterfaceNumber: UCHAR, + AlternateSetting: UCHAR, + Class: UCHAR, + SubClass: UCHAR, + Protocol: UCHAR, + Reserved: UCHAR, + InterfaceHandle: USBD_INTERFACE_HANDLE, + NumberOfPipes: ULONG, + Pipes: [USBD_PIPE_INFORMATION; 1], +}} +pub type PUSBD_INTERFACE_INFORMATION = *mut USBD_INTERFACE_INFORMATION; +STRUCT!{struct URB_HCD_AREA { + Reserved8: [PVOID; 8], +}} +STRUCT!{struct URB_HEADER { + Length: USHORT, + Function: USHORT, + Status: USBD_STATUS, + UsbdDeviceHandle: PVOID, + UsbdFlags: ULONG, +}} +STRUCT!{struct URB_SELECT_INTERFACE { + Hdr: URB_HEADER, + ConfigurationHandle: USBD_CONFIGURATION_HANDLE, + Interface: USBD_INTERFACE_INFORMATION, +}} +STRUCT!{struct URB_SELECT_CONFIGURATION { + Hdr: URB_HEADER, + ConfigurationDescriptor: PUSB_CONFIGURATION_DESCRIPTOR, + ConfigurationHandle: USBD_CONFIGURATION_HANDLE, + Interface: USBD_INTERFACE_INFORMATION, +}} +STRUCT!{struct URB_PIPE_REQUEST { + Hdr: URB_HEADER, + PipeHandle: USBD_PIPE_HANDLE, + Reserved: ULONG, +}} +STRUCT!{struct URB_FRAME_LENGTH_CONTROL { + Hdr: URB_HEADER, +}} +STRUCT!{struct URB_GET_FRAME_LENGTH { + Hdr: URB_HEADER, + FrameLength: ULONG, + FrameNumber: ULONG, +}} +STRUCT!{struct URB_SET_FRAME_LENGTH { + Hdr: URB_HEADER, + FrameLengthDelta: LONG, +}} +STRUCT!{struct URB_GET_CURRENT_FRAME_NUMBER { + Hdr: URB_HEADER, + FrameNumber: ULONG, +}} +STRUCT!{struct URB_CONTROL_DESCRIPTOR_REQUEST { + Hdr: URB_HEADER, + Reserved: PVOID, + Reserved0: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + UrbLink: *mut URB, + hca: URB_HCD_AREA, + Reserved1: USHORT, + Index: UCHAR, + DescriptorType: UCHAR, + LanguageId: USHORT, + Reserved2: USHORT, +}} +STRUCT!{struct URB_CONTROL_GET_STATUS_REQUEST { + Hdr: URB_HEADER, + Reserved: PVOID, + Reserved0: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + UrbLink: *mut URB, + hca: URB_HCD_AREA, + Reserved1: [UCHAR; 4], + Index: USHORT, + Reserved2: USHORT, +}} +STRUCT!{struct URB_CONTROL_FEATURE_REQUEST { + Hdr: URB_HEADER, + Reserved: PVOID, + Reserved2: ULONG, + Reserved3: ULONG, + Reserved4: PVOID, + Reserved5: PMDL, + UrbLink: *mut URB, + hca: URB_HCD_AREA, + Reserved0: USHORT, + FeatureSelector: USHORT, + Index: USHORT, + Reserved1: USHORT, +}} +STRUCT!{struct URB_CONTROL_VENDOR_OR_CLASS_REQUEST { + Hdr: URB_HEADER, + Reserved: PVOID, + TransferFlags: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + UrbLink: *mut URB, + hca: URB_HCD_AREA, + RequestTypeReservedBits: UCHAR, + Request: UCHAR, + Value: USHORT, + Index: USHORT, + Reserved1: USHORT, +}} +STRUCT!{struct URB_CONTROL_GET_INTERFACE_REQUEST { + Hdr: URB_HEADER, + Reserved: PVOID, + Reserved0: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + UrbLink: *mut URB, + hca: URB_HCD_AREA, + Reserved1: [UCHAR; 4], + Interface: USHORT, + Reserved2: USHORT, +}} +STRUCT!{struct URB_CONTROL_GET_CONFIGURATION_REQUEST { + Hdr: URB_HEADER, + Reserved: PVOID, + Reserved0: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + UrbLink: *mut URB, + hca: URB_HCD_AREA, + Reserved1: [UCHAR; 8], +}} +pub const OS_STRING_DESCRIPTOR_INDEX: UCHAR = 0xEE; +pub const MS_GENRE_DESCRIPTOR_INDEX: USHORT = 0x0001; +pub const MS_POWER_DESCRIPTOR_INDEX: USHORT = 0x0002; +pub const MS_OS_STRING_SIGNATURE: &'static str = "MSFT100"; +pub const MS_OS_FLAGS_CONTAINERID: UCHAR = 0x02; +UNION!{union OS_STRING_u { + [u8; 1], + bPad bPad_mut: UCHAR, + bFlags bFlags_mut: UCHAR, +}} +STRUCT!{struct OS_STRING { + bLength: UCHAR, + bDescriptorType: UCHAR, + MicrosoftString: [WCHAR; 7], + bVendorCode: UCHAR, + u: OS_STRING_u, +}} +pub type POS_STRING = *mut OS_STRING; +STRUCT!{struct URB_OS_FEATURE_DESCRIPTOR_REQUEST { + Hdr: URB_HEADER, + Reserved: PVOID, + Reserved0: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + UrbLink: *mut URB, + hca: URB_HCD_AREA, + BitField: UCHAR, + Reserved2: UCHAR, + InterfaceNumber: UCHAR, + MS_PageIndex: UCHAR, + MS_FeatureDescriptorIndex: USHORT, + Reserved3: USHORT, +}} +BITFIELD!{URB_OS_FEATURE_DESCRIPTOR_REQUEST BitField: UCHAR [ + Recipient set_Recipient[0..5], + Reserved1 set_Reserved1[5..8], +]} +STRUCT!{struct URB_CONTROL_TRANSFER { + Hdr: URB_HEADER, + PipeHandle: USBD_PIPE_HANDLE, + TransferFlags: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + UrbLink: *mut URB, + hca: URB_HCD_AREA, + SetupPacket: [UCHAR; 8], +}} +#[cfg(target_pointer_width = "64")] +STRUCT!{struct URB_CONTROL_TRANSFER_EX { + Hdr: URB_HEADER, + PipeHandle: USBD_PIPE_HANDLE, + TransferFlags: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + Timeout: ULONG, + Pad: ULONG, + hca: URB_HCD_AREA, + SetupPacket: [UCHAR; 8], +}} +#[cfg(target_pointer_width = "32")] +STRUCT!{struct URB_CONTROL_TRANSFER_EX { + Hdr: URB_HEADER, + PipeHandle: USBD_PIPE_HANDLE, + TransferFlags: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + Timeout: ULONG, + hca: URB_HCD_AREA, + SetupPacket: [UCHAR; 8], +}} +STRUCT!{struct URB_BULK_OR_INTERRUPT_TRANSFER { + Hdr: URB_HEADER, + PipeHandle: USBD_PIPE_HANDLE, + TransferFlags: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + UrbLink: *mut URB, + hca: URB_HCD_AREA, +}} +STRUCT!{struct USBD_ISO_PACKET_DESCRIPTOR { + Offset: ULONG, + Length: ULONG, + Status: USBD_STATUS, +}} +pub type PUSBD_ISO_PACKET_DESCRIPTOR = *mut USBD_ISO_PACKET_DESCRIPTOR; +STRUCT!{struct URB_ISOCH_TRANSFER { + Hdr: URB_HEADER, + PipeHandle: USBD_PIPE_HANDLE, + TransferFlags: ULONG, + TransferBufferLength: ULONG, + TransferBuffer: PVOID, + TransferBufferMDL: PMDL, + UrbLink: *mut URB, + hca: URB_HCD_AREA, + StartFrame: ULONG, + NumberOfPackets: ULONG, + ErrorCount: ULONG, + IsoPacket: [USBD_ISO_PACKET_DESCRIPTOR; 1], +}} +pub const URB_OPEN_STATIC_STREAMS_VERSION_100: USHORT = 0x100; +STRUCT!{struct USBD_STREAM_INFORMATION { + PipeHandle: USBD_PIPE_HANDLE, + StreamID: ULONG, + MaximumTransferSize: ULONG, + PipeFlags: ULONG, +}} +pub type PUSBD_STREAM_INFORMATION = *mut USBD_STREAM_INFORMATION; +STRUCT!{struct URB_OPEN_STATIC_STREAMS { + Hdr: URB_HEADER, + PipeHandle: USBD_PIPE_HANDLE, + NumberOfStreams: ULONG, + StreamInfoVersion: USHORT, + StreamInfoSize: USHORT, + Streams: PUSBD_STREAM_INFORMATION, +}} +UNION!{union URB_u { + [u32; 24] [u64; 19], + UrbHeader UrbHeader_mut: URB_HEADER, + UrbSelectInterface UrbSelectInterface_mut: URB_SELECT_INTERFACE, + UrbSelectConfiguration UrbSelectConfiguration_mut: URB_SELECT_CONFIGURATION, + UrbPipeRequest UrbPipeRequest_mut: URB_PIPE_REQUEST, + UrbFrameLengthControl UrbFrameLengthControl_mut: URB_FRAME_LENGTH_CONTROL, + UrbGetFrameLength UrbGetFrameLength_mut: URB_GET_FRAME_LENGTH, + UrbSetFrameLength UrbSetFrameLength_mut: URB_SET_FRAME_LENGTH, + UrbGetCurrentFrameNumber UrbGetCurrentFrameNumber_mut: URB_GET_CURRENT_FRAME_NUMBER, + UrbControlTransfer UrbControlTransfer_mut: URB_CONTROL_TRANSFER, + UrbControlTransferEx UrbControlTransferEx_mut: URB_CONTROL_TRANSFER_EX, + UrbBulkOrInterruptTransfer UrbBulkOrInterruptTransfer_mut: URB_BULK_OR_INTERRUPT_TRANSFER, + UrbIsochronousTransfer UrbIsochronousTransfer_mut: URB_ISOCH_TRANSFER, + UrbControlDescriptorRequest UrbControlDescriptorRequest_mut: URB_CONTROL_DESCRIPTOR_REQUEST, + UrbControlGetStatusRequest UrbControlGetStatusRequest_mut: URB_CONTROL_GET_STATUS_REQUEST, + UrbControlFeatureRequest UrbControlFeatureRequest_mut: URB_CONTROL_FEATURE_REQUEST, + UrbControlVendorClassRequest UrbControlVendorClassRequest_mut: + URB_CONTROL_VENDOR_OR_CLASS_REQUEST, + UrbControlGetInterfaceRequest UrbControlGetInterfaceRequest_mut: + URB_CONTROL_GET_INTERFACE_REQUEST, + UrbControlGetConfigurationRequest UrbControlGetConfigurationRequest_mut: + URB_CONTROL_GET_CONFIGURATION_REQUEST, + UrbOSFeatureDescriptorRequest UrbOSFeatureDescriptorRequest_mut: + URB_OS_FEATURE_DESCRIPTOR_REQUEST, + UrbOpenStaticStreams UrbOpenStaticStreams_mut: URB_OPEN_STATIC_STREAMS, +}} +STRUCT!{struct URB { + u: URB_u, +}} +pub type PURB = *mut URB; diff --git a/bash-5.1/vendor/winapi/src/shared/usbioctl.rs b/bash-5.1/vendor/winapi/src/shared/usbioctl.rs new file mode 100644 index 0000000000000000000000000000000000000000..a7906fe5af1e923f5f7568c487d703ef2552f180 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/usbioctl.rs @@ -0,0 +1,705 @@ +use shared::basetsd::ULONG64; +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, UCHAR, ULONG, USHORT}; +use shared::ntdef::{BOOLEAN, HANDLE, LARGE_INTEGER, LONG, NTSTATUS, PWCHAR, WCHAR}; +use shared::usb::USBD_STATUS; +use shared::usbiodef::{ + FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_OFF, HCD_DIAGNOSTIC_MODE_ON, HCD_DISABLE_PORT, + HCD_ENABLE_PORT, HCD_GET_DRIVERKEY_NAME, HCD_GET_ROOT_HUB_NAME, HCD_GET_STATS_1, + HCD_GET_STATS_2, USB_CYCLE_PORT, USB_DIAG_IGNORE_HUBS_OFF, USB_DIAG_IGNORE_HUBS_ON, + USB_ENABLE_PORT, USB_FAIL_GET_STATUS, USB_GET_BUSGUID_INFO, USB_GET_BUS_INFO, + USB_GET_CONTROLLER_NAME, USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, + USB_GET_DEVICE_CHARACTERISTICS, USB_GET_DEVICE_HANDLE, USB_GET_DEVICE_HANDLE_EX, + USB_GET_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC, USB_GET_HUB_CAPABILITIES, + USB_GET_HUB_CAPABILITIES_EX, USB_GET_HUB_CONFIG_INFO, USB_GET_HUB_COUNT, + USB_GET_HUB_INFORMATION_EX, USB_GET_HUB_NAME, USB_GET_NODE_CONNECTION_ATTRIBUTES, + USB_GET_NODE_CONNECTION_DRIVERKEY_NAME, USB_GET_NODE_CONNECTION_INFORMATION, + USB_GET_NODE_CONNECTION_INFORMATION_EX, USB_GET_NODE_CONNECTION_INFORMATION_EX_V2, + USB_GET_NODE_CONNECTION_NAME, USB_GET_NODE_INFORMATION, USB_GET_PARENT_HUB_INFO, + USB_GET_PORT_CONNECTOR_PROPERTIES, USB_GET_PORT_STATUS, USB_GET_ROOTHUB_PDO, + USB_GET_TOPOLOGY_ADDRESS, USB_GET_TRANSPORT_CHARACTERISTICS, USB_GET_TT_DEVICE_HANDLE, + USB_HUB_CYCLE_PORT, USB_IDLE_NOTIFICATION, USB_IDLE_NOTIFICATION_EX, + USB_NOTIFY_ON_TRANSPORT_CHARACTERISTICS_CHANGE, USB_RECORD_FAILURE, + USB_REGISTER_COMPOSITE_DEVICE, USB_REGISTER_FOR_TRANSPORT_CHARACTERISTICS_CHANGE, + USB_REQUEST_REMOTE_WAKE_NOTIFICATION, USB_REQ_GLOBAL_RESUME, USB_REQ_GLOBAL_SUSPEND, + USB_RESET_HUB, USB_RESET_PORT, USB_START_TRACKING_FOR_TIME_SYNC, + USB_STOP_TRACKING_FOR_TIME_SYNC, USB_SUBMIT_URB, USB_UNREGISTER_COMPOSITE_DEVICE, + USB_UNREGISTER_FOR_TRANSPORT_CHARACTERISTICS_CHANGE, +}; +use shared::usbspec::{ + USB_30_HUB_DESCRIPTOR, USB_CONFIGURATION_DESCRIPTOR, USB_DEVICE_DESCRIPTOR, USB_DEVICE_SPEED, + USB_ENDPOINT_DESCRIPTOR, USB_HUB_DESCRIPTOR, +}; +use um::winioctl::{FILE_ANY_ACCESS, FILE_DEVICE_USBEX, METHOD_BUFFERED, METHOD_NEITHER}; +pub const IOCTL_INTERNAL_USB_SUBMIT_URB: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_SUBMIT_URB, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_RESET_PORT: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_RESET_PORT, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_ROOTHUB_PDO, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const USBD_PORT_ENABLED: DWORD = 0x00000001; +pub const USBD_PORT_CONNECTED: DWORD = 0x00000002; +pub const IOCTL_INTERNAL_USB_GET_PORT_STATUS: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_PORT_STATUS, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_ENABLE_PORT: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_ENABLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_HUB_COUNT: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_HUB_COUNT, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_CYCLE_PORT: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_CYCLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_HUB_NAME: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_BUS_INFO: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_BUS_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_CONTROLLER_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_BUSGUID_INFO: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_BUSGUID_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_PARENT_HUB_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_IDLE_NOTIFICATION, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_NOTIFY_IDLE_READY: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_IDLE_NOTIFICATION_EX, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_REQ_GLOBAL_SUSPEND: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_REQ_GLOBAL_SUSPEND, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_REQ_GLOBAL_RESUME: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_REQ_GLOBAL_RESUME, METHOD_NEITHER, FILE_ANY_ACCESS); +STRUCT!{struct USB_START_FAILDATA { + LengthInBytes: ULONG, + NtStatus: NTSTATUS, + UsbdStatus: USBD_STATUS, + ConnectStatus: ULONG, + DriverData: [UCHAR; 4], +}} +pub type PUSB_START_FAILDATA = *mut USB_START_FAILDATA; +pub const IOCTL_INTERNAL_USB_RECORD_FAILURE: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_RECORD_FAILURE, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE_EX: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE_EX, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_TT_DEVICE_HANDLE: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_TT_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS); +STRUCT!{struct USB_TOPOLOGY_ADDRESS { + PciBusNumber: ULONG, + PciDeviceNumber: ULONG, + PciFunctionNumber: ULONG, + Reserved: ULONG, + RootHubPortNumber: USHORT, + HubPortNumber: [USHORT; 5], + Reserved2: USHORT, +}} +pub type PUSB_TOPOLOGY_ADDRESS = *mut USB_TOPOLOGY_ADDRESS; +pub const IOCTL_INTERNAL_USB_GET_TOPOLOGY_ADDRESS: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_TOPOLOGY_ADDRESS, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_GET_DEVICE_CONFIG_INFO: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_HUB_CONFIG_INFO, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_REGISTER_COMPOSITE_DEVICE: DWORD + = CTL_CODE!(FILE_DEVICE_USBEX, USB_REGISTER_COMPOSITE_DEVICE, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_UNREGISTER_COMPOSITE_DEVICE: DWORD + = CTL_CODE!(FILE_DEVICE_USBEX, USB_UNREGISTER_COMPOSITE_DEVICE, METHOD_NEITHER, + FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_REQUEST_REMOTE_WAKE_NOTIFICATION: DWORD + = CTL_CODE!(FILE_DEVICE_USBEX, USB_REQUEST_REMOTE_WAKE_NOTIFICATION, METHOD_NEITHER, + FILE_ANY_ACCESS); +pub const IOCTL_INTERNAL_USB_FAIL_GET_STATUS_FROM_DEVICE: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_FAIL_GET_STATUS, METHOD_NEITHER, FILE_ANY_ACCESS); +pub const IOCTL_USB_HCD_GET_STATS_1: DWORD + = CTL_CODE!(FILE_DEVICE_USB, HCD_GET_STATS_1, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_HCD_GET_STATS_2: DWORD + = CTL_CODE!(FILE_DEVICE_USB, HCD_GET_STATS_2, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_HCD_DISABLE_PORT: DWORD + = CTL_CODE!(FILE_DEVICE_USB, HCD_DISABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_HCD_ENABLE_PORT: DWORD + = CTL_CODE!(FILE_DEVICE_USB, HCD_ENABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_DIAGNOSTIC_MODE_ON: DWORD + = CTL_CODE!(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_ON, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_DIAGNOSTIC_MODE_OFF: DWORD + = CTL_CODE!(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_ROOT_HUB_NAME: DWORD + = CTL_CODE!(FILE_DEVICE_USB, HCD_GET_ROOT_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_GET_HCD_DRIVERKEY_NAME: DWORD + = CTL_CODE!(FILE_DEVICE_USB, HCD_GET_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_NODE_INFORMATION: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_NODE_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_NODE_CONNECTION_INFORMATION: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_NODE_CONNECTION_NAME: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_DIAG_IGNORE_HUBS_ON: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_DIAG_IGNORE_HUBS_ON, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_DIAG_IGNORE_HUBS_OFF: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_DIAG_IGNORE_HUBS_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_DRIVERKEY_NAME, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_HUB_CAPABILITIES: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_HUB_CYCLE_PORT: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_HUB_CYCLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_NODE_CONNECTION_ATTRIBUTES: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_ATTRIBUTES, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_RESET_HUB: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_RESET_HUB, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_HUB_CAPABILITIES_EX: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES_EX, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_HUB_INFORMATION_EX: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_HUB_INFORMATION_EX, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_PORT_CONNECTOR_PROPERTIES: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_PORT_CONNECTOR_PROPERTIES, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX_V2: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX_V2, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_TRANSPORT_CHARACTERISTICS: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_TRANSPORT_CHARACTERISTICS, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_REGISTER_FOR_TRANSPORT_CHARACTERISTICS_CHANGE: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_REGISTER_FOR_TRANSPORT_CHARACTERISTICS_CHANGE, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_NOTIFY_ON_TRANSPORT_CHARACTERISTICS_CHANGE: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_NOTIFY_ON_TRANSPORT_CHARACTERISTICS_CHANGE, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_UNREGISTER_FOR_TRANSPORT_CHARACTERISTICS_CHANGE: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_UNREGISTER_FOR_TRANSPORT_CHARACTERISTICS_CHANGE, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_USB_START_TRACKING_FOR_TIME_SYNC: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_START_TRACKING_FOR_TIME_SYNC, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_STOP_TRACKING_FOR_TIME_SYNC: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_STOP_TRACKING_FOR_TIME_SYNC, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_USB_GET_DEVICE_CHARACTERISTICS: DWORD + = CTL_CODE!(FILE_DEVICE_USB, USB_GET_DEVICE_CHARACTERISTICS, METHOD_BUFFERED, FILE_ANY_ACCESS); +ENUM!{enum USB_HUB_NODE { + UsbHub, + UsbMIParent, +}} +STRUCT!{#[repr(packed)] struct USB_HUB_INFORMATION { + HubDescriptor: USB_HUB_DESCRIPTOR, + HubIsBusPowered: BOOLEAN, +}} +pub type PUSB_HUB_INFORMATION = *mut USB_HUB_INFORMATION; +STRUCT!{#[repr(packed)] struct USB_MI_PARENT_INFORMATION { + NumberOfInterfaces: ULONG, +}} +pub type PUSB_MI_PARENT_INFORMATION = *mut USB_MI_PARENT_INFORMATION; +STRUCT!{#[repr(packed)] struct USB_NODE_INFORMATION { + NodeType: USB_HUB_NODE, + u: USB_NODE_INFORMATION_u, +}} +UNION!{union USB_NODE_INFORMATION_u { + [u8; 72], + HubInformation HubInformation_mut: USB_HUB_INFORMATION, + MiParentInformation MiParentInformation_mut: USB_MI_PARENT_INFORMATION, +}} +pub type PUSB_NODE_INFORMATION = *mut USB_NODE_INFORMATION; +STRUCT!{#[repr(packed)] struct USB_PIPE_INFO { + EndpointDescriptor: USB_ENDPOINT_DESCRIPTOR, + ScheduleOffset: ULONG, +}} +pub type PUSB_PIPE_INFO = *mut USB_PIPE_INFO; +ENUM!{enum USB_CONNECTION_STATUS { + NoDeviceConnected, + DeviceConnected, + DeviceFailedEnumeration, + DeviceGeneralFailure, + DeviceCausedOvercurrent, + DeviceNotEnoughPower, + DeviceNotEnoughBandwidth, + DeviceHubNestedTooDeeply, + DeviceInLegacyHub, + DeviceEnumerating, + DeviceReset, +}} +pub type PUSB_CONNECTION_STATUS = *mut USB_CONNECTION_STATUS; +STRUCT!{#[repr(packed)] struct USB_NODE_CONNECTION_INFORMATION { + ConnectionIndex: ULONG, + DeviceDescriptor: USB_DEVICE_DESCRIPTOR, + CurrentConfigurationValue: UCHAR, + LowSpeed: BOOLEAN, + DeviceIsHub: BOOLEAN, + DeviceAddress: USHORT, + NumberOfOpenPipes: ULONG, + ConnectionStatus: USB_CONNECTION_STATUS, + PipeList: [USB_PIPE_INFO; 0], +}} +pub type PUSB_NODE_CONNECTION_INFORMATION = *mut USB_NODE_CONNECTION_INFORMATION; +STRUCT!{#[repr(packed)] struct USB_NODE_CONNECTION_DRIVERKEY_NAME { + ConnectionIndex: ULONG, + ActualLength: ULONG, + DriverKeyName: [WCHAR; 1], +}} +pub type PUSB_NODE_CONNECTION_DRIVERKEY_NAME = *mut USB_NODE_CONNECTION_DRIVERKEY_NAME; +STRUCT!{#[repr(packed)] struct USB_NODE_CONNECTION_NAME { + ConnectionIndex: ULONG, + ActualLength: ULONG, + NodeName: [WCHAR; 1], +}} +pub type PUSB_NODE_CONNECTION_NAME = *mut USB_NODE_CONNECTION_NAME; +STRUCT!{#[repr(packed)] struct USB_HUB_NAME { + ActualLength: ULONG, + HubName: [WCHAR; 1], +}} +pub type PUSB_HUB_NAME = *mut USB_HUB_NAME; +STRUCT!{#[repr(packed)] struct USB_ROOT_HUB_NAME { + ActualLength: ULONG, + RootHubName: [WCHAR; 1], +}} +pub type PUSB_ROOT_HUB_NAME = *mut USB_ROOT_HUB_NAME; +STRUCT!{#[repr(packed)] struct USB_HCD_DRIVERKEY_NAME { + ActualLength: ULONG, + DriverKeyName: [WCHAR; 1], +}} +pub type PUSB_HCD_DRIVERKEY_NAME = *mut USB_HCD_DRIVERKEY_NAME; +STRUCT!{#[repr(packed)] struct USB_DESCRIPTOR_REQUEST { + ConnectionIndex: ULONG, + SetupPacket: USB_DESCRIPTOR_REQUEST_SetupPacket, + Data: [UCHAR; 0], +}} +STRUCT!{#[repr(packed)] struct USB_DESCRIPTOR_REQUEST_SetupPacket { + bmRequest: UCHAR, + bRequest: UCHAR, + wValue: USHORT, + wIndex: USHORT, + wLength: USHORT, +}} +pub type PUSB_DESCRIPTOR_REQUEST = *mut USB_DESCRIPTOR_REQUEST; +STRUCT!{#[repr(packed)] struct USB_HUB_CAPABILITIES { + bitfield: ULONG, +}} +BITFIELD!{USB_HUB_CAPABILITIES bitfield: ULONG [ + HubIs2xCapable set_HubIs2xCapable[0..1], +]} +pub type PUSB_HUB_CAPABILITIES = *mut USB_HUB_CAPABILITIES; +STRUCT!{#[repr(packed)] struct USB_NODE_CONNECTION_ATTRIBUTES { + ConnectionIndex: ULONG, + ConnectionStatus: USB_CONNECTION_STATUS, + PortAttributes: ULONG, +}} +pub type PUSB_NODE_CONNECTION_ATTRIBUTES = *mut USB_NODE_CONNECTION_ATTRIBUTES; +STRUCT!{#[repr(packed)] struct USB_NODE_CONNECTION_INFORMATION_EX { + ConnectionIndex: ULONG, + DeviceDescriptor: USB_DEVICE_DESCRIPTOR, + CurrentConfigurationValue: UCHAR, + Speed: UCHAR, + DeviceIsHub: BOOLEAN, + DeviceAddress: USHORT, + NumberOfOpenPipes: ULONG, + ConnectionStatus: USB_CONNECTION_STATUS, + PipeList: [USB_PIPE_INFO; 0], +}} +pub type PUSB_NODE_CONNECTION_INFORMATION_EX = *mut USB_NODE_CONNECTION_INFORMATION_EX; +STRUCT!{#[repr(packed)] struct USB_HUB_CAP_FLAGS { + ul: ULONG, +}} +BITFIELD!{USB_HUB_CAP_FLAGS ul: ULONG [ + HubIsHighSpeedCapable set_HubIsHighSpeedCapable[0..1], + HubIsHighSpeed set_HubIsHighSpeed[1..2], + HubIsMultiTtCapable set_HubIsMultiTtCapable[2..3], + HubIsMultiTt set_HubIsMultiTt[3..4], + HubIsRoot set_HubIsRoot[4..5], + HubIsArmedWakeOnConnect set_HubIsArmedWakeOnConnect[5..6], + HubIsBusPowered set_HubIsBusPowered[6..7], + ReservedMBZ set_ReservedMBZ[7..32], +]} +pub type PUSB_HUB_CAP_FLAGS = *mut USB_HUB_CAP_FLAGS; +STRUCT!{#[repr(packed)] struct USB_HUB_CAPABILITIES_EX { + CapabilityFlags: USB_HUB_CAP_FLAGS, +}} +pub type PUSB_HUB_CAPABILITIES_EX = *mut USB_HUB_CAPABILITIES_EX; +STRUCT!{#[repr(packed)] struct USB_CYCLE_PORT_PARAMS { + ConnectionIndex: ULONG, + StatusReturned: ULONG, +}} +pub type PUSB_CYCLE_PORT_PARAMS = *mut USB_CYCLE_PORT_PARAMS; +STRUCT!{#[repr(packed)] struct USB_ID_STRING { + LanguageId: USHORT, + Pad: USHORT, + LengthInBytes: ULONG, + Buffer: PWCHAR, +}} +pub type PUSB_ID_STRING = *mut USB_ID_STRING; +STRUCT!{#[repr(packed)] struct USB_HUB_DEVICE_UXD_SETTINGS { + Version: ULONG, + PnpGuid: GUID, + OwnerGuid: GUID, + DeleteOnShutdown: ULONG, + DeleteOnReload: ULONG, + DeleteOnDisconnect: ULONG, + Reserved: [ULONG; 5], +}} +pub type PUSB_HUB_DEVICE_UXD_SETTINGS = *mut USB_HUB_DEVICE_UXD_SETTINGS; +STRUCT!{#[repr(packed)] struct HUB_DEVICE_CONFIG_INFO { + Version: ULONG, + Length: ULONG, + HubFlags: USB_HUB_CAP_FLAGS, + HardwareIds: USB_ID_STRING, + CompatibleIds: USB_ID_STRING, + DeviceDescription: USB_ID_STRING, + Reserved: [ULONG; 19], + UxdSettings: USB_HUB_DEVICE_UXD_SETTINGS, +}} +pub type PHUB_DEVICE_CONFIG_INFO = *mut HUB_DEVICE_CONFIG_INFO; +STRUCT!{#[repr(packed)] struct HCD_STAT_COUNTERS { + BytesTransferred: ULONG, + IsoMissedCount: USHORT, + DataOverrunErrorCount: USHORT, + CrcErrorCount: USHORT, + ScheduleOverrunCount: USHORT, + TimeoutErrorCount: USHORT, + InternalHcErrorCount: USHORT, + BufferOverrunErrorCount: USHORT, + SWErrorCount: USHORT, + StallPidCount: USHORT, + PortDisableCount: USHORT, +}} +pub type PHCD_STAT_COUNTERS = *mut HCD_STAT_COUNTERS; +STRUCT!{#[repr(packed)] struct HCD_ISO_STAT_COUNTERS { + LateUrbs: USHORT, + DoubleBufferedPackets: USHORT, + TransfersCF_5ms: USHORT, + TransfersCF_2ms: USHORT, + TransfersCF_1ms: USHORT, + MaxInterruptLatency: USHORT, + BadStartFrame: USHORT, + StaleUrbs: USHORT, + IsoPacketNotAccesed: USHORT, + IsoPacketHWError: USHORT, + SmallestUrbPacketCount: USHORT, + LargestUrbPacketCount: USHORT, + IsoCRC_Error: USHORT, + IsoOVERRUN_Error: USHORT, + IsoINTERNAL_Error: USHORT, + IsoUNKNOWN_Error: USHORT, + IsoBytesTransferred: ULONG, + LateMissedCount: USHORT, + HWIsoMissedCount: USHORT, + Reserved7: [ULONG; 8], +}} +pub type PHCD_ISO_STAT_COUNTERS = *mut HCD_ISO_STAT_COUNTERS; +STRUCT!{#[repr(packed)] struct HCD_STAT_INFORMATION_1 { + Reserved1: ULONG, + Reserved2: ULONG, + ResetCounters: ULONG, + TimeRead: LARGE_INTEGER, + Counters: HCD_STAT_COUNTERS, +}} +pub type PHCD_STAT_INFORMATION_1 = *mut HCD_STAT_INFORMATION_1; +STRUCT!{#[repr(packed)] struct HCD_STAT_INFORMATION_2 { + Reserved1: ULONG, + Reserved2: ULONG, + ResetCounters: ULONG, + TimeRead: LARGE_INTEGER, + LockedMemoryUsed: LONG, + Counters: HCD_STAT_COUNTERS, + IsoCounters: HCD_ISO_STAT_COUNTERS, +}} +pub type PHCD_STAT_INFORMATION_2 = *mut HCD_STAT_INFORMATION_2; +pub const WMI_USB_DRIVER_INFORMATION: ULONG = 0; +pub const WMI_USB_DRIVER_NOTIFICATION: ULONG = 1; +pub const WMI_USB_POWER_DEVICE_ENABLE: ULONG = 2; +pub const WMI_USB_HUB_NODE_INFORMATION: ULONG = 4; +pub const WMI_USB_PERFORMANCE_INFORMATION: ULONG = 1; +pub const WMI_USB_DEVICE_NODE_INFORMATION: ULONG = 2; +ENUM!{enum USB_NOTIFICATION_TYPE { + EnumerationFailure = 0, + InsufficentBandwidth, + InsufficentPower, + OverCurrent, + ResetOvercurrent, + AcquireBusInfo, + AcquireHubName, + AcquireControllerName, + HubOvercurrent, + HubPowerChange, + HubNestedTooDeeply, + ModernDeviceInLegacyHub, +}} +STRUCT!{#[repr(packed)] struct USB_NOTIFICATION { + NotificationType: USB_NOTIFICATION_TYPE, +}} +pub type PUSB_NOTIFICATION = *mut USB_NOTIFICATION; +STRUCT!{#[repr(packed)] struct USB_CONNECTION_NOTIFICATION { + NotificationType: USB_NOTIFICATION_TYPE, + ConnectionNumber: ULONG, + RequestedBandwidth: ULONG, + EnumerationFailReason: ULONG, + PowerRequested: ULONG, + HubNameLength: ULONG, +}} +pub type PUSB_CONNECTION_NOTIFICATION = *mut USB_CONNECTION_NOTIFICATION; +STRUCT!{#[repr(packed)] struct USB_BUS_NOTIFICATION { + NotificationType: USB_NOTIFICATION_TYPE, + TotalBandwidth: ULONG, + ConsumedBandwidth: ULONG, + ControllerNameLength: ULONG, +}} +pub type PUSB_BUS_NOTIFICATION = *mut USB_BUS_NOTIFICATION; +STRUCT!{#[repr(packed)] struct USB_ACQUIRE_INFO { + NotificationType: USB_NOTIFICATION_TYPE, + TotalSize: ULONG, + Buffer: [WCHAR; 1], +}} +pub type PUSB_ACQUIRE_INFO = *mut USB_ACQUIRE_INFO; +ENUM!{enum USB_WMI_DEVICE_NODE_TYPE { + UsbDevice, + HubDevice, + CompositeDevice, + UsbController, +}} +pub type PUSB_WMI_DEVICE_NODE_TYPE = *mut USB_WMI_DEVICE_NODE_TYPE; +STRUCT!{#[repr(packed)] struct USB_DEVICE_STATE { + bitfield: ULONG, +}} +BITFIELD!{USB_DEVICE_STATE bitfield: ULONG [ + DeviceConnected set_DeviceConnected[0..1], + DeviceStarted set_DeviceStarted[1..2], +]} +pub type PUSB_DEVICE_STATE = *mut USB_DEVICE_STATE; +STRUCT!{#[repr(packed)] struct USB_HUB_PORT_INFORMATION { + DeviceState: USB_DEVICE_STATE, + PortNumber: USHORT, + DeviceAddress: USHORT, + ConnectionIndex: ULONG, + ConnectionStatus: USB_CONNECTION_STATUS, +}} +pub type PUSB_HUB_PORT_INFORMATION = *mut USB_HUB_PORT_INFORMATION; +STRUCT!{#[repr(packed)] struct USB_HUB_DEVICE_INFO { + HubDescriptor: USB_HUB_DESCRIPTOR, + HubNumber: ULONG, + DeviceAddress: USHORT, + HubIsSelfPowered: BOOLEAN, + HubIsRootHub: BOOLEAN, + HubCapabilities: USB_HUB_CAPABILITIES, + NumberOfHubPorts: ULONG, + PortInfo: [USB_HUB_PORT_INFORMATION; 1], +}} +pub type PUSB_HUB_DEVICE_INFO = *mut USB_HUB_DEVICE_INFO; +STRUCT!{#[repr(packed)] struct USB_COMPOSITE_FUNCTION_INFO { + FunctionNumber: UCHAR, + BaseInterfaceNumber: UCHAR, + NumberOfInterfaces: UCHAR, + FunctionIsIdle: BOOLEAN, +}} +pub type PUSB_COMPOSITE_FUNCTION_INFO = *mut USB_COMPOSITE_FUNCTION_INFO; +STRUCT!{#[repr(packed)] struct USB_COMPOSITE_DEVICE_INFO { + DeviceDescriptor: USB_DEVICE_DESCRIPTOR, + CurrentConfigDescriptor: USB_CONFIGURATION_DESCRIPTOR, + CurrentConfigurationValue: UCHAR, + NumberOfFunctions: UCHAR, + FunctionInfo: [USB_COMPOSITE_FUNCTION_INFO; 1], +}} +pub type PUSB_COMPOSITE_DEVICE_INFO = *mut USB_COMPOSITE_DEVICE_INFO; +STRUCT!{#[repr(packed)] struct USB_CONTROLLER_DEVICE_INFO { + PciVendorId: ULONG, + PciDeviceId: ULONG, + PciRevision: ULONG, + NumberOfRootPorts: ULONG, + HcFeatureFlags: ULONG, +}} +pub type PUSB_CONTROLLER_DEVICE_INFO = *mut USB_CONTROLLER_DEVICE_INFO; +STRUCT!{#[repr(packed)] struct USB_DEVICE_INFO { + DeviceState: USB_DEVICE_STATE, + PortNumber: USHORT, + DeviceDescriptor: USB_DEVICE_DESCRIPTOR, + CurrentConfigurationValue: UCHAR, + Speed: USB_DEVICE_SPEED, + DeviceAddress: USHORT, + ConnectionIndex: ULONG, + ConnectionStatus: USB_CONNECTION_STATUS, + PnpHardwareId: [WCHAR; 128], + PnpCompatibleId: [WCHAR; 128], + SerialNumberId: [WCHAR; 128], + PnpDeviceDescription: [WCHAR; 128], + NumberOfOpenPipes: ULONG, + PipeList: [USB_PIPE_INFO; 1], +}} +pub type PUSB_DEVICE_INFO = *mut USB_DEVICE_INFO; +STRUCT!{#[repr(packed)] struct USB_DEVICE_NODE_INFO { + Sig: ULONG, + LengthInBytes: ULONG, + DeviceDescription: [WCHAR; 40], + NodeType: USB_WMI_DEVICE_NODE_TYPE, + BusAddress: USB_TOPOLOGY_ADDRESS, + u: USB_DEVICE_NODE_INFO_u, +}} +UNION!{union USB_DEVICE_NODE_INFO_u { + [u8; 1078], + UsbDeviceInfo UsbDeviceInfo_mut: USB_DEVICE_INFO, + HubDeviceInfo HubDeviceInfo_mut: USB_HUB_DEVICE_INFO, + CompositeDeviceInfo CompositeDeviceInfo_mut: USB_COMPOSITE_DEVICE_INFO, + ControllerDeviceInfo ControllerDeviceInfo_mut: USB_CONTROLLER_DEVICE_INFO, + DeviceInformation DeviceInformation_mut: [UCHAR; 4], +}} +pub type PUSB_DEVICE_NODE_INFO = *mut USB_DEVICE_NODE_INFO; +STRUCT!{#[repr(packed)] struct USB_DEVICE_PERFORMANCE_INFO { + BulkBytes: ULONG, + ControlDataBytes: ULONG, + IsoBytes: ULONG, + InterruptBytes: ULONG, + BulkUrbCount: ULONG, + ControlUrbCount: ULONG, + IsoUrbCount: ULONG, + InterruptUrbCount: ULONG, + AllocedInterrupt: [ULONG; 6], + AllocedIso: ULONG, + Total32secBandwidth: ULONG, + TotalTtBandwidth: ULONG, + DeviceDescription: [WCHAR; 60], + DeviceSpeed: USB_DEVICE_SPEED, + TotalIsoLatency: ULONG, + DroppedIsoPackets: ULONG, + TransferErrors: ULONG, + PciInterruptCount: ULONG, + HcIdleState: ULONG, + HcAsyncIdleState: ULONG, + HcAsyncCacheFlushCount: ULONG, + HcPeriodicIdleState: ULONG, + HcPeriodicCacheFlushCount: ULONG, +}} +pub type PUSB_DEVICE_PERFORMANCE_INFO = *mut USB_DEVICE_PERFORMANCE_INFO; +ENUM!{enum USB_HUB_TYPE { + UsbRootHub = 1, + Usb20Hub = 2, + Usb30Hub = 3, +}} +STRUCT!{#[repr(packed)] struct USB_HUB_INFORMATION_EX { + HubType: USB_HUB_TYPE, + HighestPortNumber: USHORT, + u: USB_HUB_INFORMATION_EX_u, +}} +UNION!{union USB_HUB_INFORMATION_EX_u { + [u8; 71], + UsbHubDescriptor UsbHubDescriptor_mut: USB_HUB_DESCRIPTOR, + Usb30HubDescriptor Usb30HubDescriptor_mut: USB_30_HUB_DESCRIPTOR, +}} +pub type PUSB_HUB_INFORMATION_EX = *mut USB_HUB_INFORMATION_EX; +STRUCT!{#[repr(packed)] struct USB_PORT_PROPERTIES { + ul: ULONG, +}} +BITFIELD!{USB_PORT_PROPERTIES ul: ULONG [ + PortIsUserConnectable set_PortIsUserConnectable[0..1], + PortIsDebugCapable set_PortIsDebugCapable[1..2], + PortHasMultipleCompanions set_PortHasMultipleCompanions[2..3], + PortConnectorIsTypeC set_PortConnectorIsTypeC[3..4], + ReservedMBZ set_ReservedMBZ[4..32], +]} +pub type PUSB_PORT_PROPERTIES = *mut USB_PORT_PROPERTIES; +STRUCT!{#[repr(packed)] struct USB_PORT_CONNECTOR_PROPERTIES { + ConnectionIndex: ULONG, + ActualLength: ULONG, + UsbPortProperties: USB_PORT_PROPERTIES, + CompanionIndex: USHORT, + CompanionPortNumber: USHORT, + CompanionHubSymbolicLinkName: [WCHAR; 1], +}} +pub type PUSB_PORT_CONNECTOR_PROPERTIES = *mut USB_PORT_CONNECTOR_PROPERTIES; +STRUCT!{#[repr(packed)] struct USB_PROTOCOLS { + ul: ULONG, +}} +BITFIELD!{USB_PROTOCOLS ul: ULONG [ + Usb110 set_Usb110[0..1], + Usb200 set_Usb200[1..2], + Usb300 set_Usb300[2..3], + ReservedMBZ set_ReservedMBZ[3..32], +]} +pub type PUSB_PROTOCOLS = *mut USB_PROTOCOLS; +STRUCT!{#[repr(packed)] struct USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS { + ul: ULONG, +}} +BITFIELD!{USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS ul: ULONG [ + DeviceIsOperatingAtSuperSpeedOrHigher set_DeviceIsOperatingAtSuperSpeedOrHigher[0..1], + DeviceIsSuperSpeedCapableOrHigher set_DeviceIsSuperSpeedCapableOrHigher[1..2], + DeviceIsOperatingAtSuperSpeedPlusOrHigher set_DeviceIsOperatingAtSuperSpeedPlusOrHigher[2..3], + DeviceIsSuperSpeedPlusCapableOrHigher set_DeviceIsSuperSpeedPlusCapableOrHigher[3..4], + ReservedMBZ set_ReservedMBZ[4..32], +]} +pub type PUSB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS + = *mut USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS; +STRUCT!{#[repr(packed)] struct USB_NODE_CONNECTION_INFORMATION_EX_V2 { + ConnectionIndex: ULONG, + Length: ULONG, + SupportedUsbProtocols: USB_PROTOCOLS, + Flags: USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS, +}} +pub type PUSB_NODE_CONNECTION_INFORMATION_EX_V2 = *mut USB_NODE_CONNECTION_INFORMATION_EX_V2; +pub const USB_TRANSPORT_CHARACTERISTICS_VERSION_1: ULONG = 0x01; +pub const USB_TRANSPORT_CHARACTERISTICS_LATENCY_AVAILABLE: ULONG = 0x1; +pub const USB_TRANSPORT_CHARACTERISTICS_BANDWIDTH_AVAILABLE: ULONG = 0x2; +STRUCT!{#[repr(packed)] struct USB_TRANSPORT_CHARACTERISTICS { + Version: ULONG, + TransportCharacteristicsFlags: ULONG, + CurrentRoundtripLatencyInMilliSeconds: ULONG64, + MaxPotentialBandwidth: ULONG64, +}} +pub type PUSB_TRANSPORT_CHARACTERISTICS = *mut USB_TRANSPORT_CHARACTERISTICS; +pub const USB_REGISTER_FOR_TRANSPORT_LATENCY_CHANGE: ULONG = 0x1; +pub const USB_REGISTER_FOR_TRANSPORT_BANDWIDTH_CHANGE: ULONG = 0x2; +DECLARE_HANDLE!(USB_CHANGE_REGISTRATION_HANDLE, USB_CHANGE_REGISTRATION_HANDLE__); +STRUCT!{#[repr(packed)] struct USB_TRANSPORT_CHARACTERISTICS_CHANGE_REGISTRATION { + ChangeNotificationInputFlags: ULONG, + Handle: USB_CHANGE_REGISTRATION_HANDLE, + UsbTransportCharacteristics: USB_TRANSPORT_CHARACTERISTICS, +}} +pub type PUSB_TRANSPORT_CHARACTERISTICS_CHANGE_REGISTRATION + = *mut USB_TRANSPORT_CHARACTERISTICS_CHANGE_REGISTRATION; +STRUCT!{#[repr(packed)] struct USB_TRANSPORT_CHARACTERISTICS_CHANGE_NOTIFICATION { + Handle: USB_CHANGE_REGISTRATION_HANDLE, + UsbTransportCharacteristics: USB_TRANSPORT_CHARACTERISTICS, +}} +pub type PUSB_TRANSPORT_CHARACTERISTICS_CHANGE_NOTIFICATION + = *mut USB_TRANSPORT_CHARACTERISTICS_CHANGE_NOTIFICATION; +STRUCT!{#[repr(packed)] struct USB_TRANSPORT_CHARACTERISTICS_CHANGE_UNREGISTRATION { + Handle: USB_CHANGE_REGISTRATION_HANDLE, +}} +pub type PUSB_TRANSPORT_CHARACTERISTICS_CHANGE_UNREGISTRATION + = *mut USB_TRANSPORT_CHARACTERISTICS_CHANGE_UNREGISTRATION; +pub const USB_DEVICE_CHARACTERISTICS_VERSION_1: ULONG = 0x01; +pub const USB_DEVICE_CHARACTERISTICS_MAXIMUM_PATH_DELAYS_AVAILABLE: ULONG = 0x1; +STRUCT!{#[repr(packed)] struct USB_DEVICE_CHARACTERISTICS { + Version: ULONG, + Reserved: [ULONG; 2], + UsbDeviceCharacteristicsFlags: ULONG, + MaximumSendPathDelayInMilliSeconds: ULONG, + MaximumCompletionPathDelayInMilliSeconds: ULONG, +}} +pub type PUSB_DEVICE_CHARACTERISTICS = *mut USB_DEVICE_CHARACTERISTICS; +STRUCT!{#[repr(packed)] struct USB_START_TRACKING_FOR_TIME_SYNC_INFORMATION { + TimeTrackingHandle: HANDLE, + IsStartupDelayTolerable: BOOLEAN, +}} +pub type PUSB_START_TRACKING_FOR_TIME_SYNC_INFORMATION + = *mut USB_START_TRACKING_FOR_TIME_SYNC_INFORMATION; +STRUCT!{#[repr(packed)] struct USB_STOP_TRACKING_FOR_TIME_SYNC_INFORMATION { + TimeTrackingHandle: HANDLE, +}} +pub type PUSB_STOP_TRACKING_FOR_TIME_SYNC_INFORMATION + = *mut USB_STOP_TRACKING_FOR_TIME_SYNC_INFORMATION; +STRUCT!{#[repr(packed)] struct USB_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC_INFORMATION { + TimeTrackingHandle: HANDLE, + InputFrameNumber: ULONG, + InputMicroFrameNumber: ULONG, + QueryPerformanceCounterAtInputFrameOrMicroFrame: LARGE_INTEGER, + QueryPerformanceCounterFrequency: LARGE_INTEGER, + PredictedAccuracyInMicroSeconds: ULONG, + CurrentGenerationID: ULONG, + CurrentQueryPerformanceCounter: LARGE_INTEGER, + CurrentHardwareFrameNumber: ULONG, + CurrentHardwareMicroFrameNumber: ULONG, + CurrentUSBFrameNumber: ULONG, +}} +pub type PUSB_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC_INFORMATION + = *mut USB_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC_INFORMATION; diff --git a/bash-5.1/vendor/winapi/src/shared/usbiodef.rs b/bash-5.1/vendor/winapi/src/shared/usbiodef.rs new file mode 100644 index 0000000000000000000000000000000000000000..8fcde38c56e833f96b32985bcf1281951c605d12 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/usbiodef.rs @@ -0,0 +1,120 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! Common header file for all USB IOCTLs defined for +//! the core stack. We define them in this single header file +//! so that we can maintain backward compatibilty with older +//! versions of the stack. +use shared::guiddef::GUID; +use shared::minwindef::ULONG; +use um::winioctl::{FILE_ANY_ACCESS, FILE_DEVICE_UNKNOWN, METHOD_BUFFERED, METHOD_NEITHER}; +use um::winnt::PVOID; +pub const USB_SUBMIT_URB: ULONG = 0; +pub const USB_RESET_PORT: ULONG = 1; +pub const USB_GET_ROOTHUB_PDO: ULONG = 3; +pub const USB_GET_PORT_STATUS: ULONG = 4; +pub const USB_ENABLE_PORT: ULONG = 5; +pub const USB_GET_HUB_COUNT: ULONG = 6; +pub const USB_CYCLE_PORT: ULONG = 7; +pub const USB_GET_HUB_NAME: ULONG = 8; +pub const USB_IDLE_NOTIFICATION: ULONG = 9; +pub const USB_RECORD_FAILURE: ULONG = 10; +pub const USB_GET_BUS_INFO: ULONG = 264; +pub const USB_GET_CONTROLLER_NAME: ULONG = 265; +pub const USB_GET_BUSGUID_INFO: ULONG = 266; +pub const USB_GET_PARENT_HUB_INFO: ULONG = 267; +pub const USB_GET_DEVICE_HANDLE: ULONG = 268; +pub const USB_GET_DEVICE_HANDLE_EX: ULONG = 269; +pub const USB_GET_TT_DEVICE_HANDLE: ULONG = 270; +pub const USB_GET_TOPOLOGY_ADDRESS: ULONG = 271; +pub const USB_IDLE_NOTIFICATION_EX: ULONG = 272; +pub const USB_REQ_GLOBAL_SUSPEND: ULONG = 273; +pub const USB_REQ_GLOBAL_RESUME: ULONG = 274; +pub const USB_GET_HUB_CONFIG_INFO: ULONG = 275; +pub const USB_FAIL_GET_STATUS: ULONG = 280; +pub const USB_REGISTER_COMPOSITE_DEVICE: ULONG = 0; +pub const USB_UNREGISTER_COMPOSITE_DEVICE: ULONG = 1; +pub const USB_REQUEST_REMOTE_WAKE_NOTIFICATION: ULONG = 2; +pub const HCD_GET_STATS_1: ULONG = 255; +pub const HCD_DIAGNOSTIC_MODE_ON: ULONG = 256; +pub const HCD_DIAGNOSTIC_MODE_OFF: ULONG = 257; +pub const HCD_GET_ROOT_HUB_NAME: ULONG = 258; +pub const HCD_GET_DRIVERKEY_NAME: ULONG = 265; +pub const HCD_GET_STATS_2: ULONG = 266; +pub const HCD_DISABLE_PORT: ULONG = 268; +pub const HCD_ENABLE_PORT: ULONG = 269; +pub const HCD_USER_REQUEST: ULONG = 270; +pub const HCD_TRACE_READ_REQUEST: ULONG = 275; +pub const USB_GET_NODE_INFORMATION: ULONG = 258; +pub const USB_GET_NODE_CONNECTION_INFORMATION: ULONG = 259; +pub const USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION: ULONG = 260; +pub const USB_GET_NODE_CONNECTION_NAME: ULONG = 261; +pub const USB_DIAG_IGNORE_HUBS_ON: ULONG = 262; +pub const USB_DIAG_IGNORE_HUBS_OFF: ULONG = 263; +pub const USB_GET_NODE_CONNECTION_DRIVERKEY_NAME: ULONG = 264; +pub const USB_GET_HUB_CAPABILITIES: ULONG = 271; +pub const USB_GET_NODE_CONNECTION_ATTRIBUTES: ULONG = 272; +pub const USB_HUB_CYCLE_PORT: ULONG = 273; +pub const USB_GET_NODE_CONNECTION_INFORMATION_EX: ULONG = 274; +pub const USB_RESET_HUB: ULONG = 275; +pub const USB_GET_HUB_CAPABILITIES_EX: ULONG = 276; +pub const USB_GET_HUB_INFORMATION_EX: ULONG = 277; +pub const USB_GET_PORT_CONNECTOR_PROPERTIES: ULONG = 278; +pub const USB_GET_NODE_CONNECTION_INFORMATION_EX_V2: ULONG = 279; +pub const USB_GET_TRANSPORT_CHARACTERISTICS: ULONG = 281; +pub const USB_REGISTER_FOR_TRANSPORT_CHARACTERISTICS_CHANGE: ULONG = 282; +pub const USB_NOTIFY_ON_TRANSPORT_CHARACTERISTICS_CHANGE: ULONG = 283; +pub const USB_UNREGISTER_FOR_TRANSPORT_CHARACTERISTICS_CHANGE: ULONG = 284; +pub const USB_START_TRACKING_FOR_TIME_SYNC: ULONG = 285; +pub const USB_GET_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC: ULONG = 286; +pub const USB_STOP_TRACKING_FOR_TIME_SYNC: ULONG = 287; +pub const USB_GET_DEVICE_CHARACTERISTICS: ULONG = 288; +DEFINE_GUID!{GUID_DEVINTERFACE_USB_HUB, + 0xf18a0e88, 0xc30c, 0x11d0, 0x88, 0x15, 0x00, 0xa0, 0xc9, 0x06, 0xbe, 0xd8} +DEFINE_GUID!{GUID_DEVINTERFACE_USB_DEVICE, + 0xA5DCBF10, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED} +DEFINE_GUID!{GUID_DEVINTERFACE_USB_HOST_CONTROLLER, + 0x3abf6f2d, 0x71c4, 0x462a, 0x8a, 0x92, 0x1e, 0x68, 0x61, 0xe6, 0xaf, 0x27} +DEFINE_GUID!{GUID_USB_WMI_STD_DATA, + 0x4E623B20, 0xCB14, 0x11D1, 0xB3, 0x31, 0x00, 0xA0, 0xC9, 0x59, 0xBB, 0xD2} +DEFINE_GUID!{GUID_USB_WMI_STD_NOTIFICATION, + 0x4E623B20, 0xCB14, 0x11D1, 0xB3, 0x31, 0x00, 0xA0, 0xC9, 0x59, 0xBB, 0xD2} +DEFINE_GUID!{GUID_USB_WMI_DEVICE_PERF_INFO, + 0x66c1aa3c, 0x499f, 0x49a0, 0xa9, 0xa5, 0x61, 0xe2, 0x35, 0x9f, 0x64, 0x7} +DEFINE_GUID!{GUID_USB_WMI_NODE_INFO, + 0x9c179357, 0xdc7a, 0x4f41, 0xb6, 0x6b, 0x32, 0x3b, 0x9d, 0xdc, 0xb5, 0xb1} +DEFINE_GUID!{GUID_USB_WMI_TRACING, + 0x3a61881b, 0xb4e6, 0x4bf9, 0xae, 0xf, 0x3c, 0xd8, 0xf3, 0x94, 0xe5, 0x2f} +DEFINE_GUID!{GUID_USB_TRANSFER_TRACING, + 0x681eb8aa, 0x403d, 0x452c, 0x9f, 0x8a, 0xf0, 0x61, 0x6f, 0xac, 0x95, 0x40} +DEFINE_GUID!{GUID_USB_PERFORMANCE_TRACING, + 0xd5de77a6, 0x6ae9, 0x425c, 0xb1, 0xe2, 0xf5, 0x61, 0x5f, 0xd3, 0x48, 0xa9} +DEFINE_GUID!{GUID_USB_WMI_SURPRISE_REMOVAL_NOTIFICATION, + 0x9bbbf831, 0xa2f2, 0x43b4, 0x96, 0xd1, 0x86, 0x94, 0x4b, 0x59, 0x14, 0xb3} +pub const GUID_CLASS_USBHUB: GUID = GUID_DEVINTERFACE_USB_HUB; +pub const GUID_CLASS_USB_DEVICE: GUID = GUID_DEVINTERFACE_USB_DEVICE; +pub const GUID_CLASS_USB_HOST_CONTROLLER: GUID = GUID_DEVINTERFACE_USB_HOST_CONTROLLER; +pub const FILE_DEVICE_USB: ULONG = FILE_DEVICE_UNKNOWN; +#[inline] +pub fn USB_CTL(id: ULONG) -> ULONG { + CTL_CODE!(FILE_DEVICE_USB, id, METHOD_BUFFERED, FILE_ANY_ACCESS) +} +#[inline] +pub fn USB_KERNEL_CTL(id: ULONG) -> ULONG { + CTL_CODE!(FILE_DEVICE_USB, id, METHOD_NEITHER, FILE_ANY_ACCESS) +} +#[inline] +pub fn USB_KERNEL_CTL_BUFFERED(id: ULONG) -> ULONG { + CTL_CODE!(FILE_DEVICE_USB, id, METHOD_BUFFERED, FILE_ANY_ACCESS) +} +// No calling convention was specified in the code +FN!{stdcall USB_IDLE_CALLBACK( + Context: PVOID, +) -> ()} +STRUCT!{struct USB_IDLE_CALLBACK_INFO { + IdleCallback: USB_IDLE_CALLBACK, + IdleContext: PVOID, +}} +pub type PUSB_IDLE_CALLBACK_INFO = *mut USB_IDLE_CALLBACK_INFO; diff --git a/bash-5.1/vendor/winapi/src/shared/usbscan.rs b/bash-5.1/vendor/winapi/src/shared/usbscan.rs new file mode 100644 index 0000000000000000000000000000000000000000..f5c71625cad9c61f3cded932e1a4a07f8e2e8cd6 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/usbscan.rs @@ -0,0 +1,21 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +use shared::ntdef::{ULONG, USHORT}; +use um::winioctl::{FILE_ANY_ACCESS, METHOD_BUFFERED}; +//98 +STRUCT!{struct DEVICE_DESCRIPTOR { + usVendorId: USHORT, + usProductId: USHORT, + usBcdDevice: USHORT, + usLanguageId: USHORT, +}} +pub type PDEVICE_DESCRIPTOR = *mut DEVICE_DESCRIPTOR; +//132 +pub const FILE_DEVICE_USB_SCAN: ULONG = 0x8000; +pub const IOCTL_INDEX: ULONG = 0x0800; +//143 +pub const IOCTL_GET_USB_DESCRIPTOR: ULONG + = CTL_CODE!(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 8, METHOD_BUFFERED, FILE_ANY_ACCESS); diff --git a/bash-5.1/vendor/winapi/src/shared/usbspec.rs b/bash-5.1/vendor/winapi/src/shared/usbspec.rs new file mode 100644 index 0000000000000000000000000000000000000000..5fae43efdd58879b1ccd1048ac64aaa31be7f538 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/usbspec.rs @@ -0,0 +1,860 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! USB Spec Definitions. +use shared::basetsd::ULONG64; +use shared::guiddef::GUID; +use shared::minwindef::{UCHAR, ULONG, USHORT}; +use um::winnt::WCHAR; +ENUM!{enum USB_DEVICE_SPEED { + UsbLowSpeed = 0, + UsbFullSpeed, + UsbHighSpeed, + UsbSuperSpeed, +}} +ENUM!{enum USB_DEVICE_TYPE { + Usb11Device = 0, + Usb20Device, +}} +STRUCT!{#[repr(packed)] struct BM_REQUEST_TYPE { + B: UCHAR, +}} +BITFIELD!{BM_REQUEST_TYPE B: UCHAR [ + Recipient set_Recipient[0..2], + Reserved set_Reserved[2..5], + Type set_Type[5..7], + Dir set_Dir[7..8], +]} +pub type PBM_REQUEST_TYPE = *mut BM_REQUEST_TYPE; +STRUCT!{#[repr(packed)] struct USB_DEFAULT_PIPE_SETUP_PACKET_wValue_s { + LowByte: UCHAR, + HiByte: UCHAR, +}} +UNION!{#[repr(packed)] union USB_DEFAULT_PIPE_SETUP_PACKET_wValue { + [u16; 1], + s s_mut: USB_DEFAULT_PIPE_SETUP_PACKET_wValue_s, + W W_mut: USHORT, +}} +STRUCT!{#[repr(packed)] struct USB_DEFAULT_PIPE_SETUP_PACKET_wIndex_s { + LowByte: UCHAR, + HiByte: UCHAR, +}} +UNION!{#[repr(packed)] union USB_DEFAULT_PIPE_SETUP_PACKET_wIndex { + [u16; 1], + s s_mut: USB_DEFAULT_PIPE_SETUP_PACKET_wIndex_s, + W W_mut: USHORT, +}} +STRUCT!{#[repr(packed)] struct USB_DEFAULT_PIPE_SETUP_PACKET { + bmRequestType: BM_REQUEST_TYPE, + bRequest: UCHAR, + wValue: USB_DEFAULT_PIPE_SETUP_PACKET_wValue, + wIndex: USB_DEFAULT_PIPE_SETUP_PACKET_wIndex, + wLength: USHORT, +}} +pub type PUSB_DEFAULT_PIPE_SETUP_PACKET = *mut USB_DEFAULT_PIPE_SETUP_PACKET; +pub const BMREQUEST_HOST_TO_DEVICE: UCHAR = 0; +pub const BMREQUEST_DEVICE_TO_HOST: UCHAR = 1; +pub const BMREQUEST_STANDARD: UCHAR = 0; +pub const BMREQUEST_CLASS: UCHAR = 1; +pub const BMREQUEST_VENDOR: UCHAR = 2; +pub const BMREQUEST_TO_DEVICE: UCHAR = 0; +pub const BMREQUEST_TO_INTERFACE: UCHAR = 1; +pub const BMREQUEST_TO_ENDPOINT: UCHAR = 2; +pub const BMREQUEST_TO_OTHER: UCHAR = 3; +#[inline] +pub fn USB_DESCRIPTOR_MAKE_TYPE_AND_INDEX(d: UCHAR, i: UCHAR) -> USHORT { + (d as USHORT) << 8 | (i as USHORT) +} +pub const USB_REQUEST_GET_STATUS: UCHAR = 0x00; +pub const USB_REQUEST_CLEAR_FEATURE: UCHAR = 0x01; +pub const USB_REQUEST_SET_FEATURE: UCHAR = 0x03; +pub const USB_REQUEST_SET_ADDRESS: UCHAR = 0x05; +pub const USB_REQUEST_GET_DESCRIPTOR: UCHAR = 0x06; +pub const USB_REQUEST_SET_DESCRIPTOR: UCHAR = 0x07; +pub const USB_REQUEST_GET_CONFIGURATION: UCHAR = 0x08; +pub const USB_REQUEST_SET_CONFIGURATION: UCHAR = 0x09; +pub const USB_REQUEST_GET_INTERFACE: UCHAR = 0x0A; +pub const USB_REQUEST_SET_INTERFACE: UCHAR = 0x0B; +pub const USB_REQUEST_SYNC_FRAME: UCHAR = 0x0C; +pub const USB_REQUEST_SET_SEL: UCHAR = 0x30; +pub const USB_REQUEST_ISOCH_DELAY: UCHAR = 0x31; +pub const USB_DEVICE_DESCRIPTOR_TYPE: UCHAR = 0x01; +pub const USB_CONFIGURATION_DESCRIPTOR_TYPE: UCHAR = 0x02; +pub const USB_STRING_DESCRIPTOR_TYPE: UCHAR = 0x03; +pub const USB_INTERFACE_DESCRIPTOR_TYPE: UCHAR = 0x04; +pub const USB_ENDPOINT_DESCRIPTOR_TYPE: UCHAR = 0x05; +pub const USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE: UCHAR = 0x06; +pub const USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE: UCHAR = 0x07; +pub const USB_INTERFACE_POWER_DESCRIPTOR_TYPE: UCHAR = 0x08; +pub const USB_OTG_DESCRIPTOR_TYPE: UCHAR = 0x09; +pub const USB_DEBUG_DESCRIPTOR_TYPE: UCHAR = 0x0A; +pub const USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE: UCHAR = 0x0B; +pub const USB_BOS_DESCRIPTOR_TYPE: UCHAR = 0x0F; +pub const USB_DEVICE_CAPABILITY_DESCRIPTOR_TYPE: UCHAR = 0x10; +pub const USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_TYPE: UCHAR = 0x30; +pub const USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR_TYPE: UCHAR = 0x31; +pub const USB_RESERVED_DESCRIPTOR_TYPE: UCHAR = 0x06; +pub const USB_CONFIG_POWER_DESCRIPTOR_TYPE: UCHAR = 0x07; +pub const USB_FEATURE_ENDPOINT_STALL: UCHAR = 0x00; +pub const USB_FEATURE_REMOTE_WAKEUP: UCHAR = 0x01; +pub const USB_FEATURE_TEST_MODE: UCHAR = 0x02; +pub const USB_FEATURE_FUNCTION_SUSPEND: UCHAR = 0x00; +pub const USB_FEATURE_U1_ENABLE: UCHAR = 0x30; +pub const USB_FEATURE_U2_ENABLE: UCHAR = 0x31; +pub const USB_FEATURE_LTM_ENABLE: UCHAR = 0x32; +pub const USB_FEATURE_LDM_ENABLE: UCHAR = 0x35; +pub const USB_FEATURE_BATTERY_WAKE_MASK: UCHAR = 0x28; +pub const USB_FEATURE_OS_IS_PD_AWARE: UCHAR = 0x29; +pub const USB_FEATURE_POLICY_MODE: UCHAR = 0x2A; +pub const USB_FEATURE_CHARGING_POLICY: UCHAR = 0x36; +pub const USB_CHARGING_POLICY_DEFAULT: UCHAR = 0x00; +pub const USB_CHARGING_POLICY_ICCHPF: UCHAR = 0x01; +pub const USB_CHARGING_POLICY_ICCLPF: UCHAR = 0x02; +pub const USB_CHARGING_POLICY_NO_POWER: UCHAR = 0x03; +pub const USB_STATUS_PORT_STATUS: UCHAR = 0x00; +pub const USB_STATUS_PD_STATUS: UCHAR = 0x01; +pub const USB_STATUS_EXT_PORT_STATUS: UCHAR = 0x02; +pub const USB_GETSTATUS_SELF_POWERED: UCHAR = 0x01; +pub const USB_GETSTATUS_REMOTE_WAKEUP_ENABLED: UCHAR = 0x02; +pub const USB_GETSTATUS_U1_ENABLE: UCHAR = 0x04; +pub const USB_GETSTATUS_U2_ENABLE: UCHAR = 0x08; +pub const USB_GETSTATUS_LTM_ENABLE: UCHAR = 0x10; +STRUCT!{#[repr(packed)] struct USB_DEVICE_STATUS { + AsUshort16: USHORT, +}} +BITFIELD!{USB_DEVICE_STATUS AsUshort16: USHORT [ + SelfPowered set_SelfPowered[0..1], + RemoteWakeup set_RemoteWakeup[1..2], + U1Enable set_U1Enable[2..3], + U2Enable set_U2Enable[3..4], + LtmEnable set_LtmEnable[4..5], + Reserved set_Reserved[5..16], +]} +pub type PUSB_DEVICE_STATUS = *mut USB_DEVICE_STATUS; +STRUCT!{#[repr(packed)] struct USB_INTERFACE_STATUS { + AsUshort16: USHORT, +}} +BITFIELD!{USB_INTERFACE_STATUS AsUshort16: USHORT [ + RemoteWakeupCapable set_RemoteWakeupCapable[0..1], + RemoteWakeupEnabled set_RemoteWakeupEnabled[1..2], + Reserved set_Reserved[2..16], +]} +pub type PUSB_INTERFACE_STATUS = *mut USB_INTERFACE_STATUS; +STRUCT!{#[repr(packed)] struct USB_ENDPOINT_STATUS { + AsUshort16: USHORT, +}} +BITFIELD!{USB_ENDPOINT_STATUS AsUshort16: USHORT [ + Halt set_Halt[0..1], + Reserved set_Reserved[1..16], +]} +pub type PUSB_ENDPOINT_STATUS = *mut USB_ENDPOINT_STATUS; +STRUCT!{#[repr(packed)] struct USB_COMMON_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, +}} +pub type PUSB_COMMON_DESCRIPTOR = *mut USB_COMMON_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_DEVICE_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bcdUSB: USHORT, + bDeviceClass: UCHAR, + bDeviceSubClass: UCHAR, + bDeviceProtocol: UCHAR, + bMaxPacketSize0: UCHAR, + idVendor: USHORT, + idProduct: USHORT, + bcdDevice: USHORT, + iManufacturer: UCHAR, + iProduct: UCHAR, + iSerialNumber: UCHAR, + bNumConfigurations: UCHAR, +}} +pub type PUSB_DEVICE_DESCRIPTOR = *mut USB_DEVICE_DESCRIPTOR; +pub const USB_DEVICE_CLASS_RESERVED: UCHAR = 0x00; +pub const USB_DEVICE_CLASS_AUDIO: UCHAR = 0x01; +pub const USB_DEVICE_CLASS_COMMUNICATIONS: UCHAR = 0x02; +pub const USB_DEVICE_CLASS_HUMAN_INTERFACE: UCHAR = 0x03; +pub const USB_DEVICE_CLASS_MONITOR: UCHAR = 0x04; +pub const USB_DEVICE_CLASS_PHYSICAL_INTERFACE: UCHAR = 0x05; +pub const USB_DEVICE_CLASS_POWER: UCHAR = 0x06; +pub const USB_DEVICE_CLASS_IMAGE: UCHAR = 0x06; +pub const USB_DEVICE_CLASS_PRINTER: UCHAR = 0x07; +pub const USB_DEVICE_CLASS_STORAGE: UCHAR = 0x08; +pub const USB_DEVICE_CLASS_HUB: UCHAR = 0x09; +pub const USB_DEVICE_CLASS_CDC_DATA: UCHAR = 0x0A; +pub const USB_DEVICE_CLASS_SMART_CARD: UCHAR = 0x0B; +pub const USB_DEVICE_CLASS_CONTENT_SECURITY: UCHAR = 0x0D; +pub const USB_DEVICE_CLASS_VIDEO: UCHAR = 0x0E; +pub const USB_DEVICE_CLASS_PERSONAL_HEALTHCARE: UCHAR = 0x0F; +pub const USB_DEVICE_CLASS_AUDIO_VIDEO: UCHAR = 0x10; +pub const USB_DEVICE_CLASS_BILLBOARD: UCHAR = 0x11; +pub const USB_DEVICE_CLASS_DIAGNOSTIC_DEVICE: UCHAR = 0xDC; +pub const USB_DEVICE_CLASS_WIRELESS_CONTROLLER: UCHAR = 0xE0; +pub const USB_DEVICE_CLASS_MISCELLANEOUS: UCHAR = 0xEF; +pub const USB_DEVICE_CLASS_APPLICATION_SPECIFIC: UCHAR = 0xFE; +pub const USB_DEVICE_CLASS_VENDOR_SPECIFIC: UCHAR = 0xFF; +STRUCT!{#[repr(packed)] struct USB_DEVICE_QUALIFIER_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bcdUSB: USHORT, + bDeviceClass: UCHAR, + bDeviceSubClass: UCHAR, + bDeviceProtocol: UCHAR, + bMaxPacketSize0: UCHAR, + bNumConfigurations: UCHAR, + bReserved: UCHAR, +}} +pub type PUSB_DEVICE_QUALIFIER_DESCRIPTOR = *mut USB_DEVICE_QUALIFIER_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_BOS_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + wTotalLength: USHORT, + bNumDeviceCaps: UCHAR, +}} +pub type PUSB_BOS_DESCRIPTOR = *mut USB_BOS_DESCRIPTOR; +pub const USB_DEVICE_CAPABILITY_WIRELESS_USB: UCHAR = 0x01; +pub const USB_DEVICE_CAPABILITY_USB20_EXTENSION: UCHAR = 0x02; +pub const USB_DEVICE_CAPABILITY_SUPERSPEED_USB: UCHAR = 0x03; +pub const USB_DEVICE_CAPABILITY_CONTAINER_ID: UCHAR = 0x04; +pub const USB_DEVICE_CAPABILITY_PLATFORM: UCHAR = 0x05; +pub const USB_DEVICE_CAPABILITY_POWER_DELIVERY: UCHAR = 0x06; +pub const USB_DEVICE_CAPABILITY_BATTERY_INFO: UCHAR = 0x07; +pub const USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT: UCHAR = 0x08; +pub const USB_DEVICE_CAPABILITY_PD_PROVIDER_PORT: UCHAR = 0x09; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB: UCHAR = 0x0A; +pub const USB_DEVICE_CAPABILITY_PRECISION_TIME_MEASUREMENT: UCHAR = 0x0B; +pub const USB_DEVICE_CAPABILITY_BILLBOARD: UCHAR = 0x0D; +pub const USB_DEVICE_CAPABILITY_CONFIGURATION_SUMMARY: UCHAR = 0x10; +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR_bmAttributes { + AsUlong: ULONG, +}} +BITFIELD!{USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR_bmAttributes AsUlong: ULONG [ + Reserved set_Reserved[0..1], + LPMCapable set_LPMCapable[1..2], + BESLAndAlternateHIRDSupported set_BESLAndAlternateHIRDSupported[2..3], + BaselineBESLValid set_BaselineBESLValid[3..4], + DeepBESLValid set_DeepBESLValid[4..5], + Reserved1 set_Reserved1[5..8], + BaselineBESL set_BaselineBESL[8..12], + DeepBESL set_DeepBESL[12..16], + Reserved2 set_Reserved2[16..32], +]} +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bDevCapabilityType: UCHAR, + bmAttributes: USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR_bmAttributes, +}} +pub type PUSB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR + = *mut USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR; +pub const USB_DEVICE_CAPABILITY_USB20_EXTENSION_BMATTRIBUTES_RESERVED_MASK: ULONG = 0xFFFF00E1; +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR_bmAttributes { + AsUlong: ULONG, +}} +BITFIELD!{USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR_bmAttributes AsUlong: ULONG [ + Reserved set_Reserved[0..1], + BatteryCharging set_BatteryCharging[1..2], + USBPowerDelivery set_USBPowerDelivery[2..3], + Provider set_Provider[3..4], + Consumer set_Consumer[4..5], + ChargingPolicy set_ChargingPolicy[5..6], + TypeCCurrent set_TypeCCurrent[6..7], + Reserved2 set_Reserved2[7..8], + ACSupply set_ACSupply[8..9], + Battery set_Battery[9..10], + Other set_Other[10..11], + NumBatteries set_NumBatteries[11..14], + UsesVbus set_UsesVbus[14..15], + Reserved3 set_Reserved3[15..32], +]} +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bDevCapabilityType: UCHAR, + bReserved: UCHAR, + bmAttributes: USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR_bmAttributes, + bmProviderPorts: USHORT, + bmConsumerPorts: USHORT, + bcdBCVersion: USHORT, + bcdPDVersion: USHORT, + bcdUSBTypeCVersion: USHORT, +}} +pub type PUSB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR + = *mut USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR_bmCapabilities { + AsUshort: USHORT, +}} +BITFIELD!{USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR_bmCapabilities AsUshort: USHORT [ + BatteryCharging set_BatteryCharging[0..1], + USBPowerDelivery set_USBPowerDelivery[1..2], + USBTypeCCurrent set_USBTypeCCurrent[2..3], + Reserved set_Reserved[3..16], +]} +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bDevCapabilityType: UCHAR, + bReserved: UCHAR, + bmCapabilities: USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR_bmCapabilities, + wMinVoltage: USHORT, + wMaxVoltage: USHORT, + wReserved: USHORT, + dwMaxOperatingPower: ULONG, + dwMaxPeakPower: ULONG, + dwMaxPeakPowerTime: ULONG, +}} +pub type PUSB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR + = *mut USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bDevCapabilityType: UCHAR, + bmAttributes: UCHAR, + wSpeedsSupported: USHORT, + bFunctionalitySupport: UCHAR, + bU1DevExitLat: UCHAR, + wU2DevExitLat: USHORT, +}} +pub type PUSB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR + = *mut USB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR; +pub const USB_DEVICE_CAPABILITY_SUPERSPEED_BMATTRIBUTES_RESERVED_MASK: UCHAR = 0xFD; +pub const USB_DEVICE_CAPABILITY_SUPERSPEED_BMATTRIBUTES_LTM_CAPABLE: UCHAR = 0x02; +pub const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_RESERVED_MASK: USHORT = 0xFFF0; +pub const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_LOW: USHORT = 0x0001; +pub const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_FULL: USHORT = 0x0002; +pub const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_HIGH: USHORT = 0x0004; +pub const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_SUPER: USHORT = 0x0008; +pub const USB_DEVICE_CAPABILITY_SUPERSPEED_U1_DEVICE_EXIT_MAX_VALUE: UCHAR = 0x0A; +pub const USB_DEVICE_CAPABILITY_SUPERSPEED_U2_DEVICE_EXIT_MAX_VALUE: USHORT = 0x07FF; +pub const USB_DEVICE_CAPABILITY_MAX_U1_LATENCY: UCHAR = 0x0A; +pub const USB_DEVICE_CAPABILITY_MAX_U2_LATENCY: USHORT = 0x07FF; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_LSE_BPS: ULONG = 0; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_LSE_KBPS: ULONG = 1; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_LSE_MBPS: ULONG = 2; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_LSE_GBPS: ULONG = 3; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_MODE_SYMMETRIC: ULONG = 0; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_MODE_ASYMMETRIC: ULONG = 1; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_DIR_RX: ULONG = 0; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_DIR_TX: ULONG = 1; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_PROTOCOL_SS: ULONG = 0; +pub const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_PROTOCOL_SSP: ULONG = 1; +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED { + AsUlong32: ULONG, +}} +BITFIELD!{USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED AsUlong32: ULONG [ + SublinkSpeedAttrID set_SublinkSpeedAttrID[0..4], + LaneSpeedExponent set_LaneSpeedExponent[4..6], + SublinkTypeMode set_SublinkTypeMode[6..7], + SublinkTypeDir set_SublinkTypeDir[7..8], + Reserved set_Reserved[8..14], + LinkProtocol set_LinkProtocol[14..16], + LaneSpeedMantissa set_LaneSpeedMantissa[16..32], +]} +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR_bmAttributes { + AsUlong32: ULONG, +}} +BITFIELD!{USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR_bmAttributes AsUlong32: ULONG [ + SublinkSpeedAttrCount set_SublinkSpeedAttrCount[0..5], + SublinkSpeedIDCount set_SublinkSpeedIDCount[5..9], + Reserved set_Reserved[9..32], +]} +STRUCT!{#[repr(packed)] + struct USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR_wFunctionalitySupport { + AsUshort: USHORT, +}} +BITFIELD!{ + USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR_wFunctionalitySupport AsUshort: USHORT [ + SublinkSpeedAttrID set_SublinkSpeedAttrID[0..4], + Reserved set_Reserved[4..8], + MinRxLaneCount set_MinRxLaneCount[8..12], + MinTxLaneCount set_MinTxLaneCount[12..16], +]} +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bDevCapabilityType: UCHAR, + bReserved: UCHAR, + bmAttributes: USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR_bmAttributes, + wFunctionalitySupport: + USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR_wFunctionalitySupport, + wReserved: USHORT, + bmSublinkSpeedAttr: [USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED; 1], +}} +pub type PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR + = *mut USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bDevCapabilityType: UCHAR, + bReserved: UCHAR, + ContainerID: [UCHAR; 16], +}} +pub type PUSB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR + = *mut USB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_CONFIGURATION_SUMMARY_DESCRIPTOR_Function { + bClass: UCHAR, + bSubClass: UCHAR, + bProtocol: UCHAR, +}} +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_CONFIGURATION_SUMMARY_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bDevCapabilityType: UCHAR, + bcdVersion: USHORT, + bConfigurationValue: UCHAR, + bMaxPower: UCHAR, + bNumFunctions: UCHAR, + Function: [USB_DEVICE_CAPABILITY_CONFIGURATION_SUMMARY_DESCRIPTOR_Function; 1], +}} +pub type PUSB_DEVICE_CAPABILITY_CONFIGURATION_SUMMARY_DESCRIPTOR + = *mut USB_DEVICE_CAPABILITY_CONFIGURATION_SUMMARY_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bDevCapabilityType: UCHAR, + bReserved: UCHAR, + PlatformCapabilityUuid: GUID, + CapabililityData: [UCHAR; 1], +}} +pub type PUSB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR + = *mut USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR_VconnPower { + AsUshort: USHORT, +}} +BITFIELD!{USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR_VconnPower AsUshort: USHORT [ + VConnPowerNeededForFullFunctionality set_VConnPowerNeededForFullFunctionality[0..3], + Reserved set_Reserved[3..15], + NoVconnPowerRequired set_NoVconnPowerRequired[15..16], +]} +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR_AlternateMode { + wSVID: USHORT, + bAlternateMode: UCHAR, + iAlternateModeSetting: UCHAR, +}} +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bDevCapabilityType: UCHAR, + iAddtionalInfoURL: UCHAR, + bNumberOfAlternateModes: UCHAR, + bPreferredAlternateMode: UCHAR, + VconnPower: USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR_VconnPower, + bmConfigured: [UCHAR; 32], + bReserved: ULONG, + AlternateMode: [USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR_AlternateMode; 1], +}} +pub type PUSB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR + = *mut USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR; +DEFINE_GUID!{GUID_USB_MSOS20_PLATFORM_CAPABILITY_ID, + 0xd8dd60df, 0x4589, 0x4cc7, 0x9c, 0xd2, 0x65, 0x9d, 0x9e, 0x64, 0x8a, 0x9f} +STRUCT!{#[repr(packed)] struct USB_DEVICE_CAPABILITY_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bDevCapabilityType: UCHAR, +}} +pub type PUSB_DEVICE_CAPABILITY_DESCRIPTOR = *mut USB_DEVICE_CAPABILITY_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_CONFIGURATION_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + wTotalLength: USHORT, + bNumInterfaces: UCHAR, + bConfigurationValue: UCHAR, + iConfiguration: UCHAR, + bmAttributes: UCHAR, + MaxPower: UCHAR, +}} +pub type PUSB_CONFIGURATION_DESCRIPTOR = *mut USB_CONFIGURATION_DESCRIPTOR; +pub const USB_CONFIG_POWERED_MASK: UCHAR = 0xC0; +pub const USB_CONFIG_BUS_POWERED: UCHAR = 0x80; +pub const USB_CONFIG_SELF_POWERED: UCHAR = 0x40; +pub const USB_CONFIG_REMOTE_WAKEUP: UCHAR = 0x20; +pub const USB_CONFIG_RESERVED: UCHAR = 0x1F; +STRUCT!{#[repr(packed)] struct USB_INTERFACE_ASSOCIATION_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bFirstInterface: UCHAR, + bInterfaceCount: UCHAR, + bFunctionClass: UCHAR, + bFunctionSubClass: UCHAR, + bFunctionProtocol: UCHAR, + iFunction: UCHAR, +}} +pub type PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR = *mut USB_INTERFACE_ASSOCIATION_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_INTERFACE_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bInterfaceNumber: UCHAR, + bAlternateSetting: UCHAR, + bNumEndpoints: UCHAR, + bInterfaceClass: UCHAR, + bInterfaceSubClass: UCHAR, + bInterfaceProtocol: UCHAR, + iInterface: UCHAR, +}} +pub type PUSB_INTERFACE_DESCRIPTOR = *mut USB_INTERFACE_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_ENDPOINT_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bEndpointAddress: UCHAR, + bmAttributes: UCHAR, + wMaxPacketSize: USHORT, + bInterval: UCHAR, +}} +pub type PUSB_ENDPOINT_DESCRIPTOR = *mut USB_ENDPOINT_DESCRIPTOR; +pub const USB_ENDPOINT_DIRECTION_MASK: UCHAR = 0x80; +#[inline] +pub fn USB_ENDPOINT_DIRECTION_OUT(addr: UCHAR) -> UCHAR { + !(addr & USB_ENDPOINT_DIRECTION_MASK) +} +#[inline] +pub fn USB_ENDPOINT_DIRECTION_IN(addr: UCHAR) -> UCHAR { + addr & USB_ENDPOINT_DIRECTION_MASK +} +pub const USB_ENDPOINT_ADDRESS_MASK: UCHAR = 0x0F; +pub const USB_ENDPOINT_TYPE_MASK: UCHAR = 0x03; +pub const USB_ENDPOINT_TYPE_CONTROL: UCHAR = 0x00; +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS: UCHAR = 0x01; +pub const USB_ENDPOINT_TYPE_BULK: UCHAR = 0x02; +pub const USB_ENDPOINT_TYPE_INTERRUPT: UCHAR = 0x03; +pub const USB_ENDPOINT_TYPE_BULK_RESERVED_MASK: UCHAR = 0xFC; +pub const USB_ENDPOINT_TYPE_CONTROL_RESERVED_MASK: UCHAR = 0xFC; +pub const USB_20_ENDPOINT_TYPE_INTERRUPT_RESERVED_MASK: UCHAR = 0xFC; +pub const USB_30_ENDPOINT_TYPE_INTERRUPT_RESERVED_MASK: UCHAR = 0xCC; +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_RESERVED_MASK: UCHAR = 0xC0; +pub const USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_MASK: UCHAR = 0x30; +pub const USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_PERIODIC: UCHAR = 0x00; +pub const USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_NOTIFICATION: UCHAR = 0x10; +pub const USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_RESERVED10: UCHAR = 0x20; +pub const USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_RESERVED11: UCHAR = 0x30; +#[inline] +pub fn USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE(bmAttr: UCHAR) -> UCHAR { + bmAttr & USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_MASK +} +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_MASK: UCHAR = 0x0C; +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_NO_SYNCHRONIZATION: UCHAR = 0x00; +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_ASYNCHRONOUS: UCHAR = 0x04; +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_ADAPTIVE: UCHAR = 0x08; +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_SYNCHRONOUS: UCHAR = 0x0C; +#[inline] +pub fn USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION(bmAttr: UCHAR) -> UCHAR { + bmAttr & USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_MASK +} +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_MASK: UCHAR = 0x30; +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_DATA_ENDOINT: UCHAR = 0x00; +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_FEEDBACK_ENDPOINT: UCHAR = 0x10; +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_IMPLICIT_FEEDBACK_DATA_ENDPOINT: UCHAR = 0x20; +pub const USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_RESERVED: UCHAR = 0x30; +#[inline] +pub fn USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE(bmAttr: UCHAR) -> UCHAR { + bmAttr & USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_MASK +} +STRUCT!{#[repr(packed)] struct USB_HIGH_SPEED_MAXPACKET { + us: USHORT, +}} +BITFIELD!{USB_HIGH_SPEED_MAXPACKET us: USHORT [ + MaxPacket set_MaxPacket[0..11], + HSmux set_HSmux[11..13], + Reserved set_Reserved[13..16], +]} +pub type PUSB_HIGH_SPEED_MAXPACKET = *mut USB_HIGH_SPEED_MAXPACKET; +pub const USB_ENDPOINT_SUPERSPEED_BULK_MAX_PACKET_SIZE: USHORT = 1024; +pub const USB_ENDPOINT_SUPERSPEED_CONTROL_MAX_PACKET_SIZE: USHORT = 512; +pub const USB_ENDPOINT_SUPERSPEED_ISO_MAX_PACKET_SIZE: USHORT = 1024; +pub const USB_ENDPOINT_SUPERSPEED_INTERRUPT_MAX_PACKET_SIZE: USHORT = 1024; +STRUCT!{#[repr(packed)] struct USB_STRING_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bString: [WCHAR; 1], +}} +pub type PUSB_STRING_DESCRIPTOR = *mut USB_STRING_DESCRIPTOR; +pub const MAXIMUM_USB_STRING_LENGTH: UCHAR = 255; +STRUCT!{#[repr(packed)] struct USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes_Bulk { + BitField: UCHAR, +}} +BITFIELD!{USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes_Bulk BitField: UCHAR [ + MaxStreams set_MaxStreams[0..5], + Reserved1 set_Reserved1[5..8], +]} +STRUCT!{#[repr(packed)] + struct USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes_Isochronous { + BitField: UCHAR, +}} +BITFIELD!{USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes_Isochronous BitField: UCHAR [ + Mult set_Mult[0..2], + Reserved2 set_Reserved2[2..7], + SspCompanion set_SspCompanion[7..8], +]} +UNION!{#[repr(packed)] union USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes { + [u8; 1], + AsUchar AsUchar_mut: UCHAR, + Bulk Bulk_mut: USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes_Bulk, + Isochronous Isochronous_mut: + USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes_Isochronous, +}} +STRUCT!{#[repr(packed)] struct USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bMaxBurst: UCHAR, + bmAttributes: USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes, + wBytesPerInterval: USHORT, +}} +pub type PUSB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR + = *mut USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR; +pub const USB_SUPERSPEED_ISOCHRONOUS_MAX_MULTIPLIER: UCHAR = 2; +STRUCT!{#[repr(packed)] struct USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + wReserved: USHORT, + dwBytesPerInterval: ULONG, +}} +pub type PUSB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR + = *mut USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR; +pub const USB_SUPERSPEEDPLUS_ISOCHRONOUS_MIN_BYTESPERINTERVAL: ULONG = 0xC001; +pub const USB_SUPERSPEEDPLUS_ISOCHRONOUS_MAX_BYTESPERINTERVAL: ULONG = 0xFFFFFF; +STRUCT!{#[repr(packed)] struct USB_HUB_DESCRIPTOR { + bDescriptorLength: UCHAR, + bDescriptorType: UCHAR, + bNumberOfPorts: UCHAR, + wHubCharacteristics: USHORT, + bPowerOnToPowerGood: UCHAR, + bHubControlCurrent: UCHAR, + bRemoveAndPowerMask: [UCHAR; 64], +}} +pub type PUSB_HUB_DESCRIPTOR = *mut USB_HUB_DESCRIPTOR; +pub const USB_20_HUB_DESCRIPTOR_TYPE: UCHAR = 0x29; +STRUCT!{#[repr(packed)] struct USB_30_HUB_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bNumberOfPorts: UCHAR, + wHubCharacteristics: USHORT, + bPowerOnToPowerGood: UCHAR, + bHubControlCurrent: UCHAR, + bHubHdrDecLat: UCHAR, + wHubDelay: USHORT, + DeviceRemovable: USHORT, +}} +pub type PUSB_30_HUB_DESCRIPTOR = *mut USB_30_HUB_DESCRIPTOR; +pub const USB_30_HUB_DESCRIPTOR_TYPE: UCHAR = 0x2A; +pub const USB_REQUEST_GET_STATE: UCHAR = 0x02; +pub const USB_REQUEST_CLEAR_TT_BUFFER: UCHAR = 0x08; +pub const USB_REQUEST_RESET_TT: UCHAR = 0x09; +pub const USB_REQUEST_GET_TT_STATE: UCHAR = 0x0A; +pub const USB_REQUEST_STOP_TT: UCHAR = 0x0B; +pub const USB_REQUEST_SET_HUB_DEPTH: UCHAR = 0x0C; +pub const USB_REQUEST_GET_PORT_ERR_COUNT: UCHAR = 0x0D; +STRUCT!{#[repr(packed)] struct USB_HUB_STATUS { + AsUshort16: USHORT, +}} +BITFIELD!{USB_HUB_STATUS AsUshort16: USHORT [ + LocalPowerLost set_LocalPowerLost[0..1], + OverCurrent set_OverCurrent[1..2], + Reserved set_Reserved[2..16], +]} +pub type PUSB_HUB_STATUS = *mut USB_HUB_STATUS; +STRUCT!{#[repr(packed)] struct USB_HUB_CHANGE { + AsUshort16: USHORT, +}} +BITFIELD!{USB_HUB_CHANGE AsUshort16: USHORT [ + LocalPowerChange set_LocalPowerChange[0..1], + OverCurrentChange set_OverCurrentChange[1..2], + Reserved set_Reserved[2..16], +]} +pub type PUSB_HUB_CHANGE = *mut USB_HUB_CHANGE; +STRUCT!{#[repr(packed)] struct USB_HUB_STATUS_AND_CHANGE_s { + HubStatus: USB_HUB_STATUS, + HubChange: USB_HUB_CHANGE, +}} +UNION!{#[repr(packed)] union USB_HUB_STATUS_AND_CHANGE { + [u32; 1], + AsUlong32 AsUlong32_mut: ULONG, + s s_mut: USB_HUB_STATUS_AND_CHANGE_s, +}} +pub type PUSB_HUB_STATUS_AND_CHANGE = *mut USB_HUB_STATUS_AND_CHANGE; +STRUCT!{#[repr(packed)] struct USB_20_PORT_STATUS { + AsUshort16: USHORT, +}} +BITFIELD!{USB_20_PORT_STATUS AsUshort16: USHORT [ + CurrentConnectStatus set_CurrentConnectStatus[0..1], + PortEnabledDisabled set_PortEnabledDisabled[1..2], + Suspend set_Suspend[2..3], + OverCurrent set_OverCurrent[3..4], + Reset set_Reset[4..5], + L1 set_L1[5..6], + Reserved0 set_Reserved0[6..8], + PortPower set_PortPower[8..9], + LowSpeedDeviceAttached set_LowSpeedDeviceAttached[9..10], + HighSpeedDeviceAttached set_HighSpeedDeviceAttached[10..11], + PortTestMode set_PortTestMode[11..12], + PortIndicatorControl set_PortIndicatorControl[12..13], + Reserved1 set_Reserved1[13..16], +]} +pub type PUSB_20_PORT_STATUS = *mut USB_20_PORT_STATUS; +pub const USB_PORT_STATUS_CONNECT: USHORT = 0x0001; +pub const USB_PORT_STATUS_ENABLE: USHORT = 0x0002; +pub const USB_PORT_STATUS_SUSPEND: USHORT = 0x0004; +pub const USB_PORT_STATUS_OVER_CURRENT: USHORT = 0x0008; +pub const USB_PORT_STATUS_RESET: USHORT = 0x0010; +pub const USB_PORT_STATUS_POWER: USHORT = 0x0100; +pub const USB_PORT_STATUS_LOW_SPEED: USHORT = 0x0200; +pub const USB_PORT_STATUS_HIGH_SPEED: USHORT = 0x0400; +STRUCT!{#[repr(packed)] struct USB_20_PORT_CHANGE { + AsUshort16: USHORT, +}} +BITFIELD!{USB_20_PORT_CHANGE AsUshort16: USHORT [ + ConnectStatusChange set_ConnectStatusChange[0..1], + PortEnableDisableChange set_PortEnableDisableChange[1..2], + SuspendChange set_SuspendChange[2..3], + OverCurrentIndicatorChange set_OverCurrentIndicatorChange[3..4], + ResetChange set_ResetChange[4..5], + Reserved2 set_Reserved2[5..16], +]} +pub type PUSB_20_PORT_CHANGE = *mut USB_20_PORT_CHANGE; +STRUCT!{#[repr(packed)] struct USB_30_PORT_STATUS { + AsUshort16: USHORT, +}} +BITFIELD!{USB_30_PORT_STATUS AsUshort16: USHORT [ + CurrentConnectStatus set_CurrentConnectStatus[0..1], + PortEnabledDisabled set_PortEnabledDisabled[1..2], + Reserved0 set_Reserved0[2..3], + OverCurrent set_OverCurrent[3..4], + Reset set_Reset[4..5], + PortLinkState set_PortLinkState[5..9], + PortPower set_PortPower[9..10], + NegotiatedDeviceSpeed set_NegotiatedDeviceSpeed[10..13], + Reserved1 set_Reserved1[13..16], +]} +pub type PUSB_30_PORT_STATUS = *mut USB_30_PORT_STATUS; +pub const PORT_LINK_STATE_U0: USHORT = 0; +pub const PORT_LINK_STATE_U1: USHORT = 1; +pub const PORT_LINK_STATE_U2: USHORT = 2; +pub const PORT_LINK_STATE_U3: USHORT = 3; +pub const PORT_LINK_STATE_DISABLED: USHORT = 4; +pub const PORT_LINK_STATE_RX_DETECT: USHORT = 5; +pub const PORT_LINK_STATE_INACTIVE: USHORT = 6; +pub const PORT_LINK_STATE_POLLING: USHORT = 7; +pub const PORT_LINK_STATE_RECOVERY: USHORT = 8; +pub const PORT_LINK_STATE_HOT_RESET: USHORT = 9; +pub const PORT_LINK_STATE_COMPLIANCE_MODE: USHORT = 10; +pub const PORT_LINK_STATE_LOOPBACK: USHORT = 11; +pub const PORT_LINK_STATE_TEST_MODE: USHORT = 11; +STRUCT!{#[repr(packed)] struct USB_30_PORT_CHANGE { + AsUshort16: USHORT, +}} +BITFIELD!{USB_30_PORT_CHANGE AsUshort16: USHORT [ + ConnectStatusChange set_ConnectStatusChange[0..1], + Reserved2 set_Reserved2[1..3], + OverCurrentIndicatorChange set_OverCurrentIndicatorChange[3..4], + ResetChange set_ResetChange[4..5], + BHResetChange set_BHResetChange[5..6], + PortLinkStateChange set_PortLinkStateChange[6..7], + PortConfigErrorChange set_PortConfigErrorChange[7..8], + Reserved3 set_Reserved3[8..16], +]} +pub type PUSB_30_PORT_CHANGE = *mut USB_30_PORT_CHANGE; +UNION!{#[repr(packed)] union USB_PORT_STATUS { + [u16; 1], + AsUshort16 AsUshort16_mut: USHORT, + Usb20PortStatus Usb20PortStatus_mut: USB_20_PORT_STATUS, + Usb30PortStatus Usb30PortStatus_mut: USB_30_PORT_STATUS, +}} +pub type PUSB_PORT_STATUS = *mut USB_PORT_STATUS; +UNION!{#[repr(packed)] union USB_PORT_CHANGE { + [u16; 1], + AsUshort16 AsUshort16_mut: USHORT, + Usb20PortChange Usb20PortChange_mut: USB_20_PORT_CHANGE, + Usb30PortChange Usb30PortChange_mut: USB_30_PORT_CHANGE, +}} +pub type PUSB_PORT_CHANGE = *mut USB_PORT_CHANGE; +STRUCT!{#[repr(packed)] struct USB_PORT_EXT_STATUS { + AsUlong32: ULONG, +}} +BITFIELD!{USB_PORT_EXT_STATUS AsUlong32: ULONG [ + RxSublinkSpeedID set_RxSublinkSpeedID[0..4], + TxSublinkSpeedID set_TxSublinkSpeedID[4..8], + RxLaneCount set_RxLaneCount[8..12], + TxLaneCount set_TxLaneCount[12..16], + Reserved set_Reserved[16..32], +]} +pub type PUSB_PORT_EXT_STATUS = *mut USB_PORT_EXT_STATUS; +STRUCT!{#[repr(packed)] struct USB_PORT_STATUS_AND_CHANGE_s { + PortStatus: USB_PORT_STATUS, + PortChange: USB_PORT_CHANGE, +}} +UNION!{#[repr(packed)] union USB_PORT_STATUS_AND_CHANGE { + [u32; 1], + AsUlong32 AsUlong32_mut: ULONG, + s s_mut: USB_PORT_STATUS_AND_CHANGE_s, +}} +pub type PUSB_PORT_STATUS_AND_CHANGE = *mut USB_PORT_STATUS_AND_CHANGE; +STRUCT!{#[repr(packed)] struct USB_PORT_EXT_STATUS_AND_CHANGE_s { + PortStatusChange: USB_PORT_STATUS_AND_CHANGE, + PortExtStatus: USB_PORT_EXT_STATUS, +}} +UNION!{#[repr(packed)] union USB_PORT_EXT_STATUS_AND_CHANGE { + [u64; 1], + AsUlong64 AsUlong64_mut: ULONG64, + s s_mut: USB_PORT_EXT_STATUS_AND_CHANGE_s, +}} +pub type PUSB_PORT_EXT_STATUS_AND_CHANGE = *mut USB_PORT_EXT_STATUS_AND_CHANGE; +STRUCT!{#[repr(packed)] struct USB_HUB_30_PORT_REMOTE_WAKE_MASK { + AsUchar8: UCHAR, +}} +BITFIELD!{USB_HUB_30_PORT_REMOTE_WAKE_MASK AsUchar8: UCHAR [ + ConnectRemoteWakeEnable set_ConnectRemoteWakeEnable[0..1], + DisconnectRemoteWakeEnable set_DisconnectRemoteWakeEnable[1..2], + OverCurrentRemoteWakeEnable set_OverCurrentRemoteWakeEnable[2..3], + Reserved0 set_Reserved0[3..8], +]} +pub type PUSB_HUB_30_PORT_REMOTE_WAKE_MASK = *mut USB_HUB_30_PORT_REMOTE_WAKE_MASK; +STRUCT!{#[repr(packed)] struct USB_FUNCTION_SUSPEND_OPTIONS { + AsUchar: UCHAR, +}} +BITFIELD!{USB_FUNCTION_SUSPEND_OPTIONS AsUchar: UCHAR [ + PowerState set_PowerState[0..1], + RemoteWakeEnabled set_RemoteWakeEnabled[1..2], + Reserved0 set_Reserved0[2..8], +]} +pub type PUSB_FUNCTION_SUSPEND_OPTIONS = *mut USB_FUNCTION_SUSPEND_OPTIONS; +pub const USB_FEATURE_INTERFACE_POWER_D0: USHORT = 0x0002; +pub const USB_FEATURE_INTERFACE_POWER_D1: USHORT = 0x0003; +pub const USB_FEATURE_INTERFACE_POWER_D2: USHORT = 0x0004; +pub const USB_FEATURE_INTERFACE_POWER_D3: USHORT = 0x0005; +pub const USB_SUPPORT_D0_COMMAND: UCHAR = 0x01; +pub const USB_SUPPORT_D1_COMMAND: UCHAR = 0x02; +pub const USB_SUPPORT_D2_COMMAND: UCHAR = 0x04; +pub const USB_SUPPORT_D3_COMMAND: UCHAR = 0x08; +pub const USB_SUPPORT_D1_WAKEUP: UCHAR = 0x10; +pub const USB_SUPPORT_D2_WAKEUP: UCHAR = 0x20; +STRUCT!{#[repr(packed)] struct USB_CONFIGURATION_POWER_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + SelfPowerConsumedD0: [UCHAR; 3], + bPowerSummaryId: UCHAR, + bBusPowerSavingD1: UCHAR, + bSelfPowerSavingD1: UCHAR, + bBusPowerSavingD2: UCHAR, + bSelfPowerSavingD2: UCHAR, + bBusPowerSavingD3: UCHAR, + bSelfPowerSavingD3: UCHAR, + TransitionTimeFromD1: USHORT, + TransitionTimeFromD2: USHORT, + TransitionTimeFromD3: USHORT, +}} +pub type PUSB_CONFIGURATION_POWER_DESCRIPTOR = *mut USB_CONFIGURATION_POWER_DESCRIPTOR; +STRUCT!{#[repr(packed)] struct USB_INTERFACE_POWER_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bmCapabilitiesFlags: UCHAR, + bBusPowerSavingD1: UCHAR, + bSelfPowerSavingD1: UCHAR, + bBusPowerSavingD2: UCHAR, + bSelfPowerSavingD2: UCHAR, + bBusPowerSavingD3: UCHAR, + bSelfPowerSavingD3: UCHAR, + TransitionTimeFromD1: USHORT, + TransitionTimeFromD2: USHORT, + TransitionTimeFromD3: USHORT, +}} +pub type PUSB_INTERFACE_POWER_DESCRIPTOR = *mut USB_INTERFACE_POWER_DESCRIPTOR; diff --git a/bash-5.1/vendor/winapi/src/shared/windef.rs b/bash-5.1/vendor/winapi/src/shared/windef.rs new file mode 100644 index 0000000000000000000000000000000000000000..d2e5fe01c0443522a9312968537c398af1f724a2 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/windef.rs @@ -0,0 +1,125 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Basic Windows Type Definitions +use ctypes::c_void; +use shared::minwindef::{DWORD, HFILE, WORD}; +use um::winnt::{LONG, SHORT}; +DECLARE_HANDLE!{HWND, HWND__} +DECLARE_HANDLE!{HHOOK, HHOOK__} +pub type HGDIOBJ = *mut c_void; +DECLARE_HANDLE!{HACCEL, HACCEL__} +DECLARE_HANDLE!{HBITMAP, HBITMAP__} +DECLARE_HANDLE!{HBRUSH, HBRUSH__} +DECLARE_HANDLE!{HCOLORSPACE, HCOLORSPACE__} +DECLARE_HANDLE!{HDC, HDC__} +DECLARE_HANDLE!{HGLRC, HGLRC__} +DECLARE_HANDLE!{HDESK, HDESK__} +DECLARE_HANDLE!{HENHMETAFILE, HENHMETAFILE__} +DECLARE_HANDLE!{HFONT, HFONT__} +DECLARE_HANDLE!{HICON, HICON__} +DECLARE_HANDLE!{HMENU, HMENU__} +DECLARE_HANDLE!{HPALETTE, HPALETTE__} +DECLARE_HANDLE!{HPEN, HPEN__} +DECLARE_HANDLE!{HWINEVENTHOOK, HWINEVENTHOOK__} +DECLARE_HANDLE!{HMONITOR, HMONITOR__} +DECLARE_HANDLE!{HUMPD, HUMPD__} +pub type HCURSOR = HICON; +pub type COLORREF = DWORD; +pub type LPCOLORREF = *mut DWORD; +pub const HFILE_ERROR: HFILE = -1; +STRUCT!{#[debug] struct RECT { + left: LONG, + top: LONG, + right: LONG, + bottom: LONG, +}} +pub type PRECT = *mut RECT; +pub type NPRECT = *mut RECT; +pub type LPRECT = *mut RECT; +pub type LPCRECT = *const RECT; +STRUCT!{#[debug] struct RECTL { + left: LONG, + top: LONG, + right: LONG, + bottom: LONG, +}} +pub type PRECTL = *mut RECTL; +pub type LPRECTL = *mut RECTL; +pub type LPCRECTL = *const RECTL; +STRUCT!{struct POINT { + x: LONG, + y: LONG, +}} +pub type PPOINT = *mut POINT; +pub type NPPOINT = *mut POINT; +pub type LPPOINT = *mut POINT; +STRUCT!{struct POINTL { + x: LONG, + y: LONG, +}} +pub type PPOINTL = *mut POINTL; +STRUCT!{struct SIZE { + cx: LONG, + cy: LONG, +}} +pub type PSIZE = *mut SIZE; +pub type LPSIZE = *mut SIZE; +pub type SIZEL = SIZE; +pub type PSIZEL = *mut SIZE; +pub type LPSIZEL = *mut SIZE; +STRUCT!{struct POINTS { + x: SHORT, + y: SHORT, +}} +pub type PPOINTS = *mut POINTS; +pub type LPPOINTS = *mut POINTS; +pub const DM_UPDATE: WORD = 1; +pub const DM_COPY: WORD = 2; +pub const DM_PROMPT: WORD = 4; +pub const DM_MODIFY: WORD = 8; +pub const DM_IN_BUFFER: WORD = DM_MODIFY; +pub const DM_IN_PROMPT: WORD = DM_PROMPT; +pub const DM_OUT_BUFFER: WORD = DM_COPY; +pub const DM_OUT_DEFAULT: WORD = DM_UPDATE; +pub const DC_FIELDS: DWORD = 1; +pub const DC_PAPERS: DWORD = 2; +pub const DC_PAPERSIZE: DWORD = 3; +pub const DC_MINEXTENT: DWORD = 4; +pub const DC_MAXEXTENT: DWORD = 5; +pub const DC_BINS: DWORD = 6; +pub const DC_DUPLEX: DWORD = 7; +pub const DC_SIZE: DWORD = 8; +pub const DC_EXTRA: DWORD = 9; +pub const DC_VERSION: DWORD = 10; +pub const DC_DRIVER: DWORD = 11; +pub const DC_BINNAMES: DWORD = 12; +pub const DC_ENUMRESOLUTIONS: DWORD = 13; +pub const DC_FILEDEPENDENCIES: DWORD = 14; +pub const DC_TRUETYPE: DWORD = 15; +pub const DC_PAPERNAMES: DWORD = 16; +pub const DC_ORIENTATION: DWORD = 17; +pub const DC_COPIES: DWORD = 18; +DECLARE_HANDLE!{DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT__} +ENUM!{enum DPI_AWARENESS { + DPI_AWARENESS_INVALID = -1i32 as u32, + DPI_AWARENESS_UNAWARE = 0, + DPI_AWARENESS_SYSTEM_AWARE = 1, + DPI_AWARENESS_PER_MONITOR_AWARE = 2, +}} +pub const DPI_AWARENESS_CONTEXT_UNAWARE: DPI_AWARENESS_CONTEXT = -1isize as DPI_AWARENESS_CONTEXT; +pub const DPI_AWARENESS_CONTEXT_SYSTEM_AWARE: DPI_AWARENESS_CONTEXT + = -2isize as DPI_AWARENESS_CONTEXT; +pub const DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE: DPI_AWARENESS_CONTEXT + = -3isize as DPI_AWARENESS_CONTEXT; +pub const DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2: DPI_AWARENESS_CONTEXT + = -4isize as DPI_AWARENESS_CONTEXT; +pub const DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED: DPI_AWARENESS_CONTEXT + = -5isize as DPI_AWARENESS_CONTEXT; +ENUM!{enum DPI_HOSTING_BEHAVIOR { + DPI_HOSTING_BEHAVIOR_INVALID = -1i32 as u32, + DPI_HOSTING_BEHAVIOR_DEFAULT = 0, + DPI_HOSTING_BEHAVIOR_MIXED = 1, +}} diff --git a/bash-5.1/vendor/winapi/src/shared/windot11.rs b/bash-5.1/vendor/winapi/src/shared/windot11.rs new file mode 100644 index 0000000000000000000000000000000000000000..4e483047f5683b7c6fd842f11fc50fda1c089dbd --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/windot11.rs @@ -0,0 +1,2853 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Definitions for native 802.11 miniport driver specifications. +use shared::basetsd::UINT8; +use shared::minwindef::{UCHAR, ULONG, USHORT}; +use shared::ntddndis::{ + NDIS_OBJECT_HEADER, NDIS_PACKET_TYPE_ALL_MULTICAST, NDIS_PACKET_TYPE_BROADCAST, + NDIS_PACKET_TYPE_DIRECTED, NDIS_PACKET_TYPE_MULTICAST, NDIS_PACKET_TYPE_PROMISCUOUS, + NDIS_STATUS, +}; +use shared::wlantypes::{ + DOT11_AUTH_ALGORITHM, DOT11_AUTH_CIPHER_PAIR, DOT11_BSS_TYPE, DOT11_CIPHER_ALGORITHM, + DOT11_SSID, PDOT11_AUTH_CIPHER_PAIR, +}; +use um::winnt::{BOOLEAN, HANDLE, LARGE_INTEGER, LONG, PVOID, ULONGLONG}; +pub type DOT11_MAC_ADDRESS = [UCHAR; 6]; +pub type PDOT11_MAC_ADDRESS = *mut DOT11_MAC_ADDRESS; +STRUCT!{struct DOT11_BSSID_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + BSSIDs: [DOT11_MAC_ADDRESS; 1], +}} +pub type PDOT11_BSSID_LIST = *mut DOT11_BSSID_LIST; +pub const DOT11_BSSID_LIST_REVISION_1: UCHAR = 1; +pub const DOT11_HESSID_LENGTH: usize = 6; +pub type DOT11_HESSID = [UCHAR; DOT11_HESSID_LENGTH]; +pub type PDOT11_HESSID = *mut DOT11_HESSID; +ENUM!{enum DOT11_PHY_TYPE { + dot11_phy_type_unknown = 0, + dot11_phy_type_any = dot11_phy_type_unknown, + dot11_phy_type_fhss = 1, + dot11_phy_type_dsss = 2, + dot11_phy_type_irbaseband = 3, + dot11_phy_type_ofdm = 4, + dot11_phy_type_hrdsss = 5, + dot11_phy_type_erp = 6, + dot11_phy_type_ht = 7, + dot11_phy_type_vht = 8, + dot11_phy_type_dmg = 9, + dot11_phy_type_IHV_start = 0x80000000, + dot11_phy_type_IHV_end = 0xffffffff, +}} +pub type PDOT11_PHY_TYPE = *mut DOT11_PHY_TYPE; +pub const DOT11_RATE_SET_MAX_LENGTH: usize = 126; +STRUCT!{struct DOT11_RATE_SET { + uRateSetLength: ULONG, + ucRateSet: [UCHAR; DOT11_RATE_SET_MAX_LENGTH], +}} +pub type PDOT11_RATE_SET = *mut DOT11_RATE_SET; +pub type DOT11_COUNTRY_OR_REGION_STRING = [UCHAR; 3]; +pub type PDOT11_COUNTRY_OR_REGION_STRING = *mut DOT11_COUNTRY_OR_REGION_STRING; +pub type DOT11_DIALOG_TOKEN = UCHAR; +pub type DOT11_WFD_STATUS_CODE = UCHAR; +pub type DOT11_WFD_MINOR_REASON_CODE = UCHAR; +pub type DOT11_WFD_SERVICE_HASH = [UCHAR; 6]; +pub const DOT11_WFD_SERVICE_NAME_MAX_LENGTH: usize = 255; +pub const DOT11_WFD_APS2_SERVICE_TYPE_MAX_LENGTH: usize = 21; +pub const DOT11_WFD_ASP2_INSTANCE_NAME_MAX_LENGTH: usize = 63; +pub const DOT11_WFD_SERVICE_INFORMATION_MAX_LENGTH: usize = 65535; +pub const DOT11_MAX_REQUESTED_SERVICE_INFORMATION_LENGTH: usize = 255; +pub const DOT11_WFD_SESSION_INFO_MAX_LENGTH: usize = 144; +STRUCT!{struct DOT11_WFD_SESSION_INFO { + uSessionInfoLength: USHORT, + ucSessionInfo: [UCHAR; DOT11_WFD_SESSION_INFO_MAX_LENGTH], +}} +pub type PDOT11_WFD_SESSION_INFO = *mut DOT11_WFD_SESSION_INFO; +pub const NDIS_PACKET_TYPE_MEDIA_SPECIFIC_MASK: u32 = 0x0fff0000; +pub const NDIS_PACKET_TYPE_802_11_DIRECTED_DATA: u32 = NDIS_PACKET_TYPE_DIRECTED; +pub const NDIS_PACKET_TYPE_802_11_BROADCAST_DATA: u32 = NDIS_PACKET_TYPE_BROADCAST; +pub const NDIS_PACKET_TYPE_802_11_MULTICAST_DATA: u32 = NDIS_PACKET_TYPE_MULTICAST; +pub const NDIS_PACKET_TYPE_802_11_ALL_MULTICAST_DATA: u32 = NDIS_PACKET_TYPE_ALL_MULTICAST; +pub const NDIS_PACKET_TYPE_802_11_PROMISCUOUS_DATA: u32 = NDIS_PACKET_TYPE_PROMISCUOUS; +pub const NDIS_PACKET_TYPE_802_11_RAW_DATA: u32 = 0x00010000; +pub const NDIS_PACKET_TYPE_802_11_DIRECTED_MGMT: u32 = 0x00020000; +pub const NDIS_PACKET_TYPE_802_11_BROADCAST_MGMT: u32 = 0x00040000; +pub const NDIS_PACKET_TYPE_802_11_MULTICAST_MGMT: u32 = 0x00080000; +pub const NDIS_PACKET_TYPE_802_11_ALL_MULTICAST_MGMT: u32 = 0x00100000; +pub const NDIS_PACKET_TYPE_802_11_PROMISCUOUS_MGMT: u32 = 0x00200000; +pub const NDIS_PACKET_TYPE_802_11_RAW_MGMT: u32 = 0x00400000; +pub const NDIS_PACKET_TYPE_802_11_DIRECTED_CTRL: u32 = 0x00800000; +pub const NDIS_PACKET_TYPE_802_11_BROADCAST_CTRL: u32 = 0x01000000; +pub const NDIS_PACKET_TYPE_802_11_PROMISCUOUS_CTRL: u32 = 0x02000000; +pub const NDIS_PACKET_TYPE_ALL_802_11_FILTERS: u32 = NDIS_PACKET_TYPE_DIRECTED + | NDIS_PACKET_TYPE_MULTICAST | NDIS_PACKET_TYPE_ALL_MULTICAST | NDIS_PACKET_TYPE_BROADCAST + | NDIS_PACKET_TYPE_PROMISCUOUS | NDIS_PACKET_TYPE_802_11_RAW_DATA + | NDIS_PACKET_TYPE_802_11_DIRECTED_MGMT | NDIS_PACKET_TYPE_802_11_BROADCAST_MGMT + | NDIS_PACKET_TYPE_802_11_MULTICAST_MGMT | NDIS_PACKET_TYPE_802_11_ALL_MULTICAST_MGMT + | NDIS_PACKET_TYPE_802_11_PROMISCUOUS_MGMT | NDIS_PACKET_TYPE_802_11_RAW_MGMT + | NDIS_PACKET_TYPE_802_11_DIRECTED_CTRL | NDIS_PACKET_TYPE_802_11_BROADCAST_CTRL + | NDIS_PACKET_TYPE_802_11_PROMISCUOUS_CTRL; +pub const DOT11_MAX_PDU_SIZE: i32 = 2346; +pub const DOT11_MIN_PDU_SIZE: i32 = 256; +pub const DOT11_MAX_NUM_DEFAULT_KEY: i32 = 4; +pub const DOT11_MAX_NUM_DEFAULT_KEY_MFP: i32 = DOT11_MAX_NUM_DEFAULT_KEY + 2; +pub const OID_DOT11_NDIS_START: u32 = 0x0D010300; +pub const NWF_MANDATORY_OID: u32 = 0x01; +pub const NWF_OPTIONAL_OID: u32 = 0x02; +pub const NWF_OPERATIONAL_OID: u32 = 0x01; +pub const NWF_STATISTICS_OID: u32 = 0x02; +#[inline] +pub fn NWF_DEFINE_OID(Seq: u32, o: u32, m: u32) -> u32 { + 0x0E000000 | (o << 16) | (m << 8) | Seq +} +macro_rules! NWF_DEFINE_OID { + ($Seq:expr, $o:expr, $m:expr) => { 0x0E000000 | $o << 16 | $m << 8 | $Seq }; +} +pub const OID_DOT11_OFFLOAD_CAPABILITY: u32 = OID_DOT11_NDIS_START + 0; +pub const DOT11_HW_WEP_SUPPORTED_TX: u32 = 0x00000001; +pub const DOT11_HW_WEP_SUPPORTED_RX: u32 = 0x00000002; +pub const DOT11_HW_FRAGMENTATION_SUPPORTED: u32 = 0x00000004; +pub const DOT11_HW_DEFRAGMENTATION_SUPPORTED: u32 = 0x00000008; +pub const DOT11_HW_MSDU_AUTH_SUPPORTED_TX: u32 = 0x00000010; +pub const DOT11_HW_MSDU_AUTH_SUPPORTED_RX: u32 = 0x00000020; +pub const DOT11_CONF_ALGO_WEP_RC4: u32 = 0x00000001; +pub const DOT11_CONF_ALGO_TKIP: u32 = 0x00000002; +pub const DOT11_AUTH_ALGO_MICHAEL: u32 = 0x00000001; +STRUCT!{struct DOT11_OFFLOAD_CAPABILITY { + uReserved: ULONG, + uFlags: ULONG, + uSupportedWEPAlgorithms: ULONG, + uNumOfReplayWindows: ULONG, + uMaxWEPKeyMappingLength: ULONG, + uSupportedAuthAlgorithms: ULONG, + uMaxAuthKeyMappingLength: ULONG, +}} +pub type PDOT11_OFFLOAD_CAPABILITY = *mut DOT11_OFFLOAD_CAPABILITY; +pub const OID_DOT11_CURRENT_OFFLOAD_CAPABILITY: u32 = OID_DOT11_NDIS_START + 1; +STRUCT!{struct DOT11_CURRENT_OFFLOAD_CAPABILITY { + uReserved: ULONG, + uFlags: ULONG, +}} +pub type PDOT11_CURRENT_OFFLOAD_CAPABILITY = *mut DOT11_CURRENT_OFFLOAD_CAPABILITY; +pub const OID_DOT11_WEP_OFFLOAD: u32 = OID_DOT11_NDIS_START + 2; +ENUM!{enum DOT11_OFFLOAD_TYPE { + dot11_offload_type_wep = 1, + dot11_offload_type_auth = 2, +}} +pub type PDOT11_OFFLOAD_TYPE = *mut DOT11_OFFLOAD_TYPE; +STRUCT!{struct DOT11_IV48_COUNTER { + uIV32Counter: ULONG, + usIV16Counter: USHORT, +}} +pub type PDOT11_IV48_COUNTER = *mut DOT11_IV48_COUNTER; +STRUCT!{struct DOT11_WEP_OFFLOAD { + uReserved: ULONG, + hOffloadContext: HANDLE, + hOffload: HANDLE, + dot11OffloadType: DOT11_OFFLOAD_TYPE, + dwAlgorithm: ULONG, + bRowIsOutbound: BOOLEAN, + bUseDefault: BOOLEAN, + uFlags: ULONG, + ucMacAddress: [UCHAR; 6], + uNumOfRWsOnPeer: ULONG, + uNumOfRWsOnMe: ULONG, + dot11IV48Counters: [DOT11_IV48_COUNTER; 16], + usDot11RWBitMaps: [USHORT; 16], + usKeyLength: USHORT, + ucKey: [UCHAR; 1], +}} +pub type PDOT11_WEP_OFFLOAD = *mut DOT11_WEP_OFFLOAD; +pub const OID_DOT11_WEP_UPLOAD: u32 = OID_DOT11_NDIS_START + 3; +STRUCT!{struct DOT11_WEP_UPLOAD { + uReserved: ULONG, + dot11OffloadType: DOT11_OFFLOAD_TYPE, + hOffload: HANDLE, + uNumOfRWsUsed: ULONG, + dot11IV48Counters: [DOT11_IV48_COUNTER; 16], + usDot11RWBitMaps: [USHORT; 16], +}} +pub type PDOT11_WEP_UPLOAD = *mut DOT11_WEP_UPLOAD; +pub const OID_DOT11_DEFAULT_WEP_OFFLOAD: u32 = OID_DOT11_NDIS_START + 4; +ENUM!{enum DOT11_KEY_DIRECTION { + dot11_key_direction_both = 1, + dot11_key_direction_inbound = 2, + dot11_key_direction_outbound = 3, +}} +pub type PDOT11_KEY_DIRECTION = *mut DOT11_KEY_DIRECTION; +STRUCT!{struct DOT11_DEFAULT_WEP_OFFLOAD { + uReserved: ULONG, + hOffloadContext: HANDLE, + hOffload: HANDLE, + dwIndex: ULONG, + dot11OffloadType: DOT11_OFFLOAD_TYPE, + dwAlgorithm: ULONG, + uFlags: ULONG, + dot11KeyDirection: DOT11_KEY_DIRECTION, + ucMacAddress: [UCHAR; 6], + uNumOfRWsOnMe: ULONG, + dot11IV48Counters: [DOT11_IV48_COUNTER; 16], + usDot11RWBitMaps: [USHORT; 16], + usKeyLength: USHORT, + ucKey: [UCHAR; 1], +}} +pub type PDOT11_DEFAULT_WEP_OFFLOAD = *mut DOT11_DEFAULT_WEP_OFFLOAD; +pub const OID_DOT11_DEFAULT_WEP_UPLOAD: u32 = OID_DOT11_NDIS_START + 5; +STRUCT!{struct DOT11_DEFAULT_WEP_UPLOAD { + uReserved: ULONG, + dot11OffloadType: DOT11_OFFLOAD_TYPE, + hOffload: HANDLE, + uNumOfRWsUsed: ULONG, + dot11IV48Counters: [DOT11_IV48_COUNTER; 16], + usDot11RWBitMaps: [USHORT; 16], +}} +pub type PDOT11_DEFAULT_WEP_UPLOAD = *mut DOT11_DEFAULT_WEP_UPLOAD; +pub const OID_DOT11_MPDU_MAX_LENGTH: u32 = OID_DOT11_NDIS_START + 6; +pub const OID_DOT11_OPERATION_MODE_CAPABILITY: u32 = OID_DOT11_NDIS_START + 7; +pub const DOT11_OPERATION_MODE_UNKNOWN: ULONG = 0x00000000; +pub const DOT11_OPERATION_MODE_STATION: ULONG = 0x00000001; +pub const DOT11_OPERATION_MODE_AP: ULONG = 0x00000002; +pub const DOT11_OPERATION_MODE_EXTENSIBLE_STATION: ULONG = 0x00000004; +pub const DOT11_OPERATION_MODE_EXTENSIBLE_AP: ULONG = 0x00000008; +pub const DOT11_OPERATION_MODE_WFD_DEVICE: ULONG = 0x00000010; +pub const DOT11_OPERATION_MODE_WFD_GROUP_OWNER: ULONG = 0x00000020; +pub const DOT11_OPERATION_MODE_WFD_CLIENT: ULONG = 0x00000040; +pub const DOT11_OPERATION_MODE_MANUFACTURING: ULONG = 0x40000000; +pub const DOT11_OPERATION_MODE_NETWORK_MONITOR: ULONG = 0x80000000; +STRUCT!{struct DOT11_OPERATION_MODE_CAPABILITY { + uReserved: ULONG, + uMajorVersion: ULONG, + uMinorVersion: ULONG, + uNumOfTXBuffers: ULONG, + uNumOfRXBuffers: ULONG, + uOpModeCapability: ULONG, +}} +pub type PDOT11_OPERATION_MODE_CAPABILITY = *mut DOT11_OPERATION_MODE_CAPABILITY; +pub const OID_DOT11_CURRENT_OPERATION_MODE: u32 = OID_DOT11_NDIS_START + 8; +STRUCT!{struct DOT11_CURRENT_OPERATION_MODE { + uReserved: ULONG, + uCurrentOpMode: ULONG, +}} +pub type PDOT11_CURRENT_OPERATION_MODE = *mut DOT11_CURRENT_OPERATION_MODE; +pub const OID_DOT11_CURRENT_PACKET_FILTER: u32 = OID_DOT11_NDIS_START + 9; +pub const DOT11_PACKET_TYPE_DIRECTED_CTRL: u32 = 0x00000001; +pub const DOT11_PACKET_TYPE_DIRECTED_MGMT: u32 = 0x00000002; +pub const DOT11_PACKET_TYPE_DIRECTED_DATA: u32 = 0x00000004; +pub const DOT11_PACKET_TYPE_MULTICAST_CTRL: u32 = 0x00000008; +pub const DOT11_PACKET_TYPE_MULTICAST_MGMT: u32 = 0x00000010; +pub const DOT11_PACKET_TYPE_MULTICAST_DATA: u32 = 0x00000020; +pub const DOT11_PACKET_TYPE_BROADCAST_CTRL: u32 = 0x00000040; +pub const DOT11_PACKET_TYPE_BROADCAST_MGMT: u32 = 0x00000080; +pub const DOT11_PACKET_TYPE_BROADCAST_DATA: u32 = 0x00000100; +pub const DOT11_PACKET_TYPE_PROMISCUOUS_CTRL: u32 = 0x00000200; +pub const DOT11_PACKET_TYPE_PROMISCUOUS_MGMT: u32 = 0x00000400; +pub const DOT11_PACKET_TYPE_PROMISCUOUS_DATA: u32 = 0x00000800; +pub const DOT11_PACKET_TYPE_ALL_MULTICAST_CTRL: u32 = 0x00001000; +pub const DOT11_PACKET_TYPE_ALL_MULTICAST_MGMT: u32 = 0x00002000; +pub const DOT11_PACKET_TYPE_ALL_MULTICAST_DATA: u32 = 0x00004000; +pub const DOT11_PACKET_TYPE_RESERVED: u32 = !(DOT11_PACKET_TYPE_DIRECTED_CTRL + | DOT11_PACKET_TYPE_DIRECTED_MGMT | DOT11_PACKET_TYPE_DIRECTED_DATA + | DOT11_PACKET_TYPE_MULTICAST_CTRL | DOT11_PACKET_TYPE_MULTICAST_MGMT + | DOT11_PACKET_TYPE_MULTICAST_DATA | DOT11_PACKET_TYPE_BROADCAST_CTRL + | DOT11_PACKET_TYPE_BROADCAST_MGMT | DOT11_PACKET_TYPE_BROADCAST_DATA + | DOT11_PACKET_TYPE_PROMISCUOUS_CTRL | DOT11_PACKET_TYPE_PROMISCUOUS_MGMT + | DOT11_PACKET_TYPE_PROMISCUOUS_DATA | DOT11_PACKET_TYPE_ALL_MULTICAST_CTRL + | DOT11_PACKET_TYPE_ALL_MULTICAST_MGMT | DOT11_PACKET_TYPE_ALL_MULTICAST_DATA | 0); +pub const OID_DOT11_ATIM_WINDOW: u32 = OID_DOT11_NDIS_START + 10; +pub const OID_DOT11_SCAN_REQUEST: u32 = OID_DOT11_NDIS_START + 11; +ENUM!{enum DOT11_SCAN_TYPE { + dot11_scan_type_active = 1, + dot11_scan_type_passive = 2, + dot11_scan_type_auto = 3, + dot11_scan_type_forced = 0x80000000, +}} +pub type PDOT11_SCAN_TYPE = *mut DOT11_SCAN_TYPE; +STRUCT!{struct DOT11_SCAN_REQUEST { + dot11BSSType: DOT11_BSS_TYPE, + dot11BSSID: DOT11_MAC_ADDRESS, + dot11SSID: DOT11_SSID, + dot11ScanType: DOT11_SCAN_TYPE, + bRestrictedScan: BOOLEAN, + bUseRequestIE: BOOLEAN, + uRequestIDsOffset: ULONG, + uNumOfRequestIDs: ULONG, + uPhyTypesOffset: ULONG, + uNumOfPhyTypes: ULONG, + uIEsOffset: ULONG, + uIEsLength: ULONG, + ucBuffer: [UCHAR; 1], +}} +pub type PDOT11_SCAN_REQUEST = *mut DOT11_SCAN_REQUEST; +ENUM!{enum CH_DESCRIPTION_TYPE { + ch_description_type_logical = 1, + ch_description_type_center_frequency = 2, + ch_description_type_phy_specific = 3, +}} +pub type PCH_DESCRIPTION_TYPE = *mut CH_DESCRIPTION_TYPE; +STRUCT!{struct DOT11_PHY_TYPE_INFO { + dot11PhyType: DOT11_PHY_TYPE, + bUseParameters: BOOLEAN, + uProbeDelay: ULONG, + uMinChannelTime: ULONG, + uMaxChannelTime: ULONG, + ChDescriptionType: CH_DESCRIPTION_TYPE, + uChannelListSize: ULONG, + ucChannelListBuffer: [UCHAR; 1], +}} +pub type PDOT11_PHY_TYPE_INFO = *mut DOT11_PHY_TYPE_INFO; +STRUCT!{struct DOT11_SCAN_REQUEST_V2 { + dot11BSSType: DOT11_BSS_TYPE, + dot11BSSID: DOT11_MAC_ADDRESS, + dot11ScanType: DOT11_SCAN_TYPE, + bRestrictedScan: BOOLEAN, + udot11SSIDsOffset: ULONG, + uNumOfdot11SSIDs: ULONG, + bUseRequestIE: BOOLEAN, + uRequestIDsOffset: ULONG, + uNumOfRequestIDs: ULONG, + uPhyTypeInfosOffset: ULONG, + uNumOfPhyTypeInfos: ULONG, + uIEsOffset: ULONG, + uIEsLength: ULONG, + ucBuffer: [UCHAR; 1], +}} +pub type PDOT11_SCAN_REQUEST_V2 = *mut DOT11_SCAN_REQUEST_V2; +pub const OID_DOT11_CURRENT_PHY_TYPE: u32 = OID_DOT11_NDIS_START + 12; +STRUCT!{struct DOT11_PHY_TYPE_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11PhyType: [DOT11_PHY_TYPE; 1], +}} +pub type PDOT11_PHY_TYPE_LIST = *mut DOT11_PHY_TYPE_LIST; +pub const DOT11_PHY_TYPE_LIST_REVISION_1: UCHAR = 1; +pub const OID_DOT11_JOIN_REQUEST: u32 = OID_DOT11_NDIS_START + 13; +pub const DOT11_CAPABILITY_INFO_ESS: USHORT = 0x0001; +pub const DOT11_CAPABILITY_INFO_IBSS: USHORT = 0x0002; +pub const DOT11_CAPABILITY_INFO_CF_POLLABLE: USHORT = 0x0004; +pub const DOT11_CAPABILITY_INFO_CF_POLL_REQ: USHORT = 0x0008; +pub const DOT11_CAPABILITY_INFO_PRIVACY: USHORT = 0x0010; +pub const DOT11_CAPABILITY_SHORT_PREAMBLE: USHORT = 0x0020; +pub const DOT11_CAPABILITY_PBCC: USHORT = 0x0040; +pub const DOT11_CAPABILITY_CHANNEL_AGILITY: USHORT = 0x0080; +pub const DOT11_CAPABILITY_SHORT_SLOT_TIME: USHORT = 0x0400; +pub const DOT11_CAPABILITY_DSSSOFDM: USHORT = 0x2000; +STRUCT!{struct DOT11_BSS_DESCRIPTION { + uReserved: ULONG, + dot11BSSID: DOT11_MAC_ADDRESS, + dot11BSSType: DOT11_BSS_TYPE, + usBeaconPeriod: USHORT, + ullTimestamp: ULONGLONG, + usCapabilityInformation: USHORT, + uBufferLength: ULONG, + ucBuffer: [UCHAR; 1], +}} +pub type PDOT11_BSS_DESCRIPTION = *mut DOT11_BSS_DESCRIPTION; +STRUCT!{struct DOT11_JOIN_REQUEST { + uJoinFailureTimeout: ULONG, + OperationalRateSet: DOT11_RATE_SET, + uChCenterFrequency: ULONG, + dot11BSSDescription: DOT11_BSS_DESCRIPTION, +}} +pub type PDOT11_JOIN_REQUEST = *mut DOT11_JOIN_REQUEST; +pub const OID_DOT11_START_REQUEST: u32 = OID_DOT11_NDIS_START + 14; +STRUCT!{struct DOT11_START_REQUEST { + uStartFailureTimeout: ULONG, + OperationalRateSet: DOT11_RATE_SET, + uChCenterFrequency: ULONG, + dot11BSSDescription: DOT11_BSS_DESCRIPTION, +}} +pub type PDOT11_START_REQUEST = *mut DOT11_START_REQUEST; +pub const OID_DOT11_UPDATE_IE: u32 = OID_DOT11_NDIS_START + 15; +ENUM!{enum DOT11_UPDATE_IE_OP { + dot11_update_ie_op_create_replace = 1, + dot11_update_ie_op_delete = 2, +}} +pub type PDOT11_UPDATE_IE_OP = *mut DOT11_UPDATE_IE_OP; +STRUCT!{struct DOT11_UPDATE_IE { + dot11UpdateIEOp: DOT11_UPDATE_IE_OP, + uBufferLength: ULONG, + ucBuffer: [UCHAR; 1], +}} +pub type PDOT11_UPDATE_IE = *mut DOT11_UPDATE_IE; +pub const OID_DOT11_RESET_REQUEST: u32 = OID_DOT11_NDIS_START + 16; +ENUM!{enum DOT11_RESET_TYPE { + dot11_reset_type_phy = 1, + dot11_reset_type_mac = 2, + dot11_reset_type_phy_and_mac = 3, +}} +pub type PDOT11_RESET_TYPE = *mut DOT11_RESET_TYPE; +STRUCT!{struct DOT11_RESET_REQUEST { + dot11ResetType: DOT11_RESET_TYPE, + dot11MacAddress: DOT11_MAC_ADDRESS, + bSetDefaultMIB: BOOLEAN, +}} +pub type PDOT11_RESET_REQUEST = *mut DOT11_RESET_REQUEST; +pub const OID_DOT11_NIC_POWER_STATE: u32 = OID_DOT11_NDIS_START + 17; +pub const OID_DOT11_OPTIONAL_CAPABILITY: u32 = OID_DOT11_NDIS_START + 18; +STRUCT!{struct DOT11_OPTIONAL_CAPABILITY { + uReserved: ULONG, + bDot11PCF: BOOLEAN, + bDot11PCFMPDUTransferToPC: BOOLEAN, + bStrictlyOrderedServiceClass: BOOLEAN, +}} +pub type PDOT11_OPTIONAL_CAPABILITY = *mut DOT11_OPTIONAL_CAPABILITY; +pub const OID_DOT11_CURRENT_OPTIONAL_CAPABILITY: u32 = OID_DOT11_NDIS_START + 19; +STRUCT!{struct DOT11_CURRENT_OPTIONAL_CAPABILITY { + uReserved: ULONG, + bDot11CFPollable: BOOLEAN, + bDot11PCF: BOOLEAN, + bDot11PCFMPDUTransferToPC: BOOLEAN, + bStrictlyOrderedServiceClass: BOOLEAN, +}} +pub type PDOT11_CURRENT_OPTIONAL_CAPABILITY = *mut DOT11_CURRENT_OPTIONAL_CAPABILITY; +pub const OID_DOT11_STATION_ID: u32 = OID_DOT11_NDIS_START + 20; +pub const OID_DOT11_MEDIUM_OCCUPANCY_LIMIT: u32 = OID_DOT11_NDIS_START + 21; +pub const OID_DOT11_CF_POLLABLE: u32 = OID_DOT11_NDIS_START + 22; +pub const OID_DOT11_CFP_PERIOD: u32 = OID_DOT11_NDIS_START + 23; +pub const OID_DOT11_CFP_MAX_DURATION: u32 = OID_DOT11_NDIS_START + 24; +pub const OID_DOT11_POWER_MGMT_MODE: u32 = OID_DOT11_NDIS_START + 25; +ENUM!{enum DOT11_POWER_MODE { + dot11_power_mode_unknown = 0, + dot11_power_mode_active = 1, + dot11_power_mode_powersave = 2, +}} +pub type PDOT11_POWER_MODE = *mut DOT11_POWER_MODE; +pub const DOT11_POWER_SAVE_LEVEL_MAX_PSP: ULONG = 1; +pub const DOT11_POWER_SAVE_LEVEL_FAST_PSP: ULONG = 2; +STRUCT!{struct DOT11_POWER_MGMT_MODE { + dot11PowerMode: DOT11_POWER_MODE, + uPowerSaveLevel: ULONG, + usListenInterval: USHORT, + usAID: USHORT, + bReceiveDTIMs: BOOLEAN, +}} +pub type PDOT11_POWER_MGMT_MODE = *mut DOT11_POWER_MGMT_MODE; +pub const OID_DOT11_OPERATIONAL_RATE_SET: u32 = OID_DOT11_NDIS_START + 26; +pub const OID_DOT11_BEACON_PERIOD: u32 = OID_DOT11_NDIS_START + 27; +pub const OID_DOT11_DTIM_PERIOD: u32 = OID_DOT11_NDIS_START + 28; +pub const OID_DOT11_WEP_ICV_ERROR_COUNT: u32 = OID_DOT11_NDIS_START + 29; +pub const OID_DOT11_MAC_ADDRESS: u32 = OID_DOT11_NDIS_START + 30; +pub const OID_DOT11_RTS_THRESHOLD: u32 = OID_DOT11_NDIS_START + 31; +pub const OID_DOT11_SHORT_RETRY_LIMIT: u32 = OID_DOT11_NDIS_START + 32; +pub const OID_DOT11_LONG_RETRY_LIMIT: u32 = OID_DOT11_NDIS_START + 33; +pub const OID_DOT11_FRAGMENTATION_THRESHOLD: u32 = OID_DOT11_NDIS_START + 34; +pub const OID_DOT11_MAX_TRANSMIT_MSDU_LIFETIME: u32 = OID_DOT11_NDIS_START + 35; +pub const OID_DOT11_MAX_RECEIVE_LIFETIME: u32 = OID_DOT11_NDIS_START + 36; +pub const OID_DOT11_COUNTERS_ENTRY: u32 = OID_DOT11_NDIS_START + 37; +STRUCT!{struct DOT11_COUNTERS_ENTRY { + uTransmittedFragmentCount: ULONG, + uMulticastTransmittedFrameCount: ULONG, + uFailedCount: ULONG, + uRetryCount: ULONG, + uMultipleRetryCount: ULONG, + uFrameDuplicateCount: ULONG, + uRTSSuccessCount: ULONG, + uRTSFailureCount: ULONG, + uACKFailureCount: ULONG, + uReceivedFragmentCount: ULONG, + uMulticastReceivedFrameCount: ULONG, + uFCSErrorCount: ULONG, + uTransmittedFrameCount: ULONG, +}} +pub type PDOT11_COUNTERS_ENTRY = *mut DOT11_COUNTERS_ENTRY; +pub const OID_DOT11_SUPPORTED_PHY_TYPES: u32 = OID_DOT11_NDIS_START + 38; +STRUCT!{struct DOT11_SUPPORTED_PHY_TYPES { + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11PHYType: [DOT11_PHY_TYPE; 1], +}} +pub type PDOT11_SUPPORTED_PHY_TYPES = *mut DOT11_SUPPORTED_PHY_TYPES; +pub const OID_DOT11_CURRENT_REG_DOMAIN: u32 = OID_DOT11_NDIS_START + 39; +pub const DOT11_REG_DOMAIN_OTHER: ULONG = 0x00000000; +pub const DOT11_REG_DOMAIN_FCC: ULONG = 0x00000010; +pub const DOT11_REG_DOMAIN_DOC: ULONG = 0x00000020; +pub const DOT11_REG_DOMAIN_ETSI: ULONG = 0x00000030; +pub const DOT11_REG_DOMAIN_SPAIN: ULONG = 0x00000031; +pub const DOT11_REG_DOMAIN_FRANCE: ULONG = 0x00000032; +pub const DOT11_REG_DOMAIN_MKK: ULONG = 0x00000040; +pub const OID_DOT11_TEMP_TYPE: u32 = OID_DOT11_NDIS_START + 40; +ENUM!{enum DOT11_TEMP_TYPE { + dot11_temp_type_unknown = 0, + dot11_temp_type_1 = 1, + dot11_temp_type_2 = 2, +}} +pub type PDOT11_TEMP_TYPE = *mut DOT11_TEMP_TYPE; +pub const OID_DOT11_CURRENT_TX_ANTENNA: u32 = OID_DOT11_NDIS_START + 41; +pub const OID_DOT11_DIVERSITY_SUPPORT: u32 = OID_DOT11_NDIS_START + 42; +ENUM!{enum DOT11_DIVERSITY_SUPPORT { + dot11_diversity_support_unknown = 0, + dot11_diversity_support_fixedlist = 1, + dot11_diversity_support_notsupported = 2, + dot11_diversity_support_dynamic = 3, +}} +pub type PDOT11_DIVERSITY_SUPPORT = *mut DOT11_DIVERSITY_SUPPORT; +pub const OID_DOT11_CURRENT_RX_ANTENNA: u32 = OID_DOT11_NDIS_START + 43; +pub const OID_DOT11_SUPPORTED_POWER_LEVELS: u32 = OID_DOT11_NDIS_START + 44; +STRUCT!{struct DOT11_SUPPORTED_POWER_LEVELS { + uNumOfSupportedPowerLevels: ULONG, + uTxPowerLevelValues: [ULONG; 8], +}} +pub type PDOT11_SUPPORTED_POWER_LEVELS = *mut DOT11_SUPPORTED_POWER_LEVELS; +pub const OID_DOT11_CURRENT_TX_POWER_LEVEL: u32 = OID_DOT11_NDIS_START + 45; +pub const OID_DOT11_HOP_TIME: u32 = OID_DOT11_NDIS_START + 46; +pub const OID_DOT11_CURRENT_CHANNEL_NUMBER: u32 = OID_DOT11_NDIS_START + 47; +pub const OID_DOT11_MAX_DWELL_TIME: u32 = OID_DOT11_NDIS_START + 48; +pub const OID_DOT11_CURRENT_DWELL_TIME: u32 = OID_DOT11_NDIS_START + 49; +pub const OID_DOT11_CURRENT_SET: u32 = OID_DOT11_NDIS_START + 50; +pub const OID_DOT11_CURRENT_PATTERN: u32 = OID_DOT11_NDIS_START + 51; +pub const OID_DOT11_CURRENT_INDEX: u32 = OID_DOT11_NDIS_START + 52; +pub const OID_DOT11_CURRENT_CHANNEL: u32 = OID_DOT11_NDIS_START + 53; +pub const OID_DOT11_CCA_MODE_SUPPORTED: u32 = OID_DOT11_NDIS_START + 54; +pub const DOT11_CCA_MODE_ED_ONLY: ULONG = 0x00000001; +pub const DOT11_CCA_MODE_CS_ONLY: ULONG = 0x00000002; +pub const DOT11_CCA_MODE_ED_and_CS: ULONG = 0x00000004; +pub const DOT11_CCA_MODE_CS_WITH_TIMER: ULONG = 0x00000008; +pub const DOT11_CCA_MODE_HRCS_AND_ED: ULONG = 0x00000010; +pub const OID_DOT11_CURRENT_CCA_MODE: u32 = OID_DOT11_NDIS_START + 55; +pub const OID_DOT11_ED_THRESHOLD: u32 = OID_DOT11_NDIS_START + 56; +pub const OID_DOT11_CCA_WATCHDOG_TIMER_MAX: u32 = OID_DOT11_NDIS_START + 57; +pub const OID_DOT11_CCA_WATCHDOG_COUNT_MAX: u32 = OID_DOT11_NDIS_START + 58; +pub const OID_DOT11_CCA_WATCHDOG_TIMER_MIN: u32 = OID_DOT11_NDIS_START + 59; +pub const OID_DOT11_CCA_WATCHDOG_COUNT_MIN: u32 = OID_DOT11_NDIS_START + 60; +pub const OID_DOT11_REG_DOMAINS_SUPPORT_VALUE: u32 = OID_DOT11_NDIS_START + 61; +STRUCT!{struct DOT11_REG_DOMAIN_VALUE { + uRegDomainsSupportIndex: ULONG, + uRegDomainsSupportValue: ULONG, +}} +pub type PDOT11_REG_DOMAIN_VALUE = *mut DOT11_REG_DOMAIN_VALUE; +STRUCT!{struct DOT11_REG_DOMAINS_SUPPORT_VALUE { + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11RegDomainValue: [DOT11_REG_DOMAIN_VALUE; 1], +}} +pub type PDOT11_REG_DOMAINS_SUPPORT_VALUE = *mut DOT11_REG_DOMAINS_SUPPORT_VALUE; +pub const OID_DOT11_SUPPORTED_TX_ANTENNA: u32 = OID_DOT11_NDIS_START + 62; +STRUCT!{struct DOT11_SUPPORTED_ANTENNA { + uAntennaListIndex: ULONG, + bSupportedAntenna: BOOLEAN, +}} +pub type PDOT11_SUPPORTED_ANTENNA = *mut DOT11_SUPPORTED_ANTENNA; +STRUCT!{struct DOT11_SUPPORTED_ANTENNA_LIST { + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11SupportedAntenna: [DOT11_SUPPORTED_ANTENNA; 1], +}} +pub type PDOT11_SUPPORTED_ANTENNA_LIST = *mut DOT11_SUPPORTED_ANTENNA_LIST; +pub const OID_DOT11_SUPPORTED_RX_ANTENNA: u32 = OID_DOT11_NDIS_START + 63; +pub const OID_DOT11_DIVERSITY_SELECTION_RX: u32 = OID_DOT11_NDIS_START + 64; +STRUCT!{struct DOT11_DIVERSITY_SELECTION_RX { + uAntennaListIndex: ULONG, + bDiversitySelectionRX: BOOLEAN, +}} +pub type PDOT11_DIVERSITY_SELECTION_RX = *mut DOT11_DIVERSITY_SELECTION_RX; +STRUCT!{struct DOT11_DIVERSITY_SELECTION_RX_LIST { + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11DiversitySelectionRx: [DOT11_DIVERSITY_SELECTION_RX; 1], +}} +pub type PDOT11_DIVERSITY_SELECTION_RX_LIST = *mut DOT11_DIVERSITY_SELECTION_RX_LIST; +pub const OID_DOT11_SUPPORTED_DATA_RATES_VALUE: u32 = OID_DOT11_NDIS_START + 65; +pub const MAX_NUM_SUPPORTED_RATES: usize = 8; +pub const MAX_NUM_SUPPORTED_RATES_V2: usize = 255; +STRUCT!{struct DOT11_SUPPORTED_DATA_RATES_VALUE { + ucSupportedTxDataRatesValue: [UCHAR; MAX_NUM_SUPPORTED_RATES], + ucSupportedRxDataRatesValue: [UCHAR; MAX_NUM_SUPPORTED_RATES], +}} +pub type PDOT11_SUPPORTED_DATA_RATES_VALUE = *mut DOT11_SUPPORTED_DATA_RATES_VALUE; +STRUCT!{struct DOT11_SUPPORTED_DATA_RATES_VALUE_V2 { + ucSupportedTxDataRatesValue: [UCHAR; MAX_NUM_SUPPORTED_RATES_V2], + ucSupportedRxDataRatesValue: [UCHAR; MAX_NUM_SUPPORTED_RATES_V2], +}} +pub type PDOT11_SUPPORTED_DATA_RATES_VALUE_V2 = *mut DOT11_SUPPORTED_DATA_RATES_VALUE_V2; +pub type DOT11_SUPPORTED_DATA_RATES_VALUE_V1 = DOT11_SUPPORTED_DATA_RATES_VALUE_V2; +pub type PDOT11_SUPPORTED_DATA_RATES_VALUE_V1 = *mut DOT11_SUPPORTED_DATA_RATES_VALUE_V2; +pub const OID_DOT11_CURRENT_FREQUENCY: u32 = OID_DOT11_NDIS_START + 66; +pub const OID_DOT11_TI_THRESHOLD: u32 = OID_DOT11_NDIS_START + 67; +pub const OID_DOT11_FREQUENCY_BANDS_SUPPORTED: u32 = OID_DOT11_NDIS_START + 68; +pub const DOT11_FREQUENCY_BANDS_LOWER: u32 = 0x00000001; +pub const DOT11_FREQUENCY_BANDS_MIDDLE: u32 = 0x00000002; +pub const DOT11_FREQUENCY_BANDS_UPPER: u32 = 0x00000004; +pub const OID_DOT11_SHORT_PREAMBLE_OPTION_IMPLEMENTED: u32 = OID_DOT11_NDIS_START + 69; +pub const OID_DOT11_PBCC_OPTION_IMPLEMENTED: u32 = OID_DOT11_NDIS_START + 70; +pub const OID_DOT11_CHANNEL_AGILITY_PRESENT: u32 = OID_DOT11_NDIS_START + 71; +pub const OID_DOT11_CHANNEL_AGILITY_ENABLED: u32 = OID_DOT11_NDIS_START + 72; +pub const OID_DOT11_HR_CCA_MODE_SUPPORTED: u32 = OID_DOT11_NDIS_START + 73; +pub const DOT11_HR_CCA_MODE_ED_ONLY: ULONG = 0x00000001; +pub const DOT11_HR_CCA_MODE_CS_ONLY: ULONG = 0x00000002; +pub const DOT11_HR_CCA_MODE_CS_AND_ED: ULONG = 0x00000004; +pub const DOT11_HR_CCA_MODE_CS_WITH_TIMER: ULONG = 0x00000008; +pub const DOT11_HR_CCA_MODE_HRCS_AND_ED: ULONG = 0x00000010; +pub const OID_DOT11_MULTI_DOMAIN_CAPABILITY_IMPLEMENTED: u32 = OID_DOT11_NDIS_START + 74; +pub const OID_DOT11_MULTI_DOMAIN_CAPABILITY_ENABLED: u32 = OID_DOT11_NDIS_START + 75; +pub const OID_DOT11_COUNTRY_STRING: u32 = OID_DOT11_NDIS_START + 76; +STRUCT!{struct DOT11_MULTI_DOMAIN_CAPABILITY_ENTRY { + uMultiDomainCapabilityIndex: ULONG, + uFirstChannelNumber: ULONG, + uNumberOfChannels: ULONG, + lMaximumTransmitPowerLevel: LONG, +}} +pub type PDOT11_MULTI_DOMAIN_CAPABILITY_ENTRY = *mut DOT11_MULTI_DOMAIN_CAPABILITY_ENTRY; +STRUCT!{struct DOT11_MD_CAPABILITY_ENTRY_LIST { + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11MDCapabilityEntry: [DOT11_MULTI_DOMAIN_CAPABILITY_ENTRY; 1], +}} +pub type PDOT11_MD_CAPABILITY_ENTRY_LIST = *mut DOT11_MD_CAPABILITY_ENTRY_LIST; +pub const OID_DOT11_MULTI_DOMAIN_CAPABILITY: u32 = OID_DOT11_NDIS_START + 77; +pub const OID_DOT11_EHCC_PRIME_RADIX: u32 = OID_DOT11_NDIS_START + 78; +pub const OID_DOT11_EHCC_NUMBER_OF_CHANNELS_FAMILY_INDEX: u32 = OID_DOT11_NDIS_START + 79; +pub const OID_DOT11_EHCC_CAPABILITY_IMPLEMENTED: u32 = OID_DOT11_NDIS_START + 80; +pub const OID_DOT11_EHCC_CAPABILITY_ENABLED: u32 = OID_DOT11_NDIS_START + 81; +pub const OID_DOT11_HOP_ALGORITHM_ADOPTED: u32 = OID_DOT11_NDIS_START + 82; +ENUM!{enum DOT11_HOP_ALGO_ADOPTED { + dot11_hop_algo_current = 0, + dot11_hop_algo_hop_index = 1, + dot11_hop_algo_hcc = 2, +}} +pub type PDOT11_HOP_ALGO_ADOPTED = *mut DOT11_HOP_ALGO_ADOPTED; +pub const OID_DOT11_RANDOM_TABLE_FLAG: u32 = OID_DOT11_NDIS_START + 83; +pub const OID_DOT11_NUMBER_OF_HOPPING_SETS: u32 = OID_DOT11_NDIS_START + 84; +pub const OID_DOT11_HOP_MODULUS: u32 = OID_DOT11_NDIS_START + 85; +pub const OID_DOT11_HOP_OFFSET: u32 = OID_DOT11_NDIS_START + 86; +pub const OID_DOT11_HOPPING_PATTERN: u32 = OID_DOT11_NDIS_START + 87; +STRUCT!{struct DOT11_HOPPING_PATTERN_ENTRY { + uHoppingPatternIndex: ULONG, + uRandomTableFieldNumber: ULONG, +}} +pub type PDOT11_HOPPING_PATTERN_ENTRY = *mut DOT11_HOPPING_PATTERN_ENTRY; +STRUCT!{struct DOT11_HOPPING_PATTERN_ENTRY_LIST { + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11HoppingPatternEntry: [DOT11_HOPPING_PATTERN_ENTRY; 1], +}} +pub type PDOT11_HOPPING_PATTERN_ENTRY_LIST = *mut DOT11_HOPPING_PATTERN_ENTRY_LIST; +pub const OID_DOT11_RANDOM_TABLE_FIELD_NUMBER: u32 = OID_DOT11_NDIS_START + 88; +pub const OID_DOT11_WPA_TSC: u32 = OID_DOT11_NDIS_START + 89; +STRUCT!{struct DOT11_WPA_TSC { + uReserved: ULONG, + dot11OffloadType: DOT11_OFFLOAD_TYPE, + hOffload: HANDLE, + dot11IV48Counter: DOT11_IV48_COUNTER, +}} +pub type PDOT11_WPA_TSC = *mut DOT11_WPA_TSC; +pub const OID_DOT11_RSSI_RANGE: u32 = OID_DOT11_NDIS_START + 90; +STRUCT!{struct DOT11_RSSI_RANGE { + dot11PhyType: DOT11_PHY_TYPE, + uRSSIMin: ULONG, + uRSSIMax: ULONG, +}} +pub type PDOT11_RSSI_RANGE = *mut DOT11_RSSI_RANGE; +pub const OID_DOT11_RF_USAGE: u32 = OID_DOT11_NDIS_START + 91; +pub const OID_DOT11_NIC_SPECIFIC_EXTENSION: u32 = OID_DOT11_NDIS_START + 92; +STRUCT!{struct DOT11_NIC_SPECIFIC_EXTENSION { + uBufferLength: ULONG, + uTotalBufferLength: ULONG, + ucBuffer: [UCHAR; 1], +}} +pub type PDOT11_NIC_SPECIFIC_EXTENSION = *mut DOT11_NIC_SPECIFIC_EXTENSION; +pub const OID_DOT11_AP_JOIN_REQUEST: u32 = OID_DOT11_NDIS_START + 93; +STRUCT!{struct DOT11_AP_JOIN_REQUEST { + uJoinFailureTimeout: ULONG, + OperationalRateSet: DOT11_RATE_SET, + uChCenterFrequency: ULONG, + dot11BSSDescription: DOT11_BSS_DESCRIPTION, +}} +pub type PDOT11_AP_JOIN_REQUEST = *mut DOT11_AP_JOIN_REQUEST; +pub const OID_DOT11_ERP_PBCC_OPTION_IMPLEMENTED: u32 = OID_DOT11_NDIS_START + 94; +pub const OID_DOT11_ERP_PBCC_OPTION_ENABLED: u32 = OID_DOT11_NDIS_START + 95; +pub const OID_DOT11_DSSS_OFDM_OPTION_IMPLEMENTED: u32 = OID_DOT11_NDIS_START + 96; +pub const OID_DOT11_DSSS_OFDM_OPTION_ENABLED: u32 = OID_DOT11_NDIS_START + 97; +pub const OID_DOT11_SHORT_SLOT_TIME_OPTION_IMPLEMENTED: u32 = OID_DOT11_NDIS_START + 98; +pub const OID_DOT11_SHORT_SLOT_TIME_OPTION_ENABLED: u32 = OID_DOT11_NDIS_START + 99; +pub const OID_DOT11_MAX_MAC_ADDRESS_STATES: u32 = OID_DOT11_NDIS_START + 100; +pub const OID_DOT11_RECV_SENSITIVITY_LIST: u32 = OID_DOT11_NDIS_START + 101; +STRUCT!{struct DOT11_RECV_SENSITIVITY { + ucDataRate: UCHAR, + lRSSIMin: LONG, + lRSSIMax: LONG, +}} +pub type PDOT11_RECV_SENSITIVITY = *mut DOT11_RECV_SENSITIVITY; +UNION!{union DOT11_RECV_SENSITIVITY_LIST_u { + [u32; 1], + dot11PhyType dot11PhyType_mut: DOT11_PHY_TYPE, + uPhyId uPhyId_mut: ULONG, +}} +STRUCT!{struct DOT11_RECV_SENSITIVITY_LIST { + u: DOT11_RECV_SENSITIVITY_LIST_u, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11RecvSensitivity: [DOT11_RECV_SENSITIVITY; 1], +}} +pub type PDOT11_RECV_SENSITIVITY_LIST = *mut DOT11_RECV_SENSITIVITY_LIST; +pub const OID_DOT11_WME_IMPLEMENTED: u32 = OID_DOT11_NDIS_START + 102; +pub const OID_DOT11_WME_ENABLED: u32 = OID_DOT11_NDIS_START + 103; +pub const OID_DOT11_WME_AC_PARAMETERS: u32 = OID_DOT11_NDIS_START + 104; +ENUM!{enum DOT11_AC_PARAM { + dot11_AC_param_BE = 0, + dot11_AC_param_BK = 1, + dot11_AC_param_VI = 2, + dot11_AC_param_VO = 3, + dot11_AC_param_max = 4, +}} +pub type PDOT11_AC_PARAM = *mut DOT11_AC_PARAM; +STRUCT!{struct DOT11_WME_AC_PARAMETERS { + ucAccessCategoryIndex: UCHAR, + ucAIFSN: UCHAR, + ucECWmin: UCHAR, + ucECWmax: UCHAR, + usTXOPLimit: USHORT, +}} +pub type PDOT11_WME_AC_PARAMETERS = *mut DOT11_WME_AC_PARAMETERS; +STRUCT!{struct DOT11_WME_AC_PARAMETERS_LIST { + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11WMEACParameters: [DOT11_WME_AC_PARAMETERS; 1], +}} +pub type PDOT11_WME_AC_PARAMETERS_LIST = *mut DOT11_WME_AC_PARAMETERS_LIST; +pub const OID_DOT11_WME_UPDATE_IE: u32 = OID_DOT11_NDIS_START + 105; +STRUCT!{struct DOT11_WME_UPDATE_IE { + uParamElemMinBeaconIntervals: ULONG, + uWMEInfoElemOffset: ULONG, + uWMEInfoElemLength: ULONG, + uWMEParamElemOffset: ULONG, + uWMEParamElemLength: ULONG, + ucBuffer: [UCHAR; 1], +}} +pub type PDOT11_WME_UPDATE_IE = *mut DOT11_WME_UPDATE_IE; +pub const OID_DOT11_QOS_TX_QUEUES_SUPPORTED: u32 = OID_DOT11_NDIS_START + 106; +pub const OID_DOT11_QOS_TX_DURATION: u32 = OID_DOT11_NDIS_START + 107; +STRUCT!{struct DOT11_QOS_TX_DURATION { + uNominalMSDUSize: ULONG, + uMinPHYRate: ULONG, + uDuration: ULONG, +}} +pub type PDOT11_QOS_TX_DURATION = *mut DOT11_QOS_TX_DURATION; +pub const OID_DOT11_QOS_TX_MEDIUM_TIME: u32 = OID_DOT11_NDIS_START + 108; +STRUCT!{struct DOT11_QOS_TX_MEDIUM_TIME { + dot11PeerAddress: DOT11_MAC_ADDRESS, + ucQoSPriority: UCHAR, + uMediumTimeAdmited: ULONG, +}} +pub type PDOT11_QOS_TX_MEDIUM_TIME = *mut DOT11_QOS_TX_MEDIUM_TIME; +pub const OID_DOT11_SUPPORTED_OFDM_FREQUENCY_LIST: u32 = OID_DOT11_NDIS_START + 109; +STRUCT!{struct DOT11_SUPPORTED_OFDM_FREQUENCY { + uCenterFrequency: ULONG, +}} +pub type PDOT11_SUPPORTED_OFDM_FREQUENCY = *mut DOT11_SUPPORTED_OFDM_FREQUENCY; +STRUCT!{struct DOT11_SUPPORTED_OFDM_FREQUENCY_LIST { + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11SupportedOFDMFrequency: [DOT11_SUPPORTED_OFDM_FREQUENCY; 1], +}} +pub type PDOT11_SUPPORTED_OFDM_FREQUENCY_LIST = *mut DOT11_SUPPORTED_OFDM_FREQUENCY_LIST; +pub const OID_DOT11_SUPPORTED_DSSS_CHANNEL_LIST: u32 = OID_DOT11_NDIS_START + 110; +STRUCT!{struct DOT11_SUPPORTED_DSSS_CHANNEL { + uChannel: ULONG, +}} +pub type PDOT11_SUPPORTED_DSSS_CHANNEL = *mut DOT11_SUPPORTED_DSSS_CHANNEL; +STRUCT!{struct DOT11_SUPPORTED_DSSS_CHANNEL_LIST { + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11SupportedDSSSChannel: [DOT11_SUPPORTED_DSSS_CHANNEL; 1], +}} +pub type PDOT11_SUPPORTED_DSSS_CHANNEL_LIST = *mut DOT11_SUPPORTED_DSSS_CHANNEL_LIST; +STRUCT!{struct DOT11_BYTE_ARRAY { + Header: NDIS_OBJECT_HEADER, + uNumOfBytes: ULONG, + uTotalNumOfBytes: ULONG, + ucBuffer: [UCHAR; 1], +}} +pub type PDOT11_BYTE_ARRAY = *mut DOT11_BYTE_ARRAY; +pub const OID_DOT11_AUTO_CONFIG_ENABLED: u32 = + NWF_DEFINE_OID!(120, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const DOT11_PHY_AUTO_CONFIG_ENABLED_FLAG: ULONG = 0x00000001; +pub const DOT11_MAC_AUTO_CONFIG_ENABLED_FLAG: ULONG = 0x00000002; +pub const OID_DOT11_ENUM_BSS_LIST: u32 = + NWF_DEFINE_OID!(121, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const DOT11_BSS_ENTRY_BYTE_ARRAY_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO_FHSS { + uHopPattern: ULONG, + uHopSet: ULONG, + uDwellTime: ULONG, +}} +UNION!{union DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO { + [u32; 3], + uChCenterFrequency uChCenterFrequency_mut: ULONG, + FHSS FHSS_mut: DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO_FHSS, +}} +pub type PDOT11_BSS_ENTRY_PHY_SPECIFIC_INFO = *mut DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO; +STRUCT!{struct DOT11_BSS_ENTRY { + uPhyId: ULONG, + PhySpecificInfo: DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO, + dot11BSSID: DOT11_MAC_ADDRESS, + dot11BSSType: DOT11_BSS_TYPE, + lRSSI: LONG, + uLinkQuality: ULONG, + bInRegDomain: BOOLEAN, + usBeaconPeriod: USHORT, + ullTimestamp: ULONGLONG, + ullHostTimestamp: ULONGLONG, + usCapabilityInformation: USHORT, + uBufferLength: ULONG, + ucBuffer: [UCHAR; 1], +}} +pub type PDOT11_BSS_ENTRY = *mut DOT11_BSS_ENTRY; +pub const OID_DOT11_FLUSH_BSS_LIST: u32 = + NWF_DEFINE_OID!(122, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_POWER_MGMT_REQUEST: u32 = + NWF_DEFINE_OID!(123, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const DOT11_POWER_SAVING_NO_POWER_SAVING: ULONG = 0; +pub const DOT11_POWER_SAVING_FAST_PSP: ULONG = 8; +pub const DOT11_POWER_SAVING_MAX_PSP: ULONG = 16; +pub const DOT11_POWER_SAVING_MAXIMUM_LEVEL: ULONG = 24; +pub const OID_DOT11_DESIRED_SSID_LIST: u32 = + NWF_DEFINE_OID!(124, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_SSID_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + SSIDs: [DOT11_SSID; 1], +}} +pub type PDOT11_SSID_LIST = *mut DOT11_SSID_LIST; +pub const DOT11_SSID_LIST_REVISION_1: UCHAR = 1; +pub const OID_DOT11_EXCLUDED_MAC_ADDRESS_LIST: u32 = + NWF_DEFINE_OID!(125, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_MAC_ADDRESS_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + MacAddrs: [DOT11_MAC_ADDRESS; 1], +}} +pub type PDOT11_MAC_ADDRESS_LIST = *mut DOT11_MAC_ADDRESS_LIST; +pub const DOT11_MAC_ADDRESS_LIST_REVISION_1: UCHAR = 1; +pub const OID_DOT11_DESIRED_BSSID_LIST: u32 = + NWF_DEFINE_OID!(126, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_DESIRED_BSS_TYPE: u32 = + NWF_DEFINE_OID!(127, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_PMKID_LIST: u32 = NWF_DEFINE_OID!(128, NWF_OPERATIONAL_OID, NWF_OPTIONAL_OID); +pub type DOT11_PMKID_VALUE = [UCHAR; 16]; +STRUCT!{struct DOT11_PMKID_ENTRY { + BSSID: DOT11_MAC_ADDRESS, + PMKID: DOT11_PMKID_VALUE, + uFlags: ULONG, +}} +pub type PDOT11_PMKID_ENTRY = *mut DOT11_PMKID_ENTRY; +STRUCT!{struct DOT11_PMKID_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + PMKIDs: [DOT11_PMKID_ENTRY; 1], +}} +pub type PDOT11_PMKID_LIST = *mut DOT11_PMKID_LIST; +pub const DOT11_PMKID_LIST_REVISION_1: UCHAR = 1; +pub const OID_DOT11_CONNECT_REQUEST: u32 = + NWF_DEFINE_OID!(129, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_EXCLUDE_UNENCRYPTED: u32 = + NWF_DEFINE_OID!(130, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_STATISTICS: u32 = + NWF_DEFINE_OID!(131, NWF_STATISTICS_OID, NWF_MANDATORY_OID); +pub const DOT11_STATISTICS_UNKNOWN: ULONGLONG = -1i64 as u64; +STRUCT!{struct DOT11_PHY_FRAME_STATISTICS { + ullTransmittedFrameCount: ULONGLONG, + ullMulticastTransmittedFrameCount: ULONGLONG, + ullFailedCount: ULONGLONG, + ullRetryCount: ULONGLONG, + ullMultipleRetryCount: ULONGLONG, + ullMaxTXLifetimeExceededCount: ULONGLONG, + ullTransmittedFragmentCount: ULONGLONG, + ullRTSSuccessCount: ULONGLONG, + ullRTSFailureCount: ULONGLONG, + ullACKFailureCount: ULONGLONG, + ullReceivedFrameCount: ULONGLONG, + ullMulticastReceivedFrameCount: ULONGLONG, + ullPromiscuousReceivedFrameCount: ULONGLONG, + ullMaxRXLifetimeExceededCount: ULONGLONG, + ullFrameDuplicateCount: ULONGLONG, + ullReceivedFragmentCount: ULONGLONG, + ullPromiscuousReceivedFragmentCount: ULONGLONG, + ullFCSErrorCount: ULONGLONG, +}} +pub type PDOT11_PHY_FRAME_STATISTICS = *mut DOT11_PHY_FRAME_STATISTICS; +STRUCT!{struct DOT11_MAC_FRAME_STATISTICS { + ullTransmittedFrameCount: ULONGLONG, + ullReceivedFrameCount: ULONGLONG, + ullTransmittedFailureFrameCount: ULONGLONG, + ullReceivedFailureFrameCount: ULONGLONG, + ullWEPExcludedCount: ULONGLONG, + ullTKIPLocalMICFailures: ULONGLONG, + ullTKIPReplays: ULONGLONG, + ullTKIPICVErrorCount: ULONGLONG, + ullCCMPReplays: ULONGLONG, + ullCCMPDecryptErrors: ULONGLONG, + ullWEPUndecryptableCount: ULONGLONG, + ullWEPICVErrorCount: ULONGLONG, + ullDecryptSuccessCount: ULONGLONG, + ullDecryptFailureCount: ULONGLONG, +}} +pub type PDOT11_MAC_FRAME_STATISTICS = *mut DOT11_MAC_FRAME_STATISTICS; +STRUCT!{struct DOT11_STATISTICS { + Header: NDIS_OBJECT_HEADER, + ullFourWayHandshakeFailures: ULONGLONG, + ullTKIPCounterMeasuresInvoked: ULONGLONG, + ullReserved: ULONGLONG, + MacUcastCounters: DOT11_MAC_FRAME_STATISTICS, + MacMcastCounters: DOT11_MAC_FRAME_STATISTICS, + PhyCounters: [DOT11_PHY_FRAME_STATISTICS; 1], +}} +pub type PDOT11_STATISTICS = *mut DOT11_STATISTICS; +pub const DOT11_STATISTICS_REVISION_1: UCHAR = 1; +pub const OID_DOT11_PRIVACY_EXEMPTION_LIST: u32 = + NWF_DEFINE_OID!(132, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_PRIVACY_EXEMPTION { + usEtherType: USHORT, + usExemptionActionType: USHORT, + usExemptionPacketType: USHORT, +}} +pub type PDOT11_PRIVACY_EXEMPTION = *mut DOT11_PRIVACY_EXEMPTION; +pub const DOT11_EXEMPT_NO_EXEMPTION: USHORT = 0; +pub const DOT11_EXEMPT_ALWAYS: USHORT = 1; +pub const DOT11_EXEMPT_ON_KEY_MAPPING_KEY_UNAVAILABLE: USHORT = 2; +pub const DOT11_EXEMPT_UNICAST: USHORT = 1; +pub const DOT11_EXEMPT_MULTICAST: USHORT = 2; +pub const DOT11_EXEMPT_BOTH: USHORT = 3; +STRUCT!{struct DOT11_PRIVACY_EXEMPTION_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + PrivacyExemptionEntries: [DOT11_PRIVACY_EXEMPTION; 1], +}} +pub type PDOT11_PRIVACY_EXEMPTION_LIST = *mut DOT11_PRIVACY_EXEMPTION_LIST; +pub const DOT11_PRIVACY_EXEMPTION_LIST_REVISION_1: UCHAR = 1; +pub const OID_DOT11_ENABLED_AUTHENTICATION_ALGORITHM: u32 = + NWF_DEFINE_OID!(133, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_AUTH_ALGORITHM_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + AlgorithmIds: [DOT11_AUTH_ALGORITHM; 1], +}} +pub type PDOT11_AUTH_ALGORITHM_LIST = *mut DOT11_AUTH_ALGORITHM_LIST; +pub const DOT11_AUTH_ALGORITHM_LIST_REVISION_1: UCHAR = 1; +pub const OID_DOT11_SUPPORTED_UNICAST_ALGORITHM_PAIR: u32 = + NWF_DEFINE_OID!(134, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_AUTH_CIPHER_PAIR_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + AuthCipherPairs: [DOT11_AUTH_CIPHER_PAIR; 1], +}} +pub type PDOT11_AUTH_CIPHER_PAIR_LIST = *mut DOT11_AUTH_CIPHER_PAIR_LIST; +pub const DOT11_AUTH_CIPHER_PAIR_LIST_REVISION_1: UCHAR = 1; +pub const OID_DOT11_ENABLED_UNICAST_CIPHER_ALGORITHM: u32 = + NWF_DEFINE_OID!(135, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_CIPHER_ALGORITHM_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + AlgorithmIds: [DOT11_CIPHER_ALGORITHM; 1], +}} +pub type PDOT11_CIPHER_ALGORITHM_LIST = *mut DOT11_CIPHER_ALGORITHM_LIST; +pub const DOT11_CIPHER_ALGORITHM_LIST_REVISION_1: UCHAR = 1; +pub const OID_DOT11_SUPPORTED_MULTICAST_ALGORITHM_PAIR: u32 = + NWF_DEFINE_OID!(136, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_ENABLED_MULTICAST_CIPHER_ALGORITHM: u32 = + NWF_DEFINE_OID!(137, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_CIPHER_DEFAULT_KEY_ID: u32 = + NWF_DEFINE_OID!(138, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_CIPHER_DEFAULT_KEY: u32 = + NWF_DEFINE_OID!(139, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_CIPHER_DEFAULT_KEY_VALUE { + Header: NDIS_OBJECT_HEADER, + uKeyIndex: ULONG, + AlgorithmId: DOT11_CIPHER_ALGORITHM, + MacAddr: DOT11_MAC_ADDRESS, + bDelete: BOOLEAN, + bStatic: BOOLEAN, + usKeyLength: USHORT, + ucKey: [UCHAR; 1], +}} +pub type PDOT11_CIPHER_DEFAULT_KEY_VALUE = *mut DOT11_CIPHER_DEFAULT_KEY_VALUE; +pub const DOT11_CIPHER_DEFAULT_KEY_VALUE_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_KEY_ALGO_TKIP_MIC { + ucIV48Counter: [UCHAR; 6], + ulTKIPKeyLength: ULONG, + ulMICKeyLength: ULONG, + ucTKIPMICKeys: [UCHAR; 1], +}} +pub type PDOT11_KEY_ALGO_TKIP_MIC = *mut DOT11_KEY_ALGO_TKIP_MIC; +STRUCT!{struct DOT11_KEY_ALGO_CCMP { + ucIV48Counter: [UCHAR; 6], + ulCCMPKeyLength: ULONG, + ucCCMPKey: [UCHAR; 1], +}} +pub type PDOT11_KEY_ALGO_CCMP = *mut DOT11_KEY_ALGO_CCMP; +STRUCT!{struct DOT11_KEY_ALGO_GCMP { + ucIV48Counter: [UCHAR; 6], + ulGCMPKeyLength: ULONG, + ucGCMPKey: [UCHAR; 1], +}} +pub type PDOT11_KEY_ALGO_GCMP = *mut DOT11_KEY_ALGO_GCMP; +STRUCT!{struct DOT11_KEY_ALGO_BIP { + ucIPN: [UCHAR; 6], + ulBIPKeyLength: ULONG, + ucBIPKey: [UCHAR; 1], +}} +pub type PDOT11_KEY_ALGO_BIP = *mut DOT11_KEY_ALGO_BIP; +pub const OID_DOT11_CIPHER_KEY_MAPPING_KEY: u32 = + NWF_DEFINE_OID!(140, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +ENUM!{enum DOT11_DIRECTION { + DOT11_DIR_INBOUND = 1, + DOT11_DIR_OUTBOUND = 2, + DOT11_DIR_BOTH = 3, +}} +pub type PDOT11_DIRECTION = *mut DOT11_DIRECTION; +pub const DOT11_CIPHER_KEY_MAPPING_KEY_VALUE_BYTE_ARRAY_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_CIPHER_KEY_MAPPING_KEY_VALUE { + PeerMacAddr: DOT11_MAC_ADDRESS, + AlgorithmId: DOT11_CIPHER_ALGORITHM, + Direction: DOT11_DIRECTION, + bDelete: BOOLEAN, + bStatic: BOOLEAN, + usKeyLength: USHORT, + ucKey: [UCHAR; 1], +}} +pub type PDOT11_CIPHER_KEY_MAPPING_KEY_VALUE = *mut DOT11_CIPHER_KEY_MAPPING_KEY_VALUE; +pub const OID_DOT11_ENUM_ASSOCIATION_INFO: u32 = + NWF_DEFINE_OID!(141, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +ENUM!{enum DOT11_ASSOCIATION_STATE { + dot11_assoc_state_zero = 0, + dot11_assoc_state_unauth_unassoc = 1, + dot11_assoc_state_auth_unassoc = 2, + dot11_assoc_state_auth_assoc = 3, +}} +pub type PDOT11_ASSOCIATION_STATE = *mut DOT11_ASSOCIATION_STATE; +STRUCT!{struct DOT11_ASSOCIATION_INFO_EX { + PeerMacAddress: DOT11_MAC_ADDRESS, + BSSID: DOT11_MAC_ADDRESS, + usCapabilityInformation: USHORT, + usListenInterval: USHORT, + ucPeerSupportedRates: [UCHAR; 255], + usAssociationID: USHORT, + dot11AssociationState: DOT11_ASSOCIATION_STATE, + dot11PowerMode: DOT11_POWER_MODE, + liAssociationUpTime: LARGE_INTEGER, + ullNumOfTxPacketSuccesses: ULONGLONG, + ullNumOfTxPacketFailures: ULONGLONG, + ullNumOfRxPacketSuccesses: ULONGLONG, + ullNumOfRxPacketFailures: ULONGLONG, +}} +pub type PDOT11_ASSOCIATION_INFO_EX = *mut DOT11_ASSOCIATION_INFO_EX; +STRUCT!{struct DOT11_ASSOCIATION_INFO_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11AssocInfo: [DOT11_ASSOCIATION_INFO_EX; 1], +}} +pub type PDOT11_ASSOCIATION_INFO_LIST = *mut DOT11_ASSOCIATION_INFO_LIST; +pub const DOT11_ASSOCIATION_INFO_LIST_REVISION_1: UCHAR = 1; +pub const OID_DOT11_DISCONNECT_REQUEST: u32 = + NWF_DEFINE_OID!(142, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_UNICAST_USE_GROUP_ENABLED: u32 = + NWF_DEFINE_OID!(143, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_HARDWARE_PHY_STATE: u32 = + NWF_DEFINE_OID!(144, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_DESIRED_PHY_LIST: u32 = + NWF_DEFINE_OID!(145, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_PHY_ID_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + dot11PhyId: [ULONG; 1], +}} +pub type PDOT11_PHY_ID_LIST = *mut DOT11_PHY_ID_LIST; +pub const DOT11_PHY_ID_LIST_REVISION_1: UCHAR = 1; +pub const DOT11_PHY_ID_ANY: ULONG = 0xffffffff; +pub const OID_DOT11_CURRENT_PHY_ID: u32 = + NWF_DEFINE_OID!(146, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_MEDIA_STREAMING_ENABLED: u32 = + NWF_DEFINE_OID!(147, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_UNREACHABLE_DETECTION_THRESHOLD: u32 = + NWF_DEFINE_OID!(148, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_ACTIVE_PHY_LIST: u32 = + NWF_DEFINE_OID!(149, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_EXTSTA_CAPABILITY: u32 = + NWF_DEFINE_OID!(150, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_EXTSTA_CAPABILITY { + Header: NDIS_OBJECT_HEADER, + uScanSSIDListSize: ULONG, + uDesiredBSSIDListSize: ULONG, + uDesiredSSIDListSize: ULONG, + uExcludedMacAddressListSize: ULONG, + uPrivacyExemptionListSize: ULONG, + uKeyMappingTableSize: ULONG, + uDefaultKeyTableSize: ULONG, + uWEPKeyValueMaxLength: ULONG, + uPMKIDCacheSize: ULONG, + uMaxNumPerSTADefaultKeyTables: ULONG, +}} +pub type PDOT11_EXTSTA_CAPABILITY = *mut DOT11_EXTSTA_CAPABILITY; +pub const DOT11_EXTSTA_CAPABILITY_REVISION_1: UCHAR = 1; +pub const OID_DOT11_DATA_RATE_MAPPING_TABLE: u32 = + NWF_DEFINE_OID!(151, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_DATA_RATE_MAPPING_ENTRY { + ucDataRateIndex: UCHAR, + ucDataRateFlag: UCHAR, + usDataRateValue: USHORT, +}} +pub type PDOT11_DATA_RATE_MAPPING_ENTRY = *mut DOT11_DATA_RATE_MAPPING_ENTRY; +STRUCT!{struct DOT11_DATA_RATE_MAPPING_TABLE { + Header: NDIS_OBJECT_HEADER, + uDataRateMappingLength: ULONG, + DataRateMappingEntries: [DOT11_DATA_RATE_MAPPING_ENTRY; DOT11_RATE_SET_MAX_LENGTH], +}} +pub type PDOT11_DATA_RATE_MAPPING_TABLE = *mut DOT11_DATA_RATE_MAPPING_TABLE; +pub const DOT11_DATA_RATE_MAPPING_TABLE_REVISION_1: UCHAR = 1; +pub const DOT11_DATA_RATE_NON_STANDARD: UCHAR = 0x01; +pub const DOT11_DATA_RATE_INDEX_MASK: UCHAR = 0x7f; +pub const OID_DOT11_SUPPORTED_COUNTRY_OR_REGION_STRING: u32 = + NWF_DEFINE_OID!(152, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_COUNTRY_OR_REGION_STRING_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + CountryOrRegionStrings: [DOT11_COUNTRY_OR_REGION_STRING; 1], +}} +pub type PDOT11_COUNTRY_OR_REGION_STRING_LIST = *mut DOT11_COUNTRY_OR_REGION_STRING_LIST; +pub const DOT11_COUNTRY_OR_REGION_STRING_LIST_REVISION_1: UCHAR = 1; +pub const OID_DOT11_DESIRED_COUNTRY_OR_REGION_STRING: u32 = + NWF_DEFINE_OID!(153, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_PORT_STATE_NOTIFICATION: u32 = + NWF_DEFINE_OID!(154, NWF_OPERATIONAL_OID, NWF_OPTIONAL_OID); +STRUCT!{struct DOT11_PORT_STATE_NOTIFICATION { + Header: NDIS_OBJECT_HEADER, + PeerMac: DOT11_MAC_ADDRESS, + bOpen: BOOLEAN, +}} +pub type PDOT11_PORT_STATE_NOTIFICATION = *mut DOT11_PORT_STATE_NOTIFICATION; +pub const DOT11_PORT_STATE_NOTIFICATION_REVISION_1: UCHAR = 1; +pub const OID_DOT11_IBSS_PARAMS: u32 = + NWF_DEFINE_OID!(155, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_IBSS_PARAMS { + Header: NDIS_OBJECT_HEADER, + bJoinOnly: BOOLEAN, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_IBSS_PARAMS = *mut DOT11_IBSS_PARAMS; +pub const DOT11_IBSS_PARAMS_REVISION_1: UCHAR = 1; +pub const OID_DOT11_QOS_PARAMS: u32 = NWF_DEFINE_OID!(156, NWF_OPERATIONAL_OID, NWF_OPTIONAL_OID); +STRUCT!{struct DOT11_QOS_PARAMS { + Header: NDIS_OBJECT_HEADER, + ucEnabledQoSProtocolFlags: UCHAR, +}} +pub type PDOT11_QOS_PARAMS = *mut DOT11_QOS_PARAMS; +pub const DOT11_QOS_PARAMS_REVISION_1: UCHAR = 1; +pub const DOT11_QOS_PROTOCOL_FLAG_WMM: UCHAR = 0x01; +pub const DOT11_QOS_PROTOCOL_FLAG_11E: UCHAR = 0x02; +pub const OID_DOT11_SAFE_MODE_ENABLED: u32 = + NWF_DEFINE_OID!(157, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_HIDDEN_NETWORK_ENABLED: u32 = + NWF_DEFINE_OID!(158, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_ASSOCIATION_PARAMS: u32 = + NWF_DEFINE_OID!(159, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_ASSOCIATION_PARAMS { + Header: NDIS_OBJECT_HEADER, + BSSID: DOT11_MAC_ADDRESS, + uAssocRequestIEsOffset: ULONG, + uAssocRequestIEsLength: ULONG, +}} +pub type PDOT11_ASSOCIATION_PARAMS = *mut DOT11_ASSOCIATION_PARAMS; +pub const DOT11_ASSOCIATION_PARAMS_REVISION_1: UCHAR = 1; +pub const OID_DOT11_SAFE_MODE_HT_ENABLED: u32 = + NWF_DEFINE_OID!(160, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); +pub const DOT11_MAX_NUM_OF_FRAGMENTS: USHORT = 16; +pub const DOT11_PRIORITY_CONTENTION: i32 = 0; +pub const DOT11_PRIORITY_CONTENTION_FREE: i32 = 1; +pub const DOT11_SERVICE_CLASS_REORDERABLE_MULTICAST: i32 = 0; +pub const DOT11_SERVICE_CLASS_STRICTLY_ORDERED: i32 = 1; +pub const DOT11_FLAGS_80211B_SHORT_PREAMBLE: u32 = 0x00000001; +pub const DOT11_FLAGS_80211B_PBCC: u32 = 0x00000002; +pub const DOT11_FLAGS_80211B_CHANNEL_AGILITY: u32 = 0x00000004; +pub const DOT11_FLAGS_PS_ON: u32 = 0x00000008; +pub const DOT11_FLAGS_80211G_DSSS_OFDM: u32 = 0x00000010; +pub const DOT11_FLAGS_80211G_USE_PROTECTION: u32 = 0x00000020; +pub const DOT11_FLAGS_80211G_NON_ERP_PRESENT: u32 = 0x00000040; +pub const DOT11_FLAGS_80211G_BARKER_PREAMBLE_MODE: u32 = 0x00000080; +pub const DOT11_WME_PACKET: u32 = 0x00000100; +STRUCT!{struct DOT11_FRAGMENT_DESCRIPTOR { + uOffset: ULONG, + uLength: ULONG, +}} +pub type PDOT11_FRAGMENT_DESCRIPTOR = *mut DOT11_FRAGMENT_DESCRIPTOR; +STRUCT!{struct DOT11_PER_MSDU_COUNTERS { + uTransmittedFragmentCount: ULONG, + uRetryCount: ULONG, + uRTSSuccessCount: ULONG, + uRTSFailureCount: ULONG, + uACKFailureCount: ULONG, +}} +pub type PDOT11_PER_MSDU_COUNTERS = *mut DOT11_PER_MSDU_COUNTERS; +STRUCT!{struct DOT11_HRDSSS_PHY_ATTRIBUTES { + bShortPreambleOptionImplemented: BOOLEAN, + bPBCCOptionImplemented: BOOLEAN, + bChannelAgilityPresent: BOOLEAN, + uHRCCAModeSupported: ULONG, +}} +pub type PDOT11_HRDSSS_PHY_ATTRIBUTES = *mut DOT11_HRDSSS_PHY_ATTRIBUTES; +STRUCT!{struct DOT11_OFDM_PHY_ATTRIBUTES { + uFrequencyBandsSupported: ULONG, +}} +pub type PDOT11_OFDM_PHY_ATTRIBUTES = *mut DOT11_OFDM_PHY_ATTRIBUTES; +STRUCT!{struct DOT11_ERP_PHY_ATTRIBUTES { + HRDSSSAttributes: DOT11_HRDSSS_PHY_ATTRIBUTES, + bERPPBCCOptionImplemented: BOOLEAN, + bDSSSOFDMOptionImplemented: BOOLEAN, + bShortSlotTimeOptionImplemented: BOOLEAN, +}} +pub type PDOT11_ERP_PHY_ATTRIBUTES = *mut DOT11_ERP_PHY_ATTRIBUTES; +pub const DOT11_PHY_ATTRIBUTES_REVISION_1: UCHAR = 1; +UNION!{union DOT11_PHY_ATTRIBUTES_u { + [u32; 3], + HRDSSSAttributes HRDSSSAttributes_mut: DOT11_HRDSSS_PHY_ATTRIBUTES, + OFDMAttributes OFDMAttributes_mut: DOT11_OFDM_PHY_ATTRIBUTES, + ERPAttributes ERPAttributes_mut: DOT11_ERP_PHY_ATTRIBUTES, +}} +STRUCT!{struct DOT11_PHY_ATTRIBUTES { + Header: NDIS_OBJECT_HEADER, + PhyType: DOT11_PHY_TYPE, + bHardwarePhyState: BOOLEAN, + bSoftwarePhyState: BOOLEAN, + bCFPollable: BOOLEAN, + uMPDUMaxLength: ULONG, + TempType: DOT11_TEMP_TYPE, + DiversitySupport: DOT11_DIVERSITY_SUPPORT, + u: DOT11_PHY_ATTRIBUTES_u, + uNumberSupportedPowerLevels: ULONG, + TxPowerLevels: [ULONG; 8], + uNumDataRateMappingEntries: ULONG, + DataRateMappingEntries: [DOT11_DATA_RATE_MAPPING_ENTRY; DOT11_RATE_SET_MAX_LENGTH], + SupportedDataRatesValue: DOT11_SUPPORTED_DATA_RATES_VALUE_V2, +}} +pub type PDOT11_PHY_ATTRIBUTES = *mut DOT11_PHY_ATTRIBUTES; +pub const DOT11_EXTSTA_ATTRIBUTES_SAFEMODE_OID_SUPPORTED: UINT8 = 0x1; +pub const DOT11_EXTSTA_ATTRIBUTES_SAFEMODE_CERTIFIED: UINT8 = 0x2; +pub const DOT11_EXTSTA_ATTRIBUTES_SAFEMODE_RESERVED: UINT8 = 0xC; +pub const DOT11_EXTSTA_ATTRIBUTES_REVISION_1: UCHAR = 1; +pub const DOT11_EXTSTA_ATTRIBUTES_REVISION_2: UCHAR = 2; +pub const DOT11_EXTSTA_ATTRIBUTES_REVISION_3: UCHAR = 3; +pub const DOT11_EXTSTA_ATTRIBUTES_REVISION_4: UCHAR = 4; +STRUCT!{struct DOT11_EXTSTA_ATTRIBUTES { + Header: NDIS_OBJECT_HEADER, + uScanSSIDListSize: ULONG, + uDesiredBSSIDListSize: ULONG, + uDesiredSSIDListSize: ULONG, + uExcludedMacAddressListSize: ULONG, + uPrivacyExemptionListSize: ULONG, + uKeyMappingTableSize: ULONG, + uDefaultKeyTableSize: ULONG, + uWEPKeyValueMaxLength: ULONG, + uPMKIDCacheSize: ULONG, + uMaxNumPerSTADefaultKeyTables: ULONG, + bStrictlyOrderedServiceClassImplemented: BOOLEAN, + ucSupportedQoSProtocolFlags: UCHAR, + bSafeModeImplemented: BOOLEAN, + uNumSupportedCountryOrRegionStrings: ULONG, + pSupportedCountryOrRegionStrings: PDOT11_COUNTRY_OR_REGION_STRING, + uInfraNumSupportedUcastAlgoPairs: ULONG, + pInfraSupportedUcastAlgoPairs: PDOT11_AUTH_CIPHER_PAIR, + uInfraNumSupportedMcastAlgoPairs: ULONG, + pInfraSupportedMcastAlgoPairs: PDOT11_AUTH_CIPHER_PAIR, + uAdhocNumSupportedUcastAlgoPairs: ULONG, + pAdhocSupportedUcastAlgoPairs: PDOT11_AUTH_CIPHER_PAIR, + uAdhocNumSupportedMcastAlgoPairs: ULONG, + pAdhocSupportedMcastAlgoPairs: PDOT11_AUTH_CIPHER_PAIR, + bAutoPowerSaveMode: BOOLEAN, + uMaxNetworkOffloadListSize: ULONG, + bMFPCapable: BOOLEAN, + uInfraNumSupportedMcastMgmtAlgoPairs: ULONG, + pInfraSupportedMcastMgmtAlgoPairs: PDOT11_AUTH_CIPHER_PAIR, + bNeighborReportSupported: BOOLEAN, + bAPChannelReportSupported: BOOLEAN, + bActionFramesSupported: BOOLEAN, + bANQPQueryOffloadSupported: BOOLEAN, + bHESSIDConnectionSupported: BOOLEAN, +}} +pub type PDOT11_EXTSTA_ATTRIBUTES = *mut DOT11_EXTSTA_ATTRIBUTES; +STRUCT!{struct DOT11_RECV_EXTENSION_INFO { + uVersion: ULONG, + pvReserved: PVOID, + dot11PhyType: DOT11_PHY_TYPE, + uChCenterFrequency: ULONG, + lRSSI: LONG, + lRSSIMin: LONG, + lRSSIMax: LONG, + uRSSI: ULONG, + ucPriority: UCHAR, + ucDataRate: UCHAR, + ucPeerMacAddress: [UCHAR; 6], + dwExtendedStatus: ULONG, + hWEPOffloadContext: HANDLE, + hAuthOffloadContext: HANDLE, + usWEPAppliedMask: USHORT, + usWPAMSDUPriority: USHORT, + dot11LowestIV48Counter: DOT11_IV48_COUNTER, + usDot11LeftRWBitMap: USHORT, + dot11HighestIV48Counter: DOT11_IV48_COUNTER, + usDot11RightRWBitMap: USHORT, + usNumberOfMPDUsReceived: USHORT, + usNumberOfFragments: USHORT, + pNdisPackets: [PVOID; 1], +}} +pub type PDOT11_RECV_EXTENSION_INFO = *mut DOT11_RECV_EXTENSION_INFO; +STRUCT!{struct DOT11_RECV_EXTENSION_INFO_V2 { + uVersion: ULONG, + pvReserved: PVOID, + dot11PhyType: DOT11_PHY_TYPE, + uChCenterFrequency: ULONG, + lRSSI: LONG, + uRSSI: ULONG, + ucPriority: UCHAR, + ucDataRate: UCHAR, + ucPeerMacAddress: [UCHAR; 6], + dwExtendedStatus: ULONG, + hWEPOffloadContext: HANDLE, + hAuthOffloadContext: HANDLE, + usWEPAppliedMask: USHORT, + usWPAMSDUPriority: USHORT, + dot11LowestIV48Counter: DOT11_IV48_COUNTER, + usDot11LeftRWBitMap: USHORT, + dot11HighestIV48Counter: DOT11_IV48_COUNTER, + usDot11RightRWBitMap: USHORT, + usNumberOfMPDUsReceived: USHORT, + usNumberOfFragments: USHORT, + pNdisPackets: [PVOID; 1], +}} +pub type PDOT11_RECV_EXTENSION_INFO_V2 = *mut DOT11_RECV_EXTENSION_INFO_V2; +pub const DOT11_STATUS_SUCCESS: NDIS_STATUS = 0x00000001; +pub const DOT11_STATUS_RETRY_LIMIT_EXCEEDED: NDIS_STATUS = 0x00000002; +pub const DOT11_STATUS_UNSUPPORTED_PRIORITY: NDIS_STATUS = 0x00000004; +pub const DOT11_STATUS_UNSUPPORTED_SERVICE_CLASS: NDIS_STATUS = 0x00000008; +pub const DOT11_STATUS_UNAVAILABLE_PRIORITY: NDIS_STATUS = 0x00000010; +pub const DOT11_STATUS_UNAVAILABLE_SERVICE_CLASS: NDIS_STATUS = 0x00000020; +pub const DOT11_STATUS_XMIT_MSDU_TIMER_EXPIRED: NDIS_STATUS = 0x00000040; +pub const DOT11_STATUS_UNAVAILABLE_BSS: NDIS_STATUS = 0x00000080; +pub const DOT11_STATUS_EXCESSIVE_DATA_LENGTH: NDIS_STATUS = 0x00000100; +pub const DOT11_STATUS_ENCRYPTION_FAILED: NDIS_STATUS = 0x00000200; +pub const DOT11_STATUS_WEP_KEY_UNAVAILABLE: NDIS_STATUS = 0x00000400; +pub const DOT11_STATUS_ICV_VERIFIED: NDIS_STATUS = 0x00000800; +pub const DOT11_STATUS_PACKET_REASSEMBLED: NDIS_STATUS = 0x00001000; +pub const DOT11_STATUS_PACKET_NOT_REASSEMBLED: NDIS_STATUS = 0x00002000; +pub const DOT11_STATUS_GENERATE_AUTH_FAILED: NDIS_STATUS = 0x00004000; +pub const DOT11_STATUS_AUTH_NOT_VERIFIED: NDIS_STATUS = 0x00008000; +pub const DOT11_STATUS_AUTH_VERIFIED: NDIS_STATUS = 0x00010000; +pub const DOT11_STATUS_AUTH_FAILED: NDIS_STATUS = 0x00020000; +pub const DOT11_STATUS_PS_LIFETIME_EXPIRED: NDIS_STATUS = 0x00040000; +STRUCT!{struct DOT11_STATUS_INDICATION { + uStatusType: ULONG, + ndisStatus: NDIS_STATUS, +}} +pub type PDOT11_STATUS_INDICATION = *mut DOT11_STATUS_INDICATION; +pub const DOT11_STATUS_RESET_CONFIRM: ULONG = 4; +pub const DOT11_STATUS_SCAN_CONFIRM: ULONG = 1; +pub const DOT11_STATUS_JOIN_CONFIRM: ULONG = 2; +pub const DOT11_STATUS_START_CONFIRM: ULONG = 3; +pub const DOT11_STATUS_AP_JOIN_CONFIRM: ULONG = 5; +pub const DOT11_STATUS_MPDU_MAX_LENGTH_CHANGED: ULONG = 6; +STRUCT!{struct DOT11_MPDU_MAX_LENGTH_INDICATION { + Header: NDIS_OBJECT_HEADER, + uPhyId: ULONG, + uMPDUMaxLength: ULONG, +}} +pub type PDOT11_MPDU_MAX_LENGTH_INDICATION = *mut DOT11_MPDU_MAX_LENGTH_INDICATION; +pub const DOT11_MPDU_MAX_LENGTH_INDICATION_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_ASSOCIATION_START_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + MacAddr: DOT11_MAC_ADDRESS, + SSID: DOT11_SSID, + uIHVDataOffset: ULONG, + uIHVDataSize: ULONG, +}} +pub type PDOT11_ASSOCIATION_START_PARAMETERS = *mut DOT11_ASSOCIATION_START_PARAMETERS; +pub const DOT11_ASSOCIATION_START_PARAMETERS_REVISION_1: UCHAR = 1; +pub const DOT11_ENCAP_RFC_1042: USHORT = 1; +pub const DOT11_ENCAP_802_1H: USHORT = 2; +STRUCT!{struct DOT11_ENCAP_ENTRY { + usEtherType: USHORT, + usEncapType: USHORT, +}} +pub type PDOT11_ENCAP_ENTRY = *mut DOT11_ENCAP_ENTRY; +ENUM!{enum DOT11_DS_INFO { + DOT11_DS_CHANGED = 0, + DOT11_DS_UNCHANGED = 1, + DOT11_DS_UNKNOWN = 2, +}} +pub type PDOT11_DS_INFO = *mut DOT11_DS_INFO; +pub type DOT11_ASSOC_STATUS = ULONG; +pub const DOT11_ASSOC_STATUS_SUCCESS: DOT11_ASSOC_STATUS = 0; +pub const DOT11_ASSOC_STATUS_FAILURE: DOT11_ASSOC_STATUS = 0x00000001; +pub const DOT11_ASSOC_STATUS_UNREACHABLE: DOT11_ASSOC_STATUS = 0x00000002; +pub const DOT11_ASSOC_STATUS_RADIO_OFF: DOT11_ASSOC_STATUS = 0x00000003; +pub const DOT11_ASSOC_STATUS_PHY_DISABLED: DOT11_ASSOC_STATUS = 0x00000004; +pub const DOT11_ASSOC_STATUS_CANCELLED: DOT11_ASSOC_STATUS = 0x00000005; +pub const DOT11_ASSOC_STATUS_CANDIDATE_LIST_EXHAUSTED: DOT11_ASSOC_STATUS = 0x00000006; +pub const DOT11_ASSOC_STATUS_DISASSOCIATED_BY_OS: DOT11_ASSOC_STATUS = 0x00000007; +pub const DOT11_ASSOC_STATUS_DISASSOCIATED_BY_ROAMING: DOT11_ASSOC_STATUS = 0x00000008; +pub const DOT11_ASSOC_STATUS_DISASSOCIATED_BY_RESET: DOT11_ASSOC_STATUS = 0x00000009; +pub const DOT11_ASSOC_STATUS_SYSTEM_ERROR: DOT11_ASSOC_STATUS = 0x0000000a; +pub const DOT11_ASSOC_STATUS_ROAMING_BETTER_AP_FOUND: DOT11_ASSOC_STATUS = 0x0000000b; +pub const DOT11_ASSOC_STATUS_ROAMING_ASSOCIATION_LOST: DOT11_ASSOC_STATUS = 0x0000000c; +pub const DOT11_ASSOC_STATUS_ROAMING_ADHOC: DOT11_ASSOC_STATUS = 0x0000000d; +pub const DOT11_ASSOC_STATUS_PEER_DEAUTHENTICATED: DOT11_ASSOC_STATUS = 0x00010000; +pub const DOT11_ASSOC_STATUS_PEER_DEAUTHENTICATED_START: DOT11_ASSOC_STATUS = + DOT11_ASSOC_STATUS_PEER_DEAUTHENTICATED; +pub const DOT11_ASSOC_STATUS_PEER_DEAUTHENTICATED_END: DOT11_ASSOC_STATUS = 0x0001ffff; +pub const DOT11_ASSOC_STATUS_PEER_DISASSOCIATED: DOT11_ASSOC_STATUS = 0x00020000; +pub const DOT11_ASSOC_STATUS_PEER_DISASSOCIATED_START: DOT11_ASSOC_STATUS = + DOT11_ASSOC_STATUS_PEER_DISASSOCIATED; +pub const DOT11_ASSOC_STATUS_PEER_DISASSOCIATED_END: DOT11_ASSOC_STATUS = 0x0002ffff; +pub const DOT11_ASSOC_STATUS_ASSOCIATION_RESPONSE: DOT11_ASSOC_STATUS = 0x00030000; +pub const DOT11_ASSOC_STATUS_ASSOCIATION_RESPONSE_START: DOT11_ASSOC_STATUS = + DOT11_ASSOC_STATUS_ASSOCIATION_RESPONSE; +pub const DOT11_ASSOC_STATUS_ASSOCIATION_RESPONSE_END: DOT11_ASSOC_STATUS = 0x0003ffff; +pub const DOT11_ASSOC_STATUS_REASON_CODE_MASK: DOT11_ASSOC_STATUS = 0xffff; +pub const DOT11_ASSOC_STATUS_IHV_START: DOT11_ASSOC_STATUS = 0x80000000; +pub const DOT11_ASSOC_STATUS_IHV_END: DOT11_ASSOC_STATUS = 0xffffffff; +STRUCT!{struct DOT11_ASSOCIATION_COMPLETION_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + MacAddr: DOT11_MAC_ADDRESS, + uStatus: DOT11_ASSOC_STATUS, + bReAssocReq: BOOLEAN, + bReAssocResp: BOOLEAN, + uAssocReqOffset: ULONG, + uAssocReqSize: ULONG, + uAssocRespOffset: ULONG, + uAssocRespSize: ULONG, + uBeaconOffset: ULONG, + uBeaconSize: ULONG, + uIHVDataOffset: ULONG, + uIHVDataSize: ULONG, + AuthAlgo: DOT11_AUTH_ALGORITHM, + UnicastCipher: DOT11_CIPHER_ALGORITHM, + MulticastCipher: DOT11_CIPHER_ALGORITHM, + uActivePhyListOffset: ULONG, + uActivePhyListSize: ULONG, + bFourAddressSupported: BOOLEAN, + bPortAuthorized: BOOLEAN, + ucActiveQoSProtocol: UCHAR, + DSInfo: DOT11_DS_INFO, + uEncapTableOffset: ULONG, + uEncapTableSize: ULONG, + MulticastMgmtCipher: DOT11_CIPHER_ALGORITHM, + uAssocComebackTime: ULONG, +}} +pub type PDOT11_ASSOCIATION_COMPLETION_PARAMETERS = *mut DOT11_ASSOCIATION_COMPLETION_PARAMETERS; +pub const DOT11_ASSOCIATION_COMPLETION_PARAMETERS_REVISION_1: UCHAR = 1; +pub const DOT11_ASSOCIATION_COMPLETION_PARAMETERS_REVISION_2: UCHAR = 2; +STRUCT!{struct DOT11_CONNECTION_START_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + BSSType: DOT11_BSS_TYPE, + AdhocBSSID: DOT11_MAC_ADDRESS, + AdhocSSID: DOT11_SSID, +}} +pub type PDOT11_CONNECTION_START_PARAMETERS = *mut DOT11_CONNECTION_START_PARAMETERS; +pub const DOT11_CONNECTION_START_PARAMETERS_REVISION_1: UCHAR = 1; +pub const DOT11_CONNECTION_STATUS_SUCCESS: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_SUCCESS; +pub const DOT11_CONNECTION_STATUS_FAILURE: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_FAILURE; +pub const DOT11_CONNECTION_STATUS_CANDIDATE_LIST_EXHAUSTED: DOT11_ASSOC_STATUS = + DOT11_ASSOC_STATUS_CANDIDATE_LIST_EXHAUSTED; +pub const DOT11_CONNECTION_STATUS_PHY_POWER_DOWN: DOT11_ASSOC_STATUS = + DOT11_ASSOC_STATUS_RADIO_OFF; +pub const DOT11_CONNECTION_STATUS_CANCELLED: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_CANCELLED; +pub const DOT11_CONNECTION_STATUS_IHV_START: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_IHV_START; +pub const DOT11_CONNECTION_STATUS_IHV_END: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_IHV_END; +STRUCT!{struct DOT11_CONNECTION_COMPLETION_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + uStatus: DOT11_ASSOC_STATUS, +}} +pub type PDOT11_CONNECTION_COMPLETION_PARAMETERS = *mut DOT11_CONNECTION_COMPLETION_PARAMETERS; +pub const DOT11_CONNECTION_COMPLETION_PARAMETERS_REVISION_1: UCHAR = 1; +pub const DOT11_ROAMING_REASON_BETTER_AP_FOUND: DOT11_ASSOC_STATUS = + DOT11_ASSOC_STATUS_ROAMING_BETTER_AP_FOUND; +pub const DOT11_ROAMING_REASON_ASSOCIATION_LOST: DOT11_ASSOC_STATUS = + DOT11_ASSOC_STATUS_ROAMING_ASSOCIATION_LOST; +pub const DOT11_ROAMING_REASON_ADHOC: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_ROAMING_ADHOC; +pub const DOT11_ROAMING_REASON_IHV_START: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_IHV_START; +pub const DOT11_ROAMING_REASON_IHV_END: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_IHV_END; +STRUCT!{struct DOT11_ROAMING_START_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + AdhocBSSID: DOT11_MAC_ADDRESS, + AdhocSSID: DOT11_SSID, + uRoamingReason: DOT11_ASSOC_STATUS, +}} +pub type PDOT11_ROAMING_START_PARAMETERS = *mut DOT11_ROAMING_START_PARAMETERS; +pub const DOT11_ROAMING_START_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_ROAMING_COMPLETION_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + uStatus: DOT11_ASSOC_STATUS, +}} +pub type PDOT11_ROAMING_COMPLETION_PARAMETERS = *mut DOT11_ROAMING_COMPLETION_PARAMETERS; +pub const DOT11_ROAMING_COMPLETION_PARAMETERS_REVISION_1: UCHAR = 1; +pub const DOT11_DISASSOC_REASON_OS: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_DISASSOCIATED_BY_OS; +pub const DOT11_DISASSOC_REASON_PEER_UNREACHABLE: DOT11_ASSOC_STATUS = + DOT11_ASSOC_STATUS_UNREACHABLE; +pub const DOT11_DISASSOC_REASON_PEER_DEAUTHENTICATED: DOT11_ASSOC_STATUS = + DOT11_ASSOC_STATUS_PEER_DEAUTHENTICATED; +pub const DOT11_DISASSOC_REASON_PEER_DISASSOCIATED: DOT11_ASSOC_STATUS = + DOT11_ASSOC_STATUS_PEER_DISASSOCIATED; +pub const DOT11_DISASSOC_REASON_RADIO_OFF: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_RADIO_OFF; +pub const DOT11_DISASSOC_REASON_PHY_DISABLED: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_PHY_DISABLED; +pub const DOT11_DISASSOC_REASON_IHV_START: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_IHV_START; +pub const DOT11_DISASSOC_REASON_IHV_END: DOT11_ASSOC_STATUS = DOT11_ASSOC_STATUS_IHV_END; +STRUCT!{struct DOT11_DISASSOCIATION_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + MacAddr: DOT11_MAC_ADDRESS, + uReason: DOT11_ASSOC_STATUS, + uIHVDataOffset: ULONG, + uIHVDataSize: ULONG, +}} +pub type PDOT11_DISASSOCIATION_PARAMETERS = *mut DOT11_DISASSOCIATION_PARAMETERS; +pub const DOT11_DISASSOCIATION_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_TKIPMIC_FAILURE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + bDefaultKeyFailure: BOOLEAN, + uKeyIndex: ULONG, + PeerMac: DOT11_MAC_ADDRESS, +}} +pub type PDOT11_TKIPMIC_FAILURE_PARAMETERS = *mut DOT11_TKIPMIC_FAILURE_PARAMETERS; +pub const DOT11_TKIPMIC_FAILURE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_PMKID_CANDIDATE_LIST_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + uCandidateListSize: ULONG, + uCandidateListOffset: ULONG, +}} +pub type PDOT11_PMKID_CANDIDATE_LIST_PARAMETERS = *mut DOT11_PMKID_CANDIDATE_LIST_PARAMETERS; +pub const DOT11_PMKID_CANDIDATE_LIST_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_BSSID_CANDIDATE { + BSSID: DOT11_MAC_ADDRESS, + uFlags: ULONG, +}} +pub type PDOT11_BSSID_CANDIDATE = *mut DOT11_BSSID_CANDIDATE; +pub const DOT11_PMKID_CANDIDATE_PREAUTH_ENABLED: ULONG = 0x00000001; +STRUCT!{struct DOT11_PHY_STATE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + uPhyId: ULONG, + bHardwarePhyState: BOOLEAN, + bSoftwarePhyState: BOOLEAN, +}} +pub type PDOT11_PHY_STATE_PARAMETERS = *mut DOT11_PHY_STATE_PARAMETERS; +pub const DOT11_PHY_STATE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_LINK_QUALITY_ENTRY { + PeerMacAddr: DOT11_MAC_ADDRESS, + ucLinkQuality: UCHAR, +}} +pub type PDOT11_LINK_QUALITY_ENTRY = *mut DOT11_LINK_QUALITY_ENTRY; +STRUCT!{struct DOT11_LINK_QUALITY_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + uLinkQualityListSize: ULONG, + uLinkQualityListOffset: ULONG, +}} +pub type PDOT11_LINK_QUALITY_PARAMETERS = *mut DOT11_LINK_QUALITY_PARAMETERS; +pub const DOT11_LINK_QUALITY_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_EXTSTA_SEND_CONTEXT { + Header: NDIS_OBJECT_HEADER, + usExemptionActionType: USHORT, + uPhyId: ULONG, + uDelayedSleepValue: ULONG, + pvMediaSpecificInfo: PVOID, + uSendFlags: ULONG, +}} +pub type PDOT11_EXTSTA_SEND_CONTEXT = *mut DOT11_EXTSTA_SEND_CONTEXT; +pub type DOT11_EXTAP_SEND_CONTEXT = DOT11_EXTSTA_SEND_CONTEXT; +pub type PDOT11_EXTAP_SEND_CONTEXT = *mut DOT11_EXTSTA_SEND_CONTEXT; +pub const DOT11_EXTSTA_SEND_CONTEXT_REVISION_1: UCHAR = 1; +pub const DOT11_RECV_FLAG_RAW_PACKET: ULONG = 0x00000001; +pub const DOT11_RECV_FLAG_RAW_PACKET_FCS_FAILURE: ULONG = 0x00000002; +pub const DOT11_RECV_FLAG_RAW_PACKET_TIMESTAMP: ULONG = 0x00000004; +pub const DOT11_EXTSTA_RECV_CONTEXT_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_EXTSTA_RECV_CONTEXT { + Header: NDIS_OBJECT_HEADER, + uReceiveFlags: ULONG, + uPhyId: ULONG, + uChCenterFrequency: ULONG, + usNumberOfMPDUsReceived: USHORT, + lRSSI: LONG, + ucDataRate: UCHAR, + uSizeMediaSpecificInfo: ULONG, + pvMediaSpecificInfo: PVOID, + ullTimestamp: ULONGLONG, +}} +pub type PDOT11_EXTSTA_RECV_CONTEXT = *mut DOT11_EXTSTA_RECV_CONTEXT; +pub type DOT11_EXTAP_RECV_CONTEXT = DOT11_EXTSTA_RECV_CONTEXT; +pub type PDOT11_EXTAP_RECV_CONTEXT = *mut DOT11_EXTSTA_RECV_CONTEXT; +pub const OID_DOT11_PRIVATE_OIDS_START: u32 = OID_DOT11_NDIS_START + 1024; +pub const OID_DOT11_CURRENT_ADDRESS: u32 = OID_DOT11_PRIVATE_OIDS_START + 2; +pub const OID_DOT11_PERMANENT_ADDRESS: u32 = OID_DOT11_PRIVATE_OIDS_START + 3; +pub const OID_DOT11_MULTICAST_LIST: u32 = OID_DOT11_PRIVATE_OIDS_START + 4; +pub const OID_DOT11_MAXIMUM_LIST_SIZE: u32 = OID_DOT11_PRIVATE_OIDS_START + 5; +macro_rules! DEFINE_NWF_GUID { + ($name:ident, $ord:expr) => { + DEFINE_GUID!{ + $name, 0x6cb9a43e + $ord, 0xc45f, 0x4039, 0x9f, 0xe6, 0xd0, 0x8c, 0xb0, 0x57, 0x18, + 0x4c + } + }; +} +DEFINE_NWF_GUID!{GUID_NWF_OFFLOAD_CAPABILITY, 0} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_OFFLOAD_CAPABILITY, 1} +DEFINE_NWF_GUID!{GUID_NWF_WEP_OFFLOAD, 2} +DEFINE_NWF_GUID!{GUID_NWF_WEP_UPLOAD, 3} +DEFINE_NWF_GUID!{GUID_NWF_DEFAULT_WEP_OFFLOAD, 4} +DEFINE_NWF_GUID!{GUID_NWF_DEFAULT_WEP_UPLOAD, 5} +DEFINE_NWF_GUID!{GUID_NWF_MPDU_MAX_LENGTH, 6} +DEFINE_NWF_GUID!{GUID_NWF_OPERATION_MODE_CAPABILITY, 7} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_OPERATION_MODE, 8} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_PACKET_FILTER, 9} +DEFINE_NWF_GUID!{GUID_NWF_ATIM_WINDOW, 10} +DEFINE_NWF_GUID!{GUID_NWF_SCAN_REQUEST, 11} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_PHY_TYPE, 12} +DEFINE_NWF_GUID!{GUID_NWF_JOIN_REQUEST, 13} +DEFINE_NWF_GUID!{GUID_NWF_START_REQUEST, 14} +DEFINE_NWF_GUID!{GUID_NWF_UPDATE_IE, 15} +DEFINE_NWF_GUID!{GUID_NWF_RESET_REQUEST, 16} +DEFINE_NWF_GUID!{GUID_NWF_NIC_POWER_STATE, 17} +DEFINE_NWF_GUID!{GUID_NWF_OPTIONAL_CAPABILITY, 18} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_OPTIONAL_CAPABILITY, 19} +DEFINE_NWF_GUID!{GUID_NWF_STATION_ID, 20} +DEFINE_NWF_GUID!{GUID_NWF_MEDIUM_OCCUPANCY_LIMIT, 21} +DEFINE_NWF_GUID!{GUID_NWF_CF_POLLABLE, 22} +DEFINE_NWF_GUID!{GUID_NWF_CFP_PERIOD, 23} +DEFINE_NWF_GUID!{GUID_NWF_CFP_MAX_DURATION, 24} +DEFINE_NWF_GUID!{GUID_NWF_POWER_MGMT_MODE, 25} +DEFINE_NWF_GUID!{GUID_NWF_OPERATIONAL_RATE_SET, 26} +DEFINE_NWF_GUID!{GUID_NWF_BEACON_PERIOD, 27} +DEFINE_NWF_GUID!{GUID_NWF_DTIM_PERIOD, 28} +DEFINE_NWF_GUID!{GUID_NWF_WEP_ICV_ERROR_COUNT, 29} +DEFINE_NWF_GUID!{GUID_NWF_MAC_ADDRESS, 30} +DEFINE_NWF_GUID!{GUID_NWF_RTS_THRESHOLD, 31} +DEFINE_NWF_GUID!{GUID_NWF_SHORT_RETRY_LIMIT, 32} +DEFINE_NWF_GUID!{GUID_NWF_LONG_RETRY_LIMIT, 33} +DEFINE_NWF_GUID!{GUID_NWF_FRAGMENTATION_THRESHOLD, 34} +DEFINE_NWF_GUID!{GUID_NWF_MAX_TRANSMIT_MSDU_LIFETIME, 35} +DEFINE_NWF_GUID!{GUID_NWF_MAX_RECEIVE_LIFETIME, 36} +DEFINE_NWF_GUID!{GUID_NWF_COUNTERS_ENTRY, 37} +DEFINE_NWF_GUID!{GUID_NWF_SUPPORTED_PHY_TYPES, 38} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_REG_DOMAIN, 39} +DEFINE_NWF_GUID!{GUID_NWF_TEMP_TYPE, 40} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_TX_ANTENNA, 41} +DEFINE_NWF_GUID!{GUID_NWF_DIVERSITY_SUPPORT, 42} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_RX_ANTENNA, 43} +DEFINE_NWF_GUID!{GUID_NWF_SUPPORTED_POWER_LEVELS, 44} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_TX_POWER_LEVEL, 45} +DEFINE_NWF_GUID!{GUID_NWF_HOP_TIME, 46} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_CHANNEL_NUMBER, 47} +DEFINE_NWF_GUID!{GUID_NWF_MAX_DWELL_TIME, 48} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_DWELL_TIME, 49} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_SET, 50} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_PATTERN, 51} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_INDEX, 52} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_CHANNEL, 53} +DEFINE_NWF_GUID!{GUID_NWF_CCA_MODE_SUPPORTED, 54} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_CCA_MODE, 55} +DEFINE_NWF_GUID!{GUID_NWF_ED_THRESHOLD, 56} +DEFINE_NWF_GUID!{GUID_NWF_CCA_WATCHDOG_TIMER_MAX, 57} +DEFINE_NWF_GUID!{GUID_NWF_CCA_WATCHDOG_COUNT_MAX, 58} +DEFINE_NWF_GUID!{GUID_NWF_CCA_WATCHDOG_TIMER_MIN, 59} +DEFINE_NWF_GUID!{GUID_NWF_CCA_WATCHDOG_COUNT_MIN, 60} +DEFINE_NWF_GUID!{GUID_NWF_REG_DOMAINS_SUPPORT_VALUE, 61} +DEFINE_NWF_GUID!{GUID_NWF_SUPPORTED_TX_ANTENNA, 62} +DEFINE_NWF_GUID!{GUID_NWF_SUPPORTED_RX_ANTENNA, 63} +DEFINE_NWF_GUID!{GUID_NWF_DIVERSITY_SELECTION_RX, 64} +DEFINE_NWF_GUID!{GUID_NWF_SUPPORTED_DATA_RATES_VALUE, 65} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_FREQUENCY, 66} +DEFINE_NWF_GUID!{GUID_NWF_TI_THRESHOLD, 67} +DEFINE_NWF_GUID!{GUID_NWF_FREQUENCY_BANDS_SUPPORTED, 68} +DEFINE_NWF_GUID!{GUID_NWF_SHORT_PREAMBLE_OPTION_IMPLEMENTED, 69} +DEFINE_NWF_GUID!{GUID_NWF_PBCC_OPTION_IMPLEMENTED, 70} +DEFINE_NWF_GUID!{GUID_NWF_CHANNEL_AGILITY_PRESENT, 71} +DEFINE_NWF_GUID!{GUID_NWF_CHANNEL_AGILITY_ENABLED, 72} +DEFINE_NWF_GUID!{GUID_NWF_HR_CCA_MODE_SUPPORTED, 73} +DEFINE_NWF_GUID!{GUID_NWF_MULTI_DOMAIN_CAPABILITY_IMPLEMENTED, 74} +DEFINE_NWF_GUID!{GUID_NWF_MULTI_DOMAIN_CAPABILITY_ENABLED, 75} +DEFINE_NWF_GUID!{GUID_NWF_COUNTRY_STRING, 76} +DEFINE_NWF_GUID!{GUID_NWF_MULTI_DOMAIN_CAPABILITY, 77} +DEFINE_NWF_GUID!{GUID_NWF_EHCC_PRIME_RADIX, 78} +DEFINE_NWF_GUID!{GUID_NWF_EHCC_NUMBER_OF_CHANNELS_FAMILY_INDEX, 79} +DEFINE_NWF_GUID!{GUID_NWF_EHCC_CAPABILITY_IMPLEMENTED, 80} +DEFINE_NWF_GUID!{GUID_NWF_EHCC_CAPABILITY_ENABLED, 81} +DEFINE_NWF_GUID!{GUID_NWF_HOP_ALGORITHM_ADOPTED, 82} +DEFINE_NWF_GUID!{GUID_NWF_RANDOM_TABLE_FLAG, 83} +DEFINE_NWF_GUID!{GUID_NWF_NUMBER_OF_HOPPING_SETS, 84} +DEFINE_NWF_GUID!{GUID_NWF_HOP_MODULUS, 85} +DEFINE_NWF_GUID!{GUID_NWF_HOP_OFFSET, 86} +DEFINE_NWF_GUID!{GUID_NWF_HOPPING_PATTERN, 87} +DEFINE_NWF_GUID!{GUID_NWF_RANDOM_TABLE_FIELD_NUMBER, 88} +DEFINE_NWF_GUID!{GUID_NWF_WPA_TSC, 89} +DEFINE_NWF_GUID!{GUID_NWF_RSSI_RANGE, 90} +DEFINE_NWF_GUID!{GUID_NWF_RF_USAGE, 91} +DEFINE_NWF_GUID!{GUID_NWF_NIC_SPECIFIC_EXTENSION, 92} +DEFINE_NWF_GUID!{GUID_NWF_AP_JOIN_REQUEST, 93} +DEFINE_NWF_GUID!{GUID_NWF_ERP_PBCC_OPTION_IMPLEMENTED, 94} +DEFINE_NWF_GUID!{GUID_NWF_ERP_PBCC_OPTION_ENABLED, 95} +DEFINE_NWF_GUID!{GUID_NWF_DSSS_OFDM_OPTION_IMPLEMENTED, 96} +DEFINE_NWF_GUID!{GUID_NWF_DSSS_OFDM_OPTION_ENABLED, 97} +DEFINE_NWF_GUID!{GUID_NWF_SHORT_SLOT_TIME_OPTION_IMPLEMENTED, 98} +DEFINE_NWF_GUID!{GUID_NWF_SHORT_SLOT_TIME_OPTION_ENABLED, 99} +DEFINE_NWF_GUID!{GUID_NWF_MAX_MAC_ADDRESS_STATES, 100} +DEFINE_NWF_GUID!{GUID_NWF_RECV_SENSITIVITY_LIST, 101} +DEFINE_NWF_GUID!{GUID_NWF_WME_IMPLEMENTED, 102} +DEFINE_NWF_GUID!{GUID_NWF_WME_ENABLED, 103} +DEFINE_NWF_GUID!{GUID_NWF_WME_AC_PARAMETERS, 104} +DEFINE_NWF_GUID!{GUID_NWF_WME_UPDATE_IE, 105} +DEFINE_NWF_GUID!{GUID_NWF_QOS_TX_QUEUES_SUPPORTED, 106} +DEFINE_NWF_GUID!{GUID_NWF_QOS_TX_DURATION, 107} +DEFINE_NWF_GUID!{GUID_NWF_QOS_TX_MEDIUM_TIME, 108} +DEFINE_NWF_GUID!{GUID_NWF_SUPPORTED_OFDM_FREQUENCY_LIST, 109} +DEFINE_NWF_GUID!{GUID_NWF_SUPPORTED_DSSS_CHANNEL_LIST, 110} +DEFINE_NWF_GUID!{GUID_NWF_AUTO_CONFIG_ENABLED, 120} +DEFINE_NWF_GUID!{GUID_NWF_ENUM_BSS_LIST, 121} +DEFINE_NWF_GUID!{GUID_NWF_FLUSH_BSS_LIST, 122} +DEFINE_NWF_GUID!{GUID_NWF_POWER_MGMT_REQUEST, 123} +DEFINE_NWF_GUID!{GUID_NWF_DESIRED_SSID_LIST, 124} +DEFINE_NWF_GUID!{GUID_NWF_EXCLUDED_MAC_ADDRESS_LIST, 125} +DEFINE_NWF_GUID!{GUID_NWF_DESIRED_BSSID_LIST, 126} +DEFINE_NWF_GUID!{GUID_NWF_DESIRED_BSS_TYPE, 127} +DEFINE_NWF_GUID!{GUID_NWF_PMKID_LIST, 128} +DEFINE_NWF_GUID!{GUID_NWF_CONNECT_REQUEST, 129} +DEFINE_NWF_GUID!{GUID_NWF_EXCLUDE_UNENCRYPTED, 130} +DEFINE_NWF_GUID!{GUID_NWF_STATISTICS, 131} +DEFINE_NWF_GUID!{GUID_NWF_PRIVACY_EXEMPTION_LIST, 132} +DEFINE_NWF_GUID!{GUID_NWF_ENABLED_AUTHENTICATION_ALGORITHM, 133} +DEFINE_NWF_GUID!{GUID_NWF_SUPPORTED_UNICAST_ALGORITHM_PAIR, 134} +DEFINE_NWF_GUID!{GUID_NWF_ENABLED_UNICAST_CIPHER_ALGORITHM, 135} +DEFINE_NWF_GUID!{GUID_NWF_SUPPORTED_MULTICAST_ALGORITHM_PAIR, 136} +DEFINE_NWF_GUID!{GUID_NWF_ENABLED_MULTICAST_CIPHER_ALGORITHM, 137} +DEFINE_NWF_GUID!{GUID_NWF_CIPHER_DEFAULT_KEY_ID, 138} +DEFINE_NWF_GUID!{GUID_NWF_CIPHER_DEFAULT_KEY, 139} +DEFINE_NWF_GUID!{GUID_NWF_CIPHER_KEY_MAPPING_KEY, 140} +DEFINE_NWF_GUID!{GUID_NWF_ENUM_ASSOCIATION_INFO, 141} +DEFINE_NWF_GUID!{GUID_NWF_DISCONNECT_REQUEST, 142} +DEFINE_NWF_GUID!{GUID_NWF_UNICAST_USE_GROUP_ENABLED, 143} +DEFINE_NWF_GUID!{GUID_NWF_PHY_STATE, 144} +DEFINE_NWF_GUID!{GUID_NWF_DESIRED_PHY_LIST, 145} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_PHY_ID, 146} +DEFINE_NWF_GUID!{GUID_NWF_MEDIA_STREAMING_ENABLED, 147} +DEFINE_NWF_GUID!{GUID_NWF_UNREACHABLE_DETECTION_THRESHOLD, 148} +DEFINE_NWF_GUID!{GUID_NWF_ACTIVE_PHY_LIST, 149} +DEFINE_NWF_GUID!{GUID_NWF_EXTSTA_CAPABILITY, 150} +DEFINE_NWF_GUID!{GUID_NWF_DATA_RATE_MAPPING_TABLE, 151} +DEFINE_NWF_GUID!{GUID_NWF_SUPPORTED_COUNTRY_OR_REGION_STRING, 152} +DEFINE_NWF_GUID!{GUID_NWF_DESIRED_COUNTRY_OR_REGION_STRING, 153} +DEFINE_NWF_GUID!{GUID_NWF_PORT_STATE_NOTIFICATION, 154} +DEFINE_NWF_GUID!{GUID_NWF_IBSS_PARAMS, 155} +DEFINE_NWF_GUID!{GUID_NWF_QOS_PARAMS, 156} +DEFINE_NWF_GUID!{GUID_NWF_SAFE_MODE_ENABLED, 157} +DEFINE_NWF_GUID!{GUID_NWF_HIDDEN_NETWORK_ENABLED, 158} +DEFINE_NWF_GUID!{GUID_NWF_ASSOCIATION_PARAMS, 159} +DEFINE_NWF_GUID!{GUID_NWF_CURRENT_ADDRESS, 1024 + 2} +DEFINE_NWF_GUID!{GUID_NWF_PERMANENT_ADDRESS, 1024 + 3} +DEFINE_NWF_GUID!{GUID_NWF_MULTICAST_LIST, 1024 + 4} +DEFINE_NWF_GUID!{GUID_NWF_MAXIMUM_LIST_SIZE, 1024 + 5} +pub const DOT11_EXTAP_ATTRIBUTES_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_EXTAP_ATTRIBUTES { + Header: NDIS_OBJECT_HEADER, + uScanSSIDListSize: ULONG, + uDesiredSSIDListSize: ULONG, + uPrivacyExemptionListSize: ULONG, + uAssociationTableSize: ULONG, + uDefaultKeyTableSize: ULONG, + uWEPKeyValueMaxLength: ULONG, + bStrictlyOrderedServiceClassImplemented: BOOLEAN, + uNumSupportedCountryOrRegionStrings: ULONG, + pSupportedCountryOrRegionStrings: PDOT11_COUNTRY_OR_REGION_STRING, + uInfraNumSupportedUcastAlgoPairs: ULONG, + pInfraSupportedUcastAlgoPairs: PDOT11_AUTH_CIPHER_PAIR, + uInfraNumSupportedMcastAlgoPairs: ULONG, + pInfraSupportedMcastAlgoPairs: PDOT11_AUTH_CIPHER_PAIR, +}} +pub type PDOT11_EXTAP_ATTRIBUTES = *mut DOT11_EXTAP_ATTRIBUTES; +pub const DOT11_INCOMING_ASSOC_STARTED_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_INCOMING_ASSOC_STARTED_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerMacAddr: DOT11_MAC_ADDRESS, +}} +pub type PDOT11_INCOMING_ASSOC_STARTED_PARAMETERS = *mut DOT11_INCOMING_ASSOC_STARTED_PARAMETERS; +pub const DOT11_INCOMING_ASSOC_REQUEST_RECEIVED_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_INCOMING_ASSOC_REQUEST_RECEIVED_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerMacAddr: DOT11_MAC_ADDRESS, + bReAssocReq: BOOLEAN, + uAssocReqOffset: ULONG, + uAssocReqSize: ULONG, +}} +pub type PDOT11_INCOMING_ASSOC_REQUEST_RECEIVED_PARAMETERS = + *mut DOT11_INCOMING_ASSOC_REQUEST_RECEIVED_PARAMETERS; +pub const DOT11_ASSOC_ERROR_SOURCE_OS: UCHAR = 0x0; +pub const DOT11_ASSOC_ERROR_SOURCE_REMOTE: UCHAR = 0x01; +pub const DOT11_ASSOC_ERROR_SOURCE_OTHER: UCHAR = 0xFF; +pub const DOT11_INCOMING_ASSOC_COMPLETION_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_INCOMING_ASSOC_COMPLETION_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerMacAddr: DOT11_MAC_ADDRESS, + uStatus: ULONG, + ucErrorSource: UCHAR, + bReAssocReq: BOOLEAN, + bReAssocResp: BOOLEAN, + uAssocReqOffset: ULONG, + uAssocReqSize: ULONG, + uAssocRespOffset: ULONG, + uAssocRespSize: ULONG, + AuthAlgo: DOT11_AUTH_ALGORITHM, + UnicastCipher: DOT11_CIPHER_ALGORITHM, + MulticastCipher: DOT11_CIPHER_ALGORITHM, + uActivePhyListOffset: ULONG, + uActivePhyListSize: ULONG, + uBeaconOffset: ULONG, + uBeaconSize: ULONG, +}} +pub type PDOT11_INCOMING_ASSOC_COMPLETION_PARAMETERS = + *mut DOT11_INCOMING_ASSOC_COMPLETION_PARAMETERS; +pub const DOT11_STOP_AP_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_STOP_AP_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + ulReason: ULONG, +}} +pub type PDOT11_STOP_AP_PARAMETERS = *mut DOT11_STOP_AP_PARAMETERS; +pub const DOT11_STOP_AP_REASON_FREQUENCY_NOT_AVAILABLE: ULONG = 0x1; +pub const DOT11_STOP_AP_REASON_CHANNEL_NOT_AVAILABLE: ULONG = 0x2; +pub const DOT11_STOP_AP_REASON_AP_ACTIVE: ULONG = 0x3; +pub const DOT11_STOP_AP_REASON_IHV_START: ULONG = 0xFF000000; +pub const DOT11_STOP_AP_REASON_IHV_END: ULONG = 0xFFFFFFFF; +pub const DOT11_PHY_FREQUENCY_ADOPTED_PARAMETERS_REVISION_1: UCHAR = 1; +UNION!{union DOT11_PHY_FREQUENCY_ADOPTED_PARAMETERS_u { + [u32; 1], + ulChannel ulChannel_mut: ULONG, + ulFrequency ulFrequency_mut: ULONG, +}} +STRUCT!{struct DOT11_PHY_FREQUENCY_ADOPTED_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + ulPhyId: ULONG, + u: DOT11_PHY_FREQUENCY_ADOPTED_PARAMETERS_u, +}} +pub type PDOT11_PHY_FREQUENCY_ADOPTED_PARAMETERS = *mut DOT11_PHY_FREQUENCY_ADOPTED_PARAMETERS; +pub const DOT11_CAN_SUSTAIN_AP_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_CAN_SUSTAIN_AP_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + ulReason: ULONG, +}} +pub type PDOT11_CAN_SUSTAIN_AP_PARAMETERS = *mut DOT11_CAN_SUSTAIN_AP_PARAMETERS; +pub const DOT11_CAN_SUSTAIN_AP_REASON_IHV_START: ULONG = 0xFF000000; +pub const DOT11_CAN_SUSTAIN_AP_REASON_IHV_END: ULONG = 0xFFFFFFFF; +pub const NWF_EXTAP_OID: u32 = 0x03; +pub const OID_DOT11_WPS_ENABLED: u32 = NWF_DEFINE_OID!(0x01, NWF_EXTAP_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_START_AP_REQUEST: u32 = + NWF_DEFINE_OID!(0x02, NWF_EXTAP_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_AVAILABLE_CHANNEL_LIST: u32 = + NWF_DEFINE_OID!(0x03, NWF_EXTAP_OID, NWF_MANDATORY_OID); +pub const DOT11_AVAILABLE_CHANNEL_LIST_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_AVAILABLE_CHANNEL_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + uChannelNumber: [ULONG; 1], +}} +pub type PDOT11_AVAILABLE_CHANNEL_LIST = *mut DOT11_AVAILABLE_CHANNEL_LIST; +pub const OID_DOT11_AVAILABLE_FREQUENCY_LIST: u32 = + NWF_DEFINE_OID!(0x04, NWF_EXTAP_OID, NWF_MANDATORY_OID); +pub const DOT11_AVAILABLE_FREQUENCY_LIST_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_AVAILABLE_FREQUENCY_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + uFrequencyValue: [ULONG; 1], +}} +pub type PDOT11_AVAILABLE_FREQUENCY_LIST = *mut DOT11_AVAILABLE_FREQUENCY_LIST; +pub const OID_DOT11_DISASSOCIATE_PEER_REQUEST: u32 = + NWF_DEFINE_OID!(0x05, NWF_EXTAP_OID, NWF_MANDATORY_OID); +pub const DOT11_DISASSOCIATE_PEER_REQUEST_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_DISASSOCIATE_PEER_REQUEST { + Header: NDIS_OBJECT_HEADER, + PeerMacAddr: DOT11_MAC_ADDRESS, + usReason: USHORT, +}} +pub type PDOT11_DISASSOCIATE_PEER_REQUEST = *mut DOT11_DISASSOCIATE_PEER_REQUEST; +pub const OID_DOT11_INCOMING_ASSOCIATION_DECISION: u32 = + NWF_DEFINE_OID!(0x06, NWF_EXTAP_OID, NWF_MANDATORY_OID); +pub const DOT11_INCOMING_ASSOC_DECISION_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_INCOMING_ASSOC_DECISION { + Header: NDIS_OBJECT_HEADER, + PeerMacAddr: DOT11_MAC_ADDRESS, + bAccept: BOOLEAN, + usReasonCode: USHORT, + uAssocResponseIEsOffset: ULONG, + uAssocResponseIEsLength: ULONG, +}} +pub type PDOT11_INCOMING_ASSOC_DECISION = *mut DOT11_INCOMING_ASSOC_DECISION; +pub const DOT11_INCOMING_ASSOC_DECISION_REVISION_2: UCHAR = 2; +STRUCT!{struct DOT11_INCOMING_ASSOC_DECISION_V2 { + Header: NDIS_OBJECT_HEADER, + PeerMacAddr: DOT11_MAC_ADDRESS, + bAccept: BOOLEAN, + usReasonCode: USHORT, + uAssocResponseIEsOffset: ULONG, + uAssocResponseIEsLength: ULONG, + WFDStatus: DOT11_WFD_STATUS_CODE, +}} +pub type PDOT11_INCOMING_ASSOC_DECISION_V2 = *mut DOT11_INCOMING_ASSOC_DECISION_V2; +pub const OID_DOT11_ADDITIONAL_IE: u32 = NWF_DEFINE_OID!(0x07, NWF_EXTAP_OID, NWF_MANDATORY_OID); +pub const DOT11_ADDITIONAL_IE_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_ADDITIONAL_IE { + Header: NDIS_OBJECT_HEADER, + uBeaconIEsOffset: ULONG, + uBeaconIEsLength: ULONG, + uResponseIEsOffset: ULONG, + uResponseIEsLength: ULONG, +}} +pub type PDOT11_ADDITIONAL_IE = *mut DOT11_ADDITIONAL_IE; +pub const DOT11_EXTAP_SEND_CONTEXT_REVISION_1: UCHAR = 1; +pub const DOT11_EXTAP_RECV_CONTEXT_REVISION_1: UCHAR = 1; +pub const OID_DOT11_ENUM_PEER_INFO: u32 = NWF_DEFINE_OID!(0x08, NWF_EXTAP_OID, NWF_MANDATORY_OID); +STRUCT!{struct DOT11_PEER_STATISTICS { + ullDecryptSuccessCount: ULONGLONG, + ullDecryptFailureCount: ULONGLONG, + ullTxPacketSuccessCount: ULONGLONG, + ullTxPacketFailureCount: ULONGLONG, + ullRxPacketSuccessCount: ULONGLONG, + ullRxPacketFailureCount: ULONGLONG, +}} +pub type PDOT11_PEER_STATISTICS = *mut DOT11_PEER_STATISTICS; +STRUCT!{struct DOT11_PEER_INFO { + MacAddress: DOT11_MAC_ADDRESS, + usCapabilityInformation: USHORT, + AuthAlgo: DOT11_AUTH_ALGORITHM, + UnicastCipherAlgo: DOT11_CIPHER_ALGORITHM, + MulticastCipherAlgo: DOT11_CIPHER_ALGORITHM, + bWpsEnabled: BOOLEAN, + usListenInterval: USHORT, + ucSupportedRates: [UCHAR; MAX_NUM_SUPPORTED_RATES_V2], + usAssociationID: USHORT, + AssociationState: DOT11_ASSOCIATION_STATE, + PowerMode: DOT11_POWER_MODE, + liAssociationUpTime: LARGE_INTEGER, + Statistics: DOT11_PEER_STATISTICS, +}} +pub type PDOT11_PEER_INFO = *mut DOT11_PEER_INFO; +pub const DOT11_PEER_INFO_LIST_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_PEER_INFO_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + PeerInfo: [DOT11_PEER_INFO; 1], +}} +pub type PDOT11_PEER_INFO_LIST = *mut DOT11_PEER_INFO_LIST; +pub const DOT11_VWIFI_COMBINATION_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_VWIFI_COMBINATION { + Header: NDIS_OBJECT_HEADER, + uNumInfrastructure: ULONG, + uNumAdhoc: ULONG, + uNumSoftAP: ULONG, +}} +pub type PDOT11_VWIFI_COMBINATION = *mut DOT11_VWIFI_COMBINATION; +pub const DOT11_VWIFI_COMBINATION_REVISION_2: UCHAR = 2; +STRUCT!{struct DOT11_VWIFI_COMBINATION_V2 { + Header: NDIS_OBJECT_HEADER, + uNumInfrastructure: ULONG, + uNumAdhoc: ULONG, + uNumSoftAP: ULONG, + uNumVirtualStation: ULONG, +}} +pub type PDOT11_VWIFI_COMBINATION_V2 = *mut DOT11_VWIFI_COMBINATION_V2; +pub const DOT11_VWIFI_COMBINATION_REVISION_3: UCHAR = 3; +STRUCT!{struct DOT11_VWIFI_COMBINATION_V3 { + Header: NDIS_OBJECT_HEADER, + uNumInfrastructure: ULONG, + uNumAdhoc: ULONG, + uNumSoftAP: ULONG, + uNumVirtualStation: ULONG, + uNumWFDGroup: ULONG, +}} +pub type PDOT11_VWIFI_COMBINATION_V3 = *mut DOT11_VWIFI_COMBINATION_V3; +pub const DOT11_VWIFI_ATTRIBUTES_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_VWIFI_ATTRIBUTES { + Header: NDIS_OBJECT_HEADER, + uTotalNumOfEntries: ULONG, + Combinations: [DOT11_VWIFI_COMBINATION; 1], +}} +pub type PDOT11_VWIFI_ATTRIBUTES = *mut DOT11_VWIFI_ATTRIBUTES; +pub const NWF_VWIFI_OID: u32 = 0x04; +pub const OID_DOT11_CREATE_MAC: u32 = NWF_DEFINE_OID!(0x01, NWF_VWIFI_OID, NWF_MANDATORY_OID); +pub const DOT11_MAC_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_MAC_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + uOpmodeMask: ULONG, +}} +pub type PDOT11_MAC_PARAMETERS = *mut DOT11_MAC_PARAMETERS; +STRUCT!{struct DOT11_MAC_INFO { + uReserved: ULONG, + uNdisPortNumber: ULONG, + MacAddr: DOT11_MAC_ADDRESS, +}} +pub type PDOT11_MAC_INFO = *mut DOT11_MAC_INFO; +pub const OID_DOT11_DELETE_MAC: u32 = NWF_DEFINE_OID!(0x02, NWF_VWIFI_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_PREFERRED_MAC: u32 = NWF_DEFINE_OID!(0x03, NWF_VWIFI_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_VIRTUAL_STATION_CAPABILITY: u32 = + NWF_DEFINE_OID!(0x04, NWF_VWIFI_OID, NWF_OPTIONAL_OID); +pub const DOT11_WFD_ATTRIBUTES_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_ATTRIBUTES { + Header: NDIS_OBJECT_HEADER, + uNumConcurrentGORole: ULONG, + uNumConcurrentClientRole: ULONG, + WPSVersionsSupported: ULONG, + bServiceDiscoverySupported: BOOLEAN, + bClientDiscoverabilitySupported: BOOLEAN, + bInfrastructureManagementSupported: BOOLEAN, + uMaxSecondaryDeviceTypeListSize: ULONG, + DeviceAddress: DOT11_MAC_ADDRESS, + uInterfaceAddressListCount: ULONG, + pInterfaceAddressList: PDOT11_MAC_ADDRESS, + uNumSupportedCountryOrRegionStrings: ULONG, + pSupportedCountryOrRegionStrings: PDOT11_COUNTRY_OR_REGION_STRING, + uDiscoveryFilterListSize: ULONG, + uGORoleClientTableSize: ULONG, +}} +pub type PDOT11_WFD_ATTRIBUTES = *mut DOT11_WFD_ATTRIBUTES; +pub type DOT11_WFD_GROUP_CAPABILITY = UCHAR; +pub const DOT11_WFD_STATUS_SUCCESS: DOT11_WFD_STATUS_CODE = 0; +pub const DOT11_WFD_STATUS_FAILED_INFORMATION_IS_UNAVAILABLE: DOT11_WFD_STATUS_CODE = 1; +pub const DOT11_WFD_STATUS_FAILED_INCOMPATIBLE_PARAMETERS: DOT11_WFD_STATUS_CODE = 2; +pub const DOT11_WFD_STATUS_FAILED_LIMIT_REACHED: DOT11_WFD_STATUS_CODE = 3; +pub const DOT11_WFD_STATUS_FAILED_INVALID_PARAMETERS: DOT11_WFD_STATUS_CODE = 4; +pub const DOT11_WFD_STATUS_FAILED_UNABLE_TO_ACCOMODATE_REQUEST: DOT11_WFD_STATUS_CODE = 5; +pub const DOT11_WFD_STATUS_FAILED_PREVIOUS_PROTOCOL_ERROR: DOT11_WFD_STATUS_CODE = 6; +pub const DOT11_WFD_STATUS_FAILED_NO_COMMON_CHANNELS: DOT11_WFD_STATUS_CODE = 7; +pub const DOT11_WFD_STATUS_FAILED_UNKNOWN_WFD_GROUP: DOT11_WFD_STATUS_CODE = 8; +pub const DOT11_WFD_STATUS_FAILED_MATCHING_MAX_INTENT: DOT11_WFD_STATUS_CODE = 9; +pub const DOT11_WFD_STATUS_FAILED_INCOMPATIBLE_PROVISIONING_METHOD: DOT11_WFD_STATUS_CODE = 10; +pub const DOT11_WFD_STATUS_FAILED_REJECTED_BY_USER: DOT11_WFD_STATUS_CODE = 11; +pub const DOT11_WFD_STATUS_SUCCESS_ACCEPTED_BY_USER: DOT11_WFD_STATUS_CODE = 12; +#[inline] +pub fn WFD_STATUS_SUCCEEDED(status: DOT11_WFD_STATUS_CODE) -> bool { + status == DOT11_WFD_STATUS_SUCCESS || status == DOT11_WFD_STATUS_SUCCESS_ACCEPTED_BY_USER +} +#[inline] +pub fn WFD_STATUS_FAILED(status: DOT11_WFD_STATUS_CODE) -> bool { + status != DOT11_WFD_STATUS_SUCCESS || status != DOT11_WFD_STATUS_SUCCESS_ACCEPTED_BY_USER +} +pub const DOT11_WFD_MINOR_REASON_SUCCESS: i32 = 0; +pub const DOT11_WFD_MINOR_REASON_DISASSOCIATED_FROM_WLAN_CROSS_CONNECTION_POLICY: i32 = 1; +pub const DOT11_WFD_MINOR_REASON_DISASSOCIATED_NOT_MANAGED_INFRASTRUCTURE_CAPABLE: i32 = 2; +pub const DOT11_WFD_MINOR_REASON_DISASSOCIATED_WFD_COEXISTENCE_POLICY: i32 = 3; +pub const DOT11_WFD_MINOR_REASON_DISASSOCIATED_INFRASTRUCTURE_MANAGED_POLICY: i32 = 4; +pub const DOT11_WPS_VERSION_1_0: u8 = 0x01; +pub const DOT11_WPS_VERSION_2_0: u8 = 0x02; +pub const DOT11_WFD_DEVICE_CAPABILITY_SERVICE_DISCOVERY: u8 = 0x01; +pub const DOT11_WFD_DEVICE_CAPABILITY_P2P_CLIENT_DISCOVERABILITY: u8 = 0x02; +pub const DOT11_WFD_DEVICE_CAPABILITY_CONCURRENT_OPERATION: u8 = 0x04; +pub const DOT11_WFD_DEVICE_CAPABILITY_P2P_INFRASTRUCTURE_MANAGED: u8 = 0x08; +pub const DOT11_WFD_DEVICE_CAPABILITY_P2P_DEVICE_LIMIT: u8 = 0x10; +pub const DOT11_WFD_DEVICE_CAPABILITY_P2P_INVITATION_PROCEDURE: u8 = 0x20; +pub const DOT11_WFD_DEVICE_CAPABILITY_RESERVED_6: u8 = 0x40; +pub const DOT11_WFD_DEVICE_CAPABILITY_RESERVED_7: u8 = 0x80; +pub const DOT11_WFD_GROUP_CAPABILITY_NONE: u8 = 0x00; +pub const DOT11_WFD_GROUP_CAPABILITY_GROUP_OWNER: u8 = 0x01; +pub const DOT11_WFD_GROUP_CAPABILITY_PERSISTENT_GROUP: u8 = 0x02; +pub const DOT11_WFD_GROUP_CAPABILITY_GROUP_LIMIT_REACHED: u8 = 0x04; +pub const DOT11_WFD_GROUP_CAPABILITY_INTRABSS_DISTRIBUTION_SUPPORTED: u8 = 0x08; +pub const DOT11_WFD_GROUP_CAPABILITY_CROSS_CONNECTION_SUPPORTED: u8 = 0x10; +pub const DOT11_WFD_GROUP_CAPABILITY_PERSISTENT_RECONNECT_SUPPORTED: u8 = 0x20; +pub const DOT11_WFD_GROUP_CAPABILITY_IN_GROUP_FORMATION: u8 = 0x40; +pub const DOT11_WFD_GROUP_CAPABILITY_RESERVED_7: u8 = 0x80; +pub const DOT11_WFD_GROUP_CAPABILITY_EAPOL_KEY_IP_ADDRESS_ALLOCATION_SUPPORTED: u8 = 0x80; +pub const DOT11_WPS_DEVICE_NAME_MAX_LENGTH: usize = 32; +pub const DOT11_WPS_MAX_PASSKEY_LENGTH: usize = 8; +pub const DOT11_WPS_MAX_MODEL_NAME_LENGTH: usize = 32; +pub const DOT11_WPS_MAX_MODEL_NUMBER_LENGTH: usize = 32; +STRUCT!{struct DOT11_WFD_DEVICE_TYPE { + CategoryID: USHORT, + SubCategoryID: USHORT, + OUI: [UCHAR; 4], +}} +pub type PDOT11_WFD_DEVICE_TYPE = *mut DOT11_WFD_DEVICE_TYPE; +STRUCT!{struct DOT11_WPS_DEVICE_NAME { + uDeviceNameLength: ULONG, + ucDeviceName: [UCHAR; DOT11_WPS_DEVICE_NAME_MAX_LENGTH], +}} +pub type PDOT11_WPS_DEVICE_NAME = *mut DOT11_WPS_DEVICE_NAME; +STRUCT!{struct DOT11_WFD_CONFIGURATION_TIMEOUT { + GOTimeout: UCHAR, + ClientTimeout: UCHAR, +}} +pub type PDOT11_WFD_CONFIGURATION_TIMEOUT = *mut DOT11_WFD_CONFIGURATION_TIMEOUT; +STRUCT!{struct DOT11_WFD_GROUP_ID { + DeviceAddress: DOT11_MAC_ADDRESS, + SSID: DOT11_SSID, +}} +pub type PDOT11_WFD_GROUP_ID = *mut DOT11_WFD_GROUP_ID; +STRUCT!{#[repr(packed)] struct DOT11_WFD_GO_INTENT { + Bitfields: UCHAR, +}} +BITFIELD!{DOT11_WFD_GO_INTENT Bitfields: UCHAR [ + TieBreaker set_TieBreaker[0..1], + Intent set_Intent[1..8], +]} +pub type PDOT11_WFD_GO_INTENT = *mut DOT11_WFD_GO_INTENT; +STRUCT!{struct DOT11_WFD_CHANNEL { + CountryRegionString: DOT11_COUNTRY_OR_REGION_STRING, + OperatingClass: UCHAR, + ChannelNumber: UCHAR, +}} +pub type PDOT11_WFD_CHANNEL = *mut DOT11_WFD_CHANNEL; +ENUM!{enum DOT11_WPS_CONFIG_METHOD { + DOT11_WPS_CONFIG_METHOD_NULL = 0, + DOT11_WPS_CONFIG_METHOD_DISPLAY = 0x0008, + DOT11_WPS_CONFIG_METHOD_NFC_TAG = 0x0020, + DOT11_WPS_CONFIG_METHOD_NFC_INTERFACE = 0x0040, + DOT11_WPS_CONFIG_METHOD_PUSHBUTTON = 0x0080, + DOT11_WPS_CONFIG_METHOD_KEYPAD = 0x0100, + DOT11_WPS_CONFIG_METHOD_WFDS_DEFAULT = 0x1000, +}} +pub type PDOT11_WPS_CONFIG_METHOD = *mut DOT11_WPS_CONFIG_METHOD; +ENUM!{enum DOT11_WPS_DEVICE_PASSWORD_ID { + DOT11_WPS_PASSWORD_ID_DEFAULT = 0x0000, + DOT11_WPS_PASSWORD_ID_USER_SPECIFIED = 0x0001, + DOT11_WPS_PASSWORD_ID_MACHINE_SPECIFIED = 0x0002, + DOT11_WPS_PASSWORD_ID_REKEY = 0x0003, + DOT11_WPS_PASSWORD_ID_PUSHBUTTON = 0x0004, + DOT11_WPS_PASSWORD_ID_REGISTRAR_SPECIFIED = 0x0005, + DOT11_WPS_PASSWORD_ID_NFC_CONNECTION_HANDOVER = 0x0007, + DOT11_WPS_PASSWORD_ID_WFD_SERVICES = 0x0008, + DOT11_WPS_PASSWORD_ID_OOB_RANGE_MIN = 0x0010, + DOT11_WPS_PASSWORD_ID_OOB_RANGE_MAX = 0xFFFF, +}} +pub type PDOT11_WPS_DEVICE_PASSWORD_ID = *mut DOT11_WPS_DEVICE_PASSWORD_ID; +STRUCT!{struct WFDSVC_CONNECTION_CAPABILITY { + bNew: BOOLEAN, + bClient: BOOLEAN, + bGO: BOOLEAN, +}} +pub type PWFDSVC_CONNECTION_CAPABILITY = *mut WFDSVC_CONNECTION_CAPABILITY; +pub const WFDSVC_CONNECTION_CAPABILITY_NEW: BOOLEAN = 0x01; +pub const WFDSVC_CONNECTION_CAPABILITY_CLIENT: BOOLEAN = 0x02; +pub const WFDSVC_CONNECTION_CAPABILITY_GO: BOOLEAN = 0x04; +STRUCT!{struct DOT11_WFD_SERVICE_HASH_LIST { + ServiceHashCount: USHORT, + ServiceHash: [DOT11_WFD_SERVICE_HASH; 1], +}} +pub type PDOT11_WFD_SERVICE_HASH_LIST = *mut DOT11_WFD_SERVICE_HASH_LIST; +STRUCT!{struct DOT11_WFD_ADVERTISEMENT_ID { + AdvertisementID: ULONG, + ServiceAddress: DOT11_MAC_ADDRESS, +}} +pub type PDOT11_WFD_ADVERTISEMENT_ID = *mut DOT11_WFD_ADVERTISEMENT_ID; +STRUCT!{struct DOT11_WFD_SESSION_ID { + SessionID: ULONG, + SessionAddress: DOT11_MAC_ADDRESS, +}} +pub type PDOT11_WFD_SESSION_ID = *mut DOT11_WFD_SESSION_ID; +STRUCT!{struct DOT11_WFD_ADVERTISED_SERVICE_DESCRIPTOR { + AdvertisementID: ULONG, + ConfigMethods: USHORT, + ServiceNameLength: UCHAR, + ServiceName: [UCHAR; DOT11_WFD_SERVICE_NAME_MAX_LENGTH], +}} +pub type PDOT11_WFD_ADVERTISED_SERVICE_DESCRIPTOR = *mut DOT11_WFD_ADVERTISED_SERVICE_DESCRIPTOR; +STRUCT!{struct DOT11_WFD_ADVERTISED_SERVICE_LIST { + ServiceCount: USHORT, + AdvertisedService: [DOT11_WFD_ADVERTISED_SERVICE_DESCRIPTOR; 1], +}} +pub type PDOT11_WFD_ADVERTISED_SERVICE_LIST = *mut DOT11_WFD_ADVERTISED_SERVICE_LIST; +pub const DOT11_WFD_DISCOVER_COMPLETE_PARAMETERS_REVISION_1: UCHAR = 1; +pub const DOT11_WFD_DISCOVER_COMPLETE_MAX_LIST_SIZE: ULONG = 128; +STRUCT!{struct DOT11_WFD_DISCOVER_COMPLETE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + Status: NDIS_STATUS, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + uListOffset: ULONG, + uListLength: ULONG, +}} +pub type PDOT11_WFD_DISCOVER_COMPLETE_PARAMETERS = *mut DOT11_WFD_DISCOVER_COMPLETE_PARAMETERS; +pub const DOT11_GO_NEGOTIATION_REQUEST_SEND_COMPLETE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_GO_NEGOTIATION_REQUEST_SEND_COMPLETE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + Status: NDIS_STATUS, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_GO_NEGOTIATION_REQUEST_SEND_COMPLETE_PARAMETERS = + *mut DOT11_GO_NEGOTIATION_REQUEST_SEND_COMPLETE_PARAMETERS; +pub const DOT11_RECEIVED_GO_NEGOTIATION_REQUEST_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_RECEIVED_GO_NEGOTIATION_REQUEST_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + RequestContext: PVOID, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_RECEIVED_GO_NEGOTIATION_REQUEST_PARAMETERS = + *mut DOT11_RECEIVED_GO_NEGOTIATION_REQUEST_PARAMETERS; +pub const DOT11_GO_NEGOTIATION_RESPONSE_SEND_COMPLETE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_GO_NEGOTIATION_RESPONSE_SEND_COMPLETE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + Status: NDIS_STATUS, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_GO_NEGOTIATION_RESPONSE_SEND_COMPLETE_PARAMETERS = + *mut DOT11_GO_NEGOTIATION_RESPONSE_SEND_COMPLETE_PARAMETERS; +pub const DOT11_RECEIVED_GO_NEGOTIATION_RESPONSE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_RECEIVED_GO_NEGOTIATION_RESPONSE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + ResponseContext: PVOID, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_RECEIVED_GO_NEGOTIATION_RESPONSE_PARAMETERS = + *mut DOT11_RECEIVED_GO_NEGOTIATION_RESPONSE_PARAMETERS; +pub const DOT11_GO_NEGOTIATION_CONFIRMATION_SEND_COMPLETE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_GO_NEGOTIATION_CONFIRMATION_SEND_COMPLETE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + Status: NDIS_STATUS, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_GO_NEGOTIATION_CONFIRMATION_SEND_COMPLETE_PARAMETERS = + *mut DOT11_GO_NEGOTIATION_CONFIRMATION_SEND_COMPLETE_PARAMETERS; +pub const DOT11_RECEIVED_GO_NEGOTIATION_CONFIRMATION_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_RECEIVED_GO_NEGOTIATION_CONFIRMATION_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_RECEIVED_GO_NEGOTIATION_CONFIRMATION_PARAMETERS = + *mut DOT11_RECEIVED_GO_NEGOTIATION_CONFIRMATION_PARAMETERS; +pub const DOT11_INVITATION_REQUEST_SEND_COMPLETE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_INVITATION_REQUEST_SEND_COMPLETE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + ReceiverAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + Status: NDIS_STATUS, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_INVITATION_REQUEST_SEND_COMPLETE_PARAMETERS = + *mut DOT11_INVITATION_REQUEST_SEND_COMPLETE_PARAMETERS; +pub const DOT11_RECEIVED_INVITATION_REQUEST_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_RECEIVED_INVITATION_REQUEST_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + TransmitterDeviceAddress: DOT11_MAC_ADDRESS, + BSSID: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + RequestContext: PVOID, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_RECEIVED_INVITATION_REQUEST_PARAMETERS = + *mut DOT11_RECEIVED_INVITATION_REQUEST_PARAMETERS; +pub const DOT11_INVITATION_RESPONSE_SEND_COMPLETE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_INVITATION_RESPONSE_SEND_COMPLETE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + ReceiverDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + Status: NDIS_STATUS, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_INVITATION_RESPONSE_SEND_COMPLETE_PARAMETERS = + *mut DOT11_INVITATION_RESPONSE_SEND_COMPLETE_PARAMETERS; +pub const DOT11_RECEIVED_INVITATION_RESPONSE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_RECEIVED_INVITATION_RESPONSE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + TransmitterDeviceAddress: DOT11_MAC_ADDRESS, + BSSID: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_RECEIVED_INVITATION_RESPONSE_PARAMETERS = + *mut DOT11_RECEIVED_INVITATION_RESPONSE_PARAMETERS; +pub const DOT11_PROVISION_DISCOVERY_REQUEST_SEND_COMPLETE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_PROVISION_DISCOVERY_REQUEST_SEND_COMPLETE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + ReceiverAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + Status: NDIS_STATUS, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_PROVISION_DISCOVERY_REQUEST_SEND_COMPLETE_PARAMETERS = + *mut DOT11_PROVISION_DISCOVERY_REQUEST_SEND_COMPLETE_PARAMETERS; +pub const DOT11_RECEIVED_PROVISION_DISCOVERY_REQUEST_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_RECEIVED_PROVISION_DISCOVERY_REQUEST_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + TransmitterDeviceAddress: DOT11_MAC_ADDRESS, + BSSID: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + RequestContext: PVOID, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_RECEIVED_PROVISION_DISCOVERY_REQUEST_PARAMETERS = + *mut DOT11_RECEIVED_PROVISION_DISCOVERY_REQUEST_PARAMETERS; +pub const DOT11_PROVISION_DISCOVERY_RESPONSE_SEND_COMPLETE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_PROVISION_DISCOVERY_RESPONSE_SEND_COMPLETE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + ReceiverDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + Status: NDIS_STATUS, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_PROVISION_DISCOVERY_RESPONSE_SEND_COMPLETE_PARAMETERS = + *mut DOT11_PROVISION_DISCOVERY_RESPONSE_SEND_COMPLETE_PARAMETERS; +pub const DOT11_RECEIVED_PROVISION_DISCOVERY_RESPONSE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_RECEIVED_PROVISION_DISCOVERY_RESPONSE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + TransmitterDeviceAddress: DOT11_MAC_ADDRESS, + BSSID: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_RECEIVED_PROVISION_DISCOVERY_RESPONSE_PARAMETERS = + *mut DOT11_RECEIVED_PROVISION_DISCOVERY_RESPONSE_PARAMETERS; +pub const DOT11_ANQP_QUERY_COMPLETE_PARAMETERS_REVISION_1: UCHAR = 1; +ENUM!{enum DOT11_ANQP_QUERY_RESULT { + dot11_ANQP_query_result_success = 0, + dot11_ANQP_query_result_failure = 1, + dot11_ANQP_query_result_timed_out = 2, + dot11_ANQP_query_result_resources = 3, + dot11_ANQP_query_result_advertisement_protocol_not_supported_on_remote = 4, + dot11_ANQP_query_result_gas_protocol_failure = 5, + dot11_ANQP_query_result_advertisement_server_not_responding = 6, + dot11_ANQP_query_result_access_issues = 7, +}} +pub type PDOT11_ANQP_QUERY_RESULT = *mut DOT11_ANQP_QUERY_RESULT; +STRUCT!{struct DOT11_ANQP_QUERY_COMPLETE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + Status: DOT11_ANQP_QUERY_RESULT, + hContext: HANDLE, + uResponseLength: ULONG, +}} +pub type PDOT11_ANQP_QUERY_COMPLETE_PARAMETERS = *mut DOT11_ANQP_QUERY_COMPLETE_PARAMETERS; +pub const NWF_WFD_DEVICE_OID: u32 = 0x05; +pub const NWF_WFD_ROLE_OID: u32 = 0x06; +pub const OID_DOT11_WFD_DEVICE_CAPABILITY: u32 = + NWF_DEFINE_OID!(0x01, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_WFD_DEVICE_CAPABILITY_CONFIG_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_DEVICE_CAPABILITY_CONFIG { + Header: NDIS_OBJECT_HEADER, + bServiceDiscoveryEnabled: BOOLEAN, + bClientDiscoverabilityEnabled: BOOLEAN, + bConcurrentOperationSupported: BOOLEAN, + bInfrastructureManagementEnabled: BOOLEAN, + bDeviceLimitReached: BOOLEAN, + bInvitationProcedureEnabled: BOOLEAN, + WPSVersionsEnabled: ULONG, +}} +pub type PDOT11_WFD_DEVICE_CAPABILITY_CONFIG = *mut DOT11_WFD_DEVICE_CAPABILITY_CONFIG; +pub const OID_DOT11_WFD_GROUP_OWNER_CAPABILITY: u32 = + NWF_DEFINE_OID!(0x02, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_WFD_GROUP_OWNER_CAPABILITY_CONFIG_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_GROUP_OWNER_CAPABILITY_CONFIG { + Header: NDIS_OBJECT_HEADER, + bPersistentGroupEnabled: BOOLEAN, + bIntraBSSDistributionSupported: BOOLEAN, + bCrossConnectionSupported: BOOLEAN, + bPersistentReconnectSupported: BOOLEAN, + bGroupFormationEnabled: BOOLEAN, + uMaximumGroupLimit: ULONG, +}} +pub type PDOT11_WFD_GROUP_OWNER_CAPABILITY_CONFIG = *mut DOT11_WFD_GROUP_OWNER_CAPABILITY_CONFIG; +pub const DOT11_WFD_GROUP_OWNER_CAPABILITY_CONFIG_REVISION_2: UCHAR = 2; +STRUCT!{struct DOT11_WFD_GROUP_OWNER_CAPABILITY_CONFIG_V2 { + Header: NDIS_OBJECT_HEADER, + bPersistentGroupEnabled: BOOLEAN, + bIntraBSSDistributionSupported: BOOLEAN, + bCrossConnectionSupported: BOOLEAN, + bPersistentReconnectSupported: BOOLEAN, + bGroupFormationEnabled: BOOLEAN, + uMaximumGroupLimit: ULONG, + bEapolKeyIpAddressAllocationSupported: BOOLEAN, +}} +pub type PDOT11_WFD_GROUP_OWNER_CAPABILITY_CONFIG_V2 = + *mut DOT11_WFD_GROUP_OWNER_CAPABILITY_CONFIG_V2; +pub const OID_DOT11_WFD_DEVICE_INFO: u32 = + NWF_DEFINE_OID!(0x03, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_WFD_DEVICE_INFO_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_DEVICE_INFO { + Header: NDIS_OBJECT_HEADER, + DeviceAddress: DOT11_MAC_ADDRESS, + ConfigMethods: USHORT, + PrimaryDeviceType: DOT11_WFD_DEVICE_TYPE, + DeviceName: DOT11_WPS_DEVICE_NAME, +}} +pub type PDOT11_WFD_DEVICE_INFO = *mut DOT11_WFD_DEVICE_INFO; +pub const OID_DOT11_WFD_SECONDARY_DEVICE_TYPE_LIST: u32 = + NWF_DEFINE_OID!(0x04, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_WFD_SECONDARY_DEVICE_TYPE_LIST_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_SECONDARY_DEVICE_TYPE_LIST { + Header: NDIS_OBJECT_HEADER, + uNumOfEntries: ULONG, + uTotalNumOfEntries: ULONG, + SecondaryDeviceTypes: [DOT11_WFD_DEVICE_TYPE; 1], +}} +pub type PDOT11_WFD_SECONDARY_DEVICE_TYPE_LIST = *mut DOT11_WFD_SECONDARY_DEVICE_TYPE_LIST; +// pub const DOT11_SIZEOF_WFD_SECONDARY_DEVICE_TYPE_LIST_REVISION_1: usize = +// FIELD_OFFSET(DOT11_WFD_SECONDARY_DEVICE_TYPE_LIST, SecondaryDeviceTypes); +pub const OID_DOT11_WFD_DISCOVER_REQUEST: u32 = + NWF_DEFINE_OID!(0x05, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +ENUM!{enum DOT11_WFD_DISCOVER_TYPE { + dot11_wfd_discover_type_scan_only = 1, + dot11_wfd_discover_type_find_only = 2, + dot11_wfd_discover_type_auto = 3, + dot11_wfd_discover_type_scan_social_channels = 4, + dot11_wfd_discover_type_forced = 0x80000000, +}} +pub type PDOT11_WFD_DISCOVER_TYPE = *mut DOT11_WFD_DISCOVER_TYPE; +ENUM!{enum DOT11_WFD_SCAN_TYPE { + dot11_wfd_scan_type_active = 1, + dot11_wfd_scan_type_passive = 2, + dot11_wfd_scan_type_auto = 3, +}} +pub type PDOT11_WFD_SCAN_TYPE = *mut DOT11_WFD_SCAN_TYPE; +pub const DISCOVERY_FILTER_BITMASK_DEVICE: UCHAR = 0x1; +pub const DISCOVERY_FILTER_BITMASK_GO: UCHAR = 0x2; +pub const DISCOVERY_FILTER_BITMASK_ANY: UCHAR = 0xF; +STRUCT!{struct DOT11_WFD_DISCOVER_DEVICE_FILTER { + DeviceID: DOT11_MAC_ADDRESS, + ucBitmask: UCHAR, + GroupSSID: DOT11_SSID, +}} +pub type PDOT11_WFD_DISCOVER_DEVICE_FILTER = *mut DOT11_WFD_DISCOVER_DEVICE_FILTER; +pub const DOT11_WFD_DISCOVER_REQUEST_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_DISCOVER_REQUEST { + Header: NDIS_OBJECT_HEADER, + DiscoverType: DOT11_WFD_DISCOVER_TYPE, + ScanType: DOT11_WFD_SCAN_TYPE, + uDiscoverTimeout: ULONG, + uDeviceFilterListOffset: ULONG, + uNumDeviceFilters: ULONG, + uIEsOffset: ULONG, + uIEsLength: ULONG, + bForceScanLegacyNetworks: BOOLEAN, +}} +pub type PDOT11_WFD_DISCOVER_REQUEST = *mut DOT11_WFD_DISCOVER_REQUEST; +pub const OID_DOT11_WFD_ENUM_DEVICE_LIST: u32 = + NWF_DEFINE_OID!(0x06, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_DEVICE_ENTRY_BYTE_ARRAY_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_DEVICE_ENTRY { + uPhyId: ULONG, + PhySpecificInfo: DOT11_BSS_ENTRY_PHY_SPECIFIC_INFO, + dot11BSSID: DOT11_MAC_ADDRESS, + dot11BSSType: DOT11_BSS_TYPE, + TransmitterAddress: DOT11_MAC_ADDRESS, + lRSSI: LONG, + uLinkQuality: ULONG, + usBeaconPeriod: USHORT, + ullTimestamp: ULONGLONG, + ullBeaconHostTimestamp: ULONGLONG, + ullProbeResponseHostTimestamp: ULONGLONG, + usCapabilityInformation: USHORT, + uBeaconIEsOffset: ULONG, + uBeaconIEsLength: ULONG, + uProbeResponseIEsOffset: ULONG, + uProbeResponseIEsLength: ULONG, +}} +pub type PDOT11_WFD_DEVICE_ENTRY = *mut DOT11_WFD_DEVICE_ENTRY; +pub const OID_DOT11_WFD_LISTEN_STATE_DISCOVERABILITY: u32 = + NWF_DEFINE_OID!(0x07, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_WFD_DEVICE_NOT_DISCOVERABLE: i32 = 0; +pub const DOT11_WFD_DEVICE_AUTO_AVAILABILITY: i32 = 16; +pub const DOT11_WFD_DEVICE_HIGH_AVAILABILITY: i32 = 24; +pub const OID_DOT11_WFD_ADDITIONAL_IE: u32 = + NWF_DEFINE_OID!(0x08, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_WFD_ADDITIONAL_IE_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_ADDITIONAL_IE { + Header: NDIS_OBJECT_HEADER, + uBeaconIEsOffset: ULONG, + uBeaconIEsLength: ULONG, + uProbeResponseIEsOffset: ULONG, + uProbeResponseIEsLength: ULONG, + uDefaultRequestIEsOffset: ULONG, + uDefaultRequestIEsLength: ULONG, +}} +pub type PDOT11_WFD_ADDITIONAL_IE = *mut DOT11_WFD_ADDITIONAL_IE; +pub const OID_DOT11_WFD_FLUSH_DEVICE_LIST: u32 = + NWF_DEFINE_OID!(0x09, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_WFD_SEND_GO_NEGOTIATION_REQUEST: u32 = + NWF_DEFINE_OID!(0x0A, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_SEND_GO_NEGOTIATION_REQUEST_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_SEND_GO_NEGOTIATION_REQUEST_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + uSendTimeout: ULONG, + GroupOwnerIntent: DOT11_WFD_GO_INTENT, + MinimumConfigTimeout: DOT11_WFD_CONFIGURATION_TIMEOUT, + IntendedInterfaceAddress: DOT11_MAC_ADDRESS, + GroupCapability: DOT11_WFD_GROUP_CAPABILITY, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_SEND_GO_NEGOTIATION_REQUEST_PARAMETERS = + *mut DOT11_SEND_GO_NEGOTIATION_REQUEST_PARAMETERS; +pub const OID_DOT11_WFD_SEND_GO_NEGOTIATION_RESPONSE: u32 = + NWF_DEFINE_OID!(0x0B, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_SEND_GO_NEGOTIATION_RESPONSE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_SEND_GO_NEGOTIATION_RESPONSE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + RequestContext: PVOID, + uSendTimeout: ULONG, + Status: DOT11_WFD_STATUS_CODE, + GroupOwnerIntent: DOT11_WFD_GO_INTENT, + MinimumConfigTimeout: DOT11_WFD_CONFIGURATION_TIMEOUT, + IntendedInterfaceAddress: DOT11_MAC_ADDRESS, + GroupCapability: DOT11_WFD_GROUP_CAPABILITY, + GroupID: DOT11_WFD_GROUP_ID, + bUseGroupID: BOOLEAN, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_SEND_GO_NEGOTIATION_RESPONSE_PARAMETERS = + *mut DOT11_SEND_GO_NEGOTIATION_RESPONSE_PARAMETERS; +pub const OID_DOT11_WFD_SEND_GO_NEGOTIATION_CONFIRMATION: u32 = + NWF_DEFINE_OID!(0x0C, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_SEND_GO_NEGOTIATION_CONFIRMATION_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_SEND_GO_NEGOTIATION_CONFIRMATION_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + ResponseContext: PVOID, + uSendTimeout: ULONG, + Status: DOT11_WFD_STATUS_CODE, + GroupCapability: DOT11_WFD_GROUP_CAPABILITY, + GroupID: DOT11_WFD_GROUP_ID, + bUseGroupID: BOOLEAN, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_SEND_GO_NEGOTIATION_CONFIRMATION_PARAMETERS = + *mut DOT11_SEND_GO_NEGOTIATION_CONFIRMATION_PARAMETERS; +pub const OID_DOT11_WFD_SEND_INVITATION_REQUEST: u32 = + NWF_DEFINE_OID!(0x0D, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +STRUCT!{#[repr(packed)] struct DOT11_WFD_INVITATION_FLAGS { + Bitfields: UCHAR, +}} +BITFIELD!{DOT11_WFD_INVITATION_FLAGS Bitfields: UCHAR [ + InvitationType set_InvitationType[0..1], + Reserved set_Reserved[1..8], +]} +pub type PDOT11_WFD_INVITATION_FLAGS = *mut DOT11_WFD_INVITATION_FLAGS; +pub const DOT11_SEND_INVITATION_REQUEST_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_SEND_INVITATION_REQUEST_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + DialogToken: DOT11_DIALOG_TOKEN, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + uSendTimeout: ULONG, + MinimumConfigTimeout: DOT11_WFD_CONFIGURATION_TIMEOUT, + InvitationFlags: DOT11_WFD_INVITATION_FLAGS, + GroupBSSID: DOT11_MAC_ADDRESS, + bUseGroupBSSID: BOOLEAN, + OperatingChannel: DOT11_WFD_CHANNEL, + bUseSpecifiedOperatingChannel: BOOLEAN, + GroupID: DOT11_WFD_GROUP_ID, + bLocalGO: BOOLEAN, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_SEND_INVITATION_REQUEST_PARAMETERS = + *mut DOT11_SEND_INVITATION_REQUEST_PARAMETERS; +pub const OID_DOT11_WFD_SEND_INVITATION_RESPONSE: u32 = + NWF_DEFINE_OID!(0x0E, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_SEND_INVITATION_RESPONSE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_SEND_INVITATION_RESPONSE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + ReceiverDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + RequestContext: PVOID, + uSendTimeout: ULONG, + Status: DOT11_WFD_STATUS_CODE, + MinimumConfigTimeout: DOT11_WFD_CONFIGURATION_TIMEOUT, + GroupBSSID: DOT11_MAC_ADDRESS, + bUseGroupBSSID: BOOLEAN, + OperatingChannel: DOT11_WFD_CHANNEL, + bUseSpecifiedOperatingChannel: BOOLEAN, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_SEND_INVITATION_RESPONSE_PARAMETERS = + *mut DOT11_SEND_INVITATION_RESPONSE_PARAMETERS; +pub const OID_DOT11_WFD_SEND_PROVISION_DISCOVERY_REQUEST: u32 = + NWF_DEFINE_OID!(0x0F, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_SEND_PROVISION_DISCOVERY_REQUEST_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_SEND_PROVISION_DISCOVERY_REQUEST_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + DialogToken: DOT11_DIALOG_TOKEN, + PeerDeviceAddress: DOT11_MAC_ADDRESS, + uSendTimeout: ULONG, + GroupCapability: DOT11_WFD_GROUP_CAPABILITY, + GroupID: DOT11_WFD_GROUP_ID, + bUseGroupID: BOOLEAN, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_SEND_PROVISION_DISCOVERY_REQUEST_PARAMETERS = + *mut DOT11_SEND_PROVISION_DISCOVERY_REQUEST_PARAMETERS; +pub const OID_DOT11_WFD_SEND_PROVISION_DISCOVERY_RESPONSE: u32 = + NWF_DEFINE_OID!(0x10, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_SEND_PROVISION_DISCOVERY_RESPONSE_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_SEND_PROVISION_DISCOVERY_RESPONSE_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + ReceiverDeviceAddress: DOT11_MAC_ADDRESS, + DialogToken: DOT11_DIALOG_TOKEN, + RequestContext: PVOID, + uSendTimeout: ULONG, + uIEsOffset: ULONG, + uIEsLength: ULONG, +}} +pub type PDOT11_SEND_PROVISION_DISCOVERY_RESPONSE_PARAMETERS = + *mut DOT11_SEND_PROVISION_DISCOVERY_RESPONSE_PARAMETERS; +pub const OID_DOT11_WFD_GET_DIALOG_TOKEN: u32 = + NWF_DEFINE_OID!(0x11, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_WFD_STOP_DISCOVERY: u32 = + NWF_DEFINE_OID!(0x12, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_WFD_ENABLE_HRDSSS_DEVICES: u32 = + NWF_DEFINE_OID!(0x13, NWF_WFD_DEVICE_OID, NWF_OPTIONAL_OID); +pub const OID_DOT11_WFD_DEVICE_LISTEN_CHANNEL: u32 = + NWF_DEFINE_OID!(0x14, NWF_WFD_DEVICE_OID, NWF_MANDATORY_OID); +pub const DOT11_WFD_DEVICE_LISTEN_CHANNEL_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_DEVICE_LISTEN_CHANNEL { + Header: NDIS_OBJECT_HEADER, + ChannelNumber: UCHAR, +}} +pub type PDOT11_WFD_DEVICE_LISTEN_CHANNEL = *mut DOT11_WFD_DEVICE_LISTEN_CHANNEL; +pub const OID_DOT11_WFD_DESIRED_GROUP_ID: u32 = + NWF_DEFINE_OID!(0x01, NWF_WFD_ROLE_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_WFD_START_GO_REQUEST: u32 = + NWF_DEFINE_OID!(0x02, NWF_WFD_ROLE_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_WFD_GROUP_START_PARAMETERS: u32 = + NWF_DEFINE_OID!(0x03, NWF_WFD_ROLE_OID, NWF_MANDATORY_OID); +pub const DOT11_WFD_GROUP_START_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_GROUP_START_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + AdvertisedOperatingChannel: DOT11_WFD_CHANNEL, +}} +pub type PDOT11_WFD_GROUP_START_PARAMETERS = *mut DOT11_WFD_GROUP_START_PARAMETERS; +pub const OID_DOT11_WFD_CONNECT_TO_GROUP_REQUEST: u32 = + NWF_DEFINE_OID!(0x04, NWF_WFD_ROLE_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_WFD_DISCONNECT_FROM_GROUP_REQUEST: u32 = + NWF_DEFINE_OID!(0x05, NWF_WFD_ROLE_OID, NWF_MANDATORY_OID); +pub const OID_DOT11_WFD_GROUP_JOIN_PARAMETERS: u32 = + NWF_DEFINE_OID!(0x06, NWF_WFD_ROLE_OID, NWF_MANDATORY_OID); +pub const DOT11_WFD_GROUP_JOIN_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_WFD_GROUP_JOIN_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + GOOperatingChannel: DOT11_WFD_CHANNEL, + GOConfigTime: ULONG, + bInGroupFormation: BOOLEAN, + bWaitForWPSReady: BOOLEAN, +}} +pub type PDOT11_WFD_GROUP_JOIN_PARAMETERS = *mut DOT11_WFD_GROUP_JOIN_PARAMETERS; +pub const NWF_POWER_SAVE_OID: u32 = 0x07; +pub const OID_DOT11_POWER_MGMT_MODE_AUTO_ENABLED: u32 = + NWF_DEFINE_OID!(0x01, NWF_POWER_SAVE_OID, NWF_MANDATORY_OID); +pub const DOT11_POWER_MGMT_AUTO_MODE_ENABLED_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_POWER_MGMT_AUTO_MODE_ENABLED_INFO { + Header: NDIS_OBJECT_HEADER, + bEnabled: BOOLEAN, +}} +pub type PDOT11_POWER_MGMT_AUTO_MODE_ENABLED_INFO = *mut DOT11_POWER_MGMT_AUTO_MODE_ENABLED_INFO; +pub const OID_DOT11_POWER_MGMT_MODE_STATUS: u32 = + NWF_DEFINE_OID!(0x02, NWF_POWER_SAVE_OID, NWF_MANDATORY_OID); +ENUM!{enum DOT11_POWER_MODE_REASON { + dot11_power_mode_reason_no_change = 0, + dot11_power_mode_reason_noncompliant_AP = 1, + dot11_power_mode_reason_legacy_WFD_device = 2, + dot11_power_mode_reason_compliant_AP = 3, + dot11_power_mode_reason_compliant_WFD_device = 4, + dot11_power_mode_reason_others = 5, +}} +pub const DOT11_POWER_MGMT_MODE_STATUS_INFO_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_POWER_MGMT_MODE_STATUS_INFO { + Header: NDIS_OBJECT_HEADER, + PowerSaveMode: DOT11_POWER_MODE, + uPowerSaveLevel: ULONG, + Reason: DOT11_POWER_MODE_REASON, +}} +pub type PDOT11_POWER_MGMT_MODE_STATUSINFO = *mut DOT11_POWER_MGMT_MODE_STATUS_INFO; +pub const OID_DOT11_OFFLOAD_NETWORK_LIST: u32 = + NWF_DEFINE_OID!(0x03, NWF_POWER_SAVE_OID, NWF_MANDATORY_OID); +pub const DOT11_MAX_CHANNEL_HINTS: usize = 4; +pub const DOT11_INVALID_CHANNEL_NUMBER: ULONG = 0; +STRUCT!{struct DOT11_CHANNEL_HINT { + Dot11PhyType: DOT11_PHY_TYPE, + uChannelNumber: ULONG, +}} +pub type PDOT11_CHANNEL_HINT = *mut DOT11_CHANNEL_HINT; +STRUCT!{struct DOT11_OFFLOAD_NETWORK { + Ssid: DOT11_SSID, + UnicastCipher: DOT11_CIPHER_ALGORITHM, + AuthAlgo: DOT11_AUTH_ALGORITHM, + Dot11ChannelHints: [DOT11_CHANNEL_HINT; DOT11_MAX_CHANNEL_HINTS], +}} +pub type PDOT11_OFFLOAD_NETWORK = *mut DOT11_OFFLOAD_NETWORK; +pub const DOT11_NLO_FLAG_STOP_NLO_INDICATION: ULONG = 0x00000001; +pub const DOT11_NLO_FLAG_SCAN_ON_AOAC_PLATFORM: ULONG = 0x00000002; +pub const DOT11_NLO_FLAG_SCAN_AT_SYSTEM_RESUME: ULONG = 0x00000004; +pub const DOT11_OFFLOAD_NETWORK_LIST_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_OFFLOAD_NETWORK_LIST_INFO { + Header: NDIS_OBJECT_HEADER, + ulFlags: ULONG, + FastScanPeriod: ULONG, + FastScanIterations: ULONG, + SlowScanPeriod: ULONG, + uNumOfEntries: ULONG, + offloadNetworkList: [DOT11_OFFLOAD_NETWORK; 1], +}} +pub type PDOT11_OFFLOAD_NETWORK_LIST_INFO = *mut DOT11_OFFLOAD_NETWORK_LIST_INFO; +pub const DOT11_OFFLOAD_NETWORK_STATUS_PARAMETERS_REVISION_1: UCHAR = 1; +STRUCT!{struct DOT11_OFFLOAD_NETWORK_STATUS_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + Status: NDIS_STATUS, +}} +pub type PDOT11_OFFLOAD_NETWORK_STATUS_PARAMETERS = *mut DOT11_OFFLOAD_NETWORK_STATUS_PARAMETERS; +pub const NWF_MANUFACTURING_OID: u32 = 0x08; +pub const OID_DOT11_MANUFACTURING_TEST: u32 = + NWF_DEFINE_OID!(0x01, NWF_MANUFACTURING_OID, NWF_OPTIONAL_OID); +pub const DOT11_MANUFACTURING_TEST_REVISION_1: UCHAR = 1; +ENUM!{enum DOT11_MANUFACTURING_TEST_TYPE { + dot11_manufacturing_test_unknown = 0, + dot11_manufacturing_test_self_start = 1, + dot11_manufacturing_test_self_query_result = 2, + dot11_manufacturing_test_rx = 3, + dot11_manufacturing_test_tx = 4, + dot11_manufacturing_test_query_adc = 5, + dot11_manufacturing_test_set_data = 6, + dot11_manufacturing_test_query_data = 7, + dot11_manufacturing_test_sleep = 8, + dot11_manufacturing_test_awake = 9, + dot11_manufacturing_test_IHV_start = 0x80000000, + dot11_manufacturing_test_IHV_end = 0xffffffff, +}} +pub type PDOT11_MANUFACTURING_TEST_TYPE = *mut DOT11_MANUFACTURING_TEST_TYPE; +STRUCT!{struct DOT11_MANUFACTURING_TEST { + dot11ManufacturingTestType: DOT11_MANUFACTURING_TEST_TYPE, + uBufferLength: ULONG, + ucBuffer: [UCHAR; 1], +}} +pub type PDOT11_MANUFACTURING_TEST = *mut DOT11_MANUFACTURING_TEST; +ENUM!{enum DOT11_MANUFACTURING_SELF_TEST_TYPE { + DOT11_MANUFACTURING_SELF_TEST_TYPE_INTERFACE = 1, + DOT11_MANUFACTURING_SELF_TEST_TYPE_RF_INTERFACE = 2, + DOT11_MANUFACTURING_SELF_TEST_TYPE_BT_COEXISTENCE = 3, +}} +pub type PDOT11_MANUFACTURING_SELF_TEST_TYPE = *mut DOT11_MANUFACTURING_SELF_TEST_TYPE; +STRUCT!{struct DOT11_MANUFACTURING_SELF_TEST_SET_PARAMS { + SelfTestType: DOT11_MANUFACTURING_SELF_TEST_TYPE, + uTestID: ULONG, + uPinBitMask: ULONG, + pvContext: PVOID, + uBufferLength: ULONG, + ucBufferIn: [UCHAR; 1], +}} +pub type PDOT11_MANUFACTURING_SELF_TEST_SET_PARAMS = + *mut DOT11_MANUFACTURING_SELF_TEST_SET_PARAMS; +STRUCT!{struct DOT11_MANUFACTURING_SELF_TEST_QUERY_RESULTS { + SelfTestType: DOT11_MANUFACTURING_SELF_TEST_TYPE, + uTestID: ULONG, + bResult: BOOLEAN, + uPinFailedBitMask: ULONG, + pvContext: PVOID, + uBytesWrittenOut: ULONG, + ucBufferOut: [UCHAR; 1], +}} +pub type PDOT11_MANUFACTURING_SELF_TEST_QUERY_RESULTS = + *mut DOT11_MANUFACTURING_SELF_TEST_QUERY_RESULTS; +ENUM!{enum DOT11_BAND { + dot11_band_2p4g = 1, + dot11_band_4p9g = 2, + dot11_band_5g = 3, +}} +pub type PDOT11_BAND = *mut DOT11_BAND; +STRUCT!{struct DOT11_MANUFACTURING_FUNCTIONAL_TEST_RX { + bEnabled: BOOLEAN, + Dot11Band: DOT11_BAND, + uChannel: ULONG, + PowerLevel: LONG, +}} +pub type PDOT11_MANUFACTURING_FUNCTIONAL_TEST_RX = *mut DOT11_MANUFACTURING_FUNCTIONAL_TEST_RX; +STRUCT!{struct DOT11_MANUFACTURING_FUNCTIONAL_TEST_TX { + bEnable: BOOLEAN, + bOpenLoop: BOOLEAN, + Dot11Band: DOT11_BAND, + uChannel: ULONG, + uSetPowerLevel: ULONG, + ADCPowerLevel: LONG, +}} +pub type PDOT11_MANUFACTURING_FUNCTIONAL_TEST_TX = *mut DOT11_MANUFACTURING_FUNCTIONAL_TEST_TX; +STRUCT!{struct DOT11_MANUFACTURING_FUNCTIONAL_TEST_QUERY_ADC { + Dot11Band: DOT11_BAND, + uChannel: ULONG, + ADCPowerLevel: LONG, +}} +pub type PDOT11_MANUFACTURING_FUNCTIONAL_TEST_QUERY_ADC = + *mut DOT11_MANUFACTURING_FUNCTIONAL_TEST_QUERY_ADC; +STRUCT!{struct DOT11_MANUFACTURING_TEST_SET_DATA { + uKey: ULONG, + uOffset: ULONG, + uBufferLength: ULONG, + ucBufferIn: [UCHAR; 1], +}} +pub type PDOT11_MANUFACTURING_TEST_SET_DATA = *mut DOT11_MANUFACTURING_TEST_SET_DATA; +STRUCT!{struct DOT11_MANUFACTURING_TEST_QUERY_DATA { + uKey: ULONG, + uOffset: ULONG, + uBufferLength: ULONG, + uBytesRead: ULONG, + ucBufferOut: [UCHAR; 1], +}} +pub type PDOT11_MANUFACTURING_TEST_QUERY_DATA = *mut DOT11_MANUFACTURING_TEST_QUERY_DATA; +STRUCT!{struct DOT11_MANUFACTURING_TEST_SLEEP { + uSleepTime: ULONG, + pvContext: PVOID, +}} +pub type PDOT11_MANUFACTURING_TEST_SLEEP = *mut DOT11_MANUFACTURING_TEST_SLEEP; +ENUM!{enum DOT11_MANUFACTURING_CALLBACK_TYPE { + dot11_manufacturing_callback_unknown = 0, + dot11_manufacturing_callback_self_test_complete = 1, + dot11_manufacturing_callback_sleep_complete = 2, + dot11_manufacturing_callback_IHV_start = 0x80000000, + dot11_manufacturing_callback_IHV_end = 0xffffffff, +}} +pub type PDOT11_MANUFACTURING_CALLBACK_TYPE = *mut DOT11_MANUFACTURING_CALLBACK_TYPE; +STRUCT!{struct DOT11_MANUFACTURING_CALLBACK_PARAMETERS { + Header: NDIS_OBJECT_HEADER, + dot11ManufacturingCallbackType: DOT11_MANUFACTURING_CALLBACK_TYPE, + uStatus: ULONG, + pvContext: PVOID, +}} +pub type PDOT11_MANUFACTURING_CALLBACK_PARAMETERS = *mut DOT11_MANUFACTURING_CALLBACK_PARAMETERS; +pub const DOT11_MANUFACTURING_CALLBACK_REVISION_1: UCHAR = 1; +pub const OID_DOT11_SET_FT_REASSOCIATION_PARAMETERS: u32 = + NWF_DEFINE_OID!(0x168, NWF_OPERATIONAL_OID, NWF_MANDATORY_OID); diff --git a/bash-5.1/vendor/winapi/src/shared/windowsx.rs b/bash-5.1/vendor/winapi/src/shared/windowsx.rs new file mode 100644 index 0000000000000000000000000000000000000000..4147aa353c432750cb8e70bf678bf64df1099660 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/windowsx.rs @@ -0,0 +1,17 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Macro APIs, window message crackers, and control APIs +use ctypes::{c_int, c_short}; +use shared::minwindef::{DWORD, HIWORD, LOWORD, LPARAM}; +//1233 +#[inline] +pub fn GET_X_LPARAM(lp: LPARAM) -> c_int { + LOWORD(lp as DWORD) as c_short as c_int +} +#[inline] +pub fn GET_Y_LPARAM(lp: LPARAM) -> c_int { + HIWORD(lp as DWORD) as c_short as c_int +} diff --git a/bash-5.1/vendor/winapi/src/shared/winerror.rs b/bash-5.1/vendor/winapi/src/shared/winerror.rs new file mode 100644 index 0000000000000000000000000000000000000000..2c2982100c64721103202f313fa679d92a4ce9a7 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/winerror.rs @@ -0,0 +1,6150 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! error code definitions for the Win32 API functions +use ctypes::{c_long, c_ulong}; +use shared::minwindef::DWORD; +use shared::wtypesbase::SCODE; +pub const FACILITY_XPS: HRESULT = 82; +pub const FACILITY_XAML: HRESULT = 43; +pub const FACILITY_USN: HRESULT = 129; +pub const FACILITY_BLBUI: HRESULT = 128; +pub const FACILITY_SPP: HRESULT = 256; +pub const FACILITY_WSB_ONLINE: HRESULT = 133; +pub const FACILITY_DLS: HRESULT = 153; +pub const FACILITY_BLB_CLI: HRESULT = 121; +pub const FACILITY_BLB: HRESULT = 120; +pub const FACILITY_WSBAPP: HRESULT = 122; +pub const FACILITY_WPN: HRESULT = 62; +pub const FACILITY_WMAAECMA: HRESULT = 1996; +pub const FACILITY_WINRM: HRESULT = 51; +pub const FACILITY_WINPE: HRESULT = 61; +pub const FACILITY_WINDOWSUPDATE: HRESULT = 36; +pub const FACILITY_WINDOWS_STORE: HRESULT = 63; +pub const FACILITY_WINDOWS_SETUP: HRESULT = 48; +pub const FACILITY_WINDOWS_DEFENDER: HRESULT = 80; +pub const FACILITY_WINDOWS_CE: HRESULT = 24; +pub const FACILITY_WINDOWS: HRESULT = 8; +pub const FACILITY_WINCODEC_DWRITE_DWM: HRESULT = 2200; +pub const FACILITY_WIA: HRESULT = 33; +pub const FACILITY_WER: HRESULT = 27; +pub const FACILITY_WEP: HRESULT = 2049; +pub const FACILITY_WEB_SOCKET: HRESULT = 886; +pub const FACILITY_WEB: HRESULT = 885; +pub const FACILITY_USERMODE_VOLSNAP: HRESULT = 130; +pub const FACILITY_USERMODE_VOLMGR: HRESULT = 56; +pub const FACILITY_VISUALCPP: HRESULT = 109; +pub const FACILITY_USERMODE_VIRTUALIZATION: HRESULT = 55; +pub const FACILITY_USERMODE_VHD: HRESULT = 58; +pub const FACILITY_URT: HRESULT = 19; +pub const FACILITY_UMI: HRESULT = 22; +pub const FACILITY_UI: HRESULT = 42; +pub const FACILITY_TPM_SOFTWARE: HRESULT = 41; +pub const FACILITY_TPM_SERVICES: HRESULT = 40; +pub const FACILITY_TIERING: HRESULT = 131; +pub const FACILITY_SYNCENGINE: HRESULT = 2050; +pub const FACILITY_SXS: HRESULT = 23; +pub const FACILITY_STORAGE: HRESULT = 3; +pub const FACILITY_STATE_MANAGEMENT: HRESULT = 34; +pub const FACILITY_SSPI: HRESULT = 9; +pub const FACILITY_USERMODE_SPACES: HRESULT = 231; +pub const FACILITY_SOS: HRESULT = 160; +pub const FACILITY_SCARD: HRESULT = 16; +pub const FACILITY_SHELL: HRESULT = 39; +pub const FACILITY_SETUPAPI: HRESULT = 15; +pub const FACILITY_SECURITY: HRESULT = 9; +pub const FACILITY_SDIAG: HRESULT = 60; +pub const FACILITY_USERMODE_SDBUS: HRESULT = 2305; +pub const FACILITY_RPC: HRESULT = 1; +pub const FACILITY_RESTORE: HRESULT = 256; +pub const FACILITY_SCRIPT: HRESULT = 112; +pub const FACILITY_PARSE: HRESULT = 113; +pub const FACILITY_RAS: HRESULT = 83; +pub const FACILITY_POWERSHELL: HRESULT = 84; +pub const FACILITY_PLA: HRESULT = 48; +pub const FACILITY_PIDGENX: HRESULT = 2561; +pub const FACILITY_P2P_INT: HRESULT = 98; +pub const FACILITY_P2P: HRESULT = 99; +pub const FACILITY_OPC: HRESULT = 81; +pub const FACILITY_ONLINE_ID: HRESULT = 134; +pub const FACILITY_WIN32: HRESULT = 7; +pub const FACILITY_CONTROL: HRESULT = 10; +pub const FACILITY_WEBSERVICES: HRESULT = 61; +pub const FACILITY_NULL: HRESULT = 0; +pub const FACILITY_NDIS: HRESULT = 52; +pub const FACILITY_NAP: HRESULT = 39; +pub const FACILITY_MOBILE: HRESULT = 1793; +pub const FACILITY_METADIRECTORY: HRESULT = 35; +pub const FACILITY_MSMQ: HRESULT = 14; +pub const FACILITY_MEDIASERVER: HRESULT = 13; +pub const FACILITY_MBN: HRESULT = 84; +pub const FACILITY_LINGUISTIC_SERVICES: HRESULT = 305; +pub const FACILITY_LEAP: HRESULT = 2184; +pub const FACILITY_JSCRIPT: HRESULT = 2306; +pub const FACILITY_INTERNET: HRESULT = 12; +pub const FACILITY_ITF: HRESULT = 4; +pub const FACILITY_INPUT: HRESULT = 64; +pub const FACILITY_USERMODE_HYPERVISOR: HRESULT = 53; +pub const FACILITY_ACCELERATOR: HRESULT = 1536; +pub const FACILITY_HTTP: HRESULT = 25; +pub const FACILITY_GRAPHICS: HRESULT = 38; +pub const FACILITY_FWP: HRESULT = 50; +pub const FACILITY_FVE: HRESULT = 49; +pub const FACILITY_USERMODE_FILTER_MANAGER: HRESULT = 31; +pub const FACILITY_EAS: HRESULT = 85; +pub const FACILITY_EAP: HRESULT = 66; +pub const FACILITY_DXGI_DDI: HRESULT = 2171; +pub const FACILITY_DXGI: HRESULT = 2170; +pub const FACILITY_DPLAY: HRESULT = 21; +pub const FACILITY_DMSERVER: HRESULT = 256; +pub const FACILITY_DISPATCH: HRESULT = 2; +pub const FACILITY_DIRECTORYSERVICE: HRESULT = 37; +pub const FACILITY_DIRECTMUSIC: HRESULT = 2168; +pub const FACILITY_DIRECT3D11: HRESULT = 2172; +pub const FACILITY_DIRECT3D10: HRESULT = 2169; +pub const FACILITY_DIRECT2D: HRESULT = 2201; +pub const FACILITY_DAF: HRESULT = 100; +pub const FACILITY_DEPLOYMENT_SERVICES_UTIL: HRESULT = 260; +pub const FACILITY_DEPLOYMENT_SERVICES_TRANSPORT_MANAGEMENT: HRESULT = 272; +pub const FACILITY_DEPLOYMENT_SERVICES_TFTP: HRESULT = 264; +pub const FACILITY_DEPLOYMENT_SERVICES_PXE: HRESULT = 263; +pub const FACILITY_DEPLOYMENT_SERVICES_MULTICAST_SERVER: HRESULT = 289; +pub const FACILITY_DEPLOYMENT_SERVICES_MULTICAST_CLIENT: HRESULT = 290; +pub const FACILITY_DEPLOYMENT_SERVICES_MANAGEMENT: HRESULT = 259; +pub const FACILITY_DEPLOYMENT_SERVICES_IMAGING: HRESULT = 258; +pub const FACILITY_DEPLOYMENT_SERVICES_DRIVER_PROVISIONING: HRESULT = 278; +pub const FACILITY_DEPLOYMENT_SERVICES_SERVER: HRESULT = 257; +pub const FACILITY_DEPLOYMENT_SERVICES_CONTENT_PROVIDER: HRESULT = 293; +pub const FACILITY_DEPLOYMENT_SERVICES_BINLSVC: HRESULT = 261; +pub const FACILITY_DEFRAG: HRESULT = 2304; +pub const FACILITY_DEBUGGERS: HRESULT = 176; +pub const FACILITY_CONFIGURATION: HRESULT = 33; +pub const FACILITY_COMPLUS: HRESULT = 17; +pub const FACILITY_USERMODE_COMMONLOG: HRESULT = 26; +pub const FACILITY_CMI: HRESULT = 54; +pub const FACILITY_CERT: HRESULT = 11; +pub const FACILITY_BLUETOOTH_ATT: HRESULT = 101; +pub const FACILITY_BCD: HRESULT = 57; +pub const FACILITY_BACKGROUNDCOPY: HRESULT = 32; +pub const FACILITY_AUDIOSTREAMING: HRESULT = 1094; +pub const FACILITY_AUDCLNT: HRESULT = 2185; +pub const FACILITY_AUDIO: HRESULT = 102; +pub const FACILITY_ACTION_QUEUE: HRESULT = 44; +pub const FACILITY_ACS: HRESULT = 20; +pub const FACILITY_AAF: HRESULT = 18; +pub const ERROR_SUCCESS: DWORD = 0; +pub const NO_ERROR: DWORD = 0; +pub const SEC_E_OK: HRESULT = 0; +pub const ERROR_INVALID_FUNCTION: DWORD = 1; +pub const ERROR_FILE_NOT_FOUND: DWORD = 2; +pub const ERROR_PATH_NOT_FOUND: DWORD = 3; +pub const ERROR_TOO_MANY_OPEN_FILES: DWORD = 4; +pub const ERROR_ACCESS_DENIED: DWORD = 5; +pub const ERROR_INVALID_HANDLE: DWORD = 6; +pub const ERROR_ARENA_TRASHED: DWORD = 7; +pub const ERROR_NOT_ENOUGH_MEMORY: DWORD = 8; +pub const ERROR_INVALID_BLOCK: DWORD = 9; +pub const ERROR_BAD_ENVIRONMENT: DWORD = 10; +pub const ERROR_BAD_FORMAT: DWORD = 11; +pub const ERROR_INVALID_ACCESS: DWORD = 12; +pub const ERROR_INVALID_DATA: DWORD = 13; +pub const ERROR_OUTOFMEMORY: DWORD = 14; +pub const ERROR_INVALID_DRIVE: DWORD = 15; +pub const ERROR_CURRENT_DIRECTORY: DWORD = 16; +pub const ERROR_NOT_SAME_DEVICE: DWORD = 17; +pub const ERROR_NO_MORE_FILES: DWORD = 18; +pub const ERROR_WRITE_PROTECT: DWORD = 19; +pub const ERROR_BAD_UNIT: DWORD = 20; +pub const ERROR_NOT_READY: DWORD = 21; +pub const ERROR_BAD_COMMAND: DWORD = 22; +pub const ERROR_CRC: DWORD = 23; +pub const ERROR_BAD_LENGTH: DWORD = 24; +pub const ERROR_SEEK: DWORD = 25; +pub const ERROR_NOT_DOS_DISK: DWORD = 26; +pub const ERROR_SECTOR_NOT_FOUND: DWORD = 27; +pub const ERROR_OUT_OF_PAPER: DWORD = 28; +pub const ERROR_WRITE_FAULT: DWORD = 29; +pub const ERROR_READ_FAULT: DWORD = 30; +pub const ERROR_GEN_FAILURE: DWORD = 31; +pub const ERROR_SHARING_VIOLATION: DWORD = 32; +pub const ERROR_LOCK_VIOLATION: DWORD = 33; +pub const ERROR_WRONG_DISK: DWORD = 34; +pub const ERROR_SHARING_BUFFER_EXCEEDED: DWORD = 36; +pub const ERROR_HANDLE_EOF: DWORD = 38; +pub const ERROR_HANDLE_DISK_FULL: DWORD = 39; +pub const ERROR_NOT_SUPPORTED: DWORD = 50; +pub const ERROR_REM_NOT_LIST: DWORD = 51; +pub const ERROR_DUP_NAME: DWORD = 52; +pub const ERROR_BAD_NETPATH: DWORD = 53; +pub const ERROR_NETWORK_BUSY: DWORD = 54; +pub const ERROR_DEV_NOT_EXIST: DWORD = 55; +pub const ERROR_TOO_MANY_CMDS: DWORD = 56; +pub const ERROR_ADAP_HDW_ERR: DWORD = 57; +pub const ERROR_BAD_NET_RESP: DWORD = 58; +pub const ERROR_UNEXP_NET_ERR: DWORD = 59; +pub const ERROR_BAD_REM_ADAP: DWORD = 60; +pub const ERROR_PRINTQ_FULL: DWORD = 61; +pub const ERROR_NO_SPOOL_SPACE: DWORD = 62; +pub const ERROR_PRINT_CANCELLED: DWORD = 63; +pub const ERROR_NETNAME_DELETED: DWORD = 64; +pub const ERROR_NETWORK_ACCESS_DENIED: DWORD = 65; +pub const ERROR_BAD_DEV_TYPE: DWORD = 66; +pub const ERROR_BAD_NET_NAME: DWORD = 67; +pub const ERROR_TOO_MANY_NAMES: DWORD = 68; +pub const ERROR_TOO_MANY_SESS: DWORD = 69; +pub const ERROR_SHARING_PAUSED: DWORD = 70; +pub const ERROR_REQ_NOT_ACCEP: DWORD = 71; +pub const ERROR_REDIR_PAUSED: DWORD = 72; +pub const ERROR_FILE_EXISTS: DWORD = 80; +pub const ERROR_CANNOT_MAKE: DWORD = 82; +pub const ERROR_FAIL_I24: DWORD = 83; +pub const ERROR_OUT_OF_STRUCTURES: DWORD = 84; +pub const ERROR_ALREADY_ASSIGNED: DWORD = 85; +pub const ERROR_INVALID_PASSWORD: DWORD = 86; +pub const ERROR_INVALID_PARAMETER: DWORD = 87; +pub const ERROR_NET_WRITE_FAULT: DWORD = 88; +pub const ERROR_NO_PROC_SLOTS: DWORD = 89; +pub const ERROR_TOO_MANY_SEMAPHORES: DWORD = 100; +pub const ERROR_EXCL_SEM_ALREADY_OWNED: DWORD = 101; +pub const ERROR_SEM_IS_SET: DWORD = 102; +pub const ERROR_TOO_MANY_SEM_REQUESTS: DWORD = 103; +pub const ERROR_INVALID_AT_INTERRUPT_TIME: DWORD = 104; +pub const ERROR_SEM_OWNER_DIED: DWORD = 105; +pub const ERROR_SEM_USER_LIMIT: DWORD = 106; +pub const ERROR_DISK_CHANGE: DWORD = 107; +pub const ERROR_DRIVE_LOCKED: DWORD = 108; +pub const ERROR_BROKEN_PIPE: DWORD = 109; +pub const ERROR_OPEN_FAILED: DWORD = 110; +pub const ERROR_BUFFER_OVERFLOW: DWORD = 111; +pub const ERROR_DISK_FULL: DWORD = 112; +pub const ERROR_NO_MORE_SEARCH_HANDLES: DWORD = 113; +pub const ERROR_INVALID_TARGET_HANDLE: DWORD = 114; +pub const ERROR_INVALID_CATEGORY: DWORD = 117; +pub const ERROR_INVALID_VERIFY_SWITCH: DWORD = 118; +pub const ERROR_BAD_DRIVER_LEVEL: DWORD = 119; +pub const ERROR_CALL_NOT_IMPLEMENTED: DWORD = 120; +pub const ERROR_SEM_TIMEOUT: DWORD = 121; +pub const ERROR_INSUFFICIENT_BUFFER: DWORD = 122; +pub const ERROR_INVALID_NAME: DWORD = 123; +pub const ERROR_INVALID_LEVEL: DWORD = 124; +pub const ERROR_NO_VOLUME_LABEL: DWORD = 125; +pub const ERROR_MOD_NOT_FOUND: DWORD = 126; +pub const ERROR_PROC_NOT_FOUND: DWORD = 127; +pub const ERROR_WAIT_NO_CHILDREN: DWORD = 128; +pub const ERROR_CHILD_NOT_COMPLETE: DWORD = 129; +pub const ERROR_DIRECT_ACCESS_HANDLE: DWORD = 130; +pub const ERROR_NEGATIVE_SEEK: DWORD = 131; +pub const ERROR_SEEK_ON_DEVICE: DWORD = 132; +pub const ERROR_IS_JOIN_TARGET: DWORD = 133; +pub const ERROR_IS_JOINED: DWORD = 134; +pub const ERROR_IS_SUBSTED: DWORD = 135; +pub const ERROR_NOT_JOINED: DWORD = 136; +pub const ERROR_NOT_SUBSTED: DWORD = 137; +pub const ERROR_JOIN_TO_JOIN: DWORD = 138; +pub const ERROR_SUBST_TO_SUBST: DWORD = 139; +pub const ERROR_JOIN_TO_SUBST: DWORD = 140; +pub const ERROR_SUBST_TO_JOIN: DWORD = 141; +pub const ERROR_BUSY_DRIVE: DWORD = 142; +pub const ERROR_SAME_DRIVE: DWORD = 143; +pub const ERROR_DIR_NOT_ROOT: DWORD = 144; +pub const ERROR_DIR_NOT_EMPTY: DWORD = 145; +pub const ERROR_IS_SUBST_PATH: DWORD = 146; +pub const ERROR_IS_JOIN_PATH: DWORD = 147; +pub const ERROR_PATH_BUSY: DWORD = 148; +pub const ERROR_IS_SUBST_TARGET: DWORD = 149; +pub const ERROR_SYSTEM_TRACE: DWORD = 150; +pub const ERROR_INVALID_EVENT_COUNT: DWORD = 151; +pub const ERROR_TOO_MANY_MUXWAITERS: DWORD = 152; +pub const ERROR_INVALID_LIST_FORMAT: DWORD = 153; +pub const ERROR_LABEL_TOO_LONG: DWORD = 154; +pub const ERROR_TOO_MANY_TCBS: DWORD = 155; +pub const ERROR_SIGNAL_REFUSED: DWORD = 156; +pub const ERROR_DISCARDED: DWORD = 157; +pub const ERROR_NOT_LOCKED: DWORD = 158; +pub const ERROR_BAD_THREADID_ADDR: DWORD = 159; +pub const ERROR_BAD_ARGUMENTS: DWORD = 160; +pub const ERROR_BAD_PATHNAME: DWORD = 161; +pub const ERROR_SIGNAL_PENDING: DWORD = 162; +pub const ERROR_MAX_THRDS_REACHED: DWORD = 164; +pub const ERROR_LOCK_FAILED: DWORD = 167; +pub const ERROR_BUSY: DWORD = 170; +pub const ERROR_DEVICE_SUPPORT_IN_PROGRESS: DWORD = 171; +pub const ERROR_CANCEL_VIOLATION: DWORD = 173; +pub const ERROR_ATOMIC_LOCKS_NOT_SUPPORTED: DWORD = 174; +pub const ERROR_INVALID_SEGMENT_NUMBER: DWORD = 180; +pub const ERROR_INVALID_ORDINAL: DWORD = 182; +pub const ERROR_ALREADY_EXISTS: DWORD = 183; +pub const ERROR_INVALID_FLAG_NUMBER: DWORD = 186; +pub const ERROR_SEM_NOT_FOUND: DWORD = 187; +pub const ERROR_INVALID_STARTING_CODESEG: DWORD = 188; +pub const ERROR_INVALID_STACKSEG: DWORD = 189; +pub const ERROR_INVALID_MODULETYPE: DWORD = 190; +pub const ERROR_INVALID_EXE_SIGNATURE: DWORD = 191; +pub const ERROR_EXE_MARKED_INVALID: DWORD = 192; +pub const ERROR_BAD_EXE_FORMAT: DWORD = 193; +pub const ERROR_ITERATED_DATA_EXCEEDS_64k: DWORD = 194; +pub const ERROR_INVALID_MINALLOCSIZE: DWORD = 195; +pub const ERROR_DYNLINK_FROM_INVALID_RING: DWORD = 196; +pub const ERROR_IOPL_NOT_ENABLED: DWORD = 197; +pub const ERROR_INVALID_SEGDPL: DWORD = 198; +pub const ERROR_AUTODATASEG_EXCEEDS_64k: DWORD = 199; +pub const ERROR_RING2SEG_MUST_BE_MOVABLE: DWORD = 200; +pub const ERROR_RELOC_CHAIN_XEEDS_SEGLIM: DWORD = 201; +pub const ERROR_INFLOOP_IN_RELOC_CHAIN: DWORD = 202; +pub const ERROR_ENVVAR_NOT_FOUND: DWORD = 203; +pub const ERROR_NO_SIGNAL_SENT: DWORD = 205; +pub const ERROR_FILENAME_EXCED_RANGE: DWORD = 206; +pub const ERROR_RING2_STACK_IN_USE: DWORD = 207; +pub const ERROR_META_EXPANSION_TOO_LONG: DWORD = 208; +pub const ERROR_INVALID_SIGNAL_NUMBER: DWORD = 209; +pub const ERROR_THREAD_1_INACTIVE: DWORD = 210; +pub const ERROR_LOCKED: DWORD = 212; +pub const ERROR_TOO_MANY_MODULES: DWORD = 214; +pub const ERROR_NESTING_NOT_ALLOWED: DWORD = 215; +pub const ERROR_EXE_MACHINE_TYPE_MISMATCH: DWORD = 216; +pub const ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY: DWORD = 217; +pub const ERROR_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY: DWORD = 218; +pub const ERROR_FILE_CHECKED_OUT: DWORD = 220; +pub const ERROR_CHECKOUT_REQUIRED: DWORD = 221; +pub const ERROR_BAD_FILE_TYPE: DWORD = 222; +pub const ERROR_FILE_TOO_LARGE: DWORD = 223; +pub const ERROR_FORMS_AUTH_REQUIRED: DWORD = 224; +pub const ERROR_VIRUS_INFECTED: DWORD = 225; +pub const ERROR_VIRUS_DELETED: DWORD = 226; +pub const ERROR_PIPE_LOCAL: DWORD = 229; +pub const ERROR_BAD_PIPE: DWORD = 230; +pub const ERROR_PIPE_BUSY: DWORD = 231; +pub const ERROR_NO_DATA: DWORD = 232; +pub const ERROR_PIPE_NOT_CONNECTED: DWORD = 233; +pub const ERROR_MORE_DATA: DWORD = 234; +pub const ERROR_VC_DISCONNECTED: DWORD = 240; +pub const ERROR_INVALID_EA_NAME: DWORD = 254; +pub const ERROR_EA_LIST_INCONSISTENT: DWORD = 255; +pub const WAIT_TIMEOUT: DWORD = 258; +pub const ERROR_NO_MORE_ITEMS: DWORD = 259; +pub const ERROR_CANNOT_COPY: DWORD = 266; +pub const ERROR_DIRECTORY: DWORD = 267; +pub const ERROR_EAS_DIDNT_FIT: DWORD = 275; +pub const ERROR_EA_FILE_CORRUPT: DWORD = 276; +pub const ERROR_EA_TABLE_FULL: DWORD = 277; +pub const ERROR_INVALID_EA_HANDLE: DWORD = 278; +pub const ERROR_EAS_NOT_SUPPORTED: DWORD = 282; +pub const ERROR_NOT_OWNER: DWORD = 288; +pub const ERROR_TOO_MANY_POSTS: DWORD = 298; +pub const ERROR_PARTIAL_COPY: DWORD = 299; +pub const ERROR_OPLOCK_NOT_GRANTED: DWORD = 300; +pub const ERROR_INVALID_OPLOCK_PROTOCOL: DWORD = 301; +pub const ERROR_DISK_TOO_FRAGMENTED: DWORD = 302; +pub const ERROR_DELETE_PENDING: DWORD = 303; +pub const ERROR_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING: DWORD = 304; +pub const ERROR_SHORT_NAMES_NOT_ENABLED_ON_VOLUME: DWORD = 305; +pub const ERROR_SECURITY_STREAM_IS_INCONSISTENT: DWORD = 306; +pub const ERROR_INVALID_LOCK_RANGE: DWORD = 307; +pub const ERROR_IMAGE_SUBSYSTEM_NOT_PRESENT: DWORD = 308; +pub const ERROR_NOTIFICATION_GUID_ALREADY_DEFINED: DWORD = 309; +pub const ERROR_INVALID_EXCEPTION_HANDLER: DWORD = 310; +pub const ERROR_DUPLICATE_PRIVILEGES: DWORD = 311; +pub const ERROR_NO_RANGES_PROCESSED: DWORD = 312; +pub const ERROR_NOT_ALLOWED_ON_SYSTEM_FILE: DWORD = 313; +pub const ERROR_DISK_RESOURCES_EXHAUSTED: DWORD = 314; +pub const ERROR_INVALID_TOKEN: DWORD = 315; +pub const ERROR_DEVICE_FEATURE_NOT_SUPPORTED: DWORD = 316; +pub const ERROR_MR_MID_NOT_FOUND: DWORD = 317; +pub const ERROR_SCOPE_NOT_FOUND: DWORD = 318; +pub const ERROR_UNDEFINED_SCOPE: DWORD = 319; +pub const ERROR_INVALID_CAP: DWORD = 320; +pub const ERROR_DEVICE_UNREACHABLE: DWORD = 321; +pub const ERROR_DEVICE_NO_RESOURCES: DWORD = 322; +pub const ERROR_DATA_CHECKSUM_ERROR: DWORD = 323; +pub const ERROR_INTERMIXED_KERNEL_EA_OPERATION: DWORD = 324; +pub const ERROR_FILE_LEVEL_TRIM_NOT_SUPPORTED: DWORD = 326; +pub const ERROR_OFFSET_ALIGNMENT_VIOLATION: DWORD = 327; +pub const ERROR_INVALID_FIELD_IN_PARAMETER_LIST: DWORD = 328; +pub const ERROR_OPERATION_IN_PROGRESS: DWORD = 329; +pub const ERROR_BAD_DEVICE_PATH: DWORD = 330; +pub const ERROR_TOO_MANY_DESCRIPTORS: DWORD = 331; +pub const ERROR_SCRUB_DATA_DISABLED: DWORD = 332; +pub const ERROR_NOT_REDUNDANT_STORAGE: DWORD = 333; +pub const ERROR_RESIDENT_FILE_NOT_SUPPORTED: DWORD = 334; +pub const ERROR_COMPRESSED_FILE_NOT_SUPPORTED: DWORD = 335; +pub const ERROR_DIRECTORY_NOT_SUPPORTED: DWORD = 336; +pub const ERROR_NOT_READ_FROM_COPY: DWORD = 337; +pub const ERROR_FT_WRITE_FAILURE: DWORD = 338; +pub const ERROR_FT_DI_SCAN_REQUIRED: DWORD = 339; +pub const ERROR_INVALID_KERNEL_INFO_VERSION: DWORD = 340; +pub const ERROR_INVALID_PEP_INFO_VERSION: DWORD = 341; +pub const ERROR_OBJECT_NOT_EXTERNALLY_BACKED: DWORD = 342; +pub const ERROR_EXTERNAL_BACKING_PROVIDER_UNKNOWN: DWORD = 343; +pub const ERROR_ENCLAVE_FAILURE: DWORD = 349; +pub const ERROR_FAIL_NOACTION_REBOOT: DWORD = 350; +pub const ERROR_FAIL_SHUTDOWN: DWORD = 351; +pub const ERROR_FAIL_RESTART: DWORD = 352; +pub const ERROR_MAX_SESSIONS_REACHED: DWORD = 353; +pub const ERROR_THREAD_MODE_ALREADY_BACKGROUND: DWORD = 400; +pub const ERROR_THREAD_MODE_NOT_BACKGROUND: DWORD = 401; +pub const ERROR_PROCESS_MODE_ALREADY_BACKGROUND: DWORD = 402; +pub const ERROR_PROCESS_MODE_NOT_BACKGROUND: DWORD = 403; +pub const ERROR_DEVICE_HARDWARE_ERROR: DWORD = 483; +pub const ERROR_INVALID_ADDRESS: DWORD = 487; +pub const ERROR_USER_PROFILE_LOAD: DWORD = 500; +pub const ERROR_ARITHMETIC_OVERFLOW: DWORD = 534; +pub const ERROR_PIPE_CONNECTED: DWORD = 535; +pub const ERROR_PIPE_LISTENING: DWORD = 536; +pub const ERROR_VERIFIER_STOP: DWORD = 537; +pub const ERROR_ABIOS_ERROR: DWORD = 538; +pub const ERROR_WX86_WARNING: DWORD = 539; +pub const ERROR_WX86_ERROR: DWORD = 540; +pub const ERROR_TIMER_NOT_CANCELED: DWORD = 541; +pub const ERROR_UNWIND: DWORD = 542; +pub const ERROR_BAD_STACK: DWORD = 543; +pub const ERROR_INVALID_UNWIND_TARGET: DWORD = 544; +pub const ERROR_INVALID_PORT_ATTRIBUTES: DWORD = 545; +pub const ERROR_PORT_MESSAGE_TOO_LONG: DWORD = 546; +pub const ERROR_INVALID_QUOTA_LOWER: DWORD = 547; +pub const ERROR_DEVICE_ALREADY_ATTACHED: DWORD = 548; +pub const ERROR_INSTRUCTION_MISALIGNMENT: DWORD = 549; +pub const ERROR_PROFILING_NOT_STARTED: DWORD = 550; +pub const ERROR_PROFILING_NOT_STOPPED: DWORD = 551; +pub const ERROR_COULD_NOT_INTERPRET: DWORD = 552; +pub const ERROR_PROFILING_AT_LIMIT: DWORD = 553; +pub const ERROR_CANT_WAIT: DWORD = 554; +pub const ERROR_CANT_TERMINATE_SELF: DWORD = 555; +pub const ERROR_UNEXPECTED_MM_CREATE_ERR: DWORD = 556; +pub const ERROR_UNEXPECTED_MM_MAP_ERROR: DWORD = 557; +pub const ERROR_UNEXPECTED_MM_EXTEND_ERR: DWORD = 558; +pub const ERROR_BAD_FUNCTION_TABLE: DWORD = 559; +pub const ERROR_NO_GUID_TRANSLATION: DWORD = 560; +pub const ERROR_INVALID_LDT_SIZE: DWORD = 561; +pub const ERROR_INVALID_LDT_OFFSET: DWORD = 563; +pub const ERROR_INVALID_LDT_DESCRIPTOR: DWORD = 564; +pub const ERROR_TOO_MANY_THREADS: DWORD = 565; +pub const ERROR_THREAD_NOT_IN_PROCESS: DWORD = 566; +pub const ERROR_PAGEFILE_QUOTA_EXCEEDED: DWORD = 567; +pub const ERROR_LOGON_SERVER_CONFLICT: DWORD = 568; +pub const ERROR_SYNCHRONIZATION_REQUIRED: DWORD = 569; +pub const ERROR_NET_OPEN_FAILED: DWORD = 570; +pub const ERROR_IO_PRIVILEGE_FAILED: DWORD = 571; +pub const ERROR_CONTROL_C_EXIT: DWORD = 572; +pub const ERROR_MISSING_SYSTEMFILE: DWORD = 573; +pub const ERROR_UNHANDLED_EXCEPTION: DWORD = 574; +pub const ERROR_APP_INIT_FAILURE: DWORD = 575; +pub const ERROR_PAGEFILE_CREATE_FAILED: DWORD = 576; +pub const ERROR_INVALID_IMAGE_HASH: DWORD = 577; +pub const ERROR_NO_PAGEFILE: DWORD = 578; +pub const ERROR_ILLEGAL_FLOAT_CONTEXT: DWORD = 579; +pub const ERROR_NO_EVENT_PAIR: DWORD = 580; +pub const ERROR_DOMAIN_CTRLR_CONFIG_ERROR: DWORD = 581; +pub const ERROR_ILLEGAL_CHARACTER: DWORD = 582; +pub const ERROR_UNDEFINED_CHARACTER: DWORD = 583; +pub const ERROR_FLOPPY_VOLUME: DWORD = 584; +pub const ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT: DWORD = 585; +pub const ERROR_BACKUP_CONTROLLER: DWORD = 586; +pub const ERROR_MUTANT_LIMIT_EXCEEDED: DWORD = 587; +pub const ERROR_FS_DRIVER_REQUIRED: DWORD = 588; +pub const ERROR_CANNOT_LOAD_REGISTRY_FILE: DWORD = 589; +pub const ERROR_DEBUG_ATTACH_FAILED: DWORD = 590; +pub const ERROR_SYSTEM_PROCESS_TERMINATED: DWORD = 591; +pub const ERROR_DATA_NOT_ACCEPTED: DWORD = 592; +pub const ERROR_VDM_HARD_ERROR: DWORD = 593; +pub const ERROR_DRIVER_CANCEL_TIMEOUT: DWORD = 594; +pub const ERROR_REPLY_MESSAGE_MISMATCH: DWORD = 595; +pub const ERROR_LOST_WRITEBEHIND_DATA: DWORD = 596; +pub const ERROR_CLIENT_SERVER_PARAMETERS_INVALID: DWORD = 597; +pub const ERROR_NOT_TINY_STREAM: DWORD = 598; +pub const ERROR_STACK_OVERFLOW_READ: DWORD = 599; +pub const ERROR_CONVERT_TO_LARGE: DWORD = 600; +pub const ERROR_FOUND_OUT_OF_SCOPE: DWORD = 601; +pub const ERROR_ALLOCATE_BUCKET: DWORD = 602; +pub const ERROR_MARSHALL_OVERFLOW: DWORD = 603; +pub const ERROR_INVALID_VARIANT: DWORD = 604; +pub const ERROR_BAD_COMPRESSION_BUFFER: DWORD = 605; +pub const ERROR_AUDIT_FAILED: DWORD = 606; +pub const ERROR_TIMER_RESOLUTION_NOT_SET: DWORD = 607; +pub const ERROR_INSUFFICIENT_LOGON_INFO: DWORD = 608; +pub const ERROR_BAD_DLL_ENTRYPOINT: DWORD = 609; +pub const ERROR_BAD_SERVICE_ENTRYPOINT: DWORD = 610; +pub const ERROR_IP_ADDRESS_CONFLICT1: DWORD = 611; +pub const ERROR_IP_ADDRESS_CONFLICT2: DWORD = 612; +pub const ERROR_REGISTRY_QUOTA_LIMIT: DWORD = 613; +pub const ERROR_NO_CALLBACK_ACTIVE: DWORD = 614; +pub const ERROR_PWD_TOO_SHORT: DWORD = 615; +pub const ERROR_PWD_TOO_RECENT: DWORD = 616; +pub const ERROR_PWD_HISTORY_CONFLICT: DWORD = 617; +pub const ERROR_UNSUPPORTED_COMPRESSION: DWORD = 618; +pub const ERROR_INVALID_HW_PROFILE: DWORD = 619; +pub const ERROR_INVALID_PLUGPLAY_DEVICE_PATH: DWORD = 620; +pub const ERROR_QUOTA_LIST_INCONSISTENT: DWORD = 621; +pub const ERROR_EVALUATION_EXPIRATION: DWORD = 622; +pub const ERROR_ILLEGAL_DLL_RELOCATION: DWORD = 623; +pub const ERROR_DLL_INIT_FAILED_LOGOFF: DWORD = 624; +pub const ERROR_VALIDATE_CONTINUE: DWORD = 625; +pub const ERROR_NO_MORE_MATCHES: DWORD = 626; +pub const ERROR_RANGE_LIST_CONFLICT: DWORD = 627; +pub const ERROR_SERVER_SID_MISMATCH: DWORD = 628; +pub const ERROR_CANT_ENABLE_DENY_ONLY: DWORD = 629; +pub const ERROR_FLOAT_MULTIPLE_FAULTS: DWORD = 630; +pub const ERROR_FLOAT_MULTIPLE_TRAPS: DWORD = 631; +pub const ERROR_NOINTERFACE: DWORD = 632; +pub const ERROR_DRIVER_FAILED_SLEEP: DWORD = 633; +pub const ERROR_CORRUPT_SYSTEM_FILE: DWORD = 634; +pub const ERROR_COMMITMENT_MINIMUM: DWORD = 635; +pub const ERROR_PNP_RESTART_ENUMERATION: DWORD = 636; +pub const ERROR_SYSTEM_IMAGE_BAD_SIGNATURE: DWORD = 637; +pub const ERROR_PNP_REBOOT_REQUIRED: DWORD = 638; +pub const ERROR_INSUFFICIENT_POWER: DWORD = 639; +pub const ERROR_MULTIPLE_FAULT_VIOLATION: DWORD = 640; +pub const ERROR_SYSTEM_SHUTDOWN: DWORD = 641; +pub const ERROR_PORT_NOT_SET: DWORD = 642; +pub const ERROR_DS_VERSION_CHECK_FAILURE: DWORD = 643; +pub const ERROR_RANGE_NOT_FOUND: DWORD = 644; +pub const ERROR_NOT_SAFE_MODE_DRIVER: DWORD = 646; +pub const ERROR_FAILED_DRIVER_ENTRY: DWORD = 647; +pub const ERROR_DEVICE_ENUMERATION_ERROR: DWORD = 648; +pub const ERROR_MOUNT_POINT_NOT_RESOLVED: DWORD = 649; +pub const ERROR_INVALID_DEVICE_OBJECT_PARAMETER: DWORD = 650; +pub const ERROR_MCA_OCCURED: DWORD = 651; +pub const ERROR_DRIVER_DATABASE_ERROR: DWORD = 652; +pub const ERROR_SYSTEM_HIVE_TOO_LARGE: DWORD = 653; +pub const ERROR_DRIVER_FAILED_PRIOR_UNLOAD: DWORD = 654; +pub const ERROR_VOLSNAP_PREPARE_HIBERNATE: DWORD = 655; +pub const ERROR_HIBERNATION_FAILURE: DWORD = 656; +pub const ERROR_PWD_TOO_LONG: DWORD = 657; +pub const ERROR_FILE_SYSTEM_LIMITATION: DWORD = 665; +pub const ERROR_ASSERTION_FAILURE: DWORD = 668; +pub const ERROR_ACPI_ERROR: DWORD = 669; +pub const ERROR_WOW_ASSERTION: DWORD = 670; +pub const ERROR_PNP_BAD_MPS_TABLE: DWORD = 671; +pub const ERROR_PNP_TRANSLATION_FAILED: DWORD = 672; +pub const ERROR_PNP_IRQ_TRANSLATION_FAILED: DWORD = 673; +pub const ERROR_PNP_INVALID_ID: DWORD = 674; +pub const ERROR_WAKE_SYSTEM_DEBUGGER: DWORD = 675; +pub const ERROR_HANDLES_CLOSED: DWORD = 676; +pub const ERROR_EXTRANEOUS_INFORMATION: DWORD = 677; +pub const ERROR_RXACT_COMMIT_NECESSARY: DWORD = 678; +pub const ERROR_MEDIA_CHECK: DWORD = 679; +pub const ERROR_GUID_SUBSTITUTION_MADE: DWORD = 680; +pub const ERROR_STOPPED_ON_SYMLINK: DWORD = 681; +pub const ERROR_LONGJUMP: DWORD = 682; +pub const ERROR_PLUGPLAY_QUERY_VETOED: DWORD = 683; +pub const ERROR_UNWIND_CONSOLIDATE: DWORD = 684; +pub const ERROR_REGISTRY_HIVE_RECOVERED: DWORD = 685; +pub const ERROR_DLL_MIGHT_BE_INSECURE: DWORD = 686; +pub const ERROR_DLL_MIGHT_BE_INCOMPATIBLE: DWORD = 687; +pub const ERROR_DBG_EXCEPTION_NOT_HANDLED: DWORD = 688; +pub const ERROR_DBG_REPLY_LATER: DWORD = 689; +pub const ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE: DWORD = 690; +pub const ERROR_DBG_TERMINATE_THREAD: DWORD = 691; +pub const ERROR_DBG_TERMINATE_PROCESS: DWORD = 692; +pub const ERROR_DBG_CONTROL_C: DWORD = 693; +pub const ERROR_DBG_PRINTEXCEPTION_C: DWORD = 694; +pub const ERROR_DBG_RIPEXCEPTION: DWORD = 695; +pub const ERROR_DBG_CONTROL_BREAK: DWORD = 696; +pub const ERROR_DBG_COMMAND_EXCEPTION: DWORD = 697; +pub const ERROR_OBJECT_NAME_EXISTS: DWORD = 698; +pub const ERROR_THREAD_WAS_SUSPENDED: DWORD = 699; +pub const ERROR_IMAGE_NOT_AT_BASE: DWORD = 700; +pub const ERROR_RXACT_STATE_CREATED: DWORD = 701; +pub const ERROR_SEGMENT_NOTIFICATION: DWORD = 702; +pub const ERROR_BAD_CURRENT_DIRECTORY: DWORD = 703; +pub const ERROR_FT_READ_RECOVERY_FROM_BACKUP: DWORD = 704; +pub const ERROR_FT_WRITE_RECOVERY: DWORD = 705; +pub const ERROR_IMAGE_MACHINE_TYPE_MISMATCH: DWORD = 706; +pub const ERROR_RECEIVE_PARTIAL: DWORD = 707; +pub const ERROR_RECEIVE_EXPEDITED: DWORD = 708; +pub const ERROR_RECEIVE_PARTIAL_EXPEDITED: DWORD = 709; +pub const ERROR_EVENT_DONE: DWORD = 710; +pub const ERROR_EVENT_PENDING: DWORD = 711; +pub const ERROR_CHECKING_FILE_SYSTEM: DWORD = 712; +pub const ERROR_FATAL_APP_EXIT: DWORD = 713; +pub const ERROR_PREDEFINED_HANDLE: DWORD = 714; +pub const ERROR_WAS_UNLOCKED: DWORD = 715; +pub const ERROR_SERVICE_NOTIFICATION: DWORD = 716; +pub const ERROR_WAS_LOCKED: DWORD = 717; +pub const ERROR_LOG_HARD_ERROR: DWORD = 718; +pub const ERROR_ALREADY_WIN32: DWORD = 719; +pub const ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE: DWORD = 720; +pub const ERROR_NO_YIELD_PERFORMED: DWORD = 721; +pub const ERROR_TIMER_RESUME_IGNORED: DWORD = 722; +pub const ERROR_ARBITRATION_UNHANDLED: DWORD = 723; +pub const ERROR_CARDBUS_NOT_SUPPORTED: DWORD = 724; +pub const ERROR_MP_PROCESSOR_MISMATCH: DWORD = 725; +pub const ERROR_HIBERNATED: DWORD = 726; +pub const ERROR_RESUME_HIBERNATION: DWORD = 727; +pub const ERROR_FIRMWARE_UPDATED: DWORD = 728; +pub const ERROR_DRIVERS_LEAKING_LOCKED_PAGES: DWORD = 729; +pub const ERROR_WAKE_SYSTEM: DWORD = 730; +pub const ERROR_WAIT_1: DWORD = 731; +pub const ERROR_WAIT_2: DWORD = 732; +pub const ERROR_WAIT_3: DWORD = 733; +pub const ERROR_WAIT_63: DWORD = 734; +pub const ERROR_ABANDONED_WAIT_0: DWORD = 735; +pub const ERROR_ABANDONED_WAIT_63: DWORD = 736; +pub const ERROR_USER_APC: DWORD = 737; +pub const ERROR_KERNEL_APC: DWORD = 738; +pub const ERROR_ALERTED: DWORD = 739; +pub const ERROR_ELEVATION_REQUIRED: DWORD = 740; +pub const ERROR_REPARSE: DWORD = 741; +pub const ERROR_OPLOCK_BREAK_IN_PROGRESS: DWORD = 742; +pub const ERROR_VOLUME_MOUNTED: DWORD = 743; +pub const ERROR_RXACT_COMMITTED: DWORD = 744; +pub const ERROR_NOTIFY_CLEANUP: DWORD = 745; +pub const ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED: DWORD = 746; +pub const ERROR_PAGE_FAULT_TRANSITION: DWORD = 747; +pub const ERROR_PAGE_FAULT_DEMAND_ZERO: DWORD = 748; +pub const ERROR_PAGE_FAULT_COPY_ON_WRITE: DWORD = 749; +pub const ERROR_PAGE_FAULT_GUARD_PAGE: DWORD = 750; +pub const ERROR_PAGE_FAULT_PAGING_FILE: DWORD = 751; +pub const ERROR_CACHE_PAGE_LOCKED: DWORD = 752; +pub const ERROR_CRASH_DUMP: DWORD = 753; +pub const ERROR_BUFFER_ALL_ZEROS: DWORD = 754; +pub const ERROR_REPARSE_OBJECT: DWORD = 755; +pub const ERROR_RESOURCE_REQUIREMENTS_CHANGED: DWORD = 756; +pub const ERROR_TRANSLATION_COMPLETE: DWORD = 757; +pub const ERROR_NOTHING_TO_TERMINATE: DWORD = 758; +pub const ERROR_PROCESS_NOT_IN_JOB: DWORD = 759; +pub const ERROR_PROCESS_IN_JOB: DWORD = 760; +pub const ERROR_VOLSNAP_HIBERNATE_READY: DWORD = 761; +pub const ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY: DWORD = 762; +pub const ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED: DWORD = 763; +pub const ERROR_INTERRUPT_STILL_CONNECTED: DWORD = 764; +pub const ERROR_WAIT_FOR_OPLOCK: DWORD = 765; +pub const ERROR_DBG_EXCEPTION_HANDLED: DWORD = 766; +pub const ERROR_DBG_CONTINUE: DWORD = 767; +pub const ERROR_CALLBACK_POP_STACK: DWORD = 768; +pub const ERROR_COMPRESSION_DISABLED: DWORD = 769; +pub const ERROR_CANTFETCHBACKWARDS: DWORD = 770; +pub const ERROR_CANTSCROLLBACKWARDS: DWORD = 771; +pub const ERROR_ROWSNOTRELEASED: DWORD = 772; +pub const ERROR_BAD_ACCESSOR_FLAGS: DWORD = 773; +pub const ERROR_ERRORS_ENCOUNTERED: DWORD = 774; +pub const ERROR_NOT_CAPABLE: DWORD = 775; +pub const ERROR_REQUEST_OUT_OF_SEQUENCE: DWORD = 776; +pub const ERROR_VERSION_PARSE_ERROR: DWORD = 777; +pub const ERROR_BADSTARTPOSITION: DWORD = 778; +pub const ERROR_MEMORY_HARDWARE: DWORD = 779; +pub const ERROR_DISK_REPAIR_DISABLED: DWORD = 780; +pub const ERROR_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE: DWORD = 781; +pub const ERROR_SYSTEM_POWERSTATE_TRANSITION: DWORD = 782; +pub const ERROR_SYSTEM_POWERSTATE_COMPLEX_TRANSITION: DWORD = 783; +pub const ERROR_MCA_EXCEPTION: DWORD = 784; +pub const ERROR_ACCESS_AUDIT_BY_POLICY: DWORD = 785; +pub const ERROR_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY: DWORD = 786; +pub const ERROR_ABANDON_HIBERFILE: DWORD = 787; +pub const ERROR_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED: DWORD = 788; +pub const ERROR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR: DWORD = 789; +pub const ERROR_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR: DWORD = 790; +pub const ERROR_BAD_MCFG_TABLE: DWORD = 791; +pub const ERROR_DISK_REPAIR_REDIRECTED: DWORD = 792; +pub const ERROR_DISK_REPAIR_UNSUCCESSFUL: DWORD = 793; +pub const ERROR_CORRUPT_LOG_OVERFULL: DWORD = 794; +pub const ERROR_CORRUPT_LOG_CORRUPTED: DWORD = 795; +pub const ERROR_CORRUPT_LOG_UNAVAILABLE: DWORD = 796; +pub const ERROR_CORRUPT_LOG_DELETED_FULL: DWORD = 797; +pub const ERROR_CORRUPT_LOG_CLEARED: DWORD = 798; +pub const ERROR_ORPHAN_NAME_EXHAUSTED: DWORD = 799; +pub const ERROR_OPLOCK_SWITCHED_TO_NEW_HANDLE: DWORD = 800; +pub const ERROR_CANNOT_GRANT_REQUESTED_OPLOCK: DWORD = 801; +pub const ERROR_CANNOT_BREAK_OPLOCK: DWORD = 802; +pub const ERROR_OPLOCK_HANDLE_CLOSED: DWORD = 803; +pub const ERROR_NO_ACE_CONDITION: DWORD = 804; +pub const ERROR_INVALID_ACE_CONDITION: DWORD = 805; +pub const ERROR_FILE_HANDLE_REVOKED: DWORD = 806; +pub const ERROR_IMAGE_AT_DIFFERENT_BASE: DWORD = 807; +pub const ERROR_ENCRYPTED_IO_NOT_POSSIBLE: DWORD = 808; +pub const ERROR_EA_ACCESS_DENIED: DWORD = 994; +pub const ERROR_OPERATION_ABORTED: DWORD = 995; +pub const ERROR_IO_INCOMPLETE: DWORD = 996; +pub const ERROR_IO_PENDING: DWORD = 997; +pub const ERROR_NOACCESS: DWORD = 998; +pub const ERROR_SWAPERROR: DWORD = 999; +pub const ERROR_STACK_OVERFLOW: DWORD = 1001; +pub const ERROR_INVALID_MESSAGE: DWORD = 1002; +pub const ERROR_CAN_NOT_COMPLETE: DWORD = 1003; +pub const ERROR_INVALID_FLAGS: DWORD = 1004; +pub const ERROR_UNRECOGNIZED_VOLUME: DWORD = 1005; +pub const ERROR_FILE_INVALID: DWORD = 1006; +pub const ERROR_FULLSCREEN_MODE: DWORD = 1007; +pub const ERROR_NO_TOKEN: DWORD = 1008; +pub const ERROR_BADDB: DWORD = 1009; +pub const ERROR_BADKEY: DWORD = 1010; +pub const ERROR_CANTOPEN: DWORD = 1011; +pub const ERROR_CANTREAD: DWORD = 1012; +pub const ERROR_CANTWRITE: DWORD = 1013; +pub const ERROR_REGISTRY_RECOVERED: DWORD = 1014; +pub const ERROR_REGISTRY_CORRUPT: DWORD = 1015; +pub const ERROR_REGISTRY_IO_FAILED: DWORD = 1016; +pub const ERROR_NOT_REGISTRY_FILE: DWORD = 1017; +pub const ERROR_KEY_DELETED: DWORD = 1018; +pub const ERROR_NO_LOG_SPACE: DWORD = 1019; +pub const ERROR_KEY_HAS_CHILDREN: DWORD = 1020; +pub const ERROR_CHILD_MUST_BE_VOLATILE: DWORD = 1021; +pub const ERROR_NOTIFY_ENUM_DIR: DWORD = 1022; +pub const ERROR_DEPENDENT_SERVICES_RUNNING: DWORD = 1051; +pub const ERROR_INVALID_SERVICE_CONTROL: DWORD = 1052; +pub const ERROR_SERVICE_REQUEST_TIMEOUT: DWORD = 1053; +pub const ERROR_SERVICE_NO_THREAD: DWORD = 1054; +pub const ERROR_SERVICE_DATABASE_LOCKED: DWORD = 1055; +pub const ERROR_SERVICE_ALREADY_RUNNING: DWORD = 1056; +pub const ERROR_INVALID_SERVICE_ACCOUNT: DWORD = 1057; +pub const ERROR_SERVICE_DISABLED: DWORD = 1058; +pub const ERROR_CIRCULAR_DEPENDENCY: DWORD = 1059; +pub const ERROR_SERVICE_DOES_NOT_EXIST: DWORD = 1060; +pub const ERROR_SERVICE_CANNOT_ACCEPT_CTRL: DWORD = 1061; +pub const ERROR_SERVICE_NOT_ACTIVE: DWORD = 1062; +pub const ERROR_FAILED_SERVICE_CONTROLLER_CONNECT: DWORD = 1063; +pub const ERROR_EXCEPTION_IN_SERVICE: DWORD = 1064; +pub const ERROR_DATABASE_DOES_NOT_EXIST: DWORD = 1065; +pub const ERROR_SERVICE_SPECIFIC_ERROR: DWORD = 1066; +pub const ERROR_PROCESS_ABORTED: DWORD = 1067; +pub const ERROR_SERVICE_DEPENDENCY_FAIL: DWORD = 1068; +pub const ERROR_SERVICE_LOGON_FAILED: DWORD = 1069; +pub const ERROR_SERVICE_START_HANG: DWORD = 1070; +pub const ERROR_INVALID_SERVICE_LOCK: DWORD = 1071; +pub const ERROR_SERVICE_MARKED_FOR_DELETE: DWORD = 1072; +pub const ERROR_SERVICE_EXISTS: DWORD = 1073; +pub const ERROR_ALREADY_RUNNING_LKG: DWORD = 1074; +pub const ERROR_SERVICE_DEPENDENCY_DELETED: DWORD = 1075; +pub const ERROR_BOOT_ALREADY_ACCEPTED: DWORD = 1076; +pub const ERROR_SERVICE_NEVER_STARTED: DWORD = 1077; +pub const ERROR_DUPLICATE_SERVICE_NAME: DWORD = 1078; +pub const ERROR_DIFFERENT_SERVICE_ACCOUNT: DWORD = 1079; +pub const ERROR_CANNOT_DETECT_DRIVER_FAILURE: DWORD = 1080; +pub const ERROR_CANNOT_DETECT_PROCESS_ABORT: DWORD = 1081; +pub const ERROR_NO_RECOVERY_PROGRAM: DWORD = 1082; +pub const ERROR_SERVICE_NOT_IN_EXE: DWORD = 1083; +pub const ERROR_NOT_SAFEBOOT_SERVICE: DWORD = 1084; +pub const ERROR_END_OF_MEDIA: DWORD = 1100; +pub const ERROR_FILEMARK_DETECTED: DWORD = 1101; +pub const ERROR_BEGINNING_OF_MEDIA: DWORD = 1102; +pub const ERROR_SETMARK_DETECTED: DWORD = 1103; +pub const ERROR_NO_DATA_DETECTED: DWORD = 1104; +pub const ERROR_PARTITION_FAILURE: DWORD = 1105; +pub const ERROR_INVALID_BLOCK_LENGTH: DWORD = 1106; +pub const ERROR_DEVICE_NOT_PARTITIONED: DWORD = 1107; +pub const ERROR_UNABLE_TO_LOCK_MEDIA: DWORD = 1108; +pub const ERROR_UNABLE_TO_UNLOAD_MEDIA: DWORD = 1109; +pub const ERROR_MEDIA_CHANGED: DWORD = 1110; +pub const ERROR_BUS_RESET: DWORD = 1111; +pub const ERROR_NO_MEDIA_IN_DRIVE: DWORD = 1112; +pub const ERROR_NO_UNICODE_TRANSLATION: DWORD = 1113; +pub const ERROR_DLL_INIT_FAILED: DWORD = 1114; +pub const ERROR_SHUTDOWN_IN_PROGRESS: DWORD = 1115; +pub const ERROR_NO_SHUTDOWN_IN_PROGRESS: DWORD = 1116; +pub const ERROR_IO_DEVICE: DWORD = 1117; +pub const ERROR_SERIAL_NO_DEVICE: DWORD = 1118; +pub const ERROR_IRQ_BUSY: DWORD = 1119; +pub const ERROR_MORE_WRITES: DWORD = 1120; +pub const ERROR_COUNTER_TIMEOUT: DWORD = 1121; +pub const ERROR_FLOPPY_ID_MARK_NOT_FOUND: DWORD = 1122; +pub const ERROR_FLOPPY_WRONG_CYLINDER: DWORD = 1123; +pub const ERROR_FLOPPY_UNKNOWN_ERROR: DWORD = 1124; +pub const ERROR_FLOPPY_BAD_REGISTERS: DWORD = 1125; +pub const ERROR_DISK_RECALIBRATE_FAILED: DWORD = 1126; +pub const ERROR_DISK_OPERATION_FAILED: DWORD = 1127; +pub const ERROR_DISK_RESET_FAILED: DWORD = 1128; +pub const ERROR_EOM_OVERFLOW: DWORD = 1129; +pub const ERROR_NOT_ENOUGH_SERVER_MEMORY: DWORD = 1130; +pub const ERROR_POSSIBLE_DEADLOCK: DWORD = 1131; +pub const ERROR_MAPPED_ALIGNMENT: DWORD = 1132; +pub const ERROR_SET_POWER_STATE_VETOED: DWORD = 1140; +pub const ERROR_SET_POWER_STATE_FAILED: DWORD = 1141; +pub const ERROR_TOO_MANY_LINKS: DWORD = 1142; +pub const ERROR_OLD_WIN_VERSION: DWORD = 1150; +pub const ERROR_APP_WRONG_OS: DWORD = 1151; +pub const ERROR_SINGLE_INSTANCE_APP: DWORD = 1152; +pub const ERROR_RMODE_APP: DWORD = 1153; +pub const ERROR_INVALID_DLL: DWORD = 1154; +pub const ERROR_NO_ASSOCIATION: DWORD = 1155; +pub const ERROR_DDE_FAIL: DWORD = 1156; +pub const ERROR_DLL_NOT_FOUND: DWORD = 1157; +pub const ERROR_NO_MORE_USER_HANDLES: DWORD = 1158; +pub const ERROR_MESSAGE_SYNC_ONLY: DWORD = 1159; +pub const ERROR_SOURCE_ELEMENT_EMPTY: DWORD = 1160; +pub const ERROR_DESTINATION_ELEMENT_FULL: DWORD = 1161; +pub const ERROR_ILLEGAL_ELEMENT_ADDRESS: DWORD = 1162; +pub const ERROR_MAGAZINE_NOT_PRESENT: DWORD = 1163; +pub const ERROR_DEVICE_REINITIALIZATION_NEEDED: DWORD = 1164; +pub const ERROR_DEVICE_REQUIRES_CLEANING: DWORD = 1165; +pub const ERROR_DEVICE_DOOR_OPEN: DWORD = 1166; +pub const ERROR_DEVICE_NOT_CONNECTED: DWORD = 1167; +pub const ERROR_NOT_FOUND: DWORD = 1168; +pub const ERROR_NO_MATCH: DWORD = 1169; +pub const ERROR_SET_NOT_FOUND: DWORD = 1170; +pub const ERROR_POINT_NOT_FOUND: DWORD = 1171; +pub const ERROR_NO_TRACKING_SERVICE: DWORD = 1172; +pub const ERROR_NO_VOLUME_ID: DWORD = 1173; +pub const ERROR_UNABLE_TO_REMOVE_REPLACED: DWORD = 1175; +pub const ERROR_UNABLE_TO_MOVE_REPLACEMENT: DWORD = 1176; +pub const ERROR_UNABLE_TO_MOVE_REPLACEMENT_2: DWORD = 1177; +pub const ERROR_JOURNAL_DELETE_IN_PROGRESS: DWORD = 1178; +pub const ERROR_JOURNAL_NOT_ACTIVE: DWORD = 1179; +pub const ERROR_POTENTIAL_FILE_FOUND: DWORD = 1180; +pub const ERROR_JOURNAL_ENTRY_DELETED: DWORD = 1181; +pub const ERROR_SHUTDOWN_IS_SCHEDULED: DWORD = 1190; +pub const ERROR_SHUTDOWN_USERS_LOGGED_ON: DWORD = 1191; +pub const ERROR_BAD_DEVICE: DWORD = 1200; +pub const ERROR_CONNECTION_UNAVAIL: DWORD = 1201; +pub const ERROR_DEVICE_ALREADY_REMEMBERED: DWORD = 1202; +pub const ERROR_NO_NET_OR_BAD_PATH: DWORD = 1203; +pub const ERROR_BAD_PROVIDER: DWORD = 1204; +pub const ERROR_CANNOT_OPEN_PROFILE: DWORD = 1205; +pub const ERROR_BAD_PROFILE: DWORD = 1206; +pub const ERROR_NOT_CONTAINER: DWORD = 1207; +pub const ERROR_EXTENDED_ERROR: DWORD = 1208; +pub const ERROR_INVALID_GROUPNAME: DWORD = 1209; +pub const ERROR_INVALID_COMPUTERNAME: DWORD = 1210; +pub const ERROR_INVALID_EVENTNAME: DWORD = 1211; +pub const ERROR_INVALID_DOMAINNAME: DWORD = 1212; +pub const ERROR_INVALID_SERVICENAME: DWORD = 1213; +pub const ERROR_INVALID_NETNAME: DWORD = 1214; +pub const ERROR_INVALID_SHARENAME: DWORD = 1215; +pub const ERROR_INVALID_PASSWORDNAME: DWORD = 1216; +pub const ERROR_INVALID_MESSAGENAME: DWORD = 1217; +pub const ERROR_INVALID_MESSAGEDEST: DWORD = 1218; +pub const ERROR_SESSION_CREDENTIAL_CONFLICT: DWORD = 1219; +pub const ERROR_REMOTE_SESSION_LIMIT_EXCEEDED: DWORD = 1220; +pub const ERROR_DUP_DOMAINNAME: DWORD = 1221; +pub const ERROR_NO_NETWORK: DWORD = 1222; +pub const ERROR_CANCELLED: DWORD = 1223; +pub const ERROR_USER_MAPPED_FILE: DWORD = 1224; +pub const ERROR_CONNECTION_REFUSED: DWORD = 1225; +pub const ERROR_GRACEFUL_DISCONNECT: DWORD = 1226; +pub const ERROR_ADDRESS_ALREADY_ASSOCIATED: DWORD = 1227; +pub const ERROR_ADDRESS_NOT_ASSOCIATED: DWORD = 1228; +pub const ERROR_CONNECTION_INVALID: DWORD = 1229; +pub const ERROR_CONNECTION_ACTIVE: DWORD = 1230; +pub const ERROR_NETWORK_UNREACHABLE: DWORD = 1231; +pub const ERROR_HOST_UNREACHABLE: DWORD = 1232; +pub const ERROR_PROTOCOL_UNREACHABLE: DWORD = 1233; +pub const ERROR_PORT_UNREACHABLE: DWORD = 1234; +pub const ERROR_REQUEST_ABORTED: DWORD = 1235; +pub const ERROR_CONNECTION_ABORTED: DWORD = 1236; +pub const ERROR_RETRY: DWORD = 1237; +pub const ERROR_CONNECTION_COUNT_LIMIT: DWORD = 1238; +pub const ERROR_LOGIN_TIME_RESTRICTION: DWORD = 1239; +pub const ERROR_LOGIN_WKSTA_RESTRICTION: DWORD = 1240; +pub const ERROR_INCORRECT_ADDRESS: DWORD = 1241; +pub const ERROR_ALREADY_REGISTERED: DWORD = 1242; +pub const ERROR_SERVICE_NOT_FOUND: DWORD = 1243; +pub const ERROR_NOT_AUTHENTICATED: DWORD = 1244; +pub const ERROR_NOT_LOGGED_ON: DWORD = 1245; +pub const ERROR_CONTINUE: DWORD = 1246; +pub const ERROR_ALREADY_INITIALIZED: DWORD = 1247; +pub const ERROR_NO_MORE_DEVICES: DWORD = 1248; +pub const ERROR_NO_SUCH_SITE: DWORD = 1249; +pub const ERROR_DOMAIN_CONTROLLER_EXISTS: DWORD = 1250; +pub const ERROR_ONLY_IF_CONNECTED: DWORD = 1251; +pub const ERROR_OVERRIDE_NOCHANGES: DWORD = 1252; +pub const ERROR_BAD_USER_PROFILE: DWORD = 1253; +pub const ERROR_NOT_SUPPORTED_ON_SBS: DWORD = 1254; +pub const ERROR_SERVER_SHUTDOWN_IN_PROGRESS: DWORD = 1255; +pub const ERROR_HOST_DOWN: DWORD = 1256; +pub const ERROR_NON_ACCOUNT_SID: DWORD = 1257; +pub const ERROR_NON_DOMAIN_SID: DWORD = 1258; +pub const ERROR_APPHELP_BLOCK: DWORD = 1259; +pub const ERROR_ACCESS_DISABLED_BY_POLICY: DWORD = 1260; +pub const ERROR_REG_NAT_CONSUMPTION: DWORD = 1261; +pub const ERROR_CSCSHARE_OFFLINE: DWORD = 1262; +pub const ERROR_PKINIT_FAILURE: DWORD = 1263; +pub const ERROR_SMARTCARD_SUBSYSTEM_FAILURE: DWORD = 1264; +pub const ERROR_DOWNGRADE_DETECTED: DWORD = 1265; +pub const ERROR_MACHINE_LOCKED: DWORD = 1271; +pub const ERROR_CALLBACK_SUPPLIED_INVALID_DATA: DWORD = 1273; +pub const ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED: DWORD = 1274; +pub const ERROR_DRIVER_BLOCKED: DWORD = 1275; +pub const ERROR_INVALID_IMPORT_OF_NON_DLL: DWORD = 1276; +pub const ERROR_ACCESS_DISABLED_WEBBLADE: DWORD = 1277; +pub const ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER: DWORD = 1278; +pub const ERROR_RECOVERY_FAILURE: DWORD = 1279; +pub const ERROR_ALREADY_FIBER: DWORD = 1280; +pub const ERROR_ALREADY_THREAD: DWORD = 1281; +pub const ERROR_STACK_BUFFER_OVERRUN: DWORD = 1282; +pub const ERROR_PARAMETER_QUOTA_EXCEEDED: DWORD = 1283; +pub const ERROR_DEBUGGER_INACTIVE: DWORD = 1284; +pub const ERROR_DELAY_LOAD_FAILED: DWORD = 1285; +pub const ERROR_VDM_DISALLOWED: DWORD = 1286; +pub const ERROR_UNIDENTIFIED_ERROR: DWORD = 1287; +pub const ERROR_INVALID_CRUNTIME_PARAMETER: DWORD = 1288; +pub const ERROR_BEYOND_VDL: DWORD = 1289; +pub const ERROR_INCOMPATIBLE_SERVICE_SID_TYPE: DWORD = 1290; +pub const ERROR_DRIVER_PROCESS_TERMINATED: DWORD = 1291; +pub const ERROR_IMPLEMENTATION_LIMIT: DWORD = 1292; +pub const ERROR_PROCESS_IS_PROTECTED: DWORD = 1293; +pub const ERROR_SERVICE_NOTIFY_CLIENT_LAGGING: DWORD = 1294; +pub const ERROR_DISK_QUOTA_EXCEEDED: DWORD = 1295; +pub const ERROR_CONTENT_BLOCKED: DWORD = 1296; +pub const ERROR_INCOMPATIBLE_SERVICE_PRIVILEGE: DWORD = 1297; +pub const ERROR_APP_HANG: DWORD = 1298; +pub const ERROR_INVALID_LABEL: DWORD = 1299; +pub const ERROR_NOT_ALL_ASSIGNED: DWORD = 1300; +pub const ERROR_SOME_NOT_MAPPED: DWORD = 1301; +pub const ERROR_NO_QUOTAS_FOR_ACCOUNT: DWORD = 1302; +pub const ERROR_LOCAL_USER_SESSION_KEY: DWORD = 1303; +pub const ERROR_NULL_LM_PASSWORD: DWORD = 1304; +pub const ERROR_UNKNOWN_REVISION: DWORD = 1305; +pub const ERROR_REVISION_MISMATCH: DWORD = 1306; +pub const ERROR_INVALID_OWNER: DWORD = 1307; +pub const ERROR_INVALID_PRIMARY_GROUP: DWORD = 1308; +pub const ERROR_NO_IMPERSONATION_TOKEN: DWORD = 1309; +pub const ERROR_CANT_DISABLE_MANDATORY: DWORD = 1310; +pub const ERROR_NO_LOGON_SERVERS: DWORD = 1311; +pub const ERROR_NO_SUCH_LOGON_SESSION: DWORD = 1312; +pub const ERROR_NO_SUCH_PRIVILEGE: DWORD = 1313; +pub const ERROR_PRIVILEGE_NOT_HELD: DWORD = 1314; +pub const ERROR_INVALID_ACCOUNT_NAME: DWORD = 1315; +pub const ERROR_USER_EXISTS: DWORD = 1316; +pub const ERROR_NO_SUCH_USER: DWORD = 1317; +pub const ERROR_GROUP_EXISTS: DWORD = 1318; +pub const ERROR_NO_SUCH_GROUP: DWORD = 1319; +pub const ERROR_MEMBER_IN_GROUP: DWORD = 1320; +pub const ERROR_MEMBER_NOT_IN_GROUP: DWORD = 1321; +pub const ERROR_LAST_ADMIN: DWORD = 1322; +pub const ERROR_WRONG_PASSWORD: DWORD = 1323; +pub const ERROR_ILL_FORMED_PASSWORD: DWORD = 1324; +pub const ERROR_PASSWORD_RESTRICTION: DWORD = 1325; +pub const ERROR_LOGON_FAILURE: DWORD = 1326; +pub const ERROR_ACCOUNT_RESTRICTION: DWORD = 1327; +pub const ERROR_INVALID_LOGON_HOURS: DWORD = 1328; +pub const ERROR_INVALID_WORKSTATION: DWORD = 1329; +pub const ERROR_PASSWORD_EXPIRED: DWORD = 1330; +pub const ERROR_ACCOUNT_DISABLED: DWORD = 1331; +pub const ERROR_NONE_MAPPED: DWORD = 1332; +pub const ERROR_TOO_MANY_LUIDS_REQUESTED: DWORD = 1333; +pub const ERROR_LUIDS_EXHAUSTED: DWORD = 1334; +pub const ERROR_INVALID_SUB_AUTHORITY: DWORD = 1335; +pub const ERROR_INVALID_ACL: DWORD = 1336; +pub const ERROR_INVALID_SID: DWORD = 1337; +pub const ERROR_INVALID_SECURITY_DESCR: DWORD = 1338; +pub const ERROR_BAD_INHERITANCE_ACL: DWORD = 1340; +pub const ERROR_SERVER_DISABLED: DWORD = 1341; +pub const ERROR_SERVER_NOT_DISABLED: DWORD = 1342; +pub const ERROR_INVALID_ID_AUTHORITY: DWORD = 1343; +pub const ERROR_ALLOTTED_SPACE_EXCEEDED: DWORD = 1344; +pub const ERROR_INVALID_GROUP_ATTRIBUTES: DWORD = 1345; +pub const ERROR_BAD_IMPERSONATION_LEVEL: DWORD = 1346; +pub const ERROR_CANT_OPEN_ANONYMOUS: DWORD = 1347; +pub const ERROR_BAD_VALIDATION_CLASS: DWORD = 1348; +pub const ERROR_BAD_TOKEN_TYPE: DWORD = 1349; +pub const ERROR_NO_SECURITY_ON_OBJECT: DWORD = 1350; +pub const ERROR_CANT_ACCESS_DOMAIN_INFO: DWORD = 1351; +pub const ERROR_INVALID_SERVER_STATE: DWORD = 1352; +pub const ERROR_INVALID_DOMAIN_STATE: DWORD = 1353; +pub const ERROR_INVALID_DOMAIN_ROLE: DWORD = 1354; +pub const ERROR_NO_SUCH_DOMAIN: DWORD = 1355; +pub const ERROR_DOMAIN_EXISTS: DWORD = 1356; +pub const ERROR_DOMAIN_LIMIT_EXCEEDED: DWORD = 1357; +pub const ERROR_INTERNAL_DB_CORRUPTION: DWORD = 1358; +pub const ERROR_INTERNAL_ERROR: DWORD = 1359; +pub const ERROR_GENERIC_NOT_MAPPED: DWORD = 1360; +pub const ERROR_BAD_DESCRIPTOR_FORMAT: DWORD = 1361; +pub const ERROR_NOT_LOGON_PROCESS: DWORD = 1362; +pub const ERROR_LOGON_SESSION_EXISTS: DWORD = 1363; +pub const ERROR_NO_SUCH_PACKAGE: DWORD = 1364; +pub const ERROR_BAD_LOGON_SESSION_STATE: DWORD = 1365; +pub const ERROR_LOGON_SESSION_COLLISION: DWORD = 1366; +pub const ERROR_INVALID_LOGON_TYPE: DWORD = 1367; +pub const ERROR_CANNOT_IMPERSONATE: DWORD = 1368; +pub const ERROR_RXACT_INVALID_STATE: DWORD = 1369; +pub const ERROR_RXACT_COMMIT_FAILURE: DWORD = 1370; +pub const ERROR_SPECIAL_ACCOUNT: DWORD = 1371; +pub const ERROR_SPECIAL_GROUP: DWORD = 1372; +pub const ERROR_SPECIAL_USER: DWORD = 1373; +pub const ERROR_MEMBERS_PRIMARY_GROUP: DWORD = 1374; +pub const ERROR_TOKEN_ALREADY_IN_USE: DWORD = 1375; +pub const ERROR_NO_SUCH_ALIAS: DWORD = 1376; +pub const ERROR_MEMBER_NOT_IN_ALIAS: DWORD = 1377; +pub const ERROR_MEMBER_IN_ALIAS: DWORD = 1378; +pub const ERROR_ALIAS_EXISTS: DWORD = 1379; +pub const ERROR_LOGON_NOT_GRANTED: DWORD = 1380; +pub const ERROR_TOO_MANY_SECRETS: DWORD = 1381; +pub const ERROR_SECRET_TOO_LONG: DWORD = 1382; +pub const ERROR_INTERNAL_DB_ERROR: DWORD = 1383; +pub const ERROR_TOO_MANY_CONTEXT_IDS: DWORD = 1384; +pub const ERROR_LOGON_TYPE_NOT_GRANTED: DWORD = 1385; +pub const ERROR_NT_CROSS_ENCRYPTION_REQUIRED: DWORD = 1386; +pub const ERROR_NO_SUCH_MEMBER: DWORD = 1387; +pub const ERROR_INVALID_MEMBER: DWORD = 1388; +pub const ERROR_TOO_MANY_SIDS: DWORD = 1389; +pub const ERROR_LM_CROSS_ENCRYPTION_REQUIRED: DWORD = 1390; +pub const ERROR_NO_INHERITANCE: DWORD = 1391; +pub const ERROR_FILE_CORRUPT: DWORD = 1392; +pub const ERROR_DISK_CORRUPT: DWORD = 1393; +pub const ERROR_NO_USER_SESSION_KEY: DWORD = 1394; +pub const ERROR_LICENSE_QUOTA_EXCEEDED: DWORD = 1395; +pub const ERROR_WRONG_TARGET_NAME: DWORD = 1396; +pub const ERROR_MUTUAL_AUTH_FAILED: DWORD = 1397; +pub const ERROR_TIME_SKEW: DWORD = 1398; +pub const ERROR_CURRENT_DOMAIN_NOT_ALLOWED: DWORD = 1399; +pub const ERROR_INVALID_WINDOW_HANDLE: DWORD = 1400; +pub const ERROR_INVALID_MENU_HANDLE: DWORD = 1401; +pub const ERROR_INVALID_CURSOR_HANDLE: DWORD = 1402; +pub const ERROR_INVALID_ACCEL_HANDLE: DWORD = 1403; +pub const ERROR_INVALID_HOOK_HANDLE: DWORD = 1404; +pub const ERROR_INVALID_DWP_HANDLE: DWORD = 1405; +pub const ERROR_TLW_WITH_WSCHILD: DWORD = 1406; +pub const ERROR_CANNOT_FIND_WND_CLASS: DWORD = 1407; +pub const ERROR_WINDOW_OF_OTHER_THREAD: DWORD = 1408; +pub const ERROR_HOTKEY_ALREADY_REGISTERED: DWORD = 1409; +pub const ERROR_CLASS_ALREADY_EXISTS: DWORD = 1410; +pub const ERROR_CLASS_DOES_NOT_EXIST: DWORD = 1411; +pub const ERROR_CLASS_HAS_WINDOWS: DWORD = 1412; +pub const ERROR_INVALID_INDEX: DWORD = 1413; +pub const ERROR_INVALID_ICON_HANDLE: DWORD = 1414; +pub const ERROR_PRIVATE_DIALOG_INDEX: DWORD = 1415; +pub const ERROR_LISTBOX_ID_NOT_FOUND: DWORD = 1416; +pub const ERROR_NO_WILDCARD_CHARACTERS: DWORD = 1417; +pub const ERROR_CLIPBOARD_NOT_OPEN: DWORD = 1418; +pub const ERROR_HOTKEY_NOT_REGISTERED: DWORD = 1419; +pub const ERROR_WINDOW_NOT_DIALOG: DWORD = 1420; +pub const ERROR_CONTROL_ID_NOT_FOUND: DWORD = 1421; +pub const ERROR_INVALID_COMBOBOX_MESSAGE: DWORD = 1422; +pub const ERROR_WINDOW_NOT_COMBOBOX: DWORD = 1423; +pub const ERROR_INVALID_EDIT_HEIGHT: DWORD = 1424; +pub const ERROR_DC_NOT_FOUND: DWORD = 1425; +pub const ERROR_INVALID_HOOK_FILTER: DWORD = 1426; +pub const ERROR_INVALID_FILTER_PROC: DWORD = 1427; +pub const ERROR_HOOK_NEEDS_HMOD: DWORD = 1428; +pub const ERROR_GLOBAL_ONLY_HOOK: DWORD = 1429; +pub const ERROR_JOURNAL_HOOK_SET: DWORD = 1430; +pub const ERROR_HOOK_NOT_INSTALLED: DWORD = 1431; +pub const ERROR_INVALID_LB_MESSAGE: DWORD = 1432; +pub const ERROR_SETCOUNT_ON_BAD_LB: DWORD = 1433; +pub const ERROR_LB_WITHOUT_TABSTOPS: DWORD = 1434; +pub const ERROR_DESTROY_OBJECT_OF_OTHER_THREAD: DWORD = 1435; +pub const ERROR_CHILD_WINDOW_MENU: DWORD = 1436; +pub const ERROR_NO_SYSTEM_MENU: DWORD = 1437; +pub const ERROR_INVALID_MSGBOX_STYLE: DWORD = 1438; +pub const ERROR_INVALID_SPI_VALUE: DWORD = 1439; +pub const ERROR_SCREEN_ALREADY_LOCKED: DWORD = 1440; +pub const ERROR_HWNDS_HAVE_DIFF_PARENT: DWORD = 1441; +pub const ERROR_NOT_CHILD_WINDOW: DWORD = 1442; +pub const ERROR_INVALID_GW_COMMAND: DWORD = 1443; +pub const ERROR_INVALID_THREAD_ID: DWORD = 1444; +pub const ERROR_NON_MDICHILD_WINDOW: DWORD = 1445; +pub const ERROR_POPUP_ALREADY_ACTIVE: DWORD = 1446; +pub const ERROR_NO_SCROLLBARS: DWORD = 1447; +pub const ERROR_INVALID_SCROLLBAR_RANGE: DWORD = 1448; +pub const ERROR_INVALID_SHOWWIN_COMMAND: DWORD = 1449; +pub const ERROR_NO_SYSTEM_RESOURCES: DWORD = 1450; +pub const ERROR_NONPAGED_SYSTEM_RESOURCES: DWORD = 1451; +pub const ERROR_PAGED_SYSTEM_RESOURCES: DWORD = 1452; +pub const ERROR_WORKING_SET_QUOTA: DWORD = 1453; +pub const ERROR_PAGEFILE_QUOTA: DWORD = 1454; +pub const ERROR_COMMITMENT_LIMIT: DWORD = 1455; +pub const ERROR_MENU_ITEM_NOT_FOUND: DWORD = 1456; +pub const ERROR_INVALID_KEYBOARD_HANDLE: DWORD = 1457; +pub const ERROR_HOOK_TYPE_NOT_ALLOWED: DWORD = 1458; +pub const ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION: DWORD = 1459; +pub const ERROR_TIMEOUT: DWORD = 1460; +pub const ERROR_INVALID_MONITOR_HANDLE: DWORD = 1461; +pub const ERROR_INCORRECT_SIZE: DWORD = 1462; +pub const ERROR_SYMLINK_CLASS_DISABLED: DWORD = 1463; +pub const ERROR_SYMLINK_NOT_SUPPORTED: DWORD = 1464; +pub const ERROR_XML_PARSE_ERROR: DWORD = 1465; +pub const ERROR_XMLDSIG_ERROR: DWORD = 1466; +pub const ERROR_RESTART_APPLICATION: DWORD = 1467; +pub const ERROR_WRONG_COMPARTMENT: DWORD = 1468; +pub const ERROR_AUTHIP_FAILURE: DWORD = 1469; +pub const ERROR_NO_NVRAM_RESOURCES: DWORD = 1470; +pub const ERROR_NOT_GUI_PROCESS: DWORD = 1471; +pub const ERROR_EVENTLOG_FILE_CORRUPT: DWORD = 1500; +pub const ERROR_EVENTLOG_CANT_START: DWORD = 1501; +pub const ERROR_LOG_FILE_FULL: DWORD = 1502; +pub const ERROR_EVENTLOG_FILE_CHANGED: DWORD = 1503; +pub const ERROR_INVALID_TASK_NAME: DWORD = 1550; +pub const ERROR_INVALID_TASK_INDEX: DWORD = 1551; +pub const ERROR_THREAD_ALREADY_IN_TASK: DWORD = 1552; +pub const ERROR_INSTALL_SERVICE_FAILURE: DWORD = 1601; +pub const ERROR_INSTALL_USEREXIT: DWORD = 1602; +pub const ERROR_INSTALL_FAILURE: DWORD = 1603; +pub const ERROR_INSTALL_SUSPEND: DWORD = 1604; +pub const ERROR_UNKNOWN_PRODUCT: DWORD = 1605; +pub const ERROR_UNKNOWN_FEATURE: DWORD = 1606; +pub const ERROR_UNKNOWN_COMPONENT: DWORD = 1607; +pub const ERROR_UNKNOWN_PROPERTY: DWORD = 1608; +pub const ERROR_INVALID_HANDLE_STATE: DWORD = 1609; +pub const ERROR_BAD_CONFIGURATION: DWORD = 1610; +pub const ERROR_INDEX_ABSENT: DWORD = 1611; +pub const ERROR_INSTALL_SOURCE_ABSENT: DWORD = 1612; +pub const ERROR_INSTALL_PACKAGE_VERSION: DWORD = 1613; +pub const ERROR_PRODUCT_UNINSTALLED: DWORD = 1614; +pub const ERROR_BAD_QUERY_SYNTAX: DWORD = 1615; +pub const ERROR_INVALID_FIELD: DWORD = 1616; +pub const ERROR_DEVICE_REMOVED: DWORD = 1617; +pub const ERROR_INSTALL_ALREADY_RUNNING: DWORD = 1618; +pub const ERROR_INSTALL_PACKAGE_OPEN_FAILED: DWORD = 1619; +pub const ERROR_INSTALL_PACKAGE_INVALID: DWORD = 1620; +pub const ERROR_INSTALL_UI_FAILURE: DWORD = 1621; +pub const ERROR_INSTALL_LOG_FAILURE: DWORD = 1622; +pub const ERROR_INSTALL_LANGUAGE_UNSUPPORTED: DWORD = 1623; +pub const ERROR_INSTALL_TRANSFORM_FAILURE: DWORD = 1624; +pub const ERROR_INSTALL_PACKAGE_REJECTED: DWORD = 1625; +pub const ERROR_FUNCTION_NOT_CALLED: DWORD = 1626; +pub const ERROR_FUNCTION_FAILED: DWORD = 1627; +pub const ERROR_INVALID_TABLE: DWORD = 1628; +pub const ERROR_DATATYPE_MISMATCH: DWORD = 1629; +pub const ERROR_UNSUPPORTED_TYPE: DWORD = 1630; +pub const ERROR_CREATE_FAILED: DWORD = 1631; +pub const ERROR_INSTALL_TEMP_UNWRITABLE: DWORD = 1632; +pub const ERROR_INSTALL_PLATFORM_UNSUPPORTED: DWORD = 1633; +pub const ERROR_INSTALL_NOTUSED: DWORD = 1634; +pub const ERROR_PATCH_PACKAGE_OPEN_FAILED: DWORD = 1635; +pub const ERROR_PATCH_PACKAGE_INVALID: DWORD = 1636; +pub const ERROR_PATCH_PACKAGE_UNSUPPORTED: DWORD = 1637; +pub const ERROR_PRODUCT_VERSION: DWORD = 1638; +pub const ERROR_INVALID_COMMAND_LINE: DWORD = 1639; +pub const ERROR_INSTALL_REMOTE_DISALLOWED: DWORD = 1640; +pub const ERROR_SUCCESS_REBOOT_INITIATED: DWORD = 1641; +pub const ERROR_PATCH_TARGET_NOT_FOUND: DWORD = 1642; +pub const ERROR_PATCH_PACKAGE_REJECTED: DWORD = 1643; +pub const ERROR_INSTALL_TRANSFORM_REJECTED: DWORD = 1644; +pub const ERROR_INSTALL_REMOTE_PROHIBITED: DWORD = 1645; +pub const ERROR_PATCH_REMOVAL_UNSUPPORTED: DWORD = 1646; +pub const ERROR_UNKNOWN_PATCH: DWORD = 1647; +pub const ERROR_PATCH_NO_SEQUENCE: DWORD = 1648; +pub const ERROR_PATCH_REMOVAL_DISALLOWED: DWORD = 1649; +pub const ERROR_INVALID_PATCH_XML: DWORD = 1650; +pub const ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT: DWORD = 1651; +pub const ERROR_INSTALL_SERVICE_SAFEBOOT: DWORD = 1652; +pub const ERROR_FAIL_FAST_EXCEPTION: DWORD = 1653; +pub const ERROR_INSTALL_REJECTED: DWORD = 1654; +pub const ERROR_DYNAMIC_CODE_BLOCKED: DWORD = 1655; +pub const RPC_S_INVALID_STRING_BINDING: DWORD = 1700; +pub const RPC_S_WRONG_KIND_OF_BINDING: DWORD = 1701; +pub const RPC_S_INVALID_BINDING: DWORD = 1702; +pub const RPC_S_PROTSEQ_NOT_SUPPORTED: DWORD = 1703; +pub const RPC_S_INVALID_RPC_PROTSEQ: DWORD = 1704; +pub const RPC_S_INVALID_STRING_UUID: DWORD = 1705; +pub const RPC_S_INVALID_ENDPOINT_FORMAT: DWORD = 1706; +pub const RPC_S_INVALID_NET_ADDR: DWORD = 1707; +pub const RPC_S_NO_ENDPOINT_FOUND: DWORD = 1708; +pub const RPC_S_INVALID_TIMEOUT: DWORD = 1709; +pub const RPC_S_OBJECT_NOT_FOUND: DWORD = 1710; +pub const RPC_S_ALREADY_REGISTERED: DWORD = 1711; +pub const RPC_S_TYPE_ALREADY_REGISTERED: DWORD = 1712; +pub const RPC_S_ALREADY_LISTENING: DWORD = 1713; +pub const RPC_S_NO_PROTSEQS_REGISTERED: DWORD = 1714; +pub const RPC_S_NOT_LISTENING: DWORD = 1715; +pub const RPC_S_UNKNOWN_MGR_TYPE: DWORD = 1716; +pub const RPC_S_UNKNOWN_IF: DWORD = 1717; +pub const RPC_S_NO_BINDINGS: DWORD = 1718; +pub const RPC_S_NO_PROTSEQS: DWORD = 1719; +pub const RPC_S_CANT_CREATE_ENDPOINT: DWORD = 1720; +pub const RPC_S_OUT_OF_RESOURCES: DWORD = 1721; +pub const RPC_S_SERVER_UNAVAILABLE: DWORD = 1722; +pub const RPC_S_SERVER_TOO_BUSY: DWORD = 1723; +pub const RPC_S_INVALID_NETWORK_OPTIONS: DWORD = 1724; +pub const RPC_S_NO_CALL_ACTIVE: DWORD = 1725; +pub const RPC_S_CALL_FAILED: DWORD = 1726; +pub const RPC_S_CALL_FAILED_DNE: DWORD = 1727; +pub const RPC_S_PROTOCOL_ERROR: DWORD = 1728; +pub const RPC_S_PROXY_ACCESS_DENIED: DWORD = 1729; +pub const RPC_S_UNSUPPORTED_TRANS_SYN: DWORD = 1730; +pub const RPC_S_UNSUPPORTED_TYPE: DWORD = 1732; +pub const RPC_S_INVALID_TAG: DWORD = 1733; +pub const RPC_S_INVALID_BOUND: DWORD = 1734; +pub const RPC_S_NO_ENTRY_NAME: DWORD = 1735; +pub const RPC_S_INVALID_NAME_SYNTAX: DWORD = 1736; +pub const RPC_S_UNSUPPORTED_NAME_SYNTAX: DWORD = 1737; +pub const RPC_S_UUID_NO_ADDRESS: DWORD = 1739; +pub const RPC_S_DUPLICATE_ENDPOINT: DWORD = 1740; +pub const RPC_S_UNKNOWN_AUTHN_TYPE: DWORD = 1741; +pub const RPC_S_MAX_CALLS_TOO_SMALL: DWORD = 1742; +pub const RPC_S_STRING_TOO_LONG: DWORD = 1743; +pub const RPC_S_PROTSEQ_NOT_FOUND: DWORD = 1744; +pub const RPC_S_PROCNUM_OUT_OF_RANGE: DWORD = 1745; +pub const RPC_S_BINDING_HAS_NO_AUTH: DWORD = 1746; +pub const RPC_S_UNKNOWN_AUTHN_SERVICE: DWORD = 1747; +pub const RPC_S_UNKNOWN_AUTHN_LEVEL: DWORD = 1748; +pub const RPC_S_INVALID_AUTH_IDENTITY: DWORD = 1749; +pub const RPC_S_UNKNOWN_AUTHZ_SERVICE: DWORD = 1750; +pub const EPT_S_INVALID_ENTRY: DWORD = 1751; +pub const EPT_S_CANT_PERFORM_OP: DWORD = 1752; +pub const EPT_S_NOT_REGISTERED: DWORD = 1753; +pub const RPC_S_NOTHING_TO_EXPORT: DWORD = 1754; +pub const RPC_S_INCOMPLETE_NAME: DWORD = 1755; +pub const RPC_S_INVALID_VERS_OPTION: DWORD = 1756; +pub const RPC_S_NO_MORE_MEMBERS: DWORD = 1757; +pub const RPC_S_NOT_ALL_OBJS_UNEXPORTED: DWORD = 1758; +pub const RPC_S_INTERFACE_NOT_FOUND: DWORD = 1759; +pub const RPC_S_ENTRY_ALREADY_EXISTS: DWORD = 1760; +pub const RPC_S_ENTRY_NOT_FOUND: DWORD = 1761; +pub const RPC_S_NAME_SERVICE_UNAVAILABLE: DWORD = 1762; +pub const RPC_S_INVALID_NAF_ID: DWORD = 1763; +pub const RPC_S_CANNOT_SUPPORT: DWORD = 1764; +pub const RPC_S_NO_CONTEXT_AVAILABLE: DWORD = 1765; +pub const RPC_S_INTERNAL_ERROR: DWORD = 1766; +pub const RPC_S_ZERO_DIVIDE: DWORD = 1767; +pub const RPC_S_ADDRESS_ERROR: DWORD = 1768; +pub const RPC_S_FP_DIV_ZERO: DWORD = 1769; +pub const RPC_S_FP_UNDERFLOW: DWORD = 1770; +pub const RPC_S_FP_OVERFLOW: DWORD = 1771; +pub const RPC_X_NO_MORE_ENTRIES: DWORD = 1772; +pub const RPC_X_SS_CHAR_TRANS_OPEN_FAIL: DWORD = 1773; +pub const RPC_X_SS_CHAR_TRANS_SHORT_FILE: DWORD = 1774; +pub const RPC_X_SS_IN_NULL_CONTEXT: DWORD = 1775; +pub const RPC_X_SS_CONTEXT_DAMAGED: DWORD = 1777; +pub const RPC_X_SS_HANDLES_MISMATCH: DWORD = 1778; +pub const RPC_X_SS_CANNOT_GET_CALL_HANDLE: DWORD = 1779; +pub const RPC_X_NULL_REF_POINTER: DWORD = 1780; +pub const RPC_X_ENUM_VALUE_OUT_OF_RANGE: DWORD = 1781; +pub const RPC_X_BYTE_COUNT_TOO_SMALL: DWORD = 1782; +pub const RPC_X_BAD_STUB_DATA: DWORD = 1783; +pub const ERROR_INVALID_USER_BUFFER: DWORD = 1784; +pub const ERROR_UNRECOGNIZED_MEDIA: DWORD = 1785; +pub const ERROR_NO_TRUST_LSA_SECRET: DWORD = 1786; +pub const ERROR_NO_TRUST_SAM_ACCOUNT: DWORD = 1787; +pub const ERROR_TRUSTED_DOMAIN_FAILURE: DWORD = 1788; +pub const ERROR_TRUSTED_RELATIONSHIP_FAILURE: DWORD = 1789; +pub const ERROR_TRUST_FAILURE: DWORD = 1790; +pub const RPC_S_CALL_IN_PROGRESS: DWORD = 1791; +pub const ERROR_NETLOGON_NOT_STARTED: DWORD = 1792; +pub const ERROR_ACCOUNT_EXPIRED: DWORD = 1793; +pub const ERROR_REDIRECTOR_HAS_OPEN_HANDLES: DWORD = 1794; +pub const ERROR_PRINTER_DRIVER_ALREADY_INSTALLED: DWORD = 1795; +pub const ERROR_UNKNOWN_PORT: DWORD = 1796; +pub const ERROR_UNKNOWN_PRINTER_DRIVER: DWORD = 1797; +pub const ERROR_UNKNOWN_PRINTPROCESSOR: DWORD = 1798; +pub const ERROR_INVALID_SEPARATOR_FILE: DWORD = 1799; +pub const ERROR_INVALID_PRIORITY: DWORD = 1800; +pub const ERROR_INVALID_PRINTER_NAME: DWORD = 1801; +pub const ERROR_PRINTER_ALREADY_EXISTS: DWORD = 1802; +pub const ERROR_INVALID_PRINTER_COMMAND: DWORD = 1803; +pub const ERROR_INVALID_DATATYPE: DWORD = 1804; +pub const ERROR_INVALID_ENVIRONMENT: DWORD = 1805; +pub const RPC_S_NO_MORE_BINDINGS: DWORD = 1806; +pub const ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT: DWORD = 1807; +pub const ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT: DWORD = 1808; +pub const ERROR_NOLOGON_SERVER_TRUST_ACCOUNT: DWORD = 1809; +pub const ERROR_DOMAIN_TRUST_INCONSISTENT: DWORD = 1810; +pub const ERROR_SERVER_HAS_OPEN_HANDLES: DWORD = 1811; +pub const ERROR_RESOURCE_DATA_NOT_FOUND: DWORD = 1812; +pub const ERROR_RESOURCE_TYPE_NOT_FOUND: DWORD = 1813; +pub const ERROR_RESOURCE_NAME_NOT_FOUND: DWORD = 1814; +pub const ERROR_RESOURCE_LANG_NOT_FOUND: DWORD = 1815; +pub const ERROR_NOT_ENOUGH_QUOTA: DWORD = 1816; +pub const RPC_S_NO_INTERFACES: DWORD = 1817; +pub const RPC_S_CALL_CANCELLED: DWORD = 1818; +pub const RPC_S_BINDING_INCOMPLETE: DWORD = 1819; +pub const RPC_S_COMM_FAILURE: DWORD = 1820; +pub const RPC_S_UNSUPPORTED_AUTHN_LEVEL: DWORD = 1821; +pub const RPC_S_NO_PRINC_NAME: DWORD = 1822; +pub const RPC_S_NOT_RPC_ERROR: DWORD = 1823; +pub const RPC_S_UUID_LOCAL_ONLY: DWORD = 1824; +pub const RPC_S_SEC_PKG_ERROR: DWORD = 1825; +pub const RPC_S_NOT_CANCELLED: DWORD = 1826; +pub const RPC_X_INVALID_ES_ACTION: DWORD = 1827; +pub const RPC_X_WRONG_ES_VERSION: DWORD = 1828; +pub const RPC_X_WRONG_STUB_VERSION: DWORD = 1829; +pub const RPC_X_INVALID_PIPE_OBJECT: DWORD = 1830; +pub const RPC_X_WRONG_PIPE_ORDER: DWORD = 1831; +pub const RPC_X_WRONG_PIPE_VERSION: DWORD = 1832; +pub const RPC_S_COOKIE_AUTH_FAILED: DWORD = 1833; +pub const RPC_S_GROUP_MEMBER_NOT_FOUND: DWORD = 1898; +pub const EPT_S_CANT_CREATE: DWORD = 1899; +pub const RPC_S_INVALID_OBJECT: DWORD = 1900; +pub const ERROR_INVALID_TIME: DWORD = 1901; +pub const ERROR_INVALID_FORM_NAME: DWORD = 1902; +pub const ERROR_INVALID_FORM_SIZE: DWORD = 1903; +pub const ERROR_ALREADY_WAITING: DWORD = 1904; +pub const ERROR_PRINTER_DELETED: DWORD = 1905; +pub const ERROR_INVALID_PRINTER_STATE: DWORD = 1906; +pub const ERROR_PASSWORD_MUST_CHANGE: DWORD = 1907; +pub const ERROR_DOMAIN_CONTROLLER_NOT_FOUND: DWORD = 1908; +pub const ERROR_ACCOUNT_LOCKED_OUT: DWORD = 1909; +pub const OR_INVALID_OXID: DWORD = 1910; +pub const OR_INVALID_OID: DWORD = 1911; +pub const OR_INVALID_SET: DWORD = 1912; +pub const RPC_S_SEND_INCOMPLETE: DWORD = 1913; +pub const RPC_S_INVALID_ASYNC_HANDLE: DWORD = 1914; +pub const RPC_S_INVALID_ASYNC_CALL: DWORD = 1915; +pub const RPC_X_PIPE_CLOSED: DWORD = 1916; +pub const RPC_X_PIPE_DISCIPLINE_ERROR: DWORD = 1917; +pub const RPC_X_PIPE_EMPTY: DWORD = 1918; +pub const ERROR_NO_SITENAME: DWORD = 1919; +pub const ERROR_CANT_ACCESS_FILE: DWORD = 1920; +pub const ERROR_CANT_RESOLVE_FILENAME: DWORD = 1921; +pub const RPC_S_ENTRY_TYPE_MISMATCH: DWORD = 1922; +pub const RPC_S_NOT_ALL_OBJS_EXPORTED: DWORD = 1923; +pub const RPC_S_INTERFACE_NOT_EXPORTED: DWORD = 1924; +pub const RPC_S_PROFILE_NOT_ADDED: DWORD = 1925; +pub const RPC_S_PRF_ELT_NOT_ADDED: DWORD = 1926; +pub const RPC_S_PRF_ELT_NOT_REMOVED: DWORD = 1927; +pub const RPC_S_GRP_ELT_NOT_ADDED: DWORD = 1928; +pub const RPC_S_GRP_ELT_NOT_REMOVED: DWORD = 1929; +pub const ERROR_KM_DRIVER_BLOCKED: DWORD = 1930; +pub const ERROR_CONTEXT_EXPIRED: DWORD = 1931; +pub const ERROR_PER_USER_TRUST_QUOTA_EXCEEDED: DWORD = 1932; +pub const ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED: DWORD = 1933; +pub const ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED: DWORD = 1934; +pub const ERROR_AUTHENTICATION_FIREWALL_FAILED: DWORD = 1935; +pub const ERROR_REMOTE_PRINT_CONNECTIONS_BLOCKED: DWORD = 1936; +pub const ERROR_NTLM_BLOCKED: DWORD = 1937; +pub const ERROR_PASSWORD_CHANGE_REQUIRED: DWORD = 1938; +pub const ERROR_INVALID_PIXEL_FORMAT: DWORD = 2000; +pub const ERROR_BAD_DRIVER: DWORD = 2001; +pub const ERROR_INVALID_WINDOW_STYLE: DWORD = 2002; +pub const ERROR_METAFILE_NOT_SUPPORTED: DWORD = 2003; +pub const ERROR_TRANSFORM_NOT_SUPPORTED: DWORD = 2004; +pub const ERROR_CLIPPING_NOT_SUPPORTED: DWORD = 2005; +pub const ERROR_INVALID_CMM: DWORD = 2010; +pub const ERROR_INVALID_PROFILE: DWORD = 2011; +pub const ERROR_TAG_NOT_FOUND: DWORD = 2012; +pub const ERROR_TAG_NOT_PRESENT: DWORD = 2013; +pub const ERROR_DUPLICATE_TAG: DWORD = 2014; +pub const ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE: DWORD = 2015; +pub const ERROR_PROFILE_NOT_FOUND: DWORD = 2016; +pub const ERROR_INVALID_COLORSPACE: DWORD = 2017; +pub const ERROR_ICM_NOT_ENABLED: DWORD = 2018; +pub const ERROR_DELETING_ICM_XFORM: DWORD = 2019; +pub const ERROR_INVALID_TRANSFORM: DWORD = 2020; +pub const ERROR_COLORSPACE_MISMATCH: DWORD = 2021; +pub const ERROR_INVALID_COLORINDEX: DWORD = 2022; +pub const ERROR_PROFILE_DOES_NOT_MATCH_DEVICE: DWORD = 2023; +pub const ERROR_CONNECTED_OTHER_PASSWORD: DWORD = 2108; +pub const ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT: DWORD = 2109; +pub const ERROR_BAD_USERNAME: DWORD = 2202; +pub const ERROR_NOT_CONNECTED: DWORD = 2250; +pub const ERROR_OPEN_FILES: DWORD = 2401; +pub const ERROR_ACTIVE_CONNECTIONS: DWORD = 2402; +pub const ERROR_DEVICE_IN_USE: DWORD = 2404; +pub const ERROR_UNKNOWN_PRINT_MONITOR: DWORD = 3000; +pub const ERROR_PRINTER_DRIVER_IN_USE: DWORD = 3001; +pub const ERROR_SPOOL_FILE_NOT_FOUND: DWORD = 3002; +pub const ERROR_SPL_NO_STARTDOC: DWORD = 3003; +pub const ERROR_SPL_NO_ADDJOB: DWORD = 3004; +pub const ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED: DWORD = 3005; +pub const ERROR_PRINT_MONITOR_ALREADY_INSTALLED: DWORD = 3006; +pub const ERROR_INVALID_PRINT_MONITOR: DWORD = 3007; +pub const ERROR_PRINT_MONITOR_IN_USE: DWORD = 3008; +pub const ERROR_PRINTER_HAS_JOBS_QUEUED: DWORD = 3009; +pub const ERROR_SUCCESS_REBOOT_REQUIRED: DWORD = 3010; +pub const ERROR_SUCCESS_RESTART_REQUIRED: DWORD = 3011; +pub const ERROR_PRINTER_NOT_FOUND: DWORD = 3012; +pub const ERROR_PRINTER_DRIVER_WARNED: DWORD = 3013; +pub const ERROR_PRINTER_DRIVER_BLOCKED: DWORD = 3014; +pub const ERROR_PRINTER_DRIVER_PACKAGE_IN_USE: DWORD = 3015; +pub const ERROR_CORE_DRIVER_PACKAGE_NOT_FOUND: DWORD = 3016; +pub const ERROR_FAIL_REBOOT_REQUIRED: DWORD = 3017; +pub const ERROR_FAIL_REBOOT_INITIATED: DWORD = 3018; +pub const ERROR_PRINTER_DRIVER_DOWNLOAD_NEEDED: DWORD = 3019; +pub const ERROR_PRINT_JOB_RESTART_REQUIRED: DWORD = 3020; +pub const ERROR_INVALID_PRINTER_DRIVER_MANIFEST: DWORD = 3021; +pub const ERROR_PRINTER_NOT_SHAREABLE: DWORD = 3022; +pub const ERROR_REQUEST_PAUSED: DWORD = 3050; +pub const ERROR_IO_REISSUE_AS_CACHED: DWORD = 3950; +pub const ERROR_WINS_INTERNAL: DWORD = 4000; +pub const ERROR_CAN_NOT_DEL_LOCAL_WINS: DWORD = 4001; +pub const ERROR_STATIC_INIT: DWORD = 4002; +pub const ERROR_INC_BACKUP: DWORD = 4003; +pub const ERROR_FULL_BACKUP: DWORD = 4004; +pub const ERROR_REC_NON_EXISTENT: DWORD = 4005; +pub const ERROR_RPL_NOT_ALLOWED: DWORD = 4006; +pub const PEERDIST_ERROR_CONTENTINFO_VERSION_UNSUPPORTED: DWORD = 4050; +pub const PEERDIST_ERROR_CANNOT_PARSE_CONTENTINFO: DWORD = 4051; +pub const PEERDIST_ERROR_MISSING_DATA: DWORD = 4052; +pub const PEERDIST_ERROR_NO_MORE: DWORD = 4053; +pub const PEERDIST_ERROR_NOT_INITIALIZED: DWORD = 4054; +pub const PEERDIST_ERROR_ALREADY_INITIALIZED: DWORD = 4055; +pub const PEERDIST_ERROR_SHUTDOWN_IN_PROGRESS: DWORD = 4056; +pub const PEERDIST_ERROR_INVALIDATED: DWORD = 4057; +pub const PEERDIST_ERROR_ALREADY_EXISTS: DWORD = 4058; +pub const PEERDIST_ERROR_OPERATION_NOTFOUND: DWORD = 4059; +pub const PEERDIST_ERROR_ALREADY_COMPLETED: DWORD = 4060; +pub const PEERDIST_ERROR_OUT_OF_BOUNDS: DWORD = 4061; +pub const PEERDIST_ERROR_VERSION_UNSUPPORTED: DWORD = 4062; +pub const PEERDIST_ERROR_INVALID_CONFIGURATION: DWORD = 4063; +pub const PEERDIST_ERROR_NOT_LICENSED: DWORD = 4064; +pub const PEERDIST_ERROR_SERVICE_UNAVAILABLE: DWORD = 4065; +pub const PEERDIST_ERROR_TRUST_FAILURE: DWORD = 4066; +pub const ERROR_DHCP_ADDRESS_CONFLICT: DWORD = 4100; +pub const ERROR_WMI_GUID_NOT_FOUND: DWORD = 4200; +pub const ERROR_WMI_INSTANCE_NOT_FOUND: DWORD = 4201; +pub const ERROR_WMI_ITEMID_NOT_FOUND: DWORD = 4202; +pub const ERROR_WMI_TRY_AGAIN: DWORD = 4203; +pub const ERROR_WMI_DP_NOT_FOUND: DWORD = 4204; +pub const ERROR_WMI_UNRESOLVED_INSTANCE_REF: DWORD = 4205; +pub const ERROR_WMI_ALREADY_ENABLED: DWORD = 4206; +pub const ERROR_WMI_GUID_DISCONNECTED: DWORD = 4207; +pub const ERROR_WMI_SERVER_UNAVAILABLE: DWORD = 4208; +pub const ERROR_WMI_DP_FAILED: DWORD = 4209; +pub const ERROR_WMI_INVALID_MOF: DWORD = 4210; +pub const ERROR_WMI_INVALID_REGINFO: DWORD = 4211; +pub const ERROR_WMI_ALREADY_DISABLED: DWORD = 4212; +pub const ERROR_WMI_READ_ONLY: DWORD = 4213; +pub const ERROR_WMI_SET_FAILURE: DWORD = 4214; +pub const ERROR_NOT_APPCONTAINER: DWORD = 4250; +pub const ERROR_APPCONTAINER_REQUIRED: DWORD = 4251; +pub const ERROR_NOT_SUPPORTED_IN_APPCONTAINER: DWORD = 4252; +pub const ERROR_INVALID_PACKAGE_SID_LENGTH: DWORD = 4253; +pub const ERROR_INVALID_MEDIA: DWORD = 4300; +pub const ERROR_INVALID_LIBRARY: DWORD = 4301; +pub const ERROR_INVALID_MEDIA_POOL: DWORD = 4302; +pub const ERROR_DRIVE_MEDIA_MISMATCH: DWORD = 4303; +pub const ERROR_MEDIA_OFFLINE: DWORD = 4304; +pub const ERROR_LIBRARY_OFFLINE: DWORD = 4305; +pub const ERROR_EMPTY: DWORD = 4306; +pub const ERROR_NOT_EMPTY: DWORD = 4307; +pub const ERROR_MEDIA_UNAVAILABLE: DWORD = 4308; +pub const ERROR_RESOURCE_DISABLED: DWORD = 4309; +pub const ERROR_INVALID_CLEANER: DWORD = 4310; +pub const ERROR_UNABLE_TO_CLEAN: DWORD = 4311; +pub const ERROR_OBJECT_NOT_FOUND: DWORD = 4312; +pub const ERROR_DATABASE_FAILURE: DWORD = 4313; +pub const ERROR_DATABASE_FULL: DWORD = 4314; +pub const ERROR_MEDIA_INCOMPATIBLE: DWORD = 4315; +pub const ERROR_RESOURCE_NOT_PRESENT: DWORD = 4316; +pub const ERROR_INVALID_OPERATION: DWORD = 4317; +pub const ERROR_MEDIA_NOT_AVAILABLE: DWORD = 4318; +pub const ERROR_DEVICE_NOT_AVAILABLE: DWORD = 4319; +pub const ERROR_REQUEST_REFUSED: DWORD = 4320; +pub const ERROR_INVALID_DRIVE_OBJECT: DWORD = 4321; +pub const ERROR_LIBRARY_FULL: DWORD = 4322; +pub const ERROR_MEDIUM_NOT_ACCESSIBLE: DWORD = 4323; +pub const ERROR_UNABLE_TO_LOAD_MEDIUM: DWORD = 4324; +pub const ERROR_UNABLE_TO_INVENTORY_DRIVE: DWORD = 4325; +pub const ERROR_UNABLE_TO_INVENTORY_SLOT: DWORD = 4326; +pub const ERROR_UNABLE_TO_INVENTORY_TRANSPORT: DWORD = 4327; +pub const ERROR_TRANSPORT_FULL: DWORD = 4328; +pub const ERROR_CONTROLLING_IEPORT: DWORD = 4329; +pub const ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA: DWORD = 4330; +pub const ERROR_CLEANER_SLOT_SET: DWORD = 4331; +pub const ERROR_CLEANER_SLOT_NOT_SET: DWORD = 4332; +pub const ERROR_CLEANER_CARTRIDGE_SPENT: DWORD = 4333; +pub const ERROR_UNEXPECTED_OMID: DWORD = 4334; +pub const ERROR_CANT_DELETE_LAST_ITEM: DWORD = 4335; +pub const ERROR_MESSAGE_EXCEEDS_MAX_SIZE: DWORD = 4336; +pub const ERROR_VOLUME_CONTAINS_SYS_FILES: DWORD = 4337; +pub const ERROR_INDIGENOUS_TYPE: DWORD = 4338; +pub const ERROR_NO_SUPPORTING_DRIVES: DWORD = 4339; +pub const ERROR_CLEANER_CARTRIDGE_INSTALLED: DWORD = 4340; +pub const ERROR_IEPORT_FULL: DWORD = 4341; +pub const ERROR_FILE_OFFLINE: DWORD = 4350; +pub const ERROR_REMOTE_STORAGE_NOT_ACTIVE: DWORD = 4351; +pub const ERROR_REMOTE_STORAGE_MEDIA_ERROR: DWORD = 4352; +pub const ERROR_NOT_A_REPARSE_POINT: DWORD = 4390; +pub const ERROR_REPARSE_ATTRIBUTE_CONFLICT: DWORD = 4391; +pub const ERROR_INVALID_REPARSE_DATA: DWORD = 4392; +pub const ERROR_REPARSE_TAG_INVALID: DWORD = 4393; +pub const ERROR_REPARSE_TAG_MISMATCH: DWORD = 4394; +pub const ERROR_APP_DATA_NOT_FOUND: DWORD = 4400; +pub const ERROR_APP_DATA_EXPIRED: DWORD = 4401; +pub const ERROR_APP_DATA_CORRUPT: DWORD = 4402; +pub const ERROR_APP_DATA_LIMIT_EXCEEDED: DWORD = 4403; +pub const ERROR_APP_DATA_REBOOT_REQUIRED: DWORD = 4404; +pub const ERROR_SECUREBOOT_ROLLBACK_DETECTED: DWORD = 4420; +pub const ERROR_SECUREBOOT_POLICY_VIOLATION: DWORD = 4421; +pub const ERROR_SECUREBOOT_INVALID_POLICY: DWORD = 4422; +pub const ERROR_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND: DWORD = 4423; +pub const ERROR_SECUREBOOT_POLICY_NOT_SIGNED: DWORD = 4424; +pub const ERROR_SECUREBOOT_NOT_ENABLED: DWORD = 4425; +pub const ERROR_SECUREBOOT_FILE_REPLACED: DWORD = 4426; +pub const ERROR_OFFLOAD_READ_FLT_NOT_SUPPORTED: DWORD = 4440; +pub const ERROR_OFFLOAD_WRITE_FLT_NOT_SUPPORTED: DWORD = 4441; +pub const ERROR_OFFLOAD_READ_FILE_NOT_SUPPORTED: DWORD = 4442; +pub const ERROR_OFFLOAD_WRITE_FILE_NOT_SUPPORTED: DWORD = 4443; +pub const ERROR_VOLUME_NOT_SIS_ENABLED: DWORD = 4500; +pub const ERROR_DEPENDENT_RESOURCE_EXISTS: DWORD = 5001; +pub const ERROR_DEPENDENCY_NOT_FOUND: DWORD = 5002; +pub const ERROR_DEPENDENCY_ALREADY_EXISTS: DWORD = 5003; +pub const ERROR_RESOURCE_NOT_ONLINE: DWORD = 5004; +pub const ERROR_HOST_NODE_NOT_AVAILABLE: DWORD = 5005; +pub const ERROR_RESOURCE_NOT_AVAILABLE: DWORD = 5006; +pub const ERROR_RESOURCE_NOT_FOUND: DWORD = 5007; +pub const ERROR_SHUTDOWN_CLUSTER: DWORD = 5008; +pub const ERROR_CANT_EVICT_ACTIVE_NODE: DWORD = 5009; +pub const ERROR_OBJECT_ALREADY_EXISTS: DWORD = 5010; +pub const ERROR_OBJECT_IN_LIST: DWORD = 5011; +pub const ERROR_GROUP_NOT_AVAILABLE: DWORD = 5012; +pub const ERROR_GROUP_NOT_FOUND: DWORD = 5013; +pub const ERROR_GROUP_NOT_ONLINE: DWORD = 5014; +pub const ERROR_HOST_NODE_NOT_RESOURCE_OWNER: DWORD = 5015; +pub const ERROR_HOST_NODE_NOT_GROUP_OWNER: DWORD = 5016; +pub const ERROR_RESMON_CREATE_FAILED: DWORD = 5017; +pub const ERROR_RESMON_ONLINE_FAILED: DWORD = 5018; +pub const ERROR_RESOURCE_ONLINE: DWORD = 5019; +pub const ERROR_QUORUM_RESOURCE: DWORD = 5020; +pub const ERROR_NOT_QUORUM_CAPABLE: DWORD = 5021; +pub const ERROR_CLUSTER_SHUTTING_DOWN: DWORD = 5022; +pub const ERROR_INVALID_STATE: DWORD = 5023; +pub const ERROR_RESOURCE_PROPERTIES_STORED: DWORD = 5024; +pub const ERROR_NOT_QUORUM_CLASS: DWORD = 5025; +pub const ERROR_CORE_RESOURCE: DWORD = 5026; +pub const ERROR_QUORUM_RESOURCE_ONLINE_FAILED: DWORD = 5027; +pub const ERROR_QUORUMLOG_OPEN_FAILED: DWORD = 5028; +pub const ERROR_CLUSTERLOG_CORRUPT: DWORD = 5029; +pub const ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE: DWORD = 5030; +pub const ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE: DWORD = 5031; +pub const ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND: DWORD = 5032; +pub const ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE: DWORD = 5033; +pub const ERROR_QUORUM_OWNER_ALIVE: DWORD = 5034; +pub const ERROR_NETWORK_NOT_AVAILABLE: DWORD = 5035; +pub const ERROR_NODE_NOT_AVAILABLE: DWORD = 5036; +pub const ERROR_ALL_NODES_NOT_AVAILABLE: DWORD = 5037; +pub const ERROR_RESOURCE_FAILED: DWORD = 5038; +pub const ERROR_CLUSTER_INVALID_NODE: DWORD = 5039; +pub const ERROR_CLUSTER_NODE_EXISTS: DWORD = 5040; +pub const ERROR_CLUSTER_JOIN_IN_PROGRESS: DWORD = 5041; +pub const ERROR_CLUSTER_NODE_NOT_FOUND: DWORD = 5042; +pub const ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND: DWORD = 5043; +pub const ERROR_CLUSTER_NETWORK_EXISTS: DWORD = 5044; +pub const ERROR_CLUSTER_NETWORK_NOT_FOUND: DWORD = 5045; +pub const ERROR_CLUSTER_NETINTERFACE_EXISTS: DWORD = 5046; +pub const ERROR_CLUSTER_NETINTERFACE_NOT_FOUND: DWORD = 5047; +pub const ERROR_CLUSTER_INVALID_REQUEST: DWORD = 5048; +pub const ERROR_CLUSTER_INVALID_NETWORK_PROVIDER: DWORD = 5049; +pub const ERROR_CLUSTER_NODE_DOWN: DWORD = 5050; +pub const ERROR_CLUSTER_NODE_UNREACHABLE: DWORD = 5051; +pub const ERROR_CLUSTER_NODE_NOT_MEMBER: DWORD = 5052; +pub const ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS: DWORD = 5053; +pub const ERROR_CLUSTER_INVALID_NETWORK: DWORD = 5054; +pub const ERROR_CLUSTER_NODE_UP: DWORD = 5056; +pub const ERROR_CLUSTER_IPADDR_IN_USE: DWORD = 5057; +pub const ERROR_CLUSTER_NODE_NOT_PAUSED: DWORD = 5058; +pub const ERROR_CLUSTER_NO_SECURITY_CONTEXT: DWORD = 5059; +pub const ERROR_CLUSTER_NETWORK_NOT_INTERNAL: DWORD = 5060; +pub const ERROR_CLUSTER_NODE_ALREADY_UP: DWORD = 5061; +pub const ERROR_CLUSTER_NODE_ALREADY_DOWN: DWORD = 5062; +pub const ERROR_CLUSTER_NETWORK_ALREADY_ONLINE: DWORD = 5063; +pub const ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE: DWORD = 5064; +pub const ERROR_CLUSTER_NODE_ALREADY_MEMBER: DWORD = 5065; +pub const ERROR_CLUSTER_LAST_INTERNAL_NETWORK: DWORD = 5066; +pub const ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS: DWORD = 5067; +pub const ERROR_INVALID_OPERATION_ON_QUORUM: DWORD = 5068; +pub const ERROR_DEPENDENCY_NOT_ALLOWED: DWORD = 5069; +pub const ERROR_CLUSTER_NODE_PAUSED: DWORD = 5070; +pub const ERROR_NODE_CANT_HOST_RESOURCE: DWORD = 5071; +pub const ERROR_CLUSTER_NODE_NOT_READY: DWORD = 5072; +pub const ERROR_CLUSTER_NODE_SHUTTING_DOWN: DWORD = 5073; +pub const ERROR_CLUSTER_JOIN_ABORTED: DWORD = 5074; +pub const ERROR_CLUSTER_INCOMPATIBLE_VERSIONS: DWORD = 5075; +pub const ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED: DWORD = 5076; +pub const ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED: DWORD = 5077; +pub const ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND: DWORD = 5078; +pub const ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED: DWORD = 5079; +pub const ERROR_CLUSTER_RESNAME_NOT_FOUND: DWORD = 5080; +pub const ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED: DWORD = 5081; +pub const ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST: DWORD = 5082; +pub const ERROR_CLUSTER_DATABASE_SEQMISMATCH: DWORD = 5083; +pub const ERROR_RESMON_INVALID_STATE: DWORD = 5084; +pub const ERROR_CLUSTER_GUM_NOT_LOCKER: DWORD = 5085; +pub const ERROR_QUORUM_DISK_NOT_FOUND: DWORD = 5086; +pub const ERROR_DATABASE_BACKUP_CORRUPT: DWORD = 5087; +pub const ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT: DWORD = 5088; +pub const ERROR_RESOURCE_PROPERTY_UNCHANGEABLE: DWORD = 5089; +pub const ERROR_NO_ADMIN_ACCESS_POINT: DWORD = 5090; +pub const ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE: DWORD = 5890; +pub const ERROR_CLUSTER_QUORUMLOG_NOT_FOUND: DWORD = 5891; +pub const ERROR_CLUSTER_MEMBERSHIP_HALT: DWORD = 5892; +pub const ERROR_CLUSTER_INSTANCE_ID_MISMATCH: DWORD = 5893; +pub const ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP: DWORD = 5894; +pub const ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH: DWORD = 5895; +pub const ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP: DWORD = 5896; +pub const ERROR_CLUSTER_PARAMETER_MISMATCH: DWORD = 5897; +pub const ERROR_NODE_CANNOT_BE_CLUSTERED: DWORD = 5898; +pub const ERROR_CLUSTER_WRONG_OS_VERSION: DWORD = 5899; +pub const ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME: DWORD = 5900; +pub const ERROR_CLUSCFG_ALREADY_COMMITTED: DWORD = 5901; +pub const ERROR_CLUSCFG_ROLLBACK_FAILED: DWORD = 5902; +pub const ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT: DWORD = 5903; +pub const ERROR_CLUSTER_OLD_VERSION: DWORD = 5904; +pub const ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME: DWORD = 5905; +pub const ERROR_CLUSTER_NO_NET_ADAPTERS: DWORD = 5906; +pub const ERROR_CLUSTER_POISONED: DWORD = 5907; +pub const ERROR_CLUSTER_GROUP_MOVING: DWORD = 5908; +pub const ERROR_CLUSTER_RESOURCE_TYPE_BUSY: DWORD = 5909; +pub const ERROR_RESOURCE_CALL_TIMED_OUT: DWORD = 5910; +pub const ERROR_INVALID_CLUSTER_IPV6_ADDRESS: DWORD = 5911; +pub const ERROR_CLUSTER_INTERNAL_INVALID_FUNCTION: DWORD = 5912; +pub const ERROR_CLUSTER_PARAMETER_OUT_OF_BOUNDS: DWORD = 5913; +pub const ERROR_CLUSTER_PARTIAL_SEND: DWORD = 5914; +pub const ERROR_CLUSTER_REGISTRY_INVALID_FUNCTION: DWORD = 5915; +pub const ERROR_CLUSTER_INVALID_STRING_TERMINATION: DWORD = 5916; +pub const ERROR_CLUSTER_INVALID_STRING_FORMAT: DWORD = 5917; +pub const ERROR_CLUSTER_DATABASE_TRANSACTION_IN_PROGRESS: DWORD = 5918; +pub const ERROR_CLUSTER_DATABASE_TRANSACTION_NOT_IN_PROGRESS: DWORD = 5919; +pub const ERROR_CLUSTER_NULL_DATA: DWORD = 5920; +pub const ERROR_CLUSTER_PARTIAL_READ: DWORD = 5921; +pub const ERROR_CLUSTER_PARTIAL_WRITE: DWORD = 5922; +pub const ERROR_CLUSTER_CANT_DESERIALIZE_DATA: DWORD = 5923; +pub const ERROR_DEPENDENT_RESOURCE_PROPERTY_CONFLICT: DWORD = 5924; +pub const ERROR_CLUSTER_NO_QUORUM: DWORD = 5925; +pub const ERROR_CLUSTER_INVALID_IPV6_NETWORK: DWORD = 5926; +pub const ERROR_CLUSTER_INVALID_IPV6_TUNNEL_NETWORK: DWORD = 5927; +pub const ERROR_QUORUM_NOT_ALLOWED_IN_THIS_GROUP: DWORD = 5928; +pub const ERROR_DEPENDENCY_TREE_TOO_COMPLEX: DWORD = 5929; +pub const ERROR_EXCEPTION_IN_RESOURCE_CALL: DWORD = 5930; +pub const ERROR_CLUSTER_RHS_FAILED_INITIALIZATION: DWORD = 5931; +pub const ERROR_CLUSTER_NOT_INSTALLED: DWORD = 5932; +pub const ERROR_CLUSTER_RESOURCES_MUST_BE_ONLINE_ON_THE_SAME_NODE: DWORD = 5933; +pub const ERROR_CLUSTER_MAX_NODES_IN_CLUSTER: DWORD = 5934; +pub const ERROR_CLUSTER_TOO_MANY_NODES: DWORD = 5935; +pub const ERROR_CLUSTER_OBJECT_ALREADY_USED: DWORD = 5936; +pub const ERROR_NONCORE_GROUPS_FOUND: DWORD = 5937; +pub const ERROR_FILE_SHARE_RESOURCE_CONFLICT: DWORD = 5938; +pub const ERROR_CLUSTER_EVICT_INVALID_REQUEST: DWORD = 5939; +pub const ERROR_CLUSTER_SINGLETON_RESOURCE: DWORD = 5940; +pub const ERROR_CLUSTER_GROUP_SINGLETON_RESOURCE: DWORD = 5941; +pub const ERROR_CLUSTER_RESOURCE_PROVIDER_FAILED: DWORD = 5942; +pub const ERROR_CLUSTER_RESOURCE_CONFIGURATION_ERROR: DWORD = 5943; +pub const ERROR_CLUSTER_GROUP_BUSY: DWORD = 5944; +pub const ERROR_CLUSTER_NOT_SHARED_VOLUME: DWORD = 5945; +pub const ERROR_CLUSTER_INVALID_SECURITY_DESCRIPTOR: DWORD = 5946; +pub const ERROR_CLUSTER_SHARED_VOLUMES_IN_USE: DWORD = 5947; +pub const ERROR_CLUSTER_USE_SHARED_VOLUMES_API: DWORD = 5948; +pub const ERROR_CLUSTER_BACKUP_IN_PROGRESS: DWORD = 5949; +pub const ERROR_NON_CSV_PATH: DWORD = 5950; +pub const ERROR_CSV_VOLUME_NOT_LOCAL: DWORD = 5951; +pub const ERROR_CLUSTER_WATCHDOG_TERMINATING: DWORD = 5952; +pub const ERROR_CLUSTER_RESOURCE_VETOED_MOVE_INCOMPATIBLE_NODES: DWORD = 5953; +pub const ERROR_CLUSTER_INVALID_NODE_WEIGHT: DWORD = 5954; +pub const ERROR_CLUSTER_RESOURCE_VETOED_CALL: DWORD = 5955; +pub const ERROR_RESMON_SYSTEM_RESOURCES_LACKING: DWORD = 5956; +pub const ERROR_CLUSTER_RESOURCE_VETOED_MOVE_NOT_ENOUGH_RESOURCES_ON_DESTINATION: DWORD = 5957; +pub const ERROR_CLUSTER_RESOURCE_VETOED_MOVE_NOT_ENOUGH_RESOURCES_ON_SOURCE: DWORD = 5958; +pub const ERROR_CLUSTER_GROUP_QUEUED: DWORD = 5959; +pub const ERROR_CLUSTER_RESOURCE_LOCKED_STATUS: DWORD = 5960; +pub const ERROR_CLUSTER_SHARED_VOLUME_FAILOVER_NOT_ALLOWED: DWORD = 5961; +pub const ERROR_CLUSTER_NODE_DRAIN_IN_PROGRESS: DWORD = 5962; +pub const ERROR_CLUSTER_DISK_NOT_CONNECTED: DWORD = 5963; +pub const ERROR_DISK_NOT_CSV_CAPABLE: DWORD = 5964; +pub const ERROR_RESOURCE_NOT_IN_AVAILABLE_STORAGE: DWORD = 5965; +pub const ERROR_CLUSTER_SHARED_VOLUME_REDIRECTED: DWORD = 5966; +pub const ERROR_CLUSTER_SHARED_VOLUME_NOT_REDIRECTED: DWORD = 5967; +pub const ERROR_CLUSTER_CANNOT_RETURN_PROPERTIES: DWORD = 5968; +pub const ERROR_CLUSTER_RESOURCE_CONTAINS_UNSUPPORTED_DIFF_AREA_FOR_SHARED_VOLUMES: DWORD = 5969; +pub const ERROR_CLUSTER_RESOURCE_IS_IN_MAINTENANCE_MODE: DWORD = 5970; +pub const ERROR_CLUSTER_AFFINITY_CONFLICT: DWORD = 5971; +pub const ERROR_CLUSTER_RESOURCE_IS_REPLICA_VIRTUAL_MACHINE: DWORD = 5972; +pub const ERROR_ENCRYPTION_FAILED: DWORD = 6000; +pub const ERROR_DECRYPTION_FAILED: DWORD = 6001; +pub const ERROR_FILE_ENCRYPTED: DWORD = 6002; +pub const ERROR_NO_RECOVERY_POLICY: DWORD = 6003; +pub const ERROR_NO_EFS: DWORD = 6004; +pub const ERROR_WRONG_EFS: DWORD = 6005; +pub const ERROR_NO_USER_KEYS: DWORD = 6006; +pub const ERROR_FILE_NOT_ENCRYPTED: DWORD = 6007; +pub const ERROR_NOT_EXPORT_FORMAT: DWORD = 6008; +pub const ERROR_FILE_READ_ONLY: DWORD = 6009; +pub const ERROR_DIR_EFS_DISALLOWED: DWORD = 6010; +pub const ERROR_EFS_SERVER_NOT_TRUSTED: DWORD = 6011; +pub const ERROR_BAD_RECOVERY_POLICY: DWORD = 6012; +pub const ERROR_EFS_ALG_BLOB_TOO_BIG: DWORD = 6013; +pub const ERROR_VOLUME_NOT_SUPPORT_EFS: DWORD = 6014; +pub const ERROR_EFS_DISABLED: DWORD = 6015; +pub const ERROR_EFS_VERSION_NOT_SUPPORT: DWORD = 6016; +pub const ERROR_CS_ENCRYPTION_INVALID_SERVER_RESPONSE: DWORD = 6017; +pub const ERROR_CS_ENCRYPTION_UNSUPPORTED_SERVER: DWORD = 6018; +pub const ERROR_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE: DWORD = 6019; +pub const ERROR_CS_ENCRYPTION_NEW_ENCRYPTED_FILE: DWORD = 6020; +pub const ERROR_CS_ENCRYPTION_FILE_NOT_CSE: DWORD = 6021; +pub const ERROR_ENCRYPTION_POLICY_DENIES_OPERATION: DWORD = 6022; +pub const ERROR_NO_BROWSER_SERVERS_FOUND: DWORD = 6118; +pub const SCHED_E_SERVICE_NOT_LOCALSYSTEM: DWORD = 6200; +pub const ERROR_LOG_SECTOR_INVALID: DWORD = 6600; +pub const ERROR_LOG_SECTOR_PARITY_INVALID: DWORD = 6601; +pub const ERROR_LOG_SECTOR_REMAPPED: DWORD = 6602; +pub const ERROR_LOG_BLOCK_INCOMPLETE: DWORD = 6603; +pub const ERROR_LOG_INVALID_RANGE: DWORD = 6604; +pub const ERROR_LOG_BLOCKS_EXHAUSTED: DWORD = 6605; +pub const ERROR_LOG_READ_CONTEXT_INVALID: DWORD = 6606; +pub const ERROR_LOG_RESTART_INVALID: DWORD = 6607; +pub const ERROR_LOG_BLOCK_VERSION: DWORD = 6608; +pub const ERROR_LOG_BLOCK_INVALID: DWORD = 6609; +pub const ERROR_LOG_READ_MODE_INVALID: DWORD = 6610; +pub const ERROR_LOG_NO_RESTART: DWORD = 6611; +pub const ERROR_LOG_METADATA_CORRUPT: DWORD = 6612; +pub const ERROR_LOG_METADATA_INVALID: DWORD = 6613; +pub const ERROR_LOG_METADATA_INCONSISTENT: DWORD = 6614; +pub const ERROR_LOG_RESERVATION_INVALID: DWORD = 6615; +pub const ERROR_LOG_CANT_DELETE: DWORD = 6616; +pub const ERROR_LOG_CONTAINER_LIMIT_EXCEEDED: DWORD = 6617; +pub const ERROR_LOG_START_OF_LOG: DWORD = 6618; +pub const ERROR_LOG_POLICY_ALREADY_INSTALLED: DWORD = 6619; +pub const ERROR_LOG_POLICY_NOT_INSTALLED: DWORD = 6620; +pub const ERROR_LOG_POLICY_INVALID: DWORD = 6621; +pub const ERROR_LOG_POLICY_CONFLICT: DWORD = 6622; +pub const ERROR_LOG_PINNED_ARCHIVE_TAIL: DWORD = 6623; +pub const ERROR_LOG_RECORD_NONEXISTENT: DWORD = 6624; +pub const ERROR_LOG_RECORDS_RESERVED_INVALID: DWORD = 6625; +pub const ERROR_LOG_SPACE_RESERVED_INVALID: DWORD = 6626; +pub const ERROR_LOG_TAIL_INVALID: DWORD = 6627; +pub const ERROR_LOG_FULL: DWORD = 6628; +pub const ERROR_COULD_NOT_RESIZE_LOG: DWORD = 6629; +pub const ERROR_LOG_MULTIPLEXED: DWORD = 6630; +pub const ERROR_LOG_DEDICATED: DWORD = 6631; +pub const ERROR_LOG_ARCHIVE_NOT_IN_PROGRESS: DWORD = 6632; +pub const ERROR_LOG_ARCHIVE_IN_PROGRESS: DWORD = 6633; +pub const ERROR_LOG_EPHEMERAL: DWORD = 6634; +pub const ERROR_LOG_NOT_ENOUGH_CONTAINERS: DWORD = 6635; +pub const ERROR_LOG_CLIENT_ALREADY_REGISTERED: DWORD = 6636; +pub const ERROR_LOG_CLIENT_NOT_REGISTERED: DWORD = 6637; +pub const ERROR_LOG_FULL_HANDLER_IN_PROGRESS: DWORD = 6638; +pub const ERROR_LOG_CONTAINER_READ_FAILED: DWORD = 6639; +pub const ERROR_LOG_CONTAINER_WRITE_FAILED: DWORD = 6640; +pub const ERROR_LOG_CONTAINER_OPEN_FAILED: DWORD = 6641; +pub const ERROR_LOG_CONTAINER_STATE_INVALID: DWORD = 6642; +pub const ERROR_LOG_STATE_INVALID: DWORD = 6643; +pub const ERROR_LOG_PINNED: DWORD = 6644; +pub const ERROR_LOG_METADATA_FLUSH_FAILED: DWORD = 6645; +pub const ERROR_LOG_INCONSISTENT_SECURITY: DWORD = 6646; +pub const ERROR_LOG_APPENDED_FLUSH_FAILED: DWORD = 6647; +pub const ERROR_LOG_PINNED_RESERVATION: DWORD = 6648; +pub const ERROR_INVALID_TRANSACTION: DWORD = 6700; +pub const ERROR_TRANSACTION_NOT_ACTIVE: DWORD = 6701; +pub const ERROR_TRANSACTION_REQUEST_NOT_VALID: DWORD = 6702; +pub const ERROR_TRANSACTION_NOT_REQUESTED: DWORD = 6703; +pub const ERROR_TRANSACTION_ALREADY_ABORTED: DWORD = 6704; +pub const ERROR_TRANSACTION_ALREADY_COMMITTED: DWORD = 6705; +pub const ERROR_TM_INITIALIZATION_FAILED: DWORD = 6706; +pub const ERROR_RESOURCEMANAGER_READ_ONLY: DWORD = 6707; +pub const ERROR_TRANSACTION_NOT_JOINED: DWORD = 6708; +pub const ERROR_TRANSACTION_SUPERIOR_EXISTS: DWORD = 6709; +pub const ERROR_CRM_PROTOCOL_ALREADY_EXISTS: DWORD = 6710; +pub const ERROR_TRANSACTION_PROPAGATION_FAILED: DWORD = 6711; +pub const ERROR_CRM_PROTOCOL_NOT_FOUND: DWORD = 6712; +pub const ERROR_TRANSACTION_INVALID_MARSHALL_BUFFER: DWORD = 6713; +pub const ERROR_CURRENT_TRANSACTION_NOT_VALID: DWORD = 6714; +pub const ERROR_TRANSACTION_NOT_FOUND: DWORD = 6715; +pub const ERROR_RESOURCEMANAGER_NOT_FOUND: DWORD = 6716; +pub const ERROR_ENLISTMENT_NOT_FOUND: DWORD = 6717; +pub const ERROR_TRANSACTIONMANAGER_NOT_FOUND: DWORD = 6718; +pub const ERROR_TRANSACTIONMANAGER_NOT_ONLINE: DWORD = 6719; +pub const ERROR_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION: DWORD = 6720; +pub const ERROR_TRANSACTION_NOT_ROOT: DWORD = 6721; +pub const ERROR_TRANSACTION_OBJECT_EXPIRED: DWORD = 6722; +pub const ERROR_TRANSACTION_RESPONSE_NOT_ENLISTED: DWORD = 6723; +pub const ERROR_TRANSACTION_RECORD_TOO_LONG: DWORD = 6724; +pub const ERROR_IMPLICIT_TRANSACTION_NOT_SUPPORTED: DWORD = 6725; +pub const ERROR_TRANSACTION_INTEGRITY_VIOLATED: DWORD = 6726; +pub const ERROR_TRANSACTIONMANAGER_IDENTITY_MISMATCH: DWORD = 6727; +pub const ERROR_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT: DWORD = 6728; +pub const ERROR_TRANSACTION_MUST_WRITETHROUGH: DWORD = 6729; +pub const ERROR_TRANSACTION_NO_SUPERIOR: DWORD = 6730; +pub const ERROR_HEURISTIC_DAMAGE_POSSIBLE: DWORD = 6731; +pub const ERROR_TRANSACTIONAL_CONFLICT: DWORD = 6800; +pub const ERROR_RM_NOT_ACTIVE: DWORD = 6801; +pub const ERROR_RM_METADATA_CORRUPT: DWORD = 6802; +pub const ERROR_DIRECTORY_NOT_RM: DWORD = 6803; +pub const ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE: DWORD = 6805; +pub const ERROR_LOG_RESIZE_INVALID_SIZE: DWORD = 6806; +pub const ERROR_OBJECT_NO_LONGER_EXISTS: DWORD = 6807; +pub const ERROR_STREAM_MINIVERSION_NOT_FOUND: DWORD = 6808; +pub const ERROR_STREAM_MINIVERSION_NOT_VALID: DWORD = 6809; +pub const ERROR_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION: DWORD = 6810; +pub const ERROR_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT: DWORD = 6811; +pub const ERROR_CANT_CREATE_MORE_STREAM_MINIVERSIONS: DWORD = 6812; +pub const ERROR_REMOTE_FILE_VERSION_MISMATCH: DWORD = 6814; +pub const ERROR_HANDLE_NO_LONGER_VALID: DWORD = 6815; +pub const ERROR_NO_TXF_METADATA: DWORD = 6816; +pub const ERROR_LOG_CORRUPTION_DETECTED: DWORD = 6817; +pub const ERROR_CANT_RECOVER_WITH_HANDLE_OPEN: DWORD = 6818; +pub const ERROR_RM_DISCONNECTED: DWORD = 6819; +pub const ERROR_ENLISTMENT_NOT_SUPERIOR: DWORD = 6820; +pub const ERROR_RECOVERY_NOT_NEEDED: DWORD = 6821; +pub const ERROR_RM_ALREADY_STARTED: DWORD = 6822; +pub const ERROR_FILE_IDENTITY_NOT_PERSISTENT: DWORD = 6823; +pub const ERROR_CANT_BREAK_TRANSACTIONAL_DEPENDENCY: DWORD = 6824; +pub const ERROR_CANT_CROSS_RM_BOUNDARY: DWORD = 6825; +pub const ERROR_TXF_DIR_NOT_EMPTY: DWORD = 6826; +pub const ERROR_INDOUBT_TRANSACTIONS_EXIST: DWORD = 6827; +pub const ERROR_TM_VOLATILE: DWORD = 6828; +pub const ERROR_ROLLBACK_TIMER_EXPIRED: DWORD = 6829; +pub const ERROR_TXF_ATTRIBUTE_CORRUPT: DWORD = 6830; +pub const ERROR_EFS_NOT_ALLOWED_IN_TRANSACTION: DWORD = 6831; +pub const ERROR_TRANSACTIONAL_OPEN_NOT_ALLOWED: DWORD = 6832; +pub const ERROR_LOG_GROWTH_FAILED: DWORD = 6833; +pub const ERROR_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE: DWORD = 6834; +pub const ERROR_TXF_METADATA_ALREADY_PRESENT: DWORD = 6835; +pub const ERROR_TRANSACTION_SCOPE_CALLBACKS_NOT_SET: DWORD = 6836; +pub const ERROR_TRANSACTION_REQUIRED_PROMOTION: DWORD = 6837; +pub const ERROR_CANNOT_EXECUTE_FILE_IN_TRANSACTION: DWORD = 6838; +pub const ERROR_TRANSACTIONS_NOT_FROZEN: DWORD = 6839; +pub const ERROR_TRANSACTION_FREEZE_IN_PROGRESS: DWORD = 6840; +pub const ERROR_NOT_SNAPSHOT_VOLUME: DWORD = 6841; +pub const ERROR_NO_SAVEPOINT_WITH_OPEN_FILES: DWORD = 6842; +pub const ERROR_DATA_LOST_REPAIR: DWORD = 6843; +pub const ERROR_SPARSE_NOT_ALLOWED_IN_TRANSACTION: DWORD = 6844; +pub const ERROR_TM_IDENTITY_MISMATCH: DWORD = 6845; +pub const ERROR_FLOATED_SECTION: DWORD = 6846; +pub const ERROR_CANNOT_ACCEPT_TRANSACTED_WORK: DWORD = 6847; +pub const ERROR_CANNOT_ABORT_TRANSACTIONS: DWORD = 6848; +pub const ERROR_BAD_CLUSTERS: DWORD = 6849; +pub const ERROR_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION: DWORD = 6850; +pub const ERROR_VOLUME_DIRTY: DWORD = 6851; +pub const ERROR_NO_LINK_TRACKING_IN_TRANSACTION: DWORD = 6852; +pub const ERROR_OPERATION_NOT_SUPPORTED_IN_TRANSACTION: DWORD = 6853; +pub const ERROR_EXPIRED_HANDLE: DWORD = 6854; +pub const ERROR_TRANSACTION_NOT_ENLISTED: DWORD = 6855; +pub const ERROR_CTX_WINSTATION_NAME_INVALID: DWORD = 7001; +pub const ERROR_CTX_INVALID_PD: DWORD = 7002; +pub const ERROR_CTX_PD_NOT_FOUND: DWORD = 7003; +pub const ERROR_CTX_WD_NOT_FOUND: DWORD = 7004; +pub const ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY: DWORD = 7005; +pub const ERROR_CTX_SERVICE_NAME_COLLISION: DWORD = 7006; +pub const ERROR_CTX_CLOSE_PENDING: DWORD = 7007; +pub const ERROR_CTX_NO_OUTBUF: DWORD = 7008; +pub const ERROR_CTX_MODEM_INF_NOT_FOUND: DWORD = 7009; +pub const ERROR_CTX_INVALID_MODEMNAME: DWORD = 7010; +pub const ERROR_CTX_MODEM_RESPONSE_ERROR: DWORD = 7011; +pub const ERROR_CTX_MODEM_RESPONSE_TIMEOUT: DWORD = 7012; +pub const ERROR_CTX_MODEM_RESPONSE_NO_CARRIER: DWORD = 7013; +pub const ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE: DWORD = 7014; +pub const ERROR_CTX_MODEM_RESPONSE_BUSY: DWORD = 7015; +pub const ERROR_CTX_MODEM_RESPONSE_VOICE: DWORD = 7016; +pub const ERROR_CTX_TD_ERROR: DWORD = 7017; +pub const ERROR_CTX_WINSTATION_NOT_FOUND: DWORD = 7022; +pub const ERROR_CTX_WINSTATION_ALREADY_EXISTS: DWORD = 7023; +pub const ERROR_CTX_WINSTATION_BUSY: DWORD = 7024; +pub const ERROR_CTX_BAD_VIDEO_MODE: DWORD = 7025; +pub const ERROR_CTX_GRAPHICS_INVALID: DWORD = 7035; +pub const ERROR_CTX_LOGON_DISABLED: DWORD = 7037; +pub const ERROR_CTX_NOT_CONSOLE: DWORD = 7038; +pub const ERROR_CTX_CLIENT_QUERY_TIMEOUT: DWORD = 7040; +pub const ERROR_CTX_CONSOLE_DISCONNECT: DWORD = 7041; +pub const ERROR_CTX_CONSOLE_CONNECT: DWORD = 7042; +pub const ERROR_CTX_SHADOW_DENIED: DWORD = 7044; +pub const ERROR_CTX_WINSTATION_ACCESS_DENIED: DWORD = 7045; +pub const ERROR_CTX_INVALID_WD: DWORD = 7049; +pub const ERROR_CTX_SHADOW_INVALID: DWORD = 7050; +pub const ERROR_CTX_SHADOW_DISABLED: DWORD = 7051; +pub const ERROR_CTX_CLIENT_LICENSE_IN_USE: DWORD = 7052; +pub const ERROR_CTX_CLIENT_LICENSE_NOT_SET: DWORD = 7053; +pub const ERROR_CTX_LICENSE_NOT_AVAILABLE: DWORD = 7054; +pub const ERROR_CTX_LICENSE_CLIENT_INVALID: DWORD = 7055; +pub const ERROR_CTX_LICENSE_EXPIRED: DWORD = 7056; +pub const ERROR_CTX_SHADOW_NOT_RUNNING: DWORD = 7057; +pub const ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE: DWORD = 7058; +pub const ERROR_ACTIVATION_COUNT_EXCEEDED: DWORD = 7059; +pub const ERROR_CTX_WINSTATIONS_DISABLED: DWORD = 7060; +pub const ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED: DWORD = 7061; +pub const ERROR_CTX_SESSION_IN_USE: DWORD = 7062; +pub const ERROR_CTX_NO_FORCE_LOGOFF: DWORD = 7063; +pub const ERROR_CTX_ACCOUNT_RESTRICTION: DWORD = 7064; +pub const ERROR_RDP_PROTOCOL_ERROR: DWORD = 7065; +pub const ERROR_CTX_CDM_CONNECT: DWORD = 7066; +pub const ERROR_CTX_CDM_DISCONNECT: DWORD = 7067; +pub const ERROR_CTX_SECURITY_LAYER_ERROR: DWORD = 7068; +pub const ERROR_TS_INCOMPATIBLE_SESSIONS: DWORD = 7069; +pub const ERROR_TS_VIDEO_SUBSYSTEM_ERROR: DWORD = 7070; +pub const FRS_ERR_INVALID_API_SEQUENCE: DWORD = 8001; +pub const FRS_ERR_STARTING_SERVICE: DWORD = 8002; +pub const FRS_ERR_STOPPING_SERVICE: DWORD = 8003; +pub const FRS_ERR_INTERNAL_API: DWORD = 8004; +pub const FRS_ERR_INTERNAL: DWORD = 8005; +pub const FRS_ERR_SERVICE_COMM: DWORD = 8006; +pub const FRS_ERR_INSUFFICIENT_PRIV: DWORD = 8007; +pub const FRS_ERR_AUTHENTICATION: DWORD = 8008; +pub const FRS_ERR_PARENT_INSUFFICIENT_PRIV: DWORD = 8009; +pub const FRS_ERR_PARENT_AUTHENTICATION: DWORD = 8010; +pub const FRS_ERR_CHILD_TO_PARENT_COMM: DWORD = 8011; +pub const FRS_ERR_PARENT_TO_CHILD_COMM: DWORD = 8012; +pub const FRS_ERR_SYSVOL_POPULATE: DWORD = 8013; +pub const FRS_ERR_SYSVOL_POPULATE_TIMEOUT: DWORD = 8014; +pub const FRS_ERR_SYSVOL_IS_BUSY: DWORD = 8015; +pub const FRS_ERR_SYSVOL_DEMOTE: DWORD = 8016; +pub const FRS_ERR_INVALID_SERVICE_PARAMETER: DWORD = 8017; +pub const DS_S_SUCCESS: DWORD = NO_ERROR; +pub const ERROR_DS_NOT_INSTALLED: DWORD = 8200; +pub const ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY: DWORD = 8201; +pub const ERROR_DS_NO_ATTRIBUTE_OR_VALUE: DWORD = 8202; +pub const ERROR_DS_INVALID_ATTRIBUTE_SYNTAX: DWORD = 8203; +pub const ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED: DWORD = 8204; +pub const ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS: DWORD = 8205; +pub const ERROR_DS_BUSY: DWORD = 8206; +pub const ERROR_DS_UNAVAILABLE: DWORD = 8207; +pub const ERROR_DS_NO_RIDS_ALLOCATED: DWORD = 8208; +pub const ERROR_DS_NO_MORE_RIDS: DWORD = 8209; +pub const ERROR_DS_INCORRECT_ROLE_OWNER: DWORD = 8210; +pub const ERROR_DS_RIDMGR_INIT_ERROR: DWORD = 8211; +pub const ERROR_DS_OBJ_CLASS_VIOLATION: DWORD = 8212; +pub const ERROR_DS_CANT_ON_NON_LEAF: DWORD = 8213; +pub const ERROR_DS_CANT_ON_RDN: DWORD = 8214; +pub const ERROR_DS_CANT_MOD_OBJ_CLASS: DWORD = 8215; +pub const ERROR_DS_CROSS_DOM_MOVE_ERROR: DWORD = 8216; +pub const ERROR_DS_GC_NOT_AVAILABLE: DWORD = 8217; +pub const ERROR_SHARED_POLICY: DWORD = 8218; +pub const ERROR_POLICY_OBJECT_NOT_FOUND: DWORD = 8219; +pub const ERROR_POLICY_ONLY_IN_DS: DWORD = 8220; +pub const ERROR_PROMOTION_ACTIVE: DWORD = 8221; +pub const ERROR_NO_PROMOTION_ACTIVE: DWORD = 8222; +pub const ERROR_DS_OPERATIONS_ERROR: DWORD = 8224; +pub const ERROR_DS_PROTOCOL_ERROR: DWORD = 8225; +pub const ERROR_DS_TIMELIMIT_EXCEEDED: DWORD = 8226; +pub const ERROR_DS_SIZELIMIT_EXCEEDED: DWORD = 8227; +pub const ERROR_DS_ADMIN_LIMIT_EXCEEDED: DWORD = 8228; +pub const ERROR_DS_COMPARE_FALSE: DWORD = 8229; +pub const ERROR_DS_COMPARE_TRUE: DWORD = 8230; +pub const ERROR_DS_AUTH_METHOD_NOT_SUPPORTED: DWORD = 8231; +pub const ERROR_DS_STRONG_AUTH_REQUIRED: DWORD = 8232; +pub const ERROR_DS_INAPPROPRIATE_AUTH: DWORD = 8233; +pub const ERROR_DS_AUTH_UNKNOWN: DWORD = 8234; +pub const ERROR_DS_REFERRAL: DWORD = 8235; +pub const ERROR_DS_UNAVAILABLE_CRIT_EXTENSION: DWORD = 8236; +pub const ERROR_DS_CONFIDENTIALITY_REQUIRED: DWORD = 8237; +pub const ERROR_DS_INAPPROPRIATE_MATCHING: DWORD = 8238; +pub const ERROR_DS_CONSTRAINT_VIOLATION: DWORD = 8239; +pub const ERROR_DS_NO_SUCH_OBJECT: DWORD = 8240; +pub const ERROR_DS_ALIAS_PROBLEM: DWORD = 8241; +pub const ERROR_DS_INVALID_DN_SYNTAX: DWORD = 8242; +pub const ERROR_DS_IS_LEAF: DWORD = 8243; +pub const ERROR_DS_ALIAS_DEREF_PROBLEM: DWORD = 8244; +pub const ERROR_DS_UNWILLING_TO_PERFORM: DWORD = 8245; +pub const ERROR_DS_LOOP_DETECT: DWORD = 8246; +pub const ERROR_DS_NAMING_VIOLATION: DWORD = 8247; +pub const ERROR_DS_OBJECT_RESULTS_TOO_LARGE: DWORD = 8248; +pub const ERROR_DS_AFFECTS_MULTIPLE_DSAS: DWORD = 8249; +pub const ERROR_DS_SERVER_DOWN: DWORD = 8250; +pub const ERROR_DS_LOCAL_ERROR: DWORD = 8251; +pub const ERROR_DS_ENCODING_ERROR: DWORD = 8252; +pub const ERROR_DS_DECODING_ERROR: DWORD = 8253; +pub const ERROR_DS_FILTER_UNKNOWN: DWORD = 8254; +pub const ERROR_DS_PARAM_ERROR: DWORD = 8255; +pub const ERROR_DS_NOT_SUPPORTED: DWORD = 8256; +pub const ERROR_DS_NO_RESULTS_RETURNED: DWORD = 8257; +pub const ERROR_DS_CONTROL_NOT_FOUND: DWORD = 8258; +pub const ERROR_DS_CLIENT_LOOP: DWORD = 8259; +pub const ERROR_DS_REFERRAL_LIMIT_EXCEEDED: DWORD = 8260; +pub const ERROR_DS_SORT_CONTROL_MISSING: DWORD = 8261; +pub const ERROR_DS_OFFSET_RANGE_ERROR: DWORD = 8262; +pub const ERROR_DS_RIDMGR_DISABLED: DWORD = 8263; +pub const ERROR_DS_ROOT_MUST_BE_NC: DWORD = 8301; +pub const ERROR_DS_ADD_REPLICA_INHIBITED: DWORD = 8302; +pub const ERROR_DS_ATT_NOT_DEF_IN_SCHEMA: DWORD = 8303; +pub const ERROR_DS_MAX_OBJ_SIZE_EXCEEDED: DWORD = 8304; +pub const ERROR_DS_OBJ_STRING_NAME_EXISTS: DWORD = 8305; +pub const ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA: DWORD = 8306; +pub const ERROR_DS_RDN_DOESNT_MATCH_SCHEMA: DWORD = 8307; +pub const ERROR_DS_NO_REQUESTED_ATTS_FOUND: DWORD = 8308; +pub const ERROR_DS_USER_BUFFER_TO_SMALL: DWORD = 8309; +pub const ERROR_DS_ATT_IS_NOT_ON_OBJ: DWORD = 8310; +pub const ERROR_DS_ILLEGAL_MOD_OPERATION: DWORD = 8311; +pub const ERROR_DS_OBJ_TOO_LARGE: DWORD = 8312; +pub const ERROR_DS_BAD_INSTANCE_TYPE: DWORD = 8313; +pub const ERROR_DS_MASTERDSA_REQUIRED: DWORD = 8314; +pub const ERROR_DS_OBJECT_CLASS_REQUIRED: DWORD = 8315; +pub const ERROR_DS_MISSING_REQUIRED_ATT: DWORD = 8316; +pub const ERROR_DS_ATT_NOT_DEF_FOR_CLASS: DWORD = 8317; +pub const ERROR_DS_ATT_ALREADY_EXISTS: DWORD = 8318; +pub const ERROR_DS_CANT_ADD_ATT_VALUES: DWORD = 8320; +pub const ERROR_DS_SINGLE_VALUE_CONSTRAINT: DWORD = 8321; +pub const ERROR_DS_RANGE_CONSTRAINT: DWORD = 8322; +pub const ERROR_DS_ATT_VAL_ALREADY_EXISTS: DWORD = 8323; +pub const ERROR_DS_CANT_REM_MISSING_ATT: DWORD = 8324; +pub const ERROR_DS_CANT_REM_MISSING_ATT_VAL: DWORD = 8325; +pub const ERROR_DS_ROOT_CANT_BE_SUBREF: DWORD = 8326; +pub const ERROR_DS_NO_CHAINING: DWORD = 8327; +pub const ERROR_DS_NO_CHAINED_EVAL: DWORD = 8328; +pub const ERROR_DS_NO_PARENT_OBJECT: DWORD = 8329; +pub const ERROR_DS_PARENT_IS_AN_ALIAS: DWORD = 8330; +pub const ERROR_DS_CANT_MIX_MASTER_AND_REPS: DWORD = 8331; +pub const ERROR_DS_CHILDREN_EXIST: DWORD = 8332; +pub const ERROR_DS_OBJ_NOT_FOUND: DWORD = 8333; +pub const ERROR_DS_ALIASED_OBJ_MISSING: DWORD = 8334; +pub const ERROR_DS_BAD_NAME_SYNTAX: DWORD = 8335; +pub const ERROR_DS_ALIAS_POINTS_TO_ALIAS: DWORD = 8336; +pub const ERROR_DS_CANT_DEREF_ALIAS: DWORD = 8337; +pub const ERROR_DS_OUT_OF_SCOPE: DWORD = 8338; +pub const ERROR_DS_OBJECT_BEING_REMOVED: DWORD = 8339; +pub const ERROR_DS_CANT_DELETE_DSA_OBJ: DWORD = 8340; +pub const ERROR_DS_GENERIC_ERROR: DWORD = 8341; +pub const ERROR_DS_DSA_MUST_BE_INT_MASTER: DWORD = 8342; +pub const ERROR_DS_CLASS_NOT_DSA: DWORD = 8343; +pub const ERROR_DS_INSUFF_ACCESS_RIGHTS: DWORD = 8344; +pub const ERROR_DS_ILLEGAL_SUPERIOR: DWORD = 8345; +pub const ERROR_DS_ATTRIBUTE_OWNED_BY_SAM: DWORD = 8346; +pub const ERROR_DS_NAME_TOO_MANY_PARTS: DWORD = 8347; +pub const ERROR_DS_NAME_TOO_LONG: DWORD = 8348; +pub const ERROR_DS_NAME_VALUE_TOO_LONG: DWORD = 8349; +pub const ERROR_DS_NAME_UNPARSEABLE: DWORD = 8350; +pub const ERROR_DS_NAME_TYPE_UNKNOWN: DWORD = 8351; +pub const ERROR_DS_NOT_AN_OBJECT: DWORD = 8352; +pub const ERROR_DS_SEC_DESC_TOO_SHORT: DWORD = 8353; +pub const ERROR_DS_SEC_DESC_INVALID: DWORD = 8354; +pub const ERROR_DS_NO_DELETED_NAME: DWORD = 8355; +pub const ERROR_DS_SUBREF_MUST_HAVE_PARENT: DWORD = 8356; +pub const ERROR_DS_NCNAME_MUST_BE_NC: DWORD = 8357; +pub const ERROR_DS_CANT_ADD_SYSTEM_ONLY: DWORD = 8358; +pub const ERROR_DS_CLASS_MUST_BE_CONCRETE: DWORD = 8359; +pub const ERROR_DS_INVALID_DMD: DWORD = 8360; +pub const ERROR_DS_OBJ_GUID_EXISTS: DWORD = 8361; +pub const ERROR_DS_NOT_ON_BACKLINK: DWORD = 8362; +pub const ERROR_DS_NO_CROSSREF_FOR_NC: DWORD = 8363; +pub const ERROR_DS_SHUTTING_DOWN: DWORD = 8364; +pub const ERROR_DS_UNKNOWN_OPERATION: DWORD = 8365; +pub const ERROR_DS_INVALID_ROLE_OWNER: DWORD = 8366; +pub const ERROR_DS_COULDNT_CONTACT_FSMO: DWORD = 8367; +pub const ERROR_DS_CROSS_NC_DN_RENAME: DWORD = 8368; +pub const ERROR_DS_CANT_MOD_SYSTEM_ONLY: DWORD = 8369; +pub const ERROR_DS_REPLICATOR_ONLY: DWORD = 8370; +pub const ERROR_DS_OBJ_CLASS_NOT_DEFINED: DWORD = 8371; +pub const ERROR_DS_OBJ_CLASS_NOT_SUBCLASS: DWORD = 8372; +pub const ERROR_DS_NAME_REFERENCE_INVALID: DWORD = 8373; +pub const ERROR_DS_CROSS_REF_EXISTS: DWORD = 8374; +pub const ERROR_DS_CANT_DEL_MASTER_CROSSREF: DWORD = 8375; +pub const ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD: DWORD = 8376; +pub const ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX: DWORD = 8377; +pub const ERROR_DS_DUP_RDN: DWORD = 8378; +pub const ERROR_DS_DUP_OID: DWORD = 8379; +pub const ERROR_DS_DUP_MAPI_ID: DWORD = 8380; +pub const ERROR_DS_DUP_SCHEMA_ID_GUID: DWORD = 8381; +pub const ERROR_DS_DUP_LDAP_DISPLAY_NAME: DWORD = 8382; +pub const ERROR_DS_SEMANTIC_ATT_TEST: DWORD = 8383; +pub const ERROR_DS_SYNTAX_MISMATCH: DWORD = 8384; +pub const ERROR_DS_EXISTS_IN_MUST_HAVE: DWORD = 8385; +pub const ERROR_DS_EXISTS_IN_MAY_HAVE: DWORD = 8386; +pub const ERROR_DS_NONEXISTENT_MAY_HAVE: DWORD = 8387; +pub const ERROR_DS_NONEXISTENT_MUST_HAVE: DWORD = 8388; +pub const ERROR_DS_AUX_CLS_TEST_FAIL: DWORD = 8389; +pub const ERROR_DS_NONEXISTENT_POSS_SUP: DWORD = 8390; +pub const ERROR_DS_SUB_CLS_TEST_FAIL: DWORD = 8391; +pub const ERROR_DS_BAD_RDN_ATT_ID_SYNTAX: DWORD = 8392; +pub const ERROR_DS_EXISTS_IN_AUX_CLS: DWORD = 8393; +pub const ERROR_DS_EXISTS_IN_SUB_CLS: DWORD = 8394; +pub const ERROR_DS_EXISTS_IN_POSS_SUP: DWORD = 8395; +pub const ERROR_DS_RECALCSCHEMA_FAILED: DWORD = 8396; +pub const ERROR_DS_TREE_DELETE_NOT_FINISHED: DWORD = 8397; +pub const ERROR_DS_CANT_DELETE: DWORD = 8398; +pub const ERROR_DS_ATT_SCHEMA_REQ_ID: DWORD = 8399; +pub const ERROR_DS_BAD_ATT_SCHEMA_SYNTAX: DWORD = 8400; +pub const ERROR_DS_CANT_CACHE_ATT: DWORD = 8401; +pub const ERROR_DS_CANT_CACHE_CLASS: DWORD = 8402; +pub const ERROR_DS_CANT_REMOVE_ATT_CACHE: DWORD = 8403; +pub const ERROR_DS_CANT_REMOVE_CLASS_CACHE: DWORD = 8404; +pub const ERROR_DS_CANT_RETRIEVE_DN: DWORD = 8405; +pub const ERROR_DS_MISSING_SUPREF: DWORD = 8406; +pub const ERROR_DS_CANT_RETRIEVE_INSTANCE: DWORD = 8407; +pub const ERROR_DS_CODE_INCONSISTENCY: DWORD = 8408; +pub const ERROR_DS_DATABASE_ERROR: DWORD = 8409; +pub const ERROR_DS_GOVERNSID_MISSING: DWORD = 8410; +pub const ERROR_DS_MISSING_EXPECTED_ATT: DWORD = 8411; +pub const ERROR_DS_NCNAME_MISSING_CR_REF: DWORD = 8412; +pub const ERROR_DS_SECURITY_CHECKING_ERROR: DWORD = 8413; +pub const ERROR_DS_SCHEMA_NOT_LOADED: DWORD = 8414; +pub const ERROR_DS_SCHEMA_ALLOC_FAILED: DWORD = 8415; +pub const ERROR_DS_ATT_SCHEMA_REQ_SYNTAX: DWORD = 8416; +pub const ERROR_DS_GCVERIFY_ERROR: DWORD = 8417; +pub const ERROR_DS_DRA_SCHEMA_MISMATCH: DWORD = 8418; +pub const ERROR_DS_CANT_FIND_DSA_OBJ: DWORD = 8419; +pub const ERROR_DS_CANT_FIND_EXPECTED_NC: DWORD = 8420; +pub const ERROR_DS_CANT_FIND_NC_IN_CACHE: DWORD = 8421; +pub const ERROR_DS_CANT_RETRIEVE_CHILD: DWORD = 8422; +pub const ERROR_DS_SECURITY_ILLEGAL_MODIFY: DWORD = 8423; +pub const ERROR_DS_CANT_REPLACE_HIDDEN_REC: DWORD = 8424; +pub const ERROR_DS_BAD_HIERARCHY_FILE: DWORD = 8425; +pub const ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED: DWORD = 8426; +pub const ERROR_DS_CONFIG_PARAM_MISSING: DWORD = 8427; +pub const ERROR_DS_COUNTING_AB_INDICES_FAILED: DWORD = 8428; +pub const ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED: DWORD = 8429; +pub const ERROR_DS_INTERNAL_FAILURE: DWORD = 8430; +pub const ERROR_DS_UNKNOWN_ERROR: DWORD = 8431; +pub const ERROR_DS_ROOT_REQUIRES_CLASS_TOP: DWORD = 8432; +pub const ERROR_DS_REFUSING_FSMO_ROLES: DWORD = 8433; +pub const ERROR_DS_MISSING_FSMO_SETTINGS: DWORD = 8434; +pub const ERROR_DS_UNABLE_TO_SURRENDER_ROLES: DWORD = 8435; +pub const ERROR_DS_DRA_GENERIC: DWORD = 8436; +pub const ERROR_DS_DRA_INVALID_PARAMETER: DWORD = 8437; +pub const ERROR_DS_DRA_BUSY: DWORD = 8438; +pub const ERROR_DS_DRA_BAD_DN: DWORD = 8439; +pub const ERROR_DS_DRA_BAD_NC: DWORD = 8440; +pub const ERROR_DS_DRA_DN_EXISTS: DWORD = 8441; +pub const ERROR_DS_DRA_INTERNAL_ERROR: DWORD = 8442; +pub const ERROR_DS_DRA_INCONSISTENT_DIT: DWORD = 8443; +pub const ERROR_DS_DRA_CONNECTION_FAILED: DWORD = 8444; +pub const ERROR_DS_DRA_BAD_INSTANCE_TYPE: DWORD = 8445; +pub const ERROR_DS_DRA_OUT_OF_MEM: DWORD = 8446; +pub const ERROR_DS_DRA_MAIL_PROBLEM: DWORD = 8447; +pub const ERROR_DS_DRA_REF_ALREADY_EXISTS: DWORD = 8448; +pub const ERROR_DS_DRA_REF_NOT_FOUND: DWORD = 8449; +pub const ERROR_DS_DRA_OBJ_IS_REP_SOURCE: DWORD = 8450; +pub const ERROR_DS_DRA_DB_ERROR: DWORD = 8451; +pub const ERROR_DS_DRA_NO_REPLICA: DWORD = 8452; +pub const ERROR_DS_DRA_ACCESS_DENIED: DWORD = 8453; +pub const ERROR_DS_DRA_NOT_SUPPORTED: DWORD = 8454; +pub const ERROR_DS_DRA_RPC_CANCELLED: DWORD = 8455; +pub const ERROR_DS_DRA_SOURCE_DISABLED: DWORD = 8456; +pub const ERROR_DS_DRA_SINK_DISABLED: DWORD = 8457; +pub const ERROR_DS_DRA_NAME_COLLISION: DWORD = 8458; +pub const ERROR_DS_DRA_SOURCE_REINSTALLED: DWORD = 8459; +pub const ERROR_DS_DRA_MISSING_PARENT: DWORD = 8460; +pub const ERROR_DS_DRA_PREEMPTED: DWORD = 8461; +pub const ERROR_DS_DRA_ABANDON_SYNC: DWORD = 8462; +pub const ERROR_DS_DRA_SHUTDOWN: DWORD = 8463; +pub const ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET: DWORD = 8464; +pub const ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA: DWORD = 8465; +pub const ERROR_DS_DRA_EXTN_CONNECTION_FAILED: DWORD = 8466; +pub const ERROR_DS_INSTALL_SCHEMA_MISMATCH: DWORD = 8467; +pub const ERROR_DS_DUP_LINK_ID: DWORD = 8468; +pub const ERROR_DS_NAME_ERROR_RESOLVING: DWORD = 8469; +pub const ERROR_DS_NAME_ERROR_NOT_FOUND: DWORD = 8470; +pub const ERROR_DS_NAME_ERROR_NOT_UNIQUE: DWORD = 8471; +pub const ERROR_DS_NAME_ERROR_NO_MAPPING: DWORD = 8472; +pub const ERROR_DS_NAME_ERROR_DOMAIN_ONLY: DWORD = 8473; +pub const ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING: DWORD = 8474; +pub const ERROR_DS_CONSTRUCTED_ATT_MOD: DWORD = 8475; +pub const ERROR_DS_WRONG_OM_OBJ_CLASS: DWORD = 8476; +pub const ERROR_DS_DRA_REPL_PENDING: DWORD = 8477; +pub const ERROR_DS_DS_REQUIRED: DWORD = 8478; +pub const ERROR_DS_INVALID_LDAP_DISPLAY_NAME: DWORD = 8479; +pub const ERROR_DS_NON_BASE_SEARCH: DWORD = 8480; +pub const ERROR_DS_CANT_RETRIEVE_ATTS: DWORD = 8481; +pub const ERROR_DS_BACKLINK_WITHOUT_LINK: DWORD = 8482; +pub const ERROR_DS_EPOCH_MISMATCH: DWORD = 8483; +pub const ERROR_DS_SRC_NAME_MISMATCH: DWORD = 8484; +pub const ERROR_DS_SRC_AND_DST_NC_IDENTICAL: DWORD = 8485; +pub const ERROR_DS_DST_NC_MISMATCH: DWORD = 8486; +pub const ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC: DWORD = 8487; +pub const ERROR_DS_SRC_GUID_MISMATCH: DWORD = 8488; +pub const ERROR_DS_CANT_MOVE_DELETED_OBJECT: DWORD = 8489; +pub const ERROR_DS_PDC_OPERATION_IN_PROGRESS: DWORD = 8490; +pub const ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD: DWORD = 8491; +pub const ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION: DWORD = 8492; +pub const ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS: DWORD = 8493; +pub const ERROR_DS_NC_MUST_HAVE_NC_PARENT: DWORD = 8494; +pub const ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE: DWORD = 8495; +pub const ERROR_DS_DST_DOMAIN_NOT_NATIVE: DWORD = 8496; +pub const ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER: DWORD = 8497; +pub const ERROR_DS_CANT_MOVE_ACCOUNT_GROUP: DWORD = 8498; +pub const ERROR_DS_CANT_MOVE_RESOURCE_GROUP: DWORD = 8499; +pub const ERROR_DS_INVALID_SEARCH_FLAG: DWORD = 8500; +pub const ERROR_DS_NO_TREE_DELETE_ABOVE_NC: DWORD = 8501; +pub const ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE: DWORD = 8502; +pub const ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE: DWORD = 8503; +pub const ERROR_DS_SAM_INIT_FAILURE: DWORD = 8504; +pub const ERROR_DS_SENSITIVE_GROUP_VIOLATION: DWORD = 8505; +pub const ERROR_DS_CANT_MOD_PRIMARYGROUPID: DWORD = 8506; +pub const ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD: DWORD = 8507; +pub const ERROR_DS_NONSAFE_SCHEMA_CHANGE: DWORD = 8508; +pub const ERROR_DS_SCHEMA_UPDATE_DISALLOWED: DWORD = 8509; +pub const ERROR_DS_CANT_CREATE_UNDER_SCHEMA: DWORD = 8510; +pub const ERROR_DS_INSTALL_NO_SRC_SCH_VERSION: DWORD = 8511; +pub const ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE: DWORD = 8512; +pub const ERROR_DS_INVALID_GROUP_TYPE: DWORD = 8513; +pub const ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN: DWORD = 8514; +pub const ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN: DWORD = 8515; +pub const ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER: DWORD = 8516; +pub const ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER: DWORD = 8517; +pub const ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER: DWORD = 8518; +pub const ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER: DWORD = 8519; +pub const ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER: DWORD = 8520; +pub const ERROR_DS_HAVE_PRIMARY_MEMBERS: DWORD = 8521; +pub const ERROR_DS_STRING_SD_CONVERSION_FAILED: DWORD = 8522; +pub const ERROR_DS_NAMING_MASTER_GC: DWORD = 8523; +pub const ERROR_DS_DNS_LOOKUP_FAILURE: DWORD = 8524; +pub const ERROR_DS_COULDNT_UPDATE_SPNS: DWORD = 8525; +pub const ERROR_DS_CANT_RETRIEVE_SD: DWORD = 8526; +pub const ERROR_DS_KEY_NOT_UNIQUE: DWORD = 8527; +pub const ERROR_DS_WRONG_LINKED_ATT_SYNTAX: DWORD = 8528; +pub const ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD: DWORD = 8529; +pub const ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY: DWORD = 8530; +pub const ERROR_DS_CANT_START: DWORD = 8531; +pub const ERROR_DS_INIT_FAILURE: DWORD = 8532; +pub const ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION: DWORD = 8533; +pub const ERROR_DS_SOURCE_DOMAIN_IN_FOREST: DWORD = 8534; +pub const ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST: DWORD = 8535; +pub const ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED: DWORD = 8536; +pub const ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN: DWORD = 8537; +pub const ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER: DWORD = 8538; +pub const ERROR_DS_SRC_SID_EXISTS_IN_FOREST: DWORD = 8539; +pub const ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH: DWORD = 8540; +pub const ERROR_SAM_INIT_FAILURE: DWORD = 8541; +pub const ERROR_DS_DRA_SCHEMA_INFO_SHIP: DWORD = 8542; +pub const ERROR_DS_DRA_SCHEMA_CONFLICT: DWORD = 8543; +pub const ERROR_DS_DRA_EARLIER_SCHEMA_CONFLICT: DWORD = 8544; +pub const ERROR_DS_DRA_OBJ_NC_MISMATCH: DWORD = 8545; +pub const ERROR_DS_NC_STILL_HAS_DSAS: DWORD = 8546; +pub const ERROR_DS_GC_REQUIRED: DWORD = 8547; +pub const ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY: DWORD = 8548; +pub const ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS: DWORD = 8549; +pub const ERROR_DS_CANT_ADD_TO_GC: DWORD = 8550; +pub const ERROR_DS_NO_CHECKPOINT_WITH_PDC: DWORD = 8551; +pub const ERROR_DS_SOURCE_AUDITING_NOT_ENABLED: DWORD = 8552; +pub const ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC: DWORD = 8553; +pub const ERROR_DS_INVALID_NAME_FOR_SPN: DWORD = 8554; +pub const ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS: DWORD = 8555; +pub const ERROR_DS_UNICODEPWD_NOT_IN_QUOTES: DWORD = 8556; +pub const ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED: DWORD = 8557; +pub const ERROR_DS_MUST_BE_RUN_ON_DST_DC: DWORD = 8558; +pub const ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER: DWORD = 8559; +pub const ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ: DWORD = 8560; +pub const ERROR_DS_INIT_FAILURE_CONSOLE: DWORD = 8561; +pub const ERROR_DS_SAM_INIT_FAILURE_CONSOLE: DWORD = 8562; +pub const ERROR_DS_FOREST_VERSION_TOO_HIGH: DWORD = 8563; +pub const ERROR_DS_DOMAIN_VERSION_TOO_HIGH: DWORD = 8564; +pub const ERROR_DS_FOREST_VERSION_TOO_LOW: DWORD = 8565; +pub const ERROR_DS_DOMAIN_VERSION_TOO_LOW: DWORD = 8566; +pub const ERROR_DS_INCOMPATIBLE_VERSION: DWORD = 8567; +pub const ERROR_DS_LOW_DSA_VERSION: DWORD = 8568; +pub const ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN: DWORD = 8569; +pub const ERROR_DS_NOT_SUPPORTED_SORT_ORDER: DWORD = 8570; +pub const ERROR_DS_NAME_NOT_UNIQUE: DWORD = 8571; +pub const ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4: DWORD = 8572; +pub const ERROR_DS_OUT_OF_VERSION_STORE: DWORD = 8573; +pub const ERROR_DS_INCOMPATIBLE_CONTROLS_USED: DWORD = 8574; +pub const ERROR_DS_NO_REF_DOMAIN: DWORD = 8575; +pub const ERROR_DS_RESERVED_LINK_ID: DWORD = 8576; +pub const ERROR_DS_LINK_ID_NOT_AVAILABLE: DWORD = 8577; +pub const ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER: DWORD = 8578; +pub const ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE: DWORD = 8579; +pub const ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC: DWORD = 8580; +pub const ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG: DWORD = 8581; +pub const ERROR_DS_MODIFYDN_WRONG_GRANDPARENT: DWORD = 8582; +pub const ERROR_DS_NAME_ERROR_TRUST_REFERRAL: DWORD = 8583; +pub const ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER: DWORD = 8584; +pub const ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD: DWORD = 8585; +pub const ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2: DWORD = 8586; +pub const ERROR_DS_THREAD_LIMIT_EXCEEDED: DWORD = 8587; +pub const ERROR_DS_NOT_CLOSEST: DWORD = 8588; +pub const ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF: DWORD = 8589; +pub const ERROR_DS_SINGLE_USER_MODE_FAILED: DWORD = 8590; +pub const ERROR_DS_NTDSCRIPT_SYNTAX_ERROR: DWORD = 8591; +pub const ERROR_DS_NTDSCRIPT_PROCESS_ERROR: DWORD = 8592; +pub const ERROR_DS_DIFFERENT_REPL_EPOCHS: DWORD = 8593; +pub const ERROR_DS_DRS_EXTENSIONS_CHANGED: DWORD = 8594; +pub const ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR: DWORD = 8595; +pub const ERROR_DS_NO_MSDS_INTID: DWORD = 8596; +pub const ERROR_DS_DUP_MSDS_INTID: DWORD = 8597; +pub const ERROR_DS_EXISTS_IN_RDNATTID: DWORD = 8598; +pub const ERROR_DS_AUTHORIZATION_FAILED: DWORD = 8599; +pub const ERROR_DS_INVALID_SCRIPT: DWORD = 8600; +pub const ERROR_DS_REMOTE_CROSSREF_OP_FAILED: DWORD = 8601; +pub const ERROR_DS_CROSS_REF_BUSY: DWORD = 8602; +pub const ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN: DWORD = 8603; +pub const ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC: DWORD = 8604; +pub const ERROR_DS_DUPLICATE_ID_FOUND: DWORD = 8605; +pub const ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT: DWORD = 8606; +pub const ERROR_DS_GROUP_CONVERSION_ERROR: DWORD = 8607; +pub const ERROR_DS_CANT_MOVE_APP_BASIC_GROUP: DWORD = 8608; +pub const ERROR_DS_CANT_MOVE_APP_QUERY_GROUP: DWORD = 8609; +pub const ERROR_DS_ROLE_NOT_VERIFIED: DWORD = 8610; +pub const ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL: DWORD = 8611; +pub const ERROR_DS_DOMAIN_RENAME_IN_PROGRESS: DWORD = 8612; +pub const ERROR_DS_EXISTING_AD_CHILD_NC: DWORD = 8613; +pub const ERROR_DS_REPL_LIFETIME_EXCEEDED: DWORD = 8614; +pub const ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER: DWORD = 8615; +pub const ERROR_DS_LDAP_SEND_QUEUE_FULL: DWORD = 8616; +pub const ERROR_DS_DRA_OUT_SCHEDULE_WINDOW: DWORD = 8617; +pub const ERROR_DS_POLICY_NOT_KNOWN: DWORD = 8618; +pub const ERROR_NO_SITE_SETTINGS_OBJECT: DWORD = 8619; +pub const ERROR_NO_SECRETS: DWORD = 8620; +pub const ERROR_NO_WRITABLE_DC_FOUND: DWORD = 8621; +pub const ERROR_DS_NO_SERVER_OBJECT: DWORD = 8622; +pub const ERROR_DS_NO_NTDSA_OBJECT: DWORD = 8623; +pub const ERROR_DS_NON_ASQ_SEARCH: DWORD = 8624; +pub const ERROR_DS_AUDIT_FAILURE: DWORD = 8625; +pub const ERROR_DS_INVALID_SEARCH_FLAG_SUBTREE: DWORD = 8626; +pub const ERROR_DS_INVALID_SEARCH_FLAG_TUPLE: DWORD = 8627; +pub const ERROR_DS_HIERARCHY_TABLE_TOO_DEEP: DWORD = 8628; +pub const ERROR_DS_DRA_CORRUPT_UTD_VECTOR: DWORD = 8629; +pub const ERROR_DS_DRA_SECRETS_DENIED: DWORD = 8630; +pub const ERROR_DS_RESERVED_MAPI_ID: DWORD = 8631; +pub const ERROR_DS_MAPI_ID_NOT_AVAILABLE: DWORD = 8632; +pub const ERROR_DS_DRA_MISSING_KRBTGT_SECRET: DWORD = 8633; +pub const ERROR_DS_DOMAIN_NAME_EXISTS_IN_FOREST: DWORD = 8634; +pub const ERROR_DS_FLAT_NAME_EXISTS_IN_FOREST: DWORD = 8635; +pub const ERROR_INVALID_USER_PRINCIPAL_NAME: DWORD = 8636; +pub const ERROR_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS: DWORD = 8637; +pub const ERROR_DS_OID_NOT_FOUND: DWORD = 8638; +pub const ERROR_DS_DRA_RECYCLED_TARGET: DWORD = 8639; +pub const ERROR_DS_DISALLOWED_NC_REDIRECT: DWORD = 8640; +pub const ERROR_DS_HIGH_ADLDS_FFL: DWORD = 8641; +pub const ERROR_DS_HIGH_DSA_VERSION: DWORD = 8642; +pub const ERROR_DS_LOW_ADLDS_FFL: DWORD = 8643; +pub const ERROR_DOMAIN_SID_SAME_AS_LOCAL_WORKSTATION: DWORD = 8644; +pub const ERROR_DS_UNDELETE_SAM_VALIDATION_FAILED: DWORD = 8645; +pub const ERROR_INCORRECT_ACCOUNT_TYPE: DWORD = 8646; +pub const ERROR_DS_SPN_VALUE_NOT_UNIQUE_IN_FOREST: DWORD = 8647; +pub const ERROR_DS_UPN_VALUE_NOT_UNIQUE_IN_FOREST: DWORD = 8648; +pub const DNS_ERROR_RESPONSE_CODES_BASE: DWORD = 9000; +pub const DNS_ERROR_RCODE_NO_ERROR: DWORD = NO_ERROR; +pub const DNS_ERROR_MASK: DWORD = 0x00002328; +pub const DNS_ERROR_RCODE_FORMAT_ERROR: DWORD = 9001; +pub const DNS_ERROR_RCODE_SERVER_FAILURE: DWORD = 9002; +pub const DNS_ERROR_RCODE_NAME_ERROR: DWORD = 9003; +pub const DNS_ERROR_RCODE_NOT_IMPLEMENTED: DWORD = 9004; +pub const DNS_ERROR_RCODE_REFUSED: DWORD = 9005; +pub const DNS_ERROR_RCODE_YXDOMAIN: DWORD = 9006; +pub const DNS_ERROR_RCODE_YXRRSET: DWORD = 9007; +pub const DNS_ERROR_RCODE_NXRRSET: DWORD = 9008; +pub const DNS_ERROR_RCODE_NOTAUTH: DWORD = 9009; +pub const DNS_ERROR_RCODE_NOTZONE: DWORD = 9010; +pub const DNS_ERROR_RCODE_BADSIG: DWORD = 9016; +pub const DNS_ERROR_RCODE_BADKEY: DWORD = 9017; +pub const DNS_ERROR_RCODE_BADTIME: DWORD = 9018; +pub const DNS_ERROR_RCODE_LAST: DWORD = DNS_ERROR_RCODE_BADTIME; +pub const DNS_ERROR_DNSSEC_BASE: DWORD = 9100; +pub const DNS_ERROR_KEYMASTER_REQUIRED: DWORD = 9101; +pub const DNS_ERROR_NOT_ALLOWED_ON_SIGNED_ZONE: DWORD = 9102; +pub const DNS_ERROR_NSEC3_INCOMPATIBLE_WITH_RSA_SHA1: DWORD = 9103; +pub const DNS_ERROR_NOT_ENOUGH_SIGNING_KEY_DESCRIPTORS: DWORD = 9104; +pub const DNS_ERROR_UNSUPPORTED_ALGORITHM: DWORD = 9105; +pub const DNS_ERROR_INVALID_KEY_SIZE: DWORD = 9106; +pub const DNS_ERROR_SIGNING_KEY_NOT_ACCESSIBLE: DWORD = 9107; +pub const DNS_ERROR_KSP_DOES_NOT_SUPPORT_PROTECTION: DWORD = 9108; +pub const DNS_ERROR_UNEXPECTED_DATA_PROTECTION_ERROR: DWORD = 9109; +pub const DNS_ERROR_UNEXPECTED_CNG_ERROR: DWORD = 9110; +pub const DNS_ERROR_UNKNOWN_SIGNING_PARAMETER_VERSION: DWORD = 9111; +pub const DNS_ERROR_KSP_NOT_ACCESSIBLE: DWORD = 9112; +pub const DNS_ERROR_TOO_MANY_SKDS: DWORD = 9113; +pub const DNS_ERROR_INVALID_ROLLOVER_PERIOD: DWORD = 9114; +pub const DNS_ERROR_INVALID_INITIAL_ROLLOVER_OFFSET: DWORD = 9115; +pub const DNS_ERROR_ROLLOVER_IN_PROGRESS: DWORD = 9116; +pub const DNS_ERROR_STANDBY_KEY_NOT_PRESENT: DWORD = 9117; +pub const DNS_ERROR_NOT_ALLOWED_ON_ZSK: DWORD = 9118; +pub const DNS_ERROR_NOT_ALLOWED_ON_ACTIVE_SKD: DWORD = 9119; +pub const DNS_ERROR_ROLLOVER_ALREADY_QUEUED: DWORD = 9120; +pub const DNS_ERROR_NOT_ALLOWED_ON_UNSIGNED_ZONE: DWORD = 9121; +pub const DNS_ERROR_BAD_KEYMASTER: DWORD = 9122; +pub const DNS_ERROR_INVALID_SIGNATURE_VALIDITY_PERIOD: DWORD = 9123; +pub const DNS_ERROR_INVALID_NSEC3_ITERATION_COUNT: DWORD = 9124; +pub const DNS_ERROR_DNSSEC_IS_DISABLED: DWORD = 9125; +pub const DNS_ERROR_INVALID_XML: DWORD = 9126; +pub const DNS_ERROR_NO_VALID_TRUST_ANCHORS: DWORD = 9127; +pub const DNS_ERROR_ROLLOVER_NOT_POKEABLE: DWORD = 9128; +pub const DNS_ERROR_NSEC3_NAME_COLLISION: DWORD = 9129; +pub const DNS_ERROR_NSEC_INCOMPATIBLE_WITH_NSEC3_RSA_SHA1: DWORD = 9130; +pub const DNS_ERROR_PACKET_FMT_BASE: DWORD = 9500; +pub const DNS_INFO_NO_RECORDS: DWORD = 9501; +pub const DNS_ERROR_BAD_PACKET: DWORD = 9502; +pub const DNS_ERROR_NO_PACKET: DWORD = 9503; +pub const DNS_ERROR_RCODE: DWORD = 9504; +pub const DNS_ERROR_UNSECURE_PACKET: DWORD = 9505; +pub const DNS_STATUS_PACKET_UNSECURE: DWORD = DNS_ERROR_UNSECURE_PACKET; +pub const DNS_REQUEST_PENDING: DWORD = 9506; +pub const DNS_ERROR_NO_MEMORY: DWORD = ERROR_OUTOFMEMORY; +pub const DNS_ERROR_INVALID_NAME: DWORD = ERROR_INVALID_NAME; +pub const DNS_ERROR_INVALID_DATA: DWORD = ERROR_INVALID_DATA; +pub const DNS_ERROR_GENERAL_API_BASE: DWORD = 9550; +pub const DNS_ERROR_INVALID_TYPE: DWORD = 9551; +pub const DNS_ERROR_INVALID_IP_ADDRESS: DWORD = 9552; +pub const DNS_ERROR_INVALID_PROPERTY: DWORD = 9553; +pub const DNS_ERROR_TRY_AGAIN_LATER: DWORD = 9554; +pub const DNS_ERROR_NOT_UNIQUE: DWORD = 9555; +pub const DNS_ERROR_NON_RFC_NAME: DWORD = 9556; +pub const DNS_STATUS_FQDN: DWORD = 9557; +pub const DNS_STATUS_DOTTED_NAME: DWORD = 9558; +pub const DNS_STATUS_SINGLE_PART_NAME: DWORD = 9559; +pub const DNS_ERROR_INVALID_NAME_CHAR: DWORD = 9560; +pub const DNS_ERROR_NUMERIC_NAME: DWORD = 9561; +pub const DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER: DWORD = 9562; +pub const DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION: DWORD = 9563; +pub const DNS_ERROR_CANNOT_FIND_ROOT_HINTS: DWORD = 9564; +pub const DNS_ERROR_INCONSISTENT_ROOT_HINTS: DWORD = 9565; +pub const DNS_ERROR_DWORD_VALUE_TOO_SMALL: DWORD = 9566; +pub const DNS_ERROR_DWORD_VALUE_TOO_LARGE: DWORD = 9567; +pub const DNS_ERROR_BACKGROUND_LOADING: DWORD = 9568; +pub const DNS_ERROR_NOT_ALLOWED_ON_RODC: DWORD = 9569; +pub const DNS_ERROR_NOT_ALLOWED_UNDER_DNAME: DWORD = 9570; +pub const DNS_ERROR_DELEGATION_REQUIRED: DWORD = 9571; +pub const DNS_ERROR_INVALID_POLICY_TABLE: DWORD = 9572; +pub const DNS_ERROR_ZONE_BASE: DWORD = 9600; +pub const DNS_ERROR_ZONE_DOES_NOT_EXIST: DWORD = 9601; +pub const DNS_ERROR_NO_ZONE_INFO: DWORD = 9602; +pub const DNS_ERROR_INVALID_ZONE_OPERATION: DWORD = 9603; +pub const DNS_ERROR_ZONE_CONFIGURATION_ERROR: DWORD = 9604; +pub const DNS_ERROR_ZONE_HAS_NO_SOA_RECORD: DWORD = 9605; +pub const DNS_ERROR_ZONE_HAS_NO_NS_RECORDS: DWORD = 9606; +pub const DNS_ERROR_ZONE_LOCKED: DWORD = 9607; +pub const DNS_ERROR_ZONE_CREATION_FAILED: DWORD = 9608; +pub const DNS_ERROR_ZONE_ALREADY_EXISTS: DWORD = 9609; +pub const DNS_ERROR_AUTOZONE_ALREADY_EXISTS: DWORD = 9610; +pub const DNS_ERROR_INVALID_ZONE_TYPE: DWORD = 9611; +pub const DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP: DWORD = 9612; +pub const DNS_ERROR_ZONE_NOT_SECONDARY: DWORD = 9613; +pub const DNS_ERROR_NEED_SECONDARY_ADDRESSES: DWORD = 9614; +pub const DNS_ERROR_WINS_INIT_FAILED: DWORD = 9615; +pub const DNS_ERROR_NEED_WINS_SERVERS: DWORD = 9616; +pub const DNS_ERROR_NBSTAT_INIT_FAILED: DWORD = 9617; +pub const DNS_ERROR_SOA_DELETE_INVALID: DWORD = 9618; +pub const DNS_ERROR_FORWARDER_ALREADY_EXISTS: DWORD = 9619; +pub const DNS_ERROR_ZONE_REQUIRES_MASTER_IP: DWORD = 9620; +pub const DNS_ERROR_ZONE_IS_SHUTDOWN: DWORD = 9621; +pub const DNS_ERROR_ZONE_LOCKED_FOR_SIGNING: DWORD = 9622; +pub const DNS_ERROR_DATAFILE_BASE: DWORD = 9650; +pub const DNS_ERROR_PRIMARY_REQUIRES_DATAFILE: DWORD = 9651; +pub const DNS_ERROR_INVALID_DATAFILE_NAME: DWORD = 9652; +pub const DNS_ERROR_DATAFILE_OPEN_FAILURE: DWORD = 9653; +pub const DNS_ERROR_FILE_WRITEBACK_FAILED: DWORD = 9654; +pub const DNS_ERROR_DATAFILE_PARSING: DWORD = 9655; +pub const DNS_ERROR_DATABASE_BASE: DWORD = 9700; +pub const DNS_ERROR_RECORD_DOES_NOT_EXIST: DWORD = 9701; +pub const DNS_ERROR_RECORD_FORMAT: DWORD = 9702; +pub const DNS_ERROR_NODE_CREATION_FAILED: DWORD = 9703; +pub const DNS_ERROR_UNKNOWN_RECORD_TYPE: DWORD = 9704; +pub const DNS_ERROR_RECORD_TIMED_OUT: DWORD = 9705; +pub const DNS_ERROR_NAME_NOT_IN_ZONE: DWORD = 9706; +pub const DNS_ERROR_CNAME_LOOP: DWORD = 9707; +pub const DNS_ERROR_NODE_IS_CNAME: DWORD = 9708; +pub const DNS_ERROR_CNAME_COLLISION: DWORD = 9709; +pub const DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT: DWORD = 9710; +pub const DNS_ERROR_RECORD_ALREADY_EXISTS: DWORD = 9711; +pub const DNS_ERROR_SECONDARY_DATA: DWORD = 9712; +pub const DNS_ERROR_NO_CREATE_CACHE_DATA: DWORD = 9713; +pub const DNS_ERROR_NAME_DOES_NOT_EXIST: DWORD = 9714; +pub const DNS_WARNING_PTR_CREATE_FAILED: DWORD = 9715; +pub const DNS_WARNING_DOMAIN_UNDELETED: DWORD = 9716; +pub const DNS_ERROR_DS_UNAVAILABLE: DWORD = 9717; +pub const DNS_ERROR_DS_ZONE_ALREADY_EXISTS: DWORD = 9718; +pub const DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE: DWORD = 9719; +pub const DNS_ERROR_NODE_IS_DNAME: DWORD = 9720; +pub const DNS_ERROR_DNAME_COLLISION: DWORD = 9721; +pub const DNS_ERROR_ALIAS_LOOP: DWORD = 9722; +pub const DNS_ERROR_OPERATION_BASE: DWORD = 9750; +pub const DNS_INFO_AXFR_COMPLETE: DWORD = 9751; +pub const DNS_ERROR_AXFR: DWORD = 9752; +pub const DNS_INFO_ADDED_LOCAL_WINS: DWORD = 9753; +pub const DNS_ERROR_SECURE_BASE: DWORD = 9800; +pub const DNS_STATUS_CONTINUE_NEEDED: DWORD = 9801; +pub const DNS_ERROR_SETUP_BASE: DWORD = 9850; +pub const DNS_ERROR_NO_TCPIP: DWORD = 9851; +pub const DNS_ERROR_NO_DNS_SERVERS: DWORD = 9852; +pub const DNS_ERROR_DP_BASE: DWORD = 9900; +pub const DNS_ERROR_DP_DOES_NOT_EXIST: DWORD = 9901; +pub const DNS_ERROR_DP_ALREADY_EXISTS: DWORD = 9902; +pub const DNS_ERROR_DP_NOT_ENLISTED: DWORD = 9903; +pub const DNS_ERROR_DP_ALREADY_ENLISTED: DWORD = 9904; +pub const DNS_ERROR_DP_NOT_AVAILABLE: DWORD = 9905; +pub const DNS_ERROR_DP_FSMO_ERROR: DWORD = 9906; +pub const DNS_ERROR_ZONESCOPE_ALREADY_EXISTS: DWORD = 9951; +pub const DNS_ERROR_ZONESCOPE_DOES_NOT_EXIST: DWORD = 9952; +pub const DNS_ERROR_DEFAULT_ZONESCOPE: DWORD = 9953; +pub const DNS_ERROR_INVALID_ZONESCOPE_NAME: DWORD = 9954; +pub const DNS_ERROR_NOT_ALLOWED_WITH_ZONESCOPES: DWORD = 9955; +pub const DNS_ERROR_LOAD_ZONESCOPE_FAILED: DWORD = 9956; +pub const DNS_ERROR_ZONESCOPE_FILE_WRITEBACK_FAILED: DWORD = 9957; +pub const DNS_ERROR_INVALID_SCOPE_NAME: DWORD = 9958; +pub const DNS_ERROR_SCOPE_DOES_NOT_EXIST: DWORD = 9959; +pub const DNS_ERROR_DEFAULT_SCOPE: DWORD = 9960; +pub const DNS_ERROR_INVALID_SCOPE_OPERATION: DWORD = 9961; +pub const DNS_ERROR_SCOPE_LOCKED: DWORD = 9962; +pub const DNS_ERROR_SCOPE_ALREADY_EXISTS: DWORD = 9963; +pub const WSABASEERR: DWORD = 10000; +pub const WSAEINTR: DWORD = 10004; +pub const WSAEBADF: DWORD = 10009; +pub const WSAEACCES: DWORD = 10013; +pub const WSAEFAULT: DWORD = 10014; +pub const WSAEINVAL: DWORD = 10022; +pub const WSAEMFILE: DWORD = 10024; +pub const WSAEWOULDBLOCK: DWORD = 10035; +pub const WSAEINPROGRESS: DWORD = 10036; +pub const WSAEALREADY: DWORD = 10037; +pub const WSAENOTSOCK: DWORD = 10038; +pub const WSAEDESTADDRREQ: DWORD = 10039; +pub const WSAEMSGSIZE: DWORD = 10040; +pub const WSAEPROTOTYPE: DWORD = 10041; +pub const WSAENOPROTOOPT: DWORD = 10042; +pub const WSAEPROTONOSUPPORT: DWORD = 10043; +pub const WSAESOCKTNOSUPPORT: DWORD = 10044; +pub const WSAEOPNOTSUPP: DWORD = 10045; +pub const WSAEPFNOSUPPORT: DWORD = 10046; +pub const WSAEAFNOSUPPORT: DWORD = 10047; +pub const WSAEADDRINUSE: DWORD = 10048; +pub const WSAEADDRNOTAVAIL: DWORD = 10049; +pub const WSAENETDOWN: DWORD = 10050; +pub const WSAENETUNREACH: DWORD = 10051; +pub const WSAENETRESET: DWORD = 10052; +pub const WSAECONNABORTED: DWORD = 10053; +pub const WSAECONNRESET: DWORD = 10054; +pub const WSAENOBUFS: DWORD = 10055; +pub const WSAEISCONN: DWORD = 10056; +pub const WSAENOTCONN: DWORD = 10057; +pub const WSAESHUTDOWN: DWORD = 10058; +pub const WSAETOOMANYREFS: DWORD = 10059; +pub const WSAETIMEDOUT: DWORD = 10060; +pub const WSAECONNREFUSED: DWORD = 10061; +pub const WSAELOOP: DWORD = 10062; +pub const WSAENAMETOOLONG: DWORD = 10063; +pub const WSAEHOSTDOWN: DWORD = 10064; +pub const WSAEHOSTUNREACH: DWORD = 10065; +pub const WSAENOTEMPTY: DWORD = 10066; +pub const WSAEPROCLIM: DWORD = 10067; +pub const WSAEUSERS: DWORD = 10068; +pub const WSAEDQUOT: DWORD = 10069; +pub const WSAESTALE: DWORD = 10070; +pub const WSAEREMOTE: DWORD = 10071; +pub const WSASYSNOTREADY: DWORD = 10091; +pub const WSAVERNOTSUPPORTED: DWORD = 10092; +pub const WSANOTINITIALISED: DWORD = 10093; +pub const WSAEDISCON: DWORD = 10101; +pub const WSAENOMORE: DWORD = 10102; +pub const WSAECANCELLED: DWORD = 10103; +pub const WSAEINVALIDPROCTABLE: DWORD = 10104; +pub const WSAEINVALIDPROVIDER: DWORD = 10105; +pub const WSAEPROVIDERFAILEDINIT: DWORD = 10106; +pub const WSASYSCALLFAILURE: DWORD = 10107; +pub const WSASERVICE_NOT_FOUND: DWORD = 10108; +pub const WSATYPE_NOT_FOUND: DWORD = 10109; +pub const WSA_E_NO_MORE: DWORD = 10110; +pub const WSA_E_CANCELLED: DWORD = 10111; +pub const WSAEREFUSED: DWORD = 10112; +pub const WSAHOST_NOT_FOUND: DWORD = 11001; +pub const WSATRY_AGAIN: DWORD = 11002; +pub const WSANO_RECOVERY: DWORD = 11003; +pub const WSANO_DATA: DWORD = 11004; +pub const WSA_QOS_RECEIVERS: DWORD = 11005; +pub const WSA_QOS_SENDERS: DWORD = 11006; +pub const WSA_QOS_NO_SENDERS: DWORD = 11007; +pub const WSA_QOS_NO_RECEIVERS: DWORD = 11008; +pub const WSA_QOS_REQUEST_CONFIRMED: DWORD = 11009; +pub const WSA_QOS_ADMISSION_FAILURE: DWORD = 11010; +pub const WSA_QOS_POLICY_FAILURE: DWORD = 11011; +pub const WSA_QOS_BAD_STYLE: DWORD = 11012; +pub const WSA_QOS_BAD_OBJECT: DWORD = 11013; +pub const WSA_QOS_TRAFFIC_CTRL_ERROR: DWORD = 11014; +pub const WSA_QOS_GENERIC_ERROR: DWORD = 11015; +pub const WSA_QOS_ESERVICETYPE: DWORD = 11016; +pub const WSA_QOS_EFLOWSPEC: DWORD = 11017; +pub const WSA_QOS_EPROVSPECBUF: DWORD = 11018; +pub const WSA_QOS_EFILTERSTYLE: DWORD = 11019; +pub const WSA_QOS_EFILTERTYPE: DWORD = 11020; +pub const WSA_QOS_EFILTERCOUNT: DWORD = 11021; +pub const WSA_QOS_EOBJLENGTH: DWORD = 11022; +pub const WSA_QOS_EFLOWCOUNT: DWORD = 11023; +pub const WSA_QOS_EUNKOWNPSOBJ: DWORD = 11024; +pub const WSA_QOS_EPOLICYOBJ: DWORD = 11025; +pub const WSA_QOS_EFLOWDESC: DWORD = 11026; +pub const WSA_QOS_EPSFLOWSPEC: DWORD = 11027; +pub const WSA_QOS_EPSFILTERSPEC: DWORD = 11028; +pub const WSA_QOS_ESDMODEOBJ: DWORD = 11029; +pub const WSA_QOS_ESHAPERATEOBJ: DWORD = 11030; +pub const WSA_QOS_RESERVED_PETYPE: DWORD = 11031; +pub const WSA_SECURE_HOST_NOT_FOUND: DWORD = 11032; +pub const WSA_IPSEC_NAME_POLICY_ERROR: DWORD = 11033; +pub const ERROR_IPSEC_QM_POLICY_EXISTS: DWORD = 13000; +pub const ERROR_IPSEC_QM_POLICY_NOT_FOUND: DWORD = 13001; +pub const ERROR_IPSEC_QM_POLICY_IN_USE: DWORD = 13002; +pub const ERROR_IPSEC_MM_POLICY_EXISTS: DWORD = 13003; +pub const ERROR_IPSEC_MM_POLICY_NOT_FOUND: DWORD = 13004; +pub const ERROR_IPSEC_MM_POLICY_IN_USE: DWORD = 13005; +pub const ERROR_IPSEC_MM_FILTER_EXISTS: DWORD = 13006; +pub const ERROR_IPSEC_MM_FILTER_NOT_FOUND: DWORD = 13007; +pub const ERROR_IPSEC_TRANSPORT_FILTER_EXISTS: DWORD = 13008; +pub const ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND: DWORD = 13009; +pub const ERROR_IPSEC_MM_AUTH_EXISTS: DWORD = 13010; +pub const ERROR_IPSEC_MM_AUTH_NOT_FOUND: DWORD = 13011; +pub const ERROR_IPSEC_MM_AUTH_IN_USE: DWORD = 13012; +pub const ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND: DWORD = 13013; +pub const ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND: DWORD = 13014; +pub const ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND: DWORD = 13015; +pub const ERROR_IPSEC_TUNNEL_FILTER_EXISTS: DWORD = 13016; +pub const ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND: DWORD = 13017; +pub const ERROR_IPSEC_MM_FILTER_PENDING_DELETION: DWORD = 13018; +pub const ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION: DWORD = 13019; +pub const ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION: DWORD = 13020; +pub const ERROR_IPSEC_MM_POLICY_PENDING_DELETION: DWORD = 13021; +pub const ERROR_IPSEC_MM_AUTH_PENDING_DELETION: DWORD = 13022; +pub const ERROR_IPSEC_QM_POLICY_PENDING_DELETION: DWORD = 13023; +pub const WARNING_IPSEC_MM_POLICY_PRUNED: DWORD = 13024; +pub const WARNING_IPSEC_QM_POLICY_PRUNED: DWORD = 13025; +pub const ERROR_IPSEC_IKE_NEG_STATUS_BEGIN: DWORD = 13800; +pub const ERROR_IPSEC_IKE_AUTH_FAIL: DWORD = 13801; +pub const ERROR_IPSEC_IKE_ATTRIB_FAIL: DWORD = 13802; +pub const ERROR_IPSEC_IKE_NEGOTIATION_PENDING: DWORD = 13803; +pub const ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR: DWORD = 13804; +pub const ERROR_IPSEC_IKE_TIMED_OUT: DWORD = 13805; +pub const ERROR_IPSEC_IKE_NO_CERT: DWORD = 13806; +pub const ERROR_IPSEC_IKE_SA_DELETED: DWORD = 13807; +pub const ERROR_IPSEC_IKE_SA_REAPED: DWORD = 13808; +pub const ERROR_IPSEC_IKE_MM_ACQUIRE_DROP: DWORD = 13809; +pub const ERROR_IPSEC_IKE_QM_ACQUIRE_DROP: DWORD = 13810; +pub const ERROR_IPSEC_IKE_QUEUE_DROP_MM: DWORD = 13811; +pub const ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM: DWORD = 13812; +pub const ERROR_IPSEC_IKE_DROP_NO_RESPONSE: DWORD = 13813; +pub const ERROR_IPSEC_IKE_MM_DELAY_DROP: DWORD = 13814; +pub const ERROR_IPSEC_IKE_QM_DELAY_DROP: DWORD = 13815; +pub const ERROR_IPSEC_IKE_ERROR: DWORD = 13816; +pub const ERROR_IPSEC_IKE_CRL_FAILED: DWORD = 13817; +pub const ERROR_IPSEC_IKE_INVALID_KEY_USAGE: DWORD = 13818; +pub const ERROR_IPSEC_IKE_INVALID_CERT_TYPE: DWORD = 13819; +pub const ERROR_IPSEC_IKE_NO_PRIVATE_KEY: DWORD = 13820; +pub const ERROR_IPSEC_IKE_SIMULTANEOUS_REKEY: DWORD = 13821; +pub const ERROR_IPSEC_IKE_DH_FAIL: DWORD = 13822; +pub const ERROR_IPSEC_IKE_CRITICAL_PAYLOAD_NOT_RECOGNIZED: DWORD = 13823; +pub const ERROR_IPSEC_IKE_INVALID_HEADER: DWORD = 13824; +pub const ERROR_IPSEC_IKE_NO_POLICY: DWORD = 13825; +pub const ERROR_IPSEC_IKE_INVALID_SIGNATURE: DWORD = 13826; +pub const ERROR_IPSEC_IKE_KERBEROS_ERROR: DWORD = 13827; +pub const ERROR_IPSEC_IKE_NO_PUBLIC_KEY: DWORD = 13828; +pub const ERROR_IPSEC_IKE_PROCESS_ERR: DWORD = 13829; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_SA: DWORD = 13830; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_PROP: DWORD = 13831; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_TRANS: DWORD = 13832; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_KE: DWORD = 13833; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_ID: DWORD = 13834; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_CERT: DWORD = 13835; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ: DWORD = 13836; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_HASH: DWORD = 13837; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_SIG: DWORD = 13838; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_NONCE: DWORD = 13839; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY: DWORD = 13840; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_DELETE: DWORD = 13841; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR: DWORD = 13842; +pub const ERROR_IPSEC_IKE_INVALID_PAYLOAD: DWORD = 13843; +pub const ERROR_IPSEC_IKE_LOAD_SOFT_SA: DWORD = 13844; +pub const ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN: DWORD = 13845; +pub const ERROR_IPSEC_IKE_INVALID_COOKIE: DWORD = 13846; +pub const ERROR_IPSEC_IKE_NO_PEER_CERT: DWORD = 13847; +pub const ERROR_IPSEC_IKE_PEER_CRL_FAILED: DWORD = 13848; +pub const ERROR_IPSEC_IKE_POLICY_CHANGE: DWORD = 13849; +pub const ERROR_IPSEC_IKE_NO_MM_POLICY: DWORD = 13850; +pub const ERROR_IPSEC_IKE_NOTCBPRIV: DWORD = 13851; +pub const ERROR_IPSEC_IKE_SECLOADFAIL: DWORD = 13852; +pub const ERROR_IPSEC_IKE_FAILSSPINIT: DWORD = 13853; +pub const ERROR_IPSEC_IKE_FAILQUERYSSP: DWORD = 13854; +pub const ERROR_IPSEC_IKE_SRVACQFAIL: DWORD = 13855; +pub const ERROR_IPSEC_IKE_SRVQUERYCRED: DWORD = 13856; +pub const ERROR_IPSEC_IKE_GETSPIFAIL: DWORD = 13857; +pub const ERROR_IPSEC_IKE_INVALID_FILTER: DWORD = 13858; +pub const ERROR_IPSEC_IKE_OUT_OF_MEMORY: DWORD = 13859; +pub const ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED: DWORD = 13860; +pub const ERROR_IPSEC_IKE_INVALID_POLICY: DWORD = 13861; +pub const ERROR_IPSEC_IKE_UNKNOWN_DOI: DWORD = 13862; +pub const ERROR_IPSEC_IKE_INVALID_SITUATION: DWORD = 13863; +pub const ERROR_IPSEC_IKE_DH_FAILURE: DWORD = 13864; +pub const ERROR_IPSEC_IKE_INVALID_GROUP: DWORD = 13865; +pub const ERROR_IPSEC_IKE_ENCRYPT: DWORD = 13866; +pub const ERROR_IPSEC_IKE_DECRYPT: DWORD = 13867; +pub const ERROR_IPSEC_IKE_POLICY_MATCH: DWORD = 13868; +pub const ERROR_IPSEC_IKE_UNSUPPORTED_ID: DWORD = 13869; +pub const ERROR_IPSEC_IKE_INVALID_HASH: DWORD = 13870; +pub const ERROR_IPSEC_IKE_INVALID_HASH_ALG: DWORD = 13871; +pub const ERROR_IPSEC_IKE_INVALID_HASH_SIZE: DWORD = 13872; +pub const ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG: DWORD = 13873; +pub const ERROR_IPSEC_IKE_INVALID_AUTH_ALG: DWORD = 13874; +pub const ERROR_IPSEC_IKE_INVALID_SIG: DWORD = 13875; +pub const ERROR_IPSEC_IKE_LOAD_FAILED: DWORD = 13876; +pub const ERROR_IPSEC_IKE_RPC_DELETE: DWORD = 13877; +pub const ERROR_IPSEC_IKE_BENIGN_REINIT: DWORD = 13878; +pub const ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY: DWORD = 13879; +pub const ERROR_IPSEC_IKE_INVALID_MAJOR_VERSION: DWORD = 13880; +pub const ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN: DWORD = 13881; +pub const ERROR_IPSEC_IKE_MM_LIMIT: DWORD = 13882; +pub const ERROR_IPSEC_IKE_NEGOTIATION_DISABLED: DWORD = 13883; +pub const ERROR_IPSEC_IKE_QM_LIMIT: DWORD = 13884; +pub const ERROR_IPSEC_IKE_MM_EXPIRED: DWORD = 13885; +pub const ERROR_IPSEC_IKE_PEER_MM_ASSUMED_INVALID: DWORD = 13886; +pub const ERROR_IPSEC_IKE_CERT_CHAIN_POLICY_MISMATCH: DWORD = 13887; +pub const ERROR_IPSEC_IKE_UNEXPECTED_MESSAGE_ID: DWORD = 13888; +pub const ERROR_IPSEC_IKE_INVALID_AUTH_PAYLOAD: DWORD = 13889; +pub const ERROR_IPSEC_IKE_DOS_COOKIE_SENT: DWORD = 13890; +pub const ERROR_IPSEC_IKE_SHUTTING_DOWN: DWORD = 13891; +pub const ERROR_IPSEC_IKE_CGA_AUTH_FAILED: DWORD = 13892; +pub const ERROR_IPSEC_IKE_PROCESS_ERR_NATOA: DWORD = 13893; +pub const ERROR_IPSEC_IKE_INVALID_MM_FOR_QM: DWORD = 13894; +pub const ERROR_IPSEC_IKE_QM_EXPIRED: DWORD = 13895; +pub const ERROR_IPSEC_IKE_TOO_MANY_FILTERS: DWORD = 13896; +pub const ERROR_IPSEC_IKE_NEG_STATUS_END: DWORD = 13897; +pub const ERROR_IPSEC_IKE_KILL_DUMMY_NAP_TUNNEL: DWORD = 13898; +pub const ERROR_IPSEC_IKE_INNER_IP_ASSIGNMENT_FAILURE: DWORD = 13899; +pub const ERROR_IPSEC_IKE_REQUIRE_CP_PAYLOAD_MISSING: DWORD = 13900; +pub const ERROR_IPSEC_KEY_MODULE_IMPERSONATION_NEGOTIATION_PENDING: DWORD = 13901; +pub const ERROR_IPSEC_IKE_COEXISTENCE_SUPPRESS: DWORD = 13902; +pub const ERROR_IPSEC_IKE_RATELIMIT_DROP: DWORD = 13903; +pub const ERROR_IPSEC_IKE_PEER_DOESNT_SUPPORT_MOBIKE: DWORD = 13904; +pub const ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE: DWORD = 13905; +pub const ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_FAILURE: DWORD = 13906; +pub const ERROR_IPSEC_IKE_AUTHORIZATION_FAILURE_WITH_OPTIONAL_RETRY: DWORD = 13907; +pub const ERROR_IPSEC_IKE_STRONG_CRED_AUTHORIZATION_AND_CERTMAP_FAILURE: DWORD = 13908; +pub const ERROR_IPSEC_IKE_NEG_STATUS_EXTENDED_END: DWORD = 13909; +pub const ERROR_IPSEC_BAD_SPI: DWORD = 13910; +pub const ERROR_IPSEC_SA_LIFETIME_EXPIRED: DWORD = 13911; +pub const ERROR_IPSEC_WRONG_SA: DWORD = 13912; +pub const ERROR_IPSEC_REPLAY_CHECK_FAILED: DWORD = 13913; +pub const ERROR_IPSEC_INVALID_PACKET: DWORD = 13914; +pub const ERROR_IPSEC_INTEGRITY_CHECK_FAILED: DWORD = 13915; +pub const ERROR_IPSEC_CLEAR_TEXT_DROP: DWORD = 13916; +pub const ERROR_IPSEC_AUTH_FIREWALL_DROP: DWORD = 13917; +pub const ERROR_IPSEC_THROTTLE_DROP: DWORD = 13918; +pub const ERROR_IPSEC_DOSP_BLOCK: DWORD = 13925; +pub const ERROR_IPSEC_DOSP_RECEIVED_MULTICAST: DWORD = 13926; +pub const ERROR_IPSEC_DOSP_INVALID_PACKET: DWORD = 13927; +pub const ERROR_IPSEC_DOSP_STATE_LOOKUP_FAILED: DWORD = 13928; +pub const ERROR_IPSEC_DOSP_MAX_ENTRIES: DWORD = 13929; +pub const ERROR_IPSEC_DOSP_KEYMOD_NOT_ALLOWED: DWORD = 13930; +pub const ERROR_IPSEC_DOSP_NOT_INSTALLED: DWORD = 13931; +pub const ERROR_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES: DWORD = 13932; +pub const ERROR_SXS_SECTION_NOT_FOUND: DWORD = 14000; +pub const ERROR_SXS_CANT_GEN_ACTCTX: DWORD = 14001; +pub const ERROR_SXS_INVALID_ACTCTXDATA_FORMAT: DWORD = 14002; +pub const ERROR_SXS_ASSEMBLY_NOT_FOUND: DWORD = 14003; +pub const ERROR_SXS_MANIFEST_FORMAT_ERROR: DWORD = 14004; +pub const ERROR_SXS_MANIFEST_PARSE_ERROR: DWORD = 14005; +pub const ERROR_SXS_ACTIVATION_CONTEXT_DISABLED: DWORD = 14006; +pub const ERROR_SXS_KEY_NOT_FOUND: DWORD = 14007; +pub const ERROR_SXS_VERSION_CONFLICT: DWORD = 14008; +pub const ERROR_SXS_WRONG_SECTION_TYPE: DWORD = 14009; +pub const ERROR_SXS_THREAD_QUERIES_DISABLED: DWORD = 14010; +pub const ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET: DWORD = 14011; +pub const ERROR_SXS_UNKNOWN_ENCODING_GROUP: DWORD = 14012; +pub const ERROR_SXS_UNKNOWN_ENCODING: DWORD = 14013; +pub const ERROR_SXS_INVALID_XML_NAMESPACE_URI: DWORD = 14014; +pub const ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED: DWORD = 14015; +pub const ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED: DWORD = 14016; +pub const ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE: DWORD = 14017; +pub const ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE: DWORD = 14018; +pub const ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE: DWORD = 14019; +pub const ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT: DWORD = 14020; +pub const ERROR_SXS_DUPLICATE_DLL_NAME: DWORD = 14021; +pub const ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME: DWORD = 14022; +pub const ERROR_SXS_DUPLICATE_CLSID: DWORD = 14023; +pub const ERROR_SXS_DUPLICATE_IID: DWORD = 14024; +pub const ERROR_SXS_DUPLICATE_TLBID: DWORD = 14025; +pub const ERROR_SXS_DUPLICATE_PROGID: DWORD = 14026; +pub const ERROR_SXS_DUPLICATE_ASSEMBLY_NAME: DWORD = 14027; +pub const ERROR_SXS_FILE_HASH_MISMATCH: DWORD = 14028; +pub const ERROR_SXS_POLICY_PARSE_ERROR: DWORD = 14029; +pub const ERROR_SXS_XML_E_MISSINGQUOTE: DWORD = 14030; +pub const ERROR_SXS_XML_E_COMMENTSYNTAX: DWORD = 14031; +pub const ERROR_SXS_XML_E_BADSTARTNAMECHAR: DWORD = 14032; +pub const ERROR_SXS_XML_E_BADNAMECHAR: DWORD = 14033; +pub const ERROR_SXS_XML_E_BADCHARINSTRING: DWORD = 14034; +pub const ERROR_SXS_XML_E_XMLDECLSYNTAX: DWORD = 14035; +pub const ERROR_SXS_XML_E_BADCHARDATA: DWORD = 14036; +pub const ERROR_SXS_XML_E_MISSINGWHITESPACE: DWORD = 14037; +pub const ERROR_SXS_XML_E_EXPECTINGTAGEND: DWORD = 14038; +pub const ERROR_SXS_XML_E_MISSINGSEMICOLON: DWORD = 14039; +pub const ERROR_SXS_XML_E_UNBALANCEDPAREN: DWORD = 14040; +pub const ERROR_SXS_XML_E_INTERNALERROR: DWORD = 14041; +pub const ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE: DWORD = 14042; +pub const ERROR_SXS_XML_E_INCOMPLETE_ENCODING: DWORD = 14043; +pub const ERROR_SXS_XML_E_MISSING_PAREN: DWORD = 14044; +pub const ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE: DWORD = 14045; +pub const ERROR_SXS_XML_E_MULTIPLE_COLONS: DWORD = 14046; +pub const ERROR_SXS_XML_E_INVALID_DECIMAL: DWORD = 14047; +pub const ERROR_SXS_XML_E_INVALID_HEXIDECIMAL: DWORD = 14048; +pub const ERROR_SXS_XML_E_INVALID_UNICODE: DWORD = 14049; +pub const ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK: DWORD = 14050; +pub const ERROR_SXS_XML_E_UNEXPECTEDENDTAG: DWORD = 14051; +pub const ERROR_SXS_XML_E_UNCLOSEDTAG: DWORD = 14052; +pub const ERROR_SXS_XML_E_DUPLICATEATTRIBUTE: DWORD = 14053; +pub const ERROR_SXS_XML_E_MULTIPLEROOTS: DWORD = 14054; +pub const ERROR_SXS_XML_E_INVALIDATROOTLEVEL: DWORD = 14055; +pub const ERROR_SXS_XML_E_BADXMLDECL: DWORD = 14056; +pub const ERROR_SXS_XML_E_MISSINGROOT: DWORD = 14057; +pub const ERROR_SXS_XML_E_UNEXPECTEDEOF: DWORD = 14058; +pub const ERROR_SXS_XML_E_BADPEREFINSUBSET: DWORD = 14059; +pub const ERROR_SXS_XML_E_UNCLOSEDSTARTTAG: DWORD = 14060; +pub const ERROR_SXS_XML_E_UNCLOSEDENDTAG: DWORD = 14061; +pub const ERROR_SXS_XML_E_UNCLOSEDSTRING: DWORD = 14062; +pub const ERROR_SXS_XML_E_UNCLOSEDCOMMENT: DWORD = 14063; +pub const ERROR_SXS_XML_E_UNCLOSEDDECL: DWORD = 14064; +pub const ERROR_SXS_XML_E_UNCLOSEDCDATA: DWORD = 14065; +pub const ERROR_SXS_XML_E_RESERVEDNAMESPACE: DWORD = 14066; +pub const ERROR_SXS_XML_E_INVALIDENCODING: DWORD = 14067; +pub const ERROR_SXS_XML_E_INVALIDSWITCH: DWORD = 14068; +pub const ERROR_SXS_XML_E_BADXMLCASE: DWORD = 14069; +pub const ERROR_SXS_XML_E_INVALID_STANDALONE: DWORD = 14070; +pub const ERROR_SXS_XML_E_UNEXPECTED_STANDALONE: DWORD = 14071; +pub const ERROR_SXS_XML_E_INVALID_VERSION: DWORD = 14072; +pub const ERROR_SXS_XML_E_MISSINGEQUALS: DWORD = 14073; +pub const ERROR_SXS_PROTECTION_RECOVERY_FAILED: DWORD = 14074; +pub const ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT: DWORD = 14075; +pub const ERROR_SXS_PROTECTION_CATALOG_NOT_VALID: DWORD = 14076; +pub const ERROR_SXS_UNTRANSLATABLE_HRESULT: DWORD = 14077; +pub const ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING: DWORD = 14078; +pub const ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE: DWORD = 14079; +pub const ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME: DWORD = 14080; +pub const ERROR_SXS_ASSEMBLY_MISSING: DWORD = 14081; +pub const ERROR_SXS_CORRUPT_ACTIVATION_STACK: DWORD = 14082; +pub const ERROR_SXS_CORRUPTION: DWORD = 14083; +pub const ERROR_SXS_EARLY_DEACTIVATION: DWORD = 14084; +pub const ERROR_SXS_INVALID_DEACTIVATION: DWORD = 14085; +pub const ERROR_SXS_MULTIPLE_DEACTIVATION: DWORD = 14086; +pub const ERROR_SXS_PROCESS_TERMINATION_REQUESTED: DWORD = 14087; +pub const ERROR_SXS_RELEASE_ACTIVATION_CONTEXT: DWORD = 14088; +pub const ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY: DWORD = 14089; +pub const ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE: DWORD = 14090; +pub const ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME: DWORD = 14091; +pub const ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE: DWORD = 14092; +pub const ERROR_SXS_IDENTITY_PARSE_ERROR: DWORD = 14093; +pub const ERROR_MALFORMED_SUBSTITUTION_STRING: DWORD = 14094; +pub const ERROR_SXS_INCORRECT_PUBLIC_KEY_TOKEN: DWORD = 14095; +pub const ERROR_UNMAPPED_SUBSTITUTION_STRING: DWORD = 14096; +pub const ERROR_SXS_ASSEMBLY_NOT_LOCKED: DWORD = 14097; +pub const ERROR_SXS_COMPONENT_STORE_CORRUPT: DWORD = 14098; +pub const ERROR_ADVANCED_INSTALLER_FAILED: DWORD = 14099; +pub const ERROR_XML_ENCODING_MISMATCH: DWORD = 14100; +pub const ERROR_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT: DWORD = 14101; +pub const ERROR_SXS_IDENTITIES_DIFFERENT: DWORD = 14102; +pub const ERROR_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT: DWORD = 14103; +pub const ERROR_SXS_FILE_NOT_PART_OF_ASSEMBLY: DWORD = 14104; +pub const ERROR_SXS_MANIFEST_TOO_BIG: DWORD = 14105; +pub const ERROR_SXS_SETTING_NOT_REGISTERED: DWORD = 14106; +pub const ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE: DWORD = 14107; +pub const ERROR_SMI_PRIMITIVE_INSTALLER_FAILED: DWORD = 14108; +pub const ERROR_GENERIC_COMMAND_FAILED: DWORD = 14109; +pub const ERROR_SXS_FILE_HASH_MISSING: DWORD = 14110; +pub const ERROR_EVT_INVALID_CHANNEL_PATH: DWORD = 15000; +pub const ERROR_EVT_INVALID_QUERY: DWORD = 15001; +pub const ERROR_EVT_PUBLISHER_METADATA_NOT_FOUND: DWORD = 15002; +pub const ERROR_EVT_EVENT_TEMPLATE_NOT_FOUND: DWORD = 15003; +pub const ERROR_EVT_INVALID_PUBLISHER_NAME: DWORD = 15004; +pub const ERROR_EVT_INVALID_EVENT_DATA: DWORD = 15005; +pub const ERROR_EVT_CHANNEL_NOT_FOUND: DWORD = 15007; +pub const ERROR_EVT_MALFORMED_XML_TEXT: DWORD = 15008; +pub const ERROR_EVT_SUBSCRIPTION_TO_DIRECT_CHANNEL: DWORD = 15009; +pub const ERROR_EVT_CONFIGURATION_ERROR: DWORD = 15010; +pub const ERROR_EVT_QUERY_RESULT_STALE: DWORD = 15011; +pub const ERROR_EVT_QUERY_RESULT_INVALID_POSITION: DWORD = 15012; +pub const ERROR_EVT_NON_VALIDATING_MSXML: DWORD = 15013; +pub const ERROR_EVT_FILTER_ALREADYSCOPED: DWORD = 15014; +pub const ERROR_EVT_FILTER_NOTELTSET: DWORD = 15015; +pub const ERROR_EVT_FILTER_INVARG: DWORD = 15016; +pub const ERROR_EVT_FILTER_INVTEST: DWORD = 15017; +pub const ERROR_EVT_FILTER_INVTYPE: DWORD = 15018; +pub const ERROR_EVT_FILTER_PARSEERR: DWORD = 15019; +pub const ERROR_EVT_FILTER_UNSUPPORTEDOP: DWORD = 15020; +pub const ERROR_EVT_FILTER_UNEXPECTEDTOKEN: DWORD = 15021; +pub const ERROR_EVT_INVALID_OPERATION_OVER_ENABLED_DIRECT_CHANNEL: DWORD = 15022; +pub const ERROR_EVT_INVALID_CHANNEL_PROPERTY_VALUE: DWORD = 15023; +pub const ERROR_EVT_INVALID_PUBLISHER_PROPERTY_VALUE: DWORD = 15024; +pub const ERROR_EVT_CHANNEL_CANNOT_ACTIVATE: DWORD = 15025; +pub const ERROR_EVT_FILTER_TOO_COMPLEX: DWORD = 15026; +pub const ERROR_EVT_MESSAGE_NOT_FOUND: DWORD = 15027; +pub const ERROR_EVT_MESSAGE_ID_NOT_FOUND: DWORD = 15028; +pub const ERROR_EVT_UNRESOLVED_VALUE_INSERT: DWORD = 15029; +pub const ERROR_EVT_UNRESOLVED_PARAMETER_INSERT: DWORD = 15030; +pub const ERROR_EVT_MAX_INSERTS_REACHED: DWORD = 15031; +pub const ERROR_EVT_EVENT_DEFINITION_NOT_FOUND: DWORD = 15032; +pub const ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND: DWORD = 15033; +pub const ERROR_EVT_VERSION_TOO_OLD: DWORD = 15034; +pub const ERROR_EVT_VERSION_TOO_NEW: DWORD = 15035; +pub const ERROR_EVT_CANNOT_OPEN_CHANNEL_OF_QUERY: DWORD = 15036; +pub const ERROR_EVT_PUBLISHER_DISABLED: DWORD = 15037; +pub const ERROR_EVT_FILTER_OUT_OF_RANGE: DWORD = 15038; +pub const ERROR_EC_SUBSCRIPTION_CANNOT_ACTIVATE: DWORD = 15080; +pub const ERROR_EC_LOG_DISABLED: DWORD = 15081; +pub const ERROR_EC_CIRCULAR_FORWARDING: DWORD = 15082; +pub const ERROR_EC_CREDSTORE_FULL: DWORD = 15083; +pub const ERROR_EC_CRED_NOT_FOUND: DWORD = 15084; +pub const ERROR_EC_NO_ACTIVE_CHANNEL: DWORD = 15085; +pub const ERROR_MUI_FILE_NOT_FOUND: DWORD = 15100; +pub const ERROR_MUI_INVALID_FILE: DWORD = 15101; +pub const ERROR_MUI_INVALID_RC_CONFIG: DWORD = 15102; +pub const ERROR_MUI_INVALID_LOCALE_NAME: DWORD = 15103; +pub const ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME: DWORD = 15104; +pub const ERROR_MUI_FILE_NOT_LOADED: DWORD = 15105; +pub const ERROR_RESOURCE_ENUM_USER_STOP: DWORD = 15106; +pub const ERROR_MUI_INTLSETTINGS_UILANG_NOT_INSTALLED: DWORD = 15107; +pub const ERROR_MUI_INTLSETTINGS_INVALID_LOCALE_NAME: DWORD = 15108; +pub const ERROR_MRM_RUNTIME_NO_DEFAULT_OR_NEUTRAL_RESOURCE: DWORD = 15110; +pub const ERROR_MRM_INVALID_PRICONFIG: DWORD = 15111; +pub const ERROR_MRM_INVALID_FILE_TYPE: DWORD = 15112; +pub const ERROR_MRM_UNKNOWN_QUALIFIER: DWORD = 15113; +pub const ERROR_MRM_INVALID_QUALIFIER_VALUE: DWORD = 15114; +pub const ERROR_MRM_NO_CANDIDATE: DWORD = 15115; +pub const ERROR_MRM_NO_MATCH_OR_DEFAULT_CANDIDATE: DWORD = 15116; +pub const ERROR_MRM_RESOURCE_TYPE_MISMATCH: DWORD = 15117; +pub const ERROR_MRM_DUPLICATE_MAP_NAME: DWORD = 15118; +pub const ERROR_MRM_DUPLICATE_ENTRY: DWORD = 15119; +pub const ERROR_MRM_INVALID_RESOURCE_IDENTIFIER: DWORD = 15120; +pub const ERROR_MRM_FILEPATH_TOO_LONG: DWORD = 15121; +pub const ERROR_MRM_UNSUPPORTED_DIRECTORY_TYPE: DWORD = 15122; +pub const ERROR_MRM_INVALID_PRI_FILE: DWORD = 15126; +pub const ERROR_MRM_NAMED_RESOURCE_NOT_FOUND: DWORD = 15127; +pub const ERROR_MRM_MAP_NOT_FOUND: DWORD = 15135; +pub const ERROR_MRM_UNSUPPORTED_PROFILE_TYPE: DWORD = 15136; +pub const ERROR_MRM_INVALID_QUALIFIER_OPERATOR: DWORD = 15137; +pub const ERROR_MRM_INDETERMINATE_QUALIFIER_VALUE: DWORD = 15138; +pub const ERROR_MRM_AUTOMERGE_ENABLED: DWORD = 15139; +pub const ERROR_MRM_TOO_MANY_RESOURCES: DWORD = 15140; +pub const ERROR_MRM_UNSUPPORTED_FILE_TYPE_FOR_MERGE: DWORD = 15141; +pub const ERROR_MRM_UNSUPPORTED_FILE_TYPE_FOR_LOAD_UNLOAD_PRI_FILE: DWORD = 15142; +pub const ERROR_MRM_NO_CURRENT_VIEW_ON_THREAD: DWORD = 15143; +pub const ERROR_DIFFERENT_PROFILE_RESOURCE_MANAGER_EXIST: DWORD = 15144; +pub const ERROR_OPERATION_NOT_ALLOWED_FROM_SYSTEM_COMPONENT: DWORD = 15145; +pub const ERROR_MRM_DIRECT_REF_TO_NON_DEFAULT_RESOURCE: DWORD = 15146; +pub const ERROR_MRM_GENERATION_COUNT_MISMATCH: DWORD = 15147; +pub const ERROR_MCA_INVALID_CAPABILITIES_STRING: DWORD = 15200; +pub const ERROR_MCA_INVALID_VCP_VERSION: DWORD = 15201; +pub const ERROR_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION: DWORD = 15202; +pub const ERROR_MCA_MCCS_VERSION_MISMATCH: DWORD = 15203; +pub const ERROR_MCA_UNSUPPORTED_MCCS_VERSION: DWORD = 15204; +pub const ERROR_MCA_INTERNAL_ERROR: DWORD = 15205; +pub const ERROR_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED: DWORD = 15206; +pub const ERROR_MCA_UNSUPPORTED_COLOR_TEMPERATURE: DWORD = 15207; +pub const ERROR_AMBIGUOUS_SYSTEM_DEVICE: DWORD = 15250; +pub const ERROR_SYSTEM_DEVICE_NOT_FOUND: DWORD = 15299; +pub const ERROR_HASH_NOT_SUPPORTED: DWORD = 15300; +pub const ERROR_HASH_NOT_PRESENT: DWORD = 15301; +pub const ERROR_SECONDARY_IC_PROVIDER_NOT_REGISTERED: DWORD = 15321; +pub const ERROR_GPIO_CLIENT_INFORMATION_INVALID: DWORD = 15322; +pub const ERROR_GPIO_VERSION_NOT_SUPPORTED: DWORD = 15323; +pub const ERROR_GPIO_INVALID_REGISTRATION_PACKET: DWORD = 15324; +pub const ERROR_GPIO_OPERATION_DENIED: DWORD = 15325; +pub const ERROR_GPIO_INCOMPATIBLE_CONNECT_MODE: DWORD = 15326; +pub const ERROR_GPIO_INTERRUPT_ALREADY_UNMASKED: DWORD = 15327; +pub const ERROR_CANNOT_SWITCH_RUNLEVEL: DWORD = 15400; +pub const ERROR_INVALID_RUNLEVEL_SETTING: DWORD = 15401; +pub const ERROR_RUNLEVEL_SWITCH_TIMEOUT: DWORD = 15402; +pub const ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT: DWORD = 15403; +pub const ERROR_RUNLEVEL_SWITCH_IN_PROGRESS: DWORD = 15404; +pub const ERROR_SERVICES_FAILED_AUTOSTART: DWORD = 15405; +pub const ERROR_COM_TASK_STOP_PENDING: DWORD = 15501; +pub const ERROR_INSTALL_OPEN_PACKAGE_FAILED: DWORD = 15600; +pub const ERROR_INSTALL_PACKAGE_NOT_FOUND: DWORD = 15601; +pub const ERROR_INSTALL_INVALID_PACKAGE: DWORD = 15602; +pub const ERROR_INSTALL_RESOLVE_DEPENDENCY_FAILED: DWORD = 15603; +pub const ERROR_INSTALL_OUT_OF_DISK_SPACE: DWORD = 15604; +pub const ERROR_INSTALL_NETWORK_FAILURE: DWORD = 15605; +pub const ERROR_INSTALL_REGISTRATION_FAILURE: DWORD = 15606; +pub const ERROR_INSTALL_DEREGISTRATION_FAILURE: DWORD = 15607; +pub const ERROR_INSTALL_CANCEL: DWORD = 15608; +pub const ERROR_INSTALL_FAILED: DWORD = 15609; +pub const ERROR_REMOVE_FAILED: DWORD = 15610; +pub const ERROR_PACKAGE_ALREADY_EXISTS: DWORD = 15611; +pub const ERROR_NEEDS_REMEDIATION: DWORD = 15612; +pub const ERROR_INSTALL_PREREQUISITE_FAILED: DWORD = 15613; +pub const ERROR_PACKAGE_REPOSITORY_CORRUPTED: DWORD = 15614; +pub const ERROR_INSTALL_POLICY_FAILURE: DWORD = 15615; +pub const ERROR_PACKAGE_UPDATING: DWORD = 15616; +pub const ERROR_DEPLOYMENT_BLOCKED_BY_POLICY: DWORD = 15617; +pub const ERROR_PACKAGES_IN_USE: DWORD = 15618; +pub const ERROR_RECOVERY_FILE_CORRUPT: DWORD = 15619; +pub const ERROR_INVALID_STAGED_SIGNATURE: DWORD = 15620; +pub const ERROR_DELETING_EXISTING_APPLICATIONDATA_STORE_FAILED: DWORD = 15621; +pub const ERROR_INSTALL_PACKAGE_DOWNGRADE: DWORD = 15622; +pub const ERROR_SYSTEM_NEEDS_REMEDIATION: DWORD = 15623; +pub const ERROR_APPX_INTEGRITY_FAILURE_CLR_NGEN: DWORD = 15624; +pub const ERROR_RESILIENCY_FILE_CORRUPT: DWORD = 15625; +pub const ERROR_INSTALL_FIREWALL_SERVICE_NOT_RUNNING: DWORD = 15626; +pub const APPMODEL_ERROR_NO_PACKAGE: DWORD = 15700; +pub const APPMODEL_ERROR_PACKAGE_RUNTIME_CORRUPT: DWORD = 15701; +pub const APPMODEL_ERROR_PACKAGE_IDENTITY_CORRUPT: DWORD = 15702; +pub const APPMODEL_ERROR_NO_APPLICATION: DWORD = 15703; +pub const APPMODEL_ERROR_DYNAMIC_PROPERTY_READ_FAILED: DWORD = 15704; +pub const APPMODEL_ERROR_DYNAMIC_PROPERTY_INVALID: DWORD = 15705; +pub const ERROR_STATE_LOAD_STORE_FAILED: DWORD = 15800; +pub const ERROR_STATE_GET_VERSION_FAILED: DWORD = 15801; +pub const ERROR_STATE_SET_VERSION_FAILED: DWORD = 15802; +pub const ERROR_STATE_STRUCTURED_RESET_FAILED: DWORD = 15803; +pub const ERROR_STATE_OPEN_CONTAINER_FAILED: DWORD = 15804; +pub const ERROR_STATE_CREATE_CONTAINER_FAILED: DWORD = 15805; +pub const ERROR_STATE_DELETE_CONTAINER_FAILED: DWORD = 15806; +pub const ERROR_STATE_READ_SETTING_FAILED: DWORD = 15807; +pub const ERROR_STATE_WRITE_SETTING_FAILED: DWORD = 15808; +pub const ERROR_STATE_DELETE_SETTING_FAILED: DWORD = 15809; +pub const ERROR_STATE_QUERY_SETTING_FAILED: DWORD = 15810; +pub const ERROR_STATE_READ_COMPOSITE_SETTING_FAILED: DWORD = 15811; +pub const ERROR_STATE_WRITE_COMPOSITE_SETTING_FAILED: DWORD = 15812; +pub const ERROR_STATE_ENUMERATE_CONTAINER_FAILED: DWORD = 15813; +pub const ERROR_STATE_ENUMERATE_SETTINGS_FAILED: DWORD = 15814; +pub const ERROR_STATE_COMPOSITE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED: DWORD = 15815; +pub const ERROR_STATE_SETTING_VALUE_SIZE_LIMIT_EXCEEDED: DWORD = 15816; +pub const ERROR_STATE_SETTING_NAME_SIZE_LIMIT_EXCEEDED: DWORD = 15817; +pub const ERROR_STATE_CONTAINER_NAME_SIZE_LIMIT_EXCEEDED: DWORD = 15818; +pub const ERROR_API_UNAVAILABLE: DWORD = 15841; +pub const STORE_ERROR_UNLICENSED: DWORD = 15861; +pub const STORE_ERROR_UNLICENSED_USER: DWORD = 15862; +pub const STORE_ERROR_PENDING_COM_TRANSACTION: DWORD = 15863; +pub const STORE_ERROR_LICENSE_REVOKED: DWORD = 15864; +pub const SEVERITY_SUCCESS: HRESULT = 0; +pub const SEVERITY_ERROR: HRESULT = 1; +#[inline] +pub fn SUCCEEDED(hr: HRESULT) -> bool { + hr >= 0 +} +#[inline] +pub fn FAILED(hr: HRESULT) -> bool { + hr < 0 +} +#[inline] +pub fn IS_ERROR(hr: HRESULT) -> bool { + (hr as u32) >> 31 == (SEVERITY_ERROR as u32) +} +#[inline] +pub fn HRESULT_CODE(hr: HRESULT) -> HRESULT { + hr & 0xFFFF +} +#[inline] +pub fn SCODE_CODE(sc: SCODE) -> HRESULT { + sc & 0xFFFF +} +#[inline] +pub fn HRESULT_FACILITY(hr: HRESULT) -> HRESULT { + (hr >> 16) & 0x1fff +} +#[inline] +pub fn SCODE_FACILITY(sc: SCODE) -> HRESULT { + (sc >> 16) & 0x1fff +} +#[inline] +pub fn HRESULT_SEVERITY(hr: HRESULT) -> HRESULT { + (hr >> 31) & 0x1 +} +#[inline] +pub fn SCODE_SEVERITY(sc: SCODE) -> HRESULT { + (sc >> 31) & 0x1 +} +#[inline] +pub fn MAKE_HRESULT(sev: HRESULT, fac: HRESULT, code: HRESULT) -> HRESULT { + (sev << 31) | (fac << 16) | code +} +#[inline] +pub fn MAKE_SCODE(sev: HRESULT, fac: HRESULT, code: HRESULT) -> SCODE { + (sev << 31) | (fac << 16) | code +} +pub const FACILITY_NT_BIT: HRESULT = 0x10000000; +#[inline] +pub fn HRESULT_FROM_WIN32(x: c_ulong) -> HRESULT { + if x as i32 <= 0 { + x as i32 + } else { + ((x & 0x0000FFFF) | ((FACILITY_WIN32 as u32) << 16) | 0x80000000) as i32 + } +} +pub type HRESULT = c_long; +#[inline] +pub fn HRESULT_FROM_NT(x: c_ulong) -> HRESULT { + (x | FACILITY_NT_BIT as u32) as i32 +} +pub const NOERROR: HRESULT = 0; +pub const E_UNEXPECTED: HRESULT = 0x8000FFFF; +pub const E_NOTIMPL: HRESULT = 0x80004001; +pub const E_OUTOFMEMORY: HRESULT = 0x8007000E; +pub const E_INVALIDARG: HRESULT = 0x80070057; +pub const E_NOINTERFACE: HRESULT = 0x80004002; +pub const E_POINTER: HRESULT = 0x80004003; +pub const E_HANDLE: HRESULT = 0x80070006; +pub const E_ABORT: HRESULT = 0x80004004; +pub const E_FAIL: HRESULT = 0x80004005; +pub const E_ACCESSDENIED: HRESULT = 0x80070005; +pub const E_PENDING: HRESULT = 0x8000000A; +pub const E_BOUNDS: HRESULT = 0x8000000B; +pub const E_CHANGED_STATE: HRESULT = 0x8000000C; +pub const E_ILLEGAL_STATE_CHANGE: HRESULT = 0x8000000D; +pub const E_ILLEGAL_METHOD_CALL: HRESULT = 0x8000000E; +pub const RO_E_METADATA_NAME_NOT_FOUND: HRESULT = 0x8000000F; +pub const RO_E_METADATA_NAME_IS_NAMESPACE: HRESULT = 0x80000010; +pub const RO_E_METADATA_INVALID_TYPE_FORMAT: HRESULT = 0x80000011; +pub const RO_E_INVALID_METADATA_FILE: HRESULT = 0x80000012; +pub const RO_E_CLOSED: HRESULT = 0x80000013; +pub const RO_E_EXCLUSIVE_WRITE: HRESULT = 0x80000014; +pub const RO_E_CHANGE_NOTIFICATION_IN_PROGRESS: HRESULT = 0x80000015; +pub const RO_E_ERROR_STRING_NOT_FOUND: HRESULT = 0x80000016; +pub const E_STRING_NOT_NULL_TERMINATED: HRESULT = 0x80000017; +pub const E_ILLEGAL_DELEGATE_ASSIGNMENT: HRESULT = 0x80000018; +pub const E_ASYNC_OPERATION_NOT_STARTED: HRESULT = 0x80000019; +pub const E_APPLICATION_EXITING: HRESULT = 0x8000001A; +pub const E_APPLICATION_VIEW_EXITING: HRESULT = 0x8000001B; +pub const RO_E_MUST_BE_AGILE: HRESULT = 0x8000001C; +pub const RO_E_UNSUPPORTED_FROM_MTA: HRESULT = 0x8000001D; +pub const RO_E_COMMITTED: HRESULT = 0x8000001E; +pub const RO_E_BLOCKED_CROSS_ASTA_CALL: HRESULT = 0x8000001F; +pub const CO_E_INIT_TLS: HRESULT = 0x80004006; +pub const CO_E_INIT_SHARED_ALLOCATOR: HRESULT = 0x80004007; +pub const CO_E_INIT_MEMORY_ALLOCATOR: HRESULT = 0x80004008; +pub const CO_E_INIT_CLASS_CACHE: HRESULT = 0x80004009; +pub const CO_E_INIT_RPC_CHANNEL: HRESULT = 0x8000400A; +pub const CO_E_INIT_TLS_SET_CHANNEL_CONTROL: HRESULT = 0x8000400B; +pub const CO_E_INIT_TLS_CHANNEL_CONTROL: HRESULT = 0x8000400C; +pub const CO_E_INIT_UNACCEPTED_USER_ALLOCATOR: HRESULT = 0x8000400D; +pub const CO_E_INIT_SCM_MUTEX_EXISTS: HRESULT = 0x8000400E; +pub const CO_E_INIT_SCM_FILE_MAPPING_EXISTS: HRESULT = 0x8000400F; +pub const CO_E_INIT_SCM_MAP_VIEW_OF_FILE: HRESULT = 0x80004010; +pub const CO_E_INIT_SCM_EXEC_FAILURE: HRESULT = 0x80004011; +pub const CO_E_INIT_ONLY_SINGLE_THREADED: HRESULT = 0x80004012; +pub const CO_E_CANT_REMOTE: HRESULT = 0x80004013; +pub const CO_E_BAD_SERVER_NAME: HRESULT = 0x80004014; +pub const CO_E_WRONG_SERVER_IDENTITY: HRESULT = 0x80004015; +pub const CO_E_OLE1DDE_DISABLED: HRESULT = 0x80004016; +pub const CO_E_RUNAS_SYNTAX: HRESULT = 0x80004017; +pub const CO_E_CREATEPROCESS_FAILURE: HRESULT = 0x80004018; +pub const CO_E_RUNAS_CREATEPROCESS_FAILURE: HRESULT = 0x80004019; +pub const CO_E_RUNAS_LOGON_FAILURE: HRESULT = 0x8000401A; +pub const CO_E_LAUNCH_PERMSSION_DENIED: HRESULT = 0x8000401B; +pub const CO_E_START_SERVICE_FAILURE: HRESULT = 0x8000401C; +pub const CO_E_REMOTE_COMMUNICATION_FAILURE: HRESULT = 0x8000401D; +pub const CO_E_SERVER_START_TIMEOUT: HRESULT = 0x8000401E; +pub const CO_E_CLSREG_INCONSISTENT: HRESULT = 0x8000401F; +pub const CO_E_IIDREG_INCONSISTENT: HRESULT = 0x80004020; +pub const CO_E_NOT_SUPPORTED: HRESULT = 0x80004021; +pub const CO_E_RELOAD_DLL: HRESULT = 0x80004022; +pub const CO_E_MSI_ERROR: HRESULT = 0x80004023; +pub const CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT: HRESULT = 0x80004024; +pub const CO_E_SERVER_PAUSED: HRESULT = 0x80004025; +pub const CO_E_SERVER_NOT_PAUSED: HRESULT = 0x80004026; +pub const CO_E_CLASS_DISABLED: HRESULT = 0x80004027; +pub const CO_E_CLRNOTAVAILABLE: HRESULT = 0x80004028; +pub const CO_E_ASYNC_WORK_REJECTED: HRESULT = 0x80004029; +pub const CO_E_SERVER_INIT_TIMEOUT: HRESULT = 0x8000402A; +pub const CO_E_NO_SECCTX_IN_ACTIVATE: HRESULT = 0x8000402B; +pub const CO_E_TRACKER_CONFIG: HRESULT = 0x80004030; +pub const CO_E_THREADPOOL_CONFIG: HRESULT = 0x80004031; +pub const CO_E_SXS_CONFIG: HRESULT = 0x80004032; +pub const CO_E_MALFORMED_SPN: HRESULT = 0x80004033; +pub const CO_E_UNREVOKED_REGISTRATION_ON_APARTMENT_SHUTDOWN: HRESULT = 0x80004034; +pub const CO_E_PREMATURE_STUB_RUNDOWN: HRESULT = 0x80004035; +pub const S_OK: HRESULT = 0; +pub const S_FALSE: HRESULT = 1; +pub const OLE_E_FIRST: HRESULT = 0x80040000; +pub const OLE_E_LAST: HRESULT = 0x800400FF; +pub const OLE_S_FIRST: HRESULT = 0x00040000; +pub const OLE_S_LAST: HRESULT = 0x000400FF; +pub const OLE_E_OLEVERB: HRESULT = 0x80040000; +pub const OLE_E_ADVF: HRESULT = 0x80040001; +pub const OLE_E_ENUM_NOMORE: HRESULT = 0x80040002; +pub const OLE_E_ADVISENOTSUPPORTED: HRESULT = 0x80040003; +pub const OLE_E_NOCONNECTION: HRESULT = 0x80040004; +pub const OLE_E_NOTRUNNING: HRESULT = 0x80040005; +pub const OLE_E_NOCACHE: HRESULT = 0x80040006; +pub const OLE_E_BLANK: HRESULT = 0x80040007; +pub const OLE_E_CLASSDIFF: HRESULT = 0x80040008; +pub const OLE_E_CANT_GETMONIKER: HRESULT = 0x80040009; +pub const OLE_E_CANT_BINDTOSOURCE: HRESULT = 0x8004000A; +pub const OLE_E_STATIC: HRESULT = 0x8004000B; +pub const OLE_E_PROMPTSAVECANCELLED: HRESULT = 0x8004000C; +pub const OLE_E_INVALIDRECT: HRESULT = 0x8004000D; +pub const OLE_E_WRONGCOMPOBJ: HRESULT = 0x8004000E; +pub const OLE_E_INVALIDHWND: HRESULT = 0x8004000F; +pub const OLE_E_NOT_INPLACEACTIVE: HRESULT = 0x80040010; +pub const OLE_E_CANTCONVERT: HRESULT = 0x80040011; +pub const OLE_E_NOSTORAGE: HRESULT = 0x80040012; +pub const DV_E_FORMATETC: HRESULT = 0x80040064; +pub const DV_E_DVTARGETDEVICE: HRESULT = 0x80040065; +pub const DV_E_STGMEDIUM: HRESULT = 0x80040066; +pub const DV_E_STATDATA: HRESULT = 0x80040067; +pub const DV_E_LINDEX: HRESULT = 0x80040068; +pub const DV_E_TYMED: HRESULT = 0x80040069; +pub const DV_E_CLIPFORMAT: HRESULT = 0x8004006A; +pub const DV_E_DVASPECT: HRESULT = 0x8004006B; +pub const DV_E_DVTARGETDEVICE_SIZE: HRESULT = 0x8004006C; +pub const DV_E_NOIVIEWOBJECT: HRESULT = 0x8004006D; +pub const DRAGDROP_E_FIRST: HRESULT = 0x80040100; +pub const DRAGDROP_E_LAST: HRESULT = 0x8004010F; +pub const DRAGDROP_S_FIRST: HRESULT = 0x00040100; +pub const DRAGDROP_S_LAST: HRESULT = 0x0004010F; +pub const DRAGDROP_E_NOTREGISTERED: HRESULT = 0x80040100; +pub const DRAGDROP_E_ALREADYREGISTERED: HRESULT = 0x80040101; +pub const DRAGDROP_E_INVALIDHWND: HRESULT = 0x80040102; +pub const DRAGDROP_E_CONCURRENT_DRAG_ATTEMPTED: HRESULT = 0x80040103; +pub const CLASSFACTORY_E_FIRST: HRESULT = 0x80040110; +pub const CLASSFACTORY_E_LAST: HRESULT = 0x8004011F; +pub const CLASSFACTORY_S_FIRST: HRESULT = 0x00040110; +pub const CLASSFACTORY_S_LAST: HRESULT = 0x0004011F; +pub const CLASS_E_NOAGGREGATION: HRESULT = 0x80040110; +pub const CLASS_E_CLASSNOTAVAILABLE: HRESULT = 0x80040111; +pub const CLASS_E_NOTLICENSED: HRESULT = 0x80040112; +pub const MARSHAL_E_FIRST: HRESULT = 0x80040120; +pub const MARSHAL_E_LAST: HRESULT = 0x8004012F; +pub const MARSHAL_S_FIRST: HRESULT = 0x00040120; +pub const MARSHAL_S_LAST: HRESULT = 0x0004012F; +pub const DATA_E_FIRST: HRESULT = 0x80040130; +pub const DATA_E_LAST: HRESULT = 0x8004013F; +pub const DATA_S_FIRST: HRESULT = 0x00040130; +pub const DATA_S_LAST: HRESULT = 0x0004013F; +pub const VIEW_E_FIRST: HRESULT = 0x80040140; +pub const VIEW_E_LAST: HRESULT = 0x8004014F; +pub const VIEW_S_FIRST: HRESULT = 0x00040140; +pub const VIEW_S_LAST: HRESULT = 0x0004014F; +pub const VIEW_E_DRAW: HRESULT = 0x80040140; +pub const REGDB_E_FIRST: HRESULT = 0x80040150; +pub const REGDB_E_LAST: HRESULT = 0x8004015F; +pub const REGDB_S_FIRST: HRESULT = 0x00040150; +pub const REGDB_S_LAST: HRESULT = 0x0004015F; +pub const REGDB_E_READREGDB: HRESULT = 0x80040150; +pub const REGDB_E_WRITEREGDB: HRESULT = 0x80040151; +pub const REGDB_E_KEYMISSING: HRESULT = 0x80040152; +pub const REGDB_E_INVALIDVALUE: HRESULT = 0x80040153; +pub const REGDB_E_CLASSNOTREG: HRESULT = 0x80040154; +pub const REGDB_E_IIDNOTREG: HRESULT = 0x80040155; +pub const REGDB_E_BADTHREADINGMODEL: HRESULT = 0x80040156; +pub const CAT_E_FIRST: HRESULT = 0x80040160; +pub const CAT_E_LAST: HRESULT = 0x80040161; +pub const CAT_E_CATIDNOEXIST: HRESULT = 0x80040160; +pub const CAT_E_NODESCRIPTION: HRESULT = 0x80040161; +pub const CS_E_FIRST: HRESULT = 0x80040164; +pub const CS_E_LAST: HRESULT = 0x8004016F; +pub const CS_E_PACKAGE_NOTFOUND: HRESULT = 0x80040164; +pub const CS_E_NOT_DELETABLE: HRESULT = 0x80040165; +pub const CS_E_CLASS_NOTFOUND: HRESULT = 0x80040166; +pub const CS_E_INVALID_VERSION: HRESULT = 0x80040167; +pub const CS_E_NO_CLASSSTORE: HRESULT = 0x80040168; +pub const CS_E_OBJECT_NOTFOUND: HRESULT = 0x80040169; +pub const CS_E_OBJECT_ALREADY_EXISTS: HRESULT = 0x8004016A; +pub const CS_E_INVALID_PATH: HRESULT = 0x8004016B; +pub const CS_E_NETWORK_ERROR: HRESULT = 0x8004016C; +pub const CS_E_ADMIN_LIMIT_EXCEEDED: HRESULT = 0x8004016D; +pub const CS_E_SCHEMA_MISMATCH: HRESULT = 0x8004016E; +pub const CS_E_INTERNAL_ERROR: HRESULT = 0x8004016F; +pub const CACHE_E_FIRST: HRESULT = 0x80040170; +pub const CACHE_E_LAST: HRESULT = 0x8004017F; +pub const CACHE_S_FIRST: HRESULT = 0x00040170; +pub const CACHE_S_LAST: HRESULT = 0x0004017F; +pub const CACHE_E_NOCACHE_UPDATED: HRESULT = 0x80040170; +pub const OLEOBJ_E_FIRST: HRESULT = 0x80040180; +pub const OLEOBJ_E_LAST: HRESULT = 0x8004018F; +pub const OLEOBJ_S_FIRST: HRESULT = 0x00040180; +pub const OLEOBJ_S_LAST: HRESULT = 0x0004018F; +pub const OLEOBJ_E_NOVERBS: HRESULT = 0x80040180; +pub const OLEOBJ_E_INVALIDVERB: HRESULT = 0x80040181; +pub const CLIENTSITE_E_FIRST: HRESULT = 0x80040190; +pub const CLIENTSITE_E_LAST: HRESULT = 0x8004019F; +pub const CLIENTSITE_S_FIRST: HRESULT = 0x00040190; +pub const CLIENTSITE_S_LAST: HRESULT = 0x0004019F; +pub const INPLACE_E_NOTUNDOABLE: HRESULT = 0x800401A0; +pub const INPLACE_E_NOTOOLSPACE: HRESULT = 0x800401A1; +pub const INPLACE_E_FIRST: HRESULT = 0x800401A0; +pub const INPLACE_E_LAST: HRESULT = 0x800401AF; +pub const INPLACE_S_FIRST: HRESULT = 0x000401A0; +pub const INPLACE_S_LAST: HRESULT = 0x000401AF; +pub const ENUM_E_FIRST: HRESULT = 0x800401B0; +pub const ENUM_E_LAST: HRESULT = 0x800401BF; +pub const ENUM_S_FIRST: HRESULT = 0x000401B0; +pub const ENUM_S_LAST: HRESULT = 0x000401BF; +pub const CONVERT10_E_FIRST: HRESULT = 0x800401C0; +pub const CONVERT10_E_LAST: HRESULT = 0x800401CF; +pub const CONVERT10_S_FIRST: HRESULT = 0x000401C0; +pub const CONVERT10_S_LAST: HRESULT = 0x000401CF; +pub const CONVERT10_E_OLESTREAM_GET: HRESULT = 0x800401C0; +pub const CONVERT10_E_OLESTREAM_PUT: HRESULT = 0x800401C1; +pub const CONVERT10_E_OLESTREAM_FMT: HRESULT = 0x800401C2; +pub const CONVERT10_E_OLESTREAM_BITMAP_TO_DIB: HRESULT = 0x800401C3; +pub const CONVERT10_E_STG_FMT: HRESULT = 0x800401C4; +pub const CONVERT10_E_STG_NO_STD_STREAM: HRESULT = 0x800401C5; +pub const CONVERT10_E_STG_DIB_TO_BITMAP: HRESULT = 0x800401C6; +pub const CLIPBRD_E_FIRST: HRESULT = 0x800401D0; +pub const CLIPBRD_E_LAST: HRESULT = 0x800401DF; +pub const CLIPBRD_S_FIRST: HRESULT = 0x000401D0; +pub const CLIPBRD_S_LAST: HRESULT = 0x000401DF; +pub const CLIPBRD_E_CANT_OPEN: HRESULT = 0x800401D0; +pub const CLIPBRD_E_CANT_EMPTY: HRESULT = 0x800401D1; +pub const CLIPBRD_E_CANT_SET: HRESULT = 0x800401D2; +pub const CLIPBRD_E_BAD_DATA: HRESULT = 0x800401D3; +pub const CLIPBRD_E_CANT_CLOSE: HRESULT = 0x800401D4; +pub const MK_E_FIRST: HRESULT = 0x800401E0; +pub const MK_E_LAST: HRESULT = 0x800401EF; +pub const MK_S_FIRST: HRESULT = 0x000401E0; +pub const MK_S_LAST: HRESULT = 0x000401EF; +pub const MK_E_CONNECTMANUALLY: HRESULT = 0x800401E0; +pub const MK_E_EXCEEDEDDEADLINE: HRESULT = 0x800401E1; +pub const MK_E_NEEDGENERIC: HRESULT = 0x800401E2; +pub const MK_E_UNAVAILABLE: HRESULT = 0x800401E3; +pub const MK_E_SYNTAX: HRESULT = 0x800401E4; +pub const MK_E_NOOBJECT: HRESULT = 0x800401E5; +pub const MK_E_INVALIDEXTENSION: HRESULT = 0x800401E6; +pub const MK_E_INTERMEDIATEINTERFACENOTSUPPORTED: HRESULT = 0x800401E7; +pub const MK_E_NOTBINDABLE: HRESULT = 0x800401E8; +pub const MK_E_NOTBOUND: HRESULT = 0x800401E9; +pub const MK_E_CANTOPENFILE: HRESULT = 0x800401EA; +pub const MK_E_MUSTBOTHERUSER: HRESULT = 0x800401EB; +pub const MK_E_NOINVERSE: HRESULT = 0x800401EC; +pub const MK_E_NOSTORAGE: HRESULT = 0x800401ED; +pub const MK_E_NOPREFIX: HRESULT = 0x800401EE; +pub const MK_E_ENUMERATION_FAILED: HRESULT = 0x800401EF; +pub const CO_E_FIRST: HRESULT = 0x800401F0; +pub const CO_E_LAST: HRESULT = 0x800401FF; +pub const CO_S_FIRST: HRESULT = 0x000401F0; +pub const CO_S_LAST: HRESULT = 0x000401FF; +pub const CO_E_NOTINITIALIZED: HRESULT = 0x800401F0; +pub const CO_E_ALREADYINITIALIZED: HRESULT = 0x800401F1; +pub const CO_E_CANTDETERMINECLASS: HRESULT = 0x800401F2; +pub const CO_E_CLASSSTRING: HRESULT = 0x800401F3; +pub const CO_E_IIDSTRING: HRESULT = 0x800401F4; +pub const CO_E_APPNOTFOUND: HRESULT = 0x800401F5; +pub const CO_E_APPSINGLEUSE: HRESULT = 0x800401F6; +pub const CO_E_ERRORINAPP: HRESULT = 0x800401F7; +pub const CO_E_DLLNOTFOUND: HRESULT = 0x800401F8; +pub const CO_E_ERRORINDLL: HRESULT = 0x800401F9; +pub const CO_E_WRONGOSFORAPP: HRESULT = 0x800401FA; +pub const CO_E_OBJNOTREG: HRESULT = 0x800401FB; +pub const CO_E_OBJISREG: HRESULT = 0x800401FC; +pub const CO_E_OBJNOTCONNECTED: HRESULT = 0x800401FD; +pub const CO_E_APPDIDNTREG: HRESULT = 0x800401FE; +pub const CO_E_RELEASED: HRESULT = 0x800401FF; +pub const EVENT_E_FIRST: HRESULT = 0x80040200; +pub const EVENT_E_LAST: HRESULT = 0x8004021F; +pub const EVENT_S_FIRST: HRESULT = 0x00040200; +pub const EVENT_S_LAST: HRESULT = 0x0004021F; +pub const EVENT_S_SOME_SUBSCRIBERS_FAILED: HRESULT = 0x00040200; +pub const EVENT_E_ALL_SUBSCRIBERS_FAILED: HRESULT = 0x80040201; +pub const EVENT_S_NOSUBSCRIBERS: HRESULT = 0x00040202; +pub const EVENT_E_QUERYSYNTAX: HRESULT = 0x80040203; +pub const EVENT_E_QUERYFIELD: HRESULT = 0x80040204; +pub const EVENT_E_INTERNALEXCEPTION: HRESULT = 0x80040205; +pub const EVENT_E_INTERNALERROR: HRESULT = 0x80040206; +pub const EVENT_E_INVALID_PER_USER_SID: HRESULT = 0x80040207; +pub const EVENT_E_USER_EXCEPTION: HRESULT = 0x80040208; +pub const EVENT_E_TOO_MANY_METHODS: HRESULT = 0x80040209; +pub const EVENT_E_MISSING_EVENTCLASS: HRESULT = 0x8004020A; +pub const EVENT_E_NOT_ALL_REMOVED: HRESULT = 0x8004020B; +pub const EVENT_E_COMPLUS_NOT_INSTALLED: HRESULT = 0x8004020C; +pub const EVENT_E_CANT_MODIFY_OR_DELETE_UNCONFIGURED_OBJECT: HRESULT = 0x8004020D; +pub const EVENT_E_CANT_MODIFY_OR_DELETE_CONFIGURED_OBJECT: HRESULT = 0x8004020E; +pub const EVENT_E_INVALID_EVENT_CLASS_PARTITION: HRESULT = 0x8004020F; +pub const EVENT_E_PER_USER_SID_NOT_LOGGED_ON: HRESULT = 0x80040210; +pub const TPC_E_INVALID_PROPERTY: HRESULT = 0x80040241; +pub const TPC_E_NO_DEFAULT_TABLET: HRESULT = 0x80040212; +pub const TPC_E_UNKNOWN_PROPERTY: HRESULT = 0x8004021B; +pub const TPC_E_INVALID_INPUT_RECT: HRESULT = 0x80040219; +pub const TPC_E_INVALID_STROKE: HRESULT = 0x80040222; +pub const TPC_E_INITIALIZE_FAIL: HRESULT = 0x80040223; +pub const TPC_E_NOT_RELEVANT: HRESULT = 0x80040232; +pub const TPC_E_INVALID_PACKET_DESCRIPTION: HRESULT = 0x80040233; +pub const TPC_E_RECOGNIZER_NOT_REGISTERED: HRESULT = 0x80040235; +pub const TPC_E_INVALID_RIGHTS: HRESULT = 0x80040236; +pub const TPC_E_OUT_OF_ORDER_CALL: HRESULT = 0x80040237; +pub const TPC_E_QUEUE_FULL: HRESULT = 0x80040238; +pub const TPC_E_INVALID_CONFIGURATION: HRESULT = 0x80040239; +pub const TPC_E_INVALID_DATA_FROM_RECOGNIZER: HRESULT = 0x8004023A; +pub const TPC_S_TRUNCATED: HRESULT = 0x00040252; +pub const TPC_S_INTERRUPTED: HRESULT = 0x00040253; +pub const TPC_S_NO_DATA_TO_PROCESS: HRESULT = 0x00040254; +pub const XACT_E_FIRST: HRESULT = 0x8004D000; +pub const XACT_E_LAST: HRESULT = 0x8004D02B; +pub const XACT_S_FIRST: HRESULT = 0x0004D000; +pub const XACT_S_LAST: HRESULT = 0x0004D010; +pub const XACT_E_ALREADYOTHERSINGLEPHASE: HRESULT = 0x8004D000; +pub const XACT_E_CANTRETAIN: HRESULT = 0x8004D001; +pub const XACT_E_COMMITFAILED: HRESULT = 0x8004D002; +pub const XACT_E_COMMITPREVENTED: HRESULT = 0x8004D003; +pub const XACT_E_HEURISTICABORT: HRESULT = 0x8004D004; +pub const XACT_E_HEURISTICCOMMIT: HRESULT = 0x8004D005; +pub const XACT_E_HEURISTICDAMAGE: HRESULT = 0x8004D006; +pub const XACT_E_HEURISTICDANGER: HRESULT = 0x8004D007; +pub const XACT_E_ISOLATIONLEVEL: HRESULT = 0x8004D008; +pub const XACT_E_NOASYNC: HRESULT = 0x8004D009; +pub const XACT_E_NOENLIST: HRESULT = 0x8004D00A; +pub const XACT_E_NOISORETAIN: HRESULT = 0x8004D00B; +pub const XACT_E_NORESOURCE: HRESULT = 0x8004D00C; +pub const XACT_E_NOTCURRENT: HRESULT = 0x8004D00D; +pub const XACT_E_NOTRANSACTION: HRESULT = 0x8004D00E; +pub const XACT_E_NOTSUPPORTED: HRESULT = 0x8004D00F; +pub const XACT_E_UNKNOWNRMGRID: HRESULT = 0x8004D010; +pub const XACT_E_WRONGSTATE: HRESULT = 0x8004D011; +pub const XACT_E_WRONGUOW: HRESULT = 0x8004D012; +pub const XACT_E_XTIONEXISTS: HRESULT = 0x8004D013; +pub const XACT_E_NOIMPORTOBJECT: HRESULT = 0x8004D014; +pub const XACT_E_INVALIDCOOKIE: HRESULT = 0x8004D015; +pub const XACT_E_INDOUBT: HRESULT = 0x8004D016; +pub const XACT_E_NOTIMEOUT: HRESULT = 0x8004D017; +pub const XACT_E_ALREADYINPROGRESS: HRESULT = 0x8004D018; +pub const XACT_E_ABORTED: HRESULT = 0x8004D019; +pub const XACT_E_LOGFULL: HRESULT = 0x8004D01A; +pub const XACT_E_TMNOTAVAILABLE: HRESULT = 0x8004D01B; +pub const XACT_E_CONNECTION_DOWN: HRESULT = 0x8004D01C; +pub const XACT_E_CONNECTION_DENIED: HRESULT = 0x8004D01D; +pub const XACT_E_REENLISTTIMEOUT: HRESULT = 0x8004D01E; +pub const XACT_E_TIP_CONNECT_FAILED: HRESULT = 0x8004D01F; +pub const XACT_E_TIP_PROTOCOL_ERROR: HRESULT = 0x8004D020; +pub const XACT_E_TIP_PULL_FAILED: HRESULT = 0x8004D021; +pub const XACT_E_DEST_TMNOTAVAILABLE: HRESULT = 0x8004D022; +pub const XACT_E_TIP_DISABLED: HRESULT = 0x8004D023; +pub const XACT_E_NETWORK_TX_DISABLED: HRESULT = 0x8004D024; +pub const XACT_E_PARTNER_NETWORK_TX_DISABLED: HRESULT = 0x8004D025; +pub const XACT_E_XA_TX_DISABLED: HRESULT = 0x8004D026; +pub const XACT_E_UNABLE_TO_READ_DTC_CONFIG: HRESULT = 0x8004D027; +pub const XACT_E_UNABLE_TO_LOAD_DTC_PROXY: HRESULT = 0x8004D028; +pub const XACT_E_ABORTING: HRESULT = 0x8004D029; +pub const XACT_E_PUSH_COMM_FAILURE: HRESULT = 0x8004D02A; +pub const XACT_E_PULL_COMM_FAILURE: HRESULT = 0x8004D02B; +pub const XACT_E_LU_TX_DISABLED: HRESULT = 0x8004D02C; +pub const XACT_E_CLERKNOTFOUND: HRESULT = 0x8004D080; +pub const XACT_E_CLERKEXISTS: HRESULT = 0x8004D081; +pub const XACT_E_RECOVERYINPROGRESS: HRESULT = 0x8004D082; +pub const XACT_E_TRANSACTIONCLOSED: HRESULT = 0x8004D083; +pub const XACT_E_INVALIDLSN: HRESULT = 0x8004D084; +pub const XACT_E_REPLAYREQUEST: HRESULT = 0x8004D085; +pub const XACT_S_ASYNC: HRESULT = 0x0004D000; +pub const XACT_S_DEFECT: HRESULT = 0x0004D001; +pub const XACT_S_READONLY: HRESULT = 0x0004D002; +pub const XACT_S_SOMENORETAIN: HRESULT = 0x0004D003; +pub const XACT_S_OKINFORM: HRESULT = 0x0004D004; +pub const XACT_S_MADECHANGESCONTENT: HRESULT = 0x0004D005; +pub const XACT_S_MADECHANGESINFORM: HRESULT = 0x0004D006; +pub const XACT_S_ALLNORETAIN: HRESULT = 0x0004D007; +pub const XACT_S_ABORTING: HRESULT = 0x0004D008; +pub const XACT_S_SINGLEPHASE: HRESULT = 0x0004D009; +pub const XACT_S_LOCALLY_OK: HRESULT = 0x0004D00A; +pub const XACT_S_LASTRESOURCEMANAGER: HRESULT = 0x0004D010; +pub const CONTEXT_E_FIRST: HRESULT = 0x8004E000; +pub const CONTEXT_E_LAST: HRESULT = 0x8004E02F; +pub const CONTEXT_S_FIRST: HRESULT = 0x0004E000; +pub const CONTEXT_S_LAST: HRESULT = 0x0004E02F; +pub const CONTEXT_E_ABORTED: HRESULT = 0x8004E002; +pub const CONTEXT_E_ABORTING: HRESULT = 0x8004E003; +pub const CONTEXT_E_NOCONTEXT: HRESULT = 0x8004E004; +pub const CONTEXT_E_WOULD_DEADLOCK: HRESULT = 0x8004E005; +pub const CONTEXT_E_SYNCH_TIMEOUT: HRESULT = 0x8004E006; +pub const CONTEXT_E_OLDREF: HRESULT = 0x8004E007; +pub const CONTEXT_E_ROLENOTFOUND: HRESULT = 0x8004E00C; +pub const CONTEXT_E_TMNOTAVAILABLE: HRESULT = 0x8004E00F; +pub const CO_E_ACTIVATIONFAILED: HRESULT = 0x8004E021; +pub const CO_E_ACTIVATIONFAILED_EVENTLOGGED: HRESULT = 0x8004E022; +pub const CO_E_ACTIVATIONFAILED_CATALOGERROR: HRESULT = 0x8004E023; +pub const CO_E_ACTIVATIONFAILED_TIMEOUT: HRESULT = 0x8004E024; +pub const CO_E_INITIALIZATIONFAILED: HRESULT = 0x8004E025; +pub const CONTEXT_E_NOJIT: HRESULT = 0x8004E026; +pub const CONTEXT_E_NOTRANSACTION: HRESULT = 0x8004E027; +pub const CO_E_THREADINGMODEL_CHANGED: HRESULT = 0x8004E028; +pub const CO_E_NOIISINTRINSICS: HRESULT = 0x8004E029; +pub const CO_E_NOCOOKIES: HRESULT = 0x8004E02A; +pub const CO_E_DBERROR: HRESULT = 0x8004E02B; +pub const CO_E_NOTPOOLED: HRESULT = 0x8004E02C; +pub const CO_E_NOTCONSTRUCTED: HRESULT = 0x8004E02D; +pub const CO_E_NOSYNCHRONIZATION: HRESULT = 0x8004E02E; +pub const CO_E_ISOLEVELMISMATCH: HRESULT = 0x8004E02F; +pub const CO_E_CALL_OUT_OF_TX_SCOPE_NOT_ALLOWED: HRESULT = 0x8004E030; +pub const CO_E_EXIT_TRANSACTION_SCOPE_NOT_CALLED: HRESULT = 0x8004E031; +pub const OLE_S_USEREG: HRESULT = 0x00040000; +pub const OLE_S_STATIC: HRESULT = 0x00040001; +pub const OLE_S_MAC_CLIPFORMAT: HRESULT = 0x00040002; +pub const DRAGDROP_S_DROP: HRESULT = 0x00040100; +pub const DRAGDROP_S_CANCEL: HRESULT = 0x00040101; +pub const DRAGDROP_S_USEDEFAULTCURSORS: HRESULT = 0x00040102; +pub const DATA_S_SAMEFORMATETC: HRESULT = 0x00040130; +pub const VIEW_S_ALREADY_FROZEN: HRESULT = 0x00040140; +pub const CACHE_S_FORMATETC_NOTSUPPORTED: HRESULT = 0x00040170; +pub const CACHE_S_SAMECACHE: HRESULT = 0x00040171; +pub const CACHE_S_SOMECACHES_NOTUPDATED: HRESULT = 0x00040172; +pub const OLEOBJ_S_INVALIDVERB: HRESULT = 0x00040180; +pub const OLEOBJ_S_CANNOT_DOVERB_NOW: HRESULT = 0x00040181; +pub const OLEOBJ_S_INVALIDHWND: HRESULT = 0x00040182; +pub const INPLACE_S_TRUNCATED: HRESULT = 0x000401A0; +pub const CONVERT10_S_NO_PRESENTATION: HRESULT = 0x000401C0; +pub const MK_S_REDUCED_TO_SELF: HRESULT = 0x000401E2; +pub const MK_S_ME: HRESULT = 0x000401E4; +pub const MK_S_HIM: HRESULT = 0x000401E5; +pub const MK_S_US: HRESULT = 0x000401E6; +pub const MK_S_MONIKERALREADYREGISTERED: HRESULT = 0x000401E7; +pub const SCHED_S_TASK_READY: HRESULT = 0x00041300; +pub const SCHED_S_TASK_RUNNING: HRESULT = 0x00041301; +pub const SCHED_S_TASK_DISABLED: HRESULT = 0x00041302; +pub const SCHED_S_TASK_HAS_NOT_RUN: HRESULT = 0x00041303; +pub const SCHED_S_TASK_NO_MORE_RUNS: HRESULT = 0x00041304; +pub const SCHED_S_TASK_NOT_SCHEDULED: HRESULT = 0x00041305; +pub const SCHED_S_TASK_TERMINATED: HRESULT = 0x00041306; +pub const SCHED_S_TASK_NO_VALID_TRIGGERS: HRESULT = 0x00041307; +pub const SCHED_S_EVENT_TRIGGER: HRESULT = 0x00041308; +pub const SCHED_E_TRIGGER_NOT_FOUND: HRESULT = 0x80041309; +pub const SCHED_E_TASK_NOT_READY: HRESULT = 0x8004130A; +pub const SCHED_E_TASK_NOT_RUNNING: HRESULT = 0x8004130B; +pub const SCHED_E_SERVICE_NOT_INSTALLED: HRESULT = 0x8004130C; +pub const SCHED_E_CANNOT_OPEN_TASK: HRESULT = 0x8004130D; +pub const SCHED_E_INVALID_TASK: HRESULT = 0x8004130E; +pub const SCHED_E_ACCOUNT_INFORMATION_NOT_SET: HRESULT = 0x8004130F; +pub const SCHED_E_ACCOUNT_NAME_NOT_FOUND: HRESULT = 0x80041310; +pub const SCHED_E_ACCOUNT_DBASE_CORRUPT: HRESULT = 0x80041311; +pub const SCHED_E_NO_SECURITY_SERVICES: HRESULT = 0x80041312; +pub const SCHED_E_UNKNOWN_OBJECT_VERSION: HRESULT = 0x80041313; +pub const SCHED_E_UNSUPPORTED_ACCOUNT_OPTION: HRESULT = 0x80041314; +pub const SCHED_E_SERVICE_NOT_RUNNING: HRESULT = 0x80041315; +pub const SCHED_E_UNEXPECTEDNODE: HRESULT = 0x80041316; +pub const SCHED_E_NAMESPACE: HRESULT = 0x80041317; +pub const SCHED_E_INVALIDVALUE: HRESULT = 0x80041318; +pub const SCHED_E_MISSINGNODE: HRESULT = 0x80041319; +pub const SCHED_E_MALFORMEDXML: HRESULT = 0x8004131A; +pub const SCHED_S_SOME_TRIGGERS_FAILED: HRESULT = 0x0004131B; +pub const SCHED_S_BATCH_LOGON_PROBLEM: HRESULT = 0x0004131C; +pub const SCHED_E_TOO_MANY_NODES: HRESULT = 0x8004131D; +pub const SCHED_E_PAST_END_BOUNDARY: HRESULT = 0x8004131E; +pub const SCHED_E_ALREADY_RUNNING: HRESULT = 0x8004131F; +pub const SCHED_E_USER_NOT_LOGGED_ON: HRESULT = 0x80041320; +pub const SCHED_E_INVALID_TASK_HASH: HRESULT = 0x80041321; +pub const SCHED_E_SERVICE_NOT_AVAILABLE: HRESULT = 0x80041322; +pub const SCHED_E_SERVICE_TOO_BUSY: HRESULT = 0x80041323; +pub const SCHED_E_TASK_ATTEMPTED: HRESULT = 0x80041324; +pub const SCHED_S_TASK_QUEUED: HRESULT = 0x00041325; +pub const SCHED_E_TASK_DISABLED: HRESULT = 0x80041326; +pub const SCHED_E_TASK_NOT_V1_COMPAT: HRESULT = 0x80041327; +pub const SCHED_E_START_ON_DEMAND: HRESULT = 0x80041328; +pub const SCHED_E_TASK_NOT_UBPM_COMPAT: HRESULT = 0x80041329; +pub const SCHED_E_DEPRECATED_FEATURE_USED: HRESULT = 0x80041330; +pub const CO_E_CLASS_CREATE_FAILED: HRESULT = 0x80080001; +pub const CO_E_SCM_ERROR: HRESULT = 0x80080002; +pub const CO_E_SCM_RPC_FAILURE: HRESULT = 0x80080003; +pub const CO_E_BAD_PATH: HRESULT = 0x80080004; +pub const CO_E_SERVER_EXEC_FAILURE: HRESULT = 0x80080005; +pub const CO_E_OBJSRV_RPC_FAILURE: HRESULT = 0x80080006; +pub const MK_E_NO_NORMALIZED: HRESULT = 0x80080007; +pub const CO_E_SERVER_STOPPING: HRESULT = 0x80080008; +pub const MEM_E_INVALID_ROOT: HRESULT = 0x80080009; +pub const MEM_E_INVALID_LINK: HRESULT = 0x80080010; +pub const MEM_E_INVALID_SIZE: HRESULT = 0x80080011; +pub const CO_S_NOTALLINTERFACES: HRESULT = 0x00080012; +pub const CO_S_MACHINENAMENOTFOUND: HRESULT = 0x00080013; +pub const CO_E_MISSING_DISPLAYNAME: HRESULT = 0x80080015; +pub const CO_E_RUNAS_VALUE_MUST_BE_AAA: HRESULT = 0x80080016; +pub const CO_E_ELEVATION_DISABLED: HRESULT = 0x80080017; +pub const APPX_E_PACKAGING_INTERNAL: HRESULT = 0x80080200; +pub const APPX_E_INTERLEAVING_NOT_ALLOWED: HRESULT = 0x80080201; +pub const APPX_E_RELATIONSHIPS_NOT_ALLOWED: HRESULT = 0x80080202; +pub const APPX_E_MISSING_REQUIRED_FILE: HRESULT = 0x80080203; +pub const APPX_E_INVALID_MANIFEST: HRESULT = 0x80080204; +pub const APPX_E_INVALID_BLOCKMAP: HRESULT = 0x80080205; +pub const APPX_E_CORRUPT_CONTENT: HRESULT = 0x80080206; +pub const APPX_E_BLOCK_HASH_INVALID: HRESULT = 0x80080207; +pub const APPX_E_REQUESTED_RANGE_TOO_LARGE: HRESULT = 0x80080208; +pub const APPX_E_INVALID_SIP_CLIENT_DATA: HRESULT = 0x80080209; +pub const BT_E_SPURIOUS_ACTIVATION: HRESULT = 0x80080300; +pub const DISP_E_UNKNOWNINTERFACE: HRESULT = 0x80020001; +pub const DISP_E_MEMBERNOTFOUND: HRESULT = 0x80020003; +pub const DISP_E_PARAMNOTFOUND: HRESULT = 0x80020004; +pub const DISP_E_TYPEMISMATCH: HRESULT = 0x80020005; +pub const DISP_E_UNKNOWNNAME: HRESULT = 0x80020006; +pub const DISP_E_NONAMEDARGS: HRESULT = 0x80020007; +pub const DISP_E_BADVARTYPE: HRESULT = 0x80020008; +pub const DISP_E_EXCEPTION: HRESULT = 0x80020009; +pub const DISP_E_OVERFLOW: HRESULT = 0x8002000A; +pub const DISP_E_BADINDEX: HRESULT = 0x8002000B; +pub const DISP_E_UNKNOWNLCID: HRESULT = 0x8002000C; +pub const DISP_E_ARRAYISLOCKED: HRESULT = 0x8002000D; +pub const DISP_E_BADPARAMCOUNT: HRESULT = 0x8002000E; +pub const DISP_E_PARAMNOTOPTIONAL: HRESULT = 0x8002000F; +pub const DISP_E_BADCALLEE: HRESULT = 0x80020010; +pub const DISP_E_NOTACOLLECTION: HRESULT = 0x80020011; +pub const DISP_E_DIVBYZERO: HRESULT = 0x80020012; +pub const DISP_E_BUFFERTOOSMALL: HRESULT = 0x80020013; +pub const TYPE_E_BUFFERTOOSMALL: HRESULT = 0x80028016; +pub const TYPE_E_FIELDNOTFOUND: HRESULT = 0x80028017; +pub const TYPE_E_INVDATAREAD: HRESULT = 0x80028018; +pub const TYPE_E_UNSUPFORMAT: HRESULT = 0x80028019; +pub const TYPE_E_REGISTRYACCESS: HRESULT = 0x8002801C; +pub const TYPE_E_LIBNOTREGISTERED: HRESULT = 0x8002801D; +pub const TYPE_E_UNDEFINEDTYPE: HRESULT = 0x80028027; +pub const TYPE_E_QUALIFIEDNAMEDISALLOWED: HRESULT = 0x80028028; +pub const TYPE_E_INVALIDSTATE: HRESULT = 0x80028029; +pub const TYPE_E_WRONGTYPEKIND: HRESULT = 0x8002802A; +pub const TYPE_E_ELEMENTNOTFOUND: HRESULT = 0x8002802B; +pub const TYPE_E_AMBIGUOUSNAME: HRESULT = 0x8002802C; +pub const TYPE_E_NAMECONFLICT: HRESULT = 0x8002802D; +pub const TYPE_E_UNKNOWNLCID: HRESULT = 0x8002802E; +pub const TYPE_E_DLLFUNCTIONNOTFOUND: HRESULT = 0x8002802F; +pub const TYPE_E_BADMODULEKIND: HRESULT = 0x800288BD; +pub const TYPE_E_SIZETOOBIG: HRESULT = 0x800288C5; +pub const TYPE_E_DUPLICATEID: HRESULT = 0x800288C6; +pub const TYPE_E_INVALIDID: HRESULT = 0x800288CF; +pub const TYPE_E_TYPEMISMATCH: HRESULT = 0x80028CA0; +pub const TYPE_E_OUTOFBOUNDS: HRESULT = 0x80028CA1; +pub const TYPE_E_IOERROR: HRESULT = 0x80028CA2; +pub const TYPE_E_CANTCREATETMPFILE: HRESULT = 0x80028CA3; +pub const TYPE_E_CANTLOADLIBRARY: HRESULT = 0x80029C4A; +pub const TYPE_E_INCONSISTENTPROPFUNCS: HRESULT = 0x80029C83; +pub const TYPE_E_CIRCULARTYPE: HRESULT = 0x80029C84; +pub const STG_E_INVALIDFUNCTION: HRESULT = 0x80030001; +pub const STG_E_FILENOTFOUND: HRESULT = 0x80030002; +pub const STG_E_PATHNOTFOUND: HRESULT = 0x80030003; +pub const STG_E_TOOMANYOPENFILES: HRESULT = 0x80030004; +pub const STG_E_ACCESSDENIED: HRESULT = 0x80030005; +pub const STG_E_INVALIDHANDLE: HRESULT = 0x80030006; +pub const STG_E_INSUFFICIENTMEMORY: HRESULT = 0x80030008; +pub const STG_E_INVALIDPOINTER: HRESULT = 0x80030009; +pub const STG_E_NOMOREFILES: HRESULT = 0x80030012; +pub const STG_E_DISKISWRITEPROTECTED: HRESULT = 0x80030013; +pub const STG_E_SEEKERROR: HRESULT = 0x80030019; +pub const STG_E_WRITEFAULT: HRESULT = 0x8003001D; +pub const STG_E_READFAULT: HRESULT = 0x8003001E; +pub const STG_E_SHAREVIOLATION: HRESULT = 0x80030020; +pub const STG_E_LOCKVIOLATION: HRESULT = 0x80030021; +pub const STG_E_FILEALREADYEXISTS: HRESULT = 0x80030050; +pub const STG_E_INVALIDPARAMETER: HRESULT = 0x80030057; +pub const STG_E_MEDIUMFULL: HRESULT = 0x80030070; +pub const STG_E_PROPSETMISMATCHED: HRESULT = 0x800300F0; +pub const STG_E_ABNORMALAPIEXIT: HRESULT = 0x800300FA; +pub const STG_E_INVALIDHEADER: HRESULT = 0x800300FB; +pub const STG_E_INVALIDNAME: HRESULT = 0x800300FC; +pub const STG_E_UNKNOWN: HRESULT = 0x800300FD; +pub const STG_E_UNIMPLEMENTEDFUNCTION: HRESULT = 0x800300FE; +pub const STG_E_INVALIDFLAG: HRESULT = 0x800300FF; +pub const STG_E_INUSE: HRESULT = 0x80030100; +pub const STG_E_NOTCURRENT: HRESULT = 0x80030101; +pub const STG_E_REVERTED: HRESULT = 0x80030102; +pub const STG_E_CANTSAVE: HRESULT = 0x80030103; +pub const STG_E_OLDFORMAT: HRESULT = 0x80030104; +pub const STG_E_OLDDLL: HRESULT = 0x80030105; +pub const STG_E_SHAREREQUIRED: HRESULT = 0x80030106; +pub const STG_E_NOTFILEBASEDSTORAGE: HRESULT = 0x80030107; +pub const STG_E_EXTANTMARSHALLINGS: HRESULT = 0x80030108; +pub const STG_E_DOCFILECORRUPT: HRESULT = 0x80030109; +pub const STG_E_BADBASEADDRESS: HRESULT = 0x80030110; +pub const STG_E_DOCFILETOOLARGE: HRESULT = 0x80030111; +pub const STG_E_NOTSIMPLEFORMAT: HRESULT = 0x80030112; +pub const STG_E_INCOMPLETE: HRESULT = 0x80030201; +pub const STG_E_TERMINATED: HRESULT = 0x80030202; +pub const STG_S_CONVERTED: HRESULT = 0x00030200; +pub const STG_S_BLOCK: HRESULT = 0x00030201; +pub const STG_S_RETRYNOW: HRESULT = 0x00030202; +pub const STG_S_MONITORING: HRESULT = 0x00030203; +pub const STG_S_MULTIPLEOPENS: HRESULT = 0x00030204; +pub const STG_S_CONSOLIDATIONFAILED: HRESULT = 0x00030205; +pub const STG_S_CANNOTCONSOLIDATE: HRESULT = 0x00030206; +pub const STG_E_STATUS_COPY_PROTECTION_FAILURE: HRESULT = 0x80030305; +pub const STG_E_CSS_AUTHENTICATION_FAILURE: HRESULT = 0x80030306; +pub const STG_E_CSS_KEY_NOT_PRESENT: HRESULT = 0x80030307; +pub const STG_E_CSS_KEY_NOT_ESTABLISHED: HRESULT = 0x80030308; +pub const STG_E_CSS_SCRAMBLED_SECTOR: HRESULT = 0x80030309; +pub const STG_E_CSS_REGION_MISMATCH: HRESULT = 0x8003030A; +pub const STG_E_RESETS_EXHAUSTED: HRESULT = 0x8003030B; +pub const RPC_E_CALL_REJECTED: HRESULT = 0x80010001; +pub const RPC_E_CALL_CANCELED: HRESULT = 0x80010002; +pub const RPC_E_CANTPOST_INSENDCALL: HRESULT = 0x80010003; +pub const RPC_E_CANTCALLOUT_INASYNCCALL: HRESULT = 0x80010004; +pub const RPC_E_CANTCALLOUT_INEXTERNALCALL: HRESULT = 0x80010005; +pub const RPC_E_CONNECTION_TERMINATED: HRESULT = 0x80010006; +pub const RPC_E_SERVER_DIED: HRESULT = 0x80010007; +pub const RPC_E_CLIENT_DIED: HRESULT = 0x80010008; +pub const RPC_E_INVALID_DATAPACKET: HRESULT = 0x80010009; +pub const RPC_E_CANTTRANSMIT_CALL: HRESULT = 0x8001000A; +pub const RPC_E_CLIENT_CANTMARSHAL_DATA: HRESULT = 0x8001000B; +pub const RPC_E_CLIENT_CANTUNMARSHAL_DATA: HRESULT = 0x8001000C; +pub const RPC_E_SERVER_CANTMARSHAL_DATA: HRESULT = 0x8001000D; +pub const RPC_E_SERVER_CANTUNMARSHAL_DATA: HRESULT = 0x8001000E; +pub const RPC_E_INVALID_DATA: HRESULT = 0x8001000F; +pub const RPC_E_INVALID_PARAMETER: HRESULT = 0x80010010; +pub const RPC_E_CANTCALLOUT_AGAIN: HRESULT = 0x80010011; +pub const RPC_E_SERVER_DIED_DNE: HRESULT = 0x80010012; +pub const RPC_E_SYS_CALL_FAILED: HRESULT = 0x80010100; +pub const RPC_E_OUT_OF_RESOURCES: HRESULT = 0x80010101; +pub const RPC_E_ATTEMPTED_MULTITHREAD: HRESULT = 0x80010102; +pub const RPC_E_NOT_REGISTERED: HRESULT = 0x80010103; +pub const RPC_E_FAULT: HRESULT = 0x80010104; +pub const RPC_E_SERVERFAULT: HRESULT = 0x80010105; +pub const RPC_E_CHANGED_MODE: HRESULT = 0x80010106; +pub const RPC_E_INVALIDMETHOD: HRESULT = 0x80010107; +pub const RPC_E_DISCONNECTED: HRESULT = 0x80010108; +pub const RPC_E_RETRY: HRESULT = 0x80010109; +pub const RPC_E_SERVERCALL_RETRYLATER: HRESULT = 0x8001010A; +pub const RPC_E_SERVERCALL_REJECTED: HRESULT = 0x8001010B; +pub const RPC_E_INVALID_CALLDATA: HRESULT = 0x8001010C; +pub const RPC_E_CANTCALLOUT_ININPUTSYNCCALL: HRESULT = 0x8001010D; +pub const RPC_E_WRONG_THREAD: HRESULT = 0x8001010E; +pub const RPC_E_THREAD_NOT_INIT: HRESULT = 0x8001010F; +pub const RPC_E_VERSION_MISMATCH: HRESULT = 0x80010110; +pub const RPC_E_INVALID_HEADER: HRESULT = 0x80010111; +pub const RPC_E_INVALID_EXTENSION: HRESULT = 0x80010112; +pub const RPC_E_INVALID_IPID: HRESULT = 0x80010113; +pub const RPC_E_INVALID_OBJECT: HRESULT = 0x80010114; +pub const RPC_S_CALLPENDING: HRESULT = 0x80010115; +pub const RPC_S_WAITONTIMER: HRESULT = 0x80010116; +pub const RPC_E_CALL_COMPLETE: HRESULT = 0x80010117; +pub const RPC_E_UNSECURE_CALL: HRESULT = 0x80010118; +pub const RPC_E_TOO_LATE: HRESULT = 0x80010119; +pub const RPC_E_NO_GOOD_SECURITY_PACKAGES: HRESULT = 0x8001011A; +pub const RPC_E_ACCESS_DENIED: HRESULT = 0x8001011B; +pub const RPC_E_REMOTE_DISABLED: HRESULT = 0x8001011C; +pub const RPC_E_INVALID_OBJREF: HRESULT = 0x8001011D; +pub const RPC_E_NO_CONTEXT: HRESULT = 0x8001011E; +pub const RPC_E_TIMEOUT: HRESULT = 0x8001011F; +pub const RPC_E_NO_SYNC: HRESULT = 0x80010120; +pub const RPC_E_FULLSIC_REQUIRED: HRESULT = 0x80010121; +pub const RPC_E_INVALID_STD_NAME: HRESULT = 0x80010122; +pub const CO_E_FAILEDTOIMPERSONATE: HRESULT = 0x80010123; +pub const CO_E_FAILEDTOGETSECCTX: HRESULT = 0x80010124; +pub const CO_E_FAILEDTOOPENTHREADTOKEN: HRESULT = 0x80010125; +pub const CO_E_FAILEDTOGETTOKENINFO: HRESULT = 0x80010126; +pub const CO_E_TRUSTEEDOESNTMATCHCLIENT: HRESULT = 0x80010127; +pub const CO_E_FAILEDTOQUERYCLIENTBLANKET: HRESULT = 0x80010128; +pub const CO_E_FAILEDTOSETDACL: HRESULT = 0x80010129; +pub const CO_E_ACCESSCHECKFAILED: HRESULT = 0x8001012A; +pub const CO_E_NETACCESSAPIFAILED: HRESULT = 0x8001012B; +pub const CO_E_WRONGTRUSTEENAMESYNTAX: HRESULT = 0x8001012C; +pub const CO_E_INVALIDSID: HRESULT = 0x8001012D; +pub const CO_E_CONVERSIONFAILED: HRESULT = 0x8001012E; +pub const CO_E_NOMATCHINGSIDFOUND: HRESULT = 0x8001012F; +pub const CO_E_LOOKUPACCSIDFAILED: HRESULT = 0x80010130; +pub const CO_E_NOMATCHINGNAMEFOUND: HRESULT = 0x80010131; +pub const CO_E_LOOKUPACCNAMEFAILED: HRESULT = 0x80010132; +pub const CO_E_SETSERLHNDLFAILED: HRESULT = 0x80010133; +pub const CO_E_FAILEDTOGETWINDIR: HRESULT = 0x80010134; +pub const CO_E_PATHTOOLONG: HRESULT = 0x80010135; +pub const CO_E_FAILEDTOGENUUID: HRESULT = 0x80010136; +pub const CO_E_FAILEDTOCREATEFILE: HRESULT = 0x80010137; +pub const CO_E_FAILEDTOCLOSEHANDLE: HRESULT = 0x80010138; +pub const CO_E_EXCEEDSYSACLLIMIT: HRESULT = 0x80010139; +pub const CO_E_ACESINWRONGORDER: HRESULT = 0x8001013A; +pub const CO_E_INCOMPATIBLESTREAMVERSION: HRESULT = 0x8001013B; +pub const CO_E_FAILEDTOOPENPROCESSTOKEN: HRESULT = 0x8001013C; +pub const CO_E_DECODEFAILED: HRESULT = 0x8001013D; +pub const CO_E_ACNOTINITIALIZED: HRESULT = 0x8001013F; +pub const CO_E_CANCEL_DISABLED: HRESULT = 0x80010140; +pub const RPC_E_UNEXPECTED: HRESULT = 0x8001FFFF; +pub const ERROR_AUDITING_DISABLED: HRESULT = 0xC0090001; +pub const ERROR_ALL_SIDS_FILTERED: HRESULT = 0xC0090002; +pub const ERROR_BIZRULES_NOT_ENABLED: HRESULT = 0xC0090003; +pub const NTE_BAD_UID: HRESULT = 0x80090001; +pub const NTE_BAD_HASH: HRESULT = 0x80090002; +pub const NTE_BAD_KEY: HRESULT = 0x80090003; +pub const NTE_BAD_LEN: HRESULT = 0x80090004; +pub const NTE_BAD_DATA: HRESULT = 0x80090005; +pub const NTE_BAD_SIGNATURE: HRESULT = 0x80090006; +pub const NTE_BAD_VER: HRESULT = 0x80090007; +pub const NTE_BAD_ALGID: HRESULT = 0x80090008; +pub const NTE_BAD_FLAGS: HRESULT = 0x80090009; +pub const NTE_BAD_TYPE: HRESULT = 0x8009000A; +pub const NTE_BAD_KEY_STATE: HRESULT = 0x8009000B; +pub const NTE_BAD_HASH_STATE: HRESULT = 0x8009000C; +pub const NTE_NO_KEY: HRESULT = 0x8009000D; +pub const NTE_NO_MEMORY: HRESULT = 0x8009000E; +pub const NTE_EXISTS: HRESULT = 0x8009000F; +pub const NTE_PERM: HRESULT = 0x80090010; +pub const NTE_NOT_FOUND: HRESULT = 0x80090011; +pub const NTE_DOUBLE_ENCRYPT: HRESULT = 0x80090012; +pub const NTE_BAD_PROVIDER: HRESULT = 0x80090013; +pub const NTE_BAD_PROV_TYPE: HRESULT = 0x80090014; +pub const NTE_BAD_PUBLIC_KEY: HRESULT = 0x80090015; +pub const NTE_BAD_KEYSET: HRESULT = 0x80090016; +pub const NTE_PROV_TYPE_NOT_DEF: HRESULT = 0x80090017; +pub const NTE_PROV_TYPE_ENTRY_BAD: HRESULT = 0x80090018; +pub const NTE_KEYSET_NOT_DEF: HRESULT = 0x80090019; +pub const NTE_KEYSET_ENTRY_BAD: HRESULT = 0x8009001A; +pub const NTE_PROV_TYPE_NO_MATCH: HRESULT = 0x8009001B; +pub const NTE_SIGNATURE_FILE_BAD: HRESULT = 0x8009001C; +pub const NTE_PROVIDER_DLL_FAIL: HRESULT = 0x8009001D; +pub const NTE_PROV_DLL_NOT_FOUND: HRESULT = 0x8009001E; +pub const NTE_BAD_KEYSET_PARAM: HRESULT = 0x8009001F; +pub const NTE_FAIL: HRESULT = 0x80090020; +pub const NTE_SYS_ERR: HRESULT = 0x80090021; +pub const NTE_SILENT_CONTEXT: HRESULT = 0x80090022; +pub const NTE_TOKEN_KEYSET_STORAGE_FULL: HRESULT = 0x80090023; +pub const NTE_TEMPORARY_PROFILE: HRESULT = 0x80090024; +pub const NTE_FIXEDPARAMETER: HRESULT = 0x80090025; +pub const NTE_INVALID_HANDLE: HRESULT = 0x80090026; +pub const NTE_INVALID_PARAMETER: HRESULT = 0x80090027; +pub const NTE_BUFFER_TOO_SMALL: HRESULT = 0x80090028; +pub const NTE_NOT_SUPPORTED: HRESULT = 0x80090029; +pub const NTE_NO_MORE_ITEMS: HRESULT = 0x8009002A; +pub const NTE_BUFFERS_OVERLAP: HRESULT = 0x8009002B; +pub const NTE_DECRYPTION_FAILURE: HRESULT = 0x8009002C; +pub const NTE_INTERNAL_ERROR: HRESULT = 0x8009002D; +pub const NTE_UI_REQUIRED: HRESULT = 0x8009002E; +pub const NTE_HMAC_NOT_SUPPORTED: HRESULT = 0x8009002F; +pub const NTE_DEVICE_NOT_READY: HRESULT = 0x80090030; +pub const NTE_AUTHENTICATION_IGNORED: HRESULT = 0x80090031; +pub const NTE_VALIDATION_FAILED: HRESULT = 0x80090032; +pub const NTE_INCORRECT_PASSWORD: HRESULT = 0x80090033; +pub const NTE_ENCRYPTION_FAILURE: HRESULT = 0x80090034; +pub const NTE_DEVICE_NOT_FOUND: HRESULT = 0x80090035; +pub const SEC_E_INSUFFICIENT_MEMORY: HRESULT = 0x80090300; +pub const SEC_E_INVALID_HANDLE: HRESULT = 0x80090301; +pub const SEC_E_UNSUPPORTED_FUNCTION: HRESULT = 0x80090302; +pub const SEC_E_TARGET_UNKNOWN: HRESULT = 0x80090303; +pub const SEC_E_INTERNAL_ERROR: HRESULT = 0x80090304; +pub const SEC_E_SECPKG_NOT_FOUND: HRESULT = 0x80090305; +pub const SEC_E_NOT_OWNER: HRESULT = 0x80090306; +pub const SEC_E_CANNOT_INSTALL: HRESULT = 0x80090307; +pub const SEC_E_INVALID_TOKEN: HRESULT = 0x80090308; +pub const SEC_E_CANNOT_PACK: HRESULT = 0x80090309; +pub const SEC_E_QOP_NOT_SUPPORTED: HRESULT = 0x8009030A; +pub const SEC_E_NO_IMPERSONATION: HRESULT = 0x8009030B; +pub const SEC_E_LOGON_DENIED: HRESULT = 0x8009030C; +pub const SEC_E_UNKNOWN_CREDENTIALS: HRESULT = 0x8009030D; +pub const SEC_E_NO_CREDENTIALS: HRESULT = 0x8009030E; +pub const SEC_E_MESSAGE_ALTERED: HRESULT = 0x8009030F; +pub const SEC_E_OUT_OF_SEQUENCE: HRESULT = 0x80090310; +pub const SEC_E_NO_AUTHENTICATING_AUTHORITY: HRESULT = 0x80090311; +pub const SEC_I_CONTINUE_NEEDED: HRESULT = 0x00090312; +pub const SEC_I_COMPLETE_NEEDED: HRESULT = 0x00090313; +pub const SEC_I_COMPLETE_AND_CONTINUE: HRESULT = 0x00090314; +pub const SEC_I_LOCAL_LOGON: HRESULT = 0x00090315; +pub const SEC_E_BAD_PKGID: HRESULT = 0x80090316; +pub const SEC_E_CONTEXT_EXPIRED: HRESULT = 0x80090317; +pub const SEC_I_CONTEXT_EXPIRED: HRESULT = 0x00090317; +pub const SEC_E_INCOMPLETE_MESSAGE: HRESULT = 0x80090318; +pub const SEC_E_INCOMPLETE_CREDENTIALS: HRESULT = 0x80090320; +pub const SEC_E_BUFFER_TOO_SMALL: HRESULT = 0x80090321; +pub const SEC_I_INCOMPLETE_CREDENTIALS: HRESULT = 0x00090320; +pub const SEC_I_RENEGOTIATE: HRESULT = 0x00090321; +pub const SEC_E_WRONG_PRINCIPAL: HRESULT = 0x80090322; +pub const SEC_I_NO_LSA_CONTEXT: HRESULT = 0x00090323; +pub const SEC_E_TIME_SKEW: HRESULT = 0x80090324; +pub const SEC_E_UNTRUSTED_ROOT: HRESULT = 0x80090325; +pub const SEC_E_ILLEGAL_MESSAGE: HRESULT = 0x80090326; +pub const SEC_E_CERT_UNKNOWN: HRESULT = 0x80090327; +pub const SEC_E_CERT_EXPIRED: HRESULT = 0x80090328; +pub const SEC_E_ENCRYPT_FAILURE: HRESULT = 0x80090329; +pub const SEC_E_DECRYPT_FAILURE: HRESULT = 0x80090330; +pub const SEC_E_ALGORITHM_MISMATCH: HRESULT = 0x80090331; +pub const SEC_E_SECURITY_QOS_FAILED: HRESULT = 0x80090332; +pub const SEC_E_UNFINISHED_CONTEXT_DELETED: HRESULT = 0x80090333; +pub const SEC_E_NO_TGT_REPLY: HRESULT = 0x80090334; +pub const SEC_E_NO_IP_ADDRESSES: HRESULT = 0x80090335; +pub const SEC_E_WRONG_CREDENTIAL_HANDLE: HRESULT = 0x80090336; +pub const SEC_E_CRYPTO_SYSTEM_INVALID: HRESULT = 0x80090337; +pub const SEC_E_MAX_REFERRALS_EXCEEDED: HRESULT = 0x80090338; +pub const SEC_E_MUST_BE_KDC: HRESULT = 0x80090339; +pub const SEC_E_STRONG_CRYPTO_NOT_SUPPORTED: HRESULT = 0x8009033A; +pub const SEC_E_TOO_MANY_PRINCIPALS: HRESULT = 0x8009033B; +pub const SEC_E_NO_PA_DATA: HRESULT = 0x8009033C; +pub const SEC_E_PKINIT_NAME_MISMATCH: HRESULT = 0x8009033D; +pub const SEC_E_SMARTCARD_LOGON_REQUIRED: HRESULT = 0x8009033E; +pub const SEC_E_SHUTDOWN_IN_PROGRESS: HRESULT = 0x8009033F; +pub const SEC_E_KDC_INVALID_REQUEST: HRESULT = 0x80090340; +pub const SEC_E_KDC_UNABLE_TO_REFER: HRESULT = 0x80090341; +pub const SEC_E_KDC_UNKNOWN_ETYPE: HRESULT = 0x80090342; +pub const SEC_E_UNSUPPORTED_PREAUTH: HRESULT = 0x80090343; +pub const SEC_E_DELEGATION_REQUIRED: HRESULT = 0x80090345; +pub const SEC_E_BAD_BINDINGS: HRESULT = 0x80090346; +pub const SEC_E_MULTIPLE_ACCOUNTS: HRESULT = 0x80090347; +pub const SEC_E_NO_KERB_KEY: HRESULT = 0x80090348; +pub const SEC_E_CERT_WRONG_USAGE: HRESULT = 0x80090349; +pub const SEC_E_DOWNGRADE_DETECTED: HRESULT = 0x80090350; +pub const SEC_E_SMARTCARD_CERT_REVOKED: HRESULT = 0x80090351; +pub const SEC_E_ISSUING_CA_UNTRUSTED: HRESULT = 0x80090352; +pub const SEC_E_REVOCATION_OFFLINE_C: HRESULT = 0x80090353; +pub const SEC_E_PKINIT_CLIENT_FAILURE: HRESULT = 0x80090354; +pub const SEC_E_SMARTCARD_CERT_EXPIRED: HRESULT = 0x80090355; +pub const SEC_E_NO_S4U_PROT_SUPPORT: HRESULT = 0x80090356; +pub const SEC_E_CROSSREALM_DELEGATION_FAILURE: HRESULT = 0x80090357; +pub const SEC_E_REVOCATION_OFFLINE_KDC: HRESULT = 0x80090358; +pub const SEC_E_ISSUING_CA_UNTRUSTED_KDC: HRESULT = 0x80090359; +pub const SEC_E_KDC_CERT_EXPIRED: HRESULT = 0x8009035A; +pub const SEC_E_KDC_CERT_REVOKED: HRESULT = 0x8009035B; +pub const SEC_I_SIGNATURE_NEEDED: HRESULT = 0x0009035C; +pub const SEC_E_INVALID_PARAMETER: HRESULT = 0x8009035D; +pub const SEC_E_DELEGATION_POLICY: HRESULT = 0x8009035E; +pub const SEC_E_POLICY_NLTM_ONLY: HRESULT = 0x8009035F; +pub const SEC_I_NO_RENEGOTIATION: HRESULT = 0x00090360; +pub const SEC_E_NO_CONTEXT: HRESULT = 0x80090361; +pub const SEC_E_PKU2U_CERT_FAILURE: HRESULT = 0x80090362; +pub const SEC_E_MUTUAL_AUTH_FAILED: HRESULT = 0x80090363; +pub const SEC_I_MESSAGE_FRAGMENT: HRESULT = 0x00090364; +pub const SEC_E_ONLY_HTTPS_ALLOWED: HRESULT = 0x80090365; +pub const SEC_I_CONTINUE_NEEDED_MESSAGE_OK: HRESULT = 0x00090366; +pub const SEC_E_APPLICATION_PROTOCOL_MISMATCH: HRESULT = 0x80090367; +pub const SEC_E_NO_SPM: HRESULT = SEC_E_INTERNAL_ERROR; +pub const SEC_E_NOT_SUPPORTED: HRESULT = SEC_E_UNSUPPORTED_FUNCTION; +pub const CRYPT_E_MSG_ERROR: HRESULT = 0x80091001; +pub const CRYPT_E_UNKNOWN_ALGO: HRESULT = 0x80091002; +pub const CRYPT_E_OID_FORMAT: HRESULT = 0x80091003; +pub const CRYPT_E_INVALID_MSG_TYPE: HRESULT = 0x80091004; +pub const CRYPT_E_UNEXPECTED_ENCODING: HRESULT = 0x80091005; +pub const CRYPT_E_AUTH_ATTR_MISSING: HRESULT = 0x80091006; +pub const CRYPT_E_HASH_VALUE: HRESULT = 0x80091007; +pub const CRYPT_E_INVALID_INDEX: HRESULT = 0x80091008; +pub const CRYPT_E_ALREADY_DECRYPTED: HRESULT = 0x80091009; +pub const CRYPT_E_NOT_DECRYPTED: HRESULT = 0x8009100A; +pub const CRYPT_E_RECIPIENT_NOT_FOUND: HRESULT = 0x8009100B; +pub const CRYPT_E_CONTROL_TYPE: HRESULT = 0x8009100C; +pub const CRYPT_E_ISSUER_SERIALNUMBER: HRESULT = 0x8009100D; +pub const CRYPT_E_SIGNER_NOT_FOUND: HRESULT = 0x8009100E; +pub const CRYPT_E_ATTRIBUTES_MISSING: HRESULT = 0x8009100F; +pub const CRYPT_E_STREAM_MSG_NOT_READY: HRESULT = 0x80091010; +pub const CRYPT_E_STREAM_INSUFFICIENT_DATA: HRESULT = 0x80091011; +pub const CRYPT_I_NEW_PROTECTION_REQUIRED: HRESULT = 0x00091012; +pub const CRYPT_E_BAD_LEN: HRESULT = 0x80092001; +pub const CRYPT_E_BAD_ENCODE: HRESULT = 0x80092002; +pub const CRYPT_E_FILE_ERROR: HRESULT = 0x80092003; +pub const CRYPT_E_NOT_FOUND: HRESULT = 0x80092004; +pub const CRYPT_E_EXISTS: HRESULT = 0x80092005; +pub const CRYPT_E_NO_PROVIDER: HRESULT = 0x80092006; +pub const CRYPT_E_SELF_SIGNED: HRESULT = 0x80092007; +pub const CRYPT_E_DELETED_PREV: HRESULT = 0x80092008; +pub const CRYPT_E_NO_MATCH: HRESULT = 0x80092009; +pub const CRYPT_E_UNEXPECTED_MSG_TYPE: HRESULT = 0x8009200A; +pub const CRYPT_E_NO_KEY_PROPERTY: HRESULT = 0x8009200B; +pub const CRYPT_E_NO_DECRYPT_CERT: HRESULT = 0x8009200C; +pub const CRYPT_E_BAD_MSG: HRESULT = 0x8009200D; +pub const CRYPT_E_NO_SIGNER: HRESULT = 0x8009200E; +pub const CRYPT_E_PENDING_CLOSE: HRESULT = 0x8009200F; +pub const CRYPT_E_REVOKED: HRESULT = 0x80092010; +pub const CRYPT_E_NO_REVOCATION_DLL: HRESULT = 0x80092011; +pub const CRYPT_E_NO_REVOCATION_CHECK: HRESULT = 0x80092012; +pub const CRYPT_E_REVOCATION_OFFLINE: HRESULT = 0x80092013; +pub const CRYPT_E_NOT_IN_REVOCATION_DATABASE: HRESULT = 0x80092014; +pub const CRYPT_E_INVALID_NUMERIC_STRING: HRESULT = 0x80092020; +pub const CRYPT_E_INVALID_PRINTABLE_STRING: HRESULT = 0x80092021; +pub const CRYPT_E_INVALID_IA5_STRING: HRESULT = 0x80092022; +pub const CRYPT_E_INVALID_X500_STRING: HRESULT = 0x80092023; +pub const CRYPT_E_NOT_CHAR_STRING: HRESULT = 0x80092024; +pub const CRYPT_E_FILERESIZED: HRESULT = 0x80092025; +pub const CRYPT_E_SECURITY_SETTINGS: HRESULT = 0x80092026; +pub const CRYPT_E_NO_VERIFY_USAGE_DLL: HRESULT = 0x80092027; +pub const CRYPT_E_NO_VERIFY_USAGE_CHECK: HRESULT = 0x80092028; +pub const CRYPT_E_VERIFY_USAGE_OFFLINE: HRESULT = 0x80092029; +pub const CRYPT_E_NOT_IN_CTL: HRESULT = 0x8009202A; +pub const CRYPT_E_NO_TRUSTED_SIGNER: HRESULT = 0x8009202B; +pub const CRYPT_E_MISSING_PUBKEY_PARA: HRESULT = 0x8009202C; +pub const CRYPT_E_OBJECT_LOCATOR_OBJECT_NOT_FOUND: HRESULT = 0x8009202D; +pub const CRYPT_E_OSS_ERROR: HRESULT = 0x80093000; +pub const OSS_MORE_BUF: HRESULT = 0x80093001; +pub const OSS_NEGATIVE_UINTEGER: HRESULT = 0x80093002; +pub const OSS_PDU_RANGE: HRESULT = 0x80093003; +pub const OSS_MORE_INPUT: HRESULT = 0x80093004; +pub const OSS_DATA_ERROR: HRESULT = 0x80093005; +pub const OSS_BAD_ARG: HRESULT = 0x80093006; +pub const OSS_BAD_VERSION: HRESULT = 0x80093007; +pub const OSS_OUT_MEMORY: HRESULT = 0x80093008; +pub const OSS_PDU_MISMATCH: HRESULT = 0x80093009; +pub const OSS_LIMITED: HRESULT = 0x8009300A; +pub const OSS_BAD_PTR: HRESULT = 0x8009300B; +pub const OSS_BAD_TIME: HRESULT = 0x8009300C; +pub const OSS_INDEFINITE_NOT_SUPPORTED: HRESULT = 0x8009300D; +pub const OSS_MEM_ERROR: HRESULT = 0x8009300E; +pub const OSS_BAD_TABLE: HRESULT = 0x8009300F; +pub const OSS_TOO_LONG: HRESULT = 0x80093010; +pub const OSS_CONSTRAINT_VIOLATED: HRESULT = 0x80093011; +pub const OSS_FATAL_ERROR: HRESULT = 0x80093012; +pub const OSS_ACCESS_SERIALIZATION_ERROR: HRESULT = 0x80093013; +pub const OSS_NULL_TBL: HRESULT = 0x80093014; +pub const OSS_NULL_FCN: HRESULT = 0x80093015; +pub const OSS_BAD_ENCRULES: HRESULT = 0x80093016; +pub const OSS_UNAVAIL_ENCRULES: HRESULT = 0x80093017; +pub const OSS_CANT_OPEN_TRACE_WINDOW: HRESULT = 0x80093018; +pub const OSS_UNIMPLEMENTED: HRESULT = 0x80093019; +pub const OSS_OID_DLL_NOT_LINKED: HRESULT = 0x8009301A; +pub const OSS_CANT_OPEN_TRACE_FILE: HRESULT = 0x8009301B; +pub const OSS_TRACE_FILE_ALREADY_OPEN: HRESULT = 0x8009301C; +pub const OSS_TABLE_MISMATCH: HRESULT = 0x8009301D; +pub const OSS_TYPE_NOT_SUPPORTED: HRESULT = 0x8009301E; +pub const OSS_REAL_DLL_NOT_LINKED: HRESULT = 0x8009301F; +pub const OSS_REAL_CODE_NOT_LINKED: HRESULT = 0x80093020; +pub const OSS_OUT_OF_RANGE: HRESULT = 0x80093021; +pub const OSS_COPIER_DLL_NOT_LINKED: HRESULT = 0x80093022; +pub const OSS_CONSTRAINT_DLL_NOT_LINKED: HRESULT = 0x80093023; +pub const OSS_COMPARATOR_DLL_NOT_LINKED: HRESULT = 0x80093024; +pub const OSS_COMPARATOR_CODE_NOT_LINKED: HRESULT = 0x80093025; +pub const OSS_MEM_MGR_DLL_NOT_LINKED: HRESULT = 0x80093026; +pub const OSS_PDV_DLL_NOT_LINKED: HRESULT = 0x80093027; +pub const OSS_PDV_CODE_NOT_LINKED: HRESULT = 0x80093028; +pub const OSS_API_DLL_NOT_LINKED: HRESULT = 0x80093029; +pub const OSS_BERDER_DLL_NOT_LINKED: HRESULT = 0x8009302A; +pub const OSS_PER_DLL_NOT_LINKED: HRESULT = 0x8009302B; +pub const OSS_OPEN_TYPE_ERROR: HRESULT = 0x8009302C; +pub const OSS_MUTEX_NOT_CREATED: HRESULT = 0x8009302D; +pub const OSS_CANT_CLOSE_TRACE_FILE: HRESULT = 0x8009302E; +pub const CRYPT_E_ASN1_ERROR: HRESULT = 0x80093100; +pub const CRYPT_E_ASN1_INTERNAL: HRESULT = 0x80093101; +pub const CRYPT_E_ASN1_EOD: HRESULT = 0x80093102; +pub const CRYPT_E_ASN1_CORRUPT: HRESULT = 0x80093103; +pub const CRYPT_E_ASN1_LARGE: HRESULT = 0x80093104; +pub const CRYPT_E_ASN1_CONSTRAINT: HRESULT = 0x80093105; +pub const CRYPT_E_ASN1_MEMORY: HRESULT = 0x80093106; +pub const CRYPT_E_ASN1_OVERFLOW: HRESULT = 0x80093107; +pub const CRYPT_E_ASN1_BADPDU: HRESULT = 0x80093108; +pub const CRYPT_E_ASN1_BADARGS: HRESULT = 0x80093109; +pub const CRYPT_E_ASN1_BADREAL: HRESULT = 0x8009310A; +pub const CRYPT_E_ASN1_BADTAG: HRESULT = 0x8009310B; +pub const CRYPT_E_ASN1_CHOICE: HRESULT = 0x8009310C; +pub const CRYPT_E_ASN1_RULE: HRESULT = 0x8009310D; +pub const CRYPT_E_ASN1_UTF8: HRESULT = 0x8009310E; +pub const CRYPT_E_ASN1_PDU_TYPE: HRESULT = 0x80093133; +pub const CRYPT_E_ASN1_NYI: HRESULT = 0x80093134; +pub const CRYPT_E_ASN1_EXTENDED: HRESULT = 0x80093201; +pub const CRYPT_E_ASN1_NOEOD: HRESULT = 0x80093202; +pub const CERTSRV_E_BAD_REQUESTSUBJECT: HRESULT = 0x80094001; +pub const CERTSRV_E_NO_REQUEST: HRESULT = 0x80094002; +pub const CERTSRV_E_BAD_REQUESTSTATUS: HRESULT = 0x80094003; +pub const CERTSRV_E_PROPERTY_EMPTY: HRESULT = 0x80094004; +pub const CERTSRV_E_INVALID_CA_CERTIFICATE: HRESULT = 0x80094005; +pub const CERTSRV_E_SERVER_SUSPENDED: HRESULT = 0x80094006; +pub const CERTSRV_E_ENCODING_LENGTH: HRESULT = 0x80094007; +pub const CERTSRV_E_ROLECONFLICT: HRESULT = 0x80094008; +pub const CERTSRV_E_RESTRICTEDOFFICER: HRESULT = 0x80094009; +pub const CERTSRV_E_KEY_ARCHIVAL_NOT_CONFIGURED: HRESULT = 0x8009400A; +pub const CERTSRV_E_NO_VALID_KRA: HRESULT = 0x8009400B; +pub const CERTSRV_E_BAD_REQUEST_KEY_ARCHIVAL: HRESULT = 0x8009400C; +pub const CERTSRV_E_NO_CAADMIN_DEFINED: HRESULT = 0x8009400D; +pub const CERTSRV_E_BAD_RENEWAL_CERT_ATTRIBUTE: HRESULT = 0x8009400E; +pub const CERTSRV_E_NO_DB_SESSIONS: HRESULT = 0x8009400F; +pub const CERTSRV_E_ALIGNMENT_FAULT: HRESULT = 0x80094010; +pub const CERTSRV_E_ENROLL_DENIED: HRESULT = 0x80094011; +pub const CERTSRV_E_TEMPLATE_DENIED: HRESULT = 0x80094012; +pub const CERTSRV_E_DOWNLEVEL_DC_SSL_OR_UPGRADE: HRESULT = 0x80094013; +pub const CERTSRV_E_ADMIN_DENIED_REQUEST: HRESULT = 0x80094014; +pub const CERTSRV_E_NO_POLICY_SERVER: HRESULT = 0x80094015; +pub const CERTSRV_E_WEAK_SIGNATURE_OR_KEY: HRESULT = 0x80094016; +pub const CERTSRV_E_KEY_ATTESTATION_NOT_SUPPORTED: HRESULT = 0x80094017; +pub const CERTSRV_E_ENCRYPTION_CERT_REQUIRED: HRESULT = 0x80094018; +pub const CERTSRV_E_UNSUPPORTED_CERT_TYPE: HRESULT = 0x80094800; +pub const CERTSRV_E_NO_CERT_TYPE: HRESULT = 0x80094801; +pub const CERTSRV_E_TEMPLATE_CONFLICT: HRESULT = 0x80094802; +pub const CERTSRV_E_SUBJECT_ALT_NAME_REQUIRED: HRESULT = 0x80094803; +pub const CERTSRV_E_ARCHIVED_KEY_REQUIRED: HRESULT = 0x80094804; +pub const CERTSRV_E_SMIME_REQUIRED: HRESULT = 0x80094805; +pub const CERTSRV_E_BAD_RENEWAL_SUBJECT: HRESULT = 0x80094806; +pub const CERTSRV_E_BAD_TEMPLATE_VERSION: HRESULT = 0x80094807; +pub const CERTSRV_E_TEMPLATE_POLICY_REQUIRED: HRESULT = 0x80094808; +pub const CERTSRV_E_SIGNATURE_POLICY_REQUIRED: HRESULT = 0x80094809; +pub const CERTSRV_E_SIGNATURE_COUNT: HRESULT = 0x8009480A; +pub const CERTSRV_E_SIGNATURE_REJECTED: HRESULT = 0x8009480B; +pub const CERTSRV_E_ISSUANCE_POLICY_REQUIRED: HRESULT = 0x8009480C; +pub const CERTSRV_E_SUBJECT_UPN_REQUIRED: HRESULT = 0x8009480D; +pub const CERTSRV_E_SUBJECT_DIRECTORY_GUID_REQUIRED: HRESULT = 0x8009480E; +pub const CERTSRV_E_SUBJECT_DNS_REQUIRED: HRESULT = 0x8009480F; +pub const CERTSRV_E_ARCHIVED_KEY_UNEXPECTED: HRESULT = 0x80094810; +pub const CERTSRV_E_KEY_LENGTH: HRESULT = 0x80094811; +pub const CERTSRV_E_SUBJECT_EMAIL_REQUIRED: HRESULT = 0x80094812; +pub const CERTSRV_E_UNKNOWN_CERT_TYPE: HRESULT = 0x80094813; +pub const CERTSRV_E_CERT_TYPE_OVERLAP: HRESULT = 0x80094814; +pub const CERTSRV_E_TOO_MANY_SIGNATURES: HRESULT = 0x80094815; +pub const CERTSRV_E_RENEWAL_BAD_PUBLIC_KEY: HRESULT = 0x80094816; +pub const CERTSRV_E_INVALID_EK: HRESULT = 0x80094817; +pub const CERTSRV_E_INVALID_IDBINDING: HRESULT = 0x80094818; +pub const CERTSRV_E_INVALID_ATTESTATION: HRESULT = 0x80094819; +pub const CERTSRV_E_KEY_ATTESTATION: HRESULT = 0x8009481A; +pub const CERTSRV_E_CORRUPT_KEY_ATTESTATION: HRESULT = 0x8009481B; +pub const CERTSRV_E_EXPIRED_CHALLENGE: HRESULT = 0x8009481C; +pub const CERTSRV_E_INVALID_RESPONSE: HRESULT = 0x8009481D; +pub const CERTSRV_E_INVALID_REQUESTID: HRESULT = 0x8009481E; +pub const XENROLL_E_KEY_NOT_EXPORTABLE: HRESULT = 0x80095000; +pub const XENROLL_E_CANNOT_ADD_ROOT_CERT: HRESULT = 0x80095001; +pub const XENROLL_E_RESPONSE_KA_HASH_NOT_FOUND: HRESULT = 0x80095002; +pub const XENROLL_E_RESPONSE_UNEXPECTED_KA_HASH: HRESULT = 0x80095003; +pub const XENROLL_E_RESPONSE_KA_HASH_MISMATCH: HRESULT = 0x80095004; +pub const XENROLL_E_KEYSPEC_SMIME_MISMATCH: HRESULT = 0x80095005; +pub const TRUST_E_SYSTEM_ERROR: HRESULT = 0x80096001; +pub const TRUST_E_NO_SIGNER_CERT: HRESULT = 0x80096002; +pub const TRUST_E_COUNTER_SIGNER: HRESULT = 0x80096003; +pub const TRUST_E_CERT_SIGNATURE: HRESULT = 0x80096004; +pub const TRUST_E_TIME_STAMP: HRESULT = 0x80096005; +pub const TRUST_E_BAD_DIGEST: HRESULT = 0x80096010; +pub const TRUST_E_BASIC_CONSTRAINTS: HRESULT = 0x80096019; +pub const TRUST_E_FINANCIAL_CRITERIA: HRESULT = 0x8009601E; +pub const MSSIPOTF_E_OUTOFMEMRANGE: HRESULT = 0x80097001; +pub const MSSIPOTF_E_CANTGETOBJECT: HRESULT = 0x80097002; +pub const MSSIPOTF_E_NOHEADTABLE: HRESULT = 0x80097003; +pub const MSSIPOTF_E_BAD_MAGICNUMBER: HRESULT = 0x80097004; +pub const MSSIPOTF_E_BAD_OFFSET_TABLE: HRESULT = 0x80097005; +pub const MSSIPOTF_E_TABLE_TAGORDER: HRESULT = 0x80097006; +pub const MSSIPOTF_E_TABLE_LONGWORD: HRESULT = 0x80097007; +pub const MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT: HRESULT = 0x80097008; +pub const MSSIPOTF_E_TABLES_OVERLAP: HRESULT = 0x80097009; +pub const MSSIPOTF_E_TABLE_PADBYTES: HRESULT = 0x8009700A; +pub const MSSIPOTF_E_FILETOOSMALL: HRESULT = 0x8009700B; +pub const MSSIPOTF_E_TABLE_CHECKSUM: HRESULT = 0x8009700C; +pub const MSSIPOTF_E_FILE_CHECKSUM: HRESULT = 0x8009700D; +pub const MSSIPOTF_E_FAILED_POLICY: HRESULT = 0x80097010; +pub const MSSIPOTF_E_FAILED_HINTS_CHECK: HRESULT = 0x80097011; +pub const MSSIPOTF_E_NOT_OPENTYPE: HRESULT = 0x80097012; +pub const MSSIPOTF_E_FILE: HRESULT = 0x80097013; +pub const MSSIPOTF_E_CRYPT: HRESULT = 0x80097014; +pub const MSSIPOTF_E_BADVERSION: HRESULT = 0x80097015; +pub const MSSIPOTF_E_DSIG_STRUCTURE: HRESULT = 0x80097016; +pub const MSSIPOTF_E_PCONST_CHECK: HRESULT = 0x80097017; +pub const MSSIPOTF_E_STRUCTURE: HRESULT = 0x80097018; +pub const ERROR_CRED_REQUIRES_CONFIRMATION: HRESULT = 0x80097019; +pub const NTE_OP_OK: HRESULT = 0; +pub const TRUST_E_PROVIDER_UNKNOWN: HRESULT = 0x800B0001; +pub const TRUST_E_ACTION_UNKNOWN: HRESULT = 0x800B0002; +pub const TRUST_E_SUBJECT_FORM_UNKNOWN: HRESULT = 0x800B0003; +pub const TRUST_E_SUBJECT_NOT_TRUSTED: HRESULT = 0x800B0004; +pub const DIGSIG_E_ENCODE: HRESULT = 0x800B0005; +pub const DIGSIG_E_DECODE: HRESULT = 0x800B0006; +pub const DIGSIG_E_EXTENSIBILITY: HRESULT = 0x800B0007; +pub const DIGSIG_E_CRYPTO: HRESULT = 0x800B0008; +pub const PERSIST_E_SIZEDEFINITE: HRESULT = 0x800B0009; +pub const PERSIST_E_SIZEINDEFINITE: HRESULT = 0x800B000A; +pub const PERSIST_E_NOTSELFSIZING: HRESULT = 0x800B000B; +pub const TRUST_E_NOSIGNATURE: HRESULT = 0x800B0100; +pub const CERT_E_EXPIRED: HRESULT = 0x800B0101; +pub const CERT_E_VALIDITYPERIODNESTING: HRESULT = 0x800B0102; +pub const CERT_E_ROLE: HRESULT = 0x800B0103; +pub const CERT_E_PATHLENCONST: HRESULT = 0x800B0104; +pub const CERT_E_CRITICAL: HRESULT = 0x800B0105; +pub const CERT_E_PURPOSE: HRESULT = 0x800B0106; +pub const CERT_E_ISSUERCHAINING: HRESULT = 0x800B0107; +pub const CERT_E_MALFORMED: HRESULT = 0x800B0108; +pub const CERT_E_UNTRUSTEDROOT: HRESULT = 0x800B0109; +pub const CERT_E_CHAINING: HRESULT = 0x800B010A; +pub const TRUST_E_FAIL: HRESULT = 0x800B010B; +pub const CERT_E_REVOKED: HRESULT = 0x800B010C; +pub const CERT_E_UNTRUSTEDTESTROOT: HRESULT = 0x800B010D; +pub const CERT_E_REVOCATION_FAILURE: HRESULT = 0x800B010E; +pub const CERT_E_CN_NO_MATCH: HRESULT = 0x800B010F; +pub const CERT_E_WRONG_USAGE: HRESULT = 0x800B0110; +pub const TRUST_E_EXPLICIT_DISTRUST: HRESULT = 0x800B0111; +pub const CERT_E_UNTRUSTEDCA: HRESULT = 0x800B0112; +pub const CERT_E_INVALID_POLICY: HRESULT = 0x800B0113; +pub const CERT_E_INVALID_NAME: HRESULT = 0x800B0114; +pub const SPAPI_E_EXPECTED_SECTION_NAME: HRESULT = 0x800F0000; +pub const SPAPI_E_BAD_SECTION_NAME_LINE: HRESULT = 0x800F0001; +pub const SPAPI_E_SECTION_NAME_TOO_LONG: HRESULT = 0x800F0002; +pub const SPAPI_E_GENERAL_SYNTAX: HRESULT = 0x800F0003; +pub const SPAPI_E_WRONG_INF_STYLE: HRESULT = 0x800F0100; +pub const SPAPI_E_SECTION_NOT_FOUND: HRESULT = 0x800F0101; +pub const SPAPI_E_LINE_NOT_FOUND: HRESULT = 0x800F0102; +pub const SPAPI_E_NO_BACKUP: HRESULT = 0x800F0103; +pub const SPAPI_E_NO_ASSOCIATED_CLASS: HRESULT = 0x800F0200; +pub const SPAPI_E_CLASS_MISMATCH: HRESULT = 0x800F0201; +pub const SPAPI_E_DUPLICATE_FOUND: HRESULT = 0x800F0202; +pub const SPAPI_E_NO_DRIVER_SELECTED: HRESULT = 0x800F0203; +pub const SPAPI_E_KEY_DOES_NOT_EXIST: HRESULT = 0x800F0204; +pub const SPAPI_E_INVALID_DEVINST_NAME: HRESULT = 0x800F0205; +pub const SPAPI_E_INVALID_CLASS: HRESULT = 0x800F0206; +pub const SPAPI_E_DEVINST_ALREADY_EXISTS: HRESULT = 0x800F0207; +pub const SPAPI_E_DEVINFO_NOT_REGISTERED: HRESULT = 0x800F0208; +pub const SPAPI_E_INVALID_REG_PROPERTY: HRESULT = 0x800F0209; +pub const SPAPI_E_NO_INF: HRESULT = 0x800F020A; +pub const SPAPI_E_NO_SUCH_DEVINST: HRESULT = 0x800F020B; +pub const SPAPI_E_CANT_LOAD_CLASS_ICON: HRESULT = 0x800F020C; +pub const SPAPI_E_INVALID_CLASS_INSTALLER: HRESULT = 0x800F020D; +pub const SPAPI_E_DI_DO_DEFAULT: HRESULT = 0x800F020E; +pub const SPAPI_E_DI_NOFILECOPY: HRESULT = 0x800F020F; +pub const SPAPI_E_INVALID_HWPROFILE: HRESULT = 0x800F0210; +pub const SPAPI_E_NO_DEVICE_SELECTED: HRESULT = 0x800F0211; +pub const SPAPI_E_DEVINFO_LIST_LOCKED: HRESULT = 0x800F0212; +pub const SPAPI_E_DEVINFO_DATA_LOCKED: HRESULT = 0x800F0213; +pub const SPAPI_E_DI_BAD_PATH: HRESULT = 0x800F0214; +pub const SPAPI_E_NO_CLASSINSTALL_PARAMS: HRESULT = 0x800F0215; +pub const SPAPI_E_FILEQUEUE_LOCKED: HRESULT = 0x800F0216; +pub const SPAPI_E_BAD_SERVICE_INSTALLSECT: HRESULT = 0x800F0217; +pub const SPAPI_E_NO_CLASS_DRIVER_LIST: HRESULT = 0x800F0218; +pub const SPAPI_E_NO_ASSOCIATED_SERVICE: HRESULT = 0x800F0219; +pub const SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE: HRESULT = 0x800F021A; +pub const SPAPI_E_DEVICE_INTERFACE_ACTIVE: HRESULT = 0x800F021B; +pub const SPAPI_E_DEVICE_INTERFACE_REMOVED: HRESULT = 0x800F021C; +pub const SPAPI_E_BAD_INTERFACE_INSTALLSECT: HRESULT = 0x800F021D; +pub const SPAPI_E_NO_SUCH_INTERFACE_CLASS: HRESULT = 0x800F021E; +pub const SPAPI_E_INVALID_REFERENCE_STRING: HRESULT = 0x800F021F; +pub const SPAPI_E_INVALID_MACHINENAME: HRESULT = 0x800F0220; +pub const SPAPI_E_REMOTE_COMM_FAILURE: HRESULT = 0x800F0221; +pub const SPAPI_E_MACHINE_UNAVAILABLE: HRESULT = 0x800F0222; +pub const SPAPI_E_NO_CONFIGMGR_SERVICES: HRESULT = 0x800F0223; +pub const SPAPI_E_INVALID_PROPPAGE_PROVIDER: HRESULT = 0x800F0224; +pub const SPAPI_E_NO_SUCH_DEVICE_INTERFACE: HRESULT = 0x800F0225; +pub const SPAPI_E_DI_POSTPROCESSING_REQUIRED: HRESULT = 0x800F0226; +pub const SPAPI_E_INVALID_COINSTALLER: HRESULT = 0x800F0227; +pub const SPAPI_E_NO_COMPAT_DRIVERS: HRESULT = 0x800F0228; +pub const SPAPI_E_NO_DEVICE_ICON: HRESULT = 0x800F0229; +pub const SPAPI_E_INVALID_INF_LOGCONFIG: HRESULT = 0x800F022A; +pub const SPAPI_E_DI_DONT_INSTALL: HRESULT = 0x800F022B; +pub const SPAPI_E_INVALID_FILTER_DRIVER: HRESULT = 0x800F022C; +pub const SPAPI_E_NON_WINDOWS_NT_DRIVER: HRESULT = 0x800F022D; +pub const SPAPI_E_NON_WINDOWS_DRIVER: HRESULT = 0x800F022E; +pub const SPAPI_E_NO_CATALOG_FOR_OEM_INF: HRESULT = 0x800F022F; +pub const SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE: HRESULT = 0x800F0230; +pub const SPAPI_E_NOT_DISABLEABLE: HRESULT = 0x800F0231; +pub const SPAPI_E_CANT_REMOVE_DEVINST: HRESULT = 0x800F0232; +pub const SPAPI_E_INVALID_TARGET: HRESULT = 0x800F0233; +pub const SPAPI_E_DRIVER_NONNATIVE: HRESULT = 0x800F0234; +pub const SPAPI_E_IN_WOW64: HRESULT = 0x800F0235; +pub const SPAPI_E_SET_SYSTEM_RESTORE_POINT: HRESULT = 0x800F0236; +pub const SPAPI_E_INCORRECTLY_COPIED_INF: HRESULT = 0x800F0237; +pub const SPAPI_E_SCE_DISABLED: HRESULT = 0x800F0238; +pub const SPAPI_E_UNKNOWN_EXCEPTION: HRESULT = 0x800F0239; +pub const SPAPI_E_PNP_REGISTRY_ERROR: HRESULT = 0x800F023A; +pub const SPAPI_E_REMOTE_REQUEST_UNSUPPORTED: HRESULT = 0x800F023B; +pub const SPAPI_E_NOT_AN_INSTALLED_OEM_INF: HRESULT = 0x800F023C; +pub const SPAPI_E_INF_IN_USE_BY_DEVICES: HRESULT = 0x800F023D; +pub const SPAPI_E_DI_FUNCTION_OBSOLETE: HRESULT = 0x800F023E; +pub const SPAPI_E_NO_AUTHENTICODE_CATALOG: HRESULT = 0x800F023F; +pub const SPAPI_E_AUTHENTICODE_DISALLOWED: HRESULT = 0x800F0240; +pub const SPAPI_E_AUTHENTICODE_TRUSTED_PUBLISHER: HRESULT = 0x800F0241; +pub const SPAPI_E_AUTHENTICODE_TRUST_NOT_ESTABLISHED: HRESULT = 0x800F0242; +pub const SPAPI_E_AUTHENTICODE_PUBLISHER_NOT_TRUSTED: HRESULT = 0x800F0243; +pub const SPAPI_E_SIGNATURE_OSATTRIBUTE_MISMATCH: HRESULT = 0x800F0244; +pub const SPAPI_E_ONLY_VALIDATE_VIA_AUTHENTICODE: HRESULT = 0x800F0245; +pub const SPAPI_E_DEVICE_INSTALLER_NOT_READY: HRESULT = 0x800F0246; +pub const SPAPI_E_DRIVER_STORE_ADD_FAILED: HRESULT = 0x800F0247; +pub const SPAPI_E_DEVICE_INSTALL_BLOCKED: HRESULT = 0x800F0248; +pub const SPAPI_E_DRIVER_INSTALL_BLOCKED: HRESULT = 0x800F0249; +pub const SPAPI_E_WRONG_INF_TYPE: HRESULT = 0x800F024A; +pub const SPAPI_E_FILE_HASH_NOT_IN_CATALOG: HRESULT = 0x800F024B; +pub const SPAPI_E_DRIVER_STORE_DELETE_FAILED: HRESULT = 0x800F024C; +pub const SPAPI_E_UNRECOVERABLE_STACK_OVERFLOW: HRESULT = 0x800F0300; +pub const SPAPI_E_ERROR_NOT_INSTALLED: HRESULT = 0x800F1000; +pub const SCARD_S_SUCCESS: HRESULT = NO_ERROR as i32; +pub const SCARD_F_INTERNAL_ERROR: HRESULT = 0x80100001; +pub const SCARD_E_CANCELLED: HRESULT = 0x80100002; +pub const SCARD_E_INVALID_HANDLE: HRESULT = 0x80100003; +pub const SCARD_E_INVALID_PARAMETER: HRESULT = 0x80100004; +pub const SCARD_E_INVALID_TARGET: HRESULT = 0x80100005; +pub const SCARD_E_NO_MEMORY: HRESULT = 0x80100006; +pub const SCARD_F_WAITED_TOO_LONG: HRESULT = 0x80100007; +pub const SCARD_E_INSUFFICIENT_BUFFER: HRESULT = 0x80100008; +pub const SCARD_E_UNKNOWN_READER: HRESULT = 0x80100009; +pub const SCARD_E_TIMEOUT: HRESULT = 0x8010000A; +pub const SCARD_E_SHARING_VIOLATION: HRESULT = 0x8010000B; +pub const SCARD_E_NO_SMARTCARD: HRESULT = 0x8010000C; +pub const SCARD_E_UNKNOWN_CARD: HRESULT = 0x8010000D; +pub const SCARD_E_CANT_DISPOSE: HRESULT = 0x8010000E; +pub const SCARD_E_PROTO_MISMATCH: HRESULT = 0x8010000F; +pub const SCARD_E_NOT_READY: HRESULT = 0x80100010; +pub const SCARD_E_INVALID_VALUE: HRESULT = 0x80100011; +pub const SCARD_E_SYSTEM_CANCELLED: HRESULT = 0x80100012; +pub const SCARD_F_COMM_ERROR: HRESULT = 0x80100013; +pub const SCARD_F_UNKNOWN_ERROR: HRESULT = 0x80100014; +pub const SCARD_E_INVALID_ATR: HRESULT = 0x80100015; +pub const SCARD_E_NOT_TRANSACTED: HRESULT = 0x80100016; +pub const SCARD_E_READER_UNAVAILABLE: HRESULT = 0x80100017; +pub const SCARD_P_SHUTDOWN: HRESULT = 0x80100018; +pub const SCARD_E_PCI_TOO_SMALL: HRESULT = 0x80100019; +pub const SCARD_E_READER_UNSUPPORTED: HRESULT = 0x8010001A; +pub const SCARD_E_DUPLICATE_READER: HRESULT = 0x8010001B; +pub const SCARD_E_CARD_UNSUPPORTED: HRESULT = 0x8010001C; +pub const SCARD_E_NO_SERVICE: HRESULT = 0x8010001D; +pub const SCARD_E_SERVICE_STOPPED: HRESULT = 0x8010001E; +pub const SCARD_E_UNEXPECTED: HRESULT = 0x8010001F; +pub const SCARD_E_ICC_INSTALLATION: HRESULT = 0x80100020; +pub const SCARD_E_ICC_CREATEORDER: HRESULT = 0x80100021; +pub const SCARD_E_UNSUPPORTED_FEATURE: HRESULT = 0x80100022; +pub const SCARD_E_DIR_NOT_FOUND: HRESULT = 0x80100023; +pub const SCARD_E_FILE_NOT_FOUND: HRESULT = 0x80100024; +pub const SCARD_E_NO_DIR: HRESULT = 0x80100025; +pub const SCARD_E_NO_FILE: HRESULT = 0x80100026; +pub const SCARD_E_NO_ACCESS: HRESULT = 0x80100027; +pub const SCARD_E_WRITE_TOO_MANY: HRESULT = 0x80100028; +pub const SCARD_E_BAD_SEEK: HRESULT = 0x80100029; +pub const SCARD_E_INVALID_CHV: HRESULT = 0x8010002A; +pub const SCARD_E_UNKNOWN_RES_MNG: HRESULT = 0x8010002B; +pub const SCARD_E_NO_SUCH_CERTIFICATE: HRESULT = 0x8010002C; +pub const SCARD_E_CERTIFICATE_UNAVAILABLE: HRESULT = 0x8010002D; +pub const SCARD_E_NO_READERS_AVAILABLE: HRESULT = 0x8010002E; +pub const SCARD_E_COMM_DATA_LOST: HRESULT = 0x8010002F; +pub const SCARD_E_NO_KEY_CONTAINER: HRESULT = 0x80100030; +pub const SCARD_E_SERVER_TOO_BUSY: HRESULT = 0x80100031; +pub const SCARD_E_PIN_CACHE_EXPIRED: HRESULT = 0x80100032; +pub const SCARD_E_NO_PIN_CACHE: HRESULT = 0x80100033; +pub const SCARD_E_READ_ONLY_CARD: HRESULT = 0x80100034; +pub const SCARD_W_UNSUPPORTED_CARD: HRESULT = 0x80100065; +pub const SCARD_W_UNRESPONSIVE_CARD: HRESULT = 0x80100066; +pub const SCARD_W_UNPOWERED_CARD: HRESULT = 0x80100067; +pub const SCARD_W_RESET_CARD: HRESULT = 0x80100068; +pub const SCARD_W_REMOVED_CARD: HRESULT = 0x80100069; +pub const SCARD_W_SECURITY_VIOLATION: HRESULT = 0x8010006A; +pub const SCARD_W_WRONG_CHV: HRESULT = 0x8010006B; +pub const SCARD_W_CHV_BLOCKED: HRESULT = 0x8010006C; +pub const SCARD_W_EOF: HRESULT = 0x8010006D; +pub const SCARD_W_CANCELLED_BY_USER: HRESULT = 0x8010006E; +pub const SCARD_W_CARD_NOT_AUTHENTICATED: HRESULT = 0x8010006F; +pub const SCARD_W_CACHE_ITEM_NOT_FOUND: HRESULT = 0x80100070; +pub const SCARD_W_CACHE_ITEM_STALE: HRESULT = 0x80100071; +pub const SCARD_W_CACHE_ITEM_TOO_BIG: HRESULT = 0x80100072; +pub const COMADMIN_E_OBJECTERRORS: HRESULT = 0x80110401; +pub const COMADMIN_E_OBJECTINVALID: HRESULT = 0x80110402; +pub const COMADMIN_E_KEYMISSING: HRESULT = 0x80110403; +pub const COMADMIN_E_ALREADYINSTALLED: HRESULT = 0x80110404; +pub const COMADMIN_E_APP_FILE_WRITEFAIL: HRESULT = 0x80110407; +pub const COMADMIN_E_APP_FILE_READFAIL: HRESULT = 0x80110408; +pub const COMADMIN_E_APP_FILE_VERSION: HRESULT = 0x80110409; +pub const COMADMIN_E_BADPATH: HRESULT = 0x8011040A; +pub const COMADMIN_E_APPLICATIONEXISTS: HRESULT = 0x8011040B; +pub const COMADMIN_E_ROLEEXISTS: HRESULT = 0x8011040C; +pub const COMADMIN_E_CANTCOPYFILE: HRESULT = 0x8011040D; +pub const COMADMIN_E_NOUSER: HRESULT = 0x8011040F; +pub const COMADMIN_E_INVALIDUSERIDS: HRESULT = 0x80110410; +pub const COMADMIN_E_NOREGISTRYCLSID: HRESULT = 0x80110411; +pub const COMADMIN_E_BADREGISTRYPROGID: HRESULT = 0x80110412; +pub const COMADMIN_E_AUTHENTICATIONLEVEL: HRESULT = 0x80110413; +pub const COMADMIN_E_USERPASSWDNOTVALID: HRESULT = 0x80110414; +pub const COMADMIN_E_CLSIDORIIDMISMATCH: HRESULT = 0x80110418; +pub const COMADMIN_E_REMOTEINTERFACE: HRESULT = 0x80110419; +pub const COMADMIN_E_DLLREGISTERSERVER: HRESULT = 0x8011041A; +pub const COMADMIN_E_NOSERVERSHARE: HRESULT = 0x8011041B; +pub const COMADMIN_E_DLLLOADFAILED: HRESULT = 0x8011041D; +pub const COMADMIN_E_BADREGISTRYLIBID: HRESULT = 0x8011041E; +pub const COMADMIN_E_APPDIRNOTFOUND: HRESULT = 0x8011041F; +pub const COMADMIN_E_REGISTRARFAILED: HRESULT = 0x80110423; +pub const COMADMIN_E_COMPFILE_DOESNOTEXIST: HRESULT = 0x80110424; +pub const COMADMIN_E_COMPFILE_LOADDLLFAIL: HRESULT = 0x80110425; +pub const COMADMIN_E_COMPFILE_GETCLASSOBJ: HRESULT = 0x80110426; +pub const COMADMIN_E_COMPFILE_CLASSNOTAVAIL: HRESULT = 0x80110427; +pub const COMADMIN_E_COMPFILE_BADTLB: HRESULT = 0x80110428; +pub const COMADMIN_E_COMPFILE_NOTINSTALLABLE: HRESULT = 0x80110429; +pub const COMADMIN_E_NOTCHANGEABLE: HRESULT = 0x8011042A; +pub const COMADMIN_E_NOTDELETEABLE: HRESULT = 0x8011042B; +pub const COMADMIN_E_SESSION: HRESULT = 0x8011042C; +pub const COMADMIN_E_COMP_MOVE_LOCKED: HRESULT = 0x8011042D; +pub const COMADMIN_E_COMP_MOVE_BAD_DEST: HRESULT = 0x8011042E; +pub const COMADMIN_E_REGISTERTLB: HRESULT = 0x80110430; +pub const COMADMIN_E_SYSTEMAPP: HRESULT = 0x80110433; +pub const COMADMIN_E_COMPFILE_NOREGISTRAR: HRESULT = 0x80110434; +pub const COMADMIN_E_COREQCOMPINSTALLED: HRESULT = 0x80110435; +pub const COMADMIN_E_SERVICENOTINSTALLED: HRESULT = 0x80110436; +pub const COMADMIN_E_PROPERTYSAVEFAILED: HRESULT = 0x80110437; +pub const COMADMIN_E_OBJECTEXISTS: HRESULT = 0x80110438; +pub const COMADMIN_E_COMPONENTEXISTS: HRESULT = 0x80110439; +pub const COMADMIN_E_REGFILE_CORRUPT: HRESULT = 0x8011043B; +pub const COMADMIN_E_PROPERTY_OVERFLOW: HRESULT = 0x8011043C; +pub const COMADMIN_E_NOTINREGISTRY: HRESULT = 0x8011043E; +pub const COMADMIN_E_OBJECTNOTPOOLABLE: HRESULT = 0x8011043F; +pub const COMADMIN_E_APPLID_MATCHES_CLSID: HRESULT = 0x80110446; +pub const COMADMIN_E_ROLE_DOES_NOT_EXIST: HRESULT = 0x80110447; +pub const COMADMIN_E_START_APP_NEEDS_COMPONENTS: HRESULT = 0x80110448; +pub const COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM: HRESULT = 0x80110449; +pub const COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY: HRESULT = 0x8011044A; +pub const COMADMIN_E_CAN_NOT_START_APP: HRESULT = 0x8011044B; +pub const COMADMIN_E_CAN_NOT_EXPORT_SYS_APP: HRESULT = 0x8011044C; +pub const COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT: HRESULT = 0x8011044D; +pub const COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBER: HRESULT = 0x8011044E; +pub const COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLE: HRESULT = 0x8011044F; +pub const COMADMIN_E_BASE_PARTITION_ONLY: HRESULT = 0x80110450; +pub const COMADMIN_E_START_APP_DISABLED: HRESULT = 0x80110451; +pub const COMADMIN_E_CAT_DUPLICATE_PARTITION_NAME: HRESULT = 0x80110457; +pub const COMADMIN_E_CAT_INVALID_PARTITION_NAME: HRESULT = 0x80110458; +pub const COMADMIN_E_CAT_PARTITION_IN_USE: HRESULT = 0x80110459; +pub const COMADMIN_E_FILE_PARTITION_DUPLICATE_FILES: HRESULT = 0x8011045A; +pub const COMADMIN_E_CAT_IMPORTED_COMPONENTS_NOT_ALLOWED: HRESULT = 0x8011045B; +pub const COMADMIN_E_AMBIGUOUS_APPLICATION_NAME: HRESULT = 0x8011045C; +pub const COMADMIN_E_AMBIGUOUS_PARTITION_NAME: HRESULT = 0x8011045D; +pub const COMADMIN_E_REGDB_NOTINITIALIZED: HRESULT = 0x80110472; +pub const COMADMIN_E_REGDB_NOTOPEN: HRESULT = 0x80110473; +pub const COMADMIN_E_REGDB_SYSTEMERR: HRESULT = 0x80110474; +pub const COMADMIN_E_REGDB_ALREADYRUNNING: HRESULT = 0x80110475; +pub const COMADMIN_E_MIG_VERSIONNOTSUPPORTED: HRESULT = 0x80110480; +pub const COMADMIN_E_MIG_SCHEMANOTFOUND: HRESULT = 0x80110481; +pub const COMADMIN_E_CAT_BITNESSMISMATCH: HRESULT = 0x80110482; +pub const COMADMIN_E_CAT_UNACCEPTABLEBITNESS: HRESULT = 0x80110483; +pub const COMADMIN_E_CAT_WRONGAPPBITNESS: HRESULT = 0x80110484; +pub const COMADMIN_E_CAT_PAUSE_RESUME_NOT_SUPPORTED: HRESULT = 0x80110485; +pub const COMADMIN_E_CAT_SERVERFAULT: HRESULT = 0x80110486; +pub const COMQC_E_APPLICATION_NOT_QUEUED: HRESULT = 0x80110600; +pub const COMQC_E_NO_QUEUEABLE_INTERFACES: HRESULT = 0x80110601; +pub const COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE: HRESULT = 0x80110602; +pub const COMQC_E_NO_IPERSISTSTREAM: HRESULT = 0x80110603; +pub const COMQC_E_BAD_MESSAGE: HRESULT = 0x80110604; +pub const COMQC_E_UNAUTHENTICATED: HRESULT = 0x80110605; +pub const COMQC_E_UNTRUSTED_ENQUEUER: HRESULT = 0x80110606; +pub const MSDTC_E_DUPLICATE_RESOURCE: HRESULT = 0x80110701; +pub const COMADMIN_E_OBJECT_PARENT_MISSING: HRESULT = 0x80110808; +pub const COMADMIN_E_OBJECT_DOES_NOT_EXIST: HRESULT = 0x80110809; +pub const COMADMIN_E_APP_NOT_RUNNING: HRESULT = 0x8011080A; +pub const COMADMIN_E_INVALID_PARTITION: HRESULT = 0x8011080B; +pub const COMADMIN_E_SVCAPP_NOT_POOLABLE_OR_RECYCLABLE: HRESULT = 0x8011080D; +pub const COMADMIN_E_USER_IN_SET: HRESULT = 0x8011080E; +pub const COMADMIN_E_CANTRECYCLELIBRARYAPPS: HRESULT = 0x8011080F; +pub const COMADMIN_E_CANTRECYCLESERVICEAPPS: HRESULT = 0x80110811; +pub const COMADMIN_E_PROCESSALREADYRECYCLED: HRESULT = 0x80110812; +pub const COMADMIN_E_PAUSEDPROCESSMAYNOTBERECYCLED: HRESULT = 0x80110813; +pub const COMADMIN_E_CANTMAKEINPROCSERVICE: HRESULT = 0x80110814; +pub const COMADMIN_E_PROGIDINUSEBYCLSID: HRESULT = 0x80110815; +pub const COMADMIN_E_DEFAULT_PARTITION_NOT_IN_SET: HRESULT = 0x80110816; +pub const COMADMIN_E_RECYCLEDPROCESSMAYNOTBEPAUSED: HRESULT = 0x80110817; +pub const COMADMIN_E_PARTITION_ACCESSDENIED: HRESULT = 0x80110818; +pub const COMADMIN_E_PARTITION_MSI_ONLY: HRESULT = 0x80110819; +pub const COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_1_0_FORMAT: HRESULT = 0x8011081A; +pub const COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_NONBASE_PARTITIONS: HRESULT + = 0x8011081B; +pub const COMADMIN_E_COMP_MOVE_SOURCE: HRESULT = 0x8011081C; +pub const COMADMIN_E_COMP_MOVE_DEST: HRESULT = 0x8011081D; +pub const COMADMIN_E_COMP_MOVE_PRIVATE: HRESULT = 0x8011081E; +pub const COMADMIN_E_BASEPARTITION_REQUIRED_IN_SET: HRESULT = 0x8011081F; +pub const COMADMIN_E_CANNOT_ALIAS_EVENTCLASS: HRESULT = 0x80110820; +pub const COMADMIN_E_PRIVATE_ACCESSDENIED: HRESULT = 0x80110821; +pub const COMADMIN_E_SAFERINVALID: HRESULT = 0x80110822; +pub const COMADMIN_E_REGISTRY_ACCESSDENIED: HRESULT = 0x80110823; +pub const COMADMIN_E_PARTITIONS_DISABLED: HRESULT = 0x80110824; +pub const WER_S_REPORT_DEBUG: HRESULT = 0x001B0000; +pub const WER_S_REPORT_UPLOADED: HRESULT = 0x001B0001; +pub const WER_S_REPORT_QUEUED: HRESULT = 0x001B0002; +pub const WER_S_DISABLED: HRESULT = 0x001B0003; +pub const WER_S_SUSPENDED_UPLOAD: HRESULT = 0x001B0004; +pub const WER_S_DISABLED_QUEUE: HRESULT = 0x001B0005; +pub const WER_S_DISABLED_ARCHIVE: HRESULT = 0x001B0006; +pub const WER_S_REPORT_ASYNC: HRESULT = 0x001B0007; +pub const WER_S_IGNORE_ASSERT_INSTANCE: HRESULT = 0x001B0008; +pub const WER_S_IGNORE_ALL_ASSERTS: HRESULT = 0x001B0009; +pub const WER_S_ASSERT_CONTINUE: HRESULT = 0x001B000A; +pub const WER_S_THROTTLED: HRESULT = 0x001B000B; +pub const WER_E_CRASH_FAILURE: HRESULT = 0x801B8000; +pub const WER_E_CANCELED: HRESULT = 0x801B8001; +pub const WER_E_NETWORK_FAILURE: HRESULT = 0x801B8002; +pub const WER_E_NOT_INITIALIZED: HRESULT = 0x801B8003; +pub const WER_E_ALREADY_REPORTING: HRESULT = 0x801B8004; +pub const WER_E_DUMP_THROTTLED: HRESULT = 0x801B8005; +pub const ERROR_FLT_IO_COMPLETE: HRESULT = 0x001F0001; +pub const ERROR_FLT_NO_HANDLER_DEFINED: HRESULT = 0x801F0001; +pub const ERROR_FLT_CONTEXT_ALREADY_DEFINED: HRESULT = 0x801F0002; +pub const ERROR_FLT_INVALID_ASYNCHRONOUS_REQUEST: HRESULT = 0x801F0003; +pub const ERROR_FLT_DISALLOW_FAST_IO: HRESULT = 0x801F0004; +pub const ERROR_FLT_INVALID_NAME_REQUEST: HRESULT = 0x801F0005; +pub const ERROR_FLT_NOT_SAFE_TO_POST_OPERATION: HRESULT = 0x801F0006; +pub const ERROR_FLT_NOT_INITIALIZED: HRESULT = 0x801F0007; +pub const ERROR_FLT_FILTER_NOT_READY: HRESULT = 0x801F0008; +pub const ERROR_FLT_POST_OPERATION_CLEANUP: HRESULT = 0x801F0009; +pub const ERROR_FLT_INTERNAL_ERROR: HRESULT = 0x801F000A; +pub const ERROR_FLT_DELETING_OBJECT: HRESULT = 0x801F000B; +pub const ERROR_FLT_MUST_BE_NONPAGED_POOL: HRESULT = 0x801F000C; +pub const ERROR_FLT_DUPLICATE_ENTRY: HRESULT = 0x801F000D; +pub const ERROR_FLT_CBDQ_DISABLED: HRESULT = 0x801F000E; +pub const ERROR_FLT_DO_NOT_ATTACH: HRESULT = 0x801F000F; +pub const ERROR_FLT_DO_NOT_DETACH: HRESULT = 0x801F0010; +pub const ERROR_FLT_INSTANCE_ALTITUDE_COLLISION: HRESULT = 0x801F0011; +pub const ERROR_FLT_INSTANCE_NAME_COLLISION: HRESULT = 0x801F0012; +pub const ERROR_FLT_FILTER_NOT_FOUND: HRESULT = 0x801F0013; +pub const ERROR_FLT_VOLUME_NOT_FOUND: HRESULT = 0x801F0014; +pub const ERROR_FLT_INSTANCE_NOT_FOUND: HRESULT = 0x801F0015; +pub const ERROR_FLT_CONTEXT_ALLOCATION_NOT_FOUND: HRESULT = 0x801F0016; +pub const ERROR_FLT_INVALID_CONTEXT_REGISTRATION: HRESULT = 0x801F0017; +pub const ERROR_FLT_NAME_CACHE_MISS: HRESULT = 0x801F0018; +pub const ERROR_FLT_NO_DEVICE_OBJECT: HRESULT = 0x801F0019; +pub const ERROR_FLT_VOLUME_ALREADY_MOUNTED: HRESULT = 0x801F001A; +pub const ERROR_FLT_ALREADY_ENLISTED: HRESULT = 0x801F001B; +pub const ERROR_FLT_CONTEXT_ALREADY_LINKED: HRESULT = 0x801F001C; +pub const ERROR_FLT_NO_WAITER_FOR_REPLY: HRESULT = 0x801F0020; +pub const ERROR_FLT_REGISTRATION_BUSY: HRESULT = 0x801F0023; +pub const ERROR_HUNG_DISPLAY_DRIVER_THREAD: HRESULT = 0x80260001; +pub const DWM_E_COMPOSITIONDISABLED: HRESULT = 0x80263001; +pub const DWM_E_REMOTING_NOT_SUPPORTED: HRESULT = 0x80263002; +pub const DWM_E_NO_REDIRECTION_SURFACE_AVAILABLE: HRESULT = 0x80263003; +pub const DWM_E_NOT_QUEUING_PRESENTS: HRESULT = 0x80263004; +pub const DWM_E_ADAPTER_NOT_FOUND: HRESULT = 0x80263005; +pub const DWM_S_GDI_REDIRECTION_SURFACE: HRESULT = 0x00263005; +pub const DWM_E_TEXTURE_TOO_LARGE: HRESULT = 0x80263007; +pub const ERROR_MONITOR_NO_DESCRIPTOR: HRESULT = 0x80261001; +pub const ERROR_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT: HRESULT = 0x80261002; +pub const ERROR_MONITOR_INVALID_DESCRIPTOR_CHECKSUM: HRESULT = 0xC0261003; +pub const ERROR_MONITOR_INVALID_STANDARD_TIMING_BLOCK: HRESULT = 0xC0261004; +pub const ERROR_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED: HRESULT = 0xC0261005; +pub const ERROR_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK: HRESULT = 0xC0261006; +pub const ERROR_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK: HRESULT = 0xC0261007; +pub const ERROR_MONITOR_NO_MORE_DESCRIPTOR_DATA: HRESULT = 0xC0261008; +pub const ERROR_MONITOR_INVALID_DETAILED_TIMING_BLOCK: HRESULT = 0xC0261009; +pub const ERROR_MONITOR_INVALID_MANUFACTURE_DATE: HRESULT = 0xC026100A; +pub const ERROR_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER: HRESULT = 0xC0262000; +pub const ERROR_GRAPHICS_INSUFFICIENT_DMA_BUFFER: HRESULT = 0xC0262001; +pub const ERROR_GRAPHICS_INVALID_DISPLAY_ADAPTER: HRESULT = 0xC0262002; +pub const ERROR_GRAPHICS_ADAPTER_WAS_RESET: HRESULT = 0xC0262003; +pub const ERROR_GRAPHICS_INVALID_DRIVER_MODEL: HRESULT = 0xC0262004; +pub const ERROR_GRAPHICS_PRESENT_MODE_CHANGED: HRESULT = 0xC0262005; +pub const ERROR_GRAPHICS_PRESENT_OCCLUDED: HRESULT = 0xC0262006; +pub const ERROR_GRAPHICS_PRESENT_DENIED: HRESULT = 0xC0262007; +pub const ERROR_GRAPHICS_CANNOTCOLORCONVERT: HRESULT = 0xC0262008; +pub const ERROR_GRAPHICS_DRIVER_MISMATCH: HRESULT = 0xC0262009; +pub const ERROR_GRAPHICS_PARTIAL_DATA_POPULATED: HRESULT = 0x4026200A; +pub const ERROR_GRAPHICS_PRESENT_REDIRECTION_DISABLED: HRESULT = 0xC026200B; +pub const ERROR_GRAPHICS_PRESENT_UNOCCLUDED: HRESULT = 0xC026200C; +pub const ERROR_GRAPHICS_WINDOWDC_NOT_AVAILABLE: HRESULT = 0xC026200D; +pub const ERROR_GRAPHICS_WINDOWLESS_PRESENT_DISABLED: HRESULT = 0xC026200E; +pub const ERROR_GRAPHICS_NO_VIDEO_MEMORY: HRESULT = 0xC0262100; +pub const ERROR_GRAPHICS_CANT_LOCK_MEMORY: HRESULT = 0xC0262101; +pub const ERROR_GRAPHICS_ALLOCATION_BUSY: HRESULT = 0xC0262102; +pub const ERROR_GRAPHICS_TOO_MANY_REFERENCES: HRESULT = 0xC0262103; +pub const ERROR_GRAPHICS_TRY_AGAIN_LATER: HRESULT = 0xC0262104; +pub const ERROR_GRAPHICS_TRY_AGAIN_NOW: HRESULT = 0xC0262105; +pub const ERROR_GRAPHICS_ALLOCATION_INVALID: HRESULT = 0xC0262106; +pub const ERROR_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE: HRESULT = 0xC0262107; +pub const ERROR_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED: HRESULT = 0xC0262108; +pub const ERROR_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION: HRESULT = 0xC0262109; +pub const ERROR_GRAPHICS_INVALID_ALLOCATION_USAGE: HRESULT = 0xC0262110; +pub const ERROR_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION: HRESULT = 0xC0262111; +pub const ERROR_GRAPHICS_ALLOCATION_CLOSED: HRESULT = 0xC0262112; +pub const ERROR_GRAPHICS_INVALID_ALLOCATION_INSTANCE: HRESULT = 0xC0262113; +pub const ERROR_GRAPHICS_INVALID_ALLOCATION_HANDLE: HRESULT = 0xC0262114; +pub const ERROR_GRAPHICS_WRONG_ALLOCATION_DEVICE: HRESULT = 0xC0262115; +pub const ERROR_GRAPHICS_ALLOCATION_CONTENT_LOST: HRESULT = 0xC0262116; +pub const ERROR_GRAPHICS_GPU_EXCEPTION_ON_DEVICE: HRESULT = 0xC0262200; +pub const ERROR_GRAPHICS_SKIP_ALLOCATION_PREPARATION: HRESULT = 0x40262201; +pub const ERROR_GRAPHICS_INVALID_VIDPN_TOPOLOGY: HRESULT = 0xC0262300; +pub const ERROR_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED: HRESULT = 0xC0262301; +pub const ERROR_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED: HRESULT + = 0xC0262302; +pub const ERROR_GRAPHICS_INVALID_VIDPN: HRESULT = 0xC0262303; +pub const ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE: HRESULT = 0xC0262304; +pub const ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET: HRESULT = 0xC0262305; +pub const ERROR_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED: HRESULT = 0xC0262306; +pub const ERROR_GRAPHICS_MODE_NOT_PINNED: HRESULT = 0x00262307; +pub const ERROR_GRAPHICS_INVALID_VIDPN_SOURCEMODESET: HRESULT = 0xC0262308; +pub const ERROR_GRAPHICS_INVALID_VIDPN_TARGETMODESET: HRESULT = 0xC0262309; +pub const ERROR_GRAPHICS_INVALID_FREQUENCY: HRESULT = 0xC026230A; +pub const ERROR_GRAPHICS_INVALID_ACTIVE_REGION: HRESULT = 0xC026230B; +pub const ERROR_GRAPHICS_INVALID_TOTAL_REGION: HRESULT = 0xC026230C; +pub const ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE: HRESULT = 0xC0262310; +pub const ERROR_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE: HRESULT = 0xC0262311; +pub const ERROR_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET: HRESULT = 0xC0262312; +pub const ERROR_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY: HRESULT = 0xC0262313; +pub const ERROR_GRAPHICS_MODE_ALREADY_IN_MODESET: HRESULT = 0xC0262314; +pub const ERROR_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET: HRESULT = 0xC0262315; +pub const ERROR_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET: HRESULT = 0xC0262316; +pub const ERROR_GRAPHICS_SOURCE_ALREADY_IN_SET: HRESULT = 0xC0262317; +pub const ERROR_GRAPHICS_TARGET_ALREADY_IN_SET: HRESULT = 0xC0262318; +pub const ERROR_GRAPHICS_INVALID_VIDPN_PRESENT_PATH: HRESULT = 0xC0262319; +pub const ERROR_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY: HRESULT = 0xC026231A; +pub const ERROR_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET: HRESULT = 0xC026231B; +pub const ERROR_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE: HRESULT = 0xC026231C; +pub const ERROR_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET: HRESULT = 0xC026231D; +pub const ERROR_GRAPHICS_NO_PREFERRED_MODE: HRESULT = 0x0026231E; +pub const ERROR_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET: HRESULT = 0xC026231F; +pub const ERROR_GRAPHICS_STALE_MODESET: HRESULT = 0xC0262320; +pub const ERROR_GRAPHICS_INVALID_MONITOR_SOURCEMODESET: HRESULT = 0xC0262321; +pub const ERROR_GRAPHICS_INVALID_MONITOR_SOURCE_MODE: HRESULT = 0xC0262322; +pub const ERROR_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN: HRESULT = 0xC0262323; +pub const ERROR_GRAPHICS_MODE_ID_MUST_BE_UNIQUE: HRESULT = 0xC0262324; +pub const ERROR_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION: HRESULT + = 0xC0262325; +pub const ERROR_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES: HRESULT + = 0xC0262326; +pub const ERROR_GRAPHICS_PATH_NOT_IN_TOPOLOGY: HRESULT = 0xC0262327; +pub const ERROR_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE: HRESULT = 0xC0262328; +pub const ERROR_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET: HRESULT = 0xC0262329; +pub const ERROR_GRAPHICS_INVALID_MONITORDESCRIPTORSET: HRESULT = 0xC026232A; +pub const ERROR_GRAPHICS_INVALID_MONITORDESCRIPTOR: HRESULT = 0xC026232B; +pub const ERROR_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET: HRESULT = 0xC026232C; +pub const ERROR_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET: HRESULT = 0xC026232D; +pub const ERROR_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE: HRESULT = 0xC026232E; +pub const ERROR_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE: HRESULT = 0xC026232F; +pub const ERROR_GRAPHICS_RESOURCES_NOT_RELATED: HRESULT = 0xC0262330; +pub const ERROR_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE: HRESULT = 0xC0262331; +pub const ERROR_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE: HRESULT = 0xC0262332; +pub const ERROR_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET: HRESULT = 0xC0262333; +pub const ERROR_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER: HRESULT + = 0xC0262334; +pub const ERROR_GRAPHICS_NO_VIDPNMGR: HRESULT = 0xC0262335; +pub const ERROR_GRAPHICS_NO_ACTIVE_VIDPN: HRESULT = 0xC0262336; +pub const ERROR_GRAPHICS_STALE_VIDPN_TOPOLOGY: HRESULT = 0xC0262337; +pub const ERROR_GRAPHICS_MONITOR_NOT_CONNECTED: HRESULT = 0xC0262338; +pub const ERROR_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY: HRESULT = 0xC0262339; +pub const ERROR_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE: HRESULT = 0xC026233A; +pub const ERROR_GRAPHICS_INVALID_VISIBLEREGION_SIZE: HRESULT = 0xC026233B; +pub const ERROR_GRAPHICS_INVALID_STRIDE: HRESULT = 0xC026233C; +pub const ERROR_GRAPHICS_INVALID_PIXELFORMAT: HRESULT = 0xC026233D; +pub const ERROR_GRAPHICS_INVALID_COLORBASIS: HRESULT = 0xC026233E; +pub const ERROR_GRAPHICS_INVALID_PIXELVALUEACCESSMODE: HRESULT = 0xC026233F; +pub const ERROR_GRAPHICS_TARGET_NOT_IN_TOPOLOGY: HRESULT = 0xC0262340; +pub const ERROR_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT: HRESULT = 0xC0262341; +pub const ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE: HRESULT = 0xC0262342; +pub const ERROR_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN: HRESULT = 0xC0262343; +pub const ERROR_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL: HRESULT = 0xC0262344; +pub const ERROR_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION: HRESULT + = 0xC0262345; +pub const ERROR_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED: HRESULT + = 0xC0262346; +pub const ERROR_GRAPHICS_INVALID_GAMMA_RAMP: HRESULT = 0xC0262347; +pub const ERROR_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED: HRESULT = 0xC0262348; +pub const ERROR_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED: HRESULT = 0xC0262349; +pub const ERROR_GRAPHICS_MODE_NOT_IN_MODESET: HRESULT = 0xC026234A; +pub const ERROR_GRAPHICS_DATASET_IS_EMPTY: HRESULT = 0x0026234B; +pub const ERROR_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET: HRESULT = 0x0026234C; +pub const ERROR_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON: HRESULT + = 0xC026234D; +pub const ERROR_GRAPHICS_INVALID_PATH_CONTENT_TYPE: HRESULT = 0xC026234E; +pub const ERROR_GRAPHICS_INVALID_COPYPROTECTION_TYPE: HRESULT = 0xC026234F; +pub const ERROR_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS: HRESULT = 0xC0262350; +pub const ERROR_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_PINNED: HRESULT = 0x00262351; +pub const ERROR_GRAPHICS_INVALID_SCANLINE_ORDERING: HRESULT = 0xC0262352; +pub const ERROR_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED: HRESULT = 0xC0262353; +pub const ERROR_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS: HRESULT = 0xC0262354; +pub const ERROR_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT: HRESULT = 0xC0262355; +pub const ERROR_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM: HRESULT = 0xC0262356; +pub const ERROR_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN: HRESULT = 0xC0262357; +pub const ERROR_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT: HRESULT + = 0xC0262358; +pub const ERROR_GRAPHICS_MAX_NUM_PATHS_REACHED: HRESULT = 0xC0262359; +pub const ERROR_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION: HRESULT = 0xC026235A; +pub const ERROR_GRAPHICS_INVALID_CLIENT_TYPE: HRESULT = 0xC026235B; +pub const ERROR_GRAPHICS_CLIENTVIDPN_NOT_SET: HRESULT = 0xC026235C; +pub const ERROR_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED: HRESULT = 0xC0262400; +pub const ERROR_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED: HRESULT = 0xC0262401; +pub const ERROR_GRAPHICS_UNKNOWN_CHILD_STATUS: HRESULT = 0x4026242F; +pub const ERROR_GRAPHICS_NOT_A_LINKED_ADAPTER: HRESULT = 0xC0262430; +pub const ERROR_GRAPHICS_LEADLINK_NOT_ENUMERATED: HRESULT = 0xC0262431; +pub const ERROR_GRAPHICS_CHAINLINKS_NOT_ENUMERATED: HRESULT = 0xC0262432; +pub const ERROR_GRAPHICS_ADAPTER_CHAIN_NOT_READY: HRESULT = 0xC0262433; +pub const ERROR_GRAPHICS_CHAINLINKS_NOT_STARTED: HRESULT = 0xC0262434; +pub const ERROR_GRAPHICS_CHAINLINKS_NOT_POWERED_ON: HRESULT = 0xC0262435; +pub const ERROR_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE: HRESULT = 0xC0262436; +pub const ERROR_GRAPHICS_LEADLINK_START_DEFERRED: HRESULT = 0x40262437; +pub const ERROR_GRAPHICS_NOT_POST_DEVICE_DRIVER: HRESULT = 0xC0262438; +pub const ERROR_GRAPHICS_POLLING_TOO_FREQUENTLY: HRESULT = 0x40262439; +pub const ERROR_GRAPHICS_START_DEFERRED: HRESULT = 0x4026243A; +pub const ERROR_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED: HRESULT = 0xC026243B; +pub const ERROR_GRAPHICS_OPM_NOT_SUPPORTED: HRESULT = 0xC0262500; +pub const ERROR_GRAPHICS_COPP_NOT_SUPPORTED: HRESULT = 0xC0262501; +pub const ERROR_GRAPHICS_UAB_NOT_SUPPORTED: HRESULT = 0xC0262502; +pub const ERROR_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS: HRESULT = 0xC0262503; +pub const ERROR_GRAPHICS_OPM_NO_VIDEO_OUTPUTS_EXIST: HRESULT = 0xC0262505; +pub const ERROR_GRAPHICS_OPM_INTERNAL_ERROR: HRESULT = 0xC026250B; +pub const ERROR_GRAPHICS_OPM_INVALID_HANDLE: HRESULT = 0xC026250C; +pub const ERROR_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH: HRESULT = 0xC026250E; +pub const ERROR_GRAPHICS_OPM_SPANNING_MODE_ENABLED: HRESULT = 0xC026250F; +pub const ERROR_GRAPHICS_OPM_THEATER_MODE_ENABLED: HRESULT = 0xC0262510; +pub const ERROR_GRAPHICS_PVP_HFS_FAILED: HRESULT = 0xC0262511; +pub const ERROR_GRAPHICS_OPM_INVALID_SRM: HRESULT = 0xC0262512; +pub const ERROR_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP: HRESULT = 0xC0262513; +pub const ERROR_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP: HRESULT = 0xC0262514; +pub const ERROR_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA: HRESULT = 0xC0262515; +pub const ERROR_GRAPHICS_OPM_HDCP_SRM_NEVER_SET: HRESULT = 0xC0262516; +pub const ERROR_GRAPHICS_OPM_RESOLUTION_TOO_HIGH: HRESULT = 0xC0262517; +pub const ERROR_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE: HRESULT = 0xC0262518; +pub const ERROR_GRAPHICS_OPM_VIDEO_OUTPUT_NO_LONGER_EXISTS: HRESULT = 0xC026251A; +pub const ERROR_GRAPHICS_OPM_SESSION_TYPE_CHANGE_IN_PROGRESS: HRESULT = 0xC026251B; +pub const ERROR_GRAPHICS_OPM_VIDEO_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS: HRESULT + = 0xC026251C; +pub const ERROR_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST: HRESULT = 0xC026251D; +pub const ERROR_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR: HRESULT = 0xC026251E; +pub const ERROR_GRAPHICS_OPM_VIDEO_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS: HRESULT + = 0xC026251F; +pub const ERROR_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED: HRESULT = 0xC0262520; +pub const ERROR_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST: HRESULT = 0xC0262521; +pub const ERROR_GRAPHICS_I2C_NOT_SUPPORTED: HRESULT = 0xC0262580; +pub const ERROR_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST: HRESULT = 0xC0262581; +pub const ERROR_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA: HRESULT = 0xC0262582; +pub const ERROR_GRAPHICS_I2C_ERROR_RECEIVING_DATA: HRESULT = 0xC0262583; +pub const ERROR_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED: HRESULT = 0xC0262584; +pub const ERROR_GRAPHICS_DDCCI_INVALID_DATA: HRESULT = 0xC0262585; +pub const ERROR_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE: HRESULT + = 0xC0262586; +pub const ERROR_GRAPHICS_MCA_INVALID_CAPABILITIES_STRING: HRESULT = 0xC0262587; +pub const ERROR_GRAPHICS_MCA_INTERNAL_ERROR: HRESULT = 0xC0262588; +pub const ERROR_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND: HRESULT = 0xC0262589; +pub const ERROR_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH: HRESULT = 0xC026258A; +pub const ERROR_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM: HRESULT = 0xC026258B; +pub const ERROR_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE: HRESULT = 0xC026258C; +pub const ERROR_GRAPHICS_MONITOR_NO_LONGER_EXISTS: HRESULT = 0xC026258D; +pub const ERROR_GRAPHICS_DDCCI_CURRENT_CURRENT_VALUE_GREATER_THAN_MAXIMUM_VALUE: HRESULT + = 0xC02625D8; +pub const ERROR_GRAPHICS_MCA_INVALID_VCP_VERSION: HRESULT = 0xC02625D9; +pub const ERROR_GRAPHICS_MCA_MONITOR_VIOLATES_MCCS_SPECIFICATION: HRESULT + = 0xC02625DA; +pub const ERROR_GRAPHICS_MCA_MCCS_VERSION_MISMATCH: HRESULT = 0xC02625DB; +pub const ERROR_GRAPHICS_MCA_UNSUPPORTED_MCCS_VERSION: HRESULT = 0xC02625DC; +pub const ERROR_GRAPHICS_MCA_INVALID_TECHNOLOGY_TYPE_RETURNED: HRESULT = 0xC02625DE; +pub const ERROR_GRAPHICS_MCA_UNSUPPORTED_COLOR_TEMPERATURE: HRESULT = 0xC02625DF; +pub const ERROR_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED: HRESULT = 0xC02625E0; +pub const ERROR_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME: HRESULT = 0xC02625E1; +pub const ERROR_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP: HRESULT + = 0xC02625E2; +pub const ERROR_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED: HRESULT = 0xC02625E3; +pub const ERROR_GRAPHICS_INVALID_POINTER: HRESULT = 0xC02625E4; +pub const ERROR_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE: HRESULT + = 0xC02625E5; +pub const ERROR_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL: HRESULT = 0xC02625E6; +pub const ERROR_GRAPHICS_INTERNAL_ERROR: HRESULT = 0xC02625E7; +pub const ERROR_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS: HRESULT = 0xC02605E8; +pub const NAP_E_INVALID_PACKET: HRESULT = 0x80270001; +pub const NAP_E_MISSING_SOH: HRESULT = 0x80270002; +pub const NAP_E_CONFLICTING_ID: HRESULT = 0x80270003; +pub const NAP_E_NO_CACHED_SOH: HRESULT = 0x80270004; +pub const NAP_E_STILL_BOUND: HRESULT = 0x80270005; +pub const NAP_E_NOT_REGISTERED: HRESULT = 0x80270006; +pub const NAP_E_NOT_INITIALIZED: HRESULT = 0x80270007; +pub const NAP_E_MISMATCHED_ID: HRESULT = 0x80270008; +pub const NAP_E_NOT_PENDING: HRESULT = 0x80270009; +pub const NAP_E_ID_NOT_FOUND: HRESULT = 0x8027000A; +pub const NAP_E_MAXSIZE_TOO_SMALL: HRESULT = 0x8027000B; +pub const NAP_E_SERVICE_NOT_RUNNING: HRESULT = 0x8027000C; +pub const NAP_S_CERT_ALREADY_PRESENT: HRESULT = 0x0027000D; +pub const NAP_E_ENTITY_DISABLED: HRESULT = 0x8027000E; +pub const NAP_E_NETSH_GROUPPOLICY_ERROR: HRESULT = 0x8027000F; +pub const NAP_E_TOO_MANY_CALLS: HRESULT = 0x80270010; +pub const NAP_E_SHV_CONFIG_EXISTED: HRESULT = 0x80270011; +pub const NAP_E_SHV_CONFIG_NOT_FOUND: HRESULT = 0x80270012; +pub const NAP_E_SHV_TIMEOUT: HRESULT = 0x80270013; +pub const TPM_E_ERROR_MASK: HRESULT = 0x80280000; +pub const TPM_E_AUTHFAIL: HRESULT = 0x80280001; +pub const TPM_E_BADINDEX: HRESULT = 0x80280002; +pub const TPM_E_BAD_PARAMETER: HRESULT = 0x80280003; +pub const TPM_E_AUDITFAILURE: HRESULT = 0x80280004; +pub const TPM_E_CLEAR_DISABLED: HRESULT = 0x80280005; +pub const TPM_E_DEACTIVATED: HRESULT = 0x80280006; +pub const TPM_E_DISABLED: HRESULT = 0x80280007; +pub const TPM_E_DISABLED_CMD: HRESULT = 0x80280008; +pub const TPM_E_FAIL: HRESULT = 0x80280009; +pub const TPM_E_BAD_ORDINAL: HRESULT = 0x8028000A; +pub const TPM_E_INSTALL_DISABLED: HRESULT = 0x8028000B; +pub const TPM_E_INVALID_KEYHANDLE: HRESULT = 0x8028000C; +pub const TPM_E_KEYNOTFOUND: HRESULT = 0x8028000D; +pub const TPM_E_INAPPROPRIATE_ENC: HRESULT = 0x8028000E; +pub const TPM_E_MIGRATEFAIL: HRESULT = 0x8028000F; +pub const TPM_E_INVALID_PCR_INFO: HRESULT = 0x80280010; +pub const TPM_E_NOSPACE: HRESULT = 0x80280011; +pub const TPM_E_NOSRK: HRESULT = 0x80280012; +pub const TPM_E_NOTSEALED_BLOB: HRESULT = 0x80280013; +pub const TPM_E_OWNER_SET: HRESULT = 0x80280014; +pub const TPM_E_RESOURCES: HRESULT = 0x80280015; +pub const TPM_E_SHORTRANDOM: HRESULT = 0x80280016; +pub const TPM_E_SIZE: HRESULT = 0x80280017; +pub const TPM_E_WRONGPCRVAL: HRESULT = 0x80280018; +pub const TPM_E_BAD_PARAM_SIZE: HRESULT = 0x80280019; +pub const TPM_E_SHA_THREAD: HRESULT = 0x8028001A; +pub const TPM_E_SHA_ERROR: HRESULT = 0x8028001B; +pub const TPM_E_FAILEDSELFTEST: HRESULT = 0x8028001C; +pub const TPM_E_AUTH2FAIL: HRESULT = 0x8028001D; +pub const TPM_E_BADTAG: HRESULT = 0x8028001E; +pub const TPM_E_IOERROR: HRESULT = 0x8028001F; +pub const TPM_E_ENCRYPT_ERROR: HRESULT = 0x80280020; +pub const TPM_E_DECRYPT_ERROR: HRESULT = 0x80280021; +pub const TPM_E_INVALID_AUTHHANDLE: HRESULT = 0x80280022; +pub const TPM_E_NO_ENDORSEMENT: HRESULT = 0x80280023; +pub const TPM_E_INVALID_KEYUSAGE: HRESULT = 0x80280024; +pub const TPM_E_WRONG_ENTITYTYPE: HRESULT = 0x80280025; +pub const TPM_E_INVALID_POSTINIT: HRESULT = 0x80280026; +pub const TPM_E_INAPPROPRIATE_SIG: HRESULT = 0x80280027; +pub const TPM_E_BAD_KEY_PROPERTY: HRESULT = 0x80280028; +pub const TPM_E_BAD_MIGRATION: HRESULT = 0x80280029; +pub const TPM_E_BAD_SCHEME: HRESULT = 0x8028002A; +pub const TPM_E_BAD_DATASIZE: HRESULT = 0x8028002B; +pub const TPM_E_BAD_MODE: HRESULT = 0x8028002C; +pub const TPM_E_BAD_PRESENCE: HRESULT = 0x8028002D; +pub const TPM_E_BAD_VERSION: HRESULT = 0x8028002E; +pub const TPM_E_NO_WRAP_TRANSPORT: HRESULT = 0x8028002F; +pub const TPM_E_AUDITFAIL_UNSUCCESSFUL: HRESULT = 0x80280030; +pub const TPM_E_AUDITFAIL_SUCCESSFUL: HRESULT = 0x80280031; +pub const TPM_E_NOTRESETABLE: HRESULT = 0x80280032; +pub const TPM_E_NOTLOCAL: HRESULT = 0x80280033; +pub const TPM_E_BAD_TYPE: HRESULT = 0x80280034; +pub const TPM_E_INVALID_RESOURCE: HRESULT = 0x80280035; +pub const TPM_E_NOTFIPS: HRESULT = 0x80280036; +pub const TPM_E_INVALID_FAMILY: HRESULT = 0x80280037; +pub const TPM_E_NO_NV_PERMISSION: HRESULT = 0x80280038; +pub const TPM_E_REQUIRES_SIGN: HRESULT = 0x80280039; +pub const TPM_E_KEY_NOTSUPPORTED: HRESULT = 0x8028003A; +pub const TPM_E_AUTH_CONFLICT: HRESULT = 0x8028003B; +pub const TPM_E_AREA_LOCKED: HRESULT = 0x8028003C; +pub const TPM_E_BAD_LOCALITY: HRESULT = 0x8028003D; +pub const TPM_E_READ_ONLY: HRESULT = 0x8028003E; +pub const TPM_E_PER_NOWRITE: HRESULT = 0x8028003F; +pub const TPM_E_FAMILYCOUNT: HRESULT = 0x80280040; +pub const TPM_E_WRITE_LOCKED: HRESULT = 0x80280041; +pub const TPM_E_BAD_ATTRIBUTES: HRESULT = 0x80280042; +pub const TPM_E_INVALID_STRUCTURE: HRESULT = 0x80280043; +pub const TPM_E_KEY_OWNER_CONTROL: HRESULT = 0x80280044; +pub const TPM_E_BAD_COUNTER: HRESULT = 0x80280045; +pub const TPM_E_NOT_FULLWRITE: HRESULT = 0x80280046; +pub const TPM_E_CONTEXT_GAP: HRESULT = 0x80280047; +pub const TPM_E_MAXNVWRITES: HRESULT = 0x80280048; +pub const TPM_E_NOOPERATOR: HRESULT = 0x80280049; +pub const TPM_E_RESOURCEMISSING: HRESULT = 0x8028004A; +pub const TPM_E_DELEGATE_LOCK: HRESULT = 0x8028004B; +pub const TPM_E_DELEGATE_FAMILY: HRESULT = 0x8028004C; +pub const TPM_E_DELEGATE_ADMIN: HRESULT = 0x8028004D; +pub const TPM_E_TRANSPORT_NOTEXCLUSIVE: HRESULT = 0x8028004E; +pub const TPM_E_OWNER_CONTROL: HRESULT = 0x8028004F; +pub const TPM_E_DAA_RESOURCES: HRESULT = 0x80280050; +pub const TPM_E_DAA_INPUT_DATA0: HRESULT = 0x80280051; +pub const TPM_E_DAA_INPUT_DATA1: HRESULT = 0x80280052; +pub const TPM_E_DAA_ISSUER_SETTINGS: HRESULT = 0x80280053; +pub const TPM_E_DAA_TPM_SETTINGS: HRESULT = 0x80280054; +pub const TPM_E_DAA_STAGE: HRESULT = 0x80280055; +pub const TPM_E_DAA_ISSUER_VALIDITY: HRESULT = 0x80280056; +pub const TPM_E_DAA_WRONG_W: HRESULT = 0x80280057; +pub const TPM_E_BAD_HANDLE: HRESULT = 0x80280058; +pub const TPM_E_BAD_DELEGATE: HRESULT = 0x80280059; +pub const TPM_E_BADCONTEXT: HRESULT = 0x8028005A; +pub const TPM_E_TOOMANYCONTEXTS: HRESULT = 0x8028005B; +pub const TPM_E_MA_TICKET_SIGNATURE: HRESULT = 0x8028005C; +pub const TPM_E_MA_DESTINATION: HRESULT = 0x8028005D; +pub const TPM_E_MA_SOURCE: HRESULT = 0x8028005E; +pub const TPM_E_MA_AUTHORITY: HRESULT = 0x8028005F; +pub const TPM_E_PERMANENTEK: HRESULT = 0x80280061; +pub const TPM_E_BAD_SIGNATURE: HRESULT = 0x80280062; +pub const TPM_E_NOCONTEXTSPACE: HRESULT = 0x80280063; +pub const TPM_E_COMMAND_BLOCKED: HRESULT = 0x80280400; +pub const TPM_E_INVALID_HANDLE: HRESULT = 0x80280401; +pub const TPM_E_DUPLICATE_VHANDLE: HRESULT = 0x80280402; +pub const TPM_E_EMBEDDED_COMMAND_BLOCKED: HRESULT = 0x80280403; +pub const TPM_E_EMBEDDED_COMMAND_UNSUPPORTED: HRESULT = 0x80280404; +pub const TPM_E_RETRY: HRESULT = 0x80280800; +pub const TPM_E_NEEDS_SELFTEST: HRESULT = 0x80280801; +pub const TPM_E_DOING_SELFTEST: HRESULT = 0x80280802; +pub const TPM_E_DEFEND_LOCK_RUNNING: HRESULT = 0x80280803; +pub const TBS_E_INTERNAL_ERROR: HRESULT = 0x80284001; +pub const TBS_E_BAD_PARAMETER: HRESULT = 0x80284002; +pub const TBS_E_INVALID_OUTPUT_POINTER: HRESULT = 0x80284003; +pub const TBS_E_INVALID_CONTEXT: HRESULT = 0x80284004; +pub const TBS_E_INSUFFICIENT_BUFFER: HRESULT = 0x80284005; +pub const TBS_E_IOERROR: HRESULT = 0x80284006; +pub const TBS_E_INVALID_CONTEXT_PARAM: HRESULT = 0x80284007; +pub const TBS_E_SERVICE_NOT_RUNNING: HRESULT = 0x80284008; +pub const TBS_E_TOO_MANY_TBS_CONTEXTS: HRESULT = 0x80284009; +pub const TBS_E_TOO_MANY_RESOURCES: HRESULT = 0x8028400A; +pub const TBS_E_SERVICE_START_PENDING: HRESULT = 0x8028400B; +pub const TBS_E_PPI_NOT_SUPPORTED: HRESULT = 0x8028400C; +pub const TBS_E_COMMAND_CANCELED: HRESULT = 0x8028400D; +pub const TBS_E_BUFFER_TOO_LARGE: HRESULT = 0x8028400E; +pub const TBS_E_TPM_NOT_FOUND: HRESULT = 0x8028400F; +pub const TBS_E_SERVICE_DISABLED: HRESULT = 0x80284010; +pub const TBS_E_NO_EVENT_LOG: HRESULT = 0x80284011; +pub const TBS_E_ACCESS_DENIED: HRESULT = 0x80284012; +pub const TBS_E_PROVISIONING_NOT_ALLOWED: HRESULT = 0x80284013; +pub const TBS_E_PPI_FUNCTION_UNSUPPORTED: HRESULT = 0x80284014; +pub const TBS_E_OWNERAUTH_NOT_FOUND: HRESULT = 0x80284015; +pub const TBS_E_PROVISIONING_INCOMPLETE: HRESULT = 0x80284016; +pub const TPMAPI_E_INVALID_STATE: HRESULT = 0x80290100; +pub const TPMAPI_E_NOT_ENOUGH_DATA: HRESULT = 0x80290101; +pub const TPMAPI_E_TOO_MUCH_DATA: HRESULT = 0x80290102; +pub const TPMAPI_E_INVALID_OUTPUT_POINTER: HRESULT = 0x80290103; +pub const TPMAPI_E_INVALID_PARAMETER: HRESULT = 0x80290104; +pub const TPMAPI_E_OUT_OF_MEMORY: HRESULT = 0x80290105; +pub const TPMAPI_E_BUFFER_TOO_SMALL: HRESULT = 0x80290106; +pub const TPMAPI_E_INTERNAL_ERROR: HRESULT = 0x80290107; +pub const TPMAPI_E_ACCESS_DENIED: HRESULT = 0x80290108; +pub const TPMAPI_E_AUTHORIZATION_FAILED: HRESULT = 0x80290109; +pub const TPMAPI_E_INVALID_CONTEXT_HANDLE: HRESULT = 0x8029010A; +pub const TPMAPI_E_TBS_COMMUNICATION_ERROR: HRESULT = 0x8029010B; +pub const TPMAPI_E_TPM_COMMAND_ERROR: HRESULT = 0x8029010C; +pub const TPMAPI_E_MESSAGE_TOO_LARGE: HRESULT = 0x8029010D; +pub const TPMAPI_E_INVALID_ENCODING: HRESULT = 0x8029010E; +pub const TPMAPI_E_INVALID_KEY_SIZE: HRESULT = 0x8029010F; +pub const TPMAPI_E_ENCRYPTION_FAILED: HRESULT = 0x80290110; +pub const TPMAPI_E_INVALID_KEY_PARAMS: HRESULT = 0x80290111; +pub const TPMAPI_E_INVALID_MIGRATION_AUTHORIZATION_BLOB: HRESULT = 0x80290112; +pub const TPMAPI_E_INVALID_PCR_INDEX: HRESULT = 0x80290113; +pub const TPMAPI_E_INVALID_DELEGATE_BLOB: HRESULT = 0x80290114; +pub const TPMAPI_E_INVALID_CONTEXT_PARAMS: HRESULT = 0x80290115; +pub const TPMAPI_E_INVALID_KEY_BLOB: HRESULT = 0x80290116; +pub const TPMAPI_E_INVALID_PCR_DATA: HRESULT = 0x80290117; +pub const TPMAPI_E_INVALID_OWNER_AUTH: HRESULT = 0x80290118; +pub const TPMAPI_E_FIPS_RNG_CHECK_FAILED: HRESULT = 0x80290119; +pub const TPMAPI_E_EMPTY_TCG_LOG: HRESULT = 0x8029011A; +pub const TPMAPI_E_INVALID_TCG_LOG_ENTRY: HRESULT = 0x8029011B; +pub const TPMAPI_E_TCG_SEPARATOR_ABSENT: HRESULT = 0x8029011C; +pub const TPMAPI_E_TCG_INVALID_DIGEST_ENTRY: HRESULT = 0x8029011D; +pub const TPMAPI_E_POLICY_DENIES_OPERATION: HRESULT = 0x8029011E; +pub const TBSIMP_E_BUFFER_TOO_SMALL: HRESULT = 0x80290200; +pub const TBSIMP_E_CLEANUP_FAILED: HRESULT = 0x80290201; +pub const TBSIMP_E_INVALID_CONTEXT_HANDLE: HRESULT = 0x80290202; +pub const TBSIMP_E_INVALID_CONTEXT_PARAM: HRESULT = 0x80290203; +pub const TBSIMP_E_TPM_ERROR: HRESULT = 0x80290204; +pub const TBSIMP_E_HASH_BAD_KEY: HRESULT = 0x80290205; +pub const TBSIMP_E_DUPLICATE_VHANDLE: HRESULT = 0x80290206; +pub const TBSIMP_E_INVALID_OUTPUT_POINTER: HRESULT = 0x80290207; +pub const TBSIMP_E_INVALID_PARAMETER: HRESULT = 0x80290208; +pub const TBSIMP_E_RPC_INIT_FAILED: HRESULT = 0x80290209; +pub const TBSIMP_E_SCHEDULER_NOT_RUNNING: HRESULT = 0x8029020A; +pub const TBSIMP_E_COMMAND_CANCELED: HRESULT = 0x8029020B; +pub const TBSIMP_E_OUT_OF_MEMORY: HRESULT = 0x8029020C; +pub const TBSIMP_E_LIST_NO_MORE_ITEMS: HRESULT = 0x8029020D; +pub const TBSIMP_E_LIST_NOT_FOUND: HRESULT = 0x8029020E; +pub const TBSIMP_E_NOT_ENOUGH_SPACE: HRESULT = 0x8029020F; +pub const TBSIMP_E_NOT_ENOUGH_TPM_CONTEXTS: HRESULT = 0x80290210; +pub const TBSIMP_E_COMMAND_FAILED: HRESULT = 0x80290211; +pub const TBSIMP_E_UNKNOWN_ORDINAL: HRESULT = 0x80290212; +pub const TBSIMP_E_RESOURCE_EXPIRED: HRESULT = 0x80290213; +pub const TBSIMP_E_INVALID_RESOURCE: HRESULT = 0x80290214; +pub const TBSIMP_E_NOTHING_TO_UNLOAD: HRESULT = 0x80290215; +pub const TBSIMP_E_HASH_TABLE_FULL: HRESULT = 0x80290216; +pub const TBSIMP_E_TOO_MANY_TBS_CONTEXTS: HRESULT = 0x80290217; +pub const TBSIMP_E_TOO_MANY_RESOURCES: HRESULT = 0x80290218; +pub const TBSIMP_E_PPI_NOT_SUPPORTED: HRESULT = 0x80290219; +pub const TBSIMP_E_TPM_INCOMPATIBLE: HRESULT = 0x8029021A; +pub const TBSIMP_E_NO_EVENT_LOG: HRESULT = 0x8029021B; +pub const TPM_E_PPI_ACPI_FAILURE: HRESULT = 0x80290300; +pub const TPM_E_PPI_USER_ABORT: HRESULT = 0x80290301; +pub const TPM_E_PPI_BIOS_FAILURE: HRESULT = 0x80290302; +pub const TPM_E_PPI_NOT_SUPPORTED: HRESULT = 0x80290303; +pub const TPM_E_PPI_BLOCKED_IN_BIOS: HRESULT = 0x80290304; +pub const TPM_E_PCP_ERROR_MASK: HRESULT = 0x80290400; +pub const TPM_E_PCP_DEVICE_NOT_READY: HRESULT = 0x80290401; +pub const TPM_E_PCP_INVALID_HANDLE: HRESULT = 0x80290402; +pub const TPM_E_PCP_INVALID_PARAMETER: HRESULT = 0x80290403; +pub const TPM_E_PCP_FLAG_NOT_SUPPORTED: HRESULT = 0x80290404; +pub const TPM_E_PCP_NOT_SUPPORTED: HRESULT = 0x80290405; +pub const TPM_E_PCP_BUFFER_TOO_SMALL: HRESULT = 0x80290406; +pub const TPM_E_PCP_INTERNAL_ERROR: HRESULT = 0x80290407; +pub const TPM_E_PCP_AUTHENTICATION_FAILED: HRESULT = 0x80290408; +pub const TPM_E_PCP_AUTHENTICATION_IGNORED: HRESULT = 0x80290409; +pub const TPM_E_PCP_POLICY_NOT_FOUND: HRESULT = 0x8029040A; +pub const TPM_E_PCP_PROFILE_NOT_FOUND: HRESULT = 0x8029040B; +pub const TPM_E_PCP_VALIDATION_FAILED: HRESULT = 0x8029040C; +pub const PLA_E_DCS_NOT_FOUND: HRESULT = 0x80300002; +pub const PLA_E_DCS_IN_USE: HRESULT = 0x803000AA; +pub const PLA_E_TOO_MANY_FOLDERS: HRESULT = 0x80300045; +pub const PLA_E_NO_MIN_DISK: HRESULT = 0x80300070; +pub const PLA_E_DCS_ALREADY_EXISTS: HRESULT = 0x803000B7; +pub const PLA_S_PROPERTY_IGNORED: HRESULT = 0x00300100; +pub const PLA_E_PROPERTY_CONFLICT: HRESULT = 0x80300101; +pub const PLA_E_DCS_SINGLETON_REQUIRED: HRESULT = 0x80300102; +pub const PLA_E_CREDENTIALS_REQUIRED: HRESULT = 0x80300103; +pub const PLA_E_DCS_NOT_RUNNING: HRESULT = 0x80300104; +pub const PLA_E_CONFLICT_INCL_EXCL_API: HRESULT = 0x80300105; +pub const PLA_E_NETWORK_EXE_NOT_VALID: HRESULT = 0x80300106; +pub const PLA_E_EXE_ALREADY_CONFIGURED: HRESULT = 0x80300107; +pub const PLA_E_EXE_PATH_NOT_VALID: HRESULT = 0x80300108; +pub const PLA_E_DC_ALREADY_EXISTS: HRESULT = 0x80300109; +pub const PLA_E_DCS_START_WAIT_TIMEOUT: HRESULT = 0x8030010A; +pub const PLA_E_DC_START_WAIT_TIMEOUT: HRESULT = 0x8030010B; +pub const PLA_E_REPORT_WAIT_TIMEOUT: HRESULT = 0x8030010C; +pub const PLA_E_NO_DUPLICATES: HRESULT = 0x8030010D; +pub const PLA_E_EXE_FULL_PATH_REQUIRED: HRESULT = 0x8030010E; +pub const PLA_E_INVALID_SESSION_NAME: HRESULT = 0x8030010F; +pub const PLA_E_PLA_CHANNEL_NOT_ENABLED: HRESULT = 0x80300110; +pub const PLA_E_TASKSCHED_CHANNEL_NOT_ENABLED: HRESULT = 0x80300111; +pub const PLA_E_RULES_MANAGER_FAILED: HRESULT = 0x80300112; +pub const PLA_E_CABAPI_FAILURE: HRESULT = 0x80300113; +pub const FVE_E_LOCKED_VOLUME: HRESULT = 0x80310000; +pub const FVE_E_NOT_ENCRYPTED: HRESULT = 0x80310001; +pub const FVE_E_NO_TPM_BIOS: HRESULT = 0x80310002; +pub const FVE_E_NO_MBR_METRIC: HRESULT = 0x80310003; +pub const FVE_E_NO_BOOTSECTOR_METRIC: HRESULT = 0x80310004; +pub const FVE_E_NO_BOOTMGR_METRIC: HRESULT = 0x80310005; +pub const FVE_E_WRONG_BOOTMGR: HRESULT = 0x80310006; +pub const FVE_E_SECURE_KEY_REQUIRED: HRESULT = 0x80310007; +pub const FVE_E_NOT_ACTIVATED: HRESULT = 0x80310008; +pub const FVE_E_ACTION_NOT_ALLOWED: HRESULT = 0x80310009; +pub const FVE_E_AD_SCHEMA_NOT_INSTALLED: HRESULT = 0x8031000A; +pub const FVE_E_AD_INVALID_DATATYPE: HRESULT = 0x8031000B; +pub const FVE_E_AD_INVALID_DATASIZE: HRESULT = 0x8031000C; +pub const FVE_E_AD_NO_VALUES: HRESULT = 0x8031000D; +pub const FVE_E_AD_ATTR_NOT_SET: HRESULT = 0x8031000E; +pub const FVE_E_AD_GUID_NOT_FOUND: HRESULT = 0x8031000F; +pub const FVE_E_BAD_INFORMATION: HRESULT = 0x80310010; +pub const FVE_E_TOO_SMALL: HRESULT = 0x80310011; +pub const FVE_E_SYSTEM_VOLUME: HRESULT = 0x80310012; +pub const FVE_E_FAILED_WRONG_FS: HRESULT = 0x80310013; +pub const FVE_E_BAD_PARTITION_SIZE: HRESULT = 0x80310014; +pub const FVE_E_NOT_SUPPORTED: HRESULT = 0x80310015; +pub const FVE_E_BAD_DATA: HRESULT = 0x80310016; +pub const FVE_E_VOLUME_NOT_BOUND: HRESULT = 0x80310017; +pub const FVE_E_TPM_NOT_OWNED: HRESULT = 0x80310018; +pub const FVE_E_NOT_DATA_VOLUME: HRESULT = 0x80310019; +pub const FVE_E_AD_INSUFFICIENT_BUFFER: HRESULT = 0x8031001A; +pub const FVE_E_CONV_READ: HRESULT = 0x8031001B; +pub const FVE_E_CONV_WRITE: HRESULT = 0x8031001C; +pub const FVE_E_KEY_REQUIRED: HRESULT = 0x8031001D; +pub const FVE_E_CLUSTERING_NOT_SUPPORTED: HRESULT = 0x8031001E; +pub const FVE_E_VOLUME_BOUND_ALREADY: HRESULT = 0x8031001F; +pub const FVE_E_OS_NOT_PROTECTED: HRESULT = 0x80310020; +pub const FVE_E_PROTECTION_DISABLED: HRESULT = 0x80310021; +pub const FVE_E_RECOVERY_KEY_REQUIRED: HRESULT = 0x80310022; +pub const FVE_E_FOREIGN_VOLUME: HRESULT = 0x80310023; +pub const FVE_E_OVERLAPPED_UPDATE: HRESULT = 0x80310024; +pub const FVE_E_TPM_SRK_AUTH_NOT_ZERO: HRESULT = 0x80310025; +pub const FVE_E_FAILED_SECTOR_SIZE: HRESULT = 0x80310026; +pub const FVE_E_FAILED_AUTHENTICATION: HRESULT = 0x80310027; +pub const FVE_E_NOT_OS_VOLUME: HRESULT = 0x80310028; +pub const FVE_E_AUTOUNLOCK_ENABLED: HRESULT = 0x80310029; +pub const FVE_E_WRONG_BOOTSECTOR: HRESULT = 0x8031002A; +pub const FVE_E_WRONG_SYSTEM_FS: HRESULT = 0x8031002B; +pub const FVE_E_POLICY_PASSWORD_REQUIRED: HRESULT = 0x8031002C; +pub const FVE_E_CANNOT_SET_FVEK_ENCRYPTED: HRESULT = 0x8031002D; +pub const FVE_E_CANNOT_ENCRYPT_NO_KEY: HRESULT = 0x8031002E; +pub const FVE_E_BOOTABLE_CDDVD: HRESULT = 0x80310030; +pub const FVE_E_PROTECTOR_EXISTS: HRESULT = 0x80310031; +pub const FVE_E_RELATIVE_PATH: HRESULT = 0x80310032; +pub const FVE_E_PROTECTOR_NOT_FOUND: HRESULT = 0x80310033; +pub const FVE_E_INVALID_KEY_FORMAT: HRESULT = 0x80310034; +pub const FVE_E_INVALID_PASSWORD_FORMAT: HRESULT = 0x80310035; +pub const FVE_E_FIPS_RNG_CHECK_FAILED: HRESULT = 0x80310036; +pub const FVE_E_FIPS_PREVENTS_RECOVERY_PASSWORD: HRESULT = 0x80310037; +pub const FVE_E_FIPS_PREVENTS_EXTERNAL_KEY_EXPORT: HRESULT = 0x80310038; +pub const FVE_E_NOT_DECRYPTED: HRESULT = 0x80310039; +pub const FVE_E_INVALID_PROTECTOR_TYPE: HRESULT = 0x8031003A; +pub const FVE_E_NO_PROTECTORS_TO_TEST: HRESULT = 0x8031003B; +pub const FVE_E_KEYFILE_NOT_FOUND: HRESULT = 0x8031003C; +pub const FVE_E_KEYFILE_INVALID: HRESULT = 0x8031003D; +pub const FVE_E_KEYFILE_NO_VMK: HRESULT = 0x8031003E; +pub const FVE_E_TPM_DISABLED: HRESULT = 0x8031003F; +pub const FVE_E_NOT_ALLOWED_IN_SAFE_MODE: HRESULT = 0x80310040; +pub const FVE_E_TPM_INVALID_PCR: HRESULT = 0x80310041; +pub const FVE_E_TPM_NO_VMK: HRESULT = 0x80310042; +pub const FVE_E_PIN_INVALID: HRESULT = 0x80310043; +pub const FVE_E_AUTH_INVALID_APPLICATION: HRESULT = 0x80310044; +pub const FVE_E_AUTH_INVALID_CONFIG: HRESULT = 0x80310045; +pub const FVE_E_FIPS_DISABLE_PROTECTION_NOT_ALLOWED: HRESULT = 0x80310046; +pub const FVE_E_FS_NOT_EXTENDED: HRESULT = 0x80310047; +pub const FVE_E_FIRMWARE_TYPE_NOT_SUPPORTED: HRESULT = 0x80310048; +pub const FVE_E_NO_LICENSE: HRESULT = 0x80310049; +pub const FVE_E_NOT_ON_STACK: HRESULT = 0x8031004A; +pub const FVE_E_FS_MOUNTED: HRESULT = 0x8031004B; +pub const FVE_E_TOKEN_NOT_IMPERSONATED: HRESULT = 0x8031004C; +pub const FVE_E_DRY_RUN_FAILED: HRESULT = 0x8031004D; +pub const FVE_E_REBOOT_REQUIRED: HRESULT = 0x8031004E; +pub const FVE_E_DEBUGGER_ENABLED: HRESULT = 0x8031004F; +pub const FVE_E_RAW_ACCESS: HRESULT = 0x80310050; +pub const FVE_E_RAW_BLOCKED: HRESULT = 0x80310051; +pub const FVE_E_BCD_APPLICATIONS_PATH_INCORRECT: HRESULT = 0x80310052; +pub const FVE_E_NOT_ALLOWED_IN_VERSION: HRESULT = 0x80310053; +pub const FVE_E_NO_AUTOUNLOCK_MASTER_KEY: HRESULT = 0x80310054; +pub const FVE_E_MOR_FAILED: HRESULT = 0x80310055; +pub const FVE_E_HIDDEN_VOLUME: HRESULT = 0x80310056; +pub const FVE_E_TRANSIENT_STATE: HRESULT = 0x80310057; +pub const FVE_E_PUBKEY_NOT_ALLOWED: HRESULT = 0x80310058; +pub const FVE_E_VOLUME_HANDLE_OPEN: HRESULT = 0x80310059; +pub const FVE_E_NO_FEATURE_LICENSE: HRESULT = 0x8031005A; +pub const FVE_E_INVALID_STARTUP_OPTIONS: HRESULT = 0x8031005B; +pub const FVE_E_POLICY_RECOVERY_PASSWORD_NOT_ALLOWED: HRESULT = 0x8031005C; +pub const FVE_E_POLICY_RECOVERY_PASSWORD_REQUIRED: HRESULT = 0x8031005D; +pub const FVE_E_POLICY_RECOVERY_KEY_NOT_ALLOWED: HRESULT = 0x8031005E; +pub const FVE_E_POLICY_RECOVERY_KEY_REQUIRED: HRESULT = 0x8031005F; +pub const FVE_E_POLICY_STARTUP_PIN_NOT_ALLOWED: HRESULT = 0x80310060; +pub const FVE_E_POLICY_STARTUP_PIN_REQUIRED: HRESULT = 0x80310061; +pub const FVE_E_POLICY_STARTUP_KEY_NOT_ALLOWED: HRESULT = 0x80310062; +pub const FVE_E_POLICY_STARTUP_KEY_REQUIRED: HRESULT = 0x80310063; +pub const FVE_E_POLICY_STARTUP_PIN_KEY_NOT_ALLOWED: HRESULT = 0x80310064; +pub const FVE_E_POLICY_STARTUP_PIN_KEY_REQUIRED: HRESULT = 0x80310065; +pub const FVE_E_POLICY_STARTUP_TPM_NOT_ALLOWED: HRESULT = 0x80310066; +pub const FVE_E_POLICY_STARTUP_TPM_REQUIRED: HRESULT = 0x80310067; +pub const FVE_E_POLICY_INVALID_PIN_LENGTH: HRESULT = 0x80310068; +pub const FVE_E_KEY_PROTECTOR_NOT_SUPPORTED: HRESULT = 0x80310069; +pub const FVE_E_POLICY_PASSPHRASE_NOT_ALLOWED: HRESULT = 0x8031006A; +pub const FVE_E_POLICY_PASSPHRASE_REQUIRED: HRESULT = 0x8031006B; +pub const FVE_E_FIPS_PREVENTS_PASSPHRASE: HRESULT = 0x8031006C; +pub const FVE_E_OS_VOLUME_PASSPHRASE_NOT_ALLOWED: HRESULT = 0x8031006D; +pub const FVE_E_INVALID_BITLOCKER_OID: HRESULT = 0x8031006E; +pub const FVE_E_VOLUME_TOO_SMALL: HRESULT = 0x8031006F; +pub const FVE_E_DV_NOT_SUPPORTED_ON_FS: HRESULT = 0x80310070; +pub const FVE_E_DV_NOT_ALLOWED_BY_GP: HRESULT = 0x80310071; +pub const FVE_E_POLICY_USER_CERTIFICATE_NOT_ALLOWED: HRESULT = 0x80310072; +pub const FVE_E_POLICY_USER_CERTIFICATE_REQUIRED: HRESULT = 0x80310073; +pub const FVE_E_POLICY_USER_CERT_MUST_BE_HW: HRESULT = 0x80310074; +pub const FVE_E_POLICY_USER_CONFIGURE_FDV_AUTOUNLOCK_NOT_ALLOWED: HRESULT + = 0x80310075; +pub const FVE_E_POLICY_USER_CONFIGURE_RDV_AUTOUNLOCK_NOT_ALLOWED: HRESULT + = 0x80310076; +pub const FVE_E_POLICY_USER_CONFIGURE_RDV_NOT_ALLOWED: HRESULT = 0x80310077; +pub const FVE_E_POLICY_USER_ENABLE_RDV_NOT_ALLOWED: HRESULT = 0x80310078; +pub const FVE_E_POLICY_USER_DISABLE_RDV_NOT_ALLOWED: HRESULT = 0x80310079; +pub const FVE_E_POLICY_INVALID_PASSPHRASE_LENGTH: HRESULT = 0x80310080; +pub const FVE_E_POLICY_PASSPHRASE_TOO_SIMPLE: HRESULT = 0x80310081; +pub const FVE_E_RECOVERY_PARTITION: HRESULT = 0x80310082; +pub const FVE_E_POLICY_CONFLICT_FDV_RK_OFF_AUK_ON: HRESULT = 0x80310083; +pub const FVE_E_POLICY_CONFLICT_RDV_RK_OFF_AUK_ON: HRESULT = 0x80310084; +pub const FVE_E_NON_BITLOCKER_OID: HRESULT = 0x80310085; +pub const FVE_E_POLICY_PROHIBITS_SELFSIGNED: HRESULT = 0x80310086; +pub const FVE_E_POLICY_CONFLICT_RO_AND_STARTUP_KEY_REQUIRED: HRESULT = 0x80310087; +pub const FVE_E_CONV_RECOVERY_FAILED: HRESULT = 0x80310088; +pub const FVE_E_VIRTUALIZED_SPACE_TOO_BIG: HRESULT = 0x80310089; +pub const FVE_E_POLICY_CONFLICT_OSV_RP_OFF_ADB_ON: HRESULT = 0x80310090; +pub const FVE_E_POLICY_CONFLICT_FDV_RP_OFF_ADB_ON: HRESULT = 0x80310091; +pub const FVE_E_POLICY_CONFLICT_RDV_RP_OFF_ADB_ON: HRESULT = 0x80310092; +pub const FVE_E_NON_BITLOCKER_KU: HRESULT = 0x80310093; +pub const FVE_E_PRIVATEKEY_AUTH_FAILED: HRESULT = 0x80310094; +pub const FVE_E_REMOVAL_OF_DRA_FAILED: HRESULT = 0x80310095; +pub const FVE_E_OPERATION_NOT_SUPPORTED_ON_VISTA_VOLUME: HRESULT = 0x80310096; +pub const FVE_E_CANT_LOCK_AUTOUNLOCK_ENABLED_VOLUME: HRESULT = 0x80310097; +pub const FVE_E_FIPS_HASH_KDF_NOT_ALLOWED: HRESULT = 0x80310098; +pub const FVE_E_ENH_PIN_INVALID: HRESULT = 0x80310099; +pub const FVE_E_INVALID_PIN_CHARS: HRESULT = 0x8031009A; +pub const FVE_E_INVALID_DATUM_TYPE: HRESULT = 0x8031009B; +pub const FVE_E_EFI_ONLY: HRESULT = 0x8031009C; +pub const FVE_E_MULTIPLE_NKP_CERTS: HRESULT = 0x8031009D; +pub const FVE_E_REMOVAL_OF_NKP_FAILED: HRESULT = 0x8031009E; +pub const FVE_E_INVALID_NKP_CERT: HRESULT = 0x8031009F; +pub const FVE_E_NO_EXISTING_PIN: HRESULT = 0x803100A0; +pub const FVE_E_PROTECTOR_CHANGE_PIN_MISMATCH: HRESULT = 0x803100A1; +pub const FVE_E_PIN_PROTECTOR_CHANGE_BY_STD_USER_DISALLOWED: HRESULT = 0x803100A2; +pub const FVE_E_PROTECTOR_CHANGE_MAX_PIN_CHANGE_ATTEMPTS_REACHED: HRESULT + = 0x803100A3; +pub const FVE_E_POLICY_PASSPHRASE_REQUIRES_ASCII: HRESULT = 0x803100A4; +pub const FVE_E_FULL_ENCRYPTION_NOT_ALLOWED_ON_TP_STORAGE: HRESULT = 0x803100A5; +pub const FVE_E_WIPE_NOT_ALLOWED_ON_TP_STORAGE: HRESULT = 0x803100A6; +pub const FVE_E_KEY_LENGTH_NOT_SUPPORTED_BY_EDRIVE: HRESULT = 0x803100A7; +pub const FVE_E_NO_EXISTING_PASSPHRASE: HRESULT = 0x803100A8; +pub const FVE_E_PROTECTOR_CHANGE_PASSPHRASE_MISMATCH: HRESULT = 0x803100A9; +pub const FVE_E_PASSPHRASE_TOO_LONG: HRESULT = 0x803100AA; +pub const FVE_E_NO_PASSPHRASE_WITH_TPM: HRESULT = 0x803100AB; +pub const FVE_E_NO_TPM_WITH_PASSPHRASE: HRESULT = 0x803100AC; +pub const FVE_E_NOT_ALLOWED_ON_CSV_STACK: HRESULT = 0x803100AD; +pub const FVE_E_NOT_ALLOWED_ON_CLUSTER: HRESULT = 0x803100AE; +pub const FVE_E_EDRIVE_NO_FAILOVER_TO_SW: HRESULT = 0x803100AF; +pub const FVE_E_EDRIVE_BAND_IN_USE: HRESULT = 0x803100B0; +pub const FVE_E_EDRIVE_DISALLOWED_BY_GP: HRESULT = 0x803100B1; +pub const FVE_E_EDRIVE_INCOMPATIBLE_VOLUME: HRESULT = 0x803100B2; +pub const FVE_E_NOT_ALLOWED_TO_UPGRADE_WHILE_CONVERTING: HRESULT = 0x803100B3; +pub const FVE_E_EDRIVE_DV_NOT_SUPPORTED: HRESULT = 0x803100B4; +pub const FVE_E_NO_PREBOOT_KEYBOARD_DETECTED: HRESULT = 0x803100B5; +pub const FVE_E_NO_PREBOOT_KEYBOARD_OR_WINRE_DETECTED: HRESULT = 0x803100B6; +pub const FVE_E_POLICY_REQUIRES_STARTUP_PIN_ON_TOUCH_DEVICE: HRESULT = 0x803100B7; +pub const FVE_E_POLICY_REQUIRES_RECOVERY_PASSWORD_ON_TOUCH_DEVICE: HRESULT + = 0x803100B8; +pub const FVE_E_WIPE_CANCEL_NOT_APPLICABLE: HRESULT = 0x803100B9; +pub const FVE_E_SECUREBOOT_DISABLED: HRESULT = 0x803100BA; +pub const FVE_E_SECUREBOOT_CONFIGURATION_INVALID: HRESULT = 0x803100BB; +pub const FVE_E_EDRIVE_DRY_RUN_FAILED: HRESULT = 0x803100BC; +pub const FVE_E_SHADOW_COPY_PRESENT: HRESULT = 0x803100BD; +pub const FVE_E_POLICY_INVALID_ENHANCED_BCD_SETTINGS: HRESULT = 0x803100BE; +pub const FVE_E_EDRIVE_INCOMPATIBLE_FIRMWARE: HRESULT = 0x803100BF; +pub const FVE_E_PROTECTOR_CHANGE_MAX_PASSPHRASE_CHANGE_ATTEMPTS_REACHED: HRESULT + = 0x803100C0; +pub const FVE_E_PASSPHRASE_PROTECTOR_CHANGE_BY_STD_USER_DISALLOWED: HRESULT + = 0x803100C1; +pub const FVE_E_LIVEID_ACCOUNT_SUSPENDED: HRESULT = 0x803100C2; +pub const FVE_E_LIVEID_ACCOUNT_BLOCKED: HRESULT = 0x803100C3; +pub const FVE_E_NOT_PROVISIONED_ON_ALL_VOLUMES: HRESULT = 0x803100C4; +pub const FVE_E_DE_FIXED_DATA_NOT_SUPPORTED: HRESULT = 0x803100C5; +pub const FVE_E_DE_HARDWARE_NOT_COMPLIANT: HRESULT = 0x803100C6; +pub const FVE_E_DE_WINRE_NOT_CONFIGURED: HRESULT = 0x803100C7; +pub const FVE_E_DE_PROTECTION_SUSPENDED: HRESULT = 0x803100C8; +pub const FVE_E_DE_OS_VOLUME_NOT_PROTECTED: HRESULT = 0x803100C9; +pub const FVE_E_DE_DEVICE_LOCKEDOUT: HRESULT = 0x803100CA; +pub const FVE_E_DE_PROTECTION_NOT_YET_ENABLED: HRESULT = 0x803100CB; +pub const FVE_E_INVALID_PIN_CHARS_DETAILED: HRESULT = 0x803100CC; +pub const FVE_E_DEVICE_LOCKOUT_COUNTER_UNAVAILABLE: HRESULT = 0x803100CD; +pub const FVE_E_DEVICELOCKOUT_COUNTER_MISMATCH: HRESULT = 0x803100CE; +pub const FVE_E_BUFFER_TOO_LARGE: HRESULT = 0x803100CF; +pub const FVE_E_NO_SUCH_CAPABILITY_ON_TARGET: HRESULT = 0x803100D0; +pub const FVE_E_DE_PREVENTED_FOR_OS: HRESULT = 0x803100D1; +pub const FVE_E_DE_VOLUME_OPTED_OUT: HRESULT = 0x803100D2; +pub const FVE_E_DE_VOLUME_NOT_SUPPORTED: HRESULT = 0x803100D3; +pub const FVE_E_EOW_NOT_SUPPORTED_IN_VERSION: HRESULT = 0x803100D4; +pub const FVE_E_ADBACKUP_NOT_ENABLED: HRESULT = 0x803100D5; +pub const FVE_E_VOLUME_EXTEND_PREVENTS_EOW_DECRYPT: HRESULT = 0x803100D6; +pub const FVE_E_NOT_DE_VOLUME: HRESULT = 0x803100D7; +pub const FVE_E_PROTECTION_CANNOT_BE_DISABLED: HRESULT = 0x803100D8; +pub const FWP_E_CALLOUT_NOT_FOUND: HRESULT = 0x80320001; +pub const FWP_E_CONDITION_NOT_FOUND: HRESULT = 0x80320002; +pub const FWP_E_FILTER_NOT_FOUND: HRESULT = 0x80320003; +pub const FWP_E_LAYER_NOT_FOUND: HRESULT = 0x80320004; +pub const FWP_E_PROVIDER_NOT_FOUND: HRESULT = 0x80320005; +pub const FWP_E_PROVIDER_CONTEXT_NOT_FOUND: HRESULT = 0x80320006; +pub const FWP_E_SUBLAYER_NOT_FOUND: HRESULT = 0x80320007; +pub const FWP_E_NOT_FOUND: HRESULT = 0x80320008; +pub const FWP_E_ALREADY_EXISTS: HRESULT = 0x80320009; +pub const FWP_E_IN_USE: HRESULT = 0x8032000A; +pub const FWP_E_DYNAMIC_SESSION_IN_PROGRESS: HRESULT = 0x8032000B; +pub const FWP_E_WRONG_SESSION: HRESULT = 0x8032000C; +pub const FWP_E_NO_TXN_IN_PROGRESS: HRESULT = 0x8032000D; +pub const FWP_E_TXN_IN_PROGRESS: HRESULT = 0x8032000E; +pub const FWP_E_TXN_ABORTED: HRESULT = 0x8032000F; +pub const FWP_E_SESSION_ABORTED: HRESULT = 0x80320010; +pub const FWP_E_INCOMPATIBLE_TXN: HRESULT = 0x80320011; +pub const FWP_E_TIMEOUT: HRESULT = 0x80320012; +pub const FWP_E_NET_EVENTS_DISABLED: HRESULT = 0x80320013; +pub const FWP_E_INCOMPATIBLE_LAYER: HRESULT = 0x80320014; +pub const FWP_E_KM_CLIENTS_ONLY: HRESULT = 0x80320015; +pub const FWP_E_LIFETIME_MISMATCH: HRESULT = 0x80320016; +pub const FWP_E_BUILTIN_OBJECT: HRESULT = 0x80320017; +pub const FWP_E_TOO_MANY_CALLOUTS: HRESULT = 0x80320018; +pub const FWP_E_NOTIFICATION_DROPPED: HRESULT = 0x80320019; +pub const FWP_E_TRAFFIC_MISMATCH: HRESULT = 0x8032001A; +pub const FWP_E_INCOMPATIBLE_SA_STATE: HRESULT = 0x8032001B; +pub const FWP_E_NULL_POINTER: HRESULT = 0x8032001C; +pub const FWP_E_INVALID_ENUMERATOR: HRESULT = 0x8032001D; +pub const FWP_E_INVALID_FLAGS: HRESULT = 0x8032001E; +pub const FWP_E_INVALID_NET_MASK: HRESULT = 0x8032001F; +pub const FWP_E_INVALID_RANGE: HRESULT = 0x80320020; +pub const FWP_E_INVALID_INTERVAL: HRESULT = 0x80320021; +pub const FWP_E_ZERO_LENGTH_ARRAY: HRESULT = 0x80320022; +pub const FWP_E_NULL_DISPLAY_NAME: HRESULT = 0x80320023; +pub const FWP_E_INVALID_ACTION_TYPE: HRESULT = 0x80320024; +pub const FWP_E_INVALID_WEIGHT: HRESULT = 0x80320025; +pub const FWP_E_MATCH_TYPE_MISMATCH: HRESULT = 0x80320026; +pub const FWP_E_TYPE_MISMATCH: HRESULT = 0x80320027; +pub const FWP_E_OUT_OF_BOUNDS: HRESULT = 0x80320028; +pub const FWP_E_RESERVED: HRESULT = 0x80320029; +pub const FWP_E_DUPLICATE_CONDITION: HRESULT = 0x8032002A; +pub const FWP_E_DUPLICATE_KEYMOD: HRESULT = 0x8032002B; +pub const FWP_E_ACTION_INCOMPATIBLE_WITH_LAYER: HRESULT = 0x8032002C; +pub const FWP_E_ACTION_INCOMPATIBLE_WITH_SUBLAYER: HRESULT = 0x8032002D; +pub const FWP_E_CONTEXT_INCOMPATIBLE_WITH_LAYER: HRESULT = 0x8032002E; +pub const FWP_E_CONTEXT_INCOMPATIBLE_WITH_CALLOUT: HRESULT = 0x8032002F; +pub const FWP_E_INCOMPATIBLE_AUTH_METHOD: HRESULT = 0x80320030; +pub const FWP_E_INCOMPATIBLE_DH_GROUP: HRESULT = 0x80320031; +pub const FWP_E_EM_NOT_SUPPORTED: HRESULT = 0x80320032; +pub const FWP_E_NEVER_MATCH: HRESULT = 0x80320033; +pub const FWP_E_PROVIDER_CONTEXT_MISMATCH: HRESULT = 0x80320034; +pub const FWP_E_INVALID_PARAMETER: HRESULT = 0x80320035; +pub const FWP_E_TOO_MANY_SUBLAYERS: HRESULT = 0x80320036; +pub const FWP_E_CALLOUT_NOTIFICATION_FAILED: HRESULT = 0x80320037; +pub const FWP_E_INVALID_AUTH_TRANSFORM: HRESULT = 0x80320038; +pub const FWP_E_INVALID_CIPHER_TRANSFORM: HRESULT = 0x80320039; +pub const FWP_E_INCOMPATIBLE_CIPHER_TRANSFORM: HRESULT = 0x8032003A; +pub const FWP_E_INVALID_TRANSFORM_COMBINATION: HRESULT = 0x8032003B; +pub const FWP_E_DUPLICATE_AUTH_METHOD: HRESULT = 0x8032003C; +pub const FWP_E_INVALID_TUNNEL_ENDPOINT: HRESULT = 0x8032003D; +pub const FWP_E_L2_DRIVER_NOT_READY: HRESULT = 0x8032003E; +pub const FWP_E_KEY_DICTATOR_ALREADY_REGISTERED: HRESULT = 0x8032003F; +pub const FWP_E_KEY_DICTATION_INVALID_KEYING_MATERIAL: HRESULT = 0x80320040; +pub const FWP_E_CONNECTIONS_DISABLED: HRESULT = 0x80320041; +pub const FWP_E_INVALID_DNS_NAME: HRESULT = 0x80320042; +pub const FWP_E_STILL_ON: HRESULT = 0x80320043; +pub const FWP_E_IKEEXT_NOT_RUNNING: HRESULT = 0x80320044; +pub const FWP_E_DROP_NOICMP: HRESULT = 0x80320104; +pub const WS_S_ASYNC: HRESULT = 0x003D0000; +pub const WS_S_END: HRESULT = 0x003D0001; +pub const WS_E_INVALID_FORMAT: HRESULT = 0x803D0000; +pub const WS_E_OBJECT_FAULTED: HRESULT = 0x803D0001; +pub const WS_E_NUMERIC_OVERFLOW: HRESULT = 0x803D0002; +pub const WS_E_INVALID_OPERATION: HRESULT = 0x803D0003; +pub const WS_E_OPERATION_ABORTED: HRESULT = 0x803D0004; +pub const WS_E_ENDPOINT_ACCESS_DENIED: HRESULT = 0x803D0005; +pub const WS_E_OPERATION_TIMED_OUT: HRESULT = 0x803D0006; +pub const WS_E_OPERATION_ABANDONED: HRESULT = 0x803D0007; +pub const WS_E_QUOTA_EXCEEDED: HRESULT = 0x803D0008; +pub const WS_E_NO_TRANSLATION_AVAILABLE: HRESULT = 0x803D0009; +pub const WS_E_SECURITY_VERIFICATION_FAILURE: HRESULT = 0x803D000A; +pub const WS_E_ADDRESS_IN_USE: HRESULT = 0x803D000B; +pub const WS_E_ADDRESS_NOT_AVAILABLE: HRESULT = 0x803D000C; +pub const WS_E_ENDPOINT_NOT_FOUND: HRESULT = 0x803D000D; +pub const WS_E_ENDPOINT_NOT_AVAILABLE: HRESULT = 0x803D000E; +pub const WS_E_ENDPOINT_FAILURE: HRESULT = 0x803D000F; +pub const WS_E_ENDPOINT_UNREACHABLE: HRESULT = 0x803D0010; +pub const WS_E_ENDPOINT_ACTION_NOT_SUPPORTED: HRESULT = 0x803D0011; +pub const WS_E_ENDPOINT_TOO_BUSY: HRESULT = 0x803D0012; +pub const WS_E_ENDPOINT_FAULT_RECEIVED: HRESULT = 0x803D0013; +pub const WS_E_ENDPOINT_DISCONNECTED: HRESULT = 0x803D0014; +pub const WS_E_PROXY_FAILURE: HRESULT = 0x803D0015; +pub const WS_E_PROXY_ACCESS_DENIED: HRESULT = 0x803D0016; +pub const WS_E_NOT_SUPPORTED: HRESULT = 0x803D0017; +pub const WS_E_PROXY_REQUIRES_BASIC_AUTH: HRESULT = 0x803D0018; +pub const WS_E_PROXY_REQUIRES_DIGEST_AUTH: HRESULT = 0x803D0019; +pub const WS_E_PROXY_REQUIRES_NTLM_AUTH: HRESULT = 0x803D001A; +pub const WS_E_PROXY_REQUIRES_NEGOTIATE_AUTH: HRESULT = 0x803D001B; +pub const WS_E_SERVER_REQUIRES_BASIC_AUTH: HRESULT = 0x803D001C; +pub const WS_E_SERVER_REQUIRES_DIGEST_AUTH: HRESULT = 0x803D001D; +pub const WS_E_SERVER_REQUIRES_NTLM_AUTH: HRESULT = 0x803D001E; +pub const WS_E_SERVER_REQUIRES_NEGOTIATE_AUTH: HRESULT = 0x803D001F; +pub const WS_E_INVALID_ENDPOINT_URL: HRESULT = 0x803D0020; +pub const WS_E_OTHER: HRESULT = 0x803D0021; +pub const WS_E_SECURITY_TOKEN_EXPIRED: HRESULT = 0x803D0022; +pub const WS_E_SECURITY_SYSTEM_FAILURE: HRESULT = 0x803D0023; +pub const ERROR_NDIS_INTERFACE_CLOSING: HRESULT = 0x80340002; +pub const ERROR_NDIS_BAD_VERSION: HRESULT = 0x80340004; +pub const ERROR_NDIS_BAD_CHARACTERISTICS: HRESULT = 0x80340005; +pub const ERROR_NDIS_ADAPTER_NOT_FOUND: HRESULT = 0x80340006; +pub const ERROR_NDIS_OPEN_FAILED: HRESULT = 0x80340007; +pub const ERROR_NDIS_DEVICE_FAILED: HRESULT = 0x80340008; +pub const ERROR_NDIS_MULTICAST_FULL: HRESULT = 0x80340009; +pub const ERROR_NDIS_MULTICAST_EXISTS: HRESULT = 0x8034000A; +pub const ERROR_NDIS_MULTICAST_NOT_FOUND: HRESULT = 0x8034000B; +pub const ERROR_NDIS_REQUEST_ABORTED: HRESULT = 0x8034000C; +pub const ERROR_NDIS_RESET_IN_PROGRESS: HRESULT = 0x8034000D; +pub const ERROR_NDIS_NOT_SUPPORTED: HRESULT = 0x803400BB; +pub const ERROR_NDIS_INVALID_PACKET: HRESULT = 0x8034000F; +pub const ERROR_NDIS_ADAPTER_NOT_READY: HRESULT = 0x80340011; +pub const ERROR_NDIS_INVALID_LENGTH: HRESULT = 0x80340014; +pub const ERROR_NDIS_INVALID_DATA: HRESULT = 0x80340015; +pub const ERROR_NDIS_BUFFER_TOO_SHORT: HRESULT = 0x80340016; +pub const ERROR_NDIS_INVALID_OID: HRESULT = 0x80340017; +pub const ERROR_NDIS_ADAPTER_REMOVED: HRESULT = 0x80340018; +pub const ERROR_NDIS_UNSUPPORTED_MEDIA: HRESULT = 0x80340019; +pub const ERROR_NDIS_GROUP_ADDRESS_IN_USE: HRESULT = 0x8034001A; +pub const ERROR_NDIS_FILE_NOT_FOUND: HRESULT = 0x8034001B; +pub const ERROR_NDIS_ERROR_READING_FILE: HRESULT = 0x8034001C; +pub const ERROR_NDIS_ALREADY_MAPPED: HRESULT = 0x8034001D; +pub const ERROR_NDIS_RESOURCE_CONFLICT: HRESULT = 0x8034001E; +pub const ERROR_NDIS_MEDIA_DISCONNECTED: HRESULT = 0x8034001F; +pub const ERROR_NDIS_INVALID_ADDRESS: HRESULT = 0x80340022; +pub const ERROR_NDIS_INVALID_DEVICE_REQUEST: HRESULT = 0x80340010; +pub const ERROR_NDIS_PAUSED: HRESULT = 0x8034002A; +pub const ERROR_NDIS_INTERFACE_NOT_FOUND: HRESULT = 0x8034002B; +pub const ERROR_NDIS_UNSUPPORTED_REVISION: HRESULT = 0x8034002C; +pub const ERROR_NDIS_INVALID_PORT: HRESULT = 0x8034002D; +pub const ERROR_NDIS_INVALID_PORT_STATE: HRESULT = 0x8034002E; +pub const ERROR_NDIS_LOW_POWER_STATE: HRESULT = 0x8034002F; +pub const ERROR_NDIS_REINIT_REQUIRED: HRESULT = 0x80340030; +pub const ERROR_NDIS_DOT11_AUTO_CONFIG_ENABLED: HRESULT = 0x80342000; +pub const ERROR_NDIS_DOT11_MEDIA_IN_USE: HRESULT = 0x80342001; +pub const ERROR_NDIS_DOT11_POWER_STATE_INVALID: HRESULT = 0x80342002; +pub const ERROR_NDIS_PM_WOL_PATTERN_LIST_FULL: HRESULT = 0x80342003; +pub const ERROR_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL: HRESULT = 0x80342004; +pub const ERROR_NDIS_INDICATION_REQUIRED: HRESULT = 0x00340001; +pub const ERROR_NDIS_OFFLOAD_POLICY: HRESULT = 0xC034100F; +pub const ERROR_NDIS_OFFLOAD_CONNECTION_REJECTED: HRESULT = 0xC0341012; +pub const ERROR_NDIS_OFFLOAD_PATH_REJECTED: HRESULT = 0xC0341013; +pub const ERROR_HV_INVALID_HYPERCALL_CODE: HRESULT = 0xC0350002; +pub const ERROR_HV_INVALID_HYPERCALL_INPUT: HRESULT = 0xC0350003; +pub const ERROR_HV_INVALID_ALIGNMENT: HRESULT = 0xC0350004; +pub const ERROR_HV_INVALID_PARAMETER: HRESULT = 0xC0350005; +pub const ERROR_HV_ACCESS_DENIED: HRESULT = 0xC0350006; +pub const ERROR_HV_INVALID_PARTITION_STATE: HRESULT = 0xC0350007; +pub const ERROR_HV_OPERATION_DENIED: HRESULT = 0xC0350008; +pub const ERROR_HV_UNKNOWN_PROPERTY: HRESULT = 0xC0350009; +pub const ERROR_HV_PROPERTY_VALUE_OUT_OF_RANGE: HRESULT = 0xC035000A; +pub const ERROR_HV_INSUFFICIENT_MEMORY: HRESULT = 0xC035000B; +pub const ERROR_HV_PARTITION_TOO_DEEP: HRESULT = 0xC035000C; +pub const ERROR_HV_INVALID_PARTITION_ID: HRESULT = 0xC035000D; +pub const ERROR_HV_INVALID_VP_INDEX: HRESULT = 0xC035000E; +pub const ERROR_HV_INVALID_PORT_ID: HRESULT = 0xC0350011; +pub const ERROR_HV_INVALID_CONNECTION_ID: HRESULT = 0xC0350012; +pub const ERROR_HV_INSUFFICIENT_BUFFERS: HRESULT = 0xC0350013; +pub const ERROR_HV_NOT_ACKNOWLEDGED: HRESULT = 0xC0350014; +pub const ERROR_HV_ACKNOWLEDGED: HRESULT = 0xC0350016; +pub const ERROR_HV_INVALID_SAVE_RESTORE_STATE: HRESULT = 0xC0350017; +pub const ERROR_HV_INVALID_SYNIC_STATE: HRESULT = 0xC0350018; +pub const ERROR_HV_OBJECT_IN_USE: HRESULT = 0xC0350019; +pub const ERROR_HV_INVALID_PROXIMITY_DOMAIN_INFO: HRESULT = 0xC035001A; +pub const ERROR_HV_NO_DATA: HRESULT = 0xC035001B; +pub const ERROR_HV_INACTIVE: HRESULT = 0xC035001C; +pub const ERROR_HV_NO_RESOURCES: HRESULT = 0xC035001D; +pub const ERROR_HV_FEATURE_UNAVAILABLE: HRESULT = 0xC035001E; +pub const ERROR_HV_INSUFFICIENT_BUFFER: HRESULT = 0xC0350033; +pub const ERROR_HV_INSUFFICIENT_DEVICE_DOMAINS: HRESULT = 0xC0350038; +pub const ERROR_HV_INVALID_LP_INDEX: HRESULT = 0xC0350041; +pub const ERROR_HV_NOT_PRESENT: HRESULT = 0xC0351000; +pub const ERROR_VID_DUPLICATE_HANDLER: HRESULT = 0xC0370001; +pub const ERROR_VID_TOO_MANY_HANDLERS: HRESULT = 0xC0370002; +pub const ERROR_VID_QUEUE_FULL: HRESULT = 0xC0370003; +pub const ERROR_VID_HANDLER_NOT_PRESENT: HRESULT = 0xC0370004; +pub const ERROR_VID_INVALID_OBJECT_NAME: HRESULT = 0xC0370005; +pub const ERROR_VID_PARTITION_NAME_TOO_LONG: HRESULT = 0xC0370006; +pub const ERROR_VID_MESSAGE_QUEUE_NAME_TOO_LONG: HRESULT = 0xC0370007; +pub const ERROR_VID_PARTITION_ALREADY_EXISTS: HRESULT = 0xC0370008; +pub const ERROR_VID_PARTITION_DOES_NOT_EXIST: HRESULT = 0xC0370009; +pub const ERROR_VID_PARTITION_NAME_NOT_FOUND: HRESULT = 0xC037000A; +pub const ERROR_VID_MESSAGE_QUEUE_ALREADY_EXISTS: HRESULT = 0xC037000B; +pub const ERROR_VID_EXCEEDED_MBP_ENTRY_MAP_LIMIT: HRESULT = 0xC037000C; +pub const ERROR_VID_MB_STILL_REFERENCED: HRESULT = 0xC037000D; +pub const ERROR_VID_CHILD_GPA_PAGE_SET_CORRUPTED: HRESULT = 0xC037000E; +pub const ERROR_VID_INVALID_NUMA_SETTINGS: HRESULT = 0xC037000F; +pub const ERROR_VID_INVALID_NUMA_NODE_INDEX: HRESULT = 0xC0370010; +pub const ERROR_VID_NOTIFICATION_QUEUE_ALREADY_ASSOCIATED: HRESULT = 0xC0370011; +pub const ERROR_VID_INVALID_MEMORY_BLOCK_HANDLE: HRESULT = 0xC0370012; +pub const ERROR_VID_PAGE_RANGE_OVERFLOW: HRESULT = 0xC0370013; +pub const ERROR_VID_INVALID_MESSAGE_QUEUE_HANDLE: HRESULT = 0xC0370014; +pub const ERROR_VID_INVALID_GPA_RANGE_HANDLE: HRESULT = 0xC0370015; +pub const ERROR_VID_NO_MEMORY_BLOCK_NOTIFICATION_QUEUE: HRESULT = 0xC0370016; +pub const ERROR_VID_MEMORY_BLOCK_LOCK_COUNT_EXCEEDED: HRESULT = 0xC0370017; +pub const ERROR_VID_INVALID_PPM_HANDLE: HRESULT = 0xC0370018; +pub const ERROR_VID_MBPS_ARE_LOCKED: HRESULT = 0xC0370019; +pub const ERROR_VID_MESSAGE_QUEUE_CLOSED: HRESULT = 0xC037001A; +pub const ERROR_VID_VIRTUAL_PROCESSOR_LIMIT_EXCEEDED: HRESULT = 0xC037001B; +pub const ERROR_VID_STOP_PENDING: HRESULT = 0xC037001C; +pub const ERROR_VID_INVALID_PROCESSOR_STATE: HRESULT = 0xC037001D; +pub const ERROR_VID_EXCEEDED_KM_CONTEXT_COUNT_LIMIT: HRESULT = 0xC037001E; +pub const ERROR_VID_KM_INTERFACE_ALREADY_INITIALIZED: HRESULT = 0xC037001F; +pub const ERROR_VID_MB_PROPERTY_ALREADY_SET_RESET: HRESULT = 0xC0370020; +pub const ERROR_VID_MMIO_RANGE_DESTROYED: HRESULT = 0xC0370021; +pub const ERROR_VID_INVALID_CHILD_GPA_PAGE_SET: HRESULT = 0xC0370022; +pub const ERROR_VID_RESERVE_PAGE_SET_IS_BEING_USED: HRESULT = 0xC0370023; +pub const ERROR_VID_RESERVE_PAGE_SET_TOO_SMALL: HRESULT = 0xC0370024; +pub const ERROR_VID_MBP_ALREADY_LOCKED_USING_RESERVED_PAGE: HRESULT = 0xC0370025; +pub const ERROR_VID_MBP_COUNT_EXCEEDED_LIMIT: HRESULT = 0xC0370026; +pub const ERROR_VID_SAVED_STATE_CORRUPT: HRESULT = 0xC0370027; +pub const ERROR_VID_SAVED_STATE_UNRECOGNIZED_ITEM: HRESULT = 0xC0370028; +pub const ERROR_VID_SAVED_STATE_INCOMPATIBLE: HRESULT = 0xC0370029; +pub const ERROR_VID_REMOTE_NODE_PARENT_GPA_PAGES_USED: HRESULT = 0x80370001; +pub const ERROR_VOLMGR_INCOMPLETE_REGENERATION: HRESULT = 0x80380001; +pub const ERROR_VOLMGR_INCOMPLETE_DISK_MIGRATION: HRESULT = 0x80380002; +pub const ERROR_VOLMGR_DATABASE_FULL: HRESULT = 0xC0380001; +pub const ERROR_VOLMGR_DISK_CONFIGURATION_CORRUPTED: HRESULT = 0xC0380002; +pub const ERROR_VOLMGR_DISK_CONFIGURATION_NOT_IN_SYNC: HRESULT = 0xC0380003; +pub const ERROR_VOLMGR_PACK_CONFIG_UPDATE_FAILED: HRESULT = 0xC0380004; +pub const ERROR_VOLMGR_DISK_CONTAINS_NON_SIMPLE_VOLUME: HRESULT = 0xC0380005; +pub const ERROR_VOLMGR_DISK_DUPLICATE: HRESULT = 0xC0380006; +pub const ERROR_VOLMGR_DISK_DYNAMIC: HRESULT = 0xC0380007; +pub const ERROR_VOLMGR_DISK_ID_INVALID: HRESULT = 0xC0380008; +pub const ERROR_VOLMGR_DISK_INVALID: HRESULT = 0xC0380009; +pub const ERROR_VOLMGR_DISK_LAST_VOTER: HRESULT = 0xC038000A; +pub const ERROR_VOLMGR_DISK_LAYOUT_INVALID: HRESULT = 0xC038000B; +pub const ERROR_VOLMGR_DISK_LAYOUT_NON_BASIC_BETWEEN_BASIC_PARTITIONS: HRESULT + = 0xC038000C; +pub const ERROR_VOLMGR_DISK_LAYOUT_NOT_CYLINDER_ALIGNED: HRESULT = 0xC038000D; +pub const ERROR_VOLMGR_DISK_LAYOUT_PARTITIONS_TOO_SMALL: HRESULT = 0xC038000E; +pub const ERROR_VOLMGR_DISK_LAYOUT_PRIMARY_BETWEEN_LOGICAL_PARTITIONS: HRESULT + = 0xC038000F; +pub const ERROR_VOLMGR_DISK_LAYOUT_TOO_MANY_PARTITIONS: HRESULT = 0xC0380010; +pub const ERROR_VOLMGR_DISK_MISSING: HRESULT = 0xC0380011; +pub const ERROR_VOLMGR_DISK_NOT_EMPTY: HRESULT = 0xC0380012; +pub const ERROR_VOLMGR_DISK_NOT_ENOUGH_SPACE: HRESULT = 0xC0380013; +pub const ERROR_VOLMGR_DISK_REVECTORING_FAILED: HRESULT = 0xC0380014; +pub const ERROR_VOLMGR_DISK_SECTOR_SIZE_INVALID: HRESULT = 0xC0380015; +pub const ERROR_VOLMGR_DISK_SET_NOT_CONTAINED: HRESULT = 0xC0380016; +pub const ERROR_VOLMGR_DISK_USED_BY_MULTIPLE_MEMBERS: HRESULT = 0xC0380017; +pub const ERROR_VOLMGR_DISK_USED_BY_MULTIPLE_PLEXES: HRESULT = 0xC0380018; +pub const ERROR_VOLMGR_DYNAMIC_DISK_NOT_SUPPORTED: HRESULT = 0xC0380019; +pub const ERROR_VOLMGR_EXTENT_ALREADY_USED: HRESULT = 0xC038001A; +pub const ERROR_VOLMGR_EXTENT_NOT_CONTIGUOUS: HRESULT = 0xC038001B; +pub const ERROR_VOLMGR_EXTENT_NOT_IN_PUBLIC_REGION: HRESULT = 0xC038001C; +pub const ERROR_VOLMGR_EXTENT_NOT_SECTOR_ALIGNED: HRESULT = 0xC038001D; +pub const ERROR_VOLMGR_EXTENT_OVERLAPS_EBR_PARTITION: HRESULT = 0xC038001E; +pub const ERROR_VOLMGR_EXTENT_VOLUME_LENGTHS_DO_NOT_MATCH: HRESULT = 0xC038001F; +pub const ERROR_VOLMGR_FAULT_TOLERANT_NOT_SUPPORTED: HRESULT = 0xC0380020; +pub const ERROR_VOLMGR_INTERLEAVE_LENGTH_INVALID: HRESULT = 0xC0380021; +pub const ERROR_VOLMGR_MAXIMUM_REGISTERED_USERS: HRESULT = 0xC0380022; +pub const ERROR_VOLMGR_MEMBER_IN_SYNC: HRESULT = 0xC0380023; +pub const ERROR_VOLMGR_MEMBER_INDEX_DUPLICATE: HRESULT = 0xC0380024; +pub const ERROR_VOLMGR_MEMBER_INDEX_INVALID: HRESULT = 0xC0380025; +pub const ERROR_VOLMGR_MEMBER_MISSING: HRESULT = 0xC0380026; +pub const ERROR_VOLMGR_MEMBER_NOT_DETACHED: HRESULT = 0xC0380027; +pub const ERROR_VOLMGR_MEMBER_REGENERATING: HRESULT = 0xC0380028; +pub const ERROR_VOLMGR_ALL_DISKS_FAILED: HRESULT = 0xC0380029; +pub const ERROR_VOLMGR_NO_REGISTERED_USERS: HRESULT = 0xC038002A; +pub const ERROR_VOLMGR_NO_SUCH_USER: HRESULT = 0xC038002B; +pub const ERROR_VOLMGR_NOTIFICATION_RESET: HRESULT = 0xC038002C; +pub const ERROR_VOLMGR_NUMBER_OF_MEMBERS_INVALID: HRESULT = 0xC038002D; +pub const ERROR_VOLMGR_NUMBER_OF_PLEXES_INVALID: HRESULT = 0xC038002E; +pub const ERROR_VOLMGR_PACK_DUPLICATE: HRESULT = 0xC038002F; +pub const ERROR_VOLMGR_PACK_ID_INVALID: HRESULT = 0xC0380030; +pub const ERROR_VOLMGR_PACK_INVALID: HRESULT = 0xC0380031; +pub const ERROR_VOLMGR_PACK_NAME_INVALID: HRESULT = 0xC0380032; +pub const ERROR_VOLMGR_PACK_OFFLINE: HRESULT = 0xC0380033; +pub const ERROR_VOLMGR_PACK_HAS_QUORUM: HRESULT = 0xC0380034; +pub const ERROR_VOLMGR_PACK_WITHOUT_QUORUM: HRESULT = 0xC0380035; +pub const ERROR_VOLMGR_PARTITION_STYLE_INVALID: HRESULT = 0xC0380036; +pub const ERROR_VOLMGR_PARTITION_UPDATE_FAILED: HRESULT = 0xC0380037; +pub const ERROR_VOLMGR_PLEX_IN_SYNC: HRESULT = 0xC0380038; +pub const ERROR_VOLMGR_PLEX_INDEX_DUPLICATE: HRESULT = 0xC0380039; +pub const ERROR_VOLMGR_PLEX_INDEX_INVALID: HRESULT = 0xC038003A; +pub const ERROR_VOLMGR_PLEX_LAST_ACTIVE: HRESULT = 0xC038003B; +pub const ERROR_VOLMGR_PLEX_MISSING: HRESULT = 0xC038003C; +pub const ERROR_VOLMGR_PLEX_REGENERATING: HRESULT = 0xC038003D; +pub const ERROR_VOLMGR_PLEX_TYPE_INVALID: HRESULT = 0xC038003E; +pub const ERROR_VOLMGR_PLEX_NOT_RAID5: HRESULT = 0xC038003F; +pub const ERROR_VOLMGR_PLEX_NOT_SIMPLE: HRESULT = 0xC0380040; +pub const ERROR_VOLMGR_STRUCTURE_SIZE_INVALID: HRESULT = 0xC0380041; +pub const ERROR_VOLMGR_TOO_MANY_NOTIFICATION_REQUESTS: HRESULT = 0xC0380042; +pub const ERROR_VOLMGR_TRANSACTION_IN_PROGRESS: HRESULT = 0xC0380043; +pub const ERROR_VOLMGR_UNEXPECTED_DISK_LAYOUT_CHANGE: HRESULT = 0xC0380044; +pub const ERROR_VOLMGR_VOLUME_CONTAINS_MISSING_DISK: HRESULT = 0xC0380045; +pub const ERROR_VOLMGR_VOLUME_ID_INVALID: HRESULT = 0xC0380046; +pub const ERROR_VOLMGR_VOLUME_LENGTH_INVALID: HRESULT = 0xC0380047; +pub const ERROR_VOLMGR_VOLUME_LENGTH_NOT_SECTOR_SIZE_MULTIPLE: HRESULT = 0xC0380048; +pub const ERROR_VOLMGR_VOLUME_NOT_MIRRORED: HRESULT = 0xC0380049; +pub const ERROR_VOLMGR_VOLUME_NOT_RETAINED: HRESULT = 0xC038004A; +pub const ERROR_VOLMGR_VOLUME_OFFLINE: HRESULT = 0xC038004B; +pub const ERROR_VOLMGR_VOLUME_RETAINED: HRESULT = 0xC038004C; +pub const ERROR_VOLMGR_NUMBER_OF_EXTENTS_INVALID: HRESULT = 0xC038004D; +pub const ERROR_VOLMGR_DIFFERENT_SECTOR_SIZE: HRESULT = 0xC038004E; +pub const ERROR_VOLMGR_BAD_BOOT_DISK: HRESULT = 0xC038004F; +pub const ERROR_VOLMGR_PACK_CONFIG_OFFLINE: HRESULT = 0xC0380050; +pub const ERROR_VOLMGR_PACK_CONFIG_ONLINE: HRESULT = 0xC0380051; +pub const ERROR_VOLMGR_NOT_PRIMARY_PACK: HRESULT = 0xC0380052; +pub const ERROR_VOLMGR_PACK_LOG_UPDATE_FAILED: HRESULT = 0xC0380053; +pub const ERROR_VOLMGR_NUMBER_OF_DISKS_IN_PLEX_INVALID: HRESULT = 0xC0380054; +pub const ERROR_VOLMGR_NUMBER_OF_DISKS_IN_MEMBER_INVALID: HRESULT = 0xC0380055; +pub const ERROR_VOLMGR_VOLUME_MIRRORED: HRESULT = 0xC0380056; +pub const ERROR_VOLMGR_PLEX_NOT_SIMPLE_SPANNED: HRESULT = 0xC0380057; +pub const ERROR_VOLMGR_NO_VALID_LOG_COPIES: HRESULT = 0xC0380058; +pub const ERROR_VOLMGR_PRIMARY_PACK_PRESENT: HRESULT = 0xC0380059; +pub const ERROR_VOLMGR_NUMBER_OF_DISKS_INVALID: HRESULT = 0xC038005A; +pub const ERROR_VOLMGR_MIRROR_NOT_SUPPORTED: HRESULT = 0xC038005B; +pub const ERROR_VOLMGR_RAID5_NOT_SUPPORTED: HRESULT = 0xC038005C; +pub const ERROR_BCD_NOT_ALL_ENTRIES_IMPORTED: HRESULT = 0x80390001; +pub const ERROR_BCD_TOO_MANY_ELEMENTS: HRESULT = 0xC0390002; +pub const ERROR_BCD_NOT_ALL_ENTRIES_SYNCHRONIZED: HRESULT = 0x80390003; +pub const ERROR_VHD_DRIVE_FOOTER_MISSING: HRESULT = 0xC03A0001; +pub const ERROR_VHD_DRIVE_FOOTER_CHECKSUM_MISMATCH: HRESULT = 0xC03A0002; +pub const ERROR_VHD_DRIVE_FOOTER_CORRUPT: HRESULT = 0xC03A0003; +pub const ERROR_VHD_FORMAT_UNKNOWN: HRESULT = 0xC03A0004; +pub const ERROR_VHD_FORMAT_UNSUPPORTED_VERSION: HRESULT = 0xC03A0005; +pub const ERROR_VHD_SPARSE_HEADER_CHECKSUM_MISMATCH: HRESULT = 0xC03A0006; +pub const ERROR_VHD_SPARSE_HEADER_UNSUPPORTED_VERSION: HRESULT = 0xC03A0007; +pub const ERROR_VHD_SPARSE_HEADER_CORRUPT: HRESULT = 0xC03A0008; +pub const ERROR_VHD_BLOCK_ALLOCATION_FAILURE: HRESULT = 0xC03A0009; +pub const ERROR_VHD_BLOCK_ALLOCATION_TABLE_CORRUPT: HRESULT = 0xC03A000A; +pub const ERROR_VHD_INVALID_BLOCK_SIZE: HRESULT = 0xC03A000B; +pub const ERROR_VHD_BITMAP_MISMATCH: HRESULT = 0xC03A000C; +pub const ERROR_VHD_PARENT_VHD_NOT_FOUND: HRESULT = 0xC03A000D; +pub const ERROR_VHD_CHILD_PARENT_ID_MISMATCH: HRESULT = 0xC03A000E; +pub const ERROR_VHD_CHILD_PARENT_TIMESTAMP_MISMATCH: HRESULT = 0xC03A000F; +pub const ERROR_VHD_METADATA_READ_FAILURE: HRESULT = 0xC03A0010; +pub const ERROR_VHD_METADATA_WRITE_FAILURE: HRESULT = 0xC03A0011; +pub const ERROR_VHD_INVALID_SIZE: HRESULT = 0xC03A0012; +pub const ERROR_VHD_INVALID_FILE_SIZE: HRESULT = 0xC03A0013; +pub const ERROR_VIRTDISK_PROVIDER_NOT_FOUND: HRESULT = 0xC03A0014; +pub const ERROR_VIRTDISK_NOT_VIRTUAL_DISK: HRESULT = 0xC03A0015; +pub const ERROR_VHD_PARENT_VHD_ACCESS_DENIED: HRESULT = 0xC03A0016; +pub const ERROR_VHD_CHILD_PARENT_SIZE_MISMATCH: HRESULT = 0xC03A0017; +pub const ERROR_VHD_DIFFERENCING_CHAIN_CYCLE_DETECTED: HRESULT = 0xC03A0018; +pub const ERROR_VHD_DIFFERENCING_CHAIN_ERROR_IN_PARENT: HRESULT = 0xC03A0019; +pub const ERROR_VIRTUAL_DISK_LIMITATION: HRESULT = 0xC03A001A; +pub const ERROR_VHD_INVALID_TYPE: HRESULT = 0xC03A001B; +pub const ERROR_VHD_INVALID_STATE: HRESULT = 0xC03A001C; +pub const ERROR_VIRTDISK_UNSUPPORTED_DISK_SECTOR_SIZE: HRESULT = 0xC03A001D; +pub const ERROR_VIRTDISK_DISK_ALREADY_OWNED: HRESULT = 0xC03A001E; +pub const ERROR_VIRTDISK_DISK_ONLINE_AND_WRITABLE: HRESULT = 0xC03A001F; +pub const ERROR_CTLOG_TRACKING_NOT_INITIALIZED: HRESULT = 0xC03A0020; +pub const ERROR_CTLOG_LOGFILE_SIZE_EXCEEDED_MAXSIZE: HRESULT = 0xC03A0021; +pub const ERROR_CTLOG_VHD_CHANGED_OFFLINE: HRESULT = 0xC03A0022; +pub const ERROR_CTLOG_INVALID_TRACKING_STATE: HRESULT = 0xC03A0023; +pub const ERROR_CTLOG_INCONSISTENT_TRACKING_FILE: HRESULT = 0xC03A0024; +pub const ERROR_VHD_RESIZE_WOULD_TRUNCATE_DATA: HRESULT = 0xC03A0025; +pub const ERROR_VHD_COULD_NOT_COMPUTE_MINIMUM_VIRTUAL_SIZE: HRESULT = 0xC03A0026; +pub const ERROR_VHD_ALREADY_AT_OR_BELOW_MINIMUM_VIRTUAL_SIZE: HRESULT = 0xC03A0027; +pub const ERROR_VHD_METADATA_FULL: HRESULT = 0xC03A0028; +pub const ERROR_QUERY_STORAGE_ERROR: HRESULT = 0x803A0001; +pub const SDIAG_E_CANCELLED: HRESULT = 0x803C0100; +pub const SDIAG_E_SCRIPT: HRESULT = 0x803C0101; +pub const SDIAG_E_POWERSHELL: HRESULT = 0x803C0102; +pub const SDIAG_E_MANAGEDHOST: HRESULT = 0x803C0103; +pub const SDIAG_E_NOVERIFIER: HRESULT = 0x803C0104; +pub const SDIAG_S_CANNOTRUN: HRESULT = 0x003C0105; +pub const SDIAG_E_DISABLED: HRESULT = 0x803C0106; +pub const SDIAG_E_TRUST: HRESULT = 0x803C0107; +pub const SDIAG_E_CANNOTRUN: HRESULT = 0x803C0108; +pub const SDIAG_E_VERSION: HRESULT = 0x803C0109; +pub const SDIAG_E_RESOURCE: HRESULT = 0x803C010A; +pub const SDIAG_E_ROOTCAUSE: HRESULT = 0x803C010B; +pub const WPN_E_CHANNEL_CLOSED: HRESULT = 0x803E0100; +pub const WPN_E_CHANNEL_REQUEST_NOT_COMPLETE: HRESULT = 0x803E0101; +pub const WPN_E_INVALID_APP: HRESULT = 0x803E0102; +pub const WPN_E_OUTSTANDING_CHANNEL_REQUEST: HRESULT = 0x803E0103; +pub const WPN_E_DUPLICATE_CHANNEL: HRESULT = 0x803E0104; +pub const WPN_E_PLATFORM_UNAVAILABLE: HRESULT = 0x803E0105; +pub const WPN_E_NOTIFICATION_POSTED: HRESULT = 0x803E0106; +pub const WPN_E_NOTIFICATION_HIDDEN: HRESULT = 0x803E0107; +pub const WPN_E_NOTIFICATION_NOT_POSTED: HRESULT = 0x803E0108; +pub const WPN_E_CLOUD_DISABLED: HRESULT = 0x803E0109; +pub const WPN_E_CLOUD_INCAPABLE: HRESULT = 0x803E0110; +pub const WPN_E_CLOUD_AUTH_UNAVAILABLE: HRESULT = 0x803E011A; +pub const WPN_E_CLOUD_SERVICE_UNAVAILABLE: HRESULT = 0x803E011B; +pub const WPN_E_FAILED_LOCK_SCREEN_UPDATE_INTIALIZATION: HRESULT = 0x803E011C; +pub const WPN_E_NOTIFICATION_DISABLED: HRESULT = 0x803E0111; +pub const WPN_E_NOTIFICATION_INCAPABLE: HRESULT = 0x803E0112; +pub const WPN_E_INTERNET_INCAPABLE: HRESULT = 0x803E0113; +pub const WPN_E_NOTIFICATION_TYPE_DISABLED: HRESULT = 0x803E0114; +pub const WPN_E_NOTIFICATION_SIZE: HRESULT = 0x803E0115; +pub const WPN_E_TAG_SIZE: HRESULT = 0x803E0116; +pub const WPN_E_ACCESS_DENIED: HRESULT = 0x803E0117; +pub const WPN_E_DUPLICATE_REGISTRATION: HRESULT = 0x803E0118; +pub const WPN_E_PUSH_NOTIFICATION_INCAPABLE: HRESULT = 0x803E0119; +pub const WPN_E_DEV_ID_SIZE: HRESULT = 0x803E0120; +pub const WPN_E_TAG_ALPHANUMERIC: HRESULT = 0x803E012A; +pub const WPN_E_INVALID_HTTP_STATUS_CODE: HRESULT = 0x803E012B; +pub const WPN_E_OUT_OF_SESSION: HRESULT = 0x803E0200; +pub const WPN_E_POWER_SAVE: HRESULT = 0x803E0201; +pub const WPN_E_IMAGE_NOT_FOUND_IN_CACHE: HRESULT = 0x803E0202; +pub const WPN_E_ALL_URL_NOT_COMPLETED: HRESULT = 0x803E0203; +pub const WPN_E_INVALID_CLOUD_IMAGE: HRESULT = 0x803E0204; +pub const WPN_E_NOTIFICATION_ID_MATCHED: HRESULT = 0x803E0205; +pub const WPN_E_CALLBACK_ALREADY_REGISTERED: HRESULT = 0x803E0206; +pub const WPN_E_TOAST_NOTIFICATION_DROPPED: HRESULT = 0x803E0207; +pub const WPN_E_STORAGE_LOCKED: HRESULT = 0x803E0208; +pub const E_MBN_CONTEXT_NOT_ACTIVATED: HRESULT = 0x80548201; +pub const E_MBN_BAD_SIM: HRESULT = 0x80548202; +pub const E_MBN_DATA_CLASS_NOT_AVAILABLE: HRESULT = 0x80548203; +pub const E_MBN_INVALID_ACCESS_STRING: HRESULT = 0x80548204; +pub const E_MBN_MAX_ACTIVATED_CONTEXTS: HRESULT = 0x80548205; +pub const E_MBN_PACKET_SVC_DETACHED: HRESULT = 0x80548206; +pub const E_MBN_PROVIDER_NOT_VISIBLE: HRESULT = 0x80548207; +pub const E_MBN_RADIO_POWER_OFF: HRESULT = 0x80548208; +pub const E_MBN_SERVICE_NOT_ACTIVATED: HRESULT = 0x80548209; +pub const E_MBN_SIM_NOT_INSERTED: HRESULT = 0x8054820A; +pub const E_MBN_VOICE_CALL_IN_PROGRESS: HRESULT = 0x8054820B; +pub const E_MBN_INVALID_CACHE: HRESULT = 0x8054820C; +pub const E_MBN_NOT_REGISTERED: HRESULT = 0x8054820D; +pub const E_MBN_PROVIDERS_NOT_FOUND: HRESULT = 0x8054820E; +pub const E_MBN_PIN_NOT_SUPPORTED: HRESULT = 0x8054820F; +pub const E_MBN_PIN_REQUIRED: HRESULT = 0x80548210; +pub const E_MBN_PIN_DISABLED: HRESULT = 0x80548211; +pub const E_MBN_FAILURE: HRESULT = 0x80548212; +pub const E_MBN_INVALID_PROFILE: HRESULT = 0x80548218; +pub const E_MBN_DEFAULT_PROFILE_EXIST: HRESULT = 0x80548219; +pub const E_MBN_SMS_ENCODING_NOT_SUPPORTED: HRESULT = 0x80548220; +pub const E_MBN_SMS_FILTER_NOT_SUPPORTED: HRESULT = 0x80548221; +pub const E_MBN_SMS_INVALID_MEMORY_INDEX: HRESULT = 0x80548222; +pub const E_MBN_SMS_LANG_NOT_SUPPORTED: HRESULT = 0x80548223; +pub const E_MBN_SMS_MEMORY_FAILURE: HRESULT = 0x80548224; +pub const E_MBN_SMS_NETWORK_TIMEOUT: HRESULT = 0x80548225; +pub const E_MBN_SMS_UNKNOWN_SMSC_ADDRESS: HRESULT = 0x80548226; +pub const E_MBN_SMS_FORMAT_NOT_SUPPORTED: HRESULT = 0x80548227; +pub const E_MBN_SMS_OPERATION_NOT_ALLOWED: HRESULT = 0x80548228; +pub const E_MBN_SMS_MEMORY_FULL: HRESULT = 0x80548229; +pub const PEER_E_IPV6_NOT_INSTALLED: HRESULT = 0x80630001; +pub const PEER_E_NOT_INITIALIZED: HRESULT = 0x80630002; +pub const PEER_E_CANNOT_START_SERVICE: HRESULT = 0x80630003; +pub const PEER_E_NOT_LICENSED: HRESULT = 0x80630004; +pub const PEER_E_INVALID_GRAPH: HRESULT = 0x80630010; +pub const PEER_E_DBNAME_CHANGED: HRESULT = 0x80630011; +pub const PEER_E_DUPLICATE_GRAPH: HRESULT = 0x80630012; +pub const PEER_E_GRAPH_NOT_READY: HRESULT = 0x80630013; +pub const PEER_E_GRAPH_SHUTTING_DOWN: HRESULT = 0x80630014; +pub const PEER_E_GRAPH_IN_USE: HRESULT = 0x80630015; +pub const PEER_E_INVALID_DATABASE: HRESULT = 0x80630016; +pub const PEER_E_TOO_MANY_ATTRIBUTES: HRESULT = 0x80630017; +pub const PEER_E_CONNECTION_NOT_FOUND: HRESULT = 0x80630103; +pub const PEER_E_CONNECT_SELF: HRESULT = 0x80630106; +pub const PEER_E_ALREADY_LISTENING: HRESULT = 0x80630107; +pub const PEER_E_NODE_NOT_FOUND: HRESULT = 0x80630108; +pub const PEER_E_CONNECTION_FAILED: HRESULT = 0x80630109; +pub const PEER_E_CONNECTION_NOT_AUTHENTICATED: HRESULT = 0x8063010A; +pub const PEER_E_CONNECTION_REFUSED: HRESULT = 0x8063010B; +pub const PEER_E_CLASSIFIER_TOO_LONG: HRESULT = 0x80630201; +pub const PEER_E_TOO_MANY_IDENTITIES: HRESULT = 0x80630202; +pub const PEER_E_NO_KEY_ACCESS: HRESULT = 0x80630203; +pub const PEER_E_GROUPS_EXIST: HRESULT = 0x80630204; +pub const PEER_E_RECORD_NOT_FOUND: HRESULT = 0x80630301; +pub const PEER_E_DATABASE_ACCESSDENIED: HRESULT = 0x80630302; +pub const PEER_E_DBINITIALIZATION_FAILED: HRESULT = 0x80630303; +pub const PEER_E_MAX_RECORD_SIZE_EXCEEDED: HRESULT = 0x80630304; +pub const PEER_E_DATABASE_ALREADY_PRESENT: HRESULT = 0x80630305; +pub const PEER_E_DATABASE_NOT_PRESENT: HRESULT = 0x80630306; +pub const PEER_E_IDENTITY_NOT_FOUND: HRESULT = 0x80630401; +pub const PEER_E_EVENT_HANDLE_NOT_FOUND: HRESULT = 0x80630501; +pub const PEER_E_INVALID_SEARCH: HRESULT = 0x80630601; +pub const PEER_E_INVALID_ATTRIBUTES: HRESULT = 0x80630602; +pub const PEER_E_INVITATION_NOT_TRUSTED: HRESULT = 0x80630701; +pub const PEER_E_CHAIN_TOO_LONG: HRESULT = 0x80630703; +pub const PEER_E_INVALID_TIME_PERIOD: HRESULT = 0x80630705; +pub const PEER_E_CIRCULAR_CHAIN_DETECTED: HRESULT = 0x80630706; +pub const PEER_E_CERT_STORE_CORRUPTED: HRESULT = 0x80630801; +pub const PEER_E_NO_CLOUD: HRESULT = 0x80631001; +pub const PEER_E_CLOUD_NAME_AMBIGUOUS: HRESULT = 0x80631005; +pub const PEER_E_INVALID_RECORD: HRESULT = 0x80632010; +pub const PEER_E_NOT_AUTHORIZED: HRESULT = 0x80632020; +pub const PEER_E_PASSWORD_DOES_NOT_MEET_POLICY: HRESULT = 0x80632021; +pub const PEER_E_DEFERRED_VALIDATION: HRESULT = 0x80632030; +pub const PEER_E_INVALID_GROUP_PROPERTIES: HRESULT = 0x80632040; +pub const PEER_E_INVALID_PEER_NAME: HRESULT = 0x80632050; +pub const PEER_E_INVALID_CLASSIFIER: HRESULT = 0x80632060; +pub const PEER_E_INVALID_FRIENDLY_NAME: HRESULT = 0x80632070; +pub const PEER_E_INVALID_ROLE_PROPERTY: HRESULT = 0x80632071; +pub const PEER_E_INVALID_CLASSIFIER_PROPERTY: HRESULT = 0x80632072; +pub const PEER_E_INVALID_RECORD_EXPIRATION: HRESULT = 0x80632080; +pub const PEER_E_INVALID_CREDENTIAL_INFO: HRESULT = 0x80632081; +pub const PEER_E_INVALID_CREDENTIAL: HRESULT = 0x80632082; +pub const PEER_E_INVALID_RECORD_SIZE: HRESULT = 0x80632083; +pub const PEER_E_UNSUPPORTED_VERSION: HRESULT = 0x80632090; +pub const PEER_E_GROUP_NOT_READY: HRESULT = 0x80632091; +pub const PEER_E_GROUP_IN_USE: HRESULT = 0x80632092; +pub const PEER_E_INVALID_GROUP: HRESULT = 0x80632093; +pub const PEER_E_NO_MEMBERS_FOUND: HRESULT = 0x80632094; +pub const PEER_E_NO_MEMBER_CONNECTIONS: HRESULT = 0x80632095; +pub const PEER_E_UNABLE_TO_LISTEN: HRESULT = 0x80632096; +pub const PEER_E_IDENTITY_DELETED: HRESULT = 0x806320A0; +pub const PEER_E_SERVICE_NOT_AVAILABLE: HRESULT = 0x806320A1; +pub const PEER_E_CONTACT_NOT_FOUND: HRESULT = 0x80636001; +pub const PEER_S_GRAPH_DATA_CREATED: HRESULT = 0x00630001; +pub const PEER_S_NO_EVENT_DATA: HRESULT = 0x00630002; +pub const PEER_S_ALREADY_CONNECTED: HRESULT = 0x00632000; +pub const PEER_S_SUBSCRIPTION_EXISTS: HRESULT = 0x00636000; +pub const PEER_S_NO_CONNECTIVITY: HRESULT = 0x00630005; +pub const PEER_S_ALREADY_A_MEMBER: HRESULT = 0x00630006; +pub const PEER_E_CANNOT_CONVERT_PEER_NAME: HRESULT = 0x80634001; +pub const PEER_E_INVALID_PEER_HOST_NAME: HRESULT = 0x80634002; +pub const PEER_E_NO_MORE: HRESULT = 0x80634003; +pub const PEER_E_PNRP_DUPLICATE_PEER_NAME: HRESULT = 0x80634005; +pub const PEER_E_INVITE_CANCELLED: HRESULT = 0x80637000; +pub const PEER_E_INVITE_RESPONSE_NOT_AVAILABLE: HRESULT = 0x80637001; +pub const PEER_E_NOT_SIGNED_IN: HRESULT = 0x80637003; +pub const PEER_E_PRIVACY_DECLINED: HRESULT = 0x80637004; +pub const PEER_E_TIMEOUT: HRESULT = 0x80637005; +pub const PEER_E_INVALID_ADDRESS: HRESULT = 0x80637007; +pub const PEER_E_FW_EXCEPTION_DISABLED: HRESULT = 0x80637008; +pub const PEER_E_FW_BLOCKED_BY_POLICY: HRESULT = 0x80637009; +pub const PEER_E_FW_BLOCKED_BY_SHIELDS_UP: HRESULT = 0x8063700A; +pub const PEER_E_FW_DECLINED: HRESULT = 0x8063700B; +pub const UI_E_CREATE_FAILED: HRESULT = 0x802A0001; +pub const UI_E_SHUTDOWN_CALLED: HRESULT = 0x802A0002; +pub const UI_E_ILLEGAL_REENTRANCY: HRESULT = 0x802A0003; +pub const UI_E_OBJECT_SEALED: HRESULT = 0x802A0004; +pub const UI_E_VALUE_NOT_SET: HRESULT = 0x802A0005; +pub const UI_E_VALUE_NOT_DETERMINED: HRESULT = 0x802A0006; +pub const UI_E_INVALID_OUTPUT: HRESULT = 0x802A0007; +pub const UI_E_BOOLEAN_EXPECTED: HRESULT = 0x802A0008; +pub const UI_E_DIFFERENT_OWNER: HRESULT = 0x802A0009; +pub const UI_E_AMBIGUOUS_MATCH: HRESULT = 0x802A000A; +pub const UI_E_FP_OVERFLOW: HRESULT = 0x802A000B; +pub const UI_E_WRONG_THREAD: HRESULT = 0x802A000C; +pub const UI_E_STORYBOARD_ACTIVE: HRESULT = 0x802A0101; +pub const UI_E_STORYBOARD_NOT_PLAYING: HRESULT = 0x802A0102; +pub const UI_E_START_KEYFRAME_AFTER_END: HRESULT = 0x802A0103; +pub const UI_E_END_KEYFRAME_NOT_DETERMINED: HRESULT = 0x802A0104; +pub const UI_E_LOOPS_OVERLAP: HRESULT = 0x802A0105; +pub const UI_E_TRANSITION_ALREADY_USED: HRESULT = 0x802A0106; +pub const UI_E_TRANSITION_NOT_IN_STORYBOARD: HRESULT = 0x802A0107; +pub const UI_E_TRANSITION_ECLIPSED: HRESULT = 0x802A0108; +pub const UI_E_TIME_BEFORE_LAST_UPDATE: HRESULT = 0x802A0109; +pub const UI_E_TIMER_CLIENT_ALREADY_CONNECTED: HRESULT = 0x802A010A; +pub const UI_E_INVALID_DIMENSION: HRESULT = 0x802A010B; +pub const UI_E_PRIMITIVE_OUT_OF_BOUNDS: HRESULT = 0x802A010C; +pub const UI_E_WINDOW_CLOSED: HRESULT = 0x802A0201; +pub const E_BLUETOOTH_ATT_INVALID_HANDLE: HRESULT = 0x80650001; +pub const E_BLUETOOTH_ATT_READ_NOT_PERMITTED: HRESULT = 0x80650002; +pub const E_BLUETOOTH_ATT_WRITE_NOT_PERMITTED: HRESULT = 0x80650003; +pub const E_BLUETOOTH_ATT_INVALID_PDU: HRESULT = 0x80650004; +pub const E_BLUETOOTH_ATT_INSUFFICIENT_AUTHENTICATION: HRESULT = 0x80650005; +pub const E_BLUETOOTH_ATT_REQUEST_NOT_SUPPORTED: HRESULT = 0x80650006; +pub const E_BLUETOOTH_ATT_INVALID_OFFSET: HRESULT = 0x80650007; +pub const E_BLUETOOTH_ATT_INSUFFICIENT_AUTHORIZATION: HRESULT = 0x80650008; +pub const E_BLUETOOTH_ATT_PREPARE_QUEUE_FULL: HRESULT = 0x80650009; +pub const E_BLUETOOTH_ATT_ATTRIBUTE_NOT_FOUND: HRESULT = 0x8065000A; +pub const E_BLUETOOTH_ATT_ATTRIBUTE_NOT_LONG: HRESULT = 0x8065000B; +pub const E_BLUETOOTH_ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE: HRESULT = 0x8065000C; +pub const E_BLUETOOTH_ATT_INVALID_ATTRIBUTE_VALUE_LENGTH: HRESULT = 0x8065000D; +pub const E_BLUETOOTH_ATT_UNLIKELY: HRESULT = 0x8065000E; +pub const E_BLUETOOTH_ATT_INSUFFICIENT_ENCRYPTION: HRESULT = 0x8065000F; +pub const E_BLUETOOTH_ATT_UNSUPPORTED_GROUP_TYPE: HRESULT = 0x80650010; +pub const E_BLUETOOTH_ATT_INSUFFICIENT_RESOURCES: HRESULT = 0x80650011; +pub const E_BLUETOOTH_ATT_UNKNOWN_ERROR: HRESULT = 0x80651000; +pub const E_AUDIO_ENGINE_NODE_NOT_FOUND: HRESULT = 0x80660001; +pub const E_HDAUDIO_EMPTY_CONNECTION_LIST: HRESULT = 0x80660002; +pub const E_HDAUDIO_CONNECTION_LIST_NOT_SUPPORTED: HRESULT = 0x80660003; +pub const E_HDAUDIO_NO_LOGICAL_DEVICES_CREATED: HRESULT = 0x80660004; +pub const E_HDAUDIO_NULL_LINKED_LIST_ENTRY: HRESULT = 0x80660005; +pub const ERROR_SPACES_POOL_WAS_DELETED: HRESULT = 0x00E70001; +pub const ERROR_SPACES_RESILIENCY_TYPE_INVALID: HRESULT = 0x80E70003; +pub const ERROR_SPACES_DRIVE_SECTOR_SIZE_INVALID: HRESULT = 0x80E70004; +pub const ERROR_SPACES_DRIVE_REDUNDANCY_INVALID: HRESULT = 0x80E70006; +pub const ERROR_SPACES_NUMBER_OF_DATA_COPIES_INVALID: HRESULT = 0x80E70007; +pub const ERROR_SPACES_PARITY_LAYOUT_INVALID: HRESULT = 0x80E70008; +pub const ERROR_SPACES_INTERLEAVE_LENGTH_INVALID: HRESULT = 0x80E70009; +pub const ERROR_SPACES_NUMBER_OF_COLUMNS_INVALID: HRESULT = 0x80E7000A; +pub const ERROR_SPACES_NOT_ENOUGH_DRIVES: HRESULT = 0x80E7000B; +pub const ERROR_VOLSNAP_BOOTFILE_NOT_VALID: HRESULT = 0x80820001; +pub const ERROR_TIERING_NOT_SUPPORTED_ON_VOLUME: HRESULT = 0x80830001; +pub const ERROR_TIERING_VOLUME_DISMOUNT_IN_PROGRESS: HRESULT = 0x80830002; +pub const ERROR_TIERING_STORAGE_TIER_NOT_FOUND: HRESULT = 0x80830003; +pub const ERROR_TIERING_INVALID_FILE_ID: HRESULT = 0x80830004; +pub const ERROR_TIERING_WRONG_CLUSTER_NODE: HRESULT = 0x80830005; +pub const ERROR_TIERING_ALREADY_PROCESSING: HRESULT = 0x80830006; +pub const ERROR_TIERING_CANNOT_PIN_OBJECT: HRESULT = 0x80830007; +pub const DXGI_STATUS_OCCLUDED: HRESULT = 0x087A0001; +pub const DXGI_STATUS_CLIPPED: HRESULT = 0x087A0002; +pub const DXGI_STATUS_NO_REDIRECTION: HRESULT = 0x087A0004; +pub const DXGI_STATUS_NO_DESKTOP_ACCESS: HRESULT = 0x087A0005; +pub const DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE: HRESULT = 0x087A0006; +pub const DXGI_STATUS_MODE_CHANGED: HRESULT = 0x087A0007; +pub const DXGI_STATUS_MODE_CHANGE_IN_PROGRESS: HRESULT = 0x087A0008; +pub const DXGI_ERROR_INVALID_CALL: HRESULT = 0x887A0001; +pub const DXGI_ERROR_NOT_FOUND: HRESULT = 0x887A0002; +pub const DXGI_ERROR_MORE_DATA: HRESULT = 0x887A0003; +pub const DXGI_ERROR_UNSUPPORTED: HRESULT = 0x887A0004; +pub const DXGI_ERROR_DEVICE_REMOVED: HRESULT = 0x887A0005; +pub const DXGI_ERROR_DEVICE_HUNG: HRESULT = 0x887A0006; +pub const DXGI_ERROR_DEVICE_RESET: HRESULT = 0x887A0007; +pub const DXGI_ERROR_WAS_STILL_DRAWING: HRESULT = 0x887A000A; +pub const DXGI_ERROR_FRAME_STATISTICS_DISJOINT: HRESULT = 0x887A000B; +pub const DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE: HRESULT = 0x887A000C; +pub const DXGI_ERROR_DRIVER_INTERNAL_ERROR: HRESULT = 0x887A0020; +pub const DXGI_ERROR_NONEXCLUSIVE: HRESULT = 0x887A0021; +pub const DXGI_ERROR_NOT_CURRENTLY_AVAILABLE: HRESULT = 0x887A0022; +pub const DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED: HRESULT = 0x887A0023; +pub const DXGI_ERROR_REMOTE_OUTOFMEMORY: HRESULT = 0x887A0024; +pub const DXGI_ERROR_ACCESS_LOST: HRESULT = 0x887A0026; +pub const DXGI_ERROR_WAIT_TIMEOUT: HRESULT = 0x887A0027; +pub const DXGI_ERROR_SESSION_DISCONNECTED: HRESULT = 0x887A0028; +pub const DXGI_ERROR_RESTRICT_TO_OUTPUT_STALE: HRESULT = 0x887A0029; +pub const DXGI_ERROR_CANNOT_PROTECT_CONTENT: HRESULT = 0x887A002A; +pub const DXGI_ERROR_ACCESS_DENIED: HRESULT = 0x887A002B; +pub const DXGI_ERROR_NAME_ALREADY_EXISTS: HRESULT = 0x887A002C; +pub const DXGI_ERROR_SDK_COMPONENT_MISSING: HRESULT = 0x887A002D; +pub const DXGI_STATUS_UNOCCLUDED: HRESULT = 0x087A0009; +pub const DXGI_STATUS_DDA_WAS_STILL_DRAWING: HRESULT = 0x087A000A; +pub const DXGI_ERROR_MODE_CHANGE_IN_PROGRESS: HRESULT = 0x887A0025; +pub const DXGI_DDI_ERR_WASSTILLDRAWING: HRESULT = 0x887B0001; +pub const DXGI_DDI_ERR_UNSUPPORTED: HRESULT = 0x887B0002; +pub const DXGI_DDI_ERR_NONEXCLUSIVE: HRESULT = 0x887B0003; +pub const D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS: HRESULT = 0x88790001; +pub const D3D10_ERROR_FILE_NOT_FOUND: HRESULT = 0x88790002; +pub const D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS: HRESULT = 0x887C0001; +pub const D3D11_ERROR_FILE_NOT_FOUND: HRESULT = 0x887C0002; +pub const D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS: HRESULT = 0x887C0003; +pub const D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD: HRESULT + = 0x887C0004; +pub const D2DERR_WRONG_STATE: HRESULT = 0x88990001; +pub const D2DERR_NOT_INITIALIZED: HRESULT = 0x88990002; +pub const D2DERR_UNSUPPORTED_OPERATION: HRESULT = 0x88990003; +pub const D2DERR_SCANNER_FAILED: HRESULT = 0x88990004; +pub const D2DERR_SCREEN_ACCESS_DENIED: HRESULT = 0x88990005; +pub const D2DERR_DISPLAY_STATE_INVALID: HRESULT = 0x88990006; +pub const D2DERR_ZERO_VECTOR: HRESULT = 0x88990007; +pub const D2DERR_INTERNAL_ERROR: HRESULT = 0x88990008; +pub const D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED: HRESULT = 0x88990009; +pub const D2DERR_INVALID_CALL: HRESULT = 0x8899000A; +pub const D2DERR_NO_HARDWARE_DEVICE: HRESULT = 0x8899000B; +pub const D2DERR_RECREATE_TARGET: HRESULT = 0x8899000C; +pub const D2DERR_TOO_MANY_SHADER_ELEMENTS: HRESULT = 0x8899000D; +pub const D2DERR_SHADER_COMPILE_FAILED: HRESULT = 0x8899000E; +pub const D2DERR_MAX_TEXTURE_SIZE_EXCEEDED: HRESULT = 0x8899000F; +pub const D2DERR_UNSUPPORTED_VERSION: HRESULT = 0x88990010; +pub const D2DERR_BAD_NUMBER: HRESULT = 0x88990011; +pub const D2DERR_WRONG_FACTORY: HRESULT = 0x88990012; +pub const D2DERR_LAYER_ALREADY_IN_USE: HRESULT = 0x88990013; +pub const D2DERR_POP_CALL_DID_NOT_MATCH_PUSH: HRESULT = 0x88990014; +pub const D2DERR_WRONG_RESOURCE_DOMAIN: HRESULT = 0x88990015; +pub const D2DERR_PUSH_POP_UNBALANCED: HRESULT = 0x88990016; +pub const D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT: HRESULT = 0x88990017; +pub const D2DERR_INCOMPATIBLE_BRUSH_TYPES: HRESULT = 0x88990018; +pub const D2DERR_WIN32_ERROR: HRESULT = 0x88990019; +pub const D2DERR_TARGET_NOT_GDI_COMPATIBLE: HRESULT = 0x8899001A; +pub const D2DERR_TEXT_EFFECT_IS_WRONG_TYPE: HRESULT = 0x8899001B; +pub const D2DERR_TEXT_RENDERER_NOT_RELEASED: HRESULT = 0x8899001C; +pub const D2DERR_EXCEEDS_MAX_BITMAP_SIZE: HRESULT = 0x8899001D; +pub const D2DERR_INVALID_GRAPH_CONFIGURATION: HRESULT = 0x8899001E; +pub const D2DERR_INVALID_INTERNAL_GRAPH_CONFIGURATION: HRESULT = 0x8899001F; +pub const D2DERR_CYCLIC_GRAPH: HRESULT = 0x88990020; +pub const D2DERR_BITMAP_CANNOT_DRAW: HRESULT = 0x88990021; +pub const D2DERR_OUTSTANDING_BITMAP_REFERENCES: HRESULT = 0x88990022; +pub const D2DERR_ORIGINAL_TARGET_NOT_BOUND: HRESULT = 0x88990023; +pub const D2DERR_INVALID_TARGET: HRESULT = 0x88990024; +pub const D2DERR_BITMAP_BOUND_AS_TARGET: HRESULT = 0x88990025; +pub const D2DERR_INSUFFICIENT_DEVICE_CAPABILITIES: HRESULT = 0x88990026; +pub const D2DERR_INTERMEDIATE_TOO_LARGE: HRESULT = 0x88990027; +pub const D2DERR_EFFECT_IS_NOT_REGISTERED: HRESULT = 0x88990028; +pub const D2DERR_INVALID_PROPERTY: HRESULT = 0x88990029; +pub const D2DERR_NO_SUBPROPERTIES: HRESULT = 0x8899002A; +pub const D2DERR_PRINT_JOB_CLOSED: HRESULT = 0x8899002B; +pub const D2DERR_PRINT_FORMAT_NOT_SUPPORTED: HRESULT = 0x8899002C; +pub const D2DERR_TOO_MANY_TRANSFORM_INPUTS: HRESULT = 0x8899002D; +pub const DWRITE_E_FILEFORMAT: HRESULT = 0x88985000; +pub const DWRITE_E_UNEXPECTED: HRESULT = 0x88985001; +pub const DWRITE_E_NOFONT: HRESULT = 0x88985002; +pub const DWRITE_E_FILENOTFOUND: HRESULT = 0x88985003; +pub const DWRITE_E_FILEACCESS: HRESULT = 0x88985004; +pub const DWRITE_E_FONTCOLLECTIONOBSOLETE: HRESULT = 0x88985005; +pub const DWRITE_E_ALREADYREGISTERED: HRESULT = 0x88985006; +pub const DWRITE_E_CACHEFORMAT: HRESULT = 0x88985007; +pub const DWRITE_E_CACHEVERSION: HRESULT = 0x88985008; +pub const DWRITE_E_UNSUPPORTEDOPERATION: HRESULT = 0x88985009; +pub const DWRITE_E_TEXTRENDERERINCOMPATIBLE: HRESULT = 0x8898500A; +pub const DWRITE_E_FLOWDIRECTIONCONFLICTS: HRESULT = 0x8898500B; +pub const DWRITE_E_NOCOLOR: HRESULT = 0x8898500C; +pub const WINCODEC_ERR_WRONGSTATE: HRESULT = 0x88982F04; +pub const WINCODEC_ERR_VALUEOUTOFRANGE: HRESULT = 0x88982F05; +pub const WINCODEC_ERR_UNKNOWNIMAGEFORMAT: HRESULT = 0x88982F07; +pub const WINCODEC_ERR_UNSUPPORTEDVERSION: HRESULT = 0x88982F0B; +pub const WINCODEC_ERR_NOTINITIALIZED: HRESULT = 0x88982F0C; +pub const WINCODEC_ERR_ALREADYLOCKED: HRESULT = 0x88982F0D; +pub const WINCODEC_ERR_PROPERTYNOTFOUND: HRESULT = 0x88982F40; +pub const WINCODEC_ERR_PROPERTYNOTSUPPORTED: HRESULT = 0x88982F41; +pub const WINCODEC_ERR_PROPERTYSIZE: HRESULT = 0x88982F42; +pub const WINCODEC_ERR_CODECPRESENT: HRESULT = 0x88982F43; +pub const WINCODEC_ERR_CODECNOTHUMBNAIL: HRESULT = 0x88982F44; +pub const WINCODEC_ERR_PALETTEUNAVAILABLE: HRESULT = 0x88982F45; +pub const WINCODEC_ERR_CODECTOOMANYSCANLINES: HRESULT = 0x88982F46; +pub const WINCODEC_ERR_INTERNALERROR: HRESULT = 0x88982F48; +pub const WINCODEC_ERR_SOURCERECTDOESNOTMATCHDIMENSIONS: HRESULT = 0x88982F49; +pub const WINCODEC_ERR_COMPONENTNOTFOUND: HRESULT = 0x88982F50; +pub const WINCODEC_ERR_IMAGESIZEOUTOFRANGE: HRESULT = 0x88982F51; +pub const WINCODEC_ERR_TOOMUCHMETADATA: HRESULT = 0x88982F52; +pub const WINCODEC_ERR_BADIMAGE: HRESULT = 0x88982F60; +pub const WINCODEC_ERR_BADHEADER: HRESULT = 0x88982F61; +pub const WINCODEC_ERR_FRAMEMISSING: HRESULT = 0x88982F62; +pub const WINCODEC_ERR_BADMETADATAHEADER: HRESULT = 0x88982F63; +pub const WINCODEC_ERR_BADSTREAMDATA: HRESULT = 0x88982F70; +pub const WINCODEC_ERR_STREAMWRITE: HRESULT = 0x88982F71; +pub const WINCODEC_ERR_STREAMREAD: HRESULT = 0x88982F72; +pub const WINCODEC_ERR_STREAMNOTAVAILABLE: HRESULT = 0x88982F73; +pub const WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT: HRESULT = 0x88982F80; +pub const WINCODEC_ERR_UNSUPPORTEDOPERATION: HRESULT = 0x88982F81; +pub const WINCODEC_ERR_INVALIDREGISTRATION: HRESULT = 0x88982F8A; +pub const WINCODEC_ERR_COMPONENTINITIALIZEFAILURE: HRESULT = 0x88982F8B; +pub const WINCODEC_ERR_INSUFFICIENTBUFFER: HRESULT = 0x88982F8C; +pub const WINCODEC_ERR_DUPLICATEMETADATAPRESENT: HRESULT = 0x88982F8D; +pub const WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE: HRESULT = 0x88982F8E; +pub const WINCODEC_ERR_UNEXPECTEDSIZE: HRESULT = 0x88982F8F; +pub const WINCODEC_ERR_INVALIDQUERYREQUEST: HRESULT = 0x88982F90; +pub const WINCODEC_ERR_UNEXPECTEDMETADATATYPE: HRESULT = 0x88982F91; +pub const WINCODEC_ERR_REQUESTONLYVALIDATMETADATAROOT: HRESULT = 0x88982F92; +pub const WINCODEC_ERR_INVALIDQUERYCHARACTER: HRESULT = 0x88982F93; +pub const WINCODEC_ERR_WIN32ERROR: HRESULT = 0x88982F94; +pub const WINCODEC_ERR_INVALIDPROGRESSIVELEVEL: HRESULT = 0x88982F95; +pub const MILERR_OBJECTBUSY: HRESULT = 0x88980001; +pub const MILERR_INSUFFICIENTBUFFER: HRESULT = 0x88980002; +pub const MILERR_WIN32ERROR: HRESULT = 0x88980003; +pub const MILERR_SCANNER_FAILED: HRESULT = 0x88980004; +pub const MILERR_SCREENACCESSDENIED: HRESULT = 0x88980005; +pub const MILERR_DISPLAYSTATEINVALID: HRESULT = 0x88980006; +pub const MILERR_NONINVERTIBLEMATRIX: HRESULT = 0x88980007; +pub const MILERR_ZEROVECTOR: HRESULT = 0x88980008; +pub const MILERR_TERMINATED: HRESULT = 0x88980009; +pub const MILERR_BADNUMBER: HRESULT = 0x8898000A; +pub const MILERR_INTERNALERROR: HRESULT = 0x88980080; +pub const MILERR_DISPLAYFORMATNOTSUPPORTED: HRESULT = 0x88980084; +pub const MILERR_INVALIDCALL: HRESULT = 0x88980085; +pub const MILERR_ALREADYLOCKED: HRESULT = 0x88980086; +pub const MILERR_NOTLOCKED: HRESULT = 0x88980087; +pub const MILERR_DEVICECANNOTRENDERTEXT: HRESULT = 0x88980088; +pub const MILERR_GLYPHBITMAPMISSED: HRESULT = 0x88980089; +pub const MILERR_MALFORMEDGLYPHCACHE: HRESULT = 0x8898008A; +pub const MILERR_GENERIC_IGNORE: HRESULT = 0x8898008B; +pub const MILERR_MALFORMED_GUIDELINE_DATA: HRESULT = 0x8898008C; +pub const MILERR_NO_HARDWARE_DEVICE: HRESULT = 0x8898008D; +pub const MILERR_NEED_RECREATE_AND_PRESENT: HRESULT = 0x8898008E; +pub const MILERR_ALREADY_INITIALIZED: HRESULT = 0x8898008F; +pub const MILERR_MISMATCHED_SIZE: HRESULT = 0x88980090; +pub const MILERR_NO_REDIRECTION_SURFACE_AVAILABLE: HRESULT = 0x88980091; +pub const MILERR_REMOTING_NOT_SUPPORTED: HRESULT = 0x88980092; +pub const MILERR_QUEUED_PRESENT_NOT_SUPPORTED: HRESULT = 0x88980093; +pub const MILERR_NOT_QUEUING_PRESENTS: HRESULT = 0x88980094; +pub const MILERR_NO_REDIRECTION_SURFACE_RETRY_LATER: HRESULT = 0x88980095; +pub const MILERR_TOOMANYSHADERELEMNTS: HRESULT = 0x88980096; +pub const MILERR_MROW_READLOCK_FAILED: HRESULT = 0x88980097; +pub const MILERR_MROW_UPDATE_FAILED: HRESULT = 0x88980098; +pub const MILERR_SHADER_COMPILE_FAILED: HRESULT = 0x88980099; +pub const MILERR_MAX_TEXTURE_SIZE_EXCEEDED: HRESULT = 0x8898009A; +pub const MILERR_QPC_TIME_WENT_BACKWARD: HRESULT = 0x8898009B; +pub const MILERR_DXGI_ENUMERATION_OUT_OF_SYNC: HRESULT = 0x8898009D; +pub const MILERR_ADAPTER_NOT_FOUND: HRESULT = 0x8898009E; +pub const MILERR_COLORSPACE_NOT_SUPPORTED: HRESULT = 0x8898009F; +pub const MILERR_PREFILTER_NOT_SUPPORTED: HRESULT = 0x889800A0; +pub const MILERR_DISPLAYID_ACCESS_DENIED: HRESULT = 0x889800A1; +pub const UCEERR_INVALIDPACKETHEADER: HRESULT = 0x88980400; +pub const UCEERR_UNKNOWNPACKET: HRESULT = 0x88980401; +pub const UCEERR_ILLEGALPACKET: HRESULT = 0x88980402; +pub const UCEERR_MALFORMEDPACKET: HRESULT = 0x88980403; +pub const UCEERR_ILLEGALHANDLE: HRESULT = 0x88980404; +pub const UCEERR_HANDLELOOKUPFAILED: HRESULT = 0x88980405; +pub const UCEERR_RENDERTHREADFAILURE: HRESULT = 0x88980406; +pub const UCEERR_CTXSTACKFRSTTARGETNULL: HRESULT = 0x88980407; +pub const UCEERR_CONNECTIONIDLOOKUPFAILED: HRESULT = 0x88980408; +pub const UCEERR_BLOCKSFULL: HRESULT = 0x88980409; +pub const UCEERR_MEMORYFAILURE: HRESULT = 0x8898040A; +pub const UCEERR_PACKETRECORDOUTOFRANGE: HRESULT = 0x8898040B; +pub const UCEERR_ILLEGALRECORDTYPE: HRESULT = 0x8898040C; +pub const UCEERR_OUTOFHANDLES: HRESULT = 0x8898040D; +pub const UCEERR_UNCHANGABLE_UPDATE_ATTEMPTED: HRESULT = 0x8898040E; +pub const UCEERR_NO_MULTIPLE_WORKER_THREADS: HRESULT = 0x8898040F; +pub const UCEERR_REMOTINGNOTSUPPORTED: HRESULT = 0x88980410; +pub const UCEERR_MISSINGENDCOMMAND: HRESULT = 0x88980411; +pub const UCEERR_MISSINGBEGINCOMMAND: HRESULT = 0x88980412; +pub const UCEERR_CHANNELSYNCTIMEDOUT: HRESULT = 0x88980413; +pub const UCEERR_CHANNELSYNCABANDONED: HRESULT = 0x88980414; +pub const UCEERR_UNSUPPORTEDTRANSPORTVERSION: HRESULT = 0x88980415; +pub const UCEERR_TRANSPORTUNAVAILABLE: HRESULT = 0x88980416; +pub const UCEERR_FEEDBACK_UNSUPPORTED: HRESULT = 0x88980417; +pub const UCEERR_COMMANDTRANSPORTDENIED: HRESULT = 0x88980418; +pub const UCEERR_GRAPHICSSTREAMUNAVAILABLE: HRESULT = 0x88980419; +pub const UCEERR_GRAPHICSSTREAMALREADYOPEN: HRESULT = 0x88980420; +pub const UCEERR_TRANSPORTDISCONNECTED: HRESULT = 0x88980421; +pub const UCEERR_TRANSPORTOVERLOADED: HRESULT = 0x88980422; +pub const UCEERR_PARTITION_ZOMBIED: HRESULT = 0x88980423; +pub const MILAVERR_NOCLOCK: HRESULT = 0x88980500; +pub const MILAVERR_NOMEDIATYPE: HRESULT = 0x88980501; +pub const MILAVERR_NOVIDEOMIXER: HRESULT = 0x88980502; +pub const MILAVERR_NOVIDEOPRESENTER: HRESULT = 0x88980503; +pub const MILAVERR_NOREADYFRAMES: HRESULT = 0x88980504; +pub const MILAVERR_MODULENOTLOADED: HRESULT = 0x88980505; +pub const MILAVERR_WMPFACTORYNOTREGISTERED: HRESULT = 0x88980506; +pub const MILAVERR_INVALIDWMPVERSION: HRESULT = 0x88980507; +pub const MILAVERR_INSUFFICIENTVIDEORESOURCES: HRESULT = 0x88980508; +pub const MILAVERR_VIDEOACCELERATIONNOTAVAILABLE: HRESULT = 0x88980509; +pub const MILAVERR_REQUESTEDTEXTURETOOBIG: HRESULT = 0x8898050A; +pub const MILAVERR_SEEKFAILED: HRESULT = 0x8898050B; +pub const MILAVERR_UNEXPECTEDWMPFAILURE: HRESULT = 0x8898050C; +pub const MILAVERR_MEDIAPLAYERCLOSED: HRESULT = 0x8898050D; +pub const MILAVERR_UNKNOWNHARDWAREERROR: HRESULT = 0x8898050E; +pub const MILEFFECTSERR_UNKNOWNPROPERTY: HRESULT = 0x8898060E; +pub const MILEFFECTSERR_EFFECTNOTPARTOFGROUP: HRESULT = 0x8898060F; +pub const MILEFFECTSERR_NOINPUTSOURCEATTACHED: HRESULT = 0x88980610; +pub const MILEFFECTSERR_CONNECTORNOTCONNECTED: HRESULT = 0x88980611; +pub const MILEFFECTSERR_CONNECTORNOTASSOCIATEDWITHEFFECT: HRESULT = 0x88980612; +pub const MILEFFECTSERR_RESERVED: HRESULT = 0x88980613; +pub const MILEFFECTSERR_CYCLEDETECTED: HRESULT = 0x88980614; +pub const MILEFFECTSERR_EFFECTINMORETHANONEGRAPH: HRESULT = 0x88980615; +pub const MILEFFECTSERR_EFFECTALREADYINAGRAPH: HRESULT = 0x88980616; +pub const MILEFFECTSERR_EFFECTHASNOCHILDREN: HRESULT = 0x88980617; +pub const MILEFFECTSERR_ALREADYATTACHEDTOLISTENER: HRESULT = 0x88980618; +pub const MILEFFECTSERR_NOTAFFINETRANSFORM: HRESULT = 0x88980619; +pub const MILEFFECTSERR_EMPTYBOUNDS: HRESULT = 0x8898061A; +pub const MILEFFECTSERR_OUTPUTSIZETOOLARGE: HRESULT = 0x8898061B; +pub const DWMERR_STATE_TRANSITION_FAILED: HRESULT = 0x88980700; +pub const DWMERR_THEME_FAILED: HRESULT = 0x88980701; +pub const DWMERR_CATASTROPHIC_FAILURE: HRESULT = 0x88980702; +pub const DCOMPOSITION_ERROR_WINDOW_ALREADY_COMPOSED: HRESULT = 0x88980800; +pub const DCOMPOSITION_ERROR_SURFACE_BEING_RENDERED: HRESULT = 0x88980801; +pub const DCOMPOSITION_ERROR_SURFACE_NOT_BEING_RENDERED: HRESULT = 0x88980802; +pub const ONL_E_INVALID_AUTHENTICATION_TARGET: HRESULT = 0x80860001; +pub const ONL_E_ACCESS_DENIED_BY_TOU: HRESULT = 0x80860002; +pub const ONL_E_INVALID_APPLICATION: HRESULT = 0x80860003; +pub const ONL_E_PASSWORD_UPDATE_REQUIRED: HRESULT = 0x80860004; +pub const ONL_E_ACCOUNT_UPDATE_REQUIRED: HRESULT = 0x80860005; +pub const ONL_E_FORCESIGNIN: HRESULT = 0x80860006; +pub const ONL_E_ACCOUNT_LOCKED: HRESULT = 0x80860007; +pub const ONL_E_PARENTAL_CONSENT_REQUIRED: HRESULT = 0x80860008; +pub const ONL_E_EMAIL_VERIFICATION_REQUIRED: HRESULT = 0x80860009; +pub const ONL_E_ACCOUNT_SUSPENDED_COMPROIMISE: HRESULT = 0x8086000A; +pub const ONL_E_ACCOUNT_SUSPENDED_ABUSE: HRESULT = 0x8086000B; +pub const ONL_E_ACTION_REQUIRED: HRESULT = 0x8086000C; +pub const ONL_CONNECTION_COUNT_LIMIT: HRESULT = 0x8086000D; +pub const ONL_E_CONNECTED_ACCOUNT_CAN_NOT_SIGNOUT: HRESULT = 0x8086000E; +pub const ONL_E_USER_AUTHENTICATION_REQUIRED: HRESULT = 0x8086000F; +pub const ONL_E_REQUEST_THROTTLED: HRESULT = 0x80860010; +pub const FA_E_MAX_PERSISTED_ITEMS_REACHED: HRESULT = 0x80270220; +pub const FA_E_HOMEGROUP_NOT_AVAILABLE: HRESULT = 0x80270222; +pub const E_MONITOR_RESOLUTION_TOO_LOW: HRESULT = 0x80270250; +pub const E_ELEVATED_ACTIVATION_NOT_SUPPORTED: HRESULT = 0x80270251; +pub const E_UAC_DISABLED: HRESULT = 0x80270252; +pub const E_FULL_ADMIN_NOT_SUPPORTED: HRESULT = 0x80270253; +pub const E_APPLICATION_NOT_REGISTERED: HRESULT = 0x80270254; +pub const E_MULTIPLE_EXTENSIONS_FOR_APPLICATION: HRESULT = 0x80270255; +pub const E_MULTIPLE_PACKAGES_FOR_FAMILY: HRESULT = 0x80270256; +pub const E_APPLICATION_MANAGER_NOT_RUNNING: HRESULT = 0x80270257; +pub const S_STORE_LAUNCHED_FOR_REMEDIATION: HRESULT = 0x00270258; +pub const S_APPLICATION_ACTIVATION_ERROR_HANDLED_BY_DIALOG: HRESULT = 0x00270259; +pub const E_APPLICATION_ACTIVATION_TIMED_OUT: HRESULT = 0x8027025A; +pub const E_APPLICATION_ACTIVATION_EXEC_FAILURE: HRESULT = 0x8027025B; +pub const E_APPLICATION_TEMPORARY_LICENSE_ERROR: HRESULT = 0x8027025C; +pub const E_APPLICATION_TRIAL_LICENSE_EXPIRED: HRESULT = 0x8027025D; +pub const E_SKYDRIVE_ROOT_TARGET_FILE_SYSTEM_NOT_SUPPORTED: HRESULT = 0x80270260; +pub const E_SKYDRIVE_ROOT_TARGET_OVERLAP: HRESULT = 0x80270261; +pub const E_SKYDRIVE_ROOT_TARGET_CANNOT_INDEX: HRESULT = 0x80270262; +pub const E_SKYDRIVE_FILE_NOT_UPLOADED: HRESULT = 0x80270263; +pub const E_SKYDRIVE_UPDATE_AVAILABILITY_FAIL: HRESULT = 0x80270264; +pub const E_SKYDRIVE_ROOT_TARGET_VOLUME_ROOT_NOT_SUPPORTED: HRESULT = 0x80270265; +pub const E_SYNCENGINE_FILE_SIZE_OVER_LIMIT: HRESULT = 0x8802B001; +pub const E_SYNCENGINE_FILE_SIZE_EXCEEDS_REMAINING_QUOTA: HRESULT = 0x8802B002; +pub const E_SYNCENGINE_UNSUPPORTED_FILE_NAME: HRESULT = 0x8802B003; +pub const E_SYNCENGINE_FOLDER_ITEM_COUNT_LIMIT_EXCEEDED: HRESULT = 0x8802B004; +pub const E_SYNCENGINE_FILE_SYNC_PARTNER_ERROR: HRESULT = 0x8802B005; +pub const E_SYNCENGINE_SYNC_PAUSED_BY_SERVICE: HRESULT = 0x8802B006; +pub const E_SYNCENGINE_FILE_IDENTIFIER_UNKNOWN: HRESULT = 0x8802C002; +pub const E_SYNCENGINE_SERVICE_AUTHENTICATION_FAILED: HRESULT = 0x8802C003; +pub const E_SYNCENGINE_UNKNOWN_SERVICE_ERROR: HRESULT = 0x8802C004; +pub const E_SYNCENGINE_SERVICE_RETURNED_UNEXPECTED_SIZE: HRESULT = 0x8802C005; +pub const E_SYNCENGINE_REQUEST_BLOCKED_BY_SERVICE: HRESULT = 0x8802C006; +pub const E_SYNCENGINE_REQUEST_BLOCKED_DUE_TO_CLIENT_ERROR: HRESULT = 0x8802C007; +pub const E_SYNCENGINE_FOLDER_INACCESSIBLE: HRESULT = 0x8802D001; +pub const E_SYNCENGINE_UNSUPPORTED_FOLDER_NAME: HRESULT = 0x8802D002; +pub const E_SYNCENGINE_UNSUPPORTED_MARKET: HRESULT = 0x8802D003; +pub const E_SYNCENGINE_PATH_LENGTH_LIMIT_EXCEEDED: HRESULT = 0x8802D004; +pub const E_SYNCENGINE_REMOTE_PATH_LENGTH_LIMIT_EXCEEDED: HRESULT = 0x8802D005; +pub const E_SYNCENGINE_CLIENT_UPDATE_NEEDED: HRESULT = 0x8802D006; +pub const E_SYNCENGINE_PROXY_AUTHENTICATION_REQUIRED: HRESULT = 0x8802D007; +pub const E_SYNCENGINE_STORAGE_SERVICE_PROVISIONING_FAILED: HRESULT = 0x8802D008; +pub const E_SYNCENGINE_UNSUPPORTED_REPARSE_POINT: HRESULT = 0x8802D009; +pub const E_SYNCENGINE_STORAGE_SERVICE_BLOCKED: HRESULT = 0x8802D00A; +pub const E_SYNCENGINE_FOLDER_IN_REDIRECTION: HRESULT = 0x8802D00B; +pub const EAS_E_POLICY_NOT_MANAGED_BY_OS: HRESULT = 0x80550001; +pub const EAS_E_POLICY_COMPLIANT_WITH_ACTIONS: HRESULT = 0x80550002; +pub const EAS_E_REQUESTED_POLICY_NOT_ENFORCEABLE: HRESULT = 0x80550003; +pub const EAS_E_CURRENT_USER_HAS_BLANK_PASSWORD: HRESULT = 0x80550004; +pub const EAS_E_REQUESTED_POLICY_PASSWORD_EXPIRATION_INCOMPATIBLE: HRESULT + = 0x80550005; +pub const EAS_E_USER_CANNOT_CHANGE_PASSWORD: HRESULT = 0x80550006; +pub const EAS_E_ADMINS_HAVE_BLANK_PASSWORD: HRESULT = 0x80550007; +pub const EAS_E_ADMINS_CANNOT_CHANGE_PASSWORD: HRESULT = 0x80550008; +pub const EAS_E_LOCAL_CONTROLLED_USERS_CANNOT_CHANGE_PASSWORD: HRESULT = 0x80550009; +pub const EAS_E_PASSWORD_POLICY_NOT_ENFORCEABLE_FOR_CONNECTED_ADMINS: HRESULT + = 0x8055000A; +pub const EAS_E_CONNECTED_ADMINS_NEED_TO_CHANGE_PASSWORD: HRESULT = 0x8055000B; +pub const EAS_E_PASSWORD_POLICY_NOT_ENFORCEABLE_FOR_CURRENT_CONNECTED_USER: HRESULT + = 0x8055000C; +pub const EAS_E_CURRENT_CONNECTED_USER_NEED_TO_CHANGE_PASSWORD: HRESULT = 0x8055000D; +pub const WEB_E_UNSUPPORTED_FORMAT: HRESULT = 0x83750001; +pub const WEB_E_INVALID_XML: HRESULT = 0x83750002; +pub const WEB_E_MISSING_REQUIRED_ELEMENT: HRESULT = 0x83750003; +pub const WEB_E_MISSING_REQUIRED_ATTRIBUTE: HRESULT = 0x83750004; +pub const WEB_E_UNEXPECTED_CONTENT: HRESULT = 0x83750005; +pub const WEB_E_RESOURCE_TOO_LARGE: HRESULT = 0x83750006; +pub const WEB_E_INVALID_JSON_STRING: HRESULT = 0x83750007; +pub const WEB_E_INVALID_JSON_NUMBER: HRESULT = 0x83750008; +pub const WEB_E_JSON_VALUE_NOT_FOUND: HRESULT = 0x83750009; +pub const HTTP_E_STATUS_UNEXPECTED: HRESULT = 0x80190001; +pub const HTTP_E_STATUS_UNEXPECTED_REDIRECTION: HRESULT = 0x80190003; +pub const HTTP_E_STATUS_UNEXPECTED_CLIENT_ERROR: HRESULT = 0x80190004; +pub const HTTP_E_STATUS_UNEXPECTED_SERVER_ERROR: HRESULT = 0x80190005; +pub const HTTP_E_STATUS_AMBIGUOUS: HRESULT = 0x8019012C; +pub const HTTP_E_STATUS_MOVED: HRESULT = 0x8019012D; +pub const HTTP_E_STATUS_REDIRECT: HRESULT = 0x8019012E; +pub const HTTP_E_STATUS_REDIRECT_METHOD: HRESULT = 0x8019012F; +pub const HTTP_E_STATUS_NOT_MODIFIED: HRESULT = 0x80190130; +pub const HTTP_E_STATUS_USE_PROXY: HRESULT = 0x80190131; +pub const HTTP_E_STATUS_REDIRECT_KEEP_VERB: HRESULT = 0x80190133; +pub const HTTP_E_STATUS_BAD_REQUEST: HRESULT = 0x80190190; +pub const HTTP_E_STATUS_DENIED: HRESULT = 0x80190191; +pub const HTTP_E_STATUS_PAYMENT_REQ: HRESULT = 0x80190192; +pub const HTTP_E_STATUS_FORBIDDEN: HRESULT = 0x80190193; +pub const HTTP_E_STATUS_NOT_FOUND: HRESULT = 0x80190194; +pub const HTTP_E_STATUS_BAD_METHOD: HRESULT = 0x80190195; +pub const HTTP_E_STATUS_NONE_ACCEPTABLE: HRESULT = 0x80190196; +pub const HTTP_E_STATUS_PROXY_AUTH_REQ: HRESULT = 0x80190197; +pub const HTTP_E_STATUS_REQUEST_TIMEOUT: HRESULT = 0x80190198; +pub const HTTP_E_STATUS_CONFLICT: HRESULT = 0x80190199; +pub const HTTP_E_STATUS_GONE: HRESULT = 0x8019019A; +pub const HTTP_E_STATUS_LENGTH_REQUIRED: HRESULT = 0x8019019B; +pub const HTTP_E_STATUS_PRECOND_FAILED: HRESULT = 0x8019019C; +pub const HTTP_E_STATUS_REQUEST_TOO_LARGE: HRESULT = 0x8019019D; +pub const HTTP_E_STATUS_URI_TOO_LONG: HRESULT = 0x8019019E; +pub const HTTP_E_STATUS_UNSUPPORTED_MEDIA: HRESULT = 0x8019019F; +pub const HTTP_E_STATUS_RANGE_NOT_SATISFIABLE: HRESULT = 0x801901A0; +pub const HTTP_E_STATUS_EXPECTATION_FAILED: HRESULT = 0x801901A1; +pub const HTTP_E_STATUS_SERVER_ERROR: HRESULT = 0x801901F4; +pub const HTTP_E_STATUS_NOT_SUPPORTED: HRESULT = 0x801901F5; +pub const HTTP_E_STATUS_BAD_GATEWAY: HRESULT = 0x801901F6; +pub const HTTP_E_STATUS_SERVICE_UNAVAIL: HRESULT = 0x801901F7; +pub const HTTP_E_STATUS_GATEWAY_TIMEOUT: HRESULT = 0x801901F8; +pub const HTTP_E_STATUS_VERSION_NOT_SUP: HRESULT = 0x801901F9; +pub const E_INVALID_PROTOCOL_OPERATION: HRESULT = 0x83760001; +pub const E_INVALID_PROTOCOL_FORMAT: HRESULT = 0x83760002; +pub const E_PROTOCOL_EXTENSIONS_NOT_SUPPORTED: HRESULT = 0x83760003; +pub const E_SUBPROTOCOL_NOT_SUPPORTED: HRESULT = 0x83760004; +pub const E_PROTOCOL_VERSION_NOT_SUPPORTED: HRESULT = 0x83760005; +pub const INPUT_E_OUT_OF_ORDER: HRESULT = 0x80400000; +pub const INPUT_E_REENTRANCY: HRESULT = 0x80400001; +pub const INPUT_E_MULTIMODAL: HRESULT = 0x80400002; +pub const INPUT_E_PACKET: HRESULT = 0x80400003; +pub const INPUT_E_FRAME: HRESULT = 0x80400004; +pub const INPUT_E_HISTORY: HRESULT = 0x80400005; +pub const INPUT_E_DEVICE_INFO: HRESULT = 0x80400006; +pub const INPUT_E_TRANSFORM: HRESULT = 0x80400007; +pub const INPUT_E_DEVICE_PROPERTY: HRESULT = 0x80400008; +pub const INET_E_INVALID_URL: HRESULT = 0x800C0002; +pub const INET_E_NO_SESSION: HRESULT = 0x800C0003; +pub const INET_E_CANNOT_CONNECT: HRESULT = 0x800C0004; +pub const INET_E_RESOURCE_NOT_FOUND: HRESULT = 0x800C0005; +pub const INET_E_OBJECT_NOT_FOUND: HRESULT = 0x800C0006; +pub const INET_E_DATA_NOT_AVAILABLE: HRESULT = 0x800C0007; +pub const INET_E_DOWNLOAD_FAILURE: HRESULT = 0x800C0008; +pub const INET_E_AUTHENTICATION_REQUIRED: HRESULT = 0x800C0009; +pub const INET_E_NO_VALID_MEDIA: HRESULT = 0x800C000A; +pub const INET_E_CONNECTION_TIMEOUT: HRESULT = 0x800C000B; +pub const INET_E_INVALID_REQUEST: HRESULT = 0x800C000C; +pub const INET_E_UNKNOWN_PROTOCOL: HRESULT = 0x800C000D; +pub const INET_E_SECURITY_PROBLEM: HRESULT = 0x800C000E; +pub const INET_E_CANNOT_LOAD_DATA: HRESULT = 0x800C000F; +pub const INET_E_CANNOT_INSTANTIATE_OBJECT: HRESULT = 0x800C0010; +pub const INET_E_INVALID_CERTIFICATE: HRESULT = 0x800C0019; +pub const INET_E_REDIRECT_FAILED: HRESULT = 0x800C0014; +pub const INET_E_REDIRECT_TO_DIR: HRESULT = 0x800C0015; +pub const ERROR_DBG_CREATE_PROCESS_FAILURE_LOCKDOWN: HRESULT = 0x80B00001; +pub const ERROR_DBG_ATTACH_PROCESS_FAILURE_LOCKDOWN: HRESULT = 0x80B00002; +pub const ERROR_DBG_CONNECT_SERVER_FAILURE_LOCKDOWN: HRESULT = 0x80B00003; +pub const ERROR_DBG_START_SERVER_FAILURE_LOCKDOWN: HRESULT = 0x80B00004; +pub const ERROR_IO_PREEMPTED: HRESULT = 0x89010001; +pub const JSCRIPT_E_CANTEXECUTE: HRESULT = 0x89020001; +pub const WEP_E_NOT_PROVISIONED_ON_ALL_VOLUMES: HRESULT = 0x88010001; +pub const WEP_E_FIXED_DATA_NOT_SUPPORTED: HRESULT = 0x88010002; +pub const WEP_E_HARDWARE_NOT_COMPLIANT: HRESULT = 0x88010003; +pub const WEP_E_LOCK_NOT_CONFIGURED: HRESULT = 0x88010004; +pub const WEP_E_PROTECTION_SUSPENDED: HRESULT = 0x88010005; +pub const WEP_E_NO_LICENSE: HRESULT = 0x88010006; +pub const WEP_E_OS_NOT_PROTECTED: HRESULT = 0x88010007; +pub const WEP_E_UNEXPECTED_FAIL: HRESULT = 0x88010008; +pub const WEP_E_BUFFER_TOO_LARGE: HRESULT = 0x88010009; +pub const ERROR_SVHDX_ERROR_STORED: HRESULT = 0xC05C0000; +pub const ERROR_SVHDX_ERROR_NOT_AVAILABLE: HRESULT = 0xC05CFF00; +pub const ERROR_SVHDX_UNIT_ATTENTION_AVAILABLE: HRESULT = 0xC05CFF01; +pub const ERROR_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED: HRESULT = 0xC05CFF02; +pub const ERROR_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED: HRESULT = 0xC05CFF03; +pub const ERROR_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED: HRESULT = 0xC05CFF04; +pub const ERROR_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED: HRESULT = 0xC05CFF05; +pub const ERROR_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED: HRESULT + = 0xC05CFF06; +pub const ERROR_SVHDX_RESERVATION_CONFLICT: HRESULT = 0xC05CFF07; +pub const ERROR_SVHDX_WRONG_FILE_TYPE: HRESULT = 0xC05CFF08; +pub const ERROR_SVHDX_VERSION_MISMATCH: HRESULT = 0xC05CFF09; +pub const ERROR_VHD_SHARED: HRESULT = 0xC05CFF0A; +pub const WININET_E_OUT_OF_HANDLES: HRESULT = 0x80072EE1; +pub const WININET_E_TIMEOUT: HRESULT = 0x80072EE2; +pub const WININET_E_EXTENDED_ERROR: HRESULT = 0x80072EE3; +pub const WININET_E_INTERNAL_ERROR: HRESULT = 0x80072EE4; +pub const WININET_E_INVALID_URL: HRESULT = 0x80072EE5; +pub const WININET_E_UNRECOGNIZED_SCHEME: HRESULT = 0x80072EE6; +pub const WININET_E_NAME_NOT_RESOLVED: HRESULT = 0x80072EE7; +pub const WININET_E_PROTOCOL_NOT_FOUND: HRESULT = 0x80072EE8; +pub const WININET_E_INVALID_OPTION: HRESULT = 0x80072EE9; +pub const WININET_E_BAD_OPTION_LENGTH: HRESULT = 0x80072EEA; +pub const WININET_E_OPTION_NOT_SETTABLE: HRESULT = 0x80072EEB; +pub const WININET_E_SHUTDOWN: HRESULT = 0x80072EEC; +pub const WININET_E_INCORRECT_USER_NAME: HRESULT = 0x80072EED; +pub const WININET_E_INCORRECT_PASSWORD: HRESULT = 0x80072EEE; +pub const WININET_E_LOGIN_FAILURE: HRESULT = 0x80072EEF; +pub const WININET_E_INVALID_OPERATION: HRESULT = 0x80072EF0; +pub const WININET_E_OPERATION_CANCELLED: HRESULT = 0x80072EF1; +pub const WININET_E_INCORRECT_HANDLE_TYPE: HRESULT = 0x80072EF2; +pub const WININET_E_INCORRECT_HANDLE_STATE: HRESULT = 0x80072EF3; +pub const WININET_E_NOT_PROXY_REQUEST: HRESULT = 0x80072EF4; +pub const WININET_E_REGISTRY_VALUE_NOT_FOUND: HRESULT = 0x80072EF5; +pub const WININET_E_BAD_REGISTRY_PARAMETER: HRESULT = 0x80072EF6; +pub const WININET_E_NO_DIRECT_ACCESS: HRESULT = 0x80072EF7; +pub const WININET_E_NO_CONTEXT: HRESULT = 0x80072EF8; +pub const WININET_E_NO_CALLBACK: HRESULT = 0x80072EF9; +pub const WININET_E_REQUEST_PENDING: HRESULT = 0x80072EFA; +pub const WININET_E_INCORRECT_FORMAT: HRESULT = 0x80072EFB; +pub const WININET_E_ITEM_NOT_FOUND: HRESULT = 0x80072EFC; +pub const WININET_E_CANNOT_CONNECT: HRESULT = 0x80072EFD; +pub const WININET_E_CONNECTION_ABORTED: HRESULT = 0x80072EFE; +pub const WININET_E_CONNECTION_RESET: HRESULT = 0x80072EFF; +pub const WININET_E_FORCE_RETRY: HRESULT = 0x80072F00; +pub const WININET_E_INVALID_PROXY_REQUEST: HRESULT = 0x80072F01; +pub const WININET_E_NEED_UI: HRESULT = 0x80072F02; +pub const WININET_E_HANDLE_EXISTS: HRESULT = 0x80072F04; +pub const WININET_E_SEC_CERT_DATE_INVALID: HRESULT = 0x80072F05; +pub const WININET_E_SEC_CERT_CN_INVALID: HRESULT = 0x80072F06; +pub const WININET_E_HTTP_TO_HTTPS_ON_REDIR: HRESULT = 0x80072F07; +pub const WININET_E_HTTPS_TO_HTTP_ON_REDIR: HRESULT = 0x80072F08; +pub const WININET_E_MIXED_SECURITY: HRESULT = 0x80072F09; +pub const WININET_E_CHG_POST_IS_NON_SECURE: HRESULT = 0x80072F0A; +pub const WININET_E_POST_IS_NON_SECURE: HRESULT = 0x80072F0B; +pub const WININET_E_CLIENT_AUTH_CERT_NEEDED: HRESULT = 0x80072F0C; +pub const WININET_E_INVALID_CA: HRESULT = 0x80072F0D; +pub const WININET_E_CLIENT_AUTH_NOT_SETUP: HRESULT = 0x80072F0E; +pub const WININET_E_ASYNC_THREAD_FAILED: HRESULT = 0x80072F0F; +pub const WININET_E_REDIRECT_SCHEME_CHANGE: HRESULT = 0x80072F10; +pub const WININET_E_DIALOG_PENDING: HRESULT = 0x80072F11; +pub const WININET_E_RETRY_DIALOG: HRESULT = 0x80072F12; +pub const WININET_E_NO_NEW_CONTAINERS: HRESULT = 0x80072F13; +pub const WININET_E_HTTPS_HTTP_SUBMIT_REDIR: HRESULT = 0x80072F14; +pub const WININET_E_SEC_CERT_ERRORS: HRESULT = 0x80072F17; +pub const WININET_E_SEC_CERT_REV_FAILED: HRESULT = 0x80072F19; +pub const WININET_E_HEADER_NOT_FOUND: HRESULT = 0x80072F76; +pub const WININET_E_DOWNLEVEL_SERVER: HRESULT = 0x80072F77; +pub const WININET_E_INVALID_SERVER_RESPONSE: HRESULT = 0x80072F78; +pub const WININET_E_INVALID_HEADER: HRESULT = 0x80072F79; +pub const WININET_E_INVALID_QUERY_REQUEST: HRESULT = 0x80072F7A; +pub const WININET_E_HEADER_ALREADY_EXISTS: HRESULT = 0x80072F7B; +pub const WININET_E_REDIRECT_FAILED: HRESULT = 0x80072F7C; +pub const WININET_E_SECURITY_CHANNEL_ERROR: HRESULT = 0x80072F7D; +pub const WININET_E_UNABLE_TO_CACHE_FILE: HRESULT = 0x80072F7E; +pub const WININET_E_TCPIP_NOT_INSTALLED: HRESULT = 0x80072F7F; +pub const WININET_E_DISCONNECTED: HRESULT = 0x80072F83; +pub const WININET_E_SERVER_UNREACHABLE: HRESULT = 0x80072F84; +pub const WININET_E_PROXY_SERVER_UNREACHABLE: HRESULT = 0x80072F85; +pub const WININET_E_BAD_AUTO_PROXY_SCRIPT: HRESULT = 0x80072F86; +pub const WININET_E_UNABLE_TO_DOWNLOAD_SCRIPT: HRESULT = 0x80072F87; +pub const WININET_E_SEC_INVALID_CERT: HRESULT = 0x80072F89; +pub const WININET_E_SEC_CERT_REVOKED: HRESULT = 0x80072F8A; +pub const WININET_E_FAILED_DUETOSECURITYCHECK: HRESULT = 0x80072F8B; +pub const WININET_E_NOT_INITIALIZED: HRESULT = 0x80072F8C; +pub const WININET_E_LOGIN_FAILURE_DISPLAY_ENTITY_BODY: HRESULT = 0x80072F8E; +pub const WININET_E_DECODING_FAILED: HRESULT = 0x80072F8F; +pub const WININET_E_NOT_REDIRECTED: HRESULT = 0x80072F80; +pub const WININET_E_COOKIE_NEEDS_CONFIRMATION: HRESULT = 0x80072F81; +pub const WININET_E_COOKIE_DECLINED: HRESULT = 0x80072F82; +pub const WININET_E_REDIRECT_NEEDS_CONFIRMATION: HRESULT = 0x80072F88; diff --git a/bash-5.1/vendor/winapi/src/shared/winusbio.rs b/bash-5.1/vendor/winapi/src/shared/winusbio.rs new file mode 100644 index 0000000000000000000000000000000000000000..8006943336838f3b30829fcf179ce43cd79dd40f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/winusbio.rs @@ -0,0 +1,38 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Public header for WINUSB +use shared::minwindef::{UCHAR, ULONG, USHORT}; +use shared::usb::USBD_PIPE_TYPE; +pub const SHORT_PACKET_TERMINATE: ULONG = 0x01; +pub const AUTO_CLEAR_STALL: ULONG = 0x02; +pub const PIPE_TRANSFER_TIMEOUT: ULONG = 0x03; +pub const IGNORE_SHORT_PACKETS: ULONG = 0x04; +pub const ALLOW_PARTIAL_READS: ULONG = 0x05; +pub const AUTO_FLUSH: ULONG = 0x06; +pub const RAW_IO: ULONG = 0x07; +pub const MAXIMUM_TRANSFER_SIZE: ULONG = 0x08; +pub const RESET_PIPE_ON_RESUME: ULONG = 0x09; +pub const DEVICE_SPEED: ULONG = 0x01; +pub const LowSpeed: ULONG = 0x01; +pub const FullSpeed: ULONG = 0x02; +pub const HighSpeed: ULONG = 0x03; +DEFINE_GUID!{WinUSB_TestGuid, + 0xda812bff, 0x12c3, 0x46a2, 0x8e, 0x2b, 0xdb, 0xd3, 0xb7, 0x83, 0x4c, 0x43} +STRUCT!{struct WINUSB_PIPE_INFORMATION { + PipeType: USBD_PIPE_TYPE, + PipeId: UCHAR, + MaximumPacketSize: USHORT, + Interval: UCHAR, +}} +pub type PWINUSB_PIPE_INFORMATION = *mut WINUSB_PIPE_INFORMATION; +STRUCT!{struct WINUSB_PIPE_INFORMATION_EX { + PipeType: USBD_PIPE_TYPE, + PipeId: UCHAR, + MaximumPacketSize: USHORT, + Interval: UCHAR, + MaximumBytesPerInterval: ULONG, +}} +pub type PWINUSB_PIPE_INFORMATION_EX = *mut WINUSB_PIPE_INFORMATION_EX; diff --git a/bash-5.1/vendor/winapi/src/shared/wlantypes.rs b/bash-5.1/vendor/winapi/src/shared/wlantypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..a9e9c665aaa15737e396e99bec37bb646bb4b789 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/wlantypes.rs @@ -0,0 +1,78 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Structures used to hold wlan information. +use shared::basetsd::UINT8; +use shared::minwindef::{UCHAR, ULONG, USHORT}; +ENUM!{enum DOT11_BSS_TYPE { + dot11_BSS_type_infrastructure = 1, + dot11_BSS_type_independent = 2, + dot11_BSS_type_any = 3, +}} +pub type PDOT11_BSS_TYPE = *mut DOT11_BSS_TYPE; +pub const DOT11_SSID_MAX_LENGTH: usize = 32; +STRUCT!{struct DOT11_SSID { + uSSIDLength: ULONG, + ucSSID: [UCHAR; DOT11_SSID_MAX_LENGTH], +}} +pub type PDOT11_SSID = *mut DOT11_SSID; +ENUM!{enum DOT11_AUTH_ALGORITHM { + DOT11_AUTH_ALGO_80211_OPEN = 1, + DOT11_AUTH_ALGO_80211_SHARED_KEY = 2, + DOT11_AUTH_ALGO_WPA = 3, + DOT11_AUTH_ALGO_WPA_PSK = 4, + DOT11_AUTH_ALGO_WPA_NONE = 5, + DOT11_AUTH_ALGO_RSNA = 6, + DOT11_AUTH_ALGO_RSNA_PSK = 7, + DOT11_AUTH_ALGO_IHV_START = 0x80000000, + DOT11_AUTH_ALGO_IHV_END = 0xffffffff, +}} +pub type PDOT11_AUTH_ALGORITHM = *mut DOT11_AUTH_ALGORITHM; +pub const DOT11_AUTH_ALGORITHM_OPEN_SYSTEM: DOT11_AUTH_ALGORITHM = DOT11_AUTH_ALGO_80211_OPEN; +pub const DOT11_AUTH_ALGORITHM_SHARED_KEY: DOT11_AUTH_ALGORITHM = DOT11_AUTH_ALGO_80211_SHARED_KEY; +pub const DOT11_AUTH_ALGORITHM_WPA: DOT11_AUTH_ALGORITHM = DOT11_AUTH_ALGO_WPA; +pub const DOT11_AUTH_ALGORITHM_WPA_PSK: DOT11_AUTH_ALGORITHM = DOT11_AUTH_ALGO_WPA_PSK; +pub const DOT11_AUTH_ALGORITHM_WPA_NONE: DOT11_AUTH_ALGORITHM = DOT11_AUTH_ALGO_WPA_NONE; +pub const DOT11_AUTH_ALGORITHM_RSNA: DOT11_AUTH_ALGORITHM = DOT11_AUTH_ALGO_RSNA; +pub const DOT11_AUTH_ALGORITHM_RSNA_PSK: DOT11_AUTH_ALGORITHM = DOT11_AUTH_ALGO_RSNA_PSK; +ENUM!{enum DOT11_CIPHER_ALGORITHM { + DOT11_CIPHER_ALGO_NONE = 0x00, + DOT11_CIPHER_ALGO_WEP40 = 0x01, + DOT11_CIPHER_ALGO_TKIP = 0x02, + DOT11_CIPHER_ALGO_CCMP = 0x04, + DOT11_CIPHER_ALGO_WEP104 = 0x05, + DOT11_CIPHER_ALGO_BIP = 0x06, + DOT11_CIPHER_ALGO_GCMP = 0x08, + DOT11_CIPHER_ALGO_WPA_USE_GROUP = 0x100, + DOT11_CIPHER_ALGO_WEP = 0x101, + DOT11_CIPHER_ALGO_IHV_START = 0x80000000, + DOT11_CIPHER_ALGO_IHV_END = 0xffffffff, +}} +pub type PDOT11_CIPHER_ALGORITHM = *mut DOT11_CIPHER_ALGORITHM; +STRUCT!{struct DOT11_AUTH_CIPHER_PAIR { + AuthAlgoId: DOT11_AUTH_ALGORITHM, + CipherAlgoId: DOT11_CIPHER_ALGORITHM, +}} +pub type PDOT11_AUTH_CIPHER_PAIR = *mut DOT11_AUTH_CIPHER_PAIR; +pub const DOT11_OI_MAX_LENGTH: usize = 5; +pub const DOT11_OI_MIN_LENGTH: usize = 3; +STRUCT!{struct DOT11_OI { + OILength: USHORT, + OI: [UCHAR; DOT11_OI_MAX_LENGTH], +}} +pub type PDOT11_OI = *mut DOT11_OI; +STRUCT!{struct DOT11_ACCESSNETWORKOPTIONS { + AccessNetworkType: UINT8, + Internet: UINT8, + ASRA: UINT8, + ESR: UINT8, + UESA: UINT8, +}} +pub type PDOT11_ACCESSNETWORKOPTIONS = *mut DOT11_ACCESSNETWORKOPTIONS; +STRUCT!{struct DOT11_VENUEINFO { + VenueGroup: UINT8, + VenueType: UINT8, +}} +pub type PDOT11_VENUEINFO = *mut DOT11_VENUEINFO; diff --git a/bash-5.1/vendor/winapi/src/shared/wmistr.rs b/bash-5.1/vendor/winapi/src/shared/wmistr.rs new file mode 100644 index 0000000000000000000000000000000000000000..35374e92bd6640cfea066c2038d20ed0b58f9c96 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/wmistr.rs @@ -0,0 +1,199 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{ULONG64, ULONG_PTR}; +use shared::guiddef::GUID; +use shared::minwindef::{UCHAR, ULONG}; +use um::winnt::{HANDLE, LARGE_INTEGER, STANDARD_RIGHTS_READ, SYNCHRONIZE, WCHAR}; +STRUCT!{struct WNODE_HEADER_u1_s { + Version: ULONG, + Linkage: ULONG, +}} +UNION!{union WNODE_HEADER_u1 { + [u64; 1], + HistoricalContext HistoricalContext_mut: ULONG64, + s s_mut: WNODE_HEADER_u1_s, +}} +UNION!{union WNODE_HEADER_u2 { + [u64; 1], + CountLost CountLost_mut: ULONG, + KernelHandle KernelHandle_mut: HANDLE, + TimeStamp TimeStamp_mut: LARGE_INTEGER, +}} +STRUCT!{struct WNODE_HEADER { + BufferSize: ULONG, + ProviderId: ULONG, + u1: WNODE_HEADER_u1, + u2: WNODE_HEADER_u2, + Guid: GUID, + ClientContext: ULONG, + Flags: ULONG, +}} +pub type PWNODE_HEADER = *mut WNODE_HEADER; +pub const WNODE_FLAG_ALL_DATA: ULONG = 0x00000001; +pub const WNODE_FLAG_SINGLE_INSTANCE: ULONG = 0x00000002; +pub const WNODE_FLAG_SINGLE_ITEM: ULONG = 0x00000004; +pub const WNODE_FLAG_EVENT_ITEM: ULONG = 0x00000008; +pub const WNODE_FLAG_FIXED_INSTANCE_SIZE: ULONG = 0x00000010; +pub const WNODE_FLAG_TOO_SMALL: ULONG = 0x00000020; +pub const WNODE_FLAG_INSTANCES_SAME: ULONG = 0x00000040; +pub const WNODE_FLAG_STATIC_INSTANCE_NAMES: ULONG = 0x00000080; +pub const WNODE_FLAG_INTERNAL: ULONG = 0x00000100; +pub const WNODE_FLAG_USE_TIMESTAMP: ULONG = 0x00000200; +pub const WNODE_FLAG_PERSIST_EVENT: ULONG = 0x00000400; +pub const WNODE_FLAG_EVENT_REFERENCE: ULONG = 0x00002000; +pub const WNODE_FLAG_ANSI_INSTANCENAMES: ULONG = 0x00004000; +pub const WNODE_FLAG_METHOD_ITEM: ULONG = 0x00008000; +pub const WNODE_FLAG_PDO_INSTANCE_NAMES: ULONG = 0x00010000; +pub const WNODE_FLAG_TRACED_GUID: ULONG = 0x00020000; +pub const WNODE_FLAG_LOG_WNODE: ULONG = 0x00040000; +pub const WNODE_FLAG_USE_GUID_PTR: ULONG = 0x00080000; +pub const WNODE_FLAG_USE_MOF_PTR: ULONG = 0x00100000; +pub const WNODE_FLAG_NO_HEADER: ULONG = 0x00200000; +pub const WNODE_FLAG_SEND_DATA_BLOCK: ULONG = 0x00400000; +pub const WNODE_FLAG_VERSIONED_PROPERTIES: ULONG = 0x00800000; +pub const WNODE_FLAG_SEVERITY_MASK: ULONG = 0xff000000; +STRUCT!{struct OFFSETINSTANCEDATAANDLENGTH { + OffsetInstanceData: ULONG, + LengthInstanceData: ULONG, +}} +pub type POFFSETINSTANCEDATAANDLENGTH = *mut OFFSETINSTANCEDATAANDLENGTH; +UNION!{union WNODE_ALL_DATA_u { + [u32; 2], + FixedInstanceSize FixedInstanceSize_mut: ULONG, + OffsetInstanceDataAndLength OffsetInstanceDataAndLength_mut: + [OFFSETINSTANCEDATAANDLENGTH; 0], +}} +STRUCT!{struct WNODE_ALL_DATA { + WnodeHeader: WNODE_HEADER, + DataBlockOffset: ULONG, + InstanceCount: ULONG, + OffsetInstanceNameOffsets: ULONG, + u: WNODE_ALL_DATA_u, +}} +pub type PWNODE_ALL_DATA = *mut WNODE_ALL_DATA; +STRUCT!{struct WNODE_SINGLE_INSTANCE { + WnodeHeader: WNODE_HEADER, + OffsetInstanceName: ULONG, + InstanceIndex: ULONG, + DataBlockOffset: ULONG, + SizeDataBlock: ULONG, + VariableData: [UCHAR; 0], +}} +pub type PWNODE_SINGLE_INSTANCE = *mut WNODE_SINGLE_INSTANCE; +STRUCT!{struct WNODE_SINGLE_ITEM { + WnodeHeader: WNODE_HEADER, + OffsetInstanceName: ULONG, + InstanceIndex: ULONG, + ItemId: ULONG, + DataBlockOffset: ULONG, + SizeDataItem: ULONG, + VariableData: [UCHAR; 0], +}} +pub type PWNODE_SINGLE_ITEM = *mut WNODE_SINGLE_ITEM; +STRUCT!{struct WNODE_METHOD_ITEM { + WnodeHeader: WNODE_HEADER, + OffsetInstanceName: ULONG, + InstanceIndex: ULONG, + MethodId: ULONG, + DataBlockOffset: ULONG, + SizeDataBlock: ULONG, + VariableData: [UCHAR; 0], +}} +pub type PWNODE_METHOD_ITEM = *mut WNODE_METHOD_ITEM; +STRUCT!{struct WNODE_EVENT_ITEM { + WnodeHeader: WNODE_HEADER, +}} +pub type PWNODE_EVENT_ITEM = *mut WNODE_EVENT_ITEM; +UNION!{union WNODE_EVENT_REFERENCE_u { + [u32; 1], + TargetInstanceIndex TargetInstanceIndex_mut: ULONG, + TargetInstanceName TargetInstanceName_mut: [WCHAR; 0], +}} +STRUCT!{struct WNODE_EVENT_REFERENCE { + WnodeHeader: WNODE_HEADER, + TargetGuid: GUID, + TargetDataBlockSize: ULONG, + u: WNODE_EVENT_REFERENCE_u, +}} +pub type PWNODE_EVENT_REFERENCE = *mut WNODE_EVENT_REFERENCE; +STRUCT!{struct WNODE_TOO_SMALL { + WnodeHeader: WNODE_HEADER, + SizeNeeded: ULONG, +}} +pub type PWNODE_TOO_SMALL = *mut WNODE_TOO_SMALL; +UNION!{union WMIREGGUIDW_u { + [usize; 1], + InstanceNameList InstanceNameList_mut: ULONG, + BaseNameOffset BaseNameOffset_mut: ULONG, + Pdo Pdo_mut: ULONG_PTR, + InstanceInfo InstanceInfo_mut: ULONG_PTR, +}} +STRUCT!{struct WMIREGGUIDW { + Guid: GUID, + Flags: ULONG, + InstanceCount: ULONG, + u: WMIREGGUIDW_u, +}} +pub type PWMIREGGUIDW = *mut WMIREGGUIDW; +pub const WMIREG_FLAG_EXPENSIVE: ULONG = 0x00000001; +pub const WMIREG_FLAG_INSTANCE_LIST: ULONG = 0x00000004; +pub const WMIREG_FLAG_INSTANCE_BASENAME: ULONG = 0x00000008; +pub const WMIREG_FLAG_INSTANCE_PDO: ULONG = 0x00000020; +pub const WMIREG_FLAG_REMOVE_GUID: ULONG = 0x00010000; +pub const WMIREG_FLAG_RESERVED1: ULONG = 0x00020000; +pub const WMIREG_FLAG_RESERVED2: ULONG = 0x00040000; +pub const WMIREG_FLAG_TRACED_GUID: ULONG = 0x00080000; +pub const WMIREG_FLAG_TRACE_CONTROL_GUID: ULONG = 0x00001000; +pub const WMIREG_FLAG_EVENT_ONLY_GUID: ULONG = 0x00000040; +STRUCT!{struct WMIREGINFOW { + BufferSize: ULONG, + NextWmiRegInfo: ULONG, + RegistryPath: ULONG, + MofResourceName: ULONG, + GuidGount: ULONG, + WmiRegGuid: [WMIREGGUIDW; 0], +}} +pub type PWMIREGINFOW = *mut WMIREGINFOW; +ENUM!{enum WMIDPREQUESTCODE { + WMI_GET_ALL_DATA = 0, + WMI_GET_SINGLE_INSTANCE = 1, + WMI_SET_SINGLE_INSTANCE = 2, + WMI_SET_SINGLE_ITEM = 3, + WMI_ENABLE_EVENTS = 4, + WMI_DISABLE_EVENTS = 5, + WMI_ENABLE_COLLECTION = 6, + WMI_DISABLE_COLLECTION = 7, + WMI_REGINFO = 8, + WMI_EXECUTE_METHOD = 9, + WMI_CAPTURE_STATE = 10, +}} +pub const WMI_GUIDTYPE_TRACECONTROL: ULONG = 0; +pub const WMI_GUIDTYPE_TRACE: ULONG = 1; +pub const WMI_GUIDTYPE_DATA: ULONG = 2; +pub const WMI_GUIDTYPE_EVENT: ULONG = 3; +pub const WMIGUID_QUERY: ULONG = 0x0001; +pub const WMIGUID_SET: ULONG = 0x0002; +pub const WMIGUID_NOTIFICATION: ULONG = 0x0004; +pub const WMIGUID_READ_DESCRIPTION: ULONG = 0x0008; +pub const WMIGUID_EXECUTE: ULONG = 0x0010; +pub const TRACELOG_CREATE_REALTIME: ULONG = 0x0020; +pub const TRACELOG_CREATE_ONDISK: ULONG = 0x0040; +pub const TRACELOG_GUID_ENABLE: ULONG = 0x0080; +pub const TRACELOG_ACCESS_KERNEL_LOGGER: ULONG = 0x0100; +pub const TRACELOG_LOG_EVENT: ULONG = 0x0200; +pub const TRACELOG_CREATE_INPROC: ULONG = 0x0200; +pub const TRACELOG_ACCESS_REALTIME: ULONG = 0x0400; +pub const TRACELOG_REGISTER_GUIDS: ULONG = 0x0800; +pub const TRACELOG_JOIN_GROUP: ULONG = 0x1000; +pub const WMIGUID_ALL_ACCESS_WIN2K: ULONG = STANDARD_RIGHTS_READ | WMIGUID_QUERY | WMIGUID_SET + | WMIGUID_NOTIFICATION | WMIGUID_READ_DESCRIPTION | WMIGUID_EXECUTE | TRACELOG_CREATE_REALTIME + | TRACELOG_CREATE_ONDISK | TRACELOG_GUID_ENABLE | TRACELOG_ACCESS_KERNEL_LOGGER + | TRACELOG_CREATE_INPROC | TRACELOG_ACCESS_REALTIME; +pub const WMIGUID_ALL_ACCESS_WINXP: ULONG = WMIGUID_ALL_ACCESS_WIN2K | SYNCHRONIZE + | TRACELOG_REGISTER_GUIDS; +pub const WMIGUID_ALL_ACCESS_RS1: ULONG = WMIGUID_ALL_ACCESS_WINXP | TRACELOG_JOIN_GROUP; +pub const WMIGUID_ALL_ACCESS: ULONG = WMIGUID_ALL_ACCESS_RS1; +pub const WMI_GLOBAL_LOGGER_ID: ULONG = 0x0001; diff --git a/bash-5.1/vendor/winapi/src/shared/wnnc.rs b/bash-5.1/vendor/winapi/src/shared/wnnc.rs new file mode 100644 index 0000000000000000000000000000000000000000..305137c582dcad2eb5221cad7499be0a55d1fd7d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/wnnc.rs @@ -0,0 +1,77 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Provides the Windows Networking WNNC_NET definitions to winnetwk.h and the IFS Kit. +use shared::minwindef::DWORD; +pub const WNNC_NET_MSNET: DWORD = 0x00010000; +pub const WNNC_NET_SMB: DWORD = 0x00020000; +pub const WNNC_NET_NETWARE: DWORD = 0x00030000; +pub const WNNC_NET_VINES: DWORD = 0x00040000; +pub const WNNC_NET_10NET: DWORD = 0x00050000; +pub const WNNC_NET_LOCUS: DWORD = 0x00060000; +pub const WNNC_NET_SUN_PC_NFS: DWORD = 0x00070000; +pub const WNNC_NET_LANSTEP: DWORD = 0x00080000; +pub const WNNC_NET_9TILES: DWORD = 0x00090000; +pub const WNNC_NET_LANTASTIC: DWORD = 0x000A0000; +pub const WNNC_NET_AS400: DWORD = 0x000B0000; +pub const WNNC_NET_FTP_NFS: DWORD = 0x000C0000; +pub const WNNC_NET_PATHWORKS: DWORD = 0x000D0000; +pub const WNNC_NET_LIFENET: DWORD = 0x000E0000; +pub const WNNC_NET_POWERLAN: DWORD = 0x000F0000; +pub const WNNC_NET_BWNFS: DWORD = 0x00100000; +pub const WNNC_NET_COGENT: DWORD = 0x00110000; +pub const WNNC_NET_FARALLON: DWORD = 0x00120000; +pub const WNNC_NET_APPLETALK: DWORD = 0x00130000; +pub const WNNC_NET_INTERGRAPH: DWORD = 0x00140000; +pub const WNNC_NET_SYMFONET: DWORD = 0x00150000; +pub const WNNC_NET_CLEARCASE: DWORD = 0x00160000; +pub const WNNC_NET_FRONTIER: DWORD = 0x00170000; +pub const WNNC_NET_BMC: DWORD = 0x00180000; +pub const WNNC_NET_DCE: DWORD = 0x00190000; +pub const WNNC_NET_AVID: DWORD = 0x001A0000; +pub const WNNC_NET_DOCUSPACE: DWORD = 0x001B0000; +pub const WNNC_NET_MANGOSOFT: DWORD = 0x001C0000; +pub const WNNC_NET_SERNET: DWORD = 0x001D0000; +pub const WNNC_NET_RIVERFRONT1: DWORD = 0x001E0000; +pub const WNNC_NET_RIVERFRONT2: DWORD = 0x001F0000; +pub const WNNC_NET_DECORB: DWORD = 0x00200000; +pub const WNNC_NET_PROTSTOR: DWORD = 0x00210000; +pub const WNNC_NET_FJ_REDIR: DWORD = 0x00220000; +pub const WNNC_NET_DISTINCT: DWORD = 0x00230000; +pub const WNNC_NET_TWINS: DWORD = 0x00240000; +pub const WNNC_NET_RDR2SAMPLE: DWORD = 0x00250000; +pub const WNNC_NET_CSC: DWORD = 0x00260000; +pub const WNNC_NET_3IN1: DWORD = 0x00270000; +pub const WNNC_NET_EXTENDNET: DWORD = 0x00290000; +pub const WNNC_NET_STAC: DWORD = 0x002A0000; +pub const WNNC_NET_FOXBAT: DWORD = 0x002B0000; +pub const WNNC_NET_YAHOO: DWORD = 0x002C0000; +pub const WNNC_NET_EXIFS: DWORD = 0x002D0000; +pub const WNNC_NET_DAV: DWORD = 0x002E0000; +pub const WNNC_NET_KNOWARE: DWORD = 0x002F0000; +pub const WNNC_NET_OBJECT_DIRE: DWORD = 0x00300000; +pub const WNNC_NET_MASFAX: DWORD = 0x00310000; +pub const WNNC_NET_HOB_NFS: DWORD = 0x00320000; +pub const WNNC_NET_SHIVA: DWORD = 0x00330000; +pub const WNNC_NET_IBMAL: DWORD = 0x00340000; +pub const WNNC_NET_LOCK: DWORD = 0x00350000; +pub const WNNC_NET_TERMSRV: DWORD = 0x00360000; +pub const WNNC_NET_SRT: DWORD = 0x00370000; +pub const WNNC_NET_QUINCY: DWORD = 0x00380000; +pub const WNNC_NET_OPENAFS: DWORD = 0x00390000; +pub const WNNC_NET_AVID1: DWORD = 0x003A0000; +pub const WNNC_NET_DFS: DWORD = 0x003B0000; +pub const WNNC_NET_KWNP: DWORD = 0x003C0000; +pub const WNNC_NET_ZENWORKS: DWORD = 0x003D0000; +pub const WNNC_NET_DRIVEONWEB: DWORD = 0x003E0000; +pub const WNNC_NET_VMWARE: DWORD = 0x003F0000; +pub const WNNC_NET_RSFX: DWORD = 0x00400000; +pub const WNNC_NET_MFILES: DWORD = 0x00410000; +pub const WNNC_NET_MS_NFS: DWORD = 0x00420000; +pub const WNNC_NET_GOOGLE: DWORD = 0x00430000; +pub const WNNC_NET_NDFS: DWORD = 0x00440000; +pub const WNNC_NET_DOCUSHARE: DWORD = 0x00450000; +pub const WNNC_CRED_MANAGER: DWORD = 0xFFFF0000; +pub const WNNC_NET_LANMAN: DWORD = WNNC_NET_SMB; diff --git a/bash-5.1/vendor/winapi/src/shared/ws2def.rs b/bash-5.1/vendor/winapi/src/shared/ws2def.rs new file mode 100644 index 0000000000000000000000000000000000000000..484f6d4a6c9838f4f278215e528b426b9aea1724 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ws2def.rs @@ -0,0 +1,556 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Core definitions for the Winsock2 specification +use ctypes::{__int64, c_char, c_int, c_long, c_short, c_void}; +use shared::basetsd::SIZE_T; +use shared::guiddef::LPGUID; +use shared::inaddr::IN_ADDR; +use shared::minwindef::{DWORD, INT, UCHAR, ULONG, USHORT}; +use um::winnt::{CHAR, HANDLE, LONG, PROCESSOR_NUMBER, PWSTR}; +use vc::vcruntime::size_t; +pub type ADDRESS_FAMILY = USHORT; +pub const AF_UNSPEC: c_int = 0; +pub const AF_UNIX: c_int = 1; +pub const AF_INET: c_int = 2; +pub const AF_IMPLINK: c_int = 3; +pub const AF_PUP: c_int = 4; +pub const AF_CHAOS: c_int = 5; +pub const AF_NS: c_int = 6; +pub const AF_IPX: c_int = AF_NS; +pub const AF_ISO: c_int = 7; +pub const AF_OSI: c_int = AF_ISO; +pub const AF_ECMA: c_int = 8; +pub const AF_DATAKIT: c_int = 9; +pub const AF_CCITT: c_int = 10; +pub const AF_SNA: c_int = 11; +pub const AF_DECnet: c_int = 12; +pub const AF_DLI: c_int = 13; +pub const AF_LAT: c_int = 14; +pub const AF_HYLINK: c_int = 15; +pub const AF_APPLETALK: c_int = 16; +pub const AF_NETBIOS: c_int = 17; +pub const AF_VOICEVIEW: c_int = 18; +pub const AF_FIREFOX: c_int = 19; +pub const AF_UNKNOWN1: c_int = 20; +pub const AF_BAN: c_int = 21; +pub const AF_ATM: c_int = 22; +pub const AF_INET6: c_int = 23; +pub const AF_CLUSTER: c_int = 24; +pub const AF_12844: c_int = 25; +pub const AF_IRDA: c_int = 26; +pub const AF_NETDES: c_int = 28; +pub const AF_TCNPROCESS: c_int = 29; +pub const AF_TCNMESSAGE: c_int = 30; +pub const AF_ICLFXBM: c_int = 31; +pub const AF_BTH: c_int = 32; +pub const AF_LINK: c_int = 33; +pub const AF_HYPERV: c_int = 34; +pub const AF_MAX: c_int = 35; +pub const SOCK_STREAM: c_int = 1; +pub const SOCK_DGRAM: c_int = 2; +pub const SOCK_RAW: c_int = 3; +pub const SOCK_RDM: c_int = 4; +pub const SOCK_SEQPACKET: c_int = 5; +pub const SOL_SOCKET: c_int = 0xffff; +pub const SO_DEBUG: c_int = 0x0001; +pub const SO_ACCEPTCONN: c_int = 0x0002; +pub const SO_REUSEADDR: c_int = 0x0004; +pub const SO_KEEPALIVE: c_int = 0x0008; +pub const SO_DONTROUTE: c_int = 0x0010; +pub const SO_BROADCAST: c_int = 0x0020; +pub const SO_USELOOPBACK: c_int = 0x0040; +pub const SO_LINGER: c_int = 0x0080; +pub const SO_OOBINLINE: c_int = 0x0100; +pub const SO_DONTLINGER: c_int = !SO_LINGER; +pub const SO_EXCLUSIVEADDRUSE: c_int = !SO_REUSEADDR; +pub const SO_SNDBUF: c_int = 0x1001; +pub const SO_RCVBUF: c_int = 0x1002; +pub const SO_SNDLOWAT: c_int = 0x1003; +pub const SO_RCVLOWAT: c_int = 0x1004; +pub const SO_SNDTIMEO: c_int = 0x1005; +pub const SO_RCVTIMEO: c_int = 0x1006; +pub const SO_ERROR: c_int = 0x1007; +pub const SO_TYPE: c_int = 0x1008; +pub const SO_BSP_STATE: c_int = 0x1009; +pub const SO_GROUP_ID: c_int = 0x2001; +pub const SO_GROUP_PRIORITY: c_int = 0x2002; +pub const SO_MAX_MSG_SIZE: c_int = 0x2003; +pub const SO_CONDITIONAL_ACCEPT: c_int = 0x3002; +pub const SO_PAUSE_ACCEPT: c_int = 0x3003; +pub const SO_COMPARTMENT_ID: c_int = 0x3004; +pub const SO_RANDOMIZE_PORT: c_int = 0x3005; +pub const SO_PORT_SCALABILITY: c_int = 0x3006; +pub const SO_REUSE_UNICASTPORT: c_int = 0x3007; +pub const SO_REUSE_MULTICASTPORT: c_int = 0x3008; +pub const WSK_SO_BASE: c_int = 0x4000; +pub const TCP_NODELAY: c_int = 0x0001; +STRUCT!{struct SOCKADDR { + sa_family: ADDRESS_FAMILY, + sa_data: [CHAR; 14], +}} +pub type PSOCKADDR = *mut SOCKADDR; +pub type LPSOCKADDR = *mut SOCKADDR; +STRUCT!{struct SOCKET_ADDRESS { + lpSockaddr: LPSOCKADDR, + iSockaddrLength: INT, +}} +pub type PSOCKET_ADDRESS = *mut SOCKET_ADDRESS; +pub type LPSOCKET_ADDRESS = *mut SOCKET_ADDRESS; +STRUCT!{struct SOCKET_ADDRESS_LIST { + iAddressCount: INT, + Address: [SOCKET_ADDRESS; 1], +}} +pub type PSOCKET_ADDRESS_LIST = *mut SOCKET_ADDRESS_LIST; +pub type LPSOCKET_ADDRESS_LIST = *mut SOCKET_ADDRESS_LIST; +STRUCT!{struct CSADDR_INFO { + LocalAddr: SOCKET_ADDRESS, + RemoteAddr: SOCKET_ADDRESS, + iSocketType: INT, + iProtocol: INT, +}} +pub type PCSADDR_INFO = *mut CSADDR_INFO; +pub type LPCSADDR_INFO = *mut CSADDR_INFO; +STRUCT!{struct SOCKADDR_STORAGE_LH { + ss_family: ADDRESS_FAMILY, + __ss_pad1: [CHAR; 6], + __ss_align: __int64, + __ss_pad2: [CHAR; 112], +}} +pub type PSOCKADDR_STORAGE_LH = *mut SOCKADDR_STORAGE_LH; +pub type LPSOCKADDR_STORAGE_LH = *mut SOCKADDR_STORAGE_LH; +STRUCT!{struct SOCKADDR_STORAGE_XP { + ss_family: c_short, + __ss_pad1: [CHAR; 6], + __ss_align: __int64, + __ss_pad2: [CHAR; 112], +}} +pub type PSOCKADDR_STORAGE_XP = *mut SOCKADDR_STORAGE_XP; +pub type LPSOCKADDR_STORAGE_XP = *mut SOCKADDR_STORAGE_XP; +pub type SOCKADDR_STORAGE = SOCKADDR_STORAGE_LH; +pub type PSOCKADDR_STORAGE = *mut SOCKADDR_STORAGE; +pub type LPSOCKADDR_STORAGE = *mut SOCKADDR_STORAGE; +STRUCT!{struct SOCKET_PROCESSOR_AFFINITY { + Processor: PROCESSOR_NUMBER, + NumaNodeId: USHORT, + Reserved: USHORT, +}} +pub type PSOCKET_PROCESSOR_AFFINITY = *mut SOCKET_PROCESSOR_AFFINITY; +pub const IOC_UNIX: DWORD = 0x00000000; +pub const IOC_WS2: DWORD = 0x08000000; +pub const IOC_PROTOCOL: DWORD = 0x10000000; +pub const IOC_VENDOR: DWORD = 0x18000000; +pub const IOC_WSK: DWORD = IOC_WS2 | 0x07000000; +pub const SIO_ASSOCIATE_HANDLE: DWORD = _WSAIOW!(IOC_WS2, 1); +pub const SIO_ENABLE_CIRCULAR_QUEUEING: DWORD = _WSAIO!(IOC_WS2, 2); +pub const SIO_FIND_ROUTE: DWORD = _WSAIOR!(IOC_WS2, 3); +pub const SIO_FLUSH: DWORD = _WSAIO!(IOC_WS2, 4); +pub const SIO_GET_BROADCAST_ADDRESS: DWORD = _WSAIOR!(IOC_WS2, 5); +pub const SIO_GET_EXTENSION_FUNCTION_POINTER: DWORD = _WSAIORW!(IOC_WS2, 6); +pub const SIO_GET_QOS: DWORD = _WSAIORW!(IOC_WS2, 7); +pub const SIO_GET_GROUP_QOS: DWORD = _WSAIORW!(IOC_WS2, 8); +pub const SIO_MULTIPOINT_LOOPBACK: DWORD = _WSAIOW!(IOC_WS2, 9); +pub const SIO_MULTICAST_SCOPE: DWORD = _WSAIOW!(IOC_WS2, 10); +pub const SIO_SET_QOS: DWORD = _WSAIOW!(IOC_WS2, 11); +pub const SIO_SET_GROUP_QOS: DWORD = _WSAIOW!(IOC_WS2, 12); +pub const SIO_TRANSLATE_HANDLE: DWORD = _WSAIORW!(IOC_WS2, 13); +pub const SIO_ROUTING_INTERFACE_QUERY: DWORD = _WSAIORW!(IOC_WS2, 20); +pub const SIO_ROUTING_INTERFACE_CHANGE: DWORD = _WSAIOW!(IOC_WS2, 21); +pub const SIO_ADDRESS_LIST_QUERY: DWORD = _WSAIOR!(IOC_WS2, 22); +pub const SIO_ADDRESS_LIST_CHANGE: DWORD = _WSAIO!(IOC_WS2, 23); +pub const SIO_QUERY_TARGET_PNP_HANDLE: DWORD = _WSAIOR!(IOC_WS2, 24); +pub const SIO_QUERY_RSS_PROCESSOR_INFO: DWORD = _WSAIOR!(IOC_WS2, 37); +pub const SIO_ADDRESS_LIST_SORT: DWORD = _WSAIORW!(IOC_WS2, 25); +pub const SIO_RESERVED_1: DWORD = _WSAIOW!(IOC_WS2, 26); +pub const SIO_RESERVED_2: DWORD = _WSAIOW!(IOC_WS2, 33); +pub const SIO_GET_MULTIPLE_EXTENSION_FUNCTION_POINTER: DWORD = _WSAIORW!(IOC_WS2, 36); +pub const IPPROTO_IP: c_int = 0; +ENUM!{enum IPPROTO { + IPPROTO_HOPOPTS = 0, // IPv6 Hop-by-Hop options + IPPROTO_ICMP = 1, + IPPROTO_IGMP = 2, + IPPROTO_GGP = 3, + IPPROTO_IPV4 = 4, + IPPROTO_ST = 5, + IPPROTO_TCP = 6, + IPPROTO_CBT = 7, + IPPROTO_EGP = 8, + IPPROTO_IGP = 9, + IPPROTO_PUP = 12, + IPPROTO_UDP = 17, + IPPROTO_IDP = 22, + IPPROTO_RDP = 27, + IPPROTO_IPV6 = 41, // IPv6 header + IPPROTO_ROUTING = 43, // IPv6 Routing header + IPPROTO_FRAGMENT = 44, // IPv6 fragmentation header + IPPROTO_ESP = 50, // encapsulating security payload + IPPROTO_AH = 51, // authentication header + IPPROTO_ICMPV6 = 58, // ICMPv6 + IPPROTO_NONE = 59, // IPv6 no next header + IPPROTO_DSTOPTS = 60, // IPv6 Destination options + IPPROTO_ND = 77, + IPPROTO_ICLFXBM = 78, + IPPROTO_PIM = 103, + IPPROTO_PGM = 113, + IPPROTO_L2TP = 115, + IPPROTO_SCTP = 132, + IPPROTO_RAW = 255, + IPPROTO_MAX = 256, + IPPROTO_RESERVED_RAW = 257, + IPPROTO_RESERVED_IPSEC = 258, + IPPROTO_RESERVED_IPSECOFFLOAD = 259, + IPPROTO_RESERVED_WNV = 260, + IPPROTO_RESERVED_MAX = 261, +}} +pub type PIPPROTO = *mut IPPROTO; +pub const IPPORT_TCPMUX: USHORT = 1; +pub const IPPORT_ECHO: USHORT = 7; +pub const IPPORT_DISCARD: USHORT = 9; +pub const IPPORT_SYSTAT: USHORT = 11; +pub const IPPORT_DAYTIME: USHORT = 13; +pub const IPPORT_NETSTAT: USHORT = 15; +pub const IPPORT_QOTD: USHORT = 17; +pub const IPPORT_MSP: USHORT = 18; +pub const IPPORT_CHARGEN: USHORT = 19; +pub const IPPORT_FTP_DATA: USHORT = 20; +pub const IPPORT_FTP: USHORT = 21; +pub const IPPORT_TELNET: USHORT = 23; +pub const IPPORT_SMTP: USHORT = 25; +pub const IPPORT_TIMESERVER: USHORT = 37; +pub const IPPORT_NAMESERVER: USHORT = 42; +pub const IPPORT_WHOIS: USHORT = 43; +pub const IPPORT_MTP: USHORT = 57; +pub const IPPORT_TFTP: USHORT = 69; +pub const IPPORT_RJE: USHORT = 77; +pub const IPPORT_FINGER: USHORT = 79; +pub const IPPORT_TTYLINK: USHORT = 87; +pub const IPPORT_SUPDUP: USHORT = 95; +pub const IPPORT_POP3: USHORT = 110; +pub const IPPORT_NTP: USHORT = 123; +pub const IPPORT_EPMAP: USHORT = 135; +pub const IPPORT_NETBIOS_NS: USHORT = 137; +pub const IPPORT_NETBIOS_DGM: USHORT = 138; +pub const IPPORT_NETBIOS_SSN: USHORT = 139; +pub const IPPORT_IMAP: USHORT = 143; +pub const IPPORT_SNMP: USHORT = 161; +pub const IPPORT_SNMP_TRAP: USHORT = 162; +pub const IPPORT_IMAP3: USHORT = 220; +pub const IPPORT_LDAP: USHORT = 389; +pub const IPPORT_HTTPS: USHORT = 443; +pub const IPPORT_MICROSOFT_DS: USHORT = 445; +pub const IPPORT_EXECSERVER: USHORT = 512; +pub const IPPORT_LOGINSERVER: USHORT = 513; +pub const IPPORT_CMDSERVER: USHORT = 514; +pub const IPPORT_EFSSERVER: USHORT = 520; +pub const IPPORT_BIFFUDP: USHORT = 512; +pub const IPPORT_WHOSERVER: USHORT = 513; +pub const IPPORT_ROUTESERVER: USHORT = 520; +pub const IPPORT_RESERVED: USHORT = 1024; +pub const IPPORT_REGISTERED_MIN: USHORT = IPPORT_RESERVED; +pub const IPPORT_REGISTERED_MAX: USHORT = 0xbfff; +pub const IPPORT_DYNAMIC_MIN: USHORT = 0xc000; +pub const IPPORT_DYNAMIC_MAX: USHORT = 0xffff; +#[inline] +pub fn IN_CLASSA(i: LONG) -> bool { + (i & 0x80000000) == 0 +} +pub const IN_CLASSA_NET: LONG = 0xff000000; +pub const IN_CLASSA_NSHIFT: LONG = 24; +pub const IN_CLASSA_HOST: LONG = 0x00ffffff; +pub const IN_CLASSA_MAX: LONG = 128; +#[inline] +pub fn IN_CLASSB(i: LONG) -> bool { + (i as u32 & 0xc0000000) == 0x80000000 +} +pub const IN_CLASSB_NET: LONG = 0xffff0000; +pub const IN_CLASSB_NSHIFT: LONG = 16; +pub const IN_CLASSB_HOST: LONG = 0x0000ffff; +pub const IN_CLASSB_MAX: LONG = 65536; +#[inline] +pub fn IN_CLASSC(i: LONG) -> bool { + (i as u32 & 0xe0000000) == 0xc0000000 +} +pub const IN_CLASSC_NET: LONG = 0xffffff00; +pub const IN_CLASSC_NSHIFT: LONG = 8; +pub const IN_CLASSC_HOST: LONG = 0x000000ff; +#[inline] +pub fn IN_CLASSD(i: c_long) -> bool { + (i as u32 & 0xf0000000) == 0xe0000000 +} +pub const IN_CLASSD_NET: LONG = 0xf0000000; +pub const IN_CLASSD_NSHIFT: LONG = 28; +pub const IN_CLASSD_HOST: LONG = 0x0fffffff; +#[inline] +pub fn IN_MULTICAST(i: c_long) -> bool { + IN_CLASSD(i) +} +pub const INADDR_ANY: ULONG = 0x00000000; +pub const INADDR_LOOPBACK: ULONG = 0x7f000001; +pub const INADDR_BROADCAST: ULONG = 0xffffffff; +pub const INADDR_NONE: ULONG = 0xffffffff; +ENUM!{enum SCOPE_LEVEL { + ScopeLevelInterface = 1, + ScopeLevelLink = 2, + ScopeLevelSubnet = 3, + ScopeLevelAdmin = 4, + ScopeLevelSite = 5, + ScopeLevelOrganization = 8, + ScopeLevelGlobal = 14, + ScopeLevelCount = 16, +}} +STRUCT!{struct SCOPE_ID_u_s { + bitfield: ULONG, +}} +BITFIELD!{SCOPE_ID_u_s bitfield: ULONG [ + Zone set_Zone[0..28], + Level set_Level[28..32], +]} +UNION!{union SCOPE_ID_u { + [u32; 1], + s s_mut: SCOPE_ID_u_s, + Value Value_mut: ULONG, +}} +STRUCT!{struct SCOPE_ID { + u: SCOPE_ID_u, +}} +pub type PSCOPE_ID = *mut SCOPE_ID; +STRUCT!{struct SOCKADDR_IN { + sin_family: ADDRESS_FAMILY, + sin_port: USHORT, + sin_addr: IN_ADDR, + sin_zero: [CHAR; 8], +}} +pub type PSOCKADDR_IN = *mut SOCKADDR_IN; +STRUCT!{struct SOCKADDR_DL { + sdl_family: ADDRESS_FAMILY, + sdl_data: [UCHAR; 8], + sdl_zero: [UCHAR; 4], +}} +pub type PSOCKADDR_DL = *mut SOCKADDR_DL; +pub const IOCPARM_MASK: DWORD = 0x7f; +pub const IOC_VOID: DWORD = 0x20000000; +pub const IOC_OUT: DWORD = 0x40000000; +pub const IOC_IN: DWORD = 0x80000000; +pub const IOC_INOUT: DWORD = IOC_IN | IOC_OUT; +STRUCT!{struct WSABUF { + len: ULONG, + buf: *mut CHAR, +}} +pub type LPWSABUF = *mut WSABUF; +STRUCT!{struct WSAMSG { + name: LPSOCKADDR, + namelen: INT, + lpBuffers: LPWSABUF, + dwBufferCount: ULONG, + Control: WSABUF, + dwFlags: ULONG, +}} +pub type PWSAMSG = *mut WSAMSG; +pub type LPWSAMSG = *mut WSAMSG; +STRUCT!{struct WSACMSGHDR { + cmsg_len: SIZE_T, + cmsg_level: INT, + cmsg_type: INT, +}} +pub type PWSACMSGHDR = *mut WSACMSGHDR; +pub type LPWSACMSGHDR = *mut WSACMSGHDR; +pub type CMSGHDR = WSACMSGHDR; +pub type PCMSGHDR = *mut WSACMSGHDR; +pub const MSG_TRUNC: ULONG = 0x0100; +pub const MSG_CTRUNC: ULONG = 0x0200; +pub const MSG_BCAST: ULONG = 0x0400; +pub const MSG_MCAST: ULONG = 0x0800; +pub const AI_PASSIVE: c_int = 0x00000001; +pub const AI_CANONNAME: c_int = 0x00000002; +pub const AI_NUMERICHOST: c_int = 0x00000004; +pub const AI_NUMERICSERV: c_int = 0x00000008; +pub const AI_DNS_ONLY: c_int = 0x00000010; +pub const AI_ALL: c_int = 0x00000100; +pub const AI_ADDRCONFIG: c_int = 0x00000400; +pub const AI_V4MAPPED: c_int = 0x00000800; +pub const AI_NON_AUTHORITATIVE: c_int = 0x00004000; +pub const AI_SECURE: c_int = 0x00008000; +pub const AI_RETURN_PREFERRED_NAMES: c_int = 0x00010000; +pub const AI_FQDN: c_int = 0x00020000; +pub const AI_FILESERVER: c_int = 0x00040000; +pub const AI_DISABLE_IDN_ENCODING: c_int = 0x00080000; +pub const AI_EXTENDED: c_int = 0x80000000; +pub const AI_RESOLUTION_HANDLE: c_int = 0x40000000; +STRUCT!{struct ADDRINFOA { + ai_flags: c_int, + ai_family: c_int, + ai_socktype: c_int, + ai_protocol: c_int, + ai_addrlen: size_t, + ai_canonname: *mut c_char, + ai_addr: *mut SOCKADDR, + ai_next: *mut ADDRINFOA, +}} +pub type PADDRINFOA = *mut ADDRINFOA; +STRUCT!{struct ADDRINFOW { + ai_flags: c_int, + ai_family: c_int, + ai_socktype: c_int, + ai_protocol: c_int, + ai_addrlen: size_t, + ai_canonname: PWSTR, + ai_addr: *mut SOCKADDR, + ai_next: *mut ADDRINFOW, +}} +pub type PADDRINFOW = *mut ADDRINFOW; +STRUCT!{struct ADDRINFOEXA { + ai_flags: c_int, + ai_family: c_int, + ai_socktype: c_int, + ai_protocol: c_int, + ai_addrlen: size_t, + ai_canonname: *mut c_char, + ai_addr: *mut SOCKADDR, + ai_blob: *mut c_void, + ai_bloblen: size_t, + ai_provider: LPGUID, + ai_next: *mut ADDRINFOEXA, +}} +pub type PADDRINFOEXA = *mut ADDRINFOEXA; +pub type LPADDRINFOEXA = *mut ADDRINFOEXA; +STRUCT!{struct ADDRINFOEXW { + ai_flags: c_int, + ai_family: c_int, + ai_socktype: c_int, + ai_protocol: c_int, + ai_addrlen: size_t, + ai_canonname: PWSTR, + ai_addr: *mut SOCKADDR, + ai_blob: *mut c_void, + ai_bloblen: size_t, + ai_provider: LPGUID, + ai_next: *mut ADDRINFOEXW, +}} +pub type PADDRINFOEXW = *mut ADDRINFOEXW; +pub type LPADDRINFOEXW = *mut ADDRINFOEXW; +pub const ADDRINFOEX_VERSION_2: c_int = 2; +pub const ADDRINFOEX_VERSION_3: c_int = 3; +pub const ADDRINFOEX_VERSION_4: c_int = 4; +STRUCT!{struct ADDRINFOEX2A { + ai_flags: c_int, + ai_family: c_int, + ai_socktype: c_int, + ai_protocol: c_int, + ai_addrlen: size_t, + ai_canonname: *mut c_char, + ai_addr: *mut SOCKADDR, + ai_blob: *mut c_void, + ai_bloblen: size_t, + ai_provider: LPGUID, + ai_next: *mut ADDRINFOEX2W, + ai_version: c_int, + ai_fqdn: *mut c_char, +}} +pub type PADDRINFOEX2A = *mut ADDRINFOEX2A; +pub type LPADDRINFOEX2A = *mut ADDRINFOEX2A; +STRUCT!{struct ADDRINFOEX2W { + ai_flags: c_int, + ai_family: c_int, + ai_socktype: c_int, + ai_protocol: c_int, + ai_addrlen: size_t, + ai_canonname: PWSTR, + ai_addr: *mut SOCKADDR, + ai_blob: *mut c_void, + ai_bloblen: size_t, + ai_provider: LPGUID, + ai_next: *mut ADDRINFOEX2W, + ai_version: c_int, + ai_fqdn: PWSTR, +}} +pub type PADDRINFOEX2W = *mut ADDRINFOEX2W; +pub type LPADDRINFOEX2W = *mut ADDRINFOEX2W; +STRUCT!{struct ADDRINFOEX3A { + ai_flags: c_int, + ai_family: c_int, + ai_socktype: c_int, + ai_protocol: c_int, + ai_addrlen: size_t, + ai_canonname: *mut c_char, + ai_addr: *mut SOCKADDR, + ai_blob: *mut c_void, + ai_bloblen: size_t, + ai_provider: LPGUID, + ai_next: *mut ADDRINFOEX3W, + ai_version: c_int, + ai_fqdn: *mut c_char, + ai_interfaceindex: c_int, +}} +pub type PADDRINFOEX3A = *mut ADDRINFOEX3A; +pub type LPADDRINFOEX3A = *mut ADDRINFOEX3A; +STRUCT!{struct ADDRINFOEX3W { + ai_flags: c_int, + ai_family: c_int, + ai_socktype: c_int, + ai_protocol: c_int, + ai_addrlen: size_t, + ai_canonname: PWSTR, + ai_addr: *mut SOCKADDR, + ai_blob: *mut c_void, + ai_bloblen: size_t, + ai_provider: LPGUID, + ai_next: *mut ADDRINFOEX3W, + ai_version: c_int, + ai_fqdn: PWSTR, + ai_interfaceindex: c_int, +}} +pub type PADDRINFOEX3W = *mut ADDRINFOEX3W; +pub type LPADDRINFOEX3W = *mut ADDRINFOEX3W; +STRUCT!{struct ADDRINFOEX4 { + ai_flags: c_int, + ai_family: c_int, + ai_socktype: c_int, + ai_protocol: c_int, + ai_addrlen: size_t, + ai_canonname: PWSTR, + ai_addr: *mut SOCKADDR, + ai_blob: *mut c_void, + ai_bloblen: size_t, + ai_provider: LPGUID, + ai_next: *mut ADDRINFOEX4, + ai_version: c_int, + ai_fqdn: PWSTR, + ai_interfaceindex: c_int, + ai_resolutionhandle: HANDLE, +}} +pub type PADDRINFOEX4 = *mut ADDRINFOEX4; +pub type LPADDRINFOEX4 = *mut ADDRINFOEX4; +pub const NS_ALL: DWORD = 0; +pub const NS_SAP: DWORD = 1; +pub const NS_NDS: DWORD = 2; +pub const NS_PEER_BROWSE: DWORD = 3; +pub const NS_SLP: DWORD = 5; +pub const NS_DHCP: DWORD = 6; +pub const NS_TCPIP_LOCAL: DWORD = 10; +pub const NS_TCPIP_HOSTS: DWORD = 11; +pub const NS_DNS: DWORD = 12; +pub const NS_NETBT: DWORD = 13; +pub const NS_WINS: DWORD = 14; +pub const NS_NLA: DWORD = 15; +pub const NS_BTH: DWORD = 16; +pub const NS_NBP: DWORD = 20; +pub const NS_MS: DWORD = 30; +pub const NS_STDA: DWORD = 31; +pub const NS_NTDS: DWORD = 32; +pub const NS_EMAIL: DWORD = 37; +pub const NS_PNRPNAME: DWORD = 38; +pub const NS_PNRPCLOUD: DWORD = 39; +pub const NS_X500: DWORD = 40; +pub const NS_NIS: DWORD = 41; +pub const NS_NISPLUS: DWORD = 42; +pub const NS_WRQ: DWORD = 50; +pub const NS_NETDES: DWORD = 60; +pub const NI_NOFQDN: c_int = 0x01; +pub const NI_NUMERICHOST: c_int = 0x02; +pub const NI_NAMEREQD: c_int = 0x04; +pub const NI_NUMERICSERV: c_int = 0x08; +pub const NI_DGRAM: c_int = 0x10; +pub const NI_MAXHOST: c_int = 1025; +pub const NI_MAXSERV: c_int = 32; diff --git a/bash-5.1/vendor/winapi/src/shared/ws2ipdef.rs b/bash-5.1/vendor/winapi/src/shared/ws2ipdef.rs new file mode 100644 index 0000000000000000000000000000000000000000..caf7dbda3f02e4d7dcf7465ec17b1f3b56f7f88e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/ws2ipdef.rs @@ -0,0 +1,112 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! TCP/IP specific information for use by WinSock2 compatible applications. +use ctypes::c_int; +use shared::in6addr::IN6_ADDR; +use shared::inaddr::IN_ADDR; +use shared::minwindef::{ULONG, USHORT}; +use shared::ws2def::{ADDRESS_FAMILY, SCOPE_ID, SOCKADDR_IN}; +pub const IFF_UP: ULONG = 0x00000001; +pub const IFF_BROADCAST: ULONG = 0x00000002; +pub const IFF_LOOPBACK: ULONG = 0x00000004; +pub const IFF_POINTTOPOINT: ULONG = 0x00000008; +pub const IFF_MULTICAST: ULONG = 0x00000010; +pub const IP_OPTIONS: c_int = 1; +pub const IP_HDRINCL: c_int = 2; +pub const IP_TOS: c_int = 3; +pub const IP_TTL: c_int = 4; +pub const IP_MULTICAST_IF: c_int = 9; +pub const IP_MULTICAST_TTL: c_int = 10; +pub const IP_MULTICAST_LOOP: c_int = 11; +pub const IP_ADD_MEMBERSHIP: c_int = 12; +pub const IP_DROP_MEMBERSHIP: c_int = 13; +pub const IP_DONTFRAGMENT: c_int = 14; +pub const IP_ADD_SOURCE_MEMBERSHIP: c_int = 15; +pub const IP_DROP_SOURCE_MEMBERSHIP: c_int = 16; +pub const IP_BLOCK_SOURCE: c_int = 17; +pub const IP_UNBLOCK_SOURCE: c_int = 18; +pub const IP_PKTINFO: c_int = 19; +pub const IP_RECEIVE_BROADCAST: c_int = 22; +pub const IP_RECVDSTADDR: c_int = 25; +UNION!{union SOCKADDR_IN6_LH_u { + [u32; 1], + sin6_scope_id sin6_scope_id_mut: ULONG, + sin6_scope_struct sin6_scope_struct_mut: SCOPE_ID, +}} +STRUCT!{struct SOCKADDR_IN6_LH { + sin6_family: ADDRESS_FAMILY, + sin6_port: USHORT, + sin6_flowinfo: ULONG, + sin6_addr: IN6_ADDR, + u: SOCKADDR_IN6_LH_u, +}} +pub type PSOCKADDR_IN6_LH = *mut SOCKADDR_IN6_LH; +pub type SOCKADDR_IN6 = SOCKADDR_IN6_LH; +pub type PSOCKADDR_IN6 = *mut SOCKADDR_IN6; +STRUCT!{struct SOCKADDR_IN6_PAIR { + SourceAddress: PSOCKADDR_IN6, + DestinationAddress: PSOCKADDR_IN6, +}} +pub type PSOCKADDR_IN6_PAIR = *mut SOCKADDR_IN6_PAIR; +UNION!{union SOCKADDR_INET { + [u32; 7], + Ipv4 Ipv4_mut: SOCKADDR_IN, + Ipv6 Ipv6_mut: SOCKADDR_IN6, + si_family si_family_mut: ADDRESS_FAMILY, +}} +pub type PSOCKADDR_INET = *mut SOCKADDR_INET; +STRUCT!{struct IP_MREQ { + imr_multiaddr: IN_ADDR, + imr_interface: IN_ADDR, +}} +pub type PIP_MREQ = *mut IP_MREQ; +STRUCT!{struct IP_MREQ_SOURCE { + imr_multiaddr: IN_ADDR, + imr_sourceaddr: IN_ADDR, + imr_interface: IN_ADDR, +}} +pub type PIP_MREQ_SOURCE = *mut IP_MREQ_SOURCE; +pub const IPV6_HOPOPTS: c_int = 1; +pub const IPV6_HDRINCL: c_int = 2; +pub const IPV6_UNICAST_HOPS: c_int = 4; +pub const IPV6_MULTICAST_IF: c_int = 9; +pub const IPV6_MULTICAST_HOPS: c_int = 10; +pub const IPV6_MULTICAST_LOOP: c_int = 11; +pub const IPV6_ADD_MEMBERSHIP: c_int = 12; +pub const IPV6_JOIN_GROUP: c_int = IPV6_ADD_MEMBERSHIP; +pub const IPV6_DROP_MEMBERSHIP: c_int = 13; +pub const IPV6_LEAVE_GROUP: c_int = IPV6_DROP_MEMBERSHIP; +pub const IPV6_DONTFRAG: c_int = 14; +pub const IPV6_PKTINFO: c_int = 19; +pub const IPV6_HOPLIMIT: c_int = 21; +pub const IPV6_PROTECTION_LEVEL: c_int = 23; +pub const IPV6_RECVIF: c_int = 24; +pub const IPV6_RECVDSTADDR: c_int = 25; +pub const IPV6_CHECKSUM: c_int = 26; +pub const IPV6_V6ONLY: c_int = 27; +pub const IPV6_IFLIST: c_int = 28; +pub const IPV6_ADD_IFLIST: c_int = 29; +pub const IPV6_DEL_IFLIST: c_int = 30; +pub const IPV6_UNICAST_IF: c_int = 31; +pub const IPV6_RTHDR: c_int = 32; +pub const IPV6_RECVRTHDR: c_int = 38; +pub const IPV6_TCLASS: c_int = 39; +pub const IPV6_RECVTCLASS: c_int = 40; +STRUCT!{struct IPV6_MREQ { + ipv6mr_multiaddr: IN6_ADDR, + ipv6mr_interface: ULONG, +}} +pub type PIPV6_MREQ = *mut IPV6_MREQ; +STRUCT!{struct IN_PKTINFO { + ipi_addr: IN_ADDR, + ipi_ifindex: ULONG, +}} +pub type PIN_PKTINFO = *mut IN_PKTINFO; +STRUCT!{struct IN6_PKTINFO { + ipi6_addr: IN6_ADDR, + ipi6_ifindex: ULONG, +}} +pub type PIN6_PKTINFO = *mut IN6_PKTINFO; diff --git a/bash-5.1/vendor/winapi/src/shared/wtypes.rs b/bash-5.1/vendor/winapi/src/shared/wtypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..8b5c88811097e01a873f58a381473333ff1d23b2 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/wtypes.rs @@ -0,0 +1,344 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{__int64, c_double, c_short, c_ushort, c_void, wchar_t}; +use shared::guiddef::{CLSID, GUID}; +use shared::minwindef::{BYTE, DWORD, ULONG, USHORT, WORD}; +use shared::ntdef::{LCID, LONG, LONGLONG, ULONGLONG}; +use shared::rpcndr::byte; +use shared::wtypesbase::{ + BYTE_BLOB, DWORD_BLOB, FLAGGED_BYTE_BLOB, FLAGGED_WORD_BLOB, LPOLESTR, OLECHAR +}; +use um::wingdi::LOGPALETTE; +// extern RPC_IF_HANDLE __MIDL_itf_wtypes_0000_0000_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wtypes_0000_0000_v0_0_s_ifspec; +STRUCT!{struct RemHGLOBAL { + fNullHGlobal: LONG, + cbData: ULONG, + data: [byte; 1], +}} +STRUCT!{struct RemHMETAFILEPICT { + mm: LONG, + xExt: LONG, + yExt: LONG, + cbData: ULONG, + data: [byte; 1], +}} +STRUCT!{struct RemHENHMETAFILE { + cbData: ULONG, + data: [byte; 1], +}} +STRUCT!{struct RemHBITMAP { + cbData: ULONG, + data: [byte; 1], +}} +STRUCT!{struct RemHPALETTE { + cbData: ULONG, + data: [byte; 1], +}} +STRUCT!{struct RemHBRUSH { + cbData: ULONG, + data: [byte; 1], +}} +pub const ROTFLAGS_REGISTRATIONKEEPSALIVE: DWORD = 0x1; +pub const ROTFLAGS_ALLOWANYCLIENT: DWORD = 0x2; +pub const ROT_COMPARE_MAX: DWORD = 2048; +ENUM!{enum DVASPECT { + DVASPECT_CONTENT = 1, + DVASPECT_THUMBNAIL = 2, + DVASPECT_ICON = 4, + DVASPECT_DOCPRINT = 8, +}} +ENUM!{enum STGC { + STGC_DEFAULT = 0, + STGC_OVERWRITE = 1, + STGC_ONLYIFCURRENT = 2, + STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4, + STGC_CONSOLIDATE = 8, +}} +ENUM!{enum STGMOVE { + STGMOVE_MOVE = 0, + STGMOVE_COPY = 1, + STGMOVE_SHALLOWCOPY = 2, +}} +ENUM!{enum STATFLAG { + STATFLAG_DEFAULT = 0, + STATFLAG_NONAME = 1, + STATFLAG_NOOPEN = 2, +}} +pub type HCONTEXT = *mut c_void; +pub const WDT_INPROC_CALL: ULONG = 0x48746457; +pub const WDT_REMOTE_CALL: ULONG = 0x52746457; +pub const WDT_INPROC64_CALL: ULONG = 0x50746457; +UNION!{union userCLIPFORMAT_u { + [usize; 1], + dwValue dwValue_mut: DWORD, + pwszName pwszName_mut: *mut wchar_t, +}} +STRUCT!{struct userCLIPFORMAT { + fContext: LONG, + u: userCLIPFORMAT_u, +}} +pub type wireCLIPFORMAT = *mut userCLIPFORMAT; +pub type CLIPFORMAT = WORD; +UNION!{union GDI_NONREMOTE_u { + [usize; 1], + hInproc hInproc_mut: LONG, + hRemote hRemote_mut: *mut DWORD_BLOB, +}} +STRUCT!{struct GDI_NONREMOTE { + fContext: LONG, + u: GDI_NONREMOTE_u, +}} +UNION!{union userHGLOBAL_u { + [u64; 1], + hInproc hInproc_mut: LONG, + hRemote hRemote_mut: *mut FLAGGED_BYTE_BLOB, + hInproc64 hInproc64_mut: __int64, +}} +STRUCT!{struct userHGLOBAL { + fContext: LONG, + u: userHGLOBAL_u, +}} +pub type wireHGLOBAL = *mut userHGLOBAL; +UNION!{union userHMETAFILE_u { + [u64; 1], + hInproc hInproc_mut: LONG, + hRemote hRemote_mut: *mut BYTE_BLOB, + hInproc64 hInproc64_mut: __int64, +}} +STRUCT!{struct userHMETAFILE { + fContext: LONG, + u: userHMETAFILE_u, +}} +STRUCT!{struct remoteMETAFILEPICT { + mm: LONG, + xExt: LONG, + yExt: LONG, + hMF: *mut userHMETAFILE, +}} +UNION!{union userHMETAFILEPICT_u { + [u64; 1], + hInproc hInproc_mut: LONG, + hRemote hRemote_mut: *mut remoteMETAFILEPICT, + hInproc64 hInproc64_mut: __int64, +}} +STRUCT!{struct userHMETAFILEPICT { + fContext: LONG, + u: userHMETAFILEPICT_u, +}} +UNION!{union userHENHMETAFILE_u { + [u64; 1], + hInproc hInproc_mut: LONG, + hRemote hRemote_mut: *mut BYTE_BLOB, + hInproc64 hInproc64_mut: __int64, +}} +STRUCT!{struct userHENHMETAFILE { + fContext: LONG, + u: userHENHMETAFILE_u, +}} +STRUCT!{struct userBITMAP { + bmType: LONG, + bmWidth: LONG, + bmHeight: LONG, + bmWidthBytes: LONG, + bmPlanes: WORD, + bmBitsPixel: WORD, + cbSize: ULONG, + pBuffer: [byte; 1], +}} +UNION!{union userHBITMAP_u { + [u64; 1], + hInproc hInproc_mut: LONG, + hRemote hRemote_mut: *mut userBITMAP, + hInproc64 hInproc64_mut: __int64, +}} +STRUCT!{struct userHBITMAP { + fContext: LONG, + u: userHBITMAP_u, +}} +UNION!{union userHPALETTE_u { + [u64; 1], + hInproc hInproc_mut: LONG, + hRemote hRemote_mut: *mut LOGPALETTE, + hInproc64 hInproc64_mut: __int64, +}} +STRUCT!{struct userHPALETTE { + fContext: LONG, + u: userHPALETTE_u, +}} +UNION!{union RemotableHandle_u { + [u32; 1], + hInproc hInproc_mut: LONG, + hRemote hRemote_mut: LONG, +}} +STRUCT!{struct RemotableHandle { + fContext: LONG, + u: RemotableHandle_u, +}} +pub type wireHWND = *mut RemotableHandle; +pub type wireHMENU = *mut RemotableHandle; +pub type wireHACCEL = *mut RemotableHandle; +pub type wireHBRUSH = *mut RemotableHandle; +pub type wireHFONT = *mut RemotableHandle; +pub type wireHDC = *mut RemotableHandle; +pub type wireHICON = *mut RemotableHandle; +pub type wireHRGN = *mut RemotableHandle; +pub type wireHMONITOR = *mut RemotableHandle; +pub type wireHBITMAP = *mut userHBITMAP; +pub type wireHPALETTE = *mut userHPALETTE; +pub type wireHENHMETAFILE = *mut userHENHMETAFILE; +pub type wireHMETAFILE = *mut userHMETAFILE; +pub type wireHMETAFILEPICT = *mut userHMETAFILEPICT; +pub type HMETAFILEPICT = *mut c_void; +// extern RPC_IF_HANDLE IWinTypes_v0_1_c_ifspec; +// extern RPC_IF_HANDLE IWinTypes_v0_1_s_ifspec; +pub type DATE = c_double; +STRUCT!{struct CY { + int64: LONGLONG, +}} +pub type LPCY = *mut CY; +STRUCT!{struct DECIMAL { + wReserved: USHORT, + scale: BYTE, + sign: BYTE, + Hi32: ULONG, + Lo64: ULONGLONG, +}} +pub const DECIMAL_NEG: BYTE = 0x80; +#[inline] +pub fn DECIMAL_SETZERO(dec: &mut DECIMAL) { + dec.Lo64 = 0; + dec.Hi32 = 0; + dec.scale = 0; + dec.sign = 0; +} +pub type LPDECIMAL = *mut DECIMAL; +pub type wireBSTR = *mut FLAGGED_WORD_BLOB; +pub type BSTR = *mut OLECHAR; +pub type LPBSTR = *mut BSTR; +pub type VARIANT_BOOL = c_short; +STRUCT!{struct BSTRBLOB { + cbSize: ULONG, + pData: *mut BYTE, +}} +pub type LPBSTRBLOB = *mut BSTRBLOB; +pub const VARIANT_TRUE: VARIANT_BOOL = -1; +pub const VARIANT_FALSE: VARIANT_BOOL = 0; +STRUCT!{struct CLIPDATA { + cbSize: ULONG, + ulClipFmt: LONG, + pClipData: *mut BYTE, +}} +#[inline] +pub fn CBPCLIPDATA(clipdata: CLIPDATA) -> ULONG { + clipdata.cbSize - 4 +} +pub type VARTYPE = c_ushort; +ENUM!{enum VARENUM { + VT_EMPTY = 0, + VT_NULL = 1, + VT_I2 = 2, + VT_I4 = 3, + VT_R4 = 4, + VT_R8 = 5, + VT_CY = 6, + VT_DATE = 7, + VT_BSTR = 8, + VT_DISPATCH = 9, + VT_ERROR = 10, + VT_BOOL = 11, + VT_VARIANT = 12, + VT_UNKNOWN = 13, + VT_DECIMAL = 14, + VT_I1 = 16, + VT_UI1 = 17, + VT_UI2 = 18, + VT_UI4 = 19, + VT_I8 = 20, + VT_UI8 = 21, + VT_INT = 22, + VT_UINT = 23, + VT_VOID = 24, + VT_HRESULT = 25, + VT_PTR = 26, + VT_SAFEARRAY = 27, + VT_CARRAY = 28, + VT_USERDEFINED = 29, + VT_LPSTR = 30, + VT_LPWSTR = 31, + VT_RECORD = 36, + VT_INT_PTR = 37, + VT_UINT_PTR = 38, + VT_FILETIME = 64, + VT_BLOB = 65, + VT_STREAM = 66, + VT_STORAGE = 67, + VT_STREAMED_OBJECT = 68, + VT_STORED_OBJECT = 69, + VT_BLOB_OBJECT = 70, + VT_CF = 71, + VT_CLSID = 72, + VT_VERSIONED_STREAM = 73, + VT_BSTR_BLOB = 0xfff, + VT_VECTOR = 0x1000, + VT_ARRAY = 0x2000, + VT_BYREF = 0x4000, + VT_RESERVED = 0x8000, + VT_ILLEGAL = 0xffff, + VT_ILLEGALMASKED = 0xfff, + VT_TYPEMASK = 0xfff, +}} +pub type PROPID = ULONG; +STRUCT!{struct PROPERTYKEY { + fmtid: GUID, + pid: DWORD, +}} +STRUCT!{struct CSPLATFORM { + dwPlatformId: DWORD, + dwVersionHi: DWORD, + dwVersionLo: DWORD, + dwProcessorArch: DWORD, +}} +STRUCT!{struct QUERYCONTEXT { + dwContext: DWORD, + Platform: CSPLATFORM, + Locale: LCID, + dwVersionHi: DWORD, + dwVersionLo: DWORD, +}} +ENUM!{enum TYSPEC { + TYSPEC_CLSID, + TYSPEC_FILEEXT, + TYSPEC_MIMETYPE, + TYSPEC_FILENAME, + TYSPEC_PROGID, + TYSPEC_PACKAGENAME, + TYSPEC_OBJECTID, +}} +STRUCT!{struct uCLSSPEC_ByName { + pPackageName: LPOLESTR, + PolicyId: GUID, +}} +STRUCT!{struct uCLSSPEC_ByObjectId { + ObjectId: GUID, + PolicyId: GUID, +}} +UNION!{union uCLSSPEC_u { + [u32; 8] [u64; 4], + clsid clsid_mut: CLSID, + pFileExt pFileExt_mut: LPOLESTR, + pMimeType pMimeType_mut: LPOLESTR, + pProgId pProgId_mut: LPOLESTR, + pFileName pFileName_mut: LPOLESTR, + ByName ByName_mut: uCLSSPEC_ByName, + ByObjectId ByObjectId_mut: uCLSSPEC_ByObjectId, +}} +STRUCT!{struct uCLSSPEC { + tyspec: DWORD, + u: uCLSSPEC_u, +}} +// extern RPC_IF_HANDLE __MIDL_itf_wtypes_0000_0001_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wtypes_0000_0001_v0_0_s_ifspec; diff --git a/bash-5.1/vendor/winapi/src/shared/wtypesbase.rs b/bash-5.1/vendor/winapi/src/shared/wtypesbase.rs new file mode 100644 index 0000000000000000000000000000000000000000..e8ca7ee0818b10b86de8efeb828fbbfc8b24677b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/shared/wtypesbase.rs @@ -0,0 +1,161 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_double, c_short, c_uchar, c_ushort}; +use shared::minwindef::{BYTE, DWORD}; +use shared::rpcndr::{boolean, byte, hyper}; +use um::winnt::{LONG, LPWSTR, WCHAR}; +pub type OLECHAR = WCHAR; +pub type LPOLESTR = *mut OLECHAR; +pub type LPCOLESTR = *const OLECHAR; +pub type UCHAR = c_uchar; +pub type SHORT = c_short; +pub type USHORT = c_ushort; +pub type ULONG = DWORD; +pub type DOUBLE = c_double; +STRUCT!{struct COAUTHIDENTITY { + User: *mut USHORT, + UserLength: ULONG, + Domain: *mut USHORT, + DomainLength: ULONG, + Password: *mut USHORT, + PasswordLength: ULONG, + Flags: ULONG, +}} +STRUCT!{struct COAUTHINFO { + dwAuthnSvc: DWORD, + dwAuthzSvc: DWORD, + pwszServerPrincName: LPWSTR, + dwAuthnLevel: DWORD, + dwImpersonationLevel: DWORD, + pAuthIdentityData: *mut COAUTHIDENTITY, + dwCapabilities: DWORD, +}} +pub type SCODE = LONG; +pub type PSCODE = *mut SCODE; +ENUM!{enum MEMCTX { + MEMCTX_TASK = 1, + MEMCTX_SHARED = 2, + MEMCTX_MACSYSTEM = 3, + MEMCTX_UNKNOWN = -1i32 as u32, + MEMCTX_SAME = -2i32 as u32, +}} +pub const ROTREGFLAGS_ALLOWANYCLIENT: DWORD = 0x1; +pub const APPIDREGFLAGS_ACTIVATE_IUSERVER_INDESKTOP: DWORD = 0x1; +pub const APPIDREGFLAGS_SECURE_SERVER_PROCESS_SD_AND_BIND: DWORD = 0x2; +pub const APPIDREGFLAGS_ISSUE_ACTIVATION_RPC_AT_IDENTIFY: DWORD = 0x4; +pub const APPIDREGFLAGS_IUSERVER_UNMODIFIED_LOGON_TOKEN: DWORD = 0x8; +pub const APPIDREGFLAGS_IUSERVER_SELF_SID_IN_LAUNCH_PERMISSION: DWORD = 0x10; +pub const APPIDREGFLAGS_IUSERVER_ACTIVATE_IN_CLIENT_SESSION_ONLY: DWORD = 0x20; +pub const APPIDREGFLAGS_RESERVED1: DWORD = 0x40; +pub const APPIDREGFLAGS_RESERVED2: DWORD = 0x80; +pub const APPIDREGFLAGS_RESERVED3: DWORD = 0x100; +pub const APPIDREGFLAGS_RESERVED4: DWORD = 0x200; +pub const APPIDREGFLAGS_RESERVED5: DWORD = 0x400; +pub const APPIDREGFLAGS_RESERVED6: DWORD = 0x800; +pub const DCOMSCM_ACTIVATION_USE_ALL_AUTHNSERVICES: DWORD = 0x1; +pub const DCOMSCM_ACTIVATION_DISALLOW_UNSECURE_CALL: DWORD = 0x2; +pub const DCOMSCM_RESOLVE_USE_ALL_AUTHNSERVICES: DWORD = 0x4; +pub const DCOMSCM_RESOLVE_DISALLOW_UNSECURE_CALL: DWORD = 0x8; +pub const DCOMSCM_PING_USE_MID_AUTHNSERVICE: DWORD = 0x10; +pub const DCOMSCM_PING_DISALLOW_UNSECURE_CALL: DWORD = 0x20; +ENUM!{enum CLSCTX { + CLSCTX_INPROC_SERVER = 0x1, + CLSCTX_INPROC_HANDLER = 0x2, + CLSCTX_LOCAL_SERVER = 0x4, + CLSCTX_INPROC_SERVER16 = 0x8, + CLSCTX_REMOTE_SERVER = 0x10, + CLSCTX_INPROC_HANDLER16 = 0x20, + CLSCTX_RESERVED1 = 0x40, + CLSCTX_RESERVED2 = 0x80, + CLSCTX_RESERVED3 = 0x100, + CLSCTX_RESERVED4 = 0x200, + CLSCTX_NO_CODE_DOWNLOAD = 0x400, + CLSCTX_RESERVED5 = 0x800, + CLSCTX_NO_CUSTOM_MARSHAL = 0x1000, + CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000, + CLSCTX_NO_FAILURE_LOG = 0x4000, + CLSCTX_DISABLE_AAA = 0x8000, + CLSCTX_ENABLE_AAA = 0x10000, + CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000, + CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000, + CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000, + CLSCTX_ENABLE_CLOAKING = 0x100000, + CLSCTX_APPCONTAINER = 0x400000, + CLSCTX_ACTIVATE_AAA_AS_IU = 0x800000, + CLSCTX_PS_DLL = 0x80000000, +}} +pub const CLSCTX_VALID_MASK: CLSCTX = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER + | CLSCTX_LOCAL_SERVER | CLSCTX_INPROC_SERVER16 | CLSCTX_REMOTE_SERVER + | CLSCTX_NO_CODE_DOWNLOAD | CLSCTX_NO_CUSTOM_MARSHAL | CLSCTX_ENABLE_CODE_DOWNLOAD + | CLSCTX_NO_FAILURE_LOG | CLSCTX_DISABLE_AAA | CLSCTX_ENABLE_AAA | CLSCTX_FROM_DEFAULT_CONTEXT + | CLSCTX_ACTIVATE_32_BIT_SERVER | CLSCTX_ACTIVATE_64_BIT_SERVER | CLSCTX_ENABLE_CLOAKING + | CLSCTX_APPCONTAINER | CLSCTX_ACTIVATE_AAA_AS_IU | CLSCTX_PS_DLL; +ENUM!{enum MSHLFLAGS { + MSHLFLAGS_NORMAL = 0, + MSHLFLAGS_TABLESTRONG = 1, + MSHLFLAGS_TABLEWEAK = 2, + MSHLFLAGS_NOPING = 4, + MSHLFLAGS_RESERVED1 = 8, + MSHLFLAGS_RESERVED2 = 16, + MSHLFLAGS_RESERVED3 = 32, + MSHLFLAGS_RESERVED4 = 64, +}} +ENUM!{enum MSHCTX { + MSHCTX_LOCAL = 0, + MSHCTX_NOSHAREDMEM = 1, + MSHCTX_DIFFERENTMACHINE = 2, + MSHCTX_INPROC = 3, + MSHCTX_CROSSCTX = 4, +}} +STRUCT!{struct BYTE_BLOB { + clSize: ULONG, + abData: [byte; 1], +}} +pub type UP_BYTE_BLOB = *mut BYTE_BLOB; +STRUCT!{struct WORD_BLOB { + clSize: ULONG, + asData: [c_ushort; 1], +}} +pub type UP_WORD_BLOB = *mut WORD_BLOB; +STRUCT!{struct DWORD_BLOB { + clSize: ULONG, + alData: [ULONG; 1], +}} +pub type UP_DWORD_BLOB = *mut DWORD_BLOB; +STRUCT!{struct FLAGGED_BYTE_BLOB { + fFlags: ULONG, + clSize: ULONG, + abData: [byte; 1], +}} +pub type UP_FLAGGED_BYTE_BLOB = *mut FLAGGED_BYTE_BLOB; +STRUCT!{struct FLAGGED_WORD_BLOB { + fFlags: ULONG, + clSize: ULONG, + alData: [ULONG; 1], +}} +pub type UP_FLAGGED_WORD_BLOB = *mut FLAGGED_WORD_BLOB; +STRUCT!{struct BYTE_SIZEDARR { + clSize: ULONG, + pData: *mut byte, +}} +STRUCT!{struct WORD_SIZEDARR { + clSize: ULONG, + pData: *mut c_ushort, +}} +STRUCT!{struct DWORD_SIZEDARR { + clSize: ULONG, + pData: *mut ULONG, +}} +STRUCT!{struct HYPER_SIZEDARR { + clSize: ULONG, + pData: *mut hyper, +}} +pub type BOOLEAN = boolean; +STRUCT!{struct BLOB { + cbSize: ULONG, + pBlobData: *mut BYTE, +}} +pub type LPBLOB = *mut BLOB; diff --git a/bash-5.1/vendor/winapi/src/ucrt/corecrt.rs b/bash-5.1/vendor/winapi/src/ucrt/corecrt.rs new file mode 100644 index 0000000000000000000000000000000000000000..4fdf89736bf7f230c605e447d4b02844f3b86ed2 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/ucrt/corecrt.rs @@ -0,0 +1,11 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// #include +// #include +use ctypes::{__int64, c_long}; +pub type __time32_t = c_long; +pub type __time64_t = __int64; +pub type time_t = __time64_t; diff --git a/bash-5.1/vendor/winapi/src/ucrt/mod.rs b/bash-5.1/vendor/winapi/src/ucrt/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..d24d553722a89cb85211bae82afe935fb70a812a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/ucrt/mod.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// Headers for the universal C Runtime +#[cfg(feature = "corecrt")] pub mod corecrt; diff --git a/bash-5.1/vendor/winapi/src/um/accctrl.rs b/bash-5.1/vendor/winapi/src/um/accctrl.rs new file mode 100644 index 0000000000000000000000000000000000000000..829ce5793a9620c8f3b59dee6448cf0dcd37ee5e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/accctrl.rs @@ -0,0 +1,371 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, ULONG}; +use um::winbase::LocalFree; +use um::winnt::{HANDLE, LONG, LPSTR, LPWSTR, PVOID, SID}; +#[inline] +pub unsafe fn AccFree(p: PVOID) -> PVOID { + LocalFree(p) +} +ENUM!{enum SE_OBJECT_TYPE { + SE_UNKNOWN_OBJECT_TYPE = 0, + SE_FILE_OBJECT, + SE_SERVICE, + SE_PRINTER, + SE_REGISTRY_KEY, + SE_LMSHARE, + SE_KERNEL_OBJECT, + SE_WINDOW_OBJECT, + SE_DS_OBJECT, + SE_DS_OBJECT_ALL, + SE_PROVIDER_DEFINED_OBJECT, + SE_WMIGUID_OBJECT, + SE_REGISTRY_WOW64_32KEY, + SE_REGISTRY_WOW64_64KEY, +}} +ENUM!{enum TRUSTEE_TYPE { + TRUSTEE_IS_UNKNOWN, + TRUSTEE_IS_USER, + TRUSTEE_IS_GROUP, + TRUSTEE_IS_DOMAIN, + TRUSTEE_IS_ALIAS, + TRUSTEE_IS_WELL_KNOWN_GROUP, + TRUSTEE_IS_DELETED, + TRUSTEE_IS_INVALID, + TRUSTEE_IS_COMPUTER, +}} +ENUM!{enum TRUSTEE_FORM { + TRUSTEE_IS_SID, + TRUSTEE_IS_NAME, + TRUSTEE_BAD_FORM, + TRUSTEE_IS_OBJECTS_AND_SID, + TRUSTEE_IS_OBJECTS_AND_NAME, +}} +ENUM!{enum MULTIPLE_TRUSTEE_OPERATION { + NO_MULTIPLE_TRUSTEE, + TRUSTEE_IS_IMPERSONATE, +}} +STRUCT!{struct OBJECTS_AND_SID { + ObjectsPresent: DWORD, + ObjectTypeGuid: GUID, + InheritedObjectTypeGuid: GUID, + pSid: *mut SID, +}} +pub type POBJECTS_AND_SID = *mut OBJECTS_AND_SID; +STRUCT!{struct OBJECTS_AND_NAME_A { + ObjectsPresent: DWORD, + ObjectType: SE_OBJECT_TYPE, + ObjectTypeName: LPSTR, + InheritedObjectTypeName: LPSTR, + ptstrName: LPSTR, +}} +pub type POBJECTS_AND_NAME_A = *mut OBJECTS_AND_NAME_A; +STRUCT!{struct OBJECTS_AND_NAME_W { + ObjectsPresent: DWORD, + ObjectType: SE_OBJECT_TYPE, + ObjectTypeName: LPWSTR, + InheritedObjectTypeName: LPWSTR, + ptstrName: LPWSTR, +}} +pub type POBJECTS_AND_NAME_W = *mut OBJECTS_AND_NAME_W; +STRUCT!{struct TRUSTEE_A { + pMultipleTrustee: *mut TRUSTEE_A, + MultipleTrusteeOperation: MULTIPLE_TRUSTEE_OPERATION, + TrusteeForm: TRUSTEE_FORM, + TrusteeType: TRUSTEE_TYPE, + ptstrName: LPSTR, +}} +pub type PTRUSTEE_A = *mut TRUSTEE_A; +pub type TRUSTEEA = TRUSTEE_A; +pub type PTRUSTEEA = PTRUSTEE_A; +STRUCT!{struct TRUSTEE_W { + pMultipleTrustee: *mut TRUSTEE_W, + MultipleTrusteeOperation: MULTIPLE_TRUSTEE_OPERATION, + TrusteeForm: TRUSTEE_FORM, + TrusteeType: TRUSTEE_TYPE, + ptstrName: LPWSTR, +}} +pub type PTRUSTEE_W = *mut TRUSTEE_W; +pub type TRUSTEEW = TRUSTEE_W; +pub type PTRUSTEEW = PTRUSTEE_W; +ENUM!{enum ACCESS_MODE { + NOT_USED_ACCESS = 0, + GRANT_ACCESS, + SET_ACCESS, + DENY_ACCESS, + REVOKE_ACCESS, + SET_AUDIT_SUCCESS, + SET_AUDIT_FAILURE, +}} +pub const NO_INHERITANCE: DWORD = 0x0; +pub const SUB_OBJECTS_ONLY_INHERIT: DWORD = 0x1; +pub const SUB_CONTAINERS_ONLY_INHERIT: DWORD = 0x2; +pub const SUB_CONTAINERS_AND_OBJECTS_INHERIT: DWORD = 0x3; +pub const INHERIT_NO_PROPAGATE: DWORD = 0x4; +pub const INHERIT_ONLY: DWORD = 0x8; +pub const INHERITED_ACCESS_ENTRY: DWORD = 0x10; +pub const INHERITED_PARENT: DWORD = 0x10000000; +pub const INHERITED_GRANDPARENT: DWORD = 0x20000000; +STRUCT!{struct EXPLICIT_ACCESS_A { + grfAccessPermissions: DWORD, + grfAccessMode: ACCESS_MODE, + grfInheritance: DWORD, + Trustee: TRUSTEE_A, +}} +pub type PEXPLICIT_ACCESS_A = *mut EXPLICIT_ACCESS_A; +pub type EXPLICIT_ACCESSA = EXPLICIT_ACCESS_A; +pub type PEXPLICIT_ACCESSA = PEXPLICIT_ACCESS_A; +STRUCT!{struct EXPLICIT_ACCESS_W { + grfAccessPermissions: DWORD, + grfAccessMode: ACCESS_MODE, + grfInheritance: DWORD, + Trustee: TRUSTEE_W, +}} +pub type PEXPLICIT_ACCESS_W = *mut EXPLICIT_ACCESS_W; +pub type EXPLICIT_ACCESSW = EXPLICIT_ACCESS_W; +pub type PEXPLICIT_ACCESSW = PEXPLICIT_ACCESS_W; +pub const ACCCTRL_DEFAULT_PROVIDER: &'static str = "Windows NT Access Provider"; +pub type ACCESS_RIGHTS = ULONG; +pub type PACCESS_RIGHTS = *mut ACCESS_RIGHTS; +pub type INHERIT_FLAGS = ULONG; +pub type PINHERIT_FLAGS = *mut INHERIT_FLAGS; +STRUCT!{struct ACTRL_ACCESS_ENTRYA { + Trustee: TRUSTEE_A, + fAccessFlags: ULONG, + Access: ACCESS_RIGHTS, + ProvSpecificAccess: ACCESS_RIGHTS, + Inheritance: INHERIT_FLAGS, + lpInheritProperty: LPSTR, +}} +pub type PACTRL_ACCESS_ENTRYA = *mut ACTRL_ACCESS_ENTRYA; +STRUCT!{struct ACTRL_ACCESS_ENTRYW { + Trustee: TRUSTEE_W, + fAccessFlags: ULONG, + Access: ACCESS_RIGHTS, + ProvSpecificAccess: ACCESS_RIGHTS, + Inheritance: INHERIT_FLAGS, + lpInheritProperty: LPWSTR, +}} +pub type PACTRL_ACCESS_ENTRYW = *mut ACTRL_ACCESS_ENTRYW; +STRUCT!{struct ACTRL_ACCESS_ENTRY_LISTA { + cEntries: ULONG, + pAccessList: *mut ACTRL_ACCESS_ENTRYA, +}} +pub type PACTRL_ACCESS_ENTRY_LISTA = *mut ACTRL_ACCESS_ENTRY_LISTA; +STRUCT!{struct ACTRL_ACCESS_ENTRY_LISTW { + cEntries: ULONG, + pAccessList: *mut ACTRL_ACCESS_ENTRYW, +}} +pub type PACTRL_ACCESS_ENTRY_LISTW = *mut ACTRL_ACCESS_ENTRY_LISTW; +STRUCT!{struct ACTRL_PROPERTY_ENTRYA { + lpProperty: LPSTR, + pAccessEntryList: PACTRL_ACCESS_ENTRY_LISTA, + fListFlags: ULONG, +}} +pub type PACTRL_PROPERTY_ENTRYA = *mut ACTRL_PROPERTY_ENTRYA; +STRUCT!{struct ACTRL_PROPERTY_ENTRYW { + lpProperty: LPWSTR, + pAccessEntryList: PACTRL_ACCESS_ENTRY_LISTW, + fListFlags: ULONG, +}} +pub type PACTRL_PROPERTY_ENTRYW = *mut ACTRL_PROPERTY_ENTRYW; +STRUCT!{struct ACTRL_ACCESSA { + cEntries: ULONG, + pPropertyAccessList: PACTRL_PROPERTY_ENTRYA, +}} +pub type PACTRL_ACCESSA = *mut ACTRL_ACCESSA; +pub type ACTRL_AUDITA = ACTRL_ACCESSA; +pub type PACTRL_AUDITA = *mut ACTRL_AUDITA; +STRUCT!{struct ACTRL_ACCESSW { + cEntries: ULONG, + pPropertyAccessList: PACTRL_PROPERTY_ENTRYW, +}} +pub type PACTRL_ACCESSW = *mut ACTRL_ACCESSW; +pub type ACTRL_AUDITW = ACTRL_ACCESSW; +pub type PACTRL_AUDITW = *mut ACTRL_AUDITW; +pub const TRUSTEE_ACCESS_ALLOWED: ULONG = 0x00000001; +pub const TRUSTEE_ACCESS_READ: ULONG = 0x00000002; +pub const TRUSTEE_ACCESS_WRITE: ULONG = 0x00000004; +pub const TRUSTEE_ACCESS_EXPLICIT: ULONG = 0x00000001; +pub const TRUSTEE_ACCESS_READ_WRITE: ULONG = TRUSTEE_ACCESS_READ | TRUSTEE_ACCESS_WRITE; +pub const TRUSTEE_ACCESS_ALL: ULONG = 0xFFFFFFFF; +STRUCT!{struct TRUSTEE_ACCESSA { + lpProperty: LPSTR, + Access: ACCESS_RIGHTS, + fAccessFlags: ULONG, + fReturnedAccess: ULONG, +}} +pub type PTRUSTEE_ACCESSA = *mut TRUSTEE_ACCESSA; +STRUCT!{struct TRUSTEE_ACCESSW { + lpProperty: LPWSTR, + Access: ACCESS_RIGHTS, + fAccessFlags: ULONG, + fReturnedAccess: ULONG, +}} +pub type PTRUSTEE_ACCESSW = *mut TRUSTEE_ACCESSW; +pub const ACTRL_RESERVED: ULONG = 0x00000000; +pub const ACTRL_PERM_1: ULONG = 0x00000001; +pub const ACTRL_PERM_2: ULONG = 0x00000002; +pub const ACTRL_PERM_3: ULONG = 0x00000004; +pub const ACTRL_PERM_4: ULONG = 0x00000008; +pub const ACTRL_PERM_5: ULONG = 0x00000010; +pub const ACTRL_PERM_6: ULONG = 0x00000020; +pub const ACTRL_PERM_7: ULONG = 0x00000040; +pub const ACTRL_PERM_8: ULONG = 0x00000080; +pub const ACTRL_PERM_9: ULONG = 0x00000100; +pub const ACTRL_PERM_10: ULONG = 0x00000200; +pub const ACTRL_PERM_11: ULONG = 0x00000400; +pub const ACTRL_PERM_12: ULONG = 0x00000800; +pub const ACTRL_PERM_13: ULONG = 0x00001000; +pub const ACTRL_PERM_14: ULONG = 0x00002000; +pub const ACTRL_PERM_15: ULONG = 0x00004000; +pub const ACTRL_PERM_16: ULONG = 0x00008000; +pub const ACTRL_PERM_17: ULONG = 0x00010000; +pub const ACTRL_PERM_18: ULONG = 0x00020000; +pub const ACTRL_PERM_19: ULONG = 0x00040000; +pub const ACTRL_PERM_20: ULONG = 0x00080000; +pub const ACTRL_ACCESS_ALLOWED: ULONG = 0x00000001; +pub const ACTRL_ACCESS_DENIED: ULONG = 0x00000002; +pub const ACTRL_AUDIT_SUCCESS: ULONG = 0x00000004; +pub const ACTRL_AUDIT_FAILURE: ULONG = 0x00000008; +pub const ACTRL_ACCESS_PROTECTED: ULONG = 0x00000001; +pub const ACTRL_SYSTEM_ACCESS: ULONG = 0x04000000; +pub const ACTRL_DELETE: ULONG = 0x08000000; +pub const ACTRL_READ_CONTROL: ULONG = 0x10000000; +pub const ACTRL_CHANGE_ACCESS: ULONG = 0x20000000; +pub const ACTRL_CHANGE_OWNER: ULONG = 0x40000000; +pub const ACTRL_SYNCHRONIZE: ULONG = 0x80000000; +pub const ACTRL_STD_RIGHTS_ALL: ULONG = 0xf8000000; +pub const ACTRL_STD_RIGHT_REQUIRED: ULONG = ACTRL_STD_RIGHTS_ALL & !ACTRL_SYNCHRONIZE; +pub const ACTRL_DS_OPEN: ULONG = ACTRL_RESERVED; +pub const ACTRL_DS_CREATE_CHILD: ULONG = ACTRL_PERM_1; +pub const ACTRL_DS_DELETE_CHILD: ULONG = ACTRL_PERM_2; +pub const ACTRL_DS_LIST: ULONG = ACTRL_PERM_3; +pub const ACTRL_DS_SELF: ULONG = ACTRL_PERM_4; +pub const ACTRL_DS_READ_PROP: ULONG = ACTRL_PERM_5; +pub const ACTRL_DS_WRITE_PROP: ULONG = ACTRL_PERM_6; +pub const ACTRL_DS_DELETE_TREE: ULONG = ACTRL_PERM_7; +pub const ACTRL_DS_LIST_OBJECT: ULONG = ACTRL_PERM_8; +pub const ACTRL_DS_CONTROL_ACCESS: ULONG = ACTRL_PERM_9; +pub const ACTRL_FILE_READ: ULONG = ACTRL_PERM_1; +pub const ACTRL_FILE_WRITE: ULONG = ACTRL_PERM_2; +pub const ACTRL_FILE_APPEND: ULONG = ACTRL_PERM_3; +pub const ACTRL_FILE_READ_PROP: ULONG = ACTRL_PERM_4; +pub const ACTRL_FILE_WRITE_PROP: ULONG = ACTRL_PERM_5; +pub const ACTRL_FILE_EXECUTE: ULONG = ACTRL_PERM_6; +pub const ACTRL_FILE_READ_ATTRIB: ULONG = ACTRL_PERM_8; +pub const ACTRL_FILE_WRITE_ATTRIB: ULONG = ACTRL_PERM_9; +pub const ACTRL_FILE_CREATE_PIPE: ULONG = ACTRL_PERM_10; +pub const ACTRL_DIR_LIST: ULONG = ACTRL_PERM_1; +pub const ACTRL_DIR_CREATE_OBJECT: ULONG = ACTRL_PERM_2; +pub const ACTRL_DIR_CREATE_CHILD: ULONG = ACTRL_PERM_3; +pub const ACTRL_DIR_DELETE_CHILD: ULONG = ACTRL_PERM_7; +pub const ACTRL_DIR_TRAVERSE: ULONG = ACTRL_PERM_6; +pub const ACTRL_KERNEL_TERMINATE: ULONG = ACTRL_PERM_1; +pub const ACTRL_KERNEL_THREAD: ULONG = ACTRL_PERM_2; +pub const ACTRL_KERNEL_VM: ULONG = ACTRL_PERM_3; +pub const ACTRL_KERNEL_VM_READ: ULONG = ACTRL_PERM_4; +pub const ACTRL_KERNEL_VM_WRITE: ULONG = ACTRL_PERM_5; +pub const ACTRL_KERNEL_DUP_HANDLE: ULONG = ACTRL_PERM_6; +pub const ACTRL_KERNEL_PROCESS: ULONG = ACTRL_PERM_7; +pub const ACTRL_KERNEL_SET_INFO: ULONG = ACTRL_PERM_8; +pub const ACTRL_KERNEL_GET_INFO: ULONG = ACTRL_PERM_9; +pub const ACTRL_KERNEL_CONTROL: ULONG = ACTRL_PERM_10; +pub const ACTRL_KERNEL_ALERT: ULONG = ACTRL_PERM_11; +pub const ACTRL_KERNEL_GET_CONTEXT: ULONG = ACTRL_PERM_12; +pub const ACTRL_KERNEL_SET_CONTEXT: ULONG = ACTRL_PERM_13; +pub const ACTRL_KERNEL_TOKEN: ULONG = ACTRL_PERM_14; +pub const ACTRL_KERNEL_IMPERSONATE: ULONG = ACTRL_PERM_15; +pub const ACTRL_KERNEL_DIMPERSONATE: ULONG = ACTRL_PERM_16; +pub const ACTRL_PRINT_SADMIN: ULONG = ACTRL_PERM_1; +pub const ACTRL_PRINT_SLIST: ULONG = ACTRL_PERM_2; +pub const ACTRL_PRINT_PADMIN: ULONG = ACTRL_PERM_3; +pub const ACTRL_PRINT_PUSE: ULONG = ACTRL_PERM_4; +pub const ACTRL_PRINT_JADMIN: ULONG = ACTRL_PERM_5; +pub const ACTRL_SVC_GET_INFO: ULONG = ACTRL_PERM_1; +pub const ACTRL_SVC_SET_INFO: ULONG = ACTRL_PERM_2; +pub const ACTRL_SVC_STATUS: ULONG = ACTRL_PERM_3; +pub const ACTRL_SVC_LIST: ULONG = ACTRL_PERM_4; +pub const ACTRL_SVC_START: ULONG = ACTRL_PERM_5; +pub const ACTRL_SVC_STOP: ULONG = ACTRL_PERM_6; +pub const ACTRL_SVC_PAUSE: ULONG = ACTRL_PERM_7; +pub const ACTRL_SVC_INTERROGATE: ULONG = ACTRL_PERM_8; +pub const ACTRL_SVC_UCONTROL: ULONG = ACTRL_PERM_9; +pub const ACTRL_REG_QUERY: ULONG = ACTRL_PERM_1; +pub const ACTRL_REG_SET: ULONG = ACTRL_PERM_2; +pub const ACTRL_REG_CREATE_CHILD: ULONG = ACTRL_PERM_3; +pub const ACTRL_REG_LIST: ULONG = ACTRL_PERM_4; +pub const ACTRL_REG_NOTIFY: ULONG = ACTRL_PERM_5; +pub const ACTRL_REG_LINK: ULONG = ACTRL_PERM_6; +pub const ACTRL_WIN_CLIPBRD: ULONG = ACTRL_PERM_1; +pub const ACTRL_WIN_GLOBAL_ATOMS: ULONG = ACTRL_PERM_2; +pub const ACTRL_WIN_CREATE: ULONG = ACTRL_PERM_3; +pub const ACTRL_WIN_LIST_DESK: ULONG = ACTRL_PERM_4; +pub const ACTRL_WIN_LIST: ULONG = ACTRL_PERM_5; +pub const ACTRL_WIN_READ_ATTRIBS: ULONG = ACTRL_PERM_6; +pub const ACTRL_WIN_WRITE_ATTRIBS: ULONG = ACTRL_PERM_7; +pub const ACTRL_WIN_SCREEN: ULONG = ACTRL_PERM_8; +pub const ACTRL_WIN_EXIT: ULONG = ACTRL_PERM_9; +UNION!{union ACTRL_OVERLAPPED_u { + [u32; 1] [u64; 1], + Provider Provider_mut: PVOID, + Reserved1 Reserved1_mut: ULONG, +}} +STRUCT!{struct ACTRL_OVERLAPPED { + u: ACTRL_OVERLAPPED_u, + Reserved2: ULONG, + hEvent: HANDLE, +}} +pub type PACTRL_OVERLAPPED = *mut ACTRL_OVERLAPPED; +STRUCT!{struct ACTRL_ACCESS_INFOA { + fAccessPermission: ULONG, + lpAccessPermissionName: LPSTR, +}} +pub type PACTRL_ACCESS_INFOA = *mut ACTRL_ACCESS_INFOA; +STRUCT!{struct ACTRL_ACCESS_INFOW { + fAccessPermission: ULONG, + lpAccessPermissionName: LPWSTR, +}} +pub type PACTRL_ACCESS_INFOW = *mut ACTRL_ACCESS_INFOW; +STRUCT!{struct ACTRL_CONTROL_INFOA { + lpControlId: LPSTR, + lpControlName: LPSTR, +}} +pub type PACTRL_CONTROL_INFOA = *mut ACTRL_CONTROL_INFOA; +STRUCT!{struct ACTRL_CONTROL_INFOW { + lpControlId: LPWSTR, + lpControlName: LPWSTR, +}} +pub type PACTRL_CONTROL_INFOW = *mut ACTRL_CONTROL_INFOW; +pub const ACTRL_ACCESS_NO_OPTIONS: DWORD = 0x00000000; +pub const ACTRL_ACCESS_SUPPORTS_OBJECT_ENTRIES: DWORD = 0x00000001; +pub const TREE_SEC_INFO_SET: DWORD = 0x00000001; +pub const TREE_SEC_INFO_RESET: DWORD = 0x00000002; +pub const TREE_SEC_INFO_RESET_KEEP_EXPLICIT: DWORD = 0x00000003; +ENUM!{enum PROG_INVOKE_SETTING { + ProgressInvokeNever = 1, + ProgressInvokeEveryObject, + ProgressInvokeOnError, + ProgressCancelOperation, + ProgressRetryOperation, + ProgressInvokePrePostError, +}} +pub type PPROG_INVOKE_SETTING = *mut PROG_INVOKE_SETTING; +STRUCT!{struct FN_OBJECT_MGR_FUNCTS { + Placeholder: ULONG, +}} +pub type PFN_OBJECT_MGR_FUNCTS = *mut FN_OBJECT_MGR_FUNCTS; +STRUCT!{struct INHERITED_FROMA { + GenerationGap: LONG, + AncestorName: LPSTR, +}} +pub type PINHERITED_FROMA = *mut INHERITED_FROMA; +STRUCT!{struct INHERITED_FROMW { + GenerationGap: LONG, + AncestorName: LPWSTR, +}} +pub type PINHERITED_FROMW = *mut INHERITED_FROMW; diff --git a/bash-5.1/vendor/winapi/src/um/aclapi.rs b/bash-5.1/vendor/winapi/src/um/aclapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..5c2c5f121c5e92ded9d49a27ef9276e6033e94a3 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/aclapi.rs @@ -0,0 +1,362 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, DWORD, PULONG, ULONG, USHORT}; +use um::accctrl::{ + ACCESS_MODE, MULTIPLE_TRUSTEE_OPERATION, PEXPLICIT_ACCESS_A, PEXPLICIT_ACCESS_W, + PFN_OBJECT_MGR_FUNCTS, PINHERITED_FROMA, PINHERITED_FROMW, POBJECTS_AND_NAME_A, + POBJECTS_AND_NAME_W, POBJECTS_AND_SID, PPROG_INVOKE_SETTING, PROG_INVOKE_SETTING, PTRUSTEE_A, + PTRUSTEE_W, SE_OBJECT_TYPE, TRUSTEE_FORM, TRUSTEE_TYPE +}; +use um::winnt::{ + HANDLE, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PACCESS_MASK, PACL, PGENERIC_MAPPING, + PSECURITY_DESCRIPTOR, PSID, PVOID, SECURITY_INFORMATION +}; +FN!{cdecl FN_PROGRESS( + pObjectName: LPWSTR, + Status: DWORD, + pInvokeSetting: PPROG_INVOKE_SETTING, + Args: PVOID, + SecuritySet: BOOL, +) -> ()} +extern "system" { + pub fn SetEntriesInAclA( + cCountOfExplicitEntries: ULONG, + pListOfExplicitEntries: PEXPLICIT_ACCESS_A, + OldAcl: PACL, + NewAcl: *mut PACL, + ) -> DWORD; + pub fn SetEntriesInAclW( + cCountOfExplicitEntries: ULONG, + pListOfExplicitEntries: PEXPLICIT_ACCESS_W, + OldAcl: PACL, + NewAcl: *mut PACL, + ) -> DWORD; + pub fn GetExplicitEntriesFromAclA( + pacl: PACL, + pcCountOfExplicitEntries: PULONG, + pListOfExplicitEntries: *mut PEXPLICIT_ACCESS_A, + ) -> DWORD; + pub fn GetExplicitEntriesFromAclW( + pacl: PACL, + pcCountOfExplicitEntries: PULONG, + pListOfExplicitEntries: *mut PEXPLICIT_ACCESS_W, + ) -> DWORD; + pub fn GetEffectiveRightsFromAclA( + pacl: PACL, + pTrustee: PTRUSTEE_A, + pAccessRight: PACCESS_MASK, + ) -> DWORD; + pub fn GetEffectiveRightsFromAclW( + pacl: PACL, + pTrustee: PTRUSTEE_W, + pAccessRight: PACCESS_MASK, + ) -> DWORD; + pub fn GetAuditedPermissionsFromAclA( + pAcl: PACL, + pTrustee: PTRUSTEE_A, + pSuccessfulAuditedRights: PACCESS_MASK, + pFailedAuditRights: PACCESS_MASK, + ) -> DWORD; + pub fn GetAuditedPermissionsFromAclW( + pAcl: PACL, + pTrustee: PTRUSTEE_W, + pSuccessfulAuditedRights: PACCESS_MASK, + pFailedAuditRights: PACCESS_MASK, + ) -> DWORD; + pub fn GetNamedSecurityInfoA( + pObjectName: LPCSTR, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + ppsidOwner: *mut PSID, + ppsidGroup: *mut PSID, + ppDacl: *mut PACL, + ppSacl: *mut PACL, + ppSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + ) -> DWORD; + pub fn GetNamedSecurityInfoW( + pObjectName: LPCWSTR, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + ppsidOwner: *mut PSID, + ppsidGroup: *mut PSID, + ppDacl: *mut PACL, + ppSacl: *mut PACL, + ppSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + ) -> DWORD; + pub fn GetSecurityInfo( + handle: HANDLE, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + ppsidOwner: *mut PSID, + ppsidGroup: *mut PSID, + ppDacl: *mut PACL, + ppSacl: *mut PACL, + ppSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + ) -> DWORD; + pub fn SetNamedSecurityInfoA( + pObjectame: LPSTR, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + psidOwner: PSID, + psidGroup: PSID, + pDacl: PACL, + pSacl: PACL, + ) -> DWORD; + pub fn SetNamedSecurityInfoW( + pObjectame: LPWSTR, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + psidOwner: PSID, + psidGroup: PSID, + pDacl: PACL, + pSacl: PACL, + ) -> DWORD; + pub fn SetSecurityInfo( + handle: HANDLE, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + psidOwner: PSID, + psidGroup: PSID, + pDacl: PACL, + pSacl: PACL, + ) -> DWORD; + pub fn GetInheritanceSourceA( + pObjectName: LPSTR, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + Container: BOOL, + pObjectClassGuids: *mut *mut GUID, + GuidCount: DWORD, + pAcl: PACL, + pfnArray: PFN_OBJECT_MGR_FUNCTS, + pGenericMapping: PGENERIC_MAPPING, + pInheritArray: PINHERITED_FROMA, + ) -> DWORD; + pub fn GetInheritanceSourceW( + pObjectName: LPWSTR, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + Container: BOOL, + pObjectClassGuids: *mut *mut GUID, + GuidCount: DWORD, + pAcl: PACL, + pfnArray: PFN_OBJECT_MGR_FUNCTS, + pGenericMapping: PGENERIC_MAPPING, + pInheritArray: PINHERITED_FROMW, + ) -> DWORD; + pub fn FreeInheritedFromArray( + pInheritArray: PINHERITED_FROMW, + AceCnt: USHORT, + pfnArray: PFN_OBJECT_MGR_FUNCTS, + ) -> DWORD; + pub fn TreeResetNamedSecurityInfoA( + pObjectName: LPSTR, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + pOwner: PSID, + pGroup: PSID, + pDacl: PACL, + pSacl: PACL, + KeepExplicit: BOOL, + fnProgress: FN_PROGRESS, + ProgressInvokeSetting: PROG_INVOKE_SETTING, + Args: PVOID, + ) -> DWORD; + pub fn TreeResetNamedSecurityInfoW( + pObjectName: LPWSTR, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + pOwner: PSID, + pGroup: PSID, + pDacl: PACL, + pSacl: PACL, + KeepExplicit: BOOL, + fnProgress: FN_PROGRESS, + ProgressInvokeSetting: PROG_INVOKE_SETTING, + Args: PVOID, + ) -> DWORD; + pub fn TreeSetNamedSecurityInfoA( + pObjectName: LPSTR, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + pOwner: PSID, + pGroup: PSID, + pDacl: PACL, + pSacl: PACL, + dwAction: DWORD, + fnProgress: FN_PROGRESS, + ProgressInvokeSetting: PROG_INVOKE_SETTING, + Args: PVOID, + ) -> DWORD; + pub fn TreeSetNamedSecurityInfoW( + pObjectName: LPWSTR, + ObjectType: SE_OBJECT_TYPE, + SecurityInfo: SECURITY_INFORMATION, + pOwner: PSID, + pGroup: PSID, + pDacl: PACL, + pSacl: PACL, + dwAction: DWORD, + fnProgress: FN_PROGRESS, + ProgressInvokeSetting: PROG_INVOKE_SETTING, + Args: PVOID, + ) -> DWORD; + pub fn BuildSecurityDescriptorA( + pOwner: PTRUSTEE_A, + pGroup: PTRUSTEE_A, + cCountOfAccessEntries: ULONG, + pListOfAccessEntries: PEXPLICIT_ACCESS_A, + cCountOfAuditEntries: ULONG, + pListOfAuditEntries: PEXPLICIT_ACCESS_A, + pOldSD: PSECURITY_DESCRIPTOR, + pSizeNewSD: PULONG, + pNewSD: *mut PSECURITY_DESCRIPTOR, + ) -> DWORD; + pub fn BuildSecurityDescriptorW( + pOwner: PTRUSTEE_W, + pGroup: PTRUSTEE_W, + cCountOfAccessEntries: ULONG, + pListOfAccessEntries: PEXPLICIT_ACCESS_W, + cCountOfAuditEntries: ULONG, + pListOfAuditEntries: PEXPLICIT_ACCESS_W, + pOldSD: PSECURITY_DESCRIPTOR, + pSizeNewSD: PULONG, + pNewSD: *mut PSECURITY_DESCRIPTOR, + ) -> DWORD; + pub fn LookupSecurityDescriptorPartsA( + ppOwner: *mut PTRUSTEE_A, + ppGroup: *mut PTRUSTEE_A, + pcCountOfAccessEntries: PULONG, + ppListOfAccessEntries: *mut PEXPLICIT_ACCESS_A, + pcCountOfAuditEntries: PULONG, + ppListOfAuditEntries: *mut PEXPLICIT_ACCESS_A, + pSD: PSECURITY_DESCRIPTOR, + ) -> DWORD; + pub fn LookupSecurityDescriptorPartsW( + ppOwner: *mut PTRUSTEE_W, + ppGroup: *mut PTRUSTEE_W, + pcCountOfAccessEntries: PULONG, + ppListOfAccessEntries: *mut PEXPLICIT_ACCESS_W, + pcCountOfAuditEntries: PULONG, + ppListOfAuditEntries: *mut PEXPLICIT_ACCESS_W, + pSD: PSECURITY_DESCRIPTOR, + ) -> DWORD; + pub fn BuildExplicitAccessWithNameA( + pExplicitAccess: PEXPLICIT_ACCESS_A, + pTrusteeName: LPSTR, + AccessPermissions: DWORD, + AccessMode: ACCESS_MODE, + Inheritance: DWORD, + ); + pub fn BuildExplicitAccessWithNameW( + pExplicitAccess: PEXPLICIT_ACCESS_W, + pTrusteeName: LPWSTR, + AccessPermissions: DWORD, + AccessMode: ACCESS_MODE, + Inheritance: DWORD, + ); + pub fn BuildImpersonateExplicitAccessWithNameA( + pExplicitAccess: PEXPLICIT_ACCESS_A, + pTrusteeName: LPSTR, + pTrustee: PTRUSTEE_A, + AccessPermissions: DWORD, + AccessMode: ACCESS_MODE, + Inheritance: DWORD, + ); + pub fn BuildImpersonateExplicitAccessWithNameW( + pExplicitAccess: PEXPLICIT_ACCESS_W, + pTrusteeName: LPWSTR, + pTrustee: PTRUSTEE_W, + AccessPermissions: DWORD, + AccessMode: ACCESS_MODE, + Inheritance: DWORD, + ); + pub fn BuildTrusteeWithNameA( + pTrustee: PTRUSTEE_A, + pName: LPSTR, + ); + pub fn BuildTrusteeWithNameW( + pTrustee: PTRUSTEE_W, + pName: LPWSTR, + ); + pub fn BuildImpersonateTrusteeA( + pTrustee: PTRUSTEE_A, + pImpersonateTrustee: PTRUSTEE_A, + ); + pub fn BuildImpersonateTrusteeW( + pTrustee: PTRUSTEE_W, + pImpersonateTrustee: PTRUSTEE_W, + ); + pub fn BuildTrusteeWithSidA( + pTrustee: PTRUSTEE_A, + pSid: PSID, + ); + pub fn BuildTrusteeWithSidW( + pTrustee: PTRUSTEE_W, + pSid: PSID, + ); + pub fn BuildTrusteeWithObjectsAndSidA( + pTrustee: PTRUSTEE_A, + pObjSid: POBJECTS_AND_SID, + pObjectGuid: *mut GUID, + pInheritedObjectGuid: *mut GUID, + pSid: PSID, + ); + pub fn BuildTrusteeWithObjectsAndSidW( + pTrustee: PTRUSTEE_W, + pObjSid: POBJECTS_AND_SID, + pObjectGuid: *mut GUID, + pInheritedObjectGuid: *mut GUID, + pSid: PSID, + ); + pub fn BuildTrusteeWithObjectsAndNameA( + pTrustee: PTRUSTEE_A, + pObjName: POBJECTS_AND_NAME_A, + ObjectType: SE_OBJECT_TYPE, + ObjectTypeName: LPSTR, + InheritedObjectTypeName: LPSTR, + Name: LPSTR, + ); + pub fn BuildTrusteeWithObjectsAndNameW( + pTrustee: PTRUSTEE_W, + pObjName: POBJECTS_AND_NAME_W, + ObjectType: SE_OBJECT_TYPE, + ObjectTypeName: LPWSTR, + InheritedObjectTypeName: LPWSTR, + Name: LPWSTR, + ); + pub fn GetTrusteeNameA( + pTrustee: PTRUSTEE_A, + ) -> LPSTR; + pub fn GetTrusteeNameW( + pTrustee: PTRUSTEE_W, + ) -> LPWSTR; + pub fn GetTrusteeTypeA( + pTrustee: PTRUSTEE_A, + ) -> TRUSTEE_TYPE; + pub fn GetTrusteeTypeW( + pTrustee: PTRUSTEE_W, + ) -> TRUSTEE_TYPE; + pub fn GetTrusteeFormA( + pTrustee: PTRUSTEE_A, + ) -> TRUSTEE_FORM; + pub fn GetTrusteeFormW( + pTrustee: PTRUSTEE_W, + ) -> TRUSTEE_FORM; + pub fn GetMultipleTrusteeOperationA( + pTrustee: PTRUSTEE_A, + ) -> MULTIPLE_TRUSTEE_OPERATION; + pub fn GetMultipleTrusteeOperationW( + pTrustee: PTRUSTEE_W, + ) -> MULTIPLE_TRUSTEE_OPERATION; + pub fn GetMultipleTrusteeA( + pTrustee: PTRUSTEE_A, + ) -> PTRUSTEE_A; + pub fn GetMultipleTrusteeW( + pTrustee: PTRUSTEE_W, + ) -> PTRUSTEE_W; +} diff --git a/bash-5.1/vendor/winapi/src/um/adhoc.rs b/bash-5.1/vendor/winapi/src/um/adhoc.rs new file mode 100644 index 0000000000000000000000000000000000000000..7448c08d298b6ef3e225fde5bd58b0830e14c2b9 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/adhoc.rs @@ -0,0 +1,220 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::ULONG; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{BOOLEAN, HRESULT, LONG, LPCWSTR, LPWSTR}; +ENUM!{enum DOT11_ADHOC_CIPHER_ALGORITHM { + DOT11_ADHOC_CIPHER_ALGO_INVALID = -1i32 as u32, + DOT11_ADHOC_CIPHER_ALGO_NONE = 0, + DOT11_ADHOC_CIPHER_ALGO_CCMP = 0x4, + DOT11_ADHOC_CIPHER_ALGO_WEP = 0x101, +}} +ENUM!{enum DOT11_ADHOC_AUTH_ALGORITHM { + DOT11_ADHOC_AUTH_ALGO_INVALID = -1i32 as u32, + DOT11_ADHOC_AUTH_ALGO_80211_OPEN = 1, + DOT11_ADHOC_AUTH_ALGO_RSNA_PSK = 7, +}} +ENUM!{enum DOT11_ADHOC_NETWORK_CONNECTION_STATUS { + DOT11_ADHOC_NETWORK_CONNECTION_STATUS_INVALID = 0, + DOT11_ADHOC_NETWORK_CONNECTION_STATUS_DISCONNECTED = 11, + DOT11_ADHOC_NETWORK_CONNECTION_STATUS_CONNECTING = 12, + DOT11_ADHOC_NETWORK_CONNECTION_STATUS_CONNECTED = 13, + DOT11_ADHOC_NETWORK_CONNECTION_STATUS_FORMED = 14, +}} +ENUM!{enum DOT11_ADHOC_CONNECT_FAIL_REASON { + DOT11_ADHOC_CONNECT_FAIL_DOMAIN_MISMATCH = 0, + DOT11_ADHOC_CONNECT_FAIL_PASSPHRASE_MISMATCH = 1, + DOT11_ADHOC_CONNECT_FAIL_OTHER = 2, +}} +RIDL!{#[uuid(0x8f10cc26, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] +interface IDot11AdHocManager(IDot11AdHocManagerVtbl): IUnknown(IUnknownVtbl) { + fn CreateNetwork( + Name: LPCWSTR, + Password: LPCWSTR, + GeographicalId: LONG, + pInterface: *mut IDot11AdHocInterface, + pSecurity: *mut IDot11AdHocSecuritySettings, + pContextGuid: *mut GUID, + pIAdHoc: *mut *mut IDot11AdHocNetwork, + ) -> HRESULT, + fn CommitCreatedNetwork( + pIAdHoc: *mut IDot11AdHocNetwork, + fSaveProfile: BOOLEAN, + fMakeSavedProfileUserSpecific: BOOLEAN, + ) -> HRESULT, + fn GetIEnumDot11AdHocNetworks( + pContextGuid: *mut GUID, + ppEnum: *mut *mut IEnumDot11AdHocNetworks, + ) -> HRESULT, + fn GetIEnumDot11AdHocInterfaces( + ppEnum: *mut *mut IEnumDot11AdHocInterfaces, + ) -> HRESULT, + fn GetNetwork( + NetworkSignature: *mut GUID, + pNetwork: *mut *mut IDot11AdHocNetwork, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8f10cc27, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] +interface IDot11AdHocManagerNotificationSink(IDot11AdHocManagerNotificationSinkVtbl): + IUnknown(IUnknownVtbl) { + fn OnNetworkAdd( + pIAdHocNetwork: *mut IDot11AdHocNetwork, + ) -> HRESULT, + fn OnNetworkRemove( + Signature: *mut GUID, + ) -> HRESULT, + fn OnInterfaceAdd( + pIAdHocInterface: *mut IDot11AdHocInterface, + ) -> HRESULT, + fn OnInterfaceRemove( + Signature: *mut GUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8f10cc28, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] +interface IEnumDot11AdHocNetworks(IEnumDot11AdHocNetworksVtbl): IUnknown(IUnknownVtbl) { + fn Next( + cElt: ULONG, + rgElt: *mut *mut IDot11AdHocNetwork, + pcEltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + cElt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppEnum: *mut *mut IEnumDot11AdHocNetworks, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8f10cc29, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] +interface IDot11AdHocNetwork(IDot11AdHocNetworkVtbl): IUnknown(IUnknownVtbl) { + fn GetStatus( + eStatus: *mut DOT11_ADHOC_NETWORK_CONNECTION_STATUS, + ) -> HRESULT, + fn GetSSID( + ppszwSSID: *mut LPWSTR, + ) -> HRESULT, + fn HasProfile( + pf11d: *mut BOOLEAN, + ) -> HRESULT, + fn GetProfileName( + ppszwProfileName: *mut LPWSTR, + ) -> HRESULT, + fn DeleteProfile() -> HRESULT, + fn GetSignalQuality( + puStrengthValue: *mut ULONG, + puStrengthMax: *mut ULONG, + ) -> HRESULT, + fn GetSecuritySetting( + pAdHocSecuritySetting: *mut *mut IDot11AdHocSecuritySettings, + ) -> HRESULT, + fn GetContextGuid( + pContextGuid: *mut GUID, + ) -> HRESULT, + fn GetSignature( + pSignature: *mut GUID, + ) -> HRESULT, + fn GetInterface( + pAdHocInterface: *mut *mut IDot11AdHocInterface, + ) -> HRESULT, + fn Connect( + Passphrase: LPCWSTR, + GeographicalId: LONG, + fSaveProfile: BOOLEAN, + fMakeSavedProfileUserSpecific: BOOLEAN, + ) -> HRESULT, + fn Disconnect() -> HRESULT, +}} +RIDL!{#[uuid(0x8f10cc2a, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] +interface IDot11AdHocNetworkNotificationSink(IDot11AdHocNetworkNotificationSinkVtbl): + IUnknown(IUnknownVtbl) { + fn OnStatusChange( + eStatus: DOT11_ADHOC_NETWORK_CONNECTION_STATUS, + ) -> HRESULT, + fn OnConnectFail( + eFailReason: DOT11_ADHOC_CONNECT_FAIL_REASON, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8f10cc2b, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] +interface IDot11AdHocInterface(IDot11AdHocInterfaceVtbl): IUnknown(IUnknownVtbl) { + fn GetDeviceSignature( + pSignature: *mut GUID, + ) -> HRESULT, + fn GetFriendlyName( + ppszName: *mut LPWSTR, + ) -> HRESULT, + fn IsDot11d( + pf11d: *mut BOOLEAN, + ) -> HRESULT, + fn IsAdHocCapable( + pfAdHocCapable: *mut BOOLEAN, + ) -> HRESULT, + fn IsRadioOn( + pfIsRadioOn: *mut BOOLEAN, + ) -> HRESULT, + fn GetActiveNetwork( + ppNetwork: *mut *mut IDot11AdHocNetwork, + ) -> HRESULT, + fn GetIEnumSecuritySettings( + ppEnum: *mut *mut IEnumDot11AdHocSecuritySettings, + ) -> HRESULT, + fn GetIEnumDot11AdHocNetworks( + pFilterGuid: *mut GUID, + ppEnum: *mut *mut IEnumDot11AdHocNetworks, + ) -> HRESULT, + fn GetStatus( + pState: *mut DOT11_ADHOC_NETWORK_CONNECTION_STATUS, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8f10cc2c, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] +interface IEnumDot11AdHocInterfaces(IEnumDot11AdHocInterfacesVtbl): IUnknown(IUnknownVtbl) { + fn Next( + cElt: ULONG, + rgElt: *mut *mut IDot11AdHocInterface, + pcEltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + cElt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppEnum: *mut *mut IEnumDot11AdHocInterfaces, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8f10cc2d, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] +interface IEnumDot11AdHocSecuritySettings(IEnumDot11AdHocSecuritySettingsVtbl): + IUnknown(IUnknownVtbl) { + fn Next( + cElt: ULONG, + rgElt: *mut *mut IDot11AdHocSecuritySettings, + pcEltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + cElt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppEnum: *mut *mut IEnumDot11AdHocSecuritySettings, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8f10cc2e, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] +interface IDot11AdHocSecuritySettings(IDot11AdHocSecuritySettingsVtbl): IUnknown(IUnknownVtbl) { + fn GetDot11AuthAlgorithm( + pAuth: *mut DOT11_ADHOC_AUTH_ALGORITHM, + ) -> HRESULT, + fn GetDot11CipherAlgorithm( + pCipher: *mut DOT11_ADHOC_CIPHER_ALGORITHM, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8f10cc2f, 0xcf0d, 0x42a0, 0xac, 0xbe, 0xe2, 0xde, 0x70, 0x07, 0x38, 0x4d)] +interface IDot11AdHocInterfaceNotificationSink(IDot11AdHocInterfaceNotificationSinkVtbl): + IUnknown(IUnknownVtbl) { + fn OnConnectionStatusChange( + eStatus: DOT11_ADHOC_NETWORK_CONNECTION_STATUS, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdd06a84f, 0x83bd, 0x4d01, 0x8a, 0xb9, 0x23, 0x89, 0xfe, 0xa0, 0x86, 0x9e)] +class Dot11AdHocManager;} diff --git a/bash-5.1/vendor/winapi/src/um/appmgmt.rs b/bash-5.1/vendor/winapi/src/um/appmgmt.rs new file mode 100644 index 0000000000000000000000000000000000000000..1d7b910d4eec574d0f1f0d10d392756d4d8c5791 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/appmgmt.rs @@ -0,0 +1,122 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, DWORD, LPDWORD}; +use um::winnt::{LANGID, LCID, LPWSTR, WCHAR}; +ENUM!{enum INSTALLSPECTYPE { + APPNAME = 1, + FILEEXT, + PROGID, + COMCLASS, +}} +STRUCT!{struct INSTALLSPEC_APPNAME { + Name: *mut WCHAR, + GPOId: GUID, +}} +STRUCT!{struct INSTALLSPEC_COMCLASS { + Clsid: GUID, + ClsCtx: DWORD, +}} +UNION!{union INSTALLSPEC { + [u32; 5] [u64; 3], + AppName AppName_mut: INSTALLSPEC_APPNAME, + FileExt FileExt_mut: *mut WCHAR, + ProgId ProgId_mut: *mut WCHAR, + COMClass COMClass_mut: INSTALLSPEC_COMCLASS, +}} +STRUCT!{struct INSTALLDATA { + Type: INSTALLSPECTYPE, + Spec: INSTALLSPEC, +}} +pub type PINSTALLDATA = *mut INSTALLDATA; +ENUM!{enum APPSTATE { + ABSENT, + ASSIGNED, + PUBLISHED, +}} +pub const LOCALSTATE_ASSIGNED: DWORD = 0x1; +pub const LOCALSTATE_PUBLISHED: DWORD = 0x2; +pub const LOCALSTATE_UNINSTALL_UNMANAGED: DWORD = 0x4; +pub const LOCALSTATE_POLICYREMOVE_ORPHAN: DWORD = 0x8; +pub const LOCALSTATE_POLICYREMOVE_UNINSTALL: DWORD = 0x10; +pub const LOCALSTATE_ORPHANED: DWORD = 0x20; +pub const LOCALSTATE_UNINSTALLED: DWORD = 0x40; +STRUCT!{struct LOCALMANAGEDAPPLICATION { + pszDeploymentName: LPWSTR, + pszPolicyName: LPWSTR, + pszProductId: LPWSTR, + dwState: DWORD, +}} +pub type PLOCALMANAGEDAPPLICATION = *mut LOCALMANAGEDAPPLICATION; +pub const MANAGED_APPS_USERAPPLICATIONS: DWORD = 0x1; +pub const MANAGED_APPS_FROMCATEGORY: DWORD = 0x2; +pub const MANAGED_APPS_INFOLEVEL_DEFAULT: DWORD = 0x10000; +pub const MANAGED_APPTYPE_WINDOWSINSTALLER: DWORD = 0x1; +pub const MANAGED_APPTYPE_SETUPEXE: DWORD = 0x2; +pub const MANAGED_APPTYPE_UNSUPPORTED: DWORD = 0x3; +STRUCT!{struct MANAGEDAPPLICATION { + pszPackageName: LPWSTR, + pszPublisher: LPWSTR, + dwVersionHi: DWORD, + dwVersionLo: DWORD, + dwRevision: DWORD, + GpoId: GUID, + pszPolicyName: LPWSTR, + ProductId: GUID, + Language: LANGID, + pszOwner: LPWSTR, + pszCompany: LPWSTR, + pszComments: LPWSTR, + pszContact: LPWSTR, + pszSupportUrl: LPWSTR, + dwPathType: DWORD, + bInstalled: BOOL, +}} +pub type PMANAGEDAPPLICATION = *mut MANAGEDAPPLICATION; +STRUCT!{struct APPCATEGORYINFO { + Locale: LCID, + pszDescription: LPWSTR, + AppCategoryId: GUID, +}} +STRUCT!{struct APPCATEGORYINFOLIST { + cCategory: DWORD, + pCategoryInfo: *mut APPCATEGORYINFO, +}} +extern "system" { + pub fn InstallApplication( + pInstallInfo: PINSTALLDATA, + ) -> DWORD; + pub fn UninstallApplication( + ProductCode: LPWSTR, + dwStatus: DWORD, + ) -> DWORD; + pub fn CommandLineFromMsiDescriptor( + Descriptor: LPWSTR, + CommandLine: LPWSTR, + CommandLineLength: *mut DWORD, + ) -> DWORD; + pub fn GetManagedApplications( + pCategory: *mut GUID, + dwQueryFlags: DWORD, + dwInfoLevel: DWORD, + pdwApps: LPDWORD, + prgManagedApps: *mut PMANAGEDAPPLICATION, + ) -> DWORD; + pub fn GetLocalManagedApplications( + bUserApps: BOOL, + pdwApps: LPDWORD, + prgManagedApps: *mut PMANAGEDAPPLICATION, + ) -> DWORD; + pub fn GetLocalManagedApplicationData( + ProductCode: LPWSTR, + DisplayName: *mut LPWSTR, + SupportUrl: *mut LPWSTR, + ); + pub fn GetManagedApplicationCategories( + dwReserved: DWORD, + pAppCategory: *mut APPCATEGORYINFOLIST, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/audioclient.rs b/bash-5.1/vendor/winapi/src/um/audioclient.rs new file mode 100644 index 0000000000000000000000000000000000000000..5f7b83e4676cef39d2b5e40a0d8f9db6c48679f9 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/audioclient.rs @@ -0,0 +1,172 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! this ALWAYS GENERATED file contains the definitions for the interfaces +use ctypes::c_float; +use shared::basetsd::{UINT32, UINT64}; +use shared::guiddef::{LPCGUID, REFIID}; +use shared::minwindef::{BYTE, DWORD, LPVOID}; +use shared::mmreg::WAVEFORMATEX; +use shared::winerror::{FACILITY_AUDCLNT, SEVERITY_ERROR, SEVERITY_SUCCESS}; +use shared::wtypesbase::SCODE; +use um::audiosessiontypes::AUDCLNT_SHAREMODE; +use um::strmif::REFERENCE_TIME; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT}; +//1627 +pub const AUDCLNT_E_NOT_INITIALIZED: HRESULT = AUDCLNT_ERR!(0x001); +pub const AUDCLNT_E_ALREADY_INITIALIZED: HRESULT = AUDCLNT_ERR!(0x002); +pub const AUDCLNT_E_WRONG_ENDPOINT_TYPE: HRESULT = AUDCLNT_ERR!(0x003); +pub const AUDCLNT_E_DEVICE_INVALIDATED: HRESULT = AUDCLNT_ERR!(0x004); +pub const AUDCLNT_E_NOT_STOPPED: HRESULT = AUDCLNT_ERR!(0x005); +pub const AUDCLNT_E_BUFFER_TOO_LARGE: HRESULT = AUDCLNT_ERR!(0x006); +pub const AUDCLNT_E_OUT_OF_ORDER: HRESULT = AUDCLNT_ERR!(0x007); +pub const AUDCLNT_E_UNSUPPORTED_FORMAT: HRESULT = AUDCLNT_ERR!(0x008); +pub const AUDCLNT_E_INVALID_SIZE: HRESULT = AUDCLNT_ERR!(0x009); +pub const AUDCLNT_E_DEVICE_IN_USE: HRESULT = AUDCLNT_ERR!(0x00a); +pub const AUDCLNT_E_BUFFER_OPERATION_PENDING: HRESULT = AUDCLNT_ERR!(0x00b); +pub const AUDCLNT_E_THREAD_NOT_REGISTERED: HRESULT = AUDCLNT_ERR!(0x00c); +pub const AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED: HRESULT = AUDCLNT_ERR!(0x00e); +pub const AUDCLNT_E_ENDPOINT_CREATE_FAILED: HRESULT = AUDCLNT_ERR!(0x00f); +pub const AUDCLNT_E_SERVICE_NOT_RUNNING: HRESULT = AUDCLNT_ERR!(0x010); +pub const AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED: HRESULT = AUDCLNT_ERR!(0x011); +pub const AUDCLNT_E_EXCLUSIVE_MODE_ONLY: HRESULT = AUDCLNT_ERR!(0x012); +pub const AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL: HRESULT = AUDCLNT_ERR!(0x013); +pub const AUDCLNT_E_EVENTHANDLE_NOT_SET: HRESULT = AUDCLNT_ERR!(0x014); +pub const AUDCLNT_E_INCORRECT_BUFFER_SIZE: HRESULT = AUDCLNT_ERR!(0x015); +pub const AUDCLNT_E_BUFFER_SIZE_ERROR: HRESULT = AUDCLNT_ERR!(0x016); +pub const AUDCLNT_E_CPUUSAGE_EXCEEDED: HRESULT = AUDCLNT_ERR!(0x017); +pub const AUDCLNT_E_BUFFER_ERROR: HRESULT = AUDCLNT_ERR!(0x018); +pub const AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED: HRESULT = AUDCLNT_ERR!(0x019); +pub const AUDCLNT_E_INVALID_DEVICE_PERIOD: HRESULT = AUDCLNT_ERR!(0x020); +pub const AUDCLNT_E_INVALID_STREAM_FLAG: HRESULT = AUDCLNT_ERR!(0x021); +pub const AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE: HRESULT = AUDCLNT_ERR!(0x022); +pub const AUDCLNT_E_OUT_OF_OFFLOAD_RESOURCES: HRESULT = AUDCLNT_ERR!(0x023); +pub const AUDCLNT_E_OFFLOAD_MODE_ONLY: HRESULT = AUDCLNT_ERR!(0x024); +pub const AUDCLNT_E_NONOFFLOAD_MODE_ONLY: HRESULT = AUDCLNT_ERR!(0x025); +pub const AUDCLNT_E_RESOURCES_INVALIDATED: HRESULT = AUDCLNT_ERR!(0x026); +pub const AUDCLNT_E_RAW_MODE_UNSUPPORTED: HRESULT = AUDCLNT_ERR!(0x027); +pub const AUDCLNT_S_BUFFER_EMPTY: SCODE = AUDCLNT_SUCCESS!(0x001); +pub const AUDCLNT_S_THREAD_ALREADY_REGISTERED: SCODE = AUDCLNT_SUCCESS!(0x002); +pub const AUDCLNT_S_POSITION_STALLED: SCODE = AUDCLNT_SUCCESS!(0x003); +ENUM!{enum AUDCLNT_BUFFERFLAGS { + AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY = 0x1, + AUDCLNT_BUFFERFLAGS_SILENT = 0x2, + AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR = 0x4, +}} +DEFINE_GUID!{IID_IAudioClient, + 0x1CB9AD4C, 0xDBFA, 0x4c32, 0xB1, 0x78, 0xC2, 0xF5, 0x68, 0xA7, 0x03, 0xB2} +DEFINE_GUID!{IID_IAudioRenderClient, + 0xF294ACFC, 0x3146, 0x4483, 0xA7, 0xBF, 0xAD, 0xDC, 0xA7, 0xC2, 0x60, 0xE2} +DEFINE_GUID!{IID_IAudioCaptureClient, + 0xc8adbd64, 0xe71e, 0x48a0, 0xa4, 0xde, 0x18, 0x5c, 0x39, 0x5c, 0xd3, 0x17} +DEFINE_GUID!{IID_IAudioClock, + 0xcd63314f, 0x3fba, 0x4a1b, 0x81, 0x2c, 0xef, 0x96, 0x35, 0x87, 0x28, 0xe7} +DEFINE_GUID!{IID_IAudioStreamVolume, + 0x93014887, 0x242d, 0x4068, 0x8a, 0x15, 0xcf, 0x5e, 0x93, 0xb9, 0x0f, 0xe3} +RIDL!{#[uuid(0x1cb9ad4c, 0xdbfa, 0x4c32, 0xb1, 0x78, 0xc2, 0xf5, 0x68, 0xa7, 0x03, 0xb2)] +interface IAudioClient(IAudioClientVtbl): IUnknown(IUnknownVtbl) { + fn Initialize( + ShareMode: AUDCLNT_SHAREMODE, + StreamFlags: DWORD, + hnsBufferDuration: REFERENCE_TIME, + hnsPeriodicity: REFERENCE_TIME, + pFormat: *const WAVEFORMATEX, + AudioSessionGuid: LPCGUID, + ) -> HRESULT, + fn GetBufferSize( + pNumBufferFrames: *mut UINT32, + ) -> HRESULT, + fn GetStreamLatency( + phnsLatency: *mut REFERENCE_TIME, + ) -> HRESULT, + fn GetCurrentPadding( + pNumPaddingFrames: *mut UINT32, + ) -> HRESULT, + fn IsFormatSupported( + ShareMode: AUDCLNT_SHAREMODE, + pFormat: *const WAVEFORMATEX, + ppClosestMatch: *mut *mut WAVEFORMATEX, + ) -> HRESULT, + fn GetMixFormat( + ppDeviceFormat: *mut *mut WAVEFORMATEX, + ) -> HRESULT, + fn GetDevicePeriod( + phnsDefaultDevicePeriod: *mut REFERENCE_TIME, + phnsMinimumDevicePeriod: *mut REFERENCE_TIME, + ) -> HRESULT, + fn Start() -> HRESULT, + fn Stop() -> HRESULT, + fn Reset() -> HRESULT, + fn SetEventHandle( + eventHandle: HANDLE, + ) -> HRESULT, + fn GetService( + riid: REFIID, + ppv: *mut LPVOID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf294acfc, 0x3146, 0x4483, 0xa7, 0xbf, 0xad, 0xdc, 0xa7, 0xc2, 0x60, 0xe2)] +interface IAudioRenderClient(IAudioRenderClientVtbl): IUnknown(IUnknownVtbl) { + fn GetBuffer( + NumFramesRequested: UINT32, + ppData: *mut *mut BYTE, + ) -> HRESULT, + fn ReleaseBuffer( + NumFramesWritten: UINT32, + dwFlags: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc8adbd64, 0xe71e, 0x48a0, 0xa4, 0xde, 0x18, 0x5c, 0x39, 0x5c, 0xd3, 0x17)] +interface IAudioCaptureClient(IAudioCaptureClientVtbl): IUnknown(IUnknownVtbl) { + fn GetBuffer( + ppData: *mut *mut BYTE, + pNumFramesToRead: *mut UINT32, + pdwFlags: *mut DWORD, + pu64DevicePosition: *mut UINT64, + pu64QPCPosition: *mut UINT64, + ) -> HRESULT, + fn ReleaseBuffer( + NumFramesRead: UINT32, + ) -> HRESULT, + fn GetNextPacketSize( + pNumFramesInNextPacket: *mut UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xcd63314f, 0x3fba, 0x4a1b, 0x81, 0x2c, 0xef, 0x96, 0x35, 0x87, 0x28, 0xe7)] +interface IAudioClock(IAudioClockVtbl): IUnknown(IUnknownVtbl) { + fn GetFrequency( + pu64Frequency: *mut UINT64, + ) -> HRESULT, + fn GetPosition( + pu64Position: *mut UINT64, + pu64QPCPosition: *mut UINT64, + ) -> HRESULT, + fn GetCharacteristics( + pdwCharacteristics: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x93014887, 0x242d, 0x4068, 0x8a, 0x15, 0xcf, 0x5e, 0x93, 0xb9, 0x0f, 0xe3)] +interface IAudioStreamVolume(IAudioStreamVolumeVtbl): IUnknown(IUnknownVtbl) { + fn GetChannelCount( + pdwCount: *mut UINT32, + ) -> HRESULT, + fn SetChannelVolume( + dwIndex: UINT32, + fLevel: c_float, + ) -> HRESULT, + fn GetChannelVolume( + dwIndex: UINT32, + pfLevel: *mut c_float, + ) -> HRESULT, + fn SetAllVolumes( + dwCount: UINT32, + pfVolumes: *const c_float, + ) -> HRESULT, + fn GetAllVolumes( + dwCount: UINT32, + pfVolumes: *mut c_float, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/audiosessiontypes.rs b/bash-5.1/vendor/winapi/src/um/audiosessiontypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..3c64f4244cdd74a6499705f7126bd5cd3d0ed31f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/audiosessiontypes.rs @@ -0,0 +1,37 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::DWORD; +ENUM!{enum AUDCLNT_SHAREMODE { + AUDCLNT_SHAREMODE_SHARED, + AUDCLNT_SHAREMODE_EXCLUSIVE, +}} +ENUM!{enum AUDIO_STREAM_CATEGORY { + AudioCategory_Other = 0, + AudioCategory_ForegroundOnlyMedia = 1, + AudioCategory_BackgroundCapableMedia = 2, + AudioCategory_Communications = 3, + AudioCategory_Alerts = 4, + AudioCategory_SoundEffects = 5, + AudioCategory_GameEffects = 6, + AudioCategory_GameMedia = 7, + AudioCategory_GameChat = 8, + AudioCategory_Speech = 9, + AudioCategory_Movie = 10, + AudioCategory_Media = 11, +}} +pub const AUDCLNT_STREAMFLAGS_CROSSPROCESS: DWORD = 0x00010000; +pub const AUDCLNT_STREAMFLAGS_LOOPBACK: DWORD = 0x00020000; +pub const AUDCLNT_STREAMFLAGS_EVENTCALLBACK: DWORD = 0x00040000; +pub const AUDCLNT_STREAMFLAGS_NOPERSIST: DWORD = 0x00080000; +pub const AUDCLNT_STREAMFLAGS_RATEADJUST: DWORD = 0x00100000; +pub const AUDCLNT_SESSIONFLAGS_EXPIREWHENUNOWNED: DWORD = 0x10000000; +pub const AUDCLNT_SESSIONFLAGS_DISPLAY_HIDE: DWORD = 0x20000000; +pub const AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED: DWORD = 0x40000000; +ENUM!{enum AudioSessionState { + AudioSessionStateInactive = 0, + AudioSessionStateActive = 1, + AudioSessionStateExpired = 2, +}} diff --git a/bash-5.1/vendor/winapi/src/um/avrt.rs b/bash-5.1/vendor/winapi/src/um/avrt.rs new file mode 100644 index 0000000000000000000000000000000000000000..62b0e9c8890efe11ba087955f11de628d0230d4e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/avrt.rs @@ -0,0 +1,82 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_longlong; +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, LPDWORD, PULONG}; +use um::winnt::{HANDLE, LPCSTR, LPCWSTR, PHANDLE, PLARGE_INTEGER}; +ENUM!{enum AVRT_PRIORITY { + AVRT_PRIORITY_VERYLOW = -2i32 as u32, + AVRT_PRIORITY_LOW, + AVRT_PRIORITY_NORMAL = 0, + AVRT_PRIORITY_HIGH, + AVRT_PRIORITY_CRITICAL, +}} +pub const THREAD_ORDER_GROUP_INFINITE_TIMEOUT: c_longlong = -1; +extern "system" { + pub fn AvSetMmThreadCharacteristicsA( + TaskName: LPCSTR, + TaskIndex: LPDWORD, + ) -> HANDLE; + pub fn AvSetMmThreadCharacteristicsW( + TaskName: LPCWSTR, + TaskIndex: LPDWORD, + ) -> HANDLE; + pub fn AvSetMmMaxThreadCharacteristicsA( + FirstTask: LPCSTR, + SecondTask: LPCSTR, + TaskIndex: LPDWORD, + ) -> HANDLE; + pub fn AvSetMmMaxThreadCharacteristicsW( + FirstTask: LPCWSTR, + SecondTask: LPCWSTR, + TaskIndex: LPDWORD, + ) -> HANDLE; + pub fn AvRevertMmThreadCharacteristics( + avrt_handle: HANDLE, + ) -> BOOL; + pub fn AvSetMmThreadPriority( + AvrtHandle: HANDLE, + Priority: AVRT_PRIORITY, + ) -> BOOL; + pub fn AvRtCreateThreadOrderingGroup( + Context: PHANDLE, + Period: PLARGE_INTEGER, + ThreadOrderingGuid: *mut GUID, + Timeout: PLARGE_INTEGER, + ) -> BOOL; + pub fn AvRtCreateThreadOrderingGroupExA( + Context: PHANDLE, + Period: PLARGE_INTEGER, + ThreadOrderingGuid: *mut GUID, + Timeout: PLARGE_INTEGER, + TaskName: LPCSTR, + )-> BOOL; + pub fn AvRtCreateThreadOrderingGroupExW( + Context: PHANDLE, + Period: PLARGE_INTEGER, + ThreadOrderingGuid: *mut GUID, + Timeout: PLARGE_INTEGER, + TaskName: LPCWSTR, + ) -> BOOL; + pub fn AvRtJoinThreadOrderingGroup( + Context: PHANDLE, + ThreadOrderingGuid: *mut GUID, + Before: BOOL, + ) -> BOOL; + pub fn AvRtWaitOnThreadOrderingGroup( + Context: HANDLE, + ) -> BOOL; + pub fn AvRtLeaveThreadOrderingGroup( + Context: HANDLE, + ) -> BOOL; + pub fn AvRtDeleteThreadOrderingGroup( + Context: HANDLE, + ) -> BOOL; + pub fn AvQuerySystemResponsiveness( + AvrtHandle: HANDLE, + SystemResponsivenessValue: PULONG, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/bits.rs b/bash-5.1/vendor/winapi/src/um/bits.rs new file mode 100644 index 0000000000000000000000000000000000000000..aef603fe053709f17edffee89a456434b3441cd3 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bits.rs @@ -0,0 +1,295 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::UINT64; +use shared::guiddef::{GUID, REFGUID}; +use shared::minwindef::{BOOL, DWORD, FILETIME, ULONG}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR, WCHAR}; +RIDL!{#[uuid(0x4991d34b, 0x80a1, 0x4291, 0x83, 0xb6, 0x33, 0x28, 0x36, 0x6b, 0x90, 0x97)] +class BackgroundCopyManager;} +pub const BG_SIZE_UNKNOWN: UINT64 = -1i64 as u64; +STRUCT!{struct BG_FILE_PROGRESS { + BytesTotal: UINT64, + BytesTransferred: UINT64, + Completed: BOOL, +}} +RIDL!{#[uuid(0x01b7bd23, 0xfb88, 0x4a77, 0x84, 0x90, 0x58, 0x91, 0xd3, 0xe4, 0x65, 0x3a)] +interface IBackgroundCopyFile(IBackgroundCopyFileVtbl): IUnknown(IUnknownVtbl) { + fn GetRemoteName( + pVal: *mut LPWSTR, + ) -> HRESULT, + fn GetLocalName( + pVal: *mut LPWSTR, + ) -> HRESULT, + fn GetProgress( + pVal: *mut BG_FILE_PROGRESS, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xca51e165, 0xc365, 0x424c, 0x8d, 0x41, 0x24, 0xaa, 0xa4, 0xff, 0x3c, 0x40)] +interface IEnumBackgroundCopyFiles(IEnumBackgroundCopyFilesVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut *mut IBackgroundCopyFile, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumBackgroundCopyFiles, + ) -> HRESULT, + fn GetCount( + puCount: *mut ULONG, + ) -> HRESULT, +}} +ENUM!{enum BG_ERROR_CONTEXT { + BG_ERROR_CONTEXT_NONE = 0, + BG_ERROR_CONTEXT_UNKNOWN = 1, + BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER = 2, + BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION = 3, + BG_ERROR_CONTEXT_LOCAL_FILE = 4, + BG_ERROR_CONTEXT_REMOTE_FILE = 5, + BG_ERROR_CONTEXT_GENERAL_TRANSPORT = 6, + BG_ERROR_CONTEXT_REMOTE_APPLICATION = 7, +}} +RIDL!{#[uuid(0x19c613a0, 0xfcb8, 0x4f28, 0x81, 0xae, 0x89, 0x7c, 0x3d, 0x07, 0x8f, 0x81)] +interface IBackgroundCopyError(IBackgroundCopyErrorVtbl): IUnknown(IUnknownVtbl) { + fn GetError( + pContext: *mut BG_ERROR_CONTEXT, + pCode: *mut HRESULT, + ) -> HRESULT, + fn GetFile( + pVal: *mut *mut IBackgroundCopyFile, + ) -> HRESULT, + fn GetErrorDescription( + LanguageId: DWORD, + pErrorDescription: *mut LPWSTR, + ) -> HRESULT, + fn GetErrorContextDescription( + LanguageId: DWORD, + pContextDescription: *mut LPWSTR, + ) -> HRESULT, + fn GetProtocol( + pProtocol: *mut LPWSTR, + ) -> HRESULT, +}} +STRUCT!{struct BG_FILE_INFO { + RemoteName: LPWSTR, + LocalName: LPWSTR, +}} +STRUCT!{struct BG_JOB_PROGRESS { + BytesTotal: UINT64, + BytesTransferred: UINT64, + FilesTotal: ULONG, + FilesTransferred: ULONG, +}} +STRUCT!{struct BG_JOB_TIMES { + CreationTime: FILETIME, + ModificationTime: FILETIME, + TransferCompletionTime: FILETIME, +}} +ENUM!{enum BG_JOB_PRIORITY { + BG_JOB_PRIORITY_FOREGROUND = 0, + BG_JOB_PRIORITY_HIGH = BG_JOB_PRIORITY_FOREGROUND + 1, + BG_JOB_PRIORITY_NORMAL = BG_JOB_PRIORITY_HIGH + 1, + BG_JOB_PRIORITY_LOW = BG_JOB_PRIORITY_NORMAL + 1, +}} +ENUM!{enum BG_JOB_STATE { + BG_JOB_STATE_QUEUED = 0, + BG_JOB_STATE_CONNECTING = BG_JOB_STATE_QUEUED + 1, + BG_JOB_STATE_TRANSFERRING = BG_JOB_STATE_CONNECTING + 1, + BG_JOB_STATE_SUSPENDED = BG_JOB_STATE_TRANSFERRING + 1, + BG_JOB_STATE_ERROR = BG_JOB_STATE_SUSPENDED + 1, + BG_JOB_STATE_TRANSIENT_ERROR = BG_JOB_STATE_ERROR + 1, + BG_JOB_STATE_TRANSFERRED = BG_JOB_STATE_TRANSIENT_ERROR + 1, + BG_JOB_STATE_ACKNOWLEDGED = BG_JOB_STATE_TRANSFERRED + 1, + BG_JOB_STATE_CANCELLED = BG_JOB_STATE_ACKNOWLEDGED + 1, +}} +ENUM!{enum BG_JOB_TYPE { + BG_JOB_TYPE_DOWNLOAD = 0, + BG_JOB_TYPE_UPLOAD = BG_JOB_TYPE_DOWNLOAD + 1, + BG_JOB_TYPE_UPLOAD_REPLY = BG_JOB_TYPE_UPLOAD + 1, +}} +ENUM!{enum BG_JOB_PROXY_USAGE { + BG_JOB_PROXY_USAGE_PRECONFIG = 0, + BG_JOB_PROXY_USAGE_NO_PROXY = BG_JOB_PROXY_USAGE_PRECONFIG + 1, + BG_JOB_PROXY_USAGE_OVERRIDE = BG_JOB_PROXY_USAGE_NO_PROXY + 1, + BG_JOB_PROXY_USAGE_AUTODETECT = BG_JOB_PROXY_USAGE_OVERRIDE + 1, +}} +RIDL!{#[uuid(0x37668d37, 0x507e, 0x4160, 0x93, 0x16, 0x26, 0x30, 0x6d, 0x15, 0x0b, 0x12)] +interface IBackgroundCopyJob(IBackgroundCopyJobVtbl): IUnknown(IUnknownVtbl) { + fn AddFileSet( + cFileCount: ULONG, + pFileSet: *mut BG_FILE_INFO, + ) -> HRESULT, + fn AddFile( + RemoteUrl: LPCWSTR, + LocalName: LPCWSTR, + ) -> HRESULT, + fn EnumFiles( + pErrorDescription: *mut *mut IEnumBackgroundCopyFiles, + ) -> HRESULT, + fn Suspend() -> HRESULT, + fn Resume() -> HRESULT, + fn Cancel() -> HRESULT, + fn Complete() -> HRESULT, + fn GetId( + pVal: *mut GUID, + ) -> HRESULT, + fn GetType( + pVal: *mut BG_JOB_TYPE, + ) -> HRESULT, + fn GetProgress( + pVal: *mut BG_JOB_PROGRESS, + ) -> HRESULT, + fn GetTimes( + pVal: *mut BG_JOB_TIMES, + ) -> HRESULT, + fn GetState( + pVal: *mut BG_JOB_STATE, + ) -> HRESULT, + fn GetError( + ppError: *mut *mut IBackgroundCopyError, + ) -> HRESULT, + fn GetOwner( + pVal: *mut LPWSTR, + ) -> HRESULT, + fn SetDisplayName( + Val: LPCWSTR, + ) -> HRESULT, + fn GetDisplayName( + pVal: *mut LPWSTR, + ) -> HRESULT, + fn SetDescription( + Val: LPCWSTR, + ) -> HRESULT, + fn GetDescription( + pVal: *mut LPWSTR, + ) -> HRESULT, + fn SetPriority( + Val: BG_JOB_PRIORITY, + ) -> HRESULT, + fn GetPriority( + pVal: *mut BG_JOB_PRIORITY, + ) -> HRESULT, + fn SetNotifyFlags( + Val: ULONG, + ) -> HRESULT, + fn GetNotifyFlags( + pVal: *mut ULONG, + ) -> HRESULT, + fn SetNotifyInterface( + Val: *mut IUnknown, + ) -> HRESULT, + fn GetNotifyInterface( + pVal: *mut *mut IUnknown, + ) -> HRESULT, + fn SetMinimumRetryDelay( + Seconds: ULONG, + ) -> HRESULT, + fn GetMinimumRetryDelay( + Seconds: *mut ULONG, + ) -> HRESULT, + fn SetNoProgressTimeout( + Seconds: ULONG, + ) -> HRESULT, + fn GetNoProgressTimeout( + Seconds: *mut ULONG, + ) -> HRESULT, + fn GetErrorCount( + Errors: *mut ULONG, + ) -> HRESULT, + fn SetProxySettings( + ProxyUsage: BG_JOB_PROXY_USAGE, + ProxyList: *const WCHAR, + ProxyBypassList: *const WCHAR, + ) -> HRESULT, + fn GetProxySettings( + pProxyUsage: *mut BG_JOB_PROXY_USAGE, + pProxyList: *mut LPWSTR, + pProxyBypassListpProxyList: *mut LPWSTR, + ) -> HRESULT, + fn TakeOwnership() -> HRESULT, +}} +RIDL!{#[uuid(0x1af4f612, 0x3b71, 0x466f, 0x8f, 0x58, 0x7b, 0x6f, 0x73, 0xac, 0x57, 0xad)] +interface IEnumBackgroundCopyJobs(IEnumBackgroundCopyJobsVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut *mut IBackgroundCopyJob, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumBackgroundCopyJobs, + ) -> HRESULT, + fn GetCount( + puCount: *mut ULONG, + ) -> HRESULT, +}} +pub const BG_NOTIFY_JOB_TRANSFERRED: DWORD = 0x0001; +pub const BG_NOTIFY_JOB_ERROR: DWORD = 0x0002; +pub const BG_NOTIFY_DISABLE: DWORD = 0x0004; +pub const BG_NOTIFY_JOB_MODIFICATION: DWORD = 0x0008; +pub const BG_NOTIFY_FILE_TRANSFERRED: DWORD = 0x0010; +pub const BG_NOTIFY_FILE_RANGES_TRANSFERRED: DWORD = 0x0020; +RIDL!{#[uuid(0x97ea99c7, 0x0186, 0x4ad4, 0x8d, 0xf9, 0xc5, 0xb4, 0xe0, 0xed, 0x6b, 0x22)] +interface IBackgroundCopyCallback(IBackgroundCopyCallbackVtbl): IUnknown(IUnknownVtbl) { + fn JobTransferred( + pJob: *mut IBackgroundCopyJob, + ) -> HRESULT, + fn JobError( + pJob: *mut IBackgroundCopyJob, + pError: *mut IBackgroundCopyError, + ) -> HRESULT, + fn JobModification( + pJob: *mut IBackgroundCopyJob, + dwReserved: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xca29d251, 0xb4bb, 0x4679, 0xa3, 0xd9, 0xae, 0x80, 0x06, 0x11, 0x9d, 0x54)] +interface AsyncIBackgroundCopyCallback(AsyncIBackgroundCopyCallbackVtbl): IUnknown(IUnknownVtbl) { + fn Begin_JobTransferred( + pJob: *mut IBackgroundCopyJob, + ) -> HRESULT, + fn Finish_JobTransferred() -> HRESULT, + fn Begin_JobError( + pJob: *mut IBackgroundCopyJob, + pError: *mut IBackgroundCopyError, + ) -> HRESULT, + fn Finish_JobError() -> HRESULT, + fn Begin_JobModification( + pJob: *mut IBackgroundCopyJob, + dwReserved: DWORD, + ) -> HRESULT, + fn Finish_JobModification() -> HRESULT, +}} +pub const BG_JOB_ENUM_ALL_USERS: DWORD = 0x0001; +RIDL!{#[uuid(0x5ce34c0d, 0x0dc9, 0x4c1f, 0x89, 0x7c, 0xda, 0xa1, 0xb7, 0x8c, 0xee, 0x7c)] +interface IBackgroundCopyManager(IBackgroundCopyManagerVtbl): IUnknown(IUnknownVtbl) { + fn CreateJob( + DisplayName: LPCWSTR, + Type: BG_JOB_TYPE, + pJobId: *mut GUID, + ppJob: *mut *mut IBackgroundCopyJob, + ) -> HRESULT, + fn GetJob( + jobID: REFGUID, + ppJob: *mut *mut IBackgroundCopyJob, + ) -> HRESULT, + fn EnumJobs( + dwFlags: DWORD, + ppEnum: *mut *mut IEnumBackgroundCopyJobs, + ) -> HRESULT, + fn GetErrorDescription( + hResult: HRESULT, + LanguageId: DWORD, + pErrorDescription: *mut LPWSTR, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/bits10_1.rs b/bash-5.1/vendor/winapi/src/um/bits10_1.rs new file mode 100644 index 0000000000000000000000000000000000000000..327161a8d6119917abc88a44484ee7d3dc2af478 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bits10_1.rs @@ -0,0 +1,37 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::UINT64; +use shared::minwindef::DWORD; +use um::bits::{IBackgroundCopyFile, IBackgroundCopyJob}; +use um::bits2_0::BG_FILE_RANGE; +use um::bits3_0::{IBackgroundCopyCallback2, IBackgroundCopyCallback2Vtbl}; +use um::bits5_0::{IBackgroundCopyFile5, IBackgroundCopyFile5Vtbl}; +use um::winnt::HRESULT; +RIDL!{#[uuid(0x98c97bd2, 0xe32b, 0x4ad8, 0xa5, 0x28, 0x95, 0xfd, 0x8b, 0x16, 0xbd, 0x42)] +interface IBackgroundCopyCallback3(IBackgroundCopyCallback3Vtbl): + IBackgroundCopyCallback2(IBackgroundCopyCallback2Vtbl) { + fn FileRangesTransferred( + job: *mut IBackgroundCopyJob, + file: *mut IBackgroundCopyFile, + rangeCount: DWORD, + ranges: *const BG_FILE_RANGE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xcf6784f7, 0xd677, 0x49fd, 0x93, 0x68, 0xcb, 0x47, 0xae, 0xe9, 0xd1, 0xad)] +interface IBackgroundCopyFile6(IBackgroundCopyFile6Vtbl): + IBackgroundCopyFile5(IBackgroundCopyFile5Vtbl) { + fn UpdateDownloadPosition( + offset: UINT64, + ) -> HRESULT, + fn RequestFileRanges( + rangeCount: DWORD, + ranges: *const BG_FILE_RANGE, + ) -> HRESULT, + fn GetFilledFileRanges( + rangeCount: *mut DWORD, + ranges: *mut *mut BG_FILE_RANGE, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/bits1_5.rs b/bash-5.1/vendor/winapi/src/um/bits1_5.rs new file mode 100644 index 0000000000000000000000000000000000000000..b2890e7db5ed4e0ad8314b11f9f83fe668ff4048 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bits1_5.rs @@ -0,0 +1,70 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::UINT64; +use shared::rpcndr::byte; +use um::bits::{IBackgroundCopyJob, IBackgroundCopyJobVtbl}; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR}; +STRUCT!{struct BG_JOB_REPLY_PROGRESS { + BytesTotal: UINT64, + BytesTransferred: UINT64, +}} +ENUM!{enum BG_AUTH_TARGET { + BG_AUTH_TARGET_SERVER = 1, + BG_AUTH_TARGET_PROXY = BG_AUTH_TARGET_SERVER + 1, +}} +ENUM!{enum BG_AUTH_SCHEME { + BG_AUTH_SCHEME_BASIC = 1, + BG_AUTH_SCHEME_DIGEST = BG_AUTH_SCHEME_BASIC + 1, + BG_AUTH_SCHEME_NTLM = BG_AUTH_SCHEME_DIGEST + 1, + BG_AUTH_SCHEME_NEGOTIATE = BG_AUTH_SCHEME_NTLM + 1, + BG_AUTH_SCHEME_PASSPORT = BG_AUTH_SCHEME_NEGOTIATE + 1, +}} +STRUCT!{struct BG_BASIC_CREDENTIALS { + UserName: LPWSTR, + Password: LPWSTR, +}} +UNION!{union BG_AUTH_CREDENTIALS_UNION { + [usize; 2], + Basic Basic_mut: BG_BASIC_CREDENTIALS, +}} +STRUCT!{struct BG_AUTH_CREDENTIALS { + Target: BG_AUTH_TARGET, + Scheme: BG_AUTH_SCHEME, + Credentials: BG_AUTH_CREDENTIALS_UNION, +}} +pub type PBG_AUTH_CREDENTIALS = *mut BG_AUTH_CREDENTIALS; +RIDL!{#[uuid(0x54b50739, 0x686f, 0x45eb, 0x9d, 0xff, 0xd6, 0xa9, 0xa0, 0xfa, 0xa9, 0xaf)] +interface IBackgroundCopyJob2(IBackgroundCopyJob2Vtbl): + IBackgroundCopyJob(IBackgroundCopyJobVtbl) { + fn SetNotifyCmdLine( + Program: LPCWSTR, + Parameters: LPCWSTR, + ) -> HRESULT, + fn GetNotifyCmdLine( + pProgram: *mut LPWSTR, + pParameters: *mut LPWSTR, + ) -> HRESULT, + fn GetReplyProgress( + pProgress: *mut BG_JOB_REPLY_PROGRESS, + ) -> HRESULT, + fn GetReplyData( + ppBuffer: *mut *mut byte, + pLength: *mut UINT64, + ) -> HRESULT, + fn SetReplyFileName( + ReplyFileName: LPCWSTR, + ) -> HRESULT, + fn GetReplyFileName( + pReplyFileName: *mut LPWSTR, + ) -> HRESULT, + fn SetCredentials( + credentials: *mut BG_AUTH_CREDENTIALS, + ) -> HRESULT, + fn RemoveCredentials( + Target: BG_AUTH_TARGET, + Scheme: BG_AUTH_SCHEME, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/bits2_0.rs b/bash-5.1/vendor/winapi/src/um/bits2_0.rs new file mode 100644 index 0000000000000000000000000000000000000000..15e5827086f1ffcf0db576356535aa2a5a05066d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bits2_0.rs @@ -0,0 +1,51 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::UINT64; +use shared::minwindef::DWORD; +use um::bits::{IBackgroundCopyFile, IBackgroundCopyFileVtbl}; +use um::bits1_5::{IBackgroundCopyJob2, IBackgroundCopyJob2Vtbl}; +use um::winnt::{HRESULT, LPCWSTR}; +pub const BG_LENGTH_TO_EOF: UINT64 = -1i64 as u64; +STRUCT!{struct BG_FILE_RANGE { + InitialOffset: UINT64, + Length: UINT64, +}} +pub const BG_COPY_FILE_OWNER: DWORD = 1; +pub const BG_COPY_FILE_GROUP: DWORD = 2; +pub const BG_COPY_FILE_DACL: DWORD = 4; +pub const BG_COPY_FILE_SACL: DWORD = 8; +pub const BG_COPY_FILE_ALL: DWORD = 15; +RIDL!{#[uuid(0x443c8934, 0x90ff, 0x48ed, 0xbc, 0xde, 0x26, 0xf5, 0xc7, 0x45, 0x00, 0x42)] +interface IBackgroundCopyJob3(IBackgroundCopyJob3Vtbl): + IBackgroundCopyJob2(IBackgroundCopyJob2Vtbl) { + fn ReplaceRemotePrefix( + OldPrefix: LPCWSTR, + NewPrefix: LPCWSTR, + ) -> HRESULT, + fn AddFileWithRanges( + RemoteUrl: LPCWSTR, + LocalName: LPCWSTR, + RangeCount: DWORD, + Ranges: *mut BG_FILE_RANGE, + ) -> HRESULT, + fn SetFileACLFlags( + Flags: DWORD, + ) -> HRESULT, + fn GetFileACLFlags( + Flags: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x83e81b93, 0x0873, 0x474d, 0x8a, 0x8c, 0xf2, 0x01, 0x8b, 0x1a, 0x93, 0x9c)] +interface IBackgroundCopyFile2(IBackgroundCopyFile2Vtbl): + IBackgroundCopyFile(IBackgroundCopyFileVtbl) { + fn GetFileRanges( + RangeCount: *mut DWORD, + Ranges: *mut *mut BG_FILE_RANGE, + ) -> HRESULT, + fn SetRemoteName( + Val: LPCWSTR, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/bits2_5.rs b/bash-5.1/vendor/winapi/src/um/bits2_5.rs new file mode 100644 index 0000000000000000000000000000000000000000..50a5b4d176464cd8d44654c294d9790266b4f234 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bits2_5.rs @@ -0,0 +1,64 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::ULONG; +use shared::rpcndr::byte; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR}; +ENUM!{enum BG_CERT_STORE_LOCATION { + BG_CERT_STORE_LOCATION_CURRENT_USER = 0, + BG_CERT_STORE_LOCATION_LOCAL_MACHINE = BG_CERT_STORE_LOCATION_CURRENT_USER + 1, + BG_CERT_STORE_LOCATION_CURRENT_SERVICE = BG_CERT_STORE_LOCATION_LOCAL_MACHINE + 1, + BG_CERT_STORE_LOCATION_SERVICES = BG_CERT_STORE_LOCATION_CURRENT_SERVICE + 1, + BG_CERT_STORE_LOCATION_USERS = BG_CERT_STORE_LOCATION_SERVICES + 1, + BG_CERT_STORE_LOCATION_CURRENT_USER_GROUP_POLICY = BG_CERT_STORE_LOCATION_USERS + 1, + BG_CERT_STORE_LOCATION_LOCAL_MACHINE_GROUP_POLICY + = BG_CERT_STORE_LOCATION_CURRENT_USER_GROUP_POLICY + 1, + BG_CERT_STORE_LOCATION_LOCAL_MACHINE_ENTERPRISE + = BG_CERT_STORE_LOCATION_LOCAL_MACHINE_GROUP_POLICY + 1, +}} +RIDL!{#[uuid(0xf1bd1079, 0x9f01, 0x4bdc, 0x80, 0x36, 0xf0, 0x9b, 0x70, 0x09, 0x50, 0x66)] +interface IBackgroundCopyJobHttpOptions(IBackgroundCopyJobHttpOptionsVtbl): + IUnknown(IUnknownVtbl) { + fn SetClientCertificateByID( + StoreLocation: BG_CERT_STORE_LOCATION, + StoreName: LPCWSTR, + pCertHashBlob: *mut byte, + ) -> HRESULT, + fn SetClientCertificateByName( + StoreLocation: BG_CERT_STORE_LOCATION, + StoreName: LPCWSTR, + SubjectName: LPCWSTR, + ) -> HRESULT, + fn RemoveClientCertificate() -> HRESULT, + fn GetClientCertificate( + pStoreLocation: *mut BG_CERT_STORE_LOCATION, + pStoreName: *mut LPWSTR, + ppCertHashBlob: *mut *mut byte, + pSubjectName: *mut LPWSTR, + ) -> HRESULT, + fn SetCustomHeaders( + RequestHeaders: LPCWSTR, + ) -> HRESULT, + fn GetCustomHeaders( + pRequestHeaders: *mut LPWSTR, + ) -> HRESULT, + fn SetSecurityFlags( + Flags: ULONG, + ) -> HRESULT, + fn GetSecurityFlags( + pFlags: *mut ULONG, + ) -> HRESULT, +}} +pub const BG_SSL_ENABLE_CRL_CHECK: ULONG = 0x0001; +pub const BG_SSL_IGNORE_CERT_CN_INVALID: ULONG = 0x0002; +pub const BG_SSL_IGNORE_CERT_DATE_INVALID: ULONG = 0x0004; +pub const BG_SSL_IGNORE_UNKNOWN_CA: ULONG = 0x0008; +pub const BG_SSL_IGNORE_CERT_WRONG_USAGE: ULONG = 0x0010; +pub const BG_HTTP_REDIRECT_POLICY_MASK: ULONG = 0x0700; +pub const BG_HTTP_REDIRECT_POLICY_ALLOW_SILENT: ULONG = 0x0000; +pub const BG_HTTP_REDIRECT_POLICY_ALLOW_REPORT: ULONG = 0x0100; +pub const BG_HTTP_REDIRECT_POLICY_DISALLOW: ULONG = 0x0200; +pub const BG_HTTP_REDIRECT_POLICY_ALLOW_HTTPS_TO_HTTP: ULONG = 0x0800; diff --git a/bash-5.1/vendor/winapi/src/um/bits3_0.rs b/bash-5.1/vendor/winapi/src/um/bits3_0.rs new file mode 100644 index 0000000000000000000000000000000000000000..478dce6427054a81f1db69e165be4cdd962d385e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bits3_0.rs @@ -0,0 +1,179 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::UINT64; +use shared::guiddef::{GUID, REFGUID}; +use shared::minwindef::{BOOL, DWORD, FILETIME, ULONG}; +use um::bits::{ + IBackgroundCopyCallback, IBackgroundCopyCallbackVtbl, IBackgroundCopyFile, IBackgroundCopyJob, +}; +use um::bits2_0::{ + BG_FILE_RANGE, IBackgroundCopyFile2, IBackgroundCopyFile2Vtbl, IBackgroundCopyJob3, + IBackgroundCopyJob3Vtbl, +}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR}; +RIDL!{#[uuid(0x659cdeaf, 0x489e, 0x11d9, 0xa9, 0xcd, 0x00, 0x0d, 0x56, 0x96, 0x52, 0x51)] +interface IBitsPeerCacheRecord(IBitsPeerCacheRecordVtbl): IUnknown(IUnknownVtbl) { + fn GetId( + pVal: *mut GUID, + ) -> HRESULT, + fn GetOriginUrl( + pVal: *mut LPWSTR, + ) -> HRESULT, + fn GetFileSize( + pVal: *mut UINT64, + ) -> HRESULT, + fn GetFileModificationTime( + pVal: *mut FILETIME, + ) -> HRESULT, + fn GetLastAccessTime( + pVal: *mut FILETIME, + ) -> HRESULT, + fn IsFileValidated() -> HRESULT, + fn GetFileRanges( + pRangeCount: *mut DWORD, + ppRanges: *mut *mut BG_FILE_RANGE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x659cdea4, 0x489e, 0x11d9, 0xa9, 0xcd, 0x00, 0x0d, 0x56, 0x96, 0x52, 0x51)] +interface IEnumBitsPeerCacheRecords(IEnumBitsPeerCacheRecordsVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut *mut IBitsPeerCacheRecord, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumBitsPeerCacheRecords, + ) -> HRESULT, + fn GetCount( + puCount: *mut ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x659cdea2, 0x489e, 0x11d9, 0xa9, 0xcd, 0x00, 0x0d, 0x56, 0x96, 0x52, 0x51)] +interface IBitsPeer(IBitsPeerVtbl): IUnknown(IUnknownVtbl) { + fn GetPeerName( + pName: *mut LPWSTR, + ) -> HRESULT, + fn IsAuthenticated( + pAuth: *mut BOOL, + ) -> HRESULT, + fn IsAvailable( + pOnline: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x659cdea5, 0x489e, 0x11d9, 0xa9, 0xcd, 0x00, 0x0d, 0x56, 0x96, 0x52, 0x51)] +interface IEnumBitsPeers(IEnumBitsPeersVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut *mut IBitsPeer, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumBitsPeers, + ) -> HRESULT, + fn GetCount( + puCount: *mut ULONG, + ) -> HRESULT, +}} +pub const BG_ENABLE_PEERCACHING_CLIENT: DWORD = 0x0001; +pub const BG_ENABLE_PEERCACHING_SERVER: DWORD = 0x0002; +pub const BG_DISABLE_BRANCH_CACHE: DWORD = 0x0004; +RIDL!{#[uuid(0x659cdead, 0x489e, 0x11d9, 0xa9, 0xcd, 0x00, 0x0d, 0x56, 0x96, 0x52, 0x51)] +interface IBitsPeerCacheAdministration(IBitsPeerCacheAdministrationVtbl): IUnknown(IUnknownVtbl) { + fn GetMaximumCacheSize( + pBytes: *mut DWORD, + ) -> HRESULT, + fn SetMaximumCacheSize( + Bytes: DWORD, + ) -> HRESULT, + fn GetMaximumContentAge( + pSeconds: *mut ULONG, + ) -> HRESULT, + fn SetMaximumContentAge( + Seconds: ULONG, + ) -> HRESULT, + fn GetConfigurationFlags( + pFlags: *mut DWORD, + ) -> HRESULT, + fn SetConfigurationFlags( + Flags: DWORD, + ) -> HRESULT, + fn EnumRecords( + ppEnum: *mut *mut IEnumBitsPeerCacheRecords, + ) -> HRESULT, + fn GetRecord( + ppRecord: *mut *mut IBitsPeerCacheRecord, + ) -> HRESULT, + fn ClearRecords() -> HRESULT, + fn DeleteRecord( + id: REFGUID, + ) -> HRESULT, + fn DeleteUrl( + url: LPCWSTR, + ) -> HRESULT, + fn EnumPeers( + ppEnum: *mut *mut IEnumBitsPeers, + ) -> HRESULT, + fn ClearPeers() -> HRESULT, + fn DiscoverPeers() -> HRESULT, +}} +pub const BG_JOB_ENABLE_PEERCACHING_CLIENT: DWORD = 0x0001; +pub const BG_JOB_ENABLE_PEERCACHING_SERVER: DWORD = 0x0002; +pub const BG_JOB_DISABLE_BRANCH_CACHE: DWORD = 0x0004; +RIDL!{#[uuid(0x659cdeae, 0x489e, 0x11d9, 0xa9, 0xcd, 0x00, 0x0d, 0x56, 0x96, 0x52, 0x51)] +interface IBackgroundCopyJob4(IBackgroundCopyJob4Vtbl): + IBackgroundCopyJob3(IBackgroundCopyJob3Vtbl) { + fn SetPeerCachingFlags( + Flags: DWORD, + ) -> HRESULT, + fn GetPeerCachingFlags( + pFlags: *mut DWORD, + ) -> HRESULT, + fn GetOwnerIntegrityLevel( + pLevel: *mut ULONG, + ) -> HRESULT, + fn GetOwnerElevationState( + pElevated: *mut BOOL, + ) -> HRESULT, + fn SetMaximumDownloadTime( + Timeout: ULONG, + ) -> HRESULT, + fn GetMaximumDownloadTime( + pTimeout: *mut ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x659cdeaa, 0x489e, 0x11d9, 0xa9, 0xcd, 0x00, 0x0d, 0x56, 0x96, 0x52, 0x51)] +interface IBackgroundCopyFile3(IBackgroundCopyFile3Vtbl): + IBackgroundCopyFile2(IBackgroundCopyFile2Vtbl) { + fn GetTemporaryName( + pFilename: *mut LPWSTR, + ) -> HRESULT, + fn SetValidationState( + state: BOOL, + ) -> HRESULT, + fn GetValidationState( + pState: *mut BOOL, + ) -> HRESULT, + fn IsDownloadedFromPeer( + pVal: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x659cdeac, 0x489e, 0x11d9, 0xa9, 0xcd, 0x00, 0x0d, 0x56, 0x96, 0x52, 0x51)] +interface IBackgroundCopyCallback2(IBackgroundCopyCallback2Vtbl): + IBackgroundCopyCallback(IBackgroundCopyCallbackVtbl) { + fn FileTransferred( + pJob: *mut IBackgroundCopyJob, + pFile: *mut IBackgroundCopyFile, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/bits4_0.rs b/bash-5.1/vendor/winapi/src/um/bits4_0.rs new file mode 100644 index 0000000000000000000000000000000000000000..2cd763a68749bc48d362991464c9ccbd0d6b3a1e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bits4_0.rs @@ -0,0 +1,32 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::PUINT64; +use shared::minwindef::DWORD; +use um::bits3_0::{IBackgroundCopyFile3, IBackgroundCopyFile3Vtbl}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPWSTR}; +RIDL!{#[uuid(0x9a2584c3, 0xf7d2, 0x457a, 0x9a, 0x5e, 0x22, 0xb6, 0x7b, 0xff, 0xc7, 0xd2)] +interface IBitsTokenOptions(IBitsTokenOptionsVtbl): IUnknown(IUnknownVtbl) { + fn SetHelperTokenFlags( + UsageFlags: DWORD, + ) -> HRESULT, + fn GetHelperTokenFlags( + pFlags: *mut DWORD, + ) -> HRESULT, + fn SetHelperToken() -> HRESULT, + fn ClearHelperToken() -> HRESULT, + fn GetHelperTokenSid( + pSid: *mut LPWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xef7e0655, 0x7888, 0x4960, 0xb0, 0xe5, 0x73, 0x08, 0x46, 0xe0, 0x34, 0x92)] +interface IBackgroundCopyFile4(IBackgroundCopyFile4Vtbl): + IBackgroundCopyFile3(IBackgroundCopyFile3Vtbl) { + fn GetPeerDownloadStats( + pFromOrigin: PUINT64, + pFromPeers: PUINT64, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/bits5_0.rs b/bash-5.1/vendor/winapi/src/um/bits5_0.rs new file mode 100644 index 0000000000000000000000000000000000000000..97166eb83f82aa3a87d21bbd0eb5dc6f87b7d849 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bits5_0.rs @@ -0,0 +1,95 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::UINT64; +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, DWORD}; +use um::bits1_5::BG_AUTH_TARGET; +use um::bits3_0::{IBackgroundCopyJob4, IBackgroundCopyJob4Vtbl}; +use um::bits4_0::{IBackgroundCopyFile4, IBackgroundCopyFile4Vtbl}; +use um::winnt::{HRESULT, LPWSTR}; +pub const BITS_COST_STATE_UNRESTRICTED: DWORD = 0x1; +pub const BITS_COST_STATE_CAPPED_USAGE_UNKNOWN: DWORD = 0x2; +pub const BITS_COST_STATE_BELOW_CAP: DWORD = 0x4; +pub const BITS_COST_STATE_NEAR_CAP: DWORD = 0x8; +pub const BITS_COST_STATE_OVERCAP_CHARGED: DWORD = 0x10; +pub const BITS_COST_STATE_OVERCAP_THROTTLED: DWORD = 0x20; +pub const BITS_COST_STATE_USAGE_BASED: DWORD = 0x40; +pub const BITS_COST_STATE_ROAMING: DWORD = 0x80; +pub const BITS_COST_OPTION_IGNORE_CONGESTION: DWORD = 0x80000000; +pub const BITS_COST_STATE_RESERVED: DWORD = 0x40000000; +pub const BITS_COST_STATE_TRANSFER_NOT_ROAMING: DWORD = BITS_COST_OPTION_IGNORE_CONGESTION + | BITS_COST_STATE_USAGE_BASED | BITS_COST_STATE_OVERCAP_THROTTLED + | BITS_COST_STATE_OVERCAP_CHARGED | BITS_COST_STATE_NEAR_CAP | BITS_COST_STATE_BELOW_CAP + | BITS_COST_STATE_CAPPED_USAGE_UNKNOWN | BITS_COST_STATE_UNRESTRICTED; +pub const BITS_COST_STATE_TRANSFER_NO_SURCHARGE: DWORD = BITS_COST_OPTION_IGNORE_CONGESTION + | BITS_COST_STATE_USAGE_BASED | BITS_COST_STATE_OVERCAP_THROTTLED | BITS_COST_STATE_NEAR_CAP + | BITS_COST_STATE_BELOW_CAP | BITS_COST_STATE_CAPPED_USAGE_UNKNOWN + | BITS_COST_STATE_UNRESTRICTED; +pub const BITS_COST_STATE_TRANSFER_STANDARD: DWORD = BITS_COST_OPTION_IGNORE_CONGESTION + | BITS_COST_STATE_USAGE_BASED | BITS_COST_STATE_OVERCAP_THROTTLED | BITS_COST_STATE_BELOW_CAP + | BITS_COST_STATE_CAPPED_USAGE_UNKNOWN | BITS_COST_STATE_UNRESTRICTED; +pub const BITS_COST_STATE_TRANSFER_UNRESTRICTED: DWORD = BITS_COST_OPTION_IGNORE_CONGESTION + | BITS_COST_STATE_OVERCAP_THROTTLED | BITS_COST_STATE_UNRESTRICTED; +pub const BITS_COST_STATE_TRANSFER_ALWAYS: DWORD = BITS_COST_OPTION_IGNORE_CONGESTION + | BITS_COST_STATE_ROAMING | BITS_COST_STATE_USAGE_BASED | BITS_COST_STATE_OVERCAP_THROTTLED + | BITS_COST_STATE_OVERCAP_CHARGED | BITS_COST_STATE_NEAR_CAP | BITS_COST_STATE_BELOW_CAP + | BITS_COST_STATE_CAPPED_USAGE_UNKNOWN | BITS_COST_STATE_UNRESTRICTED; +ENUM!{enum BITS_JOB_TRANSFER_POLICY { + BITS_JOB_TRANSFER_POLICY_ALWAYS = 0x800000ff, + BITS_JOB_TRANSFER_POLICY_NOT_ROAMING = 0x8000007f, + BITS_JOB_TRANSFER_POLICY_NO_SURCHARGE = 0x8000006f, + BITS_JOB_TRANSFER_POLICY_STANDARD = 0x80000067, + BITS_JOB_TRANSFER_POLICY_UNRESTRICTED = 0x80000021, +}} +ENUM!{enum BITS_JOB_PROPERTY_ID { + BITS_JOB_PROPERTY_ID_COST_FLAGS = 1, + BITS_JOB_PROPERTY_NOTIFICATION_CLSID = 2, + BITS_JOB_PROPERTY_DYNAMIC_CONTENT = 3, + BITS_JOB_PROPERTY_HIGH_PERFORMANCE = 4, + BITS_JOB_PROPERTY_MAX_DOWNLOAD_SIZE = 5, + BITS_JOB_PROPERTY_USE_STORED_CREDENTIALS = 7, + BITS_JOB_PROPERTY_MINIMUM_NOTIFICATION_INTERVAL_MS = 9, + BITS_JOB_PROPERTY_ON_DEMAND_MODE = 10, +}} +UNION!{union BITS_JOB_PROPERTY_VALUE { + [u64; 2], + Dword Dword_mut: DWORD, + ClsID ClsID_mut: GUID, + Enable Enable_mut: BOOL, + Uint64 Uint64_mut: UINT64, + Target Target_mut: BG_AUTH_TARGET, +}} +ENUM!{enum BITS_FILE_PROPERTY_ID { + BITS_FILE_PROPERTY_ID_HTTP_RESPONSE_HEADERS = 1, +}} +UNION!{union BITS_FILE_PROPERTY_VALUE { + [usize; 1], + String String_mut: LPWSTR, +}} +RIDL!{#[uuid(0xe847030c, 0xbbba, 0x4657, 0xaf, 0x6d, 0x48, 0x4a, 0xa4, 0x2b, 0xf1, 0xfe)] +interface IBackgroundCopyJob5(IBackgroundCopyJob5Vtbl): + IBackgroundCopyJob4(IBackgroundCopyJob4Vtbl) { + fn SetProperty( + PropertyId: BITS_JOB_PROPERTY_ID, + PropertyValue: BITS_JOB_PROPERTY_VALUE, + ) -> HRESULT, + fn GetProperty( + PropertyId: BITS_JOB_PROPERTY_ID, + PropertyValue: *mut BITS_JOB_PROPERTY_VALUE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x85c1657f, 0xdafc, 0x40e8, 0x88, 0x34, 0xdf, 0x18, 0xea, 0x25, 0x71, 0x7e)] +interface IBackgroundCopyFile5(IBackgroundCopyFile5Vtbl): + IBackgroundCopyFile4(IBackgroundCopyFile4Vtbl) { + fn SetProperty( + PropertyId: BITS_JOB_PROPERTY_ID, + PropertyValue: BITS_JOB_PROPERTY_VALUE, + ) -> HRESULT, + fn GetProperty( + PropertyId: BITS_JOB_PROPERTY_ID, + PropertyValue: *mut BITS_JOB_PROPERTY_VALUE, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/bitscfg.rs b/bash-5.1/vendor/winapi/src/um/bitscfg.rs new file mode 100644 index 0000000000000000000000000000000000000000..3d9f46a2dbd7efb7d948d0891e68e732650d622f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bitscfg.rs @@ -0,0 +1,70 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_uchar, c_ulong}; +use shared::guiddef::REFIID; +use shared::wtypes::BSTR; +use um::oaidl::{IDispatch, IDispatchVtbl}; +use um::unknwnbase::IUnknown; +use um::winnt::HRESULT; +RIDL!{#[uuid(0x29cfbbf7, 0x09e4, 0x4b97, 0xb0, 0xbc, 0xf2, 0x28, 0x7e, 0x3d, 0x8e, 0xb3)] +interface IBITSExtensionSetup(IBITSExtensionSetupVtbl): IDispatch(IDispatchVtbl) { + fn EnableBITSUploads() -> HRESULT, + fn DisableBITSUploads() -> HRESULT, + fn GetCleanupTaskName( + pTaskName: *mut BSTR, + ) -> HRESULT, + fn GetCleanupTask( + riid: REFIID, + ppUnk: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd5d2d542, 0x5503, 0x4e64, 0x8b, 0x48, 0x72, 0xef, 0x91, 0xa3, 0x2e, 0xe1)] +interface IBITSExtensionSetupFactory(IBITSExtensionSetupFactoryVtbl): IDispatch(IDispatchVtbl) { + fn GetObject( + Path: BSTR, + ppExtensionSetup: *mut *mut IBITSExtensionSetup, + ) -> HRESULT, +}} +extern "system" { + pub fn BSTR_UserSize( + pFlags: *mut c_ulong, + Offset: c_ulong, + pBstr: *mut BSTR, + ) -> c_ulong; + pub fn BSTR_UserMarshal( + pFlags: *mut c_ulong, + pBuffer: *mut c_uchar, + pBstr: *mut BSTR, + ) -> *mut c_uchar; + pub fn BSTR_UserUnmarshal( + pFlags: *mut c_ulong, + pBuffer: *mut c_uchar, + pBstr: *mut BSTR, + ) -> *mut c_uchar; + pub fn BSTR_UserFree( + pFlags: *mut c_ulong, + pBstr: *mut BSTR, + ); + pub fn BSTR_UserSize64( + pFlags: *mut c_ulong, + Offset: c_ulong, + pBstr: *mut BSTR, + ) -> c_ulong; + pub fn BSTR_UserMarshal64( + pFlags: *mut c_ulong, + pBuffer: *mut c_uchar, + pBstr: *mut BSTR, + ) -> *mut c_uchar; + pub fn BSTR_UserUnmarshal64( + pFlags: *mut c_ulong, + pBuffer: *mut c_uchar, + pBstr: *mut BSTR, + ) -> *mut c_uchar; + pub fn BSTR_UserFree64( + pFlags: *mut c_ulong, + pBstr: *mut BSTR, + ); +} diff --git a/bash-5.1/vendor/winapi/src/um/bitsmsg.rs b/bash-5.1/vendor/winapi/src/um/bitsmsg.rs new file mode 100644 index 0000000000000000000000000000000000000000..b7029f730bde9c36729075646873291abe623afa --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bitsmsg.rs @@ -0,0 +1,142 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! error code definitions for the background file copier +use shared::minwindef::DWORD; +pub const BG_E_NOT_FOUND: DWORD = 0x80200001; +pub const BG_E_INVALID_STATE: DWORD = 0x80200002; +pub const BG_E_EMPTY: DWORD = 0x80200003; +pub const BG_E_FILE_NOT_AVAILABLE: DWORD = 0x80200004; +pub const BG_E_PROTOCOL_NOT_AVAILABLE: DWORD = 0x80200005; +pub const BG_S_ERROR_CONTEXT_NONE: DWORD = 0x00200006; +pub const BG_E_ERROR_CONTEXT_UNKNOWN: DWORD = 0x80200007; +pub const BG_E_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER: DWORD = 0x80200008; +pub const BG_E_ERROR_CONTEXT_LOCAL_FILE: DWORD = 0x80200009; +pub const BG_E_ERROR_CONTEXT_REMOTE_FILE: DWORD = 0x8020000A; +pub const BG_E_ERROR_CONTEXT_GENERAL_TRANSPORT: DWORD = 0x8020000B; +pub const BG_E_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION: DWORD = 0x8020000C; +pub const BG_E_DESTINATION_LOCKED: DWORD = 0x8020000D; +pub const BG_E_VOLUME_CHANGED: DWORD = 0x8020000E; +pub const BG_E_ERROR_INFORMATION_UNAVAILABLE: DWORD = 0x8020000F; +pub const BG_E_NETWORK_DISCONNECTED: DWORD = 0x80200010; +pub const BG_E_MISSING_FILE_SIZE: DWORD = 0x80200011; +pub const BG_E_INSUFFICIENT_HTTP_SUPPORT: DWORD = 0x80200012; +pub const BG_E_INSUFFICIENT_RANGE_SUPPORT: DWORD = 0x80200013; +pub const BG_E_REMOTE_NOT_SUPPORTED: DWORD = 0x80200014; +pub const BG_E_NEW_OWNER_DIFF_MAPPING: DWORD = 0x80200015; +pub const BG_E_NEW_OWNER_NO_FILE_ACCESS: DWORD = 0x80200016; +pub const BG_S_PARTIAL_COMPLETE: DWORD = 0x00200017; +pub const BG_E_PROXY_LIST_TOO_LARGE: DWORD = 0x80200018; +pub const BG_E_PROXY_BYPASS_LIST_TOO_LARGE: DWORD = 0x80200019; +pub const BG_S_UNABLE_TO_DELETE_FILES: DWORD = 0x0020001A; +pub const BG_E_INVALID_SERVER_RESPONSE: DWORD = 0x8020001B; +pub const BG_E_TOO_MANY_FILES: DWORD = 0x8020001C; +pub const BG_E_LOCAL_FILE_CHANGED: DWORD = 0x8020001D; +pub const BG_E_ERROR_CONTEXT_REMOTE_APPLICATION: DWORD = 0x8020001E; +pub const BG_E_SESSION_NOT_FOUND: DWORD = 0x8020001F; +pub const BG_E_TOO_LARGE: DWORD = 0x80200020; +pub const BG_E_STRING_TOO_LONG: DWORD = 0x80200021; +pub const BG_E_CLIENT_SERVER_PROTOCOL_MISMATCH: DWORD = 0x80200022; +pub const BG_E_SERVER_EXECUTE_ENABLE: DWORD = 0x80200023; +pub const BG_E_NO_PROGRESS: DWORD = 0x80200024; +pub const BG_E_USERNAME_TOO_LARGE: DWORD = 0x80200025; +pub const BG_E_PASSWORD_TOO_LARGE: DWORD = 0x80200026; +pub const BG_E_INVALID_AUTH_TARGET: DWORD = 0x80200027; +pub const BG_E_INVALID_AUTH_SCHEME: DWORD = 0x80200028; +pub const BG_E_FILE_NOT_FOUND: DWORD = 0x80200029; +pub const BG_S_PROXY_CHANGED: DWORD = 0x0020002A; +pub const BG_E_INVALID_RANGE: DWORD = 0x8020002B; +pub const BG_E_OVERLAPPING_RANGES: DWORD = 0x8020002C; +pub const BG_E_CONNECT_FAILURE: DWORD = 0x8020002D; +pub const BG_E_CONNECTION_CLOSED: DWORD = 0x8020002E; +pub const BG_E_BLOCKED_BY_POLICY: DWORD = 0x8020003E; +pub const BG_E_INVALID_PROXY_INFO: DWORD = 0x8020003F; +pub const BG_E_INVALID_CREDENTIALS: DWORD = 0x80200040; +pub const BG_E_INVALID_HASH_ALGORITHM: DWORD = 0x80200041; +pub const BG_E_RECORD_DELETED: DWORD = 0x80200042; +pub const BG_E_COMMIT_IN_PROGRESS: DWORD = 0x80200043; +pub const BG_E_DISCOVERY_IN_PROGRESS: DWORD = 0x80200044; +pub const BG_E_UPNP_ERROR: DWORD = 0x80200045; +pub const BG_E_TEST_OPTION_BLOCKED_DOWNLOAD: DWORD = 0x80200046; +pub const BG_E_PEERCACHING_DISABLED: DWORD = 0x80200047; +pub const BG_E_BUSYCACHERECORD: DWORD = 0x80200048; +pub const BG_E_TOO_MANY_JOBS_PER_USER: DWORD = 0x80200049; +pub const BG_E_TOO_MANY_JOBS_PER_MACHINE: DWORD = 0x80200050; +pub const BG_E_TOO_MANY_FILES_IN_JOB: DWORD = 0x80200051; +pub const BG_E_TOO_MANY_RANGES_IN_FILE: DWORD = 0x80200052; +pub const BG_E_VALIDATION_FAILED: DWORD = 0x80200053; +pub const BG_E_MAXDOWNLOAD_TIMEOUT: DWORD = 0x80200054; +pub const BG_S_OVERRIDDEN_BY_POLICY: DWORD = 0x00200055; +pub const BG_E_TOKEN_REQUIRED: DWORD = 0x80200056; +pub const BG_E_UNKNOWN_PROPERTY_ID: DWORD = 0x80200057; +pub const BG_E_READ_ONLY_PROPERTY: DWORD = 0x80200058; +pub const BG_E_BLOCKED_BY_COST_TRANSFER_POLICY: DWORD = 0x80200059; +pub const BG_E_PROPERTY_SUPPORTED_FOR_DOWNLOAD_JOBS_ONLY: DWORD = 0x80200060; +pub const BG_E_READ_ONLY_PROPERTY_AFTER_ADDFILE: DWORD = 0x80200061; +pub const BG_E_READ_ONLY_PROPERTY_AFTER_RESUME: DWORD = 0x80200062; +pub const BG_E_MAX_DOWNLOAD_SIZE_INVALID_VALUE: DWORD = 0x80200063; +pub const BG_E_MAX_DOWNLOAD_SIZE_LIMIT_REACHED: DWORD = 0x80200064; +pub const BG_E_STANDBY_MODE: DWORD = 0x80200065; +pub const BG_E_USE_STORED_CREDENTIALS_NOT_SUPPORTED: DWORD = 0x80200066; +pub const BG_E_BLOCKED_BY_BATTERY_POLICY: DWORD = 0x80200067; +pub const BG_E_BLOCKED_BY_BATTERY_SAVER: DWORD = 0x80200068; +pub const BG_E_WATCHDOG_TIMEOUT: DWORD = 0x80200069; +pub const BG_E_APP_PACKAGE_NOT_FOUND: DWORD = 0x8020006A; +pub const BG_E_APP_PACKAGE_SCENARIO_NOT_SUPPORTED: DWORD = 0x8020006B; +pub const BG_E_DATABASE_CORRUPT: DWORD = 0x8020006C; +pub const BG_E_RANDOM_ACCESS_NOT_SUPPORTED: DWORD = 0x8020006D; +pub const BG_E_HTTP_ERROR_100: DWORD = 0x80190064; +pub const BG_E_HTTP_ERROR_101: DWORD = 0x80190065; +pub const BG_E_HTTP_ERROR_200: DWORD = 0x801900C8; +pub const BG_E_HTTP_ERROR_201: DWORD = 0x801900C9; +pub const BG_E_HTTP_ERROR_202: DWORD = 0x801900CA; +pub const BG_E_HTTP_ERROR_203: DWORD = 0x801900CB; +pub const BG_E_HTTP_ERROR_204: DWORD = 0x801900CC; +pub const BG_E_HTTP_ERROR_205: DWORD = 0x801900CD; +pub const BG_E_HTTP_ERROR_206: DWORD = 0x801900CE; +pub const BG_E_HTTP_ERROR_300: DWORD = 0x8019012C; +pub const BG_E_HTTP_ERROR_301: DWORD = 0x8019012D; +pub const BG_E_HTTP_ERROR_302: DWORD = 0x8019012E; +pub const BG_E_HTTP_ERROR_303: DWORD = 0x8019012F; +pub const BG_E_HTTP_ERROR_304: DWORD = 0x80190130; +pub const BG_E_HTTP_ERROR_305: DWORD = 0x80190131; +pub const BG_E_HTTP_ERROR_307: DWORD = 0x80190133; +pub const BG_E_HTTP_ERROR_400: DWORD = 0x80190190; +pub const BG_E_HTTP_ERROR_401: DWORD = 0x80190191; +pub const BG_E_HTTP_ERROR_402: DWORD = 0x80190192; +pub const BG_E_HTTP_ERROR_403: DWORD = 0x80190193; +pub const BG_E_HTTP_ERROR_404: DWORD = 0x80190194; +pub const BG_E_HTTP_ERROR_405: DWORD = 0x80190195; +pub const BG_E_HTTP_ERROR_406: DWORD = 0x80190196; +pub const BG_E_HTTP_ERROR_407: DWORD = 0x80190197; +pub const BG_E_HTTP_ERROR_408: DWORD = 0x80190198; +pub const BG_E_HTTP_ERROR_409: DWORD = 0x80190199; +pub const BG_E_HTTP_ERROR_410: DWORD = 0x8019019A; +pub const BG_E_HTTP_ERROR_411: DWORD = 0x8019019B; +pub const BG_E_HTTP_ERROR_412: DWORD = 0x8019019C; +pub const BG_E_HTTP_ERROR_413: DWORD = 0x8019019D; +pub const BG_E_HTTP_ERROR_414: DWORD = 0x8019019E; +pub const BG_E_HTTP_ERROR_415: DWORD = 0x8019019F; +pub const BG_E_HTTP_ERROR_416: DWORD = 0x801901A0; +pub const BG_E_HTTP_ERROR_417: DWORD = 0x801901A1; +pub const BG_E_HTTP_ERROR_449: DWORD = 0x801901C1; +pub const BG_E_HTTP_ERROR_500: DWORD = 0x801901F4; +pub const BG_E_HTTP_ERROR_501: DWORD = 0x801901F5; +pub const BG_E_HTTP_ERROR_502: DWORD = 0x801901F6; +pub const BG_E_HTTP_ERROR_503: DWORD = 0x801901F7; +pub const BG_E_HTTP_ERROR_504: DWORD = 0x801901F8; +pub const BG_E_HTTP_ERROR_505: DWORD = 0x801901F9; +pub const BITS_MC_JOB_CANCELLED: DWORD = 0x80194000; +pub const BITS_MC_FILE_DELETION_FAILED: DWORD = 0x80194001; +pub const BITS_MC_FILE_DELETION_FAILED_MORE: DWORD = 0x80194002; +pub const BITS_MC_JOB_PROPERTY_CHANGE: DWORD = 0x80194003; +pub const BITS_MC_JOB_TAKE_OWNERSHIP: DWORD = 0x80194004; +pub const BITS_MC_JOB_SCAVENGED: DWORD = 0x80194005; +pub const BITS_MC_JOB_NOTIFICATION_FAILURE: DWORD = 0x80194006; +pub const BITS_MC_STATE_FILE_CORRUPT: DWORD = 0x80194007; +pub const BITS_MC_FAILED_TO_START: DWORD = 0x80194008; +pub const BITS_MC_FATAL_IGD_ERROR: DWORD = 0x80194009; +pub const BITS_MC_PEERCACHING_PORT: DWORD = 0x8019400A; +pub const BITS_MC_WSD_PORT: DWORD = 0x8019400B; diff --git a/bash-5.1/vendor/winapi/src/um/bluetoothapis.rs b/bash-5.1/vendor/winapi/src/um/bluetoothapis.rs new file mode 100644 index 0000000000000000000000000000000000000000..8b75c873920a40a44275c6e0c6270cdc5ae82ac4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bluetoothapis.rs @@ -0,0 +1,414 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::bthdef::{AUTHENTICATION_REQUIREMENTS, BTH_ADDR, BTH_MAX_PIN_SIZE}; +use shared::bthsdpdef::{SDP_LARGE_INTEGER_16, SDP_SPECIFICTYPE, SDP_TYPE, SDP_ULARGE_INTEGER_16}; +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, DWORD, LPBYTE, LPVOID, PULONG, UCHAR, ULONG, USHORT}; +use shared::windef::HWND; +use um::minwinbase::SYSTEMTIME; +use um::winnt::{ + CHAR, HANDLE, LONG, LONGLONG, LPCWSTR, LPWSTR, PVOID, PWSTR, SHORT, ULONGLONG, WCHAR, +}; +pub const BLUETOOTH_MAX_NAME_SIZE: usize = 248; +pub const BLUETOOTH_MAX_PASSKEY_SIZE: usize = 16; +pub const BLUETOOTH_MAX_PASSKEY_BUFFER_SIZE: usize = BLUETOOTH_MAX_PASSKEY_SIZE + 1; +pub const BLUETOOTH_MAX_SERVICE_NAME_SIZE: usize = 256; +pub const BLUETOOTH_DEVICE_NAME_SIZE: usize = 256; +pub type BLUETOOTH_ADDRESS = BTH_ADDR; +pub const BLUETOOTH_NULL_ADDRESS: BLUETOOTH_ADDRESS = 0x0; +STRUCT!{struct BLUETOOTH_LOCAL_SERVICE_INFO { + Enabled: BOOL, + btAddr: BLUETOOTH_ADDRESS, + szName: [WCHAR; BLUETOOTH_MAX_SERVICE_NAME_SIZE], + szDeviceString: [WCHAR; BLUETOOTH_DEVICE_NAME_SIZE], +}} +pub type PBLUETOOTH_LOCAL_SERVICE_INFO = *mut BLUETOOTH_LOCAL_SERVICE_INFO; +STRUCT!{struct BLUETOOTH_FIND_RADIO_PARAMS { + dwSize: DWORD, +}} +pub type HBLUETOOTH_RADIO_FIND = HANDLE; +extern "system" { + pub fn BluetoothFindFirstRadio( + pbtfrp: *const BLUETOOTH_FIND_RADIO_PARAMS, + phRadio: *mut HANDLE, + ) -> HBLUETOOTH_RADIO_FIND; + pub fn BluetoothFindNextRadio( + hFind: HBLUETOOTH_RADIO_FIND, + phRadio: *mut HANDLE, + ) -> BOOL; + pub fn BluetoothFindRadioClose( + hFind: HBLUETOOTH_RADIO_FIND, + ) -> BOOL; +} +STRUCT!{struct BLUETOOTH_RADIO_INFO { + dwSize: DWORD, + address: BLUETOOTH_ADDRESS, + szName: [WCHAR; BLUETOOTH_MAX_NAME_SIZE], + ulClassofDevice: ULONG, + lmpSubversion: USHORT, + manufacturer: USHORT, +}} +pub type PBLUETOOTH_RADIO_INFO = *mut BLUETOOTH_RADIO_INFO; +extern "system" { + pub fn BluetoothGetRadioInfo( + hRadio: HANDLE, + pRadioInfo: PBLUETOOTH_RADIO_INFO, + ) -> DWORD; +} +STRUCT!{struct BLUETOOTH_DEVICE_INFO { + dwSize: DWORD, + Address: BLUETOOTH_ADDRESS, + ulClassofDevice: ULONG, + fConnected: BOOL, + fRemembered: BOOL, + fAuthenticated: BOOL, + stLastSeen: SYSTEMTIME, + stLastUsed: SYSTEMTIME, + szName: [WCHAR; BLUETOOTH_MAX_NAME_SIZE], +}} +pub type PBLUETOOTH_DEVICE_INFO = *mut BLUETOOTH_DEVICE_INFO; +ENUM!{enum BLUETOOTH_AUTHENTICATION_METHOD { + BLUETOOTH_AUTHENTICATION_METHOD_LEGACY = 0x1, + BLUETOOTH_AUTHENTICATION_METHOD_OOB, + BLUETOOTH_AUTHENTICATION_METHOD_NUMERIC_COMPARISON, + BLUETOOTH_AUTHENTICATION_METHOD_PASSKEY_NOTIFICATION, + BLUETOOTH_AUTHENTICATION_METHOD_PASSKEY, +}} +pub type PBLUETOOTH_AUTHENTICATION_METHOD = *mut BLUETOOTH_AUTHENTICATION_METHOD; +ENUM!{enum BLUETOOTH_IO_CAPABILITY { + BLUETOOTH_IO_CAPABILITY_DISPLAYONLY = 0x00, + BLUETOOTH_IO_CAPABILITY_DISPLAYYESNO = 0x01, + BLUETOOTH_IO_CAPABILITY_KEYBOARDONLY = 0x02, + BLUETOOTH_IO_CAPABILITY_NOINPUTNOOUTPUT = 0x03, + BLUETOOTH_IO_CAPABILITY_UNDEFINED = 0xff, +}} +ENUM!{enum BLUETOOTH_AUTHENTICATION_REQUIREMENTS { + BLUETOOTH_MITM_ProtectionNotRequired = 0, + BLUETOOTH_MITM_ProtectionRequired = 0x1, + BLUETOOTH_MITM_ProtectionNotRequiredBonding = 0x2, + BLUETOOTH_MITM_ProtectionRequiredBonding = 0x3, + BLUETOOTH_MITM_ProtectionNotRequiredGeneralBonding = 0x4, + BLUETOOTH_MITM_ProtectionRequiredGeneralBonding = 0x5, + BLUETOOTH_MITM_ProtectionNotDefined = 0xff, +}} +UNION!{union BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS_u { + [u32; 1], + Numeric_Value Numeric_Value_mut: ULONG, + Passkey Passkey_mut: ULONG, +}} +STRUCT!{struct BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS { + deviceInfo: BLUETOOTH_DEVICE_INFO, + authenticationMethod: BLUETOOTH_AUTHENTICATION_METHOD, + ioCapability: BLUETOOTH_IO_CAPABILITY, + authenticationRequirements: BLUETOOTH_AUTHENTICATION_REQUIREMENTS, + u: BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS_u, +}} +pub type PBLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS = *mut BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS; +STRUCT!{struct BLUETOOTH_DEVICE_SEARCH_PARAMS { + dwSize: DWORD, + fReturnAuthenticated: BOOL, + fReturnRemembered: BOOL, + fReturnUnknown: BOOL, + fReturnConnected: BOOL, + fIssueInquiry: BOOL, + cTimeoutMultiplier: UCHAR, + hRadio: HANDLE, +}} +pub type HBLUETOOTH_DEVICE_FIND = HANDLE; +extern "system" { + pub fn BluetoothFindFirstDevice( + pbtsp: *const BLUETOOTH_DEVICE_SEARCH_PARAMS, + pbtdi: *mut BLUETOOTH_DEVICE_INFO, + ) -> HBLUETOOTH_DEVICE_FIND; + pub fn BluetoothFindNextDevice( + hFind: HBLUETOOTH_DEVICE_FIND, + pbtdi: *mut BLUETOOTH_DEVICE_INFO, + ) -> BOOL; + pub fn BluetoothFindDeviceClose( + hFind: HBLUETOOTH_DEVICE_FIND, + ) -> BOOL; + pub fn BluetoothGetDeviceInfo( + hRadio: HANDLE, + pbtdi: *mut BLUETOOTH_DEVICE_INFO, + ) -> DWORD; + pub fn BluetoothUpdateDeviceRecord( + pbtdi: *const BLUETOOTH_DEVICE_INFO, + ) -> DWORD; + pub fn BluetoothRemoveDevice( + pAddress: *const BLUETOOTH_ADDRESS, + ) -> DWORD; +} +STRUCT!{struct BLUETOOTH_COD_PAIRS { + ulCODMask: ULONG, + pcszDescription: LPCWSTR, +}} +FN!{stdcall PFN_DEVICE_CALLBACK( + pvParam: LPVOID, + pDevice: *const BLUETOOTH_DEVICE_INFO, +) -> BOOL} +STRUCT!{struct BLUETOOTH_SELECT_DEVICE_PARAMS { + dwSize: DWORD, + cNumOfClasses: ULONG, + prgClassOfDevices: *mut BLUETOOTH_COD_PAIRS, + pszInfo: LPWSTR, + hwndParent: HWND, + fForceAuthentication: BOOL, + fShowAuthenticated: BOOL, + fShowRemembered: BOOL, + fShowUnknown: BOOL, + fAddNewDeviceWizard: BOOL, + fSkipServicesPage: BOOL, + pfnDeviceCallback: PFN_DEVICE_CALLBACK, + pvParam: LPVOID, + cNumDevices: DWORD, + pDevices: PBLUETOOTH_DEVICE_INFO, +}} +extern "system" { + pub fn BluetoothSelectDevices( + pbtsdp: *mut BLUETOOTH_SELECT_DEVICE_PARAMS, + ) -> BOOL; + pub fn BluetoothSelectDevicesFree( + pbtsdp: *mut BLUETOOTH_SELECT_DEVICE_PARAMS, + ) -> BOOL; + pub fn BluetoothDisplayDeviceProperties( + hwndParent: HWND, + pbtdi: *mut BLUETOOTH_DEVICE_INFO, + ) -> BOOL; + // #[deprecated] + pub fn BluetoothAuthenticateDevice( + hwndParent: HWND, + hRadio: HANDLE, + pbtbi: *mut BLUETOOTH_DEVICE_INFO, + pszPasskey: PWSTR, + ulPasskeyLength: ULONG, + ) -> DWORD; +} +STRUCT!{struct BLUETOOTH_PIN_INFO { + pin: [UCHAR; BTH_MAX_PIN_SIZE], + pinLength: UCHAR, +}} +pub type PBLUETOOTH_PIN_INFO = *mut BLUETOOTH_PIN_INFO; +STRUCT!{struct BLUETOOTH_OOB_DATA_INFO { + C: [UCHAR; 16], + R: [UCHAR; 16], +}} +pub type PBLUETOOTH_OOB_DATA_INFO = *mut BLUETOOTH_OOB_DATA_INFO; +STRUCT!{struct BLUETOOTH_NUMERIC_COMPARISON_INFO { + NumericValue: ULONG, +}} +pub type PBLUETOOTH_NUMERIC_COMPARISON_INFO = *mut BLUETOOTH_NUMERIC_COMPARISON_INFO; +STRUCT!{struct BLUETOOTH_PASSKEY_INFO { + passkey: ULONG, +}} +pub type PBLUETOOTH_PASSKEY_INFO = *mut BLUETOOTH_PASSKEY_INFO; +extern "system" { + pub fn BluetoothAuthenticateDeviceEx( + hwndParentIn: HWND, + hRadioIn: HANDLE, + pbtdiInout: *mut BLUETOOTH_DEVICE_INFO, + pbtOobData: PBLUETOOTH_OOB_DATA_INFO, + authenticationRequirement: AUTHENTICATION_REQUIREMENTS, + ) -> DWORD; + // #[deprecated] + pub fn BluetoothAuthenticateMultipleDevices( + hwndParent: HWND, + hRadio: HANDLE, + cDevices: DWORD, + rgbtdi: *mut BLUETOOTH_DEVICE_INFO, + ) -> DWORD; +} +pub const BLUETOOTH_SERVICE_DISABLE: DWORD = 0x00; +pub const BLUETOOTH_SERVICE_ENABLE: DWORD = 0x01; +pub const BLUETOOTH_SERVICE_MASK: DWORD = BLUETOOTH_SERVICE_DISABLE | BLUETOOTH_SERVICE_ENABLE; +extern "system" { + pub fn BluetoothSetServiceState( + hRadio: HANDLE, + pbtdi: *const BLUETOOTH_DEVICE_INFO, + pGuidService: *const GUID, + dwServiceFlags: DWORD, + ) -> DWORD; + pub fn BluetoothEnumerateInstalledServices( + hRadio: HANDLE, + pbtdi: *const BLUETOOTH_DEVICE_INFO, + pcServiceInout: *mut DWORD, + pGuidServices: *mut GUID, + ) -> DWORD; + pub fn BluetoothEnableDiscovery( + hRadio: HANDLE, + fEnabled: BOOL, + ) -> BOOL; + pub fn BluetoothIsDiscoverable( + hRadio: HANDLE, + ) -> BOOL; + pub fn BluetoothEnableIncomingConnections( + hRadio: HANDLE, + fEnabled: BOOL, + ) -> BOOL; + pub fn BluetoothIsConnectable( + hRadio: HANDLE, + ) -> BOOL; +} +pub type HBLUETOOTH_AUTHENTICATION_REGISTRATION = HANDLE; +FN!{stdcall PFN_AUTHENTICATION_CALLBACK( + pvParam: LPVOID, + pDevice: PBLUETOOTH_DEVICE_INFO, +) -> BOOL} +extern "system" { + // #[deprecated] + pub fn BluetoothRegisterForAuthentication( + pbtdi: *const BLUETOOTH_DEVICE_INFO, + phRegHandle: *mut HBLUETOOTH_AUTHENTICATION_REGISTRATION, + pfnCallback: PFN_AUTHENTICATION_CALLBACK, + pvParam: PVOID, + ) -> DWORD; +} +FN!{stdcall PFN_AUTHENTICATION_CALLBACK_EX( + pvParam: LPVOID, + pAuthCallbackParams: PBLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS, +) -> BOOL} +extern "system" { + pub fn BluetoothRegisterForAuthenticationEx( + pbtdiIn: *const BLUETOOTH_DEVICE_INFO, + phRegHandleOut: *mut HBLUETOOTH_AUTHENTICATION_REGISTRATION, + pfnCallbackIn: PFN_AUTHENTICATION_CALLBACK_EX, + pvParam: PVOID, + ) -> DWORD; + pub fn BluetoothUnregisterAuthentication( + hRegHandle: HBLUETOOTH_AUTHENTICATION_REGISTRATION, + ) -> BOOL; + // #[deprecated] + pub fn BluetoothSendAuthenticationResponse( + hRadio: HANDLE, + pbtdi: *const BLUETOOTH_DEVICE_INFO, + pszPasskey: LPCWSTR, + ) -> DWORD; +} +UNION!{union BLUETOOTH_AUTHENTICATE_RESPONSE_u { + [u32; 8], + pinInfo pinInfo_mut: BLUETOOTH_PIN_INFO, + oobInfo oobInfo_mut: BLUETOOTH_OOB_DATA_INFO, + numericCompInfo numericCompInfo_mut: BLUETOOTH_NUMERIC_COMPARISON_INFO, + passkeyInfo passkeyInfo_mut: BLUETOOTH_PASSKEY_INFO, +}} +STRUCT!{struct BLUETOOTH_AUTHENTICATE_RESPONSE { + bthAddressRemote: BLUETOOTH_ADDRESS, + authMethod: BLUETOOTH_AUTHENTICATION_METHOD, + u: BLUETOOTH_AUTHENTICATE_RESPONSE_u, + negativeResponse: UCHAR, +}} +pub type PBLUETOOTH_AUTHENTICATE_RESPONSE = *mut BLUETOOTH_AUTHENTICATE_RESPONSE; +extern "system" { + pub fn BluetoothSendAuthenticationResponseEx( + hRadioIn: HANDLE, + pauthResponse: PBLUETOOTH_AUTHENTICATE_RESPONSE, + ) -> DWORD; +} +STRUCT!{struct SDP_ELEMENT_DATA_data_string { + value: LPBYTE, + length: ULONG, +}} +STRUCT!{struct SDP_ELEMENT_DATA_data_url { + value: LPBYTE, + length: ULONG, +}} +STRUCT!{struct SDP_ELEMENT_DATA_data_sequence { + value: LPBYTE, + length: ULONG, +}} +STRUCT!{struct SDP_ELEMENT_DATA_data_alternative { + value: LPBYTE, + length: ULONG, +}} +UNION!{union SDP_ELEMENT_DATA_data { + [u64; 2], + int128 int128_mut: SDP_LARGE_INTEGER_16, + int64 int64_mut: LONGLONG, + int32 int32_mut: LONG, + int16 int16_mut: SHORT, + int8 int8_mut: CHAR, + uint128 uint128_mut: SDP_ULARGE_INTEGER_16, + uint64 uint64_mut: ULONGLONG, + uint32 uint32_mut: ULONG, + uint16 uint16_mut: USHORT, + uint8 uint8_mut: UCHAR, + booleanVal booleanVal_mut: UCHAR, + uuid128 uuid128_mut: GUID, + uuid32 uuid32_mut: ULONG, + uuid16 uuid16_mut: USHORT, + string string_mut: SDP_ELEMENT_DATA_data_string, + url url_mut: SDP_ELEMENT_DATA_data_url, + sequence sequence_mut: SDP_ELEMENT_DATA_data_sequence, + alternative alternative_mut: SDP_ELEMENT_DATA_data_alternative, +}} +STRUCT!{struct SDP_ELEMENT_DATA { + type_: SDP_TYPE, + specificType: SDP_SPECIFICTYPE, + data: SDP_ELEMENT_DATA_data, +}} +pub type PSDP_ELEMENT_DATA = *mut SDP_ELEMENT_DATA; +extern "system" { + pub fn BluetoothSdpGetElementData( + pSdpStream: LPBYTE, + cbSdpStreamLength: ULONG, + pData: PSDP_ELEMENT_DATA, + ) -> DWORD; +} +pub type HBLUETOOTH_CONTAINER_ELEMENT = HANDLE; +extern "system" { + pub fn BluetoothSdpGetContainerElementData( + pContainerStream: LPBYTE, + cbContainerLength: ULONG, + pElement: *mut HBLUETOOTH_CONTAINER_ELEMENT, + pData: PSDP_ELEMENT_DATA, + ) -> DWORD; + pub fn BluetoothSdpGetAttributeValue( + pRecordStream: LPBYTE, + cbRecordLength: ULONG, + usAttributeId: USHORT, + pAttributeData: PSDP_ELEMENT_DATA, + ) -> DWORD; +} +STRUCT!{struct SDP_STRING_TYPE_DATA { + encoding: USHORT, + mibeNum: USHORT, + attributeId: USHORT, +}} +pub type PSDP_STRING_TYPE_DATA = *mut SDP_STRING_TYPE_DATA; +extern "system" { + pub fn BluetoothSdpGetString( + pRecordStream: LPBYTE, + cbRecordLength: ULONG, + pStringData: PSDP_STRING_TYPE_DATA, + usStringOffset: USHORT, + pszString: PWSTR, + pcchStringLength: PULONG, + ) -> DWORD; +} +FN!{stdcall PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK( + uAttribId: ULONG, + pValueStream: LPBYTE, + cbStreamSize: ULONG, + pvParam: LPVOID, +) -> BOOL} +pub use self::BluetoothSdpEnumAttributes as BluetoothEnumAttributes; +extern "system" { + pub fn BluetoothSdpEnumAttributes( + pSDPStream: LPBYTE, + cbStreamSize: ULONG, + pfnCallback: PFN_BLUETOOTH_ENUM_ATTRIBUTES_CALLBACK, + pvParam: LPVOID, + ) -> BOOL; + pub fn BluetoothSetLocalServiceInfo( + hRadioIn: HANDLE, + pClassGuid: *const GUID, + ulInstance: ULONG, + pServiceInfoIn: *const BLUETOOTH_LOCAL_SERVICE_INFO, + ) -> DWORD; + pub fn BluetoothIsVersionAvailable( + MajorVersion: UCHAR, + MinorVersion: UCHAR, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/bluetoothleapis.rs b/bash-5.1/vendor/winapi/src/um/bluetoothleapis.rs new file mode 100644 index 0000000000000000000000000000000000000000..bca8f9743549a1e9653e577627f5fd65826b44df --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bluetoothleapis.rs @@ -0,0 +1,104 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{ULONG, USHORT}; +use shared::winerror::HRESULT; +use um::bthledef::{ + BLUETOOTH_GATT_EVENT_HANDLE, BTH_LE_GATT_EVENT_TYPE, BTH_LE_GATT_RELIABLE_WRITE_CONTEXT, + PBTH_LE_GATT_CHARACTERISTIC, PBTH_LE_GATT_CHARACTERISTIC_VALUE, PBTH_LE_GATT_DESCRIPTOR, + PBTH_LE_GATT_DESCRIPTOR_VALUE, PBTH_LE_GATT_RELIABLE_WRITE_CONTEXT, PBTH_LE_GATT_SERVICE, + PFNBLUETOOTH_GATT_EVENT_CALLBACK, +}; +use um::winnt::{HANDLE, PVOID}; +extern "system" { + pub fn BluetoothGATTGetServices( + hDevice: HANDLE, + ServicesBufferCount: USHORT, + ServicesBuffer: PBTH_LE_GATT_SERVICE, + ServicesBufferActual: *mut USHORT, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTGetIncludedServices( + hDevice: HANDLE, + ParentService: PBTH_LE_GATT_SERVICE, + IncludedServicesBufferCount: USHORT, + IncludedServicesBuffer: PBTH_LE_GATT_SERVICE, + IncludedServicesBufferActual: *mut USHORT, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTGetCharacteristics( + hDevice: HANDLE, + Service: PBTH_LE_GATT_SERVICE, + CharacteristicsBufferCount: USHORT, + CharacteristicsBuffer: PBTH_LE_GATT_CHARACTERISTIC, + CharacteristicsBufferActual: *mut USHORT, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTGetDescriptors( + hDevice: HANDLE, + Characteristic: PBTH_LE_GATT_CHARACTERISTIC, + DescriptorsBufferCount: USHORT, + DescriptorsBuffer: PBTH_LE_GATT_DESCRIPTOR, + DescriptorsBufferActual: *mut USHORT, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTGetCharacteristicValue( + hDevice: HANDLE, + Characteristic: PBTH_LE_GATT_CHARACTERISTIC, + CharacteristicValueDataSize: ULONG, + CharacteristicValue: PBTH_LE_GATT_CHARACTERISTIC_VALUE, + CharacteristicValueSizeRequired: *mut USHORT, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTGetDescriptorValue( + hDevice: HANDLE, + Descriptor: PBTH_LE_GATT_DESCRIPTOR, + DescriptorValueDataSize: ULONG, + DescriptorValue: PBTH_LE_GATT_DESCRIPTOR_VALUE, + DescriptorValueSizeRequired: *mut USHORT, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTBeginReliableWrite( + hDevice: HANDLE, + ReliableWriteContext: PBTH_LE_GATT_RELIABLE_WRITE_CONTEXT, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTSetCharacteristicValue( + hDevice: HANDLE, + Characteristic: PBTH_LE_GATT_CHARACTERISTIC, + CharacteristicValue: PBTH_LE_GATT_CHARACTERISTIC_VALUE, + ReliableWriteContext: BTH_LE_GATT_RELIABLE_WRITE_CONTEXT, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTEndReliableWrite( + hDevice: HANDLE, + ReliableWriteContext: BTH_LE_GATT_RELIABLE_WRITE_CONTEXT, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTAbortReliableWrite( + hDevice: HANDLE, + ReliableWriteContext: BTH_LE_GATT_RELIABLE_WRITE_CONTEXT, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTSetDescriptorValue( + hDevice: HANDLE, + Descriptor: PBTH_LE_GATT_DESCRIPTOR, + DescriptorValue: PBTH_LE_GATT_DESCRIPTOR_VALUE, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTRegisterEvent( + hService: HANDLE, + EventType: BTH_LE_GATT_EVENT_TYPE, + EventParameterIn: PVOID, + Callback: PFNBLUETOOTH_GATT_EVENT_CALLBACK, + CallbackContext: PVOID, + pEventHandle: *mut BLUETOOTH_GATT_EVENT_HANDLE, + Flags: ULONG, + ) -> HRESULT; + pub fn BluetoothGATTUnregisterEvent( + EventHandle: BLUETOOTH_GATT_EVENT_HANDLE, + Flags: ULONG, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/bthledef.rs b/bash-5.1/vendor/winapi/src/um/bthledef.rs new file mode 100644 index 0000000000000000000000000000000000000000..ca97c3219e93007b8f8a59ac27e26b1956234380 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/bthledef.rs @@ -0,0 +1,280 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::ULONG64; +use shared::guiddef::{GUID, IsEqualGUID}; +use shared::minwindef::{UCHAR, ULONG, USHORT}; +use um::winnt::{BOOLEAN, HANDLE, PVOID}; +DEFINE_GUID!{GUID_BLUETOOTHLE_DEVICE_INTERFACE, + 0x781aee18, 0x7733, 0x4ce4, 0xad, 0xd0, 0x91, 0xf4, 0x1c, 0x67, 0xb5, 0x92} +DEFINE_GUID!{GUID_BLUETOOTH_GATT_SERVICE_DEVICE_INTERFACE, + 0x6e3bb679, 0x4372, 0x40c8, 0x9e, 0xaa, 0x45, 0x09, 0xdf, 0x26, 0x0c, 0xd8} +DEFINE_GUID!{BTH_LE_ATT_BLUETOOTH_BASE_GUID, + 0x00000000, 0x0000, 0x1000, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB} +pub const BTH_LE_SERVICE_GAP: USHORT = 0x1800; +pub const BTH_LE_SERVICE_GATT: USHORT = 0x1801; +pub const BTH_LE_GATT_ATTRIBUTE_TYPE_PRIMARY_SERVICE: USHORT = 0x2800; +pub const BTH_LE_GATT_ATTRIBUTE_TYPE_SECONDARY_SERVICE: USHORT = 0x2801; +pub const BTH_LE_GATT_ATTRIBUTE_TYPE_INCLUDE: USHORT = 0x2802; +pub const BTH_LE_GATT_ATTRIBUTE_TYPE_CHARACTERISTIC: USHORT = 0x2803; +pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_EXTENDED_PROPERTIES: USHORT = 0x2900; +pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_USER_DESCRIPTION: USHORT = 0x2901; +pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_CLIENT_CONFIGURATION: USHORT = 0x2902; +pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_SERVER_CONFIGURATION: USHORT = 0x2903; +pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_FORMAT: USHORT = 0x2904; +pub const BTH_LE_GATT_CHARACTERISTIC_DESCRIPTOR_AGGREGATE_FORMAT: USHORT = 0x2905; +pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_DEVICE_NAME: USHORT = 0x2A00; +pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_APPEARANCE: USHORT = 0x2A01; +pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_PERIPHERAL_PRIVACY_FLAG: USHORT = 0x2A02; +pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_RECONNECTION_ADDRESS: USHORT = 0x2A03; +pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_PERIPHERAL_PREFERED_CONNECTION_PARAMETER: USHORT + = 0x2A04; +pub const BTH_LE_GATT_CHARACTERISTIC_TYPE_SERVICE_CHANGED: USHORT = 0x2A05; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_OFFSET: u8 = 0x6; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_MASK: USHORT = 0x3ff; +#[inline] +pub fn BTH_LE_GAP_APPEARANCE_GET_CATEGORY(a: USHORT) -> USHORT { + (a >> BTH_LE_GAP_APPEARANCE_CATEGORY_OFFSET) & BTH_LE_GAP_APPEARANCE_CATEGORY_MASK +} +#[inline] +pub fn BTH_LE_GAP_APPEARANCE_SET_CATEGORY(a: &mut USHORT, c: USHORT) { + *a = (*a & !BTH_LE_GAP_APPEARANCE_CATEGORY_MASK) + | (c << BTH_LE_GAP_APPEARANCE_CATEGORY_OFFSET); +} +pub const BTH_LE_GAP_APPEARANCE_SUB_CATEGORY_MASK: USHORT = 0x3f; +#[inline] +pub fn BTH_LE_GAP_APPEARANCE_GET_SUB_CATEGORY(a: USHORT) -> UCHAR { + (a & BTH_LE_GAP_APPEARANCE_SUB_CATEGORY_MASK) as u8 +} +#[inline] +pub fn BTH_LE_GAP_APPEARANCE_SET_SUB_CATEGORY(a: &mut USHORT, s: UCHAR) { + *a = (*a & !BTH_LE_GAP_APPEARANCE_SUB_CATEGORY_MASK) | (s as u16); +} +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_UNCATEGORIZED: USHORT = 0x0000; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_PHONE: USHORT = 0x0001; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_COMPUTER: USHORT = 0x0002; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_WATCH: USHORT = 0x0003; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_CLOCK: USHORT = 0x0004; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_DISPLAY: USHORT = 0x0005; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_REMOTE_CONTROL: USHORT = 0x0006; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_EYE_GLASSES: USHORT = 0x0007; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_TAG: USHORT = 0x0008; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_KEYRING: USHORT = 0x0009; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_MEDIA_PLAYER: USHORT = 0x000a; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_BARCODE_SCANNER: USHORT = 0x000b; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_THERMOMETER: USHORT = 0x000c; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_HEART_RATE: USHORT = 0x000d; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_BLOOD_PRESSURE: USHORT = 0x000e; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_HID: USHORT = 0x000f; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_GLUCOSE_METER: USHORT = 0x0010; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_RUNNING_WALKING_SENSOR: USHORT = 0x0011; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_CYCLING: USHORT = 0x0012; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_PLUSE_OXIMETER: USHORT = 0x0031; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_WEIGHT_SCALE: USHORT = 0x0032; +pub const BTH_LE_GAP_APPEARANCE_CATEGORY_OUTDOOR_SPORTS_ACTIVITY: USHORT = 0x0051; +pub const BTH_LE_GAP_APPEARANCE_SUBCATEGORY_GENERIC: UCHAR = 0x00; +pub const BTH_LE_GAP_APPEARANCE_WATCH_SUBCATEGORY_SPORTS_WATCH: UCHAR = 0x01; +pub const BTH_LE_GAP_APPEARANCE_THERMOMETER_SUBCATEGORY_EAR: UCHAR = 0x01; +pub const BTH_LE_GAP_APPEARANCE_HEART_RATE_SUBCATEGORY_HEART_RATE_BELT: UCHAR = 0x01; +pub const BTH_LE_GAP_APPEARANCE_BLOOD_PRESSURE_SUBCATEGORY_ARM: UCHAR = 0x01; +pub const BTH_LE_GAP_APPEARANCE_BLOOD_PRESSURE_SUBCATEGORY_WRIST: UCHAR = 0x02; +pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_KEYBOARD: UCHAR = 0x01; +pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_MOUSE: UCHAR = 0x02; +pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_JOYSTICK: UCHAR = 0x03; +pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_GAMEPAD: UCHAR = 0x04; +pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_DIGITIZER_TABLET: UCHAR = 0x05; +pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_CARD_READER: UCHAR = 0x06; +pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_DIGITAL_PEN: UCHAR = 0x07; +pub const BTH_LE_GAP_APPEARANCE_HID_SUBCATEGORY_BARCODE_SCANNER: UCHAR = 0x08; +pub const BTH_LE_GAP_APPEARANCE_RUNNING_WALKING_SENSOR_SUBCATEGORY_IN_SHOE: UCHAR = 0x01; +pub const BTH_LE_GAP_APPEARANCE_RUNNING_WALKING_SENSOR_SUBCATEGORY_ON_SHOE: UCHAR = 0x02; +pub const BTH_LE_GAP_APPEARANCE_RUNNING_WALKING_SENSOR_SUBCATEGORY_ON_HIP: UCHAR = 0x03; +pub const BTH_LE_GAP_APPEARANCE_CYCLING_SUBCATEGORY_CYCLING_COMPUTER: UCHAR = 0x01; +pub const BTH_LE_GAP_APPEARANCE_CYCLING_SUBCATEGORY_SPEED_SENSOR: UCHAR = 0x02; +pub const BTH_LE_GAP_APPEARANCE_CYCLING_SUBCATEGORY_CADENCE_SENSOR: UCHAR = 0x03; +pub const BTH_LE_GAP_APPEARANCE_CYCLING_SUBCATEGORY_POWER_SENSOR: UCHAR = 0x04; +pub const BTH_LE_GAP_APPEARANCE_CYCLING_SUBCATEGORY_SPEED_AND_CADENCE_SENSOR: UCHAR = 0x05; +pub const BTH_LE_GAP_APPEARANCE_PULSE_OXIMETER_SUBCATEGORY_FINGERTIP: UCHAR = 0x01; +pub const BTH_LE_GAP_APPEARANCE_PULSE_OXIMETER_SUBCATEGORY_WRIST_WORN: UCHAR = 0x02; +pub const BTH_LE_GAP_APPEARANCE_OUTDOOR_SPORTS_ACTIVITY_SUBCATEGORY_LOCATION_DISPLAY_DEVICE: UCHAR + = 0x01; +pub const + BTH_LE_GAP_APPEARANCE_OUTDOOR_SPORTS_ACTIVITY_SUBCATEGORY_LOCATION_NAVIGATION_DISPLAY_DEVICE: + UCHAR = 0x02; +pub const BTH_LE_GAP_APPEARANCE_OUTDOOR_SPORTS_ACTIVITY_SUBCATEGORY_LOCATION_POD: UCHAR = 0x03; +pub const BTH_LE_GAP_APPEARANCE_OUTDOOR_SPORTS_ACTIVITY_SUBCATEGORY_LOCATION_NAVIGATION_POD: UCHAR + = 0x04; +pub const BTH_LE_GATT_DEFAULT_MAX_INCLUDED_SERVICES_DEPTH: USHORT = 3; +pub const BTH_LE_ATT_TRANSACTION_TIMEOUT: USHORT = 30; +pub const BTH_LE_ATT_MAX_VALUE_SIZE: USHORT = 512; +pub const BTH_LE_ATT_CID: USHORT = 0x0004; +pub const BTHLEENUM_ATT_MTU_MIN: USHORT = 23; +// #define BTHLEENUM_ATT_MTU_MAX (MAX_USHORT) +pub const BTHLEENUM_ATT_MTU_DEFAULT: USHORT = BTHLEENUM_ATT_MTU_MIN; +pub const BTHLEENUM_ATT_MTU_INITIAL_NEGOTIATION: USHORT = 525; +pub const BTH_LE_ERROR_INVALID_HANDLE: USHORT = 0x01; +pub const BTH_LE_ERROR_READ_NOT_PERMITTED: USHORT = 0x02; +pub const BTH_LE_ERROR_WRITE_NOT_PERMITTED: USHORT = 0x03; +pub const BTH_LE_ERROR_INVALID_PDU: USHORT = 0x04; +pub const BTH_LE_ERROR_INSUFFICIENT_AUTHENTICATION: USHORT = 0x05; +pub const BTH_LE_ERROR_REQUEST_NOT_SUPPORTED: USHORT = 0x06; +pub const BTH_LE_ERROR_INVALID_OFFSET: USHORT = 0x07; +pub const BTH_LE_ERROR_INSUFFICIENT_AUTHORIZATION: USHORT = 0x08; +pub const BTH_LE_ERROR_PREPARE_QUEUE_FULL: USHORT = 0x09; +pub const BTH_LE_ERROR_ATTRIBUTE_NOT_FOUND: USHORT = 0x0A; +pub const BTH_LE_ERROR_ATTRIBUTE_NOT_LONG: USHORT = 0x0B; +pub const BTH_LE_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE: USHORT = 0x0C; +pub const BTH_LE_ERROR_INVALID_ATTRIBUTE_VALUE_LENGTH: USHORT = 0x0D; +pub const BTH_LE_ERROR_UNLIKELY: USHORT = 0x0E; +pub const BTH_LE_ERROR_INSUFFICIENT_ENCRYPTION: USHORT = 0x0F; +pub const BTH_LE_ERROR_UNSUPPORTED_GROUP_TYPE: USHORT = 0x10; +pub const BTH_LE_ERROR_INSUFFICIENT_RESOURCES: USHORT = 0x11; +pub const BTH_LE_ERROR_UNKNOWN: USHORT = 0x1000; +pub const BLUETOOTH_GATT_FLAG_NONE: ULONG = 0x00000000; +pub const BLUETOOTH_GATT_FLAG_CONNECTION_ENCRYPTED: ULONG = 0x00000001; +pub const BLUETOOTH_GATT_FLAG_CONNECTION_AUTHENTICATED: ULONG = 0x00000002; +pub const BLUETOOTH_GATT_FLAG_FORCE_READ_FROM_DEVICE: ULONG = 0x00000004; +pub const BLUETOOTH_GATT_FLAG_FORCE_READ_FROM_CACHE: ULONG = 0x00000008; +pub const BLUETOOTH_GATT_FLAG_SIGNED_WRITE: ULONG = 0x00000010; +pub const BLUETOOTH_GATT_FLAG_WRITE_WITHOUT_RESPONSE: ULONG = 0x00000020; +pub const BLUETOOTH_GATT_FLAG_RETURN_ALL: ULONG = 0x00000040; +pub const BLUETOOTH_GATT_FLAG_VALID_MASK: ULONG = BLUETOOTH_GATT_FLAG_NONE + | BLUETOOTH_GATT_FLAG_CONNECTION_ENCRYPTED | BLUETOOTH_GATT_FLAG_CONNECTION_AUTHENTICATED + | BLUETOOTH_GATT_FLAG_FORCE_READ_FROM_DEVICE | BLUETOOTH_GATT_FLAG_FORCE_READ_FROM_CACHE + | BLUETOOTH_GATT_FLAG_SIGNED_WRITE | BLUETOOTH_GATT_FLAG_WRITE_WITHOUT_RESPONSE + | BLUETOOTH_GATT_FLAG_RETURN_ALL; +#[inline] +pub fn IS_BLUETOOTH_GATT_FLAG_VALID(f: ULONG) -> bool { + (f & !BLUETOOTH_GATT_FLAG_VALID_MASK) == 0 +} +pub type BLUETOOTH_GATT_EVENT_HANDLE = HANDLE; +UNION!{union BTH_LE_UUID_value { + [u32; 4], + ShortUuid ShortUuid_mut: USHORT, + LongUuid LongUuid_mut: GUID, +}} +STRUCT!{struct BTH_LE_UUID { + IsShortUuid: BOOLEAN, + Value: BTH_LE_UUID_value, +}} +pub type PBTH_LE_UUID = *mut BTH_LE_UUID; +STRUCT!{struct BTH_LE_GATT_SERVICE { + ServiceUuid: BTH_LE_UUID, + AttributeHandle: USHORT, +}} +pub type PBTH_LE_GATT_SERVICE = *mut BTH_LE_GATT_SERVICE; +ENUM!{enum BTH_LE_GATT_DESCRIPTOR_TYPE { + CharacteristicExtendedProperties, + CharacteristicUserDescription, + ClientCharacteristicConfiguration, + ServerCharacteristicConfiguration, + CharacteristicFormat, + CharacteristicAggregateFormat, + CustomDescriptor, +}} +pub type PBTH_LE_GATT_DESCRIPTOR_TYPE = *mut BTH_LE_GATT_DESCRIPTOR_TYPE; +STRUCT!{struct BTH_LE_GATT_CHARACTERISTIC { + ServiceHandle: USHORT, + CharacteristicUuid: BTH_LE_UUID, + AttributeHandle: USHORT, + CharacteristicValueHandle: USHORT, + IsBroadcastable: BOOLEAN, + IsReadable: BOOLEAN, + IsWritable: BOOLEAN, + IsWritableWithoutResponse: BOOLEAN, + IsSignedWritable: BOOLEAN, + IsNotifiable: BOOLEAN, + IsIndicatable: BOOLEAN, + HasExtendedProperties: BOOLEAN, +}} +pub type PBTH_LE_GATT_CHARACTERISTIC = *mut BTH_LE_GATT_CHARACTERISTIC; +STRUCT!{struct BTH_LE_GATT_CHARACTERISTIC_VALUE { + DataSize: ULONG, + Data: [UCHAR; 1], +}} +pub type PBTH_LE_GATT_CHARACTERISTIC_VALUE = *mut BTH_LE_GATT_CHARACTERISTIC_VALUE; +STRUCT!{struct BTH_LE_GATT_DESCRIPTOR { + ServiceHandle: USHORT, + CharacteristicHandle: USHORT, + DescriptorType: BTH_LE_GATT_DESCRIPTOR_TYPE, + DescriptorUuid: BTH_LE_UUID, + AttributeHandle: USHORT, +}} +pub type PBTH_LE_GATT_DESCRIPTOR = *mut BTH_LE_GATT_DESCRIPTOR; +STRUCT!{struct BTH_LE_GATT_DESCRIPTOR_VALUE_u_CharacteristicExtendedProperties { + IsReliableWriteEnabled: BOOLEAN, + IsAuxiliariesWritable: BOOLEAN, +}} +STRUCT!{struct BTH_LE_GATT_DESCRIPTOR_VALUE_u_ClientCharacteristicConfiguration { + IsSubscribeToNotification: BOOLEAN, + IsSubscribeToIndication: BOOLEAN, +}} +STRUCT!{struct BTH_LE_GATT_DESCRIPTOR_VALUE_u_ServerCharacteristicConfiguration { + IsBroadcast: BOOLEAN, +}} +STRUCT!{struct BTH_LE_GATT_DESCRIPTOR_VALUE_u_CharacteristicFormat { + Format: UCHAR, + Exponent: UCHAR, + Unit: BTH_LE_UUID, + NameSpace: UCHAR, + Description: BTH_LE_UUID, +}} +UNION!{union BTH_LE_GATT_DESCRIPTOR_VALUE_u { + [u32; 12], + CharacteristicExtendedProperties CharacteristicExtendedProperties_mut: + BTH_LE_GATT_DESCRIPTOR_VALUE_u_CharacteristicExtendedProperties, + ClientCharacteristicConfiguration ClientCharacteristicConfiguration_mut: + BTH_LE_GATT_DESCRIPTOR_VALUE_u_ClientCharacteristicConfiguration, + ServerCharacteristicConfiguration ServerCharacteristicConfiguration_mut: + BTH_LE_GATT_DESCRIPTOR_VALUE_u_ServerCharacteristicConfiguration, + CharacteristicFormat CharacteristicFormat_mut: + BTH_LE_GATT_DESCRIPTOR_VALUE_u_CharacteristicFormat, +}} +STRUCT!{struct BTH_LE_GATT_DESCRIPTOR_VALUE { + DescriptorType: BTH_LE_GATT_DESCRIPTOR_TYPE, + DescriptorUuid: BTH_LE_UUID, + u: BTH_LE_GATT_DESCRIPTOR_VALUE_u, + DataSize: ULONG, + Data: [UCHAR; 1], +}} +pub type PBTH_LE_GATT_DESCRIPTOR_VALUE = *mut BTH_LE_GATT_DESCRIPTOR_VALUE; +ENUM!{enum BTH_LE_GATT_EVENT_TYPE { + CharacteristicValueChangedEvent, +}} +FN!{stdcall PFNBLUETOOTH_GATT_EVENT_CALLBACK( + EventType: BTH_LE_GATT_EVENT_TYPE, + EventOutParameter: PVOID, + Context: PVOID, +) -> ()} +STRUCT!{struct BLUETOOTH_GATT_VALUE_CHANGED_EVENT_REGISTRATION { + NumCharacteristics: USHORT, + Characteristics: [BTH_LE_GATT_CHARACTERISTIC; 1], +}} +pub type PBLUETOOTH_GATT_VALUE_CHANGED_EVENT_REGISTRATION + = *mut BLUETOOTH_GATT_VALUE_CHANGED_EVENT_REGISTRATION; +STRUCT!{struct BLUETOOTH_GATT_VALUE_CHANGED_EVENT { + ChangedAttributeHandle: USHORT, + CharacteristicValueDataSize: usize, + CharacteristicValue: PBTH_LE_GATT_CHARACTERISTIC_VALUE, +}} +pub type PBLUETOOTH_GATT_VALUE_CHANGED_EVENT = *mut BLUETOOTH_GATT_VALUE_CHANGED_EVENT; +pub type BTH_LE_GATT_RELIABLE_WRITE_CONTEXT = ULONG64; +pub type PBTH_LE_GATT_RELIABLE_WRITE_CONTEXT = *mut ULONG64; +#[inline] +pub fn IsBthLEUuidMatch(uuid1: &BTH_LE_UUID, uuid2: &BTH_LE_UUID) -> bool { + fn is_bluetooth_le_uuid(uuid: &GUID) -> bool { + uuid.Data2 == BTH_LE_ATT_BLUETOOTH_BASE_GUID.Data2 + && uuid.Data3 == BTH_LE_ATT_BLUETOOTH_BASE_GUID.Data3 + && uuid.Data4 == BTH_LE_ATT_BLUETOOTH_BASE_GUID.Data4 + } + unsafe { match (uuid1.IsShortUuid != 0, uuid2.IsShortUuid != 0) { + (true, true) => uuid1.Value.ShortUuid() == uuid2.Value.ShortUuid(), + (false, false) => IsEqualGUID(uuid1.Value.LongUuid(), uuid2.Value.LongUuid()), + (true, false) => is_bluetooth_le_uuid(uuid2.Value.LongUuid()) + && ((*uuid1.Value.ShortUuid()) as u32) == uuid2.Value.LongUuid().Data1, + (false, true) => is_bluetooth_le_uuid(uuid1.Value.LongUuid()) + && ((*uuid2.Value.ShortUuid()) as u32) == uuid1.Value.LongUuid().Data1, + }} +} diff --git a/bash-5.1/vendor/winapi/src/um/cfgmgr32.rs b/bash-5.1/vendor/winapi/src/um/cfgmgr32.rs new file mode 100644 index 0000000000000000000000000000000000000000..2c4c7f39fe3f86ffbff1a96b5133217b254994b9 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/cfgmgr32.rs @@ -0,0 +1,2077 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! user APIs for the Configuration Manager +use shared::basetsd::{DWORD_PTR, ULONG32, ULONG64, ULONG_PTR}; +use shared::cfg::PPNP_VETO_TYPE; +use shared::devpropdef::{DEVPROPKEY, DEVPROPTYPE}; +use shared::guiddef::{GUID, LPGUID}; +use shared::minwindef::{BOOL, BYTE, DWORD, MAX_PATH, PBOOL, PBYTE, PHKEY, PULONG, ULONG, WORD}; +use um::winnt::{ + ANYSIZE_ARRAY, CHAR, DWORDLONG, HANDLE, LARGE_INTEGER, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, + PCHAR, PCSTR, PCWSTR, PDWORDLONG, PSTR, PVOID, PWCHAR, PWSTR, ULONGLONG, VOID, WCHAR +}; +use um::winreg::REGSAM; +pub type PCVOID = *const VOID; +pub const MAX_DEVICE_ID_LEN: usize = 200; +pub const MAX_DEVNODE_ID_LEN: usize = MAX_DEVICE_ID_LEN; +pub const MAX_GUID_STRING_LEN: usize = 39; +pub const MAX_CLASS_NAME_LEN: usize = 32; +pub const MAX_PROFILE_LEN: usize = 80; +pub const MAX_CONFIG_VALUE: DWORD = 9999; +pub const MAX_INSTANCE_VALUE: DWORD = 9999; +pub const MAX_MEM_REGISTERS: DWORD = 9; +pub const MAX_IO_PORTS: DWORD = 20; +pub const MAX_IRQS: DWORD = 7; +pub const MAX_DMA_CHANNELS: DWORD = 7; +pub const DWORD_MAX: DWORD = 0xffffffff; +pub const DWORDLONG_MAX: DWORDLONG = 0xffffffffffffffff; +pub const CONFIGMG_VERSION: DWORD = 0x0400; +pub type RETURN_TYPE = DWORD; +pub type CONFIGRET = RETURN_TYPE; +pub type DEVNODE = DWORD; +pub type DEVINST = DWORD; +pub type PDEVNODE = *mut DEVNODE; +pub type PDEVINST = *mut DEVNODE; +pub type DEVNODEID_A = *mut CHAR; +pub type DEVINSTID_A = *mut CHAR; +pub type DEVNODEID_W = *mut WCHAR; +pub type DEVINSTID_W = *mut WCHAR; +pub type LOG_CONF = DWORD_PTR; +pub type PLOG_CONF = *mut LOG_CONF; +pub type RES_DES = DWORD_PTR; +pub type PRES_DES = *mut RES_DES; +pub type RESOURCEID = ULONG; +pub type PRESOURCEID = *mut RESOURCEID; +pub type PRIORITY = ULONG; +pub type PPRIORITY = *mut PRIORITY; +pub type RANGE_LIST = DWORD_PTR; +pub type PRANGE_LIST = *mut RANGE_LIST; +pub type RANGE_ELEMENT = DWORD_PTR; +pub type PRANGE_ELEMENT = *mut RANGE_ELEMENT; +pub type HMACHINE = HANDLE; +pub type PHMACHINE = *mut HMACHINE; +pub type CONFLICT_LIST = ULONG_PTR; +pub type PCONFLICT_LIST = *mut CONFLICT_LIST; +STRUCT!{struct CONFLICT_DETAILS_A { + CD_ulSize: ULONG, + CD_ulMask: ULONG, + CD_dnDevInst: DEVINST, + CD_rdResDes: RES_DES, + CD_ulFlags: ULONG, + CD_szDescription: [CHAR; MAX_PATH], +}} +pub type PCONFLICT_DETAILS_A = *mut CONFLICT_DETAILS_A; +STRUCT!{struct CONFLICT_DETAILS_W { + CD_ulSize: ULONG, + CD_ulMask: ULONG, + CD_dnDevInst: DEVINST, + CD_rdResDes: RES_DES, + CD_ulFlags: ULONG, + CD_szDescription: [WCHAR; MAX_PATH], +}} +pub type PCONFLICT_DETAILS_W = *mut CONFLICT_DETAILS_W; +pub const CM_CDMASK_DEVINST: ULONG = 0x00000001; +pub const CM_CDMASK_RESDES: ULONG = 0x00000002; +pub const CM_CDMASK_FLAGS: ULONG = 0x00000004; +pub const CM_CDMASK_DESCRIPTION: ULONG = 0x00000008; +pub const CM_CDMASK_VALID: ULONG = 0x0000000F; +pub const CM_CDFLAGS_DRIVER: ULONG = 0x00000001; +pub const CM_CDFLAGS_ROOT_OWNED: ULONG = 0x00000002; +pub const CM_CDFLAGS_RESERVED: ULONG = 0x00000004; +pub type REGDISPOSITION = ULONG; +pub const mMD_MemoryType: DWORD = 0x1; +pub const fMD_MemoryType: DWORD = mMD_MemoryType; +pub const fMD_ROM: DWORD = 0x0; +pub const fMD_RAM: DWORD = 0x1; +pub const mMD_32_24: DWORD = 0x2; +pub const fMD_32_24: DWORD = mMD_32_24; +pub const fMD_24: DWORD = 0x0; +pub const fMD_32: DWORD = 0x2; +pub const mMD_Prefetchable: DWORD = 0x4; +pub const fMD_Prefetchable: DWORD = mMD_Prefetchable; +pub const fMD_Pref: DWORD = mMD_Prefetchable; +pub const fMD_PrefetchDisallowed: DWORD = 0x0; +pub const fMD_PrefetchAllowed: DWORD = 0x4; +pub const mMD_Readable: DWORD = 0x8; +pub const fMD_Readable: DWORD = mMD_Readable; +pub const fMD_ReadAllowed: DWORD = 0x0; +pub const fMD_ReadDisallowed: DWORD = 0x8; +pub const mMD_CombinedWrite: DWORD = 0x10; +pub const fMD_CombinedWrite: DWORD = mMD_CombinedWrite; +pub const fMD_CombinedWriteDisallowed: DWORD = 0x0; +pub const fMD_CombinedWriteAllowed: DWORD = 0x10; +pub const mMD_Cacheable: DWORD = 0x20; +pub const fMD_NonCacheable: DWORD = 0x0; +pub const fMD_Cacheable: DWORD = 0x20; +pub const fMD_WINDOW_DECODE: DWORD = 0x40; +pub const fMD_MEMORY_BAR: DWORD = 0x80; +STRUCT!{#[repr(packed)] struct MEM_RANGE { + MR_Align: DWORDLONG, + MR_nBytes: ULONG, + MR_Min: DWORDLONG, + MR_Max: DWORDLONG, + MR_Flags: DWORD, + MR_Reserved: DWORD, +}} +pub type PMEM_RANGE = *mut MEM_RANGE; +STRUCT!{#[repr(packed)] struct MEM_DES { + MD_Count: DWORD, + MD_Type: DWORD, + MD_Alloc_Base: DWORDLONG, + MD_Alloc_End: DWORDLONG, + MD_Flags: DWORD, + MD_Reserved: DWORD, +}} +pub type PMEM_DES = *mut MEM_DES; +STRUCT!{#[repr(packed)] struct MEM_RESOURCE { + MEM_Header: MEM_DES, + MEM_Data: [MEM_RANGE; ANYSIZE_ARRAY], +}} +pub type PMEM_RESOURCE = *mut MEM_RESOURCE; +STRUCT!{#[repr(packed)] struct MEM_LARGE_RANGE { + MLR_Align: DWORDLONG, + MLR_nBytes: ULONGLONG, + MLR_Min: DWORDLONG, + MLR_Max: DWORDLONG, + MLR_Flags: DWORD, + MLR_Reserved: DWORD, +}} +pub type PMEM_LARGE_RANGE = *mut MEM_LARGE_RANGE; +STRUCT!{#[repr(packed)] struct MEM_LARGE_DES { + MLD_Count: DWORD, + MLD_Type: DWORD, + MLD_Alloc_Base: DWORDLONG, + MLD_Alloc_End: DWORDLONG, + MLD_Flags: DWORD, + MLD_Reserved: DWORD, +}} +pub type PMEM_LARGE_DES = *mut MEM_LARGE_DES; +STRUCT!{#[repr(packed)] struct MEM_LARGE_RESOURCE { + MEM_LARGE_Header: MEM_LARGE_DES, + MEM_LARGE_Data: [MEM_LARGE_RANGE; ANYSIZE_ARRAY], +}} +pub type PMEM_LARGE_RESOURCE = *mut MEM_LARGE_RESOURCE; +pub const fIOD_PortType: DWORD = 0x1; +pub const fIOD_Memory: DWORD = 0x0; +pub const fIOD_IO: DWORD = 0x1; +pub const fIOD_DECODE: DWORD = 0x00fc; +pub const fIOD_10_BIT_DECODE: DWORD = 0x0004; +pub const fIOD_12_BIT_DECODE: DWORD = 0x0008; +pub const fIOD_16_BIT_DECODE: DWORD = 0x0010; +pub const fIOD_POSITIVE_DECODE: DWORD = 0x0020; +pub const fIOD_PASSIVE_DECODE: DWORD = 0x0040; +pub const fIOD_WINDOW_DECODE: DWORD = 0x0080; +pub const fIOD_PORT_BAR: DWORD = 0x0100; +pub const IO_ALIAS_10_BIT_DECODE: DWORDLONG = 0x00000004; +pub const IO_ALIAS_12_BIT_DECODE: DWORDLONG = 0x00000010; +pub const IO_ALIAS_16_BIT_DECODE: DWORDLONG = 0x00000000; +pub const IO_ALIAS_POSITIVE_DECODE: DWORDLONG = 0x000000FF; +STRUCT!{#[repr(packed)] struct IO_RANGE { + IOR_Align: DWORDLONG, + IOR_nPorts: DWORD, + IOR_Min: DWORDLONG, + IOR_Max: DWORDLONG, + IOR_RangeFlags: DWORD, + IOR_Alias: DWORDLONG, +}} +pub type PIO_RANGE = *mut IO_RANGE; +STRUCT!{#[repr(packed)] struct IO_DES { + IOD_Count: DWORD, + IOD_Type: DWORD, + IOD_Alloc_Base: DWORDLONG, + IOD_Alloc_End: DWORDLONG, + IOD_DesFlags: DWORD, +}} +pub type PIO_DES = *mut IO_DES; +STRUCT!{#[repr(packed)] struct IO_RESOURCE { + IO_Header: IO_DES, + IO_Data: [IO_RANGE; ANYSIZE_ARRAY], +}} +pub type PIO_RESOURCE = *mut IO_RESOURCE; +pub const mDD_Width: ULONG = 0x3; +pub const fDD_BYTE: ULONG = 0x0; +pub const fDD_WORD: ULONG = 0x1; +pub const fDD_DWORD: ULONG = 0x2; +pub const fDD_BYTE_AND_WORD: ULONG = 0x3; +pub const mDD_BusMaster: ULONG = 0x4; +pub const fDD_NoBusMaster: ULONG = 0x0; +pub const fDD_BusMaster: ULONG = 0x4; +pub const mDD_Type: ULONG = 0x18; +pub const fDD_TypeStandard: ULONG = 0x00; +pub const fDD_TypeA: ULONG = 0x08; +pub const fDD_TypeB: ULONG = 0x10; +pub const fDD_TypeF: ULONG = 0x18; +STRUCT!{#[repr(packed)] struct DMA_RANGE { + DR_Min: ULONG, + DR_Max: ULONG, + DR_Flags: ULONG, +}} +pub type PDMA_RANGE = *mut DMA_RANGE; +STRUCT!{#[repr(packed)] struct DMA_DES { + DD_Count: DWORD, + DD_Type: DWORD, + DD_Flags: DWORD, + DD_Alloc_Chan: ULONG, +}} +pub type PDMA_DES = *mut DMA_DES; +STRUCT!{#[repr(packed)] struct DMA_RESOURCE { + DMA_Header: DMA_DES, + DMA_Data: [DMA_RANGE; ANYSIZE_ARRAY], +}} +pub type PDMA_RESOURCE = *mut DMA_RESOURCE; +pub const mIRQD_Share: ULONG = 0x1; +pub const fIRQD_Exclusive: ULONG = 0x0; +pub const fIRQD_Share: ULONG = 0x1; +pub const fIRQD_Share_Bit: ULONG = 0; +pub const fIRQD_Level_Bit: ULONG = 1; +pub const mIRQD_Edge_Level: ULONG = 0x2; +pub const fIRQD_Level: ULONG = 0x0; +pub const fIRQD_Edge: ULONG = 0x2; +STRUCT!{#[repr(packed)] struct IRQ_RANGE { + IRQR_Min: ULONG, + IRQR_Max: ULONG, + IRQR_Flags: ULONG, +}} +pub type PIRQ_RANGE = *mut IRQ_RANGE; +STRUCT!{#[repr(packed)] struct IRQ_DES_32 { + IRQD_Count: DWORD, + IRQD_Type: DWORD, + IRQD_Flags: DWORD, + IRQD_Alloc_Num: ULONG, + IRQD_Affinity: ULONG32, +}} +pub type PIRQ_DES_32 = *mut IRQ_DES_32; +STRUCT!{#[repr(packed)] struct IRQ_DES_64 { + IRQD_Count: DWORD, + IRQD_Type: DWORD, + IRQD_Flags: DWORD, + IRQD_Alloc_Num: ULONG, + IRQD_Affinity: ULONG64, +}} +pub type PIRQ_DES_64 = *mut IRQ_DES_64; +STRUCT!{#[repr(packed)] struct IRQ_RESOURCE_32 { + IRQ_Header: IRQ_DES_32, + IRQ_Data: [IRQ_RANGE; ANYSIZE_ARRAY], +}} +pub type PIRQ_RESOURCE_32 = *mut IRQ_RESOURCE_32; +STRUCT!{#[repr(packed)] struct IRQ_RESOURCE_64 { + IRQ_Header: IRQ_DES_64, + IRQ_Data: [IRQ_RANGE; ANYSIZE_ARRAY], +}} +pub type PIRQ_RESOURCE_64 = *mut IRQ_RESOURCE_64; +STRUCT!{#[repr(packed)] struct DEVPRIVATE_RANGE { + PR_Data1: DWORD, + PR_Data2: DWORD, + PR_Data3: DWORD, +}} +pub type PDEVPRIVATE_RANGE = *mut DEVPRIVATE_RANGE; +STRUCT!{#[repr(packed)] struct DEVPRIVATE_DES { + PD_Count: DWORD, + PD_Type: DWORD, + PD_Data1: DWORD, + PD_Data2: DWORD, + PD_Data3: DWORD, + PD_Flags: DWORD, +}} +pub type PDEVPRIVATE_DES = *mut DEVPRIVATE_DES; +STRUCT!{#[repr(packed)] struct DEVPRIVATE_RESOURCE { + PRV_Header: DEVPRIVATE_DES, + PRV_Data: [DEVPRIVATE_RANGE; ANYSIZE_ARRAY], +}} +pub type PDEVPRIVATE_RESOURCE = *mut DEVPRIVATE_RESOURCE; +STRUCT!{#[repr(packed)] struct CS_DES { + CSD_SignatureLength: DWORD, + CSD_LegacyDataOffset: DWORD, + CSD_LegacyDataSize: DWORD, + CSD_Flags: DWORD, + CSD_ClassGuid: GUID, + CSD_Signature: [BYTE; ANYSIZE_ARRAY], +}} +pub type PCS_DES = *mut CS_DES; +STRUCT!{#[repr(packed)] struct CS_RESOURCE { + CS_Header: CS_DES, +}} +pub type PCS_RESOURCE = *mut CS_RESOURCE; +pub const mPCD_IO_8_16: DWORD = 0x1; +pub const fPCD_IO_8: DWORD = 0x0; +pub const fPCD_IO_16: DWORD = 0x1; +pub const mPCD_MEM_8_16: DWORD = 0x2; +pub const fPCD_MEM_8: DWORD = 0x0; +pub const fPCD_MEM_16: DWORD = 0x2; +pub const mPCD_MEM_A_C: DWORD = 0xC; +pub const fPCD_MEM1_A: DWORD = 0x4; +pub const fPCD_MEM2_A: DWORD = 0x8; +pub const fPCD_IO_ZW_8: DWORD = 0x10; +pub const fPCD_IO_SRC_16: DWORD = 0x20; +pub const fPCD_IO_WS_16: DWORD = 0x40; +pub const mPCD_MEM_WS: DWORD = 0x300; +pub const fPCD_MEM_WS_ONE: DWORD = 0x100; +pub const fPCD_MEM_WS_TWO: DWORD = 0x200; +pub const fPCD_MEM_WS_THREE: DWORD = 0x300; +pub const fPCD_MEM_A: DWORD = 0x4; +pub const fPCD_ATTRIBUTES_PER_WINDOW: DWORD = 0x8000; +pub const fPCD_IO1_16: DWORD = 0x00010000; +pub const fPCD_IO1_ZW_8: DWORD = 0x00020000; +pub const fPCD_IO1_SRC_16: DWORD = 0x00040000; +pub const fPCD_IO1_WS_16: DWORD = 0x00080000; +pub const fPCD_IO2_16: DWORD = 0x00100000; +pub const fPCD_IO2_ZW_8: DWORD = 0x00200000; +pub const fPCD_IO2_SRC_16: DWORD = 0x00400000; +pub const fPCD_IO2_WS_16: DWORD = 0x00800000; +pub const mPCD_MEM1_WS: DWORD = 0x03000000; +pub const fPCD_MEM1_WS_TWO: DWORD = 0x02000000; +pub const fPCD_MEM1_WS_THREE: DWORD = 0x03000000; +pub const fPCD_MEM1_16: DWORD = 0x04000000; +pub const mPCD_MEM2_WS: DWORD = 0x30000000; +pub const fPCD_MEM2_WS_ONE: DWORD = 0x10000000; +pub const fPCD_MEM2_WS_TWO: DWORD = 0x20000000; +pub const fPCD_MEM2_WS_THREE: DWORD = 0x30000000; +pub const fPCD_MEM2_16: DWORD = 0x40000000; +pub const PCD_MAX_MEMORY: usize = 2; +pub const PCD_MAX_IO: usize = 2; +STRUCT!{#[repr(packed)] struct PCCARD_DES { + PCD_Count: DWORD, + PCD_Type: DWORD, + PCD_Flags: DWORD, + PCD_ConfigIndex: BYTE, + PCD_Reserved: [BYTE; 3], + PCD_MemoryCardBase1: DWORD, + PCD_MemoryCardBase2: DWORD, + PCD_MemoryCardBase: [DWORD; PCD_MAX_MEMORY], + PCD_MemoryFlags: [WORD; PCD_MAX_MEMORY], + PCD_IoFlags: [BYTE; PCD_MAX_IO], +}} +pub type PPCCARD_DES = *mut PCCARD_DES; +STRUCT!{#[repr(packed)] struct PCCARD_RESOURCE { + PcCard_Header: PCCARD_DES, +}} +pub type PPCCARD_RESOURCE = *mut PCCARD_RESOURCE; +pub const mPMF_AUDIO_ENABLE: DWORD = 0x8; +pub const fPMF_AUDIO_ENABLE: DWORD = 0x8; +STRUCT!{#[repr(packed)] struct MFCARD_DES { + PMF_Count: DWORD, + PMF_Type: DWORD, + PMF_Flags: DWORD, + PMF_ConfigOptions: BYTE, + PMF_IoResourceIndex: BYTE, + PMF_Reserved: [BYTE; 2], + PMF_ConfigRegisterBase: DWORD, +}} +pub type PMFCARD_DES = *mut MFCARD_DES; +STRUCT!{#[repr(packed)] struct MFCARD_RESOURCE { + MfCard_Header: MFCARD_DES, +}} +pub type PMFCARD_RESOURCE = *mut MFCARD_RESOURCE; +STRUCT!{#[repr(packed)] struct BUSNUMBER_RANGE { + BUSR_Min: ULONG, + BUSR_Max: ULONG, + BUSR_nBusNumbers: ULONG, + BUSR_Flags: ULONG, +}} +pub type PBUSNUMBER_RANGE = *mut BUSNUMBER_RANGE; +STRUCT!{#[repr(packed)] struct BUSNUMBER_DES { + BUSD_Count: DWORD, + BUSD_Type: DWORD, + BUSD_Flags: DWORD, + BUSD_Alloc_Base: ULONG, + BUSD_Alloc_End: ULONG, +}} +pub type PBUSNUMBER_DES = *mut BUSNUMBER_DES; +STRUCT!{#[repr(packed)] struct BUSNUMBER_RESOURCE { + BusNumber_Header: BUSNUMBER_DES, + BusNumber_Data: [BUSNUMBER_RANGE; ANYSIZE_ARRAY], +}} +pub type PBUSNUMBER_RESOURCE = *mut BUSNUMBER_RESOURCE; +STRUCT!{#[repr(packed)] struct CONNECTION_DES { + COND_Type: DWORD, + COND_Flags: DWORD, + COND_Class: BYTE, + COND_ClassType: BYTE, + COND_Reserved1: BYTE, + COND_Reserved2: BYTE, + COND_Id: LARGE_INTEGER, +}} +pub type PCONNECTION_DES = *mut CONNECTION_DES; +STRUCT!{#[repr(packed)] struct CONNECTION_RESOURCE { + Connection_Header: CONNECTION_DES, +}} +pub type PCONNECTION_RESOURCE = *mut CONNECTION_RESOURCE; +pub const CM_HWPI_NOT_DOCKABLE: DWORD = 0x00000000; +pub const CM_HWPI_UNDOCKED: DWORD = 0x00000001; +pub const CM_HWPI_DOCKED: DWORD = 0x00000002; +STRUCT!{#[repr(packed)] struct HWPROFILEINFO_A { + HWPI_ulHWProfile: ULONG, + HWPI_szFriendlyName: [CHAR; MAX_PROFILE_LEN], + HWPI_dwFlags: DWORD, +}} +pub type PHWPROFILEINFO_A = *mut HWPROFILEINFO_A; +STRUCT!{#[repr(packed)] struct HWPROFILEINFO_W { + HWPI_ulHWProfile: ULONG, + HWPI_szFriendlyName: [WCHAR; MAX_PROFILE_LEN], + HWPI_dwFlags: DWORD, +}} +pub type PHWPROFILEINFO_W = *mut HWPROFILEINFO_W; +pub const ResType_All: RESOURCEID = 0x00000000; +pub const ResType_None: RESOURCEID = 0x00000000; +pub const ResType_Mem: RESOURCEID = 0x00000001; +pub const ResType_IO: RESOURCEID = 0x00000002; +pub const ResType_DMA: RESOURCEID = 0x00000003; +pub const ResType_IRQ: RESOURCEID = 0x00000004; +pub const ResType_DoNotUse: RESOURCEID = 0x00000005; +pub const ResType_BusNumber: RESOURCEID = 0x00000006; +pub const ResType_MemLarge: RESOURCEID = 0x00000007; +pub const ResType_MAX: RESOURCEID = 0x00000007; +pub const ResType_Ignored_Bit: RESOURCEID = 0x00008000; +pub const ResType_ClassSpecific: RESOURCEID = 0x0000FFFF; +pub const ResType_Reserved: RESOURCEID = 0x00008000; +pub const ResType_DevicePrivate: RESOURCEID = 0x00008001; +pub const ResType_PcCardConfig: RESOURCEID = 0x00008002; +pub const ResType_MfCardConfig: RESOURCEID = 0x00008003; +pub const ResType_Connection: RESOURCEID = 0x00008004; +pub const CM_ADD_RANGE_ADDIFCONFLICT: ULONG = 0x00000000; +pub const CM_ADD_RANGE_DONOTADDIFCONFLICT: ULONG = 0x00000001; +pub const CM_ADD_RANGE_BITS: ULONG = 0x00000001; +pub const BASIC_LOG_CONF: ULONG = 0x00000000; +pub const FILTERED_LOG_CONF: ULONG = 0x00000001; +pub const ALLOC_LOG_CONF: ULONG = 0x00000002; +pub const BOOT_LOG_CONF: ULONG = 0x00000003; +pub const FORCED_LOG_CONF: ULONG = 0x00000004; +pub const OVERRIDE_LOG_CONF: ULONG = 0x00000005; +pub const NUM_LOG_CONF: ULONG = 0x00000006; +pub const LOG_CONF_BITS: ULONG = 0x00000007; +pub const PRIORITY_EQUAL_FIRST: ULONG = 0x00000008; +pub const PRIORITY_EQUAL_LAST: ULONG = 0x00000000; +pub const PRIORITY_BIT: ULONG = 0x00000008; +pub const RegDisposition_OpenAlways: REGDISPOSITION = 0x00000000; +pub const RegDisposition_OpenExisting: REGDISPOSITION = 0x00000001; +pub const RegDisposition_Bits: REGDISPOSITION = 0x00000001; +pub const CM_ADD_ID_HARDWARE: ULONG = 0x00000000; +pub const CM_ADD_ID_COMPATIBLE: ULONG = 0x00000001; +pub const CM_ADD_ID_BITS: ULONG = 0x00000001; +pub const CM_CREATE_DEVNODE_NORMAL: ULONG = 0x00000000; +pub const CM_CREATE_DEVNODE_NO_WAIT_INSTALL: ULONG = 0x00000001; +pub const CM_CREATE_DEVNODE_PHANTOM: ULONG = 0x00000002; +pub const CM_CREATE_DEVNODE_GENERATE_ID: ULONG = 0x00000004; +pub const CM_CREATE_DEVNODE_DO_NOT_INSTALL: ULONG = 0x00000008; +pub const CM_CREATE_DEVNODE_BITS: ULONG = 0x0000000F; +pub const CM_CREATE_DEVINST_NORMAL: ULONG = CM_CREATE_DEVNODE_NORMAL; +pub const CM_CREATE_DEVINST_NO_WAIT_INSTALL: ULONG = CM_CREATE_DEVNODE_NO_WAIT_INSTALL; +pub const CM_CREATE_DEVINST_PHANTOM: ULONG = CM_CREATE_DEVNODE_PHANTOM; +pub const CM_CREATE_DEVINST_GENERATE_ID: ULONG = CM_CREATE_DEVNODE_GENERATE_ID; +pub const CM_CREATE_DEVINST_DO_NOT_INSTALL: ULONG = CM_CREATE_DEVNODE_DO_NOT_INSTALL; +pub const CM_CREATE_DEVINST_BITS: ULONG = CM_CREATE_DEVNODE_BITS; +pub const CM_DELETE_CLASS_ONLY: ULONG = 0x00000000; +pub const CM_DELETE_CLASS_SUBKEYS: ULONG = 0x00000001; +pub const CM_DELETE_CLASS_INTERFACE: ULONG = 0x00000002; +pub const CM_DELETE_CLASS_BITS: ULONG = 0x00000003; +pub const CM_ENUMERATE_CLASSES_INSTALLER: ULONG = 0x00000000; +pub const CM_ENUMERATE_CLASSES_INTERFACE: ULONG = 0x00000001; +pub const CM_ENUMERATE_CLASSES_BITS: ULONG = 0x00000001; +pub const CM_DETECT_NEW_PROFILE: ULONG = 0x00000001; +pub const CM_DETECT_CRASHED: ULONG = 0x00000002; +pub const CM_DETECT_HWPROF_FIRST_BOOT: ULONG = 0x00000004; +pub const CM_DETECT_RUN: ULONG = 0x80000000; +pub const CM_DETECT_BITS: ULONG = 0x80000007; +pub const CM_DISABLE_POLITE: ULONG = 0x00000000; +pub const CM_DISABLE_ABSOLUTE: ULONG = 0x00000001; +pub const CM_DISABLE_HARDWARE: ULONG = 0x00000002; +pub const CM_DISABLE_UI_NOT_OK: ULONG = 0x00000004; +pub const CM_DISABLE_BITS: ULONG = 0x00000007; +pub const CM_GETIDLIST_FILTER_NONE: ULONG = 0x00000000; +pub const CM_GETIDLIST_FILTER_ENUMERATOR: ULONG = 0x00000001; +pub const CM_GETIDLIST_FILTER_SERVICE: ULONG = 0x00000002; +pub const CM_GETIDLIST_FILTER_EJECTRELATIONS: ULONG = 0x00000004; +pub const CM_GETIDLIST_FILTER_REMOVALRELATIONS: ULONG = 0x00000008; +pub const CM_GETIDLIST_FILTER_POWERRELATIONS: ULONG = 0x00000010; +pub const CM_GETIDLIST_FILTER_BUSRELATIONS: ULONG = 0x00000020; +pub const CM_GETIDLIST_DONOTGENERATE: ULONG = 0x10000040; +pub const CM_GETIDLIST_FILTER_TRANSPORTRELATIONS: ULONG = 0x00000080; +pub const CM_GETIDLIST_FILTER_PRESENT: ULONG = 0x00000100; +pub const CM_GETIDLIST_FILTER_CLASS: ULONG = 0x00000200; +pub const CM_GETIDLIST_FILTER_BITS: ULONG = 0x100003FF; +pub const CM_GET_DEVICE_INTERFACE_LIST_PRESENT: ULONG = 0x00000000; +pub const CM_GET_DEVICE_INTERFACE_LIST_ALL_DEVICES: ULONG = 0x00000001; +pub const CM_GET_DEVICE_INTERFACE_LIST_BITS: ULONG = 0x00000001; +pub const CM_DRP_DEVICEDESC: ULONG = 0x00000001; +pub const CM_DRP_HARDWAREID: ULONG = 0x00000002; +pub const CM_DRP_COMPATIBLEIDS: ULONG = 0x00000003; +pub const CM_DRP_UNUSED0: ULONG = 0x00000004; +pub const CM_DRP_SERVICE: ULONG = 0x00000005; +pub const CM_DRP_UNUSED1: ULONG = 0x00000006; +pub const CM_DRP_UNUSED2: ULONG = 0x00000007; +pub const CM_DRP_CLASS: ULONG = 0x00000008; +pub const CM_DRP_CLASSGUID: ULONG = 0x00000009; +pub const CM_DRP_DRIVER: ULONG = 0x0000000A; +pub const CM_DRP_CONFIGFLAGS: ULONG = 0x0000000B; +pub const CM_DRP_MFG: ULONG = 0x0000000C; +pub const CM_DRP_FRIENDLYNAME: ULONG = 0x0000000D; +pub const CM_DRP_LOCATION_INFORMATION: ULONG = 0x0000000E; +pub const CM_DRP_PHYSICAL_DEVICE_OBJECT_NAME: ULONG = 0x0000000F; +pub const CM_DRP_CAPABILITIES: ULONG = 0x00000010; +pub const CM_DRP_UI_NUMBER: ULONG = 0x00000011; +pub const CM_DRP_UPPERFILTERS: ULONG = 0x00000012; +pub const CM_CRP_UPPERFILTERS: ULONG = CM_DRP_UPPERFILTERS; +pub const CM_DRP_LOWERFILTERS: ULONG = 0x00000013; +pub const CM_CRP_LOWERFILTERS: ULONG = CM_DRP_LOWERFILTERS; +pub const CM_DRP_BUSTYPEGUID: ULONG = 0x00000014; +pub const CM_DRP_LEGACYBUSTYPE: ULONG = 0x00000015; +pub const CM_DRP_BUSNUMBER: ULONG = 0x00000016; +pub const CM_DRP_ENUMERATOR_NAME: ULONG = 0x00000017; +pub const CM_DRP_SECURITY: ULONG = 0x00000018; +pub const CM_CRP_SECURITY: ULONG = CM_DRP_SECURITY; +pub const CM_DRP_SECURITY_SDS: ULONG = 0x00000019; +pub const CM_CRP_SECURITY_SDS: ULONG = CM_DRP_SECURITY_SDS; +pub const CM_DRP_DEVTYPE: ULONG = 0x0000001A; +pub const CM_CRP_DEVTYPE: ULONG = CM_DRP_DEVTYPE; +pub const CM_DRP_EXCLUSIVE: ULONG = 0x0000001B; +pub const CM_CRP_EXCLUSIVE: ULONG = CM_DRP_EXCLUSIVE; +pub const CM_DRP_CHARACTERISTICS: ULONG = 0x0000001C; +pub const CM_CRP_CHARACTERISTICS: ULONG = CM_DRP_CHARACTERISTICS; +pub const CM_DRP_ADDRESS: ULONG = 0x0000001D; +pub const CM_DRP_UI_NUMBER_DESC_FORMAT: ULONG = 0x0000001E; +pub const CM_DRP_DEVICE_POWER_DATA: ULONG = 0x0000001F; +pub const CM_DRP_REMOVAL_POLICY: ULONG = 0x00000020; +pub const CM_DRP_REMOVAL_POLICY_HW_DEFAULT: ULONG = 0x00000021; +pub const CM_DRP_REMOVAL_POLICY_OVERRIDE: ULONG = 0x00000022; +pub const CM_DRP_INSTALL_STATE: ULONG = 0x00000023; +pub const CM_DRP_LOCATION_PATHS: ULONG = 0x00000024; +pub const CM_DRP_BASE_CONTAINERID: ULONG = 0x00000025; +pub const CM_DRP_MIN: ULONG = 0x00000001; +pub const CM_CRP_MIN: ULONG = CM_DRP_MIN; +pub const CM_DRP_MAX: ULONG = 0x00000025; +pub const CM_CRP_MAX: ULONG = CM_DRP_MAX; +pub const CM_DEVCAP_LOCKSUPPORTED: ULONG = 0x00000001; +pub const CM_DEVCAP_EJECTSUPPORTED: ULONG = 0x00000002; +pub const CM_DEVCAP_REMOVABLE: ULONG = 0x00000004; +pub const CM_DEVCAP_DOCKDEVICE: ULONG = 0x00000008; +pub const CM_DEVCAP_UNIQUEID: ULONG = 0x00000010; +pub const CM_DEVCAP_SILENTINSTALL: ULONG = 0x00000020; +pub const CM_DEVCAP_RAWDEVICEOK: ULONG = 0x00000040; +pub const CM_DEVCAP_SURPRISEREMOVALOK: ULONG = 0x00000080; +pub const CM_DEVCAP_HARDWAREDISABLED: ULONG = 0x00000100; +pub const CM_DEVCAP_NONDYNAMIC: ULONG = 0x00000200; +pub const CM_REMOVAL_POLICY_EXPECT_NO_REMOVAL: ULONG = 1; +pub const CM_REMOVAL_POLICY_EXPECT_ORDERLY_REMOVAL: ULONG = 2; +pub const CM_REMOVAL_POLICY_EXPECT_SURPRISE_REMOVAL: ULONG = 3; +pub const CM_INSTALL_STATE_INSTALLED: ULONG = 0; +pub const CM_INSTALL_STATE_NEEDS_REINSTALL: ULONG = 1; +pub const CM_INSTALL_STATE_FAILED_INSTALL: ULONG = 2; +pub const CM_INSTALL_STATE_FINISH_INSTALL: ULONG = 3; +pub const CM_LOCATE_DEVNODE_NORMAL: ULONG = 0x00000000; +pub const CM_LOCATE_DEVNODE_PHANTOM: ULONG = 0x00000001; +pub const CM_LOCATE_DEVNODE_CANCELREMOVE: ULONG = 0x00000002; +pub const CM_LOCATE_DEVNODE_NOVALIDATION: ULONG = 0x00000004; +pub const CM_LOCATE_DEVNODE_BITS: ULONG = 0x00000007; +pub const CM_LOCATE_DEVINST_NORMAL: ULONG = CM_LOCATE_DEVNODE_NORMAL; +pub const CM_LOCATE_DEVINST_PHANTOM: ULONG = CM_LOCATE_DEVNODE_PHANTOM; +pub const CM_LOCATE_DEVINST_CANCELREMOVE: ULONG = CM_LOCATE_DEVNODE_CANCELREMOVE; +pub const CM_LOCATE_DEVINST_NOVALIDATION: ULONG = CM_LOCATE_DEVNODE_NOVALIDATION; +pub const CM_LOCATE_DEVINST_BITS: ULONG = CM_LOCATE_DEVNODE_BITS; +pub const CM_OPEN_CLASS_KEY_INSTALLER: ULONG = 0x00000000; +pub const CM_OPEN_CLASS_KEY_INTERFACE: ULONG = 0x00000001; +pub const CM_OPEN_CLASS_KEY_BITS: ULONG = 0x00000001; +pub const CM_REMOVE_UI_OK: ULONG = 0x00000000; +pub const CM_REMOVE_UI_NOT_OK: ULONG = 0x00000001; +pub const CM_REMOVE_NO_RESTART: ULONG = 0x00000002; +pub const CM_REMOVE_BITS: ULONG = 0x00000003; +pub const CM_QUERY_REMOVE_UI_OK: ULONG = CM_REMOVE_UI_OK; +pub const CM_QUERY_REMOVE_UI_NOT_OK: ULONG = CM_REMOVE_UI_NOT_OK; +pub const CM_QUERY_REMOVE_BITS: ULONG = CM_QUERY_REMOVE_UI_OK | CM_QUERY_REMOVE_UI_NOT_OK; +pub const CM_REENUMERATE_NORMAL: ULONG = 0x00000000; +pub const CM_REENUMERATE_SYNCHRONOUS: ULONG = 0x00000001; +pub const CM_REENUMERATE_RETRY_INSTALLATION: ULONG = 0x00000002; +pub const CM_REENUMERATE_ASYNCHRONOUS: ULONG = 0x00000004; +pub const CM_REENUMERATE_BITS: ULONG = 0x00000007; +pub const CM_REGISTER_DEVICE_DRIVER_STATIC: ULONG = 0x00000000; +pub const CM_REGISTER_DEVICE_DRIVER_DISABLEABLE: ULONG = 0x00000001; +pub const CM_REGISTER_DEVICE_DRIVER_REMOVABLE: ULONG = 0x00000002; +pub const CM_REGISTER_DEVICE_DRIVER_BITS: ULONG = 0x00000003; +pub const CM_REGISTRY_HARDWARE: ULONG = 0x00000000; +pub const CM_REGISTRY_SOFTWARE: ULONG = 0x00000001; +pub const CM_REGISTRY_USER: ULONG = 0x00000100; +pub const CM_REGISTRY_CONFIG: ULONG = 0x00000200; +pub const CM_REGISTRY_BITS: ULONG = 0x00000301; +pub const CM_SET_DEVNODE_PROBLEM_NORMAL: ULONG = 0x00000000; +pub const CM_SET_DEVNODE_PROBLEM_OVERRIDE: ULONG = 0x00000001; +pub const CM_SET_DEVNODE_PROBLEM_BITS: ULONG = 0x00000001; +pub const CM_SET_DEVINST_PROBLEM_NORMAL: ULONG = CM_SET_DEVNODE_PROBLEM_NORMAL; +pub const CM_SET_DEVINST_PROBLEM_OVERRIDE: ULONG = CM_SET_DEVNODE_PROBLEM_OVERRIDE; +pub const CM_SET_DEVINST_PROBLEM_BITS: ULONG = CM_SET_DEVNODE_PROBLEM_BITS; +pub const CM_SET_HW_PROF_FLAGS_UI_NOT_OK: ULONG = 0x00000001; +pub const CM_SET_HW_PROF_FLAGS_BITS: ULONG = 0x00000001; +pub const CM_SETUP_DEVNODE_READY: ULONG = 0x00000000; +pub const CM_SETUP_DEVINST_READY: ULONG = CM_SETUP_DEVNODE_READY; +pub const CM_SETUP_DOWNLOAD: ULONG = 0x00000001; +pub const CM_SETUP_WRITE_LOG_CONFS: ULONG = 0x00000002; +pub const CM_SETUP_PROP_CHANGE: ULONG = 0x00000003; +pub const CM_SETUP_DEVNODE_RESET: ULONG = 0x00000004; +pub const CM_SETUP_DEVINST_RESET: ULONG = CM_SETUP_DEVNODE_RESET; +pub const CM_SETUP_DEVNODE_CONFIG: ULONG = 0x00000005; +pub const CM_SETUP_DEVINST_CONFIG: ULONG = CM_SETUP_DEVNODE_CONFIG; +pub const CM_SETUP_DEVNODE_CONFIG_CLASS: ULONG = 0x00000006; +pub const CM_SETUP_DEVINST_CONFIG_CLASS: ULONG = CM_SETUP_DEVNODE_CONFIG_CLASS; +pub const CM_SETUP_DEVNODE_CONFIG_EXTENSIONS: ULONG = 0x00000007; +pub const CM_SETUP_DEVINST_CONFIG_EXTENSIONS: ULONG = CM_SETUP_DEVNODE_CONFIG_EXTENSIONS; +pub const CM_SETUP_BITS: ULONG = 0x00000007; +pub const CM_QUERY_ARBITRATOR_RAW: ULONG = 0x00000000; +pub const CM_QUERY_ARBITRATOR_TRANSLATED: ULONG = 0x00000001; +pub const CM_QUERY_ARBITRATOR_BITS: ULONG = 0x00000001; +pub const CM_CUSTOMDEVPROP_MERGE_MULTISZ: ULONG = 0x00000001; +pub const CM_CUSTOMDEVPROP_BITS: ULONG = 0x00000001; +pub const CM_NAME_ATTRIBUTE_NAME_RETRIEVED_FROM_DEVICE: ULONG = 0x1; +pub const CM_NAME_ATTRIBUTE_USER_ASSIGNED_NAME: ULONG = 0x2; +pub const CM_CLASS_PROPERTY_INSTALLER: ULONG = 0x00000000; +pub const CM_CLASS_PROPERTY_INTERFACE: ULONG = 0x00000001; +pub const CM_CLASS_PROPERTY_BITS: ULONG = 0x00000001; +DECLARE_HANDLE!{HCMNOTIFICATION, HCMNOTIFICATION__} +pub type PHCMNOTIFICATION = *mut HCMNOTIFICATION; +pub const CM_NOTIFY_FILTER_FLAG_ALL_INTERFACE_CLASSES: ULONG = 0x00000001; +pub const CM_NOTIFY_FILTER_FLAG_ALL_DEVICE_INSTANCES: ULONG = 0x00000002; +pub const CM_NOTIFY_FILTER_VALID_FLAGS: ULONG = CM_NOTIFY_FILTER_FLAG_ALL_INTERFACE_CLASSES + | CM_NOTIFY_FILTER_FLAG_ALL_DEVICE_INSTANCES; +ENUM!{enum CM_NOTIFY_FILTER_TYPE { + CM_NOTIFY_FILTER_TYPE_DEVICEINTERFACE = 0, + CM_NOTIFY_FILTER_TYPE_DEVICEHANDLE, + CM_NOTIFY_FILTER_TYPE_DEVICEINSTANCE, + CM_NOTIFY_FILTER_TYPE_MAX, +}} +pub type PCM_NOTIFY_FILTER_TYPE = *mut CM_NOTIFY_FILTER_TYPE; +STRUCT!{struct CM_NOTIFY_FILTER_DeviceInterface { + ClassGuid: GUID, +}} +STRUCT!{struct CM_NOTIFY_FILTER_DeviceHandle { + hTarget: HANDLE, +}} +STRUCT!{struct CM_NOTIFY_FILTER_DeviceInstance { + InstanceId: [WCHAR; MAX_DEVICE_ID_LEN], +}} +UNION!{union CM_NOTIFY_FILTER_u { + [u32; 100] [u64; 50], + DeviceInterface DeviceInterface_mut: CM_NOTIFY_FILTER_DeviceInterface, + DeviceHandle DeviceHandle_mut: CM_NOTIFY_FILTER_DeviceHandle, + DeviceInstance DeviceInstance_mut: CM_NOTIFY_FILTER_DeviceInstance, +}} +STRUCT!{struct CM_NOTIFY_FILTER { + cbSize: DWORD, + Flags: DWORD, + FilterType: CM_NOTIFY_FILTER_TYPE, + Reserved: DWORD, + u: CM_NOTIFY_FILTER_u, +}} +pub type PCM_NOTIFY_FILTER = *mut CM_NOTIFY_FILTER; +ENUM!{enum CM_NOTIFY_ACTION { + CM_NOTIFY_ACTION_DEVICEINTERFACEARRIVAL = 0, + CM_NOTIFY_ACTION_DEVICEINTERFACEREMOVAL, + CM_NOTIFY_ACTION_DEVICEQUERYREMOVE, + CM_NOTIFY_ACTION_DEVICEQUERYREMOVEFAILED, + CM_NOTIFY_ACTION_DEVICEREMOVEPENDING, + CM_NOTIFY_ACTION_DEVICEREMOVECOMPLETE, + CM_NOTIFY_ACTION_DEVICECUSTOMEVENT, + CM_NOTIFY_ACTION_DEVICEINSTANCEENUMERATED, + CM_NOTIFY_ACTION_DEVICEINSTANCESTARTED, + CM_NOTIFY_ACTION_DEVICEINSTANCEREMOVED, + CM_NOTIFY_ACTION_MAX, +}} +pub type PCM_NOTIFY_ACTION = *mut CM_NOTIFY_ACTION; +STRUCT!{struct CM_NOTIFY_EVENT_DATA_DeviceInterface { + ClassGuid: GUID, + SymbolicLink: [WCHAR; ANYSIZE_ARRAY], +}} +STRUCT!{struct CM_NOTIFY_EVENT_DATA_DeviceHandle { + EventGuid: GUID, + NameOffset: LONG, + DataSize: DWORD, + Data: [BYTE; ANYSIZE_ARRAY], +}} +STRUCT!{struct CM_NOTIFY_EVENT_DATA_DeviceInstance { + InstanceId: [WCHAR; ANYSIZE_ARRAY], +}} +UNION!{union CM_NOTIFY_EVENT_DATA_u { + [u32; 7], + DeviceInterface DeviceInterface_mut: CM_NOTIFY_EVENT_DATA_DeviceInterface, + DeviceHandle DeviceHandle_mut: CM_NOTIFY_EVENT_DATA_DeviceHandle, + DeviceInstance DeviceInstance_mut: CM_NOTIFY_EVENT_DATA_DeviceInstance, +}} +STRUCT!{struct CM_NOTIFY_EVENT_DATA { + FilterType: CM_NOTIFY_FILTER_TYPE, + Reserved: DWORD, + u: CM_NOTIFY_EVENT_DATA_u, +}} +pub type PCM_NOTIFY_EVENT_DATA = *mut CM_NOTIFY_EVENT_DATA; +FN!{stdcall PCM_NOTIFY_CALLBACK( + hNotify: HCMNOTIFICATION, + Context: PVOID, + Action: CM_NOTIFY_ACTION, + EventData: PCM_NOTIFY_EVENT_DATA, + EventDataSize: DWORD, +) -> DWORD} +extern "system" { + pub fn CM_Add_Empty_Log_Conf( + plcLogConf: PLOG_CONF, + dnDevInst: DEVINST, + Priority: PRIORITY, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Add_Empty_Log_Conf_Ex( + plcLogConf: PLOG_CONF, + dnDevInst: DEVINST, + Priority: PRIORITY, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Add_IDA( + dnDevInst: DEVINST, + pszID: PSTR, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Add_IDW( + dnDevInst: DEVINST, + pszID: PWSTR, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Add_ID_ExA( + dnDevInst: DEVINST, + pszID: PSTR, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Add_ID_ExW( + dnDevInst: DEVINST, + pszID: PWSTR, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Add_Range( + ullStartValue: DWORDLONG, + ullEndValue: DWORDLONG, + rlh: RANGE_LIST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Add_Res_Des( + prdResDes: PRES_DES, + lcLogConf: LOG_CONF, + ResourceID: RESOURCEID, + ResourceData: PCVOID, + ResourceLen: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Add_Res_Des_Ex( + prdResDes: PRES_DES, + lcLogConf: LOG_CONF, + ResourceID: RESOURCEID, + ResourceData: PCVOID, + ResourceLen: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Connect_MachineA( + UNCServerName: PCSTR, + phMachine: PHMACHINE, + ) -> CONFIGRET; + pub fn CM_Connect_MachineW( + UNCServerName: PCWSTR, + phMachine: PHMACHINE, + ) -> CONFIGRET; + pub fn CM_Create_DevNodeA( + pdnDevInst: PDEVINST, + pDeviceID: DEVINSTID_A, + dnParent: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Create_DevNodeW( + pdnDevInst: PDEVINST, + pDeviceID: DEVINSTID_W, + dnParent: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Create_DevNode_ExA( + pdnDevInst: PDEVINST, + pDeviceID: DEVINSTID_A, + dnParent: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Create_DevNode_ExW( + pdnDevInst: PDEVINST, + pDeviceID: DEVINSTID_W, + dnParent: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Create_Range_List( + prlh: PRANGE_LIST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Delete_Class_Key( + ClassGuid: LPGUID, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Delete_Class_Key_Ex( + ClassGuid: LPGUID, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Delete_DevNode_Key( + dnDevNode: DEVNODE, + ulHardwareProfile: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Delete_DevNode_Key_Ex( + dnDevNode: DEVNODE, + ulHardwareProfile: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Delete_Range( + ullStartValue: DWORDLONG, + ullEndValue: DWORDLONG, + rlh: RANGE_LIST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Detect_Resource_Conflict( + dnDevInst: DEVINST, + ResourceID: RESOURCEID, + ResourceData: PCVOID, + ResourceLen: ULONG, + pbConflictDetected: PBOOL, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Detect_Resource_Conflict_Ex( + dnDevInst: DEVINST, + ResourceID: RESOURCEID, + ResourceData: PCVOID, + ResourceLen: ULONG, + pbConflictDetected: PBOOL, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Disable_DevNode( + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Disable_DevNode_Ex( + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Disconnect_Machine( + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Dup_Range_List( + rlhOld: RANGE_LIST, + rlhNew: RANGE_LIST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Enable_DevNode( + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Enable_DevNode_Ex( + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Enumerate_Classes( + ulClassIndex: ULONG, + ClassGuid: LPGUID, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Enumerate_Classes_Ex( + ulClassIndex: ULONG, + ClassGuid: LPGUID, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Enumerate_EnumeratorsA( + ulEnumIndex: ULONG, + Buffer: PSTR, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Enumerate_EnumeratorsW( + ulEnumIndex: ULONG, + Buffer: PWSTR, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Enumerate_Enumerators_ExA( + ulEnumIndex: ULONG, + Buffer: PSTR, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Enumerate_Enumerators_ExW( + ulEnumIndex: ULONG, + Buffer: PWSTR, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Find_Range( + pullStart: PDWORDLONG, + ullStart: DWORDLONG, + ulLength: ULONG, + ullAlignment: DWORDLONG, + ullEnd: DWORDLONG, + rlh: RANGE_LIST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_First_Range( + rlh: RANGE_LIST, + pullStart: PDWORDLONG, + pullEnd: PDWORDLONG, + preElement: PRANGE_LIST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Free_Log_Conf( + lcLogConfToBeFreed: LOG_CONF, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Free_Log_Conf_Ex( + lcLogConfToBeFreed: LOG_CONF, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Free_Log_Conf_Handle( + lcLogConf: LOG_CONF, + ) -> CONFIGRET; + pub fn CM_Free_Range_List( + rlh: RANGE_LIST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Free_Res_Des( + prdResDes: PRES_DES, + rdResDes: RES_DES, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Free_Res_Des_Ex( + prdResDes: PRES_DES, + rdResDes: RES_DES, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Free_Res_Des_Handle( + rdResDes: RES_DES, + ) -> CONFIGRET; + pub fn CM_Get_Child( + pdnDevInst: PDEVINST, + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Child_Ex( + pdnDevInst: PDEVINST, + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Class_Key_NameA( + ClassGuid: LPGUID, + pszKeyName: LPSTR, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Class_Key_NameW( + ClassGuid: LPGUID, + pszKeyName: LPWSTR, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Class_Key_Name_ExA( + ClassGuid: LPGUID, + pszKeyName: LPSTR, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Class_Key_Name_ExW( + ClassGuid: LPGUID, + pszKeyName: LPWSTR, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Class_NameA( + ClassGuid: LPGUID, + Buffer: PSTR, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Class_NameW( + ClassGuid: LPGUID, + Buffer: PWSTR, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Class_Name_ExA( + ClassGuid: LPGUID, + Buffer: PSTR, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Class_Name_ExW( + ClassGuid: LPGUID, + Buffer: PWSTR, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Depth( + pulDepth: PULONG, + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Depth_Ex( + pulDepth: PULONG, + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_IDA( + dnDevInst: DEVINST, + Buffer: PSTR, + BufferLen: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_IDW( + dnDevInst: DEVINST, + Buffer: PWSTR, + BufferLen: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_ExA( + dnDevInst: DEVINST, + Buffer: PSTR, + BufferLen: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_ExW( + dnDevInst: DEVINST, + Buffer: PWSTR, + BufferLen: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_ListA( + pszFilter: PCSTR, + Buffer: PCHAR, + BufferLen: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_ListW( + pszFilter: PCWSTR, + Buffer: PWCHAR, + BufferLen: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_List_ExA( + pszFilter: PCSTR, + Buffer: PCHAR, + BufferLen: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_List_ExW( + pszFilter: PCWSTR, + Buffer: PWCHAR, + BufferLen: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_List_SizeA( + pulLen: PULONG, + pszFilter: PCSTR, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_List_SizeW( + pulLen: PULONG, + pszFilter: PCWSTR, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_List_Size_ExA( + pulLen: PULONG, + pszFilter: PCSTR, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_List_Size_ExW( + pulLen: PULONG, + pszFilter: PCWSTR, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_Size( + pulLen: PULONG, + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_ID_Size_Ex( + pulLen: PULONG, + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_PropertyW( + dnDevInst: DEVINST, + PropertyKey: *const DEVPROPKEY, + PropertyType: *mut DEVPROPTYPE, + PropertyBuffer: PBYTE, + PropertyBufferSize: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_PropertyExW( + dnDevInst: DEVINST, + PropertyKey: *const DEVPROPKEY, + PropertyType: *mut DEVPROPTYPE, + PropertyBuffer: PBYTE, + PropertyBufferSize: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_Registry_PropertyA( + dnDevInst: DEVINST, + ulProperty: ULONG, + pulRegDataType: PULONG, + Buffer: PVOID, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_Registry_PropertyW( + dnDevInst: DEVINST, + ulProperty: ULONG, + pulRegDataType: PULONG, + Buffer: PVOID, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_Registry_Property_ExA( + dnDevInst: DEVINST, + ulProperty: ULONG, + pulRegDataType: PULONG, + Buffer: PVOID, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_Registry_Property_ExW( + dnDevInst: DEVINST, + ulProperty: ULONG, + pulRegDataType: PULONG, + Buffer: PVOID, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_Custom_PropertyA( + dnDevInst: DEVINST, + pszCustomPropertyName: PCSTR, + pulRegDataType: PULONG, + Buffer: PVOID, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_Custom_PropertyW( + dnDevInst: DEVINST, + pszCustomPropertyName: PCWSTR, + pulRegDataType: PULONG, + Buffer: PVOID, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_Custom_Property_ExA( + dnDevInst: DEVINST, + pszCustomPropertyName: PCSTR, + pulRegDataType: PULONG, + Buffer: PVOID, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_Custom_Property_ExW( + dnDevInst: DEVINST, + pszCustomPropertyName: PCWSTR, + pulRegDataType: PULONG, + Buffer: PVOID, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_Status( + pulStatus: PULONG, + pulProblemNumber: PULONG, + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_DevNode_Status_Ex( + pulStatus: PULONG, + pulProblemNumber: PULONG, + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_First_Log_Conf( + plcLogConf: PLOG_CONF, + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_First_Log_Conf_Ex( + plcLogConf: PLOG_CONF, + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Global_State( + pulState: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Global_State_Ex( + pulState: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Hardware_Profile_InfoA( + ulIndex: ULONG, + pHWProfileInfo: PHWPROFILEINFO_A, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Hardware_Profile_Info_ExA( + ulIndex: ULONG, + pHWProfileInfo: PHWPROFILEINFO_A, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Hardware_Profile_InfoW( + ulIndex: ULONG, + pHWProfileInfo: PHWPROFILEINFO_W, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Hardware_Profile_Info_ExW( + ulIndex: ULONG, + pHWProfileInfo: PHWPROFILEINFO_W, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_HW_Prof_FlagsA( + pDeviceID: DEVINSTID_A, + ulHardwareProfile: ULONG, + pulValue: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_HW_Prof_FlagsW( + pDeviceID: DEVINSTID_W, + ulHardwareProfile: ULONG, + pulValue: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_HW_Prof_Flags_ExA( + pDeviceID: DEVINSTID_A, + ulHardwareProfile: ULONG, + pulValue: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_HW_Prof_Flags_ExW( + pDeviceID: DEVINSTID_W, + ulHardwareProfile: ULONG, + pulValue: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_AliasA( + pszDeviceInterface: LPCSTR, + AliasInterfaceGuid: LPGUID, + pszAliasDeviceInterface: LPSTR, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_AliasW( + pszDeviceInterface: LPCWSTR, + AliasInterfaceGuid: LPGUID, + pszAliasDeviceInterface: LPWSTR, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_Alias_ExA( + pszDeviceInterface: LPCSTR, + AliasInterfaceGuid: LPGUID, + pszAliasDeviceInterface: LPSTR, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_Alias_ExW( + pszDeviceInterface: LPCWSTR, + AliasInterfaceGuid: LPGUID, + pszAliasDeviceInterface: LPWSTR, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_ListA( + InterfaceClassGuid: LPGUID, + pDeviceID: DEVINSTID_A, + Buffer: PCHAR, + BufferLen: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_ListW( + InterfaceClassGuid: LPGUID, + pDeviceID: DEVINSTID_W, + Buffer: PWCHAR, + BufferLen: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_List_ExA( + InterfaceClassGuid: LPGUID, + pDeviceID: DEVINSTID_A, + Buffer: PCHAR, + BufferLen: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_List_ExW( + InterfaceClassGuid: LPGUID, + pDeviceID: DEVINSTID_W, + Buffer: PWCHAR, + BufferLen: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_List_SizeA( + pulLen: PULONG, + InterfaceClassGuid: LPGUID, + pDeviceID: DEVINSTID_A, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_List_SizeW( + pulLen: PULONG, + InterfaceClassGuid: LPGUID, + pDeviceID: DEVINSTID_W, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_List_Size_ExA( + pulLen: PULONG, + InterfaceClassGuid: LPGUID, + pDeviceID: DEVINSTID_A, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_List_Size_ExW( + pulLen: PULONG, + InterfaceClassGuid: LPGUID, + pDeviceID: DEVINSTID_W, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_PropertyW( + pszDeviceInterface: LPCWSTR, + PropertyKey: *const DEVPROPKEY, + PropertyType: *mut DEVPROPTYPE, + PropertyBuffer: PBYTE, + PropertyBufferSize: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Device_Interface_PropertyExW( + pszDeviceInterface: LPCWSTR, + PropertyKey: *const DEVPROPKEY, + PropertyType: *mut DEVPROPTYPE, + PropertyBuffer: PBYTE, + PropertyBufferSize: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Log_Conf_Priority( + lcLogConf: LOG_CONF, + pPriority: PRIORITY, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Log_Conf_Priority_Ex( + lcLogConf: LOG_CONF, + pPriority: PRIORITY, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Next_Log_Conf( + plcLogConf: PLOG_CONF, + lcLogConf: LOG_CONF, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Next_Log_Conf_Ex( + plcLogConf: PLOG_CONF, + lcLogConf: LOG_CONF, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Parent( + pdnDevInst: PDEVINST, + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Parent_Ex( + pdnDevInst: PDEVINST, + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Res_Des_Data( + rdResDes: RES_DES, + Buffer: PVOID, + BufferLen: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Res_Des_Data_Ex( + rdResDes: RES_DES, + Buffer: PVOID, + BufferLen: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Res_Des_Data_Size( + pulSize: PULONG, + rdResDes: RES_DES, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Res_Des_Data_Size_Ex( + pulSize: PULONG, + rdResDes: RES_DES, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Sibling( + pdnDevInst: PDEVINST, + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Sibling_Ex( + pdnDevInst: PDEVINST, + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Version() -> WORD; + pub fn CM_Get_Version_Ex( + hMachine: HMACHINE, + ) -> WORD; + pub fn CM_Is_Version_Available( + wVersion: WORD, + ) -> BOOL; + pub fn CM_Is_Version_Available_Ex( + wVersion: WORD, + hMachine: HMACHINE, + ) -> BOOL; + pub fn CM_Intersect_Range_List( + rlhOld1: RANGE_LIST, + rlhOld2: RANGE_LIST, + rlhNew: RANGE_LIST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Invert_Range_List( + rlhOld: RANGE_LIST, + rlhNew: RANGE_LIST, + ullMaxValue: DWORDLONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Locate_DevNodeA( + pdnDevInst: PDEVINST, + pDeviceID: DEVINSTID_A, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Locate_DevNodeW( + pdnDevInst: PDEVINST, + pDeviceID: DEVINSTID_W, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Locate_DevNode_ExA( + pdnDevInst: PDEVINST, + pDeviceID: DEVINSTID_A, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Locate_DevNode_ExW( + pdnDevInst: PDEVINST, + pDeviceID: DEVINSTID_W, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Merge_Range_List( + rlhOld1: RANGE_LIST, + rlhOld2: RANGE_LIST, + rlhNew: RANGE_LIST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Modify_Res_Des( + prdResDes: PRES_DES, + rdResDes: RES_DES, + ResourceID: RESOURCEID, + ResourceData: PCVOID, + ResourceLen: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Modify_Res_Des_Ex( + prdResDes: PRES_DES, + rdResDes: RES_DES, + ResourceID: RESOURCEID, + ResourceData: PCVOID, + ResourceLen: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Move_DevNode( + dnFromDevInst: DEVINST, + dnToDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Move_DevNode_Ex( + dnFromDevInst: DEVINST, + dnToDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Next_Range( + preElement: PRANGE_LIST, + pullStart: PDWORDLONG, + pullEnd: PDWORDLONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Next_Res_Des( + prdResDes: PRES_DES, + rdResDes: RES_DES, + ForResource: RESOURCEID, + pResourceID: PRESOURCEID, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Get_Next_Res_Des_Ex( + prdResDes: PRES_DES, + rdResDes: RES_DES, + ForResource: RESOURCEID, + pResourceID: PRESOURCEID, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Open_Class_KeyA( + ClassGuid: LPGUID, + pszClassName: LPCSTR, + samDesired: REGSAM, + Disposition: REGDISPOSITION, + phkClass: PHKEY, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Open_Class_KeyW( + ClassGuid: LPGUID, + pszClassName: LPCWSTR, + samDesired: REGSAM, + Disposition: REGDISPOSITION, + phkClass: PHKEY, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Open_Class_Key_ExA( + ClassGuid: LPGUID, + pszClassName: LPCSTR, + samDesired: REGSAM, + Disposition: REGDISPOSITION, + phkClass: PHKEY, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Open_Class_Key_ExW( + ClassGuid: LPGUID, + pszClassName: LPCWSTR, + samDesired: REGSAM, + Disposition: REGDISPOSITION, + phkClass: PHKEY, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Open_DevNode_Key( + dnDevNode: DEVINST, + samDesired: REGSAM, + ulHardwareProfile: ULONG, + Disposition: REGDISPOSITION, + phkDevice: PHKEY, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Open_DevNode_Key_Ex( + dnDevNode: DEVINST, + samDesired: REGSAM, + ulHardwareProfile: ULONG, + Disposition: REGDISPOSITION, + phkDevice: PHKEY, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Open_Device_Interface_KeyA( + pszDeviceInterface: LPCSTR, + samDesired: REGSAM, + Disposition: REGDISPOSITION, + phkDeviceInterface: PHKEY, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Open_Device_Interface_KeyW( + pszDeviceInterface: LPCWSTR, + samDesired: REGSAM, + Disposition: REGDISPOSITION, + phkDeviceInterface: PHKEY, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Open_Device_Interface_Key_ExA( + pszDeviceInterface: LPCSTR, + samDesired: REGSAM, + Disposition: REGDISPOSITION, + phkDeviceInterface: PHKEY, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Open_Device_Interface_Key_ExW( + pszDeviceInterface: LPCWSTR, + samDesired: REGSAM, + Disposition: REGDISPOSITION, + phkDeviceInterface: PHKEY, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Delete_Device_Interface_KeyA( + pszDeviceInterface: LPCSTR, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Delete_Device_Interface_KeyW( + pszDeviceInterface: LPCWSTR, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Delete_Device_Interface_Key_ExA( + pszDeviceInterface: LPCSTR, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Delete_Device_Interface_Key_ExW( + pszDeviceInterface: LPCWSTR, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Query_Arbitrator_Free_Data( + pData: PVOID, + DataLen: ULONG, + dnDevInst: DEVINST, + ResourceID: RESOURCEID, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Query_Arbitrator_Free_Data_Ex( + pData: PVOID, + DataLen: ULONG, + dnDevInst: DEVINST, + ResourceID: RESOURCEID, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Query_Arbitrator_Free_Size( + pulSize: PULONG, + dnDevInst: DEVINST, + ResourceID: RESOURCEID, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Query_Arbitrator_Free_Size_Ex( + pulSize: PULONG, + dnDevInst: DEVINST, + ResourceID: RESOURCEID, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Query_Remove_SubTree( + dnAncestor: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Query_Remove_SubTree_Ex( + dnAncestor: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Query_And_Remove_SubTreeA( + dnAncestor: DEVINST, + pVetoType: PPNP_VETO_TYPE, + pszVetoName: LPSTR, + ulNameLength: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Query_And_Remove_SubTree_ExA( + dnAncestor: DEVINST, + pVetoType: PPNP_VETO_TYPE, + pszVetoName: LPSTR, + ulNameLength: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Query_And_Remove_SubTreeW( + dnAncestor: DEVINST, + pVetoType: PPNP_VETO_TYPE, + pszVetoName: LPWSTR, + ulNameLength: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Query_And_Remove_SubTree_ExW( + dnAncestor: DEVINST, + pVetoType: PPNP_VETO_TYPE, + pszVetoName: LPWSTR, + ulNameLength: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Request_Device_EjectA( + dnDevInst: DEVINST, + pVetoType: PPNP_VETO_TYPE, + pszVetoName: LPSTR, + ulNameLength: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Request_Device_Eject_ExA( + dnDevInst: DEVINST, + pVetoType: PPNP_VETO_TYPE, + pszVetoName: LPSTR, + ulNameLength: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Request_Device_EjectW( + dnDevInst: DEVINST, + pVetoType: PPNP_VETO_TYPE, + pszVetoName: LPWSTR, + ulNameLength: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Request_Device_Eject_ExW( + dnDevInst: DEVINST, + pVetoType: PPNP_VETO_TYPE, + pszVetoName: LPWSTR, + ulNameLength: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Reenumerate_DevNode( + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Reenumerate_DevNode_Ex( + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Register_Device_InterfaceA( + dnDevInst: DEVINST, + InterfaceClassGuid: LPGUID, + pszReference: LPCSTR, + pszDeviceInterface: LPSTR, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Register_Device_InterfaceW( + dnDevInst: DEVINST, + InterfaceClassGuid: LPGUID, + pszReference: LPCWSTR, + pszDeviceInterface: LPWSTR, + pulLength: PULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Register_Device_Interface_ExA( + dnDevInst: DEVINST, + InterfaceClassGuid: LPGUID, + pszReference: LPCSTR, + pszDeviceInterface: LPSTR, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Register_Device_Interface_ExW( + dnDevInst: DEVINST, + InterfaceClassGuid: LPGUID, + pszReference: LPCWSTR, + pszDeviceInterface: LPWSTR, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Set_DevNode_Problem_Ex( + dnDevInst: DEVINST, + ulProblem: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Set_DevNode_Problem( + dnDevInst: DEVINST, + ulProblem: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Unregister_Device_InterfaceA( + pszDeviceInterface: LPCSTR, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Unregister_Device_InterfaceW( + pszDeviceInterface: LPCWSTR, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Unregister_Device_Interface_ExA( + pszDeviceInterface: LPCSTR, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Unregister_Device_Interface_ExW( + pszDeviceInterface: LPCWSTR, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Register_Device_Driver( + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Register_Device_Driver_Ex( + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Remove_SubTree( + dnAncestor: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Remove_SubTree_Ex( + dnAncestor: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Set_DevNode_Registry_PropertyA( + dnDevInst: DEVINST, + ulProperty: ULONG, + Buffer: PCVOID, + ulLength: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Set_DevNode_Registry_PropertyW( + dnDevInst: DEVINST, + ulProperty: ULONG, + Buffer: PCVOID, + ulLength: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Set_DevNode_Registry_Property_ExA( + dnDevInst: DEVINST, + ulProperty: ULONG, + Buffer: PCVOID, + ulLength: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Set_DevNode_Registry_Property_ExW( + dnDevInst: DEVINST, + ulProperty: ULONG, + Buffer: PCVOID, + ulLength: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Is_Dock_Station_Present( + pbPresent: PBOOL, + ) -> CONFIGRET; + pub fn CM_Is_Dock_Station_Present_Ex( + pbPresent: PBOOL, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Request_Eject_PC() -> CONFIGRET; + pub fn CM_Request_Eject_PC_Ex( + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Set_HW_Prof_FlagsA( + pDeviceID: DEVINSTID_A, + ulConfig: ULONG, + ulValue: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Set_HW_Prof_FlagsW( + pDeviceID: DEVINSTID_W, + ulConfig: ULONG, + ulValue: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Set_HW_Prof_Flags_ExA( + pDeviceID: DEVINSTID_A, + ulConfig: ULONG, + ulValue: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Set_HW_Prof_Flags_ExW( + pDeviceID: DEVINSTID_A, + ulConfig: ULONG, + ulValue: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Setup_DevNode( + dnDevInst: DEVINST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Setup_DevNode_Ex( + dnDevInst: DEVINST, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Test_Range_Available( + ullStartValue: DWORDLONG, + ullEndValue: DWORDLONG, + rlh: RANGE_LIST, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Uninstall_DevNode( + dnDevInst: DEVNODE, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Uninstall_DevNode_Ex( + dnDevInst: DEVNODE, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Run_Detection( + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Run_Detection_Ex( + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Set_HW_Prof( + ulHardwareProfile: ULONG, + ulFlags: ULONG, + ) -> CONFIGRET; + pub fn CM_Set_HW_Prof_Ex( + ulHardwareProfile: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Query_Resource_Conflict_List( + pclConflictList: PCONFLICT_LIST, + dnDevInst: DEVINST, + ResourceID: RESOURCEID, + ResourceData: PCVOID, + ResourceLen: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Free_Resource_Conflict_Handle( + clConflictList: CONFLICT_LIST, + ) -> CONFIGRET; + pub fn CM_Get_Resource_Conflict_Count( + clConflictList: CONFLICT_LIST, + pulCount: PULONG, + ) -> CONFIGRET; + pub fn CM_Get_Resource_Conflict_DetailsA( + clConflictList: CONFLICT_LIST, + ulIndex: ULONG, + pConflictDetails: PCONFLICT_DETAILS_A, + ) -> CONFIGRET; + pub fn CM_Get_Resource_Conflict_DetailsW( + clConflictList: CONFLICT_LIST, + ulIndex: ULONG, + pConflictDetails: PCONFLICT_DETAILS_W, + ) -> CONFIGRET; + pub fn CM_Get_Class_Registry_PropertyW( + ClassGuid: LPGUID, + ulProperty: ULONG, + pulRegDataType: PULONG, + Buffer: PVOID, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Set_Class_Registry_PropertyW( + ClassGuid: LPGUID, + ulProperty: ULONG, + Buffer: PCVOID, + ulLength: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Get_Class_Registry_PropertyA( + ClassGuid: LPGUID, + ulProperty: ULONG, + pulRegDataType: PULONG, + Buffer: PVOID, + pulLength: PULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CM_Set_Class_Registry_PropertyA( + ClassGuid: LPGUID, + ulProperty: ULONG, + Buffer: PCVOID, + ulLength: ULONG, + ulFlags: ULONG, + hMachine: HMACHINE, + ) -> CONFIGRET; + pub fn CMP_WaitNoPendingInstallEvents( + dwTimeout: DWORD, + ) -> DWORD; +} +pub const CR_SUCCESS: CONFIGRET = 0x00000000; +pub const CR_DEFAULT: CONFIGRET = 0x00000001; +pub const CR_OUT_OF_MEMORY: CONFIGRET = 0x00000002; +pub const CR_INVALID_POINTER: CONFIGRET = 0x00000003; +pub const CR_INVALID_FLAG: CONFIGRET = 0x00000004; +pub const CR_INVALID_DEVNODE: CONFIGRET = 0x00000005; +pub const CR_INVALID_DEVINST: CONFIGRET = CR_INVALID_DEVNODE; +pub const CR_INVALID_RES_DES: CONFIGRET = 0x00000006; +pub const CR_INVALID_LOG_CONF: CONFIGRET = 0x00000007; +pub const CR_INVALID_ARBITRATOR: CONFIGRET = 0x00000008; +pub const CR_INVALID_NODELIST: CONFIGRET = 0x00000009; +pub const CR_DEVNODE_HAS_REQS: CONFIGRET = 0x0000000A; +pub const CR_DEVINST_HAS_REQS: CONFIGRET = CR_DEVNODE_HAS_REQS; +pub const CR_INVALID_RESOURCEID: CONFIGRET = 0x0000000B; +pub const CR_DLVXD_NOT_FOUND: CONFIGRET = 0x0000000C; +pub const CR_NO_SUCH_DEVNODE: CONFIGRET = 0x0000000D; +pub const CR_NO_SUCH_DEVINST: CONFIGRET = CR_NO_SUCH_DEVNODE; +pub const CR_NO_MORE_LOG_CONF: CONFIGRET = 0x0000000E; +pub const CR_NO_MORE_RES_DES: CONFIGRET = 0x0000000F; +pub const CR_ALREADY_SUCH_DEVNODE: CONFIGRET = 0x00000010; +pub const CR_ALREADY_SUCH_DEVINST: CONFIGRET = CR_ALREADY_SUCH_DEVNODE; +pub const CR_INVALID_RANGE_LIST: CONFIGRET = 0x00000011; +pub const CR_INVALID_RANGE: CONFIGRET = 0x00000012; +pub const CR_FAILURE: CONFIGRET = 0x00000013; +pub const CR_NO_SUCH_LOGICAL_DEV: CONFIGRET = 0x00000014; +pub const CR_CREATE_BLOCKED: CONFIGRET = 0x00000015; +pub const CR_NOT_SYSTEM_VM: CONFIGRET = 0x00000016; +pub const CR_REMOVE_VETOED: CONFIGRET = 0x00000017; +pub const CR_APM_VETOED: CONFIGRET = 0x00000018; +pub const CR_INVALID_LOAD_TYPE: CONFIGRET = 0x00000019; +pub const CR_BUFFER_SMALL: CONFIGRET = 0x0000001A; +pub const CR_NO_ARBITRATOR: CONFIGRET = 0x0000001B; +pub const CR_NO_REGISTRY_HANDLE: CONFIGRET = 0x0000001C; +pub const CR_REGISTRY_ERROR: CONFIGRET = 0x0000001D; +pub const CR_INVALID_DEVICE_ID: CONFIGRET = 0x0000001E; +pub const CR_INVALID_DATA: CONFIGRET = 0x0000001F; +pub const CR_INVALID_API: CONFIGRET = 0x00000020; +pub const CR_DEVLOADER_NOT_READY: CONFIGRET = 0x00000021; +pub const CR_NEED_RESTART: CONFIGRET = 0x00000022; +pub const CR_NO_MORE_HW_PROFILES: CONFIGRET = 0x00000023; +pub const CR_DEVICE_NOT_THERE: CONFIGRET = 0x00000024; +pub const CR_NO_SUCH_VALUE: CONFIGRET = 0x00000025; +pub const CR_WRONG_TYPE: CONFIGRET = 0x00000026; +pub const CR_INVALID_PRIORITY: CONFIGRET = 0x00000027; +pub const CR_NOT_DISABLEABLE: CONFIGRET = 0x00000028; +pub const CR_FREE_RESOURCES: CONFIGRET = 0x00000029; +pub const CR_QUERY_VETOED: CONFIGRET = 0x0000002A; +pub const CR_CANT_SHARE_IRQ: CONFIGRET = 0x0000002B; +pub const CR_NO_DEPENDENT: CONFIGRET = 0x0000002C; +pub const CR_SAME_RESOURCES: CONFIGRET = 0x0000002D; +pub const CR_NO_SUCH_REGISTRY_KEY: CONFIGRET = 0x0000002E; +pub const CR_INVALID_MACHINENAME: CONFIGRET = 0x0000002F; +pub const CR_REMOTE_COMM_FAILURE: CONFIGRET = 0x00000030; +pub const CR_MACHINE_UNAVAILABLE: CONFIGRET = 0x00000031; +pub const CR_NO_CM_SERVICES: CONFIGRET = 0x00000032; +pub const CR_ACCESS_DENIED: CONFIGRET = 0x00000033; +pub const CR_CALL_NOT_IMPLEMENTED: CONFIGRET = 0x00000034; +pub const CR_INVALID_PROPERTY: CONFIGRET = 0x00000035; +pub const CR_DEVICE_INTERFACE_ACTIVE: CONFIGRET = 0x00000036; +pub const CR_NO_SUCH_DEVICE_INTERFACE: CONFIGRET = 0x00000037; +pub const CR_INVALID_REFERENCE_STRING: CONFIGRET = 0x00000038; +pub const CR_INVALID_CONFLICT_LIST: CONFIGRET = 0x00000039; +pub const CR_INVALID_INDEX: CONFIGRET = 0x0000003A; +pub const CR_INVALID_STRUCTURE_SIZE: CONFIGRET = 0x0000003B; +pub const NUM_CR_RESULTS: CONFIGRET = 0x0000003C; diff --git a/bash-5.1/vendor/winapi/src/um/cguid.rs b/bash-5.1/vendor/winapi/src/um/cguid.rs new file mode 100644 index 0000000000000000000000000000000000000000..be7f929582d0b39eaa49e37e319eca79e536cf90 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/cguid.rs @@ -0,0 +1,134 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +// Some of these definitions are commented out because I could not find their value +DEFINE_GUID!{GUID_NULL, + 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} +DEFINE_GUID!{CATID_MARSHALER, + 0x00000003, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IRpcChannel, + 0x00000004, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IRpcStub, + 0x00000005, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IStubManager, + 0x00000006, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IRpcProxy, + 0x00000007, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IProxyManager, + 0x00000008, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IPSFactory, + 0x00000009, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IInternalMoniker, + 0x00000011, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IDfReserved1, + 0x00000013, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IDfReserved2, + 0x00000014, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IDfReserved3, + 0x00000015, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_StdMarshal, + 0x00000017, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +// extern const CLSID CLSID_AggStdMarshal; +DEFINE_GUID!{CLSID_StdAsyncActManager, + 0x00000329, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IStub, + 0x00000026, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IProxy, + 0x00000027, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IEnumGeneric, + 0x00000106, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IEnumHolder, + 0x00000107, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IEnumCallback, + 0x00000108, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IOleManager, + 0x0000011f, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IOlePresObj, + 0x00000120, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IDebug, + 0x00000123, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{IID_IDebugStream, + 0x00000124, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_PSGenObject, + 0x0000030c, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_PSClientSite, + 0x0000030d, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_PSClassObject, + 0x0000030e, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_PSInPlaceActive, + 0x0000030f, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_PSInPlaceFrame, + 0x00000310, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_PSDragDrop, + 0x00000311, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_PSBindCtx, + 0x00000312, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_PSEnumerators, + 0x00000313, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_StaticMetafile, + 0x00000315, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_StaticDib, + 0x00000316, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +// extern const CLSID CID_CDfsVolume; +DEFINE_GUID!{CLSID_DCOMAccessControl, + 0x0000031d, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_GlobalOptions, + 0x0000034b, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_StdGlobalInterfaceTable, + 0x00000323, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_ComBinding, + 0x00000328, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_StdEvent, + 0x0000032b, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_ManualResetEvent, + 0x0000032c, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_SynchronizeContainer, + 0x0000032d, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_AddrControl, + 0x00000348, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_ContextSwitcher, + 0x0000034e, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +// extern const CLSID CLSID_CCDFormKrnl; +// extern const CLSID CLSID_CCDPropertyPage; +// extern const CLSID CLSID_CCDFormDialog; +// extern const CLSID CLSID_CCDCommandButton; +// extern const CLSID CLSID_CCDComboBox; +// extern const CLSID CLSID_CCDTextBox; +// extern const CLSID CLSID_CCDCheckBox; +// extern const CLSID CLSID_CCDLabel; +// extern const CLSID CLSID_CCDOptionButton; +// extern const CLSID CLSID_CCDListBox; +// extern const CLSID CLSID_CCDScrollBar; +// extern const CLSID CLSID_CCDGroupBox; +// extern const CLSID CLSID_CCDGeneralPropertyPage; +// extern const CLSID CLSID_CCDGenericPropertyPage; +// extern const CLSID CLSID_CCDFontPropertyPage; +// extern const CLSID CLSID_CCDColorPropertyPage; +// extern const CLSID CLSID_CCDLabelPropertyPage; +// extern const CLSID CLSID_CCDCheckBoxPropertyPage; +// extern const CLSID CLSID_CCDTextBoxPropertyPage; +// extern const CLSID CLSID_CCDOptionButtonPropertyPage; +// extern const CLSID CLSID_CCDListBoxPropertyPage; +// extern const CLSID CLSID_CCDCommandButtonPropertyPage; +// extern const CLSID CLSID_CCDComboBoxPropertyPage; +// extern const CLSID CLSID_CCDScrollBarPropertyPage; +// extern const CLSID CLSID_CCDGroupBoxPropertyPage; +// extern const CLSID CLSID_CCDXObjectPropertyPage; +// extern const CLSID CLSID_CStdPropertyFrame; +// extern const CLSID CLSID_CFormPropertyPage; +// extern const CLSID CLSID_CGridPropertyPage; +// extern const CLSID CLSID_CWSJArticlePage; +// extern const CLSID CLSID_CSystemPage; +// extern const CLSID CLSID_IdentityUnmarshal; +DEFINE_GUID!{CLSID_InProcFreeMarshaler, + 0x0000033a, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_Picture_Metafile, + 0x00000315, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_Picture_EnhMetafile, + 0x00000319, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{CLSID_Picture_Dib, + 0x00000316, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} +DEFINE_GUID!{GUID_TRISTATE, + 0x6650430a, 0xbe0f, 0x101a, 0x8b, 0xbb, 0x00, 0xaa, 0x00, 0x30, 0x0c, 0xab} diff --git a/bash-5.1/vendor/winapi/src/um/combaseapi.rs b/bash-5.1/vendor/winapi/src/um/combaseapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..823c026ac95b1778a807938230ededf6254dc7cc --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/combaseapi.rs @@ -0,0 +1,477 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Base Component Object Model defintions. +use ctypes::{c_int, c_void}; +use shared::basetsd::{SIZE_T, UINT64, ULONG_PTR}; +use shared::guiddef::{CLSID, GUID, LPCLSID, LPIID, REFCLSID, REFGUID, REFIID}; +use shared::minwindef::{BOOL, DWORD, FILETIME, HGLOBAL, LPDWORD, LPHANDLE, LPVOID, ULONG}; +use shared::rpcdce::{RPC_AUTHZ_HANDLE, RPC_AUTH_IDENTITY_HANDLE}; +use shared::wtypesbase::{ + CLSCTX, CLSCTX_INPROC_HANDLER, CLSCTX_INPROC_SERVER, CLSCTX_LOCAL_SERVER, CLSCTX_REMOTE_SERVER, + LPCOLESTR, LPOLESTR, OLECHAR, +}; +use um::objidl::SOLE_AUTHENTICATION_SERVICE; +use um::objidlbase::{ + APTTYPE, APTTYPEQUALIFIER, COSERVERINFO, IActivationFilter, IAgileReference, LPMALLOC, + LPMARSHAL, LPSTREAM, LPSURROGATE, MULTI_QI, +}; +use um::propidl::PROPVARIANT; +use um::unknwnbase::{IUnknown, LPUNKNOWN}; +use um::winnt::{HANDLE, HRESULT, LARGE_INTEGER, LONG, PSECURITY_DESCRIPTOR, PVOID, ULARGE_INTEGER}; +#[inline] +pub fn LISet32(li: &mut LARGE_INTEGER, v: DWORD) { + unsafe { + li.u_mut().HighPart = if (v as LONG) < 0 { + -1 + } else { + 0 + }; + li.u_mut().LowPart = v; + } +} +#[inline] +pub fn ULISet32(li: &mut ULARGE_INTEGER, v: DWORD) { + unsafe { + li.u_mut().HighPart = 0; + li.u_mut().LowPart = v; + } +} +pub const CLSCTX_INPROC: CLSCTX = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER; +pub const CLSCTX_ALL: CLSCTX = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER + | CLSCTX_REMOTE_SERVER; +pub const CLSCTX_SERVER: CLSCTX = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER + | CLSCTX_REMOTE_SERVER; +ENUM!{enum REGCLS { + REGCLS_SINGLEUSE = 0, + REGCLS_MULTIPLEUSE = 1, + REGCLS_MULTI_SEPARATE = 2, + REGCLS_SUSPENDED = 4, + REGCLS_SURROGATE = 8, + REGCLS_AGILE = 0x10, +}} +ENUM!{enum COINITBASE { + COINITBASE_MULTITHREADED = 0x0, +}} +extern "system" { + pub fn CoGetMalloc( + dwMemContext: DWORD, + ppMalloc: *mut LPMALLOC, + ) -> HRESULT; + pub fn CreateStreamOnHGlobal( + hGlobal: HGLOBAL, + fDeleteOnRelease: BOOL, + ppstm: *mut LPSTREAM, + ) -> HRESULT; + pub fn GetHGlobalFromStream( + pstm: LPSTREAM, + phglobal: *mut HGLOBAL, + ) -> HRESULT; + pub fn CoUninitialize() -> (); + pub fn CoGetCurrentProcess() -> DWORD; + pub fn CoInitializeEx( + pvReserved: LPVOID, + dwCoInit: DWORD, + ) -> HRESULT; + pub fn CoGetCallerTID( + lpdwTID: LPDWORD, + ) -> HRESULT; + pub fn CoGetCurrentLogicalThreadId( + pguid: *mut GUID, + ) -> HRESULT; + pub fn CoGetContextToken( + pToken: *mut ULONG_PTR, + ) -> HRESULT; + pub fn CoGetDefaultContext( + aptType: APTTYPE, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT; + pub fn CoGetApartmentType( + pAptType: *mut APTTYPE, + pAptQualifier: *mut APTTYPEQUALIFIER, + ) -> HRESULT; +} +STRUCT!{struct ServerInformation { + dwServerPid: DWORD, + dwServerTid: DWORD, + ui64ServerAddress: UINT64, +}} +pub type PServerInformation = *mut ServerInformation; +extern "system" { + pub fn CoDecodeProxy( + dwClientPid: DWORD, + ui64ProxyAddress: UINT64, + pServerInformation: PServerInformation, + ) -> HRESULT; +} +DECLARE_HANDLE!{CO_MTA_USAGE_COOKIE, CO_MTA_USAGE_COOKIE__} +extern "system" { + pub fn CoIncrementMTAUsage( + pCookie: *mut CO_MTA_USAGE_COOKIE, + ) -> HRESULT; + pub fn CoDecrementMTAUsage( + Cookie: CO_MTA_USAGE_COOKIE, + ) -> HRESULT; + pub fn CoAllowUnmarshalerCLSID( + clsid: REFCLSID, + ) -> HRESULT; + pub fn CoGetObjectContext( + riid: REFIID, + ppv: *mut LPVOID, + ) -> HRESULT; + pub fn CoGetClassObject( + rclsid: REFCLSID, + dwClsContext: DWORD, + pvReserved: LPVOID, + riid: REFIID, + ppv: *mut LPVOID, + ) -> HRESULT; + pub fn CoRegisterClassObject( + rclsid: REFCLSID, + pUnk: LPUNKNOWN, + dwClsContext: DWORD, + flags: DWORD, + lpdwRegister: LPDWORD, + ) -> HRESULT; + pub fn CoRevokeClassObject( + dwRegister: DWORD, + ) -> HRESULT; + pub fn CoResumeClassObjects() -> HRESULT; + pub fn CoSuspendClassObjects() -> HRESULT; + pub fn CoAddRefServerProcess() -> ULONG; + pub fn CoReleaseServerProcess() -> ULONG; + pub fn CoGetPSClsid( + riid: REFIID, + pClsid: *mut CLSID, + ) -> HRESULT; + pub fn CoRegisterPSClsid( + riid: REFIID, + rclsid: REFCLSID, + ) -> HRESULT; + pub fn CoRegisterSurrogate( + pSurrogate: LPSURROGATE, + ) -> HRESULT; + pub fn CoGetMarshalSizeMax( + pulSize: *mut ULONG, + riid: REFIID, + pUnk: LPUNKNOWN, + dwDestContext: DWORD, + pvDestContext: LPVOID, + mshlflags: DWORD, + ) -> HRESULT; + pub fn CoMarshalInterface( + pStm: LPSTREAM, + riid: REFIID, + pUnk: LPUNKNOWN, + dwDestContext: DWORD, + pvDestContext: LPVOID, + mshlflags: DWORD, + ) -> HRESULT; + pub fn CoUnmarshalInterface( + pStm: LPSTREAM, + riid: REFIID, + ppv: *mut LPVOID, + ) -> HRESULT; + pub fn CoMarshalHresult( + pstm: LPSTREAM, + hresult: HRESULT, + ) -> HRESULT; + pub fn CoUnmarshalHresult( + pstm: LPSTREAM, + phresult: *mut HRESULT, + ) -> HRESULT; + pub fn CoReleaseMarshalData( + pstm: LPSTREAM, + ) -> HRESULT; + pub fn CoDisconnectObject( + pUnk: LPUNKNOWN, + dwReserved: DWORD, + ) -> HRESULT; + pub fn CoLockObjectExternal( + pUnk: LPUNKNOWN, + fLock: BOOL, + fLastUnlockReleases: BOOL, + ) -> HRESULT; + pub fn CoGetStandardMarshal( + riid: REFIID, + pUnk: LPUNKNOWN, + dwDestContext: DWORD, + pvDestContext: LPVOID, + mshlflags: DWORD, + ppMarshal: *mut LPMARSHAL, + ) -> HRESULT; + pub fn CoGetStdMarshalEx( + pUnkOuter: LPUNKNOWN, + smexflags: DWORD, + ppUnkInner: *mut LPUNKNOWN, + ) -> HRESULT; +} +ENUM!{enum STDMSHLFLAGS { + SMEXF_SERVER = 0x01, + SMEXF_HANDLER = 0x02, +}} +extern "system" { + pub fn CoIsHandlerConnected( + pUnk: LPUNKNOWN, + ) -> BOOL; + pub fn CoMarshalInterThreadInterfaceInStream( + riid: REFIID, + pUnk: LPUNKNOWN, + ppStm: *mut LPSTREAM, + ) -> HRESULT; + pub fn CoGetInterfaceAndReleaseStream( + pStm: LPSTREAM, + iid: REFIID, + ppv: *mut LPVOID, + ) -> HRESULT; + pub fn CoCreateFreeThreadedMarshaler( + punkOuter: LPUNKNOWN, + ppunkMarshal: *mut LPUNKNOWN, + ) -> HRESULT; + pub fn CoFreeUnusedLibraries(); + pub fn CoFreeUnusedLibrariesEx( + dwUnloadDelay: DWORD, + dwReserved: DWORD, + ); + pub fn CoDisconnectContext( + dwTimeout: DWORD, + )-> HRESULT; + pub fn CoInitializeSecurity( + pSecDesc: PSECURITY_DESCRIPTOR, + cAuthSvc: LONG, + asAuthSvc: *mut SOLE_AUTHENTICATION_SERVICE, + pReserved1: *mut c_void, + dwAuthnLevel: DWORD, + dwImpLevel: DWORD, + pAuthList: *mut c_void, + dwCapabilities: DWORD, + pReserved3: *mut c_void, + ) -> HRESULT; + pub fn CoGetCallContext( + riid: REFIID, + ppInterface: *mut *mut c_void, + ) -> HRESULT; + pub fn CoQueryProxyBlanket( + pProxy: *mut IUnknown, + pwAuthnSvc: *mut DWORD, + pAuthzSvc: *mut DWORD, + pServerPrincName: *mut LPOLESTR, + pAuthnLevel: *mut DWORD, + pImpLevel: *mut DWORD, + pAuthInfo: *mut RPC_AUTH_IDENTITY_HANDLE, + pCapabilites: *mut DWORD, + ) -> HRESULT; + pub fn CoSetProxyBlanket( + pProxy: *mut IUnknown, + dwAuthnSvc: DWORD, + dwAuthzSvc: DWORD, + pServerPrincName: *mut OLECHAR, + dwAuthnLevel: DWORD, + dwImpLevel: DWORD, + pAuthInfo: RPC_AUTH_IDENTITY_HANDLE, + dwCapabilities: DWORD, + ) -> HRESULT; + pub fn CoCopyProxy( + pProxy: *mut IUnknown, + ppCopy: *mut *mut IUnknown, + ) -> HRESULT; + pub fn CoQueryClientBlanket( + pAuthnSvc: *mut DWORD, + pAuthzSvc: *mut DWORD, + pServerPrincName: *mut LPOLESTR, + pAuthnLevel: *mut DWORD, + pImpLevel: *mut DWORD, + pPrivs: *mut RPC_AUTHZ_HANDLE, + pCapabilities: *mut DWORD, + ) -> HRESULT; + pub fn CoImpersonateClient() -> HRESULT; + pub fn CoRevertToSelf() -> HRESULT; + pub fn CoQueryAuthenticationServices( + pcAuthSvc: *mut DWORD, + asAuthSvc: *mut *mut SOLE_AUTHENTICATION_SERVICE, + ) -> HRESULT; + pub fn CoSwitchCallContext( + pNewObject: *mut IUnknown, + ppOldObject: *mut *mut IUnknown, + ) -> HRESULT; +} +pub const COM_RIGHTS_EXECUTE: DWORD = 1; +pub const COM_RIGHTS_EXECUTE_LOCAL: DWORD = 2; +pub const COM_RIGHTS_EXECUTE_REMOTE: DWORD = 4; +pub const COM_RIGHTS_ACTIVATE_LOCAL: DWORD = 8; +pub const COM_RIGHTS_ACTIVATE_REMOTE: DWORD = 16; +extern "system" { + pub fn CoCreateInstance( + rclsid: REFCLSID, + pUnkOuter: LPUNKNOWN, + dwClsContext: DWORD, + riid: REFIID, + ppv: *mut LPVOID, + ) -> HRESULT; + pub fn CoCreateInstanceEx( + Clsid: REFCLSID, + punkOuter: *mut IUnknown, + dwClsCtx: DWORD, + pServerInfo: *mut COSERVERINFO, + dwCount: DWORD, + pResults: *mut MULTI_QI, + ) -> HRESULT; + pub fn CoRegisterActivationFilter( + pActivationFilter: *mut IActivationFilter, + ) -> HRESULT; + pub fn CoCreateInstanceFromApp( + Clsid: REFCLSID, + punkOuter: *mut IUnknown, + dwClsCtx: DWORD, + reserved: PVOID, + dwCount: DWORD, + pResults: *mut MULTI_QI, + ) -> HRESULT; + pub fn CoGetCancelObject( + dwThreadId: DWORD, + iid: REFIID, + ppUnk: *mut *mut c_void, + ) -> HRESULT; + pub fn CoSetCancelObject( + pUnk: *mut *mut IUnknown, + ) -> HRESULT; + pub fn CoCancelCall( + dwThreadId: DWORD, + ulTimeout: ULONG, + ) -> HRESULT; + pub fn CoTestCancel() -> HRESULT; + pub fn CoEnableCallCancellation( + pReserved: LPVOID, + ) -> HRESULT; + pub fn CoDisableCallCancellation( + pReserved: LPVOID, + ) -> HRESULT; + pub fn StringFromCLSID( + rclsid: REFCLSID, + lplpsz: *mut LPOLESTR, + ) -> HRESULT; + pub fn CLSIDFromString( + lpsz: LPCOLESTR, + pclsid: LPCLSID, + ) -> HRESULT; + pub fn StringFromIID( + rclsid: REFIID, + lplpsz: *mut LPOLESTR, + ) -> HRESULT; + pub fn IIDFromString( + lpsz: LPCOLESTR, + lpiid: LPIID, + ) -> HRESULT; + pub fn ProgIDFromCLSID( + clsid: REFCLSID, + lplpszProgID: *mut LPOLESTR, + ) -> HRESULT; + pub fn CLSIDFromProgID( + lpszProgID: LPCOLESTR, + lpclsid: LPCLSID, + ) -> HRESULT; + pub fn StringFromGUID2( + rguid: REFGUID, + lpsz: LPOLESTR, + cchMax: c_int, + ) -> c_int; + pub fn CoCreateGuid( + pguid: *mut GUID, + ) -> HRESULT; + pub fn PropVariantCopy( + pvarDest: *mut PROPVARIANT, + pvarSrc: *const PROPVARIANT, + ) -> HRESULT; + pub fn PropVariantClear( + pvar: *mut PROPVARIANT, + ) -> HRESULT; + pub fn FreePropVariantArray( + cVariants: ULONG, + rgvars: *mut PROPVARIANT, + ) -> HRESULT; + pub fn CoWaitForMultipleHandles( + dwFlags: DWORD, + dwTimeout: DWORD, + cHandles: ULONG, + pHandles: LPHANDLE, + lpdwindex: LPDWORD, + ) -> HRESULT; +} +ENUM!{enum COWAIT_FLAGS { + COWAIT_DEFAULT = 0, + COWAIT_WAITALL = 1, + COWAIT_ALERTABLE = 2, + COWAIT_INPUTAVAILABLE = 4, + COWAIT_DISPATCH_CALLS = 8, + COWAIT_DISPATCH_WINDOW_MESSAGES = 0x10, +}} +ENUM!{enum CWMO_FLAGS { + CWMO_DEFAULT = 0, + CWMO_DISPATCH_CALLS = 1, + CWMO_DISPATCH_WINDOW_MESSAGES = 2, +}} +extern "system" { + pub fn CoWaitForMultipleObjects( + dwFlags: DWORD, + dwTimeout: DWORD, + cHandles: ULONG, + pHandles: *const HANDLE, + lpdwindex: LPDWORD, + ) -> HRESULT; +} +pub const CWMO_MAX_HANDLES: ULONG = 56; +extern "system" { + pub fn CoGetTreatAsClass( + clsidOld: REFCLSID, + pClsidNew: LPCLSID, + ) -> HRESULT; + pub fn CoInvalidateRemoteMachineBindings( + pszMachineName: LPOLESTR, + ) -> HRESULT; +} +ENUM!{enum AgileReferenceOptions { + AGILEREFERENCE_DEFAULT = 0, + AGILEREFERENCE_DELAYEDMARSHAL = 1, +}} +extern "system" { + pub fn RoGetAgileReference( + options: AgileReferenceOptions, + riid: REFIID, + pUnk: *mut IUnknown, + ppAgileReference: *mut *mut IAgileReference, + ) -> HRESULT; +} +FN!{stdcall LPFNGETCLASSOBJECT( + REFCLSID, + REFIID, + *mut LPVOID, +) -> HRESULT} +FN!{stdcall LPFNCANUNLOADNOW() -> HRESULT} +extern "system" { + pub fn DllGetClassObject( + rclsid: REFCLSID, + riid: REFIID, + ppv: *mut LPVOID, + ) -> HRESULT; + pub fn DllCanUnloadNow() -> HRESULT; + pub fn CoTaskMemAlloc( + cb: SIZE_T, + ) -> LPVOID; + pub fn CoTaskMemRealloc( + pv: LPVOID, + cb: SIZE_T, + ) -> LPVOID; + pub fn CoTaskMemFree( + pv: LPVOID, + ); + pub fn CoFileTimeNow( + lpFileTime: *mut FILETIME, + ) -> HRESULT; + pub fn CLSIDFromProgIDEx( + lpszProgID: LPCOLESTR, + lpclsid: LPCLSID, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/coml2api.rs b/bash-5.1/vendor/winapi/src/um/coml2api.rs new file mode 100644 index 0000000000000000000000000000000000000000..449be87e3b4be67e233f9a43f0450bdca05c02e8 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/coml2api.rs @@ -0,0 +1,10 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! Structured storage, property sets, and related APIs. +use shared::minwindef::DWORD; +pub const STGM_READ: DWORD = 0x00000000; +pub const STGM_WRITE: DWORD = 0x00000001; +pub const STGM_READWRITE: DWORD = 0x00000002; diff --git a/bash-5.1/vendor/winapi/src/um/commapi.rs b/bash-5.1/vendor/winapi/src/um/commapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..433bb78fa82a224b6738b602cff2389de25b7333 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/commapi.rs @@ -0,0 +1,87 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_char; +use shared::minwindef::{BOOL, DWORD, LPDWORD}; +use um::minwinbase::LPOVERLAPPED; +use um::winbase::{LPCOMMCONFIG, LPCOMMPROP, LPCOMMTIMEOUTS, LPCOMSTAT, LPDCB}; +use um::winnt::HANDLE; +extern "system" { + pub fn ClearCommBreak( + hFile: HANDLE, + ) -> BOOL; + pub fn ClearCommError( + hFile: HANDLE, + lpErrors: LPDWORD, + lpStat: LPCOMSTAT, + ) -> BOOL; + pub fn SetupComm( + hFile: HANDLE, + dwInQueue: DWORD, + dwOutQueue: DWORD, + ) -> BOOL; + pub fn EscapeCommFunction( + hFile: HANDLE, + dwFunc: DWORD, + ) -> BOOL; + pub fn GetCommConfig( + hCommDev: HANDLE, + lpCC: LPCOMMCONFIG, + lpdwSize: LPDWORD, + ) -> BOOL; + pub fn GetCommMask( + hFile: HANDLE, + lpEvtMask: LPDWORD, + ) -> BOOL; + pub fn GetCommModemStatus( + hFile: HANDLE, + lpModemStat: LPDWORD, + ) -> BOOL; + pub fn GetCommProperties( + hFile: HANDLE, + lpCommProp: LPCOMMPROP, + ) -> BOOL; + pub fn GetCommState( + hFile: HANDLE, + lpDCB: LPDCB, + ) -> BOOL; + pub fn GetCommTimeouts( + hFile: HANDLE, + lpCommTimeouts: LPCOMMTIMEOUTS, + ) -> BOOL; + pub fn PurgeComm( + hFile: HANDLE, + dwFlags: DWORD, + ) -> BOOL; + pub fn SetCommBreak( + hFile: HANDLE, + ) -> BOOL; + pub fn SetCommConfig( + hCommDev: HANDLE, + lpCC: LPCOMMCONFIG, + dwSize: DWORD, + ) -> BOOL; + pub fn SetCommMask( + hFile: HANDLE, + dwEvtMask: DWORD, + ) -> BOOL; + pub fn SetCommState( + hFile: HANDLE, + lpDCB: LPDCB, + ) -> BOOL; + pub fn SetCommTimeouts( + hFile: HANDLE, + lpCommTimeouts: LPCOMMTIMEOUTS, + ) -> BOOL; + pub fn TransmitCommChar( + hFile: HANDLE, + cChar: c_char, + ) -> BOOL; + pub fn WaitCommEvent( + hFile: HANDLE, + lpEvtMask: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/commctrl.rs b/bash-5.1/vendor/winapi/src/um/commctrl.rs new file mode 100644 index 0000000000000000000000000000000000000000..0d4d649202716ce987b0bf29dc5ea0228dd7d6ad --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/commctrl.rs @@ -0,0 +1,4135 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_char, c_int, c_long, c_short, c_void}; +use shared::basetsd::{DWORD_PTR, INT_PTR, LONG_PTR, UINT_PTR}; +#[cfg(target_pointer_width = "64")] use shared::basetsd::PINT_PTR; +use shared::guiddef::{IID, REFIID}; +use shared::minwindef::{ + BOOL, BYTE, DWORD, HINSTANCE, HKEY, INT, LPARAM, LPINT, LRESULT, PUINT, UINT, ULONG, WORD, + WPARAM, +}; +use shared::windef::{ + COLORREF, HBITMAP, HBRUSH, HDC, HICON, HMENU, HPEN, HWND, LPCRECT, LPRECT, POINT, RECT, SIZE, +}; +use um::commoncontrols::IImageList; +use um::minwinbase::SYSTEMTIME; +use um::winnt::{CHAR, LANGID, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PCWSTR, PVOID, PWSTR, WCHAR}; +use um::winuser::{ + CB_DELETESTRING, IMAGE_BITMAP, LPSCROLLINFO, LPTRACKMOUSEEVENT, NMHDR, + WINDOWPOS, WM_USER, +}; +use vc::vcruntime::size_t; +pub type HRESULT = c_long; +extern "system" { + pub fn InitCommonControls(); +} +//138 +STRUCT!{struct INITCOMMONCONTROLSEX { + dwSize: DWORD, + dwICC: DWORD, +}} +pub type LPINITCOMMONCONTROLSEX = *mut INITCOMMONCONTROLSEX; +pub const ICC_LISTVIEW_CLASSES: DWORD = 0x1; +pub const ICC_TREEVIEW_CLASSES: DWORD = 0x2; +pub const ICC_BAR_CLASSES: DWORD = 0x4; +pub const ICC_TAB_CLASSES: DWORD = 0x8; +pub const ICC_UPDOWN_CLASS: DWORD = 0x10; +pub const ICC_PROGRESS_CLASS: DWORD = 0x20; +pub const ICC_HOTKEY_CLASS: DWORD = 0x40; +pub const ICC_ANIMATE_CLASS: DWORD = 0x80; +pub const ICC_WIN95_CLASSES: DWORD = 0xFF; +pub const ICC_DATE_CLASSES: DWORD = 0x100; +pub const ICC_USEREX_CLASSES: DWORD = 0x200; +pub const ICC_COOL_CLASSES: DWORD = 0x400; +pub const ICC_INTERNET_CLASSES: DWORD = 0x800; +pub const ICC_PAGESCROLLER_CLASS: DWORD = 0x1000; +pub const ICC_NATIVEFNTCTL_CLASS: DWORD = 0x2000; +pub const ICC_STANDARD_CLASSES: DWORD = 0x4000; +pub const ICC_LINK_CLASS: DWORD = 0x8000; +extern "system" { + pub fn InitCommonControlsEx( + lpInitCtrls: *const INITCOMMONCONTROLSEX, + ) -> BOOL; +} +pub const ODT_HEADER: UINT = 100; +pub const ODT_TAB: UINT = 101; +pub const ODT_LISTVIEW: UINT = 102; +pub const LVM_FIRST: UINT = 0x1000; +pub const TV_FIRST: UINT = 0x1100; +pub const HDM_FIRST: UINT = 0x1200; +pub const TCM_FIRST: UINT = 0x1300; +pub const PGM_FIRST: UINT = 0x1400; +pub const ECM_FIRST: UINT = 0x1500; +pub const BCM_FIRST: UINT = 0x1600; +pub const CBM_FIRST: UINT = 0x1700; +pub const CCM_FIRST: UINT = 0x2000; +pub const CCM_LAST: UINT = CCM_FIRST + 0x200; +pub const CCM_SETBKCOLOR: UINT = CCM_FIRST + 1; +STRUCT!{struct COLORSCHEME { + dwSize: DWORD, + clrBtnHighlight: COLORREF, + clrBtnShadow: COLORREF, +}} +pub type LPCOLORSCHEME = *mut COLORSCHEME; +pub const CCM_SETCOLORSCHEME: UINT = CCM_FIRST + 2; +pub const CCM_GETCOLORSCHEME: UINT = CCM_FIRST + 3; +pub const CCM_GETDROPTARGET: UINT = CCM_FIRST + 4; +pub const CCM_SETUNICODEFORMAT: UINT = CCM_FIRST + 5; +pub const CCM_GETUNICODEFORMAT: UINT = CCM_FIRST + 6; +pub const CCM_SETVERSION: UINT = CCM_FIRST + 7; +pub const CCM_GETVERSION: UINT = CCM_FIRST + 8; +pub const CCM_SETNOTIFYWINDOW: UINT = CCM_FIRST + 9; +pub const CCM_SETWINDOWTHEME: UINT = CCM_FIRST + 0xb; +pub const CCM_DPISCALE: UINT = CCM_FIRST + 0xc; +pub const INFOTIPSIZE: c_int = 1024; +pub const NM_OUTOFMEMORY: UINT = (NM_FIRST as i32 - 1) as u32; +pub const NM_CLICK: UINT = (NM_FIRST as i32 - 2) as u32; +pub const NM_DBLCLK: UINT = (NM_FIRST as i32 - 3) as u32; +pub const NM_RETURN: UINT = (NM_FIRST as i32 - 4) as u32; +pub const NM_RCLICK: UINT = (NM_FIRST as i32 - 5) as u32; +pub const NM_RDBLCLK: UINT = (NM_FIRST as i32 - 6) as u32; +pub const NM_SETFOCUS: UINT = (NM_FIRST as i32 - 7) as u32; +pub const NM_KILLFOCUS: UINT = (NM_FIRST as i32 - 8) as u32; +pub const NM_CUSTOMDRAW: UINT = (NM_FIRST as i32 - 12) as u32; +pub const NM_HOVER: UINT = (NM_FIRST as i32 - 13) as u32; +pub const NM_NCHITTEST: UINT = (NM_FIRST as i32 - 14) as u32; +pub const NM_KEYDOWN: UINT = (NM_FIRST as i32 - 15) as u32; +pub const NM_RELEASEDCAPTURE: UINT = (NM_FIRST as i32 - 16) as u32; +pub const NM_SETCURSOR: UINT = (NM_FIRST as i32 - 17) as u32; +pub const NM_CHAR: UINT = (NM_FIRST as i32 - 18) as u32; +pub const NM_TOOLTIPSCREATED: UINT = (NM_FIRST as i32 - 19) as u32; +pub const NM_LDOWN: UINT = (NM_FIRST as i32 - 20) as u32; +pub const NM_RDOWN: UINT = (NM_FIRST as i32 - 21) as u32; +pub const NM_THEMECHANGED: UINT = (NM_FIRST as i32 - 22) as u32; +pub const NM_FONTCHANGED: UINT = (NM_FIRST as i32 - 23) as u32; +pub const NM_CUSTOMTEXT: UINT = (NM_FIRST as i32 - 24) as u32; +pub const NM_TVSTATEIMAGECHANGING: UINT = (NM_FIRST as i32 - 24) as u32; +STRUCT!{struct NMTOOLTIPSCREATED { + hdr: NMHDR, + hwndToolTips: HWND, +}} +pub type LPNMTOOLTIPSCREATED = *mut NMTOOLTIPSCREATED; +STRUCT!{struct NMMOUSE { + hdr: NMHDR, + dwItemSpec: DWORD_PTR, + dwItemData: DWORD_PTR, + pt: POINT, + dwHitInfo: LPARAM, +}} +pub type LPNMMOUSE = *mut NMMOUSE; +pub type NMCLICK = NMMOUSE; +pub type LPNMCLICK = LPNMMOUSE; +STRUCT!{struct NMOBJECTNOTIFY { + hdr: NMHDR, + iItem: c_int, + piid: *const IID, + pObject: *mut c_void, + hResult: HRESULT, + dwFlags: DWORD, +}} +pub type LPNMOBJECTNOTIFY = *mut NMOBJECTNOTIFY; +STRUCT!{struct NMKEY { + hdr: NMHDR, + nVKey: UINT, + uFlags: UINT, +}} +pub type LPNMKEY = *mut NMKEY; +STRUCT!{struct NMCHAR { + hdr: NMHDR, + ch: UINT, + dwItemPrev: DWORD, + dwItemNext: DWORD, +}} +pub type LPNMCHAR = *mut NMCHAR; +STRUCT!{struct NMCUSTOMTEXT { + hdr: NMHDR, + hDC: HDC, + lpString: LPCWSTR, + nCount: c_int, + lpRect: LPRECT, + uFormat: UINT, + fLink: BOOL, +}} +pub type LPNMCUSTOMTEXT = *mut NMCUSTOMTEXT; +pub const NM_FIRST: UINT = 0; +pub const NM_LAST: UINT = -99i32 as u32; +pub const LVN_FIRST: UINT = -100i32 as u32; +pub const LVN_LAST: UINT = -199i32 as u32; +pub const HDN_FIRST: UINT = -300i32 as u32; +pub const HDN_LAST: UINT = -399i32 as u32; +pub const TVN_FIRST: UINT = -400i32 as u32; +pub const TVN_LAST: UINT = -499i32 as u32; +pub const TTN_FIRST: UINT = -520i32 as u32; +pub const TTN_LAST: UINT = -549i32 as u32; +pub const TCN_FIRST: UINT = -550i32 as u32; +pub const TCN_LAST: UINT = -580i32 as u32; +pub const CDN_FIRST: UINT = -601i32 as u32; +pub const CDN_LAST: UINT = -699i32 as u32; +pub const TBN_FIRST: UINT = -700i32 as u32; +pub const TBN_LAST: UINT = -720i32 as u32; +pub const UDN_FIRST: UINT = -721i32 as u32; +pub const UDN_LAST: UINT = -729i32 as u32; +pub const DTN_FIRST: UINT = -740i32 as u32; +pub const DTN_LAST: UINT = -745i32 as u32; +pub const MCN_FIRST: UINT = -746i32 as u32; +pub const MCN_LAST: UINT = -752i32 as u32; +pub const DTN_FIRST2: UINT = -753i32 as u32; +pub const DTN_LAST2: UINT = -799i32 as u32; +pub const CBEN_FIRST: UINT = -800i32 as u32; +pub const CBEN_LAST: UINT = -830i32 as u32; +pub const RBN_FIRST: UINT = -831i32 as u32; +pub const RBN_LAST: UINT = -859i32 as u32; +pub const IPN_FIRST: UINT = -860i32 as u32; +pub const IPN_LAST: UINT = -879i32 as u32; +pub const SBN_FIRST: UINT = -880i32 as u32; +pub const SBN_LAST: UINT = -899i32 as u32; +pub const PGN_FIRST: UINT = -900i32 as u32; +pub const PGN_LAST: UINT = -950i32 as u32; +pub const WMN_FIRST: UINT = -1000i32 as u32; +pub const WMN_LAST: UINT = -1200i32 as u32; +pub const BCN_FIRST: UINT = -1250i32 as u32; +pub const BCN_LAST: UINT = -1350i32 as u32; +pub const TRBN_FIRST: UINT = -1501i32 as u32; +pub const TRBN_LAST: UINT = -1519i32 as u32; +pub const MSGF_COMMCTRL_BEGINDRAG: c_int = 0x4200; +pub const MSGF_COMMCTRL_SIZEHEADER: c_int = 0x4201; +pub const MSGF_COMMCTRL_DRAGSELECT: c_int = 0x4202; +pub const MSGF_COMMCTRL_TOOLBARCUST: c_int = 0x4203; +pub const CDRF_DODEFAULT: LRESULT = 0x00000000; +pub const CDRF_NEWFONT: LRESULT = 0x00000002; +pub const CDRF_SKIPDEFAULT: LRESULT = 0x00000004; +pub const CDRF_DOERASE: LRESULT = 0x00000008; +pub const CDRF_SKIPPOSTPAINT: LRESULT = 0x00000100; +pub const CDRF_NOTIFYPOSTPAINT: LRESULT = 0x00000010; +pub const CDRF_NOTIFYITEMDRAW: LRESULT = 0x00000020; +pub const CDRF_NOTIFYSUBITEMDRAW: LRESULT = 0x00000020; +pub const CDRF_NOTIFYPOSTERASE: LRESULT = 0x00000040; +pub const CDDS_PREPAINT: DWORD = 0x00000001; +pub const CDDS_POSTPAINT: DWORD = 0x00000002; +pub const CDDS_PREERASE: DWORD = 0x00000003; +pub const CDDS_POSTERASE: DWORD = 0x00000004; +pub const CDDS_ITEM: DWORD = 0x00010000; +pub const CDDS_ITEMPREPAINT: DWORD = CDDS_ITEM | CDDS_PREPAINT; +pub const CDDS_ITEMPOSTPAINT: DWORD = CDDS_ITEM | CDDS_POSTPAINT; +pub const CDDS_ITEMPREERASE: DWORD = CDDS_ITEM | CDDS_PREERASE; +pub const CDDS_ITEMPOSTERASE: DWORD = CDDS_ITEM | CDDS_POSTERASE; +pub const CDDS_SUBITEM: DWORD = 0x00020000; +pub const CDIS_SELECTED: UINT = 0x0001; +pub const CDIS_GRAYED: UINT = 0x0002; +pub const CDIS_DISABLED: UINT = 0x0004; +pub const CDIS_CHECKED: UINT = 0x0008; +pub const CDIS_FOCUS: UINT = 0x0010; +pub const CDIS_DEFAULT: UINT = 0x0020; +pub const CDIS_HOT: UINT = 0x0040; +pub const CDIS_MARKED: UINT = 0x0080; +pub const CDIS_INDETERMINATE: UINT = 0x0100; +pub const CDIS_SHOWKEYBOARDCUES: UINT = 0x0200; +pub const CDIS_NEARHOT: UINT = 0x0400; +pub const CDIS_OTHERSIDEHOT: UINT = 0x0800; +pub const CDIS_DROPHILITED: UINT = 0x1000; +STRUCT!{struct NMCUSTOMDRAW { + hdr: NMHDR, + dwDrawStage: DWORD, + hdc: HDC, + rc: RECT, + dwItemSpec: DWORD_PTR, + uItemState: UINT, + lItemlParam: LPARAM, +}} +pub type LPNMCUSTOMDRAW = *mut NMCUSTOMDRAW; +STRUCT!{struct NMTTCUSTOMDRAW { + nmcd: NMCUSTOMDRAW, + uDrawFlags: UINT, +}} +pub type LPNMTTCUSTOMDRAW = *mut NMTTCUSTOMDRAW; +STRUCT!{struct NMCUSTOMSPLITRECTINFO { + hdr: NMHDR, + rcClient: RECT, + rcButton: RECT, + rcSplit: RECT, +}} +pub type LPNMCUSTOMSPLITRECTINFO = *mut NMCUSTOMSPLITRECTINFO; +pub const NM_GETCUSTOMSPLITRECT: UINT = BCN_FIRST + 0x0003; +pub const CLR_NONE: DWORD = 0xFFFFFFFF; +pub const CLR_DEFAULT: DWORD = 0xFF000000; +pub enum IMAGELIST {} +pub type HIMAGELIST = *mut IMAGELIST; +STRUCT!{struct IMAGELISTDRAWPARAMS { + cbSize: DWORD, + himl: HIMAGELIST, + i: c_int, + hdcDst: HDC, + x: c_int, + y: c_int, + cx: c_int, + cy: c_int, + xBitmap: c_int, + yBitmap: c_int, + rgbBk: COLORREF, + rgbFg: COLORREF, + fStyle: UINT, + dwRop: DWORD, + fState: DWORD, + Frame: DWORD, + crEffect: COLORREF, +}} +pub type LPIMAGELISTDRAWPARAMS = *mut IMAGELISTDRAWPARAMS; +pub const ILC_MASK: UINT = 0x00000001; +pub const ILC_COLOR: UINT = 0x00000000; +pub const ILC_COLORDDB: UINT = 0x000000FE; +pub const ILC_COLOR4: UINT = 0x00000004; +pub const ILC_COLOR8: UINT = 0x00000008; +pub const ILC_COLOR16: UINT = 0x00000010; +pub const ILC_COLOR24: UINT = 0x00000018; +pub const ILC_COLOR32: UINT = 0x00000020; +pub const ILC_PALETTE: UINT = 0x00000800; +pub const ILC_MIRROR: UINT = 0x00002000; +pub const ILC_PERITEMMIRROR: UINT = 0x00008000; +pub const ILC_ORIGINALSIZE: UINT = 0x00010000; +pub const ILC_HIGHQUALITYSCALE: UINT = 0x00020000; +extern "system" { + pub fn ImageList_Create( + cx: c_int, + cy: c_int, + flags: UINT, + cInitial: c_int, + cGrow: c_int, + ) -> HIMAGELIST; + pub fn ImageList_Destroy( + himl: HIMAGELIST, + ) -> BOOL; + pub fn ImageList_GetImageCount( + himl: HIMAGELIST, + ) -> c_int; + pub fn ImageList_SetImageCount( + himl: HIMAGELIST, + uNewCount: UINT, + ) -> BOOL; + pub fn ImageList_Add( + himl: HIMAGELIST, + hbmImage: HBITMAP, + hbmMask: HBITMAP, + ) -> c_int; + pub fn ImageList_ReplaceIcon( + himl: HIMAGELIST, + i: c_int, + hicon: HICON, + ) -> c_int; + pub fn ImageList_SetBkColor( + himl: HIMAGELIST, + clrBk: COLORREF, + ) -> COLORREF; + pub fn ImageList_GetBkColor( + himl: HIMAGELIST, + ) -> COLORREF; + pub fn ImageList_SetOverlayImage( + himl: HIMAGELIST, + iImage: c_int, + iOverlay: c_int, + ) -> BOOL; +} +#[inline] +pub unsafe fn ImageList_AddIcon(himl: HIMAGELIST, hicon: HICON) -> c_int { + ImageList_ReplaceIcon(himl, -1, hicon) +} +pub const ILD_NORMAL: UINT = 0x00000000; +pub const ILD_TRANSPARENT: UINT = 0x00000001; +pub const ILD_MASK: UINT = 0x00000010; +pub const ILD_IMAGE: UINT = 0x00000020; +pub const ILD_ROP: UINT = 0x00000040; +pub const ILD_BLEND25: UINT = 0x00000002; +pub const ILD_BLEND50: UINT = 0x00000004; +pub const ILD_OVERLAYMASK: UINT = 0x00000F00; +#[inline] +pub fn INDEXTOOVERLAYMASK(i: UINT) -> UINT { + i << 8 +} +pub const ILD_PRESERVEALPHA: UINT = 0x00001000; +pub const ILD_SCALE: UINT = 0x00002000; +pub const ILD_DPISCALE: UINT = 0x00004000; +pub const ILD_ASYNC: UINT = 0x00008000; +pub const ILD_SELECTED: UINT = ILD_BLEND50; +pub const ILD_FOCUS: UINT = ILD_BLEND25; +pub const ILD_BLEND: UINT = ILD_BLEND50; +pub const CLR_HILIGHT: DWORD = CLR_DEFAULT; +pub const ILS_NORMAL: DWORD = 0x00000000; +pub const ILS_GLOW: DWORD = 0x00000001; +pub const ILS_SHADOW: DWORD = 0x00000002; +pub const ILS_SATURATE: DWORD = 0x00000004; +pub const ILS_ALPHA: DWORD = 0x00000008; +pub const ILGT_NORMAL: DWORD = 0x00000000; +pub const ILGT_ASYNC : DWORD = 0x00000001; +extern "system" { + pub fn ImageList_Draw( + himl: HIMAGELIST, + i: c_int, + hdcDst: HDC, + x: c_int, + y: c_int, + fStyle: UINT, + ) -> BOOL; +} +pub const HBITMAP_CALLBACK: HBITMAP = -1isize as HBITMAP; +extern "system" { + pub fn ImageList_Replace( + himl: HIMAGELIST, + i: c_int, + hbmImage: HBITMAP, + hbmMask: HBITMAP, + ) -> BOOL; + pub fn ImageList_AddMasked( + himl: HIMAGELIST, + hbmImage: HBITMAP, + crMask: COLORREF, + ) -> c_int; + pub fn ImageList_DrawEx( + himl: HIMAGELIST, + i: c_int, + hdcDst: HDC, + x: c_int, + y: c_int, + dx: c_int, + dy: c_int, + rgbBk: COLORREF, + rgbFg: COLORREF, + fStyle: UINT, + ) -> BOOL; + pub fn ImageList_DrawIndirect( + pimldp: *mut IMAGELISTDRAWPARAMS, + ) -> BOOL; + pub fn ImageList_Remove( + himl: HIMAGELIST, + i: c_int, + ) -> BOOL; + pub fn ImageList_GetIcon( + himl: HIMAGELIST, + i: c_int, + flags: UINT, + ) -> HICON; + pub fn ImageList_LoadImageA( + hi: HINSTANCE, + lpbmp: LPCSTR, + cx: c_int, + cGrow: c_int, + crMask: COLORREF, + uType: UINT, + uFlags: UINT, + ) -> HIMAGELIST; + pub fn ImageList_LoadImageW( + hi: HINSTANCE, + lpbmp: LPCWSTR, + cx: c_int, + cGrow: c_int, + crMask: COLORREF, + uType: UINT, + uFlags: UINT, + ) -> HIMAGELIST; +} +pub const ILCF_MOVE: UINT = 0x00000000; +pub const ILCF_SWAP: UINT = 0x00000001; +extern "system" { + pub fn ImageList_Copy( + himlDst: HIMAGELIST, + iDst: c_int, + himlSrc: HIMAGELIST, + iSrc: c_int, + uFlags: UINT, + ) -> BOOL; + pub fn ImageList_BeginDrag( + himlTrack: HIMAGELIST, + iTrack: c_int, + dxHotspot: c_int, + dyHotspot: c_int, + ) -> BOOL; + pub fn ImageList_EndDrag(); + pub fn ImageList_DragEnter( + hwndLock: HWND, + x: c_int, + y: c_int, + ) -> BOOL; + pub fn ImageList_DragLeave( + hwndLock: HWND, + ) -> BOOL; + pub fn ImageList_DragMove( + x: c_int, + y: c_int, + ) -> BOOL; + pub fn ImageList_SetDragCursorImage( + himlDrag: HIMAGELIST, + iDrag: c_int, + dxHotspot: c_int, + dyHotspot: c_int, + ) -> BOOL; + pub fn ImageList_DragShowNolock( + fShow: BOOL, + ) -> BOOL; + pub fn ImageList_GetDragImage( + ppt: *mut POINT, + pptHotspot: *mut POINT, + ) -> HIMAGELIST; +} +#[inline] +pub unsafe fn ImageList_RemoveAll(himl: HIMAGELIST) -> BOOL { + ImageList_Remove(himl, -1) +} +#[inline] +pub unsafe fn ImageList_ExtractIcon(_: HINSTANCE, himl: HIMAGELIST, i: c_int) -> HICON { + ImageList_GetIcon(himl, i, 0) +} +#[inline] +pub unsafe fn ImageList_LoadBitmap( + hi: HINSTANCE, + lpbmp: LPCWSTR, + cx: c_int, + cGrow: c_int, + crMask: COLORREF, +) -> HIMAGELIST { + ImageList_LoadImageW(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0) +} +pub enum IStream {} +extern "system" { + pub fn ImageList_Read( + pstm: *mut IStream, + ) -> HIMAGELIST; + pub fn ImageList_Write( + himl: HIMAGELIST, + pstm: *mut IStream, + ) -> BOOL; +} +pub const ILP_NORMAL: DWORD = 0; +pub const ILP_DOWNLEVEL: DWORD = 0; +extern "system" { + pub fn ImageList_ReadEx( + dwFlags: DWORD, + pstm: *mut IStream, + riid: REFIID, + ppv: *mut PVOID, + ) -> HRESULT; + pub fn ImageList_WriteEx( + himl: HIMAGELIST, + dwFlags: DWORD, + pstm: *mut IStream, + ) -> HRESULT; +} +STRUCT!{struct IMAGEINFO { + hbmImage: HBITMAP, + hbmMask: HBITMAP, + Unused1: c_int, + Unused2: c_int, + rcImage: RECT, +}} +pub type LPIMAGEINFO = *mut IMAGEINFO; +extern "system" { + pub fn ImageList_GetIconSize( + himl: HIMAGELIST, + cx: *mut c_int, + cy: *mut c_int, + ) -> BOOL; + pub fn ImageList_SetIconSize( + himl: HIMAGELIST, + cx: c_int, + cy: c_int, + ) -> BOOL; + pub fn ImageList_GetImageInfo( + himl: HIMAGELIST, + i: c_int, + pImageInfo: *mut IMAGEINFO, + ) -> BOOL; + pub fn ImageList_Merge( + himl1: HIMAGELIST, + i1: c_int, + himl2: HIMAGELIST, + i2: c_int, + dx: c_int, + dy: c_int, + ) -> HIMAGELIST; + pub fn ImageList_Duplicate( + himl: HIMAGELIST, + ) -> HIMAGELIST; + pub fn HIMAGELIST_QueryInterface( + himl: HIMAGELIST, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT; +} +#[inline] +pub fn IImageListToHIMAGELIST(himl: *mut IImageList) -> HIMAGELIST { + himl as HIMAGELIST +} +pub const WC_HEADER: &'static str = "SysHeader32"; +pub const HDS_HORZ: DWORD = 0x0000; +pub const HDS_BUTTONS: DWORD = 0x0002; +pub const HDS_HOTTRACK: DWORD = 0x0004; +pub const HDS_HIDDEN: DWORD = 0x0008; +pub const HDS_DRAGDROP: DWORD = 0x0040; +pub const HDS_FULLDRAG: DWORD = 0x0080; +pub const HDS_FILTERBAR: DWORD = 0x0100; +pub const HDS_FLAT: DWORD = 0x0200; +pub const HDS_CHECKBOXES: DWORD = 0x0400; +pub const HDS_NOSIZING: DWORD = 0x0800; +pub const HDS_OVERFLOW: DWORD = 0x1000; +pub const HDFT_ISSTRING: UINT = 0x0000; +pub const HDFT_ISNUMBER: UINT = 0x0001; +pub const HDFT_ISDATE: UINT = 0x0002; +pub const HDFT_HASNOVALUE: UINT = 0x8000; +STRUCT!{struct HD_TEXTFILTERA { + pszText: LPSTR, + cchTextMax: INT, +}} +pub type LPHD_TEXTFILTERA = *mut HD_TEXTFILTERA; +STRUCT!{struct HD_TEXTFILTERW { + pszText: LPWSTR, + cchTextMax: INT, +}} +pub type LPHD_TEXTFILTERW = *mut HD_TEXTFILTERW; +STRUCT!{struct HDITEMA { + mask: UINT, + cxy: c_int, + pszText: LPSTR, + hbm: HBITMAP, + cchTextMax: c_int, + fmt: c_int, + lParam: LPARAM, + iImage: c_int, + iOrder: c_int, + _type: UINT, + pvFilter: *mut c_void, + state: UINT, +}} +pub type LPHDITEMA = *mut HDITEMA; +STRUCT!{struct HDITEMW { + mask: UINT, + cxy: c_int, + pszText: LPWSTR, + hbm: HBITMAP, + cchTextMax: c_int, + fmt: c_int, + lParam: LPARAM, + iImage: c_int, + iOrder: c_int, + _type: UINT, + pvFilter: *mut c_void, + state: UINT, +}} +pub type LPHDITEMW = *mut HDITEMW; +pub const HDI_WIDTH: UINT = 0x0001; +pub const HDI_HEIGHT: UINT = HDI_WIDTH; +pub const HDI_TEXT: UINT = 0x0002; +pub const HDI_FORMAT: UINT = 0x0004; +pub const HDI_LPARAM: UINT = 0x0008; +pub const HDI_BITMAP: UINT = 0x0010; +pub const HDI_IMAGE: UINT = 0x0020; +pub const HDI_DI_SETITEM: UINT = 0x0040; +pub const HDI_ORDER: UINT = 0x0080; +pub const HDI_FILTER: UINT = 0x0100; +pub const HDI_STATE: UINT = 0x0200; +pub const HDF_LEFT: c_int = 0x0000; +pub const HDF_RIGHT: c_int = 0x0001; +pub const HDF_CENTER: c_int = 0x0002; +pub const HDF_JUSTIFYMASK: c_int = 0x0003; +pub const HDF_RTLREADING: c_int = 0x0004; +pub const HDF_BITMAP: c_int = 0x2000; +pub const HDF_STRING: c_int = 0x4000; +pub const HDF_OWNERDRAW: c_int = 0x8000; +pub const HDF_IMAGE: c_int = 0x0800; +pub const HDF_BITMAP_ON_RIGHT: c_int = 0x1000; +pub const HDF_SORTUP: c_int = 0x0400; +pub const HDF_SORTDOWN: c_int = 0x0200; +pub const HDF_CHECKBOX: c_int = 0x0040; +pub const HDF_CHECKED: c_int = 0x0080; +pub const HDF_FIXEDWIDTH: c_int = 0x0100; +pub const HDF_SPLITBUTTON: c_int = 0x1000000; +pub const HDIS_FOCUSED: UINT = 0x00000001; +pub const HDM_GETITEMCOUNT: UINT = HDM_FIRST + 0; +pub const HDM_INSERTITEMA: UINT = HDM_FIRST + 1; +pub const HDM_INSERTITEMW: UINT = HDM_FIRST + 10; +pub const HDM_DELETEITEM: UINT = HDM_FIRST + 2; +pub const HDM_GETITEMA: UINT = HDM_FIRST + 3; +pub const HDM_GETITEMW: UINT = HDM_FIRST + 11; +pub const HDM_SETITEMA: UINT = HDM_FIRST + 4; +pub const HDM_SETITEMW: UINT = HDM_FIRST + 12; +STRUCT!{struct HDLAYOUT { + prc: *mut RECT, + pwpos: *mut WINDOWPOS, +}} +pub type LPHDLAYOUT = *mut HDLAYOUT; +pub const HDM_LAYOUT: UINT = HDM_FIRST + 5; +pub const HHT_NOWHERE: UINT = 0x0001; +pub const HHT_ONHEADER: UINT = 0x0002; +pub const HHT_ONDIVIDER: UINT = 0x0004; +pub const HHT_ONDIVOPEN: UINT = 0x0008; +pub const HHT_ONFILTER: UINT = 0x0010; +pub const HHT_ONFILTERBUTTON: UINT = 0x0020; +pub const HHT_ABOVE: UINT = 0x0100; +pub const HHT_BELOW: UINT = 0x0200; +pub const HHT_TORIGHT: UINT = 0x0400; +pub const HHT_TOLEFT: UINT = 0x0800; +pub const HHT_ONITEMSTATEICON: UINT = 0x1000; +pub const HHT_ONDROPDOWN: UINT = 0x2000; +pub const HHT_ONOVERFLOW: UINT = 0x4000; +STRUCT!{struct HDHITTESTINFO { + pt: POINT, + flags: UINT, + iItem: c_int, +}} +pub type LPHDHITTESTINFO = *mut HDHITTESTINFO; +pub type HD_HITTESTINFO = HDHITTESTINFO; +pub const HDSIL_NORMAL: WPARAM = 0; +pub const HDSIL_STATE: WPARAM = 1; +pub const HDM_HITTEST: UINT = HDM_FIRST + 6; +pub const HDM_GETITEMRECT: UINT = HDM_FIRST + 7; +pub const HDM_SETIMAGELIST: UINT = HDM_FIRST + 8; +pub const HDM_GETIMAGELIST: UINT = HDM_FIRST + 9; +pub const HDM_ORDERTOINDEX: UINT = HDM_FIRST + 15; +pub const HDM_CREATEDRAGIMAGE: UINT = HDM_FIRST + 16; +pub const HDM_GETORDERARRAY: UINT = HDM_FIRST + 17; +pub const HDM_SETORDERARRAY: UINT = HDM_FIRST + 18; +pub const HDM_SETHOTDIVIDER: UINT = HDM_FIRST + 19; +pub const HDM_SETBITMAPMARGIN: UINT = HDM_FIRST + 20; +pub const HDM_GETBITMAPMARGIN: UINT = HDM_FIRST + 21; +pub const HDM_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const HDM_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const HDM_SETFILTERCHANGETIMEOUT: UINT = HDM_FIRST + 22; +pub const HDM_EDITFILTER: UINT = HDM_FIRST + 23; +pub const HDM_CLEARFILTER: UINT = HDM_FIRST + 24; +pub const HDM_GETITEMDROPDOWNRECT: UINT = HDM_FIRST + 25; +pub const HDM_GETOVERFLOWRECT: UINT = HDM_FIRST + 26; +pub const HDM_GETFOCUSEDITEM: UINT = HDM_FIRST + 27; +pub const HDM_SETFOCUSEDITEM: UINT = HDM_FIRST + 28; +pub const HDN_ITEMCHANGINGA: UINT = HDN_FIRST - 0; +pub const HDN_ITEMCHANGINGW: UINT = HDN_FIRST - 20; +pub const HDN_ITEMCHANGEDA: UINT = HDN_FIRST - 1; +pub const HDN_ITEMCHANGEDW: UINT = HDN_FIRST - 21; +pub const HDN_ITEMCLICKA: UINT = HDN_FIRST - 2; +pub const HDN_ITEMCLICKW: UINT = HDN_FIRST - 22; +pub const HDN_ITEMDBLCLICKA: UINT = HDN_FIRST - 3; +pub const HDN_ITEMDBLCLICKW: UINT = HDN_FIRST - 23; +pub const HDN_DIVIDERDBLCLICKA: UINT = HDN_FIRST - 5; +pub const HDN_DIVIDERDBLCLICKW: UINT = HDN_FIRST - 25; +pub const HDN_BEGINTRACKA: UINT = HDN_FIRST - 6; +pub const HDN_BEGINTRACKW: UINT = HDN_FIRST - 26; +pub const HDN_ENDTRACKA: UINT = HDN_FIRST - 7; +pub const HDN_ENDTRACKW: UINT = HDN_FIRST - 27; +pub const HDN_TRACKA: UINT = HDN_FIRST - 8; +pub const HDN_TRACKW: UINT = HDN_FIRST - 28; +pub const HDN_GETDISPINFOA: UINT = HDN_FIRST - 9; +pub const HDN_GETDISPINFOW: UINT = HDN_FIRST - 29; +pub const HDN_BEGINDRAG: UINT = HDN_FIRST - 10; +pub const HDN_ENDDRAG: UINT = HDN_FIRST - 11; +pub const HDN_FILTERCHANGE: UINT = HDN_FIRST - 12; +pub const HDN_FILTERBTNCLICK: UINT = HDN_FIRST - 13; +pub const HDN_BEGINFILTEREDIT: UINT = HDN_FIRST - 14; +pub const HDN_ENDFILTEREDIT: UINT = HDN_FIRST - 15; +pub const HDN_ITEMSTATEICONCLICK: UINT = HDN_FIRST - 16; +pub const HDN_ITEMKEYDOWN: UINT = HDN_FIRST - 17; +pub const HDN_DROPDOWN: UINT = HDN_FIRST - 18; +pub const HDN_OVERFLOWCLICK: UINT = HDN_FIRST - 19; +STRUCT!{struct NMHEADERA { + hdr: NMHDR, + iItem: c_int, + iButton: c_int, + pitem: *mut HDITEMA, +}} +pub type LPNMHEADERA = *mut NMHEADERA; +pub type HD_NOTIFYA = NMHEADERA; +STRUCT!{struct NMHEADERW { + hdr: NMHDR, + iItem: c_int, + iButton: c_int, + pitem: *mut HDITEMW, +}} +pub type LPNMHEADERW = *mut NMHEADERW; +pub type HD_NOTIFYW = NMHEADERW; +STRUCT!{struct NMHDDISPINFOW { + hdr: NMHDR, + iItem: c_int, + mask: UINT, + pszText: LPWSTR, + cchTextMax: c_int, + iImage: c_int, + lParam: LPARAM, +}} +pub type LPNMHDDISPINFOW = *mut NMHDDISPINFOW; +STRUCT!{struct NMHDDISPINFOA { + hdr: NMHDR, + iItem: c_int, + mask: UINT, + pszText: LPSTR, + cchTextMax: c_int, + iImage: c_int, + lParam: LPARAM, +}} +pub type LPNMHDDISPINFOA = *mut NMHDDISPINFOA; +STRUCT!{struct NMHDFILTERBTNCLICK { + hdr: NMHDR, + iItem: INT, + rc: RECT, +}} +pub type LPNMHDFILTERBTNCLICK = *mut NMHDFILTERBTNCLICK; +pub const TOOLBARCLASSNAME: &'static str = "ToolbarWindow32"; +#[cfg(target_pointer_width = "32")] +STRUCT!{struct TBBUTTON { + iBitmap: c_int, + idCommand: c_int, + fsState: BYTE, + fsStyle: BYTE, + bReserved: [BYTE; 2], + dwData: DWORD_PTR, + iString: INT_PTR, +}} +#[cfg(target_pointer_width = "64")] +STRUCT!{struct TBBUTTON { + iBitmap: c_int, + idCommand: c_int, + fsState: BYTE, + fsStyle: BYTE, + bReserved: [BYTE; 6], + dwData: DWORD_PTR, + iString: INT_PTR, +}} +pub type PTBBUTTON = *mut TBBUTTON; +pub type LPTBBUTTON = *mut TBBUTTON; +pub type LPCTBBUTTON = *const TBBUTTON; +STRUCT!{struct COLORMAP { + from: COLORREF, + to: COLORREF, +}} +pub type LPCOLORMAP = *mut COLORMAP; +extern "system" { + pub fn CreateToolbarEx( + hwnd: HWND, + ws: DWORD, + wID: UINT, + nBitmaps: c_int, + hBMInst: HINSTANCE, + wBMID: UINT_PTR, + lpButtons: LPCTBBUTTON, + iNumButtons: c_int, + dxButton: c_int, + dyButton: c_int, + dxBitmap: c_int, + dyBitmap: c_int, + uStructSize: UINT, + ) -> HWND; + pub fn CreateMappedBitmap( + hInstance: HINSTANCE, + idBitmap: INT_PTR, + wFlags: UINT, + lpColorMap: LPCOLORMAP, + iNumMaps: c_int, + ) -> HBITMAP; +} +pub const CMB_MASKED: UINT = 0x02; +pub const TBSTATE_CHECKED: BYTE = 0x01; +pub const TBSTATE_PRESSED: BYTE = 0x02; +pub const TBSTATE_ENABLED: BYTE = 0x04; +pub const TBSTATE_HIDDEN: BYTE = 0x08; +pub const TBSTATE_INDETERMINATE: BYTE = 0x10; +pub const TBSTATE_WRAP: BYTE = 0x20; +pub const TBSTATE_ELLIPSES: BYTE = 0x40; +pub const TBSTATE_MARKED: BYTE = 0x80; +pub const TBSTYLE_BUTTON: DWORD = 0x0000; +pub const TBSTYLE_SEP: DWORD = 0x0001; +pub const TBSTYLE_CHECK: DWORD = 0x0002; +pub const TBSTYLE_GROUP: DWORD = 0x0004; +pub const TBSTYLE_CHECKGROUP: DWORD = TBSTYLE_GROUP | TBSTYLE_CHECK; +pub const TBSTYLE_DROPDOWN: DWORD = 0x0008; +pub const TBSTYLE_AUTOSIZE: DWORD = 0x0010; +pub const TBSTYLE_NOPREFIX: DWORD = 0x0020; +pub const TBSTYLE_TOOLTIPS: DWORD = 0x0100; +pub const TBSTYLE_WRAPABLE: DWORD = 0x0200; +pub const TBSTYLE_ALTDRAG: DWORD = 0x0400; +pub const TBSTYLE_FLAT: DWORD = 0x0800; +pub const TBSTYLE_LIST: DWORD = 0x1000; +pub const TBSTYLE_CUSTOMERASE: DWORD = 0x2000; +pub const TBSTYLE_REGISTERDROP: DWORD = 0x4000; +pub const TBSTYLE_TRANSPARENT: DWORD = 0x8000; +pub const TBSTYLE_EX_DRAWDDARROWS: DWORD = 0x00000001; +pub const BTNS_BUTTON: DWORD = TBSTYLE_BUTTON; +pub const BTNS_SEP: DWORD = TBSTYLE_SEP; +pub const BTNS_CHECK: DWORD = TBSTYLE_CHECK; +pub const BTNS_GROUP: DWORD = TBSTYLE_GROUP; +pub const BTNS_CHECKGROUP: DWORD = TBSTYLE_CHECKGROUP; +pub const BTNS_DROPDOWN: DWORD = TBSTYLE_DROPDOWN; +pub const BTNS_AUTOSIZE: DWORD = TBSTYLE_AUTOSIZE; +pub const BTNS_NOPREFIX: DWORD = TBSTYLE_NOPREFIX; +pub const BTNS_SHOWTEXT: DWORD = 0x0040; +pub const BTNS_WHOLEDROPDOWN: DWORD = 0x0080; +pub const TBSTYLE_EX_MIXEDBUTTONS: DWORD = 0x00000008; +pub const TBSTYLE_EX_HIDECLIPPEDBUTTONS: DWORD = 0x00000010; +pub const TBSTYLE_EX_MULTICOLUMN: DWORD = 0x00000002; +pub const TBSTYLE_EX_VERTICAL: DWORD = 0x00000004; +pub const TBSTYLE_EX_DOUBLEBUFFER: DWORD = 0x00000080; +STRUCT!{struct NMTBCUSTOMDRAW { + nmcd: NMCUSTOMDRAW, + hbrMonoDither: HBRUSH, + hbrLines: HBRUSH, + hpenLines: HPEN, + clrText: COLORREF, + clrMark: COLORREF, + clrTextHighlight: COLORREF, + clrBtnFace: COLORREF, + clrBtnHighlight: COLORREF, + clrHighlightHotTrack: COLORREF, + rcText: RECT, + nStringBkMode: c_int, + nHLStringBkMode: c_int, + iListGap: c_int, +}} +pub type LPNMTBCUSTOMDRAW = *mut NMTBCUSTOMDRAW; +pub const TBCDRF_NOEDGES: LRESULT = 0x00010000; +pub const TBCDRF_HILITEHOTTRACK: LRESULT = 0x00020000; +pub const TBCDRF_NOOFFSET: LRESULT = 0x00040000; +pub const TBCDRF_NOMARK: LRESULT = 0x00080000; +pub const TBCDRF_NOETCHEDEFFECT: LRESULT = 0x00100000; +pub const TBCDRF_BLENDICON: LRESULT = 0x00200000; +pub const TBCDRF_NOBACKGROUND: LRESULT = 0x00400000; +pub const TBCDRF_USECDCOLORS: LRESULT = 0x00800000; +pub const TB_ENABLEBUTTON: UINT = WM_USER + 1; +pub const TB_CHECKBUTTON: UINT = WM_USER + 2; +pub const TB_PRESSBUTTON: UINT = WM_USER + 3; +pub const TB_HIDEBUTTON: UINT = WM_USER + 4; +pub const TB_INDETERMINATE: UINT = WM_USER + 5; +pub const TB_MARKBUTTON: UINT = WM_USER + 6; +pub const TB_ISBUTTONENABLED: UINT = WM_USER + 9; +pub const TB_ISBUTTONCHECKED: UINT = WM_USER + 10; +pub const TB_ISBUTTONPRESSED: UINT = WM_USER + 11; +pub const TB_ISBUTTONHIDDEN: UINT = WM_USER + 12; +pub const TB_ISBUTTONINDETERMINATE: UINT = WM_USER + 13; +pub const TB_ISBUTTONHIGHLIGHTED: UINT = WM_USER + 14; +pub const TB_SETSTATE: UINT = WM_USER + 17; +pub const TB_GETSTATE: UINT = WM_USER + 18; +pub const TB_ADDBITMAP: UINT = WM_USER + 19; +STRUCT!{struct TBADDBITMAP { + hInst: HINSTANCE, + nID: UINT_PTR, +}} +pub type LPTBADDBITMAP = *mut TBADDBITMAP; +pub const HINST_COMMCTRL: HINSTANCE = -1isize as HINSTANCE; +pub const IDB_STD_SMALL_COLOR: WPARAM = 0; +pub const IDB_STD_LARGE_COLOR: WPARAM = 1; +pub const IDB_VIEW_SMALL_COLOR: WPARAM = 4; +pub const IDB_VIEW_LARGE_COLOR: WPARAM = 5; +pub const IDB_HIST_SMALL_COLOR: WPARAM = 8; +pub const IDB_HIST_LARGE_COLOR: WPARAM = 9; +pub const IDB_HIST_NORMAL: WPARAM = 12; +pub const IDB_HIST_HOT: WPARAM = 13; +pub const IDB_HIST_DISABLED: WPARAM = 14; +pub const IDB_HIST_PRESSED: WPARAM = 15; +pub const STD_CUT: c_int = 0; +pub const STD_COPY: c_int = 1; +pub const STD_PASTE: c_int = 2; +pub const STD_UNDO: c_int = 3; +pub const STD_REDOW: c_int = 4; +pub const STD_DELETE: c_int = 5; +pub const STD_FILENEW: c_int = 6; +pub const STD_FILEOPEN: c_int = 7; +pub const STD_FILESAVE: c_int = 8; +pub const STD_PRINTPRE: c_int = 9; +pub const STD_PROPERTIES: c_int = 10; +pub const STD_HELP: c_int = 11; +pub const STD_FIND: c_int = 12; +pub const STD_REPLACE: c_int = 13; +pub const STD_PRINT: c_int = 14; +pub const VIEW_LARGEICONS: c_int = 0; +pub const VIEW_SMALLICONS: c_int = 1; +pub const VIEW_LIST: c_int = 2; +pub const VIEW_DETAILS: c_int = 3; +pub const VIEW_SORTNAME: c_int = 4; +pub const VIEW_SORTSIZE: c_int = 5; +pub const VIEW_SORTDATE: c_int = 6; +pub const VIEW_SORTTYPE: c_int = 7; +pub const VIEW_PARENTFOLDER: c_int = 8; +pub const VIEW_NETCONNECT: c_int = 9; +pub const VIEW_NETDISCONNECT: c_int = 10; +pub const VIEW_NEWFOLDER: c_int = 11; +pub const VIEW_VIEWMENU: c_int = 12; +pub const HIST_BACK: c_int = 0; +pub const HIST_FORWARD: c_int = 1; +pub const HIST_FAVORITES: c_int = 2; +pub const HIST_ADDTOFAVORITES: c_int = 3; +pub const HIST_VIEWTREE: c_int = 4; +pub const TB_ADDBUTTONSA: UINT = WM_USER + 20; +pub const TB_INSERTBUTTONA: UINT = WM_USER + 21; +pub const TB_DELETEBUTTON: UINT = WM_USER + 22; +pub const TB_GETBUTTON: UINT = WM_USER + 23; +pub const TB_BUTTONCOUNT: UINT = WM_USER + 24; +pub const TB_COMMANDTOINDEX: UINT = WM_USER + 25; +STRUCT!{struct TBSAVEPARAMSA { + hkr: HKEY, + pszSubKey: LPCSTR, + pszValueName: LPCSTR, +}} +pub type LPTBSAVEPARAMSA = *mut TBSAVEPARAMSA; +STRUCT!{struct TBSAVEPARAMSW { + hkr: HKEY, + pszSubKey: LPCWSTR, + pszValueName: LPCWSTR, +}} +pub type LPTBSAVEPARAMSW = *mut TBSAVEPARAMSW; +pub const TB_SAVERESTOREA: UINT = WM_USER + 26; +pub const TB_SAVERESTOREW: UINT = WM_USER + 76; +pub const TB_CUSTOMIZE: UINT = WM_USER + 27; +pub const TB_ADDSTRINGA: UINT = WM_USER + 28; +pub const TB_ADDSTRINGW: UINT = WM_USER + 77; +pub const TB_GETITEMRECT: UINT = WM_USER + 29; +pub const TB_BUTTONSTRUCTSIZE: UINT = WM_USER + 30; +pub const TB_SETBUTTONSIZE: UINT = WM_USER + 31; +pub const TB_SETBITMAPSIZE: UINT = WM_USER + 32; +pub const TB_AUTOSIZE: UINT = WM_USER + 33; +pub const TB_GETTOOLTIPS: UINT = WM_USER + 35; +pub const TB_SETTOOLTIPS: UINT = WM_USER + 36; +pub const TB_SETPARENT: UINT = WM_USER + 37; +pub const TB_SETROWS: UINT = WM_USER + 39; +pub const TB_GETROWS: UINT = WM_USER + 40; +pub const TB_SETCMDID: UINT = WM_USER + 42; +pub const TB_CHANGEBITMAP: UINT = WM_USER + 43; +pub const TB_GETBITMAP: UINT = WM_USER + 44; +pub const TB_GETBUTTONTEXTA: UINT = WM_USER + 45; +pub const TB_GETBUTTONTEXTW: UINT = WM_USER + 75; +pub const TB_REPLACEBITMAP: UINT = WM_USER + 46; +pub const TB_SETINDENT: UINT = WM_USER + 47; +pub const TB_SETIMAGELIST: UINT = WM_USER + 48; +pub const TB_GETIMAGELIST: UINT = WM_USER + 49; +pub const TB_LOADIMAGES: UINT = WM_USER + 50; +pub const TB_GETRECT: UINT = WM_USER + 51; +pub const TB_SETHOTIMAGELIST: UINT = WM_USER + 52; +pub const TB_GETHOTIMAGELIST: UINT = WM_USER + 53; +pub const TB_SETDISABLEDIMAGELIST: UINT = WM_USER + 54; +pub const TB_GETDISABLEDIMAGELIST: UINT = WM_USER + 55; +pub const TB_SETSTYLE: UINT = WM_USER + 56; +pub const TB_GETSTYLE: UINT = WM_USER + 57; +pub const TB_GETBUTTONSIZE: UINT = WM_USER + 58; +pub const TB_SETBUTTONWIDTH: UINT = WM_USER + 59; +pub const TB_SETMAXTEXTROWS: UINT = WM_USER + 60; +pub const TB_GETTEXTROWS: UINT = WM_USER + 61; +pub const TB_GETOBJECT: UINT = WM_USER + 62; +pub const TB_GETHOTITEM: UINT = WM_USER + 71; +pub const TB_SETHOTITEM: UINT = WM_USER + 72; +pub const TB_SETANCHORHIGHLIGHT: UINT = WM_USER + 73; +pub const TB_GETANCHORHIGHLIGHT: UINT = WM_USER + 74; +pub const TB_MAPACCELERATORA: UINT = WM_USER + 78; +STRUCT!{struct TBINSERTMARK { + iButton: c_int, + dwFlags: DWORD, +}} +pub type LPTBINSERTMARK = *mut TBINSERTMARK; +pub const TBIMHT_AFTER: DWORD = 0x00000001; +pub const TBIMHT_BACKGROUND: DWORD = 0x00000002; +pub const TB_GETINSERTMARK: UINT = WM_USER + 79; +pub const TB_SETINSERTMARK: UINT = WM_USER + 80; +pub const TB_INSERTMARKHITTEST: UINT = WM_USER + 81; +pub const TB_MOVEBUTTON: UINT = WM_USER + 82; +pub const TB_GETMAXSIZE: UINT = WM_USER + 83; +pub const TB_SETEXTENDEDSTYLE: UINT = WM_USER + 84; +pub const TB_GETEXTENDEDSTYLE: UINT = WM_USER + 85; +pub const TB_GETPADDING: UINT = WM_USER + 86; +pub const TB_SETPADDING: UINT = WM_USER + 87; +pub const TB_SETINSERTMARKCOLOR: UINT = WM_USER + 88; +pub const TB_GETINSERTMARKCOLOR: UINT = WM_USER + 89; +pub const TB_SETCOLORSCHEME: UINT = CCM_SETCOLORSCHEME; +pub const TB_GETCOLORSCHEME: UINT = CCM_GETCOLORSCHEME; +pub const TB_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const TB_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const TB_MAPACCELERATORW: UINT = WM_USER + 90; +STRUCT!{struct TBREPLACEBITMAP { + hInstOld: HINSTANCE, + nIDOld: UINT_PTR, + hInstNew: HINSTANCE, + nIDNew: UINT_PTR, + nButtons: c_int, +}} +pub type LPTBREPLACEBITMAP = *mut TBREPLACEBITMAP; +pub const TBBF_LARGE: DWORD = 0x0001; +pub const TB_GETBITMAPFLAGS: UINT = WM_USER + 41; +pub const TBIF_IMAGE: DWORD = 0x00000001; +pub const TBIF_TEXT: DWORD = 0x00000002; +pub const TBIF_STATE: DWORD = 0x00000004; +pub const TBIF_STYLE: DWORD = 0x00000008; +pub const TBIF_LPARAM: DWORD = 0x00000010; +pub const TBIF_COMMAND: DWORD = 0x00000020; +pub const TBIF_SIZE: DWORD = 0x00000040; +pub const TBIF_BYINDEX: DWORD = 0x80000000; +STRUCT!{struct TBBUTTONINFOA { + cbSize: UINT, + dwMask: DWORD, + idCommand: c_int, + iImage: c_int, + fsState: BYTE, + fsStyle: BYTE, + cx: WORD, + lParam: DWORD_PTR, + pszText: LPSTR, + cchText: c_int, +}} +pub type LPTBBUTTONINFOA = *mut TBBUTTONINFOA; +STRUCT!{struct TBBUTTONINFOW { + cbSize: UINT, + dwMask: DWORD, + idCommand: c_int, + iImage: c_int, + fsState: BYTE, + fsStyle: BYTE, + cx: WORD, + lParam: DWORD_PTR, + pszText: LPWSTR, + cchText: c_int, +}} +pub type LPTBBUTTONINFOW = *mut TBBUTTONINFOW; +pub const TB_GETBUTTONINFOW: UINT = WM_USER + 63; +pub const TB_SETBUTTONINFOW: UINT = WM_USER + 64; +pub const TB_GETBUTTONINFOA: UINT = WM_USER + 65; +pub const TB_SETBUTTONINFOA: UINT = WM_USER + 66; +pub const TB_INSERTBUTTONW: UINT = WM_USER + 67; +pub const TB_ADDBUTTONSW: UINT = WM_USER + 68; +pub const TB_HITTEST: UINT = WM_USER + 69; +pub const TB_SETDRAWTEXTFLAGS: UINT = WM_USER + 70; +pub const TB_GETSTRINGW: UINT = WM_USER + 91; +pub const TB_GETSTRINGA: UINT = WM_USER + 92; +pub const TB_SETBOUNDINGSIZE: UINT = WM_USER + 93; +pub const TB_SETHOTITEM2: UINT = WM_USER + 94; +pub const TB_HASACCELERATOR: UINT = WM_USER + 95; +pub const TB_SETLISTGAP: UINT = WM_USER + 96; +pub const TB_GETIMAGELISTCOUNT: UINT = WM_USER + 98; +pub const TB_GETIDEALSIZE: UINT = WM_USER + 99; +pub const TBMF_PAD: DWORD = 0x00000001; +pub const TBMF_BARPAD: DWORD = 0x00000002; +pub const TBMF_BUTTONSPACING: DWORD = 0x00000004; +STRUCT!{struct TBMETRICS { + cbSize: UINT, + dwMask: DWORD, + cxPad: c_int, + cyPad: c_int, + cxBarPad: c_int, + cyBarPad: c_int, + cxButtonSpacing: c_int, + cyButtonSpacing: c_int, +}} +pub type LPTBMETRICS = *mut TBMETRICS; +pub const TB_GETMETRICS: UINT = WM_USER + 101; +pub const TB_SETMETRICS: UINT = WM_USER + 102; +pub const TB_GETITEMDROPDOWNRECT: UINT = WM_USER + 103; +pub const TB_SETPRESSEDIMAGELIST: UINT = WM_USER + 104; +pub const TB_GETPRESSEDIMAGELIST: UINT = WM_USER + 105; +pub const TB_SETWINDOWTHEME: UINT = CCM_SETWINDOWTHEME; +pub const TBN_GETBUTTONINFOA: UINT = TBN_FIRST - 0; +pub const TBN_BEGINDRAG: UINT = TBN_FIRST - 1; +pub const TBN_ENDDRAG: UINT = TBN_FIRST - 2; +pub const TBN_BEGINADJUST: UINT = TBN_FIRST - 3; +pub const TBN_ENDADJUST: UINT = TBN_FIRST - 4; +pub const TBN_RESET: UINT = TBN_FIRST - 5; +pub const TBN_QUERYINSERT: UINT = TBN_FIRST - 6; +pub const TBN_QUERYDELETE: UINT = TBN_FIRST - 7; +pub const TBN_TOOLBARCHANGE: UINT = TBN_FIRST - 8; +pub const TBN_CUSTHELP: UINT = TBN_FIRST - 9; +pub const TBN_DROPDOWN: UINT = TBN_FIRST - 10; +pub const TBN_GETOBJECT: UINT = TBN_FIRST - 12; +STRUCT!{struct NMTBHOTITEM { + hdr: NMHDR, + idOld: c_int, + idNew: c_int, + dwFlags: DWORD, +}} +pub type LPNMTBHOTITEM = *mut NMTBHOTITEM; +pub const HICF_OTHER: DWORD = 0x00000000; +pub const HICF_MOUSE: DWORD = 0x00000001; +pub const HICF_ARROWKEYS: DWORD = 0x00000002; +pub const HICF_ACCELERATOR: DWORD = 0x00000004; +pub const HICF_DUPACCEL: DWORD = 0x00000008; +pub const HICF_ENTERING: DWORD = 0x00000010; +pub const HICF_LEAVING: DWORD = 0x00000020; +pub const HICF_RESELECT: DWORD = 0x00000040; +pub const HICF_LMOUSE: DWORD = 0x00000080; +pub const HICF_TOGGLEDROPDOWN: DWORD = 0x00000100; +pub const TBN_HOTITEMCHANGE: UINT = TBN_FIRST - 13; +pub const TBN_DRAGOUT: UINT = TBN_FIRST - 14; +pub const TBN_DELETINGBUTTON: UINT = TBN_FIRST - 15; +pub const TBN_GETDISPINFOA: UINT = TBN_FIRST - 16; +pub const TBN_GETDISPINFOW: UINT = TBN_FIRST - 17; +pub const TBN_GETINFOTIPA: UINT = TBN_FIRST - 18; +pub const TBN_GETINFOTIPW: UINT = TBN_FIRST - 19; +pub const TBN_GETBUTTONINFOW: UINT = TBN_FIRST - 20; +pub const TBN_RESTORE: UINT = TBN_FIRST - 21; +pub const TBN_SAVE: UINT = TBN_FIRST - 22; +pub const TBN_INITCUSTOMIZE: UINT = TBN_FIRST - 23; +pub const TBNRF_HIDEHELP: LRESULT = 0x00000001; +pub const TBNRF_ENDCUSTOMIZE: LRESULT = 0x00000002; +pub const TBN_WRAPHOTITEM: UINT = TBN_FIRST - 24; +pub const TBN_DUPACCELERATOR: UINT = TBN_FIRST - 25; +pub const TBN_WRAPACCELERATOR: UINT = TBN_FIRST - 26; +pub const TBN_DRAGOVER: UINT = TBN_FIRST - 27; +pub const TBN_MAPACCELERATOR: UINT = TBN_FIRST - 28; +STRUCT!{struct NMTBSAVE { + hdr: NMHDR, + pData: *mut DWORD, + pCurrent: *mut DWORD, + cbData: UINT, + iItem: c_int, + cButtons: c_int, + tbButton: TBBUTTON, +}} +pub type LPNMTBSAVE = *mut NMTBSAVE; +STRUCT!{struct NMTBRESTORE { + hdr: NMHDR, + pData: *mut DWORD, + pCurrent: *mut DWORD, + cbData: UINT, + iItem: c_int, + cButtons: c_int, + cbBytesPerRecord: c_int, + tbButton: TBBUTTON, +}} +pub type LPNMTBRESTORE = *mut NMTBRESTORE; +STRUCT!{struct NMTBGETINFOTIPA { + hdr: NMHDR, + pszText: LPSTR, + cchTextMax: c_int, + iItem: c_int, + lParal: LPARAM, +}} +pub type LPNMTBGETINFOTIPA = *mut NMTBGETINFOTIPA; +STRUCT!{struct NMTBGETINFOTIPW { + hdr: NMHDR, + pszText: LPWSTR, + cchTextMax: c_int, + iItem: c_int, + lParal: LPARAM, +}} +pub type LPNMTBGETINFOTIPW = *mut NMTBGETINFOTIPW; +pub const TBNF_IMAGE: DWORD = 0x00000001; +pub const TBNF_TEXT: DWORD = 0x00000002; +pub const TBNF_DI_SETITEM: DWORD = 0x10000000; +STRUCT!{struct NMTBDISPINFOA { + hdr: NMHDR, + dwMask: DWORD, + idCommand: c_int, + lParam: DWORD_PTR, + iImage: c_int, + pszText: LPSTR, + cchText: c_int, +}} +pub type LPNMTBDISPINFOA = *mut NMTBDISPINFOA; +STRUCT!{struct NMTBDISPINFOW { + hdr: NMHDR, + dwMask: DWORD, + idCommand: c_int, + lParam: DWORD_PTR, + iImage: c_int, + pszText: LPWSTR, + cchText: c_int, +}} +pub type LPNMTBDISPINFOW = *mut NMTBDISPINFOW; +pub const TBDDRET_DEFAULT: LRESULT = 0; +pub const TBDDRET_NODEFAULT: LRESULT = 1; +pub const TBDDRET_TREATPRESSED: LRESULT = 2; +pub type TBNOTIFYA = NMTOOLBARA; +pub type TBNOTIFYW = NMTOOLBARW; +pub type LPTBNOTIFYA = LPNMTOOLBARA; +pub type LPTBNOTIFYW = LPNMTOOLBARW; +STRUCT!{struct NMTOOLBARA { + hdr: NMHDR, + iItem: c_int, + tbButton: TBBUTTON, + cchText: c_int, + pszText: LPSTR, + rcButton: RECT, +}} +pub type LPNMTOOLBARA = *mut NMTOOLBARA; +STRUCT!{struct NMTOOLBARW { + hdr: NMHDR, + iItem: c_int, + tbButton: TBBUTTON, + cchText: c_int, + pszText: LPWSTR, + rcButton: RECT, +}} +pub type LPNMTOOLBARW = *mut NMTOOLBARW; +pub const REBARCLASSNAME: &'static str = "ReBarWindow32"; +pub const RBIM_IMAGELIST: UINT = 0x00000001; +pub const RBS_TOOLTIPS: DWORD = 0x00000100; +pub const RBS_VARHEIGHT: DWORD = 0x00000200; +pub const RBS_BANDBORDERS: DWORD = 0x00000400; +pub const RBS_FIXEDORDER: DWORD = 0x00000800; +pub const RBS_REGISTERDROP: DWORD = 0x00001000; +pub const RBS_AUTOSIZE: DWORD = 0x00002000; +pub const RBS_VERTICALGRIPPER: DWORD = 0x00004000; +pub const RBS_DBLCLKTOGGLE: DWORD = 0x00008000; +STRUCT!{struct REBARINFO { + cbSize: UINT, + fMask: UINT, + himl: HIMAGELIST, +}} +pub type LPREBARINFO = *mut REBARINFO; +pub const RBBS_BREAK: UINT = 0x00000001; +pub const RBBS_FIXEDSIZE: UINT = 0x00000002; +pub const RBBS_CHILDEDGE: UINT = 0x00000004; +pub const RBBS_HIDDEN: UINT = 0x00000008; +pub const RBBS_NOVERT: UINT = 0x00000010; +pub const RBBS_FIXEDBMP: UINT = 0x00000020; +pub const RBBS_VARIABLEHEIGHT: UINT = 0x00000040; +pub const RBBS_GRIPPERALWAYS: UINT = 0x00000080; +pub const RBBS_NOGRIPPER: UINT = 0x00000100; +pub const RBBS_USECHEVRON: UINT = 0x00000200; +pub const RBBS_HIDETITLE: UINT = 0x00000400; +pub const RBBS_TOPALIGN: UINT = 0x00000800; +pub const RBBIM_STYLE: UINT = 0x00000001; +pub const RBBIM_COLORS: UINT = 0x00000002; +pub const RBBIM_TEXT: UINT = 0x00000004; +pub const RBBIM_IMAGE: UINT = 0x00000008; +pub const RBBIM_CHILD: UINT = 0x00000010; +pub const RBBIM_CHILDSIZE: UINT = 0x00000020; +pub const RBBIM_SIZE: UINT = 0x00000040; +pub const RBBIM_BACKGROUND: UINT = 0x00000080; +pub const RBBIM_ID: UINT = 0x00000100; +pub const RBBIM_IDEALSIZE: UINT = 0x00000200; +pub const RBBIM_LPARAM: UINT = 0x00000400; +pub const RBBIM_HEADERSIZE: UINT = 0x00000800; +pub const RBBIM_CHEVRONLOCATION: UINT = 0x00001000; +pub const RBBIM_CHEVRONSTATE: UINT = 0x00002000; +STRUCT!{struct REBARBANDINFOA { + cbSize: UINT, + fMask: UINT, + fStyle: UINT, + clrFore: COLORREF, + clrBack: COLORREF, + lpText: LPSTR, + cch: UINT, + iImage: c_int, + hwndChild: HWND, + cxMinChild: UINT, + cyMinChild: UINT, + cx: UINT, + hbmBack: HBITMAP, + wID: UINT, + cyChild: UINT, + cyMaxChild: UINT, + cyIntegral: UINT, + cxIdeal: UINT, + lParam: LPARAM, + cxHeader: UINT, + rcChevronLocation: RECT, + uChevronState: UINT, +}} +pub type LPREBARBANDINFOA = *mut REBARBANDINFOA; +pub type LPCREBARBANDINFOA = *const REBARBANDINFOA; +STRUCT!{struct REBARBANDINFOW { + cbSize: UINT, + fMask: UINT, + fStyle: UINT, + clrFore: COLORREF, + clrBack: COLORREF, + lpText: LPWSTR, + cch: UINT, + iImage: c_int, + hwndChild: HWND, + cxMinChild: UINT, + cyMinChild: UINT, + cx: UINT, + hbmBack: HBITMAP, + wID: UINT, + cyChild: UINT, + cyMaxChild: UINT, + cyIntegral: UINT, + cxIdeal: UINT, + lParam: LPARAM, + cxHeader: UINT, + rcChevronLocation: RECT, + uChevronState: UINT, +}} +pub type LPREBARBANDINFOW = *mut REBARBANDINFOW; +pub type LPCREBARBANDINFOW = *const REBARBANDINFOW; +pub const RB_INSERTBANDA: UINT = WM_USER + 1; +pub const RB_DELETEBAND: UINT = WM_USER + 2; +pub const RB_GETBARINFO: UINT = WM_USER + 3; +pub const RB_SETBARINFO: UINT = WM_USER + 4; +pub const RB_SETBANDINFOA: UINT = WM_USER + 6; +pub const RB_SETPARENT: UINT = WM_USER + 7; +pub const RB_HITTEST: UINT = WM_USER + 8; +pub const RB_GETRECT: UINT = WM_USER + 9; +pub const RB_INSERTBANDW: UINT = WM_USER + 10; +pub const RB_SETBANDINFOW: UINT = WM_USER + 11; +pub const RB_GETBANDCOUNT: UINT = WM_USER + 12; +pub const RB_GETROWCOUNT: UINT = WM_USER + 13; +pub const RB_GETROWHEIGHT: UINT = WM_USER + 14; +pub const RB_IDTOINDEX: UINT = WM_USER + 16; +pub const RB_GETTOOLTIPS: UINT = WM_USER + 17; +pub const RB_SETTOOLTIPS: UINT = WM_USER + 18; +pub const RB_SETBKCOLOR: UINT = WM_USER + 19; +pub const RB_GETBKCOLOR: UINT = WM_USER + 20; +pub const RB_SETTEXTCOLOR: UINT = WM_USER + 21; +pub const RB_GETTEXTCOLOR: UINT = WM_USER + 22; +pub const RBSTR_CHANGERECT: WPARAM = 0x0001; +pub const RB_SIZETORECT: UINT = WM_USER + 23; +pub const RB_SETCOLORSCHEME: UINT = CCM_SETCOLORSCHEME; +pub const RB_GETCOLORSCHEME: UINT = CCM_GETCOLORSCHEME; +pub const RB_BEGINDRAG: UINT = WM_USER + 24; +pub const RB_ENDDRAG: UINT = WM_USER + 25; +pub const RB_DRAGMOVE: UINT = WM_USER + 26; +pub const RB_GETBARHEIGHT: UINT = WM_USER + 27; +pub const RB_GETBANDINFOW: UINT = WM_USER + 28; +pub const RB_GETBANDINFOA: UINT = WM_USER + 29; +pub const RB_MINIMIZEBAND: UINT = WM_USER + 30; +pub const RB_MAXIMIZEBAND: UINT = WM_USER + 31; +pub const RB_GETDROPTARGET: UINT = CCM_GETDROPTARGET; +pub const RB_GETBANDBORDERS: UINT = WM_USER + 34; +pub const RB_SHOWBAND: UINT = WM_USER + 35; +pub const RB_SETPALETTE: UINT = WM_USER + 37; +pub const RB_GETPALETTE: UINT = WM_USER + 38; +pub const RB_MOVEBAND: UINT = WM_USER + 39; +pub const RB_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const RB_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const RB_GETBANDMARGINS: UINT = WM_USER + 40; +pub const RB_SETWINDOWTHEME: UINT = CCM_SETWINDOWTHEME; +pub const RB_SETEXTENDEDSTYLE: UINT = WM_USER + 41; +pub const RB_GETEXTENDEDSTYLE: UINT = WM_USER + 42; +pub const RB_PUSHCHEVRON: UINT = WM_USER + 43; +pub const RB_SETBANDWIDTH: UINT = WM_USER + 44; +pub const RBN_HEIGHTCHANGE: UINT = RBN_FIRST - 0; +pub const RBN_GETOBJECT: UINT = RBN_FIRST - 1; +pub const RBN_LAYOUTCHANGED: UINT = RBN_FIRST - 2; +pub const RBN_AUTOSIZE: UINT = RBN_FIRST - 3; +pub const RBN_BEGINDRAG: UINT = RBN_FIRST - 4; +pub const RBN_ENDDRAG: UINT = RBN_FIRST - 5; +pub const RBN_DELETINGBAND: UINT = RBN_FIRST - 6; +pub const RBN_DELETEDBAND: UINT = RBN_FIRST - 7; +pub const RBN_CHILDSIZE: UINT = RBN_FIRST - 8; +pub const RBN_CHEVRONPUSHED: UINT = RBN_FIRST - 10; +pub const RBN_SPLITTERDRAG: UINT = RBN_FIRST - 11; +pub const RBN_MINMAX: UINT = RBN_FIRST - 21; +pub const RBN_AUTOBREAK: UINT = RBN_FIRST - 22; +STRUCT!{struct NMREBARCHILDSIZE { + hdr: NMHDR, + uBand: UINT, + wID: UINT, + rcChild: RECT, + rcBand: RECT, +}} +pub type LPNMREBARCHILDSIZE = *mut NMREBARCHILDSIZE; +STRUCT!{struct NMREBAR { + hdr: NMHDR, + dwMask: DWORD, + uBand: UINT, + fStyle: UINT, + wID: UINT, + lParam: LPARAM, +}} +pub type LPNMREBAR = *mut NMREBAR; +pub const RBNM_ID: DWORD = 0x00000001; +pub const RBNM_STYLE: DWORD = 0x00000002; +pub const RBNM_LPARAM: DWORD = 0x00000004; +STRUCT!{struct NMRBAUTOSIZE { + hdr: NMHDR, + fChanged: BOOL, + rcTarget: RECT, + rcActual: RECT, +}} +pub type LPNMRBAUTOSIZE = *mut NMRBAUTOSIZE; +STRUCT!{struct NMREBARCHEVRON { + hdr: NMHDR, + uBand: UINT, + wID: UINT, + lParam: LPARAM, + rc: RECT, + lParamNM: LPARAM, +}} +pub type LPNMREBARCHEVRON = *mut NMREBARCHEVRON; +STRUCT!{struct NMREBARSPLITTER { + hdr: NMHDR, + rcSizing: RECT, +}} +pub type LPNMREBARSPLITTER = *mut NMREBARSPLITTER; +pub const RBAB_AUTOSIZE: UINT = 0x0001; +pub const RBAB_ADDBAND: UINT = 0x0002; +STRUCT!{struct NMREBARAUTOBREAK { + hdr: NMHDR, + uBand: UINT, + wID: UINT, + lParam: LPARAM, + uMsg: UINT, + fStyleCurrent: UINT, + fAutoBreak: UINT, +}} +pub type LPNMREBARAUTOBREAK = *mut NMREBARAUTOBREAK; +pub const RBHT_NOWHERE: UINT = 0x0001; +pub const RBHT_CAPTION: UINT = 0x0002; +pub const RBHT_CLIENT: UINT = 0x0003; +pub const RBHT_GRABBER: UINT = 0x0004; +pub const RBHT_CHEVRON: UINT = 0x0008; +pub const RBHT_SPLITTER: UINT = 0x0010; +STRUCT!{struct RBHITTESTINFO { + pt: POINT, + flags: UINT, + iBand: c_int, +}} +pub type LPRBHITTESTINFO = *mut RBHITTESTINFO; +pub const TOOLTIPS_CLASS: &'static str = "tooltips_class32"; +pub type LPTOOLINFOA = LPTTTOOLINFOA; +pub type LPTOOLINFOW = LPTTTOOLINFOW; +pub type TOOLINFOA = TTTOOLINFOA; +pub type TOOLINFOW = TTTOOLINFOW; +STRUCT!{struct TTTOOLINFOA { + cbSize: UINT, + uFlags: UINT, + hwnd: HWND, + uId: UINT_PTR, + rect: RECT, + hinst: HINSTANCE, + lpszText: LPSTR, + lParam: LPARAM, + lpReserved: *mut c_void, +}} +pub type PTTTOOLINFOA = *mut TTTOOLINFOA; +pub type LPTTTOOLINFOA = *mut TTTOOLINFOA; +STRUCT!{struct TTTOOLINFOW { + cbSize: UINT, + uFlags: UINT, + hwnd: HWND, + uId: UINT_PTR, + rect: RECT, + hinst: HINSTANCE, + lpszText: LPWSTR, + lParam: LPARAM, + lpReserved: *mut c_void, +}} +pub type PTTTOOLINFOW = *mut TTTOOLINFOW; +pub type LPTTTOOLINFOW = *mut TTTOOLINFOW; +pub const TTS_ALWAYSTIP: DWORD = 0x01; +pub const TTS_NOPREFIX: DWORD = 0x02; +pub const TTS_NOANIMATE: DWORD = 0x10; +pub const TTS_NOFADE: DWORD = 0x20; +pub const TTS_BALLOON: DWORD = 0x40; +pub const TTS_CLOSE: DWORD = 0x80; +pub const TTS_USEVISUALSTYLE: DWORD = 0x100; +pub const TTF_IDISHWND: UINT = 0x0001; +pub const TTF_CENTERTIP: UINT = 0x0002; +pub const TTF_RTLREADING: UINT = 0x0004; +pub const TTF_SUBCLASS: UINT = 0x0010; +pub const TTF_TRACK: UINT = 0x0020; +pub const TTF_ABSOLUTE: UINT = 0x0080; +pub const TTF_TRANSPARENT: UINT = 0x0100; +pub const TTF_PARSELINKS: UINT = 0x1000; +pub const TTF_DI_SETITEM: UINT = 0x8000; +pub const TTDT_AUTOMATIC: WPARAM = 0; +pub const TTDT_RESHOW: WPARAM = 1; +pub const TTDT_AUTOPOP: WPARAM = 2; +pub const TTDT_INITIAL: WPARAM = 3; +pub const TTI_NONE: WPARAM = 0; +pub const TTI_INFO: WPARAM = 1; +pub const TTI_WARNING: WPARAM = 2; +pub const TTI_ERROR: WPARAM = 3; +pub const TTI_INFO_LARGE: WPARAM = 4; +pub const TTI_WARNING_LARGE: WPARAM = 5; +pub const TTI_ERROR_LARGE: WPARAM = 6; +pub const TTM_ACTIVATE: UINT = WM_USER + 1; +pub const TTM_SETDELAYTIME: UINT = WM_USER + 3; +pub const TTM_ADDTOOLA: UINT = WM_USER + 4; +pub const TTM_ADDTOOLW: UINT = WM_USER + 50; +pub const TTM_DELTOOLA: UINT = WM_USER + 5; +pub const TTM_DELTOOLW: UINT = WM_USER + 51; +pub const TTM_NEWTOOLRECTA: UINT = WM_USER + 6; +pub const TTM_NEWTOOLRECTW: UINT = WM_USER + 52; +pub const TTM_RELAYEVENT: UINT = WM_USER + 7; +pub const TTM_GETTOOLINFOA: UINT = WM_USER + 8; +pub const TTM_GETTOOLINFOW: UINT = WM_USER + 53; +pub const TTM_SETTOOLINFOA: UINT = WM_USER + 9; +pub const TTM_SETTOOLINFOW: UINT = WM_USER + 54; +pub const TTM_HITTESTA: UINT = WM_USER + 10; +pub const TTM_HITTESTW: UINT = WM_USER + 55; +pub const TTM_GETTEXTA: UINT = WM_USER + 11; +pub const TTM_GETTEXTW: UINT = WM_USER + 56; +pub const TTM_UPDATETIPTEXTA: UINT = WM_USER + 12; +pub const TTM_UPDATETIPTEXTW: UINT = WM_USER + 57; +pub const TTM_GETTOOLCOUNT: UINT = WM_USER + 13; +pub const TTM_ENUMTOOLSA: UINT = WM_USER + 14; +pub const TTM_ENUMTOOLSW: UINT = WM_USER + 58; +pub const TTM_GETCURRENTTOOLA: UINT = WM_USER + 15; +pub const TTM_GETCURRENTTOOLW: UINT = WM_USER + 59; +pub const TTM_WINDOWFROMPOINT: UINT = WM_USER + 16; +pub const TTM_TRACKACTIVATE: UINT = WM_USER + 17; +pub const TTM_TRACKPOSITION: UINT = WM_USER + 18; +pub const TTM_SETTIPBKCOLOR: UINT = WM_USER + 19; +pub const TTM_SETTIPTEXTCOLOR: UINT = WM_USER + 20; +pub const TTM_GETDELAYTIME: UINT = WM_USER + 21; +pub const TTM_GETTIPBKCOLOR: UINT = WM_USER + 22; +pub const TTM_GETTIPTEXTCOLOR: UINT = WM_USER + 23; +pub const TTM_SETMAXTIPWIDTH: UINT = WM_USER + 24; +pub const TTM_GETMAXTIPWIDTH: UINT = WM_USER + 25; +pub const TTM_SETMARGIN: UINT = WM_USER + 26; +pub const TTM_GETMARGIN: UINT = WM_USER + 27; +pub const TTM_POP: UINT = WM_USER + 28; +pub const TTM_UPDATE: UINT = WM_USER + 29; +pub const TTM_GETBUBBLESIZE: UINT = WM_USER + 30; +pub const TTM_ADJUSTRECT: UINT = WM_USER + 31; +pub const TTM_SETTITLEA: UINT = WM_USER + 32; +pub const TTM_SETTITLEW: UINT = WM_USER + 33; +pub const TTM_POPUP: UINT = WM_USER + 34; +pub const TTM_GETTITLE: UINT = WM_USER + 35; +STRUCT!{struct TTGETTITLE { + dwSize: DWORD, + uTitleBitmap: UINT, + cch: UINT, + pszTitle: *mut WCHAR, +}} +pub type LPTTGETTITLE = *mut TTGETTITLE; +pub const TTM_SETWINDOWTHEME: UINT = CCM_SETWINDOWTHEME; +pub type LPHITTESTINFOW = LPTTHITTESTINFOW; +pub type LPHITTESTINFOA = LPTTHITTESTINFOA; +STRUCT!{struct TTHITTESTINFOA { + hwnd: HWND, + pt: POINT, + ti: TTTOOLINFOA, +}} +pub type LPTTHITTESTINFOA = *mut TTHITTESTINFOA; +STRUCT!{struct TTHITTESTINFOW { + hwnd: HWND, + pt: POINT, + ti: TTTOOLINFOW, +}} +pub type LPTTHITTESTINFOW = *mut TTHITTESTINFOW; +pub const TTN_GETDISPINFOA: UINT = TTN_FIRST - 0; +pub const TTN_GETDISPINFOW: UINT = TTN_FIRST - 10; +pub const TTN_SHOW: UINT = TTN_FIRST - 1; +pub const TTN_POP: UINT = TTN_FIRST - 2; +pub const TTN_LINKCLICK: UINT = TTN_FIRST - 3; +pub const TTN_NEEDTEXTA: UINT = TTN_GETDISPINFOA; +pub const TTN_NEEDTEXTW: UINT = TTN_GETDISPINFOW; +pub type TOOLTIPTEXTW = NMTTDISPINFOW; +pub type TOOLTIPTEXTA = NMTTDISPINFOA; +pub type LPTOOLTIPTEXTA = LPNMTTDISPINFOA; +pub type LPTOOLTIPTEXTW = LPNMTTDISPINFOW; +STRUCT!{struct NMTTDISPINFOA { + hdr: NMHDR, + lpszText: LPSTR, + szText: [c_char; 80], + hinst: HINSTANCE, + uFlags: UINT, + lParam: LPARAM, +}} +pub type LPNMTTDISPINFOA = *mut NMTTDISPINFOA; +STRUCT!{struct NMTTDISPINFOW { + hdr: NMHDR, + lpszText: LPWSTR, + szText: [WCHAR; 80], + hinst: HINSTANCE, + uFlags: UINT, + lParam: LPARAM, +}} +pub type LPNMTTDISPINFOW = *mut NMTTDISPINFOW; +pub const SBARS_SIZEGRIP: DWORD = 0x0100; +pub const SBARS_TOOLTIPS: DWORD = 0x0800; +pub const SBT_TOOLTIPS: DWORD = 0x0800; +extern "system" { + pub fn DrawStatusTextA( + hDC: HDC, + lprc: LPCRECT, + pszText: LPCSTR, + uFlags: UINT, + ); + pub fn DrawStatusTextW( + hDC: HDC, + lprc: LPCRECT, + pszText: LPCWSTR, + uFlags: UINT, + ); + pub fn CreateStatusWindowA( + style: LONG, + lpszText: LPCSTR, + hwndParent: HWND, + wID: UINT, + ) -> HWND; + pub fn CreateStatusWindowW( + style: LONG, + lpszText: LPCWSTR, + hwndParent: HWND, + wID: UINT, + ) -> HWND; +} +pub const STATUSCLASSNAME: &'static str = "msctls_statusbar32"; +pub const SB_SETTEXTA: UINT = WM_USER + 1; +pub const SB_SETTEXTW: UINT = WM_USER + 11; +pub const SB_GETTEXTA: UINT = WM_USER + 2; +pub const SB_GETTEXTW: UINT = WM_USER + 13; +pub const SB_GETTEXTLENGTHA: UINT = WM_USER + 3; +pub const SB_GETTEXTLENGTHW: UINT = WM_USER + 12; +pub const SB_SETPARTS: UINT = WM_USER + 4; +pub const SB_GETPARTS: UINT = WM_USER + 6; +pub const SB_GETBORDERS: UINT = WM_USER + 7; +pub const SB_SETMINHEIGHT: UINT = WM_USER + 8; +pub const SB_SIMPLE: UINT = WM_USER + 9; +pub const SB_GETRECT: UINT = WM_USER + 10; +pub const SB_ISSIMPLE: UINT = WM_USER + 14; +pub const SB_SETICON: UINT = WM_USER + 15; +pub const SB_SETTIPTEXTA: UINT = WM_USER + 16; +pub const SB_SETTIPTEXTW: UINT = WM_USER + 17; +pub const SB_GETTIPTEXTA: UINT = WM_USER + 18; +pub const SB_GETTIPTEXTW: UINT = WM_USER + 19; +pub const SB_GETICON: UINT = WM_USER + 20; +pub const SB_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const SB_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const SBT_OWNERDRAW: WPARAM = 0x1000; +pub const SBT_NOBORDERS: WPARAM = 0x0100; +pub const SBT_POPOUT: WPARAM = 0x0200; +pub const SBT_RTLREADING: WPARAM = 0x0400; +pub const SBT_NOTABPARSING: WPARAM = 0x0800; +pub const SB_SETBKCOLOR: UINT = CCM_SETBKCOLOR; +pub const SBN_SIMPLEMODECHANGE: UINT = SBN_FIRST - 0; +pub const SB_SIMPLEID: WPARAM = 0x00ff; +extern "system" { + pub fn MenuHelp( + uMsg: UINT, + wParam: WPARAM, + lParam: LPARAM, + hMainMenu: HMENU, + hInst: HINSTANCE, + hwndStatus: HWND, + lpwIDs: *mut UINT, + ); + pub fn ShowHideMenuCtl( + hWnd: HWND, + uFlags: UINT_PTR, + lpInfo: LPINT, + ) -> BOOL; + pub fn GetEffectiveClientRect( + hWnd: HWND, + lprc: LPRECT, + lpInfo: *const INT, + ); +} +pub const TRACKBAR_CLASS: &'static str = "msctls_trackbar32"; +pub const TBS_AUTOTICKS: DWORD = 0x0001; +pub const TBS_VERT: DWORD = 0x0002; +pub const TBS_HORZ: DWORD = 0x0000; +pub const TBS_TOP: DWORD = 0x0004; +pub const TBS_BOTTOM: DWORD = 0x0000; +pub const TBS_LEFT: DWORD = 0x0004; +pub const TBS_RIGHT: DWORD = 0x0000; +pub const TBS_BOTH: DWORD = 0x0008; +pub const TBS_NOTICKS: DWORD = 0x0010; +pub const TBS_ENABLESELRANGE: DWORD = 0x0020; +pub const TBS_FIXEDLENGTH: DWORD = 0x0040; +pub const TBS_NOTHUMB: DWORD = 0x0080; +pub const TBS_TOOLTIPS: DWORD = 0x0100; +pub const TBS_REVERSED: DWORD = 0x0200; +pub const TBS_DOWNISLEFT: DWORD = 0x0400; +pub const TBS_NOTIFYBEFOREMOVE: DWORD = 0x0800; +pub const TBS_TRANSPARENTBKGND: DWORD = 0x1000; +pub const TBM_GETPOS: UINT = WM_USER; +pub const TBM_GETRANGEMIN: UINT = WM_USER + 1; +pub const TBM_GETRANGEMAX: UINT = WM_USER + 2; +pub const TBM_GETTIC: UINT = WM_USER + 3; +pub const TBM_SETTIC: UINT = WM_USER + 4; +pub const TBM_SETPOS: UINT = WM_USER + 5; +pub const TBM_SETRANGE: UINT = WM_USER + 6; +pub const TBM_SETRANGEMIN: UINT = WM_USER + 7; +pub const TBM_SETRANGEMAX: UINT = WM_USER + 8; +pub const TBM_CLEARTICS: UINT = WM_USER + 9; +pub const TBM_SETSEL: UINT = WM_USER + 10; +pub const TBM_SETSELSTART: UINT = WM_USER + 11; +pub const TBM_SETSELEND: UINT = WM_USER + 12; +pub const TBM_GETPTICS: UINT = WM_USER + 14; +pub const TBM_GETTICPOS: UINT = WM_USER + 15; +pub const TBM_GETNUMTICS: UINT = WM_USER + 16; +pub const TBM_GETSELSTART: UINT = WM_USER + 17; +pub const TBM_GETSELEND: UINT = WM_USER + 18; +pub const TBM_CLEARSEL: UINT = WM_USER + 19; +pub const TBM_SETTICFREQ: UINT = WM_USER + 20; +pub const TBM_SETPAGESIZE: UINT = WM_USER + 21; +pub const TBM_GETPAGESIZE: UINT = WM_USER + 22; +pub const TBM_SETLINESIZE: UINT = WM_USER + 23; +pub const TBM_GETLINESIZE: UINT = WM_USER + 24; +pub const TBM_GETTHUMBRECT: UINT = WM_USER + 25; +pub const TBM_GETCHANNELRECT: UINT = WM_USER + 26; +pub const TBM_SETTHUMBLENGTH: UINT = WM_USER + 27; +pub const TBM_GETTHUMBLENGTH: UINT = WM_USER + 28; +pub const TBM_SETTOOLTIPS: UINT = WM_USER + 29; +pub const TBM_GETTOOLTIPS: UINT = WM_USER + 30; +pub const TBM_SETTIPSIDE: UINT = WM_USER + 31; +pub const TBTS_TOP: WPARAM = 0; +pub const TBTS_LEFT: WPARAM = 1; +pub const TBTS_BOTTOM: WPARAM = 2; +pub const TBTS_RIGHT: WPARAM = 3; +pub const TBM_SETBUDDY: UINT = WM_USER + 32; +pub const TBM_GETBUDDY: UINT = WM_USER + 33; +pub const TBM_SETPOSNOTIFY: UINT = WM_USER + 34; +pub const TBM_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const TBM_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const TB_LINEUP: WPARAM = 0; +pub const TB_LINEDOWN: WPARAM = 1; +pub const TB_PAGEUP: WPARAM = 2; +pub const TB_PAGEDOWN: WPARAM = 3; +pub const TB_THUMBPOSITION: WPARAM = 4; +pub const TB_THUMBTRACK: WPARAM = 5; +pub const TB_TOP: WPARAM = 6; +pub const TB_BOTTOM: WPARAM = 7; +pub const TB_ENDTRACK: WPARAM = 8; +pub const TBCD_TICS: DWORD_PTR = 0x0001; +pub const TBCD_THUMB: DWORD_PTR = 0x0001; +pub const TBCD_CHANNEL: DWORD_PTR = 0x0001; +pub const TRBN_THUMBPOSCHANGING: UINT = TRBN_FIRST - 1; +STRUCT!{struct NMTRBTHUMBPOSCHANGING { + hdr: NMHDR, + dwPos: DWORD, + nReason: c_int, +}} +STRUCT!{struct DRAGLISTINFO { + uNotification: UINT, + hWnd: HWND, + ptCursor: POINT, +}} +pub type LPDRAGLISTINFO = *mut DRAGLISTINFO; +pub const DL_BEGINDRAG: UINT = WM_USER + 133; +pub const DL_DRAGGING: UINT = WM_USER + 134; +pub const DL_DROPPED: UINT = WM_USER + 135; +pub const DL_CANCELDRAG: UINT = WM_USER + 136; +pub const DL_CURSORSET: UINT = 0; +pub const DL_STOPCURSOR: UINT = 1; +pub const DL_COPYCURSOR: UINT = 2; +pub const DL_MOVECURSOR: UINT = 3; +pub const DRAGLISTMSGSTRING: &'static str = "commctrl_DragListMsg"; +extern "system" { + pub fn MakeDragList( + hLB: HWND, + ) -> BOOL; + pub fn DrawInsert( + handParent: HWND, + hLB: HWND, + nItem: c_int, + ); + pub fn LBItemFromPt( + hLB: HWND, + pt: POINT, + bAutoScroll: BOOL, + ) -> c_int; +} +pub const UPDOWN_CLASS: &'static str = "msctls_updown32"; +STRUCT!{struct UDACCEL { + nSec: UINT, + nInc: UINT, +}} +pub type LPUDACCEL = *mut UDACCEL; +pub const UD_MAXVAL: c_short = 0x7fff; +pub const UD_MINVAL: c_short = 0 - UD_MAXVAL; +pub const UDS_WRAP: DWORD = 0x0001; +pub const UDS_SETBUDDYINT: DWORD = 0x0002; +pub const UDS_ALIGNRIGHT: DWORD = 0x0004; +pub const UDS_ALIGNLEFT: DWORD = 0x0008; +pub const UDS_AUTOBUDDY: DWORD = 0x0010; +pub const UDS_ARROWKEYS: DWORD = 0x0020; +pub const UDS_HORZ: DWORD = 0x0040; +pub const UDS_NOTHOUSANDS: DWORD = 0x0080; +pub const UDS_HOTTRACK: DWORD = 0x0100; +pub const UDM_SETRANGE: UINT = WM_USER + 101; +pub const UDM_GETRANGE: UINT = WM_USER + 102; +pub const UDM_SETPOS: UINT = WM_USER + 103; +pub const UDM_GETPOS: UINT = WM_USER + 104; +pub const UDM_SETBUDDY: UINT = WM_USER + 105; +pub const UDM_GETBUDDY: UINT = WM_USER + 106; +pub const UDM_SETACCEL: UINT = WM_USER + 107; +pub const UDM_GETACCEL: UINT = WM_USER + 108; +pub const UDM_SETBASE: UINT = WM_USER + 109; +pub const UDM_GETBASE: UINT = WM_USER + 110; +pub const UDM_SETRANGE32: UINT = WM_USER + 111; +pub const UDM_GETRANGE32: UINT = WM_USER + 112; +pub const UDM_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const UDM_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const UDM_SETPOS32: UINT = WM_USER + 113; +pub const UDM_GETPOS32: UINT = WM_USER + 114; +extern "system" { + pub fn CreateUpDownControl( + dwStyle: DWORD, + x: c_int, + y: c_int, + cx: c_int, + cy: c_int, + hParent: HWND, + nID: c_int, + hInst: HINSTANCE, + nBuddy: HWND, + nUpper: c_int, + nLower: c_int, + nPos: c_int, + ) -> HWND; +} +pub type NM_UPDOWN = NMUPDOWN; +pub type LPNM_UPDOWN = LPNMUPDOWN; +STRUCT!{struct NMUPDOWN { + hdr: NMHDR, + iPos: c_int, + iDelta: c_int, +}} +pub type LPNMUPDOWN = *mut NMUPDOWN; +pub const UDN_DELTAPOS: UINT = UDN_FIRST - 1; +pub const PROGRESS_CLASS: &'static str = "msctls_progress32"; +pub const PBS_SMOOTH: DWORD = 0x01; +pub const PBS_VERTICAL: DWORD = 0x04; +pub const PBM_SETRANGE: UINT = WM_USER + 1; +pub const PBM_SETPOS: UINT = WM_USER + 2; +pub const PBM_DELTAPOS: UINT = WM_USER + 3; +pub const PBM_SETSTEP: UINT = WM_USER + 4; +pub const PBM_STEPIT: UINT = WM_USER + 5; +pub const PBM_SETRANGE32: UINT = WM_USER + 6; +STRUCT!{struct PBRANGE { + iLow: c_int, + iHigh: c_int, +}} +pub type LPPBRANGE = *mut PBRANGE; +pub const PBM_GETRANGE: UINT = WM_USER + 7; +pub const PBM_GETPOS: UINT = WM_USER + 8; +pub const PBM_SETBARCOLOR: UINT = WM_USER + 9; +pub const PBM_SETBKCOLOR: UINT = CCM_SETBKCOLOR; +pub const PBS_MARQUEE: DWORD = 0x08; +pub const PBM_SETMARQUEE: UINT = WM_USER + 10; +pub const PBS_SMOOTHREVERSE: DWORD = 0x10; +pub const PBM_GETSTEP: UINT = WM_USER + 13; +pub const PBM_GETBKCOLOR: UINT = WM_USER + 14; +pub const PBM_GETBARCOLOR: UINT = WM_USER + 15; +pub const PBM_SETSTATE: UINT = WM_USER + 16; +pub const PBM_GETSTATE: UINT = WM_USER + 17; +pub const PBST_NORMAL: c_int = 0x0001; +pub const PBST_ERROR: c_int = 0x0002; +pub const PBST_PAUSED: c_int = 0x0003; +pub const HOTKEYF_SHIFT: BYTE = 0x01; +pub const HOTKEYF_CONTROL: BYTE = 0x02; +pub const HOTKEYF_ALT: BYTE = 0x04; +pub const HOTKEYF_EXT: BYTE = 0x08; +pub const HKCOMB_NONE: WPARAM = 0x0001; +pub const HKCOMB_S: WPARAM = 0x0002; +pub const HKCOMB_C: WPARAM = 0x0004; +pub const HKCOMB_A: WPARAM = 0x0008; +pub const HKCOMB_SC: WPARAM = 0x0010; +pub const HKCOMB_SA: WPARAM = 0x0020; +pub const HKCOMB_CA: WPARAM = 0x0040; +pub const HKCOMB_SCA: WPARAM = 0x0080; +pub const HKM_SETHOTKEY: UINT = WM_USER + 1; +pub const HKM_GETHOTKEY: UINT = WM_USER + 2; +pub const HKM_SETRULES: UINT = WM_USER + 3; +pub const HOTKEY_CLASS: &'static str = "msctls_hotkey32"; +pub const CCS_TOP: DWORD = 0x00000001; +pub const CCS_NOMOVEY: DWORD = 0x00000002; +pub const CCS_BOTTOM: DWORD = 0x00000003; +pub const CCS_NORESIZE: DWORD = 0x00000004; +pub const CCS_NOPARENTALIGN: DWORD = 0x00000008; +pub const CCS_ADJUSTABLE: DWORD = 0x00000020; +pub const CCS_NODIVIDER: DWORD = 0x00000040; +pub const CCS_VERT: DWORD = 0x00000080; +pub const CCS_LEFT: DWORD = CCS_VERT | CCS_TOP; +pub const CCS_RIGHT: DWORD = CCS_VERT | CCS_BOTTOM; +pub const CCS_NOMOVEX: DWORD = CCS_VERT | CCS_NOMOVEY; +pub const INVALID_LINK_INDEX: c_int = -1; +pub const MAX_LINKID_TEXT: usize = 48; +pub const L_MAX_URL_LENGTH: usize = 2048 + 32 + 4; +pub const WC_LINK: &'static str = "SysLink"; +pub const LWS_TRANSPARENT: DWORD = 0x0001; +pub const LWS_IGNORERETURN: DWORD = 0x0002; +pub const LWS_NOPREFIX: DWORD = 0x0004; +pub const LWS_USEVISUALSTYLE: DWORD = 0x0008; +pub const LWS_USECUSTOMTEXT: DWORD = 0x0010; +pub const LWS_RIGHT: DWORD = 0x0020; +pub const LIF_ITEMINDEX: UINT = 0x00000001; +pub const LIF_STATE: UINT = 0x00000002; +pub const LIF_ITEMID: UINT = 0x00000004; +pub const LIF_URL: UINT = 0x00000008; +pub const LIS_FOCUSED: UINT = 0x00000001; +pub const LIS_ENABLED: UINT = 0x00000002; +pub const LIS_VISITED: UINT = 0x00000004; +pub const LIS_HOTTRACK: UINT = 0x00000008; +pub const LIS_DEFAULTCOLORS: UINT = 0x00000010; +STRUCT!{struct LITEM { + mask: UINT, + iLink: c_int, + state: UINT, + stateMask: UINT, + szID: [WCHAR; MAX_LINKID_TEXT], + szUrl: [WCHAR; L_MAX_URL_LENGTH], +}} +pub type PLITEM = *mut LITEM; +STRUCT!{struct LHITTESTINFO { + pt: POINT, + item: LITEM, +}} +pub type PLHITTESTINFO = *mut LHITTESTINFO; +STRUCT!{struct NMLINK { + hdr: NMHDR, + item: LITEM, +}} +pub type PNMLINK = *mut NMLINK; +pub const LM_HITTEST: UINT = WM_USER + 0x300; +pub const LM_GETIDEALHEIGHT: UINT = WM_USER + 0x301; +pub const LM_SETITEM: UINT = WM_USER + 0x302; +pub const LM_GETITEM: UINT = WM_USER + 0x303; +pub const LM_GETIDEALSIZE: UINT = LM_GETIDEALHEIGHT; +pub const WC_LISTVIEW: &'static str = "SysListView32"; +pub const LVS_ICON: DWORD = 0x0000; +pub const LVS_REPORT: DWORD = 0x0001; +pub const LVS_SMALLICON: DWORD = 0x0002; +pub const LVS_LIST: DWORD = 0x0003; +pub const LVS_TYPEMASK: DWORD = 0x0003; +pub const LVS_SINGLESEL: DWORD = 0x0004; +pub const LVS_SHOWSELALWAYS: DWORD = 0x0008; +pub const LVS_SORTASCENDING: DWORD = 0x0010; +pub const LVS_SORTDESCENDING: DWORD = 0x0020; +pub const LVS_SHAREIMAGELISTS: DWORD = 0x0040; +pub const LVS_NOLABELWRAP: DWORD = 0x0080; +pub const LVS_AUTOARRANGE: DWORD = 0x0100; +pub const LVS_EDITLABELS: DWORD = 0x0200; +pub const LVS_OWNERDATA: DWORD = 0x1000; +pub const LVS_NOSCROLL: DWORD = 0x2000; +pub const LVS_TYPESTYLEMASK: DWORD = 0xfc00; +pub const LVS_ALIGNTOP: DWORD = 0x0000; +pub const LVS_ALIGNLEFT: DWORD = 0x0800; +pub const LVS_ALIGNMASK: DWORD = 0x0c00; +pub const LVS_OWNERDRAWFIXED: DWORD = 0x0400; +pub const LVS_NOCOLUMNHEADER: DWORD = 0x4000; +pub const LVS_NOSORTHEADER: DWORD = 0x8000; +pub const LVM_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const LVM_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const LVM_GETBKCOLOR: UINT = LVM_FIRST + 0; +pub const LVM_SETBKCOLOR: UINT = LVM_FIRST + 1; +pub const LVM_GETIMAGELIST: UINT = LVM_FIRST + 2; +pub const LVSIL_NORMAL: c_int = 0; +pub const LVSIL_SMALL: c_int = 1; +pub const LVSIL_STATE: c_int = 2; +pub const LVSIL_GROUPHEADER: c_int = 3; +pub const LVM_SETIMAGELIST: UINT = LVM_FIRST + 3; +pub const LVM_GETITEMCOUNT: UINT = LVM_FIRST + 4; +pub const LVIF_TEXT: UINT = 0x00000001; +pub const LVIF_IMAGE: UINT = 0x00000002; +pub const LVIF_PARAM: UINT = 0x00000004; +pub const LVIF_STATE: UINT = 0x00000008; +pub const LVIF_INDENT: UINT = 0x00000010; +pub const LVIF_NORECOMPUTE: UINT = 0x00000800; +pub const LVIF_GROUPID: UINT = 0x00000100; +pub const LVIF_COLUMNS: UINT = 0x00000200; +pub const LVIF_COLFMT: UINT = 0x00010000; +pub const LVIS_FOCUSED: UINT = 0x0001; +pub const LVIS_SELECTED: UINT = 0x0002; +pub const LVIS_CUT: UINT = 0x0004; +pub const LVIS_DROPHILITED: UINT = 0x0008; +pub const LVIS_GLOW: UINT = 0x0010; +pub const LVIS_ACTIVATING: UINT = 0x0020; +pub const LVIS_OVERLAYMASK: UINT = 0x0F00; +pub const LVIS_STATEIMAGEMASK: UINT = 0xF000; +#[inline] +pub fn INDEXTOSTATEIMAGEMASK(i: UINT) -> UINT { + i << 12 +} +pub const I_INDENTCALLBACK: c_int = -1; +pub type LV_ITEMA = LVITEMA; +pub type LV_ITEMW = LVITEMW; +pub const I_GROUPIDCALLBACK: c_int = -1; +pub const I_GROUPIDNONE: c_int = -2; +STRUCT!{struct LVITEMA { + mask: UINT, + iItem: c_int, + iSubItem: c_int, + state: UINT, + stateMask: UINT, + pszText: LPSTR, + cchTextMax: c_int, + iImage: c_int, + lParam: LPARAM, + iIndent: c_int, + iGroupId: c_int, + cColumns: UINT, + puColumns: PUINT, + piColFmt: *mut c_int, + iGroup: c_int, +}} +pub type LPLVITEMA = *mut LVITEMA; +STRUCT!{struct LVITEMW { + mask: UINT, + iItem: c_int, + iSubItem: c_int, + state: UINT, + stateMask: UINT, + pszText: LPWSTR, + cchTextMax: c_int, + iImage: c_int, + lParam: LPARAM, + iIndent: c_int, + iGroupId: c_int, + cColumns: UINT, + puColumns: PUINT, + piColFmt: *mut c_int, + iGroup: c_int, +}} +pub type LPLVITEMW = *mut LVITEMW; +pub const LPSTR_TEXTCALLBACKW: LPWSTR = -1isize as LPWSTR; +pub const LPSTR_TEXTCALLBACKA: LPSTR = -1isize as LPSTR; +pub const I_IMAGECALLBACK: c_int = -1; +pub const I_IMAGENONE: c_int = -2; +pub const I_COLUMNSCALLBACK: UINT = -1i32 as u32; +pub const LVM_GETITEMA: UINT = LVM_FIRST + 5; +pub const LVM_GETITEMW: UINT = LVM_FIRST + 75; +pub const LVM_SETITEMA: UINT = LVM_FIRST + 6; +pub const LVM_SETITEMW: UINT = LVM_FIRST + 76; +pub const LVM_INSERTITEMA: UINT = LVM_FIRST + 7; +pub const LVM_INSERTITEMW: UINT = LVM_FIRST + 77; +pub const LVM_DELETEITEM: UINT = LVM_FIRST + 8; +pub const LVM_DELETEALLITEMS: UINT = LVM_FIRST + 9; +pub const LVM_GETCALLBACKMASK: UINT = LVM_FIRST + 10; +pub const LVM_SETCALLBACKMASK: UINT = LVM_FIRST + 11; +pub const LVNI_ALL: LPARAM = 0x0000; +pub const LVNI_FOCUSED: LPARAM = 0x0001; +pub const LVNI_SELECTED: LPARAM = 0x0002; +pub const LVNI_CUT: LPARAM = 0x0004; +pub const LVNI_DROPHILITED: LPARAM = 0x0008; +pub const LVNI_STATEMASK: LPARAM = LVNI_FOCUSED | LVNI_SELECTED | LVNI_CUT | LVNI_DROPHILITED; +pub const LVNI_VISIBLEORDER: LPARAM = 0x0010; +pub const LVNI_PREVIOUS: LPARAM = 0x0020; +pub const LVNI_VISIBLEONLY: LPARAM = 0x0040; +pub const LVNI_SAMEGROUPONLY: LPARAM = 0x0080; +pub const LVNI_ABOVE: LPARAM = 0x0100; +pub const LVNI_BELOW: LPARAM = 0x0200; +pub const LVNI_TOLEFT: LPARAM = 0x0400; +pub const LVNI_TORIGHT: LPARAM = 0x0800; +pub const LVNI_DIRECTIONMASK: LPARAM = LVNI_ABOVE | LVNI_BELOW | LVNI_TOLEFT | LVNI_TORIGHT; +pub const LVM_GETNEXTITEM: UINT = LVM_FIRST + 12; +pub const LVFI_PARAM: UINT = 0x0001; +pub const LVFI_STRING: UINT = 0x0002; +pub const LVFI_SUBSTRING: UINT = 0x0004; +pub const LVFI_PARTIAL: UINT = 0x0008; +pub const LVFI_WRAP: UINT = 0x0020; +pub const LVFI_NEARESTXY: UINT = 0x0040; +pub type LV_FINDINFOA = LVFINDINFOA; +pub type LV_FINDINFOW = LVFINDINFOW; +STRUCT!{struct LVFINDINFOA { + flags: UINT, + psz: LPCSTR, + lParam: LPARAM, + pt: POINT, + vkDirection: UINT, +}} +pub type LPFINDINFOA = *mut LVFINDINFOA; +STRUCT!{struct LVFINDINFOW { + flags: UINT, + psz: LPCWSTR, + lParam: LPARAM, + pt: POINT, + vkDirection: UINT, +}} +pub type LPFINDINFOW = *mut LVFINDINFOW; +pub const LVM_FINDITEMA: UINT = LVM_FIRST + 13; +pub const LVM_FINDITEMW: UINT = LVM_FIRST + 83; +pub const LVIR_BOUNDS: c_int = 0; +pub const LVIR_ICON: c_int = 1; +pub const LVIR_LABEL: c_int = 2; +pub const LVIR_SELECTBOUNDS: c_int = 3; +pub const LVM_GETITEMRECT: UINT = LVM_FIRST + 14; +pub const LVM_SETITEMPOSITION: UINT = LVM_FIRST + 15; +pub const LVM_GETITEMPOSITION: UINT = LVM_FIRST + 16; +pub const LVM_GETSTRINGWIDTHA: UINT = LVM_FIRST + 17; +pub const LVM_GETSTRINGWIDTHW: UINT = LVM_FIRST + 87; +pub const LVHT_NOWHERE: UINT = 0x00000001; +pub const LVHT_ONITEMICON: UINT = 0x00000002; +pub const LVHT_ONITEMLABEL: UINT = 0x00000004; +pub const LVHT_ONITEMSTATEICON: UINT = 0x00000008; +pub const LVHT_ONITEM: UINT = LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON; +pub const LVHT_ABOVE: UINT = 0x00000008; +pub const LVHT_BELOW: UINT = 0x00000010; +pub const LVHT_TORIGHT: UINT = 0x00000020; +pub const LVHT_TOLEFT: UINT = 0x00000040; +pub const LVHT_EX_GROUP_HEADER: UINT = 0x10000000; +pub const LVHT_EX_GROUP_FOOTER: UINT = 0x20000000; +pub const LVHT_EX_GROUP_COLLAPSE: UINT = 0x40000000; +pub const LVHT_EX_GROUP_BACKGROUND: UINT = 0x80000000; +pub const LVHT_EX_GROUP_STATEICON: UINT = 0x01000000; +pub const LVHT_EX_GROUP_SUBSETLINK: UINT = 0x02000000; +pub const LVHT_EX_GROUP: UINT = LVHT_EX_GROUP_BACKGROUND | LVHT_EX_GROUP_COLLAPSE + | LVHT_EX_GROUP_FOOTER | LVHT_EX_GROUP_HEADER | LVHT_EX_GROUP_STATEICON + | LVHT_EX_GROUP_SUBSETLINK; +pub const LVHT_EX_ONCONTENTS: UINT = 0x04000000; +pub const LVHT_EX_FOOTER: UINT = 0x08000000; +pub type LV_HITTESTINFO = LVHITTESTINFO; +STRUCT!{struct LVHITTESTINFO { + pt: POINT, + flags: UINT, + iItem: c_int, + iSubItem: c_int, + iGroup: c_int, +}} +pub type LPLVHITTESTINFO = *mut LVHITTESTINFO; +pub const LVM_HITTEST: UINT = LVM_FIRST + 18; +pub const LVM_ENSUREVISIBLE: UINT = LVM_FIRST + 19; +pub const LVM_SCROLL: UINT = LVM_FIRST + 20; +pub const LVM_REDRAWITEMS: UINT = LVM_FIRST + 21; +pub const LVA_DEFAULT: WPARAM = 0x0000; +pub const LVA_ALIGNLEFT: WPARAM = 0x0001; +pub const LVA_ALIGNTOP: WPARAM = 0x0002; +pub const LVA_SNAPTOGRID: WPARAM = 0x0005; +pub const LVM_ARRANGE: UINT = LVM_FIRST + 22; +pub const LVM_EDITLABELA: UINT = LVM_FIRST + 23; +pub const LVM_EDITLABELW: UINT = LVM_FIRST + 118; +pub const LVM_GETEDITCONTROL: UINT = LVM_FIRST + 24; +pub type LV_COLUMNA = LVCOLUMNA; +pub type LV_COLUMNW = LVCOLUMNW; +STRUCT!{struct LVCOLUMNA { + mask: UINT, + fmt: c_int, + cx: c_int, + pszText: LPSTR, + cchTextMax: c_int, + iSubItem: c_int, + iImage: c_int, + iOrder: c_int, + cxMin: c_int, + cxDefault: c_int, + cxIdeal: c_int, +}} +pub type LPLVCOLUMNA = *mut LVCOLUMNA; +STRUCT!{struct LVCOLUMNW { + mask: UINT, + fmt: c_int, + cx: c_int, + pszText: LPWSTR, + cchTextMax: c_int, + iSubItem: c_int, + iImage: c_int, + iOrder: c_int, + cxMin: c_int, + cxDefault: c_int, + cxIdeal: c_int, +}} +pub type LPLVCOLUMNW = *mut LVCOLUMNW; +pub const LVCF_FMT: UINT = 0x0001; +pub const LVCF_WIDTH: UINT = 0x0002; +pub const LVCF_TEXT: UINT = 0x0004; +pub const LVCF_SUBITEM: UINT = 0x0008; +pub const LVCF_IMAGE: UINT = 0x0010; +pub const LVCF_ORDER: UINT = 0x0020; +pub const LVCF_MINWIDTH: UINT = 0x0040; +pub const LVCF_DEFAULTWIDTH: UINT = 0x0080; +pub const LVCF_IDEALWIDTH: UINT = 0x0100; +pub const LVCFMT_LEFT: c_int = 0x0000; +pub const LVCFMT_RIGHT: c_int = 0x0001; +pub const LVCFMT_CENTER: c_int = 0x0002; +pub const LVCFMT_JUSTIFYMASK: c_int = 0x0003; +pub const LVCFMT_IMAGE: c_int = 0x0800; +pub const LVCFMT_BITMAP_ON_RIGHT: c_int = 0x1000; +pub const LVCFMT_COL_HAS_IMAGES: c_int = 0x8000; +pub const LVCFMT_FIXED_WIDTH: c_int = 0x00100; +pub const LVCFMT_NO_DPI_SCALE: c_int = 0x40000; +pub const LVCFMT_FIXED_RATIO: c_int = 0x80000; +pub const LVCFMT_LINE_BREAK: c_int = 0x100000; +pub const LVCFMT_FILL: c_int = 0x200000; +pub const LVCFMT_WRAP: c_int = 0x400000; +pub const LVCFMT_NO_TITLE: c_int = 0x800000; +pub const LVCFMT_TILE_PLACEMENTMASK: c_int = LVCFMT_LINE_BREAK | LVCFMT_FILL; +pub const LVCFMT_SPLITBUTTON: c_int = 0x1000000; +pub const LVM_GETCOLUMNA: UINT = LVM_FIRST + 25; +pub const LVM_GETCOLUMNW: UINT = LVM_FIRST + 95; +pub const LVM_SETCOLUMNA: UINT = LVM_FIRST + 26; +pub const LVM_SETCOLUMNW: UINT = LVM_FIRST + 96; +pub const LVM_INSERTCOLUMNA: UINT = LVM_FIRST + 27; +pub const LVM_INSERTCOLUMNW: UINT = LVM_FIRST + 97; +pub const LVM_DELETECOLUMN: UINT = LVM_FIRST + 28; +pub const LVM_GETCOLUMNWIDTH: UINT = LVM_FIRST + 29; +pub const LVSCW_AUTOSIZE: c_int = -1; +pub const LVSCW_AUTOSIZE_USEHEADER: c_int = -2; +pub const LVM_SETCOLUMNWIDTH: UINT = LVM_FIRST + 30; +pub const LVM_GETHEADER: UINT = LVM_FIRST + 31; +pub const LVM_CREATEDRAGIMAGE: UINT = LVM_FIRST + 33; +pub const LVM_GETVIEWRECT: UINT = LVM_FIRST + 34; +pub const LVM_GETTEXTCOLOR: UINT = LVM_FIRST + 35; +pub const LVM_SETTEXTCOLOR: UINT = LVM_FIRST + 36; +pub const LVM_GETTEXTBKCOLOR: UINT = LVM_FIRST + 37; +pub const LVM_SETTEXTBKCOLOR: UINT = LVM_FIRST + 38; +pub const LVM_GETTOPINDEX: UINT = LVM_FIRST + 39; +pub const LVM_GETCOUNTPERPAGE: UINT = LVM_FIRST + 40; +pub const LVM_GETORIGIN: UINT = LVM_FIRST + 41; +pub const LVM_UPDATE: UINT = LVM_FIRST + 42; +pub const LVM_SETITEMSTATE: UINT = LVM_FIRST + 43; +pub const LVM_GETITEMSTATE: UINT = LVM_FIRST + 44; +pub const LVM_GETITEMTEXTA: UINT = LVM_FIRST + 45; +pub const LVM_GETITEMTEXTW: UINT = LVM_FIRST + 115; +pub const LVM_SETITEMTEXTA: UINT = LVM_FIRST + 46; +pub const LVM_SETITEMTEXTW: UINT = LVM_FIRST + 116; +pub const LVSICF_NOINVALIDATEALL: LPARAM = 0x00000001; +pub const LVSICF_NOSCROLL: LPARAM = 0x00000002; +pub const LVM_SETITEMCOUNT: UINT = LVM_FIRST + 47; +FN!{stdcall PFNLVCOMPARE( + LPARAM, + LPARAM, + LPARAM, +) -> c_int} +pub const LVM_SORTITEMS: UINT = LVM_FIRST + 48; +pub const LVM_SETITEMPOSITION32: UINT = LVM_FIRST + 49; +pub const LVM_GETSELECTEDCOUNT: UINT = LVM_FIRST + 50; +pub const LVM_GETITEMSPACING: UINT = LVM_FIRST + 51; +pub const LVM_GETISEARCHSTRINGA: UINT = LVM_FIRST + 52; +pub const LVM_GETISEARCHSTRINGW: UINT = LVM_FIRST + 117; +pub const LVM_SETICONSPACING: UINT = LVM_FIRST + 53; +pub const LVM_SETEXTENDEDLISTVIEWSTYLE: UINT = LVM_FIRST + 54; +pub const LVM_GETEXTENDEDLISTVIEWSTYLE: UINT = LVM_FIRST + 55; +pub const LVS_EX_GRIDLINES: DWORD = 0x00000001; +pub const LVS_EX_SUBITEMIMAGES: DWORD = 0x00000002; +pub const LVS_EX_CHECKBOXES: DWORD = 0x00000004; +pub const LVS_EX_TRACKSELECT: DWORD = 0x00000008; +pub const LVS_EX_HEADERDRAGDROP: DWORD = 0x00000010; +pub const LVS_EX_FULLROWSELECT: DWORD = 0x00000020; +pub const LVS_EX_ONECLICKACTIVATE: DWORD = 0x00000040; +pub const LVS_EX_TWOCLICKACTIVATE: DWORD = 0x00000080; +pub const LVS_EX_FLATSB: DWORD = 0x00000100; +pub const LVS_EX_REGIONAL: DWORD = 0x00000200; +pub const LVS_EX_INFOTIP: DWORD = 0x00000400; +pub const LVS_EX_UNDERLINEHOT: DWORD = 0x00000800; +pub const LVS_EX_UNDERLINECOLD: DWORD = 0x00001000; +pub const LVS_EX_MULTIWORKAREAS: DWORD = 0x00002000; +pub const LVS_EX_LABELTIP: DWORD = 0x00004000; +pub const LVS_EX_BORDERSELECT: DWORD = 0x00008000; +pub const LVS_EX_DOUBLEBUFFER: DWORD = 0x00010000; +pub const LVS_EX_HIDELABELS: DWORD = 0x00020000; +pub const LVS_EX_SINGLEROW: DWORD = 0x00040000; +pub const LVS_EX_SNAPTOGRID: DWORD = 0x00080000; +pub const LVS_EX_SIMPLESELECT: DWORD = 0x00100000; +pub const LVS_EX_JUSTIFYCOLUMNS: DWORD = 0x00200000; +pub const LVS_EX_TRANSPARENTBKGND: DWORD = 0x00400000; +pub const LVS_EX_TRANSPARENTSHADOWTEXT: DWORD = 0x00800000; +pub const LVS_EX_AUTOAUTOARRANGE: DWORD = 0x01000000; +pub const LVS_EX_HEADERINALLVIEWS: DWORD = 0x02000000; +pub const LVS_EX_AUTOCHECKSELECT: DWORD = 0x08000000; +pub const LVS_EX_AUTOSIZECOLUMNS: DWORD = 0x10000000; +pub const LVS_EX_COLUMNSNAPPOINTS: DWORD = 0x40000000; +pub const LVS_EX_COLUMNOVERFLOW: DWORD = 0x80000000; +pub const LVM_GETSUBITEMRECT: UINT = LVM_FIRST + 56; +pub const LVM_SUBITEMHITTEST: UINT = LVM_FIRST + 57; +pub const LVM_SETCOLUMNORDERARRAY: UINT = LVM_FIRST + 58; +pub const LVM_GETCOLUMNORDERARRAY: UINT = LVM_FIRST + 59; +pub const LVM_SETHOTITEM: UINT = LVM_FIRST + 60; +pub const LVM_GETHOTITEM: UINT = LVM_FIRST + 61; +pub const LVM_SETHOTCURSOR: UINT = LVM_FIRST + 62; +pub const LVM_GETHOTCURSOR: UINT = LVM_FIRST + 63; +pub const LVM_APPROXIMATEVIEWRECT: UINT = LVM_FIRST + 64; +pub const LV_MAX_WORKAREAS: WPARAM = 16; +pub const LVM_SETWORKAREAS: UINT = LVM_FIRST + 65; +pub const LVM_GETWORKAREAS: UINT = LVM_FIRST + 70; +pub const LVM_GETNUMBEROFWORKAREAS: UINT = LVM_FIRST + 73; +pub const LVM_GETSELECTIONMARK: UINT = LVM_FIRST + 66; +pub const LVM_SETSELECTIONMARK: UINT = LVM_FIRST + 67; +pub const LVM_SETHOVERTIME: UINT = LVM_FIRST + 71; +pub const LVM_GETHOVERTIME: UINT = LVM_FIRST + 72; +pub const LVM_SETTOOLTIPS: UINT = LVM_FIRST + 74; +pub const LVM_GETTOOLTIPS: UINT = LVM_FIRST + 78; +pub const LVM_SORTITEMSEX: UINT = LVM_FIRST + 81; +STRUCT!{struct LVBKIMAGEA { + ulFlags: ULONG, + hbm: HBITMAP, + pszImage: LPSTR, + cchImageMax: UINT, + xOffsetPercent: c_int, + yOffsetPercent: c_int, +}} +pub type LPLVBKIMAGEA = *mut LVBKIMAGEA; +STRUCT!{struct LVBKIMAGEW { + ulFlags: ULONG, + hbm: HBITMAP, + pszImage: LPWSTR, + cchImageMax: UINT, + xOffsetPercent: c_int, + yOffsetPercent: c_int, +}} +pub type LPLVBKIMAGEW = *mut LVBKIMAGEW; +pub const LVBKIF_SOURCE_NONE: ULONG = 0x00000000; +pub const LVBKIF_SOURCE_HBITMAP: ULONG = 0x00000001; +pub const LVBKIF_SOURCE_URL: ULONG = 0x00000002; +pub const LVBKIF_SOURCE_MASK: ULONG = 0x00000003; +pub const LVBKIF_STYLE_NORMAL: ULONG = 0x00000000; +pub const LVBKIF_STYLE_TILE: ULONG = 0x00000010; +pub const LVBKIF_STYLE_MASK: ULONG = 0x00000010; +pub const LVBKIF_FLAG_TILEOFFSET: ULONG = 0x00000100; +pub const LVBKIF_TYPE_WATERMARK: ULONG = 0x10000000; +pub const LVBKIF_FLAG_ALPHABLEND: ULONG = 0x20000000; +pub const LVM_SETBKIMAGEA: UINT = LVM_FIRST + 68; +pub const LVM_SETBKIMAGEW: UINT = LVM_FIRST + 138; +pub const LVM_GETBKIMAGEA: UINT = LVM_FIRST + 69; +pub const LVM_GETBKIMAGEW: UINT = LVM_FIRST + 139; +pub const LVM_SETSELECTEDCOLUMN: UINT = LVM_FIRST + 140; +pub const LV_VIEW_ICON: DWORD = 0x0000; +pub const LV_VIEW_DETAILS: DWORD = 0x0001; +pub const LV_VIEW_SMALLICON: DWORD = 0x0002; +pub const LV_VIEW_LIST: DWORD = 0x0003; +pub const LV_VIEW_TILE: DWORD = 0x0004; +pub const LV_VIEW_MAX: DWORD = 0x0004; +pub const LVM_SETVIEW: UINT = LVM_FIRST + 142; +pub const LVM_GETVIEW: UINT = LVM_FIRST + 143; +pub const LVGF_NONE: UINT = 0x00000000; +pub const LVGF_HEADER: UINT = 0x00000001; +pub const LVGF_FOOTER: UINT = 0x00000002; +pub const LVGF_STATE: UINT = 0x00000004; +pub const LVGF_ALIGN: UINT = 0x00000008; +pub const LVGF_GROUPID: UINT = 0x00000010; +pub const LVGF_SUBTITLE: UINT = 0x00000100; +pub const LVGF_TASK: UINT = 0x00000200; +pub const LVGF_DESCRIPTIONTOP: UINT = 0x00000400; +pub const LVGF_DESCRIPTIONBOTTOM: UINT = 0x00000800; +pub const LVGF_TITLEIMAGE: UINT = 0x00001000; +pub const LVGF_EXTENDEDIMAGE: UINT = 0x00002000; +pub const LVGF_ITEMS: UINT = 0x00004000; +pub const LVGF_SUBSET: UINT = 0x00008000; +pub const LVGF_SUBSETITEMS: UINT = 0x00010000; +pub const LVGS_NORMAL: UINT = 0x00000000; +pub const LVGS_COLLAPSED: UINT = 0x00000001; +pub const LVGS_HIDDEN: UINT = 0x00000002; +pub const LVGS_NOHEADER: UINT = 0x00000004; +pub const LVGS_COLLAPSIBLE: UINT = 0x00000008; +pub const LVGS_FOCUSED: UINT = 0x00000010; +pub const LVGS_SELECTED: UINT = 0x00000020; +pub const LVGS_SUBSETED: UINT = 0x00000040; +pub const LVGS_SUBSETLINKFOCUSED: UINT = 0x00000080; +pub const LVGA_HEADER_LEFT: UINT = 0x00000001; +pub const LVGA_HEADER_CENTER: UINT = 0x00000002; +pub const LVGA_HEADER_RIGHT: UINT = 0x00000004; +pub const LVGA_FOOTER_LEFT: UINT = 0x00000008; +pub const LVGA_FOOTER_CENTER: UINT = 0x00000010; +pub const LVGA_FOOTER_RIGHT: UINT = 0x00000020; +STRUCT!{struct LVGROUP { + cbSize: UINT, + mask: UINT, + pszHeader: LPWSTR, + cchHeader: c_int, + pszFooter: LPWSTR, + cchFooter: c_int, + iGroupId: c_int, + stateMask: UINT, + state: UINT, + uAlign: UINT, + pszSubtitle: LPWSTR, + cchSubtitle: UINT, + pszTask: LPWSTR, + cchTask: UINT, + pszDescriptionTop: LPWSTR, + cchDescriptionTop: UINT, + pszDescriptionBottom: LPWSTR, + cchDescriptionBottom: UINT, + iTitleImage: c_int, + iExtendedImage: c_int, + iFirstItem: c_int, + cItems: UINT, + pszSubsetTitle: LPWSTR, + cchSubsetTitle: UINT, +}} +pub type PLVGROUP = *mut LVGROUP; +pub const LVM_INSERTGROUP: UINT = LVM_FIRST + 145; +pub const LVM_SETGROUPINFO: UINT = LVM_FIRST + 147; +pub const LVM_GETGROUPINFO: UINT = LVM_FIRST + 149; +pub const LVM_REMOVEGROUP: UINT = LVM_FIRST + 150; +pub const LVM_MOVEGROUP: UINT = LVM_FIRST + 151; +pub const LVM_GETGROUPCOUNT: UINT = LVM_FIRST + 152; +pub const LVM_GETGROUPINFOBYINDEX: UINT = LVM_FIRST + 153; +pub const LVM_MOVEITEMTOGROUP: UINT = LVM_FIRST + 154; +pub const LVGGR_GROUP: LPARAM = 0; +pub const LVGGR_HEADER: LPARAM = 1; +pub const LVGGR_LABEL: LPARAM = 2; +pub const LVGGR_SUBSETLINK: LPARAM = 3; +pub const LVM_GETGROUPRECT: UINT = LVM_FIRST + 98; +pub const LVGMF_NONE: UINT = 0x00000000; +pub const LVGMF_BORDERSIZE: UINT = 0x00000001; +pub const LVGMF_BORDERCOLOR: UINT = 0x00000002; +pub const LVGMF_TEXTCOLOR: UINT = 0x00000004; +STRUCT!{struct LVGROUPMETRICS { + cbSize: UINT, + mask: UINT, + Left: UINT, + Top: UINT, + Right: UINT, + Bottom: UINT, + crLeft: COLORREF, + crTop: COLORREF, + crRight: COLORREF, + crBottom: COLORREF, + crHeader: COLORREF, + crFooter: COLORREF, +}} +pub type PLVGROUPMETRICS = *mut LVGROUPMETRICS; +pub const LVM_SETGROUPMETRICS: UINT = LVM_FIRST + 155; +pub const LVM_GETGROUPMETRICS: UINT = LVM_FIRST + 156; +pub const LVM_ENABLEGROUPVIEW: UINT = LVM_FIRST + 157; +FN!{stdcall PFNLVGROUPCOMPARE( + c_int, + c_int, + *mut c_void, +) -> c_int} +pub const LVM_SORTGROUPS: UINT = LVM_FIRST + 158; +STRUCT!{struct LVINSERTGROUPSORTED { + pfnGroupCompare: PFNLVGROUPCOMPARE, + pvData: *mut c_void, + lvGroup: LVGROUP, +}} +pub type PLVINSERTGROUPSORTED = *mut LVINSERTGROUPSORTED; +pub const LVM_INSERTGROUPSORTED: UINT = LVM_FIRST + 159; +pub const LVM_REMOVEALLGROUPS: UINT = LVM_FIRST + 160; +pub const LVM_HASGROUP: UINT = LVM_FIRST + 161; +pub const LVM_GETGROUPSTATE: UINT = LVM_FIRST + 92; +pub const LVM_GETFOCUSEDGROUP: UINT = LVM_FIRST + 93; +pub const LVTVIF_AUTOSIZE: DWORD = 0x00000000; +pub const LVTVIF_FIXEDWIDTH: DWORD = 0x00000001; +pub const LVTVIF_FIXEDHEIGHT: DWORD = 0x00000002; +pub const LVTVIF_FIXEDSIZE: DWORD = 0x00000003; +pub const LVTVIF_EXTENDED: DWORD = 0x00000004; +pub const LVTVIM_TILESIZE: DWORD = 0x00000001; +pub const LVTVIM_COLUMNS: DWORD = 0x00000002; +pub const LVTVIM_LABELMARGIN: DWORD = 0x00000004; +STRUCT!{struct LVTILEVIEWINFO { + cbSize: UINT, + dwMask: DWORD, + dwFlags: DWORD, + sizeTile: SIZE, + cLines: c_int, + rcLabelMargin: RECT, +}} +pub type PLVTILEVIEWINFO = *mut LVTILEVIEWINFO; +STRUCT!{struct LVTILEINFO { + cbSize: UINT, + iItem: c_int, + cColumns: UINT, + puColumns: PUINT, + piColFmt: *mut c_int, +}} +pub type PLVTILEINFO = *mut LVTILEINFO; +pub const LVM_SETTILEVIEWINFO: UINT = LVM_FIRST + 162; +pub const LVM_GETTILEVIEWINFO: UINT = LVM_FIRST + 163; +pub const LVM_SETTILEINFO: UINT = LVM_FIRST + 164; +pub const LVM_GETTILEINFO: UINT = LVM_FIRST + 165; +STRUCT!{struct LVINSERTMARK { + cbSize: UINT, + dwFlags: DWORD, + iItem: c_int, + dwReserved: DWORD, +}} +pub type LPLVINSERTMARK = *mut LVINSERTMARK; +pub const LVIM_AFTER: DWORD = 0x00000001; +pub const LVM_SETINSERTMARK: UINT = LVM_FIRST + 166; +pub const LVM_GETINSERTMARK: UINT = LVM_FIRST + 167; +pub const LVM_INSERTMARKHITTEST: UINT = LVM_FIRST + 168; +pub const LVM_GETINSERTMARKRECT: UINT = LVM_FIRST + 169; +pub const LVM_SETINSERTMARKCOLOR: UINT = LVM_FIRST + 170; +pub const LVM_GETINSERTMARKCOLOR: UINT = LVM_FIRST + 171; +STRUCT!{struct LVSETINFOTIP { + cbSize: UINT, + dwFlags: DWORD, + pszText: LPWSTR, + iItem: c_int, + iSubItem: c_int, +}} +pub type PLVSETINFOTIP = *mut LVSETINFOTIP; +pub const LVM_SETINFOTIP: UINT = LVM_FIRST + 173; +pub const LVM_GETSELECTEDCOLUMN: UINT = LVM_FIRST + 174; +pub const LVM_ISGROUPVIEWENABLED: UINT = LVM_FIRST + 175; +pub const LVM_GETOUTLINECOLOR: UINT = LVM_FIRST + 176; +pub const LVM_SETOUTLINECOLOR: UINT = LVM_FIRST + 177; +pub const LVM_CANCELEDITLABEL: UINT = LVM_FIRST + 179; +pub const LVM_MAPINDEXTOID: UINT = LVM_FIRST + 180; +pub const LVM_MAPIDTOINDEX: UINT = LVM_FIRST + 181; +pub const LVM_ISITEMVISIBLE: UINT = LVM_FIRST + 182; +pub const LVM_GETEMPTYTEXT: UINT = LVM_FIRST + 204; +pub const LVM_GETFOOTERRECT: UINT = LVM_FIRST + 205; +pub const LVFF_ITEMCOUNT: UINT = 0x00000001; +STRUCT!{struct LVFOOTERINFO { + mask: UINT, + pszText: LPWSTR, + cchTextMax: c_int, + cItems: UINT, +}} +pub type LPLVFOOTERINFO = *mut LVFOOTERINFO; +pub const LVM_GETFOOTERINFO: UINT = LVM_FIRST + 206; +pub const LVM_GETFOOTERITEMRECT: UINT = LVM_FIRST + 207; +pub const LVFIF_TEXT: UINT = 0x00000001; +pub const LVFIF_STATE: UINT = 0x00000002; +pub const LVFIS_FOCUSED: UINT = 0x0001; +STRUCT!{struct LVFOOTERITEM { + mask: UINT, + iItem: c_int, + pszText: LPWSTR, + cchTextMax: c_int, + state: UINT, + stateMask: UINT, +}} +pub type LPLVFOOTERITEM = *mut LVFOOTERITEM; +pub const LVM_GETFOOTERITEM: UINT = LVM_FIRST + 208; +STRUCT!{struct LVITEMINDEX { + iItem: c_int, + iGroup: c_int, +}} +pub type PLVITEMINDEX = *mut LVITEMINDEX; +pub const LVM_GETITEMINDEXRECT: UINT = LVM_FIRST + 209; +pub const LVM_SETITEMINDEXSTATE: UINT = LVM_FIRST + 210; +pub const LVM_GETNEXTITEMINDEX: UINT = LVM_FIRST + 211; +pub type LPNM_LISTVIEW = LPNMLISTVIEW; +pub type NM_LISTVIEW = NMLISTVIEW; +STRUCT!{struct NMLISTVIEW { + hdr: NMHDR, + iItem: c_int, + iSubItem: c_int, + uNewState: UINT, + uOldState: UINT, + uChanged: UINT, + ptAction: POINT, + lParam: LPARAM, +}} +pub type LPNMLISTVIEW = *mut NMLISTVIEW; +STRUCT!{struct NMITEMACTIVATE { + hdr: NMHDR, + iItem: c_int, + iSubItem: c_int, + uNewState: UINT, + uOldState: UINT, + uChanged: UINT, + ptAction: POINT, + lParam: LPARAM, + uKeyFlags: UINT, +}} +pub type LPNMITEMACTIVATE = *mut NMITEMACTIVATE; +pub const LVKF_ALT: UINT = 0x0001; +pub const LVKF_CONTROL: UINT = 0x0002; +pub const LVKF_SHIFT: UINT = 0x0004; +STRUCT!{struct NMLVCUSTOMDRAW { + nmcd: NMCUSTOMDRAW, + clrText: COLORREF, + clrTextBk: COLORREF, + iSubItem: c_int, + dwItemType: DWORD, + clrFace: COLORREF, + iIconEffect: c_int, + iIconPhase: c_int, + iPartId: c_int, + iStateId: c_int, + rcText: RECT, + uAlign: UINT, +}} +pub type LPNMLVCUSTOMDRAW = *mut NMLVCUSTOMDRAW; +pub const LVCDI_ITEM: DWORD = 0x00000000; +pub const LVCDI_GROUP: DWORD = 0x00000001; +pub const LVCDI_ITEMSLIST: DWORD = 0x00000002; +pub const LVCDRF_NOSELECT: LRESULT = 0x00010000; +pub const LVCDRF_NOGROUPFRAME: LRESULT = 0x00020000; +STRUCT!{struct NMLVCACHEHINT { + hdr: NMHDR, + iFrom: c_int, + iTo: c_int, +}} +pub type LPNMLVCACHEHINT = *mut NMLVCACHEHINT; +pub type LPNM_CACHEHINT = LPNMLVCACHEHINT; +pub type PNM_CACHEHINT = LPNMLVCACHEHINT; +pub type NM_CACHEHINT = NMLVCACHEHINT; +STRUCT!{struct NMLVFINDITEMA { + hdr: NMHDR, + iStart: c_int, + lvfi: LVFINDINFOA, +}} +pub type LPNMLVFINDITEMA = *mut NMLVFINDITEMA; +STRUCT!{struct NMLVFINDITEMW { + hdr: NMHDR, + iStart: c_int, + lvfi: LVFINDINFOW, +}} +pub type LPNMLVFINDITEMW = *mut NMLVFINDITEMW; +pub type PNM_FINDITEMA = LPNMLVFINDITEMA; +pub type LPNM_FINDITEMA = LPNMLVFINDITEMA; +pub type NM_FINDITEMA = NMLVFINDITEMA; +pub type PNM_FINDITEMW = LPNMLVFINDITEMW; +pub type LPNM_FINDITEMW = LPNMLVFINDITEMW; +pub type NM_FINDITEMW = NMLVFINDITEMW; +STRUCT!{struct NMLVODSTATECHANGE { + hdr: NMHDR, + iFrom: c_int, + iTo: c_int, + uNewState: UINT, + uOldState: UINT, +}} +pub type LPNMLVODSTATECHANGE = *mut NMLVODSTATECHANGE; +pub type PNM_ODSTATECHANGE = LPNMLVODSTATECHANGE; +pub type LPNM_ODSTATECHANGE = LPNMLVODSTATECHANGE; +pub type NM_ODSTATECHANGE = NMLVODSTATECHANGE; +pub const LVN_ITEMCHANGING: UINT = LVN_FIRST - 0; +pub const LVN_ITEMCHANGED: UINT = LVN_FIRST - 1; +pub const LVN_INSERTITEM: UINT = LVN_FIRST - 2; +pub const LVN_DELETEITEM: UINT = LVN_FIRST - 3; +pub const LVN_DELETEALLITEMS: UINT = LVN_FIRST - 4; +pub const LVN_BEGINLABELEDITA: UINT = LVN_FIRST - 5; +pub const LVN_BEGINLABELEDITW: UINT = LVN_FIRST - 75; +pub const LVN_ENDLABELEDITA: UINT = LVN_FIRST - 6; +pub const LVN_ENDLABELEDITW: UINT = LVN_FIRST - 76; +pub const LVN_COLUMNCLICK: UINT = LVN_FIRST - 8; +pub const LVN_BEGINDRAG: UINT = LVN_FIRST - 9; +pub const LVN_BEGINRDRAG: UINT = LVN_FIRST - 11; +pub const LVN_ODCACHEHINT: UINT = LVN_FIRST - 13; +pub const LVN_ODFINDITEMA: UINT = LVN_FIRST - 52; +pub const LVN_ODFINDITEMW: UINT = LVN_FIRST - 79; +pub const LVN_ITEMACTIVATE: UINT = LVN_FIRST - 14; +pub const LVN_ODSTATECHANGED: UINT = LVN_FIRST - 15; +pub const LVN_HOTTRACK: UINT = LVN_FIRST - 21; +pub const LVN_GETDISPINFOA: UINT = LVN_FIRST - 50; +pub const LVN_GETDISPINFOW: UINT = LVN_FIRST - 77; +pub const LVN_SETDISPINFOA: UINT = LVN_FIRST - 51; +pub const LVN_SETDISPINFOW: UINT = LVN_FIRST - 78; +pub const LVIF_DI_SETITEM: UINT = 0x1000; +pub type LV_DISPINFOA = NMLVDISPINFOA; +pub type LV_DISPINFOW = NMLVDISPINFOW; +STRUCT!{struct NMLVDISPINFOA { + hdr: NMHDR, + item: LVITEMA, +}} +pub type LPNMLVDISPINFOA = *mut NMLVDISPINFOA; +STRUCT!{struct NMLVDISPINFOW { + hdr: NMHDR, + item: LVITEMW, +}} +pub type LPNMLVDISPINFOW = *mut NMLVDISPINFOW; +pub const LVN_KEYDOWN: UINT = LVN_FIRST - 55; +pub type LV_KEYDOWN = NMLVKEYDOWN; +STRUCT!{#[repr(packed)] struct NMLVKEYDOWN { + hdr: NMHDR, + wVKey: WORD, + flags: UINT, +}} +pub type LPNMLVKEYDOWN = *mut NMLVKEYDOWN; +pub const LVN_MARQUEEBEGIN: UINT = LVN_FIRST - 56; +STRUCT!{struct NMLVLINK { + hdr: NMHDR, + link: LITEM, + iItem: c_int, + iSubItem: c_int, +}} +pub type PNMLVLINK = *mut NMLVLINK; +STRUCT!{struct NMLVGETINFOTIPA { + hdr: NMHDR, + dwFlags: DWORD, + pszText: LPSTR, + cchTextMax: c_int, + iItem: c_int, + iSubItem: c_int, + lParam: LPARAM, +}} +pub type LPNMLVGETINFOTIPA = *mut NMLVGETINFOTIPA; +STRUCT!{struct NMLVGETINFOTIPW { + hdr: NMHDR, + dwFlags: DWORD, + pszText: LPWSTR, + cchTextMax: c_int, + iItem: c_int, + iSubItem: c_int, + lParam: LPARAM, +}} +pub type LPNMLVGETINFOTIPW = *mut NMLVGETINFOTIPW; +pub const LVGIT_UNFOLDED: DWORD = 0x0001; +pub const LVN_GETINFOTIPA: UINT = LVN_FIRST - 57; +pub const LVN_GETINFOTIPW: UINT = LVN_FIRST - 58; +pub const LVNSCH_DEFAULT: LPARAM = -1; +pub const LVNSCH_ERROR: LPARAM = -2; +pub const LVNSCH_IGNORE: LPARAM = -3; +pub const LVN_INCREMENTALSEARCHA: UINT = LVN_FIRST - 62; +pub const LVN_INCREMENTALSEARCHW: UINT = LVN_FIRST - 63; +pub const LVN_COLUMNDROPDOWN: UINT = LVN_FIRST - 64; +pub const LVN_COLUMNOVERFLOWCLICK: UINT = LVN_FIRST - 66; +STRUCT!{struct NMLVSCROLL { + hdr: NMHDR, + dx: c_int, + dy: c_int, +}} +pub type LPNMLVSCROLL = *mut NMLVSCROLL; +pub const LVN_BEGINSCROLL: UINT = LVN_FIRST - 80; +pub const LVN_ENDSCROLL: UINT = LVN_FIRST - 81; +pub const LVN_LINKCLICK: UINT = LVN_FIRST - 84; +pub const EMF_CENTERED: DWORD = 0x00000001; +STRUCT!{struct NMLVEMPTYMARKUP { + hdr: NMHDR, + dwFlags: DWORD, + szMarkup: [WCHAR; L_MAX_URL_LENGTH], +}} +pub const LVN_GETEMPTYMARKUP: UINT = LVN_FIRST - 87; +pub const WC_TREEVIEW: &'static str = "SysTreeView32"; +pub const TVS_HASBUTTONS: DWORD = 0x0001; +pub const TVS_HASLINES: DWORD = 0x0002; +pub const TVS_LINESATROOT: DWORD = 0x0004; +pub const TVS_EDITLABELS: DWORD = 0x0008; +pub const TVS_DISABLEDRAGDROP: DWORD = 0x0010; +pub const TVS_SHOWSELALWAYS: DWORD = 0x0020; +pub const TVS_RTLREADING: DWORD = 0x0040; +pub const TVS_NOTOOLTIPS: DWORD = 0x0080; +pub const TVS_CHECKBOXES: DWORD = 0x0100; +pub const TVS_TRACKSELECT: DWORD = 0x0200; +pub const TVS_SINGLEEXPAND: DWORD = 0x0400; +pub const TVS_INFOTIP: DWORD = 0x0800; +pub const TVS_FULLROWSELECT: DWORD = 0x1000; +pub const TVS_NOSCROLL: DWORD = 0x2000; +pub const TVS_NONEVENHEIGHT: DWORD = 0x4000; +pub const TVS_NOHSCROLL: DWORD = 0x8000; +pub const TVS_EX_NOSINGLECOLLAPSE: DWORD = 0x0001; +pub const TVS_EX_MULTISELECT: DWORD = 0x0002; +pub const TVS_EX_DOUBLEBUFFER: DWORD = 0x0004; +pub const TVS_EX_NOINDENTSTATE: DWORD = 0x0008; +pub const TVS_EX_RICHTOOLTIP: DWORD = 0x0010; +pub const TVS_EX_AUTOHSCROLL: DWORD = 0x0020; +pub const TVS_EX_FADEINOUTEXPANDOS: DWORD = 0x0040; +pub const TVS_EX_PARTIALCHECKBOXES: DWORD = 0x0080; +pub const TVS_EX_EXCLUSIONCHECKBOXES: DWORD = 0x0100; +pub const TVS_EX_DIMMEDCHECKBOXES: DWORD = 0x0200; +pub const TVS_EX_DRAWIMAGEASYNC: DWORD = 0x0400; +pub enum TREEITEM {} +pub type HTREEITEM = *mut TREEITEM; +pub const TVIF_TEXT: UINT = 0x0001; +pub const TVIF_IMAGE: UINT = 0x0002; +pub const TVIF_PARAM: UINT = 0x0004; +pub const TVIF_STATE: UINT = 0x0008; +pub const TVIF_HANDLE: UINT = 0x0010; +pub const TVIF_SELECTEDIMAGE: UINT = 0x0020; +pub const TVIF_CHILDREN: UINT = 0x0040; +pub const TVIF_INTEGRAL: UINT = 0x0080; +pub const TVIF_STATEEX: UINT = 0x0100; +pub const TVIF_EXPANDEDIMAGE: UINT = 0x0200; +pub const TVIS_SELECTED: UINT = 0x0002; +pub const TVIS_CUT: UINT = 0x0004; +pub const TVIS_DROPHILITED: UINT = 0x0008; +pub const TVIS_BOLD: UINT = 0x0010; +pub const TVIS_EXPANDED: UINT = 0x0020; +pub const TVIS_EXPANDEDONCE: UINT = 0x0040; +pub const TVIS_EXPANDPARTIAL: UINT = 0x0080; +pub const TVIS_OVERLAYMASK: UINT = 0x0F00; +pub const TVIS_STATEIMAGEMASK: UINT = 0xF000; +pub const TVIS_USERMASK: UINT = 0xF000; +pub const TVIS_EX_FLAT: UINT = 0x0001; +pub const TVIS_EX_DISABLED: UINT = 0x0002; +pub const TVIS_EX_ALL: UINT = 0x0002; +STRUCT!{struct NMTVSTATEIMAGECHANGING { + hdr: NMHDR, + hti: HTREEITEM, + iOldStateImageIndex: c_int, + iNewStateImageIndex: c_int, +}} +pub type LPNMTVSTATEIMAGECHANGING = *mut NMTVSTATEIMAGECHANGING; +pub const I_CHILDRENCALLBACK: c_int = -1; +pub const I_CHILDRENAUTO: c_int = -2; +pub type LPTV_ITEMW = LPTVITEMW; +pub type LPTV_ITEMA = LPTVITEMA; +pub type TV_ITEMW = TVITEMW; +pub type TV_ITEMA = TVITEMA; +STRUCT!{struct TVITEMA { + mask: UINT, + hItem: HTREEITEM, + state: UINT, + stateMask: UINT, + pszText: LPSTR, + cchTextMax: c_int, + iImage: c_int, + iSelectedImage: c_int, + cChildren: c_int, + lParam: LPARAM, +}} +pub type LPTVITEMA = *mut TVITEMA; +STRUCT!{struct TVITEMW { + mask: UINT, + hItem: HTREEITEM, + state: UINT, + stateMask: UINT, + pszText: LPWSTR, + cchTextMax: c_int, + iImage: c_int, + iSelectedImage: c_int, + cChildren: c_int, + lParam: LPARAM, +}} +pub type LPTVITEMW = *mut TVITEMW; +STRUCT!{struct TVITEMEXA { + mask: UINT, + hItem: HTREEITEM, + state: UINT, + stateMask: UINT, + pszText: LPSTR, + cchTextMax: c_int, + iImage: c_int, + iSelectedImage: c_int, + cChildren: c_int, + lParam: LPARAM, + iIntegral: c_int, + uStateEx: UINT, + hwnd: HWND, + iExpandedImage: c_int, + iReserved: c_int, +}} +pub type LPTVITEMEXA = *mut TVITEMEXA; +STRUCT!{struct TVITEMEXW { + mask: UINT, + hItem: HTREEITEM, + state: UINT, + stateMask: UINT, + pszText: LPWSTR, + cchTextMax: c_int, + iImage: c_int, + iSelectedImage: c_int, + cChildren: c_int, + lParam: LPARAM, + iIntegral: c_int, + uStateEx: UINT, + hwnd: HWND, + iExpandedImage: c_int, + iReserved: c_int, +}} +pub type LPTVITEMEXW = *mut TVITEMEXW; +pub const TVI_ROOT: HTREEITEM = -0x10000isize as HTREEITEM; +pub const TVI_FIRST: HTREEITEM = -0x0FFFFisize as HTREEITEM; +pub const TVI_LAST: HTREEITEM = -0x0FFFEisize as HTREEITEM; +pub const TVI_SORT: HTREEITEM = -0x0FFFDisize as HTREEITEM; +pub type LPTV_INSERTSTRUCTA = LPTVINSERTSTRUCTA; +pub type LPTV_INSERTSTRUCTW = LPTVINSERTSTRUCTW; +pub type TV_INSERTSTRUCTA = TVINSERTSTRUCTA; +pub type TV_INSERTSTRUCTW = TVINSERTSTRUCTW; +UNION!{union TVINSERTSTRUCTA_u { + [u32; 15] [u64; 10], + itemex itemex_mut: TVITEMEXA, + item item_mut: TV_ITEMA, +}} +STRUCT!{struct TVINSERTSTRUCTA { + hParent: HTREEITEM, + hInsertAfter: HTREEITEM, + u: TVINSERTSTRUCTA_u, +}} +pub type LPTVINSERTSTRUCTA = *mut TVINSERTSTRUCTA; +UNION!{union TVINSERTSTRUCTW_u { + [u32; 15] [u64; 10], + itemex itemex_mut: TVITEMEXW, + item item_mut: TV_ITEMW, +}} +STRUCT!{struct TVINSERTSTRUCTW { + hParent: HTREEITEM, + hInsertAfter: HTREEITEM, + u: TVINSERTSTRUCTW_u, +}} +pub type LPTVINSERTSTRUCTW = *mut TVINSERTSTRUCTW; +pub const TVM_INSERTITEMA: UINT = TV_FIRST + 0; +pub const TVM_INSERTITEMW: UINT = TV_FIRST + 50; +pub const TVM_DELETEITEM: UINT = TV_FIRST + 1; +pub const TVM_EXPAND: UINT = TV_FIRST + 2; +pub const TVE_COLLAPSE: WPARAM = 0x0001; +pub const TVE_EXPAND: WPARAM = 0x0002; +pub const TVE_TOGGLE: WPARAM = 0x0003; +pub const TVE_EXPANDPARTIAL: WPARAM = 0x4000; +pub const TVE_COLLAPSERESET: WPARAM = 0x8000; +pub const TVM_GETITEMRECT: UINT = TV_FIRST + 4; +pub const TVM_GETCOUNT: UINT = TV_FIRST + 5; +pub const TVM_GETINDENT: UINT = TV_FIRST + 6; +pub const TVM_SETINDENT: UINT = TV_FIRST + 7; +pub const TVM_GETIMAGELIST: UINT = TV_FIRST + 8; +pub const TVSIL_NORMAL: WPARAM = 0; +pub const TVSIL_STATE: WPARAM = 2; +pub const TVM_SETIMAGELIST: UINT = TV_FIRST + 9; +pub const TVM_GETNEXTITEM: UINT = TV_FIRST + 10; +pub const TVGN_ROOT: WPARAM = 0x0000; +pub const TVGN_NEXT: WPARAM = 0x0001; +pub const TVGN_PREVIOUS: WPARAM = 0x0002; +pub const TVGN_PARENT: WPARAM = 0x0003; +pub const TVGN_CHILD: WPARAM = 0x0004; +pub const TVGN_FIRSTVISIBLE: WPARAM = 0x0005; +pub const TVGN_NEXTVISIBLE: WPARAM = 0x0006; +pub const TVGN_PREVIOUSVISIBLE: WPARAM = 0x0007; +pub const TVGN_DROPHILITE: WPARAM = 0x0008; +pub const TVGN_CARET: WPARAM = 0x0009; +pub const TVGN_LASTVISIBLE: WPARAM = 0x000A; +pub const TVGN_NEXTSELECTED: WPARAM = 0x000B; +pub const TVSI_NOSINGLEEXPAND: WPARAM = 0x8000; +pub const TVM_SELECTITEM: UINT = TV_FIRST + 11; +pub const TVM_GETITEMA: UINT = TV_FIRST + 12; +pub const TVM_GETITEMW: UINT = TV_FIRST + 62; +pub const TVM_SETITEMA: UINT = TV_FIRST + 13; +pub const TVM_SETITEMW: UINT = TV_FIRST + 63; +pub const TVM_EDITLABELA: UINT = TV_FIRST + 14; +pub const TVM_EDITLABELW: UINT = TV_FIRST + 65; +pub const TVM_GETEDITCONTROL: UINT = TV_FIRST + 15; +pub const TVM_GETVISIBLECOUNT: UINT = TV_FIRST + 16; +pub const TVM_HITTEST: UINT = TV_FIRST + 17; +pub type LPTV_HITTESTINFO = LPTVHITTESTINFO; +pub type TV_HITTESTINFO = TVHITTESTINFO; +STRUCT!{struct TVHITTESTINFO { + pt: POINT, + flags: UINT, + hItem: HTREEITEM, +}} +pub type LPTVHITTESTINFO = *mut TVHITTESTINFO; +pub const TVHT_NOWHERE: UINT = 0x0001; +pub const TVHT_ONITEMICON: UINT = 0x0002; +pub const TVHT_ONITEMLABEL: UINT = 0x0004; +pub const TVHT_ONITEM: UINT = TVHT_ONITEMICON | TVHT_ONITEMLABEL | TVHT_ONITEMSTATEICON; +pub const TVHT_ONITEMINDENT: UINT = 0x0008; +pub const TVHT_ONITEMBUTTON: UINT = 0x0010; +pub const TVHT_ONITEMRIGHT: UINT = 0x0020; +pub const TVHT_ONITEMSTATEICON: UINT = 0x0040; +pub const TVHT_ABOVE: UINT = 0x0100; +pub const TVHT_BELOW: UINT = 0x0200; +pub const TVHT_TORIGHT: UINT = 0x0400; +pub const TVHT_TOLEFT: UINT = 0x0800; +pub const TVM_CREATEDRAGIMAGE: UINT = TV_FIRST + 18; +pub const TVM_SORTCHILDREN: UINT = TV_FIRST + 19; +pub const TVM_ENSUREVISIBLE: UINT = TV_FIRST + 20; +pub const TVM_SORTCHILDRENCB: UINT = TV_FIRST + 21; +pub const TVM_ENDEDITLABELNOW: UINT = TV_FIRST + 22; +pub const TVM_GETISEARCHSTRINGA: UINT = TV_FIRST + 23; +pub const TVM_GETISEARCHSTRINGW: UINT = TV_FIRST + 64; +pub const TVM_SETTOOLTIPS: UINT = TV_FIRST + 24; +pub const TVM_GETTOOLTIPS: UINT = TV_FIRST + 25; +pub const TVM_SETINSERTMARK: UINT = TV_FIRST + 26; +pub const TVM_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const TVM_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const TVM_SETITEMHEIGHT: UINT = TV_FIRST + 27; +pub const TVM_GETITEMHEIGHT: UINT = TV_FIRST + 28; +pub const TVM_SETBKCOLOR: UINT = TV_FIRST + 29; +pub const TVM_SETTEXTCOLOR: UINT = TV_FIRST + 30; +pub const TVM_GETBKCOLOR: UINT = TV_FIRST + 31; +pub const TVM_GETTEXTCOLOR: UINT = TV_FIRST + 32; +pub const TVM_SETSCROLLTIME: UINT = TV_FIRST + 33; +pub const TVM_GETSCROLLTIME: UINT = TV_FIRST + 34; +pub const TVM_SETINSERTMARKCOLOR: UINT = TV_FIRST + 37; +pub const TVM_GETINSERTMARKCOLOR: UINT = TV_FIRST + 38; +pub const TVM_SETBORDER: UINT = TV_FIRST + 35; +pub const TVSBF_XBORDER: WPARAM = 0x00000001; +pub const TVSBF_YBORDER: WPARAM = 0x00000002; +pub const TVM_GETITEMSTATE: UINT = TV_FIRST + 39; +pub const TVM_SETLINECOLOR: UINT = TV_FIRST + 40; +pub const TVM_GETLINECOLOR: UINT = TV_FIRST + 41; +pub const TVM_MAPACCIDTOHTREEITEM: UINT = TV_FIRST + 42; +pub const TVM_MAPHTREEITEMTOACCID: UINT = TV_FIRST + 43; +pub const TVM_SETEXTENDEDSTYLE: UINT = TV_FIRST + 44; +pub const TVM_GETEXTENDEDSTYLE: UINT = TV_FIRST + 45; +pub const TVM_SETAUTOSCROLLINFO: UINT = TV_FIRST + 59; +pub const TVM_SETHOT: UINT = TV_FIRST + 58; +pub const TVM_GETSELECTEDCOUNT: UINT = TV_FIRST + 70; +pub const TVM_SHOWINFOTIP: UINT = TV_FIRST + 71; +ENUM!{enum TVITEMPART { + TVGIPR_BUTTON = 0x0001, +}} +STRUCT!{struct TVGETITEMPARTRECTINFO { + hti: HTREEITEM, + prc: *mut RECT, + partID: TVITEMPART, +}} +pub const TVM_GETITEMPARTRECT: UINT = TV_FIRST + 72; +FN!{stdcall PFNTVCOMPARE( + lParam1: LPARAM, + lParam2: LPARAM, + lParamSort: LPARAM, +) -> c_int} +pub type LPTV_SORTCB = LPTVSORTCB; +pub type TV_SORTCB = TVSORTCB; +STRUCT!{struct TVSORTCB { + hParent: HTREEITEM, + lpfnCompare: PFNTVCOMPARE, + lParam: LPARAM, +}} +pub type LPTVSORTCB = *mut TVSORTCB; +pub type LPNM_TREEVIEWA = LPNMTREEVIEWA; +pub type LPNM_TREEVIEWW = LPNMTREEVIEWW; +pub type NM_TREEVIEWA = NMTREEVIEWA; +pub type NM_TREEVIEWW = NMTREEVIEWW; +STRUCT!{struct NMTREEVIEWA { + hdr: NMHDR, + action: UINT, + itemOld: TVITEMA, + itemNew: TVITEMA, + ptDrag: POINT, +}} +pub type LPNMTREEVIEWA = *mut NMTREEVIEWA; +STRUCT!{struct NMTREEVIEWW { + hdr: NMHDR, + action: UINT, + itemOld: TVITEMW, + itemNew: TVITEMW, + ptDrag: POINT, +}} +pub type LPNMTREEVIEWW = *mut NMTREEVIEWW; +pub const TVN_SELCHANGINGA: UINT = TVN_FIRST - 1; +pub const TVN_SELCHANGINGW: UINT = TVN_FIRST - 50; +pub const TVN_SELCHANGEDA: UINT = TVN_FIRST - 2; +pub const TVN_SELCHANGEDW: UINT = TVN_FIRST - 51; +pub const TVC_UNKNOWN: LPARAM = 0x0000; +pub const TVC_BYMOUSE: LPARAM = 0x0001; +pub const TVC_BYKEYBOARD: LPARAM = 0x0002; +pub const TVN_GETDISPINFOA: UINT = TVN_FIRST - 3; +pub const TVN_GETDISPINFOW: UINT = TVN_FIRST - 52; +pub const TVN_SETDISPINFOA: UINT = TVN_FIRST - 4; +pub const TVN_SETDISPINFOW: UINT = TVN_FIRST - 53; +pub const TVIF_DI_SETITEM: UINT = 0x1000; +pub type TV_DISPINFOA = NMTVDISPINFOA; +pub type TV_DISPINFOW = NMTVDISPINFOW; +STRUCT!{struct NMTVDISPINFOA { + hdr: NMHDR, + item: TVITEMA, +}} +pub type LPNMTVDISPINFOA = *mut NMTVDISPINFOA; +STRUCT!{struct NMTVDISPINFOW { + hdr: NMHDR, + item: TVITEMW, +}} +pub type LPNMTVDISPINFOW = *mut NMTVDISPINFOW; +STRUCT!{struct NMTVDISPINFOEXA { + hdr: NMHDR, + item: TVITEMEXA, +}} +pub type LPNMTVDISPINFOEXA = *mut NMTVDISPINFOEXA; +STRUCT!{struct NMTVDISPINFOEXW { + hdr: NMHDR, + item: TVITEMEXW, +}} +pub type LPNMTVDISPINFOEXW = *mut NMTVDISPINFOEXW; +pub type TV_DISPINFOEXA = NMTVDISPINFOEXA; +pub type TV_DISPINFOEXW = NMTVDISPINFOEXW; +pub const TVN_ITEMEXPANDINGA: UINT = TVN_FIRST - 5; +pub const TVN_ITEMEXPANDINGW: UINT = TVN_FIRST - 54; +pub const TVN_ITEMEXPANDEDA: UINT = TVN_FIRST - 6; +pub const TVN_ITEMEXPANDEDW: UINT = TVN_FIRST - 55; +pub const TVN_BEGINDRAGA: UINT = TVN_FIRST - 7; +pub const TVN_BEGINDRAGW: UINT = TVN_FIRST - 56; +pub const TVN_BEGINRDRAGA: UINT = TVN_FIRST - 8; +pub const TVN_BEGINRDRAGW: UINT = TVN_FIRST - 57; +pub const TVN_DELETEITEMA: UINT = TVN_FIRST - 9; +pub const TVN_DELETEITEMW: UINT = TVN_FIRST - 58; +pub const TVN_BEGINLABELEDITA: UINT = TVN_FIRST - 10; +pub const TVN_BEGINLABELEDITW: UINT = TVN_FIRST - 59; +pub const TVN_ENDLABELEDITA: UINT = TVN_FIRST - 11; +pub const TVN_ENDLABELEDITW: UINT = TVN_FIRST - 60; +pub const TVN_KEYDOWN: UINT = TVN_FIRST - 12; +pub const TVN_GETINFOTIPA: UINT = TVN_FIRST - 13; +pub const TVN_GETINFOTIPW: UINT = TVN_FIRST - 14; +pub const TVN_SINGLEEXPAND: UINT = TVN_FIRST - 15; +pub const TVNRET_DEFAULT: LRESULT = 0; +pub const TVNRET_SKIPOLD: LRESULT = 1; +pub const TVNRET_SKIPNEW: LRESULT = 2; +pub const TVN_ITEMCHANGINGA: UINT = TVN_FIRST - 16; +pub const TVN_ITEMCHANGINGW: UINT = TVN_FIRST - 17; +pub const TVN_ITEMCHANGEDA: UINT = TVN_FIRST - 18; +pub const TVN_ITEMCHANGEDW: UINT = TVN_FIRST - 19; +pub const TVN_ASYNCDRAW: UINT = TVN_FIRST - 20; +pub type TV_KEYDOWN = NMTVKEYDOWN; +STRUCT!{#[repr(packed)] struct NMTVKEYDOWN { + hdr: NMHDR, + wVKey: WORD, + flags: UINT, +}} +pub type LPNMTVKEYDOWN = *mut NMTVKEYDOWN; +STRUCT!{struct NMTVCUSTOMDRAW { + nmcd: NMCUSTOMDRAW, + clrText: COLORREF, + clrTextBk: COLORREF, + iLevel: c_int, +}} +pub type LPNMTVCUSTOMDRAW = *mut NMTVCUSTOMDRAW; +STRUCT!{struct NMTVGETINFOTIPA { + hdr: NMHDR, + pszText: LPSTR, + cchTextMax: c_int, + hItem: HTREEITEM, + lParam: LPARAM, +}} +pub type LPNMTVGETINFOTIPA = *mut NMTVGETINFOTIPA; +STRUCT!{struct NMTVGETINFOTIPW { + hdr: NMHDR, + pszText: LPWSTR, + cchTextMax: c_int, + hItem: HTREEITEM, + lParam: LPARAM, +}} +pub type LPNMTVGETINFOTIPW = *mut NMTVGETINFOTIPW; +pub const TVCDRF_NOIMAGES: LRESULT = 0x00010000; +STRUCT!{struct NMTVITEMCHANGE { + hdr: NMHDR, + uChanged: UINT, + hItem: HTREEITEM, + uStateNew: UINT, + uStateOld: UINT, + lParam: LPARAM, +}} +STRUCT!{struct NMTVASYNCDRAW { + hdr: NMHDR, + pimldp: *mut IMAGELISTDRAWPARAMS, + hr: HRESULT, + hItem: HTREEITEM, + lParam: LPARAM, + dwRetFlags: DWORD, + iRetImageIndex: c_int, +}} +pub const WC_COMBOBOXEX: &'static str = "ComboBoxEx32"; +pub const CBEIF_TEXT: UINT = 0x00000001; +pub const CBEIF_IMAGE: UINT = 0x00000002; +pub const CBEIF_SELECTEDIMAGE: UINT = 0x00000004; +pub const CBEIF_OVERLAY: UINT = 0x00000008; +pub const CBEIF_INDENT: UINT = 0x00000010; +pub const CBEIF_LPARAM: UINT = 0x00000020; +pub const CBEIF_DI_SETITEM: UINT = 0x10000000; +STRUCT!{struct COMBOBOXEXITEMA { + mask: UINT, + iItem: INT_PTR, + pszText: LPSTR, + cchTextMax: c_int, + iImage: c_int, + iSelectedImage: c_int, + iOverlay: c_int, + iIndent: c_int, + lParam: LPARAM, +}} +pub type PCOMBOBOXEXITEMA = *mut COMBOBOXEXITEMA; +pub type PCCOMBOBOXEXITEMA = *const COMBOBOXEXITEMA; +STRUCT!{struct COMBOBOXEXITEMW { + mask: UINT, + iItem: INT_PTR, + pszText: LPWSTR, + cchTextMax: c_int, + iImage: c_int, + iSelectedImage: c_int, + iOverlay: c_int, + iIndent: c_int, + lParam: LPARAM, +}} +pub type PCOMBOBOXEXITEMW = *mut COMBOBOXEXITEMW; +pub type PCCOMBOBOXEXITEMW = *const COMBOBOXEXITEMW; +pub const CBEM_INSERTITEMA: UINT = WM_USER + 1; +pub const CBEM_SETIMAGELIST: UINT = WM_USER + 2; +pub const CBEM_GETIMAGELIST: UINT = WM_USER + 3; +pub const CBEM_GETITEMA: UINT = WM_USER + 4; +pub const CBEM_SETITEMA: UINT = WM_USER + 5; +pub const CBEM_DELETEITEM: UINT = CB_DELETESTRING; +pub const CBEM_GETCOMBOCONTROL: UINT = WM_USER + 6; +pub const CBEM_GETEDITCONTROL: UINT = WM_USER + 7; +pub const CBEM_SETEXSTYLE: UINT = WM_USER + 8; +pub const CBEM_SETEXTENDEDSTYLE: UINT = WM_USER + 14; +pub const CBEM_GETEXSTYLE: UINT = WM_USER + 9; +pub const CBEM_GETEXTENDEDSTYLE: UINT = WM_USER + 9; +pub const CBEM_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const CBEM_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const CBEM_HASEDITCHANGED: UINT = WM_USER + 10; +pub const CBEM_INSERTITEMW: UINT = WM_USER + 11; +pub const CBEM_SETITEMW: UINT = WM_USER + 12; +pub const CBEM_GETITEMW: UINT = WM_USER + 13; +pub const CBEM_SETWINDOWTHEME: UINT = CCM_SETWINDOWTHEME; +pub const CBES_EX_NOEDITIMAGE: DWORD = 0x00000001; +pub const CBES_EX_NOEDITIMAGEINDENT: DWORD = 0x00000002; +pub const CBES_EX_PATHWORDBREAKPROC: DWORD = 0x00000004; +pub const CBES_EX_NOSIZELIMIT: DWORD = 0x00000008; +pub const CBES_EX_CASESENSITIVE: DWORD = 0x00000010; +pub const CBES_EX_TEXTENDELLIPSIS: DWORD = 0x00000020; +STRUCT!{struct NMCOMBOBOXEXA { + hdr: NMHDR, + ceItem: COMBOBOXEXITEMA, +}} +pub type PNMCOMBOBOXEXA = *mut NMCOMBOBOXEXA; +STRUCT!{struct NMCOMBOBOXEXW { + hdr: NMHDR, + ceItem: COMBOBOXEXITEMW, +}} +pub type PNMCOMBOBOXEXW = *mut NMCOMBOBOXEXW; +pub const CBEN_GETDISPINFOA: UINT = CBEN_FIRST - 0; +pub const CBEN_INSERTITEM: UINT = CBEN_FIRST - 1; +pub const CBEN_DELETEITEM: UINT = CBEN_FIRST - 2; +pub const CBEN_BEGINEDIT: UINT = CBEN_FIRST - 4; +pub const CBEN_ENDEDITA: UINT = CBEN_FIRST - 5; +pub const CBEN_ENDEDITW: UINT = CBEN_FIRST - 6; +pub const CBEN_GETDISPINFOW: UINT = CBEN_FIRST - 7; +pub const CBEN_DRAGBEGINA: UINT = CBEN_FIRST - 8; +pub const CBEN_DRAGBEGINW: UINT = CBEN_FIRST - 9; +pub const CBENF_KILLFOCUS: c_int = 1; +pub const CBENF_RETURN: c_int = 2; +pub const CBENF_ESCAPE: c_int = 3; +pub const CBENF_DROPDOWN: c_int = 4; +pub const CBEMAXSTRLEN: usize = 260; +STRUCT!{struct NMCBEDRAGBEGINW { + hdr: NMHDR, + iItemid: c_int, + szText: [WCHAR; CBEMAXSTRLEN], +}} +pub type PNMCBEDRAGBEGINW = *mut NMCBEDRAGBEGINW; +pub type LPNMCBEDRAGBEGINW = *mut NMCBEDRAGBEGINW; +STRUCT!{struct NMCBEDRAGBEGINA { + hdr: NMHDR, + iItemid: c_int, + szText: [c_char; CBEMAXSTRLEN], +}} +pub type PNMCBEDRAGBEGINA = *mut NMCBEDRAGBEGINA; +pub type LPNMCBEDRAGBEGINA = *mut NMCBEDRAGBEGINA; +STRUCT!{struct NMCBEENDEDITW { + hdr: NMHDR, + fChanged: BOOL, + iNewSelection: c_int, + szText: [WCHAR; CBEMAXSTRLEN], + iWhy: c_int, +}} +pub type PNMCBEENDEDITW = *mut NMCBEENDEDITW; +pub type LPNMCBEENDEDITW = *mut NMCBEENDEDITW; +STRUCT!{struct NMCBEENDEDITA { + hdr: NMHDR, + fChanged: BOOL, + iNewSelection: c_int, + szText: [c_char; CBEMAXSTRLEN], + iWhy: c_int, +}} +pub type PNMCBEENDEDITA = *mut NMCBEENDEDITA; +pub type LPNMCBEENDEDITA = *mut NMCBEENDEDITA; +pub const WC_TABCONTROL: &'static str = "SysTabControl32"; +pub const TCS_SCROLLOPPOSITE: DWORD = 0x0001; +pub const TCS_BOTTOM: DWORD = 0x0002; +pub const TCS_RIGHT: DWORD = 0x0002; +pub const TCS_MULTISELECT: DWORD = 0x0004; +pub const TCS_FLATBUTTONS: DWORD = 0x0008; +pub const TCS_FORCEICONLEFT: DWORD = 0x0010; +pub const TCS_FORCELABELLEFT: DWORD = 0x0020; +pub const TCS_HOTTRACK: DWORD = 0x0040; +pub const TCS_VERTICAL: DWORD = 0x0080; +pub const TCS_TABS: DWORD = 0x0000; +pub const TCS_BUTTONS: DWORD = 0x0100; +pub const TCS_SINGLELINE: DWORD = 0x0000; +pub const TCS_MULTILINE: DWORD = 0x0200; +pub const TCS_RIGHTJUSTIFY: DWORD = 0x0000; +pub const TCS_FIXEDWIDTH: DWORD = 0x0400; +pub const TCS_RAGGEDRIGHT: DWORD = 0x0800; +pub const TCS_FOCUSONBUTTONDOWN: DWORD = 0x1000; +pub const TCS_OWNERDRAWFIXED: DWORD = 0x2000; +pub const TCS_TOOLTIPS: DWORD = 0x4000; +pub const TCS_FOCUSNEVER: DWORD = 0x8000; +pub const TCS_EX_FLATSEPARATORS: DWORD = 0x00000001; +pub const TCS_EX_REGISTERDROP: DWORD = 0x00000002; +pub const TCM_GETIMAGELIST: UINT = TCM_FIRST + 2; +pub const TCM_SETIMAGELIST: UINT = TCM_FIRST + 3; +pub const TCM_GETITEMCOUNT: UINT = TCM_FIRST + 4; +pub const TCIF_TEXT: UINT = 0x0001; +pub const TCIF_IMAGE: UINT = 0x0002; +pub const TCIF_RTLREADING: UINT = 0x0004; +pub const TCIF_PARAM: UINT = 0x0008; +pub const TCIF_STATE: UINT = 0x0010; +pub const TCIS_BUTTONPRESSED: DWORD = 0x0001; +pub const TCIS_HIGHLIGHTED: DWORD = 0x0002; +pub type TC_ITEMHEADERA = TCITEMHEADERA; +pub type TC_ITEMHEADERW = TCITEMHEADERW; +STRUCT!{struct TCITEMHEADERA { + mask: UINT, + lpReserved1: UINT, + lpReserved2: UINT, + pszText: LPSTR, + cchTextMax: c_int, + iImage: c_int, +}} +pub type LPTCITEMHEADERA = *mut TCITEMHEADERA; +STRUCT!{struct TCITEMHEADERW { + mask: UINT, + lpReserved1: UINT, + lpReserved2: UINT, + pszText: LPWSTR, + cchTextMax: c_int, + iImage: c_int, +}} +pub type LPTCITEMHEADERW = *mut TCITEMHEADERW; +pub type TC_ITEMA = TCITEMA; +pub type TC_ITEMW = TCITEMW; +STRUCT!{struct TCITEMA { + mask: UINT, + dwState: DWORD, + dwStateMask: DWORD, + pszText: LPSTR, + cchTextMax: c_int, + iImage: c_int, + lParam: LPARAM, +}} +pub type LPTCITEMA = *mut TCITEMA; +STRUCT!{struct TCITEMW { + mask: UINT, + dwState: DWORD, + dwStateMask: DWORD, + pszText: LPWSTR, + cchTextMax: c_int, + iImage: c_int, + lParam: LPARAM, +}} +pub type LPTCITEMW = *mut TCITEMW; +pub const TCM_GETITEMA: UINT = TCM_FIRST + 5; +pub const TCM_GETITEMW: UINT = TCM_FIRST + 60; +pub const TCM_SETITEMA: UINT = TCM_FIRST + 6; +pub const TCM_SETITEMW: UINT = TCM_FIRST + 61; +pub const TCM_INSERTITEMA: UINT = TCM_FIRST + 7; +pub const TCM_INSERTITEMW: UINT = TCM_FIRST + 62; +pub const TCM_DELETEITEM: UINT = TCM_FIRST + 8; +pub const TCM_DELETEALLITEMS: UINT = TCM_FIRST + 9; +pub const TCM_GETITEMRECT: UINT = TCM_FIRST + 10; +pub const TCM_GETCURSEL: UINT = TCM_FIRST + 11; +pub const TCM_SETCURSEL: UINT = TCM_FIRST + 12; +pub const TCHT_NOWHERE: UINT = 0x0001; +pub const TCHT_ONITEMICON: UINT = 0x0002; +pub const TCHT_ONITEMLABEL: UINT = 0x0004; +pub const TCHT_ONITEM: UINT = TCHT_ONITEMICON | TCHT_ONITEMLABEL; +pub type LPTC_HITTESTINFO = LPTCHITTESTINFO; +pub type TC_HITTESTINFO = TCHITTESTINFO; +STRUCT!{struct TCHITTESTINFO { + pt: POINT, + flags: UINT, +}} +pub type LPTCHITTESTINFO = *mut TCHITTESTINFO; +pub const TCM_HITTEST: UINT = TCM_FIRST + 13; +pub const TCM_SETITEMEXTRA: UINT = TCM_FIRST + 14; +pub const TCM_ADJUSTRECT: UINT = TCM_FIRST + 40; +pub const TCM_SETITEMSIZE: UINT = TCM_FIRST + 41; +pub const TCM_REMOVEIMAGE: UINT = TCM_FIRST + 42; +pub const TCM_SETPADDING: UINT = TCM_FIRST + 43; +pub const TCM_GETROWCOUNT: UINT = TCM_FIRST + 44; +pub const TCM_GETTOOLTIPS: UINT = TCM_FIRST + 45; +pub const TCM_SETTOOLTIPS: UINT = TCM_FIRST + 46; +pub const TCM_GETCURFOCUS: UINT = TCM_FIRST + 47; +pub const TCM_SETCURFOCUS: UINT = TCM_FIRST + 48; +pub const TCM_SETMINTABWIDTH: UINT = TCM_FIRST + 49; +pub const TCM_DESELECTALL: UINT = TCM_FIRST + 50; +pub const TCM_HIGHLIGHTITEM: UINT = TCM_FIRST + 51; +pub const TCM_SETEXTENDEDSTYLE: UINT = TCM_FIRST + 52; +pub const TCM_GETEXTENDEDSTYLE: UINT = TCM_FIRST + 53; +pub const TCM_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const TCM_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const TCN_KEYDOWN: UINT = TCN_FIRST - 0; +pub type TC_KEYDOWN = NMTCKEYDOWN; +STRUCT!{#[repr(packed)] struct NMTCKEYDOWN { + hdr: NMHDR, + wVKey: WORD, + flags: UINT, +}} +pub const TCN_SELCHANGE: UINT = TCN_FIRST - 1; +pub const TCN_SELCHANGING: UINT = TCN_FIRST - 2; +pub const TCN_GETOBJECT: UINT = TCN_FIRST - 3; +pub const TCN_FOCUSCHANGE: UINT = TCN_FIRST - 4; +pub const ANIMATE_CLASS: &'static str = "SysAnimate32"; +pub const ACS_CENTER: DWORD = 0x0001; +pub const ACS_TRANSPARENT: DWORD = 0x0002; +pub const ACS_AUTOPLAY: DWORD = 0x0004; +pub const ACS_TIMER: DWORD = 0x0008; +pub const ACM_OPENA: UINT = WM_USER + 100; +pub const ACM_OPENW: UINT = WM_USER + 103; +pub const ACM_PLAY: UINT = WM_USER + 101; +pub const ACM_STOP: UINT = WM_USER + 102; +pub const ACM_ISPLAYING: UINT = WM_USER + 104; +pub const ACN_START: WPARAM = 1; +pub const ACN_STOP: WPARAM = 2; +pub const MONTHCAL_CLASS: &'static str = "SysMonthCal32"; +pub type MONTHDAYSTATE = DWORD; +pub type LPMONTHDAYSTATE = *mut DWORD; +pub const MCM_FIRST: UINT = 0x1000; +pub const MCM_GETCURSEL: UINT = MCM_FIRST + 1; +pub const MCM_SETCURSEL: UINT = MCM_FIRST + 2; +pub const MCM_GETMAXSELCOUNT: UINT = MCM_FIRST + 3; +pub const MCM_SETMAXSELCOUNT: UINT = MCM_FIRST + 4; +pub const MCM_GETSELRANGE: UINT = MCM_FIRST + 5; +pub const MCM_SETSELRANGE: UINT = MCM_FIRST + 6; +pub const MCM_GETMONTHRANGE: UINT = MCM_FIRST + 7; +pub const MCM_SETDAYSTATE: UINT = MCM_FIRST + 8; +pub const MCM_GETMINREQRECT: UINT = MCM_FIRST + 9; +pub const MCM_SETCOLOR: UINT = MCM_FIRST + 10; +pub const MCM_GETCOLOR: UINT = MCM_FIRST + 11; +pub const MCSC_BACKGROUND: WPARAM = 0; +pub const MCSC_TEXT: WPARAM = 1; +pub const MCSC_TITLEBK: WPARAM = 2; +pub const MCSC_TITLETEXT: WPARAM = 3; +pub const MCSC_MONTHBK: WPARAM = 4; +pub const MCSC_TRAILINGTEXT: WPARAM = 5; +pub const MCM_SETTODAY: UINT = MCM_FIRST + 12; +pub const MCM_GETTODAY: UINT = MCM_FIRST + 13; +pub const MCM_HITTEST: UINT = MCM_FIRST + 14; +STRUCT!{struct MCHITTESTINFO { + cbSize: UINT, + pt: POINT, + uHit: UINT, + st: SYSTEMTIME, + rc: RECT, + iOffset: c_int, + iRow: c_int, + iCol: c_int, +}} +pub type PMCHITTESTINFO = *mut MCHITTESTINFO; +pub const MCHT_TITLE: UINT = 0x00010000; +pub const MCHT_CALENDAR: UINT = 0x00020000; +pub const MCHT_TODAYLINK: UINT = 0x00030000; +pub const MCHT_CALENDARCONTROL: UINT = 0x00100000; +pub const MCHT_NEXT: UINT = 0x01000000; +pub const MCHT_PREV: UINT = 0x02000000; +pub const MCHT_NOWHERE: UINT = 0x00000000; +pub const MCHT_TITLEBK: UINT = MCHT_TITLE; +pub const MCHT_TITLEMONTH: UINT = MCHT_TITLE | 0x0001; +pub const MCHT_TITLEYEAR: UINT = MCHT_TITLE | 0x0002; +pub const MCHT_TITLEBTNNEXT: UINT = MCHT_TITLE | MCHT_NEXT | 0x0003; +pub const MCHT_TITLEBTNPREV: UINT = MCHT_TITLE | MCHT_PREV | 0x0003; +pub const MCHT_CALENDARBK: UINT = MCHT_CALENDAR; +pub const MCHT_CALENDARDATE: UINT = MCHT_CALENDAR | 0x0001; +pub const MCHT_CALENDARDATENEXT: UINT = MCHT_CALENDARDATE | MCHT_NEXT; +pub const MCHT_CALENDARDATEPREV: UINT = MCHT_CALENDARDATE | MCHT_PREV; +pub const MCHT_CALENDARDAY: UINT = MCHT_CALENDAR | 0x0002; +pub const MCHT_CALENDARWEEKNUM: UINT = MCHT_CALENDAR | 0x0003; +pub const MCHT_CALENDARDATEMIN: UINT = MCHT_CALENDAR | 0x0004; +pub const MCHT_CALENDARDATEMAX: UINT = MCHT_CALENDAR | 0x0005; +pub const MCM_SETFIRSTDAYOFWEEK: UINT = MCM_FIRST + 15; +pub const MCM_GETFIRSTDAYOFWEEK: UINT = MCM_FIRST + 16; +pub const MCM_GETRANGE: UINT = MCM_FIRST + 17; +pub const MCM_SETRANGE: UINT = MCM_FIRST + 18; +pub const MCM_GETMONTHDELTA: UINT = MCM_FIRST + 19; +pub const MCM_SETMONTHDELTA: UINT = MCM_FIRST + 20; +pub const MCM_GETMAXTODAYWIDTH: UINT = MCM_FIRST + 21; +pub const MCM_SETUNICODEFORMAT: UINT = CCM_SETUNICODEFORMAT; +pub const MCM_GETUNICODEFORMAT: UINT = CCM_GETUNICODEFORMAT; +pub const MCMV_MONTH: DWORD = 0; +pub const MCMV_YEAR: DWORD = 1; +pub const MCMV_DECADE: DWORD = 2; +pub const MCMV_CENTURY: DWORD = 3; +pub const MCMV_MAX: DWORD = MCMV_CENTURY; +pub const MCM_GETCURRENTVIEW: UINT = MCM_FIRST + 22; +pub const MCM_GETCALENDARCOUNT: UINT = MCM_FIRST + 23; +pub const MCGIP_CALENDARCONTROL: DWORD = 0; +pub const MCGIP_NEXT: DWORD = 1; +pub const MCGIP_PREV: DWORD = 2; +pub const MCGIP_FOOTER: DWORD = 3; +pub const MCGIP_CALENDAR: DWORD = 4; +pub const MCGIP_CALENDARHEADER: DWORD = 5; +pub const MCGIP_CALENDARBODY: DWORD = 6; +pub const MCGIP_CALENDARROW: DWORD = 7; +pub const MCGIP_CALENDARCELL: DWORD = 8; +pub const MCGIF_DATE: DWORD = 0x00000001; +pub const MCGIF_RECT: DWORD = 0x00000002; +pub const MCGIF_NAME: DWORD = 0x00000004; +STRUCT!{struct MCGRIDINFO { + cbSize: UINT, + dwPart: DWORD, + dwFlags: DWORD, + iCalendar: c_int, + iRow: c_int, + iCol: c_int, + bSelected: BOOL, + stStart: SYSTEMTIME, + stEnd: SYSTEMTIME, + rc: RECT, + pszName: PWSTR, + cchName: size_t, +}} +pub type PMCGRIDINFO = *mut MCGRIDINFO; +pub const MCM_GETCALENDARGRIDINFO: UINT = MCM_FIRST + 24; +pub const MCM_GETCALID: UINT = MCM_FIRST + 27; +pub const MCM_SETCALID: UINT = MCM_FIRST + 28; +pub const MCM_SIZERECTTOMIN: UINT = MCM_FIRST + 29; +pub const MCM_SETCALENDARBORDER: UINT = MCM_FIRST + 30; +pub const MCM_GETCALENDARBORDER: UINT = MCM_FIRST + 31; +pub const MCM_SETCURRENTVIEW: UINT = MCM_FIRST + 32; +STRUCT!{struct NMSELCHANGE { + nmhdr: NMHDR, + stSelStart: SYSTEMTIME, + stSelEnd: SYSTEMTIME, +}} +pub type LPNMSELCHANGE = *mut NMSELCHANGE; +pub const MCN_SELCHANGE: UINT = MCN_FIRST - 3; +STRUCT!{struct NMDAYSTATE { + nmhdr: NMHDR, + stStart: SYSTEMTIME, + cDayState: c_int, + prgDayState: LPMONTHDAYSTATE, +}} +pub type LPNMDAYSTATE = *mut NMDAYSTATE; +pub const MCN_GETDAYSTATE: UINT = MCN_FIRST - 1; +pub type NMSELECT = NMSELCHANGE; +pub type LPNMSELECT = *mut NMSELCHANGE; +pub const MCN_SELECT: UINT = MCN_FIRST; +STRUCT!{struct NMVIEWCHANGE { + nmhdr: NMHDR, + dwOldView: DWORD, + dwNewView: DWORD, +}} +pub type LPNMVIEWCHANGE = *mut NMVIEWCHANGE; +pub const MCN_VIEWCHANGE: UINT = MCN_FIRST - 4; +pub const MCS_DAYSTATE: DWORD = 0x0001; +pub const MCS_MULTISELECT: DWORD = 0x0002; +pub const MCS_WEEKNUMBERS: DWORD = 0x0004; +pub const MCS_NOTODAYCIRCLE: DWORD = 0x0008; +pub const MCS_NOTODAY: DWORD = 0x0010; +pub const MCS_NOTRAILINGDATES: DWORD = 0x0040; +pub const MCS_SHORTDAYSOFWEEK: DWORD = 0x0080; +pub const MCS_NOSELCHANGEONNAV: DWORD = 0x0100; +pub const GMR_VISIBLE: DWORD = 0; +pub const GMR_DAYSTATE: DWORD = 1; +pub const DATETIMEPICK_CLASS: &'static str = "SysDateTimePick32"; +STRUCT!{struct DATETIMEPICKERINFO { + cbSize: UINT, + rcCheck: RECT, + stateCheck: DWORD, + rcButton: RECT, + stateButton: DWORD, + hwndEdit: HWND, + hwndUD: HWND, + hwndDropDown: HWND, +}} +pub type LPDATETIMEPICKERINFO = *mut DATETIMEPICKERINFO; +pub const DTM_FIRST: UINT = 0x1000; +pub const DTM_GETSYSTEMTIME: UINT = DTM_FIRST + 1; +pub const DTM_SETSYSTEMTIME: UINT = DTM_FIRST + 2; +pub const DTM_GETRANGE: UINT = DTM_FIRST + 3; +pub const DTM_SETRANGE: UINT = DTM_FIRST + 4; +pub const DTM_SETFORMATA: UINT = DTM_FIRST + 5; +pub const DTM_SETFORMATW: UINT = DTM_FIRST + 50; +pub const DTM_SETMCCOLOR: UINT = DTM_FIRST + 6; +pub const DTM_GETMCCOLOR: UINT = DTM_FIRST + 7; +pub const DTM_GETMONTHCAL: UINT = DTM_FIRST + 8; +pub const DTM_SETMCFONT: UINT = DTM_FIRST + 9; +pub const DTM_GETMCFONT: UINT = DTM_FIRST + 10; +pub const DTM_SETMCSTYLE: UINT = DTM_FIRST + 11; +pub const DTM_GETMCSTYLE: UINT = DTM_FIRST + 12; +pub const DTM_CLOSEMONTHCAL: UINT = DTM_FIRST + 13; +pub const DTM_GETDATETIMEPICKERINFO: UINT = DTM_FIRST + 14; +pub const DTM_GETIDEALSIZE: UINT = DTM_FIRST + 15; +pub const DTS_UPDOWN: DWORD = 0x0001; +pub const DTS_SHOWNONE: DWORD = 0x0002; +pub const DTS_SHORTDATEFORMAT: DWORD = 0x0000; +pub const DTS_LONGDATEFORMAT: DWORD = 0x0004; +pub const DTS_SHORTDATECENTURYFORMAT: DWORD = 0x000C; +pub const DTS_TIMEFORMAT: DWORD = 0x0009; +pub const DTS_APPCANPARSE: DWORD = 0x0010; +pub const DTS_RIGHTALIGN: DWORD = 0x0020; +pub const DTN_DATETIMECHANGE: UINT = DTN_FIRST2 - 6; +STRUCT!{struct NMDATETIMECHANGE { + nmhdr: NMHDR, + dwFlags: DWORD, + st: SYSTEMTIME, +}} +pub type LPNMDATETIMECHANGE = *mut NMDATETIMECHANGE; +pub const DTN_USERSTRINGA: UINT = DTN_FIRST2 - 5; +pub const DTN_USERSTRINGW: UINT = DTN_FIRST - 5; +STRUCT!{struct NMDATETIMESTRINGA { + nmhdr: NMHDR, + pszUserString: LPCSTR, + st: SYSTEMTIME, + dwFlags: DWORD, +}} +pub type LPNMDATETIMESTRINGA = *mut NMDATETIMESTRINGA; +STRUCT!{struct NMDATETIMESTRINGW { + nmhdr: NMHDR, + pszUserString: LPCWSTR, + st: SYSTEMTIME, + dwFlags: DWORD, +}} +pub type LPNMDATETIMESTRINGW = *mut NMDATETIMESTRINGW; +pub const DTN_WMKEYDOWNA: UINT = DTN_FIRST2 - 4; +pub const DTN_WMKEYDOWNW: UINT = DTN_FIRST - 4; +STRUCT!{struct NMDATETIMEWMKEYDOWNA { + nmhdr: NMHDR, + nVirtKey: c_int, + pszFormat: LPCSTR, + st: SYSTEMTIME, +}} +pub type LPNMDATETIMEWMKEYDOWNA = *mut NMDATETIMEWMKEYDOWNA; +STRUCT!{struct NMDATETIMEWMKEYDOWNW { + nmhdr: NMHDR, + nVirtKey: c_int, + pszFormat: LPCWSTR, + st: SYSTEMTIME, +}} +pub type LPNMDATETIMEWMKEYDOWNW = *mut NMDATETIMEWMKEYDOWNW; +pub const DTN_FORMATA: UINT = DTN_FIRST2 - 3; +pub const DTN_FORMATW: UINT = DTN_FIRST - 3; +STRUCT!{struct NMDATETIMEFORMATA { + nmhdr: NMHDR, + pszFormat: LPCSTR, + st: SYSTEMTIME, + pszDisplay: LPCSTR, + szDisplay: [CHAR; 64], +}} +pub type LPNMDATETIMEFORMATA = *mut NMDATETIMEFORMATA; +STRUCT!{struct NMDATETIMEFORMATW { + nmhdr: NMHDR, + pszFormat: LPCWSTR, + st: SYSTEMTIME, + pszDisplay: LPCWSTR, + szDisplay: [WCHAR; 64], +}} +pub type LPNMDATETIMEFORMATW = *mut NMDATETIMEFORMATW; +pub const DTN_FORMATQUERYA: UINT = DTN_FIRST2 - 2; +pub const DTN_FORMATQUERYW: UINT = DTN_FIRST - 2; +STRUCT!{struct NMDATETIMEFORMATQUERYA { + nmhdr: NMHDR, + pszFormat: LPCSTR, + szMax: SIZE, +}} +pub type LPNMDATETIMEFORMATQUERYA = *mut NMDATETIMEFORMATQUERYA; +STRUCT!{struct NMDATETIMEFORMATQUERYW { + nmhdr: NMHDR, + pszFormat: LPCWSTR, + szMax: SIZE, +}} +pub type LPNMDATETIMEFORMATQUERYW = *mut NMDATETIMEFORMATQUERYW; +pub const DTN_DROPDOWN: UINT = DTN_FIRST2 - 1; +pub const DTN_CLOSEUP: UINT = DTN_FIRST2; +pub const GDTR_MIN: WPARAM = 0x0001; +pub const GDTR_MAX: WPARAM = 0x0002; +pub const GDT_ERROR: LRESULT = -1; +pub const GDT_VALID: LRESULT = 0; +pub const GDT_NONE: LRESULT = 1; +pub const IPM_CLEARADDRESS: UINT = WM_USER + 100; +pub const IPM_SETADDRESS: UINT = WM_USER + 101; +pub const IPM_GETADDRESS: UINT = WM_USER + 102; +pub const IPM_SETRANGE: UINT = WM_USER + 103; +pub const IPM_SETFOCUS: UINT = WM_USER + 104; +pub const IPM_ISBLANK: UINT = WM_USER + 105; +pub const WC_IPADDRESS: &'static str = "SysIPAddress32"; +pub const IPN_FIELDCHANGED: UINT = IPN_FIRST - 0; +STRUCT!{struct NMIPADDRESS { + hdr: NMHDR, + iField: c_int, + iValue: c_int, +}} +pub type LPNMIPADDRESS = *mut NMIPADDRESS; +#[inline] +pub fn MAKEIPRANGE(low: BYTE, high: BYTE) -> LPARAM { + (((high as WORD) << 8) + low as WORD) as LPARAM +} +#[inline] +pub fn MAKEIPADDRESS(b1: DWORD, b2: DWORD, b3: DWORD, b4: DWORD) -> LPARAM { + ((b1 << 24) + (b2 << 16) + (b3 << 8) + b4) as LPARAM +} +#[inline] +pub fn FIRST_IPADDRESS(x: LPARAM) -> BYTE { + ((x >> 24) & 0xff) as BYTE +} +#[inline] +pub fn SECOND_IPADDRESS(x: LPARAM) -> BYTE { + ((x >> 16) & 0xff) as BYTE +} +#[inline] +pub fn THIRD_IPADDRESS(x: LPARAM) -> BYTE { + ((x >> 8) & 0xff) as BYTE +} +#[inline] +pub fn FOURTH_IPADDRESS(x: LPARAM) -> BYTE { + (x & 0xff) as BYTE +} +pub const WC_PAGESCROLLER: &'static str = "SysPager"; +pub const PGS_VERT: DWORD = 0x00000000; +pub const PGS_HORZ: DWORD = 0x00000001; +pub const PGS_AUTOSCROLL: DWORD = 0x00000002; +pub const PGS_DRAGNDROP: DWORD = 0x00000004; +pub const PGF_INVISIBLE: DWORD = 0; +pub const PGF_NORMAL: DWORD = 1; +pub const PGF_GRAYED: DWORD = 2; +pub const PGF_DEPRESSED: DWORD = 4; +pub const PGF_HOT: DWORD = 8; +pub const PGB_TOPORLEFT: c_int = 0; +pub const PGB_BOTTOMORRIGHT: c_int = 1; +pub const PGM_SETCHILD: UINT = PGM_FIRST + 1; +pub const PGM_RECALCSIZE: UINT = PGM_FIRST + 2; +pub const PGM_FORWARDMOUSE: UINT = PGM_FIRST + 3; +pub const PGM_SETBKCOLOR: UINT = PGM_FIRST + 4; +pub const PGM_GETBKCOLOR: UINT = PGM_FIRST + 5; +pub const PGM_SETBORDER: UINT = PGM_FIRST + 6; +pub const PGM_GETBORDER: UINT = PGM_FIRST + 7; +pub const PGM_SETPOS: UINT = PGM_FIRST + 8; +pub const PGM_GETPOS: UINT = PGM_FIRST + 9; +pub const PGM_SETBUTTONSIZE: UINT = PGM_FIRST + 10; +pub const PGM_GETBUTTONSIZE: UINT = PGM_FIRST + 11; +pub const PGM_GETBUTTONSTATE: UINT = PGM_FIRST + 12; +pub const PGM_GETDROPTARGET: UINT = CCM_GETDROPTARGET; +pub const PGM_SETSCROLLINFO: UINT = PGM_FIRST + 13; +pub const PGN_SCROLL: UINT = PGN_FIRST - 1; +pub const PGF_SCROLLUP: c_int = 1; +pub const PGF_SCROLLDOWN: c_int = 2; +pub const PGF_SCROLLLEFT: c_int = 4; +pub const PGF_SCROLLRIGHT: c_int = 8; +pub const PGK_SHIFT: BOOL = 1; +pub const PGK_CONTROL: BOOL = 2; +pub const PGK_MENU: BOOL = 4; +STRUCT!{#[repr(packed)] struct NMPGSCROLL { + hdr: NMHDR, + fwKeys: WORD, + rcParent: RECT, + iDir: c_int, + iXpos: c_int, + iYpos: c_int, + iScroll: c_int, +}} +pub type LPNMPGSCROLL = *mut NMPGSCROLL; +pub const PGN_CALCSIZE: UINT = PGN_FIRST - 2; +pub const PGF_CALCWIDTH: DWORD = 1; +pub const PGF_CALCHEIGHT: DWORD = 2; +STRUCT!{struct NMPGCALCSIZE { + hdr: NMHDR, + dwFlag: DWORD, + iWidth: c_int, + iHeight: c_int, +}} +pub type LPNMPGCALCSIZE = *mut NMPGCALCSIZE; +pub const PGN_HOTITEMCHANGE: UINT = PGN_FIRST - 3; +STRUCT!{struct NMPGHOTITEM { + hdr: NMHDR, + idOld: c_int, + idNew: c_int, + dwFlags: DWORD, +}} +pub type LPNMPGHOTITEM = *mut NMPGHOTITEM; +pub const WC_NATIVEFONTCTL: &'static str = "NativeFontCtl"; +pub const NFS_EDIT: DWORD = 0x0001; +pub const NFS_STATIC: DWORD = 0x0002; +pub const NFS_LISTCOMBO: DWORD = 0x0004; +pub const NFS_BUTTON: DWORD = 0x0008; +pub const NFS_ALL: DWORD = 0x0010; +pub const NFS_USEFONTASSOC: DWORD = 0x0020; +pub const WC_BUTTONA: &'static str = "Button"; +pub const BUTTON_IMAGELIST_ALIGN_LEFT: UINT = 0; +pub const BUTTON_IMAGELIST_ALIGN_RIGHT: UINT = 1; +pub const BUTTON_IMAGELIST_ALIGN_TOP: UINT = 2; +pub const BUTTON_IMAGELIST_ALIGN_BOTTOM: UINT = 3; +pub const BUTTON_IMAGELIST_ALIGN_CENTER: UINT = 4; +STRUCT!{struct BUTTON_IMAGELIST { + himl: HIMAGELIST, + margin: RECT, + uAlign: UINT, +}} +pub type PBUTTON_IMAGELIST = *mut BUTTON_IMAGELIST; +pub const BCM_GETIDEALSIZE: UINT = BCM_FIRST + 0x0001; +pub const BCM_SETIMAGELIST: UINT = BCM_FIRST + 0x0002; +pub const BCM_GETIMAGELIST: UINT = BCM_FIRST + 0x0003; +pub const BCM_SETTEXTMARGIN: UINT = BCM_FIRST + 0x0004; +pub const BCM_GETTEXTMARGIN: UINT = BCM_FIRST + 0x0005; +STRUCT!{struct NMBCHOTITEM { + hdr: NMHDR, + dwFlags: DWORD, +}} +pub type LPNMBCHOTITEM = *mut NMBCHOTITEM; +pub const BCN_HOTITEMCHANGE: UINT = BCN_FIRST + 0x0001; +pub const BS_SPLITBUTTON: UINT = 0x0000000C; +pub const BS_DEFSPLITBUTTON: UINT = 0x0000000D; +pub const BS_COMMANDLINK: UINT = 0x0000000E; +pub const BS_DEFCOMMANDLINK: UINT = 0x0000000F; +pub const BCSIF_GLYPH: UINT = 0x0001; +pub const BCSIF_IMAGE: UINT = 0x0002; +pub const BCSIF_STYLE: UINT = 0x0004; +pub const BCSIF_SIZE: UINT = 0x0008; +pub const BCSS_NOSPLIT: UINT = 0x0001; +pub const BCSS_STRETCH: UINT = 0x0002; +pub const BCSS_ALIGNLEFT: UINT = 0x0004; +pub const BCSS_IMAGE: UINT = 0x0008; +STRUCT!{struct BUTTON_SPLITINFO { + mask: UINT, + himlGlyph: HIMAGELIST, + uSplitStyle: UINT, + size: SIZE, +}} +pub type PBUTTON_SPLITINFO = *mut BUTTON_SPLITINFO; +pub const BCM_SETDROPDOWNSTATE: UINT = BCM_FIRST + 0x0006; +pub const BCM_SETSPLITINFO: UINT = BCM_FIRST + 0x0007; +pub const BCM_GETSPLITINFO: UINT = BCM_FIRST + 0x0008; +pub const BCM_SETNOTE: UINT = BCM_FIRST + 0x0009; +pub const BCM_GETNOTE: UINT = BCM_FIRST + 0x000A; +pub const BCM_GETNOTELENGTH: UINT = BCM_FIRST + 0x000B; +pub const BCM_SETSHIELD: UINT = BCM_FIRST + 0x000C; +pub const BCCL_NOGLYPH: HIMAGELIST = -1isize as HIMAGELIST; +STRUCT!{struct NMBCDROPDOWN { + hdr: NMHDR, + rcButton: RECT, +}} +pub type LPNMBCDROPDOWN = *mut NMBCDROPDOWN; +pub const BCN_DROPDOWN: UINT = BCN_FIRST + 0x0002; +pub const WC_STATIC: &'static str = "Static"; +pub const WC_EDIT: &'static str = "Edit"; +pub const EM_SETCUEBANNER: UINT = ECM_FIRST + 1; +pub const EM_GETCUEBANNER: UINT = ECM_FIRST + 2; +STRUCT!{struct EDITBALLOONTIP { + cbStruct: DWORD, + pszTitle: LPCWSTR, + pszText: LPCWSTR, + ttiIcon: INT, +}} +pub type PEDITBALLOONTIP = *mut EDITBALLOONTIP; +pub const EM_SHOWBALLOONTIP: UINT = ECM_FIRST + 3; +pub const EM_HIDEBALLOONTIP: UINT = ECM_FIRST + 4; +pub const EM_SETHILITE: UINT = ECM_FIRST + 5; +pub const EM_GETHILITE: UINT = ECM_FIRST + 6; +pub const EM_NOSETFOCUS: UINT = ECM_FIRST + 7; +pub const EM_TAKEFOCUS: UINT = ECM_FIRST + 8; +pub const WC_LISTBOX: &'static str = "ListBox"; +pub const WC_COMBOBOX: &'static str = "ComboBox"; +pub const CB_SETMINVISIBLE: UINT = CBM_FIRST + 1; +pub const CB_GETMINVISIBLE: UINT = CBM_FIRST + 2; +pub const CB_SETCUEBANNER: UINT = CBM_FIRST + 3; +pub const CB_GETCUEBANNER: UINT = CBM_FIRST + 4; +pub const WC_SCROLLBAR: &'static str = "ScrollBar"; +FN!{stdcall PFTASKDIALOGCALLBACK( + hwnd: HWND, + msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + lpRefData: LONG_PTR, +) -> HRESULT} +ENUM!{enum TASKDIALOG_FLAGS { + TDF_ENABLE_HYPERLINKS = 0x0001, + TDF_USE_HICON_MAIN = 0x0002, + TDF_USE_HICON_FOOTER = 0x0004, + TDF_ALLOW_DIALOG_CANCELLATION = 0x0008, + TDF_USE_COMMAND_LINKS = 0x0010, + TDF_USE_COMMAND_LINKS_NO_ICON = 0x0020, + TDF_EXPAND_FOOTER_AREA = 0x0040, + TDF_EXPANDED_BY_DEFAULT = 0x0080, + TDF_VERIFICATION_FLAG_CHECKED = 0x0100, + TDF_SHOW_PROGRESS_BAR = 0x0200, + TDF_SHOW_MARQUEE_PROGRESS_BAR = 0x0400, + TDF_CALLBACK_TIMER = 0x0800, + TDF_POSITION_RELATIVE_TO_WINDOW = 0x1000, + TDF_RTL_LAYOUT = 0x2000, + TDF_NO_DEFAULT_RADIO_BUTTON = 0x4000, + TDF_CAN_BE_MINIMIZED = 0x8000, + TDF_NO_SET_FOREGROUND = 0x00010000, + TDF_SIZE_TO_CONTENT = 0x01000000, +}} +ENUM!{enum TASKDIALOG_MESSAGES { + TDM_NAVIGATE_PAGE = WM_USER + 101, + TDM_CLICK_BUTTON = WM_USER + 102, + TDM_SET_MARQUEE_PROGRESS_BAR = WM_USER + 103, + TDM_SET_PROGRESS_BAR_STATE = WM_USER + 104, + TDM_SET_PROGRESS_BAR_RANGE = WM_USER + 105, + TDM_SET_PROGRESS_BAR_POS = WM_USER + 106, + TDM_SET_PROGRESS_BAR_MARQUEE = WM_USER + 107, + TDM_SET_ELEMENT_TEXT = WM_USER + 108, + TDM_CLICK_RADIO_BUTTON = WM_USER + 110, + TDM_ENABLE_BUTTON = WM_USER + 111, + TDM_ENABLE_RADIO_BUTTON = WM_USER + 112, + TDM_CLICK_VERIFICATION = WM_USER + 113, + TDM_UPDATE_ELEMENT_TEXT = WM_USER + 114, + TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE = WM_USER + 115, + TDM_UPDATE_ICON = WM_USER + 116, +}} +ENUM!{enum TASKDIALOG_NOTIFICATIONS { + TDN_CREATED = 0, + TDN_NAVIGATED = 1, + TDN_BUTTON_CLICKED = 2, + TDN_HYPERLINK_CLICKED = 3, + TDN_TIMER = 4, + TDN_DESTROYED = 5, + TDN_RADIO_BUTTON_CLICKED = 6, + TDN_DIALOG_CONSTRUCTED = 7, + TDN_VERIFICATION_CLICKED = 8, + TDN_HELP = 9, + TDN_EXPANDO_BUTTON_CLICKED = 10, +}} +STRUCT!{#[repr(packed)] struct TASKDIALOG_BUTTON { + nButtonID: c_int, + pszButtonText: PCWSTR, +}} +ENUM!{enum TASKDIALOG_ELEMENTS { + TDE_CONTENT, + TDE_EXPANDED_INFORMATION, + TDE_FOOTER, + TDE_MAIN_INSTRUCTION, +}} +ENUM!{enum TASKDIALOG_ICON_ELEMENTS { + TDIE_ICON_MAIN, + TDIE_ICON_FOOTER, +}} +pub const TD_WARNING_ICON: LPWSTR = MAKEINTRESOURCE!(-1i16); +pub const TD_ERROR_ICON: LPWSTR = MAKEINTRESOURCE!(-2i16); +pub const TD_INFORMATION_ICON: LPWSTR = MAKEINTRESOURCE!(-3i16); +pub const TD_SHIELD_ICON: LPWSTR = MAKEINTRESOURCE!(-4i16); +ENUM!{enum TASKDIALOG_COMMON_BUTTON_FLAGS { + TDCBF_OK_BUTTON = 0x0001, + TDCBF_YES_BUTTON = 0x0002, + TDCBF_NO_BUTTON = 0x0004, + TDCBF_CANCEL_BUTTON = 0x0008, + TDCBF_RETRY_BUTTON = 0x0010, + TDCBF_CLOSE_BUTTON = 0x0020, +}} +UNION!{#[repr(packed)] union TASKDIALOGCONFIG_u1 { + [usize; 1], + hMainIcon hMainIcon_mut: HICON, + pszMainIcon pszMainIcon_mut: PCWSTR, +}} +UNION!{#[repr(packed)] union TASKDIALOGCONFIG_u2 { + [usize; 1], + hFooterIcon hFooterIcon_mut: HICON, + pszFooterIcon pszFooterIcon_mut: PCWSTR, +}} +STRUCT!{#[repr(packed)] struct TASKDIALOGCONFIG { + cbSize: UINT, + hwndParent: HWND, + hInstance: HINSTANCE, + dwFlags: TASKDIALOG_FLAGS, + dwCommonButtons: TASKDIALOG_COMMON_BUTTON_FLAGS, + pszWindowTitle: PCWSTR, + u1: TASKDIALOGCONFIG_u1, + pszMainInstruction: PCWSTR, + pszContent: PCWSTR, + cButtons: UINT, + pButtons: *const TASKDIALOG_BUTTON, + nDefaultButton: c_int, + cRadioButtons: UINT, + pRadioButtons: *const TASKDIALOG_BUTTON, + nDefaultRadioButton: c_int, + pszVerificationText: PCWSTR, + pszExpandedInformation: PCWSTR, + pszExpandedControlText: PCWSTR, + pszCollapsedControlText: PCWSTR, + u2: TASKDIALOGCONFIG_u2, + pszFooter: PCWSTR, + pfCallback: PFTASKDIALOGCALLBACK, + lpCallbackData: LONG_PTR, + cxWidth: UINT, +}} +extern "system" { + pub fn TaskDialogIndirect( + pTaskConfig: *const TASKDIALOGCONFIG, + pnButton: *mut c_int, + pnRadioButton: *mut c_int, + pfVerificationFlagChecked: *mut BOOL, + ) -> HRESULT; + pub fn TaskDialog( + hwndOwner: HWND, + hInstance: HINSTANCE, + pszWindowTitle: PCWSTR, + pszMainInstruction: PCWSTR, + pszContent: PCWSTR, + dwCommonButtons: TASKDIALOG_COMMON_BUTTON_FLAGS, + pszIcon: PCWSTR, + pnButton: *mut c_int, + ) -> HRESULT; + pub fn InitMUILanguage( + uiLang: LANGID, + ); + pub fn GetMUILanguage() -> LANGID; + pub fn _TrackMouseEvent( + lpEventTrack: LPTRACKMOUSEEVENT, + ) -> BOOL; +} +pub const WSB_PROP_CYVSCROLL: UINT = 0x00000001; +pub const WSB_PROP_CXHSCROLL: UINT = 0x00000002; +pub const WSB_PROP_CYHSCROLL: UINT = 0x00000004; +pub const WSB_PROP_CXVSCROLL: UINT = 0x00000008; +pub const WSB_PROP_CXHTHUMB: UINT = 0x00000010; +pub const WSB_PROP_CYVTHUMB: UINT = 0x00000020; +pub const WSB_PROP_VBKGCOLOR: UINT = 0x00000040; +pub const WSB_PROP_HBKGCOLOR: UINT = 0x00000080; +pub const WSB_PROP_VSTYLE: UINT = 0x00000100; +pub const WSB_PROP_HSTYLE: UINT = 0x00000200; +pub const WSB_PROP_WINSTYLE: UINT = 0x00000400; +pub const WSB_PROP_PALETTE: UINT = 0x00000800; +pub const WSB_PROP_MASK: UINT = 0x00000FFF; +pub const FSB_FLAT_MODE: INT_PTR = 2; +pub const FSB_ENCARTA_MODE: INT_PTR = 1; +pub const FSB_REGULAR_MODE: INT_PTR = 0; +extern "system" { + pub fn FlatSB_EnableScrollBar( + hWnd: HWND, + wSBflags: c_int, + wArrows: UINT, + ) -> BOOL; + pub fn FlatSB_ShowScrollBar( + hWnd: HWND, + code: c_int, + fShow: BOOL, + ) -> BOOL; + pub fn FlatSB_GetScrollRange( + hWnd: HWND, + code: c_int, + lpMinPos: LPINT, + lpMaxPos: LPINT, + ) -> BOOL; + pub fn FlatSB_GetScrollInfo( + hwnd: HWND, + code: c_int, + lpsi: LPSCROLLINFO, + ) -> BOOL; + pub fn FlatSB_GetScrollPos( + hWnd: HWND, + code: c_int, + ) -> c_int; + pub fn FlatSB_GetScrollProp(hWnd: HWND, + propIndex: c_int, + pValue: LPINT, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn FlatSB_GetScrollPropPtr( + hWnd: HWND, + propIndex: c_int, + pValue: PINT_PTR, + ) -> BOOL; + pub fn FlatSB_SetScrollPos( + hWnd: HWND, + code: c_int, + pos: c_int, + fRedraw: BOOL, + ) -> c_int; + pub fn FlatSB_SetScrollInfo( + hWnd: HWND, + code: c_int, + psi: LPSCROLLINFO, + fRedraw: BOOL, + ) -> c_int; + pub fn FlatSB_SetScrollRange( + hWnd: HWND, + code: c_int, + min: c_int, + max: c_int, + fRedraw: BOOL, + ) -> c_int; + pub fn FlatSB_SetScrollProp( + hWnd: HWND, + index: UINT, + newValue: INT_PTR, + fRedraw: BOOL, + ) -> BOOL; + pub fn InitializeFlatSB( + hWnd: HWND, + ) -> BOOL; + pub fn UninitializeFlatSB( + hWnd: HWND, + ) -> HRESULT; +} +FN!{stdcall SUBCLASSPROC( + hWnd: HWND, + uMsg: UINT, + wParam: WPARAM, + lParam: LPARAM, + uIdSubclass: UINT_PTR, + dwRefData: DWORD_PTR, +) -> LRESULT} +extern "system" { + pub fn SetWindowSubclass( + hWnd: HWND, + pfnSubclass: SUBCLASSPROC, + uIdSubclass: UINT_PTR, + dwRefData: DWORD_PTR, + ) -> BOOL; + pub fn GetWindowSubclass( + hWnd: HWND, + pfnSubclass: SUBCLASSPROC, + uIdSubclass: UINT_PTR, + pdwRefData: *mut DWORD_PTR, + ) -> BOOL; + pub fn RemoveWindowSubclass( + hWnd: HWND, + pfnSubclass: SUBCLASSPROC, + uIdSubclass: UINT_PTR, + ) -> BOOL; + pub fn DefSubclassProc( + hWnd: HWND, + uMsg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; +} +ENUM!{enum REGCLS { + LIM_SMALL, + LIM_LARGE, +}} +extern "system" { + pub fn LoadIconMetric( + hinst: HINSTANCE, + pszName: PCWSTR, + lims: c_int, + phico: *mut HICON, + ) -> HRESULT; + pub fn LoadIconWithScaleDown( + hinst: HINSTANCE, + pszName: PCWSTR, + cx: c_int, + cy: c_int, + phico: *mut HICON, + ) -> HRESULT; + pub fn DrawShadowText( + hdc: HDC, + pszText: LPCWSTR, + cch: UINT, + prc: *mut RECT, + dwFlags: DWORD, + crText: COLORREF, + crShadow: COLORREF, + ixOffset: c_int, + iyOffset: c_int, + ) -> c_int; +} diff --git a/bash-5.1/vendor/winapi/src/um/commdlg.rs b/bash-5.1/vendor/winapi/src/um/commdlg.rs new file mode 100644 index 0000000000000000000000000000000000000000..c9326a6fcfcd37a25b7ba460327da3bb8e6b184f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/commdlg.rs @@ -0,0 +1,712 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! 32-Bit Common Dialog APIs +use ctypes::{c_short, c_void}; +use shared::basetsd::UINT_PTR; +use shared::minwindef::{ + BOOL, DWORD, HGLOBAL, HINSTANCE, INT, LPARAM, LPVOID, LRESULT, UINT, WORD, WPARAM, +}; +use shared::windef::{COLORREF, HDC, HWND, POINT, RECT}; +use um::prsht::HPROPSHEETPAGE; +use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN}; +use um::wingdi::{DM_COLLATE, DM_COPIES, LPDEVMODEW, LPLOGFONTA, LPLOGFONTW}; +use um::winnt::{HRESULT, LPCSTR, LPCWSTR, LPSTR, LPWSTR}; +use um::winuser::{NMHDR, WM_USER}; +FN!{stdcall LPOFNHOOKPROC( + HWND, + UINT, + WPARAM, + LPARAM, +) -> UINT_PTR} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct OPENFILENAME_NT4A { + lStructSize: DWORD, + hwndOwner: HWND, + hInstance: HINSTANCE, + lpstrFilter: LPCSTR, + lpstrCustomFilter: LPSTR, + nMaxCustFilter: DWORD, + nFilterIndex: DWORD, + lpstrFile: LPSTR, + nMaxFile: DWORD, + lpstrFileTitle: LPSTR, + nMaxFileTitle: DWORD, + lpstrInitialDir: LPCSTR, + lpstrTitle: LPCSTR, + Flags: DWORD, + nFileOffset: WORD, + nFileExtension: WORD, + lpstrDefExt: LPCSTR, + lCustData: LPARAM, + lpfnHook: LPOFNHOOKPROC, + lpTemplateName: LPCSTR, +}} +pub type LPOPENFILENAME_NT4A = *mut OPENFILENAME_NT4A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct OPENFILENAME_NT4W { + lStructSize: DWORD, + hwndOwner: HWND, + hInstance: HINSTANCE, + lpstrFilter: LPCWSTR, + lpstrCustomFilter: LPWSTR, + nMaxCustFilter: DWORD, + nFilterIndex: DWORD, + lpstrFile: LPWSTR, + nMaxFile: DWORD, + lpstrFileTitle: LPWSTR, + nMaxFileTitle: DWORD, + lpstrInitialDir: LPCWSTR, + lpstrTitle: LPCWSTR, + Flags: DWORD, + nFileOffset: WORD, + nFileExtension: WORD, + lpstrDefExt: LPCWSTR, + lCustData: LPARAM, + lpfnHook: LPOFNHOOKPROC, + lpTemplateName: LPCWSTR, +}} +pub type LPOPENFILENAME_NT4W = *mut OPENFILENAME_NT4W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct OPENFILENAMEA { + lStructSize: DWORD, + hwndOwner: HWND, + hInstance: HINSTANCE, + lpstrFilter: LPCSTR, + lpstrCustomFilter: LPSTR, + nMaxCustFilter: DWORD, + nFilterIndex: DWORD, + lpstrFile: LPSTR, + nMaxFile: DWORD, + lpstrFileTitle: LPSTR, + nMaxFileTitle: DWORD, + lpstrInitialDir: LPCSTR, + lpstrTitle: LPCSTR, + Flags: DWORD, + nFileOffset: WORD, + nFileExtension: WORD, + lpstrDefExt: LPCSTR, + lCustData: LPARAM, + lpfnHook: LPOFNHOOKPROC, + lpTemplateName: LPCSTR, + pvReserved: *mut c_void, + dwReserved: DWORD, + FlagsEx: DWORD, +}} +pub type LPOPENFILENAMEA = *mut OPENFILENAMEA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct OPENFILENAMEW { + lStructSize: DWORD, + hwndOwner: HWND, + hInstance: HINSTANCE, + lpstrFilter: LPCWSTR, + lpstrCustomFilter: LPWSTR, + nMaxCustFilter: DWORD, + nFilterIndex: DWORD, + lpstrFile: LPWSTR, + nMaxFile: DWORD, + lpstrFileTitle: LPWSTR, + nMaxFileTitle: DWORD, + lpstrInitialDir: LPCWSTR, + lpstrTitle: LPCWSTR, + Flags: DWORD, + nFileOffset: WORD, + nFileExtension: WORD, + lpstrDefExt: LPCWSTR, + lCustData: LPARAM, + lpfnHook: LPOFNHOOKPROC, + lpTemplateName: LPCWSTR, + pvReserved: *mut c_void, + dwReserved: DWORD, + FlagsEx: DWORD, +}} +pub type LPOPENFILENAMEW = *mut OPENFILENAMEW; +extern "system" { + pub fn GetOpenFileNameA( + lpofn: LPOPENFILENAMEA, + ) -> BOOL; + pub fn GetOpenFileNameW( + lpofn: LPOPENFILENAMEW, + ) -> BOOL; + pub fn GetSaveFileNameA( + lpofn: LPOPENFILENAMEA, + ) -> BOOL; + pub fn GetSaveFileNameW( + lpofn: LPOPENFILENAMEW, + ) -> BOOL; + pub fn GetFileTitleA( + lpszFile: LPCSTR, + Buf: LPSTR, + cchSize: WORD, + ) -> c_short; + pub fn GetFileTitleW( + lpszFile: LPCWSTR, + Buf: LPWSTR, + cchSize: WORD, + ) -> c_short; +} +pub const OFN_READONLY: DWORD = 0x00000001; +pub const OFN_OVERWRITEPROMPT: DWORD = 0x00000002; +pub const OFN_HIDEREADONLY: DWORD = 0x00000004; +pub const OFN_NOCHANGEDIR: DWORD = 0x00000008; +pub const OFN_SHOWHELP: DWORD = 0x00000010; +pub const OFN_ENABLEHOOK: DWORD = 0x00000020; +pub const OFN_ENABLETEMPLATE: DWORD = 0x00000040; +pub const OFN_ENABLETEMPLATEHANDLE: DWORD = 0x00000080; +pub const OFN_NOVALIDATE: DWORD = 0x00000100; +pub const OFN_ALLOWMULTISELECT: DWORD = 0x00000200; +pub const OFN_EXTENSIONDIFFERENT: DWORD = 0x00000400; +pub const OFN_PATHMUSTEXIST: DWORD = 0x00000800; +pub const OFN_FILEMUSTEXIST: DWORD = 0x00001000; +pub const OFN_CREATEPROMPT: DWORD = 0x00002000; +pub const OFN_SHAREAWARE: DWORD = 0x00004000; +pub const OFN_NOREADONLYRETURN: DWORD = 0x00008000; +pub const OFN_NOTESTFILECREATE: DWORD = 0x00010000; +pub const OFN_NONETWORKBUTTON: DWORD = 0x00020000; +pub const OFN_NOLONGNAMES: DWORD = 0x00040000; +pub const OFN_EXPLORER: DWORD = 0x00080000; +pub const OFN_NODEREFERENCELINKS: DWORD = 0x00100000; +pub const OFN_LONGNAMES: DWORD = 0x00200000; +pub const OFN_ENABLEINCLUDENOTIFY: DWORD = 0x00400000; +pub const OFN_ENABLESIZING: DWORD = 0x00800000; +pub const OFN_DONTADDTORECENT: DWORD = 0x02000000; +pub const OFN_FORCESHOWHIDDEN: DWORD = 0x10000000; +pub const OFN_EX_NOPLACESBAR: DWORD = 0x00000001; +pub const OFN_SHAREFALLTHROUGH: UINT_PTR = 2; +pub const OFN_SHARENOWARN: UINT_PTR = 1; +pub const OFN_SHAREWARN: UINT_PTR = 0; +FN!{stdcall LPCCHOOKPROC( + HWND, + UINT, + WPARAM, + LPARAM, +) -> UINT_PTR} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct OFNOTIFYA { + hdr: NMHDR, + lpOFN: LPOPENFILENAMEA, + pszFile: LPSTR, +}} +pub type LPOFNOTIFYA = *mut OFNOTIFYA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct OFNOTIFYW { + hdr: NMHDR, + lpOFN: LPOPENFILENAMEW, + pszFile: LPWSTR, +}} +pub type LPOFNOTIFYW = *mut OFNOTIFYW; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct OFNOTIFYEXA { + hdr: NMHDR, + lpOFN: LPOPENFILENAMEA, + psf: LPVOID, + pidl: LPVOID, +}} +pub type LPOFNOTIFYEXA = *mut OFNOTIFYEXA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct OFNOTIFYEXW { + hdr: NMHDR, + lpOFN: LPOPENFILENAMEW, + psf: LPVOID, + pidl: LPVOID, +}} +pub type LPOFNOTIFYEXW = *mut OFNOTIFYEXW; +pub const CDN_FIRST: UINT = -601i32 as u32; +pub const CDN_LAST: UINT = -699i32 as u32; +pub const CDN_INITDONE: UINT = CDN_FIRST - 0x0000; +pub const CDN_SELCHANGE: UINT = CDN_FIRST - 0x0001; +pub const CDN_FOLDERCHANGE: UINT = CDN_FIRST - 0x0002; +pub const CDN_SHAREVIOLATION: UINT = CDN_FIRST - 0x0003; +pub const CDN_HELP: UINT = CDN_FIRST - 0x0004; +pub const CDN_FILEOK: UINT = CDN_FIRST - 0x0005; +pub const CDN_TYPECHANGE: UINT = CDN_FIRST - 0x0006; +pub const CDN_INCLUDEITEM: UINT = CDN_FIRST - 0x0007; +pub const CDM_FIRST: UINT = WM_USER + 100; +pub const CDM_LAST: UINT = WM_USER + 200; +pub const CDM_GETSPEC: UINT = CDM_FIRST + 0x0000; +pub const CDM_GETFILEPATH: UINT = CDM_FIRST + 0x0001; +pub const CDM_GETFOLDERPATH: UINT = CDM_FIRST + 0x0002; +pub const CDM_GETFOLDERIDLIST: UINT = CDM_FIRST + 0x0003; +pub const CDM_SETCONTROLTEXT: UINT = CDM_FIRST + 0x0004; +pub const CDM_HIDECONTROL: UINT = CDM_FIRST + 0x0005; +pub const CDM_SETDEFEXT: UINT = CDM_FIRST + 0x0006; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct CHOOSECOLORA { + lStructSize: DWORD, + hwndOwner: HWND, + hInstance: HWND, + rgbResult: COLORREF, + lpCustColors: *mut COLORREF, + Flags: DWORD, + lCustData: LPARAM, + lpfnHook: LPCCHOOKPROC, + lpTemplateName: LPCSTR, +}} +pub type LPCHOOSECOLORA = *mut CHOOSECOLORA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct CHOOSECOLORW { + lStructSize: DWORD, + hwndOwner: HWND, + hInstance: HWND, + rgbResult: COLORREF, + lpCustColors: *mut COLORREF, + Flags: DWORD, + lCustData: LPARAM, + lpfnHook: LPCCHOOKPROC, + lpTemplateName: LPCWSTR, +}} +pub type LPCHOOSECOLORW = *mut CHOOSECOLORW; +extern "system" { + pub fn ChooseColorA( + lpcc: LPCHOOSECOLORA, + ) -> BOOL; + pub fn ChooseColorW( + lpcc: LPCHOOSECOLORW, + ) -> BOOL; +} +pub const CC_RGBINIT: DWORD = 0x00000001; +pub const CC_FULLOPEN: DWORD = 0x00000002; +pub const CC_PREVENTFULLOPEN: DWORD = 0x00000004; +pub const CC_SHOWHELP: DWORD = 0x00000008; +pub const CC_ENABLEHOOK: DWORD = 0x00000010; +pub const CC_ENABLETEMPLATE: DWORD = 0x00000020; +pub const CC_ENABLETEMPLATEHANDLE: DWORD = 0x00000040; +pub const CC_SOLIDCOLOR: DWORD = 0x00000080; +pub const CC_ANYCOLOR: DWORD = 0x00000100; +FN!{stdcall LPFRHOOKPROC( + HWND, + UINT, + WPARAM, + LPARAM, +) -> UINT_PTR} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FINDREPLACEA { + lStructSize: DWORD, + hwndOwner: HWND, + hInstance: HINSTANCE, + Flags: DWORD, + lpstrFindWhat: LPSTR, + lpstrReplaceWith: LPSTR, + wFindWhatLen: WORD, + wReplaceWithLen: WORD, + lCustData: LPARAM, + lpfnHook: LPFRHOOKPROC, + lpTemplateName: LPCSTR, +}} +pub type LPFINDREPLACEA = *mut FINDREPLACEA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FINDREPLACEW { + lStructSize: DWORD, + hwndOwner: HWND, + hInstance: HINSTANCE, + Flags: DWORD, + lpstrFindWhat: LPWSTR, + lpstrReplaceWith: LPWSTR, + wFindWhatLen: WORD, + wReplaceWithLen: WORD, + lCustData: LPARAM, + lpfnHook: LPFRHOOKPROC, + lpTemplateName: LPCWSTR, +}} +pub type LPFINDREPLACEW = *mut FINDREPLACEW; +pub const FR_DOWN: DWORD = 0x00000001; +pub const FR_WHOLEWORD: DWORD = 0x00000002; +pub const FR_MATCHCASE: DWORD = 0x00000004; +pub const FR_FINDNEXT: DWORD = 0x00000008; +pub const FR_REPLACE: DWORD = 0x00000010; +pub const FR_REPLACEALL: DWORD = 0x00000020; +pub const FR_DIALOGTERM: DWORD = 0x00000040; +pub const FR_SHOWHELP: DWORD = 0x00000080; +pub const FR_ENABLEHOOK: DWORD = 0x00000100; +pub const FR_ENABLETEMPLATE: DWORD = 0x00000200; +pub const FR_NOUPDOWN: DWORD = 0x00000400; +pub const FR_NOMATCHCASE: DWORD = 0x00000800; +pub const FR_NOWHOLEWORD: DWORD = 0x00001000; +pub const FR_ENABLETEMPLATEHANDLE: DWORD = 0x00002000; +pub const FR_HIDEUPDOWN: DWORD = 0x00004000; +pub const FR_HIDEMATCHCASE: DWORD = 0x00008000; +pub const FR_HIDEWHOLEWORD: DWORD = 0x00010000; +pub const FR_RAW: DWORD = 0x00020000; +pub const FR_MATCHDIAC: DWORD = 0x20000000; +pub const FR_MATCHKASHIDA: DWORD = 0x40000000; +pub const FR_MATCHALEFHAMZA: DWORD = 0x80000000; +extern "system" { + pub fn FindTextA( + lpfr: LPFINDREPLACEA, + ) -> HWND; + pub fn FindTextW( + lpfr: LPFINDREPLACEW, + ) -> HWND; + pub fn ReplaceTextA( + lpfr: LPFINDREPLACEA, + ) -> HWND; + pub fn ReplaceTextW( + lpfr: LPFINDREPLACEW, + ) -> HWND; +} +FN!{stdcall LPCFHOOKPROC( + HWND, + UINT, + WPARAM, + LPARAM, +) -> UINT_PTR} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct CHOOSEFONTA { + lStructSize: DWORD, + hwndOwner: HWND, + hDC: HDC, + lpLogFont: LPLOGFONTA, + iPointSize: INT, + Flags: DWORD, + rgbColors: COLORREF, + lCustData: LPARAM, + lpfnHook: LPCFHOOKPROC, + lpTemplateName: LPCSTR, + hInstance: HINSTANCE, + lpszStyle: LPSTR, + nFontType: WORD, + ___MISSING_ALIGNMENT__: WORD, + nSizeMin: INT, + nSizeMax: INT, +}} +pub type LPCHOOSEFONTA = *mut CHOOSEFONTA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct CHOOSEFONTW { + lStructSize: DWORD, + hwndOwner: HWND, + hDC: HDC, + lpLogFont: LPLOGFONTW, + iPointSize: INT, + Flags: DWORD, + rgbColors: COLORREF, + lCustData: LPARAM, + lpfnHook: LPCFHOOKPROC, + lpTemplateName: LPCWSTR, + hInstance: HINSTANCE, + lpszStyle: LPWSTR, + nFontType: WORD, + ___MISSING_ALIGNMENT__: WORD, + nSizeMin: INT, + nSizeMax: INT, +}} +pub type LPCHOOSEFONTW = *mut CHOOSEFONTW; +extern "system" { + pub fn ChooseFontA( + lpcf: LPCHOOSEFONTA, + ) -> BOOL; + pub fn ChooseFontW( + lpcf: LPCHOOSEFONTW, + ) -> BOOL; +} +pub const CF_SCREENFONTS: DWORD = 0x00000001; +pub const CF_PRINTERFONTS: DWORD = 0x00000002; +pub const CF_BOTH: DWORD = CF_SCREENFONTS | CF_PRINTERFONTS; +pub const CF_SHOWHELP: DWORD = 0x00000004; +pub const CF_ENABLEHOOK: DWORD = 0x00000008; +pub const CF_ENABLETEMPLATE: DWORD = 0x00000010; +pub const CF_ENABLETEMPLATEHANDLE: DWORD = 0x00000020; +pub const CF_INITTOLOGFONTSTRUCT: DWORD = 0x00000040; +pub const CF_USESTYLE: DWORD = 0x00000080; +pub const CF_EFFECTS: DWORD = 0x00000100; +pub const CF_APPLY: DWORD = 0x00000200; +pub const CF_ANSIONLY: DWORD = 0x00000400; +pub const CF_SCRIPTSONLY: DWORD = CF_ANSIONLY; +pub const CF_NOVECTORFONTS: DWORD = 0x00000800; +pub const CF_NOOEMFONTS: DWORD = CF_NOVECTORFONTS; +pub const CF_NOSIMULATIONS: DWORD = 0x00001000; +pub const CF_LIMITSIZE: DWORD = 0x00002000; +pub const CF_FIXEDPITCHONLY: DWORD = 0x00004000; +pub const CF_WYSIWYG: DWORD = 0x00008000; +pub const CF_FORCEFONTEXIST: DWORD = 0x00010000; +pub const CF_SCALABLEONLY: DWORD = 0x00020000; +pub const CF_TTONLY: DWORD = 0x00040000; +pub const CF_NOFACESEL: DWORD = 0x00080000; +pub const CF_NOSTYLESEL: DWORD = 0x00100000; +pub const CF_NOSIZESEL: DWORD = 0x00200000; +pub const CF_SELECTSCRIPT: DWORD = 0x00400000; +pub const CF_NOSCRIPTSEL: DWORD = 0x00800000; +pub const CF_NOVERTFONTS: DWORD = 0x01000000; +pub const CF_INACTIVEFONTS: DWORD = 0x02000000; +pub const SIMULATED_FONTTYPE: WORD = 0x8000; +pub const PRINTER_FONTTYPE: WORD = 0x4000; +pub const SCREEN_FONTTYPE: WORD = 0x2000; +pub const BOLD_FONTTYPE: WORD = 0x0100; +pub const ITALIC_FONTTYPE: WORD = 0x0200; +pub const REGULAR_FONTTYPE: WORD = 0x0400; +pub const PS_OPENTYPE_FONTTYPE: DWORD = 0x10000; +pub const TT_OPENTYPE_FONTTYPE: DWORD = 0x20000; +pub const TYPE1_FONTTYPE: DWORD = 0x40000; +pub const SYMBOL_FONTTYPE: DWORD = 0x80000; +pub const WM_CHOOSEFONT_GETLOGFONT: UINT = WM_USER + 1; +pub const WM_CHOOSEFONT_SETLOGFONT: UINT = WM_USER + 101; +pub const WM_CHOOSEFONT_SETFLAGS: UINT = WM_USER + 102; +pub const CD_LBSELNOITEMS: WORD = -1i16 as u16; +pub const CD_LBSELCHANGE: WORD = 0; +pub const CD_LBSELSUB: WORD = 1; +pub const CD_LBSELADD: WORD = 2; +FN!{stdcall LPPRINTHOOKPROC( + HWND, + UINT, + WPARAM, + LPARAM, +) -> UINT_PTR} +FN!{stdcall LPSETUPHOOKPROC( + HWND, + UINT, + WPARAM, + LPARAM, +) -> UINT_PTR} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct PRINTDLGA { + lStructSize: DWORD, + hwndOwner: HWND, + hDevMode: HGLOBAL, + hDevNames: HGLOBAL, + hDC: HDC, + Flags: DWORD, + nFromPage: WORD, + nToPage: WORD, + nMinPage: WORD, + nMaxPage: WORD, + nCopies: WORD, + hInstance: HINSTANCE, + lCustData: LPARAM, + lpfnPrintHook: LPPRINTHOOKPROC, + lpfnSetupHook: LPSETUPHOOKPROC, + lpPrintTemplateName: LPCSTR, + lpSetupTemplateName: LPCSTR, + hPrintTemplate: HGLOBAL, + hSetupTemplate: HGLOBAL, +}} +pub type LPPRINTDLGA = *mut PRINTDLGA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct PRINTDLGW { + lStructSize: DWORD, + hwndOwner: HWND, + hDevMode: HGLOBAL, + hDevNames: HGLOBAL, + hDC: HDC, + Flags: DWORD, + nFromPage: WORD, + nToPage: WORD, + nMinPage: WORD, + nMaxPage: WORD, + nCopies: WORD, + hInstance: HINSTANCE, + lCustData: LPARAM, + lpfnPrintHook: LPPRINTHOOKPROC, + lpfnSetupHook: LPSETUPHOOKPROC, + lpPrintTemplateName: LPCWSTR, + lpSetupTemplateName: LPCWSTR, + hPrintTemplate: HGLOBAL, + hSetupTemplate: HGLOBAL, +}} +pub type LPPRINTDLGW = *mut PRINTDLGW; +extern "system" { + pub fn PrintDlgA( + pPD: LPPRINTDLGA, + ) -> BOOL; + pub fn PrintDlgW( + pPD: LPPRINTDLGW, + ) -> BOOL; +} +RIDL!{#[uuid(0x5852a2c3, 0x6530, 0x11d1, 0xb6, 0xa3, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9)] +interface IPrintDialogCallback(IPrintDialogCallbackVtbl): IUnknown(IUnknownVtbl) { + fn InitDone() -> HRESULT, + fn SelectionChange() -> HRESULT, + fn HandleMessage( + hDlg: HWND, + uMsg: UINT, + wParam: WPARAM, + lParam: LPARAM, + pResult: *mut LRESULT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x509aaeda, 0x5639, 0x11d1, 0xb6, 0xa1, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9)] +interface IPrintDialogServices(IPrintDialogServicesVtbl): IUnknown(IUnknownVtbl) { + fn GetCurrentDevMode( + pDevMode: LPDEVMODEW, + pcbSize: *mut UINT, + ) -> HRESULT, + fn GetCurrentPrinterName( + pPrinterName: LPWSTR, + pcchSize: *mut UINT, + ) -> HRESULT, + fn GetCurrentPortName( + pPortName: LPWSTR, + pcchSize: *mut UINT, + ) -> HRESULT, +}} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct PRINTPAGERANGE { + nFromPage: DWORD, + nToPage: DWORD, +}} +pub type LPPRINTPAGERANGE = *mut PRINTPAGERANGE; +pub type PCPRINTPAGERANGE = *const PRINTPAGERANGE; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct PRINTDLGEXA { + lStructSize: DWORD, + hwndOwner: HWND, + hDevMode: HGLOBAL, + hDevNames: HGLOBAL, + hDC: HDC, + Flags: DWORD, + Flags2: DWORD, + ExclusionFlags: DWORD, + nPageRanges: DWORD, + nMaxPageRanges: DWORD, + lpPageRanges: LPPRINTPAGERANGE, + nMinPage: DWORD, + nMaxPage: DWORD, + nCopies: DWORD, + hInstance: HINSTANCE, + lpPrintTemplateName: LPCSTR, + lpCallback: LPUNKNOWN, + nPropertyPages: DWORD, + lphPropertyPages: *mut HPROPSHEETPAGE, + nStartPage: DWORD, + dwResultAction: DWORD, +}} +pub type LPPRINTDLGEXA = *mut PRINTDLGEXA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct PRINTDLGEXW { + lStructSize: DWORD, + hwndOwner: HWND, + hDevMode: HGLOBAL, + hDevNames: HGLOBAL, + hDC: HDC, + Flags: DWORD, + Flags2: DWORD, + ExclusionFlags: DWORD, + nPageRanges: DWORD, + nMaxPageRanges: DWORD, + lpPageRanges: LPPRINTPAGERANGE, + nMinPage: DWORD, + nMaxPage: DWORD, + nCopies: DWORD, + hInstance: HINSTANCE, + lpPrintTemplateName: LPCWSTR, + lpCallback: LPUNKNOWN, + nPropertyPages: DWORD, + lphPropertyPages: *mut HPROPSHEETPAGE, + nStartPage: DWORD, + dwResultAction: DWORD, +}} +pub type LPPRINTDLGEXW = *mut PRINTDLGEXW; +extern "system" { + pub fn PrintDlgExA( + pPD: LPPRINTDLGEXA, + ) -> HRESULT; + pub fn PrintDlgExW( + pPD: LPPRINTDLGEXW, + ) -> HRESULT; +} +pub const PD_ALLPAGES: DWORD = 0x00000000; +pub const PD_SELECTION: DWORD = 0x00000001; +pub const PD_PAGENUMS: DWORD = 0x00000002; +pub const PD_NOSELECTION: DWORD = 0x00000004; +pub const PD_NOPAGENUMS: DWORD = 0x00000008; +pub const PD_COLLATE: DWORD = 0x00000010; +pub const PD_PRINTTOFILE: DWORD = 0x00000020; +pub const PD_PRINTSETUP: DWORD = 0x00000040; +pub const PD_NOWARNING: DWORD = 0x00000080; +pub const PD_RETURNDC: DWORD = 0x00000100; +pub const PD_RETURNIC: DWORD = 0x00000200; +pub const PD_RETURNDEFAULT: DWORD = 0x00000400; +pub const PD_SHOWHELP: DWORD = 0x00000800; +pub const PD_ENABLEPRINTHOOK: DWORD = 0x00001000; +pub const PD_ENABLESETUPHOOK: DWORD = 0x00002000; +pub const PD_ENABLEPRINTTEMPLATE: DWORD = 0x00004000; +pub const PD_ENABLESETUPTEMPLATE: DWORD = 0x00008000; +pub const PD_ENABLEPRINTTEMPLATEHANDLE: DWORD = 0x00010000; +pub const PD_ENABLESETUPTEMPLATEHANDLE: DWORD = 0x00020000; +pub const PD_USEDEVMODECOPIES: DWORD = 0x00040000; +pub const PD_USEDEVMODECOPIESANDCOLLATE: DWORD = 0x00040000; +pub const PD_DISABLEPRINTTOFILE: DWORD = 0x00080000; +pub const PD_HIDEPRINTTOFILE: DWORD = 0x00100000; +pub const PD_NONETWORKBUTTON: DWORD = 0x00200000; +pub const PD_CURRENTPAGE: DWORD = 0x00400000; +pub const PD_NOCURRENTPAGE: DWORD = 0x00800000; +pub const PD_EXCLUSIONFLAGS: DWORD = 0x01000000; +pub const PD_USELARGETEMPLATE: DWORD = 0x10000000; +pub const PD_EXCL_COPIESANDCOLLATE: DWORD = DM_COPIES | DM_COLLATE; +pub const START_PAGE_GENERAL: DWORD = 0xffffffff; +pub const PD_RESULT_CANCEL: DWORD = 0; +pub const PD_RESULT_PRINT: DWORD = 1; +pub const PD_RESULT_APPLY: DWORD = 2; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct DEVNAMES { + wDriverOffset: WORD, + wDeviceOffset: WORD, + wOutputOffset: WORD, + wDefault: WORD, +}} +pub type LPDEVNAMES = *mut DEVNAMES; +pub type PCDEVNAMES = *const DEVNAMES; +pub const DN_DEFAULTPRN: WORD = 0x0001; +extern "system" { + pub fn CommDlgExtendedError() -> DWORD; +} +pub const WM_PSD_PAGESETUPDLG: UINT = WM_USER; +pub const WM_PSD_FULLPAGERECT: UINT = WM_USER + 1; +pub const WM_PSD_MINMARGINRECT: UINT = WM_USER + 2; +pub const WM_PSD_MARGINRECT: UINT = WM_USER + 3; +pub const WM_PSD_GREEKTEXTRECT: UINT = WM_USER + 4; +pub const WM_PSD_ENVSTAMPRECT: UINT = WM_USER + 5; +pub const WM_PSD_YAFULLPAGERECT: UINT = WM_USER + 6; +FN!{stdcall LPPAGEPAINTHOOK( + HWND, + UINT, + WPARAM, + LPARAM, +) -> UINT_PTR} +FN!{stdcall LPPAGESETUPHOOK( + HWND, + UINT, + WPARAM, + LPARAM, +) -> UINT_PTR} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct PAGESETUPDLGA { + lStructSize: DWORD, + hwndOwner: HWND, + hDevMode: HGLOBAL, + hDevNames: HGLOBAL, + Flags: DWORD, + ptPaperSize: POINT, + rtMinMargin: RECT, + rtMargin: RECT, + hInstance: HINSTANCE, + lCustData: LPARAM, + lpfnPageSetupHook: LPPAGESETUPHOOK, + lpfnPagePaintHook: LPPAGEPAINTHOOK, + lpPageSetupTemplateName: LPCSTR, + hPageSetupTemplate: HGLOBAL, +}} +pub type LPPAGESETUPDLGA = *mut PAGESETUPDLGA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct PAGESETUPDLGW { + lStructSize: DWORD, + hwndOwner: HWND, + hDevMode: HGLOBAL, + hDevNames: HGLOBAL, + Flags: DWORD, + ptPaperSize: POINT, + rtMinMargin: RECT, + rtMargin: RECT, + hInstance: HINSTANCE, + lCustData: LPARAM, + lpfnPageSetupHook: LPPAGESETUPHOOK, + lpfnPagePaintHook: LPPAGEPAINTHOOK, + lpPageSetupTemplateName: LPCWSTR, + hPageSetupTemplate: HGLOBAL, +}} +pub type LPPAGESETUPDLGW = *mut PAGESETUPDLGW; +extern "system" { + pub fn PageSetupDlgA( + lppsd: LPPAGESETUPDLGA, + ) -> BOOL; + pub fn PageSetupDlgW( + lppsd: LPPAGESETUPDLGW, + ) -> BOOL; +} +pub const PSD_DEFAULTMINMARGINS: DWORD = 0x00000000; +pub const PSD_INWININIINTLMEASURE: DWORD = 0x00000000; +pub const PSD_MINMARGINS: DWORD = 0x00000001; +pub const PSD_MARGINS: DWORD = 0x00000002; +pub const PSD_INTHOUSANDTHSOFINCHES: DWORD = 0x00000004; +pub const PSD_INHUNDREDTHSOFMILLIMETERS: DWORD = 0x00000008; +pub const PSD_DISABLEMARGINS: DWORD = 0x00000010; +pub const PSD_DISABLEPRINTER: DWORD = 0x00000020; +pub const PSD_NOWARNING: DWORD = 0x00000080; +pub const PSD_DISABLEORIENTATION: DWORD = 0x00000100; +pub const PSD_RETURNDEFAULT: DWORD = 0x00000400; +pub const PSD_DISABLEPAPER: DWORD = 0x00000200; +pub const PSD_SHOWHELP: DWORD = 0x00000800; +pub const PSD_ENABLEPAGESETUPHOOK: DWORD = 0x00002000; +pub const PSD_ENABLEPAGESETUPTEMPLATE: DWORD = 0x00008000; +pub const PSD_ENABLEPAGESETUPTEMPLATEHANDLE: DWORD = 0x00020000; +pub const PSD_ENABLEPAGEPAINTHOOK: DWORD = 0x00040000; +pub const PSD_DISABLEPAGEPAINTING: DWORD = 0x00080000; +pub const PSD_NONETWORKBUTTON: DWORD = 0x00200000; diff --git a/bash-5.1/vendor/winapi/src/um/commoncontrols.rs b/bash-5.1/vendor/winapi/src/um/commoncontrols.rs new file mode 100644 index 0000000000000000000000000000000000000000..d659e046ada1a606f5071302a8a5db4bc89183eb --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/commoncontrols.rs @@ -0,0 +1,232 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_int, c_void}; +use shared::guiddef::{REFCLSID, REFIID}; +use shared::minwindef::{BOOL, DWORD, LRESULT, UINT}; +use shared::windef::{COLORREF, HBITMAP, HICON, HWND, POINT, RECT}; +use um::commctrl::{IMAGEINFO, IMAGELISTDRAWPARAMS}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::HRESULT; +extern "system" { + pub fn ImageList_CoCreateInstance( + rclsid: REFCLSID, + punkOuter: *const IUnknown, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT; +} +pub const ILIF_ALPHA: DWORD = 0x00000001; +pub const ILIF_LOWQUALITY: DWORD = 0x00000001; +pub const ILDRF_IMAGELOWQUALITY: LRESULT = 0x00000001; +pub const ILDRF_OVERLAYLOWQUALITY: LRESULT = 0x00000010; +RIDL!{#[uuid(0x46eb5926, 0x582e, 0x4017, 0x9f, 0xdf, 0xe8, 0x99, 0x8d, 0xaa, 0x09, 0x50)] +interface IImageList(IImageListVtbl): IUnknown(IUnknownVtbl) { + fn Add( + hbmImage: HBITMAP, + hbmMask: HBITMAP, + pi: *mut c_int, + ) -> HRESULT, + fn ReplaceIcon( + hicon: HICON, + pi: *mut c_int, + ) -> HRESULT, + fn SetOverlayImage( + iImage: c_int, + iOverlay: c_int, + ) -> HRESULT, + fn Replace( + hbmImage: HBITMAP, + hbmMask: HBITMAP, + ) -> HRESULT, + fn AddMasked( + hbmImage: HBITMAP, + crMask: COLORREF, + pi: *mut c_int, + ) -> HRESULT, + fn Draw( + pimldp: *mut IMAGELISTDRAWPARAMS, + ) -> HRESULT, + fn Remove( + i: c_int, + ) -> HRESULT, + fn GetIcon( + i: c_int, + flags: UINT, + picon: *mut HICON, + ) -> HRESULT, + fn GetImageInfo( + i: c_int, + pImageInfo: *mut IMAGEINFO, + ) -> HRESULT, + fn Copy( + iDst: c_int, + punkSrc: *mut IUnknown, + iSrc: c_int, + uFlags: UINT, + ) -> HRESULT, + fn Merge( + i1: c_int, + punk2: *mut IUnknown, + i2: c_int, + dx: c_int, + dy: c_int, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, + fn Clone( + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, + fn GetImageRect( + i: c_int, + prc: *mut RECT, + ) -> HRESULT, + fn GetIconSize( + cx: *mut c_int, + cy: *mut c_int, + ) -> HRESULT, + fn SetIconSize( + cx: c_int, + cy: c_int, + ) -> HRESULT, + fn GetImageCount( + pi: *mut c_int, + ) -> HRESULT, + fn SetImageCount( + uNewCount: UINT, + ) -> HRESULT, + fn SetBkColor( + clrBk: COLORREF, + pclr: *mut COLORREF, + ) -> HRESULT, + fn GetBkColor( + pclr: *mut COLORREF, + ) -> HRESULT, + fn BeginDrag( + iTrack: c_int, + dxHotspot: c_int, + dyHotspot: c_int, + ) -> HRESULT, + fn EndDrag() -> HRESULT, + fn DragEnter( + hwndLock: HWND, + x: c_int, + y: c_int, + ) -> HRESULT, + fn DragLeave( + hwndLock: HWND, + ) -> HRESULT, + fn DragMove( + x: c_int, + y: c_int, + ) -> HRESULT, + fn SetDragCursorImage( + punk: *mut IUnknown, + iDrag: c_int, + dxHotspot: c_int, + dyHotspot: c_int, + ) -> HRESULT, + fn DragShowNolock( + fShow: BOOL, + ) -> HRESULT, + fn GetDragImage( + ppt: *mut POINT, + pptHotspot: *mut POINT, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, + fn GetItemFlags( + dwFlags: *mut DWORD, + ) -> HRESULT, + fn GetOverlayImage( + iOverlay: c_int, + piIndex: *mut c_int, + ) -> HRESULT, +}} +pub const ILR_DEFAULT: DWORD = 0x0000; +pub const ILR_HORIZONTAL_LEFT: DWORD = 0x0000; +pub const ILR_HORIZONTAL_CENTER: DWORD = 0x0001; +pub const ILR_HORIZONTAL_RIGHT: DWORD = 0x0002; +pub const ILR_VERTICAL_TOP: DWORD = 0x0000; +pub const ILR_VERTICAL_CENTER: DWORD = 0x0010; +pub const ILR_VERTICAL_BOTTOM: DWORD = 0x0020; +pub const ILR_SCALE_CLIP: DWORD = 0x0000; +pub const ILR_SCALE_ASPECTRATIO: DWORD = 0x0100; +pub const ILGOS_ALWAYS: DWORD = 0x00000000; +pub const ILGOS_FROMSTANDBY: DWORD = 0x00000001; +pub const ILFIP_ALWAYS: DWORD = 0x00000000; +pub const ILFIP_FROMSTANDBY: DWORD = 0x00000001; +pub const ILDI_PURGE: DWORD = 0x00000001; +pub const ILDI_STANDBY: DWORD = 0x00000002; +pub const ILDI_RESETACCESS: DWORD = 0x00000004; +pub const ILDI_QUERYACCESS: DWORD = 0x00000008; +STRUCT!{struct IMAGELISTSTATS { + cbSize: DWORD, + cAlloc: c_int, + cUsed: c_int, + cStandby: c_int, +}} +RIDL!{#[uuid(0x192b9d83, 0x58fc, 0x457b, 0x90, 0xa0, 0x2b, 0x82, 0xa8, 0xb5, 0xda, 0xe1)] +interface IImageList2(IImageList2Vtbl): IImageList(IImageListVtbl) { + fn Resize( + cxNewIconSize: c_int, + cyNewIconSize: c_int, + ) -> HRESULT, + fn GetOriginalSize( + iImage: c_int, + dwFlags: DWORD, + pcx: *mut c_int, + pcy: *mut c_int, + ) -> HRESULT, + fn SetOriginalSize( + iImage: c_int, + cx: c_int, + cy: c_int, + ) -> HRESULT, + fn SetCallback( + punk: *mut IUnknown, + ) -> HRESULT, + fn GetCallback( + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, + fn ForceImagePresent( + iImage: c_int, + dwFlags: DWORD, + ) -> HRESULT, + fn DiscardImages( + iFirstImage: c_int, + iLastImage: c_int, + dwFlags: DWORD, + ) -> HRESULT, + fn PreloadImages( + pimldp: *mut IMAGELISTDRAWPARAMS, + ) -> HRESULT, + fn GetStatistics( + pils: *mut IMAGELISTSTATS, + ) -> HRESULT, + fn Initialize( + cx: c_int, + cy: c_int, + flags: UINT, + cInitial: c_int, + cGrow: c_int, + ) -> HRESULT, + fn Replace2( + i: c_int, + hbmImage: HBITMAP, + hbmMask: HBITMAP, + punk: *mut IUnknown, + dwFlags: DWORD, + ) -> HRESULT, + fn ReplaceFromImageList( + i: c_int, + pil: *mut IImageList, + iSrc: c_int, + punk: *mut IUnknown, + dwFlags: DWORD, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/consoleapi.rs b/bash-5.1/vendor/winapi/src/um/consoleapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..3f5496b9557aec72579ee5dcf60b8dd2b6b53103 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/consoleapi.rs @@ -0,0 +1,91 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-core-console-l1 +use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, UINT}; +use um::wincon::{PCONSOLE_READCONSOLE_CONTROL, PHANDLER_ROUTINE}; +use um::wincontypes::{COORD, HPCON, PINPUT_RECORD}; +use um::winnt::{HANDLE, HRESULT, VOID}; +extern "system" { + pub fn AllocConsole() -> BOOL; + pub fn GetConsoleCP() -> UINT; + pub fn GetConsoleMode( + hConsoleHandle: HANDLE, + lpMode: LPDWORD, + ) -> BOOL; + pub fn GetConsoleOutputCP() -> UINT; + pub fn GetNumberOfConsoleInputEvents( + hConsoleInput: HANDLE, + lpNumberOfEvents: LPDWORD, + ) -> BOOL; + pub fn PeekConsoleInputA( + hConsoleInput: HANDLE, + lpBuffer: PINPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsRead: LPDWORD, + ) -> BOOL; + pub fn ReadConsoleA( + hConsoleInput: HANDLE, + lpBuffer: LPVOID, + nNumberOfCharsToRead: DWORD, + lpNumberOfCharsRead: LPDWORD, + pInputControl: PCONSOLE_READCONSOLE_CONTROL, + ) -> BOOL; + pub fn ReadConsoleW( + hConsoleInput: HANDLE, + lpBuffer: LPVOID, + nNumberOfCharsToRead: DWORD, + lpNumberOfCharsRead: LPDWORD, + pInputControl: PCONSOLE_READCONSOLE_CONTROL, + ) -> BOOL; + pub fn ReadConsoleInputA( + hConsoleInput: HANDLE, + lpBuffer: PINPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsRead: LPDWORD, + ) -> BOOL; + pub fn ReadConsoleInputW( + hConsoleInput: HANDLE, + lpBuffer: PINPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsRead: LPDWORD, + ) -> BOOL; + pub fn SetConsoleCtrlHandler( + HandlerRoutine: PHANDLER_ROUTINE, + Add: BOOL, + ) -> BOOL; + pub fn SetConsoleMode( + hConsoleHandle: HANDLE, + dwMode: DWORD, + ) -> BOOL; + pub fn WriteConsoleA( + hConsoleOutput: HANDLE, + lpBuffer: *const VOID, + nNumberOfCharsToWrite: DWORD, + lpNumberOfCharsWritten: LPDWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn WriteConsoleW( + hConsoleOutput: HANDLE, + lpBuffer: *const VOID, + nNumberOfCharsToWrite: DWORD, + lpNumberOfCharsWritten: LPDWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn CreatePseudoConsole( + size: COORD, + hInput: HANDLE, + hOutput: HANDLE, + dwFlags: DWORD, + phPC: *mut HPCON, + ) -> HRESULT; + pub fn ResizePseudoConsole( + hPC: HPCON, + size: COORD, + ) -> HRESULT; + pub fn ClosePseudoConsole( + hPC: HPCON, + ); +} diff --git a/bash-5.1/vendor/winapi/src/um/corsym.rs b/bash-5.1/vendor/winapi/src/um/corsym.rs new file mode 100644 index 0000000000000000000000000000000000000000..2e7c0f9835b59cec3d8dee67264c0cddbc784d59 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/corsym.rs @@ -0,0 +1,89 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! Common Language Runtime Debugging Symbol Reader/Writer/Binder Interfaces +use shared::basetsd::ULONG32; +use um::objidlbase::IStream; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, WCHAR}; +DEFINE_GUID!{CorSym_LanguageType_C, + 0x63a08714, 0xfc37, 0x11d2, 0x90, 0x4c, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1} +DEFINE_GUID!{CorSym_LanguageType_CPlusPlus, + 0x3a12d0b7, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2} +DEFINE_GUID!{CorSym_LanguageType_CSharp, + 0x3f5162f8, 0x07c6, 0x11d3, 0x90, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1} +DEFINE_GUID!{CorSym_LanguageType_Basic, + 0x3a12d0b8, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2} +DEFINE_GUID!{CorSym_LanguageType_Java, + 0x3a12d0b4, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2} +DEFINE_GUID!{CorSym_LanguageType_Cobol, + 0xaf046cd1, 0xd0e1, 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc} +DEFINE_GUID!{CorSym_LanguageType_Pascal, + 0xaf046cd2, 0xd0e1, 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc} +DEFINE_GUID!{CorSym_LanguageType_ILAssembly, + 0xaf046cd3, 0xd0e1, 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc} +DEFINE_GUID!{CorSym_LanguageType_JScript, + 0x3a12d0b6, 0xc26c, 0x11d0, 0xb4, 0x42, 0x00, 0xa0, 0x24, 0x4a, 0x1d, 0xd2} +DEFINE_GUID!{CorSym_LanguageType_SMC, + 0xd9b9f7b, 0x6611, 0x11d3, 0xbd, 0x2a, 0x0, 0x0, 0xf8, 0x8, 0x49, 0xbd} +DEFINE_GUID!{CorSym_LanguageType_MCPlusPlus, + 0x4b35fde8, 0x07c6, 0x11d3, 0x90, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1} +DEFINE_GUID!{CorSym_LanguageVendor_Microsoft, + 0x994b45c4, 0xe6e9, 0x11d2, 0x90, 0x3f, 0x00, 0xc0, 0x4f, 0xa3, 0x02, 0xa1} +DEFINE_GUID!{CorSym_DocumentType_Text, + 0x5a869d0b, 0x6611, 0x11d3, 0xbd, 0x2a, 0x0, 0x0, 0xf8, 0x8, 0x49, 0xbd} +DEFINE_GUID!{CorSym_DocumentType_MC, + 0xeb40cb65, 0x3c1f, 0x4352, 0x9d, 0x7b, 0xba, 0xf, 0xc4, 0x7a, 0x9d, 0x77} +DEFINE_GUID!{CorSym_SourceHash_MD5, + 0x406ea660, 0x64cf, 0x4c82, 0xb6, 0xf0, 0x42, 0xd4, 0x81, 0x72, 0xa7, 0x99} +DEFINE_GUID!{CorSym_SourceHash_SHA1, + 0xff1816ec, 0xaa5e, 0x4d10, 0x87, 0xf7, 0x6f, 0x49, 0x63, 0x83, 0x34, 0x60} +ENUM!{enum CorSymAddrKind { + ADDR_IL_OFFSET = 1, + ADDR_NATIVE_RVA = 2, + ADDR_NATIVE_REGISTER = 3, + ADDR_NATIVE_REGREL = 4, + ADDR_NATIVE_OFFSET = 5, + ADDR_NATIVE_REGREG = 6, + ADDR_NATIVE_REGSTK = 7, + ADDR_NATIVE_STKREG = 8, + ADDR_BITFIELD = 9, + ADDR_NATIVE_ISECTOFFSET = 10, +}} +ENUM!{enum CorSymVarFlag { + VAR_IS_COMP_GEN = 1, +}} +RIDL!{#[uuid(0xaa544d42, 0x28cb, 0x11d3, 0xbd, 0x22, 0x00, 0x00, 0xf8, 0x08, 0x49, 0xbd)] +interface ISymUnmanagedBinder(ISymUnmanagedBinderVtbl): IUnknown(IUnknownVtbl) { + fn GetReaderForFile( + importer: *mut IUnknown, + fileName: *const WCHAR, + searchPath: *const WCHAR, + pRetVal: *mut *mut ISymUnmanagedReader, + ) -> HRESULT, + fn GetReaderFromStream( + importer: *mut IUnknown, + pstream: *mut IStream, + pRetVal: *mut *mut ISymUnmanagedReader, + ) -> HRESULT, +}} +ENUM!{enum CorSymSearchPolicyAttributes { + AllowRegistryAccess = 0x1, + AllowSymbolServerAccess = 0x2, + AllowOriginalPathAccess = 0x4, + AllowReferencePathAccess = 0x8, +}} +RIDL!{#[uuid(0xaccee350, 0x89af, 0x4ccb, 0x8b, 0x40, 0x1c, 0x2c, 0x4c, 0x6f, 0x94, 0x34)] +interface ISymUnmanagedBinder2(ISymUnmanagedBinder2Vtbl): + ISymUnmanagedBinder(ISymUnmanagedBinderVtbl) { + fn GetReaderForFile2( + importer: *mut IUnknown, + fileName: *const WCHAR, + searchPath: *const WCHAR, + searchPolicy: ULONG32, + pRetVal: *mut *mut ISymUnmanagedReader, + ) -> HRESULT, +}} +pub enum ISymUnmanagedReader {} // TODO diff --git a/bash-5.1/vendor/winapi/src/um/d2d1.rs b/bash-5.1/vendor/winapi/src/um/d2d1.rs new file mode 100644 index 0000000000000000000000000000000000000000..0632e68910beddda6079010df7a2afb95a427368 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d2d1.rs @@ -0,0 +1,982 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! Mappings for the contents of d2d1.h +use ctypes::c_void; +use shared::basetsd::{UINT32, UINT64}; +use shared::dxgi::IDXGISurface; +use shared::guiddef::REFIID; +use shared::minwindef::{BOOL, DWORD, FLOAT}; +use shared::windef::{HDC, HWND, RECT}; +use um::d2dbasetypes::{ + D2D_COLOR_F, D2D_MATRIX_3X2_F, D2D_POINT_2F, D2D_POINT_2U, D2D_RECT_F, D2D_RECT_U, D2D_SIZE_F, + D2D_SIZE_U, +}; +use um::d3dcommon::{D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_1}; +use um::dcommon::{D2D1_PIXEL_FORMAT, DWRITE_MEASURING_MODE}; +use um::dwrite::{DWRITE_GLYPH_RUN, IDWriteRenderingParams, IDWriteTextFormat, IDWriteTextLayout}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::wincodec::{IWICBitmap, IWICBitmapSource}; +use um::winnt::{HRESULT, WCHAR}; +// Types confirmed affected by the ABI issue: +// D2D1_SIZE_F, D2D1_SIZE_U, D2D1_COLOR_F, D2D1_PIXEL_FORMAT, D2D1_POINT_2F +pub const D2D1_DEFAULT_FLATTENING_TOLERANCE: FLOAT = 0.25; +pub const D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR: DWORD = 0; +pub const D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR: DWORD = 1; +pub const D2D1_INTERPOLATION_MODE_DEFINITION_CUBIC: DWORD = 2; +pub const D2D1_INTERPOLATION_MODE_DEFINITION_MULTI_SAMPLE_LINEAR: DWORD = 3; +pub const D2D1_INTERPOLATION_MODE_DEFINITION_ANISOTROPIC: DWORD = 4; +pub const D2D1_INTERPOLATION_MODE_DEFINITION_HIGH_QUALITY_CUBIC: DWORD = 5; +pub const D2D1_INTERPOLATION_MODE_DEFINITION_FANT: DWORD = 6; +pub const D2D1_INTERPOLATION_MODE_DEFINITION_MIPMAP_LINEAR: DWORD = 7; +ENUM!{enum D2D1_GAMMA { + D2D1_GAMMA_2_2 = 0, + D2D1_GAMMA_1_0 = 1, +}} +ENUM!{enum D2D1_OPACITY_MASK_CONTENT { + D2D1_OPACITY_MASK_CONTENT_GRAPHICS = 0, + D2D1_OPACITY_MASK_CONTENT_TEXT_NATURAL = 1, + D2D1_OPACITY_MASK_CONTENT_TEXT_GDI_COMPATIBLE = 2, +}} +ENUM!{enum D2D1_EXTEND_MODE { + D2D1_EXTEND_MODE_CLAMP = 0, + D2D1_EXTEND_MODE_WRAP = 1, + D2D1_EXTEND_MODE_MIRROR = 2, +}} +ENUM!{enum D2D1_ANTIALIAS_MODE { + D2D1_ANTIALIAS_MODE_PER_PRIMITIVE = 0, + D2D1_ANTIALIAS_MODE_ALIASED = 1, +}} +ENUM!{enum D2D1_TEXT_ANTIALIAS_MODE { + D2D1_TEXT_ANTIALIAS_MODE_DEFAULT = 0, + D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE = 1, + D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE = 2, + D2D1_TEXT_ANTIALIAS_MODE_ALIASED = 3, +}} +ENUM!{enum D2D1_BITMAP_INTERPOLATION_MODE { + D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR = + D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR, + D2D1_BITMAP_INTERPOLATION_MODE_LINEAR = + D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR, +}} +ENUM!{enum D2D1_DRAW_TEXT_OPTIONS { + D2D1_DRAW_TEXT_OPTIONS_NO_SNAP = 0x00000001, + D2D1_DRAW_TEXT_OPTIONS_CLIP = 0x00000002, + D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT = 0x00000004, + D2D1_DRAW_TEXT_OPTIONS_NONE = 0x00000000, +}} +pub type D2D1_POINT_2U = D2D_POINT_2U; +pub type D2D1_POINT_2F = D2D_POINT_2F; +pub type D2D1_RECT_F = D2D_RECT_F; +pub type D2D1_RECT_U = D2D_RECT_U; +pub type D2D1_SIZE_F = D2D_SIZE_F; +pub type D2D1_SIZE_U = D2D_SIZE_U; +pub type D2D1_COLOR_F = D2D_COLOR_F; +pub type D2D1_MATRIX_3X2_F = D2D_MATRIX_3X2_F; +pub type D2D1_TAG = UINT64; +STRUCT!{struct D2D1_BITMAP_PROPERTIES { + pixelFormat: D2D1_PIXEL_FORMAT, + dpiX: FLOAT, + dpiY: FLOAT, +}} +STRUCT!{struct D2D1_GRADIENT_STOP { + position: FLOAT, + color: D2D1_COLOR_F, +}} +STRUCT!{struct D2D1_BRUSH_PROPERTIES { + opacity: FLOAT, + transform: D2D1_MATRIX_3X2_F, +}} +STRUCT!{struct D2D1_BITMAP_BRUSH_PROPERTIES { + extendModeX: D2D1_EXTEND_MODE, + extendModeY: D2D1_EXTEND_MODE, + interpolationMode: D2D1_BITMAP_INTERPOLATION_MODE, +}} +STRUCT!{struct D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES { + startPoint: D2D1_POINT_2F, + endPoint: D2D1_POINT_2F, +}} +STRUCT!{struct D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES { + center: D2D1_POINT_2F, + gradientOriginOffset: D2D1_POINT_2F, + radiusX: FLOAT, + radiusY: FLOAT, +}} +ENUM!{enum D2D1_ARC_SIZE { + D2D1_ARC_SIZE_SMALL = 0, + D2D1_ARC_SIZE_LARGE = 1, +}} +ENUM!{enum D2D1_CAP_STYLE { + D2D1_CAP_STYLE_FLAT = 0, + D2D1_CAP_STYLE_SQUARE = 1, + D2D1_CAP_STYLE_ROUND = 2, + D2D1_CAP_STYLE_TRIANGLE = 3, +}} +ENUM!{enum D2D1_DASH_STYLE { + D2D1_DASH_STYLE_SOLID = 0, + D2D1_DASH_STYLE_DASH = 1, + D2D1_DASH_STYLE_DOT = 2, + D2D1_DASH_STYLE_DASH_DOT = 3, + D2D1_DASH_STYLE_DASH_DOT_DOT = 4, + D2D1_DASH_STYLE_CUSTOM = 5, +}} +ENUM!{enum D2D1_LINE_JOIN { + D2D1_LINE_JOIN_MITER = 0, + D2D1_LINE_JOIN_BEVEL = 1, + D2D1_LINE_JOIN_ROUND = 2, + D2D1_LINE_JOIN_MITER_OR_BEVEL = 3, +}} +ENUM!{enum D2D1_COMBINE_MODE { + D2D1_COMBINE_MODE_UNION = 0, + D2D1_COMBINE_MODE_INTERSECT = 1, + D2D1_COMBINE_MODE_XOR = 2, + D2D1_COMBINE_MODE_EXCLUDE = 3, +}} +ENUM!{enum D2D1_GEOMETRY_RELATION { + D2D1_GEOMETRY_RELATION_UNKNOWN = 0, + D2D1_GEOMETRY_RELATION_DISJOINT = 1, + D2D1_GEOMETRY_RELATION_IS_CONTAINED = 2, + D2D1_GEOMETRY_RELATION_CONTAINS = 3, + D2D1_GEOMETRY_RELATION_OVERLAP = 4, +}} +ENUM!{enum D2D1_GEOMETRY_SIMPLIFICATION_OPTION { + D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES = 0, + D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES = 1, +}} +ENUM!{enum D2D1_FIGURE_BEGIN { + D2D1_FIGURE_BEGIN_FILLED = 0, + D2D1_FIGURE_BEGIN_HOLLOW = 1, +}} +ENUM!{enum D2D1_FIGURE_END { + D2D1_FIGURE_END_OPEN = 0, + D2D1_FIGURE_END_CLOSED = 1, +}} +STRUCT!{struct D2D1_BEZIER_SEGMENT { + point1: D2D1_POINT_2F, + point2: D2D1_POINT_2F, + point3: D2D1_POINT_2F, +}} +STRUCT!{struct D2D1_TRIANGLE { + point1: D2D1_POINT_2F, + point2: D2D1_POINT_2F, + point3: D2D1_POINT_2F, +}} +ENUM!{enum D2D1_PATH_SEGMENT { + D2D1_PATH_SEGMENT_NONE = 0x00000000, + D2D1_PATH_SEGMENT_FORCE_UNSTROKED = 0x00000001, + D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN = 0x00000002, +}} +ENUM!{enum D2D1_SWEEP_DIRECTION { + D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE = 0, + D2D1_SWEEP_DIRECTION_CLOCKWISE = 1, +}} +ENUM!{enum D2D1_FILL_MODE { + D2D1_FILL_MODE_ALTERNATE = 0, + D2D1_FILL_MODE_WINDING = 1, +}} +STRUCT!{struct D2D1_ARC_SEGMENT { + point: D2D1_POINT_2F, + size: D2D1_SIZE_F, + rotationAngle: FLOAT, + sweepDirection: D2D1_SWEEP_DIRECTION, + arcSize: D2D1_ARC_SIZE, +}} +STRUCT!{struct D2D1_QUADRATIC_BEZIER_SEGMENT { + point1: D2D1_POINT_2F, + point2: D2D1_POINT_2F, +}} +STRUCT!{struct D2D1_ELLIPSE { + point: D2D1_POINT_2F, + radiusX: FLOAT, + radiusY: FLOAT, +}} +STRUCT!{struct D2D1_ROUNDED_RECT { + rect: D2D1_RECT_F, + radiusX: FLOAT, + radiusY: FLOAT, +}} +STRUCT!{struct D2D1_STROKE_STYLE_PROPERTIES { + startCap: D2D1_CAP_STYLE, + endCap: D2D1_CAP_STYLE, + dashCap: D2D1_CAP_STYLE, + lineJoin: D2D1_LINE_JOIN, + miterLimit: FLOAT, + dashStyle: D2D1_DASH_STYLE, + dashOffset: FLOAT, +}} +ENUM!{enum D2D1_LAYER_OPTIONS { + D2D1_LAYER_OPTIONS_NONE = 0x00000000, + D2D1_LAYER_OPTIONS_INITIALIZE_FOR_CLEARTYPE = 0x00000001, +}} +STRUCT!{struct D2D1_LAYER_PARAMETERS { + contentBounds: D2D1_RECT_F, + geometricMask: *mut ID2D1Geometry, + maskAntialiasMode: D2D1_ANTIALIAS_MODE, + maskTransform: D2D1_MATRIX_3X2_F, + opacity: FLOAT, + opacityBrush: *mut ID2D1Brush, + layerOptions: D2D1_LAYER_OPTIONS, +}} +ENUM!{enum D2D1_WINDOW_STATE { + D2D1_WINDOW_STATE_NONE = 0x0000000, + D2D1_WINDOW_STATE_OCCLUDED = 0x0000001, +}} +ENUM!{enum D2D1_RENDER_TARGET_TYPE { + D2D1_RENDER_TARGET_TYPE_DEFAULT = 0, + D2D1_RENDER_TARGET_TYPE_SOFTWARE = 1, + D2D1_RENDER_TARGET_TYPE_HARDWARE = 2, +}} +ENUM!{enum D2D1_FEATURE_LEVEL { + D2D1_FEATURE_LEVEL_DEFAULT = 0, + D2D1_FEATURE_LEVEL_9 = D3D_FEATURE_LEVEL_9_1, + D2D1_FEATURE_LEVEL_10 = D3D_FEATURE_LEVEL_10_0, +}} +ENUM!{enum D2D1_RENDER_TARGET_USAGE { + D2D1_RENDER_TARGET_USAGE_NONE = 0x00000000, + D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING = 0x00000001, + D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE = 0x00000002, +}} +ENUM!{enum D2D1_PRESENT_OPTIONS { + D2D1_PRESENT_OPTIONS_NONE = 0x00000000, + D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS = 0x00000001, + D2D1_PRESENT_OPTIONS_IMMEDIATELY = 0x00000002, +}} +STRUCT!{struct D2D1_RENDER_TARGET_PROPERTIES { + _type: D2D1_RENDER_TARGET_TYPE, + pixelFormat: D2D1_PIXEL_FORMAT, + dpiX: FLOAT, + dpiY: FLOAT, + usage: D2D1_RENDER_TARGET_USAGE, + minLevel: D2D1_FEATURE_LEVEL, +}} +STRUCT!{struct D2D1_HWND_RENDER_TARGET_PROPERTIES { + hwnd: HWND, + pixelSize: D2D1_SIZE_U, + presentOptions: D2D1_PRESENT_OPTIONS, +}} +ENUM!{enum D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS { + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE = 0x00000000, + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE = 0x00000001, +}} +STRUCT!{struct D2D1_DRAWING_STATE_DESCRIPTION { + antialiasMode: D2D1_ANTIALIAS_MODE, + textAntialiasMode: D2D1_TEXT_ANTIALIAS_MODE, + tag1: D2D1_TAG, + tag2: D2D1_TAG, + transform: D2D1_MATRIX_3X2_F, +}} +ENUM!{enum D2D1_DC_INITIALIZE_MODE { + D2D1_DC_INITIALIZE_MODE_COPY = 0, + D2D1_DC_INITIALIZE_MODE_CLEAR = 1, +}} +ENUM!{enum D2D1_DEBUG_LEVEL { + D2D1_DEBUG_LEVEL_NONE = 0, + D2D1_DEBUG_LEVEL_ERROR = 1, + D2D1_DEBUG_LEVEL_WARNING = 2, + D2D1_DEBUG_LEVEL_INFORMATION = 3, +}} +ENUM!{enum D2D1_FACTORY_TYPE { + D2D1_FACTORY_TYPE_SINGLE_THREADED = 0, + D2D1_FACTORY_TYPE_MULTI_THREADED = 1, +}} +STRUCT!{struct D2D1_FACTORY_OPTIONS { + debugLevel: D2D1_DEBUG_LEVEL, +}} +RIDL!{#[uuid(0x2cd90691, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1Resource(ID2D1ResourceVtbl): IUnknown(IUnknownVtbl) { + fn GetFactory( + factory: *mut *mut ID2D1Factory, + ) -> (), +}} +RIDL!{#[uuid(0x65019f75, 0x8da2, 0x497c, 0xb3, 0x2c, 0xdf, 0xa3, 0x4e, 0x48, 0xed, 0xe6)] +interface ID2D1Image(ID2D1ImageVtbl): ID2D1Resource(ID2D1ResourceVtbl) {}} +RIDL!{#[uuid(0xa2296057, 0xea42, 0x4099, 0x98, 0x3b, 0x53, 0x9f, 0xb6, 0x50, 0x54, 0x26)] +interface ID2D1Bitmap(ID2D1BitmapVtbl): ID2D1Image(ID2D1ImageVtbl) { + #[fixme] fn GetSize() -> D2D1_SIZE_F, + #[fixme] fn GetPixelSize() -> D2D1_SIZE_U, + #[fixme] fn GetPixelFormat() -> D2D1_PIXEL_FORMAT, + fn GetDpi( + dpiX: *mut FLOAT, + dpiY: *mut FLOAT, + ) -> (), + fn CopyFromBitmap( + destPoint: *const D2D1_POINT_2U, + bitmap: *mut ID2D1Bitmap, + srcRect: *const D2D1_RECT_U, + ) -> HRESULT, + fn CopyFromRenderTarget( + destPoint: *const D2D1_POINT_2U, + renderTarget: *mut ID2D1RenderTarget, + srcRect: *const D2D1_RECT_U, + ) -> HRESULT, + fn CopyFromMemory( + dstRect: *const D2D1_RECT_U, + srcData: *const c_void, + pitch: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2cd906a7, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1GradientStopCollection(ID2D1GradientStopCollectionVtbl): + ID2D1Resource(ID2D1ResourceVtbl) { + fn GetGradientStopCount() -> UINT32, + fn GetGradientStops( + gradientStops: *mut D2D1_GRADIENT_STOP, + gradientStopsCount: UINT32, + ) -> (), + fn GetColorInterpolationGamma() -> D2D1_GAMMA, + fn GetExtendMode() -> D2D1_EXTEND_MODE, +}} +RIDL!{#[uuid(0x2cd906a8, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1Brush(ID2D1BrushVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn SetOpacity( + opacity: FLOAT, + ) -> (), + fn SetTransform( + transform: *const D2D1_MATRIX_3X2_F, + ) -> (), + fn GetOpacity() -> FLOAT, + fn GetTransform( + transform: *mut D2D1_MATRIX_3X2_F, + ) -> (), +}} +RIDL!{#[uuid(0x2cd906aa, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1BitmapBrush(ID2D1BitmapBrushVtbl): ID2D1Brush(ID2D1BrushVtbl) { + fn SetExtendModeX( + extendModeX: D2D1_EXTEND_MODE, + ) -> (), + fn SetExtendModeY( + extendModeY: D2D1_EXTEND_MODE, + ) -> (), + fn SetInterpolationMode( + interpolationMode: D2D1_BITMAP_INTERPOLATION_MODE, + ) -> (), + fn SetBitmap( + bitmap: *mut ID2D1Bitmap, + ) -> (), + fn GetExtendModeX() -> D2D1_EXTEND_MODE, + fn GetExtendModeY() -> D2D1_EXTEND_MODE, + fn GetInterpolationMode() -> D2D1_BITMAP_INTERPOLATION_MODE, + fn GetBitmap( + bitmap: *mut *mut ID2D1Bitmap, + ) -> (), +}} +RIDL!{#[uuid(0x2cd906a9, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1SolidColorBrush(ID2D1SolidColorBrushVtbl): ID2D1Brush(ID2D1BrushVtbl) { + fn SetColor( + color: *const D2D1_COLOR_F, + ) -> (), + #[fixme] fn GetColor() -> D2D1_COLOR_F, +}} +RIDL!{#[uuid(0x2cd906ab, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1LinearGradientBrush(ID2D1LinearGradientBrushVtbl): ID2D1Brush(ID2D1BrushVtbl) { + fn SetStartPoint( + startPoint: D2D1_POINT_2F, + ) -> (), + fn SetEndPoint( + endPoint: D2D1_POINT_2F, + ) -> (), + #[fixme] fn GetStartPoint() -> D2D1_POINT_2F, + #[fixme] fn GetEndPoint() -> D2D1_POINT_2F, + fn GetGradientStopCollection( + gradientStopCollection: *mut *mut ID2D1GradientStopCollection, + ) -> (), +}} +RIDL!{#[uuid(0x2cd906ac, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1RadialGradientBrush(ID2D1RadialGradientBrushVtbl): ID2D1Brush(ID2D1BrushVtbl) { + fn SetCenter( + center: D2D1_POINT_2F, + ) -> (), + fn SetGradientOriginOffset( + gradientOriginOffset: D2D1_POINT_2F, + ) -> (), + fn SetRadiusX( + radiusX: FLOAT, + ) -> (), + fn SetRadiusY( + radiusY: FLOAT, + ) -> (), + #[fixme] fn GetCenter() -> D2D1_POINT_2F, + #[fixme] fn GetGradientOriginOffset() -> D2D1_POINT_2F, + fn GetRadiusX() -> FLOAT, + fn GetRadiusY() -> FLOAT, + fn GetGradientStopCollection( + gradientStopCollection: *mut *mut ID2D1GradientStopCollection, + ) -> (), +}} +RIDL!{#[uuid(0x2cd9069d, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1StrokeStyle(ID2D1StrokeStyleVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn GetStartCap() -> D2D1_CAP_STYLE, + fn GetEndCap() -> D2D1_CAP_STYLE, + fn GetDashCap() -> D2D1_CAP_STYLE, + fn GetMiterLimit() -> FLOAT, + fn GetLineJoin() -> D2D1_LINE_JOIN, + fn GetDashOffset() -> FLOAT, + fn GetDashStyle() -> D2D1_DASH_STYLE, + fn GetDashesCount() -> UINT32, + fn GetDashes( + dashes: *mut FLOAT, + dashesCount: UINT32, + ) -> (), +}} +RIDL!{#[uuid(0x2cd906a1, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1Geometry(ID2D1GeometryVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn GetBounds( + worldTransform: *const D2D1_MATRIX_3X2_F, + bounds: *mut D2D1_RECT_F, + ) -> HRESULT, + fn GetWidenedBounds( + strokeWidth: FLOAT, + strokeStyle: *mut ID2D1StrokeStyle, + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + bounds: *mut D2D1_RECT_F, + ) -> HRESULT, + fn StrokeContainsPoint( + point: D2D1_POINT_2F, + strokeWidth: FLOAT, + strokeStyle: *mut ID2D1StrokeStyle, + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + contains: *mut BOOL, + ) -> HRESULT, + fn FillContainsPoint( + point: D2D1_POINT_2F, + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + contains: *mut BOOL, + ) -> HRESULT, + fn CompareWithGeometry( + inputGeometry: *mut ID2D1Geometry, + inputGeometryTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + relation: *mut D2D1_GEOMETRY_RELATION, + ) -> HRESULT, + fn Simplify( + simplificationOption: D2D1_GEOMETRY_SIMPLIFICATION_OPTION, + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + geometrySink: *mut ID2D1SimplifiedGeometrySink, + ) -> HRESULT, + fn Tessellate( + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + tessellationSink: *mut ID2D1TessellationSink, + ) -> HRESULT, + fn CombineWithGeometry( + inputGeometry: *mut ID2D1Geometry, + combineMode: D2D1_COMBINE_MODE, + inputGeometryTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + geometrySink: *mut ID2D1SimplifiedGeometrySink, + ) -> HRESULT, + fn Outline( + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + geometrySink: *mut ID2D1SimplifiedGeometrySink, + ) -> HRESULT, + fn ComputeArea( + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + area: *mut FLOAT, + ) -> HRESULT, + fn ComputeLength( + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + length: *mut FLOAT, + ) -> HRESULT, + fn ComputePointAtLength( + length: FLOAT, + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + point: *mut D2D1_POINT_2F, + unitTangentVector: *mut D2D1_POINT_2F, + ) -> HRESULT, + fn Widen( + strokeWidth: FLOAT, + strokeStyle: *mut ID2D1StrokeStyle, + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + geometrySink: *mut ID2D1SimplifiedGeometrySink, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2cd906a2, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1RectangleGeometry(ID2D1RectangleGeometryVtbl): ID2D1Geometry(ID2D1GeometryVtbl) { + fn GetRect( + rect: *mut D2D1_RECT_F, + ) -> (), +}} +RIDL!{#[uuid(0x2cd906a3, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1RoundedRectangleGeometry(ID2D1RoundedRectangleGeometryVtbl): + ID2D1Geometry(ID2D1GeometryVtbl) { + fn GetRoundedRect( + roundedRect: *mut D2D1_ROUNDED_RECT, + ) -> (), +}} +RIDL!{#[uuid(0x2cd906a4, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1EllipseGeometry(ID2D1EllipseGeometryVtbl): ID2D1Geometry(ID2D1GeometryVtbl) { + fn GetEllipse( + ellipse: *mut D2D1_ELLIPSE, + ) -> (), +}} +RIDL!{#[uuid(0x2cd906a6, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1GeometryGroup(ID2D1GeometryGroupVtbl): ID2D1Geometry(ID2D1GeometryVtbl) { + fn GetFillMode() -> D2D1_FILL_MODE, + fn GetSourceGeometryCount() -> UINT32, + fn GetSourceGeometries( + geometries: *mut *mut ID2D1Geometry, + geometriesCount: UINT32, + ) -> (), +}} +RIDL!{#[uuid(0x2cd906bb, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1TransformedGeometry(ID2D1TransformedGeometryVtbl): + ID2D1Geometry(ID2D1GeometryVtbl) { + fn GetSourceGeometry( + sourceGeometry: *mut *mut ID2D1Geometry, + ) -> (), + fn GetTransform( + transform: *mut D2D1_MATRIX_3X2_F, + ) -> (), +}} +RIDL!{#[uuid(0x2cd9069e, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1SimplifiedGeometrySink(ID2D1SimplifiedGeometrySinkVtbl): IUnknown(IUnknownVtbl) { + fn SetFillMode( + fillMode: D2D1_FILL_MODE, + ) -> (), + fn SetSegmentFlags( + vertexFlags: D2D1_PATH_SEGMENT, + ) -> (), + fn BeginFigure( + startPoint: D2D1_POINT_2F, + figureBegin: D2D1_FIGURE_BEGIN, + ) -> (), + fn AddLines( + points: *const D2D1_POINT_2F, + pointsCount: UINT32, + ) -> (), + fn AddBeziers( + beziers: *const D2D1_BEZIER_SEGMENT, + beziersCount: UINT32, + ) -> (), + fn EndFigure( + figureEnd: D2D1_FIGURE_END, + ) -> (), + fn Close() -> HRESULT, +}} +RIDL!{#[uuid(0x2cd9069f, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1GeometrySink(ID2D1GeometrySinkVtbl): + ID2D1SimplifiedGeometrySink(ID2D1SimplifiedGeometrySinkVtbl) { + fn AddLine( + point: D2D1_POINT_2F, + ) -> (), + fn AddBezier( + bezier: *const D2D1_BEZIER_SEGMENT, + ) -> (), + fn AddQuadraticBezier( + bezier: *const D2D1_QUADRATIC_BEZIER_SEGMENT, + ) -> (), + fn AddQuadraticBeziers( + beziers: *const D2D1_QUADRATIC_BEZIER_SEGMENT, + beziersCount: UINT32, + ) -> (), + fn AddArc( + arc: *const D2D1_ARC_SEGMENT, + ) -> (), +}} +RIDL!{#[uuid(0x2cd906c1, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1TessellationSink(ID2D1TessellationSinkVtbl): IUnknown(IUnknownVtbl) { + fn AddTriangles( + triangles: *const D2D1_TRIANGLE, + triangleCount: UINT32, + ) -> (), + fn Close() -> HRESULT, +}} +RIDL!{#[uuid(0x2cd906a5, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1PathGeometry(ID2D1PathGeometryVtbl): ID2D1Geometry(ID2D1GeometryVtbl) { + fn Open( + geometrySink: *mut *mut ID2D1GeometrySink, + ) -> HRESULT, + fn Stream( + geometrySink: *mut ID2D1GeometrySink, + ) -> HRESULT, + fn GetSegmentCount( + count: *mut UINT32, + ) -> HRESULT, + fn GetFigureCount( + count: *mut UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2cd906c2, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1Mesh(ID2D1MeshVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn Open( + tessellationSink: *mut *mut ID2D1TessellationSink, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2cd9069b, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1Layer(ID2D1LayerVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + #[fixme] fn GetSize() -> D2D1_SIZE_F, +}} +RIDL!{#[uuid(0x28506e39, 0xebf6, 0x46a1, 0xbb, 0x47, 0xfd, 0x85, 0x56, 0x5a, 0xb9, 0x57)] +interface ID2D1DrawingStateBlock(ID2D1DrawingStateBlockVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn GetDescription( + stateDescription: *mut D2D1_DRAWING_STATE_DESCRIPTION, + ) -> (), + fn SetDescription( + stateDescription: *const D2D1_DRAWING_STATE_DESCRIPTION, + ) -> (), + fn SetTextRenderingParams( + textRenderingParams: *mut IDWriteRenderingParams, + ) -> (), + fn GetTextRenderingParams( + textRenderingParams: *mut *mut IDWriteRenderingParams, + ) -> (), +}} +RIDL!{#[uuid(0x2cd90694, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1RenderTarget(ID2D1RenderTargetVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn CreateBitmap( + size: D2D1_SIZE_U, + srcData: *const c_void, + pitch: UINT32, + bitmapProperties: *const D2D1_BITMAP_PROPERTIES, + bitmap: *mut *mut ID2D1Bitmap, + ) -> HRESULT, + fn CreateBitmapFromWicBitmap( + wicBitmapSource: *mut IWICBitmapSource, + bitmapProperties: *const D2D1_BITMAP_PROPERTIES, + bitmap: *mut *mut ID2D1Bitmap, + ) -> HRESULT, + fn CreateSharedBitmap( + riid: REFIID, + data: *const c_void, + bitmapProperties: *const D2D1_BITMAP_PROPERTIES, + bitmap: *mut *mut ID2D1Bitmap, + ) -> HRESULT, + fn CreateBitmapBrush( + bitmap: *mut ID2D1Bitmap, + bitmapBrushProperties: *const D2D1_BITMAP_BRUSH_PROPERTIES, + brushProperties: *const D2D1_BRUSH_PROPERTIES, + bitmapBrush: *mut *mut ID2D1BitmapBrush, + ) -> HRESULT, + fn CreateSolidColorBrush( + color: *const D2D1_COLOR_F, + brushProperties: *const D2D1_BRUSH_PROPERTIES, + solidColorBrush: *mut *mut ID2D1SolidColorBrush, + ) -> HRESULT, + fn CreateGradientStopCollection( + gradientStops: *const D2D1_GRADIENT_STOP, + gradientStopsCount: UINT32, + colorInterpolationGamma: D2D1_GAMMA, + extendMode: D2D1_EXTEND_MODE, + gradientStopCollection: *mut *mut ID2D1GradientStopCollection, + ) -> HRESULT, + fn CreateLinearGradientBrush( + linearGradientBrushProperties: *const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES, + brushProperties: *const D2D1_BRUSH_PROPERTIES, + gradientStopCollection: *mut ID2D1GradientStopCollection, + linearGradientBrush: *mut *mut ID2D1LinearGradientBrush, + ) -> HRESULT, + fn CreateRadialGradientBrush( + radialGradientBrushProperties: *const D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES, + brushProperties: *const D2D1_BRUSH_PROPERTIES, + gradientStopCollection: *mut ID2D1GradientStopCollection, + radialGradientBrush: *mut *mut ID2D1RadialGradientBrush, + ) -> HRESULT, + fn CreateCompatibleRenderTarget( + desiredSize: *const D2D1_SIZE_F, + desiredPixelSize: *const D2D1_SIZE_U, + desiredFormat: *const D2D1_PIXEL_FORMAT, + options: D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS, + bitmapRenderTarget: *mut *mut ID2D1BitmapRenderTarget, + ) -> HRESULT, + fn CreateLayer( + size: *const D2D1_SIZE_F, + layer: *mut *mut ID2D1Layer, + ) -> HRESULT, + fn CreateMesh( + mesh: *mut *mut ID2D1Mesh, + ) -> HRESULT, + fn DrawLine( + point0: D2D1_POINT_2F, + point1: D2D1_POINT_2F, + brush: *mut ID2D1Brush, + strokeWidth: FLOAT, + strokeStype: *mut ID2D1StrokeStyle, + ) -> (), + fn DrawRectangle( + rect: *const D2D1_RECT_F, + brush: *mut ID2D1Brush, + strokeWidth: FLOAT, + strokeStyle: *mut ID2D1StrokeStyle, + ) -> (), + fn FillRectangle( + rect: *const D2D1_RECT_F, + brush: *mut ID2D1Brush, + ) -> (), + fn DrawRoundedRectangle( + roundedRect: *const D2D1_ROUNDED_RECT, + brush: *mut ID2D1Brush, + strokeWidth: FLOAT, + strokeStyle: *mut ID2D1StrokeStyle, + ) -> (), + fn FillRoundedRectangle( + roundedRect: *const D2D1_ROUNDED_RECT, + brush: *mut ID2D1Brush, + ) -> (), + fn DrawEllipse( + ellipse: *const D2D1_ELLIPSE, + brush: *mut ID2D1Brush, + strokeWidth: FLOAT, + strokeStyle: *mut ID2D1StrokeStyle, + ) -> (), + fn FillEllipse( + ellipse: *const D2D1_ELLIPSE, + brush: *mut ID2D1Brush, + ) -> (), + fn DrawGeometry( + geometry: *mut ID2D1Geometry, + brush: *mut ID2D1Brush, + strokeWidth: FLOAT, + strokeStyle: *mut ID2D1StrokeStyle, + ) -> (), + fn FillGeometry( + geometry: *mut ID2D1Geometry, + brush: *mut ID2D1Brush, + opacityBrush: *mut ID2D1Brush, + ) -> (), + fn FillMesh( + mesh: *mut ID2D1Mesh, + brush: *const ID2D1Brush, + ) -> (), + fn FillOpacityMask( + opacityMask: *mut ID2D1Bitmap, + brush: *mut ID2D1Brush, + content: D2D1_OPACITY_MASK_CONTENT, + destinationRectangle: *const D2D1_RECT_F, + sourceRectangle: *const D2D1_RECT_F, + ) -> (), + fn DrawBitmap( + bitmap: *mut ID2D1Bitmap, + destinationRectangle: *const D2D1_RECT_F, + opacity: FLOAT, + interpolationMode: D2D1_BITMAP_INTERPOLATION_MODE, + sourceRectangle: *const D2D1_RECT_F, + ) -> (), + fn DrawText( + string: *const WCHAR, + stringLength: UINT32, + textFormat: *mut IDWriteTextFormat, + layoutRect: *const D2D1_RECT_F, + defaultForegroundBrush: *mut ID2D1Brush, + options: D2D1_DRAW_TEXT_OPTIONS, + measuringMode: DWRITE_MEASURING_MODE, + ) -> (), + fn DrawTextLayout( + origin: D2D1_POINT_2F, + textLayout: *mut IDWriteTextLayout, + defaultForegroundBrush: *mut ID2D1Brush, + options: D2D1_DRAW_TEXT_OPTIONS, + ) -> (), + fn DrawGlyphRun( + baselineOrigin: D2D1_POINT_2F, + glyphRun: *const DWRITE_GLYPH_RUN, + foregroundBrush: *mut ID2D1Brush, + measuringMode: DWRITE_MEASURING_MODE, + ) -> (), + fn SetTransform( + transform: *const D2D1_MATRIX_3X2_F, + ) -> (), + fn GetTransform( + transform: *mut D2D1_MATRIX_3X2_F, + ) -> (), + fn SetAntialiasMode( + antialiasMode: D2D1_ANTIALIAS_MODE, + ) -> (), + fn GetAntialiasMode() -> D2D1_ANTIALIAS_MODE, + fn SetTextAntialiasMode( + textAntialiasMode: D2D1_TEXT_ANTIALIAS_MODE, + ) -> (), + fn GetTextAntialiasMode() -> D2D1_TEXT_ANTIALIAS_MODE, + fn SetTextRenderingParams( + textRenderingParams: *mut IDWriteRenderingParams, + ) -> (), + fn GetTextRenderingParams( + textRenderingParams: *mut *mut IDWriteRenderingParams, + ) -> (), + fn SetTags( + tag1: D2D1_TAG, + tag2: D2D1_TAG, + ) -> (), + fn GetTags( + tag1: *mut D2D1_TAG, + tag2: *mut D2D1_TAG, + ) -> (), + fn PushLayer( + layerParameters: *const D2D1_LAYER_PARAMETERS, + layer: *mut ID2D1Layer, + ) -> (), + fn PopLayer() -> (), + fn Flush( + tag1: *mut D2D1_TAG, + tag2: *mut D2D1_TAG, + ) -> HRESULT, + fn SaveDrawingState( + drawingStateBlock: *mut ID2D1DrawingStateBlock, + ) -> (), + fn RestoreDrawingState( + drawingStateBlock: *mut ID2D1DrawingStateBlock, + ) -> (), + fn PushAxisAlignedClip( + clipRect: *const D2D1_RECT_F, + antialiasMode: D2D1_ANTIALIAS_MODE, + ) -> (), + fn PopAxisAlignedClip() -> (), + fn Clear( + clearColor: *const D2D1_COLOR_F, + ) -> (), + fn BeginDraw() -> (), + fn EndDraw( + tag1: *mut D2D1_TAG, + tag2: *mut D2D1_TAG, + ) -> HRESULT, + #[fixme] fn GetPixelFormat() -> D2D1_PIXEL_FORMAT, + fn SetDpi( + dpiX: FLOAT, + dpiY: FLOAT, + ) -> (), + fn GetDpi( + dpiX: *mut FLOAT, + dpiY: *mut FLOAT, + ) -> (), + #[fixme] fn GetSize() -> D2D1_SIZE_F, + #[fixme] fn GetPixelSize() -> D2D1_SIZE_U, + fn GetMaximumBitmapSize() -> UINT32, + fn IsSupported( + renderTargetProperties: *const D2D1_RENDER_TARGET_PROPERTIES, + ) -> BOOL, +}} +RIDL!{#[uuid(0x2cd90695, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1BitmapRenderTarget(ID2D1BitmapRenderTargetVtbl): + ID2D1RenderTarget(ID2D1RenderTargetVtbl) { + fn GetBitmap( + bitmap: *mut *mut ID2D1Bitmap, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2cd90698, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)] +interface ID2D1HwndRenderTarget(ID2D1HwndRenderTargetVtbl): + ID2D1RenderTarget(ID2D1RenderTargetVtbl) { + fn CheckWindowState() -> D2D1_WINDOW_STATE, + fn Resize( + pixelSize: *const D2D1_SIZE_U, + ) -> HRESULT, + fn GetHwnd() -> HWND, +}} +RIDL!{#[uuid(0xe0db51c3, 0x6f77, 0x4bae, 0xb3, 0xd5, 0xe4, 0x75, 0x09, 0xb3, 0x58, 0x38)] +interface ID2D1GdiInteropRenderTarget(ID2D1GdiInteropRenderTargetVtbl): IUnknown(IUnknownVtbl) { + fn GetDC( + mode: D2D1_DC_INITIALIZE_MODE, + hdc: *mut HDC, + ) -> HRESULT, + fn ReleaseDC( + update: *const RECT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1c51bc64, 0xde61, 0x46fd, 0x98, 0x99, 0x63, 0xa5, 0xd8, 0xf0, 0x39, 0x50)] +interface ID2D1DCRenderTarget(ID2D1DCRenderTargetVtbl): ID2D1RenderTarget(ID2D1RenderTargetVtbl) { + fn BindDC( + hDC: HDC, + pSubRect: *const RECT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x06152247, 0x6f50, 0x465a, 0x92, 0x45, 0x11, 0x8b, 0xfd, 0x3b, 0x60, 0x07)] +interface ID2D1Factory(ID2D1FactoryVtbl): IUnknown(IUnknownVtbl) { + fn ReloadSystemMetrics() -> HRESULT, + fn GetDesktopDpi( + dpiX: *mut FLOAT, + dpiY: *mut FLOAT, + ) -> (), + fn CreateRectangleGeometry( + rectangle: *const D2D1_RECT_F, + rectangleGeometry: *mut *mut ID2D1RectangleGeometry, + ) -> HRESULT, + fn CreateRoundedRectangleGeometry( + roundedRectangle: *const D2D1_ROUNDED_RECT, + roundedRectangleGeometry: *mut *mut ID2D1RoundedRectangleGeometry, + ) -> HRESULT, + fn CreateEllipseGeometry( + ellipse: *const D2D1_ELLIPSE, + ellipseGeometry: *mut *mut ID2D1EllipseGeometry, + ) -> HRESULT, + fn CreateGeometryGroup( + fillMode: D2D1_FILL_MODE, + geometries: *mut *mut ID2D1Geometry, + geometriesCount: UINT32, + geometryGroup: *mut *mut ID2D1GeometryGroup, + ) -> HRESULT, + fn CreateTransformedGeometry( + sourceGeometry: *mut ID2D1Geometry, + transform: *const D2D1_MATRIX_3X2_F, + transformedGeometry: *mut *mut ID2D1TransformedGeometry, + ) -> HRESULT, + fn CreatePathGeometry( + pathGeometry: *mut *mut ID2D1PathGeometry, + ) -> HRESULT, + fn CreateStrokeStyle( + strokeStyleProperties: *const D2D1_STROKE_STYLE_PROPERTIES, + dashes: *const FLOAT, + dashesCount: UINT32, + strokeStyle: *mut *mut ID2D1StrokeStyle, + ) -> HRESULT, + fn CreateDrawingStateBlock( + drawingStateDescription: *const D2D1_DRAWING_STATE_DESCRIPTION, + textRenderingParams: *mut IDWriteRenderingParams, + drawingStateBlock: *mut *mut ID2D1DrawingStateBlock, + ) -> HRESULT, + fn CreateWicBitmapRenderTarget( + target: *mut IWICBitmap, + renderTargetProperties: *const D2D1_RENDER_TARGET_PROPERTIES, + renderTarget: *mut *mut ID2D1RenderTarget, + ) -> HRESULT, + fn CreateHwndRenderTarget( + renderTargetProperties: *const D2D1_RENDER_TARGET_PROPERTIES, + hwndRenderTargetProperties: *const D2D1_HWND_RENDER_TARGET_PROPERTIES, + hwndRenderTarget: *mut *mut ID2D1HwndRenderTarget, + ) -> HRESULT, + fn CreateDxgiSurfaceRenderTarget( + dxgiSurface: *mut IDXGISurface, + renderTargetProperties: *const D2D1_RENDER_TARGET_PROPERTIES, + renderTarget: *mut *mut ID2D1RenderTarget, + ) -> HRESULT, + fn CreateDCRenderTarget( + renderTargetProperties: *const D2D1_RENDER_TARGET_PROPERTIES, + dcRenderTarget: *mut *mut ID2D1DCRenderTarget, + ) -> HRESULT, +}} +extern "system" { + pub fn D2D1CreateFactory( + factoryType: D2D1_FACTORY_TYPE, + riid: REFIID, + pFactoryOptions: *const D2D1_FACTORY_OPTIONS, + ppIFactory: *mut *mut c_void, + ) -> HRESULT; + pub fn D2D1MakeRotateMatrix( + angle: FLOAT, + center: D2D1_POINT_2F, + matrix: *mut D2D1_MATRIX_3X2_F, + ); + pub fn D2D1MakeSkewMatrix( + angleX: FLOAT, + angleY: FLOAT, + center: D2D1_POINT_2F, + matrix: *mut D2D1_MATRIX_3X2_F, + ); + pub fn D2D1IsMatrixInvertible( + matrix: *const D2D1_MATRIX_3X2_F, + ) -> BOOL; + pub fn D2D1InvertMatrix( + matrix: *mut D2D1_MATRIX_3X2_F, + ) -> BOOL; + pub fn D2D1ComputeMaximumScaleFactor( + matrix: *const D2D1_MATRIX_3X2_F, + ) -> FLOAT; +} diff --git a/bash-5.1/vendor/winapi/src/um/d2d1_1.rs b/bash-5.1/vendor/winapi/src/um/d2d1_1.rs new file mode 100644 index 0000000000000000000000000000000000000000..8217e30abe1607641facfc56143c649abcc3c726 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d2d1_1.rs @@ -0,0 +1,847 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of d2d1_1.h +use ctypes::c_void; +use shared::basetsd::{UINT32, UINT64}; +use shared::dxgi::{IDXGIDevice, IDXGISurface}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::guiddef::{CLSID, REFCLSID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT}; +use um::d2d1::{ + D2D1_ANTIALIAS_MODE, D2D1_BRUSH_PROPERTIES, D2D1_CAP_STYLE, D2D1_COLOR_F, + D2D1_DASH_STYLE, D2D1_DEBUG_LEVEL, D2D1_EXTEND_MODE, D2D1_GRADIENT_STOP, + D2D1_INTERPOLATION_MODE_DEFINITION_ANISOTROPIC, D2D1_INTERPOLATION_MODE_DEFINITION_CUBIC, + D2D1_INTERPOLATION_MODE_DEFINITION_HIGH_QUALITY_CUBIC, + D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR, + D2D1_INTERPOLATION_MODE_DEFINITION_MULTI_SAMPLE_LINEAR, + D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR, D2D1_LINE_JOIN, D2D1_MATRIX_3X2_F, + D2D1_POINT_2F, D2D1_RECT_F, D2D1_SIZE_U, D2D1_TAG, D2D1_TEXT_ANTIALIAS_MODE, ID2D1Bitmap, + ID2D1BitmapBrush, ID2D1BitmapBrushVtbl, ID2D1BitmapVtbl, ID2D1Brush, ID2D1BrushVtbl, + ID2D1DrawingStateBlock, ID2D1DrawingStateBlockVtbl, ID2D1Factory, ID2D1FactoryVtbl, + ID2D1Geometry, ID2D1GradientStopCollection, ID2D1GradientStopCollectionVtbl, ID2D1Image, + ID2D1ImageVtbl, ID2D1Layer, ID2D1Mesh, ID2D1PathGeometry, ID2D1PathGeometryVtbl, + ID2D1RenderTarget, ID2D1RenderTargetVtbl, ID2D1Resource, ID2D1ResourceVtbl, ID2D1StrokeStyle, + ID2D1StrokeStyleVtbl, +}; +use um::d2d1effectauthor::D2D1_PROPERTY_BINDING; +use um::d2dbasetypes::D2D_SIZE_F; +use um::dcommon::{D2D1_PIXEL_FORMAT, DWRITE_MEASURING_MODE}; +use um::documenttarget::IPrintDocumentPackageTarget; +use um::dwrite::{DWRITE_GLYPH_RUN, DWRITE_GLYPH_RUN_DESCRIPTION, IDWriteRenderingParams}; +use um::objidlbase::IStream; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::wincodec::{IWICBitmapSource, IWICColorContext, IWICImagingFactory}; +use um::winnt::{HRESULT, PCWSTR, PWSTR}; +FN!{stdcall PD2D1_EFFECT_FACTORY( + effectImpl: *mut *mut IUnknown, +) -> HRESULT} +pub use um::d2dbasetypes::D2D_RECT_L as D2D1_RECT_L; +pub use um::d2dbasetypes::D2D_POINT_2L as D2D1_POINT_2L; +ENUM!{enum D2D1_PROPERTY_TYPE { + D2D1_PROPERTY_TYPE_UNKNOWN = 0, + D2D1_PROPERTY_TYPE_STRING = 1, + D2D1_PROPERTY_TYPE_BOOL = 2, + D2D1_PROPERTY_TYPE_UINT32 = 3, + D2D1_PROPERTY_TYPE_INT32 = 4, + D2D1_PROPERTY_TYPE_FLOAT = 5, + D2D1_PROPERTY_TYPE_VECTOR2 = 6, + D2D1_PROPERTY_TYPE_VECTOR3 = 7, + D2D1_PROPERTY_TYPE_VECTOR4 = 8, + D2D1_PROPERTY_TYPE_BLOB = 9, + D2D1_PROPERTY_TYPE_IUNKNOWN = 10, + D2D1_PROPERTY_TYPE_ENUM = 11, + D2D1_PROPERTY_TYPE_ARRAY = 12, + D2D1_PROPERTY_TYPE_CLSID = 13, + D2D1_PROPERTY_TYPE_MATRIX_3X2 = 14, + D2D1_PROPERTY_TYPE_MATRIX_4X3 = 15, + D2D1_PROPERTY_TYPE_MATRIX_4X4 = 16, + D2D1_PROPERTY_TYPE_MATRIX_5X4 = 17, + D2D1_PROPERTY_TYPE_COLOR_CONTEXT = 18, + D2D1_PROPERTY_TYPE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_PROPERTY { + D2D1_PROPERTY_CLSID = 0x80000000, + D2D1_PROPERTY_DISPLAYNAME = 0x80000001, + D2D1_PROPERTY_AUTHOR = 0x80000002, + D2D1_PROPERTY_CATEGORY = 0x80000003, + D2D1_PROPERTY_DESCRIPTION = 0x80000004, + D2D1_PROPERTY_INPUTS = 0x80000005, + D2D1_PROPERTY_CACHED = 0x80000006, + D2D1_PROPERTY_PRECISION = 0x80000007, + D2D1_PROPERTY_MIN_INPUTS = 0x80000008, + D2D1_PROPERTY_MAX_INPUTS = 0x80000009, + D2D1_PROPERTY_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_SUBPROPERTY { + D2D1_SUBPROPERTY_DISPLAYNAME = 0x80000000, + D2D1_SUBPROPERTY_ISREADONLY = 0x80000001, + D2D1_SUBPROPERTY_MIN = 0x80000002, + D2D1_SUBPROPERTY_MAX = 0x80000003, + D2D1_SUBPROPERTY_DEFAULT = 0x80000004, + D2D1_SUBPROPERTY_FIELDS = 0x80000005, + D2D1_SUBPROPERTY_INDEX = 0x80000006, + D2D1_SUBPROPERTY_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BITMAP_OPTIONS { + D2D1_BITMAP_OPTIONS_NONE = 0x00000000, + D2D1_BITMAP_OPTIONS_TARGET = 0x00000001, + D2D1_BITMAP_OPTIONS_CANNOT_DRAW = 0x00000002, + D2D1_BITMAP_OPTIONS_CPU_READ = 0x00000004, + D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE = 0x00000008, + D2D1_BITMAP_OPTIONS_FORCE_DWORD = 0xffffffff, +}} +// DEFINE_ENUM_FLAG_OPERATORS(D2D1_BITMAP_OPTIONS); +ENUM!{enum D2D1_COMPOSITE_MODE { + D2D1_COMPOSITE_MODE_SOURCE_OVER = 0, + D2D1_COMPOSITE_MODE_DESTINATION_OVER = 1, + D2D1_COMPOSITE_MODE_SOURCE_IN = 2, + D2D1_COMPOSITE_MODE_DESTINATION_IN = 3, + D2D1_COMPOSITE_MODE_SOURCE_OUT = 4, + D2D1_COMPOSITE_MODE_DESTINATION_OUT = 5, + D2D1_COMPOSITE_MODE_SOURCE_ATOP = 6, + D2D1_COMPOSITE_MODE_DESTINATION_ATOP = 7, + D2D1_COMPOSITE_MODE_XOR = 8, + D2D1_COMPOSITE_MODE_PLUS = 9, + D2D1_COMPOSITE_MODE_SOURCE_COPY = 10, + D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY = 11, + D2D1_COMPOSITE_MODE_MASK_INVERT = 12, + D2D1_COMPOSITE_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BUFFER_PRECISION { + D2D1_BUFFER_PRECISION_UNKNOWN = 0, + D2D1_BUFFER_PRECISION_8BPC_UNORM = 1, + D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB = 2, + D2D1_BUFFER_PRECISION_16BPC_UNORM = 3, + D2D1_BUFFER_PRECISION_16BPC_FLOAT = 4, + D2D1_BUFFER_PRECISION_32BPC_FLOAT = 5, + D2D1_BUFFER_PRECISION_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_MAP_OPTIONS { + D2D1_MAP_OPTIONS_NONE = 0, + D2D1_MAP_OPTIONS_READ = 1, + D2D1_MAP_OPTIONS_WRITE = 2, + D2D1_MAP_OPTIONS_DISCARD = 4, + D2D1_MAP_OPTIONS_FORCE_DWORD = 0xffffffff, +}} +//DEFINE_ENUM_FLAG_OPERATORS(D2D1_MAP_OPTIONS); +ENUM!{enum D2D1_INTERPOLATION_MODE { + D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR = D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR, + D2D1_INTERPOLATION_MODE_LINEAR = D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR, + D2D1_INTERPOLATION_MODE_CUBIC = D2D1_INTERPOLATION_MODE_DEFINITION_CUBIC, + D2D1_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR + = D2D1_INTERPOLATION_MODE_DEFINITION_MULTI_SAMPLE_LINEAR, + D2D1_INTERPOLATION_MODE_ANISOTROPIC = D2D1_INTERPOLATION_MODE_DEFINITION_ANISOTROPIC, + D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC + = D2D1_INTERPOLATION_MODE_DEFINITION_HIGH_QUALITY_CUBIC, + D2D1_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_UNIT_MODE { + D2D1_UNIT_MODE_DIPS = 0, + D2D1_UNIT_MODE_PIXELS = 1, + D2D1_UNIT_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_COLOR_SPACE { + D2D1_COLOR_SPACE_CUSTOM = 0, + D2D1_COLOR_SPACE_SRGB = 1, + D2D1_COLOR_SPACE_SCRGB = 2, + D2D1_COLOR_SPACE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DEVICE_CONTEXT_OPTIONS { + D2D1_DEVICE_CONTEXT_OPTIONS_NONE = 0, + D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS = 1, + D2D1_DEVICE_CONTEXT_OPTIONS_FORCE_DWORD = 0xffffffff, +}} +//DEFINE_ENUM_FLAG_OPERATORS(D2D1_DEVICE_CONTEXT_OPTIONS); +ENUM!{enum D2D1_STROKE_TRANSFORM_TYPE { + D2D1_STROKE_TRANSFORM_TYPE_NORMAL = 0, + D2D1_STROKE_TRANSFORM_TYPE_FIXED = 1, + D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE = 2, + D2D1_STROKE_TRANSFORM_TYPE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_PRIMITIVE_BLEND { + D2D1_PRIMITIVE_BLEND_SOURCE_OVER = 0, + D2D1_PRIMITIVE_BLEND_COPY = 1, + D2D1_PRIMITIVE_BLEND_MIN = 2, + D2D1_PRIMITIVE_BLEND_ADD = 3, + D2D1_PRIMITIVE_BLEND_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_THREADING_MODE { + D2D1_THREADING_MODE_SINGLE_THREADED = super::d2d1::D2D1_FACTORY_TYPE_SINGLE_THREADED, + D2D1_THREADING_MODE_MULTI_THREADED = super::d2d1::D2D1_FACTORY_TYPE_MULTI_THREADED, + D2D1_THREADING_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_COLOR_INTERPOLATION_MODE { + D2D1_COLOR_INTERPOLATION_MODE_STRAIGHT = 0, + D2D1_COLOR_INTERPOLATION_MODE_PREMULTIPLIED = 1, + D2D1_COLOR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +}} +pub use um::d2dbasetypes::D2D_VECTOR_2F as D2D1_VECTOR_2F; +pub use um::d2dbasetypes::D2D_VECTOR_3F as D2D1_VECTOR_3F; +pub use um::d2dbasetypes::D2D_VECTOR_4F as D2D1_VECTOR_4F; +STRUCT!{struct D2D1_BITMAP_PROPERTIES1 { + pixelFormat: D2D1_PIXEL_FORMAT, + dpiX: FLOAT, + dpiY: FLOAT, + bitmapOptions: D2D1_BITMAP_OPTIONS, + colorContext: *const ID2D1ColorContext, +}} +STRUCT!{struct D2D1_MAPPED_RECT { + pitch: UINT32, + bits: *const BYTE, +}} +STRUCT!{struct D2D1_RENDERING_CONTROLS { + bufferPrecision: D2D1_BUFFER_PRECISION, + tileSize: D2D1_SIZE_U, +}} +STRUCT!{struct D2D1_EFFECT_INPUT_DESCRIPTION { + effect: *const ID2D1Effect, + inputIndex: UINT32, + inputRectangle: D2D1_RECT_F, +}} +pub use um::d2dbasetypes::D2D_MATRIX_4X3_F as D2D1_MATRIX_4X3_F; +pub use um::d2dbasetypes::D2D_MATRIX_4X4_F as D2D1_MATRIX_4X4_F; +pub use um::d2dbasetypes::D2D_MATRIX_5X4_F as D2D1_MATRIX_5X4_F; +STRUCT!{struct D2D1_POINT_DESCRIPTION { + point: D2D1_POINT_2F, + unitTangentVector: D2D1_POINT_2F, + endSegment: UINT32, + endFigure: UINT32, + lengthToEndSegment: FLOAT, +}} +STRUCT!{struct D2D1_IMAGE_BRUSH_PROPERTIES { + sourceRectangle: D2D1_RECT_F, + extendModeX: D2D1_EXTEND_MODE, + extendModeY: D2D1_EXTEND_MODE, + interpolationMode: D2D1_INTERPOLATION_MODE, +}} +STRUCT!{struct D2D1_BITMAP_BRUSH_PROPERTIES1 { + extendModeX: D2D1_EXTEND_MODE, + extendModeY: D2D1_EXTEND_MODE, + interpolationMode: D2D1_INTERPOLATION_MODE, +}} +STRUCT!{struct D2D1_STROKE_STYLE_PROPERTIES1 { + startCap: D2D1_CAP_STYLE, + endCap: D2D1_CAP_STYLE, + dashCap: D2D1_CAP_STYLE, + lineJoin: D2D1_LINE_JOIN, + miterLimit: FLOAT, + dashStyle: D2D1_DASH_STYLE, + dashOffset: FLOAT, + transformType: D2D1_STROKE_TRANSFORM_TYPE, +}} +ENUM!{enum D2D1_LAYER_OPTIONS1 { + D2D1_LAYER_OPTIONS1_NONE = 0, + D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND = 1, + D2D1_LAYER_OPTIONS1_IGNORE_ALPHA = 2, + D2D1_LAYER_OPTIONS1_FORCE_DWORD = 0xffffffff, +}} +//DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS1); +STRUCT!{struct D2D1_LAYER_PARAMETERS1 { + contentBounds: D2D1_RECT_F, + geometricMask: *const ID2D1Geometry, + maskAntialiasMode: D2D1_ANTIALIAS_MODE, + maskTransform: D2D1_MATRIX_3X2_F, + opacity: FLOAT, + opacityBrush: *const ID2D1Brush, + layerOptions: D2D1_LAYER_OPTIONS1, +}} +ENUM!{enum D2D1_PRINT_FONT_SUBSET_MODE { + D2D1_PRINT_FONT_SUBSET_MODE_DEFAULT = 0, + D2D1_PRINT_FONT_SUBSET_MODE_EACHPAGE = 1, + D2D1_PRINT_FONT_SUBSET_MODE_NONE = 2, + D2D1_PRINT_FONT_SUBSET_MODE_FORCE_DWORD = 0xffffffff, +}} +STRUCT!{struct D2D1_DRAWING_STATE_DESCRIPTION1 { + antialiasMode: D2D1_ANTIALIAS_MODE, + textAntialiasMode: D2D1_TEXT_ANTIALIAS_MODE, + tag1: D2D1_TAG, + tag2: D2D1_TAG, + transform: D2D1_MATRIX_3X2_F, + primitiveBlend: D2D1_PRIMITIVE_BLEND, + unitMode: D2D1_UNIT_MODE, +}} +STRUCT!{struct D2D1_PRINT_CONTROL_PROPERTIES { + fontSubset: D2D1_PRINT_FONT_SUBSET_MODE, + rasterDPI: FLOAT, + colorSpace: D2D1_COLOR_SPACE, +}} +STRUCT!{struct D2D1_CREATION_PROPERTIES { + threadingMode: D2D1_THREADING_MODE, + debugLevel: D2D1_DEBUG_LEVEL, + options: D2D1_DEVICE_CONTEXT_OPTIONS, +}} +RIDL!{#[uuid(0x82237326, 0x8111, 0x4f7c, 0xbc, 0xf4, 0xb5, 0xc1, 0x17, 0x55, 0x64, 0xfe)] +interface ID2D1GdiMetafileSink(ID2D1GdiMetafileSinkVtbl): IUnknown(IUnknownVtbl) { + fn ProcessRecord( + recordType: DWORD, + recordData: *const c_void, + recordDataSize: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2f543dc3, 0xcfc1, 0x4211, 0x86, 0x4f, 0xcf, 0xd9, 0x1c, 0x6f, 0x33, 0x95)] +interface ID2D1GdiMetafile(ID2D1GdiMetafileVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn Stream( + sink: *const ID2D1GdiMetafileSink, + ) -> HRESULT, + fn GetBounds( + bounds: *mut D2D1_RECT_F, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x54d7898a, 0xa061, 0x40a7, 0xbe, 0xc7, 0xe4, 0x65, 0xbc, 0xba, 0x2c, 0x4f)] +interface ID2D1CommandSink(ID2D1CommandSinkVtbl): IUnknown(IUnknownVtbl) { + fn BeginDraw() -> HRESULT, + fn EndDraw() -> HRESULT, + fn SetAntialiasMode( + antialiasMode: D2D1_ANTIALIAS_MODE, + ) -> HRESULT, + fn SetTags( + tag1: D2D1_TAG, + tag2: D2D1_TAG, + ) -> HRESULT, + fn SetTextAntialiasMode( + textAntialiasMode: D2D1_TEXT_ANTIALIAS_MODE, + ) -> HRESULT, + fn SetTextRenderingParams( + textRenderingParams: *const IDWriteRenderingParams, + ) -> HRESULT, + fn SetTransform( + transform: *const D2D1_MATRIX_3X2_F, + ) -> HRESULT, + fn SetPrimitiveBlend( + primitiveBlend: D2D1_PRIMITIVE_BLEND, + ) -> HRESULT, + fn SetUnitMode( + unitMode: D2D1_UNIT_MODE, + ) -> HRESULT, + fn Clear( + color: *const D2D1_COLOR_F, + ) -> HRESULT, + fn DrawGlyphRun( + baselineOrigin: D2D1_POINT_2F, + glyphRun: *const DWRITE_GLYPH_RUN, + glyphRunDescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, + foregroundBrush: *const ID2D1Brush, + measuringMode: DWRITE_MEASURING_MODE, + ) -> HRESULT, + fn DrawLine( + point0: D2D1_POINT_2F, + point1: D2D1_POINT_2F, + brush: *const ID2D1Brush, + strokeWidth: FLOAT, + strokeStyle: *const ID2D1StrokeStyle, + ) -> HRESULT, + fn DrawGeometry( + geometry: *const ID2D1Geometry, + brush: *const ID2D1Brush, + strokeWidth: FLOAT, + strokeStyle: *const ID2D1StrokeStyle, + ) -> HRESULT, + fn DrawRectangle( + rect: *const D2D1_RECT_F, + brush: *const ID2D1Brush, + strokeWidth: FLOAT, + strokeStyle: *const ID2D1StrokeStyle, + ) -> HRESULT, + fn DrawBitmap( + bitmap: *const ID2D1Bitmap, + destinationRectangle: *const D2D1_RECT_F, + opacity: FLOAT, + interpolationMode: D2D1_INTERPOLATION_MODE, + sourceRectangle: *const D2D1_RECT_F, + perspectiveTransform: *const D2D1_MATRIX_4X4_F, + ) -> HRESULT, + fn DrawImage( + image: *const ID2D1Image, + targetOffset: *const D2D1_POINT_2F, + imageRectangle: *const D2D1_RECT_F, + interpolationMode: D2D1_INTERPOLATION_MODE, + compositeMode: D2D1_COMPOSITE_MODE, + ) -> HRESULT, + fn DrawGdiMetafile( + gdiMetafile: *const ID2D1GdiMetafile, + targetOffset: *const D2D1_POINT_2F, + ) -> HRESULT, + fn FillMesh( + mesh: *const ID2D1Mesh, + brush: *const ID2D1Brush, + ) -> HRESULT, + fn FillOpacityMask( + opacityMask: *const ID2D1Bitmap, + brush: *const ID2D1Brush, + destinationRectangle: *const D2D1_RECT_F, + sourceRectangle: *const D2D1_RECT_F, + ) -> HRESULT, + fn FillGeometry( + geometry: *const ID2D1Geometry, + brush: *const ID2D1Brush, + opacityBrush: *const ID2D1Brush, + ) -> HRESULT, + fn FillRectangle( + rect: *const D2D1_RECT_F, + brush: *const ID2D1Brush, + ) -> HRESULT, + fn PushAxisAlignedClip( + clipRect: *const D2D1_RECT_F, + antialiasMode: D2D1_ANTIALIAS_MODE, + ) -> HRESULT, + fn PushLayer( + layerParameters1: *const D2D1_LAYER_PARAMETERS1, + layer: *const ID2D1Layer, + ) -> HRESULT, + fn PopAxisAlignedClip() -> HRESULT, + fn PopLayer() -> HRESULT, +}} +RIDL!{#[uuid(0xb4f34a19, 0x2383, 0x4d76, 0x94, 0xf6, 0xec, 0x34, 0x36, 0x57, 0xc3, 0xdc)] +interface ID2D1CommandList(ID2D1CommandListVtbl): ID2D1Image(ID2D1ImageVtbl) { + fn Stream( + sink: *const ID2D1CommandSink, + ) -> HRESULT, + fn Close() -> HRESULT, +}} +RIDL!{#[uuid(0x2c1d867d, 0xc290, 0x41c8, 0xae, 0x7e, 0x34, 0xa9, 0x87, 0x02, 0xe9, 0xa5)] +interface ID2D1PrintControl(ID2D1PrintControlVtbl): IUnknown(IUnknownVtbl) { + fn AddPage( + commandList: *const ID2D1CommandList, + pageSize: D2D_SIZE_F, + pagePrintTicketStream: *const IStream, + tag1: *mut D2D1_TAG, + tag2: *mut D2D1_TAG, + ) -> HRESULT, + fn Close() -> HRESULT, +}} +RIDL!{#[uuid(0xfe9e984d, 0x3f95, 0x407c, 0xb5, 0xdb, 0xcb, 0x94, 0xd4, 0xe8, 0xf8, 0x7c)] +interface ID2D1ImageBrush(ID2D1ImageBrushVtbl): ID2D1Brush(ID2D1BrushVtbl) { + fn SetImage( + image: *const ID2D1Image, + ) -> (), + fn SetExtendModeX( + extendModeX: D2D1_EXTEND_MODE, + ) -> (), + fn SetExtendModeY( + extendModeY: D2D1_EXTEND_MODE, + ) -> (), + fn SetInterpolationMode( + interpolationMode: D2D1_INTERPOLATION_MODE, + ) -> (), + fn SetSourceRectangle( + sourceRectangle: *const D2D1_RECT_F, + ) -> (), + fn GetImage( + image: *mut *mut ID2D1Image, + ) -> (), + fn GetExtendModeX() -> D2D1_EXTEND_MODE, + fn GetExtendModeY() -> D2D1_EXTEND_MODE, + fn GetInterpolationMode() -> D2D1_INTERPOLATION_MODE, + fn GetSourceRectangle( + sourceRectangle: *mut D2D1_RECT_F, + ) -> (), +}} +RIDL!{#[uuid(0x41343a53, 0xe41a, 0x49a2, 0x91, 0xcd, 0x21, 0x79, 0x3b, 0xbb, 0x62, 0xe5)] +interface ID2D1BitmapBrush1(ID2D1BitmapBrush1Vtbl): ID2D1BitmapBrush(ID2D1BitmapBrushVtbl) { + fn SetInterpolationMode1( + interpolationMode: D2D1_INTERPOLATION_MODE, + ) -> (), + fn GetInterpolationMode1() -> D2D1_INTERPOLATION_MODE, +}} +RIDL!{#[uuid(0x10a72a66, 0xe91c, 0x43f4, 0x99, 0x3f, 0xdd, 0xf4, 0xb8, 0x2b, 0x0b, 0x4a)] +interface ID2D1StrokeStyle1(ID2D1StrokeStyle1Vtbl): ID2D1StrokeStyle(ID2D1StrokeStyleVtbl) { + fn GetStrokeTransformType() -> D2D1_STROKE_TRANSFORM_TYPE, +}} +RIDL!{#[uuid(0x62baa2d2, 0xab54, 0x41b7, 0xb8, 0x72, 0x78, 0x7e, 0x01, 0x06, 0xa4, 0x21)] +interface ID2D1PathGeometry1(ID2D1PathGeometry1Vtbl): ID2D1PathGeometry(ID2D1PathGeometryVtbl) { + fn ComputePointAndSegmentAtLength( + length: FLOAT, + startSegment: UINT32, + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + pointDescription: *mut D2D1_POINT_DESCRIPTION, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x483473d7, 0xcd46, 0x4f9d, 0x9d, 0x3a, 0x31, 0x12, 0xaa, 0x80, 0x15, 0x9d)] +interface ID2D1Properties(ID2D1PropertiesVtbl): IUnknown(IUnknownVtbl) { + fn GetPropertyCount() -> UINT32, + fn GetPropertyName( + index: UINT32, + name: PWSTR, + nameCount: UINT32, + ) -> HRESULT, + fn GetPropertyNameLength( + index: UINT32, + ) -> UINT32, + fn GetType( + index: UINT32, + ) -> D2D1_PROPERTY_TYPE, + fn GetPropertyIndex( + name: PCWSTR, + ) -> UINT32, + fn SetValueByName( + name: PCWSTR, + prop_type: D2D1_PROPERTY_TYPE, + data: *const BYTE, + dataSize: UINT32, + ) -> HRESULT, + fn SetValue( + index: UINT32, + prop_type: D2D1_PROPERTY_TYPE, + data: *const BYTE, + dataSize: UINT32, + ) -> HRESULT, + fn GetValueByName( + name: PCWSTR, + prop_type: D2D1_PROPERTY_TYPE, + data: *mut BYTE, + dataSize: UINT32, + ) -> HRESULT, + fn GetValue( + index: UINT32, + prop_type: D2D1_PROPERTY_TYPE, + data: *mut BYTE, + dataSize: UINT32, + ) -> HRESULT, + fn GetValueSize( + index: UINT32, + ) -> UINT32, + fn GetSubProperties( + index: UINT32, + subProperties: *mut *mut ID2D1Properties, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x28211a43, 0x7d89, 0x476f, 0x81, 0x81, 0x2d, 0x61, 0x59, 0xb2, 0x20, 0xad)] +interface ID2D1Effect(ID2D1EffectVtbl): ID2D1Properties(ID2D1PropertiesVtbl) { + fn SetInput( + index: UINT32, + input: *const ID2D1Image, + invalidate: BOOL, + ) -> (), + fn SetInputCount( + inputCount: UINT32, + ) -> HRESULT, + fn GetInput( + index: UINT32, + input: *mut *mut ID2D1Image, + ) -> (), + fn GetInputCount() -> UINT32, + fn GetOutput( + outputImage: *mut *mut ID2D1Image, + ) -> (), +}} +RIDL!{#[uuid(0xa898a84c, 0x3873, 0x4588, 0xb0, 0x8b, 0xeb, 0xbf, 0x97, 0x8d, 0xf0, 0x41)] +interface ID2D1Bitmap1(ID2D1Bitmap1Vtbl): ID2D1Bitmap(ID2D1BitmapVtbl) { + fn GetColorContext( + colorContext: *mut *mut ID2D1ColorContext, + ) -> (), + fn GetOptions() -> D2D1_BITMAP_OPTIONS, + fn GetSurface( + dxgiSurface: *mut *mut IDXGISurface, + ) -> HRESULT, + fn Map( + options: D2D1_MAP_OPTIONS, + mappedRect: *mut D2D1_MAPPED_RECT, + ) -> HRESULT, + fn Unmap() -> HRESULT, +}} +RIDL!{#[uuid(0x1c4820bb, 0x5771, 0x4518, 0xa5, 0x81, 0x2f, 0xe4, 0xdd, 0x0e, 0xc6, 0x57)] +interface ID2D1ColorContext(ID2D1ColorContextVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn GetColorSpace() -> D2D1_COLOR_SPACE, + fn GetProfileSize() -> UINT32, + fn GetProfile( + profile: *mut BYTE, + profileSize: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xae1572f4, 0x5dd0, 0x4777, 0x99, 0x8b, 0x92, 0x79, 0x47, 0x2a, 0xe6, 0x3b)] +interface ID2D1GradientStopCollection1(ID2D1GradientStopCollection1Vtbl): + ID2D1GradientStopCollection(ID2D1GradientStopCollectionVtbl) { + fn GetGradientStops1( + gradientStops: *mut D2D1_GRADIENT_STOP, + gradientStopsCount: UINT32, + ) -> (), + fn GetPreInterpolationSpace() -> D2D1_COLOR_SPACE, + fn GetPostInterpolationSpace() -> D2D1_COLOR_SPACE, + fn GetBufferPrecision() -> D2D1_BUFFER_PRECISION, + fn GetColorInterpolationMode() -> D2D1_COLOR_INTERPOLATION_MODE, +}} +RIDL!{#[uuid(0x689f1f85, 0xc72e, 0x4e33, 0x8f, 0x19, 0x85, 0x75, 0x4e, 0xfd, 0x5a, 0xce)] +interface ID2D1DrawingStateBlock1(ID2D1DrawingStateBlock1Vtbl): + ID2D1DrawingStateBlock(ID2D1DrawingStateBlockVtbl) { + fn GetDescription( + stateDescription: *mut D2D1_DRAWING_STATE_DESCRIPTION1, + ) -> (), + fn SetDescription( + stateDescription: *const D2D1_DRAWING_STATE_DESCRIPTION1, + ) -> (), +}} +RIDL!{#[uuid(0xe8f7fe7a, 0x191c, 0x466d, 0xad, 0x95, 0x97, 0x56, 0x78, 0xbd, 0xa9, 0x98)] +interface ID2D1DeviceContext(ID2D1DeviceContextVtbl): ID2D1RenderTarget(ID2D1RenderTargetVtbl) { + fn CreateBitmap( + size: D2D1_SIZE_U, + sourceData: *const c_void, + pitch: UINT32, + bitmapProperties: *const D2D1_BITMAP_PROPERTIES1, + bitmap: *mut *mut ID2D1Bitmap1, + ) -> HRESULT, + fn CreateBitmapFromWicBitmap( + wicBitmapSource: *const IWICBitmapSource, + bitmapProperties: *const D2D1_BITMAP_PROPERTIES1, + bitmap: *mut *mut ID2D1Bitmap1, + ) -> HRESULT, + fn CreateColorContext( + space: D2D1_COLOR_SPACE, + profile: *const BYTE, + profileSize: UINT32, + colorContext: *mut *mut ID2D1ColorContext, + ) -> HRESULT, + fn CreateColorContextFromFilename( + filename: PCWSTR, + colorContext: *mut *mut ID2D1ColorContext, + ) -> HRESULT, + fn CreateColorContextFromWicColorContext( + wicColorContext: *const IWICColorContext, + colorContext: *mut *mut ID2D1ColorContext, + ) -> HRESULT, + fn CreateBitmapFromDxgiSurface( + surface: *const IDXGISurface, + bitmapProperties: *const D2D1_BITMAP_PROPERTIES1, + bitmap: *mut *mut ID2D1Bitmap1, + ) -> HRESULT, + fn CreateEffect( + effectId: REFCLSID, + effect: *mut *mut ID2D1Effect, + ) -> HRESULT, + fn CreateGradientStopCollection( + straightAlphaGradientStops: *const D2D1_GRADIENT_STOP, + straightAlphaGradientStopsCount: UINT32, + preInterpolationSpace: D2D1_COLOR_SPACE, + postInterpolationSpace: D2D1_COLOR_SPACE, + bufferPrecision: D2D1_BUFFER_PRECISION, + extendMode: D2D1_EXTEND_MODE, + colorInterpolationMode: D2D1_COLOR_INTERPOLATION_MODE, + gradientStopCollection1: *mut *mut ID2D1GradientStopCollection1, + ) -> HRESULT, + fn CreateImageBrush( + image: *const ID2D1Image, + imageBrushProperties: *const D2D1_IMAGE_BRUSH_PROPERTIES, + brushProperties: *const D2D1_BRUSH_PROPERTIES, + imageBrush: *mut *mut ID2D1ImageBrush, + ) -> HRESULT, + fn CreateBitmapBrush( + bitmap: *const ID2D1Bitmap, + bitmapBrushProperties: *const D2D1_BITMAP_BRUSH_PROPERTIES1, + brushProperties: *const D2D1_BRUSH_PROPERTIES, + bitmapBrush: *mut *mut ID2D1BitmapBrush1, + ) -> HRESULT, + fn CreateCommandList( + commandList: *mut *mut ID2D1CommandList, + ) -> HRESULT, + fn IsDxgiFormatSupported( + format: DXGI_FORMAT, + ) -> BOOL, + fn IsBufferPrecisionSupported( + bufferPrecision: D2D1_BUFFER_PRECISION, + ) -> BOOL, + fn GetImageLocalBounds( + image: *const ID2D1Image, + localBounds: *mut D2D1_RECT_F, + ) -> HRESULT, + fn GetImageWorldBounds( + image: *const ID2D1Image, + worldBounds: *mut D2D1_RECT_F, + ) -> HRESULT, + fn GetGlyphRunWorldBounds( + baselineOrigin: D2D1_POINT_2F, + glyphRun: *const DWRITE_GLYPH_RUN, + measuringMode: DWRITE_MEASURING_MODE, + bounds: *mut D2D1_RECT_F, + ) -> HRESULT, + fn GetDevice( + device: *mut *mut ID2D1Device, + ) -> (), + fn SetTarget( + image: *const ID2D1Image, + ) -> (), + fn GetTarget( + image: *mut *mut ID2D1Image, + ) -> (), + fn SetRenderingControls( + renderingControls: *const D2D1_RENDERING_CONTROLS, + ) -> (), + fn GetRenderingControls( + renderingControls: *mut D2D1_RENDERING_CONTROLS, + ) -> (), + fn SetPrimitiveBlend( + primitiveBlend: D2D1_PRIMITIVE_BLEND, + ) -> (), + fn GetPrimitiveBlend() -> D2D1_PRIMITIVE_BLEND, + fn SetUnitMode( + unitMode: D2D1_UNIT_MODE, + ) -> (), + fn GetUnitMode() -> D2D1_UNIT_MODE, + fn DrawGlyphRun( + baselineOrigin: D2D1_POINT_2F, + glyphRun: *const DWRITE_GLYPH_RUN, + glyphRunDescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, + foregroundBrush: *const ID2D1Brush, + measuringMode: DWRITE_MEASURING_MODE, + ) -> (), + fn DrawImage( + image: *const ID2D1Image, + targetOffset: *const D2D1_POINT_2F, + imageRectangle: *const D2D1_RECT_F, + interpolationMode: D2D1_INTERPOLATION_MODE, + compositeMode: D2D1_COMPOSITE_MODE, + ) -> (), + fn DrawGdiMetafile( + gdiMetafile: *const ID2D1GdiMetafile, + targetOffset: *const D2D1_POINT_2F, + ) -> (), + fn DrawBitmap( + bitmap: *const ID2D1Bitmap, + destinationRectangle: *const D2D1_RECT_F, + opacity: FLOAT, + interpolationMode: D2D1_INTERPOLATION_MODE, + sourceRectangle: *const D2D1_RECT_F, + perspectiveTransform: *const D2D1_MATRIX_4X4_F, + ) -> (), + fn PushLayer( + layerParameters: *const D2D1_LAYER_PARAMETERS1, + layer: *const ID2D1Layer, + ) -> (), + fn InvalidateEffectInputRectangle( + effect: *const ID2D1Effect, + input: UINT32, + inputRectangle: *const D2D1_RECT_F, + ) -> HRESULT, + fn GetEffectInvalidRectangleCount( + effect: *const ID2D1Effect, + rectangleCount: *mut UINT32, + ) -> HRESULT, + fn GetEffectInvalidRectangles( + effect: *const ID2D1Effect, + rectangles: *mut D2D1_RECT_F, + rectanglesCount: UINT32, + ) -> HRESULT, + fn GetEffectRequiredInputRectangles( + renderEffect: *const ID2D1Effect, + renderImageRectangle: *const D2D1_RECT_F, + inputDescriptions: *const D2D1_EFFECT_INPUT_DESCRIPTION, + requiredInputRects: *mut D2D1_RECT_F, + inputCount: UINT32, + ) -> HRESULT, + fn FillOpacityMask( + opacityMask: *const ID2D1Bitmap, + brush: *const ID2D1Brush, + destinationRectangle: *const D2D1_RECT_F, + sourceRectangle: *const D2D1_RECT_F, + ) -> (), +}} +RIDL!{#[uuid(0x47dd575d, 0xac05, 0x4cdd, 0x80, 0x49, 0x9b, 0x02, 0xcd, 0x16, 0xf4, 0x4c)] +interface ID2D1Device(ID2D1DeviceVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn CreateDeviceContext( + options: D2D1_DEVICE_CONTEXT_OPTIONS, + deviceContext: *mut *mut ID2D1DeviceContext, + ) -> HRESULT, + fn CreatePrintControl( + wicFactory: *const IWICImagingFactory, + documentTarget: *const IPrintDocumentPackageTarget, + printControlProperties: *const D2D1_PRINT_CONTROL_PROPERTIES, + printControl: *mut *mut ID2D1PrintControl, + ) -> HRESULT, + fn SetMaximumTextureMemory( + maximumInBytes: UINT64, + ) -> (), + fn GetMaximumTextureMemory() -> UINT64, + fn ClearResources( + millisecondsSinceUse: UINT32, + ) -> (), +}} +RIDL!{#[uuid(0xbb12d362, 0xdaee, 0x4b9a, 0xaa, 0x1d, 0x14, 0xba, 0x40, 0x1c, 0xfa, 0x1f)] +interface ID2D1Factory1(ID2D1Factory1Vtbl): ID2D1Factory(ID2D1FactoryVtbl) { + fn CreateDevice( + dxgiDevice: *const IDXGIDevice, + d2dDevice: *mut *mut ID2D1Device, + ) -> HRESULT, + fn CreateStrokeStyle( + strokeStyleProperties: *const D2D1_STROKE_STYLE_PROPERTIES1, + dashes: *const FLOAT, + dashesCount: UINT32, + strokeStyle: *mut *mut ID2D1StrokeStyle1, + ) -> HRESULT, + fn CreatePathGeometry( + pathGeometry: *mut *mut ID2D1PathGeometry1, + ) -> HRESULT, + fn CreateDrawingStateBlock( + drawingStateDescription: *const D2D1_DRAWING_STATE_DESCRIPTION1, + textRenderingParams: *const IDWriteRenderingParams, + drawingStateBlock: *mut *mut ID2D1DrawingStateBlock1, + ) -> HRESULT, + fn CreateGdiMetafile( + metafileStream: *const IStream, + metafile: *mut *mut ID2D1GdiMetafile, + ) -> HRESULT, + fn RegisterEffectFromStream( + classId: REFCLSID, + propertyXml: *const IStream, + bindings: *const D2D1_PROPERTY_BINDING, + bindingsCount: UINT32, + effectFactory: PD2D1_EFFECT_FACTORY, + ) -> HRESULT, + fn RegisterEffectFromString( + classId: REFCLSID, + propertyXml: PCWSTR, + bindings: *const D2D1_PROPERTY_BINDING, + bindingsCount: UINT32, + effectFactory: PD2D1_EFFECT_FACTORY, + ) -> HRESULT, + fn UnregisterEffect( + classId: REFCLSID, + ) -> HRESULT, + fn GetRegisteredEffects( + effects: *mut CLSID, + effectsCount: UINT32, + effectsReturned: *mut UINT32, + effectsRegistered: *mut UINT32, + ) -> HRESULT, + fn GetEffectProperties( + effectId: REFCLSID, + properties: *mut *mut ID2D1Properties, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x31e6e7bc, 0xe0ff, 0x4d46, 0x8c, 0x64, 0xa0, 0xa8, 0xc4, 0x1c, 0x15, 0xd3)] +interface ID2D1Multithread(ID2D1MultithreadVtbl): IUnknown(IUnknownVtbl) { + fn GetMultithreadProtected() -> BOOL, + fn Enter() -> (), + fn Leave() -> (), +}} +extern "system" { + pub fn D2D1CreateDevice( + dxgiDevice: *const IDXGIDevice, + creationProperties: *const D2D1_CREATION_PROPERTIES, + d2dDevice: *mut *mut ID2D1Device, + ) -> HRESULT; + pub fn D2D1CreateDeviceContext( + dxgiSurface: *const IDXGISurface, + creationProperties: *const D2D1_CREATION_PROPERTIES, + d2dDeviceContext: *mut *mut ID2D1DeviceContext, + ) -> HRESULT; + pub fn D2D1ConvertColorSpace( + sourceColorSpace: D2D1_COLOR_SPACE, + destinationColorSpace: D2D1_COLOR_SPACE, + color: *const D2D1_COLOR_F, + ) -> D2D1_COLOR_F; + pub fn D2D1SinCos( + angle: FLOAT, + s: *mut FLOAT, + c: *mut FLOAT, + ) -> (); + pub fn D2D1Tan( + angle: FLOAT, + ) -> FLOAT; + pub fn D2D1Vec3Length( + x: FLOAT, + y: FLOAT, + z: FLOAT, + ) -> FLOAT; +} diff --git a/bash-5.1/vendor/winapi/src/um/d2d1_2.rs b/bash-5.1/vendor/winapi/src/um/d2d1_2.rs new file mode 100644 index 0000000000000000000000000000000000000000..31b051390b0e364a822f3b0452c49bef1372eddd --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d2d1_2.rs @@ -0,0 +1,68 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of d2d1_2.h +use shared::dxgi::IDXGIDevice; +use shared::minwindef::FLOAT; +use um::d2d1::{ID2D1Brush, ID2D1Geometry, ID2D1StrokeStyle}; +use um::d2d1::{ID2D1Resource, ID2D1ResourceVtbl}; +use um::d2d1_1::{D2D1_DEVICE_CONTEXT_OPTIONS, D2D1_PRIMITIVE_BLEND}; +use um::d2d1_1::{ID2D1DeviceContext, ID2D1DeviceContextVtbl}; +use um::d2d1_1::{ID2D1Device, ID2D1DeviceVtbl}; +use um::d2d1_1::{ID2D1Factory1, ID2D1Factory1Vtbl}; +use um::d2d1_1::{ID2D1CommandSink, ID2D1CommandSinkVtbl}; +use um::winnt::HRESULT; +ENUM!{enum D2D1_RENDERING_PRIORITY { + D2D1_RENDERING_PRIORITY_NORMAL = 0, + D2D1_RENDERING_PRIORITY_LOW = 1, + D2D1_RENDERING_PRIORITY_FORCE_DWORD = 0xffffffff, +}} +RIDL!{#[uuid(0xa16907d7, 0xbc02, 0x4801, 0x99, 0xe8, 0x8c, 0xf7, 0xf4, 0x85, 0xf7, 0x74)] +interface ID2D1GeometryRealization(ID2D1GeometryRealizationVtbl): + ID2D1Resource(ID2D1ResourceVtbl) {}} +RIDL!{#[uuid(0xd37f57e4, 0x6908, 0x459f, 0xa1, 0x99, 0xe7, 0x2f, 0x24, 0xf7, 0x99, 0x87)] +interface ID2D1DeviceContext1(ID2D1DeviceContext1Vtbl): + ID2D1DeviceContext(ID2D1DeviceContextVtbl) { + fn CreateFilledGeometryRealization( + geometry: *mut ID2D1Geometry, + flatteningTolerance: FLOAT, + geometryRealization: *mut *mut ID2D1GeometryRealization, + ) -> HRESULT, + fn CreateStrokedGeometryRealization( + geometry: *mut ID2D1Geometry, + flatteningTolerance: FLOAT, + strokeWidth: FLOAT, + strokeStyle: *mut ID2D1StrokeStyle, + geometryRealization: *mut *mut ID2D1GeometryRealization, + ) -> HRESULT, + fn DrawGeometryRealization( + geometryRealization: *mut ID2D1GeometryRealization, + brush: *mut ID2D1Brush, + ) -> (), +}} +RIDL!{#[uuid(0xd21768e1, 0x23a4, 0x4823, 0xa1, 0x4b, 0x7c, 0x3e, 0xba, 0x85, 0xd6, 0x58)] +interface ID2D1Device1(ID2D1Device1Vtbl): ID2D1Device(ID2D1DeviceVtbl) { + fn GetRenderingPriority() -> D2D1_RENDERING_PRIORITY, + fn SetRenderingPriority( + renderingPriority: D2D1_RENDERING_PRIORITY, + ) -> (), + fn CreateDeviceContext( + options: D2D1_DEVICE_CONTEXT_OPTIONS, + deviceContext1: *mut *mut ID2D1DeviceContext1, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x94f81a73, 0x9212, 0x4376, 0x9c, 0x58, 0xb1, 0x6a, 0x3a, 0x0d, 0x39, 0x92)] +interface ID2D1Factory2(ID2D1Factory2Vtbl): ID2D1Factory1(ID2D1Factory1Vtbl) { + fn CreateDevice( + dxgiDevice: *mut IDXGIDevice, + d2dDevice1: *mut *mut ID2D1Device1, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9eb767fd, 0x4269, 0x4467, 0xb8, 0xc2, 0xeb, 0x30, 0xcb, 0x30, 0x57, 0x43)] +interface ID2D1CommandSink1(ID2D1CommandSink1Vtbl): ID2D1CommandSink(ID2D1CommandSinkVtbl) { + fn SetPrimitiveBlend1( + primitiveBlend: D2D1_PRIMITIVE_BLEND, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/d2d1_3.rs b/bash-5.1/vendor/winapi/src/um/d2d1_3.rs new file mode 100644 index 0000000000000000000000000000000000000000..64b7bd39427e2da32d65bad036cd1eb26260f692 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d2d1_3.rs @@ -0,0 +1,698 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of d2d1_3.h +use ctypes::c_void; +use shared::basetsd::{UINT16, UINT32, UINT64}; +use shared::dxgi::{IDXGIDevice, IDXGISurface}; +use shared::dxgitype::DXGI_COLOR_SPACE_TYPE; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT}; +use shared::ntdef::WCHAR; +use shared::winerror::HRESULT; +use um::d2d1::{ + D2D1_BITMAP_INTERPOLATION_MODE, D2D1_COLOR_F, D2D1_DRAW_TEXT_OPTIONS, D2D1_GAMMA_1_0, + D2D1_GAMMA_2_2, D2D1_MATRIX_3X2_F, D2D1_POINT_2F, D2D1_RECT_F, D2D1_RECT_U, D2D1_SIZE_F, + ID2D1Bitmap, ID2D1Brush, ID2D1Image, ID2D1ImageVtbl, ID2D1Resource, ID2D1ResourceVtbl, + ID2D1SimplifiedGeometrySink, +}; +use um::d2d1_1::{ + D2D1_BUFFER_PRECISION, D2D1_DEVICE_CONTEXT_OPTIONS, D2D1_INTERPOLATION_MODE, + D2D1_PRIMITIVE_BLEND, ID2D1ColorContext, ID2D1ColorContextVtbl, ID2D1CommandList, + ID2D1GdiMetafile, ID2D1GdiMetafileSink, ID2D1GdiMetafileSinkVtbl, ID2D1GdiMetafileVtbl, +}; +use um::d2d1_2::{ + ID2D1CommandSink1, ID2D1CommandSink1Vtbl, ID2D1Device1, ID2D1Device1Vtbl, ID2D1DeviceContext1, + ID2D1DeviceContext1Vtbl, ID2D1Factory2, ID2D1Factory2Vtbl, +}; +use um::d2d1effects::D2D1_BLEND_MODE; +use um::d2d1svg::ID2D1SvgDocument; +use um::dcommon::{D2D1_ALPHA_MODE, DWRITE_GLYPH_IMAGE_FORMATS, DWRITE_MEASURING_MODE}; +use um::dwrite::{DWRITE_GLYPH_RUN, IDWriteFontFace, IDWriteTextFormat, IDWriteTextLayout}; +use um::objidlbase::IStream; +use um::wincodec::IWICBitmapSource; +ENUM!{enum D2D1_INK_NIB_SHAPE { + D2D1_INK_NIB_SHAPE_ROUND = 0, + D2D1_INK_NIB_SHAPE_SQUARE = 1, +}} +ENUM!{enum D2D1_ORIENTATION { + D2D1_ORIENTATION_DEFAULT = 1, + D2D1_ORIENTATION_FLIP_HORIZONTAL = 2, + D2D1_ORIENTATION_ROTATE_CLOCKWISE180 = 3, + D2D1_ORIENTATION_ROTATE_CLOCKWISE180_FLIP_HORIZONTAL = 4, + D2D1_ORIENTATION_ROTATE_CLOCKWISE90_FLIP_HORIZONTAL = 5, + D2D1_ORIENTATION_ROTATE_CLOCKWISE270 = 6, + D2D1_ORIENTATION_ROTATE_CLOCKWISE270_FLIP_HORIZONTAL = 7, + D2D1_ORIENTATION_ROTATE_CLOCKWISE90 = 8, +}} +ENUM!{enum D2D1_IMAGE_SOURCE_LOADING_OPTIONS { + D2D1_IMAGE_SOURCE_LOADING_OPTIONS_NONE = 0, + D2D1_IMAGE_SOURCE_LOADING_OPTIONS_RELEASE_SOURCE = 1, + D2D1_IMAGE_SOURCE_LOADING_OPTIONS_CACHE_ON_DEMAND = 2, +}} +ENUM!{enum D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS { + D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_NONE = 0, + D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_LOW_QUALITY_PRIMARY_CONVERSION = 1, +}} +ENUM!{enum D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS { + D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_NONE = 0, + D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_DISABLE_DPI_SCALE = 1, +}} +STRUCT!{struct D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES { + orientation: D2D1_ORIENTATION, + scaleX: FLOAT, + scaleY: FLOAT, + interpolationMode: D2D1_INTERPOLATION_MODE, + options: D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS, +}} +STRUCT!{struct D2D1_INK_POINT { + x: FLOAT, + y: FLOAT, + radius: FLOAT, +}} +STRUCT!{struct D2D1_INK_BEZIER_SEGMENT { + point1: D2D1_INK_POINT, + point2: D2D1_INK_POINT, + point3: D2D1_INK_POINT, +}} +STRUCT!{struct D2D1_INK_STYLE_PROPERTIES { + nibShape: D2D1_INK_NIB_SHAPE, + nibTransform: D2D1_MATRIX_3X2_F, +}} +ENUM!{enum D2D1_PATCH_EDGE_MODE { + D2D1_PATCH_EDGE_MODE_ALIASED = 0, + D2D1_PATCH_EDGE_MODE_ANTIALIASED = 1, + D2D1_PATCH_EDGE_MODE_ALIASED_INFLATED = 2, +}} +STRUCT!{struct D2D1_GRADIENT_MESH_PATCH { + point00: D2D1_POINT_2F, + point01: D2D1_POINT_2F, + point02: D2D1_POINT_2F, + point03: D2D1_POINT_2F, + point10: D2D1_POINT_2F, + point11: D2D1_POINT_2F, + point12: D2D1_POINT_2F, + point13: D2D1_POINT_2F, + point20: D2D1_POINT_2F, + point21: D2D1_POINT_2F, + point22: D2D1_POINT_2F, + point23: D2D1_POINT_2F, + point30: D2D1_POINT_2F, + point31: D2D1_POINT_2F, + point32: D2D1_POINT_2F, + point33: D2D1_POINT_2F, + color00: D2D1_COLOR_F, + color03: D2D1_COLOR_F, + color30: D2D1_COLOR_F, + color33: D2D1_COLOR_F, + topEdgeMode: D2D1_PATCH_EDGE_MODE, + leftEdgeMode: D2D1_PATCH_EDGE_MODE, + bottomEdgeMode: D2D1_PATCH_EDGE_MODE, + rightEdgeMode: D2D1_PATCH_EDGE_MODE, +}} +ENUM!{enum D2D1_SPRITE_OPTIONS { + D2D1_SPRITE_OPTIONS_NONE = 0, + D2D1_SPRITE_OPTIONS_CLAMP_TO_SOURCE_RECTANGLE = 1, +}} +ENUM!{enum D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION { + D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_DEFAULT = 0, + D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_DISABLE = 1, +}} +ENUM!{enum D2D1_GAMMA1 { + D2D1_GAMMA1_G22 = D2D1_GAMMA_2_2, + D2D1_GAMMA1_G10 = D2D1_GAMMA_1_0, + D2D1_GAMMA1_G2084 = 2, +}} +STRUCT!{struct D2D1_SIMPLE_COLOR_PROFILE { + redPrimary: D2D1_POINT_2F, + greenPrimary: D2D1_POINT_2F, + bluePrimary: D2D1_POINT_2F, + whitePointXZ: D2D1_POINT_2F, + gamma: D2D1_GAMMA1, +}} +ENUM!{enum D2D1_COLOR_CONTEXT_TYPE { + D2D1_COLOR_CONTEXT_TYPE_ICC = 0, + D2D1_COLOR_CONTEXT_TYPE_SIMPLE = 1, + D2D1_COLOR_CONTEXT_TYPE_DXGI = 2, +}} +DEFINE_GUID!{IID_ID2D1InkStyle, + 0xbae8b344, 0x23fc, 0x4071, 0x8c, 0xb5, 0xd0, 0x5d, 0x6f, 0x07, 0x38, 0x48} +DEFINE_GUID!{IID_ID2D1Ink, + 0xb499923b, 0x7029, 0x478f, 0xa8, 0xb3, 0x43, 0x2c, 0x7c, 0x5f, 0x53, 0x12} +DEFINE_GUID!{IID_ID2D1GradientMesh, + 0xf292e401, 0xc050, 0x4cde, 0x83, 0xd7, 0x04, 0x96, 0x2d, 0x3b, 0x23, 0xc2} +DEFINE_GUID!{IID_ID2D1ImageSource, + 0xc9b664e5, 0x74a1, 0x4378, 0x9a, 0xc2, 0xee, 0xfc, 0x37, 0xa3, 0xf4, 0xd8} +DEFINE_GUID!{IID_ID2D1ImageSourceFromWic, + 0x77395441, 0x1c8f, 0x4555, 0x86, 0x83, 0xf5, 0x0d, 0xab, 0x0f, 0xe7, 0x92} +DEFINE_GUID!{IID_ID2D1TransformedImageSource, + 0x7f1f79e5, 0x2796, 0x416c, 0x8f, 0x55, 0x70, 0x0f, 0x91, 0x14, 0x45, 0xe5} +DEFINE_GUID!{IID_ID2D1LookupTable3D, + 0x53dd9855, 0xa3b0, 0x4d5b, 0x82, 0xe1, 0x26, 0xe2, 0x5c, 0x5e, 0x57, 0x97} +DEFINE_GUID!{IID_ID2D1DeviceContext2, + 0x394ea6a3, 0x0c34, 0x4321, 0x95, 0x0b, 0x6c, 0xa2, 0x0f, 0x0b, 0xe6, 0xc7} +DEFINE_GUID!{IID_ID2D1Device2, + 0xa44472e1, 0x8dfb, 0x4e60, 0x84, 0x92, 0x6e, 0x28, 0x61, 0xc9, 0xca, 0x8b} +DEFINE_GUID!{IID_ID2D1Factory3, + 0x0869759f, 0x4f00, 0x413f, 0xb0, 0x3e, 0x2b, 0xda, 0x45, 0x40, 0x4d, 0x0f} +DEFINE_GUID!{IID_ID2D1CommandSink2, + 0x3bab440e, 0x417e, 0x47df, 0xa2, 0xe2, 0xbc, 0x0b, 0xe6, 0xa0, 0x09, 0x16} +DEFINE_GUID!{IID_ID2D1GdiMetafile1, + 0x2e69f9e8, 0xdd3f, 0x4bf9, 0x95, 0xba, 0xc0, 0x4f, 0x49, 0xd7, 0x88, 0xdf} +DEFINE_GUID!{IID_ID2D1GdiMetafileSink1, + 0xfd0ecb6b, 0x91e6, 0x411e, 0x86, 0x55, 0x39, 0x5e, 0x76, 0x0f, 0x91, 0xb4} +DEFINE_GUID!{IID_ID2D1SpriteBatch, + 0x4dc583bf, 0x3a10, 0x438a, 0x87, 0x22, 0xe9, 0x76, 0x52, 0x24, 0xf1, 0xf1} +DEFINE_GUID!{IID_ID2D1DeviceContext3, + 0x235a7496, 0x8351, 0x414c, 0xbc, 0xd4, 0x66, 0x72, 0xab, 0x2d, 0x8e, 0x00} +DEFINE_GUID!{IID_ID2D1Device3, + 0x852f2087, 0x802c, 0x4037, 0xab, 0x60, 0xff, 0x2e, 0x7e, 0xe6, 0xfc, 0x01} +DEFINE_GUID!{IID_ID2D1Factory4, + 0xbd4ec2d2, 0x0662, 0x4bee, 0xba, 0x8e, 0x6f, 0x29, 0xf0, 0x32, 0xe0, 0x96} +DEFINE_GUID!{IID_ID2D1CommandSink3, + 0x18079135, 0x4cf3, 0x4868, 0xbc, 0x8e, 0x06, 0x06, 0x7e, 0x6d, 0x24, 0x2d} +DEFINE_GUID!{IID_ID2D1SvgGlyphStyle, + 0xaf671749, 0xd241, 0x4db8, 0x8e, 0x41, 0xdc, 0xc2, 0xe5, 0xc1, 0xa4, 0x38} +DEFINE_GUID!{IID_ID2D1DeviceContext4, + 0x8c427831, 0x3d90, 0x4476, 0xb6, 0x47, 0xc4, 0xfa, 0xe3, 0x49, 0xe4, 0xdb} +DEFINE_GUID!{IID_ID2D1Device4, + 0xd7bdb159, 0x5683, 0x4a46, 0xbc, 0x9c, 0x72, 0xdc, 0x72, 0x0b, 0x85, 0x8b} +DEFINE_GUID!{IID_ID2D1Factory5, + 0xc4349994, 0x838e, 0x4b0f, 0x8c, 0xab, 0x44, 0x99, 0x7d, 0x9e, 0xea, 0xcc} +DEFINE_GUID!{IID_ID2D1CommandSink4, + 0xc78a6519, 0x40d6, 0x4218, 0xb2, 0xde, 0xbe, 0xee, 0xb7, 0x44, 0xbb, 0x3e} +DEFINE_GUID!{IID_ID2D1ColorContext1, + 0x1ab42875, 0xc57f, 0x4be9, 0xbd, 0x85, 0x9c, 0xd7, 0x8d, 0x6f, 0x55, 0xee} +DEFINE_GUID!{IID_ID2D1DeviceContext5, + 0x7836d248, 0x68cc, 0x4df6, 0xb9, 0xe8, 0xde, 0x99, 0x1b, 0xf6, 0x2e, 0xb7} +DEFINE_GUID!{IID_ID2D1Device5, + 0xd55ba0a4, 0x6405, 0x4694, 0xae, 0xf5, 0x08, 0xee, 0x1a, 0x43, 0x58, 0xb4} +DEFINE_GUID!{IID_ID2D1Factory6, + 0xf9976f46, 0xf642, 0x44c1, 0x97, 0xca, 0xda, 0x32, 0xea, 0x2a, 0x26, 0x35} +DEFINE_GUID!{IID_ID2D1CommandSink5, + 0x7047dd26, 0xb1e7, 0x44a7, 0x95, 0x9a, 0x83, 0x49, 0xe2, 0x14, 0x4f, 0xa8} +DEFINE_GUID!{IID_ID2D1DeviceContext6, + 0x985f7e37, 0x4ed0, 0x4a19, 0x98, 0xa3, 0x15, 0xb0, 0xed, 0xfd, 0xe3, 0x06} +DEFINE_GUID!{IID_ID2D1Device6, + 0x7bfef914, 0x2d75, 0x4bad, 0xbe, 0x87, 0xe1, 0x8d, 0xdb, 0x07, 0x7b, 0x6d} +DEFINE_GUID!{IID_ID2D1Factory7, + 0xbdc2bdd3, 0xb96c, 0x4de6, 0xbd, 0xf7, 0x99, 0xd4, 0x74, 0x54, 0x54, 0xde} +RIDL!{#[uuid(0xbae8b344, 0x23fc, 0x4071, 0x8c, 0xb5, 0xd0, 0x5d, 0x6f, 0x07, 0x38, 0x48)] +interface ID2D1InkStyle(ID2D1InkStyleVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn SetNibTransform( + transform: *const D2D1_MATRIX_3X2_F, + ) -> (), + fn GetNibTransform( + transform: *mut D2D1_MATRIX_3X2_F, + ) -> (), + fn SetNibShape( + nibShape: D2D1_INK_NIB_SHAPE, + ) -> (), + fn GetNibShape() -> D2D1_INK_NIB_SHAPE, +}} +RIDL!{#[uuid(0xb499923b, 0x7029, 0x478f, 0xa8, 0xb3, 0x43, 0x2c, 0x7c, 0x5f, 0x53, 0x12)] +interface ID2D1Ink(ID2D1InkVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn SetStartPoint( + startPoint: *const D2D1_INK_POINT, + ) -> (), + fn GetStartPoint() -> D2D1_INK_POINT, + fn AddSegments( + segments: *const D2D1_INK_BEZIER_SEGMENT, + segmentsCount: UINT32, + ) -> HRESULT, + fn RemoveSegmentsAtEnd( + segmentsCount: UINT32, + ) -> HRESULT, + fn SetSegments( + startSegment: UINT32, + segments: *const D2D1_INK_BEZIER_SEGMENT, + segmentsCount: UINT32, + ) -> HRESULT, + fn SetSegmentAtEnd( + segment: *const D2D1_INK_BEZIER_SEGMENT, + ) -> HRESULT, + fn GetSegmentCount() -> UINT32, + fn GetSegments( + startSegment: UINT32, + segments: *mut D2D1_INK_BEZIER_SEGMENT, + segmentsCount: UINT32, + ) -> HRESULT, + fn StreamAsGeometry( + inkStyle: *mut ID2D1InkStyle, + worldTransform: *const D2D1_MATRIX_3X2_F, + flatteningTolerance: FLOAT, + geometrySink: *mut ID2D1SimplifiedGeometrySink, + ) -> HRESULT, + fn GetBounds( + inkStyle: *mut ID2D1InkStyle, + worldTransform: *const D2D1_MATRIX_3X2_F, + bounds: *mut D2D1_RECT_F, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf292e401, 0xc050, 0x4cde, 0x83, 0xd7, 0x04, 0x96, 0x2d, 0x3b, 0x23, 0xc2)] +interface ID2D1GradientMesh(ID2D1GradientMeshVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn GetPatchCount() -> UINT32, + fn GetPatches( + startIndex: UINT32, + patches: *mut D2D1_GRADIENT_MESH_PATCH, + patchesCount: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc9b664e5, 0x74a1, 0x4378, 0x9a, 0xc2, 0xee, 0xfc, 0x37, 0xa3, 0xf4, 0xd8)] +interface ID2D1ImageSource(ID2D1ImageSourceVtbl): ID2D1Image(ID2D1ImageVtbl) { + fn OfferResources() -> HRESULT, + fn TryReclaimResources( + resourcesDiscarded: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x77395441, 0x1c8f, 0x4555, 0x86, 0x83, 0xf5, 0x0d, 0xab, 0x0f, 0xe7, 0x92)] +interface ID2D1ImageSourceFromWic(ID2D1ImageSourceFromWicVtbl): + ID2D1ImageSource(ID2D1ImageSourceVtbl) { + fn EnsureCached( + rectangleToFill: *const D2D1_RECT_U, + ) -> HRESULT, + fn TrimCache( + rectangleToPreserve: *const D2D1_RECT_U, + ) -> HRESULT, + fn GetSource( + wicBitmapSource: *mut *mut IWICBitmapSource, + ) -> (), +}} +RIDL!{#[uuid(0x7f1f79e5, 0x2796, 0x416c, 0x8f, 0x55, 0x70, 0x0f, 0x91, 0x14, 0x45, 0xe5)] +interface ID2D1TransformedImageSource(ID2D1TransformedImageSourceVtbl): + ID2D1Image(ID2D1ImageVtbl) { + fn GetSource( + imageSource: *mut *mut ID2D1ImageSource, + ) -> (), + fn GetProperties( + properties: *mut D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES, + ) -> (), +}} +RIDL!{#[uuid(0x53dd9855, 0xa3b0, 0x4d5b, 0x82, 0xe1, 0x26, 0xe2, 0x5c, 0x5e, 0x57, 0x97)] +interface ID2D1LookupTable3D(ID2D1LookupTable3DVtbl): ID2D1Resource(ID2D1ResourceVtbl) {}} +RIDL!{#[uuid(0x394ea6a3, 0x0c34, 0x4321, 0x95, 0x0b, 0x6c, 0xa2, 0x0f, 0x0b, 0xe6, 0xc7)] +interface ID2D1DeviceContext2(ID2D1DeviceContext2Vtbl): + ID2D1DeviceContext1(ID2D1DeviceContext1Vtbl) { + fn CreateInk( + startPoint: *const D2D1_INK_POINT, + ink: *mut *mut ID2D1Ink, + ) -> HRESULT, + fn CreateInkStyle( + inkStyleProperties: *const D2D1_INK_STYLE_PROPERTIES, + inkStyle: *mut *mut ID2D1InkStyle, + ) -> HRESULT, + fn CreateGradientMesh( + patches: *const D2D1_GRADIENT_MESH_PATCH, + patchesCount: UINT32, + gradientMesh: *mut *mut ID2D1GradientMesh, + ) -> HRESULT, + fn CreateImageSourceFromWic( + wicBitmapSource: *mut IWICBitmapSource, + loadingOptions: D2D1_IMAGE_SOURCE_LOADING_OPTIONS, + alphaMode: D2D1_ALPHA_MODE, + imageSource: *mut *mut ID2D1ImageSourceFromWic, + ) -> HRESULT, + fn CreateLookupTable3D( + precision: D2D1_BUFFER_PRECISION, + extents: *const UINT32, + data: *const BYTE, + dataCount: UINT32, + strides: *const UINT32, + lookupTable: *mut *mut ID2D1LookupTable3D, + ) -> HRESULT, + fn CreateImageSourceFromDxgi( + surfaces: *const *mut IDXGISurface, + surfaceCount: UINT32, + colorSpace: DXGI_COLOR_SPACE_TYPE, + options: D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS, + imageSource: *mut *mut ID2D1ImageSource, + ) -> HRESULT, + fn GetGradientMeshWorldBounds( + gradientMesh: *mut ID2D1GradientMesh, + pBounds: *mut D2D1_RECT_F, + ) -> HRESULT, + fn DrawInk( + ink: *mut ID2D1Ink, + brush: *mut ID2D1Brush, + inkStyle: *mut ID2D1InkStyle, + ) -> (), + fn DrawGradientMesh( + gradientMesh: *mut ID2D1GradientMesh, + ) -> (), + fn DrawGdiMetafile( + gdiMetafile: *mut ID2D1GdiMetafile, + destinationRectangle: *const D2D1_RECT_F, + sourceRectangle: *const D2D1_RECT_F, + ) -> (), + fn CreateTransformedImageSource( + imageSource: *mut ID2D1ImageSource, + properties: *const D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES, + transformedImageSource: *mut *mut ID2D1TransformedImageSource, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa44472e1, 0x8dfb, 0x4e60, 0x84, 0x92, 0x6e, 0x28, 0x61, 0xc9, 0xca, 0x8b)] +interface ID2D1Device2(ID2D1Device2Vtbl): ID2D1Device1(ID2D1Device1Vtbl) { + fn CreateDeviceContext( + options: D2D1_DEVICE_CONTEXT_OPTIONS, + deviceContext2: *mut *mut ID2D1DeviceContext2, + ) -> HRESULT, + fn FlushDeviceContexts( + bitmap: *mut ID2D1Bitmap, + ) -> (), + fn GetDxgiDevice( + dxgiDevice: *mut *mut IDXGIDevice, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0869759f, 0x4f00, 0x413f, 0xb0, 0x3e, 0x2b, 0xda, 0x45, 0x40, 0x4d, 0x0f)] +interface ID2D1Factory3(ID2D1Factory3Vtbl): ID2D1Factory2(ID2D1Factory2Vtbl) { + fn CreateDevice( + dxgiDevice: *mut IDXGIDevice, + d2dDevice2: *mut *mut ID2D1Device2, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3bab440e, 0x417e, 0x47df, 0xa2, 0xe2, 0xbc, 0x0b, 0xe6, 0xa0, 0x09, 0x16)] +interface ID2D1CommandSink2(ID2D1CommandSink2Vtbl): ID2D1CommandSink1(ID2D1CommandSink1Vtbl) { + fn DrawInk( + ink: *mut ID2D1Ink, + brush: *mut ID2D1Brush, + inkStyle: *mut ID2D1InkStyle, + ) -> (), + fn DrawGradientMesh( + gradientMesh: *mut ID2D1GradientMesh, + ) -> (), + fn DrawGdiMetafile( + gdiMetafile: *mut ID2D1GdiMetafile, + destinationRectangle: *const D2D1_RECT_F, + sourceRectangle: *const D2D1_RECT_F, + ) -> (), +}} +RIDL!{#[uuid(0x2e69f9e8, 0xdd3f, 0x4bf9, 0x95, 0xba, 0xc0, 0x4f, 0x49, 0xd7, 0x88, 0xdf)] +interface ID2D1GdiMetafile1(ID2D1GdiMetafile1Vtbl): ID2D1GdiMetafile(ID2D1GdiMetafileVtbl) { + fn GetDpi( + dpiX: *mut FLOAT, + dpiY: *mut FLOAT, + ) -> HRESULT, + fn GetSourceBounds( + bounds: *mut D2D1_RECT_F, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xfd0ecb6b, 0x91e6, 0x411e, 0x86, 0x55, 0x39, 0x5e, 0x76, 0x0f, 0x91, 0xb4)] +interface ID2D1GdiMetafileSink1(ID2D1GdiMetafileSink1Vtbl): + ID2D1GdiMetafileSink(ID2D1GdiMetafileSinkVtbl) { + fn ProcessRecord( + recordType: DWORD, + recordData: *const c_void, + recordDataSize: DWORD, + flags: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4dc583bf, 0x3a10, 0x438a, 0x87, 0x22, 0xe9, 0x76, 0x52, 0x24, 0xf1, 0xf1)] +interface ID2D1SpriteBatch(ID2D1SpriteBatchVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn AddSprites( + spriteCount: UINT32, + destinationRectangle: *const D2D1_RECT_F, + sourceRectangles: *const D2D1_RECT_U, + colors: *const D2D1_COLOR_F, + transforms: *const D2D1_MATRIX_3X2_F, + destinationRectanglesStride: UINT32, + sourceRectanglesStride: UINT32, + colorsStride: UINT32, + transformsStride: D2D1_MATRIX_3X2_F, + ) -> HRESULT, + fn SetSprites( + startIndex: UINT32, + spriteCount: UINT32, + destinationRectangle: *const D2D1_RECT_F, + sourceRectangles: *const D2D1_RECT_U, + colors: *const D2D1_COLOR_F, + transforms: *const D2D1_MATRIX_3X2_F, + destinationRectanglesStride: UINT32, + sourceRectanglesStride: UINT32, + colorsStride: UINT32, + transformsStride: D2D1_MATRIX_3X2_F, + ) -> HRESULT, + fn GetSprites( + startIndex: UINT32, + spriteCount: UINT32, + destinationRectangle: *mut D2D1_RECT_F, + sourceRectangles: *mut D2D1_RECT_U, + colors: *mut D2D1_COLOR_F, + transforms: *mut D2D1_MATRIX_3X2_F, + ) -> HRESULT, + fn GetSpriteCount() -> UINT32, + fn Clear() -> (), +}} +RIDL!{#[uuid(0x235a7496, 0x8351, 0x414c, 0xbc, 0xd4, 0x66, 0x72, 0xab, 0x2d, 0x8e, 0x00)] +interface ID2D1DeviceContext3(ID2D1DeviceContext3Vtbl): + ID2D1DeviceContext2(ID2D1DeviceContext2Vtbl) { + fn CreateSpriteBatch( + spriteBatch: *mut *mut ID2D1SpriteBatch, + ) -> HRESULT, + fn DrawSpriteBatch( + spriteBatch: *mut ID2D1SpriteBatch, + startIndex: UINT32, + spriteCount: UINT32, + bitmap: *mut ID2D1Bitmap, + interpolationMode: D2D1_BITMAP_INTERPOLATION_MODE, + spriteOptions: D2D1_SPRITE_OPTIONS, + ) -> (), +}} +RIDL!{#[uuid(0x852f2087, 0x802c, 0x4037, 0xab, 0x60, 0xff, 0x2e, 0x7e, 0xe6, 0xfc, 0x01)] +interface ID2D1Device3(ID2D1Device3Vtbl): ID2D1Device2(ID2D1Device2Vtbl) { + fn CreateDeviceContext( + options: D2D1_DEVICE_CONTEXT_OPTIONS, + deviceContext3: *mut *mut ID2D1DeviceContext3, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xbd4ec2d2, 0x0662, 0x4bee, 0xba, 0x8e, 0x6f, 0x29, 0xf0, 0x32, 0xe0, 0x96)] +interface ID2D1Factory4(ID2D1Factory4Vtbl): ID2D1Factory3(ID2D1Factory3Vtbl) { + fn CreateDevice( + dxgiDevice: *mut IDXGIDevice, + d2dDevice3: *mut *mut ID2D1Device3, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x18079135, 0x4cf3, 0x4868, 0xbc, 0x8e, 0x06, 0x06, 0x7e, 0x6d, 0x24, 0x2d)] +interface ID2D1CommandSink3(ID2D1CommandSink3Vtbl): ID2D1CommandSink2(ID2D1CommandSink2Vtbl) { + fn DrawSpriteBatch( + spriteBatch: *mut ID2D1SpriteBatch, + startIndex: UINT32, + spriteCount: UINT32, + bitmap: *mut ID2D1Bitmap, + interpolationMode: D2D1_BITMAP_INTERPOLATION_MODE, + spriteOptions: D2D1_SPRITE_OPTIONS, + ) -> (), +}} +RIDL!{#[uuid(0xaf671749, 0xd241, 0x4db8, 0x8e, 0x41, 0xdc, 0xc2, 0xe5, 0xc1, 0xa4, 0x38)] +interface ID2D1SvgGlyphStyle(ID2D1SvgGlyphStyleVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn SetFill( + brush: *mut ID2D1Brush, + ) -> HRESULT, + fn GetFill( + brush: *mut *mut ID2D1Brush, + ) -> (), + fn SetStroke( + brush: *mut ID2D1Brush, + strokeWidth: FLOAT, + dashes: *const FLOAT, + dashesCount: UINT32, + dashOffset: FLOAT, + ) -> HRESULT, + fn GetStrokeDashesCount() -> UINT32, + fn GetStroke( + brush: *mut *mut ID2D1Brush, + strokeWidth: *mut FLOAT, + dashes: *mut FLOAT, + dashesCount: UINT32, + dashOffset: *mut FLOAT, + ) -> (), +}} +RIDL!{#[uuid(0x8c427831, 0x3d90, 0x4476, 0xb6, 0x47, 0xc4, 0xfa, 0xe3, 0x49, 0xe4, 0xdb)] +interface ID2D1DeviceContext4(ID2D1DeviceContext4Vtbl): + ID2D1DeviceContext3(ID2D1DeviceContext3Vtbl) { + fn CreateSvgGlyphStyle( + svgGlyphStyle: *mut *mut ID2D1SvgGlyphStyle, + ) -> HRESULT, + fn DrawText( + string: *const WCHAR, + stringLength: UINT32, + textFormat: *mut IDWriteTextFormat, + layoutRect: *const D2D1_RECT_F, + defaultFillBrush: *mut ID2D1Brush, + svgGlyphStyle: *mut ID2D1SvgGlyphStyle, + colorPaletteIndex: UINT32, + options: D2D1_DRAW_TEXT_OPTIONS, + measuringMode: DWRITE_MEASURING_MODE, + ) -> (), + fn DrawTextLayout( + origin: D2D1_POINT_2F, + textLayout: *mut IDWriteTextLayout, + defaultFillBrush: *mut ID2D1Brush, + svgGlyphStyle: *mut ID2D1SvgGlyphStyle, + colorPaletteIndex: UINT32, + options: D2D1_DRAW_TEXT_OPTIONS, + ) -> (), + fn DrawColorBitmapGlyphRun( + glyphImageFormat: DWRITE_GLYPH_IMAGE_FORMATS, + baselineOrigin: D2D1_POINT_2F, + glyphRun: *const DWRITE_GLYPH_RUN, + measuringMode: DWRITE_MEASURING_MODE, + bitmapSnapOption: D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION, + ) -> (), + fn DrawSvgGlyphRun( + baselineOrigin: D2D1_POINT_2F, + glyphRun: *const DWRITE_GLYPH_RUN, + defaultFillBrush: *mut ID2D1Brush, + svgGlyphStyle: *mut ID2D1SvgGlyphStyle, + colorPaletteIndex: UINT32, + measuringMode: DWRITE_MEASURING_MODE, + ) -> (), + fn GetColorBitmapGlyphImage( + glyphImageFormat: DWRITE_GLYPH_IMAGE_FORMATS, + glyphOrigin: D2D1_POINT_2F, + fontFace: *mut IDWriteFontFace, + fontEmSize: FLOAT, + glyphIndex: UINT16, + isSideways: BOOL, + worldTransform: *const D2D1_MATRIX_3X2_F, + dpiX: FLOAT, + dpiY: FLOAT, + glyphTransform: *mut D2D1_MATRIX_3X2_F, + glyphImage: *mut *mut ID2D1Image, + ) -> HRESULT, + fn GetSvgGlyphImage( + glyphImageFormat: DWRITE_GLYPH_IMAGE_FORMATS, + glyphOrigin: D2D1_POINT_2F, + fontFace: *mut IDWriteFontFace, + fontEmSize: FLOAT, + glyphIndex: UINT16, + isSideways: BOOL, + worldTransform: *const D2D1_MATRIX_3X2_F, + defaultFillBrush: *mut ID2D1Brush, + svgGlyphStyle: *mut ID2D1SvgGlyphStyle, + colorPaletteIndex: UINT32, + glyphTransform: *mut D2D1_MATRIX_3X2_F, + glyphImage: *mut *mut ID2D1CommandList, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd7bdb159, 0x5683, 0x4a46, 0xbc, 0x9c, 0x72, 0xdc, 0x72, 0x0b, 0x85, 0x8b)] +interface ID2D1Device4(ID2D1Device4Vtbl): ID2D1Device3(ID2D1Device3Vtbl) { + fn CreateDeviceContext( + options: D2D1_DEVICE_CONTEXT_OPTIONS, + deviceContext4: *mut *mut ID2D1DeviceContext4, + ) -> HRESULT, + fn SetMaximumColorGlyphCacheMemory( + maximumInBytes: UINT64, + ) -> (), + fn GetMaximumColorGlyphCacheMemory() -> UINT64, +}} +RIDL!{#[uuid(0xc4349994, 0x838e, 0x4b0f, 0x8c, 0xab, 0x44, 0x99, 0x7d, 0x9e, 0xea, 0xcc)] +interface ID2D1Factory5(ID2D1Factory5Vtbl): ID2D1Factory4(ID2D1Factory4Vtbl) { + fn CreateDevice( + dxgiDevice: *mut IDXGIDevice, + d2dDevice4: *mut *mut ID2D1Device4, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc78a6519, 0x40d6, 0x4218, 0xb2, 0xde, 0xbe, 0xee, 0xb7, 0x44, 0xbb, 0x3e)] +interface ID2D1CommandSink4(ID2D1CommandSink4Vtbl): ID2D1CommandSink3(ID2D1CommandSink3Vtbl) { + fn SetPrimitiveBlend2( + primitiveBlend: D2D1_PRIMITIVE_BLEND, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1ab42875, 0xc57f, 0x4be9, 0xbd, 0x85, 0x9c, 0xd7, 0x8d, 0x6f, 0x55, 0xee)] +interface ID2D1ColorContext1(ID2D1ColorContext1Vtbl): ID2D1ColorContext(ID2D1ColorContextVtbl) { + fn GetColorContextType() -> D2D1_COLOR_CONTEXT_TYPE, + fn GetDXGIColorSpace() -> DXGI_COLOR_SPACE_TYPE, + fn GetSimpleColorProfile( + simpleProfile: *mut D2D1_SIMPLE_COLOR_PROFILE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7836d248, 0x68cc, 0x4df6, 0xb9, 0xe8, 0xde, 0x99, 0x1b, 0xf6, 0x2e, 0xb7)] +interface ID2D1DeviceContext5(ID2D1DeviceContext5Vtbl): + ID2D1DeviceContext4(ID2D1DeviceContext4Vtbl) { + fn CreateSvgDocument( + inputXmlStream: *mut IStream, + viewportSize: D2D1_SIZE_F, + svgDocument: *mut *mut ID2D1SvgDocument, + ) -> HRESULT, + fn DrawSvgDocument( + svgDocument: *mut ID2D1SvgDocument, + ) -> (), + fn CreateColorContextFromDxgiColorSpace( + colorSpace: DXGI_COLOR_SPACE_TYPE, + colorContext: *mut *mut ID2D1ColorContext1, + ) -> HRESULT, + fn CreateColorContextFromSimpleColorProfile( + simpleProfile: *const D2D1_SIMPLE_COLOR_PROFILE, + colorContext: *mut *mut ID2D1ColorContext1, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd55ba0a4, 0x6405, 0x4694, 0xae, 0xf5, 0x08, 0xee, 0x1a, 0x43, 0x58, 0xb4)] +interface ID2D1Device5(ID2D1Device5Vtbl): ID2D1Device4(ID2D1Device4Vtbl) { + fn CreateDeviceContext( + options: D2D1_DEVICE_CONTEXT_OPTIONS, + deviceContext5: *mut *mut ID2D1DeviceContext5, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf9976f46, 0xf642, 0x44c1, 0x97, 0xca, 0xda, 0x32, 0xea, 0x2a, 0x26, 0x35)] +interface ID2D1Factory6(ID2D1Factory6Vtbl): ID2D1Factory5(ID2D1Factory5Vtbl) { + fn CreateDevice( + dxgiDevice: *mut IDXGIDevice, + d2dDevice5: *mut *mut ID2D1Device5, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7047dd26, 0xb1e7, 0x44a7, 0x95, 0x9a, 0x83, 0x49, 0xe2, 0x14, 0x4f, 0xa8)] +interface ID2D1CommandSink5(ID2D1CommandSink5Vtbl): ID2D1CommandSink4(ID2D1CommandSink4Vtbl) { + fn BlendImage( + image: *mut ID2D1Image, + blendMode: D2D1_BLEND_MODE, + targetOffset: *const D2D1_POINT_2F, + imageRectangle: *const D2D1_RECT_F, + interpolationMode: D2D1_INTERPOLATION_MODE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x985f7e37, 0x4ed0, 0x4a19, 0x98, 0xa3, 0x15, 0xb0, 0xed, 0xfd, 0xe3, 0x06)] +interface ID2D1DeviceContext6(ID2D1DeviceContext6Vtbl): + ID2D1DeviceContext5(ID2D1DeviceContext5Vtbl) { + fn BlendImage( + image: *mut ID2D1Image, + blendMode: D2D1_BLEND_MODE, + targetOffset: *const D2D1_POINT_2F, + imageRectangle: *const D2D1_RECT_F, + interpolationMode: D2D1_INTERPOLATION_MODE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7bfef914, 0x2d75, 0x4bad, 0xbe, 0x87, 0xe1, 0x8d, 0xdb, 0x07, 0x7b, 0x6d)] +interface ID2D1Device6(ID2D1Device6Vtbl): ID2D1Device5(ID2D1Device5Vtbl) { + fn CreateDeviceContext( + options: D2D1_DEVICE_CONTEXT_OPTIONS, + deviceContext6: *mut *mut ID2D1DeviceContext6, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xbdc2bdd3, 0xb96c, 0x4de6, 0xbd, 0xf7, 0x99, 0xd4, 0x74, 0x54, 0x54, 0xde)] +interface ID2D1Factory7(ID2D1Factory7Vtbl): ID2D1Factory6(ID2D1Factory6Vtbl) { + fn CreateDevice( + dxgiDevice: *mut IDXGIDevice, + d2dDevice6: *mut *mut ID2D1Device6, + ) -> HRESULT, +}} +extern "system" { + pub fn D2D1GetGradientMeshInteriorPointsFromCoonsPatch( + pPoint0: *const D2D1_POINT_2F, + pPoint1: *const D2D1_POINT_2F, + pPoint2: *const D2D1_POINT_2F, + pPoint3: *const D2D1_POINT_2F, + pPoint4: *const D2D1_POINT_2F, + pPoint5: *const D2D1_POINT_2F, + pPoint6: *const D2D1_POINT_2F, + pPoint7: *const D2D1_POINT_2F, + pPoint8: *const D2D1_POINT_2F, + pPoint9: *const D2D1_POINT_2F, + pPoint10: *const D2D1_POINT_2F, + pPoint11: *const D2D1_POINT_2F, + pTensorPoint11: *mut D2D1_POINT_2F, + pTensorPoint12: *mut D2D1_POINT_2F, + pTensorPoint21: *mut D2D1_POINT_2F, + pTensorPoint22: *mut D2D1_POINT_2F, + ); +} diff --git a/bash-5.1/vendor/winapi/src/um/d2d1effectauthor.rs b/bash-5.1/vendor/winapi/src/um/d2d1effectauthor.rs new file mode 100644 index 0000000000000000000000000000000000000000..c8322791c2a035be040970442aade00ad7c3b21a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d2d1effectauthor.rs @@ -0,0 +1,516 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_void; +use shared::basetsd::UINT32; +use shared::dxgiformat::DXGI_FORMAT; +use shared::guiddef::{GUID, REFCLSID, REFGUID}; +use shared::minwindef::{BOOL, BYTE, FLOAT}; +use shared::ntdef::{HRESULT, PCSTR, PCWSTR}; +use um::d2d1::D2D1_EXTEND_MODE; +use um::d2d1_1::{ + D2D1_BUFFER_PRECISION, D2D1_COLOR_SPACE, ID2D1Bitmap1, ID2D1ColorContext, ID2D1Effect, +}; +use um::d2dbasetypes::{D2D_POINT_2L, D2D_POINT_2U, D2D_RECT_L}; +use um::d3dcommon::D3D_FEATURE_LEVEL; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::wincodec::IWICColorContext; +FN!{stdcall PD2D1_PROPERTY_SET_FUNCTION( + effect: *const IUnknown, + data: *const BYTE, + dataSize: UINT32, +) -> HRESULT} +FN!{stdcall PD2D1_PROPERTY_GET_FUNCTION( + effect: *const IUnknown, + data: *mut BYTE, + dataSize: UINT32, + actualSize: *mut UINT32, +) -> HRESULT} +ENUM!{enum D2D1_CHANGE_TYPE { + D2D1_CHANGE_TYPE_NONE = 0, + D2D1_CHANGE_TYPE_PROPERTIES = 1, + D2D1_CHANGE_TYPE_CONTEXT = 2, + D2D1_CHANGE_TYPE_GRAPH = 3, +}} +ENUM!{enum D2D1_PIXEL_OPTIONS { + D2D1_PIXEL_OPTIONS_NONE = 0, + D2D1_PIXEL_OPTIONS_TRIVIAL_SAMPLING = 1, +}} +ENUM!{enum D2D1_VERTEX_OPTIONS { + D2D1_VERTEX_OPTIONS_NONE = 0, + D2D1_VERTEX_OPTIONS_DO_NOT_CLEAR = 1, + D2D1_VERTEX_OPTIONS_USE_DEPTH_BUFFER = 2, + D2D1_VERTEX_OPTIONS_ASSUME_NO_OVERLAP = 4, +}} +ENUM!{enum D2D1_VERTEX_USAGE { + D2D1_VERTEX_USAGE_STATIC = 0, + D2D1_VERTEX_USAGE_DYNAMIC = 1, +}} +ENUM!{enum D2D1_BLEND_OPERATION { + D2D1_BLEND_OPERATION_ADD = 1, + D2D1_BLEND_OPERATION_SUBTRACT = 2, + D2D1_BLEND_OPERATION_REV_SUBTRACT = 3, + D2D1_BLEND_OPERATION_MIN = 4, + D2D1_BLEND_OPERATION_MAX = 5, +}} +ENUM!{enum D2D1_BLEND { + D2D1_BLEND_ZERO = 1, + D2D1_BLEND_ONE = 2, + D2D1_BLEND_SRC_COLOR = 3, + D2D1_BLEND_INV_SRC_COLOR = 4, + D2D1_BLEND_SRC_ALPHA = 5, + D2D1_BLEND_INV_SRC_ALPHA = 6, + D2D1_BLEND_DEST_ALPHA = 7, + D2D1_BLEND_INV_DEST_ALPHA = 8, + D2D1_BLEND_DEST_COLOR = 9, + D2D1_BLEND_INV_DEST_COLOR = 10, + D2D1_BLEND_SRC_ALPHA_SAT = 11, + D2D1_BLEND_BLEND_FACTOR = 14, + D2D1_BLEND_INV_BLEND_FACTOR = 15, +}} +ENUM!{enum D2D1_CHANNEL_DEPTH { + D2D1_CHANNEL_DEPTH_DEFAULT = 0, + D2D1_CHANNEL_DEPTH_1 = 1, + D2D1_CHANNEL_DEPTH_4 = 4, +}} +ENUM!{enum D2D1_FILTER { + D2D1_FILTER_MIN_MAG_MIP_POINT = 0x00, + D2D1_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x01, + D2D1_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x04, + D2D1_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x05, + D2D1_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, + D2D1_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, + D2D1_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, + D2D1_FILTER_MIN_MAG_MIP_LINEAR = 0x15, + D2D1_FILTER_ANISOTROPIC = 0x55, +}} +ENUM!{enum D2D1_FEATURE { + D2D1_FEATURE_DOUBLES = 0, + D2D1_FEATURE_D3D10_X_HARDWARE_OPTIONS = 1, +}} +STRUCT!{struct D2D1_PROPERTY_BINDING { + propertyName: PCWSTR, + setFunction: PD2D1_PROPERTY_SET_FUNCTION, + getFunction: PD2D1_PROPERTY_GET_FUNCTION, +}} +STRUCT!{struct D2D1_RESOURCE_TEXTURE_PROPERTIES { + extents: *const UINT32, + dimensions: UINT32, + bufferPrecision: D2D1_BUFFER_PRECISION, + channelDepth: D2D1_CHANNEL_DEPTH, + filter: D2D1_FILTER, + extendModes: *const D2D1_EXTEND_MODE, +}} +STRUCT!{struct D2D1_INPUT_ELEMENT_DESC { + semanticName: PCSTR, + semanticIndex: UINT32, + format: DXGI_FORMAT, + inputSlot: UINT32, + alignedByteOffset: UINT32, +}} +pub const D2D1_APPEND_ALIGNED_ELEMENT: UINT32 = 0xffffffff; +STRUCT!{struct D2D1_VERTEX_BUFFER_PROPERTIES { + inputCount: UINT32, + usage: D2D1_VERTEX_USAGE, + data: *const BYTE, + byteWidth: UINT32, +}} +STRUCT!{struct D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES { + shaderBufferWithInputSignature: *const BYTE, + shaderBufferSize: UINT32, + inputElements: *const D2D1_INPUT_ELEMENT_DESC, + elementCount: UINT32, + stride: UINT32, +}} +STRUCT!{struct D2D1_VERTEX_RANGE { + startVertex: UINT32, + vertexCount: UINT32, +}} +STRUCT!{struct D2D1_BLEND_DESCRIPTION { + sourceBlend: D2D1_BLEND, + destinationBlend: D2D1_BLEND, + blendOperation: D2D1_BLEND_OPERATION, + sourceBlendAlpha: D2D1_BLEND, + destinationBlendAlpha: D2D1_BLEND, + blendOperationAlpha: D2D1_BLEND_OPERATION, + blendFactor: [FLOAT; 4], +}} +STRUCT!{struct D2D1_INPUT_DESCRIPTION { + filter: D2D1_FILTER, + leveOfDetailCount: UINT32, +}} +STRUCT!{struct D2D1_FEATURE_DATA_DOUBLES { + doublePrecisionFloatShaderOps: BOOL, +}} +STRUCT!{struct D2D1_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS { + computeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x: BOOL, +}} +DEFINE_GUID!{IID_ID2D1VertexBuffer, + 0x9b8b1336, 0x00a5, 0x4668, 0x92, 0xb7, 0xce, 0xd5, 0xd8, 0xbf, 0x9b, 0x7b} +DEFINE_GUID!{IID_ID2D1ResourceTexture, + 0x688d15c3, 0x02b0, 0x438d, 0xb1, 0x3a, 0xd1, 0xb4, 0x4c, 0x32, 0xc3, 0x9a} +DEFINE_GUID!{IID_ID2D1RenderInfo, + 0x519ae1bd, 0xd19a, 0x420d, 0xb8, 0x49, 0x36, 0x4f, 0x59, 0x47, 0x76, 0xb7} +DEFINE_GUID!{IID_ID2D1DrawInfo, + 0x693ce632, 0x7f2f, 0x45de, 0x93, 0xfe, 0x18, 0xd8, 0x8b, 0x37, 0xaa, 0x21} +DEFINE_GUID!{IID_ID2D1ComputeInfo, + 0x5598b14b, 0x9fd7, 0x48b7, 0x9b, 0xdb, 0x8f, 0x09, 0x64, 0xeb, 0x38, 0xbc} +DEFINE_GUID!{IID_ID2D1TransformNode, + 0xb2efe1e7, 0x729f, 0x4102, 0x94, 0x9f, 0x50, 0x5f, 0xa2, 0x1b, 0xf6, 0x66} +DEFINE_GUID!{IID_ID2D1TransformGraph, + 0x13d29038, 0xc3e6, 0x4034, 0x90, 0x81, 0x13, 0xb5, 0x3a, 0x41, 0x79, 0x92} +DEFINE_GUID!{IID_ID2D1Transform, + 0xef1a287d, 0x342a, 0x4f76, 0x8f, 0xdb, 0xda, 0x0d, 0x6e, 0xa9, 0xf9, 0x2b} +DEFINE_GUID!{IID_ID2D1DrawTransform, + 0x36bfdcb6, 0x9739, 0x435d, 0xa3, 0x0d, 0xa6, 0x53, 0xbe, 0xff, 0x6a, 0x6f} +DEFINE_GUID!{IID_ID2D1ComputeTransform, + 0x0d85573c, 0x01e3, 0x4f7d, 0xbf, 0xd9, 0x0d, 0x60, 0x60, 0x8b, 0xf3, 0xc3} +DEFINE_GUID!{IID_ID2D1AnalysisTransform, + 0x0359dc30, 0x95e6, 0x4568, 0x90, 0x55, 0x27, 0x72, 0x0d, 0x13, 0x0e, 0x93} +DEFINE_GUID!{IID_ID2D1SourceTransform, + 0xdb1800dd, 0x0c34, 0x4cf9, 0xbe, 0x90, 0x31, 0xcc, 0x0a, 0x56, 0x53, 0xe1} +DEFINE_GUID!{IID_ID2D1ConcreteTransform, + 0x1a799d8a, 0x69f7, 0x4e4c, 0x9f, 0xed, 0x43, 0x7c, 0xcc, 0x66, 0x84, 0xcc} +DEFINE_GUID!{IID_ID2D1BlendTransform, + 0x63ac0b32, 0xba44, 0x450f, 0x88, 0x06, 0x7f, 0x4c, 0xa1, 0xff, 0x2f, 0x1b} +DEFINE_GUID!{IID_ID2D1BorderTransform, + 0x4998735c, 0x3a19, 0x473c, 0x97, 0x81, 0x65, 0x68, 0x47, 0xe3, 0xa3, 0x47} +DEFINE_GUID!{IID_ID2D1OffsetTransform, + 0x3fe6adea, 0x7643, 0x4f53, 0xbd, 0x14, 0xa0, 0xce, 0x63, 0xf2, 0x40, 0x42} +DEFINE_GUID!{IID_ID2D1BoundsAdjustmentTransform, + 0x90f732e2, 0x5092, 0x4606, 0xa8, 0x19, 0x86, 0x51, 0x97, 0x0b, 0xac, 0xcd} +DEFINE_GUID!{IID_ID2D1EffectImpl, + 0xa248fd3f, 0x3e6c, 0x4e63, 0x9f, 0x03, 0x7f, 0x68, 0xec, 0xc9, 0x1d, 0xb9} +DEFINE_GUID!{IID_ID2D1EffectContext, + 0x3d9f916b, 0x27dc, 0x4ad7, 0xb4, 0xf1, 0x64, 0x94, 0x53, 0x40, 0xf5, 0x63} +RIDL!{#[uuid(0x9b8b1336, 0x00a5, 0x4668, 0x92, 0xb7, 0xce, 0xd5, 0xd8, 0xbf, 0x9b, 0x7b)] +interface ID2D1VertexBuffer(ID2D1VertexBufferVtbl): IUnknown(IUnknownVtbl) { + fn Map( + data: *mut *mut BYTE, + ) -> HRESULT, + fn Unmap() -> HRESULT, +}} +RIDL!{#[uuid(0x688d15c3, 0x02b0, 0x438d, 0xb1, 0x3a, 0xd1, 0xb4, 0x4c, 0x32, 0xc3, 0x9a)] +interface ID2D1ResourceTexture(ID2D1ResourceTextureVtbl): IUnknown(IUnknownVtbl) { + fn Update( + minimumExtents: *const UINT32, + maximumExtents: *const UINT32, + strides: *const UINT32, + dimensions: UINT32, + data: *const BYTE, + dataCount: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x519ae1bd, 0xd19a, 0x420d, 0xb8, 0x49, 0x36, 0x4f, 0x59, 0x47, 0x76, 0xb7)] +interface ID2D1RenderInfo(ID2D1RenderInfoVtbl): IUnknown(IUnknownVtbl) { + fn SetInputDescription( + inputIndex: UINT32, + inputDescription: D2D1_INPUT_DESCRIPTION, + ) -> HRESULT, + fn SetOutputBuffer( + bufferPrecision: D2D1_BUFFER_PRECISION, + channelDepth: D2D1_CHANNEL_DEPTH, + ) -> HRESULT, + fn SetCached( + isCached: BOOL, + ) -> (), + fn SetInstructionCountHint( + instructionCount: UINT32, + ) -> (), +}} +RIDL!{#[uuid(0x693ce632, 0x7f2f, 0x45de, 0x93, 0xfe, 0x18, 0xd8, 0x8b, 0x37, 0xaa, 0x21)] +interface ID2D1DrawInfo(ID2D1DrawInfoVtbl): ID2D1RenderInfo(ID2D1RenderInfoVtbl) { + fn SetPixelShaderConstantBuffer( + buffer: *const BYTE, + bufferCount: UINT32, + ) -> HRESULT, + fn SetResourceTexture( + textureIndex: UINT32, + resourceTexture: *mut ID2D1ResourceTexture, + ) -> HRESULT, + fn SetVertexShaderConstantBuffer( + buffer: *const BYTE, + bufferCount: UINT32, + ) -> HRESULT, + fn SetPixelShader( + shaderId: REFGUID, + pixelOptions: D2D1_PIXEL_OPTIONS, + ) -> HRESULT, + fn SetVertexProcessing( + vertexBuffer: *mut ID2D1VertexBuffer, + vertexOptions: D2D1_VERTEX_OPTIONS, + blendDescription: *const D2D1_BLEND_DESCRIPTION, + vertexRange: *const D2D1_VERTEX_RANGE, + vertexShader: *const GUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5598b14b, 0x9fd7, 0x48b7, 0x9b, 0xdb, 0x8f, 0x09, 0x64, 0xeb, 0x38, 0xbc)] +interface ID2D1ComputeInfo(ID2D1ComputeInfoVtbl): ID2D1RenderInfo(ID2D1RenderInfoVtbl) { + fn SetComputeShaderConstantBuffer( + buffer: *const BYTE, + bufferCount: UINT32, + ) -> HRESULT, + fn SetComputeShader( + shaderId: REFGUID, + ) -> HRESULT, + fn SetResourceTexture( + textureIndex: UINT32, + resourceTexture: *mut ID2D1ResourceTexture, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb2efe1e7, 0x729f, 0x4102, 0x94, 0x9f, 0x50, 0x5f, 0xa2, 0x1b, 0xf6, 0x66)] +interface ID2D1TransformNode(ID2D1TransformNodeVtbl): IUnknown(IUnknownVtbl) { + fn GetInputCount() -> UINT32, +}} +RIDL!{#[uuid(0x13d29038, 0xc3e6, 0x4034, 0x90, 0x81, 0x13, 0xb5, 0x3a, 0x41, 0x79, 0x92)] +interface ID2D1TransformGraph(ID2D1TransformGraphVtbl): IUnknown(IUnknownVtbl) { + fn GetInputCount() -> UINT32, + fn SetSingleTransformNode( + node: *mut ID2D1TransformNode, + ) -> HRESULT, + fn AddNode( + node: *mut ID2D1TransformNode, + ) -> HRESULT, + fn RemoveNode( + node: *mut ID2D1TransformNode, + ) -> HRESULT, + fn SetOutputNode( + node: *mut ID2D1TransformNode, + ) -> HRESULT, + fn ConnectNode( + fromNode: *mut ID2D1TransformNode, + toNode: *mut ID2D1TransformNode, + toNodeInputIndex: UINT32, + ) -> HRESULT, + fn ConnectToEffectInput( + toEffectInputIndex: UINT32, + node: *mut ID2D1TransformNode, + toNodeInputIndex: UINT32, + ) -> HRESULT, + fn Clear() -> (), + fn SetPassthroughGraph( + effectInputIndex: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xef1a287d, 0x342a, 0x4f76, 0x8f, 0xdb, 0xda, 0x0d, 0x6e, 0xa9, 0xf9, 0x2b)] +interface ID2D1Transform(ID2D1TransformVtbl): ID2D1TransformNode(ID2D1TransformNodeVtbl) { + fn MapOutputRectToInputRects( + outputRect: *const D2D_RECT_L, + inputRects: *mut D2D_RECT_L, + inputRectsCount: UINT32, + ) -> HRESULT, + fn MapInputRectsToOutputRect( + inputRects: *const D2D_RECT_L, + inputOpaqueSubRects: *const D2D_RECT_L, + inputRectCount: UINT32, + outputRect: *mut D2D_RECT_L, + outputOpaqueSubRect: *mut D2D_RECT_L, + ) -> HRESULT, + fn MapInvalidRect( + inputIndex: UINT32, + invalidInputRect: D2D_RECT_L, + invalidOutputRect: *mut D2D_RECT_L, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x36bfdcb6, 0x9739, 0x435d, 0xa3, 0x0d, 0xa6, 0x53, 0xbe, 0xff, 0x6a, 0x6f)] +interface ID2D1DrawTransform(ID2D1DrawTransformVtbl): ID2D1Transform(ID2D1TransformVtbl) { + fn SetDrawInfo( + drawInfo: *mut ID2D1DrawInfo, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0d85573c, 0x01e3, 0x4f7d, 0xbf, 0xd9, 0x0d, 0x60, 0x60, 0x8b, 0xf3, 0xc3)] +interface ID2D1ComputeTransform(ID2D1ComputeTransformVtbl): ID2D1Transform(ID2D1TransformVtbl) { + fn SetComputeInfo( + computeInfo: *mut ID2D1ComputeInfo, + ) -> HRESULT, + fn CalculateThreadgroups( + outputRect: *const D2D_RECT_L, + dimensionX: *mut UINT32, + dimensionY: *mut UINT32, + dimensionZ: *mut UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0359dc30, 0x95e6, 0x4568, 0x90, 0x55, 0x27, 0x72, 0x0d, 0x13, 0x0e, 0x93)] +interface ID2D1AnalysisTransform(ID2D1AnalysisTransformVtbl): IUnknown(IUnknownVtbl) { + fn ProcessAnalysisResults( + analysisData: *const BYTE, + analysisDataCount: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdb1800dd, 0x0c34, 0x4cf9, 0xbe, 0x90, 0x31, 0xcc, 0x0a, 0x56, 0x53, 0xe1)] +interface ID2D1SourceTransform(ID2D1SourceTransformVtbl): ID2D1Transform(ID2D1TransformVtbl) { + fn SetRenderInfo( + renderInfo: *mut ID2D1RenderInfo, + ) -> HRESULT, + fn Draw( + target: *mut ID2D1Bitmap1, + drawRect: *mut D2D_RECT_L, + targetOrigin: D2D_POINT_2U, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1a799d8a, 0x69f7, 0x4e4c, 0x9f, 0xed, 0x43, 0x7c, 0xcc, 0x66, 0x84, 0xcc)] +interface ID2D1ConcreteTransform(ID2D1ConcreteTransformVtbl): + ID2D1TransformNode(ID2D1TransformNodeVtbl) { + fn SetOutputBuffer( + bufferPrecision: D2D1_BUFFER_PRECISION, + channelDepth: D2D1_CHANNEL_DEPTH, + ) -> HRESULT, + fn SetCached( + isCached: BOOL, + ) -> (), +}} +RIDL!{#[uuid(0x63ac0b32, 0xba44, 0x450f, 0x88, 0x06, 0x7f, 0x4c, 0xa1, 0xff, 0x2f, 0x1b)] +interface ID2D1BlendTransform(ID2D1BlendTransformVtbl): + ID2D1ConcreteTransform(ID2D1ConcreteTransformVtbl) { + fn SetDescription( + description: *const D2D1_BLEND_DESCRIPTION, + ) -> (), + fn GetDescription( + description: *mut D2D1_BLEND_DESCRIPTION, + ) -> (), +}} +RIDL!{#[uuid(0x4998735c, 0x3a19, 0x473c, 0x97, 0x81, 0x65, 0x68, 0x47, 0xe3, 0xa3, 0x47)] +interface ID2D1BorderTransform(ID2D1BorderTransformVtbl): + ID2D1ConcreteTransform(ID2D1ConcreteTransformVtbl) { + fn SetExtendModeX( + extendMode: D2D1_EXTEND_MODE, + ) -> (), + fn SetExtendModeY( + extendMode: D2D1_EXTEND_MODE, + ) -> (), + fn GetExtendModeX() -> D2D1_EXTEND_MODE, + fn GetExtendModeY() -> D2D1_EXTEND_MODE, +}} +RIDL!{#[uuid(0x3fe6adea, 0x7643, 0x4f53, 0xbd, 0x14, 0xa0, 0xce, 0x63, 0xf2, 0x40, 0x42)] +interface ID2D1OffsetTransform(ID2D1OffsetTransformVtbl): + ID2D1TransformNode(ID2D1TransformNodeVtbl) { + fn SetOffset( + offset: D2D_POINT_2L, + ) -> (), + fn GetOffset() -> D2D_POINT_2L, +}} +RIDL!{#[uuid(0x90f732e2, 0x5092, 0x4606, 0xa8, 0x19, 0x86, 0x51, 0x97, 0x0b, 0xac, 0xcd)] +interface ID2D1BoundsAdjustmentTransform(ID2D1BoundsAdjustmentTransformVtbl): + ID2D1TransformNode(ID2D1TransformNodeVtbl) { + fn SetOutputBounds( + outputBounds: *const D2D_RECT_L, + ) -> (), + fn GetOutputBounds( + outputBounds: *mut D2D_RECT_L, + ) -> (), +}} +RIDL!{#[uuid(0xa248fd3f, 0x3e6c, 0x4e63, 0x9f, 0x03, 0x7f, 0x68, 0xec, 0xc9, 0x1d, 0xb9)] +interface ID2D1EffectImpl(ID2D1EffectImplVtbl): IUnknown(IUnknownVtbl) { + fn Initialize( + effectContext: *mut ID2D1EffectContext, + transformGraph: *mut ID2D1TransformGraph, + ) -> HRESULT, + fn PrepareForRender( + changeType: D2D1_CHANGE_TYPE, + ) -> HRESULT, + fn SetGraph( + transformGraph: *mut ID2D1TransformGraph, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3d9f916b, 0x27dc, 0x4ad7, 0xb4, 0xf1, 0x64, 0x94, 0x53, 0x40, 0xf5, 0x63)] +interface ID2D1EffectContext(ID2D1EffectContextVtbl): IUnknown(IUnknownVtbl) { + fn GetDpi( + dpiX: *mut FLOAT, + dpiY: *mut FLOAT, + ) -> (), + fn CreateEffect( + effectId: REFCLSID, + effect: *mut *mut ID2D1Effect, + ) -> HRESULT, + fn GetMaximumSupportedFeatureLevel( + featureLevels: *const D3D_FEATURE_LEVEL, + featureLevelsCount: UINT32, + maximumSupportedFeatureLevel: *mut D3D_FEATURE_LEVEL, + ) -> HRESULT, + fn CreateTransformNodeFromEffect( + effect: *mut ID2D1Effect, + transformNode: *mut *mut ID2D1TransformNode, + ) -> HRESULT, + fn CreateBlendTransform( + numInputs: UINT32, + blendDescription: D2D1_BLEND_DESCRIPTION, + transform: *mut *mut ID2D1BlendTransform, + ) -> HRESULT, + fn CreateBorderTransform( + extendModeX: D2D1_EXTEND_MODE, + extendModeY: D2D1_EXTEND_MODE, + transform: *mut *mut ID2D1BorderTransform, + ) -> HRESULT, + fn CreateOffsetTransform( + offset: D2D_POINT_2L, + transform: *mut *mut ID2D1OffsetTransform, + ) -> HRESULT, + fn CreateBoundsAdjustmentTransform( + outputRectangle: *mut D2D_RECT_L, + transform: ID2D1BoundsAdjustmentTransform, + ) -> HRESULT, + fn LoadPixelShader( + shaderId: REFGUID, + shaderBuffer: *const BYTE, + shaderBufferCount: UINT32, + ) -> HRESULT, + fn LoadVertexShader( + resourceId: REFGUID, + shaderBuffer: *const BYTE, + shaderBufferCount: UINT32, + ) -> HRESULT, + fn LoadComputeShader( + resourceId: REFGUID, + shaderBuffer: *const BYTE, + shaderBufferCount: UINT32, + ) -> HRESULT, + fn IsShaderLoaded( + shaderId: REFGUID, + ) -> BOOL, + fn CreateResourceTexture( + resourceId: *const GUID, + resourceTextureProperties: *const D2D1_RESOURCE_TEXTURE_PROPERTIES, + data: *const BYTE, + strides: *const UINT32, + dataSize: UINT32, + resourceTexture: *mut *mut ID2D1ResourceTexture, + ) -> HRESULT, + fn FindResourceTexture( + resourceId: *const GUID, + resourceTexture: *mut *mut ID2D1ResourceTexture, + ) -> HRESULT, + fn CreateVertexBuffer( + vertexBufferProperties: *const D2D1_VERTEX_BUFFER_PROPERTIES, + resourceId: *const GUID, + customVertexBufferProperties: *const D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES, + buffer: *mut *mut ID2D1VertexBuffer, + ) -> HRESULT, + fn FindVertexBuffer( + resourceId: *const GUID, + buffer: *mut *mut ID2D1VertexBuffer, + ) -> HRESULT, + fn CreateColorContext( + space: D2D1_COLOR_SPACE, + profile: *const BYTE, + profileSize: UINT32, + colorContext: *mut *mut ID2D1ColorContext, + ) -> HRESULT, + fn CreateColorContextFromFilename( + filename: PCWSTR, + colorContext: *mut *mut ID2D1ColorContext, + ) -> HRESULT, + fn CreateColorContextFromWicColorContext( + wicColorContext: *mut IWICColorContext, + colorContext: *mut *mut ID2D1ColorContext, + ) -> HRESULT, + fn CheckFeatureSupport( + feature: D2D1_FEATURE, + featureSupportData: *mut c_void, + featureSupportDataSize: UINT32, + ) -> HRESULT, + fn IsBufferPrecisionSupported( + bufferPrecision: D2D1_BUFFER_PRECISION, + ) -> BOOL, +}} diff --git a/bash-5.1/vendor/winapi/src/um/d2d1effects.rs b/bash-5.1/vendor/winapi/src/um/d2d1effects.rs new file mode 100644 index 0000000000000000000000000000000000000000..c2d1f58a11d800f7997d52f4311c1fbe08dd7d9b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d2d1effects.rs @@ -0,0 +1,617 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of d2d1effects.h +DEFINE_GUID!{CLSID_D2D12DAffineTransform, + 0x6AA97485, 0x6354, 0x4cfc, 0x90, 0x8C, 0xE4, 0xA7, 0x4F, 0x62, 0xC9, 0x6C} +DEFINE_GUID!{CLSID_D2D13DPerspectiveTransform, + 0xC2844D0B, 0x3D86, 0x46e7, 0x85, 0xBA, 0x52, 0x6C, 0x92, 0x40, 0xF3, 0xFB} +DEFINE_GUID!{CLSID_D2D13DTransform, + 0xe8467b04, 0xec61, 0x4b8a, 0xb5, 0xde, 0xd4, 0xd7, 0x3d, 0xeb, 0xea, 0x5a} +DEFINE_GUID!{CLSID_D2D1ArithmeticComposite, + 0xfc151437, 0x049a, 0x4784, 0xa2, 0x4a, 0xf1, 0xc4, 0xda, 0xf2, 0x09, 0x87} +DEFINE_GUID!{CLSID_D2D1Atlas, + 0x913e2be4, 0xfdcf, 0x4fe2, 0xa5, 0xf0, 0x24, 0x54, 0xf1, 0x4f, 0xf4, 0x08} +DEFINE_GUID!{CLSID_D2D1BitmapSource, + 0x5fb6c24d, 0xc6dd, 0x4231, 0x94, 0x4, 0x50, 0xf4, 0xd5, 0xc3, 0x25, 0x2d} +DEFINE_GUID!{CLSID_D2D1Blend, + 0x81c5b77b, 0x13f8, 0x4cdd, 0xad, 0x20, 0xc8, 0x90, 0x54, 0x7a, 0xc6, 0x5d} +DEFINE_GUID!{CLSID_D2D1Border, + 0x2A2D49C0, 0x4ACF, 0x43c7, 0x8C, 0x6A, 0x7C, 0x4A, 0x27, 0x87, 0x4D, 0x27} +DEFINE_GUID!{CLSID_D2D1Brightness, + 0x8cea8d1e, 0x77b0, 0x4986, 0xb3, 0xb9, 0x2f, 0x0c, 0x0e, 0xae, 0x78, 0x87} +DEFINE_GUID!{CLSID_D2D1ColorManagement, + 0x1A28524C, 0xFDD6, 0x4AA4, 0xAE, 0x8F, 0x83, 0x7E, 0xB8, 0x26, 0x7B, 0x37} +DEFINE_GUID!{CLSID_D2D1ColorMatrix, + 0x921F03D6, 0x641C, 0x47DF, 0x85, 0x2D, 0xB4, 0xBB, 0x61, 0x53, 0xAE, 0x11} +DEFINE_GUID!{CLSID_D2D1Composite, + 0x48fc9f51, 0xf6ac, 0x48f1, 0x8b, 0x58, 0x3b, 0x28, 0xac, 0x46, 0xf7, 0x6d} +DEFINE_GUID!{CLSID_D2D1ConvolveMatrix, + 0x407f8c08, 0x5533, 0x4331, 0xa3, 0x41, 0x23, 0xcc, 0x38, 0x77, 0x84, 0x3e} +DEFINE_GUID!{CLSID_D2D1Crop, + 0xE23F7110, 0x0E9A, 0x4324, 0xAF, 0x47, 0x6A, 0x2C, 0x0C, 0x46, 0xF3, 0x5B} +DEFINE_GUID!{CLSID_D2D1DirectionalBlur, + 0x174319a6, 0x58e9, 0x49b2, 0xbb, 0x63, 0xca, 0xf2, 0xc8, 0x11, 0xa3, 0xdb} +DEFINE_GUID!{CLSID_D2D1DiscreteTransfer, + 0x90866fcd, 0x488e, 0x454b, 0xaf, 0x06, 0xe5, 0x04, 0x1b, 0x66, 0xc3, 0x6c} +DEFINE_GUID!{CLSID_D2D1DisplacementMap, + 0xedc48364, 0x417, 0x4111, 0x94, 0x50, 0x43, 0x84, 0x5f, 0xa9, 0xf8, 0x90} +DEFINE_GUID!{CLSID_D2D1DistantDiffuse, + 0x3e7efd62, 0xa32d, 0x46d4, 0xa8, 0x3c, 0x52, 0x78, 0x88, 0x9a, 0xc9, 0x54} +DEFINE_GUID!{CLSID_D2D1DistantSpecular, + 0x428c1ee5, 0x77b8, 0x4450, 0x8a, 0xb5, 0x72, 0x21, 0x9c, 0x21, 0xab, 0xda} +DEFINE_GUID!{CLSID_D2D1DpiCompensation, + 0x6c26c5c7, 0x34e0, 0x46fc, 0x9c, 0xfd, 0xe5, 0x82, 0x37, 0x6, 0xe2, 0x28} +DEFINE_GUID!{CLSID_D2D1Flood, + 0x61c23c20, 0xae69, 0x4d8e, 0x94, 0xcf, 0x50, 0x07, 0x8d, 0xf6, 0x38, 0xf2} +DEFINE_GUID!{CLSID_D2D1GammaTransfer, + 0x409444c4, 0xc419, 0x41a0, 0xb0, 0xc1, 0x8c, 0xd0, 0xc0, 0xa1, 0x8e, 0x42} +DEFINE_GUID!{CLSID_D2D1GaussianBlur, + 0x1feb6d69, 0x2fe6, 0x4ac9, 0x8c, 0x58, 0x1d, 0x7f, 0x93, 0xe7, 0xa6, 0xa5} +DEFINE_GUID!{CLSID_D2D1Scale, + 0x9daf9369, 0x3846, 0x4d0e, 0xa4, 0x4e, 0xc, 0x60, 0x79, 0x34, 0xa5, 0xd7} +DEFINE_GUID!{CLSID_D2D1Histogram, + 0x881db7d0, 0xf7ee, 0x4d4d, 0xa6, 0xd2, 0x46, 0x97, 0xac, 0xc6, 0x6e, 0xe8} +DEFINE_GUID!{CLSID_D2D1HueRotation, + 0x0f4458ec, 0x4b32, 0x491b, 0x9e, 0x85, 0xbd, 0x73, 0xf4, 0x4d, 0x3e, 0xb6} +DEFINE_GUID!{CLSID_D2D1LinearTransfer, + 0xad47c8fd, 0x63ef, 0x4acc, 0x9b, 0x51, 0x67, 0x97, 0x9c, 0x03, 0x6c, 0x06} +DEFINE_GUID!{CLSID_D2D1LuminanceToAlpha, + 0x41251ab7, 0x0beb, 0x46f8, 0x9d, 0xa7, 0x59, 0xe9, 0x3f, 0xcc, 0xe5, 0xde} +DEFINE_GUID!{CLSID_D2D1Morphology, + 0xeae6c40d, 0x626a, 0x4c2d, 0xbf, 0xcb, 0x39, 0x10, 0x01, 0xab, 0xe2, 0x02} +DEFINE_GUID!{CLSID_D2D1OpacityMetadata, + 0x6c53006a, 0x4450, 0x4199, 0xaa, 0x5b, 0xad, 0x16, 0x56, 0xfe, 0xce, 0x5e} +DEFINE_GUID!{CLSID_D2D1PointDiffuse, + 0xb9e303c3, 0xc08c, 0x4f91, 0x8b, 0x7b, 0x38, 0x65, 0x6b, 0xc4, 0x8c, 0x20} +DEFINE_GUID!{CLSID_D2D1PointSpecular, + 0x09c3ca26, 0x3ae2, 0x4f09, 0x9e, 0xbc, 0xed, 0x38, 0x65, 0xd5, 0x3f, 0x22} +DEFINE_GUID!{CLSID_D2D1Premultiply, + 0x06eab419, 0xdeed, 0x4018, 0x80, 0xd2, 0x3e, 0x1d, 0x47, 0x1a, 0xde, 0xb2} +DEFINE_GUID!{CLSID_D2D1Saturation, + 0x5cb2d9cf, 0x327d, 0x459f, 0xa0, 0xce, 0x40, 0xc0, 0xb2, 0x08, 0x6b, 0xf7} +DEFINE_GUID!{CLSID_D2D1Shadow, + 0xC67EA361, 0x1863, 0x4e69, 0x89, 0xDB, 0x69, 0x5D, 0x3E, 0x9A, 0x5B, 0x6B} +DEFINE_GUID!{CLSID_D2D1SpotDiffuse, + 0x818a1105, 0x7932, 0x44f4, 0xaa, 0x86, 0x08, 0xae, 0x7b, 0x2f, 0x2c, 0x93} +DEFINE_GUID!{CLSID_D2D1SpotSpecular, + 0xedae421e, 0x7654, 0x4a37, 0x9d, 0xb8, 0x71, 0xac, 0xc1, 0xbe, 0xb3, 0xc1} +DEFINE_GUID!{CLSID_D2D1TableTransfer, + 0x5bf818c3, 0x5e43, 0x48cb, 0xb6, 0x31, 0x86, 0x83, 0x96, 0xd6, 0xa1, 0xd4} +DEFINE_GUID!{CLSID_D2D1Tile, + 0xB0784138, 0x3B76, 0x4bc5, 0xB1, 0x3B, 0x0F, 0xA2, 0xAD, 0x02, 0x65, 0x9F} +DEFINE_GUID!{CLSID_D2D1Turbulence, + 0xCF2BB6AE, 0x889A, 0x4ad7, 0xBA, 0x29, 0xA2, 0xFD, 0x73, 0x2C, 0x9F, 0xC9} +DEFINE_GUID!{CLSID_D2D1UnPremultiply, + 0xfb9ac489, 0xad8d, 0x41ed, 0x99, 0x99, 0xbb, 0x63, 0x47, 0xd1, 0x10, 0xf7} +ENUM!{enum D2D1_BORDER_MODE { + D2D1_BORDER_MODE_SOFT = 0, + D2D1_BORDER_MODE_HARD = 1, + D2D1_BORDER_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_CHANNEL_SELECTOR { + D2D1_CHANNEL_SELECTOR_R = 0, + D2D1_CHANNEL_SELECTOR_G = 1, + D2D1_CHANNEL_SELECTOR_B = 2, + D2D1_CHANNEL_SELECTOR_A = 3, + D2D1_CHANNEL_SELECTOR_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BITMAPSOURCE_ORIENTATION { + D2D1_BITMAPSOURCE_ORIENTATION_DEFAULT = 1, + D2D1_BITMAPSOURCE_ORIENTATION_FLIP_HORIZONTAL = 2, + D2D1_BITMAPSOURCE_ORIENTATION_ROTATE_CLOCKWISE180 = 3, + D2D1_BITMAPSOURCE_ORIENTATION_ROTATE_CLOCKWISE180_FLIP_HORIZONTAL = 4, + D2D1_BITMAPSOURCE_ORIENTATION_ROTATE_CLOCKWISE270_FLIP_HORIZONTAL = 5, + D2D1_BITMAPSOURCE_ORIENTATION_ROTATE_CLOCKWISE90 = 6, + D2D1_BITMAPSOURCE_ORIENTATION_ROTATE_CLOCKWISE90_FLIP_HORIZONTAL = 7, + D2D1_BITMAPSOURCE_ORIENTATION_ROTATE_CLOCKWISE270 = 8, + D2D1_BITMAPSOURCE_ORIENTATION_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_GAUSSIANBLUR_PROP { + D2D1_GAUSSIANBLUR_PROP_STANDARD_DEVIATION = 0, + D2D1_GAUSSIANBLUR_PROP_OPTIMIZATION = 1, + D2D1_GAUSSIANBLUR_PROP_BORDER_MODE = 2, + D2D1_GAUSSIANBLUR_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_GAUSSIANBLUR_OPTIMIZATION { + D2D1_GAUSSIANBLUR_OPTIMIZATION_SPEED = 0, + D2D1_GAUSSIANBLUR_OPTIMIZATION_BALANCED = 1, + D2D1_GAUSSIANBLUR_OPTIMIZATION_QUALITY = 2, + D2D1_GAUSSIANBLUR_OPTIMIZATION_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DIRECTIONALBLUR_PROP { + D2D1_DIRECTIONALBLUR_PROP_STANDARD_DEVIATION = 0, + D2D1_DIRECTIONALBLUR_PROP_ANGLE = 1, + D2D1_DIRECTIONALBLUR_PROP_OPTIMIZATION = 2, + D2D1_DIRECTIONALBLUR_PROP_BORDER_MODE = 3, + D2D1_DIRECTIONALBLUR_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DIRECTIONALBLUR_OPTIMIZATION { + D2D1_DIRECTIONALBLUR_OPTIMIZATION_SPEED = 0, + D2D1_DIRECTIONALBLUR_OPTIMIZATION_BALANCED = 1, + D2D1_DIRECTIONALBLUR_OPTIMIZATION_QUALITY = 2, + D2D1_DIRECTIONALBLUR_OPTIMIZATION_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_SHADOW_PROP { + D2D1_SHADOW_PROP_BLUR_STANDARD_DEVIATION = 0, + D2D1_SHADOW_PROP_COLOR = 1, + D2D1_SHADOW_PROP_OPTIMIZATION = 2, + D2D1_SHADOW_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_SHADOW_OPTIMIZATION { + D2D1_SHADOW_OPTIMIZATION_SPEED = 0, + D2D1_SHADOW_OPTIMIZATION_BALANCED = 1, + D2D1_SHADOW_OPTIMIZATION_QUALITY = 2, + D2D1_SHADOW_OPTIMIZATION_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BLEND_PROP { + D2D1_BLEND_PROP_MODE = 0, + D2D1_BLEND_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BLEND_MODE { + D2D1_BLEND_MODE_MULTIPLY = 0, + D2D1_BLEND_MODE_SCREEN = 1, + D2D1_BLEND_MODE_DARKEN = 2, + D2D1_BLEND_MODE_LIGHTEN = 3, + D2D1_BLEND_MODE_DISSOLVE = 4, + D2D1_BLEND_MODE_COLOR_BURN = 5, + D2D1_BLEND_MODE_LINEAR_BURN = 6, + D2D1_BLEND_MODE_DARKER_COLOR = 7, + D2D1_BLEND_MODE_LIGHTER_COLOR = 8, + D2D1_BLEND_MODE_COLOR_DODGE = 9, + D2D1_BLEND_MODE_LINEAR_DODGE = 10, + D2D1_BLEND_MODE_OVERLAY = 11, + D2D1_BLEND_MODE_SOFT_LIGHT = 12, + D2D1_BLEND_MODE_HARD_LIGHT = 13, + D2D1_BLEND_MODE_VIVID_LIGHT = 14, + D2D1_BLEND_MODE_LINEAR_LIGHT = 15, + D2D1_BLEND_MODE_PIN_LIGHT = 16, + D2D1_BLEND_MODE_HARD_MIX = 17, + D2D1_BLEND_MODE_DIFFERENCE = 18, + D2D1_BLEND_MODE_EXCLUSION = 19, + D2D1_BLEND_MODE_HUE = 20, + D2D1_BLEND_MODE_SATURATION = 21, + D2D1_BLEND_MODE_COLOR = 22, + D2D1_BLEND_MODE_LUMINOSITY = 23, + D2D1_BLEND_MODE_SUBTRACT = 24, + D2D1_BLEND_MODE_DIVISION = 25, + D2D1_BLEND_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_SATURATION_PROP { + D2D1_SATURATION_PROP_SATURATION = 0, + D2D1_SATURATION_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_HUEROTATION_PROP { + D2D1_HUEROTATION_PROP_ANGLE = 0, + D2D1_HUEROTATION_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_COLORMATRIX_PROP { + D2D1_COLORMATRIX_PROP_COLOR_MATRIX = 0, + D2D1_COLORMATRIX_PROP_ALPHA_MODE = 1, + D2D1_COLORMATRIX_PROP_CLAMP_OUTPUT = 2, + D2D1_COLORMATRIX_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_COLORMATRIX_ALPHA_MODE { + D2D1_COLORMATRIX_ALPHA_MODE_PREMULTIPLIED = 1, + D2D1_COLORMATRIX_ALPHA_MODE_STRAIGHT = 2, + D2D1_COLORMATRIX_ALPHA_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BITMAPSOURCE_PROP { + D2D1_BITMAPSOURCE_PROP_WIC_BITMAP_SOURCE = 0, + D2D1_BITMAPSOURCE_PROP_SCALE = 1, + D2D1_BITMAPSOURCE_PROP_INTERPOLATION_MODE = 2, + D2D1_BITMAPSOURCE_PROP_ENABLE_DPI_CORRECTION = 3, + D2D1_BITMAPSOURCE_PROP_ALPHA_MODE = 4, + D2D1_BITMAPSOURCE_PROP_ORIENTATION = 5, + D2D1_BITMAPSOURCE_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BITMAPSOURCE_INTERPOLATION_MODE { + D2D1_BITMAPSOURCE_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, + D2D1_BITMAPSOURCE_INTERPOLATION_MODE_LINEAR = 1, + D2D1_BITMAPSOURCE_INTERPOLATION_MODE_CUBIC = 2, + D2D1_BITMAPSOURCE_INTERPOLATION_MODE_FANT = 6, + D2D1_BITMAPSOURCE_INTERPOLATION_MODE_MIPMAP_LINEAR = 7, + D2D1_BITMAPSOURCE_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BITMAPSOURCE_ALPHA_MODE { + D2D1_BITMAPSOURCE_ALPHA_MODE_PREMULTIPLIED = 1, + D2D1_BITMAPSOURCE_ALPHA_MODE_STRAIGHT = 2, + D2D1_BITMAPSOURCE_ALPHA_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_COMPOSITE_PROP { + D2D1_COMPOSITE_PROP_MODE = 0, + D2D1_COMPOSITE_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_3DTRANSFORM_PROP { + D2D1_3DTRANSFORM_PROP_INTERPOLATION_MODE = 0, + D2D1_3DTRANSFORM_PROP_BORDER_MODE = 1, + D2D1_3DTRANSFORM_PROP_TRANSFORM_MATRIX = 2, + D2D1_3DTRANSFORM_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_3DTRANSFORM_INTERPOLATION_MODE { + D2D1_3DTRANSFORM_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, + D2D1_3DTRANSFORM_INTERPOLATION_MODE_LINEAR = 1, + D2D1_3DTRANSFORM_INTERPOLATION_MODE_CUBIC = 2, + D2D1_3DTRANSFORM_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_3DTRANSFORM_INTERPOLATION_MODE_ANISOTROPIC = 4, + D2D1_3DTRANSFORM_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_3DPERSPECTIVETRANSFORM_PROP { + D2D1_3DPERSPECTIVETRANSFORM_PROP_INTERPOLATION_MODE = 0, + D2D1_3DPERSPECTIVETRANSFORM_PROP_BORDER_MODE = 1, + D2D1_3DPERSPECTIVETRANSFORM_PROP_DEPTH = 2, + D2D1_3DPERSPECTIVETRANSFORM_PROP_PERSPECTIVE_ORIGIN = 3, + D2D1_3DPERSPECTIVETRANSFORM_PROP_LOCAL_OFFSET = 4, + D2D1_3DPERSPECTIVETRANSFORM_PROP_GLOBAL_OFFSET = 5, + D2D1_3DPERSPECTIVETRANSFORM_PROP_ROTATION_ORIGIN = 6, + D2D1_3DPERSPECTIVETRANSFORM_PROP_ROTATION = 7, + D2D1_3DPERSPECTIVETRANSFORM_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE { + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_LINEAR = 1, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_CUBIC = 2, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_ANISOTROPIC = 4, + D2D1_3DPERSPECTIVETRANSFORM_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_2DAFFINETRANSFORM_PROP { + D2D1_2DAFFINETRANSFORM_PROP_INTERPOLATION_MODE = 0, + D2D1_2DAFFINETRANSFORM_PROP_BORDER_MODE = 1, + D2D1_2DAFFINETRANSFORM_PROP_TRANSFORM_MATRIX = 2, + D2D1_2DAFFINETRANSFORM_PROP_SHARPNESS = 3, + D2D1_2DAFFINETRANSFORM_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE { + D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, + D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_LINEAR = 1, + D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_CUBIC = 2, + D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_ANISOTROPIC = 4, + D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DPICOMPENSATION_PROP { + D2D1_DPICOMPENSATION_PROP_INTERPOLATION_MODE = 0, + D2D1_DPICOMPENSATION_PROP_BORDER_MODE = 1, + D2D1_DPICOMPENSATION_PROP_INPUT_DPI = 2, + D2D1_DPICOMPENSATION_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DPICOMPENSATION_INTERPOLATION_MODE { + D2D1_DPICOMPENSATION_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, + D2D1_DPICOMPENSATION_INTERPOLATION_MODE_LINEAR = 1, + D2D1_DPICOMPENSATION_INTERPOLATION_MODE_CUBIC = 2, + D2D1_DPICOMPENSATION_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_DPICOMPENSATION_INTERPOLATION_MODE_ANISOTROPIC = 4, + D2D1_DPICOMPENSATION_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_DPICOMPENSATION_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_SCALE_PROP { + D2D1_SCALE_PROP_SCALE = 0, + D2D1_SCALE_PROP_CENTER_POINT = 1, + D2D1_SCALE_PROP_INTERPOLATION_MODE = 2, + D2D1_SCALE_PROP_BORDER_MODE = 3, + D2D1_SCALE_PROP_SHARPNESS = 4, + D2D1_SCALE_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_SCALE_INTERPOLATION_MODE { + D2D1_SCALE_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, + D2D1_SCALE_INTERPOLATION_MODE_LINEAR = 1, + D2D1_SCALE_INTERPOLATION_MODE_CUBIC = 2, + D2D1_SCALE_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_SCALE_INTERPOLATION_MODE_ANISOTROPIC = 4, + D2D1_SCALE_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_SCALE_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_TURBULENCE_PROP { + D2D1_TURBULENCE_PROP_OFFSET = 0, + D2D1_TURBULENCE_PROP_SIZE = 1, + D2D1_TURBULENCE_PROP_BASE_FREQUENCY = 2, + D2D1_TURBULENCE_PROP_NUM_OCTAVES = 3, + D2D1_TURBULENCE_PROP_SEED = 4, + D2D1_TURBULENCE_PROP_NOISE = 5, + D2D1_TURBULENCE_PROP_STITCHABLE = 6, + D2D1_TURBULENCE_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_TURBULENCE_NOISE { + D2D1_TURBULENCE_NOISE_FRACTAL_SUM = 0, + D2D1_TURBULENCE_NOISE_TURBULENCE = 1, + D2D1_TURBULENCE_NOISE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DISPLACEMENTMAP_PROP { + D2D1_DISPLACEMENTMAP_PROP_SCALE = 0, + D2D1_DISPLACEMENTMAP_PROP_X_CHANNEL_SELECT = 1, + D2D1_DISPLACEMENTMAP_PROP_Y_CHANNEL_SELECT = 2, + D2D1_DISPLACEMENTMAP_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_COLORMANAGEMENT_PROP { + D2D1_COLORMANAGEMENT_PROP_SOURCE_COLOR_CONTEXT = 0, + D2D1_COLORMANAGEMENT_PROP_SOURCE_RENDERING_INTENT = 1, + D2D1_COLORMANAGEMENT_PROP_DESTINATION_COLOR_CONTEXT = 2, + D2D1_COLORMANAGEMENT_PROP_DESTINATION_RENDERING_INTENT = 3, + D2D1_COLORMANAGEMENT_PROP_ALPHA_MODE = 4, + D2D1_COLORMANAGEMENT_PROP_QUALITY = 5, + D2D1_COLORMANAGEMENT_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_COLORMANAGEMENT_ALPHA_MODE { + D2D1_COLORMANAGEMENT_ALPHA_MODE_PREMULTIPLIED = 1, + D2D1_COLORMANAGEMENT_ALPHA_MODE_STRAIGHT = 2, + D2D1_COLORMANAGEMENT_ALPHA_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_COLORMANAGEMENT_QUALITY { + D2D1_COLORMANAGEMENT_QUALITY_PROOF = 0, + D2D1_COLORMANAGEMENT_QUALITY_NORMAL = 1, + D2D1_COLORMANAGEMENT_QUALITY_BEST = 2, + D2D1_COLORMANAGEMENT_QUALITY_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_COLORMANAGEMENT_RENDERING_INTENT { + D2D1_COLORMANAGEMENT_RENDERING_INTENT_PERCEPTUAL = 0, + D2D1_COLORMANAGEMENT_RENDERING_INTENT_RELATIVE_COLORIMETRIC = 1, + D2D1_COLORMANAGEMENT_RENDERING_INTENT_SATURATION = 2, + D2D1_COLORMANAGEMENT_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 3, + D2D1_COLORMANAGEMENT_RENDERING_INTENT_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_HISTOGRAM_PROP { + D2D1_HISTOGRAM_PROP_NUM_BINS = 0, + D2D1_HISTOGRAM_PROP_CHANNEL_SELECT = 1, + D2D1_HISTOGRAM_PROP_HISTOGRAM_OUTPUT = 2, + D2D1_HISTOGRAM_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_POINTSPECULAR_PROP { + D2D1_POINTSPECULAR_PROP_LIGHT_POSITION = 0, + D2D1_POINTSPECULAR_PROP_SPECULAR_EXPONENT = 1, + D2D1_POINTSPECULAR_PROP_SPECULAR_CONSTANT = 2, + D2D1_POINTSPECULAR_PROP_SURFACE_SCALE = 3, + D2D1_POINTSPECULAR_PROP_COLOR = 4, + D2D1_POINTSPECULAR_PROP_KERNEL_UNIT_LENGTH = 5, + D2D1_POINTSPECULAR_PROP_SCALE_MODE = 6, + D2D1_POINTSPECULAR_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_POINTSPECULAR_SCALE_MODE { + D2D1_POINTSPECULAR_SCALE_MODE_NEAREST_NEIGHBOR = 0, + D2D1_POINTSPECULAR_SCALE_MODE_LINEAR = 1, + D2D1_POINTSPECULAR_SCALE_MODE_CUBIC = 2, + D2D1_POINTSPECULAR_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_POINTSPECULAR_SCALE_MODE_ANISOTROPIC = 4, + D2D1_POINTSPECULAR_SCALE_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_POINTSPECULAR_SCALE_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_SPOTSPECULAR_PROP { + D2D1_SPOTSPECULAR_PROP_LIGHT_POSITION = 0, + D2D1_SPOTSPECULAR_PROP_POINTS_AT = 1, + D2D1_SPOTSPECULAR_PROP_FOCUS = 2, + D2D1_SPOTSPECULAR_PROP_LIMITING_CONE_ANGLE = 3, + D2D1_SPOTSPECULAR_PROP_SPECULAR_EXPONENT = 4, + D2D1_SPOTSPECULAR_PROP_SPECULAR_CONSTANT = 5, + D2D1_SPOTSPECULAR_PROP_SURFACE_SCALE = 6, + D2D1_SPOTSPECULAR_PROP_COLOR = 7, + D2D1_SPOTSPECULAR_PROP_KERNEL_UNIT_LENGTH = 8, + D2D1_SPOTSPECULAR_PROP_SCALE_MODE = 9, + D2D1_SPOTSPECULAR_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_SPOTSPECULAR_SCALE_MODE { + D2D1_SPOTSPECULAR_SCALE_MODE_NEAREST_NEIGHBOR = 0, + D2D1_SPOTSPECULAR_SCALE_MODE_LINEAR = 1, + D2D1_SPOTSPECULAR_SCALE_MODE_CUBIC = 2, + D2D1_SPOTSPECULAR_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_SPOTSPECULAR_SCALE_MODE_ANISOTROPIC = 4, + D2D1_SPOTSPECULAR_SCALE_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_SPOTSPECULAR_SCALE_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DISTANTSPECULAR_PROP { + D2D1_DISTANTSPECULAR_PROP_AZIMUTH = 0, + D2D1_DISTANTSPECULAR_PROP_ELEVATION = 1, + D2D1_DISTANTSPECULAR_PROP_SPECULAR_EXPONENT = 2, + D2D1_DISTANTSPECULAR_PROP_SPECULAR_CONSTANT = 3, + D2D1_DISTANTSPECULAR_PROP_SURFACE_SCALE = 4, + D2D1_DISTANTSPECULAR_PROP_COLOR = 5, + D2D1_DISTANTSPECULAR_PROP_KERNEL_UNIT_LENGTH = 6, + D2D1_DISTANTSPECULAR_PROP_SCALE_MODE = 7, + D2D1_DISTANTSPECULAR_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DISTANTSPECULAR_SCALE_MODE { + D2D1_DISTANTSPECULAR_SCALE_MODE_NEAREST_NEIGHBOR = 0, + D2D1_DISTANTSPECULAR_SCALE_MODE_LINEAR = 1, + D2D1_DISTANTSPECULAR_SCALE_MODE_CUBIC = 2, + D2D1_DISTANTSPECULAR_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_DISTANTSPECULAR_SCALE_MODE_ANISOTROPIC = 4, + D2D1_DISTANTSPECULAR_SCALE_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_DISTANTSPECULAR_SCALE_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_POINTDIFFUSE_PROP { + D2D1_POINTDIFFUSE_PROP_LIGHT_POSITION = 0, + D2D1_POINTDIFFUSE_PROP_DIFFUSE_CONSTANT = 1, + D2D1_POINTDIFFUSE_PROP_SURFACE_SCALE = 2, + D2D1_POINTDIFFUSE_PROP_COLOR = 3, + D2D1_POINTDIFFUSE_PROP_KERNEL_UNIT_LENGTH = 4, + D2D1_POINTDIFFUSE_PROP_SCALE_MODE = 5, + D2D1_POINTDIFFUSE_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_POINTDIFFUSE_SCALE_MODE { + D2D1_POINTDIFFUSE_SCALE_MODE_NEAREST_NEIGHBOR = 0, + D2D1_POINTDIFFUSE_SCALE_MODE_LINEAR = 1, + D2D1_POINTDIFFUSE_SCALE_MODE_CUBIC = 2, + D2D1_POINTDIFFUSE_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_POINTDIFFUSE_SCALE_MODE_ANISOTROPIC = 4, + D2D1_POINTDIFFUSE_SCALE_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_POINTDIFFUSE_SCALE_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_SPOTDIFFUSE_PROP { + D2D1_SPOTDIFFUSE_PROP_LIGHT_POSITION = 0, + D2D1_SPOTDIFFUSE_PROP_POINTS_AT = 1, + D2D1_SPOTDIFFUSE_PROP_FOCUS = 2, + D2D1_SPOTDIFFUSE_PROP_LIMITING_CONE_ANGLE = 3, + D2D1_SPOTDIFFUSE_PROP_DIFFUSE_CONSTANT = 4, + D2D1_SPOTDIFFUSE_PROP_SURFACE_SCALE = 5, + D2D1_SPOTDIFFUSE_PROP_COLOR = 6, + D2D1_SPOTDIFFUSE_PROP_KERNEL_UNIT_LENGTH = 7, + D2D1_SPOTDIFFUSE_PROP_SCALE_MODE = 8, + D2D1_SPOTDIFFUSE_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_SPOTDIFFUSE_SCALE_MODE { + D2D1_SPOTDIFFUSE_SCALE_MODE_NEAREST_NEIGHBOR = 0, + D2D1_SPOTDIFFUSE_SCALE_MODE_LINEAR = 1, + D2D1_SPOTDIFFUSE_SCALE_MODE_CUBIC = 2, + D2D1_SPOTDIFFUSE_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_SPOTDIFFUSE_SCALE_MODE_ANISOTROPIC = 4, + D2D1_SPOTDIFFUSE_SCALE_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_SPOTDIFFUSE_SCALE_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DISTANTDIFFUSE_PROP { + D2D1_DISTANTDIFFUSE_PROP_AZIMUTH = 0, + D2D1_DISTANTDIFFUSE_PROP_ELEVATION = 1, + D2D1_DISTANTDIFFUSE_PROP_DIFFUSE_CONSTANT = 2, + D2D1_DISTANTDIFFUSE_PROP_SURFACE_SCALE = 3, + D2D1_DISTANTDIFFUSE_PROP_COLOR = 4, + D2D1_DISTANTDIFFUSE_PROP_KERNEL_UNIT_LENGTH = 5, + D2D1_DISTANTDIFFUSE_PROP_SCALE_MODE = 6, + D2D1_DISTANTDIFFUSE_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DISTANTDIFFUSE_SCALE_MODE { + D2D1_DISTANTDIFFUSE_SCALE_MODE_NEAREST_NEIGHBOR = 0, + D2D1_DISTANTDIFFUSE_SCALE_MODE_LINEAR = 1, + D2D1_DISTANTDIFFUSE_SCALE_MODE_CUBIC = 2, + D2D1_DISTANTDIFFUSE_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_DISTANTDIFFUSE_SCALE_MODE_ANISOTROPIC = 4, + D2D1_DISTANTDIFFUSE_SCALE_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_DISTANTDIFFUSE_SCALE_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_FLOOD_PROP { + D2D1_FLOOD_PROP_COLOR = 0, + D2D1_FLOOD_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_LINEARTRANSFER_PROP { + D2D1_LINEARTRANSFER_PROP_RED_Y_INTERCEPT = 0, + D2D1_LINEARTRANSFER_PROP_RED_SLOPE = 1, + D2D1_LINEARTRANSFER_PROP_RED_DISABLE = 2, + D2D1_LINEARTRANSFER_PROP_GREEN_Y_INTERCEPT = 3, + D2D1_LINEARTRANSFER_PROP_GREEN_SLOPE = 4, + D2D1_LINEARTRANSFER_PROP_GREEN_DISABLE = 5, + D2D1_LINEARTRANSFER_PROP_BLUE_Y_INTERCEPT = 6, + D2D1_LINEARTRANSFER_PROP_BLUE_SLOPE = 7, + D2D1_LINEARTRANSFER_PROP_BLUE_DISABLE = 8, + D2D1_LINEARTRANSFER_PROP_ALPHA_Y_INTERCEPT = 9, + D2D1_LINEARTRANSFER_PROP_ALPHA_SLOPE = 10, + D2D1_LINEARTRANSFER_PROP_ALPHA_DISABLE = 11, + D2D1_LINEARTRANSFER_PROP_CLAMP_OUTPUT = 12, + D2D1_LINEARTRANSFER_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_GAMMATRANSFER_PROP { + D2D1_GAMMATRANSFER_PROP_RED_AMPLITUDE = 0, + D2D1_GAMMATRANSFER_PROP_RED_EXPONENT = 1, + D2D1_GAMMATRANSFER_PROP_RED_OFFSET = 2, + D2D1_GAMMATRANSFER_PROP_RED_DISABLE = 3, + D2D1_GAMMATRANSFER_PROP_GREEN_AMPLITUDE = 4, + D2D1_GAMMATRANSFER_PROP_GREEN_EXPONENT = 5, + D2D1_GAMMATRANSFER_PROP_GREEN_OFFSET = 6, + D2D1_GAMMATRANSFER_PROP_GREEN_DISABLE = 7, + D2D1_GAMMATRANSFER_PROP_BLUE_AMPLITUDE = 8, + D2D1_GAMMATRANSFER_PROP_BLUE_EXPONENT = 9, + D2D1_GAMMATRANSFER_PROP_BLUE_OFFSET = 10, + D2D1_GAMMATRANSFER_PROP_BLUE_DISABLE = 11, + D2D1_GAMMATRANSFER_PROP_ALPHA_AMPLITUDE = 12, + D2D1_GAMMATRANSFER_PROP_ALPHA_EXPONENT = 13, + D2D1_GAMMATRANSFER_PROP_ALPHA_OFFSET = 14, + D2D1_GAMMATRANSFER_PROP_ALPHA_DISABLE = 15, + D2D1_GAMMATRANSFER_PROP_CLAMP_OUTPUT = 16, + D2D1_GAMMATRANSFER_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_TABLETRANSFER_PROP { + D2D1_TABLETRANSFER_PROP_RED_TABLE = 0, + D2D1_TABLETRANSFER_PROP_RED_DISABLE = 1, + D2D1_TABLETRANSFER_PROP_GREEN_TABLE = 2, + D2D1_TABLETRANSFER_PROP_GREEN_DISABLE = 3, + D2D1_TABLETRANSFER_PROP_BLUE_TABLE = 4, + D2D1_TABLETRANSFER_PROP_BLUE_DISABLE = 5, + D2D1_TABLETRANSFER_PROP_ALPHA_TABLE = 6, + D2D1_TABLETRANSFER_PROP_ALPHA_DISABLE = 7, + D2D1_TABLETRANSFER_PROP_CLAMP_OUTPUT = 8, + D2D1_TABLETRANSFER_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_DISCRETETRANSFER_PROP { + D2D1_DISCRETETRANSFER_PROP_RED_TABLE = 0, + D2D1_DISCRETETRANSFER_PROP_RED_DISABLE = 1, + D2D1_DISCRETETRANSFER_PROP_GREEN_TABLE = 2, + D2D1_DISCRETETRANSFER_PROP_GREEN_DISABLE = 3, + D2D1_DISCRETETRANSFER_PROP_BLUE_TABLE = 4, + D2D1_DISCRETETRANSFER_PROP_BLUE_DISABLE = 5, + D2D1_DISCRETETRANSFER_PROP_ALPHA_TABLE = 6, + D2D1_DISCRETETRANSFER_PROP_ALPHA_DISABLE = 7, + D2D1_DISCRETETRANSFER_PROP_CLAMP_OUTPUT = 8, + D2D1_DISCRETETRANSFER_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_CONVOLVEMATRIX_PROP { + D2D1_CONVOLVEMATRIX_PROP_KERNEL_UNIT_LENGTH = 0, + D2D1_CONVOLVEMATRIX_PROP_SCALE_MODE = 1, + D2D1_CONVOLVEMATRIX_PROP_KERNEL_SIZE_X = 2, + D2D1_CONVOLVEMATRIX_PROP_KERNEL_SIZE_Y = 3, + D2D1_CONVOLVEMATRIX_PROP_KERNEL_MATRIX = 4, + D2D1_CONVOLVEMATRIX_PROP_DIVISOR = 5, + D2D1_CONVOLVEMATRIX_PROP_BIAS = 6, + D2D1_CONVOLVEMATRIX_PROP_KERNEL_OFFSET = 7, + D2D1_CONVOLVEMATRIX_PROP_PRESERVE_ALPHA = 8, + D2D1_CONVOLVEMATRIX_PROP_BORDER_MODE = 9, + D2D1_CONVOLVEMATRIX_PROP_CLAMP_OUTPUT = 10, + D2D1_CONVOLVEMATRIX_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_CONVOLVEMATRIX_SCALE_MODE { + D2D1_CONVOLVEMATRIX_SCALE_MODE_NEAREST_NEIGHBOR = 0, + D2D1_CONVOLVEMATRIX_SCALE_MODE_LINEAR = 1, + D2D1_CONVOLVEMATRIX_SCALE_MODE_CUBIC = 2, + D2D1_CONVOLVEMATRIX_SCALE_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_CONVOLVEMATRIX_SCALE_MODE_ANISOTROPIC = 4, + D2D1_CONVOLVEMATRIX_SCALE_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_CONVOLVEMATRIX_SCALE_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BRIGHTNESS_PROP { + D2D1_BRIGHTNESS_PROP_WHITE_POINT = 0, + D2D1_BRIGHTNESS_PROP_BLACK_POINT = 1, + D2D1_BRIGHTNESS_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_ARITHMETICCOMPOSITE_PROP { + D2D1_ARITHMETICCOMPOSITE_PROP_COEFFICIENTS = 0, + D2D1_ARITHMETICCOMPOSITE_PROP_CLAMP_OUTPUT = 1, + D2D1_ARITHMETICCOMPOSITE_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_CROP_PROP { + D2D1_CROP_PROP_RECT = 0, + D2D1_CROP_PROP_BORDER_MODE = 1, + D2D1_CROP_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BORDER_PROP { + D2D1_BORDER_PROP_EDGE_MODE_X = 0, + D2D1_BORDER_PROP_EDGE_MODE_Y = 1, + D2D1_BORDER_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_BORDER_EDGE_MODE { + D2D1_BORDER_EDGE_MODE_CLAMP = 0, + D2D1_BORDER_EDGE_MODE_WRAP = 1, + D2D1_BORDER_EDGE_MODE_MIRROR = 2, + D2D1_BORDER_EDGE_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_MORPHOLOGY_PROP { + D2D1_MORPHOLOGY_PROP_MODE = 0, + D2D1_MORPHOLOGY_PROP_WIDTH = 1, + D2D1_MORPHOLOGY_PROP_HEIGHT = 2, + D2D1_MORPHOLOGY_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_MORPHOLOGY_MODE { + D2D1_MORPHOLOGY_MODE_ERODE = 0, + D2D1_MORPHOLOGY_MODE_DILATE = 1, + D2D1_MORPHOLOGY_MODE_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_TILE_PROP { + D2D1_TILE_PROP_RECT = 0, + D2D1_TILE_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_ATLAS_PROP { + D2D1_ATLAS_PROP_INPUT_RECT = 0, + D2D1_ATLAS_PROP_INPUT_PADDING_RECT = 1, + D2D1_ATLAS_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_OPACITYMETADATA_PROP { + D2D1_OPACITYMETADATA_PROP_INPUT_OPAQUE_RECT = 0, + D2D1_OPACITYMETADATA_PROP_FORCE_DWORD = 0xffffffff, +}} diff --git a/bash-5.1/vendor/winapi/src/um/d2d1effects_1.rs b/bash-5.1/vendor/winapi/src/um/d2d1effects_1.rs new file mode 100644 index 0000000000000000000000000000000000000000..ba97f01497c51ff6333be3384c41ee81f98e008a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d2d1effects_1.rs @@ -0,0 +1,31 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// Mappings for the contents of d2d1effects_1.h +DEFINE_GUID!{CLSID_D2D1YCbCr, + 0x99503cc1, 0x66c7, 0x45c9, 0xa8, 0x75, 0x8a, 0xd8, 0xa7, 0x91, 0x44, 0x01} +ENUM!{enum D2D1_YCBCR_PROP { + D2D1_YCBCR_PROP_CHROMA_SUBSAMPLING = 0, + D2D1_YCBCR_PROP_TRANSFORM_MATRIX = 1, + D2D1_YCBCR_PROP_INTERPOLATION_MODE = 2, + D2D1_YCBCR_PROP_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_YCBCR_CHROMA_SUBSAMPLING { + D2D1_YCBCR_CHROMA_SUBSAMPLING_AUTO = 0, + D2D1_YCBCR_CHROMA_SUBSAMPLING_420 = 1, + D2D1_YCBCR_CHROMA_SUBSAMPLING_422 = 2, + D2D1_YCBCR_CHROMA_SUBSAMPLING_444 = 3, + D2D1_YCBCR_CHROMA_SUBSAMPLING_440 = 4, + D2D1_YCBCR_CHROMA_SUBSAMPLING_FORCE_DWORD = 0xffffffff, +}} +ENUM!{enum D2D1_YCBCR_INTERPOLATION_MODE { + D2D1_YCBCR_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, + D2D1_YCBCR_INTERPOLATION_MODE_LINEAR = 1, + D2D1_YCBCR_INTERPOLATION_MODE_CUBIC = 2, + D2D1_YCBCR_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3, + D2D1_YCBCR_INTERPOLATION_MODE_ANISOTROPIC = 4, + D2D1_YCBCR_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 5, + D2D1_YCBCR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, +}} diff --git a/bash-5.1/vendor/winapi/src/um/d2d1effects_2.rs b/bash-5.1/vendor/winapi/src/um/d2d1effects_2.rs new file mode 100644 index 0000000000000000000000000000000000000000..40eea83a271d829547123610222c5ad4ebb66677 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d2d1effects_2.rs @@ -0,0 +1,40 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of d2d1effects_2.h +DEFINE_GUID!{CLSID_D2D1Contrast, + 0xb648a78a, 0x0ed5, 0x4f80, 0xa9, 0x4a, 0x8e, 0x82, 0x5a, 0xca, 0x6b, 0x77} +DEFINE_GUID!{CLSID_D2D1RgbToHue, + 0x23f3e5ec, 0x91e8, 0x4d3d, 0xad, 0x0a, 0xaf, 0xad, 0xc1, 0x00, 0x4a, 0xa1} +DEFINE_GUID!{CLSID_D2D1HueToRgb, + 0x7b78a6bd, 0x0141, 0x4def, 0x8a, 0x52, 0x63, 0x56, 0xee, 0x0c, 0xbd, 0xd5} +DEFINE_GUID!{CLSID_D2D1ChromaKey, + 0x74c01f5b, 0x2a0d, 0x408c, 0x88, 0xe2, 0xc7, 0xa3, 0xc7, 0x19, 0x77, 0x42} +DEFINE_GUID!{CLSID_D2D1Emboss, + 0xb1c5eb2b, 0x0348, 0x43f0, 0x81, 0x07, 0x49, 0x57, 0xca, 0xcb, 0xa2, 0xae} +DEFINE_GUID!{CLSID_D2D1Exposure, + 0xb56c8cfa, 0xf634, 0x41ee, 0xbe, 0xe0, 0xff, 0xa6, 0x17, 0x10, 0x60, 0x04} +DEFINE_GUID!{CLSID_D2D1Grayscale, + 0x36dde0eb, 0x3725, 0x42e0, 0x83, 0x6d, 0x52, 0xfb, 0x20, 0xae, 0xe6, 0x44} +DEFINE_GUID!{CLSID_D2D1Invert, + 0xe0c3784d, 0xcb39, 0x4e84, 0xb6, 0xfd, 0x6b, 0x72, 0xf0, 0x81, 0x02, 0x63} +DEFINE_GUID!{CLSID_D2D1Posterize, + 0x2188945e, 0x33a3, 0x4366, 0xb7, 0xbc, 0x08, 0x6b, 0xd0, 0x2d, 0x08, 0x84} +DEFINE_GUID!{CLSID_D2D1Sepia, + 0x3a1af410, 0x5f1d, 0x4dbe, 0x84, 0xdf, 0x91, 0x5d, 0xa7, 0x9b, 0x71, 0x53} +DEFINE_GUID!{CLSID_D2D1Sharpen, + 0xc9b887cb, 0xc5ff, 0x4dc5, 0x97, 0x79, 0x27, 0x3d, 0xcf, 0x41, 0x7c, 0x7d} +DEFINE_GUID!{CLSID_D2D1Straighten, + 0x4da47b12, 0x79a3, 0x4fb0, 0x82, 0x37, 0xbb, 0xc3, 0xb2, 0xa4, 0xde, 0x08} +DEFINE_GUID!{CLSID_D2D1TemperatureTint, + 0x89176087, 0x8af9, 0x4a08, 0xae, 0xb1, 0x89, 0x5f, 0x38, 0xdb, 0x17, 0x66} +DEFINE_GUID!{CLSID_D2D1Vignette, + 0xc00c40be, 0x5e67, 0x4ca3, 0x95, 0xb4, 0xf4, 0xb0, 0x2c, 0x11, 0x51, 0x35} +DEFINE_GUID!{CLSID_D2D1EdgeDetection, + 0xeff583ca, 0xcb07, 0x4aa9, 0xac, 0x5d, 0x2c, 0xc4, 0x4c, 0x76, 0x46, 0x0f} +DEFINE_GUID!{CLSID_D2D1HighlightsShadows, + 0xcadc8384, 0x323f, 0x4c7e, 0xa3, 0x61, 0x2e, 0x2b, 0x24, 0xdf, 0x6e, 0xe4} +DEFINE_GUID!{CLSID_D2D1LookupTable3D, + 0x349e0eda, 0x0088, 0x4a79, 0x9c, 0xa3, 0xc7, 0xe3, 0x00, 0x20, 0x20, 0x20} diff --git a/bash-5.1/vendor/winapi/src/um/d2d1svg.rs b/bash-5.1/vendor/winapi/src/um/d2d1svg.rs new file mode 100644 index 0000000000000000000000000000000000000000..33e133ebe43ffef71a0e155f99361cd04a077950 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d2d1svg.rs @@ -0,0 +1,411 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of d2d1svg.h +use ctypes::c_void; +use shared::basetsd::UINT32; +use shared::guiddef::REFIID; +use shared::minwindef::{BOOL, FLOAT}; +use shared::ntdef::{PCWSTR, PWSTR, WCHAR}; +use shared::winerror::HRESULT; +use um::d2d1::{ + D2D1_CAP_STYLE_FLAT, D2D1_CAP_STYLE_ROUND, D2D1_CAP_STYLE_SQUARE, D2D1_COLOR_F, D2D1_FILL_MODE, + D2D1_LINE_JOIN_BEVEL, D2D1_LINE_JOIN_MITER_OR_BEVEL, D2D1_LINE_JOIN_ROUND, D2D1_POINT_2F, + D2D1_SIZE_F, ID2D1Resource, ID2D1ResourceVtbl +}; +use um::d2d1_1::ID2D1PathGeometry1; +use um::objidlbase::IStream; +ENUM!{enum D2D1_SVG_PAINT_TYPE { + D2D1_SVG_PAINT_TYPE_NONE = 0, + D2D1_SVG_PAINT_TYPE_COLOR = 1, + D2D1_SVG_PAINT_TYPE_CURRENT_COLOR = 2, + D2D1_SVG_PAINT_TYPE_URI = 3, + D2D1_SVG_PAINT_TYPE_URI_NONE = 4, + D2D1_SVG_PAINT_TYPE_URI_COLOR = 5, + D2D1_SVG_PAINT_TYPE_URI_CURRENT_COLOR = 6, +}} +ENUM!{enum D2D1_SVG_LENGTH_UNITS { + D2D1_SVG_LENGTH_UNITS_NUMBER = 0, + D2D1_SVG_LENGTH_UNITS_PERCENTAGE = 1, +}} +ENUM!{enum D2D1_SVG_DISPLAY { + D2D1_SVG_DISPLAY_INLINE = 0, + D2D1_SVG_DISPLAY_NONE = 1, +}} +ENUM!{enum D2D1_SVG_VISIBILITY { + D2D1_SVG_VISIBILITY_VISIBLE = 0, + D2D1_SVG_VISIBILITY_HIDDEN = 1, +}} +ENUM!{enum D2D1_SVG_OVERFLOW { + D2D1_SVG_OVERFLOW_VISIBLE = 0, + D2D1_SVG_OVERFLOW_HIDDEN = 1, +}} +ENUM!{enum D2D1_SVG_LINE_CAP { + D2D1_SVG_LINE_CAP_BUTT = D2D1_CAP_STYLE_FLAT, + D2D1_SVG_LINE_CAP_SQUARE = D2D1_CAP_STYLE_SQUARE, + D2D1_SVG_LINE_CAP_ROUND = D2D1_CAP_STYLE_ROUND, +}} +ENUM!{enum D2D1_SVG_LINE_JOIN { + D2D1_SVG_LINE_JOIN_BEVEL = D2D1_LINE_JOIN_BEVEL, + D2D1_SVG_LINE_JOIN_MITER = D2D1_LINE_JOIN_MITER_OR_BEVEL, + D2D1_SVG_LINE_JOIN_ROUND = D2D1_LINE_JOIN_ROUND, +}} +ENUM!{enum D2D1_SVG_ASPECT_ALIGN { + D2D1_SVG_ASPECT_ALIGN_NONE = 0, + D2D1_SVG_ASPECT_ALIGN_X_MIN_Y_MIN = 1, + D2D1_SVG_ASPECT_ALIGN_X_MID_Y_MIN = 2, + D2D1_SVG_ASPECT_ALIGN_X_MAX_Y_MIN = 3, + D2D1_SVG_ASPECT_ALIGN_X_MIN_Y_MID = 4, + D2D1_SVG_ASPECT_ALIGN_X_MID_Y_MID = 5, + D2D1_SVG_ASPECT_ALIGN_X_MAX_Y_MID = 6, + D2D1_SVG_ASPECT_ALIGN_X_MIN_Y_MAX = 7, + D2D1_SVG_ASPECT_ALIGN_X_MID_Y_MAX = 8, + D2D1_SVG_ASPECT_ALIGN_X_MAX_Y_MAX = 9, +}} +ENUM!{enum D2D1_SVG_ASPECT_SCALING { + D2D1_SVG_ASPECT_SCALING_MEET = 0, + D2D1_SVG_ASPECT_SCALING_SLICE = 1, +}} +ENUM!{enum D2D1_SVG_PATH_COMMAND { + D2D1_SVG_PATH_COMMAND_CLOSE_PATH = 0, + D2D1_SVG_PATH_COMMAND_MOVE_ABSOLUTE = 1, + D2D1_SVG_PATH_COMMAND_MOVE_RELATIVE = 2, + D2D1_SVG_PATH_COMMAND_LINE_ABSOLUTE = 3, + D2D1_SVG_PATH_COMMAND_LINE_RELATIVE = 4, + D2D1_SVG_PATH_COMMAND_CUBIC_ABSOLUTE = 5, + D2D1_SVG_PATH_COMMAND_CUBIC_RELATIVE = 6, + D2D1_SVG_PATH_COMMAND_QUADRADIC_ABSOLUTE = 7, + D2D1_SVG_PATH_COMMAND_QUADRADIC_RELATIVE = 8, + D2D1_SVG_PATH_COMMAND_ARC_ABSOLUTE = 9, + D2D1_SVG_PATH_COMMAND_ARC_RELATIVE = 10, + D2D1_SVG_PATH_COMMAND_HORIZONTAL_ABSOLUTE = 11, + D2D1_SVG_PATH_COMMAND_HORIZONTAL_RELATIVE = 12, + D2D1_SVG_PATH_COMMAND_VERTICAL_ABSOLUTE = 13, + D2D1_SVG_PATH_COMMAND_VERTICAL_RELATIVE = 14, + D2D1_SVG_PATH_COMMAND_CUBIC_SMOOTH_ABSOLUTE = 15, + D2D1_SVG_PATH_COMMAND_CUBIC_SMOOTH_RELATIVE = 16, + D2D1_SVG_PATH_COMMAND_QUADRADIC_SMOOTH_ABSOLUTE = 17, + D2D1_SVG_PATH_COMMAND_QUADRADIC_SMOOTH_RELATIVE = 18, +}} +ENUM!{enum D2D1_SVG_UNIT_TYPE { + D2D1_SVG_UNIT_TYPE_USER_SPACE_ON_USE = 0, + D2D1_SVG_UNIT_TYPE_OBJECT_BOUNDING_BOX = 1, +}} +ENUM!{enum D2D1_SVG_ATTRIBUTE_STRING_TYPE { + D2D1_SVG_ATTRIBUTE_STRING_TYPE_SVG = 0, + D2D1_SVG_ATTRIBUTE_STRING_TYPE_ID = 1, +}} +ENUM!{enum D2D1_SVG_ATTRIBUTE_POD_TYPE { + D2D1_SVG_ATTRIBUTE_POD_TYPE_FLOAT = 0, + D2D1_SVG_ATTRIBUTE_POD_TYPE_COLOR = 1, + D2D1_SVG_ATTRIBUTE_POD_TYPE_FILL_MODE = 2, + D2D1_SVG_ATTRIBUTE_POD_TYPE_DISPLAY = 3, + D2D1_SVG_ATTRIBUTE_POD_TYPE_OVERFLOW = 4, + D2D1_SVG_ATTRIBUTE_POD_TYPE_LINE_CAP = 5, + D2D1_SVG_ATTRIBUTE_POD_TYPE_LINE_JOIN = 6, + D2D1_SVG_ATTRIBUTE_POD_TYPE_VISIBILITY = 7, + D2D1_SVG_ATTRIBUTE_POD_TYPE_MATRIX = 8, + D2D1_SVG_ATTRIBUTE_POD_TYPE_UNIT_TYPE = 9, + D2D1_SVG_ATTRIBUTE_POD_TYPE_EXTEND_MODE = 10, + D2D1_SVG_ATTRIBUTE_POD_TYPE_PRESERVE_ASPECT_RATIO = 11, + D2D1_SVG_ATTRIBUTE_POD_TYPE_VIEWBOX = 12, + D2D1_SVG_ATTRIBUTE_POD_TYPE_LENGTH = 13, +}} +STRUCT!{struct D2D1_SVG_LENGTH { + value: FLOAT, + units: D2D1_SVG_LENGTH_UNITS, +}} +STRUCT!{struct D2D1_SVG_PRESERVE_ASPECT_RATIO { + defer: BOOL, + align: D2D1_SVG_ASPECT_ALIGN, + meetOrSlice: D2D1_SVG_ASPECT_SCALING, +}} +STRUCT!{struct D2D1_SVG_VIEWBOX { + x: FLOAT, + y: FLOAT, + width: FLOAT, + height: FLOAT, +}} +DEFINE_GUID!{IID_ID2D1SvgAttribute, + 0xc9cdb0dd, 0xf8c9, 0x4e70, 0xb7, 0xc2, 0x30, 0x1c, 0x80, 0x29, 0x2c, 0x5e} +DEFINE_GUID!{IID_ID2D1SvgPaint, + 0xd59bab0a, 0x68a2, 0x455b, 0xa5, 0xdc, 0x9e, 0xb2, 0x85, 0x4e, 0x24, 0x90} +DEFINE_GUID!{IID_ID2D1SvgStrokeDashArray, + 0xf1c0ca52, 0x92a3, 0x4f00, 0xb4, 0xce, 0xf3, 0x56, 0x91, 0xef, 0xd9, 0xd9} +DEFINE_GUID!{IID_ID2D1SvgPointCollection, + 0x9dbe4c0d, 0x3572, 0x4dd9, 0x98, 0x25, 0x55, 0x30, 0x81, 0x3b, 0xb7, 0x12} +DEFINE_GUID!{IID_ID2D1SvgPathData, + 0xc095e4f4, 0xbb98, 0x43d6, 0x97, 0x45, 0x4d, 0x1b, 0x84, 0xec, 0x98, 0x88} +DEFINE_GUID!{IID_ID2D1SvgElement, + 0xac7b67a6, 0x183e, 0x49c1, 0xa8, 0x23, 0x0e, 0xbe, 0x40, 0xb0, 0xdb, 0x29} +DEFINE_GUID!{IID_ID2D1SvgDocument, + 0x86b88e4d, 0xafa4, 0x4d7b, 0x88, 0xe4, 0x68, 0xa5, 0x1c, 0x4a, 0x0a, 0xec} +RIDL!{#[uuid(0xc9cdb0dd, 0xf8c9, 0x4e70, 0xb7, 0xc2, 0x30, 0x1c, 0x80, 0x29, 0x2c, 0x5e)] +interface ID2D1SvgAttribute(ID2D1SvgAttributeVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn GetElement( + element: *mut *mut ID2D1SvgElement, + ) -> (), + fn Clone( + attribute: *mut *mut ID2D1SvgAttribute, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd59bab0a, 0x68a2, 0x455b, 0xa5, 0xdc, 0x9e, 0xb2, 0x85, 0x4e, 0x24, 0x90)] +interface ID2D1SvgPaint(ID2D1SvgPaintVtbl): ID2D1SvgAttribute(ID2D1SvgAttributeVtbl) { + fn SetPaintType( + paintType: D2D1_SVG_PAINT_TYPE, + ) -> HRESULT, + fn GetPaintType() -> D2D1_SVG_PAINT_TYPE, + fn SetColor( + color: D2D1_COLOR_F, + ) -> HRESULT, + fn GetColor( + color: *mut D2D1_COLOR_F, + ) -> (), + fn SetId( + id: PCWSTR, + ) -> HRESULT, + fn GetId( + id: PWSTR, + idCount: UINT32, + ) -> HRESULT, + fn GetIdLength() -> UINT32, +}} +RIDL!{#[uuid(0xf1c0ca52, 0x92a3, 0x4f00, 0xb4, 0xce, 0xf3, 0x56, 0x91, 0xef, 0xd9, 0xd9)] +interface ID2D1SvgStrokeDashArray(ID2D1SvgStrokeDashArrayVtbl): + ID2D1SvgAttribute(ID2D1SvgAttributeVtbl) { + fn RemoveDashesAtEnd( + dashesCount: UINT32, + ) -> HRESULT, + fn UpdateDashes_1( + dashes: *const D2D1_SVG_LENGTH, + dashesCount: UINT32, + startIndex: UINT32, + ) -> HRESULT, + fn UpdateDashes_2( + dashes: *const FLOAT, + dashesCount: UINT32, + startIndex: UINT32, + ) -> HRESULT, + fn GetDashes_1( + dashes: *mut D2D1_SVG_LENGTH, + dashesCount: UINT32, + startIndex: UINT32, + ) -> HRESULT, + fn GetDashes_2( + dashes: *mut FLOAT, + dashesCount: UINT32, + startIndex: UINT32, + ) -> HRESULT, + fn GetDashesCount() -> UINT32, +}} +RIDL!{#[uuid(0x9dbe4c0d, 0x3572, 0x4dd9, 0x98, 0x25, 0x55, 0x30, 0x81, 0x3b, 0xb7, 0x12)] +interface ID2D1SvgPointCollection(ID2D1SvgPointCollectionVtbl): + ID2D1SvgAttribute(ID2D1SvgAttributeVtbl) { + fn RemovePointsAtEnd( + pointsCount: UINT32, + ) -> HRESULT, + fn UpdatePoints( + points: *const D2D1_POINT_2F, + pointsCount: UINT32, + startIndex: UINT32, + ) -> HRESULT, + fn GetPoints( + points: *mut D2D1_POINT_2F, + pointsCount: UINT32, + startIndex: UINT32, + ) -> HRESULT, + fn GetPointsCount() -> UINT32, +}} +RIDL!{#[uuid(0xc095e4f4, 0xbb98, 0x43d6, 0x97, 0x45, 0x4d, 0x1b, 0x84, 0xec, 0x98, 0x88)] +interface ID2D1SvgPathData(ID2D1SvgPathDataVtbl): ID2D1SvgAttribute(ID2D1SvgAttributeVtbl) { + fn RemoveSegmentDataAtEnd( + dataCount: UINT32, + ) -> HRESULT, + fn UpdateSegmentData( + data: *const FLOAT, + dataCount: UINT32, + startIndex: UINT32, + ) -> HRESULT, + fn GetSegmentData( + data: *mut FLOAT, + dataCount: UINT32, + startIndex: UINT32, + ) -> HRESULT, + fn GetSegmentDataCount() -> UINT32, + fn RemoveCommandsAtEnd( + commandsCount: UINT32, + ) -> HRESULT, + fn UpdateCommands( + commands: *const D2D1_SVG_PATH_COMMAND, + commandsCount: UINT32, + startIndex: UINT32, + ) -> HRESULT, + fn GetCommands( + commands: *mut D2D1_SVG_PATH_COMMAND, + commandsCount: UINT32, + startIndex: UINT32, + ) -> HRESULT, + fn GetCommandsCount() -> UINT32, + fn CreatePathGeometry( + fillMode: D2D1_FILL_MODE, + pathGeometry: *mut *mut ID2D1PathGeometry1, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xac7b67a6, 0x183e, 0x49c1, 0xa8, 0x23, 0x0e, 0xbe, 0x40, 0xb0, 0xdb, 0x29)] +interface ID2D1SvgElement(ID2D1SvgElementVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn GetDocument( + document: *mut *mut ID2D1SvgDocument, + ) -> (), + fn GetTagName( + name: PWSTR, + nameCount: UINT32, + ) -> HRESULT, + fn GetTagNameLength() -> UINT32, + fn IsTextContent() -> BOOL, + fn GetParent( + parent: *mut *mut ID2D1SvgElement, + ) -> (), + fn HasChildren() -> BOOL, + fn GetFirstChild( + child: *mut *mut ID2D1SvgElement, + ) -> (), + fn GetLastChild( + child: *mut *mut ID2D1SvgElement, + ) -> (), + fn GetPreviousChild( + referenceChild: *mut ID2D1SvgElement, + previousChild: *mut *mut ID2D1SvgElement, + ) -> HRESULT, + fn GetNextChild( + referenceChild: *mut ID2D1SvgElement, + nextChild: *mut *mut ID2D1SvgElement, + ) -> HRESULT, + fn InsertChildBefore( + newChild: *mut ID2D1SvgElement, + referenceChild: *mut ID2D1SvgElement, + ) -> HRESULT, + fn AppendChild( + newChild: *mut ID2D1SvgElement, + ) -> HRESULT, + fn ReplaceChild( + newChild: *mut ID2D1SvgElement, + oldChild: *mut ID2D1SvgElement, + ) -> HRESULT, + fn RemoveChild( + oldChild: *mut ID2D1SvgElement, + ) -> HRESULT, + fn IsAttributeSpecified( + name: PCWSTR, inherited: *mut BOOL, + ) -> BOOL, + fn GetSpecifiedAttributeCount() -> UINT32, + fn GetSpecifiedAttributeName( + index: UINT32, + name: PWSTR, + nameCount: UINT32, + inherited: *mut BOOL, + ) -> HRESULT, + fn GetSpecifiedAttributeNameLength( + index: UINT32, + nameLength: *mut UINT32, + inherited: *mut BOOL, + ) -> HRESULT, + fn RemoveAttribute( + name: PCWSTR, + ) -> HRESULT, + fn SetTextValue( + name: *const WCHAR, + nameCount: UINT32, + ) -> HRESULT, + fn GetTextValue( + name: PWSTR, + nameCount: UINT32, + ) -> HRESULT, + fn GetTextValueLength() -> UINT32, + fn SetAttributeValue_1( + name: PCWSTR, + value: *mut ID2D1SvgAttribute, + ) -> HRESULT, + fn SetAttributeValue_2( + name: PCWSTR, + type_: D2D1_SVG_ATTRIBUTE_POD_TYPE, + value: *const c_void, + valueSizeInBytes: UINT32, + ) -> HRESULT, + fn SetAttributeValue_3( + name: PCWSTR, + type_: D2D1_SVG_ATTRIBUTE_STRING_TYPE, + value: PCWSTR, + ) -> HRESULT, + fn GetAttributeValue_1( + name: PCWSTR, + riid: REFIID, + value: *mut *mut c_void, + ) -> HRESULT, + fn GetAttributeValue_2( + name: PCWSTR, + type_: D2D1_SVG_ATTRIBUTE_POD_TYPE, + value: *mut c_void, + valueSizeInBytes: UINT32, + ) -> HRESULT, + fn GetAttributeValue_3( + name: PCWSTR, + type_: D2D1_SVG_ATTRIBUTE_STRING_TYPE, + value: PWSTR, + valueCount: UINT32, + ) -> HRESULT, + fn GetAttributeValueLength( + name: PCWSTR, + type_: D2D1_SVG_ATTRIBUTE_STRING_TYPE, + valueLength: *mut UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x86b88e4d, 0xafa4, 0x4d7b, 0x88, 0xe4, 0x68, 0xa5, 0x1c, 0x4a, 0x0a, 0xec)] +interface ID2D1SvgDocument(ID2D1SvgDocumentVtbl): ID2D1Resource(ID2D1ResourceVtbl) { + fn SetViewportSize( + viewportSize: D2D1_SIZE_F, + ) -> HRESULT, + fn GetViewportSize() -> D2D1_SIZE_F, + fn SetRoot( + root: *mut ID2D1SvgElement, + ) -> HRESULT, + fn GetRoot( + root: *mut *mut ID2D1SvgElement, + ) -> (), + fn FindElementById( + id: PCWSTR, + svgElement: *mut *mut ID2D1SvgElement, + ) -> HRESULT, + fn Serialize( + outputXmlStream: *mut IStream, + subtree: *mut ID2D1SvgElement, + ) -> HRESULT, + fn Deserialize( + inputXmlStream: *mut IStream, + subtree: *mut *mut ID2D1SvgElement, + ) -> HRESULT, + fn CreatePaint( + paintType: D2D1_SVG_PAINT_TYPE, + color: *const D2D1_COLOR_F, + id: PCWSTR, + paint: *mut *mut ID2D1SvgPaint, + ) -> HRESULT, + fn CreateStrokeDashArray( + dashes: *const D2D1_SVG_LENGTH, + dashesCount: UINT32, + strokeDashArray: *mut *mut ID2D1SvgStrokeDashArray, + ) -> HRESULT, + fn CreatePointCollection( + points: *const D2D1_POINT_2F, + pountsCount: UINT32, + pointCollection: *mut ID2D1SvgPointCollection, + ) -> HRESULT, + fn CreatePathData( + segmentData: *const FLOAT, + segmentDataCount: UINT32, + commands: *const D2D1_SVG_PATH_COMMAND, + commandsCount: UINT32, + pathData: *mut *mut ID2D1SvgPathData, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/d2dbasetypes.rs b/bash-5.1/vendor/winapi/src/um/d2dbasetypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..754a0557261d6c7fa695afcfc07c05fe80de3faf --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d2dbasetypes.rs @@ -0,0 +1,15 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of d2dbasetypes.h +use shared::d3d9types::D3DCOLORVALUE; +// FIXME: Remove in next major version +pub use um::dcommon::{ + D2D1_MATRIX_3X2_F, D2D1_POINT_2F, D2D1_POINT_2L, D2D1_POINT_2U, D2D1_RECT_F, D2D1_RECT_L, + D2D1_RECT_U, D2D1_SIZE_F, D2D1_SIZE_U, D2D_MATRIX_3X2_F, D2D_MATRIX_4X3_F, D2D_MATRIX_4X4_F, + D2D_MATRIX_5X4_F, D2D_POINT_2F, D2D_POINT_2L, D2D_POINT_2U, D2D_RECT_F, D2D_RECT_L, D2D_RECT_U, + D2D_SIZE_F, D2D_SIZE_U, D2D_VECTOR_2F, D2D_VECTOR_3F, D2D_VECTOR_4F, +}; +pub type D2D_COLOR_F = D3DCOLORVALUE; diff --git a/bash-5.1/vendor/winapi/src/um/d3d.rs b/bash-5.1/vendor/winapi/src/um/d3d.rs new file mode 100644 index 0000000000000000000000000000000000000000..e4b0250b6803e74321ff0fcbf3c2cf6af1fc84d5 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d.rs @@ -0,0 +1,61 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_IDirect3D, + 0x3bba0080, 0x2421, 0x11cf, 0xa3, 0x1a, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} +DEFINE_GUID!{IID_IDirect3D2, + 0x6aae1ec1, 0x662a, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} +DEFINE_GUID!{IID_IDirect3D3, + 0xbb223240, 0xe72b, 0x11d0, 0xa9, 0xb4, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e} +DEFINE_GUID!{IID_IDirect3D7, + 0xf5049e77, 0x4861, 0x11d2, 0xa4, 0x07, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} +DEFINE_GUID!{IID_IDirect3DRampDevice, + 0xf2086b20, 0x259f, 0x11cf, 0xa3, 0x1a, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} +DEFINE_GUID!{IID_IDirect3DRGBDevice, + 0xa4665c60, 0x2673, 0x11cf, 0xa3, 0x1a, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} +DEFINE_GUID!{IID_IDirect3DHALDevice, + 0x84e63de0, 0x46aa, 0x11cf, 0x81, 0x6f, 0x00, 0x00, 0xc0, 0x20, 0x15, 0x6e} +DEFINE_GUID!{IID_IDirect3DMMXDevice, + 0x881949a1, 0xd6f3, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} +DEFINE_GUID!{IID_IDirect3DRefDevice, + 0x50936643, 0x13e9, 0x11d1, 0x89, 0xaa, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} +DEFINE_GUID!{IID_IDirect3DNullDevice, + 0x8767df22, 0xbacc, 0x11d1, 0x89, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} +DEFINE_GUID!{IID_IDirect3DTnLHalDevice, + 0xf5049e78, 0x4861, 0x11d2, 0xa4, 0x07, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} +DEFINE_GUID!{IID_IDirect3DDevice, + 0x64108800, 0x957d, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} +DEFINE_GUID!{IID_IDirect3DDevice2, + 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} +DEFINE_GUID!{IID_IDirect3DDevice3, + 0xb0ab3b60, 0x33d7, 0x11d1, 0xa9, 0x81, 0x00, 0xc0, 0x4f, 0xd7, 0xb1, 0x74} +DEFINE_GUID!{IID_IDirect3DDevice7, + 0xf5049e79, 0x4861, 0x11d2, 0xa4, 0x07, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} +DEFINE_GUID!{IID_IDirect3DTexture, + 0x2cdcd9e0, 0x25a0, 0x11cf, 0xa3, 0x1a, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} +DEFINE_GUID!{IID_IDirect3DTexture2, + 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} +DEFINE_GUID!{IID_IDirect3DLight, + 0x4417c142, 0x33ad, 0x11cf, 0x81, 0x6f, 0x00, 0x00, 0xc0, 0x20, 0x15, 0x6e} +DEFINE_GUID!{IID_IDirect3DMaterial, + 0x4417c144, 0x33ad, 0x11cf, 0x81, 0x6f, 0x00, 0x00, 0xc0, 0x20, 0x15, 0x6e} +DEFINE_GUID!{IID_IDirect3DIndexBuffer8, + 0x0e689c9a, 0x053d, 0x44a0, 0x9d, 0x92, 0xdb, 0x0e, 0x3d, 0x75, 0x0f, 0x86} +DEFINE_GUID!{IID_IDirect3DMaterial2, + 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} +DEFINE_GUID!{IID_IDirect3DMaterial3, + 0xca9c46f4, 0xd3c5, 0x11d1, 0xb7, 0x5a, 0x00, 0x60, 0x08, 0x52, 0xb3, 0x12} +DEFINE_GUID!{IID_IDirect3DExecuteBuffer, + 0x4417c145, 0x33ad, 0x11cf, 0x81, 0x6f, 0x00, 0x00, 0xc0, 0x20, 0x15, 0x6e} +DEFINE_GUID!{IID_IDirect3DViewport, + 0x4417c146, 0x33ad, 0x11cf, 0x81, 0x6f, 0x00, 0x00, 0xc0, 0x20, 0x15, 0x6e} +DEFINE_GUID!{IID_IDirect3DViewport2, + 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} +DEFINE_GUID!{IID_IDirect3DViewport3, + 0xb0ab3b61, 0x33d7, 0x11d1, 0xa9, 0x81, 0x00, 0xc0, 0x4f, 0xd7, 0xb1, 0x74} +DEFINE_GUID!{IID_IDirect3DVertexBuffer, + 0x7a503555, 0x4a83, 0x11d1, 0xa5, 0xdb, 0x00, 0xa0, 0xc9, 0x03, 0x67, 0xf8} +DEFINE_GUID!{IID_IDirect3DVertexBuffer7, + 0xf5049e7d, 0x4861, 0x11d2, 0xa4, 0x07, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} diff --git a/bash-5.1/vendor/winapi/src/um/d3d10.rs b/bash-5.1/vendor/winapi/src/um/d3d10.rs new file mode 100644 index 0000000000000000000000000000000000000000..887b7a344fe49b4544193a297f77628249a4dcce --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d10.rs @@ -0,0 +1,57 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use um::d3dcommon::{D3D_PRIMITIVE, D3D_PRIMITIVE_TOPOLOGY, D3D_SRV_DIMENSION}; +pub type D3D10_PRIMITIVE_TOPOLOGY = D3D_PRIMITIVE_TOPOLOGY; +pub type D3D10_PRIMITIVE = D3D_PRIMITIVE; +pub type D3D10_SRV_DIMENSION = D3D_SRV_DIMENSION; +DEFINE_GUID!{IID_ID3D10DeviceChild, + 0x9b7e4c00, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10DepthStencilState, + 0x2b4b1cc8, 0xa4ad, 0x41f8, 0x83, 0x22, 0xca, 0x86, 0xfc, 0x3e, 0xc6, 0x75} +DEFINE_GUID!{IID_ID3D10BlendState, + 0xedad8d19, 0x8a35, 0x4d6d, 0x85, 0x66, 0x2e, 0xa2, 0x76, 0xcd, 0xe1, 0x61} +DEFINE_GUID!{IID_ID3D10RasterizerState, + 0xa2a07292, 0x89af, 0x4345, 0xbe, 0x2e, 0xc5, 0x3d, 0x9f, 0xbb, 0x6e, 0x9f} +DEFINE_GUID!{IID_ID3D10Resource, + 0x9b7e4c01, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Buffer, + 0x9b7e4c02, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Texture1D, + 0x9b7e4c03, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Texture2D, + 0x9b7e4c04, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Texture3D, + 0x9b7e4c05, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10View, + 0xc902b03f, 0x60a7, 0x49ba, 0x99, 0x36, 0x2a, 0x3a, 0xb3, 0x7a, 0x7e, 0x33} +DEFINE_GUID!{IID_ID3D10ShaderResourceView, + 0x9b7e4c07, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10RenderTargetView, + 0x9b7e4c08, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10DepthStencilView, + 0x9b7e4c09, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10VertexShader, + 0x9b7e4c0a, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10GeometryShader, + 0x6316be88, 0x54cd, 0x4040, 0xab, 0x44, 0x20, 0x46, 0x1b, 0xc8, 0x1f, 0x68} +DEFINE_GUID!{IID_ID3D10PixelShader, + 0x4968b601, 0x9d00, 0x4cde, 0x83, 0x46, 0x8e, 0x7f, 0x67, 0x58, 0x19, 0xb6} +DEFINE_GUID!{IID_ID3D10InputLayout, + 0x9b7e4c0b, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10SamplerState, + 0x9b7e4c0c, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Asynchronous, + 0x9b7e4c0d, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Query, + 0x9b7e4c0e, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Predicate, + 0x9b7e4c10, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Counter, + 0x9b7e4c11, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Device, + 0x9b7e4c0f, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Multithread, + 0x9b7e4e00, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} diff --git a/bash-5.1/vendor/winapi/src/um/d3d10_1.rs b/bash-5.1/vendor/winapi/src/um/d3d10_1.rs new file mode 100644 index 0000000000000000000000000000000000000000..3765ce3090271c1bb199f41938503a18d1699891 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d10_1.rs @@ -0,0 +1,11 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_ID3D10BlendState1, + 0xedad8d99, 0x8a35, 0x4d6d, 0x85, 0x66, 0x2e, 0xa2, 0x76, 0xcd, 0xe1, 0x61} +DEFINE_GUID!{IID_ID3D10ShaderResourceView1, + 0x9b7e4c87, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10Device1, + 0x9b7e4c8f, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} diff --git a/bash-5.1/vendor/winapi/src/um/d3d10_1shader.rs b/bash-5.1/vendor/winapi/src/um/d3d10_1shader.rs new file mode 100644 index 0000000000000000000000000000000000000000..69d9583ce0361f073c79484338dc9ae0609990f4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d10_1shader.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_ID3D10ShaderReflection1, + 0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47} diff --git a/bash-5.1/vendor/winapi/src/um/d3d10effect.rs b/bash-5.1/vendor/winapi/src/um/d3d10effect.rs new file mode 100644 index 0000000000000000000000000000000000000000..de93acec4e000bb5895530e58d791e0f8f40f780 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d10effect.rs @@ -0,0 +1,45 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_ID3D10StateBlock, + 0x0803425a, 0x57f5, 0x4dd6, 0x94, 0x65, 0xa8, 0x75, 0x70, 0x83, 0x4a, 0x08} +DEFINE_GUID!{IID_ID3D10EffectType, + 0x4e9e1ddc, 0xcd9d, 0x4772, 0xa8, 0x37, 0x00, 0x18, 0x0b, 0x9b, 0x88, 0xfd} +DEFINE_GUID!{IID_ID3D10EffectVariable, + 0xae897105, 0x00e6, 0x45bf, 0xbb, 0x8e, 0x28, 0x1d, 0xd6, 0xdb, 0x8e, 0x1b} +DEFINE_GUID!{IID_ID3D10EffectScalarVariable, + 0x00e48f7b, 0xd2c8, 0x49e8, 0xa8, 0x6c, 0x02, 0x2d, 0xee, 0x53, 0x43, 0x1f} +DEFINE_GUID!{IID_ID3D10EffectVectorVariable, + 0x62b98c44, 0x1f82, 0x4c67, 0xbc, 0xd0, 0x72, 0xcf, 0x8f, 0x21, 0x7e, 0x81} +DEFINE_GUID!{IID_ID3D10EffectMatrixVariable, + 0x50666c24, 0xb82f, 0x4eed, 0xa1, 0x72, 0x5b, 0x6e, 0x7e, 0x85, 0x22, 0xe0} +DEFINE_GUID!{IID_ID3D10EffectStringVariable, + 0x71417501, 0x8df9, 0x4e0a, 0xa7, 0x8a, 0x25, 0x5f, 0x97, 0x56, 0xba, 0xff} +DEFINE_GUID!{IID_ID3D10EffectShaderResourceVariable, + 0xc0a7157b, 0xd872, 0x4b1d, 0x80, 0x73, 0xef, 0xc2, 0xac, 0xd4, 0xb1, 0xfc} +DEFINE_GUID!{IID_ID3D10EffectRenderTargetViewVariable, + 0x28ca0cc3, 0xc2c9, 0x40bb, 0xb5, 0x7f, 0x67, 0xb7, 0x37, 0x12, 0x2b, 0x17} +DEFINE_GUID!{IID_ID3D10EffectDepthStencilViewVariable, + 0x3e02c918, 0xcc79, 0x4985, 0xb6, 0x22, 0x2d, 0x92, 0xad, 0x70, 0x16, 0x23} +DEFINE_GUID!{IID_ID3D10EffectConstantBuffer, + 0x56648f4d, 0xcc8b, 0x4444, 0xa5, 0xad, 0xb5, 0xa3, 0xd7, 0x6e, 0x91, 0xb3} +DEFINE_GUID!{IID_ID3D10EffectShaderVariable, + 0x80849279, 0xc799, 0x4797, 0x8c, 0x33, 0x04, 0x07, 0xa0, 0x7d, 0x9e, 0x06} +DEFINE_GUID!{IID_ID3D10EffectBlendVariable, + 0x1fcd2294, 0xdf6d, 0x4eae, 0x86, 0xb3, 0x0e, 0x91, 0x60, 0xcf, 0xb0, 0x7b} +DEFINE_GUID!{IID_ID3D10EffectDepthStencilVariable, + 0xaf482368, 0x330a, 0x46a5, 0x9a, 0x5c, 0x01, 0xc7, 0x1a, 0xf2, 0x4c, 0x8d} +DEFINE_GUID!{IID_ID3D10EffectRasterizerVariable, + 0x21af9f0e, 0x4d94, 0x4ea9, 0x97, 0x85, 0x2c, 0xb7, 0x6b, 0x8c, 0x0b, 0x34} +DEFINE_GUID!{IID_ID3D10EffectSamplerVariable, + 0x6530d5c7, 0x07e9, 0x4271, 0xa4, 0x18, 0xe7, 0xce, 0x4b, 0xd1, 0xe4, 0x80} +DEFINE_GUID!{IID_ID3D10EffectPass, + 0x5cfbeb89, 0x1a06, 0x46e0, 0xb2, 0x82, 0xe3, 0xf9, 0xbf, 0xa3, 0x6a, 0x54} +DEFINE_GUID!{IID_ID3D10EffectTechnique, + 0xdb122ce8, 0xd1c9, 0x4292, 0xb2, 0x37, 0x24, 0xed, 0x3d, 0xe8, 0xb1, 0x75} +DEFINE_GUID!{IID_ID3D10Effect, + 0x51b0ca8b, 0xec0b, 0x4519, 0x87, 0x0d, 0x8e, 0xe1, 0xcb, 0x50, 0x17, 0xc7} +DEFINE_GUID!{IID_ID3D10EffectPool, + 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33} diff --git a/bash-5.1/vendor/winapi/src/um/d3d10misc.rs b/bash-5.1/vendor/winapi/src/um/d3d10misc.rs new file mode 100644 index 0000000000000000000000000000000000000000..5303f2eb36a81b1222da743e6ef136cd93c80037 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d10misc.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{GUID_DeviceType, + 0xd722fb4d, 0x7a68, 0x437a, 0xb2, 0x0c, 0x58, 0x04, 0xee, 0x24, 0x94, 0xa6} diff --git a/bash-5.1/vendor/winapi/src/um/d3d10sdklayers.rs b/bash-5.1/vendor/winapi/src/um/d3d10sdklayers.rs new file mode 100644 index 0000000000000000000000000000000000000000..d71c483e475ca52179128c3f1fad8a106555fa1a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d10sdklayers.rs @@ -0,0 +1,13 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{DXGI_DEBUG_D3D10, + 0x243b4c52, 0x3606, 0x4d3a, 0x99, 0xd7, 0xa7, 0xe7, 0xb3, 0x3e, 0xd7, 0x06} +DEFINE_GUID!{IID_ID3D10Debug, + 0x9b7e4e01, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10SwitchToRef, + 0x9b7e4e02, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} +DEFINE_GUID!{IID_ID3D10InfoQueue, + 0x1b940b17, 0x2642, 0x4d1f, 0xab, 0x1f, 0xb9, 0x9b, 0xad, 0x0c, 0x39, 0x5f} diff --git a/bash-5.1/vendor/winapi/src/um/d3d10shader.rs b/bash-5.1/vendor/winapi/src/um/d3d10shader.rs new file mode 100644 index 0000000000000000000000000000000000000000..952fd6dc2a6c66301053fb2e0cd4638519bcd11e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d10shader.rs @@ -0,0 +1,206 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +use shared::minwindef::{BYTE, LPVOID, UINT}; +use um::d3d10::{D3D10_PRIMITIVE_TOPOLOGY, D3D10_SRV_DIMENSION}; +use um::d3dcommon::{ + D3D_CBUFFER_TYPE, D3D_INCLUDE_TYPE, D3D_NAME, D3D_REGISTER_COMPONENT_TYPE, + D3D_RESOURCE_RETURN_TYPE, D3D_SHADER_CBUFFER_FLAGS, D3D_SHADER_INPUT_FLAGS, + D3D_SHADER_INPUT_TYPE, D3D_SHADER_MACRO, D3D_SHADER_VARIABLE_CLASS, D3D_SHADER_VARIABLE_FLAGS, + D3D_SHADER_VARIABLE_TYPE, ID3DInclude, +}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCSTR}; +pub const D3D10_SHADER_DEBUG: UINT = 1 << 0; +pub const D3D10_SHADER_SKIP_VALIDATION: UINT = 1 << 1; +pub const D3D10_SHADER_SKIP_OPTIMIZATION: UINT = 1 << 2; +pub const D3D10_SHADER_PACK_MATRIX_ROW_MAJOR: UINT = 1 << 3; +pub const D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR: UINT = 1 << 4; +pub const D3D10_SHADER_PARTIAL_PRECISION: UINT = 1 << 5; +pub const D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT: UINT = 1 << 6; +pub const D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT: UINT = 1 << 7; +pub const D3D10_SHADER_NO_PRESHADER: UINT = 1 << 8; +pub const D3D10_SHADER_AVOID_FLOW_CONTROL: UINT = 1 << 9; +pub const D3D10_SHADER_PREFER_FLOW_CONTROL: UINT = 1 << 10; +pub const D3D10_SHADER_ENABLE_STRICTNESS: UINT = 1 << 11; +pub const D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY: UINT = 1 << 12; +pub const D3D10_SHADER_IEEE_STRICTNESS: UINT = 1 << 13; +pub const D3D10_SHADER_WARNINGS_ARE_ERRORS: UINT = 1 << 18; +pub const D3D10_SHADER_RESOURCES_MAY_ALIAS: UINT = 1 << 19; +pub const D3D10_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES: UINT = 1 << 20; +pub const D3D10_ALL_RESOURCES_BOUND: UINT = 1 << 21; +pub const D3D10_SHADER_OPTIMIZATION_LEVEL0: UINT = 1 << 14; +pub const D3D10_SHADER_OPTIMIZATION_LEVEL1: UINT = 0; +pub const D3D10_SHADER_OPTIMIZATION_LEVEL2: UINT = (1 << 14) | (1 << 15); +pub const D3D10_SHADER_OPTIMIZATION_LEVEL3: UINT = 1 << 15; +pub const D3D10_SHADER_FLAGS2_FORCE_ROOT_SIGNATURE_LATEST: UINT = 0; +pub const D3D10_SHADER_FLAGS2_FORCE_ROOT_SIGNATURE_1_0: UINT = 1 << 4; +pub const D3D10_SHADER_FLAGS2_FORCE_ROOT_SIGNATURE_1_1: UINT = 1 << 5; +pub type D3D10_SHADER_MACRO = D3D_SHADER_MACRO; +pub type LPD3D10_SHADER_MACRO = *mut D3D10_SHADER_MACRO; +pub type D3D10_SHADER_VARIABLE_CLASS = D3D_SHADER_VARIABLE_CLASS; +pub type LPD3D10_SHADER_VARIABLE_CLASS = *mut D3D10_SHADER_VARIABLE_CLASS; +pub type D3D10_SHADER_VARIABLE_FLAGS = D3D_SHADER_VARIABLE_FLAGS; +pub type LPD3D10_SHADER_VARIABLE_FLAGS = *mut D3D10_SHADER_VARIABLE_FLAGS; +pub type D3D10_SHADER_VARIABLE_TYPE = D3D_SHADER_VARIABLE_TYPE; +pub type LPD3D10_SHADER_VARIABLE_TYPE = *mut D3D10_SHADER_VARIABLE_TYPE; +pub type D3D10_SHADER_INPUT_FLAGS = D3D_SHADER_INPUT_FLAGS; +pub type LPD3D10_SHADER_INPUT_FLAGS = *mut D3D10_SHADER_INPUT_FLAGS; +pub type D3D10_SHADER_INPUT_TYPE = D3D_SHADER_INPUT_TYPE; +pub type LPD3D10_SHADER_INPUT_TYPE = *mut D3D10_SHADER_INPUT_TYPE; +pub type D3D10_SHADER_CBUFFER_FLAGS = D3D_SHADER_CBUFFER_FLAGS; +pub type LPD3D10_SHADER_CBUFFER_FLAGS = *mut D3D10_SHADER_CBUFFER_FLAGS; +pub type D3D10_CBUFFER_TYPE = D3D_CBUFFER_TYPE; +pub type LPD3D10_CBUFFER_TYPE = *mut D3D10_CBUFFER_TYPE; +pub type D3D10_NAME = D3D_NAME; +pub type D3D10_RESOURCE_RETURN_TYPE = D3D_RESOURCE_RETURN_TYPE; +pub type D3D10_REGISTER_COMPONENT_TYPE = D3D_REGISTER_COMPONENT_TYPE; +pub type D3D10_INCLUDE_TYPE = D3D_INCLUDE_TYPE; +pub type ID3D10Include = ID3DInclude; +pub type LPD3D10INCLUDE = *mut ID3DInclude; +// const IID_ID3D10Include: IID = IID_ID3DInclude; +STRUCT!{struct D3D10_SHADER_DESC { + Version: UINT, + Creator: LPCSTR, + Flags: UINT, + ConstantBuffers: UINT, + BoundResources: UINT, + InputParameters: UINT, + OutputParameters: UINT, + InstructionCount: UINT, + TempRegisterCount: UINT, + TempArrayCount: UINT, + DefCount: UINT, + DclCount: UINT, + TextureNormalInstructions: UINT, + TextureLoadInstructions: UINT, + TextureCompInstructions: UINT, + TextureBiasInstructions: UINT, + TextureGradientInstructions: UINT, + FloatInstructionCount: UINT, + IntInstructionCount: UINT, + UintInstructionCount: UINT, + StaticFlowControlCount: UINT, + DynamicFlowControlCount: UINT, + MacroInstructionCount: UINT, + ArrayInstructionCount: UINT, + CutInstructionCount: UINT, + EmitInstructionCount: UINT, + GSOutputTopology: D3D10_PRIMITIVE_TOPOLOGY, + GSMaxOutputVertexCount: UINT, +}} +STRUCT!{struct D3D10_SHADER_BUFFER_DESC { + Name: LPCSTR, + Type: D3D10_CBUFFER_TYPE, + Variables: UINT, + Size: UINT, + uFlags: UINT, +}} +STRUCT!{struct D3D10_SHADER_VARIABLE_DESC { + Name: LPCSTR, + StartOffset: UINT, + Size: UINT, + uFlags: UINT, + DefaultValue: LPVOID, +}} +STRUCT!{struct D3D10_SHADER_TYPE_DESC { + Class: D3D10_SHADER_VARIABLE_CLASS, + Type: D3D10_SHADER_VARIABLE_TYPE, + Rows: UINT, + Columns: UINT, + Elements: UINT, + Members: UINT, + Offset: UINT, +}} +STRUCT!{struct D3D10_SHADER_INPUT_BIND_DESC { + Name: LPCSTR, + Type: D3D10_SHADER_INPUT_TYPE, + BindPoint: UINT, + BindCount: UINT, + uFlags: UINT, + ReturnType: D3D10_RESOURCE_RETURN_TYPE, + Dimension: D3D10_SRV_DIMENSION, + NumSamples: UINT, +}} +STRUCT!{struct D3D10_SIGNATURE_PARAMETER_DESC { + SemanticName: LPCSTR, + SemanticIndex: UINT, + Register: UINT, + SystemValueType: D3D10_NAME, + ComponentType: D3D10_REGISTER_COMPONENT_TYPE, + Mask: BYTE, + ReadWriteMask: BYTE, +}} +pub type LPD3D10SHADERREFLECTIONTYPE = *mut ID3D10ShaderReflectionType; +DEFINE_GUID!{IID_ID3D10ShaderReflectionType, + 0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd} +RIDL!{#[uuid(0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd)] +interface ID3D10ShaderReflectionType(ID3D10ShaderReflectionTypeVtbl) { + fn GetDesc( + pDesc: *mut D3D10_SHADER_TYPE_DESC, + ) -> HRESULT, + fn GetMemberTypeByIndex( + Index: UINT, + ) -> *mut ID3D10ShaderReflectionType, + fn GetMemberTypeByName( + Name: LPCSTR, + ) -> *mut ID3D10ShaderReflectionType, + fn GetMemberTypeName( + Index: UINT, + ) -> LPCSTR, +}} +pub type LPD3D10SHADERREFLECTIONVARIABLE = *mut ID3D10ShaderReflectionVariable; +DEFINE_GUID!{IID_ID3D10ShaderReflectionVariable, + 0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1} +RIDL!{#[uuid(0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1)] +interface ID3D10ShaderReflectionVariable(ID3D10ShaderReflectionVariableVtbl) { + fn GetDesc( + pDesc: *mut D3D10_SHADER_VARIABLE_DESC, + ) -> HRESULT, + fn GetType() -> *mut ID3D10ShaderReflectionType, +}} +pub type LPD3D10SHADERREFLECTIONCONSTANTBUFFER = *mut ID3D10ShaderReflectionConstantBuffer; +DEFINE_GUID!{IID_ID3D10ShaderReflectionConstantBuffer, + 0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0} +RIDL!{#[uuid(0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0)] +interface ID3D10ShaderReflectionConstantBuffer(ID3D10ShaderReflectionConstantBufferVtbl) { + fn GetDesc( + pDesc: *mut D3D10_SHADER_BUFFER_DESC, + ) -> HRESULT, + fn GetVariableByIndex( + Index: UINT, + ) -> *mut ID3D10ShaderReflectionVariable, + fn GetVariableByName( + Name: LPCSTR, + ) -> *mut ID3D10ShaderReflectionVariable, +}} +pub type LPD3D10SHADERREFLECTION = *mut ID3D10ShaderReflection; +DEFINE_GUID!{IID_ID3D10ShaderReflection, + 0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa} +RIDL!{#[uuid(0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa)] +interface ID3D10ShaderReflection(ID3D10ShaderReflectionVtbl): IUnknown(IUnknownVtbl) { + fn GetDesc( + pDesc: *mut D3D10_SHADER_DESC, + ) -> HRESULT, + fn GetConstantBufferByIndex( + Index: UINT, + ) -> *mut ID3D10ShaderReflectionConstantBuffer, + fn GetConstantBufferByName( + Name: LPCSTR, + ) -> *mut ID3D10ShaderReflectionConstantBuffer, + fn GetResourceBindingDesc( + ResourceIndex: UINT, + pDesc: *mut D3D10_SHADER_INPUT_BIND_DESC, + ) -> HRESULT, + fn GetInputParameterDesc( + ParameterIndex: UINT, + pDesc: *mut D3D10_SIGNATURE_PARAMETER_DESC, + ) -> HRESULT, + fn GetOutputParameterDesc( + ParameterIndex: UINT, + pDesc: *mut D3D10_SIGNATURE_PARAMETER_DESC, + ) -> HRESULT, +}} +// TODO Some functions diff --git a/bash-5.1/vendor/winapi/src/um/d3d11.rs b/bash-5.1/vendor/winapi/src/um/d3d11.rs new file mode 100644 index 0000000000000000000000000000000000000000..79b5c4dff0f3c774ba8662cc44b4b4f1109a11c5 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d11.rs @@ -0,0 +1,3421 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_float, c_int, c_long, c_void}; +use shared::basetsd::{SIZE_T, UINT64, UINT8}; +use shared::dxgi::{DXGI_SWAP_CHAIN_DESC, IDXGIAdapter, IDXGISwapChain}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::dxgitype::{DXGI_RATIONAL, DXGI_SAMPLE_DESC}; +use shared::guiddef::{GUID, REFGUID, REFIID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT, HMODULE, INT, UINT, USHORT}; +use shared::windef::{RECT, SIZE}; +use um::d3dcommon::{ + D3D_DRIVER_TYPE, D3D_FEATURE_LEVEL, D3D_PRIMITIVE, D3D_PRIMITIVE_TOPOLOGY, D3D_SRV_DIMENSION, +}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, LPCSTR, LPSTR, ULONGLONG}; +pub const D3D11_16BIT_INDEX_STRIP_CUT_VALUE: DWORD = 0xffff; +pub const D3D11_32BIT_INDEX_STRIP_CUT_VALUE: DWORD = 0xffffffff; +pub const D3D11_8BIT_INDEX_STRIP_CUT_VALUE: DWORD = 0xff; +pub const D3D11_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT: DWORD = 9; +pub const D3D11_CLIP_OR_CULL_DISTANCE_COUNT: DWORD = 8; +pub const D3D11_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT: DWORD = 2; +pub const D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT: DWORD = 14; +pub const D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS: DWORD = 4; +pub const D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT: DWORD = 15; +pub const D3D11_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT: DWORD = 16; +pub const D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT: DWORD = 15; +pub const D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST: DWORD = 1; +pub const D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT: DWORD = 64; +pub const D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT: DWORD = 1; +pub const D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST: DWORD = 1; +pub const D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT: DWORD = 128; +pub const D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST: DWORD = 1; +pub const D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT: DWORD = 128; +pub const D3D11_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_COMMONSHADER_SAMPLER_REGISTER_COUNT: DWORD = 16; +pub const D3D11_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST: DWORD = 1; +pub const D3D11_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT: DWORD = 16; +pub const D3D11_COMMONSHADER_SUBROUTINE_NESTING_LIMIT: DWORD = 32; +pub const D3D11_COMMONSHADER_TEMP_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_COMMONSHADER_TEMP_REGISTER_COUNT: DWORD = 4096; +pub const D3D11_COMMONSHADER_TEMP_REGISTER_READS_PER_INST: DWORD = 3; +pub const D3D11_COMMONSHADER_TEMP_REGISTER_READ_PORTS: DWORD = 3; +pub const D3D11_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX: DWORD = 10; +pub const D3D11_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN: c_long = -10; +pub const D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE: c_long = -8; +pub const D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE: DWORD = 7; +pub const D3D11_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 256; +pub const D3D11_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP: DWORD = 64; +pub const D3D11_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 240; +pub const D3D11_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP: DWORD = 68; +pub const D3D11_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 224; +pub const D3D11_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP: DWORD = 72; +pub const D3D11_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 208; +pub const D3D11_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP: DWORD = 76; +pub const D3D11_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 192; +pub const D3D11_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP: DWORD = 84; +pub const D3D11_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 176; +pub const D3D11_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP: DWORD = 92; +pub const D3D11_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 160; +pub const D3D11_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP: DWORD = 100; +pub const D3D11_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 144; +pub const D3D11_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP: DWORD = 112; +pub const D3D11_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 128; +pub const D3D11_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP: DWORD = 128; +pub const D3D11_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 112; +pub const D3D11_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP: DWORD = 144; +pub const D3D11_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 96; +pub const D3D11_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP: DWORD = 168; +pub const D3D11_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 80; +pub const D3D11_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP: DWORD = 204; +pub const D3D11_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 64; +pub const D3D11_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP: DWORD = 256; +pub const D3D11_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 48; +pub const D3D11_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP: DWORD = 340; +pub const D3D11_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 32; +pub const D3D11_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP: DWORD = 512; +pub const D3D11_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: DWORD = 16; +pub const D3D11_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP: DWORD = 768; +pub const D3D11_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION: DWORD = 1; +pub const D3D11_CS_4_X_RAW_UAV_BYTE_ALIGNMENT: DWORD = 256; +pub const D3D11_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP: DWORD = 768; +pub const D3D11_CS_4_X_THREAD_GROUP_MAX_X: DWORD = 768; +pub const D3D11_CS_4_X_THREAD_GROUP_MAX_Y: DWORD = 768; +pub const D3D11_CS_4_X_UAV_REGISTER_COUNT: DWORD = 1; +pub const D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION: DWORD = 65535; +pub const D3D11_CS_TGSM_REGISTER_COUNT: DWORD = 8192; +pub const D3D11_CS_TGSM_REGISTER_READS_PER_INST: DWORD = 1; +pub const D3D11_CS_TGSM_RESOURCE_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_CS_TGSM_RESOURCE_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_CS_THREADGROUPID_REGISTER_COMPONENTS: DWORD = 3; +pub const D3D11_CS_THREADGROUPID_REGISTER_COUNT: DWORD = 1; +pub const D3D11_CS_THREADIDINGROUPFLATTENED_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_CS_THREADIDINGROUPFLATTENED_REGISTER_COUNT: DWORD = 1; +pub const D3D11_CS_THREADIDINGROUP_REGISTER_COMPONENTS: DWORD = 3; +pub const D3D11_CS_THREADIDINGROUP_REGISTER_COUNT: DWORD = 1; +pub const D3D11_CS_THREADID_REGISTER_COMPONENTS: DWORD = 3; +pub const D3D11_CS_THREADID_REGISTER_COUNT: DWORD = 1; +pub const D3D11_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP: DWORD = 1024; +pub const D3D11_CS_THREAD_GROUP_MAX_X: DWORD = 1024; +pub const D3D11_CS_THREAD_GROUP_MAX_Y: DWORD = 1024; +pub const D3D11_CS_THREAD_GROUP_MAX_Z: DWORD = 64; +pub const D3D11_CS_THREAD_GROUP_MIN_X: DWORD = 1; +pub const D3D11_CS_THREAD_GROUP_MIN_Y: DWORD = 1; +pub const D3D11_CS_THREAD_GROUP_MIN_Z: DWORD = 1; +pub const D3D11_CS_THREAD_LOCAL_TEMP_REGISTER_POOL: DWORD = 16384; +pub const D3D11_DEFAULT_BLEND_FACTOR_ALPHA: FLOAT = 1.0; +pub const D3D11_DEFAULT_BLEND_FACTOR_BLUE: FLOAT = 1.0; +pub const D3D11_DEFAULT_BLEND_FACTOR_GREEN: FLOAT = 1.0; +pub const D3D11_DEFAULT_BLEND_FACTOR_RED: FLOAT = 1.0; +pub const D3D11_DEFAULT_BORDER_COLOR_COMPONENT: FLOAT = 0.0; +pub const D3D11_DEFAULT_DEPTH_BIAS: DWORD = 0; +pub const D3D11_DEFAULT_DEPTH_BIAS_CLAMP: FLOAT = 0.0; +pub const D3D11_DEFAULT_MAX_ANISOTROPY: DWORD = 16; +pub const D3D11_DEFAULT_MIP_LOD_BIAS: FLOAT = 0.0; +pub const D3D11_DEFAULT_RENDER_TARGET_ARRAY_INDEX: DWORD = 0; +pub const D3D11_DEFAULT_SAMPLE_MASK: DWORD = 0xffffffff; +pub const D3D11_DEFAULT_SCISSOR_ENDX: DWORD = 0; +pub const D3D11_DEFAULT_SCISSOR_ENDY: DWORD = 0; +pub const D3D11_DEFAULT_SCISSOR_STARTX: DWORD = 0; +pub const D3D11_DEFAULT_SCISSOR_STARTY: DWORD = 0; +pub const D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS: FLOAT = 0.0; +pub const D3D11_DEFAULT_STENCIL_READ_MASK: DWORD = 0xff; +pub const D3D11_DEFAULT_STENCIL_REFERENCE: DWORD = 0; +pub const D3D11_DEFAULT_STENCIL_WRITE_MASK: DWORD = 0xff; +pub const D3D11_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX: DWORD = 0; +pub const D3D11_DEFAULT_VIEWPORT_HEIGHT: DWORD = 0; +pub const D3D11_DEFAULT_VIEWPORT_MAX_DEPTH: FLOAT = 0.0; +pub const D3D11_DEFAULT_VIEWPORT_MIN_DEPTH: FLOAT = 0.0; +pub const D3D11_DEFAULT_VIEWPORT_TOPLEFTX: DWORD = 0; +pub const D3D11_DEFAULT_VIEWPORT_TOPLEFTY: DWORD = 0; +pub const D3D11_DEFAULT_VIEWPORT_WIDTH: DWORD = 0; +pub const D3D11_DS_INPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS: DWORD = 3968; +pub const D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_DS_INPUT_CONTROL_POINT_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_DS_INPUT_CONTROL_POINT_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENTS: DWORD = 3; +pub const D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COUNT: DWORD = 1; +pub const D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_COUNT: DWORD = 1; +pub const D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_DS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_DS_OUTPUT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_DS_OUTPUT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_FLOAT16_FUSED_TOLERANCE_IN_ULP: FLOAT = 0.6; +pub const D3D11_FLOAT32_MAX: FLOAT = 3.402823466E+38; +pub const D3D11_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP: FLOAT = 0.6; +pub const D3D11_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR: FLOAT = 2.4; +pub const D3D11_FLOAT_TO_SRGB_EXPONENT_NUMERATOR: FLOAT = 1.0; +pub const D3D11_FLOAT_TO_SRGB_OFFSET: FLOAT = 0.055; +pub const D3D11_FLOAT_TO_SRGB_SCALE_1: FLOAT = 12.92; +pub const D3D11_FLOAT_TO_SRGB_SCALE_2: FLOAT = 1.055; +pub const D3D11_FLOAT_TO_SRGB_THRESHOLD: FLOAT = 0.0031308; +pub const D3D11_FTOI_INSTRUCTION_MAX_INPUT: FLOAT = 2147483647.999; +pub const D3D11_FTOI_INSTRUCTION_MIN_INPUT: FLOAT = -2147483648.999; +pub const D3D11_FTOU_INSTRUCTION_MAX_INPUT: FLOAT = 4294967295.999; +pub const D3D11_FTOU_INSTRUCTION_MIN_INPUT: FLOAT = 0.0; +pub const D3D11_GS_INPUT_INSTANCE_ID_READS_PER_INST: DWORD = 2; +pub const D3D11_GS_INPUT_INSTANCE_ID_READ_PORTS: DWORD = 1; +pub const D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COUNT: DWORD = 1; +pub const D3D11_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_GS_INPUT_PRIM_CONST_REGISTER_COUNT: DWORD = 1; +pub const D3D11_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_GS_INPUT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_GS_INPUT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_GS_INPUT_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_GS_INPUT_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_GS_INPUT_REGISTER_VERTICES: DWORD = 32; +pub const D3D11_GS_MAX_INSTANCE_COUNT: DWORD = 32; +pub const D3D11_GS_MAX_OUTPUT_VERTEX_COUNT_ACROSS_INSTANCES: DWORD = 1024; +pub const D3D11_GS_OUTPUT_ELEMENTS: DWORD = 32; +pub const D3D11_GS_OUTPUT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_GS_OUTPUT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_HS_CONTROL_POINT_PHASE_INPUT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_HS_CONTROL_POINT_PHASE_OUTPUT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_HS_CONTROL_POINT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_HS_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_HS_CONTROL_POINT_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_HS_CONTROL_POINT_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_HS_FORK_PHASE_INSTANCE_COUNT_UPPER_BOUND: DWORD = 0xffffffff; +pub const D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COUNT: DWORD = 1; +pub const D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COUNT: DWORD = 1; +pub const D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COUNT: DWORD = 1; +pub const D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_HS_JOIN_PHASE_INSTANCE_COUNT_UPPER_BOUND: DWORD = 0xffffffff; +pub const D3D11_HS_MAXTESSFACTOR_LOWER_BOUND: FLOAT = 1.0; +pub const D3D11_HS_MAXTESSFACTOR_UPPER_BOUND: FLOAT = 64.0; +pub const D3D11_HS_OUTPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS: DWORD = 3968; +pub const D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COUNT: DWORD = 1; +pub const D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_SCALAR_COMPONENTS: DWORD = 128; +pub const D3D11_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES: DWORD = 0; +pub const D3D11_IA_DEFAULT_PRIMITIVE_TOPOLOGY: DWORD = 0; +pub const D3D11_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES: DWORD = 0; +pub const D3D11_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT: DWORD = 1; +pub const D3D11_IA_INSTANCE_ID_BIT_COUNT: DWORD = 32; +pub const D3D11_IA_INTEGER_ARITHMETIC_BIT_COUNT: DWORD = 32; +pub const D3D11_IA_PATCH_MAX_CONTROL_POINT_COUNT: DWORD = 32; +pub const D3D11_IA_PRIMITIVE_ID_BIT_COUNT: DWORD = 32; +pub const D3D11_IA_VERTEX_ID_BIT_COUNT: DWORD = 32; +pub const D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT: DWORD = 32; +pub const D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS: DWORD = 128; +pub const D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT: DWORD = 32; +pub const D3D11_INTEGER_DIVIDE_BY_ZERO_QUOTIENT: DWORD = 0xffffffff; +pub const D3D11_INTEGER_DIVIDE_BY_ZERO_REMAINDER: DWORD = 0xffffffff; +pub const D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL: DWORD = 0xffffffff; +pub const D3D11_KEEP_UNORDERED_ACCESS_VIEWS: DWORD = 0xffffffff; +pub const D3D11_LINEAR_GAMMA: FLOAT = 1.0; +pub const D3D11_MAJOR_VERSION: DWORD = 11; +pub const D3D11_MAX_BORDER_COLOR_COMPONENT: FLOAT = 1.0; +pub const D3D11_MAX_DEPTH: FLOAT = 1.0; +pub const D3D11_MAX_MAXANISOTROPY: DWORD = 16; +pub const D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT: DWORD = 32; +pub const D3D11_MAX_POSITION_VALUE: FLOAT = 3.402823466E+34; +pub const D3D11_MAX_TEXTURE_DIMENSION_2_TO_EXP: DWORD = 17; +pub const D3D11_MINOR_VERSION: DWORD = 0; +pub const D3D11_MIN_BORDER_COLOR_COMPONENT: FLOAT = 0.0; +pub const D3D11_MIN_DEPTH: FLOAT = 0.0; +pub const D3D11_MIN_MAXANISOTROPY: DWORD = 0; +pub const D3D11_MIP_LOD_BIAS_MAX: FLOAT = 15.99; +pub const D3D11_MIP_LOD_BIAS_MIN: FLOAT = -16.0; +pub const D3D11_MIP_LOD_FRACTIONAL_BIT_COUNT: DWORD = 8; +pub const D3D11_MIP_LOD_RANGE_BIT_COUNT: DWORD = 8; +pub const D3D11_MULTISAMPLE_ANTIALIAS_LINE_WIDTH: FLOAT = 1.4; +pub const D3D11_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT: DWORD = 0; +pub const D3D11_PIXEL_ADDRESS_RANGE_BIT_COUNT: DWORD = 15; +pub const D3D11_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT: DWORD = 16; +pub const D3D11_PS_CS_UAV_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_PS_CS_UAV_REGISTER_COUNT: DWORD = 8; +pub const D3D11_PS_CS_UAV_REGISTER_READS_PER_INST: DWORD = 1; +pub const D3D11_PS_CS_UAV_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_PS_FRONTFACING_DEFAULT_VALUE: DWORD = 0xffffffff; +pub const D3D11_PS_FRONTFACING_FALSE_VALUE: DWORD = 0; +pub const D3D11_PS_FRONTFACING_TRUE_VALUE: DWORD = 0xffffffff; +pub const D3D11_PS_INPUT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_PS_INPUT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_PS_INPUT_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_PS_INPUT_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT: FLOAT = 0.0; +pub const D3D11_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_PS_OUTPUT_DEPTH_REGISTER_COUNT: DWORD = 1; +pub const D3D11_PS_OUTPUT_MASK_REGISTER_COMPONENTS: DWORD = 1; +pub const D3D11_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_PS_OUTPUT_MASK_REGISTER_COUNT: DWORD = 1; +pub const D3D11_PS_OUTPUT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_PS_OUTPUT_REGISTER_COUNT: DWORD = 8; +pub const D3D11_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT: FLOAT = 0.5; +pub const D3D11_RAW_UAV_SRV_BYTE_ALIGNMENT: DWORD = 16; +pub const D3D11_REQ_BLEND_OBJECT_COUNT_PER_DEVICE: DWORD = 4096; +pub const D3D11_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP: DWORD = 27; +pub const D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT: DWORD = 4096; +pub const D3D11_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_DEVICE: DWORD = 4096; +pub const D3D11_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP: DWORD = 32; +pub const D3D11_REQ_DRAW_VERTEX_COUNT_2_TO_EXP: DWORD = 32; +pub const D3D11_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION: DWORD = 16384; +pub const D3D11_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT: DWORD = 1024; +pub const D3D11_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT: DWORD = 4096; +pub const D3D11_REQ_MAXANISOTROPY: DWORD = 16; +pub const D3D11_REQ_MIP_LEVELS: DWORD = 15; +pub const D3D11_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES: DWORD = 2048; +pub const D3D11_REQ_RASTERIZER_OBJECT_COUNT_PER_DEVICE: DWORD = 4096; +pub const D3D11_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH: DWORD = 16384; +pub const D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM: DWORD = 128; +pub const D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM: FLOAT = 0.25; +pub const D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_C_TERM: DWORD = 2048; +pub const D3D11_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP: DWORD = 20; +pub const D3D11_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE: DWORD = 4096; +pub const D3D11_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION: DWORD = 2048; +pub const D3D11_REQ_TEXTURE1D_U_DIMENSION: DWORD = 16384; +pub const D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION: DWORD = 2048; +pub const D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION: DWORD = 16384; +pub const D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION: DWORD = 2048; +pub const D3D11_REQ_TEXTURECUBE_DIMENSION: DWORD = 16384; +pub const D3D11_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL: DWORD = 0; +pub const D3D11_SHADER_MAJOR_VERSION: DWORD = 5; +pub const D3D11_SHADER_MAX_INSTANCES: DWORD = 65535; +pub const D3D11_SHADER_MAX_INTERFACES: DWORD = 253; +pub const D3D11_SHADER_MAX_INTERFACE_CALL_SITES: DWORD = 4096; +pub const D3D11_SHADER_MAX_TYPES: DWORD = 65535; +pub const D3D11_SHADER_MINOR_VERSION: DWORD = 0; +pub const D3D11_SHIFT_INSTRUCTION_PAD_VALUE: DWORD = 0; +pub const D3D11_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT: DWORD = 5; +pub const D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT: DWORD = 8; +pub const D3D11_SO_BUFFER_MAX_STRIDE_IN_BYTES: DWORD = 2048; +pub const D3D11_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES: DWORD = 512; +pub const D3D11_SO_BUFFER_SLOT_COUNT: DWORD = 4; +pub const D3D11_SO_DDI_REGISTER_INDEX_DENOTING_GAP: DWORD = 0xffffffff; +pub const D3D11_SO_NO_RASTERIZED_STREAM: DWORD = 0xffffffff; +pub const D3D11_SO_OUTPUT_COMPONENT_COUNT: DWORD = 128; +pub const D3D11_SO_STREAM_COUNT: DWORD = 4; +pub const D3D11_SPEC_DATE_DAY: DWORD = 16; +pub const D3D11_SPEC_DATE_MONTH: DWORD = 0o5; +pub const D3D11_SPEC_DATE_YEAR: DWORD = 2011; +pub const D3D11_SPEC_VERSION: FLOAT = 1.07; +pub const D3D11_SRGB_GAMMA: FLOAT = 2.2; +pub const D3D11_SRGB_TO_FLOAT_DENOMINATOR_1: FLOAT = 12.92; +pub const D3D11_SRGB_TO_FLOAT_DENOMINATOR_2: FLOAT = 1.055; +pub const D3D11_SRGB_TO_FLOAT_EXPONENT: FLOAT = 2.4; +pub const D3D11_SRGB_TO_FLOAT_OFFSET: FLOAT = 0.055; +pub const D3D11_SRGB_TO_FLOAT_THRESHOLD: FLOAT = 0.04045; +pub const D3D11_SRGB_TO_FLOAT_TOLERANCE_IN_ULP: FLOAT = 0.5; +pub const D3D11_STANDARD_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_STANDARD_COMPONENT_BIT_COUNT_DOUBLED: DWORD = 64; +pub const D3D11_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE: DWORD = 4; +pub const D3D11_STANDARD_PIXEL_COMPONENT_COUNT: DWORD = 128; +pub const D3D11_STANDARD_PIXEL_ELEMENT_COUNT: DWORD = 32; +pub const D3D11_STANDARD_VECTOR_SIZE: DWORD = 4; +pub const D3D11_STANDARD_VERTEX_ELEMENT_COUNT: DWORD = 32; +pub const D3D11_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT: DWORD = 64; +pub const D3D11_SUBPIXEL_FRACTIONAL_BIT_COUNT: DWORD = 8; +pub const D3D11_SUBTEXEL_FRACTIONAL_BIT_COUNT: DWORD = 8; +pub const D3D11_TESSELLATOR_MAX_EVEN_TESSELLATION_FACTOR: DWORD = 64; +pub const D3D11_TESSELLATOR_MAX_ISOLINE_DENSITY_TESSELLATION_FACTOR: DWORD = 64; +pub const D3D11_TESSELLATOR_MAX_ODD_TESSELLATION_FACTOR: DWORD = 63; +pub const D3D11_TESSELLATOR_MAX_TESSELLATION_FACTOR: DWORD = 64; +pub const D3D11_TESSELLATOR_MIN_EVEN_TESSELLATION_FACTOR: DWORD = 2; +pub const D3D11_TESSELLATOR_MIN_ISOLINE_DENSITY_TESSELLATION_FACTOR: DWORD = 1; +pub const D3D11_TESSELLATOR_MIN_ODD_TESSELLATION_FACTOR: DWORD = 1; +pub const D3D11_TEXEL_ADDRESS_RANGE_BIT_COUNT: DWORD = 16; +pub const D3D11_UNBOUND_MEMORY_ACCESS_RESULT: DWORD = 0; +pub const D3D11_VIEWPORT_AND_SCISSORRECT_MAX_INDEX: DWORD = 15; +pub const D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE: DWORD = 16; +pub const D3D11_VIEWPORT_BOUNDS_MAX: DWORD = 32767; +pub const D3D11_VIEWPORT_BOUNDS_MIN: c_long = -32768; +pub const D3D11_VS_INPUT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_VS_INPUT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_VS_INPUT_REGISTER_READS_PER_INST: DWORD = 2; +pub const D3D11_VS_INPUT_REGISTER_READ_PORTS: DWORD = 1; +pub const D3D11_VS_OUTPUT_REGISTER_COMPONENTS: DWORD = 4; +pub const D3D11_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT: DWORD = 32; +pub const D3D11_VS_OUTPUT_REGISTER_COUNT: DWORD = 32; +pub const D3D11_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT: DWORD = 10; +pub const D3D11_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP: DWORD = 25; +pub const D3D11_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP: DWORD = 25; +pub const D3D11_1_UAV_SLOT_COUNT: DWORD = 64; +pub const D3D11_2_TILED_RESOURCE_TILE_SIZE_IN_BYTES: DWORD = 65536; +ENUM!{enum D3D11_INPUT_CLASSIFICATION { + D3D11_INPUT_PER_VERTEX_DATA = 0, + D3D11_INPUT_PER_INSTANCE_DATA = 1, +}} +pub const D3D11_APPEND_ALIGNED_ELEMENT: DWORD = 0xffffffff; +STRUCT!{struct D3D11_INPUT_ELEMENT_DESC { + SemanticName: LPCSTR, + SemanticIndex: UINT, + Format: DXGI_FORMAT, + InputSlot: UINT, + AlignedByteOffset: UINT, + InputSlotClass: D3D11_INPUT_CLASSIFICATION, + InstanceDataStepRate: UINT, +}} +ENUM!{enum D3D11_FILL_MODE { + D3D11_FILL_WIREFRAME = 2, + D3D11_FILL_SOLID = 3, +}} +pub type D3D11_PRIMITIVE_TOPOLOGY = D3D_PRIMITIVE_TOPOLOGY; +pub type D3D11_PRIMITIVE = D3D_PRIMITIVE; +ENUM!{enum D3D11_CULL_MODE { + D3D11_CULL_NONE = 1, + D3D11_CULL_FRONT = 2, + D3D11_CULL_BACK = 3, +}} +STRUCT!{struct D3D11_SO_DECLARATION_ENTRY { + Stream: UINT, + SemanticName: LPCSTR, + SemanticIndex: UINT, + StartComponent: BYTE, + ComponentCount: BYTE, + OutputSlot: BYTE, +}} +STRUCT!{struct D3D11_VIEWPORT { + TopLeftX: FLOAT, + TopLeftY: FLOAT, + Width: FLOAT, + Height: FLOAT, + MinDepth: FLOAT, + MaxDepth: FLOAT, +}} +STRUCT!{struct D3D11_DRAW_INSTANCED_INDIRECT_ARGS { + VertexCountPerInstance: UINT, + InstanceCount: UINT, + StartVertexLocation: UINT, + StartInstanceLocation: UINT, +}} +STRUCT!{struct D3D11_DRAW_INDEXED_INSTANCED_INDIRECT_ARGS { + IndexCountPerInstance: UINT, + InstanceCount: UINT, + StartIndexLocation: UINT, + BaseVertexLocation: INT, + StartInstanceLocation: UINT, +}} +ENUM!{enum D3D11_RESOURCE_DIMENSION { + D3D11_RESOURCE_DIMENSION_UNKNOWN = 0, + D3D11_RESOURCE_DIMENSION_BUFFER = 1, + D3D11_RESOURCE_DIMENSION_TEXTURE1D = 2, + D3D11_RESOURCE_DIMENSION_TEXTURE2D = 3, + D3D11_RESOURCE_DIMENSION_TEXTURE3D = 4, +}} +pub type D3D11_SRV_DIMENSION = D3D_SRV_DIMENSION; +ENUM!{enum D3D11_DSV_DIMENSION { + D3D11_DSV_DIMENSION_UNKNOWN = 0, + D3D11_DSV_DIMENSION_TEXTURE1D = 1, + D3D11_DSV_DIMENSION_TEXTURE1DARRAY = 2, + D3D11_DSV_DIMENSION_TEXTURE2D = 3, + D3D11_DSV_DIMENSION_TEXTURE2DARRAY = 4, + D3D11_DSV_DIMENSION_TEXTURE2DMS = 5, + D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY = 6, +}} +ENUM!{enum D3D11_RTV_DIMENSION { + D3D11_RTV_DIMENSION_UNKNOWN = 0, + D3D11_RTV_DIMENSION_BUFFER = 1, + D3D11_RTV_DIMENSION_TEXTURE1D = 2, + D3D11_RTV_DIMENSION_TEXTURE1DARRAY = 3, + D3D11_RTV_DIMENSION_TEXTURE2D = 4, + D3D11_RTV_DIMENSION_TEXTURE2DARRAY = 5, + D3D11_RTV_DIMENSION_TEXTURE2DMS = 6, + D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D11_RTV_DIMENSION_TEXTURE3D = 8, +}} +ENUM!{enum D3D11_UAV_DIMENSION { + D3D11_UAV_DIMENSION_UNKNOWN = 0, + D3D11_UAV_DIMENSION_BUFFER = 1, + D3D11_UAV_DIMENSION_TEXTURE1D = 2, + D3D11_UAV_DIMENSION_TEXTURE1DARRAY = 3, + D3D11_UAV_DIMENSION_TEXTURE2D = 4, + D3D11_UAV_DIMENSION_TEXTURE2DARRAY = 5, + D3D11_UAV_DIMENSION_TEXTURE3D = 8, +}} +ENUM!{enum D3D11_USAGE { + D3D11_USAGE_DEFAULT = 0, + D3D11_USAGE_IMMUTABLE = 1, + D3D11_USAGE_DYNAMIC = 2, + D3D11_USAGE_STAGING = 3, +}} +ENUM!{enum D3D11_BIND_FLAG { + D3D11_BIND_VERTEX_BUFFER = 0x1, + D3D11_BIND_INDEX_BUFFER = 0x2, + D3D11_BIND_CONSTANT_BUFFER = 0x4, + D3D11_BIND_SHADER_RESOURCE = 0x8, + D3D11_BIND_STREAM_OUTPUT = 0x10, + D3D11_BIND_RENDER_TARGET = 0x20, + D3D11_BIND_DEPTH_STENCIL = 0x40, + D3D11_BIND_UNORDERED_ACCESS = 0x80, + D3D11_BIND_DECODER = 0x200, + D3D11_BIND_VIDEO_ENCODER = 0x400, +}} +ENUM!{enum D3D11_CPU_ACCESS_FLAG { + D3D11_CPU_ACCESS_WRITE = 0x10000, + D3D11_CPU_ACCESS_READ = 0x20000, +}} +ENUM!{enum D3D11_RESOURCE_MISC_FLAG { + D3D11_RESOURCE_MISC_GENERATE_MIPS = 0x1, + D3D11_RESOURCE_MISC_SHARED = 0x2, + D3D11_RESOURCE_MISC_TEXTURECUBE = 0x4, + D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x10, + D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x20, + D3D11_RESOURCE_MISC_BUFFER_STRUCTURED = 0x40, + D3D11_RESOURCE_MISC_RESOURCE_CLAMP = 0x80, + D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x100, + D3D11_RESOURCE_MISC_GDI_COMPATIBLE = 0x200, + D3D11_RESOURCE_MISC_SHARED_NTHANDLE = 0x800, + D3D11_RESOURCE_MISC_RESTRICTED_CONTENT = 0x1000, + D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE = 0x2000, + D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER = 0x4000, + D3D11_RESOURCE_MISC_GUARDED = 0x8000, + D3D11_RESOURCE_MISC_TILE_POOL = 0x20000, + D3D11_RESOURCE_MISC_TILED = 0x40000, + D3D11_RESOURCE_MISC_HW_PROTECTED = 0x80000, +}} +ENUM!{enum D3D11_MAP { + D3D11_MAP_READ = 1, + D3D11_MAP_WRITE = 2, + D3D11_MAP_READ_WRITE = 3, + D3D11_MAP_WRITE_DISCARD = 4, + D3D11_MAP_WRITE_NO_OVERWRITE = 5, +}} +ENUM!{enum D3D11_MAP_FLAG { + D3D11_MAP_FLAG_DO_NOT_WAIT = 0x100000, +}} +ENUM!{enum D3D11_RAISE_FLAG { + D3D11_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1, +}} +ENUM!{enum D3D11_CLEAR_FLAG { + D3D11_CLEAR_DEPTH = 0x1, + D3D11_CLEAR_STENCIL = 0x2, +}} +pub type D3D11_RECT = RECT; +STRUCT!{struct D3D11_BOX { + left: UINT, + top: UINT, + front: UINT, + right: UINT, + bottom: UINT, + back: UINT, +}} +RIDL!{#[uuid(0x1841e5c8, 0x16b0, 0x489b, 0xbc, 0xc8, 0x44, 0xcf, 0xb0, 0xd5, 0xde, 0xae)] +interface ID3D11DeviceChild(ID3D11DeviceChildVtbl): IUnknown(IUnknownVtbl) { + fn GetDevice( + ppDevice: *mut *mut ID3D11Device, + ) -> (), + fn GetPrivateData( + guid: REFGUID, + pDataSize: *mut UINT, + pData: *mut c_void, + ) -> HRESULT, + fn SetPrivateData( + guid: REFGUID, + DataSize: UINT, + pData: *const c_void, + ) -> HRESULT, + fn SetPrivateDataInterface( + guid: REFGUID, + pData: *const IUnknown, + ) -> HRESULT, +}} +ENUM!{enum D3D11_COMPARISON_FUNC { + D3D11_COMPARISON_NEVER = 1, + D3D11_COMPARISON_LESS = 2, + D3D11_COMPARISON_EQUAL = 3, + D3D11_COMPARISON_LESS_EQUAL = 4, + D3D11_COMPARISON_GREATER = 5, + D3D11_COMPARISON_NOT_EQUAL = 6, + D3D11_COMPARISON_GREATER_EQUAL = 7, + D3D11_COMPARISON_ALWAYS = 8, +}} +ENUM!{enum D3D11_DEPTH_WRITE_MASK { + D3D11_DEPTH_WRITE_MASK_ZERO = 0, + D3D11_DEPTH_WRITE_MASK_ALL = 1, +}} +ENUM!{enum D3D11_STENCIL_OP { + D3D11_STENCIL_OP_KEEP = 1, + D3D11_STENCIL_OP_ZERO = 2, + D3D11_STENCIL_OP_REPLACE = 3, + D3D11_STENCIL_OP_INCR_SAT = 4, + D3D11_STENCIL_OP_DECR_SAT = 5, + D3D11_STENCIL_OP_INVERT = 6, + D3D11_STENCIL_OP_INCR = 7, + D3D11_STENCIL_OP_DECR = 8, +}} +STRUCT!{struct D3D11_DEPTH_STENCILOP_DESC { + StencilFailOp: D3D11_STENCIL_OP, + StencilDepthFailOp: D3D11_STENCIL_OP, + StencilPassOp: D3D11_STENCIL_OP, + StencilFunc: D3D11_COMPARISON_FUNC, +}} +STRUCT!{struct D3D11_DEPTH_STENCIL_DESC { + DepthEnable: BOOL, + DepthWriteMask: D3D11_DEPTH_WRITE_MASK, + DepthFunc: D3D11_COMPARISON_FUNC, + StencilEnable: BOOL, + StencilReadMask: UINT8, + StencilWriteMask: UINT8, + FrontFace: D3D11_DEPTH_STENCILOP_DESC, + BackFace: D3D11_DEPTH_STENCILOP_DESC, +}} +RIDL!{#[uuid(0x03823efb, 0x8d8f, 0x4e1c, 0x9a, 0xa2, 0xf6, 0x4b, 0xb2, 0xcb, 0xfd, 0xf1)] +interface ID3D11DepthStencilState(ID3D11DepthStencilStateVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetDesc( + pDesc: *mut D3D11_DEPTH_STENCIL_DESC, + ) -> (), +}} +ENUM!{enum D3D11_BLEND { + D3D11_BLEND_ZERO = 1, + D3D11_BLEND_ONE = 2, + D3D11_BLEND_SRC_COLOR = 3, + D3D11_BLEND_INV_SRC_COLOR = 4, + D3D11_BLEND_SRC_ALPHA = 5, + D3D11_BLEND_INV_SRC_ALPHA = 6, + D3D11_BLEND_DEST_ALPHA = 7, + D3D11_BLEND_INV_DEST_ALPHA = 8, + D3D11_BLEND_DEST_COLOR = 9, + D3D11_BLEND_INV_DEST_COLOR = 10, + D3D11_BLEND_SRC_ALPHA_SAT = 11, + D3D11_BLEND_BLEND_FACTOR = 14, + D3D11_BLEND_INV_BLEND_FACTOR = 15, + D3D11_BLEND_SRC1_COLOR = 16, + D3D11_BLEND_INV_SRC1_COLOR = 17, + D3D11_BLEND_SRC1_ALPHA = 18, + D3D11_BLEND_INV_SRC1_ALPHA = 19, +}} +ENUM!{enum D3D11_BLEND_OP { + D3D11_BLEND_OP_ADD = 1, + D3D11_BLEND_OP_SUBTRACT = 2, + D3D11_BLEND_OP_REV_SUBTRACT = 3, + D3D11_BLEND_OP_MIN = 4, + D3D11_BLEND_OP_MAX = 5, +}} +ENUM!{enum D3D11_COLOR_WRITE_ENABLE { + D3D11_COLOR_WRITE_ENABLE_RED = 1, + D3D11_COLOR_WRITE_ENABLE_GREEN = 2, + D3D11_COLOR_WRITE_ENABLE_BLUE = 4, + D3D11_COLOR_WRITE_ENABLE_ALPHA = 8, + D3D11_COLOR_WRITE_ENABLE_ALL = D3D11_COLOR_WRITE_ENABLE_RED | D3D11_COLOR_WRITE_ENABLE_GREEN + | D3D11_COLOR_WRITE_ENABLE_BLUE | D3D11_COLOR_WRITE_ENABLE_ALPHA, +}} +STRUCT!{struct D3D11_RENDER_TARGET_BLEND_DESC { + BlendEnable: BOOL, + SrcBlend: D3D11_BLEND, + DestBlend: D3D11_BLEND, + BlendOp: D3D11_BLEND_OP, + SrcBlendAlpha: D3D11_BLEND, + DestBlendAlpha: D3D11_BLEND, + BlendOpAlpha: D3D11_BLEND_OP, + RenderTargetWriteMask: UINT8, +}} +STRUCT!{struct D3D11_BLEND_DESC { + AlphaToCoverageEnable: BOOL, + IndependentBlendEnable: BOOL, + RenderTarget: [D3D11_RENDER_TARGET_BLEND_DESC; 8], +}} +RIDL!{#[uuid(0x75b68faa, 0x347d, 0x4159, 0x8f, 0x45, 0xa0, 0x64, 0x0f, 0x01, 0xcd, 0x9a)] +interface ID3D11BlendState(ID3D11BlendStateVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetDesc( + pDesc: *mut D3D11_BLEND_DESC, + ) -> (), +}} +STRUCT!{struct D3D11_RASTERIZER_DESC { + FillMode: D3D11_FILL_MODE, + CullMode: D3D11_CULL_MODE, + FrontCounterClockwise: BOOL, + DepthBias: INT, + DepthBiasClamp: FLOAT, + SlopeScaledDepthBias: FLOAT, + DepthClipEnable: BOOL, + ScissorEnable: BOOL, + MultisampleEnable: BOOL, + AntialiasedLineEnable: BOOL, +}} +RIDL!{#[uuid(0x9bb4ab81, 0xab1a, 0x4d8f, 0xb5, 0x06, 0xfc, 0x04, 0x20, 0x0b, 0x6e, 0xe7)] +interface ID3D11RasterizerState(ID3D11RasterizerStateVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetDesc( + pDesc: *mut D3D11_RASTERIZER_DESC, + ) -> (), +}} +STRUCT!{struct D3D11_SUBRESOURCE_DATA { + pSysMem: *const c_void, + SysMemPitch: UINT, + SysMemSlicePitch: UINT, +}} +STRUCT!{struct D3D11_MAPPED_SUBRESOURCE { + pData: *mut c_void, + RowPitch: UINT, + DepthPitch: UINT, +}} +RIDL!{#[uuid(0xdc8e63f3, 0xd12b, 0x4952, 0xb4, 0x7b, 0x5e, 0x45, 0x02, 0x6a, 0x86, 0x2d)] +interface ID3D11Resource(ID3D11ResourceVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetType( + pResourceDimension: *mut D3D11_RESOURCE_DIMENSION, + ) -> (), + fn SetEvictionPriority( + EvictionPriority: UINT, + ) -> (), + fn GetEvictionPriority() -> UINT, +}} +STRUCT!{struct D3D11_BUFFER_DESC { + ByteWidth: UINT, + Usage: D3D11_USAGE, + BindFlags: UINT, + CPUAccessFlags: UINT, + MiscFlags: UINT, + StructureByteStride: UINT, +}} +RIDL!{#[uuid(0x48570b85, 0xd1ee, 0x4fcd, 0xa2, 0x50, 0xeb, 0x35, 0x07, 0x22, 0xb0, 0x37)] +interface ID3D11Buffer(ID3D11BufferVtbl): ID3D11Resource(ID3D11ResourceVtbl) { + fn GetDesc( + pDesc: *mut D3D11_BUFFER_DESC, + ) -> (), +}} +STRUCT!{struct D3D11_TEXTURE1D_DESC { + Width: UINT, + MipLevels: UINT, + ArraySize: UINT, + Format: DXGI_FORMAT, + Usage: D3D11_USAGE, + BindFlags: UINT, + CPUAccessFlags: UINT, + MiscFlags: UINT, +}} +RIDL!{#[uuid(0xf8fb5c27, 0xc6b3, 0x4f75, 0xa4, 0xc8, 0x43, 0x9a, 0xf2, 0xef, 0x56, 0x4c)] +interface ID3D11Texture1D(ID3D11Texture1DVtbl): ID3D11Resource(ID3D11ResourceVtbl) { + fn GetDesc( + pDesc: *mut D3D11_TEXTURE1D_DESC, + ) -> (), +}} +STRUCT!{struct D3D11_TEXTURE2D_DESC { + Width: UINT, + Height: UINT, + MipLevels: UINT, + ArraySize: UINT, + Format: DXGI_FORMAT, + SampleDesc: DXGI_SAMPLE_DESC, + Usage: D3D11_USAGE, + BindFlags: UINT, + CPUAccessFlags: UINT, + MiscFlags: UINT, +}} +RIDL!{#[uuid(0x6f15aaf2, 0xd208, 0x4e89, 0x9a, 0xb4, 0x48, 0x95, 0x35, 0xd3, 0x4f, 0x9c)] +interface ID3D11Texture2D(ID3D11Texture2DVtbl): ID3D11Resource(ID3D11ResourceVtbl) { + fn GetDesc( + pDesc: *mut D3D11_TEXTURE2D_DESC, + ) -> (), +}} +STRUCT!{struct D3D11_TEXTURE3D_DESC { + Width: UINT, + Height: UINT, + Depth: UINT, + MipLevels: UINT, + Format: DXGI_FORMAT, + Usage: D3D11_USAGE, + BindFlags: UINT, + CPUAccessFlags: UINT, + MiscFlags: UINT, +}} +RIDL!{#[uuid(0x037e866e, 0xf56d, 0x4357, 0xa8, 0xaf, 0x9d, 0xab, 0xbe, 0x6e, 0x25, 0x0e)] +interface ID3D11Texture3D(ID3D11Texture3DVtbl): ID3D11Resource(ID3D11ResourceVtbl) { + fn GetDesc( + pDesc: *mut D3D11_TEXTURE3D_DESC, + ) -> (), +}} +ENUM!{enum D3D11_TEXTURECUBE_FACE { + D3D11_TEXTURECUBE_FACE_POSITIVE_X = 0, + D3D11_TEXTURECUBE_FACE_NEGATIVE_X = 1, + D3D11_TEXTURECUBE_FACE_POSITIVE_Y = 2, + D3D11_TEXTURECUBE_FACE_NEGATIVE_Y = 3, + D3D11_TEXTURECUBE_FACE_POSITIVE_Z = 4, + D3D11_TEXTURECUBE_FACE_NEGATIVE_Z = 5, +}} +RIDL!{#[uuid(0x839d1216, 0xbb2e, 0x412b, 0xb7, 0xf4, 0xa9, 0xdb, 0xeb, 0xe0, 0x8e, 0xd1)] +interface ID3D11View(ID3D11ViewVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetResource( + ppResource: *mut *mut ID3D11Resource, + ) -> (), +}} +UNION!{union D3D11_BUFFER_SRV_u1 { + [u32; 1], + FirstElement FirstElement_mut: UINT, + ElementOffset ElementOffset_mut: UINT, +}} +UNION!{union D3D11_BUFFER_SRV_u2 { + [u32; 1], + NumElements NumElements_mut: UINT, + ElementWidth ElementWidth_mut: UINT, +}} +STRUCT!{struct D3D11_BUFFER_SRV { + u1: D3D11_BUFFER_SRV_u1, + u2: D3D11_BUFFER_SRV_u2, +}} +ENUM!{enum D3D11_BUFFEREX_SRV_FLAG { + D3D11_BUFFEREX_SRV_FLAG_RAW = 0x1, +}} +STRUCT!{struct D3D11_BUFFEREX_SRV { + FirstElement: UINT, + NumElements: UINT, + Flags: UINT, +}} +STRUCT!{struct D3D11_TEX1D_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, +}} +STRUCT!{struct D3D11_TEX1D_ARRAY_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D11_TEX2D_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, +}} +STRUCT!{struct D3D11_TEX2D_ARRAY_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D11_TEX3D_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, +}} +STRUCT!{struct D3D11_TEXCUBE_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, +}} +STRUCT!{struct D3D11_TEXCUBE_ARRAY_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, + First2DArrayFace: UINT, + NumCubes: UINT, +}} +STRUCT!{struct D3D11_TEX2DMS_SRV { + UnusedField_NothingToDefine: UINT, +}} +STRUCT!{struct D3D11_TEX2DMS_ARRAY_SRV { + FirstArraySlice: UINT, + ArraySize: UINT, +}} +UNION!{union D3D11_SHADER_RESOURCE_VIEW_DESC_u { + [u32; 4], + Buffer Buffer_mut: D3D11_BUFFER_SRV, + Texture1D Texture1D_mut: D3D11_TEX1D_SRV, + Texture1DArray Texture1DArray_mut: D3D11_TEX1D_ARRAY_SRV, + Texture2D Texture2D_mut: D3D11_TEX2D_SRV, + Texture2DArray Texture2DArray_mut: D3D11_TEX2D_ARRAY_SRV, + Texture2DMS Texture2DMS_mut: D3D11_TEX2DMS_SRV, + Texture2DMSArray Texture2DMSArray_mut: D3D11_TEX2DMS_ARRAY_SRV, + Texture3D Texture3D_mut: D3D11_TEX3D_SRV, + TextureCube TextureCube_mut: D3D11_TEXCUBE_SRV, + TextureCubeArray TextureCubeArray_mut: D3D11_TEXCUBE_ARRAY_SRV, + BufferEx BufferEx_mut: D3D11_BUFFEREX_SRV, +}} +STRUCT!{struct D3D11_SHADER_RESOURCE_VIEW_DESC { + Format: DXGI_FORMAT, + ViewDimension: D3D11_SRV_DIMENSION, + u: D3D11_SHADER_RESOURCE_VIEW_DESC_u, +}} +RIDL!{#[uuid(0xb0e06fe0, 0x8192, 0x4e1a, 0xb1, 0xca, 0x36, 0xd7, 0x41, 0x47, 0x10, 0xb2)] +interface ID3D11ShaderResourceView(ID3D11ShaderResourceViewVtbl): ID3D11View(ID3D11ViewVtbl) { + fn GetDesc( + pDesc: *mut D3D11_SHADER_RESOURCE_VIEW_DESC, + ) -> (), +}} +UNION!{union D3D11_BUFFER_RTV_u1 { + [u32; 1], + FirstElement FirstElement_mut: UINT, + ElementOffset ElementOffset_mut: UINT, +}} +UNION!{union D3D11_BUFFER_RTV_u2 { + [u32; 1], + NumElements NumElements_mut: UINT, + ElementWidth ElementWidth_mut: UINT, +}} +STRUCT!{struct D3D11_BUFFER_RTV { + u1: D3D11_BUFFER_RTV_u1, + u2: D3D11_BUFFER_RTV_u2, +}} +STRUCT!{struct D3D11_TEX1D_RTV { + MipSlice: UINT, +}} +STRUCT!{struct D3D11_TEX1D_ARRAY_RTV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D11_TEX2D_RTV { + MipSlice: UINT, +}} +STRUCT!{struct D3D11_TEX2DMS_RTV { + UnusedField_NothingToDefine: UINT, +}} +STRUCT!{struct D3D11_TEX2D_ARRAY_RTV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D11_TEX2DMS_ARRAY_RTV { + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D11_TEX3D_RTV { + MipSlice: UINT, + FirstWSlice: UINT, + WSize: UINT, +}} +UNION!{union D3D11_RENDER_TARGET_VIEW_DESC_u { + [u32; 3], + Buffer Buffer_mut: D3D11_BUFFER_RTV, + Texture1D Texture1D_mut: D3D11_TEX1D_RTV, + Texture1DArray Texture1DArray_mut: D3D11_TEX1D_ARRAY_RTV, + Texture2D Texture2D_mut: D3D11_TEX2D_RTV, + Texture2DArray Texture2DArray_mut: D3D11_TEX2D_ARRAY_RTV, + Texture2DMS Texture2DMS_mut: D3D11_TEX2DMS_RTV, + Texture2DMSArray Texture2DMSArray_mut: D3D11_TEX2DMS_ARRAY_RTV, + Texture3D Texture3D_mut: D3D11_TEX3D_RTV, +}} +STRUCT!{struct D3D11_RENDER_TARGET_VIEW_DESC { + Format: DXGI_FORMAT, + ViewDimension: D3D11_RTV_DIMENSION, + u: D3D11_RENDER_TARGET_VIEW_DESC_u, +}} +RIDL!{#[uuid(0xdfdba067, 0x0b8d, 0x4865, 0x87, 0x5b, 0xd7, 0xb4, 0x51, 0x6c, 0xc1, 0x64)] +interface ID3D11RenderTargetView(ID3D11RenderTargetViewVtbl): ID3D11View(ID3D11ViewVtbl) { + fn GetDesc( + pDesc: *mut D3D11_RENDER_TARGET_VIEW_DESC, + ) -> (), +}} +STRUCT!{struct D3D11_TEX1D_DSV { + MipSlice: UINT, +}} +STRUCT!{struct D3D11_TEX1D_ARRAY_DSV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D11_TEX2D_DSV { + MipSlice: UINT, +}} +STRUCT!{struct D3D11_TEX2D_ARRAY_DSV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D11_TEX2DMS_DSV { + UnusedField_NothingToDefine: UINT, +}} +STRUCT!{struct D3D11_TEX2DMS_ARRAY_DSV { + FirstArraySlice: UINT, + ArraySize: UINT, +}} +ENUM!{enum D3D11_DSV_FLAG { + D3D11_DSV_READ_ONLY_DEPTH = 0x1, + D3D11_DSV_READ_ONLY_STENCIL = 0x2, +}} +UNION!{union D3D11_DEPTH_STENCIL_VIEW_DESC_u { + [u32; 3], + Texture1D Texture1D_mut: D3D11_TEX1D_DSV, + Texture1DArray Texture1DArray_mut: D3D11_TEX1D_ARRAY_DSV, + Texture2D Texture2D_mut: D3D11_TEX2D_DSV, + Texture2DArray Texture2DArray_mut: D3D11_TEX2D_ARRAY_DSV, + Texture2DMS Texture2DMS_mut: D3D11_TEX2DMS_DSV, + Texture2DMSArray Texture2DMSArray_mut: D3D11_TEX2DMS_ARRAY_DSV, +}} +STRUCT!{struct D3D11_DEPTH_STENCIL_VIEW_DESC { + Format: DXGI_FORMAT, + ViewDimension: D3D11_DSV_DIMENSION, + Flags: UINT, + u: D3D11_DEPTH_STENCIL_VIEW_DESC_u, +}} +RIDL!{#[uuid(0x9fdac92a, 0x1876, 0x48c3, 0xaf, 0xad, 0x25, 0xb9, 0x4f, 0x84, 0xa9, 0xb6)] +interface ID3D11DepthStencilView(ID3D11DepthStencilViewVtbl): ID3D11View(ID3D11ViewVtbl) { + fn GetDesc( + pDesc: *mut D3D11_DEPTH_STENCIL_VIEW_DESC, + ) -> (), +}} +ENUM!{enum D3D11_BUFFER_UAV_FLAG { + D3D11_BUFFER_UAV_FLAG_RAW = 0x1, + D3D11_BUFFER_UAV_FLAG_APPEND = 0x2, + D3D11_BUFFER_UAV_FLAG_COUNTER = 0x4, +}} +STRUCT!{struct D3D11_BUFFER_UAV { + FirstElement: UINT, + NumElements: UINT, + Flags: UINT, +}} +STRUCT!{struct D3D11_TEX1D_UAV { + MipSlice: UINT, +}} +STRUCT!{struct D3D11_TEX1D_ARRAY_UAV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D11_TEX2D_UAV { + MipSlice: UINT, +}} +STRUCT!{struct D3D11_TEX2D_ARRAY_UAV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D11_TEX3D_UAV { + MipSlice: UINT, + FirstWSlice: UINT, + WSize: UINT, +}} +UNION!{union D3D11_UNORDERED_ACCESS_VIEW_DESC_u { + [u32; 3], + Buffer Buffer_mut: D3D11_BUFFER_UAV, + Texture1D Texture1D_mut: D3D11_TEX1D_UAV, + Texture1DArray Texture1DArray_mut: D3D11_TEX1D_ARRAY_UAV, + Texture2D Texture2D_mut: D3D11_TEX2D_UAV, + Texture2DArray Texture2DArray_mut: D3D11_TEX2D_ARRAY_UAV, + Texture3D Texture3D_mut: D3D11_TEX3D_UAV, +}} +STRUCT!{struct D3D11_UNORDERED_ACCESS_VIEW_DESC { + Format: DXGI_FORMAT, + ViewDimension: D3D11_UAV_DIMENSION, + u: D3D11_UNORDERED_ACCESS_VIEW_DESC_u, +}} +RIDL!{#[uuid(0x28acf509, 0x7f5c, 0x48f6, 0x86, 0x11, 0xf3, 0x16, 0x01, 0x0a, 0x63, 0x80)] +interface ID3D11UnorderedAccessView(ID3D11UnorderedAccessViewVtbl): ID3D11View(ID3D11ViewVtbl) { + fn GetDesc( + pDesc: *mut D3D11_UNORDERED_ACCESS_VIEW_DESC, + ) -> (), +}} +RIDL!{#[uuid(0x3b301d64, 0xd678, 0x4289, 0x88, 0x97, 0x22, 0xf8, 0x92, 0x8b, 0x72, 0xf3)] +interface ID3D11VertexShader(ID3D11VertexShaderVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) {}} +RIDL!{#[uuid(0x8e5c6061, 0x628a, 0x4c8e, 0x82, 0x64, 0xbb, 0xe4, 0x5c, 0xb3, 0xd5, 0xdd)] +interface ID3D11HullShader(ID3D11HullShaderVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) {}} +RIDL!{#[uuid(0xf582c508, 0x0f36, 0x490c, 0x99, 0x77, 0x31, 0xee, 0xce, 0x26, 0x8c, 0xfa)] +interface ID3D11DomainShader(ID3D11DomainShaderVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) {}} +RIDL!{#[uuid(0x38325b96, 0xeffb, 0x4022, 0xba, 0x02, 0x2e, 0x79, 0x5b, 0x70, 0x27, 0x5c)] +interface ID3D11GeometryShader(ID3D11GeometryShaderVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) {}} +RIDL!{#[uuid(0xea82e40d, 0x51dc, 0x4f33, 0x93, 0xd4, 0xdb, 0x7c, 0x91, 0x25, 0xae, 0x8c)] +interface ID3D11PixelShader(ID3D11PixelShaderVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) {}} +RIDL!{#[uuid(0x4f5b196e, 0xc2bd, 0x495e, 0xbd, 0x01, 0x1f, 0xde, 0xd3, 0x8e, 0x49, 0x69)] +interface ID3D11ComputeShader(ID3D11ComputeShaderVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) {}} +RIDL!{#[uuid(0xe4819ddc, 0x4cf0, 0x4025, 0xbd, 0x26, 0x5d, 0xe8, 0x2a, 0x3e, 0x07, 0xb7)] +interface ID3D11InputLayout(ID3D11InputLayoutVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) {}} +ENUM!{enum D3D11_FILTER { + D3D11_FILTER_MIN_MAG_MIP_POINT = 0, + D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1, + D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4, + D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5, + D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, + D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, + D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, + D3D11_FILTER_MIN_MAG_MIP_LINEAR = 0x15, + D3D11_FILTER_ANISOTROPIC = 0x55, + D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, + D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, + D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84, + D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85, + D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90, + D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91, + D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94, + D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95, + D3D11_FILTER_COMPARISON_ANISOTROPIC = 0xd5, + D3D11_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100, + D3D11_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101, + D3D11_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x104, + D3D11_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x105, + D3D11_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x110, + D3D11_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111, + D3D11_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114, + D3D11_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115, + D3D11_FILTER_MINIMUM_ANISOTROPIC = 0x155, + D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180, + D3D11_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181, + D3D11_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x184, + D3D11_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x185, + D3D11_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x190, + D3D11_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191, + D3D11_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194, + D3D11_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195, + D3D11_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5, +}} +ENUM!{enum D3D11_FILTER_TYPE { + D3D11_FILTER_TYPE_POINT = 0, + D3D11_FILTER_TYPE_LINEAR = 1, +}} +ENUM!{enum D3D11_FILTER_REDUCTION_TYPE { + D3D11_FILTER_REDUCTION_TYPE_STANDARD = 0, + D3D11_FILTER_REDUCTION_TYPE_COMPARISON = 1, + D3D11_FILTER_REDUCTION_TYPE_MINIMUM = 2, + D3D11_FILTER_REDUCTION_TYPE_MAXIMUM = 3, +}} +pub const D3D11_FILTER_REDUCTION_TYPE_MASK: DWORD = 0x3; +pub const D3D11_FILTER_REDUCTION_TYPE_SHIFT: DWORD = 7; +pub const D3D11_FILTER_TYPE_MASK: DWORD = 0x3; +pub const D3D11_MIN_FILTER_SHIFT: DWORD = 4; +pub const D3D11_MAG_FILTER_SHIFT: DWORD = 2; +pub const D3D11_MIP_FILTER_SHIFT: DWORD = 0; +pub const D3D11_COMPARISON_FILTERING_BIT: DWORD = 0x80; +pub const D3D11_ANISOTROPIC_FILTERING_BIT: DWORD = 0x40; +ENUM!{enum D3D11_TEXTURE_ADDRESS_MODE { + D3D11_TEXTURE_ADDRESS_WRAP = 1, + D3D11_TEXTURE_ADDRESS_MIRROR = 2, + D3D11_TEXTURE_ADDRESS_CLAMP = 3, + D3D11_TEXTURE_ADDRESS_BORDER = 4, + D3D11_TEXTURE_ADDRESS_MIRROR_ONCE = 5, +}} +STRUCT!{struct D3D11_SAMPLER_DESC { + Filter: D3D11_FILTER, + AddressU: D3D11_TEXTURE_ADDRESS_MODE, + AddressV: D3D11_TEXTURE_ADDRESS_MODE, + AddressW: D3D11_TEXTURE_ADDRESS_MODE, + MipLODBias: FLOAT, + MaxAnisotropy: UINT, + ComparisonFunc: D3D11_COMPARISON_FUNC, + BorderColor: [FLOAT; 4], + MinLOD: FLOAT, + MaxLOD: FLOAT, +}} +RIDL!{#[uuid(0xda6fea51, 0x564c, 0x4487, 0x98, 0x10, 0xf0, 0xd0, 0xf9, 0xb4, 0xe3, 0xa5)] +interface ID3D11SamplerState(ID3D11SamplerStateVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetDesc( + pDesc: *mut D3D11_SAMPLER_DESC, + ) -> (), +}} +ENUM!{enum D3D11_FORMAT_SUPPORT { + D3D11_FORMAT_SUPPORT_BUFFER = 0x1, + D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x2, + D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x4, + D3D11_FORMAT_SUPPORT_SO_BUFFER = 0x8, + D3D11_FORMAT_SUPPORT_TEXTURE1D = 0x10, + D3D11_FORMAT_SUPPORT_TEXTURE2D = 0x20, + D3D11_FORMAT_SUPPORT_TEXTURE3D = 0x40, + D3D11_FORMAT_SUPPORT_TEXTURECUBE = 0x80, + D3D11_FORMAT_SUPPORT_SHADER_LOAD = 0x100, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE = 0x200, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x400, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x800, + D3D11_FORMAT_SUPPORT_MIP = 0x1000, + D3D11_FORMAT_SUPPORT_MIP_AUTOGEN = 0x2000, + D3D11_FORMAT_SUPPORT_RENDER_TARGET = 0x4000, + D3D11_FORMAT_SUPPORT_BLENDABLE = 0x8000, + D3D11_FORMAT_SUPPORT_DEPTH_STENCIL = 0x10000, + D3D11_FORMAT_SUPPORT_CPU_LOCKABLE = 0x20000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x40000, + D3D11_FORMAT_SUPPORT_DISPLAY = 0x80000, + D3D11_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000, + D3D11_FORMAT_SUPPORT_SHADER_GATHER = 0x800000, + D3D11_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x1000000, + D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000, + D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON = 0x4000000, + D3D11_FORMAT_SUPPORT_DECODER_OUTPUT = 0x8000000, + D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT = 0x10000000, + D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT = 0x20000000, + D3D11_FORMAT_SUPPORT_VIDEO_ENCODER = 0x40000000, +}} +ENUM!{enum D3D11_FORMAT_SUPPORT2 { + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20, + D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40, + D3D11_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80, + D3D11_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x100, + D3D11_FORMAT_SUPPORT2_TILED = 0x200, + D3D11_FORMAT_SUPPORT2_SHAREABLE = 0x400, + D3D11_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000, +}} +RIDL!{#[uuid(0x4b35d0cd, 0x1e15, 0x4258, 0x9c, 0x98, 0x1b, 0x13, 0x33, 0xf6, 0xdd, 0x3b)] +interface ID3D11Asynchronous(ID3D11AsynchronousVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetDataSize() -> UINT, +}} +ENUM!{enum D3D11_ASYNC_GETDATA_FLAG { + D3D11_ASYNC_GETDATA_DONOTFLUSH = 0x1, +}} +ENUM!{enum D3D11_QUERY { + D3D11_QUERY_EVENT = 0, + D3D11_QUERY_OCCLUSION = D3D11_QUERY_EVENT + 1u32, + D3D11_QUERY_TIMESTAMP = D3D11_QUERY_OCCLUSION + 1u32, + D3D11_QUERY_TIMESTAMP_DISJOINT = D3D11_QUERY_TIMESTAMP + 1u32, + D3D11_QUERY_PIPELINE_STATISTICS = D3D11_QUERY_TIMESTAMP_DISJOINT + 1u32, + D3D11_QUERY_OCCLUSION_PREDICATE = D3D11_QUERY_PIPELINE_STATISTICS + 1u32, + D3D11_QUERY_SO_STATISTICS = D3D11_QUERY_OCCLUSION_PREDICATE + 1u32, + D3D11_QUERY_SO_OVERFLOW_PREDICATE = D3D11_QUERY_SO_STATISTICS + 1u32, + D3D11_QUERY_SO_STATISTICS_STREAM0 = D3D11_QUERY_SO_OVERFLOW_PREDICATE + 1u32, + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 = D3D11_QUERY_SO_STATISTICS_STREAM0 + 1u32, + D3D11_QUERY_SO_STATISTICS_STREAM1 = D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 + 1u32, + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 = D3D11_QUERY_SO_STATISTICS_STREAM1 + 1u32, + D3D11_QUERY_SO_STATISTICS_STREAM2 = D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 + 1u32, + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 = D3D11_QUERY_SO_STATISTICS_STREAM2 + 1u32, + D3D11_QUERY_SO_STATISTICS_STREAM3 = D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 + 1u32, + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3 = D3D11_QUERY_SO_STATISTICS_STREAM3 + 1u32, +}} +ENUM!{enum D3D11_QUERY_MISC_FLAG { + D3D11_QUERY_MISC_PREDICATEHINT = 0x1, +}} +STRUCT!{struct D3D11_QUERY_DESC { + Query: D3D11_QUERY, + MiscFlags: UINT, +}} +RIDL!{#[uuid(0xd6c00747, 0x87b7, 0x425e, 0xb8, 0x4d, 0x44, 0xd1, 0x08, 0x56, 0x0a, 0xfd)] +interface ID3D11Query(ID3D11QueryVtbl): ID3D11Asynchronous(ID3D11AsynchronousVtbl) { + fn GetDesc( + pDesc: *mut D3D11_QUERY_DESC, + ) -> (), +}} +RIDL!{#[uuid(0x9eb576dd, 0x9f77, 0x4d86, 0x81, 0xaa, 0x8b, 0xab, 0x5f, 0xe4, 0x90, 0xe2)] +interface ID3D11Predicate(ID3D11PredicateVtbl): ID3D11Query(ID3D11QueryVtbl) {}} +STRUCT!{struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT { + Frequency: UINT64, + Disjoint: BOOL, +}} +STRUCT!{struct D3D11_QUERY_DATA_PIPELINE_STATISTICS { + IAVertices: UINT64, + IAPrimitives: UINT64, + VSInvocations: UINT64, + GSInvocations: UINT64, + GSPrimitives: UINT64, + CInvocations: UINT64, + CPrimitives: UINT64, + PSInvocations: UINT64, + HSInvocations: UINT64, + DSInvocations: UINT64, + CSInvocations: UINT64, +}} +STRUCT!{struct D3D11_QUERY_DATA_SO_STATISTICS { + NumPrimitivesWritten: UINT64, + PrimitivesStorageNeeded: UINT64, +}} +ENUM!{enum D3D11_COUNTER { + D3D11_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000, +}} +ENUM!{enum D3D11_COUNTER_TYPE { + D3D11_COUNTER_TYPE_FLOAT32 = 0, + D3D11_COUNTER_TYPE_UINT16 = D3D11_COUNTER_TYPE_FLOAT32 + 1u32, + D3D11_COUNTER_TYPE_UINT32 = D3D11_COUNTER_TYPE_UINT16 + 1u32, + D3D11_COUNTER_TYPE_UINT64 = D3D11_COUNTER_TYPE_UINT32 + 1u32, +}} +STRUCT!{struct D3D11_COUNTER_DESC { + Counter: D3D11_COUNTER, + MiscFlags: UINT, +}} +STRUCT!{struct D3D11_COUNTER_INFO { + LastDeviceDependentCounter: D3D11_COUNTER, + NumSimultaneousCounters: UINT, + NumDetectableParallelUnits: UINT8, +}} +RIDL!{#[uuid(0x6e8c49fb, 0xa371, 0x4770, 0xb4, 0x40, 0x29, 0x08, 0x60, 0x22, 0xb7, 0x41)] +interface ID3D11Counter(ID3D11CounterVtbl): ID3D11Asynchronous(ID3D11AsynchronousVtbl) { + fn GetDesc( + pDesc: *mut D3D11_COUNTER_DESC, + ) -> (), +}} +ENUM!{enum D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS { + D3D11_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff, + D3D11_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe, +}} +ENUM!{enum D3D11_DEVICE_CONTEXT_TYPE { + D3D11_DEVICE_CONTEXT_IMMEDIATE = 0, + D3D11_DEVICE_CONTEXT_DEFERRED = D3D11_DEVICE_CONTEXT_IMMEDIATE + 1u32, +}} +STRUCT!{struct D3D11_CLASS_INSTANCE_DESC { + InstanceId: UINT, + InstanceIndex: UINT, + TypeId: UINT, + ConstantBuffer: UINT, + BaseConstantBufferOffset: UINT, + BaseTexture: UINT, + BaseSampler: UINT, + Created: BOOL, +}} +RIDL!{#[uuid(0xa6cd7faa, 0xb0b7, 0x4a2f, 0x94, 0x36, 0x86, 0x62, 0xa6, 0x57, 0x97, 0xcb)] +interface ID3D11ClassInstance(ID3D11ClassInstanceVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetClassLinkage( + ppLinkage: *mut *mut ID3D11ClassLinkage, + ) -> (), + fn GetDesc( + pDesc: *mut D3D11_CLASS_INSTANCE_DESC, + ) -> (), + fn GetInstanceName( + pInstanceName: LPSTR, + pBufferLength: *mut SIZE_T, + ) -> (), + fn GetTypeName( + pTypeName: LPSTR, + pBufferLength: *mut SIZE_T, + ) -> (), +}} +RIDL!{#[uuid(0xddf57cba, 0x9543, 0x46e4, 0xa1, 0x2b, 0xf2, 0x07, 0xa0, 0xfe, 0x7f, 0xed)] +interface ID3D11ClassLinkage(ID3D11ClassLinkageVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetClassInstance( + GetClassInstance: LPCSTR, + InstanceIndex: UINT, + ppInstance: *mut *mut ID3D11ClassInstance, + ) -> HRESULT, + fn CreateClassInstance( + pClassTypeName: LPCSTR, + ConstantBufferOffset: UINT, + ConstantVectorOffset: UINT, + TextureOffset: UINT, + SamplerOffset: UINT, + ppInstance: *mut *mut ID3D11ClassInstance, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa24bc4d1, 0x769e, 0x43f7, 0x80, 0x13, 0x98, 0xff, 0x56, 0x6c, 0x18, 0xe2)] +interface ID3D11CommandList(ID3D11CommandListVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetContextFlags() -> UINT, +}} +ENUM!{enum D3D11_FEATURE { + D3D11_FEATURE_THREADING = 0, + D3D11_FEATURE_DOUBLES = D3D11_FEATURE_THREADING + 1u32, + D3D11_FEATURE_FORMAT_SUPPORT = D3D11_FEATURE_DOUBLES + 1u32, + D3D11_FEATURE_FORMAT_SUPPORT2 = D3D11_FEATURE_FORMAT_SUPPORT + 1u32, + D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS = D3D11_FEATURE_FORMAT_SUPPORT2 + 1u32, + D3D11_FEATURE_D3D11_OPTIONS = D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS + 1u32, + D3D11_FEATURE_ARCHITECTURE_INFO = D3D11_FEATURE_D3D11_OPTIONS + 1u32, + D3D11_FEATURE_D3D9_OPTIONS = D3D11_FEATURE_ARCHITECTURE_INFO + 1u32, + D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT = D3D11_FEATURE_D3D9_OPTIONS + 1u32, + D3D11_FEATURE_D3D9_SHADOW_SUPPORT = D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT + 1u32, + D3D11_FEATURE_D3D11_OPTIONS1 = D3D11_FEATURE_D3D9_SHADOW_SUPPORT + 1u32, + D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT = D3D11_FEATURE_D3D11_OPTIONS1 + 1u32, + D3D11_FEATURE_MARKER_SUPPORT = D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT + 1u32, + D3D11_FEATURE_D3D9_OPTIONS1 = D3D11_FEATURE_MARKER_SUPPORT + 1u32, + D3D11_FEATURE_D3D11_OPTIONS2 = D3D11_FEATURE_D3D9_OPTIONS1 + 1u32, + D3D11_FEATURE_D3D11_OPTIONS3 = D3D11_FEATURE_D3D11_OPTIONS2 + 1u32, + D3D11_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = D3D11_FEATURE_D3D11_OPTIONS3 + 1u32, +}} +STRUCT!{struct D3D11_FEATURE_DATA_THREADING { + DriverConcurrentCreates: BOOL, + DriverCommandLists: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_DOUBLES { + DoublePrecisionFloatShaderOps: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_FORMAT_SUPPORT { + InFormat: DXGI_FORMAT, + OutFormatSupport: UINT, +}} +STRUCT!{struct D3D11_FEATURE_DATA_FORMAT_SUPPORT2 { + InFormat: DXGI_FORMAT, + OutFormatSupport2: UINT, +}} +STRUCT!{struct D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS { + ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_D3D11_OPTIONS { + OutputMergerLogicOp: BOOL, + UAVOnlyRenderingForcedSampleCount: BOOL, + DiscardAPIsSeenByDriver: BOOL, + FlagsForUpdateAndCopySeenByDriver: BOOL, + ClearView: BOOL, + CopyWithOverlap: BOOL, + ConstantBufferPartialUpdate: BOOL, + ConstantBufferOffsetting: BOOL, + MapNoOverwriteOnDynamicConstantBuffer: BOOL, + MapNoOverwriteOnDynamicBufferSRV: BOOL, + MultisampleRTVWithForcedSampleCountOne: BOOL, + SAD4ShaderInstructions: BOOL, + ExtendedDoublesShaderInstructions: BOOL, + ExtendedResourceSharing: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_ARCHITECTURE_INFO { + TileBasedDeferredRenderer: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_D3D9_OPTIONS { + FullNonPow2TextureSupport: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_D3D9_SHADOW_SUPPORT { + SupportsDepthAsTextureWithLessEqualComparisonFilter: BOOL, +}} +ENUM!{enum D3D11_SHADER_MIN_PRECISION_SUPPORT { + D3D11_SHADER_MIN_PRECISION_10_BIT = 0x1, + D3D11_SHADER_MIN_PRECISION_16_BIT = 0x2, +}} +STRUCT!{struct D3D11_FEATURE_DATA_SHADER_MIN_PRECISION_SUPPORT { + PixelShaderMinPrecision: UINT, + AllOtherShaderStagesMinPrecision: UINT, +}} +ENUM!{enum D3D11_TILED_RESOURCES_TIER { + D3D11_TILED_RESOURCES_NOT_SUPPORTED = 0, + D3D11_TILED_RESOURCES_TIER_1 = 1, + D3D11_TILED_RESOURCES_TIER_2 = 2, + D3D11_TILED_RESOURCES_TIER_3 = 3, +}} +STRUCT!{struct D3D11_FEATURE_DATA_D3D11_OPTIONS1 { + TiledResourcesTier: D3D11_TILED_RESOURCES_TIER, + MinMaxFiltering: BOOL, + ClearViewAlsoSupportsDepthOnlyFormats: BOOL, + MapOnDefaultBuffers: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_D3D9_SIMPLE_INSTANCING_SUPPORT { + SimpleInstancingSupported: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_MARKER_SUPPORT { + Profile: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_D3D9_OPTIONS1 { + FullNonPow2TextureSupported: BOOL, + DepthAsTextureWithLessEqualComparisonFilterSupported: BOOL, + SimpleInstancingSupported: BOOL, + TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported: BOOL, +}} +ENUM!{enum D3D11_CONSERVATIVE_RASTERIZATION_TIER { + D3D11_CONSERVATIVE_RASTERIZATION_NOT_SUPPORTED = 0, + D3D11_CONSERVATIVE_RASTERIZATION_TIER_1 = 1, + D3D11_CONSERVATIVE_RASTERIZATION_TIER_2 = 2, + D3D11_CONSERVATIVE_RASTERIZATION_TIER_3 = 3, +}} +STRUCT!{struct D3D11_FEATURE_DATA_D3D11_OPTIONS2 { + PSSpecifiedStencilRefSupported: BOOL, + TypedUAVLoadAdditionalFormats: BOOL, + ROVsSupported: BOOL, + ConservativeRasterizationTier: D3D11_CONSERVATIVE_RASTERIZATION_TIER, + TiledResourcesTier: D3D11_TILED_RESOURCES_TIER, + MapOnDefaultTextures: BOOL, + StandardSwizzle: BOOL, + UnifiedMemoryArchitecture: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_D3D11_OPTIONS3 { + VPAndRTArrayIndexFromAnyShaderFeedingRasterizer: BOOL, +}} +STRUCT!{struct D3D11_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT { + MaxGPUVirtualAddressBitsPerResource: UINT, + MaxGPUVirtualAddressBitsPerProcess: UINT, +}} +RIDL!{#[uuid(0xc0bfa96c, 0xe089, 0x44fb, 0x8e, 0xaf, 0x26, 0xf8, 0x79, 0x61, 0x90, 0xda)] +interface ID3D11DeviceContext(ID3D11DeviceContextVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn VSSetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + ) -> (), + fn PSSetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *const *mut ID3D11ShaderResourceView, + ) -> (), + fn PSSetShader( + pPixelShader: *mut ID3D11PixelShader, + ppClassInstances: *const *mut ID3D11ClassInstance, + NumClassInstances: UINT, + ) -> (), + fn PSSetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *const *mut ID3D11SamplerState, + ) -> (), + fn VSSetShader( + pVertexShader: *mut ID3D11VertexShader, + ppClassInstances: *const *mut ID3D11ClassInstance, + NumClassInstances: UINT, + ) -> (), + fn DrawIndexed( + IndexCount: UINT, + StartIndexLocation: UINT, + BaseVertexLocation: INT, + ) -> (), + fn Draw( + VertexCount: UINT, + StartVertexLocation: UINT, + ) -> (), + fn Map( + pResource: *mut ID3D11Resource, + Subresource: UINT, + MapType: D3D11_MAP, + MapFlags: UINT, + pMappedResource: *mut D3D11_MAPPED_SUBRESOURCE, + ) -> HRESULT, + fn Unmap( + pResource: *mut ID3D11Resource, + Subresource: UINT, + ) -> (), + fn PSSetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + ) -> (), + fn IASetInputLayout( + pInputLayout: *mut ID3D11InputLayout, + ) -> (), + fn IASetVertexBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppVertexBuffers: *const *mut ID3D11Buffer, + pStrides: *const UINT, + pOffsets: *const UINT, + ) -> (), + fn IASetIndexBuffer( + pIndexBuffer: *mut ID3D11Buffer, + Format: DXGI_FORMAT, + Offset: UINT, + ) -> (), + fn DrawIndexedInstanced( + IndexCountPerInstance: UINT, + InstanceCount: UINT, + StartIndexLocation: UINT, + BaseVertexLocation: INT, + StartInstanceLocation: UINT, + ) -> (), + fn DrawInstanced( + VertexCountPerInstance: UINT, + InstanceCount: UINT, + StartVertexLocation: UINT, + StartInstanceLocation: UINT, + ) -> (), + fn GSSetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + ) -> (), + fn GSSetShader( + pShader: *mut ID3D11GeometryShader, + ppClassInstances: *const *mut ID3D11ClassInstance, + NumClassInstances: UINT, + ) -> (), + fn IASetPrimitiveTopology( + Topology: D3D11_PRIMITIVE_TOPOLOGY, + ) -> (), + fn VSSetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *const *mut ID3D11ShaderResourceView, + ) -> (), + fn VSSetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *const *mut ID3D11SamplerState, + ) -> (), + fn Begin( + pAsync: *mut ID3D11Asynchronous, + ) -> (), + fn End( + pAsync: *mut ID3D11Asynchronous, + ) -> (), + fn GetData( + pAsync: *mut ID3D11Asynchronous, + pData: *mut c_void, + DataSize: UINT, + GetDataFlags: UINT, + ) -> HRESULT, + fn SetPredication( + pPredicate: *mut ID3D11Predicate, + PredicateValue: BOOL, + ) -> (), + fn GSSetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *const *mut ID3D11ShaderResourceView, + ) -> (), + fn GSSetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *const *mut ID3D11SamplerState, + ) -> (), + fn OMSetRenderTargets( + NumViews: UINT, + ppRenderTargetViews: *const *mut ID3D11RenderTargetView, + pDepthStencilView: *mut ID3D11DepthStencilView, + ) -> (), + fn OMSetRenderTargetsAndUnorderedAccessViews( + NumRTVs: UINT, + ppRenderTargetViews: *const *mut ID3D11RenderTargetView, + pDepthStencilView: *mut ID3D11DepthStencilView, + UAVStartSlot: UINT, + NumUAVs: UINT, + ppUnorderedAccessViews: *const *mut ID3D11UnorderedAccessView, + pUAVInitialCounts: *const UINT, + ) -> (), + fn OMSetBlendState( + pBlendState: *mut ID3D11BlendState, + BlendFactor: &[FLOAT; 4], + SampleMask: UINT, + ) -> (), + fn OMSetDepthStencilState( + pDepthStencilState: *mut ID3D11DepthStencilState, + StencilRef: UINT, + ) -> (), + fn SOSetTargets( + NumBuffers: UINT, + ppSOTargets: *const *mut ID3D11Buffer, + pOffsets: *const UINT, + ) -> (), + fn DrawAuto() -> (), + fn DrawIndexedInstancedIndirect( + pBufferForArgs: *mut ID3D11Buffer, + AlignedByteOffsetForArgs: UINT, + ) -> (), + fn DrawInstancedIndirect( + pBufferForArgs: *mut ID3D11Buffer, + AlignedByteOffsetForArgs: UINT, + ) -> (), + fn Dispatch( + ThreadGroupCountX: UINT, + ThreadGroupCountY: UINT, + ThreadGroupCountZ: UINT, + ) -> (), + fn DispatchIndirect( + pBufferForArgs: *mut ID3D11Buffer, + AlignedByteOffsetForArgs: UINT, + ) -> (), + fn RSSetState( + pRasterizerState: *mut ID3D11RasterizerState, + ) -> (), + fn RSSetViewports( + NumViewports: UINT, + pViewports: *const D3D11_VIEWPORT, + ) -> (), + fn RSSetScissorRects( + NumRects: UINT, + pRects: *const D3D11_RECT, + ) -> (), + fn CopySubresourceRegion( + pDstResource: *mut ID3D11Resource, + DstSubresource: UINT, + DstX: UINT, + DstY: UINT, + DstZ: UINT, + pSrcResource: *mut ID3D11Resource, + SrcSubresource: UINT, + pSrcBox: *const D3D11_BOX, + ) -> (), + fn CopyResource( + pDstResource: *mut ID3D11Resource, + pSrcResource: *mut ID3D11Resource, + ) -> (), + fn UpdateSubresource( + pDstResource: *mut ID3D11Resource, + DstSubresource: UINT, + pDstBox: *const D3D11_BOX, + pSrcData: *const c_void, + SrcRowPitch: UINT, + SrcDepthPitch: UINT, + ) -> (), + fn CopyStructureCount( + pDstBuffer: *mut ID3D11Buffer, + DstAlignedByteOffset: UINT, + pSrcView: *mut ID3D11UnorderedAccessView, + ) -> (), + fn ClearRenderTargetView( + pRenderTargetView: *mut ID3D11RenderTargetView, + ColorRGBA: &[FLOAT; 4], + ) -> (), + fn ClearUnorderedAccessViewUint( + pUnorderedAccessView: *mut ID3D11UnorderedAccessView, + Values: &[UINT; 4], + ) -> (), + fn ClearUnorderedAccessViewFloat( + pUnorderedAccessView: *mut ID3D11UnorderedAccessView, + Values: &[FLOAT; 4], + ) -> (), + fn ClearDepthStencilView( + pDepthStencilView: *mut ID3D11DepthStencilView, + ClearFlags: UINT, + Depth: FLOAT, + Stencil: UINT8, + ) -> (), + fn GenerateMips( + pShaderResourceView: *mut ID3D11ShaderResourceView, + ) -> (), + fn SetResourceMinLOD( + pResource: *mut ID3D11Resource, + MinLOD: FLOAT, + ) -> (), + fn GetResourceMinLOD( + pResource: *mut ID3D11Resource, + ) -> FLOAT, + fn ResolveSubresource( + pDstResource: *mut ID3D11Resource, + DstSubresource: UINT, + pSrcResource: *mut ID3D11Resource, + SrcSubresource: UINT, + Format: DXGI_FORMAT, + ) -> (), + fn ExecuteCommandList( + pCommandList: *mut ID3D11CommandList, + RestoreContextState: BOOL, + ) -> (), + fn HSSetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *const *mut ID3D11ShaderResourceView, + ) -> (), + fn HSSetShader( + pHullShader: *mut ID3D11HullShader, + ppClassInstances: *const *mut ID3D11ClassInstance, + NumClassInstances: UINT, + ) -> (), + fn HSSetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *const *mut ID3D11SamplerState, + ) -> (), + fn HSSetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + ) -> (), + fn DSSetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *const *mut ID3D11ShaderResourceView, + ) -> (), + fn DSSetShader( + pDomainShader: *mut ID3D11DomainShader, + ppClassInstances: *const *mut ID3D11ClassInstance, + NumClassInstances: UINT, + ) -> (), + fn DSSetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *const *mut ID3D11SamplerState, + ) -> (), + fn DSSetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + ) -> (), + fn CSSetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *const *mut ID3D11ShaderResourceView, + ) -> (), + fn CSSetUnorderedAccessViews( + StartSlot: UINT, + NumUAVs: UINT, + ppUnorderedAccessViews: *const *mut ID3D11UnorderedAccessView, + pUAVInitialCounts: *const UINT, + ) -> (), + fn CSSetShader( + pComputeShader: *mut ID3D11ComputeShader, + ppClassInstances: *const *mut ID3D11ClassInstance, + NumClassInstances: UINT, + ) -> (), + fn CSSetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *const *mut ID3D11SamplerState, + ) -> (), + fn CSSetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + ) -> (), + fn VSGetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + ) -> (), + fn PSGetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *mut *mut ID3D11ShaderResourceView, + ) -> (), + fn PSGetShader( + ppPixelShader: *mut *mut ID3D11PixelShader, + ppClassInstances: *mut *mut ID3D11ClassInstance, + pNumClassInstances: *mut UINT, + ) -> (), + fn PSGetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *mut *mut ID3D11SamplerState, + ) -> (), + fn VSGetShader( + ppVertexShader: *mut *mut ID3D11VertexShader, + ppClassInstances: *mut *mut ID3D11ClassInstance, + pNumClassInstances: *mut UINT, + ) -> (), + fn PSGetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + ) -> (), + fn IAGetInputLayout( + ppInputLayout: *mut *mut ID3D11InputLayout, + ) -> (), + fn IAGetVertexBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppVertexBuffers: *mut *mut ID3D11Buffer, + pStrides: *mut UINT, + pOffsets: *mut UINT, + ) -> (), + fn IAGetIndexBuffer( + pIndexBuffer: *mut *mut ID3D11Buffer, + Format: *mut DXGI_FORMAT, + Offset: *mut UINT, + ) -> (), + fn GSGetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + ) -> (), + fn GSGetShader( + ppGeometryShader: *mut *mut ID3D11GeometryShader, + ppClassInstances: *mut *mut ID3D11ClassInstance, + pNumClassInstances: *mut UINT, + ) -> (), + fn IAGetPrimitiveTopology( + pTopology: *mut D3D11_PRIMITIVE_TOPOLOGY, + ) -> (), + fn VSGetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *mut *mut ID3D11ShaderResourceView, + ) -> (), + fn VSGetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *mut *mut ID3D11SamplerState, + ) -> (), + fn GetPredication( + ppPredicate: *mut *mut ID3D11Predicate, + pPredicateValue: *mut BOOL, + ) -> (), + fn GSGetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *mut *mut ID3D11ShaderResourceView, + ) -> (), + fn GSGetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *mut *mut ID3D11SamplerState, + ) -> (), + fn OMGetRenderTargets( + NumViews: UINT, + ppRenderTargetViews: *mut *mut ID3D11RenderTargetView, + ppDepthStencilView: *mut *mut ID3D11DepthStencilView, + ) -> (), + fn OMGetRenderTargetsAndUnorderedAccessViews( + NumRTVs: UINT, + ppRenderTargetViews: *mut *mut ID3D11RenderTargetView, + ppDepthStencilView: *mut *mut ID3D11DepthStencilView, + UAVStartSlot: UINT, + NumUAVs: UINT, + ppUnorderedAccessViews: *mut *mut ID3D11UnorderedAccessView, + ) -> (), + fn OMGetBlendState( + ppBlendState: *mut *mut ID3D11BlendState, + BlendFactor: &mut [FLOAT; 4], + pSampleMask: *mut UINT, + ) -> (), + fn OMGetDepthStencilState( + ppDepthStencilState: *mut *mut ID3D11DepthStencilState, + pStencilRef: *mut UINT, + ) -> (), + fn SOGetTargets( + NumBuffers: UINT, + ppSOTargets: *mut *mut ID3D11Buffer, + ) -> (), + fn RSGetState( + ppRasterizerState: *mut *mut ID3D11RasterizerState, + ) -> (), + fn RSGetViewports( + pNumViewports: *mut UINT, + pViewports: *mut D3D11_VIEWPORT, + ) -> (), + fn RSGetScissorRects( + pNumRects: *mut UINT, + pRects: *mut D3D11_RECT, + ) -> (), + fn HSGetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *mut *mut ID3D11ShaderResourceView, + ) -> (), + fn HSGetShader( + ppHullShader: *mut *mut ID3D11HullShader, + ppClassInstances: *mut *mut ID3D11ClassInstance, + pNumClassInstances: *mut UINT, + ) -> (), + fn HSGetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *mut *mut ID3D11SamplerState, + ) -> (), + fn HSGetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + ) -> (), + fn DSGetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *mut *mut ID3D11ShaderResourceView, + ) -> (), + fn DSGetShader( + ppDomainShader: *mut *mut ID3D11DomainShader, + ppClassInstances: *mut *mut ID3D11ClassInstance, + pNumClassInstances: *mut UINT, + ) -> (), + fn DSGetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *mut *mut ID3D11SamplerState, + ) -> (), + fn DSGetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + ) -> (), + fn CSGetShaderResources( + StartSlot: UINT, + NumViews: UINT, + ppShaderResourceViews: *mut *mut ID3D11ShaderResourceView, + ) -> (), + fn CSGetUnorderedAccessViews( + StartSlot: UINT, + NumUAVs: UINT, + ppUnorderedAccessViews: *mut *mut ID3D11UnorderedAccessView, + ) -> (), + fn CSGetShader( + ppComputeShader: *mut *mut ID3D11ComputeShader, + ppClassInstances: *mut *mut ID3D11ClassInstance, + pNumClassInstances: *mut UINT, + ) -> (), + fn CSGetSamplers( + StartSlot: UINT, + NumSamplers: UINT, + ppSamplers: *mut *mut ID3D11SamplerState, + ) -> (), + fn CSGetConstantBuffers( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + ) -> (), + fn ClearState() -> (), + fn Flush() -> (), + fn GetType() -> D3D11_DEVICE_CONTEXT_TYPE, + fn GetContextFlags() -> UINT, + fn FinishCommandList( + RestoreDeferredContextState: BOOL, + ppCommandList: *mut *mut ID3D11CommandList, + ) -> HRESULT, +}} +DEFINE_GUID!{D3D11_DECODER_PROFILE_MPEG2_MOCOMP, + 0xe6a9f44b, 0x61b0, 0x4563, 0x9e, 0xa4, 0x63, 0xd2, 0xa3, 0xc6, 0xfe, 0x66} +DEFINE_GUID!{D3D11_DECODER_PROFILE_MPEG2_IDCT, + 0xbf22ad00, 0x03ea, 0x4690, 0x80, 0x77, 0x47, 0x33, 0x46, 0x20, 0x9b, 0x7e} +DEFINE_GUID!{D3D11_DECODER_PROFILE_MPEG2_VLD, + 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9} +DEFINE_GUID!{D3D11_DECODER_PROFILE_MPEG1_VLD, + 0x6f3ec719, 0x3735, 0x42cc, 0x80, 0x63, 0x65, 0xcc, 0x3c, 0xb3, 0x66, 0x16} +DEFINE_GUID!{D3D11_DECODER_PROFILE_MPEG2and1_VLD, + 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60} +DEFINE_GUID!{D3D11_DECODER_PROFILE_H264_MOCOMP_NOFGT, + 0x1b81be64, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_H264_MOCOMP_FGT, + 0x1b81be65, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_H264_IDCT_NOFGT, + 0x1b81be66, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_H264_IDCT_FGT, + 0x1b81be67, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_H264_VLD_NOFGT, + 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_H264_VLD_FGT, + 0x1b81be69, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_H264_VLD_WITHFMOASO_NOFGT, + 0xd5f04ff9, 0x3418, 0x45d8, 0x95, 0x61, 0x32, 0xa7, 0x6a, 0xae, 0x2d, 0xdd} +DEFINE_GUID!{D3D11_DECODER_PROFILE_H264_VLD_STEREO_PROGRESSIVE_NOFGT, + 0xd79be8da, 0x0cf1, 0x4c81, 0xb8, 0x2a, 0x69, 0xa4, 0xe2, 0x36, 0xf4, 0x3d} +DEFINE_GUID!{D3D11_DECODER_PROFILE_H264_VLD_STEREO_NOFGT, + 0xf9aaccbb, 0xc2b6, 0x4cfc, 0x87, 0x79, 0x57, 0x07, 0xb1, 0x76, 0x05, 0x52} +DEFINE_GUID!{D3D11_DECODER_PROFILE_H264_VLD_MULTIVIEW_NOFGT, + 0x705b9d82, 0x76cf, 0x49d6, 0xb7, 0xe6, 0xac, 0x88, 0x72, 0xdb, 0x01, 0x3c} +DEFINE_GUID!{D3D11_DECODER_PROFILE_WMV8_POSTPROC, + 0x1b81be80, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_WMV8_MOCOMP, + 0x1b81be81, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_WMV9_POSTPROC, + 0x1b81be90, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_WMV9_MOCOMP, + 0x1b81be91, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_WMV9_IDCT, + 0x1b81be94, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_VC1_POSTPROC, + 0x1b81bea0, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_VC1_MOCOMP, + 0x1b81bea1, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_VC1_IDCT, + 0x1b81bea2, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_VC1_VLD, + 0x1b81bea3, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_VC1_D2010, + 0x1b81bea4, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{D3D11_DECODER_PROFILE_MPEG4PT2_VLD_SIMPLE, + 0xefd64d74, 0xc9e8, 0x41d7, 0xa5, 0xe9, 0xe9, 0xb0, 0xe3, 0x9f, 0xa3, 0x19} +DEFINE_GUID!{D3D11_DECODER_PROFILE_MPEG4PT2_VLD_ADVSIMPLE_NOGMC, + 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e} +DEFINE_GUID!{D3D11_DECODER_PROFILE_MPEG4PT2_VLD_ADVSIMPLE_GMC, + 0xab998b5b, 0x4258, 0x44a9, 0x9f, 0xeb, 0x94, 0xe5, 0x97, 0xa6, 0xba, 0xae} +DEFINE_GUID!{D3D11_DECODER_PROFILE_HEVC_VLD_MAIN, + 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0} +DEFINE_GUID!{D3D11_DECODER_PROFILE_HEVC_VLD_MAIN10, + 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13} +DEFINE_GUID!{D3D11_DECODER_PROFILE_VP9_VLD_PROFILE0, + 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e} +DEFINE_GUID!{D3D11_DECODER_PROFILE_VP8_VLD, + 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7} +STRUCT!{struct D3D11_VIDEO_DECODER_DESC { + Guid: GUID, + SampleWidth: UINT, + SampleHeight: UINT, + OutputFormat: DXGI_FORMAT, +}} +STRUCT!{struct D3D11_VIDEO_DECODER_CONFIG { + guidConfigBitstreamEncryption: GUID, + guidConfigMBcontrolEncryption: GUID, + guidConfigResidDiffEncryption: GUID, + ConfigBitstreamRaw: UINT, + ConfigMBcontrolRasterOrder: UINT, + ConfigResidDiffHost: UINT, + ConfigSpatialResid8: UINT, + ConfigResid8Subtraction: UINT, + ConfigSpatialHost8or9Clipping: UINT, + ConfigSpatialResidInterleaved: UINT, + ConfigIntraResidUnsigned: UINT, + ConfigResidDiffAccelerator: UINT, + ConfigHostInverseScan: UINT, + ConfigSpecificIDCT: UINT, + Config4GroupedCoefs: UINT, + ConfigMinRenderTargetBuffCount: USHORT, + ConfigDecoderSpecific: USHORT, +}} +ENUM!{enum D3D11_VIDEO_DECODER_BUFFER_TYPE { + D3D11_VIDEO_DECODER_BUFFER_PICTURE_PARAMETERS = 0, + D3D11_VIDEO_DECODER_BUFFER_MACROBLOCK_CONTROL = 1, + D3D11_VIDEO_DECODER_BUFFER_RESIDUAL_DIFFERENCE = 2, + D3D11_VIDEO_DECODER_BUFFER_DEBLOCKING_CONTROL = 3, + D3D11_VIDEO_DECODER_BUFFER_INVERSE_QUANTIZATION_MATRIX = 4, + D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL = 5, + D3D11_VIDEO_DECODER_BUFFER_BITSTREAM = 6, + D3D11_VIDEO_DECODER_BUFFER_MOTION_VECTOR = 7, + D3D11_VIDEO_DECODER_BUFFER_FILM_GRAIN = 8, +}} +STRUCT!{struct D3D11_AES_CTR_IV { + IV: UINT64, + Count: UINT64, +}} +STRUCT!{struct D3D11_ENCRYPTED_BLOCK_INFO { + NumEncryptedBytesAtBeginning: UINT, + NumBytesInSkipPattern: UINT, + NumBytesInEncryptPattern: UINT, +}} +STRUCT!{struct D3D11_VIDEO_DECODER_BUFFER_DESC { + BufferType: D3D11_VIDEO_DECODER_BUFFER_TYPE, + BufferIndex: UINT, + DataOffset: UINT, + DataSize: UINT, + FirstMBaddress: UINT, + NumMBsInBuffer: UINT, + Width: UINT, + Height: UINT, + Stride: UINT, + ReservedBits: UINT, + pIV: *mut c_void, + IVSize: UINT, + PartialEncryption: BOOL, + EncryptedBlockInfo: D3D11_ENCRYPTED_BLOCK_INFO, +}} +STRUCT!{struct D3D11_VIDEO_DECODER_EXTENSION { + Function: UINT, + pPrivateInputData: *mut c_void, + PrivateInputDataSize: UINT, + pPrivateOutputData: *mut c_void, + PrivateOutputDataSize: UINT, + ResourceCount: UINT, + ppResourceList: *mut *mut ID3D11Resource, +}} +RIDL!{#[uuid(0x3c9c5b51, 0x995d, 0x48d1, 0x9b, 0x8d, 0xfa, 0x5c, 0xae, 0xde, 0xd6, 0x5c)] +interface ID3D11VideoDecoder(ID3D11VideoDecoderVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetCreationParameters( + pVideoDesc: *mut D3D11_VIDEO_DECODER_DESC, + pConfig: *mut D3D11_VIDEO_DECODER_CONFIG, + ) -> HRESULT, + fn GetDriverHandle( + pDriverHandle: *mut HANDLE, + ) -> HRESULT, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT { + D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT = 0x1, + D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT = 0x2, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_DEVICE_CAPS { + D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_LINEAR_SPACE = 0x1, + D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_xvYCC = 0x2, + D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_RGB_RANGE_CONVERSION = 0x4, + D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_YCbCr_MATRIX_CONVERSION = 0x8, + D3D11_VIDEO_PROCESSOR_DEVICE_CAPS_NOMINAL_RANGE = 0x10, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_FEATURE_CAPS { + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_FILL = 0x1, + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_CONSTRICTION = 0x2, + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_LUMA_KEY = 0x4, + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_PALETTE = 0x8, + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_LEGACY = 0x10, + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_STEREO = 0x20, + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ROTATION = 0x40, + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_ALPHA_STREAM = 0x80, + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_PIXEL_ASPECT_RATIO = 0x100, + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_MIRROR = 0x200, + D3D11_VIDEO_PROCESSOR_FEATURE_CAPS_SHADER_USAGE = 0x400, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_FILTER_CAPS { + D3D11_VIDEO_PROCESSOR_FILTER_CAPS_BRIGHTNESS = 0x1, + D3D11_VIDEO_PROCESSOR_FILTER_CAPS_CONTRAST = 0x2, + D3D11_VIDEO_PROCESSOR_FILTER_CAPS_HUE = 0x4, + D3D11_VIDEO_PROCESSOR_FILTER_CAPS_SATURATION = 0x8, + D3D11_VIDEO_PROCESSOR_FILTER_CAPS_NOISE_REDUCTION = 0x10, + D3D11_VIDEO_PROCESSOR_FILTER_CAPS_EDGE_ENHANCEMENT = 0x20, + D3D11_VIDEO_PROCESSOR_FILTER_CAPS_ANAMORPHIC_SCALING = 0x40, + D3D11_VIDEO_PROCESSOR_FILTER_CAPS_STEREO_ADJUSTMENT = 0x80, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_FORMAT_CAPS { + D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_INTERLACED = 0x1, + D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_PROCAMP = 0x2, + D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_RGB_LUMA_KEY = 0x4, + D3D11_VIDEO_PROCESSOR_FORMAT_CAPS_PALETTE_INTERLACED = 0x8, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS { + D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_DENOISE = 0x1, + D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_DERINGING = 0x2, + D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_EDGE_ENHANCEMENT = 0x4, + D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_COLOR_CORRECTION = 0x8, + D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_FLESH_TONE_MAPPING = 0x10, + D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_IMAGE_STABILIZATION = 0x20, + D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_SUPER_RESOLUTION = 0x40, + D3D11_VIDEO_PROCESSOR_AUTO_STREAM_CAPS_ANAMORPHIC_SCALING = 0x80, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_STEREO_CAPS { + D3D11_VIDEO_PROCESSOR_STEREO_CAPS_MONO_OFFSET = 0x1, + D3D11_VIDEO_PROCESSOR_STEREO_CAPS_ROW_INTERLEAVED = 0x2, + D3D11_VIDEO_PROCESSOR_STEREO_CAPS_COLUMN_INTERLEAVED = 0x4, + D3D11_VIDEO_PROCESSOR_STEREO_CAPS_CHECKERBOARD = 0x8, + D3D11_VIDEO_PROCESSOR_STEREO_CAPS_FLIP_MODE = 0x10, +}} +STRUCT!{struct D3D11_VIDEO_PROCESSOR_CAPS { + DeviceCaps: UINT, + FeatureCaps: UINT, + FilterCaps: UINT, + InputFormatCaps: UINT, + AutoStreamCaps: UINT, + StereoCaps: UINT, + RateConversionCapsCount: UINT, + MaxInputStreams: UINT, + MaxStreamStates: UINT, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS { + D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BLEND = 0x1, + D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB = 0x2, + D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_ADAPTIVE = 0x4, + D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_MOTION_COMPENSATION = 0x8, + D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_INVERSE_TELECINE = 0x10, + D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_FRAME_RATE_CONVERSION = 0x20, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS { + D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_32 = 0x1, + D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_22 = 0x2, + D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_2224 = 0x4, + D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_2332 = 0x8, + D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_32322 = 0x10, + D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_55 = 0x20, + D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_64 = 0x40, + D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_87 = 0x80, + D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_222222222223 = 0x100, + D3D11_VIDEO_PROCESSOR_ITELECINE_CAPS_OTHER = 0x80000000, +}} +STRUCT!{struct D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS { + PastFrames: UINT, + FutureFrames: UINT, + ProcessorCaps: UINT, + ITelecineCaps: UINT, + CustomRateCount: UINT, +}} +ENUM!{enum D3D11_CONTENT_PROTECTION_CAPS { + D3D11_CONTENT_PROTECTION_CAPS_SOFTWARE = 0x1, + D3D11_CONTENT_PROTECTION_CAPS_HARDWARE = 0x2, + D3D11_CONTENT_PROTECTION_CAPS_PROTECTION_ALWAYS_ON = 0x4, + D3D11_CONTENT_PROTECTION_CAPS_PARTIAL_DECRYPTION = 0x8, + D3D11_CONTENT_PROTECTION_CAPS_CONTENT_KEY = 0x10, + D3D11_CONTENT_PROTECTION_CAPS_FRESHEN_SESSION_KEY = 0x20, + D3D11_CONTENT_PROTECTION_CAPS_ENCRYPTED_READ_BACK = 0x40, + D3D11_CONTENT_PROTECTION_CAPS_ENCRYPTED_READ_BACK_KEY = 0x80, + D3D11_CONTENT_PROTECTION_CAPS_SEQUENTIAL_CTR_IV = 0x100, + D3D11_CONTENT_PROTECTION_CAPS_ENCRYPT_SLICEDATA_ONLY = 0x200, + D3D11_CONTENT_PROTECTION_CAPS_DECRYPTION_BLT = 0x400, + D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_PROTECT_UNCOMPRESSED = 0x800, + D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_PROTECTED_MEMORY_PAGEABLE = 0x1000, + D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_TEARDOWN = 0x2000, + D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_DRM_COMMUNICATION = 0x4000, +}} +DEFINE_GUID!{D3D11_CRYPTO_TYPE_AES128_CTR, + 0x9b6bd711, 0x4f74, 0x41c9, 0x9e, 0x7b, 0x0b, 0xe2, 0xd7, 0xd9, 0x3b, 0x4f} +DEFINE_GUID!{D3D11_DECODER_ENCRYPTION_HW_CENC, + 0x89d6ac4f, 0x09f2, 0x4229, 0xb2, 0xcd, 0x37, 0x74, 0x0a, 0x6d, 0xfd, 0x81} +DEFINE_GUID!{D3D11_KEY_EXCHANGE_HW_PROTECTION, + 0xb1170d8a, 0x628d, 0x4da3, 0xad, 0x3b, 0x82, 0xdd, 0xb0, 0x8b, 0x49, 0x70} +STRUCT!{struct D3D11_VIDEO_CONTENT_PROTECTION_CAPS { + Caps: UINT, + KeyExchangeTypeCount: UINT, + BlockAlignmentSize: UINT, + ProtectedMemorySize: ULONGLONG, +}} +STRUCT!{struct D3D11_VIDEO_PROCESSOR_CUSTOM_RATE { + CustomRate: DXGI_RATIONAL, + OutputFrames: UINT, + InputInterlaced: BOOL, + InputFramesOrFields: UINT, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_FILTER { + D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS = 0, + D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST = 1, + D3D11_VIDEO_PROCESSOR_FILTER_HUE = 2, + D3D11_VIDEO_PROCESSOR_FILTER_SATURATION = 3, + D3D11_VIDEO_PROCESSOR_FILTER_NOISE_REDUCTION = 4, + D3D11_VIDEO_PROCESSOR_FILTER_EDGE_ENHANCEMENT = 5, + D3D11_VIDEO_PROCESSOR_FILTER_ANAMORPHIC_SCALING = 6, + D3D11_VIDEO_PROCESSOR_FILTER_STEREO_ADJUSTMENT = 7, +}} +STRUCT!{struct D3D11_VIDEO_PROCESSOR_FILTER_RANGE { + Minimum: c_int, + Maximum: c_int, + Default: c_int, + Multiplier: c_float, +}} +ENUM!{enum D3D11_VIDEO_FRAME_FORMAT { + D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE = 0, + D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST = 1, + D3D11_VIDEO_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST = 2, +}} +ENUM!{enum D3D11_VIDEO_USAGE { + D3D11_VIDEO_USAGE_PLAYBACK_NORMAL = 0, + D3D11_VIDEO_USAGE_OPTIMAL_SPEED = 1, + D3D11_VIDEO_USAGE_OPTIMAL_QUALITY = 2, +}} +STRUCT!{struct D3D11_VIDEO_PROCESSOR_CONTENT_DESC { + InputFrameFormat: D3D11_VIDEO_FRAME_FORMAT, + InputFrameRate: DXGI_RATIONAL, + InputWidth: UINT, + InputHeight: UINT, + OutputFrameRate: DXGI_RATIONAL, + OutputWidth: UINT, + OutputHeight: UINT, + Usage: D3D11_VIDEO_USAGE, +}} +RIDL!{#[uuid(0x31627037, 0x53ab, 0x4200, 0x90, 0x61, 0x05, 0xfa, 0xa9, 0xab, 0x45, 0xf9)] +interface ID3D11VideoProcessorEnumerator(ID3D11VideoProcessorEnumeratorVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetVideoProcessorContentDesc( + pContentDesc: *mut D3D11_VIDEO_PROCESSOR_CONTENT_DESC, + ) -> HRESULT, + fn CheckVideoProcessorFormat( + Format: DXGI_FORMAT, + pFlags: *mut UINT, + ) -> HRESULT, + fn GetVideoProcessorCaps( + pCaps: *mut D3D11_VIDEO_PROCESSOR_CAPS, + ) -> HRESULT, + fn GetVideoProcessorRateConversionCaps( + TypeIndex: UINT, + pCaps: *mut D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS, + ) -> HRESULT, + fn GetVideoProcessorCustomRate( + TypeIndex: UINT, + CustomRateIndex: UINT, + pRate: *mut D3D11_VIDEO_PROCESSOR_CUSTOM_RATE, + ) -> HRESULT, + fn GetVideoProcessorFilterRange( + Filter: D3D11_VIDEO_PROCESSOR_FILTER, + Range: *mut D3D11_VIDEO_PROCESSOR_FILTER_RANGE, + ) -> HRESULT, +}} +STRUCT!{struct D3D11_VIDEO_COLOR_RGBA { + R: c_float, + G: c_float, + B: c_float, + A: c_float, +}} +STRUCT!{struct D3D11_VIDEO_COLOR_YCbCrA { + Y: c_float, + Cb: c_float, + Cr: c_float, + A: c_float, +}} +UNION!{union D3D11_VIDEO_COLOR { + [f32; 4], + YCbCr YCbCr_mut: D3D11_VIDEO_COLOR_YCbCrA, + RGBA RGBA_mut: D3D11_VIDEO_COLOR_RGBA, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE { + D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_UNDEFINED = 0, + D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_16_235 = 1, + D3D11_VIDEO_PROCESSOR_NOMINAL_RANGE_0_255 = 2, +}} +STRUCT!{struct D3D11_VIDEO_PROCESSOR_COLOR_SPACE { + bitfield: UINT, +}} +BITFIELD!{D3D11_VIDEO_PROCESSOR_COLOR_SPACE bitfield: UINT [ + Usage set_Usage[0..1], + RGB_Range set_RGB_Range[1..2], + YCbCr_Matrix set_YCbCr_Matrix[2..3], + YCbCr_xvYCC set_YCbCr_xvYCC[3..4], + Nominal_Range set_Nominal_Range[4..6], +]} +ENUM!{enum D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE { + D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_OPAQUE = 0, + D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_BACKGROUND = 1, + D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_DESTINATION = 2, + D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE_SOURCE_STREAM = 3, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_OUTPUT_RATE { + D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_NORMAL = 0, + D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_HALF = 1, + D3D11_VIDEO_PROCESSOR_OUTPUT_RATE_CUSTOM = 2, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_STEREO_FORMAT { + D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_MONO = 0, + D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_HORIZONTAL = 1, + D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_VERTICAL = 2, + D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_SEPARATE = 3, + D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_MONO_OFFSET = 4, + D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_ROW_INTERLEAVED = 5, + D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_COLUMN_INTERLEAVED = 6, + D3D11_VIDEO_PROCESSOR_STEREO_FORMAT_CHECKERBOARD = 7, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE { + D3D11_VIDEO_PROCESSOR_STEREO_FLIP_NONE = 0, + D3D11_VIDEO_PROCESSOR_STEREO_FLIP_FRAME0 = 1, + D3D11_VIDEO_PROCESSOR_STEREO_FLIP_FRAME1 = 2, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_ROTATION { + D3D11_VIDEO_PROCESSOR_ROTATION_IDENTITY = 0, + D3D11_VIDEO_PROCESSOR_ROTATION_90 = 1, + D3D11_VIDEO_PROCESSOR_ROTATION_180 = 2, + D3D11_VIDEO_PROCESSOR_ROTATION_270 = 3, +}} +STRUCT!{struct D3D11_VIDEO_PROCESSOR_STREAM { + Enable: BOOL, + OutputIndex: UINT, + InputFrameOrField: UINT, + PastFrames: UINT, + FutureFrames: UINT, + ppPastSurfaces: *mut *mut ID3D11VideoProcessorInputView, + pInputSurface: *mut ID3D11VideoProcessorInputView, + ppFutureSurfaces: *mut *mut ID3D11VideoProcessorInputView, + ppPastSurfacesRight: *mut *mut ID3D11VideoProcessorInputView, + pInputSurfaceRight: *mut ID3D11VideoProcessorInputView, + ppFutureSurfacesRight: *mut *mut ID3D11VideoProcessorInputView, +}} +RIDL!{#[uuid(0x1d7b0652, 0x185f, 0x41c6, 0x85, 0xce, 0x0c, 0x5b, 0xe3, 0xd4, 0xae, 0x6c)] +interface ID3D11VideoProcessor(ID3D11VideoProcessorVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetContentDesc( + pDesc: *mut D3D11_VIDEO_PROCESSOR_CONTENT_DESC, + ) -> (), + fn GetRateConversionCaps( + pCaps: *mut D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS, + ) -> (), +}} +STRUCT!{struct D3D11_OMAC { + Omac: [BYTE; 16], +}} +ENUM!{enum D3D11_AUTHENTICATED_CHANNEL_TYPE { + D3D11_AUTHENTICATED_CHANNEL_D3D11 = 1, + D3D11_AUTHENTICATED_CHANNEL_DRIVER_SOFTWARE = 2, + D3D11_AUTHENTICATED_CHANNEL_DRIVER_HARDWARE = 3, +}} +RIDL!{#[uuid(0x3015a308, 0xdcbd, 0x47aa, 0xa7, 0x47, 0x19, 0x24, 0x86, 0xd1, 0x4d, 0x4a)] +interface ID3D11AuthenticatedChannel(ID3D11AuthenticatedChannelVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetCertificateSize( + pCertificateSize: *mut UINT, + ) -> HRESULT, + fn GetCertificate( + CertificateSize: UINT, + pCertificate: *mut BYTE, + ) -> HRESULT, + fn GetChannelHandle( + pChannelHandle: *mut HANDLE, + ) -> (), +}} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_PROTECTION, + 0xa84eb584, 0xc495, 0x48aa, 0xb9, 0x4d, 0x8b, 0xd2, 0xd6, 0xfb, 0xce, 0x05} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_CHANNEL_TYPE, + 0xbc1b18a5, 0xb1fb, 0x42ab, 0xbd, 0x94, 0xb5, 0x82, 0x8b, 0x4b, 0xf7, 0xbe} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_DEVICE_HANDLE, + 0xec1c539d, 0x8cff, 0x4e2a, 0xbc, 0xc4, 0xf5, 0x69, 0x2f, 0x99, 0xf4, 0x80} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION, + 0x2634499e, 0xd018, 0x4d74, 0xac, 0x17, 0x7f, 0x72, 0x40, 0x59, 0x52, 0x8d} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT, + 0x0db207b3, 0x9450, 0x46a6, 0x82, 0xde, 0x1b, 0x96, 0xd4, 0x4f, 0x9c, 0xf2} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS, + 0x649bbadb, 0xf0f4, 0x4639, 0xa1, 0x5b, 0x24, 0x39, 0x3f, 0xc3, 0xab, 0xac} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT, + 0x012f0bd6, 0xe662, 0x4474, 0xbe, 0xfd, 0xaa, 0x53, 0xe5, 0x14, 0x3c, 0x6d} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT, + 0x2c042b5e, 0x8c07, 0x46d5, 0xaa, 0xbe, 0x8f, 0x75, 0xcb, 0xad, 0x4c, 0x31} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_OUTPUT_ID, + 0x839ddca3, 0x9b4e, 0x41e4, 0xb0, 0x53, 0x89, 0x2b, 0xd2, 0xa1, 0x1e, 0xe7} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ATTRIBUTES, + 0x6214d9d2, 0x432c, 0x4abb, 0x9f, 0xce, 0x21, 0x6e, 0xea, 0x26, 0x9e, 0x3b} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_ENCRYPTION_WHEN_ACCESSIBLE_GUID_COUNT, + 0xb30f7066, 0x203c, 0x4b07, 0x93, 0xfc, 0xce, 0xaa, 0xfd, 0x61, 0x24, 0x1e} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_ENCRYPTION_WHEN_ACCESSIBLE_GUID, + 0xf83a5958, 0xe986, 0x4bda, 0xbe, 0xb0, 0x41, 0x1f, 0x6a, 0x7a, 0x01, 0xb7} +DEFINE_GUID!{D3D11_AUTHENTICATED_QUERY_CURRENT_ENCRYPTION_WHEN_ACCESSIBLE, + 0xec1791c7, 0xdad3, 0x4f15, 0x9e, 0xc3, 0xfa, 0xa9, 0x3d, 0x60, 0xd4, 0xf0} +DEFINE_GUID!{D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE, + 0x06114bdb, 0x3523, 0x470a, 0x8d, 0xca, 0xfb, 0xc2, 0x84, 0x51, 0x54, 0xf0} +DEFINE_GUID!{D3D11_AUTHENTICATED_CONFIGURE_PROTECTION, + 0x50455658, 0x3f47, 0x4362, 0xbf, 0x99, 0xbf, 0xdf, 0xcd, 0xe9, 0xed, 0x29} +DEFINE_GUID!{D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION, + 0x6346cc54, 0x2cfc, 0x4ad4, 0x82, 0x24, 0xd1, 0x58, 0x37, 0xde, 0x77, 0x00} +DEFINE_GUID!{D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE, + 0x0772d047, 0x1b40, 0x48e8, 0x9c, 0xa6, 0xb5, 0xf5, 0x10, 0xde, 0x9f, 0x01} +DEFINE_GUID!{D3D11_AUTHENTICATED_CONFIGURE_ENCRYPTION_WHEN_ACCESSIBLE, + 0x41fff286, 0x6ae0, 0x4d43, 0x9d, 0x55, 0xa4, 0x6e, 0x9e, 0xfd, 0x15, 0x8a} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_INPUT { + QueryType: GUID, + hChannel: HANDLE, + SequenceNumber: UINT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_OUTPUT { + omac: D3D11_OMAC, + QueryType: GUID, + hChannel: HANDLE, + SequenceNumber: UINT, + ReturnCode: HRESULT, +}} +//FIXME bitfield +STRUCT!{struct D3D11_AUTHENTICATED_PROTECTION_FLAGS { + u: UINT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_PROTECTION_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + ProtectionFlags: D3D11_AUTHENTICATED_PROTECTION_FLAGS, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_CHANNEL_TYPE_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + ChannelType: D3D11_AUTHENTICATED_CHANNEL_TYPE, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_DEVICE_HANDLE_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + DeviceHandle: HANDLE, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_INPUT { + Input: D3D11_AUTHENTICATED_QUERY_INPUT, + DecoderHandle: HANDLE, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_CRYPTO_SESSION_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + DecoderHandle: HANDLE, + CryptoSessionHandle: HANDLE, + DeviceHandle: HANDLE, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_COUNT_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + RestrictedSharedResourceProcessCount: UINT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_INPUT { + Input: D3D11_AUTHENTICATED_QUERY_INPUT, + ProcessIndex: UINT, +}} +ENUM!{enum D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE { + D3D11_PROCESSIDTYPE_UNKNOWN = 0, + D3D11_PROCESSIDTYPE_DWM = 1, + D3D11_PROCESSIDTYPE_HANDLE = 2, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_RESTRICTED_SHARED_RESOURCE_PROCESS_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + ProcessIndex: UINT, + ProcessIdentifier: D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE, + ProcessHandle: HANDLE, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_UNRESTRICTED_PROTECTED_SHARED_RESOURCE_COUNT_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + UnrestrictedProtectedSharedResourceCount: UINT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_INPUT { + Input: D3D11_AUTHENTICATED_QUERY_INPUT, + DeviceHandle: HANDLE, + CryptoSessionHandle: HANDLE, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_COUNT_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + DeviceHandle: HANDLE, + CryptoSessionHandle: HANDLE, + OutputIDCount: UINT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_INPUT { + Input: D3D11_AUTHENTICATED_QUERY_INPUT, + DeviceHandle: HANDLE, + CryptoSessionHandle: HANDLE, + OutputIDIndex: UINT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_OUTPUT_ID_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + DeviceHandle: HANDLE, + CryptoSessionHandle: HANDLE, + OutputIDIndex: UINT, + OutputID: UINT64, +}} +ENUM!{enum D3D11_BUS_TYPE { + D3D11_BUS_TYPE_OTHER = 0, + D3D11_BUS_TYPE_PCI = 0x1, + D3D11_BUS_TYPE_PCIX = 0x2, + D3D11_BUS_TYPE_PCIEXPRESS = 0x3, + D3D11_BUS_TYPE_AGP = 0x4, + D3D11_BUS_IMPL_MODIFIER_INSIDE_OF_CHIPSET = 0x10000, + D3D11_BUS_IMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP = 0x20000, + D3D11_BUS_IMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET = 0x30000, + D3D11_BUS_IMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR = 0x40000, + D3D11_BUS_IMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE = 0x50000, + D3D11_BUS_IMPL_MODIFIER_NON_STANDARD = 0x80000000, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_ACESSIBILITY_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + BusType: D3D11_BUS_TYPE, + AccessibleInContiguousBlocks: BOOL, + AccessibleInNonContiguousBlocks: BOOL, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_COUNT_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + EncryptionGuidCount: UINT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_INPUT { + Input: D3D11_AUTHENTICATED_QUERY_INPUT, + EncryptionGuidIndex: UINT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_ACCESSIBILITY_ENCRYPTION_GUID_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + EncryptionGuidIndex: UINT, + EncryptionGuid: GUID, +}} +STRUCT!{struct D3D11_AUTHENTICATED_QUERY_CURRENT_ACCESSIBILITY_ENCRYPTION_OUTPUT { + Output: D3D11_AUTHENTICATED_QUERY_OUTPUT, + EncryptionGuid: GUID, +}} +STRUCT!{struct D3D11_AUTHENTICATED_CONFIGURE_INPUT { + omac: D3D11_OMAC, + ConfigureType: GUID, + hChannel: HANDLE, + SequenceNumber: UINT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_CONFIGURE_OUTPUT { + omac: D3D11_OMAC, + ConfigureType: GUID, + hChannel: HANDLE, + SequenceNumber: UINT, + ReturnCode: HRESULT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_CONFIGURE_INITIALIZE_INPUT { + Parameters: D3D11_AUTHENTICATED_CONFIGURE_INPUT, + StartSequenceQuery: UINT, + StartSequenceConfigure: UINT, +}} +STRUCT!{struct D3D11_AUTHENTICATED_CONFIGURE_PROTECTION_INPUT { + Parameters: D3D11_AUTHENTICATED_CONFIGURE_INPUT, + Protections: D3D11_AUTHENTICATED_PROTECTION_FLAGS, +}} +STRUCT!{struct D3D11_AUTHENTICATED_CONFIGURE_CRYPTO_SESSION_INPUT { + Parameters: D3D11_AUTHENTICATED_CONFIGURE_INPUT, + DecoderHandle: HANDLE, + CryptoSessionHandle: HANDLE, + DeviceHandle: HANDLE, +}} +STRUCT!{struct D3D11_AUTHENTICATED_CONFIGURE_SHARED_RESOURCE_INPUT { + Parameters: D3D11_AUTHENTICATED_CONFIGURE_INPUT, + ProcessType: D3D11_AUTHENTICATED_PROCESS_IDENTIFIER_TYPE, + ProcessHandle: HANDLE, + AllowAccess: BOOL, +}} +STRUCT!{struct D3D11_AUTHENTICATED_CONFIGURE_ACCESSIBLE_ENCRYPTION_INPUT { + Parameters: D3D11_AUTHENTICATED_CONFIGURE_INPUT, + EncryptionGuid: GUID, +}} +DEFINE_GUID!{D3D11_KEY_EXCHANGE_RSAES_OAEP, + 0xc1949895, 0xd72a, 0x4a1d, 0x8e, 0x5d, 0xed, 0x85, 0x7d, 0x17, 0x15, 0x20} +RIDL!{#[uuid(0x9b32f9ad, 0xbdcc, 0x40a6, 0xa3, 0x9d, 0xd5, 0xc8, 0x65, 0x84, 0x57, 0x20)] +interface ID3D11CryptoSession(ID3D11CryptoSessionVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetCryptoType( + pCryptoType: *mut GUID, + ) -> (), + fn GetDecoderProfile( + pDecoderProfile: *mut GUID, + ) -> (), + fn GetCertificateSize( + pCertificateSize: *mut UINT, + ) -> HRESULT, + fn GetCertificate( + CertificateSize: UINT, + pCertificate: *mut BYTE, + ) -> HRESULT, + fn GetCryptoSessionHandle( + pCertificate: *mut HANDLE, + ) -> (), +}} +ENUM!{enum D3D11_VDOV_DIMENSION { + D3D11_VDOV_DIMENSION_UNKNOWN = 0, + D3D11_VDOV_DIMENSION_TEXTURE2D = 1, +}} +STRUCT!{struct D3D11_TEX2D_VDOV { + ArraySlice: UINT, +}} +STRUCT!{struct D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC { + DecodeProfile: GUID, + ViewDimension: D3D11_VDOV_DIMENSION, + Texture2D: D3D11_TEX2D_VDOV, +}} +RIDL!{#[uuid(0xc2931aea, 0x2a85, 0x4f20, 0x86, 0x0f, 0xfb, 0xa1, 0xfd, 0x25, 0x6e, 0x18)] +interface ID3D11VideoDecoderOutputView(ID3D11VideoDecoderOutputViewVtbl): + ID3D11View(ID3D11ViewVtbl) { + fn GetDesc( + pDesc: *mut D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC, + ) -> (), +}} +ENUM!{enum D3D11_VPIV_DIMENSION { + D3D11_VPIV_DIMENSION_UNKNOWN = 0, + D3D11_VPIV_DIMENSION_TEXTURE2D = 1, +}} +STRUCT!{struct D3D11_TEX2D_VPIV { + MipSlice: UINT, + ArraySlice: UINT, +}} +STRUCT!{struct D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC { + FourCC: UINT, + ViewDimension: D3D11_VPIV_DIMENSION, + Texture2D: D3D11_TEX2D_VPIV, +}} +RIDL!{#[uuid(0x11ec5a5f, 0x51dc, 0x4945, 0xab, 0x34, 0x6e, 0x8c, 0x21, 0x30, 0x0e, 0xa5)] +interface ID3D11VideoProcessorInputView(ID3D11VideoProcessorInputViewVtbl): + ID3D11View(ID3D11ViewVtbl) { + fn GetDesc( + pDesc: *mut D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC, + ) -> (), +}} +ENUM!{enum D3D11_VPOV_DIMENSION { + D3D11_VPOV_DIMENSION_UNKNOWN = 0, + D3D11_VPOV_DIMENSION_TEXTURE2D = 1, + D3D11_VPOV_DIMENSION_TEXTURE2DARRAY = 2, +}} +STRUCT!{struct D3D11_TEX2D_VPOV { + MipSlice: UINT, +}} +STRUCT!{struct D3D11_TEX2D_ARRAY_VPOV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +UNION!{union D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC_u { + [u32; 3], + Texture2D Texture2D_mut: D3D11_TEX2D_VPOV, + Texture2DArray Texture2DArray_mut: D3D11_TEX2D_ARRAY_VPOV, +}} +STRUCT!{struct D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC { + ViewDimension: D3D11_VPOV_DIMENSION, + u: D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC_u, +}} +RIDL!{#[uuid(0xa048285e, 0x25a9, 0x4527, 0xbd, 0x93, 0xd6, 0x8b, 0x68, 0xc4, 0x42, 0x54)] +interface ID3D11VideoProcessorOutputView(ID3D11VideoProcessorOutputViewVtbl): + ID3D11View(ID3D11ViewVtbl) { + fn GetDesc( + pDesc: *mut D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC, + ) -> (), +}} +RIDL!{#[uuid(0x61f21c45, 0x3c0e, 0x4a74, 0x9c, 0xea, 0x67, 0x10, 0x0d, 0x9a, 0xd5, 0xe4)] +interface ID3D11VideoContext(ID3D11VideoContextVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { + fn GetDecoderBuffer( + pDecoder: *mut ID3D11VideoDecoder, + Type: D3D11_VIDEO_DECODER_BUFFER_TYPE, + pBufferSize: *mut UINT, + ppBuffer: *mut *mut c_void, + ) -> HRESULT, + fn ReleaseDecoderBuffer( + pDecoder: *mut ID3D11VideoDecoder, + Type: D3D11_VIDEO_DECODER_BUFFER_TYPE, + ) -> HRESULT, + fn DecoderBeginFrame( + pDecoder: *mut ID3D11VideoDecoder, + pView: *mut ID3D11VideoDecoderOutputView, + ContentKeySize: UINT, + pContentKey: *const c_void, + ) -> HRESULT, + fn DecoderEndFrame( + pDecoder: *mut ID3D11VideoDecoder, + ) -> HRESULT, + fn SubmitDecoderBuffers( + pDecoder: *mut ID3D11VideoDecoder, + NumBuffers: UINT, + pBufferDesc: *const D3D11_VIDEO_DECODER_BUFFER_DESC, + ) -> HRESULT, + fn DecoderExtension( + pDecoder: *mut ID3D11VideoDecoder, + pExtensionData: *const D3D11_VIDEO_DECODER_EXTENSION, + ) -> HRESULT, + fn VideoProcessorSetOutputTargetRect( + pVideoProcessor: *mut ID3D11VideoProcessor, + Enable: BOOL, + pRect: *const RECT, + ) -> (), + fn VideoProcessorSetOutputBackgroundColor( + pVideoProcessor: *mut ID3D11VideoProcessor, + YCbCr: BOOL, + pRect: *const RECT, + ) -> (), + fn VideoProcessorSetOutputColorSpace( + pVideoProcessor: *mut ID3D11VideoProcessor, + pColorSpace: *const D3D11_VIDEO_PROCESSOR_COLOR_SPACE, + ) -> HRESULT, + fn VideoProcessorSetOutputAlphaFillMode( + pVideoProcessor: *mut ID3D11VideoProcessor, + AlphaFillMode: D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE, + StreamIndex: UINT, + ) -> (), + fn VideoProcessorSetOutputConstriction( + pVideoProcessor: *mut ID3D11VideoProcessor, + Enable: BOOL, + Size: SIZE, + ) -> (), + fn VideoProcessorSetOutputStereoMode( + pVideoProcessor: *mut ID3D11VideoProcessor, + Enable: BOOL, + ) -> (), + fn VideoProcessorSetOutputExtension( + pVideoProcessor: *mut ID3D11VideoProcessor, + pExtensionGuid: *const GUID, + DataSize: UINT, + pData: *mut c_void, + ) -> HRESULT, + fn VideoProcessorGetOutputTargetRect( + pVideoProcessor: *mut ID3D11VideoProcessor, + Enabled: *mut BOOL, + pRect: *mut RECT, + ) -> (), + fn VideoProcessorGetOutputBackgroundColor( + pVideoProcessor: *mut ID3D11VideoProcessor, + pYCbCr: *mut BOOL, + pColor: *mut D3D11_VIDEO_COLOR, + ) -> (), + fn VideoProcessorGetOutputColorSpace( + pVideoProcessor: *mut ID3D11VideoProcessor, + pColorSpace: *mut D3D11_VIDEO_PROCESSOR_COLOR_SPACE, + ) -> (), + fn VideoProcessorGetOutputAlphaFillMode( + pVideoProcessor: *mut ID3D11VideoProcessor, + pAlphaFillMode: *mut D3D11_VIDEO_PROCESSOR_ALPHA_FILL_MODE, + pStreamIndex: *mut UINT, + ) -> (), + fn VideoProcessorGetOutputConstriction( + pVideoProcessor: *mut ID3D11VideoProcessor, + pEnabled: *mut BOOL, + pSize: *mut SIZE, + ) -> (), + fn VideoProcessorGetOutputStereoMode( + pVideoProcessor: *mut ID3D11VideoProcessor, + pEnabled: *mut BOOL, + ) -> (), + fn VideoProcessorGetOutputExtension( + pVideoProcessor: *mut ID3D11VideoProcessor, + pExtensionGuid: *const GUID, + DataSize: UINT, + pData: *mut c_void, + ) -> HRESULT, + fn VideoProcessorSetStreamFrameFormat( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + FrameFormat: D3D11_VIDEO_FRAME_FORMAT, + ) -> (), + fn VideoProcessorSetStreamColorSpace( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pColorSpace: *const D3D11_VIDEO_PROCESSOR_COLOR_SPACE, + ) -> (), + fn VideoProcessorSetStreamOutputRate( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + OutputRate: D3D11_VIDEO_PROCESSOR_OUTPUT_RATE, + RepeatFrame: BOOL, + pCustomRate: *const DXGI_RATIONAL, + ) -> (), + fn VideoProcessorSetStreamSourceRect( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Enable: BOOL, + pRect: *const RECT, + ) -> (), + fn VideoProcessorSetStreamDestRect( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Enable: BOOL, + pRect: *const RECT, + ) -> (), + fn VideoProcessorSetStreamAlpha( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Enable: BOOL, + Alpha: FLOAT, + ) -> (), + fn VideoProcessorSetStreamPalette( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Count: UINT, + pEntries: *const UINT, + ) -> (), + fn VideoProcessorSetStreamPixelAspectRatio( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Enable: BOOL, + pSourceAspectRatio: *const DXGI_RATIONAL, + pDestinationAspectRatio: *const DXGI_RATIONAL, + ) -> (), + fn VideoProcessorSetStreamLumaKey( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Enable: BOOL, + Lower: FLOAT, + Upper: FLOAT, + ) -> (), + fn VideoProcessorSetStreamStereoFormat( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Enable: BOOL, + Format: D3D11_VIDEO_PROCESSOR_STEREO_FORMAT, + LeftViewFrame0: BOOL, + BaseViewFrame0: BOOL, + FlipMode: D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE, + ) -> (), + fn VideoProcessorSetStreamAutoProcessingMode( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Enable: BOOL, + ) -> (), + fn VideoProcessorSetStreamFilter( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Filter: D3D11_VIDEO_PROCESSOR_FILTER, + Enable: BOOL, + Level: c_int, + ) -> (), + fn VideoProcessorSetStreamExtension( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pExtensionGuid: *const GUID, + DataSize: UINT, + pData: *mut c_void, + ) -> HRESULT, + fn VideoProcessorGetStreamFrameFormat( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pFrameFormat: *mut D3D11_VIDEO_FRAME_FORMAT, + ) -> (), + fn VideoProcessorGetStreamColorSpace( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pColorSpace: *mut D3D11_VIDEO_PROCESSOR_COLOR_SPACE, + ) -> (), + fn VideoProcessorGetStreamOutputRate( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pOutputRate: *mut D3D11_VIDEO_PROCESSOR_OUTPUT_RATE, + pRepeatFrame: *mut BOOL, + pCustomRate: *mut DXGI_RATIONAL, + ) -> (), + fn VideoProcessorGetStreamSourceRect( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pEnabled: *mut BOOL, + pRect: *mut RECT, + ) -> (), + fn VideoProcessorGetStreamDestRect( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pEnabled: *mut BOOL, + pRect: *mut RECT, + ) -> (), + fn VideoProcessorGetStreamAlpha( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pEnabled: *mut BOOL, + pAlpha: *mut FLOAT, + ) -> (), + fn VideoProcessorGetStreamPalette( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Count: UINT, + pEntries: *mut UINT, + ) -> (), + fn VideoProcessorGetStreamPixelAspectRatio( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pEnabled: *mut BOOL, + pSourceAspectRatio: *mut DXGI_RATIONAL, + pDestinationAspectRatio: *mut DXGI_RATIONAL, + ) -> (), + fn VideoProcessorGetStreamLumaKey( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pEnabled: *mut BOOL, + pLower: *mut FLOAT, + pUpper: *mut FLOAT, + ) -> (), + fn VideoProcessorGetStreamStereoFormat( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pEnabled: *mut BOOL, + pFormat: *mut D3D11_VIDEO_PROCESSOR_STEREO_FORMAT, + pLeftViewFrame0: *mut BOOL, + pBaseViewFrame0: *mut BOOL, + pFlipMode: *mut D3D11_VIDEO_PROCESSOR_STEREO_FLIP_MODE, + MonoOffset: *mut c_int, + ) -> (), + fn VideoProcessorGetStreamAutoProcessingMode( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pEnabled: *mut BOOL, + ) -> (), + fn VideoProcessorGetStreamFilter( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Filter: D3D11_VIDEO_PROCESSOR_FILTER, + pEnabled: *mut BOOL, + pLevel: *mut c_int, + ) -> (), + fn VideoProcessorGetStreamExtension( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pExtensionGuid: *const GUID, + DataSize: UINT, + pData: *mut c_void, + ) -> HRESULT, + fn VideoProcessorBlt( + pVideoProcessor: *mut ID3D11VideoProcessor, + pView: *mut ID3D11VideoProcessorOutputView, + OutputFrame: UINT, + StreamCount: UINT, + pStreams: *const D3D11_VIDEO_PROCESSOR_STREAM, + ) -> HRESULT, + fn NegotiateCryptoSessionKeyExchange( + pCryptoSession: *mut ID3D11CryptoSession, + DataSize: UINT, + pData: *mut c_void, + ) -> HRESULT, + fn EncryptionBlt( + pCryptoSession: *mut ID3D11CryptoSession, + pSrcSurface: *mut ID3D11Texture2D, + pDstSurface: *mut ID3D11Texture2D, + IVSize: UINT, + pIV: *mut c_void, + ) -> HRESULT, + fn DecryptionBlt( + pCryptoSession: *mut ID3D11CryptoSession, + pSrcSurface: *mut ID3D11Texture2D, + pDstSurface: *mut ID3D11Texture2D, + pEncryptedBlockInfo: *mut D3D11_ENCRYPTED_BLOCK_INFO, + ContentKeySize: UINT, + pContentKey: *const c_void, + IVSize: UINT, + pIV: *mut c_void, + ) -> HRESULT, + fn StartSessionKeyRefresh( + pCryptoSession: *mut ID3D11CryptoSession, + RandomNumberSize: UINT, + pRandomNumber: *mut c_void, + ) -> HRESULT, + fn FinishSessionKeyRefresh( + pCryptoSession: *mut ID3D11CryptoSession, + ) -> HRESULT, + fn GetEncryptionBltKey( + pCryptoSession: *mut ID3D11CryptoSession, + KeySize: UINT, + pReadbackKey: *mut c_void, + ) -> HRESULT, + fn NegotiateAuthenticatedChannelKeyExchange( + pChannel: *mut ID3D11AuthenticatedChannel, + DataSize: UINT, + pData: *mut c_void, + ) -> HRESULT, + fn QueryAuthenticatedChannel( + pChannel: *mut ID3D11AuthenticatedChannel, + InputSize: UINT, + pInput: *const c_void, + OutputSize: UINT, + pOutput: *mut c_void, + ) -> HRESULT, + fn ConfigureAuthenticatedChannel( + pChannel: *mut ID3D11AuthenticatedChannel, + InputSize: UINT, + pInput: *const c_void, + pOutput: *mut D3D11_AUTHENTICATED_CONFIGURE_OUTPUT, + ) -> HRESULT, + fn VideoProcessorSetStreamRotation( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Enable: BOOL, + Rotation: D3D11_VIDEO_PROCESSOR_ROTATION, + ) -> HRESULT, + fn VideoProcessorGetStreamRotation( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pEnable: *mut BOOL, + pRotation: *mut D3D11_VIDEO_PROCESSOR_ROTATION, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x10ec4d5b, 0x975a, 0x4689, 0xb9, 0xe4, 0xd0, 0xaa, 0xc3, 0x0f, 0xe3, 0x33)] +interface ID3D11VideoDevice(ID3D11VideoDeviceVtbl): IUnknown(IUnknownVtbl) { + fn CreateVideoDecoder( + pVideoDesc: *const D3D11_VIDEO_DECODER_DESC, + pConfig: *const D3D11_VIDEO_DECODER_CONFIG, + ppDecoder: *mut *mut ID3D11VideoDecoder, + ) -> HRESULT, + fn CreateVideoProcessor( + pEnum: *mut ID3D11VideoProcessorEnumerator, + RateConversionIndex: UINT, + ppVideoProcessor: *mut *mut ID3D11VideoProcessor, + ) -> HRESULT, + fn CreateAuthenticatedChannel( + ChannelType: D3D11_AUTHENTICATED_CHANNEL_TYPE, + ppAuthenticatedChannel: *mut *mut ID3D11AuthenticatedChannel, + ) -> HRESULT, + fn CreateCryptoSession( + pCryptoType: *const GUID, + pDecoderProfile: *const GUID, + pKeyExchangeType: *const GUID, + ppCryptoSession: *mut *mut ID3D11CryptoSession, + ) -> HRESULT, + fn CreateVideoDecoderOutputView( + pResource: *mut ID3D11Resource, + pDesc: *const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC, + ppVDOVView: *mut *mut ID3D11VideoDecoderOutputView, + ) -> HRESULT, + fn CreateVideoProcessorInputView( + pResource: *mut ID3D11Resource, + pEnum: *mut ID3D11VideoProcessorEnumerator, + pDesc: *const D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC, + ppVPIView: *mut *mut ID3D11VideoProcessorInputView, + ) -> HRESULT, + fn CreateVideoProcessorOutputView( + pResource: *mut ID3D11Resource, + pEnum: *mut ID3D11VideoProcessorEnumerator, + pDesc: *const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC, + ppVPOView: *mut *mut ID3D11VideoProcessorOutputView, + ) -> HRESULT, + fn CreateVideoProcessorEnumerator( + pDesc: *const D3D11_VIDEO_PROCESSOR_CONTENT_DESC, + ppEnum: *mut *mut ID3D11VideoProcessorEnumerator, + ) -> HRESULT, + fn GetVideoDecoderProfileCount() -> UINT, + fn GetVideoDecoderProfile( + Index: UINT, + pDecoderProfile: *mut GUID, + ) -> HRESULT, + fn CheckVideoDecoderFormat( + pDecoderProfile: *const GUID, + Format: DXGI_FORMAT, + pSupported: *mut BOOL, + ) -> HRESULT, + fn GetVideoDecoderConfigCount( + pDesc: *const D3D11_VIDEO_DECODER_DESC, + pCount: *mut UINT, + ) -> HRESULT, + fn GetVideoDecoderConfig( + pDesc: *const D3D11_VIDEO_DECODER_DESC, + Index: UINT, + pConfig: *mut D3D11_VIDEO_DECODER_CONFIG, + ) -> HRESULT, + fn GetContentProtectionCaps( + pCryptoType: *const GUID, + pDecoderProfile: *const GUID, + pCaps: *mut D3D11_VIDEO_CONTENT_PROTECTION_CAPS, + ) -> HRESULT, + fn CheckCryptoKeyExchange( + pCryptoType: *const GUID, + pDecoderProfile: *const GUID, + Index: UINT, + pKeyExchangeType: *mut GUID, + ) -> HRESULT, + fn SetPrivateData( + guid: REFGUID, + DataSize: UINT, + pData: *const c_void, + ) -> HRESULT, + fn SetPrivateDataInterface( + guid: REFGUID, + pData: *const IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdb6f6ddb, 0xac77, 0x4e88, 0x82, 0x53, 0x81, 0x9d, 0xf9, 0xbb, 0xf1, 0x40)] +interface ID3D11Device(ID3D11DeviceVtbl): IUnknown(IUnknownVtbl) { + fn CreateBuffer( + pDesc: *const D3D11_BUFFER_DESC, + pInitialData: *const D3D11_SUBRESOURCE_DATA, + ppBuffer: *mut *mut ID3D11Buffer, + ) -> HRESULT, + fn CreateTexture1D( + pDesc: *const D3D11_TEXTURE1D_DESC, + pInitialData: *const D3D11_SUBRESOURCE_DATA, + ppTexture1D: *mut *mut ID3D11Texture1D, + ) -> HRESULT, + fn CreateTexture2D( + pDesc: *const D3D11_TEXTURE2D_DESC, + pInitialData: *const D3D11_SUBRESOURCE_DATA, + ppTexture2D: *mut *mut ID3D11Texture2D, + ) -> HRESULT, + fn CreateTexture3D( + pDesc: *const D3D11_TEXTURE3D_DESC, + pInitialData: *const D3D11_SUBRESOURCE_DATA, + ppTexture3D: *mut *mut ID3D11Texture3D, + ) -> HRESULT, + fn CreateShaderResourceView( + pResource: *mut ID3D11Resource, + pDesc: *const D3D11_SHADER_RESOURCE_VIEW_DESC, + ppSRView: *mut *mut ID3D11ShaderResourceView, + ) -> HRESULT, + fn CreateUnorderedAccessView( + pResource: *mut ID3D11Resource, + pDesc: *const D3D11_UNORDERED_ACCESS_VIEW_DESC, + ppUAView: *mut *mut ID3D11UnorderedAccessView, + ) -> HRESULT, + fn CreateRenderTargetView( + pResource: *mut ID3D11Resource, + pDesc: *const D3D11_RENDER_TARGET_VIEW_DESC, + ppRTView: *mut *mut ID3D11RenderTargetView, + ) -> HRESULT, + fn CreateDepthStencilView( + pResource: *mut ID3D11Resource, + pDesc: *const D3D11_DEPTH_STENCIL_VIEW_DESC, + ppDepthStencilView: *mut *mut ID3D11DepthStencilView, + ) -> HRESULT, + fn CreateInputLayout( + pInputElementDescs: *const D3D11_INPUT_ELEMENT_DESC, + NumElements: UINT, + pShaderBytecodeWithInputSignature: *const c_void, + BytecodeLength: SIZE_T, + ppInputLayout: *mut *mut ID3D11InputLayout, + ) -> HRESULT, + fn CreateVertexShader( + pShaderBytecode: *const c_void, + BytecodeLength: SIZE_T, + pClassLinkage: *mut ID3D11ClassLinkage, + ppVertexShader: *mut *mut ID3D11VertexShader, + ) -> HRESULT, + fn CreateGeometryShader( + pShaderBytecode: *const c_void, + BytecodeLength: SIZE_T, + pClassLinkage: *mut ID3D11ClassLinkage, + ppGeometryShader: *mut *mut ID3D11GeometryShader, + ) -> HRESULT, + fn CreateGeometryShaderWithStreamOutput( + pShaderBytecode: *const c_void, + BytecodeLength: SIZE_T, + pSODeclaration: *const D3D11_SO_DECLARATION_ENTRY, + NumEntries: UINT, + pBufferStrides: *const UINT, + NumStrides: UINT, + RasterizedStream: UINT, + pClassLinkage: *mut ID3D11ClassLinkage, + ppGeometryShader: *mut *mut ID3D11GeometryShader, + ) -> HRESULT, + fn CreatePixelShader( + pShaderBytecode: *const c_void, + BytecodeLength: SIZE_T, + pClassLinkage: *mut ID3D11ClassLinkage, + ppPixelShader: *mut *mut ID3D11PixelShader, + ) -> HRESULT, + fn CreateHullShader( + pShaderBytecode: *const c_void, + BytecodeLength: SIZE_T, + pClassLinkage: *mut ID3D11ClassLinkage, + ppHullShader: *mut *mut ID3D11HullShader, + ) -> HRESULT, + fn CreateDomainShader( + pShaderBytecode: *const c_void, + BytecodeLength: SIZE_T, + pClassLinkage: *mut ID3D11ClassLinkage, + ppDomainShader: *mut *mut ID3D11DomainShader, + ) -> HRESULT, + fn CreateComputeShader( + pShaderBytecode: *const c_void, + BytecodeLength: SIZE_T, + pClassLinkage: *mut ID3D11ClassLinkage, + ppComputeShader: *mut *mut ID3D11ComputeShader, + ) -> HRESULT, + fn CreateClassLinkage( + ppLinkage: *mut *mut ID3D11ClassLinkage, + ) -> HRESULT, + fn CreateBlendState( + pBlendStateDesc: *const D3D11_BLEND_DESC, + ppBlendState: *mut *mut ID3D11BlendState, + ) -> HRESULT, + fn CreateDepthStencilState( + pDepthStencilDesc: *const D3D11_DEPTH_STENCIL_DESC, + ppDepthStencilState: *mut *mut ID3D11DepthStencilState, + ) -> HRESULT, + fn CreateRasterizerState( + pRasterizerDesc: *const D3D11_RASTERIZER_DESC, + ppRasterizerState: *mut *mut ID3D11RasterizerState, + ) -> HRESULT, + fn CreateSamplerState( + pSamplerDesc: *const D3D11_SAMPLER_DESC, + ppSamplerState: *mut *mut ID3D11SamplerState, + ) -> HRESULT, + fn CreateQuery( + pQueryDesc: *const D3D11_QUERY_DESC, + ppQuery: *mut *mut ID3D11Query, + ) -> HRESULT, + fn CreatePredicate( + pPredicateDesc: *const D3D11_QUERY_DESC, + ppPredicate: *mut *mut ID3D11Predicate, + ) -> HRESULT, + fn CreateCounter( + pCounterDesc: *const D3D11_COUNTER_DESC, + ppCounter: *mut *mut ID3D11Counter, + ) -> HRESULT, + fn CreateDeferredContext( + ContextFlags: UINT, + ppDeferredContext: *mut *mut ID3D11DeviceContext, + ) -> HRESULT, + fn OpenSharedResource( + hResource: HANDLE, + ReturnedInterface: REFIID, + ppResource: *mut *mut c_void, + ) -> HRESULT, + fn CheckFormatSupport( + Format: DXGI_FORMAT, + pFormatSupport: *mut UINT, + ) -> HRESULT, + fn CheckMultisampleQualityLevels( + Format: DXGI_FORMAT, + SampleCount: UINT, + pNumQualityLevels: *mut UINT, + ) -> HRESULT, + fn CheckCounterInfo( + pCounterInfo: *mut D3D11_COUNTER_INFO, + ) -> (), + fn CheckCounter( + pDesc: *const D3D11_COUNTER_DESC, + pType: *mut D3D11_COUNTER_TYPE, + pActiveCounters: *mut UINT, + szName: LPSTR, + pNameLength: *mut UINT, + szUnits: LPSTR, + pUnitsLength: *mut UINT, + szDescription: LPSTR, + pDescriptionLength: *mut UINT, + ) -> HRESULT, + fn CheckFeatureSupport( + Feature: D3D11_FEATURE, + pFeatureSupportData: *mut c_void, + FeatureSupportDataSize: UINT, + ) -> HRESULT, + fn GetPrivateData( + guid: REFGUID, + pDataSize: *mut UINT, + pData: *mut c_void, + ) -> HRESULT, + fn SetPrivateData( + guid: REFGUID, + DataSize: UINT, + pData: *const c_void, + ) -> HRESULT, + fn SetPrivateDataInterface( + guid: REFGUID, + pData: *const IUnknown, + ) -> HRESULT, + fn GetFeatureLevel() -> D3D_FEATURE_LEVEL, + fn GetCreationFlags() -> UINT, + fn GetDeviceRemovedReason() -> HRESULT, + fn GetImmediateContext( + ppImmediateContext: *mut *mut ID3D11DeviceContext, + ) -> (), + fn SetExceptionMode( + RaiseFlags: UINT, + ) -> HRESULT, + fn GetExceptionMode() -> UINT, +}} +ENUM!{enum D3D11_CREATE_DEVICE_FLAG { + D3D11_CREATE_DEVICE_SINGLETHREADED = 0x1, + D3D11_CREATE_DEVICE_DEBUG = 0x2, + D3D11_CREATE_DEVICE_SWITCH_TO_REF = 0x4, + D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8, + D3D11_CREATE_DEVICE_BGRA_SUPPORT = 0x20, + D3D11_CREATE_DEVICE_DEBUGGABLE = 0x40, + D3D11_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY = 0x80, + D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT = 0x100, + D3D11_CREATE_DEVICE_VIDEO_SUPPORT = 0x800, +}} +pub const D3D11_SDK_VERSION: DWORD = 7; +#[inline] +pub fn D3D11CalcSubresource(MipSlice: UINT, ArraySlice: UINT, MipLevels: UINT) -> UINT { + MipSlice + ArraySlice * MipLevels +} +extern "system" { + pub fn D3D11CreateDevice( + pAdapter: *mut IDXGIAdapter, + DriverType: D3D_DRIVER_TYPE, + Software: HMODULE, + Flags: UINT, + pFeatureLevels: *const D3D_FEATURE_LEVEL, + FeatureLevels: UINT, + SDKVersion: UINT, + ppDevice: *mut *mut ID3D11Device, + pFeatureLevel: *mut D3D_FEATURE_LEVEL, + ppImmediateContext: *mut *mut ID3D11DeviceContext, + ) -> HRESULT; + pub fn D3D11CreateDeviceAndSwapChain( + pAdapter: *mut IDXGIAdapter, + DriverType: D3D_DRIVER_TYPE, + Software: HMODULE, + Flags: UINT, + pFeatureLevels: *const D3D_FEATURE_LEVEL, + FeatureLevels: UINT, + SDKVersion: UINT, + pSwapChainDesc: *const DXGI_SWAP_CHAIN_DESC, + ppSwapChain: *mut *mut IDXGISwapChain, + ppDevice: *mut *mut ID3D11Device, + pFeatureLevel: *mut D3D_FEATURE_LEVEL, + ppImmediateContext: *mut *mut ID3D11DeviceContext, + ) -> HRESULT; +} +DEFINE_GUID!{IID_ID3D11DeviceChild, + 0x1841e5c8, 0x16b0, 0x489b, 0xbc, 0xc8, 0x44, 0xcf, 0xb0, 0xd5, 0xde, 0xae} +DEFINE_GUID!{IID_ID3D11DepthStencilState, + 0x03823efb, 0x8d8f, 0x4e1c, 0x9a, 0xa2, 0xf6, 0x4b, 0xb2, 0xcb, 0xfd, 0xf1} +DEFINE_GUID!{IID_ID3D11BlendState, + 0x75b68faa, 0x347d, 0x4159, 0x8f, 0x45, 0xa0, 0x64, 0x0f, 0x01, 0xcd, 0x9a} +DEFINE_GUID!{IID_ID3D11RasterizerState, + 0x9bb4ab81, 0xab1a, 0x4d8f, 0xb5, 0x06, 0xfc, 0x04, 0x20, 0x0b, 0x6e, 0xe7} +DEFINE_GUID!{IID_ID3D11Resource, + 0xdc8e63f3, 0xd12b, 0x4952, 0xb4, 0x7b, 0x5e, 0x45, 0x02, 0x6a, 0x86, 0x2d} +DEFINE_GUID!{IID_ID3D11Buffer, + 0x48570b85, 0xd1ee, 0x4fcd, 0xa2, 0x50, 0xeb, 0x35, 0x07, 0x22, 0xb0, 0x37} +DEFINE_GUID!{IID_ID3D11Texture1D, + 0xf8fb5c27, 0xc6b3, 0x4f75, 0xa4, 0xc8, 0x43, 0x9a, 0xf2, 0xef, 0x56, 0x4c} +DEFINE_GUID!{IID_ID3D11Texture2D, + 0x6f15aaf2, 0xd208, 0x4e89, 0x9a, 0xb4, 0x48, 0x95, 0x35, 0xd3, 0x4f, 0x9c} +DEFINE_GUID!{IID_ID3D11Texture3D, + 0x037e866e, 0xf56d, 0x4357, 0xa8, 0xaf, 0x9d, 0xab, 0xbe, 0x6e, 0x25, 0x0e} +DEFINE_GUID!{IID_ID3D11View, + 0x839d1216, 0xbb2e, 0x412b, 0xb7, 0xf4, 0xa9, 0xdb, 0xeb, 0xe0, 0x8e, 0xd1} +DEFINE_GUID!{IID_ID3D11ShaderResourceView, + 0xb0e06fe0, 0x8192, 0x4e1a, 0xb1, 0xca, 0x36, 0xd7, 0x41, 0x47, 0x10, 0xb2} +DEFINE_GUID!{IID_ID3D11RenderTargetView, + 0xdfdba067, 0x0b8d, 0x4865, 0x87, 0x5b, 0xd7, 0xb4, 0x51, 0x6c, 0xc1, 0x64} +DEFINE_GUID!{IID_ID3D11DepthStencilView, + 0x9fdac92a, 0x1876, 0x48c3, 0xaf, 0xad, 0x25, 0xb9, 0x4f, 0x84, 0xa9, 0xb6} +DEFINE_GUID!{IID_ID3D11UnorderedAccessView, + 0x28acf509, 0x7f5c, 0x48f6, 0x86, 0x11, 0xf3, 0x16, 0x01, 0x0a, 0x63, 0x80} +DEFINE_GUID!{IID_ID3D11VertexShader, + 0x3b301d64, 0xd678, 0x4289, 0x88, 0x97, 0x22, 0xf8, 0x92, 0x8b, 0x72, 0xf3} +DEFINE_GUID!{IID_ID3D11HullShader, + 0x8e5c6061, 0x628a, 0x4c8e, 0x82, 0x64, 0xbb, 0xe4, 0x5c, 0xb3, 0xd5, 0xdd} +DEFINE_GUID!{IID_ID3D11DomainShader, + 0xf582c508, 0x0f36, 0x490c, 0x99, 0x77, 0x31, 0xee, 0xce, 0x26, 0x8c, 0xfa} +DEFINE_GUID!{IID_ID3D11GeometryShader, + 0x38325b96, 0xeffb, 0x4022, 0xba, 0x02, 0x2e, 0x79, 0x5b, 0x70, 0x27, 0x5c} +DEFINE_GUID!{IID_ID3D11PixelShader, + 0xea82e40d, 0x51dc, 0x4f33, 0x93, 0xd4, 0xdb, 0x7c, 0x91, 0x25, 0xae, 0x8c} +DEFINE_GUID!{IID_ID3D11ComputeShader, + 0x4f5b196e, 0xc2bd, 0x495e, 0xbd, 0x01, 0x1f, 0xde, 0xd3, 0x8e, 0x49, 0x69} +DEFINE_GUID!{IID_ID3D11InputLayout, + 0xe4819ddc, 0x4cf0, 0x4025, 0xbd, 0x26, 0x5d, 0xe8, 0x2a, 0x3e, 0x07, 0xb7} +DEFINE_GUID!{IID_ID3D11SamplerState, + 0xda6fea51, 0x564c, 0x4487, 0x98, 0x10, 0xf0, 0xd0, 0xf9, 0xb4, 0xe3, 0xa5} +DEFINE_GUID!{IID_ID3D11Asynchronous, + 0x4b35d0cd, 0x1e15, 0x4258, 0x9c, 0x98, 0x1b, 0x13, 0x33, 0xf6, 0xdd, 0x3b} +DEFINE_GUID!{IID_ID3D11Query, + 0xd6c00747, 0x87b7, 0x425e, 0xb8, 0x4d, 0x44, 0xd1, 0x08, 0x56, 0x0a, 0xfd} +DEFINE_GUID!{IID_ID3D11Predicate, + 0x9eb576dd, 0x9f77, 0x4d86, 0x81, 0xaa, 0x8b, 0xab, 0x5f, 0xe4, 0x90, 0xe2} +DEFINE_GUID!{IID_ID3D11Counter, + 0x6e8c49fb, 0xa371, 0x4770, 0xb4, 0x40, 0x29, 0x08, 0x60, 0x22, 0xb7, 0x41} +DEFINE_GUID!{IID_ID3D11ClassInstance, + 0xa6cd7faa, 0xb0b7, 0x4a2f, 0x94, 0x36, 0x86, 0x62, 0xa6, 0x57, 0x97, 0xcb} +DEFINE_GUID!{IID_ID3D11ClassLinkage, + 0xddf57cba, 0x9543, 0x46e4, 0xa1, 0x2b, 0xf2, 0x07, 0xa0, 0xfe, 0x7f, 0xed} +DEFINE_GUID!{IID_ID3D11CommandList, + 0xa24bc4d1, 0x769e, 0x43f7, 0x80, 0x13, 0x98, 0xff, 0x56, 0x6c, 0x18, 0xe2} +DEFINE_GUID!{IID_ID3D11DeviceContext, + 0xc0bfa96c, 0xe089, 0x44fb, 0x8e, 0xaf, 0x26, 0xf8, 0x79, 0x61, 0x90, 0xda} +DEFINE_GUID!{IID_ID3D11VideoDecoder, + 0x3c9c5b51, 0x995d, 0x48d1, 0x9b, 0x8d, 0xfa, 0x5c, 0xae, 0xde, 0xd6, 0x5c} +DEFINE_GUID!{IID_ID3D11VideoProcessorEnumerator, + 0x31627037, 0x53ab, 0x4200, 0x90, 0x61, 0x05, 0xfa, 0xa9, 0xab, 0x45, 0xf9} +DEFINE_GUID!{IID_ID3D11VideoProcessor, + 0x1d7b0652, 0x185f, 0x41c6, 0x85, 0xce, 0x0c, 0x5b, 0xe3, 0xd4, 0xae, 0x6c} +DEFINE_GUID!{IID_ID3D11AuthenticatedChannel, + 0x3015a308, 0xdcbd, 0x47aa, 0xa7, 0x47, 0x19, 0x24, 0x86, 0xd1, 0x4d, 0x4a} +DEFINE_GUID!{IID_ID3D11CryptoSession, + 0x9b32f9ad, 0xbdcc, 0x40a6, 0xa3, 0x9d, 0xd5, 0xc8, 0x65, 0x84, 0x57, 0x20} +DEFINE_GUID!{IID_ID3D11VideoDecoderOutputView, + 0xc2931aea, 0x2a85, 0x4f20, 0x86, 0x0f, 0xfb, 0xa1, 0xfd, 0x25, 0x6e, 0x18} +DEFINE_GUID!{IID_ID3D11VideoProcessorInputView, + 0x11ec5a5f, 0x51dc, 0x4945, 0xab, 0x34, 0x6e, 0x8c, 0x21, 0x30, 0x0e, 0xa5} +DEFINE_GUID!{IID_ID3D11VideoProcessorOutputView, + 0xa048285e, 0x25a9, 0x4527, 0xbd, 0x93, 0xd6, 0x8b, 0x68, 0xc4, 0x42, 0x54} +DEFINE_GUID!{IID_ID3D11VideoContext, + 0x61f21c45, 0x3c0e, 0x4a74, 0x9c, 0xea, 0x67, 0x10, 0x0d, 0x9a, 0xd5, 0xe4} +DEFINE_GUID!{IID_ID3D11VideoDevice, + 0x10ec4d5b, 0x975a, 0x4689, 0xb9, 0xe4, 0xd0, 0xaa, 0xc3, 0x0f, 0xe3, 0x33} +DEFINE_GUID!{IID_ID3D11Device, + 0xdb6f6ddb, 0xac77, 0x4e88, 0x82, 0x53, 0x81, 0x9d, 0xf9, 0xbb, 0xf1, 0x40} diff --git a/bash-5.1/vendor/winapi/src/um/d3d11_1.rs b/bash-5.1/vendor/winapi/src/um/d3d11_1.rs new file mode 100644 index 0000000000000000000000000000000000000000..7b0b46ec2aff4f489b5c7aaec120f9dddcf3d73c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d11_1.rs @@ -0,0 +1,484 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_void; +use shared::basetsd::{UINT64, UINT8}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::dxgitype::{DXGI_COLOR_SPACE_TYPE, DXGI_RATIONAL}; +use shared::guiddef::{GUID, REFIID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT, INT, UINT}; +use um::d3d11::{ + D3D11_BLEND, D3D11_BLEND_OP, D3D11_BOX, D3D11_CULL_MODE, D3D11_FILL_MODE, D3D11_RECT, + D3D11_VIDEO_DECODER_BUFFER_TYPE, D3D11_VIDEO_DECODER_CONFIG, D3D11_VIDEO_DECODER_DESC, + ID3D11BlendState, ID3D11BlendStateVtbl, ID3D11Buffer, ID3D11CryptoSession, ID3D11Device, + ID3D11DeviceChild, ID3D11DeviceChildVtbl, ID3D11DeviceContext, ID3D11DeviceContextVtbl, + ID3D11DeviceVtbl, ID3D11RasterizerState, ID3D11RasterizerStateVtbl, ID3D11Resource, + ID3D11VideoContext, ID3D11VideoContextVtbl, ID3D11VideoDecoder, ID3D11VideoDevice, + ID3D11VideoDeviceVtbl, ID3D11VideoProcessor, ID3D11VideoProcessorEnumerator, + ID3D11VideoProcessorEnumeratorVtbl, ID3D11View +}; +use um::d3dcommon::D3D_FEATURE_LEVEL; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, LPCWSTR}; +DEFINE_GUID!{IID_ID3D11BlendState1, + 0xcc86fabe, 0xda55, 0x401d, 0x85, 0xe7, 0xe3, 0xc9, 0xde, 0x28, 0x77, 0xe9} +DEFINE_GUID!{IID_ID3D11RasterizerState1, + 0x1217d7a6, 0x5039, 0x418c, 0xb0, 0x42, 0x9c, 0xbe, 0x25, 0x6a, 0xfd, 0x6e} +DEFINE_GUID!{IID_ID3DDeviceContextState, + 0x5c1e0d8a, 0x7c23, 0x48f9, 0x8c, 0x59, 0xa9, 0x29, 0x58, 0xce, 0xff, 0x11} +DEFINE_GUID!{IID_ID3D11DeviceContext1, + 0xbb2c6faa, 0xb5fb, 0x4082, 0x8e, 0x6b, 0x38, 0x8b, 0x8c, 0xfa, 0x90, 0xe1} +DEFINE_GUID!{IID_ID3D11VideoContext1, + 0xa7f026da, 0xa5f8, 0x4487, 0xa5, 0x64, 0x15, 0xe3, 0x43, 0x57, 0x65, 0x1e} +DEFINE_GUID!{IID_ID3D11VideoDevice1, + 0x29da1d51, 0x1321, 0x4454, 0x80, 0x4b, 0xf5, 0xfc, 0x9f, 0x86, 0x1f, 0x0f} +DEFINE_GUID!{IID_ID3D11VideoProcessorEnumerator1, + 0x465217f2, 0x5568, 0x43cf, 0xb5, 0xb9, 0xf6, 0x1d, 0x54, 0x53, 0x1c, 0xa1} +DEFINE_GUID!{IID_ID3D11Device1, + 0xa04bfb29, 0x08ef, 0x43d6, 0xa4, 0x9c, 0xa9, 0xbd, 0xbd, 0xcb, 0xe6, 0x86} +DEFINE_GUID!{IID_ID3DUserDefinedAnnotation, + 0xb2daad8b, 0x03d4, 0x4dbf, 0x95, 0xeb, 0x32, 0xab, 0x4b, 0x63, 0xd0, 0xab} +ENUM!{enum D3D11_COPY_FLAGS { + D3D11_COPY_NO_OVERWRITE = 0x00000001, + D3D11_COPY_DISCARD = 0x00000002, +}} +ENUM!{enum D3D11_LOGIC_OP { + D3D11_LOGIC_OP_CLEAR = 0, + D3D11_LOGIC_OP_SET = 1, + D3D11_LOGIC_OP_COPY = 2, + D3D11_LOGIC_OP_COPY_INVERTED = 3, + D3D11_LOGIC_OP_NOOP = 4, + D3D11_LOGIC_OP_INVERT = 5, + D3D11_LOGIC_OP_AND = 6, + D3D11_LOGIC_OP_NAND = 7, + D3D11_LOGIC_OP_OR = 8, + D3D11_LOGIC_OP_NOR = 9, + D3D11_LOGIC_OP_XOR = 10, + D3D11_LOGIC_OP_EQUIV = 11, + D3D11_LOGIC_OP_AND_REVERSE = 12, + D3D11_LOGIC_OP_AND_INVERTED = 13, + D3D11_LOGIC_OP_OR_REVERSE = 14, + D3D11_LOGIC_OP_OR_INVERTED = 15, +}} +STRUCT!{struct D3D11_RENDER_TARGET_BLEND_DESC1 { + BlendEnable: BOOL, + LogicOpEnable: BOOL, + SrcBlend: D3D11_BLEND, + DestBlend: D3D11_BLEND, + BlendOp: D3D11_BLEND_OP, + SrcBlendAlpha: D3D11_BLEND, + DestBlendAlpha: D3D11_BLEND, + BlendOpAlpha: D3D11_BLEND_OP, + LogicOp: D3D11_LOGIC_OP, + RenderTargetWriteMask: UINT8, +}} +STRUCT!{struct D3D11_BLEND_DESC1 { + AlphaToCoverageEnable: BOOL, + IndependentBlendEnable: BOOL, + RenderTarget: [D3D11_RENDER_TARGET_BLEND_DESC1; 8], +}} +RIDL!{#[uuid(0xcc86fabe, 0xda55, 0x401d, 0x85, 0xe7, 0xe3, 0xc9, 0xde, 0x28, 0x77, 0xe9)] +interface ID3D11BlendState1(ID3D11BlendState1Vtbl): ID3D11BlendState(ID3D11BlendStateVtbl) { + fn GetDesc1( + pDesc: *mut D3D11_BLEND_DESC1, + ) -> (), +}} +STRUCT!{struct D3D11_RASTERIZER_DESC1 { + FillMode: D3D11_FILL_MODE, + CullMode: D3D11_CULL_MODE, + FrontCounterClockwise: BOOL, + DepthBias: INT, + DepthBiasClamp: FLOAT, + SlopeScaledDepthBias: FLOAT, + DepthClipEnable: BOOL, + ScissorEnable: BOOL, + MultisampleEnable: BOOL, + AntialiasedLineEnable: BOOL, + ForcedSampleCount: UINT, +}} +RIDL!{#[uuid(0x1217d7a6, 0x5039, 0x418c, 0xb0, 0x42, 0x9c, 0xbe, 0x25, 0x6a, 0xfd, 0x6e)] +interface ID3D11RasterizerState1(ID3D11RasterizerState1Vtbl): + ID3D11RasterizerState(ID3D11RasterizerStateVtbl) { + fn GetDesc1( + pDesc: *mut D3D11_RASTERIZER_DESC1, + ) -> (), +}} +ENUM!{enum D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG { + D3D11_1_CREATE_DEVICE_CONTEXT_STATE_SINGLETHREADED = 0x1, +}} +RIDL!{#[uuid(0x5c1e0d8a, 0x7c23, 0x48f9, 0x8c, 0x59, 0xa9, 0x29, 0x58, 0xce, 0xff, 0x11)] +interface ID3DDeviceContextState(ID3DDeviceContextStateVtbl): + ID3D11DeviceChild(ID3D11DeviceChildVtbl) {}} +RIDL!{#[uuid(0xbb2c6faa, 0xb5fb, 0x4082, 0x8e, 0x6b, 0x38, 0x8b, 0x8c, 0xfa, 0x90, 0xe1)] +interface ID3D11DeviceContext1(ID3D11DeviceContext1Vtbl): + ID3D11DeviceContext(ID3D11DeviceContextVtbl) { + fn CopySubresourceRegion1( + pDstResource: *mut ID3D11Resource, + DstSubresource: UINT, + DstX: UINT, + DstY: UINT, + DstZ: UINT, + pSrcResource: *mut ID3D11Resource, + SrcSubresource: UINT, + pSrcBox: *const D3D11_BOX, + CopyFlags: UINT, + ) -> (), + fn UpdateSubresource1( + pDstResource: *mut ID3D11Resource, + DstSubresource: UINT, + pDstBox: *const D3D11_BOX, + pSrcData: *mut c_void, + SrcRowPitch: UINT, + SrcDepthPitch: UINT, + CopyFlags: UINT, + ) -> (), + fn DiscardResource( + pResource: *mut ID3D11Resource, + ) -> (), + fn DiscardView( + pResource: *mut ID3D11Resource, + ) -> (), + fn VSSetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + pFirstConstant: *const UINT, + pNumConstants: *const UINT, + ) -> (), + fn HSSetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + pFirstConstant: *const UINT, + pNumConstants: *const UINT, + ) -> (), + fn DSSetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + pFirstConstant: *const UINT, + pNumConstants: *const UINT, + ) -> (), + fn GSSetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + pFirstConstant: *const UINT, + pNumConstants: *const UINT, + ) -> (), + fn PSSetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + pFirstConstant: *const UINT, + pNumConstants: *const UINT, + ) -> (), + fn CSSetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *const *mut ID3D11Buffer, + pFirstConstant: *const UINT, + pNumConstants: *const UINT, + ) -> (), + fn VSGetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + pFirstConstant: *mut UINT, + pNumConstants: *mut UINT, + ) -> (), + fn HSGetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + pFirstConstant: *mut UINT, + pNumConstants: *mut UINT, + ) -> (), + fn DSGetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + pFirstConstant: *mut UINT, + pNumConstants: *mut UINT, + ) -> (), + fn GSGetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + pFirstConstant: *mut UINT, + pNumConstants: *mut UINT, + ) -> (), + fn PSGetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + pFirstConstant: *mut UINT, + pNumConstants: *mut UINT, + ) -> (), + fn CSGetConstantBuffers1( + StartSlot: UINT, + NumBuffers: UINT, + ppConstantBuffers: *mut *mut ID3D11Buffer, + pFirstConstant: *mut UINT, + pNumConstants: *mut UINT, + ) -> (), + fn SwapDeviceContextState( + pState: *mut ID3DDeviceContextState, + ppPreviousState: *mut *mut ID3DDeviceContextState, + ) -> (), + fn ClearView( + pView: *mut ID3D11View, + Color: [FLOAT; 4], + pRect: *const D3D11_RECT, + NumRects: UINT, + ) -> (), + fn DiscardView1( + pResourceView: *mut ID3D11View, + pRects: *const D3D11_RECT, + NumRects: UINT, + ) -> (), +}} +STRUCT!{struct D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK { + ClearSize: UINT, + EncryptedSize: UINT, +}} +STRUCT!{struct D3D11_VIDEO_DECODER_BUFFER_DESC1 { + BufferType: D3D11_VIDEO_DECODER_BUFFER_TYPE, + DataOffset: UINT, + DataSize: UINT, + pIV: *mut c_void, + IVSize: UINT, + pSubSampleMappingBlock: *mut D3D11_VIDEO_DECODER_SUB_SAMPLE_MAPPING_BLOCK, + SubSampleMappingCount: UINT, +}} +STRUCT!{struct D3D11_VIDEO_DECODER_BEGIN_FRAME_CRYPTO_SESSION { + pCryptoSession: *mut ID3D11CryptoSession, + BlobSize: UINT, + pBlob: *mut c_void, + pKeyInfoId: *mut GUID, + PrivateDataSize: UINT, + pPrivateData: *mut c_void, +}} +ENUM!{enum D3D11_VIDEO_DECODER_CAPS { + D3D11_VIDEO_DECODER_CAPS_DOWNSAMPLE = 0x1, + D3D11_VIDEO_DECODER_CAPS_NON_REAL_TIME = 0x02, + D3D11_VIDEO_DECODER_CAPS_DOWNSAMPLE_DYNAMIC = 0x04, + D3D11_VIDEO_DECODER_CAPS_DOWNSAMPLE_REQUIRED = 0x08, + D3D11_VIDEO_DECODER_CAPS_UNSUPPORTED = 0x10, +}} +ENUM!{enum D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINTS { + D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_MULTIPLANE_OVERLAY_ROTATION = 0x01, + D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_MULTIPLANE_OVERLAY_RESIZE = 0x02, + D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_MULTIPLANE_OVERLAY_COLOR_SPACE_CONVERSION = 0x04, + D3D11_VIDEO_PROCESSOR_BEHAVIOR_HINT_TRIPLE_BUFFER_OUTPUT = 0x08, +}} +STRUCT!{struct D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT { + Enable: BOOL, + Width: UINT, + Height: UINT, + Format: DXGI_FORMAT, +}} +ENUM!{enum D3D11_CRYPTO_SESSION_STATUS { + D3D11_CRYPTO_SESSION_STATUS_OK = 0, + D3D11_CRYPTO_SESSION_STATUS_KEY_LOST = 1, + D3D11_CRYPTO_SESSION_STATUS_KEY_AND_CONTENT_LOST = 2, +}} +STRUCT!{struct D3D11_KEY_EXCHANGE_HW_PROTECTION_INPUT_DATA { + PrivateDataSize: UINT, + HWProtectionDataSize: UINT, + pbInput: [BYTE; 4], +}} +STRUCT!{struct D3D11_KEY_EXCHANGE_HW_PROTECTION_OUTPUT_DATA { + PrivateDataSize: UINT, + MaxHWProtectionDataSize: UINT, + HWProtectionDataSize: UINT, + TransportTime: UINT64, + ExecutionTime: UINT64, + pbOutput: [BYTE; 4], +}} +STRUCT!{struct D3D11_KEY_EXCHANGE_HW_PROTECTION_DATA { + HWProtectionFunctionID: UINT, + pInputData: *mut D3D11_KEY_EXCHANGE_HW_PROTECTION_INPUT_DATA, + pOutputData: *mut D3D11_KEY_EXCHANGE_HW_PROTECTION_OUTPUT_DATA, + Status: HRESULT, +}} +STRUCT!{struct D3D11_VIDEO_SAMPLE_DESC { + Width: UINT, + Height: UINT, + Format: DXGI_FORMAT, + ColorSpace: DXGI_COLOR_SPACE_TYPE, +}} +RIDL!{#[uuid(0xa7f026da, 0xa5f8, 0x4487, 0xa5, 0x64, 0x15, 0xe3, 0x43, 0x57, 0x65, 0x1e)] +interface ID3D11VideoContext1(ID3D11VideoContext1Vtbl): + ID3D11VideoContext(ID3D11VideoContextVtbl) { + fn SubmitDecoderBuffers1( + pDecoder: *mut ID3D11VideoDecoder, + NumBuffers: UINT, + pBufferDesc: *const D3D11_VIDEO_DECODER_BUFFER_DESC1, + ) -> HRESULT, + fn GetDataForNewHardwareKey( + pCryptoSession: *mut ID3D11CryptoSession, + PrivateInputSize: UINT, + pPrivateInputData: *const c_void, + pPrivateOutputData: *mut UINT64, + ) -> HRESULT, + fn CheckCryptoSessionStatus( + pCryptoSession: *mut ID3D11CryptoSession, + pStatus: *mut D3D11_CRYPTO_SESSION_STATUS, + ) -> HRESULT, + fn DecoderEnableDownsampling( + pDecoder: *mut ID3D11VideoDecoder, + InputColorSpace: DXGI_COLOR_SPACE_TYPE, + pOutputDesc: *const D3D11_VIDEO_SAMPLE_DESC, + ReferenceFrameCount: UINT, + ) -> HRESULT, + fn DecoderUpdateDownsampling( + pDecoder: *mut ID3D11VideoDecoder, + pOutputDesc: *const D3D11_VIDEO_SAMPLE_DESC, + ) -> HRESULT, + fn VideoProcessorSetOutputColorSpace1( + pVideoProcessor: *mut ID3D11VideoProcessor, + ColorSpace: DXGI_COLOR_SPACE_TYPE, + ) -> (), + fn VideoProcessorSetOutputShaderUsage( + pVideoProcessor: *mut ID3D11VideoProcessor, + ShaderUsage: BOOL, + ) -> (), + fn VideoProcessorGetOutputColorSpace1( + pVideoProcessor: *mut ID3D11VideoProcessor, + pColorSpace: *mut DXGI_COLOR_SPACE_TYPE, + ) -> (), + fn VideoProcessorGetOutputShaderUsage( + pVideoProcessor: *mut ID3D11VideoProcessor, + pShaderUsage: *mut BOOL, + ) -> (), + fn VideoProcessorSetStreamColorSpace1( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + ColorSpace: DXGI_COLOR_SPACE_TYPE, + ) -> (), + fn VideoProcessorSetStreamMirror( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + Enable: BOOL, + FlipHorizontal: BOOL, + FlipVertical: BOOL, + ) -> (), + fn VideoProcessorGetStreamColorSpace1( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pColorSpace: *mut DXGI_COLOR_SPACE_TYPE, + ) -> (), + fn VideoProcessorGetStreamMirror( + pVideoProcessor: *mut ID3D11VideoProcessor, + StreamIndex: UINT, + pEnable: *mut BOOL, + pFlipHorizontal: *mut BOOL, + pFlipVertical: *mut BOOL, + ) -> (), + fn VideoProcessorGetBehaviorHints( + pVideoProcessor: *mut ID3D11VideoProcessor, + OutputWidth: UINT, + OutputHeight: UINT, + OutputFormat: DXGI_FORMAT, + StreamCount: UINT, + pStreams: *const D3D11_VIDEO_PROCESSOR_STREAM_BEHAVIOR_HINT, + pBehaviorHints: *mut UINT, + ) -> (), +}} +RIDL!{#[uuid(0x29da1d51, 0x1321, 0x4454, 0x80, 0x4b, 0xf5, 0xfc, 0x9f, 0x86, 0x1f, 0x0f)] +interface ID3D11VideoDevice1(ID3D11VideoDevice1Vtbl): ID3D11VideoDevice(ID3D11VideoDeviceVtbl) { + fn GetCryptoSessionPrivateDataSize( + pCryptoType: *const GUID, + pDecoderProfile: *const GUID, + pKeyExchangeType: *const GUID, + pPrivateInputSize: *mut UINT, + pPrivateOutputSize: *mut UINT, + ) -> HRESULT, + fn GetVideoDecoderCaps( + pDecoderProfile: *const GUID, + SampleWidth: UINT, + SampleHeight: UINT, + pFrameRate: *const DXGI_RATIONAL, + BitRate: UINT, + pCryptoType: *const GUID, + pDecoderCaps: *mut UINT, + ) -> HRESULT, + fn CheckVideoDecoderDownsampling( + pInputDesc: *const D3D11_VIDEO_DECODER_DESC, + InputColorSpace: DXGI_COLOR_SPACE_TYPE, + pInputConfig: *const D3D11_VIDEO_DECODER_CONFIG, + pFrameRate: *const DXGI_RATIONAL, + pOutputDesc: *const D3D11_VIDEO_SAMPLE_DESC, + pSupported: *mut BOOL, + pRealTimeHint: *mut BOOL, + ) -> HRESULT, + fn RecommendVideoDecoderDownsampleParameters( + pInputDesc: *const D3D11_VIDEO_DECODER_DESC, + InputColorSpace: DXGI_COLOR_SPACE_TYPE, + pInputConfig: *const D3D11_VIDEO_DECODER_CONFIG, + pRecommendedOutputDesc: *mut D3D11_VIDEO_SAMPLE_DESC, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x465217f2, 0x5568, 0x43cf, 0xb5, 0xb9, 0xf6, 0x1d, 0x54, 0x53, 0x1c, 0xa1)] +interface ID3D11VideoProcessorEnumerator1(ID3D11VideoProcessorEnumerator1Vtbl): + ID3D11VideoProcessorEnumerator(ID3D11VideoProcessorEnumeratorVtbl) { + fn CheckVideoProcessorFormatConversion( + InputFormat: DXGI_FORMAT, + InputCOlorSpace: DXGI_COLOR_SPACE_TYPE, + OutputFormat: DXGI_FORMAT, + OutputColorSpace: DXGI_COLOR_SPACE_TYPE, + pSupported: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa04bfb29, 0x08ef, 0x43d6, 0xa4, 0x9c, 0xa9, 0xbd, 0xbd, 0xcb, 0xe6, 0x86)] +interface ID3D11Device1(ID3D11Device1Vtbl): ID3D11Device(ID3D11DeviceVtbl) { + fn GetImmediateContext1( + ppImmediateContext: *mut *mut ID3D11DeviceContext1, + ) -> (), + fn CreateDeferredContext1( + ContextFlags: UINT, + ppDeferredContext: *mut *mut ID3D11DeviceContext1, + ) -> HRESULT, + fn CreateBlendState( + pBlendStateDesc: *const D3D11_BLEND_DESC1, + ppBlendState: *mut *mut ID3D11BlendState1, + ) -> HRESULT, + fn CreateRasterizerState( + pRasterizerDesc: *const D3D11_RASTERIZER_DESC1, + ppRasterizerState: *mut *mut ID3D11RasterizerState1, + ) -> HRESULT, + fn CreateDeviceContextState( + Flags: UINT, + pFeatureLevels: *const D3D_FEATURE_LEVEL, + FeatureLevels: UINT, + SDKVersion: UINT, + EmulatedInterface: REFIID, + pChosenFeatureLevel: *mut D3D_FEATURE_LEVEL, + ppContextState: *mut *mut ID3DDeviceContextState, + ) -> HRESULT, + fn OpenSharedResource1( + hResource: HANDLE, + returnedInterface: REFIID, + ppResource: *mut *mut c_void, + ) -> HRESULT, + fn OpenSharedResourceByName( + Name: LPCWSTR, + dwDesiredAccess: DWORD, + returnedInterface: REFIID, + ppResource: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb2daad8b, 0x03d4, 0x4dbf, 0x95, 0xeb, 0x32, 0xab, 0x4b, 0x63, 0xd0, 0xab)] +interface ID3DUserDefinedAnnotation(ID3DUserDefinedAnnotationVtbl): IUnknown(IUnknownVtbl) { + fn BeginEvent( + Name: LPCWSTR, + ) -> INT, + fn EndEvent() -> INT, + fn SetMarker( + Name: LPCWSTR, + ) -> (), + fn GetStatus() -> BOOL, +}} diff --git a/bash-5.1/vendor/winapi/src/um/d3d11_2.rs b/bash-5.1/vendor/winapi/src/um/d3d11_2.rs new file mode 100644 index 0000000000000000000000000000000000000000..28b655a05f797fb31cb3da6502da20fe31067092 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d11_2.rs @@ -0,0 +1,146 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_void; +use shared::basetsd::{UINT16, UINT64, UINT8}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::minwindef::{BOOL, INT, UINT}; +use um::d3d11::{ID3D11Buffer, ID3D11DeviceChild, ID3D11Resource}; +use um::d3d11_1::{ + ID3D11Device1, ID3D11Device1Vtbl, ID3D11DeviceContext1, ID3D11DeviceContext1Vtbl, +}; +use um::winnt::{HRESULT, LPCWSTR}; +DEFINE_GUID!{IID_ID3D11DeviceContext2, + 0x420d5b32, 0xb90c, 0x4da4, 0xbe, 0xf0, 0x35, 0x9f, 0x6a, 0x24, 0xa8, 0x3a} +DEFINE_GUID!{IID_ID3D11Device2, + 0x9d06dffa, 0xd1e5, 0x4d07, 0x83, 0xa8, 0x1b, 0xb1, 0x23, 0xf2, 0xf8, 0x41} +STRUCT!{struct D3D11_TILED_RESOURCE_COORDINATE { + X: UINT, + Y: UINT, + Z: UINT, + Subresource: UINT, +}} +STRUCT!{struct D3D11_TILE_REGION_SIZE { + NumTiles: UINT, + bUseBox: BOOL, + Width: UINT, + Height: UINT16, + Depth: UINT16, +}} +ENUM!{enum D3D11_TILE_MAPPING_FLAG { + D3D11_TILE_MAPPING_NO_OVERWRITE = 0x00000001, +}} +ENUM!{enum D3D11_TILE_RANGE_FLAG { + D3D11_TILE_RANGE_NULL = 0x00000001, + D3D11_TILE_RANGE_SKIP = 0x00000002, + D3D11_TILE_RANGE_REUSE_SINGLE_TILE = 0x00000004, +}} +STRUCT!{struct D3D11_SUBRESOURCE_TILING { + WidthInTiles: UINT, + HeightInTiles: UINT16, + DepthInTiles: UINT16, + StartTileIndexInOverallResource: UINT, +}} +STRUCT!{struct D3D11_TILE_SHAPE { + WidthInTexels: UINT, + HeightInTexels: UINT, + DepthInTexels: UINT, +}} +STRUCT!{struct D3D11_PACKED_MIP_DESC { + NumStandardMips: UINT8, + NumPackedMips: UINT8, + NumTilesForPackedMips: UINT, + StartTileIndexInOverallResource: UINT, +}} +ENUM!{enum D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_FLAG { + D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_TILED_RESOURCE = 0x00000001, +}} +ENUM!{enum D3D11_TILE_COPY_FLAG { + D3D11_TILE_COPY_NO_OVERWRITE = 0x00000001, + D3D11_TILE_COPY_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE = 0x00000002, + D3D11_TILE_COPY_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER = 0x00000004, +}} +RIDL!{#[uuid(0x420d5b32, 0xb90c, 0x4da4, 0xbe, 0xf0, 0x35, 0x9f, 0x6a, 0x24, 0xa8, 0x3a)] +interface ID3D11DeviceContext2(ID3D11DeviceContext2Vtbl): + ID3D11DeviceContext1(ID3D11DeviceContext1Vtbl) { + fn UpdateTileMappings( + pTiledResource: *mut ID3D11Resource, + NumTiledResourceRegions: UINT, + pTiledResourceRegionStartCoordinates: *const D3D11_TILED_RESOURCE_COORDINATE, + pTiledResourceRegionSizes: *const D3D11_TILE_REGION_SIZE, + pTilePool: *mut ID3D11Buffer, + NumRanges: UINT, + pRangeFlags: *const UINT, + pTilePoolStartOffsets: *const UINT, + pRangeTileCounts: *const UINT, + Flags: UINT, + ) -> HRESULT, + fn CopyTileMappings( + pDestTiledResource: *mut ID3D11Resource, + pDestRegionStartCoordinate: *const D3D11_TILED_RESOURCE_COORDINATE, + pSourceTiledResource: *mut ID3D11Resource, + pSourceRegionStartCoordinate: *const D3D11_TILED_RESOURCE_COORDINATE, + pTileRegionSize: *const D3D11_TILE_REGION_SIZE, + Flags: UINT, + ) -> HRESULT, + fn CopyTiles( + pTiledResource: *mut ID3D11Resource, + pTileRegionStartCoordinate: *const D3D11_TILED_RESOURCE_COORDINATE, + pTileRegionSize: *const D3D11_TILE_REGION_SIZE, + pBuffer: *mut ID3D11Buffer, + BufferStartOffsetInBytes: UINT64, + Flags: UINT, + ) -> (), + fn UpdateTiles( + pDestTiledResource: *mut ID3D11Resource, + pDestTileRegionStartCoordinate: *const D3D11_TILED_RESOURCE_COORDINATE, + pDestTileRegionSize: *const D3D11_TILE_REGION_SIZE, + pSourceTileData: *const c_void, + Flags: UINT, + ) -> (), + fn ResizeTilePool( + pTilePool: *mut ID3D11Buffer, + NewSizeInBytes: UINT64, + ) -> HRESULT, + fn TiledResourceBarrier( + pTiledResourceOrViewAccessBeforeBarrier: *mut ID3D11DeviceChild, + pTiledResourceOrViewAccessAfterBarrier: *mut ID3D11DeviceChild, + ) -> (), + fn IsAnnotationEnabled() -> BOOL, + fn SetMarkerInt( + pLabel: LPCWSTR, + Data: INT, + ) -> (), + fn BeginEventInt( + pLabel: LPCWSTR, + Data: INT, + ) -> (), + fn EndEvent() -> (), +}} +RIDL!{#[uuid(0x9d06dffa, 0xd1e5, 0x4d07, 0x83, 0xa8, 0x1b, 0xb1, 0x23, 0xf2, 0xf8, 0x41)] +interface ID3D11Device2(ID3D11Device2Vtbl): ID3D11Device1(ID3D11Device1Vtbl) { + fn GetImmediateContext2( + ppImmediateContext: *mut *mut ID3D11DeviceContext2, + ) -> (), + fn CreateDeferredContext2( + ContextFlags: UINT, + ppDeferredContext: *mut *mut ID3D11DeviceContext2, + ) -> HRESULT, + fn GetResourceTiling( + pTiledResource: *mut ID3D11Resource, + pNumTilesForEntireResource: *mut UINT, + pPackedMipDesc: *mut D3D11_PACKED_MIP_DESC, + pStandardTileShapeForNonPackedMips: *mut D3D11_TILE_SHAPE, + pNumSubresourceTilings: *mut UINT, + FirstSubresourceTilingToGet: UINT, + pSubresourceTilingsForNonPackedMips: *mut D3D11_SUBRESOURCE_TILING, + ) -> (), + fn CheckMultisampleQualityLevels1( + Format: DXGI_FORMAT, + SampleCount: UINT, + Flags: UINT, + pNumQualityLevels: *mut UINT, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/d3d11_3.rs b/bash-5.1/vendor/winapi/src/um/d3d11_3.rs new file mode 100644 index 0000000000000000000000000000000000000000..5ae721380d2c0ddb1e09ef35c9105fbeb4569455 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d11_3.rs @@ -0,0 +1,23 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_ID3D11Texture2D1, + 0x51218251, 0x1e33, 0x4617, 0x9c, 0xcb, 0x4d, 0x3a, 0x43, 0x67, 0xe7, 0xbb} +DEFINE_GUID!{IID_ID3D11Texture3D1, + 0x0c711683, 0x2853, 0x4846, 0x9b, 0xb0, 0xf3, 0xe6, 0x06, 0x39, 0xe4, 0x6a} +DEFINE_GUID!{IID_ID3D11RasterizerState2, + 0x6fbd02fb, 0x209f, 0x46c4, 0xb0, 0x59, 0x2e, 0xd1, 0x55, 0x86, 0xa6, 0xac} +DEFINE_GUID!{IID_ID3D11ShaderResourceView1, + 0x91308b87, 0x9040, 0x411d, 0x8c, 0x67, 0xc3, 0x92, 0x53, 0xce, 0x38, 0x02} +DEFINE_GUID!{IID_ID3D11RenderTargetView1, + 0xffbe2e23, 0xf011, 0x418a, 0xac, 0x56, 0x5c, 0xee, 0xd7, 0xc5, 0xb9, 0x4b} +DEFINE_GUID!{IID_ID3D11UnorderedAccessView1, + 0x7b3b6153, 0xa886, 0x4544, 0xab, 0x37, 0x65, 0x37, 0xc8, 0x50, 0x04, 0x03} +DEFINE_GUID!{IID_ID3D11Query1, + 0x631b4766, 0x36dc, 0x461d, 0x8d, 0xb6, 0xc4, 0x7e, 0x13, 0xe6, 0x09, 0x16} +DEFINE_GUID!{IID_ID3D11DeviceContext3, + 0xb4e3c01d, 0xe79e, 0x4637, 0x91, 0xb2, 0x51, 0x0e, 0x9f, 0x4c, 0x9b, 0x8f} +DEFINE_GUID!{IID_ID3D11Device3, + 0xa05c8c37, 0xd2c6, 0x4732, 0xb3, 0xa0, 0x9c, 0xe0, 0xb0, 0xdc, 0x9a, 0xe6} diff --git a/bash-5.1/vendor/winapi/src/um/d3d11_4.rs b/bash-5.1/vendor/winapi/src/um/d3d11_4.rs new file mode 100644 index 0000000000000000000000000000000000000000..5d0da98b56f1cc9dd55da6228f29a7c3aaf02463 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d11_4.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_ID3D11Device4, + 0x8992ab71, 0x02e6, 0x4b8d, 0xba, 0x48, 0xb0, 0x56, 0xdc, 0xda, 0x42, 0xc4} diff --git a/bash-5.1/vendor/winapi/src/um/d3d11on12.rs b/bash-5.1/vendor/winapi/src/um/d3d11on12.rs new file mode 100644 index 0000000000000000000000000000000000000000..bf106a38bc2191a444ae136deefc21a64f2279b3 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d11on12.rs @@ -0,0 +1,67 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the content of d3d11on12.h +use ctypes::c_void; +use shared::guiddef::IID; +use shared::minwindef::UINT; +use um::d3d11::{ID3D11Device, ID3D11DeviceContext, ID3D11Resource}; +use um::d3d12::D3D12_RESOURCE_STATES; +use um::d3dcommon::D3D_FEATURE_LEVEL; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::HRESULT; +FN!{stdcall PFN_D3D11ON12_CREATE_DEVICE( + *mut IUnknown, + UINT, + *const D3D_FEATURE_LEVEL, + UINT, + *mut *mut IUnknown, + UINT, + UINT, + *mut *mut ID3D11Device, + *mut *mut ID3D11DeviceContext, + *mut D3D_FEATURE_LEVEL, +) -> HRESULT} +extern "system" { + pub fn D3D11On12CreateDevice( + pDevice: *mut IUnknown, + Flags: UINT, + pFeatureLevels: *const D3D_FEATURE_LEVEL, + FeatureLevels: UINT, + ppCommandQueues: *mut *mut IUnknown, + NumQueues: UINT, + NodeMask: UINT, + ppDevice: *mut *mut ID3D11Device, + ppImmediateContext: *mut *mut ID3D11DeviceContext, + pChosenFeatureLevel: *mut D3D_FEATURE_LEVEL, + ) -> HRESULT; +} +STRUCT!{struct D3D11_RESOURCE_FLAGS { + BindFlags: UINT, + MiscFlags: UINT, + CPUAccessFlags: UINT, + StructureByteStride: UINT, +}} +RIDL!{#[uuid(0x85611e73, 0x70a9, 0x490e, 0x96, 0x14, 0xa9, 0xe3, 0x02, 0x77, 0x79, 0x04)] +interface ID3D11On12Device(ID3D11On12DeviceVtbl): IUnknown(IUnknownVtbl) { + fn CreateWrappedResource( + pResource12: *mut IUnknown, + pFlags11: *const D3D11_RESOURCE_FLAGS, + InState: D3D12_RESOURCE_STATES, + OutState: D3D12_RESOURCE_STATES, + riid: *const IID, + ppResource11: *mut *mut c_void, + ) -> HRESULT, + fn ReleaseWrappedResources( + ppResources: *mut *mut ID3D11Resource, + NumResources: UINT, + ) -> (), + fn AcquireWrappedResources( + ppResources: *mut *mut ID3D11Resource, + NumResources: UINT, + ) -> (), +}} +DEFINE_GUID!{IID_ID3D11On12Device, + 0x85611e73, 0x70a9, 0x490e, 0x96, 0x14, 0xa9, 0xe3, 0x02, 0x77, 0x79, 0x04} diff --git a/bash-5.1/vendor/winapi/src/um/d3d11sdklayers.rs b/bash-5.1/vendor/winapi/src/um/d3d11sdklayers.rs new file mode 100644 index 0000000000000000000000000000000000000000..e70b6686ee60fb948bd12515c04127153921b9a6 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d11sdklayers.rs @@ -0,0 +1,2679 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_char; +use shared::basetsd::{SIZE_T, UINT64}; +use shared::dxgi::IDXGISwapChain; +use shared::minwindef::{BOOL, UINT}; +use um::d3d11::ID3D11DeviceContext; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCSTR}; +pub const D3D11_SDK_LAYERS_VERSION: UINT = 0x1; +pub const D3D11_DEBUG_FEATURE_FLUSH_PER_RENDER_OP: UINT = 0x1; +pub const D3D11_DEBUG_FEATURE_FINISH_PER_RENDER_OP: UINT = 0x2; +pub const D3D11_DEBUG_FEATURE_PRESENT_PER_RENDER_OP: UINT = 0x4; +pub const D3D11_DEBUG_FEATURE_ALWAYS_DISCARD_OFFERED_RESOURCE: UINT = 0x8; +pub const D3D11_DEBUG_FEATURE_NEVER_DISCARD_OFFERED_RESOURCE: UINT = 0x10; +pub const D3D11_DEBUG_FEATURE_AVOID_BEHAVIOR_CHANGING_DEBUG_AIDS: UINT = 0x40; +pub const D3D11_DEBUG_FEATURE_DISABLE_TILED_RESOURCE_MAPPING_TRACKING_AND_VALIDATION: UINT = 0x80; +ENUM!{enum D3D11_RLDO_FLAGS { + D3D11_RLDO_SUMMARY = 0x1, + D3D11_RLDO_DETAIL = 0x2, + D3D11_RLDO_IGNORE_INTERNAL = 0x4, +}} +RIDL!{#[uuid(0x79cf2233, 0x7536, 0x4948, 0x9d, 0x36, 0x1e, 0x46, 0x92, 0xdc, 0x57, 0x60)] +interface ID3D11Debug(ID3D11DebugVtbl): IUnknown(IUnknownVtbl) { + fn SetFeatureMask( + Mask: UINT, + ) -> HRESULT, + fn GetFeatureMask() -> UINT, + fn SetPresentPerRenderOpDelay( + Milliseconds: UINT, + ) -> HRESULT, + fn GetPresentPerRenderOpDelay() -> UINT, + fn SetSwapChain( + pSwapChain: *mut IDXGISwapChain, + ) -> HRESULT, + fn GetSwapChain( + ppSwapChain: *mut *mut IDXGISwapChain, + ) -> HRESULT, + fn ValidateContext( + pContext: *const ID3D11DeviceContext, + ) -> HRESULT, + fn ReportLiveDeviceObjects( + Flags: D3D11_RLDO_FLAGS, + ) -> HRESULT, + fn ValidateContextForDispatch( + pContext: *mut ID3D11DeviceContext, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1ef337e3, 0x58e7, 0x4f83, 0xa6, 0x92, 0xdb, 0x22, 0x1f, 0x5e, 0xd4, 0x7e)] +interface ID3D11SwitchToRef(ID3D11SwitchToRefVtbl): IUnknown(IUnknownVtbl) { + fn SetUseRef( + UseRef: BOOL, + ) -> BOOL, + fn GetUseRef() -> BOOL, +}} +ENUM!{enum D3D11_SHADER_TRACKING_RESOURCE_TYPE { + D3D11_SHADER_TRACKING_RESOURCE_TYPE_NONE = 0, + D3D11_SHADER_TRACKING_RESOURCE_TYPE_UAV_DEVICEMEMORY = 1, + D3D11_SHADER_TRACKING_RESOURCE_TYPE_NON_UAV_DEVICEMEMORY = 2, + D3D11_SHADER_TRACKING_RESOURCE_TYPE_ALL_DEVICEMEMORY = 3, + D3D11_SHADER_TRACKING_RESOURCE_TYPE_GROUPSHARED_MEMORY = 4, + D3D11_SHADER_TRACKING_RESOURCE_TYPE_ALL_SHARED_MEMORY = 5, + D3D11_SHADER_TRACKING_RESOURCE_TYPE_GROUPSHARED_NON_UAV = 6, + D3D11_SHADER_TRACKING_RESOURCE_TYPE_ALL = 7, +}} +ENUM!{enum D3D11_SHADER_TRACKING_OPTION { + D3D11_SHADER_TRACKING_OPTION_IGNORE = 0, + D3D11_SHADER_TRACKING_OPTION_TRACK_UNINITIALIZED = 0x1, + D3D11_SHADER_TRACKING_OPTION_TRACK_RAW = 0x2, + D3D11_SHADER_TRACKING_OPTION_TRACK_WAR = 0x4, + D3D11_SHADER_TRACKING_OPTION_TRACK_WAW = 0x8, + D3D11_SHADER_TRACKING_OPTION_ALLOW_SAME = 0x10, + D3D11_SHADER_TRACKING_OPTION_TRACK_ATOMIC_CONSISTENCY = 0x20, + D3D11_SHADER_TRACKING_OPTION_TRACK_RAW_ACROSS_THREADGROUPS = 0x40, + D3D11_SHADER_TRACKING_OPTION_TRACK_WAR_ACROSS_THREADGROUPS = 0x80, + D3D11_SHADER_TRACKING_OPTION_TRACK_WAW_ACROSS_THREADGROUPS = 0x100, + D3D11_SHADER_TRACKING_OPTION_TRACK_ATOMIC_CONSISTENCY_ACROSS_THREADGROUPS = 0x200, + D3D11_SHADER_TRACKING_OPTION_UAV_SPECIFIC_FLAGS + = D3D11_SHADER_TRACKING_OPTION_TRACK_RAW_ACROSS_THREADGROUPS + | D3D11_SHADER_TRACKING_OPTION_TRACK_WAR_ACROSS_THREADGROUPS + | D3D11_SHADER_TRACKING_OPTION_TRACK_WAW_ACROSS_THREADGROUPS + | D3D11_SHADER_TRACKING_OPTION_TRACK_ATOMIC_CONSISTENCY_ACROSS_THREADGROUPS, + D3D11_SHADER_TRACKING_OPTION_ALL_HAZARDS = D3D11_SHADER_TRACKING_OPTION_TRACK_RAW + | D3D11_SHADER_TRACKING_OPTION_TRACK_WAR | D3D11_SHADER_TRACKING_OPTION_TRACK_WAW + | D3D11_SHADER_TRACKING_OPTION_TRACK_ATOMIC_CONSISTENCY + | D3D11_SHADER_TRACKING_OPTION_TRACK_RAW_ACROSS_THREADGROUPS + | D3D11_SHADER_TRACKING_OPTION_TRACK_WAR_ACROSS_THREADGROUPS + | D3D11_SHADER_TRACKING_OPTION_TRACK_WAW_ACROSS_THREADGROUPS + | D3D11_SHADER_TRACKING_OPTION_TRACK_ATOMIC_CONSISTENCY_ACROSS_THREADGROUPS, + D3D11_SHADER_TRACKING_OPTION_ALL_HAZARDS_ALLOWING_SAME + = D3D11_SHADER_TRACKING_OPTION_ALL_HAZARDS | D3D11_SHADER_TRACKING_OPTION_ALLOW_SAME, + D3D11_SHADER_TRACKING_OPTION_ALL_OPTIONS + = D3D11_SHADER_TRACKING_OPTION_ALL_HAZARDS_ALLOWING_SAME + | D3D11_SHADER_TRACKING_OPTION_TRACK_UNINITIALIZED, +}} +RIDL!{#[uuid(0x1911c771, 0x1587, 0x413e, 0xa7, 0xe0, 0xfb, 0x26, 0xc3, 0xde, 0x02, 0x68)] +interface ID3D11TracingDevice(ID3D11TracingDeviceVtbl): IUnknown(IUnknownVtbl) { + fn SetShaderTrackingOptionsByType( + ResourceTypeFlags: UINT, + Options: UINT, + ) -> HRESULT, + fn SetShaderTrackingOptions( + pShader: *const IUnknown, + Options: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x193dacdf, 0x0db2, 0x4c05, 0xa5, 0x5c, 0xef, 0x06, 0xca, 0xc5, 0x6f, 0xd9)] +interface ID3D11RefTrackingOptions(ID3D11RefTrackingOptionsVtbl): IUnknown(IUnknownVtbl) { + fn SetTrackingOptions( + Options: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x03916615, 0xc644, 0x418c, 0x9b, 0xf4, 0x75, 0xdb, 0x5b, 0xe6, 0x3c, 0xa0)] +interface ID3D11RefDefaultTrackingOptions(ID3D11RefDefaultTrackingOptionsVtbl): + IUnknown(IUnknownVtbl) { + fn SetTrackingOptions( + ResourceTypeFlags: UINT, + Options: UINT, + ) -> HRESULT, +}} +DEFINE_GUID!{DXGI_DEBUG_D3D11, + 0x4b99317b, 0xac39, 0x4aa6, 0xbb, 0x0b, 0xba, 0xa0, 0x47, 0x84, 0x79, 0x8f} +pub const D3D11_REGKEY_PATH: &'static str = "Software\\Microsoft\\Direct3D"; +pub const D3D11_MUTE_DEBUG_OUTPUT: &'static str = "MuteDebugOutput"; +pub const D3D11_ENABLE_BREAK_ON_MESSAGE: &'static str = "EnableBreakOnMessage"; +pub const D3D11_INFOQUEUE_STORAGE_FILTER_OVERRIDE: &'static str = "InfoQueueStorageFilterOverride"; +pub const D3D11_MUTE_CATEGORY: &'static str = "Mute_CATEGORY_%s"; +pub const D3D11_MUTE_SEVERITY: &'static str = "Mute_SEVERITY_%s"; +pub const D3D11_MUTE_ID_STRING: &'static str = "Mute_ID_%s"; +pub const D3D11_MUTE_ID_DECIMAL: &'static str = "Mute_ID_%d"; +pub const D3D11_UNMUTE_SEVERITY_INFO: &'static str = "Unmute_SEVERITY_INFO"; +pub const D3D11_BREAKON_CATEGORY: &'static str = "BreakOn_CATEGORY_%s"; +pub const D3D11_BREAKON_SEVERITY: &'static str = "BreakOn_SEVERITY_%s"; +pub const D3D11_BREAKON_ID_STRING: &'static str = "BreakOn_ID_%s"; +pub const D3D11_BREAKON_ID_DECIMAL: &'static str = "BreakOn_ID_%d"; +pub const D3D11_APPSIZE_STRING: &'static str = "Size"; +pub const D3D11_APPNAME_STRING: &'static str = "Name"; +pub const D3D11_FORCE_DEBUGGABLE: &'static str = "ForceDebuggable"; +pub const D3D11_FORCE_SHADER_SKIP_OPTIMIZATION: &'static str = "ForceShaderSkipOptimization"; +ENUM!{enum D3D11_MESSAGE_CATEGORY { + D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0, + D3D11_MESSAGE_CATEGORY_MISCELLANEOUS = D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1, + D3D11_MESSAGE_CATEGORY_INITIALIZATION = D3D11_MESSAGE_CATEGORY_MISCELLANEOUS + 1, + D3D11_MESSAGE_CATEGORY_CLEANUP = D3D11_MESSAGE_CATEGORY_INITIALIZATION + 1, + D3D11_MESSAGE_CATEGORY_COMPILATION = D3D11_MESSAGE_CATEGORY_CLEANUP + 1, + D3D11_MESSAGE_CATEGORY_STATE_CREATION = D3D11_MESSAGE_CATEGORY_COMPILATION + 1, + D3D11_MESSAGE_CATEGORY_STATE_SETTING = D3D11_MESSAGE_CATEGORY_STATE_CREATION + 1, + D3D11_MESSAGE_CATEGORY_STATE_GETTING = D3D11_MESSAGE_CATEGORY_STATE_SETTING + 1, + D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = D3D11_MESSAGE_CATEGORY_STATE_GETTING + 1, + D3D11_MESSAGE_CATEGORY_EXECUTION = D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1, + D3D11_MESSAGE_CATEGORY_SHADER = D3D11_MESSAGE_CATEGORY_EXECUTION + 1, +}} +ENUM!{enum D3D11_MESSAGE_SEVERITY { + D3D11_MESSAGE_SEVERITY_CORRUPTION = 0, + D3D11_MESSAGE_SEVERITY_ERROR = D3D11_MESSAGE_SEVERITY_CORRUPTION + 1, + D3D11_MESSAGE_SEVERITY_WARNING = D3D11_MESSAGE_SEVERITY_ERROR + 1, + D3D11_MESSAGE_SEVERITY_INFO = D3D11_MESSAGE_SEVERITY_WARNING + 1, + D3D11_MESSAGE_SEVERITY_MESSAGE = D3D11_MESSAGE_SEVERITY_INFO + 1, +}} +ENUM!{enum D3D11_MESSAGE_ID { + D3D11_MESSAGE_ID_UNKNOWN = 0, + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = D3D11_MESSAGE_ID_UNKNOWN + 1, + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + = D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1, + D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + = D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1, + D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + = D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1, + D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + = D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1, + D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + = D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1, + D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + = D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1, + D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + = D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1, + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + = D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1, + D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + = D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1, + D3D11_MESSAGE_ID_STRING_FROM_APPLICATION = D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1, + D3D11_MESSAGE_ID_CORRUPTED_THIS = D3D11_MESSAGE_ID_STRING_FROM_APPLICATION + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1 = D3D11_MESSAGE_ID_CORRUPTED_THIS + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1, + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15 = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1, + D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING = D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1, + D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + = D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1, + D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + = D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1, + D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + = D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1, + D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + = D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1, + D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + = D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + = D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + = D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + = D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + = D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + = D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + = D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + = D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC = D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + = D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + = D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + = D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + = D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + = D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + = D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + = D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + = D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + = D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + = D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + = D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + = D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + = D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + = D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + = D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + = D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + = D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + = D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + = D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + = D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + = D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + = D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + = D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + = D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + = D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + = D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + = D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + = D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + = D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + = D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1, + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1, + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + = D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + = D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + = D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1, + D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1, + D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + = D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + = D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1, + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + = D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1, + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + = D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1, + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + = D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1, + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + = D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1, + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + = D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1, + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + = D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + = D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1, + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1, + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + = D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1, + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + = D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1, + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + = D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1, + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + = D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1, + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + = D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1, + D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + = D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1, + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + = D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1, + D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + = D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + = D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + = D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1, + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + = D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1, + D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1, + D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + = D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + = D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + = D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + = D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1, + D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + = D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + = D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + = D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1, + D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + = D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1, + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + = D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1, + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + = D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1, + D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1, + D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + = D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + 1, + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + = D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1, + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + = D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1, + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + = D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1, + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + = D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1, + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + = D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1, + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + = D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1, + D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + = D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1, + D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + = D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1, + D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + = D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1, + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + = D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1, + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + = D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1, + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + = D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1, + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + = D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1, + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + = D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1, + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + = D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1, + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + = D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1, + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + = D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1, + D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + = D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1, + D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1, + D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + = D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1, + D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1, + D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1, + D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + = D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1, + D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + = D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1, + D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + = D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1, + D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + = D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1, + D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + = D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1, + D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1, + D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + = D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1, + D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + = D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1, + D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + = D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + = D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1, + D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + = D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1, + D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + = D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1, + D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1, + D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + = D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1, + D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + = D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1, + D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + = D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1, + D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + = D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1, + D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + = D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1, + D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + = D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1, + D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + = D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1, + D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + = D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1, + D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1, + D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + = D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + = D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1, + D3D11_MESSAGE_ID_REF_THREADING_MODE + = D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1, + D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = D3D11_MESSAGE_ID_REF_THREADING_MODE + 1, + D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1, + D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION = D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1, + D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + = D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1, + D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + = D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1, + D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY = D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1, + D3D11_MESSAGE_ID_REF_INFO = D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = D3D11_MESSAGE_ID_REF_INFO + 1, + D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + = D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1, + D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + = D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1, + D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + = D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1, + D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + = D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1, + D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + = D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1, + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + = D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + = D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1, + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + = D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1, + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + = D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1, + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + = D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1, + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + = D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + = D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + = D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + = D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + = D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + = D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + = D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + = D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + = D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + = D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + = D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + = D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + = D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + = D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + = D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + = D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + = D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1, + D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + = D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1, + D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + = D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1, + D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + = D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1, + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1, + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + = D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + = D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1, + D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1, + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + = D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1, + D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + = D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1, + D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1, + D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + = D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1, + D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1, + D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + = D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + = D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + 1, + D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + = D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + 1, + D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1, + D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + = D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC + = D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + 1, + D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER = D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC + 1, + D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + = D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER + 1, + D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + = D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1, + D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + = D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + 1, + D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + = D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + = D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + 1, + D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + = D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + 1, + D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + = D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + 1, + D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + = D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + 1, + D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + = D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + 1, + D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE = D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + 1, + D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + = D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE + 1, + D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL = D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + = D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + = D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + = D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1, + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + = D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + = D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1, + D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY + = D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1, + D3D11_MESSAGE_ID_LIVE_BUFFER = D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY + 1, + D3D11_MESSAGE_ID_LIVE_TEXTURE1D = D3D11_MESSAGE_ID_LIVE_BUFFER + 1, + D3D11_MESSAGE_ID_LIVE_TEXTURE2D = D3D11_MESSAGE_ID_LIVE_TEXTURE1D + 1, + D3D11_MESSAGE_ID_LIVE_TEXTURE3D = D3D11_MESSAGE_ID_LIVE_TEXTURE2D + 1, + D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW = D3D11_MESSAGE_ID_LIVE_TEXTURE3D + 1, + D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW = D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW + 1, + D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW = D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW + 1, + D3D11_MESSAGE_ID_LIVE_VERTEXSHADER = D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW + 1, + D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER = D3D11_MESSAGE_ID_LIVE_VERTEXSHADER + 1, + D3D11_MESSAGE_ID_LIVE_PIXELSHADER = D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER + 1, + D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT = D3D11_MESSAGE_ID_LIVE_PIXELSHADER + 1, + D3D11_MESSAGE_ID_LIVE_SAMPLER = D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT + 1, + D3D11_MESSAGE_ID_LIVE_BLENDSTATE = D3D11_MESSAGE_ID_LIVE_SAMPLER + 1, + D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE = D3D11_MESSAGE_ID_LIVE_BLENDSTATE + 1, + D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE = D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE + 1, + D3D11_MESSAGE_ID_LIVE_QUERY = D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE + 1, + D3D11_MESSAGE_ID_LIVE_PREDICATE = D3D11_MESSAGE_ID_LIVE_QUERY + 1, + D3D11_MESSAGE_ID_LIVE_COUNTER = D3D11_MESSAGE_ID_LIVE_PREDICATE + 1, + D3D11_MESSAGE_ID_LIVE_DEVICE = D3D11_MESSAGE_ID_LIVE_COUNTER + 1, + D3D11_MESSAGE_ID_LIVE_SWAPCHAIN = D3D11_MESSAGE_ID_LIVE_DEVICE + 1, + D3D11_MESSAGE_ID_D3D10_MESSAGES_END = D3D11_MESSAGE_ID_LIVE_SWAPCHAIN + 1, + D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x100000, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + = D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START + 1, + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + = D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + 1, + D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + 1, + D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + = D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + = D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + = D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + = D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + = D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + = D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + = D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + 1, + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + = D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + 1, + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + = D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + 1, + D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + = D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + 1, + D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + = D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + 1, + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + 1, + D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + = D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + = D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + 1, + D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + = D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + 1, + D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + = D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + = D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + 1, + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + 1, + D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + = D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + = D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + = D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + = D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + = D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + = D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + = D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + = D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + = D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + 1, + D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + = D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + 1, + D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + = D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED = D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED = D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + = D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + 1, + D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + = D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + = D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + 1, + D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + = D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + = D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + = D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + 1, + D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + = D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + 1, + D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + = D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + 1, + D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + = D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + 1, + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + = D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + 1, + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + = D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_COPYRESOURCE_NO_3D_MISMATCHED_UPDATES + = D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + 1, + D3D11_MESSAGE_ID_D3D10L9_MESSAGES_END + = D3D11_MESSAGE_ID_COPYRESOURCE_NO_3D_MISMATCHED_UPDATES + 1, + D3D11_MESSAGE_ID_D3D11_MESSAGES_START = 0x200000, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS + = D3D11_MESSAGE_ID_D3D11_MESSAGES_START + 1, + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE + = D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE + = D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS + 1, + D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE + 1, + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS + = D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE + 1, + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED + = D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS + 1, + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED + 1, + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN + = D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN + 1, + D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT + = D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT + 1, + D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN + = D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM + = D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES + 1, + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES + 1, + D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD + = D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES + 1, + D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD + = D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD + 1, + D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD + 1, + D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL + = D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY + = D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL + 1, + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE + = D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE + = D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE + 1, + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE + = D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE + 1, + D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE + 1, + D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER + = D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD + = D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD + = D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD + 1, + D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD + 1, + D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL + = D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY + = D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL + 1, + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE + = D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE + = D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE + 1, + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE + = D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE + 1, + D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE + 1, + D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER + = D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT + = D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER + = D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT + 1, + D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED + = D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW + = D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED + 1, + D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE + = D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW + 1, + D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE + = D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE + 1, + D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS + = D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE + 1, + D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED = D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN + = D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED + 1, + D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN + 1, + D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD + = D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE + = D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD + 1, + D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED + = D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS + = D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED + 1, + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH + 1, + D3D11_MESSAGE_ID_CREATE_CONTEXT + = D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH + 1, + D3D11_MESSAGE_ID_LIVE_CONTEXT = D3D11_MESSAGE_ID_CREATE_CONTEXT + 1, + D3D11_MESSAGE_ID_DESTROY_CONTEXT = D3D11_MESSAGE_ID_LIVE_CONTEXT + 1, + D3D11_MESSAGE_ID_CREATE_BUFFER = D3D11_MESSAGE_ID_DESTROY_CONTEXT + 1, + D3D11_MESSAGE_ID_LIVE_BUFFER_WIN7 = D3D11_MESSAGE_ID_CREATE_BUFFER + 1, + D3D11_MESSAGE_ID_DESTROY_BUFFER = D3D11_MESSAGE_ID_LIVE_BUFFER_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_TEXTURE1D = D3D11_MESSAGE_ID_DESTROY_BUFFER + 1, + D3D11_MESSAGE_ID_LIVE_TEXTURE1D_WIN7 = D3D11_MESSAGE_ID_CREATE_TEXTURE1D + 1, + D3D11_MESSAGE_ID_DESTROY_TEXTURE1D = D3D11_MESSAGE_ID_LIVE_TEXTURE1D_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_TEXTURE2D = D3D11_MESSAGE_ID_DESTROY_TEXTURE1D + 1, + D3D11_MESSAGE_ID_LIVE_TEXTURE2D_WIN7 = D3D11_MESSAGE_ID_CREATE_TEXTURE2D + 1, + D3D11_MESSAGE_ID_DESTROY_TEXTURE2D = D3D11_MESSAGE_ID_LIVE_TEXTURE2D_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_TEXTURE3D = D3D11_MESSAGE_ID_DESTROY_TEXTURE2D + 1, + D3D11_MESSAGE_ID_LIVE_TEXTURE3D_WIN7 = D3D11_MESSAGE_ID_CREATE_TEXTURE3D + 1, + D3D11_MESSAGE_ID_DESTROY_TEXTURE3D = D3D11_MESSAGE_ID_LIVE_TEXTURE3D_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW = D3D11_MESSAGE_ID_DESTROY_TEXTURE3D + 1, + D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW_WIN7 = D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW + 1, + D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW + = D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW = D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW + 1, + D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW_WIN7 = D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW + 1, + D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW = D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW = D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW + 1, + D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW_WIN7 = D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW + 1, + D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW = D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_VERTEXSHADER = D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW + 1, + D3D11_MESSAGE_ID_LIVE_VERTEXSHADER_WIN7 = D3D11_MESSAGE_ID_CREATE_VERTEXSHADER + 1, + D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER = D3D11_MESSAGE_ID_LIVE_VERTEXSHADER_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_HULLSHADER = D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER + 1, + D3D11_MESSAGE_ID_LIVE_HULLSHADER = D3D11_MESSAGE_ID_CREATE_HULLSHADER + 1, + D3D11_MESSAGE_ID_DESTROY_HULLSHADER = D3D11_MESSAGE_ID_LIVE_HULLSHADER + 1, + D3D11_MESSAGE_ID_CREATE_DOMAINSHADER = D3D11_MESSAGE_ID_DESTROY_HULLSHADER + 1, + D3D11_MESSAGE_ID_LIVE_DOMAINSHADER = D3D11_MESSAGE_ID_CREATE_DOMAINSHADER + 1, + D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER = D3D11_MESSAGE_ID_LIVE_DOMAINSHADER + 1, + D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER = D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER + 1, + D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER_WIN7 = D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER + 1, + D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER = D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_PIXELSHADER = D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER + 1, + D3D11_MESSAGE_ID_LIVE_PIXELSHADER_WIN7 = D3D11_MESSAGE_ID_CREATE_PIXELSHADER + 1, + D3D11_MESSAGE_ID_DESTROY_PIXELSHADER = D3D11_MESSAGE_ID_LIVE_PIXELSHADER_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT = D3D11_MESSAGE_ID_DESTROY_PIXELSHADER + 1, + D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT_WIN7 = D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT + 1, + D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT = D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_SAMPLER = D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT + 1, + D3D11_MESSAGE_ID_LIVE_SAMPLER_WIN7 = D3D11_MESSAGE_ID_CREATE_SAMPLER + 1, + D3D11_MESSAGE_ID_DESTROY_SAMPLER = D3D11_MESSAGE_ID_LIVE_SAMPLER_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_BLENDSTATE = D3D11_MESSAGE_ID_DESTROY_SAMPLER + 1, + D3D11_MESSAGE_ID_LIVE_BLENDSTATE_WIN7 = D3D11_MESSAGE_ID_CREATE_BLENDSTATE + 1, + D3D11_MESSAGE_ID_DESTROY_BLENDSTATE = D3D11_MESSAGE_ID_LIVE_BLENDSTATE_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE = D3D11_MESSAGE_ID_DESTROY_BLENDSTATE + 1, + D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE_WIN7 = D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE + 1, + D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE = D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE = D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE + 1, + D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE_WIN7 = D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE + 1, + D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE = D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_QUERY = D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE + 1, + D3D11_MESSAGE_ID_LIVE_QUERY_WIN7 = D3D11_MESSAGE_ID_CREATE_QUERY + 1, + D3D11_MESSAGE_ID_DESTROY_QUERY = D3D11_MESSAGE_ID_LIVE_QUERY_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_PREDICATE = D3D11_MESSAGE_ID_DESTROY_QUERY + 1, + D3D11_MESSAGE_ID_LIVE_PREDICATE_WIN7 = D3D11_MESSAGE_ID_CREATE_PREDICATE + 1, + D3D11_MESSAGE_ID_DESTROY_PREDICATE = D3D11_MESSAGE_ID_LIVE_PREDICATE_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_COUNTER = D3D11_MESSAGE_ID_DESTROY_PREDICATE + 1, + D3D11_MESSAGE_ID_DESTROY_COUNTER = D3D11_MESSAGE_ID_CREATE_COUNTER + 1, + D3D11_MESSAGE_ID_CREATE_COMMANDLIST = D3D11_MESSAGE_ID_DESTROY_COUNTER + 1, + D3D11_MESSAGE_ID_LIVE_COMMANDLIST = D3D11_MESSAGE_ID_CREATE_COMMANDLIST + 1, + D3D11_MESSAGE_ID_DESTROY_COMMANDLIST = D3D11_MESSAGE_ID_LIVE_COMMANDLIST + 1, + D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE = D3D11_MESSAGE_ID_DESTROY_COMMANDLIST + 1, + D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE = D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE + 1, + D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE = D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE + 1, + D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE = D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE + 1, + D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE = D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE + 1, + D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE = D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE + 1, + D3D11_MESSAGE_ID_LIVE_DEVICE_WIN7 = D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE + 1, + D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY_WIN7 = D3D11_MESSAGE_ID_LIVE_DEVICE_WIN7 + 1, + D3D11_MESSAGE_ID_CREATE_COMPUTESHADER = D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY_WIN7 + 1, + D3D11_MESSAGE_ID_LIVE_COMPUTESHADER = D3D11_MESSAGE_ID_CREATE_COMPUTESHADER + 1, + D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER = D3D11_MESSAGE_ID_LIVE_COMPUTESHADER + 1, + D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW = D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER + 1, + D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW = D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW + 1, + D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW = D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW + 1, + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL + = D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW + 1, + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL + 1, + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE + = D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX + = D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE + 1, + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE + = D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX + 1, + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA + = D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE + 1, + D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA + = D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA + 1, + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS + = D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA + 1, + D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL + = D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS + 1, + D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE + = D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL + 1, + D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE + = D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE + 1, + D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE + 1, + D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD + = D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD + = D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD + 1, + D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD + 1, + D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL + = D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY + = D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL + 1, + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE + = D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE + = D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE + 1, + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE + = D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE + 1, + D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE + 1, + D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER + = D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED + + 1, + D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE + = D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS + = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS + 1, + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT + 1, + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS + = D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD + 1, + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP + = D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS + + 1, + D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP + 1, + D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS + 1, + D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH + = D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD + 1, + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY + = D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH + 1, + D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY + = D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS + = D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY + 1, + D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER + = D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS + 1, + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED + = D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER + 1, + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW + = D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED + 1, + D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT + = D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW + 1, + D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE + = D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT + 1, + D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD + = D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE + 1, + D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT + = D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD + 1, + D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE + = D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT + 1, + D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE + 1, + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY + = D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY + = D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY + 1, + D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED + = D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH + = D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW + = D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED + 1, + D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO + = D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW + 1, + D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO + 1, + D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH + = D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH + 1, + D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET + = D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET + = D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET + 1, + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE + = D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET + 1, + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE + = D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE + 1, + D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED + = D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE + 1, + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW + = D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET + = D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW + 1, + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS + = D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET + 1, + D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT + = D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED + = D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_REF_WARNING + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_PIXEL_SHADER_WITHOUT_RTV_OR_DSV + = D3D11_MESSAGE_ID_REF_WARNING + 1, + D3D11_MESSAGE_ID_SHADER_ABORT + = D3D11_MESSAGE_ID_DEVICE_DRAW_PIXEL_SHADER_WITHOUT_RTV_OR_DSV + 1, + D3D11_MESSAGE_ID_SHADER_MESSAGE = D3D11_MESSAGE_ID_SHADER_ABORT + 1, + D3D11_MESSAGE_ID_SHADER_ERROR = D3D11_MESSAGE_ID_SHADER_MESSAGE + 1, + D3D11_MESSAGE_ID_OFFERRESOURCES_INVALIDRESOURCE = D3D11_MESSAGE_ID_SHADER_ERROR + 1, + D3D11_MESSAGE_ID_HSSETSAMPLERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_OFFERRESOURCES_INVALIDRESOURCE + 1, + D3D11_MESSAGE_ID_DSSETSAMPLERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_HSSETSAMPLERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CSSETSAMPLERS_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_DSSETSAMPLERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_HSSETSHADER_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_CSSETSAMPLERS_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_DSSETSHADER_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_HSSETSHADER_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_CSSETSHADER_UNBINDDELETINGOBJECT + = D3D11_MESSAGE_ID_DSSETSHADER_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_ENQUEUESETEVENT_INVALIDARG_RETURN + = D3D11_MESSAGE_ID_CSSETSHADER_UNBINDDELETINGOBJECT + 1, + D3D11_MESSAGE_ID_ENQUEUESETEVENT_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_ENQUEUESETEVENT_INVALIDARG_RETURN + 1, + D3D11_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN + = D3D11_MESSAGE_ID_ENQUEUESETEVENT_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NUMUAVS_INVALIDRANGE + = D3D11_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN + 1, + D3D11_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT + = D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NUMUAVS_INVALIDRANGE + + 1, + D3D11_MESSAGE_ID_D3D11_MESSAGES_END = D3D11_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT + 1, + D3D11_MESSAGE_ID_D3D11_1_MESSAGES_START = 0x300000, + D3D11_MESSAGE_ID_CREATE_VIDEODECODER = D3D11_MESSAGE_ID_D3D11_1_MESSAGES_START + 1, + D3D11_MESSAGE_ID_CREATE_VIDEOPROCESSORENUM = D3D11_MESSAGE_ID_CREATE_VIDEODECODER + 1, + D3D11_MESSAGE_ID_CREATE_VIDEOPROCESSOR = D3D11_MESSAGE_ID_CREATE_VIDEOPROCESSORENUM + 1, + D3D11_MESSAGE_ID_CREATE_DECODEROUTPUTVIEW = D3D11_MESSAGE_ID_CREATE_VIDEOPROCESSOR + 1, + D3D11_MESSAGE_ID_CREATE_PROCESSORINPUTVIEW = D3D11_MESSAGE_ID_CREATE_DECODEROUTPUTVIEW + 1, + D3D11_MESSAGE_ID_CREATE_PROCESSOROUTPUTVIEW = D3D11_MESSAGE_ID_CREATE_PROCESSORINPUTVIEW + 1, + D3D11_MESSAGE_ID_CREATE_DEVICECONTEXTSTATE = D3D11_MESSAGE_ID_CREATE_PROCESSOROUTPUTVIEW + 1, + D3D11_MESSAGE_ID_LIVE_VIDEODECODER = D3D11_MESSAGE_ID_CREATE_DEVICECONTEXTSTATE + 1, + D3D11_MESSAGE_ID_LIVE_VIDEOPROCESSORENUM = D3D11_MESSAGE_ID_LIVE_VIDEODECODER + 1, + D3D11_MESSAGE_ID_LIVE_VIDEOPROCESSOR = D3D11_MESSAGE_ID_LIVE_VIDEOPROCESSORENUM + 1, + D3D11_MESSAGE_ID_LIVE_DECODEROUTPUTVIEW = D3D11_MESSAGE_ID_LIVE_VIDEOPROCESSOR + 1, + D3D11_MESSAGE_ID_LIVE_PROCESSORINPUTVIEW = D3D11_MESSAGE_ID_LIVE_DECODEROUTPUTVIEW + 1, + D3D11_MESSAGE_ID_LIVE_PROCESSOROUTPUTVIEW = D3D11_MESSAGE_ID_LIVE_PROCESSORINPUTVIEW + 1, + D3D11_MESSAGE_ID_LIVE_DEVICECONTEXTSTATE = D3D11_MESSAGE_ID_LIVE_PROCESSOROUTPUTVIEW + 1, + D3D11_MESSAGE_ID_DESTROY_VIDEODECODER = D3D11_MESSAGE_ID_LIVE_DEVICECONTEXTSTATE + 1, + D3D11_MESSAGE_ID_DESTROY_VIDEOPROCESSORENUM = D3D11_MESSAGE_ID_DESTROY_VIDEODECODER + 1, + D3D11_MESSAGE_ID_DESTROY_VIDEOPROCESSOR = D3D11_MESSAGE_ID_DESTROY_VIDEOPROCESSORENUM + 1, + D3D11_MESSAGE_ID_DESTROY_DECODEROUTPUTVIEW = D3D11_MESSAGE_ID_DESTROY_VIDEOPROCESSOR + 1, + D3D11_MESSAGE_ID_DESTROY_PROCESSORINPUTVIEW = D3D11_MESSAGE_ID_DESTROY_DECODEROUTPUTVIEW + 1, + D3D11_MESSAGE_ID_DESTROY_PROCESSOROUTPUTVIEW = D3D11_MESSAGE_ID_DESTROY_PROCESSORINPUTVIEW + 1, + D3D11_MESSAGE_ID_DESTROY_DEVICECONTEXTSTATE = D3D11_MESSAGE_ID_DESTROY_PROCESSOROUTPUTVIEW + 1, + D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDFLAGS + = D3D11_MESSAGE_ID_DESTROY_DEVICECONTEXTSTATE + 1, + D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDFEATURELEVEL + = D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_FEATURELEVELS_NOT_SUPPORTED + = D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDFEATURELEVEL + 1, + D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDREFIID + = D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_FEATURELEVELS_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_DISCARDVIEW_INVALIDVIEW + = D3D11_MESSAGE_ID_CREATEDEVICECONTEXTSTATE_INVALIDREFIID + 1, + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION1_INVALIDCOPYFLAGS + = D3D11_MESSAGE_ID_DEVICE_DISCARDVIEW_INVALIDVIEW + 1, + D3D11_MESSAGE_ID_UPDATESUBRESOURCE1_INVALIDCOPYFLAGS + = D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION1_INVALIDCOPYFLAGS + 1, + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT + = D3D11_MESSAGE_ID_UPDATESUBRESOURCE1_INVALIDCOPYFLAGS + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODER_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODER_NULLPARAM + = D3D11_MESSAGE_ID_CREATEVIDEODECODER_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODER_INVALIDFORMAT + = D3D11_MESSAGE_ID_CREATEVIDEODECODER_NULLPARAM + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODER_ZEROWIDTHHEIGHT + = D3D11_MESSAGE_ID_CREATEVIDEODECODER_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODER_DRIVER_INVALIDBUFFERSIZE + = D3D11_MESSAGE_ID_CREATEVIDEODECODER_ZEROWIDTHHEIGHT + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODER_DRIVER_INVALIDBUFFERUSAGE + = D3D11_MESSAGE_ID_CREATEVIDEODECODER_DRIVER_INVALIDBUFFERSIZE + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERPROFILECOUNT_OUTOFMEMORY + = D3D11_MESSAGE_ID_CREATEVIDEODECODER_DRIVER_INVALIDBUFFERUSAGE + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_NULLPARAM + = D3D11_MESSAGE_ID_GETVIDEODECODERPROFILECOUNT_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_INVALIDINDEX + = D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_INVALIDINDEX + 1, + D3D11_MESSAGE_ID_CHECKVIDEODECODERFORMAT_NULLPARAM + = D3D11_MESSAGE_ID_GETVIDEODECODERPROFILE_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CHECKVIDEODECODERFORMAT_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CHECKVIDEODECODERFORMAT_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERCONFIGCOUNT_NULLPARAM + = D3D11_MESSAGE_ID_CHECKVIDEODECODERFORMAT_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERCONFIGCOUNT_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_GETVIDEODECODERCONFIGCOUNT_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_NULLPARAM + = D3D11_MESSAGE_ID_GETVIDEODECODERCONFIGCOUNT_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_INVALIDINDEX + = D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_INVALIDINDEX + 1, + D3D11_MESSAGE_ID_GETDECODERCREATIONPARAMS_NULLPARAM + = D3D11_MESSAGE_ID_GETVIDEODECODERCONFIG_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_GETDECODERDRIVERHANDLE_NULLPARAM + = D3D11_MESSAGE_ID_GETDECODERCREATIONPARAMS_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETDECODERBUFFER_NULLPARAM + = D3D11_MESSAGE_ID_GETDECODERDRIVERHANDLE_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETDECODERBUFFER_INVALIDBUFFER + = D3D11_MESSAGE_ID_GETDECODERBUFFER_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETDECODERBUFFER_INVALIDTYPE + = D3D11_MESSAGE_ID_GETDECODERBUFFER_INVALIDBUFFER + 1, + D3D11_MESSAGE_ID_GETDECODERBUFFER_LOCKED = D3D11_MESSAGE_ID_GETDECODERBUFFER_INVALIDTYPE + 1, + D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_NULLPARAM = D3D11_MESSAGE_ID_GETDECODERBUFFER_LOCKED + 1, + D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_INVALIDTYPE + = D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_NULLPARAM + 1, + D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_NOTLOCKED + = D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_INVALIDTYPE + 1, + D3D11_MESSAGE_ID_DECODERBEGINFRAME_NULLPARAM + = D3D11_MESSAGE_ID_RELEASEDECODERBUFFER_NOTLOCKED + 1, + D3D11_MESSAGE_ID_DECODERBEGINFRAME_HAZARD = D3D11_MESSAGE_ID_DECODERBEGINFRAME_NULLPARAM + 1, + D3D11_MESSAGE_ID_DECODERENDFRAME_NULLPARAM = D3D11_MESSAGE_ID_DECODERBEGINFRAME_HAZARD + 1, + D3D11_MESSAGE_ID_SUBMITDECODERBUFFERS_NULLPARAM + = D3D11_MESSAGE_ID_DECODERENDFRAME_NULLPARAM + 1, + D3D11_MESSAGE_ID_SUBMITDECODERBUFFERS_INVALIDTYPE + = D3D11_MESSAGE_ID_SUBMITDECODERBUFFERS_NULLPARAM + 1, + D3D11_MESSAGE_ID_DECODEREXTENSION_NULLPARAM + = D3D11_MESSAGE_ID_SUBMITDECODERBUFFERS_INVALIDTYPE + 1, + D3D11_MESSAGE_ID_DECODEREXTENSION_INVALIDRESOURCE + = D3D11_MESSAGE_ID_DECODEREXTENSION_NULLPARAM + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_DECODEREXTENSION_INVALIDRESOURCE + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_NULLPARAM + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDFRAMEFORMAT + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_NULLPARAM + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDUSAGE + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDFRAMEFORMAT + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDINPUTFRAMERATE + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDUSAGE + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDOUTPUTFRAMERATE + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDINPUTFRAMERATE + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDWIDTHHEIGHT + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDOUTPUTFRAMERATE + 1, + D3D11_MESSAGE_ID_GETVIDEOPROCESSORCONTENTDESC_NULLPARAM + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORENUMERATOR_INVALIDWIDTHHEIGHT + 1, + D3D11_MESSAGE_ID_CHECKVIDEOPROCESSORFORMAT_NULLPARAM + = D3D11_MESSAGE_ID_GETVIDEOPROCESSORCONTENTDESC_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEOPROCESSORCAPS_NULLPARAM + = D3D11_MESSAGE_ID_CHECKVIDEOPROCESSORFORMAT_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEOPROCESSORRATECONVERSIONCAPS_NULLPARAM + = D3D11_MESSAGE_ID_GETVIDEOPROCESSORCAPS_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEOPROCESSORRATECONVERSIONCAPS_INVALIDINDEX + = D3D11_MESSAGE_ID_GETVIDEOPROCESSORRATECONVERSIONCAPS_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEOPROCESSORCUSTOMRATE_NULLPARAM + = D3D11_MESSAGE_ID_GETVIDEOPROCESSORRATECONVERSIONCAPS_INVALIDINDEX + 1, + D3D11_MESSAGE_ID_GETVIDEOPROCESSORCUSTOMRATE_INVALIDINDEX + = D3D11_MESSAGE_ID_GETVIDEOPROCESSORCUSTOMRATE_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEOPROCESSORFILTERRANGE_NULLPARAM + = D3D11_MESSAGE_ID_GETVIDEOPROCESSORCUSTOMRATE_INVALIDINDEX + 1, + D3D11_MESSAGE_ID_GETVIDEOPROCESSORFILTERRANGE_UNSUPPORTED + = D3D11_MESSAGE_ID_GETVIDEOPROCESSORFILTERRANGE_NULLPARAM + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOR_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_GETVIDEOPROCESSORFILTERRANGE_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOR_NULLPARAM + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOR_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTTARGETRECT_NULLPARAM + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOR_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTBACKGROUNDCOLOR_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTTARGETRECT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTBACKGROUNDCOLOR_INVALIDALPHA + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTBACKGROUNDCOLOR_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTBACKGROUNDCOLOR_INVALIDALPHA + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_INVALIDFILLMODE + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTALPHAFILLMODE_INVALIDFILLMODE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSTEREOMODE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSTEREOMODE_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSTEREOMODE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTEXTENSION_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSTEREOMODE_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTTARGETRECT_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTEXTENSION_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTBACKGROUNDCOLOR_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTTARGETRECT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTBACKGROUNDCOLOR_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTALPHAFILLMODE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCONSTRICTION_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTALPHAFILLMODE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCONSTRICTION_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_INVALIDSIZE + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSTEREOMODE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCONSTRICTION_INVALIDSIZE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTEXTENSION_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSTEREOMODE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTEXTENSION_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_INVALIDFORMAT + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFRAMEFORMAT_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDRATE + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDFLAG + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDRATE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDFLAG + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMOUTPUTRATE_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_INVALIDRECT + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSOURCERECT_INVALIDRECT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_INVALIDRECT + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMDESTRECT_INVALIDRECT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_INVALIDALPHA + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_INVALIDALPHA + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDCOUNT + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDALPHA + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDCOUNT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPALETTE_INVALIDALPHA + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_INVALIDRATIO + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_INVALIDRATIO + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_INVALIDRANGE + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_INVALIDRANGE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMLUMAKEY_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_FLIPUNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_MONOOFFSETUNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_FLIPUNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_FORMATUNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_MONOOFFSETUNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_INVALIDFORMAT + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_FORMATUNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMAUTOPROCESSINGMODE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMSTEREOFORMAT_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMAUTOPROCESSINGMODE_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMAUTOPROCESSINGMODE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMAUTOPROCESSINGMODE_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDFILTER + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDFILTER + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDLEVEL + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMEXTENSION_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMFILTER_INVALIDLEVEL + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMEXTENSION_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMEXTENSION_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFRAMEFORMAT_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMEXTENSION_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFRAMEFORMAT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMOUTPUTRATE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSOURCERECT_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMOUTPUTRATE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMDESTRECT_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSOURCERECT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMALPHA_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMDESTRECT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPALETTE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMALPHA_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPIXELASPECTRATIO_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPALETTE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMLUMAKEY_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPIXELASPECTRATIO_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSTEREOFORMAT_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMLUMAKEY_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMAUTOPROCESSINGMODE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSTEREOFORMAT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFILTER_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMAUTOPROCESSINGMODE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMEXTENSION_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFILTER_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMEXTENSION_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMEXTENSION_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMEXTENSION_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDSTREAMCOUNT + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_TARGETRECT + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDSTREAMCOUNT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDOUTPUT + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_TARGETRECT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDPASTFRAMES + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDOUTPUT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDFUTUREFRAMES + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDPASTFRAMES + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDSOURCERECT + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDFUTUREFRAMES + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDDESTRECT + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDSOURCERECT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDINPUTRESOURCE + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDDESTRECT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDARRAYSIZE + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDINPUTRESOURCE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDARRAY + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDARRAYSIZE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_RIGHTEXPECTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDARRAY + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_RIGHTNOTEXPECTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_RIGHTEXPECTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_STEREONOTENABLED + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_RIGHTNOTEXPECTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDRIGHTRESOURCE + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_STEREONOTENABLED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_NOSTEREOSTREAMS + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INVALIDRIGHTRESOURCE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INPUTHAZARD + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_NOSTEREOSTREAMS + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_OUTPUTHAZARD + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_INPUTHAZARD + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_VIDEOPROCESSORBLT_OUTPUTHAZARD + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_NULLPARAM + = D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDTYPE + = D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_NULLPARAM + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDBIND + = D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDTYPE + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_UNSUPPORTEDFORMAT + = D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDBIND + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDMIP + = D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_UNSUPPORTEDFORMAT + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_UNSUPPORTEMIP + = D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDMIP + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAYSIZE + = D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_UNSUPPORTEMIP + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAY + = D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAYSIZE + 1, + D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDDIMENSION + = D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDARRAY + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATEVIDEODECODEROUTPUTVIEW_INVALIDDIMENSION + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_NULLPARAM + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDTYPE + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_NULLPARAM + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDBIND + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDTYPE + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMISC + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDBIND + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDUSAGE + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMISC + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDFORMAT + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDUSAGE + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDFOURCC + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMIP + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDFOURCC + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_UNSUPPORTEDMIP + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMIP + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDARRAYSIZE + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_UNSUPPORTEDMIP + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDARRAY + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDARRAYSIZE + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDDIMENSION + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDARRAY + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDDIMENSION + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_NULLPARAM + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDTYPE + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_NULLPARAM + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDBIND + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDTYPE + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDFORMAT + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDBIND + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMIP + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDFORMAT + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_UNSUPPORTEDMIP + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMIP + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_UNSUPPORTEDARRAY + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_UNSUPPORTEDMIP + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDARRAY + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_UNSUPPORTEDARRAY + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDDIMENSION + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDARRAY + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDDIMENSION + 1, + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS + = D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDARRAYWITHDECODER + = D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDARRAYWITHDECODER + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDARRAYWITHDECODER + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDARRAYWITHDECODER + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDARRAYWITHDECODER + 1, + D3D11_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDARRAYWITHDECODER + 1, + D3D11_MESSAGE_ID_REF_WARNING_ATOMIC_INCONSISTENT + = D3D11_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE + 1, + D3D11_MESSAGE_ID_REF_WARNING_READING_UNINITIALIZED_RESOURCE + = D3D11_MESSAGE_ID_REF_WARNING_ATOMIC_INCONSISTENT + 1, + D3D11_MESSAGE_ID_REF_WARNING_RAW_HAZARD + = D3D11_MESSAGE_ID_REF_WARNING_READING_UNINITIALIZED_RESOURCE + 1, + D3D11_MESSAGE_ID_REF_WARNING_WAR_HAZARD = D3D11_MESSAGE_ID_REF_WARNING_RAW_HAZARD + 1, + D3D11_MESSAGE_ID_REF_WARNING_WAW_HAZARD = D3D11_MESSAGE_ID_REF_WARNING_WAR_HAZARD + 1, + D3D11_MESSAGE_ID_CREATECRYPTOSESSION_NULLPARAM = D3D11_MESSAGE_ID_REF_WARNING_WAW_HAZARD + 1, + D3D11_MESSAGE_ID_CREATECRYPTOSESSION_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATECRYPTOSESSION_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETCRYPTOTYPE_NULLPARAM + = D3D11_MESSAGE_ID_CREATECRYPTOSESSION_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_GETDECODERPROFILE_NULLPARAM = D3D11_MESSAGE_ID_GETCRYPTOTYPE_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATESIZE_NULLPARAM + = D3D11_MESSAGE_ID_GETDECODERPROFILE_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATE_NULLPARAM + = D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATESIZE_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATE_WRONGSIZE + = D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATE_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETCRYPTOSESSIONHANDLE_WRONGSIZE + = D3D11_MESSAGE_ID_GETCRYPTOSESSIONCERTIFICATE_WRONGSIZE + 1, + D3D11_MESSAGE_ID_NEGOTIATECRPYTOSESSIONKEYEXCHANGE_NULLPARAM + = D3D11_MESSAGE_ID_GETCRYPTOSESSIONHANDLE_WRONGSIZE + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_UNSUPPORTED + = D3D11_MESSAGE_ID_NEGOTIATECRPYTOSESSIONKEYEXCHANGE_NULLPARAM + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_NULLPARAM = D3D11_MESSAGE_ID_ENCRYPTIONBLT_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_WRONGDEVICE = D3D11_MESSAGE_ID_ENCRYPTIONBLT_NULLPARAM + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_WRONGDEVICE + = D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_WRONGDEVICE + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_FORMAT_MISMATCH + = D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_WRONGDEVICE + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_SIZE_MISMATCH + = D3D11_MESSAGE_ID_ENCRYPTIONBLT_FORMAT_MISMATCH + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_MULTISAMPLED + = D3D11_MESSAGE_ID_ENCRYPTIONBLT_SIZE_MISMATCH + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_NOT_STAGING + = D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_MULTISAMPLED + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_MAPPED = D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_NOT_STAGING + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_MAPPED = D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_MAPPED + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_OFFERED = D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_MAPPED + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_OFFERED = D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_OFFERED + 1, + D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_CONTENT_UNDEFINED + = D3D11_MESSAGE_ID_ENCRYPTIONBLT_DST_OFFERED + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_UNSUPPORTED + = D3D11_MESSAGE_ID_ENCRYPTIONBLT_SRC_CONTENT_UNDEFINED + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_NULLPARAM = D3D11_MESSAGE_ID_DECRYPTIONBLT_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_WRONGDEVICE = D3D11_MESSAGE_ID_DECRYPTIONBLT_NULLPARAM + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_WRONGDEVICE + = D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_WRONGDEVICE + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_FORMAT_MISMATCH + = D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_WRONGDEVICE + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_SIZE_MISMATCH + = D3D11_MESSAGE_ID_DECRYPTIONBLT_FORMAT_MISMATCH + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_MULTISAMPLED + = D3D11_MESSAGE_ID_DECRYPTIONBLT_SIZE_MISMATCH + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_NOT_STAGING + = D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_MULTISAMPLED + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_NOT_RENDER_TARGET + = D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_NOT_STAGING + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_MAPPED + = D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_NOT_RENDER_TARGET + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_MAPPED = D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_MAPPED + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_OFFERED = D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_MAPPED + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_OFFERED = D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_OFFERED + 1, + D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_CONTENT_UNDEFINED + = D3D11_MESSAGE_ID_DECRYPTIONBLT_DST_OFFERED + 1, + D3D11_MESSAGE_ID_STARTSESSIONKEYREFRESH_NULLPARAM + = D3D11_MESSAGE_ID_DECRYPTIONBLT_SRC_CONTENT_UNDEFINED + 1, + D3D11_MESSAGE_ID_STARTSESSIONKEYREFRESH_INVALIDSIZE + = D3D11_MESSAGE_ID_STARTSESSIONKEYREFRESH_NULLPARAM + 1, + D3D11_MESSAGE_ID_FINISHSESSIONKEYREFRESH_NULLPARAM + = D3D11_MESSAGE_ID_STARTSESSIONKEYREFRESH_INVALIDSIZE + 1, + D3D11_MESSAGE_ID_GETENCRYPTIONBLTKEY_NULLPARAM + = D3D11_MESSAGE_ID_FINISHSESSIONKEYREFRESH_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETENCRYPTIONBLTKEY_INVALIDSIZE + = D3D11_MESSAGE_ID_GETENCRYPTIONBLTKEY_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETCONTENTPROTECTIONCAPS_NULLPARAM + = D3D11_MESSAGE_ID_GETENCRYPTIONBLTKEY_INVALIDSIZE + 1, + D3D11_MESSAGE_ID_CHECKCRYPTOKEYEXCHANGE_NULLPARAM + = D3D11_MESSAGE_ID_GETCONTENTPROTECTIONCAPS_NULLPARAM + 1, + D3D11_MESSAGE_ID_CHECKCRYPTOKEYEXCHANGE_INVALIDINDEX + = D3D11_MESSAGE_ID_CHECKCRYPTOKEYEXCHANGE_NULLPARAM + 1, + D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_NULLPARAM + = D3D11_MESSAGE_ID_CHECKCRYPTOKEYEXCHANGE_INVALIDINDEX + 1, + D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_UNSUPPORTED + = D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_NULLPARAM + 1, + D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_INVALIDTYPE + = D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_OUTOFMEMORY_RETURN + = D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_INVALIDTYPE + 1, + D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATESIZE_INVALIDCHANNEL + = D3D11_MESSAGE_ID_CREATEAUTHENTICATEDCHANNEL_OUTOFMEMORY_RETURN + 1, + D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATESIZE_NULLPARAM + = D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATESIZE_INVALIDCHANNEL + 1, + D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_INVALIDCHANNEL + = D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATESIZE_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_NULLPARAM + = D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_INVALIDCHANNEL + 1, + D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_WRONGSIZE + = D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_NULLPARAM + 1, + D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_INVALIDCHANNEL + = D3D11_MESSAGE_ID_GETAUTHENTICATEDCHANNELCERTIFICATE_WRONGSIZE + 1, + D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_NULLPARAM + = D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_INVALIDCHANNEL + 1, + D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_NULLPARAM + = D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_NULLPARAM + 1, + D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_WRONGCHANNEL + = D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_NULLPARAM + 1, + D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_UNSUPPORTEDQUERY + = D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_WRONGCHANNEL + 1, + D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_WRONGSIZE + = D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_UNSUPPORTEDQUERY + 1, + D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_INVALIDPROCESSINDEX + = D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_WRONGSIZE + 1, + D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_NULLPARAM + = D3D11_MESSAGE_ID_QUERYAUTHENTICATEDCHANNEL_INVALIDPROCESSINDEX + 1, + D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_WRONGCHANNEL + = D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_NULLPARAM + 1, + D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_UNSUPPORTEDCONFIGURE + = D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_WRONGCHANNEL + 1, + D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_WRONGSIZE + = D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_UNSUPPORTEDCONFIGURE + 1, + D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_INVALIDPROCESSIDTYPE + = D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_WRONGSIZE + 1, + D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + = D3D11_MESSAGE_ID_CONFIGUREAUTHENTICATEDCHANNEL_INVALIDPROCESSIDTYPE + 1, + D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + = D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1, + D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + = D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1, + D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + = D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1, + D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + = D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1, + D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + = D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1, + D3D11_MESSAGE_ID_NEGOTIATECRPYTOSESSIONKEYEXCHANGE_INVALIDSIZE + = D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFEROFFSETORCOUNT + 1, + D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_INVALIDSIZE + = D3D11_MESSAGE_ID_NEGOTIATECRPYTOSESSIONKEYEXCHANGE_INVALIDSIZE + 1, + D3D11_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY + = D3D11_MESSAGE_ID_NEGOTIATEAUTHENTICATEDCHANNELKEYEXCHANGE_INVALIDSIZE + 1, + D3D11_MESSAGE_ID_GETCRYPTOSESSIONHANDLE_OUTOFMEMORY + = D3D11_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY + 1, + D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_NULLPARAM + = D3D11_MESSAGE_ID_GETCRYPTOSESSIONHANDLE_OUTOFMEMORY + 1, + D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDTYPE + = D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_NULLPARAM + 1, + D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDBIND + = D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDTYPE + 1, + D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDARRAY + = D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDBIND + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_NULLPARAM + = D3D11_MESSAGE_ID_ACQUIREHANDLEFORCAPTURE_INVALIDARRAY + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_INVALID + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_INVALID + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMROTATION_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMROTATION_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMROTATION_NULLPARAM + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_SHADEREXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_SHADEREXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_SHADEREXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_SHADEREXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_SHADEREXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED + + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_SHADEREXTENSIONSNOTSUPPORTED + + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_SHADEREXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_SHADEREXTENSIONSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION + = D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_SHADEREXTENSIONSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_UNSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMPIXELASPECTRATIO_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_INVALIDOFFSET + = D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_TOOMANYVIEWS + = D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_INVALIDOFFSET + 1, + D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_NOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_TOOMANYVIEWS + 1, + D3D11_MESSAGE_ID_SWAPDEVICECONTEXTSTATE_NOTSUPPORTED + = D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_NOTSUPPORTED + 1, + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_PREFERUPDATESUBRESOURCE1 + = D3D11_MESSAGE_ID_SWAPDEVICECONTEXTSTATE_NOTSUPPORTED + 1, + D3D11_MESSAGE_ID_GETDC_INACCESSIBLE + = D3D11_MESSAGE_ID_UPDATESUBRESOURCE_PREFERUPDATESUBRESOURCE1 + 1, + D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDRECT = D3D11_MESSAGE_ID_GETDC_INACCESSIBLE + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLE_MASK_IGNORED_ON_FL9 + = D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDRECT + 1, + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE1_NOT_SUPPORTED + = D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLE_MASK_IGNORED_ON_FL9 + 1, + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BY_NAME_NOT_SUPPORTED + = D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE1_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_ENQUEUESETEVENT_NOT_SUPPORTED + = D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BY_NAME_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_OFFERRELEASE_NOT_SUPPORTED + = D3D11_MESSAGE_ID_ENQUEUESETEVENT_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_OFFERRESOURCES_INACCESSIBLE = D3D11_MESSAGE_ID_OFFERRELEASE_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMSAA + = D3D11_MESSAGE_ID_OFFERRESOURCES_INACCESSIBLE + 1, + D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMSAA + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMSAA + 1, + D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT + = D3D11_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMSAA + 1, + D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT + = D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT + 1, + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_EMPTYDESTBOX + = D3D11_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT + 1, + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_EMPTYSOURCEBOX + = D3D11_MESSAGE_ID_UPDATESUBRESOURCE_EMPTYDESTBOX + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS + = D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_EMPTYSOURCEBOX + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_DEPTHSTENCILVIEW_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET + = D3D11_MESSAGE_ID_DEVICE_DRAW_DEPTHSTENCILVIEW_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET_DUE_TO_FLIP_PRESENT + = D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET + 1, + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET_DUE_TO_FLIP_PRESENT + = D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET_DUE_TO_FLIP_PRESENT + 1, + D3D11_MESSAGE_ID_GETDATAFORNEWHARDWAREKEY_NULLPARAM + = D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET_DUE_TO_FLIP_PRESENT + 1, + D3D11_MESSAGE_ID_CHECKCRYPTOSESSIONSTATUS_NULLPARAM + = D3D11_MESSAGE_ID_GETDATAFORNEWHARDWAREKEY_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETCRYPTOSESSIONPRIVATEDATASIZE_NULLPARAM + = D3D11_MESSAGE_ID_CHECKCRYPTOSESSIONSTATUS_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERCAPS_NULLPARAM + = D3D11_MESSAGE_ID_GETCRYPTOSESSIONPRIVATEDATASIZE_NULLPARAM + 1, + D3D11_MESSAGE_ID_GETVIDEODECODERCAPS_ZEROWIDTHHEIGHT + = D3D11_MESSAGE_ID_GETVIDEODECODERCAPS_NULLPARAM + 1, + D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_NULLPARAM + = D3D11_MESSAGE_ID_GETVIDEODECODERCAPS_ZEROWIDTHHEIGHT + 1, + D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE + = D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_NULLPARAM + 1, + D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT + = D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE + 1, + D3D11_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_NULLPARAM + = D3D11_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT + 1, + D3D11_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_NULLPARAM + = D3D11_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_NULLPARAM + 1, + D3D11_MESSAGE_ID_CHECKVIDEOPROCESSORFORMATCONVERSION_NULLPARAM + = D3D11_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE1_NULLPARAM + = D3D11_MESSAGE_ID_CHECKVIDEOPROCESSORFORMATCONVERSION_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE1_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE1_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE1_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_UNSUPPORTED + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_UNSUPPORTED + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_NULLPARAM + 1, + D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_NULLPARAM + 1, + D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE + = D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_NULLPARAM + 1, + D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT + = D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSHADERUSAGE_NULLPARAM + = D3D11_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSHADERUSAGE_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSHADERUSAGE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSHADERUSAGE_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSTREAMCOUNT + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_TARGETRECT + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSTREAMCOUNT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSOURCERECT + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_TARGETRECT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDDESTRECT + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSOURCERECT + 1, + D3D11_MESSAGE_ID_GETCRYPTOSESSIONPRIVATEDATASIZE_INVALID_KEY_EXCHANGE_TYPE + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDDESTRECT + 1, + D3D11_MESSAGE_ID_D3D11_1_MESSAGES_END + = D3D11_MESSAGE_ID_GETCRYPTOSESSIONPRIVATEDATASIZE_INVALID_KEY_EXCHANGE_TYPE + 1, + D3D11_MESSAGE_ID_D3D11_2_MESSAGES_START = D3D11_MESSAGE_ID_D3D11_1_MESSAGES_END + 1, + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDUSAGE = D3D11_MESSAGE_ID_D3D11_2_MESSAGES_START + 1, + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDUSAGE = D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDUSAGE + 1, + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDUSAGE + = D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDUSAGE + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_STEPRATE_NOT_1 + = D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDUSAGE + 1, + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_INSTANCING_NOT_SUPPORTED + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_STEPRATE_NOT_1 + 1, + D3D11_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER + = D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_INSTANCING_NOT_SUPPORTED + 1, + D3D11_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER + = D3D11_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER + 1, + D3D11_MESSAGE_ID_COPYTILES_INVALID_PARAMETER + = D3D11_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER + 1, + D3D11_MESSAGE_ID_UPDATETILES_INVALID_PARAMETER + = D3D11_MESSAGE_ID_COPYTILES_INVALID_PARAMETER + 1, + D3D11_MESSAGE_ID_RESIZETILEPOOL_INVALID_PARAMETER + = D3D11_MESSAGE_ID_UPDATETILES_INVALID_PARAMETER + 1, + D3D11_MESSAGE_ID_TILEDRESOURCEBARRIER_INVALID_PARAMETER + = D3D11_MESSAGE_ID_RESIZETILEPOOL_INVALID_PARAMETER + 1, + D3D11_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_WARNING + = D3D11_MESSAGE_ID_TILEDRESOURCEBARRIER_INVALID_PARAMETER + 1, + D3D11_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_ERROR + = D3D11_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_WARNING + 1, + D3D11_MESSAGE_ID_DIRTY_TILE_MAPPING_ACCESS + = D3D11_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_ERROR + 1, + D3D11_MESSAGE_ID_DUPLICATE_TILE_MAPPINGS_IN_COVERED_AREA + = D3D11_MESSAGE_ID_DIRTY_TILE_MAPPING_ACCESS + 1, + D3D11_MESSAGE_ID_TILE_MAPPINGS_IN_COVERED_AREA_DUPLICATED_OUTSIDE + = D3D11_MESSAGE_ID_DUPLICATE_TILE_MAPPINGS_IN_COVERED_AREA + 1, + D3D11_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INCOMPATIBLE_RESOURCES + = D3D11_MESSAGE_ID_TILE_MAPPINGS_IN_COVERED_AREA_DUPLICATED_OUTSIDE + 1, + D3D11_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INPUT_AND_OUTPUT + = D3D11_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INCOMPATIBLE_RESOURCES + 1, + D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_INVALIDFLAGS + = D3D11_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INPUT_AND_OUTPUT + 1, + D3D11_MESSAGE_ID_GETRESOURCETILING_NONTILED_RESOURCE + = D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_INVALIDFLAGS + 1, + D3D11_MESSAGE_ID_RESIZETILEPOOL_SHRINK_WITH_MAPPINGS_STILL_DEFINED_PAST_END + = D3D11_MESSAGE_ID_GETRESOURCETILING_NONTILED_RESOURCE + 1, + D3D11_MESSAGE_ID_NEED_TO_CALL_TILEDRESOURCEBARRIER + = D3D11_MESSAGE_ID_RESIZETILEPOOL_SHRINK_WITH_MAPPINGS_STILL_DEFINED_PAST_END + 1, + D3D11_MESSAGE_ID_CREATEDEVICE_INVALIDARGS + = D3D11_MESSAGE_ID_NEED_TO_CALL_TILEDRESOURCEBARRIER + 1, + D3D11_MESSAGE_ID_CREATEDEVICE_WARNING = D3D11_MESSAGE_ID_CREATEDEVICE_INVALIDARGS + 1, + D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWUINT_HAZARD + = D3D11_MESSAGE_ID_CREATEDEVICE_WARNING + 1, + D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_HAZARD + = D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWUINT_HAZARD + 1, + D3D11_MESSAGE_ID_TILED_RESOURCE_TIER_1_BUFFER_TEXTURE_MISMATCH + = D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_HAZARD + 1, + D3D11_MESSAGE_ID_CREATE_CRYPTOSESSION + = D3D11_MESSAGE_ID_TILED_RESOURCE_TIER_1_BUFFER_TEXTURE_MISMATCH + 1, + D3D11_MESSAGE_ID_CREATE_AUTHENTICATEDCHANNEL = D3D11_MESSAGE_ID_CREATE_CRYPTOSESSION + 1, + D3D11_MESSAGE_ID_LIVE_CRYPTOSESSION = D3D11_MESSAGE_ID_CREATE_AUTHENTICATEDCHANNEL + 1, + D3D11_MESSAGE_ID_LIVE_AUTHENTICATEDCHANNEL = D3D11_MESSAGE_ID_LIVE_CRYPTOSESSION + 1, + D3D11_MESSAGE_ID_DESTROY_CRYPTOSESSION = D3D11_MESSAGE_ID_LIVE_AUTHENTICATEDCHANNEL + 1, + D3D11_MESSAGE_ID_DESTROY_AUTHENTICATEDCHANNEL = D3D11_MESSAGE_ID_DESTROY_CRYPTOSESSION + 1, + D3D11_MESSAGE_ID_D3D11_2_MESSAGES_END = D3D11_MESSAGE_ID_DESTROY_AUTHENTICATEDCHANNEL + 1, + D3D11_MESSAGE_ID_D3D11_3_MESSAGES_START = D3D11_MESSAGE_ID_D3D11_2_MESSAGES_END + 1, + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE + = D3D11_MESSAGE_ID_D3D11_3_MESSAGES_START + 1, + D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_SYSTEMVALUE + = D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE + 1, + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDCONTEXTTYPE + = D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_SYSTEMVALUE + 1, + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_DECODENOTSUPPORTED + = D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDCONTEXTTYPE + 1, + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_ENCODENOTSUPPORTED + = D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_DECODENOTSUPPORTED + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX + = D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_ENCODENOTSUPPORTED + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX + 1, + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANEINDEX + = D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANEINDEX + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANEINDEX + 1, + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_AMBIGUOUSVIDEOPLANEINDEX + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANEINDEX + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANEINDEX + = D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANEINDEX + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANEINDEX + 1, + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_AMBIGUOUSVIDEOPLANEINDEX + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANEINDEX + 1, + D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSCANDATAOFFSET + = D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1, + D3D11_MESSAGE_ID_JPEGDECODE_NOTSUPPORTED + = D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSCANDATAOFFSET + 1, + D3D11_MESSAGE_ID_JPEGDECODE_DIMENSIONSTOOLARGE = D3D11_MESSAGE_ID_JPEGDECODE_NOTSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGDECODE_INVALIDCOMPONENTS + = D3D11_MESSAGE_ID_JPEGDECODE_DIMENSIONSTOOLARGE + 1, + D3D11_MESSAGE_ID_JPEGDECODE_DESTINATIONNOT2D + = D3D11_MESSAGE_ID_JPEGDECODE_INVALIDCOMPONENTS + 1, + D3D11_MESSAGE_ID_JPEGDECODE_TILEDRESOURCESUNSUPPORTED + = D3D11_MESSAGE_ID_JPEGDECODE_DESTINATIONNOT2D + 1, + D3D11_MESSAGE_ID_JPEGDECODE_GUARDRECTSUNSUPPORTED + = D3D11_MESSAGE_ID_JPEGDECODE_TILEDRESOURCESUNSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGDECODE_FORMATUNSUPPORTED + = D3D11_MESSAGE_ID_JPEGDECODE_GUARDRECTSUNSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSUBRESOURCE + = D3D11_MESSAGE_ID_JPEGDECODE_FORMATUNSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGDECODE_INVALIDMIPLEVEL + = D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSUBRESOURCE + 1, + D3D11_MESSAGE_ID_JPEGDECODE_EMPTYDESTBOX = D3D11_MESSAGE_ID_JPEGDECODE_INVALIDMIPLEVEL + 1, + D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXNOT2D = D3D11_MESSAGE_ID_JPEGDECODE_EMPTYDESTBOX + 1, + D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXNOTSUB = D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXNOT2D + 1, + D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXESINTERSECT = D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXNOTSUB + 1, + D3D11_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEMISMATCH + = D3D11_MESSAGE_ID_JPEGDECODE_DESTBOXESINTERSECT + 1, + D3D11_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEMISMATCH + = D3D11_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEMISMATCH + 1, + D3D11_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEODD = D3D11_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEMISMATCH + 1, + D3D11_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEODD = D3D11_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEODD + 1, + D3D11_MESSAGE_ID_JPEGDECODE_OUTPUTDIMENSIONSTOOLARGE + = D3D11_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEODD + 1, + D3D11_MESSAGE_ID_JPEGDECODE_NONPOW2SCALEUNSUPPORTED + = D3D11_MESSAGE_ID_JPEGDECODE_OUTPUTDIMENSIONSTOOLARGE + 1, + D3D11_MESSAGE_ID_JPEGDECODE_FRACTIONALDOWNSCALETOLARGE + = D3D11_MESSAGE_ID_JPEGDECODE_NONPOW2SCALEUNSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGDECODE_CHROMASIZEMISMATCH + = D3D11_MESSAGE_ID_JPEGDECODE_FRACTIONALDOWNSCALETOLARGE + 1, + D3D11_MESSAGE_ID_JPEGDECODE_LUMACHROMASIZEMISMATCH + = D3D11_MESSAGE_ID_JPEGDECODE_CHROMASIZEMISMATCH + 1, + D3D11_MESSAGE_ID_JPEGDECODE_INVALIDNUMDESTINATIONS + = D3D11_MESSAGE_ID_JPEGDECODE_LUMACHROMASIZEMISMATCH + 1, + D3D11_MESSAGE_ID_JPEGDECODE_SUBBOXUNSUPPORTED + = D3D11_MESSAGE_ID_JPEGDECODE_INVALIDNUMDESTINATIONS + 1, + D3D11_MESSAGE_ID_JPEGDECODE_1DESTUNSUPPORTEDFORMAT + = D3D11_MESSAGE_ID_JPEGDECODE_SUBBOXUNSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGDECODE_3DESTUNSUPPORTEDFORMAT + = D3D11_MESSAGE_ID_JPEGDECODE_1DESTUNSUPPORTEDFORMAT + 1, + D3D11_MESSAGE_ID_JPEGDECODE_SCALEUNSUPPORTED + = D3D11_MESSAGE_ID_JPEGDECODE_3DESTUNSUPPORTEDFORMAT + 1, + D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSOURCESIZE + = D3D11_MESSAGE_ID_JPEGDECODE_SCALEUNSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGDECODE_INVALIDCOPYFLAGS + = D3D11_MESSAGE_ID_JPEGDECODE_INVALIDSOURCESIZE + 1, + D3D11_MESSAGE_ID_JPEGDECODE_HAZARD = D3D11_MESSAGE_ID_JPEGDECODE_INVALIDCOPYFLAGS + 1, + D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERUSAGE = D3D11_MESSAGE_ID_JPEGDECODE_HAZARD + 1, + D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS + = D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERUSAGE + 1, + D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE + = D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS + 1, + D3D11_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED + = D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE + 1, + D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPRTEDCOPYFLAGS + = D3D11_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED = D3D11_MESSAGE_ID_JPEGDECODE_UNSUPPRTEDCOPYFLAGS + 1, + D3D11_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET + = D3D11_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS + = D3D11_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET + 1, + D3D11_MESSAGE_ID_JPEGENCODE_SOURCENOT2D = D3D11_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS + 1, + D3D11_MESSAGE_ID_JPEGENCODE_TILEDRESOURCESUNSUPPORTED + = D3D11_MESSAGE_ID_JPEGENCODE_SOURCENOT2D + 1, + D3D11_MESSAGE_ID_JPEGENCODE_GUARDRECTSUNSUPPORTED + = D3D11_MESSAGE_ID_JPEGENCODE_TILEDRESOURCESUNSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGENCODE_XSUBSAMPLEMISMATCH + = D3D11_MESSAGE_ID_JPEGENCODE_GUARDRECTSUNSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGENCODE_YSUBSAMPLEMISMATCH + = D3D11_MESSAGE_ID_JPEGENCODE_XSUBSAMPLEMISMATCH + 1, + D3D11_MESSAGE_ID_JPEGENCODE_FORMATUNSUPPORTED + = D3D11_MESSAGE_ID_JPEGENCODE_YSUBSAMPLEMISMATCH + 1, + D3D11_MESSAGE_ID_JPEGENCODE_INVALIDSUBRESOURCE + = D3D11_MESSAGE_ID_JPEGENCODE_FORMATUNSUPPORTED + 1, + D3D11_MESSAGE_ID_JPEGENCODE_INVALIDMIPLEVEL + = D3D11_MESSAGE_ID_JPEGENCODE_INVALIDSUBRESOURCE + 1, + D3D11_MESSAGE_ID_JPEGENCODE_DIMENSIONSTOOLARGE + = D3D11_MESSAGE_ID_JPEGENCODE_INVALIDMIPLEVEL + 1, + D3D11_MESSAGE_ID_JPEGENCODE_HAZARD = D3D11_MESSAGE_ID_JPEGENCODE_DIMENSIONSTOOLARGE + 1, + D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERUSAGE = D3D11_MESSAGE_ID_JPEGENCODE_HAZARD + 1, + D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS + = D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERUSAGE + 1, + D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE + = D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS + 1, + D3D11_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED + = D3D11_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE + 1, + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTTYPEFORQUERY + = D3D11_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED + 1, + D3D11_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE + = D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTTYPEFORQUERY + 1, + D3D11_MESSAGE_ID_DEVICE_SETHARDWAREPROTECTION_INVALIDCONTEXT + = D3D11_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTHDRMETADATA_NULLPARAM + = D3D11_MESSAGE_ID_DEVICE_SETHARDWAREPROTECTION_INVALIDCONTEXT + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTHDRMETADATA_INVALIDSIZE + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTHDRMETADATA_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTHDRMETADATA_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTHDRMETADATA_INVALIDSIZE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTHDRMETADATA_INVALIDSIZE + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTHDRMETADATA_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMHDRMETADATA_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTHDRMETADATA_INVALIDSIZE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMHDRMETADATA_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMHDRMETADATA_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMHDRMETADATA_INVALIDSIZE + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMHDRMETADATA_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMHDRMETADATA_NULLPARAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMHDRMETADATA_INVALIDSIZE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMHDRMETADATA_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMHDRMETADATA_NULLPARAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMHDRMETADATA_INVALIDSIZE + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMHDRMETADATA_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFRAMEFORMAT_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMHDRMETADATA_INVALIDSIZE + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFRAMEFORMAT_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMOUTPUTRATE_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSOURCERECT_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMOUTPUTRATE_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMDESTRECT_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSOURCERECT_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMALPHA_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMDESTRECT_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPALETTE_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMALPHA_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPIXELASPECTRATIO_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPALETTE_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMLUMAKEY_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMPIXELASPECTRATIO_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSTEREOFORMAT_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMLUMAKEY_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMAUTOPROCESSINGMODE_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMSTEREOFORMAT_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFILTER_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMAUTOPROCESSINGMODE_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMROTATION_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMFILTER_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMROTATION_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_INVALIDSTREAM + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_CREATE_FENCE + = D3D11_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_INVALIDSTREAM + 1, + D3D11_MESSAGE_ID_LIVE_FENCE = D3D11_MESSAGE_ID_CREATE_FENCE + 1, + D3D11_MESSAGE_ID_DESTROY_FENCE = D3D11_MESSAGE_ID_LIVE_FENCE + 1, + D3D11_MESSAGE_ID_D3D11_3_MESSAGES_END = D3D11_MESSAGE_ID_DESTROY_FENCE + 1, +}} +STRUCT!{struct D3D11_MESSAGE { + Category: D3D11_MESSAGE_CATEGORY, + Severity: D3D11_MESSAGE_SEVERITY, + ID: D3D11_MESSAGE_ID, + pDescription: *const c_char, + DescriptionByteLength: SIZE_T, +}} +STRUCT!{struct D3D11_INFO_QUEUE_FILTER_DESC { + NumCategories: UINT, + pCategoryList: *const D3D11_MESSAGE_CATEGORY, + NumSeverities: UINT, + pSeverityList: *const D3D11_MESSAGE_SEVERITY, + NumIDs: UINT, + pIDList: *const D3D11_MESSAGE_ID, +}} +STRUCT!{struct D3D11_INFO_QUEUE_FILTER { + AllowList: D3D11_INFO_QUEUE_FILTER_DESC, + DenyList: D3D11_INFO_QUEUE_FILTER_DESC, +}} +pub const D3D11_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT: UINT64 = 1024; +RIDL!{#[uuid(0x6543dbb6, 0x1b48, 0x42f5, 0xab, 0x82, 0xe9, 0x7e, 0xc7, 0x43, 0x26, 0xf6)] +interface ID3D11InfoQueue(ID3D11InfoQueueVtbl): IUnknown(IUnknownVtbl) { + fn SetMessageCountLimit( + MessageCountLimit: UINT64, + ) -> HRESULT, + fn ClearStoredMessages() -> (), + fn GetMessage( + MessageIndex: UINT64, + pMessage: *mut D3D11_MESSAGE, + pMessageByteLength: *mut SIZE_T, + ) -> HRESULT, + fn GetNumMessagesAllowedByStorageFilter() -> UINT64, + fn GetNumMessagesDeniedByStorageFilter() -> UINT64, + fn GetNumStoredMessages() -> UINT64, + fn GetNumStoredMessagesAllowedByRetrievalFilter() -> UINT64, + fn GetNumMessagesDiscardedByMessageCountLimit() -> UINT64, + fn GetMessageCountLimit() -> UINT64, + fn AddStorageFilterEntries( + pFilter: *const D3D11_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn GetStorageFilter( + pFilter: *mut D3D11_INFO_QUEUE_FILTER, + pFilterByteLength: *mut SIZE_T, + ) -> HRESULT, + fn ClearStorageFilter() -> (), + fn PushEmptyStorageFilter() -> HRESULT, + fn PushCopyOfStorageFilter() -> HRESULT, + fn PushStorageFilter( + pFilter: *const D3D11_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn PopStorageFilter() -> (), + fn GetStorageFilterStackSize() -> UINT, + fn AddRetrievalFilterEntries( + pFilter: *const D3D11_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn GetRetrievalFilter( + pFilter: *mut D3D11_INFO_QUEUE_FILTER, + pFilterByteLength: *mut SIZE_T, + ) -> HRESULT, + fn ClearRetrievalFilter() -> (), + fn PushEmptyRetrievalFilter() -> HRESULT, + fn PushCopyOfRetrievalFilter() -> HRESULT, + fn PushRetrievalFilter( + pFilter: *const D3D11_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn PopRetrievalFilter() -> (), + fn GetRetrievalFilterStackSize() -> UINT, + fn AddMessage( + Category: D3D11_MESSAGE_CATEGORY, + Severity: D3D11_MESSAGE_SEVERITY, + ID: D3D11_MESSAGE_ID, + pDescription: LPCSTR, + ) -> HRESULT, + fn AddApplicationMessage( + Severity: D3D11_MESSAGE_SEVERITY, + pDescription: LPCSTR, + ) -> HRESULT, + fn SetBreakOnCategory( + Category: D3D11_MESSAGE_CATEGORY, + bEnable: BOOL, + ) -> HRESULT, + fn SetBreakOnSeverity( + ID: D3D11_MESSAGE_ID, + bEnable: BOOL, + ) -> HRESULT, + fn SetBreakOnID( + Severity: D3D11_MESSAGE_SEVERITY, + bEnable: BOOL, + ) -> HRESULT, + fn GetBreakOnCategory( + Category: D3D11_MESSAGE_CATEGORY, + ) -> BOOL, + fn GetBreakOnSeverity( + Severity: D3D11_MESSAGE_SEVERITY, + ) -> BOOL, + fn GetBreakOnID( + ID: D3D11_MESSAGE_ID, + ) -> BOOL, + fn SetMuteDebugOutput( + bMute: BOOL, + ) -> (), + fn GetMuteDebugOutput() -> BOOL, +}} +DEFINE_GUID!{IID_ID3D11Debug, + 0x79cf2233, 0x7536, 0x4948, 0x9d, 0x36, 0x1e, 0x46, 0x92, 0xdc, 0x57, 0x60} +DEFINE_GUID!{IID_ID3D11SwitchToRef, + 0x1ef337e3, 0x58e7, 0x4f83, 0xa6, 0x92, 0xdb, 0x22, 0x1f, 0x5e, 0xd4, 0x7e} +DEFINE_GUID!{IID_ID3D11TracingDevice, + 0x1911c771, 0x1587, 0x413e, 0xa7, 0xe0, 0xfb, 0x26, 0xc3, 0xde, 0x02, 0x68} +DEFINE_GUID!{IID_ID3D11RefTrackingOptions, + 0x193dacdf, 0x0db2, 0x4c05, 0xa5, 0x5c, 0xef, 0x06, 0xca, 0xc5, 0x6f, 0xd9} +DEFINE_GUID!{IID_ID3D11RefDefaultTrackingOptions, + 0x03916615, 0xc644, 0x418c, 0x9b, 0xf4, 0x75, 0xdb, 0x5b, 0xe6, 0x3c, 0xa0} +DEFINE_GUID!{IID_ID3D11InfoQueue, + 0x6543dbb6, 0x1b48, 0x42f5, 0xab, 0x82, 0xe9, 0x7e, 0xc7, 0x43, 0x26, 0xf6} diff --git a/bash-5.1/vendor/winapi/src/um/d3d11shader.rs b/bash-5.1/vendor/winapi/src/um/d3d11shader.rs new file mode 100644 index 0000000000000000000000000000000000000000..ebe06b424396eb1a05ad89b97943af36d78b2cd5 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d11shader.rs @@ -0,0 +1,477 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_int; +use shared::basetsd::UINT64; +use shared::minwindef::{BOOL, BYTE, INT, LPVOID, UINT}; +use um::d3dcommon::{ + D3D_CBUFFER_TYPE, D3D_FEATURE_LEVEL, D3D_INTERPOLATION_MODE, D3D_MIN_PRECISION, D3D_NAME, + D3D_PARAMETER_FLAGS, D3D_PRIMITIVE, D3D_PRIMITIVE_TOPOLOGY, D3D_REGISTER_COMPONENT_TYPE, + D3D_RESOURCE_RETURN_TYPE, D3D_SHADER_INPUT_TYPE, D3D_SHADER_VARIABLE_CLASS, + D3D_SHADER_VARIABLE_TYPE, D3D_SRV_DIMENSION, D3D_TESSELLATOR_DOMAIN, + D3D_TESSELLATOR_OUTPUT_PRIMITIVE, D3D_TESSELLATOR_PARTITIONING, ID3DBlob, +}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCSTR}; +ENUM!{enum D3D11_SHADER_VERSION_TYPE { + D3D11_SHVER_PIXEL_SHADER = 0, + D3D11_SHVER_VERTEX_SHADER = 1, + D3D11_SHVER_GEOMETRY_SHADER = 2, + D3D11_SHVER_HULL_SHADER = 3, + D3D11_SHVER_DOMAIN_SHADER = 4, + D3D11_SHVER_COMPUTE_SHADER = 5, + D3D11_SHVER_RESERVED0 = 0xFFF0, +}} +pub const D3D_RETURN_PARAMETER_INDEX: c_int = -1; +pub type D3D11_RESOURCE_RETURN_TYPE = D3D_RESOURCE_RETURN_TYPE; +pub type D3D11_CBUFFER_TYPE = D3D_CBUFFER_TYPE; +STRUCT!{struct D3D11_SIGNATURE_PARAMETER_DESC { + SemanticName: LPCSTR, + SemanticIndex: UINT, + Register: UINT, + SystemValueType: D3D_NAME, + ComponentType: D3D_REGISTER_COMPONENT_TYPE, + Mask: BYTE, + ReadWriteMask: BYTE, + Stream: UINT, + MinPrecision: D3D_MIN_PRECISION, +}} +STRUCT!{struct D3D11_SHADER_BUFFER_DESC { + Name: LPCSTR, + Type: D3D_CBUFFER_TYPE, + Variables: UINT, + Size: UINT, + uFlags: UINT, +}} +STRUCT!{struct D3D11_SHADER_VARIABLE_DESC { + Name: LPCSTR, + StartOffset: UINT, + Size: UINT, + uFlags: UINT, + DefaultValue: LPVOID, + StartTexture: UINT, + TextureSize: UINT, + StartSampler: UINT, + SamplerSize: UINT, +}} +STRUCT!{struct D3D11_SHADER_TYPE_DESC { + Class: D3D_SHADER_VARIABLE_CLASS, + Type: D3D_SHADER_VARIABLE_TYPE, + Rows: UINT, + Columns: UINT, + Elements: UINT, + Members: UINT, + Offset: UINT, + Name: LPCSTR, +}} +pub type D3D11_TESSELLATOR_DOMAIN = D3D_TESSELLATOR_DOMAIN; +pub type D3D11_TESSELLATOR_PARTITIONING = D3D_TESSELLATOR_PARTITIONING; +pub type D3D11_TESSELLATOR_OUTPUT_PRIMITIVE = D3D_TESSELLATOR_OUTPUT_PRIMITIVE; +STRUCT!{struct D3D11_SHADER_DESC { + Version: UINT, + Creator: LPCSTR, + Flags: UINT, + ConstantBuffers: UINT, + BoundResources: UINT, + InputParameters: UINT, + OutputParameters: UINT, + InstructionCount: UINT, + TempRegisterCount: UINT, + TempArrayCount: UINT, + DefCount: UINT, + DclCount: UINT, + TextureNormalInstructions: UINT, + TextureLoadInstructions: UINT, + TextureCompInstructions: UINT, + TextureBiasInstructions: UINT, + TextureGradientInstructions: UINT, + FloatInstructionCount: UINT, + IntInstructionCount: UINT, + UintInstructionCount: UINT, + StaticFlowControlCount: UINT, + DynamicFlowControlCount: UINT, + MacroInstructionCount: UINT, + ArrayInstructionCount: UINT, + CutInstructionCount: UINT, + EmitInstructionCount: UINT, + GSOutputTopology: D3D_PRIMITIVE_TOPOLOGY, + GSMaxOutputVertexCount: UINT, + InputPrimitive: D3D_PRIMITIVE, + PatchConstantParameters: UINT, + cGSInstanceCount: UINT, + cControlPoints: UINT, + HSOutputPrimitive: D3D_TESSELLATOR_OUTPUT_PRIMITIVE, + HSPartitioning: D3D_TESSELLATOR_PARTITIONING, + TessellatorDomain: D3D_TESSELLATOR_DOMAIN, + cBarrierInstructions: UINT, + cInterlockedInstructions: UINT, + cTextureStoreInstructions: UINT, +}} +STRUCT!{struct D3D11_SHADER_INPUT_BIND_DESC { + Name: LPCSTR, + Type: D3D_SHADER_INPUT_TYPE, + BindPoint: UINT, + BindCount: UINT, + uFlags: UINT, + ReturnType: D3D_RESOURCE_RETURN_TYPE, + Dimension: D3D_SRV_DIMENSION, + NumSamples: UINT, +}} +pub const D3D_SHADER_REQUIRES_DOUBLES: UINT64 = 0x00000001; +pub const D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL: UINT64 = 0x00000002; +pub const D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE: UINT64 = 0x00000004; +pub const D3D_SHADER_REQUIRES_64_UAVS: UINT64 = 0x00000008; +pub const D3D_SHADER_REQUIRES_MINIMUM_PRECISION: UINT64 = 0x00000010; +pub const D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS: UINT64 = 0x00000020; +pub const D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS: UINT64 = 0x00000040; +pub const D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING: UINT64 = 0x00000080; +pub const D3D_SHADER_REQUIRES_TILED_RESOURCES: UINT64 = 0x00000100; +STRUCT!{struct D3D11_LIBRARY_DESC { + Creator: LPCSTR, + Flags: UINT, + FunctionCount: UINT, +}} +STRUCT!{struct D3D11_FUNCTION_DESC { + Version: UINT, + Creator: LPCSTR, + Flags: UINT, + ConstantBuffers: UINT, + BoundResources: UINT, + InstructionCount: UINT, + TempRegisterCount: UINT, + TempArrayCount: UINT, + DefCount: UINT, + DclCount: UINT, + TextureNormalInstructions: UINT, + TextureLoadInstructions: UINT, + TextureCompInstructions: UINT, + TextureBiasInstructions: UINT, + TextureGradientInstructions: UINT, + FloatInstructionCount: UINT, + IntInstructionCount: UINT, + UintInstructionCount: UINT, + StaticFlowControlCount: UINT, + DynamicFlowControlCount: UINT, + MacroInstructionCount: UINT, + ArrayInstructionCount: UINT, + MovInstructionCount: UINT, + MovcInstructionCount: UINT, + ConversionInstructionCount: UINT, + BitwiseInstructionCount: UINT, + MinFeatureLevel: D3D_FEATURE_LEVEL, + RequiredFeatureFlags: UINT64, + Name: LPCSTR, + FunctionParameterCount: INT, + HasReturn: BOOL, + Has10Level9VertexShader: BOOL, + Has10Level9PixelShader: BOOL, +}} +STRUCT!{struct D3D11_PARAMETER_DESC { + Name: LPCSTR, + SemanticName: LPCSTR, + Type: D3D_SHADER_VARIABLE_TYPE, + Class: D3D_SHADER_VARIABLE_CLASS, + Rows: UINT, + Columns: UINT, + InterpolationMode: D3D_INTERPOLATION_MODE, + Flags: D3D_PARAMETER_FLAGS, + FirstInRegister: UINT, + FirstInComponent: UINT, + FirstOutRegister: UINT, + FirstOutComponent: UINT, +}} +DEFINE_GUID!{IID_ID3D11ShaderReflectionType, + 0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21} +RIDL!{#[uuid(0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21)] +interface ID3D11ShaderReflectionType(ID3D11ShaderReflectionTypeVtbl) { + fn GetDesc( + pDesc: *mut D3D11_SHADER_TYPE_DESC, + ) -> HRESULT, + fn GetMemberTypeByIndex( + Index: UINT, + ) -> *mut ID3D11ShaderReflectionType, + fn GetMemberTypeByName( + Name: LPCSTR, + ) -> *mut ID3D11ShaderReflectionType, + fn GetMemberTypeName( + Index: UINT, + ) -> LPCSTR, + fn IsEqual( + pType: *mut ID3D11ShaderReflectionType, + ) -> HRESULT, + fn GetSubType() -> *mut ID3D11ShaderReflectionType, + fn GetBaseClass() -> *mut ID3D11ShaderReflectionType, + fn GetNumInterfaces() -> UINT, + fn GetInterfaceByIndex( + uIndex: UINT, + ) -> *mut ID3D11ShaderReflectionType, + fn IsOfType( + pType: *mut ID3D11ShaderReflectionType, + ) -> HRESULT, + fn ImplementsInterface( + pBase: *mut ID3D11ShaderReflectionType, + ) -> HRESULT, +}} +DEFINE_GUID!{IID_ID3D11ShaderReflectionVariable, + 0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c} +RIDL!{#[uuid(0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c)] +interface ID3D11ShaderReflectionVariable(ID3D11ShaderReflectionVariableVtbl) { + fn GetDesc( + pDesc: *mut D3D11_SHADER_VARIABLE_DESC, + ) -> HRESULT, + fn GetType() -> *mut ID3D11ShaderReflectionType, + fn GetBuffer() -> *mut ID3D11ShaderReflectionConstantBuffer, + fn GetInterfaceSlot( + uArrayIndex: UINT, + ) -> UINT, +}} +DEFINE_GUID!{IID_ID3D11ShaderReflectionConstantBuffer, + 0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8} +RIDL!{#[uuid(0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8)] +interface ID3D11ShaderReflectionConstantBuffer(ID3D11ShaderReflectionConstantBufferVtbl) { + fn GetDesc( + pDesc: *mut D3D11_SHADER_BUFFER_DESC, + ) -> HRESULT, + fn GetVariableByIndex( + Index: UINT, + ) -> *mut ID3D11ShaderReflectionVariable, + fn GetVariableByName( + Name: LPCSTR, + ) -> *mut ID3D11ShaderReflectionVariable, +}} +DEFINE_GUID!{IID_ID3D11ShaderReflection, + 0x8d536ca1, 0x0cca, 0x4956, 0xa8, 0x37, 0x78, 0x69, 0x63, 0x75, 0x55, 0x84} +RIDL!{#[uuid(0x8d536ca1, 0x0cca, 0x4956, 0xa8, 0x37, 0x78, 0x69, 0x63, 0x75, 0x55, 0x84)] +interface ID3D11ShaderReflection(ID3D11ShaderReflectionVtbl): IUnknown(IUnknownVtbl) { + fn GetDesc( + pDesc: *mut D3D11_SHADER_DESC, + ) -> HRESULT, + fn GetConstantBufferByIndex( + Index: UINT, + ) -> *mut ID3D11ShaderReflectionConstantBuffer, + fn GetConstantBufferByName( + Name: LPCSTR, + ) -> *mut ID3D11ShaderReflectionConstantBuffer, + fn GetResourceBindingDesc( + ResourceIndex: UINT, + pDesc: *mut D3D11_SHADER_INPUT_BIND_DESC, + ) -> HRESULT, + fn GetInputParameterDesc( + ParameterIndex: UINT, + pDesc: *mut D3D11_SIGNATURE_PARAMETER_DESC, + ) -> HRESULT, + fn GetOutputParameterDesc( + ParameterIndex: UINT, + pDesc: *mut D3D11_SIGNATURE_PARAMETER_DESC, + ) -> HRESULT, + fn GetPatchConstantParameterDesc( + ParameterIndex: UINT, + pDesc: *mut D3D11_SIGNATURE_PARAMETER_DESC, + ) -> HRESULT, + fn GetVariableByName( + Name: LPCSTR, + ) -> *mut ID3D11ShaderReflectionVariable, + fn GetResourceBindingDescByName( + Name: LPCSTR, + pDesc: *mut D3D11_SHADER_INPUT_BIND_DESC, + ) -> HRESULT, + fn GetMovInstructionCount() -> UINT, + fn GetMovcInstructionCount() -> UINT, + fn GetConversionInstructionCount() -> UINT, + fn GetBitwiseInstructionCount() -> UINT, + fn GetGSInputPrimitive() -> D3D_PRIMITIVE, + fn IsSampleFrequencyShader() -> BOOL, + fn GetNumInterfaceSlots() -> UINT, + fn GetMinFeatureLevel( + pLevel: *mut D3D_FEATURE_LEVEL, + ) -> HRESULT, + fn GetThreadGroupSize( + pSizeX: *mut UINT, + pSizeY: *mut UINT, + pSizeZ: *mut UINT, + ) -> UINT, + fn GetRequiresFlags() -> UINT64, +}} +DEFINE_GUID!{IID_ID3D11LibraryReflection, + 0x54384f1b, 0x5b3e, 0x4bb7, 0xae, 0x01, 0x60, 0xba, 0x30, 0x97, 0xcb, 0xb6} +RIDL!{#[uuid(0x54384f1b, 0x5b3e, 0x4bb7, 0xae, 0x01, 0x60, 0xba, 0x30, 0x97, 0xcb, 0xb6)] +interface ID3D11LibraryReflection(ID3D11LibraryReflectionVtbl): IUnknown(IUnknownVtbl) { + fn GetDesc( + pDesc: *mut D3D11_LIBRARY_DESC, + ) -> HRESULT, + fn GetFunctionByIndex( + FunctionIndex: INT, + ) -> *mut ID3D11FunctionReflection, +}} +DEFINE_GUID!{IID_ID3D11FunctionReflection, + 0x207bcecb, 0xd683, 0x4a06, 0xa8, 0xa3, 0x9b, 0x14, 0x9b, 0x9f, 0x73, 0xa4} +RIDL!{#[uuid(0x207bcecb, 0xd683, 0x4a06, 0xa8, 0xa3, 0x9b, 0x14, 0x9b, 0x9f, 0x73, 0xa4)] +interface ID3D11FunctionReflection(ID3D11FunctionReflectionVtbl) { + fn GetDesc( + pDesc: *mut D3D11_FUNCTION_DESC, + ) -> HRESULT, + fn GetConstantBufferByIndex( + BufferIndex: UINT, + ) -> *mut ID3D11ShaderReflectionConstantBuffer, + fn GetConstantBufferByName( + Name: LPCSTR, + ) -> *mut ID3D11ShaderReflectionConstantBuffer, + fn GetResourceBindingDesc( + ResourceIndex: UINT, + pDesc: *mut D3D11_SHADER_INPUT_BIND_DESC, + ) -> HRESULT, + fn GetVariableByName( + Name: LPCSTR, + ) -> *mut ID3D11ShaderReflectionVariable, + fn GetResourceBindingDescByName( + Name: LPCSTR, + pDesc: *mut D3D11_SHADER_INPUT_BIND_DESC, + ) -> HRESULT, + fn GetFunctionParameter( + ParameterIndex: INT, + ) -> *mut ID3D11FunctionParameterReflection, +}} +DEFINE_GUID!{IID_ID3D11FunctionParameterReflection, + 0x42757488, 0x334f, 0x47fe, 0x98, 0x2e, 0x1a, 0x65, 0xd0, 0x8c, 0xc4, 0x62} +RIDL!{#[uuid(0x42757488, 0x334f, 0x47fe, 0x98, 0x2e, 0x1a, 0x65, 0xd0, 0x8c, 0xc4, 0x62)] +interface ID3D11FunctionParameterReflection(ID3D11FunctionParameterReflectionVtbl) { + fn GetDesc( + pDesc: *mut D3D11_PARAMETER_DESC, + ) -> HRESULT, +}} +DEFINE_GUID!{IID_ID3D11Module, + 0xcac701ee, 0x80fc, 0x4122, 0x82, 0x42, 0x10, 0xb3, 0x9c, 0x8c, 0xec, 0x34} +RIDL!{#[uuid(0xcac701ee, 0x80fc, 0x4122, 0x82, 0x42, 0x10, 0xb3, 0x9c, 0x8c, 0xec, 0x34)] +interface ID3D11Module(ID3D11ModuleVtbl): IUnknown(IUnknownVtbl) { + fn CreateInstance( + pNamespace: LPCSTR, + ppModuleInstance: *mut *mut ID3D11ModuleInstance, + ) -> HRESULT, +}} +DEFINE_GUID!{IID_ID3D11ModuleInstance, + 0x469e07f7, 0x045a, 0x48d5, 0xaa, 0x12, 0x68, 0xa4, 0x78, 0xcd, 0xf7, 0x5d} +RIDL!{#[uuid(0x469e07f7, 0x045a, 0x48d5, 0xaa, 0x12, 0x68, 0xa4, 0x78, 0xcd, 0xf7, 0x5d)] +interface ID3D11ModuleInstance(ID3D11ModuleInstanceVtbl): IUnknown(IUnknownVtbl) { + fn BindConstantBuffer( + uSrcSlot: UINT, + uDstSlot: UINT, + cbDstOffset: UINT, + ) -> HRESULT, + fn BindConstantBufferByName( + pName: LPCSTR, + uDstSlot: UINT, + cbDstOffset: UINT, + ) -> HRESULT, + fn BindResource( + uSrcSlot: UINT, + uDstSlot: UINT, + uCount: UINT, + ) -> HRESULT, + fn BindResourceByName( + pName: LPCSTR, + uDstSlot: UINT, + uCount: UINT, + ) -> HRESULT, + fn BindSampler( + uSrcSlot: UINT, + uDstSlot: UINT, + uCount: UINT, + ) -> HRESULT, + fn BindSamplerByName( + pName: LPCSTR, + uDstSlot: UINT, + uCount: UINT, + ) -> HRESULT, + fn BindUnorderedAccessView( + uSrcSlot: UINT, + uDstSlot: UINT, + uCount: UINT, + ) -> HRESULT, + fn BindUnorderedAccessViewByName( + pName: LPCSTR, + uDstSlot: UINT, + uCount: UINT, + ) -> HRESULT, + fn BindResourceAsUnorderedAccessView( + uSrcSrvSlot: UINT, + uDstUavSlot: UINT, + uCount: UINT, + ) -> HRESULT, + fn BindResourceAsUnorderedAccessViewByName( + pSrvName: LPCSTR, + uDstUavSlot: UINT, + uCount: UINT, + ) -> HRESULT, +}} +DEFINE_GUID!{IID_ID3D11Linker, + 0x59a6cd0e, 0xe10d, 0x4c1f, 0x88, 0xc0, 0x63, 0xab, 0xa1, 0xda, 0xf3, 0x0e} +RIDL!{#[uuid(0x59a6cd0e, 0xe10d, 0x4c1f, 0x88, 0xc0, 0x63, 0xab, 0xa1, 0xda, 0xf3, 0x0e)] +interface ID3D11Linker(ID3D11LinkerVtbl): IUnknown(IUnknownVtbl) { + fn Link( + pEntry: *mut ID3D11ModuleInstance, + pEntryName: LPCSTR, + pTargetName: LPCSTR, + uFlags: UINT, + ppShaderBlob: *mut *mut ID3DBlob, + ppErrorBuffer: *mut *mut ID3DBlob, + ) -> HRESULT, + fn UseLibrary( + pLibraryMI: *mut ID3D11ModuleInstance, + ) -> HRESULT, + fn AddClipPlaneFromCBuffer( + uCBufferSlot: UINT, + uCBufferEntry: UINT, + ) -> HRESULT, +}} +DEFINE_GUID!{IID_ID3D11LinkingNode, + 0xd80dd70c, 0x8d2f, 0x4751, 0x94, 0xa1, 0x03, 0xc7, 0x9b, 0x35, 0x56, 0xdb} +RIDL!{#[uuid(0xd80dd70c, 0x8d2f, 0x4751, 0x94, 0xa1, 0x03, 0xc7, 0x9b, 0x35, 0x56, 0xdb)] +interface ID3D11LinkingNode(ID3D11LinkingNodeVtbl): IUnknown(IUnknownVtbl) {}} +DEFINE_GUID!{IID_ID3D11FunctionLinkingGraph, + 0x54133220, 0x1ce8, 0x43d3, 0x82, 0x36, 0x98, 0x55, 0xc5, 0xce, 0xec, 0xff} +RIDL!{#[uuid(0x54133220, 0x1ce8, 0x43d3, 0x82, 0x36, 0x98, 0x55, 0xc5, 0xce, 0xec, 0xff)] +interface ID3D11FunctionLinkingGraph(ID3D11FunctionLinkingGraphVtbl): IUnknown(IUnknownVtbl) { + fn CreateModuleInstance( + ppModuleInstance: *mut *mut ID3D11ModuleInstance, + ppErrorBuffer: *mut *mut ID3DBlob, + ) -> HRESULT, + fn SetInputSignature( + pInputParameters: *const D3D11_PARAMETER_DESC, + cInputParameters: UINT, + ppInputNode: *mut *mut ID3D11LinkingNode, + ) -> HRESULT, + fn SetOutputSignature( + pOutputParameters: *const D3D11_PARAMETER_DESC, + cOutputParameters: UINT, + ppOutputNode: *mut *mut ID3D11LinkingNode, + ) -> HRESULT, + fn CallFunction( + pModuleInstanceNamespace: LPCSTR, + pModuleWithFunctionPrototype: *mut ID3D11Module, + pFunctionName: LPCSTR, + ppCallNode: *mut *mut ID3D11LinkingNode, + ) -> HRESULT, + fn PassValue( + pSrcNode: *mut ID3D11LinkingNode, + SrcParameterIndex: INT, + pDstNode: *mut ID3D11LinkingNode, + DstParameterIndex: INT, + ) -> HRESULT, + fn PassValueWithSwizzle( + pSrcNode: *mut ID3D11LinkingNode, + SrcParameterIndex: INT, + pSrcSwizzle: LPCSTR, + pDstNode: *mut ID3D11LinkingNode, + DstParameterIndex: INT, + pDstSwizzle: LPCSTR, + ) -> HRESULT, + fn GetLastError( + ppErrorBuffer: *mut *mut ID3DBlob, + ) -> HRESULT, + fn GenerateHlsl( + uFlags: UINT, + ppBuffer: *mut *mut ID3DBlob, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/d3d11tokenizedprogramformat.rs b/bash-5.1/vendor/winapi/src/um/d3d11tokenizedprogramformat.rs new file mode 100644 index 0000000000000000000000000000000000000000..54dbde26c323bf11864581a6262ae480b42eb69f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d11tokenizedprogramformat.rs @@ -0,0 +1,1335 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{DWORD, UINT}; +ENUM!{enum D3D10_SB_TOKENIZED_PROGRAM_TYPE { + D3D10_SB_PIXEL_SHADER = 0, + D3D10_SB_VERTEX_SHADER = 1, + D3D10_SB_GEOMETRY_SHADER = 2, + D3D11_SB_HULL_SHADER = 3, + D3D11_SB_DOMAIN_SHADER = 4, + D3D11_SB_COMPUTE_SHADER = 5, + D3D11_SB_RESERVED0 = 0xFFF0, +}} +pub const D3D10_SB_TOKENIZED_PROGRAM_TYPE_MASK: DWORD = 0xffff0000; +pub const D3D10_SB_TOKENIZED_PROGRAM_TYPE_SHIFT: DWORD = 16; +#[inline] +pub fn DECODE_D3D10_SB_TOKENIZED_PROGRAM_TYPE(VerTok: DWORD) -> DWORD { + ((VerTok & D3D10_SB_TOKENIZED_PROGRAM_TYPE_MASK) >> D3D10_SB_TOKENIZED_PROGRAM_TYPE_SHIFT) + as D3D10_SB_TOKENIZED_PROGRAM_TYPE +} +pub const D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_MASK: DWORD = 0x000000f0; +pub const D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_SHIFT: DWORD = 4; +pub const D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION_MASK: DWORD = 0x0000000f; +#[inline] +pub fn DECODE_D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION(VerTok: DWORD) -> DWORD { + (VerTok & D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_MASK) + >> D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_SHIFT +} +#[inline] +pub fn DECODE_D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION(VerTok: DWORD) -> DWORD { + VerTok & D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION_MASK +} +#[inline] +pub fn ENCODE_D3D10_SB_TOKENIZED_PROGRAM_VERSION_TOKEN( + ProgType: DWORD, + MajorVer: DWORD, + MinorVer: DWORD, +) -> DWORD { + ((ProgType << D3D10_SB_TOKENIZED_PROGRAM_TYPE_SHIFT) & D3D10_SB_TOKENIZED_PROGRAM_TYPE_MASK) + | ((MajorVer << D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_SHIFT) + & D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_MASK) + | (MinorVer & D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION_MASK) +} +#[inline] +pub fn DECODE_D3D10_SB_TOKENIZED_PROGRAM_LENGTH(LenTok: DWORD) -> DWORD { + LenTok +} +#[inline] +pub fn ENCODE_D3D10_SB_TOKENIZED_PROGRAM_LENGTH(Length: DWORD) -> DWORD { + Length +} +pub const MAX_D3D10_SB_TOKENIZED_PROGRAM_LENGTH: DWORD = 0xffffffff; +ENUM!{enum D3D10_SB_OPCODE_TYPE { + D3D10_SB_OPCODE_ADD = 0, + D3D10_SB_OPCODE_AND = 1, + D3D10_SB_OPCODE_BREAK = 2, + D3D10_SB_OPCODE_BREAKC = 3, + D3D10_SB_OPCODE_CALL = 4, + D3D10_SB_OPCODE_CALLC = 5, + D3D10_SB_OPCODE_CASE = 6, + D3D10_SB_OPCODE_CONTINUE = 7, + D3D10_SB_OPCODE_CONTINUEC = 8, + D3D10_SB_OPCODE_CUT = 9, + D3D10_SB_OPCODE_DEFAULT = 10, + D3D10_SB_OPCODE_DERIV_RTX = 11, + D3D10_SB_OPCODE_DERIV_RTY = 12, + D3D10_SB_OPCODE_DISCARD = 13, + D3D10_SB_OPCODE_DIV = 14, + D3D10_SB_OPCODE_DP2 = 15, + D3D10_SB_OPCODE_DP3 = 16, + D3D10_SB_OPCODE_DP4 = 17, + D3D10_SB_OPCODE_ELSE = 18, + D3D10_SB_OPCODE_EMIT = 19, + D3D10_SB_OPCODE_EMITTHENCUT = 20, + D3D10_SB_OPCODE_ENDIF = 21, + D3D10_SB_OPCODE_ENDLOOP = 22, + D3D10_SB_OPCODE_ENDSWITCH = 23, + D3D10_SB_OPCODE_EQ = 24, + D3D10_SB_OPCODE_EXP = 25, + D3D10_SB_OPCODE_FRC = 26, + D3D10_SB_OPCODE_FTOI = 27, + D3D10_SB_OPCODE_FTOU = 28, + D3D10_SB_OPCODE_GE = 29, + D3D10_SB_OPCODE_IADD = 30, + D3D10_SB_OPCODE_IF = 31, + D3D10_SB_OPCODE_IEQ = 32, + D3D10_SB_OPCODE_IGE = 33, + D3D10_SB_OPCODE_ILT = 34, + D3D10_SB_OPCODE_IMAD = 35, + D3D10_SB_OPCODE_IMAX = 36, + D3D10_SB_OPCODE_IMIN = 37, + D3D10_SB_OPCODE_IMUL = 38, + D3D10_SB_OPCODE_INE = 39, + D3D10_SB_OPCODE_INEG = 40, + D3D10_SB_OPCODE_ISHL = 41, + D3D10_SB_OPCODE_ISHR = 42, + D3D10_SB_OPCODE_ITOF = 43, + D3D10_SB_OPCODE_LABEL = 44, + D3D10_SB_OPCODE_LD = 45, + D3D10_SB_OPCODE_LD_MS = 46, + D3D10_SB_OPCODE_LOG = 47, + D3D10_SB_OPCODE_LOOP = 48, + D3D10_SB_OPCODE_LT = 49, + D3D10_SB_OPCODE_MAD = 50, + D3D10_SB_OPCODE_MIN = 51, + D3D10_SB_OPCODE_MAX = 52, + D3D10_SB_OPCODE_CUSTOMDATA = 53, + D3D10_SB_OPCODE_MOV = 54, + D3D10_SB_OPCODE_MOVC = 55, + D3D10_SB_OPCODE_MUL = 56, + D3D10_SB_OPCODE_NE = 57, + D3D10_SB_OPCODE_NOP = 58, + D3D10_SB_OPCODE_NOT = 59, + D3D10_SB_OPCODE_OR = 60, + D3D10_SB_OPCODE_RESINFO = 61, + D3D10_SB_OPCODE_RET = 62, + D3D10_SB_OPCODE_RETC = 63, + D3D10_SB_OPCODE_ROUND_NE = 64, + D3D10_SB_OPCODE_ROUND_NI = 65, + D3D10_SB_OPCODE_ROUND_PI = 66, + D3D10_SB_OPCODE_ROUND_Z = 67, + D3D10_SB_OPCODE_RSQ = 68, + D3D10_SB_OPCODE_SAMPLE = 69, + D3D10_SB_OPCODE_SAMPLE_C = 70, + D3D10_SB_OPCODE_SAMPLE_C_LZ = 71, + D3D10_SB_OPCODE_SAMPLE_L = 72, + D3D10_SB_OPCODE_SAMPLE_D = 73, + D3D10_SB_OPCODE_SAMPLE_B = 74, + D3D10_SB_OPCODE_SQRT = 75, + D3D10_SB_OPCODE_SWITCH = 76, + D3D10_SB_OPCODE_SINCOS = 77, + D3D10_SB_OPCODE_UDIV = 78, + D3D10_SB_OPCODE_ULT = 79, + D3D10_SB_OPCODE_UGE = 80, + D3D10_SB_OPCODE_UMUL = 81, + D3D10_SB_OPCODE_UMAD = 82, + D3D10_SB_OPCODE_UMAX = 83, + D3D10_SB_OPCODE_UMIN = 84, + D3D10_SB_OPCODE_USHR = 85, + D3D10_SB_OPCODE_UTOF = 86, + D3D10_SB_OPCODE_XOR = 87, + D3D10_SB_OPCODE_DCL_RESOURCE = 88, + D3D10_SB_OPCODE_DCL_CONSTANT_BUFFER = 89, + D3D10_SB_OPCODE_DCL_SAMPLER = 90, + D3D10_SB_OPCODE_DCL_INDEX_RANGE = 91, + D3D10_SB_OPCODE_DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY = 92, + D3D10_SB_OPCODE_DCL_GS_INPUT_PRIMITIVE = 93, + D3D10_SB_OPCODE_DCL_MAX_OUTPUT_VERTEX_COUNT = 94, + D3D10_SB_OPCODE_DCL_INPUT = 95, + D3D10_SB_OPCODE_DCL_INPUT_SGV = 96, + D3D10_SB_OPCODE_DCL_INPUT_SIV = 97, + D3D10_SB_OPCODE_DCL_INPUT_PS = 98, + D3D10_SB_OPCODE_DCL_INPUT_PS_SGV = 99, + D3D10_SB_OPCODE_DCL_INPUT_PS_SIV = 100, + D3D10_SB_OPCODE_DCL_OUTPUT = 101, + D3D10_SB_OPCODE_DCL_OUTPUT_SGV = 102, + D3D10_SB_OPCODE_DCL_OUTPUT_SIV = 103, + D3D10_SB_OPCODE_DCL_TEMPS = 104, + D3D10_SB_OPCODE_DCL_INDEXABLE_TEMP = 105, + D3D10_SB_OPCODE_DCL_GLOBAL_FLAGS = 106, + D3D10_SB_OPCODE_RESERVED0 = 107, + D3D10_1_SB_OPCODE_LOD = 108, + D3D10_1_SB_OPCODE_GATHER4 = 109, + D3D10_1_SB_OPCODE_SAMPLE_POS = 110, + D3D10_1_SB_OPCODE_SAMPLE_INFO = 111, + D3D10_1_SB_OPCODE_RESERVED1 = 112, + D3D11_SB_OPCODE_HS_DECLS = 113, + D3D11_SB_OPCODE_HS_CONTROL_POINT_PHASE = 114, + D3D11_SB_OPCODE_HS_FORK_PHASE = 115, + D3D11_SB_OPCODE_HS_JOIN_PHASE = 116, + D3D11_SB_OPCODE_EMIT_STREAM = 117, + D3D11_SB_OPCODE_CUT_STREAM = 118, + D3D11_SB_OPCODE_EMITTHENCUT_STREAM = 119, + D3D11_SB_OPCODE_INTERFACE_CALL = 120, + D3D11_SB_OPCODE_BUFINFO = 121, + D3D11_SB_OPCODE_DERIV_RTX_COARSE = 122, + D3D11_SB_OPCODE_DERIV_RTX_FINE = 123, + D3D11_SB_OPCODE_DERIV_RTY_COARSE = 124, + D3D11_SB_OPCODE_DERIV_RTY_FINE = 125, + D3D11_SB_OPCODE_GATHER4_C = 126, + D3D11_SB_OPCODE_GATHER4_PO = 127, + D3D11_SB_OPCODE_GATHER4_PO_C = 128, + D3D11_SB_OPCODE_RCP = 129, + D3D11_SB_OPCODE_F32TOF16 = 130, + D3D11_SB_OPCODE_F16TOF32 = 131, + D3D11_SB_OPCODE_UADDC = 132, + D3D11_SB_OPCODE_USUBB = 133, + D3D11_SB_OPCODE_COUNTBITS = 134, + D3D11_SB_OPCODE_FIRSTBIT_HI = 135, + D3D11_SB_OPCODE_FIRSTBIT_LO = 136, + D3D11_SB_OPCODE_FIRSTBIT_SHI = 137, + D3D11_SB_OPCODE_UBFE = 138, + D3D11_SB_OPCODE_IBFE = 139, + D3D11_SB_OPCODE_BFI = 140, + D3D11_SB_OPCODE_BFREV = 141, + D3D11_SB_OPCODE_SWAPC = 142, + D3D11_SB_OPCODE_DCL_STREAM = 143, + D3D11_SB_OPCODE_DCL_FUNCTION_BODY = 144, + D3D11_SB_OPCODE_DCL_FUNCTION_TABLE = 145, + D3D11_SB_OPCODE_DCL_INTERFACE = 146, + D3D11_SB_OPCODE_DCL_INPUT_CONTROL_POINT_COUNT = 147, + D3D11_SB_OPCODE_DCL_OUTPUT_CONTROL_POINT_COUNT = 148, + D3D11_SB_OPCODE_DCL_TESS_DOMAIN = 149, + D3D11_SB_OPCODE_DCL_TESS_PARTITIONING = 150, + D3D11_SB_OPCODE_DCL_TESS_OUTPUT_PRIMITIVE = 151, + D3D11_SB_OPCODE_DCL_HS_MAX_TESSFACTOR = 152, + D3D11_SB_OPCODE_DCL_HS_FORK_PHASE_INSTANCE_COUNT = 153, + D3D11_SB_OPCODE_DCL_HS_JOIN_PHASE_INSTANCE_COUNT = 154, + D3D11_SB_OPCODE_DCL_THREAD_GROUP = 155, + D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_TYPED = 156, + D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_RAW = 157, + D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_STRUCTURED = 158, + D3D11_SB_OPCODE_DCL_THREAD_GROUP_SHARED_MEMORY_RAW = 159, + D3D11_SB_OPCODE_DCL_THREAD_GROUP_SHARED_MEMORY_STRUCTURED = 160, + D3D11_SB_OPCODE_DCL_RESOURCE_RAW = 161, + D3D11_SB_OPCODE_DCL_RESOURCE_STRUCTURED = 162, + D3D11_SB_OPCODE_LD_UAV_TYPED = 163, + D3D11_SB_OPCODE_STORE_UAV_TYPED = 164, + D3D11_SB_OPCODE_LD_RAW = 165, + D3D11_SB_OPCODE_STORE_RAW = 166, + D3D11_SB_OPCODE_LD_STRUCTURED = 167, + D3D11_SB_OPCODE_STORE_STRUCTURED = 168, + D3D11_SB_OPCODE_ATOMIC_AND = 169, + D3D11_SB_OPCODE_ATOMIC_OR = 170, + D3D11_SB_OPCODE_ATOMIC_XOR = 171, + D3D11_SB_OPCODE_ATOMIC_CMP_STORE = 172, + D3D11_SB_OPCODE_ATOMIC_IADD = 173, + D3D11_SB_OPCODE_ATOMIC_IMAX = 174, + D3D11_SB_OPCODE_ATOMIC_IMIN = 175, + D3D11_SB_OPCODE_ATOMIC_UMAX = 176, + D3D11_SB_OPCODE_ATOMIC_UMIN = 177, + D3D11_SB_OPCODE_IMM_ATOMIC_ALLOC = 178, + D3D11_SB_OPCODE_IMM_ATOMIC_CONSUME = 179, + D3D11_SB_OPCODE_IMM_ATOMIC_IADD = 180, + D3D11_SB_OPCODE_IMM_ATOMIC_AND = 181, + D3D11_SB_OPCODE_IMM_ATOMIC_OR = 182, + D3D11_SB_OPCODE_IMM_ATOMIC_XOR = 183, + D3D11_SB_OPCODE_IMM_ATOMIC_EXCH = 184, + D3D11_SB_OPCODE_IMM_ATOMIC_CMP_EXCH = 185, + D3D11_SB_OPCODE_IMM_ATOMIC_IMAX = 186, + D3D11_SB_OPCODE_IMM_ATOMIC_IMIN = 187, + D3D11_SB_OPCODE_IMM_ATOMIC_UMAX = 188, + D3D11_SB_OPCODE_IMM_ATOMIC_UMIN = 189, + D3D11_SB_OPCODE_SYNC = 190, + D3D11_SB_OPCODE_DADD = 191, + D3D11_SB_OPCODE_DMAX = 192, + D3D11_SB_OPCODE_DMIN = 193, + D3D11_SB_OPCODE_DMUL = 194, + D3D11_SB_OPCODE_DEQ = 195, + D3D11_SB_OPCODE_DGE = 196, + D3D11_SB_OPCODE_DLT = 197, + D3D11_SB_OPCODE_DNE = 198, + D3D11_SB_OPCODE_DMOV = 199, + D3D11_SB_OPCODE_DMOVC = 200, + D3D11_SB_OPCODE_DTOF = 201, + D3D11_SB_OPCODE_FTOD = 202, + D3D11_SB_OPCODE_EVAL_SNAPPED = 203, + D3D11_SB_OPCODE_EVAL_SAMPLE_INDEX = 204, + D3D11_SB_OPCODE_EVAL_CENTROID = 205, + D3D11_SB_OPCODE_DCL_GS_INSTANCE_COUNT = 206, + D3D11_SB_OPCODE_ABORT = 207, + D3D11_SB_OPCODE_DEBUG_BREAK = 208, + D3D11_SB_OPCODE_RESERVED0 = 209, + D3D11_1_SB_OPCODE_DDIV = 210, + D3D11_1_SB_OPCODE_DFMA = 211, + D3D11_1_SB_OPCODE_DRCP = 212, + D3D11_1_SB_OPCODE_MSAD = 213, + D3D11_1_SB_OPCODE_DTOI = 214, + D3D11_1_SB_OPCODE_DTOU = 215, + D3D11_1_SB_OPCODE_ITOD = 216, + D3D11_1_SB_OPCODE_UTOD = 217, + D3D11_1_SB_OPCODE_RESERVED0 = 218, + D3DWDDM1_3_SB_OPCODE_GATHER4_FEEDBACK = 219, + D3DWDDM1_3_SB_OPCODE_GATHER4_C_FEEDBACK = 220, + D3DWDDM1_3_SB_OPCODE_GATHER4_PO_FEEDBACK = 221, + D3DWDDM1_3_SB_OPCODE_GATHER4_PO_C_FEEDBACK = 222, + D3DWDDM1_3_SB_OPCODE_LD_FEEDBACK = 223, + D3DWDDM1_3_SB_OPCODE_LD_MS_FEEDBACK = 224, + D3DWDDM1_3_SB_OPCODE_LD_UAV_TYPED_FEEDBACK = 225, + D3DWDDM1_3_SB_OPCODE_LD_RAW_FEEDBACK = 226, + D3DWDDM1_3_SB_OPCODE_LD_STRUCTURED_FEEDBACK = 227, + D3DWDDM1_3_SB_OPCODE_SAMPLE_L_FEEDBACK = 228, + D3DWDDM1_3_SB_OPCODE_SAMPLE_C_LZ_FEEDBACK = 229, + D3DWDDM1_3_SB_OPCODE_SAMPLE_CLAMP_FEEDBACK = 230, + D3DWDDM1_3_SB_OPCODE_SAMPLE_B_CLAMP_FEEDBACK = 231, + D3DWDDM1_3_SB_OPCODE_SAMPLE_D_CLAMP_FEEDBACK = 232, + D3DWDDM1_3_SB_OPCODE_SAMPLE_C_CLAMP_FEEDBACK = 233, + D3DWDDM1_3_SB_OPCODE_CHECK_ACCESS_FULLY_MAPPED = 234, + D3DWDDM1_3_SB_OPCODE_RESERVED0 = 235, + D3D10_SB_NUM_OPCODES = 236, +}} +pub const D3D10_SB_OPCODE_TYPE_MASK: DWORD = 0x00007ff; +#[inline] +pub fn DECODE_D3D10_SB_OPCODE_TYPE(OpcodeToken0: DWORD) -> D3D10_SB_OPCODE_TYPE { + (OpcodeToken0 & D3D10_SB_OPCODE_TYPE_MASK) as D3D10_SB_OPCODE_TYPE +} +#[inline] +pub fn ENCODE_D3D10_SB_OPCODE_TYPE(OpcodeName: D3D10_SB_OPCODE_TYPE) -> DWORD { + OpcodeName & D3D10_SB_OPCODE_TYPE_MASK +} +pub const D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_MASK: DWORD = 0x7f000000; +pub const D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_SHIFT: DWORD = 24; +#[inline] +pub fn DECODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(OpcodeToken0: DWORD) -> DWORD { + (OpcodeToken0 & D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_MASK) + >> D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_SHIFT +} +#[inline] +pub fn ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(Length: DWORD) -> DWORD { + (Length << D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_SHIFT) + & D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_MASK +} +pub const MAX_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH: DWORD = 127; +pub const D3D10_SB_INSTRUCTION_SATURATE_MASK: DWORD = 0x00002000; +#[inline] +pub fn DECODE_IS_D3D10_SB_INSTRUCTION_SATURATE_ENABLED(OpcodeToken0: DWORD) -> DWORD { + OpcodeToken0 & D3D10_SB_INSTRUCTION_SATURATE_MASK +} +#[inline] +pub fn ENCODE_D3D10_SB_INSTRUCTION_SATURATE(bSat: DWORD) -> DWORD { + if bSat != 0 { + D3D10_SB_INSTRUCTION_SATURATE_MASK + } else { + 0 + } +} +ENUM!{enum D3D10_SB_INSTRUCTION_TEST_BOOLEAN { + D3D10_SB_INSTRUCTION_TEST_ZERO = 0, + D3D10_SB_INSTRUCTION_TEST_NONZERO = 1, +}} +pub const D3D10_SB_INSTRUCTION_TEST_BOOLEAN_MASK: DWORD = 0x00040000; +pub const D3D10_SB_INSTRUCTION_TEST_BOOLEAN_SHIFT: DWORD = 18; +#[inline] +pub fn DECODE_D3D10_SB_INSTRUCTION_TEST_BOOLEAN( + OpcodeToken0: DWORD, +) -> D3D10_SB_INSTRUCTION_TEST_BOOLEAN { + ((OpcodeToken0 & D3D10_SB_INSTRUCTION_TEST_BOOLEAN_MASK) + >> D3D10_SB_INSTRUCTION_TEST_BOOLEAN_SHIFT) as D3D10_SB_INSTRUCTION_TEST_BOOLEAN +} +#[inline] +pub fn ENCODE_D3D10_SB_INSTRUCTION_TEST_BOOLEAN( + Boolean: D3D10_SB_INSTRUCTION_TEST_BOOLEAN, +) -> DWORD { + (Boolean << D3D10_SB_INSTRUCTION_TEST_BOOLEAN_SHIFT) & D3D10_SB_INSTRUCTION_TEST_BOOLEAN_MASK +} +pub const D3D11_SB_INSTRUCTION_PRECISE_VALUES_MASK: DWORD = 0x00780000; +pub const D3D11_SB_INSTRUCTION_PRECISE_VALUES_SHIFT: DWORD = 19; +#[inline] +pub fn DECODE_D3D11_SB_INSTRUCTION_PRECISE_VALUES(OpcodeToken0: DWORD) -> DWORD { + (OpcodeToken0 & D3D11_SB_INSTRUCTION_PRECISE_VALUES_MASK) + >> D3D11_SB_INSTRUCTION_PRECISE_VALUES_SHIFT +} +#[inline] +pub fn ENCODE_D3D11_SB_INSTRUCTION_PRECISE_VALUES(ComponentMask: DWORD) -> DWORD { + (ComponentMask << D3D11_SB_INSTRUCTION_PRECISE_VALUES_SHIFT) + & D3D11_SB_INSTRUCTION_PRECISE_VALUES_MASK +} +ENUM!{enum D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE { + D3D10_SB_RESINFO_INSTRUCTION_RETURN_FLOAT = 0, + D3D10_SB_RESINFO_INSTRUCTION_RETURN_RCPFLOAT = 1, + D3D10_SB_RESINFO_INSTRUCTION_RETURN_UINT = 2, +}} +pub const D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_MASK: DWORD = 0x00001800; +pub const D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE( + OpcodeToken0: DWORD, +) -> D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE { + ((OpcodeToken0 & D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_MASK) + >> D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_SHIFT) + as D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE +} +#[inline] +pub fn ENCODE_D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE( + ReturnType: D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE, +) -> DWORD { + (ReturnType << D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_SHIFT) + & D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_MASK +} +pub const D3D11_SB_SYNC_THREADS_IN_GROUP: DWORD = 0x00000800; +pub const D3D11_SB_SYNC_THREAD_GROUP_SHARED_MEMORY: DWORD = 0x00001000; +pub const D3D11_SB_SYNC_UNORDERED_ACCESS_VIEW_MEMORY_GROUP: DWORD = 0x00002000; +pub const D3D11_SB_SYNC_UNORDERED_ACCESS_VIEW_MEMORY_GLOBAL: DWORD = 0x00004000; +pub const D3D11_SB_SYNC_FLAGS_MASK: DWORD = 0x00007800; +#[inline] +pub fn DECODE_D3D11_SB_SYNC_FLAGS(OperandToken0: DWORD) -> DWORD { + OperandToken0 & D3D11_SB_SYNC_FLAGS_MASK +} +#[inline] +pub fn ENCODE_D3D11_SB_SYNC_FLAGS(Flags: DWORD) -> DWORD { + Flags & D3D11_SB_SYNC_FLAGS_MASK +} +pub const D3D10_SB_OPCODE_EXTENDED_MASK: DWORD = 0x80000000; +pub const D3D10_SB_OPCODE_EXTENDED_SHIFT: DWORD = 31; +#[inline] +pub fn DECODE_IS_D3D10_SB_OPCODE_EXTENDED(OpcodeToken0: DWORD) -> DWORD { + (OpcodeToken0 & D3D10_SB_OPCODE_EXTENDED_MASK) >> D3D10_SB_OPCODE_EXTENDED_SHIFT +} +#[inline] +pub fn ENCODE_D3D10_SB_OPCODE_EXTENDED(bExtended: DWORD) -> DWORD { + if bExtended != 0 { + D3D10_SB_OPCODE_EXTENDED_MASK + } else { + 0 + } +} +ENUM!{enum D3D10_SB_EXTENDED_OPCODE_TYPE { + D3D10_SB_EXTENDED_OPCODE_EMPTY = 0, + D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS = 1, + D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM = 2, + D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE = 3, +}} +pub const D3D11_SB_MAX_SIMULTANEOUS_EXTENDED_OPCODES: DWORD = 3; +pub const D3D10_SB_EXTENDED_OPCODE_TYPE_MASK: DWORD = 0x0000003f; +#[inline] +pub fn DECODE_D3D10_SB_EXTENDED_OPCODE_TYPE(OpcodeToken1: DWORD) -> D3D10_SB_EXTENDED_OPCODE_TYPE { + (OpcodeToken1 & D3D10_SB_EXTENDED_OPCODE_TYPE_MASK) as D3D10_SB_EXTENDED_OPCODE_TYPE +} +#[inline] +pub fn ENCODE_D3D10_SB_EXTENDED_OPCODE_TYPE( + ExtOpcodeType: D3D10_SB_EXTENDED_OPCODE_TYPE, +) -> DWORD { + ExtOpcodeType & D3D10_SB_EXTENDED_OPCODE_TYPE_MASK +} +ENUM!{enum D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD { + D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_U = 0, + D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_V = 1, + D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_W = 2, +}} +pub const D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD_MASK: DWORD = 3; +#[inline] +pub fn D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord: DWORD) -> DWORD { + 9 + 4 * (Coord & D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD_MASK) +} +#[inline] +pub fn D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_MASK(Coord: DWORD) -> DWORD { + 0x0000000f << D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord) +} +#[inline] +pub fn DECODE_IMMEDIATE_D3D10_SB_ADDRESS_OFFSET( + Coord: DWORD, + OpcodeToken1: DWORD, +) -> DWORD { + (OpcodeToken1 & D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_MASK(Coord)) + >> D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord) +} +#[inline] +pub fn ENCODE_IMMEDIATE_D3D10_SB_ADDRESS_OFFSET( + Coord: DWORD, + ImmediateOffset: DWORD, +) -> DWORD { + (ImmediateOffset << D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord)) + & D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_MASK(Coord) +} +pub const D3D11_SB_EXTENDED_RESOURCE_DIMENSION_MASK: DWORD = 0x000007C0; +pub const D3D11_SB_EXTENDED_RESOURCE_DIMENSION_SHIFT: DWORD = 6; +#[inline] +pub fn DECODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION( + OpcodeTokenN: DWORD, +) -> D3D10_SB_RESOURCE_DIMENSION { + ((OpcodeTokenN & D3D11_SB_EXTENDED_RESOURCE_DIMENSION_MASK) + >> D3D11_SB_EXTENDED_RESOURCE_DIMENSION_SHIFT) as D3D10_SB_RESOURCE_DIMENSION +} +#[inline] +pub fn ENCODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION( + ResourceDim: D3D10_SB_RESOURCE_DIMENSION, +) -> DWORD { + (ResourceDim << D3D11_SB_EXTENDED_RESOURCE_DIMENSION_SHIFT) + & D3D11_SB_EXTENDED_RESOURCE_DIMENSION_MASK +} +pub const D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_MASK: DWORD = 0x007FF800; +pub const D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE(OpcodeTokenN: DWORD) -> DWORD { + (OpcodeTokenN & D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_MASK) + >> D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_SHIFT +} +#[inline] +pub fn ENCODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE(Stride: DWORD) -> DWORD { + (Stride << D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_SHIFT) + & D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_MASK +} +pub const D3D10_SB_RESOURCE_RETURN_TYPE_MASK: DWORD = 0x0000000f; +pub const D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS: DWORD = 0x00000004; +pub const D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE_SHIFT: DWORD = 6; +#[inline] +pub fn DECODE_D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE( + OpcodeTokenN: DWORD, + Component: DWORD, +) -> DWORD { + ((OpcodeTokenN >> (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS + + D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE_SHIFT)) + & D3D10_SB_RESOURCE_RETURN_TYPE_MASK) as D3D10_SB_RESOURCE_RETURN_TYPE +} +#[inline] +pub fn ENCODE_D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE( + ReturnType: DWORD, + Component: DWORD, +) -> DWORD { + (ReturnType & D3D10_SB_RESOURCE_RETURN_TYPE_MASK) + << (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS + + D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE_SHIFT) +} +ENUM!{enum D3D10_SB_CUSTOMDATA_CLASS { + D3D10_SB_CUSTOMDATA_COMMENT = 0, + D3D10_SB_CUSTOMDATA_DEBUGINFO = 1, + D3D10_SB_CUSTOMDATA_OPAQUE = 2, + D3D10_SB_CUSTOMDATA_DCL_IMMEDIATE_CONSTANT_BUFFER = 3, + D3D11_SB_CUSTOMDATA_SHADER_MESSAGE = 4, + D3D11_SB_CUSTOMDATA_SHADER_CLIP_PLANE_CONSTANT_MAPPINGS_FOR_DX9 = 5, +}} +pub const D3D10_SB_CUSTOMDATA_CLASS_MASK: DWORD = 0xfffff800; +pub const D3D10_SB_CUSTOMDATA_CLASS_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D10_SB_CUSTOMDATA_CLASS(CustomDataDescTok: DWORD) -> D3D10_SB_CUSTOMDATA_CLASS { + ((CustomDataDescTok & D3D10_SB_CUSTOMDATA_CLASS_MASK) >> D3D10_SB_CUSTOMDATA_CLASS_SHIFT) + as D3D10_SB_CUSTOMDATA_CLASS +} +#[inline] +pub fn ENCODE_D3D10_SB_CUSTOMDATA_CLASS(CustomDataClass: D3D10_SB_CUSTOMDATA_CLASS) -> DWORD { + ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_CUSTOMDATA) + | ((CustomDataClass << D3D10_SB_CUSTOMDATA_CLASS_SHIFT) & D3D10_SB_CUSTOMDATA_CLASS_MASK) +} +ENUM!{enum D3D10_SB_OPERAND_NUM_COMPONENTS { + D3D10_SB_OPERAND_0_COMPONENT = 0, + D3D10_SB_OPERAND_1_COMPONENT = 1, + D3D10_SB_OPERAND_4_COMPONENT = 2, + D3D10_SB_OPERAND_N_COMPONENT = 3, +}} +pub const D3D10_SB_OPERAND_NUM_COMPONENTS_MASK: DWORD = 0x00000003; +#[inline] +pub fn DECODE_D3D10_SB_OPERAND_NUM_COMPONENTS(OperandToken0: DWORD) -> DWORD { + (OperandToken0 & D3D10_SB_OPERAND_NUM_COMPONENTS_MASK) as D3D10_SB_OPERAND_NUM_COMPONENTS +} +#[inline] +pub fn ENCODE_D3D10_SB_OPERAND_NUM_COMPONENTS(NumComp: DWORD) -> DWORD { + NumComp & D3D10_SB_OPERAND_NUM_COMPONENTS_MASK +} +ENUM!{enum D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE { + D3D10_SB_OPERAND_4_COMPONENT_MASK_MODE = 0, + D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MODE = 1, + D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MODE = 2, +}} +pub const D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_MASK: DWORD = 0x0000000c; +pub const D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_SHIFT: DWORD = 2; +#[inline] +pub fn DECODE_D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE( + OperandToken0: DWORD, +) -> D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE { + ((OperandToken0 & D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_MASK) + >> D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_SHIFT) + as D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE +} +#[inline] +pub fn ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE( + SelectionMode: D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE, +) -> DWORD { + (SelectionMode << D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_SHIFT) + & D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_MASK +} +ENUM!{enum D3D10_SB_4_COMPONENT_NAME { + D3D10_SB_4_COMPONENT_X = 0, + D3D10_SB_4_COMPONENT_Y = 1, + D3D10_SB_4_COMPONENT_Z = 2, + D3D10_SB_4_COMPONENT_W = 3, + D3D10_SB_4_COMPONENT_R = 0, + D3D10_SB_4_COMPONENT_G = 1, + D3D10_SB_4_COMPONENT_B = 2, + D3D10_SB_4_COMPONENT_A = 3, +}} +pub const D3D10_SB_4_COMPONENT_NAME_MASK: DWORD = 3; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_MASK: DWORD = 0x000000f0; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_SHIFT: DWORD = 4; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_X: DWORD = 0x00000010; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_Y: DWORD = 0x00000020; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_Z: DWORD = 0x00000040; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_W: DWORD = 0x00000080; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_R: DWORD = D3D10_SB_OPERAND_4_COMPONENT_MASK_X; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_G: DWORD = D3D10_SB_OPERAND_4_COMPONENT_MASK_Y; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_B: DWORD = D3D10_SB_OPERAND_4_COMPONENT_MASK_Z; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_A: DWORD = D3D10_SB_OPERAND_4_COMPONENT_MASK_W; +pub const D3D10_SB_OPERAND_4_COMPONENT_MASK_ALL: DWORD = D3D10_SB_OPERAND_4_COMPONENT_MASK_MASK; +#[inline] +pub fn DECODE_D3D10_SB_OPERAND_4_COMPONENT_MASK(OperandToken0: DWORD) -> DWORD { + OperandToken0 & D3D10_SB_OPERAND_4_COMPONENT_MASK_MASK +} +#[inline] +pub fn ENCODE_D3D10_SB_OPERAND_4_COMPONENT_MASK(ComponentMask: DWORD) -> DWORD { + ComponentMask & D3D10_SB_OPERAND_4_COMPONENT_MASK_MASK +} +#[inline] +pub fn D3D10_SB_OPERAND_4_COMPONENT_MASK(ComponentName: DWORD) -> DWORD { + (1 << (D3D10_SB_OPERAND_4_COMPONENT_MASK_SHIFT + ComponentName)) + & D3D10_SB_OPERAND_4_COMPONENT_MASK_MASK +} +pub const D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MASK: DWORD = 0x00000ff0; +pub const D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_SHIFT: DWORD = 4; +#[inline] +pub fn DECODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE(OperandToken0: DWORD) -> DWORD { + OperandToken0 & D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MASK +} +#[inline] +pub fn DECODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_SOURCE( + OperandToken0: DWORD, + DestComp: DWORD, +) -> D3D10_SB_4_COMPONENT_NAME { + ((OperandToken0 >> (D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_SHIFT + 2 + * (DestComp & D3D10_SB_4_COMPONENT_NAME_MASK))) + & D3D10_SB_4_COMPONENT_NAME_MASK) as D3D10_SB_4_COMPONENT_NAME +} +#[inline] +pub fn ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE( + XSrc: DWORD, + YSrc: DWORD, + ZSrc: DWORD, + WSrc: DWORD, +) -> DWORD { + ((XSrc & D3D10_SB_4_COMPONENT_NAME_MASK) + | ((YSrc & D3D10_SB_4_COMPONENT_NAME_MASK) << 2) + | ((ZSrc & D3D10_SB_4_COMPONENT_NAME_MASK) << 4) + | ((WSrc & D3D10_SB_4_COMPONENT_NAME_MASK) << 6)) + << D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_SHIFT +} +#[inline] +pub fn D3D10_SB_OPERAND_4_COMPONENT_NOSWIZZLE() -> DWORD { + ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE( + D3D10_SB_4_COMPONENT_X, + D3D10_SB_4_COMPONENT_Y, + D3D10_SB_4_COMPONENT_Z, + D3D10_SB_4_COMPONENT_W, + ) +} +#[inline] +pub fn D3D10_SB_OPERAND_4_COMPONENT_REPLICATEX() -> DWORD { + ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE( + D3D10_SB_4_COMPONENT_X, + D3D10_SB_4_COMPONENT_X, + D3D10_SB_4_COMPONENT_X, + D3D10_SB_4_COMPONENT_X, + ) +} +#[inline] +pub fn D3D10_SB_OPERAND_4_COMPONENT_REPLICATEY() -> DWORD { + ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE( + D3D10_SB_4_COMPONENT_Y, + D3D10_SB_4_COMPONENT_Y, + D3D10_SB_4_COMPONENT_Y, + D3D10_SB_4_COMPONENT_Y, + ) +} +#[inline] +pub fn D3D10_SB_OPERAND_4_COMPONENT_REPLICATEZ() -> DWORD { + ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE( + D3D10_SB_4_COMPONENT_Z, + D3D10_SB_4_COMPONENT_Z, + D3D10_SB_4_COMPONENT_Z, + D3D10_SB_4_COMPONENT_Z, + ) +} +#[inline] +pub fn D3D10_SB_OPERAND_4_COMPONENT_REPLICATEW() -> DWORD { + ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE( + D3D10_SB_4_COMPONENT_W, + D3D10_SB_4_COMPONENT_W, + D3D10_SB_4_COMPONENT_W, + D3D10_SB_4_COMPONENT_W, + ) +} +#[inline] +pub fn D3D10_SB_OPERAND_4_COMPONENT_REPLICATERED() -> DWORD { + D3D10_SB_OPERAND_4_COMPONENT_REPLICATEX() +} +#[inline] +pub fn D3D10_SB_OPERAND_4_COMPONENT_REPLICATEGREEN() -> DWORD { + D3D10_SB_OPERAND_4_COMPONENT_REPLICATEY() +} +#[inline] +pub fn D3D10_SB_OPERAND_4_COMPONENT_REPLICATEBLUE() -> DWORD { + D3D10_SB_OPERAND_4_COMPONENT_REPLICATEZ() +} +#[inline] +pub fn D3D10_SB_OPERAND_4_COMPONENT_REPLICATEALPHA() -> DWORD { + D3D10_SB_OPERAND_4_COMPONENT_REPLICATEW() +} +pub const D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MASK: DWORD = 0x00000030; +pub const D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_SHIFT: DWORD = 4; +#[inline] +pub fn DECODE_D3D10_SB_OPERAND_4_COMPONENT_SELECT_1( + OperandToken0: DWORD, +) -> D3D10_SB_4_COMPONENT_NAME { + ((OperandToken0 & D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MASK) + >> D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_SHIFT) as D3D10_SB_4_COMPONENT_NAME +} +#[inline] +pub fn ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SELECT_1( + SelectedComp: D3D10_SB_4_COMPONENT_NAME, +) -> DWORD { + (SelectedComp << D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_SHIFT) + & D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MASK +} +ENUM!{enum D3D10_SB_OPERAND_TYPE { + D3D10_SB_OPERAND_TYPE_TEMP = 0, + D3D10_SB_OPERAND_TYPE_INPUT = 1, + D3D10_SB_OPERAND_TYPE_OUTPUT = 2, + D3D10_SB_OPERAND_TYPE_INDEXABLE_TEMP = 3, + D3D10_SB_OPERAND_TYPE_IMMEDIATE32 = 4, + D3D10_SB_OPERAND_TYPE_IMMEDIATE64 = 5, + D3D10_SB_OPERAND_TYPE_SAMPLER = 6, + D3D10_SB_OPERAND_TYPE_RESOURCE = 7, + D3D10_SB_OPERAND_TYPE_CONSTANT_BUFFER= 8, + D3D10_SB_OPERAND_TYPE_IMMEDIATE_CONSTANT_BUFFER= 9, + D3D10_SB_OPERAND_TYPE_LABEL = 10, + D3D10_SB_OPERAND_TYPE_INPUT_PRIMITIVEID = 11, + D3D10_SB_OPERAND_TYPE_OUTPUT_DEPTH = 12, + D3D10_SB_OPERAND_TYPE_NULL = 13, + D3D10_SB_OPERAND_TYPE_RASTERIZER = 14, + D3D10_SB_OPERAND_TYPE_OUTPUT_COVERAGE_MASK = 15, + D3D11_SB_OPERAND_TYPE_STREAM = 16, + D3D11_SB_OPERAND_TYPE_FUNCTION_BODY = 17, + D3D11_SB_OPERAND_TYPE_FUNCTION_TABLE = 18, + D3D11_SB_OPERAND_TYPE_INTERFACE = 19, + D3D11_SB_OPERAND_TYPE_FUNCTION_INPUT = 20, + D3D11_SB_OPERAND_TYPE_FUNCTION_OUTPUT = 21, + D3D11_SB_OPERAND_TYPE_OUTPUT_CONTROL_POINT_ID = 22, + D3D11_SB_OPERAND_TYPE_INPUT_FORK_INSTANCE_ID = 23, + D3D11_SB_OPERAND_TYPE_INPUT_JOIN_INSTANCE_ID = 24, + D3D11_SB_OPERAND_TYPE_INPUT_CONTROL_POINT = 25, + D3D11_SB_OPERAND_TYPE_OUTPUT_CONTROL_POINT = 26, + D3D11_SB_OPERAND_TYPE_INPUT_PATCH_CONSTANT = 27, + D3D11_SB_OPERAND_TYPE_INPUT_DOMAIN_POINT = 28, + D3D11_SB_OPERAND_TYPE_THIS_POINTER = 29, + D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW = 30, + D3D11_SB_OPERAND_TYPE_THREAD_GROUP_SHARED_MEMORY = 31, + D3D11_SB_OPERAND_TYPE_INPUT_THREAD_ID = 32, + D3D11_SB_OPERAND_TYPE_INPUT_THREAD_GROUP_ID = 33, + D3D11_SB_OPERAND_TYPE_INPUT_THREAD_ID_IN_GROUP = 34, + D3D11_SB_OPERAND_TYPE_INPUT_COVERAGE_MASK = 35, + D3D11_SB_OPERAND_TYPE_INPUT_THREAD_ID_IN_GROUP_FLATTENED = 36, + D3D11_SB_OPERAND_TYPE_INPUT_GS_INSTANCE_ID = 37, + D3D11_SB_OPERAND_TYPE_OUTPUT_DEPTH_GREATER_EQUAL = 38, + D3D11_SB_OPERAND_TYPE_OUTPUT_DEPTH_LESS_EQUAL = 39, + D3D11_SB_OPERAND_TYPE_CYCLE_COUNTER = 40, +}} +pub const D3D10_SB_OPERAND_TYPE_MASK: DWORD = 0x000ff000; +pub const D3D10_SB_OPERAND_TYPE_SHIFT: DWORD = 12; +#[inline] +pub fn DECODE_D3D10_SB_OPERAND_TYPE(OperandToken0: DWORD) -> D3D10_SB_OPERAND_TYPE { + ((OperandToken0 & D3D10_SB_OPERAND_TYPE_MASK) >> D3D10_SB_OPERAND_TYPE_SHIFT) + as D3D10_SB_OPERAND_TYPE +} +#[inline] +pub fn ENCODE_D3D10_SB_OPERAND_TYPE(OperandType: D3D10_SB_OPERAND_TYPE) -> DWORD { + (OperandType << D3D10_SB_OPERAND_TYPE_SHIFT) & D3D10_SB_OPERAND_TYPE_MASK +} +ENUM!{enum D3D10_SB_OPERAND_INDEX_DIMENSION { + D3D10_SB_OPERAND_INDEX_0D = 0, + D3D10_SB_OPERAND_INDEX_1D = 1, + D3D10_SB_OPERAND_INDEX_2D = 2, + D3D10_SB_OPERAND_INDEX_3D = 3, +}} +pub const D3D10_SB_OPERAND_INDEX_DIMENSION_MASK: DWORD = 0x00300000; +pub const D3D10_SB_OPERAND_INDEX_DIMENSION_SHIFT: DWORD = 20; +#[inline] +pub fn DECODE_D3D10_SB_OPERAND_INDEX_DIMENSION( + OperandToken0: DWORD, +) -> D3D10_SB_OPERAND_INDEX_DIMENSION { + ((OperandToken0 & D3D10_SB_OPERAND_INDEX_DIMENSION_MASK) + >> D3D10_SB_OPERAND_INDEX_DIMENSION_SHIFT) as D3D10_SB_OPERAND_INDEX_DIMENSION +} +#[inline] +pub fn ENCODE_D3D10_SB_OPERAND_INDEX_DIMENSION( + OperandIndexDim: D3D10_SB_OPERAND_INDEX_DIMENSION, +) -> DWORD { + (OperandIndexDim << D3D10_SB_OPERAND_INDEX_DIMENSION_SHIFT) + & D3D10_SB_OPERAND_INDEX_DIMENSION_MASK +} +ENUM!{enum D3D10_SB_OPERAND_INDEX_REPRESENTATION { + D3D10_SB_OPERAND_INDEX_IMMEDIATE32 = 0, + D3D10_SB_OPERAND_INDEX_IMMEDIATE64 = 1, + D3D10_SB_OPERAND_INDEX_RELATIVE = 2, + D3D10_SB_OPERAND_INDEX_IMMEDIATE32_PLUS_RELATIVE = 3, + D3D10_SB_OPERAND_INDEX_IMMEDIATE64_PLUS_RELATIVE = 4, +}} +#[inline] +pub fn D3D10_SB_OPERAND_INDEX_REPRESENTATION_SHIFT(Dim: DWORD) -> DWORD { + 22 + 3 * (Dim & 3) +} +#[inline] +pub fn D3D10_SB_OPERAND_INDEX_REPRESENTATION_MASK(Dim: DWORD) -> DWORD { + 0x3 << D3D10_SB_OPERAND_INDEX_REPRESENTATION_SHIFT(Dim) +} +#[inline] +pub fn DECODE_D3D10_SB_OPERAND_INDEX_REPRESENTATION( + Dim: DWORD, + OperandToken0: DWORD, +) -> D3D10_SB_OPERAND_INDEX_REPRESENTATION { + ((OperandToken0 & D3D10_SB_OPERAND_INDEX_REPRESENTATION_MASK(Dim)) + >> D3D10_SB_OPERAND_INDEX_REPRESENTATION_SHIFT(Dim)) + as D3D10_SB_OPERAND_INDEX_REPRESENTATION +} +#[inline] +pub fn ENCODE_D3D10_SB_OPERAND_INDEX_REPRESENTATION( + Dim: DWORD, + IndexRepresentation: D3D10_SB_OPERAND_INDEX_REPRESENTATION, +) -> DWORD { + (IndexRepresentation << D3D10_SB_OPERAND_INDEX_REPRESENTATION_SHIFT(Dim)) + & D3D10_SB_OPERAND_INDEX_REPRESENTATION_MASK(Dim) +} +pub const D3D10_SB_OPERAND_EXTENDED_MASK: DWORD = 0x80000000; +pub const D3D10_SB_OPERAND_EXTENDED_SHIFT: DWORD = 31; +#[inline] +pub fn DECODE_IS_D3D10_SB_OPERAND_EXTENDED(OperandToken0: DWORD) -> DWORD { + (OperandToken0 & D3D10_SB_OPERAND_EXTENDED_MASK) >> D3D10_SB_OPERAND_EXTENDED_SHIFT +} +#[inline] +pub fn ENCODE_D3D10_SB_OPERAND_EXTENDED(bExtended: DWORD) -> DWORD { + if bExtended != 0 { + D3D10_SB_OPERAND_EXTENDED_MASK + } else { + 0 + } +} +ENUM!{enum D3D10_SB_EXTENDED_OPERAND_TYPE { + D3D10_SB_EXTENDED_OPERAND_EMPTY = 0, + D3D10_SB_EXTENDED_OPERAND_MODIFIER = 1, +}} +pub const D3D10_SB_EXTENDED_OPERAND_TYPE_MASK: DWORD = 0x0000003f; +#[inline] +pub fn DECODE_D3D10_SB_EXTENDED_OPERAND_TYPE( + OperandToken1: DWORD, +) -> D3D10_SB_EXTENDED_OPERAND_TYPE { + (OperandToken1 & D3D10_SB_EXTENDED_OPERAND_TYPE_MASK) as D3D10_SB_EXTENDED_OPERAND_TYPE +} +#[inline] +pub fn ENCODE_D3D10_SB_EXTENDED_OPERAND_TYPE( + ExtOperandType: D3D10_SB_EXTENDED_OPERAND_TYPE, +) -> DWORD { + ExtOperandType & D3D10_SB_EXTENDED_OPERAND_TYPE_MASK +} +ENUM!{enum D3D10_SB_OPERAND_MODIFIER { + D3D10_SB_OPERAND_MODIFIER_NONE = 0, + D3D10_SB_OPERAND_MODIFIER_NEG = 1, + D3D10_SB_OPERAND_MODIFIER_ABS = 2, + D3D10_SB_OPERAND_MODIFIER_ABSNEG = 3, +}} +pub const D3D10_SB_OPERAND_MODIFIER_MASK: DWORD = 0x00003fc0; +pub const D3D10_SB_OPERAND_MODIFIER_SHIFT: DWORD = 6; +#[inline] +pub fn DECODE_D3D10_SB_OPERAND_MODIFIER(OperandToken1: DWORD) -> D3D10_SB_OPERAND_MODIFIER { + ((OperandToken1 & D3D10_SB_OPERAND_MODIFIER_MASK) >> D3D10_SB_OPERAND_MODIFIER_SHIFT) + as D3D10_SB_OPERAND_MODIFIER +} +#[inline] +pub fn ENCODE_D3D10_SB_EXTENDED_OPERAND_MODIFIER(SourceMod: D3D10_SB_OPERAND_MODIFIER) -> DWORD { + ((SourceMod << D3D10_SB_OPERAND_MODIFIER_SHIFT) & D3D10_SB_OPERAND_MODIFIER_MASK) + | ENCODE_D3D10_SB_EXTENDED_OPERAND_TYPE(D3D10_SB_EXTENDED_OPERAND_MODIFIER) + | ENCODE_D3D10_SB_OPERAND_DOUBLE_EXTENDED(0) +} +ENUM!{enum D3D11_SB_OPERAND_MIN_PRECISION { + D3D11_SB_OPERAND_MIN_PRECISION_DEFAULT = 0, + D3D11_SB_OPERAND_MIN_PRECISION_FLOAT_16 = 1, + D3D11_SB_OPERAND_MIN_PRECISION_FLOAT_2_8 = 2, + D3D11_SB_OPERAND_MIN_PRECISION_SINT_16 = 4, + D3D11_SB_OPERAND_MIN_PRECISION_UINT_16 = 5, +}} +pub const D3D11_SB_OPERAND_MIN_PRECISION_MASK: DWORD = 0x0001C000; +pub const D3D11_SB_OPERAND_MIN_PRECISION_SHIFT: DWORD = 14; +#[inline] +pub fn DECODE_D3D11_SB_OPERAND_MIN_PRECISION( + OperandToken1: DWORD, +) -> D3D11_SB_OPERAND_MIN_PRECISION { + ((OperandToken1 & D3D11_SB_OPERAND_MIN_PRECISION_MASK) >> D3D11_SB_OPERAND_MIN_PRECISION_SHIFT) + as D3D11_SB_OPERAND_MIN_PRECISION +} +#[inline] +pub fn ENCODE_D3D11_SB_OPERAND_MIN_PRECISION( + MinPrecision: D3D11_SB_OPERAND_MIN_PRECISION, +) -> DWORD { + (MinPrecision << D3D11_SB_OPERAND_MIN_PRECISION_SHIFT) & D3D11_SB_OPERAND_MIN_PRECISION_MASK +} +pub const D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK: DWORD = 0x80000000; +pub const D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT: DWORD = 31; +#[inline] +pub fn DECODE_IS_D3D10_SB_OPERAND_DOUBLE_EXTENDED(OperandToken1: DWORD) -> DWORD { + (OperandToken1 & D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK) + >> D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT +} +#[inline] +pub fn ENCODE_D3D10_SB_OPERAND_DOUBLE_EXTENDED(bExtended: DWORD) -> DWORD { + if bExtended != 0 { + D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK + } else { + 0 + } +} +pub const D3D10_SB_NAME_MASK: DWORD = 0x0000ffff; +#[inline] +pub fn DECODE_D3D10_SB_NAME(NameToken: DWORD) -> D3D10_SB_NAME { + (NameToken & D3D10_SB_NAME_MASK) as D3D10_SB_NAME +} +#[inline] +pub fn ENCODE_D3D10_SB_NAME(Name: D3D10_SB_NAME) -> DWORD { + Name & D3D10_SB_NAME_MASK +} +pub const D3D10_SB_GLOBAL_FLAG_REFACTORING_ALLOWED: DWORD = 1 << 11; +pub const D3D11_SB_GLOBAL_FLAG_ENABLE_DOUBLE_PRECISION_FLOAT_OPS: DWORD = 1 << 12; +pub const D3D11_SB_GLOBAL_FLAG_FORCE_EARLY_DEPTH_STENCIL: DWORD = 1 << 13; +pub const D3D11_SB_GLOBAL_FLAG_ENABLE_RAW_AND_STRUCTURED_BUFFERS: DWORD = 1 << 14; +pub const D3D11_1_SB_GLOBAL_FLAG_SKIP_OPTIMIZATION: DWORD = 1 << 15; +pub const D3D11_1_SB_GLOBAL_FLAG_ENABLE_MINIMUM_PRECISION: DWORD = 1 << 16; +pub const D3D11_1_SB_GLOBAL_FLAG_ENABLE_DOUBLE_EXTENSIONS: DWORD = 1 << 17; +pub const D3D11_1_SB_GLOBAL_FLAG_ENABLE_SHADER_EXTENSIONS: DWORD = 1 << 18; +pub const D3D10_SB_GLOBAL_FLAGS_MASK: DWORD = 0x00fff800; +#[inline] +pub fn DECODE_D3D10_SB_GLOBAL_FLAGS(OpcodeToken0: DWORD) -> DWORD { + OpcodeToken0 & D3D10_SB_GLOBAL_FLAGS_MASK +} +#[inline] +pub fn ENCODE_D3D10_SB_GLOBAL_FLAGS(Flags: DWORD) -> DWORD { + Flags & D3D10_SB_GLOBAL_FLAGS_MASK +} +pub const D3D10_SB_RESOURCE_DIMENSION_MASK: DWORD = 0x0000F800; +pub const D3D10_SB_RESOURCE_DIMENSION_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D10_SB_RESOURCE_DIMENSION(OpcodeToken0: DWORD) -> D3D10_SB_RESOURCE_DIMENSION { + ((OpcodeToken0 & D3D10_SB_RESOURCE_DIMENSION_MASK) >> D3D10_SB_RESOURCE_DIMENSION_SHIFT) + as D3D10_SB_RESOURCE_DIMENSION +} +#[inline] +pub fn ENCODE_D3D10_SB_RESOURCE_DIMENSION(ResourceDim: D3D10_SB_RESOURCE_DIMENSION) -> DWORD { + (ResourceDim << D3D10_SB_RESOURCE_DIMENSION_SHIFT) & D3D10_SB_RESOURCE_DIMENSION_MASK +} +pub const D3D10_SB_RESOURCE_SAMPLE_COUNT_MASK: DWORD = 0x07F0000; +pub const D3D10_SB_RESOURCE_SAMPLE_COUNT_SHIFT: DWORD = 16; +#[inline] +pub fn DECODE_D3D10_SB_RESOURCE_SAMPLE_COUNT(OpcodeToken0: DWORD) -> UINT { + ((OpcodeToken0 & D3D10_SB_RESOURCE_SAMPLE_COUNT_MASK) >> D3D10_SB_RESOURCE_SAMPLE_COUNT_SHIFT) + as UINT +} +#[inline] +pub fn ENCODE_D3D10_SB_RESOURCE_SAMPLE_COUNT(SampleCount: DWORD) -> DWORD { + (if SampleCount > 127 { 127 } else { SampleCount } << D3D10_SB_RESOURCE_SAMPLE_COUNT_SHIFT) + & D3D10_SB_RESOURCE_SAMPLE_COUNT_MASK +} +#[inline] +pub fn DECODE_D3D10_SB_RESOURCE_RETURN_TYPE( + ResourceReturnTypeToken: D3D10_SB_RESOURCE_RETURN_TYPE, + Component: DWORD, +) -> D3D10_SB_RESOURCE_RETURN_TYPE { + ((ResourceReturnTypeToken >> (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS)) + & D3D10_SB_RESOURCE_RETURN_TYPE_MASK) as D3D10_SB_RESOURCE_RETURN_TYPE +} +#[inline] +pub fn ENCODE_D3D10_SB_RESOURCE_RETURN_TYPE( + ReturnType: DWORD, + Component: DWORD, +) -> D3D10_SB_RESOURCE_RETURN_TYPE { + (ReturnType & D3D10_SB_RESOURCE_RETURN_TYPE_MASK) + << (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS) +} +ENUM!{enum D3D10_SB_SAMPLER_MODE { + D3D10_SB_SAMPLER_MODE_DEFAULT = 0, + D3D10_SB_SAMPLER_MODE_COMPARISON = 1, + D3D10_SB_SAMPLER_MODE_MONO = 2, +}} +pub const D3D10_SB_SAMPLER_MODE_MASK: DWORD = 0x00007800; +pub const D3D10_SB_SAMPLER_MODE_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D10_SB_SAMPLER_MODE(OpcodeToken0: DWORD) -> D3D10_SB_SAMPLER_MODE { + ((OpcodeToken0 & D3D10_SB_SAMPLER_MODE_MASK) >> D3D10_SB_SAMPLER_MODE_SHIFT) + as D3D10_SB_SAMPLER_MODE +} +#[inline] +pub fn ENCODE_D3D10_SB_SAMPLER_MODE(SamplerMode: D3D10_SB_SAMPLER_MODE) -> DWORD { + (SamplerMode << D3D10_SB_SAMPLER_MODE_SHIFT) & D3D10_SB_SAMPLER_MODE_MASK +} +pub const D3D10_SB_INPUT_INTERPOLATION_MODE_MASK: DWORD = 0x00007800; +pub const D3D10_SB_INPUT_INTERPOLATION_MODE_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D10_SB_INPUT_INTERPOLATION_MODE( + OpcodeToken0: DWORD, +) -> D3D10_SB_INTERPOLATION_MODE { + ((OpcodeToken0 & D3D10_SB_INPUT_INTERPOLATION_MODE_MASK) + >> D3D10_SB_INPUT_INTERPOLATION_MODE_SHIFT) as D3D10_SB_INTERPOLATION_MODE +} +#[inline] +pub fn ENCODE_D3D10_SB_INPUT_INTERPOLATION_MODE( + InterpolationMode: D3D10_SB_INTERPOLATION_MODE, +) -> DWORD { + (InterpolationMode << D3D10_SB_INPUT_INTERPOLATION_MODE_SHIFT) + & D3D10_SB_INPUT_INTERPOLATION_MODE_MASK +} +ENUM!{enum D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN { + D3D10_SB_CONSTANT_BUFFER_IMMEDIATE_INDEXED = 0, + D3D10_SB_CONSTANT_BUFFER_DYNAMIC_INDEXED = 1, +}} +pub const D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_MASK: DWORD = 0x00000800; +pub const D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN( + OpcodeToken0: DWORD, +) -> D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN { + ((OpcodeToken0 & D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_MASK) + >> D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_SHIFT) + as D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN +} +#[inline] +pub fn ENCODE_D3D10_SB_D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN( + AccessPattern: D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN, +) -> DWORD { + (AccessPattern << D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_SHIFT) + & D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_MASK +} +ENUM!{enum D3D11_SB_SHADER_MESSAGE_ID { + D3D11_SB_SHADER_MESSAGE_ID_MESSAGE = 0x00200102, + D3D11_SB_SHADER_MESSAGE_ID_ERROR = 0x00200103, +}} +ENUM!{enum D3D11_SB_SHADER_MESSAGE_FORMAT { + D3D11_SB_SHADER_MESSAGE_FORMAT_ANSI_TEXT = 0, + D3D11_SB_SHADER_MESSAGE_FORMAT_ANSI_PRINTF = 1, +}} +pub const D3D10_SB_GS_INPUT_PRIMITIVE_MASK: DWORD = 0x0001f800; +pub const D3D10_SB_GS_INPUT_PRIMITIVE_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D10_SB_GS_INPUT_PRIMITIVE(OpcodeToken0: DWORD) -> D3D10_SB_PRIMITIVE { + ((OpcodeToken0 & D3D10_SB_GS_INPUT_PRIMITIVE_MASK) >> D3D10_SB_GS_INPUT_PRIMITIVE_SHIFT) + as D3D10_SB_PRIMITIVE +} +#[inline] +pub fn ENCODE_D3D10_SB_GS_INPUT_PRIMITIVE(Prim: D3D10_SB_PRIMITIVE) -> DWORD { + (Prim << D3D10_SB_GS_INPUT_PRIMITIVE_SHIFT) & D3D10_SB_GS_INPUT_PRIMITIVE_MASK +} +pub const D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_MASK: DWORD = 0x0001f800; +pub const D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY( + OpcodeToken0: DWORD, +) -> D3D10_SB_PRIMITIVE_TOPOLOGY { + ((OpcodeToken0 & D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_MASK) + >> D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_SHIFT) as D3D10_SB_PRIMITIVE_TOPOLOGY +} +#[inline] +pub fn ENCODE_D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY( + PrimTopology: D3D10_SB_PRIMITIVE_TOPOLOGY, +) -> DWORD { + (PrimTopology << D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_SHIFT) + & D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_MASK +} +pub const D3D11_SB_INPUT_CONTROL_POINT_COUNT_MASK: DWORD = 0x0001f800; +pub const D3D11_SB_INPUT_CONTROL_POINT_COUNT_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D11_SB_INPUT_CONTROL_POINT_COUNT(OpcodeToken0: DWORD) -> UINT { + ((OpcodeToken0 & D3D11_SB_INPUT_CONTROL_POINT_COUNT_MASK) + >> D3D11_SB_INPUT_CONTROL_POINT_COUNT_SHIFT) as UINT +} +#[inline] +pub fn ENCODE_D3D11_SB_INPUT_CONTROL_POINT_COUNT(Count: DWORD) -> DWORD { + (Count << D3D11_SB_INPUT_CONTROL_POINT_COUNT_SHIFT) & D3D11_SB_INPUT_CONTROL_POINT_COUNT_MASK +} +pub const D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_MASK: DWORD = 0x0001f800; +pub const D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D11_SB_OUTPUT_CONTROL_POINT_COUNT(OpcodeToken0: DWORD) -> UINT { + ((OpcodeToken0 & D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_MASK) + >> D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_SHIFT) as UINT +} +#[inline] +pub fn ENCODE_D3D11_SB_OUTPUT_CONTROL_POINT_COUNT(Count: DWORD) -> DWORD { + (Count << D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_SHIFT) & D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_MASK +} +ENUM!{enum D3D11_SB_TESSELLATOR_DOMAIN { + D3D11_SB_TESSELLATOR_DOMAIN_UNDEFINED = 0, + D3D11_SB_TESSELLATOR_DOMAIN_ISOLINE = 1, + D3D11_SB_TESSELLATOR_DOMAIN_TRI = 2, + D3D11_SB_TESSELLATOR_DOMAIN_QUAD = 3, +}} +pub const D3D11_SB_TESS_DOMAIN_MASK: DWORD = 0x00001800; +pub const D3D11_SB_TESS_DOMAIN_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D11_SB_TESS_DOMAIN(OpcodeToken0: DWORD) -> D3D11_SB_TESSELLATOR_DOMAIN { + ((OpcodeToken0 & D3D11_SB_TESS_DOMAIN_MASK) >> D3D11_SB_TESS_DOMAIN_SHIFT) + as D3D11_SB_TESSELLATOR_DOMAIN +} +#[inline] +pub fn ENCODE_D3D11_SB_TESS_DOMAIN(Domain: D3D11_SB_TESSELLATOR_DOMAIN) -> DWORD { + (Domain << D3D11_SB_TESS_DOMAIN_SHIFT) & D3D11_SB_TESS_DOMAIN_MASK +} +ENUM!{enum D3D11_SB_TESSELLATOR_PARTITIONING { + D3D11_SB_TESSELLATOR_PARTITIONING_UNDEFINED = 0, + D3D11_SB_TESSELLATOR_PARTITIONING_INTEGER = 1, + D3D11_SB_TESSELLATOR_PARTITIONING_POW2 = 2, + D3D11_SB_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3, + D3D11_SB_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4, +}} +pub const D3D11_SB_TESS_PARTITIONING_MASK: DWORD = 0x00003800; +pub const D3D11_SB_TESS_PARTITIONING_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D11_SB_TESS_PARTITIONING( + OpcodeToken0: DWORD, +) -> D3D11_SB_TESSELLATOR_PARTITIONING { + ((OpcodeToken0 & D3D11_SB_TESS_PARTITIONING_MASK) >> D3D11_SB_TESS_PARTITIONING_SHIFT) + as D3D11_SB_TESSELLATOR_PARTITIONING +} +#[inline] +pub fn ENCODE_D3D11_SB_TESS_PARTITIONING( + Partitioning: D3D11_SB_TESSELLATOR_PARTITIONING, +) -> DWORD { + (Partitioning << D3D11_SB_TESS_PARTITIONING_SHIFT) & D3D11_SB_TESS_PARTITIONING_MASK +} +ENUM!{enum D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE { + D3D11_SB_TESSELLATOR_OUTPUT_UNDEFINED = 0, + D3D11_SB_TESSELLATOR_OUTPUT_POINT = 1, + D3D11_SB_TESSELLATOR_OUTPUT_LINE = 2, + D3D11_SB_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3, + D3D11_SB_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4, +}} +pub const D3D11_SB_TESS_OUTPUT_PRIMITIVE_MASK: DWORD = 0x00003800; +pub const D3D11_SB_TESS_OUTPUT_PRIMITIVE_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D11_SB_TESS_OUTPUT_PRIMITIVE( + OpcodeToken0: DWORD, +) -> D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE { + ((OpcodeToken0 & D3D11_SB_TESS_OUTPUT_PRIMITIVE_MASK) >> D3D11_SB_TESS_OUTPUT_PRIMITIVE_SHIFT) + as D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE +} +#[inline] +pub fn ENCODE_D3D11_SB_TESS_OUTPUT_PRIMITIVE( + OutputPrimitive: D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE, +) -> DWORD { + (OutputPrimitive << D3D11_SB_TESS_OUTPUT_PRIMITIVE_SHIFT) & D3D11_SB_TESS_OUTPUT_PRIMITIVE_MASK +} +ENUM!{enum D3D10_SB_INTERPOLATION_MODE { + D3D10_SB_INTERPOLATION_UNDEFINED = 0, + D3D10_SB_INTERPOLATION_CONSTANT = 1, + D3D10_SB_INTERPOLATION_LINEAR = 2, + D3D10_SB_INTERPOLATION_LINEAR_CENTROID = 3, + D3D10_SB_INTERPOLATION_LINEAR_NOPERSPECTIVE = 4, + D3D10_SB_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID = 5, + D3D10_SB_INTERPOLATION_LINEAR_SAMPLE = 6, + D3D10_SB_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE = 7, +}} +ENUM!{enum D3D10_SB_PRIMITIVE_TOPOLOGY { + D3D10_SB_PRIMITIVE_TOPOLOGY_UNDEFINED = 0, + D3D10_SB_PRIMITIVE_TOPOLOGY_POINTLIST = 1, + D3D10_SB_PRIMITIVE_TOPOLOGY_LINELIST = 2, + D3D10_SB_PRIMITIVE_TOPOLOGY_LINESTRIP = 3, + D3D10_SB_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4, + D3D10_SB_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, + D3D10_SB_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10, + D3D10_SB_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11, + D3D10_SB_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12, + D3D10_SB_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13, +}} +ENUM!{enum D3D10_SB_PRIMITIVE { + D3D10_SB_PRIMITIVE_UNDEFINED = 0, + D3D10_SB_PRIMITIVE_POINT = 1, + D3D10_SB_PRIMITIVE_LINE = 2, + D3D10_SB_PRIMITIVE_TRIANGLE = 3, + D3D10_SB_PRIMITIVE_LINE_ADJ = 6, + D3D10_SB_PRIMITIVE_TRIANGLE_ADJ = 7, + D3D11_SB_PRIMITIVE_1_CONTROL_POINT_PATCH = 8, + D3D11_SB_PRIMITIVE_2_CONTROL_POINT_PATCH = 9, + D3D11_SB_PRIMITIVE_3_CONTROL_POINT_PATCH = 10, + D3D11_SB_PRIMITIVE_4_CONTROL_POINT_PATCH = 11, + D3D11_SB_PRIMITIVE_5_CONTROL_POINT_PATCH = 12, + D3D11_SB_PRIMITIVE_6_CONTROL_POINT_PATCH = 13, + D3D11_SB_PRIMITIVE_7_CONTROL_POINT_PATCH = 14, + D3D11_SB_PRIMITIVE_8_CONTROL_POINT_PATCH = 15, + D3D11_SB_PRIMITIVE_9_CONTROL_POINT_PATCH = 16, + D3D11_SB_PRIMITIVE_10_CONTROL_POINT_PATCH = 17, + D3D11_SB_PRIMITIVE_11_CONTROL_POINT_PATCH = 18, + D3D11_SB_PRIMITIVE_12_CONTROL_POINT_PATCH = 19, + D3D11_SB_PRIMITIVE_13_CONTROL_POINT_PATCH = 20, + D3D11_SB_PRIMITIVE_14_CONTROL_POINT_PATCH = 21, + D3D11_SB_PRIMITIVE_15_CONTROL_POINT_PATCH = 22, + D3D11_SB_PRIMITIVE_16_CONTROL_POINT_PATCH = 23, + D3D11_SB_PRIMITIVE_17_CONTROL_POINT_PATCH = 24, + D3D11_SB_PRIMITIVE_18_CONTROL_POINT_PATCH = 25, + D3D11_SB_PRIMITIVE_19_CONTROL_POINT_PATCH = 26, + D3D11_SB_PRIMITIVE_20_CONTROL_POINT_PATCH = 27, + D3D11_SB_PRIMITIVE_21_CONTROL_POINT_PATCH = 28, + D3D11_SB_PRIMITIVE_22_CONTROL_POINT_PATCH = 29, + D3D11_SB_PRIMITIVE_23_CONTROL_POINT_PATCH = 30, + D3D11_SB_PRIMITIVE_24_CONTROL_POINT_PATCH = 31, + D3D11_SB_PRIMITIVE_25_CONTROL_POINT_PATCH = 32, + D3D11_SB_PRIMITIVE_26_CONTROL_POINT_PATCH = 33, + D3D11_SB_PRIMITIVE_27_CONTROL_POINT_PATCH = 34, + D3D11_SB_PRIMITIVE_28_CONTROL_POINT_PATCH = 35, + D3D11_SB_PRIMITIVE_29_CONTROL_POINT_PATCH = 36, + D3D11_SB_PRIMITIVE_30_CONTROL_POINT_PATCH = 37, + D3D11_SB_PRIMITIVE_31_CONTROL_POINT_PATCH = 38, + D3D11_SB_PRIMITIVE_32_CONTROL_POINT_PATCH = 39, +}} +ENUM!{enum D3D10_SB_COMPONENT_MASK { + D3D10_SB_COMPONENT_MASK_X = 1, + D3D10_SB_COMPONENT_MASK_Y = 2, + D3D10_SB_COMPONENT_MASK_Z = 4, + D3D10_SB_COMPONENT_MASK_W = 8, + D3D10_SB_COMPONENT_MASK_R = 1, + D3D10_SB_COMPONENT_MASK_G = 2, + D3D10_SB_COMPONENT_MASK_B = 4, + D3D10_SB_COMPONENT_MASK_A = 8, + D3D10_SB_COMPONENT_MASK_ALL = 15, +}} +ENUM!{enum D3D10_SB_NAME { + D3D10_SB_NAME_UNDEFINED = 0, + D3D10_SB_NAME_POSITION = 1, + D3D10_SB_NAME_CLIP_DISTANCE = 2, + D3D10_SB_NAME_CULL_DISTANCE = 3, + D3D10_SB_NAME_RENDER_TARGET_ARRAY_INDEX = 4, + D3D10_SB_NAME_VIEWPORT_ARRAY_INDEX = 5, + D3D10_SB_NAME_VERTEX_ID = 6, + D3D10_SB_NAME_PRIMITIVE_ID = 7, + D3D10_SB_NAME_INSTANCE_ID = 8, + D3D10_SB_NAME_IS_FRONT_FACE = 9, + D3D10_SB_NAME_SAMPLE_INDEX = 10, + D3D11_SB_NAME_FINAL_QUAD_U_EQ_0_EDGE_TESSFACTOR = 11, + D3D11_SB_NAME_FINAL_QUAD_V_EQ_0_EDGE_TESSFACTOR = 12, + D3D11_SB_NAME_FINAL_QUAD_U_EQ_1_EDGE_TESSFACTOR = 13, + D3D11_SB_NAME_FINAL_QUAD_V_EQ_1_EDGE_TESSFACTOR = 14, + D3D11_SB_NAME_FINAL_QUAD_U_INSIDE_TESSFACTOR = 15, + D3D11_SB_NAME_FINAL_QUAD_V_INSIDE_TESSFACTOR = 16, + D3D11_SB_NAME_FINAL_TRI_U_EQ_0_EDGE_TESSFACTOR = 17, + D3D11_SB_NAME_FINAL_TRI_V_EQ_0_EDGE_TESSFACTOR = 18, + D3D11_SB_NAME_FINAL_TRI_W_EQ_0_EDGE_TESSFACTOR = 19, + D3D11_SB_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 20, + D3D11_SB_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 21, + D3D11_SB_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 22, +}} +ENUM!{enum D3D10_SB_RESOURCE_DIMENSION { + D3D10_SB_RESOURCE_DIMENSION_UNKNOWN = 0, + D3D10_SB_RESOURCE_DIMENSION_BUFFER = 1, + D3D10_SB_RESOURCE_DIMENSION_TEXTURE1D = 2, + D3D10_SB_RESOURCE_DIMENSION_TEXTURE2D = 3, + D3D10_SB_RESOURCE_DIMENSION_TEXTURE2DMS = 4, + D3D10_SB_RESOURCE_DIMENSION_TEXTURE3D = 5, + D3D10_SB_RESOURCE_DIMENSION_TEXTURECUBE = 6, + D3D10_SB_RESOURCE_DIMENSION_TEXTURE1DARRAY = 7, + D3D10_SB_RESOURCE_DIMENSION_TEXTURE2DARRAY = 8, + D3D10_SB_RESOURCE_DIMENSION_TEXTURE2DMSARRAY = 9, + D3D10_SB_RESOURCE_DIMENSION_TEXTURECUBEARRAY = 10, + D3D11_SB_RESOURCE_DIMENSION_RAW_BUFFER = 11, + D3D11_SB_RESOURCE_DIMENSION_STRUCTURED_BUFFER = 12, +}} +ENUM!{enum D3D10_SB_RESOURCE_RETURN_TYPE { + D3D10_SB_RETURN_TYPE_UNORM = 1, + D3D10_SB_RETURN_TYPE_SNORM = 2, + D3D10_SB_RETURN_TYPE_SINT = 3, + D3D10_SB_RETURN_TYPE_UINT = 4, + D3D10_SB_RETURN_TYPE_FLOAT = 5, + D3D10_SB_RETURN_TYPE_MIXED = 6, + D3D11_SB_RETURN_TYPE_DOUBLE = 7, + D3D11_SB_RETURN_TYPE_CONTINUED = 8, + D3D11_SB_RETURN_TYPE_UNUSED = 9, +}} +ENUM!{enum D3D10_SB_REGISTER_COMPONENT_TYPE { + D3D10_SB_REGISTER_COMPONENT_UNKNOWN = 0, + D3D10_SB_REGISTER_COMPONENT_UINT32 = 1, + D3D10_SB_REGISTER_COMPONENT_SINT32 = 2, + D3D10_SB_REGISTER_COMPONENT_FLOAT32 = 3, +}} +ENUM!{enum D3D10_SB_INSTRUCTION_RETURN_TYPE { + D3D10_SB_INSTRUCTION_RETURN_FLOAT = 0, + D3D10_SB_INSTRUCTION_RETURN_UINT = 1, +}} +pub const D3D10_SB_INSTRUCTION_RETURN_TYPE_MASK: DWORD = 0x00001800; +pub const D3D10_SB_INSTRUCTION_RETURN_TYPE_SHIFT: DWORD = 11; +#[inline] +pub fn DECODE_D3D10_SB_INSTRUCTION_RETURN_TYPE( + OpcodeToken0: DWORD, +) -> D3D10_SB_INSTRUCTION_RETURN_TYPE { + ((OpcodeToken0 & D3D10_SB_INSTRUCTION_RETURN_TYPE_MASK) + >> D3D10_SB_INSTRUCTION_RETURN_TYPE_SHIFT) as D3D10_SB_INSTRUCTION_RETURN_TYPE +} +#[inline] +pub fn ENCODE_D3D10_SB_INSTRUCTION_RETURN_TYPE( + ReturnType: D3D10_SB_INSTRUCTION_RETURN_TYPE, +) -> DWORD { + (ReturnType << D3D10_SB_INSTRUCTION_RETURN_TYPE_SHIFT) & D3D10_SB_INSTRUCTION_RETURN_TYPE_MASK +} +pub const D3D11_SB_INTERFACE_INDEXED_BIT_MASK: DWORD = 0x00000800; +pub const D3D11_SB_INTERFACE_INDEXED_BIT_SHIFT: DWORD = 11; +pub const D3D11_SB_INTERFACE_TABLE_LENGTH_MASK: DWORD = 0x0000ffff; +pub const D3D11_SB_INTERFACE_TABLE_LENGTH_SHIFT: DWORD = 0; +pub const D3D11_SB_INTERFACE_ARRAY_LENGTH_MASK: DWORD = 0xffff0000; +pub const D3D11_SB_INTERFACE_ARRAY_LENGTH_SHIFT: DWORD = 16; +#[inline] +pub fn DECODE_D3D11_SB_INTERFACE_INDEXED_BIT(OpcodeToken0: DWORD) -> DWORD { + if (OpcodeToken0 & D3D11_SB_INTERFACE_INDEXED_BIT_MASK) >> D3D11_SB_INTERFACE_INDEXED_BIT_SHIFT + != 0 { 1 } else { 0 } +} +#[inline] +pub fn ENCODE_D3D11_SB_INTERFACE_INDEXED_BIT(IndexedBit: DWORD) -> DWORD { + (IndexedBit << D3D11_SB_INTERFACE_INDEXED_BIT_SHIFT) & D3D11_SB_INTERFACE_INDEXED_BIT_MASK +} +#[inline] +pub fn DECODE_D3D11_SB_INTERFACE_TABLE_LENGTH(OpcodeToken0: DWORD) -> UINT { + ((OpcodeToken0 & D3D11_SB_INTERFACE_TABLE_LENGTH_MASK) + >> D3D11_SB_INTERFACE_TABLE_LENGTH_SHIFT) as UINT +} +#[inline] +pub fn ENCODE_D3D11_SB_INTERFACE_TABLE_LENGTH(TableLength: DWORD) -> DWORD { + (TableLength << D3D11_SB_INTERFACE_TABLE_LENGTH_SHIFT) & D3D11_SB_INTERFACE_TABLE_LENGTH_MASK +} +#[inline] +pub fn DECODE_D3D11_SB_INTERFACE_ARRAY_LENGTH(OpcodeToken0: DWORD) -> UINT { + ((OpcodeToken0 & D3D11_SB_INTERFACE_ARRAY_LENGTH_MASK) + >> D3D11_SB_INTERFACE_ARRAY_LENGTH_SHIFT) as UINT +} +#[inline] +pub fn ENCODE_D3D11_SB_INTERFACE_ARRAY_LENGTH(ArrayLength: DWORD) -> DWORD { + (ArrayLength << D3D11_SB_INTERFACE_ARRAY_LENGTH_SHIFT) & D3D11_SB_INTERFACE_ARRAY_LENGTH_MASK +} +pub const D3D11_SB_GLOBALLY_COHERENT_ACCESS: DWORD = 0x00010000; +pub const D3D11_SB_ACCESS_COHERENCY_MASK: DWORD = 0x00010000; +#[inline] +pub fn DECODE_D3D11_SB_ACCESS_COHERENCY_FLAGS(OperandToken0: DWORD) -> DWORD { + OperandToken0 & D3D11_SB_ACCESS_COHERENCY_MASK +} +#[inline] +pub fn ENCODE_D3D11_SB_ACCESS_COHERENCY_FLAGS(Flags: DWORD) -> DWORD { + Flags & D3D11_SB_ACCESS_COHERENCY_MASK +} +pub const D3D11_SB_UAV_HAS_ORDER_PRESERVING_COUNTER: DWORD = 0x00800000; +pub const D3D11_SB_UAV_FLAGS_MASK: DWORD = 0x00800000; +#[inline] +pub fn DECODE_D3D11_SB_UAV_FLAGS(OperandToken0: DWORD) -> DWORD { + OperandToken0 & D3D11_SB_UAV_FLAGS_MASK +} +#[inline] +pub fn ENCODE_D3D11_SB_UAV_FLAGS(Flags: DWORD) -> DWORD { + Flags & D3D11_SB_UAV_FLAGS_MASK +} diff --git a/bash-5.1/vendor/winapi/src/um/d3d12.rs b/bash-5.1/vendor/winapi/src/um/d3d12.rs new file mode 100644 index 0000000000000000000000000000000000000000..56048d9391bafc4ae905e0fb2eca60d00f96fa3f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d12.rs @@ -0,0 +1,2722 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_void; +use shared::basetsd::{INT8, LONG_PTR, SIZE_T, UINT16, UINT64, UINT8}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::dxgitype::DXGI_SAMPLE_DESC; +use shared::guiddef::{IID, REFGUID, REFIID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT, INT, LPCVOID, UINT}; +use shared::windef::RECT; +use um::d3dcommon::{D3D_FEATURE_LEVEL, D3D_PRIMITIVE, D3D_PRIMITIVE_TOPOLOGY, ID3DBlob}; +use um::minwinbase::SECURITY_ATTRIBUTES; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, LPCSTR, LPCWSTR, LUID}; +pub const D3D12_16BIT_INDEX_STRIP_CUT_VALUE: UINT = 0xffff; +pub const D3D12_32BIT_INDEX_STRIP_CUT_VALUE: UINT = 0xffffffff; +pub const D3D12_8BIT_INDEX_STRIP_CUT_VALUE: UINT = 0xff; +pub const D3D12_APPEND_ALIGNED_ELEMENT: UINT = 0xffffffff; +pub const D3D12_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT: UINT = 9; +pub const D3D12_CLIP_OR_CULL_DISTANCE_COUNT: UINT = 8; +pub const D3D12_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT: UINT = 2; +pub const D3D12_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT: UINT = 14; +pub const D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS: UINT = 4; +pub const D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT: UINT = 15; +pub const D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT: UINT = 16; +pub const D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT: UINT = 15; +pub const D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST: UINT = 1; +pub const D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT: UINT = 64; +pub const D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT: UINT = 1; +pub const D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST: UINT = 1; +pub const D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT: UINT = 128; +pub const D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST: UINT = 1; +pub const D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT: UINT = 128; +pub const D3D12_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_COMMONSHADER_SAMPLER_REGISTER_COUNT: UINT = 16; +pub const D3D12_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST: UINT = 1; +pub const D3D12_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_COMMONSHADER_SAMPLER_SLOT_COUNT: UINT = 16; +pub const D3D12_COMMONSHADER_SUBROUTINE_NESTING_LIMIT: UINT = 32; +pub const D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_COMMONSHADER_TEMP_REGISTER_COUNT: UINT = 4096; +pub const D3D12_COMMONSHADER_TEMP_REGISTER_READS_PER_INST: UINT = 3; +pub const D3D12_COMMONSHADER_TEMP_REGISTER_READ_PORTS: UINT = 3; +pub const D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX: INT = 10; +pub const D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN: INT = -10; +pub const D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE: INT = -8; +pub const D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE: INT = 7; +pub const D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT: UINT = 256; +pub const D3D12_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 256; +pub const D3D12_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP: UINT = 64; +pub const D3D12_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 240; +pub const D3D12_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP: UINT = 68; +pub const D3D12_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 224; +pub const D3D12_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP: UINT = 72; +pub const D3D12_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 208; +pub const D3D12_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP: UINT = 76; +pub const D3D12_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 192; +pub const D3D12_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP: UINT = 84; +pub const D3D12_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 176; +pub const D3D12_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP: UINT = 92; +pub const D3D12_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 160; +pub const D3D12_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP: UINT = 100; +pub const D3D12_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 144; +pub const D3D12_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP: UINT = 112; +pub const D3D12_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 128; +pub const D3D12_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP: UINT = 128; +pub const D3D12_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 112; +pub const D3D12_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP: UINT = 144; +pub const D3D12_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 96; +pub const D3D12_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP: UINT = 168; +pub const D3D12_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 80; +pub const D3D12_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP: UINT = 204; +pub const D3D12_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 64; +pub const D3D12_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP: UINT = 256; +pub const D3D12_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 48; +pub const D3D12_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP: UINT = 340; +pub const D3D12_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 32; +pub const D3D12_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP: UINT = 512; +pub const D3D12_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD: UINT = 16; +pub const D3D12_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP: UINT = 768; +pub const D3D12_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION: UINT = 1; +pub const D3D12_CS_4_X_RAW_UAV_BYTE_ALIGNMENT: UINT = 256; +pub const D3D12_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP: UINT = 768; +pub const D3D12_CS_4_X_THREAD_GROUP_MAX_X: UINT = 768; +pub const D3D12_CS_4_X_THREAD_GROUP_MAX_Y: UINT = 768; +pub const D3D12_CS_4_X_UAV_REGISTER_COUNT: UINT = 1; +pub const D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION: UINT = 65535; +pub const D3D12_CS_TGSM_REGISTER_COUNT: UINT = 8192; +pub const D3D12_CS_TGSM_REGISTER_READS_PER_INST: UINT = 1; +pub const D3D12_CS_TGSM_RESOURCE_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_CS_TGSM_RESOURCE_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_CS_THREADGROUPID_REGISTER_COMPONENTS: UINT = 3; +pub const D3D12_CS_THREADGROUPID_REGISTER_COUNT: UINT = 1; +pub const D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COUNT: UINT = 1; +pub const D3D12_CS_THREADIDINGROUP_REGISTER_COMPONENTS: UINT = 3; +pub const D3D12_CS_THREADIDINGROUP_REGISTER_COUNT: UINT = 1; +pub const D3D12_CS_THREADID_REGISTER_COMPONENTS: UINT = 3; +pub const D3D12_CS_THREADID_REGISTER_COUNT: UINT = 1; +pub const D3D12_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP: UINT = 1024; +pub const D3D12_CS_THREAD_GROUP_MAX_X: UINT = 1024; +pub const D3D12_CS_THREAD_GROUP_MAX_Y: UINT = 1024; +pub const D3D12_CS_THREAD_GROUP_MAX_Z: UINT = 64; +pub const D3D12_CS_THREAD_GROUP_MIN_X: UINT = 1; +pub const D3D12_CS_THREAD_GROUP_MIN_Y: UINT = 1; +pub const D3D12_CS_THREAD_GROUP_MIN_Z: UINT = 1; +pub const D3D12_CS_THREAD_LOCAL_TEMP_REGISTER_POOL: UINT = 16384; +pub const D3D12_DEFAULT_BLEND_FACTOR_ALPHA: FLOAT = 1.0; +pub const D3D12_DEFAULT_BLEND_FACTOR_BLUE: FLOAT = 1.0; +pub const D3D12_DEFAULT_BLEND_FACTOR_GREEN: FLOAT = 1.0; +pub const D3D12_DEFAULT_BLEND_FACTOR_RED: FLOAT = 1.0; +pub const D3D12_DEFAULT_BORDER_COLOR_COMPONENT: FLOAT = 0.0; +pub const D3D12_DEFAULT_DEPTH_BIAS: UINT = 0; +pub const D3D12_DEFAULT_DEPTH_BIAS_CLAMP: FLOAT = 0.0; +pub const D3D12_DEFAULT_MAX_ANISOTROPY: UINT = 16; +pub const D3D12_DEFAULT_MIP_LOD_BIAS: FLOAT = 0.0; +pub const D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT: UINT = 4194304; +pub const D3D12_DEFAULT_RENDER_TARGET_ARRAY_INDEX: UINT = 0; +pub const D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT: UINT = 65536; +pub const D3D12_DEFAULT_SAMPLE_MASK: UINT = 0xffffffff; +pub const D3D12_DEFAULT_SCISSOR_ENDX: UINT = 0; +pub const D3D12_DEFAULT_SCISSOR_ENDY: UINT = 0; +pub const D3D12_DEFAULT_SCISSOR_STARTX: UINT = 0; +pub const D3D12_DEFAULT_SCISSOR_STARTY: UINT = 0; +pub const D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS: FLOAT = 0.0; +pub const D3D12_DEFAULT_STENCIL_READ_MASK: UINT = 0xff; +pub const D3D12_DEFAULT_STENCIL_REFERENCE: UINT = 0; +pub const D3D12_DEFAULT_STENCIL_WRITE_MASK: UINT = 0xff; +pub const D3D12_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX: UINT = 0; +pub const D3D12_DEFAULT_VIEWPORT_HEIGHT: UINT = 0; +pub const D3D12_DEFAULT_VIEWPORT_MAX_DEPTH: FLOAT = 0.0; +pub const D3D12_DEFAULT_VIEWPORT_MIN_DEPTH: FLOAT = 0.0; +pub const D3D12_DEFAULT_VIEWPORT_TOPLEFTX: UINT = 0; +pub const D3D12_DEFAULT_VIEWPORT_TOPLEFTY: UINT = 0; +pub const D3D12_DEFAULT_VIEWPORT_WIDTH: UINT = 0; +pub const D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND: UINT = 0xffffffff; +pub const D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_END: UINT = 0xfffffff7; +pub const D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_START: UINT = 0xfffffff0; +pub const D3D12_DS_INPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS: UINT = 3968; +pub const D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COUNT: UINT = 32; +pub const D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENTS: UINT = 3; +pub const D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COUNT: UINT = 1; +pub const D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT: UINT = 32; +pub const D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COUNT: UINT = 1; +pub const D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_DS_OUTPUT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_DS_OUTPUT_REGISTER_COUNT: UINT = 32; +pub const D3D12_FLOAT16_FUSED_TOLERANCE_IN_ULP: FLOAT = 0.6; +pub const D3D12_FLOAT32_MAX: FLOAT = 3.402823466e+38; +pub const D3D12_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP: FLOAT = 0.6; +pub const D3D12_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR: FLOAT = 2.4; +pub const D3D12_FLOAT_TO_SRGB_EXPONENT_NUMERATOR: FLOAT = 1.0; +pub const D3D12_FLOAT_TO_SRGB_OFFSET: FLOAT = 0.055; +pub const D3D12_FLOAT_TO_SRGB_SCALE_1: FLOAT = 12.92; +pub const D3D12_FLOAT_TO_SRGB_SCALE_2: FLOAT = 1.055; +pub const D3D12_FLOAT_TO_SRGB_THRESHOLD: FLOAT = 0.0031308; +pub const D3D12_FTOI_INSTRUCTION_MAX_INPUT: FLOAT = 2147483647.999; +pub const D3D12_FTOI_INSTRUCTION_MIN_INPUT: FLOAT = -2147483648.999; +pub const D3D12_FTOU_INSTRUCTION_MAX_INPUT: FLOAT = 4294967295.999; +pub const D3D12_FTOU_INSTRUCTION_MIN_INPUT: FLOAT = 0.0; +pub const D3D12_GS_INPUT_INSTANCE_ID_READS_PER_INST: UINT = 2; +pub const D3D12_GS_INPUT_INSTANCE_ID_READ_PORTS: UINT = 1; +pub const D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COUNT: UINT = 1; +pub const D3D12_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_GS_INPUT_PRIM_CONST_REGISTER_COUNT: UINT = 1; +pub const D3D12_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_GS_INPUT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_GS_INPUT_REGISTER_COUNT: UINT = 32; +pub const D3D12_GS_INPUT_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_GS_INPUT_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_GS_INPUT_REGISTER_VERTICES: UINT = 32; +pub const D3D12_GS_MAX_INSTANCE_COUNT: UINT = 32; +pub const D3D12_GS_MAX_OUTPUT_VERTEX_COUNT_ACROSS_INSTANCES: UINT = 1024; +pub const D3D12_GS_OUTPUT_ELEMENTS: UINT = 32; +pub const D3D12_GS_OUTPUT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_GS_OUTPUT_REGISTER_COUNT: UINT = 32; +pub const D3D12_HS_CONTROL_POINT_PHASE_INPUT_REGISTER_COUNT: UINT = 32; +pub const D3D12_HS_CONTROL_POINT_PHASE_OUTPUT_REGISTER_COUNT: UINT = 32; +pub const D3D12_HS_CONTROL_POINT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_HS_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_HS_CONTROL_POINT_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_HS_CONTROL_POINT_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_HS_FORK_PHASE_INSTANCE_COUNT_UPPER_BOUND: UINT = 0xffffffff; +pub const D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COUNT: UINT = 1; +pub const D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COUNT: UINT = 1; +pub const D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COUNT: UINT = 1; +pub const D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_HS_JOIN_PHASE_INSTANCE_COUNT_UPPER_BOUND: UINT = 0xffffffff; +pub const D3D12_HS_MAXTESSFACTOR_LOWER_BOUND: FLOAT = 1.0; +pub const D3D12_HS_MAXTESSFACTOR_UPPER_BOUND: FLOAT = 64.0; +pub const D3D12_HS_OUTPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS: UINT = 3968; +pub const D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COUNT: UINT = 1; +pub const D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COUNT: UINT = 32; +pub const D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_SCALAR_COMPONENTS: UINT = 128; +pub const D3D12_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES: UINT = 0; +pub const D3D12_IA_DEFAULT_PRIMITIVE_TOPOLOGY: UINT = 0; +pub const D3D12_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES: UINT = 0; +pub const D3D12_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT: UINT = 1; +pub const D3D12_IA_INSTANCE_ID_BIT_COUNT: UINT = 32; +pub const D3D12_IA_INTEGER_ARITHMETIC_BIT_COUNT: UINT = 32; +pub const D3D12_IA_PATCH_MAX_CONTROL_POINT_COUNT: UINT = 32; +pub const D3D12_IA_PRIMITIVE_ID_BIT_COUNT: UINT = 32; +pub const D3D12_IA_VERTEX_ID_BIT_COUNT: UINT = 32; +pub const D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT: UINT = 32; +pub const D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS: UINT = 128; +pub const D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT: UINT = 32; +pub const D3D12_INTEGER_DIVIDE_BY_ZERO_QUOTIENT: UINT = 0xffffffff; +pub const D3D12_INTEGER_DIVIDE_BY_ZERO_REMAINDER: UINT = 0xffffffff; +pub const D3D12_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL: UINT = 0xffffffff; +pub const D3D12_KEEP_UNORDERED_ACCESS_VIEWS: UINT = 0xffffffff; +pub const D3D12_LINEAR_GAMMA: FLOAT = 1.0; +pub const D3D12_MAJOR_VERSION: UINT = 12; +pub const D3D12_MAX_BORDER_COLOR_COMPONENT: FLOAT = 1.0; +pub const D3D12_MAX_DEPTH: FLOAT = 1.0; +pub const D3D12_MAX_LIVE_STATIC_SAMPLERS: UINT = 2032; +pub const D3D12_MAX_MAXANISOTROPY: UINT = 16; +pub const D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT: UINT = 32; +pub const D3D12_MAX_POSITION_VALUE: FLOAT = 3.402823466e+34; +pub const D3D12_MAX_ROOT_COST: UINT = 64; +pub const D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1: UINT = 1000000; +pub const D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_2: UINT = 1000000; +pub const D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE: UINT = 2048; +pub const D3D12_MAX_TEXTURE_DIMENSION_2_TO_EXP: UINT = 17; +pub const D3D12_MINOR_VERSION: UINT = 0; +pub const D3D12_MIN_BORDER_COLOR_COMPONENT: FLOAT = 0.0; +pub const D3D12_MIN_DEPTH: FLOAT = 0.0; +pub const D3D12_MIN_MAXANISOTROPY: UINT = 0; +pub const D3D12_MIP_LOD_BIAS_MAX: FLOAT = 15.99; +pub const D3D12_MIP_LOD_BIAS_MIN: FLOAT = -16.0; +pub const D3D12_MIP_LOD_FRACTIONAL_BIT_COUNT: UINT = 8; +pub const D3D12_MIP_LOD_RANGE_BIT_COUNT: UINT = 8; +pub const D3D12_MULTISAMPLE_ANTIALIAS_LINE_WIDTH: FLOAT = 1.4; +pub const D3D12_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT: UINT = 0; +pub const D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_END: UINT = 0xffffffff; +pub const D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_START: UINT = 0xfffffff8; +pub const D3D12_PACKED_TILE: UINT = 0xffffffff; +pub const D3D12_PIXEL_ADDRESS_RANGE_BIT_COUNT: UINT = 15; +pub const D3D12_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT: UINT = 16; +pub const D3D12_PS_CS_UAV_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_PS_CS_UAV_REGISTER_COUNT: UINT = 8; +pub const D3D12_PS_CS_UAV_REGISTER_READS_PER_INST: UINT = 1; +pub const D3D12_PS_CS_UAV_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_PS_FRONTFACING_DEFAULT_VALUE: UINT = 0xffffffff; +pub const D3D12_PS_FRONTFACING_FALSE_VALUE: UINT = 0; +pub const D3D12_PS_FRONTFACING_TRUE_VALUE: UINT = 0xffffffff; +pub const D3D12_PS_INPUT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_PS_INPUT_REGISTER_COUNT: UINT = 32; +pub const D3D12_PS_INPUT_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_PS_INPUT_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT: FLOAT = 0.0; +pub const D3D12_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_PS_OUTPUT_DEPTH_REGISTER_COUNT: UINT = 1; +pub const D3D12_PS_OUTPUT_MASK_REGISTER_COMPONENTS: UINT = 1; +pub const D3D12_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_PS_OUTPUT_MASK_REGISTER_COUNT: UINT = 1; +pub const D3D12_PS_OUTPUT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_PS_OUTPUT_REGISTER_COUNT: UINT = 8; +pub const D3D12_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT: FLOAT = 0.5; +pub const D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT: UINT = 16; +pub const D3D12_REQ_BLEND_OBJECT_COUNT_PER_DEVICE: UINT = 4096; +pub const D3D12_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP: UINT = 27; +pub const D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT: UINT = 4096; +pub const D3D12_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_DEVICE: UINT = 4096; +pub const D3D12_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP: UINT = 32; +pub const D3D12_REQ_DRAW_VERTEX_COUNT_2_TO_EXP: UINT = 32; +pub const D3D12_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION: UINT = 16384; +pub const D3D12_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT: UINT = 1024; +pub const D3D12_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT: UINT = 4096; +pub const D3D12_REQ_MAXANISOTROPY: UINT = 16; +pub const D3D12_REQ_MIP_LEVELS: UINT = 15; +pub const D3D12_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES: UINT = 2048; +pub const D3D12_REQ_RASTERIZER_OBJECT_COUNT_PER_DEVICE: UINT = 4096; +pub const D3D12_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH: UINT = 16384; +pub const D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM: UINT = 128; +pub const D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM: FLOAT = 0.25; +pub const D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_C_TERM: UINT = 2048; +pub const D3D12_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP: UINT = 20; +pub const D3D12_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE: UINT = 4096; +pub const D3D12_REQ_SUBRESOURCES: UINT = 30720; +pub const D3D12_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION: UINT = 2048; +pub const D3D12_REQ_TEXTURE1D_U_DIMENSION: UINT = 16384; +pub const D3D12_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION: UINT = 2048; +pub const D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION: UINT = 16384; +pub const D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION: UINT = 2048; +pub const D3D12_REQ_TEXTURECUBE_DIMENSION: UINT = 16384; +pub const D3D12_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL: UINT = 0; +pub const D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES: UINT = 0xffffffff; +pub const D3D12_SHADER_MAJOR_VERSION: UINT = 5; +pub const D3D12_SHADER_MAX_INSTANCES: UINT = 65535; +pub const D3D12_SHADER_MAX_INTERFACES: UINT = 253; +pub const D3D12_SHADER_MAX_INTERFACE_CALL_SITES: UINT = 4096; +pub const D3D12_SHADER_MAX_TYPES: UINT = 65535; +pub const D3D12_SHADER_MINOR_VERSION: UINT = 1; +pub const D3D12_SHIFT_INSTRUCTION_PAD_VALUE: UINT = 0; +pub const D3D12_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT: UINT = 5; +pub const D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT: UINT = 8; +pub const D3D12_SMALL_MSAA_RESOURCE_PLACEMENT_ALIGNMENT: UINT = 65536; +pub const D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT: UINT = 4096; +pub const D3D12_SO_BUFFER_MAX_STRIDE_IN_BYTES: UINT = 2048; +pub const D3D12_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES: UINT = 512; +pub const D3D12_SO_BUFFER_SLOT_COUNT: UINT = 4; +pub const D3D12_SO_DDI_REGISTER_INDEX_DENOTING_GAP: UINT = 0xffffffff; +pub const D3D12_SO_NO_RASTERIZED_STREAM: UINT = 0xffffffff; +pub const D3D12_SO_OUTPUT_COMPONENT_COUNT: UINT = 128; +pub const D3D12_SO_STREAM_COUNT: UINT = 4; +pub const D3D12_SPEC_DATE_DAY: UINT = 14; +pub const D3D12_SPEC_DATE_MONTH: UINT = 11; +pub const D3D12_SPEC_DATE_YEAR: UINT = 2014; +pub const D3D12_SPEC_VERSION: FLOAT = 1.16; +pub const D3D12_SRGB_GAMMA: FLOAT = 2.2; +pub const D3D12_SRGB_TO_FLOAT_DENOMINATOR_1: FLOAT = 12.92; +pub const D3D12_SRGB_TO_FLOAT_DENOMINATOR_2: FLOAT = 1.055; +pub const D3D12_SRGB_TO_FLOAT_EXPONENT: FLOAT = 2.4; +pub const D3D12_SRGB_TO_FLOAT_OFFSET: FLOAT = 0.055; +pub const D3D12_SRGB_TO_FLOAT_THRESHOLD: FLOAT = 0.04045; +pub const D3D12_SRGB_TO_FLOAT_TOLERANCE_IN_ULP: FLOAT = 0.5; +pub const D3D12_STANDARD_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_STANDARD_COMPONENT_BIT_COUNT_DOUBLED: UINT = 64; +pub const D3D12_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE: UINT = 4; +pub const D3D12_STANDARD_PIXEL_COMPONENT_COUNT: UINT = 128; +pub const D3D12_STANDARD_PIXEL_ELEMENT_COUNT: UINT = 32; +pub const D3D12_STANDARD_VECTOR_SIZE: UINT = 4; +pub const D3D12_STANDARD_VERTEX_ELEMENT_COUNT: UINT = 32; +pub const D3D12_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT: UINT = 64; +pub const D3D12_SUBPIXEL_FRACTIONAL_BIT_COUNT: UINT = 8; +pub const D3D12_SUBTEXEL_FRACTIONAL_BIT_COUNT: UINT = 8; +pub const D3D12_SYSTEM_RESERVED_REGISTER_SPACE_VALUES_END: UINT = 0xffffffff; +pub const D3D12_SYSTEM_RESERVED_REGISTER_SPACE_VALUES_START: UINT = 0xfffffff0; +pub const D3D12_TESSELLATOR_MAX_EVEN_TESSELLATION_FACTOR: UINT = 64; +pub const D3D12_TESSELLATOR_MAX_ISOLINE_DENSITY_TESSELLATION_FACTOR: UINT = 64; +pub const D3D12_TESSELLATOR_MAX_ODD_TESSELLATION_FACTOR: UINT = 63; +pub const D3D12_TESSELLATOR_MAX_TESSELLATION_FACTOR: UINT = 64; +pub const D3D12_TESSELLATOR_MIN_EVEN_TESSELLATION_FACTOR: UINT = 2; +pub const D3D12_TESSELLATOR_MIN_ISOLINE_DENSITY_TESSELLATION_FACTOR: UINT = 1; +pub const D3D12_TESSELLATOR_MIN_ODD_TESSELLATION_FACTOR: UINT = 1; +pub const D3D12_TEXEL_ADDRESS_RANGE_BIT_COUNT: UINT = 16; +pub const D3D12_TEXTURE_DATA_PITCH_ALIGNMENT: UINT = 256; +pub const D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT: UINT = 512; +pub const D3D12_TILED_RESOURCE_TILE_SIZE_IN_BYTES: UINT = 65536; +pub const D3D12_UAV_COUNTER_PLACEMENT_ALIGNMENT: UINT = 4096; +pub const D3D12_UAV_SLOT_COUNT: UINT = 64; +pub const D3D12_UNBOUND_MEMORY_ACCESS_RESULT: UINT = 0; +pub const D3D12_VIEWPORT_AND_SCISSORRECT_MAX_INDEX: UINT = 15; +pub const D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE: UINT = 16; +pub const D3D12_VIEWPORT_BOUNDS_MAX: INT = 32767; +pub const D3D12_VIEWPORT_BOUNDS_MIN: INT = -32768; +pub const D3D12_VS_INPUT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_VS_INPUT_REGISTER_COUNT: UINT = 32; +pub const D3D12_VS_INPUT_REGISTER_READS_PER_INST: UINT = 2; +pub const D3D12_VS_INPUT_REGISTER_READ_PORTS: UINT = 1; +pub const D3D12_VS_OUTPUT_REGISTER_COMPONENTS: UINT = 4; +pub const D3D12_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT: UINT = 32; +pub const D3D12_VS_OUTPUT_REGISTER_COUNT: UINT = 32; +pub const D3D12_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT: UINT = 10; +pub const D3D12_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP: UINT = 25; +pub const D3D12_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP: UINT = 25; +pub type D3D12_GPU_VIRTUAL_ADDRESS = UINT64; +ENUM!{enum D3D12_COMMAND_LIST_TYPE { + D3D12_COMMAND_LIST_TYPE_DIRECT = 0, + D3D12_COMMAND_LIST_TYPE_BUNDLE = 1, + D3D12_COMMAND_LIST_TYPE_COMPUTE = 2, + D3D12_COMMAND_LIST_TYPE_COPY = 3, +}} +ENUM!{enum D3D12_COMMAND_QUEUE_FLAGS { + D3D12_COMMAND_QUEUE_FLAG_NONE = 0x0, + D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT = 0x1, +}} +ENUM!{enum D3D12_COMMAND_QUEUE_PRIORITY { + D3D12_COMMAND_QUEUE_PRIORITY_NORMAL = 0, + D3D12_COMMAND_QUEUE_PRIORITY_HIGH = 100, + D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME = 10000, +}} +STRUCT!{struct D3D12_COMMAND_QUEUE_DESC { + Type: D3D12_COMMAND_LIST_TYPE, + Priority: INT, + Flags: D3D12_COMMAND_QUEUE_FLAGS, + NodeMask: UINT, +}} +ENUM!{enum D3D12_PRIMITIVE_TOPOLOGY_TYPE { + D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED = 0, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT = 1, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE = 2, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE = 3, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH = 4, +}} +ENUM!{enum D3D12_INPUT_CLASSIFICATION { + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA = 0, + D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA = 1, +}} +STRUCT!{struct D3D12_INPUT_ELEMENT_DESC { + SemanticName: LPCSTR, + SemanticIndex: UINT, + Format: DXGI_FORMAT, + InputSlot: UINT, + AlignedByteOffset: UINT, + InputSlotClass: D3D12_INPUT_CLASSIFICATION, + InstanceDataStepRate: UINT, +}} +ENUM!{enum D3D12_FILL_MODE { + D3D12_FILL_MODE_WIREFRAME = 2, + D3D12_FILL_MODE_SOLID = 3, +}} +pub type D3D12_PRIMITIVE_TOPOLOGY = D3D_PRIMITIVE_TOPOLOGY; +pub type D3D12_PRIMITIVE = D3D_PRIMITIVE; +ENUM!{enum D3D12_CULL_MODE { + D3D12_CULL_MODE_NONE = 1, + D3D12_CULL_MODE_FRONT = 2, + D3D12_CULL_MODE_BACK = 3, +}} +STRUCT!{struct D3D12_SO_DECLARATION_ENTRY { + Stream: UINT, + SemanticName: LPCSTR, + SemanticIndex: UINT, + StartComponent: BYTE, + ComponentCount: BYTE, + OutputSlot: BYTE, +}} +STRUCT!{struct D3D12_VIEWPORT { + TopLeftX: FLOAT, + TopLeftY: FLOAT, + Width: FLOAT, + Height: FLOAT, + MinDepth: FLOAT, + MaxDepth: FLOAT, +}} +pub type D3D12_RECT = RECT; +STRUCT!{struct D3D12_BOX { + left: UINT, + top: UINT, + front: UINT, + right: UINT, + bottom: UINT, + back: UINT, +}} +ENUM!{enum D3D12_COMPARISON_FUNC { + D3D12_COMPARISON_FUNC_NEVER = 1, + D3D12_COMPARISON_FUNC_LESS = 2, + D3D12_COMPARISON_FUNC_EQUAL = 3, + D3D12_COMPARISON_FUNC_LESS_EQUAL = 4, + D3D12_COMPARISON_FUNC_GREATER = 5, + D3D12_COMPARISON_FUNC_NOT_EQUAL = 6, + D3D12_COMPARISON_FUNC_GREATER_EQUAL = 7, + D3D12_COMPARISON_FUNC_ALWAYS = 8, +}} +ENUM!{enum D3D12_DEPTH_WRITE_MASK { + D3D12_DEPTH_WRITE_MASK_ZERO = 0, + D3D12_DEPTH_WRITE_MASK_ALL = 1, +}} +ENUM!{enum D3D12_STENCIL_OP { + D3D12_STENCIL_OP_KEEP = 1, + D3D12_STENCIL_OP_ZERO = 2, + D3D12_STENCIL_OP_REPLACE = 3, + D3D12_STENCIL_OP_INCR_SAT = 4, + D3D12_STENCIL_OP_DECR_SAT = 5, + D3D12_STENCIL_OP_INVERT = 6, + D3D12_STENCIL_OP_INCR = 7, + D3D12_STENCIL_OP_DECR = 8, +}} +STRUCT!{struct D3D12_DEPTH_STENCILOP_DESC { + StencilFailOp: D3D12_STENCIL_OP, + StencilDepthFailOp: D3D12_STENCIL_OP, + StencilPassOp: D3D12_STENCIL_OP, + StencilFunc: D3D12_COMPARISON_FUNC, +}} +STRUCT!{struct D3D12_DEPTH_STENCIL_DESC { + DepthEnable: BOOL, + DepthWriteMask: D3D12_DEPTH_WRITE_MASK, + DepthFunc: D3D12_COMPARISON_FUNC, + StencilEnable: BOOL, + StencilReadMask: UINT8, + StencilWriteMask: UINT8, + FrontFace: D3D12_DEPTH_STENCILOP_DESC, + BackFace: D3D12_DEPTH_STENCILOP_DESC, +}} +STRUCT!{struct D3D12_DEPTH_STENCIL_DESC1 { + DepthEnable: BOOL, + DepthWriteMask: D3D12_DEPTH_WRITE_MASK, + DepthFunc: D3D12_COMPARISON_FUNC, + StencilEnable: BOOL, + StencilReadMask: UINT8, + StencilWriteMask: UINT8, + FrontFace: D3D12_DEPTH_STENCILOP_DESC, + BackFace: D3D12_DEPTH_STENCILOP_DESC, + DepthBoundsTestEnable: BOOL, +}} +ENUM!{enum D3D12_BLEND { + D3D12_BLEND_ZERO = 1, + D3D12_BLEND_ONE = 2, + D3D12_BLEND_SRC_COLOR = 3, + D3D12_BLEND_INV_SRC_COLOR = 4, + D3D12_BLEND_SRC_ALPHA = 5, + D3D12_BLEND_INV_SRC_ALPHA = 6, + D3D12_BLEND_DEST_ALPHA = 7, + D3D12_BLEND_INV_DEST_ALPHA = 8, + D3D12_BLEND_DEST_COLOR = 9, + D3D12_BLEND_INV_DEST_COLOR = 10, + D3D12_BLEND_SRC_ALPHA_SAT = 11, + D3D12_BLEND_BLEND_FACTOR = 14, + D3D12_BLEND_INV_BLEND_FACTOR = 15, + D3D12_BLEND_SRC1_COLOR = 16, + D3D12_BLEND_INV_SRC1_COLOR = 17, + D3D12_BLEND_SRC1_ALPHA = 18, + D3D12_BLEND_INV_SRC1_ALPHA = 19, +}} +ENUM!{enum D3D12_BLEND_OP { + D3D12_BLEND_OP_ADD = 1, + D3D12_BLEND_OP_SUBTRACT = 2, + D3D12_BLEND_OP_REV_SUBTRACT = 3, + D3D12_BLEND_OP_MIN = 4, + D3D12_BLEND_OP_MAX = 5, +}} +ENUM!{enum D3D12_COLOR_WRITE_ENABLE { + D3D12_COLOR_WRITE_ENABLE_RED = 1, + D3D12_COLOR_WRITE_ENABLE_GREEN = 2, + D3D12_COLOR_WRITE_ENABLE_BLUE = 4, + D3D12_COLOR_WRITE_ENABLE_ALPHA = 8, + D3D12_COLOR_WRITE_ENABLE_ALL = D3D12_COLOR_WRITE_ENABLE_RED | D3D12_COLOR_WRITE_ENABLE_GREEN + | D3D12_COLOR_WRITE_ENABLE_BLUE | D3D12_COLOR_WRITE_ENABLE_ALPHA, +}} +ENUM!{enum D3D12_LOGIC_OP { + D3D12_LOGIC_OP_CLEAR = 0, + D3D12_LOGIC_OP_SET = 1, + D3D12_LOGIC_OP_COPY = 2, + D3D12_LOGIC_OP_COPY_INVERTED = 3, + D3D12_LOGIC_OP_NOOP = 4, + D3D12_LOGIC_OP_INVERT = 5, + D3D12_LOGIC_OP_AND = 6, + D3D12_LOGIC_OP_NAND = 7, + D3D12_LOGIC_OP_OR = 8, + D3D12_LOGIC_OP_NOR = 9, + D3D12_LOGIC_OP_XOR = 10, + D3D12_LOGIC_OP_EQUIV = 11, + D3D12_LOGIC_OP_AND_REVERSE = 12, + D3D12_LOGIC_OP_AND_INVERTED = 13, + D3D12_LOGIC_OP_OR_REVERSE = 14, + D3D12_LOGIC_OP_OR_INVERTED = 15, +}} +STRUCT!{struct D3D12_RENDER_TARGET_BLEND_DESC { + BlendEnable: BOOL, + LogicOpEnable: BOOL, + SrcBlend: D3D12_BLEND, + DestBlend: D3D12_BLEND, + BlendOp: D3D12_BLEND_OP, + SrcBlendAlpha: D3D12_BLEND, + DestBlendAlpha: D3D12_BLEND, + BlendOpAlpha: D3D12_BLEND_OP, + LogicOp: D3D12_LOGIC_OP, + RenderTargetWriteMask: UINT8, +}} +STRUCT!{struct D3D12_BLEND_DESC { + AlphaToCoverageEnable: BOOL, + IndependentBlendEnable: BOOL, + RenderTarget: [D3D12_RENDER_TARGET_BLEND_DESC; 8], +}} +ENUM!{enum D3D12_CONSERVATIVE_RASTERIZATION_MODE { + D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0, + D3D12_CONSERVATIVE_RASTERIZATION_MODE_ON = 1, +}} +STRUCT!{struct D3D12_RASTERIZER_DESC { + FillMode: D3D12_FILL_MODE, + CullMode: D3D12_CULL_MODE, + FrontCounterClockwise: BOOL, + DepthBias: INT, + DepthBiasClamp: FLOAT, + SlopeScaledDepthBias: FLOAT, + DepthClipEnable: BOOL, + MultisampleEnable: BOOL, + AntialiasedLineEnable: BOOL, + ForcedSampleCount: UINT, + ConservativeRaster: D3D12_CONSERVATIVE_RASTERIZATION_MODE, +}} +RIDL!{#[uuid(0xc54a6b66, 0x72df, 0x4ee8, 0x8b, 0xe5, 0xa9, 0x46, 0xa1, 0x42, 0x92, 0x14)] +interface ID3D12RootSignature(ID3D12RootSignatureVtbl): + ID3D12DeviceChild(ID3D12DeviceChildVtbl) {}} +STRUCT!{struct D3D12_SHADER_BYTECODE { + pShaderBytecode: *const c_void, + BytecodeLength: SIZE_T, +}} +STRUCT!{struct D3D12_STREAM_OUTPUT_DESC { + pSODeclaration: *const D3D12_SO_DECLARATION_ENTRY, + NumEntries: UINT, + pBufferStrides: *const UINT, + NumStrides: UINT, + RasterizedStream: UINT, +}} +STRUCT!{struct D3D12_INPUT_LAYOUT_DESC { + pInputElementDescs: *const D3D12_INPUT_ELEMENT_DESC, + NumElements: UINT, +}} +ENUM!{enum D3D12_INDEX_BUFFER_STRIP_CUT_VALUE { + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED = 0, + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF = 1, + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF = 2, +}} +STRUCT!{struct D3D12_CACHED_PIPELINE_STATE { + pCachedBlob: *const c_void, + CachedBlobSizeInBytes: SIZE_T, +}} +ENUM!{enum D3D12_PIPELINE_STATE_FLAGS { + D3D12_PIPELINE_STATE_FLAG_NONE = 0, + D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG = 0x1, +}} +STRUCT!{struct D3D12_GRAPHICS_PIPELINE_STATE_DESC { + pRootSignature: *mut ID3D12RootSignature, + VS: D3D12_SHADER_BYTECODE, + PS: D3D12_SHADER_BYTECODE, + DS: D3D12_SHADER_BYTECODE, + HS: D3D12_SHADER_BYTECODE, + GS: D3D12_SHADER_BYTECODE, + StreamOutput: D3D12_STREAM_OUTPUT_DESC, + BlendState: D3D12_BLEND_DESC, + SampleMask: UINT, + RasterizerState: D3D12_RASTERIZER_DESC, + DepthStencilState: D3D12_DEPTH_STENCIL_DESC, + InputLayout: D3D12_INPUT_LAYOUT_DESC, + IBStripCutValue: D3D12_INDEX_BUFFER_STRIP_CUT_VALUE, + PrimitiveTopologyType: D3D12_PRIMITIVE_TOPOLOGY_TYPE, + NumRenderTargets: UINT, + RTVFormats: [DXGI_FORMAT; 8], + DSVFormat: DXGI_FORMAT, + SampleDesc: DXGI_SAMPLE_DESC, + NodeMask: UINT, + CachedPSO: D3D12_CACHED_PIPELINE_STATE, + Flags: D3D12_PIPELINE_STATE_FLAGS, +}} +STRUCT!{struct D3D12_COMPUTE_PIPELINE_STATE_DESC { + pRootSignature: *mut ID3D12RootSignature, + CS: D3D12_SHADER_BYTECODE, + NodeMask: UINT, + CachedPSO: D3D12_CACHED_PIPELINE_STATE, + Flags: D3D12_PIPELINE_STATE_FLAGS, +}} +STRUCT!{struct D3D12_RT_FORMAT_ARRAY { + RTFormats: [DXGI_FORMAT; 8], + NumRenderTargets: UINT, +}} +STRUCT!{struct D3D12_PIPELINE_STATE_STREAM_DESC { + SizeInBytes: SIZE_T, + pPipelineStateSubobjectStream: *mut c_void, +}} +ENUM!{enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE { + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE = 0, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS = 1, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS = 2, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS = 3, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS = 4, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS = 5, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS = 6, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT = 7, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND = 8, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK = 9, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER = 10, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL = 11, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT = 12, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE = 13, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY = 14, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS = 15, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT = 16, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC = 17, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK = 18, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO = 19, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS = 20, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1 = 21, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID = 22, +}} +ENUM!{enum D3D12_FEATURE { + D3D12_FEATURE_D3D12_OPTIONS = 0, + D3D12_FEATURE_ARCHITECTURE = 1, + D3D12_FEATURE_FEATURE_LEVELS = 2, + D3D12_FEATURE_FORMAT_SUPPORT = 3, + D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS = 4, + D3D12_FEATURE_FORMAT_INFO = 5, + D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = 6, + D3D12_FEATURE_SHADER_MODEL = 7, + D3D12_FEATURE_D3D12_OPTIONS1 = 8, + D3D12_FEATURE_ROOT_SIGNATURE = 12, + D3D12_FEATURE_ARCHITECTURE1 = 16, + D3D12_FEATURE_D3D12_OPTIONS2 = 18, + D3D12_FEATURE_SHADER_CACHE = 19, + D3D12_FEATURE_COMMAND_QUEUE_PRIORITY = 20, +}} +ENUM!{enum D3D12_SHADER_MIN_PRECISION_SUPPORT { + D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE = 0, + D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT = 0x1, + D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT = 0x2, +}} +ENUM!{enum D3D12_TILED_RESOURCES_TIER { + D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED = 0, + D3D12_TILED_RESOURCES_TIER_1 = 1, + D3D12_TILED_RESOURCES_TIER_2 = 2, + D3D12_TILED_RESOURCES_TIER_3 = 3, +}} +ENUM!{enum D3D12_RESOURCE_BINDING_TIER { + D3D12_RESOURCE_BINDING_TIER_1 = 1, + D3D12_RESOURCE_BINDING_TIER_2 = 2, + D3D12_RESOURCE_BINDING_TIER_3 = 3, +}} +ENUM!{enum D3D12_CONSERVATIVE_RASTERIZATION_TIER { + D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED = 0, + D3D12_CONSERVATIVE_RASTERIZATION_TIER_1 = 1, + D3D12_CONSERVATIVE_RASTERIZATION_TIER_2 = 2, + D3D12_CONSERVATIVE_RASTERIZATION_TIER_3 = 3, +}} +ENUM!{enum D3D12_FORMAT_SUPPORT1 { + D3D12_FORMAT_SUPPORT1_NONE = 0, + D3D12_FORMAT_SUPPORT1_BUFFER = 0x1, + D3D12_FORMAT_SUPPORT1_IA_VERTEX_BUFFER = 0x2, + D3D12_FORMAT_SUPPORT1_IA_INDEX_BUFFER = 0x4, + D3D12_FORMAT_SUPPORT1_SO_BUFFER = 0x8, + D3D12_FORMAT_SUPPORT1_TEXTURE1D = 0x10, + D3D12_FORMAT_SUPPORT1_TEXTURE2D = 0x20, + D3D12_FORMAT_SUPPORT1_TEXTURE3D = 0x40, + D3D12_FORMAT_SUPPORT1_TEXTURECUBE = 0x80, + D3D12_FORMAT_SUPPORT1_SHADER_LOAD = 0x100, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE = 0x200, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON = 0x400, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_MONO_TEXT = 0x800, + D3D12_FORMAT_SUPPORT1_MIP = 0x1000, + D3D12_FORMAT_SUPPORT1_RENDER_TARGET = 0x4000, + D3D12_FORMAT_SUPPORT1_BLENDABLE = 0x8000, + D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL = 0x10000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RESOLVE = 0x40000, + D3D12_FORMAT_SUPPORT1_DISPLAY = 0x80000, + D3D12_FORMAT_SUPPORT1_CAST_WITHIN_BIT_LAYOUT = 0x100000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RENDERTARGET = 0x200000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_LOAD = 0x400000, + D3D12_FORMAT_SUPPORT1_SHADER_GATHER = 0x800000, + D3D12_FORMAT_SUPPORT1_BACK_BUFFER_CAST = 0x1000000, + D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000, + D3D12_FORMAT_SUPPORT1_SHADER_GATHER_COMPARISON = 0x4000000, + D3D12_FORMAT_SUPPORT1_DECODER_OUTPUT = 0x8000000, + D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_OUTPUT = 0x10000000, + D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_INPUT = 0x20000000, + D3D12_FORMAT_SUPPORT1_VIDEO_ENCODER = 0x40000000, +}} +ENUM!{enum D3D12_FORMAT_SUPPORT2 { + D3D12_FORMAT_SUPPORT2_NONE = 0, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20, + D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40, + D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80, + D3D12_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x100, + D3D12_FORMAT_SUPPORT2_TILED = 0x200, + D3D12_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000, +}} +ENUM!{enum D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS { + D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE = 0, + D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_TILED_RESOURCE = 0x1, +}} +ENUM!{enum D3D12_CROSS_NODE_SHARING_TIER { + D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED = 0, + D3D12_CROSS_NODE_SHARING_TIER_1_EMULATED = 1, + D3D12_CROSS_NODE_SHARING_TIER_1 = 2, + D3D12_CROSS_NODE_SHARING_TIER_2 = 3, +}} +ENUM!{enum D3D12_RESOURCE_HEAP_TIER { + D3D12_RESOURCE_HEAP_TIER_1 = 1, + D3D12_RESOURCE_HEAP_TIER_2 = 2, +}} +ENUM!{enum D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER { + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED = 0, + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_1 = 1, + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2 = 2, +}} +STRUCT!{struct D3D12_FEATURE_DATA_D3D12_OPTIONS { + DoublePrecisionFloatShaderOps: BOOL, + OutputMergerLogicOp: BOOL, + MinPrecisionSupport: D3D12_SHADER_MIN_PRECISION_SUPPORT, + TiledResourcesTier: D3D12_TILED_RESOURCES_TIER, + ResourceBindingTier: D3D12_RESOURCE_BINDING_TIER, + PSSpecifiedStencilRefSupported: BOOL, + TypedUAVLoadAdditionalFormats: BOOL, + ROVsSupported: BOOL, + ConservativeRasterizationTier: D3D12_CONSERVATIVE_RASTERIZATION_TIER, + MaxGPUVirtualAddressBitsPerResource: UINT, + StandardSwizzle64KBSupported: BOOL, + CrossNodeSharingTier: D3D12_CROSS_NODE_SHARING_TIER, + CrossAdapterRowMajorTextureSupported: BOOL, + VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation: BOOL, + ResourceHeapTier: D3D12_RESOURCE_HEAP_TIER, +}} +STRUCT!{struct D3D12_FEATURE_DATA_D3D12_OPTIONS1 { + WaveOps: BOOL, + WaveLaneCountMin: UINT, + WaveLaneCountMax: UINT, + TotalLaneCount: UINT, + ExpandedComputeResourceStates: BOOL, + Int64ShaderOps: BOOL, +}} +STRUCT!{struct D3D12_FEATURE_DATA_D3D12_OPTIONS2 { + DepthBoundsTestSupported: BOOL, + ProgrammableSamplePositionsTier: D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER, +}} +ENUM!{enum D3D_ROOT_SIGNATURE_VERSION { + D3D_ROOT_SIGNATURE_VERSION_1 = 0x1, + D3D_ROOT_SIGNATURE_VERSION_1_0 = 0x1, + D3D_ROOT_SIGNATURE_VERSION_1_1 = 0x2, +}} +STRUCT!{struct D3D12_FEATURE_DATA_ROOT_SIGNATURE { + HighestVersion: D3D_ROOT_SIGNATURE_VERSION, +}} +STRUCT!{struct D3D12_FEATURE_DATA_ARCHITECTURE { + NodeIndex: UINT, + TileBasedRenderer: BOOL, + UMA: BOOL, + CacheCoherentUMA: BOOL, +}} +STRUCT!{struct D3D12_FEATURE_DATA_ARCHITECTURE1 { + NodeIndex: UINT, + TileBasedRenderer: BOOL, + UMA: BOOL, + CacheCoherentUMA: BOOL, + IsolatedMMU: BOOL, +}} +STRUCT!{struct D3D12_FEATURE_DATA_FEATURE_LEVELS { + NumFeatureLevels: UINT, + pFeatureLevelsRequested: *const D3D_FEATURE_LEVEL, + MaxSupportedFeatureLevel: D3D_FEATURE_LEVEL, +}} +ENUM!{enum D3D_SHADER_MODEL { + D3D_SHADER_MODEL_5_1 = 0x51, + D3D_SHADER_MODEL_6_0 = 0x60, +}} +STRUCT!{struct D3D12_FEATURE_DATA_SHADER_MODEL { + HighestShaderModel: D3D_SHADER_MODEL, +}} +STRUCT!{struct D3D12_FEATURE_DATA_FORMAT_SUPPORT { + Format: DXGI_FORMAT, + Support1: D3D12_FORMAT_SUPPORT1, + Support2: D3D12_FORMAT_SUPPORT2, +}} +STRUCT!{struct D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS { + Format: DXGI_FORMAT, + SampleCount: UINT, + Flags: D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS, + NumQualityLevels: UINT, +}} +STRUCT!{struct D3D12_FEATURE_DATA_FORMAT_INFO { + Format: DXGI_FORMAT, + PlaneCount: UINT8, +}} +STRUCT!{struct D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT { + MaxGPUVirtualAddressBitsPerResource: UINT, + MaxGPUVirtualAddressBitsPerProcess: UINT, +}} +ENUM!{enum D3D12_SHADER_CACHE_SUPPORT_FLAGS { + D3D12_SHADER_CACHE_SUPPORT_NONE = 0, + D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO = 0x1, + D3D12_SHADER_CACHE_SUPPORT_LIBRARY = 0x2, + D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE = 0x4, + D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x8, +}} +STRUCT!{struct D3D12_FEATURE_DATA_SHADER_CACHE { + SupportFlags: D3D12_SHADER_CACHE_SUPPORT_FLAGS, +}} +STRUCT!{struct D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY { + CommandListType: D3D12_COMMAND_LIST_TYPE, + Priority: UINT, + PriorityForTypeIsSupported: BOOL, +}} +STRUCT!{struct D3D12_RESOURCE_ALLOCATION_INFO { + SizeInBytes: UINT64, + Alignment: UINT64, +}} +ENUM!{enum D3D12_HEAP_TYPE { + D3D12_HEAP_TYPE_DEFAULT = 1, + D3D12_HEAP_TYPE_UPLOAD = 2, + D3D12_HEAP_TYPE_READBACK = 3, + D3D12_HEAP_TYPE_CUSTOM = 4, +}} +ENUM!{enum D3D12_CPU_PAGE_PROPERTY { + D3D12_CPU_PAGE_PROPERTY_UNKNOWN = 0, + D3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLE = 1, + D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE = 2, + D3D12_CPU_PAGE_PROPERTY_WRITE_BACK = 3, +}} +ENUM!{enum D3D12_MEMORY_POOL { + D3D12_MEMORY_POOL_UNKNOWN = 0, + D3D12_MEMORY_POOL_L0 = 1, + D3D12_MEMORY_POOL_L1 = 2, +}} +STRUCT!{struct D3D12_HEAP_PROPERTIES { + Type: D3D12_HEAP_TYPE, + CPUPageProperty: D3D12_CPU_PAGE_PROPERTY, + MemoryPoolPreference: D3D12_MEMORY_POOL, + CreationNodeMask: UINT, + VisibleNodeMask: UINT, +}} +ENUM!{enum D3D12_HEAP_FLAGS { + D3D12_HEAP_FLAG_NONE = 0, + D3D12_HEAP_FLAG_SHARED = 0x1, + D3D12_HEAP_FLAG_DENY_BUFFERS = 0x4, + D3D12_HEAP_FLAG_ALLOW_DISPLAY = 0x8, + D3D12_HEAP_FLAG_SHARED_CROSS_ADAPTER = 0x20, + D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES = 0x40, + D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES = 0x80, + D3D12_HEAP_FLAG_HARDWARE_PROTECTED = 0x100, + D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH = 0x200, + D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0, + D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS = 0xc0, + D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES = 0x44, + D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES = 0x84, +}} +STRUCT!{struct D3D12_HEAP_DESC { + SizeInBytes: UINT64, + Properties: D3D12_HEAP_PROPERTIES, + Alignment: UINT64, + Flags: D3D12_HEAP_FLAGS, +}} +ENUM!{enum D3D12_RESOURCE_DIMENSION { + D3D12_RESOURCE_DIMENSION_UNKNOWN = 0, + D3D12_RESOURCE_DIMENSION_BUFFER = 1, + D3D12_RESOURCE_DIMENSION_TEXTURE1D = 2, + D3D12_RESOURCE_DIMENSION_TEXTURE2D = 3, + D3D12_RESOURCE_DIMENSION_TEXTURE3D = 4, +}} +ENUM!{enum D3D12_TEXTURE_LAYOUT { + D3D12_TEXTURE_LAYOUT_UNKNOWN = 0, + D3D12_TEXTURE_LAYOUT_ROW_MAJOR = 1, + D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE = 2, + D3D12_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE = 3, +}} +ENUM!{enum D3D12_RESOURCE_FLAGS { + D3D12_RESOURCE_FLAG_NONE = 0, + D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET = 0x1, + D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL = 0x2, + D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS = 0x4, + D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE = 0x8, + D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER = 0x10, + D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS = 0x20, +}} +STRUCT!{struct D3D12_RESOURCE_DESC { + Dimension: D3D12_RESOURCE_DIMENSION, + Alignment: UINT64, + Width: UINT64, + Height: UINT, + DepthOrArraySize: UINT16, + MipLevels: UINT16, + Format: DXGI_FORMAT, + SampleDesc: DXGI_SAMPLE_DESC, + Layout: D3D12_TEXTURE_LAYOUT, + Flags: D3D12_RESOURCE_FLAGS, +}} +STRUCT!{struct D3D12_DEPTH_STENCIL_VALUE { + Depth: FLOAT, + Stencil: UINT8, +}} +UNION!{union D3D12_CLEAR_VALUE_u { + [u32; 4], + Color Color_mut: [FLOAT; 4], + DepthStencil DepthStencil_mut: D3D12_DEPTH_STENCIL_VALUE, +}} +STRUCT!{struct D3D12_CLEAR_VALUE { + Format: DXGI_FORMAT, + u: D3D12_CLEAR_VALUE_u, +}} +STRUCT!{struct D3D12_RANGE { + Begin: SIZE_T, + End: SIZE_T, +}} +STRUCT!{struct D3D12_RANGE_UINT64 { + Begin: UINT64, + End: UINT64, +}} +STRUCT!{struct D3D12_SUBRESOURCE_RANGE_UINT64 { + Subresource: UINT, + Range: D3D12_RANGE_UINT64, +}} +STRUCT!{struct D3D12_SUBRESOURCE_INFO { + Offset: UINT64, + RowPitch: UINT, + DepthPitch: UINT, +}} +STRUCT!{struct D3D12_TILED_RESOURCE_COORDINATE { + X: UINT, + Y: UINT, + Z: UINT, + Subresource: UINT, +}} +STRUCT!{struct D3D12_TILE_REGION_SIZE { + NumTiles: UINT, + UseBox: BOOL, + Width: UINT, + Height: UINT16, + Depth: UINT16, +}} +ENUM!{enum D3D12_TILE_RANGE_FLAGS { + D3D12_TILE_RANGE_FLAG_NONE = 0, + D3D12_TILE_RANGE_FLAG_NULL = 1, + D3D12_TILE_RANGE_FLAG_SKIP = 2, + D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE = 4, +}} +STRUCT!{struct D3D12_SUBRESOURCE_TILING { + WidthInTiles: UINT, + HeightInTiles: UINT16, + DepthInTiles: UINT16, + StartTileIndexInOverallResource: UINT, +}} +STRUCT!{struct D3D12_TILE_SHAPE { + WidthInTexels: UINT, + HeightInTexels: UINT, + DepthInTexels: UINT, +}} +STRUCT!{struct D3D12_PACKED_MIP_INFO { + NumStandardMips: UINT8, + NumPackedMips: UINT8, + NumTilesForPackedMips: UINT, + StartTileIndexInOverallResource: UINT, +}} +ENUM!{enum D3D12_TILE_MAPPING_FLAGS { + D3D12_TILE_MAPPING_FLAG_NONE = 0, + D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1, +}} +ENUM!{enum D3D12_TILE_COPY_FLAGS { + D3D12_TILE_COPY_FLAG_NONE = 0, + D3D12_TILE_COPY_FLAG_NO_HAZARD = 0x1, + D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE = 0x2, + D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER = 0x4, +}} +ENUM!{enum D3D12_RESOURCE_STATES { + D3D12_RESOURCE_STATE_COMMON = 0, + D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER = 0x1, + D3D12_RESOURCE_STATE_INDEX_BUFFER = 0x2, + D3D12_RESOURCE_STATE_RENDER_TARGET = 0x4, + D3D12_RESOURCE_STATE_UNORDERED_ACCESS = 0x8, + D3D12_RESOURCE_STATE_DEPTH_WRITE = 0x10, + D3D12_RESOURCE_STATE_DEPTH_READ = 0x20, + D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE = 0x40, + D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE = 0x80, + D3D12_RESOURCE_STATE_STREAM_OUT = 0x100, + D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT = 0x200, + D3D12_RESOURCE_STATE_COPY_DEST = 0x400, + D3D12_RESOURCE_STATE_COPY_SOURCE = 0x800, + D3D12_RESOURCE_STATE_RESOLVE_DEST = 0x1000, + D3D12_RESOURCE_STATE_RESOLVE_SOURCE = 0x2000, + D3D12_RESOURCE_STATE_GENERIC_READ = 0x1 | 0x2 | 0x40 | 0x80 | 0x200 | 0x800, + D3D12_RESOURCE_STATE_PRESENT = 0, + D3D12_RESOURCE_STATE_PREDICATION = 0x200, +}} +ENUM!{enum D3D12_RESOURCE_BARRIER_TYPE { + D3D12_RESOURCE_BARRIER_TYPE_TRANSITION = 0, + D3D12_RESOURCE_BARRIER_TYPE_ALIASING = 1, + D3D12_RESOURCE_BARRIER_TYPE_UAV = 2, +}} +STRUCT!{struct D3D12_RESOURCE_TRANSITION_BARRIER { + pResource: *mut ID3D12Resource, + Subresource: UINT, + StateBefore: D3D12_RESOURCE_STATES, + StateAfter: D3D12_RESOURCE_STATES, +}} +STRUCT!{struct D3D12_RESOURCE_ALIASING_BARRIER { + pResourceBefore: *mut ID3D12Resource, + pResourceAfter: *mut ID3D12Resource, +}} +STRUCT!{struct D3D12_RESOURCE_UAV_BARRIER { + pResource: *mut ID3D12Resource, +}} +ENUM!{enum D3D12_RESOURCE_BARRIER_FLAGS { + D3D12_RESOURCE_BARRIER_FLAG_NONE = 0x0, + D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY = 0x1, + D3D12_RESOURCE_BARRIER_FLAG_END_ONLY = 0x2, +}} +UNION!{union D3D12_RESOURCE_BARRIER_u { + [u32; 4] [u64; 3], + Transition Transition_mut: D3D12_RESOURCE_TRANSITION_BARRIER, + Aliasing Aliasing_mut: D3D12_RESOURCE_ALIASING_BARRIER, + UAV UAV_mut: D3D12_RESOURCE_UAV_BARRIER, +}} +STRUCT!{struct D3D12_RESOURCE_BARRIER { + Type: D3D12_RESOURCE_BARRIER_TYPE, + Flags: D3D12_RESOURCE_BARRIER_FLAGS, + u: D3D12_RESOURCE_BARRIER_u, +}} +STRUCT!{struct D3D12_SUBRESOURCE_FOOTPRINT { + Format: DXGI_FORMAT, + Width: UINT, + Height: UINT, + Depth: UINT, + RowPitch: UINT, +}} +STRUCT!{struct D3D12_PLACED_SUBRESOURCE_FOOTPRINT { + Offset: UINT64, + Footprint: D3D12_SUBRESOURCE_FOOTPRINT, +}} +ENUM!{enum D3D12_TEXTURE_COPY_TYPE { + D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX = 0, + D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT = 1, +}} +UNION!{union D3D12_TEXTURE_COPY_LOCATION_u { + [u64; 4], + PlacedFootprint PlacedFootprint_mut: D3D12_PLACED_SUBRESOURCE_FOOTPRINT, + SubresourceIndex SubresourceIndex_mut: UINT, +}} +STRUCT!{struct D3D12_TEXTURE_COPY_LOCATION { + pResource: *mut ID3D12Resource, + Type: D3D12_TEXTURE_COPY_TYPE, + u: D3D12_TEXTURE_COPY_LOCATION_u, +}} +ENUM!{enum D3D12_RESOLVE_MODE { + D3D12_RESOLVE_MODE_DECOMPRESS = 0, + D3D12_RESOLVE_MODE_MIN = 1, + D3D12_RESOLVE_MODE_MAX = 2, + D3D12_RESOLVE_MODE_AVERAGE = 3, +}} +STRUCT!{struct D3D12_SAMPLE_POSITION { + X: INT8, + Y: INT8, +}} +ENUM!{enum D3D12_SHADER_COMPONENT_MAPPING { + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0 = 0, + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1 = 1, + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_2 = 2, + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_3 = 3, + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0 = 4, + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1 = 5, +}} +pub const D3D12_SHADER_COMPONENT_MAPPING_MASK: UINT = 0x7; +pub const D3D12_SHADER_COMPONENT_MAPPING_SHIFT: UINT = 3; +pub const D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES: UINT = 1 + << (D3D12_SHADER_COMPONENT_MAPPING_SHIFT * 4); +// D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING +// D3D12_DECODE_SHADER_4_COMPONENT_MAPPING +// D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING +ENUM!{enum D3D12_BUFFER_SRV_FLAGS { + D3D12_BUFFER_SRV_FLAG_NONE = 0x0, + D3D12_BUFFER_SRV_FLAG_RAW = 0x1, +}} +STRUCT!{struct D3D12_BUFFER_SRV { + FirstElement: UINT64, + NumElements: UINT, + StructureByteStride: UINT, + Flags: D3D12_BUFFER_SRV_FLAGS, +}} +STRUCT!{struct D3D12_TEX1D_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, + ResourceMinLODClamp: FLOAT, +}} +STRUCT!{struct D3D12_TEX1D_ARRAY_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, + ResourceMinLODClamp: FLOAT, +}} +STRUCT!{struct D3D12_TEX2D_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, + PlaneSlice: UINT, + ResourceMinLODClamp: FLOAT, +}} +STRUCT!{struct D3D12_TEX2D_ARRAY_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, + PlaneSlice: UINT, + ResourceMinLODClamp: FLOAT, +}} +STRUCT!{struct D3D12_TEX3D_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, + ResourceMinLODClamp: FLOAT, +}} +STRUCT!{struct D3D12_TEXCUBE_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, + ResourceMinLODClamp: FLOAT, +}} +STRUCT!{struct D3D12_TEXCUBE_ARRAY_SRV { + MostDetailedMip: UINT, + MipLevels: UINT, + First2DArrayFace: UINT, + NumCubes: UINT, + ResourceMinLODClamp: FLOAT, +}} +STRUCT!{struct D3D12_TEX2DMS_SRV { + UnusedField_NothingToDefine: UINT, +}} +STRUCT!{struct D3D12_TEX2DMS_ARRAY_SRV { + FirstArraySlice: UINT, + ArraySize: UINT, +}} +ENUM!{enum D3D12_SRV_DIMENSION { + D3D12_SRV_DIMENSION_UNKNOWN = 0, + D3D12_SRV_DIMENSION_BUFFER = 1, + D3D12_SRV_DIMENSION_TEXTURE1D = 2, + D3D12_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D12_SRV_DIMENSION_TEXTURE2D = 4, + D3D12_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D12_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D12_SRV_DIMENSION_TEXTURE3D = 8, + D3D12_SRV_DIMENSION_TEXTURECUBE = 9, + D3D12_SRV_DIMENSION_TEXTURECUBEARRAY = 10, +}} +UNION!{union D3D12_SHADER_RESOURCE_VIEW_DESC_u { + [u64; 3], + Buffer Buffer_mut: D3D12_BUFFER_SRV, + Texture1D Texture1D_mut: D3D12_TEX1D_SRV, + Texture1DArray Texture1DArray_mut: D3D12_TEX1D_ARRAY_SRV, + Texture2D Texture2D_mut: D3D12_TEX2D_SRV, + Texture2DArray Texture2DArray_mut: D3D12_TEX2D_ARRAY_SRV, + Texture2DMS Texture2DMS_mut: D3D12_TEX2DMS_SRV, + Texture2DMSArray Texture2DMSArray_mut: D3D12_TEX2DMS_ARRAY_SRV, + Texture3D Texture3D_mut: D3D12_TEX3D_SRV, + TextureCube TextureCube_mut: D3D12_TEXCUBE_SRV, + TextureCubeArray TextureCubeArray_mut: D3D12_TEXCUBE_ARRAY_SRV, +}} +STRUCT!{struct D3D12_SHADER_RESOURCE_VIEW_DESC { + Format: DXGI_FORMAT, + ViewDimension: D3D12_SRV_DIMENSION, + Shader4ComponentMapping: UINT, + u: D3D12_SHADER_RESOURCE_VIEW_DESC_u, +}} +STRUCT!{struct D3D12_CONSTANT_BUFFER_VIEW_DESC { + BufferLocation: D3D12_GPU_VIRTUAL_ADDRESS, + SizeInBytes: UINT, +}} +ENUM!{enum D3D12_FILTER { + D3D12_FILTER_MIN_MAG_MIP_POINT = 0, + D3D12_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1, + D3D12_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4, + D3D12_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5, + D3D12_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, + D3D12_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, + D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, + D3D12_FILTER_MIN_MAG_MIP_LINEAR = 0x15, + D3D12_FILTER_ANISOTROPIC = 0x55, + D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, + D3D12_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, + D3D12_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84, + D3D12_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85, + D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90, + D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91, + D3D12_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94, + D3D12_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95, + D3D12_FILTER_COMPARISON_ANISOTROPIC = 0xd5, + D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100, + D3D12_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101, + D3D12_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x104, + D3D12_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x105, + D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x110, + D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111, + D3D12_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114, + D3D12_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115, + D3D12_FILTER_MINIMUM_ANISOTROPIC = 0x155, + D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180, + D3D12_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181, + D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x184, + D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x185, + D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x190, + D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191, + D3D12_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194, + D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195, + D3D12_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5, +}} +ENUM!{enum D3D12_FILTER_TYPE { + D3D12_FILTER_TYPE_POINT = 0, + D3D12_FILTER_TYPE_LINEAR = 1, +}} +ENUM!{enum D3D12_FILTER_REDUCTION_TYPE { + D3D12_FILTER_REDUCTION_TYPE_STANDARD = 0, + D3D12_FILTER_REDUCTION_TYPE_COMPARISON = 1, + D3D12_FILTER_REDUCTION_TYPE_MINIMUM = 2, + D3D12_FILTER_REDUCTION_TYPE_MAXIMUM = 3, +}} +pub const D3D12_FILTER_REDUCTION_TYPE_MASK: UINT = 0x3; +pub const D3D12_FILTER_REDUCTION_TYPE_SHIFT: UINT = 7; +pub const D3D12_FILTER_TYPE_MASK: UINT = 0x3; +pub const D3D12_MIN_FILTER_SHIFT: UINT = 4; +pub const D3D12_MAG_FILTER_SHIFT: UINT = 2; +pub const D3D12_MIP_FILTER_SHIFT: UINT = 0; +pub const D3D12_ANISOTROPIC_FILTERING_BIT: UINT = 0x40; +// D3D12_ENCODE_BASIC_FILTER +// D3D12_ENCODE_ANISOTROPIC_FILTER +// D3D12_DECODE_MIN_FILTER +// D3D12_DECODE_MAG_FILTER +// D3D12_DECODE_MIP_FILTER +// D3D12_DECODE_FILTER_REDUCTION +// D3D12_DECODE_IS_COMPARISON_FILTER +// D3D12_DECODE_IS_ANISOTROPIC_FILTER +ENUM!{enum D3D12_TEXTURE_ADDRESS_MODE { + D3D12_TEXTURE_ADDRESS_MODE_WRAP = 1, + D3D12_TEXTURE_ADDRESS_MODE_MIRROR = 2, + D3D12_TEXTURE_ADDRESS_MODE_CLAMP = 3, + D3D12_TEXTURE_ADDRESS_MODE_BORDER = 4, + D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE = 5, +}} +STRUCT!{struct D3D12_SAMPLER_DESC { + Filter: D3D12_FILTER, + AddressU: D3D12_TEXTURE_ADDRESS_MODE, + AddressV: D3D12_TEXTURE_ADDRESS_MODE, + AddressW: D3D12_TEXTURE_ADDRESS_MODE, + MipLODBias: FLOAT, + MaxAnisotropy: UINT, + ComparisonFunc: D3D12_COMPARISON_FUNC, + BorderColor: [FLOAT; 4], + MinLOD: FLOAT, + MaxLOD: FLOAT, +}} +ENUM!{enum D3D12_BUFFER_UAV_FLAGS { + D3D12_BUFFER_UAV_FLAG_NONE = 0, + D3D12_BUFFER_UAV_FLAG_RAW = 0x1, +}} +STRUCT!{struct D3D12_BUFFER_UAV { + FirstElement: UINT64, + NumElements: UINT, + StructureByteStride: UINT, + CounterOffsetInBytes: UINT64, + Flags: D3D12_BUFFER_UAV_FLAGS, +}} +STRUCT!{struct D3D12_TEX1D_UAV { + MipSlice: UINT, +}} +STRUCT!{struct D3D12_TEX1D_ARRAY_UAV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D12_TEX2D_UAV { + MipSlice: UINT, + PlaneSlice: UINT, +}} +STRUCT!{struct D3D12_TEX2D_ARRAY_UAV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, + PlaneSlice: UINT, +}} +STRUCT!{struct D3D12_TEX3D_UAV { + MipSlice: UINT, + FirstWSlice: UINT, + WSize: UINT, +}} +ENUM!{enum D3D12_UAV_DIMENSION { + D3D12_UAV_DIMENSION_UNKNOWN = 0, + D3D12_UAV_DIMENSION_BUFFER = 1, + D3D12_UAV_DIMENSION_TEXTURE1D = 2, + D3D12_UAV_DIMENSION_TEXTURE1DARRAY = 3, + D3D12_UAV_DIMENSION_TEXTURE2D = 4, + D3D12_UAV_DIMENSION_TEXTURE2DARRAY = 5, + D3D12_UAV_DIMENSION_TEXTURE3D = 8, +}} +UNION!{union D3D12_UNORDERED_ACCESS_VIEW_DESC_u { + [u64; 4], + Buffer Buffer_mut: D3D12_BUFFER_UAV, + Texture1D Texture1D_mut: D3D12_TEX1D_UAV, + Texture1DArray Texture1DArray_mut: D3D12_TEX1D_ARRAY_UAV, + Texture2D Texture2D_mut: D3D12_TEX2D_UAV, + Texture2DArray Texture2DArray_mut: D3D12_TEX2D_ARRAY_UAV, + Texture3D Texture3D_mut: D3D12_TEX3D_UAV, +}} +STRUCT!{struct D3D12_UNORDERED_ACCESS_VIEW_DESC { + Format: DXGI_FORMAT, + ViewDimension: D3D12_UAV_DIMENSION, + u: D3D12_UNORDERED_ACCESS_VIEW_DESC_u, +}} +STRUCT!{struct D3D12_BUFFER_RTV { + FirstElement: UINT64, + NumElements: UINT, +}} +STRUCT!{struct D3D12_TEX1D_RTV { + MipSlice: UINT, +}} +STRUCT!{struct D3D12_TEX1D_ARRAY_RTV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D12_TEX2D_RTV { + MipSlice: UINT, + PlaneSlice: UINT, +}} +STRUCT!{struct D3D12_TEX2DMS_RTV { + UnusedField_NothingToDefine: UINT, +}} +STRUCT!{struct D3D12_TEX2D_ARRAY_RTV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, + PlaneSlice: UINT, +}} +STRUCT!{struct D3D12_TEX2DMS_ARRAY_RTV { + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D12_TEX3D_RTV { + MipSlice: UINT, + FirstWSlice: UINT, + WSize: UINT, +}} +ENUM!{enum D3D12_RTV_DIMENSION { + D3D12_RTV_DIMENSION_UNKNOWN = 0, + D3D12_RTV_DIMENSION_BUFFER = 1, + D3D12_RTV_DIMENSION_TEXTURE1D = 2, + D3D12_RTV_DIMENSION_TEXTURE1DARRAY = 3, + D3D12_RTV_DIMENSION_TEXTURE2D = 4, + D3D12_RTV_DIMENSION_TEXTURE2DARRAY = 5, + D3D12_RTV_DIMENSION_TEXTURE2DMS = 6, + D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D12_RTV_DIMENSION_TEXTURE3D = 8, +}} +UNION!{union D3D12_RENDER_TARGET_VIEW_DESC_u { + [u64; 2], + Buffer Buffer_mut: D3D12_BUFFER_RTV, + Texture1D Texture1D_mut: D3D12_TEX1D_RTV, + Texture1DArray Texture1DArray_mut: D3D12_TEX1D_ARRAY_RTV, + Texture2D Texture2D_mut: D3D12_TEX2D_RTV, + Texture2DArray Texture2DArray_mut: D3D12_TEX2D_ARRAY_RTV, + Texture2DMS Texture2DMS_mut: D3D12_TEX2DMS_RTV, + Texture2DMSArray Texture2DMSArray_mut: D3D12_TEX2DMS_ARRAY_RTV, + Texture3D Texture3D_mut: D3D12_TEX3D_RTV, +}} +STRUCT!{struct D3D12_RENDER_TARGET_VIEW_DESC { + Format: DXGI_FORMAT, + ViewDimension: D3D12_RTV_DIMENSION, + u: D3D12_RENDER_TARGET_VIEW_DESC_u, +}} +STRUCT!{struct D3D12_TEX1D_DSV { + MipSlice: UINT, +}} +STRUCT!{struct D3D12_TEX1D_ARRAY_DSV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D12_TEX2D_DSV { + MipSlice: UINT, +}} +STRUCT!{struct D3D12_TEX2D_ARRAY_DSV { + MipSlice: UINT, + FirstArraySlice: UINT, + ArraySize: UINT, +}} +STRUCT!{struct D3D12_TEX2DMS_DSV { + UnusedField_NothingToDefine: UINT, +}} +STRUCT!{struct D3D12_TEX2DMS_ARRAY_DSV { + FirstArraySlice: UINT, + ArraySize: UINT, +}} +ENUM!{enum D3D12_DSV_FLAGS { + D3D12_DSV_FLAG_NONE = 0x0, + D3D12_DSV_FLAG_READ_ONLY_DEPTH = 0x1, + D3D12_DSV_FLAG_READ_ONLY_STENCIL = 0x2, +}} +ENUM!{enum D3D12_DSV_DIMENSION { + D3D12_DSV_DIMENSION_UNKNOWN = 0, + D3D12_DSV_DIMENSION_TEXTURE1D = 1, + D3D12_DSV_DIMENSION_TEXTURE1DARRAY = 2, + D3D12_DSV_DIMENSION_TEXTURE2D = 3, + D3D12_DSV_DIMENSION_TEXTURE2DARRAY = 4, + D3D12_DSV_DIMENSION_TEXTURE2DMS = 5, + D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY = 6, +}} +UNION!{union D3D12_DEPTH_STENCIL_VIEW_DESC_u { + [u32; 3], + Texture1D Texture1D_mut: D3D12_TEX1D_DSV, + Texture1DArray Texture1DArray_mut: D3D12_TEX1D_ARRAY_DSV, + Texture2D Texture2D_mut: D3D12_TEX2D_DSV, + Texture2DArray Texture2DArray_mut: D3D12_TEX2D_ARRAY_DSV, + Texture2DMS Texture2DMS_mut: D3D12_TEX2DMS_DSV, + Texture2DMSArray Texture2DMSArray_mut: D3D12_TEX2DMS_ARRAY_DSV, +}} +STRUCT!{struct D3D12_DEPTH_STENCIL_VIEW_DESC { + Format: DXGI_FORMAT, + ViewDimension: D3D12_DSV_DIMENSION, + Flags: D3D12_DSV_FLAGS, + u: D3D12_DEPTH_STENCIL_VIEW_DESC_u, +}} +ENUM!{enum D3D12_CLEAR_FLAGS { + D3D12_CLEAR_FLAG_DEPTH = 0x1, + D3D12_CLEAR_FLAG_STENCIL = 0x2, +}} +ENUM!{enum D3D12_FENCE_FLAGS { + D3D12_FENCE_FLAG_NONE = 0x0, + D3D12_FENCE_FLAG_SHARED = 0x1, + D3D12_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x2, +}} +ENUM!{enum D3D12_DESCRIPTOR_HEAP_TYPE { + D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV = 0, + D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER = 1, + D3D12_DESCRIPTOR_HEAP_TYPE_RTV = 2, + D3D12_DESCRIPTOR_HEAP_TYPE_DSV = 3, + D3D12_DESCRIPTOR_HEAP_TYPE_NUM_TYPES = 4, +}} +ENUM!{enum D3D12_DESCRIPTOR_HEAP_FLAGS { + D3D12_DESCRIPTOR_HEAP_FLAG_NONE = 0x0, + D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE = 0x1, +}} +STRUCT!{struct D3D12_DESCRIPTOR_HEAP_DESC { + Type: D3D12_DESCRIPTOR_HEAP_TYPE, + NumDescriptors: UINT, + Flags: D3D12_DESCRIPTOR_HEAP_FLAGS, + NodeMask: UINT, +}} +ENUM!{enum D3D12_DESCRIPTOR_RANGE_TYPE { + D3D12_DESCRIPTOR_RANGE_TYPE_SRV = 0, + D3D12_DESCRIPTOR_RANGE_TYPE_UAV = 1, + D3D12_DESCRIPTOR_RANGE_TYPE_CBV = 2, + D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER = 3, +}} +STRUCT!{struct D3D12_DESCRIPTOR_RANGE { + RangeType: D3D12_DESCRIPTOR_RANGE_TYPE, + NumDescriptors: UINT, + BaseShaderRegister: UINT, + RegisterSpace: UINT, + OffsetInDescriptorsFromTableStart: UINT, +}} +STRUCT!{struct D3D12_ROOT_DESCRIPTOR_TABLE { + NumDescriptorRanges: UINT, + pDescriptorRanges: *const D3D12_DESCRIPTOR_RANGE, +}} +STRUCT!{struct D3D12_ROOT_CONSTANTS { + ShaderRegister: UINT, + RegisterSpace: UINT, + Num32BitValues: UINT, +}} +STRUCT!{struct D3D12_ROOT_DESCRIPTOR { + ShaderRegister: UINT, + RegisterSpace: UINT, +}} +ENUM!{enum D3D12_SHADER_VISIBILITY { + D3D12_SHADER_VISIBILITY_ALL = 0, + D3D12_SHADER_VISIBILITY_VERTEX = 1, + D3D12_SHADER_VISIBILITY_HULL = 2, + D3D12_SHADER_VISIBILITY_DOMAIN = 3, + D3D12_SHADER_VISIBILITY_GEOMETRY = 4, + D3D12_SHADER_VISIBILITY_PIXEL = 5, +}} +ENUM!{enum D3D12_ROOT_PARAMETER_TYPE { + D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE = 0, + D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS = 1, + D3D12_ROOT_PARAMETER_TYPE_CBV = 2, + D3D12_ROOT_PARAMETER_TYPE_SRV = 3, + D3D12_ROOT_PARAMETER_TYPE_UAV = 4, +}} +UNION!{union D3D12_ROOT_PARAMETER_u { + [u32; 3] [u64; 2], + DescriptorTable DescriptorTable_mut: D3D12_ROOT_DESCRIPTOR_TABLE, + Constants Constants_mut: D3D12_ROOT_CONSTANTS, + Descriptor Descriptor_mut: D3D12_ROOT_DESCRIPTOR, +}} +STRUCT!{struct D3D12_ROOT_PARAMETER { + ParameterType: D3D12_ROOT_PARAMETER_TYPE, + u: D3D12_ROOT_PARAMETER_u, + ShaderVisibility: D3D12_SHADER_VISIBILITY, +}} +ENUM!{enum D3D12_ROOT_SIGNATURE_FLAGS { + D3D12_ROOT_SIGNATURE_FLAG_NONE = 0x0, + D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT = 0x1, + D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS = 0x2, + D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS = 0x4, + D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS = 0x8, + D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS = 0x10, + D3D12_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS = 0x20, + D3D12_ROOT_SIGNATURE_FLAG_ALLOW_STREAM_OUTPUT = 0x40, +}} +ENUM!{enum D3D12_STATIC_BORDER_COLOR { + D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK = 0, + D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK = 1, + D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE = 2, +}} +STRUCT!{struct D3D12_STATIC_SAMPLER_DESC { + Filter: D3D12_FILTER, + AddressU: D3D12_TEXTURE_ADDRESS_MODE, + AddressV: D3D12_TEXTURE_ADDRESS_MODE, + AddressW: D3D12_TEXTURE_ADDRESS_MODE, + MipLODBias: FLOAT, + MaxAnisotropy: UINT, + ComparisonFunc: D3D12_COMPARISON_FUNC, + BorderColor: D3D12_STATIC_BORDER_COLOR, + MinLOD: FLOAT, + MaxLOD: FLOAT, + ShaderRegister: UINT, + RegisterSpace: UINT, + ShaderVisibility: D3D12_SHADER_VISIBILITY, +}} +STRUCT!{struct D3D12_ROOT_SIGNATURE_DESC { + NumParameters: UINT, + pParameters: *const D3D12_ROOT_PARAMETER, + NumStaticSamplers: UINT, + pStaticSamplers: *const D3D12_STATIC_SAMPLER_DESC, + Flags: D3D12_ROOT_SIGNATURE_FLAGS, +}} +ENUM!{enum D3D12_DESCRIPTOR_RANGE_FLAGS { + D3D12_DESCRIPTOR_RANGE_FLAG_NONE = 0, + D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_VOLATILE = 0x1, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE = 0x2, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC = 0x8, +}} +STRUCT!{struct D3D12_DESCRIPTOR_RANGE1 { + RangeType: D3D12_DESCRIPTOR_RANGE_TYPE, + NumDescriptors: UINT, + BaseShaderRegister: UINT, + RegisterSpace: UINT, + Flags: D3D12_DESCRIPTOR_RANGE_FLAGS, + OffsetInDescriptorsFromTableStart: UINT, +}} +STRUCT!{struct D3D12_ROOT_DESCRIPTOR_TABLE1 { + NumDescriptorRanges: UINT, + pDescriptorRanges: *const D3D12_DESCRIPTOR_RANGE1, +}} +ENUM!{enum D3D12_ROOT_DESCRIPTOR_FLAGS { + D3D12_ROOT_DESCRIPTOR_FLAG_NONE = 0, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE = 0x2, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC = 0x8, +}} +STRUCT!{struct D3D12_ROOT_DESCRIPTOR1 { + ShaderRegister: UINT, + RegisterSpace: UINT, + Flags: D3D12_ROOT_DESCRIPTOR_FLAGS, +}} +UNION!{union D3D12_ROOT_PARAMETER1_u { + [u32; 3] [u64; 2], + DescriptorTable DescriptorTable_mut: D3D12_ROOT_DESCRIPTOR_TABLE1, + Constants Constants_mut: D3D12_ROOT_CONSTANTS, + Descriptor Descriptor_mut: D3D12_ROOT_DESCRIPTOR1, +}} +STRUCT!{struct D3D12_ROOT_PARAMETER1 { + ParameterType: D3D12_ROOT_PARAMETER_TYPE, + u: D3D12_ROOT_PARAMETER1_u, + ShaderVisibility: D3D12_SHADER_VISIBILITY, +}} +STRUCT!{struct D3D12_ROOT_SIGNATURE_DESC1 { + NumParameters: UINT, + pParameters: *const D3D12_ROOT_PARAMETER1, + NumStaticSamplers: UINT, + pStaticSamplers: *const D3D12_STATIC_SAMPLER_DESC, + Flags: D3D12_ROOT_SIGNATURE_FLAGS, +}} +UNION!{union D3D12_VERSIONED_ROOT_SIGNATURE_DESC_u { + [u32; 5] [u64; 5], + Desc_1_0 Desc_1_0_mut: D3D12_ROOT_SIGNATURE_DESC, + Desc_1_1 Desc_1_1_mut: D3D12_ROOT_SIGNATURE_DESC1, +}} +STRUCT!{struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC { + Version: UINT, + u: D3D12_VERSIONED_ROOT_SIGNATURE_DESC_u, +}} +RIDL!{#[uuid(0x34ab647b, 0x3cc8, 0x46ac, 0x84, 0x1b, 0xc0, 0x96, 0x56, 0x45, 0xc0, 0x46)] +interface ID3D12RootSignatureDeserializer(ID3D12RootSignatureDeserializerVtbl): + IUnknown(IUnknownVtbl) { + fn GetRootSignatureDesc() -> *const D3D12_ROOT_SIGNATURE_DESC, +}} +RIDL!{#[uuid(0x7f91ce67, 0x090c, 0x4bb7, 0xb7, 0x8e, 0xed, 0x8f, 0xf2, 0xe3, 0x1d, 0xa0)] +interface ID3D12VersionedRootSignatureDeserializer(ID3D12VersionedRootSignatureDeserializerVtbl): + IUnknown(IUnknownVtbl) { + fn GetRootSignatureDescAtVersion( + convertToVersion: D3D_ROOT_SIGNATURE_VERSION, + ppDesc: *mut *mut D3D12_VERSIONED_ROOT_SIGNATURE_DESC, + ) -> HRESULT, + fn GetUnconvertedRootSignatureDesc() -> *const D3D12_VERSIONED_ROOT_SIGNATURE_DESC, +}} +FN!{stdcall PFN_D3D12_SERIALIZE_ROOT_SIGNATURE( + pRootSignature: *const D3D12_ROOT_SIGNATURE_DESC, + Version: D3D_ROOT_SIGNATURE_VERSION, + ppBlob: *mut *mut ID3DBlob, + ppErrorBlob: *mut *mut ID3DBlob, +) -> HRESULT} +extern "system" { + pub fn D3D12SerializeRootSignature( + pRootSignature: *const D3D12_ROOT_SIGNATURE_DESC, + Version: D3D_ROOT_SIGNATURE_VERSION, + ppBlob: *mut *mut ID3DBlob, + ppErrorBlob: *mut *mut ID3DBlob, + ) -> HRESULT; +} +FN!{stdcall PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER( + pSrcData: LPCVOID, + SrcDataSizeInBytes: SIZE_T, + pRootSignatureDeserializerInterface: REFIID, + ppRootSignatureDeserializer: *mut *mut c_void, +) -> HRESULT} +extern "system" { + pub fn D3D12CreateRootSignatureDeserializer( + pSrcData: LPCVOID, + SrcDataSizeInBytes: SIZE_T, + pRootSignatureDeserializerInterface: REFGUID, + ppRootSignatureDeserializer: *mut *mut c_void, + ) -> HRESULT; +} +FN!{stdcall PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE( + pRootSignature: *const D3D12_VERSIONED_ROOT_SIGNATURE_DESC, + ppBlob: *mut *mut ID3DBlob, + ppErrorBlob: *mut *mut ID3DBlob, +) -> HRESULT} +extern "system" { + pub fn D3D12SerializeVersionedRootSignature( + pRootSignature: *const D3D12_VERSIONED_ROOT_SIGNATURE_DESC, + ppBlob: *mut *mut ID3DBlob, + ppErrorBlob: *mut *mut ID3DBlob, + ) -> HRESULT; +} +FN!{stdcall PFN_D3D12_CREATE_VERSIONED_ROOT_SIGNATURE_DESERIALIZER( + pSrcData: LPCVOID, + SrcDataSizeInBytes: SIZE_T, + pRootSignatureDeserializerInterface: REFIID, + ppRootSignatureDeserializer: *mut *mut c_void, +) -> HRESULT} +extern "system" { + pub fn D3D12CreateVersionedRootSignatureDeserializer( + pSrcData: LPCVOID, + SrcDataSizeInBytes: SIZE_T, + pRootSignatureDeserializerInterface: REFIID, + ppRootSignatureDeserializer: *mut *mut c_void, + ) -> HRESULT; +} +STRUCT!{struct D3D12_CPU_DESCRIPTOR_HANDLE { + ptr: SIZE_T, +}} +STRUCT!{struct D3D12_GPU_DESCRIPTOR_HANDLE { + ptr: UINT64, +}} +STRUCT!{struct D3D12_DISCARD_REGION { + NumRects: UINT, + pRects: *const D3D12_RECT, + FirstSubresource: UINT, + NumSubresources: UINT, +}} +ENUM!{enum D3D12_QUERY_HEAP_TYPE { + D3D12_QUERY_HEAP_TYPE_OCCLUSION = 0, + D3D12_QUERY_HEAP_TYPE_TIMESTAMP = 1, + D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS = 2, + D3D12_QUERY_HEAP_TYPE_SO_STATISTICS = 3, +}} +STRUCT!{struct D3D12_QUERY_HEAP_DESC { + Type: D3D12_QUERY_HEAP_TYPE, + Count: UINT, + NodeMask: UINT, +}} +ENUM!{enum D3D12_QUERY_TYPE { + D3D12_QUERY_TYPE_OCCLUSION = 0, + D3D12_QUERY_TYPE_BINARY_OCCLUSION = 1, + D3D12_QUERY_TYPE_TIMESTAMP = 2, + D3D12_QUERY_TYPE_PIPELINE_STATISTICS = 3, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0 = 4, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM1 = 5, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM2 = 6, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM3 = 7, +}} +ENUM!{enum D3D12_PREDICATION_OP { + D3D12_PREDICATION_OP_EQUAL_ZERO = 0, + D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1, +}} +STRUCT!{struct D3D12_QUERY_DATA_PIPELINE_STATISTICS { + IAVertices: UINT64, + IAPrimitives: UINT64, + VSInvocations: UINT64, + GSInvocations: UINT64, + GSPrimitives: UINT64, + CInvocations: UINT64, + CPrimitives: UINT64, + PSInvocations: UINT64, + HSInvocations: UINT64, + DSInvocations: UINT64, + CSInvocations: UINT64, +}} +STRUCT!{struct D3D12_QUERY_DATA_SO_STATISTICS { + NumPrimitivesWritten: UINT64, + PrimitivesStorageNeeded: UINT64, +}} +STRUCT!{struct D3D12_STREAM_OUTPUT_BUFFER_VIEW { + BufferLocation: D3D12_GPU_VIRTUAL_ADDRESS, + SizeInBytes: UINT64, + BufferFilledSizeLocation: D3D12_GPU_VIRTUAL_ADDRESS, +}} +STRUCT!{struct D3D12_DRAW_ARGUMENTS { + VertexCountPerInstance: UINT, + InstanceCount: UINT, + StartVertexLocation: UINT, + StartInstanceLocation: UINT, +}} +STRUCT!{struct D3D12_DRAW_INDEXED_ARGUMENTS { + IndexCountPerInstance: UINT, + InstanceCount: UINT, + StartIndexLocation: UINT, + BaseVertexLocation: INT, + StartInstanceLocation: UINT, +}} +STRUCT!{struct D3D12_DISPATCH_ARGUMENTS { + ThreadGroupCountX: UINT, + ThreadGroupCountY: UINT, + ThreadGroupCountZ: UINT, +}} +STRUCT!{struct D3D12_VERTEX_BUFFER_VIEW { + BufferLocation: D3D12_GPU_VIRTUAL_ADDRESS, + SizeInBytes: UINT, + StrideInBytes: UINT, +}} +STRUCT!{struct D3D12_INDEX_BUFFER_VIEW { + BufferLocation: D3D12_GPU_VIRTUAL_ADDRESS, + SizeInBytes: UINT, + Format: DXGI_FORMAT, +}} +ENUM!{enum D3D12_INDIRECT_ARGUMENT_TYPE { + D3D12_INDIRECT_ARGUMENT_TYPE_DRAW = 0, + D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED = 1, + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH = 2, + D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW = 3, + D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW = 4, + D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT = 5, + D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW = 6, + D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW = 7, + D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW = 8, +}} +STRUCT!{struct D3D12_INDIRECT_ARGUMENT_DESC_VertexBuffer { + Slot: UINT, +}} +STRUCT!{struct D3D12_INDIRECT_ARGUMENT_DESC_Constant { + RootParameterIndex: UINT, + DestOffsetIn32BitValues: UINT, + Num32BitValuesToSet: UINT, +}} +STRUCT!{struct D3D12_INDIRECT_ARGUMENT_DESC_ConstantBufferView { + RootParameterIndex: UINT, +}} +STRUCT!{struct D3D12_INDIRECT_ARGUMENT_DESC_ShaderResourceView { + RootParameterIndex: UINT, +}} +STRUCT!{struct D3D12_INDIRECT_ARGUMENT_DESC_UnorderedAccessView { + RootParameterIndex: UINT, +}} +UNION!{union D3D12_INDIRECT_ARGUMENT_DESC_u { + [u32; 3], + VertexBuffer VertexBuffer_mut: D3D12_INDIRECT_ARGUMENT_DESC_VertexBuffer, + Constant Constant_mut: D3D12_INDIRECT_ARGUMENT_DESC_Constant, + ConstantBufferView ConstantBufferView_mut: D3D12_INDIRECT_ARGUMENT_DESC_ConstantBufferView, + ShaderResourceView ShaderResourceView_mut: D3D12_INDIRECT_ARGUMENT_DESC_ShaderResourceView, + UnorderedAccessView UnorderedAccessView_mut: D3D12_INDIRECT_ARGUMENT_DESC_UnorderedAccessView, +}} +STRUCT!{struct D3D12_INDIRECT_ARGUMENT_DESC { + Type: D3D12_INDIRECT_ARGUMENT_TYPE, + u: D3D12_INDIRECT_ARGUMENT_DESC_u, +}} +STRUCT!{struct D3D12_COMMAND_SIGNATURE_DESC { + ByteStride: UINT, + NumArgumentDescs: UINT, + pArgumentDescs: *const D3D12_INDIRECT_ARGUMENT_DESC, + NodeMask: UINT, +}} +RIDL!{#[uuid(0xc4fec28f, 0x7966, 0x4e95, 0x9f, 0x94, 0xf4, 0x31, 0xcb, 0x56, 0xc3, 0xb8)] +interface ID3D12Object(ID3D12ObjectVtbl): IUnknown(IUnknownVtbl) { + fn GetPrivateData( + guid: REFGUID, + pDataSize: *mut UINT, + pData: *mut c_void, + ) -> HRESULT, + fn SetPrivateData( + guid: REFGUID, + DataSize: UINT, + pData: *const c_void, + ) -> HRESULT, + fn SetPrivateDataInterface( + guid: REFGUID, + pData: *const IUnknown, + ) -> HRESULT, + fn SetName( + Name: LPCWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x905db94b, 0xa00c, 0x4140, 0x9d, 0xf5, 0x2b, 0x64, 0xca, 0x9e, 0xa3, 0x57)] +interface ID3D12DeviceChild(ID3D12DeviceChildVtbl): ID3D12Object(ID3D12ObjectVtbl) { + fn GetDevice( + riid: REFIID, + ppvDevice: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x63ee58fb, 0x1268, 0x4835, 0x86, 0xda, 0xf0, 0x08, 0xce, 0x62, 0xf0, 0xd6)] +interface ID3D12Pageable(ID3D12PageableVtbl): ID3D12DeviceChild(ID3D12DeviceChildVtbl) {}} +RIDL!{#[uuid(0x6b3b2502, 0x6e51, 0x45b3, 0x90, 0xee, 0x98, 0x84, 0x26, 0x5e, 0x8d, 0xf3)] +interface ID3D12Heap(ID3D12HeapVtbl): ID3D12Pageable(ID3D12PageableVtbl) { + #[fixme] fn GetDesc() -> D3D12_HEAP_DESC, +}} +RIDL!{#[uuid(0x696442be, 0xa72e, 0x4059, 0xbc, 0x79, 0x5b, 0x5c, 0x98, 0x04, 0x0f, 0xad)] +interface ID3D12Resource(ID3D12ResourceVtbl): ID3D12Pageable(ID3D12PageableVtbl) { + fn Map( + Subresource: UINT, + pReadRange: *const D3D12_RANGE, + ppData: *mut *mut c_void, + ) -> HRESULT, + fn Unmap( + Subresource: UINT, + pWrittenRange: *const D3D12_RANGE, + ) -> (), + #[fixme] fn GetDesc() -> D3D12_RESOURCE_DESC, + fn GetGPUVirtualAddress() -> D3D12_GPU_VIRTUAL_ADDRESS, + fn WriteToSubresource( + DstSubresource: UINT, + pDstBox: *const D3D12_BOX, + pSrcData: *const c_void, + SrcRowPitch: UINT, + SrcDepthPitch: UINT, + ) -> HRESULT, + fn ReadFromSubresource( + pDstData: *mut c_void, + DstRowPitch: UINT, + DstDepthPitch: UINT, + SrcSubresource: UINT, + pSrcBox: *const D3D12_BOX, + ) -> HRESULT, + fn GetHeapProperties( + pHeapProperties: *mut D3D12_HEAP_PROPERTIES, + pHeapFlags: *mut D3D12_HEAP_FLAGS, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6102dee4, 0xaf59, 0x4b09, 0xb9, 0x99, 0xb4, 0x4d, 0x73, 0xf0, 0x9b, 0x24)] +interface ID3D12CommandAllocator(ID3D12CommandAllocatorVtbl): ID3D12Pageable(ID3D12PageableVtbl) { + fn Reset() -> HRESULT, +}} +RIDL!{#[uuid(0x0a753dcf, 0xc4d8, 0x4b91, 0xad, 0xf6, 0xbe, 0x5a, 0x60, 0xd9, 0x5a, 0x76)] +interface ID3D12Fence(ID3D12FenceVtbl): ID3D12Pageable(ID3D12PageableVtbl) { + fn GetCompletedValue() -> UINT64, + fn SetEventOnCompletion( + Value: UINT64, + hEvent: HANDLE, + ) -> HRESULT, + fn Signal( + Value: UINT64, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x765a30f3, 0xf624, 0x4c6f, 0xa8, 0x28, 0xac, 0xe9, 0x48, 0x62, 0x24, 0x45)] +interface ID3D12PipelineState(ID3D12PipelineStateVtbl): ID3D12Pageable(ID3D12PageableVtbl) { + fn GetCachedBlob( + ppBlob: *mut *mut ID3DBlob, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8efb471d, 0x616c, 0x4f49, 0x90, 0xf7, 0x12, 0x7b, 0xb7, 0x63, 0xfa, 0x51)] +interface ID3D12DescriptorHeap(ID3D12DescriptorHeapVtbl): ID3D12Pageable(ID3D12PageableVtbl) { + #[fixme] fn GetDesc() -> D3D12_DESCRIPTOR_HEAP_DESC, + #[fixme] fn GetCPUDescriptorHandleForHeapStart() -> D3D12_CPU_DESCRIPTOR_HANDLE, + #[fixme] fn GetGPUDescriptorHandleForHeapStart() -> D3D12_GPU_DESCRIPTOR_HANDLE, +}} +RIDL!{#[uuid(0x0d9658ae, 0xed45, 0x469e, 0xa6, 0x1d, 0x97, 0x0e, 0xc5, 0x83, 0xca, 0xb4)] +interface ID3D12QueryHeap(ID3D12QueryHeapVtbl): ID3D12Pageable(ID3D12PageableVtbl) {}} +RIDL!{#[uuid(0xc36a797c, 0xec80, 0x4f0a, 0x89, 0x85, 0xa7, 0xb2, 0x47, 0x50, 0x82, 0xd1)] +interface ID3D12CommandSignature(ID3D12CommandSignatureVtbl): + ID3D12Pageable(ID3D12PageableVtbl) {}} +RIDL!{#[uuid(0x7116d91c, 0xe7e4, 0x47ce, 0xb8, 0xc6, 0xec, 0x81, 0x68, 0xf4, 0x37, 0xe5)] +interface ID3D12CommandList(ID3D12CommandListVtbl): ID3D12DeviceChild(ID3D12DeviceChildVtbl) { + fn GetType() -> D3D12_COMMAND_LIST_TYPE, +}} +RIDL!{#[uuid(0x5b160d0f, 0xac1b, 0x4185, 0x8b, 0xa8, 0xb3, 0xae, 0x42, 0xa5, 0xa4, 0x55)] +interface ID3D12GraphicsCommandList(ID3D12GraphicsCommandListVtbl): + ID3D12CommandList(ID3D12CommandListVtbl) { + fn Close() -> HRESULT, + fn Reset( + pAllocator: *mut ID3D12CommandAllocator, + pInitialState: *mut ID3D12PipelineState, + ) -> HRESULT, + fn ClearState( + pPipelineState: *mut ID3D12PipelineState, + ) -> (), + fn DrawInstanced( + VertexCountPerInstance: UINT, + InstanceCount: UINT, + StartVertexLocation: UINT, + StartInstanceLocation: UINT, + ) -> (), + fn DrawIndexedInstanced( + IndexCountPerInstance: UINT, + InstanceCount: UINT, + StartIndexLocation: UINT, + BaseVertexLocation: INT, + StartInstanceLocation: UINT, + ) -> (), + fn Dispatch( + ThreadGroupCountX: UINT, + ThreadGroupCountY: UINT, + ThreadGroupCountZ: UINT, + ) -> (), + fn CopyBufferRegion( + pDstBuffer: *mut ID3D12Resource, + DstOffset: UINT64, + pSrcBuffer: *mut ID3D12Resource, + SrcOffset: UINT64, + NumBytes: UINT64, + ) -> (), + fn CopyTextureRegion( + pDst: *const D3D12_TEXTURE_COPY_LOCATION, + DstX: UINT, + DstY: UINT, + DstZ: UINT, + pSrc: *const D3D12_TEXTURE_COPY_LOCATION, + pSrcBox: *const D3D12_BOX, + ) -> (), + fn CopyResource( + pDstResource: *mut ID3D12Resource, + pSrcResource: *mut ID3D12Resource, + ) -> (), + fn CopyTiles( + pTiledResource: *mut ID3D12Resource, + pTileRegionStartCoordinate: *const D3D12_TILED_RESOURCE_COORDINATE, + pTileRegionSize: *const D3D12_TILE_REGION_SIZE, + pBuffer: *mut ID3D12Resource, + BufferStartOffsetInBytes: UINT64, + Flags: D3D12_TILE_COPY_FLAGS, + ) -> (), + fn ResolveSubresource( + pDstResource: *mut ID3D12Resource, + DstSubresource: UINT, + pSrcResource: *mut ID3D12Resource, + SrcSubresource: UINT, + Format: DXGI_FORMAT, + ) -> (), + fn IASetPrimitiveTopology( + PrimitiveTopology: D3D12_PRIMITIVE_TOPOLOGY, + ) -> (), + fn RSSetViewports( + NumViewports: UINT, + pViewports: *const D3D12_VIEWPORT, + ) -> (), + fn RSSetScissorRects( + NumRects: UINT, + pRects: *const D3D12_RECT, + ) -> (), + fn OMSetBlendFactor( + BlendFactor: *const [FLOAT; 4], + ) -> (), + fn OMSetStencilRef( + StencilRef: UINT, + ) -> (), + fn SetPipelineState( + pPipelineState: *mut ID3D12PipelineState, + ) -> (), + fn ResourceBarrier( + NumBarriers: UINT, + pBarriers: *const D3D12_RESOURCE_BARRIER, + ) -> (), + fn ExecuteBundle( + pCommandList: *mut ID3D12GraphicsCommandList, + ) -> (), + fn SetDescriptorHeaps( + NumDescriptorHeaps: UINT, + ppDescriptorHeaps: *mut *mut ID3D12DescriptorHeap, + ) -> (), + fn SetComputeRootSignature( + pRootSignature: *mut ID3D12RootSignature, + ) -> (), + fn SetGraphicsRootSignature( + pRootSignature: *mut ID3D12RootSignature, + ) -> (), + fn SetComputeRootDescriptorTable( + RootParameterIndex: UINT, + BaseDescriptor: D3D12_GPU_DESCRIPTOR_HANDLE, + ) -> (), + fn SetGraphicsRootDescriptorTable( + RootParameterIndex: UINT, + BaseDescriptor: D3D12_GPU_DESCRIPTOR_HANDLE, + ) -> (), + fn SetComputeRoot32BitConstant( + RootParameterIndex: UINT, + SrcData: UINT, + DestOffsetIn32BitValues: UINT, + ) -> (), + fn SetGraphicsRoot32BitConstant( + RootParameterIndex: UINT, + SrcData: UINT, + DestOffsetIn32BitValues: UINT, + ) -> (), + fn SetComputeRoot32BitConstants( + RootParameterIndex: UINT, + Num32BitValuesToSet: UINT, + pSrcData: *const c_void, + DestOffsetIn32BitValues: UINT, + ) -> (), + fn SetGraphicsRoot32BitConstants( + RootParameterIndex: UINT, + Num32BitValuesToSet: UINT, + pSrcData: *const c_void, + DestOffsetIn32BitValues: UINT, + ) -> (), + fn SetComputeRootConstantBufferView( + RootParameterIndex: UINT, + BufferLocation: D3D12_GPU_VIRTUAL_ADDRESS, + ) -> (), + fn SetGraphicsRootConstantBufferView( + RootParameterIndex: UINT, + BufferLocation: D3D12_GPU_VIRTUAL_ADDRESS, + ) -> (), + fn SetComputeRootShaderResourceView( + RootParameterIndex: UINT, + BufferLocation: D3D12_GPU_VIRTUAL_ADDRESS, + ) -> (), + fn SetGraphicsRootShaderResourceView( + RootParameterIndex: UINT, + BufferLocation: D3D12_GPU_VIRTUAL_ADDRESS, + ) -> (), + fn SetComputeRootUnorderedAccessView( + RootParameterIndex: UINT, + BufferLocation: D3D12_GPU_VIRTUAL_ADDRESS, + ) -> (), + fn SetGraphicsRootUnorderedAccessView( + RootParameterIndex: UINT, + BufferLocation: D3D12_GPU_VIRTUAL_ADDRESS, + ) -> (), + fn IASetIndexBuffer( + pView: *const D3D12_INDEX_BUFFER_VIEW, + ) -> (), + fn IASetVertexBuffers( + StartSlot: UINT, + NumViews: UINT, + pViews: *const D3D12_VERTEX_BUFFER_VIEW, + ) -> (), + fn SOSetTargets( + StartSlot: UINT, + NumViews: UINT, + pViews: *const D3D12_STREAM_OUTPUT_BUFFER_VIEW, + ) -> (), + fn OMSetRenderTargets( + NumRenderTargetDescriptors: UINT, + pRenderTargetDescriptors: *const D3D12_CPU_DESCRIPTOR_HANDLE, + RTsSingleHandleToDescriptorRange: BOOL, + pDepthStencilDescriptor: *const D3D12_CPU_DESCRIPTOR_HANDLE, + ) -> (), + fn ClearDepthStencilView( + DepthStencilView: D3D12_CPU_DESCRIPTOR_HANDLE, + ClearFlags: D3D12_CLEAR_FLAGS, + Depth: FLOAT, + Stencil: UINT8, + NumRects: UINT, + pRects: *const D3D12_RECT, + ) -> (), + fn ClearRenderTargetView( + RenderTargetView: D3D12_CPU_DESCRIPTOR_HANDLE, + ColorRGBA: *const [FLOAT; 4], + NumRects: UINT, + pRects: *const D3D12_RECT, + ) -> (), + fn ClearUnorderedAccessViewUint( + ViewGPUHandleInCurrentHeap: D3D12_GPU_DESCRIPTOR_HANDLE, + ViewCPUHandle: D3D12_CPU_DESCRIPTOR_HANDLE, + pResource: *mut ID3D12Resource, + Values: *const [UINT; 4], + NumRects: UINT, + pRects: *const D3D12_RECT, + ) -> (), + fn ClearUnorderedAccessViewFloat( + ViewGPUHandleInCurrentHeap: D3D12_GPU_DESCRIPTOR_HANDLE, + ViewCPUHandle: D3D12_CPU_DESCRIPTOR_HANDLE, + pResource: *mut ID3D12Resource, + Values: *const [FLOAT; 4], + NumRects: UINT, + pRects: *const D3D12_RECT, + ) -> (), + fn DiscardResource( + pResource: *mut ID3D12Resource, + pRegion: *const D3D12_DISCARD_REGION, + ) -> (), + fn BeginQuery( + pQueryHeap: *mut ID3D12QueryHeap, + Type: D3D12_QUERY_TYPE, + Index: UINT, + ) -> (), + fn EndQuery( + pQueryHeap: *mut ID3D12QueryHeap, + Type: D3D12_QUERY_TYPE, + Index: UINT, + ) -> (), + fn ResolveQueryData( + pQueryHeap: *mut ID3D12QueryHeap, + Type: D3D12_QUERY_TYPE, + StartIndex: UINT, + NumQueries: UINT, + pDestinationBuffer: *mut ID3D12Resource, + AlignedDestinationBufferOffset: UINT64, + ) -> (), + fn SetPredication( + pBuffer: *mut ID3D12Resource, + AlignedBufferOffset: UINT64, + Operation: D3D12_PREDICATION_OP, + ) -> (), + fn SetMarker( + Metadata: UINT, + pData: *const c_void, + Size: UINT, + ) -> (), + fn BeginEvent( + Metadata: UINT, + pData: *const c_void, + Size: UINT, + ) -> (), + fn EndEvent() -> (), + fn ExecuteIndirect( + pCommandSignature: *mut ID3D12CommandSignature, + MaxCommandCount: UINT, + pArgumentBuffer: *mut ID3D12Resource, + ArgumentBufferOffset: UINT64, + pCountBuffer: *mut ID3D12Resource, + CountBufferOffset: UINT64, + ) -> (), +}} +RIDL!{#[uuid(0x553103fb, 0x1fe7, 0x4557, 0xbb, 0x38, 0x94, 0x6d, 0x7d, 0x0e, 0x7c, 0xa7)] +interface ID3D12GraphicsCommandList1(ID3D12GraphicsCommandList1Vtbl): + ID3D12GraphicsCommandList(ID3D12GraphicsCommandListVtbl) { + fn AtomicCopyBufferUINT( + pDstBuffer: *mut ID3D12Resource, + DstOffset: UINT64, + pSrcBuffer: *mut ID3D12Resource, + SrcOffset: UINT64, + Dependencies: UINT, + ppDependentResources: *const *mut ID3D12Resource, + pDependentSubresourceRanges: *mut D3D12_SUBRESOURCE_RANGE_UINT64, + ) -> (), + fn AtomicCopyBufferUINT64( + pDstBuffer: *mut ID3D12Resource, + DstOffset: UINT64, + pSrcBuffer: *mut ID3D12Resource, + SrcOffset: UINT64, + Dependencies: UINT, + ppDependentResources: *const *mut ID3D12Resource, + pDependentSubresourceRanges: *mut D3D12_SUBRESOURCE_RANGE_UINT64, + ) -> (), + fn OMSetDepthBounds( + Min: FLOAT, + Max: FLOAT, + ) -> (), + fn SetSamplePositions( + NumSamplesPerPixel: UINT, + NumPixels: UINT, + pSamplePositions: *mut D3D12_SAMPLE_POSITION, + ) -> (), + fn ResolveSubresourceRegion( + pDstResource: *mut ID3D12Resource, + DstSubresource: UINT, + DstX: UINT, + DstY: UINT, + pSrcResource: *mut ID3D12Resource, + SrcSubresource: UINT, + pSrcRect: *mut D3D12_RECT, + Format: DXGI_FORMAT, + ResolveMode: D3D12_RESOLVE_MODE, + ) -> (), +}} +RIDL!{#[uuid(0x0ec870a6, 0x5d7e, 0x4c22, 0x8c, 0xfc, 0x5b, 0xaa, 0xe0, 0x76, 0x16, 0xed)] +interface ID3D12CommandQueue(ID3D12CommandQueueVtbl): ID3D12Pageable(ID3D12PageableVtbl) { + fn UpdateTileMappings( + pResource: *mut ID3D12Resource, + NumResourceRegions: UINT, + pResourceRegionStartCoordinates: *const D3D12_TILED_RESOURCE_COORDINATE, + pResourceRegionSizes: *const D3D12_TILE_REGION_SIZE, + pHeap: *mut ID3D12Heap, + NumRanges: UINT, + pRangeFlags: *const D3D12_TILE_RANGE_FLAGS, + pHeapRangeStartOffsets: *const UINT, + pRangeTileCounts: *const UINT, + Flags: D3D12_TILE_MAPPING_FLAGS, + ) -> (), + fn CopyTileMappings( + pDstResource: *mut ID3D12Resource, + pDstRegionStartCoordinate: *const D3D12_TILED_RESOURCE_COORDINATE, + pSrcResource: *mut ID3D12Resource, + pSrcRegionStartCoordinate: *const D3D12_TILED_RESOURCE_COORDINATE, + pRegionSize: *const D3D12_TILE_REGION_SIZE, + Flags: D3D12_TILE_MAPPING_FLAGS, + ) -> (), + fn ExecuteCommandLists( + NumCommandLists: UINT, + ppCommandLists: *const *mut ID3D12CommandList, + ) -> (), + fn SetMarker( + Metadata: UINT, + pData: *const c_void, + Size: UINT, + ) -> (), + fn BeginEvent( + Metadata: UINT, + pData: *const c_void, + Size: UINT, + ) -> (), + fn EndEvent() -> (), + fn Signal( + pFence: *mut ID3D12Fence, + Value: UINT64, + ) -> HRESULT, + fn Wait( + pFence: *mut ID3D12Fence, + Value: UINT64, + ) -> HRESULT, + fn GetTimestampFrequency( + pFrequency: *mut UINT64, + ) -> HRESULT, + fn GetClockCalibration( + pGpuTimestamp: *mut UINT64, + pCpuTimestamp: *mut UINT64, + ) -> HRESULT, + #[fixme] fn GetDesc() -> D3D12_COMMAND_QUEUE_DESC, +}} +RIDL!{#[uuid(0x189819f1, 0x1db6, 0x4b57, 0xbe, 0x54, 0x18, 0x21, 0x33, 0x9b, 0x85, 0xf7)] +interface ID3D12Device(ID3D12DeviceVtbl): ID3D12Object(ID3D12ObjectVtbl) { + fn GetNodeCount() -> UINT, + fn CreateCommandQueue( + pDesc: *const D3D12_COMMAND_QUEUE_DESC, + riid: REFGUID, + ppCommandQueue: *mut *mut c_void, + ) -> HRESULT, + fn CreateCommandAllocator( + type_: D3D12_COMMAND_LIST_TYPE, + riid: REFGUID, + ppCommandAllocator: *mut *mut c_void, + ) -> HRESULT, + fn CreateGraphicsPipelineState( + pDesc: *const D3D12_GRAPHICS_PIPELINE_STATE_DESC, + riid: REFGUID, + ppPipelineState: *mut *mut c_void, + ) -> HRESULT, + fn CreateComputePipelineState( + pDesc: *const D3D12_COMPUTE_PIPELINE_STATE_DESC, + riid: REFGUID, + ppPipelineState: *mut *mut c_void, + ) -> HRESULT, + fn CreateCommandList( + nodeMask: UINT, + type_: D3D12_COMMAND_LIST_TYPE, + pCommandAllocator: *mut ID3D12CommandAllocator, + pInitialState: *mut ID3D12PipelineState, + riid: REFGUID, + ppCommandList: *mut *mut c_void, + ) -> HRESULT, + fn CheckFeatureSupport( + Feature: D3D12_FEATURE, + pFeatureSupportData: *mut c_void, + FeatureSupportDataSize: UINT, + ) -> HRESULT, + fn CreateDescriptorHeap( + pDescriptorHeapDesc: *const D3D12_DESCRIPTOR_HEAP_DESC, + riid: REFGUID, + ppvHeap: *mut *mut c_void, + ) -> HRESULT, + fn GetDescriptorHandleIncrementSize( + DescriptorHeapType: D3D12_DESCRIPTOR_HEAP_TYPE, + ) -> UINT, + fn CreateRootSignature( + nodeMask: UINT, + pBlobWithRootSignature: *const c_void, + blobLengthInBytes: SIZE_T, + riid: REFGUID, + ppvRootSignature: *mut *mut c_void, + ) -> HRESULT, + fn CreateConstantBufferView( + pDesc: *const D3D12_CONSTANT_BUFFER_VIEW_DESC, + DestDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE, + ) -> (), + fn CreateShaderResourceView( + pResource: *mut ID3D12Resource, + pDesc: *const D3D12_SHADER_RESOURCE_VIEW_DESC, + DestDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE, + ) -> (), + fn CreateUnorderedAccessView( + pResource: *mut ID3D12Resource, + pCounterResource: *mut ID3D12Resource, + pDesc: *const D3D12_UNORDERED_ACCESS_VIEW_DESC, + DestDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE, + ) -> (), + fn CreateRenderTargetView( + pResource: *mut ID3D12Resource, + pDesc: *const D3D12_RENDER_TARGET_VIEW_DESC, + DestDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE, + ) -> (), + fn CreateDepthStencilView( + pResource: *mut ID3D12Resource, + pDesc: *const D3D12_DEPTH_STENCIL_VIEW_DESC, + DestDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE, + ) -> (), + fn CreateSampler( + pDesc: *const D3D12_SAMPLER_DESC, + DestDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE, + ) -> (), + fn CopyDescriptors( + NumDestDescriptorRanges: UINT, + pDestDescriptorRangeStarts: *const D3D12_CPU_DESCRIPTOR_HANDLE, + pDestDescriptorRangeSizes: *const UINT, + NumSrcDescriptorRanges: UINT, + pSrcDescriptorRangeStarts: *const D3D12_CPU_DESCRIPTOR_HANDLE, + pSrcDescriptorRangeSizes: *const UINT, + DescriptorHeapsType: D3D12_DESCRIPTOR_HEAP_TYPE, + ) -> (), + fn CopyDescriptorsSimple( + NumDescriptors: UINT, + DestDescriptorRangeStart: D3D12_CPU_DESCRIPTOR_HANDLE, + SrcDescriptorRangeStart: D3D12_CPU_DESCRIPTOR_HANDLE, + DescriptorHeapsType: D3D12_DESCRIPTOR_HEAP_TYPE, + ) -> (), + #[fixme] fn GetResourceAllocationInfo( + visibleMask: UINT, + numResourceDescs: UINT, + pResourceDescs: *const D3D12_RESOURCE_DESC, + ) -> D3D12_RESOURCE_ALLOCATION_INFO, + #[fixme] fn GetCustomHeapProperties( + nodeMask: UINT, + heapType: D3D12_HEAP_TYPE, + ) -> D3D12_HEAP_PROPERTIES, + fn CreateCommittedResource( + pHeapProperties: *const D3D12_HEAP_PROPERTIES, + HeapFlags: D3D12_HEAP_FLAGS, + pResourceDesc: *const D3D12_RESOURCE_DESC, + InitialResourceState: D3D12_RESOURCE_STATES, + pOptimizedClearValue: *const D3D12_CLEAR_VALUE, + riidResource: REFGUID, + ppvResource: *mut *mut c_void, + ) -> HRESULT, + fn CreateHeap( + pDesc: *const D3D12_HEAP_DESC, + riid: REFGUID, + ppvHeap: *mut *mut c_void, + ) -> HRESULT, + fn CreatePlacedResource( + pHeap: *mut ID3D12Heap, + HeapOffset: UINT64, + pDesc: *const D3D12_RESOURCE_DESC, + InitialState: D3D12_RESOURCE_STATES, + pOptimizedClearValue: *const D3D12_CLEAR_VALUE, + riid: REFGUID, + ppvResource: *mut *mut c_void, + ) -> HRESULT, + fn CreateReservedResource( + pDesc: *const D3D12_RESOURCE_DESC, + InitialState: D3D12_RESOURCE_STATES, + pOptimizedClearValue: *const D3D12_CLEAR_VALUE, + riid: REFGUID, + ppvResource: *mut *mut c_void, + ) -> HRESULT, + fn CreateSharedHandle( + pObject: *mut ID3D12DeviceChild, + pAttributes: *const SECURITY_ATTRIBUTES, + Access: DWORD, + Name: LPCWSTR, + pHandle: *mut HANDLE, + ) -> HRESULT, + fn OpenSharedHandle( + NTHandle: HANDLE, + riid: REFGUID, + ppvObj: *mut *mut c_void, + ) -> HRESULT, + fn OpenSharedHandleByName( + Name: LPCWSTR, + Access: DWORD, + pNTHandle: *mut HANDLE, + ) -> HRESULT, + fn MakeResident( + NumObjects: UINT, + ppObjects: *mut *mut ID3D12Pageable, + ) -> HRESULT, + fn Evict( + NumObjects: UINT, + ppObjects: *mut *mut ID3D12Pageable, + ) -> HRESULT, + fn CreateFence( + InitialValue: UINT64, + Flags: D3D12_FENCE_FLAGS, + riid: REFGUID, + ppFence: *mut *mut c_void, + ) -> HRESULT, + fn GetDeviceRemovedReason() -> HRESULT, + fn GetCopyableFootprints( + pResourceDesc: *const D3D12_RESOURCE_DESC, + FirstSubresource: UINT, + NumSubresources: UINT, + BaseOffset: UINT64, + pLayouts: *mut D3D12_PLACED_SUBRESOURCE_FOOTPRINT, + pNumRows: *mut UINT, + pRowSizeInBytes: *mut UINT64, + pTotalBytes: *mut UINT64, + ) -> (), + fn CreateQueryHeap( + pDesc: *const D3D12_QUERY_HEAP_DESC, + riid: REFGUID, + ppvHeap: *mut *mut c_void, + ) -> HRESULT, + fn SetStablePowerState( + Enable: BOOL, + ) -> HRESULT, + fn CreateCommandSignature( + pDesc: *const D3D12_COMMAND_SIGNATURE_DESC, + pRootSignature: *mut ID3D12RootSignature, + riid: REFGUID, + ppvCommandSignature: *mut *mut c_void, + ) -> HRESULT, + fn GetResourceTiling( + pTiledResource: *mut ID3D12Resource, + pNumTilesForEntireResource: *mut UINT, + pPackedMipDesc: *mut D3D12_PACKED_MIP_INFO, + pStandardTileShapeForNonPackedMips: *mut D3D12_TILE_SHAPE, + pNumSubresourceTilings: *mut UINT, + FirstSubresourceTilingToGet: UINT, + pSubresourceTilingsForNonPackedMips: *mut D3D12_SUBRESOURCE_TILING, + ) -> (), + #[fixme] fn GetAdapterLuid() -> LUID, +}} +RIDL!{#[uuid(0xc64226a8, 0x9201, 0x46af, 0xb4, 0xcc, 0x53, 0xfb, 0x9f, 0xf7, 0x41, 0x4f)] +interface ID3D12PipelineLibrary(ID3D12PipelineLibraryVtbl): + ID3D12DeviceChild(ID3D12DeviceChildVtbl) { + fn StorePipeline( + pName: LPCWSTR, + pPipeline: *mut ID3D12PipelineState, + ) -> HRESULT, + fn LoadGraphicsPipeline( + pName: LPCWSTR, + pDesc: *const D3D12_GRAPHICS_PIPELINE_STATE_DESC, + riid: REFIID, + ppPipelineState: *mut *mut c_void, + ) -> HRESULT, + fn LoadComputePipeline( + pName: LPCWSTR, + pDesc: *const D3D12_COMPUTE_PIPELINE_STATE_DESC, + riid: REFIID, + ppPipelineState: *mut *mut c_void, + ) -> HRESULT, + fn GetSerializedSize() -> SIZE_T, + fn Serialize( + pData: *mut c_void, + DataSizeInBytes: SIZE_T, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x80eabf42, 0x2568, 0x4e5e, 0xbd, 0x82, 0xc3, 0x7f, 0x86, 0x96, 0x1d, 0xc3)] +interface ID3D12PipelineLibrary1(ID3D12PipelineLibrary1Vtbl): + ID3D12PipelineLibrary(ID3D12PipelineLibraryVtbl) { + fn LoadPipeline( + pName: LPCWSTR, + pDesc: *const D3D12_PIPELINE_STATE_STREAM_DESC, + riid: REFIID, + ppPipelineState: *mut *mut c_void, + ) -> HRESULT, +}} +ENUM!{enum D3D12_MULTIPLE_FENCE_WAIT_FLAGS { + D3D12_MULTIPLE_FENCE_WAIT_FLAG_NONE = 0, + D3D12_MULTIPLE_FENCE_WAIT_FLAG_ANY = 0x1, + D3D12_MULTIPLE_FENCE_WAIT_FLAG_ALL = 0, +}} +ENUM!{enum D3D12_RESIDENCY_PRIORITY { + D3D12_RESIDENCY_PRIORITY_MINIMUM = 0x28000000, + D3D12_RESIDENCY_PRIORITY_LOW = 0x50000000, + D3D12_RESIDENCY_PRIORITY_NORMAL = 0x78000000, + D3D12_RESIDENCY_PRIORITY_HIGH = 0xa0010000, + D3D12_RESIDENCY_PRIORITY_MAXIMUM = 0xc8000000, +}} +RIDL!{#[uuid(0x77acce80, 0x638e, 0x4e65, 0x88, 0x95, 0xc1, 0xf2, 0x33, 0x86, 0x86, 0x3e)] +interface ID3D12Device1(ID3D12Device1Vtbl): ID3D12Device(ID3D12DeviceVtbl) { + fn CreatePipelineLibrary( + pLibraryBlob: *const c_void, + BlobLength: SIZE_T, + riid: REFIID, + ppPipelineLibrary: *mut *mut c_void, + ) -> HRESULT, + fn SetEventOnMultipleFenceCompletion( + ppFences: *const *mut ID3D12Fence, + pFenceValues: *const UINT64, + NumFences: UINT, + Flags: D3D12_MULTIPLE_FENCE_WAIT_FLAGS, + hEvent: HANDLE, + ) -> HRESULT, + fn SetResidencyPriority( + NumObjects: UINT, + ppObjects: *const *mut ID3D12Pageable, + pPriorities: *const D3D12_RESIDENCY_PRIORITY, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x30baa41e, 0xb15b, 0x475c, 0xa0, 0xbb, 0x1a, 0xf5, 0xc5, 0xb6, 0x43, 0x28)] +interface ID3D12Device2(ID3D12Device2Vtbl): ID3D12Device1(ID3D12Device1Vtbl) { + fn CreatePipelineState( + pDesc: *const D3D12_PIPELINE_STATE_STREAM_DESC, + riid: REFIID, + ppPipelineState: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7071e1f0, 0xe84b, 0x4b33, 0x97, 0x4f, 0x12, 0xfa, 0x49, 0xde, 0x65, 0xc5)] +interface ID3D12Tools(ID3D12ToolsVtbl): IUnknown(IUnknownVtbl) { + fn EnableShaderInstrumentation( + bEnable: BOOL, + ) -> (), + fn ShaderInstrumentationEnabled() -> BOOL, +}} +STRUCT!{struct D3D12_SUBRESOURCE_DATA { + pData: *const c_void, + RowPitch: LONG_PTR, + SlicePitch: LONG_PTR, +}} +STRUCT!{struct D3D12_MEMCPY_DEST { + pData: *mut c_void, + RowPitch: SIZE_T, + SlicePitch: SIZE_T, +}} +FN!{stdcall PFN_D3D12_CREATE_DEVICE( + *mut IUnknown, + D3D_FEATURE_LEVEL, + REFIID, + *mut *mut c_void, +) -> HRESULT} +extern "system" { + pub fn D3D12CreateDevice( + pAdapter: *mut IUnknown, + MinimumFeatureLevel: D3D_FEATURE_LEVEL, + riid: REFGUID, + ppDevice: *mut *mut c_void, + ) -> HRESULT; +} +FN!{stdcall PFN_D3D12_GET_DEBUG_INTERFACE( + REFIID, + *mut *mut c_void, +) -> HRESULT} +extern "system" { + pub fn D3D12GetDebugInterface( + riid: REFGUID, + ppvDebug: *mut *mut c_void, + ) -> HRESULT; + pub fn D3D12EnableExperimentalFeatures( + NumFeatures: UINT, + pIIDs: *const IID, + pConfigurationStructs: *mut c_void, + pConfigurationStructSizes: *mut UINT, + ) -> HRESULT; +} +DEFINE_GUID!{IID_ID3D12Object, + 0xc4fec28f, 0x7966, 0x4e95, 0x9f, 0x94, 0xf4, 0x31, 0xcb, 0x56, 0xc3, 0xb8} +DEFINE_GUID!{IID_ID3D12DeviceChild, + 0x905db94b, 0xa00c, 0x4140, 0x9d, 0xf5, 0x2b, 0x64, 0xca, 0x9e, 0xa3, 0x57} +DEFINE_GUID!{IID_ID3D12RootSignature, + 0xc54a6b66, 0x72df, 0x4ee8, 0x8b, 0xe5, 0xa9, 0x46, 0xa1, 0x42, 0x92, 0x14} +DEFINE_GUID!{IID_ID3D12RootSignatureDeserializer, + 0x34AB647B, 0x3CC8, 0x46AC, 0x84, 0x1B, 0xC0, 0x96, 0x56, 0x45, 0xC0, 0x46} +DEFINE_GUID!{IID_ID3D12VersionedRootSignatureDeserializer, + 0x7F91CE67, 0x090C, 0x4BB7, 0xB7, 0x8E, 0xED, 0x8F, 0xF2, 0xE3, 0x1D, 0xA0} +DEFINE_GUID!{IID_ID3D12Pageable, + 0x63ee58fb, 0x1268, 0x4835, 0x86, 0xda, 0xf0, 0x08, 0xce, 0x62, 0xf0, 0xd6} +DEFINE_GUID!{IID_ID3D12Heap, + 0x6b3b2502, 0x6e51, 0x45b3, 0x90, 0xee, 0x98, 0x84, 0x26, 0x5e, 0x8d, 0xf3} +DEFINE_GUID!{IID_ID3D12Resource, + 0x696442be, 0xa72e, 0x4059, 0xbc, 0x79, 0x5b, 0x5c, 0x98, 0x04, 0x0f, 0xad} +DEFINE_GUID!{IID_ID3D12CommandAllocator, + 0x6102dee4, 0xaf59, 0x4b09, 0xb9, 0x99, 0xb4, 0x4d, 0x73, 0xf0, 0x9b, 0x24} +DEFINE_GUID!{IID_ID3D12Fence, + 0x0a753dcf, 0xc4d8, 0x4b91, 0xad, 0xf6, 0xbe, 0x5a, 0x60, 0xd9, 0x5a, 0x76} +DEFINE_GUID!{IID_ID3D12PipelineState, + 0x765a30f3, 0xf624, 0x4c6f, 0xa8, 0x28, 0xac, 0xe9, 0x48, 0x62, 0x24, 0x45} +DEFINE_GUID!{IID_ID3D12DescriptorHeap, + 0x8efb471d, 0x616c, 0x4f49, 0x90, 0xf7, 0x12, 0x7b, 0xb7, 0x63, 0xfa, 0x51} +DEFINE_GUID!{IID_ID3D12QueryHeap, + 0x0d9658ae, 0xed45, 0x469e, 0xa6, 0x1d, 0x97, 0x0e, 0xc5, 0x83, 0xca, 0xb4} +DEFINE_GUID!{IID_ID3D12CommandSignature, + 0xc36a797c, 0xec80, 0x4f0a, 0x89, 0x85, 0xa7, 0xb2, 0x47, 0x50, 0x82, 0xd1} +DEFINE_GUID!{IID_ID3D12CommandList, + 0x7116d91c, 0xe7e4, 0x47ce, 0xb8, 0xc6, 0xec, 0x81, 0x68, 0xf4, 0x37, 0xe5} +DEFINE_GUID!{IID_ID3D12GraphicsCommandList, + 0x5b160d0f, 0xac1b, 0x4185, 0x8b, 0xa8, 0xb3, 0xae, 0x42, 0xa5, 0xa4, 0x55} +DEFINE_GUID!{IID_ID3D12GraphicsCommandList1, + 0x553103fb, 0x1fe7, 0x4557, 0xbb, 0x38, 0x94, 0x6d, 0x7d, 0x0e, 0x7c, 0xa7} +DEFINE_GUID!{IID_ID3D12CommandQueue, + 0x0ec870a6, 0x5d7e, 0x4c22, 0x8c, 0xfc, 0x5b, 0xaa, 0xe0, 0x76, 0x16, 0xed} +DEFINE_GUID!{IID_ID3D12Device, + 0x189819f1, 0x1db6, 0x4b57, 0xbe, 0x54, 0x18, 0x21, 0x33, 0x9b, 0x85, 0xf7} +DEFINE_GUID!{IID_ID3D12PipelineLibrary, + 0xc64226a8, 0x9201, 0x46af, 0xb4, 0xcc, 0x53, 0xfb, 0x9f, 0xf7, 0x41, 0x4f} +DEFINE_GUID!{IID_ID3D12PipelineLibrary1, + 0x80eabf42, 0x2568, 0x4e5e, 0xbd, 0x82, 0xc3, 0x7f, 0x86, 0x96, 0x1d, 0xc3} +DEFINE_GUID!{IID_ID3D12Device1, + 0x77acce80, 0x638e, 0x4e65, 0x88, 0x95, 0xc1, 0xf2, 0x33, 0x86, 0x86, 0x3e} +DEFINE_GUID!{IID_ID3D12Device2, + 0x30baa41e, 0xb15b, 0x475c, 0xa0, 0xbb, 0x1a, 0xf5, 0xc5, 0xb6, 0x43, 0x28} +DEFINE_GUID!{IID_ID3D12Tools, + 0x7071e1f0, 0xe84b, 0x4b33, 0x97, 0x4f, 0x12, 0xfa, 0x49, 0xde, 0x65, 0xc5} diff --git a/bash-5.1/vendor/winapi/src/um/d3d12sdklayers.rs b/bash-5.1/vendor/winapi/src/um/d3d12sdklayers.rs new file mode 100644 index 0000000000000000000000000000000000000000..bb9535ccf68f7137d6825216ed19b9b9c1a4e6a4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d12sdklayers.rs @@ -0,0 +1,1364 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_char, c_void}; +use shared::basetsd::{SIZE_T, UINT64}; +use shared::minwindef::{BOOL, FLOAT, UINT}; +use um::d3d12::ID3D12Resource; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCSTR}; +RIDL!{#[uuid(0x344488b7, 0x6846, 0x474b, 0xb9, 0x89, 0xf0, 0x27, 0x44, 0x82, 0x45, 0xe0)] +interface ID3D12Debug(ID3D12DebugVtbl): IUnknown(IUnknownVtbl) { + fn EnableDebugLayer() -> (), +}} +RIDL!{#[uuid(0xaffaa4ca, 0x63fe, 0x4d8e, 0xb8, 0xad, 0x15, 0x90, 0x00, 0xaf, 0x43, 0x04)] +interface ID3D12Debug1(ID3D12Debug1Vtbl): IUnknown(IUnknownVtbl) { + fn EnableDebugLayer() -> (), + fn SetEnableGPUBasedValidation( + Enable: BOOL, + ) -> (), + fn SetEnableSynchronizedCommandQueueValidation( + Enable: BOOL, + ) -> (), +}} +ENUM!{enum D3D12_GPU_BASED_VALIDATION_FLAGS { + D3D12_GPU_BASED_VALIDATION_FLAGS_NONE = 0, + D3D12_GPU_BASED_VALIDATION_FLAGS_DISABLE_STATE_TRACKING = 0x01, +}} +RIDL!{#[uuid(0x93a665c4, 0xa3b2, 0x4e5d, 0xb6, 0x92, 0xa2, 0x6a, 0xe1, 0x4e, 0x33, 0x74)] +interface ID3D12Debug2(ID3D12Debug2Vtbl): IUnknown(IUnknownVtbl) { + fn SetGPUBasedValidationFlags( + Flags: D3D12_GPU_BASED_VALIDATION_FLAGS, + ) -> (), +}} +ENUM!{enum D3D12_RLDO_FLAGS { + D3D12_RLDO_NONE = 0, + D3D12_RLDO_SUMMARY = 0x1, + D3D12_RLDO_DETAIL = 0x2, + D3D12_RLDO_IGNORE_INTERNAL = 0x4, +}} +ENUM!{enum D3D12_DEBUG_DEVICE_PARAMETER_TYPE { + D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS = 0, + D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = 1, + D3D12_DEBUG_DEVICE_PARAMETER_GPU_SLOWDOWN_PERFORMANCE_FACTOR = 2, +}} +ENUM!{enum D3D12_DEBUG_FEATURE { + D3D12_DEBUG_FEATURE_NONE = 0, + D3D12_DEBUG_FEATURE_TREAT_BUNDLE_AS_DRAW = 0x1, + D3D12_DEBUG_FEATURE_TREAT_BUNDLE_AS_DISPATCH = 0x2, + D3D12_DEBUG_FEATURE_DISABLE_VIRTUALIZED_BUNDLES_VALIDATION = 0x04, + D3D12_DEBUG_FEATURE_VALID_MASK = 0x7, +}} +ENUM!{enum D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE { + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE = 0, + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY = 1, + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION = 2, + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION = 3, + NUM_D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODES = 4, +}} +ENUM!{enum D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS { + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_NONE = 0, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_TRACKING_ONLY_SHADERS + = 0x01, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_UNGUARDED_VALIDATION_SHADERS = 0x02, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_GUARDED_VALIDATION_SHADERS = 0x04, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS_VALID_MASK = 0x07, +}} +STRUCT!{struct D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS { + MaxMessagesPerCommandList: UINT, + DefaultShaderPatchMode: D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE, + PipelineStateCreateFlags: D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS, +}} +STRUCT!{struct D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR { + SlowdownFactor: FLOAT, +}} +RIDL!{#[uuid(0x3febd6dd, 0x4973, 0x4787, 0x81, 0x94, 0xe4, 0x5f, 0x9e, 0x28, 0x92, 0x3e)] +interface ID3D12DebugDevice1(ID3D12DebugDevice1Vtbl): IUnknown(IUnknownVtbl) { + fn SetDebugParameter( + Type: D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE, + pData: *const c_void, + DataSize: UINT, + ) -> HRESULT, + fn GetDebugParameter( + Type: D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE, + pData: *mut c_void, + DataSize: UINT, + ) -> HRESULT, + fn ReportLiveDeviceObjects( + Flags: D3D12_RLDO_FLAGS, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3febd6dd, 0x4973, 0x4787, 0x81, 0x94, 0xe4, 0x5f, 0x9e, 0x28, 0x92, 0x3e)] +interface ID3D12DebugDevice(ID3D12DebugDeviceVtbl): IUnknown(IUnknownVtbl) { + fn SetFeatureMask( + Mask: D3D12_DEBUG_FEATURE, + ) -> HRESULT, + fn GetFeatureMask() -> D3D12_DEBUG_FEATURE, + fn ReportLiveDeviceObjects( + Flags: D3D12_RLDO_FLAGS, + ) -> HRESULT, +}} +DEFINE_GUID!{DXGI_DEBUG_D3D12, + 0xcf59a98c, 0xa950, 0x4326, 0x91, 0xef, 0x9b, 0xba, 0xa1, 0x7b, 0xfd, 0x95} +RIDL!{#[uuid(0x09e0bf36, 0x54ac, 0x484f, 0x88, 0x47, 0x4b, 0xae, 0xea, 0xb6, 0x05, 0x3a)] +interface ID3D12DebugCommandQueue(ID3D12DebugCommandQueueVtbl): IUnknown(IUnknownVtbl) { + fn AssertResourceState( + pResource: *mut ID3D12Resource, + Subresource: UINT, + State: UINT, + ) -> BOOL, +}} +ENUM!{enum D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE { + D3D12_DEBUG_COMMAND_LIST_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = 0, +}} +STRUCT!{struct D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS { + ShaderPatchMode: D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE, +}} +RIDL!{#[uuid(0x102ca951, 0x311b, 0x4b01, 0xb1, 0x1f, 0xec, 0xb8, 0x3e, 0x06, 0x1b, 0x37)] +interface ID3D12DebugCommandList1(ID3D12DebugCommandList1Vtbl): IUnknown(IUnknownVtbl) { + fn AssertResourceState( + pResource: *mut ID3D12Resource, + Subresource: UINT, + State: UINT, + ) -> BOOL, + fn SetDebugParameter( + Type: D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE, + pData: *const c_void, + DataSize: UINT, + ) -> HRESULT, + fn GetDebugParameter( + Type: D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE, + pData: *mut c_void, + DataSize: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x09e0bf36, 0x54ac, 0x484f, 0x88, 0x47, 0x4b, 0xae, 0xea, 0xb6, 0x05, 0x3f)] +interface ID3D12DebugCommandList(ID3D12DebugCommandListVtbl): IUnknown(IUnknownVtbl) { + fn AssertResourceState( + pResource: *mut ID3D12Resource, + Subresource: UINT, + State: UINT, + ) -> BOOL, + fn SetFeatureMask( + Mask: D3D12_DEBUG_FEATURE, + ) -> HRESULT, + fn GetFeatureMask() -> D3D12_DEBUG_FEATURE, +}} +ENUM!{enum D3D12_MESSAGE_CATEGORY { + D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0, + D3D12_MESSAGE_CATEGORY_MISCELLANEOUS = 1, + D3D12_MESSAGE_CATEGORY_INITIALIZATION = 2, + D3D12_MESSAGE_CATEGORY_CLEANUP = 3, + D3D12_MESSAGE_CATEGORY_COMPILATION = 4, + D3D12_MESSAGE_CATEGORY_STATE_CREATION = 5, + D3D12_MESSAGE_CATEGORY_STATE_SETTING = 6, + D3D12_MESSAGE_CATEGORY_STATE_GETTING = 7, + D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = 8, + D3D12_MESSAGE_CATEGORY_EXECUTION = 9, + D3D12_MESSAGE_CATEGORY_SHADER = 10, +}} +ENUM!{enum D3D12_MESSAGE_SEVERITY { + D3D12_MESSAGE_SEVERITY_CORRUPTION = 0, + D3D12_MESSAGE_SEVERITY_ERROR = 1, + D3D12_MESSAGE_SEVERITY_WARNING = 2, + D3D12_MESSAGE_SEVERITY_INFO = 3, + D3D12_MESSAGE_SEVERITY_MESSAGE = 4, +}} +ENUM!{enum D3D12_MESSAGE_ID { + D3D12_MESSAGE_ID_UNKNOWN = 0, + D3D12_MESSAGE_ID_STRING_FROM_APPLICATION = 1, + D3D12_MESSAGE_ID_CORRUPTED_THIS = 2, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER1 = 3, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER2 = 4, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER3 = 5, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER4 = 6, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER5 = 7, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER6 = 8, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER7 = 9, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER8 = 10, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER9 = 11, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER10 = 12, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER11 = 13, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER12 = 14, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER13 = 15, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER14 = 16, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER15 = 17, + D3D12_MESSAGE_ID_CORRUPTED_MULTITHREADING = 18, + D3D12_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = 19, + D3D12_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = 20, + D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = 21, + D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = 22, + D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = 23, + D3D12_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = 24, + D3D12_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = 25, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = 26, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = 27, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = 28, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANESLICE = 29, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANESLICE = 30, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = 31, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = 32, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = 33, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = 34, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = 35, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = 36, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = 37, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = 38, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANESLICE = 39, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANESLICE = 40, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = 41, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = 42, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = 43, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = 44, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = 45, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = 46, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = 47, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = 48, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = 49, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = 50, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = 51, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = 52, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = 53, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = 54, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = 55, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = 56, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = 57, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = 58, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = 59, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = 60, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = 61, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = 62, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = 63, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = 64, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = 65, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = 66, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = 67, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = 68, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = 69, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = 70, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = 71, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = 72, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = 73, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = 74, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = 75, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = 76, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = 77, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = 78, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = 79, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = 80, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = 81, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = 82, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + = 83, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = 84, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = 85, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = 86, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = 87, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = 88, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = 89, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = 90, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = 91, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = 92, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = 93, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = 94, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = 95, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = 96, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = 97, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = 98, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = 99, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = 100, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = 101, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = 102, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = 103, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = 104, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = 105, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = 106, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = 107, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = 108, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = 109, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = 110, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = 111, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = 112, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = 113, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = 114, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = 115, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = 116, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = 117, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = 118, + D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = 119, + D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = 120, + D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = 121, + D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = 122, + D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = 123, + D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = 124, + D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = 125, + D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = 126, + D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = 127, + D3D12_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = 128, + D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = 129, + D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = 130, + D3D12_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = 131, + D3D12_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = 132, + D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = 133, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = 134, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = 135, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = 136, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = 137, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = 138, + D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = 139, + D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = 140, + D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = 141, + D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = 142, + D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = 143, + D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = 144, + D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = 145, + D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = 146, + D3D12_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = 147, + D3D12_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = 148, + D3D12_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = 149, + D3D12_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = 150, + D3D12_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = 151, + D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = 152, + D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = 153, + D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = 154, + D3D12_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = 155, + D3D12_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = 156, + D3D12_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = 157, + D3D12_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = 158, + D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = 159, + D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = 160, + D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = 161, + D3D12_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = 162, + D3D12_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = 163, + D3D12_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = 164, + D3D12_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = 165, + D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = 166, + D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = 167, + D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = 168, + D3D12_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = 169, + D3D12_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = 170, + D3D12_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = 171, + D3D12_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = 172, + D3D12_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = 173, + D3D12_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = 174, + D3D12_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = 175, + D3D12_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = 176, + D3D12_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = 177, + D3D12_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = 178, + D3D12_MESSAGE_ID_REF_THREADING_MODE = 179, + D3D12_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = 180, + D3D12_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = 181, + D3D12_MESSAGE_ID_REF_HARDWARE_EXCEPTION = 182, + D3D12_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = 183, + D3D12_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = 184, + D3D12_MESSAGE_ID_REF_OUT_OF_MEMORY = 185, + D3D12_MESSAGE_ID_REF_INFO = 186, + D3D12_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = 187, + D3D12_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = 188, + D3D12_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = 189, + D3D12_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = 190, + D3D12_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = 191, + D3D12_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = 192, + D3D12_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = 193, + D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = 194, + D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = 195, + D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = 196, + D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = 197, + D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = 198, + D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = 199, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET = 200, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH = 201, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_NOT_SET = 202, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INPUTLAYOUT_NOT_SET = 203, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_CONSTANT_BUFFER_NOT_SET = 204, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_CONSTANT_BUFFER_TOO_SMALL = 205, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SAMPLER_NOT_SET = 206, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SHADERRESOURCEVIEW_NOT_SET = 207, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VIEW_DIMENSION_MISMATCH = 208, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = 209, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_TOO_SMALL = 210, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_NOT_SET = 211, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_FORMAT_INVALID = 212, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_TOO_SMALL = 213, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = 214, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = 215, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_POSITION_NOT_PRESENT = 216, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OUTPUT_STREAM_NOT_SET = 217, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_BOUND_RESOURCE_MAPPED = 218, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INVALID_PRIMITIVETOPOLOGY = 219, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_OFFSET_UNALIGNED = 220, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_STRIDE_UNALIGNED = 221, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_OFFSET_UNALIGNED = 222, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = 223, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = 224, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = 225, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = 226, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = 227, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = 228, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = 229, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = 230, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = 231, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = 232, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = 233, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = 234, + D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = 235, + D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = 236, + D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = 237, + D3D12_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = 238, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = 239, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = 240, + D3D12_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = 241, + D3D12_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = 242, + D3D12_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = 243, + D3D12_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = 244, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = 245, + D3D12_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = 246, + D3D12_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = 247, + D3D12_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = 248, + D3D12_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = 249, + D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = 250, + D3D12_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = 251, + D3D12_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = 252, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = 253, + D3D12_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = 254, + D3D12_MESSAGE_ID_LIVE_OBJECT_SUMMARY = 255, + D3D12_MESSAGE_ID_LIVE_BUFFER = 256, + D3D12_MESSAGE_ID_LIVE_TEXTURE1D = 257, + D3D12_MESSAGE_ID_LIVE_TEXTURE2D = 258, + D3D12_MESSAGE_ID_LIVE_TEXTURE3D = 259, + D3D12_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW = 260, + D3D12_MESSAGE_ID_LIVE_RENDERTARGETVIEW = 261, + D3D12_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW = 262, + D3D12_MESSAGE_ID_LIVE_VERTEXSHADER = 263, + D3D12_MESSAGE_ID_LIVE_GEOMETRYSHADER = 264, + D3D12_MESSAGE_ID_LIVE_PIXELSHADER = 265, + D3D12_MESSAGE_ID_LIVE_INPUTLAYOUT = 266, + D3D12_MESSAGE_ID_LIVE_SAMPLER = 267, + D3D12_MESSAGE_ID_LIVE_BLENDSTATE = 268, + D3D12_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE = 269, + D3D12_MESSAGE_ID_LIVE_RASTERIZERSTATE = 270, + D3D12_MESSAGE_ID_LIVE_QUERY = 271, + D3D12_MESSAGE_ID_LIVE_PREDICATE = 272, + D3D12_MESSAGE_ID_LIVE_COUNTER = 273, + D3D12_MESSAGE_ID_LIVE_DEVICE = 274, + D3D12_MESSAGE_ID_LIVE_SWAPCHAIN = 275, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = 276, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = 277, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = 278, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS = 279, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = 280, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS = 281, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE = 282, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = 283, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = 284, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = 285, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = 286, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = 287, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL = 288, + D3D12_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = 289, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = 290, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = 291, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = 292, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL = 293, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = 294, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = 295, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = 296, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = 297, + D3D12_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH = 298, + D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER = 299, + D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED = 300, + D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW = 301, + D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE = 302, + D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE = 303, + D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS = 304, + D3D12_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED = 305, + D3D12_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN = 306, + D3D12_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN = 307, + D3D12_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD = 308, + D3D12_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE = 309, + D3D12_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = 310, + D3D12_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS = 311, + D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED = 312, + D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH = 313, + D3D12_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = 314, + D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH = 315, + D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = 316, + D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE = 317, + D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = 318, + D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN = 319, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL = 320, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = 321, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = 322, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = 323, + D3D12_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY = 324, + D3D12_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER = 325, + D3D12_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY = 326, + D3D12_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY = 327, + D3D12_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY = 328, + D3D12_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY = 329, + D3D12_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY = 330, + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 331, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 332, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 333, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 334, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = 335, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 336, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = 337, + D3D12_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE = 338, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS = 339, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = 340, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = 341, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = 342, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANESLICE = 343, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE = 344, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = 345, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = 346, + D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS = 347, + D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP = 348, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN = 349, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN = 350, + D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH = 351, + D3D12_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY = 352, + D3D12_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY = 353, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = 354, + D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER = 355, + D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED = 356, + D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW = 357, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY = 358, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY = 359, + D3D12_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED = 360, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH = 361, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET = 362, + D3D12_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP = 363, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH = 364, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED = 365, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED = 366, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH = 367, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH = 368, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED = 369, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED = 370, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED = 371, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED = 372, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED = 373, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED = 374, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED = 375, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED = 376, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED = 377, + D3D12_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED = 378, + D3D12_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW = 379, + D3D12_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO = 380, + D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH = 381, + D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH = 382, + D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED = 383, + D3D12_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED = 384, + D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED = 385, + D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET = 386, + D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET = 387, + D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE = 388, + D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE = 389, + D3D12_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED = 390, + D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT = 391, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED = 392, + D3D12_MESSAGE_ID_DEVICE_DRAW_PIXEL_SHADER_WITHOUT_RTV_OR_DSV = 393, + D3D12_MESSAGE_ID_SHADER_ABORT = 394, + D3D12_MESSAGE_ID_SHADER_MESSAGE = 395, + D3D12_MESSAGE_ID_SHADER_ERROR = 396, + D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDRESOURCE = 397, + D3D12_MESSAGE_ID_ENQUEUESETEVENT_INVALIDARG_RETURN = 398, + D3D12_MESSAGE_ID_ENQUEUESETEVENT_OUTOFMEMORY_RETURN = 399, + D3D12_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN = 400, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT = 401, + D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT = 402, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS = 403, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDARRAYWITHDECODER = 404, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDARRAYWITHDECODER = 405, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDARRAYWITHDECODER = 406, + D3D12_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE = 407, + D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY = 408, + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW = 409, + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 410, + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_SHADEREXTENSIONSNOTSUPPORTED = 411, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 412, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_SHADEREXTENSIONSNOTSUPPORTED = 413, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 414, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_SHADEREXTENSIONSNOTSUPPORTED = 415, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 416, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_SHADEREXTENSIONSNOTSUPPORTED = 417, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED + = 418, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_SHADEREXTENSIONSNOTSUPPORTED + = 419, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 420, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_SHADEREXTENSIONSNOTSUPPORTED = 421, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 422, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_SHADEREXTENSIONSNOTSUPPORTED = 423, + D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION = 424, + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED = 425, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED = 426, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED = 427, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED = 428, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED = 429, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED = 430, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED = 431, + D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_INVALIDOFFSET = 432, + D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_TOOMANYVIEWS = 433, + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_NOTSUPPORTED = 434, + D3D12_MESSAGE_ID_SWAPDEVICECONTEXTSTATE_NOTSUPPORTED = 435, + D3D12_MESSAGE_ID_UPDATESUBRESOURCE_PREFERUPDATESUBRESOURCE1 = 436, + D3D12_MESSAGE_ID_GETDC_INACCESSIBLE = 437, + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDRECT = 438, + D3D12_MESSAGE_ID_DEVICE_DRAW_SAMPLE_MASK_IGNORED_ON_FL9 = 439, + D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE1_NOT_SUPPORTED = 440, + D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BY_NAME_NOT_SUPPORTED = 441, + D3D12_MESSAGE_ID_ENQUEUESETEVENT_NOT_SUPPORTED = 442, + D3D12_MESSAGE_ID_OFFERRELEASE_NOT_SUPPORTED = 443, + D3D12_MESSAGE_ID_OFFERRESOURCES_INACCESSIBLE = 444, + D3D12_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMSAA = 445, + D3D12_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMSAA = 446, + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT = 447, + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT = 448, + D3D12_MESSAGE_ID_UPDATESUBRESOURCE_EMPTYDESTBOX = 449, + D3D12_MESSAGE_ID_COPYSUBRESOURCEREGION_EMPTYSOURCEBOX = 450, + D3D12_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = 451, + D3D12_MESSAGE_ID_DEVICE_DRAW_DEPTHSTENCILVIEW_NOT_SET = 452, + D3D12_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET = 453, + D3D12_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET_DUE_TO_FLIP_PRESENT = 454, + D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET_DUE_TO_FLIP_PRESENT = 455, + D3D12_MESSAGE_ID_GETDATAFORNEWHARDWAREKEY_NULLPARAM = 456, + D3D12_MESSAGE_ID_CHECKCRYPTOSESSIONSTATUS_NULLPARAM = 457, + D3D12_MESSAGE_ID_SETEVENTONHARDWARECONTENTPROTECTIONTILT_NULLPARAM = 458, + D3D12_MESSAGE_ID_GETVIDEODECODERCAPS_NULLPARAM = 459, + D3D12_MESSAGE_ID_GETVIDEODECODERCAPS_ZEROWIDTHHEIGHT = 460, + D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_NULLPARAM = 461, + D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE = 462, + D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT = 463, + D3D12_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_NULLPARAM = 464, + D3D12_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_UNSUPPORTED = 465, + D3D12_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_NULLPARAM = 466, + D3D12_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_UNSUPPORTED = 467, + D3D12_MESSAGE_ID_CHECKVIDEOPROCESSORFORMATCONVERSION_NULLPARAM = 468, + D3D12_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE1_NULLPARAM = 469, + D3D12_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE1_NULLPARAM = 470, + D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_NULLPARAM = 471, + D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_INVALIDSTREAM = 472, + D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_NULLPARAM = 473, + D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_INVALIDSTREAM = 474, + D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_UNSUPPORTED = 475, + D3D12_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_NULLPARAM = 476, + D3D12_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_NULLPARAM = 477, + D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_NULLPARAM = 478, + D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE = 479, + D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT = 480, + D3D12_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSHADERUSAGE_NULLPARAM = 481, + D3D12_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSHADERUSAGE_NULLPARAM = 482, + D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_NULLPARAM = 483, + D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSTREAMCOUNT = 484, + D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_TARGETRECT = 485, + D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSOURCERECT = 486, + D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDDESTRECT = 487, + D3D12_MESSAGE_ID_CREATEBUFFER_INVALIDUSAGE = 488, + D3D12_MESSAGE_ID_CREATETEXTURE1D_INVALIDUSAGE = 489, + D3D12_MESSAGE_ID_CREATETEXTURE2D_INVALIDUSAGE = 490, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_STEPRATE_NOT_1 = 491, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_INSTANCING_NOT_SUPPORTED = 492, + D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER = 493, + D3D12_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER = 494, + D3D12_MESSAGE_ID_COPYTILES_INVALID_PARAMETER = 495, + D3D12_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_WARNING = 496, + D3D12_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_ERROR = 497, + D3D12_MESSAGE_ID_DIRTY_TILE_MAPPING_ACCESS = 498, + D3D12_MESSAGE_ID_DUPLICATE_TILE_MAPPINGS_IN_COVERED_AREA = 499, + D3D12_MESSAGE_ID_TILE_MAPPINGS_IN_COVERED_AREA_DUPLICATED_OUTSIDE = 500, + D3D12_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INCOMPATIBLE_RESOURCES = 501, + D3D12_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INPUT_AND_OUTPUT = 502, + D3D12_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_INVALIDFLAGS = 503, + D3D12_MESSAGE_ID_GETRESOURCETILING_NONTILED_RESOURCE = 504, + D3D12_MESSAGE_ID_NEED_TO_CALL_TILEDRESOURCEBARRIER = 505, + D3D12_MESSAGE_ID_CREATEDEVICE_INVALIDARGS = 506, + D3D12_MESSAGE_ID_CREATEDEVICE_WARNING = 507, + D3D12_MESSAGE_ID_TILED_RESOURCE_TIER_1_BUFFER_TEXTURE_MISMATCH = 508, + D3D12_MESSAGE_ID_CREATE_CRYPTOSESSION = 509, + D3D12_MESSAGE_ID_CREATE_AUTHENTICATEDCHANNEL = 510, + D3D12_MESSAGE_ID_LIVE_CRYPTOSESSION = 511, + D3D12_MESSAGE_ID_LIVE_AUTHENTICATEDCHANNEL = 512, + D3D12_MESSAGE_ID_DESTROY_CRYPTOSESSION = 513, + D3D12_MESSAGE_ID_DESTROY_AUTHENTICATEDCHANNEL = 514, + D3D12_MESSAGE_ID_MAP_INVALID_SUBRESOURCE = 515, + D3D12_MESSAGE_ID_MAP_INVALID_TYPE = 516, + D3D12_MESSAGE_ID_MAP_UNSUPPORTED_TYPE = 517, + D3D12_MESSAGE_ID_UNMAP_INVALID_SUBRESOURCE = 518, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_TYPE = 519, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_NULL_POINTER = 520, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SUBRESOURCE = 521, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_RESERVED_BITS = 522, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISSING_BIND_FLAGS = 523, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_MISC_FLAGS = 524, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MATCHING_STATES = 525, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINATION = 526, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH = 527, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_RESOURCE = 528, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_SAMPLE_COUNT = 529, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS = 530, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINED_FLAGS = 531, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS_FOR_FORMAT = 532, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SPLIT_BARRIER = 533, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_END = 534, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_BEGIN = 535, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAG = 536, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMMAND_LIST_TYPE = 537, + D3D12_MESSAGE_ID_INVALID_SUBRESOURCE_STATE = 538, + D3D12_MESSAGE_ID_INEFFICIENT_PRESENT = 539, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CONTENTION = 540, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET = 541, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET_BUNDLE = 542, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CANNOT_RESET = 543, + D3D12_MESSAGE_ID_COMMAND_LIST_OPEN = 544, + D3D12_MESSAGE_ID_QUERY_STATE_MISMATCH = 545, + D3D12_MESSAGE_ID_INVALID_BUNDLE_API = 546, + D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED = 547, + D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED_WITH_INVALID_RESOURCE = 548, + D3D12_MESSAGE_ID_WRONG_COMMAND_ALLOCATOR_TYPE = 549, + D3D12_MESSAGE_ID_INVALID_INDIRECT_ARGUMENT_BUFFER = 550, + D3D12_MESSAGE_ID_COMPUTE_AND_GRAPHICS_PIPELINE = 551, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_SYNC = 552, + D3D12_MESSAGE_ID_COMMAND_LIST_SYNC = 553, + D3D12_MESSAGE_ID_SET_DESCRIPTOR_HEAP_INVALID = 554, + D3D12_MESSAGE_ID_CREATE_QUEUE_IMAGE_NOT_SUPPORTED = 555, + D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_IMAGE_NOT_SUPPORTED = 556, + D3D12_MESSAGE_ID_CREATE_COMMANDQUEUE = 557, + D3D12_MESSAGE_ID_CREATE_COMMANDALLOCATOR = 558, + D3D12_MESSAGE_ID_CREATE_PIPELINESTATE = 559, + D3D12_MESSAGE_ID_CREATE_COMMANDLIST12 = 560, + D3D12_MESSAGE_ID_CREATE_IMAGECOMMANDLIST = 561, + D3D12_MESSAGE_ID_CREATE_RESOURCE = 562, + D3D12_MESSAGE_ID_CREATE_DESCRIPTORHEAP = 563, + D3D12_MESSAGE_ID_CREATE_ROOTSIGNATURE = 564, + D3D12_MESSAGE_ID_CREATE_LIBRARY = 565, + D3D12_MESSAGE_ID_CREATE_HEAP = 566, + D3D12_MESSAGE_ID_CREATE_MONITOREDFENCE = 567, + D3D12_MESSAGE_ID_CREATE_QUERYHEAP = 568, + D3D12_MESSAGE_ID_CREATE_COMMANDSIGNATURE = 569, + D3D12_MESSAGE_ID_LIVE_COMMANDQUEUE = 570, + D3D12_MESSAGE_ID_LIVE_COMMANDALLOCATOR = 571, + D3D12_MESSAGE_ID_LIVE_PIPELINESTATE = 572, + D3D12_MESSAGE_ID_LIVE_COMMANDLIST12 = 573, + D3D12_MESSAGE_ID_LIVE_IMAGECOMMANDLIST = 574, + D3D12_MESSAGE_ID_LIVE_RESOURCE = 575, + D3D12_MESSAGE_ID_LIVE_DESCRIPTORHEAP = 576, + D3D12_MESSAGE_ID_LIVE_ROOTSIGNATURE = 577, + D3D12_MESSAGE_ID_LIVE_LIBRARY = 578, + D3D12_MESSAGE_ID_LIVE_HEAP = 579, + D3D12_MESSAGE_ID_LIVE_MONITOREDFENCE = 580, + D3D12_MESSAGE_ID_LIVE_QUERYHEAP = 581, + D3D12_MESSAGE_ID_LIVE_COMMANDSIGNATURE = 582, + D3D12_MESSAGE_ID_DESTROY_COMMANDQUEUE = 583, + D3D12_MESSAGE_ID_DESTROY_COMMANDALLOCATOR = 584, + D3D12_MESSAGE_ID_DESTROY_PIPELINESTATE = 585, + D3D12_MESSAGE_ID_DESTROY_COMMANDLIST12 = 586, + D3D12_MESSAGE_ID_DESTROY_IMAGECOMMANDLIST = 587, + D3D12_MESSAGE_ID_DESTROY_RESOURCE = 588, + D3D12_MESSAGE_ID_DESTROY_DESCRIPTORHEAP = 589, + D3D12_MESSAGE_ID_DESTROY_ROOTSIGNATURE = 590, + D3D12_MESSAGE_ID_DESTROY_LIBRARY = 591, + D3D12_MESSAGE_ID_DESTROY_HEAP = 592, + D3D12_MESSAGE_ID_DESTROY_MONITOREDFENCE = 593, + D3D12_MESSAGE_ID_DESTROY_QUERYHEAP = 594, + D3D12_MESSAGE_ID_DESTROY_COMMANDSIGNATURE = 595, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDHEAPTYPE = 596, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONS = 597, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDMISCFLAGS = 598, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMISCFLAGS = 599, + D3D12_MESSAGE_ID_CREATERESOURCE_LARGEALLOCATION = 600, + D3D12_MESSAGE_ID_CREATERESOURCE_SMALLALLOCATION = 601, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDARG_RETURN = 602, + D3D12_MESSAGE_ID_CREATERESOURCE_OUTOFMEMORY_RETURN = 603, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDESC = 604, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDINITIALSTATE = 605, + D3D12_MESSAGE_ID_RESOURCE_HAS_PENDING_INITIAL_DATA = 606, + D3D12_MESSAGE_ID_POSSIBLY_INVALID_SUBRESOURCE_STATE = 607, + D3D12_MESSAGE_ID_INVALID_USE_OF_NON_RESIDENT_RESOURCE = 608, + D3D12_MESSAGE_ID_POSSIBLE_INVALID_USE_OF_NON_RESIDENT_RESOURCE = 609, + D3D12_MESSAGE_ID_BUNDLE_PIPELINE_STATE_MISMATCH = 610, + D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_MISMATCH_PIPELINE_STATE = 611, + D3D12_MESSAGE_ID_RENDER_TARGET_NUMBER_MISMATCH_PIPELINE_STATE = 612, + D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_PIPELINE_STATE = 613, + D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = 614, + D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_PIPELINE_STATE = 615, + D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = 616, + D3D12_MESSAGE_ID_RENDER_TARGET_NUMBER_MISMATCH_BUNDLE_PIPELINE_STATE = 617, + D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_BUNDLE_PIPELINE_STATE = 618, + D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_BUNDLE_PIPELINE_STATE = 619, + D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_BUNDLE_PIPELINE_STATE = 620, + D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_BUNDLE_PIPELINE_STATE = 621, + D3D12_MESSAGE_ID_CREATESHADER_INVALIDBYTECODE = 622, + D3D12_MESSAGE_ID_CREATEHEAP_NULLDESC = 623, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDSIZE = 624, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDHEAPTYPE = 625, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = 626, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMEMORYPOOL = 627, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDPROPERTIES = 628, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDALIGNMENT = 629, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMISCFLAGS = 630, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDMISCFLAGS = 631, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDARG_RETURN = 632, + D3D12_MESSAGE_ID_CREATEHEAP_OUTOFMEMORY_RETURN = 633, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAPPROPERTIES = 634, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPTYPE = 635, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = 636, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDMEMORYPOOL = 637, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPPROPERTIES = 638, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPMISCFLAGS = 639, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPMISCFLAGS = 640, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDARG_RETURN = 641, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_OUTOFMEMORY_RETURN = 642, + D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_UNRECOGNIZEDHEAPTYPE = 643, + D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_INVALIDHEAPTYPE = 644, + D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_INVALID_DESC = 645, + D3D12_MESSAGE_ID_INVALID_DESCRIPTOR_HANDLE = 646, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE = 647, + D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_SYSTEMVALUE = 648, + D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE = 649, + D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_DESC = 650, + D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_LARGE_OFFSET = 651, + D3D12_MESSAGE_ID_CREATE_UNORDEREDACCESS_VIEW_INVALID_COUNTER_USAGE = 652, + D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES = 653, + D3D12_MESSAGE_ID_COPY_DESCRIPTORS_WRITE_ONLY_DESCRIPTOR = 654, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RTV_FORMAT_NOT_UNKNOWN = 655, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_RENDER_TARGET_COUNT = 656, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VERTEX_SHADER_NOT_SET = 657, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_NOT_SET = 658, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_HS_DS_SIGNATURE_MISMATCH = 659, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERINDEX = 660, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_COMPONENTTYPE = 661, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERMASK = 662, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SYSTEMVALUE = 663, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = 664, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_MINPRECISION = 665, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = 666, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_XOR_DS_MISMATCH = 667, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = 668, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_CONTROL_POINT_COUNT_MISMATCH = 669, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = 670, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = 671, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_FORCED_SAMPLE_COUNT = 672, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_PRIMITIVETOPOLOGY = 673, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SYSTEMVALUE = 674, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + = 675, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = 676, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_TYPE_MISMATCH = 677, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = 678, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDERTARGETVIEW_NOT_SET = 679, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DEPTHSTENCILVIEW_NOT_SET = 680, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_INPUT_PRIMITIVE_MISMATCH = 681, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_POSITION_NOT_PRESENT = 682, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE_FLAGS = 683, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_INDEX_BUFFER_PROPERTIES = 684, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SAMPLE_DESC = 685, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_ROOT_SIGNATURE_MISMATCH = 686, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DS_ROOT_SIGNATURE_MISMATCH = 687, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH = 688, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_ROOT_SIGNATURE_MISMATCH = 689, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_ROOT_SIGNATURE_MISMATCH = 690, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE = 691, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_OPEN_BUNDLE = 692, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_DESCRIPTOR_HEAP_MISMATCH = 693, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_TYPE = 694, + D3D12_MESSAGE_ID_DRAW_EMPTY_SCISSOR_RECTANGLE = 695, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_BLOB_NOT_FOUND = 696, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_DESERIALIZE_FAILED = 697, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_INVALID_CONFIGURATION = 698, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_SUPPORTED_ON_DEVICE = 699, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLRESOURCEPROPERTIES = 700, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAP = 701, + D3D12_MESSAGE_ID_GETRESOURCEALLOCATIONINFO_INVALIDRDESCS = 702, + D3D12_MESSAGE_ID_MAKERESIDENT_NULLOBJECTARRAY = 703, + D3D12_MESSAGE_ID_MAKERESIDENT_INVALIDOBJECT = 704, + D3D12_MESSAGE_ID_EVICT_NULLOBJECTARRAY = 705, + D3D12_MESSAGE_ID_EVICT_INVALIDOBJECT = 706, + D3D12_MESSAGE_ID_HEAPS_UNSUPPORTED = 707, + D3D12_MESSAGE_ID_SET_DESCRIPTOR_TABLE_INVALID = 708, + D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_INVALID = 709, + D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_BUFFER_VIEW_INVALID = 710, + D3D12_MESSAGE_ID_SET_ROOT_SHADER_RESOURCE_VIEW_INVALID = 711, + D3D12_MESSAGE_ID_SET_ROOT_UNORDERED_ACCESS_VIEW_INVALID = 712, + D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID_DESC = 713, + D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_LARGE_OFFSET = 714, + D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID_DESC = 715, + D3D12_MESSAGE_ID_SET_INDEX_BUFFER_LARGE_OFFSET = 716, + D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID_DESC = 717, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDDIMENSIONALITY = 718, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDLAYOUT = 719, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONALITY = 720, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT = 721, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMIPLEVELS = 722, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDSAMPLEDESC = 723, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDLAYOUT = 724, + D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID = 725, + D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID = 726, + D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID = 727, + D3D12_MESSAGE_ID_SET_RENDER_TARGETS_INVALID = 728, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_INVALID_PARAMETERS = 729, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_JPEG_NOT_SUPPORTED = 730, + D3D12_MESSAGE_ID_BEGIN_END_QUERY_INVALID_PARAMETERS = 731, + D3D12_MESSAGE_ID_CLOSE_COMMAND_LIST_OPEN_QUERY = 732, + D3D12_MESSAGE_ID_RESOLVE_QUERY_DATA_INVALID_PARAMETERS = 733, + D3D12_MESSAGE_ID_SET_PREDICATION_INVALID_PARAMETERS = 734, + D3D12_MESSAGE_ID_TIMESTAMPS_NOT_SUPPORTED = 735, + D3D12_MESSAGE_ID_UNSTABLE_POWER_STATE = 736, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDFORMAT = 737, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDFORMAT = 738, + D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDSUBRESOURCERANGE = 739, + D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDBASEOFFSET = 740, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_HEAP = 741, + D3D12_MESSAGE_ID_CREATE_SAMPLER_INVALID = 742, + D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID = 743, + D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS = 744, + D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION = 745, + D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDCONTEXTTYPE = 746, + D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_DECODENOTSUPPORTED = 747, + D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_ENCODENOTSUPPORTED = 748, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX = 749, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX = 750, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX = 751, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANEINDEX = 752, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANEINDEX = 753, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_AMBIGUOUSVIDEOPLANEINDEX = 754, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANEINDEX = 755, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANEINDEX = 756, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_AMBIGUOUSVIDEOPLANEINDEX = 757, + D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSCANDATAOFFSET = 758, + D3D12_MESSAGE_ID_JPEGDECODE_NOTSUPPORTED = 759, + D3D12_MESSAGE_ID_JPEGDECODE_DIMENSIONSTOOLARGE = 760, + D3D12_MESSAGE_ID_JPEGDECODE_INVALIDCOMPONENTS = 761, + D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDCOMPONENTS = 762, + D3D12_MESSAGE_ID_JPEGDECODE_DESTINATIONNOT2D = 763, + D3D12_MESSAGE_ID_JPEGDECODE_TILEDRESOURCESUNSUPPORTED = 764, + D3D12_MESSAGE_ID_JPEGDECODE_GUARDRECTSUNSUPPORTED = 765, + D3D12_MESSAGE_ID_JPEGDECODE_FORMATUNSUPPORTED = 766, + D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSUBRESOURCE = 767, + D3D12_MESSAGE_ID_JPEGDECODE_INVALIDMIPLEVEL = 768, + D3D12_MESSAGE_ID_JPEGDECODE_EMPTYDESTBOX = 769, + D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXNOT2D = 770, + D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXNOTSUB = 771, + D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXESINTERSECT = 772, + D3D12_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEMISMATCH = 773, + D3D12_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEMISMATCH = 774, + D3D12_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEODD = 775, + D3D12_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEODD = 776, + D3D12_MESSAGE_ID_JPEGDECODE_UPSCALEUNSUPPORTED = 777, + D3D12_MESSAGE_ID_JPEGDECODE_TIER4DOWNSCALETOLARGE = 778, + D3D12_MESSAGE_ID_JPEGDECODE_TIER3DOWNSCALEUNSUPPORTED = 779, + D3D12_MESSAGE_ID_JPEGDECODE_CHROMASIZEMISMATCH = 780, + D3D12_MESSAGE_ID_JPEGDECODE_LUMACHROMASIZEMISMATCH = 781, + D3D12_MESSAGE_ID_JPEGDECODE_INVALIDNUMDESTINATIONS = 782, + D3D12_MESSAGE_ID_JPEGDECODE_SUBBOXUNSUPPORTED = 783, + D3D12_MESSAGE_ID_JPEGDECODE_1DESTUNSUPPORTEDFORMAT = 784, + D3D12_MESSAGE_ID_JPEGDECODE_3DESTUNSUPPORTEDFORMAT = 785, + D3D12_MESSAGE_ID_JPEGDECODE_SCALEUNSUPPORTED = 786, + D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSOURCESIZE = 787, + D3D12_MESSAGE_ID_JPEGDECODE_INVALIDCOPYFLAGS = 788, + D3D12_MESSAGE_ID_JPEGDECODE_HAZARD = 789, + D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERUSAGE = 790, + D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS = 791, + D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE = 792, + D3D12_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED = 793, + D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPRTEDCOPYFLAGS = 794, + D3D12_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED = 795, + D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET = 796, + D3D12_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS = 797, + D3D12_MESSAGE_ID_JPEGENCODE_SOURCENOT2D = 798, + D3D12_MESSAGE_ID_JPEGENCODE_TILEDRESOURCESUNSUPPORTED = 799, + D3D12_MESSAGE_ID_JPEGENCODE_GUARDRECTSUNSUPPORTED = 800, + D3D12_MESSAGE_ID_JPEGENCODE_XSUBSAMPLEMISMATCH = 801, + D3D12_MESSAGE_ID_JPEGENCODE_YSUBSAMPLEMISMATCH = 802, + D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDCOMPONENTS = 803, + D3D12_MESSAGE_ID_JPEGENCODE_FORMATUNSUPPORTED = 804, + D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSUBRESOURCE = 805, + D3D12_MESSAGE_ID_JPEGENCODE_INVALIDMIPLEVEL = 806, + D3D12_MESSAGE_ID_JPEGENCODE_DIMENSIONSTOOLARGE = 807, + D3D12_MESSAGE_ID_JPEGENCODE_HAZARD = 808, + D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERUSAGE = 809, + D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS = 810, + D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE = 811, + D3D12_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED = 812, + D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTTYPEFORQUERY = 813, + D3D12_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE = 814, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE = 815, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT = 816, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUEFORMAT = 817, + D3D12_MESSAGE_ID_CREATERESOURCE_CLEARVALUEDENORMFLUSH = 818, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALIDDEPTH = 819, + D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE = 820, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE = 821, + D3D12_MESSAGE_ID_MAP_INVALIDHEAP = 822, + D3D12_MESSAGE_ID_UNMAP_INVALIDHEAP = 823, + D3D12_MESSAGE_ID_MAP_INVALIDRESOURCE = 824, + D3D12_MESSAGE_ID_UNMAP_INVALIDRESOURCE = 825, + D3D12_MESSAGE_ID_MAP_INVALIDSUBRESOURCE = 826, + D3D12_MESSAGE_ID_UNMAP_INVALIDSUBRESOURCE = 827, + D3D12_MESSAGE_ID_MAP_INVALIDRANGE = 828, + D3D12_MESSAGE_ID_UNMAP_INVALIDRANGE = 829, + D3D12_MESSAGE_ID_MAP_NULLRANGE = 830, + D3D12_MESSAGE_ID_UNMAP_NULLRANGE = 831, + D3D12_MESSAGE_ID_MAP_INVALIDDATAPOINTER = 832, + D3D12_MESSAGE_ID_MAP_INVALIDARG_RETURN = 833, + D3D12_MESSAGE_ID_MAP_OUTOFMEMORY_RETURN = 834, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_BUNDLENOTSUPPORTED = 835, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_COMMANDLISTMISMATCH = 836, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_OPENCOMMANDLIST = 837, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_FAILEDCOMMANDLIST = 838, + D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLDST = 839, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDDSTRESOURCEDIMENSION = 840, + D3D12_MESSAGE_ID_COPYBUFFERREGION_DSTRANGEOUTOFBOUNDS = 841, + D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLSRC = 842, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDSRCRESOURCEDIMENSION = 843, + D3D12_MESSAGE_ID_COPYBUFFERREGION_SRCRANGEOUTOFBOUNDS = 844, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDCOPYFLAGS = 845, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLDST = 846, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTTYPE = 847, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCEDIMENSION = 848, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCE = 849, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTSUBRESOURCE = 850, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTOFFSET = 851, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTFORMAT = 852, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTFORMAT = 853, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDIMENSIONS = 854, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTROWPITCH = 855, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTPLACEMENT = 856, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDSPLACEDFOOTPRINTFORMAT = 857, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_DSTREGIONOUTOFBOUNDS = 858, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLSRC = 859, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCTYPE = 860, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCEDIMENSION = 861, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCE = 862, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCSUBRESOURCE = 863, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCOFFSET = 864, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCFORMAT = 865, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCFORMAT = 866, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDIMENSIONS = 867, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCROWPITCH = 868, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCPLACEMENT = 869, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDSPLACEDFOOTPRINTFORMAT = 870, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_SRCREGIONOUTOFBOUNDS = 871, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTCOORDINATES = 872, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCBOX = 873, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_FORMATMISMATCH = 874, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_EMPTYBOX = 875, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDCOPYFLAGS = 876, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SUBRESOURCE_INDEX = 877, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_FORMAT = 878, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_MISMATCH = 879, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SAMPLE_COUNT = 880, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_INVALID_SHADER = 881, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH = 882, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_MISSING_ROOT_SIGNATURE = 883, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALIDCACHEDBLOB = 884, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBADAPTERMISMATCH = 885, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDRIVERVERSIONMISMATCH = 886, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDESCMISMATCH = 887, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBIGNORED = 888, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDHEAP = 889, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDRESOURCE = 890, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDBOX = 891, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDSUBRESOURCE = 892, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_EMPTYBOX = 893, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDHEAP = 894, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDRESOURCE = 895, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDBOX = 896, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDSUBRESOURCE = 897, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_EMPTYBOX = 898, + D3D12_MESSAGE_ID_TOO_MANY_NODES_SPECIFIED = 899, + D3D12_MESSAGE_ID_INVALID_NODE_INDEX = 900, + D3D12_MESSAGE_ID_GETHEAPPROPERTIES_INVALIDRESOURCE = 901, + D3D12_MESSAGE_ID_NODE_MASK_MISMATCH = 902, + D3D12_MESSAGE_ID_COMMAND_LIST_OUTOFMEMORY = 903, + D3D12_MESSAGE_ID_COMMAND_LIST_MULTIPLE_SWAPCHAIN_BUFFER_REFERENCES = 904, + D3D12_MESSAGE_ID_COMMAND_LIST_TOO_MANY_SWAPCHAIN_REFERENCES = 905, + D3D12_MESSAGE_ID_COMMAND_QUEUE_TOO_MANY_SWAPCHAIN_REFERENCES = 906, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE = 907, + D3D12_MESSAGE_ID_COMMAND_LIST_SETRENDERTARGETS_INVALIDNUMRENDERTARGETS = 908, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_TYPE = 909, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_FLAGS = 910, + D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFLAGS = 911, + D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFORMAT = 912, + D3D12_MESSAGE_ID_CREATESHAREDHEAP_INVALIDFLAGS = 913, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_UNRECOGNIZEDPROPERTIES = 914, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDSIZE = 915, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDOBJECT = 916, + D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDOBJECT = 917, + D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDKEY = 918, + D3D12_MESSAGE_ID_KEYEDMUTEX_WRONGSTATE = 919, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_PRIORITY = 920, + D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE = 921, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_FLAGS = 922, + D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_HAS_NO_RESOURCE = 923, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RENDER_TARGET_DELETED = 924, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_ALL_RENDER_TARGETS_HAVE_UNKNOWN_FORMAT = 925, + D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_INTERSECTS_MULTIPLE_BUFFERS = 926, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_GPU_WRITTEN_READBACK_RESOURCE_MAPPED = 927, + D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_NEEDED = 928, + D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_EMPTY = 929, + D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE = 930, + D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE = 931, + D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT = 932, + D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT = 933, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_FLAGS_NOT_SUPPORTED = 934, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_ARGUMENT_UNINITIALIZED = 935, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_HEAP_INDEX_OUT_OF_BOUNDS = 936, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TABLE_REGISTER_INDEX_OUT_OF_BOUNDS = 937, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_UNINITIALIZED = 938, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TYPE_MISMATCH = 939, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SRV_RESOURCE_DIMENSION_MISMATCH = 940, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UAV_RESOURCE_DIMENSION_MISMATCH = 941, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE = 942, + D3D12_MESSAGE_ID_COPYRESOURCE_NULLDST = 943, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDSTRESOURCE = 944, + D3D12_MESSAGE_ID_COPYRESOURCE_NULLSRC = 945, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSRCRESOURCE = 946, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLDST = 947, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDDSTRESOURCE = 948, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLSRC = 949, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDSRCRESOURCE = 950, + D3D12_MESSAGE_ID_PIPELINE_STATE_TYPE_MISMATCH = 951, + D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_NOT_SET = 952, + D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_MISMATCH = 953, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_ZERO_BARRIERS = 954, + D3D12_MESSAGE_ID_BEGIN_END_EVENT_MISMATCH = 955, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_POSSIBLE_BEFORE_AFTER_MISMATCH = 956, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_BEGIN_END = 957, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INVALID_RESOURCE = 958, + D3D12_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT = 959, + D3D12_MESSAGE_ID_OBJECT_EVICTED_WHILE_STILL_IN_USE = 960, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_DESCRIPTOR_ACCESS_OUT_OF_BOUNDS = 961, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_INVALIDLIBRARYBLOB = 962, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_DRIVERVERSIONMISMATCH = 963, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_ADAPTERVERSIONMISMATCH = 964, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_UNSUPPORTED = 965, + D3D12_MESSAGE_ID_CREATE_PIPELINELIBRARY = 966, + D3D12_MESSAGE_ID_LIVE_PIPELINELIBRARY = 967, + D3D12_MESSAGE_ID_DESTROY_PIPELINELIBRARY = 968, + D3D12_MESSAGE_ID_STOREPIPELINE_NONAME = 969, + D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME = 970, + D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND = 971, + D3D12_MESSAGE_ID_LOADPIPELINE_INVALIDDESC = 972, + D3D12_MESSAGE_ID_PIPELINELIBRARY_SERIALIZE_NOTENOUGHMEMORY = 973, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_RT_OUTPUT_MISMATCH = 974, + D3D12_MESSAGE_ID_SETEVENTONMULTIPLEFENCECOMPLETION_INVALIDFLAGS = 975, + D3D12_MESSAGE_ID_CREATE_QUEUE_VIDEO_NOT_SUPPORTED = 976, + D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_VIDEO_NOT_SUPPORTED = 977, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_VIDEO_DECODE_STATISTICS_NOT_SUPPORTED = 978, + D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDLIST = 979, + D3D12_MESSAGE_ID_CREATE_VIDEODECODER = 980, + D3D12_MESSAGE_ID_CREATE_VIDEODECODESTREAM = 981, + D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDLIST = 982, + D3D12_MESSAGE_ID_LIVE_VIDEODECODER = 983, + D3D12_MESSAGE_ID_LIVE_VIDEODECODESTREAM = 984, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDLIST = 985, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODER = 986, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODESTREAM = 987, + D3D12_MESSAGE_ID_DECODE_FRAME_INVALID_PARAMETERS = 988, + D3D12_MESSAGE_ID_DEPRECATED_API = 989, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE = 990, + D3D12_MESSAGE_ID_COMMAND_LIST_DESCRIPTOR_TABLE_NOT_SET = 991, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_CONSTANT_BUFFER_VIEW_NOT_SET = 992, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_SHADER_RESOURCE_VIEW_NOT_SET = 993, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_UNORDERED_ACCESS_VIEW_NOT_SET = 994, + D3D12_MESSAGE_ID_DISCARD_INVALID_SUBRESOURCE_RANGE = 995, + D3D12_MESSAGE_ID_DISCARD_ONE_SUBRESOURCE_FOR_MIPS_WITH_RECTS = 996, + D3D12_MESSAGE_ID_DISCARD_NO_RECTS_FOR_NON_TEXTURE2D = 997, + D3D12_MESSAGE_ID_COPY_ON_SAME_SUBRESOURCE = 998, + D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PAGEABLE = 999, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED = 1000, + D3D12_MESSAGE_ID_STATIC_DESCRIPTOR_INVALID_DESCRIPTOR_CHANGE = 1001, + D3D12_MESSAGE_ID_DATA_STATIC_DESCRIPTOR_INVALID_DATA_CHANGE = 1002, + D3D12_MESSAGE_ID_DATA_STATIC_WHILE_SET_AT_EXECUTE_DESCRIPTOR_INVALID_DATA_CHANGE = 1003, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_STATIC_DESCRIPTOR_DATA_STATIC_NOT_SET = 1004, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_ACCESS_OUT_OF_BOUNDS = 1005, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SAMPLER_MODE_MISMATCH = 1006, + D3D12_MESSAGE_ID_CREATE_FENCE_INVALID_FLAGS = 1007, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_DUPLICATE_SUBRESOURCE_TRANSITIONS = 1008, + D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PRIORITY = 1009, + D3D12_MESSAGE_ID_CREATE_PASS = 1010, + D3D12_MESSAGE_ID_DESTROY_PASS = 1011, + D3D12_MESSAGE_ID_LIVE_PASS = 1012, + D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_LARGE_NUM_DESCRIPTORS = 1013, + D3D12_MESSAGE_ID_BEGIN_EVENT = 1014, + D3D12_MESSAGE_ID_END_EVENT = 1015, + D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS = 1016, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_DEPTHBOUNDSTEST_UNSUPPORTED = 1017, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_DUPLICATE_SUBOBJECT = 1018, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_UNKNOWN_SUBOBJECT = 1019, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_ZERO_SIZE_STREAM = 1020, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_STREAM = 1021, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CANNOT_DEDUCE_TYPE = 1022, + D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_RESOURCE_DIMENSION_MISMATCH = 1023, + D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_PRIVILEGE_FOR_GLOBAL_REALTIME = 1024, + D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_HARDWARE_SUPPORT_FOR_GLOBAL_REALTIME = 1025, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_ARCHITECTURE = 1026, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DST = 1027, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE_DIMENSION = 1028, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DST_RANGE_OUT_OF_BOUNDS = 1029, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_SRC = 1030, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE_DIMENSION = 1031, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_SRC_RANGE_OUT_OF_BOUNDS = 1032, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_OFFSET_ALIGNMENT = 1033, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_RESOURCES = 1034, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_SUBRESOURCE_RANGES = 1035, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_RESOURCE = 1036, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_SUBRESOURCE_RANGE = 1037, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_SUBRESOURCE_OUT_OF_BOUNDS = 1038, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_RANGE_OUT_OF_BOUNDS = 1039, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_ZERO_DEPENDENCIES = 1040, + D3D12_MESSAGE_ID_DEVICE_CREATE_SHARED_HANDLE_INVALIDARG = 1041, + D3D12_MESSAGE_ID_DESCRIPTOR_HANDLE_WITH_INVALID_RESOURCE = 1042, + D3D12_MESSAGE_ID_SETDEPTHBOUNDS_INVALIDARGS = 1043, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_STATE_IMPRECISE = 1044, + D3D12_MESSAGE_ID_COMMAND_LIST_PIPELINE_STATE_NOT_SET = 1045, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_MODEL_MISMATCH = 1046, + D3D12_MESSAGE_ID_OBJECT_ACCESSED_WHILE_STILL_IN_USE = 1047, + D3D12_MESSAGE_ID_PROGRAMMABLE_MSAA_UNSUPPORTED = 1048, + D3D12_MESSAGE_ID_SETSAMPLEPOSITIONS_INVALIDARGS = 1049, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCEREGION_INVALID_RECT = 1050, + D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDQUEUE = 1051, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDLIST = 1052, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDQUEUE = 1053, + D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDQUEUE = 1054, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDLIST = 1055, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDQUEUE = 1056, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDQUEUE = 1057, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDLIST = 1058, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDQUEUE = 1059, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSOR = 1060, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSSTREAM = 1061, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSOR = 1062, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSSTREAM = 1063, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSOR = 1064, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSSTREAM = 1065, + D3D12_MESSAGE_ID_PROCESS_FRAME_INVALID_PARAMETERS = 1066, + D3D12_MESSAGE_ID_COPY_INVALIDLAYOUT = 1067, + D3D12_MESSAGE_ID_D3D12_MESSAGES_END = 1068, +}} +STRUCT!{struct D3D12_MESSAGE { + Category: D3D12_MESSAGE_CATEGORY, + Severity: D3D12_MESSAGE_SEVERITY, + ID: D3D12_MESSAGE_ID, + pDescription: *const c_char, + DescriptionByteLength: SIZE_T, +}} +STRUCT!{struct D3D12_INFO_QUEUE_FILTER_DESC { + NumCategories: UINT, + pCategoryList: *mut D3D12_MESSAGE_CATEGORY, + NumSeverities: UINT, + pSeverityList: *mut D3D12_MESSAGE_SEVERITY, + NumIDs: UINT, + pIDList: *mut D3D12_MESSAGE_ID, +}} +STRUCT!{struct D3D12_INFO_QUEUE_FILTER { + AllowList: D3D12_INFO_QUEUE_FILTER_DESC, + DenyList: D3D12_INFO_QUEUE_FILTER_DESC, +}} +pub const D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT: UINT = 1024; +RIDL!{#[uuid(0x0742a90b, 0xc387, 0x483f, 0xb9, 0x46, 0x30, 0xa7, 0xe4, 0xe6, 0x14, 0x58)] +interface ID3D12InfoQueue(ID3D12InfoQueueVtbl): IUnknown(IUnknownVtbl) { + fn SetMessageCountLimit( + MessageCountLimit: UINT64, + ) -> HRESULT, + fn ClearStoredMessages() -> (), + fn GetMessage( + MessageIndex: UINT64, + pMessage: *mut D3D12_MESSAGE, + pMessageByteLength: *mut SIZE_T, + ) -> HRESULT, + fn GetNumMessagesAllowedByStorageFilter() -> UINT64, + fn GetNumMessagesDeniedByStorageFilter() -> UINT64, + fn GetNumStoredMessages() -> UINT64, + fn GetNumStoredMessagesAllowedByRetrievalFilter() -> UINT64, + fn GetNumMessagesDiscardedByMessageCountLimit() -> UINT64, + fn GetMessageCountLimit() -> UINT64, + fn AddStorageFilterEntries( + pFilter: *mut D3D12_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn GetStorageFilter( + pFilter: *mut D3D12_INFO_QUEUE_FILTER, + pFilterByteLength: *mut SIZE_T, + ) -> HRESULT, + fn ClearStorageFilter() -> (), + fn PushEmptyStorageFilter() -> HRESULT, + fn PushCopyOfStorageFilter() -> HRESULT, + fn PushStorageFilter( + pFilter: *mut D3D12_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn PopStorageFilter() -> (), + fn GetStorageFilterStackSize() -> UINT, + fn AddRetrievalFilterEntries( + pFilter: *mut D3D12_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn GetRetrievalFilter( + pFilter: *mut D3D12_INFO_QUEUE_FILTER, + pFilterByteLength: *mut SIZE_T, + ) -> HRESULT, + fn ClearRetrievalFilter() -> (), + fn PushEmptyRetrievalFilter() -> HRESULT, + fn PushCopyOfRetrievalFilter() -> HRESULT, + fn PushRetrievalFilter( + pFilter: *mut D3D12_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn PopRetrievalFilter() -> (), + fn GetRetrievalFilterStackSize() -> UINT, + fn AddMessage( + Category: D3D12_MESSAGE_CATEGORY, + Severity: D3D12_MESSAGE_SEVERITY, + ID: D3D12_MESSAGE_ID, + pDescription: LPCSTR, + ) -> HRESULT, + fn AddApplicationMessage( + Severity: D3D12_MESSAGE_SEVERITY, + pDescription: LPCSTR, + ) -> HRESULT, + fn SetBreakOnCategory( + Category: D3D12_MESSAGE_CATEGORY, + bEnable: BOOL, + ) -> HRESULT, + fn SetBreakOnSeverity( + Severity: D3D12_MESSAGE_SEVERITY, + bEnable: BOOL, + ) -> HRESULT, + fn SetBreakOnID( + ID: D3D12_MESSAGE_ID, + bEnable: BOOL, + ) -> HRESULT, + fn GetBreakOnCategory( + Category: D3D12_MESSAGE_CATEGORY, + ) -> BOOL, + fn GetBreakOnSeverity( + Severity: D3D12_MESSAGE_SEVERITY, + ) -> BOOL, + fn GetBreakOnID( + ID: D3D12_MESSAGE_ID, + ) -> BOOL, + fn SetMuteDebugOutput( + bMute: BOOL, + ) -> (), + fn GetMuteDebugOutput() -> BOOL, +}} +DEFINE_GUID!{IID_ID3D12Debug, + 0x344488b7, 0x6846, 0x474b, 0xb9, 0x89, 0xf0, 0x27, 0x44, 0x82, 0x45, 0xe0} +DEFINE_GUID!{IID_ID3D12Debug1, + 0xaffaa4ca, 0x63fe, 0x4d8e, 0xb8, 0xad, 0x15, 0x90, 0x00, 0xaf, 0x43, 0x04} +DEFINE_GUID!{IID_ID3D12Debug2, + 0x93a665c4, 0xa3b2, 0x4e5d, 0xb6, 0x92, 0xa2, 0x6a, 0xe1, 0x4e, 0x33, 0x74} +DEFINE_GUID!{IID_ID3D12DebugDevice1, + 0xa9b71770, 0xd099, 0x4a65, 0xa6, 0x98, 0x3d, 0xee, 0x10, 0x02, 0x0f, 0x88} +DEFINE_GUID!{IID_ID3D12DebugDevice, + 0x3febd6dd, 0x4973, 0x4787, 0x81, 0x94, 0xe4, 0x5f, 0x9e, 0x28, 0x92, 0x3e} +DEFINE_GUID!{IID_ID3D12DebugCommandQueue, + 0x09e0bf36, 0x54ac, 0x484f, 0x88, 0x47, 0x4b, 0xae, 0xea, 0xb6, 0x05, 0x3a} +DEFINE_GUID!{IID_ID3D12DebugCommandList1, + 0x102ca951, 0x311b, 0x4b01, 0xb1, 0x1f, 0xec, 0xb8, 0x3e, 0x06, 0x1b, 0x37} +DEFINE_GUID!{IID_ID3D12DebugCommandList, + 0x09e0bf36, 0x54ac, 0x484f, 0x88, 0x47, 0x4b, 0xae, 0xea, 0xb6, 0x05, 0x3f} +DEFINE_GUID!{IID_ID3D12InfoQueue, + 0x0742a90b, 0xc387, 0x483f, 0xb9, 0x46, 0x30, 0xa7, 0xe4, 0xe6, 0x14, 0x58} diff --git a/bash-5.1/vendor/winapi/src/um/d3d12shader.rs b/bash-5.1/vendor/winapi/src/um/d3d12shader.rs new file mode 100644 index 0000000000000000000000000000000000000000..f07bf83a64527bf108ab3d122e01d528e137d66a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3d12shader.rs @@ -0,0 +1,347 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::UINT64; +use shared::minwindef::{BOOL, BYTE, INT, LPVOID, UINT}; +use um::d3dcommon::{ + D3D_CBUFFER_TYPE, D3D_FEATURE_LEVEL, D3D_INTERPOLATION_MODE, D3D_MIN_PRECISION, D3D_NAME, + D3D_PARAMETER_FLAGS, D3D_PRIMITIVE, D3D_PRIMITIVE_TOPOLOGY, D3D_REGISTER_COMPONENT_TYPE, + D3D_RESOURCE_RETURN_TYPE, D3D_SHADER_INPUT_TYPE, D3D_SHADER_VARIABLE_CLASS, + D3D_SHADER_VARIABLE_TYPE, D3D_SRV_DIMENSION, D3D_TESSELLATOR_DOMAIN, + D3D_TESSELLATOR_OUTPUT_PRIMITIVE, D3D_TESSELLATOR_PARTITIONING, +}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCSTR}; +ENUM!{enum D3D12_SHADER_VERSION_TYPE { + D3D12_SHVER_PIXEL_SHADER = 0x0, + D3D12_SHVER_VERTEX_SHADER = 0x1, + D3D12_SHVER_GEOMETRY_SHADER = 0x2, + D3D12_SHVER_HULL_SHADER = 0x3, + D3D12_SHVER_DOMAIN_SHADER = 0x4, + D3D12_SHVER_COMPUTE_SHADER = 0x5, + D3D12_SHVER_RESERVED0 = 0xFFF0, +}} +STRUCT!{struct D3D12_FUNCTION_DESC { + Version: UINT, + Creator: LPCSTR, + Flags: UINT, + ConstantBuffers: UINT, + BoundResources: UINT, + InstructionCount: UINT, + TempRegisterCount: UINT, + TempArrayCount: UINT, + DefCount: UINT, + DclCount: UINT, + TextureNormalInstructions: UINT, + TextureLoadInstructions: UINT, + TextureCompInstructions: UINT, + TextureBiasInstructions: UINT, + TextureGradientInstructions: UINT, + FloatInstructionCount: UINT, + IntInstructionCount: UINT, + UintInstructionCount: UINT, + StaticFlowControlCount: UINT, + DynamicFlowControlCount: UINT, + MacroInstructionCount: UINT, + ArrayInstructionCount: UINT, + MovInstructionCount: UINT, + MovcInstructionCount: UINT, + ConversionInstructionCount: UINT, + BitwiseInstructionCount: UINT, + MinFeatureLevel: D3D_FEATURE_LEVEL, + RequiredFeatureFlags: UINT64, + Name: LPCSTR, + FunctionParameterCount: INT, + HasReturn: BOOL, + Has10Level9VertexShader: BOOL, + Has10Level9PixelShader: BOOL, +}} +STRUCT!{struct D3D12_LIBRARY_DESC { + Creator: LPCSTR, + Flags: UINT, + FunctionCount: UINT, +}} +STRUCT!{struct D3D12_PARAMETER_DESC { + Name: LPCSTR, + SemanticName: LPCSTR, + Type: D3D_SHADER_VARIABLE_TYPE, + Class: D3D_SHADER_VARIABLE_CLASS, + Rows: UINT, + Columns: UINT, + InterpolationMode: D3D_INTERPOLATION_MODE, + Flags: D3D_PARAMETER_FLAGS, + FirstInRegister: UINT, + FirstInComponent: UINT, + FirstOutRegister: UINT, + FirstOutComponent: UINT, +}} +STRUCT!{struct D3D12_SHADER_BUFFER_DESC { + Name: LPCSTR, + Type: D3D_CBUFFER_TYPE, + Variables: UINT, + Size: UINT, + uFlags: UINT, +}} +STRUCT!{struct D3D12_SHADER_DESC { + Version: UINT, + Creator: LPCSTR, + Flags: UINT, + ConstantBuffers: UINT, + BoundResources: UINT, + InputParameters: UINT, + OutputParameters: UINT, + InstructionCount: UINT, + TempRegisterCount: UINT, + TempArrayCount: UINT, + DefCount: UINT, + DclCount: UINT, + TextureNormalInstructions: UINT, + TextureLoadInstructions: UINT, + TextureCompInstructions: UINT, + TextureBiasInstructions: UINT, + TextureGradientInstructions: UINT, + FloatInstructionCount: UINT, + IntInstructionCount: UINT, + UintInstructionCount: UINT, + StaticFlowControlCount: UINT, + DynamicFlowControlCount: UINT, + MacroInstructionCount: UINT, + ArrayInstructionCount: UINT, + CutInstructionCount: UINT, + EmitInstructionCount: UINT, + GSOutputTopology: D3D_PRIMITIVE_TOPOLOGY, + GSMaxOutputVertexCount: UINT, + InputPrimitive: D3D_PRIMITIVE, + PatchConstantParameters: UINT, + cGSInstanceCount: UINT, + cControlPoints: UINT, + HSOutputPrimitive: D3D_TESSELLATOR_OUTPUT_PRIMITIVE, + HSPartitioning: D3D_TESSELLATOR_PARTITIONING, + TessellatorDomain: D3D_TESSELLATOR_DOMAIN, + cBarrierInstructions: UINT, + cInterlockedInstructions: UINT, + cTextureStoreInstructions: UINT, +}} +STRUCT!{struct D3D12_SHADER_INPUT_BIND_DESC { + Name: LPCSTR, + Type: D3D_SHADER_INPUT_TYPE, + BindPoint: UINT, + BindCount: UINT, + uFlags: UINT, + ReturnType: D3D_RESOURCE_RETURN_TYPE, + Dimension: D3D_SRV_DIMENSION, + NumSamples: UINT, + Space: UINT, + uID: UINT, +}} +STRUCT!{struct D3D12_SHADER_TYPE_DESC { + Class: D3D_SHADER_VARIABLE_CLASS, + Type: D3D_SHADER_VARIABLE_TYPE, + Rows: UINT, + Columns: UINT, + Elements: UINT, + Members: UINT, + Offset: UINT, + Name: LPCSTR, +}} +STRUCT!{struct D3D12_SHADER_VARIABLE_DESC { + Name: LPCSTR, + StartOffset: UINT, + Size: UINT, + uFlags: UINT, + DefaultValue: LPVOID, + StartTexture: UINT, + TextureSize: UINT, + StartSampler: UINT, + SamplerSize: UINT, +}} +STRUCT!{struct D3D12_SIGNATURE_PARAMETER_DESC { + SemanticName: LPCSTR, + SemanticIndex: UINT, + Register: UINT, + SystemValueType: D3D_NAME, + ComponentType: D3D_REGISTER_COMPONENT_TYPE, + Mask: BYTE, + ReadWriteMask: BYTE, + Stream: UINT, + MinPrecision: D3D_MIN_PRECISION, +}} +RIDL!{#[uuid(0xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x02, 0xcc, 0x33, 0x75, 0x73, 0x3f)] +interface ID3D12FunctionParameterReflection(ID3D12FunctionParameterReflectionVtbl) { + fn GetDesc( + pDesc: *mut D3D12_PARAMETER_DESC, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99)] +interface ID3D12FunctionReflection(ID3D12FunctionReflectionVtbl) { + fn GetDesc( + pDesc: *mut D3D12_FUNCTION_DESC, + ) -> HRESULT, + fn GetConstantBufferByIndex( + BufferIndex: UINT, + ) -> *mut ID3D12ShaderReflectionConstantBuffer, + fn GetConstantBufferByName( + Name: LPCSTR, + ) -> *mut ID3D12ShaderReflectionConstantBuffer, + fn GetResourceBindingDesc( + ResourceIndex: UINT, + pDesc: *mut D3D12_SHADER_INPUT_BIND_DESC, + ) -> HRESULT, + fn GetVariableByName( + Name: LPCSTR, + ) -> *mut ID3D12ShaderReflectionVariable, + fn GetResourceBindingDescByName( + Name: LPCSTR, + pDesc: *mut D3D12_SHADER_INPUT_BIND_DESC, + ) -> HRESULT, + fn GetFunctionParameter( + ParameterIndex: INT, + ) -> *mut ID3D12FunctionParameterReflection, +}} +RIDL!{#[uuid(0x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4)] +interface ID3D12LibraryReflection(ID3D12LibraryReflectionVtbl): IUnknown(IUnknownVtbl) { + fn GetDesc( + pDesc: *mut D3D12_LIBRARY_DESC, + ) -> HRESULT, + fn GetFunctionByIndex( + FunctionIndex: INT, + ) -> *mut ID3D12FunctionReflection, +}} +DEFINE_GUID!{IID_ID3D12ShaderReflectionConstantBuffer, + 0xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7} +RIDL!{#[uuid(0xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7)] +interface ID3D12ShaderReflectionConstantBuffer(ID3D12ShaderReflectionConstantBufferVtbl) { + fn GetDesc( + pDesc: *mut D3D12_SHADER_BUFFER_DESC, + ) -> HRESULT, + fn GetVariableByIndex( + Index: UINT, + ) -> *mut ID3D12ShaderReflectionVariable, + fn GetVariableByName( + Name: LPCSTR, + ) -> *mut ID3D12ShaderReflectionVariable, +}} +DEFINE_GUID!{IID_ID3D12ShaderReflectionType, + 0xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56} +RIDL!{#[uuid(0xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56)] +interface ID3D12ShaderReflectionType(ID3D12ShaderReflectionTypeVtbl) { + fn GetDesc( + pDesc: *mut D3D12_SHADER_TYPE_DESC, + ) -> HRESULT, + fn GetMemberTypeByIndex( + Index: UINT, + ) -> *mut ID3D12ShaderReflectionType, + fn GetMemberTypeByName( + Name: LPCSTR, + ) -> *mut ID3D12ShaderReflectionType, + fn GetMemberTypeName( + Index: UINT, + ) -> LPCSTR, + fn IsEqual( + pType: *mut ID3D12ShaderReflectionType, + ) -> HRESULT, + fn GetSubType() -> *mut ID3D12ShaderReflectionType, + fn GetBaseClass() -> *mut ID3D12ShaderReflectionType, + fn GetNumInterfaces() -> UINT, + fn GetInterfaceByIndex( + uIndex: UINT, + ) -> *mut ID3D12ShaderReflectionType, + fn IsOfType( + pType: *mut ID3D12ShaderReflectionType, + ) -> HRESULT, + fn ImplementsInterface( + pBase: *mut ID3D12ShaderReflectionType, + ) -> HRESULT, +}} +DEFINE_GUID!{IID_ID3D12ShaderReflectionVariable, + 0x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea} +RIDL!{#[uuid(0x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea)] +interface ID3D12ShaderReflectionVariable(ID3D12ShaderReflectionVariableVtbl) { + fn GetDesc( + pDesc: *mut D3D12_SHADER_VARIABLE_DESC, + ) -> HRESULT, + fn GetType() -> *mut ID3D12ShaderReflectionType, + fn GetBuffer() -> *mut ID3D12ShaderReflectionConstantBuffer, + fn GetInterfaceSlot( + uArrayIndex: UINT, + ) -> UINT, +}} +DEFINE_GUID!{IID_ID3D12ShaderReflection, + 0x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e} +RIDL!{#[uuid(0x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e)] +interface ID3D12ShaderReflection(ID3D12ShaderReflectionVtbl): IUnknown(IUnknownVtbl) { + fn GetDesc( + pDesc: *mut D3D12_SHADER_DESC, + ) -> HRESULT, + fn GetConstantBufferByIndex( + Index: UINT, + ) -> *mut ID3D12ShaderReflectionConstantBuffer, + fn GetConstantBufferByName( + Name: LPCSTR, + ) -> *mut ID3D12ShaderReflectionConstantBuffer, + fn GetResourceBindingDesc( + ResourceIndex: UINT, + pDesc: *mut D3D12_SHADER_INPUT_BIND_DESC, + ) -> HRESULT, + fn GetInputParameterDesc( + ParameterIndex: UINT, + pDesc: *mut D3D12_SIGNATURE_PARAMETER_DESC, + ) -> HRESULT, + fn GetOutputParameterDesc( + ParameterIndex: UINT, + pDesc: *mut D3D12_SIGNATURE_PARAMETER_DESC, + ) -> HRESULT, + fn GetPatchConstantParameterDesc( + ParameterIndex: UINT, + pDesc: *mut D3D12_SIGNATURE_PARAMETER_DESC, + ) -> HRESULT, + fn GetVariableByName( + Name: LPCSTR, + ) -> *mut ID3D12ShaderReflectionVariable, + fn GetResourceBindingDescByName( + Name: LPCSTR, + pDesc: *mut D3D12_SHADER_INPUT_BIND_DESC, + ) -> HRESULT, + fn GetMovInstructionCount() -> UINT, + fn GetMovcInstructionCount() -> UINT, + fn GetConversionInstructionCount() -> UINT, + fn GetBitwiseInstructionCount() -> UINT, + fn GetGSInputPrimitive() -> D3D_PRIMITIVE, + fn IsSampleFrequencyShader() -> BOOL, + fn GetNumInterfaceSlots() -> UINT, + fn GetMinFeatureLevel( + pLevel: *mut D3D_FEATURE_LEVEL, + ) -> HRESULT, + fn GetThreadGroupSize( + pSizeX: *mut UINT, + pSizeY: *mut UINT, + pSizeZ: *mut UINT, + ) -> UINT, + fn GetRequiresFlags() -> UINT64, +}} +DEFINE_GUID!{IID_ID3D12LibraryReflection, + 0x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x04} +DEFINE_GUID!{IID_ID3D12FunctionReflection, + 0x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99} +DEFINE_GUID!{IID_ID3D12FunctionParameterReflection, + 0xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x02, 0xcc, 0x33, 0x75, 0x73, 0x3f} +pub type D3D12_CBUFFER_TYPE = D3D_CBUFFER_TYPE; +pub type D3D12_RESOURCE_RETURN_TYPE = D3D_RESOURCE_RETURN_TYPE; +pub type D3D12_TESSELLATOR_DOMAIN = D3D_TESSELLATOR_DOMAIN; +pub type D3D12_TESSELLATOR_OUTPUT_PRIMITIVE = D3D_TESSELLATOR_OUTPUT_PRIMITIVE; +pub type D3D12_TESSELLATOR_PARTITIONING = D3D_TESSELLATOR_PARTITIONING; +pub type LPD3D12FUNCTIONPARAMETERREFLECTION = *mut ID3D12FunctionParameterReflection; +pub type LPD3D12FUNCTIONREFLECTION = *mut ID3D12FunctionReflection; +pub type LPD3D12LIBRARYREFLECTION = *mut ID3D12LibraryReflection; +pub type LPD3D12SHADERREFLECTION = *mut ID3D12ShaderReflection; +pub type LPD3D12SHADERREFLECTIONCONSTANTBUFFER = *mut ID3D12ShaderReflectionConstantBuffer; +pub type LPD3D12SHADERREFLECTIONTYPE = *mut ID3D12ShaderReflectionType; +pub type LPD3D12SHADERREFLECTIONVARIABLE = *mut ID3D12ShaderReflectionVariable; +pub const D3D_SHADER_REQUIRES_INNER_COVERAGE: UINT64 = 0x00000400; +pub const D3D_SHADER_REQUIRES_ROVS: UINT64 = 0x00001000; +pub const D3D_SHADER_REQUIRES_STENCIL_REF: UINT64 = 0x00000200; +pub const D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS: UINT64 = 0x00000800; +pub const D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER: + UINT64 = 0x00002000; diff --git a/bash-5.1/vendor/winapi/src/um/d3dcommon.rs b/bash-5.1/vendor/winapi/src/um/d3dcommon.rs new file mode 100644 index 0000000000000000000000000000000000000000..b4f67dd129487ba87f422f257caa76737d1b5cd6 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3dcommon.rs @@ -0,0 +1,744 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of d3dcommon.h +use shared::basetsd::SIZE_T; +use shared::minwindef::{LPCVOID, LPVOID, UINT}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCSTR}; +ENUM!{enum D3D_DRIVER_TYPE { + D3D_DRIVER_TYPE_UNKNOWN, + D3D_DRIVER_TYPE_HARDWARE, + D3D_DRIVER_TYPE_REFERENCE, + D3D_DRIVER_TYPE_NULL, + D3D_DRIVER_TYPE_SOFTWARE, + D3D_DRIVER_TYPE_WARP, +}} +ENUM!{enum D3D_FEATURE_LEVEL { + D3D_FEATURE_LEVEL_9_1 = 0x9100, + D3D_FEATURE_LEVEL_9_2 = 0x9200, + D3D_FEATURE_LEVEL_9_3 = 0x9300, + D3D_FEATURE_LEVEL_10_0 = 0xa000, + D3D_FEATURE_LEVEL_10_1 = 0xa100, + D3D_FEATURE_LEVEL_11_0 = 0xb000, + D3D_FEATURE_LEVEL_11_1 = 0xb100, + D3D_FEATURE_LEVEL_12_0 = 0xc000, + D3D_FEATURE_LEVEL_12_1 = 0xc100, +}} +ENUM!{enum D3D_PRIMITIVE_TOPOLOGY { + D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0, + D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1, + D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, + D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13, + D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33, + D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34, + D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35, + D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36, + D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37, + D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38, + D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39, + D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40, + D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41, + D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42, + D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43, + D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44, + D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45, + D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46, + D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47, + D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48, + D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49, + D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50, + D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51, + D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52, + D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53, + D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54, + D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55, + D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56, + D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57, + D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58, + D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59, + D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60, + D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61, + D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62, + D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63, + D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64, +}} +pub const D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_UNDEFINED; +pub const D3D10_PRIMITIVE_TOPOLOGY_POINTLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_POINTLIST; +pub const D3D10_PRIMITIVE_TOPOLOGY_LINELIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_LINELIST; +pub const D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP; +pub const D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; +pub const D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP; +pub const D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ; +pub const D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ; +pub const D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ; +pub const D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ; +pub const D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_UNDEFINED; +pub const D3D11_PRIMITIVE_TOPOLOGY_POINTLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_POINTLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_LINELIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_LINELIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP; +pub const D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP; +pub const D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ; +pub const D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ; +pub const D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ; +pub const D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ; +pub const D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST; +pub const D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST: D3D_PRIMITIVE_TOPOLOGY = + D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST; +ENUM!{enum D3D_PRIMITIVE { + D3D_PRIMITIVE_UNDEFINED = 0, + D3D_PRIMITIVE_POINT = 1, + D3D_PRIMITIVE_LINE = 2, + D3D_PRIMITIVE_TRIANGLE = 3, + D3D_PRIMITIVE_LINE_ADJ = 6, + D3D_PRIMITIVE_TRIANGLE_ADJ = 7, + D3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 8, + D3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 9, + D3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 10, + D3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 11, + D3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 12, + D3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 13, + D3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 14, + D3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 15, + D3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 16, + D3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 17, + D3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 18, + D3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 19, + D3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 20, + D3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 21, + D3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 22, + D3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 23, + D3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 24, + D3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 25, + D3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 26, + D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 28, + D3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 29, + D3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 30, + D3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 31, + D3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 32, + D3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 33, + D3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 34, + D3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 35, + D3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 36, + D3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 37, + D3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 38, + D3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 39, + D3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 40, +}} +pub const D3D10_PRIMITIVE_UNDEFINED: D3D_PRIMITIVE = D3D_PRIMITIVE_UNDEFINED; +pub const D3D10_PRIMITIVE_POINT: D3D_PRIMITIVE = D3D_PRIMITIVE_POINT; +pub const D3D10_PRIMITIVE_LINE: D3D_PRIMITIVE = D3D_PRIMITIVE_LINE; +pub const D3D10_PRIMITIVE_TRIANGLE: D3D_PRIMITIVE = D3D_PRIMITIVE_TRIANGLE; +pub const D3D10_PRIMITIVE_LINE_ADJ: D3D_PRIMITIVE = D3D_PRIMITIVE_LINE_ADJ; +pub const D3D10_PRIMITIVE_TRIANGLE_ADJ: D3D_PRIMITIVE = D3D_PRIMITIVE_TRIANGLE_ADJ; +pub const D3D11_PRIMITIVE_UNDEFINED: D3D_PRIMITIVE = D3D_PRIMITIVE_UNDEFINED; +pub const D3D11_PRIMITIVE_POINT: D3D_PRIMITIVE = D3D_PRIMITIVE_POINT; +pub const D3D11_PRIMITIVE_LINE: D3D_PRIMITIVE = D3D_PRIMITIVE_LINE; +pub const D3D11_PRIMITIVE_TRIANGLE: D3D_PRIMITIVE = D3D_PRIMITIVE_TRIANGLE; +pub const D3D11_PRIMITIVE_LINE_ADJ: D3D_PRIMITIVE = D3D_PRIMITIVE_LINE_ADJ; +pub const D3D11_PRIMITIVE_TRIANGLE_ADJ: D3D_PRIMITIVE = D3D_PRIMITIVE_TRIANGLE_ADJ; +pub const D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_1_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_2_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_3_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_4_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_5_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_6_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_7_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_8_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_9_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_10_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_11_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_12_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_13_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_14_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_15_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_16_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_17_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_18_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_19_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_20_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_21_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_22_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_23_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_24_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_25_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_26_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_27_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_28_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_29_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_30_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_31_CONTROL_POINT_PATCH; +pub const D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH: D3D_PRIMITIVE = + D3D_PRIMITIVE_32_CONTROL_POINT_PATCH; +ENUM!{enum D3D_SRV_DIMENSION { + D3D_SRV_DIMENSION_UNKNOWN = 0, + D3D_SRV_DIMENSION_BUFFER = 1, + D3D_SRV_DIMENSION_TEXTURE1D = 2, + D3D_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D_SRV_DIMENSION_TEXTURE2D = 4, + D3D_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D_SRV_DIMENSION_TEXTURE3D = 8, + D3D_SRV_DIMENSION_TEXTURECUBE = 9, + D3D_SRV_DIMENSION_TEXTURECUBEARRAY = 10, + D3D_SRV_DIMENSION_BUFFEREX = 11, +}} +pub const D3D10_SRV_DIMENSION_UNKNOWN: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_UNKNOWN; +pub const D3D10_SRV_DIMENSION_BUFFER: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_BUFFER; +pub const D3D10_SRV_DIMENSION_TEXTURE1D: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE1D; +pub const D3D10_SRV_DIMENSION_TEXTURE1DARRAY: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE1DARRAY; +pub const D3D10_SRV_DIMENSION_TEXTURE2D: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE2D; +pub const D3D10_SRV_DIMENSION_TEXTURE2DARRAY: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE2DARRAY; +pub const D3D10_SRV_DIMENSION_TEXTURE2DMS: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE2DMS; +pub const D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY: D3D_SRV_DIMENSION = + D3D_SRV_DIMENSION_TEXTURE2DMSARRAY; +pub const D3D10_SRV_DIMENSION_TEXTURE3D: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE3D; +pub const D3D10_SRV_DIMENSION_TEXTURECUBE: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURECUBE; +pub const D3D10_1_SRV_DIMENSION_UNKNOWN: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_UNKNOWN; +pub const D3D10_1_SRV_DIMENSION_BUFFER: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_BUFFER; +pub const D3D10_1_SRV_DIMENSION_TEXTURE1D: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE1D; +pub const D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY: D3D_SRV_DIMENSION = + D3D_SRV_DIMENSION_TEXTURE1DARRAY; +pub const D3D10_1_SRV_DIMENSION_TEXTURE2D: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE2D; +pub const D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY: D3D_SRV_DIMENSION = + D3D_SRV_DIMENSION_TEXTURE2DARRAY; +pub const D3D10_1_SRV_DIMENSION_TEXTURE2DMS: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE2DMS; +pub const D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY: D3D_SRV_DIMENSION = + D3D_SRV_DIMENSION_TEXTURE2DMSARRAY; +pub const D3D10_1_SRV_DIMENSION_TEXTURE3D: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE3D; +pub const D3D10_1_SRV_DIMENSION_TEXTURECUBE: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURECUBE; +pub const D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY: D3D_SRV_DIMENSION = + D3D_SRV_DIMENSION_TEXTURECUBEARRAY; +pub const D3D11_SRV_DIMENSION_UNKNOWN: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_UNKNOWN; +pub const D3D11_SRV_DIMENSION_BUFFER: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_BUFFER; +pub const D3D11_SRV_DIMENSION_TEXTURE1D: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE1D; +pub const D3D11_SRV_DIMENSION_TEXTURE1DARRAY: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE1DARRAY; +pub const D3D11_SRV_DIMENSION_TEXTURE2D: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE2D; +pub const D3D11_SRV_DIMENSION_TEXTURE2DARRAY: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE2DARRAY; +pub const D3D11_SRV_DIMENSION_TEXTURE2DMS: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE2DMS; +pub const D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY: D3D_SRV_DIMENSION = + D3D_SRV_DIMENSION_TEXTURE2DMSARRAY; +pub const D3D11_SRV_DIMENSION_TEXTURE3D: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURE3D; +pub const D3D11_SRV_DIMENSION_TEXTURECUBE: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_TEXTURECUBE; +pub const D3D11_SRV_DIMENSION_TEXTURECUBEARRAY: D3D_SRV_DIMENSION = + D3D_SRV_DIMENSION_TEXTURECUBEARRAY; +pub const D3D11_SRV_DIMENSION_BUFFEREX: D3D_SRV_DIMENSION = D3D_SRV_DIMENSION_BUFFEREX; +STRUCT!{struct D3D_SHADER_MACRO { + Name: LPCSTR, + Definition: LPCSTR, +}} +pub type LPD3D_SHADER_MACRO = *mut D3D_SHADER_MACRO; +DEFINE_GUID!{IID_ID3D10Blob, + 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0x0d, 0x98, 0x9c, 0x3a, 0x01, 0x02} +RIDL!{#[uuid(0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2)] +interface ID3D10Blob(ID3D10BlobVtbl): IUnknown(IUnknownVtbl) { + fn GetBufferPointer() -> LPVOID, + fn GetBufferSize() -> SIZE_T, +}} +pub type LPD3D10BLOB = *mut ID3D10Blob; +pub type ID3DBlob = ID3D10Blob; +pub type LPD3DBLOB = *mut ID3DBlob; +ENUM!{enum D3D_INCLUDE_TYPE { + D3D_INCLUDE_LOCAL = 0, + D3D_INCLUDE_SYSTEM, +}} +pub const D3D10_INCLUDE_LOCAL: D3D_INCLUDE_TYPE = D3D_INCLUDE_LOCAL; +pub const D3D10_INCLUDE_SYSTEM: D3D_INCLUDE_TYPE = D3D_INCLUDE_SYSTEM; +RIDL!{#[uuid(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)] +interface ID3DInclude(ID3DIncludeVtbl) { + fn Open( + IncludeType: D3D_INCLUDE_TYPE, + pFileName: LPCSTR, + pParentData: LPCVOID, + ppData: *mut LPCVOID, + pBytes: *mut UINT, + ) -> HRESULT, + fn Close( + pData: LPCVOID, + ) -> HRESULT, +}} +pub type LPD3DINCLUDE = *mut ID3DInclude; +ENUM!{enum D3D_SHADER_VARIABLE_CLASS { + D3D_SVC_SCALAR = 0, + D3D_SVC_VECTOR, + D3D_SVC_MATRIX_ROWS, + D3D_SVC_MATRIX_COLUMNS, + D3D_SVC_OBJECT, + D3D_SVC_STRUCT, + D3D_SVC_INTERFACE_CLASS, + D3D_SVC_INTERFACE_POINTER, +}} +pub const D3D10_SVC_SCALAR: D3D_SHADER_VARIABLE_CLASS = D3D_SVC_SCALAR; +pub const D3D10_SVC_VECTOR: D3D_SHADER_VARIABLE_CLASS = D3D_SVC_VECTOR; +pub const D3D10_SVC_MATRIX_ROWS: D3D_SHADER_VARIABLE_CLASS = D3D_SVC_MATRIX_ROWS; +pub const D3D10_SVC_MATRIX_COLUMNS: D3D_SHADER_VARIABLE_CLASS = D3D_SVC_MATRIX_COLUMNS; +pub const D3D10_SVC_OBJECT: D3D_SHADER_VARIABLE_CLASS = D3D_SVC_OBJECT; +pub const D3D10_SVC_STRUCT: D3D_SHADER_VARIABLE_CLASS = D3D_SVC_STRUCT; +pub const D3D11_SVC_INTERFACE_CLASS: D3D_SHADER_VARIABLE_CLASS = D3D_SVC_INTERFACE_CLASS; +pub const D3D11_SVC_INTERFACE_POINTER: D3D_SHADER_VARIABLE_CLASS = D3D_SVC_INTERFACE_POINTER; +ENUM!{enum D3D_SHADER_VARIABLE_FLAGS { + D3D_SVF_USERPACKED = 1, + D3D_SVF_USED = 2, + D3D_SVF_INTERFACE_POINTER = 4, + D3D_SVF_INTERFACE_PARAMETER = 8, +}} +pub const D3D10_SVF_USERPACKED: D3D_SHADER_VARIABLE_FLAGS = D3D_SVF_USERPACKED; +pub const D3D10_SVF_USED: D3D_SHADER_VARIABLE_FLAGS = D3D_SVF_USED; +pub const D3D11_SVF_INTERFACE_POINTER: D3D_SHADER_VARIABLE_FLAGS = D3D_SVF_INTERFACE_POINTER; +pub const D3D11_SVF_INTERFACE_PARAMETER: D3D_SHADER_VARIABLE_FLAGS = D3D_SVF_INTERFACE_PARAMETER; +ENUM!{enum D3D_SHADER_VARIABLE_TYPE { + D3D_SVT_VOID = 0, + D3D_SVT_BOOL = 1, + D3D_SVT_INT = 2, + D3D_SVT_FLOAT = 3, + D3D_SVT_STRING = 4, + D3D_SVT_TEXTURE = 5, + D3D_SVT_TEXTURE1D = 6, + D3D_SVT_TEXTURE2D = 7, + D3D_SVT_TEXTURE3D = 8, + D3D_SVT_TEXTURECUBE = 9, + D3D_SVT_SAMPLER = 10, + D3D_SVT_SAMPLER1D = 11, + D3D_SVT_SAMPLER2D = 12, + D3D_SVT_SAMPLER3D = 13, + D3D_SVT_SAMPLERCUBE = 14, + D3D_SVT_PIXELSHADER = 15, + D3D_SVT_VERTEXSHADER = 16, + D3D_SVT_PIXELFRAGMENT = 17, + D3D_SVT_VERTEXFRAGMENT = 18, + D3D_SVT_UINT = 19, + D3D_SVT_UINT8 = 20, + D3D_SVT_GEOMETRYSHADER = 21, + D3D_SVT_RASTERIZER = 22, + D3D_SVT_DEPTHSTENCIL = 23, + D3D_SVT_BLEND = 24, + D3D_SVT_BUFFER = 25, + D3D_SVT_CBUFFER = 26, + D3D_SVT_TBUFFER = 27, + D3D_SVT_TEXTURE1DARRAY = 28, + D3D_SVT_TEXTURE2DARRAY = 29, + D3D_SVT_RENDERTARGETVIEW = 30, + D3D_SVT_DEPTHSTENCILVIEW = 31, + D3D_SVT_TEXTURE2DMS = 32, + D3D_SVT_TEXTURE2DMSARRAY = 33, + D3D_SVT_TEXTURECUBEARRAY = 34, + D3D_SVT_HULLSHADER = 35, + D3D_SVT_DOMAINSHADER = 36, + D3D_SVT_INTERFACE_POINTER = 37, + D3D_SVT_COMPUTESHADER = 38, + D3D_SVT_DOUBLE = 39, + D3D_SVT_RWTEXTURE1D = 40, + D3D_SVT_RWTEXTURE1DARRAY = 41, + D3D_SVT_RWTEXTURE2D = 42, + D3D_SVT_RWTEXTURE2DARRAY = 43, + D3D_SVT_RWTEXTURE3D = 44, + D3D_SVT_RWBUFFER = 45, + D3D_SVT_BYTEADDRESS_BUFFER = 46, + D3D_SVT_RWBYTEADDRESS_BUFFER = 47, + D3D_SVT_STRUCTURED_BUFFER = 48, + D3D_SVT_RWSTRUCTURED_BUFFER = 49, + D3D_SVT_APPEND_STRUCTURED_BUFFER = 50, + D3D_SVT_CONSUME_STRUCTURED_BUFFER = 51, + D3D_SVT_MIN8FLOAT = 52, + D3D_SVT_MIN10FLOAT = 53, + D3D_SVT_MIN16FLOAT = 54, + D3D_SVT_MIN12INT = 55, + D3D_SVT_MIN16INT = 56, + D3D_SVT_MIN16UINT = 57, +}} +pub const D3D10_SVT_VOID: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_VOID; +pub const D3D10_SVT_BOOL: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_BOOL; +pub const D3D10_SVT_INT: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_INT; +pub const D3D10_SVT_FLOAT: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_FLOAT; +pub const D3D10_SVT_STRING: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_STRING; +pub const D3D10_SVT_TEXTURE: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TEXTURE; +pub const D3D10_SVT_TEXTURE1D: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TEXTURE1D; +pub const D3D10_SVT_TEXTURE2D: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TEXTURE2D; +pub const D3D10_SVT_TEXTURE3D: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TEXTURE3D; +pub const D3D10_SVT_TEXTURECUBE: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TEXTURECUBE; +pub const D3D10_SVT_SAMPLER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_SAMPLER; +pub const D3D10_SVT_SAMPLER1D: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_SAMPLER1D; +pub const D3D10_SVT_SAMPLER2D: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_SAMPLER2D; +pub const D3D10_SVT_SAMPLER3D: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_SAMPLER3D; +pub const D3D10_SVT_SAMPLERCUBE: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_SAMPLERCUBE; +pub const D3D10_SVT_PIXELSHADER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_PIXELSHADER; +pub const D3D10_SVT_VERTEXSHADER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_VERTEXSHADER; +pub const D3D10_SVT_PIXELFRAGMENT: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_PIXELFRAGMENT; +pub const D3D10_SVT_VERTEXFRAGMENT: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_VERTEXFRAGMENT; +pub const D3D10_SVT_UINT: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_UINT; +pub const D3D10_SVT_UINT8: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_UINT8; +pub const D3D10_SVT_GEOMETRYSHADER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_GEOMETRYSHADER; +pub const D3D10_SVT_RASTERIZER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_RASTERIZER; +pub const D3D10_SVT_DEPTHSTENCIL: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_DEPTHSTENCIL; +pub const D3D10_SVT_BLEND: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_BLEND; +pub const D3D10_SVT_BUFFER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_BUFFER; +pub const D3D10_SVT_CBUFFER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_CBUFFER; +pub const D3D10_SVT_TBUFFER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TBUFFER; +pub const D3D10_SVT_TEXTURE1DARRAY: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TEXTURE1DARRAY; +pub const D3D10_SVT_TEXTURE2DARRAY: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TEXTURE2DARRAY; +pub const D3D10_SVT_RENDERTARGETVIEW: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_RENDERTARGETVIEW; +pub const D3D10_SVT_DEPTHSTENCILVIEW: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_DEPTHSTENCILVIEW; +pub const D3D10_SVT_TEXTURE2DMS: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TEXTURE2DMS; +pub const D3D10_SVT_TEXTURE2DMSARRAY: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TEXTURE2DMSARRAY; +pub const D3D10_SVT_TEXTURECUBEARRAY: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_TEXTURECUBEARRAY; +pub const D3D11_SVT_HULLSHADER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_HULLSHADER; +pub const D3D11_SVT_DOMAINSHADER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_DOMAINSHADER; +pub const D3D11_SVT_INTERFACE_POINTER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_INTERFACE_POINTER; +pub const D3D11_SVT_COMPUTESHADER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_COMPUTESHADER; +pub const D3D11_SVT_DOUBLE: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_DOUBLE; +pub const D3D11_SVT_RWTEXTURE1D: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_RWTEXTURE1D; +pub const D3D11_SVT_RWTEXTURE1DARRAY: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_RWTEXTURE1DARRAY; +pub const D3D11_SVT_RWTEXTURE2D: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_RWTEXTURE2D; +pub const D3D11_SVT_RWTEXTURE2DARRAY: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_RWTEXTURE2DARRAY; +pub const D3D11_SVT_RWTEXTURE3D: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_RWTEXTURE3D; +pub const D3D11_SVT_RWBUFFER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_RWBUFFER; +pub const D3D11_SVT_BYTEADDRESS_BUFFER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_BYTEADDRESS_BUFFER; +pub const D3D11_SVT_RWBYTEADDRESS_BUFFER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_RWBYTEADDRESS_BUFFER; +pub const D3D11_SVT_STRUCTURED_BUFFER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_STRUCTURED_BUFFER; +pub const D3D11_SVT_RWSTRUCTURED_BUFFER: D3D_SHADER_VARIABLE_TYPE = D3D_SVT_RWSTRUCTURED_BUFFER; +pub const D3D11_SVT_APPEND_STRUCTURED_BUFFER: D3D_SHADER_VARIABLE_TYPE = + D3D_SVT_APPEND_STRUCTURED_BUFFER; +pub const D3D11_SVT_CONSUME_STRUCTURED_BUFFER: D3D_SHADER_VARIABLE_TYPE = + D3D_SVT_CONSUME_STRUCTURED_BUFFER; +ENUM!{enum D3D_SHADER_INPUT_FLAGS { + D3D_SIF_USERPACKED = 0x1, + D3D_SIF_COMPARISON_SAMPLER = 0x2, + D3D_SIF_TEXTURE_COMPONENT_0 = 0x4, + D3D_SIF_TEXTURE_COMPONENT_1 = 0x8, + D3D_SIF_TEXTURE_COMPONENTS = 0xc, + D3D_SIF_UNUSED = 0x10, +}} +pub const D3D10_SIF_USERPACKED: D3D_SHADER_INPUT_FLAGS = D3D_SIF_USERPACKED; +pub const D3D10_SIF_COMPARISON_SAMPLER: D3D_SHADER_INPUT_FLAGS = D3D_SIF_COMPARISON_SAMPLER; +pub const D3D10_SIF_TEXTURE_COMPONENT_0: D3D_SHADER_INPUT_FLAGS = D3D_SIF_TEXTURE_COMPONENT_0; +pub const D3D10_SIF_TEXTURE_COMPONENT_1: D3D_SHADER_INPUT_FLAGS = D3D_SIF_TEXTURE_COMPONENT_1; +pub const D3D10_SIF_TEXTURE_COMPONENTS: D3D_SHADER_INPUT_FLAGS = D3D_SIF_TEXTURE_COMPONENTS; +ENUM!{enum D3D_SHADER_INPUT_TYPE { + D3D_SIT_CBUFFER, + D3D_SIT_TBUFFER, + D3D_SIT_TEXTURE, + D3D_SIT_SAMPLER, + D3D_SIT_UAV_RWTYPED, + D3D_SIT_STRUCTURED, + D3D_SIT_UAV_RWSTRUCTURED, + D3D_SIT_BYTEADDRESS, + D3D_SIT_UAV_RWBYTEADDRESS, + D3D_SIT_UAV_APPEND_STRUCTURED, + D3D_SIT_UAV_CONSUME_STRUCTURED, + D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER, +}} +pub const D3D10_SIT_CBUFFER: D3D_SHADER_INPUT_TYPE = D3D_SIT_CBUFFER; +pub const D3D10_SIT_TBUFFER: D3D_SHADER_INPUT_TYPE = D3D_SIT_TBUFFER; +pub const D3D10_SIT_TEXTURE: D3D_SHADER_INPUT_TYPE = D3D_SIT_TEXTURE; +pub const D3D10_SIT_SAMPLER: D3D_SHADER_INPUT_TYPE = D3D_SIT_SAMPLER; +pub const D3D11_SIT_UAV_RWTYPED: D3D_SHADER_INPUT_TYPE = D3D_SIT_UAV_RWTYPED; +pub const D3D11_SIT_STRUCTURED: D3D_SHADER_INPUT_TYPE = D3D_SIT_STRUCTURED; +pub const D3D11_SIT_UAV_RWSTRUCTURED: D3D_SHADER_INPUT_TYPE = D3D_SIT_UAV_RWSTRUCTURED; +pub const D3D11_SIT_BYTEADDRESS: D3D_SHADER_INPUT_TYPE = D3D_SIT_BYTEADDRESS; +pub const D3D11_SIT_UAV_RWBYTEADDRESS: D3D_SHADER_INPUT_TYPE = D3D_SIT_UAV_RWBYTEADDRESS; +pub const D3D11_SIT_UAV_APPEND_STRUCTURED: D3D_SHADER_INPUT_TYPE = D3D_SIT_UAV_APPEND_STRUCTURED; +pub const D3D11_SIT_UAV_CONSUME_STRUCTURED: D3D_SHADER_INPUT_TYPE = D3D_SIT_UAV_CONSUME_STRUCTURED; +pub const D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER: D3D_SHADER_INPUT_TYPE = + D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER; +ENUM!{enum D3D_SHADER_CBUFFER_FLAGS { + D3D_CBF_USERPACKED = 1, +}} +pub const D3D10_CBF_USERPACKED: D3D_SHADER_CBUFFER_FLAGS = D3D_CBF_USERPACKED; +ENUM!{enum D3D_CBUFFER_TYPE { + D3D_CT_CBUFFER, + D3D_CT_TBUFFER, + D3D_CT_INTERFACE_POINTERS, + D3D_CT_RESOURCE_BIND_INFO, +}} +pub const D3D10_CT_CBUFFER: D3D_CBUFFER_TYPE = D3D_CT_CBUFFER; +pub const D3D10_CT_TBUFFER: D3D_CBUFFER_TYPE = D3D_CT_TBUFFER; +pub const D3D11_CT_CBUFFER: D3D_CBUFFER_TYPE = D3D_CT_CBUFFER; +pub const D3D11_CT_TBUFFER: D3D_CBUFFER_TYPE = D3D_CT_TBUFFER; +pub const D3D11_CT_INTERFACE_POINTERS: D3D_CBUFFER_TYPE = D3D_CT_INTERFACE_POINTERS; +pub const D3D11_CT_RESOURCE_BIND_INFO: D3D_CBUFFER_TYPE = D3D_CT_RESOURCE_BIND_INFO; +ENUM!{enum D3D_NAME { + D3D_NAME_UNDEFINED = 0, + D3D_NAME_POSITION = 1, + D3D_NAME_CLIP_DISTANCE = 2, + D3D_NAME_CULL_DISTANCE = 3, + D3D_NAME_RENDER_TARGET_ARRAY_INDEX = 4, + D3D_NAME_VIEWPORT_ARRAY_INDEX = 5, + D3D_NAME_VERTEX_ID = 6, + D3D_NAME_PRIMITIVE_ID = 7, + D3D_NAME_INSTANCE_ID = 8, + D3D_NAME_IS_FRONT_FACE = 9, + D3D_NAME_SAMPLE_INDEX = 10, + D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR = 11, + D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = 12, + D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR = 13, + D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14, + D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15, + D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16, + D3D_NAME_TARGET = 64, + D3D_NAME_DEPTH = 65, + D3D_NAME_COVERAGE = 66, + D3D_NAME_DEPTH_GREATER_EQUAL = 67, + D3D_NAME_DEPTH_LESS_EQUAL = 68, +}} +pub const D3D10_NAME_UNDEFINED: D3D_NAME = D3D_NAME_UNDEFINED; +pub const D3D10_NAME_POSITION: D3D_NAME = D3D_NAME_POSITION; +pub const D3D10_NAME_CLIP_DISTANCE: D3D_NAME = D3D_NAME_CLIP_DISTANCE; +pub const D3D10_NAME_CULL_DISTANCE: D3D_NAME = D3D_NAME_CULL_DISTANCE; +pub const D3D10_NAME_RENDER_TARGET_ARRAY_INDEX: D3D_NAME = D3D_NAME_RENDER_TARGET_ARRAY_INDEX; +pub const D3D10_NAME_VIEWPORT_ARRAY_INDEX: D3D_NAME = D3D_NAME_VIEWPORT_ARRAY_INDEX; +pub const D3D10_NAME_VERTEX_ID: D3D_NAME = D3D_NAME_VERTEX_ID; +pub const D3D10_NAME_PRIMITIVE_ID: D3D_NAME = D3D_NAME_PRIMITIVE_ID; +pub const D3D10_NAME_INSTANCE_ID: D3D_NAME = D3D_NAME_INSTANCE_ID; +pub const D3D10_NAME_IS_FRONT_FACE: D3D_NAME = D3D_NAME_IS_FRONT_FACE; +pub const D3D10_NAME_SAMPLE_INDEX: D3D_NAME = D3D_NAME_SAMPLE_INDEX; +pub const D3D10_NAME_TARGET: D3D_NAME = D3D_NAME_TARGET; +pub const D3D10_NAME_DEPTH: D3D_NAME = D3D_NAME_DEPTH; +pub const D3D10_NAME_COVERAGE: D3D_NAME = D3D_NAME_COVERAGE; +pub const D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR: D3D_NAME = D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR; +pub const D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR: D3D_NAME + = D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR; +pub const D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR: D3D_NAME = D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR; +pub const D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR: D3D_NAME = D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR; +pub const D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR: D3D_NAME + = D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR; +pub const D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR: D3D_NAME + = D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR; +pub const D3D11_NAME_DEPTH_GREATER_EQUAL: D3D_NAME = D3D_NAME_DEPTH_GREATER_EQUAL; +pub const D3D11_NAME_DEPTH_LESS_EQUAL: D3D_NAME = D3D_NAME_DEPTH_LESS_EQUAL; +ENUM!{enum D3D_RESOURCE_RETURN_TYPE { + D3D_RETURN_TYPE_UNORM = 1, + D3D_RETURN_TYPE_SNORM = 2, + D3D_RETURN_TYPE_SINT = 3, + D3D_RETURN_TYPE_UINT = 4, + D3D_RETURN_TYPE_FLOAT = 5, + D3D_RETURN_TYPE_MIXED = 6, + D3D_RETURN_TYPE_DOUBLE = 7, + D3D_RETURN_TYPE_CONTINUED = 8, +}} +pub const D3D10_RETURN_TYPE_UNORM: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_UNORM; +pub const D3D10_RETURN_TYPE_SNORM: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_SNORM; +pub const D3D10_RETURN_TYPE_SINT: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_SINT; +pub const D3D10_RETURN_TYPE_UINT: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_UINT; +pub const D3D10_RETURN_TYPE_FLOAT: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_FLOAT; +pub const D3D10_RETURN_TYPE_MIXED: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_MIXED; +pub const D3D11_RETURN_TYPE_UNORM: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_UNORM; +pub const D3D11_RETURN_TYPE_SNORM: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_SNORM; +pub const D3D11_RETURN_TYPE_SINT: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_SINT; +pub const D3D11_RETURN_TYPE_UINT: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_UINT; +pub const D3D11_RETURN_TYPE_FLOAT: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_FLOAT; +pub const D3D11_RETURN_TYPE_MIXED: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_MIXED; +pub const D3D11_RETURN_TYPE_DOUBLE: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_DOUBLE; +pub const D3D11_RETURN_TYPE_CONTINUED: D3D_RESOURCE_RETURN_TYPE = D3D_RETURN_TYPE_CONTINUED; +ENUM!{enum D3D_REGISTER_COMPONENT_TYPE { + D3D_REGISTER_COMPONENT_UNKNOWN = 0, + D3D_REGISTER_COMPONENT_UINT32 = 1, + D3D_REGISTER_COMPONENT_SINT32 = 2, + D3D_REGISTER_COMPONENT_FLOAT32 = 3, +}} +pub const D3D10_REGISTER_COMPONENT_UNKNOWN: D3D_REGISTER_COMPONENT_TYPE = + D3D_REGISTER_COMPONENT_UNKNOWN; +pub const D3D10_REGISTER_COMPONENT_UINT32: D3D_REGISTER_COMPONENT_TYPE = + D3D_REGISTER_COMPONENT_UINT32; +pub const D3D10_REGISTER_COMPONENT_SINT32: D3D_REGISTER_COMPONENT_TYPE = + D3D_REGISTER_COMPONENT_SINT32; +pub const D3D10_REGISTER_COMPONENT_FLOAT32: D3D_REGISTER_COMPONENT_TYPE = + D3D_REGISTER_COMPONENT_FLOAT32; +ENUM!{enum D3D_TESSELLATOR_DOMAIN { + D3D_TESSELLATOR_DOMAIN_UNDEFINED, + D3D_TESSELLATOR_DOMAIN_ISOLINE, + D3D_TESSELLATOR_DOMAIN_TRI, + D3D_TESSELLATOR_DOMAIN_QUAD, +}} +pub const D3D11_TESSELLATOR_DOMAIN_UNDEFINED: D3D_TESSELLATOR_DOMAIN = + D3D_TESSELLATOR_DOMAIN_UNDEFINED; +pub const D3D11_TESSELLATOR_DOMAIN_ISOLINE: D3D_TESSELLATOR_DOMAIN = + D3D_TESSELLATOR_DOMAIN_ISOLINE; +pub const D3D11_TESSELLATOR_DOMAIN_TRI: D3D_TESSELLATOR_DOMAIN = D3D_TESSELLATOR_DOMAIN_TRI; +pub const D3D11_TESSELLATOR_DOMAIN_QUAD: D3D_TESSELLATOR_DOMAIN = D3D_TESSELLATOR_DOMAIN_QUAD; +ENUM!{enum D3D_TESSELLATOR_PARTITIONING { + D3D_TESSELLATOR_PARTITIONING_UNDEFINED, + D3D_TESSELLATOR_PARTITIONING_INTEGER, + D3D_TESSELLATOR_PARTITIONING_POW2, + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD, + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN, +}} +pub const D3D11_TESSELLATOR_PARTITIONING_UNDEFINED: D3D_TESSELLATOR_PARTITIONING = + D3D_TESSELLATOR_PARTITIONING_UNDEFINED; +pub const D3D11_TESSELLATOR_PARTITIONING_INTEGER: D3D_TESSELLATOR_PARTITIONING = + D3D_TESSELLATOR_PARTITIONING_INTEGER; +pub const D3D11_TESSELLATOR_PARTITIONING_POW2: D3D_TESSELLATOR_PARTITIONING = + D3D_TESSELLATOR_PARTITIONING_POW2; +pub const D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD: D3D_TESSELLATOR_PARTITIONING = + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD; +pub const D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN: D3D_TESSELLATOR_PARTITIONING = + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN; +ENUM!{enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE { + D3D_TESSELLATOR_OUTPUT_UNDEFINED, + D3D_TESSELLATOR_OUTPUT_POINT, + D3D_TESSELLATOR_OUTPUT_LINE, + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW, + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW, +}} +pub const D3D11_TESSELLATOR_OUTPUT_UNDEFINED: D3D_TESSELLATOR_OUTPUT_PRIMITIVE = + D3D_TESSELLATOR_OUTPUT_UNDEFINED; +pub const D3D11_TESSELLATOR_OUTPUT_POINT: D3D_TESSELLATOR_OUTPUT_PRIMITIVE = + D3D_TESSELLATOR_OUTPUT_POINT; +pub const D3D11_TESSELLATOR_OUTPUT_LINE: D3D_TESSELLATOR_OUTPUT_PRIMITIVE = + D3D_TESSELLATOR_OUTPUT_LINE; +pub const D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW: D3D_TESSELLATOR_OUTPUT_PRIMITIVE = + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW; +pub const D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW: D3D_TESSELLATOR_OUTPUT_PRIMITIVE = + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW; +ENUM!{enum D3D_MIN_PRECISION { + D3D_MIN_PRECISION_DEFAULT, + D3D_MIN_PRECISION_FLOAT_16, + D3D_MIN_PRECISION_FLOAT_2_8, + D3D_MIN_PRECISION_RESERVED, + D3D_MIN_PRECISION_SINT_16, + D3D_MIN_PRECISION_UINT_16, + D3D_MIN_PRECISION_ANY_16 = 0xf0, + D3D_MIN_PRECISION_ANY_10 = 0xf1, +}} +ENUM!{enum D3D_INTERPOLATION_MODE { + D3D_INTERPOLATION_UNDEFINED, + D3D_INTERPOLATION_CONSTANT, + D3D_INTERPOLATION_LINEAR, + D3D_INTERPOLATION_LINEAR_CENTROID, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID, + D3D_INTERPOLATION_LINEAR_SAMPLE, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE, +}} +ENUM!{enum D3D_PARAMETER_FLAGS { + D3D_PF_NONE = 0, + D3D_PF_IN = 0x1, + D3D_PF_OUT = 0x2, +}} +DEFINE_GUID!{WKPDID_D3DDebugObjectName, + 0x429b8c22, 0x9188, 0x4b0c, 0x87, 0x42, 0xac, 0xb0, 0xbf, 0x85, 0xc2, 0x00} +DEFINE_GUID!{WKPDID_D3DDebugObjectNameW, + 0x4cca5fd8, 0x921f, 0x42c8, 0x85, 0x66, 0x70, 0xca, 0xf2, 0xa9, 0xb7, 0x41} +DEFINE_GUID!{WKPDID_CommentStringW, + 0xd0149dc0, 0x90e8, 0x4ec8, 0x81, 0x44, 0xe9, 0x00, 0xad, 0x26, 0x6b, 0xb2} diff --git a/bash-5.1/vendor/winapi/src/um/d3dcompiler.rs b/bash-5.1/vendor/winapi/src/um/d3dcompiler.rs new file mode 100644 index 0000000000000000000000000000000000000000..944ae25f05baa4579a4adc8fe9ba6c9839598076 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3dcompiler.rs @@ -0,0 +1,274 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_void; +use shared::basetsd::SIZE_T; +use shared::guiddef::REFIID; +use shared::minwindef::{BOOL, DWORD, LPCVOID, LPVOID, UINT}; +use um::d3d11shader::{ID3D11FunctionLinkingGraph, ID3D11Linker, ID3D11Module}; +use um::d3dcommon::{D3D_SHADER_MACRO, ID3DBlob, ID3DInclude}; +use um::winnt::{HRESULT, LPCSTR, LPCWSTR}; +pub const D3DCOMPILER_DLL: &'static str = "d3dcompiler_47.dll"; +pub const D3D_COMPILER_VERSION: DWORD = 47; +extern "system" { + pub fn D3DReadFileToBlob( + pFileName: LPCWSTR, + ppContents: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DWriteBlobToFile( + pBlob: *mut ID3DBlob, + pFileName: LPCWSTR, + bOverwrite: BOOL, + ) -> HRESULT; +} +pub const D3DCOMPILE_DEBUG: DWORD = 1 << 0; +pub const D3DCOMPILE_SKIP_VALIDATION: DWORD = 1 << 1; +pub const D3DCOMPILE_SKIP_OPTIMIZATION: DWORD = 1 << 2; +pub const D3DCOMPILE_PACK_MATRIX_ROW_MAJOR: DWORD = 1 << 3; +pub const D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR: DWORD = 1 << 4; +pub const D3DCOMPILE_PARTIAL_PRECISION: DWORD = 1 << 5; +pub const D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT: DWORD = 1 << 6; +pub const D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT: DWORD = 1 << 7; +pub const D3DCOMPILE_NO_PRESHADER: DWORD = 1 << 8; +pub const D3DCOMPILE_AVOID_FLOW_CONTROL: DWORD = 1 << 9; +pub const D3DCOMPILE_PREFER_FLOW_CONTROL: DWORD = 1 << 10; +pub const D3DCOMPILE_ENABLE_STRICTNESS: DWORD = 1 << 11; +pub const D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY: DWORD = 1 << 12; +pub const D3DCOMPILE_IEEE_STRICTNESS: DWORD = 1 << 13; +pub const D3DCOMPILE_OPTIMIZATION_LEVEL0: DWORD = 1 << 14; +pub const D3DCOMPILE_OPTIMIZATION_LEVEL1: DWORD = 0; +pub const D3DCOMPILE_OPTIMIZATION_LEVEL2: DWORD = (1 << 14) | (1 << 15); +pub const D3DCOMPILE_OPTIMIZATION_LEVEL3: DWORD = 1 << 15; +pub const D3DCOMPILE_RESERVED16: DWORD = 1 << 16; +pub const D3DCOMPILE_RESERVED17: DWORD = 1 << 17; +pub const D3DCOMPILE_WARNINGS_ARE_ERRORS: DWORD = 1 << 18; +pub const D3DCOMPILE_RESOURCES_MAY_ALIAS: DWORD = 1 << 19; +pub const D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES: DWORD = 1 << 20; +pub const D3DCOMPILE_ALL_RESOURCES_BOUND: DWORD = 1 << 21; +pub const D3DCOMPILE_EFFECT_CHILD_EFFECT: DWORD = 1 << 0; +pub const D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS: DWORD = 1 << 1; +pub const D3D_COMPILE_STANDARD_FILE_INCLUDE: *mut ID3DInclude = 1 as *mut ID3DInclude; +extern "system" { + pub fn D3DCompile( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + pSourceName: LPCSTR, + pDefines: *const D3D_SHADER_MACRO, + pInclude: *mut ID3DInclude, + pEntrypoint: LPCSTR, + pTarget: LPCSTR, + Flags1: UINT, + Flags2: UINT, + ppCode: *mut *mut ID3DBlob, + ppErrorMsgs: *mut *mut ID3DBlob, + ) -> HRESULT; +} +pub const D3DCOMPILE_SECDATA_MERGE_UAV_SLOTS: DWORD = 0x00000001; +pub const D3DCOMPILE_SECDATA_PRESERVE_TEMPLATE_SLOTS: DWORD = 0x00000002; +pub const D3DCOMPILE_SECDATA_REQUIRE_TEMPLATE_MATCH: DWORD = 0x00000004; +extern "system" { + pub fn D3DCompile2( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + pSourceName: LPCSTR, + pDefines: *const D3D_SHADER_MACRO, + pInclude: *mut ID3DInclude, + pEntrypoint: LPCSTR, + pTarget: LPCSTR, + Flags1: UINT, + Flags2: UINT, + SecondaryDataFlags: UINT, + pSecondaryData: LPCVOID, + SecondaryDataSize: SIZE_T, + ppCode: *mut *mut ID3DBlob, + ppErrorMsgs: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DCompileFromFile( + pFileName: LPCWSTR, + pDefines: *const D3D_SHADER_MACRO, + pInclude: *mut ID3DInclude, + pEntrypoint: LPCSTR, + pTarget: LPCSTR, + Flags1: UINT, + Flags2: UINT, + ppCode: *mut *mut ID3DBlob, + ppErrorMsgs: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DPreprocess( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + pSourceName: LPCSTR, + pDefines: *const D3D_SHADER_MACRO, + pInclude: *mut ID3DInclude, + ppCodeText: *mut *mut ID3DBlob, + ppErrorMsgs: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DGetDebugInfo( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + ppDebugInfo: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DReflect( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + pInterface: REFIID, + ppReflector: *mut *mut c_void, + ) -> HRESULT; + pub fn D3DReflectLibrary( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + riid: REFIID, + ppReflector: *mut LPVOID, + ) -> HRESULT; +} +pub const D3D_DISASM_ENABLE_COLOR_CODE: DWORD = 0x00000001; +pub const D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS: DWORD = 0x00000002; +pub const D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING: DWORD = 0x00000004; +pub const D3D_DISASM_ENABLE_INSTRUCTION_CYCLE: DWORD = 0x00000008; +pub const D3D_DISASM_DISABLE_DEBUG_INFO: DWORD = 0x00000010; +pub const D3D_DISASM_ENABLE_INSTRUCTION_OFFSET: DWORD = 0x00000020; +pub const D3D_DISASM_INSTRUCTION_ONLY: DWORD = 0x00000040; +pub const D3D_DISASM_PRINT_HEX_LITERALS: DWORD = 0x00000080; +extern "system" { + pub fn D3DDisassemble( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + Flags: UINT, + szComments: LPCSTR, + ppDisassembly: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DDisassembleRegion( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + Flags: UINT, + szComments: LPCSTR, + StartByteOffset: SIZE_T, + NumInsts: SIZE_T, + pFinishByteOffset: *mut SIZE_T, + ppDisassembly: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DCreateLinker( + ppLinker: *mut *mut ID3D11Linker, + ) -> HRESULT; + pub fn D3DLoadModule( + pSrcData: LPCVOID, + cbSrcDataSize: SIZE_T, + ppModule: *mut *mut ID3D11Module, + ) -> HRESULT; + pub fn D3DCreateFunctionLinkingGraph( + uFlags: UINT, + ppFunctionLinkingGraph: *mut *mut ID3D11FunctionLinkingGraph, + ) -> HRESULT; +} +pub const D3D_GET_INST_OFFSETS_INCLUDE_NON_EXECUTABLE: DWORD = 0x00000001; +extern "system" { + pub fn D3DGetTraceInstructionOffsets( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + Flags: UINT, + StartInstIndex: SIZE_T, + NumInsts: SIZE_T, + pOffsets: *mut SIZE_T, + pTotalInsts: *mut SIZE_T, + ) -> HRESULT; + pub fn D3DGetInputSignatureBlob( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + ppSignatureBlob: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DGetOutputSignatureBlob( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + ppSignatureBlob: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DGetInputAndOutputSignatureBlob( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + ppSignatureBlob: *mut *mut ID3DBlob, + ) -> HRESULT; +} +ENUM!{enum D3DCOMPILER_STRIP_FLAGS { + D3DCOMPILER_STRIP_REFLECTION_DATA = 0x00000001, + D3DCOMPILER_STRIP_DEBUG_INFO = 0x00000002, + D3DCOMPILER_STRIP_TEST_BLOBS = 0x00000004, + D3DCOMPILER_STRIP_PRIVATE_DATA = 0x00000008, + D3DCOMPILER_STRIP_ROOT_SIGNATURE = 0x00000010, + D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff, +}} +extern "system" { + pub fn D3DStripShader( + pShaderBytecode: LPCVOID, + BytecodeLength: SIZE_T, + uStripFlags: UINT, + ppStrippedBlob: *mut *mut ID3DBlob, + ) -> HRESULT; +} +ENUM!{enum D3D_BLOB_PART { + D3D_BLOB_INPUT_SIGNATURE_BLOB, + D3D_BLOB_OUTPUT_SIGNATURE_BLOB, + D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB, + D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB, + D3D_BLOB_ALL_SIGNATURE_BLOB, + D3D_BLOB_DEBUG_INFO, + D3D_BLOB_LEGACY_SHADER, + D3D_BLOB_XNA_PREPASS_SHADER, + D3D_BLOB_XNA_SHADER, + D3D_BLOB_PDB, + D3D_BLOB_PRIVATE_DATA, + D3D_BLOB_ROOT_SIGNATURE, + D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000, + D3D_BLOB_TEST_COMPILE_DETAILS, + D3D_BLOB_TEST_COMPILE_PERF, + D3D_BLOB_TEST_COMPILE_REPORT, +}} +extern "system" { + pub fn D3DGetBlobPart( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + Part: D3D_BLOB_PART, + Flags: UINT, + ppPart: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DSetBlobPart( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + Part: D3D_BLOB_PART, + Flags: UINT, + pPart: LPCVOID, + PartSize: SIZE_T, + ppNewShader: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DCreateBlob( + Size: SIZE_T, + ppBlob: *mut *mut ID3DBlob, + ) -> HRESULT; +} +STRUCT!{struct D3D_SHADER_DATA { + pBytecode: LPCVOID, + BytecodeLength: SIZE_T, +}} +extern "system" { + pub fn D3DCompressShaders( + uNumShaders: UINT, + pShaderData: *mut D3D_SHADER_DATA, + uFlags: UINT, + ppCompressedData: *mut *mut ID3DBlob, + ) -> HRESULT; + pub fn D3DDecompressShaders( + pSrcData: LPCVOID, + SrcDataSize: SIZE_T, + uNumShaders: UINT, + uStartIndex: UINT, + pIndices: *mut UINT, + uFlags: UINT, + ppShaders: *mut *mut ID3DBlob, + pTotalShaders: *mut UINT, + ) -> HRESULT; + // pub fn D3DDisassemble10Effect( + // pEffect: *mut ID3D10Effect, + // Flags: UINT, + // ppDisassembly: *mut *mut ID3DBlob, + // ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/d3dcsx.rs b/bash-5.1/vendor/winapi/src/um/d3dcsx.rs new file mode 100644 index 0000000000000000000000000000000000000000..c1264006103add8b0da7f012af1fc0bc98c8eff3 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3dcsx.rs @@ -0,0 +1,11 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_ID3DX11Scan, + 0x5089b68f, 0xe71d, 0x4d38, 0xbe, 0x8e, 0xf3, 0x63, 0xb9, 0x5a, 0x94, 0x05} +DEFINE_GUID!{IID_ID3DX11SegmentedScan, + 0xa915128c, 0xd954, 0x4c79, 0xbf, 0xe1, 0x64, 0xdb, 0x92, 0x31, 0x94, 0xd6} +DEFINE_GUID!{IID_ID3DX11FFT, + 0xb3f7a938, 0x4c93, 0x4310, 0xa6, 0x75, 0xb3, 0x0d, 0x6d, 0xe5, 0x05, 0x53} diff --git a/bash-5.1/vendor/winapi/src/um/d3dx10core.rs b/bash-5.1/vendor/winapi/src/um/d3dx10core.rs new file mode 100644 index 0000000000000000000000000000000000000000..c5fb449236f99075e244baf3d81dfc8702b55341 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3dx10core.rs @@ -0,0 +1,11 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_ID3DX10Sprite, + 0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x06, 0x14} +DEFINE_GUID!{IID_ID3DX10ThreadPump, + 0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb} +DEFINE_GUID!{IID_ID3DX10Font, + 0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc} diff --git a/bash-5.1/vendor/winapi/src/um/d3dx10math.rs b/bash-5.1/vendor/winapi/src/um/d3dx10math.rs new file mode 100644 index 0000000000000000000000000000000000000000..9c6179fdd89f372eb8e8d67655289407d4eef4b5 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3dx10math.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_ID3DXMatrixStack, + 0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85} diff --git a/bash-5.1/vendor/winapi/src/um/d3dx10mesh.rs b/bash-5.1/vendor/winapi/src/um/d3dx10mesh.rs new file mode 100644 index 0000000000000000000000000000000000000000..319df62d8c84c770d325d6c99ec32e9fa6a5a6ec --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/d3dx10mesh.rs @@ -0,0 +1,19 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_ID3DX10BaseMesh, + 0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30} +DEFINE_GUID!{IID_ID3DX10MeshBuffer, + 0x04b0d117, 0x1041, 0x46b1, 0xaa, 0x8a, 0x39, 0x52, 0x84, 0x8b, 0xa2, 0x2e} +DEFINE_GUID!{IID_ID3DX10Mesh, + 0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95} +DEFINE_GUID!{IID_ID3DX10PMesh, + 0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96} +DEFINE_GUID!{IID_ID3DX10SPMesh, + 0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x02, 0x90, 0xb8, 0x3c, 0xc5} +DEFINE_GUID!{IID_ID3DX10PatchMesh, + 0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39} +DEFINE_GUID!{IID_ID3DX10SkinInfo, + 0x420bd604, 0x1c76, 0x4a34, 0xa4, 0x66, 0xe4, 0x5d, 0x06, 0x58, 0xa3, 0x2c} diff --git a/bash-5.1/vendor/winapi/src/um/datetimeapi.rs b/bash-5.1/vendor/winapi/src/um/datetimeapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..e8102a108437bf2d770db8bac7cf202c6c952dad --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/datetimeapi.rs @@ -0,0 +1,60 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_int; +use shared::minwindef::DWORD; +use um::minwinbase::SYSTEMTIME; +use um::winnt::{LCID, LPCSTR, LPCWSTR, LPSTR, LPWSTR}; +extern "system" { + pub fn GetDateFormatA( + Locale: LCID, + dwFlags: DWORD, + lpDate: *const SYSTEMTIME, + lpFormat: LPCSTR, + lpDateStr: LPSTR, + cchDate: c_int, + ) -> c_int; + pub fn GetDateFormatW( + Locale: LCID, + dwFlags: DWORD, + lpDate: *const SYSTEMTIME, + lpFormat: LPCWSTR, + lpDateStr: LPWSTR, + cchDate: c_int, + ) -> c_int; + pub fn GetTimeFormatA( + Locale: LCID, + dwFlags: DWORD, + lpTime: *const SYSTEMTIME, + lpFormat: LPCSTR, + lpTimeStr: LPSTR, + cchTime: c_int, + ) -> c_int; + pub fn GetTimeFormatW( + Locale: LCID, + dwFlags: DWORD, + lpTime: *const SYSTEMTIME, + lpFormat: LPCWSTR, + lpTimeStr: LPWSTR, + cchTime: c_int, + ) -> c_int; + pub fn GetTimeFormatEx( + lpLocaleName: LPCWSTR, + dwFlags: DWORD, + lpTime: *const SYSTEMTIME, + lpFormat: LPCWSTR, + lpTimeStr: LPWSTR, + cchTime: c_int, + ) -> c_int; + pub fn GetDateFormatEx( + lpLocaleName: LPCWSTR, + dwFlags: DWORD, + lpDate: *const SYSTEMTIME, + lpFormat: LPCWSTR, + lpDateStr: LPWSTR, + cchDate: c_int, + lpCalendar: LPCWSTR, + ) -> c_int; +} diff --git a/bash-5.1/vendor/winapi/src/um/davclnt.rs b/bash-5.1/vendor/winapi/src/um/davclnt.rs new file mode 100644 index 0000000000000000000000000000000000000000..9bfc5a371c0fa1c13237c674da944abf028c70fe --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/davclnt.rs @@ -0,0 +1,104 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! This module defines the DAV specific functions that are exposed to the user +use shared::minwindef::{BOOL, DWORD, LPDWORD, PBYTE, PULONG, ULONG}; +use um::winnt::{HANDLE, LPCWSTR, LPWSTR, PVOID, PWSTR}; +pub type OPAQUE_HANDLE = DWORD; +STRUCT!{struct DAV_CALLBACK_AUTH_BLOB { + pBuffer: PVOID, + ulSize: ULONG, + ulType: ULONG, +}} +pub type PDAV_CALLBACK_AUTH_BLOB = *mut DAV_CALLBACK_AUTH_BLOB; +STRUCT!{struct DAV_CALLBACK_AUTH_UNP { + pszUserName: LPWSTR, + ulUserNameLength: ULONG, + pszPassword: LPWSTR, + ulPasswordLength: ULONG, +}} +pub type PDAV_CALLBACK_AUTH_UNP = *mut DAV_CALLBACK_AUTH_UNP; +STRUCT!{struct DAV_CALLBACK_CRED { + AuthBlob: DAV_CALLBACK_AUTH_BLOB, + UNPBlob: DAV_CALLBACK_AUTH_UNP, + bAuthBlobValid: BOOL, + bSave: BOOL, +}} +pub type PDAV_CALLBACK_CRED = *mut DAV_CALLBACK_CRED; +pub const DAV_AUTHN_SCHEME_BASIC: DWORD = 0x00000001; +pub const DAV_AUTHN_SCHEME_NTLM: DWORD = 0x00000002; +pub const DAV_AUTHN_SCHEME_PASSPORT: DWORD = 0x00000004; +pub const DAV_AUTHN_SCHEME_DIGEST: DWORD = 0x00000008; +pub const DAV_AUTHN_SCHEME_NEGOTIATE: DWORD = 0x00000010; +pub const DAV_AUTHN_SCHEME_CERT: DWORD = 0x00010000; +pub const DAV_AUTHN_SCHEME_FBA: DWORD = 0x00100000; +ENUM!{enum AUTHNEXTSTEP { + DefaultBehavior, + RetryRequest, + CancelRequest, +}} +FN!{stdcall PFNDAVAUTHCALLBACK_FREECRED( + pbuffer: PVOID, +) -> DWORD} +FN!{stdcall PFNDAVAUTHCALLBACK( + lpwzServerName: LPWSTR, + lpwzRemoteName: LPWSTR, + dwAuthScheme: DWORD, + dwFlags: DWORD, + pCallbackCred: PDAV_CALLBACK_CRED, + NextStep: *mut AUTHNEXTSTEP, + pFreeCred: *mut PFNDAVAUTHCALLBACK_FREECRED, +) -> DWORD} +extern "system" { + pub fn DavAddConnection( + ConnectionHandle: *mut HANDLE, + RemoteName: LPCWSTR, + UserName: LPCWSTR, + Password: LPCWSTR, + ClientCert: PBYTE, + CertSize: DWORD, + ) -> DWORD; + pub fn DavDeleteConnection( + ConnectionHandle: HANDLE, + ) -> DWORD; + pub fn DavGetUNCFromHTTPPath( + HttpPath: LPCWSTR, + UncPath: LPWSTR, + lpSize: LPDWORD, + ) -> DWORD; + pub fn DavGetHTTPFromUNCPath( + UncPath: LPCWSTR, + HttpPath: LPWSTR, + lpSize: LPDWORD, + ) -> DWORD; + pub fn DavGetTheLockOwnerOfTheFile( + FileName: LPCWSTR, + LockOwnerName: PWSTR, + LockOwnerNameLengthInBytes: PULONG, + ) -> DWORD; + pub fn DavGetExtendedError( + hFile: HANDLE, + ExtError: *mut DWORD, + ExtErrorString: LPWSTR, + cChSize: *mut DWORD, + ) -> DWORD; + pub fn DavFlushFile( + hFile: HANDLE, + ) -> DWORD; + pub fn DavInvalidateCache( + URLName: LPWSTR, + ) -> DWORD; + pub fn DavCancelConnectionsToServer( + URLName: LPWSTR, + fForce: BOOL, + ) -> DWORD; + pub fn DavRegisterAuthCallback( + CallBack: PFNDAVAUTHCALLBACK, + Version: ULONG, + ) -> OPAQUE_HANDLE; + pub fn DavUnregisterAuthCallback( + hCallback: OPAQUE_HANDLE, + ); +} diff --git a/bash-5.1/vendor/winapi/src/um/dbghelp.rs b/bash-5.1/vendor/winapi/src/um/dbghelp.rs new file mode 100644 index 0000000000000000000000000000000000000000..ddcfbb92d998c99a1fa866b95f4466f898085c5f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dbghelp.rs @@ -0,0 +1,750 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! DbgHelp include file +use shared::basetsd::{DWORD64, PDWORD64, ULONG64}; +use shared::guiddef::GUID; +use shared::minwindef::{ + BOOL, DWORD, HMODULE, LPDWORD, MAX_PATH, PDWORD, PUCHAR, PULONG, UCHAR, ULONG, USHORT, WORD, +}; +use um::winnt::{ + BOOLEAN, CHAR, HANDLE, LIST_ENTRY, PCSTR, PCWSTR, PIMAGE_NT_HEADERS, PIMAGE_SECTION_HEADER, + PSTR, PVOID, PWSTR, WCHAR, +}; +#[cfg(target_pointer_width = "32")] +use um::winnt::{ + PFPO_DATA, PIMAGE_COFF_SYMBOLS_HEADER, PIMAGE_DEBUG_DIRECTORY, PIMAGE_FUNCTION_ENTRY, + PIMAGE_NT_HEADERS32, +}; +#[cfg(target_pointer_width = "64")] +use um::winnt::PIMAGE_NT_HEADERS64; +use vc::vcruntime::size_t; +#[cfg(target_pointer_width = "64")] +STRUCT!{struct LOADED_IMAGE { + ModuleName: PSTR, + hFile: HANDLE, + MappedAddress: PUCHAR, + FileHeader: PIMAGE_NT_HEADERS64, + LastRvaSection: PIMAGE_SECTION_HEADER, + NumberOfSections: ULONG, + Sections: PIMAGE_SECTION_HEADER, + Characteristics: ULONG, + fSystemImage: BOOLEAN, + fDOSImage: BOOLEAN, + fReadOnly: BOOLEAN, + Version: UCHAR, + Links: LIST_ENTRY, + SizeOfImage: ULONG, +}} +#[cfg(target_pointer_width = "32")] +STRUCT!{struct LOADED_IMAGE { + ModuleName: PSTR, + hFile: HANDLE, + MappedAddress: PUCHAR, + FileHeader: PIMAGE_NT_HEADERS32, + LastRvaSection: PIMAGE_SECTION_HEADER, + NumberOfSections: ULONG, + Sections: PIMAGE_SECTION_HEADER, + Characteristics: ULONG, + fSystemImage: BOOLEAN, + fDOSImage: BOOLEAN, + fReadOnly: BOOLEAN, + Version: UCHAR, + Links: LIST_ENTRY, + SizeOfImage: ULONG, +}} +pub const MAX_SYM_NAME: usize = 2000; +pub const ERROR_IMAGE_NOT_STRIPPED: DWORD = 0x8800; +pub const ERROR_NO_DBG_POINTER: DWORD = 0x8801; +pub const ERROR_NO_PDB_POINTER: DWORD = 0x8802; +FN!{stdcall PFIND_DEBUG_FILE_CALLBACK( + FileHandle: HANDLE, + FileName: PCSTR, + CallerData: PVOID, +) -> BOOL} +FN!{stdcall PFIND_DEBUG_FILE_CALLBACKW( + FileHandle: HANDLE, + FileName: PCWSTR, + CallerData: PVOID, +) -> BOOL} +FN!{stdcall PFINDFILEINPATHCALLBACK( + filename: PCSTR, + context: PVOID, +) -> BOOL} +FN!{stdcall PFINDFILEINPATHCALLBACKW( + filename: PCWSTR, + context: PVOID, +) -> BOOL} +FN!{stdcall PFIND_EXE_FILE_CALLBACK( + FileHandle: HANDLE, + FileName: PCSTR, + CallerData: PVOID, +) -> BOOL} +FN!{stdcall PFIND_EXE_FILE_CALLBACKW( + FileHandle: HANDLE, + FileName: PCWSTR, + CallerData: PVOID, +) -> BOOL} +FN!{stdcall PSYM_ENUMERATESYMBOLS_CALLBACKW( + pSymInfo: PSYMBOL_INFOW, + SymbolSize: ULONG, + CallerData: PVOID, +) -> BOOL} +#[cfg(target_pointer_width = "32")] +STRUCT!{struct IMAGE_DEBUG_INFORMATION { + List: LIST_ENTRY, + ReservedSize: DWORD, + ReservedMappedBase: PVOID, + ReservedMachine: USHORT, + ReservedCharacteristics: USHORT, + ReservedCheckSum: DWORD, + ImageBase: DWORD, + SizeOfImage: DWORD, + ReservedNumberOfSections: DWORD, + ReservedSections: PIMAGE_SECTION_HEADER, + ReservedExportedNamesSize: DWORD, + ReservedExportedNames: PSTR, + ReservedNumberOfFunctionTableEntries: DWORD, + ReservedFunctionTableEntries: PIMAGE_FUNCTION_ENTRY, + ReservedLowestFunctionStartingAddress: DWORD, + ReservedHighestFunctionEndingAddress: DWORD, + ReservedNumberOfFpoTableEntries: DWORD, + ReservedFpoTableEntries: PFPO_DATA, + SizeOfCoffSymbols: DWORD, + CoffSymbols: PIMAGE_COFF_SYMBOLS_HEADER, + ReservedSizeOfCodeViewSymbols: DWORD, + ReservedCodeViewSymbols: PVOID, + ImageFilePath: PSTR, + ImageFileName: PSTR, + ReservedDebugFilePath: PSTR, + ReservedTimeDateStamp: DWORD, + ReservedRomImage: BOOL, + ReservedDebugDirectory: PIMAGE_DEBUG_DIRECTORY, + ReservedNumberOfDebugDirectories: DWORD, + ReservedOriginalFunctionTableBaseAddress: DWORD, + Reserved: [DWORD; 2], +}} +#[cfg(target_pointer_width = "32")] +pub type PIMAGE_DEBUG_INFORMATION = *mut IMAGE_DEBUG_INFORMATION; +FN!{stdcall PENUMDIRTREE_CALLBACK( + FilePath: PCSTR, + CallerData: PVOID, +) -> BOOL} +FN!{stdcall PENUMDIRTREE_CALLBACKW( + FilePath: PCWSTR, + CallerData: PVOID, +) -> BOOL} +pub const UNDNAME_COMPLETE: DWORD = 0x0000; +pub const UNDNAME_NO_LEADING_UNDERSCORES: DWORD = 0x0001; +pub const UNDNAME_NO_MS_KEYWORDS: DWORD = 0x0002; +pub const UNDNAME_NO_FUNCTION_RETURNS: DWORD = 0x0004; +pub const UNDNAME_NO_ALLOCATION_MODEL: DWORD = 0x0008; +pub const UNDNAME_NO_ALLOCATION_LANGUAGE: DWORD = 0x0010; +pub const UNDNAME_NO_MS_THISTYPE: DWORD = 0x0020; +pub const UNDNAME_NO_CV_THISTYPE: DWORD = 0x0040; +pub const UNDNAME_NO_THISTYPE: DWORD = 0x0060; +pub const UNDNAME_NO_ACCESS_SPECIFIERS: DWORD = 0x0080; +pub const UNDNAME_NO_THROW_SIGNATURES: DWORD = 0x0100; +pub const UNDNAME_NO_MEMBER_TYPE: DWORD = 0x0200; +pub const UNDNAME_NO_RETURN_UDT_MODEL: DWORD = 0x0400; +pub const UNDNAME_32_BIT_DECODE: DWORD = 0x0800; +pub const UNDNAME_NAME_ONLY: DWORD = 0x1000; +pub const UNDNAME_NO_ARGUMENTS: DWORD = 0x2000; +pub const UNDNAME_NO_SPECIAL_SYMS: DWORD = 0x4000; +pub const DBHHEADER_DEBUGDIRS: DWORD = 0x1; +pub const DBHHEADER_CVMISC: DWORD = 0x2; +pub const DBHHEADER_PDBGUID: DWORD = 0x3; +STRUCT!{struct MODLOAD_DATA { + ssize: DWORD, + ssig: DWORD, + data: PVOID, + size: DWORD, + flags: DWORD, +}} +pub type PMODLOAD_DATA = *mut MODLOAD_DATA; +STRUCT!{struct MODLOAD_CVMISC { + oCV: DWORD, + cCV: size_t, + oMisc: DWORD, + cMisc: size_t, + dtImage: DWORD, + cImage: DWORD, +}} +pub type PMODLOAD_CVMISC = *mut MODLOAD_CVMISC; +STRUCT!{struct MODLOAD_PDBGUID_PDBAGE { + PdbGuid: GUID, + PdbAge: DWORD, +}} +pub type PMODLOAD_PDBGUID_PDBAGE = *mut MODLOAD_PDBGUID_PDBAGE; +ENUM!{enum ADDRESS_MODE { + AddrMode1616, + AddrMode1632, + AddrModeReal, + AddrModeFlat, +}} +STRUCT!{struct ADDRESS64 { + Offset: DWORD64, + Segment: WORD, + Mode: ADDRESS_MODE, +}} +pub type LPADDRESS64 = *mut ADDRESS64; +#[cfg(target_pointer_width = "64")] +pub type ADDRESS = ADDRESS64; +#[cfg(target_pointer_width = "64")] +pub type LPADDRESS = LPADDRESS64; +#[cfg(target_pointer_width = "32")] +STRUCT!{struct ADDRESS { + Offset: DWORD, + Segment: WORD, + Mode: ADDRESS_MODE, +}} +#[cfg(target_pointer_width = "32")] +pub type LPADDRESS = *mut ADDRESS; +STRUCT!{struct KDHELP64 { + Thread: DWORD64, + ThCallbackStack: DWORD, + ThCallbackBStore: DWORD, + NextCallback: DWORD, + FramePointer: DWORD, + KiCallUserMode: DWORD64, + KeUserCallbackDispatcher: DWORD64, + SystemRangeStart: DWORD64, + KiUserExceptionDispatcher: DWORD64, + StackBase: DWORD64, + StackLimit: DWORD64, + BuildVersion: DWORD, + Reserved0: DWORD, + Reserved1: [DWORD64; 4], +}} +pub type PKDHELP64 = *mut KDHELP64; +#[cfg(target_pointer_width = "64")] +pub type KDHELP = KDHELP64; +#[cfg(target_pointer_width = "64")] +pub type PKDHELP = PKDHELP64; +#[cfg(target_pointer_width = "32")] +STRUCT!{struct KDHELP { + Thread: DWORD, + ThCallbackStack: DWORD, + NextCallback: DWORD, + FramePointer: DWORD, + KiCallUserMode: DWORD, + KeUserCallbackDispatcher: DWORD, + SystemRangeStart: DWORD, + ThCallbackBStore: DWORD, + KiUserExceptionDispatcher: DWORD, + StackBase: DWORD, + StackLimit: DWORD, + Reserved: [DWORD; 5], +}} +#[cfg(target_pointer_width = "32")] +pub type PKDHELP = *mut KDHELP; +STRUCT!{struct STACKFRAME64 { + AddrPC: ADDRESS64, + AddrReturn: ADDRESS64, + AddrFrame: ADDRESS64, + AddrStack: ADDRESS64, + AddrBStore: ADDRESS64, + FuncTableEntry: PVOID, + Params: [DWORD64; 4], + Far: BOOL, + Virtual: BOOL, + Reserved: [DWORD64; 3], + KdHelp: KDHELP64, +}} +pub type LPSTACKFRAME64 = *mut STACKFRAME64; +pub const INLINE_FRAME_CONTEXT_INIT: DWORD = 0; +pub const INLINE_FRAME_CONTEXT_IGNORE: DWORD = 0xFFFFFFFF; +STRUCT!{struct STACKFRAME_EX { + AddrPC: ADDRESS64, + AddrReturn: ADDRESS64, + AddrFrame: ADDRESS64, + AddrStack: ADDRESS64, + AddrBStore: ADDRESS64, + FuncTableEntry: PVOID, + Params: [DWORD64; 4], + Far: BOOL, + Virtual: BOOL, + Reserved: [DWORD64; 3], + KdHelp: KDHELP64, + StackFrameSize: DWORD, + InlineFrameContext: DWORD, +}} +pub type LPSTACKFRAME_EX = *mut STACKFRAME_EX; +#[cfg(target_pointer_width = "64")] +pub type STACKFRAME = STACKFRAME64; +#[cfg(target_pointer_width = "64")] +pub type LPSTACKFRAME = LPSTACKFRAME64; +#[cfg(target_pointer_width = "32")] +STRUCT!{struct STACKFRAME { + AddrPC: ADDRESS, + AddrReturn: ADDRESS, + AddrFrame: ADDRESS, + AddrStack: ADDRESS, + FuncTableEntry: PVOID, + Params: [DWORD; 4], + Far: BOOL, + Virtual: BOOL, + Reserved: [DWORD; 3], + KdHelp: KDHELP, + AddrBStore: ADDRESS, +}} +#[cfg(target_pointer_width = "32")] +pub type LPSTACKFRAME = *mut STACKFRAME; +FN!{stdcall PREAD_PROCESS_MEMORY_ROUTINE64( + hProcess: HANDLE, + qwBaseAddress: DWORD64, + lpBuffer: PVOID, + nSize: DWORD, + lpNumberOfBytesRead: LPDWORD, +) -> BOOL} +FN!{stdcall PFUNCTION_TABLE_ACCESS_ROUTINE64( + ahProcess: HANDLE, + AddrBase: DWORD64, +) -> PVOID} +FN!{stdcall PGET_MODULE_BASE_ROUTINE64( + hProcess: HANDLE, + Address: DWORD64, +) -> DWORD64} +FN!{stdcall PTRANSLATE_ADDRESS_ROUTINE64( + hProcess: HANDLE, + hThread: HANDLE, + lpaddr: LPADDRESS64, +) -> DWORD64} +pub const SYM_STKWALK_DEFAULT: DWORD = 0x00000000; +pub const SYM_STKWALK_FORCE_FRAMEPTR: DWORD = 0x00000001; +#[cfg(target_pointer_width = "64")] +pub type PREAD_PROCESS_MEMORY_ROUTINE = PREAD_PROCESS_MEMORY_ROUTINE64; +#[cfg(target_pointer_width = "64")] +pub type PFUNCTION_TABLE_ACCESS_ROUTINE = PFUNCTION_TABLE_ACCESS_ROUTINE64; +#[cfg(target_pointer_width = "64")] +pub type PGET_MODULE_BASE_ROUTINE = PGET_MODULE_BASE_ROUTINE64; +#[cfg(target_pointer_width = "64")] +pub type PTRANSLATE_ADDRESS_ROUTINE = PTRANSLATE_ADDRESS_ROUTINE64; +#[cfg(target_pointer_width = "32")] +FN!{stdcall PREAD_PROCESS_MEMORY_ROUTINE( + hProcess: HANDLE, + qwBaseAddress: DWORD, + lpBuffer: PVOID, + nSize: DWORD, + lpNumberOfBytesRead: PDWORD, +) -> BOOL} +#[cfg(target_pointer_width = "32")] +FN!{stdcall PFUNCTION_TABLE_ACCESS_ROUTINE( + ahProcess: HANDLE, + AddrBase: DWORD, +) -> PVOID} +#[cfg(target_pointer_width = "32")] +FN!{stdcall PGET_MODULE_BASE_ROUTINE( + hProcess: HANDLE, + Address: DWORD, +) -> DWORD} +#[cfg(target_pointer_width = "32")] +FN!{stdcall PTRANSLATE_ADDRESS_ROUTINE( + hProcess: HANDLE, + hThread: HANDLE, + lpaddr: LPADDRESS, +) -> DWORD} +pub const API_VERSION_NUMBER: USHORT = 12; +STRUCT!{struct API_VERSION { + MajorVersion: USHORT, + MinorVersion: USHORT, + Revision: USHORT, + Reserved: USHORT, +}} +pub type LPAPI_VERSION = *mut API_VERSION; +STRUCT!{struct SYMBOL_INFOW { + SizeOfStruct: ULONG, + TypeIndex: ULONG, + Reserved: [ULONG64; 2], + Index: ULONG, + Size: ULONG, + ModBase: ULONG64, + Flags: ULONG, + Value: ULONG64, + Address: ULONG64, + Register: ULONG, + Scope: ULONG, + Tag: ULONG, + NameLen: ULONG, + MaxNameLen: ULONG, + Name: [WCHAR; 1], +}} +pub type PSYMBOL_INFOW = *mut SYMBOL_INFOW; +ENUM!{enum SYM_TYPE { + SymNone = 0, + SymCoff, + SymCv, + SymPdb, + SymExport, + SymDeferred, + SymSym, + SymDia, + SymVirtual, + NumSymTypes, +}} +STRUCT!{struct IMAGEHLP_SYMBOL64 { + SizeOfStruct: DWORD, + Address: DWORD64, + Size: DWORD, + Flags: DWORD, + MaxNameLength: DWORD, + Name: [CHAR; 1], +}} +pub type PIMAGEHLP_SYMBOL64 = *mut IMAGEHLP_SYMBOL64; +STRUCT!{struct IMAGEHLP_MODULEW64 { + SizeOfStruct: DWORD, + BaseOfImage: DWORD64, + ImageSize: DWORD, + TimeDateStamp: DWORD, + CheckSum: DWORD, + NumSyms: DWORD, + SymType: SYM_TYPE, + ModuleName: [WCHAR; 32], + ImageName: [WCHAR; 256], + LoadedImageName: [WCHAR; 256], + LoadedPdbName: [WCHAR; 256], + CVSig: DWORD, + CVData: [WCHAR; MAX_PATH * 3], + PdbSig: DWORD, + PdbSig70: GUID, + PdbAge: DWORD, + PdbUnmatched: BOOL, + DbgUnmatched: BOOL, + LineNumbers: BOOL, + GlobalSymbols: BOOL, + TypeInfo: BOOL, + SourceIndexed: BOOL, + Publics: BOOL, + MachineType: DWORD, + Reserved: DWORD, +}} +pub type PIMAGEHLP_MODULEW64 = *mut IMAGEHLP_MODULEW64; +STRUCT!{struct IMAGEHLP_LINEW64 { + SizeOfStruct: DWORD, + Key: PVOID, + LineNumber: DWORD, + FileName: PWSTR, + Address: DWORD64, +}} +pub type PIMAGEHLP_LINEW64 = *mut IMAGEHLP_LINEW64; +extern "system" { + pub fn EnumDirTree( + hProcess: HANDLE, + RootPath: PCSTR, + InputPathName: PCSTR, + OutputPathBuffer: PSTR, + cb: PENUMDIRTREE_CALLBACK, + data: PVOID, + ) -> BOOL; + pub fn EnumDirTreeW( + hProcess: HANDLE, + RootPath: PCWSTR, + InputPathName: PCWSTR, + OutputPathBuffer: PWSTR, + cb: PENUMDIRTREE_CALLBACKW, + data: PVOID, + ) -> BOOL; + pub fn ImagehlpApiVersion() -> LPAPI_VERSION; + pub fn ImagehlpApiVersionEx( + AppVersion: LPAPI_VERSION, + ) -> LPAPI_VERSION; + pub fn MakeSureDirectoryPathExists( + DirPath: PCSTR, + ) -> BOOL; + pub fn SearchTreeForFile( + RootPath: PCSTR, + InputPathName: PCSTR, + OutputPathBuffer: PSTR, + ) -> BOOL; + pub fn SearchTreeForFileW( + RootPath: PCWSTR, + InputPathName: PCWSTR, + OutputPathBuffer: PWSTR, + ) -> BOOL; + pub fn FindDebugInfoFile( + FileName: PCSTR, + SymbolPath: PCSTR, + DebugFilePath: PSTR, + ) -> HANDLE; + pub fn FindDebugInfoFileEx( + FileName: PCSTR, + SymbolPath: PCSTR, + DebugFilePath: PSTR, + Callback: PFIND_DEBUG_FILE_CALLBACK, + CallerData: PVOID, + ) -> HANDLE; + pub fn FindDebugInfoFileExW( + FileName: PCWSTR, + SymbolPath: PCWSTR, + DebugFilePath: PWSTR, + Callback: PFIND_DEBUG_FILE_CALLBACKW, + CallerData: PVOID, + ) -> HANDLE; + pub fn FindExecutableImage( + FileName: PCSTR, + SymbolPath: PCSTR, + ImageFilePath: PSTR, + ) -> HANDLE; + pub fn FindExecutableImageEx( + FileName: PCSTR, + SymbolPath: PCSTR, + ImageFilePath: PSTR, + Callback: PFIND_EXE_FILE_CALLBACK, + CallerData: PVOID, + ) -> HANDLE; + pub fn FindExecutableImageExW( + FileName: PCWSTR, + SymbolPath: PCWSTR, + ImageFilePath: PWSTR, + Callback: PFIND_EXE_FILE_CALLBACKW, + CallerData: PVOID, + ) -> HANDLE; + pub fn StackWalk( + MachineType: DWORD, + hProcess: HANDLE, + hThread: HANDLE, + StackFrame: LPSTACKFRAME, + ContextRecord: PVOID, + ReadMemoryRoutine: PREAD_PROCESS_MEMORY_ROUTINE, + FunctionTableAccessRoutine: PFUNCTION_TABLE_ACCESS_ROUTINE, + GetModuleBaseRoutine: PGET_MODULE_BASE_ROUTINE, + TranslateAddress: PTRANSLATE_ADDRESS_ROUTINE, + ) -> BOOL; + pub fn StackWalkEx( + MachineType: DWORD, + hProcess: HANDLE, + hThread: HANDLE, + StackFrame: LPSTACKFRAME_EX, + ContextRecord: PVOID, + ReadMemoryRoutine: PREAD_PROCESS_MEMORY_ROUTINE64, + FunctionTableAccessRoutine: PFUNCTION_TABLE_ACCESS_ROUTINE64, + GetModuleBaseRoutine: PGET_MODULE_BASE_ROUTINE64, + TranslateAddress: PTRANSLATE_ADDRESS_ROUTINE64, + Flags: DWORD, + ) -> BOOL; + pub fn StackWalk64( + MachineType: DWORD, + hProcess: HANDLE, + hThread: HANDLE, + StackFrame: LPSTACKFRAME64, + ContextRecord: PVOID, + ReadMemoryRoutine: PREAD_PROCESS_MEMORY_ROUTINE64, + FunctionTableAccessRoutine: PFUNCTION_TABLE_ACCESS_ROUTINE64, + GetModuleBaseRoutine: PGET_MODULE_BASE_ROUTINE64, + TranslateAddress: PTRANSLATE_ADDRESS_ROUTINE64, + ) -> BOOL; + pub fn UnDecorateSymbolName( + name: PCSTR, + outputString: PSTR, + maxStringLength: DWORD, + flags: DWORD, + ) -> DWORD; + pub fn UnDecorateSymbolNameW( + name: PCWSTR, + outputString: PWSTR, + maxStringLength: DWORD, + flags: DWORD, + ) -> DWORD; + pub fn GetTimestampForLoadedLibrary( + Module: HMODULE, + ) -> DWORD; + pub fn ImageDirectoryEntryToData( + Base: PVOID, + MappedAsImage: BOOLEAN, + DirectoryEntry: USHORT, + Size: PULONG, + ) -> PVOID; + pub fn ImageDirectoryEntryToDataEx( + Base: PVOID, + MappedAsImage: BOOLEAN, + DirectoryEntry: USHORT, + Size: PULONG, + FoundHeader: *mut PIMAGE_SECTION_HEADER, + ) -> PVOID; + pub fn ImageNtHeader( + Base: PVOID, + ) -> PIMAGE_NT_HEADERS; + pub fn ImageRvaToSection( + NtHeaders: PIMAGE_NT_HEADERS, + Base: PVOID, + Rva: ULONG, + ) -> PIMAGE_SECTION_HEADER; + pub fn ImageRvaToVa( + NtHeaders: PIMAGE_NT_HEADERS, + Base: PVOID, + Rva: ULONG, + LastRvaSection: *mut PIMAGE_SECTION_HEADER, + ) -> PVOID; +} +pub const SYMOPT_CASE_INSENSITIVE: DWORD = 0x00000001; +pub const SYMOPT_UNDNAME: DWORD = 0x00000002; +pub const SYMOPT_DEFERRED_LOADS: DWORD = 0x00000004; +pub const SYMOPT_NO_CPP: DWORD = 0x00000008; +pub const SYMOPT_LOAD_LINES: DWORD = 0x00000010; +pub const SYMOPT_OMAP_FIND_NEAREST: DWORD = 0x00000020; +pub const SYMOPT_LOAD_ANYTHING: DWORD = 0x00000040; +pub const SYMOPT_IGNORE_CVREC: DWORD = 0x00000080; +pub const SYMOPT_NO_UNQUALIFIED_LOADS: DWORD = 0x00000100; +pub const SYMOPT_FAIL_CRITICAL_ERRORS: DWORD = 0x00000200; +pub const SYMOPT_EXACT_SYMBOLS: DWORD = 0x00000400; +pub const SYMOPT_ALLOW_ABSOLUTE_SYMBOLS: DWORD = 0x00000800; +pub const SYMOPT_IGNORE_NT_SYMPATH: DWORD = 0x00001000; +pub const SYMOPT_INCLUDE_32BIT_MODULES: DWORD = 0x00002000; +pub const SYMOPT_PUBLICS_ONLY: DWORD = 0x00004000; +pub const SYMOPT_NO_PUBLICS: DWORD = 0x00008000; +pub const SYMOPT_AUTO_PUBLICS: DWORD = 0x00010000; +pub const SYMOPT_NO_IMAGE_SEARCH: DWORD = 0x00020000; +pub const SYMOPT_SECURE: DWORD = 0x00040000; +pub const SYMOPT_NO_PROMPTS: DWORD = 0x00080000; +pub const SYMOPT_OVERWRITE: DWORD = 0x00100000; +pub const SYMOPT_IGNORE_IMAGEDIR: DWORD = 0x00200000; +pub const SYMOPT_FLAT_DIRECTORY: DWORD = 0x00400000; +pub const SYMOPT_FAVOR_COMPRESSED: DWORD = 0x00800000; +pub const SYMOPT_ALLOW_ZERO_ADDRESS: DWORD = 0x01000000; +pub const SYMOPT_DISABLE_SYMSRV_AUTODETECT: DWORD = 0x02000000; +pub const SYMOPT_READONLY_CACHE: DWORD = 0x04000000; +pub const SYMOPT_SYMPATH_LAST: DWORD = 0x08000000; +pub const SYMOPT_DISABLE_FAST_SYMBOLS: DWORD = 0x10000000; +pub const SYMOPT_DISABLE_SYMSRV_TIMEOUT: DWORD = 0x20000000; +pub const SYMOPT_DISABLE_SRVSTAR_ON_STARTUP: DWORD = 0x40000000; +pub const SYMOPT_DEBUG: DWORD = 0x80000000; +extern "system" { + pub fn SymSetOptions( + SymOptions: DWORD, + ) -> DWORD; + pub fn SymGetOptions() -> DWORD; + pub fn SymCleanup( + hProcess: HANDLE, + ) -> BOOL; + pub fn SymEnumSymbolsW( + hProcess: HANDLE, + BaseOfDll: ULONG64, + Mask: PCWSTR, + EnumSymbolsCallback: PSYM_ENUMERATESYMBOLS_CALLBACKW, + CallerData: PVOID, + ) -> BOOL; + pub fn SymFindDebugInfoFile( + hProcess: HANDLE, + FileName: PCSTR, + DebugFilePath: PSTR, + Callback: PFIND_DEBUG_FILE_CALLBACK, + CallerData: PVOID, + ) -> HANDLE; + pub fn SymFindDebugInfoFileW( + hProcess: HANDLE, + FileName: PCWSTR, + DebugFilePath: PWSTR, + Callback: PFIND_DEBUG_FILE_CALLBACKW, + CallerData: PVOID, + ) -> HANDLE; + pub fn SymFindExecutableImage( + hProcess: HANDLE, + FileName: PCSTR, + ImageFilePath: PSTR, + Callback: PFIND_EXE_FILE_CALLBACK, + CallerData: PVOID, + ) -> HANDLE; + pub fn SymFindExecutableImageW( + hProcess: HANDLE, + FileName: PCWSTR, + ImageFilePath: PWSTR, + Callback: PFIND_EXE_FILE_CALLBACKW, + CallerData: PVOID, + ) -> HANDLE; + pub fn SymFindFileInPath( + hprocess: HANDLE, + SearchPath: PCSTR, + FileName: PCSTR, + id: PVOID, + two: DWORD, + three: DWORD, + flags: DWORD, + FoundFile: PSTR, + callback: PFINDFILEINPATHCALLBACK, + context: PVOID, + ) -> BOOL; + pub fn SymFindFileInPathW( + hprocess: HANDLE, + SearchPath: PCWSTR, + FileName: PCWSTR, + id: PVOID, + two: DWORD, + three: DWORD, + flags: DWORD, + FoundFile: PWSTR, + callback: PFINDFILEINPATHCALLBACKW, + context: PVOID, + ) -> BOOL; + pub fn SymFromAddrW( + hProcess: HANDLE, + Address: DWORD64, + Displacement: PDWORD64, + Symbol: PSYMBOL_INFOW, + ) -> BOOL; + pub fn SymFromNameW( + hProcess: HANDLE, + Name: PCWSTR, + Symbol: PSYMBOL_INFOW, + ) -> BOOL; + pub fn SymFunctionTableAccess64( + hProcess: HANDLE, + AddrBase: DWORD64, + ) -> PVOID; + pub fn SymGetLineFromAddrW64( + hProcess: HANDLE, + dwAddr: DWORD64, + pdwDisplacement: PDWORD, + Line: PIMAGEHLP_LINEW64, + ) -> BOOL; + pub fn SymGetModuleInfoW64( + hProcess: HANDLE, + qwAddr: DWORD64, + ModuleInfo: PIMAGEHLP_MODULEW64, + ) -> BOOL; + pub fn SymGetModuleBase64( + hProcess: HANDLE, + AddrBase: DWORD64, + ) -> DWORD64; + pub fn SymGetSymFromAddr64( + hProcess: HANDLE, + Address: DWORD64, + Displacement: PDWORD64, + Symbol: PIMAGEHLP_SYMBOL64, + ) -> BOOL; + pub fn SymInitializeW( + hProcess: HANDLE, + UserSearchPath: PCWSTR, + fInvadeProcess: BOOL, + ) -> BOOL; + pub fn SymLoadModuleExW( + hProcess: HANDLE, + hFile: HANDLE, + ImageName: PCWSTR, + ModuleName: PCWSTR, + BaseOfDll: DWORD64, + SizeOfDll: DWORD, + Data: PMODLOAD_DATA, + Flags: DWORD, + ) -> DWORD64; + pub fn SymUnloadModule( + hProcess: HANDLE, + BaseOfDll: DWORD, + ) -> BOOL; + pub fn SymUnloadModule64( + hProcess: HANDLE, + BaseOfDll: DWORD64, + ) -> BOOL; + #[cfg(target_pointer_width = "32")] + pub fn MapDebugInformation( + FileHandle: HANDLE, + FileName: PCSTR, + SymbolPath: PCSTR, + ImageBase: ULONG, + ) -> PIMAGE_DEBUG_INFORMATION; + #[cfg(target_pointer_width = "32")] + pub fn UnmapDebugInformation( + DebugInfo: PIMAGE_DEBUG_INFORMATION, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/dbt.rs b/bash-5.1/vendor/winapi/src/um/dbt.rs new file mode 100644 index 0000000000000000000000000000000000000000..e95a58ce9fe03d252483b2115d9ee0aa94a20041 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dbt.rs @@ -0,0 +1,192 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_char, wchar_t}; +use shared::basetsd::{ULONG32, ULONG64}; +use shared::guiddef::GUID; +use shared::minwindef::{BYTE, DWORD, UINT, WORD, WPARAM}; +use um::winnt::{HANDLE, LONG}; +use um::winuser::HDEVNOTIFY; +pub const WM_DEVICECHANGE: UINT = 0x0219; +pub const BSF_QUERY: DWORD = 0x00000001; +pub const BSF_IGNORECURRENTTASK: DWORD = 0x00000002; +pub const BSF_FLUSHDISK: DWORD = 0x00000004; +pub const BSF_NOHANG: DWORD = 0x00000008; +pub const BSF_POSTMESSAGE: DWORD = 0x00000010; +pub const BSF_FORCEIFHUNG: DWORD = 0x00000020; +pub const BSF_NOTIMEOUTIFNOTHUNG: DWORD = 0x00000040; +pub const BSF_MSGSRV32ISOK: DWORD = 0x80000000; +pub const BSF_MSGSRV32ISOK_BIT: usize = 31; +pub const BSM_ALLCOMPONENTS: DWORD = 0x00000000; +pub const BSM_VXDS: DWORD = 0x00000001; +pub const BSM_NETDRIVER: DWORD = 0x00000002; +pub const BSM_INSTALLABLEDRIVERS: DWORD = 0x00000004; +pub const BSM_APPLICATIONS: DWORD = 0x00000008; +pub const DBT_APPYBEGIN: WPARAM = 0x0000; +pub const DBT_APPYEND: WPARAM = 0x0001; +pub const DBT_DEVNODES_CHANGED: WPARAM = 0x0007; +pub const DBT_QUERYCHANGECONFIG: WPARAM = 0x0017; +pub const DBT_CONFIGCHANGED: WPARAM = 0x0018; +pub const DBT_CONFIGCHANGECANCELED: WPARAM = 0x0019; +pub const DBT_MONITORCHANGE: WPARAM = 0x001B; +pub const DBT_SHELLLOGGEDON: WPARAM = 0x0020; +pub const DBT_CONFIGMGAPI32: WPARAM = 0x0022; +pub const DBT_VXDINITCOMPLETE: WPARAM = 0x0023; +pub const DBT_VOLLOCKQUERYLOCK: WPARAM = 0x8041; +pub const DBT_VOLLOCKLOCKTAKEN: WPARAM = 0x8042; +pub const DBT_VOLLOCKLOCKFAILED: WPARAM = 0x8043; +pub const DBT_VOLLOCKQUERYUNLOCK: WPARAM = 0x8044; +pub const DBT_VOLLOCKLOCKRELEASED: WPARAM = 0x8045; +pub const DBT_VOLLOCKUNLOCKFAILED: WPARAM = 0x8046; +STRUCT!{struct DEV_BROADCAST_HDR { + dbch_size: DWORD, + dbch_devicetype: DWORD, + dbch_reserved: DWORD, +}} +pub type PDEV_BROADCAST_HDR = *mut DEV_BROADCAST_HDR; +STRUCT!{struct VolLockBroadcast { + vlb_dbh: DEV_BROADCAST_HDR, + vlb_owner: DWORD, + vlb_perms: BYTE, + vlb_lockType: BYTE, + vlb_drive: BYTE, + vlb_flags: BYTE, +}} +pub type pVolLockBroadcast = *mut VolLockBroadcast; +pub const LOCKP_ALLOW_WRITES: BYTE = 0x01; +pub const LOCKP_FAIL_WRITES: BYTE = 0x00; +pub const LOCKP_FAIL_MEM_MAPPING: BYTE = 0x02; +pub const LOCKP_ALLOW_MEM_MAPPING: BYTE = 0x00; +pub const LOCKP_USER_MASK: BYTE = 0x03; +pub const LOCKP_LOCK_FOR_FORMAT: BYTE = 0x04; +pub const LOCKF_LOGICAL_LOCK: BYTE = 0x00; +pub const LOCKF_PHYSICAL_LOCK: BYTE = 0x01; +pub const DBT_NO_DISK_SPACE: WPARAM = 0x0047; +pub const DBT_LOW_DISK_SPACE: WPARAM = 0x0048; +pub const DBT_CONFIGMGPRIVATE: WPARAM = 0x7FFF; +pub const DBT_DEVICEARRIVAL: WPARAM = 0x8000; +pub const DBT_DEVICEQUERYREMOVE: WPARAM = 0x8001; +pub const DBT_DEVICEQUERYREMOVEFAILED: WPARAM = 0x8002; +pub const DBT_DEVICEREMOVEPENDING: WPARAM = 0x8003; +pub const DBT_DEVICEREMOVECOMPLETE: WPARAM = 0x8004; +pub const DBT_DEVICETYPESPECIFIC: WPARAM = 0x8005; +pub const DBT_CUSTOMEVENT: WPARAM = 0x8006; +pub const DBT_DEVTYP_OEM: DWORD = 0x00000000; +pub const DBT_DEVTYP_DEVNODE: DWORD = 0x00000001; +pub const DBT_DEVTYP_VOLUME: DWORD = 0x00000002; +pub const DBT_DEVTYP_PORT: DWORD = 0x00000003; +pub const DBT_DEVTYP_NET: DWORD = 0x00000004; +pub const DBT_DEVTYP_DEVICEINTERFACE: DWORD = 0x00000005; +pub const DBT_DEVTYP_HANDLE: DWORD = 0x00000006; +STRUCT!{struct _DEV_BROADCAST_HEADER { + dbcd_size: DWORD, + dbcd_devicetype: DWORD, + dbcd_reserved: DWORD, +}} +STRUCT!{struct DEV_BROADCAST_OEM { + dbco_size: DWORD, + dbco_devicetype: DWORD, + dbco_reserved: DWORD, + dbco_identifier: DWORD, + dbco_suppfunc: DWORD, +}} +pub type PDEV_BROADCAST_OEM = *mut DEV_BROADCAST_OEM; +STRUCT!{struct DEV_BROADCAST_DEVNODE { + dbcd_size: DWORD, + dbcd_devicetype: DWORD, + dbcd_reserved: DWORD, + dbcd_devnode: DWORD, +}} +pub type PDEV_BROADCAST_DEVNODE = *mut DEV_BROADCAST_DEVNODE; +STRUCT!{struct DEV_BROADCAST_VOLUME { + dbcv_size: DWORD, + dbcv_devicetype: DWORD, + dbcv_reserved: DWORD, + dbcv_unitmask: DWORD, + dbcv_flags: WORD, +}} +pub type PDEV_BROADCAST_VOLUME = *mut DEV_BROADCAST_VOLUME; +pub const DBTF_MEDIA: WORD = 0x0001; +pub const DBTF_NET: WORD = 0x0002; +STRUCT!{struct DEV_BROADCAST_PORT_A { + dbcp_size: DWORD, + dbcp_devicetype: DWORD, + dbcp_reserved: DWORD, + dbcp_name: [c_char; 1], +}} +pub type PDEV_BROADCAST_PORT_A = *mut DEV_BROADCAST_PORT_A; +STRUCT!{struct DEV_BROADCAST_PORT_W { + dbcp_size: DWORD, + dbcp_devicetype: DWORD, + dbcp_reserved: DWORD, + dbcp_name: [wchar_t; 1], +}} +pub type PDEV_BROADCAST_PORT_W = *mut DEV_BROADCAST_PORT_W; +STRUCT!{struct DEV_BROADCAST_NET { + dbcn_size: DWORD, + dbcn_devicetype: DWORD, + dbcn_reserved: DWORD, + dbcn_resource: DWORD, + dbcn_flags: DWORD, +}} +pub type PDEV_BROADCAST_NET = *mut DEV_BROADCAST_NET; +STRUCT!{struct DEV_BROADCAST_DEVICEINTERFACE_A { + dbcc_size: DWORD, + dbcc_devicetype: DWORD, + dbcc_reserved: DWORD, + dbcc_classguid: GUID, + dbcc_name: [c_char; 1], +}} +pub type PDEV_BROADCAST_DEVICEINTERFACE_A = *mut DEV_BROADCAST_DEVICEINTERFACE_A; +STRUCT!{struct DEV_BROADCAST_DEVICEINTERFACE_W { + dbcc_size: DWORD, + dbcc_devicetype: DWORD, + dbcc_reserved: DWORD, + dbcc_classguid: GUID, + dbcc_name: [wchar_t; 1], +}} +pub type PDEV_BROADCAST_DEVICEINTERFACE_W = *mut DEV_BROADCAST_DEVICEINTERFACE_W; +STRUCT!{struct DEV_BROADCAST_HANDLE { + dbch_size: DWORD, + dbch_devicetype: DWORD, + dbch_reserved: DWORD, + dbch_handle: HANDLE, + dbch_hdevnotify: HDEVNOTIFY, + dbch_eventguid: GUID, + dbch_nameoffset: LONG, + dbch_data: [BYTE; 1], +}} +pub type PDEV_BROADCAST_HANDLE = *mut DEV_BROADCAST_HANDLE; +STRUCT!{struct DEV_BROADCAST_HANDLE32 { + dbch_size: DWORD, + dbch_devicetype: DWORD, + dbch_reserved: DWORD, + dbch_handle: ULONG32, + dbch_hdevnotify: ULONG32, + dbch_eventguid: GUID, + dbch_nameoffset: LONG, + dbch_data: [BYTE; 1], +}} +pub type PDEV_BROADCAST_HANDLE32 = *mut DEV_BROADCAST_HANDLE32; +STRUCT!{struct DEV_BROADCAST_HANDLE64 { + dbch_size: DWORD, + dbch_devicetype: DWORD, + dbch_reserved: DWORD, + dbch_handle: ULONG64, + dbch_hdevnotify: ULONG64, + dbch_eventguid: GUID, + dbch_nameoffset: LONG, + dbch_data: [BYTE; 1], +}} +pub type PDEV_BROADCAST_HANDLE64 = *mut DEV_BROADCAST_HANDLE64; +pub const DBTF_RESOURCE: DWORD = 0x00000001; +pub const DBTF_XPORT: DWORD = 0x00000002; +pub const DBTF_SLOWNET: DWORD = 0x00000004; +pub const DBT_VPOWERDAPI: WPARAM = 0x8100; +pub const DBT_USERDEFINED: WPARAM = 0xFFFF; +STRUCT!{struct _DEV_BROADCAST_USERDEFINED { + dbud_dbh: DEV_BROADCAST_HDR, + dbud_szName: [c_char; 1], +}} diff --git a/bash-5.1/vendor/winapi/src/um/dcommon.rs b/bash-5.1/vendor/winapi/src/um/dcommon.rs new file mode 100644 index 0000000000000000000000000000000000000000..e0260cbd95b6e9ed9ee285efad2ac809f540bf35 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dcommon.rs @@ -0,0 +1,114 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dcommon.h +use ctypes::c_void; +use shared::basetsd::UINT32; +use shared::dxgiformat::DXGI_FORMAT; +use shared::minwindef::FLOAT; +use shared::windef::{POINT, RECT}; +ENUM!{enum DWRITE_MEASURING_MODE { + DWRITE_MEASURING_MODE_NATURAL = 0, + DWRITE_MEASURING_MODE_GDI_CLASSIC = 1, + DWRITE_MEASURING_MODE_GDI_NATURAL = 2, +}} +ENUM!{enum DWRITE_GLYPH_IMAGE_FORMATS { + DWRITE_GLYPH_IMAGE_FORMATS_NONE = 0x00000000, + DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE = 0x00000001, + DWRITE_GLYPH_IMAGE_FORMATS_CFF = 0x00000002, + DWRITE_GLYPH_IMAGE_FORMATS_COLR = 0x00000004, + DWRITE_GLYPH_IMAGE_FORMATS_SVG = 0x00000008, + DWRITE_GLYPH_IMAGE_FORMATS_PNG = 0x00000010, + DWRITE_GLYPH_IMAGE_FORMATS_JPEG = 0x00000020, + DWRITE_GLYPH_IMAGE_FORMATS_TIFF = 0x00000040, + DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8 = 0x00000080, +}} +STRUCT!{struct DWRITE_GLYPH_IMAGE_DATA { + imageData: *const c_void, + imageDataSize: UINT32, + uniqueDataId: UINT32, + pixelsPerEm: UINT32, + pixelSize: D2D1_SIZE_U, + horizontalLeftOrigin: D2D1_POINT_2L, + horizontalRightOrigin: D2D1_POINT_2L, + verticalTopOrigin: D2D1_POINT_2L, + verticalBottomOrigin: D2D1_POINT_2L, +}} +ENUM!{enum D2D1_ALPHA_MODE { + D2D1_ALPHA_MODE_UNKNOWN = 0, + D2D1_ALPHA_MODE_PREMULTIPLIED = 1, + D2D1_ALPHA_MODE_STRAIGHT = 2, + D2D1_ALPHA_MODE_IGNORE = 3, +}} +STRUCT!{struct D2D1_PIXEL_FORMAT { + format: DXGI_FORMAT, + alphaMode: D2D1_ALPHA_MODE, +}} +STRUCT!{struct D2D_POINT_2U { + x: UINT32, + y: UINT32, +}} +STRUCT!{struct D2D_POINT_2F { + x: FLOAT, + y: FLOAT, +}} +pub type D2D_POINT_2L = POINT; +STRUCT!{struct D2D_VECTOR_2F { + x: FLOAT, + y: FLOAT, +}} +STRUCT!{struct D2D_VECTOR_3F { + x: FLOAT, + y: FLOAT, + z: FLOAT, +}} +STRUCT!{struct D2D_VECTOR_4F { + x: FLOAT, + y: FLOAT, + z: FLOAT, + w: FLOAT, +}} +STRUCT!{struct D2D_RECT_F { + left: FLOAT, + top: FLOAT, + right: FLOAT, + bottom: FLOAT, +}} +STRUCT!{struct D2D_RECT_U { + left: UINT32, + top: UINT32, + right: UINT32, + bottom: UINT32, +}} +pub type D2D_RECT_L = RECT; +STRUCT!{struct D2D_SIZE_F { + width: FLOAT, + height: FLOAT, +}} +STRUCT!{struct D2D_SIZE_U { + width: UINT32, + height: UINT32, +}} +STRUCT!{struct D2D_MATRIX_3X2_F { + matrix: [[FLOAT; 2]; 3], +}} +STRUCT!{struct D2D_MATRIX_4X3_F { + matrix: [[FLOAT; 3]; 4], +}} +STRUCT!{struct D2D_MATRIX_4X4_F { + matrix: [[FLOAT; 4]; 4], +}} +STRUCT!{struct D2D_MATRIX_5X4_F { + matrix: [[FLOAT; 4]; 5], +}} +pub type D2D1_POINT_2F = D2D_POINT_2F; +pub type D2D1_POINT_2U = D2D_POINT_2U; +pub type D2D1_POINT_2L = D2D_POINT_2L; +pub type D2D1_RECT_F = D2D_RECT_F; +pub type D2D1_RECT_U = D2D_RECT_U; +pub type D2D1_RECT_L = D2D_RECT_L; +pub type D2D1_SIZE_F = D2D_SIZE_F; +pub type D2D1_SIZE_U = D2D_SIZE_U; +pub type D2D1_MATRIX_3X2_F = D2D_MATRIX_3X2_F; diff --git a/bash-5.1/vendor/winapi/src/um/dcomp.rs b/bash-5.1/vendor/winapi/src/um/dcomp.rs new file mode 100644 index 0000000000000000000000000000000000000000..17048650aaa899327c1403857ffce545146c5973 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dcomp.rs @@ -0,0 +1,1159 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dcomp.h +use ctypes::{c_float, c_int, c_void}; +use shared::d3d9types::D3DMATRIX; +use shared::dcomptypes::{ + DCOMPOSITION_BACKFACE_VISIBILITY, DCOMPOSITION_BITMAP_INTERPOLATION_MODE, + DCOMPOSITION_BORDER_MODE, DCOMPOSITION_COMPOSITE_MODE, DCOMPOSITION_DEPTH_MODE, + DCOMPOSITION_FRAME_STATISTICS, DCOMPOSITION_OPACITY_MODE +}; +use shared::dxgi::IDXGIDevice; +use shared::dxgi1_2::DXGI_ALPHA_MODE; +use shared::dxgiformat::DXGI_FORMAT; +use shared::guiddef::REFIID; +use shared::minwindef::{BOOL, DWORD, UINT}; +use shared::ntdef::{HANDLE, HRESULT}; +use shared::windef::{HWND, POINT, RECT}; +use um::d2d1::{D2D1_COLOR_F, D2D1_MATRIX_3X2_F}; +use um::d2d1_1::{D2D1_COMPOSITE_MODE, D2D1_MATRIX_5X4_F, D2D1_VECTOR_2F, D2D1_VECTOR_4F}; +use um::d2d1effects::{ + D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE, D2D1_BLEND_MODE, D2D1_BORDER_MODE, + D2D1_COLORMATRIX_ALPHA_MODE, D2D1_TURBULENCE_NOISE +}; +use um::d2dbasetypes::{D2D_MATRIX_3X2_F, D2D_MATRIX_4X4_F, D2D_RECT_F}; +use um::d3dcommon::D3D_FEATURE_LEVEL; +use um::dcompanimation::IDCompositionAnimation; +use um::minwinbase::SECURITY_ATTRIBUTES; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +extern "system" { + pub fn DCompositionCreateDevice( + dxgiDevice: *const IDXGIDevice, + iid: REFIID, + dcompositionDevice: *mut *mut c_void, + ) -> HRESULT; + pub fn DCompositionCreateDevice2( + renderingDevice: *const IUnknown, + iid: REFIID, + dcompositionDevice: *mut *mut c_void, + ) -> HRESULT; + pub fn DCompositionCreateDevice3( + renderingDevice: *const IUnknown, + iid: REFIID, + dcompositionDevice: *mut *mut c_void, + ) -> HRESULT; + pub fn DCompositionGetFrameStatistics( + statistics: *const DCOMPOSITION_FRAME_STATISTICS, + minSafeFeaturelLevel: *const D3D_FEATURE_LEVEL, + maxHardwareFeaturelLevel: *const D3D_FEATURE_LEVEL, + ) -> HRESULT; + pub fn DCompositionCreateSurfaceHandle( + desiredAccess: DWORD, + securityAttributes: *const SECURITY_ATTRIBUTES, + surfaceHandle: *mut HANDLE, + ) -> HRESULT; + pub fn DCompositionAttachMouseWheelToHwnd( + visual: *const IDCompositionVisual, + hwnd: HWND, + enable: BOOL, + ) -> HRESULT; + pub fn DCompositionAttachMouseDragToHwnd( + visual: *const IDCompositionVisual, + hwnd: HWND, + enable: BOOL, + ) -> HRESULT; +} +RIDL!{#[uuid(0xc37ea93a, 0xe7aa, 0x450d, 0xb1, 0x6f, 0x97, 0x46, 0xcb, 0x04, 0x07, 0xf3)] +interface IDCompositionDevice(IDCompositionDeviceVtbl): IUnknown(IUnknownVtbl) { + fn Commit() -> HRESULT, + fn WaitForCommitCompletion() -> HRESULT, + fn GetFrameStatistics( + statistics: *mut DCOMPOSITION_FRAME_STATISTICS, + ) -> HRESULT, + fn CreateTargetForHwnd( + hwnd: HWND, + topmost: BOOL, + target: *mut *mut IDCompositionTarget, + ) -> HRESULT, + fn CreateVisual( + visual: *mut *mut IDCompositionVisual, + ) -> HRESULT, + fn CreateSurface( + width: UINT, + height: UINT, + pixelFormat: DXGI_FORMAT, + alphaMode: DXGI_ALPHA_MODE, + surface: *mut *mut IDCompositionSurface, + ) -> HRESULT, + fn CreateVirtualSurface( + initialWidth: UINT, + initialHeight: UINT, + pixelFormat: DXGI_FORMAT, + alphaMode: DXGI_ALPHA_MODE, + virtualSurface: *mut *mut IDCompositionVirtualSurface, + ) -> HRESULT, + fn CreateSurfaceFromHandle( + handle: HANDLE, + mutsurface: *mut *mut IUnknown, + ) -> HRESULT, + fn CreateSurfaceFromHwnd( + hwnd: HWND, + mutsurface: *mut *mut IUnknown, + ) -> HRESULT, + fn CreateTranslateTransform( + translateTransform: *mut *mut IDCompositionTranslateTransform, + ) -> HRESULT, + fn CreateScaleTransform( + scaleTransform: *mut *mut IDCompositionScaleTransform, + ) -> HRESULT, + fn CreateRotateTransform( + rotateTransform: *mut *mut IDCompositionRotateTransform, + ) -> HRESULT, + fn CreateSkewTransform( + skewTransform: *mut *mut IDCompositionSkewTransform, + ) -> HRESULT, + fn CreateMatrixTransform( + matrixTransform: *mut *mut IDCompositionMatrixTransform, + ) -> HRESULT, + fn CreateTransformGroup( + transforms: *const *const IDCompositionTransform, + elements: UINT, + transformGroup: *mut *mut IDCompositionTransform, + ) -> HRESULT, + fn CreateTranslateTransform3D( + translateTransform3D: *mut *mut IDCompositionTranslateTransform3D, + ) -> HRESULT, + fn CreateScaleTransform3D( + scaleTransform3D: *mut *mut IDCompositionScaleTransform3D, + ) -> HRESULT, + fn CreateRotateTransform3D( + rotateTransform3D: *mut *mut IDCompositionRotateTransform3D, + ) -> HRESULT, + fn CreateMatrixTransform3D( + matrixTransform3D: *mut *mut IDCompositionMatrixTransform3D, + ) -> HRESULT, + fn CreateTransform3DGroup( + transforms3D: *const *const IDCompositionTransform3D, + elements: UINT, + transform3DGroup: *mut *mut IDCompositionTransform3D, + ) -> HRESULT, + fn CreateEffectGroup( + effectGroup: *mut *mut IDCompositionEffectGroup, + ) -> HRESULT, + fn CreateRectangleClip( + clip: *mut *mut IDCompositionRectangleClip, + ) -> HRESULT, + fn CreateAnimation( + animation: *mut *mut IDCompositionAnimation, + ) -> HRESULT, + fn CheckDeviceState( + pfValid: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xeacdd04c, 0x117e, 0x4e17, 0x88, 0xf4, 0xd1, 0xb1, 0x2b, 0x0e, 0x3d, 0x89)] +interface IDCompositionTarget(IDCompositionTargetVtbl): IUnknown(IUnknownVtbl) { + fn SetRoot( + visual: *const IDCompositionVisual, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4d93059d, 0x097b, 0x4651, 0x9a, 0x60, 0xf0, 0xf2, 0x51, 0x16, 0xe2, 0xf3)] +interface IDCompositionVisual(IDCompositionVisualVtbl): IUnknown(IUnknownVtbl) { + fn SetOffsetX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetOffsetX_1( + offsetX: c_float, + ) -> HRESULT, + fn SetOffsetY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetOffsetY_1( + offsetY: c_float, + ) -> HRESULT, + fn SetTransform_2( + transform: *const IDCompositionTransform, + ) -> HRESULT, + fn SetTransform_1( + matrix: *const D2D_MATRIX_3X2_F, + ) -> HRESULT, + fn SetTransformParent( + visual: *const IDCompositionVisual, + ) -> HRESULT, + fn SetEffect( + effect: *const IDCompositionEffect, + ) -> HRESULT, + fn SetBitmapInterpolationMode( + interpolationMode: DCOMPOSITION_BITMAP_INTERPOLATION_MODE, + ) -> HRESULT, + fn SetBorderMode( + borderMode: DCOMPOSITION_BORDER_MODE, + ) -> HRESULT, + fn SetClip_2( + clip: *const IDCompositionClip, + ) -> HRESULT, + fn SetClip_1( + rect: *const D2D_RECT_F, + ) -> HRESULT, + fn SetContent( + content: *const IUnknown, + ) -> HRESULT, + fn AddVisual( + visual: *const IDCompositionVisual, + insertAbove: BOOL, + referenceVisual: *const IDCompositionVisual, + ) -> HRESULT, + fn RemoveVisual( + visual: *const IDCompositionVisual, + ) -> HRESULT, + fn RemoveAllVisuals() -> HRESULT, + fn SetCompositeMode( + compositeMode: DCOMPOSITION_COMPOSITE_MODE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xec81b08f, 0xbfcb, 0x4e8d, 0xb1, 0x93, 0xa9, 0x15, 0x58, 0x79, 0x99, 0xe8)] +interface IDCompositionEffect(IDCompositionEffectVtbl): IUnknown(IUnknownVtbl) {}} +RIDL!{#[uuid(0x71185722, 0x246b, 0x41f2, 0xaa, 0xd1, 0x04, 0x43, 0xf7, 0xf4, 0xbf, 0xc2)] +interface IDCompositionTransform3D(IDCompositionTransform3DVtbl): + IDCompositionEffect(IDCompositionEffectVtbl) {}} +RIDL!{#[uuid(0xfd55faa7, 0x37e0, 0x4c20, 0x95, 0xd2, 0x9b, 0xe4, 0x5b, 0xc3, 0x3f, 0x55)] +interface IDCompositionTransform(IDCompositionTransformVtbl): + IDCompositionTransform3D(IDCompositionTransform3DVtbl) {}} +RIDL!{#[uuid(0x06791122, 0xc6f0, 0x417d, 0x83, 0x23, 0x26, 0x9e, 0x98, 0x7f, 0x59, 0x54)] +interface IDCompositionTranslateTransform(IDCompositionTranslateTransformVtbl): + IDCompositionTransform(IDCompositionTransformVtbl) { + fn SetOffsetX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetOffsetX_1( + offsetX: c_float, + ) -> HRESULT, + fn SetOffsetY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetOffsetY_1( + offsetY: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x71fde914, 0x40ef, 0x45ef, 0xbd, 0x51, 0x68, 0xb0, 0x37, 0xc3, 0x39, 0xf9)] +interface IDCompositionScaleTransform(IDCompositionScaleTransformVtbl): + IDCompositionTransform(IDCompositionTransformVtbl) { + fn SetScaleX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetScaleX_1( + scaleX: c_float, + ) -> HRESULT, + fn SetScaleY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetScaleY_1( + scaleY: c_float, + ) -> HRESULT, + fn SetCenterX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterX_1( + centerX: c_float, + ) -> HRESULT, + fn SetCenterY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterY_1( + centerY: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x641ed83c, 0xae96, 0x46c5, 0x90, 0xdc, 0x32, 0x77, 0x4c, 0xc5, 0xc6, 0xd5)] +interface IDCompositionRotateTransform(IDCompositionRotateTransformVtbl): + IDCompositionTransform(IDCompositionTransformVtbl) { + fn SetAngle_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAngle_1( + angle: c_float, + ) -> HRESULT, + fn SetCenterX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterX_1( + centerX: c_float, + ) -> HRESULT, + fn SetCenterY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterY_1( + centerY: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xe57aa735, 0xdcdb, 0x4c72, 0x9c, 0x61, 0x05, 0x91, 0xf5, 0x88, 0x89, 0xee)] +interface IDCompositionSkewTransform(IDCompositionSkewTransformVtbl): + IDCompositionTransform(IDCompositionTransformVtbl) { + fn SetAngleX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAngleX_1( + angleX: c_float, + ) -> HRESULT, + fn SetAngleY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAngleY_1( + angleY: c_float, + ) -> HRESULT, + fn SetCenterX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterX_1( + centerX: c_float, + ) -> HRESULT, + fn SetCenterY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterY_1( + centerY: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x16cdff07, 0xc503, 0x419c, 0x83, 0xf2, 0x09, 0x65, 0xc7, 0xaf, 0x1f, 0xa6)] +interface IDCompositionMatrixTransform(IDCompositionMatrixTransformVtbl): + IDCompositionTransform(IDCompositionTransformVtbl) { + fn SetMatrix( + matrix: *const D2D_MATRIX_3X2_F, + ) -> HRESULT, + fn SetMatrixElement_2( + row: c_int, + column: c_int, + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetMatrixElement_1( + row: c_int, + column: c_int, + value: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa7929a74, 0xe6b2, 0x4bd6, 0x8b, 0x95, 0x40, 0x40, 0x11, 0x9c, 0xa3, 0x4d)] +interface IDCompositionEffectGroup(IDCompositionEffectGroupVtbl): + IDCompositionEffect(IDCompositionEffectVtbl) { + fn SetOpacity_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetOpacity_1( + opacity: c_float, + ) -> HRESULT, + fn SetTransform3D( + transform3D: *const IDCompositionTransform3D, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x91636d4b, 0x9ba1, 0x4532, 0xaa, 0xf7, 0xe3, 0x34, 0x49, 0x94, 0xd7, 0x88)] +interface IDCompositionTranslateTransform3D(IDCompositionTranslateTransform3DVtbl): + IDCompositionTransform3D(IDCompositionTransform3DVtbl) { + fn SetOffsetX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetOffsetX_1( + offsetX: c_float, + ) -> HRESULT, + fn SetOffsetY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetOffsetY_1( + offsetY: c_float, + ) -> HRESULT, + fn SetOffsetZ_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetOffsetZ_1( + offsetZ: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2a9e9ead, 0x364b, 0x4b15, 0xa7, 0xc4, 0xa1, 0x99, 0x7f, 0x78, 0xb3, 0x89)] +interface IDCompositionScaleTransform3D(IDCompositionScaleTransform3DVtbl): + IDCompositionTransform3D(IDCompositionTransform3DVtbl) { + fn SetScaleX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetScaleX_1( + scaleX: c_float, + ) -> HRESULT, + fn SetScaleY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetScaleY_1( + scaleY: c_float, + ) -> HRESULT, + fn SetScaleZ_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetScaleZ_1( + scaleZ: c_float, + ) -> HRESULT, + fn SetCenterX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterX_1( + centerX: c_float, + ) -> HRESULT, + fn SetCenterY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterY_1( + centerY: c_float, + ) -> HRESULT, + fn SetCenterZ_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterZ_1( + centerZ: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd8f5b23f, 0xd429, 0x4a91, 0xb5, 0x5a, 0xd2, 0xf4, 0x5f, 0xd7, 0x5b, 0x18)] +interface IDCompositionRotateTransform3D(IDCompositionRotateTransform3DVtbl): + IDCompositionTransform3D(IDCompositionTransform3DVtbl) { + fn SetAngle_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAngle_1( + angle: c_float, + ) -> HRESULT, + fn SetAxisX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAxisX_1( + axisX: c_float, + ) -> HRESULT, + fn SetAxisY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAxisY_1( + axisY: c_float, + ) -> HRESULT, + fn SetAxisZ_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAxisZ_1( + axisZ: c_float, + ) -> HRESULT, + fn SetCenterX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterX_1( + centerX: c_float, + ) -> HRESULT, + fn SetCenterY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterY_1( + centerY: c_float, + ) -> HRESULT, + fn SetCenterZ_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCenterZ_1( + centerZ: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4b3363f0, 0x643b, 0x41b7, 0xb6, 0xe0, 0xcc, 0xf2, 0x2d, 0x34, 0x46, 0x7c)] +interface IDCompositionMatrixTransform3D(IDCompositionMatrixTransform3DVtbl): + IDCompositionTransform3D(IDCompositionTransform3DVtbl) { + fn SetMatrix( + matrix: *const D3DMATRIX, + ) -> HRESULT, + fn SetMatrixElement_2( + row: c_int, + column: c_int, + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetMatrixElement_1( + row: c_int, + column: c_int, + value: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x64ac3703, 0x9d3f, 0x45ec, 0xa1, 0x09, 0x7c, 0xac, 0x0e, 0x7a, 0x13, 0xa7)] +interface IDCompositionClip(IDCompositionClipVtbl): IUnknown(IUnknownVtbl) {}} +RIDL!{#[uuid(0x9842ad7d, 0xd9cf, 0x4908, 0xae, 0xd7, 0x48, 0xb5, 0x1d, 0xa5, 0xe7, 0xc2)] +interface IDCompositionRectangleClip(IDCompositionRectangleClipVtbl): + IDCompositionClip(IDCompositionClipVtbl) { + fn SetLeft_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetLeft_1( + left: c_float, + ) -> HRESULT, + fn SetTop_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetTop_1( + top: c_float, + ) -> HRESULT, + fn SetRight_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetRight_1( + right: c_float, + ) -> HRESULT, + fn SetBottom_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBottom_1( + bottom: c_float, + ) -> HRESULT, + fn SetTopLeftRadiusX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetTopLeftRadiusX_1( + radius: c_float, + ) -> HRESULT, + fn SetTopLeftRadiusY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetTopLeftRadiusY_1( + radius: c_float, + ) -> HRESULT, + fn SetTopRightRadiusX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetTopRightRadiusX_1( + radius: c_float, + ) -> HRESULT, + fn SetTopRightRadiusY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetTopRightRadiusY_1( + radius: c_float, + ) -> HRESULT, + fn SetBottomLeftRadiusX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBottomLeftRadiusX_1( + radius: c_float, + ) -> HRESULT, + fn SetBottomLeftRadiusY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBottomLeftRadiusY_1( + radius: c_float, + ) -> HRESULT, + fn SetBottomRightRadiusX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBottomRightRadiusX_1( + radius: c_float, + ) -> HRESULT, + fn SetBottomRightRadiusY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBottomRightRadiusY_1( + radius: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xbb8a4953, 0x2c99, 0x4f5a, 0x96, 0xf5, 0x48, 0x19, 0x02, 0x7f, 0xa3, 0xac)] +interface IDCompositionSurface(IDCompositionSurfaceVtbl): IUnknown(IUnknownVtbl) { + fn BeginDraw( + updateRect: *const RECT, + iid: REFIID, + updateObject: *mut *mut c_void, + updateOffset: *mut POINT, + ) -> HRESULT, + fn EndDraw() -> HRESULT, + fn SuspendDraw() -> HRESULT, + fn ResumeDraw() -> HRESULT, + fn Scroll( + scrollRect: *const RECT, + clipRect: *const RECT, + offsetX: c_int, + offsetY: c_int, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xae471c51, 0x5f53, 0x4a24, 0x8d, 0x3e, 0xd0, 0xc3, 0x9c, 0x30, 0xb3, 0xf0)] +interface IDCompositionVirtualSurface(IDCompositionVirtualSurfaceVtbl): + IDCompositionSurface(IDCompositionSurfaceVtbl) { + fn Resize( + width: UINT, + height: UINT, + ) -> HRESULT, + fn Trim( + rectangles: *const RECT, + count: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x75f6468d, 0x1b8e, 0x447c, 0x9b, 0xc6, 0x75, 0xfe, 0xa8, 0x0b, 0x5b, 0x25)] +interface IDCompositionDevice2(IDCompositionDevice2Vtbl): IUnknown(IUnknownVtbl) { + fn Commit() -> HRESULT, + fn WaitForCommitCompletion() -> HRESULT, + fn GetFrameStatistics( + statistics: *mut DCOMPOSITION_FRAME_STATISTICS, + ) -> HRESULT, + fn CreateVisual( + visual: *mut *mut IDCompositionVisual2, + ) -> HRESULT, + fn CreateSurfaceFactory( + renderingDevice: *const IUnknown, + surfaceFactory: *mut *mut IDCompositionSurfaceFactory, + ) -> HRESULT, + fn CreateSurface( + width: UINT, + height: UINT, + pixelFormat: DXGI_FORMAT, + alphaMode: DXGI_ALPHA_MODE, + surface: *mut *mut IDCompositionSurface, + ) -> HRESULT, + fn CreateVirtualSurface( + initialWidth: UINT, + initialHeight: UINT, + pixelFormat: DXGI_FORMAT, + alphaMode: DXGI_ALPHA_MODE, + virtualSurface: *mut *mut IDCompositionVirtualSurface, + ) -> HRESULT, + fn CreateTranslateTransform( + translateTransform: *mut *mut IDCompositionTranslateTransform, + ) -> HRESULT, + fn CreateScaleTransform( + scaleTransform: *mut *mut IDCompositionScaleTransform, + ) -> HRESULT, + fn CreateRotateTransform( + rotateTransform: *mut *mut IDCompositionRotateTransform, + ) -> HRESULT, + fn CreateSkewTransform( + skewTransform: *mut *mut IDCompositionSkewTransform, + ) -> HRESULT, + fn CreateMatrixTransform( + matrixTransform: *mut *mut IDCompositionMatrixTransform, + ) -> HRESULT, + fn CreateTransformGroup( + transforms: *const *const IDCompositionTransform, + elements: UINT, + transformGroup: *mut *mut IDCompositionTransform, + ) -> HRESULT, + fn CreateTranslateTransform3D( + translateTransform3D: *mut *mut IDCompositionTranslateTransform3D, + ) -> HRESULT, + fn CreateScaleTransform3D( + scaleTransform3D: *mut *mut IDCompositionScaleTransform3D, + ) -> HRESULT, + fn CreateRotateTransform3D( + rotateTransform3D: *mut *mut IDCompositionRotateTransform3D, + ) -> HRESULT, + fn CreateMatrixTransform3D( + matrixTransform3D: *mut *mut IDCompositionMatrixTransform3D, + ) -> HRESULT, + fn CreateTransform3DGroup( + transforms3D: *const *const IDCompositionTransform3D, + elements: UINT, + transform3DGroup: *mut *mut IDCompositionTransform3D, + ) -> HRESULT, + fn CreateEffectGroup( + effectGroup: *mut *mut IDCompositionEffectGroup, + ) -> HRESULT, + fn CreateRectangleClip( + clip: *mut *mut IDCompositionRectangleClip, + ) -> HRESULT, + fn CreateAnimation( + animation: *mut *mut IDCompositionAnimation, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5f4633fe, 0x1e08, 0x4cb8, 0x8c, 0x75, 0xce, 0x24, 0x33, 0x3f, 0x56, 0x02)] +interface IDCompositionDesktopDevice(IDCompositionDesktopDeviceVtbl): + IDCompositionDevice2(IDCompositionDevice2Vtbl) { + fn CreateTargetForHwnd( + hwnd: HWND, + topmost: BOOL, + target: *mut *mut IDCompositionTarget, + ) -> HRESULT, + fn CreateSurfaceFromHandle( + handle: HANDLE, + surface: *mut *mut IUnknown, + ) -> HRESULT, + fn CreateSurfaceFromHwnd( + hwnd: HWND, + surface: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa1a3c64a, 0x224f, 0x4a81, 0x97, 0x73, 0x4f, 0x03, 0xa8, 0x9d, 0x3c, 0x6c)] +interface IDCompositionDeviceDebug(IDCompositionDeviceDebugVtbl): IUnknown(IUnknownVtbl) { + fn EnableDebugCounters() -> HRESULT, + fn DisableDebugCounters() -> HRESULT, +}} +RIDL!{#[uuid(0xe334bc12, 0x3937, 0x4e02, 0x85, 0xeb, 0xfc, 0xf4, 0xeb, 0x30, 0xd2, 0xc8)] +interface IDCompositionSurfaceFactory(IDCompositionSurfaceFactoryVtbl): IUnknown(IUnknownVtbl) { + fn CreateSurface( + width: UINT, + height: UINT, + pixelFormat: DXGI_FORMAT, + alphaMode: DXGI_ALPHA_MODE, + surface: *mut *mut IDCompositionSurface, + ) -> HRESULT, + fn CreateVirtualSurface( + initialWidth: UINT, + initialHeight: UINT, + pixelFormat: DXGI_FORMAT, + alphaMode: DXGI_ALPHA_MODE, + virtualSurface: *mut *mut IDCompositionVirtualSurface, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xe8de1639, 0x4331, 0x4b26, 0xbc, 0x5f, 0x6a, 0x32, 0x1d, 0x34, 0x7a, 0x85)] +interface IDCompositionVisual2(IDCompositionVisual2Vtbl): + IDCompositionVisual(IDCompositionVisualVtbl) { + fn SetOpacityMode( + mode: DCOMPOSITION_OPACITY_MODE, + ) -> HRESULT, + fn SetBackFaceVisibility( + visibility: DCOMPOSITION_BACKFACE_VISIBILITY, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xfed2b808, 0x5eb4, 0x43a0, 0xae, 0xa3, 0x35, 0xf6, 0x52, 0x80, 0xf9, 0x1b)] +interface IDCompositionVisualDebug(IDCompositionVisualDebugVtbl): + IDCompositionVisual2(IDCompositionVisual2Vtbl) { + fn EnableHeatMap( + color: *const D2D1_COLOR_F, + ) -> HRESULT, + fn DisableHeatMap() -> HRESULT, + fn EnableRedrawRegions() -> HRESULT, + fn DisableRedrawRegions() -> HRESULT, +}} +RIDL!{#[uuid(0x2775f462, 0xb6c1, 0x4015, 0xb0, 0xbe, 0xb3, 0xe7, 0xd6, 0xa4, 0x97, 0x6d)] +interface IDCompositionVisual3(IDCompositionVisual3Vtbl): + IDCompositionVisualDebug(IDCompositionVisualDebugVtbl) { + fn SetDepthMode( + mode: DCOMPOSITION_DEPTH_MODE, + ) -> HRESULT, + fn SetOffsetZ_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetOffsetZ_1( + offsetZ: c_float, + ) -> HRESULT, + fn SetOpacity_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetOpacity_1( + opacity: c_float, + ) -> HRESULT, + fn SetTransform_2( + transform: *const IDCompositionTransform3D, + ) -> HRESULT, + fn SetTransform_1( + matrix: *const D2D_MATRIX_4X4_F, + ) -> HRESULT, + fn SetVisible( + visible: BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0987cb06, 0xf916, 0x48bf, 0x8d, 0x35, 0xce, 0x76, 0x41, 0x78, 0x1b, 0xd9)] +interface IDCompositionDevice3(IDCompositionDevice3Vtbl): + IDCompositionDevice2(IDCompositionDevice2Vtbl) { + fn CreateGaussianBlurEffect( + gaussianBlurEffect: *mut *mut IDCompositionGaussianBlurEffect, + ) -> HRESULT, + fn CreateBrightnessEffect( + brightnessEffect: *mut *mut IDCompositionBrightnessEffect, + ) -> HRESULT, + fn CreateColorMatrixEffect( + colorMatrixEffect: *mut *mut IDCompositionColorMatrixEffect, + ) -> HRESULT, + fn CreateShadowEffect( + shadowEffect: *mut *mut IDCompositionShadowEffect, + ) -> HRESULT, + fn CreateHueRotationEffect( + hueRotationEffect: *mut *mut IDCompositionHueRotationEffect, + ) -> HRESULT, + fn CreateSaturationEffect( + saturationEffect: *mut *mut IDCompositionSaturationEffect, + ) -> HRESULT, + fn CreateTurbulenceEffect( + turbulenceEffect: *mut *mut IDCompositionTurbulenceEffect, + ) -> HRESULT, + fn CreateLinearTransferEffect( + linearTransferEffect: *mut *mut IDCompositionLinearTransferEffect, + ) -> HRESULT, + fn CreateTableTransferEffect( + tableTransferEffect: *mut *mut IDCompositionTableTransferEffect, + ) -> HRESULT, + fn CreateCompositeEffect( + compositeEffect: *mut *mut IDCompositionCompositeEffect, + ) -> HRESULT, + fn CreateBlendEffect( + blendEffect: *mut *mut IDCompositionBlendEffect, + ) -> HRESULT, + fn CreateArithmeticCompositeEffect( + arithmeticCompositeEffect: *mut *mut IDCompositionArithmeticCompositeEffect, + ) -> HRESULT, + fn CreateAffineTransform2DEffect( + affineTransform2dEffect: *mut *mut IDCompositionAffineTransform2DEffect, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x30c421d5, 0x8cb2, 0x4e9f, 0xb1, 0x33, 0x37, 0xbe, 0x27, 0x0d, 0x4a, 0xc2)] +interface IDCompositionFilterEffect(IDCompositionFilterEffectVtbl): + IDCompositionEffect(IDCompositionEffectVtbl) { + fn SetInput( + index: UINT, + input: *const IUnknown, + flags: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x45d4d0b7, 0x1bd4, 0x454e, 0x88, 0x94, 0x2b, 0xfa, 0x68, 0x44, 0x30, 0x33)] +interface IDCompositionGaussianBlurEffect(IDCompositionGaussianBlurEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetStandardDeviation_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetStandardDeviation_1( + amount: c_float, + ) -> HRESULT, + fn SetBorderMode( + mode: D2D1_BORDER_MODE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6027496e, 0xcb3a, 0x49ab, 0x93, 0x4f, 0xd7, 0x98, 0xda, 0x4f, 0x7d, 0xa6)] +interface IDCompositionBrightnessEffect(IDCompositionBrightnessEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetWhitePoint( + whitePoint: *const D2D1_VECTOR_2F, + ) -> HRESULT, + fn SetBlackPoint( + blackPoint: *const D2D1_VECTOR_2F, + ) -> HRESULT, + fn SetWhitePointX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetWhitePointX_1( + whitePointX: c_float, + ) -> HRESULT, + fn SetWhitePointY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetWhitePointY_1( + whitePointY: c_float, + ) -> HRESULT, + fn SetBlackPointX_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBlackPointX_1( + blackPointX: c_float, + ) -> HRESULT, + fn SetBlackPointY_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBlackPointY_1( + blackPointY: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc1170a22, 0x3ce2, 0x4966, 0x90, 0xd4, 0x55, 0x40, 0x8b, 0xfc, 0x84, 0xc4)] +interface IDCompositionColorMatrixEffect(IDCompositionColorMatrixEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetMatrix( + matrix: *const D2D1_MATRIX_5X4_F, + ) -> HRESULT, + fn SetMatrixElement_2( + row: c_int, + column: c_int, + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetMatrixElement_1( + row: c_int, + column: c_int, + value: c_float, + ) -> HRESULT, + fn SetAlphaMode( + mode: D2D1_COLORMATRIX_ALPHA_MODE, + ) -> HRESULT, + fn SetClampOutput( + clamp: BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4ad18ac0, 0xcfd2, 0x4c2f, 0xbb, 0x62, 0x96, 0xe5, 0x4f, 0xdb, 0x68, 0x79)] +interface IDCompositionShadowEffect(IDCompositionShadowEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetStandardDeviation_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetStandardDeviation_1( + amount: c_float, + ) -> HRESULT, + fn SetColor( + color: *const D2D1_VECTOR_4F, + ) -> HRESULT, + fn SetRed_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetRed_1( + amount: c_float, + ) -> HRESULT, + fn SetGreen_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetGreen_1( + amount: c_float, + ) -> HRESULT, + fn SetBlue_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBlue_1( + amount: c_float, + ) -> HRESULT, + fn SetAlpha_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAlpha_1( + amount: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6db9f920, 0x0770, 0x4781, 0xb0, 0xc6, 0x38, 0x19, 0x12, 0xf9, 0xd1, 0x67)] +interface IDCompositionHueRotationEffect(IDCompositionHueRotationEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + // Changes the angle of rotation + fn SetAngle_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAngle_1( + amountDegrees: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa08debda, 0x3258, 0x4fa4, 0x9f, 0x16, 0x91, 0x74, 0xd3, 0xfe, 0x93, 0xb1)] +interface IDCompositionSaturationEffect(IDCompositionSaturationEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + // Changes the amount of saturation to be applied. + fn SetSaturation_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetSaturation_1( + ratio: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa6a55bda, 0xc09c, 0x49f3, 0x91, 0x93, 0xa4, 0x19, 0x22, 0xc8, 0x97, 0x15)] +interface IDCompositionTurbulenceEffect(IDCompositionTurbulenceEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetOffset( + offset: *const D2D1_VECTOR_2F, + ) -> HRESULT, + fn SetBaseFrequency( + frequency: *const D2D1_VECTOR_2F, + ) -> HRESULT, + fn SetSize( + size: *const D2D1_VECTOR_2F, + ) -> HRESULT, + fn SetNumOctaves( + numOctaves: UINT, + ) -> HRESULT, + fn SetSeed( + seed: UINT, + ) -> HRESULT, + fn SetNoise( + noise: D2D1_TURBULENCE_NOISE, + ) -> HRESULT, + fn SetStitchable( + stitchable: BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4305ee5b, 0xc4a0, 0x4c88, 0x93, 0x85, 0x67, 0x12, 0x4e, 0x01, 0x76, 0x83)] +interface IDCompositionLinearTransferEffect(IDCompositionLinearTransferEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetRedYIntercept_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetRedYIntercept_1( + redYIntercept: c_float, + ) -> HRESULT, + fn SetRedSlope_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetRedSlope_1( + redSlope: c_float, + ) -> HRESULT, + fn SetRedDisable( + redDisable: BOOL, + ) -> HRESULT, + fn SetGreenYIntercept_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetGreenYIntercept_1( + greenYIntercept: c_float, + ) -> HRESULT, + fn SetGreenSlope_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetGreenSlope_1( + greenSlope: c_float, + ) -> HRESULT, + fn SetGreenDisable( + greenDisable: BOOL, + ) -> HRESULT, + fn SetBlueYIntercept_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBlueYIntercept_1( + blueYIntercept: c_float, + ) -> HRESULT, + fn SetBlueSlope_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBlueSlope_1( + blueSlope: c_float, + ) -> HRESULT, + fn SetBlueDisable( + blueDisable: BOOL, + ) -> HRESULT, + fn SetAlphaYIntercept_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAlphaYIntercept_1( + alphaYIntercept: c_float, + ) -> HRESULT, + fn SetAlphaSlope_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAlphaSlope_1( + alphaSlope: c_float, + ) -> HRESULT, + fn SetAlphaDisable( + alphaDisable: BOOL, + ) -> HRESULT, + fn SetClampOutput( + clampOutput: BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9b7e82e2, 0x69c5, 0x4eb4, 0xa5, 0xf5, 0xa7, 0x03, 0x3f, 0x51, 0x32, 0xcd)] +interface IDCompositionTableTransferEffect(IDCompositionTableTransferEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetRedTable( + tableValues: *const c_float, + count: UINT, + ) -> HRESULT, + fn SetGreenTable( + tableValues: *const c_float, + count: UINT, + ) -> HRESULT, + fn SetBlueTable( + tableValues: *const c_float, + count: UINT, + ) -> HRESULT, + fn SetAlphaTable( + tableValues: *const c_float, + count: UINT, + ) -> HRESULT, + fn SetRedDisable( + redDisable: BOOL, + ) -> HRESULT, + fn SetGreenDisable( + greenDisable: BOOL, + ) -> HRESULT, + fn SetBlueDisable( + blueDisable: BOOL, + ) -> HRESULT, + fn SetAlphaDisable( + alphaDisable: BOOL, + ) -> HRESULT, + fn SetClampOutput( + clampOutput: BOOL, + ) -> HRESULT, + fn SetRedTableValue_2( + index: UINT, + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetRedTableValue_1( + index: UINT, + value: c_float, + ) -> HRESULT, + fn SetGreenTableValue_2( + index: UINT, + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetGreenTableValue_1( + index: UINT, + value: c_float, + ) -> HRESULT, + fn SetBlueTableValue_2( + index: UINT, + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetBlueTableValue_1( + index: UINT, + value: c_float, + ) -> HRESULT, + fn SetAlphaTableValue_2( + index: UINT, + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetAlphaTableValue_1( + index: UINT, + value: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x576616c0, 0xa231, 0x494d, 0xa3, 0x8d, 0x00, 0xfd, 0x5e, 0xc4, 0xdb, 0x46)] +interface IDCompositionCompositeEffect(IDCompositionCompositeEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetMode( + mode: D2D1_COMPOSITE_MODE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x33ecdc0a, 0x578a, 0x4a11, 0x9c, 0x14, 0x0c, 0xb9, 0x05, 0x17, 0xf9, 0xc5)] +interface IDCompositionBlendEffect(IDCompositionBlendEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetMode( + mode: D2D1_BLEND_MODE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3b67dfa8, 0xe3dd, 0x4e61, 0xb6, 0x40, 0x46, 0xc2, 0xf3, 0xd7, 0x39, 0xdc)] +interface IDCompositionArithmeticCompositeEffect(IDCompositionArithmeticCompositeEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetCoefficients( + coefficients: *const D2D1_VECTOR_4F, + ) -> HRESULT, + fn SetClampOutput( + clampoutput: BOOL, + ) -> HRESULT, + fn SetCoefficient1_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCoefficient1_1( + Coeffcient1: c_float, + ) -> HRESULT, + fn SetCoefficient2_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCoefficient2_1( + Coefficient2: c_float, + ) -> HRESULT, + fn SetCoefficient3_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCoefficient3_1( + Coefficient3: c_float, + ) -> HRESULT, + fn SetCoefficient4_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetCoefficient4_1( + Coefficient4: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0b74b9e8, 0xcdd6, 0x492f, 0xbb, 0xbc, 0x5e, 0xd3, 0x21, 0x57, 0x02, 0x6d)] +interface IDCompositionAffineTransform2DEffect(IDCompositionAffineTransform2DEffectVtbl): + IDCompositionFilterEffect(IDCompositionFilterEffectVtbl) { + fn SetInterpolationMode( + interpolationMode: D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE, + ) -> HRESULT, + fn SetBorderMode( + borderMode: D2D1_BORDER_MODE, + ) -> HRESULT, + fn SetTransformMatrix( + transformMatrix: *const D2D1_MATRIX_3X2_F, + ) -> HRESULT, + fn SetTransformMatrixElement_2( + row: c_int, + column: c_int, + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetTransformMatrixElement_1( + row: c_int, + column: c_int, + value: c_float, + ) -> HRESULT, + fn SetSharpness_2( + animation: *const IDCompositionAnimation, + ) -> HRESULT, + fn SetSharpness_1( + sharpness: c_float, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/dcompanimation.rs b/bash-5.1/vendor/winapi/src/um/dcompanimation.rs new file mode 100644 index 0000000000000000000000000000000000000000..ca54c405ed345de0cca8408e42bf44bd304d3dd4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dcompanimation.rs @@ -0,0 +1,38 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of dcompanimation.h +use ctypes::{c_double, c_float}; +use shared::ntdef::{HRESULT, LARGE_INTEGER}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +RIDL!{#[uuid(0xcbfd91d9, 0x51b2, 0x45e4, 0xb3, 0xde, 0xd1, 0x9c, 0xcf, 0xb8, 0x63, 0xc5)] +interface IDCompositionAnimation(IDCompositionAnimationVtbl): IUnknown(IUnknownVtbl) { + fn Reset() -> HRESULT, + fn SetAbsoluteBeginTime( + beginTime: LARGE_INTEGER, + ) -> HRESULT, + fn AddCubic( + beginOffset: c_double, + constantCoefficient: c_float, + linearCoefficient: c_float, + quadraticCoefficient: c_float, + cubicCoefficient: c_float, + )-> HRESULT, + fn AddSinusoidal( + beginOffset: c_double, + bias: c_float, + amplitude: c_float, + frequency: c_float, + phase: c_float, + )-> HRESULT, + fn AddRepeat( + beginOffset: c_double, + durationToRepeat: c_double, + )-> HRESULT, + fn End( + endOffset: c_double, + endValue: c_float, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/dde.rs b/bash-5.1/vendor/winapi/src/um/dde.rs new file mode 100644 index 0000000000000000000000000000000000000000..b3ce4a9da70b4a37896dc5865973ab4e5ad2d124 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dde.rs @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{PUINT_PTR, UINT_PTR}; +use shared::minwindef::{BOOL, LPARAM, UINT}; +extern "system" { + pub fn PackDDElParam( + msg: UINT, + uiLo: UINT_PTR, + uiHi: UINT_PTR, + ) -> LPARAM; + pub fn UnpackDDElParam( + msg: UINT, + lParam: LPARAM, + puiLo: PUINT_PTR, + puiHi: PUINT_PTR, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/ddraw.rs b/bash-5.1/vendor/winapi/src/um/ddraw.rs new file mode 100644 index 0000000000000000000000000000000000000000..fd0d9e89b507b909cddd3a4c6a215cd5683a79d4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ddraw.rs @@ -0,0 +1,37 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{CLSID_DirectDraw, + 0xd7b70ee0, 0x4340, 0x11cf, 0xb0, 0x63, 0x00, 0x20, 0xaf, 0xc2, 0xcd, 0x35} +DEFINE_GUID!{CLSID_DirectDraw7, + 0x3c305196, 0x50db, 0x11d3, 0x9c, 0xfe, 0x00, 0xc0, 0x4f, 0xd9, 0x30, 0xc5} +DEFINE_GUID!{CLSID_DirectDrawClipper, + 0x593817a0, 0x7db3, 0x11cf, 0xa2, 0xde, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} +DEFINE_GUID!{IID_IDirectDraw, + 0x6c14db80, 0xa733, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} +DEFINE_GUID!{IID_IDirectDraw2, + 0xb3a6f3e0, 0x2b43, 0x11cf, 0xa2, 0xde, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} +DEFINE_GUID!{IID_IDirectDraw4, + 0x9c59509a, 0x39bd, 0x11d1, 0x8c, 0x4a, 0x00, 0xc0, 0x4f, 0xd9, 0x30, 0xc5} +DEFINE_GUID!{IID_IDirectDraw7, + 0x15e65ec0, 0x3b9c, 0x11d2, 0xb9, 0x2f, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b} +DEFINE_GUID!{IID_IDirectDrawSurface, + 0x6c14db81, 0xa733, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} +DEFINE_GUID!{IID_IDirectDrawSurface2, + 0x57805885, 0x6eec, 0x11cf, 0x94, 0x41, 0xa8, 0x23, 0x03, 0xc1, 0x0e, 0x27} +DEFINE_GUID!{IID_IDirectDrawSurface3, + 0xda044e00, 0x69b2, 0x11d0, 0xa1, 0xd5, 0x00, 0xaa, 0x00, 0xb8, 0xdf, 0xbb} +DEFINE_GUID!{IID_IDirectDrawSurface4, + 0x0b2b8630, 0xad35, 0x11d0, 0x8e, 0xa6, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b} +DEFINE_GUID!{IID_IDirectDrawSurface7, + 0x06675a80, 0x3b9b, 0x11d2, 0xb9, 0x2f, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b} +DEFINE_GUID!{IID_IDirectDrawPalette, + 0x6c14db84, 0xa733, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} +DEFINE_GUID!{IID_IDirectDrawClipper, + 0x6c14db85, 0xa733, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} +DEFINE_GUID!{IID_IDirectDrawColorControl, + 0x4b9f0ee0, 0x0d7e, 0x11d0, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} +DEFINE_GUID!{IID_IDirectDrawGammaControl, + 0x69c11c3e, 0xb46b, 0x11d1, 0xad, 0x7a, 0x00, 0xc0, 0x4f, 0xc2, 0x9b, 0x4e} diff --git a/bash-5.1/vendor/winapi/src/um/ddrawi.rs b/bash-5.1/vendor/winapi/src/um/ddrawi.rs new file mode 100644 index 0000000000000000000000000000000000000000..18e65186351a7308653913d09f66af334379cc86 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ddrawi.rs @@ -0,0 +1,13 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{GUID_OptSurfaceKmodeInfo, + 0xe05c8472, 0x51d4, 0x11d1, 0x8c, 0xce, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} +DEFINE_GUID!{GUID_OptSurfaceUmodeInfo, + 0x9d792804, 0x5fa8, 0x11d1, 0x8c, 0xd0, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} +DEFINE_GUID!{GUID_UserModeDriverInfo, + 0xf0b0e8e2, 0x5f97, 0x11d1, 0x8c, 0xd0, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} +DEFINE_GUID!{GUID_UserModeDriverPassword, + 0x97f861b6, 0x60a1, 0x11d1, 0x8c, 0xd0, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} diff --git a/bash-5.1/vendor/winapi/src/um/ddrawint.rs b/bash-5.1/vendor/winapi/src/um/ddrawint.rs new file mode 100644 index 0000000000000000000000000000000000000000..2f9b7431b63d776e0563fab4fff9f4920b17249a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ddrawint.rs @@ -0,0 +1,41 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{GUID_MiscellaneousCallbacks, + 0xefd60cc0, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} +DEFINE_GUID!{GUID_Miscellaneous2Callbacks, + 0x406b2f00, 0x3e5a, 0x11d1, 0xb6, 0x40, 0x00, 0xaa, 0x00, 0xa1, 0xf9, 0x6a} +DEFINE_GUID!{GUID_VideoPortCallbacks, + 0xefd60cc1, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} +DEFINE_GUID!{GUID_ColorControlCallbacks, + 0xefd60cc2, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} +DEFINE_GUID!{GUID_MotionCompCallbacks, + 0xb1122b40, 0x5da5, 0x11d1, 0x8f, 0xcf, 0x00, 0xc0, 0x4f, 0xc2, 0x9b, 0x4e} +DEFINE_GUID!{GUID_VideoPortCaps, + 0xefd60cc3, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} +DEFINE_GUID!{GUID_D3DExtendedCaps, + 0x7de41f80, 0x9d93, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} +DEFINE_GUID!{GUID_D3DCallbacks2, + 0x0ba584e1, 0x70b6, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} +DEFINE_GUID!{GUID_D3DCallbacks3, + 0xddf41230, 0xec0a, 0x11d0, 0xa9, 0xb6, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e} +DEFINE_GUID!{GUID_NonLocalVidMemCaps, + 0x86c4fa80, 0x8d84, 0x11d0, 0x94, 0xe8, 0x00, 0xc0, 0x4f, 0xc3, 0x41, 0x37} +DEFINE_GUID!{GUID_KernelCallbacks, + 0x80863800, 0x6b06, 0x11d0, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} +DEFINE_GUID!{GUID_KernelCaps, + 0xffaa7540, 0x7aa8, 0x11d0, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} +DEFINE_GUID!{GUID_ZPixelFormats, + 0x93869880, 0x36cf, 0x11d1, 0x9b, 0x1b, 0x00, 0xaa, 0x00, 0xbb, 0xb8, 0xae} +DEFINE_GUID!{GUID_DDMoreCaps, + 0x880baf30, 0xb030, 0x11d0, 0x8e, 0xa7, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b} +DEFINE_GUID!{GUID_D3DParseUnknownCommandCallback, + 0x2e04ffa0, 0x98e4, 0x11d1, 0x8c, 0xe1, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} +DEFINE_GUID!{GUID_NTCallbacks, + 0x6fe9ecde, 0xdf89, 0x11d1, 0x9d, 0xb0, 0x00, 0x60, 0x08, 0x27, 0x71, 0xba} +DEFINE_GUID!{GUID_DDMoreSurfaceCaps, + 0x3b8a0466, 0xf269, 0x11d1, 0x88, 0x0b, 0x00, 0xc0, 0x4f, 0xd9, 0x30, 0xc5} +DEFINE_GUID!{GUID_DDStereoMode, + 0xf828169c, 0xa8e8, 0x11d2, 0xa1, 0xf2, 0x00, 0xa0, 0xc9, 0x83, 0xea, 0xf6} diff --git a/bash-5.1/vendor/winapi/src/um/debugapi.rs b/bash-5.1/vendor/winapi/src/um/debugapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..442b50db45e97141e92123815c9f3cbee6f9383d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/debugapi.rs @@ -0,0 +1,41 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, DWORD, PBOOL}; +use um::minwinbase::LPDEBUG_EVENT; +use um::winnt::{HANDLE, LPCSTR, LPCWSTR}; +extern "system" { + pub fn IsDebuggerPresent() -> BOOL; + pub fn DebugBreak(); + pub fn OutputDebugStringA( + lpOutputString: LPCSTR, + ); + pub fn OutputDebugStringW( + lpOutputString: LPCWSTR, + ); + pub fn ContinueDebugEvent( + dwProcessId: DWORD, + dwThreadId: DWORD, + dwContinueStatus: DWORD, + ) -> BOOL; + pub fn WaitForDebugEvent( + lpDebugEvent: LPDEBUG_EVENT, + dwMilliseconds: DWORD, + ) -> BOOL; + pub fn DebugActiveProcess( + dwProcessId: DWORD, + ) -> BOOL; + pub fn DebugActiveProcessStop( + dwProcessId: DWORD, + ) -> BOOL; + pub fn CheckRemoteDebuggerPresent( + hProcess: HANDLE, + pbDebuggerPresent: PBOOL, + ) -> BOOL; + pub fn WaitForDebugEventEx( + lpDebugEvent: LPDEBUG_EVENT, + dwMilliseconds: DWORD, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/devicetopology.rs b/bash-5.1/vendor/winapi/src/um/devicetopology.rs new file mode 100644 index 0000000000000000000000000000000000000000..6f74ffba16a8438baa0ffae83ac9a304004b87fd --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/devicetopology.rs @@ -0,0 +1,462 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! The DeviceTopology API gives clients control over a variety of internal functions of audio +//! adapters that they cannot access through the MMDevice API, WASAPI, or the EndpointVolume API. +use ctypes::{c_float, c_void}; +use shared::guiddef::{GUID, LPCGUID, REFGUID, REFIID}; +use shared::minwindef::{BOOL, DWORD, UCHAR, UINT, ULONG, WORD}; +use shared::windef::COLORREF; +use shared::wtypes::VARTYPE; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LONG, LONGLONG, LPWSTR, WCHAR}; +DEFINE_GUID!{EVENTCONTEXT_VOLUMESLIDER, + 0xe2c2e9de, 0x09b1, 0x4b04, 0x84, 0xe5, 0x07, 0x93, 0x12, 0x25, 0xee, 0x04} +STRUCT!{struct KSDATAFORMAT { + FormatSize: ULONG, + Flags: ULONG, + SampleSize: ULONG, + Reserved: ULONG, + MajorFormat: GUID, + SubFormat: GUID, + Specifier: GUID, +}} +pub type PKSDATAFORMAT = *mut KSDATAFORMAT; +STRUCT!{struct KSIDENTIFIER_s { + Set: GUID, + Id: ULONG, + Flags: ULONG, +}} +UNION!{union KSIDENTIFIER { + [u64; 3], + s s_mut: KSIDENTIFIER_s, + Alignment Alignment_mut: LONGLONG, +}} +pub type KSPROPERTY = KSIDENTIFIER; +pub type PKSPROPERTY = *mut KSIDENTIFIER; +pub type KSMETHOD = KSIDENTIFIER; +pub type PKSMETHOD = *mut KSIDENTIFIER; +pub type KSEVENT = KSIDENTIFIER; +pub type PKSEVENT = *mut KSIDENTIFIER; +ENUM!{enum EPcxConnectionType { + eConnTypeUnknown = 0, + eConnType3Point5mm = 1, + eConnTypeQuarter = 2, + eConnTypeAtapiInternal = 3, + eConnTypeRCA = 4, + eConnTypeOptical = 5, + eConnTypeOtherDigital = 6, + eConnTypeOtherAnalog = 7, + eConnTypeMultichannelAnalogDIN = 8, + eConnTypeXlrProfessional = 9, + eConnTypeRJ11Modem = 10, + eConnTypeCombination = 11, +}} +ENUM!{enum EPcxGeoLocation { + eGeoLocRear = 1, + eGeoLocFront = 2, + eGeoLocLeft = 3, + eGeoLocRight = 4, + eGeoLocTop = 5, + eGeoLocBottom = 6, + eGeoLocRearPanel = 7, + eGeoLocRiser = 8, + eGeoLocInsideMobileLid = 9, + eGeoLocDrivebay = 10, + eGeoLocHDMI = 11, + eGeoLocOutsideMobileLid = 12, + eGeoLocATAPI = 13, + eGeoLocNotApplicable = 14, + eGeoLocReserved6 = 15, +}} +ENUM!{enum EPcxGenLocation { + eGenLocPrimaryBox = 0, + eGenLocInternal = 1, + eGenLocSeparate = 2, + eGenLocOther = 3, +}} +ENUM!{enum EPxcPortConnection { + ePortConnJack = 0, + ePortConnIntegratedDevice = 1, + ePortConnBothIntegratedAndJack = 2, + ePortConnUnknown = 3, +}} +STRUCT!{struct KSJACK_DESCRIPTION { + ChannelMapping: DWORD, + Color: COLORREF, + ConnectionType: EPcxConnectionType, + GeoLocation: EPcxGeoLocation, + GenLocation: EPcxGenLocation, + PortConnection: EPxcPortConnection, + IsConnected: BOOL, +}} +pub type PKSJACK_DESCRIPTION = *mut KSJACK_DESCRIPTION; +STRUCT!{struct LUID { + LowPart: DWORD, + HighPart: LONG, +}} +pub type PLUID = *mut LUID; +ENUM!{enum KSJACK_SINK_CONNECTIONTYPE { + KSJACK_SINK_CONNECTIONTYPE_HDMI = 0, + KSJACK_SINK_CONNECTIONTYPE_DISPLAYPORT = 1, +}} +STRUCT!{struct KSJACK_SINK_INFORMATION { + ConnType: KSJACK_SINK_CONNECTIONTYPE, + ManufacturerId: WORD, + ProductId: WORD, + AudioLatency: WORD, + HDCPCapable: BOOL, + AICapable: BOOL, + SinkDescriptionLength: UCHAR, + SinkDescription: [WCHAR; 32], + PortId: LUID, +}} +STRUCT!{struct KSJACK_DESCRIPTION2 { + DeviceStateInfo: DWORD, + JackCapabilities: DWORD, +}} +pub type PKSJACK_DESCRIPTION2 = *mut KSJACK_DESCRIPTION2; +ENUM!{enum DataFlow { + In = 0, + Out = 1, +}} +ENUM!{enum PartType { + Connector = 0, + Subunit = 1, +}} +ENUM!{enum ConnectorType { + Unknown_Connector = 0, + Physical_Internal = 1, + Physical_External = 2, + Software_IO = 3, + Software_Fixed = 4, + Network = 5, +}} +RIDL!{#[uuid(0x28f54685, 0x06fd, 0x11d2, 0xb2, 0x7a, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96)] +interface IKsControl(IKsControlVtbl): IUnknown(IUnknownVtbl) { + fn KsProperty( + Property: PKSPROPERTY, + PropertyLength: ULONG, + PropertyData: *mut c_void, + DataLength: ULONG, + BytesReturned: *mut ULONG, + ) -> HRESULT, + fn KsMethod( + Method: PKSMETHOD, + MethodLength: ULONG, + MethodData: *mut c_void, + DataLength: ULONG, + BytesReturned: *mut ULONG, + ) -> HRESULT, + fn KsEvent( + Event: PKSEVENT, + EventLength: ULONG, + EventData: *mut c_void, + DataLength: ULONG, + BytesReturned: *mut ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc2f8e001, 0xf205, 0x4bc9, 0x99, 0xbc, 0xc1, 0x3b, 0x1e, 0x04, 0x8c, 0xcb)] +interface IPerChannelDbLevel(IPerChannelDbLevelVtbl): IUnknown(IUnknownVtbl) { + fn GetChannelCount( + pcChannels: *mut UINT, + ) -> HRESULT, + fn GetLevelRange( + nChannel: UINT, + pfMinLevelDB: *mut c_float, + pfMaxLevelDB: *mut c_float, + pfStepping: *mut c_float, + ) -> HRESULT, + fn GetLevel( + nChannel: UINT, + pfLevelDB: *mut c_float, + ) -> HRESULT, + fn SetLevel( + nChannel: UINT, + fLevelDB: c_float, + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn SetLevelUniform( + fLevelDB: c_float, + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn SetLevelAllChannels( + aLevelsDB: *mut c_float, + cChannels: ULONG, + pguidEventContext: LPCGUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7fb7b48f, 0x531d, 0x44a2, 0xbc, 0xb3, 0x5a, 0xd5, 0xa1, 0x34, 0xb3, 0xdc)] +interface IAudioVolumeLevel(IAudioVolumeLevelVtbl): IPerChannelDbLevel(IPerChannelDbLevelVtbl) {}} +RIDL!{#[uuid(0xbb11c46f, 0xec28, 0x493c, 0xb8, 0x8a, 0x5d, 0xb8, 0x80, 0x62, 0xce, 0x98)] +interface IAudioChannelConfig(IAudioChannelConfigVtbl): IUnknown(IUnknownVtbl) { + fn SetChannelConfig( + dwConfig: DWORD, + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn GetChannelConfig( + pdwConfig: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7d8b1437, 0xdd53, 0x4350, 0x9c, 0x1b, 0x1e, 0xe2, 0x89, 0x0b, 0xd9, 0x38)] +interface IAudioLoudness(IAudioLoudnessVtbl): IUnknown(IUnknownVtbl) { + fn GetEnabled( + pbEnabled: *mut BOOL, + ) -> HRESULT, + fn SetEnabled( + bEnable: BOOL, + pguidEventContext: LPCGUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4f03dc02, 0x5e6e, 0x4653, 0x8f, 0x72, 0xa0, 0x30, 0xc1, 0x23, 0xd5, 0x98)] +interface IAudioInputSelector(IAudioInputSelectorVtbl): IUnknown(IUnknownVtbl) { + fn GetSelection( + pnIdSelected: *mut UINT, + ) -> HRESULT, + fn SetSelection( + nIdSelect: UINT, + pguidEventContext: LPCGUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xbb515f69, 0x94a7, 0x429e, 0x8b, 0x9c, 0x27, 0x1b, 0x3f, 0x11, 0xa3, 0xab)] +interface IAudioOutputSelector(IAudioOutputSelectorVtbl): IUnknown(IUnknownVtbl) { + fn GetSelection( + pnIdSelected: *mut UINT, + ) -> HRESULT, + fn SetSelection( + nIdSelect: UINT, + pguidEventContext: LPCGUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdf45aeea, 0xb74a, 0x4b6b, 0xaf, 0xad, 0x23, 0x66, 0xb6, 0xaa, 0x01, 0x2e)] +interface IAudioMute(IAudioMuteVtbl): IUnknown(IUnknownVtbl) { + fn SetMute( + bMuted: BOOL, + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn GetMute( + pbMuted: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa2b1a1d9, 0x4db3, 0x425d, 0xa2, 0xb2, 0xbd, 0x33, 0x5c, 0xb3, 0xe2, 0xe5)] +interface IAudioBass(IAudioBassVtbl): IPerChannelDbLevel(IPerChannelDbLevelVtbl) {}} +RIDL!{#[uuid(0x5e54b6d7, 0xb44b, 0x40d9, 0x9a, 0x9e, 0xe6, 0x91, 0xd9, 0xce, 0x6e, 0xdf)] +interface IAudioMidrange(IAudioMidrangeVtbl): IPerChannelDbLevel(IPerChannelDbLevelVtbl) {}} +RIDL!{#[uuid(0x0a717812, 0x694e, 0x4907, 0xb7, 0x4b, 0xba, 0xfa, 0x5c, 0xfd, 0xca, 0x7b)] +interface IAudioTreble(IAudioTrebleVtbl): IPerChannelDbLevel(IPerChannelDbLevelVtbl) {}} +RIDL!{#[uuid(0x85401fd4, 0x6de4, 0x4b9d, 0x98, 0x69, 0x2d, 0x67, 0x53, 0xa8, 0x2f, 0x3c)] +interface IAudioAutoGainControl(IAudioAutoGainControlVtbl): IUnknown(IUnknownVtbl) { + fn GetEnabled( + pbEnabled: *mut BOOL, + ) -> HRESULT, + fn SetEnabled( + bEnable: BOOL, + pguidEventContext: LPCGUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdd79923c, 0x0599, 0x45e0, 0xb8, 0xb6, 0xc8, 0xdf, 0x7d, 0xb6, 0xe7, 0x96)] +interface IAudioPeakMeter(IAudioPeakMeterVtbl): IUnknown(IUnknownVtbl) { + fn GetChannelCount( + pcChannels: *mut UINT, + ) -> HRESULT, + fn GetLevel( + nChannel: UINT, + pfLevel: *mut c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3b22bcbf, 0x2586, 0x4af0, 0x85, 0x83, 0x20, 0x5d, 0x39, 0x1b, 0x80, 0x7c)] +interface IDeviceSpecificProperty(IDeviceSpecificPropertyVtbl): IUnknown(IUnknownVtbl) { + fn GetType( + pVType: *mut VARTYPE, + ) -> HRESULT, + fn GetValue( + pvValue: *mut c_void, + pcbValue: *mut DWORD, + ) -> HRESULT, + fn SetValue( + pvValue: *mut c_void, + cbValue: DWORD, + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn Get4BRange( + plMin: *mut LONG, + plMax: *mut LONG, + plStepping: *mut LONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3cb4a69d, 0xbb6f, 0x4d2b, 0x95, 0xb7, 0x45, 0x2d, 0x2c, 0x15, 0x5d, 0xb5)] +interface IKsFormatSupport(IKsFormatSupportVtbl): IUnknown(IUnknownVtbl) { + fn IsFormatSupported( + pKsFormat: PKSDATAFORMAT, + cbFormat: DWORD, + pbSupported: *mut BOOL, + ) -> HRESULT, + fn GetDevicePreferredFormat( + ppKsFormat: *mut PKSDATAFORMAT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4509f757, 0x2d46, 0x4637, 0x8e, 0x62, 0xce, 0x7d, 0xb9, 0x44, 0xf5, 0x7b)] +interface IKsJackDescription(IKsJackDescriptionVtbl): IUnknown(IUnknownVtbl) { + fn GetJackCount( + pcJacks: *mut UINT, + ) -> HRESULT, + fn GetJackDescription( + nJack: UINT, + pDescription: *mut KSJACK_DESCRIPTION, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x478f3a9b, 0xe0c9, 0x4827, 0x92, 0x28, 0x6f, 0x55, 0x05, 0xff, 0xe7, 0x6a)] +interface IKsJackDescription2(IKsJackDescription2Vtbl): IUnknown(IUnknownVtbl) { + fn GetJackCount( + pcJacks: *mut UINT, + ) -> HRESULT, + fn GetJackDescription2( + nJack: UINT, + pDescription2: *mut KSJACK_DESCRIPTION2, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd9bd72ed, 0x290f, 0x4581, 0x9f, 0xf3, 0x61, 0x02, 0x7a, 0x8f, 0xe5, 0x32)] +interface IKsJackSinkInformation(IKsJackSinkInformationVtbl): IUnknown(IUnknownVtbl) { + fn GetJackSinkInformation( + pJackSinkInformation: *mut KSJACK_SINK_INFORMATION, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc99af463, 0xd629, 0x4ec4, 0x8c, 0x00, 0xe5, 0x4d, 0x68, 0x15, 0x42, 0x48)] +interface IKsJackContainerId(IKsJackContainerIdVtbl): IUnknown(IUnknownVtbl) { + fn GetJackContainerId( + pJackContainerId: *mut GUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6daa848c, 0x5eb0, 0x45cc, 0xae, 0xa5, 0x99, 0x8a, 0x2c, 0xda, 0x1f, 0xfb)] +interface IPartsList(IPartsListVtbl): IUnknown(IUnknownVtbl) { + fn GetCount( + pCount: *mut UINT, + ) -> HRESULT, + fn GetPart( + nIndex: UINT, + ppPart: *mut *mut IPart, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xae2de0e4, 0x5bca, 0x4f2d, 0xaa, 0x46, 0x5d, 0x13, 0xf8, 0xfd, 0xb3, 0xa9)] +interface IPart(IPartVtbl): IUnknown(IUnknownVtbl) { + fn GetName( + ppwstrName: *mut LPWSTR, + ) -> HRESULT, + fn GetLocalId( + pnId: *mut UINT, + ) -> HRESULT, + fn GetGlobalId( + ppwstrGlobalId: *mut LPWSTR, + ) -> HRESULT, + fn GetPartType( + pPartType: *mut PartType, + ) -> HRESULT, + fn GetSubType( + pSubType: *mut GUID, + ) -> HRESULT, + fn GetControlInterfaceCount( + pCount: *mut UINT, + ) -> HRESULT, + fn GetControlInterface( + nIndex: UINT, + ppInterfaceDesc: *mut *mut IControlInterface, + ) -> HRESULT, + fn EnumPartsIncoming( + ppParts: *mut *mut IPartsList, + ) -> HRESULT, + fn EnumPartsOutgoing( + ppParts: *mut *mut IPartsList, + ) -> HRESULT, + fn GetTopologyObject( + ppTopology: *mut *mut IDeviceTopology, + ) -> HRESULT, + fn Activate( + dwClsContext: DWORD, + refiid: REFIID, + ppvObject: *mut *mut c_void, + ) -> HRESULT, + fn RegisterControlChangeCallback( + riid: REFGUID, + pNotify: *mut IControlChangeNotify, + ) -> HRESULT, + fn UnregisterControlChangeCallback( + pNotify: *mut IControlChangeNotify, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9c2c4058, 0x23f5, 0x41de, 0x87, 0x7a, 0xdf, 0x3a, 0xf2, 0x36, 0xa0, 0x9e)] +interface IConnector(IConnectorVtbl): IUnknown(IUnknownVtbl) { + fn GetType( + pType: *mut ConnectorType, + ) -> HRESULT, + fn GetDataFlow( + pFlow: *mut DataFlow, + ) -> HRESULT, + fn ConnectTo( + pConnectTo: *mut IConnector, + ) -> HRESULT, + fn Disconnect() -> HRESULT, + fn IsConnected( + pbConnected: *mut BOOL, + ) -> HRESULT, + fn GetConnectedTo( + ppConTo: *mut *mut IConnector, + ) -> HRESULT, + fn GetConnectorIdConnectedTo( + ppwstrConnectorId: *mut LPWSTR, + ) -> HRESULT, + fn GetDeviceIdConnectedTo( + ppwstrDeviceId: *mut LPWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x82149a85, 0xdba6, 0x4487, 0x86, 0xbb, 0xea, 0x8f, 0x7f, 0xef, 0xcc, 0x71)] +interface ISubunit(ISubunitVtbl): IUnknown(IUnknownVtbl) {}} +RIDL!{#[uuid(0x45d37c3f, 0x5140, 0x444a, 0xae, 0x24, 0x40, 0x07, 0x89, 0xf3, 0xcb, 0xf3)] +interface IControlInterface(IControlInterfaceVtbl): IUnknown(IUnknownVtbl) { + fn GetName( + ppwstrName: *mut LPWSTR, + ) -> HRESULT, + fn GetIID( + pIID: *mut GUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa09513ed, 0xc709, 0x4d21, 0xbd, 0x7b, 0x5f, 0x34, 0xc4, 0x7f, 0x39, 0x47)] +interface IControlChangeNotify(IControlChangeNotifyVtbl): IUnknown(IUnknownVtbl) { + fn OnNotify( + dwSenderProcessId: DWORD, + pguidEventContext: LPCGUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2a07407e, 0x6497, 0x4a18, 0x97, 0x87, 0x32, 0xf7, 0x9b, 0xd0, 0xd9, 0x8f)] +interface IDeviceTopology(IDeviceTopologyVtbl): IUnknown(IUnknownVtbl) { + fn GetConnectorCount( + pCount: *mut UINT, + ) -> HRESULT, + fn GetConnector( + nIndex: UINT, + ppConnector: *mut *mut IConnector, + ) -> HRESULT, + fn GetSubunitCount( + pCount: *mut UINT, + ) -> HRESULT, + fn GetSubunit( + nIndex: UINT, + ppSubunit: *mut *mut ISubunit, + ) -> HRESULT, + fn GetPartById( + nId: UINT, + ppPart: *mut *mut IPart, + ) -> HRESULT, + fn GetDeviceId( + ppwstrDeviceId: *mut LPWSTR, + ) -> HRESULT, + fn GetSignalPath( + pIPartFrom: *mut IPart, + pIPartTo: *mut IPart, + bRejectMixedPaths: BOOL, + ppParts: *mut *mut IPartsList, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1df639d0, 0x5ec1, 0x47aa, 0x93, 0x79, 0x82, 0x8d, 0xc1, 0xaa, 0x8c, 0x59)] +class DeviceTopology;} diff --git a/bash-5.1/vendor/winapi/src/um/dinput.rs b/bash-5.1/vendor/winapi/src/um/dinput.rs new file mode 100644 index 0000000000000000000000000000000000000000..5b5b1c5e5daf632e5a13190f9ec68dd294ff30f7 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dinput.rs @@ -0,0 +1,107 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{CLSID_DirectInput, + 0x25e609e0, 0xb259, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{CLSID_DirectInputDevice, + 0x25e609e1, 0xb259, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{CLSID_DirectInput8, + 0x25e609e4, 0xb259, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{CLSID_DirectInputDevice8, + 0x25e609e5, 0xb259, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{IID_IDirectInputA, + 0x89521360, 0xaa8a, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{IID_IDirectInputW, + 0x89521361, 0xaa8a, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{IID_IDirectInput2A, + 0x5944e662, 0xaa8a, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{IID_IDirectInput2W, + 0x5944e663, 0xaa8a, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{IID_IDirectInput7A, + 0x9a4cb684, 0x236d, 0x11d3, 0x8e, 0x9d, 0x00, 0xc0, 0x4f, 0x68, 0x44, 0xae} +DEFINE_GUID!{IID_IDirectInput7W, + 0x9a4cb685, 0x236d, 0x11d3, 0x8e, 0x9d, 0x00, 0xc0, 0x4f, 0x68, 0x44, 0xae} +DEFINE_GUID!{IID_IDirectInput8A, + 0xbf798030, 0x483a, 0x4da2, 0xaa, 0x99, 0x5d, 0x64, 0xed, 0x36, 0x97, 0x00} +DEFINE_GUID!{IID_IDirectInput8W, + 0xbf798031, 0x483a, 0x4da2, 0xaa, 0x99, 0x5d, 0x64, 0xed, 0x36, 0x97, 0x00} +DEFINE_GUID!{IID_IDirectInputDeviceA, + 0x5944e680, 0xc92e, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{IID_IDirectInputDeviceW, + 0x5944e681, 0xc92e, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{IID_IDirectInputDevice2A, + 0x5944e682, 0xc92e, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{IID_IDirectInputDevice2W, + 0x5944e683, 0xc92e, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{IID_IDirectInputDevice7A, + 0x57d7c6bc, 0x2356, 0x11d3, 0x8e, 0x9d, 0x00, 0xc0, 0x4f, 0x68, 0x44, 0xae} +DEFINE_GUID!{IID_IDirectInputDevice7W, + 0x57d7c6bd, 0x2356, 0x11d3, 0x8e, 0x9d, 0x00, 0xc0, 0x4f, 0x68, 0x44, 0xae} +DEFINE_GUID!{IID_IDirectInputDevice8A, + 0x54d41080, 0xdc15, 0x4833, 0xa4, 0x1b, 0x74, 0x8f, 0x73, 0xa3, 0x81, 0x79} +DEFINE_GUID!{IID_IDirectInputDevice8W, + 0x54d41081, 0xdc15, 0x4833, 0xa4, 0x1b, 0x74, 0x8f, 0x73, 0xa3, 0x81, 0x79} +DEFINE_GUID!{IID_IDirectInputEffect, + 0xe7e1f7c0, 0x88d2, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_XAxis, + 0xa36d02e0, 0xc9f3, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_YAxis, + 0xa36d02e1, 0xc9f3, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_ZAxis, + 0xa36d02e2, 0xc9f3, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_RxAxis, + 0xa36d02f4, 0xc9f3, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_RyAxis, + 0xa36d02f5, 0xc9f3, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_RzAxis, + 0xa36d02e3, 0xc9f3, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_Slider, + 0xa36d02e4, 0xc9f3, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_Button, + 0xa36d02f0, 0xc9f3, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_Key, + 0x55728220, 0xd33c, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_POV, + 0xa36d02f2, 0xc9f3, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_Unknown, + 0xa36d02f3, 0xc9f3, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_SysMouse, + 0x6f1d2b60, 0xd5a0, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_SysKeyboard, + 0x6f1d2b61, 0xd5a0, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_Joystick, + 0x6f1d2b70, 0xd5a0, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_SysMouseEm, + 0x6f1d2b80, 0xd5a0, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_SysMouseEm2, + 0x6f1d2b81, 0xd5a0, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_SysKeyboardEm, + 0x6f1d2b82, 0xd5a0, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_SysKeyboardEm2, + 0x6f1d2b83, 0xd5a0, 0x11cf, 0xbf, 0xc7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{GUID_ConstantForce, + 0x13541c20, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_RampForce, + 0x13541c21, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_Square, + 0x13541c22, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_Sine, + 0x13541c23, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_Triangle, + 0x13541c24, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_SawtoothUp, + 0x13541c25, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_SawtoothDown, + 0x13541c26, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_Spring, + 0x13541c27, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_Damper, + 0x13541c28, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_Inertia, + 0x13541c29, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_Friction, + 0x13541c2a, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} +DEFINE_GUID!{GUID_CustomForce, + 0x13541c2b, 0x8e33, 0x11d0, 0x9a, 0xd0, 0x00, 0xa0, 0xc9, 0xa0, 0x6e, 0x35} diff --git a/bash-5.1/vendor/winapi/src/um/dispex.rs b/bash-5.1/vendor/winapi/src/um/dispex.rs new file mode 100644 index 0000000000000000000000000000000000000000..a846b461ffb1dd1169cafdc1506ed49ffedf3cee --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dispex.rs @@ -0,0 +1,221 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::DWORD_PTR; +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, WORD}; +use shared::winerror::HRESULT; +use shared::wtypes::{BSTR, VARIANT_BOOL, VARTYPE}; +use um::oaidl::{DISPID, DISPID_UNKNOWN, DISPPARAMS, EXCEPINFO, IDispatch, IDispatchVtbl, VARIANT}; +use um::servprov::IServiceProvider; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::LCID; +DEFINE_GUID!{IID_IDispatchEx, + 0xa6ef9860, 0xc720, 0x11d0, 0x93, 0x37, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9} +DEFINE_GUID!{IID_IDispError, + 0xa6ef9861, 0xc720, 0x11d0, 0x93, 0x37, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9} +DEFINE_GUID!{IID_IVariantChangeType, + 0xa6ef9862, 0xc720, 0x11d0, 0x93, 0x37, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9} +DEFINE_GUID!{SID_VariantConversion, + 0x1f101481, 0xbccd, 0x11d0, 0x93, 0x36, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9} +DEFINE_GUID!{SID_GetCaller, + 0x4717cc40, 0xbcb9, 0x11d0, 0x93, 0x36, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9} +DEFINE_GUID!{SID_ProvideRuntimeContext, + 0x74a5040c, 0xdd0c, 0x48f0, 0xac, 0x85, 0x19, 0x4c, 0x32, 0x59, 0x18, 0xa} +DEFINE_GUID!{IID_IProvideRuntimeContext, + 0x10e2414a, 0xec59, 0x49d2, 0xbc, 0x51, 0x5a, 0xdd, 0x2c, 0x36, 0xfe, 0xbc} +DEFINE_GUID!{IID_IObjectIdentity, + 0xca04b7e6, 0xd21, 0x11d1, 0x8c, 0xc5, 0x0, 0xc0, 0x4f, 0xc2, 0xb0, 0x85} +DEFINE_GUID!{IID_ICanHandleException, + 0xc5598e60, 0xb307, 0x11d1, 0xb2, 0x7d, 0x0, 0x60, 0x08, 0xc3, 0xfb, 0xfb} +// pub const SID_GetScriptSite = IID_IActiveScriptSite; +pub const fdexNameCaseSensitive: DWORD = 0x00000001; +pub const fdexNameEnsure: DWORD = 0x00000002; +pub const fdexNameImplicit: DWORD = 0x00000004; +pub const fdexNameCaseInsensitive: DWORD = 0x00000008; +pub const fdexNameInternal: DWORD = 0x00000010; +pub const fdexNameNoDynamicProperties: DWORD = 0x00000020; +pub const fdexPropCanGet: DWORD = 0x00000001; +pub const fdexPropCannotGet: DWORD = 0x00000002; +pub const fdexPropCanPut: DWORD = 0x00000004; +pub const fdexPropCannotPut: DWORD = 0x00000008; +pub const fdexPropCanPutRef: DWORD = 0x00000010; +pub const fdexPropCannotPutRef: DWORD = 0x00000020; +pub const fdexPropNoSideEffects: DWORD = 0x00000040; +pub const fdexPropDynamicType: DWORD = 0x00000080; +pub const fdexPropCanCall: DWORD = 0x00000100; +pub const fdexPropCannotCall: DWORD = 0x00000200; +pub const fdexPropCanConstruct: DWORD = 0x00000400; +pub const fdexPropCannotConstruct: DWORD = 0x00000800; +pub const fdexPropCanSourceEvents: DWORD = 0x00001000; +pub const fdexPropCannotSourceEvents: DWORD = 0x00002000; +pub const grfdexPropCanAll: DWORD = fdexPropCanGet | fdexPropCanPut | fdexPropCanPutRef + | fdexPropCanCall | fdexPropCanConstruct | fdexPropCanSourceEvents; +pub const grfdexPropCannotAll: DWORD = fdexPropCannotGet | fdexPropCannotPut | fdexPropCannotPutRef + | fdexPropCannotCall | fdexPropCannotConstruct | fdexPropCannotSourceEvents; +pub const grfdexPropExtraAll: DWORD = fdexPropNoSideEffects | fdexPropDynamicType; +pub const grfdexPropAll: DWORD = grfdexPropCanAll | grfdexPropCannotAll | grfdexPropExtraAll; +pub const fdexEnumDefault: DWORD = 0x00000001; +pub const fdexEnumAll: DWORD = 0x00000002; +pub const DISPATCH_CONSTRUCT: DWORD = 0x4000; +pub const DISPID_THIS: DISPID = -613; +pub const DISPID_STARTENUM: DISPID = DISPID_UNKNOWN; +// extern RPC_IF_HANDLE __MIDL_itf_dispex_0000_0000_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_dispex_0000_0000_v0_0_s_ifspec; +// EXTERN_C const IID IID_IDispatchEx; +RIDL!{#[uuid(0xa6ef9860, 0xc720, 0x11d0, 0x93, 0x37, 0x00, 0xa0, 0xc9, 0x0d, 0xca, 0xa9)] +interface IDispatchEx(IDispatchExVtbl): IDispatch(IDispatchVtbl) { + fn GetDispID( + bstrName: BSTR, + grfdex: DWORD, + pid: *mut DISPID, + ) -> HRESULT, + fn InvokeEx( + id: DISPID, + lcid: LCID, + wFlags: WORD, + pdp: *mut DISPPARAMS, + pvarRes: *mut VARIANT, + pei: *mut EXCEPINFO, + pspCaller: *mut IServiceProvider, + ) -> HRESULT, + fn DeleteMemberByName( + bstrName: BSTR, + grfdex: DWORD, + ) -> HRESULT, + fn DeleteMemberByDispID( + id: DISPID, + ) -> HRESULT, + fn GetMemberProperties( + id: DISPID, + grfdexFetch: DWORD, + pgrfdex: *mut DWORD, + ) -> HRESULT, + fn GetMemberName( + id: DISPID, + pbstrName: *mut BSTR, + ) -> HRESULT, + fn GetNextDispID( + grfdex: DWORD, + id: DISPID, + pid: *mut DISPID, + ) -> HRESULT, + fn GetNameSpaceParent( + ppunk: *mut *mut IUnknown, + ) -> HRESULT, +}} +// HRESULT STDMETHODCALLTYPE IDispatchEx_RemoteInvokeEx_Proxy( +// IDispatchEx * This, +// DISPID id, +// LCID lcid, +// DWORD dwFlags, +// DISPPARAMS *pdp, +// VARIANT *pvarRes, +// EXCEPINFO *pei, +// IServiceProvider *pspCaller, +// UINT cvarRefArg, +// UINT *rgiRefArg, +// VARIANT *rgvarRefArg); +// void __RPC_STUB IDispatchEx_RemoteInvokeEx_Stub( +// IRpcStubBuffer *This, +// IRpcChannelBuffer *_pRpcChannelBuffer, +// PRPC_MESSAGE _pRpcMessage, +// DWORD *_pdwStubPhase); +// EXTERN_C const IID IID_IDispError; +RIDL!{#[uuid(0xa6ef9861, 0xc720, 0x11d0, 0x93, 0x37, 0x00, 0xa0, 0xc9, 0x0d, 0xca, 0xa9)] +interface IDispError(IDispErrorVtbl): IUnknown(IUnknownVtbl) { + fn QueryErrorInfo( + guidErrorType: GUID, + ppde: *mut *mut IDispError, + ) -> HRESULT, + fn GetNext( + ppde: *mut *mut IDispError, + ) -> HRESULT, + fn GetHresult( + phr: *mut HRESULT, + ) -> HRESULT, + fn GetSource( + pbstrSource: *mut BSTR, + ) -> HRESULT, + fn GetHelpInfo( + pbstrFileName: *mut BSTR, + pdwContext: *mut DWORD, + ) -> HRESULT, + fn GetDescription( + pbstrDescription: *mut BSTR, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IVariantChangeType; +RIDL!{#[uuid(0xa6ef9862, 0xc720, 0x11d0, 0x93, 0x37, 0x00, 0xa0, 0xc9, 0x0d, 0xca, 0xa9)] +interface IVariantChangeType(IVariantChangeTypeVtbl): IUnknown(IUnknownVtbl) { + fn ChangeType( + pvarDst: *mut VARIANT, + pvarSrc: *mut VARIANT, + lcid: LCID, + vtNew: VARTYPE, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IObjectIdentity; +RIDL!{#[uuid(0xca04b7e6, 0x0d21, 0x11d1, 0x8c, 0xc5, 0x00, 0xc0, 0x4f, 0xc2, 0xb0, 0x85)] +interface IObjectIdentity(IObjectIdentityVtbl): IUnknown(IUnknownVtbl) { + fn IsEqualObject( + punk: *mut IUnknown, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ICanHandleException; +RIDL!{#[uuid(0xc5598e60, 0xb307, 0x11d1, 0xb2, 0x7d, 0x00, 0x60, 0x08, 0xc3, 0xfb, 0xfb)] +interface ICanHandleException(ICanHandleExceptionVtbl): IUnknown(IUnknownVtbl) { + fn CanHandleException( + pExcepInfo: *mut EXCEPINFO, + pvar: *mut VARIANT, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IProvideRuntimeContext; +RIDL!{#[uuid(0x10e2414a, 0xec59, 0x49d2, 0xbc, 0x51, 0x5a, 0xdd, 0x2c, 0x36, 0xfe, 0xbc)] +interface IProvideRuntimeContext(IProvideRuntimeContextVtbl): IUnknown(IUnknownVtbl) { + fn GetCurrentSourceContext( + pdwContext: *mut DWORD_PTR, + pfExecutingGlobalCode: *mut VARIANT_BOOL, + ) -> HRESULT, +}} +// extern RPC_IF_HANDLE __MIDL_itf_dispex_0000_0006_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_dispex_0000_0006_v0_0_s_ifspec; +// unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +// void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); +// unsigned long __RPC_USER VARIANT_UserSize( __RPC__in unsigned long *, unsigned long, __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); +// void __RPC_USER VARIANT_UserFree( __RPC__in unsigned long *, __RPC__in VARIANT * ); +// unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +// void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); +// unsigned long __RPC_USER VARIANT_UserSize64( __RPC__in unsigned long *, unsigned long, __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); +// void __RPC_USER VARIANT_UserFree64( __RPC__in unsigned long *, __RPC__in VARIANT * ); +// HRESULT STDMETHODCALLTYPE IDispatchEx_InvokeEx_Proxy( +// IDispatchEx * This, +// DISPID id, +// LCID lcid, +// WORD wFlags, +// DISPPARAMS *pdp, +// VARIANT *pvarRes, +// EXCEPINFO *pei, +// IServiceProvider *pspCaller); +// HRESULT STDMETHODCALLTYPE IDispatchEx_InvokeEx_Stub( +// IDispatchEx * This, +// DISPID id, +// LCID lcid, +// DWORD dwFlags, +// DISPPARAMS *pdp, +// VARIANT *pvarRes, +// EXCEPINFO *pei, +// IServiceProvider *pspCaller, +// UINT cvarRefArg, +// UINT *rgiRefArg, +// VARIANT *rgvarRefArg); diff --git a/bash-5.1/vendor/winapi/src/um/dmksctl.rs b/bash-5.1/vendor/winapi/src/um/dmksctl.rs new file mode 100644 index 0000000000000000000000000000000000000000..252ab7387ec765f60580336c0b5d233536b2bcd0 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dmksctl.rs @@ -0,0 +1,11 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_IKsControl, + 0x28f54685, 0x06fd, 0x11d2, 0xb2, 0x7a, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96} +DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_MIDI, + 0x1d262760, 0xe957, 0x11cf, 0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00} +DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_DIRECTMUSIC, + 0x1a82f8bc, 0x3f8b, 0x11d2, 0xb7, 0x74, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1} diff --git a/bash-5.1/vendor/winapi/src/um/dmusicc.rs b/bash-5.1/vendor/winapi/src/um/dmusicc.rs new file mode 100644 index 0000000000000000000000000000000000000000..ee87b6fde95296bcf17e36778210ae123c423543 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dmusicc.rs @@ -0,0 +1,71 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{CLSID_DirectMusic, + 0x636b9f10, 0x0c7d, 0x11d1, 0x95, 0xb2, 0x00, 0x20, 0xaf, 0xdc, 0x74, 0x21} +DEFINE_GUID!{CLSID_DirectMusicCollection, + 0x480ff4b0, 0x28b2, 0x11d1, 0xbe, 0xf7, 0x00, 0xc0, 0x4f, 0xbf, 0x8f, 0xef} +DEFINE_GUID!{CLSID_DirectMusicSynth, + 0x58c2b4d0, 0x46e7, 0x11d1, 0x89, 0xac, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} +DEFINE_GUID!{IID_IDirectMusic, + 0x6536115a, 0x7b2d, 0x11d2, 0xba, 0x18, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} +DEFINE_GUID!{IID_IDirectMusicBuffer, + 0xd2ac2878, 0xb39b, 0x11d1, 0x87, 0x04, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd} +DEFINE_GUID!{IID_IDirectMusicPort, + 0x08f2d8c9, 0x37c2, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} +DEFINE_GUID!{IID_IDirectMusicThru, + 0xced153e7, 0x3606, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} +DEFINE_GUID!{IID_IDirectMusicPortDownload, + 0xd2ac287a, 0xb39b, 0x11d1, 0x87, 0x04, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd} +DEFINE_GUID!{IID_IDirectMusicDownload, + 0xd2ac287b, 0xb39b, 0x11d1, 0x87, 0x04, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd} +DEFINE_GUID!{IID_IDirectMusicCollection, + 0xd2ac287c, 0xb39b, 0x11d1, 0x87, 0x04, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd} +DEFINE_GUID!{IID_IDirectMusicInstrument, + 0xd2ac287d, 0xb39b, 0x11d1, 0x87, 0x04, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd} +DEFINE_GUID!{IID_IDirectMusicDownloadedInstrument, + 0xd2ac287e, 0xb39b, 0x11d1, 0x87, 0x04, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd} +DEFINE_GUID!{IID_IDirectMusic2, + 0x6fc2cae1, 0xbc78, 0x11d2, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6} +DEFINE_GUID!{IID_IDirectMusic8, + 0x2d3629f7, 0x813d, 0x4939, 0x85, 0x08, 0xf0, 0x5c, 0x6b, 0x75, 0xfd, 0x97} +DEFINE_GUID!{GUID_DMUS_PROP_GM_Hardware, + 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} +DEFINE_GUID!{GUID_DMUS_PROP_GS_Hardware, + 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} +DEFINE_GUID!{GUID_DMUS_PROP_XG_Hardware, + 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} +DEFINE_GUID!{GUID_DMUS_PROP_XG_Capable, + 0x6496aba1, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6} +DEFINE_GUID!{GUID_DMUS_PROP_GS_Capable, + 0x6496aba2, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6} +DEFINE_GUID!{GUID_DMUS_PROP_DLS1, + 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} +DEFINE_GUID!{GUID_DMUS_PROP_DLS2, + 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6} +DEFINE_GUID!{GUID_DMUS_PROP_INSTRUMENT2, + 0x865fd372, 0x9f67, 0x11d2, 0x87, 0x2a, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd} +DEFINE_GUID!{GUID_DMUS_PROP_SynthSink_DSOUND, + 0x0aa97844, 0xc877, 0x11d1, 0x87, 0x0c, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd} +DEFINE_GUID!{GUID_DMUS_PROP_SynthSink_WAVE, + 0x0aa97845, 0xc877, 0x11d1, 0x87, 0x0c, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd} +DEFINE_GUID!{GUID_DMUS_PROP_SampleMemorySize, + 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} +DEFINE_GUID!{GUID_DMUS_PROP_SamplePlaybackRate, + 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x00, 0x60, 0x08, 0x33, 0xdb, 0xd8} +DEFINE_GUID!{GUID_DMUS_PROP_WriteLatency, + 0x268a0fa0, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6} +DEFINE_GUID!{GUID_DMUS_PROP_WritePeriod, + 0x268a0fa1, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6} +DEFINE_GUID!{GUID_DMUS_PROP_MemorySize, + 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} +DEFINE_GUID!{GUID_DMUS_PROP_WavesReverb, + 0x04cb5622, 0x32e5, 0x11d2, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6} +DEFINE_GUID!{GUID_DMUS_PROP_Effects, + 0xcda8d611, 0x684a, 0x11d2, 0x87, 0x1e, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd} +DEFINE_GUID!{GUID_DMUS_PROP_LegacyCaps, + 0xcfa7cdc2, 0x00a1, 0x11d2, 0xaa, 0xd5, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} +DEFINE_GUID!{GUID_DMUS_PROP_Volume, + 0xfedfae25, 0xe46e, 0x11d1, 0xaa, 0xce, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12} diff --git a/bash-5.1/vendor/winapi/src/um/docobj.rs b/bash-5.1/vendor/winapi/src/um/docobj.rs new file mode 100644 index 0000000000000000000000000000000000000000..e14ddb9e3e630621aadc20ccf650d46fc0d25bf7 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/docobj.rs @@ -0,0 +1,136 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::wchar_t; +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, ULONG}; +use um::oaidl::VARIANT; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::HRESULT; +ENUM!{enum OLECMDF { + OLECMDF_SUPPORTED = 0x1, + OLECMDF_ENABLED = 0x2, + OLECMDF_LATCHED = 0x4, + OLECMDF_NINCHED = 0x8, + OLECMDF_INVISIBLE = 0x10, + OLECMDF_DEFHIDEONCTXTMENU = 0x20, +}} +STRUCT!{struct OLECMD { + cmdID: ULONG, + cmdf: DWORD, +}} +STRUCT!{struct OLECMDTEXT { + cmdtextf: DWORD, + cwActual: ULONG, + cwBuf: ULONG, + rgwz: [wchar_t; 1], +}} +ENUM!{enum OLECMDEXECOPT { + OLECMDEXECOPT_DODEFAULT = 0, + OLECMDEXECOPT_PROMPTUSER = 1, + OLECMDEXECOPT_DONTPROMPTUSER = 2, + OLECMDEXECOPT_SHOWHELP = 3, +}} +ENUM!{enum OLECMDID { + OLECMDID_OPEN = 1, + OLECMDID_NEW = 2, + OLECMDID_SAVE = 3, + OLECMDID_SAVEAS = 4, + OLECMDID_SAVECOPYAS = 5, + OLECMDID_PRINT = 6, + OLECMDID_PRINTPREVIEW = 7, + OLECMDID_PAGESETUP = 8, + OLECMDID_SPELL = 9, + OLECMDID_PROPERTIES = 10, + OLECMDID_CUT = 11, + OLECMDID_COPY = 12, + OLECMDID_PASTE = 13, + OLECMDID_PASTESPECIAL = 14, + OLECMDID_UNDO = 15, + OLECMDID_REDO = 16, + OLECMDID_SELECTALL = 17, + OLECMDID_CLEARSELECTION = 18, + OLECMDID_ZOOM = 19, + OLECMDID_GETZOOMRANGE = 20, + OLECMDID_UPDATECOMMANDS = 21, + OLECMDID_REFRESH = 22, + OLECMDID_STOP = 23, + OLECMDID_HIDETOOLBARS = 24, + OLECMDID_SETPROGRESSMAX = 25, + OLECMDID_SETPROGRESSPOS = 26, + OLECMDID_SETPROGRESSTEXT = 27, + OLECMDID_SETTITLE = 28, + OLECMDID_SETDOWNLOADSTATE = 29, + OLECMDID_STOPDOWNLOAD = 30, + OLECMDID_ONTOOLBARACTIVATED = 31, + OLECMDID_FIND = 32, + OLECMDID_DELETE = 33, + OLECMDID_HTTPEQUIV = 34, + OLECMDID_HTTPEQUIV_DONE = 35, + OLECMDID_ENABLE_INTERACTION = 36, + OLECMDID_ONUNLOAD = 37, + OLECMDID_PROPERTYBAG2 = 38, + OLECMDID_PREREFRESH = 39, + OLECMDID_SHOWSCRIPTERROR = 40, + OLECMDID_SHOWMESSAGE = 41, + OLECMDID_SHOWFIND = 42, + OLECMDID_SHOWPAGESETUP = 43, + OLECMDID_SHOWPRINT = 44, + OLECMDID_CLOSE = 45, + OLECMDID_ALLOWUILESSSAVEAS = 46, + OLECMDID_DONTDOWNLOADCSS = 47, + OLECMDID_UPDATEPAGESTATUS = 48, + OLECMDID_PRINT2 = 49, + OLECMDID_PRINTPREVIEW2 = 50, + OLECMDID_SETPRINTTEMPLATE = 51, + OLECMDID_GETPRINTTEMPLATE = 52, + OLECMDID_PAGEACTIONBLOCKED = 55, + OLECMDID_PAGEACTIONUIQUERY = 56, + OLECMDID_FOCUSVIEWCONTROLS = 57, + OLECMDID_FOCUSVIEWCONTROLSQUERY = 58, + OLECMDID_SHOWPAGEACTIONMENU = 59, + OLECMDID_ADDTRAVELENTRY = 60, + OLECMDID_UPDATETRAVELENTRY = 61, + OLECMDID_UPDATEBACKFORWARDSTATE = 62, + OLECMDID_OPTICAL_ZOOM = 63, + OLECMDID_OPTICAL_GETZOOMRANGE = 64, + OLECMDID_WINDOWSTATECHANGED = 65, + OLECMDID_ACTIVEXINSTALLSCOPE = 66, + OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67, + OLECMDID_SHOWTASKDLG = 68, + OLECMDID_POPSTATEEVENT = 69, + OLECMDID_VIEWPORT_MODE = 70, + OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71, + OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72, + OLECMDID_USER_OPTICAL_ZOOM = 73, + OLECMDID_PAGEAVAILABLE = 74, + OLECMDID_GETUSERSCALABLE = 75, + OLECMDID_UPDATE_CARET = 76, + OLECMDID_ENABLE_VISIBILITY = 77, + OLECMDID_MEDIA_PLAYBACK = 78, + OLECMDID_SETFAVICON = 79, + OLECMDID_SET_HOST_FULLSCREENMODE = 80, + OLECMDID_EXITFULLSCREEN = 81, + OLECMDID_SCROLLCOMPLETE = 82, + OLECMDID_ONBEFOREUNLOAD = 83, + OLECMDID_SHOWMESSAGE_BLOCKABLE = 84, + OLECMDID_SHOWTASKDLG_BLOCKABLE = 85, +}} +RIDL!{#[uuid(0xb722bccb, 0x4e68, 0x101b, 0xa2, 0xbc, 0x00, 0xaa, 0x00, 0x40, 0x47, 0x70)] +interface IOleCommandTarget(IOleCommandTargetVtbl): IUnknown(IUnknownVtbl) { + fn QueryStatus( + pguidCmdGroup: *const GUID, + cCmds: ULONG, + prgCmds: *mut OLECMD, + pCmdText: *mut OLECMDTEXT, + ) -> HRESULT, + fn Exec( + pguidCmdGroup: *const GUID, + nCmdID: DWORD, + nCmdexecopt: DWORD, + pvaIn: *mut VARIANT, + pvaOut: *mut VARIANT, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/documenttarget.rs b/bash-5.1/vendor/winapi/src/um/documenttarget.rs new file mode 100644 index 0000000000000000000000000000000000000000..b4cc1ae0ca13e8d6fd847d451e1216f790773653 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/documenttarget.rs @@ -0,0 +1,24 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// TODO:It is a minimal implementation. +use ctypes::c_void; +use shared::basetsd::UINT32; +use shared::guiddef::{GUID, REFGUID, REFIID}; +use shared::ntdef::HRESULT; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +RIDL!{#[uuid(0x1b8efec4, 0x3019, 0x4c27, 0x96, 0x4e, 0x36, 0x72, 0x02, 0x15, 0x69, 0x06)] +interface IPrintDocumentPackageTarget(IPrintDocumentPackageTargetVtbl): IUnknown(IUnknownVtbl) { + fn GetPackageTargetTypes( + targetCount: *mut UINT32, + targetTypes: *mut *mut GUID, + ) -> HRESULT, + fn GetPackageTarget( + guidTargetType: REFGUID, + riid: REFIID, + ppvTarget: *mut *mut c_void, + ) -> HRESULT, + fn Cancel() -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/dot1x.rs b/bash-5.1/vendor/winapi/src/um/dot1x.rs new file mode 100644 index 0000000000000000000000000000000000000000..326b7fc9bf760d93765e8ab1e450a13a6b63e773 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dot1x.rs @@ -0,0 +1,151 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, DWORD}; +use um::eaptypes::EAP_METHOD_TYPE; +use um::l2cmn::L2_REASON_CODE_ONEX_BASE; +use um::winnt::HANDLE; +ENUM!{enum ONEX_AUTH_IDENTITY { + OneXAuthIdentityNone = 0, + OneXAuthIdentityMachine = 1, + OneXAuthIdentityUser = 2, + OneXAuthIdentityExplicitUser = 3, + OneXAuthIdentityGuest = 4, + OneXAuthIdentityInvalid = 5, +}} +pub type PONEX_AUTH_IDENTITY = *mut ONEX_AUTH_IDENTITY; +ENUM!{enum ONEX_AUTH_STATUS { + OneXAuthNotStarted = 0, + OneXAuthInProgress = 1, + OneXAuthNoAuthenticatorFound = 2, + OneXAuthSuccess = 3, + OneXAuthFailure = 4, + OneXAuthInvalid = 5, +}} +pub type PONEX_AUTH_STATUS = *mut ONEX_AUTH_STATUS; +ENUM!{enum ONEX_REASON_CODE { + ONEX_REASON_CODE_SUCCESS = 0, + ONEX_REASON_START = L2_REASON_CODE_ONEX_BASE, + ONEX_UNABLE_TO_IDENTIFY_USER = 327681, + ONEX_IDENTITY_NOT_FOUND = 327682, + ONEX_UI_DISABLED = 327683, + ONEX_UI_FAILURE = 327684, + ONEX_EAP_FAILURE_RECEIVED = 327685, + ONEX_AUTHENTICATOR_NO_LONGER_PRESENT = 327686, + ONEX_NO_RESPONSE_TO_IDENTITY = 327687, + ONEX_PROFILE_VERSION_NOT_SUPPORTED = 327688, + ONEX_PROFILE_INVALID_LENGTH = 327689, + ONEX_PROFILE_DISALLOWED_EAP_TYPE = 327690, + ONEX_PROFILE_INVALID_EAP_TYPE_OR_FLAG = 327691, + ONEX_PROFILE_INVALID_ONEX_FLAGS = 327692, + ONEX_PROFILE_INVALID_TIMER_VALUE = 327693, + ONEX_PROFILE_INVALID_SUPPLICANT_MODE = 327694, + ONEX_PROFILE_INVALID_AUTH_MODE = 327695, + ONEX_PROFILE_INVALID_EAP_CONNECTION_PROPERTIES = 327696, + ONEX_UI_CANCELLED = 327697, + ONEX_PROFILE_INVALID_EXPLICIT_CREDENTIALS = 327698, + ONEX_PROFILE_EXPIRED_EXPLICIT_CREDENTIALS = 327699, + ONEX_UI_NOT_PERMITTED = 327700, +}} +pub type PONEX_REASON_CODE = *mut ONEX_REASON_CODE; +ENUM!{enum ONEX_NOTIFICATION_TYPE { + OneXPublicNotificationBase = 0, + OneXNotificationTypeResultUpdate = 1, + OneXNotificationTypeAuthRestarted = 2, + OneXNotificationTypeEventInvalid = 3, + OneXNumNotifications = OneXNotificationTypeEventInvalid, +}} +pub type PONEX_NOTIFICATION_TYPE = *mut ONEX_NOTIFICATION_TYPE; +ENUM!{enum ONEX_AUTH_RESTART_REASON { + OneXRestartReasonPeerInitiated = 0, + OneXRestartReasonMsmInitiated = 1, + OneXRestartReasonOneXHeldStateTimeout = 2, + OneXRestartReasonOneXAuthTimeout = 3, + OneXRestartReasonOneXConfigurationChanged = 4, + OneXRestartReasonOneXUserChanged = 5, + OneXRestartReasonQuarantineStateChanged = 6, + OneXRestartReasonAltCredsTrial = 7, + OneXRestartReasonInvalid = 8, +}} +pub type PONEX_AUTH_RESTART_REASON = *mut ONEX_AUTH_RESTART_REASON; +STRUCT!{struct ONEX_VARIABLE_BLOB { + dwSize: DWORD, + dwOffset: DWORD, +}} +pub type PONEX_VARIABLE_BLOB = *mut ONEX_VARIABLE_BLOB; +STRUCT!{struct ONEX_AUTH_PARAMS { + fUpdatePending: BOOL, + oneXConnProfile: ONEX_VARIABLE_BLOB, + authIdentity: ONEX_AUTH_IDENTITY, + dwQuarantineState: DWORD, + Bitfields: DWORD, + dwSessionId: DWORD, + hUserToken: HANDLE, + OneXUserProfile: ONEX_VARIABLE_BLOB, + Identity: ONEX_VARIABLE_BLOB, + UserName: ONEX_VARIABLE_BLOB, + Domain: ONEX_VARIABLE_BLOB, +}} +BITFIELD!{ONEX_AUTH_PARAMS Bitfields: DWORD [ + fSessionId set_fSessionId[0..1], + fhUserToken set_fhUserToken[1..2], + fOnexUserProfile set_fOnexUserProfile[2..3], + fIdentity set_fIdentity[3..4], + fUserName set_fUserName[4..5], + fDomain set_fDomain[5..6], +]} +pub type PONEX_AUTH_PARAMS = *mut ONEX_AUTH_PARAMS; +STRUCT!{struct ONEX_EAP_ERROR { + dwWinError: DWORD, + type_: EAP_METHOD_TYPE, + dwReasonCode: DWORD, + rootCauseGuid: GUID, + repairGuid: GUID, + helpLinkGuid: GUID, + Bitfields: DWORD, + RootCauseString: ONEX_VARIABLE_BLOB, + RepairString: ONEX_VARIABLE_BLOB, +}} +BITFIELD!{ONEX_EAP_ERROR Bitfields: DWORD [ + fRootCauseString set_fRootCauseString[0..1], + fRepairString set_fRepairString[1..2], +]} +pub type PONEX_EAP_ERROR = *mut ONEX_EAP_ERROR; +STRUCT!{struct ONEX_STATUS { + authStatus: ONEX_AUTH_STATUS, + dwReason: DWORD, + dwError: DWORD, +}} +pub type PONEX_STATUS = *mut ONEX_STATUS; +ENUM!{enum ONEX_EAP_METHOD_BACKEND_SUPPORT { + OneXEapMethodBackendSupportUnknown = 0, + OneXEapMethodBackendSupported = 1, + OneXEapMethodBackendUnsupported = 2, +}} +STRUCT!{struct ONEX_RESULT_UPDATE_DATA { + oneXStatus: ONEX_STATUS, + BackendSupport: ONEX_EAP_METHOD_BACKEND_SUPPORT, + fBackendEngaged: BOOL, + Bitfields: DWORD, + authParams: ONEX_VARIABLE_BLOB, + eapError: ONEX_VARIABLE_BLOB, +}} +BITFIELD!{ONEX_RESULT_UPDATE_DATA Bitfields: DWORD [ + fOneXAuthParams set_fOneXAuthParams[0..1], + fEapError set_fEapError[1..2], +]} +pub type PONEX_RESULT_UPDATE_DATA = *mut ONEX_RESULT_UPDATE_DATA; +STRUCT!{struct ONEX_USER_INFO { + authIdentity: ONEX_AUTH_IDENTITY, + Bitfields: DWORD, + UserName: ONEX_VARIABLE_BLOB, + DomainName: ONEX_VARIABLE_BLOB, +}} +BITFIELD!{ONEX_USER_INFO Bitfields: DWORD [ + fUserName set_fUserName[0..1], + fDomainName set_fDomainName[1..2], +]} +pub type PONEX_USER_INFO = *mut ONEX_USER_INFO; diff --git a/bash-5.1/vendor/winapi/src/um/dpa_dsa.rs b/bash-5.1/vendor/winapi/src/um/dpa_dsa.rs new file mode 100644 index 0000000000000000000000000000000000000000..21a3f4b3b62e5a255378a319f86c7eea64fa33db --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dpa_dsa.rs @@ -0,0 +1,283 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_int, c_void}; +use shared::basetsd::INT_PTR; +use shared::minwindef::{BOOL, DWORD, LPARAM, UINT}; +use um::winnt::{HANDLE, HRESULT, LPCWSTR, LPWSTR, PVOID, ULONGLONG}; +pub const DA_LAST: c_int = 0x7FFFFFFF; +pub const DA_ERR: c_int = -1; +FN!{stdcall PFNDAENUMCALLBACK( + p: *mut c_void, + pData: *mut c_void, +) -> c_int} +FN!{stdcall PFNDAENUMCALLBACKCONST( + p: *const c_void, + pData: *mut c_void, +) -> c_int} +FN!{stdcall PFNDACOMPARE( + p1: *mut c_void, + p2: *mut c_void, + lParam: LPARAM, +) -> c_int} +FN!{stdcall PFNDACOMPARECONST( + p1: *const c_void, + p2: *const c_void, + lParam: LPARAM, +) -> c_int} +pub enum DSA {} +pub type HDSA = *mut DSA; +extern "system" { + pub fn DSA_Create( + cbItem: c_int, + cItemGrow: c_int, + ) -> HDSA; + pub fn DSA_Destroy( + hdsa: HDSA, + ) -> BOOL; + pub fn DSA_DestroyCallback( + hdsa: HDSA, + pfnCB: PFNDAENUMCALLBACK, + pData: *mut c_void, + ); + pub fn DSA_DeleteItem( + hdsa: HDSA, + i: c_int, + ) -> BOOL; + pub fn DSA_DeleteAllItems( + hdsa: HDSA, + ) -> BOOL; + pub fn DSA_EnumCallback( + hdsa: HDSA, + pfnCB: PFNDAENUMCALLBACK, + pData: *mut c_void, + ); + pub fn DSA_InsertItem( + hdsa: HDSA, + i: c_int, + pitem: *const c_void, + ) -> c_int; + pub fn DSA_GetItemPtr( + hdsa: HDSA, + i: c_int, + ) -> PVOID; + pub fn DSA_GetItem( + hdsa: HDSA, + i: c_int, + pitem: *mut c_void, + ) -> BOOL; + pub fn DSA_SetItem( + hdsa: HDSA, + i: c_int, + pitem: *const c_void, + ) -> BOOL; +} +#[inline] +pub unsafe fn DSA_GetItemCount(hdsa: HDSA) -> c_int { + *(hdsa as *mut c_int) +} +#[inline] +pub unsafe fn DSA_AppendItem(hdsa: HDSA, pitem: *const c_void) -> c_int { + DSA_InsertItem(hdsa, DA_LAST, pitem) +} +extern "system" { + pub fn DSA_Clone( + hdsa: HDSA, + ) -> HDSA; + pub fn DSA_GetSize( + hdsa: HDSA, + ) -> ULONGLONG; + pub fn DSA_Sort( + pdsa: HDSA, + pfnCompare: PFNDACOMPARE, + lParam: LPARAM, + ) -> BOOL; +} +pub const DSA_APPEND: c_int = DA_LAST; +pub const DSA_ERR: c_int = DA_ERR; +pub type PFNDSAENUMCALLBACK = PFNDAENUMCALLBACK; +pub type PFNDSAENUMCALLBACKCONST = PFNDAENUMCALLBACKCONST; +pub type PFNDSACOMPARE = PFNDACOMPARE; +pub type PFNDSACOMPARECONST = PFNDACOMPARECONST; +pub enum DPA {} +pub type HDPA = *mut DPA; +extern "system" { + pub fn DPA_Create( + cItemGrow: c_int, + ) -> HDPA; + pub fn DPA_CreateEx( + cpGrow: c_int, + hheap: HANDLE, + ) -> HDPA; + pub fn DPA_Clone( + hdpa: HDPA, + hdpaNew: HDPA, + ) -> HDPA; + pub fn DPA_Destroy( + hdpa: HDPA, + ) -> BOOL; + pub fn DPA_DestroyCallback( + hdpa: HDPA, + pfnCB: PFNDAENUMCALLBACK, + pData: *mut c_void, + ); + pub fn DPA_DeletePtr( + hdpa: HDPA, + i: c_int, + ) -> PVOID; + pub fn DPA_DeleteAllPtrs( + hdpa: HDPA, + ) -> BOOL; + pub fn DPA_EnumCallback( + hdpa: HDPA, + pfnCB: PFNDAENUMCALLBACK, + pData: *mut c_void, + ); + pub fn DPA_Grow( + hdpa: HDPA, + cp: c_int, + ) -> BOOL; + pub fn DPA_InsertPtr( + hdpa: HDPA, + i: c_int, + p: *mut c_void, + ) -> c_int; + pub fn DPA_SetPtr( + hdpa: HDPA, + i: c_int, + p: *mut c_void, + ) -> BOOL; + pub fn DPA_GetPtr( + hdpa: HDPA, + i: INT_PTR, + ) -> PVOID; + pub fn DPA_GetPtrIndex( + hdpa: HDPA, + p: *const c_void, + ) -> c_int; +} +#[inline] +pub unsafe fn DPA_GetPtrCount(hdpa: HDPA) -> c_int { + *(hdpa as *mut c_int) +} +#[inline] +pub unsafe fn DPA_SetPtrCount(hdpa: HDPA, cItems: c_int) { + *(hdpa as *mut c_int) = cItems; +} +#[inline] +pub unsafe fn DPA_FastDeleteLastPtr(hdpa: HDPA) -> c_int { + *(hdpa as *mut c_int) -= 1; + *(hdpa as *mut c_int) +} +#[inline] +pub unsafe fn DPA_AppendPtr(hdpa: HDPA, pitem: *mut c_void) -> c_int { + DPA_InsertPtr(hdpa, DA_LAST, pitem) +} +extern "system" { + pub fn DPA_GetSize( + hdpa: HDPA, + ) -> ULONGLONG; + pub fn DPA_Sort( + hdpa: HDPA, + pfnCompare: PFNDACOMPARE, + lParam: LPARAM, + ) -> BOOL; +} +STRUCT!{struct DPASTREAMINFO { + iPos: c_int, + pvItem: *mut c_void, +}} +pub enum IStream {} +FN!{stdcall PFNDPASTREAM( + pinfo: *mut DPASTREAMINFO, + pstream: *mut IStream, + pvInstData: *mut c_void, +) -> HRESULT} +extern "system" { + pub fn DPA_LoadStream( + phdpa: *mut HDPA, + pfn: PFNDPASTREAM, + pstream: *mut IStream, + pvInstData: *mut c_void, + ) -> HRESULT; + pub fn DPA_SaveStream( + hdpa: HDPA, + pfn: PFNDPASTREAM, + pstream: *mut IStream, + pvInstData: *mut c_void, + ) -> HRESULT; +} +pub const DPAM_SORTED: DWORD = 0x00000001; +pub const DPAM_NORMAL: DWORD = 0x00000002; +pub const DPAM_UNION: DWORD = 0x00000004; +pub const DPAM_INTERSECT: DWORD = 0x00000008; +FN!{stdcall PFNDPAMERGE( + uMsg: UINT, + pvDest: *mut c_void, + pvSrc: *mut c_void, + lParam: LPARAM, +) -> *mut c_void} +FN!{stdcall PFNDPAMERGECONST( + uMsg: UINT, + pvDest: *const c_void, + pvSrc: *const c_void, + lParam: LPARAM, +) -> *const c_void} +pub const DPAMM_MERGE: UINT = 1; +pub const DPAMM_DELETE: UINT = 2; +pub const DPAMM_INSERT: UINT = 3; +extern "system" { + pub fn DPA_Merge( + hdpaDest: HDPA, + hdpaSrc: HDPA, + dwFlags: DWORD, + pfnCompare: PFNDACOMPARE, + pfnMerge: PFNDPAMERGE, + lParam: LPARAM, + ) -> BOOL; +} +pub const DPAS_SORTED: UINT = 0x0001; +pub const DPAS_INSERTBEFORE: UINT = 0x0002; +pub const DPAS_INSERTAFTER: UINT = 0x0004; +extern "system" { + pub fn DPA_Search( + hdpa: HDPA, + pFind: *mut c_void, + iStart: c_int, + pfnCompare: PFNDACOMPARE, + lParam: LPARAM, + options: UINT, + ) -> c_int; +} +#[inline] +pub unsafe fn DPA_SortedInsertPtr( + hdpa: HDPA, + pFind: *mut c_void, + iStart: c_int, + pfnCompare: PFNDACOMPARE, + lParam: LPARAM, + options: UINT, + pitem: *mut c_void, +) -> c_int { + DPA_InsertPtr( + hdpa, + DPA_Search( + hdpa, pFind, iStart, pfnCompare, lParam, DPAS_SORTED | options, + ), + pitem, + ) +} +pub const DPA_APPEND: c_int = DA_LAST; +pub const DPA_ERR: c_int = DA_ERR; +pub type PFNDPAENUMCALLBACK = PFNDAENUMCALLBACK; +pub type PFNDPAENUMCALLBACKCONST = PFNDAENUMCALLBACKCONST; +pub type PFNDPACOMPARE = PFNDACOMPARE; +pub type PFNDPACOMPARECONST = PFNDACOMPARECONST; +extern "system" { + pub fn Str_SetPtrW( + ppsz: *mut LPWSTR, + psz: LPCWSTR, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/dpapi.rs b/bash-5.1/vendor/winapi/src/um/dpapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..42f5824f5fbf84be0c2e2d82c61b2bd28fd6cd75 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dpapi.rs @@ -0,0 +1,100 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Data Protection API Prototypes and Definitions +use shared::minwindef::{BOOL, BYTE, DWORD, LPVOID}; +use shared::windef::HWND; +use um::wincrypt::DATA_BLOB; +use um::winnt::{LPCWSTR, LPWSTR, PSID, PVOID}; +pub const szFORCE_KEY_PROTECTION: &'static str = "ForceKeyProtection"; +pub const dwFORCE_KEY_PROTECTION_DISABLED: DWORD = 0x0; +pub const dwFORCE_KEY_PROTECTION_USER_SELECT: DWORD = 0x1; +pub const dwFORCE_KEY_PROTECTION_HIGH: DWORD = 0x2; +STRUCT!{struct CRYPTPROTECT_PROMPTSTRUCT { + cbSize: DWORD, + dwPromptFlags: DWORD, + hwndApp: HWND, + szPrompt: LPCWSTR, +}} +pub type PCRYPTPROTECT_PROMPTSTRUCT = *mut CRYPTPROTECT_PROMPTSTRUCT; +pub const CRYPTPROTECT_PROMPT_ON_UNPROTECT: DWORD = 0x1; +pub const CRYPTPROTECT_PROMPT_ON_PROTECT: DWORD = 0x2; +pub const CRYPTPROTECT_PROMPT_RESERVED: DWORD = 0x04; +pub const CRYPTPROTECT_PROMPT_STRONG: DWORD = 0x08; +pub const CRYPTPROTECT_PROMPT_REQUIRE_STRONG: DWORD = 0x10; +pub const CRYPTPROTECT_UI_FORBIDDEN: DWORD = 0x1; +pub const CRYPTPROTECT_LOCAL_MACHINE: DWORD = 0x4; +pub const CRYPTPROTECT_CRED_SYNC: DWORD = 0x8; +pub const CRYPTPROTECT_AUDIT: DWORD = 0x10; +pub const CRYPTPROTECT_NO_RECOVERY: DWORD = 0x20; +pub const CRYPTPROTECT_VERIFY_PROTECTION: DWORD = 0x40; +pub const CRYPTPROTECT_CRED_REGENERATE: DWORD = 0x80; +pub const CRYPTPROTECT_FIRST_RESERVED_FLAGVAL: DWORD = 0x0FFFFFFF; +pub const CRYPTPROTECT_LAST_RESERVED_FLAGVAL: DWORD = 0xFFFFFFFF; +extern "system" { + pub fn CryptProtectData( + pDataIn: *mut DATA_BLOB, + szDataDescr: LPCWSTR, + pOptionalEntropy: *mut DATA_BLOB, + pvReserved: PVOID, + pPromptStruct: *mut CRYPTPROTECT_PROMPTSTRUCT, + dwFlags: DWORD, + pDataOut: *mut DATA_BLOB, + ) -> BOOL; + pub fn CryptUnprotectData( + pDataIn: *mut DATA_BLOB, + ppszDataDescr: *mut LPWSTR, + pOptionalEntropy: *mut DATA_BLOB, + pvReserved: PVOID, + pPromptStruct: *mut CRYPTPROTECT_PROMPTSTRUCT, + dwFlags: DWORD, + pDataOut: *mut DATA_BLOB, + ) -> BOOL; + pub fn CryptProtectDataNoUI( + pDataIn: *mut DATA_BLOB, + szDataDescr: LPCWSTR, + pOptionalEntropy: *mut DATA_BLOB, + pvReserved: PVOID, + pPromptStruct: *mut CRYPTPROTECT_PROMPTSTRUCT, + dwFlags: DWORD, + pbOptionalPassword: *const BYTE, + cbOptionalPassword: DWORD, + pDataOut: *mut DATA_BLOB, + ) -> BOOL; + pub fn CryptUnprotectDataNoUI( + pDataIn: *mut DATA_BLOB, + ppszDataDescr: *mut LPWSTR, + pOptionalEntropy: *mut DATA_BLOB, + pvReserved: PVOID, + pPromptStruct: *mut CRYPTPROTECT_PROMPTSTRUCT, + dwFlags: DWORD, + pbOptionalPassword: *const BYTE, + cbOptionalPassword: DWORD, + pDataOut: *mut DATA_BLOB, + ) -> BOOL; + pub fn CryptUpdateProtectedState( + pOldSid: PSID, + pwszOldPassword: LPCWSTR, + dwFlags: DWORD, + pdwSuccessCount: *mut DWORD, + pdwFailureCount: *mut DWORD, + ) -> BOOL; +} +pub const CRYPTPROTECTMEMORY_BLOCK_SIZE: DWORD = 16; +pub const CRYPTPROTECTMEMORY_SAME_PROCESS: DWORD = 0x00; +pub const CRYPTPROTECTMEMORY_CROSS_PROCESS: DWORD = 0x01; +pub const CRYPTPROTECTMEMORY_SAME_LOGON: DWORD = 0x02; +extern "system" { + pub fn CryptProtectMemory( + pDataIn: LPVOID, + cbDataIn: DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptUnprotectMemory( + pDataIn: LPVOID, + cbDataIn: DWORD, + dwFlags: DWORD, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/dsgetdc.rs b/bash-5.1/vendor/winapi/src/um/dsgetdc.rs new file mode 100644 index 0000000000000000000000000000000000000000..860a652ec77b13c3fa47265641727e146d5e9ed4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dsgetdc.rs @@ -0,0 +1,267 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This file contains structures, function prototypes, and definitions for the DsGetDcName API. +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, PULONG, ULONG}; +use shared::ws2def::{LPSOCKET_ADDRESS, PSOCKET_ADDRESS}; +use um::ntsecapi::PLSA_FOREST_TRUST_INFORMATION; +use um::winnt::{HANDLE, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PHANDLE, PSID}; +pub const DS_FORCE_REDISCOVERY: ULONG = 0x00000001; +pub const DS_DIRECTORY_SERVICE_REQUIRED: ULONG = 0x00000010; +pub const DS_DIRECTORY_SERVICE_PREFERRED: ULONG = 0x00000020; +pub const DS_GC_SERVER_REQUIRED: ULONG = 0x00000040; +pub const DS_PDC_REQUIRED: ULONG = 0x00000080; +pub const DS_BACKGROUND_ONLY: ULONG = 0x00000100; +pub const DS_IP_REQUIRED: ULONG = 0x00000200; +pub const DS_KDC_REQUIRED: ULONG = 0x00000400; +pub const DS_TIMESERV_REQUIRED: ULONG = 0x00000800; +pub const DS_WRITABLE_REQUIRED: ULONG = 0x00001000; +pub const DS_GOOD_TIMESERV_PREFERRED: ULONG = 0x00002000; +pub const DS_AVOID_SELF: ULONG = 0x00004000; +pub const DS_ONLY_LDAP_NEEDED: ULONG = 0x00008000; +pub const DS_IS_FLAT_NAME: ULONG = 0x00010000; +pub const DS_IS_DNS_NAME: ULONG = 0x00020000; +pub const DS_TRY_NEXTCLOSEST_SITE: ULONG = 0x00040000; +pub const DS_DIRECTORY_SERVICE_6_REQUIRED: ULONG = 0x00080000; +pub const DS_WEB_SERVICE_REQUIRED: ULONG = 0x00100000; +pub const DS_DIRECTORY_SERVICE_8_REQUIRED: ULONG = 0x00200000; +pub const DS_DIRECTORY_SERVICE_9_REQUIRED: ULONG = 0x00400000; +pub const DS_DIRECTORY_SERVICE_10_REQUIRED: ULONG = 0x00800000; +pub const DS_RETURN_DNS_NAME: ULONG = 0x40000000; +pub const DS_RETURN_FLAT_NAME: ULONG = 0x80000000; +pub const DSGETDC_VALID_FLAGS: ULONG = DS_FORCE_REDISCOVERY | DS_DIRECTORY_SERVICE_REQUIRED + | DS_DIRECTORY_SERVICE_PREFERRED | DS_GC_SERVER_REQUIRED | DS_PDC_REQUIRED | DS_BACKGROUND_ONLY + | DS_IP_REQUIRED | DS_KDC_REQUIRED | DS_TIMESERV_REQUIRED | DS_WRITABLE_REQUIRED + | DS_GOOD_TIMESERV_PREFERRED | DS_AVOID_SELF | DS_ONLY_LDAP_NEEDED | DS_IS_FLAT_NAME + | DS_IS_DNS_NAME | DS_TRY_NEXTCLOSEST_SITE | DS_DIRECTORY_SERVICE_6_REQUIRED + | DS_DIRECTORY_SERVICE_8_REQUIRED | DS_DIRECTORY_SERVICE_9_REQUIRED + | DS_DIRECTORY_SERVICE_10_REQUIRED | DS_WEB_SERVICE_REQUIRED | DS_RETURN_FLAT_NAME + | DS_RETURN_DNS_NAME; +STRUCT!{struct DOMAIN_CONTROLLER_INFOA { + DomainControllerName: LPSTR, + DomainControllerAddress: LPSTR, + DomainControllerAddressType: ULONG, + DomainGuid: GUID, + DomainName: LPSTR, + DnsForestName: LPSTR, + Flags: ULONG, + DcSiteName: LPSTR, + ClientSiteName: LPSTR, +}} +pub type PDOMAIN_CONTROLLER_INFOA = *mut DOMAIN_CONTROLLER_INFOA; +STRUCT!{struct DOMAIN_CONTROLLER_INFOW { + DomainControllerName: LPWSTR, + DomainControllerAddress: LPWSTR, + DomainControllerAddressType: ULONG, + DomainGuid: GUID, + DomainName: LPWSTR, + DnsForestName: LPWSTR, + Flags: ULONG, + DcSiteName: LPWSTR, + ClientSiteName: LPWSTR, +}} +pub type PDOMAIN_CONTROLLER_INFOW = *mut DOMAIN_CONTROLLER_INFOW; +pub const DS_INET_ADDRESS: ULONG = 1; +pub const DS_NETBIOS_ADDRESS: ULONG = 2; +pub const DS_PDC_FLAG: ULONG = 0x00000001; +pub const DS_GC_FLAG: ULONG = 0x00000004; +pub const DS_LDAP_FLAG: ULONG = 0x00000008; +pub const DS_DS_FLAG: ULONG = 0x00000010; +pub const DS_KDC_FLAG: ULONG = 0x00000020; +pub const DS_TIMESERV_FLAG: ULONG = 0x00000040; +pub const DS_CLOSEST_FLAG: ULONG = 0x00000080; +pub const DS_WRITABLE_FLAG: ULONG = 0x00000100; +pub const DS_GOOD_TIMESERV_FLAG: ULONG = 0x00000200; +pub const DS_NDNC_FLAG: ULONG = 0x00000400; +pub const DS_SELECT_SECRET_DOMAIN_6_FLAG: ULONG = 0x00000800; +pub const DS_FULL_SECRET_DOMAIN_6_FLAG: ULONG = 0x00001000; +pub const DS_WS_FLAG: ULONG = 0x00002000; +pub const DS_DS_8_FLAG: ULONG = 0x00004000; +pub const DS_DS_9_FLAG: ULONG = 0x00008000; +pub const DS_DS_10_FLAG: ULONG = 0x00010000; +pub const DS_PING_FLAGS: ULONG = 0x000FFFFF; +pub const DS_DNS_CONTROLLER_FLAG: ULONG = 0x20000000; +pub const DS_DNS_DOMAIN_FLAG: ULONG = 0x40000000; +pub const DS_DNS_FOREST_FLAG: ULONG = 0x80000000; +extern "system" { + pub fn DsGetDcNameA( + ComputerName: LPCSTR, + DomainName: LPCSTR, + DomainGuid: *mut GUID, + SiteName: LPCSTR, + Flags: ULONG, + DomainControllerInfo: *mut PDOMAIN_CONTROLLER_INFOA, + ) -> DWORD; + pub fn DsGetDcNameW( + ComputerName: LPCWSTR, + DomainName: LPCWSTR, + DomainGuid: *mut GUID, + SiteName: LPCWSTR, + Flags: ULONG, + DomainControllerInfo: *mut PDOMAIN_CONTROLLER_INFOW, + ) -> DWORD; + pub fn DsGetSiteNameA( + ComputerName: LPCSTR, + SiteName: *mut LPSTR, + ) -> DWORD; + pub fn DsGetSiteNameW( + ComputerName: LPCWSTR, + SiteName: *mut LPWSTR, + ) -> DWORD; + pub fn DsValidateSubnetNameW( + SubnetName: LPCWSTR, + ) -> DWORD; + pub fn DsValidateSubnetNameA( + SubnetName: LPCSTR, + ) -> DWORD; + pub fn DsAddressToSiteNamesW( + ComputerName: LPCWSTR, + EntryCount: DWORD, + SocketAddresses: PSOCKET_ADDRESS, + SiteNames: *mut *mut LPWSTR, + ) -> DWORD; + pub fn DsAddressToSiteNamesA( + ComputerName: LPCSTR, + EntryCount: DWORD, + SocketAddresses: PSOCKET_ADDRESS, + SiteNames: *mut *mut LPSTR, + ) -> DWORD; + pub fn DsAddressToSiteNamesExW( + ComputerName: LPCWSTR, + EntryCount: DWORD, + SocketAddresses: PSOCKET_ADDRESS, + SiteNames: *mut *mut LPWSTR, + SubnetNames: *mut *mut LPWSTR, + ) -> DWORD; + pub fn DsAddressToSiteNamesExA( + ComputerName: LPCSTR, + EntryCount: DWORD, + SocketAddresses: PSOCKET_ADDRESS, + SiteNames: *mut *mut LPSTR, + SubnetNames: *mut *mut LPSTR, + ) -> DWORD; +} +pub const DS_DOMAIN_IN_FOREST: ULONG = 0x0001; +pub const DS_DOMAIN_DIRECT_OUTBOUND: ULONG = 0x0002; +pub const DS_DOMAIN_TREE_ROOT: ULONG = 0x0004; +pub const DS_DOMAIN_PRIMARY: ULONG = 0x0008; +pub const DS_DOMAIN_NATIVE_MODE: ULONG = 0x0010; +pub const DS_DOMAIN_DIRECT_INBOUND: ULONG = 0x0020; +pub const DS_DOMAIN_VALID_FLAGS: ULONG = DS_DOMAIN_IN_FOREST | DS_DOMAIN_DIRECT_OUTBOUND + | DS_DOMAIN_TREE_ROOT | DS_DOMAIN_PRIMARY | DS_DOMAIN_NATIVE_MODE | DS_DOMAIN_DIRECT_INBOUND; +STRUCT!{struct DS_DOMAIN_TRUSTSW { + NetbiosDomainName: LPWSTR, + DnsDomainName: LPWSTR, + Flags: ULONG, + ParentIndex: ULONG, + TrustType: ULONG, + TrustAttributes: ULONG, + DomainSid: PSID, + DomainGuid: GUID, +}} +pub type PDS_DOMAIN_TRUSTSW = *mut DS_DOMAIN_TRUSTSW; +STRUCT!{struct DS_DOMAIN_TRUSTSA { + NetbiosDomainName: LPSTR, + DnsDomainName: LPSTR, + Flags: ULONG, + ParentIndex: ULONG, + TrustType: ULONG, + TrustAttributes: ULONG, + DomainSid: PSID, + DomainGuid: GUID, +}} +pub type PDS_DOMAIN_TRUSTSA = *mut DS_DOMAIN_TRUSTSA; +extern "system" { + pub fn DsEnumerateDomainTrustsW( + ServerName: LPWSTR, + Flags: ULONG, + Domains: *mut PDS_DOMAIN_TRUSTSW, + DomainCount: PULONG, + ) -> DWORD; + pub fn DsEnumerateDomainTrustsA( + ServerName: LPSTR, + Flags: ULONG, + Domains: *mut PDS_DOMAIN_TRUSTSA, + DomainCount: PULONG, + ) -> DWORD; + pub fn DsGetForestTrustInformationW( + ServerName: LPCWSTR, + TrustedDomainName: LPCWSTR, + Flags: DWORD, + ForestTrustInfo: *mut PLSA_FOREST_TRUST_INFORMATION, + ) -> DWORD; + pub fn DsMergeForestTrustInformationW( + DomainName: LPCWSTR, + NewForestTrustInfo: PLSA_FOREST_TRUST_INFORMATION, + OldForestTrustInfo: PLSA_FOREST_TRUST_INFORMATION, + MergedForestTrustInfo: *mut PLSA_FOREST_TRUST_INFORMATION, + ) -> DWORD; + pub fn DsGetDcSiteCoverageW( + ServerName: LPCWSTR, + EntryCount: PULONG, + SiteNames: *mut *mut LPWSTR, + ) -> DWORD; + pub fn DsGetDcSiteCoverageA( + ServerName: LPCSTR, + EntryCount: PULONG, + SiteNames: *mut *mut LPSTR, + ) -> DWORD; + pub fn DsDeregisterDnsHostRecordsW( + ServerName: LPWSTR, + DnsDomainName: LPWSTR, + DomainGuid: *mut GUID, + DsaGuid: *mut GUID, + DnsHostName: LPWSTR, + ) -> DWORD; + pub fn DsDeregisterDnsHostRecordsA( + ServerName: LPSTR, + DnsDomainName: LPSTR, + DomainGuid: *mut GUID, + DsaGuid: *mut GUID, + DnsHostName: LPSTR, + ) -> DWORD; +} +pub const DS_ONLY_DO_SITE_NAME: ULONG = 0x01; +pub const DS_NOTIFY_AFTER_SITE_RECORDS: ULONG = 0x02; +pub const DS_OPEN_VALID_OPTION_FLAGS: ULONG = DS_ONLY_DO_SITE_NAME + | DS_NOTIFY_AFTER_SITE_RECORDS; +pub const DS_OPEN_VALID_FLAGS: ULONG = DS_FORCE_REDISCOVERY | DS_ONLY_LDAP_NEEDED + | DS_KDC_REQUIRED | DS_PDC_REQUIRED | DS_GC_SERVER_REQUIRED | DS_WRITABLE_REQUIRED; +extern "system" { + pub fn DsGetDcOpenW( + DnsName: LPCWSTR, + OptionFlags: ULONG, + SiteName: LPCWSTR, + DomainGuid: *mut GUID, + DnsForestName: LPCWSTR, + DcFlags: ULONG, + RetGetDcContext: PHANDLE, + ) -> DWORD; + pub fn DsGetDcOpenA( + DnsName: LPCSTR, + OptionFlags: ULONG, + SiteName: LPCSTR, + DomainGuid: *mut GUID, + DnsForestName: LPCSTR, + DcFlags: ULONG, + RetGetDcContext: PHANDLE, + ) -> DWORD; + pub fn DsGetDcNextA( + GetDcContextHandle: HANDLE, + SockAddressCount: PULONG, + SockAddresses: *mut LPSOCKET_ADDRESS, + DnsHostName: *mut LPSTR, + ) -> DWORD; + pub fn DsGetDcNextW( + GetDcContextHandle: HANDLE, + SockAddressCount: PULONG, + SockAddresses: *mut LPSOCKET_ADDRESS, + DnsHostName: *mut LPWSTR, + ) -> DWORD; + pub fn DsGetDcCloseW( + GetDcContextHandle: HANDLE, + ); +} diff --git a/bash-5.1/vendor/winapi/src/um/dsound.rs b/bash-5.1/vendor/winapi/src/um/dsound.rs new file mode 100644 index 0000000000000000000000000000000000000000..9c23bbf537c9c61fd84d8f4595017be71bbc681f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dsound.rs @@ -0,0 +1,342 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! DSound procedure declarations, constant definitions and macros +use shared::guiddef::{GUID, LPCGUID, LPGUID}; +use shared::minwindef::{DWORD, LPDWORD, LPLONG, LPVOID}; +use shared::windef::HWND; +use shared::winerror::{E_FAIL, S_OK}; +use um::mmsystem::{LPCWAVEFORMATEX, LPWAVEFORMATEX}; +use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN}; +use um::winnt::{HRESULT, LONG}; +DEFINE_GUID!{CLSID_DirectSound, + 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} +DEFINE_GUID!{CLSID_DirectSound8, + 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b} +DEFINE_GUID!{CLSID_DirectSoundCapture, + 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x08, 0x00, 0xa0, 0xc9, 0x25, 0xcd, 0x16} +DEFINE_GUID!{CLSID_DirectSoundCapture8, + 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1} +DEFINE_GUID!{CLSID_DirectSoundFullDuplex, + 0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d} +DEFINE_GUID!{DSDEVID_DefaultPlayback, + 0xdef00000, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03} +DEFINE_GUID!{DSDEVID_DefaultCapture, + 0xdef00001, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03} +DEFINE_GUID!{DSDEVID_DefaultVoicePlayback, + 0xdef00002, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03} +DEFINE_GUID!{DSDEVID_DefaultVoiceCapture, + 0xdef00003, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03} +STRUCT!{struct DSCAPS { + dwSize: DWORD, + dwFlags: DWORD, + dwMinSecondarySampleRate: DWORD, + dwMaxSecondarySampleRate: DWORD, + dwPrimaryBuffers: DWORD, + dwMaxHwMixingAllBuffers: DWORD, + dwMaxHwMixingStaticBuffers: DWORD, + dwMaxHwMixingStreamingBuffers: DWORD, + dwFreeHwMixingAllBuffers: DWORD, + dwFreeHwMixingStaticBuffers: DWORD, + dwFreeHwMixingStreamingBuffers: DWORD, + dwMaxHw3DAllBuffers: DWORD, + dwMaxHw3DStaticBuffers: DWORD, + dwMaxHw3DStreamingBuffers: DWORD, + dwFreeHw3DAllBuffers: DWORD, + dwFreeHw3DStaticBuffers: DWORD, + dwFreeHw3DStreamingBuffers: DWORD, + dwTotalHwMemBytes: DWORD, + dwFreeHwMemBytes: DWORD, + dwMaxContigFreeHwMemBytes: DWORD, + dwUnlockTransferRateHwBuffers: DWORD, + dwPlayCpuOverheadSwBuffers: DWORD, + dwReserved1: DWORD, + dwReserved2: DWORD, +}} +pub type LPDSCAPS = *mut DSCAPS; +STRUCT!{struct DSBCAPS { + dwSize: DWORD, + dwFlags: DWORD, + dwBufferBytes: DWORD, + dwUnlockTransferRate: DWORD, + dwPlayCpuOverhead: DWORD, +}} +pub type LPDSBCAPS = *mut DSBCAPS; +STRUCT!{struct DSBUFFERDESC { + dwSize: DWORD, + dwFlags: DWORD, + dwBufferBytes: DWORD, + dwReserved: DWORD, + lpwfxFormat: LPWAVEFORMATEX, + guid3DAlgorithm: GUID, +}} +pub type LPCDSBUFFERDESC = *const DSBUFFERDESC; +RIDL!{#[uuid(0x279afa85, 0x4981, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60)] +interface IDirectSoundBuffer(IDirectSoundBufferVtbl): IUnknown(IUnknownVtbl) { + fn GetCaps( + pDSBufferCaps: LPDSBCAPS, + ) -> HRESULT, + fn GetCurrentPosition( + pdwCurrentPlayCursor: LPDWORD, + pdwCurrentWriteCursor: LPDWORD, + ) -> HRESULT, + fn GetFormat( + pwfxFormat: LPWAVEFORMATEX, + dwSizeAllocated: DWORD, + pdwSizeWritten: LPDWORD, + ) -> HRESULT, + fn GetVolume( + plVolume: LPLONG, + ) -> HRESULT, + fn GetPan( + plPan: LPLONG, + ) -> HRESULT, + fn GetFrequency( + pdwFrequency: LPDWORD, + ) -> HRESULT, + fn GetStatus( + pdwStatus: LPDWORD, + ) -> HRESULT, + fn Initialize( + pDirectSound: LPDIRECTSOUND, + pcDSBufferDesc: LPCDSBUFFERDESC, + ) -> HRESULT, + fn Lock( + dwOffset: DWORD, + dwBytes: DWORD, + ppvAudioPtr1: *mut LPVOID, + pdwAudioBytes1: LPDWORD, + ppvAudioPtr2: *mut LPVOID, + pdwAudioBytes2: LPDWORD, + dwFlags: DWORD, + ) -> HRESULT, + fn Play( + dwReserved1: DWORD, + dwPriority: DWORD, + dwFlags: DWORD, + ) -> HRESULT, + fn SetCurrentPosition( + dwNewPosition: DWORD, + ) -> HRESULT, + fn SetFormat( + pcfxFormat: LPCWAVEFORMATEX, + ) -> HRESULT, + fn SetVolume( + lVolume: LONG, + ) -> HRESULT, + fn SetPan( + lPan: LONG, + ) -> HRESULT, + fn SetFrequency( + dwFrequency: DWORD, + ) -> HRESULT, + fn Stop() -> HRESULT, + fn Unlock( + pvAudioPtr1: LPVOID, + dwAudioBytes1: DWORD, + pvAudioPtr2: LPVOID, + dwAudioBytes2: DWORD, + ) -> HRESULT, + fn Restore() -> HRESULT, +}} +pub type LPDIRECTSOUNDBUFFER = *mut IDirectSoundBuffer; +DEFINE_GUID!{IID_IReferenceClock, + 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70} +DEFINE_GUID!{IID_IDirectSound, + 0x279afa83, 0x4981, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} +RIDL!{#[uuid(0x279afa83, 0x4981, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60)] +interface IDirectSound(IDirectSoundVtbl): IUnknown(IUnknownVtbl) { + fn CreateSoundBuffer( + pcDSBufferDesc: LPCDSBUFFERDESC, + ppDSBuffer: *mut LPDIRECTSOUNDBUFFER, + pUnkOuter: LPUNKNOWN, + ) -> HRESULT, + fn GetCaps( + pDSCaps: LPDSCAPS, + ) -> HRESULT, + fn DuplicateSoundBuffer( + pDSBufferOriginal: LPDIRECTSOUNDBUFFER, + ppDSBufferDuplicate: *mut LPDIRECTSOUNDBUFFER, + ) -> HRESULT, + fn SetCooperativeLevel( + hWnd: HWND, + dwLevel: DWORD, + ) -> HRESULT, + fn Compact() -> HRESULT, + fn GetSpeakerConfig( + pdwSpeakerConfig: LPDWORD, + ) -> HRESULT, + fn SetSpeakerConfig( + dwSpeakerConfig: DWORD, + ) -> HRESULT, + fn Initialize( + pcGuidDevice: LPCGUID, + ) -> HRESULT, +}} +pub type LPDIRECTSOUND = *mut IDirectSound; +DEFINE_GUID!{IID_IDirectSound8, + 0xc50a7e93, 0xf395, 0x4834, 0x9e, 0xf6, 0x7f, 0xa9, 0x9d, 0xe5, 0x09, 0x66} +DEFINE_GUID!{IID_IDirectSoundBuffer, + 0x279afa85, 0x4981, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} +DEFINE_GUID!{IID_IDirectSoundBuffer8, + 0x6825a449, 0x7524, 0x4d82, 0x92, 0x0f, 0x50, 0xe3, 0x6a, 0xb3, 0xab, 0x1e} +DEFINE_GUID!{GUID_All_Objects, + 0xaa114de5, 0xc262, 0x4169, 0xa1, 0xc8, 0x23, 0xd6, 0x98, 0xcc, 0x73, 0xb5} +DEFINE_GUID!{IID_IDirectSound3DListener, + 0x279afa84, 0x4981, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} +DEFINE_GUID!{IID_IDirectSound3DBuffer, + 0x279afa86, 0x4981, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} +DEFINE_GUID!{IID_IDirectSoundCapture, + 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x08, 0x00, 0xa0, 0xc9, 0x25, 0xcd, 0x16} +DEFINE_GUID!{IID_IDirectSoundCaptureBuffer, + 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x08, 0x00, 0xa0, 0xc9, 0x25, 0xcd, 0x16} +DEFINE_GUID!{IID_IDirectSoundCaptureBuffer8, + 0x00990df4, 0x0dbb, 0x4872, 0x83, 0x3e, 0x6d, 0x30, 0x3e, 0x80, 0xae, 0xb6} +DEFINE_GUID!{IID_IDirectSoundNotify, + 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x08, 0x00, 0xa0, 0xc9, 0x25, 0xcd, 0x16} +DEFINE_GUID!{IID_IKsPropertySet, + 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93} +DEFINE_GUID!{IID_IDirectSoundFXGargle, + 0xd616f352, 0xd622, 0x11ce, 0xaa, 0xc5, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3} +DEFINE_GUID!{IID_IDirectSoundFXChorus, + 0x880842e3, 0x145f, 0x43e6, 0xa9, 0x34, 0xa7, 0x18, 0x06, 0xe5, 0x05, 0x47} +DEFINE_GUID!{IID_IDirectSoundFXFlanger, + 0x903e9878, 0x2c92, 0x4072, 0x9b, 0x2c, 0xea, 0x68, 0xf5, 0x39, 0x67, 0x83} +DEFINE_GUID!{IID_IDirectSoundFXEcho, + 0x8bd28edf, 0x50db, 0x4e92, 0xa2, 0xbd, 0x44, 0x54, 0x88, 0xd1, 0xed, 0x42} +DEFINE_GUID!{IID_IDirectSoundFXDistortion, + 0x8ecf4326, 0x455f, 0x4d8b, 0xbd, 0xa9, 0x8d, 0x5d, 0x3e, 0x9e, 0x3e, 0x0b} +DEFINE_GUID!{IID_IDirectSoundFXCompressor, + 0x4bbd1154, 0x62f6, 0x4e2c, 0xa1, 0x5c, 0xd3, 0xb6, 0xc4, 0x17, 0xf7, 0xa0} +DEFINE_GUID!{IID_IDirectSoundFXParamEq, + 0xc03ca9fe, 0xfe90, 0x4204, 0x80, 0x78, 0x82, 0x33, 0x4c, 0xd1, 0x77, 0xda} +DEFINE_GUID!{IID_IDirectSoundFXI3DL2Reverb, + 0x4b166a6a, 0x0d66, 0x43f3, 0x80, 0xe3, 0xee, 0x62, 0x80, 0xde, 0xe1, 0xa4} +DEFINE_GUID!{IID_IDirectSoundFXWavesReverb, + 0x46858c3a, 0x0dc6, 0x45e3, 0xb7, 0x60, 0xd4, 0xee, 0xf1, 0x6c, 0xb3, 0x25} +DEFINE_GUID!{IID_IDirectSoundCaptureFXAec, + 0xad74143d, 0x903d, 0x4ab7, 0x80, 0x66, 0x28, 0xd3, 0x63, 0x03, 0x6d, 0x65} +DEFINE_GUID!{IID_IDirectSoundCaptureFXNoiseSuppress, + 0xed311e41, 0xfbae, 0x4175, 0x96, 0x25, 0xcd, 0x08, 0x54, 0xf6, 0x93, 0xca} +DEFINE_GUID!{IID_IDirectSoundFullDuplex, + 0xedcb4c7a, 0xdaab, 0x4216, 0xa4, 0x2e, 0x6c, 0x50, 0x59, 0x6d, 0xdc, 0x1d} +pub const DS_OK: HRESULT = S_OK; +pub const DSERR_GENERIC: HRESULT = E_FAIL; +pub const DSSCL_NORMAL: DWORD = 0x00000001; +pub const DSSCL_PRIORITY: DWORD = 0x00000002; +pub const DSSCL_EXCLUSIVE: DWORD = 0x00000003; +pub const DSSCL_WRITEPRIMARY: DWORD = 0x00000004; +pub const DSBCAPS_PRIMARYBUFFER: DWORD = 0x00000001; +pub const DSBCAPS_STATIC: DWORD = 0x00000002; +pub const DSBCAPS_LOCHARDWARE: DWORD = 0x00000004; +pub const DSBCAPS_LOCSOFTWARE: DWORD = 0x00000008; +pub const DSBCAPS_CTRL3D: DWORD = 0x00000010; +pub const DSBCAPS_CTRLFREQUENCY: DWORD = 0x00000020; +pub const DSBCAPS_CTRLPAN: DWORD = 0x00000040; +pub const DSBCAPS_CTRLVOLUME: DWORD = 0x00000080; +pub const DSBCAPS_CTRLPOSITIONNOTIFY: DWORD = 0x00000100; +pub const DSBCAPS_CTRLFX: DWORD = 0x00000200; +pub const DSBCAPS_STICKYFOCUS: DWORD = 0x00004000; +pub const DSBCAPS_GLOBALFOCUS: DWORD = 0x00008000; +pub const DSBCAPS_GETCURRENTPOSITION2: DWORD = 0x00010000; +pub const DSBCAPS_MUTE3DATMAXDISTANCE: DWORD = 0x00020000; +pub const DSBCAPS_LOCDEFER: DWORD = 0x00040000; +pub const DSBCAPS_TRUEPLAYPOSITION: DWORD = 0x00080000; +pub const DSBPLAY_LOOPING: DWORD = 0x00000001; +pub const DSBPLAY_LOCHARDWARE: DWORD = 0x00000002; +pub const DSBPLAY_LOCSOFTWARE: DWORD = 0x00000004; +pub const DSBPLAY_TERMINATEBY_TIME: DWORD = 0x00000008; +pub const DSBPLAY_TERMINATEBY_DISTANCE: DWORD = 0x000000010; +pub const DSBPLAY_TERMINATEBY_PRIORITY: DWORD = 0x000000020; +extern "system" { + pub fn DirectSoundCreate( + pcGuidDevice: LPCGUID, + ppDS: *mut LPDIRECTSOUND, + pUnkOuter: LPUNKNOWN, + ) -> HRESULT; + // pub fn DirectSoundEnumerateA( + // pDSEnumCallback: LPDSENUMCALLBACKA, + // pContext: LPVOID, + // ) -> HRESULT; + // pub fn DirectSoundEnumerateW( + // pDSEnumCallback: LPDSENUMCALLBACKW, + // pContext: LPVOID, + // ) -> HRESULT; + // pub fn DirectSoundCaptureCreate( + // pcGuidDevice: LPCGUID, + // ppDSC: *mut LPDIRECTSOUNDCAPTURE, + // pUnkOuter: LPUNKNOWN, + // ) -> HRESULT; + // pub fn DirectSoundCaptureEnumerateA( + // pDSEnumCallback: LPDSENUMCALLBACKA, + // pContext: LPVOID, + // ) -> HRESULT; + // pub fn DirectSoundCaptureEnumerateW( + // pDSEnumCallback: LPDSENUMCALLBACKW, + // pContext: LPVOID, + // ) -> HRESULT; + // pub fn DirectSoundCreate8( + // pcGuidDevice: LPCGUID, + // ppDS8: *mut LPDIRECTSOUND8, + // pUnkOuter: LPUNKNOWN, + // ) -> HRESULT; + // pub fn DirectSoundCaptureCreate8( + // pcGuidDevice: LPCGUID, + // ppDSC8: *mut LPDIRECTSOUNDCAPTURE8, + // pUnkOuter: LPUNKNOWN, + // ) -> HRESULT; + // pub fn DirectSoundFullDuplexCreate( + // pcGuidCaptureDevice: LPCGUID, + // pcGuidRenderDevice: LPCGUID, + // pcDSCBufferDesc: LPCDSCBUFFERDESC, + // pcDSBufferDesc: LPCDSBUFFERDESC, + // hWnd: HWND, + // dwLevel: DWORD, + // ppDSFD: *mut LPDIRECTSOUNDFULLDUPLEX, + // ppDSCBuffer8: *mut LPDIRECTSOUNDCAPTUREBUFFER8, + // ppDSBuffer8: *mut LPDIRECTSOUNDBUFFER8, + // pUnkOuter: LPUNKNOWN, + // ) -> HRESULT; + pub fn GetDeviceID( + pGuidSrc: LPCGUID, + pGuidDest: LPGUID, + ) -> HRESULT; +} +DEFINE_GUID!{DS3DALG_NO_VIRTUALIZATION, + 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x00, 0xc0, 0x4f, 0xc2, 0x8a, 0xca} +DEFINE_GUID!{DS3DALG_HRTF_FULL, + 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x00, 0xc0, 0x4f, 0xc2, 0x8a, 0xca} +DEFINE_GUID!{DS3DALG_HRTF_LIGHT, + 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x00, 0xc0, 0x4f, 0xc2, 0x8a, 0xca} +DEFINE_GUID!{GUID_DSFX_STANDARD_GARGLE, + 0xdafd8210, 0x5711, 0x4b91, 0x9f, 0xe3, 0xf7, 0x5b, 0x7a, 0xe2, 0x79, 0xbf} +DEFINE_GUID!{GUID_DSFX_STANDARD_CHORUS, + 0xefe6629c, 0x81f7, 0x4281, 0xbd, 0x91, 0xc9, 0xd6, 0x04, 0xa9, 0x5a, 0xf6} +DEFINE_GUID!{GUID_DSFX_STANDARD_FLANGER, + 0xefca3d92, 0xdfd8, 0x4672, 0xa6, 0x03, 0x74, 0x20, 0x89, 0x4b, 0xad, 0x98} +DEFINE_GUID!{GUID_DSFX_STANDARD_ECHO, + 0xef3e932c, 0xd40b, 0x4f51, 0x8c, 0xcf, 0x3f, 0x98, 0xf1, 0xb2, 0x9d, 0x5d} +DEFINE_GUID!{GUID_DSFX_STANDARD_DISTORTION, + 0xef114c90, 0xcd1d, 0x484e, 0x96, 0xe5, 0x09, 0xcf, 0xaf, 0x91, 0x2a, 0x21} +DEFINE_GUID!{GUID_DSFX_STANDARD_COMPRESSOR, + 0xef011f79, 0x4000, 0x406d, 0x87, 0xaf, 0xbf, 0xfb, 0x3f, 0xc3, 0x9d, 0x57} +DEFINE_GUID!{GUID_DSFX_STANDARD_PARAMEQ, + 0x120ced89, 0x3bf4, 0x4173, 0xa1, 0x32, 0x3c, 0xb4, 0x06, 0xcf, 0x32, 0x31} +DEFINE_GUID!{GUID_DSFX_STANDARD_I3DL2REVERB, + 0xef985e71, 0xd5c7, 0x42d4, 0xba, 0x4d, 0x2d, 0x07, 0x3e, 0x2e, 0x96, 0xf4} +DEFINE_GUID!{GUID_DSFX_WAVES_REVERB, + 0x87fc0268, 0x9a55, 0x4360, 0x95, 0xaa, 0x00, 0x4a, 0x1d, 0x9d, 0xe2, 0x6c} +DEFINE_GUID!{GUID_DSCFX_CLASS_AEC, + 0xbf963d80, 0xc559, 0x11d0, 0x8a, 0x2b, 0x00, 0xa0, 0xc9, 0x25, 0x5a, 0xc1} +DEFINE_GUID!{GUID_DSCFX_MS_AEC, + 0xcdebb919, 0x379a, 0x488a, 0x87, 0x65, 0xf5, 0x3c, 0xfd, 0x36, 0xde, 0x40} +DEFINE_GUID!{GUID_DSCFX_SYSTEM_AEC, + 0x1c22c56d, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10} +DEFINE_GUID!{GUID_DSCFX_CLASS_NS, + 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5} +DEFINE_GUID!{GUID_DSCFX_MS_NS, + 0x11c5c73b, 0x66e9, 0x4ba1, 0xa0, 0xba, 0xe8, 0x14, 0xc6, 0xee, 0xd9, 0x2d} +DEFINE_GUID!{GUID_DSCFX_SYSTEM_NS, + 0x5ab0882e, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0} diff --git a/bash-5.1/vendor/winapi/src/um/dsrole.rs b/bash-5.1/vendor/winapi/src/um/dsrole.rs new file mode 100644 index 0000000000000000000000000000000000000000..b644d7994aeb8ca9370a261dbf944edc2f7c4e04 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dsrole.rs @@ -0,0 +1,66 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Contains public interfaces to query the network roles of workstations, servers, and DCs +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, PBYTE, ULONG}; +use um::winnt::{LPCWSTR, LPWSTR, PVOID}; +ENUM!{enum DSROLE_MACHINE_ROLE { + DsRole_RoleStandaloneWorkstation, + DsRole_RoleMemberWorkstation, + DsRole_RoleStandaloneServer, + DsRole_RoleMemberServer, + DsRole_RoleBackupDomainController, + DsRole_RolePrimaryDomainController, +}} +ENUM!{enum DSROLE_SERVER_STATE { + DsRoleServerUnknown = 0, + DsRoleServerPrimary, + DsRoleServerBackup, +}} +pub type PDSROLE_SERVER_STATE = *mut DSROLE_SERVER_STATE; +ENUM!{enum DSROLE_PRIMARY_DOMAIN_INFO_LEVEL { + DsRolePrimaryDomainInfoBasic = 1, + DsRoleUpgradeStatus, + DsRoleOperationState, +}} +pub const DSROLE_PRIMARY_DS_RUNNING: ULONG = 0x00000001; +pub const DSROLE_PRIMARY_DS_MIXED_MODE: ULONG = 0x00000002; +pub const DSROLE_UPGRADE_IN_PROGRESS: ULONG = 0x00000004; +pub const DSROLE_PRIMARY_DS_READONLY: ULONG = 0x00000008; +pub const DSROLE_PRIMARY_DOMAIN_GUID_PRESENT: ULONG = 0x01000000; +STRUCT!{struct DSROLE_PRIMARY_DOMAIN_INFO_BASIC { + MachineRole: DSROLE_MACHINE_ROLE, + Flags: ULONG, + DomainNameFlat: LPWSTR, + DomainNameDns: LPWSTR, + DomainForestName: LPWSTR, + DomainGuid: GUID, +}} +pub type PDSROLE_PRIMARY_DOMAIN_INFO_BASIC = *mut DSROLE_PRIMARY_DOMAIN_INFO_BASIC; +STRUCT!{struct DSROLE_UPGRADE_STATUS_INFO { + OperationState: ULONG, + PreviousServerState: DSROLE_SERVER_STATE, +}} +pub type PDSROLE_UPGRADE_STATUS_INFO = *mut DSROLE_UPGRADE_STATUS_INFO; +ENUM!{enum DSROLE_OPERATION_STATE { + DsRoleOperationIdle = 0, + DsRoleOperationActive, + DsRoleOperationNeedReboot, +}} +STRUCT!{struct DSROLE_OPERATION_STATE_INFO { + OperationState: DSROLE_OPERATION_STATE, +}} +pub type PDSROLE_OPERATION_STATE_INFO = *mut DSROLE_OPERATION_STATE_INFO; +extern "system" { + pub fn DsRoleGetPrimaryDomainInformation( + lpServer: LPCWSTR, + InfoLevel: DSROLE_PRIMARY_DOMAIN_INFO_LEVEL, + Buffer: *mut PBYTE, + ) -> DWORD; + pub fn DsRoleFreeMemory( + Buffer: PVOID, + ); +} diff --git a/bash-5.1/vendor/winapi/src/um/dvp.rs b/bash-5.1/vendor/winapi/src/um/dvp.rs new file mode 100644 index 0000000000000000000000000000000000000000..5760732e0df149181289144fa6b3d5ab74aaee4a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dvp.rs @@ -0,0 +1,25 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_IDDVideoPortContainer, + 0x6c142760, 0xa733, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} +DEFINE_GUID!{IID_IDirectDrawVideoPort, + 0xb36d93e0, 0x2b43, 0x11cf, 0xa2, 0xde, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} +DEFINE_GUID!{IID_IDirectDrawVideoPortNotify, + 0xa655fb94, 0x0589, 0x4e57, 0xb3, 0x33, 0x56, 0x7a, 0x89, 0x46, 0x8c, 0x88} +DEFINE_GUID!{DDVPTYPE_E_HREFH_VREFH, + 0x54f39980, 0xda60, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} +DEFINE_GUID!{DDVPTYPE_E_HREFH_VREFL, + 0x92783220, 0xda60, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} +DEFINE_GUID!{DDVPTYPE_E_HREFL_VREFH, + 0xa07a02e0, 0xda60, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} +DEFINE_GUID!{DDVPTYPE_E_HREFL_VREFL, + 0xe09c77e0, 0xda60, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} +DEFINE_GUID!{DDVPTYPE_CCIR656, + 0xfca326a0, 0xda60, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} +DEFINE_GUID!{DDVPTYPE_BROOKTREE, + 0x1352a560, 0xda61, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} +DEFINE_GUID!{DDVPTYPE_PHILIPS, + 0x332cf160, 0xda61, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} diff --git a/bash-5.1/vendor/winapi/src/um/dwmapi.rs b/bash-5.1/vendor/winapi/src/um/dwmapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..475473f9ac67a0abc8562b0651662a3b2b1e8bbf --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dwmapi.rs @@ -0,0 +1,295 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Procedure declarations, constant definitions, and macros for the NLS component. +use shared::basetsd::UINT32; +use shared::minwindef::{ + BOOL, BYTE, DWORD, HRGN, INT, LPARAM, LPCVOID, LPVOID, LRESULT, UINT, WPARAM +}; +use shared::windef::{HBITMAP, HWND, POINT, PSIZE, RECT}; +use um::uxtheme::MARGINS; +use um::winnt::{HANDLE, HRESULT, ULONGLONG}; +pub const DWM_BB_ENABLE: DWORD = 0x00000001; +pub const DWM_BB_BLURREGION: DWORD = 0x00000002; +pub const DWM_BB_TRANSITIONONMAXIMIZED: DWORD = 0x00000004; +STRUCT!{#[repr(packed)] struct DWM_BLURBEHIND { + dwFlags: DWORD, + fEnable: BOOL, + hRgnBlur: HRGN, + fTransitionOnMaximized: BOOL, +}} +ENUM!{enum DWMWINDOWATTRIBUTE { + DWMWA_NCRENDERING_ENABLED = 1, + DWMWA_NCRENDERING_POLICY = 2, + DWMWA_TRANSITIONS_FORCEDISABLED = 3, + DWMWA_ALLOW_NCPAINT = 4, + DWMWA_CAPTION_BUTTON_BOUNDS = 5, + DWMWA_NONCLIENT_RTL_LAYOUT = 6, + DWMWA_FORCE_ICONIC_REPRESENTATION = 7, + DWMWA_FLIP3D_POLICY = 8, + DWMWA_EXTENDED_FRAME_BOUNDS = 9, + DWMWA_HAS_ICONIC_BITMAP = 10, + DWMWA_DISALLOW_PEEK = 11, + DWMWA_EXCLUDED_FROM_PEEK = 12, + DWMWA_CLOAK = 13, + DWMWA_CLOAKED = 14, + DWMWA_FREEZE_REPRESENTATION = 15, + DWMWA_LAST = 16, +}} +ENUM!{enum DWMNCRENDERINGPOLICY { + DWMNCRP_USEWINDOWSTYLE = 0, + DWMNCRP_DISABLED = 1, + DWMNCRP_ENABLED = 2, + DWMNCRP_LAST = 3, +}} +ENUM!{enum DWMFLIP3DWINDOWPOLICY { + DWMFLIP3D_DEFAULT = 0, + DWMFLIP3D_EXCLUDEBELOW = 1, + DWMFLIP3D_EXCLUDEABOVE = 2, + DWMFLIP3D_LAST = 3, +}} +pub const DWM_CLOAKED_APP: u32 = 0x00000001; +pub const DWM_CLOAKED_SHELL: u32 = 0x00000002; +pub const DWM_CLOAKED_INHERITED: u32 = 0x00000004; +pub type HTHUMBNAIL = HANDLE; +pub type PHTHUMBNAIL = *mut HTHUMBNAIL; +pub const DWM_TNP_RECTDESTINATION: DWORD = 0x00000001; +pub const DWM_TNP_RECTSOURCE: DWORD = 0x00000002; +pub const DWM_TNP_OPACITY: DWORD = 0x00000004; +pub const DWM_TNP_VISIBLE: DWORD = 0x00000008; +pub const DWM_TNP_SOURCECLIENTAREAONLY: DWORD = 0x00000010; +STRUCT!{#[repr(packed)] struct DWM_THUMBNAIL_PROPERTIES { + dwFlags: DWORD, + rcDestination: RECT, + rcSource: RECT, + opacity: BYTE, + fVisible: BOOL, + fSourceClientAreaOnly: BOOL, +}} +pub type PDWM_THUMBNAIL_PROPERTIES = *mut DWM_THUMBNAIL_PROPERTIES; +pub type DWM_FRAME_COUNT = ULONGLONG; +pub type QPC_TIME = ULONGLONG; +STRUCT!{#[repr(packed)] struct UNSIGNED_RATIO { + uiNumerator: UINT32, + uiDenominator: UINT32, +}} +STRUCT!{#[repr(packed)] struct DWM_TIMING_INFO { + cbSize: UINT32, + rateRefresh: UNSIGNED_RATIO, + qpcRefreshPeriod: QPC_TIME, + rateCompose: UNSIGNED_RATIO, + qpcVBlank: QPC_TIME, + cRefresh: DWM_FRAME_COUNT, + cDXRefresh: UINT, + qpcCompose: QPC_TIME, + cFrame: DWM_FRAME_COUNT, + cDXPresent: UINT, + cRefreshFrame: DWM_FRAME_COUNT, + cFrameSubmitted: DWM_FRAME_COUNT, + cDXPresentSubmitted: UINT, + cFrameConfirmed: DWM_FRAME_COUNT, + cDXPresentConfirmed: UINT, + cRefreshConfirmed: DWM_FRAME_COUNT, + cDXRefreshConfirmed: UINT, + cFramesLate: DWM_FRAME_COUNT, + cFramesOutstanding: UINT, + cFrameDisplayed: DWM_FRAME_COUNT, + qpcFrameDisplayed: QPC_TIME, + cRefreshFrameDisplayed: DWM_FRAME_COUNT, + cFrameComplete: DWM_FRAME_COUNT, + qpcFrameComplete: QPC_TIME, + cFramePending: DWM_FRAME_COUNT, + qpcFramePending: QPC_TIME, + cFramesDisplayed: DWM_FRAME_COUNT, + cFramesComplete: DWM_FRAME_COUNT, + cFramesPending: DWM_FRAME_COUNT, + cFramesAvailable: DWM_FRAME_COUNT, + cFramesDropped: DWM_FRAME_COUNT, + cFramesMissed: DWM_FRAME_COUNT, + cRefreshNextDisplayed: DWM_FRAME_COUNT, + cRefreshNextPresented: DWM_FRAME_COUNT, + cRefreshesDisplayed: DWM_FRAME_COUNT, + cRefreshesPresented: DWM_FRAME_COUNT, + cRefreshStarted: DWM_FRAME_COUNT, + cPixelsReceived: ULONGLONG, + cPixelsDrawn: ULONGLONG, + cBuffersEmpty: DWM_FRAME_COUNT, +}} +ENUM!{enum DWM_SOURCE_FRAME_SAMPLING { + DWM_SOURCE_FRAME_SAMPLING_POINT = 0, + DWM_SOURCE_FRAME_SAMPLING_COVERAGE = 1, + DWM_SOURCE_FRAME_SAMPLING_LAST = 2, +}} +// pub const c_DwmMaxQueuedBuffers: UINT = 8; +// pub const c_DwmMaxMonitors: UINT = 16; +// pub const c_DwmMaxAdapters: UINT = 16; +STRUCT!{#[repr(packed)] struct DWM_PRESENT_PARAMETERS { + cbSize: UINT32, + fQueue: BOOL, + cRefreshStart: DWM_FRAME_COUNT, + cBuffer: UINT, + fUseSourceRate: BOOL, + rateSource: UNSIGNED_RATIO, + cRefreshesPerFrame: UINT, + eSampling: DWM_SOURCE_FRAME_SAMPLING, +}} +// pub const DWM_FRAME_DURATION_DEFAULT: i32 = -1; +extern "system" { + pub fn DwmDefWindowProc( + hWnd: HWND, + msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + plResult: *mut LRESULT, + ) -> BOOL; + pub fn DwmEnableBlurBehindWindow( + hWnd: HWND, + pBlurBehind: *const DWM_BLURBEHIND, + ) -> HRESULT; +} +pub const DWM_EC_DISABLECOMPOSITION: UINT = 0; +pub const DWM_EC_ENABLECOMPOSITION: UINT = 1; +extern "system" { + pub fn DwmEnableComposition( + uCompositionAction: UINT, + ) -> HRESULT; + pub fn DwmEnableMMCSS( + fEnableMMCSS: BOOL, + ) -> HRESULT; + pub fn DwmExtendFrameIntoClientArea( + hWnd: HWND, + pMarInset: *const MARGINS, + ) -> HRESULT; + pub fn DwmGetColorizationColor( + pcrColorization: *mut DWORD, + pfOpaqueBlend: *mut BOOL, + ) -> HRESULT; + pub fn DwmGetCompositionTimingInfo( + hWnd: HWND, + pTimingInfo: *mut DWM_TIMING_INFO, + ) -> HRESULT; + pub fn DwmGetWindowAttribute( + hWnd: HWND, + dwAttribute: DWORD, + pvAttribute: LPVOID, + cbAttribute: DWORD, + ) -> HRESULT; + pub fn DwmIsCompositionEnabled( + pfEnabled: *mut BOOL, + ) -> HRESULT; + pub fn DwmModifyPreviousDxFrameDuration( + hwnd: HWND, + cRefreshes: INT, + fRelative: BOOL, + ) -> HRESULT; + pub fn DwmQueryThumbnailSourceSize( + hThumbnail: HTHUMBNAIL, + pSize: PSIZE, + ) -> HRESULT; + pub fn DwmRegisterThumbnail( + hwndDestination: HWND, + hwndSource: HWND, + phThumbnailId: PHTHUMBNAIL, + ) -> HRESULT; + pub fn DwmSetDxFrameDuration( + hwnd: HWND, + cRefreshes: INT, + ) -> HRESULT; + pub fn DwmSetPresentParameters( + hwnd: HWND, + pPresentParams: *mut DWM_PRESENT_PARAMETERS, + ) -> HRESULT; + pub fn DwmSetWindowAttribute( + hWnd: HWND, + dwAttribute: DWORD, + pvAttribute: LPCVOID, + cbAttribute: DWORD, + ) -> HRESULT; + pub fn DwmUnregisterThumbnail( + hThumbnailId: HTHUMBNAIL, + ) -> HRESULT; + pub fn DwmUpdateThumbnailProperties( + hThumbnailId: HTHUMBNAIL, + ptnProperties: *const DWM_THUMBNAIL_PROPERTIES, + ) -> HRESULT; +} +pub const DWM_SIT_DISPLAYFRAME: DWORD = 0x00000001; +extern "system" { + pub fn DwmSetIconicThumbnail( + hwnd: HWND, + hbmp: HBITMAP, + dwSITFlags: DWORD, + ) -> HRESULT; + pub fn DwmSetIconicLivePreviewBitmap( + hwnd: HWND, + hbmp: HBITMAP, + pptClient: *mut POINT, + dwSITFlags: DWORD, + ) -> HRESULT; + pub fn DwmInvalidateIconicBitmaps( + hwnd: HWND, + ) -> HRESULT; + // pub fn DwmAttachMilContent(hwnd: HWND) -> HRESULT; + // pub fn DwmDetachMilContent(hwnd: HWND) -> HRESULT; + pub fn DwmFlush() -> HRESULT; + // pub fn DwmGetGraphicsStreamTransformHint(); + // pub fn DwmGetGraphicsStreamClient(); + pub fn DwmGetTransportAttributes( + pfIsRemoting: *mut BOOL, + pfIsConnected: *mut BOOL, + pDwGeneration: *mut DWORD, + ) -> HRESULT; +} +ENUM!{enum DWMTRANSITION_OWNEDWINDOW_TARGET { + DWMTRANSITION_OWNEDWINDOW_NULL = -1i32 as u32, + DWMTRANSITION_OWNEDWINDOW_REPOSITION = 0, +}} +extern "system" { + pub fn DwmTransitionOwnedWindow( + hwnd: HWND, + target: DWMTRANSITION_OWNEDWINDOW_TARGET, + ) -> HRESULT; +} +ENUM!{enum GESTURE_TYPE { + GT_PEN_TAP = 0, + GT_PEN_DOUBLETAP = 1, + GT_PEN_RIGHTTAP = 2, + GT_PEN_PRESSANDHOLD = 3, + GT_PEN_PRESSANDHOLDABORT = 4, + GT_TOUCH_TAP = 5, + GT_TOUCH_DOUBLETAP = 6, + GT_TOUCH_RIGHTTAP = 7, + GT_TOUCH_PRESSANDHOLD = 8, + GT_TOUCH_PRESSANDHOLDABORT = 9, + GT_TOUCH_PRESSANDTAP = 10, +}} +extern "system" { + pub fn DwmRenderGesture( + gt: GESTURE_TYPE, + cContacts: UINT, + pdwPointerID: *const DWORD, + pPoints: *const POINT, + ) -> HRESULT; + pub fn DwmTetherContact( + dwPointerID: DWORD, + fEnable: BOOL, + ptTether: POINT, + ) -> HRESULT; +} +ENUM!{enum DWM_SHOWCONTACT { + DWMSC_DOWN = 0x00000001, + DWMSC_UP = 0x00000002, + DWMSC_DRAG = 0x00000004, + DWMSC_HOLD = 0x00000008, + DWMSC_PENBARREL = 0x00000010, + DWMSC_NONE = 0x00000000, + DWMSC_ALL = 0xFFFFFFFF, +}} +extern "system" { + pub fn DwmShowContact( + dwPointerID: DWORD, + eShowContact: DWM_SHOWCONTACT, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/dwrite.rs b/bash-5.1/vendor/winapi/src/um/dwrite.rs new file mode 100644 index 0000000000000000000000000000000000000000..b21cd6f8d2f64eb5b645812a0ccd0073cd405f7a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dwrite.rs @@ -0,0 +1,1477 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! DirectX Typography Services public API definitions. +use ctypes::c_void; +use shared::basetsd::{INT16, INT32, UINT16, UINT32, UINT64, UINT8}; +use shared::guiddef::REFIID; +use shared::minwindef::{BOOL, BYTE, FILETIME, FLOAT}; +use shared::windef::{COLORREF, HDC, HMONITOR, RECT, SIZE}; +use shared::winerror::SEVERITY_ERROR; +use um::d2d1::ID2D1SimplifiedGeometrySink; +use um::dcommon::DWRITE_MEASURING_MODE; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::wingdi::LOGFONTW; +use um::winnt::{HRESULT, WCHAR}; +ENUM!{enum DWRITE_FONT_FILE_TYPE { + DWRITE_FONT_FILE_TYPE_UNKNOWN, + DWRITE_FONT_FILE_TYPE_CFF, + DWRITE_FONT_FILE_TYPE_TRUETYPE, + DWRITE_FONT_FILE_TYPE_OPENTYPE_COLLECTION, + DWRITE_FONT_FILE_TYPE_TYPE1_PFM, + DWRITE_FONT_FILE_TYPE_TYPE1_PFB, + DWRITE_FONT_FILE_TYPE_VECTOR, + DWRITE_FONT_FILE_TYPE_BITMAP, + DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION = DWRITE_FONT_FILE_TYPE_OPENTYPE_COLLECTION, +}} +ENUM!{enum DWRITE_FONT_FACE_TYPE { + DWRITE_FONT_FACE_TYPE_CFF, + DWRITE_FONT_FACE_TYPE_TRUETYPE, + DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION, + DWRITE_FONT_FACE_TYPE_TYPE1, + DWRITE_FONT_FACE_TYPE_VECTOR, + DWRITE_FONT_FACE_TYPE_BITMAP, + DWRITE_FONT_FACE_TYPE_UNKNOWN, + DWRITE_FONT_FACE_TYPE_RAW_CFF, + DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION = DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION, +}} +ENUM!{enum DWRITE_FONT_SIMULATIONS { + DWRITE_FONT_SIMULATIONS_NONE = 0x0000, + DWRITE_FONT_SIMULATIONS_BOLD = 0x0001, + DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002, +}} +ENUM!{enum DWRITE_FONT_WEIGHT { + DWRITE_FONT_WEIGHT_THIN = 100, + DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200, + DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200, + DWRITE_FONT_WEIGHT_LIGHT = 300, + DWRITE_FONT_WEIGHT_SEMI_LIGHT = 350, + DWRITE_FONT_WEIGHT_NORMAL = 400, + DWRITE_FONT_WEIGHT_REGULAR = 400, + DWRITE_FONT_WEIGHT_MEDIUM = 500, + DWRITE_FONT_WEIGHT_DEMI_BOLD = 600, + DWRITE_FONT_WEIGHT_SEMI_BOLD = 600, + DWRITE_FONT_WEIGHT_BOLD = 700, + DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800, + DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800, + DWRITE_FONT_WEIGHT_BLACK = 900, + DWRITE_FONT_WEIGHT_HEAVY = 900, + DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950, + DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950, +}} +ENUM!{enum DWRITE_FONT_STRETCH { + DWRITE_FONT_STRETCH_UNDEFINED = 0, + DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1, + DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2, + DWRITE_FONT_STRETCH_CONDENSED = 3, + DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4, + DWRITE_FONT_STRETCH_NORMAL = 5, + DWRITE_FONT_STRETCH_MEDIUM = 5, + DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6, + DWRITE_FONT_STRETCH_EXPANDED = 7, + DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8, + DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9, +}} +ENUM!{enum DWRITE_FONT_STYLE { + DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STYLE_OBLIQUE, + DWRITE_FONT_STYLE_ITALIC, +}} +ENUM!{enum DWRITE_INFORMATIONAL_STRING_ID { + DWRITE_INFORMATIONAL_STRING_NONE, + DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE, + DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS, + DWRITE_INFORMATIONAL_STRING_TRADEMARK, + DWRITE_INFORMATIONAL_STRING_MANUFACTURER, + DWRITE_INFORMATIONAL_STRING_DESIGNER, + DWRITE_INFORMATIONAL_STRING_DESIGNER_URL, + DWRITE_INFORMATIONAL_STRING_DESCRIPTION, + DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL, + DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION, + DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL, + DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, + DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES, + DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES, + DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES, + DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT, + DWRITE_INFORMATIONAL_STRING_FULL_NAME, + DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME, + DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME, + DWRITE_INFORMATIONAL_STRING_WWS_FAMILY_NAME, + DWRITE_INFORMATIONAL_STRING_DESIGN_SCRIPT_LANGUAGE_TAG, + DWRITE_INFORMATIONAL_STRING_SUPPORTED_SCRIPT_LANGUAGE_TAG, +}} +STRUCT!{struct DWRITE_FONT_METRICS { + designUnitsPerEm: UINT16, + ascent: UINT16, + descent: UINT16, + lineGap: INT16, + capHeight: UINT16, + xHeight: UINT16, + underlinePosition: INT16, + underlineThickness: UINT16, + strikethroughPosition: INT16, + strikethroughThickness: UINT16, +}} +STRUCT!{struct DWRITE_GLYPH_METRICS { + leftSideBearing: INT32, + advanceWidth: UINT32, + rightSideBearing: INT32, + topSideBearing: INT32, + advanceHeight: UINT32, + bottomSideBearing: INT32, + verticalOriginY: INT32, +}} +STRUCT!{struct DWRITE_GLYPH_OFFSET { + advanceOffset: FLOAT, + ascenderOffset: FLOAT, +}} +ENUM!{enum DWRITE_FACTORY_TYPE { + DWRITE_FACTORY_TYPE_SHARED, + DWRITE_FACTORY_TYPE_ISOLATED, +}} +RIDL!{#[uuid(0x727cad4e, 0xd6af, 0x4c9e, 0x8a, 0x08, 0xd6, 0x95, 0xb1, 0x1c, 0xaa, 0x49)] +interface IDWriteFontFileLoader(IDWriteFontFileLoaderVtbl): IUnknown(IUnknownVtbl) { + fn CreateStreamFromKey( + fontFileReferenceKey: *const c_void, + fontFileReferenceKeySize: UINT32, + fontFileStream: *mut *mut IDWriteFontFileStream, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb2d9f3ec, 0xc9fe, 0x4a11, 0xa2, 0xec, 0xd8, 0x62, 0x08, 0xf7, 0xc0, 0xa2)] +interface IDWriteLocalFontFileLoader(IDWriteLocalFontFileLoaderVtbl): + IDWriteFontFileLoader(IDWriteFontFileLoaderVtbl) { + fn GetFilePathLengthFromKey( + fontFileReferenceKey: *const c_void, + fontFileReferenceKeySize: UINT32, + filePathLength: *mut UINT32, + ) -> HRESULT, + fn GetFilePathFromKey( + fontFileReferenceKey: *const c_void, + fontFileReferenceKeySize: UINT32, + filePath: *mut WCHAR, + filePathSize: UINT32, + ) -> HRESULT, + fn GetLastWriteTimeFromKey( + fontFileReferenceKey: *const c_void, + fontFileReferenceKeySize: UINT32, + lastWriteTime: *mut FILETIME, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6d4865fe, 0x0ab8, 0x4d91, 0x8f, 0x62, 0x5d, 0xd6, 0xbe, 0x34, 0xa3, 0xe0)] +interface IDWriteFontFileStream(IDWriteFontFileStreamVtbl): IUnknown(IUnknownVtbl) { + fn ReadFileFragment( + fragmentStart: *mut *const c_void, + fileOffset: UINT64, + fragmentSize: UINT64, + fragmentContext: *mut *mut c_void, + ) -> HRESULT, + fn ReleaseFileFragment( + fragmentContext: *mut c_void, + ) -> (), + fn GetFileSize( + fileSize: *mut UINT64, + ) -> HRESULT, + fn GetLastWriteTime( + lastWriteTime: *mut UINT64, + ) -> HRESULT, +}} +ENUM!{enum DWRITE_OUTLINE_THRESHOLD { + DWRITE_OUTLINE_THRESHOLD_ANTIALIASED, + DWRITE_OUTLINE_THRESHOLD_ALIASED, +}} +STRUCT!{struct DWRITE_FONT_METRICS1 { + designUnitsPerEm: UINT16, + ascent: UINT16, + descent: UINT16, + lineGap: INT16, + capHeight: UINT16, + xHeight: UINT16, + underlinePosition: INT16, + underlineThickness: UINT16, + strikethroughPosition: INT16, + strikethroughThickness: UINT16, + glyphBoxLeft: INT16, + glyphBoxTop: INT16, + glyphBoxRight: INT16, + glyphBoxBottom: INT16, + subscriptPositionX: INT16, + subscriptPositionY: INT16, + subscriptSizeX: INT16, + subscriptSizeY: INT16, + superscriptPositionX: INT16, + superscriptPositionY: INT16, + superscriptSizeX: INT16, + superscriptSizeY: INT16, + hasTypographicMetrics: BOOL, +}} +STRUCT!{struct DWRITE_UNICODE_RANGE { + first: UINT32, + last: UINT32, +}} +STRUCT!{struct DWRITE_CARET_METRICS { + slopeRise: INT16, + slopeRun: INT16, + offset: INT16, +}} +#[inline] +pub fn DWRITE_MAKE_OPENTYPE_TAG(a: u8, b: u8, c: u8, d: u8) -> u32 { + ((d as u32) << 24) | ((c as u32) << 16) | ((b as u32) << 8) | (a as u32) +} +RIDL!{#[uuid(0x739d886a, 0xcef5, 0x47dc, 0x87, 0x69, 0x1a, 0x8b, 0x41, 0xbe, 0xbb, 0xb0)] +interface IDWriteFontFile(IDWriteFontFileVtbl): IUnknown(IUnknownVtbl) { + fn GetReferenceKey( + fontFileReferenceKey: *mut *const c_void, + fontFileReferenceKeySize: *mut UINT32, + ) -> HRESULT, + fn GetLoader( + fontFileLoader: *mut *mut IDWriteFontFileLoader, + ) -> HRESULT, + fn Analyze( + isSupportedFontType: *mut BOOL, + fontFileType: *mut DWRITE_FONT_FILE_TYPE, + fontFaceType: *mut DWRITE_FONT_FACE_TYPE, + numberOfFaces: *mut UINT32, + ) -> HRESULT, +}} +ENUM!{enum DWRITE_PIXEL_GEOMETRY { + DWRITE_PIXEL_GEOMETRY_FLAT, + DWRITE_PIXEL_GEOMETRY_RGB, + DWRITE_PIXEL_GEOMETRY_BGR, +}} +ENUM!{enum DWRITE_RENDERING_MODE { + DWRITE_RENDERING_MODE_DEFAULT, + DWRITE_RENDERING_MODE_ALIASED, + DWRITE_RENDERING_MODE_GDI_CLASSIC, + DWRITE_RENDERING_MODE_GDI_NATURAL, + DWRITE_RENDERING_MODE_NATURAL, + DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, + DWRITE_RENDERING_MODE_OUTLINE, + DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC = DWRITE_RENDERING_MODE_GDI_CLASSIC, + DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL = DWRITE_RENDERING_MODE_GDI_NATURAL, + DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL = DWRITE_RENDERING_MODE_NATURAL, + DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC = DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, +}} +STRUCT!{struct DWRITE_MATRIX { + m11: FLOAT, + m12: FLOAT, + m21: FLOAT, + m22: FLOAT, + dx: FLOAT, + dy: FLOAT, +}} +RIDL!{#[uuid(0x2f0da53a, 0x2add, 0x47cd, 0x82, 0xee, 0xd9, 0xec, 0x34, 0x68, 0x8e, 0x75)] +interface IDWriteRenderingParams(IDWriteRenderingParamsVtbl): IUnknown(IUnknownVtbl) { + fn GetGamma() -> FLOAT, + fn GetEnhancedContrast() -> FLOAT, + fn GetClearTypeLevel() -> FLOAT, + fn GetPixelGeometry() -> DWRITE_PIXEL_GEOMETRY, + fn GetRenderingMode() -> DWRITE_RENDERING_MODE, +}} +pub type IDWriteGeometrySink = ID2D1SimplifiedGeometrySink; +RIDL!{#[uuid(0x5f49804d, 0x7024, 0x4d43, 0xbf, 0xa9, 0xd2, 0x59, 0x84, 0xf5, 0x38, 0x49)] +interface IDWriteFontFace(IDWriteFontFaceVtbl): IUnknown(IUnknownVtbl) { + fn GetType() -> DWRITE_FONT_FACE_TYPE, + fn GetFiles( + numberOfFiles: *mut UINT32, + fontFiles: *mut *mut IDWriteFontFile, + ) -> HRESULT, + fn GetIndex() -> UINT32, + fn GetSimulations() -> DWRITE_FONT_SIMULATIONS, + fn IsSymbolFont() -> BOOL, + fn GetMetrics( + fontFaceMetrics: *mut DWRITE_FONT_METRICS, + ) -> (), + fn GetGlyphCount() -> UINT16, + fn GetDesignGlyphMetrics( + glyphIndices: *const UINT16, + glyphCount: UINT32, + glyphMetrics: *mut DWRITE_GLYPH_METRICS, + isSideways: BOOL, + ) -> HRESULT, + fn GetGlyphIndices( + codePoints: *const UINT32, + codePointCount: UINT32, + glyphIndices: *mut UINT16, + ) -> HRESULT, + fn TryGetFontTable( + openTypeTableTag: UINT32, + tableData: *mut *const c_void, + tableSize: *mut UINT32, + tableContext: *mut *mut c_void, + exists: *mut BOOL, + ) -> HRESULT, + fn ReleaseFontTable( + tableContext: *mut c_void, + ) -> HRESULT, + fn GetGlyphRunOutline( + emSize: FLOAT, + glyphIndices: *const UINT16, + glyphAdvances: *const FLOAT, + glyphOffsets: *const DWRITE_GLYPH_OFFSET, + glyphCount: UINT32, + isSideways: BOOL, + isRightToLeft: BOOL, + geometrySink: *mut IDWriteGeometrySink, + ) -> HRESULT, + fn GetRecommendedRenderingMode( + emSize: FLOAT, + pixelsPerDip: FLOAT, + measuringMode: DWRITE_MEASURING_MODE, + renderingParams: *mut IDWriteRenderingParams, + renderingMode: *mut DWRITE_RENDERING_MODE, + ) -> HRESULT, + fn GetGdiCompatibleMetrics( + emSize: FLOAT, + pixelsPerDip: FLOAT, + transform: *const DWRITE_MATRIX, + fontFaceMetrics: *mut DWRITE_FONT_METRICS, + ) -> HRESULT, + fn GetGdiCompatibleGlyphMetrics( + enSize: FLOAT, + pixelsPerDip: FLOAT, + transform: *const DWRITE_MATRIX, + useGdiNatrual: BOOL, + glyphIndices: *const UINT16, + glyphCount: UINT32, + glyphMetrics: *mut DWRITE_GLYPH_METRICS, + isSideways: BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa71efdb4, 0x9fdb, 0x4838, 0xad, 0x90, 0xcf, 0xc3, 0xbe, 0x8c, 0x3d, 0xaf)] +interface IDWriteFontFace1(IDWriteFontFace1Vtbl): IDWriteFontFace(IDWriteFontFaceVtbl) { + fn GetMetrics( + fontFaceMetrics: *mut DWRITE_FONT_METRICS1, + ) -> (), + fn GetGdiCompatibleMetrics( + emSize: FLOAT, + pixelsPerDip: FLOAT, + transform: *const DWRITE_MATRIX, + fontFaceMetrics: *mut DWRITE_FONT_METRICS1, + ) -> HRESULT, + fn GetCaretMetrics( + caretMetrics: *mut DWRITE_CARET_METRICS, + ) -> (), + fn GetUnicodeRanges( + maxRangeCount: UINT32, + unicodeRanges: *mut DWRITE_UNICODE_RANGE, + actualRangeCount: *mut UINT32, + ) -> HRESULT, + fn IsMonoSpacedFont() -> BOOL, + fn GetDesignGlyphAdvances( + glyphCount: UINT32, + glyphIndices: *const UINT16, + glyphAdvances: *mut INT32, + isSideways: BOOL, + ) -> HRESULT, + fn GetGdiCompatibleGlyphAdvance( + emSize: FLOAT, + pixelsPerDip: FLOAT, + transform: *const DWRITE_MATRIX, + useGdiNatural: BOOL, + isSideways: BOOL, + glyphCount: UINT32, + glyphIndices: *const UINT16, + glyphAdvances: *mut INT32, + ) -> HRESULT, + fn GetKerningPairAdjustments( + glyphCount: UINT32, + glyphIndices: *const UINT16, + glyphAdvanceAdjustments: *mut INT32, + ) -> HRESULT, + fn HasKerningPairs() -> BOOL, + fn GetRecommendedRenderingMode( + fontEmSize: FLOAT, + dpiX: FLOAT, + dpiY: FLOAT, + transform: *const DWRITE_MATRIX, + isSideways: BOOL, + outlineThreshold: DWRITE_OUTLINE_THRESHOLD, + measuringMode: DWRITE_MEASURING_MODE, + renderingMode: *mut DWRITE_RENDERING_MODE, + ) -> HRESULT, + fn GetVerticalGlyphVariants( + nominalGlyphIndices: *const UINT16, + verticalGlyphIndices: *mut UINT16, + ) -> HRESULT, + fn HasVerticalGlyphVariants() -> BOOL, +}} +RIDL!{#[uuid(0xcca920e4, 0x52f0, 0x492b, 0xbf, 0xa8, 0x29, 0xc7, 0x2e, 0xe0, 0xa4, 0x68)] +interface IDWriteFontCollectionLoader(IDWriteFontCollectionLoaderVtbl): + IUnknown(IUnknownVtbl) { + fn CreateEnumeratorFromKey( + factory: *mut IDWriteFactory, + collectionKey: *const c_void, + collectionKeySize: UINT32, + fontFileEnumerator: *mut *mut IDWriteFontFileEnumerator, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x72755049, 0x5ff7, 0x435d, 0x83, 0x48, 0x4b, 0xe9, 0x7c, 0xfa, 0x6c, 0x7c)] +interface IDWriteFontFileEnumerator(IDWriteFontFileEnumeratorVtbl): IUnknown(IUnknownVtbl) { + fn MoveNext( + hasCurrentFile: *mut BOOL, + ) -> HRESULT, + fn GetCurrentFontFile( + fontFile: *mut *mut IDWriteFontFile, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x08256209, 0x099a, 0x4b34, 0xb8, 0x6d, 0xc2, 0x2b, 0x11, 0x0e, 0x77, 0x71)] +interface IDWriteLocalizedStrings(IDWriteLocalizedStringsVtbl): IUnknown(IUnknownVtbl) { + fn GetCount() -> UINT32, + fn FindLocaleName( + localeName: *const WCHAR, + index: *mut UINT32, + exists: *mut BOOL, + ) -> HRESULT, + fn GetLocaleNameLength( + index: UINT32, + length: *mut UINT32, + ) -> HRESULT, + fn GetLocaleName( + index: UINT32, + localeName: *mut WCHAR, + size: UINT32, + ) -> HRESULT, + fn GetStringLength( + index: UINT32, + length: *mut UINT32, + ) -> HRESULT, + fn GetString( + index: UINT32, + stringBuffer: *mut WCHAR, + size: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa84cee02, 0x3eea, 0x4eee, 0xa8, 0x27, 0x87, 0xc1, 0xa0, 0x2a, 0x0f, 0xcc)] +interface IDWriteFontCollection(IDWriteFontCollectionVtbl): IUnknown(IUnknownVtbl) { + fn GetFontFamilyCount() -> UINT32, + fn GetFontFamily( + index: UINT32, + fontFamily: *mut *mut IDWriteFontFamily, + ) -> HRESULT, + fn FindFamilyName( + familyName: *const WCHAR, + index: *mut UINT32, + exists: *mut BOOL, + ) -> HRESULT, + fn GetFontFromFontFace( + fontFace: *mut IDWriteFontFace, + font: *mut *mut IDWriteFont, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1a0d8438, 0x1d97, 0x4ec1, 0xae, 0xf9, 0xa2, 0xfb, 0x86, 0xed, 0x6a, 0xcb)] +interface IDWriteFontList(IDWriteFontListVtbl): IUnknown(IUnknownVtbl) { + fn GetFontCollection( + fontCollection: *mut *mut IDWriteFontCollection, + ) -> HRESULT, + fn GetFontCount() -> UINT32, + fn GetFont( + index: UINT32, + font: *mut *mut IDWriteFont, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xda20d8ef, 0x812a, 0x4c43, 0x98, 0x02, 0x62, 0xec, 0x4a, 0xbd, 0x7a, 0xdd)] +interface IDWriteFontFamily(IDWriteFontFamilyVtbl): IDWriteFontList(IDWriteFontListVtbl) { + fn GetFamilyNames( + names: *mut *mut IDWriteLocalizedStrings, + ) -> HRESULT, + fn GetFirstMatchingFont( + weight: DWRITE_FONT_WEIGHT, + stretch: DWRITE_FONT_STRETCH, + style: DWRITE_FONT_STYLE, + matchingFont: *mut *mut IDWriteFont, + ) -> HRESULT, + fn GetMatchingFonts( + weight: DWRITE_FONT_WEIGHT, + stretch: DWRITE_FONT_STRETCH, + style: DWRITE_FONT_STYLE, + matchingFonts: *mut *mut IDWriteFontList, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xacd16696, 0x8c14, 0x4f5d, 0x87, 0x7e, 0xfe, 0x3f, 0xc1, 0xd3, 0x27, 0x37)] +interface IDWriteFont(IDWriteFontVtbl): IUnknown(IUnknownVtbl) { + fn GetFontFamily( + fontFamily: *mut *mut IDWriteFontFamily, + ) -> HRESULT, + fn GetWeight() -> DWRITE_FONT_WEIGHT, + fn GetStretch() -> DWRITE_FONT_STRETCH, + fn GetStyle() -> DWRITE_FONT_STYLE, + fn IsSymbolFont() -> BOOL, + fn GetFaceNames( + names: *mut *mut IDWriteLocalizedStrings, + ) -> HRESULT, + fn GetInformationalStrings( + informationalStringId: DWRITE_INFORMATIONAL_STRING_ID, + informationalStrings: *mut *mut IDWriteLocalizedStrings, + exists: *mut BOOL, + ) -> HRESULT, + fn GetSimulations() -> DWRITE_FONT_SIMULATIONS, + fn GetMetrics( + fontMetrics: *mut DWRITE_FONT_METRICS, + ) -> (), + fn HasCharacter( + unicodeValue: UINT32, + exists: *mut BOOL, + ) -> HRESULT, + fn CreateFontFace( + fontFace: *mut *mut IDWriteFontFace, + ) -> HRESULT, +}} +ENUM!{enum DWRITE_READING_DIRECTION { + DWRITE_READING_DIRECTION_LEFT_TO_RIGHT = 0, + DWRITE_READING_DIRECTION_RIGHT_TO_LEFT = 1, + DWRITE_READING_DIRECTION_TOP_TO_BOTTOM = 2, + DWRITE_READING_DIRECTION_BOTTOM_TO_TOP = 3, +}} +ENUM!{enum DWRITE_FLOW_DIRECTION { + DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM = 0, + DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP = 1, + DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT = 2, + DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT = 3, +}} +ENUM!{enum DWRITE_TEXT_ALIGNMENT { + DWRITE_TEXT_ALIGNMENT_LEADING, + DWRITE_TEXT_ALIGNMENT_TRAILING, + DWRITE_TEXT_ALIGNMENT_CENTER, + DWRITE_TEXT_ALIGNMENT_JUSTIFIED, +}} +ENUM!{enum DWRITE_PARAGRAPH_ALIGNMENT { + DWRITE_PARAGRAPH_ALIGNMENT_NEAR, + DWRITE_PARAGRAPH_ALIGNMENT_FAR, + DWRITE_PARAGRAPH_ALIGNMENT_CENTER, +}} +ENUM!{enum DWRITE_WORD_WRAPPING { + DWRITE_WORD_WRAPPING_WRAP = 0, + DWRITE_WORD_WRAPPING_NO_WRAP = 1, + DWRITE_WORD_WRAPPING_EMERGENCY_BREAK = 2, + DWRITE_WORD_WRAPPING_WHOLE_WORD = 3, + DWRITE_WORD_WRAPPING_CHARACTER = 4, +}} +ENUM!{enum DWRITE_LINE_SPACING_METHOD { + DWRITE_LINE_SPACING_METHOD_DEFAULT, + DWRITE_LINE_SPACING_METHOD_UNIFORM, + DWRITE_LINE_SPACING_METHOD_PROPORTIONAL, +}} +ENUM!{enum DWRITE_TRIMMING_GRANULARITY { + DWRITE_TRIMMING_GRANULARITY_NONE, + DWRITE_TRIMMING_GRANULARITY_CHARACTER, + DWRITE_TRIMMING_GRANULARITY_WORD, +}} +ENUM!{enum DWRITE_FONT_FEATURE_TAG { + DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS = 0x63726661, // 'afrc' + DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS = 0x63703263, // 'c2pc' + DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS = 0x63733263, // 'c2sc' + DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES = 0x746c6163, // 'calt' + DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS = 0x65736163, // 'case' + DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION = 0x706d6363, // 'ccmp' + DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES = 0x67696c63, // 'clig' + DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING = 0x70737063, // 'cpsp' + DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH = 0x68777363, // 'cswh' + DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING = 0x73727563, // 'curs' + DWRITE_FONT_FEATURE_TAG_DEFAULT = 0x746c6664, // 'dflt' + DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES = 0x67696c64, // 'dlig' + DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS = 0x74707865, // 'expt' + DWRITE_FONT_FEATURE_TAG_FRACTIONS = 0x63617266, // 'frac' + DWRITE_FONT_FEATURE_TAG_FULL_WIDTH = 0x64697766, // 'fwid' + DWRITE_FONT_FEATURE_TAG_HALF_FORMS = 0x666c6168, // 'half' + DWRITE_FONT_FEATURE_TAG_HALANT_FORMS = 0x6e6c6168, // 'haln' + DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH = 0x746c6168, // 'halt' + DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS = 0x74736968, // 'hist' + DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES = 0x616e6b68, // 'hkna' + DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES = 0x67696c68, // 'hlig' + DWRITE_FONT_FEATURE_TAG_HALF_WIDTH = 0x64697768, // 'hwid' + DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS = 0x6f6a6f68, // 'hojo' + DWRITE_FONT_FEATURE_TAG_JIS04_FORMS = 0x3430706a, // 'jp04' + DWRITE_FONT_FEATURE_TAG_JIS78_FORMS = 0x3837706a, // 'jp78' + DWRITE_FONT_FEATURE_TAG_JIS83_FORMS = 0x3338706a, // 'jp83' + DWRITE_FONT_FEATURE_TAG_JIS90_FORMS = 0x3039706a, // 'jp90' + DWRITE_FONT_FEATURE_TAG_KERNING = 0x6e72656b, // 'kern' + DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES = 0x6167696c, // 'liga' + DWRITE_FONT_FEATURE_TAG_LINING_FIGURES = 0x6d756e6c, // 'lnum' + DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS = 0x6c636f6c, // 'locl' + DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING = 0x6b72616d, // 'mark' + DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK = 0x6b72676d, // 'mgrk' + DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING = 0x6b6d6b6d, // 'mkmk' + DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS = 0x746c616e, // 'nalt' + DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS = 0x6b636c6e, // 'nlck' + DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES = 0x6d756e6f, // 'onum' + DWRITE_FONT_FEATURE_TAG_ORDINALS = 0x6e64726f, // 'ordn' + DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH = 0x746c6170, // 'palt' + DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS = 0x70616370, // 'pcap' + DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES = 0x6d756e70, // 'pnum' + DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS = 0x64697770, // 'pwid' + DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS = 0x64697771, // 'qwid' + DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES = 0x67696c72, // 'rlig' + DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS = 0x79627572, // 'ruby' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES = 0x746c6173, // 'salt' + DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS = 0x666e6973, // 'sinf' + DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS = 0x70636d73, // 'smcp' + DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS = 0x6c706d73, // 'smpl' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1 = 0x31307373, // 'ss01' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2 = 0x32307373, // 'ss02' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3 = 0x33307373, // 'ss03' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4 = 0x34307373, // 'ss04' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5 = 0x35307373, // 'ss05' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6 = 0x36307373, // 'ss06' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7 = 0x37307373, // 'ss07' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8 = 0x38307373, // 'ss08' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9 = 0x39307373, // 'ss09' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10 = 0x30317373, // 'ss10' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11 = 0x31317373, // 'ss11' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12 = 0x32317373, // 'ss12' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13 = 0x33317373, // 'ss13' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14 = 0x34317373, // 'ss14' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15 = 0x35317373, // 'ss15' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16 = 0x36317373, // 'ss16' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17 = 0x37317373, // 'ss17' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18 = 0x38317373, // 'ss18' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19 = 0x39317373, // 'ss19' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = 0x30327373, // 'ss20' + DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = 0x73627573, // 'subs' + DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = 0x73707573, // 'sups' + DWRITE_FONT_FEATURE_TAG_SWASH = 0x68737773, // 'swsh' + DWRITE_FONT_FEATURE_TAG_TITLING = 0x6c746974, // 'titl' + DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = 0x6d616e74, // 'tnam' + DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = 0x6d756e74, // 'tnum' + DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = 0x64617274, // 'trad' + DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = 0x64697774, // 'twid' + DWRITE_FONT_FEATURE_TAG_UNICASE = 0x63696e75, // 'unic' + DWRITE_FONT_FEATURE_TAG_VERTICAL_WRITING = 0x74726576, // 'vert' + DWRITE_FONT_FEATURE_TAG_VERTICAL_ALTERNATES_AND_ROTATION = 0x32747276, // 'vrt2' + DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = 0x6f72657a, // 'zero' +}} +STRUCT!{struct DWRITE_TEXT_RANGE { + startPosition: UINT32, + length: UINT32, +}} +STRUCT!{struct DWRITE_FONT_FEATURE { + nameTag: DWRITE_FONT_FEATURE_TAG, + parameter: UINT32, +}} +STRUCT!{struct DWRITE_TYPOGRAPHIC_FEATURES { + features: *mut DWRITE_FONT_FEATURE, + featureCount: UINT32, +}} +STRUCT!{struct DWRITE_TRIMMING { + granularity: DWRITE_TRIMMING_GRANULARITY, + delimiter: UINT32, + delimiterCount: UINT32, +}} +RIDL!{#[uuid(0x9c906818, 0x31d7, 0x4fd3, 0xa1, 0x51, 0x7c, 0x5e, 0x22, 0x5d, 0xb5, 0x5a)] +interface IDWriteTextFormat(IDWriteTextFormatVtbl): IUnknown(IUnknownVtbl) { + fn SetTextAlignment( + textAlignment: DWRITE_TEXT_ALIGNMENT, + ) -> HRESULT, + fn SetParagraphAlignment( + paragraphAlignment: DWRITE_PARAGRAPH_ALIGNMENT, + ) -> HRESULT, + fn SetWordWrapping( + wordWrapping: DWRITE_WORD_WRAPPING, + ) -> HRESULT, + fn SetReadingDirection( + readingDirection: DWRITE_READING_DIRECTION, + ) -> HRESULT, + fn SetFlowDirection( + flowDirection: DWRITE_FLOW_DIRECTION, + ) -> HRESULT, + fn SetIncrementalTabStop( + incrementalTabStop: FLOAT, + ) -> HRESULT, + fn SetTrimming( + trimmingOptions: *const DWRITE_TRIMMING, + trimmingSign: *mut IDWriteInlineObject, + ) -> HRESULT, + fn SetLineSpacing( + lineSpacingMethod: DWRITE_LINE_SPACING_METHOD, + lineSpacing: FLOAT, + baseLine: FLOAT, + ) -> HRESULT, + fn GetTextAlignment() -> DWRITE_TEXT_ALIGNMENT, + fn GetParagraphAlignment() -> DWRITE_PARAGRAPH_ALIGNMENT, + fn GetWordWrapping() -> DWRITE_WORD_WRAPPING, + fn GetReadingDirection() -> DWRITE_READING_DIRECTION, + fn GetFlowDirection() -> DWRITE_FLOW_DIRECTION, + fn GetIncrementalTabStop() -> FLOAT, + fn GetTrimming( + trimmingOptions: *mut DWRITE_TRIMMING, + trimmingSign: *mut *mut IDWriteInlineObject, + ) -> HRESULT, + fn GetLineSpacing( + lineSpacingMethod: *mut DWRITE_LINE_SPACING_METHOD, + lineSpacing: *mut FLOAT, + baseline: *mut FLOAT, + ) -> HRESULT, + fn GetFontCollection( + fontCollection: *mut *mut IDWriteFontCollection, + ) -> HRESULT, + fn GetFontFamilyNameLength() -> UINT32, + fn GetFontFamilyName( + fontFamilyName: *mut WCHAR, + nameSize: UINT32, + ) -> HRESULT, + fn GetFontWeight() -> DWRITE_FONT_WEIGHT, + fn GetFontStyle() -> DWRITE_FONT_STYLE, + fn GetFontStretch() -> DWRITE_FONT_STRETCH, + fn GetFontSize() -> FLOAT, + fn GetLocaleNameLength() -> UINT32, + fn GetLocaleName( + localeName: *mut WCHAR, + nameSize: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x55f1112b, 0x1dc2, 0x4b3c, 0x95, 0x41, 0xf4, 0x68, 0x94, 0xed, 0x85, 0xb6)] +interface IDWriteTypography(IDWriteTypographyVtbl): IUnknown(IUnknownVtbl) { + fn AddFontFeature( + fontFeature: DWRITE_FONT_FEATURE, + ) -> HRESULT, + fn GetFontFeatureCount() -> UINT32, + fn GetFontFeature( + fontFeatureIndex: UINT32, + fontFeature: *mut DWRITE_FONT_FEATURE, + ) -> HRESULT, +}} +ENUM!{enum DWRITE_SCRIPT_SHAPES { + DWRITE_SCRIPT_SHAPES_DEFAULT = 0, + DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1, +}} +STRUCT!{struct DWRITE_SCRIPT_ANALYSIS { + script: UINT16, + shapes: DWRITE_SCRIPT_SHAPES, +}} +ENUM!{enum DWRITE_BREAK_CONDITION { + DWRITE_BREAK_CONDITION_NEUTRAL, + DWRITE_BREAK_CONDITION_CAN_BREAK, + DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, + DWRITE_BREAK_CONDITION_MUST_BREAK, +}} +STRUCT!{struct DWRITE_LINE_BREAKPOINT { + bit_fields: UINT8, +}} +BITFIELD!{DWRITE_LINE_BREAKPOINT bit_fields: UINT8 [ + breakConditionBefore set_breakConditionBefore[0..2], + breakConditionAfter set_breakConditionAfter[2..4], + isWhitespace set_isWhitespace[4..5], + isSoftHyphen set_isSoftHyphen[5..6], + padding set_padding[6..8], +]} +ENUM!{enum DWRITE_NUMBER_SUBSTITUTION_METHOD { + DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE, + DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL, + DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, + DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL, + DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL, +}} +RIDL!{#[uuid(0x14885cc9, 0xbab0, 0x4f90, 0xb6, 0xed, 0x5c, 0x36, 0x6a, 0x2c, 0xd0, 0x3d)] +interface IDWriteNumberSubstitution(IDWriteNumberSubstitutionVtbl): IUnknown(IUnknownVtbl) {}} +STRUCT!{struct DWRITE_SHAPING_TEXT_PROPERTIES { + bit_fields: UINT16, +}} +BITFIELD!{DWRITE_SHAPING_TEXT_PROPERTIES bit_fields: UINT16 [ + isShapedAlone set_isShapedAlone[0..1], + reserved set_reserved[1..16], +]} +STRUCT!{struct DWRITE_SHAPING_GLYPH_PROPERTIES { + bit_fields: UINT16, +}} +BITFIELD!{DWRITE_SHAPING_GLYPH_PROPERTIES bit_fields: UINT16 [ + justification set_justification[0..4], + isClusterStart set_isClusterStart[4..5], + isDiacritic set_isDiacritic[5..6], + isZeroWidthSpace set_isZeroWidthSpace[6..7], + reserved set_reserved[7..16], +]} +RIDL!{#[uuid(0x688e1a58, 0x5094, 0x47c8, 0xad, 0xc8, 0xfb, 0xce, 0xa6, 0x0a, 0xe9, 0x2b)] +interface IDWriteTextAnalysisSource(IDWriteTextAnalysisSourceVtbl): IUnknown(IUnknownVtbl) { + fn GetTextAtPosition( + textPosition: UINT32, + textString: *mut *const WCHAR, + textLength: *mut UINT32, + ) -> HRESULT, + fn GetTextBeforePosition( + textPosition: UINT32, + textString: *mut *const WCHAR, + textLength: *mut UINT32, + ) -> HRESULT, + fn GetParagraphReadingDirection() -> DWRITE_READING_DIRECTION, + fn GetLocaleName( + textPosition: UINT32, + textLength: *mut UINT32, + localeName: *mut *const WCHAR, + ) -> HRESULT, + fn GetNumberSubstitution( + textPosition: UINT32, + textLength: *mut UINT32, + numberSubstitution: *mut *mut IDWriteNumberSubstitution, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5810cd44, 0x0ca0, 0x4701, 0xb3, 0xfa, 0xbe, 0xc5, 0x18, 0x2a, 0xe4, 0xf6)] +interface IDWriteTextAnalysisSink(IDWriteTextAnalysisSinkVtbl): IUnknown(IUnknownVtbl) { + fn SetScriptAnalysis( + textPosition: UINT32, + textLength: UINT32, + scriptAnalysis: *const DWRITE_SCRIPT_ANALYSIS, + ) -> HRESULT, + fn SetLineBreakpoints( + textPosition: UINT32, + textLength: UINT32, + lineBreakpoints: *const DWRITE_LINE_BREAKPOINT, + ) -> HRESULT, + fn SetBidiLevel( + textPosition: UINT32, + textLength: UINT32, + explicitLevel: UINT8, + resolvedLevel: UINT8, + ) -> HRESULT, + fn SetNumberSubstitution( + textPosition: UINT32, + textLength: UINT32, + numberSubstitution: *mut IDWriteNumberSubstitution, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb7e6163e, 0x7f46, 0x43b4, 0x84, 0xb3, 0xe4, 0xe6, 0x24, 0x9c, 0x36, 0x5d)] +interface IDWriteTextAnalyzer(IDWriteTextAnalyzerVtbl): IUnknown(IUnknownVtbl) { + fn AnalyzeScript( + analysisSource: *mut IDWriteTextAnalysisSource, + textPosition: UINT32, + textLength: UINT32, + analysisSink: *mut IDWriteTextAnalysisSink, + ) -> HRESULT, + fn AnalyzeBidi( + analysisSource: *mut IDWriteTextAnalysisSource, + textPosition: UINT32, + textLength: UINT32, + analysisSink: *mut IDWriteTextAnalysisSink, + ) -> HRESULT, + fn AnalyzeNumberSubstitution( + analysisSource: *mut IDWriteTextAnalysisSource, + textPosition: UINT32, + textLength: UINT32, + analysisSink: *mut IDWriteTextAnalysisSink, + ) -> HRESULT, + fn AnalyzeLineBreakpoints( + analysisSource: *mut IDWriteTextAnalysisSource, + textPosition: UINT32, + textLength: UINT32, + analysisSink: *mut IDWriteTextAnalysisSink, + ) -> HRESULT, + fn GetGlyphs( + textString: *const WCHAR, + textLength: UINT32, + fontFace: *mut IDWriteFontFace, + isSideways: BOOL, + isRightToLeft: BOOL, + scriptAnalysis: *const DWRITE_SCRIPT_ANALYSIS, + localeName: *const WCHAR, + numberSubstitution: *mut IDWriteNumberSubstitution, + features: *mut *const DWRITE_TYPOGRAPHIC_FEATURES, + featureRangeLengths: *const UINT32, + featureRanges: UINT32, + maxGlyphCount: UINT32, + clusterMap: *mut UINT16, + textProps: *mut DWRITE_SHAPING_TEXT_PROPERTIES, + glyphIndices: *mut UINT16, + glyphProps: *mut DWRITE_SHAPING_GLYPH_PROPERTIES, + actualGlyphCount: *mut UINT32, + ) -> HRESULT, + fn GetGlyphPlacements( + textString: *const WCHAR, + clusterMap: *const UINT16, + textProps: *mut DWRITE_SHAPING_TEXT_PROPERTIES, + textLength: UINT32, + glyphIndices: *const UINT16, + glyphProps: *const DWRITE_SHAPING_GLYPH_PROPERTIES, + glyphCount: UINT32, + fontFace: *mut IDWriteFontFace, + fontEmSize: FLOAT, + isSideways: BOOL, + isRightToLeft: BOOL, + scriptAnalysis: *const DWRITE_SCRIPT_ANALYSIS, + localeName: *const WCHAR, + features: *mut *const DWRITE_TYPOGRAPHIC_FEATURES, + featureRangeLengths: *const UINT32, + featureRanges: UINT32, + glyphAdvances: *mut FLOAT, + glyphOffsets: *mut DWRITE_GLYPH_OFFSET, + ) -> HRESULT, + fn GetGdiCompatibleGlyphPlacements( + textString: *const WCHAR, + clusterMap: *const UINT16, + textProps: *mut DWRITE_SHAPING_TEXT_PROPERTIES, + textLength: UINT32, + glyphIndices: *const UINT16, + glyphProps: *const DWRITE_SHAPING_GLYPH_PROPERTIES, + glyphCount: UINT32, + fontFace: *mut IDWriteFontFace, + fontEmSize: FLOAT, + pixelsPerDip: FLOAT, + transform: *const DWRITE_MATRIX, + useGdiNatrual: BOOL, + isSideways: BOOL, + isRightToLeft: BOOL, + scriptAnalysis: *const DWRITE_SCRIPT_ANALYSIS, + localeName: *const WCHAR, + features: *mut *const DWRITE_TYPOGRAPHIC_FEATURES, + featureRangeLengths: *const UINT32, + featureRanges: UINT32, + glyphAdvances: *mut FLOAT, + glyphOffsets: *mut DWRITE_GLYPH_OFFSET, + ) -> HRESULT, +}} +STRUCT!{struct DWRITE_GLYPH_RUN { + fontFace: *mut IDWriteFontFace, + fontEmSize: FLOAT, + glyphCount: UINT32, + glyphIndices: *const UINT16, + glyphAdvances: *const FLOAT, + glyphOffsets: *const DWRITE_GLYPH_OFFSET, + isSideways: BOOL, + bidiLevel: UINT32, +}} +STRUCT!{struct DWRITE_GLYPH_RUN_DESCRIPTION { + localeName: *const WCHAR, + string: *const WCHAR, + stringLength: UINT32, + clusterMap: *const UINT16, + textPosition: UINT32, +}} +STRUCT!{struct DWRITE_UNDERLINE { + width: FLOAT, + thickness: FLOAT, + offset: FLOAT, + runHeight: FLOAT, + readingDirection: DWRITE_READING_DIRECTION, + flowDirection: DWRITE_FLOW_DIRECTION, + localeName: *const WCHAR, + measuringMode: DWRITE_MEASURING_MODE, +}} +STRUCT!{struct DWRITE_STRIKETHROUGH { + width: FLOAT, + thickness: FLOAT, + offset: FLOAT, + readingDirection: DWRITE_READING_DIRECTION, + flowDirection: DWRITE_FLOW_DIRECTION, + localeName: *const WCHAR, + measuringMode: DWRITE_MEASURING_MODE, +}} +STRUCT!{struct DWRITE_LINE_METRICS { + length: UINT32, + trailingWhitespaceLength: UINT32, + newlineLength: UINT32, + height: FLOAT, + baseline: FLOAT, + isTrimmed: BOOL, +}} +STRUCT!{struct DWRITE_CLUSTER_METRICS { + width: FLOAT, + length: UINT16, + bit_fields: UINT16, +}} +BITFIELD!{DWRITE_CLUSTER_METRICS bit_fields: UINT16 [ + canWrapLineAfter set_canWrapLineAfter[0..1], + isWhitespace set_isWhitespace[1..2], + isNewline set_isNewline[2..3], + isSoftHyphen set_isSoftHyphen[3..4], + isRightToLeft set_isRightToLeft[4..5], + padding set_padding[5..16], +]} +STRUCT!{struct DWRITE_TEXT_METRICS { + left: FLOAT, + top: FLOAT, + width: FLOAT, + widthIncludingTrailingWhitespace: FLOAT, + height: FLOAT, + layoutWidth: FLOAT, + layoutHeight: FLOAT, + maxBidiReorderingDepth: UINT32, + lineCount: UINT32, +}} +STRUCT!{struct DWRITE_INLINE_OBJECT_METRICS { + width: FLOAT, + height: FLOAT, + baseline: FLOAT, + supportsSideways: BOOL, +}} +STRUCT!{struct DWRITE_OVERHANG_METRICS { + left: FLOAT, + top: FLOAT, + right: FLOAT, + bottom: FLOAT, +}} +STRUCT!{struct DWRITE_HIT_TEST_METRICS { + textPosition: UINT32, + length: UINT32, + left: FLOAT, + top: FLOAT, + width: FLOAT, + height: FLOAT, + bidiLevel: UINT32, + isText: BOOL, + isTrimmed: BOOL, +}} +RIDL!{#[uuid(0x8339fde3, 0x106f, 0x47ab, 0x83, 0x73, 0x1c, 0x62, 0x95, 0xeb, 0x10, 0xb3)] +interface IDWriteInlineObject(IDWriteInlineObjectVtbl): IUnknown(IUnknownVtbl) { + fn Draw( + clientDrawingContext: *mut c_void, + renderer: *mut IDWriteTextRenderer, + originX: FLOAT, + originY: FLOAT, + isSideways: BOOL, + isRightToLeft: BOOL, + clientDrawingEffect: *mut IUnknown, + ) -> HRESULT, + fn GetMetrics( + metrics: *mut DWRITE_INLINE_OBJECT_METRICS, + ) -> HRESULT, + fn GetOverhangMetrics( + overhangs: *mut DWRITE_OVERHANG_METRICS, + ) -> HRESULT, + fn GetBreakConditions( + breakConditionBefore: *mut DWRITE_BREAK_CONDITION, + breakConditionAfter: *mut DWRITE_BREAK_CONDITION, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xeaf3a2da, 0xecf4, 0x4d24, 0xb6, 0x44, 0xb3, 0x4f, 0x68, 0x42, 0x02, 0x4b)] +interface IDWritePixelSnapping(IDWritePixelSnappingVtbl): IUnknown(IUnknownVtbl) { + fn IsPixelSnappingDisabled( + clientDrawingContext: *mut c_void, + isDisabled: *mut BOOL, + ) -> HRESULT, + fn GetCurrentTransform( + clientDrawingContext: *mut c_void, + transform: *mut DWRITE_MATRIX, + ) -> HRESULT, + fn GetPixelsPerDip( + clientDrawingContext: *mut c_void, + pixelsPerDip: *mut FLOAT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xef8a8135, 0x5cc6, 0x45fe, 0x88, 0x25, 0xc5, 0xa0, 0x72, 0x4e, 0xb8, 0x19)] +interface IDWriteTextRenderer(IDWriteTextRendererVtbl): + IDWritePixelSnapping(IDWritePixelSnappingVtbl) { + fn DrawGlyphRun( + clientDrawingContext: *mut c_void, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + measuringMode: DWRITE_MEASURING_MODE, + glyphRun: *const DWRITE_GLYPH_RUN, + glyphRunDescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, + clientDrawingEffect: *mut IUnknown, + ) -> HRESULT, + fn DrawUnderline( + clientDrawingContext: *mut c_void, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + underline: *const DWRITE_UNDERLINE, + clientDrawingEffect: *mut IUnknown, + ) -> HRESULT, + fn DrawStrikethrough( + clientDrawingContext: *mut c_void, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + strikethrough: *const DWRITE_STRIKETHROUGH, + clientDrawingEffect: *mut IUnknown, + ) -> HRESULT, + fn DrawInlineObject( + clientDrawingContext: *mut c_void, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + inlineObject: *mut IDWriteInlineObject, + isSideways: BOOL, + isRightToLeft: BOOL, + clientDrawingEffect: *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x53737037, 0x6d14, 0x410b, 0x9b, 0xfe, 0x0b, 0x18, 0x2b, 0xb7, 0x09, 0x61)] +interface IDWriteTextLayout(IDWriteTextLayoutVtbl): + IDWriteTextFormat(IDWriteTextFormatVtbl) { + fn SetMaxWidth( + maxWidth: FLOAT, + ) -> HRESULT, + fn SetMaxHeight( + maxHeight: FLOAT, + ) -> HRESULT, + fn SetFontCollection( + fontCollection: *mut IDWriteFontCollection, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetFontFamilyName( + fontFamilyName: *const WCHAR, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetFontWeight( + fontWeight: DWRITE_FONT_WEIGHT, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetFontStyle( + fontStyle: DWRITE_FONT_STYLE, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetFontStretch( + fontStretch: DWRITE_FONT_STRETCH, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetFontSize( + fontSize: FLOAT, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetUnderline( + hasUnderline: BOOL, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetStrikethrough( + hasStrikethrough: BOOL, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetDrawingEffect( + drawingEffect: *mut IUnknown, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetInlineObject( + inlineObject: *mut IDWriteInlineObject, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetTypography( + typography: *mut IDWriteTypography, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetLocaleName( + localeName: *const WCHAR, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetMaxWidth() -> FLOAT, + fn GetMaxHeight() -> FLOAT, + fn GetFontCollection( + currentPosition: UINT32, + fontCollection: *mut *mut IDWriteFontCollection, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetFontFamilyNameLength( + currentPosition: UINT32, + nameLength: *mut UINT32, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetFontFamilyName( + currentPosition: UINT32, + fontFamilyName: *mut WCHAR, + nameSize: UINT32, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetFontWeight( + currentPosition: UINT32, + fontWeight: *mut DWRITE_FONT_WEIGHT, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetFontStyle( + currentPosition: UINT32, + fontStyle: *mut DWRITE_FONT_STYLE, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetFontStretch( + currentPosition: UINT32, + fontStretch: *mut DWRITE_FONT_STRETCH, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetFontSize( + currentPosition: UINT32, + fontSize: *mut FLOAT, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetUnderline( + currentPosition: UINT32, + hasUnderline: *mut BOOL, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetStrikethrough( + currentPosition: UINT32, + hasStrikethrough: *mut BOOL, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetDrawingEffect( + currentPosition: UINT32, + drawingEffect: *mut *mut IUnknown, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetInlineObject( + currentPosition: UINT32, + inlineObject: *mut *mut IDWriteInlineObject, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetTypography( + currentPosition: UINT32, + typography: *mut *mut IDWriteTypography, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetLocaleNameLength( + currentPosition: UINT32, + nameLength: *mut UINT32, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetLocaleName( + currentPosition: UINT32, + localeName: *mut WCHAR, + nameSize: UINT32, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn Draw( + clientDrawingContext: *mut c_void, + renderer: *mut IDWriteTextRenderer, + originX: FLOAT, + originY: FLOAT, + ) -> HRESULT, + fn GetLineMetrics( + lineMetrics: *mut DWRITE_LINE_METRICS, + maxLineCount: UINT32, + actualLineCount: *mut UINT32, + ) -> HRESULT, + fn GetMetrics( + textMetrics: *mut DWRITE_TEXT_METRICS, + ) -> HRESULT, + fn GetOverhangMetrics( + overhangs: *mut DWRITE_OVERHANG_METRICS, + ) -> HRESULT, + fn GetClusterMetrics( + clusterMetrics: *mut DWRITE_CLUSTER_METRICS, + maxClusterCount: UINT32, + actualClusterCount: *mut UINT32, + ) -> HRESULT, + fn DetermineMinWidth( + minWidth: *mut FLOAT, + ) -> HRESULT, + fn HitTestPoint( + pointX: FLOAT, + pointY: FLOAT, + isTrailingHit: *mut BOOL, + isInside: *mut BOOL, + hitTestMetrics: *mut DWRITE_HIT_TEST_METRICS, + ) -> HRESULT, + fn HitTestTextPosition( + textPosition: UINT32, + isTrailingHit: BOOL, + pointX: *mut FLOAT, + pointY: *mut FLOAT, + hitTestMetrics: *mut DWRITE_HIT_TEST_METRICS, + ) -> HRESULT, + fn HitTestTextRange( + textPosition: UINT32, + textLength: UINT32, + originX: FLOAT, + originY: FLOAT, + hitTestMetrics: *mut DWRITE_HIT_TEST_METRICS, + maxHitTestMetricsCount: UINT32, + actualHitTestMetricsCount: *mut UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5e5a32a3, 0x8dff, 0x4773, 0x9f, 0xf6, 0x06, 0x96, 0xea, 0xb7, 0x72, 0x67)] +interface IDWriteBitmapRenderTarget(IDWriteBitmapRenderTargetVtbl): IUnknown(IUnknownVtbl) { + fn DrawGlyphRun( + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + measuringMode: DWRITE_MEASURING_MODE, + glyphRun: *const DWRITE_GLYPH_RUN, + renderingParams: *mut IDWriteRenderingParams, + textColor: COLORREF, + blackBoxRect: *mut RECT, + ) -> HRESULT, + fn GetMemoryDC() -> HDC, + fn GetPixelsPerDip() -> FLOAT, + fn SetPixelsPerDip( + pixelsPerDip: FLOAT, + ) -> HRESULT, + fn GetCurrentTransform( + transform: *mut DWRITE_MATRIX, + ) -> HRESULT, + fn SetCurrentTransform( + transform: *const DWRITE_MATRIX, + ) -> HRESULT, + fn GetSize( + size: *mut SIZE, + ) -> HRESULT, + fn Resize( + width: UINT32, + height: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1edd9491, 0x9853, 0x4299, 0x89, 0x8f, 0x64, 0x32, 0x98, 0x3b, 0x6f, 0x3a)] +interface IDWriteGdiInterop(IDWriteGdiInteropVtbl): IUnknown(IUnknownVtbl) { + fn CreateFontFromLOGFONT( + logFont: *const LOGFONTW, + font: *mut *mut IDWriteFont, + ) -> HRESULT, + fn ConvertFontToLOGFONT( + font: *mut IDWriteFont, + logFont: *mut LOGFONTW, + isSystemFont: *mut BOOL, + ) -> HRESULT, + fn ConvertFontFaceToLOGFONT( + font: *mut IDWriteFontFace, + logFont: *mut LOGFONTW, + ) -> HRESULT, + fn CreateFontFaceFromHdc( + hdc: HDC, + fontFace: *mut *mut IDWriteFontFace, + ) -> HRESULT, + fn CreateBitmapRenderTarget( + hdc: HDC, + width: UINT32, + height: UINT32, + renderTarget: *mut *mut IDWriteBitmapRenderTarget, + ) -> HRESULT, +}} +ENUM!{enum DWRITE_TEXTURE_TYPE { + DWRITE_TEXTURE_ALIASED_1x1 = 0, + DWRITE_TEXTURE_CLEARTYPE_3x1 = 1, +}} +pub const DWRITE_ALPHA_MAX: BYTE = 255; +RIDL!{#[uuid(0x7d97dbf7, 0xe085, 0x42d4, 0x81, 0xe3, 0x6a, 0x88, 0x3b, 0xde, 0xd1, 0x18)] +interface IDWriteGlyphRunAnalysis(IDWriteGlyphRunAnalysisVtbl): IUnknown(IUnknownVtbl) { + fn GetAlphaTextureBounds( + textureType: DWRITE_TEXTURE_TYPE, + textureBounds: *mut RECT, + ) -> HRESULT, + fn CreateAlphaTexture( + textureType: DWRITE_TEXTURE_TYPE, + textureBounds: *const RECT, + alphaValues: *mut BYTE, + bufferSize: UINT32, + ) -> HRESULT, + fn GetAlphaBlendParams( + renderingParams: *mut IDWriteRenderingParams, + blendGamma: *mut FLOAT, + blendEnhancedContrast: *mut FLOAT, + blendClearTypeLevel: *mut FLOAT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb859ee5a, 0xd838, 0x4b5b, 0xa2, 0xe8, 0x1a, 0xdc, 0x7d, 0x93, 0xdb, 0x48)] +interface IDWriteFactory(IDWriteFactoryVtbl): IUnknown(IUnknownVtbl) { + fn GetSystemFontCollection( + fontCollection: *mut *mut IDWriteFontCollection, + checkForUpdates: BOOL, + ) -> HRESULT, + fn CreateCustomFontCollection( + collectionLoader: *mut IDWriteFontCollectionLoader, + collectionKey: *const c_void, + collectionKeySize: UINT32, + fontCollection: *mut *mut IDWriteFontCollection, + ) -> HRESULT, + fn RegisterFontCollectionLoader( + fontCollectionLoader: *mut IDWriteFontCollectionLoader, + ) -> HRESULT, + fn UnregisterFontCollectionLoader( + fontCollectionLoader: *mut IDWriteFontCollectionLoader, + ) -> HRESULT, + fn CreateFontFileReference( + filePath: *const WCHAR, + lastWriteTime: *const FILETIME, + fontFile: *mut *mut IDWriteFontFile, + ) -> HRESULT, + fn CreateCustomFontFileReference( + fontFileReferenceKey: *const c_void, + fontFileReferenceKeySize: UINT32, + fontFileLoader: *mut IDWriteFontFileLoader, + fontFile: *mut *mut IDWriteFontFile, + ) -> HRESULT, + fn CreateFontFace( + fontFaceType: DWRITE_FONT_FACE_TYPE, + numberOfFiles: UINT32, + fontFiles: *const *mut IDWriteFontFile, + faceIndex: UINT32, + fontFaceSimulationFlags: DWRITE_FONT_SIMULATIONS, + fontFace: *mut *mut IDWriteFontFace, + ) -> HRESULT, + fn CreateRenderingParams( + renderingParams: *mut *mut IDWriteRenderingParams, + ) -> HRESULT, + fn CreateMonitorRenderingParams( + monitor: HMONITOR, + renderingParams: *mut *mut IDWriteRenderingParams, + ) -> HRESULT, + fn CreateCustomRenderingParams( + gamma: FLOAT, + enhancedContrast: FLOAT, + clearTypeLevel: FLOAT, + pixelGeometry: DWRITE_PIXEL_GEOMETRY, + renderingMode: DWRITE_RENDERING_MODE, + renderingParams: *mut *mut IDWriteRenderingParams, + ) -> HRESULT, + fn RegisterFontFileLoader( + fontFileLoader: *mut IDWriteFontFileLoader, + ) -> HRESULT, + fn UnregisterFontFileLoader( + fontFileLoader: *mut IDWriteFontFileLoader, + ) -> HRESULT, + fn CreateTextFormat( + fontFamilyName: *const WCHAR, + fontCollection: *mut IDWriteFontCollection, + fontWeight: DWRITE_FONT_WEIGHT, + fontStyle: DWRITE_FONT_STYLE, + fontStretch: DWRITE_FONT_STRETCH, + fontSize: FLOAT, + localeName: *const WCHAR, + textFormat: *mut *mut IDWriteTextFormat, + ) -> HRESULT, + fn CreateTypography( + typography: *mut *mut IDWriteTypography, + ) -> HRESULT, + fn GetGdiInterop( + gdiInterop: *mut *mut IDWriteGdiInterop, + ) -> HRESULT, + fn CreateTextLayout( + string: *const WCHAR, + stringLength: UINT32, + textFormat: *mut IDWriteTextFormat, + maxWidth: FLOAT, + maxHeight: FLOAT, + textLayout: *mut *mut IDWriteTextLayout, + ) -> HRESULT, + fn CreateGdiCompatibleTextLayout( + string: *const WCHAR, + stringLength: UINT32, + textFormat: *mut IDWriteTextFormat, + layoutWidth: FLOAT, + layoutHeight: FLOAT, + pixelsPerDip: FLOAT, + transform: *const DWRITE_MATRIX, + useGdiNatrual: BOOL, + textLayout: *mut *mut IDWriteTextLayout, + ) -> HRESULT, + fn CreateEllipsisTrimmingSign( + textFormat: *mut IDWriteTextFormat, + trimmingSign: *mut *mut IDWriteInlineObject, + ) -> HRESULT, + fn CreateTextAnalyzer( + textAnalyzer: *mut *mut IDWriteTextAnalyzer, + ) -> HRESULT, + fn CreateNumberSubstitution( + substitutionMethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, + localeName: *const WCHAR, + ignoreUserOverride: BOOL, + numberSubstitution: *mut *mut IDWriteNumberSubstitution, + ) -> HRESULT, + fn CreateGlyphRunAnalysis( + glyphRun: *const DWRITE_GLYPH_RUN, + pixelsPerDip: FLOAT, + transform: *const DWRITE_MATRIX, + renderingMode: DWRITE_RENDERING_MODE, + measuringMode: DWRITE_MEASURING_MODE, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + glyphRunAnalysis: *mut *mut IDWriteGlyphRunAnalysis, + ) -> HRESULT, +}} +pub const FACILITY_DWRITE: HRESULT = 0x898; +pub const DWRITE_ERR_BASE: HRESULT = 0x5000; +#[inline] +pub fn MAKE_DWRITE_HR(severity: HRESULT, code: HRESULT) -> HRESULT { + MAKE_HRESULT!(severity, FACILITY_DWRITE, DWRITE_ERR_BASE + code) +} +#[inline] +pub fn MAKE_DWRITE_HR_ERR(code: HRESULT) -> HRESULT { + MAKE_DWRITE_HR(SEVERITY_ERROR, code) +} +extern "system" { + pub fn DWriteCreateFactory( + factoryType: DWRITE_FACTORY_TYPE, iid: REFIID, factory: *mut *mut IUnknown, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/dwrite_1.rs b/bash-5.1/vendor/winapi/src/um/dwrite_1.rs new file mode 100644 index 0000000000000000000000000000000000000000..b762bbdcb79ef4974bc97c453713cfa277028391 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dwrite_1.rs @@ -0,0 +1,746 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the content of dwrite_1.h +use shared::basetsd::{INT16, INT32, UINT16, UINT32, UINT8}; +use shared::minwindef::{BOOL, FLOAT}; +use um::dcommon::DWRITE_MEASURING_MODE; +use um::dwrite::{ + DWRITE_GLYPH_OFFSET, DWRITE_MATRIX, DWRITE_PIXEL_GEOMETRY, DWRITE_RENDERING_MODE, + DWRITE_SCRIPT_ANALYSIS, DWRITE_SHAPING_GLYPH_PROPERTIES, DWRITE_TEXT_RANGE, + IDWriteBitmapRenderTarget, IDWriteBitmapRenderTargetVtbl, IDWriteFactory, IDWriteFactoryVtbl, + IDWriteFont, IDWriteFontCollection, IDWriteFontFace, IDWriteFontFaceVtbl, IDWriteFontVtbl, + IDWriteRenderingParams, IDWriteRenderingParamsVtbl, IDWriteTextAnalysisSink, + IDWriteTextAnalysisSinkVtbl, IDWriteTextAnalysisSource, IDWriteTextAnalysisSourceVtbl, + IDWriteTextAnalyzer, IDWriteTextAnalyzerVtbl, IDWriteTextLayout, IDWriteTextLayoutVtbl, +}; +use um::winnt::{HRESULT, WCHAR}; +ENUM!{enum DWRITE_PANOSE_FAMILY { + DWRITE_PANOSE_FAMILY_ANY = 0x0, // 0 + DWRITE_PANOSE_FAMILY_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_FAMILY_TEXT_DISPLAY = 0x2, // 2 + DWRITE_PANOSE_FAMILY_SCRIPT = 0x3, // 3 + DWRITE_PANOSE_FAMILY_DECORATIVE = 0x4, // 4 + DWRITE_PANOSE_FAMILY_SYMBOL = 0x5, // 5 + DWRITE_PANOSE_FAMILY_PICTORIAL = 0x5, // 5 +}} +ENUM!{enum DWRITE_PANOSE_SERIF_STYLE { + DWRITE_PANOSE_SERIF_STYLE_ANY = 0x0, // 0 + DWRITE_PANOSE_SERIF_STYLE_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_SERIF_STYLE_COVE = 0x2, // 2 + DWRITE_PANOSE_SERIF_STYLE_OBTUSE_COVE = 0x3, // 3 + DWRITE_PANOSE_SERIF_STYLE_SQUARE_COVE = 0x4, // 4 + DWRITE_PANOSE_SERIF_STYLE_OBTUSE_SQUARE_COVE = 0x5, // 5 + DWRITE_PANOSE_SERIF_STYLE_SQUARE = 0x6, // 6 + DWRITE_PANOSE_SERIF_STYLE_THIN = 0x7, // 7 + DWRITE_PANOSE_SERIF_STYLE_OVAL = 0x8, // 8 + DWRITE_PANOSE_SERIF_STYLE_EXAGGERATED = 0x9, // 9 + DWRITE_PANOSE_SERIF_STYLE_TRIANGLE = 0xA, // 10 + DWRITE_PANOSE_SERIF_STYLE_NORMAL_SANS = 0xB, // 11 + DWRITE_PANOSE_SERIF_STYLE_OBTUSE_SANS = 0xC, // 12 + DWRITE_PANOSE_SERIF_STYLE_PERPENDICULAR_SANS = 0xD, // 13 + DWRITE_PANOSE_SERIF_STYLE_FLARED = 0xE, // 14 + DWRITE_PANOSE_SERIF_STYLE_ROUNDED = 0xF, // 15 + DWRITE_PANOSE_SERIF_STYLE_SCRIPT = 0x10, // 16 + DWRITE_PANOSE_SERIF_STYLE_PERP_SANS = 0xD, // 13 + DWRITE_PANOSE_SERIF_STYLE_BONE = 0x8, // 8 +}} +ENUM!{enum DWRITE_PANOSE_WEIGHT { + DWRITE_PANOSE_WEIGHT_ANY = 0x0, // 0 + DWRITE_PANOSE_WEIGHT_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_WEIGHT_VERY_LIGHT = 0x2, // 2 + DWRITE_PANOSE_WEIGHT_LIGHT = 0x3, // 3 + DWRITE_PANOSE_WEIGHT_THIN = 0x4, // 4 + DWRITE_PANOSE_WEIGHT_BOOK = 0x5, // 5 + DWRITE_PANOSE_WEIGHT_MEDIUM = 0x6, // 6 + DWRITE_PANOSE_WEIGHT_DEMI = 0x7, // 7 + DWRITE_PANOSE_WEIGHT_BOLD = 0x8, // 8 + DWRITE_PANOSE_WEIGHT_HEAVY = 0x9, // 9 + DWRITE_PANOSE_WEIGHT_BLACK = 0xA, // 10 + DWRITE_PANOSE_WEIGHT_EXTRA_BLACK = 0xB, // 11 + DWRITE_PANOSE_WEIGHT_NORD = 0xB, // 11 +}} +ENUM!{enum DWRITE_PANOSE_PROPORTION { + DWRITE_PANOSE_PROPORTION_ANY = 0x0, // 0 + DWRITE_PANOSE_PROPORTION_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_PROPORTION_OLD_STYLE = 0x2, // 2 + DWRITE_PANOSE_PROPORTION_MODERN = 0x3, // 3 + DWRITE_PANOSE_PROPORTION_EVEN_WIDTH = 0x4, // 4 + DWRITE_PANOSE_PROPORTION_EXPANDED = 0x5, // 5 + DWRITE_PANOSE_PROPORTION_CONDENSED = 0x6, // 6 + DWRITE_PANOSE_PROPORTION_VERY_EXPANDED = 0x7, // 7 + DWRITE_PANOSE_PROPORTION_VERY_CONDENSED = 0x8, // 8 + DWRITE_PANOSE_PROPORTION_MONOSPACED = 0x9, // 9 +}} +ENUM!{enum DWRITE_PANOSE_CONTRAST { + DWRITE_PANOSE_CONTRAST_ANY = 0x0, // 0 + DWRITE_PANOSE_CONTRAST_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_CONTRAST_NONE = 0x2, // 2 + DWRITE_PANOSE_CONTRAST_VERY_LOW = 0x3, // 3 + DWRITE_PANOSE_CONTRAST_LOW = 0x4, // 4 + DWRITE_PANOSE_CONTRAST_MEDIUM_LOW = 0x5, // 5 + DWRITE_PANOSE_CONTRAST_MEDIUM = 0x6, // 6 + DWRITE_PANOSE_CONTRAST_MEDIUM_HIGH = 0x7, // 7 + DWRITE_PANOSE_CONTRAST_HIGH = 0x8, // 8 + DWRITE_PANOSE_CONTRAST_VERY_HIGH = 0x9, // 9 + DWRITE_PANOSE_CONTRAST_HORIZONTAL_LOW = 0xA, // 10 + DWRITE_PANOSE_CONTRAST_HORIZONTAL_MEDIUM = 0xB, // 11 + DWRITE_PANOSE_CONTRAST_HORIZONTAL_HIGH = 0xC, // 12 + DWRITE_PANOSE_CONTRAST_BROKEN = 0xD, // 13 +}} +ENUM!{enum DWRITE_PANOSE_STROKE_VARIATION { + DWRITE_PANOSE_STROKE_VARIATION_ANY = 0x0, // 0 + DWRITE_PANOSE_STROKE_VARIATION_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_STROKE_VARIATION_NO_VARIATION = 0x2, // 2 + DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_DIAGONAL = 0x3, // 3 + DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_TRANSITIONAL = 0x4, // 4 + DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_VERTICAL = 0x5, // 5 + DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_HORIZONTAL = 0x6, // 6 + DWRITE_PANOSE_STROKE_VARIATION_RAPID_VERTICAL = 0x7, // 7 + DWRITE_PANOSE_STROKE_VARIATION_RAPID_HORIZONTAL = 0x8, // 8 + DWRITE_PANOSE_STROKE_VARIATION_INSTANT_VERTICAL = 0x9, // 9 + DWRITE_PANOSE_STROKE_VARIATION_INSTANT_HORIZONTAL = 0xA, // 10 +}} +ENUM!{enum DWRITE_PANOSE_ARM_STYLE { + DWRITE_PANOSE_ARM_STYLE_ANY = 0x0, // 0 + DWRITE_PANOSE_ARM_STYLE_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_HORIZONTAL = 0x2, // 2 + DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_WEDGE = 0x3, // 3 + DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_VERTICAL = 0x4, // 4 + DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_SINGLE_SERIF = 0x5, // 5 + DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_DOUBLE_SERIF = 0x6, // 6 + DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_HORIZONTAL = 0x7, // 7 + DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_WEDGE = 0x8, // 8 + DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_VERTICAL = 0x9, // 9 + DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_SINGLE_SERIF = 0xA, // 10 + DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_DOUBLE_SERIF = 0xB, // 11 + DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_HORZ = 0x2, // 2 + DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_VERT = 0x4, // 4 + DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_HORZ = 0x7, // 7 + DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_WEDGE = 0x8, // 8 + DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_VERT = 0x9, // 9 + DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_SINGLE_SERIF = 0xA, // 10 + DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_DOUBLE_SERIF = 0xB, // 11 +}} +ENUM!{enum DWRITE_PANOSE_LETTERFORM { + DWRITE_PANOSE_LETTERFORM_ANY = 0x0, // 0 + DWRITE_PANOSE_LETTERFORM_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_LETTERFORM_NORMAL_CONTACT = 0x2, // 2 + DWRITE_PANOSE_LETTERFORM_NORMAL_WEIGHTED = 0x3, // 3 + DWRITE_PANOSE_LETTERFORM_NORMAL_BOXED = 0x4, // 4 + DWRITE_PANOSE_LETTERFORM_NORMAL_FLATTENED = 0x5, // 5 + DWRITE_PANOSE_LETTERFORM_NORMAL_ROUNDED = 0x6, // 6 + DWRITE_PANOSE_LETTERFORM_NORMAL_OFF_CENTER = 0x7, // 7 + DWRITE_PANOSE_LETTERFORM_NORMAL_SQUARE = 0x8, // 8 + DWRITE_PANOSE_LETTERFORM_OBLIQUE_CONTACT = 0x9, // 9 + DWRITE_PANOSE_LETTERFORM_OBLIQUE_WEIGHTED = 0xA, // 10 + DWRITE_PANOSE_LETTERFORM_OBLIQUE_BOXED = 0xB, // 11 + DWRITE_PANOSE_LETTERFORM_OBLIQUE_FLATTENED = 0xC, // 12 + DWRITE_PANOSE_LETTERFORM_OBLIQUE_ROUNDED = 0xD, // 13 + DWRITE_PANOSE_LETTERFORM_OBLIQUE_OFF_CENTER = 0xE, // 14 + DWRITE_PANOSE_LETTERFORM_OBLIQUE_SQUARE = 0xF, // 15 +}} +ENUM!{enum DWRITE_PANOSE_MIDLINE { + DWRITE_PANOSE_MIDLINE_ANY = 0x0, // 0 + DWRITE_PANOSE_MIDLINE_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_MIDLINE_STANDARD_TRIMMED = 0x2, // 2 + DWRITE_PANOSE_MIDLINE_STANDARD_POINTED = 0x3, // 3 + DWRITE_PANOSE_MIDLINE_STANDARD_SERIFED = 0x4, // 4 + DWRITE_PANOSE_MIDLINE_HIGH_TRIMMED = 0x5, // 5 + DWRITE_PANOSE_MIDLINE_HIGH_POINTED = 0x6, // 6 + DWRITE_PANOSE_MIDLINE_HIGH_SERIFED = 0x7, // 7 + DWRITE_PANOSE_MIDLINE_CONSTANT_TRIMMED = 0x8, // 8 + DWRITE_PANOSE_MIDLINE_CONSTANT_POINTED = 0x9, // 9 + DWRITE_PANOSE_MIDLINE_CONSTANT_SERIFED = 0xA, // 10 + DWRITE_PANOSE_MIDLINE_LOW_TRIMMED = 0xB, // 11 + DWRITE_PANOSE_MIDLINE_LOW_POINTED = 0xC, // 12 + DWRITE_PANOSE_MIDLINE_LOW_SERIFED = 0xD, // 13 +}} +ENUM!{enum DWRITE_PANOSE_XHEIGHT { + DWRITE_PANOSE_XHEIGHT_ANY = 0x0, // 0 + DWRITE_PANOSE_XHEIGHT_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_XHEIGHT_CONSTANT_SMALL = 0x2, // 2 + DWRITE_PANOSE_XHEIGHT_CONSTANT_STANDARD = 0x3, // 3 + DWRITE_PANOSE_XHEIGHT_CONSTANT_LARGE = 0x4, // 4 + DWRITE_PANOSE_XHEIGHT_DUCKING_SMALL = 0x5, // 5 + DWRITE_PANOSE_XHEIGHT_DUCKING_STANDARD = 0x6, // 6 + DWRITE_PANOSE_XHEIGHT_DUCKING_LARGE = 0x7, // 7 + DWRITE_PANOSE_XHEIGHT_CONSTANT_STD = 0x3, // 3 + DWRITE_PANOSE_XHEIGHT_DUCKING_STD = 0x6, // 6 +}} +ENUM!{enum DWRITE_PANOSE_TOOL_KIND { + DWRITE_PANOSE_TOOL_KIND_ANY = 0x0, // 0 + DWRITE_PANOSE_TOOL_KIND_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_TOOL_KIND_FLAT_NIB = 0x2, // 2 + DWRITE_PANOSE_TOOL_KIND_PRESSURE_POINT = 0x3, // 3 + DWRITE_PANOSE_TOOL_KIND_ENGRAVED = 0x4, // 4 + DWRITE_PANOSE_TOOL_KIND_BALL = 0x5, // 5 + DWRITE_PANOSE_TOOL_KIND_BRUSH = 0x6, // 6 + DWRITE_PANOSE_TOOL_KIND_ROUGH = 0x7, // 7 + DWRITE_PANOSE_TOOL_KIND_FELT_PEN_BRUSH_TIP = 0x8, // 8 + DWRITE_PANOSE_TOOL_KIND_WILD_BRUSH = 0x9, // 9 +}} +ENUM!{enum DWRITE_PANOSE_SPACING { + DWRITE_PANOSE_SPACING_ANY = 0x0, // 0 + DWRITE_PANOSE_SPACING_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_SPACING_PROPORTIONAL_SPACED = 0x2, // 2 + DWRITE_PANOSE_SPACING_MONOSPACED = 0x3, // 3 +}} +ENUM!{enum DWRITE_PANOSE_ASPECT_RATIO { + DWRITE_PANOSE_ASPECT_RATIO_ANY = 0x0, // 0 + DWRITE_PANOSE_ASPECT_RATIO_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_ASPECT_RATIO_VERY_CONDENSED = 0x2, // 2 + DWRITE_PANOSE_ASPECT_RATIO_CONDENSED = 0x3, // 3 + DWRITE_PANOSE_ASPECT_RATIO_NORMAL = 0x4, // 4 + DWRITE_PANOSE_ASPECT_RATIO_EXPANDED = 0x5, // 5 + DWRITE_PANOSE_ASPECT_RATIO_VERY_EXPANDED = 0x6, // 6 +}} +ENUM!{enum DWRITE_PANOSE_SCRIPT_TOPOLOGY { + DWRITE_PANOSE_SCRIPT_TOPOLOGY_ANY = 0x0, // 0 + DWRITE_PANOSE_SCRIPT_TOPOLOGY_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_DISCONNECTED = 0x2, // 2 + DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_TRAILING = 0x3, // 3 + DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_CONNECTED = 0x4, // 4 + DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_DISCONNECTED = 0x5, // 5 + DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_TRAILING = 0x6, // 6 + DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_CONNECTED = 0x7, // 7 + DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_DISCONNECTED = 0x8, // 8 + DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_TRAILING = 0x9, // 9 + DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_CONNECTED = 0xA, // 10 +}} +ENUM!{enum DWRITE_PANOSE_SCRIPT_FORM { + DWRITE_PANOSE_SCRIPT_FORM_ANY = 0x0, // 0 + DWRITE_PANOSE_SCRIPT_FORM_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_NO_WRAPPING = 0x2, // 2 + DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_SOME_WRAPPING = 0x3, // 3 + DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_MORE_WRAPPING = 0x4, // 4 + DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_EXTREME_WRAPPING = 0x5, // 5 + DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_NO_WRAPPING = 0x6, // 6 + DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_SOME_WRAPPING = 0x7, // 7 + DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_MORE_WRAPPING = 0x8, // 8 + DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_EXTREME_WRAPPING = 0x9, // 9 + DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_NO_WRAPPING = 0xA, // 10 + DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_SOME_WRAPPING = 0xB, // 11 + DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_MORE_WRAPPING = 0xC, // 12 + DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_EXTREME_WRAPPING = 0xD, // 13 +}} +ENUM!{enum DWRITE_PANOSE_FINIALS { + DWRITE_PANOSE_FINIALS_ANY = 0x0, // 0 + DWRITE_PANOSE_FINIALS_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_FINIALS_NONE_NO_LOOPS = 0x2, // 2 + DWRITE_PANOSE_FINIALS_NONE_CLOSED_LOOPS = 0x3, // 3 + DWRITE_PANOSE_FINIALS_NONE_OPEN_LOOPS = 0x4, // 4 + DWRITE_PANOSE_FINIALS_SHARP_NO_LOOPS = 0x5, // 5 + DWRITE_PANOSE_FINIALS_SHARP_CLOSED_LOOPS = 0x6, // 6 + DWRITE_PANOSE_FINIALS_SHARP_OPEN_LOOPS = 0x7, // 7 + DWRITE_PANOSE_FINIALS_TAPERED_NO_LOOPS = 0x8, // 8 + DWRITE_PANOSE_FINIALS_TAPERED_CLOSED_LOOPS = 0x9, // 9 + DWRITE_PANOSE_FINIALS_TAPERED_OPEN_LOOPS = 0xA, // 10 + DWRITE_PANOSE_FINIALS_ROUND_NO_LOOPS = 0xB, // 11 + DWRITE_PANOSE_FINIALS_ROUND_CLOSED_LOOPS = 0xC, // 12 + DWRITE_PANOSE_FINIALS_ROUND_OPEN_LOOPS = 0xD, // 13 +}} +ENUM!{enum DWRITE_PANOSE_XASCENT { + DWRITE_PANOSE_XASCENT_ANY = 0x0, // 0 + DWRITE_PANOSE_XASCENT_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_XASCENT_VERY_LOW = 0x2, // 2 + DWRITE_PANOSE_XASCENT_LOW = 0x3, // 3 + DWRITE_PANOSE_XASCENT_MEDIUM = 0x4, // 4 + DWRITE_PANOSE_XASCENT_HIGH = 0x5, // 5 + DWRITE_PANOSE_XASCENT_VERY_HIGH = 0x6, // 6 +}} +ENUM!{enum DWRITE_PANOSE_DECORATIVE_CLASS { + DWRITE_PANOSE_DECORATIVE_CLASS_ANY = 0x0, // 0 + DWRITE_PANOSE_DECORATIVE_CLASS_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_DECORATIVE_CLASS_DERIVATIVE = 0x2, // 2 + DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_TOPOLOGY = 0x3, // 3 + DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_ELEMENTS = 0x4, // 4 + DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_ASPECT = 0x5, // 5 + DWRITE_PANOSE_DECORATIVE_CLASS_INITIALS = 0x6, // 6 + DWRITE_PANOSE_DECORATIVE_CLASS_CARTOON = 0x7, // 7 + DWRITE_PANOSE_DECORATIVE_CLASS_PICTURE_STEMS = 0x8, // 8 + DWRITE_PANOSE_DECORATIVE_CLASS_ORNAMENTED = 0x9, // 9 + DWRITE_PANOSE_DECORATIVE_CLASS_TEXT_AND_BACKGROUND = 0xA, // 10 + DWRITE_PANOSE_DECORATIVE_CLASS_COLLAGE = 0xB, // 11 + DWRITE_PANOSE_DECORATIVE_CLASS_MONTAGE = 0xC, // 12 +}} +ENUM!{enum DWRITE_PANOSE_ASPECT { + DWRITE_PANOSE_ASPECT_ANY = 0x0, // 0 + DWRITE_PANOSE_ASPECT_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_ASPECT_SUPER_CONDENSED = 0x2, // 2 + DWRITE_PANOSE_ASPECT_VERY_CONDENSED = 0x3, // 3 + DWRITE_PANOSE_ASPECT_CONDENSED = 0x4, // 4 + DWRITE_PANOSE_ASPECT_NORMAL = 0x5, // 5 + DWRITE_PANOSE_ASPECT_EXTENDED = 0x6, // 6 + DWRITE_PANOSE_ASPECT_VERY_EXTENDED = 0x7, // 7 + DWRITE_PANOSE_ASPECT_SUPER_EXTENDED = 0x8, // 8 + DWRITE_PANOSE_ASPECT_MONOSPACED = 0x9, // 9 +}} +ENUM!{enum DWRITE_PANOSE_FILL { + DWRITE_PANOSE_FILL_ANY = 0x0, // 0 + DWRITE_PANOSE_FILL_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_FILL_STANDARD_SOLID_FILL = 0x2, // 2 + DWRITE_PANOSE_FILL_NO_FILL = 0x3, // 3 + DWRITE_PANOSE_FILL_PATTERNED_FILL = 0x4, // 4 + DWRITE_PANOSE_FILL_COMPLEX_FILL = 0x5, // 5 + DWRITE_PANOSE_FILL_SHAPED_FILL = 0x6, // 6 + DWRITE_PANOSE_FILL_DRAWN_DISTRESSED = 0x7, // 7 +}} +ENUM!{enum DWRITE_PANOSE_LINING { + DWRITE_PANOSE_LINING_ANY = 0x0, // 0 + DWRITE_PANOSE_LINING_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_LINING_NONE = 0x2, // 2 + DWRITE_PANOSE_LINING_INLINE = 0x3, // 3 + DWRITE_PANOSE_LINING_OUTLINE = 0x4, // 4 + DWRITE_PANOSE_LINING_ENGRAVED = 0x5, // 5 + DWRITE_PANOSE_LINING_SHADOW = 0x6, // 6 + DWRITE_PANOSE_LINING_RELIEF = 0x7, // 7 + DWRITE_PANOSE_LINING_BACKDROP = 0x8, // 8 +}} +ENUM!{enum DWRITE_PANOSE_DECORATIVE_TOPOLOGY { + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_ANY = 0x0, // 0 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_STANDARD = 0x2, // 2 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_SQUARE = 0x3, // 3 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_MULTIPLE_SEGMENT = 0x4, // 4 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_ART_DECO = 0x5, // 5 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_UNEVEN_WEIGHTING = 0x6, // 6 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_DIVERSE_ARMS = 0x7, // 7 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_DIVERSE_FORMS = 0x8, // 8 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_LOMBARDIC_FORMS = 0x9, // 9 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_UPPER_CASE_IN_LOWER_CASE = 0xA, // 10 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_IMPLIED_TOPOLOGY = 0xB, // 11 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_HORSESHOE_E_AND_A = 0xC, // 12 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_CURSIVE = 0xD, // 13 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_BLACKLETTER = 0xE, // 14 + DWRITE_PANOSE_DECORATIVE_TOPOLOGY_SWASH_VARIANCE = 0xF, // 15 +}} +ENUM!{enum DWRITE_PANOSE_CHARACTER_RANGES { + DWRITE_PANOSE_CHARACTER_RANGES_ANY = 0x0, // 0 + DWRITE_PANOSE_CHARACTER_RANGES_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_CHARACTER_RANGES_EXTENDED_COLLECTION = 0x2, // 2 + DWRITE_PANOSE_CHARACTER_RANGES_LITERALS = 0x3, // 3 + DWRITE_PANOSE_CHARACTER_RANGES_NO_LOWER_CASE = 0x4, // 4 + DWRITE_PANOSE_CHARACTER_RANGES_SMALL_CAPS = 0x5, // 5 +}} +ENUM!{enum DWRITE_PANOSE_SYMBOL_KIND { + DWRITE_PANOSE_SYMBOL_KIND_ANY = 0x0, // 0 + DWRITE_PANOSE_SYMBOL_KIND_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_SYMBOL_KIND_MONTAGES = 0x2, // 2 + DWRITE_PANOSE_SYMBOL_KIND_PICTURES = 0x3, // 3 + DWRITE_PANOSE_SYMBOL_KIND_SHAPES = 0x4, // 4 + DWRITE_PANOSE_SYMBOL_KIND_SCIENTIFIC = 0x5, // 5 + DWRITE_PANOSE_SYMBOL_KIND_MUSIC = 0x6, // 6 + DWRITE_PANOSE_SYMBOL_KIND_EXPERT = 0x7, // 7 + DWRITE_PANOSE_SYMBOL_KIND_PATTERNS = 0x8, // 8 + DWRITE_PANOSE_SYMBOL_KIND_BOARDERS = 0x9, // 9 + DWRITE_PANOSE_SYMBOL_KIND_ICONS = 0xA, // 10 + DWRITE_PANOSE_SYMBOL_KIND_LOGOS = 0xB, // 11 + DWRITE_PANOSE_SYMBOL_KIND_INDUSTRY_SPECIFIC = 0xC, // 12 +}} +ENUM!{enum DWRITE_PANOSE_SYMBOL_ASPECT_RATIO { + DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_ANY = 0x0, // 0 + DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NO_FIT = 0x1, // 1 + DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NO_WIDTH = 0x2, // 2 + DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_EXCEPTIONALLY_WIDE = 0x3, // 3 + DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_SUPER_WIDE = 0x4, // 4 + DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_VERY_WIDE = 0x5, // 5 + DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_WIDE = 0x6, // 6 + DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NORMAL = 0x7, // 7 + DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NARROW = 0x8, // 8 + DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_VERY_NARROW = 0x9, // 9 +}} +ENUM!{enum DWRITE_OUTLINE_THRESHOLD { + DWRITE_OUTLINE_THRESHOLD_ANTIALIASED = 0x0, // 0 + DWRITE_OUTLINE_THRESHOLD_ALIASED = 0x1, // 1 +}} +ENUM!{enum DWRITE_BASELINE { + DWRITE_BASELINE_DEFAULT = 0x0, // 0 + DWRITE_BASELINE_ROMAN = 0x1, // 1 + DWRITE_BASELINE_CENTRAL = 0x2, // 2 + DWRITE_BASELINE_MATH = 0x3, // 3 + DWRITE_BASELINE_HANGING = 0x4, // 4 + DWRITE_BASELINE_IDEOGRAPHIC_BOTTOM = 0x5, // 5 + DWRITE_BASELINE_IDEOGRAPHIC_TOP = 0x6, // 6 + DWRITE_BASELINE_MINIMUM = 0x7, // 7 + DWRITE_BASELINE_MAXIMUM = 0x8, // 8 +}} +ENUM!{enum DWRITE_VERTICAL_GLYPH_ORIENTATION { + DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT = 0x0, // 0 + DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED = 0x1, // 1 +}} +ENUM!{enum DWRITE_GLYPH_ORIENTATION_ANGLE { + DWRITE_GLYPH_ORIENTATION_ANGLE_0_DEGREES = 0x0, // 0 + DWRITE_GLYPH_ORIENTATION_ANGLE_90_DEGREES = 0x1, // 1 + DWRITE_GLYPH_ORIENTATION_ANGLE_180_DEGREES = 0x2, // 2 + DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES = 0x3, // 3 +}} +STRUCT!{struct DWRITE_FONT_METRICS1 { + designUnitsPerEm: UINT16, + ascent: UINT16, + descent: UINT16, + lineGap: INT16, + capHeight: UINT16, + xHeight: UINT16, + underlinePosition: INT16, + underlineThickness: UINT16, + strikethroughPosition: INT16, + strikethroughThickness: UINT16, + glyphBoxLeft: INT16, + glyphBoxTop: INT16, + glyphBoxRight: INT16, + glyphBoxBottom: INT16, + subscriptPositionX: INT16, + subscriptPositionY: INT16, + subscriptSizeX: INT16, + subscriptSizeY: INT16, + superscriptPositionX: INT16, + superscriptPositionY: INT16, + superscriptSizeX: INT16, + superscriptSizeY: INT16, + hasTypographicMetrics: BOOL, +}} +STRUCT!{struct DWRITE_CARET_METRICS { + slopeRise: INT16, + slopeRun: INT16, + offset: INT16, +}} +STRUCT!{struct DWRITE_PANOSE_text { + familyKind: UINT8, + serifStyle: UINT8, + weight: UINT8, + proportion: UINT8, + contrast: UINT8, + strokeVariation: UINT8, + armStyle: UINT8, + letterform: UINT8, + midline: UINT8, + xHeight: UINT8, +}} +STRUCT!{struct DWRITE_PANOSE_script { + familyKind: UINT8, + toolKind: UINT8, + weight: UINT8, + spacing: UINT8, + aspectRatio: UINT8, + contrast: UINT8, + scriptTopology: UINT8, + scriptForm: UINT8, + finials: UINT8, + xAscent: UINT8, +}} +STRUCT!{struct DWRITE_PANOSE_decorative { + familyKind: UINT8, + decorativeClass: UINT8, + weight: UINT8, + aspect: UINT8, + contrast: UINT8, + serifVariant: UINT8, + fill: UINT8, + lining: UINT8, + decorativeTopology: UINT8, + characterRange: UINT8, +}} +STRUCT!{struct DWRITE_PANOSE_symbol { + familyKind: UINT8, + symbolKind: UINT8, + weight: UINT8, + spacing: UINT8, + aspectRatioAndContrast: UINT8, + aspectRatio94: UINT8, + aspectRatio119: UINT8, + aspectRatio157: UINT8, + aspectRatio163: UINT8, + aspectRatio211: UINT8, +}} +UNION!{union DWRITE_PANOSE { + [u8; 10], + values values_mut: [UINT8; 10], + familyKind familyKind_mut: UINT8, + text text_mut: DWRITE_PANOSE_text, + script script_mut: DWRITE_PANOSE_script, + decorative decorative_mut: DWRITE_PANOSE_decorative, + symbol symbol_mut: DWRITE_PANOSE_symbol, +}} +STRUCT!{struct DWRITE_UNICODE_RANGE { + first: UINT32, + last: UINT32, +}} +STRUCT!{struct DWRITE_SCRIPT_PROPERTIES { + isoScriptCode: UINT32, + isoScriptNumber: UINT32, + clusterLookahead: UINT32, + justificationCharacter: UINT32, + bitfield0: UINT32, +}} +BITFIELD!{DWRITE_SCRIPT_PROPERTIES bitfield0: UINT32 [ + restrictCaretToClusters set_restrictCaretToClusters[0..1], + usesWordDividers set_usesWordDividers[1..2], + isDiscreteWriting set_isDiscreteWriting[2..3], + isBlockWriting set_isBlockWriting[3..4], + isDistributedWithinCluster set_isDistributedWithinCluster[4..5], + isConnectedWriting set_isConnectedWriting[5..6], + isCursiveWriting set_isCursiveWriting[6..7], + reserved set_reserved[7..32], +]} +STRUCT!{struct DWRITE_JUSTIFICATION_OPPORTUNITY { + expansionMinimum: FLOAT, + expansionMaximum: FLOAT, + compressionMaximum: FLOAT, + bitfield0: UINT32, +}} +BITFIELD!{DWRITE_JUSTIFICATION_OPPORTUNITY bitfield0: UINT32 [ + expansionPriority set_expansionPriority[0..8], + compressionPriority set_compressionPriority[8..16], + allowResidualExpansion set_allowResidualExpansion[16..17], + allowResidualCompression set_allowResidualCompression[17..18], + applyToLeadingEdge set_applyToLeadingEdge[18..19], + applyToTrailingEdge set_applyToTrailingEdge[19..20], + reserved set_reserved[20..32], +]} +RIDL!{#[uuid(0x30572f99, 0xdac6, 0x41db, 0xa1, 0x6e, 0x04, 0x86, 0x30, 0x7e, 0x60, 0x6a)] +interface IDWriteFactory1(IDWriteFactory1Vtbl): IDWriteFactory(IDWriteFactoryVtbl) { + fn GetEudcFontCollection( + fontCollection: *mut *mut IDWriteFontCollection, + checkForUpdates: BOOL, + ) -> HRESULT, + fn CreateCustomRenderingParams( + gamma: FLOAT, + enhancedContrast: FLOAT, + enhancedContrastGrayscale: FLOAT, + clearTypeLevel: FLOAT, + pixelGeometry: DWRITE_PIXEL_GEOMETRY, + renderingMode: DWRITE_RENDERING_MODE, + renderingParams: *mut *mut IDWriteRenderingParams1, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa71efdb4, 0x9fdb, 0x4838, 0xad, 0x90, 0xcf, 0xc3, 0xbe, 0x8c, 0x3d, 0xaf)] +interface IDWriteFontFace1(IDWriteFontFace1Vtbl): IDWriteFontFace(IDWriteFontFaceVtbl) { + fn GetMetrics( + fontMetrics: *mut DWRITE_FONT_METRICS1, + ) -> (), + fn GetGdiCompatibleMetrics( + emSize: FLOAT, + pixelsPerDip: FLOAT, + transform: *const DWRITE_MATRIX, + fontMetrics: *mut DWRITE_FONT_METRICS1, + ) -> HRESULT, + fn GetCaretMetrics( + caretMetrics: *mut DWRITE_CARET_METRICS, + ) -> (), + fn GetUnicodeRanges( + maxRangeCount: UINT32, + unicodeRanges: *mut DWRITE_UNICODE_RANGE, + actualRangeCount: *mut UINT32, + ) -> HRESULT, + fn IsMonospacedFont() -> BOOL, + fn GetDesignGlyphAdvances( + glyphCount: UINT32, + glyphIndices: *const UINT16, + glyphAdvances: *mut INT32, + isSideways: BOOL, + ) -> HRESULT, + fn GetGdiCompatibleGlyphAdvances( + emSize: FLOAT, + pixelsPerDip: FLOAT, + transform: *const DWRITE_MATRIX, + useGdiNatural: BOOL, + isSideways: BOOL, + glyphCount: UINT32, + glyphIndices: *const UINT16, + glyphAdvances: *mut INT32, + ) -> HRESULT, + fn GetKerningPairAdjustments( + glyphCount: UINT32, + glyphIndices: *const UINT16, + glyphAdvanceAdjustments: *mut INT32, + ) -> HRESULT, + fn HasKerningPairs() -> BOOL, + fn GetRecommendedRenderingMode( + fontEmSize: FLOAT, + dpiX: FLOAT, + dpiY: FLOAT, + transform: *const DWRITE_MATRIX, + isSideways: BOOL, + outlineThreshold: DWRITE_OUTLINE_THRESHOLD, + measuringMode: DWRITE_MEASURING_MODE, + renderingMode: *mut DWRITE_RENDERING_MODE, + ) -> HRESULT, + fn GetVerticalGlyphVariants( + glyphCount: UINT32, + nominalGlyphIndices: *const UINT16, + verticalGlyphIndices: *mut UINT16, + ) -> HRESULT, + fn HasVerticalGlyphVariants() -> BOOL, +}} +RIDL!{#[uuid(0xacd16696, 0x8c14, 0x4f5d, 0x87, 0x7e, 0xfe, 0x3f, 0xc1, 0xd3, 0x27, 0x38)] +interface IDWriteFont1(IDWriteFont1Vtbl): IDWriteFont(IDWriteFontVtbl) { + fn GetMetrics( + fontMetrics: *mut DWRITE_FONT_METRICS1, + ) -> (), + fn GetPanose( + panose: *mut DWRITE_PANOSE, + ) -> (), + fn GetUnicodeRanges( + maxRangeCount: UINT32, + unicodeRanges: *mut DWRITE_UNICODE_RANGE, + actualRangeCount: *mut UINT32, + ) -> HRESULT, + fn IsMonospacedFont() -> BOOL, +}} +RIDL!{#[uuid(0x94413cf4, 0xa6fc, 0x4248, 0x8b, 0x50, 0x66, 0x74, 0x34, 0x8f, 0xca, 0xd3)] +interface IDWriteRenderingParams1(IDWriteRenderingParams1Vtbl): + IDWriteRenderingParams(IDWriteRenderingParamsVtbl) { + fn GetGrayscaleEnhancedContrast() -> FLOAT, +}} +RIDL!{#[uuid(0x80dad800, 0xe21f, 0x4e83, 0x96, 0xce, 0xbf, 0xcc, 0xe5, 0x00, 0xdb, 0x7c)] +interface IDWriteTextAnalyzer1(IDWriteTextAnalyzer1Vtbl): + IDWriteTextAnalyzer(IDWriteTextAnalyzerVtbl) { + fn ApplyCharacterSpacing( + leadingSpacing: FLOAT, + trailingSpacing: FLOAT, + minimumAdvanceWidth: FLOAT, + textLength: UINT32, + glyphCount: UINT32, + clusterMap: *const UINT16, + glyphAdvances: *const FLOAT, + glyphOffsets: *const DWRITE_GLYPH_OFFSET, + glyphProperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, + modifiedGlyphAdvances: *mut FLOAT, + modifiedGlyphOffsets: *mut DWRITE_GLYPH_OFFSET, + ) -> HRESULT, + fn GetBaseline( + fontFace: *mut IDWriteFontFace, + baseline: DWRITE_BASELINE, + isVertical: BOOL, + isSimulationAllowed: BOOL, + scriptAnalysis: DWRITE_SCRIPT_ANALYSIS, + localeName: *const WCHAR, + baselineCoordinate: *mut INT32, + exists: *mut BOOL, + ) -> HRESULT, + fn AnalyzeVerticalGlyphOrientation( + analysisSource: *mut IDWriteTextAnalysisSource1, + textPosition: UINT32, + textLength: UINT32, + analysisSink: *mut IDWriteTextAnalysisSink1, + ) -> HRESULT, + fn GetGlyphOrientationTransform( + glyphOrientationAngle: DWRITE_GLYPH_ORIENTATION_ANGLE, + isSideways: BOOL, + transform: *mut DWRITE_MATRIX, + ) -> HRESULT, + fn GetScriptProperties( + scriptAnalysis: DWRITE_SCRIPT_ANALYSIS, + scriptProperties: *mut DWRITE_SCRIPT_PROPERTIES, + ) -> HRESULT, + fn GetTextComplexity( + textString: *const WCHAR, + textLength: UINT32, + fontFace: *mut IDWriteFontFace, + isTextSimple: *mut BOOL, + textLengthRead: *mut UINT32, + glyphIndices: *mut UINT16, + ) -> HRESULT, + fn GetJustificationOpportunities( + fontFace: *mut IDWriteFontFace, + fontEmSize: FLOAT, + scriptAnalysis: DWRITE_SCRIPT_ANALYSIS, + textLength: UINT32, + glyphCount: UINT32, + textString: *const WCHAR, + clusterMap: *const UINT16, + glyphProperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, + justificationOpportunities: *mut DWRITE_JUSTIFICATION_OPPORTUNITY, + ) -> HRESULT, + fn JustifyGlyphAdvances( + lineWidth: FLOAT, + glyphCount: UINT32, + justificationOpportunities: *const DWRITE_JUSTIFICATION_OPPORTUNITY, + glyphAdvances: *const FLOAT, + glyphOffsets: *const DWRITE_GLYPH_OFFSET, + justifiedGlyphAdvances: *mut FLOAT, + justifiedGlyphOffsets: *mut DWRITE_GLYPH_OFFSET, + ) -> HRESULT, + fn GetJustifiedGlyphs( + fontFace: *mut IDWriteFontFace, + fontEmSize: FLOAT, + scriptAnalysis: DWRITE_SCRIPT_ANALYSIS, + textLength: UINT32, + glyphCount: UINT32, + maxGlyphCount: UINT32, + clusterMap: *const UINT16, + glyphIndices: *const UINT16, + glyphAdvances: *const FLOAT, + justifiedGlyphAdvances: *const FLOAT, + justifiedGlyphOffsets: *const DWRITE_GLYPH_OFFSET, + glyphProperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, + actualGlyphCount: *mut UINT32, + modifiedClusterMap: *mut UINT16, + modifiedGlyphIndices: *mut UINT16, + modifiedGlyphAdvances: *mut FLOAT, + modifiedGlyphOffsets: *mut DWRITE_GLYPH_OFFSET, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x639cfad8, 0x0fb4, 0x4b21, 0xa5, 0x8a, 0x06, 0x79, 0x20, 0x12, 0x00, 0x09)] +interface IDWriteTextAnalysisSource1(IDWriteTextAnalysisSource1Vtbl): + IDWriteTextAnalysisSource(IDWriteTextAnalysisSourceVtbl) { + fn GetVerticalGlyphOrientation( + textPosition: UINT32, + textLength: *mut UINT32, + glyphOrientation: *mut DWRITE_VERTICAL_GLYPH_ORIENTATION, + bidiLevel: *mut UINT8, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb0d941a0, 0x85e7, 0x4d8b, 0x9f, 0xd3, 0x5c, 0xed, 0x99, 0x34, 0x48, 0x2a)] +interface IDWriteTextAnalysisSink1(IDWriteTextAnalysisSink1Vtbl): + IDWriteTextAnalysisSink(IDWriteTextAnalysisSinkVtbl) { + fn SetGlyphOrientation( + textPosition: UINT32, + textLength: UINT32, + glyphOrientationAngle: DWRITE_GLYPH_ORIENTATION_ANGLE, + adjustedBidiLevel: UINT8, + isSideways: BOOL, + isRightToLeft: BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9064d822, 0x80a7, 0x465c, 0xa9, 0x86, 0xdf, 0x65, 0xf7, 0x8b, 0x8f, 0xeb)] +interface IDWriteTextLayout1(IDWriteTextLayout1Vtbl): + IDWriteTextLayout(IDWriteTextLayoutVtbl) { + fn SetPairKerning( + isPairKerningEnabled: BOOL, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetPairKerning( + currentPosition: UINT32, + isPairKerningEnabled: *mut BOOL, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn SetCharacterSpacing( + leadingSpacing: FLOAT, + trailingSpacing: FLOAT, + minimumAdvanceWidth: FLOAT, + textRange: DWRITE_TEXT_RANGE, + ) -> HRESULT, + fn GetCharacterSpacing( + currentPosition: UINT32, + leadingSpacing: *mut FLOAT, + trailingSpacing: *mut FLOAT, + minimumAdvanceWidth: *mut FLOAT, + textRange: *mut DWRITE_TEXT_RANGE, + ) -> HRESULT, +}} +ENUM!{enum DWRITE_TEXT_ANTIALIAS_MODE { + DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE = 0x0, // 0 + DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE = 0x1, // 1 +}} +RIDL!{#[uuid(0x791e8298, 0x3ef3, 0x4230, 0x98, 0x80, 0xc9, 0xbd, 0xec, 0xc4, 0x20, 0x64)] +interface IDWriteBitmapRenderTarget1(IDWriteBitmapRenderTarget1Vtbl): + IDWriteBitmapRenderTarget(IDWriteBitmapRenderTargetVtbl) { + fn GetTextAntialiasMode() -> DWRITE_TEXT_ANTIALIAS_MODE, + fn SetTextAntialiasMode( + antialiasMode: DWRITE_TEXT_ANTIALIAS_MODE, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/dwrite_2.rs b/bash-5.1/vendor/winapi/src/um/dwrite_2.rs new file mode 100644 index 0000000000000000000000000000000000000000..e9810bba05331ae07d459325b9cdec064fe77f3b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dwrite_2.rs @@ -0,0 +1,293 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the content of dwrite_2.h +use ctypes::{c_void, wchar_t}; +use shared::basetsd::{UINT16, UINT32, UINT8}; +use shared::d3d9types::D3DCOLORVALUE; +use shared::minwindef::{BOOL, FLOAT}; +use um::dcommon::DWRITE_MEASURING_MODE; +use um::dwrite::{ + DWRITE_FONT_FEATURE_TAG, DWRITE_FONT_STRETCH, DWRITE_FONT_STYLE, DWRITE_FONT_WEIGHT, + DWRITE_GLYPH_RUN, DWRITE_GLYPH_RUN_DESCRIPTION, DWRITE_MATRIX, DWRITE_PIXEL_GEOMETRY, + DWRITE_RENDERING_MODE, DWRITE_SCRIPT_ANALYSIS, DWRITE_STRIKETHROUGH, DWRITE_UNDERLINE, + IDWriteFont, IDWriteFontCollection, IDWriteFontFace, IDWriteGlyphRunAnalysis, + IDWriteInlineObject, IDWriteRenderingParams, IDWriteTextAnalysisSource, IDWriteTextFormat, + IDWriteTextFormatVtbl, IDWriteTextRenderer, IDWriteTextRendererVtbl, +}; +use um::dwrite_1::{ + DWRITE_GLYPH_ORIENTATION_ANGLE, DWRITE_OUTLINE_THRESHOLD, DWRITE_TEXT_ANTIALIAS_MODE, + DWRITE_UNICODE_RANGE, DWRITE_VERTICAL_GLYPH_ORIENTATION, IDWriteFactory1, + IDWriteFactory1Vtbl, IDWriteFont1, IDWriteFont1Vtbl, IDWriteFontFace1, IDWriteFontFace1Vtbl, + IDWriteRenderingParams1, IDWriteRenderingParams1Vtbl, IDWriteTextAnalyzer1, + IDWriteTextAnalyzer1Vtbl, IDWriteTextLayout1, IDWriteTextLayout1Vtbl, +}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, WCHAR}; +ENUM!{enum DWRITE_OPTICAL_ALIGNMENT { + DWRITE_OPTICAL_ALIGNMENT_NONE = 0x0, // 0 + DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS = 0x1, // 1 +}} +ENUM!{enum DWRITE_GRID_FIT_MODE { + DWRITE_GRID_FIT_MODE_DEFAULT = 0x0, // 0 + DWRITE_GRID_FIT_MODE_DISABLED = 0x1, // 1 + DWRITE_GRID_FIT_MODE_ENABLED = 0x2, // 2 +}} +STRUCT!{struct DWRITE_TEXT_METRICS1 { + left: FLOAT, + top: FLOAT, + width: FLOAT, + widthIncludingTrailingWhitespace: FLOAT, + height: FLOAT, + layoutWidth: FLOAT, + layoutHeight: FLOAT, + maxBidiReorderingDepth: UINT32, + lineCount: UINT32, + heightIncludingTrailingWhitespace: FLOAT, +}} +RIDL!{#[uuid(0xd3e0e934, 0x22a0, 0x427e, 0xaa, 0xe4, 0x7d, 0x95, 0x74, 0xb5, 0x9d, 0xb1)] +interface IDWriteTextRenderer1(IDWriteTextRenderer1Vtbl): + IDWriteTextRenderer(IDWriteTextRendererVtbl) { + fn DrawGlyphRun( + clientDrawingContext: *mut c_void, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + orientationAngle: DWRITE_GLYPH_ORIENTATION_ANGLE, + measuringMode: DWRITE_MEASURING_MODE, + glyphRun: *const DWRITE_GLYPH_RUN, + glyphRunDescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, + clientDrawingEffect: *mut IUnknown, + ) -> HRESULT, + fn DrawUnderline( + clientDrawingContext: *mut c_void, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + orientationAngle: DWRITE_GLYPH_ORIENTATION_ANGLE, + underline: *const DWRITE_UNDERLINE, + clientDrawingEffect: *mut IUnknown, + ) -> HRESULT, + fn DrawStrikethrough( + clientDrawingContext: *mut c_void, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + orientationAngle: DWRITE_GLYPH_ORIENTATION_ANGLE, + strikethrough: *const DWRITE_STRIKETHROUGH, + clientDrawingEffect: *mut IUnknown, + ) -> HRESULT, + fn DrawInlineObject( + clientDrawingContext: *mut c_void, + originX: FLOAT, + originY: FLOAT, + orientationAngle: DWRITE_GLYPH_ORIENTATION_ANGLE, + inlineObject: *mut IDWriteInlineObject, + isSideways: BOOL, + isRightToLeft: BOOL, + clientDrawingEffect: *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5f174b49, 0x0d8b, 0x4cfb, 0x8b, 0xca, 0xf1, 0xcc, 0xe9, 0xd0, 0x6c, 0x67)] +interface IDWriteTextFormat1(IDWriteTextFormat1Vtbl): + IDWriteTextFormat(IDWriteTextFormatVtbl) { + fn SetVerticalGlyphOrientation( + glyphOrientation: DWRITE_VERTICAL_GLYPH_ORIENTATION, + ) -> HRESULT, + fn GetVerticalGlyphOrientation() -> DWRITE_VERTICAL_GLYPH_ORIENTATION, + fn SetLastLineWrapping( + isLastLineWrappingEnabled: BOOL, + ) -> HRESULT, + fn GetLastLineWrapping() -> BOOL, + fn SetOpticalAlignment( + opticalAlignment: DWRITE_OPTICAL_ALIGNMENT, + ) -> HRESULT, + fn GetOpticalAlignment() -> DWRITE_OPTICAL_ALIGNMENT, + fn SetFontFallback( + fontFallback: *mut IDWriteFontFallback, + ) -> HRESULT, + fn GetFontFallback( + fontFallback: *mut *mut IDWriteFontFallback, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1093c18f, 0x8d5e, 0x43f0, 0xb0, 0x64, 0x09, 0x17, 0x31, 0x1b, 0x52, 0x5e)] +interface IDWriteTextLayout2(IDWriteTextLayout2Vtbl): + IDWriteTextLayout1(IDWriteTextLayout1Vtbl) { + fn GetMetrics( + textMetrics: *mut DWRITE_TEXT_METRICS1, + ) -> HRESULT, + fn SetVerticalGlyphOrientation( + glyphOrientation: DWRITE_VERTICAL_GLYPH_ORIENTATION, + ) -> HRESULT, + fn GetVerticalGlyphOrientation() -> DWRITE_VERTICAL_GLYPH_ORIENTATION, + fn SetLastLineWrapping( + isLastLineWrappingEnabled: BOOL, + ) -> HRESULT, + fn GetLastLineWrapping() -> BOOL, + fn SetOpticalAlignment( + opticalAlignment: DWRITE_OPTICAL_ALIGNMENT, + ) -> HRESULT, + fn GetOpticalAlignment() -> DWRITE_OPTICAL_ALIGNMENT, + fn SetFontFallback( + fontFallback: *mut IDWriteFontFallback, + ) -> HRESULT, + fn GetFontFallback( + fontFallback: *mut *mut IDWriteFontFallback, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x553a9ff3, 0x5693, 0x4df7, 0xb5, 0x2b, 0x74, 0x80, 0x6f, 0x7f, 0x2e, 0xb9)] +interface IDWriteTextAnalyzer2(IDWriteTextAnalyzer2Vtbl): + IDWriteTextAnalyzer1(IDWriteTextAnalyzer1Vtbl) { + fn GetGlyphOrientationTransform( + glyphOrientationAngle: DWRITE_GLYPH_ORIENTATION_ANGLE, + isSideways: BOOL, + originX: FLOAT, + originY: FLOAT, + transform: *mut DWRITE_MATRIX, + ) -> HRESULT, + fn GetTypographicFeatures( + fontFace: *mut IDWriteFontFace, + scriptAnalysis: DWRITE_SCRIPT_ANALYSIS, + localeName: *const WCHAR, + maxTagCount: UINT32, + actualTagCount: *mut UINT32, + tags: *mut DWRITE_FONT_FEATURE_TAG, + ) -> HRESULT, + fn CheckTypographicFeature( + fontFace: *mut IDWriteFontFace, + scriptAnalysis: DWRITE_SCRIPT_ANALYSIS, + localeName: *const WCHAR, + featureTag: DWRITE_FONT_FEATURE_TAG, + glyphCount: UINT32, + glyphIndices: *const UINT16, + featureApplies: *mut UINT8, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xefa008f9, 0xf7a1, 0x48bf, 0xb0, 0x5c, 0xf2, 0x24, 0x71, 0x3c, 0xc0, 0xff)] +interface IDWriteFontFallback(IDWriteFontFallbackVtbl): IUnknown(IUnknownVtbl) { + fn MapCharacters( + analysisSource: *mut IDWriteTextAnalysisSource, + textPosition: UINT32, + textLength: UINT32, + baseFontCollection: *mut IDWriteFontCollection, + baseFamilyName: *mut wchar_t, + baseWeight: DWRITE_FONT_WEIGHT, + baseStyle: DWRITE_FONT_STYLE, + baseStretch: DWRITE_FONT_STRETCH, + mappedLength: *mut UINT32, + mappedFont: *mut *mut IDWriteFont, + scale: *mut FLOAT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xfd882d06, 0x8aba, 0x4fb8, 0xb8, 0x49, 0x8b, 0xe8, 0xb7, 0x3e, 0x14, 0xde)] +interface IDWriteFontFallbackBuilder(IDWriteFontFallbackBuilderVtbl): + IUnknown(IUnknownVtbl) { + fn AddMapping( + ranges: *const DWRITE_UNICODE_RANGE, + rangesCount: UINT32, + targetFamilyNames: *mut *const WCHAR, + targetFamilyNamesCount: UINT32, + fontCollection: *mut IDWriteFontCollection, + localeName: *const WCHAR, + baseFamilyName: *const WCHAR, + scale: FLOAT, + ) -> HRESULT, + fn AddMappings( + fontFallback: *mut IDWriteFontFallback, + ) -> HRESULT, + fn CreateFontFallback( + fontFallback: *mut *mut IDWriteFontFallback, + ) -> HRESULT, +}} +pub type DWRITE_COLOR_F = D3DCOLORVALUE; +RIDL!{#[uuid(0x29748ed6, 0x8c9c, 0x4a6a, 0xbe, 0x0b, 0xd9, 0x12, 0xe8, 0x53, 0x89, 0x44)] +interface IDWriteFont2(IDWriteFont2Vtbl): IDWriteFont1(IDWriteFont1Vtbl) { + fn IsColorFont() -> BOOL, +}} +RIDL!{#[uuid(0xd8b768ff, 0x64bc, 0x4e66, 0x98, 0x2b, 0xec, 0x8e, 0x87, 0xf6, 0x93, 0xf7)] +interface IDWriteFontFace2(IDWriteFontFace2Vtbl): + IDWriteFontFace1(IDWriteFontFace1Vtbl) { + fn IsColorFont() -> BOOL, + fn GetColorPaletteCount() -> UINT32, + fn GetPaletteEntryCount() -> UINT32, + fn GetPaletteEntries( + colorPaletteIndex: UINT32, + firstEntryIndex: UINT32, + entryCount: UINT32, + paletteEntries: *mut DWRITE_COLOR_F, + ) -> HRESULT, + fn GetRecommendedRenderingMode( + fontEmSize: FLOAT, + dpiX: FLOAT, + dpiY: FLOAT, + transform: *const DWRITE_MATRIX, + isSideways: BOOL, + outlineThreshold: DWRITE_OUTLINE_THRESHOLD, + measuringMode: DWRITE_MEASURING_MODE, + renderingParams: *mut IDWriteRenderingParams, + renderingMode: *mut DWRITE_RENDERING_MODE, + gridFitMode: *mut DWRITE_GRID_FIT_MODE, + ) -> HRESULT, +}} +STRUCT!{struct DWRITE_COLOR_GLYPH_RUN { + glyphRun: DWRITE_GLYPH_RUN, + glyphRunDescription: *mut DWRITE_GLYPH_RUN_DESCRIPTION, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + runColor: DWRITE_COLOR_F, + paletteIndex: UINT16, +}} +RIDL!{#[uuid(0xd31fbe17, 0xf157, 0x41a2, 0x8d, 0x24, 0xcb, 0x77, 0x9e, 0x05, 0x60, 0xe8)] +interface IDWriteColorGlyphRunEnumerator(IDWriteColorGlyphRunEnumeratorVtbl): + IUnknown(IUnknownVtbl) { + fn MoveNext( + hasRun: *mut BOOL, + ) -> HRESULT, + fn GetCurrentRun( + colorGlyphRun: *mut *const DWRITE_COLOR_GLYPH_RUN, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf9d711c3, 0x9777, 0x40ae, 0x87, 0xe8, 0x3e, 0x5a, 0xf9, 0xbf, 0x09, 0x48)] +interface IDWriteRenderingParams2(IDWriteRenderingParams2Vtbl): + IDWriteRenderingParams1(IDWriteRenderingParams1Vtbl) { + fn GetGridFitMode() -> DWRITE_GRID_FIT_MODE, +}} +RIDL!{#[uuid(0x0439fc60, 0xca44, 0x4994, 0x8d, 0xee, 0x3a, 0x9a, 0xf7, 0xb7, 0x32, 0xec)] +interface IDWriteFactory2(IDWriteFactory2Vtbl): IDWriteFactory1(IDWriteFactory1Vtbl) { + fn GetSystemFontFallback( + fontFallback: *mut *mut IDWriteFontFallback, + ) -> HRESULT, + fn CreateFontFallbackBuilder( + fontFallbackBuilder: *mut *mut IDWriteFontFallbackBuilder, + ) -> HRESULT, + fn TranslateColorGlyphRun( + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + glyphRun: *const DWRITE_GLYPH_RUN, + glyphRunDescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, + measuringMode: DWRITE_MEASURING_MODE, + worldToDeviceTransform: *const DWRITE_MATRIX, + colorPaletteIndex: UINT32, + colorLayers: *mut *mut IDWriteColorGlyphRunEnumerator, + ) -> HRESULT, + fn CreateCustomRenderingParams( + gamma: FLOAT, + enhancedContrast: FLOAT, + grayscaleEnhancedContrast: FLOAT, + clearTypeLevel: FLOAT, + pixelGeometry: DWRITE_PIXEL_GEOMETRY, + renderingMode: DWRITE_RENDERING_MODE, + gridFitMode: DWRITE_GRID_FIT_MODE, + renderingParams: *mut *mut IDWriteRenderingParams2, + ) -> HRESULT, + fn CreateGlyphRunAnalysis( + glyphRun: *const DWRITE_GLYPH_RUN, + transform: *const DWRITE_MATRIX, + renderingMode: DWRITE_RENDERING_MODE, + measuringMode: DWRITE_MEASURING_MODE, + gridFitMode: DWRITE_GRID_FIT_MODE, + antialiasMode: DWRITE_TEXT_ANTIALIAS_MODE, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + glyphRunAnalysis: *mut *mut IDWriteGlyphRunAnalysis, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/dwrite_3.rs b/bash-5.1/vendor/winapi/src/um/dwrite_3.rs new file mode 100644 index 0000000000000000000000000000000000000000..f6645c3479a815e234c30f2ab24ded122d05c7c1 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dwrite_3.rs @@ -0,0 +1,578 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the content of dwrite_3.h +use ctypes::c_void; +use shared::basetsd::{UINT16, UINT32, UINT64}; +use shared::minwindef::{BOOL, FILETIME, FLOAT}; +use um::dcommon::{DWRITE_GLYPH_IMAGE_DATA, DWRITE_GLYPH_IMAGE_FORMATS, DWRITE_MEASURING_MODE}; +use um::dwrite::{ + DWRITE_FONT_SIMULATIONS, DWRITE_FONT_STRETCH, DWRITE_FONT_STYLE, DWRITE_FONT_WEIGHT, + DWRITE_GLYPH_RUN, DWRITE_INFORMATIONAL_STRING_ID, DWRITE_LINE_SPACING_METHOD, DWRITE_MATRIX, + DWRITE_PIXEL_GEOMETRY, DWRITE_RENDERING_MODE_ALIASED, DWRITE_RENDERING_MODE_DEFAULT, + DWRITE_RENDERING_MODE_GDI_CLASSIC, DWRITE_RENDERING_MODE_GDI_NATURAL, + DWRITE_RENDERING_MODE_NATURAL, DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, + DWRITE_RENDERING_MODE_OUTLINE, IDWriteFont, IDWriteFontCollection, IDWriteFontCollectionVtbl, + IDWriteFontFace, IDWriteFontFamily, IDWriteFontFamilyVtbl, IDWriteFontFile, IDWriteFontList, + IDWriteFontListVtbl, IDWriteGdiInterop, IDWriteGdiInteropVtbl, IDWriteGlyphRunAnalysis, + IDWriteLocalizedStrings, IDWriteRenderingParams, +}; +use um::dwrite_1::{DWRITE_OUTLINE_THRESHOLD, DWRITE_PANOSE, DWRITE_TEXT_ANTIALIAS_MODE}; +use um::dwrite_2::{ + DWRITE_GRID_FIT_MODE, IDWriteFactory2, IDWriteFactory2Vtbl, IDWriteFont2, IDWriteFont2Vtbl, + IDWriteFontFace2, IDWriteFontFace2Vtbl, IDWriteRenderingParams2, IDWriteRenderingParams2Vtbl, + IDWriteTextFormat1, IDWriteTextFormat1Vtbl, IDWriteTextLayout2, IDWriteTextLayout2Vtbl, +}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::wingdi::{FONTSIGNATURE, LOGFONTW}; +use um::winnt::{HRESULT, WCHAR}; +pub const DWRITE_E_REMOTEFONT: HRESULT = 0x8898500D; +pub const DWRITE_E_DOWNLOADCANCELLED: HRESULT = 0x8898500E; +pub const DWRITE_E_DOWNLOADFAILED: HRESULT = 0x8898500F; +pub const DWRITE_E_TOOMANYDOWNLOADS: HRESULT = 0x88985010; +ENUM!{enum DWRITE_FONT_PROPERTY_ID { + DWRITE_FONT_PROPERTY_ID_NONE, + DWRITE_FONT_PROPERTY_ID_FAMILY_NAME, + DWRITE_FONT_PROPERTY_ID_PREFERRED_FAMILY_NAME, + DWRITE_FONT_PROPERTY_ID_FACE_NAME, + DWRITE_FONT_PROPERTY_ID_FULL_NAME, + DWRITE_FONT_PROPERTY_ID_WIN32_FAMILY_NAME, + DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME, + DWRITE_FONT_PROPERTY_ID_DESIGN_SCRIPT_LANGUAGE_TAG, + DWRITE_FONT_PROPERTY_ID_SUPPORTED_SCRIPT_LANGUAGE_TAG, + DWRITE_FONT_PROPERTY_ID_SEMANTIC_TAG, + DWRITE_FONT_PROPERTY_ID_WEIGHT , + DWRITE_FONT_PROPERTY_ID_STRETCH, + DWRITE_FONT_PROPERTY_ID_STYLE, + DWRITE_FONT_PROPERTY_ID_TOTAL, +}} +STRUCT!{struct DWRITE_FONT_PROPERTY { + propertyId: DWRITE_FONT_PROPERTY_ID, + propertyValue: *const WCHAR, + localeName: *const WCHAR, +}} +ENUM!{enum DWRITE_LOCALITY { + DWRITE_LOCALITY_REMOTE, + DWRITE_LOCALITY_PARTIAL, + DWRITE_LOCALITY_LOCAL, +}} +ENUM!{enum DWRITE_RENDERING_MODE1 { + DWRITE_RENDERING_MODE1_DEFAULT = DWRITE_RENDERING_MODE_DEFAULT, + DWRITE_RENDERING_MODE1_ALIASED = DWRITE_RENDERING_MODE_ALIASED, + DWRITE_RENDERING_MODE1_GDI_CLASSIC = DWRITE_RENDERING_MODE_GDI_CLASSIC, + DWRITE_RENDERING_MODE1_GDI_NATURAL = DWRITE_RENDERING_MODE_GDI_NATURAL, + DWRITE_RENDERING_MODE1_NATURAL = DWRITE_RENDERING_MODE_NATURAL, + DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC = DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, + DWRITE_RENDERING_MODE1_OUTLINE = DWRITE_RENDERING_MODE_OUTLINE, + DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED, +}} +RIDL!{#[uuid(0xb7924baa, 0x391b, 0x412a, 0x8c, 0x5c, 0xe4, 0x4c, 0xc2, 0xd8, 0x67, 0xdc)] +interface IDWriteRenderingParams3(IDWriteRenderingParams3Vtbl): + IDWriteRenderingParams2(IDWriteRenderingParams2Vtbl) { + fn GetRenderingMode1() -> DWRITE_RENDERING_MODE1, +}} +RIDL!{#[uuid(0x9a1b41c3, 0xd3bb, 0x466a, 0x87, 0xfc, 0xfe, 0x67, 0x55, 0x6a, 0x3b, 0x65)] +interface IDWriteFactory3(IDWriteFactory3Vtbl): IDWriteFactory2(IDWriteFactory2Vtbl) { + fn CreateGlyphRunAnalysis( + glyphRun: *const DWRITE_GLYPH_RUN, + transform: *const DWRITE_MATRIX, + renderingMode: DWRITE_RENDERING_MODE1, + measuringMode: DWRITE_MEASURING_MODE, + gridFitMode: DWRITE_GRID_FIT_MODE, + antialiasMode: DWRITE_TEXT_ANTIALIAS_MODE, + baselineOriginX: FLOAT, + baselineOriginY: FLOAT, + glyphRunAnalysis: *mut *mut IDWriteGlyphRunAnalysis, + ) -> HRESULT, + fn CreateCustomRenderingParams( + gamma: FLOAT, + enhancedContrast: FLOAT, + grayscaleEnhancedContrast: FLOAT, + clearTypeLevel: FLOAT, + pixelGeometry: DWRITE_PIXEL_GEOMETRY, + renderingMode: DWRITE_RENDERING_MODE1, + gridFitMode: DWRITE_GRID_FIT_MODE, + renderingParams: *mut *mut IDWriteRenderingParams3, + ) -> HRESULT, + fn CreateFontFaceReference_2( + fontFile: *mut IDWriteFontFile, + faceIndex: UINT32, + fontSimulations: DWRITE_FONT_SIMULATIONS, + fontFaceReference: *mut *mut IDWriteFontFaceReference, + ) -> HRESULT, + fn CreateFontFaceReference_1( + filePath: *const WCHAR, + lastWriteTime: *const FILETIME, + faceIndex: UINT32, + fontSimulations: DWRITE_FONT_SIMULATIONS, + fontFaceReference: *mut *mut IDWriteFontFaceReference, + ) -> HRESULT, + fn GetSystemFontSet( + fontSet: *mut *mut IDWriteFontSet, + ) -> HRESULT, + fn CreateFontSetBuilder( + fontSetBuilder: *mut *mut IDWriteFontSetBuilder, + ) -> HRESULT, + fn CreateFontCollectionFromFontSet( + fontSet: *mut IDWriteFontSet, + fontCollection: *mut *mut IDWriteFontCollection1, + ) -> HRESULT, + fn GetSystemFontCollection( + includeDownloadableFonts: BOOL, + fontCollection: *mut *mut IDWriteFontCollection1, + checkForUpdates: BOOL, + ) -> HRESULT, + fn GetFontDownloadQueue( + fontDownloadQueue: *mut *mut IDWriteFontDownloadQueue, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x53585141, 0xd9f8, 0x4095, 0x83, 0x21, 0xd7, 0x3c, 0xf6, 0xbd, 0x11, 0x6b)] +interface IDWriteFontSet(IDWriteFontSetVtbl): IUnknown(IUnknownVtbl) { + fn GetFontCount() -> UINT32, + fn GetFontFaceReference( + listIndex: UINT32, + fontFaceReference: *mut *mut IDWriteFontFaceReference, + ) -> HRESULT, + fn FindFontFaceReference( + fontFaceReference: *mut IDWriteFontFaceReference, + listIndex: *mut UINT32, + exists: *mut BOOL, + ) -> HRESULT, + fn FindFontFace( + fontFace: *mut IDWriteFontFace, + listIndex: *mut UINT32, + exists: *mut BOOL, + ) -> HRESULT, + fn GetPropertyValues_3( + propertyID: DWRITE_FONT_PROPERTY_ID, + values: *mut *mut IDWriteStringList, + ) -> HRESULT, + fn GetPropertyValues_2( + propertyID: DWRITE_FONT_PROPERTY_ID, + preferredLocaleNames: *const WCHAR, + values: *mut *mut IDWriteStringList, + ) -> HRESULT, + fn GetPropertyValues_1( + listIndex: UINT32, + propertyId: DWRITE_FONT_PROPERTY_ID, + exists: *mut BOOL, + values: *mut *mut IDWriteLocalizedStrings, + ) -> HRESULT, + fn GetPropertyOccurrenceCount( + property: *const DWRITE_FONT_PROPERTY, + propertyOccurrenceCount: *mut UINT32, + ) -> HRESULT, + fn GetMatchingFonts_2( + familyName: *const WCHAR, + fontWeight: DWRITE_FONT_WEIGHT, + fontStretch: DWRITE_FONT_STRETCH, + fontStyle: DWRITE_FONT_STYLE, + filteredSet: *mut *mut IDWriteFontSet, + ) -> HRESULT, + fn GetMatchingFonts_1( + properties: *const DWRITE_FONT_PROPERTY, + propertyCount: UINT32, + filteredSet: *mut *mut IDWriteFontSet, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2f642afe, 0x9c68, 0x4f40, 0xb8, 0xbe, 0x45, 0x74, 0x01, 0xaf, 0xcb, 0x3d)] +interface IDWriteFontSetBuilder(IDWriteFontSetBuilderVtbl): IUnknown(IUnknownVtbl) { + fn AddFontFaceReference_2( + fontFaceReference: *mut IDWriteFontFaceReference, + properties: *const DWRITE_FONT_PROPERTY, + propertyCount: UINT32, + ) -> HRESULT, + fn AddFontFaceReference_1( + fontFaceReference: *mut IDWriteFontFaceReference, + ) -> HRESULT, + fn AddFontSet( + fontSet: *mut IDWriteFontSet, + ) -> HRESULT, + fn CreateFontSet( + fontSet: *mut *mut IDWriteFontSet, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x53585141, 0xd9f8, 0x4095, 0x83, 0x21, 0xd7, 0x3c, 0xf6, 0xbd, 0x11, 0x6c)] +interface IDWriteFontCollection1(IDWriteFontCollection1Vtbl): + IDWriteFontCollection(IDWriteFontCollectionVtbl) { + fn GetFontSet( + fontSet: *mut *mut IDWriteFontSet, + ) -> HRESULT, + fn GetFontFamily( + index: UINT32, + fontFamily: *mut *mut IDWriteFontFamily1, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xda20d8ef, 0x812a, 0x4c43, 0x98, 0x02, 0x62, 0xec, 0x4a, 0xbd, 0x7a, 0xdf)] +interface IDWriteFontFamily1(IDWriteFontFamily1Vtbl): + IDWriteFontFamily(IDWriteFontFamilyVtbl) { + fn GetFontLocality( + listIndex: UINT32, + ) -> DWRITE_LOCALITY, + fn GetFont( + listIndex: UINT32, + font: *mut *mut IDWriteFont3, + ) -> HRESULT, + fn GetFontFaceReference( + listIndex: UINT32, + fontFaceReference: *mut *mut IDWriteFontFaceReference, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xda20d8ef, 0x812a, 0x4c43, 0x98, 0x02, 0x62, 0xec, 0x4a, 0xbd, 0x7a, 0xde)] +interface IDWriteFontList1(IDWriteFontList1Vtbl): IDWriteFontList(IDWriteFontListVtbl) { + fn GetFontLocality( + listIndex: UINT32, + ) -> DWRITE_LOCALITY, + fn GetFont( + listIndex: UINT32, + font: *mut *mut IDWriteFont3, + ) -> HRESULT, + fn GetFontFaceReference( + listIndex: UINT32, + fontFaceReference: *mut *mut IDWriteFontFaceReference, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5e7fa7ca, 0xdde3, 0x424c, 0x89, 0xf0, 0x9f, 0xcd, 0x6f, 0xed, 0x58, 0xcd)] +interface IDWriteFontFaceReference(IDWriteFontFaceReferenceVtbl): + IUnknown(IUnknownVtbl) { + fn CreateFontFace( + fontFace: *mut *mut IDWriteFontFace3, + ) -> HRESULT, + fn CreateFontFaceWithSimulations( + fontFaceSimulationFlags: DWRITE_FONT_SIMULATIONS, + fontFace: *mut *mut IDWriteFontFace3, + ) -> HRESULT, + fn Equals( + fontFaceReference: *mut IDWriteFontFaceReference, + ) -> BOOL, + fn GetFontFaceIndex() -> UINT32, + fn GetSimulations() -> DWRITE_FONT_SIMULATIONS, + fn GetFontFile( + fontFile: *mut *mut IDWriteFontFile, + ) -> HRESULT, + fn GetLocalFileSize() -> UINT64, + fn GetFileSize() -> UINT64, + fn GetFileTime( + lastWriteTime: *mut FILETIME, + ) -> HRESULT, + fn GetLocality() -> DWRITE_LOCALITY, + fn EnqueueFontDownloadRequest() -> HRESULT, + fn EnqueueCharacterDownloadRequest( + characters: *const WCHAR, + characterCount: UINT32, + ) -> HRESULT, + fn EnqueueGlyphDownloadRequest( + glyphIndices: *const UINT16, + glyphCount: UINT32, + ) -> HRESULT, + fn EnqueueFileFragmentDownloadRequest( + fileOffset: UINT64, + fragmentSize: UINT64, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x29748ed6, 0x8c9c, 0x4a6a, 0xbe, 0x0b, 0xd9, 0x12, 0xe8, 0x53, 0x89, 0x44)] +interface IDWriteFont3(IDWriteFont3Vtbl): IDWriteFont2(IDWriteFont2Vtbl) { + fn CreateFontFace( + fontFace: *mut *mut IDWriteFontFace3, + ) -> HRESULT, + fn Equals( + font: *mut IDWriteFont, + ) -> BOOL, + fn GetFontFaceReference( + fontFaceReference: *mut *mut IDWriteFontFaceReference, + ) -> HRESULT, + fn HasCharacter( + unicodeValue: UINT32, + ) -> BOOL, + fn GetLocality() -> DWRITE_LOCALITY, +}} +RIDL!{#[uuid(0xd37d7598, 0x09be, 0x4222, 0xa2, 0x36, 0x20, 0x81, 0x34, 0x1c, 0xc1, 0xf2)] +interface IDWriteFontFace3(IDWriteFontFace3Vtbl): + IDWriteFontFace2(IDWriteFontFace2Vtbl) { + fn GetFontFaceReference( + fontFaceReference: *mut *mut IDWriteFontFaceReference, + ) -> HRESULT, + fn GetPanose( + panose: *mut DWRITE_PANOSE, + ) -> (), + fn GetWeight() -> DWRITE_FONT_WEIGHT, + fn GetStretch() -> DWRITE_FONT_STRETCH, + fn GetStyle() -> DWRITE_FONT_STYLE, + fn GetFamilyNames( + names: *mut *mut IDWriteLocalizedStrings, + ) -> HRESULT, + fn GetFaceNames( + names: *mut *mut IDWriteLocalizedStrings, + ) -> HRESULT, + fn GetInformationalStrings( + informationalStringID: DWRITE_INFORMATIONAL_STRING_ID, + informationalStrings: *mut *mut IDWriteLocalizedStrings, + exists: *mut BOOL, + ) -> HRESULT, + fn HasCharacter( + unicodeValue: UINT32, + ) -> BOOL, + fn GetRecommendedRenderingMode( + fontEmSize: FLOAT, + dpiX: FLOAT, + dpiY: FLOAT, + transform: *const DWRITE_MATRIX, + isSideways: BOOL, + outlineThreshold: DWRITE_OUTLINE_THRESHOLD, + measuringMode: DWRITE_MEASURING_MODE, + renderingParams: *mut IDWriteRenderingParams, + renderingMode: *mut DWRITE_RENDERING_MODE1, + gridFitMode: *mut DWRITE_GRID_FIT_MODE, + ) -> HRESULT, + fn IsCharacterLocal( + unicodeValue: UINT32, + ) -> BOOL, + fn IsGlyphLocal( + glyphId: UINT16, + ) -> BOOL, + fn AreCharactersLocal( + characters: *const WCHAR, + characterCount: UINT32, + enqueueIfNotLocal: BOOL, + isLocal: *mut BOOL, + ) -> HRESULT, + fn AreGlyphsLocal( + glyphIndices: *const UINT16, + glyphCount: UINT32, + enqueueIfNotLocal: BOOL, + isLocal: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xcfee3140, 0x1157, 0x47ca, 0x8b, 0x85, 0x31, 0xbf, 0xcf, 0x3f, 0x2d, 0x0e)] +interface IDWriteStringList(IDWriteStringListVtbl): IUnknown(IUnknownVtbl) { + fn GetCount() -> UINT32, + fn GetLocaleNameLength( + listIndex: UINT32, + length: *mut UINT32, + ) -> HRESULT, + fn GetLocaleName( + listIndex: UINT32, + localeName: *mut WCHAR, + size: UINT32, + ) -> HRESULT, + fn GetStringLength( + listIndex: UINT32, + length: *mut UINT32, + ) -> HRESULT, + fn GetString( + listIndex: UINT32, + stringBuffer: *mut WCHAR, + stringBufferSize: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb06fe5b9, 0x43ec, 0x4393, 0x88, 0x1b, 0xdb, 0xe4, 0xdc, 0x72, 0xfd, 0xa7)] +interface IDWriteFontDownloadListener(IDWriteFontDownloadListenerVtbl): + IUnknown(IUnknownVtbl) { + fn DownloadCompleted( + downloadQueue: *mut IDWriteFontDownloadQueue, + context: *mut IUnknown, + downloadResult: HRESULT, + ) -> (), +}} +RIDL!{#[uuid(0xb71e6052, 0x5aea, 0x4fa3, 0x83, 0x2e, 0xf6, 0x0d, 0x43, 0x1f, 0x7e, 0x91)] +interface IDWriteFontDownloadQueue(IDWriteFontDownloadQueueVtbl): + IUnknown(IUnknownVtbl) { + fn AddListener( + listener: *mut IDWriteFontDownloadListener, + token: *mut UINT32, + ) -> HRESULT, + fn RemoveListener( + token: UINT32, + ) -> HRESULT, + fn IsEmpty() -> BOOL, + fn BeginDownload( + context: *mut IUnknown, + ) -> HRESULT, + fn CancelDownload() -> HRESULT, + fn GetGenerationCount() -> UINT64, +}} +RIDL!{#[uuid(0x4556be70, 0x3abd, 0x4f70, 0x90, 0xbe, 0x42, 0x17, 0x80, 0xa6, 0xf5, 0x15)] +interface IDWriteGdiInterop1(IDWriteGdiInterop1Vtbl): + IDWriteGdiInterop(IDWriteGdiInteropVtbl) { + fn CreateFontFromLOGFONT( + logFont: *const LOGFONTW, + fontCollection: *mut IDWriteFontCollection, + font: *mut *mut IDWriteFont, + ) -> HRESULT, + fn GetFontSignature_2( + fontFace: *mut IDWriteFontFace, + fontSignature: *mut FONTSIGNATURE, + ) -> HRESULT, + fn GetFontSignature_1( + font: *mut IDWriteFont, + fontSignature: *mut FONTSIGNATURE, + ) -> HRESULT, + fn GetMatchingFontsByLOGFONT( + logFont: *const LOGFONTW, + fontSet: *mut IDWriteFontSet, + filteredSet: *mut *mut IDWriteFontSet, + ) -> HRESULT, +}} +STRUCT!{struct DWRITE_LINE_METRICS1 { + length: UINT32, + trailingWhitespaceLength: UINT32, + newlineLength: UINT32, + height: FLOAT, + baseline: FLOAT, + isTrimmed: BOOL, + leadingBefore: FLOAT, + leadingAfter: FLOAT, +}} +ENUM!{enum DWRITE_FONT_LINE_GAP_USAGE { + DWRITE_FONT_LINE_GAP_USAGE_DEFAULT, + DWRITE_FONT_LINE_GAP_USAGE_DISABLED, + DWRITE_FONT_LINE_GAP_USAGE_ENABLED, +}} +STRUCT!{struct DWRITE_LINE_SPACING { + method: DWRITE_LINE_SPACING_METHOD, + height: FLOAT, + baseline: FLOAT, + leadingBefore: FLOAT, + fontLineGapUsage: DWRITE_FONT_LINE_GAP_USAGE, +}} +RIDL!{#[uuid(0xf67e0edd, 0x9e3d, 0x4ecc, 0x8c, 0x32, 0x41, 0x83, 0x25, 0x3d, 0xfe, 0x70)] +interface IDWriteTextFormat2(IDWriteTextFormat2Vtbl): + IDWriteTextFormat1(IDWriteTextFormat1Vtbl) { + fn SetLineSpacing( + lineSpacingOptions: *const DWRITE_LINE_SPACING, + ) -> HRESULT, + fn GetLineSpacing( + lineSpacingOptions: *mut DWRITE_LINE_SPACING, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x07ddcd52, 0x020e, 0x4de8, 0xac, 0x33, 0x6c, 0x95, 0x3d, 0x83, 0xf9, 0x2d)] +interface IDWriteTextLayout3(IDWriteTextLayout3Vtbl): + IDWriteTextLayout2(IDWriteTextLayout2Vtbl) { + fn InvalidateLayout() -> HRESULT, + fn SetLineSpacing( + lineSpacingOptions: *const DWRITE_LINE_SPACING, + ) -> HRESULT, + fn GetLineSpacing( + lineSpacingOptions: *mut DWRITE_LINE_SPACING, + ) -> HRESULT, + fn GetLineMetrics( + lineMetrics: *mut DWRITE_LINE_METRICS1, + maxLineCount: UINT32, + actualLineCount: *mut UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x27f2a904, 0x4eb8, 0x441d, 0x96, 0x78, 0x05, 0x63, 0xf5, 0x3e, 0x3e, 0x2f)] +interface IDWriteFontFace4(IDWriteFontFace4Vtbl): IDWriteFontFace3(IDWriteFontFace3Vtbl) { + fn GetGlyphImageFormats_2( + glyph: UINT16, + ppemFirst: UINT32, + ppemLast: UINT32, + formats: *mut DWRITE_GLYPH_IMAGE_FORMATS, + ) -> HRESULT, + fn GetGlyphImageFormats_1() -> DWRITE_GLYPH_IMAGE_FORMATS, + fn GetGlyphImageData( + glyph: UINT16, + ppem: UINT32, + format: DWRITE_GLYPH_IMAGE_FORMATS, + data: *mut DWRITE_GLYPH_IMAGE_DATA, + context: *mut *mut c_void, + ) -> HRESULT, + fn ReleaseGlyphImageData( + context: *mut c_void, + ) -> (), +}} +ENUM!{enum DWRITE_FONT_AXIS_TAG { + DWRITE_FONT_AXIS_TAG_WEIGHT = 0x74686777, + DWRITE_FONT_AXIS_TAG_WIDTH = 0x68746477, + DWRITE_FONT_AXIS_TAG_SLANT = 0x746e6c73, + DWRITE_FONT_AXIS_TAG_OPTICAL_SIZE = 0x7a73706f, + DWRITE_FONT_AXIS_TAG_ITALIC = 0x6c617469, +}} +STRUCT!{struct DWRITE_FONT_AXIS_VALUE { + axisTag: DWRITE_FONT_AXIS_TAG, + value: FLOAT, +}} +STRUCT!{struct DWRITE_FONT_AXIS_RANGE { + axisTag: DWRITE_FONT_AXIS_TAG, + minValue: FLOAT, + maxValue: FLOAT, +}} +ENUM!{enum DWRITE_FONT_AXIS_ATTRIBUTES { + DWRITE_FONT_AXIS_ATTRIBUTES_NONE, + DWRITE_FONT_AXIS_ATTRIBUTES_VARIABLE, + DWRITE_FONT_AXIS_ATTRIBUTES_HIDDEN, +}} +RIDL!{#[uuid(0x98eff3a5, 0xb667, 0x479a, 0xb1, 0x45, 0xe2, 0xfa, 0x5b, 0x9f, 0xdc, 0x29)] +interface IDWriteFontFace5(IDWriteFontFace5Vtbl): IDWriteFontFace4(IDWriteFontFace4Vtbl) { + fn GetFontAxisValueCount() -> UINT32, + fn GetFontAxisValues( + values: *mut DWRITE_FONT_AXIS_VALUE, + valueCount: UINT32, + ) -> HRESULT, + fn HasVariations() -> BOOL, + fn GetFontResource( + resource: *mut *mut IDWriteFontResource, + ) -> HRESULT, + fn Equals( + fontFace: *mut IDWriteFontFace, + ) -> BOOL, +}} +RIDL!{#[uuid(0xc081fe77, 0x2fd1, 0x41ac, 0xa5, 0xa3, 0x34, 0x98, 0x3c, 0x4b, 0xa6, 0x1a)] +interface IDWriteFontFaceReference1(IDWriteFontFaceReference1Vtbl): + IDWriteFontFaceReference(IDWriteFontFaceReferenceVtbl) { + fn CreateFontFace( + fontFace: *mut *mut IDWriteFontFace5, + ) -> HRESULT, + fn GetFontAxisValueCount() -> UINT32, + fn GetFontAxisValues( + values: *mut DWRITE_FONT_AXIS_VALUE, + numValues: UINT32, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1f803a76, 0x6871, 0x48e8, 0x98, 0x7f, 0xb9, 0x75, 0x55, 0x1c, 0x50, 0xf2)] +interface IDWriteFontResource(IDWriteFontResourceVtbl): IUnknown(IUnknownVtbl) { + fn GetFontFile( + fontFile: *mut *mut IDWriteFontFile, + ) -> HRESULT, + fn GetFontFaceIndex() -> UINT32, + fn GetFontAxisCount() -> UINT32, + fn GetDefaultFontAxisValues( + values: *const DWRITE_FONT_AXIS_VALUE, + numValues: UINT32, + ) -> HRESULT, + fn GetFontAxisRanges( + ranges: *const DWRITE_FONT_AXIS_RANGE, + numRanges: UINT32, + ) -> HRESULT, + fn GetFontAxisAttributes( + axis: UINT32, + ) -> DWRITE_FONT_AXIS_ATTRIBUTES, + fn GetAxisNames( + axis: UINT32, + names: *mut *mut IDWriteLocalizedStrings, + ) -> HRESULT, + fn GetAxisValueNameCount( + axis: UINT32, + ) -> UINT32, + fn GetAxisValueNames( + axis: UINT32, + axisValue: UINT32, + axisRange: *mut DWRITE_FONT_AXIS_RANGE, + names: *mut *mut IDWriteLocalizedStrings, + ) -> HRESULT, + fn HasVariations() -> BOOL, + fn CreateFontFace( + simulations: DWRITE_FONT_SIMULATIONS, + axisValues: *const DWRITE_FONT_AXIS_VALUE, + numValues: UINT32, + fontFace: *mut *mut IDWriteFontFace5, + ) -> HRESULT, + fn CreateFontFaceReference( + simulations: DWRITE_FONT_SIMULATIONS, + axisValues: *const DWRITE_FONT_AXIS_VALUE, + numValues: UINT32, + reference: *mut *mut IDWriteFontFaceReference1, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/dxdiag.rs b/bash-5.1/vendor/winapi/src/um/dxdiag.rs new file mode 100644 index 0000000000000000000000000000000000000000..6f46c7ac7ba0c090702540f4721d40b768d9c4d4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dxdiag.rs @@ -0,0 +1,11 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{CLSID_DxDiagProvider, + 0xa65b8071, 0x3bfe, 0x4213, 0x9a, 0x5b, 0x49, 0x1d, 0xa4, 0x46, 0x1c, 0xa7} +DEFINE_GUID!{IID_IDxDiagProvider, + 0x9c6b4cb0, 0x23f8, 0x49cc, 0xa3, 0xed, 0x45, 0xa5, 0x50, 0x00, 0xa6, 0xd2} +DEFINE_GUID!{IID_IDxDiagContainer, + 0x7d0f462f, 0x4064, 0x4862, 0xbc, 0x7f, 0x93, 0x3e, 0x50, 0x58, 0xc1, 0x0f} diff --git a/bash-5.1/vendor/winapi/src/um/dxfile.rs b/bash-5.1/vendor/winapi/src/um/dxfile.rs new file mode 100644 index 0000000000000000000000000000000000000000..67ba32c4bd764ff355e032c75f9cdcc602b36a41 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dxfile.rs @@ -0,0 +1,23 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{CLSID_CDirectXFile, + 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3} +DEFINE_GUID!{IID_IDirectXFile, + 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{IID_IDirectXFileEnumObject, + 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{IID_IDirectXFileSaveObject, + 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{IID_IDirectXFileObject, + 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{IID_IDirectXFileData, + 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{IID_IDirectXFileDataReference, + 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{IID_IDirectXFileBinary, + 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{TID_DXFILEHeader, + 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} diff --git a/bash-5.1/vendor/winapi/src/um/dxgidebug.rs b/bash-5.1/vendor/winapi/src/um/dxgidebug.rs new file mode 100644 index 0000000000000000000000000000000000000000..3478da300e220cb942e1e0a55b76224a1228820f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dxgidebug.rs @@ -0,0 +1,235 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_char, c_int, c_void}; +use shared::basetsd::{SIZE_T, UINT64}; +use shared::guiddef::{GUID, REFIID}; +use shared::minwindef::{BOOL, DWORD, UINT}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCSTR}; +pub const DXGI_DEBUG_BINARY_VERSION: DWORD = 1; +ENUM!{enum DXGI_DEBUG_RLO_FLAGS { + DXGI_DEBUG_RLO_SUMMARY = 0x1, + DXGI_DEBUG_RLO_DETAIL = 0x2, + DXGI_DEBUG_RLO_IGNORE_INTERNAL = 0x4, + DXGI_DEBUG_RLO_ALL = 0x7, +}} +pub type DXGI_DEBUG_ID = GUID; +DEFINE_GUID!{DXGI_DEBUG_ALL, + 0xe48ae283, 0xda80, 0x490b, 0x87, 0xe6, 0x43, 0xe9, 0xa9, 0xcf, 0xda, 0x08} +DEFINE_GUID!{DXGI_DEBUG_DX, + 0x35cdd7fc, 0x13b2, 0x421d, 0xa5, 0xd7, 0x7e, 0x44, 0x51, 0x28, 0x7d, 0x64} +DEFINE_GUID!{DXGI_DEBUG_DXGI, + 0x25cddaa4, 0xb1c6, 0x47e1, 0xac, 0x3e, 0x98, 0x87, 0x5b, 0x5a, 0x2e, 0x2a} +DEFINE_GUID!{DXGI_DEBUG_APP, + 0x06cd6e01, 0x4219, 0x4ebd, 0x87, 0x09, 0x27, 0xed, 0x23, 0x36, 0x0c, 0x62} +ENUM!{enum DXGI_INFO_QUEUE_MESSAGE_CATEGORY { + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_UNKNOWN = 0, + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_MISCELLANEOUS = 1, + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_INITIALIZATION = 2, + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_CLEANUP = 3, + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_COMPILATION = 4, + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_CREATION = 5, + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_SETTING = 6, + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_GETTING = 7, + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = 8, + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_EXECUTION = 9, + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_SHADER = 10, +}} +ENUM!{enum DXGI_INFO_QUEUE_MESSAGE_SEVERITY { + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_CORRUPTION = 0, + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_ERROR = 1, + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_WARNING = 2, + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_INFO = 3, + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_MESSAGE = 4, +}} +pub type DXGI_INFO_QUEUE_MESSAGE_ID = c_int; +STRUCT!{struct DXGI_INFO_QUEUE_MESSAGE { + Producer: DXGI_DEBUG_ID, + Category: DXGI_INFO_QUEUE_MESSAGE_CATEGORY, + Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY, + ID: DXGI_INFO_QUEUE_MESSAGE_ID, + pDescription: *const c_char, + DescriptionByteLength: SIZE_T, +}} +STRUCT!{struct DXGI_INFO_QUEUE_FILTER_DESC { + NumCategories: UINT, + pCategoryList: *mut DXGI_INFO_QUEUE_MESSAGE_CATEGORY, + NumSeverities: UINT, + pSeverityList: *mut DXGI_INFO_QUEUE_MESSAGE_SEVERITY, + NumIDs: UINT, + pIDList: *mut DXGI_INFO_QUEUE_MESSAGE_ID, +}} +STRUCT!{struct DXGI_INFO_QUEUE_FILTER { + AllowList: DXGI_INFO_QUEUE_FILTER_DESC, + DenyList: DXGI_INFO_QUEUE_FILTER_DESC, +}} +pub const DXGI_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT: DWORD = 1024; +extern "system" { + pub fn DXGIGetDebugInterface( + riid: REFIID, + ppDebug: *mut *mut c_void, + ) -> HRESULT; +} +RIDL!{#[uuid(0xd67441c7, 0x672a, 0x476f, 0x9e, 0x82, 0xcd, 0x55, 0xb4, 0x49, 0x49, 0xce)] +interface IDXGIInfoQueue(IDXGIInfoQueueVtbl): IUnknown(IUnknownVtbl) { + fn SetMessageCountLimit( + Producer: DXGI_DEBUG_ID, + MessageCountLimit: UINT64, + ) -> HRESULT, + fn ClearStoredMessages( + Producer: DXGI_DEBUG_ID, + ) -> (), + fn GetMessage( + Producer: DXGI_DEBUG_ID, + MessageIndex: UINT64, + pMessage: *mut DXGI_INFO_QUEUE_MESSAGE, + pMessageByteLength: *mut SIZE_T, + ) -> HRESULT, + fn GetNumStoredMessagesAllowedByRetrievalFilters( + Producer: DXGI_DEBUG_ID, + ) -> UINT64, + fn GetNumStoredMessages( + Producer: DXGI_DEBUG_ID, + ) -> UINT64, + fn GetNumMessagesDiscardedByMessageCountLimit( + Producer: DXGI_DEBUG_ID, + ) -> UINT64, + fn GetMessageCountLimit( + Producer: DXGI_DEBUG_ID, + ) -> UINT64, + fn GetNumMessagesAllowedByStorageFilter( + Producer: DXGI_DEBUG_ID, + ) -> UINT64, + fn GetNumMessagesDeniedByStorageFilter( + Producer: DXGI_DEBUG_ID, + ) -> UINT64, + fn AddStorageFilterEntries( + Producer: DXGI_DEBUG_ID, + pFilter: *const DXGI_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn GetStorageFilter( + Producer: DXGI_DEBUG_ID, + pFilter: *mut DXGI_INFO_QUEUE_FILTER, + pFilterByteLength: *mut SIZE_T, + ) -> HRESULT, + fn ClearStorageFilter( + Producer: DXGI_DEBUG_ID, + ) -> (), + fn PushEmptyStorageFilter( + Producer: DXGI_DEBUG_ID, + ) -> HRESULT, + fn PushDenyAllStorageFilter( + Producer: DXGI_DEBUG_ID, + ) -> HRESULT, + fn PushCopyOfStorageFilter( + Producer: DXGI_DEBUG_ID, + ) -> HRESULT, + fn PushStorageFilter( + Producer: DXGI_DEBUG_ID, + pFilter: *const DXGI_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn PopStorageFilter( + Producer: DXGI_DEBUG_ID, + ) -> (), + fn GetStorageFilterStackSize( + Producer: DXGI_DEBUG_ID, + ) -> UINT, + fn AddRetrievalFilterEntries( + Producer: DXGI_DEBUG_ID, + pFilter: *const DXGI_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn GetRetrievalFilter( + Producer: DXGI_DEBUG_ID, + pFilter: *mut DXGI_INFO_QUEUE_FILTER, + pFilterByteLength: *mut SIZE_T, + ) -> HRESULT, + fn ClearRetrievalFilter( + Producer: DXGI_DEBUG_ID, + ) -> (), + fn PushEmptyRetrievalFilter( + Producer: DXGI_DEBUG_ID, + ) -> HRESULT, + fn PushDenyAllRetrievalFilter( + Producer: DXGI_DEBUG_ID, + ) -> HRESULT, + fn PushCopyOfRetrievalFilter( + Producer: DXGI_DEBUG_ID, + ) -> HRESULT, + fn PushRetrievalFilter( + Producer: DXGI_DEBUG_ID, + pFilter: *const DXGI_INFO_QUEUE_FILTER, + ) -> HRESULT, + fn PopRetrievalFilter( + Producer: DXGI_DEBUG_ID, + ) -> (), + fn GetRetrievalFilterStackSize( + Producer: DXGI_DEBUG_ID, + ) -> UINT, + fn AddMessage( + Producer: DXGI_DEBUG_ID, + Category: DXGI_INFO_QUEUE_MESSAGE_CATEGORY, + Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY, + ID: DXGI_INFO_QUEUE_MESSAGE_ID, + pDescription: LPCSTR, + ) -> HRESULT, + fn AddApplicationMessage( + Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY, + pDescription: LPCSTR, + ) -> HRESULT, + fn SetBreakOnCategory( + Producer: DXGI_DEBUG_ID, + Category: DXGI_INFO_QUEUE_MESSAGE_CATEGORY, + bEnable: BOOL, + ) -> HRESULT, + fn SetBreakOnSeverity( + Producer: DXGI_DEBUG_ID, + Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY, + bEnable: BOOL, + ) -> HRESULT, + fn SetBreakOnID( + Producer: DXGI_DEBUG_ID, + ID: DXGI_INFO_QUEUE_MESSAGE_ID, + bEnable: BOOL, + ) -> HRESULT, + fn GetBreakOnCategory( + Producer: DXGI_DEBUG_ID, + Category: DXGI_INFO_QUEUE_MESSAGE_CATEGORY, + ) -> BOOL, + fn GetBreakOnSeverity( + Producer: DXGI_DEBUG_ID, + Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY, + ) -> BOOL, + fn GetBreakOnID( + Producer: DXGI_DEBUG_ID, + ID: DXGI_INFO_QUEUE_MESSAGE_ID, + ) -> BOOL, + fn SetMuteDebugOutput( + Producer: DXGI_DEBUG_ID, + bMute: BOOL, + ) -> (), + fn GetMuteDebugOutput( + Producer: DXGI_DEBUG_ID, + ) -> BOOL, +}} +RIDL!{#[uuid(0x119e7452, 0xde9e, 0x40fe, 0x88, 0x06, 0x88, 0xf9, 0x0c, 0x12, 0xb4, 0x41)] +interface IDXGIDebug(IDXGIDebugVtbl): IUnknown(IUnknownVtbl) { + fn ReportLiveObjects( + apiid: GUID, + flags: DXGI_DEBUG_RLO_FLAGS, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x119e7452, 0xde9e, 0x40fe, 0x88, 0x06, 0x88, 0xf9, 0x0c, 0x12, 0xb4, 0x41)] +interface IDXGIDebug1(IDXGIDebug1Vtbl): IDXGIDebug(IDXGIDebugVtbl) { + fn EnableLeakTrackingForThread() -> (), + fn DisableLeakTrackingForThread() -> (), + fn IsLeakTrackingEnabledForThread() -> BOOL, +}} +DEFINE_GUID!{IID_IDXGIInfoQueue, + 0xd67441c7, 0x672a, 0x476f, 0x9e, 0x82, 0xcd, 0x55, 0xb4, 0x49, 0x49, 0xce} +DEFINE_GUID!{IID_IDXGIDebug, + 0x119e7452, 0xde9e, 0x40fe, 0x88, 0x06, 0x88, 0xf9, 0x0c, 0x12, 0xb4, 0x41} +DEFINE_GUID!{IID_IDXGIDebug1, + 0xc5a05f0c, 0x16f2, 0x4adf, 0x9f, 0x4d, 0xa8, 0xc4, 0xd5, 0x8a, 0xc5, 0x50} diff --git a/bash-5.1/vendor/winapi/src/um/dxva2api.rs b/bash-5.1/vendor/winapi/src/um/dxva2api.rs new file mode 100644 index 0000000000000000000000000000000000000000..db07c40e9ea09d5901558febf8c645c6c512e4f3 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dxva2api.rs @@ -0,0 +1,706 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_float, c_void}; +use shared::basetsd::UINT64; +use shared::d3d9::{IDirect3DDevice9, IDirect3DSurface9}; +use shared::d3d9types::{D3DFORMAT, D3DPOOL}; +use shared::guiddef::{GUID, REFGUID, REFIID}; +use shared::minwindef::{BOOL, DWORD, FLOAT, HIWORD, LOWORD, UCHAR, UINT, USHORT}; +use shared::windef::{RECT, SIZE}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, LONG, LONGLONG, PVOID, SHORT}; +DEFINE_GUID!{DXVA2_ModeMPEG2_MoComp, + 0xe6a9f44b, 0x61b0, 0x4563, 0x9e, 0xa4, 0x63, 0xd2, 0xa3, 0xc6, 0xfe, 0x66} +DEFINE_GUID!{DXVA2_ModeMPEG2_IDCT, + 0xbf22ad00, 0x03ea, 0x4690, 0x80, 0x77, 0x47, 0x33, 0x46, 0x20, 0x9b, 0x7e} +DEFINE_GUID!{DXVA2_ModeMPEG2_VLD, + 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9} +DEFINE_GUID!{DXVA2_ModeMPEG1_VLD, + 0x6f3ec719, 0x3735, 0x42cc, 0x80, 0x63, 0x65, 0xcc, 0x3c, 0xb3, 0x66, 0x16} +DEFINE_GUID!{DXVA2_ModeMPEG2and1_VLD, + 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60} +DEFINE_GUID!{DXVA2_ModeH264_A, + 0x1b81be64, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeH264_B, + 0x1b81be65, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeH264_C, + 0x1b81be66, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeH264_D, + 0x1b81be67, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeH264_E, + 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeH264_F, + 0x1b81be69, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeH264_VLD_WithFMOASO_NoFGT, + 0xd5f04ff9, 0x3418, 0x45d8, 0x95, 0x61, 0x32, 0xa7, 0x6a, 0xae, 0x2d, 0xdd} +DEFINE_GUID!{DXVA2_ModeH264_VLD_Stereo_Progressive_NoFGT, + 0xd79be8da, 0x0cf1, 0x4c81, 0xb8, 0x2a, 0x69, 0xa4, 0xe2, 0x36, 0xf4, 0x3d} +DEFINE_GUID!{DXVA2_ModeH264_VLD_Stereo_NoFGT, + 0xf9aaccbb, 0xc2b6, 0x4cfc, 0x87, 0x79, 0x57, 0x07, 0xb1, 0x76, 0x05, 0x52} +DEFINE_GUID!{DXVA2_ModeH264_VLD_Multiview_NoFGT, + 0x705b9d82, 0x76cf, 0x49d6, 0xb7, 0xe6, 0xac, 0x88, 0x72, 0xdb, 0x01, 0x3c} +DEFINE_GUID!{DXVA2_ModeWMV8_A, + 0x1b81be80, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeWMV8_B, + 0x1b81be81, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeWMV9_A, + 0x1b81be90, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeWMV9_B, + 0x1b81be91, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeWMV9_C, + 0x1b81be94, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeVC1_A, + 0x1b81bea0, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeVC1_B, + 0x1b81bea1, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeVC1_C, + 0x1b81bea2, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeVC1_D, + 0x1b81bea3, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_ModeVC1_D2010, + 0x1b81bea4, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_NoEncrypt, + 0x1b81bed0, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5} +DEFINE_GUID!{DXVA2_VideoProcProgressiveDevice, + 0x5a54a0c9, 0xc7ec, 0x4bd9, 0x8e, 0xde, 0xf3, 0xc7, 0x5d, 0xc4, 0x39, 0x3b} +DEFINE_GUID!{DXVA2_VideoProcBobDevice, + 0x335aa36e, 0x7884, 0x43a4, 0x9c, 0x91, 0x7f, 0x87, 0xfa, 0xf3, 0xe3, 0x7e} +DEFINE_GUID!{DXVA2_VideoProcSoftwareDevice, + 0x4553d47f, 0xee7e, 0x4e3f, 0x94, 0x75, 0xdb, 0xf1, 0x37, 0x6c, 0x48, 0x10} +DEFINE_GUID!{DXVA2_ModeMPEG4pt2_VLD_Simple, + 0xefd64d74, 0xc9e8, 0x41d7, 0xa5, 0xe9, 0xe9, 0xb0, 0xe3, 0x9f, 0xa3, 0x19} +DEFINE_GUID!{DXVA2_ModeMPEG4pt2_VLD_AdvSimple_NoGMC, + 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e} +DEFINE_GUID!{DXVA2_ModeMPEG4pt2_VLD_AdvSimple_GMC, + 0xab998b5b, 0x4258, 0x44a9, 0x9f, 0xeb, 0x94, 0xe5, 0x97, 0xa6, 0xba, 0xae} +DEFINE_GUID!{DXVA2_ModeHEVC_VLD_Main, + 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0} +DEFINE_GUID!{DXVA2_ModeHEVC_VLD_Main10, + 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13} +DEFINE_GUID!{DXVA2_ModeVP9_VLD_Profile0, + 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e} +DEFINE_GUID!{DXVA2_ModeVP9_VLD_10bit_Profile2, + 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7} +DEFINE_GUID!{DXVA2_ModeVP8_VLD, + 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7} +pub const DXVA2_ModeMPEG2_MOCOMP: GUID = DXVA2_ModeMPEG2_MoComp; +pub const DXVA2_ModeWMV8_PostProc: GUID = DXVA2_ModeWMV8_A; +pub const DXVA2_ModeWMV8_MoComp: GUID = DXVA2_ModeWMV8_B; +pub const DXVA2_ModeWMV9_PostProc: GUID = DXVA2_ModeWMV9_A; +pub const DXVA2_ModeWMV9_MoComp: GUID = DXVA2_ModeWMV9_B; +pub const DXVA2_ModeWMV9_IDCT: GUID = DXVA2_ModeWMV9_C; +pub const DXVA2_ModeVC1_PostProc: GUID = DXVA2_ModeVC1_A; +pub const DXVA2_ModeVC1_MoComp: GUID = DXVA2_ModeVC1_B; +pub const DXVA2_ModeVC1_IDCT: GUID = DXVA2_ModeVC1_C; +pub const DXVA2_ModeVC1_VLD: GUID = DXVA2_ModeVC1_D; +pub const DXVA2_ModeH264_MoComp_NoFGT: GUID = DXVA2_ModeH264_A; +pub const DXVA2_ModeH264_MoComp_FGT: GUID = DXVA2_ModeH264_B; +pub const DXVA2_ModeH264_IDCT_NoFGT: GUID = DXVA2_ModeH264_C; +pub const DXVA2_ModeH264_IDCT_FGT: GUID = DXVA2_ModeH264_D; +pub const DXVA2_ModeH264_VLD_NoFGT: GUID = DXVA2_ModeH264_E; +pub const DXVA2_ModeH264_VLD_FGT: GUID = DXVA2_ModeH264_F; +pub const DXVA2_E_NOT_INITIALIZED: HRESULT = 0x80041000; +pub const DXVA2_E_NEW_VIDEO_DEVICE: HRESULT = 0x80041001; +pub const DXVA2_E_VIDEO_DEVICE_LOCKED: HRESULT = 0x80041002; +pub const DXVA2_E_NOT_AVAILABLE: HRESULT = 0x80041003; +DEFINE_GUID!{IID_IDirect3DDeviceManager9, + 0xa0cade0f, 0x06d5, 0x4cf4, 0xa1, 0xc7, 0xf3, 0xcd, 0xd7, 0x25, 0xaa, 0x75} +DEFINE_GUID!{IID_IDirectXVideoAccelerationService, + 0xfc51a550, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02} +DEFINE_GUID!{IID_IDirectXVideoDecoderService, + 0xfc51a551, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02} +DEFINE_GUID!{IID_IDirectXVideoProcessorService, + 0xfc51a552, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02} +DEFINE_GUID!{IID_IDirectXVideoDecoder, + 0xf2b0810a, 0xfd00, 0x43c9, 0x91, 0x8c, 0xdf, 0x94, 0xe2, 0xd8, 0xef, 0x7d} +DEFINE_GUID!{IID_IDirectXVideoProcessor, + 0x8c3a39f0, 0x916e, 0x4690, 0x80, 0x4f, 0x4c, 0x80, 0x01, 0x35, 0x5d, 0x25} +DEFINE_GUID!{IID_IDirectXVideoMemoryConfiguration, + 0xb7f916dd, 0xdb3b, 0x49c1, 0x84, 0xd7, 0xe4, 0x5e, 0xf9, 0x9e, 0xc7, 0x26} +pub const MAX_DEINTERLACE_SURFACES: usize = 32; +pub const MAX_SUBSTREAMS: usize = 15; +STRUCT!{struct DXVA2_ExtendedFormat { + value: UINT, +}} +BITFIELD!{DXVA2_ExtendedFormat value: UINT [ + SampleFormat set_SampleFormat[0..8], + VideoChromaSubsampling set_VideoChromaSubsampling[8..12], + NominalRange set_NominalRange[12..15], + VideoTransferMatrix set_VideoTransferMatrix[15..18], + VideoLighting set_VideoLighting[18..22], + VideoPrimaries set_VideoPrimaries[22..27], + VideoTransferFunction set_VideoTransferFunction[27..32], +]} +ENUM!{enum DXVA2_SampleFormat { + DXVA2_SampleFormatMask = 0xff, + DXVA2_SampleUnknown = 0, + DXVA2_SampleProgressiveFrame = 2, + DXVA2_SampleFieldInterleavedEvenFirst = 3, + DXVA2_SampleFieldInterleavedOddFirst = 4, + DXVA2_SampleFieldSingleEven = 5, + DXVA2_SampleFieldSingleOdd = 6, + DXVA2_SampleSubStream = 7, +}} +ENUM!{enum DXVA2_VideoChromaSubSampling { + DXVA2_VideoChromaSubsamplingMask = 0xf, + DXVA2_VideoChromaSubsampling_Unknown = 0, + DXVA2_VideoChromaSubsampling_ProgressiveChroma = 0x8, + DXVA2_VideoChromaSubsampling_Horizontally_Cosited = 0x4, + DXVA2_VideoChromaSubsampling_Vertically_Cosited = 0x2, + DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes = 0x1, + DXVA2_VideoChromaSubsampling_MPEG2 = DXVA2_VideoChromaSubsampling_Horizontally_Cosited | + DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes, + DXVA2_VideoChromaSubsampling_MPEG1 = + DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes, + DXVA2_VideoChromaSubsampling_DV_PAL = DXVA2_VideoChromaSubsampling_Horizontally_Cosited | + DXVA2_VideoChromaSubsampling_Vertically_Cosited, + DXVA2_VideoChromaSubsampling_Cosited = DXVA2_VideoChromaSubsampling_Horizontally_Cosited | + DXVA2_VideoChromaSubsampling_Vertically_Cosited | + DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes, +}} +ENUM!{enum DXVA2_NominalRange { + DXVA2_NominalRangeMask = 0x7, + DXVA2_NominalRange_Unknown = 0, + DXVA2_NominalRange_Normal = 1, + DXVA2_NominalRange_Wide = 2, + DXVA2_NominalRange_0_255 = 1, + DXVA2_NominalRange_16_235 = 2, + DXVA2_NominalRange_48_208 = 3, +}} +ENUM!{enum DXVA2_VideoTransferMatrix { + DXVA2_VideoTransferMatrixMask = 0x7, + DXVA2_VideoTransferMatrix_Unknown = 0, + DXVA2_VideoTransferMatrix_BT709 = 1, + DXVA2_VideoTransferMatrix_BT601 = 2, + DXVA2_VideoTransferMatrix_SMPTE240M = 3, +}} +ENUM!{enum DXVA2_VideoLighting { + DXVA2_VideoLightingMask = 0xf, + DXVA2_VideoLighting_Unknown = 0, + DXVA2_VideoLighting_bright = 1, + DXVA2_VideoLighting_office = 2, + DXVA2_VideoLighting_dim = 3, + DXVA2_VideoLighting_dark = 4, +}} +ENUM!{enum DXVA2_VideoPrimaries { + DXVA2_VideoPrimariesMask = 0x1f, + DXVA2_VideoPrimaries_Unknown = 0, + DXVA2_VideoPrimaries_reserved = 1, + DXVA2_VideoPrimaries_BT709 = 2, + DXVA2_VideoPrimaries_BT470_2_SysM = 3, + DXVA2_VideoPrimaries_BT470_2_SysBG = 4, + DXVA2_VideoPrimaries_SMPTE170M = 5, + DXVA2_VideoPrimaries_SMPTE240M = 6, + DXVA2_VideoPrimaries_EBU3213 = 7, + DXVA2_VideoPrimaries_SMPTE_C = 8, +}} +ENUM!{enum DXVA2_VideoTransferFunction { + DXVA2_VideoTransFuncMask = 0x1f, + DXVA2_VideoTransFunc_Unknown = 0, + DXVA2_VideoTransFunc_10 = 1, + DXVA2_VideoTransFunc_18 = 2, + DXVA2_VideoTransFunc_20 = 3, + DXVA2_VideoTransFunc_22 = 4, + DXVA2_VideoTransFunc_709 = 5, + DXVA2_VideoTransFunc_240M = 6, + DXVA2_VideoTransFunc_sRGB = 7, + DXVA2_VideoTransFunc_28 = 8, +}} +pub const DXVA2_VideoTransFunc_22_709: DWORD = DXVA2_VideoTransFunc_709; +pub const DXVA2_VideoTransFunc_22_240M: DWORD = DXVA2_VideoTransFunc_240M; +pub const DXVA2_VideoTransFunc_22_8bit_sRGB: DWORD = DXVA2_VideoTransFunc_sRGB; +STRUCT!{struct DXVA2_Frequency { + Numerator: UINT, + Denominator: UINT, +}} +STRUCT!{struct DXVA2_VideoDesc { + SampleWidth: UINT, + SampleHeight: UINT, + SampleFormat: DXVA2_ExtendedFormat, + Format: D3DFORMAT, + InputSampleFreq: DXVA2_Frequency, + OutputFrameFreq: DXVA2_Frequency, + UABProtectionLevel: UINT, + Reserved: UINT, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0003 { + DXVA2_DeinterlaceTech_Unknown = 0, + DXVA2_DeinterlaceTech_BOBLineReplicate = 0x1, + DXVA2_DeinterlaceTech_BOBVerticalStretch = 0x2, + DXVA2_DeinterlaceTech_BOBVerticalStretch4Tap = 0x4, + DXVA2_DeinterlaceTech_MedianFiltering = 0x8, + DXVA2_DeinterlaceTech_EdgeFiltering = 0x10, + DXVA2_DeinterlaceTech_FieldAdaptive = 0x20, + DXVA2_DeinterlaceTech_PixelAdaptive = 0x40, + DXVA2_DeinterlaceTech_MotionVectorSteered = 0x80, + DXVA2_DeinterlaceTech_InverseTelecine = 0x100, + DXVA2_DeinterlaceTech_Mask = 0x1ff, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0004 { + DXVA2_NoiseFilterLumaLevel = 1, + DXVA2_NoiseFilterLumaThreshold = 2, + DXVA2_NoiseFilterLumaRadius = 3, + DXVA2_NoiseFilterChromaLevel = 4, + DXVA2_NoiseFilterChromaThreshold = 5, + DXVA2_NoiseFilterChromaRadius = 6, + DXVA2_DetailFilterLumaLevel = 7, + DXVA2_DetailFilterLumaThreshold = 8, + DXVA2_DetailFilterLumaRadius = 9, + DXVA2_DetailFilterChromaLevel = 10, + DXVA2_DetailFilterChromaThreshold = 11, + DXVA2_DetailFilterChromaRadius = 12, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0005 { + DXVA2_NoiseFilterTech_Unsupported = 0, + DXVA2_NoiseFilterTech_Unknown = 0x1, + DXVA2_NoiseFilterTech_Median = 0x2, + DXVA2_NoiseFilterTech_Temporal = 0x4, + DXVA2_NoiseFilterTech_BlockNoise = 0x8, + DXVA2_NoiseFilterTech_MosquitoNoise = 0x10, + DXVA2_NoiseFilterTech_Mask = 0x1f, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0006 { + DXVA2_DetailFilterTech_Unsupported = 0, + DXVA2_DetailFilterTech_Unknown = 0x1, + DXVA2_DetailFilterTech_Edge = 0x2, + DXVA2_DetailFilterTech_Sharpening = 0x4, + DXVA2_DetailFilterTech_Mask = 0x7, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0007 { + DXVA2_ProcAmp_None = 0, + DXVA2_ProcAmp_Brightness = 0x1, + DXVA2_ProcAmp_Contrast = 0x2, + DXVA2_ProcAmp_Hue = 0x4, + DXVA2_ProcAmp_Saturation = 0x8, + DXVA2_ProcAmp_Mask = 0xf, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0008 { + DXVA2_VideoProcess_None = 0, + DXVA2_VideoProcess_YUV2RGB = 0x1, + DXVA2_VideoProcess_StretchX = 0x2, + DXVA2_VideoProcess_StretchY = 0x4, + DXVA2_VideoProcess_AlphaBlend = 0x8, + DXVA2_VideoProcess_SubRects = 0x10, + DXVA2_VideoProcess_SubStreams = 0x20, + DXVA2_VideoProcess_SubStreamsExtended = 0x40, + DXVA2_VideoProcess_YUV2RGBExtended = 0x80, + DXVA2_VideoProcess_AlphaBlendExtended = 0x100, + DXVA2_VideoProcess_Constriction = 0x200, + DXVA2_VideoProcess_NoiseFilter = 0x400, + DXVA2_VideoProcess_DetailFilter = 0x800, + DXVA2_VideoProcess_PlanarAlpha = 0x1000, + DXVA2_VideoProcess_LinearScaling = 0x2000, + DXVA2_VideoProcess_GammaCompensated = 0x4000, + DXVA2_VideoProcess_MaintainsOriginalFieldData = 0x8000, + DXVA2_VideoProcess_Mask = 0xffff, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0009 { + DXVA2_VPDev_HardwareDevice = 0x1, + DXVA2_VPDev_EmulatedDXVA1 = 0x2, + DXVA2_VPDev_SoftwareDevice = 0x4, + DXVA2_VPDev_Mask = 0x7, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0010 { + DXVA2_SampleData_RFF = 0x1, + DXVA2_SampleData_TFF = 0x2, + DXVA2_SampleData_RFF_TFF_Present = 0x4, + DXVA2_SampleData_Mask = 0xffff, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0011 { + DXVA2_DestData_RFF = 0x1, + DXVA2_DestData_TFF = 0x2, + DXVA2_DestData_RFF_TFF_Present = 0x4, + DXVA2_DestData_Mask = 0xffff, +}} +STRUCT!{struct DXVA2_VideoProcessorCaps { + DeviceCaps: UINT, + InputPool: D3DPOOL, + NumForwardRefSamples: UINT, + NumBackwardRefSamples: UINT, + Reserved: UINT, + DeinterlaceTechnology: UINT, + ProcAmpControlCaps: UINT, + VideoProcessorOperations: UINT, + NoiseFilterTechnology: UINT, + DetailFilterTechnology: UINT, +}} +STRUCT!{struct DXVA2_Fixed32_s { + Fraction: USHORT, + Value: SHORT, +}} +UNION!{union DXVA2_Fixed32 { + [u32; 1], + s s_mut: DXVA2_Fixed32_s, + ll s_ll: LONG, +}} +STRUCT!{struct DXVA2_AYUVSample8 { + Cr: UCHAR, + Cb: UCHAR, + Y: UCHAR, + Alpha: UCHAR, +}} +STRUCT!{struct DXVA2_AYUVSample16 { + Cr: USHORT, + Cb: USHORT, + Y: USHORT, + Alpha: USHORT, +}} +pub type REFERENCE_TIME = LONGLONG; +STRUCT!{struct DXVA2_VideoSample { + Start: REFERENCE_TIME, + End: REFERENCE_TIME, + SampleFormat: DXVA2_ExtendedFormat, + SrcSurface: *mut IDirect3DSurface9, + SrcRect: RECT, + DstRect: RECT, + Pal: [DXVA2_AYUVSample8; 16], + PlanarAlpha: DXVA2_Fixed32, + SampleData: DWORD, +}} +STRUCT!{struct DXVA2_ValueRange { + MinValue: DXVA2_Fixed32, + MaxValue: DXVA2_Fixed32, + DefaultValue: DXVA2_Fixed32, + StepSize: DXVA2_Fixed32, +}} +STRUCT!{struct DXVA2_ProcAmpValues { + Brightness: DXVA2_Fixed32, + Contrast: DXVA2_Fixed32, + Hue: DXVA2_Fixed32, + Saturation: DXVA2_Fixed32, +}} +STRUCT!{struct DXVA2_FilterValues { + Level: DXVA2_Fixed32, + Threshold: DXVA2_Fixed32, + Radius: DXVA2_Fixed32, +}} +STRUCT!{struct DXVA2_VideoProcessBltParams { + TargetFrame: REFERENCE_TIME, + TargetRect: RECT, + ConstrictionSize: SIZE, + StreamingFlags: UINT, + BackgroundColor: DXVA2_AYUVSample16, + DestFormat: DXVA2_ExtendedFormat, + ProcAmpValues: DXVA2_ProcAmpValues, + Alpha: DXVA2_Fixed32, + NoiseFilterLuma: DXVA2_FilterValues, + NoiseFilterChroma: DXVA2_FilterValues, + DetailFilterLuma: DXVA2_FilterValues, + DetailFilterChroma: DXVA2_FilterValues, + DestData: DWORD, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0012 { + DXVA2_PictureParametersBufferType = 0, + DXVA2_MacroBlockControlBufferType = 1, + DXVA2_ResidualDifferenceBufferType = 2, + DXVA2_DeblockingControlBufferType = 3, + DXVA2_InverseQuantizationMatrixBufferType = 4, + DXVA2_SliceControlBufferType = 5, + DXVA2_BitStreamDateBufferType = 6, + DXVA2_MotionVectorBuffer = 7, + DXVA2_FilmGrainBuffer = 8, +}} +ENUM!{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0013 { + DXVA2_VideoDecoderRenderTarget = 0, + DXVA2_VideoProcessorRenderTarget = 1, + DXVA2_VideoSoftwareRenderTarget = 2, +}} +STRUCT!{struct DXVA2_ConfigPictureDecode { + guidConfigBitstreamEncryption: GUID, + guidConfigMBcontrolEncryption: GUID, + guidConfigResidDiffEncryption: GUID, + ConfigBitstreamRaw: UINT, + ConfigMBcontrolRasterOrder: UINT, + ConfigResidDiffHost: UINT, + ConfigSpatialResid8: UINT, + ConfigResid8Subtraction: UINT, + ConfigSpatialHost8or9Clipping: UINT, + ConfigSpatialResidInterleaved: UINT, + ConfigIntraResidUnsigned: UINT, + ConfigResidDiffAccelerator: UINT, + ConfigHostInverseScan: UINT, + ConfigSpecificIDCT: UINT, + Config4GroupedCoefs: UINT, + ConfigMinRenderTargetBuffCount: USHORT, + ConfigDecoderSpecific: USHORT, +}} +STRUCT!{struct DXVA2_DecodeBufferDesc { + CompressedBufferType: DWORD, + BufferIndex: UINT, + DataOffset: UINT, + DataSize: UINT, + FirstMBaddress: UINT, + NumMBsInBuffer: UINT, + Width: UINT, + Height: UINT, + Stride: UINT, + ReservedBits: UINT, + pvPVPState: PVOID, +}} +STRUCT!{struct DXVA2_AES_CTR_IV { + IV: UINT64, + Count: UINT64, +}} +STRUCT!{struct DXVA2_DecodeExtensionData { + Function: UINT, + pPrivateInputData: PVOID, + PrivateInputDataSize: UINT, + pPrivateOutputData: PVOID, + PrivateOutputDataSize: UINT, +}} +pub const DXVA2_DECODE_GET_DRIVER_HANDLE: UINT = 0x725; +pub const DXVA2_DECODE_SPECIFY_ENCRYPTED_BLOCKS: UINT = 0x724; +STRUCT!{struct DXVA2_DecodeExecuteParams { + NumCompBuffers: UINT, + pCompressedBuffers: *mut DXVA2_DecodeBufferDesc, + pExtensionData: *mut DXVA2_DecodeExtensionData, +}} +RIDL!{#[uuid(0xa0cade0f, 0x06d5, 0x4cf4, 0xa1, 0xc7, 0xf3, 0xcd, 0xd7, 0x25, 0xaa, 0x75)] +interface IDirect3DDeviceManager9(IDirect3DDeviceManager9Vtbl): IUnknown(IUnknownVtbl) { + fn ResetDevice( + pDevice: *mut IDirect3DDevice9, + resetToken: UINT, + ) -> HRESULT, + fn OpenDeviceHandle( + phDevice: *mut HANDLE, + ) -> HRESULT, + fn CloseDeviceHandle( + hDevice: HANDLE, + ) -> HRESULT, + fn TestDevice( + hDevice: HANDLE, + ) -> HRESULT, + fn LockDevice( + hDevice: HANDLE, + ppDevice: *mut *mut IDirect3DDevice9, + fBloc: BOOL, + ) -> HRESULT, + fn UnlockDevice( + hDevice: HANDLE, + fSaveState: BOOL, + ) -> HRESULT, + fn GetVideoService( + hDevice: HANDLE, + riid: REFIID, + ppService: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xfc51a550, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02)] +interface IDirectXVideoAccelerationService(IDirectXVideoAccelerationServiceVtbl): + IUnknown(IUnknownVtbl) { + fn CreateSurface( + Width: UINT, + Height: UINT, + BackBuffers: UINT, + Format: D3DFORMAT, + Pool: D3DPOOL, + Usage: DWORD, + DxvaType: DWORD, + ppSurface: *mut *mut IDirect3DSurface9, + pSharedHandle: *mut HANDLE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xfc51a551, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02)] +interface IDirectXVideoDecoderService(IDirectXVideoDecoderServiceVtbl): + IDirectXVideoAccelerationService(IDirectXVideoAccelerationServiceVtbl) { + fn GetDecoderDeviceGuids( + pCount: *mut UINT, + pGuids: *mut *mut GUID, + ) -> HRESULT, + fn GetDecoderRenderTargets( + Guid: REFGUID, + pCount: *mut UINT, + pFormats: *mut *mut D3DFORMAT, + ) -> HRESULT, + fn GetDecoderConfigurations( + Guid: REFGUID, + pVideoDesc: *const DXVA2_VideoDesc, + pReserved: *mut c_void, + pCount: *mut UINT, + ppConfigs: *mut *mut DXVA2_ConfigPictureDecode, + ) -> HRESULT, + fn CreateVideoDecoder( + Guid: REFGUID, + pVideoDesc: *const DXVA2_VideoDesc, + pConfig: *const DXVA2_ConfigPictureDecode, + ppDecoderRenderTargets: *mut *mut IDirect3DSurface9, + NumRenderTargets: UINT, + ppDecode: *mut *mut IDirectXVideoDecoder, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xfc51a552, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02)] +interface IDirectXVideoProcessorService(IDirectXVideoProcessorServiceVtbl): + IDirectXVideoAccelerationService(IDirectXVideoAccelerationServiceVtbl) { + fn RegisterVideoProcessorSoftwareDevice( + pCallbacks: *mut c_void, + ) -> HRESULT, + fn GetVideoProcessorDeviceGuids( + pVideoDesc: *mut DXVA2_VideoDesc, + pCount: *mut UINT, + pGuids: *mut *mut GUID, + ) -> HRESULT, + fn GetVideoProcessorRenderTargets( + VideoProcDeviceGuid: REFGUID, + pVideoDesc: *const DXVA2_VideoDesc, + pCount: *mut UINT, + pFormats: *mut *mut D3DFORMAT, + ) -> HRESULT, + fn GetVideoProcessorSubStreamFormats( + VideoProcDeviceGuid: REFGUID, + pVideoDesc: *const DXVA2_VideoDesc, + RenderTargetFormat: D3DFORMAT, + pCount: *mut UINT, + pFormats: *mut *mut D3DFORMAT, + ) -> HRESULT, + fn GetVideoProcessorCaps( + VideoProcDeviceGuid: REFGUID, + pVideoDesc: *const DXVA2_VideoDesc, + RenderTargetFormat: D3DFORMAT, + pCaps: *mut DXVA2_VideoProcessorCaps, + ) -> HRESULT, + fn GetProcAmpRange( + VideoProcDeviceGuid: REFGUID, + pVideoDesc: *const DXVA2_VideoDesc, + RenderTargetFormat: D3DFORMAT, + ProcAmpCap: UINT, + pRange: *mut DXVA2_ValueRange, + ) -> HRESULT, + fn GetFilterPropertyRange( + VideoProcDeviceGuid: REFGUID, + pVideoDesc: *const DXVA2_VideoDesc, + RenderTargetFormat: D3DFORMAT, + FilterSetting: UINT, + pRange: *mut DXVA2_ValueRange, + ) -> HRESULT, + fn CreateVideoProcessor( + VideoProcDeviceGuid: REFGUID, + pVideoDesc: *const DXVA2_VideoDesc, + RenderTargetFormat: D3DFORMAT, + MaxNumSubStreams: UINT, + ppVidProcess: *mut *mut IDirectXVideoProcessor, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf2b0810a, 0xfd00, 0x43c9, 0x91, 0x8c, 0xdf, 0x94, 0xe2, 0xd8, 0xef, 0x7d)] +interface IDirectXVideoDecoder(IDirectXVideoDecoderVtbl): IUnknown(IUnknownVtbl) { + fn GetVideoDecoderService( + ppService: *mut *mut IDirectXVideoDecoderService, + ) -> HRESULT, + fn GetCreationParameters( + pDeviceGuid: *mut GUID, + pVideoDesc: *mut DXVA2_VideoDesc, + pConfig: *mut DXVA2_ConfigPictureDecode, + pDecoderRenderTargets: *mut *mut *mut IDirect3DSurface9, + pNumSurfaces: *mut UINT, + ) -> HRESULT, + fn GetBuffer( + BufferType: UINT, + ppBuffer: *mut *mut c_void, + pBufferSize: *mut UINT, + ) -> HRESULT, + fn ReleaseBuffer( + BufferType: UINT, + ) -> HRESULT, + fn BeginFrame( + pRenderTarget: *mut IDirect3DSurface9, + pvPVPData: *mut c_void, + ) -> HRESULT, + fn EndFrame( + pHandleComplete: *mut HANDLE, + ) -> HRESULT, + fn Execute( + pExecuteParams: *const DXVA2_DecodeExecuteParams, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8c3a39f0, 0x916e, 0x4690, 0x80, 0x4f, 0x4c, 0x80, 0x01, 0x35, 0x5d, 0x25)] +interface IDirectXVideoProcessor(IDirectXVideoProcessorVtbl): IUnknown(IUnknownVtbl) { + fn GetVideoProcessorService( + ppService: *mut *mut IDirectXVideoProcessorService, + ) -> HRESULT, + fn GetCreationParameters( + pDeviceGuid: *mut GUID, + pVideoDesc: *mut DXVA2_VideoDesc, + pRenderTargetFormat: *mut D3DFORMAT, + pMaxNumSubStreams: *mut UINT, + ) -> HRESULT, + fn GetVideoProcessorCaps( + pCaps: *mut DXVA2_VideoProcessorCaps, + ) -> HRESULT, + fn GetProcAmpRange( + ProcAmpCap: UINT, + pRange: *mut DXVA2_ValueRange, + ) -> HRESULT, + fn GetFilterPropertyRange( + FilterSetting: UINT, + pRange: *mut DXVA2_ValueRange, + ) -> HRESULT, + fn VideoProcessBlt( + pRenderTarget: *mut IDirect3DSurface9, + pBltParams: *const DXVA2_VideoProcessBltParams, + pSamples: *const DXVA2_VideoSample, + NumSamples: UINT, + pHandleComplete: *mut HANDLE, + ) -> HRESULT, +}} +ENUM!{enum DXVA2_SurfaceType { + DXVA2_SurfaceType_DecoderRenderTarget = 0, + DXVA2_SurfaceType_ProcessorRenderTarget = 1, + DXVA2_SurfaceType_D3DRenderTargetTexture = 2, +}} +RIDL!{#[uuid(0xb7f916dd, 0xdb3b, 0x49c1, 0x84, 0xd7, 0xe4, 0x5e, 0xf9, 0x9e, 0xc7, 0x26)] +interface IDirectXVideoMemoryConfiguration(IDirectXVideoMemoryConfigurationVtbl): + IUnknown(IUnknownVtbl) { + fn GetAvailableSurfaceTypeByIndex( + dwTypeIndex: DWORD, + pdwType: *mut DXVA2_SurfaceType, + ) -> HRESULT, + fn SetSurfaceType( + dwType: DXVA2_SurfaceType, + ) -> HRESULT, +}} +extern "system" { + pub fn DXVA2CreateDirect3DDeviceManager9( + pResetToken: *mut UINT, + ppDeviceManager: *mut *mut IDirect3DDeviceManager9, + ) -> HRESULT; + pub fn DXVA2CreateVideoService( + pDD: *mut IDirect3DDevice9, + riid: REFIID, + ppService: *mut *mut c_void, + ) -> HRESULT; +} +#[inline] +pub fn DXVA2FloatToFixed(_float_: c_float) -> DXVA2_Fixed32 { + unsafe { + let mut _fixed_: DXVA2_Fixed32 = ::core::mem::uninitialized(); + _fixed_.s_mut().Fraction = LOWORD((_float_ * 0x10000 as c_float) as DWORD); + _fixed_.s_mut().Value = HIWORD((_float_ * 0x10000 as c_float) as DWORD) as SHORT; + _fixed_ + } +} +#[inline] +pub fn DXVA2FixedToFloat(_fixed_: DXVA2_Fixed32) -> c_float { + unsafe { + _fixed_.s().Value as FLOAT + _fixed_.s().Fraction as FLOAT / 0x10000 as FLOAT + } +} +#[inline] +pub fn DXVA2_Fixed32TransparentAlpha() -> DXVA2_Fixed32 { + unsafe { + let mut _fixed_: DXVA2_Fixed32 = ::core::mem::uninitialized(); + _fixed_.s_mut().Fraction = 0; + _fixed_.s_mut().Value = 0; + _fixed_ + } +} +#[inline] +pub fn DXVA2_Fixed32OpaqueAlpha() -> DXVA2_Fixed32 { + unsafe { + let mut _fixed_: DXVA2_Fixed32 = ::core::mem::uninitialized(); + _fixed_.s_mut().Fraction = 0; + _fixed_.s_mut().Value = 1; + _fixed_ + } +} diff --git a/bash-5.1/vendor/winapi/src/um/dxvahd.rs b/bash-5.1/vendor/winapi/src/um/dxvahd.rs new file mode 100644 index 0000000000000000000000000000000000000000..755dfdc2326aa86a77f853df36ab704f1b3880b9 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/dxvahd.rs @@ -0,0 +1,555 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_void; +use shared::d3d9::{IDirect3DDevice9Ex, IDirect3DSurface9}; +use shared::d3d9types::{D3DCOLOR, D3DFORMAT, D3DPOOL}; +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, DWORD, FLOAT, INT, UINT}; +use shared::windef::{RECT, SIZE}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, ULONGLONG}; +DEFINE_GUID!{IID_IDXVAHD_Device, + 0x95f12dfd, 0xd77e, 0x49be, 0x81, 0x5f, 0x57, 0xd5, 0x79, 0x63, 0x4d, 0x6d} +DEFINE_GUID!{IID_IDXVAHD_VideoProcessor, + 0x95f4edf4, 0x6e03, 0x4cd7, 0xbe, 0x1b, 0x30, 0x75, 0xd6, 0x65, 0xaa, 0x52} +ENUM!{enum DXVAHD_FRAME_FORMAT { + DXVAHD_FRAME_FORMAT_PROGRESSIVE = 0, + DXVAHD_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST = 1, + DXVAHD_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST = 2, +}} +ENUM!{enum DXVAHD_DEVICE_USAGE { + DXVAHD_DEVICE_USAGE_PLAYBACK_NORMAL = 0, + DXVAHD_DEVICE_USAGE_OPTIMAL_SPEED = 1, + DXVAHD_DEVICE_USAGE_OPTIMAL_QUALITY = 2, +}} +ENUM!{enum DXVAHD_SURFACE_TYPE { + DXVAHD_SURFACE_TYPE_VIDEO_INPUT = 0, + DXVAHD_SURFACE_TYPE_VIDEO_INPUT_PRIVATE = 1, + DXVAHD_SURFACE_TYPE_VIDEO_OUTPUT = 2, +}} +ENUM!{enum DXVAHD_DEVICE_TYPE { + DXVAHD_DEVICE_TYPE_HARDWARE = 0, + DXVAHD_DEVICE_TYPE_SOFTWARE = 1, + DXVAHD_DEVICE_TYPE_REFERENCE = 2, + DXVAHD_DEVICE_TYPE_OTHER = 3, +}} +ENUM!{enum DXVAHD_DEVICE_CAPS { + DXVAHD_DEVICE_CAPS_LINEAR_SPACE = 0x1, + DXVAHD_DEVICE_CAPS_xvYCC = 0x2, + DXVAHD_DEVICE_CAPS_RGB_RANGE_CONVERSION = 0x4, + DXVAHD_DEVICE_CAPS_YCbCr_MATRIX_CONVERSION = 0x8, +}} +ENUM!{enum DXVAHD_FEATURE_CAPS { + DXVAHD_FEATURE_CAPS_ALPHA_FILL = 0x1, + DXVAHD_FEATURE_CAPS_CONSTRICTION = 0x2, + DXVAHD_FEATURE_CAPS_LUMA_KEY = 0x4, + DXVAHD_FEATURE_CAPS_ALPHA_PALETTE = 0x8, +}} +ENUM!{enum DXVAHD_FILTER_CAPS { + DXVAHD_FILTER_CAPS_BRIGHTNESS = 0x1, + DXVAHD_FILTER_CAPS_CONTRAST = 0x2, + DXVAHD_FILTER_CAPS_HUE = 0x4, + DXVAHD_FILTER_CAPS_SATURATION = 0x8, + DXVAHD_FILTER_CAPS_NOISE_REDUCTION = 0x10, + DXVAHD_FILTER_CAPS_EDGE_ENHANCEMENT = 0x20, + DXVAHD_FILTER_CAPS_ANAMORPHIC_SCALING = 0x40, +}} +ENUM!{enum DXVAHD_INPUT_FORMAT_CAPS { + DXVAHD_INPUT_FORMAT_CAPS_RGB_INTERLACED = 0x1, + DXVAHD_INPUT_FORMAT_CAPS_RGB_PROCAMP = 0x2, + DXVAHD_INPUT_FORMAT_CAPS_RGB_LUMA_KEY = 0x4, + DXVAHD_INPUT_FORMAT_CAPS_PALETTE_INTERLACED = 0x8, +}} +ENUM!{enum DXVAHD_PROCESSOR_CAPS { + DXVAHD_PROCESSOR_CAPS_DEINTERLACE_BLEND = 0x1, + DXVAHD_PROCESSOR_CAPS_DEINTERLACE_BOB = 0x2, + DXVAHD_PROCESSOR_CAPS_DEINTERLACE_ADAPTIVE = 0x4, + DXVAHD_PROCESSOR_CAPS_DEINTERLACE_MOTION_COMPENSATION = 0x8, + DXVAHD_PROCESSOR_CAPS_INVERSE_TELECINE = 0x10, + DXVAHD_PROCESSOR_CAPS_FRAME_RATE_CONVERSION = 0x20, +}} +ENUM!{enum DXVAHD_ITELECINE_CAPS { + DXVAHD_ITELECINE_CAPS_32 = 0x1, + DXVAHD_ITELECINE_CAPS_22 = 0x2, + DXVAHD_ITELECINE_CAPS_2224 = 0x4, + DXVAHD_ITELECINE_CAPS_2332 = 0x8, + DXVAHD_ITELECINE_CAPS_32322 = 0x10, + DXVAHD_ITELECINE_CAPS_55 = 0x20, + DXVAHD_ITELECINE_CAPS_64 = 0x40, + DXVAHD_ITELECINE_CAPS_87 = 0x80, + DXVAHD_ITELECINE_CAPS_222222222223 = 0x100, + DXVAHD_ITELECINE_CAPS_OTHER = 0x80000000, +}} +ENUM!{enum DXVAHD_FILTER { + DXVAHD_FILTER_BRIGHTNESS = 0, + DXVAHD_FILTER_CONTRAST = 1, + DXVAHD_FILTER_HUE = 2, + DXVAHD_FILTER_SATURATION = 3, + DXVAHD_FILTER_NOISE_REDUCTION = 4, + DXVAHD_FILTER_EDGE_ENHANCEMENT = 5, + DXVAHD_FILTER_ANAMORPHIC_SCALING = 6, +}} +ENUM!{enum DXVAHD_BLT_STATE { + DXVAHD_BLT_STATE_TARGET_RECT = 0, + DXVAHD_BLT_STATE_BACKGROUND_COLOR = 1, + DXVAHD_BLT_STATE_OUTPUT_COLOR_SPACE = 2, + DXVAHD_BLT_STATE_ALPHA_FILL = 3, + DXVAHD_BLT_STATE_CONSTRICTION = 4, + DXVAHD_BLT_STATE_PRIVATE = 1000, +}} +ENUM!{enum DXVAHD_ALPHA_FILL_MODE { + DXVAHD_ALPHA_FILL_MODE_OPAQUE = 0, + DXVAHD_ALPHA_FILL_MODE_BACKGROUND = 1, + DXVAHD_ALPHA_FILL_MODE_DESTINATION = 2, + DXVAHD_ALPHA_FILL_MODE_SOURCE_STREAM = 3, +}} +ENUM!{enum DXVAHD_STREAM_STATE { + DXVAHD_STREAM_STATE_D3DFORMAT = 0, + DXVAHD_STREAM_STATE_FRAME_FORMAT = 1, + DXVAHD_STREAM_STATE_INPUT_COLOR_SPACE = 2, + DXVAHD_STREAM_STATE_OUTPUT_RATE = 3, + DXVAHD_STREAM_STATE_SOURCE_RECT = 4, + DXVAHD_STREAM_STATE_DESTINATION_RECT = 5, + DXVAHD_STREAM_STATE_ALPHA = 6, + DXVAHD_STREAM_STATE_PALETTE = 7, + DXVAHD_STREAM_STATE_LUMA_KEY = 8, + DXVAHD_STREAM_STATE_ASPECT_RATIO = 9, + DXVAHD_STREAM_STATE_FILTER_BRIGHTNESS = 100, + DXVAHD_STREAM_STATE_FILTER_CONTRAST = 101, + DXVAHD_STREAM_STATE_FILTER_HUE = 102, + DXVAHD_STREAM_STATE_FILTER_SATURATION = 103, + DXVAHD_STREAM_STATE_FILTER_NOISE_REDUCTION = 104, + DXVAHD_STREAM_STATE_FILTER_EDGE_ENHANCEMENT = 105, + DXVAHD_STREAM_STATE_FILTER_ANAMORPHIC_SCALING = 106, + DXVAHD_STREAM_STATE_PRIVATE = 1000, +}} +ENUM!{enum DXVAHD_OUTPUT_RATE { + DXVAHD_OUTPUT_RATE_NORMAL = 0, + DXVAHD_OUTPUT_RATE_HALF = 1, + DXVAHD_OUTPUT_RATE_CUSTOM = 2, +}} +STRUCT!{struct DXVAHD_RATIONAL { + Numerator: UINT, + Denominator: UINT, +}} +STRUCT!{struct DXVAHD_COLOR_RGBA { + R: FLOAT, + G: FLOAT, + B: FLOAT, + A: FLOAT, +}} +STRUCT!{struct DXVAHD_COLOR_YCbCrA { + Y: FLOAT, + Cb: FLOAT, + Cr: FLOAT, + A: FLOAT, +}} +UNION!{union DXVAHD_COLOR { + [u32; 4], + RGB RGB_mut: DXVAHD_COLOR_RGBA, + YCbCr YCbCr_mut: DXVAHD_COLOR_YCbCrA, +}} +STRUCT!{struct DXVAHD_CONTENT_DESC { + InputFrameFormat: DXVAHD_FRAME_FORMAT, + InputFrameRate: DXVAHD_RATIONAL, + InputWidth: UINT, + InputHeight: UINT, + OutputFrameRate: DXVAHD_RATIONAL, + OutputWidth: UINT, + OutputHeight: UINT, +}} +STRUCT!{struct DXVAHD_VPDEVCAPS { + DeviceType: DXVAHD_DEVICE_TYPE, + DeviceCaps: UINT, + FeatureCaps: UINT, + FilterCaps: UINT, + InputFormatCaps: UINT, + InputPool: D3DPOOL, + OutputFormatCount: UINT, + InputFormatCount: UINT, + VideoProcessorCount: UINT, + MaxInputStreams: UINT, + MaxStreamStates: UINT, +}} +STRUCT!{struct DXVAHD_VPCAPS { + VPGuid: GUID, + PastFrames: UINT, + FutureFrames: UINT, + ProcessorCaps: UINT, + ITelecineCaps: UINT, + CustomRateCount: UINT, +}} +STRUCT!{struct DXVAHD_CUSTOM_RATE_DATA { + CustomRate: DXVAHD_RATIONAL, + OutputFrames: UINT, + InputInterlaced: BOOL, + InputFramesOrFields: UINT, +}} +STRUCT!{struct DXVAHD_FILTER_RANGE_DATA { + Minimum: INT, + Maximum: INT, + Default: INT, + Multiplier: FLOAT, +}} +STRUCT!{struct DXVAHD_BLT_STATE_TARGET_RECT_DATA { + Enable: BOOL, + TargetRect: RECT, +}} +STRUCT!{struct DXVAHD_BLT_STATE_BACKGROUND_COLOR_DATA { + YCbCr: BOOL, + BackgroundColor: DXVAHD_COLOR, +}} +STRUCT!{struct DXVAHD_BLT_STATE_OUTPUT_COLOR_SPACE_DATA { + Value: UINT, +}} +BITFIELD!{DXVAHD_BLT_STATE_OUTPUT_COLOR_SPACE_DATA Value: UINT [ + Usage set_Usage[0..1], + RGB_Range set_RGB_Range[1..2], + YCbCr_Matrix set_YCbCr_Matrix[2..3], + YCbCr_xvYCC set_YCbCr_xvYCC[3..4], + Reserved set_Reserved[4..32], +]} +STRUCT!{struct DXVAHD_BLT_STATE_ALPHA_FILL_DATA { + Mode: DXVAHD_ALPHA_FILL_MODE, + StreamNumber: UINT, +}} +STRUCT!{struct DXVAHD_BLT_STATE_CONSTRICTION_DATA { + Enable: BOOL, + Size: SIZE, +}} +STRUCT!{struct DXVAHD_BLT_STATE_PRIVATE_DATA { + Guid: GUID, + DataSize: UINT, + pData: *mut c_void, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_D3DFORMAT_DATA { + Format: D3DFORMAT, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_FRAME_FORMAT_DATA { + FrameFormat: DXVAHD_FRAME_FORMAT, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_INPUT_COLOR_SPACE_DATA { + Value: UINT, +}} +BITFIELD!{DXVAHD_STREAM_STATE_INPUT_COLOR_SPACE_DATA Value: UINT [ + Type set_Type[0..1], + RGB_Range set_RGB_Range[1..2], + YCbCr_Matrix set_YCbCr_Matrix[2..3], + YCbCr_xvYCC set_YCbCr_xvYCC[3..4], + Reserved set_Reserved[4..32], +]} +STRUCT!{struct DXVAHD_STREAM_STATE_OUTPUT_RATE_DATA { + RepeatFrame: BOOL, + OutputRate: DXVAHD_OUTPUT_RATE, + CustomRate: DXVAHD_RATIONAL, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_SOURCE_RECT_DATA { + Enable: BOOL, + SourceRect: RECT, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_DESTINATION_RECT_DATA { + Enable: BOOL, + DestinationRect: RECT, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_ALPHA_DATA { + Enable: BOOL, + Alpha: FLOAT, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_PALETTE_DATA { + Count: UINT, + pEntries: *mut D3DCOLOR, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_LUMA_KEY_DATA { + Enable: BOOL, + Lower: FLOAT, + Upper: FLOAT, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_ASPECT_RATIO_DATA { + Enable: BOOL, + SourceAspectRatio: DXVAHD_RATIONAL, + DestinationAspectRatio: DXVAHD_RATIONAL, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_FILTER_DATA { + Enable: BOOL, + Level: INT, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_PRIVATE_DATA { + Guid: GUID, + DataSize: UINT, + pData: *mut c_void, +}} +STRUCT!{struct DXVAHD_STREAM_DATA { + Enable: BOOL, + OutputIndex: UINT, + InputFrameOrField: UINT, + PastFrames: UINT, + FutureFrames: UINT, + ppPastSurfaces: *mut *mut IDirect3DSurface9, + pInputSurface: *mut IDirect3DSurface9, + ppFutureSurfaces: *mut *mut IDirect3DSurface9, +}} +STRUCT!{struct DXVAHD_STREAM_STATE_PRIVATE_IVTC_DATA { + Enable: BOOL, + ITelecineFlags: UINT, + Frames: UINT, + InputField: UINT, +}} +RIDL!{#[uuid(0x95f12dfd, 0xd77e, 0x49be, 0x81, 0x5f, 0x57, 0xd5, 0x79, 0x63, 0x4d, 0x6d)] +interface IDXVAHD_Device(IDXVAHD_DeviceVtbl): IUnknown(IUnknownVtbl) { + fn CreateVideoSurface( + Width: UINT, + Height: UINT, + Format: D3DFORMAT, + Pool: D3DPOOL, + Usage: DWORD, + Type: DXVAHD_SURFACE_TYPE, + NumSurfaces: UINT, + ppSurfaces: *mut *mut IDirect3DSurface9, + pSharedHandle: *mut HANDLE, + ) -> HRESULT, + fn GetVideoProcessorDeviceCaps( + pCaps: *mut DXVAHD_VPDEVCAPS, + ) -> HRESULT, + fn GetVideoProcessorOutputFormats( + Count: UINT, + pFormats: *mut D3DFORMAT, + ) -> HRESULT, + fn GetVideoProcessorInputFormats( + Count: UINT, + pFormats: *mut D3DFORMAT, + ) -> HRESULT, + fn GetVideoProcessorCaps( + Count: UINT, + pCaps: *mut DXVAHD_VPCAPS, + ) -> HRESULT, + fn GetVideoProcessorCustomRates( + pVPGuid: *const GUID, + Count: UINT, + pRates: *mut DXVAHD_CUSTOM_RATE_DATA, + ) -> HRESULT, + fn GetVideoProcessorFilterRange( + Filter: DXVAHD_FILTER, + pRange: *mut DXVAHD_FILTER_RANGE_DATA, + ) -> HRESULT, + fn CreateVideoProcessor( + pVPGuid: *const GUID, + ppVideoProcessor: *mut *mut IDXVAHD_VideoProcessor, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x95f4edf4, 0x6e03, 0x4cd7, 0xbe, 0x1b, 0x30, 0x75, 0xd6, 0x65, 0xaa, 0x52)] +interface IDXVAHD_VideoProcessor(IDXVAHD_VideoProcessorVtbl): IUnknown(IUnknownVtbl) { + fn SetVideoProcessBltState( + State: DXVAHD_BLT_STATE, + DataSize: UINT, + pData: *const c_void, + ) -> HRESULT, + fn GetVideoProcessBltState( + State: DXVAHD_BLT_STATE, + DataSize: UINT, + pData: *mut c_void, + ) -> HRESULT, + fn SetVideoProcessStreamState( + StreamNumber: UINT, + State: DXVAHD_STREAM_STATE, + DataSize: UINT, + pData: *const c_void, + ) -> HRESULT, + fn GetVideoProcessStreamState( + StreamNumber: UINT, + State: DXVAHD_STREAM_STATE, + DataSize: UINT, + pData: *mut c_void, + ) -> HRESULT, + fn VideoProcessBltHD( + pOutputSurface: *mut IDirect3DSurface9, + OutputFrame: UINT, + StreamCount: UINT, + pStreams: *const DXVAHD_STREAM_DATA, + ) -> HRESULT, +}} +FN!{stdcall PDXVAHDSW_CreateDevice( + pD3DDevice: *mut IDirect3DDevice9Ex, + phDevice: *mut HANDLE, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_ProposeVideoPrivateFormat( + hDevice: HANDLE, + pFormat: *mut D3DFORMAT, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_GetVideoProcessorDeviceCaps( + hDevice: HANDLE, + pContentDesc: *const DXVAHD_CONTENT_DESC, + Usage: DXVAHD_DEVICE_USAGE, + pCaps: *mut DXVAHD_VPDEVCAPS, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_GetVideoProcessorOutputFormats( + hDevice: HANDLE, + pContentDesc: *const DXVAHD_CONTENT_DESC, + Usage: DXVAHD_DEVICE_USAGE, + Count: UINT, + pFormats: *mut D3DFORMAT, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_GetVideoProcessorInputFormats( + hDevice: HANDLE, + pContentDesc: *const DXVAHD_CONTENT_DESC, + Usage: DXVAHD_DEVICE_USAGE, + Count: UINT, + pFormats: *mut D3DFORMAT, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_GetVideoProcessorCaps( + hDevice: HANDLE, + pContentDesc: *const DXVAHD_CONTENT_DESC, + Usage: DXVAHD_DEVICE_USAGE, + Count: UINT, + pCaps: *mut DXVAHD_VPCAPS, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_GetVideoProcessorCustomRates( + hDevice: HANDLE, + pVPGuid: *const GUID, + Count: UINT, + pRates: *mut DXVAHD_CUSTOM_RATE_DATA, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_GetVideoProcessorFilterRange( + hDevice: HANDLE, + Filter: DXVAHD_FILTER, + pRange: *mut DXVAHD_FILTER_RANGE_DATA, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_DestroyDevice( + hDevice: HANDLE, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_CreateVideoProcessor( + hDevice: HANDLE, + pVPGuid: *const GUID, + phVideoProcessor: *mut HANDLE, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_SetVideoProcessBltState( + hVideoProcessor: HANDLE, + State: DXVAHD_BLT_STATE, + DataSize: UINT, + pData: *const c_void, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_GetVideoProcessBltStatePrivate( + hVideoProcessor: HANDLE, + pData: *mut DXVAHD_BLT_STATE_PRIVATE_DATA, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_SetVideoProcessStreamState( + hVideoProcessor: HANDLE, + StreamNumber: UINT, + State: DXVAHD_STREAM_STATE, + DataSize: UINT, + pData: *const c_void, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_GetVideoProcessStreamStatePrivate( + hVideoProcessor: HANDLE, + StreamNumber: UINT, + pData: *mut DXVAHD_STREAM_STATE_PRIVATE_DATA, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_VideoProcessBltHD( + hVideoProcessor: HANDLE, + pOutputSurface: *mut IDirect3DSurface9, + OutputFrame: UINT, + StreamCount: UINT, + pStreams: *const DXVAHD_STREAM_DATA, +) -> HRESULT} +FN!{stdcall PDXVAHDSW_DestroyVideoProcessor( + hVideoProcessor: HANDLE, +) -> HRESULT} +STRUCT!{struct DXVAHDSW_CALLBACKS { + CreateDevice: PDXVAHDSW_CreateDevice, + ProposeVideoPrivateFormat: PDXVAHDSW_ProposeVideoPrivateFormat, + GetVideoProcessorDeviceCaps: PDXVAHDSW_GetVideoProcessorDeviceCaps, + GetVideoProcessorOutputFormats: PDXVAHDSW_GetVideoProcessorOutputFormats, + GetVideoProcessorInputFormats: PDXVAHDSW_GetVideoProcessorInputFormats, + GetVideoProcessorCaps: PDXVAHDSW_GetVideoProcessorCaps, + GetVideoProcessorCustomRates: PDXVAHDSW_GetVideoProcessorCustomRates, + GetVideoProcessorFilterRange: PDXVAHDSW_GetVideoProcessorFilterRange, + DestroyDevice: PDXVAHDSW_DestroyDevice, + CreateVideoProcessor: PDXVAHDSW_CreateVideoProcessor, + SetVideoProcessBltState: PDXVAHDSW_SetVideoProcessBltState, + GetVideoProcessBltStatePrivate: PDXVAHDSW_GetVideoProcessBltStatePrivate, + SetVideoProcessStreamState: PDXVAHDSW_SetVideoProcessStreamState, + GetVideoProcessStreamStatePrivate: PDXVAHDSW_GetVideoProcessStreamStatePrivate, + VideoProcessBltHD: PDXVAHDSW_VideoProcessBltHD, + DestroyVideoProcessor: PDXVAHDSW_DestroyVideoProcessor, +}} +FN!{stdcall PDXVAHDSW_Plugin( + Size: UINT, + pCallbacks: *mut c_void, +) -> HRESULT} +DEFINE_GUID!{DXVAHDControlGuid, + 0xa0386e75, 0xf70c, 0x464c, 0xa9, 0xce, 0x33, 0xc4, 0x4e, 0x09, 0x16, 0x23} +DEFINE_GUID!{DXVAHDETWGUID_CREATEVIDEOPROCESSOR, + 0x681e3d1e, 0x5674, 0x4fb3, 0xa5, 0x03, 0x2f, 0x20, 0x55, 0xe9, 0x1f, 0x60} +DEFINE_GUID!{DXVAHDETWGUID_VIDEOPROCESSBLTSTATE, + 0x76c94b5a, 0x193f, 0x4692, 0x94, 0x84, 0xa4, 0xd9, 0x99, 0xda, 0x81, 0xa8} +DEFINE_GUID!{DXVAHDETWGUID_VIDEOPROCESSSTREAMSTATE, + 0x262c0b02, 0x209d, 0x47ed, 0x94, 0xd8, 0x82, 0xae, 0x02, 0xb8, 0x4a, 0xa7} +DEFINE_GUID!{DXVAHDETWGUID_VIDEOPROCESSBLTHD, + 0xbef3d435, 0x78c7, 0x4de3, 0x97, 0x07, 0xcd, 0x1b, 0x08, 0x3b, 0x16, 0x0a} +DEFINE_GUID!{DXVAHDETWGUID_VIDEOPROCESSBLTHD_STREAM, + 0x27ae473e, 0xa5fc, 0x4be5, 0xb4, 0xe3, 0xf2, 0x49, 0x94, 0xd3, 0xc4, 0x95} +DEFINE_GUID!{DXVAHDETWGUID_DESTROYVIDEOPROCESSOR, + 0xf943f0a0, 0x3f16, 0x43e0, 0x80, 0x93, 0x10, 0x5a, 0x98, 0x6a, 0xa5, 0xf1} +STRUCT!{struct DXVAHDETW_CREATEVIDEOPROCESSOR { + pObject: ULONGLONG, + pD3D9Ex: ULONGLONG, + VPGuid: GUID, +}} +STRUCT!{struct DXVAHDETW_VIDEOPROCESSBLTSTATE { + pObject: ULONGLONG, + State: DXVAHD_BLT_STATE, + DataSize: UINT, + SetState: BOOL, +}} +STRUCT!{struct DXVAHDETW_VIDEOPROCESSSTREAMSTATE { + pObject: ULONGLONG, + StreamNumber: UINT, + State: DXVAHD_STREAM_STATE, + DataSize: UINT, + SetState: BOOL, +}} +STRUCT!{struct DXVAHDETW_VIDEOPROCESSBLTHD { + pObject: ULONGLONG, + pOutputSurface: ULONGLONG, + TargetRect: RECT, + OutputFormat: D3DFORMAT, + ColorSpace: UINT, + OutputFrame: UINT, + StreamCount: UINT, + Enter: BOOL, +}} +STRUCT!{struct DXVAHDETW_VIDEOPROCESSBLTHD_STREAM { + pObject: ULONGLONG, + pInputSurface: ULONGLONG, + SourceRect: RECT, + DestinationRect: RECT, + InputFormat: D3DFORMAT, + FrameFormat: DXVAHD_FRAME_FORMAT, + ColorSpace: UINT, + StreamNumber: UINT, + OutputIndex: UINT, + InputFrameOrField: UINT, + PastFrames: UINT, + FutureFrames: UINT, +}} +STRUCT!{struct DXVAHDETW_DESTROYVIDEOPROCESSOR { + pObject: ULONGLONG, +}} +extern "system" { + pub fn DXVAHD_CreateDevice( + pD3DDevice: *mut IDirect3DDevice9Ex, + pContentDesc: *const DXVAHD_CONTENT_DESC, + Usage: DXVAHD_DEVICE_USAGE, + pPlugin: PDXVAHDSW_Plugin, + ppDevice: *mut *mut IDXVAHD_Device, + ) -> HRESULT; +} +FN!{stdcall PDXVAHD_CreateDevice( + pD3DDevice: *mut IDirect3DDevice9Ex, + pContentDesc: *const DXVAHD_CONTENT_DESC, + Usage: DXVAHD_DEVICE_USAGE, + pPlugin: PDXVAHDSW_Plugin, + ppDevice: *mut *mut IDXVAHD_Device, +) -> HRESULT} diff --git a/bash-5.1/vendor/winapi/src/um/eaptypes.rs b/bash-5.1/vendor/winapi/src/um/eaptypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..0a41e1a877168a7f2d74cc8ee40d711b4081cfaa --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/eaptypes.rs @@ -0,0 +1,403 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, BYTE, DWORD}; +use um::winnt::LPWSTR; +pub const eapPropCipherSuiteNegotiation: DWORD = 0x00000001; +pub const eapPropMutualAuth: DWORD = 0x00000002; +pub const eapPropIntegrity: DWORD = 0x00000004; +pub const eapPropReplayProtection: DWORD = 0x00000008; +pub const eapPropConfidentiality: DWORD = 0x00000010; +pub const eapPropKeyDerivation: DWORD = 0x00000020; +pub const eapPropKeyStrength64: DWORD = 0x00000040; +pub const eapPropKeyStrength128: DWORD = 0x00000080; +pub const eapPropKeyStrength256: DWORD = 0x00000100; +pub const eapPropKeyStrength512: DWORD = 0x00000200; +pub const eapPropKeyStrength1024: DWORD = 0x00000400; +pub const eapPropDictionaryAttackResistance: DWORD = 0x00000800; +pub const eapPropFastReconnect: DWORD = 0x00001000; +pub const eapPropCryptoBinding: DWORD = 0x00002000; +pub const eapPropSessionIndependence: DWORD = 0x00004000; +pub const eapPropFragmentation: DWORD = 0x00008000; +pub const eapPropChannelBinding: DWORD = 0x00010000; +pub const eapPropNap: DWORD = 0x00020000; +pub const eapPropStandalone: DWORD = 0x00040000; +pub const eapPropMppeEncryption: DWORD = 0x00080000; +pub const eapPropTunnelMethod: DWORD = 0x00100000; +pub const eapPropSupportsConfig: DWORD = 0x00200000; +pub const eapPropCertifiedMethod: DWORD = 0x00400000; +pub const eapPropHiddenMethod: DWORD = 0x00800000; +pub const eapPropMachineAuth: DWORD = 0x01000000; +pub const eapPropUserAuth: DWORD = 0x02000000; +pub const eapPropIdentityPrivacy: DWORD = 0x04000000; +pub const eapPropMethodChaining: DWORD = 0x08000000; +pub const eapPropSharedStateEquivalence: DWORD = 0x10000000; +pub const eapPropReserved: DWORD = 0x80000000; +pub const EAP_VALUENAME_PROPERTIES: &'static str = "Properties"; +pub type EAP_SESSIONID = DWORD; +STRUCT!{struct EAP_TYPE { + type_: BYTE, + dwVendorId: DWORD, + dwVendorType: DWORD, +}} +STRUCT!{struct EAP_METHOD_TYPE { + eapType: EAP_TYPE, + dwAuthorId: DWORD, +}} +STRUCT!{struct EAP_METHOD_INFO { + eaptype: EAP_METHOD_TYPE, + pwszAuthorName: LPWSTR, + pwszFriendlyName: LPWSTR, + eapProperties: DWORD, + pInnerMethodInfo: *mut EAP_METHOD_INFO, +}} +STRUCT!{struct EAP_METHOD_INFO_EX { + eaptype: EAP_METHOD_TYPE, + pwszAuthorName: LPWSTR, + pwszFriendlyName: LPWSTR, + eapProperties: DWORD, + pInnerMethodInfoArray: *mut EAP_METHOD_INFO_ARRAY_EX, +}} +STRUCT!{struct EAP_METHOD_INFO_ARRAY { + dwNumberOfMethods: DWORD, + pEapMethods: *mut EAP_METHOD_INFO, +}} +STRUCT!{struct EAP_METHOD_INFO_ARRAY_EX { + dwNumberOfMethods: DWORD, + pEapMethods: *mut EAP_METHOD_INFO_EX, +}} +STRUCT!{struct EAP_ERROR { + dwWinError: DWORD, + type_: EAP_METHOD_TYPE, + dwReasonCode: DWORD, + rootCauseGuid: GUID, + repairGuid: GUID, + helpLinkGuid: GUID, + pRootCauseString: LPWSTR, + pRepairString: LPWSTR, +}} +ENUM!{enum EAP_ATTRIBUTE_TYPE { + eatMinimum = 0, + eatUserName = 1, + eatUserPassword = 2, + eatMD5CHAPPassword = 3, + eatNASIPAddress = 4, + eatNASPort = 5, + eatServiceType = 6, + eatFramedProtocol = 7, + eatFramedIPAddress = 8, + eatFramedIPNetmask = 9, + eatFramedRouting = 10, + eatFilterId = 11, + eatFramedMTU = 12, + eatFramedCompression = 13, + eatLoginIPHost = 14, + eatLoginService = 15, + eatLoginTCPPort = 16, + eatUnassigned17 = 17, + eatReplyMessage = 18, + eatCallbackNumber = 19, + eatCallbackId = 20, + eatUnassigned21 = 21, + eatFramedRoute = 22, + eatFramedIPXNetwork = 23, + eatState = 24, + eatClass = 25, + eatVendorSpecific = 26, + eatSessionTimeout = 27, + eatIdleTimeout = 28, + eatTerminationAction = 29, + eatCalledStationId = 30, + eatCallingStationId = 31, + eatNASIdentifier = 32, + eatProxyState = 33, + eatLoginLATService = 34, + eatLoginLATNode = 35, + eatLoginLATGroup = 36, + eatFramedAppleTalkLink = 37, + eatFramedAppleTalkNetwork = 38, + eatFramedAppleTalkZone = 39, + eatAcctStatusType = 40, + eatAcctDelayTime = 41, + eatAcctInputOctets = 42, + eatAcctOutputOctets = 43, + eatAcctSessionId = 44, + eatAcctAuthentic = 45, + eatAcctSessionTime = 46, + eatAcctInputPackets = 47, + eatAcctOutputPackets = 48, + eatAcctTerminateCause = 49, + eatAcctMultiSessionId = 50, + eatAcctLinkCount = 51, + eatAcctEventTimeStamp = 55, + eatMD5CHAPChallenge = 60, + eatNASPortType = 61, + eatPortLimit = 62, + eatLoginLATPort = 63, + eatTunnelType = 64, + eatTunnelMediumType = 65, + eatTunnelClientEndpoint = 66, + eatTunnelServerEndpoint = 67, + eatARAPPassword = 70, + eatARAPFeatures = 71, + eatARAPZoneAccess = 72, + eatARAPSecurity = 73, + eatARAPSecurityData = 74, + eatPasswordRetry = 75, + eatPrompt = 76, + eatConnectInfo = 77, + eatConfigurationToken = 78, + eatEAPMessage = 79, + eatSignature = 80, + eatARAPChallengeResponse = 84, + eatAcctInterimInterval = 85, + eatNASIPv6Address = 95, + eatFramedInterfaceId = 96, + eatFramedIPv6Prefix = 97, + eatLoginIPv6Host = 98, + eatFramedIPv6Route = 99, + eatFramedIPv6Pool = 100, + eatARAPGuestLogon = 8096, + eatCertificateOID = 8097, + eatEAPConfiguration = 8098, + eatPEAPEmbeddedEAPTypeId = 8099, + eatPEAPFastRoamedSession = 8100, + eatFastRoamedSession = 8100, + eatEAPTLV = 8102, + eatCredentialsChanged = 8103, + eatInnerEapMethodType = 8104, + eatClearTextPassword = 8107, + eatQuarantineSoH = 8150, + eatCertificateThumbprint = 8250, + eatPeerId = 9000, + eatServerId = 9001, + eatMethodId = 9002, + eatEMSK = 9003, + eatSessionId = 9004, + eatReserved = 0xFFFFFFFF, +}} +pub type EapAttributeType = EAP_ATTRIBUTE_TYPE; +STRUCT!{struct EAP_ATTRIBUTE { + eaType: EAP_ATTRIBUTE_TYPE, + dwLength: DWORD, + pValue: *mut BYTE, +}} +pub type EapAttribute = EAP_ATTRIBUTE; +STRUCT!{struct EAP_ATTRIBUTES { + dwNumberOfAttributes: DWORD, + pAttribs: *mut EAP_ATTRIBUTE, +}} +pub type EapAttributes = EAP_ATTRIBUTES; +pub const EAP_FLAG_Reserved1: DWORD = 0x00000001; +pub const EAP_FLAG_NON_INTERACTIVE: DWORD = 0x00000002; +pub const EAP_FLAG_LOGON: DWORD = 0x00000004; +pub const EAP_FLAG_PREVIEW: DWORD = 0x00000008; +pub const EAP_FLAG_Reserved2: DWORD = 0x00000010; +pub const EAP_FLAG_MACHINE_AUTH: DWORD = 0x00000020; +pub const EAP_FLAG_GUEST_ACCESS: DWORD = 0x00000040; +pub const EAP_FLAG_Reserved3: DWORD = 0x00000080; +pub const EAP_FLAG_Reserved4: DWORD = 0x00000100; +pub const EAP_FLAG_RESUME_FROM_HIBERNATE: DWORD = 0x00000200; +pub const EAP_FLAG_Reserved5: DWORD = 0x00000400; +pub const EAP_FLAG_Reserved6: DWORD = 0x00000800; +pub const EAP_FLAG_FULL_AUTH: DWORD = 0x00001000; +pub const EAP_FLAG_PREFER_ALT_CREDENTIALS: DWORD = 0x00002000; +pub const EAP_FLAG_Reserved7: DWORD = 0x00004000; +pub const EAP_PEER_FLAG_HEALTH_STATE_CHANGE: DWORD = 0x00008000; +pub const EAP_FLAG_SUPRESS_UI: DWORD = 0x00010000; +pub const EAP_FLAG_PRE_LOGON: DWORD = 0x00020000; +pub const EAP_FLAG_USER_AUTH: DWORD = 0x00040000; +pub const EAP_FLAG_CONFG_READONLY: DWORD = 0x00080000; +pub const EAP_FLAG_Reserved8: DWORD = 0x00100000; +pub const EAP_FLAG_Reserved9: DWORD = 0x00400000; +pub const EAP_FLAG_VPN: DWORD = 0x00800000; +pub const EAP_CONFIG_INPUT_FIELD_PROPS_DEFAULT: DWORD = 0x00000000; +pub const EAP_CONFIG_INPUT_FIELD_PROPS_NON_DISPLAYABLE: DWORD = 0x00000001; +pub const EAP_CONFIG_INPUT_FIELD_PROPS_NON_PERSIST: DWORD = 0x00000002; +pub const EAP_UI_INPUT_FIELD_PROPS_DEFAULT: DWORD = EAP_CONFIG_INPUT_FIELD_PROPS_DEFAULT; +pub const EAP_UI_INPUT_FIELD_PROPS_NON_DISPLAYABLE: DWORD = + EAP_CONFIG_INPUT_FIELD_PROPS_NON_DISPLAYABLE; +pub const EAP_UI_INPUT_FIELD_PROPS_NON_PERSIST: DWORD = 0x00000002; +pub const EAP_UI_INPUT_FIELD_PROPS_READ_ONLY: DWORD = 0x00000004; +ENUM!{enum EAP_CONFIG_INPUT_FIELD_TYPE { + EapConfigInputUsername = 0, + EapConfigInputPassword = 1, + EapConfigInputNetworkUsername = 2, + EapConfigInputNetworkPassword = 3, + EapConfigInputPin = 4, + EapConfigInputPSK = 5, + EapConfigInputEdit = 6, + EapConfigSmartCardUsername = 7, + EapConfigSmartCardError = 8, +}} +pub type PEAP_CONFIG_INPUT_FIELD_TYPE = *mut EAP_CONFIG_INPUT_FIELD_TYPE; +pub const EAP_CREDENTIAL_VERSION: i32 = 1; +pub const EAP_INTERACTIVE_UI_DATA_VERSION: i32 = 1; +pub const EAPHOST_PEER_API_VERSION: i32 = 1; +pub const EAPHOST_METHOD_API_VERSION: i32 = 1; +pub const MAX_EAP_CONFIG_INPUT_FIELD_LENGTH: i32 = 256; +pub const MAX_EAP_CONFIG_INPUT_FIELD_VALUE_LENGTH: i32 = 1024; +STRUCT!{struct EAP_CONFIG_INPUT_FIELD_DATA { + dwSize: DWORD, + Type: EAP_CONFIG_INPUT_FIELD_TYPE, + dwFlagProps: DWORD, + pwszLabel: LPWSTR, + pwszData: LPWSTR, + dwMinDataLength: DWORD, + dwMaxDataLength: DWORD, +}} +pub type PEAP_CONFIG_INPUT_FIELD_DATA = *mut EAP_CONFIG_INPUT_FIELD_DATA; +STRUCT!{struct EAP_CONFIG_INPUT_FIELD_ARRAY { + dwVersion: DWORD, + dwNumberOfFields: DWORD, + pFields: *mut EAP_CONFIG_INPUT_FIELD_DATA, +}} +pub type PEAP_CONFIG_INPUT_FIELD_ARRAY = *mut EAP_CONFIG_INPUT_FIELD_ARRAY; +ENUM!{enum EAP_INTERACTIVE_UI_DATA_TYPE { + EapCredReq = 0, + EapCredResp = 1, + EapCredExpiryReq = 2, + EapCredExpiryResp = 3, + EapCredLogonReq = 4, + EapCredLogonResp = 5, +}} +pub type EAP_CRED_REQ = EAP_CONFIG_INPUT_FIELD_ARRAY; +pub type EAP_CRED_RESP = EAP_CONFIG_INPUT_FIELD_ARRAY; +pub type EAP_CRED_LOGON_REQ = EAP_CONFIG_INPUT_FIELD_ARRAY; +pub type EAP_CRED_LOGON_RESP = EAP_CONFIG_INPUT_FIELD_ARRAY; +STRUCT!{struct EAP_CRED_EXPIRY_REQ { + curCreds: EAP_CONFIG_INPUT_FIELD_ARRAY, + newCreds: EAP_CONFIG_INPUT_FIELD_ARRAY, +}} +pub type EAP_CRED_EXPIRY_RESP = EAP_CRED_EXPIRY_REQ; +UNION!{union EAP_UI_DATA_FORMAT { + [usize; 1], + credData credData_mut: *mut EAP_CRED_REQ, + credExpiryData credExpiryData_mut: *mut EAP_CRED_EXPIRY_REQ, + credLogonData credLogonData_mut: *mut EAP_CRED_LOGON_REQ, +}} +STRUCT!{struct EAP_INTERACTIVE_UI_DATA { + dwVersion: DWORD, + dwSize: DWORD, + dwDataType: EAP_INTERACTIVE_UI_DATA_TYPE, + cbUiData: DWORD, + pbUiData: EAP_UI_DATA_FORMAT, +}} +ENUM!{enum EAP_METHOD_PROPERTY_TYPE { + emptPropCipherSuiteNegotiation = 0, + emptPropMutualAuth = 1, + emptPropIntegrity = 2, + emptPropReplayProtection = 3, + emptPropConfidentiality = 4, + emptPropKeyDerivation = 5, + emptPropKeyStrength64 = 6, + emptPropKeyStrength128 = 7, + emptPropKeyStrength256 = 8, + emptPropKeyStrength512 = 9, + emptPropKeyStrength1024 = 10, + emptPropDictionaryAttackResistance = 11, + emptPropFastReconnect = 12, + emptPropCryptoBinding = 13, + emptPropSessionIndependence = 14, + emptPropFragmentation = 15, + emptPropChannelBinding = 16, + emptPropNap = 17, + emptPropStandalone = 18, + emptPropMppeEncryption = 19, + emptPropTunnelMethod = 20, + emptPropSupportsConfig = 21, + emptPropCertifiedMethod = 22, + emptPropHiddenMethod = 23, + emptPropMachineAuth = 24, + emptPropUserAuth = 25, + emptPropIdentityPrivacy = 26, + emptPropMethodChaining = 27, + emptPropSharedStateEquivalence = 28, + emptLegacyMethodPropertyFlag = 31, + emptPropVendorSpecific = 255, +}} +ENUM!{enum EAP_METHOD_PROPERTY_VALUE_TYPE { + empvtBool = 0, + empvtDword = 1, + empvtString = 2, +}} +STRUCT!{struct EAP_METHOD_PROPERTY_VALUE_BOOL { + length: DWORD, + value: BOOL, +}} +STRUCT!{struct EAP_METHOD_PROPERTY_VALUE_DWORD { + length: DWORD, + value: DWORD, +}} +STRUCT!{struct EAP_METHOD_PROPERTY_VALUE_STRING { + length: DWORD, + value: *mut BYTE, +}} +UNION!{union EAP_METHOD_PROPERTY_VALUE { + [usize; 2], + empvBool empvBool_mut: EAP_METHOD_PROPERTY_VALUE_BOOL, + empvDword empvDword_mut: EAP_METHOD_PROPERTY_VALUE_DWORD, + empvString empvString_mut: EAP_METHOD_PROPERTY_VALUE_STRING, +}} +STRUCT!{struct EAP_METHOD_PROPERTY { + eapMethodPropertyType: EAP_METHOD_PROPERTY_TYPE, + eapMethodPropertyValueType: EAP_METHOD_PROPERTY_VALUE_TYPE, + eapMethodPropertyValue: EAP_METHOD_PROPERTY_VALUE, +}} +STRUCT!{struct EAP_METHOD_PROPERTY_ARRAY { + dwNumberOfProperties: DWORD, + pMethodProperty: *mut EAP_METHOD_PROPERTY, +}} +STRUCT!{struct EAPHOST_IDENTITY_UI_PARAMS { + eapMethodType: EAP_METHOD_TYPE, + dwFlags: DWORD, + dwSizeofConnectionData: DWORD, + pConnectionData: *mut BYTE, + dwSizeofUserData: DWORD, + pUserData: *mut BYTE, + dwSizeofUserDataOut: DWORD, + pUserDataOut: *mut BYTE, + pwszIdentity: LPWSTR, + dwError: DWORD, + pEapError: *mut EAP_ERROR, +}} +STRUCT!{struct EAPHOST_INTERACTIVE_UI_PARAMS { + dwSizeofContextData: DWORD, + pContextData: *mut BYTE, + dwSizeofInteractiveUIData: DWORD, + pInteractiveUIData: *mut BYTE, + dwError: DWORD, + pEapError: *mut EAP_ERROR, +}} +ENUM!{enum EapCredentialType { + EAP_EMPTY_CREDENTIAL = 0, + EAP_USERNAME_PASSWORD_CREDENTIAL = 1, + EAP_WINLOGON_CREDENTIAL = 2, + EAP_CERTIFICATE_CREDENTIAL = 3, + EAP_SIM_CREDENTIAL = 4, +}} +STRUCT!{struct EapUsernamePasswordCredential { + username: LPWSTR, + password: LPWSTR, +}} +pub const CERTIFICATE_HASH_LENGTH: usize = 20; +STRUCT!{struct EapCertificateCredential { + certHash: [BYTE; CERTIFICATE_HASH_LENGTH], + password: LPWSTR, +}} +STRUCT!{struct EapSimCredential { + iccID: LPWSTR, +}} +UNION!{union EapCredentialTypeData { + [u32; 6] [u64; 4], + username_password username_password_mut: EapUsernamePasswordCredential, + certificate certificate_mut: EapCertificateCredential, + sim sim_mut: EapSimCredential, +}} +STRUCT!{struct EapCredential { + credType: EapCredentialType, + credData: EapCredentialTypeData, +}} diff --git a/bash-5.1/vendor/winapi/src/um/enclaveapi.rs b/bash-5.1/vendor/winapi/src/um/enclaveapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..b2da8e145b8dc320697ecc574ffc9981e6f57713 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/enclaveapi.rs @@ -0,0 +1,64 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{PSIZE_T, SIZE_T}; +use shared::minwindef::{BOOL, DWORD, LPCVOID, LPDWORD, LPVOID}; +use shared::ntdef::{HANDLE}; +use um::minwinbase::LPENCLAVE_ROUTINE; +use um::winnt::{LPCSTR, LPCWSTR}; +extern "system" { + pub fn IsEnclaveTypeSupported( + flEnclaveType: DWORD, + ) -> BOOL; + pub fn CreateEnclave( + hProcess: HANDLE, + lpAddress: LPVOID, + dwSize: SIZE_T, + dwInitialCommitment: SIZE_T, + flEnclaveType: DWORD, + lpEnclaveInformation: LPCVOID, + dwInfoLength: DWORD, + lpEnclaveError: LPDWORD, + ) -> LPVOID; + pub fn LoadEnclaveData( + hProcess: HANDLE, + lpAddress: LPVOID, + lpBuffer: LPCVOID, + nSize: SIZE_T, + flProtect: DWORD, + lpPageInformation: LPCVOID, + dwInfoLength: DWORD, + lpNumberOfBytesWritten: PSIZE_T, + lpEnclaveError: LPDWORD, + ) -> BOOL; + pub fn InitializeEnclave( + hProcess: HANDLE, + lpAddress: LPVOID, + lpEnclaveInformation: LPCVOID, + dwInfoLength: DWORD, + lpEnclaveError: LPDWORD, + ) -> BOOL; + pub fn LoadEnclaveImageA( + lpEnclaveAddress: LPVOID, + lpImageName: LPCSTR, + ) -> BOOL; + pub fn LoadEnclaveImageW( + lpEnclaveAddress: LPVOID, + lpImageName: LPCWSTR, + ) -> BOOL; + pub fn CallEnclave( + lpRoutine: LPENCLAVE_ROUTINE, + lpParameter: LPVOID, + fWaitForThread: BOOL, + lpReturnValue: *mut LPVOID, + ) -> BOOL; + pub fn TerminateEnclave( + lpAddress: LPVOID, + fWait: BOOL, + ) -> BOOL; + pub fn DeleteEnclave( + lpAddress: LPVOID, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/endpointvolume.rs b/bash-5.1/vendor/winapi/src/um/endpointvolume.rs new file mode 100644 index 0000000000000000000000000000000000000000..384e47b6cd64c43f4c63a93fda6a896fef91fb04 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/endpointvolume.rs @@ -0,0 +1,123 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_float; +use shared::basetsd::UINT32; +use shared::guiddef::{GUID, LPCGUID}; +use shared::minwindef::{BOOL, DWORD, UINT}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::HRESULT; +STRUCT!{struct AUDIO_VOLUME_NOTIFICATION_DATA { + guidEventContext: GUID, + bMuted: BOOL, + fMasterVolume: c_float, + nChannels: UINT, + afChannelVolumes: [c_float; 1], +}} +pub type PAUDIO_VOLUME_NOTIFICATION_DATA = *mut AUDIO_VOLUME_NOTIFICATION_DATA; +pub const ENDPOINT_HARDWARE_SUPPORT_VOLUME: DWORD = 0x00000001; +pub const ENDPOINT_HARDWARE_SUPPORT_MUTE: DWORD = 0x00000002; +pub const ENDPOINT_HARDWARE_SUPPORT_METER: DWORD = 0x00000004; +RIDL!{#[uuid(0x657804fa, 0xd6ad, 0x4496, 0x8a, 0x60, 0x35, 0x27, 0x52, 0xaf, 0x4f, 0x89)] +interface IAudioEndpointVolumeCallback(IAudioEndpointVolumeCallbackVtbl): IUnknown(IUnknownVtbl) { + fn OnNotify( + pNotify: PAUDIO_VOLUME_NOTIFICATION_DATA, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5cdf2c82, 0x841e, 0x4546, 0x97, 0x22, 0x0c, 0xf7, 0x40, 0x78, 0x22, 0x9a)] +interface IAudioEndpointVolume(IAudioEndpointVolumeVtbl): IUnknown(IUnknownVtbl) { + fn RegisterControlChangeNotify( + pNotify: *mut IAudioEndpointVolumeCallback, + ) -> HRESULT, + fn UnregisterControlChangeNotify( + pNotify: *mut IAudioEndpointVolumeCallback, + ) -> HRESULT, + fn GetChannelCount( + pnChannelCount: *mut UINT, + ) -> HRESULT, + fn SetMasterVolumeLevel( + fLevelDB: c_float, + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn SetMasterVolumeLevelScalar( + fLevel: c_float, + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn GetMasterVolumeLevel( + pfLevelDB: *mut c_float, + ) -> HRESULT, + fn GetMasterVolumeLevelScalar( + pfLevel: *mut c_float, + ) -> HRESULT, + fn SetChannelVolumeLevel( + nChannel: UINT, + fLevelDB: c_float, + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn SetChannelVolumeLevelScalar( + nChannel: UINT, + fLevel: c_float, + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn GetChannelVolumeLevel( + nChannel: UINT, + pfLevelDB: *mut c_float, + ) -> HRESULT, + fn GetChannelVolumeLevelScalar( + nChannel: UINT, + pfLevel: *mut c_float, + ) -> HRESULT, + fn SetMute( + bMute: BOOL, + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn GetMute( + pbMute: *mut BOOL, + ) -> HRESULT, + fn GetVolumeStepInfo( + pnStep: *mut UINT, + pnStepCount: *mut UINT, + ) -> HRESULT, + fn VolumeStepUp( + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn VolumeStepDown( + pguidEventContext: LPCGUID, + ) -> HRESULT, + fn QueryHardwareSupport( + pdwHardwareSupportMask: *mut DWORD, + ) -> HRESULT, + fn GetVolumeRange( + pflVolumeMindB: *mut c_float, + pflVolumeMaxdB: *mut c_float, + pflVolumeIncrementdB: *mut c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x66e11784, 0xf695, 0x4f28, 0xa5, 0x05, 0xa7, 0x08, 0x00, 0x81, 0xa7, 0x8f)] +interface IAudioEndpointVolumeEx(IAudioEndpointVolumeExVtbl): + IAudioEndpointVolume(IAudioEndpointVolumeVtbl) { + fn GetVolumeRangeChannel( + iChannel: UINT, + pflVolumeMindB: *mut c_float, + pflVolumeMaxdB: *mut c_float, + pflVolumeIncrementdB: *mut c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc02216f6, 0x8c67, 0x4b5b, 0x9d, 0x00, 0xd0, 0x08, 0xe7, 0x3e, 0x00, 0x64)] +interface IAudioMeterInformation(IAudioMeterInformationVtbl): IUnknown(IUnknownVtbl) { + fn GetPeakValue( + pfPeak: *mut c_float, + ) -> HRESULT, + fn GetMeteringChannelCount( + pnChannelCount: *mut UINT, + ) -> HRESULT, + fn GetChannelsPeakValues( + u32ChannelCount: UINT32, + afPeakValues: *mut c_float, + ) -> HRESULT, + fn QueryHardwareSupport( + pdwHardwareSupportMask: *mut DWORD, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/errhandlingapi.rs b/bash-5.1/vendor/winapi/src/um/errhandlingapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..66d7618de1bd0e4d50f57d259d3c7e5fdec9b77b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/errhandlingapi.rs @@ -0,0 +1,75 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-core-errorhandling-l1 +use shared::basetsd::ULONG_PTR; +use shared::minwindef::{BOOL, DWORD, LPDWORD, UINT, ULONG}; +use um::winnt::{ + EXCEPTION_POINTERS, LONG, LPCSTR, LPCWSTR, PCONTEXT, PEXCEPTION_RECORD, + PVECTORED_EXCEPTION_HANDLER, PVOID, +}; +FN!{stdcall PTOP_LEVEL_EXCEPTION_FILTER( + ExceptionInfo: *mut EXCEPTION_POINTERS, +) -> LONG} +pub type LPTOP_LEVEL_EXCEPTION_FILTER = PTOP_LEVEL_EXCEPTION_FILTER; +extern "system" { + pub fn RaiseException( + dwExceptionCode: DWORD, + dwExceptionFlags: DWORD, + nNumberOfArguments: DWORD, + lpArguments: *const ULONG_PTR, + ); + pub fn UnhandledExceptionFilter( + ExceptionInfo: *mut EXCEPTION_POINTERS, + ) -> LONG; + pub fn SetUnhandledExceptionFilter( + lpTopLevelExceptionFilter: LPTOP_LEVEL_EXCEPTION_FILTER, + ) -> LPTOP_LEVEL_EXCEPTION_FILTER; + pub fn GetLastError() -> DWORD; + pub fn SetLastError( + dwErrCode: DWORD, + ); + pub fn GetErrorMode() -> UINT; + pub fn SetErrorMode( + uMode: UINT, + ) -> UINT; + pub fn AddVectoredExceptionHandler( + First: ULONG, + Handler: PVECTORED_EXCEPTION_HANDLER, + ) -> PVOID; + pub fn RemoveVectoredExceptionHandler( + Handle: PVOID, + ) -> ULONG; + pub fn AddVectoredContinueHandler( + First: ULONG, + Handler: PVECTORED_EXCEPTION_HANDLER, + ) -> PVOID; + pub fn RemoveVectoredContinueHandler( + Handle: PVOID, + ) -> ULONG; +} +// RestoreLastError +extern "system" { + pub fn RaiseFailFastException( + pExceptionRecord: PEXCEPTION_RECORD, + pContextRecord: PCONTEXT, + dwFlags: DWORD, + ); + pub fn FatalAppExitA( + uAction: UINT, + lpMessageText: LPCSTR, + ); + pub fn FatalAppExitW( + uAction: UINT, + lpMessageText: LPCWSTR, + ); + pub fn GetThreadErrorMode() -> DWORD; + pub fn SetThreadErrorMode( + dwNewMode: DWORD, + lpOldMode: LPDWORD, + ) -> BOOL; +} +// What library provides this function? +// TerminateProcessOnMemoryExhaustion diff --git a/bash-5.1/vendor/winapi/src/um/evntcons.rs b/bash-5.1/vendor/winapi/src/um/evntcons.rs new file mode 100644 index 0000000000000000000000000000000000000000..48d4d700d440f83fc8c6596016f805f17196e47b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/evntcons.rs @@ -0,0 +1,229 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::ULONG64; +use shared::evntprov::EVENT_DESCRIPTOR; +use shared::evntrace::ETW_BUFFER_CONTEXT; +use shared::guiddef::{GUID, LPGUID}; +use shared::minwindef::{PUCHAR, PULONG, PUSHORT, UCHAR, ULONG, USHORT}; +use um::winnt::{ + ANYSIZE_ARRAY, BOOLEAN, LARGE_INTEGER, PCSTR, PSECURITY_DESCRIPTOR, PSID, PVOID, ULONGLONG, +}; +pub const EVENT_HEADER_EXT_TYPE_RELATED_ACTIVITYID: USHORT = 0x0001; +pub const EVENT_HEADER_EXT_TYPE_SID: USHORT = 0x0002; +pub const EVENT_HEADER_EXT_TYPE_TS_ID: USHORT = 0x0003; +pub const EVENT_HEADER_EXT_TYPE_INSTANCE_INFO: USHORT = 0x0004; +pub const EVENT_HEADER_EXT_TYPE_STACK_TRACE32: USHORT = 0x0005; +pub const EVENT_HEADER_EXT_TYPE_STACK_TRACE64: USHORT = 0x0006; +pub const EVENT_HEADER_EXT_TYPE_PEBS_INDEX: USHORT = 0x0007; +pub const EVENT_HEADER_EXT_TYPE_PMC_COUNTERS: USHORT = 0x0008; +pub const EVENT_HEADER_EXT_TYPE_PSM_KEY: USHORT = 0x0009; +pub const EVENT_HEADER_EXT_TYPE_EVENT_KEY: USHORT = 0x000A; +pub const EVENT_HEADER_EXT_TYPE_EVENT_SCHEMA_TL: USHORT = 0x000B; +pub const EVENT_HEADER_EXT_TYPE_PROV_TRAITS: USHORT = 0x000C; +pub const EVENT_HEADER_EXT_TYPE_PROCESS_START_KEY: USHORT = 0x000D; +pub const EVENT_HEADER_EXT_TYPE_CONTROL_GUID: USHORT = 0x000E; +pub const EVENT_HEADER_EXT_TYPE_MAX: USHORT = 0x000F; +STRUCT!{struct EVENT_HEADER_EXTENDED_DATA_ITEM_s { + bitfield: USHORT, +}} +BITFIELD!{EVENT_HEADER_EXTENDED_DATA_ITEM_s bitfield: USHORT [ + Linkage set_Linkage[0..1], + Reserved2 set_Reserved2[1..16], +]} +STRUCT!{struct EVENT_HEADER_EXTENDED_DATA_ITEM { + Reserved1: USHORT, + ExtType: USHORT, + s: EVENT_HEADER_EXTENDED_DATA_ITEM_s, + DataSize: USHORT, + DataPtr: ULONGLONG, +}} +pub type PEVENT_HEADER_EXTENDED_DATA_ITEM = *mut EVENT_HEADER_EXTENDED_DATA_ITEM; +STRUCT!{struct EVENT_EXTENDED_ITEM_INSTANCE { + InstanceId: ULONG, + ParentInstanceId: ULONG, + ParentGuid: GUID, +}} +pub type PEVENT_EXTENDED_ITEM_INSTANCE = *mut EVENT_EXTENDED_ITEM_INSTANCE; +STRUCT!{struct EVENT_EXTENDED_ITEM_RELATED_ACTIVITYID { + RelatedActivityId: GUID, +}} +pub type PEVENT_EXTENDED_ITEM_RELATED_ACTIVITYID = *mut EVENT_EXTENDED_ITEM_RELATED_ACTIVITYID; +STRUCT!{struct EVENT_EXTENDED_ITEM_TS_ID { + SessionId: ULONG, +}} +pub type PEVENT_EXTENDED_ITEM_TS_ID = *mut EVENT_EXTENDED_ITEM_TS_ID; +STRUCT!{struct EVENT_EXTENDED_ITEM_STACK_TRACE32 { + MatchId: ULONG64, + Address: [ULONG; ANYSIZE_ARRAY], +}} +pub type PEVENT_EXTENDED_ITEM_STACK_TRACE32 = *mut EVENT_EXTENDED_ITEM_STACK_TRACE32; +STRUCT!{struct EVENT_EXTENDED_ITEM_STACK_TRACE64 { + MatchId: ULONG64, + Address: [ULONG64; ANYSIZE_ARRAY], +}} +pub type PEVENT_EXTENDED_ITEM_STACK_TRACE64 = *mut EVENT_EXTENDED_ITEM_STACK_TRACE64; +STRUCT!{struct EVENT_EXTENDED_ITEM_PEBS_INDEX { + PebsIndex: ULONG64, +}} +pub type PEVENT_EXTENDED_ITEM_PEBS_INDEX = *mut EVENT_EXTENDED_ITEM_PEBS_INDEX; +STRUCT!{struct EVENT_EXTENDED_ITEM_PMC_COUNTERS { + Counter: [ULONG64; ANYSIZE_ARRAY], +}} +pub type PEVENT_EXTENDED_ITEM_PMC_COUNTERS = *mut EVENT_EXTENDED_ITEM_PMC_COUNTERS; +STRUCT!{struct EVENT_EXTENDED_ITEM_PROCESS_START_KEY { + ProcessStartKey: ULONG64, +}} +pub type PEVENT_EXTENDED_ITEM_PROCESS_START_KEY = *mut EVENT_EXTENDED_ITEM_PROCESS_START_KEY; +STRUCT!{struct EVENT_EXTENDED_ITEM_EVENT_KEY { + Key: ULONG64, +}} +pub type PEVENT_EXTENDED_ITEM_EVENT_KEY = *mut EVENT_EXTENDED_ITEM_EVENT_KEY; +pub const EVENT_HEADER_PROPERTY_XML: USHORT = 0x0001; +pub const EVENT_HEADER_PROPERTY_FORWARDED_XML: USHORT = 0x0002; +pub const EVENT_HEADER_PROPERTY_LEGACY_EVENTLOG: USHORT = 0x0004; +pub const EVENT_HEADER_PROPERTY_RELOGGABLE: USHORT = 0x0008; +pub const EVENT_HEADER_FLAG_EXTENDED_INFO: USHORT = 0x0001; +pub const EVENT_HEADER_FLAG_PRIVATE_SESSION: USHORT = 0x0002; +pub const EVENT_HEADER_FLAG_STRING_ONLY: USHORT = 0x0004; +pub const EVENT_HEADER_FLAG_TRACE_MESSAGE: USHORT = 0x0008; +pub const EVENT_HEADER_FLAG_NO_CPUTIME: USHORT = 0x0010; +pub const EVENT_HEADER_FLAG_32_BIT_HEADER: USHORT = 0x0020; +pub const EVENT_HEADER_FLAG_64_BIT_HEADER: USHORT = 0x0040; +pub const EVENT_HEADER_FLAG_CLASSIC_HEADER: USHORT = 0x0100; +pub const EVENT_HEADER_FLAG_PROCESSOR_INDEX: USHORT = 0x0200; +STRUCT!{struct EVENT_HEADER_u_s { + KernelTime: ULONG, + UserTime: ULONG, +}} +UNION!{union EVENT_HEADER_u { + [u64; 1], + s s_mut: EVENT_HEADER_u_s, + ProcessorTime ProcessorTime_mut: ULONG64, +}} +STRUCT!{struct EVENT_HEADER { + Size: USHORT, + HeaderType: USHORT, + Flags: USHORT, + EventProperty: USHORT, + ThreadId: ULONG, + ProcessId: ULONG, + TimeStamp: LARGE_INTEGER, + ProviderId: GUID, + EventDescriptor: EVENT_DESCRIPTOR, + u: EVENT_HEADER_u, + ActivityId: GUID, +}} +pub type PEVENT_HEADER = *mut EVENT_HEADER; +STRUCT!{struct EVENT_RECORD { + EventHeader: EVENT_HEADER, + BufferContext: ETW_BUFFER_CONTEXT, + ExtendedDataCount: USHORT, + UserDataLength: USHORT, + ExtendedData: PEVENT_HEADER_EXTENDED_DATA_ITEM, + UserData: PVOID, + UserContext: PVOID, +}} +pub type PEVENT_RECORD = *mut EVENT_RECORD; +pub type PCEVENT_RECORD = *const EVENT_RECORD; +pub const EVENT_ENABLE_PROPERTY_SID: USHORT = 0x00000001; +pub const EVENT_ENABLE_PROPERTY_TS_ID: USHORT = 0x00000002; +pub const EVENT_ENABLE_PROPERTY_STACK_TRACE: USHORT = 0x00000004; +pub const EVENT_ENABLE_PROPERTY_PSM_KEY: USHORT = 0x00000008; +pub const EVENT_ENABLE_PROPERTY_IGNORE_KEYWORD_0: USHORT = 0x00000010; +pub const EVENT_ENABLE_PROPERTY_PROVIDER_GROUP: USHORT = 0x00000020; +pub const EVENT_ENABLE_PROPERTY_ENABLE_KEYWORD_0: USHORT = 0x00000040; +pub const EVENT_ENABLE_PROPERTY_PROCESS_START_KEY: USHORT = 0x00000080; +pub const EVENT_ENABLE_PROPERTY_EVENT_KEY: USHORT = 0x00000100; +pub const EVENT_ENABLE_PROPERTY_EXCLUDE_INPRIVATE: USHORT = 0x00000200; +pub const PROCESS_TRACE_MODE_REAL_TIME: ULONG = 0x00000100; +pub const PROCESS_TRACE_MODE_RAW_TIMESTAMP: ULONG = 0x00001000; +pub const PROCESS_TRACE_MODE_EVENT_RECORD: ULONG = 0x10000000; +#[inline] +pub unsafe fn GetEventProcessorIndex(EventRecord: PCEVENT_RECORD) -> ULONG { + if (*EventRecord).EventHeader.Flags & EVENT_HEADER_FLAG_PROCESSOR_INDEX != 0 { + *(*EventRecord).BufferContext.u.ProcessorIndex() as ULONG + } else { + (*EventRecord).BufferContext.u.s().ProcessorNumber as ULONG + } +} +ENUM!{enum ETW_PROVIDER_TRAIT_TYPE { + EtwProviderTraitTypeGroup = 1, + EtwProviderTraitDecodeGuid = 2, + EtwProviderTraitTypeMax, +}} +#[inline] +unsafe fn strnlen(s: PCSTR, max_len: isize) -> isize { + let mut len = 0; + while *s.offset(len) != 0 && len < max_len { + len += 1 + } + len +} +// Taken from Rust 1.17.0 sources +#[inline] +unsafe fn read_unaligned(src: *const T) -> T { + use core::{mem, ptr}; + let mut tmp: T = mem::uninitialized(); + ptr::copy_nonoverlapping( + src as *const u8, + &mut tmp as *mut T as *mut u8, + mem::size_of::(), + ); + tmp +} +#[inline] +pub unsafe fn EtwGetTraitFromProviderTraits( + ProviderTraits: PVOID, TraitType: UCHAR, Trait: *mut PVOID, Size: PUSHORT, +) { + use core::ptr::null_mut; + let ByteCount = read_unaligned(ProviderTraits as *mut USHORT) as isize; + let mut Ptr = ProviderTraits as PUCHAR; + let PtrEnd = Ptr.offset(ByteCount); + *Trait = null_mut(); + *Size = 0; + if ByteCount < 3 { + return; + } + Ptr = Ptr.offset(2); + Ptr = Ptr.offset(strnlen(Ptr as PCSTR, (ByteCount - 3) as isize)); + Ptr = Ptr.offset(1); + while Ptr < PtrEnd { + let TraitByteCount = read_unaligned(Ptr as *const USHORT); + if TraitByteCount < 3 { + return; + } + if *Ptr.offset(2) == TraitType && Ptr.offset(TraitByteCount as isize) <= PtrEnd { + *Trait = Ptr.offset(3) as PVOID; + *Size = TraitByteCount - 3; + return; + } + Ptr = Ptr.offset(TraitByteCount as isize); + } +} +ENUM!{enum EVENTSECURITYOPERATION { + EventSecuritySetDACL, + EventSecuritySetSACL, + EventSecurityAddDACL, + EventSecurityAddSACL, + EventSecurityMax, +}} +extern "system" { + pub fn EventAccessControl( + Guid: LPGUID, + Operation: ULONG, + Sid: PSID, + Rights: ULONG, + AllowOrDeny: BOOLEAN, + ) -> ULONG; + pub fn EventAccessQuery( + Guid: LPGUID, + Buffer: PSECURITY_DESCRIPTOR, + BufferSize: PULONG, + ) -> ULONG; + pub fn EventAccessRemove( + Guid: LPGUID, + ) -> ULONG; +} diff --git a/bash-5.1/vendor/winapi/src/um/exdisp.rs b/bash-5.1/vendor/winapi/src/um/exdisp.rs new file mode 100644 index 0000000000000000000000000000000000000000..3d44fd385be588b5a8b986207d7be32a3f79990c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/exdisp.rs @@ -0,0 +1,220 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of ExDisp.h +use shared::basetsd::SHANDLE_PTR; +use shared::wtypes::{BSTR, VARIANT_BOOL}; +use um::docobj::{OLECMDEXECOPT, OLECMDF, OLECMDID}; +use um::oaidl::{IDispatch, IDispatchVtbl, VARIANT}; +use um::ocidl::READYSTATE; +use um::winnt::{HRESULT, INT, LONG}; +DEFINE_GUID!{IID_IWebBrowser2, + 0xd30c1661, 0xcdaf, 0x11d0, 0x8a, 0x3e, 0x00, 0xc0, 0x4f, 0xc9, 0xe2, 0x6e} +RIDL!{#[uuid(0xeab22ac1, 0x30c1, 0x11cf, 0xa7, 0xeb, 0x00, 0x00, 0xc0, 0x5b, 0xae, 0x0b)] +interface IWebBrowser(IWebBrowserVtbl): IDispatch(IDispatchVtbl) { + fn GoBack() -> HRESULT, + fn GoForward() -> HRESULT, + fn GoHome() -> HRESULT, + fn GoSearch() -> HRESULT, + fn Navigate( + URL: BSTR, + Flags: *const VARIANT, + TargetFrameName: *const VARIANT, + PostData: *const VARIANT, + Headers: *const VARIANT, + ) -> HRESULT, + fn Refresh() -> HRESULT, + fn Refresh2( + Level: *const VARIANT, + ) -> HRESULT, + fn Stop() -> HRESULT, + fn get_Application( + ppDisp: *mut *mut IDispatch, + ) -> HRESULT, + fn get_Parent( + ppDisp: *mut *mut IDispatch, + ) -> HRESULT, + fn get_Container( + ppDisp: *mut *mut IDispatch, + ) -> HRESULT, + fn get_Document( + ppDisp: *mut *mut IDispatch, + ) -> HRESULT, + fn get_TopLevelContainer( + pBool: *mut VARIANT_BOOL, + ) -> HRESULT, + fn get_Type( + Type: *mut BSTR, + ) -> HRESULT, + fn get_Left( + pl: *mut LONG, + ) -> HRESULT, + fn put_Left( + Left: LONG, + ) -> HRESULT, + fn get_Top( + pl: *mut LONG, + ) -> HRESULT, + fn put_Top( + Top: LONG, + ) -> HRESULT, + fn get_Width( + pl: *mut LONG, + ) -> HRESULT, + fn put_Width( + Width: LONG, + ) -> HRESULT, + fn get_Height( + pl: *mut LONG, + ) -> HRESULT, + fn put_Height( + Height: LONG, + ) -> HRESULT, + fn get_LocationName( + LocationName: *mut BSTR, + ) -> HRESULT, + fn get_LocationURL( + LocationURL: *mut BSTR, + ) -> HRESULT, + fn get_Busy( + pBool: *mut VARIANT_BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0002df05, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IWebBrowserApp(IWebBrowserAppVtbl): IWebBrowser(IWebBrowserVtbl) { + fn Quit() -> HRESULT, + fn ClientToWindow( + pcx: *mut INT, + pcy: *mut INT, + ) -> HRESULT, + fn PutProperty( + Property: BSTR, + vtValue: VARIANT, + ) -> HRESULT, + fn GetProperty( + Property: BSTR, + pvtValue: *mut VARIANT, + ) -> HRESULT, + fn get_Name( + Name: *mut BSTR, + ) -> HRESULT, + fn get_HWND( + pHWND: *mut SHANDLE_PTR, + ) -> HRESULT, + fn get_FullName( + FullName: *mut BSTR, + ) -> HRESULT, + fn get_Path( + Path: *mut BSTR, + ) -> HRESULT, + fn get_Visible( + pBool: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_Visible( + Value: VARIANT_BOOL, + ) -> HRESULT, + fn get_StatusBar( + pBool: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_StatusBar( + Value: VARIANT_BOOL, + ) -> HRESULT, + fn get_StatusText( + StatusText: *mut BSTR, + ) -> HRESULT, + fn put_StatusText( + StatusText: BSTR, + ) -> HRESULT, + fn get_ToolBar( + Value: *mut INT, + ) -> HRESULT, + fn put_ToolBar( + Value: INT, + ) -> HRESULT, + fn get_MenuBar( + Value: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_MenuBar( + Value: VARIANT_BOOL, + ) -> HRESULT, + fn get_FullScreen( + pbFullScreen: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_FullScreen( + bFullScreen: VARIANT_BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd30c1661, 0xcdaf, 0x11d0, 0x8a, 0x3e, 0x00, 0xc0, 0x4f, 0xc9, 0xe2, 0x6e)] +interface IWebBrowser2(IWebBrowser2Vtbl): IWebBrowserApp(IWebBrowserAppVtbl) { + fn Navigate2( + URL: *const VARIANT, + Flags: *const VARIANT, + TargetFrameName: *const VARIANT, + PostData: *const VARIANT, + Headers: *const VARIANT, + ) -> HRESULT, + fn QueryStatusWB( + cmdID: OLECMDID, + pcmdf: *mut OLECMDF, + ) -> HRESULT, + fn ExecWB( + cmdID: OLECMDID, + cmdexecopt: OLECMDEXECOPT, + pvaIn: *const VARIANT, + pvaOut: *mut VARIANT, + ) -> HRESULT, + fn ShowBrowserBar( + pvaClsid: *const VARIANT, + pvarShow: *const VARIANT, + pvarSize: *const VARIANT, + ) -> HRESULT, + fn get_ReadyState( + plReadyState: *mut READYSTATE, + ) -> HRESULT, + fn get_Offline( + pbOffline: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_Offline( + bOffline: VARIANT_BOOL, + ) -> HRESULT, + fn get_Silent( + pbSilent: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_Silent( + bSilent: VARIANT_BOOL, + ) -> HRESULT, + fn get_RegisterAsBrowser( + pbRegister: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_RegisterAsBrowser( + bRegister: VARIANT_BOOL, + ) -> HRESULT, + fn get_RegisterAsDropTarget( + pbRegister: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_RegisterAsDropTarget( + bRegister: VARIANT_BOOL, + ) -> HRESULT, + fn get_TheaterMode( + pbRegister: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_TheaterMode( + bRegister: VARIANT_BOOL, + ) -> HRESULT, + fn get_AddressBar( + Value: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_AddressBar( + Value: VARIANT_BOOL, + ) -> HRESULT, + fn get_Resizable( + Value: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_Resizable( + Value: VARIANT_BOOL, + ) -> HRESULT, +}} +DEFINE_GUID!{CLSID_InternetExplorer, + 0x0002df01, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} diff --git a/bash-5.1/vendor/winapi/src/um/fibersapi.rs b/bash-5.1/vendor/winapi/src/um/fibersapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..c2e3b08ff318ffe226d267d3cd038251e9e940d2 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/fibersapi.rs @@ -0,0 +1,23 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, DWORD}; +use um::winnt::{PFLS_CALLBACK_FUNCTION, PVOID}; +extern "system" { + pub fn FlsAlloc( + lpCallback: PFLS_CALLBACK_FUNCTION, + ) -> DWORD; + pub fn FlsGetValue( + dwFlsIndex: DWORD, + ) -> PVOID; + pub fn FlsSetValue( + dwFlsIndex: DWORD, + lpFlsData: PVOID, + ) -> BOOL; + pub fn FlsFree( + dwFlsIndex: DWORD, + ) -> BOOL; + pub fn IsThreadAFiber() -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/fileapi.rs b/bash-5.1/vendor/winapi/src/um/fileapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..ed183a5fb1d793dec8f9067e83264be19e1a6d65 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/fileapi.rs @@ -0,0 +1,639 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-core-file-l1 +use shared::minwindef::{ + BOOL, DWORD, FILETIME, LPCVOID, LPDWORD, LPFILETIME, LPVOID, PDWORD, PUCHAR, UCHAR, UINT, + ULONG, WORD, +}; +use um::minwinbase::{ + FILE_INFO_BY_HANDLE_CLASS, FINDEX_INFO_LEVELS, FINDEX_SEARCH_OPS, GET_FILEEX_INFO_LEVELS, + LPOVERLAPPED, LPOVERLAPPED_COMPLETION_ROUTINE, LPSECURITY_ATTRIBUTES, LPWIN32_FIND_DATAA, + LPWIN32_FIND_DATAW +}; +use um::winnt::{ + BOOLEAN, CCHAR, FILE_ID_128, FILE_SEGMENT_ELEMENT, HANDLE, LARGE_INTEGER, LONG, LONGLONG, + LPCSTR, LPCWSTR, LPSTR, LPWCH, LPWSTR, PLARGE_INTEGER, PLONG, PULARGE_INTEGER, PWSTR, + ULONGLONG, WCHAR, +}; +pub const CREATE_NEW: DWORD = 1; +pub const CREATE_ALWAYS: DWORD = 2; +pub const OPEN_EXISTING: DWORD = 3; +pub const OPEN_ALWAYS: DWORD = 4; +pub const TRUNCATE_EXISTING: DWORD = 5; +pub const INVALID_FILE_SIZE: DWORD = 0xFFFFFFFF; +pub const INVALID_SET_FILE_POINTER: DWORD = 0xFFFFFFFF; +pub const INVALID_FILE_ATTRIBUTES: DWORD = 0xFFFFFFFF; +STRUCT!{struct WIN32_FILE_ATTRIBUTE_DATA { + dwFileAttributes: DWORD, + ftCreationTime: FILETIME, + ftLastAccessTime: FILETIME, + ftLastWriteTime: FILETIME, + nFileSizeHigh: DWORD, + nFileSizeLow: DWORD, +}} +pub type LPWIN32_FILE_ATTRIBUTE_DATA = *mut WIN32_FILE_ATTRIBUTE_DATA; +STRUCT!{struct BY_HANDLE_FILE_INFORMATION { + dwFileAttributes: DWORD, + ftCreationTime: FILETIME, + ftLastAccessTime: FILETIME, + ftLastWriteTime: FILETIME, + dwVolumeSerialNumber: DWORD, + nFileSizeHigh: DWORD, + nFileSizeLow: DWORD, + nNumberOfLinks: DWORD, + nFileIndexHigh: DWORD, + nFileIndexLow: DWORD, +}} +pub type PBY_HANDLE_FILE_INFORMATION = *mut BY_HANDLE_FILE_INFORMATION; +pub type LPBY_HANDLE_FILE_INFORMATION = *mut BY_HANDLE_FILE_INFORMATION; +STRUCT!{struct CREATEFILE2_EXTENDED_PARAMETERS { + dwSize: DWORD, + dwFileAttributes: DWORD, + dwFileFlags: DWORD, + dwSecurityQosFlags: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + hTemplateFile: HANDLE, +}} +pub type PCREATEFILE2_EXTENDED_PARAMETERS = *mut CREATEFILE2_EXTENDED_PARAMETERS; +pub type LPCREATEFILE2_EXTENDED_PARAMETERS = *mut CREATEFILE2_EXTENDED_PARAMETERS; +ENUM!{enum PRIORITY_HINT { + IoPriorityHintVeryLow = 0, + IoPriorityHintLow = 1, + IoPriorityHintNormal = 2, + MaximumIoPriorityHintType = 3, +}} +STRUCT!{struct FILE_BASIC_INFO { + CreationTime: LARGE_INTEGER, + LastAccessTime: LARGE_INTEGER, + LastWriteTime: LARGE_INTEGER, + ChangeTime: LARGE_INTEGER, + FileAttributes: DWORD, +}} +STRUCT!{struct FILE_STANDARD_INFO { + AllocationSize: LARGE_INTEGER, + EndOfFile: LARGE_INTEGER, + NumberOfLinks: DWORD, + DeletePending: BOOLEAN, + Directory: BOOLEAN, +}} +STRUCT!{struct FILE_NAME_INFO { + FileNameLength: DWORD, + FileName: [WCHAR; 1], +}} +STRUCT!{struct FILE_RENAME_INFO { + ReplaceIfExists: BOOL, + RootDirectory: HANDLE, + FileNameLength: DWORD, + FileName: [WCHAR; 1], +}} +STRUCT!{struct FILE_DISPOSITION_INFO { + DeleteFile: BOOLEAN, +}} +STRUCT!{struct FILE_ALLOCATION_INFO { + AllocationSize: LARGE_INTEGER, +}} +STRUCT!{struct FILE_END_OF_FILE_INFO { + EndOfFile: LARGE_INTEGER, +}} +STRUCT!{struct FILE_STREAM_INFO { + NextEntryOffset: DWORD, + StreamNameLength: DWORD, + StreamSize: LARGE_INTEGER, + StreamAllocationSize: LARGE_INTEGER, + StreamName: [WCHAR; 1], +}} +STRUCT!{struct FILE_COMPRESSION_INFO { + CompressedFileSize: LARGE_INTEGER, + CompressionFormat: WORD, + CompressionUnitShift: UCHAR, + ChunkShift: UCHAR, + ClusterShift: UCHAR, + Reserved: [UCHAR; 3], +}} +STRUCT!{struct FILE_ATTRIBUTE_TAG_INFO { + NextEntryOffset: DWORD, + ReparseTag: DWORD, +}} +STRUCT!{struct FILE_ID_BOTH_DIR_INFO { + NextEntryOffset: DWORD, + FileIndex: DWORD, + CreationTime: LARGE_INTEGER, + LastAccessTime: LARGE_INTEGER, + LastWriteTime: LARGE_INTEGER, + ChangeTime: LARGE_INTEGER, + EndOfFile: LARGE_INTEGER, + AllocationSize: LARGE_INTEGER, + FileAttributes: DWORD, + FileNameLength: DWORD, + EaSize: DWORD, + ShortNameLength: CCHAR, + ShortName: [WCHAR; 12], + FileId: LARGE_INTEGER, + FileName: [WCHAR; 1], +}} +STRUCT!{struct FILE_IO_PRIORITY_HINT_INFO { + PriorityHint: PRIORITY_HINT, +}} +STRUCT!{struct FILE_FULL_DIR_INFO { + NextEntryOffset: ULONG, + FileIndex: ULONG, + CreationTime: LARGE_INTEGER, + LastAccessTime: LARGE_INTEGER, + LastWriteTime: LARGE_INTEGER, + ChangeTime: LARGE_INTEGER, + EndOfFile: LARGE_INTEGER, + AllocationSize: LARGE_INTEGER, + FileAttributes: ULONG, + FileNameLength: ULONG, + EaSize: ULONG, + FileName: [WCHAR; 1], +}} +STRUCT!{struct FILE_STORAGE_INFO { + LogicalBytesPerSector: ULONG, + PhysicalBytesPerSectorForAtomicity: ULONG, + PhysicalBytesPerSectorForPerformance: ULONG, + FileSystemEffectivePhysicalBytesPerSectorForAtomicity: ULONG, + Flags: ULONG, + ByteOffsetForSectorAlignment: ULONG, + ByteOffsetForPartitionAlignment: ULONG, +}} +STRUCT!{struct FILE_ALIGNMENT_INFO { + AlignmentRequirement: ULONG, +}} +STRUCT!{struct FILE_ID_INFO { + VolumeSerialNumber: ULONGLONG, + FileId: FILE_ID_128, +}} +extern "system" { + pub fn CompareFileTime( + lpFileTime1: *const FILETIME, + lpFileTime2: *const FILETIME, + ) -> LONG; + pub fn CreateDirectoryA( + lpPathName: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> BOOL; + pub fn CreateDirectoryW( + lpPathName: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> BOOL; + pub fn CreateFileA( + lpFileName: LPCSTR, + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + dwCreationDisposition: DWORD, + dwFlagsAndAttributes: DWORD, + hTemplateFile: HANDLE, + ) -> HANDLE; + pub fn CreateFileW( + lpFileName: LPCWSTR, + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + dwCreationDisposition: DWORD, + dwFlagsAndAttributes: DWORD, + hTemplateFile: HANDLE, + ) -> HANDLE; + pub fn DefineDosDeviceW( + dwFlags: DWORD, + lpDeviceName: LPCWSTR, + lpTargetPath: LPCWSTR, + ) -> BOOL; + pub fn DeleteFileA( + lpFileName: LPCSTR, + ) -> BOOL; + pub fn DeleteFileW( + lpFileName: LPCWSTR, + ) -> BOOL; + pub fn DeleteVolumeMountPointW( + lpszVolumeMountPoint: LPCWSTR, + ) -> BOOL; + pub fn FileTimeToLocalFileTime( + lpFileTime: *const FILETIME, + lpLocalFileTime: LPFILETIME, + ) -> BOOL; + pub fn FindClose( + hFindFile: HANDLE, + ) -> BOOL; + pub fn FindCloseChangeNotification( + hChangeHandle: HANDLE, + ) -> BOOL; + pub fn FindFirstChangeNotificationA( + lpPathName: LPCSTR, + bWatchSubtree: BOOL, + dwNotifyFilter: DWORD, + ) -> HANDLE; + pub fn FindFirstChangeNotificationW( + lpPathName: LPCWSTR, + bWatchSubtree: BOOL, + dwNotifyFilter: DWORD, + ) -> HANDLE; + pub fn FindFirstFileA( + lpFileName: LPCSTR, + lpFindFileData: LPWIN32_FIND_DATAA, + ) -> HANDLE; + pub fn FindFirstFileW( + lpFileName: LPCWSTR, + lpFindFileData: LPWIN32_FIND_DATAW, + ) -> HANDLE; + pub fn FindFirstFileExA( + lpFileName: LPCSTR, + fInfoLevelId: FINDEX_INFO_LEVELS, + lpFindFileData: LPVOID, + fSearchOp: FINDEX_SEARCH_OPS, + lpSearchFilter: LPVOID, + dwAdditionalFlags: DWORD, + ) -> HANDLE; + pub fn FindFirstFileExW( + lpFileName: LPCWSTR, + fInfoLevelId: FINDEX_INFO_LEVELS, + lpFindFileData: LPVOID, + fSearchOp: FINDEX_SEARCH_OPS, + lpSearchFilter: LPVOID, + dwAdditionalFlags: DWORD, + ) -> HANDLE; + pub fn FindFirstVolumeW( + lpszVolumeName: LPWSTR, + cchBufferLength: DWORD, + ) -> HANDLE; + pub fn FindNextChangeNotification( + hChangeHandle: HANDLE, + ) -> BOOL; + pub fn FindNextFileA( + hFindFile: HANDLE, + lpFindFileData: LPWIN32_FIND_DATAA, + ) -> BOOL; + pub fn FindNextFileW( + hFindFile: HANDLE, + lpFindFileData: LPWIN32_FIND_DATAW, + ) -> BOOL; + pub fn FindNextVolumeW( + hFindVolume: HANDLE, + lpszVolumeName: LPWSTR, + cchBufferLength: DWORD, + ) -> BOOL; + pub fn FindVolumeClose( + hFindVolume: HANDLE, + ) -> BOOL; + pub fn FlushFileBuffers( + hFile: HANDLE, + ) -> BOOL; + pub fn GetDiskFreeSpaceA( + lpRootPathName: LPCSTR, + lpSectorsPerCluster: LPDWORD, + lpBytesPerSector: LPDWORD, + lpNumberOfFreeClusters: LPDWORD, + lpTotalNumberOfClusters: LPDWORD, + ) -> BOOL; + pub fn GetDiskFreeSpaceW( + lpRootPathName: LPCWSTR, + lpSectorsPerCluster: LPDWORD, + lpBytesPerSector: LPDWORD, + lpNumberOfFreeClusters: LPDWORD, + lpTotalNumberOfClusters: LPDWORD, + ) -> BOOL; + pub fn GetDiskFreeSpaceExA( + lpDirectoryName: LPCSTR, + lpFreeBytesAvailableToCaller: PULARGE_INTEGER, + lpTotalNumberOfBytes: PULARGE_INTEGER, + lpTotalNumberOfFreeBytes: PULARGE_INTEGER, + ) -> BOOL; + pub fn GetDiskFreeSpaceExW( + lpDirectoryName: LPCWSTR, + lpFreeBytesAvailableToCaller: PULARGE_INTEGER, + lpTotalNumberOfBytes: PULARGE_INTEGER, + lpTotalNumberOfFreeBytes: PULARGE_INTEGER, + ) -> BOOL; + pub fn GetDriveTypeA( + lpRootPathName: LPCSTR, + ) -> UINT; + pub fn GetDriveTypeW( + lpRootPathName: LPCWSTR, + ) -> UINT; + pub fn GetFileAttributesA( + lpFileName: LPCSTR, + ) -> DWORD; + pub fn GetFileAttributesW( + lpFileName: LPCWSTR, + ) -> DWORD; + pub fn GetFileAttributesExA( + lpFileName: LPCSTR, + fInfoLevelId: GET_FILEEX_INFO_LEVELS, + lpFileInformation: LPVOID, + ) -> BOOL; + pub fn GetFileAttributesExW( + lpFileName: LPCWSTR, + fInfoLevelId: GET_FILEEX_INFO_LEVELS, + lpFileInformation: LPVOID, + ) -> BOOL; + pub fn GetFileInformationByHandle( + hFile: HANDLE, + lpFileInformation: LPBY_HANDLE_FILE_INFORMATION, + ) -> BOOL; + pub fn GetFileSize( + hFile: HANDLE, + lpFileSizeHigh: LPDWORD, + ) -> DWORD; + pub fn GetFileSizeEx( + hFile: HANDLE, + lpFileSize: PLARGE_INTEGER, + ) -> BOOL; + pub fn GetFileType( + hFile: HANDLE, + ) -> DWORD; + pub fn GetFinalPathNameByHandleA( + hFile: HANDLE, + lpszFilePath: LPSTR, + cchFilePath: DWORD, + dwFlags: DWORD, + ) -> DWORD; + pub fn GetFinalPathNameByHandleW( + hFile: HANDLE, + lpszFilePath: LPWSTR, + cchFilePath: DWORD, + dwFlags: DWORD, + ) -> DWORD; + pub fn GetFileTime( + hFile: HANDLE, + lpCreationTime: LPFILETIME, + lpLastAccessTime: LPFILETIME, + lpLastWriteTime: LPFILETIME, + ) -> BOOL; + pub fn GetFullPathNameW( + lpFileName: LPCWSTR, + nBufferLength: DWORD, + lpBuffer: LPWSTR, + lpFilePart: *mut LPWSTR, + ) -> DWORD; + pub fn GetFullPathNameA( + lpFileName: LPCSTR, + nBufferLength: DWORD, + lpBuffer: LPSTR, + lpFilePart: *mut LPSTR, + ) -> DWORD; + pub fn GetLogicalDrives() -> DWORD; + pub fn GetLogicalDriveStringsW( + nBufferLength: DWORD, + lpBuffer: LPWSTR, + ) -> DWORD; + pub fn GetLongPathNameA( + lpszShortPath: LPCSTR, + lpszLongPath: LPSTR, + cchBuffer: DWORD, + ) -> DWORD; + pub fn GetLongPathNameW( + lpszShortPath: LPCWSTR, + lpszLongPath: LPWSTR, + cchBuffer: DWORD, + ) -> DWORD; + pub fn GetShortPathNameW( + lpszLongPath: LPCWSTR, + lpszShortPath: LPWSTR, + cchBuffer: DWORD, + ) -> DWORD; + pub fn GetTempFileNameW( + lpPathName: LPCWSTR, + lpPrefixString: LPCWSTR, + uUnique: UINT, + lpTempFileName: LPWSTR, + ) -> UINT; + pub fn GetVolumeInformationByHandleW( + hFile: HANDLE, + lpVolumeNameBuffer: LPWSTR, + nVolumeNameSize: DWORD, + lpVolumeSerialNumber: LPDWORD, + lpMaximumComponentLength: LPDWORD, + lpFileSystemFlags: LPDWORD, + lpFileSystemNameBuffer: LPWSTR, + nFileSystemNameSize: DWORD, + ) -> BOOL; + pub fn GetVolumeInformationW( + lpRootPathName: LPCWSTR, + lpVolumeNameBuffer: LPWSTR, + nVolumeNameSize: DWORD, + lpVolumeSerialNumber: LPDWORD, + lpMaximumComponentLength: LPDWORD, + lpFileSystemFlags: LPDWORD, + lpFileSystemNameBuffer: LPWSTR, + nFileSystemNameSize: DWORD, + ) -> BOOL; + pub fn GetVolumePathNameW( + lpszFileName: LPCWSTR, + lpszVolumePathName: LPWSTR, + cchBufferLength: DWORD, + ) -> BOOL; + pub fn LocalFileTimeToFileTime( + lpLocalFileTime: *const FILETIME, + lpFileTime: LPFILETIME, + ) -> BOOL; + pub fn LockFile( + hFile: HANDLE, + dwFileOffsetLow: DWORD, + dwFileOffsetHigh: DWORD, + nNumberOfBytesToLockLow: DWORD, + nNumberOfBytesToLockHigh: DWORD, + ) -> BOOL; + pub fn LockFileEx( + hFile: HANDLE, + dwFlags: DWORD, + dwReserved: DWORD, + nNumberOfBytesToLockLow: DWORD, + nNumberOfBytesToLockHigh: DWORD, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn QueryDosDeviceW( + lpDeviceName: LPCWSTR, + lpTargetPath: LPWSTR, + ucchMax: DWORD, + ) -> DWORD; + pub fn ReadFile( + hFile: HANDLE, + lpBuffer: LPVOID, + nNumberOfBytesToRead: DWORD, + lpNumberOfBytesRead: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn ReadFileEx( + hFile: HANDLE, + lpBuffer: LPVOID, + nNumberOfBytesToRead: DWORD, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE, + ) -> BOOL; + pub fn ReadFileScatter( + hFile: HANDLE, + aSegmentArray: *mut FILE_SEGMENT_ELEMENT, + nNumberOfBytesToRead: DWORD, + lpReserved: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn RemoveDirectoryA( + lpPathName: LPCSTR, + ) -> BOOL; + pub fn RemoveDirectoryW( + lpPathName: LPCWSTR, + ) -> BOOL; + pub fn SetEndOfFile( + hFile: HANDLE, + ) -> BOOL; + pub fn SetFileAttributesA( + lpFileName: LPCSTR, + dwFileAttributes: DWORD, + ) -> BOOL; + pub fn SetFileAttributesW( + lpFileName: LPCWSTR, + dwFileAttributes: DWORD, + ) -> BOOL; + pub fn SetFileInformationByHandle( + hFile: HANDLE, + FileInformationClass: FILE_INFO_BY_HANDLE_CLASS, + lpFileInformation: LPVOID, + dwBufferSize: DWORD, + ) -> BOOL; + pub fn SetFilePointer( + hFile: HANDLE, + lDistanceToMove: LONG, + lpDistanceToMoveHigh: PLONG, + dwMoveMethod: DWORD, + ) -> DWORD; + pub fn SetFilePointerEx( + hFile: HANDLE, + liDistanceToMove: LARGE_INTEGER, + lpNewFilePointer: PLARGE_INTEGER, + dwMoveMethod: DWORD, + ) -> BOOL; + pub fn SetFileTime( + hFile: HANDLE, + lpCreationTime: *const FILETIME, + lpLastAccessTime: *const FILETIME, + lpLastWriteTime: *const FILETIME, + ) -> BOOL; + pub fn SetFileValidData( + hFile: HANDLE, + ValidDataLength: LONGLONG, + ) -> BOOL; + pub fn UnlockFile( + hFile: HANDLE, + dwFileOffsetLow: DWORD, + dwFileOffsetHigh: DWORD, + nNumberOfBytesToUnlockLow: DWORD, + nNumberOfBytesToUnlockHigh: DWORD, + ) -> BOOL; + pub fn UnlockFileEx( + hFile: HANDLE, + dwReserved: DWORD, + nNumberOfBytesToUnlockLow: DWORD, + nNumberOfBytesToUnlockHigh: DWORD, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn WriteFile( + hFile: HANDLE, + lpBuffer: LPCVOID, + nNumberOfBytesToWrite: DWORD, + lpNumberOfBytesWritten: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn WriteFileEx( + hFile: HANDLE, + lpBuffer: LPCVOID, + nNumberOfBytesToWrite: DWORD, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE, + ) -> BOOL; + pub fn WriteFileGather( + hFile: HANDLE, + aSegmentArray: *mut FILE_SEGMENT_ELEMENT, + nNumberOfBytesToWrite: DWORD, + lpReserved: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn GetTempPathW( + nBufferLength: DWORD, + lpBuffer: LPWSTR, + ) -> DWORD; + pub fn GetVolumeNameForVolumeMountPointW( + lpszVolumeMountPoint: LPCWSTR, + lpszVolumeName: LPWSTR, + cchBufferLength: DWORD, + ) -> BOOL; + pub fn GetVolumePathNamesForVolumeNameW( + lpszVolumeName: LPCWSTR, + lpszVolumePathNames: LPWCH, + cchBufferLength: DWORD, + lpcchReturnLength: PDWORD, + ) -> BOOL; + pub fn CreateFile2( + lpFileName: LPCWSTR, + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + dwCreationDisposition: DWORD, + pCreateExParams: LPCREATEFILE2_EXTENDED_PARAMETERS, + ) -> HANDLE; + pub fn SetFileIoOverlappedRange( + FileHandle: HANDLE, + OverlappedRangeStart: PUCHAR, + Length: ULONG, + ) -> BOOL; + pub fn GetCompressedFileSizeA( + lpFileName: LPCSTR, + lpFileSizeHigh: LPDWORD, + ) -> DWORD; + pub fn GetCompressedFileSizeW( + lpFileName: LPCWSTR, + lpFileSizeHigh: LPDWORD, + ) -> DWORD; +} +ENUM!{enum STREAM_INFO_LEVELS { + FindStreamInfoStandard, + FindStreamInfoMaxInfoLevel, +}} +extern "system" { + pub fn FindFirstStreamW( + lpFileName: LPCWSTR, + InfoLevel: STREAM_INFO_LEVELS, + lpFindStreamData: LPVOID, + dwFlags: DWORD, + ) -> HANDLE; + pub fn FindNextStreamW( + hFindStream: HANDLE, + lpFindStreamData: LPVOID, + ) -> BOOL; + pub fn AreFileApisANSI() -> BOOL; + pub fn GetTempPathA( + nBufferLength: DWORD, + lpBuffer: LPSTR, + ) -> DWORD; + pub fn FindFirstFileNameW( + lpFileName: LPCWSTR, + dwFlags: DWORD, + StringLength: LPDWORD, + LinkName: PWSTR, + ) -> HANDLE; + pub fn FindNextFileNameW( + hFindStream: HANDLE, + StringLength: LPDWORD, + LinkName: PWSTR, + ) -> BOOL; + pub fn GetVolumeInformationA( + lpRootPathName: LPCSTR, + lpVolumeNameBuffer: LPSTR, + nVolumeNameSize: DWORD, + lpVolumeSerialNumber: LPDWORD, + lpMaximumComponentLength: LPDWORD, + lpFileSystemFlags: LPDWORD, + lpFileSystemNameBuffer: LPSTR, + nFileSystemNameSize: DWORD, + ) -> BOOL; + pub fn GetTempFileNameA( + lpPathName: LPCSTR, + lpPrefixString: LPCSTR, + uUnique: UINT, + lpTempFileName: LPSTR, + ) -> UINT; + pub fn SetFileApisToOEM(); + pub fn SetFileApisToANSI(); +} diff --git a/bash-5.1/vendor/winapi/src/um/functiondiscoverykeys_devpkey.rs b/bash-5.1/vendor/winapi/src/um/functiondiscoverykeys_devpkey.rs new file mode 100644 index 0000000000000000000000000000000000000000..045547512da14fd0a9fd94e86b0262e637b03bc6 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/functiondiscoverykeys_devpkey.rs @@ -0,0 +1,117 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::wtypes::PROPERTYKEY; +//52 +DEFINE_PROPERTYKEY!{PKEY_Device_DeviceDesc, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 2} +DEFINE_PROPERTYKEY!{PKEY_Device_HardwareIds, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 3} +DEFINE_PROPERTYKEY!{PKEY_Device_CompatibleIds, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 4} +DEFINE_PROPERTYKEY!{PKEY_Device_Service, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 6} +DEFINE_PROPERTYKEY!{PKEY_Device_Class, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 9} +DEFINE_PROPERTYKEY!{PKEY_Device_ClassGuid, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 10} +DEFINE_PROPERTYKEY!{PKEY_Device_Driver, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 11} +DEFINE_PROPERTYKEY!{PKEY_Device_ConfigFlags, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 12} +DEFINE_PROPERTYKEY!{PKEY_Device_Manufacturer, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 13} +DEFINE_PROPERTYKEY!{PKEY_Device_FriendlyName, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14} +DEFINE_PROPERTYKEY!{PKEY_Device_LocationInfo, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 15} +DEFINE_PROPERTYKEY!{PKEY_Device_PDOName, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 16} +DEFINE_PROPERTYKEY!{PKEY_Device_Capabilities, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 17} +DEFINE_PROPERTYKEY!{PKEY_Device_UINumber, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 18} +DEFINE_PROPERTYKEY!{PKEY_Device_UpperFilters, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 19} +DEFINE_PROPERTYKEY!{PKEY_Device_LowerFilters, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 20} +DEFINE_PROPERTYKEY!{PKEY_Device_BusTypeGuid, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 21} +DEFINE_PROPERTYKEY!{PKEY_Device_LegacyBusType, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 22} +DEFINE_PROPERTYKEY!{PKEY_Device_BusNumber, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 23} +DEFINE_PROPERTYKEY!{PKEY_Device_EnumeratorName, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 24} +DEFINE_PROPERTYKEY!{PKEY_Device_Security, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 25} +DEFINE_PROPERTYKEY!{PKEY_Device_SecuritySDS, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 26} +DEFINE_PROPERTYKEY!{PKEY_Device_DevType, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 27} +DEFINE_PROPERTYKEY!{PKEY_Device_Exclusive, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 28} +DEFINE_PROPERTYKEY!{PKEY_Device_Characteristics, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 29} +DEFINE_PROPERTYKEY!{PKEY_Device_Address, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 30} +DEFINE_PROPERTYKEY!{PKEY_Device_UINumberDescFormat, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 31} +DEFINE_PROPERTYKEY!{PKEY_Device_PowerData, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 32} +DEFINE_PROPERTYKEY!{PKEY_Device_RemovalPolicy, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 33} +DEFINE_PROPERTYKEY!{PKEY_Device_RemovalPolicyDefault, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 34} +DEFINE_PROPERTYKEY!{PKEY_Device_RemovalPolicyOverride, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 35} +DEFINE_PROPERTYKEY!{PKEY_Device_InstallState, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 36} +DEFINE_PROPERTYKEY!{PKEY_Device_LocationPaths, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 37} +DEFINE_PROPERTYKEY!{PKEY_Device_BaseContainerId, + 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 38} +//137 +DEFINE_PROPERTYKEY!{PKEY_Device_DriverDate, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 2} +DEFINE_PROPERTYKEY!{PKEY_Device_DriverVersion, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3} +DEFINE_PROPERTYKEY!{PKEY_Device_DriverDesc, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 4} +DEFINE_PROPERTYKEY!{PKEY_Device_DriverInfPath, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 5} +DEFINE_PROPERTYKEY!{PKEY_Device_DriverInfSection, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 6} +DEFINE_PROPERTYKEY!{PKEY_Device_DriverInfSectionExt, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 7} +DEFINE_PROPERTYKEY!{PKEY_Device_MatchingDeviceId, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 8} +DEFINE_PROPERTYKEY!{PKEY_Device_DriverProvider, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 9} +DEFINE_PROPERTYKEY!{PKEY_Device_DriverPropPageProvider, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 10} +DEFINE_PROPERTYKEY!{PKEY_Device_DriverCoInstallers, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 11} +DEFINE_PROPERTYKEY!{PKEY_Device_ResourcePickerTags, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 12} +DEFINE_PROPERTYKEY!{PKEY_Device_ResourcePickerExceptions, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 13} +DEFINE_PROPERTYKEY!{PKEY_Device_DriverRank, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 14} +DEFINE_PROPERTYKEY!{PKEY_Device_DriverLogoLevel, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 15} +DEFINE_PROPERTYKEY!{PKEY_Device_NoConnectSound, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 17} +DEFINE_PROPERTYKEY!{PKEY_Device_GenericDriverInstalled, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 18} +DEFINE_PROPERTYKEY!{PKEY_Device_AdditionalSoftwareRequested, + 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 19} +//209 +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_FriendlyName, + 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 2} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Enabled, + 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 3} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_ClassGuid, + 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 4} diff --git a/bash-5.1/vendor/winapi/src/um/gl/gl.rs b/bash-5.1/vendor/winapi/src/um/gl/gl.rs new file mode 100644 index 0000000000000000000000000000000000000000..d7c1b586e7d4b37c7f558fec32a7106acb302fd6 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/gl/gl.rs @@ -0,0 +1,52 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_double, c_float, c_int, c_schar, c_short, c_uchar, c_uint, c_ushort, c_void}; +//48 +pub type GLenum = c_uint; +pub type GLboolean = c_uchar; +pub type GLbitfield = c_uint; +pub type GLbyte = c_schar; +pub type GLshort = c_short; +pub type GLint = c_int; +pub type GLsizei = c_int; +pub type GLubyte = c_uchar; +pub type GLushort = c_ushort; +pub type GLuint = c_uint; +pub type GLfloat = c_float; +pub type GLclampf = c_float; +pub type GLdouble = c_double; +pub type GLclampd = c_double; +pub type GLvoid = c_void; +//63 +//68 +//AccumOp +pub const GL_ACCUM: GLenum = 0x0100; +pub const GL_LOAD: GLenum = 0x0101; +pub const GL_RETURN: GLenum = 0x0102; +pub const GL_MULT: GLenum = 0x0103; +pub const GL_ADD: GLenum = 0x0104; +//AlphaFunction +pub const GL_NEVER: GLenum = 0x0200; +pub const GL_LESS: GLenum = 0x0201; +pub const GL_EQUAL: GLenum = 0x0202; +pub const GL_LEQUAL: GLenum = 0x0203; +pub const GL_GREATER: GLenum = 0x0204; +pub const GL_NOTEQUAL: GLenum = 0x0205; +pub const GL_GEQUAL: GLenum = 0x0206; +pub const GL_ALWAYS: GLenum = 0x0207; +// TODO: we're missing about 1500 lines of defines and methods +// until that time, you can use the excellent GL crate +// https://github.com/brendanzab/gl-rs +extern "system" { + pub fn glAccum( + op: GLenum, + value: GLfloat, + ); + pub fn glAlphaFunc( + func: GLenum, + reference: GLclampf, + ); +} diff --git a/bash-5.1/vendor/winapi/src/um/gl/mod.rs b/bash-5.1/vendor/winapi/src/um/gl/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..6ce6d067ff6d131ec9660c41487c513730d8cc35 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/gl/mod.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Headers for user mode only +#[cfg(feature = "gl-gl")] pub mod gl; diff --git a/bash-5.1/vendor/winapi/src/um/handleapi.rs b/bash-5.1/vendor/winapi/src/um/handleapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..1d7e43d779569aac111bb9bec3a38457e86f820a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/handleapi.rs @@ -0,0 +1,36 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! handleapi include file +use shared::minwindef::{BOOL, DWORD, LPDWORD, LPHANDLE}; +use um::winnt::HANDLE; +pub const INVALID_HANDLE_VALUE: HANDLE = -1isize as HANDLE; +extern "system" { + pub fn CloseHandle( + hObject: HANDLE, + ) -> BOOL; + pub fn DuplicateHandle( + hSourceProcessHandle: HANDLE, + hSourceHandle: HANDLE, + hTargetProcessHandle: HANDLE, + lpTargetHandle: LPHANDLE, + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + dwOptions: DWORD, + ) -> BOOL; + pub fn CompareObjectHandles( + hFirstObjectHandle: HANDLE, + hSecondObjectHandle: HANDLE, + ) -> BOOL; + pub fn GetHandleInformation( + hObject: HANDLE, + lpdwFlags: LPDWORD, + ) -> BOOL; + pub fn SetHandleInformation( + hObject: HANDLE, + dwMask: DWORD, + dwFlags: DWORD, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/heapapi.rs b/bash-5.1/vendor/winapi/src/um/heapapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..83073b31e2c2a038108c764a8b57eb5f3d16b601 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/heapapi.rs @@ -0,0 +1,92 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-core-heap-l1 +use shared::basetsd::{PSIZE_T, SIZE_T}; +use shared::minwindef::{BOOL, DWORD, LPCVOID, LPVOID}; +use um::minwinbase::LPPROCESS_HEAP_ENTRY; +use um::winnt::{HANDLE, HEAP_INFORMATION_CLASS, PHANDLE, PVOID}; +STRUCT!{struct HEAP_SUMMARY { + cb: DWORD, + cbAllocated: SIZE_T, + cbCommitted: SIZE_T, + cbReserved: SIZE_T, + cbMaxReserve: SIZE_T, +}} +pub type PHEAP_SUMMARY = *mut HEAP_SUMMARY; +pub type LPHEAP_SUMMARY = PHEAP_SUMMARY; +extern "system" { + pub fn HeapCreate( + flOptions: DWORD, + dwInitialSize: SIZE_T, + dwMaximumSize: SIZE_T, + ) -> HANDLE; + pub fn HeapDestroy( + hHeap: HANDLE, + ) -> BOOL; + pub fn HeapAlloc( + hHeap: HANDLE, + dwFlags: DWORD, + dwBytes: SIZE_T, + ) -> LPVOID; + pub fn HeapReAlloc( + hHeap: HANDLE, + dwFlags: DWORD, + lpMem: LPVOID, + dwBytes: SIZE_T, + ) -> LPVOID; + pub fn HeapFree( + hHeap: HANDLE, + dwFlags: DWORD, + lpMem: LPVOID, + ) -> BOOL; + pub fn HeapSize( + hHeap: HANDLE, + dwFlags: DWORD, + lpMem: LPCVOID, + ) -> SIZE_T; + pub fn GetProcessHeap() -> HANDLE; + pub fn HeapCompact( + hHeap: HANDLE, + dwFlags: DWORD, + ) -> SIZE_T; + pub fn HeapSetInformation( + HeapHandle: HANDLE, + HeapInformationClass: HEAP_INFORMATION_CLASS, + HeapInformation: PVOID, + HeapInformationLength: SIZE_T, + ) -> BOOL; + pub fn HeapValidate( + hHeap: HANDLE, + dwFlags: DWORD, + lpMem: LPCVOID, + ) -> BOOL; + pub fn HeapSummary( + hHeap: HANDLE, + dwFlags: DWORD, + lpSummary: LPHEAP_SUMMARY, + ) -> BOOL; + pub fn GetProcessHeaps( + NumberOfHeaps: DWORD, + ProcessHeaps: PHANDLE, + ) -> DWORD; + pub fn HeapLock( + hHeap: HANDLE, + ) -> BOOL; + pub fn HeapUnlock( + hHeap: HANDLE, + ) -> BOOL; + pub fn HeapWalk( + hHeap: HANDLE, + lpEntry: LPPROCESS_HEAP_ENTRY, + ) -> BOOL; + pub fn HeapQueryInformation( + HeapHandle: HANDLE, + HeapInformationClass: HEAP_INFORMATION_CLASS, + HeapInformation: PVOID, + HeapInformationLength: SIZE_T, + ReturnLength: PSIZE_T, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/highlevelmonitorconfigurationapi.rs b/bash-5.1/vendor/winapi/src/um/highlevelmonitorconfigurationapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..f187aeb26cd8b021e4e7eada3999083a156a2592 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/highlevelmonitorconfigurationapi.rs @@ -0,0 +1,171 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{DWORD, LPDWORD}; +use um::physicalmonitorenumerationapi::_BOOL; +use um::winnt::HANDLE; +pub const MC_CAPS_NONE: DWORD = 0x00000000; +pub const MC_CAPS_MONITOR_TECHNOLOGY_TYPE: DWORD = 0x00000001; +pub const MC_CAPS_BRIGHTNESS: DWORD = 0x00000002; +pub const MC_CAPS_CONTRAST: DWORD = 0x00000004; +pub const MC_CAPS_COLOR_TEMPERATURE: DWORD = 0x00000008; +pub const MC_CAPS_RED_GREEN_BLUE_GAIN: DWORD = 0x00000010; +pub const MC_CAPS_RED_GREEN_BLUE_DRIVE: DWORD = 0x00000020; +pub const MC_CAPS_DEGAUSS: DWORD = 0x00000040; +pub const MC_CAPS_DISPLAY_AREA_POSITION: DWORD = 0x00000080; +pub const MC_CAPS_DISPLAY_AREA_SIZE: DWORD = 0x00000100; +pub const MC_CAPS_RESTORE_FACTORY_DEFAULTS: DWORD = 0x00000400; +pub const MC_CAPS_RESTORE_FACTORY_COLOR_DEFAULTS: DWORD = 0x00000800; +pub const MC_RESTORE_FACTORY_DEFAULTS_ENABLES_MONITOR_SETTINGS: DWORD = 0x00001000; +pub const MC_SUPPORTED_COLOR_TEMPERATURE_NONE: DWORD = 0x00000000; +pub const MC_SUPPORTED_COLOR_TEMPERATURE_4000K: DWORD = 0x00000001; +pub const MC_SUPPORTED_COLOR_TEMPERATURE_5000K: DWORD = 0x00000002; +pub const MC_SUPPORTED_COLOR_TEMPERATURE_6500K: DWORD = 0x00000004; +pub const MC_SUPPORTED_COLOR_TEMPERATURE_7500K: DWORD = 0x00000008; +pub const MC_SUPPORTED_COLOR_TEMPERATURE_8200K: DWORD = 0x00000010; +pub const MC_SUPPORTED_COLOR_TEMPERATURE_9300K: DWORD = 0x00000020; +pub const MC_SUPPORTED_COLOR_TEMPERATURE_10000K: DWORD = 0x00000040; +pub const MC_SUPPORTED_COLOR_TEMPERATURE_11500K: DWORD = 0x00000080; +ENUM!{enum MC_DISPLAY_TECHNOLOGY_TYPE { + MC_SHADOW_MASK_CATHODE_RAY_TUBE, + MC_APERTURE_GRILL_CATHODE_RAY_TUBE, + MC_THIN_FILM_TRANSISTOR, + MC_LIQUID_CRYSTAL_ON_SILICON, + MC_PLASMA, + MC_ORGANIC_LIGHT_EMITTING_DIODE, + MC_ELECTROLUMINESCENT, + MC_MICROELECTROMECHANICAL, + MC_FIELD_EMISSION_DEVICE, +}} +pub type LPMC_DISPLAY_TECHNOLOGY_TYPE = *mut MC_DISPLAY_TECHNOLOGY_TYPE; +ENUM!{enum MC_DRIVE_TYPE { + MC_RED_DRIVE, + MC_GREEN_DRIVE, + MC_BLUE_DRIVE, +}} +ENUM!{enum MC_GAIN_TYPE { + MC_RED_GAIN, + MC_GREEN_GAIN, + MC_BLUE_GAIN, +}} +ENUM!{enum MC_POSITION_TYPE { + MC_HORIZONTAL_POSITION, + MC_VERTICAL_POSITION, +}} +ENUM!{enum MC_SIZE_TYPE { + MC_WIDTH, + MC_HEIGHT, +}} +ENUM!{enum MC_COLOR_TEMPERATURE { + MC_COLOR_TEMPERATURE_UNKNOWN, + MC_COLOR_TEMPERATURE_4000K, + MC_COLOR_TEMPERATURE_5000K, + MC_COLOR_TEMPERATURE_6500K, + MC_COLOR_TEMPERATURE_7500K, + MC_COLOR_TEMPERATURE_8200K, + MC_COLOR_TEMPERATURE_9300K, + MC_COLOR_TEMPERATURE_10000K, + MC_COLOR_TEMPERATURE_11500K, +}} +pub type LPMC_COLOR_TEMPERATURE = *mut MC_COLOR_TEMPERATURE; +extern "system" { + pub fn GetMonitorCapabilities( + hMonitor: HANDLE, + pdwMonitorCapabilities: LPDWORD, + pdwSupportedColorTemperature: LPDWORD, + ) -> _BOOL; + pub fn SaveCurrentMonitorSettings( + hMonitor: HANDLE, + ) -> _BOOL; + pub fn GetMonitorTechnologyType( + hMonitor: HANDLE, + pdtyDisplayTechnologyType: LPMC_DISPLAY_TECHNOLOGY_TYPE, + ) -> _BOOL; + pub fn GetMonitorBrightness( + hMonitor: HANDLE, + pdwMinimumBrightness: LPDWORD, + pdwCurrentBrightness: LPDWORD, + pdwMaximumBrightness: LPDWORD, + ) -> _BOOL; + pub fn GetMonitorContrast( + hMonitor: HANDLE, + pdwMinimumContrast: LPDWORD, + pdwCurrentContrast: LPDWORD, + pdwMaximumContrast: LPDWORD, + ) -> _BOOL; + pub fn GetMonitorColorTemperature( + hMonitor: HANDLE, + pctCurrentColorTemperature: LPMC_COLOR_TEMPERATURE, + ) -> _BOOL; + pub fn GetMonitorRedGreenOrBlueDrive( + hMonitor: HANDLE, + dtDriveType: MC_DRIVE_TYPE, + pdwMinimumDrive: LPDWORD, + pdwCurrentDrive: LPDWORD, + pdwMaximumDrive: LPDWORD, + ) -> _BOOL; + pub fn GetMonitorRedGreenOrBlueGain( + hMonitor: HANDLE, + gtGainType: MC_GAIN_TYPE, + pdwMinimumGain: LPDWORD, + pdwCurrentGain: LPDWORD, + pdwMaximumGain: LPDWORD, + ) -> _BOOL; + pub fn SetMonitorBrightness( + hMonitor: HANDLE, + dwNewBrightness: DWORD, + ) -> _BOOL; + pub fn SetMonitorContrast( + hMonitor: HANDLE, + dwNewContrast: DWORD, + ) -> _BOOL; + pub fn SetMonitorColorTemperature( + hMonitor: HANDLE, + ctCurrentColorTemperature: MC_COLOR_TEMPERATURE, + ) -> _BOOL; + pub fn SetMonitorRedGreenOrBlueDrive( + hMonitor: HANDLE, + dtDriveType: MC_DRIVE_TYPE, + dwNewDrive: DWORD, + ) -> _BOOL; + pub fn SetMonitorRedGreenOrBlueGain( + hMonitor: HANDLE, + gtGainType: MC_GAIN_TYPE, + dwNewGain: DWORD, + ) -> _BOOL; + pub fn DegaussMonitor( + hMonitor: HANDLE, + ) -> _BOOL; + pub fn GetMonitorDisplayAreaSize( + hMonitor: HANDLE, + stSizeType: MC_SIZE_TYPE, + pdwMinimumWidthOrHeight: LPDWORD, + pdwCurrentWidthOrHeight: LPDWORD, + pdwMaximumWidthOrHeight: LPDWORD, + ) -> _BOOL; + pub fn GetMonitorDisplayAreaPosition( + hMonitor: HANDLE, + ptPositionType: MC_POSITION_TYPE, + pdwMinimumPosition: LPDWORD, + pdwCurrentPosition: LPDWORD, + pdwMaximumPosition: LPDWORD, + ) -> _BOOL; + pub fn SetMonitorDisplayAreaSize( + hMonitor: HANDLE, + stSizeType: MC_SIZE_TYPE, + dwNewDisplayAreaWidthOrHeight: DWORD, + ) -> _BOOL; + pub fn SetMonitorDisplayAreaPosition( + hMonitor: HANDLE, + ptPositionType: MC_POSITION_TYPE, + dwNewPosition: DWORD, + ) -> _BOOL; + pub fn RestoreMonitorFactoryColorDefaults( + hMonitor: HANDLE, + ) -> _BOOL; + pub fn RestoreMonitorFactoryDefaults( + hMonitor: HANDLE, + ) -> _BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/http.rs b/bash-5.1/vendor/winapi/src/um/http.rs new file mode 100644 index 0000000000000000000000000000000000000000..71d4109d008095ef828528eddc3ecc3ba885b106 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/http.rs @@ -0,0 +1,1096 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! HTTP API specification +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, PUCHAR, PULONG, UCHAR, ULONG, USHORT}; +use shared::sspi::SECURITY_STATUS; +use shared::ws2def::{PSOCKADDR, SOCKADDR_STORAGE}; +use um::minwinbase::{LPOVERLAPPED, PSECURITY_ATTRIBUTES}; +use um::winnt::{ + ANYSIZE_ARRAY, BOOLEAN, HANDLE, PCHAR, PCSTR, PCWSTR, PHANDLE, PSECURITY_DESCRIPTOR, PVOID, + PWCHAR, PWSTR, ULARGE_INTEGER, ULONGLONG, +}; +pub const HTTP_INITIALIZE_SERVER: ULONG = 0x00000001; +pub const HTTP_INITIALIZE_CONFIG: ULONG = 0x00000002; +pub const HTTP_DEMAND_CBT: ULONG = 0x00000004; +ENUM!{enum HTTP_SERVER_PROPERTY { + HttpServerAuthenticationProperty, + HttpServerLoggingProperty, + HttpServerQosProperty, + HttpServerTimeoutsProperty, + HttpServerQueueLengthProperty, + HttpServerStateProperty, + HttpServer503VerbosityProperty, + HttpServerBindingProperty, + HttpServerExtendedAuthenticationProperty, + HttpServerListenEndpointProperty, + HttpServerChannelBindProperty, + HttpServerProtectionLevelProperty, +}} +pub type PHTTP_SERVER_PROPERTY = *mut HTTP_SERVER_PROPERTY; +STRUCT!{struct HTTP_PROPERTY_FLAGS { + BitFields: ULONG, +}} +BITFIELD!{HTTP_PROPERTY_FLAGS BitFields: ULONG [ + Present set_Present[0..1], +]} +pub type PHTTP_PROPERTY_FLAGS = *mut HTTP_PROPERTY_FLAGS; +ENUM!{enum HTTP_ENABLED_STATE { + HttpEnabledStateActive, + HttpEnabledStateInactive, +}} +pub type PHTTP_ENABLED_STATE = *mut HTTP_ENABLED_STATE; +STRUCT!{struct HTTP_STATE_INFO { + Flags: HTTP_PROPERTY_FLAGS, + State: HTTP_ENABLED_STATE, +}} +pub type PHTTP_STATE_INFO = *mut HTTP_STATE_INFO; +ENUM!{enum HTTP_503_RESPONSE_VERBOSITY { + Http503ResponseVerbosityBasic, + Http503ResponseVerbosityLimited, + Http503ResponseVerbosityFull, +}} +pub type PHTTP_503_RESPONSE_VERBOSITY = *mut HTTP_503_RESPONSE_VERBOSITY; +ENUM!{enum HTTP_QOS_SETTING_TYPE { + HttpQosSettingTypeBandwidth, + HttpQosSettingTypeConnectionLimit, + HttpQosSettingTypeFlowRate, +}} +pub type PHTTP_QOS_SETTING_TYPE = *mut HTTP_QOS_SETTING_TYPE; +STRUCT!{struct HTTP_QOS_SETTING_INFO { + QosType: HTTP_QOS_SETTING_TYPE, + QosSetting: PVOID, +}} +pub type PHTTP_QOS_SETTING_INFO = *mut HTTP_QOS_SETTING_INFO; +STRUCT!{struct HTTP_CONNECTION_LIMIT_INFO { + Flags: HTTP_PROPERTY_FLAGS, + MaxConnections: ULONG, +}} +pub type PHTTP_CONNECTION_LIMIT_INFO = *mut HTTP_CONNECTION_LIMIT_INFO; +STRUCT!{struct HTTP_BANDWIDTH_LIMIT_INFO { + Flags: HTTP_PROPERTY_FLAGS, + MaxBandwidth: ULONG, +}} +pub type PHTTP_BANDWIDTH_LIMIT_INFO = *mut HTTP_BANDWIDTH_LIMIT_INFO; +STRUCT!{struct HTTP_FLOWRATE_INFO { + Flags: HTTP_PROPERTY_FLAGS, + MaxBandwidth: ULONG, + MaxPeakBandwidth: ULONG, + BurstSize: ULONG, +}} +pub type PHTTP_FLOWRATE_INFO = *mut HTTP_FLOWRATE_INFO; +pub const HTTP_MIN_ALLOWED_BANDWIDTH_THROTTLING_RATE: ULONG = 1024; +pub const HTTP_LIMIT_INFINITE: ULONG = !0; +ENUM!{enum HTTP_SERVICE_CONFIG_TIMEOUT_KEY { + IdleConnectionTimeout = 0, + HeaderWaitTimeout, +}} +pub type PHTTP_SERVICE_CONFIG_TIMEOUT_KEY = *mut HTTP_SERVICE_CONFIG_TIMEOUT_KEY; +pub type HTTP_SERVICE_CONFIG_TIMEOUT_PARAM = USHORT; +pub type PHTTP_SERVICE_CONFIG_TIMEOUT_PARAM = *mut USHORT; +STRUCT!{struct HTTP_SERVICE_CONFIG_TIMEOUT_SET { + KeyDesc: HTTP_SERVICE_CONFIG_TIMEOUT_KEY, + ParamDesc: HTTP_SERVICE_CONFIG_TIMEOUT_PARAM, +}} +pub type PHTTP_SERVICE_CONFIG_TIMEOUT_SET = *mut HTTP_SERVICE_CONFIG_TIMEOUT_SET; +STRUCT!{struct HTTP_TIMEOUT_LIMIT_INFO { + Flags: HTTP_PROPERTY_FLAGS, + EntityBody: USHORT, + DrainEntityBody: USHORT, + RequestQueue: USHORT, + IdleConnection: USHORT, + HeaderWait: USHORT, + MinSendRate: ULONG, +}} +pub type PHTTP_TIMEOUT_LIMIT_INFO = *mut HTTP_TIMEOUT_LIMIT_INFO; +STRUCT!{struct HTTP_LISTEN_ENDPOINT_INFO { + Flags: HTTP_PROPERTY_FLAGS, + EnableSharing: BOOLEAN, +}} +pub type PHTTP_LISTEN_ENDPOINT_INFO = *mut HTTP_LISTEN_ENDPOINT_INFO; +STRUCT!{struct HTTP_SERVER_AUTHENTICATION_DIGEST_PARAMS { + DomainNameLength: USHORT, + DomainName: PWSTR, + RealmLength: USHORT, + Realm: PWSTR, +}} +pub type PHTTP_SERVER_AUTHENTICATION_DIGEST_PARAMS = *mut HTTP_SERVER_AUTHENTICATION_DIGEST_PARAMS; +STRUCT!{struct HTTP_SERVER_AUTHENTICATION_BASIC_PARAMS { + RealmLength: USHORT, + Realm: PWSTR, +}} +pub type PHTTP_SERVER_AUTHENTICATION_BASIC_PARAMS = *mut HTTP_SERVER_AUTHENTICATION_BASIC_PARAMS; +pub const HTTP_AUTH_ENABLE_BASIC: ULONG = 0x00000001; +pub const HTTP_AUTH_ENABLE_DIGEST: ULONG = 0x00000002; +pub const HTTP_AUTH_ENABLE_NTLM: ULONG = 0x00000004; +pub const HTTP_AUTH_ENABLE_NEGOTIATE: ULONG = 0x00000008; +pub const HTTP_AUTH_ENABLE_KERBEROS: ULONG = 0x00000010; +pub const HTTP_AUTH_ENABLE_ALL: ULONG = HTTP_AUTH_ENABLE_BASIC | HTTP_AUTH_ENABLE_DIGEST | + HTTP_AUTH_ENABLE_NTLM | HTTP_AUTH_ENABLE_NEGOTIATE | HTTP_AUTH_ENABLE_KERBEROS; +pub const HTTP_AUTH_EX_FLAG_ENABLE_KERBEROS_CREDENTIAL_CACHING: UCHAR = 0x01; +pub const HTTP_AUTH_EX_FLAG_CAPTURE_CREDENTIAL: UCHAR = 0x02; +STRUCT!{struct HTTP_SERVER_AUTHENTICATION_INFO { + Flags: HTTP_PROPERTY_FLAGS, + AuthSchemes: ULONG, + ReceiveMutualAuth: BOOLEAN, + ReceiveContextHandle: BOOLEAN, + DisableNTLMCredentialCaching: BOOLEAN, + ExFlags: UCHAR, + DigestParams: HTTP_SERVER_AUTHENTICATION_DIGEST_PARAMS, + BasicParams: HTTP_SERVER_AUTHENTICATION_BASIC_PARAMS, +}} +pub type PHTTP_SERVER_AUTHENTICATION_INFO = *mut HTTP_SERVER_AUTHENTICATION_INFO; +ENUM!{enum HTTP_SERVICE_BINDING_TYPE { + HttpServiceBindingTypeNone = 0, + HttpServiceBindingTypeW, + HttpServiceBindingTypeA, +}} +STRUCT!{struct HTTP_SERVICE_BINDING_BASE { + Type: HTTP_SERVICE_BINDING_TYPE, +}} +pub type PHTTP_SERVICE_BINDING_BASE = *mut HTTP_SERVICE_BINDING_BASE; +STRUCT!{struct HTTP_SERVICE_BINDING_A { + Base: HTTP_SERVICE_BINDING_BASE, + Buffer: PCHAR, + BufferSize: ULONG, +}} +pub type PHTTP_SERVICE_BINDING_A = *mut HTTP_SERVICE_BINDING_A; +STRUCT!{struct HTTP_SERVICE_BINDING_W { + Base: HTTP_SERVICE_BINDING_BASE, + Buffer: PWCHAR, + BufferSize: ULONG, +}} +pub type PHTTP_SERVICE_BINDING_W = *mut HTTP_SERVICE_BINDING_W; +ENUM!{enum HTTP_AUTHENTICATION_HARDENING_LEVELS { + HttpAuthenticationHardeningLegacy = 0, + HttpAuthenticationHardeningMedium, + HttpAuthenticationHardeningStrict, +}} +pub const HTTP_CHANNEL_BIND_PROXY: ULONG = 0x1; +pub const HTTP_CHANNEL_BIND_PROXY_COHOSTING: ULONG = 0x20; +pub const HTTP_CHANNEL_BIND_NO_SERVICE_NAME_CHECK: ULONG = 0x2; +pub const HTTP_CHANNEL_BIND_DOTLESS_SERVICE: ULONG = 0x4; +pub const HTTP_CHANNEL_BIND_SECURE_CHANNEL_TOKEN: ULONG = 0x8; +pub const HTTP_CHANNEL_BIND_CLIENT_SERVICE: ULONG = 0x10; +STRUCT!{struct HTTP_CHANNEL_BIND_INFO { + Hardening: HTTP_AUTHENTICATION_HARDENING_LEVELS, + Flags: ULONG, + ServiceNames: *mut PHTTP_SERVICE_BINDING_BASE, + NumberOfServiceNames: ULONG, +}} +pub type PHTTP_CHANNEL_BIND_INFO = *mut HTTP_CHANNEL_BIND_INFO; +STRUCT!{struct HTTP_REQUEST_CHANNEL_BIND_STATUS { + ServiceName: PHTTP_SERVICE_BINDING_BASE, + ChannelToken: PUCHAR, + ChannelTokenSize: ULONG, + Flags: ULONG, +}} +pub type PHTTP_REQUEST_CHANNEL_BIND_STATUS = *mut HTTP_REQUEST_CHANNEL_BIND_STATUS; +pub const HTTP_LOG_FIELD_DATE: ULONG = 0x00000001; +pub const HTTP_LOG_FIELD_TIME: ULONG = 0x00000002; +pub const HTTP_LOG_FIELD_CLIENT_IP: ULONG = 0x00000004; +pub const HTTP_LOG_FIELD_USER_NAME: ULONG = 0x00000008; +pub const HTTP_LOG_FIELD_SITE_NAME: ULONG = 0x00000010; +pub const HTTP_LOG_FIELD_COMPUTER_NAME: ULONG = 0x00000020; +pub const HTTP_LOG_FIELD_SERVER_IP: ULONG = 0x00000040; +pub const HTTP_LOG_FIELD_METHOD: ULONG = 0x00000080; +pub const HTTP_LOG_FIELD_URI_STEM: ULONG = 0x00000100; +pub const HTTP_LOG_FIELD_URI_QUERY: ULONG = 0x00000200; +pub const HTTP_LOG_FIELD_STATUS: ULONG = 0x00000400; +pub const HTTP_LOG_FIELD_WIN32_STATUS: ULONG = 0x00000800; +pub const HTTP_LOG_FIELD_BYTES_SENT: ULONG = 0x00001000; +pub const HTTP_LOG_FIELD_BYTES_RECV: ULONG = 0x00002000; +pub const HTTP_LOG_FIELD_TIME_TAKEN: ULONG = 0x00004000; +pub const HTTP_LOG_FIELD_SERVER_PORT: ULONG = 0x00008000; +pub const HTTP_LOG_FIELD_USER_AGENT: ULONG = 0x00010000; +pub const HTTP_LOG_FIELD_COOKIE: ULONG = 0x00020000; +pub const HTTP_LOG_FIELD_REFERER: ULONG = 0x00040000; +pub const HTTP_LOG_FIELD_VERSION: ULONG = 0x00080000; +pub const HTTP_LOG_FIELD_HOST: ULONG = 0x00100000; +pub const HTTP_LOG_FIELD_SUB_STATUS: ULONG = 0x00200000; +pub const HTTP_LOG_FIELD_CLIENT_PORT: ULONG = 0x00400000; +pub const HTTP_LOG_FIELD_URI: ULONG = 0x00800000; +pub const HTTP_LOG_FIELD_SITE_ID: ULONG = 0x01000000; +pub const HTTP_LOG_FIELD_REASON: ULONG = 0x02000000; +pub const HTTP_LOG_FIELD_QUEUE_NAME: ULONG = 0x04000000; +ENUM!{enum HTTP_LOGGING_TYPE { + HttpLoggingTypeW3C, + HttpLoggingTypeIIS, + HttpLoggingTypeNCSA, + HttpLoggingTypeRaw, +}} +ENUM!{enum HTTP_LOGGING_ROLLOVER_TYPE { + HttpLoggingRolloverSize, + HttpLoggingRolloverDaily, + HttpLoggingRolloverWeekly, + HttpLoggingRolloverMonthly, + HttpLoggingRolloverHourly, +}} +pub const HTTP_MIN_ALLOWED_LOG_FILE_ROLLOVER_SIZE: ULONG = 1 * 1024 * 1024; +pub const HTTP_LOGGING_FLAG_LOCAL_TIME_ROLLOVER: ULONG = 0x00000001; +pub const HTTP_LOGGING_FLAG_USE_UTF8_CONVERSION: ULONG = 0x00000002; +pub const HTTP_LOGGING_FLAG_LOG_ERRORS_ONLY: ULONG = 0x00000004; +pub const HTTP_LOGGING_FLAG_LOG_SUCCESS_ONLY: ULONG = 0x00000008; +STRUCT!{struct HTTP_LOGGING_INFO { + Flags: HTTP_PROPERTY_FLAGS, + LoggingFlags: ULONG, + SoftwareName: PCWSTR, + SoftwareNameLength: USHORT, + DirectoryNameLength: USHORT, + DirectoryName: PCWSTR, + Format: HTTP_LOGGING_TYPE, + Fields: ULONG, + pExtFields: PVOID, + NumOfExtFields: USHORT, + MaxRecordSize: USHORT, + RolloverType: HTTP_LOGGING_ROLLOVER_TYPE, + RolloverSize: ULONG, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, +}} +pub type PHTTP_LOGGING_INFO = *mut HTTP_LOGGING_INFO; +STRUCT!{struct HTTP_BINDING_INFO { + Flags: HTTP_PROPERTY_FLAGS, + RequestQueueHandle: HANDLE, +}} +pub type PHTTP_BINDING_INFO = *mut HTTP_BINDING_INFO; +ENUM!{enum HTTP_PROTECTION_LEVEL_TYPE { + HttpProtectionLevelUnrestricted, + HttpProtectionLevelEdgeRestricted, + HttpProtectionLevelRestricted, +}} +pub type PHTTP_PROTECTION_LEVEL_TYPE = *mut HTTP_PROTECTION_LEVEL_TYPE; +STRUCT!{struct HTTP_PROTECTION_LEVEL_INFO { + Flags: HTTP_PROPERTY_FLAGS, + Level: HTTP_PROTECTION_LEVEL_TYPE, +}} +pub type PHTTP_PROTECTION_LEVEL_INFO = *mut HTTP_PROTECTION_LEVEL_INFO; +pub const HTTP_CREATE_REQUEST_QUEUE_FLAG_OPEN_EXISTING: ULONG = 0x00000001; +pub const HTTP_CREATE_REQUEST_QUEUE_FLAG_CONTROLLER: ULONG = 0x00000002; +pub const HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY: ULONG = 0x00000001; +pub const HTTP_RECEIVE_REQUEST_FLAG_FLUSH_BODY: ULONG = 0x00000002; +pub const HTTP_RECEIVE_REQUEST_ENTITY_BODY_FLAG_FILL_BUFFER: ULONG = 0x00000001; +pub const HTTP_SEND_RESPONSE_FLAG_DISCONNECT: ULONG = 0x00000001; +pub const HTTP_SEND_RESPONSE_FLAG_MORE_DATA: ULONG = 0x00000002; +pub const HTTP_SEND_RESPONSE_FLAG_BUFFER_DATA: ULONG = 0x00000004; +pub const HTTP_SEND_RESPONSE_FLAG_ENABLE_NAGLING: ULONG = 0x00000008; +pub const HTTP_SEND_RESPONSE_FLAG_PROCESS_RANGES: ULONG = 0x00000020; +pub const HTTP_SEND_RESPONSE_FLAG_OPAQUE: ULONG = 0x00000040; +pub const HTTP_FLUSH_RESPONSE_FLAG_RECURSIVE: ULONG = 0x00000001; +pub type HTTP_OPAQUE_ID = ULONGLONG; +pub type PHTTP_OPAQUE_ID = *mut ULONGLONG; +pub type HTTP_REQUEST_ID = HTTP_OPAQUE_ID; +pub type PHTTP_REQUEST_ID = *mut HTTP_OPAQUE_ID; +pub type HTTP_CONNECTION_ID = HTTP_OPAQUE_ID; +pub type PHTTP_CONNECTION_ID = *mut HTTP_OPAQUE_ID; +pub type HTTP_RAW_CONNECTION_ID = HTTP_OPAQUE_ID; +pub type PHTTP_RAW_CONNECTION_ID = *mut HTTP_OPAQUE_ID; +pub type HTTP_URL_GROUP_ID = HTTP_OPAQUE_ID; +pub type PHTTP_URL_GROUP_ID = *mut HTTP_OPAQUE_ID; +pub type HTTP_SERVER_SESSION_ID = HTTP_OPAQUE_ID; +pub type PHTTP_SERVER_SESSION_ID = *mut HTTP_OPAQUE_ID; +pub const HTTP_BYTE_RANGE_TO_EOF: ULONGLONG = !0; +STRUCT!{struct HTTP_BYTE_RANGE { + StartingOffset: ULARGE_INTEGER, + Length: ULARGE_INTEGER, +}} +pub type PHTTP_BYTE_RANGE = *mut HTTP_BYTE_RANGE; +STRUCT!{struct HTTP_VERSION { + MajorVersion: USHORT, + MinorVersion: USHORT, +}} +pub type PHTTP_VERSION = *mut HTTP_VERSION; +pub const HTTP_VERSION_UNKNOWN: HTTP_VERSION = HTTP_VERSION { MajorVersion: 0, MinorVersion: 0 }; +pub const HTTP_VERSION_0_9: HTTP_VERSION = HTTP_VERSION { MajorVersion: 0, MinorVersion: 9 }; +pub const HTTP_VERSION_1_0: HTTP_VERSION = HTTP_VERSION { MajorVersion: 1, MinorVersion: 0 }; +pub const HTTP_VERSION_1_1: HTTP_VERSION = HTTP_VERSION { MajorVersion: 1, MinorVersion: 1 }; +#[inline] +pub fn HTTP_SET_VERSION(mut version: HTTP_VERSION, major: USHORT, minor: USHORT) { + version.MajorVersion = major; + version.MinorVersion = minor; +} +#[inline] +pub fn HTTP_EQUAL_VERSION(version: HTTP_VERSION, major: USHORT, minor: USHORT) -> bool { + version.MajorVersion == major && version.MinorVersion == minor +} +#[inline] +pub fn HTTP_GREATER_VERSION(version: HTTP_VERSION, major: USHORT, minor: USHORT) -> bool { + version.MajorVersion > major || (version.MajorVersion == major && version.MinorVersion > minor) +} +#[inline] +pub fn HTTP_LESS_VERSION(version: HTTP_VERSION, major: USHORT, minor: USHORT) -> bool { + version.MajorVersion < major || (version.MajorVersion == major && version.MinorVersion < minor) +} +#[inline] +pub fn HTTP_NOT_EQUAL_VERSION(version: HTTP_VERSION, major: USHORT, minor: USHORT) -> bool { + !HTTP_EQUAL_VERSION(version, major, minor) +} +#[inline] +pub fn HTTP_GREATER_EQUAL_VERSION(version: HTTP_VERSION, major: USHORT, minor: USHORT) -> bool { + !HTTP_LESS_VERSION(version, major, minor) +} +#[inline] +pub fn HTTP_LESS_EQUAL_VERSION(version: HTTP_VERSION, major: USHORT, minor: USHORT) -> bool { + !HTTP_GREATER_VERSION(version, major, minor) +} +ENUM!{enum HTTP_VERB { + HttpVerbUnparsed, + HttpVerbUnknown, + HttpVerbInvalid, + HttpVerbOPTIONS, + HttpVerbGET, + HttpVerbHEAD, + HttpVerbPOST, + HttpVerbPUT, + HttpVerbDELETE, + HttpVerbTRACE, + HttpVerbCONNECT, + HttpVerbTRACK, + HttpVerbMOVE, + HttpVerbCOPY, + HttpVerbPROPFIND, + HttpVerbPROPPATCH, + HttpVerbMKCOL, + HttpVerbLOCK, + HttpVerbUNLOCK, + HttpVerbSEARCH, + HttpVerbMaximum, +}} +pub type PHTTP_VERB = *mut HTTP_VERB; +ENUM!{enum HTTP_HEADER_ID { + HttpHeaderCacheControl = 0, + HttpHeaderConnection = 1, + HttpHeaderDate = 2, + HttpHeaderKeepAlive = 3, + HttpHeaderPragma = 4, + HttpHeaderTrailer = 5, + HttpHeaderTransferEncoding = 6, + HttpHeaderUpgrade = 7, + HttpHeaderVia = 8, + HttpHeaderWarning = 9, + HttpHeaderAllow = 10, + HttpHeaderContentLength = 11, + HttpHeaderContentType = 12, + HttpHeaderContentEncoding = 13, + HttpHeaderContentLanguage = 14, + HttpHeaderContentLocation = 15, + HttpHeaderContentMd5 = 16, + HttpHeaderContentRange = 17, + HttpHeaderExpires = 18, + HttpHeaderLastModified = 19, + HttpHeaderAccept = 20, + HttpHeaderAcceptCharset = 21, + HttpHeaderAcceptEncoding = 22, + HttpHeaderAcceptLanguage = 23, + HttpHeaderAuthorization = 24, + HttpHeaderCookie = 25, + HttpHeaderExpect = 26, + HttpHeaderFrom = 27, + HttpHeaderHost = 28, + HttpHeaderIfMatch = 29, + HttpHeaderIfModifiedSince = 30, + HttpHeaderIfNoneMatch = 31, + HttpHeaderIfRange = 32, + HttpHeaderIfUnmodifiedSince = 33, + HttpHeaderMaxForwards = 34, + HttpHeaderProxyAuthorization = 35, + HttpHeaderReferer = 36, + HttpHeaderRange = 37, + HttpHeaderTe = 38, + HttpHeaderTranslate = 39, + HttpHeaderUserAgent = 40, + HttpHeaderRequestMaximum = 41, + HttpHeaderAcceptRanges = 20, + HttpHeaderAge = 21, + HttpHeaderEtag = 22, + HttpHeaderLocation = 23, + HttpHeaderProxyAuthenticate = 24, + HttpHeaderRetryAfter = 25, + HttpHeaderServer = 26, + HttpHeaderSetCookie = 27, + HttpHeaderVary = 28, + HttpHeaderWwwAuthenticate = 29, + HttpHeaderResponseMaximum = 30, + HttpHeaderMaximum = 41, +}} +pub type PHTTP_HEADER_ID = *mut HTTP_HEADER_ID; +STRUCT!{struct HTTP_KNOWN_HEADER { + RawValueLength: USHORT, + pRawValue: PCSTR, +}} +pub type PHTTP_KNOWN_HEADER = *mut HTTP_KNOWN_HEADER; +STRUCT!{struct HTTP_UNKNOWN_HEADER { + NameLength: USHORT, + RawValueLength: USHORT, + pName: PCSTR, + pRawValue: PCSTR, +}} +pub type PHTTP_UNKNOWN_HEADER = *mut HTTP_UNKNOWN_HEADER; +ENUM!{enum HTTP_LOG_DATA_TYPE { + HttpLogDataTypeFields = 0, +}} +pub type PHTTP_LOG_DATA_TYPE = *mut HTTP_LOG_DATA_TYPE; +STRUCT!{struct HTTP_LOG_DATA { + Type: HTTP_LOG_DATA_TYPE, +}} +pub type PHTTP_LOG_DATA = *mut HTTP_LOG_DATA; +STRUCT!{struct HTTP_LOG_FIELDS_DATA { + Base: HTTP_LOG_DATA, + UserNameLength: USHORT, + UriStemLength: USHORT, + ClientIpLength: USHORT, + ServerNameLength: USHORT, + ServiceNameLength: USHORT, + ServerIpLength: USHORT, + MethodLength: USHORT, + UriQueryLength: USHORT, + HostLength: USHORT, + UserAgentLength: USHORT, + CookieLength: USHORT, + ReferrerLength: USHORT, + UserName: PWCHAR, + UriStem: PWCHAR, + ClientIp: PCHAR, + ServerName: PCHAR, + ServiceName: PCHAR, + ServerIp: PCHAR, + Method: PCHAR, + UriQuery: PCHAR, + Host: PCHAR, + UserAgent: PCHAR, + Cookie: PCHAR, + Referrer: PCHAR, + ServerPort: USHORT, + ProtocolStatus: USHORT, + Win32Status: ULONG, + MethodNum: HTTP_VERB, + SubStatus: USHORT, +}} +pub type PHTTP_LOG_FIELDS_DATA = *mut HTTP_LOG_FIELDS_DATA; +ENUM!{enum HTTP_DATA_CHUNK_TYPE { + HttpDataChunkFromMemory, + HttpDataChunkFromFileHandle, + HttpDataChunkFromFragmentCache, + HttpDataChunkFromFragmentCacheEx, + HttpDataChunkMaximum, +}} +pub type PHTTP_DATA_CHUNK_TYPE = *mut HTTP_DATA_CHUNK_TYPE; +STRUCT!{struct HTTP_DATA_CHUNK_FromMemory { + pBuffer: PVOID, + BufferLength: ULONG, +}} +STRUCT!{struct HTTP_DATA_CHUNK_FromFileHandle { + ByteRange: HTTP_BYTE_RANGE, + FileHandle: HANDLE, +}} +STRUCT!{struct HTTP_DATA_CHUNK_FromFragmentCache { + FragmentNameLength: USHORT, + pFragmentName: PCWSTR, +}} +STRUCT!{struct HTTP_DATA_CHUNK_FromFragmentCacheEx { + ByteRange: HTTP_BYTE_RANGE, + pFragmentName: PCWSTR, +}} +UNION!{union HTTP_DATA_CHUNK_u { + [u64; 3], + FromMemory FromMemory_mut: HTTP_DATA_CHUNK_FromMemory, + FromFileHandle FromFileHandle_mut: HTTP_DATA_CHUNK_FromFileHandle, + FromFragmentCache FromFragmentCache_mut: HTTP_DATA_CHUNK_FromFragmentCache, + FromFragmentCacheEx FromFragmentCacheEx_mut: HTTP_DATA_CHUNK_FromFragmentCacheEx, +}} +STRUCT!{struct HTTP_DATA_CHUNK { + DataChunkType: HTTP_DATA_CHUNK_TYPE, + u: HTTP_DATA_CHUNK_u, +}} +pub type PHTTP_DATA_CHUNK = *mut HTTP_DATA_CHUNK; +STRUCT!{struct HTTP_REQUEST_HEADERS { + UnknownHeaderCount: USHORT, + pUnknownHeaders: PHTTP_UNKNOWN_HEADER, + TrailerCount: USHORT, + pTrailers: PHTTP_UNKNOWN_HEADER, + KnownHeaders: [HTTP_KNOWN_HEADER; 41], // FIXME HttpHeaderRequestMaximum +}} +pub type PHTTP_REQUEST_HEADERS = *mut HTTP_REQUEST_HEADERS; +STRUCT!{struct HTTP_RESPONSE_HEADERS { + UnknownHeaderCount: USHORT, + pUnknownHeaders: PHTTP_UNKNOWN_HEADER, + TrailerCount: USHORT, + pTrailers: PHTTP_UNKNOWN_HEADER, + KnownHeaders: [HTTP_KNOWN_HEADER; 30], // FIXME HttpHeaderResponseMaximum +}} +pub type PHTTP_RESPONSE_HEADERS = *mut HTTP_RESPONSE_HEADERS; +STRUCT!{struct HTTP_TRANSPORT_ADDRESS { + pRemoteAddress: PSOCKADDR, + pLocalAddress: PSOCKADDR, +}} +pub type PHTTP_TRANSPORT_ADDRESS = *mut HTTP_TRANSPORT_ADDRESS; +STRUCT!{struct HTTP_COOKED_URL { + FullUrlLength: USHORT, + HostLength: USHORT, + AbsPathLength: USHORT, + QueryStringLength: USHORT, + pFullUrl: PCWSTR, + pHost: PCWSTR, + pAbsPath: PCWSTR, + pQueryString: PCWSTR, +}} +pub type PHTTP_COOKED_URL = *mut HTTP_COOKED_URL; +pub type HTTP_URL_CONTEXT = ULONGLONG; +pub const HTTP_URL_FLAG_REMOVE_ALL: ULONG = 0x00000001; +ENUM!{enum HTTP_AUTH_STATUS { + HttpAuthStatusSuccess, + HttpAuthStatusNotAuthenticated, + HttpAuthStatusFailure, +}} +pub type PHTTP_AUTH_STATUS = *mut HTTP_AUTH_STATUS; +ENUM!{enum HTTP_REQUEST_AUTH_TYPE { + HttpRequestAuthTypeNone = 0, + HttpRequestAuthTypeBasic, + HttpRequestAuthTypeDigest, + HttpRequestAuthTypeNTLM, + HttpRequestAuthTypeNegotiate, + HttpRequestAuthTypeKerberos, +}} +pub type PHTTP_REQUEST_AUTH_TYPE = *mut HTTP_REQUEST_AUTH_TYPE; +STRUCT!{struct HTTP_SSL_CLIENT_CERT_INFO { + CertFlags: ULONG, + CertEncodedSize: ULONG, + pCertEncoded: PUCHAR, + Token: HANDLE, + CertDeniedByMapper: BOOLEAN, +}} +pub type PHTTP_SSL_CLIENT_CERT_INFO = *mut HTTP_SSL_CLIENT_CERT_INFO; +pub const HTTP_RECEIVE_SECURE_CHANNEL_TOKEN: ULONG = 0x1; +STRUCT!{struct HTTP_SSL_INFO { + ServerCertKeySize: USHORT, + ConnectionKeySize: USHORT, + ServerCertIssuerSize: ULONG, + ServerCertSubjectSize: ULONG, + pServerCertIssuer: PCSTR, + pServerCertSubject: PCSTR, + pClientCertInfo: PHTTP_SSL_CLIENT_CERT_INFO, + SslClientCertNegotiated: ULONG, +}} +pub type PHTTP_SSL_INFO = *mut HTTP_SSL_INFO; +ENUM!{enum HTTP_REQUEST_INFO_TYPE { + HttpRequestInfoTypeAuth, + HttpRequestInfoTypeChannelBind, +}} +STRUCT!{struct HTTP_REQUEST_INFO { + InfoType: HTTP_REQUEST_INFO_TYPE, + InfoLength: ULONG, + pInfo: PVOID, +}} +pub type PHTTP_REQUEST_INFO = *mut HTTP_REQUEST_INFO; +pub const HTTP_REQUEST_AUTH_FLAG_TOKEN_FOR_CACHED_CRED: ULONG = 0x00000001; +STRUCT!{struct HTTP_REQUEST_AUTH_INFO { + AuthStatus: HTTP_AUTH_STATUS, + SecStatus: SECURITY_STATUS, + Flags: ULONG, + AuthType: HTTP_REQUEST_AUTH_TYPE, + AccessToken: HANDLE, + ContextAttributes: ULONG, + PackedContextLength: ULONG, + PackedContextType: ULONG, + PackedContext: PVOID, + MutualAuthDataLength: ULONG, + pMutualAuthData: PCHAR, + PackageNameLength: USHORT, + pPackageName: PWSTR, +}} +pub type PHTTP_REQUEST_AUTH_INFO = *mut HTTP_REQUEST_AUTH_INFO; +STRUCT!{struct HTTP_REQUEST_V1 { + Flags: ULONG, + ConnectionId: HTTP_CONNECTION_ID, + RequestId: HTTP_REQUEST_ID, + UrlContext: HTTP_URL_CONTEXT, + Version: HTTP_VERSION, + Verb: HTTP_VERB, + UnknownVerbLength: USHORT, + RawUrlLength: USHORT, + pUnknownVerb: PCSTR, + pRawUrl: PCSTR, + CookedUrl: HTTP_COOKED_URL, + Address: HTTP_TRANSPORT_ADDRESS, + Headers: HTTP_REQUEST_HEADERS, + BytesReceived: ULONGLONG, + EntityChunkCount: USHORT, + pEntityChunks: PHTTP_DATA_CHUNK, + RawConnectionId: HTTP_RAW_CONNECTION_ID, + pSslInfo: PHTTP_SSL_INFO, +}} +pub type PHTTP_REQUEST_V1 = *mut HTTP_REQUEST_V1; +STRUCT!{struct HTTP_REQUEST_V2 { + Base: HTTP_REQUEST_V1, + RequestInfoCount: USHORT, + pRequestInfo: PHTTP_REQUEST_INFO, +}} +pub type PHTTP_REQUEST_V2 = *mut HTTP_REQUEST_V2; +pub type HTTP_REQUEST = HTTP_REQUEST_V2; +pub type PHTTP_REQUEST = *mut HTTP_REQUEST; +pub const HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS: ULONG = 0x00000001; +pub const HTTP_REQUEST_FLAG_IP_ROUTED: ULONG = 0x00000002; +STRUCT!{struct HTTP_RESPONSE_V1 { + Flags: ULONG, + Version: HTTP_VERSION, + StatusCode: USHORT, + ReasonLength: USHORT, + pReason: PCSTR, + Headers: HTTP_RESPONSE_HEADERS, + EntityChunkCount: USHORT, + pEntityChunks: PHTTP_DATA_CHUNK, +}} +pub type PHTTP_RESPONSE_V1 = *mut HTTP_RESPONSE_V1; +pub const HTTP_RESPONSE_FLAG_MULTIPLE_ENCODINGS_AVAILABLE: ULONG = 0x00000001; +ENUM!{enum HTTP_RESPONSE_INFO_TYPE { + HttpResponseInfoTypeMultipleKnownHeaders, + HttpResponseInfoTypeAuthenticationProperty, + HttpResponseInfoTypeQoSProperty, + HttpResponseInfoTypeChannelBind, +}} +pub type PHTTP_RESPONSE_INFO_TYPE = *mut HTTP_RESPONSE_INFO_TYPE; +STRUCT!{struct HTTP_RESPONSE_INFO { + Type: HTTP_RESPONSE_INFO_TYPE, + Length: ULONG, + pInfo: PVOID, +}} +pub type PHTTP_RESPONSE_INFO = *mut HTTP_RESPONSE_INFO; +pub const HTTP_RESPONSE_INFO_FLAGS_PRESERVE_ORDER: ULONG = 0x00000001; +STRUCT!{struct HTTP_MULTIPLE_KNOWN_HEADERS { + HeaderId: HTTP_HEADER_ID, + Flags: ULONG, + KnownHeaderCount: USHORT, + KnownHeaders: PHTTP_KNOWN_HEADER, +}} +pub type PHTTP_MULTIPLE_KNOWN_HEADERS = *mut HTTP_MULTIPLE_KNOWN_HEADERS; +STRUCT!{struct HTTP_RESPONSE_V2 { + Base: HTTP_RESPONSE_V1, + ResponseInfoCount: USHORT, + pResponseInfo: PHTTP_RESPONSE_INFO, +}} +pub type PHTTP_RESPONSE_V2 = *mut HTTP_RESPONSE_V2; +pub type HTTP_RESPONSE = HTTP_RESPONSE_V2; +pub type PHTTP_RESPONSE = *mut HTTP_RESPONSE; +STRUCT!{struct HTTPAPI_VERSION { + HttpApiMajorVersion: USHORT, + HttpApiMinorVersion: USHORT, +}} +pub type PHTTPAPI_VERSION = *mut HTTPAPI_VERSION; +pub const HTTPAPI_VERSION_2: HTTPAPI_VERSION = HTTPAPI_VERSION { + HttpApiMajorVersion: 2, + HttpApiMinorVersion: 0, +}; +pub const HTTPAPI_VERSION_1: HTTPAPI_VERSION = HTTPAPI_VERSION { + HttpApiMajorVersion: 1, + HttpApiMinorVersion: 0, +}; +#[inline] +pub fn HTTPAPI_EQUAL_VERSION(version: HTTPAPI_VERSION, major: USHORT, minor: USHORT) -> bool { + version.HttpApiMajorVersion == major && version.HttpApiMinorVersion == minor +} +#[inline] +pub fn HTTPAPI_GREATER_VERSION(version: HTTPAPI_VERSION, major: USHORT, minor: USHORT) -> bool { + version.HttpApiMajorVersion > major || + (version.HttpApiMajorVersion == major && version.HttpApiMinorVersion > minor) +} +#[inline] +pub fn HTTPAPI_LESS_VERSION(version: HTTPAPI_VERSION, major: USHORT, minor: USHORT) -> bool { + version.HttpApiMajorVersion < major || + (version.HttpApiMajorVersion == major && version.HttpApiMinorVersion < minor) +} +#[inline] +pub fn HTTPAPI_VERSION_GREATER_OR_EQUAL( + version: HTTPAPI_VERSION, + major: USHORT, + minor: USHORT, +) -> bool { + !HTTPAPI_LESS_VERSION(version, major, minor) +} +ENUM!{enum HTTP_CACHE_POLICY_TYPE { + HttpCachePolicyNocache, + HttpCachePolicyUserInvalidates, + HttpCachePolicyTimeToLive, + HttpCachePolicyMaximum, +}} +pub type PHTTP_CACHE_POLICY_TYPE = *mut HTTP_CACHE_POLICY_TYPE; +STRUCT!{struct HTTP_CACHE_POLICY { + Policy: HTTP_CACHE_POLICY_TYPE, + SecondsToLive: ULONG, +}} +pub type PHTTP_CACHE_POLICY = *mut HTTP_CACHE_POLICY; +ENUM!{enum HTTP_SERVICE_CONFIG_ID { + HttpServiceConfigIPListenList, + HttpServiceConfigSSLCertInfo, + HttpServiceConfigUrlAclInfo, + HttpServiceConfigTimeout, + HttpServiceConfigCache, + HttpServiceConfigSslSniCertInfo, + HttpServiceConfigSslCcsCertInfo, + HttpServiceConfigMax, +}} +pub type PHTTP_SERVICE_CONFIG_ID = *mut HTTP_SERVICE_CONFIG_ID; +ENUM!{enum HTTP_SERVICE_CONFIG_QUERY_TYPE { + HttpServiceConfigQueryExact, + HttpServiceConfigQueryNext, + HttpServiceConfigQueryMax, +}} +pub type PHTTP_SERVICE_CONFIG_QUERY_TYPE = *mut HTTP_SERVICE_CONFIG_QUERY_TYPE; +STRUCT!{struct HTTP_SERVICE_CONFIG_SSL_KEY { + pIpPort: PSOCKADDR, +}} +pub type PHTTP_SERVICE_CONFIG_SSL_KEY = *mut HTTP_SERVICE_CONFIG_SSL_KEY; +STRUCT!{struct HTTP_SERVICE_CONFIG_SSL_SNI_KEY { + IpPort: SOCKADDR_STORAGE, + Host: PWSTR, +}} +pub type PHTTP_SERVICE_CONFIG_SSL_SNI_KEY = *mut HTTP_SERVICE_CONFIG_SSL_SNI_KEY; +STRUCT!{struct HTTP_SERVICE_CONFIG_SSL_CCS_KEY { + LocalAddress: SOCKADDR_STORAGE, +}} +pub type PHTTP_SERVICE_CONFIG_SSL_CCS_KEY = *mut HTTP_SERVICE_CONFIG_SSL_CCS_KEY; +STRUCT!{struct HTTP_SERVICE_CONFIG_SSL_PARAM { + SslHashLength: ULONG, + pSslHash: PVOID, + AppId: GUID, + pSslCertStoreName: PWSTR, + DefaultCertCheckMode: DWORD, + DefaultRevocationFreshnessTime: DWORD, + DefaultRevocationUrlRetrievalTimeout: DWORD, + pDefaultSslCtlIdentifier: PWSTR, + pDefaultSslCtlStoreName: PWSTR, + DefaultFlags: DWORD, +}} +pub type PHTTP_SERVICE_CONFIG_SSL_PARAM = *mut HTTP_SERVICE_CONFIG_SSL_PARAM; +pub const HTTP_SERVICE_CONFIG_SSL_FLAG_USE_DS_MAPPER: DWORD = 0x00000001; +pub const HTTP_SERVICE_CONFIG_SSL_FLAG_NEGOTIATE_CLIENT_CERT: DWORD = 0x00000002; +pub const HTTP_SERVICE_CONFIG_SSL_FLAG_NO_RAW_FILTER: DWORD = 0x00000004; +STRUCT!{struct HTTP_SERVICE_CONFIG_SSL_SET { + KeyDesc: HTTP_SERVICE_CONFIG_SSL_KEY, + ParamDesc: HTTP_SERVICE_CONFIG_SSL_PARAM, +}} +pub type PHTTP_SERVICE_CONFIG_SSL_SET = *mut HTTP_SERVICE_CONFIG_SSL_SET; +STRUCT!{struct HTTP_SERVICE_CONFIG_SSL_SNI_SET { + KeyDesc: HTTP_SERVICE_CONFIG_SSL_SNI_KEY, + ParamDesc: HTTP_SERVICE_CONFIG_SSL_PARAM, +}} +pub type PHTTP_SERVICE_CONFIG_SSL_SNI_SET = *mut HTTP_SERVICE_CONFIG_SSL_SNI_SET; +STRUCT!{struct HTTP_SERVICE_CONFIG_SSL_CCS_SET { + KeyDesc: HTTP_SERVICE_CONFIG_SSL_CCS_KEY, + ParamDesc: HTTP_SERVICE_CONFIG_SSL_PARAM, +}} +pub type PHTTP_SERVICE_CONFIG_SSL_CCS_SET = *mut HTTP_SERVICE_CONFIG_SSL_CCS_SET; +STRUCT!{struct HTTP_SERVICE_CONFIG_SSL_QUERY { + QueryDesc: HTTP_SERVICE_CONFIG_QUERY_TYPE, + KeyDesc: HTTP_SERVICE_CONFIG_SSL_KEY, + dwToken: DWORD, +}} +pub type PHTTP_SERVICE_CONFIG_SSL_QUERY = *mut HTTP_SERVICE_CONFIG_SSL_QUERY; +STRUCT!{struct HTTP_SERVICE_CONFIG_SSL_SNI_QUERY { + QueryDesc: HTTP_SERVICE_CONFIG_QUERY_TYPE, + KeyDesc: HTTP_SERVICE_CONFIG_SSL_SNI_KEY, + dwToken: DWORD, +}} +pub type PHTTP_SERVICE_CONFIG_SSL_SNI_QUERY = *mut HTTP_SERVICE_CONFIG_SSL_SNI_QUERY; +STRUCT!{struct HTTP_SERVICE_CONFIG_SSL_CCS_QUERY { + QueryDesc: HTTP_SERVICE_CONFIG_QUERY_TYPE, + KeyDesc: HTTP_SERVICE_CONFIG_SSL_CCS_KEY, + dwToken: DWORD, +}} +pub type PHTTP_SERVICE_CONFIG_SSL_CCS_QUERY = *mut HTTP_SERVICE_CONFIG_SSL_CCS_QUERY; +STRUCT!{struct HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM { + AddrLength: USHORT, + pAddress: PSOCKADDR, +}} +pub type PHTTP_SERVICE_CONFIG_IP_LISTEN_PARAM = *mut HTTP_SERVICE_CONFIG_IP_LISTEN_PARAM; +STRUCT!{struct HTTP_SERVICE_CONFIG_IP_LISTEN_QUERY { + AddrCount: ULONG, + AddrList: [SOCKADDR_STORAGE; ANYSIZE_ARRAY], +}} +pub type PHTTP_SERVICE_CONFIG_IP_LISTEN_QUERY = *mut HTTP_SERVICE_CONFIG_IP_LISTEN_QUERY; +STRUCT!{struct HTTP_SERVICE_CONFIG_URLACL_KEY { + pUrlPrefix: PWSTR, +}} +pub type PHTTP_SERVICE_CONFIG_URLACL_KEY = *mut HTTP_SERVICE_CONFIG_URLACL_KEY; +STRUCT!{struct HTTP_SERVICE_CONFIG_URLACL_PARAM { + pStringSecurityDescriptor: PWSTR, +}} +pub type PHTTP_SERVICE_CONFIG_URLACL_PARAM = *mut HTTP_SERVICE_CONFIG_URLACL_PARAM; +STRUCT!{struct HTTP_SERVICE_CONFIG_URLACL_SET { + KeyDesc: HTTP_SERVICE_CONFIG_URLACL_KEY, + ParamDesc: HTTP_SERVICE_CONFIG_URLACL_PARAM, +}} +pub type PHTTP_SERVICE_CONFIG_URLACL_SET = *mut HTTP_SERVICE_CONFIG_URLACL_SET; +STRUCT!{struct HTTP_SERVICE_CONFIG_URLACL_QUERY { + QueryDesc: HTTP_SERVICE_CONFIG_QUERY_TYPE, + KeyDesc: HTTP_SERVICE_CONFIG_URLACL_KEY, + dwToken: DWORD, +}} +pub type PHTTP_SERVICE_CONFIG_URLACL_QUERY = *mut HTTP_SERVICE_CONFIG_URLACL_QUERY; +ENUM!{enum HTTP_SERVICE_CONFIG_CACHE_KEY { + MaxCacheResponseSize = 0, + CacheRangeChunkSize, +}} +pub type PHTTP_SERVICE_CONFIG_CACHE_KEY = *mut HTTP_SERVICE_CONFIG_CACHE_KEY; +pub type HTTP_SERVICE_CONFIG_CACHE_PARAM = ULONG; +pub type PHTTP_SERVICE_CONFIG_CACHE_PARAM = *mut ULONG; +STRUCT!{struct HTTP_SERVICE_CONFIG_CACHE_SET { + KeyDesc: HTTP_SERVICE_CONFIG_CACHE_KEY, + ParamDesc: HTTP_SERVICE_CONFIG_CACHE_PARAM, +}} +pub type PHTTP_SERVICE_CONFIG_CACHE_SET = *mut HTTP_SERVICE_CONFIG_CACHE_SET; +pub const HTTP_NULL_ID: ULONGLONG = 0; +#[inline] +pub unsafe fn HTTP_IS_NULL_ID(pid: PHTTP_OPAQUE_ID) -> bool { + HTTP_NULL_ID == *pid +} +#[inline] +pub unsafe fn HTTP_SET_NULL_ID(pid: PHTTP_OPAQUE_ID) { + *pid = HTTP_NULL_ID +} +extern "system" { + pub fn HttpInitialize( + Version: HTTPAPI_VERSION, + Flags: ULONG, + pReserved: PVOID, + ) -> ULONG; + pub fn HttpTerminate( + Flags: ULONG, + pReserved: PVOID, + ) -> ULONG; + pub fn HttpCreateHttpHandle( + pReqQueueHandle: PHANDLE, + Reserved: ULONG, + ) -> ULONG; + pub fn HttpCreateRequestQueue( + Version: HTTPAPI_VERSION, + pName: PCWSTR, + pSecurityAttributes: PSECURITY_ATTRIBUTES, + Flags: ULONG, + pReqQueueHandle: PHANDLE, + ) -> ULONG; + pub fn HttpCloseRequestQueue( + ReqQueueHandle: HANDLE, + ) -> ULONG; + pub fn HttpSetRequestQueueProperty( + Handle: HANDLE, + Property: HTTP_SERVER_PROPERTY, + pPropertyInformation: PVOID, + PropertyInformationLength: ULONG, + Reserved: ULONG, + pReserved: PVOID, + ) -> ULONG; + pub fn HttpQueryRequestQueueProperty( + Handle: HANDLE, + Property: HTTP_SERVER_PROPERTY, + pPropertyInformation: PVOID, + PropertyInformationLength: ULONG, + Reserved: ULONG, + pReturnLength: PULONG, + pReserved: PVOID, + ) -> ULONG; + pub fn HttpShutdownRequestQueue( + ReqQueueHandle: HANDLE, + ) -> ULONG; + pub fn HttpReceiveClientCertificate( + ReqQueueHandle: HANDLE, + ConnectionId: HTTP_CONNECTION_ID, + Flags: ULONG, + pSslClientCertInfo: PHTTP_SSL_CLIENT_CERT_INFO, + SslClientCertInfoSize: ULONG, + pBytesReceived: PULONG, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpCreateServerSession( + Version: HTTPAPI_VERSION, + pServerSessionId: PHTTP_SERVER_SESSION_ID, + Reserved: ULONG, + ) -> ULONG; + pub fn HttpCloseServerSession( + ServerSessionId: HTTP_SERVER_SESSION_ID, + ) -> ULONG; + pub fn HttpQueryServerSessionProperty( + ServerSessionId: HTTP_SERVER_SESSION_ID, + Property: HTTP_SERVER_PROPERTY, + pPropertyInformation: PVOID, + PropertyInformationLength: ULONG, + pReturnLength: PULONG, + ) -> ULONG; + pub fn HttpSetServerSessionProperty( + ServerSessionId: HTTP_SERVER_SESSION_ID, + Property: HTTP_SERVER_PROPERTY, + pPropertyInformation: PVOID, + PropertyInformationLength: ULONG, + ) -> ULONG; + pub fn HttpAddUrl( + ReqQueueHandle: HANDLE, + pFullyQualifiedUrl: PCWSTR, + pReserved: PVOID, + ) -> ULONG; + pub fn HttpRemoveUrl( + ReqQueueHandle: HANDLE, + pFullyQualifiedUrl: PCWSTR, + ) -> ULONG; + pub fn HttpCreateUrlGroup( + ServerSessionId: HTTP_SERVER_SESSION_ID, + pUrlGroupId: PHTTP_URL_GROUP_ID, + Reserved: ULONG, + ) -> ULONG; + pub fn HttpCloseUrlGroup( + UrlGroupId: HTTP_URL_GROUP_ID, + ) -> ULONG; + pub fn HttpAddUrlToUrlGroup( + UrlGroupId: HTTP_URL_GROUP_ID, + pFullyQualifiedUrl: PCWSTR, + UrlContext: HTTP_URL_CONTEXT, + Reserved: ULONG, + ) -> ULONG; + pub fn HttpRemoveUrlFromUrlGroup( + UrlGroupId: HTTP_URL_GROUP_ID, + pFullyQualifiedUrl: PCWSTR, + Flags: ULONG, + ) -> ULONG; + pub fn HttpSetUrlGroupProperty( + UrlGroupId: HTTP_URL_GROUP_ID, + Property: HTTP_SERVER_PROPERTY, + pPropertyInformation: PVOID, + PropertyInformationLength: ULONG, + ) -> ULONG; + pub fn HttpQueryUrlGroupProperty( + UrlGroupId: HTTP_URL_GROUP_ID, + Property: HTTP_SERVER_PROPERTY, + pPropertyInformation: PVOID, + PropertyInformationLength: ULONG, + pReturnLength: PULONG, + ) -> ULONG; + pub fn HttpPrepareUrl( + Reserved: PVOID, + Flags: ULONG, + Url: PCWSTR, + PreparedUrl: *mut PWSTR, + ) -> ULONG; + pub fn HttpReceiveHttpRequest( + ReqQueueHandle: HANDLE, + RequestId: HTTP_REQUEST_ID, + Flags: ULONG, + pRequestBuffer: PHTTP_REQUEST, + RequestBufferLength: ULONG, + pBytesReturned: PULONG, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpReceiveRequestEntityBody( + ReqQueueHandle: HANDLE, + RequestId: HTTP_REQUEST_ID, + Flags: ULONG, + pBuffer: PVOID, + EntityBufferLength: ULONG, + pBytesReturned: PULONG, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpSendHttpResponse( + ReqQueueHandle: HANDLE, + RequestId: HTTP_REQUEST_ID, + Flags: ULONG, + pHttpResponse: PHTTP_RESPONSE, + pCachePolicy: PHTTP_CACHE_POLICY, + pBytesSent: PULONG, + pReserved1: PVOID, + Reserved2: ULONG, + pOverlapped: LPOVERLAPPED, + pLogData: PHTTP_LOG_DATA, + ) -> ULONG; + pub fn HttpSendResponseEntityBody( + ReqQueueHandle: HANDLE, + RequestId: HTTP_REQUEST_ID, + Flags: ULONG, + EntityChunkCount: USHORT, + pEntityChunks: PHTTP_DATA_CHUNK, + pBytesSent: PULONG, + pReserved1: PVOID, + Reserved2: ULONG, + pOverlapped: LPOVERLAPPED, + pLogData: PHTTP_LOG_DATA, + ) -> ULONG; + pub fn HttpWaitForDisconnect( + ReqQueueHandle: HANDLE, + ConnectionId: HTTP_CONNECTION_ID, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpWaitForDisconnectEx( + ReqQueueHandle: HANDLE, + ConnectionId: HTTP_CONNECTION_ID, + Reserved: ULONG, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpCancelHttpRequest( + ReqQueueHandle: HANDLE, + RequestId: HTTP_REQUEST_ID, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpWaitForDemandStart( + ReqQueueHandle: HANDLE, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpFlushResponseCache( + ReqQueueHandle: HANDLE, + pUrlPrefix: PCWSTR, + Flags: ULONG, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpAddFragmentToCache( + ReqQueueHandle: HANDLE, + pUrlPrefix: PCWSTR, + pDataChunk: PHTTP_DATA_CHUNK, + pCachePolicy: PHTTP_CACHE_POLICY, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpReadFragmentFromCache( + ReqQueueHandle: HANDLE, + pUrlPrefix: PCWSTR, + pByteRange: PHTTP_BYTE_RANGE, + pBuffer: PVOID, + BufferLength: ULONG, + pBytesRead: PULONG, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpSetServiceConfiguration( + ServiceHandle: HANDLE, + ConfigId: HTTP_SERVICE_CONFIG_ID, + pConfigInformation: PVOID, + ConfigInformationLength: ULONG, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpDeleteServiceConfiguration( + ServiceHandle: HANDLE, + ConfigId: HTTP_SERVICE_CONFIG_ID, + pConfigInformation: PVOID, + ConfigInformationLength: ULONG, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpQueryServiceConfiguration( + ServiceHandle: HANDLE, + ConfigId: HTTP_SERVICE_CONFIG_ID, + pInput: PVOID, + InputLength: ULONG, + pOutput: PVOID, + OutputLength: ULONG, + pReturnLength: PULONG, + pOverlapped: LPOVERLAPPED, + ) -> ULONG; + pub fn HttpDeclarePush( + RequestQueueHandle: HANDLE, + RequestId: HTTP_REQUEST_ID, + Verb: HTTP_VERB, + Path: PCWSTR, + Query: PCSTR, + Headers: PHTTP_REQUEST_HEADERS, + ) -> ULONG; + pub fn HttpUpdateServiceConfiguration( + Handle: HANDLE, + ConfigId: HTTP_SERVICE_CONFIG_ID, + ConfigInfo: PVOID, + ConfigInfoLength: ULONG, + Overlapped: LPOVERLAPPED, + ) -> ULONG; +} diff --git a/bash-5.1/vendor/winapi/src/um/imm.rs b/bash-5.1/vendor/winapi/src/um/imm.rs new file mode 100644 index 0000000000000000000000000000000000000000..ddf4c3f2c2d93f2cc15886c10147c515ccf1b746 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/imm.rs @@ -0,0 +1,42 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_uint; +use shared::minwindef::{BOOL, DWORD, UINT}; +use shared::windef::{HWND, POINT, RECT}; +pub type LPUINT = *mut c_uint; +STRUCT!{struct COMPOSITIONFORM { + dwStyle: DWORD, + ptCurrentPos: POINT, + rcArea: RECT, +}} +DECLARE_HANDLE!{HIMC, HIMC__} +pub type LPCOMPOSITIONFORM = *mut COMPOSITIONFORM; +extern "system" { + pub fn ImmGetContext( + hwnd: HWND, + ) -> HIMC; + pub fn ImmGetOpenStatus( + himc: HIMC, + ) -> BOOL; + pub fn ImmSetOpenStatus( + himc: HIMC, + fopen: BOOL, + ) -> BOOL; + pub fn ImmSetCompositionWindow( + himc: HIMC, + lpCompForm: LPCOMPOSITIONFORM, + ) -> BOOL; + pub fn ImmReleaseContext( + hwnd: HWND, + himc: HIMC, + ) -> BOOL; +} +pub const CFS_DEFAULT: UINT = 0x0000; +pub const CFS_RECT: UINT = 0x0001; +pub const CFS_POINT: UINT = 0x0002; +pub const CFS_FORCE_POSITION: UINT = 0x0020; +pub const CFS_CANDIDATEPOS: UINT = 0x0040; +pub const CFS_EXCLUDE: UINT = 0x0080; diff --git a/bash-5.1/vendor/winapi/src/um/interlockedapi.rs b/bash-5.1/vendor/winapi/src/um/interlockedapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..17f656db9244efbd83c40e43ac5561218881c15e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/interlockedapi.rs @@ -0,0 +1,31 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{ULONG, USHORT}; +use um::winnt::{PSLIST_ENTRY, PSLIST_HEADER}; +extern "system" { + pub fn InitializeSListHead( + ListHead: PSLIST_HEADER, + ); + pub fn InterlockedPopEntrySList( + ListHead: PSLIST_HEADER, + ) -> PSLIST_ENTRY; + pub fn InterlockedPushEntrySList( + ListHead: PSLIST_HEADER, + ListEntry: PSLIST_ENTRY, + ) -> PSLIST_ENTRY; + pub fn InterlockedPushListSListEx( + ListHead: PSLIST_HEADER, + List: PSLIST_ENTRY, + ListEnd: PSLIST_ENTRY, + Count: ULONG, + ) -> PSLIST_ENTRY; + pub fn InterlockedFlushSList( + ListHead: PSLIST_HEADER, + ) -> PSLIST_ENTRY; + pub fn QueryDepthSList( + ListHead: PSLIST_HEADER, + ) -> USHORT; +} diff --git a/bash-5.1/vendor/winapi/src/um/ioapiset.rs b/bash-5.1/vendor/winapi/src/um/ioapiset.rs new file mode 100644 index 0000000000000000000000000000000000000000..b9b710964c29b14499455ced7d5a417a5f537401 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ioapiset.rs @@ -0,0 +1,71 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{PULONG_PTR, ULONG_PTR}; +use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, PULONG, ULONG}; +use um::minwinbase::{LPOVERLAPPED, LPOVERLAPPED_ENTRY}; +use um::winnt::HANDLE; +extern "system" { + pub fn CreateIoCompletionPort( + FileHandle: HANDLE, + ExistingCompletionPort: HANDLE, + CompletionKey: ULONG_PTR, + NumberOfConcurrentThreads: DWORD, + ) -> HANDLE; + pub fn GetQueuedCompletionStatus( + CompletionPort: HANDLE, + lpNumberOfBytesTransferred: LPDWORD, + lpCompletionKey: PULONG_PTR, + lpOverlapped: *mut LPOVERLAPPED, + dwMilliseconds: DWORD, + ) -> BOOL; + pub fn GetQueuedCompletionStatusEx( + CompletionPort: HANDLE, + lpCompletionPortEntries: LPOVERLAPPED_ENTRY, + ulCount: ULONG, + ulNumEntriesRemoved: PULONG, + dwMilliseconds: DWORD, + fAlertable: BOOL, + ) -> BOOL; + pub fn PostQueuedCompletionStatus( + CompletionPort: HANDLE, + dwNumberOfBytesTransferred: DWORD, + dwCompletionKey: ULONG_PTR, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn DeviceIoControl( + hDevice: HANDLE, + dwIoControlCode: DWORD, + lpInBuffer: LPVOID, + nInBufferSize: DWORD, + lpOutBuffer: LPVOID, + nOutBufferSize: DWORD, + lpBytesReturned: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn GetOverlappedResult( + hFile: HANDLE, + lpOverlapped: LPOVERLAPPED, + lpNumberOfBytesTransferred: LPDWORD, + bWait: BOOL, + ) -> BOOL; + pub fn CancelIoEx( + hFile: HANDLE, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn CancelIo( + hFile: HANDLE, + ) -> BOOL; + pub fn GetOverlappedResultEx( + hFile: HANDLE, + lpOverlapped: LPOVERLAPPED, + lpNumberOfBytesTransferred: LPDWORD, + dwMilliseconds: DWORD, + bAlertable: BOOL, + ) -> BOOL; + pub fn CancelSynchronousIo( + hThread: HANDLE, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/ipexport.rs b/bash-5.1/vendor/winapi/src/um/ipexport.rs new file mode 100644 index 0000000000000000000000000000000000000000..32511622c16143261a2249355ca1a0cf9fec0704 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ipexport.rs @@ -0,0 +1,174 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// #include +// #include +// #include +use shared::basetsd::ULONG64; +use shared::in6addr::in6_addr; +use shared::ntdef::{INT, PUCHAR, PVOID, UCHAR, ULONG, USHORT, WCHAR}; +pub const MAX_ADAPTER_NAME: usize = 128; +pub const MAX_OPT_SIZE: usize = 40; +pub type IPAddr = ULONG; +pub type IPMask = ULONG; +pub type IP_STATUS = ULONG; +pub type IPv6Addr = in6_addr; +STRUCT!{struct IP_OPTION_INFORMATION { + Ttl: UCHAR, + Tos: UCHAR, + Flags: UCHAR, + OptionsSize: UCHAR, + OptionsData: PUCHAR, +}} +pub type PIP_OPTION_INFORMATION = *mut IP_OPTION_INFORMATION; +#[cfg(target_arch = "x86_64")] +STRUCT!{struct IP_OPTION_INFORMATION32 { + Ttl: UCHAR, + Tos: UCHAR, + Flags: UCHAR, + OptionsSize: UCHAR, + OptionsData: u32, // UCHAR * POINTER_32 +}} +#[cfg(target_arch = "x86_64")] +pub type PIP_OPTION_INFORMATION32 = *mut IP_OPTION_INFORMATION32; +STRUCT!{struct ICMP_ECHO_REPLY { + Address: IPAddr, + Status: ULONG, + RoundTripTime: ULONG, + DataSize: USHORT, + Reserved: USHORT, + Data: PVOID, + Options: IP_OPTION_INFORMATION, +}} +pub type PICMP_ECHO_REPLY = *mut ICMP_ECHO_REPLY; +#[cfg(target_arch = "x86_64")] +STRUCT!{struct ICMP_ECHO_REPLY32 { + Address: IPAddr, + Status: ULONG, + RoundTripTime: ULONG, + DataSize: USHORT, + Reserved: USHORT, + Data: u32, // VOID * POINTER_32 + Options: IP_OPTION_INFORMATION32, +}} +#[cfg(target_arch = "x86_64")] +pub type PICMP_ECHO_REPLY32 = *mut ICMP_ECHO_REPLY32; +STRUCT!{#[repr(packed)] struct IPV6_ADDRESS_EX { + sin6_port: USHORT, + sin6_flowinfo: ULONG, + sin6_addr: [USHORT; 8], + sin6_scope_id: ULONG, +}} +pub type PIPV6_ADDRESS_EX = *mut IPV6_ADDRESS_EX; +// #include +STRUCT!{struct ICMPV6_ECHO_REPLY_LH { + Address: IPV6_ADDRESS_EX, + Status: ULONG, + RoundTripTime: INT, +}} +pub type PICMPV6_ECHO_REPLY_LH = *mut ICMPV6_ECHO_REPLY_LH; +pub type ICMPV6_ECHO_REPLY = ICMPV6_ECHO_REPLY_LH; +pub type PICMPV6_ECHO_REPLY = *mut ICMPV6_ECHO_REPLY; +// #endif +STRUCT!{struct ARP_SEND_REPLY { + DestAddress: IPAddr, + SrcAddress: IPAddr, +}} +pub type PARP_SEND_REPLY = *mut ARP_SEND_REPLY; +STRUCT!{struct TCP_RESERVE_PORT_RANGE { + UpperRange: USHORT, + LowerRange: USHORT, +}} +pub type PTCP_RESERVE_PORT_RANGE = *mut TCP_RESERVE_PORT_RANGE; +STRUCT!{struct IP_ADAPTER_INDEX_MAP { + Index: ULONG, + Name: [WCHAR; MAX_ADAPTER_NAME], +}} +pub type PIP_ADAPTER_INDEX_MAP = *mut IP_ADAPTER_INDEX_MAP; +STRUCT!{struct IP_INTERFACE_INFO { + NumAdapters: ULONG, + Adapter: [IP_ADAPTER_INDEX_MAP; 1], +}} +pub type PIP_INTERFACE_INFO = *mut IP_INTERFACE_INFO; +STRUCT!{struct IP_UNIDIRECTIONAL_ADAPTER_ADDRESS { + NumAdapters: ULONG, + Address: [IPAddr; 1], +}} +pub type PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS = *mut IP_UNIDIRECTIONAL_ADAPTER_ADDRESS; +STRUCT!{struct IP_ADAPTER_ORDER_MAP { + NumAdapters: ULONG, + AdapterOrder: [ULONG; 1], +}} +pub type PIP_ADAPTER_ORDER_MAP = *mut IP_ADAPTER_ORDER_MAP; +STRUCT!{struct IP_MCAST_COUNTER_INFO { + InMcastOctets: ULONG64, + OutMcastOctets: ULONG64, + InMcastPkts: ULONG64, + OutMcastPkts: ULONG64, +}} +pub type PIP_MCAST_COUNTER_INFO = *mut IP_MCAST_COUNTER_INFO; +// IP_STATUS codes returned from IP APIs +pub const IP_STATUS_BASE: IP_STATUS = 11000; +pub const IP_SUCCESS: IP_STATUS = 0; +pub const IP_BUF_TOO_SMALL: IP_STATUS = IP_STATUS_BASE + 1; +pub const IP_DEST_NET_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 2; +pub const IP_DEST_HOST_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 3; +pub const IP_DEST_PROT_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 4; +pub const IP_DEST_PORT_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 5; +pub const IP_NO_RESOURCES: IP_STATUS = IP_STATUS_BASE + 6; +pub const IP_BAD_OPTION: IP_STATUS = IP_STATUS_BASE + 7; +pub const IP_HW_ERROR: IP_STATUS = IP_STATUS_BASE + 8; +pub const IP_PACKET_TOO_BIG: IP_STATUS = IP_STATUS_BASE + 9; +pub const IP_REQ_TIMED_OUT: IP_STATUS = IP_STATUS_BASE + 10; +pub const IP_BAD_REQ: IP_STATUS = IP_STATUS_BASE + 11; +pub const IP_BAD_ROUTE: IP_STATUS = IP_STATUS_BASE + 12; +pub const IP_TTL_EXPIRED_TRANSIT: IP_STATUS = IP_STATUS_BASE + 13; +pub const IP_TTL_EXPIRED_REASSEM: IP_STATUS = IP_STATUS_BASE + 14; +pub const IP_PARAM_PROBLEM: IP_STATUS = IP_STATUS_BASE + 15; +pub const IP_SOURCE_QUENCH: IP_STATUS = IP_STATUS_BASE + 16; +pub const IP_OPTION_TOO_BIG: IP_STATUS = IP_STATUS_BASE + 17; +pub const IP_BAD_DESTINATION: IP_STATUS = IP_STATUS_BASE + 18; +pub const IP_DEST_NO_ROUTE: IP_STATUS = IP_STATUS_BASE + 2; +pub const IP_DEST_ADDR_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 3; +pub const IP_DEST_PROHIBITED: IP_STATUS = IP_STATUS_BASE + 4; +pub const IP_HOP_LIMIT_EXCEEDED: IP_STATUS = IP_STATUS_BASE + 13; +pub const IP_REASSEMBLY_TIME_EXCEEDED: IP_STATUS = IP_STATUS_BASE + 14; +pub const IP_PARAMETER_PROBLEM: IP_STATUS = IP_STATUS_BASE + 15; +pub const IP_DEST_UNREACHABLE: IP_STATUS = IP_STATUS_BASE + 40; +pub const IP_TIME_EXCEEDED: IP_STATUS = IP_STATUS_BASE + 41; +pub const IP_BAD_HEADER: IP_STATUS = IP_STATUS_BASE + 42; +pub const IP_UNRECOGNIZED_NEXT_HEADER: IP_STATUS = IP_STATUS_BASE + 43; +pub const IP_ICMP_ERROR: IP_STATUS = IP_STATUS_BASE + 44; +pub const IP_DEST_SCOPE_MISMATCH: IP_STATUS = IP_STATUS_BASE + 45; +pub const IP_ADDR_DELETED: IP_STATUS = IP_STATUS_BASE + 19; +pub const IP_SPEC_MTU_CHANGE: IP_STATUS = IP_STATUS_BASE + 20; +pub const IP_MTU_CHANGE: IP_STATUS = IP_STATUS_BASE + 21; +pub const IP_UNLOAD: IP_STATUS = IP_STATUS_BASE + 22; +pub const IP_ADDR_ADDED: IP_STATUS = IP_STATUS_BASE + 23; +pub const IP_MEDIA_CONNECT: IP_STATUS = IP_STATUS_BASE + 24; +pub const IP_MEDIA_DISCONNECT: IP_STATUS = IP_STATUS_BASE + 25; +pub const IP_BIND_ADAPTER: IP_STATUS = IP_STATUS_BASE + 26; +pub const IP_UNBIND_ADAPTER: IP_STATUS = IP_STATUS_BASE + 27; +pub const IP_DEVICE_DOES_NOT_EXIST: IP_STATUS = IP_STATUS_BASE + 28; +pub const IP_DUPLICATE_ADDRESS: IP_STATUS = IP_STATUS_BASE + 29; +pub const IP_INTERFACE_METRIC_CHANGE: IP_STATUS = IP_STATUS_BASE + 30; +pub const IP_RECONFIG_SECFLTR: IP_STATUS = IP_STATUS_BASE + 31; +pub const IP_NEGOTIATING_IPSEC: IP_STATUS = IP_STATUS_BASE + 32; +pub const IP_INTERFACE_WOL_CAPABILITY_CHANGE: IP_STATUS = IP_STATUS_BASE + 33; +pub const IP_DUPLICATE_IPADD: IP_STATUS = IP_STATUS_BASE + 34; +pub const IP_GENERAL_FAILURE: IP_STATUS = IP_STATUS_BASE + 50; +pub const MAX_IP_STATUS: IP_STATUS = IP_GENERAL_FAILURE; +pub const IP_PENDING: IP_STATUS = IP_STATUS_BASE + 255; +pub const IP_FLAG_REVERSE: UCHAR = 0x1; +pub const IP_FLAG_DF: UCHAR = 0x2; +pub const IP_OPT_EOL: u8 = 0; +pub const IP_OPT_NOP: u8 = 1; +pub const IP_OPT_SECURITY: u8 = 0x82; +pub const IP_OPT_LSRR: u8 = 0x83; +pub const IP_OPT_SSRR: u8 = 0x89; +pub const IP_OPT_RR: u8 = 0x7; +pub const IP_OPT_TS: u8 = 0x44; +pub const IP_OPT_SID: u8 = 0x88; +pub const IP_OPT_ROUTER_ALERT: u8 = 0x94; diff --git a/bash-5.1/vendor/winapi/src/um/iphlpapi.rs b/bash-5.1/vendor/winapi/src/um/iphlpapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..926545b0d6905319a56dd8b852ae2da098789690 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/iphlpapi.rs @@ -0,0 +1,521 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// #include +// #include +// #include +// #include +use shared::basetsd::{PULONG64, ULONG64}; +use shared::ifdef::NET_LUID; +use shared::ifmib::{PMIB_IFROW, PMIB_IFTABLE}; +use shared::ipmib::{ + PMIB_ICMP, PMIB_ICMP_EX, PMIB_IPADDRTABLE, PMIB_IPFORWARDROW, PMIB_IPFORWARDTABLE, + PMIB_IPNETROW, PMIB_IPNETTABLE, PMIB_IPSTATS +}; +use shared::iprtrmib::{TCPIP_OWNER_MODULE_INFO_CLASS, TCP_TABLE_CLASS, UDP_TABLE_CLASS}; +use shared::minwindef::{BOOL, BYTE, DWORD, LPDWORD, PDWORD, PUCHAR, PULONG, UINT}; +use shared::ntdef::{ + BOOLEAN, HANDLE, LPWSTR, PHANDLE, PVOID, PWSTR, ULONG, ULONGLONG, USHORT, WCHAR, +}; +use shared::tcpestats::TCP_ESTATS_TYPE; +use shared::tcpmib::{ + PMIB_TCP6ROW, PMIB_TCP6ROW_OWNER_MODULE, PMIB_TCP6TABLE, PMIB_TCP6TABLE2, PMIB_TCPROW, + PMIB_TCPROW_OWNER_MODULE, PMIB_TCPSTATS, PMIB_TCPSTATS2, PMIB_TCPTABLE, PMIB_TCPTABLE2 +}; +use shared::udpmib::{ + PMIB_UDP6ROW_OWNER_MODULE, PMIB_UDP6TABLE, PMIB_UDPROW_OWNER_MODULE, PMIB_UDPSTATS, + PMIB_UDPSTATS2, PMIB_UDPTABLE +}; +use shared::ws2def::{PSOCKADDR, SOCKADDR, SOCKADDR_IN}; +use shared::ws2ipdef::SOCKADDR_IN6; +use um::ipexport::{ + IPAddr, IPMask, IP_STATUS, PIP_ADAPTER_INDEX_MAP, PIP_ADAPTER_ORDER_MAP, PIP_INTERFACE_INFO, + PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS, +}; +use um::iptypes::{ + PFIXED_INFO, PIP_ADAPTER_ADDRESSES, PIP_ADAPTER_INFO, PIP_INTERFACE_NAME_INFO, + PIP_PER_ADAPTER_INFO, +}; +use um::minwinbase::{LPOVERLAPPED,OVERLAPPED}; +extern "system" { + pub fn GetNumberOfInterfaces( + pdwNumIf: PDWORD + ) -> DWORD; + pub fn GetIfEntry( + pIfRow: PMIB_IFROW, + ) -> DWORD; + pub fn GetIfTable( + pIfTable: PMIB_IFTABLE, + pdwSize: PULONG, + bOrder: BOOL, + ) -> DWORD; + pub fn GetIpAddrTable( + pIpAddrTable: PMIB_IPADDRTABLE, + pdwSize: PULONG, + bOrder: BOOL, + ) -> DWORD; + pub fn GetIpNetTable( + IpNetTable: PMIB_IPNETTABLE, + SizePointer: PULONG, + Order: BOOL, + ) -> ULONG; + pub fn GetIpForwardTable( + pIpForwardTable: PMIB_IPFORWARDTABLE, + pdwSize: PULONG, + bOrder: BOOL, + ) -> DWORD; + pub fn GetTcpTable( + TcpTable: PMIB_TCPTABLE, + SizePointer: PULONG, + Order: BOOL, + ) -> ULONG; + // https://msdn.microsoft.com/en-us/library/windows/desktop/aa365928(v=vs.85).aspx + pub fn GetExtendedTcpTable( + pTcpTable: PVOID, + pdwSize: PDWORD, + bOrder: BOOL, + ulAf: ULONG, + TableClass: TCP_TABLE_CLASS, + Reserved: ULONG, + ) -> DWORD; + pub fn GetOwnerModuleFromTcpEntry( + pTcpEntry: PMIB_TCPROW_OWNER_MODULE, + Class: TCPIP_OWNER_MODULE_INFO_CLASS, + pBuffer: PVOID, + pdwSize: PDWORD, + ) -> DWORD; + pub fn GetUdpTable( + UdpTable: PMIB_UDPTABLE, + SizePointer: PULONG, + Order: BOOL, + ) -> ULONG; + pub fn GetExtendedUdpTable( + pUdpTable: PVOID, + pdwSize: PDWORD, + bOrder: BOOL, + ulAf: ULONG, + TableClass: UDP_TABLE_CLASS, + Reserved: ULONG, + ) -> DWORD; + pub fn GetOwnerModuleFromUdpEntry( + pUdpEntry: PMIB_UDPROW_OWNER_MODULE, + Class: TCPIP_OWNER_MODULE_INFO_CLASS, + pBuffer: PVOID, + pdwSize: PDWORD, + ) -> DWORD; + pub fn GetTcpTable2( + TcpTable: PMIB_TCPTABLE2, + SizePointer: PULONG, + Order: BOOL, + ) -> ULONG; + // Deprecated APIs, Added for documentation. + // pub fn AllocateAndGetTcpExTableFromStack() -> DWORD; + // pub fn AllocateAndGetUdpExTableFromStack() -> DWORD; + pub fn GetTcp6Table( + TcpTable: PMIB_TCP6TABLE, + SizePointer: PULONG, + Order: BOOL, + ) -> ULONG; + pub fn GetTcp6Table2( + TcpTable: PMIB_TCP6TABLE2, + SizePointer: PULONG, + Order: BOOL, + ) -> ULONG; + pub fn GetPerTcpConnectionEStats( + Row: PMIB_TCPROW, + EstatsType: TCP_ESTATS_TYPE, + Rw: PUCHAR, + RwVersion: ULONG, + RwSize: ULONG, + Ros: PUCHAR, + RosVersion: ULONG, + RosSize: ULONG, + Rod: PUCHAR, + RodVersion: ULONG, + RodSize: ULONG, + ) -> ULONG; + pub fn SetPerTcpConnectionEStats( + Row: PMIB_TCPROW, + EstatsType: TCP_ESTATS_TYPE, + Rw: PUCHAR, + RwVersion: ULONG, + RwSize: ULONG, + Offset: ULONG, + ) -> ULONG; + pub fn GetPerTcp6ConnectionEStats( + Row: PMIB_TCP6ROW, + EstatsType: TCP_ESTATS_TYPE, + Rw: PUCHAR, + RwVersion: ULONG, + RwSize: ULONG, + Ros: PUCHAR, + RosVersion: ULONG, + RosSize: ULONG, + Rod: PUCHAR, + RodVersion: ULONG, + RodSize: ULONG, + ) -> ULONG; + pub fn SetPerTcp6ConnectionEStats( + Row: PMIB_TCP6ROW, + EstatsType: TCP_ESTATS_TYPE, + Rw: PUCHAR, + RwVersion: ULONG, + RwSize: ULONG, + Offset: ULONG, + ) -> ULONG; + pub fn GetOwnerModuleFromTcp6Entry( + pTcpEntry: PMIB_TCP6ROW_OWNER_MODULE, + Class: TCPIP_OWNER_MODULE_INFO_CLASS, + pBuffer: PVOID, + pdwSize: PDWORD, + ) -> DWORD; + pub fn GetUdp6Table( + Udp6Table: PMIB_UDP6TABLE, + SizePointer: PULONG, + Order: BOOL, + ) -> ULONG; + pub fn GetOwnerModuleFromUdp6Entry( + pUdpEntry: PMIB_UDP6ROW_OWNER_MODULE, + Class: TCPIP_OWNER_MODULE_INFO_CLASS, + pBuffer: PVOID, + pdwSize: PDWORD, + ) -> DWORD; + pub fn GetOwnerModuleFromPidAndInfo( + ulPid: ULONG, + pInfo: *mut ULONGLONG, + Class: TCPIP_OWNER_MODULE_INFO_CLASS, + pBuffer: PVOID, + pdwSize: PDWORD, + ) -> DWORD; + pub fn GetIpStatistics( + Statistics: PMIB_IPSTATS, + ) -> ULONG; + pub fn GetIcmpStatistics( + Statistics: PMIB_ICMP, + ) -> ULONG; + pub fn GetTcpStatistics( + Statistics: PMIB_TCPSTATS, + ) -> ULONG; + pub fn GetUdpStatistics( + Stats: PMIB_UDPSTATS, + ) -> ULONG; + pub fn SetIpStatisticsEx( + Statistics: PMIB_IPSTATS, + Family: ULONG, + ) -> ULONG; + pub fn GetIpStatisticsEx( + Statistics: PMIB_IPSTATS, + Family: ULONG, + ) -> ULONG; + pub fn GetIcmpStatisticsEx( + Statistics: PMIB_ICMP_EX, + Family: ULONG, + ) -> ULONG; + pub fn GetTcpStatisticsEx( + Statistics: PMIB_TCPSTATS, + Family: ULONG, + ) -> ULONG; + pub fn GetUdpStatisticsEx( + Statistics: PMIB_UDPSTATS, + Family: ULONG, + ) -> ULONG; + pub fn GetTcpStatisticsEx2( + Statistics: PMIB_TCPSTATS2, + Family: ULONG, + ) -> ULONG; + pub fn GetUdpStatisticsEx2( + Statistics: PMIB_UDPSTATS2, + Family: ULONG, + ) -> ULONG; + pub fn SetIfEntry( + pIfRow: PMIB_IFROW, + ) -> DWORD; + pub fn CreateIpForwardEntry( + pRoute: PMIB_IPFORWARDROW, + ) -> DWORD; + pub fn SetIpForwardEntry( + pRoute: PMIB_IPFORWARDROW, + ) -> DWORD; + pub fn DeleteIpForwardEntry( + pRoute: PMIB_IPFORWARDROW, + ) -> DWORD; + pub fn SetIpStatistics( + pIpStats: PMIB_IPSTATS, + ) -> DWORD; + pub fn SetIpTTL( + nTTL: UINT, + ) -> DWORD; + pub fn CreateIpNetEntry( + pArpEntry: PMIB_IPNETROW, + ) -> DWORD; + pub fn SetIpNetEntry( + pArpEntry: PMIB_IPNETROW, + ) -> DWORD; + pub fn DeleteIpNetEntry( + pArpEntry: PMIB_IPNETROW, + ) -> DWORD; + pub fn FlushIpNetTable( + dwIfIndex: DWORD, + ) -> DWORD; + pub fn CreateProxyArpEntry( + dwAddress: DWORD, + dwMask: DWORD, + dwIfIndex: DWORD, + ) -> DWORD; + pub fn DeleteProxyArpEntry( + dwAddress: DWORD, + dwMask: DWORD, + dwIfIndex: DWORD, + ) -> DWORD; + pub fn SetTcpEntry( + pTcpRow: PMIB_TCPROW, + ) -> DWORD; + pub fn GetInterfaceInfo( + pIfTable: PIP_INTERFACE_INFO, + dwOutBufLen: PULONG, + ) -> DWORD; + pub fn GetUniDirectionalAdapterInfo( + pIPIfInfo: PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS, + dwOutBufLen: PULONG, + ) -> DWORD; + pub fn NhpAllocateAndGetInterfaceInfoFromStack( + ppTable: *mut PIP_INTERFACE_NAME_INFO, + pdwCount: PDWORD, + bOrder: BOOL, + hHeap: HANDLE, + dwFlags: DWORD, + ) -> DWORD; + pub fn GetBestInterface( + dwDestAddr: IPAddr, + pdwBestIfIndex: PDWORD, + ) -> DWORD; + pub fn GetBestInterfaceEx( + pDestAddr: PSOCKADDR, + pdwBestIfIndex: PDWORD, + ) -> DWORD; + pub fn GetBestRoute( + dwDestAddr: DWORD, + dwSourceAddr: DWORD, + pBestRoute: PMIB_IPFORWARDROW, + ) -> DWORD; + pub fn NotifyAddrChange( + Handle: PHANDLE, + overlapped: LPOVERLAPPED, + ) -> DWORD; + pub fn NotifyRouteChange( + Handle: PHANDLE, + overlapped: LPOVERLAPPED, + ) -> DWORD; + pub fn CancelIPChangeNotify( + notifyOverlapped: LPOVERLAPPED + ) -> BOOL; + pub fn GetAdapterIndex( + AdapterName: LPWSTR, + IfIndex: PULONG, + ) -> DWORD; + pub fn AddIPAddress( + Address: IPAddr, + IpMask: IPMask, + IfIndex: DWORD, + NTEContext: PULONG, + NTEInstance: PULONG, + ) -> DWORD; + pub fn DeleteIPAddress( + NTEContext: ULONG, + ) -> DWORD; + pub fn GetNetworkParams( + pFixedInfo: PFIXED_INFO, + pOutBufLen: PULONG, + ) -> DWORD; + pub fn GetAdaptersInfo( + AdapterInfo: PIP_ADAPTER_INFO, + SizePointer: PULONG, + ) -> ULONG; + pub fn GetAdapterOrderMap() -> PIP_ADAPTER_ORDER_MAP; + pub fn GetAdaptersAddresses( + Family: ULONG, + Flags: ULONG, + Reserved: PVOID, + AdapterAddresses: PIP_ADAPTER_ADDRESSES, + SizePointer: PULONG, + ) -> ULONG; + pub fn GetPerAdapterInfo( + IfIndex: ULONG, + pPerAdapterInfo: PIP_PER_ADAPTER_INFO, + pOutBufLen: PULONG, + ) -> DWORD; +} +STRUCT!{struct INTERFACE_TIMESTAMP_CAPABILITY_FLAGS { + PtpV2OverUdpIPv4EventMsgReceiveHw: BOOLEAN, + PtpV2OverUdpIPv4AllMsgReceiveHw: BOOLEAN, + PtpV2OverUdpIPv4EventMsgTransmitHw: BOOLEAN, + PtpV2OverUdpIPv4AllMsgTransmitHw: BOOLEAN, + PtpV2OverUdpIPv6EventMsgReceiveHw: BOOLEAN, + PtpV2OverUdpIPv6AllMsgReceiveHw: BOOLEAN, + PtpV2OverUdpIPv6EventMsgTransmitHw: BOOLEAN, + PtpV2OverUdpIPv6AllMsgTransmitHw: BOOLEAN, + AllReceiveHw: BOOLEAN, + AllTransmitHw: BOOLEAN, + TaggedTransmitHw: BOOLEAN, + AllReceiveSw: BOOLEAN, + AllTransmitSw: BOOLEAN, + TaggedTransmitSw: BOOLEAN, +}} +pub type PINTERFACE_TIMESTAMP_CAPABILITY_FLAGS = *mut INTERFACE_TIMESTAMP_CAPABILITY_FLAGS; +STRUCT!{struct INTERFACE_TIMESTAMP_CAPABILITIES { + Version: ULONG, + HardwareClockFrequencyHz: ULONG64, + CrossTimestamp: BOOLEAN, + Reserved1: ULONG64, + Reserved2: ULONG64, + TimestampFlags: INTERFACE_TIMESTAMP_CAPABILITY_FLAGS, +}} +pub type PINTERFACE_TIMESTAMP_CAPABILITIES = *mut INTERFACE_TIMESTAMP_CAPABILITIES; +STRUCT!{struct INTERFACE_HARDWARE_CROSSTIMESTAMP { + Version: ULONG, + Flags: ULONG, + SystemTimestamp1: ULONG64, + HardwareClockTimestamp: ULONG64, + SystemTimestamp2: ULONG64, +}} +pub type PINTERFACE_HARDWARE_CROSSTIMESTAMP = *mut INTERFACE_HARDWARE_CROSSTIMESTAMP; +DECLARE_HANDLE!{HIFTIMESTAMPCHANGE, HIFTIMESTAMPCHANGE__} +extern "system" { + pub fn GetInterfaceCurrentTimestampCapabilities( + InterfaceLuid: *const NET_LUID, + TimestampCapabilite: PINTERFACE_TIMESTAMP_CAPABILITIES, + ) -> DWORD; + pub fn GetInterfaceHardwareTimestampCapabilities( + InterfaceLuid: *const NET_LUID, + TimestampCapabilite: PINTERFACE_TIMESTAMP_CAPABILITIES, + ) -> DWORD; + pub fn CaptureInterfaceHardwareCrossTimestamp( + InterfaceLuid: *const NET_LUID, + CrossTimestamp: PINTERFACE_HARDWARE_CROSSTIMESTAMP, + ) -> DWORD; +} +FN!{stdcall INTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK( + CallerContext: PVOID, +) -> ()} +pub type PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK = *mut + INTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK; +extern "system" { + pub fn NotifyIfTimestampConfigChange( + CallerContext: PVOID, + Callback: PINTERFACE_TIMESTAMP_CONFIG_CHANGE_CALLBACK, + NotificationHandle: *mut HIFTIMESTAMPCHANGE, + ) -> DWORD; + pub fn CancelIfTimestampConfigChange( + NotificationHandle: HIFTIMESTAMPCHANGE, + ); + pub fn IpReleaseAddress( + AdapterInfo: PIP_ADAPTER_INDEX_MAP, + ) -> DWORD; + pub fn IpRenewAddress( + AdapterInfo: PIP_ADAPTER_INDEX_MAP, + ) -> DWORD; + pub fn SendARP( + DestIP: IPAddr, + SrcIP: IPAddr, + pMacAddr: PVOID, + PhyAddrLen: PULONG, + ) -> DWORD; + pub fn GetRTTAndHopCount( + DestIpAddress: IPAddr, + HopCount: PULONG, + MaxHops: ULONG, + RTT: PULONG, + ) -> BOOL; + pub fn GetFriendlyIfIndex( + IfIndex: DWORD, + ) -> DWORD; + pub fn EnableRouter( + pHandle: *mut HANDLE, + pOverlapped: *mut OVERLAPPED, + ) -> DWORD; + pub fn UnenableRouter( + pOverlapped: *mut OVERLAPPED, + lpdwEnableCount: LPDWORD, + ) -> DWORD; + pub fn DisableMediaSense( + pHandle: *mut HANDLE, + pOverLapped: *mut OVERLAPPED, + ) -> DWORD; + pub fn RestoreMediaSense( + pOverlapped: *mut OVERLAPPED, + lpdwEnableCount: LPDWORD, + ) -> DWORD; + pub fn GetIpErrorString( + ErrorCode: IP_STATUS, + Buffer: PWSTR, + Size: PDWORD, + ) -> DWORD; + pub fn ResolveNeighbor( + NetworkAddress: *mut SOCKADDR, + PhysicalAddress: PVOID, + PhysicalAddressLength: PULONG, + ) -> ULONG; + pub fn CreatePersistentTcpPortReservation( + StartPort: USHORT, + NumberOfPorts: USHORT, + Token: PULONG64, + ) -> ULONG; + pub fn CreatePersistentUdpPortReservation( + StartPort: USHORT, + NumberOfPorts: USHORT, + Token: PULONG64, + ) -> ULONG; + pub fn DeletePersistentTcpPortReservation( + StartPort: USHORT, + NumberOfPorts: USHORT, + ) -> ULONG; + pub fn DeletePersistentUdpPortReservation( + StartPort: USHORT, + NumberOfPorts: USHORT, + ) -> ULONG; + pub fn LookupPersistentTcpPortReservation( + StartPort: USHORT, + NumberOfPorts: USHORT, + Token: PULONG64, + ) -> ULONG; + pub fn LookupPersistentUdpPortReservation( + StartPort: USHORT, + NumberOfPorts: USHORT, + Token: PULONG64, + ) -> ULONG; +} +ENUM!{enum NET_ADDRESS_FORMAT { + NET_ADDRESS_FORMAT_UNSPECIFIED = 0, + NET_ADDRESS_DNS_NAME = 1, + NET_ADDRESS_IPV4 = 2, + NET_ADDRESS_IPV6 = 3, +}} +pub const DNS_MAX_NAME_BUFFER_LENGTH: usize = 256; +STRUCT!{struct NET_ADDRESS_INFO_u_s { + Address: [WCHAR; DNS_MAX_NAME_BUFFER_LENGTH], + Port: [WCHAR; 6], +}} +UNION!{union NET_ADDRESS_INFO_u { + [u32; 131], + NamedAddress NamedAddress_mut: NET_ADDRESS_INFO_u_s, + Ipv4Address Ipv4Address_mut: SOCKADDR_IN, + Ipv6Address Ipv6Address_mut: SOCKADDR_IN6, + IpAddress IpAddress_mut: SOCKADDR, +}} +STRUCT!{struct NET_ADDRESS_INFO { + Format: NET_ADDRESS_FORMAT, + u: NET_ADDRESS_INFO_u, +}} +pub type PNET_ADDRESS_INFO = *mut NET_ADDRESS_INFO; +extern "system" { + // #if defined (_WS2DEF_) && defined (_WS2IPDEF_) && defined(_WINDNS_INCLUDED_) + pub fn ParseNetworkString( + NetworkString: *const *mut WCHAR, + Types: DWORD, + AddressInfo: PNET_ADDRESS_INFO, + PortNumber: *mut USHORT, + PrefixLength: *mut BYTE, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/iptypes.rs b/bash-5.1/vendor/winapi/src/um/iptypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..c730a36be6e3d23d6ac80cf54e03ddbeaab0115f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/iptypes.rs @@ -0,0 +1,372 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{UINT8, ULONG64}; +use shared::guiddef::GUID; +use shared::ifdef::{ + IF_INDEX, IF_LUID, IF_OPER_STATUS, NET_IF_COMPARTMENT_ID, NET_IF_CONNECTION_TYPE, + NET_IF_NETWORK_GUID, TUNNEL_TYPE +}; +use shared::ipifcons::IFTYPE; +use shared::minwindef::{BOOL, BYTE, DWORD, UCHAR, UINT}; +use shared::nldef::{NL_DAD_STATE, NL_PREFIX_ORIGIN, NL_SUFFIX_ORIGIN}; +use shared::ntdef::{CHAR, PCHAR, PWCHAR, ULONG, ULONGLONG, WCHAR}; +use shared::ws2def::SOCKET_ADDRESS; +use ucrt::corecrt::time_t; +pub const MAX_ADAPTER_DESCRIPTION_LENGTH: usize = 128; +pub const MAX_ADAPTER_NAME_LENGTH: usize = 256; +pub const MAX_ADAPTER_ADDRESS_LENGTH: usize = 8; +pub const DEFAULT_MINIMUM_ENTITIES: usize = 32; +pub const MAX_HOSTNAME_LEN: usize = 128; +pub const MAX_DOMAIN_NAME_LEN: usize = 128; +pub const MAX_SCOPE_ID_LEN: usize = 256; +pub const MAX_DHCPV6_DUID_LENGTH: usize = 130; +pub const MAX_DNS_SUFFIX_STRING_LENGTH: usize = 256; +pub const BROADCAST_NODETYPE: usize = 1; +pub const PEER_TO_PEER_NODETYPE: usize = 2; +pub const MIXED_NODETYPE: usize = 4; +pub const HYBRID_NODETYPE: usize = 8; +STRUCT!{struct IP_ADDRESS_STRING { + String: [CHAR; 4*4], +}} +pub type PIP_ADDRESS_STRING = *mut IP_ADDRESS_STRING; +pub type IP_MASK_STRING = IP_ADDRESS_STRING; +pub type PIP_MASK_STRING = *mut IP_MASK_STRING; +STRUCT!{struct IP_ADDR_STRING { + Next: *mut IP_ADDR_STRING, + IpAddress: IP_ADDRESS_STRING, + IpMask: IP_MASK_STRING, + Context: DWORD, +}} +pub type PIP_ADDR_STRING = *mut IP_ADDR_STRING; +STRUCT!{struct IP_ADAPTER_INFO { + Next: *mut IP_ADAPTER_INFO, + ComboIndex: DWORD, + AdapterName: [CHAR; MAX_ADAPTER_NAME_LENGTH + 4], + Description: [CHAR; MAX_ADAPTER_DESCRIPTION_LENGTH + 4], + AddressLength: UINT, + Address: [BYTE; MAX_ADAPTER_ADDRESS_LENGTH], + Index: DWORD, + Type: UINT, + DhcpEnabled: UINT, + CurrentIpAddress: PIP_ADDR_STRING, + IpAddressList: IP_ADDR_STRING, + GatewayList: IP_ADDR_STRING, + DhcpServer: IP_ADDR_STRING, + HaveWins: BOOL, + PrimaryWinsServer: IP_ADDR_STRING, + SecondaryWinsServer: IP_ADDR_STRING, + LeaseObtained: time_t, + LeaseExpires: time_t, +}} +pub type PIP_ADAPTER_INFO = *mut IP_ADAPTER_INFO; +pub type IP_PREFIX_ORIGIN = NL_PREFIX_ORIGIN; +pub type IP_SUFFIX_ORIGIN = NL_SUFFIX_ORIGIN; +pub type IP_DAD_STATE = NL_DAD_STATE; +STRUCT!{struct IP_ADAPTER_UNICAST_ADDRESS_LH_u_s { + Length: ULONG, + Flags: DWORD, +}} +UNION!{union IP_ADAPTER_UNICAST_ADDRESS_LH_u { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: IP_ADAPTER_UNICAST_ADDRESS_LH_u_s, +}} +STRUCT!{struct IP_ADAPTER_UNICAST_ADDRESS_LH { + u: IP_ADAPTER_UNICAST_ADDRESS_LH_u, + Next: *mut IP_ADAPTER_UNICAST_ADDRESS_LH, + Address: SOCKET_ADDRESS, + PrefixOrigin: IP_PREFIX_ORIGIN, + SuffixOrigin: IP_SUFFIX_ORIGIN, + DadState: IP_DAD_STATE, + ValidLifetime: ULONG, + PreferredLifetime: ULONG, + LeaseLifetime: ULONG, + OnLinkPrefixLength: UINT8, +}} +pub type PIP_ADAPTER_UNICAST_ADDRESS_LH = *mut IP_ADAPTER_UNICAST_ADDRESS_LH; +STRUCT!{struct IP_ADAPTER_UNICAST_ADDRESS_XP_u_s { + Length: ULONG, + Flags: DWORD, +}} +UNION!{union IP_ADAPTER_UNICAST_ADDRESS_XP_u { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: IP_ADAPTER_UNICAST_ADDRESS_XP_u_s, +}} +STRUCT!{struct IP_ADAPTER_UNICAST_ADDRESS_XP { + u: IP_ADAPTER_UNICAST_ADDRESS_XP_u, + Next: *mut IP_ADAPTER_UNICAST_ADDRESS_XP, + Address: SOCKET_ADDRESS, + PrefixOrigin: IP_PREFIX_ORIGIN, + SuffixOrigin: IP_SUFFIX_ORIGIN, + DadState: IP_DAD_STATE, + ValidLifetime: ULONG, + PreferredLifetime: ULONG, + LeaseLifetime: ULONG, +}} +pub type PIP_ADAPTER_UNICAST_ADDRESS_XP = *mut IP_ADAPTER_UNICAST_ADDRESS_XP; +pub type IP_ADAPTER_UNICAST_ADDRESS = IP_ADAPTER_UNICAST_ADDRESS_LH; +// pub type IP_ADAPTER_UNICAST_ADDRESS = IP_ADAPTER_UNICAST_ADDRESS_XP; +pub type PIP_ADAPTER_UNICAST_ADDRESS = *mut IP_ADAPTER_UNICAST_ADDRESS; +pub const IP_ADAPTER_ADDRESS_DNS_ELIGIBLE: usize = 0x01; +pub const IP_ADAPTER_ADDRESS_TRANSIENT: usize = 0x02; +STRUCT!{struct IP_ADAPTER_ANYCAST_ADDRESS_XP_u_s { + Length: ULONG, + Flags: DWORD, +}} +UNION!{union IP_ADAPTER_ANYCAST_ADDRESS_XP_u { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: IP_ADAPTER_ANYCAST_ADDRESS_XP_u_s, +}} +STRUCT!{struct IP_ADAPTER_ANYCAST_ADDRESS_XP { + u: IP_ADAPTER_ANYCAST_ADDRESS_XP_u, + Next: *mut IP_ADAPTER_ANYCAST_ADDRESS_XP, + Address: SOCKET_ADDRESS, +}} +pub type PIP_ADAPTER_ANYCAST_ADDRESS_XP = *mut IP_ADAPTER_ANYCAST_ADDRESS_XP; +pub type IP_ADAPTER_ANYCAST_ADDRESS = IP_ADAPTER_ANYCAST_ADDRESS_XP; +pub type PIP_ADAPTER_ANYCAST_ADDRESS = *mut IP_ADAPTER_ANYCAST_ADDRESS; +STRUCT!{struct IP_ADAPTER_MULTICAST_ADDRESS_XP_u_s { + Length: ULONG, + Flags: DWORD, +}} +UNION!{union IP_ADAPTER_MULTICAST_ADDRESS_XP_u { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: IP_ADAPTER_MULTICAST_ADDRESS_XP_u_s, +}} +STRUCT!{struct IP_ADAPTER_MULTICAST_ADDRESS_XP { + u: IP_ADAPTER_MULTICAST_ADDRESS_XP_u, + Next: *mut IP_ADAPTER_MULTICAST_ADDRESS_XP, + Address: SOCKET_ADDRESS, +}} +pub type PIP_ADAPTER_MULTICAST_ADDRESS_XP = *mut IP_ADAPTER_MULTICAST_ADDRESS_XP; +pub type IP_ADAPTER_MULTICAST_ADDRESS = IP_ADAPTER_MULTICAST_ADDRESS_XP; +pub type PIP_ADAPTER_MULTICAST_ADDRESS = *mut IP_ADAPTER_MULTICAST_ADDRESS_XP; +STRUCT!{struct IP_ADAPTER_DNS_SERVER_ADDRESS_XP_u_s { + Length: ULONG, + Reserved: DWORD, +}} +UNION!{union IP_ADAPTER_DNS_SERVER_ADDRESS_XP_u { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: IP_ADAPTER_DNS_SERVER_ADDRESS_XP_u_s, +}} +STRUCT!{struct IP_ADAPTER_DNS_SERVER_ADDRESS_XP { + u: IP_ADAPTER_DNS_SERVER_ADDRESS_XP_u, + Next: *mut IP_ADAPTER_DNS_SERVER_ADDRESS_XP, + Address: SOCKET_ADDRESS, +}} +pub type PIP_ADAPTER_DNS_SERVER_ADDRESS_XP = *mut IP_ADAPTER_DNS_SERVER_ADDRESS_XP; +pub type IP_ADAPTER_DNS_SERVER_ADDRESS = IP_ADAPTER_DNS_SERVER_ADDRESS_XP; +pub type PIP_ADAPTER_DNS_SERVER_ADDRESS = *mut IP_ADAPTER_DNS_SERVER_ADDRESS_XP; +STRUCT!{struct IP_ADAPTER_WINS_SERVER_ADDRESS_LH_u_s { + Length: ULONG, + Reserved: DWORD, +}} +UNION!{union IP_ADAPTER_WINS_SERVER_ADDRESS_LH_u { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: IP_ADAPTER_WINS_SERVER_ADDRESS_LH_u_s, +}} +STRUCT!{struct IP_ADAPTER_WINS_SERVER_ADDRESS_LH { + u: IP_ADAPTER_WINS_SERVER_ADDRESS_LH_u, + Next: *mut IP_ADAPTER_WINS_SERVER_ADDRESS_LH, + Address: SOCKET_ADDRESS, +}} +pub type PIP_ADAPTER_WINS_SERVER_ADDRESS_LH = *mut IP_ADAPTER_WINS_SERVER_ADDRESS_LH; +pub type IP_ADAPTER_WINS_SERVER_ADDRESS = IP_ADAPTER_WINS_SERVER_ADDRESS_LH; +pub type PIP_ADAPTER_WINS_SERVER_ADDRESS = *mut IP_ADAPTER_WINS_SERVER_ADDRESS_LH; +STRUCT!{struct IP_ADAPTER_GATEWAY_ADDRESS_LH_u_s { + Length: ULONG, + Reserved: DWORD, +}} +UNION!{union IP_ADAPTER_GATEWAY_ADDRESS_LH_u { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: IP_ADAPTER_GATEWAY_ADDRESS_LH_u_s, +}} +STRUCT!{struct IP_ADAPTER_GATEWAY_ADDRESS_LH { + u: IP_ADAPTER_GATEWAY_ADDRESS_LH_u, + Next: *mut IP_ADAPTER_GATEWAY_ADDRESS_LH, + Address: SOCKET_ADDRESS, +}} +pub type PIP_ADAPTER_GATEWAY_ADDRESS_LH = *mut IP_ADAPTER_GATEWAY_ADDRESS_LH; +pub type IP_ADAPTER_GATEWAY_ADDRESS = IP_ADAPTER_GATEWAY_ADDRESS_LH; +pub type PIP_ADAPTER_GATEWAY_ADDRESS = *mut IP_ADAPTER_GATEWAY_ADDRESS_LH; +STRUCT!{struct IP_ADAPTER_PREFIX_XP_u_s { + Length: ULONG, + Flags: DWORD, +}} +UNION!{union IP_ADAPTER_PREFIX_XP_u { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: IP_ADAPTER_PREFIX_XP_u_s, +}} +STRUCT!{struct IP_ADAPTER_PREFIX_XP { + u: IP_ADAPTER_PREFIX_XP_u, + Next: *mut IP_ADAPTER_PREFIX_XP, + Address: SOCKET_ADDRESS, + PrefixLength: ULONG, +}} +pub type PIP_ADAPTER_PREFIX_XP = *mut IP_ADAPTER_PREFIX_XP; +pub type IP_ADAPTER_PREFIX = IP_ADAPTER_PREFIX_XP; +pub type PIP_ADAPTER_PREFIX = *mut IP_ADAPTER_PREFIX_XP; +STRUCT!{struct IP_ADAPTER_DNS_SUFFIX { + Next: *mut IP_ADAPTER_DNS_SUFFIX, + String: [WCHAR; MAX_DNS_SUFFIX_STRING_LENGTH], +}} +pub type PIP_ADAPTER_DNS_SUFFIX = *mut IP_ADAPTER_DNS_SUFFIX; +pub const IP_ADAPTER_DDNS_ENABLED: DWORD = 0x00000001; +pub const IP_ADAPTER_REGISTER_ADAPTER_SUFFIX: DWORD = 0x00000002; +pub const IP_ADAPTER_DHCP_ENABLED: DWORD = 0x00000004; +pub const IP_ADAPTER_RECEIVE_ONLY: DWORD = 0x00000008; +pub const IP_ADAPTER_NO_MULTICAST: DWORD = 0x00000010; +pub const IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG: DWORD = 0x00000020; +pub const IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED: DWORD = 0x00000040; +pub const IP_ADAPTER_IPV4_ENABLED: DWORD = 0x00000080; +pub const IP_ADAPTER_IPV6_ENABLED: DWORD = 0x00000100; +pub const IP_ADAPTER_IPV6_MANAGE_ADDRESS_CONFIG: DWORD = 0x00000200; +STRUCT!{struct IP_ADAPTER_ADDRESSES_LH_u_s { + Length: ULONG, + IfIndex: IF_INDEX, +}} +UNION!{union IP_ADAPTER_ADDRESSES_LH_u { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: IP_ADAPTER_ADDRESSES_LH_u_s, +}} +STRUCT!{struct IP_ADAPTER_ADDRESSES_LH { + u: IP_ADAPTER_ADDRESSES_LH_u, + Next: *mut IP_ADAPTER_ADDRESSES_LH, + AdapterName: PCHAR, + FirstUnicastAddress: PIP_ADAPTER_UNICAST_ADDRESS_LH, + FirstAnycastAddress: PIP_ADAPTER_ANYCAST_ADDRESS_XP, + FirstMulticastAddress: PIP_ADAPTER_MULTICAST_ADDRESS_XP, + FirstDnsServerAddress: PIP_ADAPTER_DNS_SERVER_ADDRESS_XP, + DnsSuffix: PWCHAR, + Description: PWCHAR, + FriendlyName: PWCHAR, + PhysicalAddress: [BYTE; MAX_ADAPTER_ADDRESS_LENGTH], + PhysicalAddressLength: ULONG, + Flags: ULONG, + Mtu: ULONG, + IfType: IFTYPE, + OperStatus: IF_OPER_STATUS, + Ipv6IfIndex: IF_INDEX, + ZoneIndices: [ULONG; 16], + FirstPrefix: PIP_ADAPTER_PREFIX_XP, + TransmitLinkSpeed: ULONG64, + ReceiveLinkSpeed: ULONG64, + FirstWinsServerAddress: PIP_ADAPTER_WINS_SERVER_ADDRESS_LH, + FirstGatewayAddress: PIP_ADAPTER_GATEWAY_ADDRESS_LH, + Ipv4Metric: ULONG, + Ipv6Metric: ULONG, + Luid: IF_LUID, + Dhcpv4Server: SOCKET_ADDRESS, + CompartmentId: NET_IF_COMPARTMENT_ID, + NetworkGuid: NET_IF_NETWORK_GUID, + ConnectionType: NET_IF_CONNECTION_TYPE, + TunnelType: TUNNEL_TYPE, + Dhcpv6Server: SOCKET_ADDRESS, + Dhcpv6ClientDuid: [BYTE; MAX_DHCPV6_DUID_LENGTH], + Dhcpv6ClientDuidLength: ULONG, + Dhcpv6Iaid: ULONG, + FirstDnsSuffix: PIP_ADAPTER_DNS_SUFFIX, +}} +BITFIELD!{IP_ADAPTER_ADDRESSES_LH Flags: ULONG [ + DdnsEnabled set_DdnsEnabled[0..1], + RegisterAdapterSuffix set_RegisterAdapterSuffix[1..2], + Dhcpv4Enabled set_Dhcpv4Enabled[2..3], + ReceiveOnly set_ReceiveOnly[3..4], + NoMulticast set_NoMulticast[4..5], + Ipv6OtherStatefulConfig set_Ipv6OtherStatefulConfig[5..6], + NetbiosOverTcpipEnabled set_NetbiosOverTcpipEnabled[6..7], + Ipv4Enabled set_Ipv4Enabled[7..8], + Ipv6Enabled set_Ipv6Enabled[8..9], + Ipv6ManagedAddressConfigurationSupported set_Ipv6ManagedAddressConfigurationSupported[9..10], +]} +pub type PIP_ADAPTER_ADDRESSES_LH = *mut IP_ADAPTER_ADDRESSES_LH; +STRUCT!{struct IP_ADAPTER_ADDRESSES_XP_u_s { + Length: ULONG, + IfIndex: DWORD, +}} +UNION!{union IP_ADAPTER_ADDRESSES_XP_u { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: IP_ADAPTER_ADDRESSES_XP_u_s, +}} +STRUCT!{struct IP_ADAPTER_ADDRESSES_XP { + u: IP_ADAPTER_ADDRESSES_XP_u, + Next: *mut IP_ADAPTER_ADDRESSES_XP, + AdapterName: PCHAR, + FirstUnicastAddress: PIP_ADAPTER_UNICAST_ADDRESS_XP, + FirstAnycastAddress: PIP_ADAPTER_ANYCAST_ADDRESS_XP, + FirstMulticastAddress: PIP_ADAPTER_MULTICAST_ADDRESS_XP, + FirstDnsServerAddress: PIP_ADAPTER_DNS_SERVER_ADDRESS_XP, + DnsSuffix: PWCHAR, + Description: PWCHAR, + FriendlyName: PWCHAR, + PhysicalAddress: [BYTE; MAX_ADAPTER_ADDRESS_LENGTH], + PhysicalAddressLength: DWORD, + Flags: DWORD, + Mtu: DWORD, + IfType: DWORD, + OperStatus: IF_OPER_STATUS, + Ipv6IfIndex: DWORD, + ZoneIndices: [DWORD; 16], + FirstPrefix: PIP_ADAPTER_PREFIX_XP, +}} +pub type PIP_ADAPTER_ADDRESSES_XP = *mut IP_ADAPTER_ADDRESSES_XP; +pub type IP_ADAPTER_ADDRESSES = IP_ADAPTER_ADDRESSES_LH; +// pub type IP_ADAPTER_ADDRESSES = IP_ADAPTER_ADDRESSES_XP; +pub type PIP_ADAPTER_ADDRESSES = *mut IP_ADAPTER_ADDRESSES; +pub const GAA_FLAG_SKIP_UNICAST: ULONG = 0x0001; +pub const GAA_FLAG_SKIP_ANYCAST: ULONG = 0x0002; +pub const GAA_FLAG_SKIP_MULTICAST: ULONG = 0x0004; +pub const GAA_FLAG_SKIP_DNS_SERVER: ULONG = 0x0008; +pub const GAA_FLAG_INCLUDE_PREFIX: ULONG = 0x0010; +pub const GAA_FLAG_SKIP_FRIENDLY_NAME: ULONG = 0x0020; +pub const GAA_FLAG_INCLUDE_WINS_INFO: ULONG = 0x0040; +pub const GAA_FLAG_INCLUDE_GATEWAYS: ULONG = 0x0080; +pub const GAA_FLAG_INCLUDE_ALL_INTERFACES: ULONG = 0x0100; +pub const GAA_FLAG_INCLUDE_ALL_COMPARTMENTS: ULONG = 0x0200; +pub const GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER: ULONG = 0x0400; +STRUCT!{struct IP_PER_ADAPTER_INFO_W2KSP1 { + AutoconfigEnabled: UINT, + AutoconfigActive: UINT, + CurrentDnsServer: PIP_ADDR_STRING, + DnsServerList: IP_ADDR_STRING, +}} +pub type PIP_PER_ADAPTER_INFO_W2KSP1 = *mut IP_PER_ADAPTER_INFO_W2KSP1; +pub type IP_PER_ADAPTER_INFO = IP_PER_ADAPTER_INFO_W2KSP1; +pub type PIP_PER_ADAPTER_INFO = *mut IP_PER_ADAPTER_INFO; +STRUCT!{struct FIXED_INFO_W2KSP1 { + HostName: [CHAR; MAX_HOSTNAME_LEN + 4], + DomainName: [CHAR; MAX_DOMAIN_NAME_LEN + 4], + CurrentDnsServer: PIP_ADDR_STRING, + DnsServerList: IP_ADDR_STRING, + NodeType: UINT, + ScopeId: [CHAR; MAX_SCOPE_ID_LEN + 4], + EnableRouting: UINT, + EnableProxy: UINT, + EnableDns: UINT, +}} +pub type PFIXED_INFO_W2KSP1 = *mut FIXED_INFO_W2KSP1; +pub type FIXED_INFO = FIXED_INFO_W2KSP1; +pub type PFIXED_INFO = *mut FIXED_INFO; +STRUCT!{struct IP_INTERFACE_NAME_INFO_W2KSP1 { + Index: ULONG, + MediaType: ULONG, + ConnectionType: UCHAR, + AccessType: UCHAR, + DeviceGuid: GUID, + InterfaceGuid: GUID, +}} +pub type PIP_INTERFACE_NAME_INFO_W2KSP1 = *mut IP_INTERFACE_NAME_INFO_W2KSP1; +pub type IP_INTERFACE_NAME_INFO = IP_INTERFACE_NAME_INFO_W2KSP1; +pub type PIP_INTERFACE_NAME_INFO = *mut IP_INTERFACE_NAME_INFO; diff --git a/bash-5.1/vendor/winapi/src/um/jobapi.rs b/bash-5.1/vendor/winapi/src/um/jobapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..cbe45c1dc6f44dad9cde3dc4a8e2ab79338aa6fa --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/jobapi.rs @@ -0,0 +1,14 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, PBOOL}; +use um::winnt::HANDLE; +extern "system" { + pub fn IsProcessInJob( + ProcessHandle: HANDLE, + JobHandle: HANDLE, + Result: PBOOL, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/jobapi2.rs b/bash-5.1/vendor/winapi/src/um/jobapi2.rs new file mode 100644 index 0000000000000000000000000000000000000000..98eb1e9d16185d146a100ddc7fab86c0bc5e2e70 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/jobapi2.rs @@ -0,0 +1,63 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::LONG64; +use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, UINT, ULONG}; +use shared::ntdef::{HANDLE, LPCWSTR, PCWSTR, VOID}; +use um::minwinbase::LPSECURITY_ATTRIBUTES; +use um::winnt::JOBOBJECTINFOCLASS; +STRUCT!{struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION { + MaxIops: LONG64, + MaxBandwidth: LONG64, + ReservationIops: LONG64, + VolumeName: PCWSTR, + BaseIoSize: ULONG, + ControlFlags: ULONG, +}} +extern "system" { + pub fn CreateJobObjectW( + lpJobAttributes: LPSECURITY_ATTRIBUTES, + lpName: LPCWSTR, + ) -> HANDLE; + pub fn FreeMemoryJobObject( + Buffer: *mut VOID, + ) -> (); + pub fn OpenJobObjectW( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpName: LPCWSTR, + ) -> HANDLE; + pub fn AssignProcessToJobObject( + hJob: HANDLE, + hProcess: HANDLE, + ) -> BOOL; + pub fn TerminateJobObject( + hJob: HANDLE, + uExitCode: UINT, + ) -> BOOL; + pub fn SetInformationJobObject( + hJob: HANDLE, + JobObjectInformationClass: JOBOBJECTINFOCLASS, + lpJobObjectInformation: LPVOID, + cbJovObjectInformationLength: DWORD, + ) -> BOOL; + pub fn SetIoRateControlInformationJobObject( + hJob: HANDLE, + IoRateControlInfo: *mut JOBOBJECT_IO_RATE_CONTROL_INFORMATION, + ) -> DWORD; + pub fn QueryInformationJobObject( + hJob: HANDLE, + JobObjectInformationClass: JOBOBJECTINFOCLASS, + lpJobObjectInformation: LPVOID, + cbJovObjectInformationLength: DWORD, + lpReturnLength: LPDWORD, + ) -> BOOL; + pub fn QueryIoRateControlInformationJobObject( + hJob: HANDLE, + VolumeName: PCWSTR, + InfoBlocks: *mut *mut JOBOBJECT_IO_RATE_CONTROL_INFORMATION, + InfoBlockCount: *mut ULONG, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/knownfolders.rs b/bash-5.1/vendor/winapi/src/um/knownfolders.rs new file mode 100644 index 0000000000000000000000000000000000000000..a761ce297a9952d77874c0728d42f9ac6a9a722a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/knownfolders.rs @@ -0,0 +1,287 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{FOLDERID_NetworkFolder, + 0xD20BEEC4, 0x5CA8, 0x4905, 0xAE, 0x3B, 0xBF, 0x25, 0x1E, 0xA0, 0x9B, 0x53} +DEFINE_GUID!{FOLDERID_ComputerFolder, + 0x0AC0837C, 0xBBF8, 0x452A, 0x85, 0x0D, 0x79, 0xD0, 0x8E, 0x66, 0x7C, 0xA7} +DEFINE_GUID!{FOLDERID_InternetFolder, + 0x4D9F7874, 0x4E0C, 0x4904, 0x96, 0x7B, 0x40, 0xB0, 0xD2, 0x0C, 0x3E, 0x4B} +DEFINE_GUID!{FOLDERID_ControlPanelFolder, + 0x82A74AEB, 0xAEB4, 0x465C, 0xA0, 0x14, 0xD0, 0x97, 0xEE, 0x34, 0x6D, 0x63} +DEFINE_GUID!{FOLDERID_PrintersFolder, + 0x76FC4E2D, 0xD6AD, 0x4519, 0xA6, 0x63, 0x37, 0xBD, 0x56, 0x06, 0x81, 0x85} +DEFINE_GUID!{FOLDERID_SyncManagerFolder, + 0x43668BF8, 0xC14E, 0x49B2, 0x97, 0xC9, 0x74, 0x77, 0x84, 0xD7, 0x84, 0xB7} +DEFINE_GUID!{FOLDERID_SyncSetupFolder, + 0x0f214138, 0xb1d3, 0x4a90, 0xbb, 0xa9, 0x27, 0xcb, 0xc0, 0xc5, 0x38, 0x9a} +DEFINE_GUID!{FOLDERID_ConflictFolder, + 0x4bfefb45, 0x347d, 0x4006, 0xa5, 0xbe, 0xac, 0x0c, 0xb0, 0x56, 0x71, 0x92} +DEFINE_GUID!{FOLDERID_SyncResultsFolder, + 0x289a9a43, 0xbe44, 0x4057, 0xa4, 0x1b, 0x58, 0x7a, 0x76, 0xd7, 0xe7, 0xf9} +DEFINE_GUID!{FOLDERID_RecycleBinFolder, + 0xB7534046, 0x3ECB, 0x4C18, 0xBE, 0x4E, 0x64, 0xCD, 0x4C, 0xB7, 0xD6, 0xAC} +DEFINE_GUID!{FOLDERID_ConnectionsFolder, + 0x6F0CD92B, 0x2E97, 0x45D1, 0x88, 0xFF, 0xB0, 0xD1, 0x86, 0xB8, 0xDE, 0xDD} +DEFINE_GUID!{FOLDERID_Fonts, + 0xFD228CB7, 0xAE11, 0x4AE3, 0x86, 0x4C, 0x16, 0xF3, 0x91, 0x0A, 0xB8, 0xFE} +DEFINE_GUID!{FOLDERID_Desktop, + 0xB4BFCC3A, 0xDB2C, 0x424C, 0xB0, 0x29, 0x7F, 0xE9, 0x9A, 0x87, 0xC6, 0x41} +DEFINE_GUID!{FOLDERID_Startup, + 0xB97D20BB, 0xF46A, 0x4C97, 0xBA, 0x10, 0x5E, 0x36, 0x08, 0x43, 0x08, 0x54} +DEFINE_GUID!{FOLDERID_Programs, + 0xA77F5D77, 0x2E2B, 0x44C3, 0xA6, 0xA2, 0xAB, 0xA6, 0x01, 0x05, 0x4A, 0x51} +DEFINE_GUID!{FOLDERID_StartMenu, + 0x625B53C3, 0xAB48, 0x4EC1, 0xBA, 0x1F, 0xA1, 0xEF, 0x41, 0x46, 0xFC, 0x19} +DEFINE_GUID!{FOLDERID_Recent, + 0xAE50C081, 0xEBD2, 0x438A, 0x86, 0x55, 0x8A, 0x09, 0x2E, 0x34, 0x98, 0x7A} +DEFINE_GUID!{FOLDERID_SendTo, + 0x8983036C, 0x27C0, 0x404B, 0x8F, 0x08, 0x10, 0x2D, 0x10, 0xDC, 0xFD, 0x74} +DEFINE_GUID!{FOLDERID_Documents, + 0xFDD39AD0, 0x238F, 0x46AF, 0xAD, 0xB4, 0x6C, 0x85, 0x48, 0x03, 0x69, 0xC7} +DEFINE_GUID!{FOLDERID_Favorites, + 0x1777F761, 0x68AD, 0x4D8A, 0x87, 0xBD, 0x30, 0xB7, 0x59, 0xFA, 0x33, 0xDD} +DEFINE_GUID!{FOLDERID_NetHood, + 0xC5ABBF53, 0xE17F, 0x4121, 0x89, 0x00, 0x86, 0x62, 0x6F, 0xC2, 0xC9, 0x73} +DEFINE_GUID!{FOLDERID_PrintHood, + 0x9274BD8D, 0xCFD1, 0x41C3, 0xB3, 0x5E, 0xB1, 0x3F, 0x55, 0xA7, 0x58, 0xF4} +DEFINE_GUID!{FOLDERID_Templates, + 0xA63293E8, 0x664E, 0x48DB, 0xA0, 0x79, 0xDF, 0x75, 0x9E, 0x05, 0x09, 0xF7} +DEFINE_GUID!{FOLDERID_CommonStartup, + 0x82A5EA35, 0xD9CD, 0x47C5, 0x96, 0x29, 0xE1, 0x5D, 0x2F, 0x71, 0x4E, 0x6E} +DEFINE_GUID!{FOLDERID_CommonPrograms, + 0x0139D44E, 0x6AFE, 0x49F2, 0x86, 0x90, 0x3D, 0xAF, 0xCA, 0xE6, 0xFF, 0xB8} +DEFINE_GUID!{FOLDERID_CommonStartMenu, + 0xA4115719, 0xD62E, 0x491D, 0xAA, 0x7C, 0xE7, 0x4B, 0x8B, 0xE3, 0xB0, 0x67} +DEFINE_GUID!{FOLDERID_PublicDesktop, + 0xC4AA340D, 0xF20F, 0x4863, 0xAF, 0xEF, 0xF8, 0x7E, 0xF2, 0xE6, 0xBA, 0x25} +DEFINE_GUID!{FOLDERID_ProgramData, + 0x62AB5D82, 0xFDC1, 0x4DC3, 0xA9, 0xDD, 0x07, 0x0D, 0x1D, 0x49, 0x5D, 0x97} +DEFINE_GUID!{FOLDERID_CommonTemplates, + 0xB94237E7, 0x57AC, 0x4347, 0x91, 0x51, 0xB0, 0x8C, 0x6C, 0x32, 0xD1, 0xF7} +DEFINE_GUID!{FOLDERID_PublicDocuments, + 0xED4824AF, 0xDCE4, 0x45A8, 0x81, 0xE2, 0xFC, 0x79, 0x65, 0x08, 0x36, 0x34} +DEFINE_GUID!{FOLDERID_RoamingAppData, + 0x3EB685DB, 0x65F9, 0x4CF6, 0xA0, 0x3A, 0xE3, 0xEF, 0x65, 0x72, 0x9F, 0x3D} +DEFINE_GUID!{FOLDERID_LocalAppData, + 0xF1B32785, 0x6FBA, 0x4FCF, 0x9D, 0x55, 0x7B, 0x8E, 0x7F, 0x15, 0x70, 0x91} +DEFINE_GUID!{FOLDERID_LocalAppDataLow, + 0xA520A1A4, 0x1780, 0x4FF6, 0xBD, 0x18, 0x16, 0x73, 0x43, 0xC5, 0xAF, 0x16} +DEFINE_GUID!{FOLDERID_InternetCache, + 0x352481E8, 0x33BE, 0x4251, 0xBA, 0x85, 0x60, 0x07, 0xCA, 0xED, 0xCF, 0x9D} +DEFINE_GUID!{FOLDERID_Cookies, + 0x2B0F765D, 0xC0E9, 0x4171, 0x90, 0x8E, 0x08, 0xA6, 0x11, 0xB8, 0x4F, 0xF6} +DEFINE_GUID!{FOLDERID_History, + 0xD9DC8A3B, 0xB784, 0x432E, 0xA7, 0x81, 0x5A, 0x11, 0x30, 0xA7, 0x59, 0x63} +DEFINE_GUID!{FOLDERID_System, + 0x1AC14E77, 0x02E7, 0x4E5D, 0xB7, 0x44, 0x2E, 0xB1, 0xAE, 0x51, 0x98, 0xB7} +DEFINE_GUID!{FOLDERID_SystemX86, + 0xD65231B0, 0xB2F1, 0x4857, 0xA4, 0xCE, 0xA8, 0xE7, 0xC6, 0xEA, 0x7D, 0x27} +DEFINE_GUID!{FOLDERID_Windows, + 0xF38BF404, 0x1D43, 0x42F2, 0x93, 0x05, 0x67, 0xDE, 0x0B, 0x28, 0xFC, 0x23} +DEFINE_GUID!{FOLDERID_Profile, + 0x5E6C858F, 0x0E22, 0x4760, 0x9A, 0xFE, 0xEA, 0x33, 0x17, 0xB6, 0x71, 0x73} +DEFINE_GUID!{FOLDERID_Pictures, + 0x33E28130, 0x4E1E, 0x4676, 0x83, 0x5A, 0x98, 0x39, 0x5C, 0x3B, 0xC3, 0xBB} +DEFINE_GUID!{FOLDERID_ProgramFilesX86, + 0x7C5A40EF, 0xA0FB, 0x4BFC, 0x87, 0x4A, 0xC0, 0xF2, 0xE0, 0xB9, 0xFA, 0x8E} +DEFINE_GUID!{FOLDERID_ProgramFilesCommonX86, + 0xDE974D24, 0xD9C6, 0x4D3E, 0xBF, 0x91, 0xF4, 0x45, 0x51, 0x20, 0xB9, 0x17} +DEFINE_GUID!{FOLDERID_ProgramFilesX64, + 0x6d809377, 0x6af0, 0x444b, 0x89, 0x57, 0xa3, 0x77, 0x3f, 0x02, 0x20, 0x0e} +DEFINE_GUID!{FOLDERID_ProgramFilesCommonX64, + 0x6365d5a7, 0x0f0d, 0x45e5, 0x87, 0xf6, 0x0d, 0xa5, 0x6b, 0x6a, 0x4f, 0x7d} +DEFINE_GUID!{FOLDERID_ProgramFiles, + 0x905e63b6, 0xc1bf, 0x494e, 0xb2, 0x9c, 0x65, 0xb7, 0x32, 0xd3, 0xd2, 0x1a} +DEFINE_GUID!{FOLDERID_ProgramFilesCommon, + 0xF7F1ED05, 0x9F6D, 0x47A2, 0xAA, 0xAE, 0x29, 0xD3, 0x17, 0xC6, 0xF0, 0x66} +DEFINE_GUID!{FOLDERID_UserProgramFiles, + 0x5cd7aee2, 0x2219, 0x4a67, 0xb8, 0x5d, 0x6c, 0x9c, 0xe1, 0x56, 0x60, 0xcb} +DEFINE_GUID!{FOLDERID_UserProgramFilesCommon, + 0xbcbd3057, 0xca5c, 0x4622, 0xb4, 0x2d, 0xbc, 0x56, 0xdb, 0x0a, 0xe5, 0x16} +DEFINE_GUID!{FOLDERID_AdminTools, + 0x724EF170, 0xA42D, 0x4FEF, 0x9F, 0x26, 0xB6, 0x0E, 0x84, 0x6F, 0xBA, 0x4F} +DEFINE_GUID!{FOLDERID_CommonAdminTools, + 0xD0384E7D, 0xBAC3, 0x4797, 0x8F, 0x14, 0xCB, 0xA2, 0x29, 0xB3, 0x92, 0xB5} +DEFINE_GUID!{FOLDERID_Music, + 0x4BD8D571, 0x6D19, 0x48D3, 0xBE, 0x97, 0x42, 0x22, 0x20, 0x08, 0x0E, 0x43} +DEFINE_GUID!{FOLDERID_Videos, + 0x18989B1D, 0x99B5, 0x455B, 0x84, 0x1C, 0xAB, 0x7C, 0x74, 0xE4, 0xDD, 0xFC} +DEFINE_GUID!{FOLDERID_Ringtones, + 0xC870044B, 0xF49E, 0x4126, 0xA9, 0xC3, 0xB5, 0x2A, 0x1F, 0xF4, 0x11, 0xE8} +DEFINE_GUID!{FOLDERID_PublicPictures, + 0xB6EBFB86, 0x6907, 0x413C, 0x9A, 0xF7, 0x4F, 0xC2, 0xAB, 0xF0, 0x7C, 0xC5} +DEFINE_GUID!{FOLDERID_PublicMusic, + 0x3214FAB5, 0x9757, 0x4298, 0xBB, 0x61, 0x92, 0xA9, 0xDE, 0xAA, 0x44, 0xFF} +DEFINE_GUID!{FOLDERID_PublicVideos, + 0x2400183A, 0x6185, 0x49FB, 0xA2, 0xD8, 0x4A, 0x39, 0x2A, 0x60, 0x2B, 0xA3} +DEFINE_GUID!{FOLDERID_PublicRingtones, + 0xE555AB60, 0x153B, 0x4D17, 0x9F, 0x04, 0xA5, 0xFE, 0x99, 0xFC, 0x15, 0xEC} +DEFINE_GUID!{FOLDERID_ResourceDir, + 0x8AD10C31, 0x2ADB, 0x4296, 0xA8, 0xF7, 0xE4, 0x70, 0x12, 0x32, 0xC9, 0x72} +DEFINE_GUID!{FOLDERID_LocalizedResourcesDir, + 0x2A00375E, 0x224C, 0x49DE, 0xB8, 0xD1, 0x44, 0x0D, 0xF7, 0xEF, 0x3D, 0xDC} +DEFINE_GUID!{FOLDERID_CommonOEMLinks, + 0xC1BAE2D0, 0x10DF, 0x4334, 0xBE, 0xDD, 0x7A, 0xA2, 0x0B, 0x22, 0x7A, 0x9D} +DEFINE_GUID!{FOLDERID_CDBurning, + 0x9E52AB10, 0xF80D, 0x49DF, 0xAC, 0xB8, 0x43, 0x30, 0xF5, 0x68, 0x78, 0x55} +DEFINE_GUID!{FOLDERID_UserProfiles, + 0x0762D272, 0xC50A, 0x4BB0, 0xA3, 0x82, 0x69, 0x7D, 0xCD, 0x72, 0x9B, 0x80} +DEFINE_GUID!{FOLDERID_Playlists, + 0xDE92C1C7, 0x837F, 0x4F69, 0xA3, 0xBB, 0x86, 0xE6, 0x31, 0x20, 0x4A, 0x23} +DEFINE_GUID!{FOLDERID_SamplePlaylists, + 0x15CA69B3, 0x30EE, 0x49C1, 0xAC, 0xE1, 0x6B, 0x5E, 0xC3, 0x72, 0xAF, 0xB5} +DEFINE_GUID!{FOLDERID_SampleMusic, + 0xB250C668, 0xF57D, 0x4EE1, 0xA6, 0x3C, 0x29, 0x0E, 0xE7, 0xD1, 0xAA, 0x1F} +DEFINE_GUID!{FOLDERID_SamplePictures, + 0xC4900540, 0x2379, 0x4C75, 0x84, 0x4B, 0x64, 0xE6, 0xFA, 0xF8, 0x71, 0x6B} +DEFINE_GUID!{FOLDERID_SampleVideos, + 0x859EAD94, 0x2E85, 0x48AD, 0xA7, 0x1A, 0x09, 0x69, 0xCB, 0x56, 0xA6, 0xCD} +DEFINE_GUID!{FOLDERID_PhotoAlbums, + 0x69D2CF90, 0xFC33, 0x4FB7, 0x9A, 0x0C, 0xEB, 0xB0, 0xF0, 0xFC, 0xB4, 0x3C} +DEFINE_GUID!{FOLDERID_Public, + 0xDFDF76A2, 0xC82A, 0x4D63, 0x90, 0x6A, 0x56, 0x44, 0xAC, 0x45, 0x73, 0x85} +DEFINE_GUID!{FOLDERID_ChangeRemovePrograms, + 0xdf7266ac, 0x9274, 0x4867, 0x8d, 0x55, 0x3b, 0xd6, 0x61, 0xde, 0x87, 0x2d} +DEFINE_GUID!{FOLDERID_AppUpdates, + 0xa305ce99, 0xf527, 0x492b, 0x8b, 0x1a, 0x7e, 0x76, 0xfa, 0x98, 0xd6, 0xe4} +DEFINE_GUID!{FOLDERID_AddNewPrograms, + 0xde61d971, 0x5ebc, 0x4f02, 0xa3, 0xa9, 0x6c, 0x82, 0x89, 0x5e, 0x5c, 0x04} +DEFINE_GUID!{FOLDERID_Downloads, + 0x374de290, 0x123f, 0x4565, 0x91, 0x64, 0x39, 0xc4, 0x92, 0x5e, 0x46, 0x7b} +DEFINE_GUID!{FOLDERID_PublicDownloads, + 0x3d644c9b, 0x1fb8, 0x4f30, 0x9b, 0x45, 0xf6, 0x70, 0x23, 0x5f, 0x79, 0xc0} +DEFINE_GUID!{FOLDERID_SavedSearches, + 0x7d1d3a04, 0xdebb, 0x4115, 0x95, 0xcf, 0x2f, 0x29, 0xda, 0x29, 0x20, 0xda} +DEFINE_GUID!{FOLDERID_QuickLaunch, + 0x52a4f021, 0x7b75, 0x48a9, 0x9f, 0x6b, 0x4b, 0x87, 0xa2, 0x10, 0xbc, 0x8f} +DEFINE_GUID!{FOLDERID_Contacts, + 0x56784854, 0xc6cb, 0x462b, 0x81, 0x69, 0x88, 0xe3, 0x50, 0xac, 0xb8, 0x82} +DEFINE_GUID!{FOLDERID_SidebarParts, + 0xa75d362e, 0x50fc, 0x4fb7, 0xac, 0x2c, 0xa8, 0xbe, 0xaa, 0x31, 0x44, 0x93} +DEFINE_GUID!{FOLDERID_SidebarDefaultParts, + 0x7b396e54, 0x9ec5, 0x4300, 0xbe, 0x0a, 0x24, 0x82, 0xeb, 0xae, 0x1a, 0x26} +DEFINE_GUID!{FOLDERID_PublicGameTasks, + 0xdebf2536, 0xe1a8, 0x4c59, 0xb6, 0xa2, 0x41, 0x45, 0x86, 0x47, 0x6a, 0xea} +DEFINE_GUID!{FOLDERID_GameTasks, + 0x054fae61, 0x4dd8, 0x4787, 0x80, 0xb6, 0x09, 0x02, 0x20, 0xc4, 0xb7, 0x0} +DEFINE_GUID!{FOLDERID_SavedGames, + 0x4c5c32ff, 0xbb9d, 0x43b0, 0xb5, 0xb4, 0x2d, 0x72, 0xe5, 0x4e, 0xaa, 0xa4} +DEFINE_GUID!{FOLDERID_Games, + 0xcac52c1a, 0xb53d, 0x4edc, 0x92, 0xd7, 0x6b, 0x2e, 0x8a, 0xc1, 0x94, 0x34} +DEFINE_GUID!{FOLDERID_SEARCH_MAPI, + 0x98ec0e18, 0x2098, 0x4d44, 0x86, 0x44, 0x66, 0x97, 0x93, 0x15, 0xa2, 0x81} +DEFINE_GUID!{FOLDERID_SEARCH_CSC, + 0xee32e446, 0x31ca, 0x4aba, 0x81, 0x4f, 0xa5, 0xeb, 0xd2, 0xfd, 0x6d, 0x5e} +DEFINE_GUID!{FOLDERID_Links, + 0xbfb9d5e0, 0xc6a9, 0x404c, 0xb2, 0xb2, 0xae, 0x6d, 0xb6, 0xaf, 0x49, 0x68} +DEFINE_GUID!{FOLDERID_UsersFiles, + 0xf3ce0f7c, 0x4901, 0x4acc, 0x86, 0x48, 0xd5, 0xd4, 0x4b, 0x04, 0xef, 0x8f} +DEFINE_GUID!{FOLDERID_UsersLibraries, + 0xa302545d, 0xdeff, 0x464b, 0xab, 0xe8, 0x61, 0xc8, 0x64, 0x8d, 0x93, 0x9b} +DEFINE_GUID!{FOLDERID_SearchHome, + 0x190337d1, 0xb8ca, 0x4121, 0xa6, 0x39, 0x6d, 0x47, 0x2d, 0x16, 0x97, 0x2a} +DEFINE_GUID!{FOLDERID_OriginalImages, + 0x2C36C0AA, 0x5812, 0x4b87, 0xbf, 0xd0, 0x4c, 0xd0, 0xdf, 0xb1, 0x9b, 0x39} +DEFINE_GUID!{FOLDERID_DocumentsLibrary, + 0x7b0db17d, 0x9cd2, 0x4a93, 0x97, 0x33, 0x46, 0xcc, 0x89, 0x02, 0x2e, 0x7c} +DEFINE_GUID!{FOLDERID_MusicLibrary, + 0x2112ab0a, 0xc86a, 0x4ffe, 0xa3, 0x68, 0x0d, 0xe9, 0x6e, 0x47, 0x01, 0x2e} +DEFINE_GUID!{FOLDERID_PicturesLibrary, + 0xa990ae9f, 0xa03b, 0x4e80, 0x94, 0xbc, 0x99, 0x12, 0xd7, 0x50, 0x41, 0x4} +DEFINE_GUID!{FOLDERID_VideosLibrary, + 0x491e922f, 0x5643, 0x4af4, 0xa7, 0xeb, 0x4e, 0x7a, 0x13, 0x8d, 0x81, 0x74} +DEFINE_GUID!{FOLDERID_RecordedTVLibrary, + 0x1a6fdba2, 0xf42d, 0x4358, 0xa7, 0x98, 0xb7, 0x4d, 0x74, 0x59, 0x26, 0xc5} +DEFINE_GUID!{FOLDERID_HomeGroup, + 0x52528a6b, 0xb9e3, 0x4add, 0xb6, 0x0d, 0x58, 0x8c, 0x2d, 0xba, 0x84, 0x2d} +DEFINE_GUID!{FOLDERID_HomeGroupCurrentUser, + 0x9b74b6a3, 0x0dfd, 0x4f11, 0x9e, 0x78, 0x5f, 0x78, 0x00, 0xf2, 0xe7, 0x72} +DEFINE_GUID!{FOLDERID_DeviceMetadataStore, + 0x5ce4a5e9, 0xe4eb, 0x479d, 0xb8, 0x9f, 0x13, 0x0c, 0x02, 0x88, 0x61, 0x55} +DEFINE_GUID!{FOLDERID_Libraries, + 0x1b3ea5dc, 0xb587, 0x4786, 0xb4, 0xef, 0xbd, 0x1d, 0xc3, 0x32, 0xae, 0xae} +DEFINE_GUID!{FOLDERID_PublicLibraries, + 0x48daf80b, 0xe6cf, 0x4f4e, 0xb8, 0x00, 0x0e, 0x69, 0xd8, 0x4e, 0xe3, 0x84} +DEFINE_GUID!{FOLDERID_UserPinned, + 0x9e3995ab, 0x1f9c, 0x4f13, 0xb8, 0x27, 0x48, 0xb2, 0x4b, 0x6c, 0x71, 0x74} +DEFINE_GUID!{FOLDERID_ImplicitAppShortcuts, + 0xbcb5256f, 0x79f6, 0x4cee, 0xb7, 0x25, 0xdc, 0x34, 0xe4, 0x02, 0xfd, 0x46} +DEFINE_GUID!{FOLDERID_AccountPictures, + 0x008ca0b1, 0x55b4, 0x4c56, 0xb8, 0xa8, 0x4d, 0xe4, 0xb2, 0x99, 0xd3, 0xbe} +DEFINE_GUID!{FOLDERID_PublicUserTiles, + 0x0482af6c, 0x08f1, 0x4c34, 0x8c, 0x90, 0xe1, 0x7e, 0xc9, 0x8b, 0x1e, 0x17} +DEFINE_GUID!{FOLDERID_AppsFolder, + 0x1e87508d, 0x89c2, 0x42f0, 0x8a, 0x7e, 0x64, 0x5a, 0x0f, 0x50, 0xca, 0x58} +DEFINE_GUID!{FOLDERID_StartMenuAllPrograms, + 0xf26305ef, 0x6948, 0x40b9, 0xb2, 0x55, 0x81, 0x45, 0x3d, 0x09, 0xc7, 0x85} +DEFINE_GUID!{FOLDERID_CommonStartMenuPlaces, + 0xa440879f, 0x87a0, 0x4f7d, 0xb7, 0x00, 0x02, 0x07, 0xb9, 0x66, 0x19, 0x4a} +DEFINE_GUID!{FOLDERID_ApplicationShortcuts, + 0xa3918781, 0xe5f2, 0x4890, 0xb3, 0xd9, 0xa7, 0xe5, 0x43, 0x32, 0x32, 0x8c} +DEFINE_GUID!{FOLDERID_RoamingTiles, + 0x00bcfc5a, 0xed94, 0x4e48, 0x96, 0xa1, 0x3f, 0x62, 0x17, 0xf2, 0x19, 0x90} +DEFINE_GUID!{FOLDERID_RoamedTileImages, + 0xaaa8d5a5, 0xf1d6, 0x4259, 0xba, 0xa8, 0x78, 0xe7, 0xef, 0x60, 0x83, 0x5e} +DEFINE_GUID!{FOLDERID_Screenshots, + 0xb7bede81, 0xdf94, 0x4682, 0xa7, 0xd8, 0x57, 0xa5, 0x26, 0x20, 0xb8, 0x6f} +DEFINE_GUID!{FOLDERID_CameraRoll, + 0xab5fb87b, 0x7ce2, 0x4f83, 0x91, 0x5d, 0x55, 0x08, 0x46, 0xc9, 0x53, 0x7b} +DEFINE_GUID!{FOLDERID_SkyDrive, + 0xa52bba46, 0xe9e1, 0x435f, 0xb3, 0xd9, 0x28, 0xda, 0xa6, 0x48, 0xc0, 0xf6} +DEFINE_GUID!{FOLDERID_OneDrive, + 0xa52bba46, 0xe9e1, 0x435f, 0xb3, 0xd9, 0x28, 0xda, 0xa6, 0x48, 0xc0, 0xf6} +DEFINE_GUID!{FOLDERID_SkyDriveDocuments, + 0x24d89e24, 0x2f19, 0x4534, 0x9d, 0xde, 0x6a, 0x66, 0x71, 0xfb, 0xb8, 0xfe} +DEFINE_GUID!{FOLDERID_SkyDrivePictures, + 0x339719b5, 0x8c47, 0x4894, 0x94, 0xc2, 0xd8, 0xf7, 0x7a, 0xdd, 0x44, 0xa6} +DEFINE_GUID!{FOLDERID_SkyDriveMusic, + 0xc3f2459e, 0x80d6, 0x45dc, 0xbf, 0xef, 0x1f, 0x76, 0x9f, 0x2b, 0xe7, 0x30} +DEFINE_GUID!{FOLDERID_SkyDriveCameraRoll, + 0x767e6811, 0x49cb, 0x4273, 0x87, 0xc2, 0x20, 0xf3, 0x55, 0xe1, 0x08, 0x5b} +DEFINE_GUID!{FOLDERID_SearchHistory, + 0x0d4c3db6, 0x03a3, 0x462f, 0xa0, 0xe6, 0x08, 0x92, 0x4c, 0x41, 0xb5, 0xd4} +DEFINE_GUID!{FOLDERID_SearchTemplates, + 0x7e636bfe, 0xdfa9, 0x4d5e, 0xb4, 0x56, 0xd7, 0xb3, 0x98, 0x51, 0xd8, 0xa9} +DEFINE_GUID!{FOLDERID_CameraRollLibrary, + 0x2b20df75, 0x1eda, 0x4039, 0x80, 0x97, 0x38, 0x79, 0x82, 0x27, 0xd5, 0xb7} +DEFINE_GUID!{FOLDERID_SavedPictures, + 0x3b193882, 0xd3ad, 0x4eab, 0x96, 0x5a, 0x69, 0x82, 0x9d, 0x1f, 0xb5, 0x9f} +DEFINE_GUID!{FOLDERID_SavedPicturesLibrary, + 0xe25b5812, 0xbe88, 0x4bd9, 0x94, 0xb0, 0x29, 0x23, 0x34, 0x77, 0xb6, 0xc3} +DEFINE_GUID!{FOLDERID_RetailDemo, + 0x12d4c69e, 0x24ad, 0x4923, 0xbe, 0x19, 0x31, 0x32, 0x1c, 0x43, 0xa7, 0x67} +DEFINE_GUID!{FOLDERID_Device, + 0x1C2AC1DC, 0x4358, 0x4B6C, 0x97, 0x33, 0xAF, 0x21, 0x15, 0x65, 0x76, 0xF0} +DEFINE_GUID!{FOLDERID_DevelopmentFiles, + 0xdbe8e08e, 0x3053, 0x4bbc, 0xb1, 0x83, 0x2a, 0x7b, 0x2b, 0x19, 0x1e, 0x59} +DEFINE_GUID!{FOLDERID_Objects3D, + 0x31c0dd25, 0x9439, 0x4f12, 0xbf, 0x41, 0x7f, 0xf4, 0xed, 0xa3, 0x87, 0x22} +DEFINE_GUID!{FOLDERID_AppCaptures, + 0xedc0fe71, 0x98d8, 0x4f4a, 0xb9, 0x20, 0xc8, 0xdc, 0x13, 0x3c, 0xb1, 0x65} +DEFINE_GUID!{FOLDERID_LocalDocuments, + 0xf42ee2d3, 0x909f, 0x4907, 0x88, 0x71, 0x4c, 0x22, 0xfc, 0x0b, 0xf7, 0x56} +DEFINE_GUID!{FOLDERID_LocalPictures, + 0x0ddd015d, 0xb06c, 0x45d5, 0x8c, 0x4c, 0xf5, 0x97, 0x13, 0x85, 0x46, 0x39} +DEFINE_GUID!{FOLDERID_LocalVideos, + 0x35286a68, 0x3c57, 0x41a1, 0xbb, 0xb1, 0x0e, 0xae, 0x73, 0xd7, 0x6c, 0x95} +DEFINE_GUID!{FOLDERID_LocalMusic, + 0xa0c69a99, 0x21c8, 0x4671, 0x87, 0x03, 0x79, 0x34, 0x16, 0x2f, 0xcf, 0x1d} +DEFINE_GUID!{FOLDERID_LocalDownloads, + 0x7d83ee9b, 0x2244, 0x4e70, 0xb1, 0xf5, 0x53, 0x93, 0x04, 0x2a, 0xf1, 0xe4} +DEFINE_GUID!{FOLDERID_RecordedCalls, + 0x2f8b40c2, 0x83ed, 0x48ee, 0xb3, 0x83, 0xa1, 0xf1, 0x57, 0xec, 0x6f, 0x9a} +DEFINE_GUID!{FOLDERID_AllAppMods, + 0x7ad67899, 0x66af, 0x43ba, 0x91, 0x56, 0x6a, 0xad, 0x42, 0xe6, 0xc5, 0x96} +DEFINE_GUID!{FOLDERID_CurrentAppMods, + 0x3db40b20, 0x2a30, 0x4dbe, 0x91, 0x7e, 0x77, 0x1d, 0xd2, 0x1d, 0xd0, 0x99} +DEFINE_GUID!{FOLDERID_AppDataDesktop, + 0xb2c5e279, 0x7add, 0x439f, 0xb2, 0x8c, 0xc4, 0x1f, 0xe1, 0xbb, 0xf6, 0x72} +DEFINE_GUID!{FOLDERID_AppDataDocuments, + 0x7be16610, 0x1f7f, 0x44ac, 0xbf, 0xf0, 0x83, 0xe1, 0x5f, 0x2f, 0xfc, 0xa1} +DEFINE_GUID!{FOLDERID_AppDataFavorites, + 0x7cfbefbc, 0xde1f, 0x45aa, 0xb8, 0x43, 0xa5, 0x42, 0xac, 0x53, 0x6c, 0xc9} +DEFINE_GUID!{FOLDERID_AppDataProgramData, + 0x559d40a3, 0xa036, 0x40fa, 0xaf, 0x61, 0x84, 0xcb, 0x43, 0x0a, 0x4d, 0x34} diff --git a/bash-5.1/vendor/winapi/src/um/ktmw32.rs b/bash-5.1/vendor/winapi/src/um/ktmw32.rs new file mode 100644 index 0000000000000000000000000000000000000000..c1b8822475244e2c97163d3c62a3b5dc9ed9e84a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ktmw32.rs @@ -0,0 +1,63 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! FFI bindings to ktmw32. +use shared::guiddef::LPGUID; +use shared::minwindef::{BOOL, DWORD}; +use um::minwinbase::LPSECURITY_ATTRIBUTES; +use um::winnt::{HANDLE, LPWSTR}; +extern "system" { + pub fn CreateTransaction( + lpTransactionAttributes: LPSECURITY_ATTRIBUTES, + UOW: LPGUID, + CreateOptions: DWORD, + IsolationLevel: DWORD, + IsolationFlags: DWORD, + Timeout: DWORD, + Description: LPWSTR, + ) -> HANDLE; + // pub fn OpenTransaction(); + pub fn CommitTransaction( + TransactionHandle: HANDLE, + ) -> BOOL; + // pub fn CommitTransactionAsync(); + pub fn RollbackTransaction( + TransactionHandle: HANDLE, + ) -> BOOL; + // pub fn RollbackTransactionAsync(); + // pub fn GetTransactionId(); + // pub fn GetTransactionInformation(); + // pub fn SetTransactionInformation(); + // pub fn CreateTransactionManager(); + // pub fn OpenTransactionManager(); + // pub fn OpenTransactionManagerById(); + // pub fn RenameTransactionManager(); + // pub fn RollforwardTransactionManager(); + // pub fn RecoverTransactionManager(); + // pub fn GetCurrentClockTransactionManager(); + // pub fn GetTransactionManagerId(); + // pub fn CreateResourceManager(); + // pub fn OpenResourceManager(); + // pub fn RecoverResourceManager(); + // pub fn GetNotificationResourceManager(); + // pub fn GetNotificationResourceManagerAsync(); + // pub fn SetResourceManagerCompletionPort(); + // pub fn CreateEnlistment(); + // pub fn OpenEnlistment(); + // pub fn RecoverEnlistment(); + // pub fn GetEnlistmentRecoveryInformation(); + // pub fn GetEnlistmentId(); + // pub fn SetEnlistmentRecoveryInformation(); + // pub fn PrepareEnlistment(); + // pub fn PrePrepareEnlistment(); + // pub fn CommitEnlistment(); + // pub fn RollbackEnlistment(); + // pub fn PrePrepareComplete(); + // pub fn PrepareComplete(); + // pub fn ReadOnlyEnlistment(); + // pub fn CommitComplete(); + // pub fn RollbackComplete(); + // pub fn SinglePhaseReject(); +} diff --git a/bash-5.1/vendor/winapi/src/um/l2cmn.rs b/bash-5.1/vendor/winapi/src/um/l2cmn.rs new file mode 100644 index 0000000000000000000000000000000000000000..152aed13a55344f906ed3b1ccee4334821d741d8 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/l2cmn.rs @@ -0,0 +1,55 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Definitions and data structures for common layer 2. +use shared::guiddef::GUID; +use shared::minwindef::DWORD; +use um::winnt::PVOID; +pub const L2_PROFILE_MAX_NAME_LENGTH: usize = 256; +pub const L2_NOTIFICATION_SOURCE_NONE: DWORD = 0; +pub const L2_NOTIFICATION_SOURCE_DOT3_AUTO_CONFIG: DWORD = 0x00000001; +pub const L2_NOTIFICATION_SOURCE_SECURITY: DWORD = 0x00000002; +pub const L2_NOTIFICATION_SOURCE_ONEX: DWORD = 0x00000004; +pub const L2_NOTIFICATION_SOURCE_WLAN_ACM: DWORD = 0x00000008; +pub const L2_NOTIFICATION_SOURCE_WLAN_MSM: DWORD = 0x00000010; +pub const L2_NOTIFICATION_SOURCE_WLAN_SECURITY: DWORD = 0x00000020; +pub const L2_NOTIFICATION_SOURCE_WLAN_IHV: DWORD = 0x00000040; +pub const L2_NOTIFICATION_SOURCE_WLAN_HNWK: DWORD = 0x00000080; +pub const L2_NOTIFICATION_SOURCE_WCM: DWORD = 0x00000100; +pub const L2_NOTIFICATION_SOURCE_WCM_CSP: DWORD = 0x00000200; +pub const L2_NOTIFICATION_SOURCE_WFD: DWORD = 0x00000400; +pub const L2_NOTIFICATION_SOURCE_ALL: DWORD = 0x0000ffff; +pub const L2_NOTIFICATION_CODE_PUBLIC_BEGIN: DWORD = 0x00000000; +pub const L2_NOTIFICATION_CODE_GROUP_SIZE: DWORD = 0x00001000; +pub const L2_NOTIFICATION_CODE_V2_BEGIN: DWORD = L2_NOTIFICATION_CODE_PUBLIC_BEGIN + + L2_NOTIFICATION_CODE_GROUP_SIZE; +pub const L2_REASON_CODE_GROUP_SIZE: u32 = 0x10000; +pub const L2_REASON_CODE_GEN_BASE: u32 = 0x10000; +pub const L2_REASON_CODE_DOT11_AC_BASE: u32 = L2_REASON_CODE_GEN_BASE + L2_REASON_CODE_GROUP_SIZE; +pub const L2_REASON_CODE_DOT11_MSM_BASE: u32 = L2_REASON_CODE_DOT11_AC_BASE + + L2_REASON_CODE_GROUP_SIZE; +pub const L2_REASON_CODE_DOT11_SECURITY_BASE: u32 = L2_REASON_CODE_DOT11_MSM_BASE + + L2_REASON_CODE_GROUP_SIZE; +pub const L2_REASON_CODE_ONEX_BASE: u32 = L2_REASON_CODE_DOT11_SECURITY_BASE + + L2_REASON_CODE_GROUP_SIZE; +pub const L2_REASON_CODE_DOT3_AC_BASE: u32 = L2_REASON_CODE_ONEX_BASE + + L2_REASON_CODE_GROUP_SIZE; +pub const L2_REASON_CODE_DOT3_MSM_BASE: u32 = L2_REASON_CODE_DOT3_AC_BASE + + L2_REASON_CODE_GROUP_SIZE; +pub const L2_REASON_CODE_PROFILE_BASE: u32 = L2_REASON_CODE_DOT3_MSM_BASE + + L2_REASON_CODE_GROUP_SIZE; +pub const L2_REASON_CODE_IHV_BASE: u32 = L2_REASON_CODE_PROFILE_BASE + L2_REASON_CODE_GROUP_SIZE; +pub const L2_REASON_CODE_WIMAX_BASE: u32 = L2_REASON_CODE_IHV_BASE + L2_REASON_CODE_GROUP_SIZE; +pub const L2_REASON_CODE_SUCCESS: u32 = 0; +pub const L2_REASON_CODE_UNKNOWN: u32 = L2_REASON_CODE_GEN_BASE + 1; +pub const L2_REASON_CODE_PROFILE_MISSING: u32 = 0x00000001; +STRUCT!{struct L2_NOTIFICATION_DATA { + NotificationSource: DWORD, + NotificationCode: DWORD, + InterfaceGuid: GUID, + dwDataSize: DWORD, + pData: PVOID, +}} +pub type PL2_NOTIFICATION_DATA = *mut L2_NOTIFICATION_DATA; diff --git a/bash-5.1/vendor/winapi/src/um/libloaderapi.rs b/bash-5.1/vendor/winapi/src/um/libloaderapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..05e3017d2d7e48b9bb0fc0e7bdbe235892cca8fb --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/libloaderapi.rs @@ -0,0 +1,236 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-core-libraryloader-l1 +use ctypes::c_int; +use shared::basetsd::LONG_PTR; +use shared::minwindef::{ + BOOL, DWORD, FARPROC, HGLOBAL, HINSTANCE, HMODULE, HRSRC, LPVOID, UINT, WORD +}; +use um::winnt::{HANDLE, LANGID, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PCWSTR, PVOID}; +pub const GET_MODULE_HANDLE_EX_FLAG_PIN: DWORD = 0x00000001; +pub const GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT: DWORD = 0x00000002; +pub const GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS: DWORD = 0x00000004; +pub const DONT_RESOLVE_DLL_REFERENCES: DWORD = 0x00000001; +pub const LOAD_LIBRARY_AS_DATAFILE: DWORD = 0x00000002; +pub const LOAD_WITH_ALTERED_SEARCH_PATH: DWORD = 0x00000008; +pub const LOAD_IGNORE_CODE_AUTHZ_LEVEL: DWORD = 0x00000010; +pub const LOAD_LIBRARY_AS_IMAGE_RESOURCE: DWORD = 0x00000020; +pub const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: DWORD = 0x00000040; +pub const LOAD_LIBRARY_REQUIRE_SIGNED_TARGET: DWORD = 0x00000080; +pub const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: DWORD = 0x00000100; +pub const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: DWORD = 0x00000200; +pub const LOAD_LIBRARY_SEARCH_USER_DIRS: DWORD = 0x00000400; +pub const LOAD_LIBRARY_SEARCH_SYSTEM32: DWORD = 0x00000800; +pub const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: DWORD = 0x00001000; +pub const LOAD_LIBRARY_SAFE_CURRENT_DIRS: DWORD = 0x00002000; +pub const LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER: DWORD = 0x00004000; +pub const LOAD_LIBRARY_OS_INTEGRITY_CONTINUITY: DWORD = 0x00008000; +FN!{stdcall ENUMRESLANGPROCA( + hModule: HMODULE, + lpType: LPCSTR, + lpName: LPCSTR, + wLanguage: WORD, + lParam: LONG_PTR, +) -> BOOL} +FN!{stdcall ENUMRESLANGPROCW( + hModule: HMODULE, + lpType: LPCWSTR, + lpName: LPCWSTR, + wLanguage: WORD, + lParam: LONG_PTR, +) -> BOOL} +FN!{stdcall ENUMRESNAMEPROCA( + hModule: HMODULE, + lpType: LPCSTR, + lpName: LPSTR, + lParam: LONG_PTR, +) -> BOOL} +FN!{stdcall ENUMRESNAMEPROCW( + hModule: HMODULE, + lpType: LPCWSTR, + lpName: LPWSTR, + lParam: LONG_PTR, +) -> BOOL} +FN!{stdcall ENUMRESTYPEPROCA( + hModule: HMODULE, + lpType: LPSTR, + lParam: LONG_PTR, +) -> BOOL} +FN!{stdcall ENUMRESTYPEPROCW( + hModule: HMODULE, + lpType: LPWSTR, + lParam: LONG_PTR, +) -> BOOL} +extern "system" { + pub fn DisableThreadLibraryCalls( + hLibModule: HMODULE, + ) -> BOOL; + pub fn FindResourceExW( + hModule: HMODULE, + lpName: LPCWSTR, + lpType: LPCWSTR, + wLanguage: WORD, + ) -> HRSRC; + pub fn FindStringOrdinal( + dwFindStringOrdinalFlags: DWORD, + lpStringSource: LPCWSTR, + cchSource: c_int, + lpStringValue: LPCWSTR, + cchValue: c_int, + bIgnoreCase: BOOL, + ) -> c_int; + pub fn FreeLibrary( + hLibModule: HMODULE, + ) -> BOOL; + pub fn FreeLibraryAndExitThread( + hLibModule: HMODULE, + dwExitCode: DWORD, + ); + pub fn FreeResource( + hResData: HGLOBAL, + ) -> BOOL; + pub fn GetModuleFileNameA( + hModule: HMODULE, + lpFilename: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetModuleFileNameW( + hModule: HMODULE, + lpFilename: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetModuleHandleA( + lpModuleName: LPCSTR, + ) -> HMODULE; + pub fn GetModuleHandleW( + lpModuleName: LPCWSTR, + ) -> HMODULE; + pub fn GetModuleHandleExA( + dwFlags: DWORD, + lpModuleName: LPCSTR, + phModule: *mut HMODULE, + ) -> BOOL; + pub fn GetModuleHandleExW( + dwFlags: DWORD, + lpModuleName: LPCWSTR, + phModule: *mut HMODULE, + ) -> BOOL; + pub fn GetProcAddress( + hModule: HMODULE, + lpProcName: LPCSTR, + ) -> FARPROC; + pub fn LoadLibraryExA( + lpLibFileName: LPCSTR, + hFile: HANDLE, + dwFlags: DWORD, + ) -> HMODULE; + pub fn LoadLibraryExW( + lpLibFileName: LPCWSTR, + hFile: HANDLE, + dwFlags: DWORD, + ) -> HMODULE; + pub fn LoadResource( + hModule: HMODULE, + hResInfo: HRSRC, + ) -> HGLOBAL; + pub fn LoadStringA( + hInstance: HINSTANCE, + uID: UINT, + lpBuffer: LPSTR, + cchBufferMax: c_int, + ) -> c_int; + pub fn LoadStringW( + hInstance: HINSTANCE, + uID: UINT, + lpBuffer: LPWSTR, + cchBufferMax: c_int, + ) -> c_int; + pub fn LockResource( + hResData: HGLOBAL, + ) -> LPVOID; + pub fn SizeofResource( + hModule: HMODULE, + hResInfo: HRSRC, + ) -> DWORD; +} +pub type DLL_DIRECTORY_COOKIE = PVOID; +pub type PDLL_DIRECTORY_COOKIE = *mut PVOID; +extern "system" { + pub fn AddDllDirectory( + NewDirectory: PCWSTR, + ) -> DLL_DIRECTORY_COOKIE; + pub fn RemoveDllDirectory( + Cookie: DLL_DIRECTORY_COOKIE, + ) -> BOOL; + pub fn SetDefaultDllDirectories( + DirectoryFlags: DWORD, + ) -> BOOL; + pub fn EnumResourceLanguagesExA( + hModule: HMODULE, + lpType: LPCSTR, + lpName: LPCSTR, + lpEnumFunc: ENUMRESLANGPROCA, + lParam: LONG_PTR, + dwFlags: DWORD, + LangId: LANGID, + ) -> BOOL; + pub fn EnumResourceLanguagesExW( + hModule: HMODULE, + lpType: LPCWSTR, + lpName: LPCWSTR, + lpEnumFunc: ENUMRESLANGPROCW, + lParam: LONG_PTR, + dwFlags: DWORD, + LangId: LANGID, + ) -> BOOL; + pub fn EnumResourceNamesExA( + hModule: HMODULE, + lpType: LPCSTR, + lpEnumFunc: ENUMRESNAMEPROCA, + lParam: LONG_PTR, + dwFlags: DWORD, + LangId: LANGID, + ) -> BOOL; + pub fn EnumResourceNamesExW( + hModule: HMODULE, + lpType: LPCWSTR, + lpEnumFunc: ENUMRESNAMEPROCW, + lParam: LONG_PTR, + dwFlags: DWORD, + LangId: LANGID, + ) -> BOOL; + pub fn EnumResourceTypesExA( + hModule: HMODULE, + lpEnumFunc: ENUMRESTYPEPROCA, + lParam: LONG_PTR, + dwFlags: DWORD, + LangId: LANGID, + ) -> BOOL; + pub fn EnumResourceTypesExW( + hModule: HMODULE, + lpEnumFunc: ENUMRESTYPEPROCW, + lParam: LONG_PTR, + dwFlags: DWORD, + LangId: LANGID, + ) -> BOOL; + pub fn FindResourceW( + hModule: HMODULE, + lpName: LPCWSTR, + lpType: LPCWSTR, + ) -> HRSRC; + pub fn LoadLibraryA( + lpFileName: LPCSTR, + ) -> HMODULE; + pub fn LoadLibraryW( + lpFileName: LPCWSTR, + ) -> HMODULE; + pub fn EnumResourceNamesW( + hModule: HMODULE, + lpType: LPCWSTR, + lpEnumFunc: ENUMRESNAMEPROCW, + lParam: LONG_PTR, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/lmaccess.rs b/bash-5.1/vendor/winapi/src/um/lmaccess.rs new file mode 100644 index 0000000000000000000000000000000000000000..76cbab927d9960fd69a5933fae49fde382f880a7 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmaccess.rs @@ -0,0 +1,1215 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +// This file contains structures, function prototypes, and definitions +// for the NetUser, NetUserModals, NetGroup, NetAccess, and NetLogon API. +use shared::basetsd::PDWORD_PTR; +use shared::lmcons::{ENCRYPTED_PWLEN, NET_API_STATUS, PARMNUM_BASE_INFOLEVEL, PWLEN}; +use shared::minwindef::{BOOL, BYTE, DWORD, FILETIME, LPBYTE, LPDWORD, LPVOID, PBYTE, ULONG}; +use um::winnt::{BOOLEAN, LONG, LPCWSTR, LPWSTR, PSID, PVOID, PZPWSTR, SID_NAME_USE}; +extern "system" { + pub fn NetUserAdd( + servername: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetUserEnum( + servername: LPCWSTR, + level: DWORD, + filter: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetUserGetInfo( + servername: LPCWSTR, + username: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetUserSetInfo( + servername: LPCWSTR, + username: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetUserDel( + servername: LPCWSTR, + username: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetUserGetGroups( + servername: LPCWSTR, + username: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetUserSetGroups( + servername: LPCWSTR, + username: LPCWSTR, + level: DWORD, + buf: LPBYTE, + num_entries: DWORD, + ) -> NET_API_STATUS; + pub fn NetUserGetLocalGroups( + servername: LPCWSTR, + username: LPCWSTR, + level: DWORD, + flags: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetUserModalsGet( + servername: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetUserModalsSet( + servername: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetUserChangePassword( + domainname: LPCWSTR, + username: LPCWSTR, + oldpassword: LPCWSTR, + newpassword: LPCWSTR, + ) -> NET_API_STATUS; +} +STRUCT!{struct USER_INFO_0 { + usri0_name: LPWSTR, +}} +pub type PUSER_INFO_0 = *mut USER_INFO_0; +pub type LPUSER_INFO_0 = *mut USER_INFO_0; +STRUCT!{struct USER_INFO_1 { + usri1_name: LPWSTR, + usri1_password: LPWSTR, + usri1_password_age: DWORD, + usri1_priv: DWORD, + usri1_home_dir: LPWSTR, + usri1_comment: LPWSTR, + usri1_flags: DWORD, + usri1_script_path: LPWSTR, +}} +pub type PUSER_INFO_1 = *mut USER_INFO_1; +pub type LPUSER_INFO_1 = *mut USER_INFO_1; +STRUCT!{struct USER_INFO_2 { + usri2_name: LPWSTR, + usri2_password: LPWSTR, + usri2_password_age: DWORD, + usri2_priv: DWORD, + usri2_home_dir: LPWSTR, + usri2_comment: LPWSTR, + usri2_flags: DWORD, + usri2_script_path: LPWSTR, + usri2_auth_flags: DWORD, + usri2_full_name: LPWSTR, + usri2_usr_comment: LPWSTR, + usri2_parms: LPWSTR, + usri2_workstations: LPWSTR, + usri2_last_logon: DWORD, + usri2_last_logoff: DWORD, + usri2_acct_expires: DWORD, + usri2_max_storage: DWORD, + usri2_units_per_week: DWORD, + usri2_logon_hours: PBYTE, + usri2_bad_pw_count: DWORD, + usri2_num_logons: DWORD, + usri2_logon_server: LPWSTR, + usri2_country_code: DWORD, + usri2_code_page: DWORD, +}} +pub type PUSER_INFO_2 = *mut USER_INFO_2; +pub type LPUSER_INFO_2 = *mut USER_INFO_2; +STRUCT!{struct USER_INFO_3 { + usri3_name: LPWSTR, + usri3_password: LPWSTR, + usri3_password_age: DWORD, + usri3_priv: DWORD, + usri3_home_dir: LPWSTR, + usri3_comment: LPWSTR, + usri3_flags: DWORD, + usri3_script_path: LPWSTR, + usri3_auth_flags: DWORD, + usri3_full_name: LPWSTR, + usri3_usr_comment: LPWSTR, + usri3_parms: LPWSTR, + usri3_workstations: LPWSTR, + usri3_last_logon: DWORD, + usri3_last_logoff: DWORD, + usri3_acct_expires: DWORD, + usri3_max_storage: DWORD, + usri3_units_per_week: DWORD, + usri3_logon_hours: PBYTE, + usri3_bad_pw_count: DWORD, + usri3_num_logons: DWORD, + usri3_logon_server: LPWSTR, + usri3_country_code: DWORD, + usri3_code_page: DWORD, + usri3_user_id: DWORD, + usri3_primary_group_id: DWORD, + usri3_profile: LPWSTR, + usri3_home_dir_drive: LPWSTR, + usri3_password_expired: DWORD, +}} +pub type PUSER_INFO_3 = *mut USER_INFO_3; +pub type LPUSER_INFO_3 = *mut USER_INFO_3; +STRUCT!{struct USER_INFO_4 { + usri4_name: LPWSTR, + usri4_password: LPWSTR, + usri4_password_age: DWORD, + usri4_priv: DWORD, + usri4_home_dir: LPWSTR, + usri4_comment: LPWSTR, + usri4_flags: DWORD, + usri4_script_path: LPWSTR, + usri4_auth_flags: DWORD, + usri4_full_name: LPWSTR, + usri4_usr_comment: LPWSTR, + usri4_parms: LPWSTR, + usri4_workstations: LPWSTR, + usri4_last_logon: DWORD, + usri4_last_logoff: DWORD, + usri4_acct_expires: DWORD, + usri4_max_storage: DWORD, + usri4_units_per_week: DWORD, + usri4_logon_hours: PBYTE, + usri4_bad_pw_count: DWORD, + usri4_num_logons: DWORD, + usri4_logon_server: LPWSTR, + usri4_country_code: DWORD, + usri4_code_page: DWORD, + usri4_user_sid: PSID, + usri4_primary_group_id: DWORD, + usri4_profile: LPWSTR, + usri4_home_dir_drive: LPWSTR, + usri4_password_expired: DWORD, +}} +pub type PUSER_INFO_4 = *mut USER_INFO_4; +pub type LPUSER_INFO_4 = *mut USER_INFO_4; +STRUCT!{struct USER_INFO_10 { + usri10_name: LPWSTR, + usri10_comment: LPWSTR, + usri10_usr_comment: LPWSTR, + usri10_full_name: LPWSTR, +}} +pub type PUSER_INFO_10 = *mut USER_INFO_10; +pub type LPUSER_INFO_10 = *mut USER_INFO_10; +STRUCT!{struct USER_INFO_11 { + usri11_name: LPWSTR, + usri11_comment: LPWSTR, + usri11_usr_comment: LPWSTR, + usri11_full_name: LPWSTR, + usri11_priv: DWORD, + usri11_auth_flags: DWORD, + usri11_password_age: DWORD, + usri11_home_dir: LPWSTR, + usri11_parms: LPWSTR, + usri11_last_logon: DWORD, + usri11_last_logoff: DWORD, + usri11_bad_pw_count: DWORD, + usri11_num_logons: DWORD, + usri11_logon_server: LPWSTR, + usri11_country_code: DWORD, + usri11_workstations: LPWSTR, + usri11_max_storage: DWORD, + usri11_units_per_week: DWORD, + usri11_logon_hours: PBYTE, + usri11_code_page: DWORD, +}} +pub type PUSER_INFO_11 = *mut USER_INFO_11; +pub type LPUSER_INFO_11 = *mut USER_INFO_11; +STRUCT!{struct USER_INFO_20 { + usri20_name: LPWSTR, + usri20_full_name: LPWSTR, + usri20_comment: LPWSTR, + usri20_flags: DWORD, + usri20_user_id: DWORD, +}} +pub type PUSER_INFO_20 = *mut USER_INFO_20; +pub type LPUSER_INFO_20 = *mut USER_INFO_20; +STRUCT!{struct USER_INFO_21 { + usri21_password: [BYTE; ENCRYPTED_PWLEN], +}} +pub type PUSER_INFO_21 = *mut USER_INFO_21; +pub type LPUSER_INFO_21 = *mut USER_INFO_21; +STRUCT!{struct USER_INFO_22 { + usri22_name: LPWSTR, + usri22_password: [BYTE; ENCRYPTED_PWLEN], + usri22_password_age: DWORD, + usri22_priv: DWORD, + usri22_home_dir: LPWSTR, + usri22_comment: LPWSTR, + usri22_flags: DWORD, + usri22_script_path: LPWSTR, + usri22_auth_flags: DWORD, + usri22_full_name: LPWSTR, + usri22_usr_comment: LPWSTR, + usri22_parms: LPWSTR, + usri22_workstations: LPWSTR, + usri22_last_logon: DWORD, + usri22_last_logoff: DWORD, + usri22_acct_expires: DWORD, + usri22_max_storage: DWORD, + usri22_units_per_week: DWORD, + usri22_logon_hours: PBYTE, + usri22_bad_pw_count: DWORD, + usri22_num_logons: DWORD, + usri22_logon_server: LPWSTR, + usri22_country_code: DWORD, + usri22_code_page: DWORD, +}} +pub type PUSER_INFO_22 = *mut USER_INFO_22; +pub type LPUSER_INFO_22 = *mut USER_INFO_22; +STRUCT!{struct USER_INFO_23 { + usri23_name: LPWSTR, + usri23_full_name: LPWSTR, + usri23_comment: LPWSTR, + usri23_flags: DWORD, + usri23_user_sid: PSID, +}} +pub type PUSER_INFO_23 = *mut USER_INFO_23; +pub type LPUSER_INFO_23 = *mut USER_INFO_23; +STRUCT!{struct USER_INFO_24 { + usri24_internet_identity: BOOL, + usri24_flags: DWORD, + usri24_internet_provider_name: LPWSTR, + usri24_internet_principal_name: LPWSTR, + usri24_user_sid: PSID, +}} +pub type PUSER_INFO_24 = *mut USER_INFO_24; +pub type LPUSER_INFO_24 = *mut USER_INFO_24; +STRUCT!{struct USER_INFO_1003 { + usri1003_password: LPWSTR, +}} +pub type PUSER_INFO_1003 = *mut USER_INFO_1003; +pub type LPUSER_INFO_1003 = *mut USER_INFO_1003; +STRUCT!{struct USER_INFO_1005 { + usri1005_priv: DWORD, +}} +pub type PUSER_INFO_1005 = *mut USER_INFO_1005; +pub type LPUSER_INFO_1005 = *mut USER_INFO_1005; +STRUCT!{struct USER_INFO_1006 { + usri1006_home_dir: LPWSTR, +}} +pub type PUSER_INFO_1006 = *mut USER_INFO_1006; +pub type LPUSER_INFO_1006 = *mut USER_INFO_1006; +STRUCT!{struct USER_INFO_1007 { + usri1007_comment: LPWSTR, +}} +pub type PUSER_INFO_1007 = *mut USER_INFO_1007; +pub type LPUSER_INFO_1007 = *mut USER_INFO_1007; +STRUCT!{struct USER_INFO_1008 { + usri1008_flags: DWORD, +}} +pub type PUSER_INFO_1008 = *mut USER_INFO_1008; +pub type LPUSER_INFO_1008 = *mut USER_INFO_1008; +STRUCT!{struct USER_INFO_1009 { + usri1009_script_path: LPWSTR, +}} +pub type PUSER_INFO_1009 = *mut USER_INFO_1009; +pub type LPUSER_INFO_1009 = *mut USER_INFO_1009; +STRUCT!{struct USER_INFO_1010 { + usri1010_auth_flags: DWORD, +}} +pub type PUSER_INFO_1010 = *mut USER_INFO_1010; +pub type LPUSER_INFO_1010 = *mut USER_INFO_1010; +STRUCT!{struct USER_INFO_1011 { + usri1011_full_name: LPWSTR, +}} +pub type PUSER_INFO_1011 = *mut USER_INFO_1011; +pub type LPUSER_INFO_1011 = *mut USER_INFO_1011; +STRUCT!{struct USER_INFO_1012 { + usri1012_usr_comment: LPWSTR, +}} +pub type PUSER_INFO_1012 = *mut USER_INFO_1012; +pub type LPUSER_INFO_1012 = *mut USER_INFO_1012; +STRUCT!{struct USER_INFO_1013 { + usri1013_parms: LPWSTR, +}} +pub type PUSER_INFO_1013 = *mut USER_INFO_1013; +pub type LPUSER_INFO_1013 = *mut USER_INFO_1013; +STRUCT!{struct USER_INFO_1014 { + usri1014_workstations: LPWSTR, +}} +pub type PUSER_INFO_1014 = *mut USER_INFO_1014; +pub type LPUSER_INFO_1014 = *mut USER_INFO_1014; +STRUCT!{struct USER_INFO_1017 { + usri1017_acct_expires: DWORD, +}} +pub type PUSER_INFO_1017 = *mut USER_INFO_1017; +pub type LPUSER_INFO_1017 = *mut USER_INFO_1017; +STRUCT!{struct USER_INFO_1018 { + usri1018_max_storage: DWORD, +}} +pub type PUSER_INFO_1018 = *mut USER_INFO_1018; +pub type LPUSER_INFO_1018 = *mut USER_INFO_1018; +STRUCT!{struct USER_INFO_1020 { + usri1020_units_per_week: DWORD, + usri1020_logon_hours: LPBYTE, +}} +pub type PUSER_INFO_1020 = *mut USER_INFO_1020; +pub type LPUSER_INFO_1020 = *mut USER_INFO_1020; +STRUCT!{struct USER_INFO_1023 { + usri1023_logon_server: LPWSTR, +}} +pub type PUSER_INFO_1023 = *mut USER_INFO_1023; +pub type LPUSER_INFO_1023 = *mut USER_INFO_1023; +STRUCT!{struct USER_INFO_1024 { + usri1024_country_code: DWORD, +}} +pub type PUSER_INFO_1024 = *mut USER_INFO_1024; +pub type LPUSER_INFO_1024 = *mut USER_INFO_1024; +STRUCT!{struct USER_INFO_1025 { + usri1025_code_page: DWORD, +}} +pub type PUSER_INFO_1025 = *mut USER_INFO_1025; +pub type LPUSER_INFO_1025 = *mut USER_INFO_1025; +STRUCT!{struct USER_INFO_1051 { + usri1051_primary_group_id: DWORD, +}} +pub type PUSER_INFO_1051 = *mut USER_INFO_1051; +pub type LPUSER_INFO_1051 = *mut USER_INFO_1051; +STRUCT!{struct USER_INFO_1052 { + usri1052_profile: LPWSTR, +}} +pub type PUSER_INFO_1052 = *mut USER_INFO_1052; +pub type LPUSER_INFO_1052 = *mut USER_INFO_1052; +STRUCT!{struct USER_INFO_1053 { + usri1053_home_dir_drive: LPWSTR, +}} +pub type PUSER_INFO_1053 = *mut USER_INFO_1053; +pub type LPUSER_INFO_1053 = *mut USER_INFO_1053; +STRUCT!{struct USER_MODALS_INFO_0 { + usrmod0_min_passwd_len: DWORD, + usrmod0_max_passwd_age: DWORD, + usrmod0_min_passwd_age: DWORD, + usrmod0_force_logoff: DWORD, + usrmod0_password_hist_len: DWORD, +}} +pub type PUSER_MODALS_INFO_0 = *mut USER_MODALS_INFO_0; +pub type LPUSER_MODALS_INFO_0 = *mut USER_MODALS_INFO_0; +STRUCT!{struct USER_MODALS_INFO_1 { + usrmod1_role: DWORD, + usrmod1_primary: LPWSTR, +}} +pub type PUSER_MODALS_INFO_1 = *mut USER_MODALS_INFO_1; +pub type LPUSER_MODALS_INFO_1 = *mut USER_MODALS_INFO_1; +STRUCT!{struct USER_MODALS_INFO_2 { + usrmod2_domain_name: LPWSTR, + usrmod2_domain_id: PSID, +}} +pub type PUSER_MODALS_INFO_2 = *mut USER_MODALS_INFO_2; +pub type LPUSER_MODALS_INFO_2 = *mut USER_MODALS_INFO_2; +STRUCT!{struct USER_MODALS_INFO_3 { + usrmod3_lockout_duration: DWORD, + usrmod3_lockout_observation_window: DWORD, + usrmod3_lockout_threshold: DWORD, +}} +pub type PUSER_MODALS_INFO_3 = *mut USER_MODALS_INFO_3; +pub type LPUSER_MODALS_INFO_3 = *mut USER_MODALS_INFO_3; +STRUCT!{struct USER_MODALS_INFO_1001 { + usrmod1001_min_passwd_len: DWORD, +}} +pub type PUSER_MODALS_INFO_1001 = *mut USER_MODALS_INFO_1001; +pub type LPUSER_MODALS_INFO_1001 = *mut USER_MODALS_INFO_1001; +STRUCT!{struct USER_MODALS_INFO_1002 { + usrmod1002_max_passwd_age: DWORD, +}} +pub type PUSER_MODALS_INFO_1002 = *mut USER_MODALS_INFO_1002; +pub type LPUSER_MODALS_INFO_1002 = *mut USER_MODALS_INFO_1002; +STRUCT!{struct USER_MODALS_INFO_1003 { + usrmod1003_min_passwd_age: DWORD, +}} +pub type PUSER_MODALS_INFO_1003 = *mut USER_MODALS_INFO_1003; +pub type LPUSER_MODALS_INFO_1003 = *mut USER_MODALS_INFO_1003; +STRUCT!{struct USER_MODALS_INFO_1004 { + usrmod1004_force_logoff: DWORD, +}} +pub type PUSER_MODALS_INFO_1004 = *mut USER_MODALS_INFO_1004; +pub type LPUSER_MODALS_INFO_1004 = *mut USER_MODALS_INFO_1004; +STRUCT!{struct USER_MODALS_INFO_1005 { + usrmod1005_password_hist_len: DWORD, +}} +pub type PUSER_MODALS_INFO_1005 = *mut USER_MODALS_INFO_1005; +pub type LPUSER_MODALS_INFO_1005 = *mut USER_MODALS_INFO_1005; +STRUCT!{struct USER_MODALS_INFO_1006 { + usrmod1006_role: DWORD, +}} +pub type PUSER_MODALS_INFO_1006 = *mut USER_MODALS_INFO_1006; +pub type LPUSER_MODALS_INFO_1006 = *mut USER_MODALS_INFO_1006; +STRUCT!{struct USER_MODALS_INFO_1007 { + usrmod1007_primary: LPWSTR, +}} +pub type PUSER_MODALS_INFO_1007 = *mut USER_MODALS_INFO_1007; +pub type LPUSER_MODALS_INFO_1007 = *mut USER_MODALS_INFO_1007; +pub const UF_SCRIPT: DWORD = 0x0001; +pub const UF_ACCOUNTDISABLE: DWORD = 0x0002; +pub const UF_HOMEDIR_REQUIRED: DWORD = 0x0008; +pub const UF_LOCKOUT: DWORD = 0x0010; +pub const UF_PASSWD_NOTREQD: DWORD = 0x0020; +pub const UF_PASSWD_CANT_CHANGE: DWORD = 0x0040; +pub const UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED: DWORD = 0x0080; +pub const UF_TEMP_DUPLICATE_ACCOUNT: DWORD = 0x0100; +pub const UF_NORMAL_ACCOUNT: DWORD = 0x0200; +pub const UF_INTERDOMAIN_TRUST_ACCOUNT: DWORD = 0x0800; +pub const UF_WORKSTATION_TRUST_ACCOUNT: DWORD = 0x1000; +pub const UF_SERVER_TRUST_ACCOUNT: DWORD = 0x2000; +pub const UF_MACHINE_ACCOUNT_MASK: DWORD = UF_INTERDOMAIN_TRUST_ACCOUNT + | UF_WORKSTATION_TRUST_ACCOUNT | UF_SERVER_TRUST_ACCOUNT; +pub const UF_ACCOUNT_TYPE_MASK: DWORD = UF_TEMP_DUPLICATE_ACCOUNT | UF_NORMAL_ACCOUNT + | UF_INTERDOMAIN_TRUST_ACCOUNT | UF_WORKSTATION_TRUST_ACCOUNT | UF_SERVER_TRUST_ACCOUNT; +pub const UF_DONT_EXPIRE_PASSWD: DWORD = 0x10000; +pub const UF_MNS_LOGON_ACCOUNT: DWORD = 0x20000; +pub const UF_SMARTCARD_REQUIRED: DWORD = 0x40000; +pub const UF_TRUSTED_FOR_DELEGATION: DWORD = 0x80000; +pub const UF_NOT_DELEGATED: DWORD = 0x100000; +pub const UF_USE_DES_KEY_ONLY: DWORD = 0x200000; +pub const UF_DONT_REQUIRE_PREAUTH: DWORD = 0x400000; +pub const UF_PASSWORD_EXPIRED: DWORD = 0x800000; +pub const UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION: DWORD = 0x1000000; +pub const UF_NO_AUTH_DATA_REQUIRED: DWORD = 0x2000000; +pub const UF_PARTIAL_SECRETS_ACCOUNT: DWORD = 0x4000000; +pub const UF_USE_AES_KEYS: DWORD = 0x8000000; +pub const UF_SETTABLE_BITS: DWORD = UF_SCRIPT | UF_ACCOUNTDISABLE | UF_LOCKOUT + | UF_HOMEDIR_REQUIRED | UF_PASSWD_NOTREQD | UF_PASSWD_CANT_CHANGE | UF_ACCOUNT_TYPE_MASK + | UF_DONT_EXPIRE_PASSWD | UF_MNS_LOGON_ACCOUNT | UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED + | UF_SMARTCARD_REQUIRED | UF_TRUSTED_FOR_DELEGATION | UF_NOT_DELEGATED | UF_USE_DES_KEY_ONLY + | UF_DONT_REQUIRE_PREAUTH | UF_PASSWORD_EXPIRED | UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION + | UF_NO_AUTH_DATA_REQUIRED | UF_USE_AES_KEYS | UF_PARTIAL_SECRETS_ACCOUNT; +pub const FILTER_TEMP_DUPLICATE_ACCOUNT: DWORD = 0x0001; +pub const FILTER_NORMAL_ACCOUNT: DWORD = 0x0002; +pub const FILTER_INTERDOMAIN_TRUST_ACCOUNT: DWORD = 0x0008; +pub const FILTER_WORKSTATION_TRUST_ACCOUNT: DWORD = 0x0010; +pub const FILTER_SERVER_TRUST_ACCOUNT: DWORD = 0x0020; +pub const LG_INCLUDE_INDIRECT: DWORD = 0x0001; +pub const AF_OP_PRINT: DWORD = 0x1; +pub const AF_OP_COMM: DWORD = 0x2; +pub const AF_OP_SERVER: DWORD = 0x4; +pub const AF_OP_ACCOUNTS: DWORD = 0x8; +pub const AF_SETTABLE_BITS: DWORD = AF_OP_PRINT | AF_OP_COMM | AF_OP_SERVER | AF_OP_ACCOUNTS; +pub const UAS_ROLE_STANDALONE: DWORD = 0; +pub const UAS_ROLE_MEMBER: DWORD = 1; +pub const UAS_ROLE_BACKUP: DWORD = 2; +pub const UAS_ROLE_PRIMARY: DWORD = 3; +pub const USER_NAME_PARMNUM: DWORD = 1; +pub const USER_PASSWORD_PARMNUM: DWORD = 3; +pub const USER_PASSWORD_AGE_PARMNUM: DWORD = 4; +pub const USER_PRIV_PARMNUM: DWORD = 5; +pub const USER_HOME_DIR_PARMNUM: DWORD = 6; +pub const USER_COMMENT_PARMNUM: DWORD = 7; +pub const USER_FLAGS_PARMNUM: DWORD = 8; +pub const USER_SCRIPT_PATH_PARMNUM: DWORD = 9; +pub const USER_AUTH_FLAGS_PARMNUM: DWORD = 10; +pub const USER_FULL_NAME_PARMNUM: DWORD = 11; +pub const USER_USR_COMMENT_PARMNUM: DWORD = 12; +pub const USER_PARMS_PARMNUM: DWORD = 13; +pub const USER_WORKSTATIONS_PARMNUM: DWORD = 14; +pub const USER_LAST_LOGON_PARMNUM: DWORD = 15; +pub const USER_LAST_LOGOFF_PARMNUM: DWORD = 16; +pub const USER_ACCT_EXPIRES_PARMNUM: DWORD = 17; +pub const USER_MAX_STORAGE_PARMNUM: DWORD = 18; +pub const USER_UNITS_PER_WEEK_PARMNUM: DWORD = 19; +pub const USER_LOGON_HOURS_PARMNUM: DWORD = 20; +pub const USER_PAD_PW_COUNT_PARMNUM: DWORD = 21; +pub const USER_NUM_LOGONS_PARMNUM: DWORD = 22; +pub const USER_LOGON_SERVER_PARMNUM: DWORD = 23; +pub const USER_COUNTRY_CODE_PARMNUM: DWORD = 24; +pub const USER_CODE_PAGE_PARMNUM: DWORD = 25; +pub const USER_PRIMARY_GROUP_PARMNUM: DWORD = 51; +pub const USER_PROFILE: DWORD = 52; +pub const USER_PROFILE_PARMNUM: DWORD = 52; +pub const USER_HOME_DIR_DRIVE_PARMNUM: DWORD = 53; +pub const USER_NAME_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_NAME_PARMNUM; +pub const USER_PASSWORD_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_PASSWORD_PARMNUM; +pub const USER_PASSWORD_AGE_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_PASSWORD_AGE_PARMNUM; +pub const USER_PRIV_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_PRIV_PARMNUM; +pub const USER_HOME_DIR_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_HOME_DIR_PARMNUM; +pub const USER_COMMENT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_COMMENT_PARMNUM; +pub const USER_FLAGS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_FLAGS_PARMNUM; +pub const USER_SCRIPT_PATH_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_SCRIPT_PATH_PARMNUM; +pub const USER_AUTH_FLAGS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_AUTH_FLAGS_PARMNUM; +pub const USER_FULL_NAME_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_FULL_NAME_PARMNUM; +pub const USER_USR_COMMENT_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_USR_COMMENT_PARMNUM; +pub const USER_PARMS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_PARMS_PARMNUM; +pub const USER_WORKSTATIONS_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_WORKSTATIONS_PARMNUM; +pub const USER_LAST_LOGON_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_LAST_LOGON_PARMNUM; +pub const USER_LAST_LOGOFF_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_LAST_LOGOFF_PARMNUM; +pub const USER_ACCT_EXPIRES_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_ACCT_EXPIRES_PARMNUM; +pub const USER_MAX_STORAGE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_MAX_STORAGE_PARMNUM; +pub const USER_UNITS_PER_WEEK_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_UNITS_PER_WEEK_PARMNUM; +pub const USER_LOGON_HOURS_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_LOGON_HOURS_PARMNUM; +pub const USER_PAD_PW_COUNT_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_PAD_PW_COUNT_PARMNUM; +pub const USER_NUM_LOGONS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_NUM_LOGONS_PARMNUM; +pub const USER_LOGON_SERVER_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_LOGON_SERVER_PARMNUM; +pub const USER_COUNTRY_CODE_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_COUNTRY_CODE_PARMNUM; +pub const USER_CODE_PAGE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + USER_CODE_PAGE_PARMNUM; +pub const USER_PRIMARY_GROUP_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_PRIMARY_GROUP_PARMNUM; +pub const USER_HOME_DIR_DRIVE_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + USER_HOME_DIR_DRIVE_PARMNUM; +pub const NULL_USERSETINFO_PASSWD: &'static str = " "; +pub const TIMEQ_FOREVER: DWORD = -1i32 as u32; +pub const USER_MAXSTORAGE_UNLIMITED: DWORD = -1i32 as u32; +pub const USER_NO_LOGOFF: DWORD = -1i32 as u32; +pub const UNITS_PER_DAY: DWORD = 24; +pub const UNITS_PER_WEEK: DWORD = UNITS_PER_DAY * 7; +pub const USER_PRIV_MASK: DWORD = 0x3; +pub const USER_PRIV_GUEST: DWORD = 0; +pub const USER_PRIV_USER: DWORD = 1; +pub const USER_PRIV_ADMIN: DWORD = 2; +pub const MAX_PASSWD_LEN: DWORD = PWLEN; +pub const DEF_MIN_PWLEN: DWORD = 6; +pub const DEF_PWUNIQUENESS: DWORD = 5; +pub const DEF_MAX_PWHIST: DWORD = 8; +pub const DEF_MAX_PWAGE: DWORD = TIMEQ_FOREVER; +pub const DEF_MIN_PWAGE: DWORD = 0; +pub const DEF_FORCE_LOGOFF: DWORD = 0xffffffff; +pub const DEF_MAX_BADPW: DWORD = 0; +pub const ONE_DAY: DWORD = 1 * 24 * 3600; +pub const VALIDATED_LOGON: DWORD = 0; +pub const PASSWORD_EXPIRED: DWORD = 2; +pub const NON_VALIDATED_LOGON: DWORD = 3; +pub const VALID_LOGOFF: DWORD = 1; +pub const MODALS_MIN_PASSWD_LEN_PARMNUM: DWORD = 1; +pub const MODALS_MAX_PASSWD_AGE_PARMNUM: DWORD = 2; +pub const MODALS_MIN_PASSWD_AGE_PARMNUM: DWORD = 3; +pub const MODALS_FORCE_LOGOFF_PARMNUM: DWORD = 4; +pub const MODALS_PASSWD_HIST_LEN_PARMNUM: DWORD = 5; +pub const MODALS_ROLE_PARMNUM: DWORD = 6; +pub const MODALS_PRIMARY_PARMNUM: DWORD = 7; +pub const MODALS_DOMAIN_NAME_PARMNUM: DWORD = 8; +pub const MODALS_DOMAIN_ID_PARMNUM: DWORD = 9; +pub const MODALS_LOCKOUT_DURATION_PARMNUM: DWORD = 10; +pub const MODALS_LOCKOUT_OBSERVATION_WINDOW_PARMNUM: DWORD = 11; +pub const MODALS_LOCKOUT_THRESHOLD_PARMNUM: DWORD = 12; +pub const MODALS_MIN_PASSWD_LEN_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + MODALS_MIN_PASSWD_LEN_PARMNUM; +pub const MODALS_MAX_PASSWD_AGE_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + MODALS_MAX_PASSWD_AGE_PARMNUM; +pub const MODALS_MIN_PASSWD_AGE_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + MODALS_MIN_PASSWD_AGE_PARMNUM; +pub const MODALS_FORCE_LOGOFF_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + MODALS_FORCE_LOGOFF_PARMNUM; +pub const MODALS_PASSWD_HIST_LEN_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + MODALS_PASSWD_HIST_LEN_PARMNUM; +pub const MODALS_ROLE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + MODALS_ROLE_PARMNUM; +pub const MODALS_PRIMARY_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + MODALS_PRIMARY_PARMNUM; +pub const MODALS_DOMAIN_NAME_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_NAME_PARMNUM; +pub const MODALS_DOMAIN_ID_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_ID_PARMNUM; +extern "system" { + pub fn NetGroupAdd( + servername: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetGroupAddUser( + servername: LPCWSTR, + GroupName: LPCWSTR, + username: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetGroupEnum( + servername: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resume_handle: PDWORD_PTR, + ) -> NET_API_STATUS; + pub fn NetGroupGetInfo( + servername: LPCWSTR, + groupname: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetGroupSetInfo( + servername: LPCWSTR, + groupname: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetGroupDel( + servername: LPCWSTR, + groupname: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetGroupDelUser( + servername: LPCWSTR, + GroupName: LPCWSTR, + Username: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetGroupGetUsers( + servername: LPCWSTR, + groupname: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + ResumeHandle: PDWORD_PTR, + ) -> NET_API_STATUS; + pub fn NetGroupSetUsers( + servername: LPCWSTR, + groupname: LPCWSTR, + level: DWORD, + buf: LPBYTE, + totalentries: DWORD, + ) -> NET_API_STATUS; +} +STRUCT!{struct GROUP_INFO_0 { + grpi0_name: LPWSTR, +}} +pub type PGROUP_INFO_0 = *mut GROUP_INFO_0; +pub type LPGROUP_INFO_0 = *mut GROUP_INFO_0; +STRUCT!{struct GROUP_INFO_1 { + grpi1_name: LPWSTR, + grpi1_comment: LPWSTR, +}} +pub type PGROUP_INFO_1 = *mut GROUP_INFO_1; +pub type LPGROUP_INFO_1 = *mut GROUP_INFO_1; +STRUCT!{struct GROUP_INFO_2 { + grpi2_name: LPWSTR, + grpi2_comment: LPWSTR, + grpi2_group_id: DWORD, + grpi2_attributes: DWORD, +}} +pub type PGROUP_INFO_2 = *mut GROUP_INFO_2; +STRUCT!{struct GROUP_INFO_3 { + grpi3_name: LPWSTR, + grpi3_comment: LPWSTR, + grpi3_group_sid: PSID, + grpi3_attributes: DWORD, +}} +pub type PGROUP_INFO_3 = *mut GROUP_INFO_3; +STRUCT!{struct GROUP_INFO_1002 { + grpi1002_comment: LPWSTR, +}} +pub type PGROUP_INFO_1002 = *mut GROUP_INFO_1002; +pub type LPGROUP_INFO_1002 = *mut GROUP_INFO_1002; +STRUCT!{struct GROUP_INFO_1005 { + grpi1005_attributes: DWORD, +}} +pub type PGROUP_INFO_1005 = *mut GROUP_INFO_1005; +pub type LPGROUP_INFO_1005 = *mut GROUP_INFO_1005; +STRUCT!{struct GROUP_USERS_INFO_0 { + grui0_name: LPWSTR, +}} +pub type PGROUP_USERS_INFO_0 = *mut GROUP_USERS_INFO_0; +pub type LPGROUP_USERS_INFO_0 = *mut GROUP_USERS_INFO_0; +STRUCT!{struct GROUP_USERS_INFO_1 { + grui1_name: LPWSTR, + grui1_attributes: DWORD, +}} +pub type PGROUP_USERS_INFO_1 = *mut GROUP_USERS_INFO_1; +pub type LPGROUP_USERS_INFO_1 = *mut GROUP_USERS_INFO_1; +pub const GROUPIDMASK: DWORD = 0x8000; +pub const GROUP_SPECIALGRP_USERS: &'static str = "USERS"; +pub const GROUP_SPECIALGRP_ADMINS: &'static str = "ADMINS"; +pub const GROUP_SPECIALGRP_GUESTS: &'static str = "GUESTS"; +pub const GROUP_SPECIALGRP_LOCAL: &'static str = "LOCAL"; +pub const GROUP_ALL_PARMNUM: DWORD = 0; +pub const GROUP_NAME_PARMNUM: DWORD = 1; +pub const GROUP_COMMENT_PARMNUM: DWORD = 2; +pub const GROUP_ATTRIBUTES_PARMNUM: DWORD = 3; +pub const GROUP_ALL_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + GROUP_ALL_PARMNUM; +pub const GROUP_NAME_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + GROUP_NAME_PARMNUM; +pub const GROUP_COMMENT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + GROUP_COMMENT_PARMNUM; +pub const GROUP_ATTRIBUTES_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + GROUP_ATTRIBUTES_PARMNUM; +extern "system" { + pub fn NetLocalGroupAdd( + servername: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetLocalGroupAddMember( + servername: LPCWSTR, + groupname: LPCWSTR, + membersid: PSID, + ) -> NET_API_STATUS; + pub fn NetLocalGroupEnum( + servername: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: PDWORD_PTR, + ) -> NET_API_STATUS; + pub fn NetLocalGroupGetInfo( + servername: LPCWSTR, + groupname: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetLocalGroupSetInfo( + servername: LPCWSTR, + groupname: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetLocalGroupDel( + servername: LPCWSTR, + groupname: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetLocalGroupDelMember( + servername: LPCWSTR, + groupname: LPCWSTR, + membersid: PSID, + ) -> NET_API_STATUS; + pub fn NetLocalGroupGetMembers( + servername: LPCWSTR, + localgroupname: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: PDWORD_PTR, + ) -> NET_API_STATUS; + pub fn NetLocalGroupSetMembers( + servername: LPCWSTR, + groupname: LPCWSTR, + level: DWORD, + buf: LPBYTE, + totalentries: DWORD, + ) -> NET_API_STATUS; + pub fn NetLocalGroupAddMembers( + servername: LPCWSTR, + groupname: LPCWSTR, + level: DWORD, + buf: LPBYTE, + totalentries: DWORD, + ) -> NET_API_STATUS; + pub fn NetLocalGroupDelMembers( + servername: LPCWSTR, + groupname: LPCWSTR, + level: DWORD, + buf: LPBYTE, + totalentries: DWORD, + ) -> NET_API_STATUS; +} +STRUCT!{struct LOCALGROUP_INFO_0 { + lgrpi0_name: LPWSTR, +}} +pub type PLOCALGROUP_INFO_0 = *mut LOCALGROUP_INFO_0; +pub type LPLOCALGROUP_INFO_0 = *mut LOCALGROUP_INFO_0; +STRUCT!{struct LOCALGROUP_INFO_1 { + lgrpi1_name: LPWSTR, + lgrpi1_comment: LPWSTR, +}} +pub type PLOCALGROUP_INFO_1 = *mut LOCALGROUP_INFO_1; +pub type LPLOCALGROUP_INFO_1 = *mut LOCALGROUP_INFO_1; +STRUCT!{struct LOCALGROUP_INFO_1002 { + lgrpi1002_comment: LPWSTR, +}} +pub type PLOCALGROUP_INFO_1002 = *mut LOCALGROUP_INFO_1002; +pub type LPLOCALGROUP_INFO_1002 = *mut LOCALGROUP_INFO_1002; +STRUCT!{struct LOCALGROUP_MEMBERS_INFO_0 { + lgrmi0_sid: PSID, +}} +pub type PLOCALGROUP_MEMBERS_INFO_0 = *mut LOCALGROUP_MEMBERS_INFO_0; +pub type LPLOCALGROUP_MEMBERS_INFO_0 = *mut LOCALGROUP_MEMBERS_INFO_0; +STRUCT!{struct LOCALGROUP_MEMBERS_INFO_1 { + lgrmi1_sid: PSID, + lgrmi1_sidusage: SID_NAME_USE, + lgrmi1_name: LPWSTR, +}} +pub type PLOCALGROUP_MEMBERS_INFO_1 = *mut LOCALGROUP_MEMBERS_INFO_1; +pub type LPLOCALGROUP_MEMBERS_INFO_1 = *mut LOCALGROUP_MEMBERS_INFO_1; +STRUCT!{struct LOCALGROUP_MEMBERS_INFO_2 { + lgrmi2_sid: PSID, + lgrmi2_sidusage: SID_NAME_USE, + lgrmi2_domainandname: LPWSTR, +}} +pub type PLOCALGROUP_MEMBERS_INFO_2 = *mut LOCALGROUP_MEMBERS_INFO_2; +pub type LPLOCALGROUP_MEMBERS_INFO_2 = *mut LOCALGROUP_MEMBERS_INFO_2; +STRUCT!{struct LOCALGROUP_MEMBERS_INFO_3 { + lgrmi3_domainandname: LPWSTR, +}} +pub type PLOCALGROUP_MEMBERS_INFO_3 = *mut LOCALGROUP_MEMBERS_INFO_3; +pub type LPLOCALGROUP_MEMBERS_INFO_3 = *mut LOCALGROUP_MEMBERS_INFO_3; +STRUCT!{struct LOCALGROUP_USERS_INFO_0 { + lgrui0_name: LPWSTR, +}} +pub type PLOCALGROUP_USERS_INFO_0 = *mut LOCALGROUP_USERS_INFO_0; +pub type LPLOCALGROUP_USERS_INFO_0 = *mut LOCALGROUP_USERS_INFO_0; +pub const LOCALGROUP_NAME_PARMNUM: DWORD = 1; +pub const LOCALGROUP_COMMENT_PARMNUM: DWORD = 2; +extern "system" { + pub fn NetQueryDisplayInformation( + ServerName: LPCWSTR, + Level: DWORD, + Index: DWORD, + EntriesRequested: DWORD, + PreferredMaximumLength: DWORD, + ReturnedEntryCount: LPDWORD, + SortedBuffer: *mut PVOID, + ) -> NET_API_STATUS; + pub fn NetGetDisplayInformationIndex( + ServerName: LPCWSTR, + Level: DWORD, + Prefix: LPCWSTR, + Index: LPDWORD, + ) -> NET_API_STATUS; +} +STRUCT!{struct NET_DISPLAY_USER { + usri1_name: LPWSTR, + usri1_comment: LPWSTR, + usri1_flags: DWORD, + usri1_full_name: LPWSTR, + usri1_user_id: DWORD, + usri1_next_index: DWORD, +}} +pub type PNET_DISPLAY_USER = *mut NET_DISPLAY_USER; +STRUCT!{struct NET_DISPLAY_MACHINE { + usri2_name: LPWSTR, + usri2_comment: LPWSTR, + usri2_flags: DWORD, + usri2_user_id: DWORD, + usri2_next_index: DWORD, +}} +pub type PNET_DISPLAY_MACHINE = *mut NET_DISPLAY_MACHINE; +STRUCT!{struct NET_DISPLAY_GROUP { + usri3_name: LPWSTR, + usri3_comment: LPWSTR, + grpi3_group_id: DWORD, + grpi3_attributes: DWORD, + grpi3_next_index: DWORD, +}} +pub type PNET_DISPLAY_GROUP = *mut NET_DISPLAY_GROUP; +extern "system" { + pub fn NetAccessAdd( + servername: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetAccessEnum( + servername: LPCWSTR, + BasePath: LPCWSTR, + Recursive: DWORD, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resume_handle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetAccessGetInfo( + servername: LPCWSTR, + resource: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetAccessSetInfo( + servername: LPCWSTR, + resource: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetAccessDel( + servername: LPCWSTR, + resource: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetAccessGetUserPerms( + servername: LPCWSTR, + UGname: LPCWSTR, + resource: LPCWSTR, + Perms: LPDWORD, + ) -> NET_API_STATUS; +} +STRUCT!{struct ACCESS_INFO_0 { + acc0_resource_name: LPWSTR, +}} +pub type PACCESS_INFO_0 = *mut ACCESS_INFO_0; +pub type LPACCESS_INFO_0 = *mut ACCESS_INFO_0; +STRUCT!{struct ACCESS_INFO_1 { + acc1_resource_name: LPWSTR, + acc1_attr: DWORD, + acc1_count: DWORD, +}} +pub type PACCESS_INFO_1 = *mut ACCESS_INFO_1; +pub type LPACCESS_INFO_1 = *mut ACCESS_INFO_1; +STRUCT!{struct ACCESS_INFO_1002 { + acc1002_attr: DWORD, +}} +pub type PACCESS_INFO_1002 = *mut ACCESS_INFO_1002; +pub type LPACCESS_INFO_1002 = *mut ACCESS_INFO_1002; +STRUCT!{struct ACCESS_LIST { + acl_ugname: LPWSTR, + acl_access: DWORD, +}} +pub type PACCESS_LIST = *mut ACCESS_LIST; +pub type LPACCESS_LIST = *mut ACCESS_LIST; +pub const MAXPERMENTRIES: DWORD = 64; +pub const ACCESS_NONE: DWORD = 0; +pub const ACCESS_ALL: DWORD = ACCESS_READ | ACCESS_WRITE | ACCESS_CREATE | ACCESS_EXEC + | ACCESS_DELETE | ACCESS_ATRIB | ACCESS_PERM; +pub const ACCESS_READ: DWORD = 0x01; +pub const ACCESS_WRITE: DWORD = 0x02; +pub const ACCESS_CREATE: DWORD = 0x04; +pub const ACCESS_EXEC: DWORD = 0x08; +pub const ACCESS_DELETE: DWORD = 0x10; +pub const ACCESS_ATRIB: DWORD = 0x20; +pub const ACCESS_PERM: DWORD = 0x40; +pub const ACCESS_GROUP: DWORD = 0x8000; +pub const ACCESS_AUDIT: DWORD = 0x1; +pub const ACCESS_SUCCESS_OPEN: DWORD = 0x10; +pub const ACCESS_SUCCESS_WRITE: DWORD = 0x20; +pub const ACCESS_SUCCESS_DELETE: DWORD = 0x40; +pub const ACCESS_SUCCESS_ACL: DWORD = 0x80; +pub const ACCESS_SUCCESS_MASK: DWORD = 0xF0; +pub const ACCESS_FAIL_OPEN: DWORD = 0x100; +pub const ACCESS_FAIL_WRITE: DWORD = 0x200; +pub const ACCESS_FAIL_DELETE: DWORD = 0x400; +pub const ACCESS_FAIL_ACL: DWORD = 0x800; +pub const ACCESS_FAIL_MASK: DWORD = 0xF00; +pub const ACCESS_FAIL_SHIFT: DWORD = 4; +pub const ACCESS_RESOURCE_NAME_PARMNUM: DWORD = 1; +pub const ACCESS_ATTR_PARMNUM: DWORD = 2; +pub const ACCESS_COUNT_PARMNUM: DWORD = 3; +pub const ACCESS_ACCESS_LIST_PARMNUM: DWORD = 4; +pub const ACCESS_RESOURCE_NAME_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + ACCESS_RESOURCE_NAME_PARMNUM; +pub const ACCESS_ATTR_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + ACCESS_ATTR_PARMNUM; +pub const ACCESS_COUNT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + ACCESS_COUNT_PARMNUM; +pub const ACCESS_ACCESS_LIST_INFOLEVEL: DWORD = + PARMNUM_BASE_INFOLEVEL + ACCESS_ACCESS_LIST_PARMNUM; +pub const ACCESS_LETTERS: &'static str = "RWCXDAP "; +ENUM!{enum NET_VALIDATE_PASSWORD_TYPE { + NetValidateAuthentication = 1, + NetValidatePasswordChange, + NetValidatePasswordReset, +}} +pub type PNET_VALIDATE_PASSWORD_TYPE = *mut NET_VALIDATE_PASSWORD_TYPE; +STRUCT!{struct NET_VALIDATE_PASSWORD_HASH { + Length: ULONG, + Hash: LPBYTE, +}} +pub type PNET_VALIDATE_PASSWORD_HASH = *mut NET_VALIDATE_PASSWORD_HASH; +pub const NET_VALIDATE_PASSWORD_LAST_SET: ULONG = 0x00000001; +pub const NET_VALIDATE_BAD_PASSWORD_TIME: ULONG = 0x00000002; +pub const NET_VALIDATE_LOCKOUT_TIME: ULONG = 0x00000004; +pub const NET_VALIDATE_BAD_PASSWORD_COUNT: ULONG = 0x00000008; +pub const NET_VALIDATE_PASSWORD_HISTORY_LENGTH: ULONG = 0x00000010; +pub const NET_VALIDATE_PASSWORD_HISTORY: ULONG = 0x00000020; +STRUCT!{struct NET_VALIDATE_PERSISTED_FIELDS { + PresentFields: ULONG, + PasswordLastSet: FILETIME, + BadPasswordTime: FILETIME, + LockoutTime: FILETIME, + BadPasswordCount: ULONG, + PasswordHistoryLength: ULONG, + PasswordHistory: PNET_VALIDATE_PASSWORD_HASH, +}} +pub type PNET_VALIDATE_PERSISTED_FIELDS = *mut NET_VALIDATE_PERSISTED_FIELDS; +STRUCT!{struct NET_VALIDATE_OUTPUT_ARG { + ChangedPersistedFields: NET_VALIDATE_PERSISTED_FIELDS, + ValidationStatus: NET_API_STATUS, +}} +pub type PNET_VALIDATE_OUTPUT_ARG = *mut NET_VALIDATE_OUTPUT_ARG; +STRUCT!{struct NET_VALIDATE_AUTHENTICATION_INPUT_ARG { + InputPersistedFields: NET_VALIDATE_PERSISTED_FIELDS, + PasswordMatched: BOOLEAN, +}} +pub type PNET_VALIDATE_AUTHENTICATION_INPUT_ARG = *mut NET_VALIDATE_AUTHENTICATION_INPUT_ARG; +STRUCT!{struct NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG { + InputPersistedFields: NET_VALIDATE_PERSISTED_FIELDS, + ClearPassword: LPWSTR, + UserAccountName: LPWSTR, + HashedPassword: NET_VALIDATE_PASSWORD_HASH, + PasswordMatch: BOOLEAN, +}} +pub type PNET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG = *mut NET_VALIDATE_PASSWORD_CHANGE_INPUT_ARG; +STRUCT!{struct NET_VALIDATE_PASSWORD_RESET_INPUT_ARG { + InputPersistedFields: NET_VALIDATE_PERSISTED_FIELDS, + ClearPassword: LPWSTR, + UserAccountName: LPWSTR, + HashedPassword: NET_VALIDATE_PASSWORD_HASH, + PasswordMustChangeAtNextLogon: BOOLEAN, + ClearLockout: BOOLEAN, +}} +pub type PNET_VALIDATE_PASSWORD_RESET_INPUT_ARG = *mut NET_VALIDATE_PASSWORD_RESET_INPUT_ARG; +extern "system" { + pub fn NetValidatePasswordPolicy( + ServerName: LPCWSTR, + Qualifier: LPVOID, + ValidationType: NET_VALIDATE_PASSWORD_TYPE, + InputArg: LPVOID, + OutputArg: *mut LPVOID, + ) -> NET_API_STATUS; + pub fn NetValidatePasswordPolicyFree( + OutputArg: *mut LPVOID, + ) -> NET_API_STATUS; + pub fn NetGetDCName( + servername: LPCWSTR, + domainname: LPCWSTR, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetGetAnyDCName( + servername: LPCWSTR, + domainname: LPCWSTR, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn I_NetLogonControl( + ServerName: LPCWSTR, + FunctionCode: DWORD, + QueryLevel: DWORD, + Buffer: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn I_NetLogonControl2( + ServerName: LPCWSTR, + FunctionCode: DWORD, + QueryLevel: DWORD, + Data: LPBYTE, + Buffer: *mut LPBYTE, + ) -> NET_API_STATUS; +} +pub type NTSTATUS = LONG; +pub type PNTSTATUS = *mut LONG; +extern "system" { + pub fn NetEnumerateTrustedDomains( + ServerName: LPWSTR, + DomainNames: *mut LPWSTR, + ) -> NTSTATUS; +} +pub const NETLOGON_CONTROL_QUERY: DWORD = 1; +pub const NETLOGON_CONTROL_REPLICATE: DWORD = 2; +pub const NETLOGON_CONTROL_SYNCHRONIZE: DWORD = 3; +pub const NETLOGON_CONTROL_PDC_REPLICATE: DWORD = 4; +pub const NETLOGON_CONTROL_REDISCOVER: DWORD = 5; +pub const NETLOGON_CONTROL_TC_QUERY: DWORD = 6; +pub const NETLOGON_CONTROL_TRANSPORT_NOTIFY: DWORD = 7; +pub const NETLOGON_CONTROL_FIND_USER: DWORD = 8; +pub const NETLOGON_CONTROL_CHANGE_PASSWORD: DWORD = 9; +pub const NETLOGON_CONTROL_TC_VERIFY: DWORD = 10; +pub const NETLOGON_CONTROL_FORCE_DNS_REG: DWORD = 11; +pub const NETLOGON_CONTROL_QUERY_DNS_REG: DWORD = 12; +pub const NETLOGON_CONTROL_QUERY_ENC_TYPES: DWORD = 13; +pub const NETLOGON_CONTROL_UNLOAD_NETLOGON_DLL: DWORD = 0xFFFB; +pub const NETLOGON_CONTROL_BACKUP_CHANGE_LOG: DWORD = 0xFFFC; +pub const NETLOGON_CONTROL_TRUNCATE_LOG: DWORD = 0xFFFD; +pub const NETLOGON_CONTROL_SET_DBFLAG: DWORD = 0xFFFE; +pub const NETLOGON_CONTROL_BREAKPOINT: DWORD = 0xFFFF; +STRUCT!{struct NETLOGON_INFO_1 { + netlog1_flags: DWORD, + netlog1_pdc_connection_status: NET_API_STATUS, +}} +pub type PNETLOGON_INFO_1 = *mut NETLOGON_INFO_1; +STRUCT!{struct NETLOGON_INFO_2 { + netlog2_flags: DWORD, + netlog2_pdc_connection_status: NET_API_STATUS, + netlog2_trusted_dc_name: LPWSTR, + netlog2_tc_connection_status: NET_API_STATUS, +}} +pub type PNETLOGON_INFO_2 = *mut NETLOGON_INFO_2; +STRUCT!{struct NETLOGON_INFO_3 { + netlog3_flags: DWORD, + netlog3_logon_attempts: DWORD, + netlog3_reserved1: DWORD, + netlog3_reserved2: DWORD, + netlog3_reserved3: DWORD, + netlog3_reserved4: DWORD, + netlog3_reserved5: DWORD, +}} +pub type PNETLOGON_INFO_3 = *mut NETLOGON_INFO_3; +STRUCT!{struct NETLOGON_INFO_4 { + netlog4_trusted_dc_name: LPWSTR, + netlog4_trusted_domain_name: LPWSTR, +}} +pub type PNETLOGON_INFO_4 = *mut NETLOGON_INFO_4; +pub const NETLOGON_REPLICATION_NEEDED: DWORD = 0x01; +pub const NETLOGON_REPLICATION_IN_PROGRESS: DWORD = 0x02; +pub const NETLOGON_FULL_SYNC_REPLICATION: DWORD = 0x04; +pub const NETLOGON_REDO_NEEDED: DWORD = 0x08; +pub const NETLOGON_HAS_IP: DWORD = 0x10; +pub const NETLOGON_HAS_TIMESERV: DWORD = 0x20; +pub const NETLOGON_DNS_UPDATE_FAILURE: DWORD = 0x40; +pub const NETLOGON_VERIFY_STATUS_RETURNED: DWORD = 0x80; +pub const SERVICE_ACCOUNT_PASSWORD: &'static str = "_SA_{262E99C9-6160-4871-ACEC-4E61736B6F21}"; +pub const SERVICE_ACCOUNT_SECRET_PREFIX: &'static str + = "_SC_{262E99C9-6160-4871-ACEC-4E61736B6F21}_"; +DEFINE_GUID!{ServiceAccountPasswordGUID, + 0x262E99C9, 0x6160, 0x4871, 0xAC, 0xEC, 0x4E, 0x61, 0x73, 0x6B, 0x6F, 0x21} +extern "system" { + pub fn NetAddServiceAccount( + ServerName: LPWSTR, + AccountName: LPWSTR, + Password: LPWSTR, + Flags: DWORD, + ) -> NTSTATUS; +} +pub const SERVICE_ACCOUNT_FLAG_LINK_TO_HOST_ONLY: DWORD = 0x00000001; +pub const SERVICE_ACCOUNT_FLAG_ADD_AGAINST_RODC: DWORD = 0x00000002; +pub const SERVICE_ACCOUNT_FLAG_UNLINK_FROM_HOST_ONLY: DWORD = 0x00000001; +pub const SERVICE_ACCOUNT_FLAG_REMOVE_OFFLINE: DWORD = 0x00000002; +extern "system" { + pub fn NetRemoveServiceAccount( + ServerName: LPWSTR, + AccountName: LPWSTR, + Flags: DWORD, + ) -> NTSTATUS; + pub fn NetEnumerateServiceAccounts( + ServerName: LPWSTR, + Flags: DWORD, + AccountsCount: *mut DWORD, + Accounts: *mut PZPWSTR, + ) -> NTSTATUS; + pub fn NetIsServiceAccount( + ServerName: LPWSTR, + AccountName: LPWSTR, + IsService: *mut BOOL, + ) -> NTSTATUS; + pub fn NetQueryServiceAccount( + ServerName: LPWSTR, + AccountName: LPWSTR, + InfoLevel: DWORD, + Buffer: *mut PBYTE, + ) -> NTSTATUS; +} +ENUM!{enum MSA_INFO_LEVEL { + MsaInfoLevel0 = 0, + MsaInfoLevelMax, +}} +pub type PMSA_INFO_LEVEL = *mut MSA_INFO_LEVEL; +ENUM!{enum MSA_INFO_STATE { + MsaInfoNotExist = 1, + MsaInfoNotService, + MsaInfoCannotInstall, + MsaInfoCanInstall, + MsaInfoInstalled, +}} +pub type PMSA_INFO_STATE = *mut MSA_INFO_STATE; +STRUCT!{struct MSA_INFO_0 { + State: MSA_INFO_STATE, +}} +pub type PMSA_INFO_0 = *mut MSA_INFO_0; +pub type LPMSA_INFO_0 = *mut MSA_INFO_0; diff --git a/bash-5.1/vendor/winapi/src/um/lmalert.rs b/bash-5.1/vendor/winapi/src/um/lmalert.rs new file mode 100644 index 0000000000000000000000000000000000000000..e406d807c2ad702d2b80984659a701617099f958 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmalert.rs @@ -0,0 +1,75 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This file contains structures for communication with the Alerter service +use shared::lmcons::{EVLEN, NET_API_STATUS, SNLEN}; +use shared::minwindef::{DWORD, LPVOID}; +use um::winnt::{LPCWSTR, WCHAR}; +extern "system" { + pub fn NetAlertRaise( + AlertType: LPCWSTR, + Buffer: LPVOID, + BufferSize: DWORD, + ) -> NET_API_STATUS; + pub fn NetAlertRaiseEx( + AlertType: LPCWSTR, + VariableInfo: LPVOID, + VariableInfoSize: DWORD, + ServiceName: LPCWSTR, + ) -> NET_API_STATUS; +} +STRUCT!{struct STD_ALERT { + alrt_timestamp: DWORD, + alrt_eventname: [WCHAR; EVLEN + 1], + alrt_servicename: [WCHAR; SNLEN + 1], +}} +pub type PSTD_ALERT = *mut STD_ALERT; +pub type LPSTD_ALERT = *mut STD_ALERT; +STRUCT!{struct ADMIN_OTHER_INFO { + alrtad_errcode: DWORD, + alrtad_numstrings: DWORD, +}} +pub type PADMIN_OTHER_INFO = *mut ADMIN_OTHER_INFO; +pub type LPADMIN_OTHER_INFO = *mut ADMIN_OTHER_INFO; +STRUCT!{struct ERRLOG_OTHER_INFO { + alrter_errcode: DWORD, + alrter_offset: DWORD, +}} +pub type PERRLOG_OTHER_INFO = *mut ERRLOG_OTHER_INFO; +pub type LPERRLOG_OTHER_INFO = *mut ERRLOG_OTHER_INFO; +STRUCT!{struct PRINT_OTHER_INFO { + alrtpr_jobid: DWORD, + alrtpr_status: DWORD, + alrtpr_submitted: DWORD, + alrtpr_size: DWORD, +}} +pub type PPRINT_OTHER_INFO = *mut PRINT_OTHER_INFO; +pub type LPPRINT_OTHER_INFO = *mut PRINT_OTHER_INFO; +STRUCT!{struct USER_OTHER_INFO { + alrtus_errcode: DWORD, + alrtus_numstrings: DWORD, +}} +pub type PUSER_OTHER_INFO = *mut USER_OTHER_INFO; +pub type LPUSER_OTHER_INFO = *mut USER_OTHER_INFO; +pub const ALERTER_MAILSLOT: &'static str = "\\\\.\\MAILSLOT\\Alerter"; +pub const ALERT_PRINT_EVENT: &'static str = "PRINTING"; +pub const ALERT_MESSAGE_EVENT: &'static str = "MESSAGE"; +pub const ALERT_ERRORLOG_EVENT: &'static str = "ERRORLOG"; +pub const ALERT_ADMIN_EVENT: &'static str = "ADMIN"; +pub const ALERT_USER_EVENT: &'static str = "USER"; +pub const PRJOB_QSTATUS: DWORD = 0x3; +pub const PRJOB_DEVSTATUS: DWORD = 0x1fc; +pub const PRJOB_COMPLETE: DWORD = 0x4; +pub const PRJOB_INTERV: DWORD = 0x8; +pub const PRJOB_ERROR: DWORD = 0x10; +pub const PRJOB_DESTOFFLINE: DWORD = 0x20; +pub const PRJOB_DESTPAUSED: DWORD = 0x40; +pub const PRJOB_NOTIFY: DWORD = 0x80; +pub const PRJOB_DESTNOPAPER: DWORD = 0x100; +pub const PRJOB_DELETED: DWORD = 0x8000; +pub const PRJOB_QS_QUEUED: DWORD = 0; +pub const PRJOB_QS_PAUSED: DWORD = 1; +pub const PRJOB_QS_SPOOLING: DWORD = 2; +pub const PRJOB_QS_PRINTING: DWORD = 3; diff --git a/bash-5.1/vendor/winapi/src/um/lmapibuf.rs b/bash-5.1/vendor/winapi/src/um/lmapibuf.rs new file mode 100644 index 0000000000000000000000000000000000000000..620a1319bf34291b6f6fbb9fc08b57eb50134b6f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmapibuf.rs @@ -0,0 +1,30 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This file contains information about NetApiBuffer APIs +use shared::lmcons::NET_API_STATUS; +use shared::minwindef::{DWORD, LPDWORD, LPVOID}; +extern "system" { + pub fn NetApiBufferAllocate( + ByteCount: DWORD, + Buffer: *mut LPVOID, + ) -> NET_API_STATUS; + pub fn NetApiBufferFree( + Buffer: LPVOID, + ) -> NET_API_STATUS; + pub fn NetApiBufferReallocate( + OldBuffer: LPVOID, + NewByteCount: DWORD, + NewBuffer: *mut LPVOID, + ) -> NET_API_STATUS; + pub fn NetApiBufferSize( + Buffer: LPVOID, + ByteCount: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetapipBufferAllocate( + ByteCount: DWORD, + Buffer: *mut LPVOID, + ) -> NET_API_STATUS; +} diff --git a/bash-5.1/vendor/winapi/src/um/lmat.rs b/bash-5.1/vendor/winapi/src/um/lmat.rs new file mode 100644 index 0000000000000000000000000000000000000000..46742eb1b727b88c42e3f805ade953d670ea3fd9 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmat.rs @@ -0,0 +1,62 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::DWORD_PTR; +use shared::lmcons::NET_API_STATUS; +use shared::minwindef::{DWORD, LPBYTE, LPDWORD, UCHAR}; +use um::winnt::{LPCWSTR, LPWSTR}; +pub const JOB_RUN_PERIODICALLY: UCHAR = 0x01; +pub const JOB_EXEC_ERROR: UCHAR = 0x02; +pub const JOB_RUNS_TODAY: UCHAR = 0x04; +pub const JOB_ADD_CURRENT_DATE: UCHAR = 0x08; +pub const JOB_NONINTERACTIVE: UCHAR = 0x10; +pub const JOB_INPUT_FLAGS: UCHAR = JOB_RUN_PERIODICALLY | JOB_ADD_CURRENT_DATE + | JOB_NONINTERACTIVE; +pub const JOB_OUTPUT_FLAGS: UCHAR = JOB_RUN_PERIODICALLY | JOB_EXEC_ERROR | JOB_RUNS_TODAY + | JOB_NONINTERACTIVE; +STRUCT!{struct AT_INFO { + JobTime: DWORD_PTR, + DaysOfMonth: DWORD, + DaysOfWeek: UCHAR, + Flags: UCHAR, + Command: LPWSTR, +}} +pub type PAT_INFO = *mut AT_INFO; +pub type LPAT_INFO = *mut AT_INFO; +STRUCT!{struct AT_ENUM { + JobId: DWORD, + JobTime: DWORD_PTR, + DaysOfMonth: DWORD, + DaysOfWeek: UCHAR, + Flags: UCHAR, + Command: LPWSTR, +}} +pub type PAT_ENUM = *mut AT_ENUM; +pub type LPAT_ENUM = *mut AT_ENUM; +extern "system" { + pub fn NetScheduleJobAdd( + Servername: LPCWSTR, + Buffer: LPBYTE, + JobId: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetScheduleJobDel( + Servername: LPCWSTR, + MinJobId: DWORD, + MaxJobId: DWORD, + ) -> NET_API_STATUS; + pub fn NetScheduleJobEnum( + Servername: LPCWSTR, + PointerToBuffer: *mut LPBYTE, + PointerToBuffer: DWORD, + EntriesRead: LPDWORD, + TotalEntries: LPDWORD, + ResumeHandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetScheduleJobGetInfo( + Servername: LPCWSTR, + JobId: DWORD, + PointerToBuffer: *mut LPBYTE, + ) -> NET_API_STATUS; +} diff --git a/bash-5.1/vendor/winapi/src/um/lmdfs.rs b/bash-5.1/vendor/winapi/src/um/lmdfs.rs new file mode 100644 index 0000000000000000000000000000000000000000..a0be98b26ca358d6b1684d6f401eba9c64839694 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmdfs.rs @@ -0,0 +1,483 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// This file contains structures, function prototypes, and definitions for the NetDfs API +use shared::guiddef::GUID; +use shared::lmcons::NET_API_STATUS; +use shared::minwindef::{DWORD, LPBYTE, LPDWORD, ULONG, USHORT}; +use um::winnt::{LPWSTR, PSECURITY_DESCRIPTOR, PWSTR, SECURITY_INFORMATION, ULONGLONG, WCHAR}; +pub const DFS_VOLUME_STATES: DWORD = 0xF; +pub const DFS_VOLUME_STATE_OK: DWORD = 1; +pub const DFS_VOLUME_STATE_INCONSISTENT: DWORD = 2; +pub const DFS_VOLUME_STATE_OFFLINE: DWORD = 3; +pub const DFS_VOLUME_STATE_ONLINE: DWORD = 4; +pub const DFS_VOLUME_STATE_RESYNCHRONIZE: DWORD = 0x10; +pub const DFS_VOLUME_STATE_STANDBY: DWORD = 0x20; +pub const DFS_VOLUME_STATE_FORCE_SYNC: DWORD = 0x40; +pub const DFS_VOLUME_FLAVORS: DWORD = 0x0300; +pub const DFS_VOLUME_FLAVOR_UNUSED1: DWORD = 0x0000; +pub const DFS_VOLUME_FLAVOR_STANDALONE: DWORD = 0x0100; +pub const DFS_VOLUME_FLAVOR_AD_BLOB: DWORD = 0x0200; +pub const DFS_STORAGE_FLAVOR_UNUSED2: DWORD = 0x0300; +pub const DFS_STORAGE_STATES: ULONG = 0xF; +pub const DFS_STORAGE_STATE_OFFLINE: ULONG = 1; +pub const DFS_STORAGE_STATE_ONLINE: ULONG = 2; +pub const DFS_STORAGE_STATE_ACTIVE: ULONG = 4; +ENUM!{enum DFS_TARGET_PRIORITY_CLASS { + DfsInvalidPriorityClass = -1i32 as u32, + DfsSiteCostNormalPriorityClass = 0, + DfsGlobalHighPriorityClass, + DfsSiteCostHighPriorityClass, + DfsSiteCostLowPriorityClass, + DfsGlobalLowPriorityClass, +}} +STRUCT!{struct DFS_TARGET_PRIORITY { + TargetPriorityClass: DFS_TARGET_PRIORITY_CLASS, + TargetPriorityRank: USHORT, + Reserved: USHORT, +}} +pub type PDFS_TARGET_PRIORITY = *mut DFS_TARGET_PRIORITY; +STRUCT!{struct DFS_INFO_1 { + EntryPath: LPWSTR, +}} +pub type PDFS_INFO_1 = *mut DFS_INFO_1; +pub type LPDFS_INFO_1 = *mut DFS_INFO_1; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +STRUCT!{struct DFS_INFO_1_32 { + EntryPath: ULONG, +}} +pub type PDFS_INFO_1_32 = *mut DFS_INFO_1_32; +pub type LPDFS_INFO_1_32 = *mut DFS_INFO_1_32; +} +STRUCT!{struct DFS_INFO_2 { + EntryPath: LPWSTR, + Comment: LPWSTR, + State: DWORD, + NumberOfStorages: DWORD, +}} +pub type PDFS_INFO_2 = *mut DFS_INFO_2; +pub type LPDFS_INFO_2 = *mut DFS_INFO_2; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +STRUCT!{struct DFS_INFO_2_32 { + EntryPath: ULONG, + Comment: ULONG, + State: DWORD, + NumberOfStorages: DWORD, +}} +pub type PDFS_INFO_2_32 = *mut DFS_INFO_2_32; +pub type LPDFS_INFO_2_32 = *mut DFS_INFO_2_32; +} +STRUCT!{struct DFS_STORAGE_INFO { + State: ULONG, + ServerName: LPWSTR, + ShareName: LPWSTR, +}} +pub type PDFS_STORAGE_INFO = *mut DFS_STORAGE_INFO; +pub type LPDFS_STORAGE_INFO = *mut DFS_STORAGE_INFO; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +STRUCT!{struct DFS_STORAGE_INFO_0_32 { + State: ULONG, + ServerName: ULONG, + ShareName: ULONG, +}} +pub type PDFS_STORAGE_INFO_0_32 = *mut DFS_STORAGE_INFO_0_32; +pub type LPDFS_STORAGE_INFO_0_32 = *mut DFS_STORAGE_INFO_0_32; +} +STRUCT!{struct DFS_STORAGE_INFO_1 { + State: ULONG, + ServerName: LPWSTR, + ShareName: LPWSTR, + TargetPriority: DFS_TARGET_PRIORITY, +}} +pub type PDFS_STORAGE_INFO_1 = *mut DFS_STORAGE_INFO_1; +pub type LPDFS_STORAGE_INFO_1 = *mut DFS_STORAGE_INFO_1; +STRUCT!{struct DFS_INFO_3 { + EntryPath: LPWSTR, + Comment: LPWSTR, + State: DWORD, + NumberOfStorages: DWORD, + Storage: LPDFS_STORAGE_INFO, +}} +pub type PDFS_INFO_3 = *mut DFS_INFO_3; +pub type LPDFS_INFO_3 = *mut DFS_INFO_3; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +STRUCT!{struct DFS_INFO_3_32 { + EntryPath: ULONG, + Comment: ULONG, + State: DWORD, + NumberOfStorages: DWORD, + Storage: ULONG, +}} +pub type PDFS_INFO_3_32 = *mut DFS_INFO_3_32; +pub type LPDFS_INFO_3_32 = *mut DFS_INFO_3_32; +} +STRUCT!{struct DFS_INFO_4 { + EntryPath: LPWSTR, + Comment: LPWSTR, + State: DWORD, + Timeout: ULONG, + Guid: GUID, + NumberOfStorages: DWORD, + Storage: LPDFS_STORAGE_INFO, +}} +pub type PDFS_INFO_4 = *mut DFS_INFO_4; +pub type LPDFS_INFO_4 = *mut DFS_INFO_4; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +STRUCT!{struct DFS_INFO_4_32 { + EntryPath: ULONG, + Comment: ULONG, + State: DWORD, + Timeout: ULONG, + Guid: GUID, + NumberOfStorages: DWORD, + Storage: ULONG, +}} +pub type PDFS_INFO_4_32 = *mut DFS_INFO_4_32; +pub type LPDFS_INFO_4_32 = *mut DFS_INFO_4_32; +} +STRUCT!{struct DFS_INFO_5 { + EntryPath: LPWSTR, + Comment: LPWSTR, + State: DWORD, + Timeout: ULONG, + Guid: GUID, + PropertyFlags: ULONG, + MetadataSize: ULONG, + NumberOfStorages: DWORD, +}} +pub type PDFS_INFO_5 = *mut DFS_INFO_5; +pub type LPDFS_INFO_5 = *mut DFS_INFO_5; +STRUCT!{struct DFS_INFO_6 { + EntryPath: LPWSTR, + Comment: LPWSTR, + State: DWORD, + Timeout: ULONG, + Guid: GUID, + PropertyFlags: ULONG, + MetadataSize: ULONG, + NumberOfStorages: DWORD, + Storage: LPDFS_STORAGE_INFO, +}} +pub type PDFS_INFO_6 = *mut DFS_INFO_6; +pub type LPDFS_INFO_6 = *mut DFS_INFO_6; +STRUCT!{struct DFS_INFO_7 { + GenerationGuid: GUID, +}} +pub type PDFS_INFO_7 = *mut DFS_INFO_7; +pub type LPDFS_INFO_7 = *mut DFS_INFO_7; +STRUCT!{struct DFS_INFO_8 { + EntryPath: LPWSTR, + Comment: LPWSTR, + State: DWORD, + Timeout: ULONG, + Guid: GUID, + PropertyFlags: ULONG, + MetadataSize: ULONG, + SdLengthReserved: ULONG, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + NumberOfStorages: DWORD, +}} +pub type PDFS_INFO_8 = *mut DFS_INFO_8; +pub type LPDFS_INFO_8 = *mut DFS_INFO_8; +STRUCT!{struct DFS_INFO_9 { + EntryPath: LPWSTR, + Comment: LPWSTR, + State: DWORD, + Timeout: ULONG, + Guid: GUID, + PropertyFlags: ULONG, + MetadataSize: ULONG, + SdLengthReserved: ULONG, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + NumberOfStorages: DWORD, + Storage: LPDFS_STORAGE_INFO, +}} +pub type PDFS_INFO_9 = *mut DFS_INFO_9; +pub type LPDFS_INFO_9 = *mut DFS_INFO_9; +pub const DFS_VALID_PROPERTY_FLAGS: ULONG = DFS_PROPERTY_FLAG_INSITE_REFERRALS + | DFS_PROPERTY_FLAG_ROOT_SCALABILITY | DFS_PROPERTY_FLAG_SITE_COSTING + | DFS_PROPERTY_FLAG_TARGET_FAILBACK | DFS_PROPERTY_FLAG_CLUSTER_ENABLED + | DFS_PROPERTY_FLAG_ABDE; +pub const DFS_PROPERTY_FLAG_INSITE_REFERRALS: ULONG = 0x00000001; +pub const DFS_PROPERTY_FLAG_ROOT_SCALABILITY: ULONG = 0x00000002; +pub const DFS_PROPERTY_FLAG_SITE_COSTING: ULONG = 0x00000004; +pub const DFS_PROPERTY_FLAG_TARGET_FAILBACK: ULONG = 0x00000008; +pub const DFS_PROPERTY_FLAG_CLUSTER_ENABLED: ULONG = 0x00000010; +pub const DFS_PROPERTY_FLAG_ABDE: ULONG = 0x00000020; +STRUCT!{struct DFS_INFO_50 { + NamespaceMajorVersion: ULONG, + NamespaceMinorVersion: ULONG, + NamespaceCapabilities: ULONGLONG, +}} +pub type PDFS_INFO_50 = *mut DFS_INFO_50; +pub type LPDFS_INFO_50 = *mut DFS_INFO_50; +STRUCT!{struct DFS_INFO_100 { + Comment: LPWSTR, +}} +pub type PDFS_INFO_100 = *mut DFS_INFO_100; +pub type LPDFS_INFO_100 = *mut DFS_INFO_100; +STRUCT!{struct DFS_INFO_101 { + State: DWORD, +}} +pub type PDFS_INFO_101 = *mut DFS_INFO_101; +pub type LPDFS_INFO_101 = *mut DFS_INFO_101; +STRUCT!{struct DFS_INFO_102 { + Timeout: ULONG, +}} +pub type PDFS_INFO_102 = *mut DFS_INFO_102; +pub type LPDFS_INFO_102 = *mut DFS_INFO_102; +STRUCT!{struct DFS_INFO_103 { + PropertyFlagMask: ULONG, + PropertyFlags: ULONG, +}} +pub type PDFS_INFO_103 = *mut DFS_INFO_103; +pub type LPDFS_INFO_103 = *mut DFS_INFO_103; +STRUCT!{struct DFS_INFO_104 { + TargetPriority: DFS_TARGET_PRIORITY, +}} +pub type PDFS_INFO_104 = *mut DFS_INFO_104; +pub type LPDFS_INFO_104 = *mut DFS_INFO_104; +STRUCT!{struct DFS_INFO_105 { + Comment: LPWSTR, + State: DWORD, + Timeout: ULONG, + PropertyFlagMask: ULONG, + PropertyFlags: ULONG, +}} +pub type PDFS_INFO_105 = *mut DFS_INFO_105; +pub type LPDFS_INFO_105 = *mut DFS_INFO_105; +STRUCT!{struct DFS_INFO_106 { + State: DWORD, + TargetPriority: DFS_TARGET_PRIORITY, +}} +pub type PDFS_INFO_106 = *mut DFS_INFO_106; +pub type LPDFS_INFO_106 = *mut DFS_INFO_106; +STRUCT!{struct DFS_INFO_107 { + Comment: LPWSTR, + State: DWORD, + Timeout: ULONG, + PropertyFlagMask: ULONG, + PropertyFlags: ULONG, + SdLengthReserved: ULONG, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, +}} +pub type PDFS_INFO_107 = *mut DFS_INFO_107; +pub type LPDFS_INFO_107 = *mut DFS_INFO_107; +STRUCT!{struct DFS_INFO_150 { + SdLengthReserved: ULONG, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, +}} +pub type PDFS_INFO_150 = *mut DFS_INFO_150; +pub type LPDFS_INFO_150 = *mut DFS_INFO_150; +STRUCT!{struct DFS_INFO_200 { + FtDfsName: LPWSTR, +}} +pub type PDFS_INFO_200 = *mut DFS_INFO_200; +pub type LPDFS_INFO_200 = *mut DFS_INFO_200; +STRUCT!{struct DFS_INFO_300 { + Flags: DWORD, + DfsName: LPWSTR, +}} +pub type PDFS_INFO_300 = *mut DFS_INFO_300; +pub type LPDFS_INFO_300 = *mut DFS_INFO_300; +extern "system" { + pub fn NetDfsAdd( + DfsEntryPath: LPWSTR, + ServerName: LPWSTR, + ShareName: LPWSTR, + Comment: LPWSTR, + Flags: DWORD, + ) -> NET_API_STATUS; +} +pub const DFS_ADD_VOLUME: DWORD = 1; +pub const DFS_RESTORE_VOLUME: DWORD = 2; +extern "system" { + pub fn NetDfsAddStdRoot( + ServerName: LPWSTR, + RootShare: LPWSTR, + Comment: LPWSTR, + Flags: DWORD, + ) -> NET_API_STATUS; + pub fn NetDfsRemoveStdRoot( + ServerName: LPWSTR, + RootShare: LPWSTR, + Flags: DWORD, + ) -> NET_API_STATUS; + pub fn NetDfsAddFtRoot( + ServerName: LPWSTR, + RootShare: LPWSTR, + FtDfsName: LPWSTR, + Comment: LPWSTR, + Flags: DWORD, + ) -> NET_API_STATUS; + pub fn NetDfsRemoveFtRoot( + ServerName: LPWSTR, + RootShare: LPWSTR, + FtDfsName: LPWSTR, + Flags: DWORD, + ) -> NET_API_STATUS; + pub fn NetDfsRemoveFtRootForced( + DomainName: LPWSTR, + ServerName: LPWSTR, + RootShare: LPWSTR, + FtDfsName: LPWSTR, + Flags: DWORD, + ) -> NET_API_STATUS; +} +pub const NET_DFS_SETDC_FLAGS: DWORD = 0x00000000; +pub const NET_DFS_SETDC_TIMEOUT: DWORD = 0x00000001; +pub const NET_DFS_SETDC_INITPKT: DWORD = 0x00000002; +STRUCT!{struct DFS_SITENAME_INFO { + SiteFlags: ULONG, + SiteName: LPWSTR, +}} +pub type PDFS_SITENAME_INFO = *mut DFS_SITENAME_INFO; +pub type LPDFS_SITENAME_INFO = *mut DFS_SITENAME_INFO; +pub const DFS_SITE_PRIMARY: ULONG = 0x1; +STRUCT!{struct DFS_SITELIST_INFO { + cSites: ULONG, + Site: [DFS_SITENAME_INFO; 1], +}} +pub type PDFS_SITELIST_INFO = *mut DFS_SITELIST_INFO; +pub type LPDFS_SITELIST_INFO = *mut DFS_SITELIST_INFO; +extern "system" { + pub fn NetDfsRemove( + DfsEntryPath: LPWSTR, + ServerName: LPWSTR, + ShareName: LPWSTR, + ) -> NET_API_STATUS; + pub fn NetDfsEnum( + DfsName: LPWSTR, + Level: DWORD, + PrefMaxLen: DWORD, + Buffer: *mut LPBYTE, + EntriesRead: LPDWORD, + ResumeHandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetDfsGetInfo( + DfsEntryPath: LPWSTR, + ServerName: LPWSTR, + ShareName: LPWSTR, + Level: DWORD, + Buffer: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetDfsSetInfo( + DfsEntryPath: LPWSTR, + ServerName: LPWSTR, + ShareName: LPWSTR, + Level: DWORD, + Buffer: LPBYTE, + ) -> NET_API_STATUS; + pub fn NetDfsGetClientInfo( + DfsEntryPath: LPWSTR, + ServerName: LPWSTR, + ShareName: LPWSTR, + Level: DWORD, + Buffer: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetDfsSetClientInfo( + DfsEntryPath: LPWSTR, + ServerName: LPWSTR, + ShareName: LPWSTR, + Level: DWORD, + Buffer: LPBYTE, + ) -> NET_API_STATUS; + pub fn NetDfsMove( + OldDfsEntryPath: LPWSTR, + NewDfsEntryPath: LPWSTR, + Flags: ULONG, + ) -> NET_API_STATUS; +} +pub const DFS_MOVE_FLAG_REPLACE_IF_EXISTS: ULONG = 0x00000001; +extern "system" { + pub fn NetDfsRename( + Path: LPWSTR, + NewPath: LPWSTR, + ) -> NET_API_STATUS; + pub fn NetDfsAddRootTarget( + pDfsPath: LPWSTR, + pTargetPath: LPWSTR, + MajorVersion: ULONG, + pComment: LPWSTR, + Flags: ULONG, + ) -> NET_API_STATUS; +} +pub const DFS_FORCE_REMOVE: ULONG = 0x80000000; +extern "system" { + pub fn NetDfsRemoveRootTarget( + pDfsPath: LPWSTR, + pTargetPath: LPWSTR, + Flags: DWORD, + ) -> NET_API_STATUS; + pub fn NetDfsGetSecurity( + DfsEntryPath: LPWSTR, + SecurityInformation: SECURITY_INFORMATION, + ppSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + lpcbSecurityDescriptor: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetDfsSetSecurity( + DfsEntryPath: LPWSTR, + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> NET_API_STATUS; + pub fn NetDfsGetStdContainerSecurity( + MachineName: LPWSTR, + SecurityInformation: SECURITY_INFORMATION, + ppSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + lpcbSecurityDescriptor: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetDfsSetStdContainerSecurity( + MachineName: LPWSTR, + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> NET_API_STATUS; + pub fn NetDfsGetFtContainerSecurity( + DomainName: LPWSTR, + SecurityInformation: SECURITY_INFORMATION, + ppSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + lpcbSecurityDescriptor: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetDfsSetFtContainerSecurity( + DomainName: LPWSTR, + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> NET_API_STATUS; +} +ENUM!{enum DFS_NAMESPACE_VERSION_ORIGIN { + DFS_NAMESPACE_VERSION_ORIGIN_COMBINED = 0, + DFS_NAMESPACE_VERSION_ORIGIN_SERVER, + DFS_NAMESPACE_VERSION_ORIGIN_DOMAIN, +}} +pub type PDFS_NAMESPACE_VERSION_ORIGIN = *mut DFS_NAMESPACE_VERSION_ORIGIN; +pub const DFS_NAMESPACE_CAPABILITY_ABDE: ULONGLONG = 0x0000000000000001; +STRUCT!{struct DFS_SUPPORTED_NAMESPACE_VERSION_INFO { + DomainDfsMajorVersion: ULONG, + DomainDfsMinorVersion: ULONG, + DomainDfsCapabilities: ULONGLONG, + StandaloneDfsMajorVersion: ULONG, + StandaloneDfsMinorVersion: ULONG, + StandaloneDfsCapabilities: ULONGLONG, +}} +pub type PDFS_SUPPORTED_NAMESPACE_VERSION_INFO = *mut DFS_SUPPORTED_NAMESPACE_VERSION_INFO; +extern "system" { + pub fn NetDfsGetSupportedNamespaceVersion( + Origin: DFS_NAMESPACE_VERSION_ORIGIN, + pName: PWSTR, + ppVersionInfo: *mut PDFS_SUPPORTED_NAMESPACE_VERSION_INFO, + ) -> NET_API_STATUS; +} +STRUCT!{struct DFS_GET_PKT_ENTRY_STATE_ARG { + DfsEntryPathLen: USHORT, + ServerNameLen: USHORT, + ShareNameLen: USHORT, + Level: ULONG, + Buffer: [WCHAR; 1], +}} +pub type PDFS_GET_PKT_ENTRY_STATE_ARG = *mut DFS_GET_PKT_ENTRY_STATE_ARG; diff --git a/bash-5.1/vendor/winapi/src/um/lmerrlog.rs b/bash-5.1/vendor/winapi/src/um/lmerrlog.rs new file mode 100644 index 0000000000000000000000000000000000000000..8a07f731ce3a13d82d5f43ae47e80f35560fa6ba --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmerrlog.rs @@ -0,0 +1,268 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{DWORD, LPBYTE}; +use um::winnt::LPWSTR; +STRUCT!{struct ERROR_LOG { + el_len: DWORD, + el_reserved: DWORD, + el_time: DWORD, + el_error: DWORD, + el_name: LPWSTR, + el_text: LPWSTR, + el_data: LPBYTE, + el_data_size: DWORD, + el_nstrings: DWORD, +}} +pub type PERROR_LOG = *mut ERROR_LOG; +pub type LPERROR_LOG = *mut ERROR_LOG; +STRUCT!{struct HLOG { + time: DWORD, + last_flags: DWORD, + offset: DWORD, + rec_offset: DWORD, +}} +pub type PHLOG = *mut HLOG; +pub type LPHLOG = *mut HLOG; +pub const LOGFLAGS_FORWARD: DWORD = 0; +pub const LOGFLAGS_BACKWARD: DWORD = 0x1; +pub const LOGFLAGS_SEEK: DWORD = 0x2; +pub const ERRLOG_BASE: DWORD = 3100; +pub const NELOG_Internal_Error: DWORD = ERRLOG_BASE + 0; +pub const NELOG_Resource_Shortage: DWORD = ERRLOG_BASE + 1; +pub const NELOG_Unable_To_Lock_Segment: DWORD = ERRLOG_BASE + 2; +pub const NELOG_Unable_To_Unlock_Segment: DWORD = ERRLOG_BASE + 3; +pub const NELOG_Uninstall_Service: DWORD = ERRLOG_BASE + 4; +pub const NELOG_Init_Exec_Fail: DWORD = ERRLOG_BASE + 5; +pub const NELOG_Ncb_Error: DWORD = ERRLOG_BASE + 6; +pub const NELOG_Net_Not_Started: DWORD = ERRLOG_BASE + 7; +pub const NELOG_Ioctl_Error: DWORD = ERRLOG_BASE + 8; +pub const NELOG_System_Semaphore: DWORD = ERRLOG_BASE + 9; +pub const NELOG_Init_OpenCreate_Err: DWORD = ERRLOG_BASE + 10; +pub const NELOG_NetBios: DWORD = ERRLOG_BASE + 11; +pub const NELOG_SMB_Illegal: DWORD = ERRLOG_BASE + 12; +pub const NELOG_Service_Fail: DWORD = ERRLOG_BASE + 13; +pub const NELOG_Entries_Lost: DWORD = ERRLOG_BASE + 14; +pub const NELOG_Init_Seg_Overflow: DWORD = ERRLOG_BASE + 20; +pub const NELOG_Srv_No_Mem_Grow: DWORD = ERRLOG_BASE + 21; +pub const NELOG_Access_File_Bad: DWORD = ERRLOG_BASE + 22; +pub const NELOG_Srvnet_Not_Started: DWORD = ERRLOG_BASE + 23; +pub const NELOG_Init_Chardev_Err: DWORD = ERRLOG_BASE + 24; +pub const NELOG_Remote_API: DWORD = ERRLOG_BASE + 25; +pub const NELOG_Ncb_TooManyErr: DWORD = ERRLOG_BASE + 26; +pub const NELOG_Mailslot_err: DWORD = ERRLOG_BASE + 27; +pub const NELOG_ReleaseMem_Alert: DWORD = ERRLOG_BASE + 28; +pub const NELOG_AT_cannot_write: DWORD = ERRLOG_BASE + 29; +pub const NELOG_Cant_Make_Msg_File: DWORD = ERRLOG_BASE + 30; +pub const NELOG_Exec_Netservr_NoMem: DWORD = ERRLOG_BASE + 31; +pub const NELOG_Server_Lock_Failure: DWORD = ERRLOG_BASE + 32; +pub const NELOG_Msg_Shutdown: DWORD = ERRLOG_BASE + 40; +pub const NELOG_Msg_Sem_Shutdown: DWORD = ERRLOG_BASE + 41; +pub const NELOG_Msg_Log_Err: DWORD = ERRLOG_BASE + 50; +pub const NELOG_VIO_POPUP_ERR: DWORD = ERRLOG_BASE + 51; +pub const NELOG_Msg_Unexpected_SMB_Type: DWORD = ERRLOG_BASE + 52; +pub const NELOG_Wksta_Infoseg: DWORD = ERRLOG_BASE + 60; +pub const NELOG_Wksta_Compname: DWORD = ERRLOG_BASE + 61; +pub const NELOG_Wksta_BiosThreadFailure: DWORD = ERRLOG_BASE + 62; +pub const NELOG_Wksta_IniSeg: DWORD = ERRLOG_BASE + 63; +pub const NELOG_Wksta_HostTab_Full: DWORD = ERRLOG_BASE + 64; +pub const NELOG_Wksta_Bad_Mailslot_SMB: DWORD = ERRLOG_BASE + 65; +pub const NELOG_Wksta_UASInit: DWORD = ERRLOG_BASE + 66; +pub const NELOG_Wksta_SSIRelogon: DWORD = ERRLOG_BASE + 67; +pub const NELOG_Build_Name: DWORD = ERRLOG_BASE + 70; +pub const NELOG_Name_Expansion: DWORD = ERRLOG_BASE + 71; +pub const NELOG_Message_Send: DWORD = ERRLOG_BASE + 72; +pub const NELOG_Mail_Slt_Err: DWORD = ERRLOG_BASE + 73; +pub const NELOG_AT_cannot_read: DWORD = ERRLOG_BASE + 74; +pub const NELOG_AT_sched_err: DWORD = ERRLOG_BASE + 75; +pub const NELOG_AT_schedule_file_created: DWORD = ERRLOG_BASE + 76; +pub const NELOG_Srvnet_NB_Open: DWORD = ERRLOG_BASE + 77; +pub const NELOG_AT_Exec_Err: DWORD = ERRLOG_BASE + 78; +pub const NELOG_Lazy_Write_Err: DWORD = ERRLOG_BASE + 80; +pub const NELOG_HotFix: DWORD = ERRLOG_BASE + 81; +pub const NELOG_HardErr_From_Server: DWORD = ERRLOG_BASE + 82; +pub const NELOG_LocalSecFail1: DWORD = ERRLOG_BASE + 83; +pub const NELOG_LocalSecFail2: DWORD = ERRLOG_BASE + 84; +pub const NELOG_LocalSecFail3: DWORD = ERRLOG_BASE + 85; +pub const NELOG_LocalSecGeneralFail: DWORD = ERRLOG_BASE + 86; +pub const NELOG_NetWkSta_Internal_Error: DWORD = ERRLOG_BASE + 90; +pub const NELOG_NetWkSta_No_Resource: DWORD = ERRLOG_BASE + 91; +pub const NELOG_NetWkSta_SMB_Err: DWORD = ERRLOG_BASE + 92; +pub const NELOG_NetWkSta_VC_Err: DWORD = ERRLOG_BASE + 93; +pub const NELOG_NetWkSta_Stuck_VC_Err: DWORD = ERRLOG_BASE + 94; +pub const NELOG_NetWkSta_NCB_Err: DWORD = ERRLOG_BASE + 95; +pub const NELOG_NetWkSta_Write_Behind_Err: DWORD = ERRLOG_BASE + 96; +pub const NELOG_NetWkSta_Reset_Err: DWORD = ERRLOG_BASE + 97; +pub const NELOG_NetWkSta_Too_Many: DWORD = ERRLOG_BASE + 98; +pub const NELOG_Srv_Thread_Failure: DWORD = ERRLOG_BASE + 104; +pub const NELOG_Srv_Close_Failure: DWORD = ERRLOG_BASE + 105; +pub const NELOG_ReplUserCurDir: DWORD = ERRLOG_BASE + 106; +pub const NELOG_ReplCannotMasterDir: DWORD = ERRLOG_BASE + 107; +pub const NELOG_ReplUpdateError: DWORD = ERRLOG_BASE + 108; +pub const NELOG_ReplLostMaster: DWORD = ERRLOG_BASE + 109; +pub const NELOG_NetlogonAuthDCFail: DWORD = ERRLOG_BASE + 110; +pub const NELOG_ReplLogonFailed: DWORD = ERRLOG_BASE + 111; +pub const NELOG_ReplNetErr: DWORD = ERRLOG_BASE + 112; +pub const NELOG_ReplMaxFiles: DWORD = ERRLOG_BASE + 113; +pub const NELOG_ReplMaxTreeDepth: DWORD = ERRLOG_BASE + 114; +pub const NELOG_ReplBadMsg: DWORD = ERRLOG_BASE + 115; +pub const NELOG_ReplSysErr: DWORD = ERRLOG_BASE + 116; +pub const NELOG_ReplUserLoged: DWORD = ERRLOG_BASE + 117; +pub const NELOG_ReplBadImport: DWORD = ERRLOG_BASE + 118; +pub const NELOG_ReplBadExport: DWORD = ERRLOG_BASE + 119; +pub const NELOG_ReplSignalFileErr: DWORD = ERRLOG_BASE + 120; +pub const NELOG_DiskFT: DWORD = ERRLOG_BASE + 121; +pub const NELOG_ReplAccessDenied: DWORD = ERRLOG_BASE + 122; +pub const NELOG_NetlogonFailedPrimary: DWORD = ERRLOG_BASE + 123; +pub const NELOG_NetlogonPasswdSetFailed: DWORD = ERRLOG_BASE + 124; +pub const NELOG_NetlogonTrackingError: DWORD = ERRLOG_BASE + 125; +pub const NELOG_NetlogonSyncError: DWORD = ERRLOG_BASE + 126; +pub const NELOG_NetlogonRequireSignOrSealError: DWORD = ERRLOG_BASE + 127; +pub const NELOG_UPS_PowerOut: DWORD = ERRLOG_BASE + 130; +pub const NELOG_UPS_Shutdown: DWORD = ERRLOG_BASE + 131; +pub const NELOG_UPS_CmdFileError: DWORD = ERRLOG_BASE + 132; +pub const NELOG_UPS_CannotOpenDriver: DWORD = ERRLOG_BASE + 133; +pub const NELOG_UPS_PowerBack: DWORD = ERRLOG_BASE + 134; +pub const NELOG_UPS_CmdFileConfig: DWORD = ERRLOG_BASE + 135; +pub const NELOG_UPS_CmdFileExec: DWORD = ERRLOG_BASE + 136; +pub const NELOG_Missing_Parameter: DWORD = ERRLOG_BASE + 150; +pub const NELOG_Invalid_Config_Line: DWORD = ERRLOG_BASE + 151; +pub const NELOG_Invalid_Config_File: DWORD = ERRLOG_BASE + 152; +pub const NELOG_File_Changed: DWORD = ERRLOG_BASE + 153; +pub const NELOG_Files_Dont_Fit: DWORD = ERRLOG_BASE + 154; +pub const NELOG_Wrong_DLL_Version: DWORD = ERRLOG_BASE + 155; +pub const NELOG_Error_in_DLL: DWORD = ERRLOG_BASE + 156; +pub const NELOG_System_Error: DWORD = ERRLOG_BASE + 157; +pub const NELOG_FT_ErrLog_Too_Large: DWORD = ERRLOG_BASE + 158; +pub const NELOG_FT_Update_In_Progress: DWORD = ERRLOG_BASE + 159; +pub const NELOG_Joined_Domain: DWORD = ERRLOG_BASE + 160; +pub const NELOG_Joined_Workgroup: DWORD = ERRLOG_BASE + 161; +pub const NELOG_OEM_Code: DWORD = ERRLOG_BASE + 199; +pub const ERRLOG2_BASE: DWORD = 5700; +pub const NELOG_NetlogonSSIInitError: DWORD = ERRLOG2_BASE + 0; +pub const NELOG_NetlogonFailedToUpdateTrustList: DWORD = ERRLOG2_BASE + 1; +pub const NELOG_NetlogonFailedToAddRpcInterface: DWORD = ERRLOG2_BASE + 2; +pub const NELOG_NetlogonFailedToReadMailslot: DWORD = ERRLOG2_BASE + 3; +pub const NELOG_NetlogonFailedToRegisterSC: DWORD = ERRLOG2_BASE + 4; +pub const NELOG_NetlogonChangeLogCorrupt: DWORD = ERRLOG2_BASE + 5; +pub const NELOG_NetlogonFailedToCreateShare: DWORD = ERRLOG2_BASE + 6; +pub const NELOG_NetlogonDownLevelLogonFailed: DWORD = ERRLOG2_BASE + 7; +pub const NELOG_NetlogonDownLevelLogoffFailed: DWORD = ERRLOG2_BASE + 8; +pub const NELOG_NetlogonNTLogonFailed: DWORD = ERRLOG2_BASE + 9; +pub const NELOG_NetlogonNTLogoffFailed: DWORD = ERRLOG2_BASE + 10; +pub const NELOG_NetlogonPartialSyncCallSuccess: DWORD = ERRLOG2_BASE + 11; +pub const NELOG_NetlogonPartialSyncCallFailed: DWORD = ERRLOG2_BASE + 12; +pub const NELOG_NetlogonFullSyncCallSuccess: DWORD = ERRLOG2_BASE + 13; +pub const NELOG_NetlogonFullSyncCallFailed: DWORD = ERRLOG2_BASE + 14; +pub const NELOG_NetlogonPartialSyncSuccess: DWORD = ERRLOG2_BASE + 15; +pub const NELOG_NetlogonPartialSyncFailed: DWORD = ERRLOG2_BASE + 16; +pub const NELOG_NetlogonFullSyncSuccess: DWORD = ERRLOG2_BASE + 17; +pub const NELOG_NetlogonFullSyncFailed: DWORD = ERRLOG2_BASE + 18; +pub const NELOG_NetlogonAuthNoDomainController: DWORD = ERRLOG2_BASE + 19; +pub const NELOG_NetlogonAuthNoTrustLsaSecret: DWORD = ERRLOG2_BASE + 20; +pub const NELOG_NetlogonAuthNoTrustSamAccount: DWORD = ERRLOG2_BASE + 21; +pub const NELOG_NetlogonServerAuthFailed: DWORD = ERRLOG2_BASE + 22; +pub const NELOG_NetlogonServerAuthNoTrustSamAccount: DWORD = ERRLOG2_BASE + 23; +pub const NELOG_FailedToRegisterSC: DWORD = ERRLOG2_BASE + 24; +pub const NELOG_FailedToSetServiceStatus: DWORD = ERRLOG2_BASE + 25; +pub const NELOG_FailedToGetComputerName: DWORD = ERRLOG2_BASE + 26; +pub const NELOG_DriverNotLoaded: DWORD = ERRLOG2_BASE + 27; +pub const NELOG_NoTranportLoaded: DWORD = ERRLOG2_BASE + 28; +pub const NELOG_NetlogonFailedDomainDelta: DWORD = ERRLOG2_BASE + 29; +pub const NELOG_NetlogonFailedGlobalGroupDelta: DWORD = ERRLOG2_BASE + 30; +pub const NELOG_NetlogonFailedLocalGroupDelta: DWORD = ERRLOG2_BASE + 31; +pub const NELOG_NetlogonFailedUserDelta: DWORD = ERRLOG2_BASE + 32; +pub const NELOG_NetlogonFailedPolicyDelta: DWORD = ERRLOG2_BASE + 33; +pub const NELOG_NetlogonFailedTrustedDomainDelta: DWORD = ERRLOG2_BASE + 34; +pub const NELOG_NetlogonFailedAccountDelta: DWORD = ERRLOG2_BASE + 35; +pub const NELOG_NetlogonFailedSecretDelta: DWORD = ERRLOG2_BASE + 36; +pub const NELOG_NetlogonSystemError: DWORD = ERRLOG2_BASE + 37; +pub const NELOG_NetlogonDuplicateMachineAccounts: DWORD = ERRLOG2_BASE + 38; +pub const NELOG_NetlogonTooManyGlobalGroups: DWORD = ERRLOG2_BASE + 39; +pub const NELOG_NetlogonBrowserDriver: DWORD = ERRLOG2_BASE + 40; +pub const NELOG_NetlogonAddNameFailure: DWORD = ERRLOG2_BASE + 41; +pub const NELOG_RplMessages: DWORD = ERRLOG2_BASE + 42; +pub const NELOG_RplXnsBoot: DWORD = ERRLOG2_BASE + 43; +pub const NELOG_RplSystem: DWORD = ERRLOG2_BASE + 44; +pub const NELOG_RplWkstaTimeout: DWORD = ERRLOG2_BASE + 45; +pub const NELOG_RplWkstaFileOpen: DWORD = ERRLOG2_BASE + 46; +pub const NELOG_RplWkstaFileRead: DWORD = ERRLOG2_BASE + 47; +pub const NELOG_RplWkstaMemory: DWORD = ERRLOG2_BASE + 48; +pub const NELOG_RplWkstaFileChecksum: DWORD = ERRLOG2_BASE + 49; +pub const NELOG_RplWkstaFileLineCount: DWORD = ERRLOG2_BASE + 50; +pub const NELOG_RplWkstaBbcFile: DWORD = ERRLOG2_BASE + 51; +pub const NELOG_RplWkstaFileSize: DWORD = ERRLOG2_BASE + 52; +pub const NELOG_RplWkstaInternal: DWORD = ERRLOG2_BASE + 53; +pub const NELOG_RplWkstaWrongVersion: DWORD = ERRLOG2_BASE + 54; +pub const NELOG_RplWkstaNetwork: DWORD = ERRLOG2_BASE + 55; +pub const NELOG_RplAdapterResource: DWORD = ERRLOG2_BASE + 56; +pub const NELOG_RplFileCopy: DWORD = ERRLOG2_BASE + 57; +pub const NELOG_RplFileDelete: DWORD = ERRLOG2_BASE + 58; +pub const NELOG_RplFilePerms: DWORD = ERRLOG2_BASE + 59; +pub const NELOG_RplCheckConfigs: DWORD = ERRLOG2_BASE + 60; +pub const NELOG_RplCreateProfiles: DWORD = ERRLOG2_BASE + 61; +pub const NELOG_RplRegistry: DWORD = ERRLOG2_BASE + 62; +pub const NELOG_RplReplaceRPLDISK: DWORD = ERRLOG2_BASE + 63; +pub const NELOG_RplCheckSecurity: DWORD = ERRLOG2_BASE + 64; +pub const NELOG_RplBackupDatabase: DWORD = ERRLOG2_BASE + 65; +pub const NELOG_RplInitDatabase: DWORD = ERRLOG2_BASE + 66; +pub const NELOG_RplRestoreDatabaseFailure: DWORD = ERRLOG2_BASE + 67; +pub const NELOG_RplRestoreDatabaseSuccess: DWORD = ERRLOG2_BASE + 68; +pub const NELOG_RplInitRestoredDatabase: DWORD = ERRLOG2_BASE + 69; +pub const NELOG_NetlogonSessionTypeWrong: DWORD = ERRLOG2_BASE + 70; +pub const NELOG_RplUpgradeDBTo40: DWORD = ERRLOG2_BASE + 71; +pub const NELOG_NetlogonLanmanBdcsNotAllowed: DWORD = ERRLOG2_BASE + 72; +pub const NELOG_NetlogonNoDynamicDns: DWORD = ERRLOG2_BASE + 73; +pub const NELOG_NetlogonDynamicDnsRegisterFailure: DWORD = ERRLOG2_BASE + 74; +pub const NELOG_NetlogonDynamicDnsDeregisterFailure: DWORD = ERRLOG2_BASE + 75; +pub const NELOG_NetlogonFailedFileCreate: DWORD = ERRLOG2_BASE + 76; +pub const NELOG_NetlogonGetSubnetToSite: DWORD = ERRLOG2_BASE + 77; +pub const NELOG_NetlogonNoSiteForClient: DWORD = ERRLOG2_BASE + 78; +pub const NELOG_NetlogonBadSiteName: DWORD = ERRLOG2_BASE + 79; +pub const NELOG_NetlogonBadSubnetName: DWORD = ERRLOG2_BASE + 80; +pub const NELOG_NetlogonDynamicDnsServerFailure: DWORD = ERRLOG2_BASE + 81; +pub const NELOG_NetlogonDynamicDnsFailure: DWORD = ERRLOG2_BASE + 82; +pub const NELOG_NetlogonRpcCallCancelled: DWORD = ERRLOG2_BASE + 83; +pub const NELOG_NetlogonDcSiteCovered: DWORD = ERRLOG2_BASE + 84; +pub const NELOG_NetlogonDcSiteNotCovered: DWORD = ERRLOG2_BASE + 85; +pub const NELOG_NetlogonGcSiteCovered: DWORD = ERRLOG2_BASE + 86; +pub const NELOG_NetlogonGcSiteNotCovered: DWORD = ERRLOG2_BASE + 87; +pub const NELOG_NetlogonFailedSpnUpdate: DWORD = ERRLOG2_BASE + 88; +pub const NELOG_NetlogonFailedDnsHostNameUpdate: DWORD = ERRLOG2_BASE + 89; +pub const NELOG_NetlogonAuthNoUplevelDomainController: DWORD = ERRLOG2_BASE + 90; +pub const NELOG_NetlogonAuthDomainDowngraded: DWORD = ERRLOG2_BASE + 91; +pub const NELOG_NetlogonNdncSiteCovered: DWORD = ERRLOG2_BASE + 92; +pub const NELOG_NetlogonNdncSiteNotCovered: DWORD = ERRLOG2_BASE + 93; +pub const NELOG_NetlogonDcOldSiteCovered: DWORD = ERRLOG2_BASE + 94; +pub const NELOG_NetlogonDcSiteNotCoveredAuto: DWORD = ERRLOG2_BASE + 95; +pub const NELOG_NetlogonGcOldSiteCovered: DWORD = ERRLOG2_BASE + 96; +pub const NELOG_NetlogonGcSiteNotCoveredAuto: DWORD = ERRLOG2_BASE + 97; +pub const NELOG_NetlogonNdncOldSiteCovered: DWORD = ERRLOG2_BASE + 98; +pub const NELOG_NetlogonNdncSiteNotCoveredAuto: DWORD = ERRLOG2_BASE + 99; +pub const NELOG_NetlogonSpnMultipleSamAccountNames: DWORD = ERRLOG2_BASE + 100; +pub const NELOG_NetlogonSpnCrackNamesFailure: DWORD = ERRLOG2_BASE + 101; +pub const NELOG_NetlogonNoAddressToSiteMapping: DWORD = ERRLOG2_BASE + 102; +pub const NELOG_NetlogonInvalidGenericParameterValue: DWORD = ERRLOG2_BASE + 103; +pub const NELOG_NetlogonInvalidDwordParameterValue: DWORD = ERRLOG2_BASE + 104; +pub const NELOG_NetlogonServerAuthFailedNoAccount: DWORD = ERRLOG2_BASE + 105; +pub const NELOG_NetlogonNoDynamicDnsManual: DWORD = ERRLOG2_BASE + 106; +pub const NELOG_NetlogonNoSiteForClients: DWORD = ERRLOG2_BASE + 107; +pub const NELOG_NetlogonDnsDeregAborted: DWORD = ERRLOG2_BASE + 108; +pub const NELOG_NetlogonRpcPortRequestFailure: DWORD = ERRLOG2_BASE + 109; +pub const NELOG_NetlogonPartialSiteMappingForClients: DWORD = ERRLOG2_BASE + 110; +pub const NELOG_NetlogonRemoteDynamicDnsRegisterFailure: DWORD = ERRLOG2_BASE + 111; +pub const NELOG_NetlogonRemoteDynamicDnsDeregisterFailure: DWORD = ERRLOG2_BASE + 112; +pub const NELOG_NetlogonRejectedRemoteDynamicDnsRegister: DWORD = ERRLOG2_BASE + 113; +pub const NELOG_NetlogonRejectedRemoteDynamicDnsDeregister: DWORD = ERRLOG2_BASE + 114; +pub const NELOG_NetlogonRemoteDynamicDnsUpdateRequestFailure: DWORD = ERRLOG2_BASE + 115; +pub const NELOG_NetlogonUserValidationReqInitialTimeOut: DWORD = ERRLOG2_BASE + 116; +pub const NELOG_NetlogonUserValidationReqRecurringTimeOut: DWORD = ERRLOG2_BASE + 117; +pub const NELOG_NetlogonUserValidationReqWaitInitialWarning: DWORD = ERRLOG2_BASE + 118; +pub const NELOG_NetlogonUserValidationReqWaitRecurringWarning: DWORD = ERRLOG2_BASE + 119; +pub const NELOG_NetlogonFailedToAddAuthzRpcInterface: DWORD = ERRLOG2_BASE + 120; +pub const NELOG_NetLogonFailedToInitializeAuthzRm: DWORD = ERRLOG2_BASE + 121; +pub const NELOG_NetLogonFailedToInitializeRPCSD: DWORD = ERRLOG2_BASE + 122; +pub const NELOG_NetlogonMachinePasswdSetSucceeded: DWORD = ERRLOG2_BASE + 123; +pub const NELOG_NetlogonMsaPasswdSetSucceeded: DWORD = ERRLOG2_BASE + 124; diff --git a/bash-5.1/vendor/winapi/src/um/lmjoin.rs b/bash-5.1/vendor/winapi/src/um/lmjoin.rs new file mode 100644 index 0000000000000000000000000000000000000000..72c72c0ee8d4da67bcafbc7d736e5f95da8b359a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmjoin.rs @@ -0,0 +1,232 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// Definitions and prototypes for the Net setup apis +use shared::lmcons::NET_API_STATUS; +use shared::minwindef::{BYTE, DWORD, PBYTE, PDWORD, ULONG}; +use um::wincrypt::PCCERT_CONTEXT; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR, PVOID}; +ENUM!{enum NETSETUP_NAME_TYPE { + NetSetupUnknown = 0, + NetSetupMachine, + NetSetupWorkgroup, + NetSetupDomain, + NetSetupNonExistentDomain, + NetSetupDnsMachine, +}} +pub type PNETSETUP_NAME_TYPE = *mut NETSETUP_NAME_TYPE; +ENUM!{enum DSREG_JOIN_TYPE { + DSREG_UNKNOWN_JOIN = 0, + DSREG_DEVICE_JOIN = 1, + DSREG_WORKPLACE_JOIN = 2, +}} +pub type PDSREG_JOIN_TYPE = *mut DSREG_JOIN_TYPE; +STRUCT!{struct DSREG_USER_INFO { + pszUserEmail: LPWSTR, + pszUserKeyId: LPWSTR, + pszUserKeyName: LPWSTR, +}} +pub type PDSREG_USER_INFO = *mut DSREG_USER_INFO; +STRUCT!{struct DSREG_JOIN_INFO { + joinType: DSREG_JOIN_TYPE, + pJoinCertificate: PCCERT_CONTEXT, + pszDeviceId: LPWSTR, + pszIdpDomain: LPWSTR, + pszTenantId: LPWSTR, + pszJoinUserEmail: LPWSTR, + pszTenantDisplayName: LPWSTR, + pszMdmEnrollmentUrl: LPWSTR, + pszMdmTermsOfUseUrl: LPWSTR, + pszMdmComplianceUrl: LPWSTR, + pszUserSettingSyncUrl: LPWSTR, + pUserInfo: *mut DSREG_USER_INFO, +}} +pub type PDSREG_JOIN_INFO = *mut DSREG_JOIN_INFO; +pub const NETSETUP_JOIN_DOMAIN: DWORD = 0x00000001; +pub const NETSETUP_ACCT_CREATE: DWORD = 0x00000002; +pub const NETSETUP_ACCT_DELETE: DWORD = 0x00000004; +pub const NETSETUP_WIN9X_UPGRADE: DWORD = 0x00000010; +pub const NETSETUP_DOMAIN_JOIN_IF_JOINED: DWORD = 0x00000020; +pub const NETSETUP_JOIN_UNSECURE: DWORD = 0x00000040; +pub const NETSETUP_MACHINE_PWD_PASSED: DWORD = 0x00000080; +pub const NETSETUP_DEFER_SPN_SET: DWORD = 0x00000100; +pub const NETSETUP_JOIN_DC_ACCOUNT: DWORD = 0x00000200; +pub const NETSETUP_JOIN_WITH_NEW_NAME: DWORD = 0x00000400; +pub const NETSETUP_JOIN_READONLY: DWORD = 0x00000800; +pub const NETSETUP_DNS_NAME_CHANGES_ONLY: DWORD = 0x00001000; +pub const NETSETUP_INSTALL_INVOCATION: DWORD = 0x00040000; +pub const NETSETUP_AMBIGUOUS_DC: DWORD = 0x00001000; +pub const NETSETUP_NO_NETLOGON_CACHE: DWORD = 0x00002000; +pub const NETSETUP_DONT_CONTROL_SERVICES: DWORD = 0x00004000; +pub const NETSETUP_SET_MACHINE_NAME: DWORD = 0x00008000; +pub const NETSETUP_FORCE_SPN_SET: DWORD = 0x00010000; +pub const NETSETUP_NO_ACCT_REUSE: DWORD = 0x00020000; +pub const NETSETUP_ALT_SAMACCOUNTNAME: DWORD = 0x00020000; +pub const NETSETUP_IGNORE_UNSUPPORTED_FLAGS: DWORD = 0x10000000; +pub const NETSETUP_VALID_UNJOIN_FLAGS: DWORD = NETSETUP_ACCT_DELETE + | NETSETUP_IGNORE_UNSUPPORTED_FLAGS | NETSETUP_JOIN_DC_ACCOUNT; +pub const NETSETUP_PROCESS_OFFLINE_FLAGS: DWORD = NETSETUP_JOIN_DOMAIN + | NETSETUP_DOMAIN_JOIN_IF_JOINED | NETSETUP_JOIN_WITH_NEW_NAME | NETSETUP_DONT_CONTROL_SERVICES + | NETSETUP_MACHINE_PWD_PASSED; +extern "system" { + pub fn NetJoinDomain( + lpServer: LPCWSTR, + lpDomain: LPCWSTR, + lpMachineAccountOU: LPCWSTR, + lpAccount: LPCWSTR, + lpPassword: LPCWSTR, + fJoinOptions: DWORD, + ) -> NET_API_STATUS; + pub fn NetUnjoinDomain( + lpServer: LPCWSTR, + lpAccount: LPCWSTR, + lpPassword: LPCWSTR, + fUnjoinOptions: DWORD, + ) -> NET_API_STATUS; + pub fn NetRenameMachineInDomain( + lpServer: LPCWSTR, + lpNewMachineName: LPCWSTR, + lpAccount: LPCWSTR, + lpPassword: LPCWSTR, + fRenameOptions: DWORD, + ) -> NET_API_STATUS; + pub fn NetValidateName( + lpServer: LPCWSTR, + lpName: LPCWSTR, + lpAccount: LPCWSTR, + lpPassword: LPCWSTR, + NameType: NETSETUP_NAME_TYPE, + ) -> NET_API_STATUS; + pub fn NetGetJoinableOUs( + lpServer: LPCWSTR, + lpDomain: LPCWSTR, + lpAccount: LPCWSTR, + lpPassword: LPCWSTR, + OUCount: *mut DWORD, + OUs: *mut *mut LPWSTR, + ) -> NET_API_STATUS; +} +pub const NET_IGNORE_UNSUPPORTED_FLAGS: DWORD = 0x01; +extern "system" { + pub fn NetAddAlternateComputerName( + Server: LPCWSTR, + AlternateName: LPCWSTR, + DomainAccount: LPCWSTR, + DomainAccountPassword: LPCWSTR, + Reserved: ULONG, + ) -> NET_API_STATUS; + pub fn NetRemoveAlternateComputerName( + Server: LPCWSTR, + AlternateName: LPCWSTR, + DomainAccount: LPCWSTR, + DomainAccountPassword: LPCWSTR, + Reserved: ULONG, + ) -> NET_API_STATUS; + pub fn NetSetPrimaryComputerName( + Server: LPCWSTR, + PrimaryName: LPCWSTR, + DomainAccount: LPCWSTR, + DomainAccountPassword: LPCWSTR, + Reserved: ULONG, + ) -> NET_API_STATUS; +} +ENUM!{enum NET_COMPUTER_NAME_TYPE { + NetPrimaryComputerName, + NetAlternateComputerNames, + NetAllComputerNames, + NetComputerNameTypeMax, +}} +pub type PNET_COMPUTER_NAME_TYPE = *mut NET_COMPUTER_NAME_TYPE; +extern "system" { + pub fn NetEnumerateComputerNames( + Server: LPCWSTR, + NameType: NET_COMPUTER_NAME_TYPE, + Reserved: ULONG, + EntryCount: PDWORD, + ComputerNames: *mut *mut LPWSTR, + ) -> NET_API_STATUS; +} +pub const NETSETUP_PROVISION_DOWNLEVEL_PRIV_SUPPORT: DWORD = 0x00000001; +pub const NETSETUP_PROVISION_REUSE_ACCOUNT: DWORD = 0x00000002; +pub const NETSETUP_PROVISION_USE_DEFAULT_PASSWORD: DWORD = 0x00000004; +pub const NETSETUP_PROVISION_SKIP_ACCOUNT_SEARCH: DWORD = 0x00000008; +pub const NETSETUP_PROVISION_ROOT_CA_CERTS: DWORD = 0x00000010; +pub const NETSETUP_PROVISION_PERSISTENTSITE: DWORD = 0x00000020; +pub const NETSETUP_PROVISION_ONLINE_CALLER: DWORD = 0x40000000; +pub const NETSETUP_PROVISION_CHECK_PWD_ONLY: DWORD = 0x80000000; +extern "system" { + pub fn NetProvisionComputerAccount( + lpDomain: LPCWSTR, + lpMachineName: LPCWSTR, + lpMachineAccountOU: LPCWSTR, + lpDcName: LPCWSTR, + dwOptions: DWORD, + pProvisionBinData: *mut PBYTE, + pdwProvisionBinDataSize: *mut DWORD, + pProvisionTextData: *mut LPWSTR, + ) -> NET_API_STATUS; + pub fn NetRequestOfflineDomainJoin( + pProvisionBinData: *mut BYTE, + cbProvisionBinDataSize: DWORD, + dwOptions: DWORD, + lpWindowsPath: LPCWSTR, + ) -> NET_API_STATUS; +} +pub const NETSETUP_PROVISIONING_PARAMS_WIN8_VERSION: DWORD = 0x00000001; +pub const NETSETUP_PROVISIONING_PARAMS_CURRENT_VERSION: DWORD = 0x00000002; +STRUCT!{struct NETSETUP_PROVISIONING_PARAMS { + dwVersion: DWORD, + lpDomain: LPCWSTR, + lpHostName: LPCWSTR, + lpMachineAccountOU: LPCWSTR, + lpDcName: LPCWSTR, + dwProvisionOptions: DWORD, + aCertTemplateNames: *mut LPCWSTR, + cCertTemplateNames: DWORD, + aMachinePolicyNames: *mut LPCWSTR, + cMachinePolicyNames: DWORD, + aMachinePolicyPaths: *mut LPCWSTR, + cMachinePolicyPaths: DWORD, + lpNetbiosName: LPWSTR, + lpSiteName: LPWSTR, + lpPrimaryDNSDomain: LPWSTR, +}} +pub type PNETSETUP_PROVISIONING_PARAMS = *mut NETSETUP_PROVISIONING_PARAMS; +extern "system" { + pub fn NetCreateProvisioningPackage( + pProvisioningParams: PNETSETUP_PROVISIONING_PARAMS, + ppPackageBinData: *mut PBYTE, + pdwPackageBinDataSize: *mut DWORD, + ppPackageTextData: *mut LPWSTR, + ) -> NET_API_STATUS; + pub fn NetRequestProvisioningPackageInstall( + pPackageBinData: *mut BYTE, + dwPackageBinDataSize: DWORD, + dwProvisionOptions: DWORD, + lpWindowsPath: LPCWSTR, + pvReserved: PVOID, + ) -> NET_API_STATUS; + pub fn NetGetAadJoinInformation( + pcszTenantId: LPCWSTR, + ppJoinInfo: *mut PDSREG_JOIN_INFO, + ) -> HRESULT; + pub fn NetFreeAadJoinInformation( + pJoinInfo: PDSREG_JOIN_INFO, + ); +} +ENUM!{enum NETSETUP_JOIN_STATUS { + NetSetupUnknownStatus = 0, + NetSetupUnjoined, + NetSetupWorkgroupName, + NetSetupDomainName, +}} +pub type PNETSETUP_JOIN_STATUS = *mut NETSETUP_JOIN_STATUS; +extern "system" { + pub fn NetGetJoinInformation( + lpServer: LPCWSTR, + lpNameBuffer: *mut LPWSTR, + BufferType: PNETSETUP_JOIN_STATUS, + ) -> NET_API_STATUS; +} diff --git a/bash-5.1/vendor/winapi/src/um/lmmsg.rs b/bash-5.1/vendor/winapi/src/um/lmmsg.rs new file mode 100644 index 0000000000000000000000000000000000000000..9970fe94e912bee837898633afd6250ef9f4285e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmmsg.rs @@ -0,0 +1,56 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This file contains structures, function prototypes, and definitions for the NetMessage API +use shared::lmcons::NET_API_STATUS; +use shared::minwindef::{DWORD, LPBYTE, LPDWORD}; +use um::winnt::{LPCWSTR, LPWSTR}; +extern "system" { + pub fn NetMessageNameAdd( + servername: LPCWSTR, + msgname: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetMessageNameEnum( + servername: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetMessageNameGetInfo( + servername: LPCWSTR, + msgname: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetMessageNameDel( + servername: LPCWSTR, + msgname: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetMessageBufferSend( + servername: LPCWSTR, + msgname: LPCWSTR, + fromname: LPCWSTR, + buf: LPBYTE, + buflen: DWORD, + ) -> NET_API_STATUS; +} +STRUCT!{struct MSG_INFO_0 { + msgi0_name: LPWSTR, +}} +pub type PMSG_INFO_0 = *mut MSG_INFO_0; +pub type LPMSG_INFO_0 = *mut MSG_INFO_0; +STRUCT!{struct MSG_INFO_1 { + msgi1_name: LPWSTR, + msgi1_forward_flag: DWORD, + msgi1_forward: LPWSTR, +}} +pub type PMSG_INFO_1 = *mut MSG_INFO_1; +pub type LPMSG_INFO_1 = *mut MSG_INFO_1; +pub const MSGNAME_NOT_FORWARDED: DWORD = 0; +pub const MSGNAME_FORWARDED_TO: DWORD = 0x04; +pub const MSGNAME_FORWARDED_FROM: DWORD = 0x10; diff --git a/bash-5.1/vendor/winapi/src/um/lmremutl.rs b/bash-5.1/vendor/winapi/src/um/lmremutl.rs new file mode 100644 index 0000000000000000000000000000000000000000..27275203b575cf8b59c71301e5e843220483bc51 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmremutl.rs @@ -0,0 +1,61 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This file contains structures, function prototypes, and definitions for the NetRemote API +use shared::lmcons::NET_API_STATUS; +use shared::minwindef::{DWORD, LPBYTE, LPDWORD}; +use um::winnt::{CHAR, LONG, LPCWSTR, LPSTR}; +pub type DESC_CHAR = CHAR; +pub type LPDESC = LPSTR; +extern "system" { + pub fn NetRemoteTOD( + UncServerName: LPCWSTR, + BufferPtr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetRemoteComputerSupports( + UncServerName: LPCWSTR, + OptionsWanted: DWORD, + OptionsSupported: LPDWORD, + ) -> NET_API_STATUS; +} +extern "C" { + pub fn RxRemoteApi( + ApiNumber: DWORD, + UncServerName: LPCWSTR, + ParmDescString: LPDESC, + DataDesc16: LPDESC, + DataDesc32: LPDESC, + DataDescSmb: LPDESC, + AuxDesc16: LPDESC, + AuxDesc32: LPDESC, + AuxDescSmb: LPDESC, + Flags: DWORD, + ) -> NET_API_STATUS; +} +STRUCT!{struct TIME_OF_DAY_INFO { + tod_elapsedt: DWORD, + tod_msecs: DWORD, + tod_hours: DWORD, + tod_mins: DWORD, + tod_secs: DWORD, + tod_hunds: DWORD, + tod_timezone: LONG, + tod_tinterval: DWORD, + tod_day: DWORD, + tod_month: DWORD, + tod_year: DWORD, + tod_weekday: DWORD, +}} +pub type PTIME_OF_DAY_INFO = *mut TIME_OF_DAY_INFO; +pub type LPTIME_OF_DAY_INFO = *mut TIME_OF_DAY_INFO; +pub const SUPPORTS_REMOTE_ADMIN_PROTOCOL: DWORD = 0x00000002; +pub const SUPPORTS_RPC: DWORD = 0x00000004; +pub const SUPPORTS_SAM_PROTOCOL: DWORD = 0x00000008; +pub const SUPPORTS_UNICODE: DWORD = 0x00000010; +pub const SUPPORTS_LOCAL: DWORD = 0x00000020; +pub const SUPPORTS_ANY: DWORD = 0xFFFFFFFF; +pub const NO_PERMISSION_REQUIRED: DWORD = 0x00000001; +pub const ALLOCATE_RESPONSE: DWORD = 0x00000002; +pub const USE_SPECIFIC_TRANSPORT: DWORD = 0x80000000; diff --git a/bash-5.1/vendor/winapi/src/um/lmrepl.rs b/bash-5.1/vendor/winapi/src/um/lmrepl.rs new file mode 100644 index 0000000000000000000000000000000000000000..81a665be55694e0a4f6a41b0543c7a6da7753503 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmrepl.rs @@ -0,0 +1,200 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This file contains structures, function prototypes, and definitions for the replicator APIs +use shared::lmcons::{NET_API_STATUS, PARMNUM_BASE_INFOLEVEL}; +use shared::minwindef::{DWORD, LPBYTE, LPDWORD}; +use um::winnt::{LPCWSTR, LPWSTR}; +pub const REPL_ROLE_EXPORT: DWORD = 1; +pub const REPL_ROLE_IMPORT: DWORD = 2; +pub const REPL_ROLE_BOTH: DWORD = 3; +pub const REPL_INTERVAL_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + 0; +pub const REPL_PULSE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + 1; +pub const REPL_GUARDTIME_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + 2; +pub const REPL_RANDOM_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + 3; +STRUCT!{struct REPL_INFO_0 { + rp0_role: DWORD, + rp0_exportpath: LPWSTR, + rp0_exportlist: LPWSTR, + rp0_importpath: LPWSTR, + rp0_importlist: LPWSTR, + rp0_logonusername: LPWSTR, + rp0_interval: DWORD, + rp0_pulse: DWORD, + rp0_guardtime: DWORD, + rp0_random: DWORD, +}} +pub type PREPL_INFO_0 = *mut REPL_INFO_0; +pub type LPREPL_INFO_0 = *mut REPL_INFO_0; +STRUCT!{struct REPL_INFO_1000 { + rp1000_interval: DWORD, +}} +pub type PREPL_INFO_1000 = *mut REPL_INFO_1000; +pub type LPREPL_INFO_1000 = *mut REPL_INFO_1000; +STRUCT!{struct REPL_INFO_1001 { + rp1001_pulse: DWORD, +}} +pub type PREPL_INFO_1001 = *mut REPL_INFO_1001; +pub type LPREPL_INFO_1001 = *mut REPL_INFO_1001; +STRUCT!{struct REPL_INFO_1002 { + rp1002_guardtime: DWORD, +}} +pub type PREPL_INFO_1002 = *mut REPL_INFO_1002; +pub type LPREPL_INFO_1002 = *mut REPL_INFO_1002; +STRUCT!{struct REPL_INFO_1003 { + rp1003_random: DWORD, +}} +pub type PREPL_INFO_1003 = *mut REPL_INFO_1003; +pub type LPREPL_INFO_1003 = *mut REPL_INFO_1003; +extern "system" { + pub fn NetReplGetInfo( + servername: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetReplSetInfo( + servername: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; +} +pub const REPL_INTEGRITY_FILE: DWORD = 1; +pub const REPL_INTEGRITY_TREE: DWORD = 2; +pub const REPL_EXTENT_FILE: DWORD = 1; +pub const REPL_EXTENT_TREE: DWORD = 2; +pub const REPL_EXPORT_INTEGRITY_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + 0; +pub const REPL_EXPORT_EXTENT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + 1; +STRUCT!{struct REPL_EDIR_INFO_0 { + rped0_dirname: LPWSTR, +}} +pub type PREPL_EDIR_INFO_0 = *mut REPL_EDIR_INFO_0; +pub type LPREPL_EDIR_INFO_0 = *mut REPL_EDIR_INFO_0; +STRUCT!{struct REPL_EDIR_INFO_1 { + rped1_dirname: LPWSTR, + rped1_integrity: DWORD, + rped1_extent: DWORD, +}} +pub type PREPL_EDIR_INFO_1 = *mut REPL_EDIR_INFO_1; +pub type LPREPL_EDIR_INFO_1 = *mut REPL_EDIR_INFO_1; +STRUCT!{struct REPL_EDIR_INFO_2 { + rped2_dirname: LPWSTR, + rped2_integrity: DWORD, + rped2_extent: DWORD, + rped2_lockcount: DWORD, + rped2_locktime: DWORD, +}} +pub type PREPL_EDIR_INFO_2 = *mut REPL_EDIR_INFO_2; +pub type LPREPL_EDIR_INFO_2 = *mut REPL_EDIR_INFO_2; +STRUCT!{struct REPL_EDIR_INFO_1000 { + rped1000_integrity: DWORD, +}} +pub type PREPL_EDIR_INFO_1000 = *mut REPL_EDIR_INFO_1000; +pub type LPREPL_EDIR_INFO_1000 = *mut REPL_EDIR_INFO_1000; +STRUCT!{struct REPL_EDIR_INFO_1001 { + rped1001_extent: DWORD, +}} +pub type PREPL_EDIR_INFO_1001 = *mut REPL_EDIR_INFO_1001; +pub type LPREPL_EDIR_INFO_1001 = *mut REPL_EDIR_INFO_1001; +extern "system" { + pub fn NetReplExportDirAdd( + servername: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetReplExportDirDel( + servername: LPCWSTR, + dirname: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetReplExportDirEnum( + servername: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetReplExportDirGetInfo( + servername: LPCWSTR, + dirname: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetReplExportDirSetInfo( + servername: LPCWSTR, + dirname: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetReplExportDirLock( + servername: LPCWSTR, + dirname: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetReplExportDirUnlock( + servername: LPCWSTR, + dirname: LPCWSTR, + unlockforce: DWORD, + ) -> NET_API_STATUS; +} +pub const REPL_UNLOCK_NOFORCE: DWORD = 0; +pub const REPL_UNLOCK_FORCE: DWORD = 1; +STRUCT!{struct REPL_IDIR_INFO_0 { + rpid0_dirname: LPWSTR, +}} +pub type PREPL_IDIR_INFO_0 = *mut REPL_IDIR_INFO_0; +pub type LPREPL_IDIR_INFO_0 = *mut REPL_IDIR_INFO_0; +STRUCT!{struct REPL_IDIR_INFO_1 { + rpid1_dirname: LPWSTR, + rpid1_state: DWORD, + rpid1_mastername: LPWSTR, + rpid1_last_update_time: DWORD, + rpid1_lockcount: DWORD, + rpid1_locktime: DWORD, +}} +pub type PREPL_IDIR_INFO_1 = *mut REPL_IDIR_INFO_1; +pub type LPREPL_IDIR_INFO_1 = *mut REPL_IDIR_INFO_1; +extern "system" { + pub fn NetReplImportDirAdd( + servername: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetReplImportDirDel( + servername: LPCWSTR, + dirname: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetReplImportDirEnum( + servername: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetReplImportDirGetInfo( + servername: LPCWSTR, + dirname: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetReplImportDirLock( + servername: LPCWSTR, + dirname: LPCWSTR, + ) -> NET_API_STATUS; + pub fn NetReplImportDirUnlock( + servername: LPCWSTR, + dirname: LPCWSTR, + unlockforce: DWORD, + ) -> NET_API_STATUS; +} +pub const REPL_STATE_OK: DWORD = 0; +pub const REPL_STATE_NO_MASTER: DWORD = 1; +pub const REPL_STATE_NO_SYNC: DWORD = 2; +pub const REPL_STATE_NEVER_REPLICATED: DWORD = 3; diff --git a/bash-5.1/vendor/winapi/src/um/lmserver.rs b/bash-5.1/vendor/winapi/src/um/lmserver.rs new file mode 100644 index 0000000000000000000000000000000000000000..621c4be9a5117bd4c1028e6de867386352e5d2a4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmserver.rs @@ -0,0 +1,1255 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This file contains information about NetServer APIs +use shared::guiddef::GUID; +use shared::lmcons::{LMCSTR, LMSTR, NET_API_STATUS, PARMNUM_BASE_INFOLEVEL, PATHLEN}; +use shared::minwindef::{BOOL, BYTE, DWORD, LPBYTE, LPDWORD, ULONG}; +use um::winnt::{BOOLEAN, LONG}; +use um::winsvc::SERVICE_STATUS_HANDLE; +extern "system" { + pub fn NetServerEnum( + servername: LMCSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + servertype: DWORD, + domain: LMCSTR, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetServerEnumEx( + servername: LMCSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + servertype: DWORD, + domain: LMCSTR, + FirstNameToReturn: LMCSTR, + ) -> NET_API_STATUS; + pub fn NetServerGetInfo( + servername: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetServerSetInfo( + servername: LMSTR, + level: DWORD, + buf: LPBYTE, + ParmError: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetServerDiskEnum( + servername: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetServerComputerNameAdd( + ServerName: LMSTR, + EmulatedDomainName: LMSTR, + EmulatedServerName: LMSTR, + ) -> NET_API_STATUS; + pub fn NetServerComputerNameDel( + ServerName: LMSTR, + EmulatedServerName: LMSTR, + ) -> NET_API_STATUS; + pub fn NetServerTransportAdd( + servername: LMSTR, + level: DWORD, + bufptr: LPBYTE, + ) -> NET_API_STATUS; + pub fn NetServerTransportAddEx( + servername: LMSTR, + level: DWORD, + bufptr: LPBYTE, + ) -> NET_API_STATUS; + pub fn NetServerTransportDel( + servername: LMSTR, + level: DWORD, + bufptr: LPBYTE, + ) -> NET_API_STATUS; + pub fn NetServerTransportEnum( + servername: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn SetServiceBits( + hServiceStatus: SERVICE_STATUS_HANDLE, + dwServiceBits: DWORD, + bSetBitsOn: BOOL, + bUpdateImmediately: BOOL, + ) -> BOOL; +} +STRUCT!{struct SERVER_INFO_100 { + sv100_platform_id: DWORD, + sv100_name: LMSTR, +}} +pub type PSERVER_INFO_100 = *mut SERVER_INFO_100; +pub type LPSERVER_INFO_100 = *mut SERVER_INFO_100; +STRUCT!{struct SERVER_INFO_101 { + sv101_platform_id: DWORD, + sv101_name: LMSTR, + sv101_version_major: DWORD, + sv101_version_minor: DWORD, + sv101_type: DWORD, + sv101_comment: LMSTR, +}} +pub type PSERVER_INFO_101 = *mut SERVER_INFO_101; +pub type LPSERVER_INFO_101 = *mut SERVER_INFO_101; +STRUCT!{struct SERVER_INFO_102 { + sv102_platform_id: DWORD, + sv102_name: LMSTR, + sv102_version_major: DWORD, + sv102_version_minor: DWORD, + sv102_type: DWORD, + sv102_comment: LMSTR, + sv102_users: DWORD, + sv102_disc: LONG, + sv102_hidden: BOOL, + sv102_announce: DWORD, + sv102_anndelta: DWORD, + sv102_licenses: DWORD, + sv102_userpath: LMSTR, +}} +pub type PSERVER_INFO_102 = *mut SERVER_INFO_102; +pub type LPSERVER_INFO_102 = *mut SERVER_INFO_102; +STRUCT!{struct SERVER_INFO_103 { + sv103_platform_id: DWORD, + sv103_name: LMSTR, + sv103_version_major: DWORD, + sv103_version_minor: DWORD, + sv103_type: DWORD, + sv103_comment: LMSTR, + sv103_users: DWORD, + sv103_disc: LONG, + sv103_hidden: BOOL, + sv103_announce: DWORD, + sv103_anndelta: DWORD, + sv103_licenses: DWORD, + sv103_userpath: LMSTR, + sv103_capabilities: DWORD, +}} +pub type PSERVER_INFO_103 = *mut SERVER_INFO_103; +pub type LPSERVER_INFO_103 = *mut SERVER_INFO_103; +STRUCT!{struct SERVER_INFO_402 { + sv402_ulist_mtime: DWORD, + sv402_glist_mtime: DWORD, + sv402_alist_mtime: DWORD, + sv402_alerts: LMSTR, + sv402_security: DWORD, + sv402_numadmin: DWORD, + sv402_lanmask: DWORD, + sv402_guestacct: LMSTR, + sv402_chdevs: DWORD, + sv402_chdevq: DWORD, + sv402_chdevjobs: DWORD, + sv402_connections: DWORD, + sv402_shares: DWORD, + sv402_openfiles: DWORD, + sv402_sessopens: DWORD, + sv402_sessvcs: DWORD, + sv402_sessreqs: DWORD, + sv402_opensearch: DWORD, + sv402_activelocks: DWORD, + sv402_numreqbuf: DWORD, + sv402_sizreqbuf: DWORD, + sv402_numbigbuf: DWORD, + sv402_numfiletasks: DWORD, + sv402_alertsched: DWORD, + sv402_erroralert: DWORD, + sv402_logonalert: DWORD, + sv402_accessalert: DWORD, + sv402_diskalert: DWORD, + sv402_netioalert: DWORD, + sv402_maxauditsz: DWORD, + sv402_srvheuristics: LMSTR, +}} +pub type PSERVER_INFO_402 = *mut SERVER_INFO_402; +pub type LPSERVER_INFO_402 = *mut SERVER_INFO_402; +STRUCT!{struct SERVER_INFO_403 { + sv403_ulist_mtime: DWORD, + sv403_glist_mtime: DWORD, + sv403_alist_mtime: DWORD, + sv403_alerts: LMSTR, + sv403_security: DWORD, + sv403_numadmin: DWORD, + sv403_lanmask: DWORD, + sv403_guestacct: LMSTR, + sv403_chdevs: DWORD, + sv403_chdevq: DWORD, + sv403_chdevjobs: DWORD, + sv403_connections: DWORD, + sv403_shares: DWORD, + sv403_openfiles: DWORD, + sv403_sessopens: DWORD, + sv403_sessvcs: DWORD, + sv403_sessreqs: DWORD, + sv403_opensearch: DWORD, + sv403_activelocks: DWORD, + sv403_numreqbuf: DWORD, + sv403_sizreqbuf: DWORD, + sv403_numbigbuf: DWORD, + sv403_numfiletasks: DWORD, + sv403_alertsched: DWORD, + sv403_erroralert: DWORD, + sv403_logonalert: DWORD, + sv403_accessalert: DWORD, + sv403_diskalert: DWORD, + sv403_netioalert: DWORD, + sv403_maxauditsz: DWORD, + sv403_srvheuristics: LMSTR, + sv403_auditedevents: DWORD, + sv403_autoprofile: DWORD, + sv403_autopath: LMSTR, +}} +pub type PSERVER_INFO_403 = *mut SERVER_INFO_403; +pub type LPSERVER_INFO_403 = *mut SERVER_INFO_403; +STRUCT!{struct SERVER_INFO_502 { + sv502_sessopens: DWORD, + sv502_sessvcs: DWORD, + sv502_opensearch: DWORD, + sv502_sizreqbuf: DWORD, + sv502_initworkitems: DWORD, + sv502_maxworkitems: DWORD, + sv502_rawworkitems: DWORD, + sv502_irpstacksize: DWORD, + sv502_maxrawbuflen: DWORD, + sv502_sessusers: DWORD, + sv502_sessconns: DWORD, + sv502_maxpagedmemoryusage: DWORD, + sv502_maxnonpagedmemoryusage: DWORD, + sv502_enablesoftcompat: BOOL, + sv502_enableforcedlogoff: BOOL, + sv502_timesource: BOOL, + sv502_acceptdownlevelapis: BOOL, + sv502_lmannounce: BOOL, +}} +pub type PSERVER_INFO_502 = *mut SERVER_INFO_502; +pub type LPSERVER_INFO_502 = *mut SERVER_INFO_502; +STRUCT!{struct SERVER_INFO_503 { + sv503_sessopens : DWORD, + sv503_sessvcs: DWORD, + sv503_opensearch: DWORD, + sv503_sizreqbuf: DWORD, + sv503_initworkitems: DWORD, + sv503_maxworkitems: DWORD, + sv503_rawworkitems: DWORD, + sv503_irpstacksize: DWORD, + sv503_maxrawbuflen: DWORD, + sv503_sessusers: DWORD, + sv503_sessconns: DWORD, + sv503_maxpagedmemoryusage: DWORD, + sv503_maxnonpagedmemoryusage: DWORD, + sv503_enablesoftcompat: BOOL, + sv503_enableforcedlogoff: BOOL, + sv503_timesource: BOOL, + sv503_acceptdownlevelapis: BOOL, + sv503_lmannounce: BOOL, + sv503_domain: LMSTR, + sv503_maxcopyreadlen: DWORD, + sv503_maxcopywritelen: DWORD, + sv503_minkeepsearch: DWORD, + sv503_maxkeepsearch: DWORD, + sv503_minkeepcomplsearch: DWORD, + sv503_maxkeepcomplsearch: DWORD, + sv503_threadcountadd: DWORD, + sv503_numblockthreads: DWORD, + sv503_scavtimeout: DWORD, + sv503_minrcvqueue: DWORD, + sv503_minfreeworkitems: DWORD, + sv503_xactmemsize: DWORD, + sv503_threadpriority: DWORD, + sv503_maxmpxct: DWORD, + sv503_oplockbreakwait: DWORD, + sv503_oplockbreakresponsewait: DWORD, + sv503_enableoplocks: BOOL, + sv503_enableoplockforceclose: BOOL, + sv503_enablefcbopens: BOOL, + sv503_enableraw: BOOL, + sv503_enablesharednetdrives: BOOL, + sv503_minfreeconnections: DWORD, + sv503_maxfreeconnections: DWORD, +}} +pub type PSERVER_INFO_503 = *mut SERVER_INFO_503; +pub type LPSERVER_INFO_503 = *mut SERVER_INFO_503; +STRUCT!{struct SERVER_INFO_599 { + sv599_sessopens: DWORD, + sv599_sessvcs: DWORD, + sv599_opensearch: DWORD, + sv599_sizreqbuf: DWORD, + sv599_initworkitems: DWORD, + sv599_maxworkitems: DWORD, + sv599_rawworkitems: DWORD, + sv599_irpstacksize: DWORD, + sv599_maxrawbuflen: DWORD, + sv599_sessusers: DWORD, + sv599_sessconns: DWORD, + sv599_maxpagedmemoryusage: DWORD, + sv599_maxnonpagedmemoryusage: DWORD, + sv599_enablesoftcompat: BOOL, + sv599_enableforcedlogoff: BOOL, + sv599_timesource: BOOL, + sv599_acceptdownlevelapis: BOOL, + sv599_lmannounce: BOOL, + sv599_domain: LMSTR, + sv599_maxcopyreadlen: DWORD, + sv599_maxcopywritelen: DWORD, + sv599_minkeepsearch: DWORD, + sv599_maxkeepsearch: DWORD, + sv599_minkeepcomplsearch: DWORD, + sv599_maxkeepcomplsearch: DWORD, + sv599_threadcountadd: DWORD, + sv599_numblockthreads: DWORD, + sv599_scavtimeout: DWORD, + sv599_minrcvqueue: DWORD, + sv599_minfreeworkitems: DWORD, + sv599_xactmemsize: DWORD, + sv599_threadpriority: DWORD, + sv599_maxmpxct: DWORD, + sv599_oplockbreakwait: DWORD, + sv599_oplockbreakresponsewait: DWORD, + sv599_enableoplocks: BOOL, + sv599_enableoplockforceclose: BOOL, + sv599_enablefcbopens: BOOL, + sv599_enableraw: BOOL, + sv599_enablesharednetdrives: BOOL, + sv599_minfreeconnections: DWORD, + sv599_maxfreeconnections: DWORD, + sv599_initsesstable: DWORD, + sv599_initconntable: DWORD, + sv599_initfiletable: DWORD, + sv599_initsearchtable: DWORD, + sv599_alertschedule: DWORD, + sv599_errorthreshold: DWORD, + sv599_networkerrorthreshold: DWORD, + sv599_diskspacethreshold: DWORD, + sv599_reserved: DWORD, + sv599_maxlinkdelay: DWORD, + sv599_minlinkthroughput: DWORD, + sv599_linkinfovalidtime: DWORD, + sv599_scavqosinfoupdatetime: DWORD, + sv599_maxworkitemidletime: DWORD, +}} +pub type PSERVER_INFO_599 = *mut SERVER_INFO_599; +pub type LPSERVER_INFO_599 = *mut SERVER_INFO_599; +STRUCT!{struct SERVER_INFO_598 { + sv598_maxrawworkitems: DWORD, + sv598_maxthreadsperqueue: DWORD, + sv598_producttype: DWORD, + sv598_serversize: DWORD, + sv598_connectionlessautodisc: DWORD, + sv598_sharingviolationretries: DWORD, + sv598_sharingviolationdelay: DWORD, + sv598_maxglobalopensearch: DWORD, + sv598_removeduplicatesearches: DWORD, + sv598_lockviolationoffset: DWORD, + sv598_lockviolationdelay: DWORD, + sv598_mdlreadswitchover: DWORD, + sv598_cachedopenlimit: DWORD, + sv598_otherqueueaffinity: DWORD, + sv598_restrictnullsessaccess: BOOL, + sv598_enablewfw311directipx: BOOL, + sv598_queuesamplesecs: DWORD, + sv598_balancecount: DWORD, + sv598_preferredaffinity: DWORD, + sv598_maxfreerfcbs: DWORD, + sv598_maxfreemfcbs: DWORD, + sv598_maxfreelfcbs: DWORD, + sv598_maxfreepagedpoolchunks: DWORD, + sv598_minpagedpoolchunksize: DWORD, + sv598_maxpagedpoolchunksize: DWORD, + sv598_sendsfrompreferredprocessor: BOOL, + sv598_cacheddirectorylimit: DWORD, + sv598_maxcopylength: DWORD, + sv598_enablecompression: BOOL, + sv598_autosharewks: BOOL, + sv598_autoshareserver: BOOL, + sv598_enablesecuritysignature: BOOL, + sv598_requiresecuritysignature: BOOL, + sv598_minclientbuffersize: DWORD, + sv598_serverguid: GUID, + sv598_ConnectionNoSessionsTimeout: DWORD, + sv598_IdleThreadTimeOut: DWORD, + sv598_enableW9xsecuritysignature: BOOL, + sv598_enforcekerberosreauthentication: BOOL, + sv598_disabledos: BOOL, + sv598_lowdiskspaceminimum: DWORD, + sv598_disablestrictnamechecking: BOOL, + sv598_enableauthenticateusersharing: BOOL, +}} +pub type PSERVER_INFO_598 = *mut SERVER_INFO_598; +pub type LPSERVER_INFO_598 = *mut SERVER_INFO_598; +STRUCT!{struct SERVER_INFO_1005 { + sv1005_comment: LMSTR, +}} +pub type PSERVER_INFO_1005 = *mut SERVER_INFO_1005; +pub type LPSERVER_INFO_1005 = *mut SERVER_INFO_1005; +STRUCT!{struct SERVER_INFO_1107 { + sv1107_users: DWORD, +}} +pub type PSERVER_INFO_1107 = *mut SERVER_INFO_1107; +pub type LPSERVER_INFO_1107 = *mut SERVER_INFO_1107; +STRUCT!{struct SERVER_INFO_1010 { + sv1010_disc: LONG, +}} +pub type PSERVER_INFO_1010 = *mut SERVER_INFO_1010; +pub type LPSERVER_INFO_1010 = *mut SERVER_INFO_1010; +STRUCT!{struct SERVER_INFO_1016 { + sv1016_hidden: BOOL, +}} +pub type PSERVER_INFO_1016 = *mut SERVER_INFO_1016; +pub type LPSERVER_INFO_1016 = *mut SERVER_INFO_1016; +STRUCT!{struct SERVER_INFO_1017 { + sv1017_announce: DWORD, +}} +pub type PSERVER_INFO_1017 = *mut SERVER_INFO_1017; +pub type LPSERVER_INFO_1017 = *mut SERVER_INFO_1017; +STRUCT!{struct SERVER_INFO_1018 { + sv1018_anndelta: DWORD, +}} +pub type PSERVER_INFO_1018 = *mut SERVER_INFO_1018; +pub type LPSERVER_INFO_1018 = *mut SERVER_INFO_1018; +STRUCT!{struct SERVER_INFO_1501 { + sv1501_sessopens: DWORD, +}} +pub type PSERVER_INFO_1501 = *mut SERVER_INFO_1501; +pub type LPSERVER_INFO_1501 = *mut SERVER_INFO_1501; +STRUCT!{struct SERVER_INFO_1502 { + sv1502_sessvcs: DWORD, +}} +pub type PSERVER_INFO_1502 = *mut SERVER_INFO_1502; +pub type LPSERVER_INFO_1502 = *mut SERVER_INFO_1502; +STRUCT!{struct SERVER_INFO_1503 { + sv1503_opensearch: DWORD, +}} +pub type PSERVER_INFO_1503 = *mut SERVER_INFO_1503; +pub type LPSERVER_INFO_1503 = *mut SERVER_INFO_1503; +STRUCT!{struct SERVER_INFO_1506 { + sv1506_maxworkitems: DWORD, +}} +pub type PSERVER_INFO_1506 = *mut SERVER_INFO_1506; +pub type LPSERVER_INFO_1506 = *mut SERVER_INFO_1506; +STRUCT!{struct SERVER_INFO_1509 { + sv1509_maxrawbuflen: DWORD, +}} +pub type PSERVER_INFO_1509 = *mut SERVER_INFO_1509; +pub type LPSERVER_INFO_1509 = *mut SERVER_INFO_1509; +STRUCT!{struct SERVER_INFO_1510 { + sv1510_sessusers: DWORD, +}} +pub type PSERVER_INFO_1510 = *mut SERVER_INFO_1510; +pub type LPSERVER_INFO_1510 = *mut SERVER_INFO_1510; +STRUCT!{struct SERVER_INFO_1511 { + sv1511_sessconns: DWORD, +}} +pub type PSERVER_INFO_1511 = *mut SERVER_INFO_1511; +pub type LPSERVER_INFO_1511 = *mut SERVER_INFO_1511; +STRUCT!{struct SERVER_INFO_1512 { + sv1512_maxnonpagedmemoryusage: DWORD, +}} +pub type PSERVER_INFO_1512 = *mut SERVER_INFO_1512; +pub type LPSERVER_INFO_1512 = *mut SERVER_INFO_1512; +STRUCT!{struct SERVER_INFO_1513 { + sv1513_maxpagedmemoryusage: DWORD, +}} +pub type PSERVER_INFO_1513 = *mut SERVER_INFO_1513; +pub type LPSERVER_INFO_1513 = *mut SERVER_INFO_1513; +STRUCT!{struct SERVER_INFO_1514 { + sv1514_enablesoftcompat: BOOL, +}} +pub type PSERVER_INFO_1514 = *mut SERVER_INFO_1514; +pub type LPSERVER_INFO_1514 = *mut SERVER_INFO_1514; +STRUCT!{struct SERVER_INFO_1515 { + sv1515_enableforcedlogoff: BOOL, +}} +pub type PSERVER_INFO_1515 = *mut SERVER_INFO_1515; +pub type LPSERVER_INFO_1515 = *mut SERVER_INFO_1515; +STRUCT!{struct SERVER_INFO_1516 { + sv1516_timesource: BOOL, +}} +pub type PSERVER_INFO_1516 = *mut SERVER_INFO_1516; +pub type LPSERVER_INFO_1516 = *mut SERVER_INFO_1516; +STRUCT!{struct SERVER_INFO_1518 { + sv1518_lmannounce: BOOL, +}} +pub type PSERVER_INFO_1518 = *mut SERVER_INFO_1518; +pub type LPSERVER_INFO_1518 = *mut SERVER_INFO_1518; +STRUCT!{struct SERVER_INFO_1520 { + sv1520_maxcopyreadlen: DWORD, +}} +pub type PSERVER_INFO_1520 = *mut SERVER_INFO_1520; +pub type LPSERVER_INFO_1520 = *mut SERVER_INFO_1520; +STRUCT!{struct SERVER_INFO_1521 { + sv1521_maxcopywritelen: DWORD, +}} +pub type PSERVER_INFO_1521 = *mut SERVER_INFO_1521; +pub type LPSERVER_INFO_1521 = *mut SERVER_INFO_1521; +STRUCT!{struct SERVER_INFO_1522 { + sv1522_minkeepsearch: DWORD, +}} +pub type PSERVER_INFO_1522 = *mut SERVER_INFO_1522; +pub type LPSERVER_INFO_1522 = *mut SERVER_INFO_1522; +STRUCT!{struct SERVER_INFO_1523 { + sv1523_maxkeepsearch: DWORD, +}} +pub type PSERVER_INFO_1523 = *mut SERVER_INFO_1523; +pub type LPSERVER_INFO_1523 = *mut SERVER_INFO_1523; +STRUCT!{struct SERVER_INFO_1524 { + sv1524_minkeepcomplsearch: DWORD, +}} +pub type PSERVER_INFO_1524 = *mut SERVER_INFO_1524; +pub type LPSERVER_INFO_1524 = *mut SERVER_INFO_1524; +STRUCT!{struct SERVER_INFO_1525 { + sv1525_maxkeepcomplsearch: DWORD, +}} +pub type PSERVER_INFO_1525 = *mut SERVER_INFO_1525; +pub type LPSERVER_INFO_1525 = *mut SERVER_INFO_1525; +STRUCT!{struct SERVER_INFO_1528 { + sv1528_scavtimeout: DWORD, +}} +pub type PSERVER_INFO_1528 = *mut SERVER_INFO_1528; +pub type LPSERVER_INFO_1528 = *mut SERVER_INFO_1528; +STRUCT!{struct SERVER_INFO_1529 { + sv1529_minrcvqueue: DWORD, +}} +pub type PSERVER_INFO_1529 = *mut SERVER_INFO_1529; +pub type LPSERVER_INFO_1529 = *mut SERVER_INFO_1529; +STRUCT!{struct SERVER_INFO_1530 { + sv1530_minfreeworkitems: DWORD, +}} +pub type PSERVER_INFO_1530 = *mut SERVER_INFO_1530; +pub type LPSERVER_INFO_1530 = *mut SERVER_INFO_1530; +STRUCT!{struct SERVER_INFO_1533 { + sv1533_maxmpxct: DWORD, +}} +pub type PSERVER_INFO_1533 = *mut SERVER_INFO_1533; +pub type LPSERVER_INFO_1533 = *mut SERVER_INFO_1533; +STRUCT!{struct SERVER_INFO_1534 { + sv1534_oplockbreakwait: DWORD, +}} +pub type PSERVER_INFO_1534 = *mut SERVER_INFO_1534; +pub type LPSERVER_INFO_1534 = *mut SERVER_INFO_1534; +STRUCT!{struct SERVER_INFO_1535 { + sv1535_oplockbreakresponsewait: DWORD, +}} +pub type PSERVER_INFO_1535 = *mut SERVER_INFO_1535; +pub type LPSERVER_INFO_1535 = *mut SERVER_INFO_1535; +STRUCT!{struct SERVER_INFO_1536 { + sv1536_enableoplocks: BOOL, +}} +pub type PSERVER_INFO_1536 = *mut SERVER_INFO_1536; +pub type LPSERVER_INFO_1536 = *mut SERVER_INFO_1536; +STRUCT!{struct SERVER_INFO_1537 { + sv1537_enableoplockforceclose: BOOL, +}} +pub type PSERVER_INFO_1537 = *mut SERVER_INFO_1537; +pub type LPSERVER_INFO_1537 = *mut SERVER_INFO_1537; +STRUCT!{struct SERVER_INFO_1538 { + sv1538_enablefcbopens: BOOL, +}} +pub type PSERVER_INFO_1538 = *mut SERVER_INFO_1538; +pub type LPSERVER_INFO_1538 = *mut SERVER_INFO_1538; +STRUCT!{struct SERVER_INFO_1539 { + sv1539_enableraw: BOOL, +}} +pub type PSERVER_INFO_1539 = *mut SERVER_INFO_1539; +pub type LPSERVER_INFO_1539 = *mut SERVER_INFO_1539; +STRUCT!{struct SERVER_INFO_1540 { + sv1540_enablesharednetdrives: BOOL, +}} +pub type PSERVER_INFO_1540 = *mut SERVER_INFO_1540; +pub type LPSERVER_INFO_1540 = *mut SERVER_INFO_1540; +STRUCT!{struct SERVER_INFO_1541 { + sv1541_minfreeconnections: BOOL, +}} +pub type PSERVER_INFO_1541 = *mut SERVER_INFO_1541; +pub type LPSERVER_INFO_1541 = *mut SERVER_INFO_1541; +STRUCT!{struct SERVER_INFO_1542 { + sv1542_maxfreeconnections: BOOL, +}} +pub type PSERVER_INFO_1542 = *mut SERVER_INFO_1542; +pub type LPSERVER_INFO_1542 = *mut SERVER_INFO_1542; +STRUCT!{struct SERVER_INFO_1543 { + sv1543_initsesstable: DWORD, +}} +pub type PSERVER_INFO_1543 = *mut SERVER_INFO_1543; +pub type LPSERVER_INFO_1543 = *mut SERVER_INFO_1543; +STRUCT!{struct SERVER_INFO_1544 { + sv1544_initconntable: DWORD, +}} +pub type PSERVER_INFO_1544 = *mut SERVER_INFO_1544; +pub type LPSERVER_INFO_1544 = *mut SERVER_INFO_1544; +STRUCT!{struct SERVER_INFO_1545 { + sv1545_initfiletable: DWORD, +}} +pub type PSERVER_INFO_1545 = *mut SERVER_INFO_1545; +pub type LPSERVER_INFO_1545 = *mut SERVER_INFO_1545; +STRUCT!{struct SERVER_INFO_1546 { + sv1546_initsearchtable: DWORD, +}} +pub type PSERVER_INFO_1546 = *mut SERVER_INFO_1546; +pub type LPSERVER_INFO_1546 = *mut SERVER_INFO_1546; +STRUCT!{struct SERVER_INFO_1547 { + sv1547_alertschedule: DWORD, +}} +pub type PSERVER_INFO_1547 = *mut SERVER_INFO_1547; +pub type LPSERVER_INFO_1547 = *mut SERVER_INFO_1547; +STRUCT!{struct SERVER_INFO_1548 { + sv1548_errorthreshold: DWORD, +}} +pub type PSERVER_INFO_1548 = *mut SERVER_INFO_1548; +pub type LPSERVER_INFO_1548 = *mut SERVER_INFO_1548; +STRUCT!{struct SERVER_INFO_1549 { + sv1549_networkerrorthreshold: DWORD, +}} +pub type PSERVER_INFO_1549 = *mut SERVER_INFO_1549; +pub type LPSERVER_INFO_1549 = *mut SERVER_INFO_1549; +STRUCT!{struct SERVER_INFO_1550 { + sv1550_diskspacethreshold: DWORD, +}} +pub type PSERVER_INFO_1550 = *mut SERVER_INFO_1550; +pub type LPSERVER_INFO_1550 = *mut SERVER_INFO_1550; +STRUCT!{struct SERVER_INFO_1552 { + sv1552_maxlinkdelay: DWORD, +}} +pub type PSERVER_INFO_1552 = *mut SERVER_INFO_1552; +pub type LPSERVER_INFO_1552 = *mut SERVER_INFO_1552; +STRUCT!{struct SERVER_INFO_1553 { + sv1553_minlinkthroughput: DWORD, +}} +pub type PSERVER_INFO_1553 = *mut SERVER_INFO_1553; +pub type LPSERVER_INFO_1553 = *mut SERVER_INFO_1553; +STRUCT!{struct SERVER_INFO_1554 { + sv1554_linkinfovalidtime: DWORD, +}} +pub type PSERVER_INFO_1554 = *mut SERVER_INFO_1554; +pub type LPSERVER_INFO_1554 = *mut SERVER_INFO_1554; +STRUCT!{struct SERVER_INFO_1555 { + sv1555_scavqosinfoupdatetime: DWORD, +}} +pub type PSERVER_INFO_1555 = *mut SERVER_INFO_1555; +pub type LPSERVER_INFO_1555 = *mut SERVER_INFO_1555; +STRUCT!{struct SERVER_INFO_1556 { + sv1556_maxworkitemidletime: DWORD, +}} +pub type PSERVER_INFO_1556 = *mut SERVER_INFO_1556; +pub type LPSERVER_INFO_1556 = *mut SERVER_INFO_1556; +STRUCT!{struct SERVER_INFO_1557 { + sv1557_maxrawworkitems: DWORD, +}} +pub type PSERVER_INFO_1557 = *mut SERVER_INFO_1557; +pub type LPSERVER_INFO_1557 = *mut SERVER_INFO_1557; +STRUCT!{struct SERVER_INFO_1560 { + sv1560_producttype: DWORD, +}} +pub type PSERVER_INFO_1560 = *mut SERVER_INFO_1560; +pub type LPSERVER_INFO_1560 = *mut SERVER_INFO_1560; +STRUCT!{struct SERVER_INFO_1561 { + sv1561_serversize: DWORD, +}} +pub type PSERVER_INFO_1561 = *mut SERVER_INFO_1561; +pub type LPSERVER_INFO_1561 = *mut SERVER_INFO_1561; +STRUCT!{struct SERVER_INFO_1562 { + sv1562_connectionlessautodisc: DWORD, +}} +pub type PSERVER_INFO_1562 = *mut SERVER_INFO_1562; +pub type LPSERVER_INFO_1562 = *mut SERVER_INFO_1562; +STRUCT!{struct SERVER_INFO_1563 { + sv1563_sharingviolationretries: DWORD, +}} +pub type PSERVER_INFO_1563 = *mut SERVER_INFO_1563; +pub type LPSERVER_INFO_1563 = *mut SERVER_INFO_1563; +STRUCT!{struct SERVER_INFO_1564 { + sv1564_sharingviolationdelay: DWORD, +}} +pub type PSERVER_INFO_1564 = *mut SERVER_INFO_1564; +pub type LPSERVER_INFO_1564 = *mut SERVER_INFO_1564; +STRUCT!{struct SERVER_INFO_1565 { + sv1565_maxglobalopensearch: DWORD, +}} +pub type PSERVER_INFO_1565 = *mut SERVER_INFO_1565; +pub type LPSERVER_INFO_1565 = *mut SERVER_INFO_1565; +STRUCT!{struct SERVER_INFO_1566 { + sv1566_removeduplicatesearches: BOOL, +}} +pub type PSERVER_INFO_1566 = *mut SERVER_INFO_1566; +pub type LPSERVER_INFO_1566 = *mut SERVER_INFO_1566; +STRUCT!{struct SERVER_INFO_1567 { + sv1567_lockviolationretries: DWORD, +}} +pub type PSERVER_INFO_1567 = *mut SERVER_INFO_1567; +pub type LPSERVER_INFO_1567 = *mut SERVER_INFO_1567; +STRUCT!{struct SERVER_INFO_1568 { + sv1568_lockviolationoffset: DWORD, +}} +pub type PSERVER_INFO_1568 = *mut SERVER_INFO_1568; +pub type LPSERVER_INFO_1568 = *mut SERVER_INFO_1568; +STRUCT!{struct SERVER_INFO_1569 { + sv1569_lockviolationdelay: DWORD, +}} +pub type PSERVER_INFO_1569 = *mut SERVER_INFO_1569; +pub type LPSERVER_INFO_1569 = *mut SERVER_INFO_1569; +STRUCT!{struct SERVER_INFO_1570 { + sv1570_mdlreadswitchover: DWORD, +}} +pub type PSERVER_INFO_1570 = *mut SERVER_INFO_1570; +pub type LPSERVER_INFO_1570 = *mut SERVER_INFO_1570; +STRUCT!{struct SERVER_INFO_1571 { + sv1571_cachedopenlimit: DWORD, +}} +pub type PSERVER_INFO_1571 = *mut SERVER_INFO_1571; +pub type LPSERVER_INFO_1571 = *mut SERVER_INFO_1571; +STRUCT!{struct SERVER_INFO_1572 { + sv1572_criticalthreads: DWORD, +}} +pub type PSERVER_INFO_1572 = *mut SERVER_INFO_1572; +pub type LPSERVER_INFO_1572 = *mut SERVER_INFO_1572; +STRUCT!{struct SERVER_INFO_1573 { + sv1573_restrictnullsessaccess: DWORD, +}} +pub type PSERVER_INFO_1573 = *mut SERVER_INFO_1573; +pub type LPSERVER_INFO_1573 = *mut SERVER_INFO_1573; +STRUCT!{struct SERVER_INFO_1574 { + sv1574_enablewfw311directipx: DWORD, +}} +pub type PSERVER_INFO_1574 = *mut SERVER_INFO_1574; +pub type LPSERVER_INFO_1574 = *mut SERVER_INFO_1574; +STRUCT!{struct SERVER_INFO_1575 { + sv1575_otherqueueaffinity: DWORD, +}} +pub type PSERVER_INFO_1575 = *mut SERVER_INFO_1575; +pub type LPSERVER_INFO_1575 = *mut SERVER_INFO_1575; +STRUCT!{struct SERVER_INFO_1576 { + sv1576_queuesamplesecs: DWORD, +}} +pub type PSERVER_INFO_1576 = *mut SERVER_INFO_1576; +pub type LPSERVER_INFO_1576 = *mut SERVER_INFO_1576; +STRUCT!{struct SERVER_INFO_1577 { + sv1577_balancecount: DWORD, +}} +pub type PSERVER_INFO_1577 = *mut SERVER_INFO_1577; +pub type LPSERVER_INFO_1577 = *mut SERVER_INFO_1577; +STRUCT!{struct SERVER_INFO_1578 { + sv1578_preferredaffinity: DWORD, +}} +pub type PSERVER_INFO_1578 = *mut SERVER_INFO_1578; +pub type LPSERVER_INFO_1578 = *mut SERVER_INFO_1578; +STRUCT!{struct SERVER_INFO_1579 { + sv1579_maxfreerfcbs: DWORD, +}} +pub type PSERVER_INFO_1579 = *mut SERVER_INFO_1579; +pub type LPSERVER_INFO_1579 = *mut SERVER_INFO_1579; +STRUCT!{struct SERVER_INFO_1580 { + sv1580_maxfreemfcbs: DWORD, +}} +pub type PSERVER_INFO_1580 = *mut SERVER_INFO_1580; +pub type LPSERVER_INFO_1580 = *mut SERVER_INFO_1580; +STRUCT!{struct SERVER_INFO_1581 { + sv1581_maxfreemlcbs: DWORD, +}} +pub type PSERVER_INFO_1581 = *mut SERVER_INFO_1581; +pub type LPSERVER_INFO_1581 = *mut SERVER_INFO_1581; +STRUCT!{struct SERVER_INFO_1582 { + sv1582_maxfreepagedpoolchunks: DWORD, +}} +pub type PSERVER_INFO_1582 = *mut SERVER_INFO_1582; +pub type LPSERVER_INFO_1582 = *mut SERVER_INFO_1582; +STRUCT!{struct SERVER_INFO_1583 { + sv1583_minpagedpoolchunksize: DWORD, +}} +pub type PSERVER_INFO_1583 = *mut SERVER_INFO_1583; +pub type LPSERVER_INFO_1583 = *mut SERVER_INFO_1583; +STRUCT!{struct SERVER_INFO_1584 { + sv1584_maxpagedpoolchunksize: DWORD, +}} +pub type PSERVER_INFO_1584 = *mut SERVER_INFO_1584; +pub type LPSERVER_INFO_1584 = *mut SERVER_INFO_1584; +STRUCT!{struct SERVER_INFO_1585 { + sv1585_sendsfrompreferredprocessor: BOOL, +}} +pub type PSERVER_INFO_1585 = *mut SERVER_INFO_1585; +pub type LPSERVER_INFO_1585 = *mut SERVER_INFO_1585; +STRUCT!{struct SERVER_INFO_1586 { + sv1586_maxthreadsperqueue: DWORD, +}} +pub type PSERVER_INFO_1586 = *mut SERVER_INFO_1586; +pub type LPSERVER_INFO_1586 = *mut SERVER_INFO_1586; +STRUCT!{struct SERVER_INFO_1587 { + sv1587_cacheddirectorylimit: DWORD, +}} +pub type PSERVER_INFO_1587 = *mut SERVER_INFO_1587; +pub type LPSERVER_INFO_1587 = *mut SERVER_INFO_1587; +STRUCT!{struct SERVER_INFO_1588 { + sv1588_maxcopylength: DWORD, +}} +pub type PSERVER_INFO_1588 = *mut SERVER_INFO_1588; +pub type LPSERVER_INFO_1588 = *mut SERVER_INFO_1588; +STRUCT!{struct SERVER_INFO_1590 { + sv1590_enablecompression: DWORD, +}} +pub type PSERVER_INFO_1590 = *mut SERVER_INFO_1590; +pub type LPSERVER_INFO_1590 = *mut SERVER_INFO_1590; +STRUCT!{struct SERVER_INFO_1591 { + sv1591_autosharewks: DWORD, +}} +pub type PSERVER_INFO_1591 = *mut SERVER_INFO_1591; +pub type LPSERVER_INFO_1591 = *mut SERVER_INFO_1591; +STRUCT!{struct SERVER_INFO_1592 { + sv1592_autosharewks: DWORD, +}} +pub type PSERVER_INFO_1592 = *mut SERVER_INFO_1592; +pub type LPSERVER_INFO_1592 = *mut SERVER_INFO_1592; +STRUCT!{struct SERVER_INFO_1593 { + sv1593_enablesecuritysignature: DWORD, +}} +pub type PSERVER_INFO_1593 = *mut SERVER_INFO_1593; +pub type LPSERVER_INFO_1593 = *mut SERVER_INFO_1593; +STRUCT!{struct SERVER_INFO_1594 { + sv1594_requiresecuritysignature: DWORD, +}} +pub type PSERVER_INFO_1594 = *mut SERVER_INFO_1594; +pub type LPSERVER_INFO_1594 = *mut SERVER_INFO_1594; +STRUCT!{struct SERVER_INFO_1595 { + sv1595_minclientbuffersize: DWORD, +}} +pub type PSERVER_INFO_1595 = *mut SERVER_INFO_1595; +pub type LPSERVER_INFO_1595 = *mut SERVER_INFO_1595; +STRUCT!{struct SERVER_INFO_1596 { + sv1596_ConnectionNoSessionsTimeout: DWORD, +}} +pub type PSERVER_INFO_1596 = *mut SERVER_INFO_1596; +pub type LPSERVER_INFO_1596 = *mut SERVER_INFO_1596; +STRUCT!{struct SERVER_INFO_1597 { + sv1597_IdleThreadTimeOut: DWORD, +}} +pub type PSERVER_INFO_1597 = *mut SERVER_INFO_1597; +pub type LPSERVER_INFO_1597 = *mut SERVER_INFO_1597; +STRUCT!{struct SERVER_INFO_1598 { + sv1598_enableW9xsecuritysignature: DWORD, +}} +pub type PSERVER_INFO_1598 = *mut SERVER_INFO_1598; +pub type LPSERVER_INFO_1598 = *mut SERVER_INFO_1598; +STRUCT!{struct SERVER_INFO_1599 { + sv1598_enforcekerberosreauthentication: BOOLEAN, +}} +pub type PSERVER_INFO_1599 = *mut SERVER_INFO_1599; +pub type LPSERVER_INFO_1599 = *mut SERVER_INFO_1599; +STRUCT!{struct SERVER_INFO_1600 { + sv1598_disabledos: BOOLEAN, +}} +pub type PSERVER_INFO_1600 = *mut SERVER_INFO_1600; +pub type LPSERVER_INFO_1600 = *mut SERVER_INFO_1600; +STRUCT!{struct SERVER_INFO_1601 { + sv1598_lowdiskspaceminimum: DWORD, +}} +pub type PSERVER_INFO_1601 = *mut SERVER_INFO_1601; +pub type LPSERVER_INFO_1601 = *mut SERVER_INFO_1601; +STRUCT!{struct SERVER_INFO_1602 { + sv_1598_disablestrictnamechecking: BOOL, +}} +pub type PSERVER_INFO_1602 = *mut SERVER_INFO_1602; +pub type LPSERVER_INFO_1602 = *mut SERVER_INFO_1602; +STRUCT!{struct SERVER_TRANSPORT_INFO_0 { + svti0_numberofvcs: DWORD, + svti0_transportname: LMSTR, + svti0_transportaddress: LPBYTE, + svti0_transportaddresslength: DWORD, + svti0_networkaddress: LMSTR, +}} +pub type PSERVER_TRANSPORT_INFO_0 = *mut SERVER_TRANSPORT_INFO_0; +pub type LPSERVER_TRANSPORT_INFO_0 = *mut SERVER_TRANSPORT_INFO_0; +STRUCT!{struct SERVER_TRANSPORT_INFO_1 { + svti1_numberofvcs: DWORD, + svti1_transportname: LMSTR, + svti1_transportaddress: LPBYTE, + svti1_transportaddresslength: DWORD, + svti1_networkaddress: LMSTR, + svti1_domain: LMSTR, +}} +pub type PSERVER_TRANSPORT_INFO_1 = *mut SERVER_TRANSPORT_INFO_1; +pub type LPSERVER_TRANSPORT_INFO_1 = *mut SERVER_TRANSPORT_INFO_1; +STRUCT!{struct SERVER_TRANSPORT_INFO_2 { + svti2_numberofvcs: DWORD, + svti2_transportname: LMSTR, + svti2_transportaddress: LPBYTE, + svti2_transportaddresslength: DWORD, + svti2_networkaddress: LMSTR, + svti2_domain: LMSTR, + svti2_flags: ULONG, +}} +pub type PSERVER_TRANSPORT_INFO_2 = *mut SERVER_TRANSPORT_INFO_2; +pub type LPSERVER_TRANSPORT_INFO_2 = *mut SERVER_TRANSPORT_INFO_2; +STRUCT!{struct SERVER_TRANSPORT_INFO_3 { + svti3_numberofvcs: DWORD, + svti3_transportname: LMSTR, + svti3_transportaddress: LPBYTE, + svti3_transportaddresslength: DWORD, + svti3_networkaddress: LMSTR, + svti3_domain: LMSTR, + svti3_flags: ULONG, + svti3_passwordlength: DWORD, + svti3_password: [BYTE; 256], +}} +pub type PSERVER_TRANSPORT_INFO_3 = *mut SERVER_TRANSPORT_INFO_3; +pub type LPSERVER_TRANSPORT_INFO_3 = *mut SERVER_TRANSPORT_INFO_3; +pub const SV_PLATFORM_ID_OS2: DWORD = 400; +pub const SV_PLATFORM_ID_NT: DWORD = 500; +pub const MAJOR_VERSION_MASK: DWORD = 0x0F; +pub const SV_TYPE_WORKSTATION: DWORD = 0x00000001; +pub const SV_TYPE_SERVER: DWORD = 0x00000002; +pub const SV_TYPE_SQLSERVER: DWORD = 0x00000004; +pub const SV_TYPE_DOMAIN_CTRL: DWORD = 0x00000008; +pub const SV_TYPE_DOMAIN_BAKCTRL: DWORD = 0x00000010; +pub const SV_TYPE_TIME_SOURCE: DWORD = 0x00000020; +pub const SV_TYPE_AFP: DWORD = 0x00000040; +pub const SV_TYPE_NOVELL: DWORD = 0x00000080; +pub const SV_TYPE_DOMAIN_MEMBER: DWORD = 0x00000100; +pub const SV_TYPE_PRINTQ_SERVER: DWORD = 0x00000200; +pub const SV_TYPE_DIALIN_SERVER: DWORD = 0x00000400; +pub const SV_TYPE_XENIX_SERVER: DWORD = 0x00000800; +pub const SV_TYPE_SERVER_UNIX: DWORD = SV_TYPE_XENIX_SERVER; +pub const SV_TYPE_NT: DWORD = 0x00001000; +pub const SV_TYPE_WFW: DWORD = 0x00002000; +pub const SV_TYPE_SERVER_MFPN: DWORD = 0x00004000; +pub const SV_TYPE_SERVER_NT: DWORD = 0x00008000; +pub const SV_TYPE_POTENTIAL_BROWSER: DWORD = 0x00010000; +pub const SV_TYPE_BACKUP_BROWSER: DWORD = 0x00020000; +pub const SV_TYPE_MASTER_BROWSER: DWORD = 0x00040000; +pub const SV_TYPE_DOMAIN_MASTER: DWORD = 0x00080000; +pub const SV_TYPE_SERVER_OSF: DWORD = 0x00100000; +pub const SV_TYPE_SERVER_VMS: DWORD = 0x00200000; +pub const SV_TYPE_WINDOWS: DWORD = 0x00400000; +pub const SV_TYPE_DFS: DWORD = 0x00800000; +pub const SV_TYPE_CLUSTER_NT: DWORD = 0x01000000; +pub const SV_TYPE_TERMINALSERVER: DWORD = 0x02000000; +pub const SV_TYPE_CLUSTER_VS_NT: DWORD = 0x04000000; +pub const SV_TYPE_DCE: DWORD = 0x10000000; +pub const SV_TYPE_ALTERNATE_XPORT: DWORD = 0x20000000; +pub const SV_TYPE_LOCAL_LIST_ONLY: DWORD = 0x40000000; +pub const SV_TYPE_DOMAIN_ENUM: DWORD = 0x80000000; +pub const SV_TYPE_ALL: DWORD = 0xFFFFFFFF; +pub const SV_NODISC: DWORD = -1i32 as u32; +pub const SV_USERSECURITY: DWORD = 1; +pub const SV_SHARESECURITY: DWORD = 0; +pub const SV_HIDDEN: DWORD = 1; +pub const SV_VISIBLE: DWORD = 0; +pub const SV_PLATFORM_ID_PARMNUM: DWORD = 101; +pub const SV_NAME_PARMNUM: DWORD = 102; +pub const SV_VERSION_MAJOR_PARMNUM: DWORD = 103; +pub const SV_VERSION_MINOR_PARMNUM: DWORD = 104; +pub const SV_TYPE_PARMNUM: DWORD = 105; +pub const SV_COMMENT_PARMNUM: DWORD = 5; +pub const SV_USERS_PARMNUM: DWORD = 107; +pub const SV_DISC_PARMNUM: DWORD = 10; +pub const SV_HIDDEN_PARMNUM: DWORD = 16; +pub const SV_ANNOUNCE_PARMNUM: DWORD = 17; +pub const SV_ANNDELTA_PARMNUM: DWORD = 18; +pub const SV_USERPATH_PARMNUM: DWORD = 112; +pub const SV_ULIST_MTIME_PARMNUM: DWORD = 401; +pub const SV_GLIST_MTIME_PARMNUM: DWORD = 402; +pub const SV_ALIST_MTIME_PARMNUM: DWORD = 403; +pub const SV_ALERTS_PARMNUM: DWORD = 11; +pub const SV_SECURITY_PARMNUM: DWORD = 405; +pub const SV_NUMADMIN_PARMNUM: DWORD = 406; +pub const SV_LANMASK_PARMNUM: DWORD = 407; +pub const SV_GUESTACC_PARMNUM: DWORD = 408; +pub const SV_CHDEVQ_PARMNUM: DWORD = 410; +pub const SV_CHDEVJOBS_PARMNUM: DWORD = 411; +pub const SV_CONNECTIONS_PARMNUM: DWORD = 412; +pub const SV_SHARES_PARMNUM: DWORD = 413; +pub const SV_OPENFILES_PARMNUM: DWORD = 414; +pub const SV_SESSREQS_PARMNUM: DWORD = 417; +pub const SV_ACTIVELOCKS_PARMNUM: DWORD = 419; +pub const SV_NUMREQBUF_PARMNUM: DWORD = 420; +pub const SV_NUMBIGBUF_PARMNUM: DWORD = 422; +pub const SV_NUMFILETASKS_PARMNUM: DWORD = 423; +pub const SV_ALERTSCHED_PARMNUM: DWORD = 37; +pub const SV_ERRORALERT_PARMNUM: DWORD = 38; +pub const SV_LOGONALERT_PARMNUM: DWORD = 39; +pub const SV_ACCESSALERT_PARMNUM: DWORD = 40; +pub const SV_DISKALERT_PARMNUM: DWORD = 41; +pub const SV_NETIOALERT_PARMNUM: DWORD = 42; +pub const SV_MAXAUDITSZ_PARMNUM: DWORD = 43; +pub const SV_SRVHEURISTICS_PARMNUM: DWORD = 431; +pub const SV_SESSOPENS_PARMNUM: DWORD = 501; +pub const SV_SESSVCS_PARMNUM: DWORD = 502; +pub const SV_OPENSEARCH_PARMNUM: DWORD = 503; +pub const SV_SIZREQBUF_PARMNUM: DWORD = 504; +pub const SV_INITWORKITEMS_PARMNUM: DWORD = 505; +pub const SV_MAXWORKITEMS_PARMNUM: DWORD = 506; +pub const SV_RAWWORKITEMS_PARMNUM: DWORD = 507; +pub const SV_IRPSTACKSIZE_PARMNUM: DWORD = 508; +pub const SV_MAXRAWBUFLEN_PARMNUM: DWORD = 509; +pub const SV_SESSUSERS_PARMNUM: DWORD = 510; +pub const SV_SESSCONNS_PARMNUM: DWORD = 511; +pub const SV_MAXNONPAGEDMEMORYUSAGE_PARMNUM: DWORD = 512; +pub const SV_MAXPAGEDMEMORYUSAGE_PARMNUM: DWORD = 513; +pub const SV_ENABLESOFTCOMPAT_PARMNUM: DWORD = 514; +pub const SV_ENABLEFORCEDLOGOFF_PARMNUM: DWORD = 515; +pub const SV_TIMESOURCE_PARMNUM: DWORD = 516; +pub const SV_ACCEPTDOWNLEVELAPIS_PARMNUM: DWORD = 517; +pub const SV_LMANNOUNCE_PARMNUM: DWORD = 518; +pub const SV_DOMAIN_PARMNUM: DWORD = 519; +pub const SV_MAXCOPYREADLEN_PARMNUM: DWORD = 520; +pub const SV_MAXCOPYWRITELEN_PARMNUM: DWORD = 521; +pub const SV_MINKEEPSEARCH_PARMNUM: DWORD = 522; +pub const SV_MAXKEEPSEARCH_PARMNUM: DWORD = 523; +pub const SV_MINKEEPCOMPLSEARCH_PARMNUM: DWORD = 524; +pub const SV_MAXKEEPCOMPLSEARCH_PARMNUM: DWORD = 525; +pub const SV_THREADCOUNTADD_PARMNUM: DWORD = 526; +pub const SV_NUMBLOCKTHREADS_PARMNUM: DWORD = 527; +pub const SV_SCAVTIMEOUT_PARMNUM: DWORD = 528; +pub const SV_MINRCVQUEUE_PARMNUM: DWORD = 529; +pub const SV_MINFREEWORKITEMS_PARMNUM: DWORD = 530; +pub const SV_XACTMEMSIZE_PARMNUM: DWORD = 531; +pub const SV_THREADPRIORITY_PARMNUM: DWORD = 532; +pub const SV_MAXMPXCT_PARMNUM: DWORD = 533; +pub const SV_OPLOCKBREAKWAIT_PARMNUM: DWORD = 534; +pub const SV_OPLOCKBREAKRESPONSEWAIT_PARMNUM: DWORD = 535; +pub const SV_ENABLEOPLOCKS_PARMNUM: DWORD = 536; +pub const SV_ENABLEOPLOCKFORCECLOSE_PARMNUM: DWORD = 537; +pub const SV_ENABLEFCBOPENS_PARMNUM: DWORD = 538; +pub const SV_ENABLERAW_PARMNUM: DWORD = 539; +pub const SV_ENABLESHAREDNETDRIVES_PARMNUM: DWORD = 540; +pub const SV_MINFREECONNECTIONS_PARMNUM: DWORD = 541; +pub const SV_MAXFREECONNECTIONS_PARMNUM: DWORD = 542; +pub const SV_INITSESSTABLE_PARMNUM: DWORD = 543; +pub const SV_INITCONNTABLE_PARMNUM: DWORD = 544; +pub const SV_INITFILETABLE_PARMNUM: DWORD = 545; +pub const SV_INITSEARCHTABLE_PARMNUM: DWORD = 546; +pub const SV_ALERTSCHEDULE_PARMNUM: DWORD = 547; +pub const SV_ERRORTHRESHOLD_PARMNUM: DWORD = 548; +pub const SV_NETWORKERRORTHRESHOLD_PARMNUM: DWORD = 549; +pub const SV_DISKSPACETHRESHOLD_PARMNUM: DWORD = 550; +pub const SV_MAXLINKDELAY_PARMNUM: DWORD = 552; +pub const SV_MINLINKTHROUGHPUT_PARMNUM: DWORD = 553; +pub const SV_LINKINFOVALIDTIME_PARMNUM: DWORD = 554; +pub const SV_SCAVQOSINFOUPDATETIME_PARMNUM: DWORD = 555; +pub const SV_MAXWORKITEMIDLETIME_PARMNUM: DWORD = 556; +pub const SV_MAXRAWWORKITEMS_PARMNUM: DWORD = 557; +pub const SV_PRODUCTTYPE_PARMNUM: DWORD = 560; +pub const SV_SERVERSIZE_PARMNUM: DWORD = 561; +pub const SV_CONNECTIONLESSAUTODISC_PARMNUM: DWORD = 562; +pub const SV_SHARINGVIOLATIONRETRIES_PARMNUM: DWORD = 563; +pub const SV_SHARINGVIOLATIONDELAY_PARMNUM: DWORD = 564; +pub const SV_MAXGLOBALOPENSEARCH_PARMNUM: DWORD = 565; +pub const SV_REMOVEDUPLICATESEARCHES_PARMNUM: DWORD = 566; +pub const SV_LOCKVIOLATIONRETRIES_PARMNUM: DWORD = 567; +pub const SV_LOCKVIOLATIONOFFSET_PARMNUM: DWORD = 568; +pub const SV_LOCKVIOLATIONDELAY_PARMNUM: DWORD = 569; +pub const SV_MDLREADSWITCHOVER_PARMNUM: DWORD = 570; +pub const SV_CACHEDOPENLIMIT_PARMNUM: DWORD = 571; +pub const SV_CRITICALTHREADS_PARMNUM: DWORD = 572; +pub const SV_RESTRICTNULLSESSACCESS_PARMNUM: DWORD = 573; +pub const SV_ENABLEWFW311DIRECTIPX_PARMNUM: DWORD = 574; +pub const SV_OTHERQUEUEAFFINITY_PARMNUM: DWORD = 575; +pub const SV_QUEUESAMPLESECS_PARMNUM: DWORD = 576; +pub const SV_BALANCECOUNT_PARMNUM: DWORD = 577; +pub const SV_PREFERREDAFFINITY_PARMNUM: DWORD = 578; +pub const SV_MAXFREERFCBS_PARMNUM: DWORD = 579; +pub const SV_MAXFREEMFCBS_PARMNUM: DWORD = 580; +pub const SV_MAXFREELFCBS_PARMNUM: DWORD = 581; +pub const SV_MAXFREEPAGEDPOOLCHUNKS_PARMNUM: DWORD = 582; +pub const SV_MINPAGEDPOOLCHUNKSIZE_PARMNUM: DWORD = 583; +pub const SV_MAXPAGEDPOOLCHUNKSIZE_PARMNUM: DWORD = 584; +pub const SV_SENDSFROMPREFERREDPROCESSOR_PARMNUM: DWORD = 585; +pub const SV_MAXTHREADSPERQUEUE_PARMNUM: DWORD = 586; +pub const SV_CACHEDDIRECTORYLIMIT_PARMNUM: DWORD = 587; +pub const SV_MAXCOPYLENGTH_PARMNUM: DWORD = 588; +pub const SV_ENABLECOMPRESSION_PARMNUM: DWORD = 590; +pub const SV_AUTOSHAREWKS_PARMNUM: DWORD = 591; +pub const SV_AUTOSHARESERVER_PARMNUM: DWORD = 592; +pub const SV_ENABLESECURITYSIGNATURE_PARMNUM: DWORD = 593; +pub const SV_REQUIRESECURITYSIGNATURE_PARMNUM: DWORD = 594; +pub const SV_MINCLIENTBUFFERSIZE_PARMNUM: DWORD = 595; +pub const SV_CONNECTIONNOSESSIONSTIMEOUT_PARMNUM: DWORD = 596; +pub const SV_IDLETHREADTIMEOUT_PARMNUM: DWORD = 597; +pub const SV_ENABLEW9XSECURITYSIGNATURE_PARMNUM: DWORD = 598; +pub const SV_ENFORCEKERBEROSREAUTHENTICATION_PARMNUM: DWORD = 599; +pub const SV_DISABLEDOS_PARMNUM: DWORD = 600; +pub const SV_LOWDISKSPACEMINIMUM_PARMNUM: DWORD = 601; +pub const SV_DISABLESTRICTNAMECHECKING_PARMNUM: DWORD = 602; +pub const SV_ENABLEAUTHENTICATEUSERSHARING_PARMNUM: DWORD = 603; +pub const SV_COMMENT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_COMMENT_PARMNUM; +pub const SV_USERS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_USERS_PARMNUM; +pub const SV_DISC_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_DISC_PARMNUM; +pub const SV_HIDDEN_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_HIDDEN_PARMNUM; +pub const SV_ANNOUNCE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_ANNOUNCE_PARMNUM; +pub const SV_ANNDELTA_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_ANNDELTA_PARMNUM; +pub const SV_SESSOPENS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_SESSOPENS_PARMNUM; +pub const SV_SESSVCS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_SESSVCS_PARMNUM; +pub const SV_OPENSEARCH_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_OPENSEARCH_PARMNUM; +pub const SV_MAXWORKITEMS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MAXWORKITEMS_PARMNUM; +pub const SV_MAXRAWBUFLEN_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MAXRAWBUFLEN_PARMNUM; +pub const SV_SESSUSERS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_SESSUSERS_PARMNUM; +pub const SV_SESSCONNS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_SESSCONNS_PARMNUM; +pub const SV_MAXNONPAGEDMEMORYUSAGE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXNONPAGEDMEMORYUSAGE_PARMNUM; +pub const SV_MAXPAGEDMEMORYUSAGE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXPAGEDMEMORYUSAGE_PARMNUM; +pub const SV_ENABLESOFTCOMPAT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_ENABLESOFTCOMPAT_PARMNUM; +pub const SV_ENABLEFORCEDLOGOFF_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_ENABLEFORCEDLOGOFF_PARMNUM; +pub const SV_TIMESOURCE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_TIMESOURCE_PARMNUM; +pub const SV_LMANNOUNCE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_LMANNOUNCE_PARMNUM; +pub const SV_MAXCOPYREADLEN_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MAXCOPYREADLEN_PARMNUM; +pub const SV_MAXCOPYWRITELEN_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXCOPYWRITELEN_PARMNUM; +pub const SV_MINKEEPSEARCH_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MINKEEPSEARCH_PARMNUM; +pub const SV_MAXKEEPSEARCH_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MAXKEEPSEARCH_PARMNUM; +pub const SV_MINKEEPCOMPLSEARCH_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MINKEEPCOMPLSEARCH_PARMNUM; +pub const SV_MAXKEEPCOMPLSEARCH_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXKEEPCOMPLSEARCH_PARMNUM; +pub const SV_SCAVTIMEOUT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_SCAVTIMEOUT_PARMNUM; +pub const SV_MINRCVQUEUE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MINRCVQUEUE_PARMNUM; +pub const SV_MINFREEWORKITEMS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MINFREEWORKITEMS_PARMNUM; +pub const SV_MAXMPXCT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MAXMPXCT_PARMNUM; +pub const SV_OPLOCKBREAKWAIT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_OPLOCKBREAKWAIT_PARMNUM; +pub const SV_OPLOCKBREAKRESPONSEWAIT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_OPLOCKBREAKRESPONSEWAIT_PARMNUM; +pub const SV_ENABLEOPLOCKS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_ENABLEOPLOCKS_PARMNUM; +pub const SV_ENABLEOPLOCKFORCECLOSE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_ENABLEOPLOCKFORCECLOSE_PARMNUM; +pub const SV_ENABLEFCBOPENS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_ENABLEFCBOPENS_PARMNUM; +pub const SV_ENABLERAW_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_ENABLERAW_PARMNUM; +pub const SV_ENABLESHAREDNETDRIVES_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_ENABLESHAREDNETDRIVES_PARMNUM; +pub const SV_MINFREECONNECTIONS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MINFREECONNECTIONS_PARMNUM; +pub const SV_MAXFREECONNECTIONS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXFREECONNECTIONS_PARMNUM; +pub const SV_INITSESSTABLE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_INITSESSTABLE_PARMNUM; +pub const SV_INITCONNTABLE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_INITCONNTABLE_PARMNUM; +pub const SV_INITFILETABLE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_INITFILETABLE_PARMNUM; +pub const SV_INITSEARCHTABLE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_INITSEARCHTABLE_PARMNUM; +pub const SV_ALERTSCHEDULE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_ALERTSCHEDULE_PARMNUM; +pub const SV_ERRORTHRESHOLD_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_ERRORTHRESHOLD_PARMNUM; +pub const SV_NETWORKERRORTHRESHOLD_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_NETWORKERRORTHRESHOLD_PARMNUM; +pub const SV_DISKSPACETHRESHOLD_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_DISKSPACETHRESHOLD_PARMNUM; +pub const SV_MAXLINKDELAY_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MAXLINKDELAY_PARMNUM; +pub const SV_MINLINKTHROUGHPUT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MINLINKTHROUGHPUT_PARMNUM; +pub const SV_LINKINFOVALIDTIME_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_LINKINFOVALIDTIME_PARMNUM; +pub const SV_SCAVQOSINFOUPDATETIME_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_SCAVQOSINFOUPDATETIME_PARMNUM; +pub const SV_MAXWORKITEMIDLETIME_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXWORKITEMIDLETIME_PARMNUM; +pub const SV_MAXRAWWORKITEMS_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXRAWWORKITEMS_PARMNUM; +pub const SV_PRODUCTTYPE_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_PRODUCTTYPE_PARMNUM; +pub const SV_SERVERSIZE_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_SERVERSIZE_PARMNUM; +pub const SV_CONNECTIONLESSAUTODISC_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_CONNECTIONLESSAUTODISC_PARMNUM; +pub const SV_SHARINGVIOLATIONRETRIES_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_SHARINGVIOLATIONRETRIES_PARMNUM; +pub const SV_SHARINGVIOLATIONDELAY_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_SHARINGVIOLATIONDELAY_PARMNUM; +pub const SV_MAXGLOBALOPENSEARCH_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXGLOBALOPENSEARCH_PARMNUM; +pub const SV_REMOVEDUPLICATESEARCHES_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_REMOVEDUPLICATESEARCHES_PARMNUM; +pub const SV_LOCKVIOLATIONRETRIES_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_LOCKVIOLATIONRETRIES_PARMNUM; +pub const SV_LOCKVIOLATIONOFFSET_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_LOCKVIOLATIONOFFSET_PARMNUM; +pub const SV_LOCKVIOLATIONDELAY_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_LOCKVIOLATIONDELAY_PARMNUM; +pub const SV_MDLREADSWITCHOVER_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MDLREADSWITCHOVER_PARMNUM; +pub const SV_CACHEDOPENLIMIT_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_CACHEDOPENLIMIT_PARMNUM; +pub const SV_CRITICALTHREADS_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_CRITICALTHREADS_PARMNUM; +pub const SV_RESTRICTNULLSESSACCESS_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_RESTRICTNULLSESSACCESS_PARMNUM; +pub const SV_ENABLEWFW311DIRECTIPX_INFOLOEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_ENABLEWFW311DIRECTIPX_PARMNUM; +pub const SV_OTHERQUEUEAFFINITY_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_OTHERQUEUEAFFINITY_PARMNUM; +pub const SV_QUEUESAMPLESECS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_QUEUESAMPLESECS_PARMNUM; +pub const SV_BALANCECOUNT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_BALANCECOUNT_PARMNUM; +pub const SV_PREFERREDAFFINITY_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_PREFERREDAFFINITY_PARMNUM; +pub const SV_MAXFREERFCBS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MAXFREERFCBS_PARMNUM; +pub const SV_MAXFREEMFCBS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MAXFREEMFCBS_PARMNUM; +pub const SV_MAXFREELFCBS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MAXFREELFCBS_PARMNUM; +pub const SV_MAXFREEPAGEDPOOLCHUNKS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXFREEPAGEDPOOLCHUNKS_PARMNUM; +pub const SV_MINPAGEDPOOLCHUNKSIZE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MINPAGEDPOOLCHUNKSIZE_PARMNUM; +pub const SV_MAXPAGEDPOOLCHUNKSIZE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXPAGEDPOOLCHUNKSIZE_PARMNUM; +pub const SV_SENDSFROMPREFERREDPROCESSOR_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_SENDSFROMPREFERREDPROCESSOR_PARMNUM; +pub const SV_MAXTHREADSPERQUEUE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MAXTHREADSPERQUEUE_PARMNUM; +pub const SV_CACHEDDIRECTORYLIMIT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_CACHEDDIRECTORYLIMIT_PARMNUM; +pub const SV_MAXCOPYLENGTH_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_MAXCOPYLENGTH_PARMNUM; +pub const SV_ENABLECOMPRESSION_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_ENABLECOMPRESSION_PARMNUM; +pub const SV_AUTOSHAREWKS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_AUTOSHAREWKS_PARMNUM; +pub const SV_AUTOSHARESERVER_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_AUTOSHARESERVER_PARMNUM; +pub const SV_ENABLESECURITYSIGNATURE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_ENABLESECURITYSIGNATURE_PARMNUM; +pub const SV_REQUIRESECURITYSIGNATURE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_REQUIRESECURITYSIGNATURE_PARMNUM; +pub const SV_MINCLIENTBUFFERSIZE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_MINCLIENTBUFFERSIZE_PARMNUM; +pub const SV_CONNECTIONNOSESSIONSTIMEOUT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_CONNECTIONNOSESSIONSTIMEOUT_PARMNUM; +pub const SV_IDLETHREADTIMEOUT_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_IDLETHREADTIMEOUT_PARMNUM; +pub const SV_ENABLEW9XSECURITYSIGNATURE_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_ENABLEW9XSECURITYSIGNATURE_PARMNUM; +pub const SV_ENFORCEKERBEROSREAUTHENTICATION_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_ENFORCEKERBEROSREAUTHENTICATION_PARMNUM; +pub const SV_DISABLEDOS_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SV_DISABLEDOS_PARMNUM; +pub const SV_LOWDISKSPACEMINIMUM_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_LOWDISKSPACEMINIMUM_PARMNUM; +pub const SV_DISABLESTRICTNAMECHECKING_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_DISABLESTRICTNAMECHECKING_PARMNUM; +pub const SV_ENABLEAUTHENTICATEUSERSHARING_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + + SV_ENABLEAUTHENTICATEUSERSHARING_PARMNUM; +pub const SVI1_NUM_ELEMENTS: DWORD = 5; +pub const SVI2_NUM_ELEMENTS: DWORD = 40; +pub const SVI3_NUM_ELEMENTS: DWORD = 44; +pub const SV_MAX_CMD_LEN: DWORD = PATHLEN; +pub const SW_AUTOPROF_LOAD_MASK: DWORD = 0x1; +pub const SW_AUTOPROF_SAVE_MASK: DWORD = 0x2; +pub const SV_MAX_SRV_HEUR_LEN: DWORD = 32; +pub const SV_USERS_PER_LICENSE: DWORD = 5; +pub const SVTI2_REMAP_PIPE_NAMES: DWORD = 0x02; +pub const SVTI2_SCOPED_NAME: DWORD = 0x04; +pub const SVTI2_CLUSTER_NAME: DWORD = 0x08; +pub const SVTI2_CLUSTER_DNN_NAME: DWORD = 0x10; +pub const SVTI2_UNICODE_TRANSPORT_ADDRESS: DWORD = 0x20; +pub const SVTI2_RESERVED1: DWORD = 0x1000; +pub const SVTI2_RESERVED2: DWORD = 0x2000; +pub const SVTI2_RESERVED3: DWORD = 0x4000; +pub const SVTI2_VALID_FLAGS: DWORD = SVTI2_REMAP_PIPE_NAMES | SVTI2_SCOPED_NAME + | SVTI2_CLUSTER_NAME | SVTI2_CLUSTER_DNN_NAME | SVTI2_UNICODE_TRANSPORT_ADDRESS; +pub const SRV_SUPPORT_HASH_GENERATION: DWORD = 0x0001; +pub const SRV_HASH_GENERATION_ACTIVE: DWORD = 0x0002; diff --git a/bash-5.1/vendor/winapi/src/um/lmshare.rs b/bash-5.1/vendor/winapi/src/um/lmshare.rs new file mode 100644 index 0000000000000000000000000000000000000000..3024ac3aa601f42d3a2103eccc1493884f0af207 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmshare.rs @@ -0,0 +1,379 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module defines the API function prototypes and data structures +use shared::basetsd::PDWORD_PTR; +use shared::guiddef::GUID; +use shared::lmcons::{LMSTR, NET_API_STATUS, PARMNUM_BASE_INFOLEVEL}; +use shared::minwindef::{DWORD, LPBYTE, LPDWORD, ULONG}; +use um::winnt::{BOOLEAN, PSECURITY_DESCRIPTOR}; +extern "system" { + pub fn NetShareAdd( + servername: LMSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetShareEnum( + servername: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetShareEnumSticky( + servername: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetShareGetInfo( + servername: LMSTR, + netname: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetShareSetInfo( + servername: LMSTR, + netname: LMSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetShareDel( + servername: LMSTR, + netname: LMSTR, + reserved: DWORD, + ) -> NET_API_STATUS; + pub fn NetShareDelSticky( + servername: LMSTR, + netname: LMSTR, + reserved: DWORD, + ) -> NET_API_STATUS; + pub fn NetShareCheck( + servername: LMSTR, + device: LMSTR, + _type: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetShareDelEx( + servername: LMSTR, + level: DWORD, + buf: LPBYTE, + ) -> NET_API_STATUS; +} +STRUCT!{struct SHARE_INFO_0 { + shi0_netname: LMSTR, +}} +pub type PSHARE_INFO_0 = *mut SHARE_INFO_0; +pub type LPSHARE_INFO_0 = *mut SHARE_INFO_0; +STRUCT!{struct SHARE_INFO_1 { + shi1_netname: LMSTR, + shi1_type: DWORD, + shi1_remark: LMSTR, +}} +pub type PSHARE_INFO_1 = *mut SHARE_INFO_1; +pub type LPSHARE_INFO_1 = *mut SHARE_INFO_1; +STRUCT!{struct SHARE_INFO_2 { + shi2_netname: LMSTR, + shi2_type: DWORD, + shi2_remark: LMSTR, + shi2_permissions: DWORD, + shi2_max_uses: DWORD, + shi2_current_uses: DWORD, + shi2_path: LMSTR, + shi2_passwd: LMSTR, +}} +pub type PSHARE_INFO_2 = *mut SHARE_INFO_2; +pub type LPSHARE_INFO_2 = *mut SHARE_INFO_2; +STRUCT!{struct SHARE_INFO_501 { + shi501_netname: LMSTR, + shi501_type: DWORD, + shi501_remark: LMSTR, + shi501_flags: DWORD, +}} +pub type PSHARE_INFO_501 = *mut SHARE_INFO_501; +pub type LPSHARE_INFO_501 = *mut SHARE_INFO_501; +STRUCT!{struct SHARE_INFO_502 { + shi502_netname: LMSTR, + shi502_type: DWORD, + shi502_remark: LMSTR, + shi502_permissions: DWORD, + shi502_max_uses: DWORD, + shi502_current_uses: DWORD, + shi502_path: LMSTR, + shi502_passwd: LMSTR, + shi502_reserved: DWORD, + shi502_security_descriptor: PSECURITY_DESCRIPTOR, +}} +pub type PSHARE_INFO_502 = *mut SHARE_INFO_502; +pub type LPSHARE_INFO_502 = *mut SHARE_INFO_502; +STRUCT!{struct SHARE_INFO_503 { + shi503_netname: LMSTR, + shi503_type: DWORD, + shi503_remark: LMSTR, + shi503_permissions: DWORD, + shi503_max_uses: DWORD, + shi503_current_uses: DWORD, + shi503_path: LMSTR, + shi503_passwd: LMSTR, + shi503_servername: LMSTR, + shi503_reserved: DWORD, + shi503_security_descriptor: PSECURITY_DESCRIPTOR, +}} +pub type PSHARE_INFO_503 = *mut SHARE_INFO_503; +pub type LPSHARE_INFO_503 = *mut SHARE_INFO_503; +STRUCT!{struct SHARE_INFO_1004 { + shi1004_remark: LMSTR, +}} +pub type PSHARE_INFO_1004 = *mut SHARE_INFO_1004; +pub type LPSHARE_INFO_1004 = *mut SHARE_INFO_1004; +STRUCT!{struct SHARE_INFO_1005 { + shi1005_flags: DWORD, +}} +pub type PSHARE_INFO_1005 = *mut SHARE_INFO_1005; +pub type LPSHARE_INFO_1005 = *mut SHARE_INFO_1005; +STRUCT!{struct SHARE_INFO_1006 { + shi1006_max_uses: DWORD, +}} +pub type PSHARE_INFO_1006 = *mut SHARE_INFO_1006; +pub type LPSHARE_INFO_1006 = *mut SHARE_INFO_1006; +STRUCT!{struct SHARE_INFO_1501 { + shi1501_reserved: DWORD, + shi1501_security_descriptor: PSECURITY_DESCRIPTOR, +}} +pub type PSHARE_INFO_1501 = *mut SHARE_INFO_1501; +pub type LPSHARE_INFO_1501 = *mut SHARE_INFO_1501; +STRUCT!{struct SHARE_INFO_1503 { + shi1503_sharefilter: GUID, +}} +pub type PSHARE_INFO_1503 = *mut SHARE_INFO_1503; +pub type LPSHARE_INFO_1503 = *mut SHARE_INFO_1503; +extern "system" { + pub fn NetServerAliasAdd( + servername: LMSTR, + level: DWORD, + buf: LPBYTE, + ) -> NET_API_STATUS; + pub fn NetServerAliasDel( + servername: LMSTR, + level: DWORD, + buf: LPBYTE, + ) -> NET_API_STATUS; + pub fn NetServerAliasEnum( + servername: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; +} +STRUCT!{struct SERVER_ALIAS_INFO_0 { + srvai0_alias: LMSTR, + srvai0_target: LMSTR, + srvai0_default: BOOLEAN, + srvai0_reserved: ULONG, +}} +pub type PSERVER_ALIAS_INFO_0 = *mut SERVER_ALIAS_INFO_0; +pub type LPSERVER_ALIAS_INFO_0 = *mut SERVER_ALIAS_INFO_0; +pub const SHARE_NETNAME_PARMNUM: DWORD = 1; +pub const SHARE_TYPE_PARMNUM: DWORD = 3; +pub const SHARE_REMARK_PARMNUM: DWORD = 4; +pub const SHARE_PERMISSIONS_PARMNUM: DWORD = 5; +pub const SHARE_MAX_USES_PARMNUM: DWORD = 6; +pub const SHARE_CURRENT_USES_PARMNUM: DWORD = 7; +pub const SHARE_PATH_PARMNUM: DWORD = 8; +pub const SHARE_PASSWD_PARMNUM: DWORD = 9; +pub const SHARE_FILE_SD_PARMNUM: DWORD = 501; +pub const SHARE_SERVER_PARMNUM: DWORD = 503; +pub const SHARE_REMARK_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SHARE_REMARK_PARMNUM; +pub const SHARE_MAX_USES_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SHARE_MAX_USES_PARMNUM; +pub const SHARE_FILE_SD_INFOLEVEL: DWORD = PARMNUM_BASE_INFOLEVEL + SHARE_FILE_SD_PARMNUM; +pub const SHI1_NUM_ELEMENTS: DWORD = 4; +pub const SHI2_NUM_ELEMENTS: DWORD = 10; +pub const STYPE_DISKTREE: DWORD = 0; +pub const STYPE_PRINTQ: DWORD = 1; +pub const STYPE_DEVICE: DWORD = 2; +pub const STYPE_IPC: DWORD = 3; +pub const STYPE_MASK: DWORD = 0x000000FF; +pub const STYPE_RESERVED1: DWORD = 0x01000000; +pub const STYPE_RESERVED2: DWORD = 0x02000000; +pub const STYPE_RESERVED3: DWORD = 0x04000000; +pub const STYPE_RESERVED4: DWORD = 0x08000000; +pub const STYPE_RESERVED_ALL: DWORD = 0x3FFFFF00; +pub const STYPE_TEMPORARY: DWORD = 0x40000000; +pub const STYPE_SPECIAL: DWORD = 0x80000000; +pub const SHI_USES_UNLIMITED: DWORD = -1i32 as u32; +pub const SHI1005_FLAGS_DFS: DWORD = 0x0001; +pub const SHI1005_FLAGS_DFS_ROOT: DWORD = 0x0002; +pub const CSC_MASK_EXT: DWORD = 0x2030; +pub const CSC_MASK: DWORD = 0x0030; +pub const CSC_CACHE_MANUAL_REINT: DWORD = 0x0000; +pub const CSC_CACHE_AUTO_REINT: DWORD = 0x0010; +pub const CSC_CACHE_VDO: DWORD = 0x0020; +pub const CSC_CACHE_NONE: DWORD = 0x0030; +pub const SHI1005_FLAGS_RESTRICT_EXCLUSIVE_OPENS: DWORD = 0x00100; +pub const SHI1005_FLAGS_FORCE_SHARED_DELETE: DWORD = 0x00200; +pub const SHI1005_FLAGS_ALLOW_NAMESPACE_CACHING: DWORD = 0x00400; +pub const SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM: DWORD = 0x00800; +pub const SHI1005_FLAGS_FORCE_LEVELII_OPLOCK: DWORD = 0x01000; +pub const SHI1005_FLAGS_ENABLE_HASH: DWORD = 0x02000; +pub const SHI1005_FLAGS_ENABLE_CA: DWORD = 0x04000; +pub const SHI1005_FLAGS_ENCRYPT_DATA: DWORD = 0x08000; +pub const SHI1005_FLAGS_RESERVED: DWORD = 0x10000; +pub const SHI1005_VALID_FLAGS_SET: DWORD = CSC_MASK | SHI1005_FLAGS_RESTRICT_EXCLUSIVE_OPENS + | SHI1005_FLAGS_FORCE_SHARED_DELETE | SHI1005_FLAGS_ALLOW_NAMESPACE_CACHING + | SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM | SHI1005_FLAGS_FORCE_LEVELII_OPLOCK + | SHI1005_FLAGS_ENABLE_HASH | SHI1005_FLAGS_ENABLE_CA | SHI1005_FLAGS_ENCRYPT_DATA + | SHI1005_FLAGS_RESERVED; +extern "system" { + pub fn NetSessionEnum( + servername: LMSTR, + UncClientName: LMSTR, + username: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetSessionDel( + servername: LMSTR, + UncClientName: LMSTR, + username: LMSTR, + ) -> NET_API_STATUS; + pub fn NetSessionGetInfo( + servername: LMSTR, + UncClientName: LMSTR, + username: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; +} +STRUCT!{struct SESSION_INFO_0 { + sesi0_cname: LMSTR, +}} +pub type PSESSION_INFO_0 = *mut SESSION_INFO_0; +pub type LPSESSION_INFO_0 = *mut SESSION_INFO_0; +STRUCT!{struct SESSION_INFO_1 { + sesi1_cname: LMSTR, + sesi1_username: LMSTR, + sesi1_num_opens: DWORD, + sesi1_time: DWORD, + sesi1_idle_time: DWORD, + sesi1_user_flags: DWORD, +}} +pub type PSESSION_INFO_1 = *mut SESSION_INFO_1; +pub type LPSESSION_INFO_1 = *mut SESSION_INFO_1; +STRUCT!{struct SESSION_INFO_2 { + sesi2_cname: LMSTR, + sesi2_username: LMSTR, + sesi2_num_opens: DWORD, + sesi2_time: DWORD, + sesi2_idle_time: DWORD, + sesi2_user_flags: DWORD, + sesi2_cltype_name: LMSTR, +}} +pub type PSESSION_INFO_2 = *mut SESSION_INFO_2; +pub type LPSESSION_INFO_2 = *mut SESSION_INFO_2; +STRUCT!{struct SESSION_INFO_10 { + sesi10_cname: LMSTR, + sesi10_username: LMSTR, + sesi10_time: DWORD, + sesi10_idle_time: DWORD, +}} +pub type PSESSION_INFO_10 = *mut SESSION_INFO_10; +pub type LPSESSION_INFO_10 = *mut SESSION_INFO_10; +STRUCT!{struct SESSION_INFO_502 { + sesi502_cname: LMSTR, + sesi502_username: LMSTR, + sesi502_num_opens: DWORD, + sesi502_time: DWORD, + sesi502_idle_time: DWORD, + sesi502_user_flags: DWORD, + sesi502_cltype_name: LMSTR, + sesi502_transport: LMSTR, +}} +pub type PSESSION_INFO_502 = *mut SESSION_INFO_502; +pub type LPSESSION_INFO_502 = *mut SESSION_INFO_502; +pub const SESS_GUEST: DWORD = 0x00000001; +pub const SESS_NOENCRYPTION: DWORD = 0x00000002; +pub const SESI1_NUM_ELEMENTS: DWORD = 8; +pub const SESI2_NUM_ELEMENTS: DWORD = 9; +extern "system" { + pub fn NetConnectionEnum( + servername: LMSTR, + qualifier: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resume_handle: LPDWORD, + ) -> NET_API_STATUS; +} +STRUCT!{struct CONNECTION_INFO_0 { + coni0_id: DWORD, +}} +pub type PCONNECTION_INFO_0 = *mut CONNECTION_INFO_0; +pub type LPCONNECTION_INFO_0 = *mut CONNECTION_INFO_0; +STRUCT!{struct CONNECTION_INFO_1 { + coni1_id: DWORD, + coni1_type: DWORD, + coni1_num_opens: DWORD, + coni1_num_users: DWORD, + coni1_time: DWORD, + coni1_username: LMSTR, + coni1_netname: LMSTR, +}} +pub type PCONNECTION_INFO_1 = *mut CONNECTION_INFO_1; +pub type LPCONNECTION_INFO_1 = *mut CONNECTION_INFO_1; +extern "system" { + pub fn NetFileClose( + servername: LMSTR, + fileid: DWORD, + ) -> NET_API_STATUS; + pub fn NetFileEnum( + servername: LMSTR, + basepath: LMSTR, + username: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resume_handle: PDWORD_PTR, + ) -> NET_API_STATUS; + pub fn NetFileGetInfo( + servername: LMSTR, + fileid: DWORD, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; +} +STRUCT!{struct FILE_INFO_2 { + fi2_id: DWORD, +}} +pub type PFILE_INFO_2 = *mut FILE_INFO_2; +pub type LPFILE_INFO_2 = *mut FILE_INFO_2; +STRUCT!{struct FILE_INFO_3 { + fi3_id: DWORD, + fi3_permissions: DWORD, + fi3_num_locks: DWORD, + fi3_pathname: LMSTR, + fi3_username: LMSTR, +}} +pub type PFILE_INFO_3 = *mut FILE_INFO_3; +pub type LPFILE_INFO_3 = *mut FILE_INFO_3; +pub const PERM_FILE_READ: DWORD = 0x1; +pub const PERM_FILE_WRITE: DWORD = 0x2; +pub const PERM_FILE_CREATE: DWORD = 0x4; diff --git a/bash-5.1/vendor/winapi/src/um/lmstats.rs b/bash-5.1/vendor/winapi/src/um/lmstats.rs new file mode 100644 index 0000000000000000000000000000000000000000..c0bfc3746b72af195137fb3b221870aa5ae9db09 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmstats.rs @@ -0,0 +1,85 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +use shared::lmcons::NET_API_STATUS; +use shared::minwindef::{DWORD, LPBYTE}; +use um::winnt::{LARGE_INTEGER, LPCWSTR}; +extern "system" { + pub fn NetStatisticsGet( + ServerName: LPCWSTR, + Service: LPCWSTR, + Level: DWORD, + Options: DWORD, + Buffer: *mut LPBYTE, + ) -> NET_API_STATUS; +} +STRUCT!{struct STAT_WORKSTATION_0 { + StatisticsStartTime: LARGE_INTEGER, + BytesReceived: LARGE_INTEGER, + SmbsReceived: LARGE_INTEGER, + PagingReadBytesRequested: LARGE_INTEGER, + NonPagingReadBytesRequested: LARGE_INTEGER, + CacheReadBytesRequested: LARGE_INTEGER, + NetworkReadBytesRequested: LARGE_INTEGER, + BytesTransmitted: LARGE_INTEGER, + SmbsTransmitted: LARGE_INTEGER, + PagingWriteBytesRequested: LARGE_INTEGER, + NonPagingWriteBytesRequested: LARGE_INTEGER, + CacheWriteBytesRequested: LARGE_INTEGER, + NetworkWriteBytesRequested: LARGE_INTEGER, + InitiallyFailedOperations: DWORD, + FailedCompletionOperations: DWORD, + ReadOperations: DWORD, + RandomReadOperations: DWORD, + ReadSmbs: DWORD, + LargeReadSmbs: DWORD, + SmallReadSmbs: DWORD, + WriteOperations: DWORD, + RandomWriteOperations: DWORD, + WriteSmbs: DWORD, + LargeWriteSmbs: DWORD, + SmallWriteSmbs: DWORD, + RawReadsDenied: DWORD, + RawWritesDenied: DWORD, + NetworkErrors: DWORD, + Sessions: DWORD, + FailedSessions: DWORD, + Reconnects: DWORD, + CoreConnects: DWORD, + Lanman20Connects: DWORD, + Lanman21Connects: DWORD, + LanmanNtConnects: DWORD, + ServerDisconnects: DWORD, + HungSessions: DWORD, + UseCount: DWORD, + FailedUseCount: DWORD, + CurrentCommands: DWORD, +}} +pub type PSTAT_WORKSTATION_0 = *mut STAT_WORKSTATION_0; +pub type LPSTAT_WORKSTATION_0 = *mut STAT_WORKSTATION_0; +STRUCT!{struct STAT_SERVER_0 { + sts0_start: DWORD, + sts0_fopens: DWORD, + sts0_devopens: DWORD, + sts0_jobsqueued: DWORD, + sts0_sopens: DWORD, + sts0_stimedout: DWORD, + sts0_serrorout: DWORD, + sts0_pwerrors: DWORD, + sts0_permerrors: DWORD, + sts0_syserrors: DWORD, + sts0_bytessent_low: DWORD, + sts0_bytessent_high: DWORD, + sts0_bytesrcvd_low: DWORD, + sts0_bytesrcvd_high: DWORD, + sts0_avresponse: DWORD, + sts0_reqbufneed: DWORD, + sts0_bigbufneed: DWORD, +}} +pub type PSTAT_SERVER_0 = *mut STAT_SERVER_0; +pub type LPSTAT_SERVER_0 = *mut STAT_SERVER_0; +pub const STATSOPT_CLR: DWORD = 1; +pub const STATS_NO_VALUE: DWORD = -1i32 as u32; +pub const STATS_OVERFLOW: DWORD = -2i32 as u32; diff --git a/bash-5.1/vendor/winapi/src/um/lmsvc.rs b/bash-5.1/vendor/winapi/src/um/lmsvc.rs new file mode 100644 index 0000000000000000000000000000000000000000..2d9ee5e2e5ebd4af009756b17eb8c22bf079184d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmsvc.rs @@ -0,0 +1,180 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! This file contains structures, function prototypes, and definitions for the NetService API +use ctypes::c_long; +use shared::lmcons::NET_API_STATUS; +use shared::minwindef::{DWORD, LPBYTE, LPDWORD}; +use um::winnt::{LPCWSTR, LPWSTR}; +STRUCT!{struct SERVICE_INFO_0 { + svci0_name: LPWSTR, +}} +pub type PSERVICE_INFO_0 = *mut SERVICE_INFO_0; +pub type LPSERVICE_INFO_0 = *mut SERVICE_INFO_0; +STRUCT!{struct SERVICE_INFO_1 { + svci1_name: LPWSTR, + svci1_status: DWORD, + svci1_code: DWORD, + svci1_pid: DWORD, +}} +pub type PSERVICE_INFO_1 = *mut SERVICE_INFO_1; +pub type LPSERVICE_INFO_1 = *mut SERVICE_INFO_1; +STRUCT!{struct SERVICE_INFO_2 { + svci2_name: LPWSTR, + svci2_status: DWORD, + svci2_code: DWORD, + svci2_pid: DWORD, + svci2_text: LPWSTR, + svci2_specific_error: DWORD, + svci2_display_name: LPWSTR, +}} +pub type PSERVICE_INFO_2 = *mut SERVICE_INFO_2; +pub type LPSERVICE_INFO_2 = *mut SERVICE_INFO_2; +extern "system" { + pub fn NetServiceControl( + servername: LPCWSTR, + service: LPCWSTR, + opcode: DWORD, + arg: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetServiceEnum( + servername: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetServiceGetInfo( + servername: LPCWSTR, + service: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetServiceInstall( + servername: LPCWSTR, + service: LPCWSTR, + argc: DWORD, + argv: *mut LPCWSTR, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; +} +pub const SERVICE_INSTALL_STATE: DWORD = 0x03; +pub const SERVICE_UNINSTALLED: DWORD = 0x00; +pub const SERVICE_INSTALL_PENDING: DWORD = 0x01; +pub const SERVICE_UNINSTALL_PENDING: DWORD = 0x02; +pub const SERVICE_INSTALLED: DWORD = 0x03; +pub const SERVICE_PAUSE_STATE: DWORD = 0x0C; +pub const LM20_SERVICE_ACTIVE: DWORD = 0x00; +pub const LM20_SERVICE_CONTINUE_PENDING: DWORD = 0x04; +pub const LM20_SERVICE_PAUSE_PENDING: DWORD = 0x08; +pub const LM20_SERVICE_PAUSED: DWORD = 0x0C; +pub const SERVICE_NOT_UNINSTALLABLE: DWORD = 0x00; +pub const SERVICE_UNINSTALLABLE: DWORD = 0x10; +pub const SERVICE_NOT_PAUSABLE: DWORD = 0x00; +pub const SERVICE_PAUSABLE: DWORD = 0x20; +pub const SERVICE_REDIR_PAUSED: DWORD = 0x700; +pub const SERVICE_REDIR_DISK_PAUSED: DWORD = 0x100; +pub const SERVICE_REDIR_PRINT_PAUSED: DWORD = 0x200; +pub const SERVICE_REDIR_COMM_PAUSED: DWORD = 0x400; +pub const SERVICE_DOS_ENCRYPTION: &'static str = "ENCRYPT"; +pub const SERVICE_CTRL_INTERROGATE: DWORD = 0; +pub const SERVICE_CTRL_PAUSE: DWORD = 1; +pub const SERVICE_CTRL_CONTINUE: DWORD = 2; +pub const SERVICE_CTRL_UNINSTALL: DWORD = 3; +pub const SERVICE_CTRL_REDIR_DISK: DWORD = 0x1; +pub const SERVICE_CTRL_REDIR_PRINT: DWORD = 0x2; +pub const SERVICE_CTRL_REDIR_COMM: DWORD = 0x4; +pub const SERVICE_IP_NO_HINT: DWORD = 0x0; +pub const SERVICE_CCP_NO_HINT: DWORD = 0x0; +pub const SERVICE_IP_QUERY_HINT: DWORD = 0x10000; +pub const SERVICE_CCP_QUERY_HINT: DWORD = 0x10000; +pub const SERVICE_IP_CHKPT_NUM: DWORD = 0x0FF; +pub const SERVICE_CCP_CHKPT_NUM: DWORD = 0x0FF; +pub const SERVICE_IP_WAIT_TIME: DWORD = 0x0FF00; +pub const SERVICE_CCP_WAIT_TIME: DWORD = 0x0FF00; +pub const SERVICE_IP_WAITTIME_SHIFT: DWORD = 8; +pub const SERVICE_NTIP_WAITTIME_SHIFT: DWORD = 12; +pub const UPPER_HINT_MASK: DWORD = 0x0000FF00; +pub const LOWER_HINT_MASK: DWORD = 0x000000FF; +pub const UPPER_GET_HINT_MASK: DWORD = 0x0FF00000; +pub const LOWER_GET_HINT_MASK: DWORD = 0x0000FF00; +pub const SERVICE_NT_MAXTIME: DWORD = 0x0000FFFF; +pub const SERVICE_RESRV_MASK: DWORD = 0x0001FFFF; +pub const SERVICE_MAXTIME: DWORD = 0x000000FF; +pub const SERVICE_BASE: DWORD = 3050; +pub const SERVICE_UIC_NORMAL: DWORD = 0; +pub const SERVICE_UIC_BADPARMVAL: DWORD = SERVICE_BASE + 1; +pub const SERVICE_UIC_MISSPARM: DWORD = SERVICE_BASE + 2; +pub const SERVICE_UIC_UNKPARM: DWORD = SERVICE_BASE + 3; +pub const SERVICE_UIC_RESOURCE: DWORD = SERVICE_BASE + 4; +pub const SERVICE_UIC_CONFIG: DWORD = SERVICE_BASE + 5; +pub const SERVICE_UIC_SYSTEM: DWORD = SERVICE_BASE + 6; +pub const SERVICE_UIC_INTERNAL: DWORD = SERVICE_BASE + 7; +pub const SERVICE_UIC_AMBIGPARM: DWORD = SERVICE_BASE + 8; +pub const SERVICE_UIC_DUPPARM: DWORD = SERVICE_BASE + 9; +pub const SERVICE_UIC_KILL: DWORD = SERVICE_BASE + 10; +pub const SERVICE_UIC_EXEC: DWORD = SERVICE_BASE + 11; +pub const SERVICE_UIC_SUBSERV: DWORD = SERVICE_BASE + 12; +pub const SERVICE_UIC_CONFLPARM: DWORD = SERVICE_BASE + 13; +pub const SERVICE_UIC_FILE: DWORD = SERVICE_BASE + 14; +pub const SERVICE_UIC_M_NULL: DWORD = 0; +pub const SERVICE_UIC_M_MEMORY: DWORD = SERVICE_BASE + 20; +pub const SERVICE_UIC_M_DISK: DWORD = SERVICE_BASE + 21; +pub const SERVICE_UIC_M_THREADS: DWORD = SERVICE_BASE + 22; +pub const SERVICE_UIC_M_PROCESSES: DWORD = SERVICE_BASE + 23; +pub const SERVICE_UIC_M_SECURITY: DWORD = SERVICE_BASE + 24; +pub const SERVICE_UIC_M_LANROOT: DWORD = SERVICE_BASE + 25; +pub const SERVICE_UIC_M_REDIR: DWORD = SERVICE_BASE + 26; +pub const SERVICE_UIC_M_SERVER: DWORD = SERVICE_BASE + 27; +pub const SERVICE_UIC_M_SEC_FILE_ERR: DWORD = SERVICE_BASE + 28; +pub const SERVICE_UIC_M_FILES: DWORD = SERVICE_BASE + 29; +pub const SERVICE_UIC_M_LOGS: DWORD = SERVICE_BASE + 30; +pub const SERVICE_UIC_M_LANGROUP: DWORD = SERVICE_BASE + 31; +pub const SERVICE_UIC_M_MSGNAME: DWORD = SERVICE_BASE + 32; +pub const SERVICE_UIC_M_ANNOUNCE: DWORD = SERVICE_BASE + 33; +pub const SERVICE_UIC_M_UAS: DWORD = SERVICE_BASE + 34; +pub const SERVICE_UIC_M_SERVER_SEC_ERR: DWORD = SERVICE_BASE + 35; +pub const SERVICE_UIC_M_WKSTA: DWORD = SERVICE_BASE + 37; +pub const SERVICE_UIC_M_ERRLOG: DWORD = SERVICE_BASE + 38; +pub const SERVICE_UIC_M_FILE_UW: DWORD = SERVICE_BASE + 39; +pub const SERVICE_UIC_M_ADDPAK: DWORD = SERVICE_BASE + 40; +pub const SERVICE_UIC_M_LAZY: DWORD = SERVICE_BASE + 41; +pub const SERVICE_UIC_M_UAS_MACHINE_ACCT: DWORD = SERVICE_BASE + 42; +pub const SERVICE_UIC_M_UAS_SERVERS_NMEMB: DWORD = SERVICE_BASE + 43; +pub const SERVICE_UIC_M_UAS_SERVERS_NOGRP: DWORD = SERVICE_BASE + 44; +pub const SERVICE_UIC_M_UAS_INVALID_ROLE: DWORD = SERVICE_BASE + 45; +pub const SERVICE_UIC_M_NETLOGON_NO_DC: DWORD = SERVICE_BASE + 46; +pub const SERVICE_UIC_M_NETLOGON_DC_CFLCT: DWORD = SERVICE_BASE + 47; +pub const SERVICE_UIC_M_NETLOGON_AUTH: DWORD = SERVICE_BASE + 48; +pub const SERVICE_UIC_M_UAS_PROLOG: DWORD = SERVICE_BASE + 49; +pub const SERVICE2_BASE: DWORD = 5600; +pub const SERVICE_UIC_M_NETLOGON_MPATH: DWORD = SERVICE2_BASE + 0; +pub const SERVICE_UIC_M_LSA_MACHINE_ACCT: DWORD = SERVICE2_BASE + 1; +pub const SERVICE_UIC_M_DATABASE_ERROR: DWORD = SERVICE2_BASE + 2; +#[inline] +pub fn SERVICE_IP_CODE(tt: DWORD, nn: DWORD) -> c_long { + (SERVICE_IP_QUERY_HINT | (nn | (tt << SERVICE_IP_WAITTIME_SHIFT))) as c_long +} +#[inline] +pub fn SERVICE_CCP_CODE(tt: DWORD, nn: DWORD) -> c_long { + (SERVICE_CCP_QUERY_HINT | (nn | (tt << SERVICE_IP_WAITTIME_SHIFT))) as c_long +} +#[inline] +pub fn SERVICE_UIC_CODE(cc: DWORD, mm: DWORD) -> c_long { + ((cc << 16) | mm) as c_long +} +#[inline] +pub fn SERVICE_NT_CCP_CODE(tt: DWORD, nn: DWORD) -> c_long { + (SERVICE_CCP_QUERY_HINT | nn | ((tt & LOWER_HINT_MASK) << SERVICE_IP_WAITTIME_SHIFT) + | ((tt & UPPER_HINT_MASK) << SERVICE_NTIP_WAITTIME_SHIFT)) as c_long +} +#[inline] +pub fn SERVICE_NT_WAIT_GET(code: DWORD) -> DWORD { + ((code & UPPER_GET_HINT_MASK) >> SERVICE_NTIP_WAITTIME_SHIFT) + | ((code & LOWER_GET_HINT_MASK) >> SERVICE_IP_WAITTIME_SHIFT) +} diff --git a/bash-5.1/vendor/winapi/src/um/lmuse.rs b/bash-5.1/vendor/winapi/src/um/lmuse.rs new file mode 100644 index 0000000000000000000000000000000000000000..66423121f10935e16e8569d5f4e8707afabbbe90 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmuse.rs @@ -0,0 +1,101 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! This file contains structures, function prototypes, and definitions for the NetUse API +use shared::lmcons::{LMSTR, NET_API_STATUS}; +use shared::minwindef::{DWORD, LPBYTE, LPDWORD, PBYTE, ULONG}; +use um::winnt::LPWSTR; +extern "system" { + pub fn NetUseAdd( + servername: LPWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetUseDel( + UncServerName: LMSTR, + UseName: LMSTR, + ForceCond: DWORD, + ) -> NET_API_STATUS; + pub fn NetUseEnum( + UncServerName: LMSTR, + Level: DWORD, + BufPtr: *mut LPBYTE, + PreferedMaximumSize: DWORD, + EntriesRead: LPDWORD, + TotalEntries: LPDWORD, + ResumeHandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetUseGetInfo( + UncServerName: LMSTR, + UseName: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; +} +STRUCT!{struct USE_INFO_0 { + ui0_local: LMSTR, + ui0_remote: LMSTR, +}} +pub type PUSE_INFO_0 = *mut USE_INFO_0; +pub type LPUSE_INFO_0 = *mut USE_INFO_0; +STRUCT!{struct USE_INFO_1 { + ui1_local: LMSTR, + ui1_remote: LMSTR, + ui1_password: LMSTR, + ui1_status: DWORD, + ui1_asg_type: DWORD, + ui1_refcount: DWORD, + ui1_usecount: DWORD, +}} +pub type PUSE_INFO_1 = *mut USE_INFO_1; +pub type LPUSE_INFO_1 = *mut USE_INFO_1; +STRUCT!{struct USE_INFO_2 { + ui2_local: LMSTR, + ui2_remote: LMSTR, + ui2_password: LMSTR, + ui2_status: DWORD, + ui2_asg_type: DWORD, + ui2_refcount: DWORD, + ui2_usecount: DWORD, + ui2_username: LMSTR, + ui2_domainname: LMSTR, +}} +pub type PUSE_INFO_2 = *mut USE_INFO_2; +pub type LPUSE_INFO_2 = *mut USE_INFO_2; +STRUCT!{struct USE_INFO_3 { + ui3_ui2: USE_INFO_2, + ui3_flags: ULONG, +}} +pub type PUSE_INFO_3 = *mut USE_INFO_3; +STRUCT!{struct USE_INFO_4 { + ui4_ui3: USE_INFO_3, + ui4_auth_identity_length: DWORD, + ui4_auth_identity: PBYTE, +}} +pub type PUSE_INFO_4 = *mut USE_INFO_4; +pub type LPUSE_INFO_4 = *mut USE_INFO_4; +pub const USE_LOCAL_PARMNUM: DWORD = 1; +pub const USE_REMOTE_PARMNUM: DWORD = 2; +pub const USE_PASSWORD_PARMNUM: DWORD = 3; +pub const USE_ASGTYPE_PARMNUM: DWORD = 4; +pub const USE_USERNAME_PARMNUM: DWORD = 5; +pub const USE_DOMAINNAME_PARMNUM: DWORD = 6; +pub const USE_OK: DWORD = 0; +pub const USE_PAUSED: DWORD = 1; +pub const USE_SESSLOST: DWORD = 2; +pub const USE_DISCONN: DWORD = 2; +pub const USE_NETERR: DWORD = 3; +pub const USE_CONN: DWORD = 4; +pub const USE_RECONN: DWORD = 5; +pub const USE_WILDCARD: DWORD = -1i32 as u32; +pub const USE_DISKDEV: DWORD = 0; +pub const USE_SPOOLDEV: DWORD = 1; +pub const USE_CHARDEV: DWORD = 2; +pub const USE_IPC: DWORD = 3; +pub const CREATE_NO_CONNECT: ULONG = 0x1; +pub const CREATE_BYPASS_CSC: ULONG = 0x2; +pub const CREATE_CRED_RESET: ULONG = 0x4; +pub const USE_DEFAULT_CREDENTIALS: ULONG = 0x4; diff --git a/bash-5.1/vendor/winapi/src/um/lmwksta.rs b/bash-5.1/vendor/winapi/src/um/lmwksta.rs new file mode 100644 index 0000000000000000000000000000000000000000..9b086bf606404153008d46527ff1541d0d82ee39 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lmwksta.rs @@ -0,0 +1,421 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +use shared::lmcons::{LMSTR, NET_API_STATUS}; +use shared::minwindef::{BOOL, DWORD, LPBYTE, LPDWORD}; +use um::winnt::LPCWSTR; +extern "system" { + pub fn NetWkstaGetInfo( + servername: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetWkstaSetInfo( + servername: LMSTR, + level: DWORD, + buffer: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetWkstaUserGetInfo( + reserved: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + ) -> NET_API_STATUS; + pub fn NetWkstaUserSetInfo( + reserved: LMSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetWkstaUserEnum( + servername: LMSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetWkstaTransportAdd( + servername: LPCWSTR, + level: DWORD, + buf: LPBYTE, + parm_err: LPDWORD, + ) -> NET_API_STATUS; + pub fn NetWkstaTransportDel( + servername: LMSTR, + transportname: LMSTR, + ucond: DWORD, + ) -> NET_API_STATUS; + pub fn NetWkstaTransportEnum( + servername: LPCWSTR, + level: DWORD, + bufptr: *mut LPBYTE, + prefmaxlen: DWORD, + entriesread: LPDWORD, + totalentries: LPDWORD, + resumehandle: LPDWORD, + ) -> NET_API_STATUS; +} +STRUCT!{struct WKSTA_INFO_100 { + wki100_platform_id: DWORD, + wki100_computername: LMSTR, + wki100_langroup: LMSTR, + wki100_ver_major: DWORD, + wki100_ver_minor: DWORD, +}} +pub type PWKSTA_INFO_100 = *mut WKSTA_INFO_100; +pub type LPWKSTA_INFO_100 = *mut WKSTA_INFO_100; +STRUCT!{struct WKSTA_INFO_101 { + wki101_platform_id: DWORD, + wki101_computername: LMSTR, + wki101_langroup: LMSTR, + wki101_ver_major: DWORD, + wki101_ver_minor: DWORD, + wki101_lanroot: LMSTR, +}} +pub type PWKSTA_INFO_101 = *mut WKSTA_INFO_101; +pub type LPWKSTA_INFO_101 = *mut WKSTA_INFO_101; +STRUCT!{struct WKSTA_INFO_102 { + wki102_platform_id: DWORD, + wki102_computername: LMSTR, + wki102_langroup: LMSTR, + wki102_ver_major: DWORD, + wki102_ver_minor: DWORD, + wki102_lanroot: LMSTR, + wki102_logged_on_users: DWORD, +}} +pub type PWKSTA_INFO_102 = *mut WKSTA_INFO_102; +pub type LPWKSTA_INFO_102 = *mut WKSTA_INFO_102; +STRUCT!{struct WKSTA_INFO_302 { + wki302_char_wait: DWORD, + wki302_collection_time: DWORD, + wki302_maximum_collection_count: DWORD, + wki302_keep_conn: DWORD, + wki302_keep_search: DWORD, + wki302_max_cmds: DWORD, + wki302_num_work_buf: DWORD, + wki302_siz_work_buf: DWORD, + wki302_max_wrk_cache: DWORD, + wki302_sess_timeout: DWORD, + wki302_siz_error: DWORD, + wki302_num_alerts: DWORD, + wki302_num_services: DWORD, + wki302_errlog_sz: DWORD, + wki302_print_buf_time: DWORD, + wki302_num_char_buf: DWORD, + wki302_siz_char_buf: DWORD, + wki302_wrk_heuristics: LMSTR, + wki302_mailslots: DWORD, + wki302_num_dgram_buf: DWORD, +}} +pub type PWKSTA_INFO_302 = *mut WKSTA_INFO_302; +pub type LPWKSTA_INFO_302 = *mut WKSTA_INFO_302; +STRUCT!{struct WKSTA_INFO_402 { + wki402_char_wait: DWORD, + wki402_collection_time: DWORD, + wki402_maximum_collection_count: DWORD, + wki402_keep_conn: DWORD, + wki402_keep_search: DWORD, + wki402_max_cmds: DWORD, + wki402_num_work_buf: DWORD, + wki402_siz_work_buf: DWORD, + wki402_max_wrk_cache: DWORD, + wki402_sess_timeout: DWORD, + wki402_siz_error: DWORD, + wki402_num_alerts: DWORD, + wki402_num_services: DWORD, + wki402_errlog_sz: DWORD, + wki402_print_buf_time: DWORD, + wki402_num_char_buf: DWORD, + wki402_siz_char_buf: DWORD, + wki402_wrk_heuristics: LMSTR, + wki402_mailslots: DWORD, + wki402_num_dgram_buf: DWORD, + wki402_max_threads: DWORD, +}} +pub type PWKSTA_INFO_402 = *mut WKSTA_INFO_402; +pub type LPWKSTA_INFO_402 = *mut WKSTA_INFO_402; +STRUCT!{struct WKSTA_INFO_502 { + wki502_char_wait: DWORD, + wki502_collection_time: DWORD, + wki502_maximum_collection_count: DWORD, + wki502_keep_conn: DWORD, + wki502_max_cmds: DWORD, + wki502_sess_timeout: DWORD, + wki502_siz_char_buf: DWORD, + wki502_max_threads: DWORD, + wki502_lock_quota: DWORD, + wki502_lock_increment: DWORD, + wki502_lock_maximum: DWORD, + wki502_pipe_increment: DWORD, + wki502_pipe_maximum: DWORD, + wki502_cache_file_timeout: DWORD, + wki502_dormant_file_limit: DWORD, + wki502_read_ahead_throughput: DWORD, + wki502_num_mailslot_buffers: DWORD, + wki502_num_srv_announce_buffers: DWORD, + wki502_max_illegal_datagram_events: DWORD, + wki502_illegal_datagram_event_reset_frequency: DWORD, + wki502_log_election_packets: BOOL, + wki502_use_opportunistic_locking: BOOL, + wki502_use_unlock_behind: BOOL, + wki502_use_close_behind: BOOL, + wki502_buf_named_pipes: BOOL, + wki502_use_lock_read_unlock: BOOL, + wki502_utilize_nt_caching: BOOL, + wki502_use_raw_read: BOOL, + wki502_use_raw_write: BOOL, + wki502_use_write_raw_data: BOOL, + wki502_use_encryption: BOOL, + wki502_buf_files_deny_write: BOOL, + wki502_buf_read_only_files: BOOL, + wki502_force_core_create_mode: BOOL, + wki502_use_512_byte_max_transfer: BOOL, +}} +pub type PWKSTA_INFO_502 = *mut WKSTA_INFO_502; +pub type LPWKSTA_INFO_502 = *mut WKSTA_INFO_502; +STRUCT!{struct WKSTA_INFO_1010 { + wki1010_char_wait: DWORD, +}} +pub type PWKSTA_INFO_1010 = *mut WKSTA_INFO_1010; +pub type LPWKSTA_INFO_1010 = *mut WKSTA_INFO_1010; +STRUCT!{struct WKSTA_INFO_1011 { + wki1011_collection_time: DWORD, +}} +pub type PWKSTA_INFO_1011 = *mut WKSTA_INFO_1011; +pub type LPWKSTA_INFO_1011 = *mut WKSTA_INFO_1011; +STRUCT!{struct WKSTA_INFO_1012 { + wki1012_maximum_collection_count: DWORD, +}} +pub type PWKSTA_INFO_1012 = *mut WKSTA_INFO_1012; +pub type LPWKSTA_INFO_1012 = *mut WKSTA_INFO_1012; +STRUCT!{struct WKSTA_INFO_1027 { + wki1027_errlog_sz: DWORD, +}} +pub type PWKSTA_INFO_1027 = *mut WKSTA_INFO_1027; +pub type LPWKSTA_INFO_1027 = *mut WKSTA_INFO_1027; +STRUCT!{struct WKSTA_INFO_1028 { + wki1028_print_buf_time: DWORD, +}} +pub type PWKSTA_INFO_1028 = *mut WKSTA_INFO_1028; +pub type LPWKSTA_INFO_1028 = *mut WKSTA_INFO_1028; +STRUCT!{struct WKSTA_INFO_1032 { + wki1032_wrk_heuristics: DWORD, +}} +pub type PWKSTA_INFO_1032 = *mut WKSTA_INFO_1032; +pub type LPWKSTA_INFO_1032 = *mut WKSTA_INFO_1032; +STRUCT!{struct WKSTA_INFO_1013 { + wki1013_keep_conn: DWORD, +}} +pub type PWKSTA_INFO_1013 = *mut WKSTA_INFO_1013; +pub type LPWKSTA_INFO_1013 = *mut WKSTA_INFO_1013; +STRUCT!{struct WKSTA_INFO_1018 { + wki1018_sess_timeout: DWORD, +}} +pub type PWKSTA_INFO_1018 = *mut WKSTA_INFO_1018; +pub type LPWKSTA_INFO_1018 = *mut WKSTA_INFO_1018; +STRUCT!{struct WKSTA_INFO_1023 { + wki1023_siz_char_buf: DWORD, +}} +pub type PWKSTA_INFO_1023 = *mut WKSTA_INFO_1023; +pub type LPWKSTA_INFO_1023 = *mut WKSTA_INFO_1023; +STRUCT!{struct WKSTA_INFO_1033 { + wki1033_max_threads: DWORD, +}} +pub type PWKSTA_INFO_1033 = *mut WKSTA_INFO_1033; +pub type LPWKSTA_INFO_1033 = *mut WKSTA_INFO_1033; +STRUCT!{struct WKSTA_INFO_1041 { + wki1041_lock_quota: DWORD, +}} +pub type PWKSTA_INFO_1041 = *mut WKSTA_INFO_1041; +pub type LPWKSTA_INFO_1041 = *mut WKSTA_INFO_1041; +STRUCT!{struct WKSTA_INFO_1042 { + wki1042_lock_increment: DWORD, +}} +pub type PWKSTA_INFO_1042 = *mut WKSTA_INFO_1042; +pub type LPWKSTA_INFO_1042 = *mut WKSTA_INFO_1042; +STRUCT!{struct WKSTA_INFO_1043 { + wki1043_lock_maximum: DWORD, +}} +pub type PWKSTA_INFO_1043 = *mut WKSTA_INFO_1043; +pub type LPWKSTA_INFO_1043 = *mut WKSTA_INFO_1043; +STRUCT!{struct WKSTA_INFO_1044 { + wki1044_pipe_increment: DWORD, +}} +pub type PWKSTA_INFO_1044 = *mut WKSTA_INFO_1044; +pub type LPWKSTA_INFO_1044 = *mut WKSTA_INFO_1044; +STRUCT!{struct WKSTA_INFO_1045 { + wki1045_pipe_maximum: DWORD, +}} +pub type PWKSTA_INFO_1045 = *mut WKSTA_INFO_1045; +pub type LPWKSTA_INFO_1045 = *mut WKSTA_INFO_1045; +STRUCT!{struct WKSTA_INFO_1046 { + wki1046_dormant_file_limit: DWORD, +}} +pub type PWKSTA_INFO_1046 = *mut WKSTA_INFO_1046; +pub type LPWKSTA_INFO_1046 = *mut WKSTA_INFO_1046; +STRUCT!{struct WKSTA_INFO_1047 { + wki1047_cache_file_timeout: DWORD, +}} +pub type PWKSTA_INFO_1047 = *mut WKSTA_INFO_1047; +pub type LPWKSTA_INFO_1047 = *mut WKSTA_INFO_1047; +STRUCT!{struct WKSTA_INFO_1048 { + wki1048_use_opportunistic_locking: BOOL, +}} +pub type PWKSTA_INFO_1048 = *mut WKSTA_INFO_1048; +pub type LPWKSTA_INFO_1048 = *mut WKSTA_INFO_1048; +STRUCT!{struct WKSTA_INFO_1049 { + wki1049_use_unlock_behind: BOOL, +}} +pub type PWKSTA_INFO_1049 = *mut WKSTA_INFO_1049; +pub type LPWKSTA_INFO_1049 = *mut WKSTA_INFO_1049; +STRUCT!{struct WKSTA_INFO_1050 { + wki1050_use_close_behind: BOOL, +}} +pub type PWKSTA_INFO_1050 = *mut WKSTA_INFO_1050; +pub type LPWKSTA_INFO_1050 = *mut WKSTA_INFO_1050; +STRUCT!{struct WKSTA_INFO_1051 { + wki1051_buf_named_pipes: BOOL, +}} +pub type PWKSTA_INFO_1051 = *mut WKSTA_INFO_1051; +pub type LPWKSTA_INFO_1051 = *mut WKSTA_INFO_1051; +STRUCT!{struct WKSTA_INFO_1052 { + wki1052_use_lock_read_unlock: BOOL, +}} +pub type PWKSTA_INFO_1052 = *mut WKSTA_INFO_1052; +pub type LPWKSTA_INFO_1052 = *mut WKSTA_INFO_1052; +STRUCT!{struct WKSTA_INFO_1053 { + wki1053_utilize_nt_caching: BOOL, +}} +pub type PWKSTA_INFO_1053 = *mut WKSTA_INFO_1053; +pub type LPWKSTA_INFO_1053 = *mut WKSTA_INFO_1053; +STRUCT!{struct WKSTA_INFO_1054 { + wki1054_use_raw_read: BOOL, +}} +pub type PWKSTA_INFO_1054 = *mut WKSTA_INFO_1054; +pub type LPWKSTA_INFO_1054 = *mut WKSTA_INFO_1054; +STRUCT!{struct WKSTA_INFO_1055 { + wki1055_use_raw_write: BOOL, +}} +pub type PWKSTA_INFO_1055 = *mut WKSTA_INFO_1055; +pub type LPWKSTA_INFO_1055 = *mut WKSTA_INFO_1055; +STRUCT!{struct WKSTA_INFO_1056 { + wki1056_use_write_raw_data: BOOL, +}} +pub type PWKSTA_INFO_1056 = *mut WKSTA_INFO_1056; +pub type LPWKSTA_INFO_1056 = *mut WKSTA_INFO_1056; +STRUCT!{struct WKSTA_INFO_1057 { + wki1057_use_encryption: BOOL, +}} +pub type PWKSTA_INFO_1057 = *mut WKSTA_INFO_1057; +pub type LPWKSTA_INFO_1057 = *mut WKSTA_INFO_1057; +STRUCT!{struct WKSTA_INFO_1058 { + wki1058_buf_files_deny_write: BOOL, +}} +pub type PWKSTA_INFO_1058 = *mut WKSTA_INFO_1058; +pub type LPWKSTA_INFO_1058 = *mut WKSTA_INFO_1058; +STRUCT!{struct WKSTA_INFO_1059 { + wki1059_buf_read_only_files: BOOL, +}} +pub type PWKSTA_INFO_1059 = *mut WKSTA_INFO_1059; +pub type LPWKSTA_INFO_1059 = *mut WKSTA_INFO_1059; +STRUCT!{struct WKSTA_INFO_1060 { + wki1060_force_core_create_mode: BOOL, +}} +pub type PWKSTA_INFO_1060 = *mut WKSTA_INFO_1060; +pub type LPWKSTA_INFO_1060 = *mut WKSTA_INFO_1060; +STRUCT!{struct WKSTA_INFO_1061 { + wki1061_use_512_byte_max_transfer: BOOL, +}} +pub type PWKSTA_INFO_1061 = *mut WKSTA_INFO_1061; +pub type LPWKSTA_INFO_1061 = *mut WKSTA_INFO_1061; +STRUCT!{struct WKSTA_INFO_1062 { + wki1062_read_ahead_throughput: DWORD, +}} +pub type PWKSTA_INFO_1062 = *mut WKSTA_INFO_1062; +pub type LPWKSTA_INFO_1062 = *mut WKSTA_INFO_1062; +STRUCT!{struct WKSTA_USER_INFO_0 { + wkui0_username: LMSTR, +}} +pub type PWKSTA_USER_INFO_0 = *mut WKSTA_USER_INFO_0; +pub type LPWKSTA_USER_INFO_0 = *mut WKSTA_USER_INFO_0; +STRUCT!{struct WKSTA_USER_INFO_1 { + wkui1_username: LMSTR, + wkui1_logon_domain: LMSTR, + wkui1_oth_domains: LMSTR, + wkui1_logon_server: LMSTR, +}} +pub type PWKSTA_USER_INFO_1 = *mut WKSTA_USER_INFO_1; +pub type LPWKSTA_USER_INFO_1 = *mut WKSTA_USER_INFO_1; +STRUCT!{struct WKSTA_USER_INFO_1101 { + wkui1101_oth_domains: LMSTR, +}} +pub type PWKSTA_USER_INFO_1101 = *mut WKSTA_USER_INFO_1101; +pub type LPWKSTA_USER_INFO_1101 = *mut WKSTA_USER_INFO_1101; +STRUCT!{struct WKSTA_TRANSPORT_INFO_0 { + wkti0_quality_of_service: DWORD, + wkti0_number_of_vcs: DWORD, + wkti0_transport_name: LMSTR, + wkti0_transport_address: LMSTR, + wkti0_wan_ish: BOOL, +}} +pub type PWKSTA_TRANSPORT_INFO_0 = *mut WKSTA_TRANSPORT_INFO_0; +pub type LPWKSTA_TRANSPORT_INFO_0 = *mut WKSTA_TRANSPORT_INFO_0; +pub const WKSTA_PLATFORM_ID_PARMNUM: DWORD = 100; +pub const WKSTA_COMPUTERNAME_PARMNUM: DWORD = 1; +pub const WKSTA_LANGROUP_PARMNUM: DWORD = 2; +pub const WKSTA_VER_MAJOR_PARMNUM: DWORD = 4; +pub const WKSTA_VER_MINOR_PARMNUM: DWORD = 5; +pub const WKSTA_LOGGED_ON_USERS_PARMNUM: DWORD = 6; +pub const WKSTA_LANROOT_PARMNUM: DWORD = 7; +pub const WKSTA_LOGON_DOMAIN_PARMNUM: DWORD = 8; +pub const WKSTA_LOGON_SERVER_PARMNUM: DWORD = 9; +pub const WKSTA_CHARWAIT_PARMNUM: DWORD = 10; +pub const WKSTA_CHARTIME_PARMNUM: DWORD = 11; +pub const WKSTA_CHARCOUNT_PARMNUM: DWORD = 12; +pub const WKSTA_KEEPCONN_PARMNUM: DWORD = 13; +pub const WKSTA_KEEPSEARCH_PARMNUM: DWORD = 14; +pub const WKSTA_MAXCMDS_PARMNUM: DWORD = 15; +pub const WKSTA_NUMWORKBUF_PARMNUM: DWORD = 16; +pub const WKSTA_MAXWRKCACHE_PARMNUM: DWORD = 17; +pub const WKSTA_SESSTIMEOUT_PARMNUM: DWORD = 18; +pub const WKSTA_SIZERROR_PARMNUM: DWORD = 19; +pub const WKSTA_NUMALERTS_PARMNUM: DWORD = 20; +pub const WKSTA_NUMSERVICES_PARMNUM: DWORD = 21; +pub const WKSTA_NUMCHARBUF_PARMNUM: DWORD = 22; +pub const WKSTA_SIZCHARBUF_PARMNUM: DWORD = 23; +pub const WKSTA_ERRLOGSZ_PARMNUM: DWORD = 27; +pub const WKSTA_PRINTBUFTIME_PARMNUM: DWORD = 28; +pub const WKSTA_SIZWORKBUF_PARMNUM: DWORD = 29; +pub const WKSTA_MAILSLOTS_PARMNUM: DWORD = 30; +pub const WKSTA_NUMDGRAMBUF_PARMNUM: DWORD = 31; +pub const WKSTA_WRKHEURISTICS_PARMNUM: DWORD = 32; +pub const WKSTA_MAXTHREADS_PARMNUM: DWORD = 33; +pub const WKSTA_LOCKQUOTA_PARMNUM: DWORD = 41; +pub const WKSTA_LOCKINCREMENT_PARMNUM: DWORD = 42; +pub const WKSTA_LOCKMAXIMUM_PARMNUM: DWORD = 43; +pub const WKSTA_PIPEINCREMENT_PARMNUM: DWORD = 44; +pub const WKSTA_PIPEMAXIMUM_PARMNUM: DWORD = 45; +pub const WKSTA_DORMANTFILELIMIT_PARMNUM: DWORD = 46; +pub const WKSTA_CACHEFILETIMEOUT_PARMNUM: DWORD = 47; +pub const WKSTA_USEOPPORTUNISTICLOCKING_PARMNUM: DWORD = 48; +pub const WKSTA_USEUNLOCKBEHIND_PARMNUM: DWORD = 49; +pub const WKSTA_USECLOSEBEHIND_PARMNUM: DWORD = 50; +pub const WKSTA_BUFFERNAMEDPIPES_PARMNUM: DWORD = 51; +pub const WKSTA_USELOCKANDREADANDUNLOCK_PARMNUM: DWORD = 52; +pub const WKSTA_UTILIZENTCACHING_PARMNUM: DWORD = 53; +pub const WKSTA_USERAWREAD_PARMNUM: DWORD = 54; +pub const WKSTA_USERAWWRITE_PARMNUM: DWORD = 55; +pub const WKSTA_USEWRITERAWWITHDATA_PARMNUM: DWORD = 56; +pub const WKSTA_USEENCRYPTION_PARMNUM: DWORD = 57; +pub const WKSTA_BUFFILESWITHDENYWRITE_PARMNUM: DWORD = 58; +pub const WKSTA_BUFFERREADONLYFILES_PARMNUM: DWORD = 59; +pub const WKSTA_FORCECORECREATEMODE_PARMNUM: DWORD = 60; +pub const WKSTA_USE512BYTESMAXTRANSFER_PARMNUM: DWORD = 61; +pub const WKSTA_READAHEADTHRUPUT_PARMNUM: DWORD = 62; +pub const WKSTA_OTH_DOMAINS_PARMNUM: DWORD = 101; +pub const TRANSPORT_QUALITYOFSERVICE_PARMNUM: DWORD = 201; +pub const TRANSPORT_NAME_PARMNUM: DWORD = 202; diff --git a/bash-5.1/vendor/winapi/src/um/lowlevelmonitorconfigurationapi.rs b/bash-5.1/vendor/winapi/src/um/lowlevelmonitorconfigurationapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..fe73214b58520196d90da11c69040b1966da6c1b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lowlevelmonitorconfigurationapi.rs @@ -0,0 +1,49 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BYTE, DWORD, LPDWORD}; +use um::physicalmonitorenumerationapi::_BOOL; +use um::winnt::{HANDLE, LPSTR}; +STRUCT!{#[repr(packed)] struct MC_TIMING_REPORT { + dwHorizontalFrequencyInHZ: DWORD, + dwVerticalFrequencyInHZ: DWORD, + bTimingStatusByte: BYTE, +}} +pub type LPMC_TIMING_REPORT = *mut MC_TIMING_REPORT; +ENUM!{enum MC_VCP_CODE_TYPE { + MC_MOMENTARY, + MC_SET_PARAMETER, +}} +pub type LPMC_VCP_CODE_TYPE = *mut MC_VCP_CODE_TYPE; +extern "system" { + pub fn GetVCPFeatureAndVCPFeatureReply( + hMonitor: HANDLE, + bVCPCode: BYTE, + pvct: LPMC_VCP_CODE_TYPE, + pdwCurrentValue: LPDWORD, + pdwMaximumValue: LPDWORD, + ) -> _BOOL; + pub fn SetVCPFeature( + hMonitor: HANDLE, + bVCPCode: BYTE, + dwNewValue: DWORD, + ) -> _BOOL; + pub fn SaveCurrentSettings( + hMonitor: HANDLE, + ) -> _BOOL; + pub fn GetCapabilitiesStringLength( + hMonitor: HANDLE, + pdwCapabilitiesStringLengthInCharacters: LPDWORD, + ) -> _BOOL; + pub fn CapabilitiesRequestAndCapabilitiesReply( + hMonitor: HANDLE, + pszASCIICapabilitiesString: LPSTR, + dwCapabilitiesStringLengthInCharacters: DWORD, + ) -> _BOOL; + pub fn GetTimingReport( + hMonitor: HANDLE, + pmtrMonitorTimingReport: LPMC_TIMING_REPORT, + ) -> _BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/lsalookup.rs b/bash-5.1/vendor/winapi/src/um/lsalookup.rs new file mode 100644 index 0000000000000000000000000000000000000000..95a6b62b7898a4a2a913f8f21ab5f7a58cb80d80 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/lsalookup.rs @@ -0,0 +1,109 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! LSA Policy Lookup API +use shared::guiddef::GUID; +use shared::minwindef::{ULONG, USHORT}; +use shared::ntdef::NTSTATUS; +use um::winnt::{ACCESS_MASK, HANDLE, LONG, PCHAR, PSID, PVOID, PWSTR, SID_NAME_USE}; +STRUCT!{struct LSA_UNICODE_STRING { + Length: USHORT, + MaximumLength: USHORT, + Buffer: PWSTR, +}} +pub type PLSA_UNICODE_STRING = *mut LSA_UNICODE_STRING; +STRUCT!{struct LSA_STRING { + Length: USHORT, + MaximumLength: USHORT, + Buffer: PCHAR, +}} +pub type PLSA_STRING = *mut LSA_STRING; +STRUCT!{struct LSA_OBJECT_ATTRIBUTES { + Length: ULONG, + RootDirectory: HANDLE, + ObjectName: PLSA_UNICODE_STRING, + Attributes: ULONG, + SecurityDescriptor: PVOID, + SecurityQualityOfService: PVOID, +}} +pub type PLSA_OBJECT_ATTRIBUTES = *mut LSA_OBJECT_ATTRIBUTES; +STRUCT!{struct LSA_TRUST_INFORMATION { + Name: LSA_UNICODE_STRING, + Sid: PSID, +}} +pub type PLSA_TRUST_INFORMATION = *mut LSA_TRUST_INFORMATION; +STRUCT!{struct LSA_REFERENCED_DOMAIN_LIST { + Entries: ULONG, + Domains: PLSA_TRUST_INFORMATION, +}} +pub type PLSA_REFERENCED_DOMAIN_LIST = *mut LSA_REFERENCED_DOMAIN_LIST; +STRUCT!{struct LSA_TRANSLATED_SID2 { + Use: SID_NAME_USE, + Sid: PSID, + DomainIndex: LONG, + Flags: ULONG, +}} +pub type PLSA_TRANSLATED_SID2 = *mut LSA_TRANSLATED_SID2; +STRUCT!{struct LSA_TRANSLATED_NAME { + Use: SID_NAME_USE, + Name: LSA_UNICODE_STRING, + DomainIndex: LONG, +}} +pub type PLSA_TRANSLATED_NAME = *mut LSA_TRANSLATED_NAME; +STRUCT!{struct POLICY_ACCOUNT_DOMAIN_INFO { + DomainName: LSA_UNICODE_STRING, + DomainSid: PSID, +}} +pub type PPOLICY_ACCOUNT_DOMAIN_INFO = *mut POLICY_ACCOUNT_DOMAIN_INFO; +STRUCT!{struct POLICY_DNS_DOMAIN_INFO { + Name: LSA_UNICODE_STRING, + DnsDomainName: LSA_UNICODE_STRING, + DnsForestName: LSA_UNICODE_STRING, + DomainGuid: GUID, + Sid: PSID, +}} +pub type PPOLICY_DNS_DOMAIN_INFO = *mut POLICY_DNS_DOMAIN_INFO; +pub const LOOKUP_VIEW_LOCAL_INFORMATION: ACCESS_MASK = 0x00000001; +pub const LOOKUP_TRANSLATE_NAMES: ACCESS_MASK = 0x00000800; +ENUM!{enum LSA_LOOKUP_DOMAIN_INFO_CLASS { + AccountDomainInformation = 5, + DnsDomainInformation = 12, +}} +pub type PLSA_LOOKUP_DOMAIN_INFO_CLASS = *mut LSA_LOOKUP_DOMAIN_INFO_CLASS; +pub type LSA_LOOKUP_HANDLE = PVOID; +pub type PLSA_LOOKUP_HANDLE = *mut PVOID; +extern "C" { + pub fn LsaLookupOpenLocalPolicy( + ObjectAttributes: PLSA_OBJECT_ATTRIBUTES, + AccessMask: ACCESS_MASK, + PolicyHandle: PLSA_LOOKUP_HANDLE, + ) -> NTSTATUS; + pub fn LsaLookupClose( + ObjectHandle: LSA_LOOKUP_HANDLE, + ) -> NTSTATUS; + pub fn LsaLookupTranslateSids( + PolicyHandle: LSA_LOOKUP_HANDLE, + Count: ULONG, + Sids: *mut PSID, + ReferencedDomains: *mut PLSA_REFERENCED_DOMAIN_LIST, + Names: *mut PLSA_TRANSLATED_NAME, + ) -> NTSTATUS; + pub fn LsaLookupTranslateNames( + PolicyHandle: LSA_LOOKUP_HANDLE, + Flags: ULONG, + Count: ULONG, + Names: PLSA_UNICODE_STRING, + ReferencedDomains: *mut PLSA_REFERENCED_DOMAIN_LIST, + Sids: *mut PLSA_TRANSLATED_SID2, + ) -> NTSTATUS; + pub fn LsaLookupGetDomainInfo( + PolicyHandle: LSA_LOOKUP_HANDLE, + DomainInfoClass: LSA_LOOKUP_DOMAIN_INFO_CLASS, + DomainInfo: *mut PVOID, + ) -> NTSTATUS; + pub fn LsaLookupFreeMemory( + Buffer: PVOID, + ) -> NTSTATUS; +} diff --git a/bash-5.1/vendor/winapi/src/um/memoryapi.rs b/bash-5.1/vendor/winapi/src/um/memoryapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..5bf5bd01c7b0cd1b43408a6cee63b8d26d6b256a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/memoryapi.rs @@ -0,0 +1,390 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-core-memory-l1-1-0 +use ctypes::c_void; +use shared::basetsd::{PSIZE_T, PULONG_PTR, SIZE_T, ULONG64, ULONG_PTR}; +use shared::minwindef::{ + BOOL, DWORD, LPCVOID, LPDWORD, LPVOID, PBOOL, PDWORD, PULONG, UINT, ULONG, +}; +use um::minwinbase::{LPSECURITY_ATTRIBUTES, PSECURITY_ATTRIBUTES}; +use um::winnt::{ + HANDLE, LPCWSTR, PCWSTR, PMEMORY_BASIC_INFORMATION, PVOID, SECTION_ALL_ACCESS, + SECTION_MAP_EXECUTE_EXPLICIT, SECTION_MAP_READ, SECTION_MAP_WRITE, +}; +pub const FILE_MAP_WRITE: DWORD = SECTION_MAP_WRITE; +pub const FILE_MAP_READ: DWORD = SECTION_MAP_READ; +pub const FILE_MAP_ALL_ACCESS: DWORD = SECTION_ALL_ACCESS; +pub const FILE_MAP_EXECUTE: DWORD = SECTION_MAP_EXECUTE_EXPLICIT; +pub const FILE_MAP_COPY: DWORD = 0x00000001; +pub const FILE_MAP_RESERVE: DWORD = 0x80000000; +pub const FILE_MAP_TARGETS_INVALID: DWORD = 0x40000000; +pub const FILE_MAP_LARGE_PAGES: DWORD = 0x20000000; +extern "system" { + pub fn VirtualAlloc( + lpAddress: LPVOID, + dwSize: SIZE_T, + flAllocationType: DWORD, + flProtect: DWORD, + ) -> LPVOID; + pub fn VirtualProtect( + lpAddress: LPVOID, + dwSize: SIZE_T, + flNewProtect: DWORD, + lpflOldProtect: PDWORD, + ) -> BOOL; + pub fn VirtualFree( + lpAddress: LPVOID, + dwSize: SIZE_T, + dwFreeType: DWORD, + ) -> BOOL; + pub fn VirtualQuery( + lpAddress: LPCVOID, + lpBuffer: PMEMORY_BASIC_INFORMATION, + dwLength: SIZE_T, + ) -> SIZE_T; + pub fn VirtualAllocEx( + hProcess: HANDLE, + lpAddress: LPVOID, + dwSize: SIZE_T, + flAllocationType: DWORD, + flProtect: DWORD, + ) -> LPVOID; + pub fn VirtualFreeEx( + hProcess: HANDLE, + lpAddress: LPVOID, + dwSize: SIZE_T, + dwFreeType: DWORD, + ) -> BOOL; + pub fn VirtualProtectEx( + hProcess: HANDLE, + lpAddress: LPVOID, + dwSize: SIZE_T, + flNewProtect: DWORD, + lpflOldProtect: PDWORD, + ) -> BOOL; + pub fn VirtualQueryEx( + hProcess: HANDLE, + lpAddress: LPCVOID, + lpBuffer: PMEMORY_BASIC_INFORMATION, + dwLength: SIZE_T, + ) -> SIZE_T; + pub fn ReadProcessMemory( + hProcess: HANDLE, + lpBaseAddress: LPCVOID, + lpBuffer: LPVOID, + nSize: SIZE_T, + lpNumberOfBytesRead: *mut SIZE_T, + ) -> BOOL; + pub fn WriteProcessMemory( + hProcess: HANDLE, + lpBaseAddress: LPVOID, + lpBuffer: LPCVOID, + nSize: SIZE_T, + lpNumberOfBytesWritten: *mut SIZE_T, + ) -> BOOL; + pub fn CreateFileMappingW( + hFile: HANDLE, + lpFileMappingAttributes: LPSECURITY_ATTRIBUTES, + flProtect: DWORD, + dwMaximumSizeHigh: DWORD, + dwMaximumSizeLow: DWORD, + lpName: LPCWSTR, + ) -> HANDLE; + pub fn OpenFileMappingW( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpName: LPCWSTR, + ) -> HANDLE; + pub fn MapViewOfFile( + hFileMappingObject: HANDLE, + dwDesiredAccess: DWORD, + dwFileOffsetHigh: DWORD, + dwFileOffsetLow: DWORD, + dwNumberOfBytesToMap: SIZE_T, + ) -> LPVOID; + pub fn MapViewOfFileEx( + hFileMappingObject: HANDLE, + dwDesiredAccess: DWORD, + dwFileOffsetHigh: DWORD, + dwFileOffsetLow: DWORD, + dwNumberOfBytesToMap: SIZE_T, + lpBaseAddress: LPVOID, + ) -> LPVOID; + pub fn FlushViewOfFile( + lpBaseAddress: LPCVOID, + dwNumberOfBytesToFlush: SIZE_T, + ) -> BOOL; + pub fn UnmapViewOfFile( + lpBaseAddress: LPCVOID, + ) -> BOOL; + pub fn GetLargePageMinimum() -> SIZE_T; + pub fn GetProcessWorkingSetSizeEx( + hProcess: HANDLE, + lpMinimumWorkingSetSize: PSIZE_T, + lpMaximumWorkingSetSize: PSIZE_T, + Flags: PDWORD, + ) -> BOOL; + pub fn SetProcessWorkingSetSizeEx( + hProcess: HANDLE, + dwMinimumWorkingSetSize: SIZE_T, + dwMaximumWorkingSetSize: SIZE_T, + Flags: DWORD, + ) -> BOOL; + pub fn VirtualLock( + lpAddress: LPVOID, + dwSize: SIZE_T, + ) -> BOOL; + pub fn VirtualUnlock( + lpAddress: LPVOID, + dwSize: SIZE_T, + ) -> BOOL; + pub fn GetWriteWatch( + dwFlags: DWORD, + lpBaseAddress: PVOID, + dwRegionSize: SIZE_T, + lpAddresses: *mut PVOID, + lpdwCount: *mut ULONG_PTR, + lpdwGranularity: LPDWORD, + ) -> UINT; + pub fn ResetWriteWatch( + lpBaseAddress: LPVOID, + dwRegionSize: SIZE_T, + ) -> UINT; +} +ENUM!{enum MEMORY_RESOURCE_NOTIFICATION_TYPE { + LowMemoryResourceNotification, + HighMemoryResourceNotification, +}} +extern "system" { + pub fn CreateMemoryResourceNotification( + NotificationType: MEMORY_RESOURCE_NOTIFICATION_TYPE, + ) -> HANDLE; + pub fn QueryMemoryResourceNotification( + ResourceNotificationHandle: HANDLE, + ResourceState: PBOOL, + ) -> BOOL; +} +pub const FILE_CACHE_MAX_HARD_ENABLE: DWORD = 0x00000001; +pub const FILE_CACHE_MAX_HARD_DISABLE: DWORD = 0x00000002; +pub const FILE_CACHE_MIN_HARD_ENABLE: DWORD = 0x00000004; +pub const FILE_CACHE_MIN_HARD_DISABLE: DWORD = 0x00000008; +extern "system" { + pub fn GetSystemFileCacheSize( + lpMinimumFileCacheSize: PSIZE_T, + lpMaximumFileCacheSize: PSIZE_T, + lpFlags: PDWORD, + ) -> BOOL; + pub fn SetSystemFileCacheSize( + MinimumFileCacheSize: SIZE_T, + MaximumFileCacheSize: SIZE_T, + Flags: DWORD, + ) -> BOOL; + pub fn CreateFileMappingNumaW( + hFile: HANDLE, + lpFileMappingAttributes: LPSECURITY_ATTRIBUTES, + flProtect: DWORD, + dwMaximumSizeHigh: DWORD, + dwMaximumSizeLow: DWORD, + lpName: LPCWSTR, + nndPreferred: DWORD, + ) -> HANDLE; +} +STRUCT!{struct WIN32_MEMORY_RANGE_ENTRY { + VirtualAddress: PVOID, + NumberOfBytes: SIZE_T, +}} +pub type PWIN32_MEMORY_RANGE_ENTRY = *mut WIN32_MEMORY_RANGE_ENTRY; +extern "system" { + pub fn PrefetchVirtualMemory( + hProcess: HANDLE, + NumberOfEntries: ULONG_PTR, + VirtualAddresses: PWIN32_MEMORY_RANGE_ENTRY, + Flags: ULONG, + ) -> BOOL; + pub fn CreateFileMappingFromApp( + hFile: HANDLE, + SecurityAttributes: PSECURITY_ATTRIBUTES, + PageProtection: ULONG, + MaximumSize: ULONG64, + Name: PCWSTR, + ) -> HANDLE; + pub fn MapViewOfFileFromApp( + hFileMappingObject: HANDLE, + DesiredAccess: ULONG, + FileOffset: ULONG64, + NumberOfBytesToMap: SIZE_T, + ) -> PVOID; + pub fn UnmapViewOfFileEx( + BaseAddress: PVOID, + UnmapFlags: ULONG, + ) -> BOOL; + pub fn AllocateUserPhysicalPages( + hProcess: HANDLE, + NumberOfPages: PULONG_PTR, + PageArray: PULONG_PTR, + ) -> BOOL; + pub fn FreeUserPhysicalPages( + hProcess: HANDLE, + NumberOfPages: PULONG_PTR, + PageArray: PULONG_PTR, + ) -> BOOL; + pub fn MapUserPhysicalPages( + VirtualAddress: PVOID, + NumberOfPages: ULONG_PTR, + PageArray: PULONG_PTR, + ) -> BOOL; + pub fn AllocateUserPhysicalPagesNuma( + hProcess: HANDLE, + NumberOfPages: PULONG_PTR, + PageArray: PULONG_PTR, + nndPreferred: DWORD, + ) -> BOOL; + pub fn VirtualAllocExNuma( + hProcess: HANDLE, + lpAddress: LPVOID, + dwSize: SIZE_T, + flAllocationType: DWORD, + flProtect: DWORD, + nndPreferred: DWORD, + ) -> LPVOID; +} +pub const MEHC_PATROL_SCRUBBER_PRESENT: ULONG = 0x1; +extern "system" { + pub fn GetMemoryErrorHandlingCapabilities( + Capabilities: PULONG, + ) -> BOOL; +} +FN!{stdcall PBAD_MEMORY_CALLBACK_ROUTINE() -> ()} +extern "system" { + pub fn RegisterBadMemoryNotification( + Callback: PBAD_MEMORY_CALLBACK_ROUTINE, + ) -> PVOID; + pub fn UnregisterBadMemoryNotification( + RegistrationHandle: PVOID, + ) -> BOOL; +} +ENUM!{enum OFFER_PRIORITY { + VmOfferPriorityVeryLow = 1, + VmOfferPriorityLow, + VmOfferPriorityBelowNormal, + VmOfferPriorityNormal, +}} +extern "system" { + pub fn OfferVirtualMemory( + VirtualAddress: PVOID, + Size: SIZE_T, + Priority: OFFER_PRIORITY, + ) -> DWORD; + pub fn ReclaimVirtualMemory( + VirtualAddress: *const c_void, + Size: SIZE_T, + ) -> DWORD; + pub fn DiscardVirtualMemory( + VirtualAddress: PVOID, + Size: SIZE_T, + ) -> DWORD; +// TODO: Needs winnt::PCFG_CALL_TARGET_INFO. +/* pub fn SetProcessValidCallTargets( + hProcess: HANDLE, + VirtualAddress: PVOID, + RegionSize: SIZE_T, + NumberOfOffsets: ULONG, + OffsetInformation: PCFG_CALL_TARGET_INFO, + ) -> BOOL; */ + pub fn VirtualAllocFromApp( + BaseAddress: PVOID, + Size: SIZE_T, + AllocationType: ULONG, + Protection: ULONG, + ) -> PVOID; + pub fn VirtualProtectFromApp( + Address: PVOID, + Size: SIZE_T, + NewProtection: ULONG, + OldProtection: PULONG, + ) -> BOOL; + pub fn OpenFileMappingFromApp( + DesiredAccess: ULONG, + InheritHandle: BOOL, + Name: PCWSTR, + ) -> HANDLE; +} +// TODO: Under WINAPI_PARTITION_APP, define CreateFileMappingW, MapViewOfFile, VirtualAlloc, +// VirtualProtect, and OpenFileMappingW as wrappers around the *FromApp functions. +ENUM!{enum WIN32_MEMORY_INFORMATION_CLASS { + MemoryRegionInfo, +}} +STRUCT!{struct WIN32_MEMORY_REGION_INFORMATION { + AllocationBase: PVOID, + AllocationProtect: ULONG, + u: WIN32_MEMORY_REGION_INFORMATION_u, + RegionSize: SIZE_T, + CommitSize: SIZE_T, +}} +UNION!{union WIN32_MEMORY_REGION_INFORMATION_u { + [u32; 1], + Flags Flags_mut: ULONG, + s s_mut: WIN32_MEMORY_REGION_INFORMATION_u_s, +}} +STRUCT!{struct WIN32_MEMORY_REGION_INFORMATION_u_s { + Bitfield: ULONG, +}} +BITFIELD!{WIN32_MEMORY_REGION_INFORMATION_u_s Bitfield: ULONG [ + Private set_Private[0..1], + MappedDataFile set_MappedDataFile[1..2], + MappedImage set_MappedImage[2..3], + MappedPageFile set_MappedPageFile[3..4], + MappedPhysical set_MappedPhysical[4..5], + DirectMapped set_DirectMapped[5..6], + Reserved set_Reserved[6..32], +]} +// TODO: Need to resolve issue #323 first. +/*extern "system" { + pub fn QueryVirtualMemoryInformation( + Process: HANDLE, + VirtualAddress: *const VOID, + MemoryInformationClass: WIN32_MEMORY_INFORMATION_CLASS, + MemoryInformation: PVOID, + MemoryInformationSize: SIZE_T, + ReturnSize: PSIZE_T, + ) -> BOOL; + pub fn MapViewOfFileNuma2( + FileMappingHandle: HANDLE, + ProcessHandle: HANDLE, + Offset: ULONG64, + BaseAddress: PVOID, + ViewSize: SIZE_T, + AllocationType: ULONG, + PageProtection: ULONG, + PreferredNode: ULONG, + ) -> PVOID; +} +#[inline] +pub unsafe fn MapViewOfFile2( + FileMappingHandle: HANDLE, + ProcessHandle: HANDLE, + Offset: ULONG64, + BaseAddress: PVOID, + ViewSize: SIZE_T, + AllocationType: ULONG, + PageProtection: ULONG, +) -> PVOID { + MapViewOfFileNuma2(FileMappingHandle, + ProcessHandle, + Offset, + BaseAddress, + ViewSize, + AllocationType, + PageProtection, + NUMA_NO_PREFERRED_NODE) +}*/ +extern "system" { + pub fn UnmapViewOfFile2( + ProcessHandle: HANDLE, + BaseAddress: PVOID, + UnmapFlags: ULONG, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/minschannel.rs b/bash-5.1/vendor/winapi/src/um/minschannel.rs new file mode 100644 index 0000000000000000000000000000000000000000..ba3ca4f2982907776b9d28caac15cbe0674e254c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/minschannel.rs @@ -0,0 +1,58 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Public Definitions for MIN SCHANNEL Security Provider +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, DWORD}; +use um::wincrypt::ALG_ID; +use um::winnt::LPWSTR; +pub const SECPKG_ATTR_ISSUER_LIST: DWORD = 0x50; +pub const SECPKG_ATTR_REMOTE_CRED: DWORD = 0x51; +pub const SECPKG_ATTR_LOCAL_CRED: DWORD = 0x52; +pub const SECPKG_ATTR_REMOTE_CERT_CONTEXT: DWORD = 0x53; +pub const SECPKG_ATTR_LOCAL_CERT_CONTEXT: DWORD = 0x54; +pub const SECPKG_ATTR_ROOT_STORE: DWORD = 0x55; +pub const SECPKG_ATTR_SUPPORTED_ALGS: DWORD = 0x56; +pub const SECPKG_ATTR_CIPHER_STRENGTHS: DWORD = 0x57; +pub const SECPKG_ATTR_SUPPORTED_PROTOCOLS: DWORD = 0x58; +pub const SECPKG_ATTR_ISSUER_LIST_EX: DWORD = 0x59; +pub const SECPKG_ATTR_CONNECTION_INFO: DWORD = 0x5a; +pub const SECPKG_ATTR_EAP_KEY_BLOCK: DWORD = 0x5b; +pub const SECPKG_ATTR_MAPPED_CRED_ATTR: DWORD = 0x5c; +pub const SECPKG_ATTR_SESSION_INFO: DWORD = 0x5d; +pub const SECPKG_ATTR_APP_DATA: DWORD = 0x5e; +pub const SECPKG_ATTR_REMOTE_CERTIFICATES: DWORD = 0x5F; +pub const SECPKG_ATTR_CLIENT_CERT_POLICY: DWORD = 0x60; +pub const SECPKG_ATTR_CC_POLICY_RESULT: DWORD = 0x61; +pub const SECPKG_ATTR_USE_NCRYPT: DWORD = 0x62; +pub const SECPKG_ATTR_LOCAL_CERT_INFO: DWORD = 0x63; +pub const SECPKG_ATTR_CIPHER_INFO: DWORD = 0x64; +pub const SECPKG_ATTR_EAP_PRF_INFO: DWORD = 0x65; +pub const SECPKG_ATTR_SUPPORTED_SIGNATURES: DWORD = 0x66; +pub const SECPKG_ATTR_REMOTE_CERT_CHAIN: DWORD = 0x67; +pub const SECPKG_ATTR_UI_INFO: DWORD = 0x68; +pub const SECPKG_ATTR_EARLY_START: DWORD = 0x69; +STRUCT!{struct SecPkgCred_SupportedAlgs { + cSupportedAlgs: DWORD, + palgSupportedAlgs: *mut ALG_ID, +}} +STRUCT!{struct SecPkgCred_CipherStrengths { + dwMinimumCipherStrength: DWORD, + dwMaximumCipherStrength: DWORD, +}} +STRUCT!{struct SecPkgCred_SupportedProtocols { + grbitProtocol: DWORD, +}} +STRUCT!{struct SecPkgCred_ClientCertPolicy { + dwFlags: DWORD, + guidPolicyId: GUID, + dwCertFlags: DWORD, + dwUrlRetrievalTimeout: DWORD, + fCheckRevocationFreshnessTime: BOOL, + dwRevocationFreshnessTime: DWORD, + fOmitUsageCheck: BOOL, + pwszSslCtlStoreName: LPWSTR, + pwszSslCtlIdentifier: LPWSTR, +}} diff --git a/bash-5.1/vendor/winapi/src/um/minwinbase.rs b/bash-5.1/vendor/winapi/src/um/minwinbase.rs new file mode 100644 index 0000000000000000000000000000000000000000..b414af1bac2d9fcf733630eae9ef1b39be9068be --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/minwinbase.rs @@ -0,0 +1,337 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! This module defines the 32-Bit Windows Base APIs +use shared::basetsd::ULONG_PTR; +use shared::minwindef::{BOOL, BYTE, DWORD, FILETIME, HMODULE, LPVOID, MAX_PATH, UINT, ULONG, WORD}; +use shared::ntstatus::{ + STATUS_ACCESS_VIOLATION, STATUS_ARRAY_BOUNDS_EXCEEDED, STATUS_BREAKPOINT, + STATUS_CONTROL_C_EXIT, STATUS_DATATYPE_MISALIGNMENT, STATUS_FLOAT_DENORMAL_OPERAND, + STATUS_FLOAT_DIVIDE_BY_ZERO, STATUS_FLOAT_INEXACT_RESULT, STATUS_FLOAT_INVALID_OPERATION, + STATUS_FLOAT_OVERFLOW, STATUS_FLOAT_STACK_CHECK, STATUS_FLOAT_UNDERFLOW, + STATUS_GUARD_PAGE_VIOLATION, STATUS_ILLEGAL_INSTRUCTION, STATUS_INTEGER_DIVIDE_BY_ZERO, + STATUS_INTEGER_OVERFLOW, STATUS_INVALID_DISPOSITION, STATUS_INVALID_HANDLE, + STATUS_IN_PAGE_ERROR, STATUS_NONCONTINUABLE_EXCEPTION, STATUS_PENDING, + STATUS_POSSIBLE_DEADLOCK, STATUS_PRIVILEGED_INSTRUCTION, STATUS_SINGLE_STEP, + STATUS_STACK_OVERFLOW, +}; +use um::winnt::{ + CHAR, EXCEPTION_RECORD, HANDLE, LPSTR, LPWSTR, PCONTEXT, PRTL_CRITICAL_SECTION, + PRTL_CRITICAL_SECTION_DEBUG, PVOID, RTL_CRITICAL_SECTION, RTL_CRITICAL_SECTION_DEBUG, WCHAR, +}; +//MoveMemory +//CopyMemory +//FillMemory +//ZeroMemory +STRUCT!{struct SECURITY_ATTRIBUTES { + nLength: DWORD, + lpSecurityDescriptor: LPVOID, + bInheritHandle: BOOL, +}} +pub type PSECURITY_ATTRIBUTES = *mut SECURITY_ATTRIBUTES; +pub type LPSECURITY_ATTRIBUTES = *mut SECURITY_ATTRIBUTES; +STRUCT!{struct OVERLAPPED_u_s { + Offset: DWORD, + OffsetHigh: DWORD, +}} +UNION!{union OVERLAPPED_u { + [u32; 2] [u64; 1], + s s_mut: OVERLAPPED_u_s, + Pointer Pointer_mut: PVOID, +}} +STRUCT!{struct OVERLAPPED { + Internal: ULONG_PTR, + InternalHigh: ULONG_PTR, + u: OVERLAPPED_u, + hEvent: HANDLE, +}} +pub type LPOVERLAPPED = *mut OVERLAPPED; +STRUCT!{struct OVERLAPPED_ENTRY { + lpCompletionKey: ULONG_PTR, + lpOverlapped: LPOVERLAPPED, + Internal: ULONG_PTR, + dwNumberOfBytesTransferred: DWORD, +}} +pub type LPOVERLAPPED_ENTRY = *mut OVERLAPPED_ENTRY; +STRUCT!{struct SYSTEMTIME { + wYear: WORD, + wMonth: WORD, + wDayOfWeek: WORD, + wDay: WORD, + wHour: WORD, + wMinute: WORD, + wSecond: WORD, + wMilliseconds: WORD, +}} +pub type PSYSTEMTIME = *mut SYSTEMTIME; +pub type LPSYSTEMTIME = *mut SYSTEMTIME; +STRUCT!{struct WIN32_FIND_DATAA { + dwFileAttributes: DWORD, + ftCreationTime: FILETIME, + ftLastAccessTime: FILETIME, + ftLastWriteTime: FILETIME, + nFileSizeHigh: DWORD, + nFileSizeLow: DWORD, + dwReserved0: DWORD, + dwReserved1: DWORD, + cFileName: [CHAR; MAX_PATH], + cAlternateFileName: [CHAR; 14], +}} +pub type PWIN32_FIND_DATAA = *mut WIN32_FIND_DATAA; +pub type LPWIN32_FIND_DATAA = *mut WIN32_FIND_DATAA; +STRUCT!{struct WIN32_FIND_DATAW { + dwFileAttributes: DWORD, + ftCreationTime: FILETIME, + ftLastAccessTime: FILETIME, + ftLastWriteTime: FILETIME, + nFileSizeHigh: DWORD, + nFileSizeLow: DWORD, + dwReserved0: DWORD, + dwReserved1: DWORD, + cFileName: [WCHAR; MAX_PATH], + cAlternateFileName: [WCHAR; 14], +}} +pub type PWIN32_FIND_DATAW = *mut WIN32_FIND_DATAW; +pub type LPWIN32_FIND_DATAW = *mut WIN32_FIND_DATAW; +ENUM!{enum FINDEX_INFO_LEVELS { + FindExInfoStandard, + FindExInfoBasic, + FindExInfoMaxInfoLevel, +}} +pub const FIND_FIRST_EX_CASE_SENSITIVE: DWORD = 0x00000001; +pub const FIND_FIRST_EX_LARGE_FETCH: DWORD = 0x00000002; +ENUM!{enum FINDEX_SEARCH_OPS { + FindExSearchNameMatch, + FindExSearchLimitToDirectories, + FindExSearchLimitToDevices, + FindExSearchMaxSearchOp, +}} +ENUM!{enum GET_FILEEX_INFO_LEVELS { + GetFileExInfoStandard, + GetFileExMaxInfoLevel, +}} +ENUM!{enum FILE_INFO_BY_HANDLE_CLASS { + FileBasicInfo, + FileStandardInfo, + FileNameInfo, + FileRenameInfo, + FileDispositionInfo, + FileAllocationInfo, + FileEndOfFileInfo, + FileStreamInfo, + FileCompressionInfo, + FileAttributeTagInfo, + FileIdBothDirectoryInfo, + FileIdBothDirectoryRestartInfo, + FileIoPriorityHintInfo, + FileRemoteProtocolInfo, + FileFullDirectoryInfo, + FileFullDirectoryRestartInfo, + FileStorageInfo, + FileAlignmentInfo, + FileIdInfo, + FileIdExtdDirectoryInfo, + FileIdExtdDirectoryRestartInfo, + FileDispositionInfoEx, + FileRenameInfoEx, + MaximumFileInfoByHandleClass, +}} +pub type PFILE_INFO_BY_HANDLE_CLASS = *mut FILE_INFO_BY_HANDLE_CLASS; +pub type CRITICAL_SECTION = RTL_CRITICAL_SECTION; +pub type PCRITICAL_SECTION = PRTL_CRITICAL_SECTION; +pub type LPCRITICAL_SECTION = PRTL_CRITICAL_SECTION; +pub type CRITICAL_SECTION_DEBUG = RTL_CRITICAL_SECTION_DEBUG; +pub type PCRITICAL_SECTION_DEBUG = PRTL_CRITICAL_SECTION_DEBUG; +pub type LPCRITICAL_SECTION_DEBUG = PRTL_CRITICAL_SECTION_DEBUG; +FN!{stdcall LPOVERLAPPED_COMPLETION_ROUTINE( + dwErrorCode: DWORD, + dwNumberOfBytesTransfered: DWORD, + lpOverlapped: LPOVERLAPPED, +) -> ()} +pub const LOCKFILE_FAIL_IMMEDIATELY: DWORD = 0x00000001; +pub const LOCKFILE_EXCLUSIVE_LOCK: DWORD = 0x00000002; +STRUCT!{struct PROCESS_HEAP_ENTRY_Block { + hMem: HANDLE, + dwReserved: [DWORD; 3], +}} +STRUCT!{struct PROCESS_HEAP_ENTRY_Region { + dwCommittedSize: DWORD, + dwUnCommittedSize: DWORD, + lpFirstBlock: LPVOID, + lpLastBlock: LPVOID, +}} +UNION!{union PROCESS_HEAP_ENTRY_u { + [u32; 4] [u64; 3], + Block Block_mut: PROCESS_HEAP_ENTRY_Block, + Region Region_mut: PROCESS_HEAP_ENTRY_Region, +}} +STRUCT!{struct PROCESS_HEAP_ENTRY { + lpData: PVOID, + cbData: DWORD, + cbOverhead: BYTE, + iRegionIndex: BYTE, + wFlags: WORD, + u: PROCESS_HEAP_ENTRY_u, +}} +pub type LPPROCESS_HEAP_ENTRY = *mut PROCESS_HEAP_ENTRY; +pub type PPROCESS_HEAP_ENTRY = *mut PROCESS_HEAP_ENTRY; +pub const PROCESS_HEAP_REGION: WORD = 0x0001; +pub const PROCESS_HEAP_UNCOMMITTED_RANGE: WORD = 0x0002; +pub const PROCESS_HEAP_ENTRY_BUSY: WORD = 0x0004; +pub const PROCESS_HEAP_SEG_ALLOC: WORD = 0x0008; +pub const PROCESS_HEAP_ENTRY_MOVEABLE: WORD = 0x0010; +pub const PROCESS_HEAP_ENTRY_DDESHARE: WORD = 0x0020; +STRUCT!{struct REASON_CONTEXT_Detailed { + LocalizedReasonModule: HMODULE, + LocalizedReasonId: ULONG, + ReasonStringCount: ULONG, + ReasonStrings: *mut LPWSTR, +}} +UNION!{union REASON_CONTEXT_Reason { + [u32; 4] [u64; 3], + Detailed Detailed_mut: REASON_CONTEXT_Detailed, + SimpleReasonString SimpleReasonString_mut: LPWSTR, +}} +STRUCT!{struct REASON_CONTEXT { + Version: ULONG, + Flags: DWORD, + Reason: REASON_CONTEXT_Reason, +}} +pub type PREASON_CONTEXT = *mut REASON_CONTEXT; +pub const EXCEPTION_DEBUG_EVENT: DWORD = 1; +pub const CREATE_THREAD_DEBUG_EVENT: DWORD = 2; +pub const CREATE_PROCESS_DEBUG_EVENT: DWORD = 3; +pub const EXIT_THREAD_DEBUG_EVENT: DWORD = 4; +pub const EXIT_PROCESS_DEBUG_EVENT: DWORD = 5; +pub const LOAD_DLL_DEBUG_EVENT: DWORD = 6; +pub const UNLOAD_DLL_DEBUG_EVENT: DWORD = 7; +pub const OUTPUT_DEBUG_STRING_EVENT: DWORD = 8; +pub const RIP_EVENT: DWORD = 9; +FN!{stdcall PTHREAD_START_ROUTINE( + lpThreadParameter: LPVOID, +) -> DWORD} +pub type LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE; +FN!{stdcall PENCLAVE_ROUTINE( + lpThreadParameter: LPVOID, +) -> DWORD} +pub type LPENCLAVE_ROUTINE = PENCLAVE_ROUTINE; +STRUCT!{struct EXCEPTION_DEBUG_INFO { + ExceptionRecord: EXCEPTION_RECORD, + dwFirstChance: DWORD, +}} +pub type LPEXCEPTION_DEBUG_INFO = *mut EXCEPTION_DEBUG_INFO; +STRUCT!{struct CREATE_THREAD_DEBUG_INFO { + hThread: HANDLE, + lpThreadLocalBase: LPVOID, + lpStartAddress: LPTHREAD_START_ROUTINE, +}} +pub type LPCREATE_THREAD_DEBUG_INFO = *mut CREATE_THREAD_DEBUG_INFO; +STRUCT!{struct CREATE_PROCESS_DEBUG_INFO { + hFile: HANDLE, + hProcess: HANDLE, + hThread: HANDLE, + lpBaseOfImage: LPVOID, + dwDebugInfoFileOffset: DWORD, + nDebugInfoSize: DWORD, + lpThreadLocalBase: LPVOID, + lpStartAddress: LPTHREAD_START_ROUTINE, + lpImageName: LPVOID, + fUnicode: WORD, +}} +pub type LPCREATE_PROCESS_DEBUG_INFO = *mut CREATE_PROCESS_DEBUG_INFO; +STRUCT!{struct EXIT_THREAD_DEBUG_INFO { + dwExitCode: DWORD, +}} +pub type LPEXIT_THREAD_DEBUG_INFO = *mut EXIT_THREAD_DEBUG_INFO; +STRUCT!{struct EXIT_PROCESS_DEBUG_INFO { + dwExitCode: DWORD, +}} +pub type LPEXIT_PROCESS_DEBUG_INFO = *mut EXIT_PROCESS_DEBUG_INFO; +STRUCT!{struct LOAD_DLL_DEBUG_INFO { + hFile: HANDLE, + lpBaseOfDll: LPVOID, + dwDebugInfoFileOffset: DWORD, + nDebugInfoSize: DWORD, + lpImageName: LPVOID, + fUnicode: WORD, +}} +pub type LPLOAD_DLL_DEBUG_INFO = *mut LOAD_DLL_DEBUG_INFO; +STRUCT!{struct UNLOAD_DLL_DEBUG_INFO { + lpBaseOfDll: LPVOID, +}} +pub type LPUNLOAD_DLL_DEBUG_INFO = *mut UNLOAD_DLL_DEBUG_INFO; +STRUCT!{struct OUTPUT_DEBUG_STRING_INFO { + lpDebugStringData: LPSTR, + fUnicode: WORD, + nDebugStringLength: WORD, +}} +pub type LPOUTPUT_DEBUG_STRING_INFO = *mut OUTPUT_DEBUG_STRING_INFO; +STRUCT!{struct RIP_INFO { + dwError: DWORD, + dwType: DWORD, +}} +pub type LPRIP_INFO = *mut RIP_INFO; +UNION!{union DEBUG_EVENT_u { + [u32; 21] [u64; 20], + Exception Exception_mut: EXCEPTION_DEBUG_INFO, + CreateThread CreateThread_mut: CREATE_THREAD_DEBUG_INFO, + CreateProcessInfo CreateProcessInfo_mut: CREATE_PROCESS_DEBUG_INFO, + ExitThread ExitThread_mut: EXIT_THREAD_DEBUG_INFO, + ExitProcess ExitProcess_mut: EXIT_PROCESS_DEBUG_INFO, + LoadDll LoadDll_mut: LOAD_DLL_DEBUG_INFO, + UnloadDll UnloadDll_mut: UNLOAD_DLL_DEBUG_INFO, + DebugString DebugString_mut: OUTPUT_DEBUG_STRING_INFO, + RipInfo RipInfo_mut: RIP_INFO, +}} +STRUCT!{struct DEBUG_EVENT { + dwDebugEventCode: DWORD, + dwProcessId: DWORD, + dwThreadId: DWORD, + u: DEBUG_EVENT_u, +}} +pub type LPDEBUG_EVENT = *mut DEBUG_EVENT; +pub type LPCONTEXT = PCONTEXT; +pub const STILL_ACTIVE: DWORD = STATUS_PENDING as u32; +pub const EXCEPTION_ACCESS_VIOLATION: DWORD = STATUS_ACCESS_VIOLATION as u32; +pub const EXCEPTION_DATATYPE_MISALIGNMENT: DWORD = STATUS_DATATYPE_MISALIGNMENT as u32; +pub const EXCEPTION_BREAKPOINT: DWORD = STATUS_BREAKPOINT as u32; +pub const EXCEPTION_SINGLE_STEP: DWORD = STATUS_SINGLE_STEP as u32; +pub const EXCEPTION_ARRAY_BOUNDS_EXCEEDED: DWORD = STATUS_ARRAY_BOUNDS_EXCEEDED as u32; +pub const EXCEPTION_FLT_DENORMAL_OPERAND: DWORD = STATUS_FLOAT_DENORMAL_OPERAND as u32; +pub const EXCEPTION_FLT_DIVIDE_BY_ZERO: DWORD = STATUS_FLOAT_DIVIDE_BY_ZERO as u32; +pub const EXCEPTION_FLT_INEXACT_RESULT: DWORD = STATUS_FLOAT_INEXACT_RESULT as u32; +pub const EXCEPTION_FLT_INVALID_OPERATION: DWORD = STATUS_FLOAT_INVALID_OPERATION as u32; +pub const EXCEPTION_FLT_OVERFLOW: DWORD = STATUS_FLOAT_OVERFLOW as u32; +pub const EXCEPTION_FLT_STACK_CHECK: DWORD = STATUS_FLOAT_STACK_CHECK as u32; +pub const EXCEPTION_FLT_UNDERFLOW: DWORD = STATUS_FLOAT_UNDERFLOW as u32; +pub const EXCEPTION_INT_DIVIDE_BY_ZERO: DWORD = STATUS_INTEGER_DIVIDE_BY_ZERO as u32; +pub const EXCEPTION_INT_OVERFLOW: DWORD = STATUS_INTEGER_OVERFLOW as u32; +pub const EXCEPTION_PRIV_INSTRUCTION: DWORD = STATUS_PRIVILEGED_INSTRUCTION as u32; +pub const EXCEPTION_IN_PAGE_ERROR: DWORD = STATUS_IN_PAGE_ERROR as u32; +pub const EXCEPTION_ILLEGAL_INSTRUCTION: DWORD = STATUS_ILLEGAL_INSTRUCTION as u32; +pub const EXCEPTION_NONCONTINUABLE_EXCEPTION: DWORD = STATUS_NONCONTINUABLE_EXCEPTION as u32; +pub const EXCEPTION_STACK_OVERFLOW: DWORD = STATUS_STACK_OVERFLOW as u32; +pub const EXCEPTION_INVALID_DISPOSITION: DWORD = STATUS_INVALID_DISPOSITION as u32; +pub const EXCEPTION_GUARD_PAGE: DWORD = STATUS_GUARD_PAGE_VIOLATION as u32; +pub const EXCEPTION_INVALID_HANDLE: DWORD = STATUS_INVALID_HANDLE as u32; +pub const EXCEPTION_POSSIBLE_DEADLOCK: DWORD = STATUS_POSSIBLE_DEADLOCK as u32; +pub const CONTROL_C_EXIT: DWORD = STATUS_CONTROL_C_EXIT as u32; +pub const LMEM_FIXED: UINT = 0x0000; +pub const LMEM_MOVEABLE: UINT = 0x0002; +pub const LMEM_NOCOMPACT: UINT = 0x0010; +pub const LMEM_NODISCARD: UINT = 0x0020; +pub const LMEM_ZEROINIT: UINT = 0x0040; +pub const LMEM_MODIFY: UINT = 0x0080; +pub const LMEM_DISCARDABLE: UINT = 0x0F00; +pub const LMEM_VALID_FLAGS: UINT = 0x0F72; +pub const LMEM_INVALID_HANDLE: UINT = 0x8000; +pub const LHND: UINT = LMEM_MOVEABLE | LMEM_ZEROINIT; +pub const LPTR: UINT = LMEM_FIXED | LMEM_ZEROINIT; +pub const NONZEROLHND: UINT = LMEM_MOVEABLE; +pub const NONZEROLPTR: UINT = LMEM_FIXED; +//LocalDiscard +pub const LMEM_DISCARDED: UINT = 0x4000; +pub const LMEM_LOCKCOUNT: UINT = 0x00FF; +pub const NUMA_NO_PREFERRED_NODE: DWORD = -1i32 as u32; diff --git a/bash-5.1/vendor/winapi/src/um/mmdeviceapi.rs b/bash-5.1/vendor/winapi/src/um/mmdeviceapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..9ab810f0c6b54efb45bde2b82ba6aada6679f458 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/mmdeviceapi.rs @@ -0,0 +1,220 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! this ALWAYS GENERATED file contains the definitions for the interfaces +use ctypes::c_void; +use shared::guiddef::{GUID, REFIID}; +use shared::minwindef::{DWORD, LPARAM, LPVOID, UINT}; +// use shared::winerror::{ERROR_NOT_FOUND, ERROR_UNSUPPORTED_TYPE, HRESULT_FROM_WIN32}; +use shared::wtypes::PROPERTYKEY; +use um::propidl::PROPVARIANT; +use um::propsys::IPropertyStore; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR}; +// pub const E_NOTFOUND: HRESULT = HRESULT_FROM_WIN32(ERROR_NOT_FOUND); +// pub const E_UNSUPPORTED_TYPE: HRESULT = HRESULT_FROM_WIN32(ERROR_UNSUPPORTED_TYPE); +pub const DEVICE_STATE_ACTIVE: DWORD = 0x00000001; +pub const DEVICE_STATE_DISABLED: DWORD = 0x00000002; +pub const DEVICE_STATE_NOTPRESENT: DWORD = 0x00000004; +pub const DEVICE_STATE_UNPLUGGED: DWORD = 0x00000008; +pub const DEVICE_STATEMASK_ALL: DWORD = 0x0000000F; +DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_FormFactor, + 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 0} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_ControlPanelPageProvider, + 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 1} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_Association, + 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 2} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_PhysicalSpeakers, + 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 3} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_GUID, + 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 4} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_Disable_SysFx, + 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 5} +pub const ENDPOINT_SYSFX_ENABLED: DWORD = 0x00000000; +pub const ENDPOINT_SYSFX_DISABLED: DWORD = 0x00000001; +DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_FullRangeSpeakers, + 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 6} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_Supports_EventDriven_Mode, + 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 7} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_JackSubType, + 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 8} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpoint_Default_VolumeInDb, + 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 9} +DEFINE_PROPERTYKEY!{PKEY_AudioEngine_DeviceFormat, + 0xf19f064d, 0x82c, 0x4e27, 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c, 0} +DEFINE_PROPERTYKEY!{PKEY_AudioEngine_OEMFormat, + 0xe4870e26, 0x3cc5, 0x4cd2, 0xba, 0x46, 0xca, 0xa, 0x9a, 0x70, 0xed, 0x4, 3} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpointLogo_IconEffects, + 0xf1ab780d, 0x2010, 0x4ed3, 0xa3, 0xa6, 0x8b, 0x87, 0xf0, 0xf0, 0xc4, 0x76, 0} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpointLogo_IconPath, + 0xf1ab780d, 0x2010, 0x4ed3, 0xa3, 0xa6, 0x8b, 0x87, 0xf0, 0xf0, 0xc4, 0x76, 1} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpointSettings_MenuText, + 0x14242002, 0x0320, 0x4de4, 0x95, 0x55, 0xa7, 0xd8, 0x2b, 0x73, 0xc2, 0x86, 0} +DEFINE_PROPERTYKEY!{PKEY_AudioEndpointSettings_LaunchContract, + 0x14242002, 0x0320, 0x4de4, 0x95, 0x55, 0xa7, 0xd8, 0x2b, 0x73, 0xc2, 0x86, 1} +STRUCT!{struct DIRECTX_AUDIO_ACTIVATION_PARAMS { + cbDirectXAudioActivationParams: DWORD, + guidAudioSession: GUID, + dwAudioStreamFlags: DWORD, +}} +pub type PDIRECTX_AUDIO_ACTIVATION_PARAMS = *mut DIRECTX_AUDIO_ACTIVATION_PARAMS; +ENUM!{enum EDataFlow { + eRender, + eCapture, + eAll, + EDataFlow_enum_count, +}} +ENUM!{enum ERole { + eConsole, + eMultimedia, + eCommunications, + ERole_enum_count, +}} +ENUM!{enum EndpointFormFactor { + RemoteNetworkDevice, + Speakers, + LineLevel, + Headphones, + Microphone, + Headset, + Handset, + UnknownDigitalPassthrough, + SPDIF, + DigitalAudioDisplayDevice, + UnknownFormFactor, + EndpointFormFactor_enum_count, +}} +pub const HDMI: EndpointFormFactor = DigitalAudioDisplayDevice; +DEFINE_GUID!{DEVINTERFACE_AUDIO_RENDER, + 0xe6327cad, 0xdcec, 0x4949, 0xae, 0x8a, 0x99, 0x1e, 0x97, 0x6a, 0x79, 0xd2} +DEFINE_GUID!{DEVINTERFACE_AUDIO_CAPTURE, + 0x2eef81be, 0x33fa, 0x4800, 0x96, 0x70, 0x1c, 0xd4, 0x74, 0x97, 0x2c, 0x3f} +DEFINE_GUID!{DEVINTERFACE_MIDI_OUTPUT, + 0x6dc23320, 0xab33, 0x4ce4, 0x80, 0xd4, 0xbb, 0xb3, 0xeb, 0xbf, 0x28, 0x14} +DEFINE_GUID!{DEVINTERFACE_MIDI_INPUT, + 0x504be32c, 0xccf6, 0x4d2c, 0xb7, 0x3f, 0x6f, 0x8b, 0x37, 0x47, 0xe2, 0x2b} +RIDL!{#[uuid(0x7991eec9, 0x7e89, 0x4d85, 0x83, 0x90, 0x6c, 0x70, 0x3c, 0xec, 0x60, 0xc0)] +interface IMMNotificationClient(IMMNotificationClientVtbl): IUnknown(IUnknownVtbl) { + fn OnDeviceStateChanged( + pwstrDeviceId: LPCWSTR, + dwNewState: DWORD, + ) -> HRESULT, + fn OnDeviceAdded( + pwstrDeviceId: LPCWSTR, + ) -> HRESULT, + fn OnDeviceRemoved( + pwstrDeviceId: LPCWSTR, + ) -> HRESULT, + fn OnDefaultDeviceChanged( + flow: EDataFlow, + role: ERole, + pwstrDefaultDeviceId: LPCWSTR, + ) -> HRESULT, + fn OnPropertyValueChanged( + pwstrDeviceId: LPCWSTR, + key: PROPERTYKEY, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd666063f, 0x1587, 0x4e43, 0x81, 0xf1, 0xb9, 0x48, 0xe8, 0x07, 0x36, 0x3f)] +interface IMMDevice(IMMDeviceVtbl): IUnknown(IUnknownVtbl) { + fn Activate( + iid: REFIID, + dwClsCtx: DWORD, + pActivationParams: *mut PROPVARIANT, + ppInterface: *mut LPVOID, + ) -> HRESULT, + fn OpenPropertyStore( + stgmAccess: DWORD, + ppProperties: *mut *mut IPropertyStore, + ) -> HRESULT, + fn GetId( + ppstrId: *mut LPWSTR, + ) -> HRESULT, + fn GetState( + pdwState: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0bd7a1be, 0x7a1a, 0x44db, 0x83, 0x97, 0xcc, 0x53, 0x92, 0x38, 0x7b, 0x5e)] +interface IMMDeviceCollection(IMMDeviceCollectionVtbl): IUnknown(IUnknownVtbl) { + fn GetCount( + pcDevices: *const UINT, + ) -> HRESULT, + fn Item( + nDevice: UINT, + ppDevice: *mut *mut IMMDevice, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1be09788, 0x6894, 0x4089, 0x85, 0x86, 0x9a, 0x2a, 0x6c, 0x26, 0x5a, 0xc5)] +interface IMMEndpoint(IMMEndpointVtbl): IUnknown(IUnknownVtbl) { + fn GetDataFlow( + pDataFlow: *mut EDataFlow, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa95664d2, 0x9614, 0x4f35, 0xa7, 0x46, 0xde, 0x8d, 0xb6, 0x36, 0x17, 0xe6)] +interface IMMDeviceEnumerator(IMMDeviceEnumeratorVtbl): IUnknown(IUnknownVtbl) { + fn EnumAudioEndpoints( + dataFlow: EDataFlow, + dwStateMask: DWORD, + ppDevices: *mut *mut IMMDeviceCollection, + ) -> HRESULT, + fn GetDefaultAudioEndpoint( + dataFlow: EDataFlow, + role: ERole, + ppEndpoint: *mut *mut IMMDevice, + ) -> HRESULT, + fn GetDevice( + pwstrId: LPCWSTR, + ppDevices: *mut *mut IMMDevice, + ) -> HRESULT, + fn RegisterEndpointNotificationCallback( + pClient: *mut IMMNotificationClient, + ) -> HRESULT, + fn UnregisterEndpointNotificationCallback( + pClient: *mut IMMNotificationClient, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3b0d0ea4, 0xd0a9, 0x4b0e, 0x93, 0x5b, 0x09, 0x51, 0x67, 0x46, 0xfa, 0xc0)] +interface IMMDeviceActivator(IMMDeviceActivatorVtbl): IUnknown(IUnknownVtbl) { + fn Activate( + iid: REFIID, + pDevice: *mut IMMDevice, + pActivationParams: *mut PROPVARIANT, + ppInterface: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x41d949ab, 0x9862, 0x444a, 0x80, 0xf6, 0xc2, 0x61, 0x33, 0x4d, 0xa5, 0xeb)] +interface IActivateAudioInterfaceCompletionHandler(IActivateAudioInterfaceCompletionHandlerVtbl): + IUnknown(IUnknownVtbl) { + fn ActivateCompleted( + activateOperation: *mut IActivateAudioInterfaceAsyncOperation, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x72a22d78, 0xcde4, 0x431d, 0xb8, 0xcc, 0x84, 0x3a, 0x71, 0x19, 0x9b, 0x6d)] +interface IActivateAudioInterfaceAsyncOperation(IActivateAudioInterfaceAsyncOperationVtbl): + IUnknown(IUnknownVtbl) { + fn GetActivateResult( + activateResult: *mut HRESULT, + activatedInterface: *mut *mut IUnknown, + ) -> HRESULT, +}} +extern "system" { + pub fn ActivateAudioInterfaceAsync( + deviceInterfacePath: LPCWSTR, + riid: REFIID, + activationParams: *mut PROPVARIANT, + completionHandler: *mut IActivateAudioInterfaceCompletionHandler, + activationOperation: *mut *mut IActivateAudioInterfaceAsyncOperation, + ) -> HRESULT; +} +STRUCT!{struct AudioExtensionParams { + AddPageParam: LPARAM, + pEndpoint: *mut IMMDevice, + pPnpInterface: *mut IMMDevice, + pPnpDevnode: *mut IMMDevice, +}} +DEFINE_GUID!{CLSID_MMDeviceEnumerator, + 0xBCDE0395, 0xE52F, 0x467C, 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E} +RIDL!{#[uuid(0xBCDE0395, 0xE52F, 0x467C, 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E)] +class MMDeviceEnumerator;} diff --git a/bash-5.1/vendor/winapi/src/um/mmeapi.rs b/bash-5.1/vendor/winapi/src/um/mmeapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..cc5153b3b367f1f02bc4af429a056134ce5fee33 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/mmeapi.rs @@ -0,0 +1,336 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{DWORD_PTR, UINT_PTR}; +use shared::minwindef::{DWORD, LPBYTE, LPDWORD, LPWORD, PDWORD, UINT}; +use um::imm::LPUINT; +use um::mmsystem::{ + HMIDI, HMIDIIN, HMIDIOUT, HMIDISTRM, HWAVEIN, HWAVEOUT, LPCWAVEFORMATEX, LPHMIDIIN, LPHMIDIOUT, + LPHMIDISTRM, LPHWAVEIN, LPHWAVEOUT, LPMIDIHDR, LPMIDIINCAPSW, LPMIDIOUTCAPSW, LPMMTIME, + LPWAVEHDR, LPWAVEINCAPSW, LPWAVEOUTCAPSW, MMRESULT +}; +use um::winnt::{LPWSTR, PVOID}; +extern "system" { + pub fn waveOutGetNumDevs() -> UINT; + // pub fn waveOutGetDevCapsA(); + pub fn waveOutGetDevCapsW( + uDeviceID: UINT_PTR, + pwoc: LPWAVEOUTCAPSW, + cbwoc: UINT, + ) -> MMRESULT; + pub fn waveOutGetVolume( + hwo: HWAVEOUT, + pdwVolume: LPDWORD, + ) -> MMRESULT; + pub fn waveOutSetVolume( + hwo: HWAVEOUT, + dwVolume: DWORD, + ) -> MMRESULT; + // pub fn waveOutGetErrorTextA(); + pub fn waveOutGetErrorTextW( + mmrError: MMRESULT, + pszText: LPWSTR, + cchText: UINT, + ) -> MMRESULT; + pub fn waveOutOpen( + phwo: LPHWAVEOUT, + uDeviceID: UINT, + pwfx: LPCWAVEFORMATEX, + dwCallback: DWORD_PTR, + dwInstance: DWORD_PTR, + fdwOpen: DWORD, + ) -> MMRESULT; + pub fn waveOutClose( + hwo: HWAVEOUT, + ) -> MMRESULT; + pub fn waveOutPrepareHeader( + hwo: HWAVEOUT, + pwh: LPWAVEHDR, + cbwh: UINT, + ) -> MMRESULT; + pub fn waveOutUnprepareHeader( + hwo: HWAVEOUT, + pwh: LPWAVEHDR, + cbwh: UINT, + ) -> MMRESULT; + pub fn waveOutWrite( + hwo: HWAVEOUT, + pwh: LPWAVEHDR, + cbwh: UINT, + ) -> MMRESULT; + pub fn waveOutPause( + hwo: HWAVEOUT, + ) -> MMRESULT; + pub fn waveOutRestart( + hwo: HWAVEOUT, + ) -> MMRESULT; + pub fn waveOutReset( + hwo: HWAVEOUT, + ) -> MMRESULT; + pub fn waveOutBreakLoop( + hwo: HWAVEOUT, + ) -> MMRESULT; + pub fn waveOutGetPosition( + hwo: HWAVEOUT, + pmmt: LPMMTIME, + cbmmt: UINT, + ) -> MMRESULT; + pub fn waveOutGetPitch( + hwo: HWAVEOUT, + pdwPitch: LPDWORD, + ) -> MMRESULT; + pub fn waveOutSetPitch( + hwo: HWAVEOUT, + dwPitch: DWORD, + ) -> MMRESULT; + pub fn waveOutGetPlaybackRate( + hwo: HWAVEOUT, + pdwRate: LPDWORD, + ) -> MMRESULT; + pub fn waveOutSetPlaybackRate( + hwo: HWAVEOUT, + dwRate: DWORD, + ) -> MMRESULT; + // pub fn waveOutGetID(); + pub fn waveOutMessage( + hwo: HWAVEOUT, + uMsg: UINT, + dw1: DWORD_PTR, + dw2: DWORD_PTR, + ) -> MMRESULT; + pub fn waveInGetNumDevs() -> UINT; + // pub fn waveInGetDevCapsA(); + pub fn waveInGetDevCapsW( + uDeviceID: UINT_PTR, + pwic: LPWAVEINCAPSW, + cbwic: UINT, + ) -> MMRESULT; + // pub fn waveInGetErrorTextA(); + pub fn waveInGetErrorTextW( + mmrError: MMRESULT, + pszText: LPWSTR, + cchText: UINT, + ) -> MMRESULT; + pub fn waveInOpen( + phwi: LPHWAVEIN, + uDeviceID: UINT, + pwfx: LPCWAVEFORMATEX, + dwCallback: DWORD_PTR, + dwInstance: DWORD_PTR, + fdwOpen: DWORD, + ) -> MMRESULT; + pub fn waveInClose( + hwi: HWAVEIN, + ) -> MMRESULT; + pub fn waveInPrepareHeader( + hwi: HWAVEIN, + pwh: LPWAVEHDR, + cbwh: UINT, + ) -> MMRESULT; + pub fn waveInUnprepareHeader( + hwi: HWAVEIN, + pwh: LPWAVEHDR, + cbwh: UINT, + ) -> MMRESULT; + pub fn waveInAddBuffer( + hwi: HWAVEIN, + pwh: LPWAVEHDR, + cbwh: UINT, + ) -> MMRESULT; + pub fn waveInStart( + hwi: HWAVEIN, + ) -> MMRESULT; + pub fn waveInStop( + hwi: HWAVEIN, + ) -> MMRESULT; + pub fn waveInReset( + hwi: HWAVEIN, + ) -> MMRESULT; + pub fn waveInGetPosition( + hwi: HWAVEIN, + pmmt: LPMMTIME, + cbmmt: UINT, + ) -> MMRESULT; + // pub fn waveInGetID(); + pub fn waveInMessage( + hwi: HWAVEIN, + uMsg: UINT, + dw1: DWORD_PTR, + dw2: DWORD_PTR, + ) -> MMRESULT; + pub fn midiOutGetNumDevs() -> UINT; + pub fn midiStreamOpen( + lphStream: LPHMIDISTRM, + puDeviceID: LPUINT, + cMidi: DWORD, + dwCallback: DWORD_PTR, + dwInstance: DWORD_PTR, + fdwOpen: DWORD, + ) -> MMRESULT; + pub fn midiStreamClose( + hStream: HMIDISTRM, + ) -> MMRESULT; + pub fn midiStreamProperty( + hm: HMIDISTRM, + lppropdata: LPBYTE, + dwProperty: DWORD, + ) -> MMRESULT; + pub fn midiStreamPosition( + hms: HMIDISTRM, + pmmt: LPMMTIME, + cbmmt: UINT, + ) -> MMRESULT; + pub fn midiStreamOut( + hMidiStream: HMIDISTRM, + lpMidiHdr: LPMIDIHDR, + cbMidiHdr: UINT, + ) -> MMRESULT; + pub fn midiStreamPause( + hms: HMIDISTRM, + ) -> MMRESULT; + pub fn midiStreamRestart( + hms: HMIDISTRM, + ) -> MMRESULT; + pub fn midiStreamStop( + hms: HMIDISTRM, + ) -> MMRESULT; + pub fn midiConnect( + hMidi: HMIDI, + hmo: HMIDIOUT, + pReserved: PVOID, + ) -> MMRESULT; + pub fn midiDisconnect( + hMidi: HMIDI, + hmo: HMIDIOUT, + pReserved: PVOID, + ) -> MMRESULT; + pub fn midiOutGetDevCapsW( + uDeviceID: UINT_PTR, + lpMidiOutCaps: LPMIDIOUTCAPSW, + cbMidiOutCaps: UINT, + ) -> MMRESULT; + pub fn midiOutGetVolume( + hmo: HMIDIOUT, + lpdwVolume: PDWORD, + ) -> MMRESULT; + pub fn midiOutSetVolume( + hmo: HMIDIOUT, + dwVolume: DWORD, + ) -> MMRESULT; + pub fn midiOutGetErrorTextW( + mmrError: MMRESULT, + lpText: LPWSTR, + cchText: UINT, + ) -> MMRESULT; + pub fn midiOutOpen( + lphmo: LPHMIDIOUT, + uDeviceID: UINT, + dwCallback: DWORD_PTR, + dwCallbackInstance: DWORD_PTR, + dwFlags: DWORD, + ) -> MMRESULT; + pub fn midiOutClose( + hmo: HMIDIOUT, + ) -> MMRESULT; + pub fn midiOutPrepareHeader( + hmo: HMIDIOUT, + lpMidiOutHdr: LPMIDIHDR, + cbMidiOutHdr: UINT, + ) -> MMRESULT; + pub fn midiOutUnprepareHeader( + hmo: HMIDIOUT, + lpMidiOutHdr: LPMIDIHDR, + cbMidiOutHdr: UINT, + ) -> MMRESULT; + pub fn midiOutShortMsg( + hmo: HMIDIOUT, + dwMsg: DWORD, + ) -> MMRESULT; + pub fn midiOutLongMsg( + hmo: HMIDIOUT, + lpMidiOutHdr: LPMIDIHDR, + cbMidiOutHdr: UINT, + ) -> MMRESULT; + pub fn midiOutReset( + hmo: HMIDIOUT, + ) -> MMRESULT; + pub fn midiOutCachePatches( + hmo: HMIDIOUT, + wBank: UINT, + lpPatchArray: LPWORD, + wFlags: UINT, + ) -> MMRESULT; + pub fn midiOutCacheDrumPatches( + hmo: HMIDIOUT, + wPatch: UINT, + lpKeyArray: LPWORD, + wFlags: UINT, + ) -> MMRESULT; + pub fn midiOutGetID( + hmo: HMIDIOUT, + puDeviceID: LPUINT, + ) -> MMRESULT; + pub fn midiOutMessage( + deviceID: HMIDIOUT, + msg: UINT, + dw1: DWORD_PTR, + dw2: DWORD_PTR, + ) -> MMRESULT; + pub fn midiInGetNumDevs() -> UINT; + pub fn midiInGetDevCapsW( + uDeviceID: UINT_PTR, + lpMidiInCaps: LPMIDIINCAPSW, + cbMidiInCaps: UINT, + ) -> MMRESULT; + pub fn midiInGetErrorTextW( + wError: MMRESULT, + lpText: LPWSTR, + cchText: UINT, + ) -> MMRESULT; + pub fn midiInOpen( + lphMidiIn: LPHMIDIIN, + uDeviceID: UINT, + dwCallback: DWORD_PTR, + dwCallbackInstance: DWORD_PTR, + dwFlags: DWORD, + ) -> MMRESULT; + pub fn midiInClose( + hMidiIn: HMIDIIN, + ) -> MMRESULT; + pub fn midiInPrepareHeader( + hMidiIn: HMIDIIN, + lpMidiInHdr: LPMIDIHDR, + cbMidiInHdr: UINT, + ) -> MMRESULT; + pub fn midiInUnprepareHeader( + hMidiIn: HMIDIIN, + lpMidiInHdr: LPMIDIHDR, + cbMidiInHdr: UINT, + ) -> MMRESULT; + pub fn midiInAddBuffer( + hMidiIn: HMIDIIN, + lpMidiInHdr: LPMIDIHDR, + cbMidiInHdr: UINT, + ) -> MMRESULT; + pub fn midiInStart( + hMidiIn: HMIDIIN, + ) -> MMRESULT; + pub fn midiInStop( + hMidiIn: HMIDIIN, + ) -> MMRESULT; + pub fn midiInReset( + hMidiIn: HMIDIIN, + ) -> MMRESULT; + pub fn midiInGetID( + hmi: HMIDIIN, + puDeviceID: LPUINT, + ) -> MMRESULT; + pub fn midiInMessage( + deviceID: HMIDIIN, + msg: UINT, + dw1: DWORD_PTR, + dw2: DWORD_PTR, + ) -> MMRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/mmsystem.rs b/bash-5.1/vendor/winapi/src/um/mmsystem.rs new file mode 100644 index 0000000000000000000000000000000000000000..657ba5f4e0154a6fff41cce86940d4c2cd7379b3 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/mmsystem.rs @@ -0,0 +1,266 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! MM procedure declarations, constant definitions and macros +use shared::basetsd::DWORD_PTR; +use shared::minwindef::{BYTE, DWORD, UINT, WORD}; +use shared::mmreg::WAVEFORMATEX; +use um::winnt::{LPSTR, WCHAR}; +//109 (Win 7 SDK) +pub type MMVERSION = UINT; +pub type MMRESULT = UINT; +STRUCT!{#[repr(packed)] struct MMTIME_smpte { + hour: BYTE, + min: BYTE, + sec: BYTE, + frame: BYTE, + fps: BYTE, + dummy: BYTE, + pad: [BYTE; 2], +}} +STRUCT!{#[repr(packed)] struct MMTIME_midi { + songptrpos: DWORD, +}} +UNION!{#[repr(packed)] union MMTIME_u { + [u32; 2], + ms ms_mut: DWORD, + sample sample_mut: DWORD, + cb cb_mut: DWORD, + ticks ticks_mut: DWORD, + smpte smpte_mut: MMTIME_smpte, + midi midi_mut: MMTIME_midi, +}} +STRUCT!{#[repr(packed)] struct MMTIME { + wType: UINT, + u: MMTIME_u, +}} +pub type PMMTIME = *mut MMTIME; +pub type NPMMTIME = *mut MMTIME; +pub type LPMMTIME = *mut MMTIME; +pub const TIME_MS: UINT = 0x0001; +pub const TIME_SAMPLES: UINT = 0x0002; +pub const TIME_BYTES: UINT = 0x0004; +pub const TIME_SMPTE: UINT = 0x0008; +pub const TIME_MIDI: UINT = 0x0010; +pub const TIME_TICKS: UINT = 0x0020; +pub const MM_JOY1MOVE: UINT = 0x3A0; +pub const MM_JOY2MOVE: UINT = 0x3A1; +pub const MM_JOY1ZMOVE: UINT = 0x3A2; +pub const MM_JOY2ZMOVE: UINT = 0x3A3; +pub const MM_JOY1BUTTONDOWN: UINT = 0x3B5; +pub const MM_JOY2BUTTONDOWN: UINT = 0x3B6; +pub const MM_JOY1BUTTONUP: UINT = 0x3B7; +pub const MM_JOY2BUTTONUP: UINT = 0x3B8; +pub const MM_MCINOTIFY: UINT = 0x3B9; +pub const MM_WOM_OPEN: UINT = 0x3BB; +pub const MM_WOM_CLOSE: UINT = 0x3BC; +pub const MM_WOM_DONE: UINT = 0x3BD; +pub const MM_WIM_OPEN: UINT = 0x3BE; +pub const MM_WIM_CLOSE: UINT = 0x3BF; +pub const MM_WIM_DATA: UINT = 0x3C0; +pub const MM_MIM_OPEN: UINT = 0x3C1; +pub const MM_MIM_CLOSE: UINT = 0x3C2; +pub const MM_MIM_DATA: UINT = 0x3C3; +pub const MM_MIM_LONGDATA: UINT = 0x3C4; +pub const MM_MIM_ERROR: UINT = 0x3C5; +pub const MM_MIM_LONGERROR: UINT = 0x3C6; +pub const MM_MOM_OPEN: UINT = 0x3C7; +pub const MM_MOM_CLOSE: UINT = 0x3C8; +pub const MM_MOM_DONE: UINT = 0x3C9; +pub const MMSYSERR_BASE: MMRESULT = 0; +pub const WAVERR_BASE: MMRESULT = 32; +pub const MIDIERR_BASE: MMRESULT = 64; +pub const TIMERR_BASE: MMRESULT = 96; +pub const JOYERR_BASE: MMRESULT = 160; +pub const MCIERR_BASE: MMRESULT = 256; +pub const MIXERR_BASE: MMRESULT = 1024; +pub const MMSYSERR_NOERROR: MMRESULT = 0; +pub const MMSYSERR_ERROR: MMRESULT = MMSYSERR_BASE + 1; +pub const MMSYSERR_BADDEVICEID: MMRESULT = MMSYSERR_BASE + 2; +pub const MMSYSERR_NOTENABLED: MMRESULT = MMSYSERR_BASE + 3; +pub const MMSYSERR_ALLOCATED: MMRESULT = MMSYSERR_BASE + 4; +pub const MMSYSERR_INVALHANDLE: MMRESULT = MMSYSERR_BASE + 5; +pub const MMSYSERR_NODRIVER: MMRESULT = MMSYSERR_BASE + 6; +pub const MMSYSERR_NOMEM: MMRESULT = MMSYSERR_BASE + 7; +pub const MMSYSERR_NOTSUPPORTED: MMRESULT = MMSYSERR_BASE + 8; +pub const MMSYSERR_BADERRNUM: MMRESULT = MMSYSERR_BASE + 9; +pub const MMSYSERR_INVALFLAG: MMRESULT = MMSYSERR_BASE + 10; +pub const MMSYSERR_INVALPARAM: MMRESULT = MMSYSERR_BASE + 11; +pub const MMSYSERR_HANDLEBUSY: MMRESULT = MMSYSERR_BASE + 12; +pub const MMSYSERR_INVALIDALIAS: MMRESULT = MMSYSERR_BASE + 13; +pub const MMSYSERR_BADDB: MMRESULT = MMSYSERR_BASE + 14; +pub const MMSYSERR_KEYNOTFOUND: MMRESULT = MMSYSERR_BASE + 15; +pub const MMSYSERR_READERROR: MMRESULT = MMSYSERR_BASE + 16; +pub const MMSYSERR_WRITEERROR: MMRESULT = MMSYSERR_BASE + 17; +pub const MMSYSERR_DELETEERROR: MMRESULT = MMSYSERR_BASE + 18; +pub const MMSYSERR_VALNOTFOUND: MMRESULT = MMSYSERR_BASE + 19; +pub const MMSYSERR_NODRIVERCB: MMRESULT = MMSYSERR_BASE + 20; +pub const MMSYSERR_MOREDATA: MMRESULT = MMSYSERR_BASE + 21; +pub const MMSYSERR_LASTERROR: MMRESULT = MMSYSERR_BASE + 21; +pub const MIDIERR_UNPREPARED: MMRESULT = MIDIERR_BASE + 0; +pub const MIDIERR_STILLPLAYING: MMRESULT = MIDIERR_BASE + 1; +pub const MIDIERR_NOMAP: MMRESULT = MIDIERR_BASE + 2; +pub const MIDIERR_NOTREADY: MMRESULT = MIDIERR_BASE + 3; +pub const MIDIERR_NODEVICE: MMRESULT = MIDIERR_BASE + 4; +pub const MIDIERR_INVALIDSETUP: MMRESULT = MIDIERR_BASE + 5; +pub const MIDIERR_BADOPENMODE: MMRESULT = MIDIERR_BASE + 6; +pub const MIDIERR_DONT_CONTINUE: MMRESULT = MIDIERR_BASE + 7; +pub const MIDIERR_LASTERROR: MMRESULT = MIDIERR_BASE + 7; +pub const CALLBACK_TYPEMASK: DWORD = 0x00070000; +pub const CALLBACK_NULL: DWORD = 0x00000000; +pub const CALLBACK_WINDOW: DWORD = 0x00010000; +pub const CALLBACK_TASK: DWORD = 0x00020000; +pub const CALLBACK_FUNCTION: DWORD = 0x00030000; +pub const CALLBACK_THREAD: DWORD = CALLBACK_TASK; +pub const CALLBACK_EVENT: DWORD = 0x00050000; +//497 (Win 7 SDK) +pub const WAVERR_BADFORMAT: MMRESULT = WAVERR_BASE + 0; +pub const WAVERR_STILLPLAYING: MMRESULT = WAVERR_BASE + 1; +pub const WAVERR_UNPREPARED: MMRESULT = WAVERR_BASE + 2; +pub const WAVERR_SYNC: MMRESULT = WAVERR_BASE + 3; +pub const WAVERR_LASTERROR: MMRESULT = WAVERR_BASE + 3; +DECLARE_HANDLE!{HWAVEIN, HWAVEIN__} +DECLARE_HANDLE!{HWAVEOUT, HWAVEOUT__} +pub type LPHWAVEIN = *mut HWAVEIN; +pub type LPHWAVEOUT = *mut HWAVEOUT; +pub const WOM_OPEN: UINT = MM_WOM_OPEN; +pub const WOM_CLOSE: UINT = MM_WOM_CLOSE; +pub const WOM_DONE: UINT = MM_WOM_DONE; +pub const WIM_OPEN: UINT = MM_WIM_OPEN; +pub const WIM_CLOSE: UINT = MM_WIM_CLOSE; +pub const WIM_DATA: UINT = MM_WIM_DATA; +pub const WAVE_MAPPER: UINT = 0xFFFFFFFF; +pub const WAVE_FORMAT_QUERY: DWORD = 0x0001; +pub const WAVE_ALLOWSYNC: DWORD = 0x0002; +pub const WAVE_MAPPED: DWORD = 0x0004; +pub const WAVE_FORMAT_DIRECT: DWORD = 0x0008; +pub const WAVE_FORMAT_DIRECT_QUERY: DWORD = WAVE_FORMAT_QUERY | WAVE_FORMAT_DIRECT; +pub const WAVE_MAPPED_DEFAULT_COMMUNICATION_DEVICE: DWORD = 0x0010; +STRUCT!{#[repr(packed)] struct WAVEHDR { + lpData: LPSTR, + dwBufferLength: DWORD, + dwBytesRecorded: DWORD, + dwUser: DWORD_PTR, + dwFlags: DWORD, + dwLoops: DWORD, + lpNext: *mut WAVEHDR, + reserved: DWORD_PTR, +}} +pub type PWAVEHDR = *mut WAVEHDR; +pub type NPWAVEHDR = *mut WAVEHDR; +pub type LPWAVEHDR = *mut WAVEHDR; +STRUCT!{#[repr(packed)] struct WAVEOUTCAPSW { + wMid: WORD, + wPid: WORD, + vDriverVersion: MMVERSION, + szPname: [WCHAR; 32], + dwFormats: DWORD, + wChannels: WORD, + wReserved1: WORD, + dwSupport: DWORD, +}} +pub type PWAVEOUTCAPSW = *mut WAVEOUTCAPSW; +pub type NPWAVEOUTCAPSW = *mut WAVEOUTCAPSW; +pub type LPWAVEOUTCAPSW = *mut WAVEOUTCAPSW; +STRUCT!{#[repr(packed)] struct WAVEINCAPSW { + wMid: WORD, + wPid: WORD, + vDriverVersion: MMVERSION, + szPname: [WCHAR; 32], + dwFormats: DWORD, + wChannels: WORD, + wReserved1: WORD, +}} +pub type PWAVEINCAPSW = *mut WAVEINCAPSW; +pub type NPWAVEINCAPSW = *mut WAVEINCAPSW; +pub type LPWAVEINCAPSW = *mut WAVEINCAPSW; +pub const WAVE_INVALIDFORMAT: DWORD = 0x00000000; +pub const WAVE_FORMAT_1M08: DWORD = 0x00000001; +pub const WAVE_FORMAT_1S08: DWORD = 0x00000002; +pub const WAVE_FORMAT_1M16: DWORD = 0x00000004; +pub const WAVE_FORMAT_1S16: DWORD = 0x00000008; +pub const WAVE_FORMAT_2M08: DWORD = 0x00000010; +pub const WAVE_FORMAT_2S08: DWORD = 0x00000020; +pub const WAVE_FORMAT_2M16: DWORD = 0x00000040; +pub const WAVE_FORMAT_2S16: DWORD = 0x00000080; +pub const WAVE_FORMAT_4M08: DWORD = 0x00000100; +pub const WAVE_FORMAT_4S08: DWORD = 0x00000200; +pub const WAVE_FORMAT_4M16: DWORD = 0x00000400; +pub const WAVE_FORMAT_4S16: DWORD = 0x00000800; +pub const WAVE_FORMAT_44M08: DWORD = 0x00000100; +pub const WAVE_FORMAT_44S08: DWORD = 0x00000200; +pub const WAVE_FORMAT_44M16: DWORD = 0x00000400; +pub const WAVE_FORMAT_44S16: DWORD = 0x00000800; +pub const WAVE_FORMAT_48M08: DWORD = 0x00001000; +pub const WAVE_FORMAT_48S08: DWORD = 0x00002000; +pub const WAVE_FORMAT_48M16: DWORD = 0x00004000; +pub const WAVE_FORMAT_48S16: DWORD = 0x00008000; +pub const WAVE_FORMAT_96M08: DWORD = 0x00010000; +pub const WAVE_FORMAT_96S08: DWORD = 0x00020000; +pub const WAVE_FORMAT_96M16: DWORD = 0x00040000; +pub const WAVE_FORMAT_96S16: DWORD = 0x00080000; +//782 (Win 7 SDK) +pub type PWAVEFORMATEX = *mut WAVEFORMATEX; +pub type NPWAVEFORMATEX = *mut WAVEFORMATEX; +pub type LPWAVEFORMATEX = *mut WAVEFORMATEX; +pub type LPCWAVEFORMATEX = *const WAVEFORMATEX; +//2170 (Win 7 SDK) +pub const TIMERR_NOERROR: MMRESULT = 0; +pub const TIMERR_NOCANDO: MMRESULT = TIMERR_BASE + 1; +pub const TIMERR_STRUCT: MMRESULT = TIMERR_BASE + 33; +//2198 (Win 7 SDK) +STRUCT!{#[repr(packed)] struct TIMECAPS { + wPeriodMin: UINT, + wPeriodMax: UINT, +}} +pub type PTIMECAPS = *mut TIMECAPS; +pub type NPTIMECAPS = *mut TIMECAPS; +pub type LPTIMECAPS = *mut TIMECAPS; +STRUCT!{#[repr(packed)] struct MIDIHDR { + lpData: LPSTR, + dwBufferLength: DWORD, + dwBytesRecorded: DWORD, + dwUser: DWORD_PTR, + dwFlags: DWORD, + lpNext: *mut MIDIHDR, + reserved: DWORD_PTR, + dwOffset: DWORD, + dwReserved: [DWORD_PTR; 8], +}} +pub type PMIDIHDR = *mut MIDIHDR; +pub type NPMIDIHDR = *mut MIDIHDR; +pub type LPMIDIHDR = *mut MIDIHDR; +STRUCT!{#[repr(packed)] struct MIDIINCAPSW { + wMid: WORD, + wPid: WORD, + vDriverVersion: MMVERSION, + szPname: [WCHAR; 32], + dwSupport: DWORD, +}} +pub type PMIDIINCAPSW = *mut MIDIINCAPSW; +pub type NPMIDIINCAPSW = *mut MIDIINCAPSW; +pub type LPMIDIINCAPSW = *mut MIDIINCAPSW; +STRUCT!{#[repr(packed)] struct MIDIOUTCAPSW { + wMid: WORD, + wPid: WORD, + vDriverVersion: MMVERSION, + szPname: [WCHAR; 32], + wTechnology: WORD, + wVoices: WORD, + wNotes: WORD, + wChannelMask: WORD, + dwSupport: DWORD, +}} +pub type PMIDIOUTCAPSW = *mut MIDIOUTCAPSW; +pub type NPMIDIOUTCAPSW = *mut MIDIOUTCAPSW; +pub type LPMIDIOUTCAPSW = *mut MIDIOUTCAPSW; +DECLARE_HANDLE!{HMIDIIN, HMIDIIN__} +DECLARE_HANDLE!{HMIDIOUT, HMIDIOUT__} +pub type LPHMIDIIN = *mut HMIDIIN; +pub type LPHMIDIOUT = *mut HMIDIOUT; +DECLARE_HANDLE!{HMIDISTRM, HMIDISTRM__} +DECLARE_HANDLE!{HMIDI, HMIDI__} +pub type LPHMIDISTRM = *mut HMIDISTRM; +pub type LPHMIDI = *mut HMIDI; diff --git a/bash-5.1/vendor/winapi/src/um/mod.rs b/bash-5.1/vendor/winapi/src/um/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..b7f0bca4e58b6130f2a24309733a1800eba4d603 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/mod.rs @@ -0,0 +1,302 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Headers for user mode only +pub mod gl; +#[cfg(feature = "accctrl")] pub mod accctrl; +#[cfg(feature = "aclapi")] pub mod aclapi; +#[cfg(feature = "adhoc")] pub mod adhoc; +#[cfg(feature = "appmgmt")] pub mod appmgmt; +#[cfg(feature = "audioclient")] pub mod audioclient; +#[cfg(feature = "audiosessiontypes")] pub mod audiosessiontypes; +#[cfg(feature = "avrt")] pub mod avrt; +#[cfg(feature = "bits")] pub mod bits; +#[cfg(feature = "bits10_1")] pub mod bits10_1; +#[cfg(feature = "bits1_5")] pub mod bits1_5; +#[cfg(feature = "bits2_0")] pub mod bits2_0; +#[cfg(feature = "bits2_5")] pub mod bits2_5; +#[cfg(feature = "bits3_0")] pub mod bits3_0; +#[cfg(feature = "bits4_0")] pub mod bits4_0; +#[cfg(feature = "bits5_0")] pub mod bits5_0; +#[cfg(feature = "bitscfg")] pub mod bitscfg; +#[cfg(feature = "bitsmsg")] pub mod bitsmsg; +#[cfg(feature = "bluetoothapis")] pub mod bluetoothapis; +#[cfg(feature = "bluetoothleapis")] pub mod bluetoothleapis; +#[cfg(feature = "bthledef")] pub mod bthledef; +#[cfg(feature = "cfgmgr32")] pub mod cfgmgr32; +#[cfg(feature = "cguid")] pub mod cguid; +#[cfg(feature = "combaseapi")] pub mod combaseapi; +#[cfg(feature = "coml2api")] pub mod coml2api; +#[cfg(feature = "commapi")] pub mod commapi; +#[cfg(feature = "commctrl")] pub mod commctrl; +#[cfg(feature = "commdlg")] pub mod commdlg; +#[cfg(feature = "commoncontrols")] pub mod commoncontrols; +#[cfg(feature = "consoleapi")] pub mod consoleapi; +#[cfg(feature = "corsym")] pub mod corsym; +#[cfg(feature = "d2d1")] pub mod d2d1; +#[cfg(feature = "d2d1_1")] pub mod d2d1_1; +#[cfg(feature = "d2d1_2")] pub mod d2d1_2; +#[cfg(feature = "d2d1_3")] pub mod d2d1_3; +#[cfg(feature = "d2d1effectauthor")] pub mod d2d1effectauthor; +#[cfg(feature = "d2d1effects")] pub mod d2d1effects; +#[cfg(feature = "d2d1effects_1")] pub mod d2d1effects_1; +#[cfg(feature = "d2d1effects_2")] pub mod d2d1effects_2; +#[cfg(feature = "d2d1svg")] pub mod d2d1svg; +#[cfg(feature = "d2dbasetypes")] pub mod d2dbasetypes; +#[cfg(feature = "d3d")] pub mod d3d; +#[cfg(feature = "d3d10")] pub mod d3d10; +#[cfg(feature = "d3d10_1")] pub mod d3d10_1; +#[cfg(feature = "d3d10_1shader")] pub mod d3d10_1shader; +#[cfg(feature = "d3d10effect")] pub mod d3d10effect; +#[cfg(feature = "d3d10misc")] pub mod d3d10misc; +#[cfg(feature = "d3d10sdklayers")] pub mod d3d10sdklayers; +#[cfg(feature = "d3d10shader")] pub mod d3d10shader; +#[cfg(feature = "d3d11")] pub mod d3d11; +#[cfg(feature = "d3d11_1")] pub mod d3d11_1; +#[cfg(feature = "d3d11_2")] pub mod d3d11_2; +#[cfg(feature = "d3d11_3")] pub mod d3d11_3; +#[cfg(feature = "d3d11_4")] pub mod d3d11_4; +#[cfg(feature = "d3d11on12")] pub mod d3d11on12; +#[cfg(feature = "d3d11sdklayers")] pub mod d3d11sdklayers; +#[cfg(feature = "d3d11shader")] pub mod d3d11shader; +#[cfg(feature = "d3d11tokenizedprogramformat")] pub mod d3d11tokenizedprogramformat; +#[cfg(feature = "d3d12")] pub mod d3d12; +#[cfg(feature = "d3d12sdklayers")] pub mod d3d12sdklayers; +#[cfg(feature = "d3d12shader")] pub mod d3d12shader; +#[cfg(feature = "d3dcommon")] pub mod d3dcommon; +#[cfg(feature = "d3dcompiler")] pub mod d3dcompiler; +#[cfg(feature = "d3dcsx")] pub mod d3dcsx; +#[cfg(feature = "d3dx10core")] pub mod d3dx10core; +#[cfg(feature = "d3dx10math")] pub mod d3dx10math; +#[cfg(feature = "d3dx10mesh")] pub mod d3dx10mesh; +#[cfg(feature = "datetimeapi")] pub mod datetimeapi; +#[cfg(feature = "davclnt")] pub mod davclnt; +#[cfg(feature = "dbghelp")] pub mod dbghelp; +#[cfg(feature = "dbt")] pub mod dbt; +#[cfg(feature = "dcommon")] pub mod dcommon; +#[cfg(feature = "dcomp")] pub mod dcomp; +#[cfg(feature = "dcompanimation")] pub mod dcompanimation; +#[cfg(feature = "dde")] pub mod dde; +#[cfg(feature = "ddraw")] pub mod ddraw; +#[cfg(feature = "ddrawi")] pub mod ddrawi; +#[cfg(feature = "ddrawint")] pub mod ddrawint; +#[cfg(feature = "debugapi")] pub mod debugapi; +#[cfg(feature = "devicetopology")] pub mod devicetopology; +#[cfg(feature = "dinput")] pub mod dinput; +#[cfg(feature = "dispex")] pub mod dispex; +#[cfg(feature = "dmksctl")] pub mod dmksctl; +#[cfg(feature = "dmusicc")] pub mod dmusicc; +#[cfg(feature = "docobj")] pub mod docobj; +#[cfg(feature = "documenttarget")] pub mod documenttarget; +#[cfg(feature = "dot1x")] pub mod dot1x; +#[cfg(feature = "dpa_dsa")] pub mod dpa_dsa; +#[cfg(feature = "dpapi")] pub mod dpapi; +#[cfg(feature = "dsgetdc")] pub mod dsgetdc; +#[cfg(feature = "dsound")] pub mod dsound; +#[cfg(feature = "dsrole")] pub mod dsrole; +#[cfg(feature = "dvp")] pub mod dvp; +#[cfg(feature = "dwmapi")] pub mod dwmapi; +#[cfg(feature = "dwrite")] pub mod dwrite; +#[cfg(feature = "dwrite_1")] pub mod dwrite_1; +#[cfg(feature = "dwrite_2")] pub mod dwrite_2; +#[cfg(feature = "dwrite_3")] pub mod dwrite_3; +#[cfg(feature = "dxdiag")] pub mod dxdiag; +#[cfg(feature = "dxfile")] pub mod dxfile; +#[cfg(feature = "dxgidebug")] pub mod dxgidebug; +#[cfg(feature = "dxva2api")] pub mod dxva2api; +#[cfg(feature = "dxvahd")] pub mod dxvahd; +#[cfg(feature = "eaptypes")] pub mod eaptypes; +#[cfg(feature = "enclaveapi")] pub mod enclaveapi; +#[cfg(feature = "endpointvolume")] pub mod endpointvolume; +#[cfg(feature = "errhandlingapi")] pub mod errhandlingapi; +#[cfg(feature = "evntcons")] pub mod evntcons; +#[cfg(feature = "exdisp")] pub mod exdisp; +#[cfg(feature = "fibersapi")] pub mod fibersapi; +#[cfg(feature = "fileapi")] pub mod fileapi; +#[cfg(feature = "functiondiscoverykeys_devpkey")] pub mod functiondiscoverykeys_devpkey; +#[cfg(feature = "handleapi")] pub mod handleapi; +#[cfg(feature = "heapapi")] pub mod heapapi; +#[cfg(feature = "highlevelmonitorconfigurationapi")] pub mod highlevelmonitorconfigurationapi; +#[cfg(feature = "http")] pub mod http; +#[cfg(feature = "imm")] pub mod imm; +#[cfg(feature = "interlockedapi")] pub mod interlockedapi; +#[cfg(feature = "ioapiset")] pub mod ioapiset; +#[cfg(feature = "ipexport")] pub mod ipexport; +#[cfg(feature = "iphlpapi")] pub mod iphlpapi; +#[cfg(feature = "iptypes")] pub mod iptypes; +#[cfg(feature = "jobapi")] pub mod jobapi; +#[cfg(feature = "jobapi2")] pub mod jobapi2; +#[cfg(feature = "knownfolders")] pub mod knownfolders; +#[cfg(feature = "ktmw32")] pub mod ktmw32; +#[cfg(feature = "l2cmn")] pub mod l2cmn; +#[cfg(feature = "libloaderapi")] pub mod libloaderapi; +#[cfg(feature = "lmaccess")] pub mod lmaccess; +#[cfg(feature = "lmalert")] pub mod lmalert; +#[cfg(feature = "lmapibuf")] pub mod lmapibuf; +#[cfg(feature = "lmat")] pub mod lmat; +#[cfg(feature = "lmdfs")] pub mod lmdfs; +#[cfg(feature = "lmerrlog")] pub mod lmerrlog; +#[cfg(feature = "lmjoin")] pub mod lmjoin; +#[cfg(feature = "lmmsg")] pub mod lmmsg; +#[cfg(feature = "lmremutl")] pub mod lmremutl; +#[cfg(feature = "lmrepl")] pub mod lmrepl; +#[cfg(feature = "lmserver")] pub mod lmserver; +#[cfg(feature = "lmshare")] pub mod lmshare; +#[cfg(feature = "lmstats")] pub mod lmstats; +#[cfg(feature = "lmsvc")] pub mod lmsvc; +#[cfg(feature = "lmuse")] pub mod lmuse; +#[cfg(feature = "lmwksta")] pub mod lmwksta; +#[cfg(feature = "lowlevelmonitorconfigurationapi")] pub mod lowlevelmonitorconfigurationapi; +#[cfg(feature = "lsalookup")] pub mod lsalookup; +#[cfg(feature = "memoryapi")] pub mod memoryapi; +#[cfg(feature = "minschannel")] pub mod minschannel; +#[cfg(feature = "minwinbase")] pub mod minwinbase; +#[cfg(feature = "mmdeviceapi")] pub mod mmdeviceapi; +#[cfg(feature = "mmeapi")] pub mod mmeapi; +#[cfg(feature = "mmsystem")] pub mod mmsystem; +#[cfg(feature = "msaatext")] pub mod msaatext; +#[cfg(feature = "mscat")] pub mod mscat; +#[cfg(feature = "mschapp")] pub mod mschapp; +#[cfg(feature = "mssip")] pub mod mssip; +#[cfg(feature = "mswsock")] pub mod mswsock; +#[cfg(feature = "namedpipeapi")] pub mod namedpipeapi; +#[cfg(feature = "namespaceapi")] pub mod namespaceapi; +#[cfg(feature = "nb30")] pub mod nb30; +#[cfg(feature = "ncrypt")] pub mod ncrypt; +#[cfg(feature = "ntlsa")] pub mod ntlsa; +#[cfg(feature = "ntsecapi")] pub mod ntsecapi; +#[cfg(feature = "oaidl")] pub mod oaidl; +#[cfg(feature = "objbase")] pub mod objbase; +#[cfg(feature = "objidl")] pub mod objidl; +#[cfg(feature = "objidlbase")] pub mod objidlbase; +#[cfg(feature = "ocidl")] pub mod ocidl; +#[cfg(feature = "ole2")] pub mod ole2; +#[cfg(feature = "oleauto")] pub mod oleauto; +#[cfg(feature = "olectl")] pub mod olectl; +#[cfg(feature = "oleidl")] pub mod oleidl; +#[cfg(feature = "opmapi")] pub mod opmapi; +#[cfg(feature = "pdh")] pub mod pdh; +#[cfg(feature = "perflib")] pub mod perflib; +#[cfg(feature = "physicalmonitorenumerationapi")] pub mod physicalmonitorenumerationapi; +#[cfg(feature = "playsoundapi")] pub mod playsoundapi; +#[cfg(feature = "portabledevice")] pub mod portabledevice; +#[cfg(feature = "portabledeviceapi")] pub mod portabledeviceapi; +#[cfg(feature = "portabledevicetypes")] pub mod portabledevicetypes; +#[cfg(feature = "powerbase")] pub mod powerbase; +#[cfg(feature = "powersetting")] pub mod powersetting; +#[cfg(feature = "powrprof")] pub mod powrprof; +#[cfg(feature = "processenv")] pub mod processenv; +#[cfg(feature = "processsnapshot")] pub mod processsnapshot; +#[cfg(feature = "processthreadsapi")] pub mod processthreadsapi; +#[cfg(feature = "processtopologyapi")] pub mod processtopologyapi; +#[cfg(feature = "profileapi")] pub mod profileapi; +#[cfg(feature = "propidl")] pub mod propidl; +#[cfg(feature = "propkey")] pub mod propkey; +#[cfg(feature = "propkeydef")] pub mod propkeydef; +#[cfg(feature = "propsys")] pub mod propsys; +#[cfg(feature = "prsht")] pub mod prsht; +#[cfg(feature = "psapi")] pub mod psapi; +#[cfg(feature = "realtimeapiset")] pub mod realtimeapiset; +#[cfg(feature = "reason")] pub mod reason; +#[cfg(feature = "restartmanager")] pub mod restartmanager; +#[cfg(feature = "restrictederrorinfo")] pub mod restrictederrorinfo; +#[cfg(feature = "rmxfguid")] pub mod rmxfguid; +#[cfg(feature = "rtinfo")] pub mod rtinfo; +#[cfg(feature = "sapi")] pub mod sapi; +#[cfg(feature = "sapi51")] pub mod sapi51; +#[cfg(feature = "sapi53")] pub mod sapi53; +#[cfg(feature = "sapiddk")] pub mod sapiddk; +#[cfg(feature = "sapiddk51")] pub mod sapiddk51; +#[cfg(feature = "schannel")] pub mod schannel; +#[cfg(feature = "securityappcontainer")] pub mod securityappcontainer; +#[cfg(feature = "securitybaseapi")] pub mod securitybaseapi; +#[cfg(feature = "servprov")] pub mod servprov; +#[cfg(feature = "setupapi")] pub mod setupapi; +#[cfg(feature = "shellapi")] pub mod shellapi; +#[cfg(feature = "shellscalingapi")] pub mod shellscalingapi; +#[cfg(feature = "shlobj")] pub mod shlobj; +#[cfg(feature = "shobjidl")] pub mod shobjidl; +#[cfg(feature = "shobjidl_core")] pub mod shobjidl_core; +#[cfg(feature = "shtypes")] pub mod shtypes; +#[cfg(feature = "softpub")] pub mod softpub; +#[cfg(feature = "spapidef")] pub mod spapidef; +#[cfg(feature = "spellcheck")] pub mod spellcheck; +#[cfg(feature = "sporder")] pub mod sporder; +#[cfg(feature = "sql")] pub mod sql; +#[cfg(feature = "sqlext")] pub mod sqlext; +#[cfg(feature = "sqltypes")] pub mod sqltypes; +#[cfg(feature = "sqlucode")] pub mod sqlucode; +#[cfg(feature = "sspi")] pub mod sspi; +#[cfg(feature = "stringapiset")] pub mod stringapiset; +#[cfg(feature = "strmif")] pub mod strmif; +#[cfg(feature = "subauth")] pub mod subauth; +#[cfg(feature = "synchapi")] pub mod synchapi; +#[cfg(feature = "sysinfoapi")] pub mod sysinfoapi; +#[cfg(feature = "systemtopologyapi")] pub mod systemtopologyapi; +#[cfg(feature = "taskschd")] pub mod taskschd; +#[cfg(feature = "textstor")] pub mod textstor; +#[cfg(feature = "threadpoolapiset")] pub mod threadpoolapiset; +#[cfg(feature = "threadpoollegacyapiset")] pub mod threadpoollegacyapiset; +#[cfg(feature = "timeapi")] pub mod timeapi; +#[cfg(feature = "timezoneapi")] pub mod timezoneapi; +#[cfg(feature = "tlhelp32")] pub mod tlhelp32; +#[cfg(feature = "unknwnbase")] pub mod unknwnbase; +#[cfg(feature = "urlhist")] pub mod urlhist; +#[cfg(feature = "urlmon")] pub mod urlmon; +#[cfg(feature = "userenv")] pub mod userenv; +#[cfg(feature = "usp10")] pub mod usp10; +#[cfg(feature = "utilapiset")] pub mod utilapiset; +#[cfg(feature = "uxtheme")] pub mod uxtheme; +#[cfg(feature = "vsbackup")] pub mod vsbackup; +#[cfg(feature = "vss")] pub mod vss; +#[cfg(feature = "vsserror")] pub mod vsserror; +#[cfg(feature = "vswriter")] pub mod vswriter; +#[cfg(feature = "wbemads")] pub mod wbemads; +#[cfg(feature = "wbemcli")] pub mod wbemcli; +#[cfg(feature = "wbemdisp")] pub mod wbemdisp; +#[cfg(feature = "wbemprov")] pub mod wbemprov; +#[cfg(feature = "wbemtran")] pub mod wbemtran; +#[cfg(feature = "wct")] pub mod wct; +#[cfg(feature = "werapi")] pub mod werapi; +#[cfg(feature = "winbase")] pub mod winbase; +#[cfg(feature = "wincodec")] pub mod wincodec; +#[cfg(feature = "wincodecsdk")] pub mod wincodecsdk; +#[cfg(feature = "wincon")] pub mod wincon; +#[cfg(feature = "wincontypes")] pub mod wincontypes; +#[cfg(feature = "wincred")] pub mod wincred; +#[cfg(feature = "wincrypt")] pub mod wincrypt; +#[cfg(feature = "windowsceip")] pub mod windowsceip; +#[cfg(feature = "winefs")] pub mod winefs; +#[cfg(feature = "winevt")] pub mod winevt; +#[cfg(feature = "wingdi")] pub mod wingdi; +#[cfg(feature = "winhttp")] pub mod winhttp; +#[cfg(feature = "wininet")] pub mod wininet; +#[cfg(feature = "winineti")] pub mod winineti; +#[cfg(feature = "winioctl")] pub mod winioctl; +#[cfg(feature = "winnetwk")] pub mod winnetwk; +#[cfg(feature = "winnls")] pub mod winnls; +#[cfg(feature = "winnt")] pub mod winnt; +#[cfg(feature = "winreg")] pub mod winreg; +#[cfg(feature = "winsafer")] pub mod winsafer; +#[cfg(feature = "winscard")] pub mod winscard; +#[cfg(feature = "winsmcrd")] pub mod winsmcrd; +#[cfg(feature = "winsock2")] pub mod winsock2; +#[cfg(feature = "winspool")] pub mod winspool; +#[cfg(feature = "winsvc")] pub mod winsvc; +#[cfg(feature = "wintrust")] pub mod wintrust; +#[cfg(feature = "winusb")] pub mod winusb; +#[cfg(feature = "winuser")] pub mod winuser; +#[cfg(feature = "winver")] pub mod winver; +#[cfg(feature = "wlanapi")] pub mod wlanapi; +#[cfg(feature = "wlanihv")] pub mod wlanihv; +#[cfg(feature = "wlanihvtypes")] pub mod wlanihvtypes; +#[cfg(feature = "wlclient")] pub mod wlclient; +#[cfg(feature = "wow64apiset")] pub mod wow64apiset; +#[cfg(feature = "wpdmtpextensions")] pub mod wpdmtpextensions; +#[cfg(feature = "ws2bth")] pub mod ws2bth; +#[cfg(feature = "ws2spi")] pub mod ws2spi; +#[cfg(feature = "ws2tcpip")] pub mod ws2tcpip; +#[cfg(feature = "wtsapi32")] pub mod wtsapi32; +#[cfg(feature = "xinput")] pub mod xinput; diff --git a/bash-5.1/vendor/winapi/src/um/msaatext.rs b/bash-5.1/vendor/winapi/src/um/msaatext.rs new file mode 100644 index 0000000000000000000000000000000000000000..238ca2c131d85e8adfedbec1f7a992dc1eaa896c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/msaatext.rs @@ -0,0 +1,59 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{IID_ITfMSAAControl, + 0xb5f8fb3b, 0x393f, 0x4f7c, 0x84, 0xcb, 0x50, 0x49, 0x24, 0xc2, 0x70, 0x5a} +DEFINE_GUID!{IID_IInternalDocWrap, + 0xe1aa6466, 0x9db4, 0x40ba, 0xbe, 0x03, 0x77, 0xc3, 0x8e, 0x8e, 0x60, 0xb2} +DEFINE_GUID!{IID_ITextStoreACPEx, + 0xa2de3bc2, 0x3d8e, 0x11d3, 0x81, 0xa9, 0xf7, 0x53, 0xfb, 0xe6, 0x1a, 0x00} +DEFINE_GUID!{IID_ITextStoreAnchorEx, + 0xa2de3bc1, 0x3d8e, 0x11d3, 0x81, 0xa9, 0xf7, 0x53, 0xfb, 0xe6, 0x1a, 0x00} +DEFINE_GUID!{IID_ITextStoreACPSinkEx, + 0x2bdf9464, 0x41e2, 0x43e3, 0x95, 0x0c, 0xa6, 0x86, 0x5b, 0xa2, 0x5c, 0xd4} +DEFINE_GUID!{IID_ITextStoreSinkAnchorEx, + 0x25642426, 0x028d, 0x4474, 0x97, 0x7b, 0x11, 0x1b, 0xb1, 0x14, 0xfe, 0x3e} +DEFINE_GUID!{IID_IAccDictionary, + 0x1dc4cb5f, 0xd737, 0x474d, 0xad, 0xe9, 0x5c, 0xcf, 0xc9, 0xbc, 0x1c, 0xc9} +DEFINE_GUID!{IID_IVersionInfo, + 0x401518ec, 0xdb00, 0x4611, 0x9b, 0x29, 0x2a, 0x0e, 0x4b, 0x9a, 0xfa, 0x85} +DEFINE_GUID!{IID_ICoCreateLocally, + 0x03de00aa, 0xf272, 0x41e3, 0x99, 0xcb, 0x03, 0xc5, 0xe8, 0x11, 0x4e, 0xa0} +DEFINE_GUID!{IID_ICoCreatedLocally, + 0x0a53eb6c, 0x1908, 0x4742, 0x8c, 0xff, 0x2c, 0xee, 0x2e, 0x93, 0xf9, 0x4c} +DEFINE_GUID!{IID_IAccStore, + 0xe2cd4a63, 0x2b72, 0x4d48, 0xb7, 0x39, 0x95, 0xe4, 0x76, 0x51, 0x95, 0xba} +DEFINE_GUID!{IID_IAccServerDocMgr, + 0xad7c73cf, 0x6dd5, 0x4855, 0xab, 0xc2, 0xb0, 0x4b, 0xad, 0x5b, 0x91, 0x53} +DEFINE_GUID!{IID_IAccClientDocMgr, + 0x4c896039, 0x7b6d, 0x49e6, 0xa8, 0xc1, 0x45, 0x11, 0x6a, 0x98, 0x29, 0x2b} +DEFINE_GUID!{IID_IDocWrap, + 0xdcd285fe, 0x0be0, 0x43bd, 0x99, 0xc9, 0xaa, 0xae, 0xc5, 0x13, 0xc5, 0x55} +DEFINE_GUID!{IID_IClonableWrapper, + 0xb33e75ff, 0xe84c, 0x4dca, 0xa2, 0x5c, 0x33, 0xb8, 0xdc, 0x00, 0x33, 0x74} +DEFINE_GUID!{LIBID_MSAATEXTLib, + 0x150e2d7a, 0xdac1, 0x4582, 0x94, 0x7d, 0x2a, 0x8f, 0xd7, 0x8b, 0x82, 0xcd} +DEFINE_GUID!{CLSID_MSAAControl, + 0x08cd963f, 0x7a3e, 0x4f5c, 0x9b, 0xd8, 0xd6, 0x92, 0xbb, 0x04, 0x3c, 0x5b} +DEFINE_GUID!{CLSID_AccStore, + 0x5440837f, 0x4bff, 0x4ae5, 0xa1, 0xb1, 0x77, 0x22, 0xec, 0xc6, 0x33, 0x2a} +DEFINE_GUID!{CLSID_AccDictionary, + 0x6572ee16, 0x5fe5, 0x4331, 0xbb, 0x6d, 0x76, 0xa4, 0x9c, 0x56, 0xe4, 0x23} +DEFINE_GUID!{CLSID_AccServerDocMgr, + 0x6089a37e, 0xeb8a, 0x482d, 0xbd, 0x6f, 0xf9, 0xf4, 0x69, 0x04, 0xd1, 0x6d} +DEFINE_GUID!{CLSID_AccClientDocMgr, + 0xfc48cc30, 0x4f3e, 0x4fa1, 0x80, 0x3b, 0xad, 0x0e, 0x19, 0x6a, 0x83, 0xb1} +DEFINE_GUID!{CLSID_DocWrap, + 0xbf426f7e, 0x7a5e, 0x44d6, 0x83, 0x0c, 0xa3, 0x90, 0xea, 0x94, 0x62, 0xa3} +DEFINE_GUID!{IID_ITextStoreACP, + 0x28888fe3, 0xc2a0, 0x483a, 0xa3, 0xea, 0x8c, 0xb1, 0xce, 0x51, 0xff, 0x3d} +DEFINE_GUID!{IID_ITextStoreAnchor, + 0x9b2077b0, 0x5f18, 0x4dec, 0xbe, 0xe9, 0x3c, 0xc7, 0x22, 0xf5, 0xdf, 0xe0} +DEFINE_GUID!{IID_IAnchor, + 0x0feb7e34, 0x5a60, 0x4356, 0x8e, 0xf7, 0xab, 0xde, 0xc2, 0xff, 0x7c, 0xf8} +DEFINE_GUID!{IID_ITextStoreAnchorSink, + 0xaa80e905, 0x2021, 0x11d2, 0x93, 0xe0, 0x00, 0x60, 0xb0, 0x67, 0xb8, 0x6e} +DEFINE_GUID!{IID_ITextStoreACPSink, + 0x22d44c94, 0xa419, 0x4542, 0xa2, 0x72, 0xae, 0x26, 0x09, 0x3e, 0xce, 0xcf} diff --git a/bash-5.1/vendor/winapi/src/um/mscat.rs b/bash-5.1/vendor/winapi/src/um/mscat.rs new file mode 100644 index 0000000000000000000000000000000000000000..fca635fcb8d37b19c483ecc4c5fb45fd89667b77 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/mscat.rs @@ -0,0 +1,36 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Microsoft Internet Security Catalog API Prototypes and Definitions +use shared::guiddef::GUID; +use shared::minwindef::DWORD; +use um::mssip::SIP_INDIRECT_DATA; +use um::wincrypt::{CRYPT_ATTR_BLOB, HCRYPTMSG, HCRYPTPROV}; +use um::winnt::{HANDLE, LPWSTR}; +STRUCT!{struct CRYPTCATSTORE { + cbStruct: DWORD, + dwPublicVersion: DWORD, + pwszP7File: LPWSTR, + hProv: HCRYPTPROV, + dwEncodingType: DWORD, + fdwStoreFlags: DWORD, + hReserved: HANDLE, + hAttrs: HANDLE, + hCryptMsg: HCRYPTMSG, + hSorted: HANDLE, +}} +STRUCT!{struct CRYPTCATMEMBER { + cbStruct: DWORD, + pwszReferenceTag: LPWSTR, + pwszFileName: LPWSTR, + gSubjectType: GUID, + fdwMemberFlags: DWORD, + pIndirectData: *mut SIP_INDIRECT_DATA, + dwCertVersion: DWORD, + dwReserved: DWORD, + hReserved: HANDLE, + sEncodedIndirectData: CRYPT_ATTR_BLOB, + sEncodedMemberInfo: CRYPT_ATTR_BLOB, +}} diff --git a/bash-5.1/vendor/winapi/src/um/mschapp.rs b/bash-5.1/vendor/winapi/src/um/mschapp.rs new file mode 100644 index 0000000000000000000000000000000000000000..103b54c9f8571bd8bf6e3f28a490e475c97632b4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/mschapp.rs @@ -0,0 +1,48 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::SIZE_T; +use shared::minwindef::{DWORD, UCHAR}; +use um::winnt::{BOOLEAN, CHAR, PWSTR}; +pub const CYPHER_BLOCK_LENGTH: SIZE_T = 8; +STRUCT!{struct CYPHER_BLOCK { + data: [CHAR; CYPHER_BLOCK_LENGTH], +}} +STRUCT!{struct LM_OWF_PASSWORD { + data: [CYPHER_BLOCK; 2], +}} +pub type PLM_OWF_PASSWORD = *mut LM_OWF_PASSWORD; +pub type NT_OWF_PASSWORD = LM_OWF_PASSWORD; +pub type PNT_OWF_PASSWORD = *mut NT_OWF_PASSWORD; +STRUCT!{struct SAMPR_ENCRYPTED_USER_PASSWORD { + Buffer: [UCHAR; (256 * 2) + 4], +}} +pub type PSAMPR_ENCRYPTED_USER_PASSWORD = *mut SAMPR_ENCRYPTED_USER_PASSWORD; +STRUCT!{struct ENCRYPTED_LM_OWF_PASSWORD { + data: [CYPHER_BLOCK; 2], +}} +pub type PENCRYPTED_LM_OWF_PASSWORD = *mut ENCRYPTED_LM_OWF_PASSWORD; +pub type ENCRYPTED_NT_OWF_PASSWORD = ENCRYPTED_LM_OWF_PASSWORD; +pub type PENCRYPTED_NT_OWF_PASSWORD = *mut ENCRYPTED_NT_OWF_PASSWORD; +extern "system" { + pub fn MSChapSrvChangePassword( + ServerName: PWSTR, + UserName: PWSTR, + LmOldPresent: BOOLEAN, + LmOldOwfPassword: PLM_OWF_PASSWORD, + LmNewOwfPassword: PLM_OWF_PASSWORD, + NtOldOwfPassword: PNT_OWF_PASSWORD, + NtNewOwfPassword: PNT_OWF_PASSWORD, + ) -> DWORD; + pub fn MSChapSrvChangePassword2( + ServerName: PWSTR, + UserName: PWSTR, + NewPasswordEncryptedWithOldNt: PSAMPR_ENCRYPTED_USER_PASSWORD, + OldNtOwfPasswordEncryptedWithNewNt: PENCRYPTED_NT_OWF_PASSWORD, + LmPresent: BOOLEAN, + NewPasswordEncryptedWithOldLm: PSAMPR_ENCRYPTED_USER_PASSWORD, + OldLmOwfPasswordEncryptedWithNewLmOrNt: PENCRYPTED_LM_OWF_PASSWORD, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/mssip.rs b/bash-5.1/vendor/winapi/src/um/mssip.rs new file mode 100644 index 0000000000000000000000000000000000000000..f8cd6e4079f05dd5af578fbb59d3ebeb830385b5 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/mssip.rs @@ -0,0 +1,255 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Microsoft SIP Provider Prototypes and Definitions +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, BYTE, DWORD, LPVOID}; +use um::mscat::{CRYPTCATMEMBER, CRYPTCATSTORE}; +use um::wincrypt::{ + CRYPT_ALGORITHM_IDENTIFIER, CRYPT_ATTRIBUTE_TYPE_VALUE, CRYPT_HASH_BLOB, HCRYPTPROV, +}; +use um::winnt::{HANDLE, LPCWSTR, PWSTR, WCHAR}; +pub type CRYPT_DIGEST_DATA = CRYPT_HASH_BLOB; +pub const MSSIP_FLAGS_PROHIBIT_RESIZE_ON_CREATE: DWORD = 0x00010000; +pub const MSSIP_FLAGS_USE_CATALOG: DWORD = 0x00020000; +pub const MSSIP_FLAGS_MULTI_HASH: DWORD = 0x00040000; +pub const SPC_INC_PE_RESOURCES_FLAG: DWORD = 0x80; +pub const SPC_INC_PE_DEBUG_INFO_FLAG: DWORD = 0x40; +pub const SPC_INC_PE_IMPORT_ADDR_TABLE_FLAG: DWORD = 0x20; +pub const SPC_EXC_PE_PAGE_HASHES_FLAG: DWORD = 0x10; +pub const SPC_INC_PE_PAGE_HASHES_FLAG: DWORD = 0x100; +pub const SPC_DIGEST_GENERATE_FLAG: DWORD = 0x200; +pub const SPC_DIGEST_SIGN_FLAG: DWORD = 0x400; +pub const SPC_RELAXED_PE_MARKER_CHECK: DWORD = 0x800; +pub const SPC_MARKER_CHECK_SKIP_SIP_INDIRECT_DATA_FLAG: DWORD = 0x00000001; +pub const SPC_MARKER_CHECK_CURRENTLY_SUPPORTED_FLAGS: DWORD + = SPC_MARKER_CHECK_SKIP_SIP_INDIRECT_DATA_FLAG; +pub const MSSIP_ADDINFO_NONE: DWORD = 0; +pub const MSSIP_ADDINFO_FLAT: DWORD = 1; +pub const MSSIP_ADDINFO_CATMEMBER: DWORD = 2; +pub const MSSIP_ADDINFO_BLOB: DWORD = 3; +pub const MSSIP_ADDINFO_NONMSSIP: DWORD = 500; +UNION!{union SIP_SUBJECTINFO_u { + [usize; 1], + psFlat psFlat_mut: *mut MS_ADDINFO_FLAT, + psCatMember psCatMember_mut: *mut MS_ADDINFO_CATALOGMEMBER, + psBlob psBlob_mut: *mut MS_ADDINFO_BLOB, +}} +STRUCT!{struct SIP_SUBJECTINFO { + cbSize: DWORD, + pgSubjectType: *mut GUID, + hFile: HANDLE, + pwsFileName: LPCWSTR, + pwsDisplayName: LPCWSTR, + dwReserved1: DWORD, + dwIntVersion: DWORD, + hProv: HCRYPTPROV, + DigestAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + dwFlags: DWORD, + dwEncodingType: DWORD, + dwReserved2: DWORD, + fdwCAPISettings: DWORD, + fdwSecuritySettings: DWORD, + dwIndex: DWORD, + dwUnionChoice: DWORD, + u: SIP_SUBJECTINFO_u, + pClientData: LPVOID, +}} +pub type LPSIP_SUBJECTINFO = *mut SIP_SUBJECTINFO; +STRUCT!{struct MS_ADDINFO_FLAT { + cbStruct: DWORD, + pIndirectData: *mut SIP_INDIRECT_DATA, +}} +pub type PMS_ADDINFO_FLAT = *mut MS_ADDINFO_FLAT; +STRUCT!{struct MS_ADDINFO_CATALOGMEMBER { + cbStruct: DWORD, + pStore: *mut CRYPTCATSTORE, + pMember: *mut CRYPTCATMEMBER, +}} +pub type PMS_ADDINFO_CATALOGMEMBER = *mut MS_ADDINFO_CATALOGMEMBER; +STRUCT!{struct MS_ADDINFO_BLOB { + cbStruct: DWORD, + cbMemObject: DWORD, + pbMemObject: *mut BYTE, + cbMemSignedMsg: DWORD, + pbMemSignedMsg: *mut BYTE, +}} +pub type PMS_ADDINFO_BLOB = *mut MS_ADDINFO_BLOB; +STRUCT!{struct SIP_CAP_SET_V2 { + cbSize: DWORD, + dwVersion: DWORD, + isMultiSign: BOOL, + dwReserved: DWORD, +}} +pub type PSIP_CAP_SET_V2 = *mut SIP_CAP_SET_V2; +UNION!{union SIP_CAP_SET_V3_u { + [u32; 1], + dwFlags dwFlags_mut: DWORD, + dwReserved dwReserved_mut: DWORD, +}} +STRUCT!{struct SIP_CAP_SET_V3 { + cbSize: DWORD, + dwVersion: DWORD, + isMultiSign: BOOL, + u: SIP_CAP_SET_V3_u, +}} +pub type PSIP_CAP_SET_V3 = *mut SIP_CAP_SET_V3; +pub type SIP_CAP_SET = SIP_CAP_SET_V3; +pub type PSIP_CAP_SET = PSIP_CAP_SET_V3; +pub const SIP_CAP_SET_VERSION_2: DWORD = 2; +pub const SIP_CAP_SET_VERSION_3: DWORD = 3; +pub const SIP_CAP_SET_CUR_VER: DWORD = 3; +pub const SIP_CAP_FLAG_SEALING: DWORD = 0x00000001; +STRUCT!{struct SIP_INDIRECT_DATA { + Data: CRYPT_ATTRIBUTE_TYPE_VALUE, + DigestAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + Digest: CRYPT_HASH_BLOB, +}} +pub type PSIP_INDIRECT_DATA = *mut SIP_INDIRECT_DATA; +extern "system" { + pub fn CryptSIPGetSignedDataMsg( + pSubjectInfo: *mut SIP_SUBJECTINFO, + pdwEncodingType: *mut DWORD, + dwIndex: DWORD, + pcbSignedDataMsg: *mut DWORD, + pbSignedDataMsg: *mut BYTE, + ) -> BOOL; +} +FN!{stdcall pCryptSIPGetSignedDataMsg( + pSubjectInfo: *mut SIP_SUBJECTINFO, + pdwEncodingType: *mut DWORD, + dwIndex: DWORD, + pcbSignedDataMsg: *mut DWORD, + pbSignedDataMsg: *mut BYTE, +) -> BOOL} +extern "system" { + pub fn CryptSIPPutSignedDataMsg( + pSubjectInfo: *mut SIP_SUBJECTINFO, + dwEncodingType: DWORD, + pdwIndex: *mut DWORD, + cbSignedDataMsg: DWORD, + pbSignedDataMsg: *mut BYTE, + ) -> BOOL; +} +FN!{stdcall pCryptSIPPutSignedDataMsg( + pSubjectInfo: *mut SIP_SUBJECTINFO, + dwEncodingType: DWORD, + pdwIndex: *mut DWORD, + cbSignedDataMsg: DWORD, + pbSignedDataMsg: *mut BYTE, +) -> BOOL} +extern "system" { + pub fn CryptSIPCreateIndirectData( + pSubjectInfo: *mut SIP_SUBJECTINFO, + pcbIndirectData: *mut DWORD, + pIndirectData: *mut SIP_INDIRECT_DATA, + ) -> BOOL; +} +FN!{stdcall pCryptSIPCreateIndirectData( + pSubjectInfo: *mut SIP_SUBJECTINFO, + pcbIndirectData: *mut DWORD, + pIndirectData: *mut SIP_INDIRECT_DATA, +) -> BOOL} +extern "system" { + pub fn CryptSIPVerifyIndirectData( + pSubjectInfo: *mut SIP_SUBJECTINFO, + pIndirectData: *mut SIP_INDIRECT_DATA, + ) -> BOOL; +} +FN!{stdcall pCryptSIPVerifyIndirectData( + pSubjectInfo: *mut SIP_SUBJECTINFO, + pIndirectData: *mut SIP_INDIRECT_DATA, +) -> BOOL} +extern "system" { + pub fn CryptSIPRemoveSignedDataMsg( + pSubjectInfo: *mut SIP_SUBJECTINFO, + dwIndex: DWORD, + ) -> BOOL; +} +FN!{stdcall pCryptSIPRemoveSignedDataMsg( + pSubjectInfo: *mut SIP_SUBJECTINFO, + dwIndex: DWORD, +) -> BOOL} +STRUCT!{struct SIP_DISPATCH_INFO { + cbSize: DWORD, + hSIP: HANDLE, + pfGet: pCryptSIPGetSignedDataMsg, + pfPut: pCryptSIPPutSignedDataMsg, + pfCreate: pCryptSIPCreateIndirectData, + pfVerify: pCryptSIPVerifyIndirectData, + pfRemove: pCryptSIPRemoveSignedDataMsg, +}} +pub type LPSIP_DISPATCH_INFO = *mut SIP_DISPATCH_INFO; +FN!{stdcall pfnIsFileSupported( + hFile: HANDLE, + pgSubject: *mut GUID, +) -> BOOL} +FN!{stdcall pfnIsFileSupportedName( + pwszFileName: *mut WCHAR, + pgSubject: *mut GUID, +) -> BOOL} +STRUCT!{struct SIP_ADD_NEWPROVIDER { + cbStruct: DWORD, + pgSubject: *mut GUID, + pwszDLLFileName: *mut WCHAR, + pwszMagicNumber: *mut WCHAR, + pwszIsFunctionName: *mut WCHAR, + pwszGetFuncName: *mut WCHAR, + pwszPutFuncName: *mut WCHAR, + pwszCreateFuncName: *mut WCHAR, + pwszVerifyFuncName: *mut WCHAR, + pwszRemoveFuncName: *mut WCHAR, + pwszIsFunctionNameFmt2: *mut WCHAR, + pwszGetCapFuncName: PWSTR, +}} +pub type PSIP_ADD_NEWPROVIDER = *mut SIP_ADD_NEWPROVIDER; +pub const SIP_MAX_MAGIC_NUMBER: DWORD = 4; +extern "system" { + pub fn CryptSIPLoad( + pgSubject: *const GUID, + dwFlags: DWORD, + pSipDispatch: *mut SIP_DISPATCH_INFO, + ) -> BOOL; + pub fn CryptSIPRetrieveSubjectGuid( + FileName: LPCWSTR, + hFileIn: HANDLE, + pgSubject: *mut GUID, + ) -> BOOL; + pub fn CryptSIPRetrieveSubjectGuidForCatalogFile( + FileName: LPCWSTR, + hFileIn: HANDLE, + pgSubject: *mut GUID, + ) -> BOOL; + pub fn CryptSIPAddProvider( + psNewProv: *mut SIP_ADD_NEWPROVIDER, + ) -> BOOL; + pub fn CryptSIPRemoveProvider( + pgProv: *mut GUID, + ) -> BOOL; + pub fn CryptSIPGetCaps( + pSubjInfo: *mut SIP_SUBJECTINFO, + pCaps: *mut SIP_CAP_SET, + ) -> BOOL; +} +FN!{stdcall pCryptSIPGetCaps( + pSubjInfo: *mut SIP_SUBJECTINFO, + pCaps: *mut SIP_CAP_SET, +) -> BOOL} +extern "system" { + pub fn CryptSIPGetSealedDigest( + pSubjectInfo: *mut SIP_SUBJECTINFO, + pSig: *const BYTE, + dwSig: DWORD, + pbDigest: *mut BYTE, + pcbDigest: *mut DWORD, + ) -> BOOL; +} +FN!{stdcall pCryptSIPGetSealedDigest( + pSubjectInfo: *mut SIP_SUBJECTINFO, + pSig: *const BYTE, + dwSig: DWORD, + pbDigest: *mut BYTE, + pcbDigest: *mut DWORD, +) -> BOOL} diff --git a/bash-5.1/vendor/winapi/src/um/mswsock.rs b/bash-5.1/vendor/winapi/src/um/mswsock.rs new file mode 100644 index 0000000000000000000000000000000000000000..cbbe191359db33d23c58558d8affb58f6f9540c0 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/mswsock.rs @@ -0,0 +1,413 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_char, c_int}; +use shared::minwindef::{BOOL, DWORD, INT, LPDWORD, LPINT, LPVOID, ULONG}; +use shared::mswsockdef::{PRIORESULT, PRIO_BUF, RIO_BUFFERID, RIO_CQ, RIO_RQ}; +use shared::ws2def::{IOC_VENDOR, IOC_WS2, LPWSAMSG, SOCKADDR}; +use um::minwinbase::LPOVERLAPPED; +use um::winnt::{CHAR, HANDLE, LARGE_INTEGER, PCHAR, PVOID, WCHAR}; +use um::winsock2::{ + LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE, LPWSAPOLLFD, SOCKET, WSAESETSERVICEOP, + WSAPOLLFD, +}; +pub const SO_CONNDATA: c_int = 0x7000; +pub const SO_CONNOPT: c_int = 0x7001; +pub const SO_DISCDATA: c_int = 0x7002; +pub const SO_DISCOPT: c_int = 0x7003; +pub const SO_CONNDATALEN: c_int = 0x7004; +pub const SO_CONNOPTLEN: c_int = 0x7005; +pub const SO_DISCDATALEN: c_int = 0x7006; +pub const SO_DISCOPTLEN: c_int = 0x7007; +pub const SO_OPENTYPE: c_int = 0x7008; +pub const SO_SYNCHRONOUS_ALERT: DWORD = 0x10; +pub const SO_SYNCHRONOUS_NONALERT: DWORD = 0x20; +pub const SO_MAXDG: c_int = 0x7009; +pub const SO_MAXPATHDG: c_int = 0x700A; +pub const SO_UPDATE_ACCEPT_CONTEXT: c_int = 0x700B; +pub const SO_CONNECT_TIME: c_int = 0x700C; +pub const SO_UPDATE_CONNECT_CONTEXT: c_int = 0x7010; +pub const TCP_BSDURGENT: c_int = 0x7000; +pub const SIO_UDP_CONNRESET: DWORD = _WSAIOW!(IOC_VENDOR, 12); +pub const SIO_SOCKET_CLOSE_NOTIFY: DWORD = _WSAIOW!(IOC_VENDOR, 13); +pub const SIO_UDP_NETRESET: DWORD = _WSAIOW!(IOC_VENDOR, 15); +extern "system" { + pub fn WSARecvEx( + s: SOCKET, + buf: *mut c_char, + len: c_int, + flags: *mut c_int, + ) -> c_int; +} +STRUCT!{struct TRANSMIT_FILE_BUFFERS { + Head: LPVOID, + HeadLength: DWORD, + Tail: LPVOID, + TailLength: DWORD, +}} +pub type PTRANSMIT_FILE_BUFFERS = *mut TRANSMIT_FILE_BUFFERS; +pub type LPTRANSMIT_FILE_BUFFERS = *mut TRANSMIT_FILE_BUFFERS; +pub const TF_DISCONNECT: DWORD = 0x01; +pub const TF_REUSE_SOCKET: DWORD = 0x02; +pub const TF_WRITE_BEHIND: DWORD = 0x04; +pub const TF_USE_DEFAULT_WORKER: DWORD = 0x00; +pub const TF_USE_SYSTEM_THREAD: DWORD = 0x10; +pub const TF_USE_KERNEL_APC: DWORD = 0x20; +extern "system" { + pub fn TransmitFile( + hSocket: SOCKET, + hFile: HANDLE, + nNumberOfBytesToWrite: DWORD, + nNumberOfBytesPerSend: DWORD, + lpOverlapped: LPOVERLAPPED, + lpTransmitBuffers: LPTRANSMIT_FILE_BUFFERS, + dwReserved: DWORD, + ) -> BOOL; + pub fn AcceptEx( + sListenSocket: SOCKET, + sAcceptSocket: SOCKET, + lpOutputBuffer: PVOID, + dwReceiveDataLength: DWORD, + dwLocalAddressLength: DWORD, + dwRemoteAddressLength: DWORD, + lpdwBytesReceived: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn GetAcceptExSockaddrs( + lpOutputBuffer: PVOID, + dwReceiveDataLength: DWORD, + dwLocalAddressLength: DWORD, + dwRemoteAddressLength: DWORD, + LocalSockaddr: *mut *mut SOCKADDR, + LocalSockaddrLength: LPINT, + RemoteSockaddr: *mut *mut SOCKADDR, + RemoteSockaddrLength: LPINT, + ); +} +FN!{stdcall LPFN_TRANSMITFILE( + hSocket: SOCKET, + hFile: HANDLE, + nNumberOfBytesToWrite: DWORD, + nNumberOfBytesPerSend: DWORD, + lpOverlapped: LPOVERLAPPED, + lpTransmitBuffers: LPTRANSMIT_FILE_BUFFERS, + dwReserved: DWORD, +) -> BOOL} +DEFINE_GUID!{WSAID_TRANSMITFILE, + 0xb5367df0, 0xcbac, 0x11cf, 0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92} +FN!{stdcall LPFN_ACCEPTEX( + sListenSocket: SOCKET, + sAcceptSocket: SOCKET, + lpOutputBuffer: PVOID, + dwReceiveDataLength: DWORD, + dwLocalAddressLength: DWORD, + dwRemoteAddressLength: DWORD, + lpdwBytesReceived: LPDWORD, + lpOverlapped: LPOVERLAPPED, +) -> BOOL} +DEFINE_GUID!{WSAID_ACCEPTEX, + 0xb5367df1, 0xcbac, 0x11cf, 0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92} +FN!{stdcall LPFN_GETACCEPTEXSOCKADDRS( + lpOutputBuffer: PVOID, + dwReceiveDataLength: DWORD, + dwLocalAddressLength: DWORD, + dwRemoteAddressLength: DWORD, + LocalSockaddr: *mut *mut SOCKADDR, + LocalSockaddrLength: LPINT, + RemoteSockaddr: *mut *mut SOCKADDR, + RemoteSockaddrLength: LPINT, +) -> ()} +DEFINE_GUID!{WSAID_GETACCEPTEXSOCKADDRS, + 0xb5367df2, 0xcbac, 0x11cf, 0x95, 0xca, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92} +pub const TP_ELEMENT_MEMORY: ULONG = 1; +pub const TP_ELEMENT_FILE: ULONG = 2; +pub const TP_ELEMENT_EOP: ULONG = 4; +STRUCT!{struct TRANSMIT_PACKETS_ELEMENT_u_s { + nFileOffset: LARGE_INTEGER, + hFile: HANDLE, +}} +UNION!{union TRANSMIT_PACKETS_ELEMENT_u { + [u64; 2], + s s_mut: TRANSMIT_PACKETS_ELEMENT_u_s, + pBuffer pBuffer_mut: PVOID, +}} +STRUCT!{struct TRANSMIT_PACKETS_ELEMENT { + dwElFlags: ULONG, + cLength: ULONG, + u: TRANSMIT_PACKETS_ELEMENT_u, +}} +pub type PTRANSMIT_PACKETS_ELEMENT = *mut TRANSMIT_PACKETS_ELEMENT; +pub type LPTRANSMIT_PACKETS_ELEMENT = *mut TRANSMIT_PACKETS_ELEMENT; +pub const TP_DISCONNECT: DWORD = TF_DISCONNECT; +pub const TP_REUSE_SOCKET: DWORD = TF_REUSE_SOCKET; +pub const TP_USE_DEFAULT_WORKER: DWORD = TF_USE_DEFAULT_WORKER; +pub const TP_USE_SYSTEM_THREAD: DWORD = TF_USE_SYSTEM_THREAD; +pub const TP_USE_KERNEL_APC: DWORD = TF_USE_KERNEL_APC; +FN!{stdcall LPFN_TRANSMITPACKETS( + hSocket: SOCKET, + lpPacketArray: LPTRANSMIT_PACKETS_ELEMENT, + nElementCount: DWORD, + nSendSize: DWORD, + lpOverlapped: LPOVERLAPPED, + dwFlags: DWORD, +) -> BOOL} +DEFINE_GUID!{WSAID_TRANSMITPACKETS, + 0xd9689da0, 0x1f90, 0x11d3, 0x99, 0x71, 0x00, 0xc0, 0x4f, 0x68, 0xc8, 0x76} +FN!{stdcall LPFN_CONNECTEX( + s: SOCKET, + name: *const SOCKADDR, + namelen: c_int, + lpSendBuffer: PVOID, + dwSendDataLength: DWORD, + lpdwBytesSent: LPDWORD, + lpOverlapped: LPOVERLAPPED, +) -> BOOL} +DEFINE_GUID!{WSAID_CONNECTEX, + 0x25a207b9, 0xddf3, 0x4660, 0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e} +FN!{stdcall LPFN_DISCONNECTEX( + s: SOCKET, + lpOverlapped: LPOVERLAPPED, + dwFlags: DWORD, + dwReserved: DWORD, +) -> BOOL} +DEFINE_GUID!{WSAID_DISCONNECTEX, + 0x7fda2e11, 0x8630, 0x436f, 0xa0, 0x31, 0xf5, 0x36, 0xa6, 0xee, 0xc1, 0x57} +pub const DE_REUSE_SOCKET: DWORD = TF_REUSE_SOCKET; +DEFINE_GUID!{NLA_NAMESPACE_GUID, + 0x6642243a, 0x3ba8, 0x4aa6, 0xba, 0xa5, 0x2e, 0xb, 0xd7, 0x1f, 0xdd, 0x83} +DEFINE_GUID!{NLA_SERVICE_CLASS_GUID, + 0x37e515, 0xb5c9, 0x4a43, 0xba, 0xda, 0x8b, 0x48, 0xa8, 0x7a, 0xd2, 0x39} +pub const NLA_ALLUSERS_NETWORK: WSAESETSERVICEOP = 0x00000001; +pub const NLA_FRIENDLY_NAME: WSAESETSERVICEOP = 0x00000002; +ENUM!{enum NLA_BLOB_DATA_TYPE { + NLA_RAW_DATA = 0, + NLA_INTERFACE = 1, + NLA_802_1X_LOCATION = 2, + NLA_CONNECTIVITY = 3, + NLA_ICS = 4, +}} +pub type PNLA_BLOB_DATA_TYPE = *mut NLA_BLOB_DATA_TYPE; +ENUM!{enum NLA_CONNECTIVITY_TYPE { + NLA_NETWORK_AD_HOC = 0, + NLA_NETWORK_MANAGED = 1, + NLA_NETWORK_UNMANAGED = 2, + NLA_NETWORK_UNKNOWN = 3, +}} +pub type PNLA_CONNECTIVITY_TYPE = *mut NLA_CONNECTIVITY_TYPE; +ENUM!{enum NLA_INTERNET { + NLA_INTERNET_UNKNOWN = 0, + NLA_INTERNET_NO = 1, + NLA_INTERNET_YES = 2, +}} +pub type PNLA_INTERNET = *mut NLA_INTERNET; +STRUCT!{struct NLA_BLOB_s { + type_: NLA_BLOB_DATA_TYPE, + dwSize: DWORD, + nextOffset: DWORD, +}} +STRUCT!{struct NLA_BLOB_u_s1 { + dwType: DWORD, + dwSpeed: DWORD, + adapterName: [CHAR; 1], +}} +STRUCT!{struct NLA_BLOB_u_s2 { + information: [CHAR; 1], +}} +STRUCT!{struct NLA_BLOB_u_s3 { + type_: NLA_CONNECTIVITY_TYPE, + internet: NLA_INTERNET, +}} +STRUCT!{struct NLA_BLOB_u_s4_s { + speed: DWORD, + type_: DWORD, + state: DWORD, + machineName: [WCHAR; 256], + sharedAdapterName: [WCHAR; 256], +}} +STRUCT!{struct NLA_BLOB_u_s4 { + remote: NLA_BLOB_u_s4_s, +}} +UNION!{union NLA_BLOB_u { + [u32; 259], + rawData rawData_mut: [CHAR; 1], + interfaceData interfaceData_mut: NLA_BLOB_u_s1, + locationData locationData_mut: NLA_BLOB_u_s2, + connectivity connectivity_mut: NLA_BLOB_u_s3, + ICS ICS_mut: NLA_BLOB_u_s4, +}} +STRUCT!{struct NLA_BLOB { + header: NLA_BLOB_s, + data: NLA_BLOB_u, +}} +pub type PNLA_BLOB = *mut NLA_BLOB; +pub type LPNLA_BLOB = *mut NLA_BLOB; +FN!{stdcall LPFN_WSARECVMSG( + s: SOCKET, + lpMsg: LPWSAMSG, + lpdwNumberOfBytesRecvd: LPDWORD, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, +) -> INT} +DEFINE_GUID!{WSAID_WSARECVMSG, + 0xf689d7c8, 0x6f1f, 0x436b, 0x8a, 0x53, 0xe5, 0x4f, 0xe3, 0x51, 0xc3, 0x22} +pub const SIO_BSP_HANDLE: DWORD = _WSAIOR!(IOC_WS2, 27); +pub const SIO_BSP_HANDLE_SELECT: DWORD = _WSAIOR!(IOC_WS2, 28); +pub const SIO_BSP_HANDLE_POLL: DWORD = _WSAIOR!(IOC_WS2, 29); +pub const SIO_BASE_HANDLE: DWORD = _WSAIOR!(IOC_WS2, 34); +pub const SIO_EXT_SELECT: DWORD = _WSAIORW!(IOC_WS2, 30); +pub const SIO_EXT_POLL: DWORD = _WSAIORW!(IOC_WS2, 31); +pub const SIO_EXT_SENDMSG: DWORD = _WSAIORW!(IOC_WS2, 32); +STRUCT!{struct WSAPOLLDATA { + result: c_int, + fds: ULONG, + timeout: INT, + fdArray: *mut WSAPOLLFD, +}} +pub type LPWSAPOLLDATA = *mut WSAPOLLDATA; +STRUCT!{struct WSASENDMSG { + lpMsg: LPWSAMSG, + dwFlags: DWORD, + lpNumberOfBytesSent: LPDWORD, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, +}} +pub type LPWSASENDMSG = *mut WSASENDMSG; +FN!{stdcall LPFN_WSASENDMSG( + s: SOCKET, + lpMsg: LPWSAMSG, + dwFlags: DWORD, + lpNumberOfBytesSent: LPDWORD, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, +) -> INT} +DEFINE_GUID!{WSAID_WSASENDMSG, + 0xa441e712, 0x754f, 0x43ca, 0x84, 0xa7, 0x0d, 0xee, 0x44, 0xcf, 0x60, 0x6d} +FN!{stdcall LPFN_WSAPOLL( + fdarray: LPWSAPOLLFD, + nfds: ULONG, + timeout: INT, +) -> INT} +DEFINE_GUID!{WSAID_WSAPOLL, + 0x18C76F85, 0xDC66, 0x4964, 0x97, 0x2E, 0x23, 0xC2, 0x72, 0x38, 0x31, 0x2B} +FN!{stdcall LPFN_RIORECEIVE( + SocketQueue: RIO_RQ, + pData: PRIO_BUF, + DataBufferCount: ULONG, + Flags: DWORD, + RequestContext: PVOID, +) -> BOOL} +FN!{stdcall LPFN_RIORECEIVEEX( + SocketQueue: RIO_RQ, + pData: PRIO_BUF, + DataBufferCount: ULONG, + pLocalAddress: PRIO_BUF, + pRemoteAddress: PRIO_BUF, + pControlContext: PRIO_BUF, + pFlags: PRIO_BUF, + Flags: DWORD, + RequestContext: PVOID, +) -> c_int} +FN!{stdcall LPFN_RIOSEND( + SocketQueue: RIO_RQ, + pData: PRIO_BUF, + DataBufferCount: ULONG, + Flags: DWORD, + RequestContext: PVOID, +) -> BOOL} +FN!{stdcall LPFN_RIOSENDEX( + SocketQueue: RIO_RQ, + pData: PRIO_BUF, + DataBufferCount: ULONG, + pLocalAddress: PRIO_BUF, + pRemoteAddress: PRIO_BUF, + pControlContext: PRIO_BUF, + pFlags: PRIO_BUF, + Flags: DWORD, + RequestContext: PVOID, +) -> BOOL} +FN!{stdcall LPFN_RIOCLOSECOMPLETIONQUEUE( + CQ: RIO_CQ, +) -> ()} +ENUM!{enum RIO_NOTIFICATION_COMPLETION_TYPE { + RIO_EVENT_COMPLETION = 1, + RIO_IOCP_COMPLETION = 2, +}} +pub type PRIO_NOTIFICATION_COMPLETION_TYPE = *mut RIO_NOTIFICATION_COMPLETION_TYPE; +STRUCT!{struct RIO_NOTIFICATION_COMPLETION_u_s1 { + EventHandle: HANDLE, + NotifyReset: BOOL, +}} +STRUCT!{struct RIO_NOTIFICATION_COMPLETION_u_s2 { + IocpHandle: HANDLE, + CompletionKey: PVOID, + Overlapped: PVOID, +}} +UNION!{union RIO_NOTIFICATION_COMPLETION_u { + [u32; 3] [u64; 3], + Event Event_mut: RIO_NOTIFICATION_COMPLETION_u_s1, + Iocp Iocp_mut: RIO_NOTIFICATION_COMPLETION_u_s2, +}} +STRUCT!{struct RIO_NOTIFICATION_COMPLETION { + Type: RIO_NOTIFICATION_COMPLETION_TYPE, + u: RIO_NOTIFICATION_COMPLETION_u, +}} +pub type PRIO_NOTIFICATION_COMPLETION = *mut RIO_NOTIFICATION_COMPLETION; +FN!{stdcall LPFN_RIOCREATECOMPLETIONQUEUE( + QueueSize: DWORD, + NotificationCompletion: PRIO_NOTIFICATION_COMPLETION, +) -> RIO_CQ} +FN!{stdcall LPFN_RIOCREATEREQUESTQUEUE( + Socket: SOCKET, + MaxOutstandingReceive: ULONG, + MaxReceiveDataBuffers: ULONG, + MaxOutstandingSend: ULONG, + MaxSendDataBuffers: ULONG, + ReceiveCQ: RIO_CQ, + SendCQ: RIO_CQ, + SocketContext: PVOID, +) -> RIO_RQ} +FN!{stdcall LPFN_RIODEQUEUECOMPLETION( + CQ: RIO_CQ, + Array: PRIORESULT, + ArraySize: ULONG, +) -> ULONG} +FN!{stdcall LPFN_RIODEREGISTERBUFFER( + BufferId: RIO_BUFFERID, +) -> ()} +FN!{stdcall LPFN_RIONOTIFY( + CQ: RIO_CQ, +) -> INT} +FN!{stdcall LPFN_RIOREGISTERBUFFER( + DataBuffer: PCHAR, + DataLength: DWORD, +) -> RIO_BUFFERID} +FN!{stdcall LPFN_RIORESIZECOMPLETIONQUEUE( + CQ: RIO_CQ, + QueueSize: DWORD, +) -> BOOL} +FN!{stdcall LPFN_RIORESIZEREQUESTQUEUE( + RQ: RIO_RQ, + MaxOutstandingReceive: DWORD, + MaxOutstandingSend: DWORD, +) -> BOOL} +STRUCT!{struct RIO_EXTENSION_FUNCTION_TABLE { + cbSize: DWORD, + RIOReceive: LPFN_RIORECEIVE, + RIOReceiveEx: LPFN_RIORECEIVEEX, + RIOSend: LPFN_RIOSEND, + RIOSendEx: LPFN_RIOSENDEX, + RIOCloseCompletionQueue: LPFN_RIOCLOSECOMPLETIONQUEUE, + RIOCreateCompletionQueue: LPFN_RIOCREATECOMPLETIONQUEUE, + RIOCreateRequestQueue: LPFN_RIOCREATEREQUESTQUEUE, + RIODequeueCompletion: LPFN_RIODEQUEUECOMPLETION, + RIODeregisterBuffer: LPFN_RIODEREGISTERBUFFER, + RIONotify: LPFN_RIONOTIFY, + RIORegisterBuffer: LPFN_RIOREGISTERBUFFER, + RIOResizeCompletionQueue: LPFN_RIORESIZECOMPLETIONQUEUE, + RIOResizeRequestQueue: LPFN_RIORESIZEREQUESTQUEUE, +}} +pub type PRIO_EXTENSION_FUNCTION_TABLE = *mut RIO_EXTENSION_FUNCTION_TABLE; +DEFINE_GUID!{WSAID_MULTIPLE_RIO, + 0x8509e081, 0x96dd, 0x4005, 0xb1, 0x65, 0x9e, 0x2e, 0xe8, 0xc7, 0x9e, 0x3f} diff --git a/bash-5.1/vendor/winapi/src/um/namedpipeapi.rs b/bash-5.1/vendor/winapi/src/um/namedpipeapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..7c7447f1edddf3fa9b3deed0f878b3dad429dbe8 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/namedpipeapi.rs @@ -0,0 +1,93 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, ULONG}; +use um::minwinbase::{LPOVERLAPPED, LPSECURITY_ATTRIBUTES}; +use um::winnt::{HANDLE, LPCWSTR, LPWSTR, PHANDLE}; +extern "system" { + pub fn CreatePipe( + hReadPipe: PHANDLE, + hWritePipe: PHANDLE, + lpPipeAttributes: LPSECURITY_ATTRIBUTES, + nSize: DWORD, + ) -> BOOL; + pub fn ConnectNamedPipe( + hNamedPipe: HANDLE, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn DisconnectNamedPipe( + hNamedPipe: HANDLE, + ) -> BOOL; + pub fn SetNamedPipeHandleState( + hNamedPipe: HANDLE, + lpMode: LPDWORD, + lpMaxCollectionCount: LPDWORD, + lpCollectDataTimeout: LPDWORD, + ) -> BOOL; + pub fn PeekNamedPipe( + hNamedPipe: HANDLE, + lpBuffer: LPVOID, + nBufferSize: DWORD, + lpBytesRead: LPDWORD, + lpTotalBytesAvail: LPDWORD, + lpBytesLeftThisMessage: LPDWORD, + ) -> BOOL; + pub fn TransactNamedPipe( + hNamedPipe: HANDLE, + lpInBuffer: LPVOID, + nInBufferSize: DWORD, + lpOutBuffer: LPVOID, + nOutBufferSize: DWORD, + lpBytesRead: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn CreateNamedPipeW( + lpName: LPCWSTR, + dwOpenMode: DWORD, + dwPipeMode: DWORD, + nMaxInstances: DWORD, + nOutBufferSize: DWORD, + nInBufferSize: DWORD, + nDefaultTimeOut: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> HANDLE; + pub fn WaitNamedPipeW( + lpNamedPipeName: LPCWSTR, + nTimeOut: DWORD, + ) -> BOOL; + pub fn GetNamedPipeClientComputerNameW( + Pipe: HANDLE, + ClientComputerName: LPWSTR, + ClientComputerNameLength: ULONG, + ) -> BOOL; + pub fn ImpersonateNamedPipeClient( + hNamedPipe: HANDLE, + ) -> BOOL; + pub fn GetNamedPipeInfo( + hNamedPipe: HANDLE, + lpFlags: LPDWORD, + lpOutBufferSize: LPDWORD, + lpInBufferSize: LPDWORD, + lpMaxInstances: LPDWORD, + ) -> BOOL; + pub fn GetNamedPipeHandleStateW( + hNamedPipe: HANDLE, + lpState: LPDWORD, + lpCurInstances: LPDWORD, + lpMaxCollectionCount: LPDWORD, + lpCollectDataTimeout: LPDWORD, + lpUserName: LPWSTR, + nMaxUserNameSize: DWORD, + ) -> BOOL; + pub fn CallNamedPipeW( + lpNamedPipeName: LPCWSTR, + lpInBuffer: LPVOID, + nInBufferSize: DWORD, + lpOutBuffer: LPVOID, + nOutBufferSize: DWORD, + lpBytesRead: LPDWORD, + nTimeOut: DWORD, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/namespaceapi.rs b/bash-5.1/vendor/winapi/src/um/namespaceapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..cfdb8057201e6cbda1aa83086d250714576462d4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/namespaceapi.rs @@ -0,0 +1,36 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +use shared::minwindef::{BOOL, LPVOID, ULONG}; +use shared::ntdef::{BOOLEAN, HANDLE, LPCWSTR}; +use um::minwinbase::LPSECURITY_ATTRIBUTES; +use um::winnt::PSID; +pub const PRIVATE_NAMESPACE_FLAG_DESTROY: ULONG = 0x00000001; +extern "system" { + pub fn CreatePrivateNamespaceW( + lpPrivateNamespaceAttributes: LPSECURITY_ATTRIBUTES, + lpBoundaryDescriptor: LPVOID, + lpAliasPrefix: LPCWSTR, + ) -> HANDLE; + pub fn OpenPrivateNamespaceW( + lpBoundaryDescriptor: LPVOID, + lpAliasPrefix: LPCWSTR, + ) -> HANDLE; + pub fn ClosePrivateNamespace( + Handle: HANDLE, + Flags: ULONG, + ) -> BOOLEAN; + pub fn CreateBoundaryDescriptorW( + Name: LPCWSTR, + Flags: ULONG, + ) -> HANDLE; + pub fn AddSIDToBoundaryDescriptor( + BoundaryDescriptor: *mut HANDLE, + RequiredSid: PSID, + ) -> BOOL; + pub fn DeleteBoundaryDescriptor( + BoundaryDescriptor: HANDLE, + ) -> (); +} diff --git a/bash-5.1/vendor/winapi/src/um/nb30.rs b/bash-5.1/vendor/winapi/src/um/nb30.rs new file mode 100644 index 0000000000000000000000000000000000000000..100efbd191bd4a2dd749f4b7c3a01d178f7d26dd --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/nb30.rs @@ -0,0 +1,214 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module contains the definitions for portable NetBIOS 3.0 support. +use shared::minwindef::{DWORD, PUCHAR, UCHAR, ULONG, USHORT, WORD}; +use um::winnt::HANDLE; +pub const NCBNAMSZ: usize = 16; +pub const MAX_LANA: usize = 254; +FN!{stdcall PFPOST( + *mut NCB, +) -> ()} +#[cfg(target_pointer_width = "64")] +STRUCT!{struct NCB { + ncb_command: UCHAR, + ncb_retcode: UCHAR, + ncb_lsn: UCHAR, + ncb_num: UCHAR, + ncb_buffer: PUCHAR, + ncb_length: WORD, + ncb_callname: [UCHAR; NCBNAMSZ], + ncb_name: [UCHAR; NCBNAMSZ], + ncb_rto: UCHAR, + ncb_sto: UCHAR, + ncb_post: PFPOST, + ncb_lana_num: UCHAR, + ncb_cmd_cplt: UCHAR, + ncb_reserve: [UCHAR; 18], + ncb_event: HANDLE, +}} +#[cfg(target_pointer_width = "32")] +STRUCT!{struct NCB { + ncb_command: UCHAR, + ncb_retcode: UCHAR, + ncb_lsn: UCHAR, + ncb_num: UCHAR, + ncb_buffer: PUCHAR, + ncb_length: WORD, + ncb_callname: [UCHAR; NCBNAMSZ], + ncb_name: [UCHAR; NCBNAMSZ], + ncb_rto: UCHAR, + ncb_sto: UCHAR, + ncb_post: PFPOST, + ncb_lana_num: UCHAR, + ncb_cmd_cplt: UCHAR, + ncb_reserve: [UCHAR; 10], + ncb_event: HANDLE, +}} +pub type PNCB = *mut NCB; +STRUCT!{struct ADAPTER_STATUS { + adapter_address: [UCHAR; 6], + rev_major: UCHAR, + reserved0: UCHAR, + adapter_type: UCHAR, + rev_minor: UCHAR, + duration: WORD, + frmr_recv: WORD, + frmr_xmit: WORD, + iframe_recv_err: WORD, + xmit_aborts: WORD, + xmit_success: DWORD, + recv_success: DWORD, + iframe_xmit_err: WORD, + recv_buff_unavail: WORD, + t1_timeouts: WORD, + ti_timeouts: WORD, + reserved1: DWORD, + free_ncbs: WORD, + max_cfg_ncbs: WORD, + max_ncbs: WORD, + xmit_buf_unavail: WORD, + max_dgram_size: WORD, + pending_sess: WORD, + max_cfg_sess: WORD, + max_sess: WORD, + max_sess_pkt_size: WORD, + name_count: WORD, +}} +pub type PADAPTER_STATUS = *mut ADAPTER_STATUS; +STRUCT!{struct NAME_BUFFER { + name: [UCHAR; NCBNAMSZ], + name_num: UCHAR, + name_flags: UCHAR, +}} +pub type PNAME_BUFFER = *mut NAME_BUFFER; +pub const NAME_FLAGS_MASK: UCHAR = 0x87; +pub const GROUP_NAME: UCHAR = 0x80; +pub const UNIQUE_NAME: UCHAR = 0x00; +pub const REGISTERING: UCHAR = 0x00; +pub const REGISTERED: UCHAR = 0x04; +pub const DEREGISTERED: UCHAR = 0x05; +pub const DUPLICATE: UCHAR = 0x06; +pub const DUPLICATE_DEREG: UCHAR = 0x07; +STRUCT!{struct SESSION_HEADER { + sess_name: UCHAR, + num_sess: UCHAR, + rcv_dg_outstanding: UCHAR, + rcv_any_outstanding: UCHAR, +}} +pub type PSESSION_HEADER = *mut SESSION_HEADER; +STRUCT!{struct SESSION_BUFFER { + lsn: UCHAR, + state: UCHAR, + local_name: [UCHAR; NCBNAMSZ], + remote_name: [UCHAR; NCBNAMSZ], + rcvs_outstanding: UCHAR, + sends_outstanding: UCHAR, +}} +pub type PSESSION_BUFFER = *mut SESSION_BUFFER; +pub const LISTEN_OUTSTANDING: UCHAR = 0x01; +pub const CALL_PENDING: UCHAR = 0x02; +pub const SESSION_ESTABLISHED: UCHAR = 0x03; +pub const HANGUP_PENDING: UCHAR = 0x04; +pub const HANGUP_COMPLETE: UCHAR = 0x05; +pub const SESSION_ABORTED: UCHAR = 0x06; +STRUCT!{struct LANA_ENUM { + length: UCHAR, + lana: [UCHAR; MAX_LANA + 1], +}} +pub type PLANA_ENUM = *mut LANA_ENUM; +STRUCT!{struct FIND_NAME_HEADER { + node_count: WORD, + reserved: UCHAR, + unique_group: UCHAR, +}} +pub type PFIND_NAME_HEADER = *mut FIND_NAME_HEADER; +STRUCT!{struct FIND_NAME_BUFFER { + length: UCHAR, + access_control: UCHAR, + frame_control: UCHAR, + destination_addr: [UCHAR; 6], + source_addr: [UCHAR; 6], + routing_info: [UCHAR; 18], +}} +pub type PFIND_NAME_BUFFER = *mut FIND_NAME_BUFFER; +STRUCT!{struct ACTION_HEADER { + transport_id: ULONG, + action_code: USHORT, + reserved: USHORT, +}} +pub type PACTION_HEADER = *mut ACTION_HEADER; +pub const ALL_TRANSPORTS: ULONG = 0x0000004d; +pub const MS_NBF: ULONG = 0x46424e4d; +pub const NCBCALL: UCHAR = 0x10; +pub const NCBLISTEN: UCHAR = 0x11; +pub const NCBHANGUP: UCHAR = 0x12; +pub const NCBSEND: UCHAR = 0x14; +pub const NCBRECV: UCHAR = 0x15; +pub const NCBRECVANY: UCHAR = 0x16; +pub const NCBCHAINSEND: UCHAR = 0x17; +pub const NCBDGSEND: UCHAR = 0x20; +pub const NCBDGRECV: UCHAR = 0x21; +pub const NCBDGSENDBC: UCHAR = 0x22; +pub const NCBADDNAME: UCHAR = 0x30; +pub const NCBDELNAME: UCHAR = 0x31; +pub const NCBRESET: UCHAR = 0x32; +pub const NCBASTAT: UCHAR = 0x33; +pub const NCBSSTAT: UCHAR = 0x34; +pub const NCBCANCEL: UCHAR = 0x35; +pub const NCBADDGRNAME: UCHAR = 0x36; +pub const NCBENUM: UCHAR = 0x37; +pub const NCBUNLINK: UCHAR = 0x70; +pub const NCBSENDNA: UCHAR = 0x71; +pub const NCBCHAINSENDNA: UCHAR = 0x72; +pub const NCBLANSTALERT: UCHAR = 0x73; +pub const NCBACTION: UCHAR = 0x77; +pub const NCBFINDNAME: UCHAR = 0x78; +pub const NCBTRACE: UCHAR = 0x79; +pub const ASYNCH: UCHAR = 0x80; +pub const NRC_GOODRET: UCHAR = 0x00; +pub const NRC_BUFLEN: UCHAR = 0x01; +pub const NRC_ILLCMD: UCHAR = 0x03; +pub const NRC_CMDTMO: UCHAR = 0x05; +pub const NRC_INCOMP: UCHAR = 0x06; +pub const NRC_BADDR: UCHAR = 0x07; +pub const NRC_SNUMOUT: UCHAR = 0x08; +pub const NRC_NORES: UCHAR = 0x09; +pub const NRC_SCLOSED: UCHAR = 0x0a; +pub const NRC_CMDCAN: UCHAR = 0x0b; +pub const NRC_DUPNAME: UCHAR = 0x0d; +pub const NRC_NAMTFUL: UCHAR = 0x0e; +pub const NRC_ACTSES: UCHAR = 0x0f; +pub const NRC_LOCTFUL: UCHAR = 0x11; +pub const NRC_REMTFUL: UCHAR = 0x12; +pub const NRC_ILLNN: UCHAR = 0x13; +pub const NRC_NOCALL: UCHAR = 0x14; +pub const NRC_NOWILD: UCHAR = 0x15; +pub const NRC_INUSE: UCHAR = 0x16; +pub const NRC_NAMERR: UCHAR = 0x17; +pub const NRC_SABORT: UCHAR = 0x18; +pub const NRC_NAMCONF: UCHAR = 0x19; +pub const NRC_IFBUSY: UCHAR = 0x21; +pub const NRC_TOOMANY: UCHAR = 0x22; +pub const NRC_BRIDGE: UCHAR = 0x23; +pub const NRC_CANOCCR: UCHAR = 0x24; +pub const NRC_CANCEL: UCHAR = 0x26; +pub const NRC_DUPENV: UCHAR = 0x30; +pub const NRC_ENVNOTDEF: UCHAR = 0x34; +pub const NRC_OSRESNOTAV: UCHAR = 0x35; +pub const NRC_MAXAPPS: UCHAR = 0x36; +pub const NRC_NOSAPS: UCHAR = 0x37; +pub const NRC_NORESOURCES: UCHAR = 0x38; +pub const NRC_INVADDRESS: UCHAR = 0x39; +pub const NRC_INVDDID: UCHAR = 0x3B; +pub const NRC_LOCKFAIL: UCHAR = 0x3C; +pub const NRC_OPENERR: UCHAR = 0x3f; +pub const NRC_SYSTEM: UCHAR = 0x40; +pub const NRC_PENDING: UCHAR = 0xff; +extern "system" { + pub fn Netbios( + pncb: PNCB, + ) -> UCHAR; +} diff --git a/bash-5.1/vendor/winapi/src/um/ncrypt.rs b/bash-5.1/vendor/winapi/src/um/ncrypt.rs new file mode 100644 index 0000000000000000000000000000000000000000..5f5431e2190f8d8e6fc92b866930bbbafb79cc6a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ncrypt.rs @@ -0,0 +1,88 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{SIZE_T, ULONG_PTR}; +use shared::bcrypt::{BCRYPT_NO_KEY_VALIDATION, BCryptBufferDesc}; +use shared::minwindef::{DWORD, LPVOID, PBYTE}; +use um::winnt::{LONG, LPCWSTR, VOID}; +pub type SECURITY_STATUS = LONG; +pub type HCRYPTPROV = ULONG_PTR; +pub type HCRYPTKEY = ULONG_PTR; +pub type HCRYPTHASH = ULONG_PTR; +FN!{stdcall PFN_NCRYPT_ALLOC( + cbSize: SIZE_T, +) -> LPVOID} +FN!{stdcall PFN_NCRYPT_FREE( + pv: LPVOID, +) -> VOID} +STRUCT!{struct NCRYPT_ALLOC_PARA { + cbSize: DWORD, + pfnAlloc: PFN_NCRYPT_ALLOC, + pfnFree: PFN_NCRYPT_FREE, +}} +pub type NCryptBufferDesc = BCryptBufferDesc; +pub type NCRYPT_HANDLE = ULONG_PTR; +pub type NCRYPT_PROV_HANDLE = ULONG_PTR; +pub type NCRYPT_KEY_HANDLE = ULONG_PTR; +pub type NCRYPT_HASH_HANDLE = ULONG_PTR; +pub type NCRYPT_SECRET_HANDLE = ULONG_PTR; +pub const NCRYPT_NO_PADDING_FLAG: DWORD = 0x00000001; +pub const NCRYPT_PAD_PKCS1_FLAG: DWORD = 0x00000002; +pub const NCRYPT_PAD_OAEP_FLAG: DWORD = 0x00000004; +pub const NCRYPT_PAD_PSS_FLAG: DWORD = 0x00000008; +pub const NCRYPT_PAD_CIPHER_FLAG: DWORD = 0x00000010; +pub const NCRYPT_ATTESTATION_FLAG: DWORD = 0x00000020; +pub const NCRYPT_SEALING_FLAG: DWORD = 0x00000100; +pub const NCRYPT_REGISTER_NOTIFY_FLAG: DWORD = 0x00000001; +pub const NCRYPT_UNREGISTER_NOTIFY_FLAG: DWORD = 0x00000002; +pub const NCRYPT_NO_KEY_VALIDATION: DWORD = BCRYPT_NO_KEY_VALIDATION; +pub const NCRYPT_MACHINE_KEY_FLAG: DWORD = 0x00000020; +pub const NCRYPT_SILENT_FLAG: DWORD = 0x00000040; +pub const NCRYPT_OVERWRITE_KEY_FLAG: DWORD = 0x00000080; +pub const NCRYPT_WRITE_KEY_TO_LEGACY_STORE_FLAG: DWORD = 0x00000200; +pub const NCRYPT_DO_NOT_FINALIZE_FLAG: DWORD = 0x00000400; +pub const NCRYPT_EXPORT_LEGACY_FLAG: DWORD = 0x00000800; +pub const NCRYPT_IGNORE_DEVICE_STATE_FLAG: DWORD = 0x00001000; +pub const NCRYPT_TREAT_NIST_AS_GENERIC_ECC_FLAG: DWORD = 0x00002000; +pub const NCRYPT_NO_CACHED_PASSWORD: DWORD = 0x00004000; +pub const NCRYPT_PROTECT_TO_LOCAL_SYSTEM: DWORD = 0x00008000; +pub const NCRYPT_PERSIST_ONLY_FLAG: DWORD = 0x40000000; +pub const NCRYPT_PERSIST_FLAG: DWORD = 0x80000000; +pub const NCRYPT_PREFER_VIRTUAL_ISOLATION_FLAG: DWORD = 0x00010000; +pub const NCRYPT_USE_VIRTUAL_ISOLATION_FLAG: DWORD = 0x00020000; +pub const NCRYPT_USE_PER_BOOT_KEY_FLAG: DWORD = 0x00040000; +extern "system" { + pub fn NCryptOpenStorageProvider( + phProvider: *mut NCRYPT_PROV_HANDLE, + pszProviderName: LPCWSTR, + dwFlags: DWORD, + ) -> SECURITY_STATUS; +} +pub const NCRYPT_ALLOW_EXPORT_FLAG: DWORD = 0x00000001; +pub const NCRYPT_ALLOW_PLAINTEXT_EXPORT_FLAG: DWORD = 0x00000002; +pub const NCRYPT_ALLOW_ARCHIVING_FLAG: DWORD = 0x00000004; +pub const NCRYPT_ALLOW_PLAINTEXT_ARCHIVING_FLAG: DWORD = 0x00000008; +extern "system" { + pub fn NCryptSetProperty( + hObject: NCRYPT_HANDLE, + pszProperty: LPCWSTR, + pbInput: PBYTE, + cbInput: DWORD, + dwFlags: DWORD, + ) -> SECURITY_STATUS; + pub fn NCryptImportKey( + hProvider: NCRYPT_PROV_HANDLE, + hImportKey: NCRYPT_KEY_HANDLE, + pszBlobType: LPCWSTR, + pParameterList: *const NCryptBufferDesc, + phKey: *mut NCRYPT_KEY_HANDLE, + pbData: PBYTE, + cbData: DWORD, + dwFlags: DWORD, + ) -> SECURITY_STATUS; + pub fn NCryptFreeObject( + hObject: NCRYPT_HANDLE, + ) -> SECURITY_STATUS; +} diff --git a/bash-5.1/vendor/winapi/src/um/ntlsa.rs b/bash-5.1/vendor/winapi/src/um/ntlsa.rs new file mode 100644 index 0000000000000000000000000000000000000000..0e283b1ad005f5e5fbc87294198aaf90df0ce3ee --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ntlsa.rs @@ -0,0 +1,1530 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{SIZE_T, ULONG_PTR}; +use shared::guiddef::GUID; +use shared::minwindef::{PUCHAR, PULONG, UCHAR, ULONG, USHORT}; +use shared::ntdef::{NTSTATUS, PNTSTATUS}; +use um::lsalookup::{ + LSA_TRUST_INFORMATION, LSA_UNICODE_STRING, PLSA_OBJECT_ATTRIBUTES, + PLSA_REFERENCED_DOMAIN_LIST, PLSA_STRING, PLSA_TRANSLATED_NAME, PLSA_TRANSLATED_SID2, + PLSA_TRUST_INFORMATION, PLSA_UNICODE_STRING, +}; +use um::ntsecapi::PLSA_HANDLE; +use um::subauth::{PUNICODE_STRING, UNICODE_STRING}; +use um::winnt::{ + ACCESS_MASK, ANYSIZE_ARRAY, BOOLEAN, HANDLE, LARGE_INTEGER, LONG, LUID, PBOOLEAN, + PCLAIMS_BLOB, PHANDLE, PLARGE_INTEGER, PLUID, PPRIVILEGE_SET, PQUOTA_LIMITS, + PSECURITY_DESCRIPTOR, PSHORT, PSID, PTOKEN_GROUPS, PTOKEN_PRIVILEGES, PTOKEN_SOURCE, PVOID, + PWSTR, QUOTA_LIMITS, SECURITY_INFORMATION, SID_NAME_USE, STANDARD_RIGHTS_EXECUTE, + STANDARD_RIGHTS_READ, STANDARD_RIGHTS_REQUIRED, STANDARD_RIGHTS_WRITE, TOKEN_DEFAULT_DACL, + TOKEN_DEVICE_CLAIMS, TOKEN_OWNER, TOKEN_PRIMARY_GROUP, TOKEN_USER, TOKEN_USER_CLAIMS, +}; +pub type LSA_OPERATIONAL_MODE = ULONG; +pub type PLSA_OPERATIONAL_MODE = *mut LSA_OPERATIONAL_MODE; +pub const LSA_MODE_PASSWORD_PROTECTED: ULONG = 0x00000001; +pub const LSA_MODE_INDIVIDUAL_ACCOUNTS: ULONG = 0x00000002; +pub const LSA_MODE_MANDATORY_ACCESS: ULONG = 0x00000004; +pub const LSA_MODE_LOG_FULL: ULONG = 0x00000008; +pub const LSA_MAXIMUM_SID_COUNT: SIZE_T = 0x00000100; +pub const LSA_MAXIMUM_ENUMERATION_LENGTH: SIZE_T = 32000; +pub const LSA_CALL_LICENSE_SERVER: ULONG = 0x80000000; +ENUM!{enum SECURITY_LOGON_TYPE { + UndefinedLogonType = 0, + Interactive = 2, + Network, + Batch, + Service, + Proxy, + Unlock, + NetworkCleartext, + NewCredentials, + RemoteInteractive, + CachedInteractive, + CachedRemoteInteractive, + CachedUnlock, +}} +pub type PSECURITY_LOGON_TYPE = *mut SECURITY_LOGON_TYPE; +pub const SECURITY_ACCESS_INTERACTIVE_LOGON: ULONG = 0x00000001; +pub const SECURITY_ACCESS_NETWORK_LOGON: ULONG = 0x00000002; +pub const SECURITY_ACCESS_BATCH_LOGON: ULONG = 0x00000004; +pub const SECURITY_ACCESS_SERVICE_LOGON: ULONG = 0x00000010; +pub const SECURITY_ACCESS_PROXY_LOGON: ULONG = 0x00000020; +pub const SECURITY_ACCESS_DENY_INTERACTIVE_LOGON: ULONG = 0x00000040; +pub const SECURITY_ACCESS_DENY_NETWORK_LOGON: ULONG = 0x00000080; +pub const SECURITY_ACCESS_DENY_BATCH_LOGON: ULONG = 0x00000100; +pub const SECURITY_ACCESS_DENY_SERVICE_LOGON: ULONG = 0x00000200; +pub const SECURITY_ACCESS_REMOTE_INTERACTIVE_LOGON: ULONG = 0x00000400; +pub const SECURITY_ACCESS_DENY_REMOTE_INTERACTIVE_LOGON: ULONG = 0x00000800; +ENUM!{enum SE_ADT_PARAMETER_TYPE { + SeAdtParmTypeNone = 0, + SeAdtParmTypeString, + SeAdtParmTypeFileSpec, + SeAdtParmTypeUlong, + SeAdtParmTypeSid, + SeAdtParmTypeLogonId, + SeAdtParmTypeNoLogonId, + SeAdtParmTypeAccessMask, + SeAdtParmTypePrivs, + SeAdtParmTypeObjectTypes, + SeAdtParmTypeHexUlong, + SeAdtParmTypePtr, + SeAdtParmTypeTime, + SeAdtParmTypeGuid, + SeAdtParmTypeLuid, + SeAdtParmTypeHexInt64, + SeAdtParmTypeStringList, + SeAdtParmTypeSidList, + SeAdtParmTypeDuration, + SeAdtParmTypeUserAccountControl, + SeAdtParmTypeNoUac, + SeAdtParmTypeMessage, + SeAdtParmTypeDateTime, + SeAdtParmTypeSockAddr, + SeAdtParmTypeSD, + SeAdtParmTypeLogonHours, + SeAdtParmTypeLogonIdNoSid, + SeAdtParmTypeUlongNoConv, + SeAdtParmTypeSockAddrNoPort, + SeAdtParmTypeAccessReason, + SeAdtParmTypeStagingReason, + SeAdtParmTypeResourceAttribute, + SeAdtParmTypeClaims, + SeAdtParmTypeLogonIdAsSid, + SeAdtParmTypeMultiSzString, + SeAdtParmTypeLogonIdEx, +}} +pub type PSE_ADT_PARAMETER_TYPE = *mut SE_ADT_PARAMETER_TYPE; +pub const SE_ADT_OBJECT_ONLY: USHORT = 0x1; +STRUCT!{struct SE_ADT_OBJECT_TYPE { + ObjectType: GUID, + Flags: USHORT, + Level: USHORT, + AccessMask: ACCESS_MASK, +}} +pub type PSE_ADT_OBJECT_TYPE = *mut SE_ADT_OBJECT_TYPE; +STRUCT!{struct SE_ADT_PARAMETER_ARRAY_ENTRY { + Type: SE_ADT_PARAMETER_TYPE, + Length: ULONG, + Data: [ULONG_PTR; 2], + Address: PVOID, +}} +pub type PSE_ADT_PARAMETER_ARRAY_ENTRY = *mut SE_ADT_PARAMETER_ARRAY_ENTRY; +STRUCT!{struct SE_ADT_ACCESS_REASON { + AccessMask: ACCESS_MASK, + AccessReasons: [ULONG; 32], + ObjectTypeIndex: ULONG, + AccessGranted: ULONG, + SecurityDescriptor: PSECURITY_DESCRIPTOR, +}} +pub type PSE_ADT_ACCESS_REASON = *mut SE_ADT_ACCESS_REASON; +STRUCT!{struct SE_ADT_CLAIMS { + Length: ULONG, + Claims: PCLAIMS_BLOB, +}} +pub type PSE_ADT_CLAIMS = *mut SE_ADT_CLAIMS; +pub const SE_MAX_AUDIT_PARAMETERS: SIZE_T = 32; +pub const SE_MAX_GENERIC_AUDIT_PARAMETERS: SIZE_T = 28; +STRUCT!{struct SE_ADT_PARAMETER_ARRAY { + CategoryId: ULONG, + AuditId: ULONG, + ParameterCount: ULONG, + Length: ULONG, + FlatSubCategoryId: USHORT, + Type: USHORT, + Flags: ULONG, + Parameters: [SE_ADT_PARAMETER_ARRAY_ENTRY; SE_MAX_AUDIT_PARAMETERS], +}} +pub type PSE_ADT_PARAMETER_ARRAY = *mut SE_ADT_PARAMETER_ARRAY; +STRUCT!{struct SE_ADT_PARAMETER_ARRAY_EX { + CategoryId: ULONG, + AuditId: ULONG, + Version: ULONG, + ParameterCount: ULONG, + Length: ULONG, + FlatSubCategoryId: USHORT, + Type: USHORT, + Flags: ULONG, + Parameters: [SE_ADT_PARAMETER_ARRAY_ENTRY; SE_MAX_AUDIT_PARAMETERS], +}} +pub type PSE_ADT_PARAMETER_ARRAY_EX = *mut SE_ADT_PARAMETER_ARRAY_EX; +pub const SE_ADT_PARAMETERS_SELF_RELATIVE: ULONG = 0x00000001; +pub const SE_ADT_PARAMETERS_SEND_TO_LSA: ULONG = 0x00000002; +pub const SE_ADT_PARAMETER_EXTENSIBLE_AUDIT: ULONG = 0x00000004; +pub const SE_ADT_PARAMETER_GENERIC_AUDIT: ULONG = 0x00000008; +pub const SE_ADT_PARAMETER_WRITE_SYNCHRONOUS: ULONG = 0x00000010; +#[cfg(target_pointer_width = "32")] +#[inline] +pub fn LSAP_SE_ADT_PARAMETER_ARRAY_TRUE_SIZE( + AuditParameters: SE_ADT_PARAMETER_ARRAY, +) -> SIZE_T { + 664 // FIXME: sizeof::() + - (20 // FIXME: sizeof::() + * (SE_MAX_AUDIT_PARAMETERS - AuditParameters.ParameterCount as SIZE_T)) +} +#[cfg(target_pointer_width = "64")] +#[inline] +pub fn LSAP_SE_ADT_PARAMETER_ARRAY_TRUE_SIZE( + AuditParameters: SE_ADT_PARAMETER_ARRAY, +) -> SIZE_T { + 1048 // FIXME: sizeof::() + - (32 // FIXME: sizeof::() + * (SE_MAX_AUDIT_PARAMETERS - AuditParameters.ParameterCount as SIZE_T)) +} +STRUCT!{struct LSA_ADT_STRING_LIST_ENTRY { + Flags: ULONG, + String: UNICODE_STRING, +}} +pub type PLSA_ADT_STRING_LIST_ENTRY = *mut LSA_ADT_STRING_LIST_ENTRY; +STRUCT!{struct LSA_ADT_STRING_LIST { + cStrings: ULONG, + String: PLSA_ADT_STRING_LIST_ENTRY, +}} +pub type PLSA_ADT_STRING_LIST = *mut LSA_ADT_STRING_LIST; +STRUCT!{struct LSA_ADT_SID_LIST_ENTRY { + Flags: ULONG, + Sid: PSID, +}} +pub type PLSA_ADT_SID_LIST_ENTRY = *mut LSA_ADT_SID_LIST_ENTRY; +STRUCT!{struct LSA_ADT_SID_LIST { + cSids: ULONG, + Sid: PLSA_ADT_SID_LIST_ENTRY, +}} +pub type PLSA_ADT_SID_LIST = *mut LSA_ADT_SID_LIST; +pub const LSA_ADT_SECURITY_SOURCE_NAME: &'static str = "Microsoft-Windows-Security-Auditing"; +pub const LSA_ADT_LEGACY_SECURITY_SOURCE_NAME: &'static str = "Security"; +pub const SE_ADT_POLICY_AUDIT_EVENT_TYPE_EX_BEGIN: ULONG = 100; +ENUM!{enum POLICY_AUDIT_EVENT_TYPE_EX { + iSystem_SecurityStateChange = SE_ADT_POLICY_AUDIT_EVENT_TYPE_EX_BEGIN, + iSystem_SecuritySubsystemExtension, + iSystem_Integrity, + iSystem_IPSecDriverEvents, + iSystem_Others, + iLogon_Logon, + iLogon_Logoff, + iLogon_AccountLockout, + iLogon_IPSecMainMode, + iLogon_SpecialLogon, + iLogon_IPSecQuickMode, + iLogon_IPSecUsermode, + iLogon_Others, + iLogon_NPS, + iLogon_Claims, + iLogon_Groups, + iObjectAccess_FileSystem, + iObjectAccess_Registry, + iObjectAccess_Kernel, + iObjectAccess_Sam, + iObjectAccess_Other, + iObjectAccess_CertificationAuthority, + iObjectAccess_ApplicationGenerated, + iObjectAccess_HandleBasedAudits, + iObjectAccess_Share, + iObjectAccess_FirewallPacketDrops, + iObjectAccess_FirewallConnection, + iObjectAccess_DetailedFileShare, + iObjectAccess_RemovableStorage, + iObjectAccess_CbacStaging, + iPrivilegeUse_Sensitive, + iPrivilegeUse_NonSensitive, + iPrivilegeUse_Others, + iDetailedTracking_ProcessCreation, + iDetailedTracking_ProcessTermination, + iDetailedTracking_DpapiActivity, + iDetailedTracking_RpcCall, + iDetailedTracking_PnpActivity, + iDetailedTracking_TokenRightAdjusted, + iPolicyChange_AuditPolicy, + iPolicyChange_AuthenticationPolicy, + iPolicyChange_AuthorizationPolicy, + iPolicyChange_MpsscvRulePolicy, + iPolicyChange_WfpIPSecPolicy, + iPolicyChange_Others, + iAccountManagement_UserAccount, + iAccountManagement_ComputerAccount, + iAccountManagement_SecurityGroup, + iAccountManagement_DistributionGroup, + iAccountManagement_ApplicationGroup, + iAccountManagement_Others, + iDSAccess_DSAccess, + iDSAccess_AdAuditChanges, + iDS_Replication, + iDS_DetailedReplication, + iAccountLogon_CredentialValidation, + iAccountLogon_Kerberos, + iAccountLogon_Others, + iAccountLogon_KerbCredentialValidation, + iUnknownSubCategory = 999, +}} +pub type PPOLICY_AUDIT_EVENT_TYPE_EX = *mut POLICY_AUDIT_EVENT_TYPE_EX; +ENUM!{enum POLICY_AUDIT_EVENT_TYPE { + AuditCategorySystem = 0, + AuditCategoryLogon, + AuditCategoryObjectAccess, + AuditCategoryPrivilegeUse, + AuditCategoryDetailedTracking, + AuditCategoryPolicyChange, + AuditCategoryAccountManagement, + AuditCategoryDirectoryServiceAccess, + AuditCategoryAccountLogon, +}} +pub type PPOLICY_AUDIT_EVENT_TYPE = *mut POLICY_AUDIT_EVENT_TYPE; +pub const POLICY_AUDIT_EVENT_UNCHANGED: ULONG = 0x00000000; +pub const POLICY_AUDIT_EVENT_SUCCESS: ULONG = 0x00000001; +pub const POLICY_AUDIT_EVENT_FAILURE: ULONG = 0x00000002; +pub const POLICY_AUDIT_EVENT_NONE: ULONG = 0x00000004; +pub const POLICY_AUDIT_EVENT_MASK: ULONG = POLICY_AUDIT_EVENT_SUCCESS | POLICY_AUDIT_EVENT_FAILURE + | POLICY_AUDIT_EVENT_UNCHANGED | POLICY_AUDIT_EVENT_NONE; +#[inline] +pub fn LSA_SUCCESS(Error: NTSTATUS) -> bool { + (Error as LONG) >= 0 +} +extern "system" { + pub fn LsaRegisterLogonProcess( + LogonProcessName: PLSA_STRING, + LsaHandle: PHANDLE, + SecurityMode: PLSA_OPERATIONAL_MODE, + ) -> NTSTATUS; + pub fn LsaLogonUser( + LsaHandle: HANDLE, + OriginName: PLSA_STRING, + LogonType: SECURITY_LOGON_TYPE, + AuthenticationPackage: ULONG, + AuthenticationInformation: PVOID, + AuthenticationInformationLength: ULONG, + LocalGroups: PTOKEN_GROUPS, + SourceContext: PTOKEN_SOURCE, + ProfileBuffer: *mut PVOID, + ProfileBufferLength: PULONG, + LogonId: PLUID, + Token: PHANDLE, + Quotas: PQUOTA_LIMITS, + SubStatus: PNTSTATUS, + ) -> NTSTATUS; + pub fn LsaLookupAuthenticationPackage( + LsaHandle: HANDLE, + PackageName: PLSA_STRING, + AuthenticationPackage: PULONG, + ) -> NTSTATUS; + pub fn LsaFreeReturnBuffer( + Buffer: PVOID, + ) -> NTSTATUS; + pub fn LsaCallAuthenticationPackage( + LsaHandle: HANDLE, + AuthenticationPackage: ULONG, + ProtocolSubmitBuffer: PVOID, + SubmitBufferLength: ULONG, + ProtocolReturnBuffer: *mut PVOID, + ReturnBufferLength: PULONG, + ProtocolStatus: PNTSTATUS, + ) -> NTSTATUS; + pub fn LsaDeregisterLogonProcess( + LsaHandle: HANDLE, + ) -> NTSTATUS; + pub fn LsaConnectUntrusted( + LsaHandle: PHANDLE, + ) -> NTSTATUS; +} +extern "C" { + pub fn LsaInsertProtectedProcessAddress( + BufferAddress: PVOID, + BufferSize: ULONG, + ) -> NTSTATUS; + pub fn LsaRemoveProtectedProcessAddress( + BufferAddress: PVOID, + BufferSize: ULONG, + ) -> NTSTATUS; +} +FN!{stdcall PFN_LSA_CALL_AUTH_PKG( + LsaHandle: HANDLE, + AuthenticationPackage: ULONG, + ProtocolSubmitBuffer: PVOID, + SubmitBufferLength: ULONG, + ProtocolReturnBuffer: *mut PVOID, + ReturnBufferLength: PULONG, + ProtocolStatus: PNTSTATUS, +) -> NTSTATUS} +FN!{stdcall PFN_LSA_DEREGISTER_PROC( + LsaHandle: HANDLE, +) -> NTSTATUS} +FN!{stdcall PFN_LSA_FREE_BUFFER( + Buffer: PVOID, +) -> NTSTATUS} +FN!{stdcall PFN_LSA_LOGON_USER( + LsaHandle: HANDLE, + OriginName: PLSA_STRING, + LogonType: SECURITY_LOGON_TYPE, + AuthenticationPackage: ULONG, + AuthenticationInformation: PVOID, + AuthenticationInformationLength: ULONG, + LocalGroups: PTOKEN_GROUPS, + SourceContext: PTOKEN_SOURCE, + ProfileBuffer: *mut PVOID, + ProfileBufferLength: PULONG, + LogonId: PLUID, + Token: PHANDLE, + Quotas: PQUOTA_LIMITS, + SubStatus: PNTSTATUS, +) -> NTSTATUS} +FN!{stdcall PFN_LOOKUP_AUTH_PKG( + LsaHandle: HANDLE, + PackageName: PLSA_STRING, + AuthenticationPackage: PULONG, +) -> NTSTATUS} +FN!{stdcall PFN_LSA_REGISTER_PROC( + LogonProcessName: PLSA_STRING, + LsaHandle: PHANDLE, + SecurityMode: PLSA_OPERATIONAL_MODE, +) -> NTSTATUS} +STRUCT!{struct LSA_AUTH_CALLBACKS { + LsaCallAuthPkgFn: PFN_LSA_CALL_AUTH_PKG, + LsaDeregisterProcFn: PFN_LSA_DEREGISTER_PROC, + LsaFreeReturnBufferFn: PFN_LSA_FREE_BUFFER, + LsaLogonUserFn: PFN_LSA_LOGON_USER, + LsaLookupAuthPkgFn: PFN_LOOKUP_AUTH_PKG, + LsaRegisterProcFn: PFN_LSA_REGISTER_PROC, +}} +pub type PLSA_AUTH_CALLBACKS = *mut LSA_AUTH_CALLBACKS; +pub type PCLSA_AUTH_CALLBACKS = *const LSA_AUTH_CALLBACKS; +pub type PLSA_CLIENT_REQUEST = *mut PVOID; +ENUM!{enum LSA_TOKEN_INFORMATION_TYPE { + LsaTokenInformationNull, + LsaTokenInformationV1, + LsaTokenInformationV2, + LsaTokenInformationV3, +}} +pub type PLSA_TOKEN_INFORMATION_TYPE = *mut LSA_TOKEN_INFORMATION_TYPE; +STRUCT!{struct LSA_TOKEN_INFORMATION_NULL { + ExpirationTime: LARGE_INTEGER, + Groups: PTOKEN_GROUPS, +}} +pub type PLSA_TOKEN_INFORMATION_NULL = *mut LSA_TOKEN_INFORMATION_NULL; +STRUCT!{struct LSA_TOKEN_INFORMATION_V1 { + ExpirationTime: LARGE_INTEGER, + User: TOKEN_USER, + Groups: PTOKEN_GROUPS, + PrimaryGroup: TOKEN_PRIMARY_GROUP, + Privileges: PTOKEN_PRIVILEGES, + Owner: TOKEN_OWNER, + DefaultDacl: TOKEN_DEFAULT_DACL, +}} +pub type PLSA_TOKEN_INFORMATION_V1 = *mut LSA_TOKEN_INFORMATION_V1; +pub type LSA_TOKEN_INFORMATION_V2 = LSA_TOKEN_INFORMATION_V1; +pub type PLSA_TOKEN_INFORMATION_V2 = *mut LSA_TOKEN_INFORMATION_V2; +STRUCT!{struct LSA_TOKEN_INFORMATION_V3 { + ExpirationTime: LARGE_INTEGER, + User: TOKEN_USER, + Groups: PTOKEN_GROUPS, + PrimaryGroup: TOKEN_PRIMARY_GROUP, + Privileges: PTOKEN_PRIVILEGES, + Owner: TOKEN_OWNER, + DefaultDacl: TOKEN_DEFAULT_DACL, + UserClaims: TOKEN_USER_CLAIMS, + DeviceClaims: TOKEN_DEVICE_CLAIMS, + DeviceGroups: PTOKEN_GROUPS, +}} +pub type PLSA_TOKEN_INFORMATION_V3 = *mut LSA_TOKEN_INFORMATION_V3; +FN!{stdcall PLSA_CREATE_LOGON_SESSION( + LogonId: PLUID, +) -> NTSTATUS} +FN!{stdcall PLSA_DELETE_LOGON_SESSION( + LogonId: PLUID, +) -> NTSTATUS} +FN!{stdcall PLSA_ADD_CREDENTIAL( + LogonId: PLUID, + AuthenticationPackage: ULONG, + PrimaryKeyValue: PLSA_STRING, + Credentials: PLSA_STRING, +) -> NTSTATUS} +FN!{stdcall PLSA_GET_CREDENTIALS( + LogonId: PLUID, + AuthenticationPackage: ULONG, + QueryContext: PULONG, + RetrieveAllCredentials: BOOLEAN, + PrimaryKeyValue: PLSA_STRING, + PrimaryKeyLength: PULONG, + Credentials: PLSA_STRING, +) -> NTSTATUS} +FN!{stdcall PLSA_DELETE_CREDENTIAL( + LogonId: PLUID, + AuthenticationPackage: ULONG, + PrimaryKeyValue: PLSA_STRING, +) -> NTSTATUS} +FN!{stdcall PLSA_ALLOCATE_LSA_HEAP( + Length: ULONG, +) -> PVOID} +FN!{stdcall PLSA_FREE_LSA_HEAP( + Base: PVOID, +) -> ()} +FN!{stdcall PLSA_ALLOCATE_PRIVATE_HEAP( + Length: SIZE_T, +) -> PVOID} +FN!{stdcall PLSA_FREE_PRIVATE_HEAP( + Base: PVOID, +) -> ()} +FN!{stdcall PLSA_ALLOCATE_CLIENT_BUFFER( + ClientRequest: PLSA_CLIENT_REQUEST, + LengthRequired: ULONG, + ClientBaseAddress: *mut PVOID, +) -> NTSTATUS} +FN!{stdcall PLSA_FREE_CLIENT_BUFFER( + ClientRequest: PLSA_CLIENT_REQUEST, + ClientBaseAddress: PVOID, +) -> NTSTATUS} +FN!{stdcall PLSA_COPY_TO_CLIENT_BUFFER( + ClientRequest: PLSA_CLIENT_REQUEST, + Length: ULONG, + ClientBaseAddress: PVOID, + BufferToCopy: PVOID, +) -> NTSTATUS} +FN!{stdcall PLSA_COPY_FROM_CLIENT_BUFFER( + ClientRequest: PLSA_CLIENT_REQUEST, + Length: ULONG, + BufferToCopy: PVOID, + ClientBaseAddress: PVOID, +) -> NTSTATUS} +STRUCT!{struct LSA_DISPATCH_TABLE { + CreateLogonSession: PLSA_CREATE_LOGON_SESSION, + DeleteLogonSession: PLSA_DELETE_LOGON_SESSION, + AddCredential: PLSA_ADD_CREDENTIAL, + GetCredentials: PLSA_GET_CREDENTIALS, + DeleteCredential: PLSA_DELETE_CREDENTIAL, + AllocateLsaHeap: PLSA_ALLOCATE_LSA_HEAP, + FreeLsaHeap: PLSA_FREE_LSA_HEAP, + AllocateClientBuffer: PLSA_ALLOCATE_CLIENT_BUFFER, + FreeClientBuffer: PLSA_FREE_CLIENT_BUFFER, + CopyToClientBuffer: PLSA_COPY_TO_CLIENT_BUFFER, + CopyFromClientBuffer: PLSA_COPY_FROM_CLIENT_BUFFER, +}} +pub type PLSA_DISPATCH_TABLE = *mut LSA_DISPATCH_TABLE; +pub const LSA_AP_NAME_INITIALIZE_PACKAGE: &'static str = "LsaApInitializePackage"; +pub const LSA_AP_NAME_LOGON_USER: &'static str = "LsaApLogonUser"; +pub const LSA_AP_NAME_LOGON_USER_EX: &'static str = "LsaApLogonUserEx"; +pub const LSA_AP_NAME_CALL_PACKAGE: &'static str = "LsaApCallPackage"; +pub const LSA_AP_NAME_LOGON_TERMINATED: &'static str = "LsaApLogonTerminated"; +pub const LSA_AP_NAME_CALL_PACKAGE_UNTRUSTED: &'static str = "LsaApCallPackageUntrusted"; +pub const LSA_AP_NAME_CALL_PACKAGE_PASSTHROUGH: &'static str = "LsaApCallPackagePassthrough"; +FN!{stdcall PLSA_AP_INITIALIZE_PACKAGE( + AuthenticationPackageId: ULONG, + LsaDispatchTable: PLSA_DISPATCH_TABLE, + Database: PLSA_STRING, + Confidentiality: PLSA_STRING, + AuthenticationPackageName: *mut PLSA_STRING, +) -> NTSTATUS} +FN!{stdcall PLSA_AP_LOGON_USER( + ClientRequest: PLSA_CLIENT_REQUEST, + LogonType: SECURITY_LOGON_TYPE, + AuthenticationInformation: PVOID, + ClientAuthentication: PVOID, + AuthenticationInformationLength: ULONG, + ProfileBuffer: *mut PVOID, + ProfileBufferLength: PULONG, + LogonId: PLUID, + SubStatus: PNTSTATUS, + TokenInformationType: PLSA_TOKEN_INFORMATION_TYPE, + TokenInformation: *mut PVOID, + AccountName: *mut PLSA_UNICODE_STRING, + AuthenticatingAutority: *mut PLSA_UNICODE_STRING, +) -> NTSTATUS} +FN!{stdcall PLSA_AP_LOGON_USER_EX( + ClientRequest: PLSA_CLIENT_REQUEST, + LogonType: SECURITY_LOGON_TYPE, + AuthenticationInformation: PVOID, + ClientAuthentication: PVOID, + AuthenticationInformationLength: ULONG, + ProfileBuffer: *mut PVOID, + ProfileBufferLength: PULONG, + LogonId: PLUID, + SubStatus: PNTSTATUS, + TokenInformationType: PLSA_TOKEN_INFORMATION_TYPE, + TokenInformation: *mut PVOID, + AccountName: *mut PLSA_UNICODE_STRING, + AuthenticatingAutority: *mut PLSA_UNICODE_STRING, + MachineName: *mut PUNICODE_STRING, +) -> NTSTATUS} +FN!{stdcall PLSA_AP_CALL_PACKAGE( + ClientRequest: PLSA_CLIENT_REQUEST, + ProtocolSubmitBuffer: PVOID, + ClientBufferBase: PVOID, + SubmitBufferLength: ULONG, + ProtocolReturnBuffer: *mut PVOID, + ReturnBufferLength: PULONG, + ProtocolStatus: PNTSTATUS, +) -> NTSTATUS} +FN!{stdcall PLSA_AP_CALL_PACKAGE_PASSTHROUGH( + ClientRequest: PLSA_CLIENT_REQUEST, + ProtocolSubmitBuffer: PVOID, + ClientBufferBase: PVOID, + SubmitBufferLength: ULONG, + ProtocolReturnBuffer: *mut PVOID, + ReturnBufferLength: PULONG, + ProtocolStatus: PNTSTATUS, +) -> NTSTATUS} +FN!{stdcall PLSA_AP_LOGON_TERMINATED( + LogonId: PLUID, +) -> ()} +pub const POLICY_VIEW_LOCAL_INFORMATION: ULONG = 0x00000001; +pub const POLICY_VIEW_AUDIT_INFORMATION: ULONG = 0x00000002; +pub const POLICY_GET_PRIVATE_INFORMATION: ULONG = 0x00000004; +pub const POLICY_TRUST_ADMIN: ULONG = 0x00000008; +pub const POLICY_CREATE_ACCOUNT: ULONG = 0x00000010; +pub const POLICY_CREATE_SECRET: ULONG = 0x00000020; +pub const POLICY_CREATE_PRIVILEGE: ULONG = 0x00000040; +pub const POLICY_SET_DEFAULT_QUOTA_LIMITS: ULONG = 0x00000080; +pub const POLICY_SET_AUDIT_REQUIREMENTS: ULONG = 0x00000100; +pub const POLICY_AUDIT_LOG_ADMIN: ULONG = 0x00000200; +pub const POLICY_SERVER_ADMIN: ULONG = 0x00000400; +pub const POLICY_LOOKUP_NAMES: ULONG = 0x00000800; +pub const POLICY_NOTIFICATION: ULONG = 0x00001000; +pub const POLICY_ALL_ACCESS: ULONG = STANDARD_RIGHTS_REQUIRED | POLICY_VIEW_LOCAL_INFORMATION + | POLICY_VIEW_AUDIT_INFORMATION | POLICY_GET_PRIVATE_INFORMATION | POLICY_TRUST_ADMIN + | POLICY_CREATE_ACCOUNT | POLICY_CREATE_SECRET | POLICY_CREATE_PRIVILEGE + | POLICY_SET_DEFAULT_QUOTA_LIMITS | POLICY_SET_AUDIT_REQUIREMENTS | POLICY_AUDIT_LOG_ADMIN + | POLICY_SERVER_ADMIN | POLICY_LOOKUP_NAMES; +pub const POLICY_READ: ULONG = STANDARD_RIGHTS_READ | POLICY_VIEW_AUDIT_INFORMATION + | POLICY_GET_PRIVATE_INFORMATION; +pub const POLICY_WRITE: ULONG = STANDARD_RIGHTS_WRITE | POLICY_TRUST_ADMIN | POLICY_CREATE_ACCOUNT + | POLICY_CREATE_SECRET | POLICY_CREATE_PRIVILEGE | POLICY_SET_DEFAULT_QUOTA_LIMITS + | POLICY_SET_AUDIT_REQUIREMENTS | POLICY_AUDIT_LOG_ADMIN | POLICY_SERVER_ADMIN; +pub const POLICY_EXECUTE: ULONG = STANDARD_RIGHTS_EXECUTE | POLICY_VIEW_LOCAL_INFORMATION + | POLICY_LOOKUP_NAMES; +STRUCT!{struct LSA_TRANSLATED_SID { + Use: SID_NAME_USE, + RelativeId: ULONG, + DomainIndex: LONG, +}} +pub type PLSA_TRANSLATED_SID = *mut LSA_TRANSLATED_SID; +pub type POLICY_SYSTEM_ACCESS_MODE = ULONG; +pub type PPOLICY_SYSTEM_ACCESS_MODE = *mut POLICY_SYSTEM_ACCESS_MODE; +pub const POLICY_MODE_INTERACTIVE: ULONG = SECURITY_ACCESS_INTERACTIVE_LOGON; +pub const POLICY_MODE_NETWORK: ULONG = SECURITY_ACCESS_NETWORK_LOGON; +pub const POLICY_MODE_BATCH: ULONG = SECURITY_ACCESS_BATCH_LOGON; +pub const POLICY_MODE_SERVICE: ULONG = SECURITY_ACCESS_SERVICE_LOGON; +pub const POLICY_MODE_PROXY: ULONG = SECURITY_ACCESS_PROXY_LOGON; +pub const POLICY_MODE_DENY_INTERACTIVE: ULONG = SECURITY_ACCESS_DENY_INTERACTIVE_LOGON; +pub const POLICY_MODE_DENY_NETWORK: ULONG = SECURITY_ACCESS_DENY_NETWORK_LOGON; +pub const POLICY_MODE_DENY_BATCH: ULONG = SECURITY_ACCESS_DENY_BATCH_LOGON; +pub const POLICY_MODE_DENY_SERVICE: ULONG = SECURITY_ACCESS_DENY_SERVICE_LOGON; +pub const POLICY_MODE_REMOTE_INTERACTIVE: ULONG = SECURITY_ACCESS_REMOTE_INTERACTIVE_LOGON; +pub const POLICY_MODE_DENY_REMOTE_INTERACTIVE: ULONG = + SECURITY_ACCESS_DENY_REMOTE_INTERACTIVE_LOGON; +pub const POLICY_MODE_ALL: ULONG = POLICY_MODE_INTERACTIVE | POLICY_MODE_NETWORK + | POLICY_MODE_BATCH | POLICY_MODE_SERVICE | POLICY_MODE_PROXY | POLICY_MODE_DENY_INTERACTIVE + | POLICY_MODE_DENY_NETWORK | SECURITY_ACCESS_DENY_BATCH_LOGON + | SECURITY_ACCESS_DENY_SERVICE_LOGON | POLICY_MODE_REMOTE_INTERACTIVE + | POLICY_MODE_DENY_REMOTE_INTERACTIVE ; +pub const POLICY_MODE_ALL_NT4: ULONG = POLICY_MODE_INTERACTIVE | POLICY_MODE_NETWORK + | POLICY_MODE_BATCH | POLICY_MODE_SERVICE; +ENUM!{enum POLICY_LSA_SERVER_ROLE { + PolicyServerRoleBackup = 2, + PolicyServerRolePrimary, +}} +pub type PPOLICY_LSA_SERVER_ROLE = *mut POLICY_LSA_SERVER_ROLE; +ENUM!{enum POLICY_SERVER_ENABLE_STATE { + PolicyServerEnabled = 2, + PolicyServerDisabled, +}} +pub type PPOLICY_SERVER_ENABLE_STATE = *mut POLICY_SERVER_ENABLE_STATE; +pub type POLICY_AUDIT_EVENT_OPTIONS = ULONG; +pub type PPOLICY_AUDIT_EVENT_OPTIONS = *mut POLICY_AUDIT_EVENT_OPTIONS; +STRUCT!{struct POLICY_PRIVILEGE_DEFINITION { + Name: LSA_UNICODE_STRING, + LocalValue: LUID, +}} +pub type PPOLICY_PRIVILEGE_DEFINITION = *mut POLICY_PRIVILEGE_DEFINITION; +pub const LSA_LOOKUP_ISOLATED_AS_LOCAL: ULONG = 0x80000000; +pub const LSA_LOOKUP_DISALLOW_CONNECTED_ACCOUNT_INTERNET_SID: ULONG = 0x80000000; +pub const LSA_LOOKUP_PREFER_INTERNET_NAMES: ULONG = 0x40000000; +ENUM!{enum POLICY_INFORMATION_CLASS { + PolicyAuditLogInformation = 1, + PolicyAuditEventsInformation, + PolicyPrimaryDomainInformation, + PolicyPdAccountInformation, + PolicyAccountDomainInformation, + PolicyLsaServerRoleInformation, + PolicyReplicaSourceInformation, + PolicyDefaultQuotaInformation, + PolicyModificationInformation, + PolicyAuditFullSetInformation, + PolicyAuditFullQueryInformation, + PolicyDnsDomainInformation, + PolicyDnsDomainInformationInt, + PolicyLocalAccountDomainInformation, + PolicyLastEntry, +}} +pub type PPOLICY_INFORMATION_CLASS = *mut POLICY_INFORMATION_CLASS; +STRUCT!{struct POLICY_AUDIT_LOG_INFO { + AuditLogPercentFull: ULONG, + MaximumLogSize: ULONG, + AuditRetentionPeriod: LARGE_INTEGER, + AuditLogFullShutdownInProgress: BOOLEAN, + TimeToShutdown: LARGE_INTEGER, + NextAuditRecordId: ULONG, +}} +pub type PPOLICY_AUDIT_LOG_INFO = *mut POLICY_AUDIT_LOG_INFO; +STRUCT!{struct POLICY_AUDIT_EVENTS_INFO { + AuditingMode: BOOLEAN, + EventAuditingOptions: PPOLICY_AUDIT_EVENT_OPTIONS, + MaximumAuditEventCount: ULONG, +}} +pub type PPOLICY_AUDIT_EVENTS_INFO = *mut POLICY_AUDIT_EVENTS_INFO; +STRUCT!{struct POLICY_AUDIT_SUBCATEGORIES_INFO { + MaximumSubCategoryCount: ULONG, + EventAuditingOptions: PPOLICY_AUDIT_EVENT_OPTIONS, +}} +pub type PPOLICY_AUDIT_SUBCATEGORIES_INFO = *mut POLICY_AUDIT_SUBCATEGORIES_INFO; +STRUCT!{struct POLICY_AUDIT_CATEGORIES_INFO { + MaximumCategoryCount: ULONG, + SubCategoriesInfo: PPOLICY_AUDIT_SUBCATEGORIES_INFO, +}} +pub type PPOLICY_AUDIT_CATEGORIES_INFO = *mut POLICY_AUDIT_CATEGORIES_INFO; +pub const PER_USER_POLICY_UNCHANGED: UCHAR = 0x00; +pub const PER_USER_AUDIT_SUCCESS_INCLUDE: UCHAR = 0x01; +pub const PER_USER_AUDIT_SUCCESS_EXCLUDE: UCHAR = 0x02; +pub const PER_USER_AUDIT_FAILURE_INCLUDE: UCHAR = 0x04; +pub const PER_USER_AUDIT_FAILURE_EXCLUDE: UCHAR = 0x08; +pub const PER_USER_AUDIT_NONE: UCHAR = 0x10; +pub const VALID_PER_USER_AUDIT_POLICY_FLAG: UCHAR = PER_USER_AUDIT_SUCCESS_INCLUDE + | PER_USER_AUDIT_SUCCESS_EXCLUDE | PER_USER_AUDIT_FAILURE_INCLUDE + | PER_USER_AUDIT_FAILURE_EXCLUDE | PER_USER_AUDIT_NONE; +STRUCT!{struct POLICY_PRIMARY_DOMAIN_INFO { + Name: LSA_UNICODE_STRING, + Sid: PSID, +}} +pub type PPOLICY_PRIMARY_DOMAIN_INFO = *mut POLICY_PRIMARY_DOMAIN_INFO; +STRUCT!{struct POLICY_PD_ACCOUNT_INFO { + Name: LSA_UNICODE_STRING, +}} +pub type PPOLICY_PD_ACCOUNT_INFO = *mut POLICY_PD_ACCOUNT_INFO; +STRUCT!{struct POLICY_LSA_SERVER_ROLE_INFO { + LsaServerRole: POLICY_LSA_SERVER_ROLE, +}} +pub type PPOLICY_LSA_SERVER_ROLE_INFO = *mut POLICY_LSA_SERVER_ROLE_INFO; +STRUCT!{struct POLICY_REPLICA_SOURCE_INFO { + ReplicaSource: LSA_UNICODE_STRING, + ReplicaAccountName: LSA_UNICODE_STRING, +}} +pub type PPOLICY_REPLICA_SOURCE_INFO = *mut POLICY_REPLICA_SOURCE_INFO; +STRUCT!{struct POLICY_DEFAULT_QUOTA_INFO { + QuotaLimits: QUOTA_LIMITS, +}} +pub type PPOLICY_DEFAULT_QUOTA_INFO = *mut POLICY_DEFAULT_QUOTA_INFO; +STRUCT!{struct POLICY_MODIFICATION_INFO { + ModifiedId: LARGE_INTEGER, + DatabaseCreationTime: LARGE_INTEGER, +}} +pub type PPOLICY_MODIFICATION_INFO = *mut POLICY_MODIFICATION_INFO; +STRUCT!{struct POLICY_AUDIT_FULL_SET_INFO { + ShutDownOnFull: BOOLEAN, +}} +pub type PPOLICY_AUDIT_FULL_SET_INFO = *mut POLICY_AUDIT_FULL_SET_INFO; +STRUCT!{struct POLICY_AUDIT_FULL_QUERY_INFO { + ShutDownOnFull: BOOLEAN, + LogIsFull: BOOLEAN, +}} +pub type PPOLICY_AUDIT_FULL_QUERY_INFO = *mut POLICY_AUDIT_FULL_QUERY_INFO; +ENUM!{enum POLICY_DOMAIN_INFORMATION_CLASS { + PolicyDomainEfsInformation = 2, + PolicyDomainKerberosTicketInformation, +}} +pub type PPOLICY_DOMAIN_INFORMATION_CLASS = *mut POLICY_DOMAIN_INFORMATION_CLASS; +pub const POLICY_QOS_SCHANNEL_REQUIRED: ULONG = 0x00000001; +pub const POLICY_QOS_OUTBOUND_INTEGRITY: ULONG = 0x00000002; +pub const POLICY_QOS_OUTBOUND_CONFIDENTIALITY: ULONG = 0x00000004; +pub const POLICY_QOS_INBOUND_INTEGRITY: ULONG = 0x00000008; +pub const POLICY_QOS_INBOUND_CONFIDENTIALITY: ULONG = 0x00000010; +pub const POLICY_QOS_ALLOW_LOCAL_ROOT_CERT_STORE: ULONG = 0x00000020; +pub const POLICY_QOS_RAS_SERVER_ALLOWED: ULONG = 0x00000040; +pub const POLICY_QOS_DHCP_SERVER_ALLOWED: ULONG = 0x00000080; +STRUCT!{struct POLICY_DOMAIN_EFS_INFO { + InfoLength: ULONG, + EfsBlob: PUCHAR, +}} +pub type PPOLICY_DOMAIN_EFS_INFO = *mut POLICY_DOMAIN_EFS_INFO; +pub const POLICY_KERBEROS_VALIDATE_CLIENT: ULONG = 0x00000080; +STRUCT!{struct POLICY_DOMAIN_KERBEROS_TICKET_INFO { + AuthenticationOptions: ULONG, + MaxServiceTicketAge: LARGE_INTEGER, + MaxTicketAge: LARGE_INTEGER, + MaxRenewAge: LARGE_INTEGER, + MaxClockSkew: LARGE_INTEGER, + Reserved: LARGE_INTEGER, +}} +pub type PPOLICY_DOMAIN_KERBEROS_TICKET_INFO = *mut POLICY_DOMAIN_KERBEROS_TICKET_INFO; +ENUM!{enum POLICY_NOTIFICATION_INFORMATION_CLASS { + PolicyNotifyAuditEventsInformation = 1, + PolicyNotifyAccountDomainInformation, + PolicyNotifyServerRoleInformation, + PolicyNotifyDnsDomainInformation, + PolicyNotifyDomainEfsInformation, + PolicyNotifyDomainKerberosTicketInformation, + PolicyNotifyMachineAccountPasswordInformation, + PolicyNotifyGlobalSaclInformation, + PolicyNotifyMax, +}} +pub type PPOLICY_NOTIFICATION_INFORMATION_CLASS = *mut POLICY_NOTIFICATION_INFORMATION_CLASS; +pub const ACCOUNT_VIEW: ULONG = 0x00000001; +pub const ACCOUNT_ADJUST_PRIVILEGES: ULONG = 0x00000002; +pub const ACCOUNT_ADJUST_QUOTAS: ULONG = 0x00000004; +pub const ACCOUNT_ADJUST_SYSTEM_ACCESS: ULONG = 0x00000008; +pub const ACCOUNT_ALL_ACCESS: ULONG = STANDARD_RIGHTS_REQUIRED | ACCOUNT_VIEW + | ACCOUNT_ADJUST_PRIVILEGES | ACCOUNT_ADJUST_QUOTAS | ACCOUNT_ADJUST_SYSTEM_ACCESS; +pub const ACCOUNT_READ: ULONG = STANDARD_RIGHTS_READ | ACCOUNT_VIEW; +pub const ACCOUNT_WRITE: ULONG = STANDARD_RIGHTS_WRITE | ACCOUNT_ADJUST_PRIVILEGES + | ACCOUNT_ADJUST_QUOTAS | ACCOUNT_ADJUST_SYSTEM_ACCESS; +pub const ACCOUNT_EXECUTE: ULONG = STANDARD_RIGHTS_EXECUTE; +DECLARE_HANDLE!{LSA_HANDLE, __LSA_HANDLE} +pub const TRUSTED_QUERY_DOMAIN_NAME: ULONG = 0x00000001; +pub const TRUSTED_QUERY_CONTROLLERS: ULONG = 0x00000002; +pub const TRUSTED_SET_CONTROLLERS: ULONG = 0x00000004; +pub const TRUSTED_QUERY_POSIX: ULONG = 0x00000008; +pub const TRUSTED_SET_POSIX: ULONG = 0x00000010; +pub const TRUSTED_SET_AUTH: ULONG = 0x00000020; +pub const TRUSTED_QUERY_AUTH: ULONG = 0x00000040; +pub const TRUSTED_ALL_ACCESS: ULONG = STANDARD_RIGHTS_REQUIRED | TRUSTED_QUERY_DOMAIN_NAME + | TRUSTED_QUERY_CONTROLLERS | TRUSTED_SET_CONTROLLERS | TRUSTED_QUERY_POSIX | TRUSTED_SET_POSIX + | TRUSTED_SET_AUTH | TRUSTED_QUERY_AUTH; +pub const TRUSTED_READ: ULONG = STANDARD_RIGHTS_READ | TRUSTED_QUERY_DOMAIN_NAME; +pub const TRUSTED_WRITE: ULONG = STANDARD_RIGHTS_WRITE | TRUSTED_SET_CONTROLLERS + | TRUSTED_SET_POSIX | TRUSTED_SET_AUTH; +pub const TRUSTED_EXECUTE: ULONG = STANDARD_RIGHTS_EXECUTE | TRUSTED_QUERY_CONTROLLERS + | TRUSTED_QUERY_POSIX; +ENUM!{enum TRUSTED_INFORMATION_CLASS { + TrustedDomainNameInformation = 1, + TrustedControllersInformation, + TrustedPosixOffsetInformation, + TrustedPasswordInformation, + TrustedDomainInformationBasic, + TrustedDomainInformationEx, + TrustedDomainAuthInformation, + TrustedDomainFullInformation, + TrustedDomainAuthInformationInternal, + TrustedDomainFullInformationInternal, + TrustedDomainInformationEx2Internal, + TrustedDomainFullInformation2Internal, + TrustedDomainSupportedEncryptionTypes, +}} +pub type PTRUSTED_INFORMATION_CLASS = *mut TRUSTED_INFORMATION_CLASS; +STRUCT!{struct TRUSTED_DOMAIN_NAME_INFO { + Name: LSA_UNICODE_STRING, +}} +pub type PTRUSTED_DOMAIN_NAME_INFO = *mut TRUSTED_DOMAIN_NAME_INFO; +STRUCT!{struct TRUSTED_CONTROLLERS_INFO { + Entries: ULONG, + Names: PLSA_UNICODE_STRING, +}} +pub type PTRUSTED_CONTROLLERS_INFO = *mut TRUSTED_CONTROLLERS_INFO; +STRUCT!{struct TRUSTED_POSIX_OFFSET_INFO { + Offset: ULONG, +}} +pub type PTRUSTED_POSIX_OFFSET_INFO = *mut TRUSTED_POSIX_OFFSET_INFO; +STRUCT!{struct TRUSTED_PASSWORD_INFO { + Password: LSA_UNICODE_STRING, + OldPassword: LSA_UNICODE_STRING, +}} +pub type PTRUSTED_PASSWORD_INFO = *mut TRUSTED_PASSWORD_INFO; +pub type TRUSTED_DOMAIN_INFORMATION_BASIC = LSA_TRUST_INFORMATION; +pub type PTRUSTED_DOMAIN_INFORMATION_BASIC = PLSA_TRUST_INFORMATION; +// NOTE: Ignoring Win XP constants +pub const TRUST_DIRECTION_DISABLED: ULONG = 0x00000000; +pub const TRUST_DIRECTION_INBOUND: ULONG = 0x00000001; +pub const TRUST_DIRECTION_OUTBOUND: ULONG = 0x00000002; +pub const TRUST_DIRECTION_BIDIRECTIONAL: ULONG = TRUST_DIRECTION_INBOUND + | TRUST_DIRECTION_OUTBOUND; +pub const TRUST_TYPE_DOWNLEVEL: ULONG = 0x00000001; +pub const TRUST_TYPE_UPLEVEL: ULONG = 0x00000002; +pub const TRUST_TYPE_MIT: ULONG = 0x00000003; +pub const TRUST_ATTRIBUTE_NON_TRANSITIVE: ULONG = 0x00000001; +pub const TRUST_ATTRIBUTE_UPLEVEL_ONLY: ULONG = 0x00000002; +pub const TRUST_ATTRIBUTE_QUARANTINED_DOMAIN: ULONG = 0x00000004; +pub const TRUST_ATTRIBUTE_FOREST_TRANSITIVE: ULONG = 0x00000008; +pub const TRUST_ATTRIBUTE_CROSS_ORGANIZATION: ULONG = 0x00000010; +pub const TRUST_ATTRIBUTE_WITHIN_FOREST: ULONG = 0x00000020; +pub const TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL: ULONG = 0x00000040; +pub const TRUST_ATTRIBUTE_TRUST_USES_RC4_ENCRYPTION: ULONG = 0x00000080; +pub const TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS: ULONG = 0x00000100; +pub const TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION: ULONG = 0x00000200; +pub const TRUST_ATTRIBUTE_PIM_TRUST: ULONG = 0x00000400; +pub const TRUST_ATTRIBUTES_VALID: ULONG = 0xFF03FFFF; +pub const TRUST_ATTRIBUTES_USER: ULONG = 0xFF000000; +STRUCT!{struct TRUSTED_DOMAIN_INFORMATION_EX { + Name: LSA_UNICODE_STRING, + FlatName: LSA_UNICODE_STRING, + Sid: PSID, + TrustDirection: ULONG, + TrustType: ULONG, + TrustAttributes: ULONG, +}} +pub type PTRUSTED_DOMAIN_INFORMATION_EX = *mut TRUSTED_DOMAIN_INFORMATION_EX; +STRUCT!{struct TRUSTED_DOMAIN_INFORMATION_EX2 { + Name: LSA_UNICODE_STRING, + FlatName: LSA_UNICODE_STRING, + Sid: PSID, + TrustDirection: ULONG, + TrustType: ULONG, + TrustAttributes: ULONG, + ForestTrustLength: ULONG, + ForestTrustInfo: PUCHAR, +}} +pub type PTRUSTED_DOMAIN_INFORMATION_EX2 = *mut TRUSTED_DOMAIN_INFORMATION_EX2; +pub const TRUST_AUTH_TYPE_NONE: ULONG = 0; +pub const TRUST_AUTH_TYPE_NT4OWF: ULONG = 1; +pub const TRUST_AUTH_TYPE_CLEAR: ULONG = 2; +pub const TRUST_AUTH_TYPE_VERSION: ULONG = 3; +STRUCT!{struct LSA_AUTH_INFORMATION { + LastUpdateTime: LARGE_INTEGER, + AuthType: ULONG, + AuthInfoLength: ULONG, + AuthInfo: PUCHAR, +}} +pub type PLSA_AUTH_INFORMATION = *mut LSA_AUTH_INFORMATION; +STRUCT!{struct TRUSTED_DOMAIN_AUTH_INFORMATION { + IncomingAuthInfos: ULONG, + IncomingAuthenticationInformation: PLSA_AUTH_INFORMATION, + IncomingPreviousAuthenticationInformation: PLSA_AUTH_INFORMATION, + OutgoingAuthInfos: ULONG, + OutgoingAuthenticationInformation: PLSA_AUTH_INFORMATION, + OutgoingPreviousAuthenticationInformation: PLSA_AUTH_INFORMATION, +}} +pub type PTRUSTED_DOMAIN_AUTH_INFORMATION = *mut TRUSTED_DOMAIN_AUTH_INFORMATION; +STRUCT!{struct TRUSTED_DOMAIN_FULL_INFORMATION { + Information: TRUSTED_DOMAIN_INFORMATION_EX, + PosixOffset: TRUSTED_POSIX_OFFSET_INFO, + AuthInformation: TRUSTED_DOMAIN_AUTH_INFORMATION, +}} +pub type PTRUSTED_DOMAIN_FULL_INFORMATION = *mut TRUSTED_DOMAIN_FULL_INFORMATION; +STRUCT!{struct TRUSTED_DOMAIN_FULL_INFORMATION2 { + Information: TRUSTED_DOMAIN_INFORMATION_EX2, + PosixOffset: TRUSTED_POSIX_OFFSET_INFO, + AuthInformation: TRUSTED_DOMAIN_AUTH_INFORMATION, +}} +pub type PTRUSTED_DOMAIN_FULL_INFORMATION2 = *mut TRUSTED_DOMAIN_FULL_INFORMATION2; +STRUCT!{struct TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES { + SupportedEncryptionTypes: ULONG, +}} +pub type PTRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES = + *mut TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES; +ENUM!{enum LSA_FOREST_TRUST_RECORD_TYPE { + ForestTrustTopLevelName, + ForestTrustTopLevelNameEx, + ForestTrustDomainInfo, + ForestTrustRecordTypeLast = ForestTrustDomainInfo, +}} +pub const LSA_FTRECORD_DISABLED_REASONS: ULONG = 0x0000FFFF; +pub const LSA_TLN_DISABLED_NEW: ULONG = 0x00000001; +pub const LSA_TLN_DISABLED_ADMIN: ULONG = 0x00000002; +pub const LSA_TLN_DISABLED_CONFLICT: ULONG = 0x00000004; +pub const LSA_SID_DISABLED_ADMIN: ULONG = 0x00000001; +pub const LSA_SID_DISABLED_CONFLICT: ULONG = 0x00000002; +pub const LSA_NB_DISABLED_ADMIN: ULONG = 0x00000004; +pub const LSA_NB_DISABLED_CONFLICT: ULONG = 0x00000008; +STRUCT!{struct LSA_FOREST_TRUST_DOMAIN_INFO { + Sid: PSID, + DnsName: LSA_UNICODE_STRING, + NetbiosName: LSA_UNICODE_STRING, +}} +pub type PLSA_FOREST_TRUST_DOMAIN_INFO = *mut LSA_FOREST_TRUST_DOMAIN_INFO; +pub const MAX_FOREST_TRUST_BINARY_DATA_SIZE: SIZE_T = 128 * 1024; +STRUCT!{struct LSA_FOREST_TRUST_BINARY_DATA { + Length: ULONG, + Buffer: PUCHAR, +}} +pub type PLSA_FOREST_TRUST_BINARY_DATA = *mut LSA_FOREST_TRUST_BINARY_DATA; +UNION!{union LSA_FOREST_TRUST_RECORD_FORESTTRUSTDATA { + [u32; 5] [u64; 5], + TopLevelName TopLevelName_mut: LSA_UNICODE_STRING, + DomainInfo DomainInfo_mut: LSA_FOREST_TRUST_DOMAIN_INFO, + Data Data_mut: LSA_FOREST_TRUST_BINARY_DATA, +}} +STRUCT!{struct LSA_FOREST_TRUST_RECORD { + Flags: ULONG, + ForestTrustType: LSA_FOREST_TRUST_RECORD_TYPE, + Time: LARGE_INTEGER, + ForestTrustData: LSA_FOREST_TRUST_RECORD_FORESTTRUSTDATA, +}} +pub type PLSA_FOREST_TRUST_RECORD = *mut LSA_FOREST_TRUST_RECORD; +pub const MAX_RECORDS_IN_FOREST_TRUST_INFO: SIZE_T = 4000; +STRUCT!{struct LSA_FOREST_TRUST_INFORMATION { + RecordCount: ULONG, + Entries: *mut PLSA_FOREST_TRUST_RECORD, +}} +pub type PLSA_FOREST_TRUST_INFORMATION = LSA_FOREST_TRUST_INFORMATION; +ENUM!{enum LSA_FOREST_TRUST_COLLISION_RECORD_TYPE { + CollisionTdo, + CollisionXref, + CollisionOther, +}} +STRUCT!{struct LSA_FOREST_TRUST_COLLISION_RECORD { + Index: ULONG, + Type: LSA_FOREST_TRUST_COLLISION_RECORD_TYPE, + Flags: ULONG, + Name: LSA_UNICODE_STRING, +}} +pub type PLSA_FOREST_TRUST_COLLISION_RECORD = *mut LSA_FOREST_TRUST_COLLISION_RECORD; +STRUCT!{struct LSA_FOREST_TRUST_COLLISION_INFORMATION { + RecordCount: ULONG, + Entries: *mut PLSA_FOREST_TRUST_COLLISION_RECORD, +}} +pub type PLSA_FOREST_TRUST_COLLISION_INFORMATION = *mut LSA_FOREST_TRUST_COLLISION_INFORMATION; +pub const SECRET_SET_VALUE: ULONG = 0x00000001; +pub const SECRET_QUERY_VALUE: ULONG = 0x00000002; +pub const SECRET_ALL_ACCESS: ULONG = STANDARD_RIGHTS_REQUIRED | SECRET_SET_VALUE + | SECRET_QUERY_VALUE; +pub const SECRET_READ: ULONG = STANDARD_RIGHTS_READ | SECRET_QUERY_VALUE; +pub const SECRET_WRITE: ULONG = STANDARD_RIGHTS_WRITE | SECRET_SET_VALUE; +pub const SECRET_EXECUTE: ULONG = STANDARD_RIGHTS_EXECUTE; +pub const LSA_GLOBAL_SECRET_PREFIX: &'static str = "G$"; +pub const LSA_GLOBAL_SECRET_PREFIX_LENGTH: SIZE_T = 2; +pub const LSA_LOCAL_SECRET_PREFIX: &'static str = "L$"; +pub const LSA_LOCAL_SECRET_PREFIX_LENGTH: SIZE_T = 2; +pub const LSA_MACHINE_SECRET_PREFIX: &'static str = "M$"; +pub const LSA_MACHINE_SECRET_PREFIX_LENGTH: SIZE_T = 2; +pub const LSA_SECRET_MAXIMUM_COUNT: SIZE_T = 0x00001000; +pub const LSA_SECRET_MAXIMUM_LENGTH: SIZE_T = 0x00000200; +DECLARE_HANDLE!{LSA_ENUMERATION_HANDLE, __LSA_ENUMERATION_HANDLE} +pub type PLSA_ENUMERATION_HANDLE = *mut LSA_ENUMERATION_HANDLE; +STRUCT!{struct LSA_ENUMERATION_INFORMATION { + Sid: PSID, +}} +pub type PLSA_ENUMERATION_INFORMATION = *mut LSA_ENUMERATION_INFORMATION; +extern "system" { + pub fn LsaFreeMemory( + Buffer: PVOID, + ) -> NTSTATUS; + pub fn LsaClose( + ObjectHandle: LSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaDelete( + ObjectHandle: LSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaQuerySecurityObject( + ObjectHandle: LSA_HANDLE, + SecurityInformation: SECURITY_INFORMATION, + SecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + ) -> NTSTATUS; + pub fn LsaSetSecurityObject( + ObjectHandle: LSA_HANDLE, + SecurityInformation: SECURITY_INFORMATION, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> NTSTATUS; + pub fn LsaChangePassword( + ServerName: PLSA_UNICODE_STRING, + DomainName: PLSA_UNICODE_STRING, + AccountName: PLSA_UNICODE_STRING, + OldPassword: PLSA_UNICODE_STRING, + NewPassword: PLSA_UNICODE_STRING, + ) -> NTSTATUS; +} +STRUCT!{struct LSA_LAST_INTER_LOGON_INFO { + LastSuccessfulLogon: LARGE_INTEGER, + LastFailedLogon: LARGE_INTEGER, + FailedAttemptCountSinceLastSuccessfulLogon: ULONG, +}} +pub type PLSA_LAST_INTER_LOGON_INFO = *mut LSA_LAST_INTER_LOGON_INFO; +STRUCT!{struct SECURITY_LOGON_SESSION_DATA { + Size: ULONG, + LogonId: LUID, + UserName: LSA_UNICODE_STRING, + LogonDomain: LSA_UNICODE_STRING, + AuthenticationPackage: LSA_UNICODE_STRING, + LogonType: ULONG, + Session: ULONG, + Sid: PSID, + LogonTime: LARGE_INTEGER, + LogonServer: LSA_UNICODE_STRING, + DnsDomainName: LSA_UNICODE_STRING, + Upn: LSA_UNICODE_STRING, + UserFlags: ULONG, + LastLogonInfo: LSA_LAST_INTER_LOGON_INFO, + LogonScript: LSA_UNICODE_STRING, + ProfilePath: LSA_UNICODE_STRING, + HomeDirectory: LSA_UNICODE_STRING, + HomeDirectoryDrive: LSA_UNICODE_STRING, + LogoffTime: LARGE_INTEGER, + KickOffTime: LARGE_INTEGER, + PasswordLastSet: LARGE_INTEGER, + PasswordCanChange: LARGE_INTEGER, + PasswordMustChange: LARGE_INTEGER, +}} +pub type PSECURITY_LOGON_SESSION_DATA = *mut SECURITY_LOGON_SESSION_DATA; +extern "system" { + pub fn LsaEnumerateLogonSessions( + LogonSessionCount: PULONG, + LogonSessionList: *mut PLUID, + ) -> NTSTATUS; + pub fn LsaGetLogonSessionData( + LogonId: PLUID, + ppLogonSessionData: *mut PSECURITY_LOGON_SESSION_DATA, + ) -> NTSTATUS; + pub fn LsaOpenPolicy( + SystemName: PLSA_UNICODE_STRING, + ObjectAttributes: PLSA_OBJECT_ATTRIBUTES, + DesiredAccess: ACCESS_MASK, + PolicyHandle: PLSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaOpenPolicySce( + SystemName: PLSA_UNICODE_STRING, + ObjectAttributes: PLSA_OBJECT_ATTRIBUTES, + DesiredAccess: ACCESS_MASK, + PolicyHandle: PLSA_HANDLE, + ) -> NTSTATUS; +} +pub const MAXIMUM_CAPES_PER_CAP: SIZE_T = 0x7F; +pub const CENTRAL_ACCESS_POLICY_OWNER_RIGHTS_PRESENT_FLAG: ULONG = 0x00000001; +pub const CENTRAL_ACCESS_POLICY_STAGED_OWNER_RIGHTS_PRESENT_FLAG: ULONG = 0x00000100; +#[inline] +pub fn STAGING_FLAG(Effective: ULONG) -> ULONG { + (Effective & 0xF) << 8 +} +pub const CENTRAL_ACCESS_POLICY_STAGED_FLAG: ULONG = 0x00010000; +pub const CENTRAL_ACCESS_POLICY_VALID_FLAG_MASK: ULONG = + CENTRAL_ACCESS_POLICY_OWNER_RIGHTS_PRESENT_FLAG + | CENTRAL_ACCESS_POLICY_STAGED_OWNER_RIGHTS_PRESENT_FLAG | CENTRAL_ACCESS_POLICY_STAGED_FLAG; +pub const LSASETCAPS_RELOAD_FLAG: ULONG = 0x00000001; +pub const LSASETCAPS_VALID_FLAG_MASK: ULONG = LSASETCAPS_RELOAD_FLAG; +STRUCT!{struct CENTRAL_ACCESS_POLICY_ENTRY { + Name: LSA_UNICODE_STRING, + Description: LSA_UNICODE_STRING, + ChangeId: LSA_UNICODE_STRING, + LengthAppliesTo: ULONG, + AppliesTo: PUCHAR, + LengthSD: ULONG, + SD: PSECURITY_DESCRIPTOR, + LengthStagedSD: ULONG, + StagedSD: PSECURITY_DESCRIPTOR, + Flags: ULONG, +}} +pub type PCENTRAL_ACCESS_POLICY_ENTRY = *mut CENTRAL_ACCESS_POLICY_ENTRY; +pub type PCCENTRAL_ACCESS_POLICY_ENTRY = *const CENTRAL_ACCESS_POLICY_ENTRY; +STRUCT!{struct CENTRAL_ACCESS_POLICY { + CAPID: PSID, + Name: LSA_UNICODE_STRING, + Description: LSA_UNICODE_STRING, + ChangeId: LSA_UNICODE_STRING, + Flags: ULONG, + CAPECount: ULONG, + CAPEs: *mut PCENTRAL_ACCESS_POLICY_ENTRY, +}} +pub type PCENTRAL_ACCESS_POLICY = *mut CENTRAL_ACCESS_POLICY; +pub type PCCENTRAL_ACCESS_POLICY = *const CENTRAL_ACCESS_POLICY; +extern "system" { + pub fn LsaSetCAPs( + CAPDNs: PLSA_UNICODE_STRING, + CAPDNCount: ULONG, + Flags: ULONG, + ) -> NTSTATUS; + pub fn LsaGetAppliedCAPIDs( + SystemName: PLSA_UNICODE_STRING, + CAPIDs: *mut *mut PSID, + CAPIDCount: PULONG, + ) -> NTSTATUS; + pub fn LsaQueryCAPs( + CAPIDs: *mut PSID, + CAPIDCount: ULONG, + CAPs: *mut PCENTRAL_ACCESS_POLICY, + CAPCount: PULONG, + ) -> NTSTATUS; + pub fn LsaQueryInformationPolicy( + PolicyHandle: LSA_HANDLE, + InformationClass: POLICY_INFORMATION_CLASS, + Buffer: *mut PVOID, + ) -> NTSTATUS; + pub fn LsaSetInformationPolicy( + PolicyHandle: LSA_HANDLE, + InformationClass: POLICY_INFORMATION_CLASS, + Buffer: PVOID, + ) -> NTSTATUS; + pub fn LsaQueryDomainInformationPolicy( + PolicyHandle: LSA_HANDLE, + InformationClass: POLICY_DOMAIN_INFORMATION_CLASS, + Buffer: *mut PVOID, + ) -> NTSTATUS; + pub fn LsaSetDomainInformationPolicy( + PolicyHandle: LSA_HANDLE, + InformationClass: POLICY_DOMAIN_INFORMATION_CLASS, + Buffer: PVOID, + ) -> NTSTATUS; + pub fn LsaRegisterPolicyChangeNotification( + InformationClass: POLICY_NOTIFICATION_INFORMATION_CLASS, + NotifcationEventHandle: HANDLE, + ) -> NTSTATUS; + pub fn LsaUnregisterPolicyChangeNotification( + InformationClass: POLICY_NOTIFICATION_INFORMATION_CLASS, + NotifcationEventHandle: HANDLE, + ) -> NTSTATUS; + pub fn LsaClearAuditLog( + PolicyHandle: LSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaCreateAccount( + PolicyHandle: LSA_HANDLE, + AccountSid: PSID, + DesiredAccess: ACCESS_MASK, + AccountHandle: PLSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaEnumerateAccounts( + PolicyHandle: LSA_HANDLE, + EnumerationContext: PLSA_ENUMERATION_HANDLE, + Buffer: *mut PVOID, + PreferredMaximumLength: ULONG, + CountReturned: PULONG, + ) -> NTSTATUS; + pub fn LsaCreateTrustedDomain( + PolicyHandle: LSA_HANDLE, + TrustedDomainInformation: PLSA_TRUST_INFORMATION, + DesiredAccess: ACCESS_MASK, + TrustedDomainHandle: PLSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaEnumerateTrustedDomains( + PolicyHandle: LSA_HANDLE, + EnumerationContext: PLSA_ENUMERATION_HANDLE, + Buffer: *mut PVOID, + PreferredMaximumLength: ULONG, + CountReturned: PULONG, + ) -> NTSTATUS; + pub fn LsaEnumeratePrivileges( + PolicyHandle: LSA_HANDLE, + EnumerationContext: PLSA_ENUMERATION_HANDLE, + Buffer: *mut PVOID, + PreferredMaximumLength: ULONG, + CountReturned: PULONG, + ) -> NTSTATUS; + pub fn LsaLookupNames( + PolicyHandle: LSA_HANDLE, + Count: ULONG, + Names: PLSA_UNICODE_STRING, + ReferencedDomains: *mut PLSA_REFERENCED_DOMAIN_LIST, + Sids: *mut PLSA_TRANSLATED_SID, + ) -> NTSTATUS; + pub fn LsaLookupNames2( + PolicyHandle: LSA_HANDLE, + Flags: ULONG, + Count: ULONG, + Names: PLSA_UNICODE_STRING, + ReferencedDomains: *mut PLSA_REFERENCED_DOMAIN_LIST, + Sids: *mut PLSA_TRANSLATED_SID2, + ) -> NTSTATUS; + pub fn LsaLookupSids( + PolicyHandle: LSA_HANDLE, + Count: ULONG, + Sids: *mut PSID, + ReferencedDomains: *mut PLSA_REFERENCED_DOMAIN_LIST, + Names: *mut PLSA_TRANSLATED_NAME, + ) -> NTSTATUS; + pub fn LsaLookupSids2( + PolicyHandle: LSA_HANDLE, + LookupOptions: ULONG, + Count: ULONG, + Sids: *mut PSID, + ReferencedDomains: *mut PLSA_REFERENCED_DOMAIN_LIST, + Names: *mut PLSA_TRANSLATED_NAME, + ) -> NTSTATUS; + pub fn LsaCreateSecret( + PolicyHandle: LSA_HANDLE, + SecretName: PLSA_UNICODE_STRING, + DesiredAccess: ACCESS_MASK, + SecretHandle: PLSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaOpenAccount( + PolicyHandle: LSA_HANDLE, + AccountSid: PSID, + DesiredAccess: ACCESS_MASK, + AccountHandle: PLSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaEnumeratePrivilegesOfAccount( + AccountHandle: LSA_HANDLE, + Privileges: *mut PPRIVILEGE_SET, + ) -> NTSTATUS; + pub fn LsaAddPrivilegesToAccount( + AccountHandle: LSA_HANDLE, + Privileges: PPRIVILEGE_SET, + ) -> NTSTATUS; + pub fn LsaRemovePrivilegesFromAccount( + AccountHandle: LSA_HANDLE, + AllPrivileges: BOOLEAN, + Privileges: PPRIVILEGE_SET, + ) -> NTSTATUS; + pub fn LsaGetQuotasForAccount( + AccountHandle: LSA_HANDLE, + QuotaLimits: PQUOTA_LIMITS, + ) -> NTSTATUS; + pub fn LsaSetQuotasForAccount( + AccountHandle: LSA_HANDLE, + QuotaLimits: PQUOTA_LIMITS, + ) -> NTSTATUS; + pub fn LsaGetSystemAccessAccount( + AccountHandle: LSA_HANDLE, + SystemAccess: PULONG, + ) -> NTSTATUS; + pub fn LsaSetSystemAccessAccount( + AccountHandle: LSA_HANDLE, + SystemAccess: ULONG, + ) -> NTSTATUS; + pub fn LsaOpenTrustedDomain( + PolicyHandle: LSA_HANDLE, + TrustedDomainSid: PSID, + DesiredAccess: ACCESS_MASK, + TrustedDomainHandle: PLSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaQueryInfoTrustedDomain( + TrustedDomainHandle: LSA_HANDLE, + InformationClass: TRUSTED_INFORMATION_CLASS, + Buffer: *mut PVOID, + ) -> NTSTATUS; + pub fn LsaSetInformationTrustedDomain( + TrustedDomainHandle: LSA_HANDLE, + InformationClass: TRUSTED_INFORMATION_CLASS, + Buffer: PVOID, + ) -> NTSTATUS; + pub fn LsaOpenSecret( + PolicyHandle: LSA_HANDLE, + SecretName: PLSA_UNICODE_STRING, + DesiredAccess: ACCESS_MASK, + SecretHandle: PLSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaSetSecret( + SecretHandle: LSA_HANDLE, + CurrentValue: PLSA_UNICODE_STRING, + OldValue: PLSA_UNICODE_STRING, + ) -> NTSTATUS; + pub fn LsaQuerySecret( + SecretHandle: LSA_HANDLE, + CurrentValue: *mut PLSA_UNICODE_STRING, + CurrentValueSetTime: PLARGE_INTEGER, + OldValue: *mut PLSA_UNICODE_STRING, + OldValueSetTime: PLARGE_INTEGER, + ) -> NTSTATUS; + pub fn LsaLookupPrivilegeValue( + PolicyHandle: LSA_HANDLE, + Name: PLSA_UNICODE_STRING, + Value: PLUID, + ) -> NTSTATUS; + pub fn LsaLookupPrivilegeName( + PolicyHandle: LSA_HANDLE, + Value: PLUID, + Name: *mut PLSA_UNICODE_STRING, + ) -> NTSTATUS; + pub fn LsaLookupPrivilegeDisplayName( + PolicyHandle: LSA_HANDLE, + Name: PLSA_UNICODE_STRING, + DisplayName: *mut PLSA_UNICODE_STRING, + LanguageReturned: PSHORT, + ) -> NTSTATUS; +} +extern "C" { + pub fn LsaGetUserName( + UserName: *mut PLSA_UNICODE_STRING, + DomainName: *mut PLSA_UNICODE_STRING, + ) -> NTSTATUS; + pub fn LsaGetRemoteUserName( + SystemName: PLSA_UNICODE_STRING, + UserName: *mut PLSA_UNICODE_STRING, + DomainName: *mut PLSA_UNICODE_STRING, + ) -> NTSTATUS; +} +pub const SE_INTERACTIVE_LOGON_NAME: &'static str = "SeInteractiveLogonRight"; +pub const SE_NETWORK_LOGON_NAME: &'static str = "SeNetworkLogonRight"; +pub const SE_BATCH_LOGON_NAME: &'static str = "SeBatchLogonRight"; +pub const SE_SERVICE_LOGON_NAME: &'static str = "SeServiceLogonRight"; +pub const SE_DENY_INTERACTIVE_LOGON_NAME: &'static str = "SeDenyInteractiveLogonRight"; +pub const SE_DENY_NETWORK_LOGON_NAME: &'static str = "SeDenyNetworkLogonRight"; +pub const SE_DENY_BATCH_LOGON_NAME: &'static str = "SeDenyBatchLogonRight"; +pub const SE_DENY_SERVICE_LOGON_NAME: &'static str = "SeDenyServiceLogonRight"; +pub const SE_REMOTE_INTERACTIVE_LOGON_NAME: &'static str = "SeRemoteInteractiveLogonRight"; +pub const SE_DENY_REMOTE_INTERACTIVE_LOGON_NAME: &'static str = + "SeDenyRemoteInteractiveLogonRight"; +extern "system" { + pub fn LsaEnumerateAccountsWithUserRight( + PolictHandle: LSA_HANDLE, + UserRights: PLSA_UNICODE_STRING, + EnumerationBuffer: *mut PVOID, + CountReturned: PULONG, + ) -> NTSTATUS; + pub fn LsaEnumerateAccountRights( + PolicyHandle: LSA_HANDLE, + AccountSid: PSID, + UserRights: *mut PLSA_UNICODE_STRING, + CountOfRights: PULONG, + ) -> NTSTATUS; + pub fn LsaAddAccountRights( + PolicyHandle: LSA_HANDLE, + AccountSid: PSID, + UserRights: PLSA_UNICODE_STRING, + CountOfRights: ULONG, + ) -> NTSTATUS; + pub fn LsaRemoveAccountRights( + PolicyHandle: LSA_HANDLE, + AccountSid: PSID, + AllRights: BOOLEAN, + UserRights: PLSA_UNICODE_STRING, + CountOfRights: ULONG, + ) -> NTSTATUS; + pub fn LsaOpenTrustedDomainByName( + PolicyHandle: LSA_HANDLE, + TrustedDomainName: PLSA_UNICODE_STRING, + DesiredAccess: ACCESS_MASK, + TrustedDomainHandle: PLSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaQueryTrustedDomainInfo( + PolicyHandle: LSA_HANDLE, + TrustedDomainSid: PSID, + InformationClass: TRUSTED_INFORMATION_CLASS, + Buffer: *mut PVOID, + ) -> NTSTATUS; + pub fn LsaSetTrustedDomainInformation( + PolicyHandle: LSA_HANDLE, + TrustedDomainSid: PSID, + InformationClass: TRUSTED_INFORMATION_CLASS, + Buffer: PVOID, + ) -> NTSTATUS; + pub fn LsaDeleteTrustedDomain( + PolicyHandle: LSA_HANDLE, + TrustedDomainSid: PSID, + ) -> NTSTATUS; + pub fn LsaQueryTrustedDomainInfoByName( + PolicyHandle: LSA_HANDLE, + TrustedDomainName: PLSA_UNICODE_STRING, + InformationClass: TRUSTED_INFORMATION_CLASS, + Buffer: *mut PVOID, + ) -> NTSTATUS; + pub fn LsaSetTrustedDomainInfoByName( + PolicyHandle: LSA_HANDLE, + TrustedDomainName: PLSA_UNICODE_STRING, + InformationClass: TRUSTED_INFORMATION_CLASS, + Buffer: PVOID, + ) -> NTSTATUS; + pub fn LsaEnumerateTrustedDomainsEx( + PolicyHandle: LSA_HANDLE, + EnumerationContext: PLSA_ENUMERATION_HANDLE, + Buffer: *mut PVOID, + PreferredMaximumLength: ULONG, + CountReturned: PULONG, + ) -> NTSTATUS; + pub fn LsaCreateTrustedDomainEx( + PolicyHandle: LSA_HANDLE, + TrustedDomainInformation: PTRUSTED_DOMAIN_INFORMATION_EX, + AuthenticationInformation: PTRUSTED_DOMAIN_AUTH_INFORMATION, + DesiredAccess: ACCESS_MASK, + TrustedDomainHandle: PLSA_HANDLE, + ) -> NTSTATUS; + pub fn LsaQueryForestTrustInformation( + PolicyHandle: LSA_HANDLE, + TrustedDomainName: PLSA_UNICODE_STRING, + ForestTrustInfo: *mut PLSA_FOREST_TRUST_INFORMATION, + ) -> NTSTATUS; + pub fn LsaSetForestTrustInformation( + PolicyHandle: LSA_HANDLE, + TrustedDomainName: PLSA_UNICODE_STRING, + ForestTrustInfo: PLSA_FOREST_TRUST_INFORMATION, + CheckOnly: BOOLEAN, + CollisionInfo: *mut PLSA_FOREST_TRUST_COLLISION_INFORMATION, + ) -> NTSTATUS; + pub fn LsaForestTrustFindMatch( + PolicyHandle: LSA_HANDLE, + Type: ULONG, + Name: PLSA_UNICODE_STRING, + Match: *mut PLSA_UNICODE_STRING, + ) -> NTSTATUS; + pub fn LsaStorePrivateData( + PolicyHandle: LSA_HANDLE, + KeyName: PLSA_UNICODE_STRING, + PrivateData: PLSA_UNICODE_STRING, + ) -> NTSTATUS; + pub fn LsaRetrievePrivateData( + PolicyHandle: LSA_HANDLE, + KeyName: PLSA_UNICODE_STRING, + PrivateData: *mut PLSA_UNICODE_STRING, + ) -> NTSTATUS; + pub fn LsaNtStatusToWinError( + Status: NTSTATUS, + ) -> ULONG; +} +ENUM!{enum NEGOTIATE_MESSAGES { + NegEnumPackagePrefixes = 0, + NegGetCallerName = 1, + NegTransferCredentials = 2, + NegEnumPackageNames = 3, + NegCallPackageMax, +}} +pub const NEGOTIATE_MAX_PREFIX: SIZE_T = 32; +STRUCT!{struct NEGOTIATE_PACKAGE_PREFIX { + PackageId: ULONG_PTR, + PackageDataA: PVOID, + PackageDataW: PVOID, + PrefixLen: ULONG_PTR, + Prefix: [UCHAR; NEGOTIATE_MAX_PREFIX], +}} +pub type PNEGOTIATE_PACKAGE_PREFIX = *mut NEGOTIATE_PACKAGE_PREFIX; +STRUCT!{struct NEGOTIATE_PACKAGE_PREFIXES { + MessageType: ULONG, + PrefixCount: ULONG, + Offset: ULONG, + Pad: ULONG, +}} +pub type PNEGOTIATE_PACKAGE_PREFIXES = *mut NEGOTIATE_PACKAGE_PREFIXES; +STRUCT!{struct NEGOTIATE_CALLER_NAME_REQUEST { + MessageType: ULONG, + LogonId: LUID, +}} +pub type PNEGOTIATE_CALLER_NAME_REQUEST = *mut NEGOTIATE_CALLER_NAME_REQUEST; +STRUCT!{struct NEGOTIATE_CALLER_NAME_RESPONSE { + Messagetype: ULONG, + CallerName: PWSTR, +}} +pub type PNEGOTIATE_CALLER_NAME_RESPONSE = *mut NEGOTIATE_CALLER_NAME_RESPONSE; +STRUCT!{struct NEGOTIATE_PACKAGE_NAMES { + NamesCount: ULONG, + Names: [UNICODE_STRING; ANYSIZE_ARRAY], +}} +pub type PNEGOTIATE_PACKAGE_NAMES = *mut NEGOTIATE_PACKAGE_NAMES; +pub const NEGOTIATE_ALLOW_NTLM: ULONG = 0x10000000; +pub const NEGOTIATE_NEG_NTLM: ULONG = 0x20000000; +STRUCT!{struct NEGOTIATE_PACKAGE_PREFIX_WOW { + PackageId: ULONG, + PackageDataA: ULONG, + PackageDataW: ULONG, + PrefixLen: ULONG, + Prefix: [UCHAR; NEGOTIATE_MAX_PREFIX], +}} +pub type PNEGOTIATE_PACKAGE_PREFIX_WOW = *mut NEGOTIATE_PACKAGE_PREFIX_WOW; +STRUCT!{struct NEGOTIATE_CALLER_NAME_RESPONSE_WOW { + MessageType: ULONG, + CallerName: ULONG, +}} +pub type PNEGOTIATE_CALLER_NAME_RESPONSE_WOW = *mut NEGOTIATE_CALLER_NAME_RESPONSE_WOW; +extern "system" { + pub fn LsaSetPolicyReplicationHandle( + PolicyHandle: PLSA_HANDLE, + ) -> NTSTATUS; +} +pub const MAX_USER_RECORDS: SIZE_T = 1000; +STRUCT!{struct LSA_USER_REGISTRATION_INFO { + Sid: LSA_UNICODE_STRING, + DeviceId: LSA_UNICODE_STRING, + Username: LSA_UNICODE_STRING, + Thumbprint: LSA_UNICODE_STRING, + RegistrationTime: LARGE_INTEGER, +}} +pub type PLSA_USER_REGISTRATION_INFO = *mut LSA_USER_REGISTRATION_INFO; +STRUCT!{struct LSA_REGISTRATION_INFO { + RegisteredCount: ULONG, + UserRegistrationInfo: *mut PLSA_USER_REGISTRATION_INFO, +}} +pub type PLSA_REGISTRATION_INFO = *mut LSA_REGISTRATION_INFO; +extern "system" { + pub fn LsaGetDeviceRegistrationInfo( + RegistrationInfo: *mut PLSA_REGISTRATION_INFO, + ) -> NTSTATUS; +} +ENUM!{enum LSA_CREDENTIAL_KEY_SOURCE_TYPE { + eFromPrecomputed = 1, + eFromClearPassword, + eFromNtOwf, +}} +pub type PLSA_CREDENTIAL_KEY_SOURCE_TYPE = *mut LSA_CREDENTIAL_KEY_SOURCE_TYPE; +extern "C" { + pub fn SeciIsProtectedUser( + ProtectedUser: PBOOLEAN, + ) -> NTSTATUS; +} diff --git a/bash-5.1/vendor/winapi/src/um/ntsecapi.rs b/bash-5.1/vendor/winapi/src/um/ntsecapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..cf30ea9291d16899e84128f93e3d4fa4b3f44de1 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ntsecapi.rs @@ -0,0 +1,1728 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module defines the Local Security Authority APIs. +use shared::basetsd::{ULONG64, ULONG_PTR}; +use shared::guiddef::GUID; +use shared::minwindef::{PUCHAR, PULONG, UCHAR, ULONG, USHORT}; +use shared::ntdef::NTSTATUS; +use shared::sspi::SecHandle; +use um::lsalookup::{ + LSA_TRUST_INFORMATION, LSA_UNICODE_STRING, PLSA_TRUST_INFORMATION, PLSA_UNICODE_STRING +}; +use um::subauth::{PUNICODE_STRING, STRING, UNICODE_STRING}; +use um::winnt::{ + ACCESS_MASK, ANYSIZE_ARRAY, BOOLEAN, HANDLE, LARGE_INTEGER, LONG, LUID, PACL, PCSTR, PCWSTR, + PSECURITY_DESCRIPTOR, PSID, PSTR, PVOID, PWSTR, QUOTA_LIMITS, SECURITY_INFORMATION, SHORT, SID, + SID_NAME_USE, STANDARD_RIGHTS_EXECUTE, STANDARD_RIGHTS_READ, STANDARD_RIGHTS_REQUIRED, + STANDARD_RIGHTS_WRITE, ULONGLONG +}; +DEFINE_GUID!{Audit_System_SecurityStateChange, + 0x0cce9210, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_System_SecuritySubsystemExtension, + 0x0cce9211, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_System_Integrity, + 0x0cce9212, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_System_IPSecDriverEvents, + 0x0cce9213, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_System_Others, + 0x0cce9214, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon_Logon, + 0x0cce9215, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon_Logoff, + 0x0cce9216, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon_AccountLockout, + 0x0cce9217, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon_IPSecMainMode, + 0x0cce9218, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon_IPSecQuickMode, + 0x0cce9219, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon_IPSecUserMode, + 0x0cce921a, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon_SpecialLogon, + 0x0cce921b, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon_Others, + 0x0cce921c, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_FileSystem, + 0x0cce921d, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_Registry, + 0x0cce921e, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_Kernel, + 0x0cce921f, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_Sam, + 0x0cce9220, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_CertificationServices, + 0x0cce9221, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_ApplicationGenerated, + 0x0cce9222, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_Handle, + 0x0cce9223, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_Share, + 0x0cce9224, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_FirewallPacketDrops, + 0x0cce9225, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_FirewallConnection, + 0x0cce9226, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_Other, + 0x0cce9227, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PrivilegeUse_Sensitive, + 0x0cce9228, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PrivilegeUse_NonSensitive, + 0x0cce9229, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PrivilegeUse_Others, + 0x0cce922a, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_DetailedTracking_ProcessCreation, + 0x0cce922b, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_DetailedTracking_ProcessTermination, + 0x0cce922c, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_DetailedTracking_DpapiActivity, + 0x0cce922d, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_DetailedTracking_RpcCall, + 0x0cce922e, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PolicyChange_AuditPolicy, + 0x0cce922f, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PolicyChange_AuthenticationPolicy, + 0x0cce9230, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PolicyChange_AuthorizationPolicy, + 0x0cce9231, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PolicyChange_MpsscvRulePolicy, + 0x0cce9232, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PolicyChange_WfpIPSecPolicy, + 0x0cce9233, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PolicyChange_Others, + 0x0cce9234, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountManagement_UserAccount, + 0x0cce9235, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountManagement_ComputerAccount, + 0x0cce9236, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountManagement_SecurityGroup, + 0x0cce9237, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountManagement_DistributionGroup, + 0x0cce9238, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountManagement_ApplicationGroup, + 0x0cce9239, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountManagement_Others, + 0x0cce923a, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_DSAccess_DSAccess, + 0x0cce923b, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_DsAccess_AdAuditChanges, + 0x0cce923c, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Ds_Replication, + 0x0cce923d, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Ds_DetailedReplication, + 0x0cce923e, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountLogon_CredentialValidation, + 0x0cce923f, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountLogon_Kerberos, + 0x0cce9240, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountLogon_Others, + 0x0cce9241, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountLogon_KerbCredentialValidation, + 0x0cce9242, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon_NPS, + 0x0cce9243, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_DetailedFileShare, + 0x0cce9244, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_RemovableStorage, + 0x0cce9245, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess_CbacStaging, + 0x0cce9246, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon_Claims, + 0x0cce9247, 0x69ae, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_System, + 0x69979848, 0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_Logon, + 0x69979849, 0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_ObjectAccess, + 0x6997984a, 0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PrivilegeUse, + 0x6997984b, 0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_DetailedTracking, + 0x6997984c, 0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_PolicyChange, + 0x6997984d, 0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountManagement, + 0x6997984e, 0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_DirectoryServiceAccess, + 0x6997984f, 0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +DEFINE_GUID!{Audit_AccountLogon, + 0x69979850, 0x797a, 0x11d9, 0xbe, 0xd3, 0x50, 0x50, 0x54, 0x50, 0x30, 0x30} +ENUM!{enum POLICY_AUDIT_EVENT_TYPE { + AuditCategorySystem = 0, + AuditCategoryLogon, + AuditCategoryObjectAccess, + AuditCategoryPrivilegeUse, + AuditCategoryDetailedTracking, + AuditCategoryPolicyChange, + AuditCategoryAccountManagement, + AuditCategoryDirectoryServiceAccess, + AuditCategoryAccountLogon, +}} +pub type PPOLICY_AUDIT_EVENT_TYPE = *mut POLICY_AUDIT_EVENT_TYPE; +pub const POLICY_AUDIT_EVENT_UNCHANGED: POLICY_AUDIT_EVENT_OPTIONS = 0x00000000; +pub const POLICY_AUDIT_EVENT_SUCCESS: POLICY_AUDIT_EVENT_OPTIONS = 0x00000001; +pub const POLICY_AUDIT_EVENT_FAILURE: POLICY_AUDIT_EVENT_OPTIONS = 0x00000002; +pub const POLICY_AUDIT_EVENT_NONE: POLICY_AUDIT_EVENT_OPTIONS = 0x00000004; +pub const POLICY_AUDIT_EVENT_MASK: POLICY_AUDIT_EVENT_OPTIONS = POLICY_AUDIT_EVENT_SUCCESS + | POLICY_AUDIT_EVENT_FAILURE | POLICY_AUDIT_EVENT_UNCHANGED | POLICY_AUDIT_EVENT_NONE; +pub const POLICY_VIEW_LOCAL_INFORMATION: ACCESS_MASK = 0x00000001; +pub const POLICY_VIEW_AUDIT_INFORMATION: ACCESS_MASK = 0x00000002; +pub const POLICY_GET_PRIVATE_INFORMATION: ACCESS_MASK = 0x00000004; +pub const POLICY_TRUST_ADMIN: ACCESS_MASK = 0x00000008; +pub const POLICY_CREATE_ACCOUNT: ACCESS_MASK = 0x00000010; +pub const POLICY_CREATE_SECRET: ACCESS_MASK = 0x00000020; +pub const POLICY_CREATE_PRIVILEGE: ACCESS_MASK = 0x00000040; +pub const POLICY_SET_DEFAULT_QUOTA_LIMITS: ACCESS_MASK = 0x00000080; +pub const POLICY_SET_AUDIT_REQUIREMENTS: ACCESS_MASK = 0x00000100; +pub const POLICY_AUDIT_LOG_ADMIN: ACCESS_MASK = 0x00000200; +pub const POLICY_SERVER_ADMIN: ACCESS_MASK = 0x00000400; +pub const POLICY_LOOKUP_NAMES: ACCESS_MASK = 0x00000800; +pub const POLICY_NOTIFICATION: ACCESS_MASK = 0x00001000; +pub const POLICY_ALL_ACCESS: ACCESS_MASK = STANDARD_RIGHTS_REQUIRED + | POLICY_VIEW_LOCAL_INFORMATION | POLICY_VIEW_AUDIT_INFORMATION + | POLICY_GET_PRIVATE_INFORMATION | POLICY_TRUST_ADMIN | POLICY_CREATE_ACCOUNT + | POLICY_CREATE_SECRET | POLICY_CREATE_PRIVILEGE | POLICY_SET_DEFAULT_QUOTA_LIMITS + | POLICY_SET_AUDIT_REQUIREMENTS | POLICY_AUDIT_LOG_ADMIN | POLICY_SERVER_ADMIN + | POLICY_LOOKUP_NAMES; +pub const POLICY_READ: ACCESS_MASK = STANDARD_RIGHTS_READ | POLICY_VIEW_AUDIT_INFORMATION + | POLICY_GET_PRIVATE_INFORMATION; +pub const POLICY_WRITE: ACCESS_MASK = STANDARD_RIGHTS_WRITE | POLICY_TRUST_ADMIN + | POLICY_CREATE_ACCOUNT | POLICY_CREATE_SECRET | POLICY_CREATE_PRIVILEGE + | POLICY_SET_DEFAULT_QUOTA_LIMITS | POLICY_SET_AUDIT_REQUIREMENTS | POLICY_AUDIT_LOG_ADMIN + | POLICY_SERVER_ADMIN; +pub const POLICY_EXECUTE: ACCESS_MASK = STANDARD_RIGHTS_EXECUTE + | POLICY_VIEW_LOCAL_INFORMATION | POLICY_LOOKUP_NAMES; +STRUCT!{struct LSA_TRANSLATED_SID { + Use: SID_NAME_USE, + RelativeId: ULONG, + DomainIndex: LONG, +}} +pub type PLSA_TRANSLATED_SID = *mut LSA_TRANSLATED_SID; +ENUM!{enum POLICY_LSA_SERVER_ROLE { + PolicyServerRoleBackup = 2, + PolicyServerRolePrimary, +}} +pub type PPOLICY_LSA_SERVER_ROLE = *mut POLICY_LSA_SERVER_ROLE; +pub type POLICY_AUDIT_EVENT_OPTIONS = ULONG; +pub type PPOLICY_AUDIT_EVENT_OPTIONS = *mut ULONG; +ENUM!{enum POLICY_INFORMATION_CLASS { + PolicyAuditLogInformation = 1, + PolicyAuditEventsInformation, + PolicyPrimaryDomainInformation, + PolicyPdAccountInformation, + PolicyAccountDomainInformation, + PolicyLsaServerRoleInformation, + PolicyReplicaSourceInformation, + PolicyDefaultQuotaInformation, + PolicyModificationInformation, + PolicyAuditFullSetInformation, + PolicyAuditFullQueryInformation, + PolicyDnsDomainInformation, + PolicyDnsDomainInformationInt, + PolicyLocalAccountDomainInformation, + PolicyLastEntry, +}} +pub type PPOLICY_INFORMATION_CLASS = *mut POLICY_INFORMATION_CLASS; +STRUCT!{struct POLICY_AUDIT_LOG_INFO { + AuditLogPercentFull: ULONG, + MaximumLogSize: ULONG, + AuditRetentionPeriod: LARGE_INTEGER, + AuditLogFullShutdownInProgress: BOOLEAN, + TimeToShutdown: LARGE_INTEGER, + NextAuditRecordId: ULONG, +}} +pub type PPOLICY_AUDIT_LOG_INFO = *mut POLICY_AUDIT_LOG_INFO; +STRUCT!{struct POLICY_AUDIT_EVENTS_INFO { + AuditingMode: BOOLEAN, + EventAuditingOptions: PPOLICY_AUDIT_EVENT_OPTIONS, + MaximumAuditEventCount: ULONG, +}} +pub type PPOLICY_AUDIT_EVENTS_INFO = *mut POLICY_AUDIT_EVENTS_INFO; +STRUCT!{struct POLICY_AUDIT_SUBCATEGORIES_INFO { + MaximumSubCategoryCount: ULONG, + EventAuditingOptions: PPOLICY_AUDIT_EVENT_OPTIONS, +}} +pub type PPOLICY_AUDIT_SUBCATEGORIES_INFO = *mut POLICY_AUDIT_SUBCATEGORIES_INFO; +STRUCT!{struct POLICY_AUDIT_CATEGORIES_INFO { + MaximumSubCategoryCount: ULONG, + SubCategoriesInfo: PPOLICY_AUDIT_SUBCATEGORIES_INFO, +}} +pub type PPOLICY_AUDIT_CATEGORIES_INFO = *mut POLICY_AUDIT_CATEGORIES_INFO; +pub const PER_USER_POLICY_UNCHANGED: ULONG = 0x00; +pub const PER_USER_AUDIT_SUCCESS_INCLUDE: ULONG = 0x01; +pub const PER_USER_AUDIT_SUCCESS_EXCLUDE: ULONG = 0x02; +pub const PER_USER_AUDIT_FAILURE_INCLUDE: ULONG = 0x04; +pub const PER_USER_AUDIT_FAILURE_EXCLUDE: ULONG = 0x08; +pub const PER_USER_AUDIT_NONE: ULONG = 0x10; +pub const VALID_PER_USER_AUDIT_POLICY_FLAG: ULONG = PER_USER_AUDIT_SUCCESS_INCLUDE + | PER_USER_AUDIT_SUCCESS_EXCLUDE | PER_USER_AUDIT_FAILURE_INCLUDE + | PER_USER_AUDIT_FAILURE_EXCLUDE | PER_USER_AUDIT_NONE; +STRUCT!{struct POLICY_PRIMARY_DOMAIN_INFO { + Name: LSA_UNICODE_STRING, + Sid: PSID, +}} +pub type PPOLICY_PRIMARY_DOMAIN_INFO = *mut POLICY_PRIMARY_DOMAIN_INFO; +STRUCT!{struct POLICY_PD_ACCOUNT_INFO { + Name: LSA_UNICODE_STRING, +}} +pub type PPOLICY_PD_ACCOUNT_INFO = *mut POLICY_PD_ACCOUNT_INFO; +STRUCT!{struct POLICY_LSA_SERVER_ROLE_INFO { + LsaServerRole: POLICY_LSA_SERVER_ROLE, +}} +pub type PPOLICY_LSA_SERVER_ROLE_INFO = *mut POLICY_LSA_SERVER_ROLE_INFO; +STRUCT!{struct POLICY_REPLICA_SOURCE_INFO { + ReplicaSource: LSA_UNICODE_STRING, + ReplicaAccountName: LSA_UNICODE_STRING, +}} +pub type PPOLICY_REPLICA_SOURCE_INFO = *mut POLICY_REPLICA_SOURCE_INFO; +STRUCT!{struct POLICY_DEFAULT_QUOTA_INFO { + QuotaLimits: QUOTA_LIMITS, +}} +pub type PPOLICY_DEFAULT_QUOTA_INFO = *mut POLICY_DEFAULT_QUOTA_INFO; +STRUCT!{struct POLICY_MODIFICATION_INFO { + ModifiedId: LARGE_INTEGER, + DatabaseCreationTime: LARGE_INTEGER, +}} +pub type PPOLICY_MODIFICATION_INFO = *mut POLICY_MODIFICATION_INFO; +STRUCT!{struct POLICY_AUDIT_FULL_SET_INFO { + ShutDownOnFull: BOOLEAN, +}} +pub type PPOLICY_AUDIT_FULL_SET_INFO = *mut POLICY_AUDIT_FULL_SET_INFO; +STRUCT!{struct POLICY_AUDIT_FULL_QUERY_INFO { + ShutDownOnFull: BOOLEAN, + LogIsFull: BOOLEAN, +}} +pub type PPOLICY_AUDIT_FULL_QUERY_INFO = *mut POLICY_AUDIT_FULL_QUERY_INFO; +ENUM!{enum POLICY_DOMAIN_INFORMATION_CLASS { + PolicyDomainEfsInformation = 2, + PolicyDomainKerberosTicketInformation, +}} +pub type PPOLICY_DOMAIN_INFORMATION_CLASS = *mut POLICY_DOMAIN_INFORMATION_CLASS; +STRUCT!{struct POLICY_DOMAIN_EFS_INFO { + InfoLength: ULONG, + EfsBlob: PUCHAR, +}} +pub type PPOLICY_DOMAIN_EFS_INFO = *mut POLICY_DOMAIN_EFS_INFO; +STRUCT!{struct POLICY_DOMAIN_KERBEROS_TICKET_INFO { + AuthenticationOptions: ULONG, + MaxServiceTicketAge: LARGE_INTEGER, + MaxTicketAge: LARGE_INTEGER, + MaxRenewAge: LARGE_INTEGER, + MaxClockSkew: LARGE_INTEGER, + Reserved: LARGE_INTEGER, +}} +pub type PPOLICY_DOMAIN_KERBEROS_TICKET_INFO = *mut POLICY_DOMAIN_KERBEROS_TICKET_INFO; +ENUM!{enum POLICY_NOTIFICATION_INFORMATION_CLASS { + PolicyNotifyAuditEventsInformation = 1, + PolicyNotifyAccountDomainInformation, + PolicyNotifyServerRoleInformation, + PolicyNotifyDnsDomainInformation, + PolicyNotifyDomainEfsInformation, + PolicyNotifyDomainKerberosTicketInformation, + PolicyNotifyMachineAccountPasswordInformation, + PolicyNotifyGlobalSaclInformation, + PolicyNotifyMax, +}} +pub type PPOLICY_NOTIFICATION_INFORMATION_CLASS = *mut POLICY_NOTIFICATION_INFORMATION_CLASS; +pub type LSA_HANDLE = PVOID; +pub type PLSA_HANDLE = *mut PVOID; +ENUM!{enum TRUSTED_INFORMATION_CLASS { + TrustedDomainNameInformation = 1, + TrustedControllersInformation, + TrustedPosixOffsetInformation, + TrustedPasswordInformation, + TrustedDomainInformationBasic, + TrustedDomainInformationEx, + TrustedDomainAuthInformation, + TrustedDomainFullInformation, + TrustedDomainAuthInformationInternal, + TrustedDomainFullInformationInternal, + TrustedDomainInformationEx2Internal, + TrustedDomainFullInformation2Internal, + TrustedDomainSupportedEncryptionTypes, +}} +pub type PTRUSTED_INFORMATION_CLASS = *mut TRUSTED_INFORMATION_CLASS; +STRUCT!{struct TRUSTED_DOMAIN_NAME_INFO { + Name: LSA_UNICODE_STRING, +}} +pub type PTRUSTED_DOMAIN_NAME_INFO = *mut TRUSTED_DOMAIN_NAME_INFO; +STRUCT!{struct TRUSTED_CONTROLLERS_INFO { + Entries: ULONG, + Names: PLSA_UNICODE_STRING, +}} +pub type PTRUSTED_CONTROLLERS_INFO = *mut TRUSTED_CONTROLLERS_INFO; +STRUCT!{struct TRUSTED_POSIX_OFFSET_INFO { + Offset: ULONG, +}} +pub type PTRUSTED_POSIX_OFFSET_INFO = *mut TRUSTED_POSIX_OFFSET_INFO; +STRUCT!{struct TRUSTED_PASSWORD_INFO { + Password: LSA_UNICODE_STRING, + OldPassword: LSA_UNICODE_STRING, +}} +pub type PTRUSTED_PASSWORD_INFO = *mut TRUSTED_PASSWORD_INFO; +pub type TRUSTED_DOMAIN_INFORMATION_BASIC = LSA_TRUST_INFORMATION; +pub type PTRUSTED_DOMAIN_INFORMATION_BASIC = PLSA_TRUST_INFORMATION; +pub const TRUST_DIRECTION_DISABLED: ULONG = 0x00000000; +pub const TRUST_DIRECTION_INBOUND: ULONG = 0x00000001; +pub const TRUST_DIRECTION_OUTBOUND: ULONG = 0x00000002; +pub const TRUST_DIRECTION_BIDIRECTIONAL: ULONG = TRUST_DIRECTION_INBOUND + | TRUST_DIRECTION_OUTBOUND; +pub const TRUST_TYPE_DOWNLEVEL: ULONG = 0x00000001; +pub const TRUST_TYPE_UPLEVEL: ULONG = 0x00000002; +pub const TRUST_TYPE_MIT: ULONG = 0x00000003; +pub const TRUST_ATTRIBUTE_NON_TRANSITIVE: ULONG = 0x00000001; +pub const TRUST_ATTRIBUTE_UPLEVEL_ONLY: ULONG = 0x00000002; +pub const TRUST_ATTRIBUTE_QUARANTINED_DOMAIN: ULONG = 0x00000004; +pub const TRUST_ATTRIBUTE_FOREST_TRANSITIVE: ULONG = 0x00000008; +pub const TRUST_ATTRIBUTE_CROSS_ORGANIZATION: ULONG = 0x00000010; +pub const TRUST_ATTRIBUTE_WITHIN_FOREST: ULONG = 0x00000020; +pub const TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL: ULONG = 0x00000040; +pub const TRUST_ATTRIBUTE_TRUST_USES_RC4_ENCRYPTION: ULONG = 0x00000080; +pub const TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS: ULONG = 0x00000100; +pub const TRUST_ATTRIBUTE_CROSS_ORGANIZATION_NO_TGT_DELEGATION: ULONG = 0x00000200; +pub const TRUST_ATTRIBUTES_VALID: ULONG = 0xFF03FFFF; +pub const TRUST_ATTRIBUTES_USER: ULONG = 0xFF000000; +STRUCT!{struct TRUSTED_DOMAIN_INFORMATION_EX { + Name: LSA_UNICODE_STRING, + FlatName: LSA_UNICODE_STRING, + Sid: PSID, + TrustDirection: ULONG, + TrustType: ULONG, + TrustAttributes: ULONG, +}} +pub type PTRUSTED_DOMAIN_INFORMATION_EX = *mut TRUSTED_DOMAIN_INFORMATION_EX; +STRUCT!{struct TRUSTED_DOMAIN_INFORMATION_EX2 { + Name: LSA_UNICODE_STRING, + FlatName: LSA_UNICODE_STRING, + Sid: PSID, + TrustDirection: ULONG, + TrustType: ULONG, + TrustAttributes: ULONG, + ForestTrustLength: ULONG, + ForestTrustInfo: PUCHAR, +}} +pub type PTRUSTED_DOMAIN_INFORMATION_EX2 = *mut TRUSTED_DOMAIN_INFORMATION_EX2; +pub const TRUST_AUTH_TYPE_NONE: ULONG = 0; +pub const TRUST_AUTH_TYPE_NT4OWF: ULONG = 1; +pub const TRUST_AUTH_TYPE_CLEAR: ULONG = 2; +pub const TRUST_AUTH_TYPE_VERSION: ULONG = 3; +STRUCT!{struct LSA_AUTH_INFORMATION { + LastUpdateTime: LARGE_INTEGER, + AuthType: ULONG, + AuthInfoLength: ULONG, + AuthInfo: PUCHAR, +}} +pub type PLSA_AUTH_INFORMATION = *mut LSA_AUTH_INFORMATION; +STRUCT!{struct TRUSTED_DOMAIN_AUTH_INFORMATION { + IncomingAuthInfos: ULONG, + IncomingAuthenticationInformation: PLSA_AUTH_INFORMATION, + IncomingPreviousAuthenticationInformation: PLSA_AUTH_INFORMATION, + OutgoingAuthInfos: ULONG, + OutgoingAuthenticationInformation: PLSA_AUTH_INFORMATION, + OutgoingPreviousAuthenticationInformation: PLSA_AUTH_INFORMATION, +}} +pub type PTRUSTED_DOMAIN_AUTH_INFORMATION = *mut TRUSTED_DOMAIN_AUTH_INFORMATION; +STRUCT!{struct TRUSTED_DOMAIN_FULL_INFORMATION { + Information: TRUSTED_DOMAIN_INFORMATION_EX, + PosixOffset: TRUSTED_POSIX_OFFSET_INFO, + AuthInformation: TRUSTED_DOMAIN_AUTH_INFORMATION, +}} +pub type PTRUSTED_DOMAIN_FULL_INFORMATION = *mut TRUSTED_DOMAIN_FULL_INFORMATION; +STRUCT!{struct TRUSTED_DOMAIN_FULL_INFORMATION2 { + Information: TRUSTED_DOMAIN_INFORMATION_EX2, + PosixOffset: TRUSTED_POSIX_OFFSET_INFO, + AuthInformation: TRUSTED_DOMAIN_AUTH_INFORMATION, +}} +pub type PTRUSTED_DOMAIN_FULL_INFORMATION2 = *mut TRUSTED_DOMAIN_FULL_INFORMATION2; +STRUCT!{struct TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES { + SupportedEncryptionTypes: ULONG, +}} +pub type PTRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES = + *mut TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES; +ENUM!{enum LSA_FOREST_TRUST_RECORD_TYPE { + ForestTrustTopLevelName, + ForestTrustTopLevelNameEx, + ForestTrustDomainInfo, + ForestTrustRecordTypeLast, // = ForestTrustDomainInfo, +}} +pub const LSA_FTRECORD_DISABLED_REASONS: ULONG = 0x0000FFFF; +pub const LSA_TLN_DISABLED_NEW: ULONG = 0x00000001; +pub const LSA_TLN_DISABLED_ADMIN: ULONG = 0x00000002; +pub const LSA_TLN_DISABLED_CONFLICT: ULONG = 0x00000004; +pub const LSA_SID_DISABLED_ADMIN: ULONG = 0x00000001; +pub const LSA_SID_DISABLED_CONFLICT: ULONG = 0x00000002; +pub const LSA_NB_DISABLED_ADMIN: ULONG = 0x00000004; +pub const LSA_NB_DISABLED_CONFLICT: ULONG = 0x00000008; +STRUCT!{struct LSA_FOREST_TRUST_DOMAIN_INFO { + Sid: PSID, + DnsName: LSA_UNICODE_STRING, + NetbiosName: LSA_UNICODE_STRING, +}} +pub type PLSA_FOREST_TRUST_DOMAIN_INFO = *mut LSA_FOREST_TRUST_DOMAIN_INFO; +pub const MAX_FOREST_TRUST_BINARY_DATA_SIZE: ULONG = 128 * 1024; +STRUCT!{struct LSA_FOREST_TRUST_BINARY_DATA { + Length: ULONG, + Buffer: PUCHAR, +}} +pub type PLSA_FOREST_TRUST_BINARY_DATA = *mut LSA_FOREST_TRUST_BINARY_DATA; +UNION!{union LSA_FOREST_TRUST_RECORD_ForestTrustData { + [usize; 5], + TopLevelName TopLevelName_mut: LSA_UNICODE_STRING, + DomainInfo DomainInfo_mut: LSA_FOREST_TRUST_DOMAIN_INFO, + Data Data_mut: LSA_FOREST_TRUST_BINARY_DATA, +}} +STRUCT!{struct LSA_FOREST_TRUST_RECORD { + Flags: ULONG, + ForestTrustType: LSA_FOREST_TRUST_RECORD_TYPE, + Time: LARGE_INTEGER, + ForestTrustData: LSA_FOREST_TRUST_RECORD_ForestTrustData, +}} +pub type PLSA_FOREST_TRUST_RECORD = *mut LSA_FOREST_TRUST_RECORD; +pub const MAX_RECORDS_IN_FOREST_TRUST_INFO: ULONG = 4000; +STRUCT!{struct LSA_FOREST_TRUST_INFORMATION { + RecordCount: ULONG, + Entries: *mut PLSA_FOREST_TRUST_RECORD, +}} +pub type PLSA_FOREST_TRUST_INFORMATION = *mut LSA_FOREST_TRUST_INFORMATION; +ENUM!{enum LSA_FOREST_TRUST_COLLISION_RECORD_TYPE { + CollisionTdo, + CollisionXref, + CollisionOther, +}} +STRUCT!{struct LSA_FOREST_TRUST_COLLISION_RECORD { + Index: ULONG, + Type: LSA_FOREST_TRUST_COLLISION_RECORD_TYPE, + Flags: ULONG, + Name: LSA_UNICODE_STRING, +}} +pub type PLSA_FOREST_TRUST_COLLISION_RECORD = *mut LSA_FOREST_TRUST_COLLISION_RECORD; +STRUCT!{struct LSA_FOREST_TRUST_COLLISION_INFORMATION { + RecordCount: ULONG, + Entries: *mut PLSA_FOREST_TRUST_COLLISION_RECORD, +}} +pub type PLSA_FOREST_TRUST_COLLISION_INFORMATION = *mut LSA_FOREST_TRUST_COLLISION_INFORMATION; +pub type LSA_ENUMERATION_HANDLE = ULONG; +pub type PLSA_ENUMERATION_HANDLE = *mut ULONG; +STRUCT!{struct LSA_ENUMERATION_INFORMATION { + Sid: PSID, +}} +pub type PLSA_ENUMERATION_INFORMATION = *mut LSA_ENUMERATION_INFORMATION; +STRUCT!{struct LSA_LAST_INTER_LOGON_INFO { + LastSuccessfulLogon: LARGE_INTEGER, + LastFailedLogon: LARGE_INTEGER, + FailedAttemptCountSinceLastSuccessfulLogon: ULONG, +}} +pub type PLSA_LAST_INTER_LOGON_INFO = *mut LSA_LAST_INTER_LOGON_INFO; +STRUCT!{struct SECURITY_LOGON_SESSION_DATA { + Size: ULONG, + LogonId: LUID, + UserName: LSA_UNICODE_STRING, + LogonDomain: LSA_UNICODE_STRING, + AuthenticationPackage: LSA_UNICODE_STRING, + LogonType: ULONG, + Session: ULONG, + Sid: PSID, + LogonTime: LARGE_INTEGER, + LogonServer: LSA_UNICODE_STRING, + DnsDomainName: LSA_UNICODE_STRING, + Upn: LSA_UNICODE_STRING, + UserFlags: ULONG, + LastLogonInfo: LSA_LAST_INTER_LOGON_INFO, + LogonScript: LSA_UNICODE_STRING, + ProfilePath: LSA_UNICODE_STRING, + HomeDirectory: LSA_UNICODE_STRING, + HomeDirectoryDrive: LSA_UNICODE_STRING, + LogoffTime: LARGE_INTEGER, + KickOffTime: LARGE_INTEGER, + PasswordLastSet: LARGE_INTEGER, + PasswordCanChange: LARGE_INTEGER, + PasswordMustChange: LARGE_INTEGER, +}} +pub type PSECURITY_LOGON_SESSION_DATA = *mut SECURITY_LOGON_SESSION_DATA; +pub const CENTRAL_ACCESS_POLICY_OWNER_RIGHTS_PRESENT_FLAG: ULONG = 0x00000001; +pub const CENTRAL_ACCESS_POLICY_STAGED_OWNER_RIGHTS_PRESENT_FLAG: ULONG = 0x00000100; +pub const CENTRAL_ACCESS_POLICY_STAGED_FLAG: ULONG = 0x00010000; +pub const CENTRAL_ACCESS_POLICY_VALID_FLAG_MASK: ULONG = + CENTRAL_ACCESS_POLICY_OWNER_RIGHTS_PRESENT_FLAG + | CENTRAL_ACCESS_POLICY_STAGED_OWNER_RIGHTS_PRESENT_FLAG + | CENTRAL_ACCESS_POLICY_STAGED_FLAG; +pub const LSASETCAPS_RELOAD_FLAG: ULONG = 0x00000001; +pub const LSASETCAPS_VALID_FLAG_MASK: ULONG = LSASETCAPS_RELOAD_FLAG; +STRUCT!{struct CENTRAL_ACCESS_POLICY_ENTRY { + Name: LSA_UNICODE_STRING, + Description: LSA_UNICODE_STRING, + ChangeId: LSA_UNICODE_STRING, + LengthAppliesTo: ULONG, + AppliesTo: PUCHAR, + LengthSD: ULONG, + SD: PSECURITY_DESCRIPTOR, + LengthStagedSD: ULONG, + StagedSD: PSECURITY_DESCRIPTOR, + Flags: ULONG, +}} +pub type PCENTRAL_ACCESS_POLICY_ENTRY = *mut CENTRAL_ACCESS_POLICY_ENTRY; +pub type PCCENTRAL_ACCESS_POLICY_ENTRY = *const CENTRAL_ACCESS_POLICY_ENTRY; +STRUCT!{struct CENTRAL_ACCESS_POLICY { + CAPID: PSID, + Name: LSA_UNICODE_STRING, + Description: LSA_UNICODE_STRING, + ChangeId: LSA_UNICODE_STRING, + Flags: ULONG, + CAPECount: ULONG, + CAPEs: *mut PCENTRAL_ACCESS_POLICY_ENTRY, +}} +pub type PCENTRAL_ACCESS_POLICY = *mut CENTRAL_ACCESS_POLICY; +pub type PCCENTRAL_ACCESS_POLICY = *const CENTRAL_ACCESS_POLICY; +ENUM!{enum NEGOTIATE_MESSAGES { + NegEnumPackagePrefixes = 0, + NegGetCallerName = 1, + NegTransferCredentials = 2, + NegCallPackageMax, +}} +pub const NEGOTIATE_MAX_PREFIX: usize = 32; +STRUCT!{struct NEGOTIATE_PACKAGE_PREFIX { + PackageId: ULONG_PTR, + PackageDataA: PVOID, + PackageDataW: PVOID, + PrefixLen: ULONG_PTR, + Prefix: [UCHAR; NEGOTIATE_MAX_PREFIX], +}} +pub type PNEGOTIATE_PACKAGE_PREFIX = *mut NEGOTIATE_PACKAGE_PREFIX; +STRUCT!{struct NEGOTIATE_PACKAGE_PREFIXES { + MessageType: ULONG, + PrefixCount: ULONG, + Offset: ULONG, + Pad: ULONG, +}} +pub type PNEGOTIATE_PACKAGE_PREFIXES = *mut NEGOTIATE_PACKAGE_PREFIXES; +STRUCT!{struct NEGOTIATE_CALLER_NAME_REQUEST { + MessageType: ULONG, + LogonId: LUID, +}} +pub type PNEGOTIATE_CALLER_NAME_REQUEST = *mut NEGOTIATE_CALLER_NAME_REQUEST; +STRUCT!{struct NEGOTIATE_CALLER_NAME_RESPONSE { + MessageType: ULONG, + CallerName: PWSTR, +}} +pub type PNEGOTIATE_CALLER_NAME_RESPONSE = *mut NEGOTIATE_CALLER_NAME_RESPONSE; +STRUCT!{struct DOMAIN_PASSWORD_INFORMATION { + MinPasswordLength: USHORT, + PasswordHistoryLength: USHORT, + PasswordProperties: ULONG, + MaxPasswordAge: LARGE_INTEGER, + MinPasswordAge: LARGE_INTEGER, +}} +pub type PDOMAIN_PASSWORD_INFORMATION = *mut DOMAIN_PASSWORD_INFORMATION; +pub const DOMAIN_PASSWORD_COMPLEX: ULONG = 0x00000001; +pub const DOMAIN_PASSWORD_NO_ANON_CHANGE: ULONG = 0x00000002; +pub const DOMAIN_PASSWORD_NO_CLEAR_CHANGE: ULONG = 0x00000004; +pub const DOMAIN_LOCKOUT_ADMINS: ULONG = 0x00000008; +pub const DOMAIN_PASSWORD_STORE_CLEARTEXT: ULONG = 0x00000010; +pub const DOMAIN_REFUSE_PASSWORD_CHANGE: ULONG = 0x00000020; +pub const DOMAIN_NO_LM_OWF_CHANGE: ULONG = 0x00000040; +FN!{stdcall PSAM_PASSWORD_NOTIFICATION_ROUTINE( + UserName: PUNICODE_STRING, + RelativeId: ULONG, + NewPassword: PUNICODE_STRING, +) -> NTSTATUS} +FN!{stdcall PSAM_INIT_NOTIFICATION_ROUTINE() -> BOOLEAN} +FN!{stdcall PSAM_PASSWORD_FILTER_ROUTINE( + AccountName: PUNICODE_STRING, + FullName: PUNICODE_STRING, + Password: PUNICODE_STRING, + SetOperation: BOOLEAN, +) -> BOOLEAN} +ENUM!{enum MSV1_0_LOGON_SUBMIT_TYPE { + MsV1_0InteractiveLogon = 2, + MsV1_0Lm20Logon, + MsV1_0NetworkLogon, + MsV1_0SubAuthLogon, + MsV1_0WorkstationUnlockLogon = 7, + MsV1_0S4ULogon = 12, + MsV1_0VirtualLogon = 82, + MsV1_0NoElevationLogon = 83, + MsV1_0LuidLogon = 84, +}} +pub type PMSV1_0_LOGON_SUBMIT_TYPE = *mut MSV1_0_LOGON_SUBMIT_TYPE; +ENUM!{enum MSV1_0_PROFILE_BUFFER_TYPE { + MsV1_0InteractiveProfile = 2, + MsV1_0Lm20LogonProfile, + MsV1_0SmartCardProfile, +}} +pub type PMSV1_0_PROFILE_BUFFER_TYPE = *mut MSV1_0_PROFILE_BUFFER_TYPE; +STRUCT!{struct MSV1_0_INTERACTIVE_LOGON { + MessageType: MSV1_0_LOGON_SUBMIT_TYPE, + LogonDomainName: UNICODE_STRING, + UserName: UNICODE_STRING, + Password: UNICODE_STRING, +}} +pub type PMSV1_0_INTERACTIVE_LOGON = *mut MSV1_0_INTERACTIVE_LOGON; +STRUCT!{struct MSV1_0_INTERACTIVE_PROFILE { + MessageType: MSV1_0_PROFILE_BUFFER_TYPE, + LogonCount: USHORT, + BadPasswordCount: USHORT, + LogonTime: LARGE_INTEGER, + LogoffTime: LARGE_INTEGER, + KickOffTime: LARGE_INTEGER, + PasswordLastSet: LARGE_INTEGER, + PasswordCanChange: LARGE_INTEGER, + PasswordMustChange: LARGE_INTEGER, + LogonScript: UNICODE_STRING, + HomeDirectory: UNICODE_STRING, + FullName: UNICODE_STRING, + ProfilePath: UNICODE_STRING, + HomeDirectoryDrive: UNICODE_STRING, + LogonServer: UNICODE_STRING, + UserFlags: ULONG, +}} +pub type PMSV1_0_INTERACTIVE_PROFILE = *mut MSV1_0_INTERACTIVE_PROFILE; +pub const MSV1_0_CHALLENGE_LENGTH: usize = 8; +pub const MSV1_0_USER_SESSION_KEY_LENGTH: usize = 16; +pub const MSV1_0_LANMAN_SESSION_KEY_LENGTH: usize = 8; +pub const MSV1_0_CLEARTEXT_PASSWORD_ALLOWED: ULONG = 0x02; +pub const MSV1_0_UPDATE_LOGON_STATISTICS: ULONG = 0x04; +pub const MSV1_0_RETURN_USER_PARAMETERS: ULONG = 0x08; +pub const MSV1_0_DONT_TRY_GUEST_ACCOUNT: ULONG = 0x10; +pub const MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT: ULONG = 0x20; +pub const MSV1_0_RETURN_PASSWORD_EXPIRY: ULONG = 0x40; +pub const MSV1_0_USE_CLIENT_CHALLENGE: ULONG = 0x80; +pub const MSV1_0_TRY_GUEST_ACCOUNT_ONLY: ULONG = 0x100; +pub const MSV1_0_RETURN_PROFILE_PATH: ULONG = 0x200; +pub const MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY: ULONG = 0x400; +pub const MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT: ULONG = 0x800; +pub const MSV1_0_DISABLE_PERSONAL_FALLBACK: ULONG = 0x00001000; +pub const MSV1_0_ALLOW_FORCE_GUEST: ULONG = 0x00002000; +pub const MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED: ULONG = 0x00004000; +pub const MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY: ULONG = 0x00008000; +pub const MSV1_0_SUBAUTHENTICATION_DLL_EX: ULONG = 0x00100000; +pub const MSV1_0_ALLOW_MSVCHAPV2: ULONG = 0x00010000; +pub const MSV1_0_S4U2SELF: ULONG = 0x00020000; +pub const MSV1_0_CHECK_LOGONHOURS_FOR_S4U: ULONG = 0x00040000; +pub const MSV1_0_INTERNET_DOMAIN: ULONG = 0x00080000; +pub const MSV1_0_SUBAUTHENTICATION_DLL: ULONG = 0xFF000000; +pub const MSV1_0_SUBAUTHENTICATION_DLL_SHIFT: ULONG = 24; +pub const MSV1_0_MNS_LOGON: ULONG = 0x01000000; +pub const MSV1_0_SUBAUTHENTICATION_DLL_RAS: ULONG = 2; +pub const MSV1_0_SUBAUTHENTICATION_DLL_IIS: ULONG = 132; +STRUCT!{struct MSV1_0_LM20_LOGON { + MessageType: MSV1_0_LOGON_SUBMIT_TYPE, + LogonDomainName: UNICODE_STRING, + UserName: UNICODE_STRING, + Workstation: UNICODE_STRING, + ChallengeToClient: [UCHAR; MSV1_0_CHALLENGE_LENGTH], + CaseSensitiveChallengeResponse: STRING, + CaseInsensitiveChallengeResponse: STRING, + ParameterControl: ULONG, +}} +pub type PMSV1_0_LM20_LOGON = *mut MSV1_0_LM20_LOGON; +STRUCT!{struct MSV1_0_SUBAUTH_LOGON { + MessageType: MSV1_0_LOGON_SUBMIT_TYPE, + LogonDomainName: UNICODE_STRING, + UserName: UNICODE_STRING, + Workstation: UNICODE_STRING, + ChallengeToClient: [UCHAR; MSV1_0_CHALLENGE_LENGTH], + AuthenticationInfo1: STRING, + AuthenticationInfo2: STRING, + ParameterControl: ULONG, + SubAuthPackageId: ULONG, +}} +pub type PMSV1_0_SUBAUTH_LOGON = *mut MSV1_0_SUBAUTH_LOGON; +STRUCT!{struct MSV1_0_S4U_LOGON { + MessageType: MSV1_0_LOGON_SUBMIT_TYPE, + MSV1_0_LOGON_SUBMIT_TYPE: ULONG, + UserPrincipalName: UNICODE_STRING, + DomainName: UNICODE_STRING, +}} +pub type PMSV1_0_S4U_LOGON = *mut MSV1_0_S4U_LOGON; +pub const LOGON_GUEST: ULONG = 0x01; +pub const LOGON_NOENCRYPTION: ULONG = 0x02; +pub const LOGON_CACHED_ACCOUNT: ULONG = 0x04; +pub const LOGON_USED_LM_PASSWORD: ULONG = 0x08; +pub const LOGON_EXTRA_SIDS: ULONG = 0x20; +pub const LOGON_SUBAUTH_SESSION_KEY: ULONG = 0x40; +pub const LOGON_SERVER_TRUST_ACCOUNT: ULONG = 0x80; +pub const LOGON_NTLMV2_ENABLED: ULONG = 0x100; +pub const LOGON_RESOURCE_GROUPS: ULONG = 0x200; +pub const LOGON_PROFILE_PATH_RETURNED: ULONG = 0x400; +pub const LOGON_NT_V2: ULONG = 0x800; +pub const LOGON_LM_V2: ULONG = 0x1000; +pub const LOGON_NTLM_V2: ULONG = 0x2000; +pub const LOGON_OPTIMIZED: ULONG = 0x4000; +pub const LOGON_WINLOGON: ULONG = 0x8000; +pub const LOGON_PKINIT: ULONG = 0x10000; +pub const LOGON_NO_OPTIMIZED: ULONG = 0x20000; +pub const LOGON_NO_ELEVATION: ULONG = 0x40000; +pub const LOGON_MANAGED_SERVICE: ULONG = 0x80000; +pub const LOGON_GRACE_LOGON: ULONG = 0x01000000; +STRUCT!{struct MSV1_0_LM20_LOGON_PROFILE { + MessageType: MSV1_0_PROFILE_BUFFER_TYPE, + KickOffTime: LARGE_INTEGER, + LogoffTime: LARGE_INTEGER, + UserFlags: ULONG, + UserSessionKey: [UCHAR; MSV1_0_USER_SESSION_KEY_LENGTH], + LogonDomainName: UNICODE_STRING, + LanmanSessionKey: [UCHAR; MSV1_0_LANMAN_SESSION_KEY_LENGTH], + LogonServer: UNICODE_STRING, + UserParameters: UNICODE_STRING, +}} +pub type PMSV1_0_LM20_LOGON_PROFILE = *mut MSV1_0_LM20_LOGON_PROFILE; +pub const MSV1_0_OWF_PASSWORD_LENGTH: usize = 16; +STRUCT!{struct MSV1_0_SUPPLEMENTAL_CREDENTIAL { + Version: ULONG, + Flags: ULONG, + LmPassword: [UCHAR; MSV1_0_OWF_PASSWORD_LENGTH], + NtPassword: [UCHAR; MSV1_0_OWF_PASSWORD_LENGTH], +}} +pub type PMSV1_0_SUPPLEMENTAL_CREDENTIAL = *mut MSV1_0_SUPPLEMENTAL_CREDENTIAL; +pub const MSV1_0_NTLM3_RESPONSE_LENGTH: usize = 16; +pub const MSV1_0_NTLM3_OWF_LENGTH: usize = 16; +STRUCT!{struct MSV1_0_NTLM3_RESPONSE { + Response: [UCHAR; MSV1_0_NTLM3_RESPONSE_LENGTH], + RespType: UCHAR, + HiRespType: UCHAR, + Flags: USHORT, + MsgWord: ULONG, + TimeStamp: ULONGLONG, + ChallengeFromClient: [UCHAR; MSV1_0_CHALLENGE_LENGTH], + AvPairsOff: ULONG, + Buffer: [UCHAR; 1], +}} +pub type PMSV1_0_NTLM3_RESPONSE = *mut MSV1_0_NTLM3_RESPONSE; +ENUM!{enum MSV1_0_AVID { + MsvAvEOL, + MsvAvNbComputerName, + MsvAvNbDomainName, + MsvAvDnsComputerName, + MsvAvDnsDomainName, + MsvAvDnsTreeName, + MsvAvFlags, + MsvAvTimestamp, + MsvAvRestrictions, + MsvAvTargetName, + MsvAvChannelBindings, +}} +STRUCT!{struct MSV1_0_AV_PAIR { + AvId: USHORT, + AvLen: USHORT, +}} +pub type PMSV1_0_AV_PAIR = *mut MSV1_0_AV_PAIR; +ENUM!{enum MSV1_0_PROTOCOL_MESSAGE_TYPE { + MsV1_0Lm20ChallengeRequest = 0, + MsV1_0Lm20GetChallengeResponse, + MsV1_0EnumerateUsers, + MsV1_0GetUserInfo, + MsV1_0ReLogonUsers, + MsV1_0ChangePassword, + MsV1_0ChangeCachedPassword, + MsV1_0GenericPassthrough, + MsV1_0CacheLogon, + MsV1_0SubAuth, + MsV1_0DeriveCredential, + MsV1_0CacheLookup, + MsV1_0SetProcessOption, + MsV1_0ConfigLocalAliases, + MsV1_0ClearCachedCredentials, + MsV1_0LookupToken, + MsV1_0ValidateAuth, + MsV1_0CacheLookupEx, + MsV1_0GetCredentialKey, + MsV1_0SetThreadOption, +}} +pub type PMSV1_0_PROTOCOL_MESSAGE_TYPE = *mut MSV1_0_PROTOCOL_MESSAGE_TYPE; +STRUCT!{struct MSV1_0_CHANGEPASSWORD_REQUEST { + MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, + DomainName: UNICODE_STRING, + AccountName: UNICODE_STRING, + OldPassword: UNICODE_STRING, + NewPassword: UNICODE_STRING, + Impersonating: BOOLEAN, +}} +pub type PMSV1_0_CHANGEPASSWORD_REQUEST = *mut MSV1_0_CHANGEPASSWORD_REQUEST; +STRUCT!{struct MSV1_0_CHANGEPASSWORD_RESPONSE { + MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, + PasswordInfoValid: BOOLEAN, + DomainPasswordInfo: DOMAIN_PASSWORD_INFORMATION, +}} +pub type PMSV1_0_CHANGEPASSWORD_RESPONSE = *mut MSV1_0_CHANGEPASSWORD_RESPONSE; +STRUCT!{struct MSV1_0_PASSTHROUGH_REQUEST { + MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, + DomainName: UNICODE_STRING, + PackageName: UNICODE_STRING, + DataLength: ULONG, + LogonData: PUCHAR, + Pad: ULONG, +}} +pub type PMSV1_0_PASSTHROUGH_REQUEST = *mut MSV1_0_PASSTHROUGH_REQUEST; +STRUCT!{struct MSV1_0_PASSTHROUGH_RESPONSE { + MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, + Pad: ULONG, + DataLength: ULONG, + ValidationData: PUCHAR, +}} +pub type PMSV1_0_PASSTHROUGH_RESPONSE = *mut MSV1_0_PASSTHROUGH_RESPONSE; +STRUCT!{struct MSV1_0_SUBAUTH_REQUEST { + MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, + SubAuthPackageId: ULONG, + SubAuthInfoLength: ULONG, + SubAuthSubmitBuffer: PUCHAR, +}} +pub type PMSV1_0_SUBAUTH_REQUEST = *mut MSV1_0_SUBAUTH_REQUEST; +STRUCT!{struct MSV1_0_SUBAUTH_RESPONSE { + MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE, + SubAuthInfoLength: ULONG, + SubAuthReturnBuffer: PUCHAR, +}} +pub type PMSV1_0_SUBAUTH_RESPONSE = *mut MSV1_0_SUBAUTH_RESPONSE; +pub use self::SystemFunction036 as RtlGenRandom; +pub use self::SystemFunction040 as RtlEncryptMemory; +pub use self::SystemFunction041 as RtlDecryptMemory; +extern "system" { + pub fn SystemFunction036( + RandomBuffer: PVOID, + RandomBufferLength: ULONG, + ) -> BOOLEAN; +} +pub const RTL_ENCRYPT_MEMORY_SIZE: ULONG = 8; +pub const RTL_ENCRYPT_OPTION_CROSS_PROCESS: ULONG = 0x01; +pub const RTL_ENCRYPT_OPTION_SAME_LOGON: ULONG = 0x02; +extern "system" { + pub fn SystemFunction040( + Memory: PVOID, + MemorySize: ULONG, + OptionFlags: ULONG, + ) -> NTSTATUS; + pub fn SystemFunction041( + Memory: PVOID, + MemorySize: ULONG, + OptionFlags: ULONG, + ) -> NTSTATUS; +} +pub const KERBEROS_VERSION: ULONG = 5; +pub const KERBEROS_REVISION: ULONG = 6; +pub const KERB_ETYPE_NULL: LONG = 0; +pub const KERB_ETYPE_DES_CBC_CRC: LONG = 1; +pub const KERB_ETYPE_DES_CBC_MD4: LONG = 2; +pub const KERB_ETYPE_DES_CBC_MD5: LONG = 3; +pub const KERB_ETYPE_AES128_CTS_HMAC_SHA1_96: LONG = 17; +pub const KERB_ETYPE_AES256_CTS_HMAC_SHA1_96: LONG = 18; +pub const KERB_ETYPE_RC4_MD4: LONG = -128; +pub const KERB_ETYPE_RC4_PLAIN2: LONG = -129; +pub const KERB_ETYPE_RC4_LM: LONG = -130; +pub const KERB_ETYPE_RC4_SHA: LONG = -131; +pub const KERB_ETYPE_DES_PLAIN: LONG = -132; +pub const KERB_ETYPE_RC4_HMAC_OLD: LONG = -133; +pub const KERB_ETYPE_RC4_PLAIN_OLD: LONG = -134; +pub const KERB_ETYPE_RC4_HMAC_OLD_EXP: LONG = -135; +pub const KERB_ETYPE_RC4_PLAIN_OLD_EXP: LONG = -136; +pub const KERB_ETYPE_RC4_PLAIN: LONG = -140; +pub const KERB_ETYPE_RC4_PLAIN_EXP: LONG = -141; +pub const KERB_ETYPE_AES128_CTS_HMAC_SHA1_96_PLAIN: LONG = -148; +pub const KERB_ETYPE_AES256_CTS_HMAC_SHA1_96_PLAIN: LONG = -149; +pub const KERB_ETYPE_DSA_SHA1_CMS: LONG = 9; +pub const KERB_ETYPE_RSA_MD5_CMS: LONG = 10; +pub const KERB_ETYPE_RSA_SHA1_CMS: LONG = 11; +pub const KERB_ETYPE_RC2_CBC_ENV: LONG = 12; +pub const KERB_ETYPE_RSA_ENV: LONG = 13; +pub const KERB_ETYPE_RSA_ES_OEAP_ENV: LONG = 14; +pub const KERB_ETYPE_DES_EDE3_CBC_ENV: LONG = 15; +pub const KERB_ETYPE_DSA_SIGN: LONG = 8; +pub const KERB_ETYPE_RSA_PRIV: LONG = 9; +pub const KERB_ETYPE_RSA_PUB: LONG = 10; +pub const KERB_ETYPE_RSA_PUB_MD5: LONG = 11; +pub const KERB_ETYPE_RSA_PUB_SHA1: LONG = 12; +pub const KERB_ETYPE_PKCS7_PUB: LONG = 13; +pub const KERB_ETYPE_DES3_CBC_MD5: LONG = 5; +pub const KERB_ETYPE_DES3_CBC_SHA1: LONG = 7; +pub const KERB_ETYPE_DES3_CBC_SHA1_KD: LONG = 16; +pub const KERB_ETYPE_DES_CBC_MD5_NT: LONG = 20; +pub const KERB_ETYPE_RC4_HMAC_NT: LONG = 23; +pub const KERB_ETYPE_RC4_HMAC_NT_EXP: LONG = 24; +pub const KERB_CHECKSUM_NONE: LONG = 0; +pub const KERB_CHECKSUM_CRC32: LONG = 1; +pub const KERB_CHECKSUM_MD4: LONG = 2; +pub const KERB_CHECKSUM_KRB_DES_MAC: LONG = 4; +pub const KERB_CHECKSUM_KRB_DES_MAC_K: LONG = 5; +pub const KERB_CHECKSUM_MD5: LONG = 7; +pub const KERB_CHECKSUM_MD5_DES: LONG = 8; +pub const KERB_CHECKSUM_SHA1_NEW: LONG = 14; +pub const KERB_CHECKSUM_HMAC_SHA1_96_AES128: LONG = 15; +pub const KERB_CHECKSUM_HMAC_SHA1_96_AES256: LONG = 16; +pub const KERB_CHECKSUM_LM: LONG = -130; +pub const KERB_CHECKSUM_SHA1: LONG = -131; +pub const KERB_CHECKSUM_REAL_CRC32: LONG = -132; +pub const KERB_CHECKSUM_DES_MAC: LONG = -133; +pub const KERB_CHECKSUM_DES_MAC_MD5: LONG = -134; +pub const KERB_CHECKSUM_MD25: LONG = -135; +pub const KERB_CHECKSUM_RC4_MD5: LONG = -136; +pub const KERB_CHECKSUM_MD5_HMAC: LONG = -137; +pub const KERB_CHECKSUM_HMAC_MD5: LONG = -138; +pub const KERB_CHECKSUM_HMAC_SHA1_96_AES128_Ki: LONG = -150; +pub const KERB_CHECKSUM_HMAC_SHA1_96_AES256_Ki: LONG = -151; +pub const KERB_TICKET_FLAGS_reserved: ULONG = 0x80000000; +pub const KERB_TICKET_FLAGS_forwardable: ULONG = 0x40000000; +pub const KERB_TICKET_FLAGS_forwarded: ULONG = 0x20000000; +pub const KERB_TICKET_FLAGS_proxiable: ULONG = 0x10000000; +pub const KERB_TICKET_FLAGS_proxy: ULONG = 0x08000000; +pub const KERB_TICKET_FLAGS_may_postdate: ULONG = 0x04000000; +pub const KERB_TICKET_FLAGS_postdated: ULONG = 0x02000000; +pub const KERB_TICKET_FLAGS_invalid: ULONG = 0x01000000; +pub const KERB_TICKET_FLAGS_renewable: ULONG = 0x00800000; +pub const KERB_TICKET_FLAGS_initial: ULONG = 0x00400000; +pub const KERB_TICKET_FLAGS_pre_authent: ULONG = 0x00200000; +pub const KERB_TICKET_FLAGS_hw_authent: ULONG = 0x00100000; +pub const KERB_TICKET_FLAGS_ok_as_delegate: ULONG = 0x00040000; +pub const KERB_TICKET_FLAGS_name_canonicalize: ULONG = 0x00010000; +pub const KERB_TICKET_FLAGS_cname_in_pa_data: ULONG = 0x00040000; +pub const KERB_TICKET_FLAGS_enc_pa_rep: ULONG = 0x00010000; +pub const KERB_TICKET_FLAGS_reserved1: ULONG = 0x00000001; +pub const KRB_NT_UNKNOWN: LONG = 0; +pub const KRB_NT_PRINCIPAL: LONG = 1; +pub const KRB_NT_PRINCIPAL_AND_ID: LONG = -131; +pub const KRB_NT_SRV_INST: LONG = 2; +pub const KRB_NT_SRV_INST_AND_ID: LONG = -132; +pub const KRB_NT_SRV_HST: LONG = 3; +pub const KRB_NT_SRV_XHST: LONG = 4; +pub const KRB_NT_UID: LONG = 5; +pub const KRB_NT_ENTERPRISE_PRINCIPAL: LONG = 10; +pub const KRB_NT_WELLKNOWN: LONG = 11; +pub const KRB_NT_ENT_PRINCIPAL_AND_ID: LONG = -130; +pub const KRB_NT_MS_PRINCIPAL: LONG = -128; +pub const KRB_NT_MS_PRINCIPAL_AND_ID: LONG = -129; +pub const KRB_NT_MS_BRANCH_ID: LONG = -133; +pub const KRB_NT_X500_PRINCIPAL: LONG = 6; +pub const KERB_WRAP_NO_ENCRYPT: ULONG = 0x80000001; +ENUM!{enum KERB_LOGON_SUBMIT_TYPE { + KerbInteractiveLogon = 2, + KerbSmartCardLogon = 6, + KerbWorkstationUnlockLogon = 7, + KerbSmartCardUnlockLogon = 8, + KerbProxyLogon = 9, + KerbTicketLogon = 10, + KerbTicketUnlockLogon = 11, + KerbS4ULogon = 12, + KerbCertificateLogon = 13, + KerbCertificateS4ULogon = 14, + KerbCertificateUnlockLogon = 15, + KerbNoElevationLogon = 83, + KerbLuidLogon = 84, +}} +pub type PKERB_LOGON_SUBMIT_TYPE = *mut KERB_LOGON_SUBMIT_TYPE; +STRUCT!{struct KERB_INTERACTIVE_LOGON { + MessageType: KERB_LOGON_SUBMIT_TYPE, + LogonDomainName: UNICODE_STRING, + UserName: UNICODE_STRING, + Password: UNICODE_STRING, +}} +pub type PKERB_INTERACTIVE_LOGON = *mut KERB_INTERACTIVE_LOGON; +STRUCT!{struct KERB_INTERACTIVE_UNLOCK_LOGON { + Logon: KERB_INTERACTIVE_LOGON, + LogonId: LUID, +}} +pub type PKERB_INTERACTIVE_UNLOCK_LOGON = *mut KERB_INTERACTIVE_UNLOCK_LOGON; +STRUCT!{struct KERB_SMART_CARD_LOGON { + MessageType: KERB_LOGON_SUBMIT_TYPE, + Pin: UNICODE_STRING, + CspDataLength: ULONG, + CspData: PUCHAR, +}} +pub type PKERB_SMART_CARD_LOGON = *mut KERB_SMART_CARD_LOGON; +STRUCT!{struct KERB_SMART_CARD_UNLOCK_LOGON { + Logon: KERB_SMART_CARD_LOGON, + LogonId: LUID, +}} +pub type PKERB_SMART_CARD_UNLOCK_LOGON = *mut KERB_SMART_CARD_UNLOCK_LOGON; +pub const KERB_CERTIFICATE_LOGON_FLAG_CHECK_DUPLICATES: ULONG = 0x1; +pub const KERB_CERTIFICATE_LOGON_FLAG_USE_CERTIFICATE_INFO: ULONG = 0x2; +STRUCT!{struct KERB_CERTIFICATE_LOGON { + MessageType: KERB_LOGON_SUBMIT_TYPE, + DomainName: UNICODE_STRING, + UserName: UNICODE_STRING, + Pin: UNICODE_STRING, + Flags: ULONG, + CspDataLength: ULONG, + CspData: PUCHAR, +}} +pub type PKERB_CERTIFICATE_LOGON = *mut KERB_CERTIFICATE_LOGON; +STRUCT!{struct KERB_CERTIFICATE_UNLOCK_LOGON { + Logon: KERB_CERTIFICATE_LOGON, + LogonId: LUID, +}} +pub type PKERB_CERTIFICATE_UNLOCK_LOGON = *mut KERB_CERTIFICATE_UNLOCK_LOGON; +pub const KERB_CERTIFICATE_S4U_LOGON_FLAG_CHECK_DUPLICATES: ULONG = 0x1; +pub const KERB_CERTIFICATE_S4U_LOGON_FLAG_CHECK_LOGONHOURS: ULONG = 0x2; +pub const KERB_CERTIFICATE_S4U_LOGON_FLAG_FAIL_IF_NT_AUTH_POLICY_REQUIRED: ULONG = 0x4; +pub const KERB_CERTIFICATE_S4U_LOGON_FLAG_IDENTIFY: ULONG = 0x8; +STRUCT!{struct KERB_CERTIFICATE_S4U_LOGON { + MessageType: KERB_LOGON_SUBMIT_TYPE, + Flags: ULONG, + UserPrincipalName: UNICODE_STRING, + DomainName: UNICODE_STRING, + CertificateLength: ULONG, + Certificate: PUCHAR, +}} +pub type PKERB_CERTIFICATE_S4U_LOGON = *mut KERB_CERTIFICATE_S4U_LOGON; +STRUCT!{struct KERB_TICKET_LOGON { + MessageType: KERB_LOGON_SUBMIT_TYPE, + Flags: ULONG, + ServiceTicketLength: ULONG, + TicketGrantingTicketLength: ULONG, + ServiceTicket: PUCHAR, + TicketGrantingTicket: PUCHAR, +}} +pub type PKERB_TICKET_LOGON = *mut KERB_TICKET_LOGON; +STRUCT!{struct KERB_TICKET_UNLOCK_LOGON { + Logon: KERB_TICKET_LOGON, + LogonId: LUID, +}} +pub type PKERB_TICKET_UNLOCK_LOGON = *mut KERB_TICKET_UNLOCK_LOGON; +pub const KERB_S4U_LOGON_FLAG_CHECK_LOGONHOURS: ULONG = 0x2; +pub const KERB_S4U_LOGON_FLAG_IDENTIFY: ULONG = 0x8; +STRUCT!{struct KERB_S4U_LOGON { + MessageType: KERB_LOGON_SUBMIT_TYPE, + Flags: ULONG, + ClientUpn: UNICODE_STRING, + ClientRealm: UNICODE_STRING, +}} +pub type PKERB_S4U_LOGON = *mut KERB_S4U_LOGON; +ENUM!{enum KERB_PROFILE_BUFFER_TYPE { + KerbInteractiveProfile = 2, + KerbSmartCardProfile = 4, + KerbTicketProfile = 6, +}} +pub type PKERB_PROFILE_BUFFER_TYPE = *mut KERB_PROFILE_BUFFER_TYPE; +STRUCT!{struct KERB_INTERACTIVE_PROFILE { + MessageType: KERB_PROFILE_BUFFER_TYPE, + LogonCount: USHORT, + BadPasswordCount: USHORT, + LogonTime: LARGE_INTEGER, + LogoffTime: LARGE_INTEGER, + KickOffTime: LARGE_INTEGER, + PasswordLastSet: LARGE_INTEGER, + PasswordCanChange: LARGE_INTEGER, + PasswordMustChange: LARGE_INTEGER, + LogonScript: UNICODE_STRING, + HomeDirectory: UNICODE_STRING, + FullName: UNICODE_STRING, + ProfilePath: UNICODE_STRING, + HomeDirectoryDrive: UNICODE_STRING, + LogonServer: UNICODE_STRING, + UserFlags: ULONG, +}} +pub type PKERB_INTERACTIVE_PROFILE = *mut KERB_INTERACTIVE_PROFILE; +STRUCT!{struct KERB_SMART_CARD_PROFILE { + Profile: KERB_INTERACTIVE_PROFILE, + CertificateSize: ULONG, + CertificateData: PUCHAR, +}} +pub type PKERB_SMART_CARD_PROFILE = *mut KERB_SMART_CARD_PROFILE; +STRUCT!{struct KERB_CRYPTO_KEY { + KeyType: LONG, + Length: ULONG, + Value: PUCHAR, +}} +pub type PKERB_CRYPTO_KEY = *mut KERB_CRYPTO_KEY; +STRUCT!{struct KERB_CRYPTO_KEY32 { + KeyType: LONG, + Length: ULONG, + Offset: ULONG, +}} +pub type PKERB_CRYPTO_KEY32 = *mut KERB_CRYPTO_KEY32; +STRUCT!{struct KERB_TICKET_PROFILE { + Profile: KERB_INTERACTIVE_PROFILE, + SessionKey: KERB_CRYPTO_KEY, +}} +pub type PKERB_TICKET_PROFILE = *mut KERB_TICKET_PROFILE; +ENUM!{enum KERB_PROTOCOL_MESSAGE_TYPE { + KerbDebugRequestMessage = 0, + KerbQueryTicketCacheMessage, + KerbChangeMachinePasswordMessage, + KerbVerifyPacMessage, + KerbRetrieveTicketMessage, + KerbUpdateAddressesMessage, + KerbPurgeTicketCacheMessage, + KerbChangePasswordMessage, + KerbRetrieveEncodedTicketMessage, + KerbDecryptDataMessage, + KerbAddBindingCacheEntryMessage, + KerbSetPasswordMessage, + KerbSetPasswordExMessage, + KerbVerifyCredentialsMessage, + KerbQueryTicketCacheExMessage, + KerbPurgeTicketCacheExMessage, + KerbRefreshSmartcardCredentialsMessage, + KerbAddExtraCredentialsMessage, + KerbQuerySupplementalCredentialsMessage, + KerbTransferCredentialsMessage, + KerbQueryTicketCacheEx2Message, + KerbSubmitTicketMessage, + KerbAddExtraCredentialsExMessage, + KerbQueryKdcProxyCacheMessage, + KerbPurgeKdcProxyCacheMessage, + KerbQueryTicketCacheEx3Message, + KerbCleanupMachinePkinitCredsMessage, + KerbAddBindingCacheEntryExMessage, + KerbQueryBindingCacheMessage, + KerbPurgeBindingCacheMessage, + KerbPinKdcMessage, + KerbUnpinAllKdcsMessage, + KerbQueryDomainExtendedPoliciesMessage, + KerbQueryS4U2ProxyCacheMessage, +}} +pub type PKERB_PROTOCOL_MESSAGE_TYPE = *mut KERB_PROTOCOL_MESSAGE_TYPE; +STRUCT!{struct KERB_QUERY_TKT_CACHE_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + LogonId: LUID, +}} +pub type PKERB_QUERY_TKT_CACHE_REQUEST = *mut KERB_QUERY_TKT_CACHE_REQUEST; +STRUCT!{struct KERB_TICKET_CACHE_INFO { + ServerName: UNICODE_STRING, + RealmName: UNICODE_STRING, + StartTime: LARGE_INTEGER, + EndTime: LARGE_INTEGER, + RenewTime: LARGE_INTEGER, + EncryptionType: LONG, + TicketFlags: ULONG, +}} +pub type PKERB_TICKET_CACHE_INFO = *mut KERB_TICKET_CACHE_INFO; +STRUCT!{struct KERB_TICKET_CACHE_INFO_EX { + ClientName: UNICODE_STRING, + ClientRealm: UNICODE_STRING, + ServerName: UNICODE_STRING, + ServerRealm: UNICODE_STRING, + StartTime: LARGE_INTEGER, + EndTime: LARGE_INTEGER, + RenewTime: LARGE_INTEGER, + EncryptionType: LONG, + TicketFlags: ULONG, +}} +pub type PKERB_TICKET_CACHE_INFO_EX = *mut KERB_TICKET_CACHE_INFO_EX; +STRUCT!{struct KERB_TICKET_CACHE_INFO_EX2 { + ClientName: UNICODE_STRING, + ClientRealm: UNICODE_STRING, + ServerName: UNICODE_STRING, + ServerRealm: UNICODE_STRING, + StartTime: LARGE_INTEGER, + EndTime: LARGE_INTEGER, + RenewTime: LARGE_INTEGER, + EncryptionType: LONG, + TicketFlags: ULONG, + SessionKeyType: ULONG, + BranchId: ULONG, +}} +pub type PKERB_TICKET_CACHE_INFO_EX2 = *mut KERB_TICKET_CACHE_INFO_EX2; +STRUCT!{struct KERB_TICKET_CACHE_INFO_EX3 { + ClientName: UNICODE_STRING, + ClientRealm: UNICODE_STRING, + ServerName: UNICODE_STRING, + ServerRealm: UNICODE_STRING, + StartTime: LARGE_INTEGER, + EndTime: LARGE_INTEGER, + RenewTime: LARGE_INTEGER, + EncryptionType: LONG, + TicketFlags: ULONG, + SessionKeyType: ULONG, + BranchId: ULONG, + CacheFlags: ULONG, + KdcCalled: UNICODE_STRING, +}} +pub type PKERB_TICKET_CACHE_INFO_EX3 = *mut KERB_TICKET_CACHE_INFO_EX3; +STRUCT!{struct KERB_QUERY_TKT_CACHE_RESPONSE { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + CountOfTickets: ULONG, + Tickets: [KERB_TICKET_CACHE_INFO; ANYSIZE_ARRAY], +}} +pub type PKERB_QUERY_TKT_CACHE_RESPONSE = *mut KERB_QUERY_TKT_CACHE_RESPONSE; +STRUCT!{struct KERB_QUERY_TKT_CACHE_EX_RESPONSE { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + CountOfTickets: ULONG, + Tickets: [KERB_TICKET_CACHE_INFO_EX; ANYSIZE_ARRAY], +}} +pub type PKERB_QUERY_TKT_CACHE_EX_RESPONSE = *mut KERB_QUERY_TKT_CACHE_EX_RESPONSE; +STRUCT!{struct KERB_QUERY_TKT_CACHE_EX2_RESPONSE { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + CountOfTickets: ULONG, + Tickets: [KERB_TICKET_CACHE_INFO_EX2; ANYSIZE_ARRAY], +}} +pub type PKERB_QUERY_TKT_CACHE_EX2_RESPONSE = *mut KERB_QUERY_TKT_CACHE_EX2_RESPONSE; +STRUCT!{struct KERB_QUERY_TKT_CACHE_EX3_RESPONSE { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + CountOfTickets: ULONG, + Tickets: [KERB_TICKET_CACHE_INFO_EX3; ANYSIZE_ARRAY], +}} +pub type PKERB_QUERY_TKT_CACHE_EX3_RESPONSE = *mut KERB_QUERY_TKT_CACHE_EX3_RESPONSE; +pub const KERB_USE_DEFAULT_TICKET_FLAGS: ULONG = 0x0; +pub const KERB_RETRIEVE_TICKET_DEFAULT: ULONG = 0x0; +pub const KERB_RETRIEVE_TICKET_DONT_USE_CACHE: ULONG = 0x1; +pub const KERB_RETRIEVE_TICKET_USE_CACHE_ONLY: ULONG = 0x2; +pub const KERB_RETRIEVE_TICKET_USE_CREDHANDLE: ULONG = 0x4; +pub const KERB_RETRIEVE_TICKET_AS_KERB_CRED: ULONG = 0x8; +pub const KERB_RETRIEVE_TICKET_WITH_SEC_CRED: ULONG = 0x10; +pub const KERB_RETRIEVE_TICKET_CACHE_TICKET: ULONG = 0x20; +pub const KERB_RETRIEVE_TICKET_MAX_LIFETIME: ULONG = 0x40; +STRUCT!{struct KERB_AUTH_DATA { + Type: ULONG, + Length: ULONG, + Data: PUCHAR, +}} +pub type PKERB_AUTH_DATA = *mut KERB_AUTH_DATA; +STRUCT!{struct KERB_NET_ADDRESS { + Family: ULONG, + Length: ULONG, + Address: PUCHAR, +}} +pub type PKERB_NET_ADDRESS = *mut KERB_NET_ADDRESS; +STRUCT!{struct KERB_NET_ADDRESSES { + Number: ULONG, + Addresses: [KERB_NET_ADDRESS; ANYSIZE_ARRAY], +}} +pub type PKERB_NET_ADDRESSES = *mut KERB_NET_ADDRESSES; +STRUCT!{struct KERB_EXTERNAL_NAME { + NameType: SHORT, + NameCount: USHORT, + Names: [UNICODE_STRING; ANYSIZE_ARRAY], +}} +pub type PKERB_EXTERNAL_NAME = *mut KERB_EXTERNAL_NAME; +STRUCT!{struct KERB_EXTERNAL_TICKET { + ServiceName: PKERB_EXTERNAL_NAME, + TargetName: PKERB_EXTERNAL_NAME, + ClientName: PKERB_EXTERNAL_NAME, + DomainName: UNICODE_STRING, + TargetDomainName: UNICODE_STRING, + AltTargetDomainName: UNICODE_STRING, + SessionKey: KERB_CRYPTO_KEY, + TicketFlags: ULONG, + Flags: ULONG, + KeyExpirationTime: LARGE_INTEGER, + StartTime: LARGE_INTEGER, + EndTime: LARGE_INTEGER, + RenewUntil: LARGE_INTEGER, + TimeSkew: LARGE_INTEGER, + EncodedTicketSize: ULONG, + EncodedTicket: PUCHAR, +}} +pub type PKERB_EXTERNAL_TICKET = *mut KERB_EXTERNAL_TICKET; +STRUCT!{struct KERB_RETRIEVE_TKT_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + LogonId: LUID, + TargetName: UNICODE_STRING, + TicketFlags: ULONG, + CacheOptions: ULONG, + EncryptionType: LONG, + CredentialsHandle: SecHandle, +}} +pub type PKERB_RETRIEVE_TKT_REQUEST = *mut KERB_RETRIEVE_TKT_REQUEST; +STRUCT!{struct KERB_RETRIEVE_TKT_RESPONSE { + Ticket: KERB_EXTERNAL_TICKET, +}} +pub type PKERB_RETRIEVE_TKT_RESPONSE = *mut KERB_RETRIEVE_TKT_RESPONSE; +STRUCT!{struct KERB_PURGE_TKT_CACHE_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + LogonId: LUID, + ServerName: UNICODE_STRING, + RealmName: UNICODE_STRING, +}} +pub type PKERB_PURGE_TKT_CACHE_REQUEST = *mut KERB_PURGE_TKT_CACHE_REQUEST; +pub const KERB_PURGE_ALL_TICKETS: ULONG = 1; +STRUCT!{struct KERB_PURGE_TKT_CACHE_EX_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + LogonId: LUID, + Flags: ULONG, + TicketTemplate: KERB_TICKET_CACHE_INFO_EX, +}} +pub type PKERB_PURGE_TKT_CACHE_EX_REQUEST = *mut KERB_PURGE_TKT_CACHE_EX_REQUEST; +STRUCT!{struct KERB_SUBMIT_TKT_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + LogonId: LUID, + Flags: ULONG, + Key: KERB_CRYPTO_KEY32, + KerbCredSize: ULONG, + KerbCredOffset: ULONG, +}} +pub type PKERB_SUBMIT_TKT_REQUEST = *mut KERB_SUBMIT_TKT_REQUEST; +STRUCT!{struct KERB_QUERY_KDC_PROXY_CACHE_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + Flags: ULONG, + LogonId: LUID, +}} +pub type PKERB_QUERY_KDC_PROXY_CACHE_REQUEST = *mut KERB_QUERY_KDC_PROXY_CACHE_REQUEST; +STRUCT!{struct KDC_PROXY_CACHE_ENTRY_DATA { + SinceLastUsed: ULONG64, + DomainName: UNICODE_STRING, + ProxyServerName: UNICODE_STRING, + ProxyServerVdir: UNICODE_STRING, + ProxyServerPort: USHORT, + LogonId: LUID, + CredUserName: UNICODE_STRING, + CredDomainName: UNICODE_STRING, + GlobalCache: BOOLEAN, +}} +pub type PKDC_PROXY_CACHE_ENTRY_DATA = *mut KDC_PROXY_CACHE_ENTRY_DATA; +STRUCT!{struct KERB_QUERY_KDC_PROXY_CACHE_RESPONSE { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + CountOfEntries: ULONG, + Entries: PKDC_PROXY_CACHE_ENTRY_DATA, +}} +pub type PKERB_QUERY_KDC_PROXY_CACHE_RESPONSE = *mut KERB_QUERY_KDC_PROXY_CACHE_RESPONSE; +STRUCT!{struct KERB_PURGE_KDC_PROXY_CACHE_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + Flags: ULONG, + LogonId: LUID, +}} +pub type PKERB_PURGE_KDC_PROXY_CACHE_REQUEST = *mut KERB_PURGE_KDC_PROXY_CACHE_REQUEST; +STRUCT!{struct KERB_PURGE_KDC_PROXY_CACHE_RESPONSE { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + CountOfPurged: ULONG, +}} +pub type PKERB_PURGE_KDC_PROXY_CACHE_RESPONSE = *mut KERB_PURGE_KDC_PROXY_CACHE_RESPONSE; +pub const KERB_S4U2PROXY_CACHE_ENTRY_INFO_FLAG_NEGATIVE: ULONG = 0x1; +STRUCT!{struct KERB_S4U2PROXY_CACHE_ENTRY_INFO { + ServerName: UNICODE_STRING, + Flags: ULONG, + LastStatus: NTSTATUS, + Expiry: LARGE_INTEGER, +}} +pub type PKERB_S4U2PROXY_CACHE_ENTRY_INFO = *mut KERB_S4U2PROXY_CACHE_ENTRY_INFO; +pub const KERB_S4U2PROXY_CRED_FLAG_NEGATIVE: ULONG = 0x1; +STRUCT!{struct KERB_S4U2PROXY_CRED { + UserName: UNICODE_STRING, + DomainName: UNICODE_STRING, + Flags: ULONG, + LastStatus: NTSTATUS, + Expiry: LARGE_INTEGER, + CountOfEntries: ULONG, + Entries: PKERB_S4U2PROXY_CACHE_ENTRY_INFO, +}} +pub type PKERB_S4U2PROXY_CRED = *mut KERB_S4U2PROXY_CRED; +STRUCT!{struct KERB_QUERY_S4U2PROXY_CACHE_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + Flags: ULONG, + LogonId: LUID, +}} +pub type PKERB_QUERY_S4U2PROXY_CACHE_REQUEST = *mut KERB_QUERY_S4U2PROXY_CACHE_REQUEST; +STRUCT!{struct KERB_QUERY_S4U2PROXY_CACHE_RESPONSE { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + CountOfCreds: ULONG, + Creds: PKERB_S4U2PROXY_CRED, +}} +pub type PKERB_QUERY_S4U2PROXY_CACHE_RESPONSE = *mut KERB_QUERY_S4U2PROXY_CACHE_RESPONSE; +STRUCT!{struct KERB_CHANGEPASSWORD_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + DomainName: UNICODE_STRING, + AccountName: UNICODE_STRING, + OldPassword: UNICODE_STRING, + NewPassword: UNICODE_STRING, + Impersonating: BOOLEAN, +}} +pub type PKERB_CHANGEPASSWORD_REQUEST = *mut KERB_CHANGEPASSWORD_REQUEST; +STRUCT!{struct KERB_SETPASSWORD_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + LogonId: LUID, + CredentialsHandle: SecHandle, + Flags: ULONG, + DomainName: UNICODE_STRING, + AccountName: UNICODE_STRING, + Password: UNICODE_STRING, +}} +pub type PKERB_SETPASSWORD_REQUEST = *mut KERB_SETPASSWORD_REQUEST; +STRUCT!{struct KERB_SETPASSWORD_EX_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + LogonId: LUID, + CredentialsHandle: SecHandle, + Flags: ULONG, + AccountRealm: UNICODE_STRING, + AccountName: UNICODE_STRING, + Password: UNICODE_STRING, + ClientRealm: UNICODE_STRING, + ClientName: UNICODE_STRING, + Impersonating: BOOLEAN, + KdcAddress: UNICODE_STRING, + KdcAddressType: ULONG, +}} +pub type PKERB_SETPASSWORD_EX_REQUEST = *mut KERB_SETPASSWORD_EX_REQUEST; +pub const DS_UNKNOWN_ADDRESS_TYPE: ULONG = 0; +pub const KERB_SETPASS_USE_LOGONID: ULONG = 1; +pub const KERB_SETPASS_USE_CREDHANDLE: ULONG = 2; +STRUCT!{struct KERB_DECRYPT_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + LogonId: LUID, + Flags: ULONG, + CryptoType: LONG, + KeyUsage: LONG, + Key: KERB_CRYPTO_KEY, + EncryptedDataSize: ULONG, + InitialVectorSize: ULONG, + InitialVector: PUCHAR, + EncryptedData: PUCHAR, +}} +pub type PKERB_DECRYPT_REQUEST = *mut KERB_DECRYPT_REQUEST; +pub const KERB_DECRYPT_FLAG_DEFAULT_KEY: ULONG = 0x00000001; +STRUCT!{struct KERB_DECRYPT_RESPONSE { + DecryptedData: [UCHAR; ANYSIZE_ARRAY], +}} +pub type PKERB_DECRYPT_RESPONSE = *mut KERB_DECRYPT_RESPONSE; +STRUCT!{struct KERB_ADD_BINDING_CACHE_ENTRY_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + RealmName: UNICODE_STRING, + KdcAddress: UNICODE_STRING, + AddressType: ULONG, +}} +pub type PKERB_ADD_BINDING_CACHE_ENTRY_REQUEST = *mut KERB_ADD_BINDING_CACHE_ENTRY_REQUEST; +STRUCT!{struct KERB_REFRESH_SCCRED_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + CredentialBlob: UNICODE_STRING, + LogonId: LUID, + Flags: ULONG, +}} +pub type PKERB_REFRESH_SCCRED_REQUEST = *mut KERB_REFRESH_SCCRED_REQUEST; +pub const KERB_REFRESH_SCCRED_RELEASE: ULONG = 0x0; +pub const KERB_REFRESH_SCCRED_GETTGT: ULONG = 0x1; +STRUCT!{struct KERB_ADD_CREDENTIALS_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + UserName: UNICODE_STRING, + DomainName: UNICODE_STRING, + Password: UNICODE_STRING, + LogonId: LUID, + Flags: ULONG, +}} +pub type PKERB_ADD_CREDENTIALS_REQUEST = *mut KERB_ADD_CREDENTIALS_REQUEST; +pub const KERB_REQUEST_ADD_CREDENTIAL: ULONG = 1; +pub const KERB_REQUEST_REPLACE_CREDENTIAL: ULONG = 2; +pub const KERB_REQUEST_REMOVE_CREDENTIAL: ULONG = 4; +STRUCT!{struct KERB_ADD_CREDENTIALS_REQUEST_EX { + Credentials: KERB_ADD_CREDENTIALS_REQUEST, + PrincipalNameCount: ULONG, + PrincipalNames: [UNICODE_STRING; ANYSIZE_ARRAY], +}} +pub type PKERB_ADD_CREDENTIALS_REQUEST_EX = *mut KERB_ADD_CREDENTIALS_REQUEST_EX; +STRUCT!{struct KERB_TRANSFER_CRED_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + OriginLogonId: LUID, + DestinationLogonId: LUID, + Flags: ULONG, +}} +pub type PKERB_TRANSFER_CRED_REQUEST = *mut KERB_TRANSFER_CRED_REQUEST; +pub const KERB_TRANSFER_CRED_WITH_TICKETS: ULONG = 0x1; +pub const KERB_TRANSFER_CRED_CLEANUP_CREDENTIALS: ULONG = 0x2; +STRUCT!{struct KERB_CLEANUP_MACHINE_PKINIT_CREDS_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + LogonId: LUID, +}} +pub type PKERB_CLEANUP_MACHINE_PKINIT_CREDS_REQUEST = + *mut KERB_CLEANUP_MACHINE_PKINIT_CREDS_REQUEST; +STRUCT!{struct KERB_BINDING_CACHE_ENTRY_DATA { + DiscoveryTime: ULONG64, + RealmName: UNICODE_STRING, + KdcAddress: UNICODE_STRING, + AddressType: ULONG, + Flags: ULONG, + DcFlags: ULONG, + CacheFlags: ULONG, + KdcName: UNICODE_STRING, +}} +pub type PKERB_BINDING_CACHE_ENTRY_DATA = *mut KERB_BINDING_CACHE_ENTRY_DATA; +STRUCT!{struct KERB_QUERY_BINDING_CACHE_RESPONSE { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + CountOfEntries: ULONG, + Entries: PKERB_BINDING_CACHE_ENTRY_DATA, +}} +pub type PKERB_QUERY_BINDING_CACHE_RESPONSE = *mut KERB_QUERY_BINDING_CACHE_RESPONSE; +STRUCT!{struct KERB_ADD_BINDING_CACHE_ENTRY_EX_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + RealmName: UNICODE_STRING, + KdcAddress: UNICODE_STRING, + AddressType: ULONG, + DcFlags: ULONG, +}} +pub type PKERB_ADD_BINDING_CACHE_ENTRY_EX_REQUEST = *mut KERB_ADD_BINDING_CACHE_ENTRY_EX_REQUEST; +STRUCT!{struct KERB_QUERY_BINDING_CACHE_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, +}} +pub type PKERB_QUERY_BINDING_CACHE_REQUEST = *mut KERB_QUERY_BINDING_CACHE_REQUEST; +STRUCT!{struct KERB_PURGE_BINDING_CACHE_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, +}} +pub type PKERB_PURGE_BINDING_CACHE_REQUEST = *mut KERB_PURGE_BINDING_CACHE_REQUEST; +STRUCT!{struct KERB_QUERY_DOMAIN_EXTENDED_POLICIES_REQUEST { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + Flags: ULONG, + DomainName: UNICODE_STRING, +}} +pub type PKERB_QUERY_DOMAIN_EXTENDED_POLICIES_REQUEST = + *mut KERB_QUERY_DOMAIN_EXTENDED_POLICIES_REQUEST; +STRUCT!{struct KERB_QUERY_DOMAIN_EXTENDED_POLICIES_RESPONSE { + MessageType: KERB_PROTOCOL_MESSAGE_TYPE, + Flags: ULONG, + ExtendedPolicies: ULONG, + DsFlags: ULONG, +}} +pub type PKERB_QUERY_DOMAIN_EXTENDED_POLICIES_RESPONSE = + *mut KERB_QUERY_DOMAIN_EXTENDED_POLICIES_RESPONSE; +ENUM!{enum KERB_CERTIFICATE_INFO_TYPE { + CertHashInfo = 1, +}} +pub type PKERB_CERTIFICATE_INFO_TYPE = *mut KERB_CERTIFICATE_INFO_TYPE; +STRUCT!{struct KERB_CERTIFICATE_HASHINFO { + StoreNameLength: USHORT, + HashLength: USHORT, +}} +pub type PKERB_CERTIFICATE_HASHINFO = *mut KERB_CERTIFICATE_HASHINFO; +STRUCT!{struct KERB_CERTIFICATE_INFO { + CertInfoSize: ULONG, + InfoType: ULONG, +}} +pub type PKERB_CERTIFICATE_INFO = *mut KERB_CERTIFICATE_INFO; +STRUCT!{struct POLICY_AUDIT_SID_ARRAY { + UsersCount: ULONG, + UserSidArray: *mut PSID, +}} +pub type PPOLICY_AUDIT_SID_ARRAY = *mut POLICY_AUDIT_SID_ARRAY; +STRUCT!{struct AUDIT_POLICY_INFORMATION { + AuditSubCategoryGuid: GUID, + AuditingInformation: ULONG, + AuditCategoryGuid: GUID, +}} +pub type PAUDIT_POLICY_INFORMATION = *mut AUDIT_POLICY_INFORMATION; +pub type LPAUDIT_POLICY_INFORMATION = PAUDIT_POLICY_INFORMATION; +pub type PCAUDIT_POLICY_INFORMATION = *const AUDIT_POLICY_INFORMATION; +pub const AUDIT_SET_SYSTEM_POLICY: ULONG = 0x0001; +pub const AUDIT_QUERY_SYSTEM_POLICY: ULONG = 0x0002; +pub const AUDIT_SET_USER_POLICY: ULONG = 0x0004; +pub const AUDIT_QUERY_USER_POLICY: ULONG = 0x0008; +pub const AUDIT_ENUMERATE_USERS: ULONG = 0x0010; +pub const AUDIT_SET_MISC_POLICY: ULONG = 0x0020; +pub const AUDIT_QUERY_MISC_POLICY: ULONG = 0x0040; +pub const AUDIT_GENERIC_ALL: ULONG = STANDARD_RIGHTS_REQUIRED | AUDIT_SET_SYSTEM_POLICY + | AUDIT_QUERY_SYSTEM_POLICY | AUDIT_SET_USER_POLICY | AUDIT_QUERY_USER_POLICY + | AUDIT_ENUMERATE_USERS | AUDIT_SET_MISC_POLICY | AUDIT_QUERY_MISC_POLICY; +pub const AUDIT_GENERIC_READ: ULONG = STANDARD_RIGHTS_READ | AUDIT_QUERY_SYSTEM_POLICY + | AUDIT_QUERY_USER_POLICY | AUDIT_ENUMERATE_USERS | AUDIT_QUERY_MISC_POLICY; +pub const AUDIT_GENERIC_WRITE: ULONG = STANDARD_RIGHTS_WRITE | AUDIT_SET_USER_POLICY + | AUDIT_SET_MISC_POLICY | AUDIT_SET_SYSTEM_POLICY; +pub const AUDIT_GENERIC_EXECUTE: ULONG = STANDARD_RIGHTS_EXECUTE; +extern "system" { + pub fn AuditSetSystemPolicy( + pAuditPolicy: PCAUDIT_POLICY_INFORMATION, + PolicyCount: ULONG, + ) -> BOOLEAN; + pub fn AuditSetPerUserPolicy( + pSid: *const SID, + pAuditPolicy: PCAUDIT_POLICY_INFORMATION, + PolicyCount: ULONG, + ) -> BOOLEAN; + pub fn AuditQuerySystemPolicy( + pSubCategoryGuids: *const GUID, + PolicyCount: ULONG, + ppAuditPolicy: *mut PAUDIT_POLICY_INFORMATION, + ) -> BOOLEAN; + pub fn AuditQueryPerUserPolicy( + pSid: *const SID, + pSubCategoryGuids: *const GUID, + PolicyCount: ULONG, + ppAuditPolicy: *mut PAUDIT_POLICY_INFORMATION, + ) -> BOOLEAN; + pub fn AuditEnumeratePerUserPolicy( + ppAuditSidArray: *mut PPOLICY_AUDIT_SID_ARRAY, + ) -> BOOLEAN; + pub fn AuditComputeEffectivePolicyBySid( + pSid: *const SID, + pSubCategoryGuids: *const GUID, + dwPolicyCount: ULONG, + ppAuditPolicy: *mut PAUDIT_POLICY_INFORMATION, + ) -> BOOLEAN; + pub fn AuditComputeEffectivePolicyByToken( + hTokenHandle: HANDLE, + pSubCategoryGuids: *const GUID, + dwPolicyCount: ULONG, + ppAuditPolicy: *mut PAUDIT_POLICY_INFORMATION, + ) -> BOOLEAN; + pub fn AuditEnumerateCategories( + ppAuditCategoriesArray: *mut *mut GUID, + pdwCountReturned: PULONG, + ) -> BOOLEAN; + pub fn AuditEnumerateSubCategories( + pAuditCategoryGuid: *const GUID, + bRetrieveAllSubCategories: BOOLEAN, + ppAuditSubCategoriesArray: *mut *mut GUID, + pdwCountReturned: PULONG, + ) -> BOOLEAN; + pub fn AuditLookupCategoryNameW( + pAuditCategoryGuid: *const GUID, + ppszCategoryName: *mut PWSTR, + ) -> BOOLEAN; + pub fn AuditLookupCategoryNameA( + pAuditCategoryGuid: *const GUID, + ppszCategoryName: *mut PSTR, + ) -> BOOLEAN; + pub fn AuditLookupSubCategoryNameW( + pAuditSubCategoryGuid: *const GUID, + ppszSubCategoryName: *mut PWSTR, + ) -> BOOLEAN; + pub fn AuditLookupSubCategoryNameA( + pAuditSubCategoryGuid: *const GUID, + ppszSubCategoryName: *mut PSTR, + ) -> BOOLEAN; + pub fn AuditLookupCategoryIdFromCategoryGuid( + pAuditCategoryGuid: *const GUID, + pAuditCategoryId: PPOLICY_AUDIT_EVENT_TYPE, + ) -> BOOLEAN; + pub fn AuditLookupCategoryGuidFromCategoryId( + AuditCategoryId: POLICY_AUDIT_EVENT_TYPE, + pAuditCategoryGuid: *mut GUID, + ) -> BOOLEAN; + pub fn AuditSetSecurity( + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> BOOLEAN; + pub fn AuditQuerySecurity( + SecurityInformation: SECURITY_INFORMATION, + ppSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + ) -> BOOLEAN; + pub fn AuditSetGlobalSaclW( + ObjectTypeName: PCWSTR, + Acl: PACL, + ) -> BOOLEAN; + pub fn AuditSetGlobalSaclA( + ObjectTypeName: PCSTR, + Acl: PACL, + ) -> BOOLEAN; + pub fn AuditQueryGlobalSaclW( + ObjectTypeName: PCWSTR, + Acl: *mut PACL, + ) -> BOOLEAN; + pub fn AuditQueryGlobalSaclA( + ObjectTypeName: PCSTR, + Acl: *mut PACL, + ) -> BOOLEAN; + pub fn AuditFree( + Buffer: PVOID, + ); +} +STRUCT!{struct PKU2U_CERT_BLOB { + CertOffset: ULONG, + CertLength: USHORT, +}} +pub type PPKU2U_CERT_BLOB = *mut PKU2U_CERT_BLOB; +pub const PKU2U_CREDUI_CONTEXT_VERSION: ULONG64 = 0x4154414454524543; +STRUCT!{struct PKU2U_CREDUI_CONTEXT { + Version: ULONG64, + cbHeaderLength: USHORT, + cbStructureLength: ULONG, + CertArrayCount: USHORT, + CertArrayOffset: ULONG, +}} +pub type PPKU2U_CREDUI_CONTEXT = *mut PKU2U_CREDUI_CONTEXT; +ENUM!{enum PKU2U_LOGON_SUBMIT_TYPE { + Pku2uCertificateS4ULogon = 14, +}} +pub type PPKU2U_LOGON_SUBMIT_TYPE = *mut PKU2U_LOGON_SUBMIT_TYPE; +STRUCT!{struct PKU2U_CERTIFICATE_S4U_LOGON { + MessageType: PKU2U_LOGON_SUBMIT_TYPE, + Flags: ULONG, + UserPrincipalName: UNICODE_STRING, + DomainName: UNICODE_STRING, + CertificateLength: ULONG, + Certificate: PUCHAR, +}} +pub type PPKU2U_CERTIFICATE_S4U_LOGON = *mut PKU2U_CERTIFICATE_S4U_LOGON; diff --git a/bash-5.1/vendor/winapi/src/um/oaidl.rs b/bash-5.1/vendor/winapi/src/um/oaidl.rs new file mode 100644 index 0000000000000000000000000000000000000000..d653f9e5831c9de2a23c29d3b3655ea56874d917 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/oaidl.rs @@ -0,0 +1,915 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of OAIdl.h +use shared::basetsd::ULONG_PTR; +use shared::guiddef::{GUID, IID, REFGUID, REFIID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT, INT, UINT, ULONG, USHORT, WORD}; +use shared::rpcndr::byte; +use shared::wtypes::{ + BSTR, CY, DATE, DECIMAL, VARIANT_BOOL, VARTYPE, VT_BSTR, VT_DISPATCH, VT_ERROR, + VT_I1, VT_I2, VT_I4, VT_I8, VT_RECORD, VT_RESERVED, VT_UNKNOWN, VT_VARIANT, + wireBSTR +}; +use shared::wtypesbase::{ + BYTE_SIZEDARR, DOUBLE, DWORD_SIZEDARR, HYPER_SIZEDARR, LPCOLESTR, LPOLESTR, SCODE, + WORD_SIZEDARR +}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{CHAR, HRESULT, LCID, LONG, LONGLONG, PVOID, SHORT, ULONGLONG}; +pub type CURRENCY = CY; +STRUCT!{struct SAFEARRAYBOUND { + cElements: ULONG, + lLbound: LONG, +}} +pub type LPSAFEARRAYBOUND = *mut SAFEARRAYBOUND; +pub type wireBRECORD = *mut _wireBRECORD; +pub type wireVARIANT = *mut _wireVARIANT; +STRUCT!{struct SAFEARR_BSTR { + Size: ULONG, + aBstr: *mut wireBSTR, +}} +STRUCT!{struct SAFEARR_UNKNOWN { + Size: ULONG, + apUnknown: *mut *mut IUnknown, +}} +STRUCT!{struct SAFEARR_DISPATCH { + Size: ULONG, + apDispatch: *mut *mut IDispatch, +}} +STRUCT!{struct SAFEARR_VARIANT { + Size: ULONG, + aVariant: *mut wireVARIANT, +}} +STRUCT!{struct SAFEARR_BRECORD { + Size: ULONG, + aRecord: *mut wireBRECORD, +}} +STRUCT!{struct SAFEARR_HAVEIID { + Size: ULONG, + apUnknown: *mut *mut IUnknown, + iid: IID, +}} +ENUM!{enum SF_TYPE { + SF_ERROR = VT_ERROR, + SF_I1 = VT_I1, + SF_I2 = VT_I2, + SF_I4 = VT_I4, + SF_I8 = VT_I8, + SF_BSTR = VT_BSTR, + SF_UNKNOWN = VT_UNKNOWN, + SF_DISPATCH = VT_DISPATCH, + SF_VARIANT = VT_VARIANT, + SF_RECORD = VT_RECORD, + SF_HAVEIID = VT_UNKNOWN | VT_RESERVED, +}} +#[cfg(target_pointer_width = "32")] +UNION!{union __MIDL_IOleAutomationTypes_0001 { + [u32; 6], + BstrStr BstrStr_mut: SAFEARR_BSTR, + UnknownStr UnknownStr_mut: SAFEARR_UNKNOWN, + DispatchStr DispatchStr_mut: SAFEARR_DISPATCH, + VariantStr VariantStr_mut: SAFEARR_VARIANT, + RecordStr RecordStr_mut: SAFEARR_BRECORD, + HaveIidStr HaveIidStr_mut: SAFEARR_HAVEIID, + ByteStr ByteStr_mut: BYTE_SIZEDARR, + WordStr WordStr_mut: WORD_SIZEDARR, + LongStr LongStr_mut: DWORD_SIZEDARR, + HyperStr HyperStr_mut: HYPER_SIZEDARR, +}} +#[cfg(target_pointer_width = "64")] +UNION!{union __MIDL_IOleAutomationTypes_0001 { + [u64; 4], + BstrStr BstrStr_mut: SAFEARR_BSTR, + UnknownStr UnknownStr_mut: SAFEARR_UNKNOWN, + DispatchStr DispatchStr_mut: SAFEARR_DISPATCH, + VariantStr VariantStr_mut: SAFEARR_VARIANT, + RecordStr RecordStr_mut: SAFEARR_BRECORD, + HaveIidStr HaveIidStr_mut: SAFEARR_HAVEIID, + ByteStr ByteStr_mut: BYTE_SIZEDARR, + WordStr WordStr_mut: WORD_SIZEDARR, + LongStr LongStr_mut: DWORD_SIZEDARR, + HyperStr HyperStr_mut: HYPER_SIZEDARR, +}} +STRUCT!{struct SAFEARRAYUNION { + sfType: ULONG, + u: __MIDL_IOleAutomationTypes_0001, +}} +STRUCT!{struct _wireSAFEARRAY { + cDims: USHORT, + fFeatures: USHORT, + cbElements: ULONG, + cLocks: ULONG, + uArrayStructs: SAFEARRAYUNION, + rgsaBound: [SAFEARRAYBOUND; 1], +}} +pub type wireSAFEARRAY = *mut _wireSAFEARRAY; +pub type wirePSAFEARRAY = *mut wireSAFEARRAY; +STRUCT!{struct SAFEARRAY { + cDims: USHORT, + fFeatures: USHORT, + cbElements: ULONG, + cLocks: ULONG, + pvData: PVOID, + rgsabound: [SAFEARRAYBOUND; 1], +}} +pub type LPSAFEARRAY = *mut SAFEARRAY; +pub const FADF_AUTO: DWORD = 0x1; +pub const FADF_STATIC: DWORD = 0x2; +pub const FADF_EMBEDDED: DWORD = 0x4; +pub const FADF_FIXEDSIZE: DWORD = 0x10; +pub const FADF_RECORD: DWORD = 0x20; +pub const FADF_HAVEIID: DWORD = 0x40; +pub const FADF_HAVEVARTYPE: DWORD = 0x80; +pub const FADF_BSTR: DWORD = 0x100; +pub const FADF_UNKNOWN: DWORD = 0x200; +pub const FADF_DISPATCH: DWORD = 0x400; +pub const FADF_VARIANT: DWORD = 0x800; +pub const FADF_RESERVED: DWORD = 0xf008; +STRUCT!{struct __tagBRECORD { + pvRecord: PVOID, + pRecInfo: *mut IRecordInfo, +}} +UNION!{union VARIANT_n3 { + [u64; 1] [u64; 2], + llVal llVal_mut: LONGLONG, + lVal lVal_mut: LONG, + bVal bVal_mut: BYTE, + iVal iVal_mut: SHORT, + fltVal fltVal_mut: FLOAT, + dblVal dblVal_mut: DOUBLE, + boolVal boolVal_mut: VARIANT_BOOL, + scode scode_mut: SCODE, + cyVal cyVal_mut: CY, + date date_mut: DATE, + bstrVal bstrVal_mut: BSTR, + punkVal punkVal_mut: *mut IUnknown, + pdispVal pdispVal_mut: *mut IDispatch, + parray parray_mut: *mut SAFEARRAY, + pbVal pbVal_mut: *mut BYTE, + piVal piVal_mut: *mut SHORT, + plVal plVal_mut: *mut LONG, + pllVal pllVal_mut: *mut LONGLONG, + pfltVal pfltVal_mut: *mut FLOAT, + pdblVal pdblVal_mut: *mut DOUBLE, + pboolVal pboolVal_mut: *mut VARIANT_BOOL, + pscode pscode_mut: *mut SCODE, + pcyVal pcyVal_mut: *mut CY, + pdate pdate_mut: *mut DATE, + pbstrVal pbstrVal_mut: *mut BSTR, + ppunkVal ppunkVal_mut: *mut *mut IUnknown, + ppdispVal ppdispVal_mut: *mut *mut IDispatch, + pparray pparray_mut: *mut *mut SAFEARRAY, + pvarVal pvarVal_mut: *mut VARIANT, + byref byref_mut: PVOID, + cVal cVal_mut: CHAR, + uiVal uiVal_mut: USHORT, + ulVal ulVal_mut: ULONG, + ullVal ullVal_mut: ULONGLONG, + intVal intVal_mut: INT, + uintVal uintVal_mut: UINT, + pdecVal pdecVal_mut: *mut DECIMAL, + pcVal pcVal_mut: *mut CHAR, + puiVal puiVal_mut: *mut USHORT, + pulVal pulVal_mut: *mut ULONG, + pullVal pullVal_mut: *mut ULONGLONG, + pintVal pintVal_mut: *mut INT, + puintVal puintVal_mut: *mut UINT, + n4 n4_mut: __tagBRECORD, +}} +STRUCT!{struct __tagVARIANT { + vt: VARTYPE, + wReserved1: WORD, + wReserved2: WORD, + wReserved3: WORD, + n3: VARIANT_n3, +}} +UNION!{union VARIANT_n1 { + [u64; 2] [u64; 3], + n2 n2_mut: __tagVARIANT, + decVal decVal_mut: DECIMAL, +}} +STRUCT!{struct VARIANT { + n1: VARIANT_n1, +}} +pub type LPVARIANT = *mut VARIANT; +pub type VARIANTARG = VARIANT; +pub type LPVARIANTARG = *mut VARIANT; +pub type REFVARIANT = *const VARIANT; +STRUCT!{struct _wireBRECORD { + fFlags: ULONG, + clSize: ULONG, + pRecInfo: *mut IRecordInfo, + pRecord: *mut byte, +}} +UNION!{union _wireVARIANT_u { + [u64; 2], + llVal llVal_mut: LONGLONG, + lVal lVal_mut: LONG, + bVal bVal_mut: BYTE, + iVal iVal_mut: SHORT, + fltVal fltVal_mut: FLOAT, + dblVal dblVal_mut: DOUBLE, + boolVal boolVal_mut: VARIANT_BOOL, + scode scode_mut: SCODE, + cyVal cyVal_mut: CY, + date date_mut: DATE, + bstrVal bstrVal_mut: wireBSTR, + punkVal punkVal_mut: *mut IUnknown, + pdispVal pdispVal_mut: *mut IDispatch, + parray parray_mut: wirePSAFEARRAY, + brecVal brecVal_mut: wireBRECORD, + pbVal pbVal_mut: *mut BYTE, + piVal piVal_mut: *mut SHORT, + plVal plVal_mut: *mut LONG, + pllVal pllVal_mut: *mut LONGLONG, + pfltVal pfltVal_mut: *mut FLOAT, + pdblVal pdblVal_mut: *mut DOUBLE, + pboolVal pboolVal_mut: *mut VARIANT_BOOL, + pscode pscode_mut: *mut SCODE, + pcyVal pcyVal_mut: *mut CY, + pdate pdate_mut: *mut DATE, + pbstrVal pbstrVal_mut: *mut wireBSTR, + ppunkVal ppunkVal_mut: *mut *mut IUnknown, + ppdispVal ppdispVal_mut: *mut *mut IDispatch, + pparray pparray_mut: *mut wirePSAFEARRAY, + pvarVal pvarVal_mut: *mut wireVARIANT, + cVal cVal_mut: CHAR, + uiVal uiVal_mut: USHORT, + ulVal ulVal_mut: ULONG, + ullVal ullVal_mut: ULONGLONG, + intVal intVal_mut: INT, + uintVal uintVal_mut: UINT, + decVal decVal_mut: DECIMAL, + pdecVal pdecVal_mut: *mut DECIMAL, + pcVal pcVal_mut: *mut CHAR, + puiVal puiVal_mut: *mut USHORT, + pulVal pulVal_mut: *mut ULONG, + pullVal pullVal_mut: *mut ULONGLONG, + pintVal pintVal_mut: *mut INT, + puintVal puintVal_mut: *mut UINT, +}} +STRUCT!{struct _wireVARIANT { + clSize: DWORD, + rpcReserved: DWORD, + vt: USHORT, + wReserved1: USHORT, + wReserved2: USHORT, + wReserved3: USHORT, + u: _wireVARIANT_u, +}} +pub type DISPID = LONG; +pub type MEMBERID = DISPID; +pub type HREFTYPE = DWORD; +ENUM!{enum TYPEKIND { + TKIND_ENUM = 0, + TKIND_RECORD, + TKIND_MODULE, + TKIND_INTERFACE, + TKIND_DISPATCH, + TKIND_COCLASS, + TKIND_ALIAS, + TKIND_UNION, + TKIND_MAX, +}} +UNION!{union TYPEDESC_u { + [usize; 1], + lptdesc lptdesc_mut: *mut TYPEDESC, + lpadesc lpadesc_mut: *mut ARRAYDESC, + hreftype hreftype_mut: HREFTYPE, +}} +STRUCT!{struct TYPEDESC { + u: TYPEDESC_u, + vt: VARTYPE, +}} +STRUCT!{struct ARRAYDESC { + tdescElem: TYPEDESC, + cDims: USHORT, + rgbounds: [SAFEARRAYBOUND; 1], +}} +STRUCT!{struct PARAMDESCEX { + cBytes: ULONG, + varDefaultValue: VARIANTARG, +}} +pub type LPPARAMDESCEX = *mut PARAMDESCEX; +STRUCT!{struct PARAMDESC { + pparamdescex: LPPARAMDESCEX, + wParamFlags: USHORT, +}} +pub type LPPARAMDESC = *mut PARAMDESC; +pub const PARAMFLAG_NONE: DWORD = 0; +pub const PARAMFLAG_FIN: DWORD = 0x1; +pub const PARAMFLAG_FOUT: DWORD = 0x2; +pub const PARAMFLAG_FLCID: DWORD = 0x4; +pub const PARAMFLAG_FRETVAL: DWORD = 0x8; +pub const PARAMFLAG_FOPT: DWORD = 0x10; +pub const PARAMFLAG_FHASDEFAULT: DWORD = 0x20; +pub const PARAMFLAG_FHASCUSTDATA: DWORD = 0x40; +STRUCT!{struct IDLDESC { + dwReserved: ULONG_PTR, + wIDLFlags: USHORT, +}} +pub type LPIDLDESC = *mut IDLDESC; +pub const IDLFLAG_NONE: DWORD = PARAMFLAG_NONE; +pub const IDLFLAG_FIN: DWORD = PARAMFLAG_FIN; +pub const IDLFLAG_FOUT: DWORD = PARAMFLAG_FOUT; +pub const IDLFLAG_FLCID: DWORD = PARAMFLAG_FLCID; +pub const IDLFLAG_FRETVAL: DWORD = PARAMFLAG_FRETVAL; +UNION!{union ELEMDESC_u { + [usize; 2], + idldesc idldesc_mut: IDLDESC, + paramdesc paramdesc_mut: PARAMDESC, +}} +STRUCT!{struct ELEMDESC { + tdesc: TYPEDESC, + u: ELEMDESC_u, +}} +pub type LPELEMDESC = *mut ELEMDESC; +STRUCT!{struct TYPEATTR { + guid: GUID, + lcid: LCID, + dwReserved: DWORD, + memidConstructor: MEMBERID, + memidDestructor: MEMBERID, + lpstrSchema: LPOLESTR, + cbSizeInstance: ULONG, + typekind: TYPEKIND, + cFuncs: WORD, + cVars: WORD, + cImplTypes: WORD, + cbSizeVft: WORD, + cbAlignment: WORD, + wTypeFlags: WORD, + wMajorVerNum: WORD, + wMinorVerNum: WORD, + tdescAlias: TYPEDESC, + idldescType: IDLDESC, +}} +pub type LPTYPEATTR = *mut TYPEATTR; +STRUCT!{struct DISPPARAMS { + rgvarg: *mut VARIANTARG, + rgdispidNamedArgs: *mut DISPID, + cArgs: UINT, + cNamedArgs: UINT, +}} +STRUCT!{struct EXCEPINFO { + wCode: WORD, + wReserved: WORD, + bstrSource: BSTR, + bstrDescription: BSTR, + bstrHelpFile: BSTR, + dwHelpContext: DWORD, + pvReserved: PVOID, + pfnDeferredFillIn: Option HRESULT>, + scode: SCODE, +}} +ENUM!{enum CALLCONV { + CC_FASTCALL = 0, + CC_CDECL = 1, + CC_MSCPASCAL, + CC_PASCAL, + CC_MACPASCAL, + CC_STDCALL, + CC_FPFASTCALL, + CC_SYSCALL, + CC_MPWCDECL, + CC_MPWPASCAL, + CC_MAX, +}} +ENUM!{enum FUNCKIND { + FUNC_VIRTUAL = 0, + FUNC_PUREVIRTUAL, + FUNC_NONVIRTUAL, + FUNC_STATIC, + FUNC_DISPATCH, +}} +ENUM!{enum INVOKEKIND { + INVOKE_FUNC = 1, + INVOKE_PROPERTYGET = 2, + INVOKE_PROPERTYPUT = 4, + INVOKE_PROPERTYPUTREF = 8, +}} +STRUCT!{struct FUNCDESC { + memid: MEMBERID, + lprgscode: *mut SCODE, + lprgelemdescParam: *mut ELEMDESC, + funckind: FUNCKIND, + invkind: INVOKEKIND, + callconv: CALLCONV, + cParams: SHORT, + cParamsOpt: SHORT, + oVft: SHORT, + cScodes: SHORT, + elemdescFunc: ELEMDESC, + wFuncFlags: WORD, +}} +pub type LPFUNCDESC = *mut FUNCDESC; +ENUM!{enum VARKIND { + VAR_PERINSTANCE = 0, + VAR_STATIC, + VAR_CONST, + VAR_DISPATCH, +}} +pub const IMPLTYPEFLAG_FDEFAULT: DWORD = 0x1; +pub const IMPLTYPEFLAG_FSOURCE: DWORD = 0x2; +pub const IMPLTYPEFLAG_FRESTRICTED: DWORD = 0x4; +pub const IMPLTYPEFLAG_FDEFAULTVTABLE: DWORD = 0x8; +UNION!{union VARDESC_u { + [usize; 1], + oInst oInst_mut: ULONG, + lpvarValue lpvarValue_mut: *mut VARIANT, +}} +STRUCT!{struct VARDESC { + memid: MEMBERID, + lpstrSchema: LPOLESTR, + u: VARDESC_u, + elemdescVar: ELEMDESC, + wVarFlags: WORD, + varkind: VARKIND, +}} +pub type LPVARDESC = *mut VARDESC; +ENUM!{enum TYPEFLAGS { + TYPEFLAG_FAPPOBJECT = 0x1, + TYPEFLAG_FCANCREATE = 0x2, + TYPEFLAG_FLICENSED = 0x4, + TYPEFLAG_FPREDECLID = 0x8, + TYPEFLAG_FHIDDEN = 0x10, + TYPEFLAG_FCONTROL = 0x20, + TYPEFLAG_FDUAL = 0x40, + TYPEFLAG_FNONEXTENSIBLE = 0x80, + TYPEFLAG_FOLEAUTOMATION = 0x100, + TYPEFLAG_FRESTRICTED = 0x200, + TYPEFLAG_FAGGREGATABLE = 0x400, + TYPEFLAG_FREPLACEABLE = 0x800, + TYPEFLAG_FDISPATCHABLE = 0x1000, + TYPEFLAG_FREVERSEBIND = 0x2000, + TYPEFLAG_FPROXY = 0x4000, +}} +ENUM!{enum FUNCFLAGS { + FUNCFLAG_FRESTRICTED = 0x1, + FUNCFLAG_FSOURCE = 0x2, + FUNCFLAG_FBINDABLE = 0x4, + FUNCFLAG_FREQUESTEDIT = 0x8, + FUNCFLAG_FDISPLAYBIND = 0x10, + FUNCFLAG_FDEFAULTBIND = 0x20, + FUNCFLAG_FHIDDEN = 0x40, + FUNCFLAG_FUSESGETLASTERROR = 0x80, + FUNCFLAG_FDEFAULTCOLLELEM = 0x100, + FUNCFLAG_FUIDEFAULT = 0x200, + FUNCFLAG_FNONBROWSABLE = 0x400, + FUNCFLAG_FREPLACEABLE = 0x800, + FUNCFLAG_FIMMEDIATEBIND = 0x1000, +}} +ENUM!{enum VARFLAGS { + VARFLAG_FREADONLY = 0x1, + VARFLAG_FSOURCE = 0x2, + VARFLAG_FBINDABLE = 0x4, + VARFLAG_FREQUESTEDIT = 0x8, + VARFLAG_FDISPLAYBIND = 0x10, + VARFLAG_FDEFAULTBIND = 0x20, + VARFLAG_FHIDDEN = 0x40, + VARFLAG_FRESTRICTED = 0x80, + VARFLAG_FDEFAULTCOLLELEM = 0x100, + VARFLAG_FUIDEFAULT = 0x200, + VARFLAG_FNONBROWSABLE = 0x400, + VARFLAG_FREPLACEABLE = 0x800, + VARFLAG_FIMMEDIATEBIND = 0x1000, +}} +STRUCT!{struct CLEANLOCALSTORAGE { + pInterface: *mut IUnknown, + pStorage: PVOID, + flags: DWORD, +}} +STRUCT!{struct CUSTDATAITEM { + guid: GUID, + varValue: VARIANTARG, +}} +pub type LPCUSTDATAITEM = *mut CUSTDATAITEM; +STRUCT!{struct CUSTDATA { + cCustData: DWORD, + prgCustData: LPCUSTDATAITEM, +}} +pub type LPCUSTDATA = *mut CUSTDATA; +pub type LPCREATETYPEINFO = *mut ICreateTypeInfo; +RIDL!{#[uuid(0x00020405, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ICreateTypeInfo(ICreateTypeInfoVtbl): IUnknown(IUnknownVtbl) { + fn SetGuid( + guid: REFGUID, + ) -> HRESULT, + fn SetTypeFlags( + uTypeFlags: UINT, + ) -> HRESULT, + fn SetDocString( + pStrDoc: LPOLESTR, + ) -> HRESULT, + fn SetHelpContext( + dwHelpContext: DWORD, + ) -> HRESULT, + fn SetVersion( + wMajorVerNum: WORD, + wMinorVerNum: WORD, + ) -> HRESULT, + fn AddRefTypeInfo( + pTInfo: *mut ITypeInfo, + ) -> HRESULT, + fn AddFuncDesc( + index: UINT, + pFuncDesc: *mut FUNCDESC, + ) -> HRESULT, + fn SetImplTypeFlags( + index: UINT, + implTypeFlags: INT, + ) -> HRESULT, + fn SetAlignment( + cbAlignment: WORD, + ) -> HRESULT, + fn SetSchema( + pStrSchema: LPOLESTR, + ) -> HRESULT, + fn AddVarDesc( + index: UINT, + pVarDesc: *mut VARDESC, + ) -> HRESULT, + fn SetFuncAndParamNames( + index: UINT, + rgszNames: *mut LPOLESTR, + cNames: UINT, + ) -> HRESULT, + fn SetVarName( + index: UINT, + szName: LPOLESTR, + ) -> HRESULT, + fn SetTypeDescAlias( + pTDescAlias: *mut TYPEDESC, + ) -> HRESULT, + fn DefineFuncAsDllEntry( + index: UINT, + szDllName: LPOLESTR, + szProcName: LPOLESTR, + ) -> HRESULT, + fn SetFuncDocString( + index: UINT, + szDocString: LPOLESTR, + ) -> HRESULT, + fn SetVarDocString( + index: UINT, + szDocString: LPOLESTR, + ) -> HRESULT, + fn SetFuncHelpContext( + index: UINT, + dwHelpContext: DWORD, + ) -> HRESULT, + fn SetVarHelpContext( + index: UINT, + dwHelpContext: DWORD, + ) -> HRESULT, + fn SetMops( + index: UINT, + bstrMops: BSTR, + ) -> HRESULT, + fn SetTypeIdldesc( + pIdlDesc: *mut IDLDESC, + ) -> HRESULT, + fn LayOut() -> HRESULT, +}} +// LPCREATETYPEINFO2 +// ICreateTypeInfo2 +// LPCREATETYPELIB +// ICreateTypeLib +// LPCREATETYPELIB2 +// ICreateTypeLib2 +pub type LPDISPATCH = *mut IDispatch; +pub const DISPID_UNKNOWN: INT = -1; +pub const DISPID_VALUE: INT = 0; +pub const DISPID_PROPERTYPUT: INT = -3; +pub const DISPID_NEWENUM: INT = -4; +pub const DISPID_EVALUATE: INT = -5; +pub const DISPID_CONSTRUCTOR: INT = -6; +pub const DISPID_DESTRUCTOR: INT = -7; +pub const DISPID_COLLECT: INT = -8; +RIDL!{#[uuid(0x00020400, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IDispatch(IDispatchVtbl): IUnknown(IUnknownVtbl) { + fn GetTypeInfoCount( + pctinfo: *mut UINT, + ) -> HRESULT, + fn GetTypeInfo( + iTInfo: UINT, + lcid: LCID, + ppTInfo: *mut *mut ITypeInfo, + ) -> HRESULT, + fn GetIDsOfNames( + riid: REFIID, + rgszNames: *mut LPOLESTR, + cNames: UINT, + lcid: LCID, + rgDispId: *mut DISPID, + ) -> HRESULT, + fn Invoke( + dispIdMember: DISPID, + riid: REFIID, + lcid: LCID, + wFlags: WORD, + pDispParams: *mut DISPPARAMS, + pVarResult: *mut VARIANT, + pExcepInfo: *mut EXCEPINFO, + puArgErr: *mut UINT, + ) -> HRESULT, +}} +// IDispatch_RemoteInvoke_Proxy +// IDispatch_RemoteInvoke_Stub +// LPENUMVARIANT +// IEnumVARIANT +// IEnumVARIANT_RemoteNext_Proxy +// IEnumVARIANT_RemoteNext_Stub +RIDL!{#[uuid(0x0000002F, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IRecordInfo(IRecordInfoVtbl): IUnknown(IUnknownVtbl) { + fn RecordInit( + pvNew: PVOID, + ) -> HRESULT, + fn RecordClear( + pvExisting: PVOID, + ) -> HRESULT, + fn RecordCopy( + pvExisting: PVOID, + pvNew: PVOID, + ) -> HRESULT, + fn GetGuid( + pguid: *mut GUID, + ) -> HRESULT, + fn GetName( + pbstrName: *mut BSTR, + ) -> HRESULT, + fn GetSize( + pcbSize: *mut ULONG, + ) -> HRESULT, + fn GetTypeInfo( + ppTypeInfo: *mut *mut ITypeInfo, + ) -> HRESULT, + fn GetField( + pvData: PVOID, + szFieldName: LPCOLESTR, + pvarField: *mut VARIANT, + ) -> HRESULT, + fn GetFieldNoCopy( + pvData: PVOID, + szFieldName: LPCOLESTR, + pvarField: *mut VARIANT, + ppvDataCArray: *mut PVOID, + ) -> HRESULT, + fn PutField( + wFlags: ULONG, + pvData: PVOID, + szFieldName: LPCOLESTR, + pvarField: *mut VARIANT, + ) -> HRESULT, + fn PutFieldNoCopy( + wFlags: ULONG, + pvData: PVOID, + szFieldName: LPCOLESTR, + pvarField: *mut VARIANT, + ) -> HRESULT, + fn GetFieldNames( + pcNames: *mut ULONG, + rgBstrNames: *mut BSTR, + ) -> HRESULT, + fn IsMatchingType( + pRecordInfo: *mut IRecordInfo, + ) -> BOOL, + fn RecordCreate() -> PVOID, + fn RecordCreateCopy( + pvSource: PVOID, + ppvDest: *mut PVOID, + ) -> HRESULT, + fn RecordDestroy( + pvRecord: PVOID, + ) -> HRESULT, +}} +pub type LPTYPECOMP = *mut ITypeComp; +ENUM!{enum DESCKIND { + DESCKIND_NONE = 0, + DESCKIND_FUNCDESC = DESCKIND_NONE + 1, + DESCKIND_VARDESC = DESCKIND_FUNCDESC + 1, + DESCKIND_TYPECOMP = DESCKIND_VARDESC + 1, + DESCKIND_IMPLICITAPPOBJ = DESCKIND_TYPECOMP + 1, + DESCKIND_MAX = DESCKIND_IMPLICITAPPOBJ + 1, +}} +UNION!{union BINDPTR { + [usize; 1], + lpfuncdesc lpfuncdesc_mut: *mut FUNCDESC, + lpvardesc lpvardesc_mut: *mut VARDESC, + lptcomp lptcomp_mut: *mut ITypeComp, +}} +pub type LPBINDPTR = *mut BINDPTR; +RIDL!{#[uuid(0x00020403, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ITypeComp(ITypeCompVtbl): IUnknown(IUnknownVtbl) { + fn Bind( + szName: LPOLESTR, + lHashVal: ULONG, + wFlags: WORD, + ppTInfo: *mut *mut ITypeInfo, + pDescKind: *mut DESCKIND, + pBindPtr: *mut BINDPTR, + ) -> HRESULT, + fn BindType( + szName: LPOLESTR, + lHashVal: ULONG, + ppTInfo: *mut *mut ITypeInfo, + ppTComp: *mut *mut ITypeComp, + ) -> HRESULT, +}} +ENUM!{enum SYSKIND { + SYS_WIN16 = 0, + SYS_WIN32, + SYS_MAC, + SYS_WIN64, +}} +STRUCT!{struct TLIBATTR { + guid: GUID, + lcid: LCID, + syskind: SYSKIND, + wMajorVerNum: WORD, + wMinorVerNum: WORD, + wLibFlags: WORD, +}} +RIDL!{#[uuid(0x00020402, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ITypeLib(ITypeLibVtbl): IUnknown(IUnknownVtbl) { + fn GetTypeInfoCount() -> UINT, + fn GetTypeInfo( + index: UINT, + ppTInfo: *mut *mut ITypeInfo, + ) -> HRESULT, + fn GetTypeInfoType( + index: UINT, + pTKind: *mut TYPEKIND, + ) -> HRESULT, + fn GetTypeInfoOfGuid( + guid: REFGUID, + ppTInfo: *mut *mut ITypeInfo, + ) -> HRESULT, + fn GetLibAttr( + ppTLibAttr: *mut *mut TLIBATTR, + ) -> HRESULT, + fn GetTypeComp( + ppTComp: *mut *mut ITypeComp, + ) -> HRESULT, + fn GetDocumentation( + index: INT, + pbstrName: *mut BSTR, + pBstrDocString: *mut BSTR, + pdwHelpContext: *mut DWORD, + pBstrHelpFile: *mut BSTR, + ) -> HRESULT, + fn IsName( + szNameBuf: LPOLESTR, + lHashVal: ULONG, + pfName: *mut BOOL, + ) -> HRESULT, + fn FindName( + szNameBuf: LPOLESTR, + lHashVal: ULONG, + ppTInfo: *mut *mut ITypeInfo, + rgMemId: *mut MEMBERID, + pcFound: *mut USHORT, + ) -> HRESULT, + fn ReleaseTLibAttr( + pTLibAttr: *const TLIBATTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00020401, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ITypeInfo(ITypeInfoVtbl): IUnknown(IUnknownVtbl) { + fn GetTypeAttr( + ppTypeAttr: *mut *mut TYPEATTR, + ) -> HRESULT, + fn GetTypeComp( + ppTComp: *mut *mut ITypeComp, + ) -> HRESULT, + fn GetFuncDesc( + index: UINT, + ppFunDesc: *mut *mut FUNCDESC, + ) -> HRESULT, + fn GetVarDesc( + index: UINT, + pPVarDesc: *mut *mut VARDESC, + ) -> HRESULT, + fn GetNames( + memid: MEMBERID, + rgBstrNames: *mut BSTR, + cMaxNames: UINT, + pcNames: *mut UINT, + ) -> HRESULT, + fn GetRefTypeOfImplType( + index: UINT, + pRefType: *mut HREFTYPE, + ) -> HRESULT, + fn GetImplTypeFlags( + index: UINT, + pImplTypeFlags: *mut INT, + ) -> HRESULT, + fn GetIDsOfNames( + rgszNames: *mut LPOLESTR, + cNames: UINT, + pMemId: *mut MEMBERID, + ) -> HRESULT, + fn Invoke( + pvInstance: PVOID, + memid: MEMBERID, + wFlags: WORD, + pDispParams: *mut DISPPARAMS, + pVarResult: *mut VARIANT, + pExcepInfo: *mut EXCEPINFO, + puArgErr: *mut UINT, + ) -> HRESULT, + fn GetDocumentation( + memid: MEMBERID, + pBstrName: *mut BSTR, + pBstrDocString: *mut BSTR, + pdwHelpContext: *mut DWORD, + pBstrHelpFile: *mut BSTR, + ) -> HRESULT, + fn GetDllEntry( + memid: MEMBERID, + invKind: INVOKEKIND, + pBstrDllName: *mut BSTR, + pBstrName: *mut BSTR, + pwOrdinal: *mut WORD, + ) -> HRESULT, + fn GetRefTypeInfo( + hRefType: HREFTYPE, + ppTInfo: *mut *mut ITypeInfo, + ) -> HRESULT, + fn AddressOfMember( + memid: MEMBERID, + invKind: INVOKEKIND, + ppv: *mut PVOID, + ) -> HRESULT, + fn CreateInstance( + pUnkOuter: *mut IUnknown, + riid: REFIID, + ppvObj: *mut PVOID, + ) -> HRESULT, + fn GetMops( + memid: MEMBERID, + pBstrMops: *mut BSTR, + ) -> HRESULT, + fn GetContainingTypeLib( + ppTLib: *mut *mut ITypeLib, + pIndex: *mut UINT, + ) -> HRESULT, + fn ReleaseTypeAttr( + pTypeAttr: *mut TYPEATTR, + ) -> (), + fn ReleaseFuncDesc( + pFuncDesc: *mut FUNCDESC, + ) -> (), + fn ReleaseVarDesc( + pVarDesc: *mut VARDESC, + ) -> (), +}} +RIDL!{#[uuid(0x1cf2b120, 0x547d, 0x101b, 0x8e, 0x65, 0x08, 0x00, 0x2b, 0x2b, 0xd1, 0x19)] +interface IErrorInfo(IErrorInfoVtbl): IUnknown(IUnknownVtbl) { + fn GetGUID( + pGUID: *mut GUID, + ) -> HRESULT, + fn GetSource( + pBstrSource: *mut BSTR, + ) -> HRESULT, + fn GetDescription( + pBstrDescription: *mut BSTR, + ) -> HRESULT, + fn GetHelpFile( + pBstrHelpFile: *mut BSTR, + ) -> HRESULT, + fn GetHelpContext( + pdwHelpContext: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x22f03340, 0x547d, 0x101b, 0x8e, 0x65, 0x08, 0x00, 0x2b, 0x2b, 0xd1, 0x19)] +interface ICreateErrorInfo(ICreateErrorInfoVtbl): IUnknown(IUnknownVtbl) { + fn SetGUID( + rguid: REFGUID, + ) -> HRESULT, + fn SetSource( + szSource: LPOLESTR, + ) -> HRESULT, + fn SetDescription( + szDescription: LPOLESTR, + ) -> HRESULT, + fn SetHelpFile( + szHelpFile: LPOLESTR, + ) -> HRESULT, + fn SetHelpContext( + dwHelpContext: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3127ca40, 0x446e, 0x11ce, 0x81, 0x35, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51)] +interface IErrorLog(IErrorLogVtbl): IUnknown(IUnknownVtbl) { + fn AddError( + pszPropName: LPCOLESTR, + pExcepInfo: *const EXCEPINFO, + ) -> HRESULT, +}} +pub type LPERRORLOG = *mut IErrorLog; diff --git a/bash-5.1/vendor/winapi/src/um/objbase.rs b/bash-5.1/vendor/winapi/src/um/objbase.rs new file mode 100644 index 0000000000000000000000000000000000000000..7cafface23cdbd97f68261e316fa97fba6fda62e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/objbase.rs @@ -0,0 +1,64 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Component object model defintions +use shared::minwindef::LPVOID; +use um::combaseapi::COINITBASE_MULTITHREADED; +use um::winnt::HRESULT; +ENUM!{enum COINIT { + COINIT_APARTMENTTHREADED = 0x2, + COINIT_MULTITHREADED = COINITBASE_MULTITHREADED, + COINIT_DISABLE_OLE1DDE = 0x4, + COINIT_SPEED_OVER_MEMORY = 0x8, +}} + // pub fn CoBuildVersion(); +extern "system" { + pub fn CoInitialize( + pvReserved: LPVOID, + ) -> HRESULT; +} + // pub fn CoRegisterMallocSpy(); + // pub fn CoRevokeMallocSpy(); + // pub fn CoRegisterInitializeSpy(); + // pub fn CoRevokeInitializeSpy(); + // pub fn CoGetSystemSecurityPermissions(); + // pub fn CoLoadLibrary(); + // pub fn CoFreeLibrary(); + // pub fn CoFreeAllLibraries(); + // pub fn CoGetInstanceFromFile(); + // pub fn CoGetInstanceFromIStorage(); + // pub fn CoAllowSetForegroundWindow(); + // pub fn DcomChannelSetHResult(); + // pub fn CoIsOle1Class(); + // pub fn CLSIDFromProgIDEx(); + // pub fn CoFileTimeToDosDateTime(); + // pub fn CoDosDateTimeToFileTime(); + // pub fn CoFileTimeNow(); + // pub fn CoRegisterMessageFilter(); + // pub fn CoRegisterChannelHook(); + // pub fn CoTreatAsClass(); + // pub fn CreateDataAdviseHolder(); + // pub fn CreateDataCache(); + // pub fn StgOpenAsyncDocfileOnIFillLockBytes(); + // pub fn StgGetIFillLockBytesOnILockBytes(); + // pub fn StgGetIFillLockBytesOnFile(); + // pub fn StgOpenLayoutDocfile(); + // pub fn CoInstall(); + // pub fn BindMoniker(); + // pub fn CoGetObject(); + // pub fn MkParseDisplayName(); + // pub fn MonikerRelativePathTo(); + // pub fn MonikerCommonPrefixWith(); + // pub fn CreateBindCtx(); + // pub fn CreateGenericComposite(); + // pub fn GetClassFile(); + // pub fn CreateClassMoniker(); + // pub fn CreateFileMoniker(); + // pub fn CreateItemMoniker(); + // pub fn CreateAntiMoniker(); + // pub fn CreatePointerMoniker(); + // pub fn CreateObjrefMoniker(); + // pub fn GetRunningObjectTable(); + // pub fn CreateStdProgressIndicator(); diff --git a/bash-5.1/vendor/winapi/src/um/objidl.rs b/bash-5.1/vendor/winapi/src/um/objidl.rs new file mode 100644 index 0000000000000000000000000000000000000000..067fb8c88f5cd367c27aa835f847d4f99f9e915b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/objidl.rs @@ -0,0 +1,525 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! this ALWAYS GENERATED file contains the definitions for the interfaces +use ctypes::c_void; +use shared::basetsd::UINT64; +use shared::guiddef::{CLSID, IID, REFCLSID, REFIID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FILETIME, HGLOBAL, ULONG, WORD}; +use shared::ntdef::LONG; +use shared::windef::{HBITMAP, HENHMETAFILE}; +use shared::wtypes::{CLIPFORMAT, HMETAFILEPICT}; +use shared::wtypesbase::{LPCOLESTR, LPOLESTR, OLECHAR}; +use um::objidlbase::{IEnumString, IStream, STATSTG}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, ULARGE_INTEGER}; +//8402 +STRUCT!{struct BIND_OPTS { + cbStruct: DWORD, + grfFlags: DWORD, + grfMode: DWORD, + dwTickCountDeadline: DWORD, +}} +pub type LPBIND_OPTS = *mut BIND_OPTS; +//8479 +RIDL!{#[uuid(0x0000000e, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IBindCtx(IBindCtxVtbl): IUnknown(IUnknownVtbl) { + fn RegisterObjectBound( + punk: *mut IUnknown, + ) -> HRESULT, + fn RevokeObjectBound( + punk: *mut IUnknown, + ) -> HRESULT, + fn ReleaseBoundObjects() -> HRESULT, + fn SetBindOptions( + pbindopts: *mut BIND_OPTS, + ) -> HRESULT, + fn GetBindOptions( + pbindopts: *mut BIND_OPTS, + ) -> HRESULT, + fn GetRunningObjectTable( + pprot: *mut *mut IRunningObjectTable, + ) -> HRESULT, + fn RegisterObjectParam( + pszKey: LPOLESTR, + punk: *mut IUnknown, + ) -> HRESULT, + fn GetObjectParam( + pszKey: LPOLESTR, + ppunk: *mut *mut IUnknown, + ) -> HRESULT, + fn EnumObjectParam( + ppenum: *mut *mut IEnumString, + ) -> HRESULT, + fn RevokeObjectParam( + pszKey: LPOLESTR, + ) -> HRESULT, +}} +//8681 +RIDL!{#[uuid(0x00000102, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IEnumMoniker(IEnumMonikerVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut *mut IMoniker, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumMoniker, + ) -> HRESULT, +}} +//8958 +RIDL!{#[uuid(0x00000010, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IRunningObjectTable(IRunningObjectTableVtbl): IUnknown(IUnknownVtbl) { + fn Register( + grfFlags: DWORD, + punkObject: *mut IUnknown, + pmkObjectName: *mut IMoniker, + pdwRegister: *mut DWORD, + ) -> HRESULT, + fn Revoke( + dwRegister: DWORD, + ) -> HRESULT, + fn IsRunning( + pmkObjectName: *mut IMoniker, + ) -> HRESULT, + fn GetObject( + pmkObjectName: *mut IMoniker, + ppunkObject: *mut *mut IUnknown, + ) -> HRESULT, + fn NoteChangeTime( + dwRegister: DWORD, + pfiletime: *mut FILETIME, + ) -> HRESULT, + fn GetTimeOfLastChange( + pmkObjectName: *mut IMoniker, + pfiletime: *mut FILETIME, + ) -> HRESULT, + fn EnumRunning( + ppenumMoniker: *mut *mut IEnumMoniker, + ) -> HRESULT, +}} +//9125 +RIDL!{#[uuid(0x0000010c, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IPersist(IPersistVtbl): IUnknown(IUnknownVtbl) { + fn GetClassID( + pClassID: *mut CLSID, + ) -> HRESULT, +}} +//9207 +RIDL!{#[uuid(0x00000109, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IPersistStream(IPersistStreamVtbl): IPersist(IPersistVtbl) { + fn IsDirty() -> HRESULT, + fn Load( + pStm: *mut IStream, + ) -> HRESULT, + fn Save( + pStm: *mut IStream, + fClearDirty: BOOL, + ) -> HRESULT, + fn GetSizeMax( + pcbSize: *mut ULARGE_INTEGER, + ) -> HRESULT, +}} +//9350 +RIDL!{#[uuid(0x0000000f, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IMoniker(IMonikerVtbl): IPersistStream(IPersistStreamVtbl) { + fn BindToObject( + pbc: *mut IBindCtx, + pmkToLeft: *mut IMoniker, + riidResult: REFIID, + ppvResult: *mut *mut c_void, + ) -> HRESULT, + fn BindToStorage( + pbc: *mut IBindCtx, + pmkToLeft: *mut IMoniker, + riid: REFIID, + ppvObj: *mut *mut c_void, + ) -> HRESULT, + fn Reduce( + pbc: *mut IBindCtx, + dwReduceHowFar: DWORD, + ppmkToLeft: *mut *mut IMoniker, + ppmkReduced: *mut *mut IMoniker, + ) -> HRESULT, + fn ComposeWith( + pmkRight: *mut IMoniker, + fOnlyIfNotGeneric: BOOL, + ppmkComposite: *mut *mut IMoniker, + ) -> HRESULT, + fn Enum( + fForward: BOOL, + ppenumMoniker: *mut *mut IEnumMoniker, + ) -> HRESULT, + fn IsEqual( + pmkOtherMoniker: *mut IMoniker, + ) -> HRESULT, + fn Hash( + pdwHash: *mut DWORD, + ) -> HRESULT, + fn IsRunning( + pbc: *mut IBindCtx, + pmkToLeft: *mut IMoniker, + pmkNewlyRunning: *mut IMoniker, + ) -> HRESULT, + fn GetTimeOfLastChange( + pbc: *mut IBindCtx, + pmkToLeft: *mut IMoniker, + pFileTime: *mut FILETIME, + ) -> HRESULT, + fn Inverse( + ppmk: *mut *mut IMoniker, + ) -> HRESULT, + fn CommonPrefixWith( + pmkOther: *mut IMoniker, + ppmkPrefix: *mut *mut IMoniker, + ) -> HRESULT, + fn RelativePathTo( + pmkOther: *mut IMoniker, + ppmkRelPath: *mut *mut IMoniker, + ) -> HRESULT, + fn GetDisplayName( + pbc: *mut IBindCtx, + pmkToLeft: *mut IMoniker, + ppszDisplayName: *mut LPOLESTR, + ) -> HRESULT, + fn ParseDisplayName( + pbc: *mut IBindCtx, + pmkToLeft: *mut IMoniker, + pszDisplayName: LPOLESTR, + pchEaten: *mut ULONG, + ppmkOut: *mut *mut IMoniker, + ) -> HRESULT, + fn IsSystemMoniker( + pdwMksys: *mut DWORD, + ) -> HRESULT, +}} +ENUM!{enum EOLE_AUTHENTICATION_CAPABILITIES { + EOAC_NONE = 0, + EOAC_MUTUAL_AUTH = 0x1, + EOAC_STATIC_CLOAKING = 0x20, + EOAC_DYNAMIC_CLOAKING = 0x40, + EOAC_ANY_AUTHORITY = 0x80, + EOAC_MAKE_FULLSIC = 0x100, + EOAC_DEFAULT = 0x800, + EOAC_SECURE_REFS = 0x2, + EOAC_ACCESS_CONTROL = 0x4, + EOAC_APPID = 0x8, + EOAC_DYNAMIC = 0x10, + EOAC_REQUIRE_FULLSIC = 0x200, + EOAC_AUTO_IMPERSONATE = 0x400, + EOAC_NO_CUSTOM_MARSHAL = 0x2000, + EOAC_DISABLE_AAA = 0x1000, +}} +STRUCT!{struct SOLE_AUTHENTICATION_SERVICE { + dwAuthnSvc: DWORD, + dwAuthzSvc: DWORD, + pPrincipalName: *mut OLECHAR, + hr: HRESULT, +}} +RIDL!{#[uuid(0x0000000d, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IEnumSTATSTG(IEnumSTATSTGVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut STATSTG, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumSTATSTG, + ) -> HRESULT, +}} +pub type SNB = *const *const OLECHAR; +RIDL!{#[uuid(0x0000000b, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IStorage(IStorageVtbl): IUnknown(IUnknownVtbl) { + fn CreateStream( + pwcsName: *const OLECHAR, + grfMode: DWORD, + reserved1: DWORD, + reserved2: DWORD, + ppstm: *mut *mut IStream, + ) -> HRESULT, + fn OpenStream( + pwcsName: *const OLECHAR, + reserved1: *const c_void, + grfMode: DWORD, + reserved2: DWORD, + ppstm: *mut *mut IStream, + ) -> HRESULT, + fn CreateStorage( + pwcsName: *const OLECHAR, + grfMode: DWORD, + reserved1: DWORD, + reserved2: DWORD, + ppstg: *mut *mut IStorage, + ) -> HRESULT, + fn OpenStorage( + pwcsName: *const OLECHAR, + pstgPriority: IStorage, + grfMode: DWORD, + snbExclude: SNB, + reserved: DWORD, + ppstg: *mut *mut IStorage, + ) -> HRESULT, + fn CopyTo( + ciidExclude: DWORD, + rgiidExclude: *const IID, + snbExclude: SNB, + pstgDest: *const IStorage, + ) -> HRESULT, + fn MoveElementTo( + pwcsName: *const OLECHAR, + pstgDest: *const IStorage, + pwcsNewName: *const OLECHAR, + grfFlags: DWORD, + ) -> HRESULT, + fn Commit( + grfCommitFlags: DWORD, + ) -> HRESULT, + fn Revert() -> HRESULT, + fn EnumElements( + reserved1: DWORD, + reserved2: *const c_void, + reserved3: DWORD, + ppenum: *mut *mut IEnumSTATSTG, + ) -> HRESULT, + fn DestroyElement( + pwcsName: *const OLECHAR, + ) -> HRESULT, + fn RenameElement( + pwcsOldName: *const OLECHAR, + pwcsNewName: *const OLECHAR, + ) -> HRESULT, + fn SetElementTimes( + pwcsName: *const OLECHAR, + pctime: *const FILETIME, + patime: *const FILETIME, + pmtime: *const FILETIME, + ) -> HRESULT, + fn SetClass( + clsid: REFCLSID, + ) -> HRESULT, + fn SetStateBits( + grfStateBits: DWORD, + grfMask: DWORD, + ) -> HRESULT, + fn Stat( + pstatstg: *mut STATSTG, + grfStatFlag: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0000010b, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IPersistFile(IPersistFileVtbl): IPersist(IPersistVtbl) { + fn IsDirty() -> HRESULT, + fn Load( + pszFileName: LPCOLESTR, + dwMode: DWORD, + ) -> HRESULT, + fn Save( + pszFileName: LPCOLESTR, + fRemember: BOOL, + ) -> HRESULT, + fn SaveCompleted( + pszFileName: LPCOLESTR, + ) -> HRESULT, + fn GetCurFile( + ppszFileName: *mut LPOLESTR, + ) -> HRESULT, +}} +STRUCT!{struct DVTARGETDEVICE { + tdSize: DWORD, + tdDriverNameOffset: WORD, + tdDeviceNameOffset: WORD, + tdPortNameOffset: WORD, + tdExtDevmodeOFfset: WORD, + tdData: [BYTE; 1], +}} +STRUCT!{struct FORMATETC { + cfFormat: CLIPFORMAT, + ptd: *const DVTARGETDEVICE, + dwAspect: DWORD, + lindex: LONG, + tymed: DWORD, +}} +RIDL!{#[uuid(0x00000103, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IEnumFORMATETC(IEnumFORMATETCVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut FORMATETC, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumFORMATETC, + ) -> HRESULT, +}} +ENUM!{enum ADVF { + ADVF_NODATA = 1, + ADVF_PRIMEFIRST = 2, + ADVF_ONLYONCE = 4, + ADVF_DATAONSTOP = 64, + ADVFCACHE_NOHANDLER = 8, + ADVFCACHE_FORCEBUILTIN = 16, + ADVFCACHE_ONSAVE = 32, +}} +STRUCT!{struct STATDATA { + formatetc: FORMATETC, + advf: DWORD, + pAdvSInk: *mut IAdviseSink, + dwConnection: DWORD, +}} +RIDL!{#[uuid(0x00000105, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IEnumSTATDATA(IEnumSTATDATAVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut STATDATA, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumSTATDATA, + ) -> HRESULT, +}} +ENUM!{enum TYMED { + TYMED_HGLOBAL = 1, + TYMED_FILE = 2, + TYMED_ISTREAM = 4, + TYMED_ISTORAGE = 8, + TYMED_GDI = 16, + TYMED_MFPICT = 32, + TYMED_ENHMF = 64, + TYMED_NULL = 0, +}} +UNION!{union STGMEDIUM_u { + [u64; 7], //TODO: I guessed to move on + hBitmap hBitmap_mut: HBITMAP, + hMetaFilePict hMetaFilePict_mut: HMETAFILEPICT, + hEnhMetaFile hEnhMetaFile_mut: HENHMETAFILE, + hGlobal hGlobal_mut: HGLOBAL, + lpszFileName lpszFileName_mut: LPOLESTR, + pstm pstm_mut: *mut IStream, + pstg pstg_mut: *mut IStorage, +}} +STRUCT!{struct STGMEDIUM { + tymed: DWORD, + u: *mut STGMEDIUM_u, + pUnkForRelease: *mut IUnknown, +}} +RIDL!{#[uuid(0x0000010f, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IAdviseSink(IAdviseSinkVtbl): IUnknown(IUnknownVtbl) { + fn OnDataChange( + pformatetc: *mut FORMATETC, + pStgmed: *mut STGMEDIUM, + ) -> c_void, + fn OnViewChange( + dwAspect: DWORD, + lindex: LONG, + ) -> c_void, + fn OnRename( + pmk: *mut IMoniker, + ) -> c_void, + fn OnSave() -> c_void, + fn OnClose() -> c_void, +}} +ENUM!{enum DATADIR { + DATADIR_GET = 1, + DATADIR_SET = 2, +}} +pub type LPDATAOBJECT = *mut IDataObject; +RIDL!{#[uuid(0x0000010e, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IDataObject(IDataObjectVtbl): IUnknown(IUnknownVtbl) { + fn GetData( + pformatetcIn: *const FORMATETC, + pmedium: *mut STGMEDIUM, + ) -> HRESULT, + fn GetDataHere( + pformatetc: *const FORMATETC, + pmedium: *mut STGMEDIUM, + ) -> HRESULT, + fn QueryGetData( + pformatetc: *const FORMATETC, + ) -> HRESULT, + fn GetCanonicalFormatEtc( + pformatetcIn: *const FORMATETC, + pformatetcOut: *mut FORMATETC, + ) -> HRESULT, + fn SetData( + pformatetc: *const FORMATETC, + pformatetcOut: *const FORMATETC, + fRelease: BOOL, + ) -> HRESULT, + fn EnumFormatEtc( + dwDirection: DWORD, + ppenumFormatEtc: *mut *mut IEnumFORMATETC, + ) -> HRESULT, + fn DAdvise( + pformatetc: *const FORMATETC, + advf: DWORD, + pAdvSInk: *const IAdviseSink, + pdwConnection: *mut DWORD, + ) -> HRESULT, + fn DUnadvise( + dwConnection: DWORD, + ) -> HRESULT, + fn EnumDAdvise( + ppenumAdvise: *const *const IEnumSTATDATA, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa2f05a09, 0x27a2, 0x42b5, 0xbc, 0x0e, 0xac, 0x16, 0x3e, 0xf4, 0x9d, 0x9b)] +interface IApartmentShutdown(IApartmentShutdownVtbl): IUnknown(IUnknownVtbl) { + fn OnUninitialize( + ui64ApartmentIdentifier: UINT64, + ) -> (), +}} +RIDL!{#[uuid(0x00000003, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IMarshal(IMarshalVtbl): IUnknown(IUnknownVtbl) { + fn GetUnmarshalClass( + riid: REFIID, + pv: *mut c_void, + dwDestContext: DWORD, + pvDestContext: *mut c_void, + mshlflags: DWORD, + pCid: *mut CLSID, + ) -> HRESULT, + fn GetMarshalSizeMax( + riid: REFIID, + pv: *mut c_void, + dwDestContext: DWORD, + pvDestContext: *mut c_void, + mshlflags: DWORD, + pSize: *mut DWORD, + ) -> HRESULT, + fn MarshalInterface( + pStm: *mut IStream, + riid: REFIID, + pv: *mut c_void, + dwDestContext: DWORD, + pvDestContext: *mut c_void, + mshlflags: DWORD, + ) -> HRESULT, + fn UnmarshalInterface( + pStm: *mut IStream, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, + fn ReleaseMarshalData( + pStm: *mut IStream, + ) -> HRESULT, + fn DisconnectObject( + dwReserved: DWORD, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/objidlbase.rs b/bash-5.1/vendor/winapi/src/um/objidlbase.rs new file mode 100644 index 0000000000000000000000000000000000000000..9984480eaa28d64bd6ad246a4a790440a3364ec6 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/objidlbase.rs @@ -0,0 +1,952 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_int, c_void}; +use shared::basetsd::{SIZE_T, ULONG_PTR}; +use shared::guiddef::{CLSID, GUID, IID, REFCLSID, REFGUID, REFIID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FILETIME, ULONG}; +use shared::wtypesbase::{COAUTHINFO, DOUBLE, LPOLESTR, OLECHAR}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, LARGE_INTEGER, LONG, LPWSTR, ULARGE_INTEGER}; +STRUCT!{struct COSERVERINFO { + dwReserved1: DWORD, + pwszName: LPWSTR, + pAuthInfo: *mut COAUTHINFO, + dwReserved2: DWORD, +}} +pub type LPMARSHAL = *mut IMarshal; +RIDL!{#[uuid(0x00000003, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IMarshal(IMarshalVtbl): IUnknown(IUnknownVtbl) { + fn GetUnmarshalClass( + riid: REFIID, + pv: *mut c_void, + dwDestContext: DWORD, + pvDestContext: *mut c_void, + mshlflags: DWORD, + pCid: *mut CLSID, + ) -> HRESULT, + fn GetMarshalSizeMax( + riid: REFIID, + pv: *mut c_void, + dwDestContext: DWORD, + pvDestContext: *mut c_void, + mshlflags: DWORD, + pSize: *mut DWORD, + ) -> HRESULT, + fn MarshalInterface( + pStm: *mut IStream, + riid: REFIID, + pv: *mut c_void, + dwDestContext: DWORD, + pvDestContext: *mut c_void, + mshlflags: DWORD, + ) -> HRESULT, + fn UnmarshalInterface( + pStm: *mut IStream, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, + fn ReleaseMarshalData( + pStm: *mut IStream, + ) -> HRESULT, + fn DisconnectObject( + dwReserved: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xecc8691b, 0xc1db, 0x4dc0, 0x85, 0x5e, 0x65, 0xf6, 0xc5, 0x51, 0xaf, 0x49)] +interface INoMarshal(INoMarshalVtbl): IUnknown(IUnknownVtbl) {}} +RIDL!{#[uuid(0x94ea2b94, 0xe9cc, 0x49e0, 0xc0, 0xff, 0xee, 0x64, 0xca, 0x8f, 0x5b, 0x90)] +interface IAgileObject(IAgileObjectVtbl): IUnknown(IUnknownVtbl) {}} +ENUM!{enum ACTIVATIONTYPE { + ACTIVATIONTYPE_UNCATEGORIZED = 0, + ACTIVATIONTYPE_FROM_MONIKER = 0x1, + ACTIVATIONTYPE_FROM_DATA = 0x2, + ACTIVATIONTYPE_FROM_STORAGE = 0x4, + ACTIVATIONTYPE_FROM_STREAM = 0x8, + ACTIVATIONTYPE_FROM_FILE = 0x10, +}} +RIDL!{#[uuid(0x00000017, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IActivationFilter(IActivationFilterVtbl): IUnknown(IUnknownVtbl) { + fn HandleActivation( + dwActivationType: DWORD, + rclsid: REFCLSID, + pReplacementClsId: *mut CLSID, + ) -> HRESULT, +}} +pub type LPMARSHAL2 = *mut IMarshal2; +RIDL!{#[uuid(0x000001cf, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IMarshal2(IMarshal2Vtbl): IMarshal(IMarshalVtbl) {}} +pub type LPMALLOC = *mut IMalloc; +RIDL!{#[uuid(0x00000002, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IMalloc(IMallocVtbl): IUnknown(IUnknownVtbl) { + fn Alloc( + cb: SIZE_T, + ) -> *mut c_void, + fn Realloc( + pv: *mut c_void, + cb: SIZE_T, + ) -> *mut c_void, + fn Free( + pv: *mut c_void, + ) -> (), + fn GetSize( + pv: *mut c_void, + ) -> SIZE_T, + fn DidAlloc( + pv: *mut c_void, + ) -> c_int, + fn HeapMinimize() -> (), +}} +pub type LPSTDMARSHALINFO = IStdMarshalInfo; +RIDL!{#[uuid(0x00000018, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IStdMarshalInfo(IStdMarshalInfoVtbl): IUnknown(IUnknownVtbl) { + fn GetClassForHandler( + dwDestContext: DWORD, + pvDestContext: *mut c_void, + pClsid: *mut CLSID, + ) -> HRESULT, +}} +ENUM!{enum EXTCONN { + EXTCONN_STRONG = 0x1, + EXTCONN_WEAK = 0x2, + EXTCONN_CALLABLE = 0x4, +}} +RIDL!{#[uuid(0x00000019, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IExternalConnection(IExternalConnectionVtbl): IUnknown(IUnknownVtbl) { + fn AddConnection( + extconn: DWORD, + reserved: DWORD, + ) -> DWORD, + fn ReleaseConnection( + extconn: DWORD, + reserved: DWORD, + fLastReleaseCloses: BOOL, + ) -> DWORD, +}} +pub type LPMULTIQI = *mut IMultiQI; +STRUCT!{struct MULTI_QI { + pIID: *const IID, + pItf: *mut IUnknown, + hr: HRESULT, +}} +RIDL!{#[uuid(0x00000020, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IMultiQI(IMultiQIVtbl): IUnknown(IUnknownVtbl) { + fn QueryMultipleInterfaces( + cMQIs: ULONG, + pMQIs: *mut MULTI_QI, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x000e0020, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface AsyncIMultiQI(AsyncIMultiQIVtbl): IUnknown(IUnknownVtbl) { + fn Begin_QueryMultipleInterfaces( + cMQIs: ULONG, + pMQIs: *mut MULTI_QI, + ) -> HRESULT, + fn Finish_QueryMultipleInterfaces( + pMQIs: *mut MULTI_QI, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000021, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IInternalUnknown(IInternalUnknownVtbl): IUnknown(IUnknownVtbl) { + fn QueryInternalInterface( + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000100, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IEnumUnknown(IEnumUnknownVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut *mut IUnknown, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000101, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IEnumString(IEnumStringVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut LPOLESTR, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumString, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0c733a30, 0x2a1c, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d)] +interface ISequentialStream(ISequentialStreamVtbl): IUnknown(IUnknownVtbl) { + fn Read( + pv: *mut c_void, + cb: ULONG, + pcbRead: *mut ULONG, + ) -> HRESULT, + fn Write( + pv: *const c_void, + cb: ULONG, + pcbWritten: *mut ULONG, + ) -> HRESULT, +}} +STRUCT!{struct STATSTG { + pwcsName: LPOLESTR, + type_: DWORD, + cbSize: ULARGE_INTEGER, + mtime: FILETIME, + ctime: FILETIME, + atime: FILETIME, + grfMode: DWORD, + grfLocksSupported: DWORD, + clsid: CLSID, + grfStateBits: DWORD, + reserved: DWORD, +}} +ENUM!{enum STGTY { + STGTY_STORAGE = 1, + STGTY_STREAM = 2, + STGTY_LOCKBYTES = 3, + STGTY_PROPERTY = 4, +}} +ENUM!{enum STREAM_SEEK { + STREAM_SEEK_SET = 0, + STREAM_SEEK_CUR = 1, + STREAM_SEEK_END = 2, +}} +ENUM!{enum LOCKTYPE { + LOCK_WRITE = 1, + LOCK_EXCLUSIVE = 2, + LOCK_ONLYONCE = 4, +}} +pub type LPSTREAM = *mut IStream; +RIDL!{#[uuid(0x0000000c, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IStream(IStreamVtbl): ISequentialStream(ISequentialStreamVtbl) { + fn Seek( + dlibMove: LARGE_INTEGER, + dwOrigin: DWORD, + plibNewPosition: *mut ULARGE_INTEGER, + ) -> HRESULT, + fn SetSize( + libNewSize: ULARGE_INTEGER, + ) -> HRESULT, + fn CopyTo( + pstm: *mut IStream, + cb: ULARGE_INTEGER, + pcbRead: *mut ULARGE_INTEGER, + pcbWritten: *mut ULARGE_INTEGER, + ) -> HRESULT, + fn Commit( + grfCommitFlags: DWORD, + ) -> HRESULT, + fn Revert() -> HRESULT, + fn LockRegion( + libOffset: ULARGE_INTEGER, + cb: ULARGE_INTEGER, + dwLockType: DWORD, + ) -> HRESULT, + fn UnlockRegion( + libOffset: ULARGE_INTEGER, + cb: ULARGE_INTEGER, + dwLockType: DWORD, + ) -> HRESULT, + fn Stat( + pstatstg: *mut STATSTG, + grfStatFlag: DWORD, + ) -> HRESULT, + fn Clone( + ppstm: *mut *mut IStream, + ) -> HRESULT, +}} +pub type RPCOLEDATAREP = ULONG; +STRUCT!{struct RPCOLEMESSAGE { + reserved1: *mut c_void, + dataRepresentation: RPCOLEDATAREP, + Buffer: *mut c_void, + cbBuffer: ULONG, + iMethod: ULONG, + reserved2: [*mut c_void; 5], + rpcFlags: ULONG, +}} +pub type PRPCOLEMESSAGE = *mut RPCOLEMESSAGE; +RIDL!{#[uuid(0xd5f56b60, 0x593b, 0x101a, 0xb5, 0x69, 0x08, 0x00, 0x2b, 0x2d, 0xbf, 0x7a)] +interface IRpcChannelBuffer(IRpcChannelBufferVtbl): IUnknown(IUnknownVtbl) { + fn GetBuffer( + pMessage: *mut RPCOLEMESSAGE, + riid: REFIID, + ) -> HRESULT, + fn SendReceive( + pMessage: *mut RPCOLEMESSAGE, + pStatus: *mut ULONG, + ) -> HRESULT, + fn FreeBuffer( + pMessage: *mut RPCOLEMESSAGE, + ) -> HRESULT, + fn GetDestCtx( + pdwDestContext: *mut DWORD, + ppvDestContext: *mut *mut c_void, + ) -> HRESULT, + fn IsConnected() -> HRESULT, +}} +RIDL!{#[uuid(0x594f31d0, 0x7f19, 0x11d0, 0xb1, 0x94, 0x00, 0xa0, 0xc9, 0x0d, 0xc8, 0xbf)] +interface IRpcChannelBuffer2(IRpcChannelBuffer2Vtbl): IRpcChannelBuffer(IRpcChannelBufferVtbl) { + fn GetProtocolVersion( + pdwVersion: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa5029fb6, 0x3c34, 0x11d1, 0x9c, 0x99, 0x00, 0xc0, 0x4f, 0xb9, 0x98, 0xaa)] +interface IAsyncRpcChannelBuffer(IAsyncRpcChannelBufferVtbl): + IRpcChannelBuffer2(IRpcChannelBuffer2Vtbl) { + fn Send( + pMsg: *mut RPCOLEMESSAGE, + pSync: *mut ISynchronize, + pulStatus: *mut ULONG, + ) -> HRESULT, + fn Receive( + pMsg: *mut RPCOLEMESSAGE, + pulStatus: *mut ULONG, + ) -> HRESULT, + fn GetDestCtxEx( + pMsg: *mut RPCOLEMESSAGE, + pdwDestContext: *mut DWORD, + ppvDestContext: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x25b15600, 0x0115, 0x11d0, 0xbf, 0x0d, 0x00, 0xaa, 0x00, 0xb8, 0xdf, 0xd2)] +interface IRpcChannelBuffer3(IRpcChannelBuffer3Vtbl): IRpcChannelBuffer2(IRpcChannelBuffer2Vtbl) { + fn Send( + pMsg: *mut RPCOLEMESSAGE, + pulStatus: *mut ULONG, + ) -> HRESULT, + fn Receive( + pMsg: *mut RPCOLEMESSAGE, + ulSize: ULONG, + pulStatus: *mut ULONG, + ) -> HRESULT, + fn Cancel( + pMsg: *mut RPCOLEMESSAGE, + ) -> HRESULT, + fn GetCallContext( + pMsg: *mut RPCOLEMESSAGE, + riid: REFIID, + pInterface: *mut *mut c_void, + ) -> HRESULT, + fn GetDestCtxEx( + pMsg: *mut RPCOLEMESSAGE, + pdwDestContext: *mut DWORD, + ppvDestContext: *mut *mut c_void, + ) -> HRESULT, + fn GetState( + pMsg: *mut RPCOLEMESSAGE, + pState: *mut DWORD, + ) -> HRESULT, + fn RegisterAsync( + pMsg: *mut RPCOLEMESSAGE, + pAsyncMgr: *mut IAsyncManager, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x58a08519, 0x24c8, 0x4935, 0xb4, 0x82, 0x3f, 0xd8, 0x23, 0x33, 0x3a, 0x4f)] +interface IRpcSyntaxNegotiate(IRpcSyntaxNegotiateVtbl): IUnknown(IUnknownVtbl) { + fn NegotiateSyntax( + pMsg: *mut RPCOLEMESSAGE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd5f56a34, 0x593b, 0x101a, 0xb5, 0x69, 0x08, 0x00, 0x2b, 0x2d, 0xbf, 0x7a)] +interface IRpcProxyBuffer(IRpcProxyBufferVtbl): IUnknown(IUnknownVtbl) { + fn Connect( + pRpcChannelBuffer: *mut IRpcChannelBuffer, + ) -> HRESULT, + fn Disconnect() -> (), +}} +RIDL!{#[uuid(0xd5f56afc, 0x593b, 0x101a, 0xb5, 0x69, 0x08, 0x00, 0x2b, 0x2d, 0xbf, 0x7a)] +interface IRpcStubBuffer(IRpcStubBufferVtbl): IUnknown(IUnknownVtbl) { + fn Connect( + pUnkServer: *mut IUnknown, + ) -> HRESULT, + fn Disconnect() -> (), + fn Invoke( + _prpcmsg: *mut RPCOLEMESSAGE, + _pRpcChannelBuffer: *mut IRpcChannelBuffer, + ) -> HRESULT, + fn IsIIDSupported( + riid: REFIID, + ) -> *mut IRpcStubBuffer, + fn CountRefs() -> ULONG, + fn DebugServerQueryInterface( + ppv: *mut *mut c_void, + ) -> HRESULT, + fn DebugServerRelease( + pv: *mut c_void, + ) -> (), +}} +RIDL!{#[uuid(0xd5f569d0, 0x593b, 0x101a, 0xb5, 0x69, 0x08, 0x00, 0x2b, 0x2d, 0xbf, 0x7a)] +interface IPSFactoryBuffer(IPSFactoryBufferVtbl): IUnknown(IUnknownVtbl) { + fn CreateProxy( + pUnkOuter: *mut IUnknown, + riid: REFIID, + ppProxy: *mut *mut IRpcProxyBuffer, + ppv: *mut *mut c_void, + ) -> HRESULT, + fn CreateStub( + riid: REFIID, + pUnkServer: *mut *mut IUnknown, + ppStub: *mut *mut IRpcStubBuffer, + ) -> HRESULT, +}} +STRUCT!{struct SChannelHookCallInfo { + iid: IID, + cbSize: DWORD, + uCausality: GUID, + dwServerPid: DWORD, + iMethod: DWORD, + pObject: *mut c_void, +}} +RIDL!{#[uuid(0x1008c4a0, 0x7613, 0x11cf, 0x9a, 0xf1, 0x00, 0x20, 0xaf, 0x6e, 0x72, 0xf4)] +interface IChannelHook(IChannelHookVtbl): IUnknown(IUnknownVtbl) { + fn ClientGetSize( + uExtent: REFGUID, + riid: REFIID, + pDataSize: *mut ULONG, + ) -> (), + fn ClientFillBuffer( + uExtent: REFGUID, + riid: REFIID, + pDataSize: *mut ULONG, + pDataBuffer: *mut c_void, + ) -> (), + fn ClientNotify( + uExtent: REFGUID, + riid: REFIID, + cbDataSize: ULONG, + pDataBuffer: *mut c_void, + lDataRep: DWORD, + hrFault: HRESULT, + ) -> (), + fn ServerNotify( + uExtent: REFGUID, + riid: REFIID, + cbDataSize: ULONG, + pDataBuffer: *mut c_void, + lDataRep: DWORD, + ) -> (), + fn ServerGetSize( + uExtent: REFGUID, + riid: REFIID, + hrFault: HRESULT, + pDataSize: *mut ULONG, + ) -> (), + fn ServerFillBuffer( + uExtent: REFGUID, + riid: REFIID, + pDataSize: *mut ULONG, + pDataBuffer: *mut c_void, + hrFault: HRESULT, + ) -> (), +}} +STRUCT!{struct SOLE_AUTHENTICATION_SERVICE { + dwAuthnSvc: DWORD, + dwAuthzSvc: DWORD, + pPrincipalName: *mut OLECHAR, + hr: HRESULT, +}} +pub type PSOLE_AUTHENTICATION_SERVICE = *mut SOLE_AUTHENTICATION_SERVICE; +ENUM!{enum EOLE_AUTHENTICATION_CAPABILITIES { + EOAC_NONE = 0, + EOAC_MUTUAL_AUTH = 0x1, + EOAC_STATIC_CLOAKING = 0x20, + EOAC_DYNAMIC_CLOAKING = 0x40, + EOAC_ANY_AUTHORITY = 0x80, + EOAC_MAKE_FULLSIC = 0x100, + EOAC_DEFAULT = 0x800, + EOAC_SECURE_REFS = 0x2, + EOAC_ACCESS_CONTROL = 0x4, + EOAC_APPID = 0x8, + EOAC_DYNAMIC = 0x10, + EOAC_REQUIRE_FULLSIC = 0x200, + EOAC_AUTO_IMPERSONATE = 0x400, + EOAC_DISABLE_AAA = 0x1000, + EOAC_NO_CUSTOM_MARSHAL = 0x2000, + EOAC_RESERVED1 = 0x4000, +}} +pub const COLE_DEFAULT_PRINCIPAL: *mut OLECHAR = -1isize as *mut OLECHAR; +pub const COLE_DEFAULT_AUTHINFO: *mut c_void = -1isize as *mut c_void; +STRUCT!{struct SOLE_AUTHENTICATION_INFO { + dwAuthnSvc: DWORD, + dwAuthzSvc: DWORD, + pAuthInfo: *mut c_void, +}} +pub type PSOLE_AUTHENTICATION_INFO = *mut SOLE_AUTHENTICATION_INFO; +STRUCT!{struct SOLE_AUTHENTICATION_LIST { + cAuthInfo: DWORD, + aAuthInfo: *mut SOLE_AUTHENTICATION_INFO, +}} +pub type PSOLE_AUTHENTICATION_LIST = *mut SOLE_AUTHENTICATION_LIST; +RIDL!{#[uuid(0x0000013d, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IClientSecurity(IClientSecurityVtbl): IUnknown(IUnknownVtbl) { + fn QueryBlanket( + pProxy: *mut IUnknown, + pAuthnSvc: *mut DWORD, + pAuthzSvc: *mut DWORD, + pServerPrincName: *mut *mut OLECHAR, + pAuthnLevel: *mut DWORD, + pImpLevel: *mut DWORD, + pAuthInfo: *mut *mut c_void, + pCapabilities: *mut DWORD, + ) -> HRESULT, + fn SetBlanket( + pProxy: *mut IUnknown, + dwAuthnSvc: DWORD, + dwAuthzSvc: DWORD, + pServerPrincName: *mut OLECHAR, + dwAuthnLevel: DWORD, + dwImpLevel: DWORD, + pAuthInfo: *mut c_void, + dwCapabilities: DWORD, + ) -> HRESULT, + fn CopyProxy( + pProxy: *mut IUnknown, + ppCopy: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0000013e, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IServerSecurity(IServerSecurityVtbl): IUnknown(IUnknownVtbl) { + fn QueryBlanket( + pAuthnSvc: *mut DWORD, + pAuthzSvc: *mut DWORD, + pServerPrincName: *mut *mut OLECHAR, + pAuthnLevel: *mut DWORD, + pImpLevel: *mut DWORD, + pPrivs: *mut *mut c_void, + pCapabilities: *mut DWORD, + ) -> HRESULT, + fn ImpersonateClient() -> HRESULT, + fn RevertToSelf() -> HRESULT, + fn IsImpersonating() -> BOOL, +}} +ENUM!{enum RPCOPT_PROPERTIES { + COMBND_RPCTIMEOUT = 0x1, + COMBND_SERVER_LOCALITY = 0x2, + COMBND_RESERVED1 = 0x4, + COMBND_RESERVED2 = 0x5, + COMBND_RESERVED3 = 0x8, + COMBND_RESERVED4 = 0x10, +}} +ENUM!{enum RPCOPT_SERVER_LOCALITY_VALUES { + SERVER_LOCALITY_PROCESS_LOCAL = 0, + SERVER_LOCALITY_MACHINE_LOCAL = 1, + SERVER_LOCALITY_REMOTE = 2, +}} +RIDL!{#[uuid(0x00000144, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IRpcOptions(IRpcOptionsVtbl): IUnknown(IUnknownVtbl) { + fn Set( + pPrx: *mut IUnknown, + dwProperty: RPCOPT_PROPERTIES, + dwValue: ULONG_PTR, + ) -> HRESULT, + fn Query( + pPrx: *mut IUnknown, + dwProperty: RPCOPT_PROPERTIES, + pdwValue: *mut ULONG_PTR, + ) -> HRESULT, +}} +ENUM!{enum GLOBALOPT_PROPERTIES { + COMGLB_EXCEPTION_HANDLING = 1, + COMGLB_APPID = 2, + COMGLB_RPC_THREADPOOL_SETTING = 3, + COMGLB_RO_SETTINGS = 4, + COMGLB_UNMARSHALING_POLICY = 5, + COMGLB_PROPERTIES_RESERVED1 = 6, +}} +ENUM!{enum GLOBALOPT_EH_VALUES { + COMGLB_EXCEPTION_HANDLE = 0, + COMGLB_EXCEPTION_DONOT_HANDLE_FATAL = 1, + COMGLB_EXCEPTION_DONOT_HANDLE = COMGLB_EXCEPTION_DONOT_HANDLE_FATAL, + COMGLB_EXCEPTION_DONOT_HANDLE_ANY = 2, +}} +ENUM!{enum GLOBALOPT_RPCTP_VALUES { + COMGLB_RPC_THREADPOOL_SETTING_DEFAULT_POOL = 0, + COMGLB_RPC_THREADPOOL_SETTING_PRIVATE_POOL = 1, +}} +ENUM!{enum GLOBALOPT_RO_FLAGS { + COMGLB_STA_MODALLOOP_REMOVE_TOUCH_MESSAGES = 0x1, + COMGLB_STA_MODALLOOP_SHARED_QUEUE_REMOVE_INPUT_MESSAGES = 0x2, + COMGLB_STA_MODALLOOP_SHARED_QUEUE_DONOT_REMOVE_INPUT_MESSAGES = 0x4, + COMGLB_FAST_RUNDOWN = 0x8, + COMGLB_RESERVED1 = 0x10, + COMGLB_RESERVED2 = 0x20, + COMGLB_RESERVED3 = 0x40, + COMGLB_STA_MODALLOOP_SHARED_QUEUE_REORDER_POINTER_MESSAGES = 0x80, + COMGLB_RESERVED4 = 0x100, + COMGLB_RESERVED5 = 0x200, + COMGLB_RESERVED6 = 0x400, +}} +ENUM!{enum GLOBALOPT_UNMARSHALING_POLICY_VALUES { + COMGLB_UNMARSHALING_POLICY_NORMAL = 0, + COMGLB_UNMARSHALING_POLICY_STRONG = 1, + COMGLB_UNMARSHALING_POLICY_HYBRID = 2, +}} +RIDL!{#[uuid(0x0000015b, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IGlobalOptions(IGlobalOptionsVtbl): IUnknown(IUnknownVtbl) { + fn Set( + dwProperty: GLOBALOPT_PROPERTIES, + dwValue: ULONG_PTR, + ) -> HRESULT, + fn Query( + dwProperty: GLOBALOPT_PROPERTIES, + pdwValue: *mut ULONG_PTR, + ) -> HRESULT, +}} +pub type LPSURROGATE = *mut ISurrogate; +RIDL!{#[uuid(0x00000022, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ISurrogate(ISurrogateVtbl): IUnknown(IUnknownVtbl) { + fn LoadDllServer( + Clsid: REFCLSID, + ) -> HRESULT, + fn FreeSurrogate() -> HRESULT, +}} +pub type LPGLOBALINTERFACETABLE = *mut IGlobalInterfaceTable; +RIDL!{#[uuid(0x00000146, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IGlobalInterfaceTable(IGlobalInterfaceTableVtbl): IUnknown(IUnknownVtbl) { + fn RegisterInterfaceInGlobal( + pUnk: *mut IUnknown, + riid: REFIID, + pdwCookie: *mut DWORD, + ) -> HRESULT, + fn RevokeInterfaceFromGlobal( + dwCookie: DWORD, + ) -> HRESULT, + fn GetInterfaceFromGlobal( + dwCookie: DWORD, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000030, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ISynchronize(ISynchronizeVtbl): IUnknown(IUnknownVtbl) { + fn Wait( + dwFlags: DWORD, + dwMilliseconds: DWORD, + ) -> HRESULT, + fn Signal() -> HRESULT, + fn Reset() -> HRESULT, +}} +RIDL!{#[uuid(0x00000031, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ISynchronizeHandle(ISynchronizeHandleVtbl): IUnknown(IUnknownVtbl) { + fn GetHandle( + ph: *mut HANDLE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000032, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ISynchronizeEvent(ISynchronizeEventVtbl): ISynchronizeHandle(ISynchronizeHandleVtbl) { + fn SetEventHandle( + ph: *mut HANDLE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000033, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ISynchronizeContainer(ISynchronizeContainerVtbl): IUnknown(IUnknownVtbl) { + fn AddSynchronize( + pSync: *mut ISynchronize, + ) -> HRESULT, + fn WaitMultiple( + dwFlags: DWORD, + dwTimeOut: DWORD, + ppSync: *mut *mut ISynchronize, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000025, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ISynchronizeMutex(ISynchronizeMutexVtbl): ISynchronize(ISynchronizeVtbl) { + fn ReleaseMutex() -> HRESULT, +}} +pub type LPCANCELMETHODCALLS = *mut ICancelMethodCalls; +RIDL!{#[uuid(0x00000029, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface ICancelMethodCalls(ICancelMethodCallsVtbl): IUnknown(IUnknownVtbl) { + fn Cancel( + ulSeconds: ULONG, + ) -> HRESULT, + fn TestCancel() -> HRESULT, +}} +ENUM!{enum DCOM_CALL_STATE { + DCOM_NONE = 0, + DCOM_CALL_COMPLETE = 0x1, + DCOM_CALL_CANCELED = 0x2, +}} +RIDL!{#[uuid(0x0000002a, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IAsyncManager(IAsyncManagerVtbl): IUnknown(IUnknownVtbl) { + fn CompleteCall( + Result: HRESULT, + ) -> HRESULT, + fn GetCallContext( + riid: REFIID, + pInterface: *mut *mut c_void, + ) -> HRESULT, + fn GetState( + pulStateFlags: *mut ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1c733a30, 0x2a1c, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d)] +interface ICallFactory(ICallFactoryVtbl): IUnknown(IUnknownVtbl) { + fn CreateCall( + riid: REFIID, + pCtrlUnk: *mut IUnknown, + riid2: REFIID, + ppv: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000149, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IRpcHelper(IRpcHelperVtbl): IUnknown(IUnknownVtbl) { + fn GetDCOMProtocolVersion( + pComVersion: *mut DWORD, + ) -> HRESULT, + fn GetIIDFromOBJREF( + pObjRef: *mut c_void, + piid: *mut *mut IID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xeb0cb9e8, 0x7996, 0x11d2, 0x87, 0x2e, 0x00, 0x00, 0xf8, 0x08, 0x08, 0x59)] +interface IReleaseMarshalBuffers(IReleaseMarshalBuffersVtbl): IUnknown(IUnknownVtbl) { + fn ReleaseMarshalBuffer( + pMsg: *mut RPCOLEMESSAGE, + dwFlags: DWORD, + pChnl: *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0000002b, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IWaitMultiple(IWaitMultipleVtbl): IUnknown(IUnknownVtbl) { + fn WaitMultiple( + timeout: DWORD, + pSync: *mut *mut ISynchronize, + ) -> HRESULT, + fn AddSynchronize( + pSync: *mut ISynchronize, + ) -> HRESULT, +}} +pub type LPADDRTRACKINGCONTROL = *mut IAddrTrackingControl; +RIDL!{#[uuid(0x00000147, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IAddrTrackingControl(IAddrTrackingControlVtbl): IUnknown(IUnknownVtbl) { + fn EnableCOMDynamicAddrTracking() -> HRESULT, + fn DisableCOMDynamicAddrTracking() -> HRESULT, +}} +pub type LPADDREXCLUSIONCONTROL = *mut IAddrExclusionControl; +RIDL!{#[uuid(0x00000148, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IAddrExclusionControl(IAddrExclusionControlVtbl): IUnknown(IUnknownVtbl) { + fn GetCurrentAddrExclusionList( + riid: REFIID, + ppEnumerator: *mut *mut c_void, + ) -> HRESULT, + fn UpdateAddrExclusionList( + pEnumerator: *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdb2f3aca, 0x2f86, 0x11d1, 0x8e, 0x04, 0x00, 0xc0, 0x4f, 0xb9, 0x98, 0x9a)] +interface IPipeByte(IPipeByteVtbl): IUnknown(IUnknownVtbl) { + fn Pull( + buf: *mut BYTE, + cRequest: ULONG, + pcReturned: *mut ULONG, + ) -> HRESULT, + fn Push( + buf: *mut BYTE, + cSent: ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdb2f3acb, 0x2f86, 0x11d1, 0x8e, 0x04, 0x00, 0xc0, 0x4f, 0xb9, 0x98, 0x9a)] +interface AsyncIPipeByte(AsyncIPipeByteVtbl): IUnknown(IUnknownVtbl) { + fn Begin_Pull( + cRequest: ULONG, + ) -> HRESULT, + fn Finish_Pull( + buf: *mut BYTE, + pcReturned: *mut ULONG, + ) -> HRESULT, + fn Begin_Push( + buf: *mut BYTE, + cSent: ULONG, + ) -> HRESULT, + fn Finish_Push() -> HRESULT, +}} +RIDL!{#[uuid(0xdb2f3acc, 0x2f86, 0x11d1, 0x8e, 0x04, 0x00, 0xc0, 0x4f, 0xb9, 0x98, 0x9a)] +interface IPipeLong(IPipeLongVtbl): IUnknown(IUnknownVtbl) { + fn Pull( + buf: *mut LONG, + cRequest: ULONG, + pcReturned: *mut ULONG, + ) -> HRESULT, + fn Push( + buf: *mut LONG, + cSent: ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdb2f3acd, 0x2f86, 0x11d1, 0x8e, 0x04, 0x00, 0xc0, 0x4f, 0xb9, 0x98, 0x9a)] +interface AsyncIPipeLong(AsyncIPipeLongVtbl): IUnknown(IUnknownVtbl) { + fn Begin_Pull( + cRequest: ULONG, + ) -> HRESULT, + fn Finish_Pull( + buf: *mut LONG, + pcReturned: *mut ULONG, + ) -> HRESULT, + fn Begin_Push( + buf: *mut LONG, + cSent: ULONG, + ) -> HRESULT, + fn Finish_Push() -> HRESULT, +}} +RIDL!{#[uuid(0xdb2f3ace, 0x2f86, 0x11d1, 0x8e, 0x04, 0x00, 0xc0, 0x4f, 0xb9, 0x98, 0x9a)] +interface IPipeDouble(IPipeDoubleVtbl): IUnknown(IUnknownVtbl) { + fn Pull( + buf: *mut DOUBLE, + cRequest: ULONG, + pcReturned: *mut ULONG, + ) -> HRESULT, + fn Push( + buf: *mut DOUBLE, + cSent: ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdb2f3acf, 0x2f86, 0x11d1, 0x8e, 0x04, 0x00, 0xc0, 0x4f, 0xb9, 0x98, 0x9a)] +interface AsyncIPipeDouble(AsyncIPipeDoubleVtbl): IUnknown(IUnknownVtbl) { + fn Begin_Pull( + cRequest: ULONG, + ) -> HRESULT, + fn Finish_Pull( + buf: *mut DOUBLE, + pcReturned: *mut ULONG, + ) -> HRESULT, + fn Begin_Push( + buf: *mut DOUBLE, + cSent: ULONG, + ) -> HRESULT, + fn Finish_Push() -> HRESULT, +}} +pub type CPFLAGS = DWORD; +STRUCT!{struct ContextProperty { + policyId: GUID, + flags: CPFLAGS, + pUnk: *mut IUnknown, +}} +pub type LPENUMCONTEXTPROPS = *mut IEnumContextProps; +RIDL!{#[uuid(0x000001c1, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IEnumContextProps(IEnumContextPropsVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + pContextProperties: *mut ContextProperty, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppEnumContextProps: *mut *mut IEnumContextProps, + ) -> HRESULT, + fn Count( + pcelt: *mut ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x000001c0, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IContext(IContextVtbl): IUnknown(IUnknownVtbl) { + fn SetProperty( + rpolicyId: REFGUID, + flags: CPFLAGS, + pUnk: *mut IUnknown, + ) -> HRESULT, + fn RemoveProperty( + rPolicyId: REFGUID, + ) -> HRESULT, + fn GetProperty( + policyId: REFGUID, + pFlags: *mut CPFLAGS, + ppUnk: *mut *mut IUnknown, + ) -> HRESULT, + fn EnumContextProps( + ppEnumContextProps: *mut *mut IEnumContextProps, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x000001c6, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IObjContext(IObjContextVtbl): IContext(IContextVtbl) { + fn Reserved1() -> (), + fn Reserved2() -> (), + fn Reserved3() -> (), + fn Reserved4() -> (), + fn Reserved5() -> (), + fn Reserved6() -> (), + fn Reserved7() -> (), +}} +ENUM!{enum APTTYPEQUALIFIER { + APTTYPEQUALIFIER_NONE = 0, + APTTYPEQUALIFIER_IMPLICIT_MTA = 1, + APTTYPEQUALIFIER_NA_ON_MTA = 2, + APTTYPEQUALIFIER_NA_ON_STA = 3, + APTTYPEQUALIFIER_NA_ON_IMPLICIT_MTA = 4, + APTTYPEQUALIFIER_NA_ON_MAINSTA = 5, + APTTYPEQUALIFIER_APPLICATION_STA= 6, +}} +ENUM!{enum APTTYPE { + APTTYPE_CURRENT = -1i32 as u32, + APTTYPE_STA = 0, + APTTYPE_MTA = 1, + APTTYPE_NA = 2, + APTTYPE_MAINSTA = 3, +}} +ENUM!{enum THDTYPE { + THDTYPE_BLOCKMESSAGES = 0, + THDTYPE_PROCESSMESSAGES = 1, +}} +pub type APARTMENTID = DWORD; +RIDL!{#[uuid(0x000001ce, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IComThreadingInfo(IComThreadingInfoVtbl): IUnknown(IUnknownVtbl) { + fn GetCurrentApartmentType( + pAptType: *mut APTTYPE, + ) -> HRESULT, + fn GetCurrentThreadType( + pThreadType: *mut THDTYPE, + ) -> HRESULT, + fn GetCurrentLogicalThreadId( + pguidLogicalThreadId: *mut GUID, + ) -> HRESULT, + fn SetCurrentLogicalThreadId( + rguid: REFGUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x72380d55, 0x8d2b, 0x43a3, 0x85, 0x13, 0x2b, 0x6e, 0xf3, 0x14, 0x34, 0xe9)] +interface IProcessInitControl(IProcessInitControlVtbl): IUnknown(IUnknownVtbl) { + fn ResetInitializerTimeout( + dwSecondsRemaining: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000040, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IFastRundown(IFastRundownVtbl): IUnknown(IUnknownVtbl) {}} +ENUM!{enum CO_MARSHALING_CONTEXT_ATTRIBUTES { + CO_MARSHALING_SOURCE_IS_APP_CONTAINER = 0, + CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_1 = 0x80000000, + CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_2 = 0x80000001, + CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_3 = 0x80000002, + CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_4 = 0x80000003, + CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_5 = 0x80000004, + CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_6 = 0x80000005, + CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_7 = 0x80000006, + CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_8 = 0x80000007, + CO_MARSHALING_CONTEXT_ATTRIBUTE_RESERVED_9 = 0x80000008, +}} +RIDL!{#[uuid(0xd8f2f5e6, 0x6102, 0x4863, 0x9f, 0x26, 0x38, 0x9a, 0x46, 0x76, 0xef, 0xde)] +interface IMarshalingStream(IMarshalingStreamVtbl): IStream(IStreamVtbl) { + fn GetMarshalingContextAttribute( + attribute: CO_MARSHALING_CONTEXT_ATTRIBUTES, + pAttributeValue: *mut ULONG_PTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc03f6a43, 0x65a4, 0x9818, 0x98, 0x7e, 0xe0, 0xb8, 0x10, 0xd2, 0xa6, 0xf2)] +interface IAgileReference(IAgileReferenceVtbl): IUnknown(IUnknownVtbl) { + fn Resolve( + riid: REFIID, + ppvObjectReference: *mut *mut c_void, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/ocidl.rs b/bash-5.1/vendor/winapi/src/um/ocidl.rs new file mode 100644 index 0000000000000000000000000000000000000000..07ec0d4ba182521c2a09b0783c0ea121534d6eae --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ocidl.rs @@ -0,0 +1,68 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +// TODO:It is a minimal implementation. +use shared::guiddef::CLSID; +use shared::minwindef::{DWORD, ULONG}; +use shared::ntdef::HRESULT; +use shared::wtypes::{CLIPFORMAT, VARTYPE}; +use shared::wtypesbase::{LPCOLESTR, LPOLESTR}; +use um::oaidl::{IErrorLog, VARIANT}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +ENUM!{enum READYSTATE { + READYSTATE_UNINITIALIZED = 0, + READYSTATE_LOADING = 1, + READYSTATE_LOADED = 2, + READYSTATE_INTERACTIVE = 3, + READYSTATE_COMPLETE = 4, +}} +ENUM!{enum PROPBAG2_TYPE { + PROPBAG2_TYPE_UNDEFINED = 0, + PROPBAG2_TYPE_DATA = 1, + PROPBAG2_TYPE_URL = 2, + PROPBAG2_TYPE_OBJECT = 3, + PROPBAG2_TYPE_STREAM = 4, + PROPBAG2_TYPE_STORAGE = 5, + PROPBAG2_TYPE_MONIKER = 6, +}} +STRUCT!{struct PROPBAG2 { + dwType: DWORD, + vt: VARTYPE, + cfType: CLIPFORMAT, + dwHint: DWORD, + pstrName: LPOLESTR, + clsid: CLSID, +}} +RIDL!{#[uuid(0x22f55882, 0x280b, 0x11d0, 0xa8, 0xa9, 0x00, 0xa0, 0xc9, 0x0c, 0x20, 0x04)] +interface IPropertyBag2(IPropertyBag2Vtbl): IUnknown(IUnknownVtbl) { + fn Read( + cProperties: ULONG, + pPropBag: *const PROPBAG2, + pErrLog: *const IErrorLog, + pvarValue: *mut VARIANT, + phrError: *mut HRESULT, + ) -> HRESULT, + fn Write( + cProperties: ULONG, + pPropBag: *const PROPBAG2, + pvarValue: *const VARIANT, + ) -> HRESULT, + fn CountProperties( + pcProperties: *mut ULONG, + ) -> HRESULT, + fn GetPropertyInfo( + iProperty: ULONG, + cProperties: ULONG, + pPropBag: *mut PROPBAG2, + pcProperties: *mut ULONG, + ) -> HRESULT, + fn LoadObject( + pstrName: LPCOLESTR, + dwHint: DWORD, + pUnkObject: *const IUnknown, + pErrLog: *const IErrorLog, + ) -> HRESULT, +}} +pub type LPPROPERTYBAG2 = *mut IPropertyBag2; diff --git a/bash-5.1/vendor/winapi/src/um/ole2.rs b/bash-5.1/vendor/winapi/src/um/ole2.rs new file mode 100644 index 0000000000000000000000000000000000000000..66c1689643272f37cdc458c527e04f2014031565 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ole2.rs @@ -0,0 +1,21 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::LPVOID; +use shared::windef::HWND; +use um::oleidl::LPDROPTARGET; +use um::winnt::HRESULT; +extern "system" { + pub fn OleInitialize( + pvReserved: LPVOID, + ) -> HRESULT; + pub fn RegisterDragDrop( + hwnd: HWND, + pDropTarget: LPDROPTARGET, + ) -> HRESULT; + pub fn RevokeDragDrop( + hwnd: HWND, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/oleauto.rs b/bash-5.1/vendor/winapi/src/um/oleauto.rs new file mode 100644 index 0000000000000000000000000000000000000000..194ef0598bdcdcf7bcc354c7973d2d2c07c90815 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/oleauto.rs @@ -0,0 +1,849 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of OleAuto.h +use ctypes::{c_double, c_float, c_int, c_uint, c_void}; +use shared::basetsd::{LONG64, ULONG64}; +use shared::minwindef::{BYTE, DWORD, FLOAT, UINT, ULONG, USHORT, WORD}; +use shared::wtypes::{BSTR, DATE, DECIMAL, LPBSTR, LPDECIMAL, VARTYPE}; +use shared::wtypesbase::{DOUBLE, LPCOLESTR, LPOLESTR, OLECHAR}; +use um::minwinbase::LPSYSTEMTIME; +use um::oaidl::{ + DISPID_UNKNOWN, ICreateErrorInfo, IErrorInfo, ITypeLib, SAFEARRAY, VARIANT, VARIANTARG +}; +use um::winnt::{CHAR, HRESULT, INT, LCID, LONG, LPCSTR, SHORT}; +extern "system" { + pub fn SysAllocString( + psz: *const OLECHAR, + ) -> BSTR; + pub fn SysReAllocString( + pbstr: *mut BSTR, + psz: *const OLECHAR, + ) -> INT; + pub fn SysAllocStringLen( + strIn: *const OLECHAR, + ui: UINT, + ) -> BSTR; + pub fn SysReAllocStringLen( + pbstr: *mut BSTR, + psz: *const OLECHAR, + len: c_uint, + ) -> INT; + pub fn SysFreeString( + bstrString: BSTR, + ); + pub fn SysStringLen( + pbstr: BSTR, + ) -> UINT; + pub fn SysStringByteLen( + bstr: BSTR, + ) -> UINT; + pub fn SysAllocStringByteLen( + psz: LPCSTR, + len: UINT, + ) -> BSTR; + pub fn DosDateTimeToVariantTime( + wDosDate: USHORT, + wDosTime: USHORT, + pvtime: *mut DOUBLE, + ) -> INT; + pub fn VariantTimeToDosDateTime( + vtime: DOUBLE, + pwDosDate: *mut USHORT, + pwDosTime: *mut USHORT, + ) -> INT; + pub fn SystemTimeToVariantTime( + lpSystemTime: LPSYSTEMTIME, + pvtime: *mut DOUBLE, + ) -> INT; + pub fn VariantTimeToSystemTime( + vtime: DOUBLE, + lpSystemTime: LPSYSTEMTIME, + ) -> INT; + pub fn SafeArrayAccessData( + psa: *mut SAFEARRAY, + ppvData: *mut *mut c_void, + ) -> HRESULT; + pub fn SafeArrayUnaccessData( + psa: *mut SAFEARRAY, + ) -> HRESULT; + pub fn SafeArrayCreateVector( + vt: VARTYPE, + lLbound: LONG, + cElements: ULONG, + ) -> *mut SAFEARRAY; + pub fn SafeArrayGetLBound( + psa: *mut SAFEARRAY, + nDim: UINT, + plLbound: *mut LONG + ) -> HRESULT; + pub fn SafeArrayGetUBound( + psa: *mut SAFEARRAY, + nDim: UINT, + plUbound: *mut LONG + ) -> HRESULT; + pub fn SafeArrayDestroy( + psa: *mut SAFEARRAY + ) -> HRESULT; + pub fn VariantInit( + pvarg: *mut VARIANTARG, + ); + pub fn VariantClear( + pvarg: *mut VARIANTARG, + ) -> HRESULT; + pub fn VariantCopy( + pvargDest: *mut VARIANTARG, + pvargSrc: *const VARIANTARG, + ) -> HRESULT; + pub fn VariantCopyInd( + pvarDest: *mut VARIANT, + pvargSrc: *const VARIANTARG, + ) -> HRESULT; + pub fn VariantChangeType( + pvargDest: *mut VARIANTARG, + pvarSrc: *const VARIANTARG, + wFlags: USHORT, + vt: VARTYPE, + ) -> HRESULT; + pub fn VariantChangeTypeEx( + pvargDest: *mut VARIANTARG, + pvarSrc: *const VARIANTARG, + lcid: LCID, + wFlags: USHORT, + vt: VARTYPE, + ) -> HRESULT; + pub fn VarUI1FromI2( + sIn: SHORT, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromI4( + lIn: LONG, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromI8( + i64In: LONG64, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromR4( + fltIn: FLOAT, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromR8( + dblIn: DOUBLE, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromDate( + dateIn: DATE, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromI1( + cIn: CHAR, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromUI2( + uiIn: USHORT, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromUI4( + ulIn: ULONG, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromUI8( + ui64In: ULONG64, + pbOut: *mut BYTE, + ); + pub fn VarUI1FromDec( + pdecIn: *const DECIMAL, + pbOut: *mut BYTE, + ); + pub fn VarI2FromUI1( + bIn: BYTE, + psOut: *mut SHORT, + ); + pub fn VarI2FromI4( + lIn: LONG, + psOut: *mut SHORT, + ); + pub fn VarI2FromI8( + i64In: LONG64, + psOut: *mut SHORT, + ); + pub fn VarI2FromR4( + fltIn: FLOAT, + psOut: *mut SHORT, + ); + pub fn VarI2FromR8( + dblIn: DOUBLE, + psOut: *mut SHORT, + ); + pub fn VarI2FromDate( + dateIn: DATE, + psOut: *mut SHORT, + ); + pub fn VarI2FromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + psOut: *mut SHORT, + ); + pub fn VarI2FromI1( + cIn: CHAR, + psOut: *mut SHORT, + ); + pub fn VarI2FromUI2( + uiIn: USHORT, + psOut: *mut SHORT, + ); + pub fn VarI2FromUI4( + ulIn: ULONG, + psOut: *mut SHORT, + ); + pub fn VarI2FromUI8( + ui64In: ULONG64, + psOut: *mut SHORT, + ); + pub fn VarI2FromDec( + pdecIn: *const DECIMAL, + psOut: *mut SHORT, + ); + pub fn VarI4FromUI1( + bIn: BYTE, + plOut: *mut LONG, + ); + pub fn VarI4FromI2( + sIn: SHORT, + plOut: *mut LONG, + ); + pub fn VarI4FromI8( + i64In: LONG64, + plOut: *mut LONG, + ); + pub fn VarI4FromR4( + fltIn: FLOAT, + plOut: *mut LONG, + ); + pub fn VarI4FromR8( + dblIn: DOUBLE, + plOut: *mut LONG, + ); + pub fn VarI4FromDate( + dateIn: DATE, + plOut: *mut LONG, + ); + pub fn VarI4FromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + plOut: *mut LONG, + ); + pub fn VarI4FromI1( + cIn: CHAR, + plOut: *mut LONG, + ); + pub fn VarI4FromUI2( + uiIn: USHORT, + plOut: *mut LONG, + ); + pub fn VarI4FromUI4( + ulIn: ULONG, + plOut: *mut LONG, + ); + pub fn VarI4FromUI8( + ui64In: ULONG64, + plOut: *mut LONG, + ); + pub fn VarI4FromDec( + pdecIn: *const DECIMAL, + plOut: *mut LONG, + ); + pub fn VarI8FromUI1( + bIn: BYTE, + pi64Out: *mut LONG64, + ); + pub fn VarI8FromI2( + sIn: SHORT, + pi64Out: *mut LONG64, + ); + pub fn VarI8FromR4( + fltIn: FLOAT, + pi64Out: *mut LONG64, + ); + pub fn VarI8FromR8( + dblIn: DOUBLE, + pi64Out: *mut LONG64, + ); + pub fn VarI8FromDate( + dateIn: DATE, + pi64Out: *mut LONG64, + ); + pub fn VarI8FromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + pi64Out: *mut LONG64, + ); + pub fn VarI8FromI1( + cIn: CHAR, + pi64Out: *mut LONG64, + ); + pub fn VarI8FromUI2( + uiIn: USHORT, + pi64Out: *mut LONG64, + ); + pub fn VarI8FromUI4( + ulIn: ULONG, + pi64Out: *mut LONG64, + ); + pub fn VarI8FromUI8( + ui64In: ULONG64, + pi64Out: *mut LONG64, + ); + pub fn VarI8FromDec( + pdecIn: *const DECIMAL, + pi64Out: *mut LONG64, + ); + pub fn VarR4FromUI1( + bIn: BYTE, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromI2( + sIn: SHORT, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromI4( + lIn: LONG, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromI8( + i64In: LONG64, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromR8( + dblIn: DOUBLE, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromDate( + dateIn: DATE, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromI1( + cIn: CHAR, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromUI2( + uiIn: USHORT, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromUI4( + ulIn: ULONG, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromUI8( + ui64In: ULONG64, + pfltOut: *mut FLOAT, + ); + pub fn VarR4FromDec( + pdecIn: *const DECIMAL, + pfltOut: *mut FLOAT, + ); + pub fn VarR8FromUI1( + bIn: BYTE, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromI2( + sIn: SHORT, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromI4( + lIn: LONG, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromI8( + i64In: LONG64, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromR4( + fltIn: FLOAT, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromDate( + dateIn: DATE, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromI1( + cIn: CHAR, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromUI2( + uiIn: USHORT, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromUI4( + ulIn: ULONG, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromUI8( + ui64In: ULONG64, + pdblOut: *mut DOUBLE, + ); + pub fn VarR8FromDec( + pdecIn: *const DECIMAL, + pdblOut: *mut DOUBLE, + ); + pub fn VarDateFromUI1( + bIn: BYTE, + pdateOut: *mut DATE, + ); + pub fn VarDateFromI2( + sIn: SHORT, + pdateOut: *mut DATE, + ); + pub fn VarDateFromI4( + lIn: LONG, + pdateOut: *mut DATE, + ); + pub fn VarDateFromI8( + i64In: LONG64, + pdateOut: *mut DATE, + ); + pub fn VarDateFromR4( + fltIn: FLOAT, + pdateOut: *mut DATE, + ); + pub fn VarDateFromR8( + dblIn: DOUBLE, + pdateOut: *mut DATE, + ); + pub fn VarDateFromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + pdateOut: *mut DATE, + ); + pub fn VarDateFromI1( + cIn: CHAR, + pdateOut: *mut DATE, + ); + pub fn VarDateFromUI2( + uiIn: USHORT, + pdateOut: *mut DATE, + ); + pub fn VarDateFromUI4( + ulIn: ULONG, + pdateOut: *mut DATE, + ); + pub fn VarDateFromUI8( + ui64In: ULONG64, + pdateOut: *mut DATE, + ); + pub fn VarDateFromDec( + pdecIn: *const DECIMAL, + pdateOut: *mut DATE, + ); + pub fn VarBstrFromUI1( + bVal: BYTE, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromI2( + iVal: SHORT, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromI4( + lIn: LONG, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromI8( + i64In: LONG64, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromR4( + fltIn: FLOAT, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromR8( + dblIn: DOUBLE, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromDate( + dateIn: DATE, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromI1( + cIn: CHAR, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromUI2( + uiIn: USHORT, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromUI4( + ulIn: ULONG, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromUI8( + ui64In: ULONG64, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarBstrFromDec( + pdecIn: *const DECIMAL, + lcid: LCID, + dwFlags: ULONG, + pbstrOut: *mut BSTR, + ); + pub fn VarUI2FromUI1( + bIn: BYTE, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromI2( + uiIn: SHORT, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromI4( + lIn: LONG, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromI8( + i64In: LONG64, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromR4( + fltIn: FLOAT, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromR8( + dblIn: DOUBLE, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromDate( + dateIn: DATE, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromI1( + cIn: CHAR, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromUI4( + ulIn: ULONG, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromUI8( + i64In: ULONG64, + puiOut: *mut USHORT, + ); + pub fn VarUI2FromDec( + pdecIn: *const DECIMAL, + puiOut: *mut USHORT, + ); + pub fn VarUI4FromUI1( + bIn: BYTE, + pulOut: *mut ULONG, + ); + pub fn VarUI4FromI2( + uiIn: SHORT, + pulOut: *mut ULONG, + ); + pub fn VarUI4FromI4( + lIn: LONG, + pulOut: *mut ULONG, + ); + pub fn VarUI4FromI8( + i64In: LONG64, + plOut: *mut ULONG, + ); + pub fn VarUI4FromR4( + fltIn: FLOAT, + pulOut: *mut ULONG, + ); + pub fn VarUI4FromR8( + dblIn: DOUBLE, + pulOut: *mut ULONG, + ); + pub fn VarUI4FromDate( + dateIn: DATE, + pulOut: *mut ULONG, + ); + pub fn VarUI4FromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + pulOut: *mut ULONG, + ); + pub fn VarUI4FromI1( + cIn: CHAR, + pulOut: *mut ULONG, + ); + pub fn VarUI4FromUI2( + uiIn: USHORT, + pulOut: *mut ULONG, + ); + pub fn VarUI4FromUI8( + ui64In: ULONG64, + plOut: *mut ULONG, + ); + pub fn VarUI4FromDec( + pdecIn: *const DECIMAL, + pulOut: *mut ULONG, + ); + pub fn VarUI8FromUI1( + bIn: BYTE, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromI2( + sIn: SHORT, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromI4( + lIn: LONG, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromI8( + ui64In: LONG64, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromR4( + fltIn: FLOAT, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromR8( + dblIn: DOUBLE, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromDate( + dateIn: DATE, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromI1( + cIn: CHAR, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromUI2( + uiIn: USHORT, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromUI4( + ulIn: ULONG, + pi64Out: *mut ULONG64, + ); + pub fn VarUI8FromDec( + pdecIn: *const DECIMAL, + pi64Out: *mut ULONG64, + ); + pub fn VarDecFromUI1( + bIn: BYTE, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromI2( + uiIn: SHORT, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromI4( + lIn: LONG, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromI8( + i64In: LONG64, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromR4( + fltIn: FLOAT, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromR8( + dblIn: DOUBLE, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromDate( + dateIn: DATE, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromStr( + strIn: LPCOLESTR, + lcid: LCID, + dwFlags: ULONG, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromI1( + cIn: CHAR, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromUI2( + uiIn: USHORT, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromUI4( + ulIn: ULONG, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecFromUI8( + ui64In: ULONG64, + pdecOut: *mut DECIMAL, + ); + pub fn VarDecAdd( + pdecLeft: LPDECIMAL, + pdecRight: LPDECIMAL, + pdecResult: LPDECIMAL, + ); + pub fn VarDecDiv( + pdecLeft: LPDECIMAL, + pdecRight: LPDECIMAL, + pdecResult: LPDECIMAL, + ); + pub fn VarDecMul( + pdecLeft: LPDECIMAL, + pdecRight: LPDECIMAL, + pdecResult: LPDECIMAL, + ); + pub fn VarDecSub( + pdecLeft: LPDECIMAL, + pdecRight: LPDECIMAL, + pdecResult: LPDECIMAL, + ); + pub fn VarDecAbs( + pdecIn: LPDECIMAL, + pdecResult: LPDECIMAL, + ); + pub fn VarDecFix( + pdecIn: LPDECIMAL, + pdecResult: LPDECIMAL, + ); + pub fn VarDecInt( + pdecIn: LPDECIMAL, + pdecResult: LPDECIMAL, + ); + pub fn VarDecNeg( + pdecIn: LPDECIMAL, + pdecResult: LPDECIMAL, + ); + pub fn VarDecRound( + pdecIn: LPDECIMAL, + cDecimals: c_int, + pdecResult: LPDECIMAL, + ); + pub fn VarDecCmp( + pdecLeft: LPDECIMAL, + pdecRight: LPDECIMAL, + ); + pub fn VarDecCmpR8( + pdecLeft: LPDECIMAL, + dblRight: c_double, + ); + pub fn VarBstrCat( + bstrLeft: BSTR, + bstrRight: BSTR, + pbstrResult: LPBSTR, + ); + pub fn VarBstrCmp( + bstrLeft: BSTR, + bstrRight: BSTR, + lcid: LCID, + dwFlags: ULONG, + ); + pub fn VarR8Pow( + dblLeft: c_double, + dblRight: c_double, + pdblResult: *mut c_double, + ); + pub fn VarR4CmpR8( + fltLeft: c_float, + dblRight: c_double, + ); + pub fn VarR8Round( + dblIn: c_double, + cDecimals: c_int, + pdblResult: *mut c_double, + ); + pub fn GetAltMonthNames( + lcid: LCID, + prgp: *mut LPOLESTR, + ); +} +pub type DISPID = LONG; +pub type MEMBERID = DISPID; +pub const MEMBERID_NIL: MEMBERID = DISPID_UNKNOWN; +pub const DISPATCH_METHOD: WORD = 0x1; +pub const DISPATCH_PROPERTYGET: WORD = 0x2; +pub const DISPATCH_PROPERTYPUT: WORD = 0x4; +pub const DISPATCH_PROPERTYPUTREF: WORD = 0x8; +ENUM!{enum REGKIND { + REGKIND_DEFAULT = 0, + REGKIND_REGISTER, + REGKIND_NONE, +}} +extern "system" { + pub fn LoadTypeLibEx( + szFile: LPCOLESTR, + regkind: REGKIND, + pptlib: *mut *mut ITypeLib, + ) -> HRESULT; + pub fn RevokeActiveObject( + dwRegister: DWORD, + pvReserved: *mut c_void, + ); + pub fn SetErrorInfo( + dwReserved: ULONG, + perrinfo: *mut IErrorInfo, + ) -> HRESULT; + pub fn GetErrorInfo( + dwReserved: ULONG, + pperrinfo: *mut *mut IErrorInfo, + ) -> HRESULT; + pub fn CreateErrorInfo( + pperrinfo: *mut *mut ICreateErrorInfo, + ) -> HRESULT; + pub fn OaBuildVersion() -> ULONG; + pub fn OaEnablePerUserTLibRegistration(); +} diff --git a/bash-5.1/vendor/winapi/src/um/olectl.rs b/bash-5.1/vendor/winapi/src/um/olectl.rs new file mode 100644 index 0000000000000000000000000000000000000000..4a9ccdf9da4dd4e62814f2bd2c99f5128a6210ff --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/olectl.rs @@ -0,0 +1,14 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! OLE Control interfaces +use shared::winerror::{FACILITY_ITF, SEVERITY_ERROR, SEVERITY_SUCCESS}; +use um::winnt::HRESULT; +pub const SELFREG_E_FIRST: HRESULT = MAKE_SCODE!(SEVERITY_ERROR, FACILITY_ITF, 0x0200); +pub const SELFREG_E_LAST: HRESULT = MAKE_SCODE!(SEVERITY_ERROR, FACILITY_ITF, 0x020F); +pub const SELFREG_S_FIRST: HRESULT = MAKE_SCODE!(SEVERITY_SUCCESS, FACILITY_ITF, 0x0200); +pub const SELFREG_S_LAST: HRESULT = MAKE_SCODE!(SEVERITY_SUCCESS, FACILITY_ITF, 0x020F); +pub const SELFREG_E_TYPELIB: HRESULT = SELFREG_E_FIRST + 0; +pub const SELFREG_E_CLASS: HRESULT = SELFREG_E_FIRST + 1; diff --git a/bash-5.1/vendor/winapi/src/um/oleidl.rs b/bash-5.1/vendor/winapi/src/um/oleidl.rs new file mode 100644 index 0000000000000000000000000000000000000000..39b8c309e39642e32f87377d23e6d3f45aa2a237 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/oleidl.rs @@ -0,0 +1,43 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::DWORD; +use shared::ntdef::HRESULT; +use shared::windef::POINTL; +use um::objidl::IDataObject; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +pub const MK_ALT: DWORD = 20; +pub const DROPEFFECT_NONE: DWORD = 0; +pub const DROPEFFECT_COPY: DWORD = 1; +pub const DROPEFFECT_MOVE: DWORD = 2; +pub const DROPEFFECT_LINK: DWORD = 4; +pub const DROPEFFECT_SCROLL: DWORD = 0x80000000; +pub const DD_DEFSCROLLINSET: DWORD = 11; +pub const DD_DEFSCROLLDELAY: DWORD = 50; +pub const DD_DEFSCROLLINTERVAL: DWORD = 50; +pub const DD_DEFDRAGDELAY: DWORD = 200; +pub const DD_DEFDRAGMINDIST: DWORD = 2; +pub type LPDROPTARGET = *mut IDropTarget; +RIDL!{#[uuid(0x00000122, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IDropTarget(IDropTargetVtbl): IUnknown(IUnknownVtbl) { + fn DragEnter( + pDataObj: *const IDataObject, + grfKeyState: DWORD, + pt: *const POINTL, + pdwEffect: *mut DWORD, + ) -> HRESULT, + fn DragOver( + grfKeyState: DWORD, + pt: *const POINTL, + pdwEffect: *mut DWORD, + ) -> HRESULT, + fn DragLeave() -> HRESULT, + fn Drop( + pDataObj: *const IDataObject, + grfKeyState: DWORD, + pt: *const POINTL, + pdwEffect: *mut DWORD, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/opmapi.rs b/bash-5.1/vendor/winapi/src/um/opmapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..a8e5de87a3958340f3b51156e4d991d9ca707e51 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/opmapi.rs @@ -0,0 +1,362 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::UINT64; +use shared::d3d9::IDirect3DDevice9; +use shared::d3d9types::D3DFORMAT; +use shared::guiddef::GUID; +use shared::minwindef::{BYTE, DWORD, ULONG}; +use shared::windef::HMONITOR; +use um::dxva2api::DXVA2_SampleFormat; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LUID}; +DEFINE_GUID!{OPM_GET_CURRENT_HDCP_SRM_VERSION, + 0x99c5ceff, 0x5f1d, 0x4879, 0x81, 0xc1, 0xc5, 0x24, 0x43, 0xc9, 0x48, 0x2b} +DEFINE_GUID!{OPM_GET_CONNECTED_HDCP_DEVICE_INFORMATION, + 0x0db59d74, 0xa992, 0x492e, 0xa0, 0xbd, 0xc2, 0x3f, 0xda, 0x56, 0x4e, 0x00} +DEFINE_GUID!{OPM_GET_ACP_AND_CGMSA_SIGNALING, + 0x6629a591, 0x3b79, 0x4cf3, 0x92, 0x4a, 0x11, 0xe8, 0xe7, 0x81, 0x16, 0x71} +DEFINE_GUID!{OPM_GET_CONNECTOR_TYPE, + 0x81d0bfd5, 0x6afe, 0x48c2, 0x99, 0xc0, 0x95, 0xa0, 0x8f, 0x97, 0xc5, 0xda} +DEFINE_GUID!{OPM_GET_SUPPORTED_PROTECTION_TYPES, + 0x38f2a801, 0x9a6c, 0x48bb, 0x91, 0x07, 0xb6, 0x69, 0x6e, 0x6f, 0x17, 0x97} +DEFINE_GUID!{OPM_GET_VIRTUAL_PROTECTION_LEVEL, + 0xb2075857, 0x3eda, 0x4d5d, 0x88, 0xdb, 0x74, 0x8f, 0x8c, 0x1a, 0x05, 0x49} +DEFINE_GUID!{OPM_GET_ACTUAL_PROTECTION_LEVEL, + 0x1957210a, 0x7766, 0x452a, 0xb9, 0x9a, 0xd2, 0x7a, 0xed, 0x54, 0xf0, 0x3a} +DEFINE_GUID!{OPM_GET_ACTUAL_OUTPUT_FORMAT, + 0xd7bf1ba3, 0xad13, 0x4f8e, 0xaf, 0x98, 0x0d, 0xcb, 0x3c, 0xa2, 0x04, 0xcc} +DEFINE_GUID!{OPM_GET_ADAPTER_BUS_TYPE, + 0xc6f4d673, 0x6174, 0x4184, 0x8e, 0x35, 0xf6, 0xdb, 0x52, 0x0, 0xbc, 0xba} +DEFINE_GUID!{OPM_GET_OUTPUT_ID, + 0x72cb6df3, 0x244f, 0x40ce, 0xb0, 0x9e, 0x20, 0x50, 0x6a, 0xf6, 0x30, 0x2f} +DEFINE_GUID!{OPM_GET_DVI_CHARACTERISTICS, + 0xa470b3bb, 0x5dd7, 0x4172, 0x83, 0x9c, 0x3d, 0x37, 0x76, 0xe0, 0xeb, 0xf5} +DEFINE_GUID!{OPM_GET_CODEC_INFO, + 0x4f374491, 0x8f5f, 0x4445, 0x9d, 0xba, 0x95, 0x58, 0x8f, 0x6b, 0x58, 0xb4} +DEFINE_GUID!{OPM_GET_OUTPUT_HARDWARE_PROTECTION_SUPPORT, + 0x3b129589, 0x2af8, 0x4ef0, 0x96, 0xa2, 0x70, 0x4a, 0x84, 0x5a, 0x21, 0x8e} +DEFINE_GUID!{OPM_SET_PROTECTION_LEVEL, + 0x9bb9327c, 0x4eb5, 0x4727, 0x9f, 0x00, 0xb4, 0x2b, 0x09, 0x19, 0xc0, 0xda} +DEFINE_GUID!{OPM_SET_ACP_AND_CGMSA_SIGNALING, + 0x09a631a5, 0xd684, 0x4c60, 0x8e, 0x4d, 0xd3, 0xbb, 0x0f, 0x0b, 0xe3, 0xee} +DEFINE_GUID!{OPM_SET_HDCP_SRM, + 0x8b5ef5d1, 0xc30d, 0x44ff, 0x84, 0xa5, 0xea, 0x71, 0xdc, 0xe7, 0x8f, 0x13} +DEFINE_GUID!{OPM_SET_PROTECTION_LEVEL_ACCORDING_TO_CSS_DVD, + 0x39ce333e, 0x4cc0, 0x44ae, 0xbf, 0xcc, 0xda, 0x50, 0xb5, 0xf8, 0x2e, 0x72} +ENUM!{enum __MIDL___MIDL_itf_opmapi_0000_0000_0001 { + OPM_OMAC_SIZE = 16, + OPM_128_BIT_RANDOM_NUMBER_SIZE = 16, + OPM_ENCRYPTED_INITIALIZATION_PARAMETERS_SIZE = 256, + OPM_CONFIGURE_SETTING_DATA_SIZE = 4056, + OPM_GET_INFORMATION_PARAMETERS_SIZE = 4056, + OPM_REQUESTED_INFORMATION_SIZE = 4076, + OPM_HDCP_KEY_SELECTION_VECTOR_SIZE = 5, + OPM_PROTECTION_TYPE_SIZE = 4, + OPM_BUS_TYPE_MASK = 0xffff, + OPM_BUS_IMPLEMENTATION_MODIFIER_MASK = 0x7fff, +}} +ENUM!{enum OPM_VIDEO_OUTPUT_SEMANTICS { + OPM_VOS_COPP_SEMANTICS = 0, + OPM_VOS_OPM_SEMANTICS = 1, + OPM_VOS_OPM_INDIRECT_DISPLAY = 2, +}} +ENUM!{enum __MIDL___MIDL_itf_opmapi_0000_0000_0002 { + OPM_HDCP_FLAG_NONE = 0, + OPM_HDCP_FLAG_REPEATER = 0x1, +}} +ENUM!{enum __MIDL___MIDL_itf_opmapi_0000_0000_0003 { + OPM_STATUS_NORMAL = 0, + OPM_STATUS_LINK_LOST = 0x1, + OPM_STATUS_RENEGOTIATION_REQUIRED = 0x2, + OPM_STATUS_TAMPERING_DETECTED = 0x4, + OPM_STATUS_REVOKED_HDCP_DEVICE_ATTACHED = 0x8, +}} +ENUM!{enum __MIDL___MIDL_itf_opmapi_0000_0000_0004 { + OPM_CONNECTOR_TYPE_OTHER = -1i32 as u32, + OPM_CONNECTOR_TYPE_VGA = 0, + OPM_CONNECTOR_TYPE_SVIDEO = 1, + OPM_CONNECTOR_TYPE_COMPOSITE_VIDEO = 2, + OPM_CONNECTOR_TYPE_COMPONENT_VIDEO = 3, + OPM_CONNECTOR_TYPE_DVI = 4, + OPM_CONNECTOR_TYPE_HDMI = 5, + OPM_CONNECTOR_TYPE_LVDS = 6, + OPM_CONNECTOR_TYPE_D_JPN = 8, + OPM_CONNECTOR_TYPE_SDI = 9, + OPM_CONNECTOR_TYPE_DISPLAYPORT_EXTERNAL = 10, + OPM_CONNECTOR_TYPE_DISPLAYPORT_EMBEDDED = 11, + OPM_CONNECTOR_TYPE_UDI_EXTERNAL = 12, + OPM_CONNECTOR_TYPE_UDI_EMBEDDED = 13, + OPM_CONNECTOR_TYPE_RESERVED = 14, + OPM_CONNECTOR_TYPE_MIRACAST = 15, + OPM_CONNECTOR_TYPE_TRANSPORT_AGNOSTIC_DIGITAL_MODE_A = 16, + OPM_CONNECTOR_TYPE_TRANSPORT_AGNOSTIC_DIGITAL_MODE_B = 17, + OPM_COPP_COMPATIBLE_CONNECTOR_TYPE_INTERNAL = 0x80000000, +}} +ENUM!{enum __MIDL___MIDL_itf_opmapi_0000_0000_0005 { + OPM_DVI_CHARACTERISTIC_1_0 = 1, + OPM_DVI_CHARACTERISTIC_1_1_OR_ABOVE = 2, +}} +ENUM!{enum OPM_OUTPUT_HARDWARE_PROTECTION { + OPM_OUTPUT_HARDWARE_PROTECTION_NOT_SUPPORTED = 0, + OPM_OUTPUT_HARDWARE_PROTECTION_SUPPORTED = 0x1, +}} +ENUM!{enum __MIDL___MIDL_itf_opmapi_0000_0000_0006 { + OPM_BUS_TYPE_OTHER = 0, + OPM_BUS_TYPE_PCI = 0x1, + OPM_BUS_TYPE_PCIX = 0x2, + OPM_BUS_TYPE_PCIEXPRESS = 0x3, + OPM_BUS_TYPE_AGP = 0x4, + OPM_BUS_IMPLEMENTATION_MODIFIER_INSIDE_OF_CHIPSET = 0x10000, + OPM_BUS_IMPLEMENTATION_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP = 0x20000, + OPM_BUS_IMPLEMENTATION_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET = 0x30000, + OPM_BUS_IMPLEMENTATION_MODIFIER_DAUGHTER_BOARD_CONNECTOR = 0x40000, + OPM_BUS_IMPLEMENTATION_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE = 0x50000, + OPM_BUS_IMPLEMENTATION_MODIFIER_NON_STANDARD = 0x80000000, + OPM_COPP_COMPATIBLE_BUS_TYPE_INTEGRATED = 0x80000000, +}} +ENUM!{enum OPM_DPCP_PROTECTION_LEVEL { + OPM_DPCP_OFF = 0, + OPM_DPCP_ON = 1, + OPM_DPCP_FORCE_ULONG = 0x7fffffff, +}} +ENUM!{enum OPM_HDCP_PROTECTION_LEVEL { + OPM_HDCP_OFF = 0, + OPM_HDCP_ON = 1, + OPM_HDCP_FORCE_ULONG = 0x7fffffff, +}} +ENUM!{enum OPM_TYPE_ENFORCEMENT_HDCP_PROTECTION_LEVEL { + OPM_TYPE_ENFORCEMENT_HDCP_OFF = OPM_HDCP_OFF, + OPM_TYPE_ENFORCEMENT_HDCP_ON_WITH_NO_TYPE_RESTRICTION = OPM_HDCP_ON, + OPM_TYPE_ENFORCEMENT_HDCP_ON_WITH_TYPE1_RESTRICTION = OPM_HDCP_ON + 1, + OPM_TYPE_ENFORCEMENT_HDCP_FORCE_ULONG = 0x7fffffff, +}} +ENUM!{enum __MIDL___MIDL_itf_opmapi_0000_0000_0007 { + OPM_CGMSA_OFF = 0, + OPM_CGMSA_COPY_FREELY = 0x1, + OPM_CGMSA_COPY_NO_MORE = 0x2, + OPM_CGMSA_COPY_ONE_GENERATION = 0x3, + OPM_CGMSA_COPY_NEVER = 0x4, + OPM_CGMSA_REDISTRIBUTION_CONTROL_REQUIRED = 0x8, +}} +ENUM!{enum OPM_ACP_PROTECTION_LEVEL { + OPM_ACP_OFF = 0, + OPM_ACP_LEVEL_ONE = 1, + OPM_ACP_LEVEL_TWO = 2, + OPM_ACP_LEVEL_THREE = 3, + OPM_ACP_FORCE_ULONG = 0x7fffffff, +}} +ENUM!{enum __MIDL___MIDL_itf_opmapi_0000_0000_0008 { + OPM_PROTECTION_TYPE_OTHER = 0x80000000, + OPM_PROTECTION_TYPE_NONE = 0, + OPM_PROTECTION_TYPE_COPP_COMPATIBLE_HDCP = 0x1, + OPM_PROTECTION_TYPE_ACP = 0x2, + OPM_PROTECTION_TYPE_CGMSA = 0x4, + OPM_PROTECTION_TYPE_HDCP = 0x8, + OPM_PROTECTION_TYPE_DPCP = 0x10, + OPM_PROTECTION_TYPE_TYPE_ENFORCEMENT_HDCP = 0x20, +}} +ENUM!{enum __MIDL___MIDL_itf_opmapi_0000_0000_0009 { + OPM_PROTECTION_STANDARD_OTHER = 0x80000000, + OPM_PROTECTION_STANDARD_NONE = 0, + OPM_PROTECTION_STANDARD_IEC61880_525I = 0x1, + OPM_PROTECTION_STANDARD_IEC61880_2_525I = 0x2, + OPM_PROTECTION_STANDARD_IEC62375_625P = 0x4, + OPM_PROTECTION_STANDARD_EIA608B_525 = 0x8, + OPM_PROTECTION_STANDARD_EN300294_625I = 0x10, + OPM_PROTECTION_STANDARD_CEA805A_TYPEA_525P = 0x20, + OPM_PROTECTION_STANDARD_CEA805A_TYPEA_750P = 0x40, + OPM_PROTECTION_STANDARD_CEA805A_TYPEA_1125I = 0x80, + OPM_PROTECTION_STANDARD_CEA805A_TYPEB_525P = 0x100, + OPM_PROTECTION_STANDARD_CEA805A_TYPEB_750P = 0x200, + OPM_PROTECTION_STANDARD_CEA805A_TYPEB_1125I = 0x400, + OPM_PROTECTION_STANDARD_ARIBTRB15_525I = 0x800, + OPM_PROTECTION_STANDARD_ARIBTRB15_525P = 0x1000, + OPM_PROTECTION_STANDARD_ARIBTRB15_750P = 0x2000, + OPM_PROTECTION_STANDARD_ARIBTRB15_1125I = 0x4000, +}} +ENUM!{enum OPM_IMAGE_ASPECT_RATIO_EN300294 { + OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_4_BY_3 = 0, + OPM_ASPECT_RATIO_EN300294_BOX_14_BY_9_CENTER = 1, + OPM_ASPECT_RATIO_EN300294_BOX_14_BY_9_TOP = 2, + OPM_ASPECT_RATIO_EN300294_BOX_16_BY_9_CENTER = 3, + OPM_ASPECT_RATIO_EN300294_BOX_16_BY_9_TOP = 4, + OPM_ASPECT_RATIO_EN300294_BOX_GT_16_BY_9_CENTER = 5, + OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_4_BY_3_PROTECTED_CENTER = 6, + OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_16_BY_9_ANAMORPHIC = 7, + OPM_ASPECT_RATIO_FORCE_ULONG = 0x7fffffff, +}} +STRUCT!{#[repr(packed)] struct OPM_RANDOM_NUMBER { + abRandomNumber: [BYTE; 16], +}} +STRUCT!{#[repr(packed)] struct OPM_OMAC { + abOMAC: [BYTE; 16], +}} +STRUCT!{#[repr(packed)] struct OPM_ENCRYPTED_INITIALIZATION_PARAMETERS { + abEncryptedInitializationParameters: [BYTE; 256], +}} +STRUCT!{#[repr(packed)] struct OPM_GET_INFO_PARAMETERS { + omac: OPM_OMAC, + rnRandomNumber: OPM_RANDOM_NUMBER, + guidInformation: GUID, + ulSequenceNumber: ULONG, + cbParametersSize: ULONG, + abParameters: [BYTE; 4056], +}} +STRUCT!{#[repr(packed)] struct OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS { + rnRandomNumber: OPM_RANDOM_NUMBER, + guidInformation: GUID, + ulSequenceNumber: ULONG, + cbParametersSize: ULONG, + abParameters: [BYTE; 4056], +}} +STRUCT!{#[repr(packed)] struct OPM_HDCP_KEY_SELECTION_VECTOR { + abKeySelectionVector: [BYTE; 5], +}} +STRUCT!{#[repr(packed)] struct OPM_CONNECTED_HDCP_DEVICE_INFORMATION { + rnRandomNumber: OPM_RANDOM_NUMBER, + ulStatusFlags: ULONG, + ulHDCPFlags: ULONG, + ksvB: OPM_HDCP_KEY_SELECTION_VECTOR, + Reserved: [BYTE; 11], + Reserved2: [BYTE; 16], + Reserved3: [BYTE; 16], +}} +STRUCT!{#[repr(packed)] struct OPM_REQUESTED_INFORMATION { + omac: OPM_OMAC, + cbRequestedInformationSize: ULONG, + abRequestedInformation: [BYTE; 4076], +}} +STRUCT!{#[repr(packed)] struct OPM_STANDARD_INFORMATION { + rnRandomNumber: OPM_RANDOM_NUMBER, + ulStatusFlags: ULONG, + ulInformation: ULONG, + ulReserved: ULONG, + ulReserved2: ULONG, +}} +STRUCT!{#[repr(packed)] struct OPM_ACTUAL_OUTPUT_FORMAT { + rnRandomNumber: OPM_RANDOM_NUMBER, + ulStatusFlags: ULONG, + ulDisplayWidth: ULONG, + ulDisplayHeight: ULONG, + dsfSampleInterleaveFormat: DXVA2_SampleFormat, + d3dFormat: D3DFORMAT, + ulFrequencyNumerator: ULONG, + ulFrequencyDenominator: ULONG, +}} +STRUCT!{#[repr(packed)] struct OPM_ACP_AND_CGMSA_SIGNALING { + rnRandomNumber: OPM_RANDOM_NUMBER, + ulStatusFlags: ULONG, + ulAvailableTVProtectionStandards: ULONG, + ulActiveTVProtectionStandard: ULONG, + ulReserved: ULONG, + ulAspectRatioValidMask1: ULONG, + ulAspectRatioData1: ULONG, + ulAspectRatioValidMask2: ULONG, + ulAspectRatioData2: ULONG, + ulAspectRatioValidMask3: ULONG, + ulAspectRatioData3: ULONG, + ulReserved2: [ULONG; 4], + ulReserved3: [ULONG; 4], +}} +STRUCT!{#[repr(packed)] struct OPM_OUTPUT_ID_DATA { + rnRandomNumber: OPM_RANDOM_NUMBER, + ulStatusFlags: ULONG, + OutputId: UINT64, +}} +STRUCT!{#[repr(packed)] struct OPM_CONFIGURE_PARAMETERS { + omac: OPM_OMAC, + guidSetting: GUID, + ulSequenceNumber: ULONG, + cbParametersSize: ULONG, + abParameters: [BYTE; 4056], +}} +STRUCT!{#[repr(packed)] struct OPM_SET_PROTECTION_LEVEL_PARAMETERS { + ulProtectionType: ULONG, + ulProtectionLevel: ULONG, + Reserved: ULONG, + Reserved2: ULONG, +}} +STRUCT!{#[repr(packed)] struct OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS { + ulNewTVProtectionStandard: ULONG, + ulAspectRatioChangeMask1: ULONG, + ulAspectRatioData1: ULONG, + ulAspectRatioChangeMask2: ULONG, + ulAspectRatioData2: ULONG, + ulAspectRatioChangeMask3: ULONG, + ulAspectRatioData3: ULONG, + ulReserved: [ULONG; 4], + ulReserved2: [ULONG; 4], + ulReserved3: ULONG, +}} +STRUCT!{#[repr(packed)] struct OPM_SET_HDCP_SRM_PARAMETERS { + ulSRMVersion: ULONG, +}} +STRUCT!{#[repr(packed)] struct OPM_GET_CODEC_INFO_PARAMETERS { + cbVerifier: DWORD, + Verifier: [BYTE; 4052], +}} +STRUCT!{#[repr(packed)] struct OPM_GET_CODEC_INFO_INFORMATION { + rnRandomNumber: OPM_RANDOM_NUMBER, + Merit: DWORD, +}} +DEFINE_GUID!{IID_IOPMVideoOutput, + 0x0a15159d, 0x41c7, 0x4456, 0x93, 0xe1, 0x28, 0x4c, 0xd6, 0x1d, 0x4e, 0x8d} +RIDL!{#[uuid(0x0a15159d, 0x41c7, 0x4456, 0x93, 0xe1, 0x28, 0x4c, 0xd6, 0x1d, 0x4e, 0x8d)] +interface IOPMVideoOutput(IOPMVideoOutputVtbl): IUnknown(IUnknownVtbl) { + fn StartInitialization( + prnRandomNumber: *mut OPM_RANDOM_NUMBER, + ppbCertificate: *mut *mut BYTE, + pulCertificateLength: *mut ULONG, + ) -> HRESULT, + fn FinishInitialization( + pParameters: *const OPM_ENCRYPTED_INITIALIZATION_PARAMETERS, + ) -> HRESULT, + fn GetInformation( + pParameters: *const OPM_GET_INFO_PARAMETERS, + pRequestedInformation: *mut OPM_REQUESTED_INFORMATION, + ) -> HRESULT, + fn COPPCompatibleGetInformation( + pParameters: *const OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS, + pRequestedInformation: *mut OPM_REQUESTED_INFORMATION, + ) -> HRESULT, + fn Configure( + pParameters: *const OPM_CONFIGURE_PARAMETERS, + ulAdditionalParametersSize: ULONG, + pbAdditionalParameters: *const BYTE, + ) -> HRESULT, +}} +#[inline] +pub fn GetBusType(ulBusTypeAndImplementation: ULONG) -> ULONG { + ulBusTypeAndImplementation & OPM_BUS_TYPE_MASK +} +#[inline] +pub fn GetBusImplementation(ulBusTypeAndImplementation: ULONG) -> ULONG { + (ulBusTypeAndImplementation & OPM_BUS_IMPLEMENTATION_MODIFIER_MASK) >> 16 +} +#[inline] +pub fn IsNonStandardBusImplementation(ulBusTypeAndImplementation: ULONG) -> ULONG { + ulBusTypeAndImplementation & OPM_BUS_IMPLEMENTATION_MODIFIER_NON_STANDARD +} +extern "system" { + pub fn OPMGetVideoOutputsFromHMONITOR( + hMonitor: HMONITOR, + vos: OPM_VIDEO_OUTPUT_SEMANTICS, + pulNumVideoOutputs: *mut ULONG, + pppOPMVideoOutputArray: *mut *mut *mut IOPMVideoOutput, + ) -> HRESULT; + pub fn OPMGetVideoOutputForTarget( + pAdapterLuid: *mut LUID, + VidPnTarget: ULONG, + vos: OPM_VIDEO_OUTPUT_SEMANTICS, + ppOPMVideoOutput: *mut *mut IOPMVideoOutput, + ) -> HRESULT; + pub fn OPMGetVideoOutputsFromIDirect3DDevice9Object( + pDirect3DDevice9: *mut IDirect3DDevice9, + vos: OPM_VIDEO_OUTPUT_SEMANTICS, + pulNumVideoOutputs: *mut ULONG, + pppOPMVideoOutputArray: *mut *mut *mut IOPMVideoOutput, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/pdh.rs b/bash-5.1/vendor/winapi/src/um/pdh.rs new file mode 100644 index 0000000000000000000000000000000000000000..9ef4ee74a38f8bb1907cb0007dd1b04f32231635 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/pdh.rs @@ -0,0 +1,806 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Common Performance Data Helper definitions +use ctypes::c_double; +use shared::basetsd::DWORD_PTR; +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, DWORD, FILETIME, LPDWORD, UCHAR}; +use shared::windef::HWND; +use um::winnt::{BOOLEAN, HANDLE, LONG, LONGLONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR}; +pub const PDH_FMT_RAW: DWORD = 0x00000010; +pub const PDH_FMT_ANSI: DWORD = 0x00000020; +pub const PDH_FMT_UNICODE: DWORD = 0x00000040; +pub const PDH_FMT_LONG: DWORD = 0x00000100; +pub const PDH_FMT_DOUBLE: DWORD = 0x00000200; +pub const PDH_FMT_LARGE: DWORD = 0x00000400; +pub const PDH_FMT_NOSCALE: DWORD = 0x00001000; +pub const PDH_FMT_1000: DWORD = 0x00002000; +pub const PDH_FMT_NODATA: DWORD = 0x00004000; +pub const PDH_FMT_NOCAP100: DWORD = 0x00008000; +pub const PERF_DETAIL_COSTLY: DWORD = 0x00010000; +pub const PERF_DETAIL_STANDARD: DWORD = 0x0000FFFF; +pub type PDH_STATUS = LONG; +pub type PDH_HQUERY = HANDLE; +pub type HQUERY = PDH_HQUERY; +pub type PDH_HCOUNTER = HANDLE; +pub type HCOUNTER = PDH_HCOUNTER; +pub type PPDH_BROWSE_DLG_CONFIG_A = *mut PDH_BROWSE_DLG_CONFIG_A; +pub type PPDH_BROWSE_DLG_CONFIG_W = *mut PDH_BROWSE_DLG_CONFIG_W; +pub type PDH_HLOG = HANDLE; +pub type PPDH_RAW_LOG_RECORD = *mut PDH_RAW_LOG_RECORD; +pub type PPDH_TIME_INFO = *mut PDH_TIME_INFO; +pub type PPDH_RAW_COUNTER = *mut PDH_RAW_COUNTER; +pub type PPDH_COUNTER_INFO_A = *mut PDH_COUNTER_INFO_A; +pub type PPDH_COUNTER_INFO_W = *mut PDH_COUNTER_INFO_W; +pub type PPDH_STATISTICS = *mut PDH_STATISTICS; +pub type PPDH_FMT_COUNTERVALUE_ITEM_A = *mut PDH_FMT_COUNTERVALUE_ITEM_A; +pub type PPDH_FMT_COUNTERVALUE_ITEM_W = *mut PDH_FMT_COUNTERVALUE_ITEM_W; +pub type PPDH_DATA_ITEM_PATH_ELEMENTS_A = *mut PDH_DATA_ITEM_PATH_ELEMENTS_A; +pub type PPDH_DATA_ITEM_PATH_ELEMENTS_W = *mut PDH_DATA_ITEM_PATH_ELEMENTS_W; +pub type PPDH_FMT_COUNTERVALUE = *mut PDH_FMT_COUNTERVALUE; +FN!{stdcall CounterPathCallBack( + DWORD_PTR, +) -> PDH_STATUS} +pub type PPDH_COUNTER_PATH_ELEMENTS_A = *mut PDH_COUNTER_PATH_ELEMENTS_A; +pub type PPDH_COUNTER_PATH_ELEMENTS_W = *mut PDH_COUNTER_PATH_ELEMENTS_W; +pub type PPDH_BROWSE_DLG_CONFIG_HA = *mut PDH_BROWSE_DLG_CONFIG_HA; +pub type PPDH_BROWSE_DLG_CONFIG_HW = *mut PDH_BROWSE_DLG_CONFIG_HW; +UNION!{union PDH_FMT_COUNTERVALUE_u { + [u64; 1], + longValue longValue_mut: LONG, + doubleValue doubleValue_mut: c_double, + largeValue largeValue_mut: LONGLONG, + AnsiStringValue AnsiStringValue_mut: LPCSTR, + WideStringValue WideStringValue_mut: LPCWSTR, +}} +STRUCT!{struct PDH_FMT_COUNTERVALUE { + CStatus: DWORD, + u: PDH_FMT_COUNTERVALUE_u, +}} +STRUCT!{struct PDH_RAW_LOG_RECORD { + dwStructureSize: DWORD, + dwRecordType: DWORD, + dwItems: DWORD, + RawBytes: UCHAR, +}} +STRUCT!{struct PDH_TIME_INFO { + StartTime: LONGLONG, + EndTime: LONGLONG, + SampleCount: DWORD, +}} +STRUCT!{struct PDH_RAW_COUNTER { + CStatus: DWORD, + TimeStamp: FILETIME, + FirstValue: LONGLONG, + SecondValue: LONGLONG, + MultiCount: DWORD, +}} +STRUCT!{struct PDH_STATISTICS { + dwFormat: DWORD, + count: DWORD, + min: PDH_FMT_COUNTERVALUE, + max: PDH_FMT_COUNTERVALUE, + mean: PDH_FMT_COUNTERVALUE, +}} +STRUCT!{struct PDH_FMT_COUNTERVALUE_ITEM_A { + szName: LPSTR, + FmtValue: PDH_FMT_COUNTERVALUE, +}} +STRUCT!{struct PDH_FMT_COUNTERVALUE_ITEM_W { + szName: LPWSTR, + FmtValue: PDH_FMT_COUNTERVALUE, +}} +STRUCT!{struct PDH_BROWSE_DLG_CONFIG_A { + flags: DWORD, + hWndOwner: HWND, + szDataSource: LPSTR, + szReturnPathBuffer: LPSTR, + cchReturnPathLength: DWORD, + pCallBack: CounterPathCallBack, + dwCallBackArg: DWORD_PTR, + CallBackStatus: PDH_STATUS, + dwDefaultDetailLevel: DWORD, + szDialogBoxCaption: LPSTR, +}} +BITFIELD!{PDH_BROWSE_DLG_CONFIG_A flags: DWORD [ + IncludeInstanceIndex set_IncludeInstanceIndex[0..1], + SingleCounterPerAdd set_SingleCounterPerAdd[1..2], + SingleCounterPerDialog set_SingleCounterPerDialog[2..3], + LocalCountersOnly set_LocalCountersOnly[3..4], + WildCardInstances set_WildCardInstances[4..5], + HideDetailBox set_HideDetailBox[5..6], + InitializePath set_InitializePath[6..7], + DisableMachineSelection set_DisableMachineSelection[7..8], + IncludeCostlyObjects set_IncludeCostlyObjects[8..9], + ShowObjectBrowser set_ShowObjectBrowser[9..10], +]} +STRUCT!{struct PDH_BROWSE_DLG_CONFIG_W { + flags: DWORD, + hWndOwner: HWND, + szDataSource: LPWSTR, + szReturnPathBuffer: LPWSTR, + cchReturnPathLength: DWORD, + pCallBack: CounterPathCallBack, + dwCallBackArg: DWORD_PTR, + CallBackStatus: PDH_STATUS, + dwDefaultDetailLevel: DWORD, + szDialogBoxCaption: LPWSTR, +}} +BITFIELD!{PDH_BROWSE_DLG_CONFIG_W flags: DWORD [ + IncludeInstanceIndex set_IncludeInstanceIndex[0..1], + SingleCounterPerAdd set_SingleCounterPerAdd[1..2], + SingleCounterPerDialog set_SingleCounterPerDialog[2..3], + LocalCountersOnly set_LocalCountersOnly[3..4], + WildCardInstances set_WildCardInstances[4..5], + HideDetailBox set_HideDetailBox[5..6], + InitializePath set_InitializePath[6..7], + DisableMachineSelection set_DisableMachineSelection[7..8], + IncludeCostlyObjects set_IncludeCostlyObjects[8..9], + ShowObjectBrowser set_ShowObjectBrowser[9..10], +]} +STRUCT!{struct PDH_COUNTER_PATH_ELEMENTS_A { + szMachineName: LPSTR, + szObjectName: LPSTR, + szInstanceName: LPSTR, + szParentInstance: LPSTR, + dwInstanceIndex: DWORD, + szCounterName: LPSTR, +}} +STRUCT!{struct PDH_COUNTER_PATH_ELEMENTS_W { + szMachineName: LPWSTR, + szObjectName: LPWSTR, + szInstanceName: LPWSTR, + szParentInstance: LPWSTR, + dwInstanceIndex: DWORD, + szCounterName: LPWSTR, +}} +STRUCT!{struct PDH_DATA_ITEM_PATH_ELEMENTS_A { + szMachineName: LPSTR, + ObjectGUID: GUID, + dwItemId: DWORD, + szInstanceName: LPSTR, +}} +STRUCT!{struct PDH_DATA_ITEM_PATH_ELEMENTS_W { + szMachineName: LPWSTR, + ObjectGUID: GUID, + dwItemId: DWORD, + szInstanceName: LPWSTR, +}} +STRUCT!{struct PDH_COUNTER_INFO_A_u_s { + szMachineName: LPSTR, + szObjectName: LPSTR, + szInstanceName: LPSTR, + szParentInstance: LPSTR, + dwInstanceIndex: DWORD, + szCounterName: LPSTR, +}} +UNION!{union PDH_COUNTER_INFO_A_u { + [u32; 7] [u64; 6], + DataItemPath DataItemPath_mut: PDH_DATA_ITEM_PATH_ELEMENTS_A, + CounterPath CounterPath_mut: PDH_COUNTER_PATH_ELEMENTS_A, + s s_mut: PDH_COUNTER_INFO_A_u_s, +}} +STRUCT!{struct PDH_COUNTER_INFO_A { + dwLength: DWORD, + dwType: DWORD, + CVersion: DWORD, + CStatus: DWORD, + lScale: LONG, + lDefaultScale: LONG, + dwUserData: DWORD_PTR, + dwQueryUserData: DWORD_PTR, + szFullPath: LPSTR, + u: PDH_COUNTER_INFO_A_u, + szExplainText: LPSTR, + DataBuffer: [DWORD; 1], +}} +STRUCT!{struct PDH_COUNTER_INFO_W_u_s { + szMachineName: LPWSTR, + szObjectName: LPWSTR, + szInstanceName: LPWSTR, + szParentInstance: LPWSTR, + dwInstanceIndex: DWORD, + szCounterName: LPWSTR, +}} +UNION!{union PDH_COUNTER_INFO_W_u { + [u32; 7] [u64; 6], + DataItemPath DataItemPath_mut: PDH_DATA_ITEM_PATH_ELEMENTS_W, + CounterPath CounterPath_mut: PDH_COUNTER_PATH_ELEMENTS_W, + s s_mut: PDH_COUNTER_INFO_W_u_s, +}} +STRUCT!{struct PDH_COUNTER_INFO_W { + dwLength: DWORD, + dwType: DWORD, + CVersion: DWORD, + CStatus: DWORD, + lScale: LONG, + lDefaultScale: LONG, + dwUserData: DWORD_PTR, + dwQueryUserData: DWORD_PTR, + szFullPath: LPWSTR, + u: PDH_COUNTER_INFO_W_u, + szExplainText: LPWSTR, + DataBuffer: [DWORD; 1], +}} +STRUCT!{struct PDH_BROWSE_DLG_CONFIG_HA { + flags: DWORD, + hWndOwner: HWND, + hDataSource: PDH_HLOG, + szReturnPathBuffer: LPSTR, + cchReturnPathLength: DWORD, + pCallBack: CounterPathCallBack, + dwCallBackArg: DWORD_PTR, + CallBackStatus: PDH_STATUS, + dwDefaultDetailLevel: DWORD, + szDialogBoxCaption: LPSTR, +}} +BITFIELD!{PDH_BROWSE_DLG_CONFIG_HA flags: DWORD [ + IncludeInstanceIndex set_IncludeInstanceIndex[0..1], + SingleCounterPerAdd set_SingleCounterPerAdd[1..2], + SingleCounterPerDialog set_SingleCounterPerDialog[2..3], + LocalCountersOnly set_LocalCountersOnly[3..4], + WildCardInstances set_WildCardInstances[4..5], + HideDetailBox set_HideDetailBox[5..6], + InitializePath set_InitializePath[6..7], + DisableMachineSelection set_DisableMachineSelection[7..8], + IncludeCostlyObjects set_IncludeCostlyObjects[8..9], + ShowObjectBrowser set_ShowObjectBrowser[9..10], +]} +STRUCT!{struct PDH_BROWSE_DLG_CONFIG_HW { + flags: DWORD, + hWndOwner: HWND, + hDataSource: PDH_HLOG, + szReturnPathBuffer: LPWSTR, + cchReturnPathLength: DWORD, + pCallBack: CounterPathCallBack, + dwCallBackArg: DWORD_PTR, + CallBackStatus: PDH_STATUS, + dwDefaultDetailLevel: DWORD, + szDialogBoxCaption: LPWSTR, +}} +BITFIELD!{PDH_BROWSE_DLG_CONFIG_HW flags: DWORD [ + IncludeInstanceIndex set_IncludeInstanceIndex[0..1], + SingleCounterPerAdd set_SingleCounterPerAdd[1..2], + SingleCounterPerDialog set_SingleCounterPerDialog[2..3], + LocalCountersOnly set_LocalCountersOnly[3..4], + WildCardInstances set_WildCardInstances[4..5], + HideDetailBox set_HideDetailBox[5..6], + InitializePath set_InitializePath[6..7], + DisableMachineSelection set_DisableMachineSelection[7..8], + IncludeCostlyObjects set_IncludeCostlyObjects[8..9], + ShowObjectBrowser set_ShowObjectBrowser[9..10], +]} +extern "system" { + pub fn PdhGetDllVersion( + lpdwVersion: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhOpenQueryW( + szDataSource: LPCWSTR, + dwUserData: DWORD_PTR, + phQuery: *mut PDH_HQUERY, + ) -> PDH_STATUS; + pub fn PdhOpenQueryA( + szDataSource: LPCSTR, + dwUserData: DWORD_PTR, + phQuery: *mut PDH_HQUERY, + ) -> PDH_STATUS; + pub fn PdhAddCounterW( + hQuery: PDH_HQUERY, + szFullCounterPath: LPCWSTR, + dwUserData: DWORD_PTR, + phCounter: *mut PDH_HCOUNTER, + ) -> PDH_STATUS; + pub fn PdhAddCounterA( + hQuery: PDH_HQUERY, + szFullCounterPath: LPCSTR, + dwUserData: DWORD_PTR, + phCounter: *mut PDH_HCOUNTER, + ) -> PDH_STATUS; + pub fn PdhAddEnglishCounterW( + hQuery: PDH_HQUERY, + szFullCounterPath: LPCWSTR, + dwUserData: DWORD_PTR, + phCounter: *mut PDH_HCOUNTER, + ) -> PDH_STATUS; + pub fn PdhAddEnglishCounterA( + hQuery: PDH_HQUERY, + szFullCounterPath: LPCSTR, + dwUserData: DWORD_PTR, + phCounter: *mut PDH_HCOUNTER, + ) -> PDH_STATUS; + pub fn PdhCollectQueryDataWithTime( + hQuery: PDH_HQUERY, + pllTimeStamp: *mut LONGLONG, + ) -> PDH_STATUS; + pub fn PdhValidatePathExW( + hDataSource: PDH_HLOG, + szFullPathBuffer: LPCWSTR, + ) -> PDH_STATUS; + pub fn PdhValidatePathExA( + hDataSource: PDH_HLOG, + szFullPathBuffer: LPCSTR, + ) -> PDH_STATUS; + pub fn PdhRemoveCounter( + hCounter: PDH_HCOUNTER, + ) -> PDH_STATUS; + pub fn PdhCollectQueryData( + hQuery: PDH_HQUERY, + ) -> PDH_STATUS; + pub fn PdhCloseQuery( + hQuery: PDH_HQUERY, + ) -> PDH_STATUS; + pub fn PdhGetFormattedCounterValue( + hCounter: PDH_HCOUNTER, + dwFormat: DWORD, + lpdwType: LPDWORD, + pValue: PPDH_FMT_COUNTERVALUE, + ) -> PDH_STATUS; + pub fn PdhGetFormattedCounterArrayA( + hCounter: PDH_HCOUNTER, + dwFormat: DWORD, + lpdwBufferSize: LPDWORD, + lpdwBufferCount: LPDWORD, + ItemBuffer: PPDH_FMT_COUNTERVALUE_ITEM_A, + ) -> PDH_STATUS; + pub fn PdhGetFormattedCounterArrayW( + hCounter: PDH_HCOUNTER, + dwFormat: DWORD, + lpdwBufferSize: LPDWORD, + lpdwBufferCount: LPDWORD, + ItemBuffer: PPDH_FMT_COUNTERVALUE_ITEM_W, + ) -> PDH_STATUS; + pub fn PdhGetRawCounterValue( + hCounter: PDH_HCOUNTER, + lpdwType: LPDWORD, + pValue: PPDH_RAW_COUNTER, + ) -> PDH_STATUS; + pub fn PdhGetRawCounterArrayA( + hCounter: PDH_HCOUNTER, + dwFormat: DWORD, + lpdwBufferSize: LPDWORD, + lpdwBufferCount: LPDWORD, + ItemBuffer: PPDH_FMT_COUNTERVALUE_ITEM_A, + ) -> PDH_STATUS; + pub fn PdhGetRawCounterArrayW( + hCounter: PDH_HCOUNTER, + dwFormat: DWORD, + lpdwBufferSize: LPDWORD, + lpdwBufferCount: LPDWORD, + ItemBuffer: PPDH_FMT_COUNTERVALUE_ITEM_W, + ) -> PDH_STATUS; + pub fn PdhCalculateCounterFromRawValue( + hCounter: PDH_HCOUNTER, + dwFormat: DWORD, + rawValue1: PPDH_RAW_COUNTER, + rawValue2: PPDH_RAW_COUNTER, + fmtValue: PPDH_FMT_COUNTERVALUE, + ) -> PDH_STATUS; + pub fn PdhComputeCounterStatistics( + hCounter: PDH_HCOUNTER, + dwFormat: DWORD, + dwFirstEntry: DWORD, + dwNumEntries: DWORD, + lpRawValueArray: PPDH_RAW_COUNTER, + data: PPDH_STATISTICS, + ) -> PDH_STATUS; + pub fn PdhGetCounterInfoW( + hCounter: PDH_HCOUNTER, + bRetrieveExplainText: BOOLEAN, + pdwBufferSize: LPDWORD, + lpBuffer: PPDH_COUNTER_INFO_W, + ) -> PDH_STATUS; + pub fn PdhGetCounterInfoA( + hCounter: PDH_HCOUNTER, + bRetrieveExplainText: BOOLEAN, + pdwBufferSize: LPDWORD, + lpBuffer: PPDH_COUNTER_INFO_A, + ) -> PDH_STATUS; + pub fn PdhSetCounterScaleFactor( + hCounter: PDH_HCOUNTER, + lFactor: LONG, + ) -> PDH_STATUS; + pub fn PdhConnectMachineW( + szMachineName: LPCWSTR, + ) -> PDH_STATUS; + pub fn PdhConnectMachineA( + szMachineName: LPCSTR, + ) -> PDH_STATUS; + pub fn PdhEnumMachinesW( + szDataSource: LPCWSTR, + mszMachineNameList: LPWSTR, + pcchBufferLength: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhEnumMachinesA( + szDataSource: LPCSTR, + mszMachineNameList: LPSTR, + pcchBufferLength: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhEnumObjectsW( + szDataSource: LPCWSTR, + szMachineName: LPCWSTR, + mszObjectList: LPWSTR, + pcchBufferLength: LPDWORD, + dwDetailLevel: DWORD, + bRefresh: BOOL, + ) -> PDH_STATUS; + pub fn PdhEnumObjectsA( + szDataSource: LPCSTR, + szMachineName: LPCSTR, + mszObjectList: LPSTR, + pcchBufferLength: LPDWORD, + dwDetailLevel: DWORD, + bRefresh: BOOL, + ) -> PDH_STATUS; + pub fn PdhEnumObjectItemsW( + szDataSource: LPCWSTR, + szMachineName: LPCWSTR, + szObjectName: LPCWSTR, + mszCounterList: LPWSTR, + pcchCounterListLength: LPDWORD, + mszInstanceList: LPWSTR, + pcchInstanceListLength: LPDWORD, + dwDetailLevel: DWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhEnumObjectItemsA( + szDataSource: LPCSTR, + szMachineName: LPCSTR, + szObjectName: LPCSTR, + mszCounterList: LPSTR, + pcchCounterListLength: LPDWORD, + mszInstanceList: LPSTR, + pcchInstanceListLength: LPDWORD, + dwDetailLevel: DWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhMakeCounterPathW( + pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS_W, + szFullPathBuffer: LPWSTR, + pcchBufferSize: LPDWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhMakeCounterPathA( + pCounterPathElements: PPDH_COUNTER_PATH_ELEMENTS_A, + szFullPathBuffer: LPSTR, + pcchBufferSize: LPDWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhParseCounterPathW( + szFullPathBuffer: LPCWSTR, + pCounterPathElements: *mut PDH_COUNTER_PATH_ELEMENTS_W, + pcchBufferSize: LPDWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhParseCounterPathA( + szFullPathBuffer: LPCSTR, + pCounterPathElements: *mut PDH_COUNTER_PATH_ELEMENTS_A, + pcchBufferSize: LPDWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhParseInstanceNameW( + szInstanceString: LPCWSTR, + szInstanceName: LPWSTR, + pcchInstanceNameLength: LPDWORD, + szParentName: LPWSTR, + pcchParentNameLength: LPDWORD, + lpIndex: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhParseInstanceNameA( + szInstanceString: LPCSTR, + szInstanceName: LPSTR, + pcchInstanceNameLength: LPDWORD, + szParentName: LPSTR, + pcchParentNameLength: LPDWORD, + lpIndex: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhValidatePathW( + szFullCounterPath: LPCWSTR, + ) -> PDH_STATUS; + pub fn PdhValidatePathA( + szFullCounterPath: LPCSTR, + ) -> PDH_STATUS; + pub fn PdhGetDefaultPerfObjectW( + szDataSource: LPCWSTR, + szMachineName: LPCWSTR, + szDefaultObjectName: LPWSTR, + pcchBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhGetDefaultPerfObjectA( + szDataSource: LPCSTR, + szMachineName: LPCSTR, + szDefaultObjectName: LPSTR, + pcchBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhGetDefaultPerfCounterW( + szDataSource: LPCWSTR, + szMachineName: LPCWSTR, + szObjectName: LPCWSTR, + szDefaultCounterName: LPWSTR, + pcchBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhGetDefaultPerfCounterA( + szDataSource: LPCSTR, + szMachineName: LPCSTR, + szObjectName: LPCSTR, + szDefaultCounterName: LPSTR, + pcchBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhBrowseCountersW( + pBrowseDlgData: PPDH_BROWSE_DLG_CONFIG_W, + ) -> PDH_STATUS; + pub fn PdhBrowseCountersA( + pBrowseDlgData: PPDH_BROWSE_DLG_CONFIG_A, + ) -> PDH_STATUS; + pub fn PdhExpandCounterPathW( + szWildCardPath: LPCWSTR, + mszExpandedPathList: LPWSTR, + pcchPathListLength: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhExpandCounterPathA( + szWildCardPath: LPCSTR, + mszExpandedPathList: LPSTR, + pcchPathListLength: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhLookupPerfNameByIndexW( + szMachineName: LPCWSTR, + dwNameIndex: DWORD, + szNameBuffer: LPWSTR, + pcchNameBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhLookupPerfNameByIndexA( + szMachineName: LPCSTR, + dwNameIndex: DWORD, + szNameBuffer: LPSTR, + pcchNameBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhLookupPerfIndexByNameW( + szMachineName: LPCWSTR, + szNameBuffer: LPCWSTR, + pdwIndex: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhLookupPerfIndexByNameA( + szMachineName: LPCSTR, + szNameBuffer: LPCSTR, + pdwIndex: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhExpandWildCardPathW( + szDataSource: LPCWSTR, + szWildCardPath: LPCWSTR, + mszExpandedPathList: LPWSTR, + pcchPathListLength: LPDWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhExpandWildCardPathA( + szDataSource: LPCSTR, + szWildCardPath: LPCSTR, + mszExpandedPathList: LPSTR, + pcchPathListLength: LPDWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhOpenLogW( + szLogFileName: LPCWSTR, + dwAccessFlags: DWORD, + lpdwLogType: LPDWORD, + hQuery: PDH_HQUERY, + dwMaxSize: DWORD, + szUserCaption: LPCWSTR, + phLog: *mut PDH_HLOG, + ) -> PDH_STATUS; + pub fn PdhOpenLogA( + szLogFileName: LPCSTR, + dwAccessFlags: DWORD, + lpdwLogType: LPDWORD, + hQuery: PDH_HQUERY, + dwMaxSize: DWORD, + szUserCaption: LPCSTR, + phLog: *mut PDH_HLOG, + ) -> PDH_STATUS; + pub fn PdhUpdateLogW( + hLog: PDH_HLOG, + szUserString: LPCWSTR, + ) -> PDH_STATUS; + pub fn PdhUpdateLogA( + hLog: PDH_HLOG, + szUserString: LPCSTR, + ) -> PDH_STATUS; + pub fn PdhUpdateLogFileCatalog( + hLog: PDH_HLOG, + ) -> PDH_STATUS; + pub fn PdhGetLogFileSize( + hLog: PDH_HLOG, + llSize: *mut LONGLONG, + ) -> PDH_STATUS; + pub fn PdhCloseLog( + hLog: PDH_HLOG, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhSelectDataSourceW( + hWndOwner: HWND, + dwFlags: DWORD, + szDataSource: LPWSTR, + pcchBufferLength: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhSelectDataSourceA( + hWndOwner: HWND, + dwFlags: DWORD, + szDataSource: LPSTR, + pcchBufferLength: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhIsRealTimeQuery( + hQuery: PDH_HQUERY, + ) -> PDH_STATUS; + pub fn PdhSetQueryTimeRange( + hQuery: PDH_HQUERY, + pInfo: PPDH_TIME_INFO, + ) -> PDH_STATUS; + pub fn PdhGetDataSourceTimeRangeW( + szDataSource: LPCWSTR, + pdwNumEntries: LPDWORD, + pInfo: PPDH_TIME_INFO, + pdwBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhGetDataSourceTimeRangeA( + szDataSource: LPCSTR, + pdwNumEntries: LPDWORD, + pInfo: PPDH_TIME_INFO, + pdwBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhCollectQueryDataEx( + hQuery: PDH_HQUERY, + dwIntervalTime: DWORD, + hNewDataEvent: HANDLE, + ) -> PDH_STATUS; + pub fn PdhFormatFromRawValue( + dwCounterType: DWORD, + dwFormat: DWORD, + pTimeBase: *mut LONGLONG, + rawValue1: PPDH_RAW_COUNTER, + rawValue2: PPDH_RAW_COUNTER, + fmtValue: PPDH_FMT_COUNTERVALUE, + ) -> PDH_STATUS; + pub fn PdhGetCounterTimeBase( + hCounter: PDH_HCOUNTER, + pTimeBase: *mut LONGLONG, + ) -> PDH_STATUS; + pub fn PdhReadRawLogRecord( + hLog: PDH_HLOG, + ftRecord: FILETIME, + pRawLogRecord: PPDH_RAW_LOG_RECORD, + pdwBufferLength: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhSetDefaultRealTimeDataSource( + dwDataSourceId: DWORD, + ) -> PDH_STATUS; + pub fn PdhBindInputDataSourceW( + phDataSource: *mut PDH_HLOG, + szLogFileNameList: LPCWSTR, + ) -> PDH_STATUS; + pub fn PdhBindInputDataSourceA( + phDataSource: *mut PDH_HLOG, + szLogFileNameList: LPCSTR, + ) -> PDH_STATUS; + pub fn PdhOpenQueryH( + hDataSource: PDH_HLOG, + dwUserData: DWORD_PTR, + phQuery: *mut PDH_HQUERY, + ) -> PDH_STATUS; + pub fn PdhEnumMachinesHW( + hDataSource: PDH_HLOG, + mszMachineNameList: LPWSTR, + pcchBufferLength: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhEnumMachinesHA( + hDataSource: PDH_HLOG, + mszMachineNameList: LPSTR, + pcchBufferLength: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhEnumObjectsHW( + hDataSource: PDH_HLOG, + szMachineName: LPCWSTR, + mszObjectList: LPWSTR, + pcchBufferLength: LPDWORD, + dwDetailLevel: DWORD, + bRefresh: BOOL, + ) -> PDH_STATUS; + pub fn PdhEnumObjectsHA( + hDataSource: PDH_HLOG, + szMachineName: LPCSTR, + mszObjectList: LPSTR, + pcchBufferLength: LPDWORD, + dwDetailLevel: DWORD, + bRefresh: BOOL, + ) -> PDH_STATUS; + pub fn PdhEnumObjectItemsHW( + hDataSource: PDH_HLOG, + szMachineName: LPCWSTR, + szObjectName: LPCWSTR, + mszCounterList: LPWSTR, + pcchCounterListLength: LPDWORD, + mszInstanceList: LPWSTR, + pcchInstanceListLength: LPDWORD, + dwDetailLevel: DWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhEnumObjectItemsHA( + hDataSource: PDH_HLOG, + szMachineName: LPCSTR, + szObjectName: LPCSTR, + mszCounterList: LPSTR, + pcchCounterListLength: LPDWORD, + mszInstanceList: LPSTR, + pcchInstanceListLength: LPDWORD, + dwDetailLevel: DWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhExpandWildCardPathHW( + hDataSource: PDH_HLOG, + szWildCardPath: LPCWSTR, + mszExpandedPathList: LPWSTR, + pcchPathListLength: LPDWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhExpandWildCardPathHA( + hDataSource: PDH_HLOG, + szWildCardPath: LPCSTR, + mszExpandedPathList: LPSTR, + pcchPathListLength: LPDWORD, + dwFlags: DWORD, + ) -> PDH_STATUS; + pub fn PdhGetDataSourceTimeRangeH( + hDataSource: PDH_HLOG, + pdwNumEntries: LPDWORD, + pInfo: PPDH_TIME_INFO, + pdwBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhGetDefaultPerfObjectHW( + hDataSource: PDH_HLOG, + szMachineName: LPCWSTR, + szDefaultObjectName: LPWSTR, + pcchBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhGetDefaultPerfObjectHA( + hDataSource: PDH_HLOG, + szMachineName: LPCSTR, + szDefaultObjectName: LPSTR, + pcchBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhGetDefaultPerfCounterHW( + hDataSource: PDH_HLOG, + szMachineName: LPCWSTR, + szObjectName: LPCWSTR, + szDefaultCounterName: LPWSTR, + pcchBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhGetDefaultPerfCounterHA( + hDataSource: PDH_HLOG, + szMachineName: LPCSTR, + szObjectName: LPCSTR, + szDefaultCounterName: LPSTR, + pcchBufferSize: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhBrowseCountersHW( + pBrowseDlgData: PPDH_BROWSE_DLG_CONFIG_HW, + ) -> PDH_STATUS; + pub fn PdhBrowseCountersHA( + pBrowseDlgData: PPDH_BROWSE_DLG_CONFIG_HA, + ) -> PDH_STATUS; + pub fn PdhEnumLogSetNamesW( + szDataSource: LPCWSTR, + mszLogSetNameList: LPWSTR, + pcchBufferLength: LPDWORD, + ) -> PDH_STATUS; + pub fn PdhEnumLogSetNamesA( + szDataSource: LPCSTR, + mszLogSetNameList: LPSTR, + pcchBufferLength: LPDWORD, + ) -> PDH_STATUS; +} +// pub fn PdhVerifySQLDBW() -> PDH_STATUS; +// pub fn PdhVerifySQLDBA() -> PDH_STATUS; +// pub fn PdhCreateSQLTablesW() -> PDH_STATUS; +// pub fn PdhCreateSQLTablesA() -> PDH_STATUS; +//pub fn PdhGetLogSetGUID() -> PDH_STATUS; +// pub fn PdhSetLogSetRunID() -> PDH_STATUS; diff --git a/bash-5.1/vendor/winapi/src/um/perflib.rs b/bash-5.1/vendor/winapi/src/um/perflib.rs new file mode 100644 index 0000000000000000000000000000000000000000..aea3bde944320e0146faaa237cbd4208821af02f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/perflib.rs @@ -0,0 +1,331 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::SIZE_T; +use shared::guiddef::{GUID, LPCGUID, LPGUID}; +use shared::minwindef::{DWORD, LPBYTE, LPDWORD, LPVOID, ULONG}; +use um::minwinbase::SYSTEMTIME; +use um::winnt::{HANDLE, LONG, LONGLONG, LPCWSTR, PCWSTR, PHANDLE, PVOID, ULONGLONG}; +pub const PERF_PROVIDER_USER_MODE: ULONG = 0; +pub const PERF_PROVIDER_KERNEL_MODE: ULONG = 1; +pub const PERF_PROVIDER_DRIVER: ULONG = 2; +pub const PERF_COUNTERSET_FLAG_MULTIPLE: ULONG = 2; +pub const PERF_COUNTERSET_FLAG_AGGREGATE: ULONG = 4; +pub const PERF_COUNTERSET_FLAG_HISTORY: ULONG = 8; +pub const PERF_COUNTERSET_FLAG_INSTANCE: ULONG = 16; +pub const PERF_COUNTERSET_SINGLE_INSTANCE: ULONG = 0; +pub const PERF_COUNTERSET_MULTI_INSTANCES: ULONG = PERF_COUNTERSET_FLAG_MULTIPLE; +pub const PERF_COUNTERSET_SINGLE_AGGREGATE: ULONG = PERF_COUNTERSET_FLAG_AGGREGATE; +pub const PERF_COUNTERSET_MULTI_AGGREGATE: ULONG = PERF_COUNTERSET_FLAG_AGGREGATE + | PERF_COUNTERSET_FLAG_MULTIPLE; +pub const PERF_COUNTERSET_SINGLE_AGGREGATE_HISTORY: ULONG = PERF_COUNTERSET_FLAG_HISTORY + | PERF_COUNTERSET_SINGLE_AGGREGATE; +pub const PERF_COUNTERSET_INSTANCE_AGGREGATE: ULONG = PERF_COUNTERSET_MULTI_AGGREGATE + | PERF_COUNTERSET_FLAG_INSTANCE; +pub const PERF_AGGREGATE_UNDEFINED: ULONG = 0; +pub const PERF_AGGREGATE_TOTAL: ULONG = 1; +pub const PERF_AGGREGATE_AVG: ULONG = 2; +pub const PERF_AGGREGATE_MIN: ULONG = 3; +pub const PERF_AGGREGATE_MAX: ULONG = 4; +pub const PERF_ATTRIB_BY_REFERENCE: ULONGLONG = 0x0000000000000001; +pub const PERF_ATTRIB_NO_DISPLAYABLE: ULONGLONG = 0x0000000000000002; +pub const PERF_ATTRIB_NO_GROUP_SEPARATOR: ULONGLONG = 0x0000000000000004; +pub const PERF_ATTRIB_DISPLAY_AS_REAL: ULONGLONG = 0x0000000000000008; +pub const PERF_ATTRIB_DISPLAY_AS_HEX: ULONGLONG = 0x0000000000000010; +STRUCT!{struct PERF_COUNTERSET_INFO { + CounterSetGuid: GUID, + ProviderGuid: GUID, + NumCounters: ULONG, + InstanceType: ULONG, +}} +pub type PPERF_COUNTERSET_INFO = *mut PERF_COUNTERSET_INFO; +STRUCT!{struct PERF_COUNTER_INFO { + CounterId: ULONG, + Type: ULONG, + Attrib: ULONGLONG, + Size: ULONG, + DetailLevel: ULONG, + Scale: LONG, + Offset: LONG, +}} +pub type PPERF_COUNTER_INFO = *mut PERF_COUNTER_INFO; +STRUCT!{struct PERF_COUNTERSET_INSTANCE { + CounterSetGuid: GUID, + dwSize: ULONG, + InstanceId: ULONG, + InstanceNameOffset: ULONG, + InstanceNameSize: ULONG, +}} +pub type PPERF_COUNTERSET_INSTANCE = *mut PERF_COUNTERSET_INSTANCE; +STRUCT!{struct PERF_COUNTER_IDENTITY { + CounterSetGuid: GUID, + BufferSize: ULONG, + CounterId: ULONG, + InstanceId: ULONG, + MachineOffset: ULONG, + NameOffset: ULONG, + Reserved: ULONG, +}} +pub type PPERF_COUNTER_IDENTITY = *mut PERF_COUNTER_IDENTITY; +pub const PERF_WILDCARD_COUNTER: ULONG = 0xFFFFFFFF; +pub const PERF_WILDCARD_INSTANCE: &'static str = "*"; +pub const PERF_AGGREGATE_INSTANCE: &'static str = "_Total"; +pub const PERF_MAX_INSTANCE_NAME: ULONG = 1024; +pub const PERF_ADD_COUNTER: ULONG = 1; +pub const PERF_REMOVE_COUNTER: ULONG = 2; +pub const PERF_ENUM_INSTANCES: ULONG = 3; +pub const PERF_COLLECT_START: ULONG = 5; +pub const PERF_COLLECT_END: ULONG = 6; +pub const PERF_FILTER: ULONG = 9; +FN!{stdcall PERFLIBREQUEST( + RequestCode: ULONG, + Buffer: PVOID, + BufferSize: ULONG, +) -> ULONG} +FN!{stdcall PERF_MEM_ALLOC( + AllocSize: SIZE_T, + pContext: LPVOID, +) -> LPVOID} +FN!{stdcall PERF_MEM_FREE( + pBuffer: LPVOID, + pContext: LPVOID, +) -> ()} +STRUCT!{struct PERF_PROVIDER_CONTEXT { + ContextSize: DWORD, + Reserved: DWORD, + ControlCallback: PERFLIBREQUEST, + MemAllocRoutine: PERF_MEM_ALLOC, + MemFreeRoutine: PERF_MEM_FREE, + pMemContext: LPVOID, +}} +pub type PPERF_PROVIDER_CONTEXT = *mut PERF_PROVIDER_CONTEXT; +extern "system" { + pub fn PerfStartProviderEx( + ProviderGuid: LPGUID, + ProviderContext: PPERF_PROVIDER_CONTEXT, + Provider: PHANDLE, + ) -> ULONG; + pub fn PerfStartProvider( + ProviderGuid: LPGUID, + ControlCallback: PERFLIBREQUEST, + Provider: PHANDLE, + ) -> ULONG; + pub fn PerfStopProvider( + ProviderHandle: HANDLE, + ) -> ULONG; + pub fn PerfSetCounterSetInfo( + ProviderHandle: HANDLE, + Template: PPERF_COUNTERSET_INFO, + TemplateSize: ULONG, + ) -> ULONG; + pub fn PerfCreateInstance( + ProviderHandle: HANDLE, + CounterSetGuid: LPCGUID, + Name: PCWSTR, + Id: ULONG, + ) -> PPERF_COUNTERSET_INSTANCE; + pub fn PerfDeleteInstance( + Provider: HANDLE, + InstanceBlock: PPERF_COUNTERSET_INSTANCE, + ) -> ULONG; + pub fn PerfQueryInstance( + ProviderHandle: HANDLE, + CounterSetGuid: LPCGUID, + Name: LPCWSTR, + Id: ULONG, + ) -> PPERF_COUNTERSET_INSTANCE; + pub fn PerfSetCounterRefValue( + Provider: HANDLE, + Instance: PPERF_COUNTERSET_INSTANCE, + CounterId: ULONG, + Address: PVOID, + ) -> ULONG; + pub fn PerfSetULongCounterValue( + Provider: HANDLE, + Instance: PPERF_COUNTERSET_INSTANCE, + CounterId: ULONG, + Value: ULONG, + ) -> ULONG; + pub fn PerfSetULongLongCounterValue( + Provider: HANDLE, + Instance: PPERF_COUNTERSET_INSTANCE, + CounterId: ULONG, + Value: ULONGLONG, + ) -> ULONG; + pub fn PerfIncrementULongCounterValue( + Provider: HANDLE, + Instance: PPERF_COUNTERSET_INSTANCE, + CounterId: ULONG, + Value: ULONG, + ) -> ULONG; + pub fn PerfIncrementULongLongCounterValue( + Provider: HANDLE, + Instance: PPERF_COUNTERSET_INSTANCE, + CounterId: ULONG, + Value: ULONGLONG, + ) -> ULONG; + pub fn PerfDecrementULongCounterValue( + Provider: HANDLE, + Instance: PPERF_COUNTERSET_INSTANCE, + CounterId: ULONG, + Value: ULONG, + ) -> ULONG; + pub fn PerfDecrementULongLongCounterValue( + Provider: HANDLE, + Instance: PPERF_COUNTERSET_INSTANCE, + CounterId: ULONG, + Value: ULONGLONG, + ) -> ULONG; +} +STRUCT!{struct PERF_INSTANCE_HEADER { + Size: ULONG, + InstanceId: ULONG, +}} +pub type PPERF_INSTANCE_HEADER = *mut PERF_INSTANCE_HEADER; +ENUM!{enum PerfRegInfoType { + PERF_REG_COUNTERSET_STRUCT = 1, + PERF_REG_COUNTER_STRUCT, + PERF_REG_COUNTERSET_NAME_STRING, + PERF_REG_COUNTERSET_HELP_STRING, + PERF_REG_COUNTER_NAME_STRINGS, + PERF_REG_COUNTER_HELP_STRINGS, + PERF_REG_PROVIDER_NAME, + PERF_REG_PROVIDER_GUID, + PERF_REG_COUNTERSET_ENGLISH_NAME, + PERF_REG_COUNTER_ENGLISH_NAMES, +}} +STRUCT!{struct PERF_COUNTERSET_REG_INFO { + CounterSetGuid: GUID, + CounterSetType: ULONG, + DetailLevel: ULONG, + NumCounters: ULONG, + InstanceType: ULONG, +}} +pub type PPERF_COUNTERSET_REG_INFO = *mut PERF_COUNTERSET_REG_INFO; +STRUCT!{struct PERF_COUNTER_REG_INFO { + CounterId: ULONG, + Type: ULONG, + Attrib: ULONGLONG, + DetailLevel: ULONG, + DefaultScale: LONG, + BaseCounterId: ULONG, + PerfTimeId: ULONG, + PerfFreqId: ULONG, + MultiId: ULONG, + AggregateFinc: ULONG, + Reserved: ULONG, +}} +pub type PPERF_COUNTER_REG_INFO = *mut PERF_COUNTER_REG_INFO; +STRUCT!{struct PERF_STRING_BUFFER_HEADER { + dwSize: DWORD, + dwCounters: DWORD, +}} +pub type PPERF_STRING_BUFFER_HEADER = *mut PERF_STRING_BUFFER_HEADER; +STRUCT!{struct PERF_STRING_COUNTER_HEADER { + dwCounterId: DWORD, + dwOffset: DWORD, +}} +pub type PPERF_STRING_COUNTER_HEADER = *mut PERF_STRING_COUNTER_HEADER; +STRUCT!{struct PERF_COUNTER_IDENTIFIER { + CounterSetGuid: GUID, + Status: ULONG, + Size: ULONG, + CounterId: ULONG, + InstanceId: ULONG, + Index: ULONG, + Reserved: ULONG, +}} +pub type PPERF_COUNTER_IDENTIFIER = *mut PERF_COUNTER_IDENTIFIER; +STRUCT!{struct PERF_DATA_HEADER { + dwTotalSize: ULONG, + dwNumCounters: ULONG, + PerfTimeStamp: LONGLONG, + PerfTime100NSec: LONGLONG, + PrefFreq: LONGLONG, + SystemTime: SYSTEMTIME, +}} +pub type PPERF_DATA_HEADER = *mut PERF_DATA_HEADER; +ENUM!{enum PerfCounterDataType { + PERF_ERROR_RETURN = 0, + PERF_SINGLE_COUNTER = 1, + PERF_MULTIPLE_COUNTERS = 2, + PERF_MULTIPLE_INSTANCES = 4, + PERF_COUNTERSET = 6, +}} +STRUCT!{struct PERF_COUNTER_HEADER { + dwStatus: ULONG, + dwType: PerfCounterDataType, + dwSize: ULONG, + Reserved: ULONG, +}} +pub type PPERF_COUNTER_HEADER = *mut PERF_COUNTER_HEADER; +STRUCT!{struct PERF_MULTI_INSTANCES { + dwTotalSize: ULONG, + dwInstances: ULONG, +}} +pub type PPERF_MULTI_INSTANCES = *mut PERF_MULTI_INSTANCES; +STRUCT!{struct PERF_MULTI_COUNTERS { + dwSize: ULONG, + dwCounters: ULONG, +}} +pub type PPERF_MULTI_COUNTERS = *mut PERF_MULTI_COUNTERS; +STRUCT!{struct PERF_COUNTER_DATA { + dwDataSize: ULONG, + dwSize: ULONG, +}} +pub type PPERF_COUNTER_DATA = *mut PERF_COUNTER_DATA; +extern "system" { + pub fn PerfEnumerateCounterSet( + szMachine: LPCWSTR, + pCounterSetIds: LPGUID, + cCounterSetIds: DWORD, + pcCounterSetIdsActual: LPDWORD, + ) -> ULONG; + pub fn PerfEnumerateCounterSetInstances( + szMachine: LPCWSTR, + pCounterSetIds: LPCGUID, + pInstances: PPERF_INSTANCE_HEADER, + cbInstances: DWORD, + pcbInstancesActual: LPDWORD, + ) -> ULONG; + pub fn PerfQueryCounterSetRegistrationInfo( + szMachine: LPCWSTR, + pCounterSetId: LPCGUID, + requestCode: PerfRegInfoType, + requestLangId: DWORD, + pbRegInfo: LPBYTE, + cbRegInfo: DWORD, + pcbRegInfoActual: LPDWORD, + ) -> ULONG; + pub fn PerfOpenQueryHandle( + szMachine: LPCWSTR, + hQuery: *mut HANDLE, + ) -> ULONG; + pub fn PerfCloseQueryHandle( + hQuery: HANDLE, + ) -> ULONG; + pub fn PerfQueryCounterInfo( + hQuery: HANDLE, + pCounters: PPERF_COUNTER_IDENTIFIER, + cbCounters: DWORD, + pcbCountersActual: LPDWORD, + ) -> ULONG; + pub fn PerfQueryCounterData( + hQuery: HANDLE, + pCounterBlock: PPERF_DATA_HEADER, + cbCounterBlock: DWORD, + pcbCounterBlockActual: LPDWORD, + ) -> ULONG; + pub fn PerfAddCounters( + hQuery: HANDLE, + pCounters: PPERF_COUNTER_IDENTIFIER, + cbCounters: DWORD, + ) -> ULONG; + pub fn PerfDeleteCounters( + hQuery: HANDLE, + pCounters: PPERF_COUNTER_IDENTIFIER, + cbCounters: DWORD, + ) -> ULONG; +} diff --git a/bash-5.1/vendor/winapi/src/um/physicalmonitorenumerationapi.rs b/bash-5.1/vendor/winapi/src/um/physicalmonitorenumerationapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..b61ff7e00d34766cd0b42cf2587336990be26368 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/physicalmonitorenumerationapi.rs @@ -0,0 +1,43 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::d3d9::IDirect3DDevice9; +use shared::minwindef::{BOOL, DWORD, LPDWORD}; +use shared::windef::HMONITOR; +use um::winnt::{HANDLE, HRESULT, WCHAR}; +pub type _BOOL = BOOL; +pub const PHYSICAL_MONITOR_DESCRIPTION_SIZE: usize = 128; +STRUCT!{#[repr(packed)] struct PHYSICAL_MONITOR { + hPhysicalMonitor: HANDLE, + szPhysicalMonitorDescription: [WCHAR; PHYSICAL_MONITOR_DESCRIPTION_SIZE], +}} +pub type LPPHYSICAL_MONITOR = *mut PHYSICAL_MONITOR; +extern "system" { + pub fn GetNumberOfPhysicalMonitorsFromHMONITOR( + hMonitor: HMONITOR, + pdwNumberOfPhysicalMonitor: LPDWORD, + ) -> _BOOL; + pub fn GetNumberOfPhysicalMonitorsFromIDirect3DDevice9( + pDirect3DDevice9: *mut IDirect3DDevice9, + pdwNumberOfPhysicalMonitor: LPDWORD, + ) -> HRESULT; + pub fn GetPhysicalMonitorsFromHMONITOR( + hMonitor: HMONITOR, + dwPhysicalMonitorArraySize: DWORD, + pPhysicalMonitorArray: LPPHYSICAL_MONITOR, + ) -> _BOOL; + pub fn GetPhysicalMonitorsFromIDirect3DDevice9( + pDirect3DDevice9: IDirect3DDevice9, + dwPhysicalMonitorArraySize: DWORD, + pPhysicalMonitorArray: LPPHYSICAL_MONITOR, + ) -> HRESULT; + pub fn DestroyPhysicalMonitor( + hMonitor: HANDLE, + ) -> _BOOL; + pub fn DestroyPhysicalMonitors( + dwPhysicalMonitorArraySize: DWORD, + pPhysicalMonitorArray: LPPHYSICAL_MONITOR, + ) -> _BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/playsoundapi.rs b/bash-5.1/vendor/winapi/src/um/playsoundapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..9b0d0d50a193a7eb75e75398b9959281d87f854e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/playsoundapi.rs @@ -0,0 +1,46 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-mm-playsound-l1-1-0 +use shared::minwindef::{BOOL, DWORD, HMODULE, UINT}; +use um::winnt::{LPCSTR, LPCWSTR}; +extern "system" { + pub fn sndPlaySoundA( + pszSound: LPCSTR, + fuSound: UINT, + ) -> BOOL; + pub fn sndPlaySoundW( + pszSound: LPCWSTR, + fuSound: UINT, + ) -> BOOL; +} +pub const SND_SYNC: DWORD = 0x0000; +pub const SND_ASYNC: DWORD = 0x0001; +pub const SND_NODEFAULT: DWORD = 0x0002; +pub const SND_MEMORY: DWORD = 0x0004; +pub const SND_LOOP: DWORD = 0x0008; +pub const SND_NOSTOP: DWORD = 0x0010; +pub const SND_NOWAIT: DWORD = 0x00002000; +pub const SND_ALIAS: DWORD = 0x00010000; +pub const SND_ALIAS_ID: DWORD = 0x00110000; +pub const SND_FILENAME: DWORD = 0x00020000; +pub const SND_RESOURCE: DWORD = 0x00040004; +pub const SND_PURGE: DWORD = 0x0040; +pub const SND_APPLICATION: DWORD = 0x0080; +pub const SND_SENTRY: DWORD = 0x00080000; +pub const SND_RING: DWORD = 0x00100000; +pub const SND_SYSTEM: DWORD = 0x00200000; +extern "system" { + pub fn PlaySoundA( + pszSound: LPCSTR, + hmod: HMODULE, + fdwSound: DWORD, + ) -> BOOL; + pub fn PlaySoundW( + pszSound: LPCWSTR, + hmod: HMODULE, + fdwSound: DWORD, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/portabledevice.rs b/bash-5.1/vendor/winapi/src/um/portabledevice.rs new file mode 100644 index 0000000000000000000000000000000000000000..68d63485bda981a806b206254685b70aaa522941 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/portabledevice.rs @@ -0,0 +1,163 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of PortableDevice.h +use shared::basetsd::ULONG_PTR; +use shared::wtypes::PROPERTYKEY; +DEFINE_GUID!{GUID_DEVINTERFACE_WPD, + 0x6AC27878, 0xA6FA, 0x4155, 0xBA, 0x85, 0xF9, 0x8F, 0x49, 0x1D, 0x4F, 0x33} +DEFINE_GUID!{GUID_DEVINTERFACE_WPD_PRIVATE, + 0xBA0C718F, 0x4DED, 0x49B7, 0xBD, 0xD3, 0xFA, 0xBE, 0x28, 0x66, 0x12, 0x11} +DEFINE_GUID!{GUID_DEVINTERFACE_WPD_SERVICE, + 0x9EF44F80, 0x3D64, 0x4246, 0xA6, 0xAA, 0x20, 0x6F, 0x32, 0x8D, 0x1E, 0xDC} +//51 +pub const WPD_DEVICE_OBJECT_ID: &'static str = "DEVICE"; +pub const WMDRMDEVICEAPP_USE_WPD_DEVICE_PTR: ULONG_PTR = -1isize as ULONG_PTR; +pub const PORTABLE_DEVICE_TYPE: &'static str = "PortableDeviceType"; +pub const PORTABLE_DEVICE_ICON: &'static str = "Icons"; +pub const PORTABLE_DEVICE_NAMESPACE_TIMEOUT: &'static str = "PortableDeviceNameSpaceTimeout"; +pub const PORTABLE_DEVICE_NAMESPACE_EXCLUDE_FROM_SHELL: &'static str + = "PortableDeviceNameSpaceExcludeFromShell"; +pub const PORTABLE_DEVICE_NAMESPACE_THUMBNAIL_CONTENT_TYPES: &'static str + = "PortableDeviceNameSpaceThumbnailContentTypes"; +pub const PORTABLE_DEVICE_IS_MASS_STORAGE: &'static str = "PortableDeviceIsMassStorage"; +pub const PORTABLE_DEVICE_DRM_SCHEME_WMDRM10_PD: &'static str = "WMDRM10-PD"; +pub const PORTABLE_DEVICE_DRM_SCHEME_PDDRM: &'static str = "PDDRM"; +//101 +ENUM!{enum WPD_DEVICE_TYPES { + WPD_DEVICE_TYPE_GENERIC = 0, + WPD_DEVICE_TYPE_CAMERA = 1, + WPD_DEVICE_TYPE_MEDIA_PLAYER = 2, + WPD_DEVICE_TYPE_PHONE = 3, + WPD_DEVICE_TYPE_VIDEO = 4, + WPD_DEVICE_TYPE_PERSONAL_INFORMATION_MANAGER = 5, + WPD_DEVICE_TYPE_AUDIO_RECORDER = 6, +}} +//133 +ENUM!{enum WPD_DEVICE_TRANSPORTS { + WPD_DEVICE_TRANSPORT_UNSPECIFIED = 0, + WPD_DEVICE_TRANSPORT_USB = 1, + WPD_DEVICE_TRANSPORT_IP = 2, + WPD_DEVICE_TRANSPORT_BLUETOOTH = 3, +}} +//175 +ENUM!{enum WPD_POWER_SOURCES { + WPD_POWER_SOURCE_BATTERY = 0, + WPD_POWER_SOURCE_EXTERNAL = 1, +}} +//696 +DEFINE_GUID!{WPD_FUNCTIONAL_OBJECT_PROPERTIES_V1, + 0x8F052D93, 0xABCA, 0x4FC5, 0xA5, 0xAC, 0xB0, 0x1D, 0xF4, 0xDB, 0xE5, 0x98} +DEFINE_PROPERTYKEY!{WPD_FUNCTIONAL_OBJECT_CATEGORY, + 0x8F052D93, 0xABCA, 0x4FC5, 0xA5, 0xAC, 0xB0, 0x1D, 0xF4, 0xDB, 0xE5, 0x98, 2} +//1140 +DEFINE_GUID!{WPD_DEVICE_PROPERTIES_V1, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC} +DEFINE_PROPERTYKEY!{WPD_DEVICE_SYNC_PARTNER, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 2} +DEFINE_PROPERTYKEY!{WPD_DEVICE_FIRMWARE_VERSION, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 3} +DEFINE_PROPERTYKEY!{WPD_DEVICE_POWER_LEVEL, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 4} +DEFINE_PROPERTYKEY!{WPD_DEVICE_POWER_SOURCE, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 5} +DEFINE_PROPERTYKEY!{WPD_DEVICE_PROTOCOL, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 6} +DEFINE_PROPERTYKEY!{WPD_DEVICE_MANUFACTURER, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 7} +DEFINE_PROPERTYKEY!{WPD_DEVICE_MODEL, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 8} +DEFINE_PROPERTYKEY!{WPD_DEVICE_SERIAL_NUMBER, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 9} +DEFINE_PROPERTYKEY!{WPD_DEVICE_SUPPORTS_NON_CONSUMABLE, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 10} +DEFINE_PROPERTYKEY!{WPD_DEVICE_DATETIME, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 11} +DEFINE_PROPERTYKEY!{WPD_DEVICE_FRIENDLY_NAME, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 12} +DEFINE_PROPERTYKEY!{WPD_DEVICE_SUPPORTED_DRM_SCHEMES, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 13} +DEFINE_PROPERTYKEY!{WPD_DEVICE_SUPPORTED_FORMATS_ARE_ORDERED, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 14} +DEFINE_PROPERTYKEY!{WPD_DEVICE_TYPE, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 15} +DEFINE_PROPERTYKEY!{WPD_DEVICE_NETWORK_IDENTIFIER, + 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC, 16} +DEFINE_GUID!{WPD_DEVICE_PROPERTIES_V2, + 0x463DD662, 0x7FC4, 0x4291, 0x91, 0x1C, 0x7F, 0x4C, 0x9C, 0xCA, 0x97, 0x99} +DEFINE_PROPERTYKEY!{WPD_DEVICE_FUNCTIONAL_UNIQUE_ID, + 0x463DD662, 0x7FC4, 0x4291, 0x91, 0x1C, 0x7F, 0x4C, 0x9C, 0xCA, 0x97, 0x99, 2} +DEFINE_PROPERTYKEY!{WPD_DEVICE_MODEL_UNIQUE_ID, + 0x463DD662, 0x7FC4, 0x4291, 0x91, 0x1C, 0x7F, 0x4C, 0x9C, 0xCA, 0x97, 0x99, 3} +DEFINE_PROPERTYKEY!{WPD_DEVICE_TRANSPORT, + 0x463DD662, 0x7FC4, 0x4291, 0x91, 0x1C, 0x7F, 0x4C, 0x9C, 0xCA, 0x97, 0x99, 4} +DEFINE_PROPERTYKEY!{WPD_DEVICE_USE_DEVICE_STAGE, + 0x463DD662, 0x7FC4, 0x4291, 0x91, 0x1C, 0x7F, 0x4C, 0x9C, 0xCA, 0x97, 0x99, 5} +DEFINE_GUID!{WPD_DEVICE_PROPERTIES_V3, + 0x6C2B878C, 0xC2EC, 0x490D, 0xB4, 0x25, 0xD7, 0xA7, 0x5E, 0x23, 0xE5, 0xED} +DEFINE_PROPERTYKEY!{WPD_DEVICE_EDP_IDENTITY, + 0x6C2B878C, 0xC2EC, 0x490D, 0xB4, 0x25, 0xD7, 0xA7, 0x5E, 0x23, 0xE5, 0xED, 1} +//1488 +DEFINE_PROPERTYKEY!{WPD_PROPERTY_COMMON_COMMAND_CATEGORY, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 1001} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_COMMON_COMMAND_ID, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 1002} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_COMMON_HRESULT, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 1003} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_COMMON_DRIVER_ERROR_CODE, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 1004} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_COMMON_COMMAND_TARGET, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 1006} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_COMMON_PERSISTENT_UNIQUE_IDS, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 1007} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_COMMON_OBJECT_IDS, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 1008} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_COMMON_CLIENT_INFORMATION, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 1009} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_COMMON_CLIENT_INFORMATION_CONTEXT, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 1010} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_COMMON_ACTIVITY_ID, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 1011} +DEFINE_PROPERTYKEY!{WPD_OPTION_VALID_OBJECT_IDS, + 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A, 5001} +//3440 +DEFINE_PROPERTYKEY!{WPD_OBJECT_ID, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 2} +DEFINE_PROPERTYKEY!{WPD_OBJECT_PARENT_ID, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 3} +DEFINE_PROPERTYKEY!{WPD_OBJECT_NAME, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 4} +DEFINE_PROPERTYKEY!{WPD_OBJECT_PERSISTENT_UNIQUE_ID, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 5} +DEFINE_PROPERTYKEY!{WPD_OBJECT_FORMAT, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 6} +DEFINE_PROPERTYKEY!{WPD_OBJECT_ISHIDDEN, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 9} +DEFINE_PROPERTYKEY!{WPD_OBJECT_ISSYSTEM, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 10} +DEFINE_PROPERTYKEY!{WPD_OBJECT_SIZE, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 11} +DEFINE_PROPERTYKEY!{WPD_OBJECT_ORIGINAL_FILE_NAME, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 12} +DEFINE_PROPERTYKEY!{WPD_OBJECT_NON_CONSUMABLE, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 13} +DEFINE_PROPERTYKEY!{WPD_OBJECT_KEYWORDS, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 15} +DEFINE_PROPERTYKEY!{WPD_OBJECT_SYNC_ID, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 16} +DEFINE_PROPERTYKEY!{WPD_OBJECT_IS_DRM_PROTECTED, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 17} +DEFINE_PROPERTYKEY!{WPD_OBJECT_DATE_CREATED, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 18} +DEFINE_PROPERTYKEY!{WPD_OBJECT_DATE_MODIFIED, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 19} +DEFINE_PROPERTYKEY!{WPD_OBJECT_DATE_AUTHORED, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 20} +DEFINE_PROPERTYKEY!{WPD_OBJECT_BACK_REFERENCES, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 21} +DEFINE_PROPERTYKEY!{WPD_OBJECT_CAN_DELETE, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 26} +DEFINE_PROPERTYKEY!{WPD_OBJECT_LANGUAGE_LOCALE, + 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, 27} diff --git a/bash-5.1/vendor/winapi/src/um/portabledeviceapi.rs b/bash-5.1/vendor/winapi/src/um/portabledeviceapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..a694e7e2d43e92164dc4e3b2d17e6e022c39ae90 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/portabledeviceapi.rs @@ -0,0 +1,288 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of PortableDeviceApi.h +use shared::guiddef::REFGUID; +use shared::minwindef::{BYTE, DWORD, ULONG}; +use um::objidlbase::IStream; +use um::portabledevicetypes::{ + IPortableDeviceKeyCollection, IPortableDevicePropVariantCollection, IPortableDeviceValues, +}; +use um::propkeydef::REFPROPERTYKEY; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR, WCHAR}; +// 328 +RIDL!{#[uuid(0xa1567595, 0x4c2f, 0x4574, 0xa6, 0xfa, 0xec, 0xef, 0x91, 0x7b, 0x9a, 0x40)] +interface IPortableDeviceManager(IPortableDeviceManagerVtbl): IUnknown(IUnknownVtbl) { + fn GetDevices( + pPnPDeviceIDs: *mut LPWSTR, + pcPnPDeviceIDs: *mut DWORD, + ) -> HRESULT, + fn RefreshDeviceList() -> HRESULT, + fn GetDeviceFriendlyName( + pszPnPDeviceID: LPCWSTR, + pDeviceFriendlyName: *mut WCHAR, + pcchDeviceFriendlyName: *mut DWORD, + ) -> HRESULT, + fn GetDeviceDescription( + pszPnPDeviceID: LPCWSTR, + pDeviceDescription: *mut WCHAR, + pcchDeviceDescription: *mut DWORD, + ) -> HRESULT, + fn GetDeviceManufacturer( + pszPnPDeviceID: LPCWSTR, + pDeviceManufacturer: *mut WCHAR, + pcchDeviceManufacturer: *mut DWORD, + ) -> HRESULT, + fn GetDeviceProperty( + pszPnPDeviceID: LPCWSTR, + pszDevicePropertyName: LPCWSTR, + pData: *mut BYTE, + pcbData: *mut DWORD, + pdwType: *mut DWORD, + ) -> HRESULT, + fn GetPrivateDevices( + pPnPDeviceIDs: *mut LPWSTR, + pcPnPDeviceIDs: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x625e2df8, 0x6392, 0x4cf0, 0x9a, 0xd1, 0x3c, 0xfa, 0x5f, 0x17, 0x77, 0x5c)] +interface IPortableDevice(IPortableDeviceVtbl): IUnknown(IUnknownVtbl) { + fn Open( + pszPnPDeviceID: LPCWSTR, + pClientInfo: *mut IPortableDeviceValues, + ) -> HRESULT, + fn SendCommand( + dwFlags: DWORD, + pParameters: *mut IPortableDeviceValues, + ppResults: *mut *mut IPortableDeviceValues, + ) -> HRESULT, + fn Content( + ppContent: *mut *mut IPortableDeviceContent, + ) -> HRESULT, + fn Capabilities( + ppCapabilities: *mut *mut IPortableDeviceCapabilities, + ) -> HRESULT, + fn Cancel() -> HRESULT, + fn Close() -> HRESULT, + fn Advise( + dwFlags: DWORD, + pCallback: *mut IPortableDeviceEventCallback, + pParameters: *mut IPortableDeviceValues, + ppszCookie: *mut LPWSTR, + ) -> HRESULT, + fn Unadvise( + pszCookie: LPCWSTR, + ) -> HRESULT, + fn GetPnPDeviceID( + ppszPnPDeviceID: *mut LPWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6a96ed84, 0x7c73, 0x4480, 0x99, 0x38, 0xbf, 0x5a, 0xf4, 0x77, 0xd4, 0x26)] +interface IPortableDeviceContent(IPortableDeviceContentVtbl): IUnknown(IUnknownVtbl) { + fn EnumObjects( + dwFlags: DWORD, + pszParentObjectID: LPCWSTR, + pFilter: *mut IPortableDeviceValues, + ppEnum: *mut *mut IEnumPortableDeviceObjectIDs, + ) -> HRESULT, + fn Properties( + ppProperties: *mut *mut IPortableDeviceProperties, + ) -> HRESULT, + fn Transfer( + ppResources: *mut *mut IPortableDeviceResources, + ) -> HRESULT, + fn CreateObjectWithPropertiesOnly( + pValues: *mut IPortableDeviceValues, + ppszObjectID: *mut LPWSTR, + ) -> HRESULT, + fn CreateObjectWithPropertiesAndData( + pValues: *mut IPortableDeviceValues, + ppData: *mut *mut IStream, + pdwOptimalWriteBufferSize: *mut DWORD, + ppszCookie: *mut LPWSTR, + ) -> HRESULT, + fn Delete( + dwOptions: DWORD, + pObjectIDs: *mut IPortableDevicePropVariantCollection, + ppResults: *mut *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, + fn GetObjectIDsFromPersistentUniqueIDs( + pPersistentUniqueIDs: *mut IPortableDevicePropVariantCollection, + ppObjectIDs: *mut *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, + fn Cancel() -> HRESULT, + fn Move( + pObjectIDs: *mut IPortableDevicePropVariantCollection, + pszDestinationFolderObjectID: LPCWSTR, + ppResults: *mut *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, + fn Copy( + pObjectIDs: *mut IPortableDevicePropVariantCollection, + pszDestinationFolderObjectID: LPCWSTR, + ppResults: *mut *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9b4add96, 0xf6bf, 0x4034, 0x87, 0x08, 0xec, 0xa7, 0x2b, 0xf1, 0x05, 0x54)] +interface IPortableDeviceContent2(IPortableDeviceContent2Vtbl): + IPortableDeviceContent(IPortableDeviceContentVtbl) { + fn UpdateObjectWithPropertiesAndData( + pszObjectID: LPCWSTR, + pProperties: *mut IPortableDeviceValues, + ppData: *mut *mut IStream, + pdwOptimalWriteBufferSize: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x10ece955, 0xcf41, 0x4728, 0xbf, 0xa0, 0x41, 0xee, 0xdf, 0x1b, 0xbf, 0x19)] +interface IEnumPortableDeviceObjectIDs(IEnumPortableDeviceObjectIDsVtbl): IUnknown(IUnknownVtbl) { + fn Next( + cObjects: ULONG, + pObjIDs: *mut LPWSTR, + pcFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + cObjects: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppEnum: *mut *mut IEnumPortableDeviceObjectIDs, + ) -> HRESULT, + fn Cancel() -> HRESULT, +}} +RIDL!{#[uuid(0x7f6d695c, 0x03df, 0x4439, 0xa8, 0x09, 0x59, 0x26, 0x6b, 0xee, 0xe3, 0xa6)] +interface IPortableDeviceProperties(IPortableDevicePropertiesVtbl): IUnknown(IUnknownVtbl) { + fn GetSupportedProperties( + pszObjectID: LPCWSTR, + ppKeys: *mut *mut IPortableDeviceKeyCollection, + ) -> HRESULT, + fn GetPropertyAttributes( + pszObjectID: LPCWSTR, + Key: REFPROPERTYKEY, + ppAttributes: *mut *mut IPortableDeviceValues, + ) -> HRESULT, + fn GetValues( + pszObjectID: LPCWSTR, + pKeys: *mut IPortableDeviceKeyCollection, + ppValues: *mut *mut IPortableDeviceValues, + ) -> HRESULT, + fn SetValues( + pszObjectID: LPCWSTR, + pValues: *mut IPortableDeviceValues, + ppResults: *mut *mut IPortableDeviceValues, + ) -> HRESULT, + fn Delete( + pszObjectID: LPCWSTR, + pKeys: *mut IPortableDeviceKeyCollection, + ) -> HRESULT, + fn Cancel() -> HRESULT, +}} +RIDL!{#[uuid(0xfd8878ac, 0xd841, 0x4d17, 0x89, 0x1c, 0xe6, 0x82, 0x9c, 0xdb, 0x69, 0x34)] +interface IPortableDeviceResources(IPortableDeviceResourcesVtbl): IUnknown(IUnknownVtbl) { + fn GetSupportedResources( + pszObjectID: LPCWSTR, + ppKeys: *mut *mut IPortableDeviceKeyCollection, + ) -> HRESULT, + fn GetResourceAttributes( + pszObjectID: LPCWSTR, + Key: REFPROPERTYKEY, + ppResourceAttributes: *mut *mut IPortableDeviceValues, + ) -> HRESULT, + fn GetStream( + pszObjectID: LPCWSTR, + Key: REFPROPERTYKEY, + dwMode: DWORD, + pdwOptimalBufferSize: *mut DWORD, + ppStream: *mut *mut IStream, + ) -> HRESULT, + fn Delete( + pszObjectID: LPCWSTR, + pKeys: *mut IPortableDeviceKeyCollection, + ) -> HRESULT, + fn Cancel() -> HRESULT, + fn CreateResource( + pResourceAttributes: *mut IPortableDeviceValues, + ppData: *mut *mut IStream, + pdwOptimalWriteBufferSize: *mut DWORD, + ppszCookie: *mut LPWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2c8c6dbf, 0xe3dc, 0x4061, 0xbe, 0xcc, 0x85, 0x42, 0xe8, 0x10, 0xd1, 0x26)] +interface IPortableDeviceCapabilities(IPortableDeviceCapabilitiesVtbl): IUnknown(IUnknownVtbl) { + fn GetSupportedCommands( + ppCommands: *mut *mut IPortableDeviceKeyCollection, + ) -> HRESULT, + fn GetCommandOptions( + Command: REFPROPERTYKEY, + ppOptions: *mut *mut IPortableDeviceValues, + ) -> HRESULT, + fn GetFunctionalCategories( + ppCategories: *mut *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, + fn GetFunctionalObjects( + Category: REFGUID, + ppObjectIDs: *mut *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, + fn GetSupportedContentTypes( + Category: REFGUID, + ppContentTypes: *mut *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, + fn GetSupportedFormats( + ContentType: REFGUID, + ppFormats: *mut *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, + fn GetSupportedFormatProperties( + Format: REFGUID, + ppKeys: *mut *mut IPortableDeviceKeyCollection, + ) -> HRESULT, + fn GetFixedPropertyAttributes( + Format: REFGUID, + Key: REFPROPERTYKEY, + ppAttributes: *mut *mut IPortableDeviceValues, + ) -> HRESULT, + fn Cancel() -> HRESULT, + fn GetSupportedEvents( + ppEvents: *mut *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, + fn GetEventOptions( + Event: REFGUID, + ppOptions: *mut *mut IPortableDeviceValues, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa8792a31, 0xf385, 0x493c, 0xa8, 0x93, 0x40, 0xf6, 0x4e, 0xb4, 0x5f, 0x6e)] +interface IPortableDeviceEventCallback(IPortableDeviceEventCallbackVtbl): IUnknown(IUnknownVtbl) { + fn OnEvent( + pEventParameters: *mut IPortableDeviceValues, + ) -> HRESULT, +}} +DEFINE_GUID!{LIBID_PortableDeviceApiLib, + 0x1f001332, 0x1a57, 0x4934, 0xbe, 0x31, 0xaf, 0xfc, 0x99, 0xf4, 0xee, 0x0a} +DEFINE_GUID!{CLSID_PortableDevice, + 0x728a21c5, 0x3d9e, 0x48d7, 0x98, 0x10, 0x86, 0x48, 0x48, 0xf0, 0xf4, 0x04} +RIDL!{#[uuid(0x728a21c5, 0x3d9e, 0x48d7, 0x98, 0x10, 0x86, 0x48, 0x48, 0xf0, 0xf4, 0x04)] +class PortableDevice;} +DEFINE_GUID!{CLSID_PortableDeviceManager, + 0x0af10cec, 0x2ecd, 0x4b92, 0x95, 0x81, 0x34, 0xf6, 0xae, 0x06, 0x37, 0xf3} +RIDL!{#[uuid(0x0af10cec, 0x2ecd, 0x4b92, 0x95, 0x81, 0x34, 0xf6, 0xae, 0x06, 0x37, 0xf3)] +class PortableDeviceManager;} +DEFINE_GUID!{CLSID_PortableDeviceService, + 0xef5db4c2, 0x9312, 0x422c, 0x91, 0x52, 0x41, 0x1c, 0xd9, 0xc4, 0xdd, 0x84} +RIDL!{#[uuid(0xef5db4c2, 0x9312, 0x422c, 0x91, 0x52, 0x41, 0x1c, 0xd9, 0xc4, 0xdd, 0x84)] +class PortableDeviceService;} +DEFINE_GUID!{CLSID_PortableDeviceDispatchFactory, + 0x43232233, 0x8338, 0x4658, 0xae, 0x01, 0x0b, 0x4a, 0xe8, 0x30, 0xb6, 0xb0} +RIDL!{#[uuid(0x43232233, 0x8338, 0x4658, 0xae, 0x01, 0x0b, 0x4a, 0xe8, 0x30, 0xb6, 0xb0)] +class PortableDeviceDispatchFactory;} +DEFINE_GUID!{CLSID_PortableDeviceFTM, + 0xf7c0039a, 0x4762, 0x488a, 0xb4, 0xb3, 0x76, 0x0e, 0xf9, 0xa1, 0xba, 0x9b} +RIDL!{#[uuid(0xf7c0039a, 0x4762, 0x488a, 0xb4, 0xb3, 0x76, 0x0e, 0xf9, 0xa1, 0xba, 0x9b)] +class PortableDeviceFTM;} +DEFINE_GUID!{CLSID_PortableDeviceServiceFTM, + 0x1649b154, 0xc794, 0x497a, 0x9b, 0x03, 0xf3, 0xf0, 0x12, 0x13, 0x02, 0xf3} +RIDL!{#[uuid(0x1649b154, 0xc794, 0x497a, 0x9b, 0x03, 0xf3, 0xf0, 0x12, 0x13, 0x02, 0xf3)] +class PortableDeviceServiceFTM;} +DEFINE_GUID!{CLSID_PortableDeviceWebControl, + 0x186dd02c, 0x2dec, 0x41b5, 0xa7, 0xd4, 0xb5, 0x90, 0x56, 0xfa, 0xde, 0x51} +RIDL!{#[uuid(0x186dd02c, 0x2dec, 0x41b5, 0xa7, 0xd4, 0xb5, 0x90, 0x56, 0xfa, 0xde, 0x51)] +class PortableDeviceWebControl;} diff --git a/bash-5.1/vendor/winapi/src/um/portabledevicetypes.rs b/bash-5.1/vendor/winapi/src/um/portabledevicetypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..f6c13d3eca73c6b3c40ad4577bf7f253d4f90dfe --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/portabledevicetypes.rs @@ -0,0 +1,255 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of PortableDeviceTypes.h +use shared::guiddef::{GUID, REFGUID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT, ULONG}; +use shared::wtypes::{PROPERTYKEY, VARTYPE}; +use um::propidl::PROPVARIANT; +use um::propkeydef::REFPROPERTYKEY; +use um::propsys::IPropertyStore; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LONG, LONGLONG, LPCWSTR, LPWSTR, ULONGLONG}; +//330 +RIDL!{#[uuid(0x6848f6f2, 0x3155, 0x4f86, 0xb6, 0xf5, 0x26, 0x3e, 0xee, 0xab, 0x31, 0x43)] +interface IPortableDeviceValues(IPortableDeviceValuesVtbl): IUnknown(IUnknownVtbl) { + fn GetCount( + pcelt: *mut DWORD, + ) -> HRESULT, + fn GetAt( + index: DWORD, + pKey: *mut PROPERTYKEY, + pValue: *mut PROPVARIANT, + ) -> HRESULT, + fn SetValue( + key: REFPROPERTYKEY, + pValue: *const PROPVARIANT, + ) -> HRESULT, + fn GetValue( + key: REFPROPERTYKEY, + pValue: *mut PROPVARIANT, + ) -> HRESULT, + fn SetStringValue( + key: REFPROPERTYKEY, + Value: LPCWSTR, + ) -> HRESULT, + fn GetStringValue( + key: REFPROPERTYKEY, + pValue: *mut LPWSTR, + ) -> HRESULT, + fn SetUnsignedIntegerValue( + key: REFPROPERTYKEY, + Value: ULONG, + ) -> HRESULT, + fn GetUnsignedIntegerValue( + key: REFPROPERTYKEY, + pValue: *mut ULONG, + ) -> HRESULT, + fn SetSignedIntegerValue( + key: REFPROPERTYKEY, + Value: LONG, + ) -> HRESULT, + fn GetSignedIntegerValue( + key: REFPROPERTYKEY, + pValue: *mut LONG, + ) -> HRESULT, + fn SetUnsignedLargeIntegerValue( + key: REFPROPERTYKEY, + Value: ULONGLONG, + ) -> HRESULT, + fn GetUnsignedLargeIntegerValue( + key: REFPROPERTYKEY, + pValue: *mut ULONGLONG, + ) -> HRESULT, + fn SetSignedLargeIntegerValue( + key: REFPROPERTYKEY, + Value: LONGLONG, + ) -> HRESULT, + fn GetSignedLargeIntegerValue( + key: REFPROPERTYKEY, + pValue: *mut LONGLONG, + ) -> HRESULT, + fn SetFloatValue( + key: REFPROPERTYKEY, + Value: FLOAT, + ) -> HRESULT, + fn GetFloatValue( + key: REFPROPERTYKEY, + pValue: *mut FLOAT, + ) -> HRESULT, + fn SetErrorValue( + key: REFPROPERTYKEY, + Value: HRESULT, + ) -> HRESULT, + fn GetErrorValue( + key: REFPROPERTYKEY, + pValue: *mut HRESULT, + ) -> HRESULT, + fn SetKeyValue( + key: REFPROPERTYKEY, + Value: REFPROPERTYKEY, + ) -> HRESULT, + fn GetKeyValue( + key: REFPROPERTYKEY, + pValue: *mut PROPERTYKEY, + ) -> HRESULT, + fn SetBoolValue( + key: REFPROPERTYKEY, + Value: BOOL, + ) -> HRESULT, + fn GetBoolValue( + key: REFPROPERTYKEY, + pValue: *mut BOOL, + ) -> HRESULT, + fn SetIUnknownValue( + key: REFPROPERTYKEY, + pValue: *mut IUnknown, + ) -> HRESULT, + fn GetIUnknownValue( + key: REFPROPERTYKEY, + ppValue: *mut *mut IUnknown, + ) -> HRESULT, + fn SetGuidValue( + key: REFPROPERTYKEY, + Value: REFGUID, + ) -> HRESULT, + fn GetGuidValue( + key: REFPROPERTYKEY, + pValue: *mut GUID, + ) -> HRESULT, + fn SetBufferValue( + key: REFPROPERTYKEY, + pValue: *mut BYTE, + cbValue: DWORD, + ) -> HRESULT, + fn GetBufferValue( + key: REFPROPERTYKEY, + ppValue: *mut *mut BYTE, + pcbValue: *mut DWORD, + ) -> HRESULT, + fn SetIPortableDeviceValuesValue( + key: REFPROPERTYKEY, + pValue: *mut IPortableDeviceValues, + ) -> HRESULT, + fn GetIPortableDeviceValuesValue( + key: REFPROPERTYKEY, + ppValue: *mut *mut IPortableDeviceValues, + ) -> HRESULT, + fn SetIPortableDevicePropVariantCollectionValue( + key: REFPROPERTYKEY, + pValue: *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, + fn GetIPortableDevicePropVariantCollectionValue( + key: REFPROPERTYKEY, + ppValue: *mut *mut IPortableDevicePropVariantCollection, + ) -> HRESULT, + fn SetIPortableDeviceKeyCollectionValue( + key: REFPROPERTYKEY, + pValue: *mut IPortableDeviceKeyCollection, + ) -> HRESULT, + fn GetIPortableDeviceKeyCollectionValue( + key: REFPROPERTYKEY, + ppValue: *mut *mut IPortableDeviceKeyCollection, + ) -> HRESULT, + fn SetIPortableDeviceValuesCollectionValue( + key: REFPROPERTYKEY, + pValue: *mut IPortableDeviceValuesCollection, + ) -> HRESULT, + fn GetIPortableDeviceValuesCollectionValue( + key: REFPROPERTYKEY, + ppValue: *mut *mut IPortableDeviceValuesCollection, + ) -> HRESULT, + fn RemoveValue( + key: REFPROPERTYKEY, + ) -> HRESULT, + fn CopyValuesFromPropertyStore( + pStore: *mut IPropertyStore, + ) -> HRESULT, + fn CopyValuesToPropertyStore( + pStore: *mut IPropertyStore, + ) -> HRESULT, + fn Clear() -> HRESULT, +}} +RIDL!{#[uuid(0xdada2357, 0xe0ad, 0x492e, 0x98, 0xdb, 0xdd, 0x61, 0xc5, 0x3b, 0xa3, 0x53)] +interface IPortableDeviceKeyCollection(IPortableDeviceKeyCollectionVtbl): IUnknown(IUnknownVtbl) { + fn GetCount( + pcElems: *mut DWORD, + ) -> HRESULT, + fn GetAt( + dwIndex: DWORD, + pKey: *mut PROPERTYKEY, + ) -> HRESULT, + fn Add( + Key: REFPROPERTYKEY, + ) -> HRESULT, + fn Clear() -> HRESULT, + fn RemoveAt( + dwIndex: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x89b2e422, 0x4f1b, 0x4316, 0xbc, 0xef, 0xa4, 0x4a, 0xfe, 0xa8, 0x3e, 0xb3)] +interface IPortableDevicePropVariantCollection(IPortableDevicePropVariantCollectionVtbl): + IUnknown(IUnknownVtbl) { + fn GetCount( + pcElems: *mut DWORD, + ) -> HRESULT, + fn GetAt( + dwIndex: DWORD, + pValue: *mut PROPVARIANT, + ) -> HRESULT, + fn Add( + pValue: *const PROPVARIANT, + ) -> HRESULT, + fn GetType( + pvt: *mut VARTYPE, + ) -> HRESULT, + fn ChangeType( + vt: VARTYPE, + ) -> HRESULT, + fn Clear() -> HRESULT, + fn RemoveAt( + dwIndex: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6e3f2d79, 0x4e07, 0x48c4, 0x82, 0x08, 0xd8, 0xc2, 0xe5, 0xaf, 0x4a, 0x99)] +interface IPortableDeviceValuesCollection(IPortableDeviceValuesCollectionVtbl): + IUnknown(IUnknownVtbl) { + fn GetCount( + pcElems: *mut DWORD, + ) -> HRESULT, + fn GetAt( + dwIndex: DWORD, + ppValues: *mut *mut IPortableDeviceValues, + ) -> HRESULT, + fn Add( + pValues: *mut IPortableDeviceValues, + ) -> HRESULT, + fn Clear() -> HRESULT, + fn RemoveAt( + dwIndex: DWORD, + ) -> HRESULT, +}} +DEFINE_GUID!{LIBID_PortableDeviceTypesLib, + 0x2B00BA2F, 0xE750, 0x4beb, 0x92, 0x35, 0x97, 0x14, 0x2E, 0xDE, 0x1D, 0x3E} +DEFINE_GUID!{CLSID_WpdSerializer, + 0x0b91a74b, 0xad7c, 0x4a9d, 0xb5, 0x63, 0x29, 0xee, 0xf9, 0x16, 0x71, 0x72} +RIDL!{#[uuid(0x0b91a74b, 0xad7c, 0x4a9d, 0xb5, 0x63, 0x29, 0xee, 0xf9, 0x16, 0x71, 0x72)] +class WpdSerializer;} +DEFINE_GUID!{CLSID_PortableDeviceValues, + 0x0c15d503, 0xd017, 0x47ce, 0x90, 0x16, 0x7b, 0x3f, 0x97, 0x87, 0x21, 0xcc} +RIDL!{#[uuid(0x0c15d503, 0xd017, 0x47ce, 0x90, 0x16, 0x7b, 0x3f, 0x97, 0x87, 0x21, 0xcc)] +class PortableDeviceValues;} +DEFINE_GUID!{CLSID_PortableDeviceKeyCollection, + 0xde2d022d, 0x2480, 0x43be, 0x97, 0xf0, 0xd1, 0xfa, 0x2c, 0xf9, 0x8f, 0x4f} +RIDL!{#[uuid(0xde2d022d, 0x2480, 0x43be, 0x97, 0xf0, 0xd1, 0xfa, 0x2c, 0xf9, 0x8f, 0x4f)] +class PortableDeviceKeyCollection;} +DEFINE_GUID!{CLSID_PortableDevicePropVariantCollection, + 0x08a99e2f, 0x6d6d, 0x4b80, 0xaf, 0x5a, 0xba, 0xf2, 0xbc, 0xbe, 0x4c, 0xb9} +RIDL!{#[uuid(0x08a99e2f, 0x6d6d, 0x4b80, 0xaf, 0x5a, 0xba, 0xf2, 0xbc, 0xbe, 0x4c, 0xb9)] +class PortableDevicePropVariantCollection;} +DEFINE_GUID!{CLSID_PortableDeviceValuesCollection, + 0x3882134d, 0x14cf, 0x4220, 0x9c, 0xb4, 0x43, 0x5f, 0x86, 0xd8, 0x3f, 0x60} +RIDL!{#[uuid(0x3882134d, 0x14cf, 0x4220, 0x9c, 0xb4, 0x43, 0x5f, 0x86, 0xd8, 0x3f, 0x60)] +class PortableDeviceValuesCollection;} diff --git a/bash-5.1/vendor/winapi/src/um/powerbase.rs b/bash-5.1/vendor/winapi/src/um/powerbase.rs new file mode 100644 index 0000000000000000000000000000000000000000..f856fddf87b2c70bb8b63bf1fcb006cba84b4a2d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/powerbase.rs @@ -0,0 +1,35 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{DWORD, ULONG}; +use um::winnt::{ + BOOLEAN, HANDLE, LONG, POWER_INFORMATION_LEVEL, POWER_PLATFORM_ROLE, + PSYSTEM_POWER_CAPABILITIES, PVOID, +}; +use um::winuser::{HPOWERNOTIFY, PHPOWERNOTIFY}; +pub type NTSTATUS = LONG; +extern "system" { + pub fn CallNtPowerInformation( + InformationLevel: POWER_INFORMATION_LEVEL, + InputBuffer: PVOID, + InputBufferLength: ULONG, + OutputBuffer: PVOID, + OutputBufferLength: ULONG, + ) -> NTSTATUS; + pub fn GetPwrCapabilities( + lpspc: PSYSTEM_POWER_CAPABILITIES, + ) -> BOOLEAN; + pub fn PowerDeterminePlatformRoleEx( + Version: ULONG, + ) -> POWER_PLATFORM_ROLE; + pub fn PowerRegisterSuspendResumeNotification( + Flags: DWORD, + Recipient: HANDLE, + RegistrationHandle: PHPOWERNOTIFY, + ) -> DWORD; + pub fn PowerUnregisterSuspendResumeNotification( + RegistrationHandle: HPOWERNOTIFY, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/powersetting.rs b/bash-5.1/vendor/winapi/src/um/powersetting.rs new file mode 100644 index 0000000000000000000000000000000000000000..88b0c6fa644966cb0881b922dbc8efcefa6f4f78 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/powersetting.rs @@ -0,0 +1,60 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::{GUID, LPCGUID}; +use shared::minwindef::{DWORD, HKEY, LPBYTE, LPDWORD, PUCHAR, PULONG}; +use um::winnt::HANDLE; +use um::winuser::{HPOWERNOTIFY, PHPOWERNOTIFY}; +extern "system" { + pub fn PowerReadACValue( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Type: PULONG, + Buffer: LPBYTE, + BufferSize: LPDWORD, + ) -> DWORD; + pub fn PowerReadDCValue( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Type: PULONG, + Buffer: PUCHAR, + BufferSize: LPDWORD, + ) -> DWORD; + pub fn PowerWriteACValueIndex( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + AcValueIndex: DWORD, + ) -> DWORD; + pub fn PowerWriteDCValueIndex( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + DcValueIndex: DWORD, + ) -> DWORD; + pub fn PowerGetActiveScheme( + UserRootPowerKey: HKEY, + ActivePolicyGuid: *mut *mut GUID, + ) -> DWORD; + pub fn PowerSetActiveScheme( + UserRootPowerKey: HKEY, + SchemeGuid: *const GUID, + ) -> DWORD; + pub fn PowerSettingRegisterNotification( + SettingGuid: LPCGUID, + Flags: DWORD, + Recipient: HANDLE, + RegistrationHandle: PHPOWERNOTIFY, + ) -> DWORD; + pub fn PowerSettingUnregisterNotification( + RegistrationHandle: HPOWERNOTIFY, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/powrprof.rs b/bash-5.1/vendor/winapi/src/um/powrprof.rs new file mode 100644 index 0000000000000000000000000000000000000000..d2d365f877bad51bb1dfb76ca334163fd0e872bc --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/powrprof.rs @@ -0,0 +1,550 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Interface for powrprof.dll, the power policy applicator +use shared::guiddef::GUID; +use shared::minwindef::{ + BOOL, DWORD, HKEY, LPARAM, LPDWORD, PBYTE, PUCHAR, PUINT, PULONG, UCHAR, UINT, ULONG, +}; +use um::winnt::{ + BOOLEAN, LPCWSTR, LPWSTR, NUM_DISCHARGE_POLICIES, PADMINISTRATOR_POWER_POLICY, + POWER_ACTION_POLICY, POWER_PLATFORM_ROLE, PROCESSOR_POWER_POLICY, PVOID, SYSTEM_POWER_LEVEL, + SYSTEM_POWER_STATE, +}; +use um::winreg::REGSAM; +STRUCT!{struct GLOBAL_MACHINE_POWER_POLICY { + Revision: ULONG, + LidOpenWakeAc: SYSTEM_POWER_STATE, + LidOpenWakeDc: SYSTEM_POWER_STATE, + BroadcastCapacityResolution: ULONG, +}} +pub type PGLOBAL_MACHINE_POWER_POLICY = *mut GLOBAL_MACHINE_POWER_POLICY; +STRUCT!{struct GLOBAL_USER_POWER_POLICY { + Revision: ULONG, + PowerButtonAc: POWER_ACTION_POLICY, + PowerButtonDc: POWER_ACTION_POLICY, + SleepButtonAc: POWER_ACTION_POLICY, + SleepButtonDc: POWER_ACTION_POLICY, + LidCloseAc: POWER_ACTION_POLICY, + LidCloseDc: POWER_ACTION_POLICY, + DischargePolicy: [SYSTEM_POWER_LEVEL; NUM_DISCHARGE_POLICIES], + GlobalFlags: ULONG, +}} +pub type PGLOBAL_USER_POWER_POLICY = *mut GLOBAL_USER_POWER_POLICY; +STRUCT!{struct GLOBAL_POWER_POLICY { + user: GLOBAL_USER_POWER_POLICY, + mach: GLOBAL_MACHINE_POWER_POLICY, +}} +pub type PGLOBAL_POWER_POLICY = *mut GLOBAL_POWER_POLICY; +STRUCT!{struct MACHINE_POWER_POLICY { + Revision: ULONG, + MinSleepAc: SYSTEM_POWER_STATE, + MinSleepDc: SYSTEM_POWER_STATE, + ReducedLatencySleepAc: SYSTEM_POWER_STATE, + ReducedLatencySleepDc: SYSTEM_POWER_STATE, + DozeTimeoutAc: ULONG, + DozeTimeoutDc: ULONG, + DozeS4TimeoutAc: ULONG, + DozeS4TimeoutDc: ULONG, + MinThrottleAc: UCHAR, + MinThrottleDc: UCHAR, + pad1: [UCHAR; 2], + OverThrottledAc: POWER_ACTION_POLICY, + OverThrottledDc: POWER_ACTION_POLICY, +}} +pub type PMACHINE_POWER_POLICY = *mut MACHINE_POWER_POLICY; +STRUCT!{struct MACHINE_PROCESSOR_POWER_POLICY { + Revision: ULONG, + ProcessorPolicyAc: PROCESSOR_POWER_POLICY, + ProcessorPolicyDc: PROCESSOR_POWER_POLICY, +}} +pub type PMACHINE_PROCESSOR_POWER_POLICY = *mut MACHINE_PROCESSOR_POWER_POLICY; +STRUCT!{struct USER_POWER_POLICY { + Revision: ULONG, + IdleAc: POWER_ACTION_POLICY, + IdleDc: POWER_ACTION_POLICY, + IdleTimeoutAc: ULONG, + IdleTimeoutDc: ULONG, + IdleSensitivityAc: UCHAR, + IdleSensitivityDc: UCHAR, + ThrottlePolicyAc: UCHAR, + ThrottlePolicyDc: UCHAR, + MaxSleepAc: SYSTEM_POWER_STATE, + MaxSleepDc: SYSTEM_POWER_STATE, + Reserved: [ULONG; 2], + VideoTimeoutAc: ULONG, + VideoTimeoutDc: ULONG, + SpindownTimeoutAc: ULONG, + SpindownTimeoutDc: ULONG, + OptimizeForPowerAc: BOOLEAN, + OptimizeForPowerDc: BOOLEAN, + FanThrottleToleranceAc: UCHAR, + FanThrottleToleranceDc: UCHAR, + ForcedThrottleAc: UCHAR, + ForcedThrottleDc: UCHAR, +}} +pub type PUSER_POWER_POLICY = *mut USER_POWER_POLICY; +STRUCT!{struct POWER_POLICY { + user: USER_POWER_POLICY, + mach: MACHINE_POWER_POLICY, +}} +pub type PPOWER_POLICY = *mut POWER_POLICY; +pub const EnableSysTrayBatteryMeter: ULONG = 0x01; +pub const EnableMultiBatteryDisplay: ULONG = 0x02; +pub const EnablePasswordLogon: ULONG = 0x04; +pub const EnableWakeOnRing: ULONG = 0x08; +pub const EnableVideoDimDisplay: ULONG = 0x10; +pub const POWER_ATTRIBUTE_HIDE: ULONG = 0x00000001; +pub const POWER_ATTRIBUTE_SHOW_AOAC: ULONG = 0x00000002; +pub const NEWSCHEME: UINT = -1i32 as u32; +FN!{stdcall PWRSCHEMESENUMPROC_V1( + Index: UINT, + NameSize: DWORD, + Name: LPWSTR, + DescriptionSize: DWORD, + Description: LPWSTR, + Policy: PPOWER_POLICY, + Context: LPARAM, +) -> BOOLEAN} +FN!{stdcall PWRSCHEMESENUMPROC_V2( + Index: UINT, + NameSize: DWORD, + Name: LPWSTR, + DescriptionSize: DWORD, + Description: LPWSTR, + Policy: PPOWER_POLICY, + Context: LPARAM, +) -> BOOLEAN} +pub type PWRSCHEMESENUMPROC = *mut PWRSCHEMESENUMPROC_V2; +extern "system" { + pub fn GetPwrDiskSpindownRange( + puiMax: PUINT, + puiMin: PUINT, + ) -> BOOLEAN; + pub fn EnumPwrSchemes( + lpfn: PWRSCHEMESENUMPROC, + lParam: LPARAM, + ) -> BOOLEAN; + pub fn ReadGlobalPwrPolicy( + pGlobalPowerPolicy: PGLOBAL_POWER_POLICY, + ) -> BOOLEAN; + pub fn ReadPwrScheme( + uiID: UINT, + pPowerPolicy: PPOWER_POLICY, + ) -> BOOLEAN; + pub fn WritePwrScheme( + puiID: PUINT, + lpszSchemeName: LPCWSTR, + lpszDescription: LPCWSTR, + lpScheme: PPOWER_POLICY, + ) -> BOOLEAN; + pub fn WriteGlobalPwrPolicy( + pGlobalPowerPolicy: PGLOBAL_POWER_POLICY, + ) -> BOOLEAN; + pub fn DeletePwrScheme( + uiID: UINT, + ) -> BOOLEAN; + pub fn GetActivePwrScheme( + puiID: PUINT, + ) -> BOOLEAN; + pub fn SetActivePwrScheme( + uiID: UINT, + pGlobalPowerPolicy: PGLOBAL_POWER_POLICY, + pPowerPolicy: PPOWER_POLICY, + ) -> BOOLEAN; + pub fn IsPwrSuspendAllowed() -> BOOLEAN; + pub fn IsPwrHibernateAllowed() -> BOOLEAN; + pub fn IsPwrShutdownAllowed() -> BOOLEAN; + pub fn IsAdminOverrideActive( + papp: PADMINISTRATOR_POWER_POLICY, + ) -> BOOLEAN; + pub fn SetSuspendState( + bHibernate: BOOLEAN, + bForce: BOOLEAN, + bWakeupEventsDisabled: BOOLEAN, + ) -> BOOLEAN; + pub fn GetCurrentPowerPolicies( + pGlobalPowerPolicy: PGLOBAL_POWER_POLICY, + pPowerPolicy: PPOWER_POLICY, + ) -> BOOLEAN; + pub fn CanUserWritePwrScheme() -> BOOLEAN; + pub fn ReadProcessorPwrScheme( + uiID: UINT, + pMachineProcessorPowerPolicy: PMACHINE_PROCESSOR_POWER_POLICY, + ) -> BOOLEAN; + pub fn WriteProcessorPwrScheme( + uiID: UINT, + pMachineProcessorPowerPolicy: PMACHINE_PROCESSOR_POWER_POLICY, + ) -> BOOLEAN; + pub fn ValidatePowerPolicies( + pGlobalPowerPolicy: PGLOBAL_POWER_POLICY, + pPowerPolicy: PPOWER_POLICY, + ) -> BOOLEAN; +} +ENUM!{enum POWER_DATA_ACCESSOR { + ACCESS_AC_POWER_SETTING_INDEX = 0, + ACCESS_DC_POWER_SETTING_INDEX, + ACCESS_FRIENDLY_NAME, + ACCESS_DESCRIPTION, + ACCESS_POSSIBLE_POWER_SETTING, + ACCESS_POSSIBLE_POWER_SETTING_FRIENDLY_NAME, + ACCESS_POSSIBLE_POWER_SETTING_DESCRIPTION, + ACCESS_DEFAULT_AC_POWER_SETTING, + ACCESS_DEFAULT_DC_POWER_SETTING, + ACCESS_POSSIBLE_VALUE_MIN, + ACCESS_POSSIBLE_VALUE_MAX, + ACCESS_POSSIBLE_VALUE_INCREMENT, + ACCESS_POSSIBLE_VALUE_UNITS, + ACCESS_ICON_RESOURCE, + ACCESS_DEFAULT_SECURITY_DESCRIPTOR, + ACCESS_ATTRIBUTES, + ACCESS_SCHEME, + ACCESS_SUBGROUP, + ACCESS_INDIVIDUAL_SETTING, + ACCESS_ACTIVE_SCHEME, + ACCESS_CREATE_SCHEME, + ACCESS_AC_POWER_SETTING_MAX, + ACCESS_DC_POWER_SETTING_MAX, + ACCESS_AC_POWER_SETTING_MIN, + ACCESS_DC_POWER_SETTING_MIN, + ACCESS_PROFILE, + ACCESS_OVERLAY_SCHEME, + ACCESS_ACTIVE_OVERLAY_SCHEME, +}} +pub type PPOWER_DATA_ACCESSOR = *mut POWER_DATA_ACCESSOR; +pub const DEVICE_NOTIFY_CALLBACK: ULONG = 2; +FN!{stdcall DEVICE_NOTIFY_CALLBACK_ROUTINE( + Context: PVOID, + Type: ULONG, + Setting: PVOID, +) -> ULONG} +pub type PDEVICE_NOTIFY_CALLBACK_ROUTINE = *mut DEVICE_NOTIFY_CALLBACK_ROUTINE; +STRUCT!{struct DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS { + Callback: PDEVICE_NOTIFY_CALLBACK_ROUTINE, + Context: PVOID, +}} +pub type PDEVICE_NOTIFY_SUBSCRIBE_PARAMETERS = *mut DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS; +extern "system" { + pub fn PowerIsSettingRangeDefined( + SubKeyGuid: *const GUID, + SettingGuid: *const GUID, + ) -> BOOLEAN; + pub fn PowerSettingAccessCheckEx( + AccessFlags: POWER_DATA_ACCESSOR, + PowerGuid: *const GUID, + AccessType: REGSAM, + ) -> DWORD; + pub fn PowerSettingAccessCheck( + AccessFlags: POWER_DATA_ACCESSOR, + PowerGuid: *const GUID, + ) -> DWORD; + pub fn PowerReadACValueIndex( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + AcValueIndex: LPDWORD, + ) -> DWORD; + pub fn PowerReadDCValueIndex( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + DcValueIndex: LPDWORD, + ) -> DWORD; + pub fn PowerReadFriendlyName( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Buffer: PUCHAR, + BufferSize: LPDWORD, + ) -> DWORD; + pub fn PowerReadDescription( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Buffer: PUCHAR, + BufferSize: LPDWORD, + ) -> DWORD; + pub fn PowerReadPossibleValue( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Type: PULONG, + PossibleSettingIndex: ULONG, + Buffer: PUCHAR, + BufferSize: LPDWORD, + ) -> DWORD; + pub fn PowerReadPossibleFriendlyName( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + PossibleSettingIndex: ULONG, + Buffer: PUCHAR, + BufferSize: LPDWORD, + ) -> DWORD; + pub fn PowerReadPossibleDescription( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + PossibleSettingIndex: ULONG, + Buffer: PUCHAR, + BufferSize: LPDWORD, + ) -> DWORD; + pub fn PowerReadValueMin( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + ValueMinimum: LPDWORD, + ) -> DWORD; + pub fn PowerReadValueMax( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + ValueMaximum: LPDWORD, + ) -> DWORD; + pub fn PowerReadValueIncrement( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + ValueIncrement: LPDWORD, + ) -> DWORD; + pub fn PowerReadValueUnitsSpecifier( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Buffer: *mut UCHAR, + BufferSize: LPDWORD, + ) -> DWORD; + pub fn PowerReadACDefaultIndex( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + AcDefaultIndex: LPDWORD, + ) -> DWORD; + pub fn PowerReadDCDefaultIndex( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + DcDefaultIndex: LPDWORD, + ) -> DWORD; + pub fn PowerReadIconResourceSpecifier( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Buffer: PUCHAR, + BufferSize: LPDWORD, + ) -> DWORD; + pub fn PowerReadSettingAttributes( + SubGroupGuid: *const GUID, + PowerSettingGuid: *const GUID, + ) -> DWORD; + pub fn PowerWriteFriendlyName( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Buffer: *mut UCHAR, + BufferSize: DWORD, + ) -> DWORD; + pub fn PowerWriteDescription( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Buffer: *mut UCHAR, + BufferSize: DWORD, + ) -> DWORD; + pub fn PowerWritePossibleValue( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Type: ULONG, + PossibleSettingIndex: ULONG, + Buffer: *mut UCHAR, + BufferSize: DWORD, + ) -> DWORD; + pub fn PowerWritePossibleFriendlyName( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + PossibleSettingIndex: ULONG, + Buffer: *mut UCHAR, + BufferSize: DWORD, + ) -> DWORD; + pub fn PowerWritePossibleDescription( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + PossibleSettingIndex: ULONG, + Buffer: *mut UCHAR, + BufferSize: DWORD, + ) -> DWORD; + pub fn PowerWriteValueMin( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + ValueMinimum: DWORD, + ) -> DWORD; + pub fn PowerWriteValueMax( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + ValueMaximum: DWORD, + ) -> DWORD; + pub fn PowerWriteValueIncrement( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + ValueIncrement: DWORD, + ) -> DWORD; + pub fn PowerWriteValueUnitsSpecifier( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Buffer: *mut UCHAR, + BufferSize: DWORD, + ) -> DWORD; + pub fn PowerWriteACDefaultIndex( + RootSystemPowerKey: HKEY, + SchemePersonalityGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + DefaultAcIndex: DWORD, + ) -> DWORD; + pub fn PowerWriteDCDefaultIndex( + RootSystemPowerKey: HKEY, + SchemePersonalityGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + DefaultDcIndex: DWORD, + ) -> DWORD; + pub fn PowerWriteIconResourceSpecifier( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + Buffer: *mut UCHAR, + BufferSize: DWORD, + ) -> DWORD; + pub fn PowerWriteSettingAttributes( + SubGroupGuid: *const GUID, + PowerSettingGuid: *const GUID, + Attributes: DWORD, + ) -> DWORD; + pub fn PowerDuplicateScheme( + RootPowerKey: HKEY, + SourceSchemeGuid: *const GUID, + DestinationSchemeGuid: *mut *mut GUID, + ) -> DWORD; + pub fn PowerImportPowerScheme( + RootPowerKey: HKEY, + ImportFileNamePath: LPCWSTR, + DestinationSchemeGuid: *mut *mut GUID, + ) -> DWORD; + pub fn PowerDeleteScheme( + RootPowerKey: HKEY, + SchemeGuid: *mut GUID, + ) -> DWORD; + pub fn PowerRemovePowerSetting( + PowerSettingSubKeyGuid: *const GUID, + PowerSettingGuid: *const GUID, + ) -> DWORD; + pub fn PowerCreateSetting( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + ) -> DWORD; + pub fn PowerCreatePossibleSetting( + RootPowerKey: HKEY, + SubGroupOfPowerSettingsGuid: *const GUID, + PowerSettingGuid: *const GUID, + PossibleSettingIndex: ULONG, + ) -> DWORD; + pub fn PowerEnumerate( + RootPowerKey: HKEY, + SchemeGuid: *const GUID, + SubGroupOfPowerSettingsGuid: *const GUID, + AccessFlags: POWER_DATA_ACCESSOR, + Index: ULONG, + Buffer: *mut UCHAR, + BufferSize: *mut DWORD, + ) -> DWORD; + pub fn PowerOpenUserPowerKey( + phUserPowerKey: *mut HKEY, + Access: REGSAM, + OpenExisting: BOOL, + ) -> DWORD; + pub fn PowerOpenSystemPowerKey( + phSystemPowerKey: *mut HKEY, + Access: REGSAM, + OpenExisting: BOOL, + ) -> DWORD; + pub fn PowerCanRestoreIndividualDefaultPowerScheme( + SchemeGuid: *const GUID, + ) -> DWORD; + pub fn PowerRestoreIndividualDefaultPowerScheme( + SchemeGuid: *const GUID, + ) -> DWORD; + pub fn PowerRestoreDefaultPowerSchemes() -> DWORD; + pub fn PowerReplaceDefaultPowerSchemes() -> DWORD; + pub fn PowerDeterminePlatformRole() -> POWER_PLATFORM_ROLE; +} +pub const DEVICEPOWER_HARDWAREID: ULONG = 0x80000000; +pub const DEVICEPOWER_AND_OPERATION: ULONG = 0x40000000; +pub const DEVICEPOWER_FILTER_DEVICES_PRESENT: ULONG = 0x20000000; +pub const DEVICEPOWER_FILTER_HARDWARE: ULONG = 0x10000000; +pub const DEVICEPOWER_FILTER_WAKEENABLED: ULONG = 0x08000000; +pub const DEVICEPOWER_FILTER_WAKEPROGRAMMABLE: ULONG = 0x04000000; +pub const DEVICEPOWER_FILTER_ON_NAME: ULONG = 0x02000000; +pub const DEVICEPOWER_SET_WAKEENABLED: ULONG = 0x00000001; +pub const DEVICEPOWER_CLEAR_WAKEENABLED: ULONG = 0x00000002; +pub const PDCAP_S0_SUPPORTED: ULONG = 0x00010000; +pub const PDCAP_S1_SUPPORTED: ULONG = 0x00020000; +pub const PDCAP_S2_SUPPORTED: ULONG = 0x00040000; +pub const PDCAP_S3_SUPPORTED: ULONG = 0x00080000; +pub const PDCAP_WAKE_FROM_S0_SUPPORTED: ULONG = 0x00100000; +pub const PDCAP_WAKE_FROM_S1_SUPPORTED: ULONG = 0x00200000; +pub const PDCAP_WAKE_FROM_S2_SUPPORTED: ULONG = 0x00400000; +pub const PDCAP_WAKE_FROM_S3_SUPPORTED: ULONG = 0x00800000; +pub const PDCAP_S4_SUPPORTED: ULONG = 0x01000000; +pub const PDCAP_S5_SUPPORTED: ULONG = 0x02000000; +extern "system" { + pub fn DevicePowerEnumDevices( + QueryIndex: ULONG, + QueryInterpretationFlags: ULONG, + QueryFlags: ULONG, + pReturnBuffer: PBYTE, + pBufferSize: PULONG, + ) -> BOOLEAN; + pub fn DevicePowerSetDeviceState( + DeviceDescription: LPCWSTR, + SetFlags: ULONG, + SetData: PVOID, + ) -> DWORD; + pub fn DevicePowerOpen( + DebugMask: ULONG, + ) -> BOOLEAN; + pub fn DevicePowerClose() -> BOOLEAN; +} +STRUCT!{struct THERMAL_EVENT { + Version: ULONG, + Size: ULONG, + Type: ULONG, + Temperature: ULONG, + TripPointTemperature: ULONG, + Initiator: LPWSTR, +}} +pub type PTHERMAL_EVENT = *mut THERMAL_EVENT; +extern "system" { + pub fn PowerReportThermalEvent( + Event: PTHERMAL_EVENT, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/processenv.rs b/bash-5.1/vendor/winapi/src/um/processenv.rs new file mode 100644 index 0000000000000000000000000000000000000000..8ecb5e0e979e36c0cbc1b5969ffa68118c4df5ce --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/processenv.rs @@ -0,0 +1,98 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, DWORD}; +use um::winnt::{HANDLE, LPCH, LPCSTR, LPCWSTR, LPSTR, LPWCH, LPWSTR, PHANDLE}; +extern "system" { + pub fn GetEnvironmentStrings() -> LPCH; + pub fn GetEnvironmentStringsW() -> LPWCH; + pub fn SetEnvironmentStringsW( + NewEnvironment: LPWCH, + ) -> BOOL; + pub fn FreeEnvironmentStringsA( + penv: LPCH, + ) -> BOOL; + pub fn FreeEnvironmentStringsW( + penv: LPWCH, + ) -> BOOL; + pub fn GetStdHandle( + nStdHandle: DWORD, + ) -> HANDLE; + pub fn SetStdHandle( + nStdHandle: DWORD, + hHandle: HANDLE, + ) -> BOOL; + pub fn SetStdHandleEx( + nStdHandle: DWORD, + hHandle: HANDLE, + phPrevValue: PHANDLE, + ) -> BOOL; + pub fn GetCommandLineA() -> LPSTR; + pub fn GetCommandLineW() -> LPWSTR; + pub fn GetEnvironmentVariableA( + lpName: LPCSTR, + lpBuffer: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetEnvironmentVariableW( + lpName: LPCWSTR, + lpBuffer: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn SetEnvironmentVariableA( + lpName: LPCSTR, + lpValue: LPCSTR, + ) -> BOOL; + pub fn SetEnvironmentVariableW( + lpName: LPCWSTR, + lpValue: LPCWSTR, + ) -> BOOL; + pub fn ExpandEnvironmentStringsA( + lpSrc: LPCSTR, + lpDst: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn ExpandEnvironmentStringsW( + lpSrc: LPCWSTR, + lpDst: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn SetCurrentDirectoryA( + lpPathName: LPCSTR, + ) -> BOOL; + pub fn SetCurrentDirectoryW( + lpPathName: LPCWSTR, + ) -> BOOL; + pub fn GetCurrentDirectoryA( + nBufferLength: DWORD, + lpBuffer: LPSTR, + ) -> DWORD; + pub fn GetCurrentDirectoryW( + nBufferLength: DWORD, + lpBuffer: LPWSTR, + ) -> DWORD; + pub fn SearchPathW( + lpPath: LPCWSTR, + lpFileName: LPCWSTR, + lpExtension: LPCWSTR, + nBufferLength: DWORD, + lpBuffer: LPWSTR, + lpFilePart: *mut LPWSTR, + ) -> DWORD; + pub fn SearchPathA( + lpPath: LPCSTR, + lpFileName: LPCSTR, + lpExtension: LPCSTR, + nBufferLength: DWORD, + lpBuffer: LPSTR, + lpFilePart: *mut LPSTR, + ) -> DWORD; + pub fn NeedCurrentDirectoryForExePathA( + ExeName: LPCSTR, + ) -> BOOL; + pub fn NeedCurrentDirectoryForExePathW( + ExeName: LPCWSTR, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/processsnapshot.rs b/bash-5.1/vendor/winapi/src/um/processsnapshot.rs new file mode 100644 index 0000000000000000000000000000000000000000..c49aac6a916307aff908d7a3bb2b30b52e96e9b7 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/processsnapshot.rs @@ -0,0 +1,120 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Defines the process snapshot API +use ctypes::c_void; +use shared::basetsd::ULONG_PTR; +use shared::minwindef::DWORD; +use um::winnt::HANDLE; +ENUM!{enum PSS_CAPTURE_FLAGS { + PSS_CAPTURE_NONE = 0x00000000, + PSS_CAPTURE_VA_CLONE = 0x00000001, + PSS_CAPTURE_RESERVED_00000002 = 0x00000002, + PSS_CAPTURE_HANDLES = 0x00000004, + PSS_CAPTURE_HANDLE_NAME_INFORMATION = 0x00000008, + PSS_CAPTURE_HANDLE_BASIC_INFORMATION = 0x00000010, + PSS_CAPTURE_HANDLE_TYPE_SPECIFIC_INFORMATION = 0x00000020, + PSS_CAPTURE_HANDLE_TRACE = 0x00000040, + PSS_CAPTURE_THREADS = 0x00000080, + PSS_CAPTURE_THREAD_CONTEXT = 0x00000100, + PSS_CAPTURE_THREAD_CONTEXT_EXTENDED = 0x00000200, + PSS_CAPTURE_RESERVED_00000400 = 0x00000400, + PSS_CAPTURE_VA_SPACE = 0x00000800, + PSS_CAPTURE_VA_SPACE_SECTION_INFORMATION = 0x00001000, + PSS_CREATE_BREAKAWAY_OPTIONAL = 0x04000000, + PSS_CREATE_BREAKAWAY = 0x08000000, + PSS_CREATE_FORCE_BREAKAWAY = 0x10000000, + PSS_CREATE_USE_VM_ALLOCATIONS = 0x20000000, + PSS_CREATE_MEASURE_PERFORMANCE = 0x40000000, + PSS_CREATE_RELEASE_SECTION = 0x80000000, +}} +ENUM!{enum PSS_QUERY_INFORMATION_CLASS { + PSS_QUERY_PROCESS_INFORMATION = 0, + PSS_QUERY_VA_CLONE_INFORMATION = 1, + PSS_QUERY_AUXILIARY_PAGES_INFORMATION = 2, + PSS_QUERY_VA_SPACE_INFORMATION = 3, + PSS_QUERY_HANDLE_INFORMATION = 4, + PSS_QUERY_THREAD_INFORMATION = 5, + PSS_QUERY_HANDLE_TRACE_INFORMATION = 6, + PSS_QUERY_PERFORMANCE_COUNTERS = 7, +}} +ENUM!{enum PSS_WALK_INFORMATION_CLASS { + PSS_WALK_AUXILIARY_PAGES = 0, + PSS_WALK_VA_SPACE = 1, + PSS_WALK_HANDLES = 2, + PSS_WALK_THREADS = 3, +}} +ENUM!{enum PSS_DUPLICATE_FLAGS { + PSS_DUPLICATE_NONE = 0x00, + PSS_DUPLICATE_CLOSE_SOURCE = 0x01, +}} +DECLARE_HANDLE!{HPSS, HPSS__} +DECLARE_HANDLE!{HPSSWALK, HPSSWALK__} +FN!{stdcall pAllocRoutine( + Context: *mut c_void, + Size: DWORD, +) -> *mut c_void} +FN!{stdcall pFreeRoutine( + Context: *mut c_void, + Address: *mut c_void, +) -> ()} +STRUCT!{struct PSS_ALLOCATOR { + Context: *mut c_void, + AllocRoutine: pAllocRoutine, + FreeRoutine: pFreeRoutine, +}} +extern "system" { + pub fn PssCaptureSnapshot( + ProcessHandle: HANDLE, + CaptureFlags: PSS_CAPTURE_FLAGS, + ThreadContextFlags: DWORD, + SnapshotHandle: *mut HPSS, + ) -> DWORD; + pub fn PssDuplicateSnapshot( + SourceProcessHandle: HANDLE, + SnapshotHandle: HPSS, + TargetProcessHandle: HANDLE, + TargetSnapshotHandle: *mut HPSS, + Flags: PSS_DUPLICATE_FLAGS, + ) -> DWORD; + pub fn PssFreeSnapshot( + ProcessHandle: HANDLE, + SnapshotHandle: HPSS, + ) -> DWORD; + pub fn PssQuerySnapshot( + SnapshotHandle: HPSS, + InformationClass: PSS_QUERY_INFORMATION_CLASS, + Buffer: *mut c_void, + BufferLength: DWORD, + ) -> DWORD; + pub fn PssWalkMarkerCreate( + Allocator: *const PSS_ALLOCATOR, + WalkMarkerHandle: *mut HPSSWALK, + ) -> DWORD; + pub fn PssWalkMarkerFree( + WalkMarkerHandle: HPSSWALK, + ) -> DWORD; + pub fn PssWalkMarkerGetPosition( + WalkMarkerHandle: HPSSWALK, + Position: *mut ULONG_PTR, + ) -> DWORD; + // pub fn PssWalkMarkerRewind(); + // pub fn PssWalkMarkerSeek(); + pub fn PssWalkMarkerSeekToBeginning( + WalkMarkerHandle: HPSS, + ) -> DWORD; + pub fn PssWalkMarkerSetPosition( + WalkMarkerHandle: HPSSWALK, + Position: ULONG_PTR, + ) -> DWORD; + // pub fn PssWalkMarkerTell(); + pub fn PssWalkSnapshot( + SnapshotHandle: HPSS, + InformationClass: PSS_WALK_INFORMATION_CLASS, + WalkMarkerHandle: HPSSWALK, + Buffer: *mut c_void, + BufferLength: DWORD, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/processthreadsapi.rs b/bash-5.1/vendor/winapi/src/um/processthreadsapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..9629ee865d122635f2ce9ae52238d5d1bbf73729 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/processthreadsapi.rs @@ -0,0 +1,441 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! ApiSet Contract for api-ms-win-core-processthreads-l1 +use ctypes::{c_int, c_void}; +use shared::basetsd::{DWORD_PTR, PSIZE_T, PULONG_PTR, SIZE_T, ULONG_PTR}; +use shared::guiddef::LPCGUID; +use shared::minwindef::{ + BOOL, DWORD, LPBYTE, LPCVOID, LPDWORD, LPFILETIME, LPVOID, PBOOL, PDWORD, PULONG, UINT, WORD +}; +use um::minwinbase::{LPCONTEXT, LPSECURITY_ATTRIBUTES, LPTHREAD_START_ROUTINE}; +use um::winnt::{ + CONTEXT, HANDLE, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PAPCFUNC, PHANDLE, PPROCESSOR_NUMBER, + PROCESS_MITIGATION_POLICY, PVOID +}; +STRUCT!{struct PROCESS_INFORMATION { + hProcess: HANDLE, + hThread: HANDLE, + dwProcessId: DWORD, + dwThreadId: DWORD, +}} +pub type PPROCESS_INFORMATION = *mut PROCESS_INFORMATION; +pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION; +STRUCT!{struct STARTUPINFOA { + cb: DWORD, + lpReserved: LPSTR, + lpDesktop: LPSTR, + lpTitle: LPSTR, + dwX: DWORD, + dwY: DWORD, + dwXSize: DWORD, + dwYSize: DWORD, + dwXCountChars: DWORD, + dwYCountChars: DWORD, + dwFillAttribute: DWORD, + dwFlags: DWORD, + wShowWindow: WORD, + cbReserved2: WORD, + lpReserved2: LPBYTE, + hStdInput: HANDLE, + hStdOutput: HANDLE, + hStdError: HANDLE, +}} +pub type LPSTARTUPINFOA = *mut STARTUPINFOA; +STRUCT!{struct STARTUPINFOW { + cb: DWORD, + lpReserved: LPWSTR, + lpDesktop: LPWSTR, + lpTitle: LPWSTR, + dwX: DWORD, + dwY: DWORD, + dwXSize: DWORD, + dwYSize: DWORD, + dwXCountChars: DWORD, + dwYCountChars: DWORD, + dwFillAttribute: DWORD, + dwFlags: DWORD, + wShowWindow: WORD, + cbReserved2: WORD, + lpReserved2: LPBYTE, + hStdInput: HANDLE, + hStdOutput: HANDLE, + hStdError: HANDLE, +}} +pub type LPSTARTUPINFOW = *mut STARTUPINFOW; +extern "system" { + pub fn QueueUserAPC( + pfnAPC: PAPCFUNC, + hThread: HANDLE, + dwData: ULONG_PTR, + ) -> DWORD; + pub fn GetProcessTimes( + hProcess: HANDLE, + lpCreationTime: LPFILETIME, + lpExitTime: LPFILETIME, + lpKernelTime: LPFILETIME, + lpUserTime: LPFILETIME, + ) -> BOOL; + pub fn GetCurrentProcess() -> HANDLE; + pub fn GetCurrentProcessId() -> DWORD; + pub fn ExitProcess( + uExitCode: UINT, + ); + pub fn TerminateProcess( + hProcess: HANDLE, + uExitCode: UINT, + ) -> BOOL; + pub fn GetExitCodeProcess( + hProcess: HANDLE, + lpExitCode: LPDWORD, + ) -> BOOL; + pub fn SwitchToThread() -> BOOL; + pub fn CreateThread( + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + dwStackSize: SIZE_T, + lpStartAddress: LPTHREAD_START_ROUTINE, + lpParameter: LPVOID, + dwCreationFlags: DWORD, + lpThreadId: LPDWORD, + ) -> HANDLE; + pub fn CreateRemoteThread( + hProcess: HANDLE, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + dwStackSize: SIZE_T, + lpStartAddress: LPTHREAD_START_ROUTINE, + lpParameter: LPVOID, + dwCreationFlags: DWORD, + lpThreadId: LPDWORD, + ) -> HANDLE; + pub fn GetCurrentThread() -> HANDLE; + pub fn GetCurrentThreadId() -> DWORD; + pub fn OpenThread( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + dwThreadId: DWORD, + ) -> HANDLE; + pub fn SetThreadPriority( + hThread: HANDLE, + nPriority: c_int, + ) -> BOOL; + pub fn SetThreadPriorityBoost( + hThread: HANDLE, + bDisablePriorityBoost: BOOL, + ) -> BOOL; + pub fn GetThreadPriorityBoost( + hThread: HANDLE, + pDisablePriorityBoost: PBOOL, + ) -> BOOL; + pub fn GetThreadPriority( + hThread: HANDLE, + ) -> c_int; + pub fn ExitThread( + dwExitCode: DWORD, + ); + pub fn TerminateThread( + hThread: HANDLE, + dwExitCode: DWORD, + ) -> BOOL; + pub fn GetExitCodeThread( + hThread: HANDLE, + lpExitCode: LPDWORD, + ) -> BOOL; + pub fn SuspendThread( + hThread: HANDLE, + ) -> DWORD; + pub fn ResumeThread( + hThread: HANDLE, + ) -> DWORD; +} +pub const TLS_OUT_OF_INDEXES: DWORD = 0xFFFFFFFF; +extern "system" { + pub fn TlsAlloc() -> DWORD; + pub fn TlsGetValue( + dwTlsIndex: DWORD, + ) -> LPVOID; + pub fn TlsSetValue( + dwTlsIndex: DWORD, + lpTlsValue: LPVOID, + ) -> BOOL; + pub fn TlsFree( + dwTlsIndex: DWORD, + ) -> BOOL; + pub fn CreateProcessA( + lpApplicationName: LPCSTR, + lpCommandLine: LPSTR, + lpProcessAttributes: LPSECURITY_ATTRIBUTES, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + bInheritHandles: BOOL, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCSTR, + lpStartupInfo: LPSTARTUPINFOA, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> BOOL; + pub fn CreateProcessW( + lpApplicationName: LPCWSTR, + lpCommandLine: LPWSTR, + lpProcessAttributes: LPSECURITY_ATTRIBUTES, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + bInheritHandles: BOOL, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCWSTR, + lpStartupInfo: LPSTARTUPINFOW, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> BOOL; + pub fn SetProcessShutdownParameters( + dwLevel: DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn GetProcessVersion( + ProcessId: DWORD, + ) -> DWORD; + pub fn GetStartupInfoW( + lpStartupInfo: LPSTARTUPINFOW, + ); + pub fn CreateProcessAsUserW( + hToken: HANDLE, + lpApplicationName: LPCWSTR, + lpCommandLine: LPWSTR, + lpProcessAttributes: LPSECURITY_ATTRIBUTES, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + bInheritHandles: BOOL, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCWSTR, + lpStartupInfo: LPSTARTUPINFOW, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> BOOL; + // pub fn GetCurrentProcessToken(); + // pub fn GetCurrentThreadToken(); + // pub fn GetCurrentThreadEffectiveToken(); + pub fn SetThreadToken( + Thread: PHANDLE, + Token: HANDLE, + ) -> BOOL; + pub fn OpenProcessToken( + ProcessHandle: HANDLE, + DesiredAccess: DWORD, + TokenHandle: PHANDLE, + ) -> BOOL; + pub fn OpenThreadToken( + ThreadHandle: HANDLE, + DesiredAccess: DWORD, + OpenAsSelf: BOOL, + TokenHandle: PHANDLE, + ) -> BOOL; + pub fn SetPriorityClass( + hProcess: HANDLE, + dwPriorityClass: DWORD, + ) -> BOOL; + pub fn SetThreadStackGuarantee( + StackSizeInBytes: PULONG, + ) -> BOOL; + pub fn GetPriorityClass( + hProcess: HANDLE, + ) -> DWORD; + pub fn ProcessIdToSessionId( + dwProcessId: DWORD, + pSessionId: *mut DWORD, + ) -> BOOL; + pub fn GetProcessId( + Process: HANDLE, + ) -> DWORD; +} +STRUCT!{struct PROC_THREAD_ATTRIBUTE_LIST { + dummy: *mut c_void, +}} +pub type PPROC_THREAD_ATTRIBUTE_LIST = *mut PROC_THREAD_ATTRIBUTE_LIST; +pub type LPPROC_THREAD_ATTRIBUTE_LIST = *mut PROC_THREAD_ATTRIBUTE_LIST; +extern "system" { + pub fn GetThreadId( + Thread: HANDLE, + ) -> DWORD; + pub fn FlushProcessWriteBuffers(); + pub fn GetProcessIdOfThread( + Thread: HANDLE, + ) -> DWORD; + pub fn InitializeProcThreadAttributeList( + lpAttributeList: LPPROC_THREAD_ATTRIBUTE_LIST, + dwAttributeCount: DWORD, + dwFlags: DWORD, + lpSize: PSIZE_T, + ) -> BOOL; + pub fn DeleteProcThreadAttributeList( + lpAttributeList: LPPROC_THREAD_ATTRIBUTE_LIST, + ); + pub fn SetProcessAffinityUpdateMode( + hProcess: HANDLE, + dwFlags: DWORD, + ) -> BOOL; + pub fn QueryProcessAffinityUpdateMode( + hProcess: HANDLE, + lpdwFlags: LPDWORD, + ) -> BOOL; + pub fn UpdateProcThreadAttribute( + lpAttributeList: LPPROC_THREAD_ATTRIBUTE_LIST, + dwFlags: DWORD, + Attribute: DWORD_PTR, + lpValue: PVOID, + cbSize: SIZE_T, + lpPreviousValue: PVOID, + lpReturnSize: PSIZE_T, + ) -> BOOL; + pub fn CreateRemoteThreadEx( + hProcess: HANDLE, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + dwStackSize: SIZE_T, + lpStartAddress: LPTHREAD_START_ROUTINE, + lpParameter: LPVOID, + dwCreationFlags: DWORD, + lpAttributeList: LPPROC_THREAD_ATTRIBUTE_LIST, + lpThreadId: LPDWORD, + ) -> HANDLE; + pub fn GetCurrentThreadStackLimits( + LowLimit: PULONG_PTR, + HighLimit: PULONG_PTR, + ); + pub fn GetThreadContext( + hThread: HANDLE, + lpContext: LPCONTEXT, + ) -> BOOL; + pub fn SetThreadContext( + hThread: HANDLE, + lpContext: *const CONTEXT, + ) -> BOOL; + pub fn SetProcessMitigationPolicy( + MitigationPolicy: PROCESS_MITIGATION_POLICY, + lpBuffer: PVOID, + dwLength: SIZE_T, + ) -> BOOL; + pub fn GetProcessMitigationPolicy( + hProcess: HANDLE, + MitigationPolicy: PROCESS_MITIGATION_POLICY, + lpBuffer: PVOID, + dwLength: SIZE_T, + ) -> BOOL; + pub fn FlushInstructionCache( + hProcess: HANDLE, + lpBaseAddress: LPCVOID, + dwSize: SIZE_T, + ) -> BOOL; + pub fn GetThreadTimes( + hThread: HANDLE, + lpCreationTime: LPFILETIME, + lpExitTime: LPFILETIME, + lpKernelTime: LPFILETIME, + lpUserTime: LPFILETIME, + ) -> BOOL; + pub fn OpenProcess( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + dwProcessId: DWORD, + ) -> HANDLE; + pub fn IsProcessorFeaturePresent( + ProcessorFeature: DWORD, + ) -> BOOL; + pub fn GetProcessHandleCount( + hProcess: HANDLE, + pdwHandleCount: PDWORD, + ) -> BOOL; + pub fn GetCurrentProcessorNumber() -> DWORD; + pub fn SetThreadIdealProcessorEx( + hThread: HANDLE, + lpIdealProcessor: PPROCESSOR_NUMBER, + lpPreviousIdealProcessor: PPROCESSOR_NUMBER, + ) -> BOOL; + pub fn GetThreadIdealProcessorEx( + hThread: HANDLE, + lpIdealProcessor: PPROCESSOR_NUMBER, + ) -> BOOL; + pub fn GetCurrentProcessorNumberEx( + ProcNumber: PPROCESSOR_NUMBER, + ); + pub fn GetProcessPriorityBoost( + hProcess: HANDLE, + pDisablePriorityBoost: PBOOL, + ) -> BOOL; + pub fn SetProcessPriorityBoost( + hProcess: HANDLE, + bDisablePriorityBoost: BOOL, + ) -> BOOL; + pub fn GetThreadIOPendingFlag( + hThread: HANDLE, + lpIOIsPending: PBOOL, + ) -> BOOL; + pub fn GetSystemTimes( + lpIdleTime: LPFILETIME, + lpKernelTime: LPFILETIME, + lpUserTime: LPFILETIME, + ) -> BOOL; +} +ENUM!{enum THREAD_INFORMATION_CLASS { + ThreadMemoryPriority, + ThreadAbsoluteCpuPriority, + ThreadInformationClassMax, +}} +// MEMORY_PRIORITY_INFORMATION +extern "system" { + pub fn GetThreadInformation( + hThread: HANDLE, + ThreadInformationClass: THREAD_INFORMATION_CLASS, + ThreadInformation: LPVOID, + ThreadInformationSize: DWORD, + ) -> BOOL; + pub fn SetThreadInformation( + hThread: HANDLE, + ThreadInformationClass: THREAD_INFORMATION_CLASS, + ThreadInformation: LPVOID, + ThreadInformationSize: DWORD, + ) -> BOOL; + pub fn IsProcessCritical( + hProcess: HANDLE, + Critical: PBOOL, + ) -> BOOL; + pub fn SetProtectedPolicy( + PolicyGuid: LPCGUID, + PolicyValue: ULONG_PTR, + OldPolicyValue: PULONG_PTR, + ) -> BOOL; + pub fn QueryProtectedPolicy( + PolicyGuid: LPCGUID, + PolicyValue: PULONG_PTR, + ) -> BOOL; + pub fn SetThreadIdealProcessor( + hThread: HANDLE, + dwIdealProcessor: DWORD, + ) -> DWORD; +} +ENUM!{enum PROCESS_INFORMATION_CLASS { + ProcessMemoryPriority, + ProcessInformationClassMax, +}} +extern "system" { + pub fn SetProcessInformation( + hProcess: HANDLE, + ProcessInformationClass: PROCESS_INFORMATION_CLASS, + ProcessInformation: LPVOID, + ProcessInformationSize: DWORD, + ) -> BOOL; + pub fn GetProcessInformation( + hProcess: HANDLE, + ProcessInformationClass: PROCESS_INFORMATION_CLASS, + ProcessInformation: LPVOID, + ProcessInformationSize: DWORD, + ) -> BOOL; + // pub fn GetSystemCpuSetInformation(); + // pub fn GetProcessDefaultCpuSets(); + // pub fn SetProcessDefaultCpuSets(); + // pub fn GetThreadSelectedCpuSets(); + // pub fn SetThreadSelectedCpuSets(); + // pub fn CreateProcessAsUserA(); + pub fn GetProcessShutdownParameters( + lpdwLevel: LPDWORD, + lpdwFlags: LPDWORD, + ) -> BOOL; + // pub fn SetThreadDescription(); + // pub fn GetThreadDescription(); +} diff --git a/bash-5.1/vendor/winapi/src/um/processtopologyapi.rs b/bash-5.1/vendor/winapi/src/um/processtopologyapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..694f0762a9a02ecdff606ef5b28ade7c4262a43f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/processtopologyapi.rs @@ -0,0 +1,23 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, PUSHORT}; +use um::winnt::{GROUP_AFFINITY, HANDLE, PGROUP_AFFINITY}; +extern "system" { + pub fn GetProcessGroupAffinity( + hProcess: HANDLE, + GroupCount: PUSHORT, + GroupArray: PUSHORT, + ) -> BOOL; + pub fn GetThreadGroupAffinity( + hThread: HANDLE, + GroupAffinity: PGROUP_AFFINITY, + ) -> BOOL; + pub fn SetThreadGroupAffinity( + hThread: HANDLE, + GroupAffinity: *const GROUP_AFFINITY, + PreviousGroupAffinity: PGROUP_AFFINITY, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/profileapi.rs b/bash-5.1/vendor/winapi/src/um/profileapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..908457592d09c63a4d74ce8ccfe78ecfd6578ad9 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/profileapi.rs @@ -0,0 +1,15 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::BOOL; +use um::winnt::LARGE_INTEGER; +extern "system" { + pub fn QueryPerformanceCounter( + lpPerformanceCount: *mut LARGE_INTEGER, + ) -> BOOL; + pub fn QueryPerformanceFrequency( + lpFrequency: *mut LARGE_INTEGER, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/propidl.rs b/bash-5.1/vendor/winapi/src/um/propidl.rs new file mode 100644 index 0000000000000000000000000000000000000000..fd25abb03289b91930f19f0830c0bfae3ff30421 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/propidl.rs @@ -0,0 +1,392 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::{CLSID, FMTID, GUID, REFCLSID, REFFMTID}; +use shared::minwindef::{ + BYTE, DWORD, FILETIME, FLOAT, HIBYTE, HIWORD, INT, LOBYTE, LOWORD, UINT, WORD +}; +use shared::ntdef::{ + BOOLEAN, CHAR, HRESULT, LARGE_INTEGER, LONG, LPSTR, LPWSTR, PVOID, SHORT, + UCHAR, ULARGE_INTEGER, ULONG, USHORT +}; +use shared::wtypes::{ + BSTR, BSTRBLOB, CLIPDATA, CY, DATE, DECIMAL, PROPID, VARIANT_BOOL, VARTYPE +}; +use shared::wtypesbase::{BLOB, DOUBLE, LPOLESTR, SCODE}; +use um::oaidl::{IDispatch, LPSAFEARRAY}; +use um::objidlbase::IStream; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +pub const PROPSETFLAG_DEFAULT: DWORD = 0; +pub const PROPSETFLAG_NONSIMPLE: DWORD = 1; +pub const PROPSETFLAG_ANSI: DWORD = 2; +pub const PROPSETFLAG_UNBUFFERED: DWORD = 4; +pub const PROPSET_BEHAVIOR_CASE_SENSITIVE: DWORD = 1; +STRUCT!{struct VERSIONEDSTREAM { + guidVersion: GUID, + pStream: *mut IStream, +}} +pub type LPVERSIONEDSTREAM = *mut VERSIONEDSTREAM; +macro_rules! TYPEDEF_CA { + ($type_:ty, $name:ident) => { STRUCT!{struct $name { + cElems: $crate::shared::ntdef::ULONG, + pElems: *mut $type_, + }}} +} +TYPEDEF_CA!(CHAR, CAC); +TYPEDEF_CA!(UCHAR, CAUB); +TYPEDEF_CA!(SHORT, CAI); +TYPEDEF_CA!(USHORT, CAUI); +TYPEDEF_CA!(LONG, CAL); +TYPEDEF_CA!(ULONG, CAUL); +TYPEDEF_CA!(FLOAT, CAFLT); +TYPEDEF_CA!(DOUBLE, CADBL); +TYPEDEF_CA!(CY, CACY); +TYPEDEF_CA!(DATE, CADATE); +TYPEDEF_CA!(BSTR, CABSTR); +TYPEDEF_CA!(BSTRBLOB, CABSTRBLOB); +TYPEDEF_CA!(VARIANT_BOOL, CABOOL); +TYPEDEF_CA!(SCODE, CASCODE); +TYPEDEF_CA!(PROPVARIANT, CAPROPVARIANT); +TYPEDEF_CA!(LARGE_INTEGER, CAH); +TYPEDEF_CA!(ULARGE_INTEGER, CAUH); +TYPEDEF_CA!(LPSTR, CALPSTR); +TYPEDEF_CA!(LPWSTR, CALPWSTR); +TYPEDEF_CA!(FILETIME, CAFILETIME); +TYPEDEF_CA!(CLIPDATA, CACLIPDATA); +TYPEDEF_CA!(CLSID, CACLSID); +UNION!{union PROPVARIANT_data { + [u64; 1] [u64; 2], + cVal cVal_mut: CHAR, + bVal bVal_mut: UCHAR, + iVal iVal_mut: SHORT, + uiVal uiVal_mut: USHORT, + lVal lVal_mut: LONG, + ulVal ulVal_mut: ULONG, + intVal intVal_mut: INT, + uintVal uintVal_mut: UINT, + hVal hVal_mut: LARGE_INTEGER, + uhVal uhVal_mut: ULARGE_INTEGER, + fltVal fltVal_mut: FLOAT, + dblVal dblVal_mut: DOUBLE, + boolVal boolVal_mut: VARIANT_BOOL, + scode scode_mut: SCODE, + cyVal cyVal_mut: CY, + date date_mut: DATE, + filetime filetime_mut: FILETIME, + puuid puuid_mut: *mut CLSID, + pclipdata pclipdata_mut: *mut CLIPDATA, + bstrVal bstrVal_mut: BSTR, + bstrblobVal bstrblobVal_mut: BSTRBLOB, + blob blob_mut: BLOB, + pszVal pszVal_mut: LPSTR, + pwszVal pwszVal_mut: LPWSTR, + punkVal punkVal_mut: *mut IUnknown, + pdispVal pdisp_mut: *mut IDispatch, + pStream pStream_mut: *mut IStream, + // pStorage pStorage_mut: *mut IStorage, + pVersionedStream pVersionedStream_mut: LPVERSIONEDSTREAM, + parray parray_mut: LPSAFEARRAY, + cac cac_mut: CAC, + caub caub_mut: CAUB, + cai cai_mut: CAI, + caui caui_mut: CAUI, + cal cal_mut: CAL, + caul caul_mut: CAUL, + cah cah_mut: CAH, + cauh cauh_mut: CAUH, + caflt caflt_mut: CAFLT, + cadbl cadbl_mut: CADBL, + cabool cabool_mut: CABOOL, + cascode cascode_mut: CASCODE, + cacy cacy_mut: CACY, + cadate cadate_mut: CADATE, + cafiletime cafiletime_mut: CAFILETIME, + cauuid cauuid_mut: CACLSID, + caclipdata caclipdata_mut: CACLIPDATA, + cabstr cabstr_mut: CABSTR, + cabstrblob cabstrblob_mut: CABSTRBLOB, + calpstr calpstr_mut: CALPSTR, + calpwstr calpwstr_mut: CALPWSTR, + capropvar capropvar_mut: CAPROPVARIANT, + pcVal pcVal_mut: *mut CHAR, + pbVal pbVal_mut: *mut UCHAR, + piVal piVal_mut: *mut SHORT, + puiVal puiVal_mut: *mut USHORT, + plVal plVal_mut: *mut LONG, + pulVal pulVal_mut: *mut ULONG, + pintVal pintVal_mut: *mut INT, + puintVal puintVal_mut: *mut UINT, + pfltVal pfltVal_mut: *mut FLOAT, + pdblVal pdblVal_mut: *mut DOUBLE, + pboolVal pboolVal_mut: *mut VARIANT_BOOL, + pdecVal pdecVal_mut: *mut DECIMAL, + pscode pscode_mut: *mut SCODE, + pcyVal pcyVal_mut: *mut CY, + pdate pdate_mut: *mut DATE, + ppunkVal ppunkVal_mut: *mut *mut IUnknown, + ppdispVal ppdispVal_mut: *mut *mut IDispatch, + ppStream ppStream_mut: *mut *mut IStream, + // ppStorage ppStorage_mut: *mut *mut IStorage, +}} +// This is actually defined as a union between this struct +// and DECIMAL. I don't this we need to do that. +STRUCT!{struct PROPVARIANT { + vt: VARTYPE, + wReserved1: WORD, + wReserved2: WORD, + wReserved3: WORD, + data: PROPVARIANT_data, +}} +pub type LPPROPVARIANT = *mut PROPVARIANT; +pub type REFPROPVARIANT = *const PROPVARIANT; +pub const PID_DICTIONARY: DWORD = 0; +pub const PID_CODEPAGE: DWORD = 0x1; +pub const PID_FIRST_USABLE: DWORD = 0x2; +pub const PID_FIRST_NAME_DEFAULT: DWORD = 0xfff; +pub const PID_LOCALE: DWORD = 0x80000000; +pub const PID_MODIFY_TIME: DWORD = 0x80000001; +pub const PID_SECURITY: DWORD = 0x80000002; +pub const PID_BEHAVIOR: DWORD = 0x80000003; +pub const PID_ILLEGAL: DWORD = 0xffffffff; +pub const PID_MIN_READONLY: DWORD = 0x80000000; +pub const PID_MAX_READONLY: DWORD = 0xbfffffff; +pub const PRSPEC_INVALID: ULONG = 0xffffffff; +pub const PRSPEC_LPWSTR: ULONG = 0; +pub const PRSPEC_PROPID: ULONG = 1; +UNION!{union PROPSPEC_u { + [u32; 1] [u64; 1], + propid propid_mut: PROPID, + lpwstr lpwstr_mut: LPOLESTR, +}} +STRUCT!{struct PROPSPEC { + ulKind: ULONG, + u: PROPSPEC_u, +}} +STRUCT!{struct STATPROPSTG { + lpwstrName: LPOLESTR, + propid: PROPID, + vt: VARTYPE, +}} +#[inline] +pub fn PROPSETHDR_OSVER_KIND(dwOSVer: DWORD) -> WORD { + HIWORD(dwOSVer) +} +#[inline] +pub fn PROPSETHDR_OSVER_MAJOR(dwOSVer: DWORD) -> BYTE { + LOBYTE(LOWORD(dwOSVer)) +} +#[inline] +pub fn PROPSETHDR_OSVER_MINOR(dwOSVer: DWORD) -> BYTE { + HIBYTE(LOWORD(dwOSVer)) +} +pub const PROPSETHDR_OSVERSION_UNKNOWN: DWORD = 0xFFFFFFFF; +STRUCT!{struct STATPROPSETSTG { + fmtid: FMTID, + clsid: CLSID, + grfFlags: DWORD, + mtime: FILETIME, + ctime: FILETIME, + atime: FILETIME, + dwOSVersion: DWORD, +}} +RIDL!{#[uuid(0x00000138, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IPropertyStorage(IPropertyStorageVtbl): IUnknown(IUnknownVtbl) { + fn ReadMultiple( + cpspec: ULONG, + rgpspec: *const PROPSPEC, + rgpropvar: *mut PROPVARIANT, + ) -> HRESULT, + fn WriteMultiple( + cpspec: ULONG, + rgpspec: *const PROPSPEC, + rgpropvar: *const PROPVARIANT, + ) -> HRESULT, + fn DeleteMultiple( + cpspec: ULONG, + rgpspec: *const PROPSPEC, + ) -> HRESULT, + fn ReadPropertyNames( + cppropid: ULONG, + rgpropid: *const PROPID, + rglpwstrName: *mut LPOLESTR, + ) -> HRESULT, + fn WritePropertyNames( + cppropid: ULONG, + rgpropid: *const PROPID, + rglpwstrName: *const LPOLESTR, + ) -> HRESULT, + fn DeletePropertyNames( + cppropid: ULONG, + rgpropid: *const PROPID, + ) -> HRESULT, + fn Commit( + grfCommitFlags: DWORD, + ) -> HRESULT, + fn Revert() -> HRESULT, + fn Enum( + ppenum: *mut *mut IEnumSTATPROPSTG, + ) -> HRESULT, + fn SetTimes( + pctime: *const FILETIME, + patime: *const FILETIME, + pmtime: *const FILETIME, + ) -> HRESULT, + fn SetClass( + clsid: REFCLSID, + ) -> HRESULT, + fn Stat( + pstatpsstg: *mut STATPROPSETSTG, + ) -> HRESULT, +}} +pub type LPPROPERTYSETSTORAGE = *mut IPropertySetStorage; +RIDL!{#[uuid(0x0000013A, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IPropertySetStorage(IPropertySetStorageVtbl): IUnknown(IUnknownVtbl) { + fn Create( + rfmtid: REFFMTID, + pclsid: *const CLSID, + grfFlags: DWORD, + grfMode: DWORD, + ppprstg: *mut *mut IPropertyStorage, + ) -> HRESULT, + fn Open( + rfmtid: REFFMTID, + grfMode: DWORD, + ppprstg: *mut *mut IPropertyStorage, + ) -> HRESULT, + fn Delete( + rfmtid: REFFMTID, + ) -> HRESULT, + fn Enum( + ppenum: *mut *mut IEnumSTATPROPSTG, + ) -> HRESULT, +}} +pub type LPENUMSTATPROPSTG = *mut IEnumSTATPROPSTG; +RIDL!{#[uuid(0x00000139, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IEnumSTATPROPSTG(IEnumSTATPROPSTGVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut STATPROPSTG, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Revert() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumSTATPROPSTG, + ) -> HRESULT, +}} +pub type LPENUMSTATPROPSETSTG = *mut IEnumSTATPROPSETSTG; +RIDL!{#[uuid(0x0000013B, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IEnumSTATPROPSETSTG(IEnumSTATPROPSETSTGVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut STATPROPSETSTG, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Revert() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumSTATPROPSETSTG, + ) -> HRESULT, +}} +pub type LPPROPERTYSTORAGE = *mut IPropertyStorage; +pub const PIDDI_THUMBNAIL: DWORD = 0x00000002; +pub const PIDSI_TITLE: DWORD = 0x00000002; +pub const PIDSI_SUBJECT: DWORD = 0x00000003; +pub const PIDSI_AUTHOR: DWORD = 0x00000004; +pub const PIDSI_KEYWORDS: DWORD = 0x00000005; +pub const PIDSI_COMMENTS: DWORD = 0x00000006; +pub const PIDSI_TEMPLATE: DWORD = 0x00000007; +pub const PIDSI_LASTAUTHOR: DWORD = 0x00000008; +pub const PIDSI_REVNUMBER: DWORD = 0x00000009; +pub const PIDSI_EDITTIME: DWORD = 0x0000000a; +pub const PIDSI_LASTPRINTED: DWORD = 0x0000000b; +pub const PIDSI_CREATE_DTM: DWORD = 0x0000000c; +pub const PIDSI_LASTSAVE_DTM: DWORD = 0x0000000d; +pub const PIDSI_PAGECOUNT: DWORD = 0x0000000e; +pub const PIDSI_WORDCOUNT: DWORD = 0x0000000f; +pub const PIDSI_CHARCOUNT: DWORD = 0x00000010; +pub const PIDSI_THUMBNAIL: DWORD = 0x00000011; +pub const PIDSI_APPNAME: DWORD = 0x00000012; +pub const PIDSI_DOC_SECURITY: DWORD = 0x00000013; +pub const PIDDSI_CATEGORY: DWORD = 0x00000002; +pub const PIDDSI_PRESFORMAT: DWORD = 0x00000003; +pub const PIDDSI_BYTECOUNT: DWORD = 0x00000004; +pub const PIDDSI_LINECOUNT: DWORD = 0x00000005; +pub const PIDDSI_PARCOUNT: DWORD = 0x00000006; +pub const PIDDSI_SLIDECOUNT: DWORD = 0x00000007; +pub const PIDDSI_NOTECOUNT: DWORD = 0x00000008; +pub const PIDDSI_HIDDENCOUNT: DWORD = 0x00000009; +pub const PIDDSI_MMCLIPCOUNT: DWORD = 0x0000000A; +pub const PIDDSI_SCALE: DWORD = 0x0000000B; +pub const PIDDSI_HEADINGPAIR: DWORD = 0x0000000C; +pub const PIDDSI_DOCPARTS: DWORD = 0x0000000D; +pub const PIDDSI_MANAGER: DWORD = 0x0000000E; +pub const PIDDSI_COMPANY: DWORD = 0x0000000F; +pub const PIDDSI_LINKSDIRTY: DWORD = 0x00000010; +pub const PIDMSI_EDITOR: DWORD = 0x00000002; +pub const PIDMSI_SUPPLIER: DWORD = 0x00000003; +pub const PIDMSI_SOURCE: DWORD = 0x00000004; +pub const PIDMSI_SEQUENCE_NO: DWORD = 0x00000005; +pub const PIDMSI_PROJECT: DWORD = 0x00000006; +pub const PIDMSI_STATUS: DWORD = 0x00000007; +pub const PIDMSI_OWNER: DWORD = 0x00000008; +pub const PIDMSI_RATING: DWORD = 0x00000009; +pub const PIDMSI_PRODUCTION: DWORD = 0x0000000A; +pub const PIDMSI_COPYRIGHT: DWORD = 0x0000000B; +ENUM!{enum PIDMSI_STATUS_VALUE { + PIDMSI_STATUS_NORMAL = 0, + PIDMSI_STATUS_NEW, + PIDMSI_STATUS_PRELIM, + PIDMSI_STATUS_DRAFT, + PIDMSI_STATUS_INPROGRESS, + PIDMSI_STATUS_EDIT, + PIDMSI_STATUS_REVIEW, + PIDMSI_STATUS_PROOF, + PIDMSI_STATUS_FINAL, + PIDMSI_STATUS_OTHER = 0x7fff, +}} +extern "system" { + pub fn PropVariantCopy( + pvarDest: *mut PROPVARIANT, + pvarSrc: *const PROPVARIANT, + ) -> HRESULT; + pub fn PropVariantClear( + pvar: *mut PROPVARIANT, + ) -> HRESULT; + pub fn FreePropVariantArray( + cVariants: ULONG, + rgvars: *mut PROPVARIANT, + ) -> HRESULT; +} +// #[inline] +// pub fn PropVariantInit(pvar: *mut PROPVARIANT) { +// memset(pvar, 0, sizeof(PROPVARIANT)) +// } +STRUCT!{struct SERIALIZEDPROPERTYVALUE { + dwType: DWORD, + rgb: *mut BYTE, +}} +pub type PMemoryAllocator = PVOID; +extern "system" { + pub fn StgConvertVariantToProperty( + pvar: *const PROPVARIANT, + CodePage: USHORT, + pprop: *mut SERIALIZEDPROPERTYVALUE, + pcb: *mut ULONG, + pid: PROPID, + fReserved: BOOLEAN, + pcIndirect: *mut ULONG, + ) -> *mut SERIALIZEDPROPERTYVALUE; + pub fn StgConvertPropertyToVariant( + pprop: *const SERIALIZEDPROPERTYVALUE, + CodePage: USHORT, + pvar: *mut PROPVARIANT, + pma: *mut PMemoryAllocator + ) -> BOOLEAN; +} diff --git a/bash-5.1/vendor/winapi/src/um/propkey.rs b/bash-5.1/vendor/winapi/src/um/propkey.rs new file mode 100644 index 0000000000000000000000000000000000000000..bfa7d095b6a469164058b01a65e3d8d5c5e5bae1 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/propkey.rs @@ -0,0 +1,2300 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::DWORD; +use shared::ntdef::{DOUBLE, LONG}; +use shared::wtypes::PROPERTYKEY; +DEFINE_PROPERTYKEY!{PKEY_Audio_ChannelCount, + 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 7} +pub const AUDIO_CHANNELCOUNT_MONO: DWORD = 1; +pub const AUDIO_CHANNELCOUNT_STEREO: DWORD = 2; +DEFINE_PROPERTYKEY!{PKEY_Audio_Compression, + 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 10} +DEFINE_PROPERTYKEY!{PKEY_Audio_EncodingBitrate, + 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 4} +DEFINE_PROPERTYKEY!{PKEY_Audio_Format, + 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 2} +DEFINE_PROPERTYKEY!{PKEY_Audio_IsVariableBitRate, + 0xE6822FEE, 0x8C17, 0x4D62, 0x82, 0x3C, 0x8E, 0x9C, 0xFC, 0xBD, 0x1D, 0x5C, 100} +DEFINE_PROPERTYKEY!{PKEY_Audio_PeakValue, + 0x2579E5D0, 0x1116, 0x4084, 0xBD, 0x9A, 0x9B, 0x4F, 0x7C, 0xB4, 0xDF, 0x5E, 100} +DEFINE_PROPERTYKEY!{PKEY_Audio_SampleRate, + 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 5} +DEFINE_PROPERTYKEY!{PKEY_Audio_SampleSize, + 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 6} +DEFINE_PROPERTYKEY!{PKEY_Audio_StreamName, + 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 9} +DEFINE_PROPERTYKEY!{PKEY_Audio_StreamNumber, + 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 8} +DEFINE_PROPERTYKEY!{PKEY_Calendar_Duration, + 0x293CA35A, 0x09AA, 0x4DD2, 0xB1, 0x80, 0x1F, 0xE2, 0x45, 0x72, 0x8A, 0x52, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_IsOnline, + 0xBFEE9149, 0xE3E2, 0x49A7, 0xA8, 0x62, 0xC0, 0x59, 0x88, 0x14, 0x5C, 0xEC, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_IsRecurring, + 0x315B9C8D, 0x80A9, 0x4EF9, 0xAE, 0x16, 0x8E, 0x74, 0x6D, 0xA5, 0x1D, 0x70, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_Location, + 0xF6272D18, 0xCECC, 0x40B1, 0xB2, 0x6A, 0x39, 0x11, 0x71, 0x7A, 0xA7, 0xBD, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_OptionalAttendeeAddresses, + 0xD55BAE5A, 0x3892, 0x417A, 0xA6, 0x49, 0xC6, 0xAC, 0x5A, 0xAA, 0xEA, 0xB3, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_OptionalAttendeeNames, + 0x09429607, 0x582D, 0x437F, 0x84, 0xC3, 0xDE, 0x93, 0xA2, 0xB2, 0x4C, 0x3C, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_OrganizerAddress, + 0x744C8242, 0x4DF5, 0x456C, 0xAB, 0x9E, 0x01, 0x4E, 0xFB, 0x90, 0x21, 0xE3, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_OrganizerName, + 0xAAA660F9, 0x9865, 0x458E, 0xB4, 0x84, 0x01, 0xBC, 0x7F, 0xE3, 0x97, 0x3E, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_ReminderTime, + 0x72FC5BA4, 0x24F9, 0x4011, 0x9F, 0x3F, 0xAD, 0xD2, 0x7A, 0xFA, 0xD8, 0x18, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_RequiredAttendeeAddresses, + 0x0BA7D6C3, 0x568D, 0x4159, 0xAB, 0x91, 0x78, 0x1A, 0x91, 0xFB, 0x71, 0xE5, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_RequiredAttendeeNames, + 0xB33AF30B, 0xF552, 0x4584, 0x93, 0x6C, 0xCB, 0x93, 0xE5, 0xCD, 0xA2, 0x9F, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_Resources, + 0x00F58A38, 0xC54B, 0x4C40, 0x86, 0x96, 0x97, 0x23, 0x59, 0x80, 0xEA, 0xE1, 100} +DEFINE_PROPERTYKEY!{PKEY_Calendar_ResponseStatus, + 0x188C1F91, 0x3C40, 0x4132, 0x9E, 0xC5, 0xD8, 0xB0, 0x3B, 0x72, 0xA8, 0xA2, 100} +pub const CALENDAR_RESPONSESTATUS_NONE: DWORD = 0; +pub const CALENDAR_RESPONSESTATUS_ORGANIZED: DWORD = 1; +pub const CALENDAR_RESPONSESTATUS_TENTATIVE: DWORD = 2; +pub const CALENDAR_RESPONSESTATUS_ACCEPTED: DWORD = 3; +pub const CALENDAR_RESPONSESTATUS_DECLINED: DWORD = 4; +pub const CALENDAR_RESPONSESTATUS_NOTRESPONDED: DWORD = 5; +DEFINE_PROPERTYKEY!{PKEY_Calendar_ShowTimeAs, + 0x5BF396D4, 0x5EB2, 0x466F, 0xBD, 0xE9, 0x2F, 0xB3, 0xF2, 0x36, 0x1D, 0x6E, 100} +pub const CALENDAR_SHOWTIMEAS_FREE: DWORD = 0; +pub const CALENDAR_SHOWTIMEAS_TENTATIVE: DWORD = 1; +pub const CALENDAR_SHOWTIMEAS_BUSY: DWORD = 2; +pub const CALENDAR_SHOWTIMEAS_OOF: DWORD = 3; +DEFINE_PROPERTYKEY!{PKEY_Calendar_ShowTimeAsText, + 0x53DA57CF, 0x62C0, 0x45C4, 0x81, 0xDE, 0x76, 0x10, 0xBC, 0xEF, 0xD7, 0xF5, 100} +DEFINE_PROPERTYKEY!{PKEY_Communication_AccountName, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 9} +DEFINE_PROPERTYKEY!{PKEY_Communication_DateItemExpires, + 0x428040AC, 0xA177, 0x4C8A, 0x97, 0x60, 0xF6, 0xF7, 0x61, 0x22, 0x7F, 0x9A, 100} +DEFINE_PROPERTYKEY!{PKEY_Communication_Direction, + 0x8E531030, 0xB960, 0x4346, 0xAE, 0x0D, 0x66, 0xBC, 0x9A, 0x86, 0xFB, 0x94, 100} +pub const COMMUNICATION_DIRECTION_UNKNOWN: DWORD = 0; +pub const COMMUNICATION_DIRECTION_INCOMING: DWORD = 1; +pub const COMMUNICATION_DIRECTION_OUTGOING: DWORD = 2; +DEFINE_PROPERTYKEY!{PKEY_Communication_FollowupIconIndex, + 0x83A6347E, 0x6FE4, 0x4F40, 0xBA, 0x9C, 0xC4, 0x86, 0x52, 0x40, 0xD1, 0xF4, 100} +DEFINE_PROPERTYKEY!{PKEY_Communication_HeaderItem, + 0xC9C34F84, 0x2241, 0x4401, 0xB6, 0x07, 0xBD, 0x20, 0xED, 0x75, 0xAE, 0x7F, 100} +DEFINE_PROPERTYKEY!{PKEY_Communication_PolicyTag, + 0xEC0B4191, 0xAB0B, 0x4C66, 0x90, 0xB6, 0xC6, 0x63, 0x7C, 0xDE, 0xBB, 0xAB, 100} +DEFINE_PROPERTYKEY!{PKEY_Communication_SecurityFlags, + 0x8619A4B6, 0x9F4D, 0x4429, 0x8C, 0x0F, 0xB9, 0x96, 0xCA, 0x59, 0xE3, 0x35, 100} +DEFINE_PROPERTYKEY!{PKEY_Communication_Suffix, + 0x807B653A, 0x9E91, 0x43EF, 0x8F, 0x97, 0x11, 0xCE, 0x04, 0xEE, 0x20, 0xC5, 100} +DEFINE_PROPERTYKEY!{PKEY_Communication_TaskStatus, + 0xBE1A72C6, 0x9A1D, 0x46B7, 0xAF, 0xE7, 0xAF, 0xAF, 0x8C, 0xEF, 0x49, 0x99, 100} +pub const TASKSTATUS_NOTSTARTED: DWORD = 0; +pub const TASKSTATUS_INPROGRESS: DWORD = 1; +pub const TASKSTATUS_COMPLETE: DWORD = 2; +pub const TASKSTATUS_WAITING: DWORD = 3; +pub const TASKSTATUS_DEFERRED: DWORD = 4; +DEFINE_PROPERTYKEY!{PKEY_Communication_TaskStatusText, + 0xA6744477, 0xC237, 0x475B, 0xA0, 0x75, 0x54, 0xF3, 0x44, 0x98, 0x29, 0x2A, 100} +DEFINE_PROPERTYKEY!{PKEY_Computer_DecoratedFreeSpace, + 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 7} +DEFINE_PROPERTYKEY!{PKEY_Contact_AccountPictureDynamicVideo, + 0x0B8BB018, 0x2725, 0x4B44, 0x92, 0xBA, 0x79, 0x33, 0xAE, 0xB2, 0xDD, 0xE7, 2} +DEFINE_PROPERTYKEY!{PKEY_Contact_AccountPictureLarge, + 0x0B8BB018, 0x2725, 0x4B44, 0x92, 0xBA, 0x79, 0x33, 0xAE, 0xB2, 0xDD, 0xE7, 3} +DEFINE_PROPERTYKEY!{PKEY_Contact_AccountPictureSmall, + 0x0B8BB018, 0x2725, 0x4B44, 0x92, 0xBA, 0x79, 0x33, 0xAE, 0xB2, 0xDD, 0xE7, 4} +DEFINE_PROPERTYKEY!{PKEY_Contact_Anniversary, + 0x9AD5BADB, 0xCEA7, 0x4470, 0xA0, 0x3D, 0xB8, 0x4E, 0x51, 0xB9, 0x94, 0x9E, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_AssistantName, + 0xCD102C9C, 0x5540, 0x4A88, 0xA6, 0xF6, 0x64, 0xE4, 0x98, 0x1C, 0x8C, 0xD1, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_AssistantTelephone, + 0x9A93244D, 0xA7AD, 0x4FF8, 0x9B, 0x99, 0x45, 0xEE, 0x4C, 0xC0, 0x9A, 0xF6, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_Birthday, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 47} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress, + 0x730FB6DD, 0xCF7C, 0x426B, 0xA0, 0x3F, 0xBD, 0x16, 0x6C, 0xC9, 0xEE, 0x24, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress1Country, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 119} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress1Locality, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 117} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress1PostalCode, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 120} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress1Region, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 118} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress1Street, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 116} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress2Country, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 124} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress2Locality, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 122} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress2PostalCode, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 125} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress2Region, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 123} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress2Street, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 121} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress3Country, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 129} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress3Locality, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 127} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress3PostalCode, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 130} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress3Region, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 128} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddress3Street, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 126} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddressCity, + 0x402B5934, 0xEC5A, 0x48C3, 0x93, 0xE6, 0x85, 0xE8, 0x6A, 0x2D, 0x93, 0x4E, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddressCountry, + 0xB0B87314, 0xFCF6, 0x4FEB, 0x8D, 0xFF, 0xA5, 0x0D, 0xA6, 0xAF, 0x56, 0x1C, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddressPostalCode, + 0xE1D4A09E, 0xD758, 0x4CD1, 0xB6, 0xEC, 0x34, 0xA8, 0xB5, 0xA7, 0x3F, 0x80, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddressPostOfficeBox, + 0xBC4E71CE, 0x17F9, 0x48D5, 0xBE, 0xE9, 0x02, 0x1D, 0xF0, 0xEA, 0x54, 0x09, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddressState, + 0x446F787F, 0x10C4, 0x41CB, 0xA6, 0xC4, 0x4D, 0x03, 0x43, 0x55, 0x15, 0x97, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessAddressStreet, + 0xDDD1460F, 0xC0BF, 0x4553, 0x8C, 0xE4, 0x10, 0x43, 0x3C, 0x90, 0x8F, 0xB0, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessEmailAddresses, + 0xF271C659, 0x7E5E, 0x471F, 0xBA, 0x25, 0x7F, 0x77, 0xB2, 0x86, 0xF8, 0x36, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessFaxNumber, + 0x91EFF6F3, 0x2E27, 0x42CA, 0x93, 0x3E, 0x7C, 0x99, 0x9F, 0xBE, 0x31, 0x0B, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessHomePage, + 0x56310920, 0x2491, 0x4919, 0x99, 0xCE, 0xEA, 0xDB, 0x06, 0xFA, 0xFD, 0xB2, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_BusinessTelephone, + 0x6A15E5A0, 0x0A1E, 0x4CD7, 0xBB, 0x8C, 0xD2, 0xF1, 0xB0, 0xC9, 0x29, 0xBC, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_CallbackTelephone, + 0xBF53D1C3, 0x49E0, 0x4F7F, 0x85, 0x67, 0x5A, 0x82, 0x1D, 0x8A, 0xC5, 0x42, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_CarTelephone, + 0x8FDC6DEA, 0xB929, 0x412B, 0xBA, 0x90, 0x39, 0x7A, 0x25, 0x74, 0x65, 0xFE, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_Children, + 0xD4729704, 0x8EF1, 0x43EF, 0x90, 0x24, 0x2B, 0xD3, 0x81, 0x18, 0x7F, 0xD5, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_CompanyMainTelephone, + 0x8589E481, 0x6040, 0x473D, 0xB1, 0x71, 0x7F, 0xA8, 0x9C, 0x27, 0x08, 0xED, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_ConnectedServiceDisplayName, + 0x39B77F4F, 0xA104, 0x4863, 0xB3, 0x95, 0x2D, 0xB2, 0xAD, 0x8F, 0x7B, 0xC1, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_ConnectedServiceIdentities, + 0x80F41EB8, 0xAFC4, 0x4208, 0xAA, 0x5F, 0xCC, 0xE2, 0x1A, 0x62, 0x72, 0x81, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_ConnectedServiceName, + 0xB5C84C9E, 0x5927, 0x46B5, 0xA3, 0xCC, 0x93, 0x3C, 0x21, 0xB7, 0x84, 0x69, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_ConnectedServiceSupportedActions, + 0xA19FB7A9, 0x024B, 0x4371, 0xA8, 0xBF, 0x4D, 0x29, 0xC3, 0xE4, 0xE9, 0xC9, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_DataSuppliers, + 0x9660C283, 0xFC3A, 0x4A08, 0xA0, 0x96, 0xEE, 0xD3, 0xAA, 0xC4, 0x6D, 0xA2, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_Department, + 0xFC9F7306, 0xFF8F, 0x4D49, 0x9F, 0xB6, 0x3F, 0xFE, 0x5C, 0x09, 0x51, 0xEC, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_DisplayBusinessPhoneNumbers, + 0x364028DA, 0xD895, 0x41FE, 0xA5, 0x84, 0x30, 0x2B, 0x1B, 0xB7, 0x0A, 0x76, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_DisplayHomePhoneNumbers, + 0x5068BCDF, 0xD697, 0x4D85, 0x8C, 0x53, 0x1F, 0x1C, 0xDA, 0xB0, 0x17, 0x63, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_DisplayMobilePhoneNumbers, + 0x9CB0C358, 0x9D7A, 0x46B1, 0xB4, 0x66, 0xDC, 0xC6, 0xF1, 0xA3, 0xD9, 0x3D, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_DisplayOtherPhoneNumbers, + 0x03089873, 0x8EE8, 0x4191, 0xBD, 0x60, 0xD3, 0x1F, 0x72, 0xB7, 0x90, 0x0B, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_EmailAddress, + 0xF8FA7FA3, 0xD12B, 0x4785, 0x8A, 0x4E, 0x69, 0x1A, 0x94, 0xF7, 0xA3, 0xE7, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_EmailAddress2, + 0x38965063, 0xEDC8, 0x4268, 0x84, 0x91, 0xB7, 0x72, 0x31, 0x72, 0xCF, 0x29, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_EmailAddress3, + 0x644D37B4, 0xE1B3, 0x4BAD, 0xB0, 0x99, 0x7E, 0x7C, 0x04, 0x96, 0x6A, 0xCA, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_EmailAddresses, + 0x84D8F337, 0x981D, 0x44B3, 0x96, 0x15, 0xC7, 0x59, 0x6D, 0xBA, 0x17, 0xE3, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_EmailName, + 0xCC6F4F24, 0x6083, 0x4BD4, 0x87, 0x54, 0x67, 0x4D, 0x0D, 0xE8, 0x7A, 0xB8, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_FileAsName, + 0xF1A24AA7, 0x9CA7, 0x40F6, 0x89, 0xEC, 0x97, 0xDE, 0xF9, 0xFF, 0xE8, 0xDB, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_FirstName, + 0x14977844, 0x6B49, 0x4AAD, 0xA7, 0x14, 0xA4, 0x51, 0x3B, 0xF6, 0x04, 0x60, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_FullName, + 0x635E9051, 0x50A5, 0x4BA2, 0xB9, 0xDB, 0x4E, 0xD0, 0x56, 0xC7, 0x72, 0x96, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_Gender, + 0x3C8CEE58, 0xD4F0, 0x4CF9, 0xB7, 0x56, 0x4E, 0x5D, 0x24, 0x44, 0x7B, 0xCD, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_GenderValue, + 0x3C8CEE58, 0xD4F0, 0x4CF9, 0xB7, 0x56, 0x4E, 0x5D, 0x24, 0x44, 0x7B, 0xCD, 101} +pub const GENDERVALUE_UNSPECIFIED: DWORD = 0; +pub const GENDERVALUE_FEMALE: DWORD = 1; +pub const GENDERVALUE_MALE: DWORD = 2; +DEFINE_PROPERTYKEY!{PKEY_Contact_Hobbies, + 0x5DC2253F, 0x5E11, 0x4ADF, 0x9C, 0xFE, 0x91, 0x0D, 0xD0, 0x1E, 0x3E, 0x70, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress, + 0x98F98354, 0x617A, 0x46B8, 0x85, 0x60, 0x5B, 0x1B, 0x64, 0xBF, 0x1F, 0x89, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress1Country, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 104} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress1Locality, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 102} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress1PostalCode, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 105} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress1Region, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 103} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress1Street, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 101} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress2Country, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 109} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress2Locality, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 107} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress2PostalCode, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 110} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress2Region, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 108} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress2Street, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 106} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress3Country, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 114} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress3Locality, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 112} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress3PostalCode, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 115} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress3Region, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 113} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddress3Street, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 111} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddressCity, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 65} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddressCountry, + 0x08A65AA1, 0xF4C9, 0x43DD, 0x9D, 0xDF, 0xA3, 0x3D, 0x8E, 0x7E, 0xAD, 0x85, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddressPostalCode, + 0x8AFCC170, 0x8A46, 0x4B53, 0x9E, 0xEE, 0x90, 0xBA, 0xE7, 0x15, 0x1E, 0x62, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddressPostOfficeBox, + 0x7B9F6399, 0x0A3F, 0x4B12, 0x89, 0xBD, 0x4A, 0xDC, 0x51, 0xC9, 0x18, 0xAF, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddressState, + 0xC89A23D0, 0x7D6D, 0x4EB8, 0x87, 0xD4, 0x77, 0x6A, 0x82, 0xD4, 0x93, 0xE5, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeAddressStreet, + 0x0ADEF160, 0xDB3F, 0x4308, 0x9A, 0x21, 0x06, 0x23, 0x7B, 0x16, 0xFA, 0x2A, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeEmailAddresses, + 0x56C90E9D, 0x9D46, 0x4963, 0x88, 0x6F, 0x2E, 0x1C, 0xD9, 0xA6, 0x94, 0xEF, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeFaxNumber, + 0x660E04D6, 0x81AB, 0x4977, 0xA0, 0x9F, 0x82, 0x31, 0x31, 0x13, 0xAB, 0x26, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_HomeTelephone, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 20} +DEFINE_PROPERTYKEY!{PKEY_Contact_IMAddress, + 0xD68DBD8A, 0x3374, 0x4B81, 0x99, 0x72, 0x3E, 0xC3, 0x06, 0x82, 0xDB, 0x3D, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_Initials, + 0xF3D8F40D, 0x50CB, 0x44A2, 0x97, 0x18, 0x40, 0xCB, 0x91, 0x19, 0x49, 0x5D, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_JA_CompanyNamePhonetic, + 0x897B3694, 0xFE9E, 0x43E6, 0x80, 0x66, 0x26, 0x0F, 0x59, 0x0C, 0x01, 0x00, 2} +DEFINE_PROPERTYKEY!{PKEY_Contact_JA_FirstNamePhonetic, + 0x897B3694, 0xFE9E, 0x43E6, 0x80, 0x66, 0x26, 0x0F, 0x59, 0x0C, 0x01, 0x00, 3} +DEFINE_PROPERTYKEY!{PKEY_Contact_JA_LastNamePhonetic, + 0x897B3694, 0xFE9E, 0x43E6, 0x80, 0x66, 0x26, 0x0F, 0x59, 0x0C, 0x01, 0x00, 4} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo1CompanyAddress, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 120} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo1CompanyName, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 102} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo1Department, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 106} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo1Manager, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 105} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo1OfficeLocation, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 104} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo1Title, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 103} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo1YomiCompanyName, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 101} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo2CompanyAddress, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 121} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo2CompanyName, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 108} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo2Department, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 113} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo2Manager, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 112} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo2OfficeLocation, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 110} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo2Title, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 109} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo2YomiCompanyName, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 107} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo3CompanyAddress, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 123} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo3CompanyName, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 115} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo3Department, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 119} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo3Manager, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 118} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo3OfficeLocation, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 117} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo3Title, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 116} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobInfo3YomiCompanyName, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 114} +DEFINE_PROPERTYKEY!{PKEY_Contact_JobTitle, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 6} +DEFINE_PROPERTYKEY!{PKEY_Contact_Label, + 0x97B0AD89, 0xDF49, 0x49CC, 0x83, 0x4E, 0x66, 0x09, 0x74, 0xFD, 0x75, 0x5B, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_LastName, + 0x8F367200, 0xC270, 0x457C, 0xB1, 0xD4, 0xE0, 0x7C, 0x5B, 0xCD, 0x90, 0xC7, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_MailingAddress, + 0xC0AC206A, 0x827E, 0x4650, 0x95, 0xAE, 0x77, 0xE2, 0xBB, 0x74, 0xFC, 0xC9, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_MiddleName, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 71} +DEFINE_PROPERTYKEY!{PKEY_Contact_MobileTelephone, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 35} +DEFINE_PROPERTYKEY!{PKEY_Contact_NickName, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 74} +DEFINE_PROPERTYKEY!{PKEY_Contact_OfficeLocation, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 7} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress, + 0x508161FA, 0x313B, 0x43D5, 0x83, 0xA1, 0xC1, 0xAC, 0xCF, 0x68, 0x62, 0x2C, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress1Country, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 134} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress1Locality, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 132} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress1PostalCode, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 135} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress1Region, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 133} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress1Street, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 131} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress2Country, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 139} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress2Locality, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 137} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress2PostalCode, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 140} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress2Region, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 138} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress2Street, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 136} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress3Country, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 144} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress3Locality, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 142} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress3PostalCode, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 145} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress3Region, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 143} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddress3Street, + 0xA7B6F596, 0xD678, 0x4BC1, 0xB0, 0x5F, 0x02, 0x03, 0xD2, 0x7E, 0x8A, 0xA1, 141} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddressCity, + 0x6E682923, 0x7F7B, 0x4F0C, 0xA3, 0x37, 0xCF, 0xCA, 0x29, 0x66, 0x87, 0xBF, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddressCountry, + 0x8F167568, 0x0AAE, 0x4322, 0x8E, 0xD9, 0x60, 0x55, 0xB7, 0xB0, 0xE3, 0x98, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddressPostalCode, + 0x95C656C1, 0x2ABF, 0x4148, 0x9E, 0xD3, 0x9E, 0xC6, 0x02, 0xE3, 0xB7, 0xCD, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddressPostOfficeBox, + 0x8B26EA41, 0x058F, 0x43F6, 0xAE, 0xCC, 0x40, 0x35, 0x68, 0x1C, 0xE9, 0x77, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddressState, + 0x71B377D6, 0xE570, 0x425F, 0xA1, 0x70, 0x80, 0x9F, 0xAE, 0x73, 0xE5, 0x4E, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherAddressStreet, + 0xFF962609, 0xB7D6, 0x4999, 0x86, 0x2D, 0x95, 0x18, 0x0D, 0x52, 0x9A, 0xEA, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_OtherEmailAddresses, + 0x11D6336B, 0x38C4, 0x4EC9, 0x84, 0xD6, 0xEB, 0x38, 0xD0, 0xB1, 0x50, 0xAF, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_PagerTelephone, + 0xD6304E01, 0xF8F5, 0x4F45, 0x8B, 0x15, 0xD0, 0x24, 0xA6, 0x29, 0x67, 0x89, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_PersonalTitle, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 69} +DEFINE_PROPERTYKEY!{PKEY_Contact_PhoneNumbersCanonical, + 0xD042D2A1, 0x927E, 0x40B5, 0xA5, 0x03, 0x6E, 0xDB, 0xD4, 0x2A, 0x51, 0x7E, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_Prefix, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 75} +DEFINE_PROPERTYKEY!{PKEY_Contact_PrimaryAddressCity, + 0xC8EA94F0, 0xA9E3, 0x4969, 0xA9, 0x4B, 0x9C, 0x62, 0xA9, 0x53, 0x24, 0xE0, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_PrimaryAddressCountry, + 0xE53D799D, 0x0F3F, 0x466E, 0xB2, 0xFF, 0x74, 0x63, 0x4A, 0x3C, 0xB7, 0xA4, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_PrimaryAddressPostalCode, + 0x18BBD425, 0xECFD, 0x46EF, 0xB6, 0x12, 0x7B, 0x4A, 0x60, 0x34, 0xED, 0xA0, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_PrimaryAddressPostOfficeBox, + 0xDE5EF3C7, 0x46E1, 0x484E, 0x99, 0x99, 0x62, 0xC5, 0x30, 0x83, 0x94, 0xC1, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_PrimaryAddressState, + 0xF1176DFE, 0x7138, 0x4640, 0x8B, 0x4C, 0xAE, 0x37, 0x5D, 0xC7, 0x0A, 0x6D, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_PrimaryAddressStreet, + 0x63C25B20, 0x96BE, 0x488F, 0x87, 0x88, 0xC0, 0x9C, 0x40, 0x7A, 0xD8, 0x12, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_PrimaryEmailAddress, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 48} +DEFINE_PROPERTYKEY!{PKEY_Contact_PrimaryTelephone, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 25} +DEFINE_PROPERTYKEY!{PKEY_Contact_Profession, + 0x7268AF55, 0x1CE4, 0x4F6E, 0xA4, 0x1F, 0xB6, 0xE4, 0xEF, 0x10, 0xE4, 0xA9, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_SpouseName, + 0x9D2408B6, 0x3167, 0x422B, 0x82, 0xB0, 0xF5, 0x83, 0xB7, 0xA7, 0xCF, 0xE3, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_Suffix, + 0x176DC63C, 0x2688, 0x4E89, 0x81, 0x43, 0xA3, 0x47, 0x80, 0x0F, 0x25, 0xE9, 73} +DEFINE_PROPERTYKEY!{PKEY_Contact_TelexNumber, + 0xC554493C, 0xC1F7, 0x40C1, 0xA7, 0x6C, 0xEF, 0x8C, 0x06, 0x14, 0x00, 0x3E, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_TTYTDDTelephone, + 0xAAF16BAC, 0x2B55, 0x45E6, 0x9F, 0x6D, 0x41, 0x5E, 0xB9, 0x49, 0x10, 0xDF, 100} +DEFINE_PROPERTYKEY!{PKEY_Contact_WebPage, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 18} +DEFINE_PROPERTYKEY!{PKEY_Contact_Webpage2, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 124} +DEFINE_PROPERTYKEY!{PKEY_Contact_Webpage3, + 0x00F63DD8, 0x22BD, 0x4A5D, 0xBA, 0x34, 0x5C, 0xB0, 0xB9, 0xBD, 0xCB, 0x03, 125} +DEFINE_PROPERTYKEY!{PKEY_AcquisitionID, + 0x65A98875, 0x3C80, 0x40AB, 0xAB, 0xBC, 0xEF, 0xDA, 0xF7, 0x7D, 0xBE, 0xE2, 100} +DEFINE_PROPERTYKEY!{PKEY_ApplicationDefinedProperties, + 0xCDBFC167, 0x337E, 0x41D8, 0xAF, 0x7C, 0x8C, 0x09, 0x20, 0x54, 0x29, 0xC7, 100} +DEFINE_PROPERTYKEY!{PKEY_ApplicationName, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 18} +DEFINE_PROPERTYKEY!{PKEY_AppZoneIdentifier, + 0x502CFEAB, 0x47EB, 0x459C, 0xB9, 0x60, 0xE6, 0xD8, 0x72, 0x8F, 0x77, 0x01, 102} +DEFINE_PROPERTYKEY!{PKEY_Author, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 4} +DEFINE_PROPERTYKEY!{PKEY_CachedFileUpdaterContentIdForConflictResolution, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 114} +DEFINE_PROPERTYKEY!{PKEY_CachedFileUpdaterContentIdForStream, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 113} +DEFINE_PROPERTYKEY!{PKEY_Capacity, + 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 3} +DEFINE_PROPERTYKEY!{PKEY_Category, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 2} +DEFINE_PROPERTYKEY!{PKEY_Comment, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 6} +DEFINE_PROPERTYKEY!{PKEY_Company, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 15} +DEFINE_PROPERTYKEY!{PKEY_ComputerName, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 5} +DEFINE_PROPERTYKEY!{PKEY_ContainedItems, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 29} +DEFINE_PROPERTYKEY!{PKEY_ContentStatus, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 27} +DEFINE_PROPERTYKEY!{PKEY_ContentType, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 26} +DEFINE_PROPERTYKEY!{PKEY_Copyright, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 11} +DEFINE_PROPERTYKEY!{PKEY_CreatorAppId, + 0xC2EA046E, 0x033C, 0x4E91, 0xBD, 0x5B, 0xD4, 0x94, 0x2F, 0x6B, 0xBE, 0x49, 2} +DEFINE_PROPERTYKEY!{PKEY_CreatorOpenWithUIOptions, + 0xC2EA046E, 0x033C, 0x4E91, 0xBD, 0x5B, 0xD4, 0x94, 0x2F, 0x6B, 0xBE, 0x49, 3} +pub const CREATOROPENWITHUIOPTION_HIDDEN: DWORD = 0; +pub const CREATOROPENWITHUIOPTION_VISIBLE: DWORD = 1; +DEFINE_PROPERTYKEY!{PKEY_DataObjectFormat, + 0x1E81A3F8, 0xA30F, 0x4247, 0xB9, 0xEE, 0x1D, 0x03, 0x68, 0xA9, 0x42, 0x5C, 2} +DEFINE_PROPERTYKEY!{PKEY_DateAccessed, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 16} +DEFINE_PROPERTYKEY!{PKEY_DateAcquired, + 0x2CBAA8F5, 0xD81F, 0x47CA, 0xB1, 0x7A, 0xF8, 0xD8, 0x22, 0x30, 0x01, 0x31, 100} +DEFINE_PROPERTYKEY!{PKEY_DateArchived, + 0x43F8D7B7, 0xA444, 0x4F87, 0x93, 0x83, 0x52, 0x27, 0x1C, 0x9B, 0x91, 0x5C, 100} +DEFINE_PROPERTYKEY!{PKEY_DateCompleted, + 0x72FAB781, 0xACDA, 0x43E5, 0xB1, 0x55, 0xB2, 0x43, 0x4F, 0x85, 0xE6, 0x78, 100} +DEFINE_PROPERTYKEY!{PKEY_DateCreated, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 15} +DEFINE_PROPERTYKEY!{PKEY_DateImported, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 18258} +DEFINE_PROPERTYKEY!{PKEY_DateModified, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 14} +DEFINE_PROPERTYKEY!{PKEY_DefaultSaveLocationDisplay, + 0x5D76B67F, 0x9B3D, 0x44BB, 0xB6, 0xAE, 0x25, 0xDA, 0x4F, 0x63, 0x8A, 0x67, 10} +pub const ISDEFAULTSAVE_NONE: DWORD = 0; +pub const ISDEFAULTSAVE_OWNER: DWORD = 1; +pub const ISDEFAULTSAVE_NONOWNER: DWORD = 2; +pub const ISDEFAULTSAVE_BOTH: DWORD = 3; +DEFINE_PROPERTYKEY!{PKEY_DueDate, + 0x3F8472B5, 0xE0AF, 0x4DB2, 0x80, 0x71, 0xC5, 0x3F, 0xE7, 0x6A, 0xE7, 0xCE, 100} +DEFINE_PROPERTYKEY!{PKEY_EndDate, + 0xC75FAA05, 0x96FD, 0x49E7, 0x9C, 0xB4, 0x9F, 0x60, 0x10, 0x82, 0xD5, 0x53, 100} +DEFINE_PROPERTYKEY!{PKEY_ExpandoProperties, + 0x6FA20DE6, 0xD11C, 0x4D9D, 0xA1, 0x54, 0x64, 0x31, 0x76, 0x28, 0xC1, 0x2D, 100} +DEFINE_PROPERTYKEY!{PKEY_FileAllocationSize, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 18} +DEFINE_PROPERTYKEY!{PKEY_FileAttributes, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 13} +DEFINE_PROPERTYKEY!{PKEY_FileCount, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 12} +DEFINE_PROPERTYKEY!{PKEY_FileDescription, + 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 3} +DEFINE_PROPERTYKEY!{PKEY_FileExtension, + 0xE4F10A3C, 0x49E6, 0x405D, 0x82, 0x88, 0xA2, 0x3B, 0xD4, 0xEE, 0xAA, 0x6C, 100} +DEFINE_PROPERTYKEY!{PKEY_FileFRN, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 21} +DEFINE_PROPERTYKEY!{PKEY_FileName, + 0x41CF5AE0, 0xF75A, 0x4806, 0xBD, 0x87, 0x59, 0xC7, 0xD9, 0x24, 0x8E, 0xB9, 100} +DEFINE_PROPERTYKEY!{PKEY_FileOfflineAvailabilityStatus, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 100} +pub const FILEOFFLINEAVAILABILITYSTATUS_PROP_NOTAVAILABLEOFFLINE: DWORD = 0; +pub const FILEOFFLINEAVAILABILITYSTATUS_PROP_PARTIALLYAVAILABLEOFFLINE: DWORD = 1; +DEFINE_PROPERTYKEY!{PKEY_FileOwner, + 0x9B174B34, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 4} +DEFINE_PROPERTYKEY!{PKEY_FilePlaceholderStatus, + 0xB2F9B9D6, 0xFEC4, 0x4DD5, 0x94, 0xD7, 0x89, 0x57, 0x48, 0x8C, 0x80, 0x7B, 2} +DEFINE_PROPERTYKEY!{PKEY_FileVersion, + 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 4} +DEFINE_PROPERTYKEY!{PKEY_FindData, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 0} +DEFINE_PROPERTYKEY!{PKEY_FlagColor, + 0x67DF94DE, 0x0CA7, 0x4D6F, 0xB7, 0x92, 0x05, 0x3A, 0x3E, 0x4F, 0x03, 0xCF, 100} +pub const FLAGCOLOR_PURPLE: DWORD = 1; +pub const FLAGCOLOR_ORANGE: DWORD = 2; +pub const FLAGCOLOR_GREEN: DWORD = 3; +pub const FLAGCOLOR_YELLOW: DWORD = 4; +pub const FLAGCOLOR_BLUE: DWORD = 5; +pub const FLAGCOLOR_RED: DWORD = 6; +DEFINE_PROPERTYKEY!{PKEY_FlagColorText, + 0x45EAE747, 0x8E2A, 0x40AE, 0x8C, 0xBF, 0xCA, 0x52, 0xAB, 0xA6, 0x15, 0x2A, 100} +DEFINE_PROPERTYKEY!{PKEY_FlagStatus, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 12} +pub const FLAGSTATUS_NOTFLAGGED: LONG = 0; +pub const FLAGSTATUS_COMPLETED: LONG = 1; +pub const FLAGSTATUS_FOLLOWUP: LONG = 2; +DEFINE_PROPERTYKEY!{PKEY_FlagStatusText, + 0xDC54FD2E, 0x189D, 0x4871, 0xAA, 0x01, 0x08, 0xC2, 0xF5, 0x7A, 0x4A, 0xBC, 100} +DEFINE_PROPERTYKEY!{PKEY_FolderKind, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 101} +DEFINE_PROPERTYKEY!{PKEY_FolderNameDisplay, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 25} +DEFINE_PROPERTYKEY!{PKEY_FreeSpace, + 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 2} +DEFINE_PROPERTYKEY!{PKEY_FullText, + 0x1E3EE840, 0xBC2B, 0x476C, 0x82, 0x37, 0x2A, 0xCD, 0x1A, 0x83, 0x9B, 0x22, 6} +DEFINE_PROPERTYKEY!{PKEY_HighKeywords, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 24} +DEFINE_PROPERTYKEY!{PKEY_Identity, + 0xA26F4AFC, 0x7346, 0x4299, 0xBE, 0x47, 0xEB, 0x1A, 0xE6, 0x13, 0x13, 0x9F, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_Blob, + 0x8C3B93A4, 0xBAED, 0x1A83, 0x9A, 0x32, 0x10, 0x2E, 0xE3, 0x13, 0xF6, 0xEB, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_DisplayName, + 0x7D683FC9, 0xD155, 0x45A8, 0xBB, 0x1F, 0x89, 0xD1, 0x9B, 0xCB, 0x79, 0x2F, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_InternetSid, + 0x6D6D5D49, 0x265D, 0x4688, 0x9F, 0x4E, 0x1F, 0xDD, 0x33, 0xE7, 0xCC, 0x83, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_IsMeIdentity, + 0xA4108708, 0x09DF, 0x4377, 0x9D, 0xFC, 0x6D, 0x99, 0x98, 0x6D, 0x5A, 0x67, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_KeyProviderContext, + 0xA26F4AFC, 0x7346, 0x4299, 0xBE, 0x47, 0xEB, 0x1A, 0xE6, 0x13, 0x13, 0x9F, 17} +DEFINE_PROPERTYKEY!{PKEY_Identity_KeyProviderName, + 0xA26F4AFC, 0x7346, 0x4299, 0xBE, 0x47, 0xEB, 0x1A, 0xE6, 0x13, 0x13, 0x9F, 16} +DEFINE_PROPERTYKEY!{PKEY_Identity_LogonStatusString, + 0xF18DEDF3, 0x337F, 0x42C0, 0x9E, 0x03, 0xCE, 0xE0, 0x87, 0x08, 0xA8, 0xC3, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_PrimaryEmailAddress, + 0xFCC16823, 0xBAED, 0x4F24, 0x9B, 0x32, 0xA0, 0x98, 0x21, 0x17, 0xF7, 0xFA, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_PrimarySid, + 0x2B1B801E, 0xC0C1, 0x4987, 0x9E, 0xC5, 0x72, 0xFA, 0x89, 0x81, 0x47, 0x87, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_ProviderData, + 0xA8A74B92, 0x361B, 0x4E9A, 0xB7, 0x22, 0x7C, 0x4A, 0x73, 0x30, 0xA3, 0x12, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_ProviderID, + 0x74A7DE49, 0xFA11, 0x4D3D, 0xA0, 0x06, 0xDB, 0x7E, 0x08, 0x67, 0x59, 0x16, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_QualifiedUserName, + 0xDA520E51, 0xF4E9, 0x4739, 0xAC, 0x82, 0x02, 0xE0, 0xA9, 0x5C, 0x90, 0x30, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_UniqueID, + 0xE55FC3B0, 0x2B60, 0x4220, 0x91, 0x8E, 0xB2, 0x1E, 0x8B, 0xF1, 0x60, 0x16, 100} +DEFINE_PROPERTYKEY!{PKEY_Identity_UserName, + 0xC4322503, 0x78CA, 0x49C6, 0x9A, 0xCC, 0xA6, 0x8E, 0x2A, 0xFD, 0x7B, 0x6B, 100} +DEFINE_PROPERTYKEY!{PKEY_IdentityProvider_Name, + 0xB96EFF7B, 0x35CA, 0x4A35, 0x86, 0x07, 0x29, 0xE3, 0xA5, 0x4C, 0x46, 0xEA, 100} +DEFINE_PROPERTYKEY!{PKEY_IdentityProvider_Picture, + 0x2425166F, 0x5642, 0x4864, 0x99, 0x2F, 0x98, 0xFD, 0x98, 0xF2, 0x94, 0xC3, 100} +DEFINE_PROPERTYKEY!{PKEY_ImageParsingName, + 0xD7750EE0, 0xC6A4, 0x48EC, 0xB5, 0x3E, 0xB8, 0x7B, 0x52, 0xE6, 0xD0, 0x73, 100} +DEFINE_PROPERTYKEY!{PKEY_Importance, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 11} +pub const IMPORTANCE_LOW_MIN: LONG = 0; +pub const IMPORTANCE_LOW_SET: LONG = 1; +pub const IMPORTANCE_LOW_MAX: LONG = 1; +pub const IMPORTANCE_NORMAL_MIN: LONG = 2; +pub const IMPORTANCE_NORMAL_SET: LONG = 3; +pub const IMPORTANCE_NORMAL_MAX: LONG = 4; +pub const IMPORTANCE_HIGH_MIN: LONG = 5; +pub const IMPORTANCE_HIGH_SET: LONG = 5; +pub const IMPORTANCE_HIGH_MAX: LONG = 5; +DEFINE_PROPERTYKEY!{PKEY_ImportanceText, + 0xA3B29791, 0x7713, 0x4E1D, 0xBB, 0x40, 0x17, 0xDB, 0x85, 0xF0, 0x18, 0x31, 100} +DEFINE_PROPERTYKEY!{PKEY_IsAttachment, + 0xF23F425C, 0x71A1, 0x4FA8, 0x92, 0x2F, 0x67, 0x8E, 0xA4, 0xA6, 0x04, 0x08, 100} +DEFINE_PROPERTYKEY!{PKEY_IsDefaultNonOwnerSaveLocation, + 0x5D76B67F, 0x9B3D, 0x44BB, 0xB6, 0xAE, 0x25, 0xDA, 0x4F, 0x63, 0x8A, 0x67, 5} +DEFINE_PROPERTYKEY!{PKEY_IsDefaultSaveLocation, + 0x5D76B67F, 0x9B3D, 0x44BB, 0xB6, 0xAE, 0x25, 0xDA, 0x4F, 0x63, 0x8A, 0x67, 3} +DEFINE_PROPERTYKEY!{PKEY_IsDeleted, + 0x5CDA5FC8, 0x33EE, 0x4FF3, 0x90, 0x94, 0xAE, 0x7B, 0xD8, 0x86, 0x8C, 0x4D, 100} +DEFINE_PROPERTYKEY!{PKEY_IsEncrypted, + 0x90E5E14E, 0x648B, 0x4826, 0xB2, 0xAA, 0xAC, 0xAF, 0x79, 0x0E, 0x35, 0x13, 10} +DEFINE_PROPERTYKEY!{PKEY_IsFlagged, + 0x5DA84765, 0xE3FF, 0x4278, 0x86, 0xB0, 0xA2, 0x79, 0x67, 0xFB, 0xDD, 0x03, 100} +DEFINE_PROPERTYKEY!{PKEY_IsFlaggedComplete, + 0xA6F360D2, 0x55F9, 0x48DE, 0xB9, 0x09, 0x62, 0x0E, 0x09, 0x0A, 0x64, 0x7C, 100} +DEFINE_PROPERTYKEY!{PKEY_IsIncomplete, + 0x346C8BD1, 0x2E6A, 0x4C45, 0x89, 0xA4, 0x61, 0xB7, 0x8E, 0x8E, 0x70, 0x0F, 100} +DEFINE_PROPERTYKEY!{PKEY_IsLocationSupported, + 0x5D76B67F, 0x9B3D, 0x44BB, 0xB6, 0xAE, 0x25, 0xDA, 0x4F, 0x63, 0x8A, 0x67, 8} +DEFINE_PROPERTYKEY!{PKEY_IsPinnedToNameSpaceTree, + 0x5D76B67F, 0x9B3D, 0x44BB, 0xB6, 0xAE, 0x25, 0xDA, 0x4F, 0x63, 0x8A, 0x67, 2} +DEFINE_PROPERTYKEY!{PKEY_IsRead, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 10} +DEFINE_PROPERTYKEY!{PKEY_IsSearchOnlyItem, + 0x5D76B67F, 0x9B3D, 0x44BB, 0xB6, 0xAE, 0x25, 0xDA, 0x4F, 0x63, 0x8A, 0x67, 4} +DEFINE_PROPERTYKEY!{PKEY_IsSendToTarget, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 33} +DEFINE_PROPERTYKEY!{PKEY_IsShared, + 0xEF884C5B, 0x2BFE, 0x41BB, 0xAA, 0xE5, 0x76, 0xEE, 0xDF, 0x4F, 0x99, 0x02, 100} +DEFINE_PROPERTYKEY!{PKEY_ItemAuthors, + 0xD0A04F0A, 0x462A, 0x48A4, 0xBB, 0x2F, 0x37, 0x06, 0xE8, 0x8D, 0xBD, 0x7D, 100} +DEFINE_PROPERTYKEY!{PKEY_ItemClassType, + 0x048658AD, 0x2DB8, 0x41A4, 0xBB, 0xB6, 0xAC, 0x1E, 0xF1, 0x20, 0x7E, 0xB1, 100} +DEFINE_PROPERTYKEY!{PKEY_ItemDate, + 0xF7DB74B4, 0x4287, 0x4103, 0xAF, 0xBA, 0xF1, 0xB1, 0x3D, 0xCD, 0x75, 0xCF, 100} +DEFINE_PROPERTYKEY!{PKEY_ItemFolderNameDisplay, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 2} +DEFINE_PROPERTYKEY!{PKEY_ItemFolderPathDisplay, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 6} +DEFINE_PROPERTYKEY!{PKEY_ItemFolderPathDisplayNarrow, + 0xDABD30ED, 0x0043, 0x4789, 0xA7, 0xF8, 0xD0, 0x13, 0xA4, 0x73, 0x66, 0x22, 100} +DEFINE_PROPERTYKEY!{PKEY_ItemName, + 0x6B8DA074, 0x3B5C, 0x43BC, 0x88, 0x6F, 0x0A, 0x2C, 0xDC, 0xE0, 0x0B, 0x6F, 100} +DEFINE_PROPERTYKEY!{PKEY_ItemNameDisplay, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 10} +DEFINE_PROPERTYKEY!{PKEY_ItemNameDisplayWithoutExtension, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 24} +DEFINE_PROPERTYKEY!{PKEY_ItemNamePrefix, + 0xD7313FF1, 0xA77A, 0x401C, 0x8C, 0x99, 0x3D, 0xBD, 0xD6, 0x8A, 0xDD, 0x36, 100} +DEFINE_PROPERTYKEY!{PKEY_ItemNameSortOverride, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 23} +DEFINE_PROPERTYKEY!{PKEY_ItemParticipants, + 0xD4D0AA16, 0x9948, 0x41A4, 0xAA, 0x85, 0xD9, 0x7F, 0xF9, 0x64, 0x69, 0x93, 100} +DEFINE_PROPERTYKEY!{PKEY_ItemPathDisplay, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 7} +DEFINE_PROPERTYKEY!{PKEY_ItemPathDisplayNarrow, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 8} +DEFINE_PROPERTYKEY!{PKEY_ItemSubType, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 37} +DEFINE_PROPERTYKEY!{PKEY_ItemType, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 11} +DEFINE_PROPERTYKEY!{PKEY_ItemTypeText, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 4} +DEFINE_PROPERTYKEY!{PKEY_ItemUrl, + 0x49691C90, 0x7E17, 0x101A, 0xA9, 0x1C, 0x08, 0x00, 0x2B, 0x2E, 0xCD, 0xA9, 9} +DEFINE_PROPERTYKEY!{PKEY_Keywords, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 5} +DEFINE_PROPERTYKEY!{PKEY_Kind, + 0x1E3EE840, 0xBC2B, 0x476C, 0x82, 0x37, 0x2A, 0xCD, 0x1A, 0x83, 0x9B, 0x22, 3} +pub const KIND_CALENDAR: &'static str = "calendar"; +pub const KIND_COMMUNICATION: &'static str = "communication"; +pub const KIND_CONTACT: &'static str = "contact"; +pub const KIND_DOCUMENT: &'static str = "document"; +pub const KIND_EMAIL: &'static str = "email"; +pub const KIND_FEED: &'static str = "feed"; +pub const KIND_FOLDER: &'static str = "folder"; +pub const KIND_GAME: &'static str = "game"; +pub const KIND_INSTANTMESSAGE: &'static str = "instantmessage"; +pub const KIND_JOURNAL: &'static str = "journal"; +pub const KIND_LINK: &'static str = "link"; +pub const KIND_MOVIE: &'static str = "movie"; +pub const KIND_MUSIC: &'static str = "music"; +pub const KIND_NOTE: &'static str = "note"; +pub const KIND_PICTURE: &'static str = "picture"; +pub const KIND_PLAYLIST: &'static str = "playlist"; +pub const KIND_PROGRAM: &'static str = "program"; +pub const KIND_RECORDEDTV: &'static str = "recordedtv"; +pub const KIND_SEARCHFOLDER: &'static str = "searchfolder"; +pub const KIND_TASK: &'static str = "task"; +pub const KIND_VIDEO: &'static str = "video"; +pub const KIND_WEBHISTORY: &'static str = "webhistory"; +pub const KIND_UNKNOWN: &'static str = "unknown"; +DEFINE_PROPERTYKEY!{PKEY_KindText, + 0xF04BEF95, 0xC585, 0x4197, 0xA2, 0xB7, 0xDF, 0x46, 0xFD, 0xC9, 0xEE, 0x6D, 100} +DEFINE_PROPERTYKEY!{PKEY_Language, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 28} +DEFINE_PROPERTYKEY!{PKEY_LastSyncError, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 107} +DEFINE_PROPERTYKEY!{PKEY_LastWriterPackageFamilyName, + 0x502CFEAB, 0x47EB, 0x459C, 0xB9, 0x60, 0xE6, 0xD8, 0x72, 0x8F, 0x77, 0x01, 101} +DEFINE_PROPERTYKEY!{PKEY_LowKeywords, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 25} +DEFINE_PROPERTYKEY!{PKEY_MediumKeywords, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 26} +DEFINE_PROPERTYKEY!{PKEY_MileageInformation, + 0xFDF84370, 0x031A, 0x4ADD, 0x9E, 0x91, 0x0D, 0x77, 0x5F, 0x1C, 0x66, 0x05, 100} +DEFINE_PROPERTYKEY!{PKEY_MIMEType, + 0x0B63E350, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 5} +DEFINE_PROPERTYKEY!{PKEY_Null, + 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0} +DEFINE_PROPERTYKEY!{PKEY_OfflineAvailability, + 0xA94688B6, 0x7D9F, 0x4570, 0xA6, 0x48, 0xE3, 0xDF, 0xC0, 0xAB, 0x2B, 0x3F, 100} +pub const OFFLINEAVAILABILITY_NOT_AVAILABLE: DWORD = 0; +pub const OFFLINEAVAILABILITY_AVAILABLE: DWORD = 1; +pub const OFFLINEAVAILABILITY_ALWAYS_AVAILABLE: DWORD = 2; +DEFINE_PROPERTYKEY!{PKEY_OfflineStatus, + 0x6D24888F, 0x4718, 0x4BDA, 0xAF, 0xED, 0xEA, 0x0F, 0xB4, 0x38, 0x6C, 0xD8, 100} +pub const OFFLINESTATUS_ONLINE: DWORD = 0; +pub const OFFLINESTATUS_OFFLINE: DWORD = 1; +pub const OFFLINESTATUS_OFFLINE_FORCED: DWORD = 2; +pub const OFFLINESTATUS_OFFLINE_SLOW: DWORD = 3; +pub const OFFLINESTATUS_OFFLINE_ERROR: DWORD = 4; +pub const OFFLINESTATUS_OFFLINE_ITEM_VERSION_CONFLICT: DWORD = 5; +pub const OFFLINESTATUS_OFFLINE_SUSPENDED: DWORD = 6; +DEFINE_PROPERTYKEY!{PKEY_OriginalFileName, + 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 6} +DEFINE_PROPERTYKEY!{PKEY_OwnerSID, + 0x5D76B67F, 0x9B3D, 0x44BB, 0xB6, 0xAE, 0x25, 0xDA, 0x4F, 0x63, 0x8A, 0x67, 6} +DEFINE_PROPERTYKEY!{PKEY_ParentalRating, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 21} +DEFINE_PROPERTYKEY!{PKEY_ParentalRatingReason, + 0x10984E0A, 0xF9F2, 0x4321, 0xB7, 0xEF, 0xBA, 0xF1, 0x95, 0xAF, 0x43, 0x19, 100} +DEFINE_PROPERTYKEY!{PKEY_ParentalRatingsOrganization, + 0xA7FE0840, 0x1344, 0x46F0, 0x8D, 0x37, 0x52, 0xED, 0x71, 0x2A, 0x4B, 0xF9, 100} +DEFINE_PROPERTYKEY!{PKEY_ParsingBindContext, + 0xDFB9A04D, 0x362F, 0x4CA3, 0xB3, 0x0B, 0x02, 0x54, 0xB1, 0x7B, 0x5B, 0x84, 100} +DEFINE_PROPERTYKEY!{PKEY_ParsingName, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 24} +DEFINE_PROPERTYKEY!{PKEY_ParsingPath, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 30} +DEFINE_PROPERTYKEY!{PKEY_PerceivedType, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 9} +DEFINE_PROPERTYKEY!{PKEY_PercentFull, + 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 5} +DEFINE_PROPERTYKEY!{PKEY_Priority, + 0x9C1FCF74, 0x2D97, 0x41BA, 0xB4, 0xAE, 0xCB, 0x2E, 0x36, 0x61, 0xA6, 0xE4, 5} +pub const PRIORITY_PROP_LOW: DWORD = 0; +pub const PRIORITY_PROP_NORMAL: DWORD = 1; +pub const PRIORITY_PROP_HIGH: DWORD = 2; +DEFINE_PROPERTYKEY!{PKEY_PriorityText, + 0xD98BE98B, 0xB86B, 0x4095, 0xBF, 0x52, 0x9D, 0x23, 0xB2, 0xE0, 0xA7, 0x52, 100} +DEFINE_PROPERTYKEY!{PKEY_Project, + 0x39A7F922, 0x477C, 0x48DE, 0x8B, 0xC8, 0xB2, 0x84, 0x41, 0xE3, 0x42, 0xE3, 100} +DEFINE_PROPERTYKEY!{PKEY_ProviderItemID, + 0xF21D9941, 0x81F0, 0x471A, 0xAD, 0xEE, 0x4E, 0x74, 0xB4, 0x92, 0x17, 0xED, 100} +DEFINE_PROPERTYKEY!{PKEY_Rating, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 9} +pub const RATING_ONE_STAR_MIN: DWORD = 1; +pub const RATING_ONE_STAR_SET: DWORD = 1; +pub const RATING_ONE_STAR_MAX: DWORD = 12; +pub const RATING_TWO_STARS_MIN: DWORD = 13; +pub const RATING_TWO_STARS_SET: DWORD = 25; +pub const RATING_TWO_STARS_MAX: DWORD = 37; +pub const RATING_THREE_STARS_MIN: DWORD = 38; +pub const RATING_THREE_STARS_SET: DWORD = 50; +pub const RATING_THREE_STARS_MAX: DWORD = 62; +pub const RATING_FOUR_STARS_MIN: DWORD = 63; +pub const RATING_FOUR_STARS_SET: DWORD = 75; +pub const RATING_FOUR_STARS_MAX: DWORD = 87; +pub const RATING_FIVE_STARS_MIN: DWORD = 88; +pub const RATING_FIVE_STARS_SET: DWORD = 99; +pub const RATING_FIVE_STARS_MAX: DWORD = 99; +DEFINE_PROPERTYKEY!{PKEY_RatingText, + 0x90197CA7, 0xFD8F, 0x4E8C, 0x9D, 0xA3, 0xB5, 0x7E, 0x1E, 0x60, 0x92, 0x95, 100} +DEFINE_PROPERTYKEY!{PKEY_RemoteConflictingFile, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 115} +DEFINE_PROPERTYKEY!{PKEY_Security_AllowedEnterpriseDataProtectionIdentities, + 0x38D43380, 0xD418, 0x4830, 0x84, 0xD5, 0x46, 0x93, 0x5A, 0x81, 0xC5, 0xC6, 32} +DEFINE_PROPERTYKEY!{PKEY_Security_EncryptionOwners, + 0x5F5AFF6A, 0x37E5, 0x4780, 0x97, 0xEA, 0x80, 0xC7, 0x56, 0x5C, 0xF5, 0x35, 34} +DEFINE_PROPERTYKEY!{PKEY_Security_EncryptionOwnersDisplay, + 0xDE621B8F, 0xE125, 0x43A3, 0xA3, 0x2D, 0x56, 0x65, 0x44, 0x6D, 0x63, 0x2A, 25} +DEFINE_PROPERTYKEY!{PKEY_Sensitivity, + 0xF8D3F6AC, 0x4874, 0x42CB, 0xBE, 0x59, 0xAB, 0x45, 0x4B, 0x30, 0x71, 0x6A, 100} +pub const SENSITIVITY_PROP_NORMAL: DWORD = 0; +pub const SENSITIVITY_PROP_PERSONAL: DWORD = 1; +pub const SENSITIVITY_PROP_PRIVATE: DWORD = 2; +pub const SENSITIVITY_PROP_CONFIDENTIAL: DWORD = 3; +DEFINE_PROPERTYKEY!{PKEY_SensitivityText, + 0xD0C7F054, 0x3F72, 0x4725, 0x85, 0x27, 0x12, 0x9A, 0x57, 0x7C, 0xB2, 0x69, 100} +DEFINE_PROPERTYKEY!{PKEY_SFGAOFlags, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 25} +DEFINE_PROPERTYKEY!{PKEY_SharedWith, + 0xEF884C5B, 0x2BFE, 0x41BB, 0xAA, 0xE5, 0x76, 0xEE, 0xDF, 0x4F, 0x99, 0x02, 200} +DEFINE_PROPERTYKEY!{PKEY_ShareUserRating, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 12} +DEFINE_PROPERTYKEY!{PKEY_SharingStatus, + 0xEF884C5B, 0x2BFE, 0x41BB, 0xAA, 0xE5, 0x76, 0xEE, 0xDF, 0x4F, 0x99, 0x02, 300} +pub const SHARINGSTATUS_NOTSHARED: DWORD = 0; +pub const SHARINGSTATUS_SHARED: DWORD = 1; +pub const SHARINGSTATUS_PRIVATE: DWORD = 2; +DEFINE_PROPERTYKEY!{PKEY_Shell_OmitFromView, + 0xDE35258C, 0xC695, 0x4CBC, 0xB9, 0x82, 0x38, 0xB0, 0xAD, 0x24, 0xCE, 0xD0, 2} +DEFINE_PROPERTYKEY!{PKEY_SimpleRating, + 0xA09F084E, 0xAD41, 0x489F, 0x80, 0x76, 0xAA, 0x5B, 0xE3, 0x08, 0x2B, 0xCA, 100} +DEFINE_PROPERTYKEY!{PKEY_Size, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 12} +DEFINE_PROPERTYKEY!{PKEY_SoftwareUsed, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 305} +DEFINE_PROPERTYKEY!{PKEY_SourceItem, + 0x668CDFA5, 0x7A1B, 0x4323, 0xAE, 0x4B, 0xE5, 0x27, 0x39, 0x3A, 0x1D, 0x81, 100} +DEFINE_PROPERTYKEY!{PKEY_SourcePackageFamilyName, + 0xFFAE9DB7, 0x1C8D, 0x43FF, 0x81, 0x8C, 0x84, 0x40, 0x3A, 0xA3, 0x73, 0x2D, 100} +DEFINE_PROPERTYKEY!{PKEY_StartDate, + 0x48FD6EC8, 0x8A12, 0x4CDF, 0xA0, 0x3E, 0x4E, 0xC5, 0xA5, 0x11, 0xED, 0xDE, 100} +DEFINE_PROPERTYKEY!{PKEY_Status, + 0x000214A1, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 9} +DEFINE_PROPERTYKEY!{PKEY_StorageProviderCallerVersionInformation, + 0xB2F9B9D6, 0xFEC4, 0x4DD5, 0x94, 0xD7, 0x89, 0x57, 0x48, 0x8C, 0x80, 0x7B, 7} +DEFINE_PROPERTYKEY!{PKEY_StorageProviderError, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 109} +DEFINE_PROPERTYKEY!{PKEY_StorageProviderFileChecksum, + 0xB2F9B9D6, 0xFEC4, 0x4DD5, 0x94, 0xD7, 0x89, 0x57, 0x48, 0x8C, 0x80, 0x7B, 5} +DEFINE_PROPERTYKEY!{PKEY_StorageProviderFileIdentifier, + 0xB2F9B9D6, 0xFEC4, 0x4DD5, 0x94, 0xD7, 0x89, 0x57, 0x48, 0x8C, 0x80, 0x7B, 3} +DEFINE_PROPERTYKEY!{PKEY_StorageProviderFileRemoteUri, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 112} +DEFINE_PROPERTYKEY!{PKEY_StorageProviderFileVersion, + 0xB2F9B9D6, 0xFEC4, 0x4DD5, 0x94, 0xD7, 0x89, 0x57, 0x48, 0x8C, 0x80, 0x7B, 4} +DEFINE_PROPERTYKEY!{PKEY_StorageProviderFileVersionWaterline, + 0xB2F9B9D6, 0xFEC4, 0x4DD5, 0x94, 0xD7, 0x89, 0x57, 0x48, 0x8C, 0x80, 0x7B, 6} +DEFINE_PROPERTYKEY!{PKEY_StorageProviderId, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 108} +DEFINE_PROPERTYKEY!{PKEY_StorageProviderShareStatuses, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 111} +pub const STORAGE_PROVIDER_SHARE_STATUS_PRIVATE: &'static str = "Private"; +pub const STORAGE_PROVIDER_SHARE_STATUS_SHARED: &'static str = "Shared"; +pub const STORAGE_PROVIDER_SHARE_STATUS_PUBLIC: &'static str = "Public"; +pub const STORAGE_PROVIDER_SHARE_STATUS_GROUP: &'static str = "Group"; +pub const STORAGE_PROVIDER_SHARE_STATUS_OWNER: &'static str = "Owner"; +DEFINE_PROPERTYKEY!{PKEY_StorageProviderSharingStatus, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 117} +pub const STORAGE_PROVIDER_SHARINGSTATUS_NOTSHARED: DWORD = 0; +pub const STORAGE_PROVIDER_SHARINGSTATUS_SHARED: DWORD = 1; +pub const STORAGE_PROVIDER_SHARINGSTATUS_PRIVATE: DWORD = 2; +pub const STORAGE_PROVIDER_SHARINGSTATUS_PUBLIC: DWORD = 3; +pub const STORAGE_PROVIDER_SHARINGSTATUS_SHARED_OWNED: DWORD = 4; +pub const STORAGE_PROVIDER_SHARINGSTATUS_SHARED_COOWNED: DWORD = 5; +pub const STORAGE_PROVIDER_SHARINGSTATUS_PUBLIC_OWNED: DWORD = 6; +pub const STORAGE_PROVIDER_SHARINGSTATUS_PUBLIC_COOWNED: DWORD = 7; +DEFINE_PROPERTYKEY!{PKEY_StorageProviderStatus, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 110} +DEFINE_PROPERTYKEY!{PKEY_Subject, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 3} +DEFINE_PROPERTYKEY!{PKEY_SyncTransferStatus, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 103} +DEFINE_PROPERTYKEY!{PKEY_Thumbnail, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 17} +DEFINE_PROPERTYKEY!{PKEY_ThumbnailCacheId, + 0x446D16B1, 0x8DAD, 0x4870, 0xA7, 0x48, 0x40, 0x2E, 0xA4, 0x3D, 0x78, 0x8C, 100} +DEFINE_PROPERTYKEY!{PKEY_ThumbnailStream, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 27} +DEFINE_PROPERTYKEY!{PKEY_Title, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 2} +DEFINE_PROPERTYKEY!{PKEY_TitleSortOverride, + 0xF0F7984D, 0x222E, 0x4AD2, 0x82, 0xAB, 0x1D, 0xD8, 0xEA, 0x40, 0xE5, 0x7E, 300} +DEFINE_PROPERTYKEY!{PKEY_TotalFileSize, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 14} +DEFINE_PROPERTYKEY!{PKEY_Trademarks, + 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 9} +DEFINE_PROPERTYKEY!{PKEY_TransferOrder, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 106} +DEFINE_PROPERTYKEY!{PKEY_TransferPosition, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 104} +DEFINE_PROPERTYKEY!{PKEY_TransferSize, + 0xFCEFF153, 0xE839, 0x4CF3, 0xA9, 0xE7, 0xEA, 0x22, 0x83, 0x20, 0x94, 0xB8, 105} +DEFINE_PROPERTYKEY!{PKEY_VolumeId, + 0x446D16B1, 0x8DAD, 0x4870, 0xA7, 0x48, 0x40, 0x2E, 0xA4, 0x3D, 0x78, 0x8C, 104} +DEFINE_PROPERTYKEY!{PKEY_ZoneIdentifier, + 0x502CFEAB, 0x47EB, 0x459C, 0xB9, 0x60, 0xE6, 0xD8, 0x72, 0x8F, 0x77, 0x01, 100} +DEFINE_PROPERTYKEY!{PKEY_Device_PrinterURL, + 0x0B48F35A, 0xBE6E, 0x4F17, 0xB1, 0x08, 0x3C, 0x40, 0x73, 0xD1, 0x66, 0x9A, 15} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Bluetooth_DeviceAddress, + 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 1} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Bluetooth_Flags, + 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 3} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Bluetooth_LastConnectedTime, + 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 11} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Bluetooth_Manufacturer, + 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 4} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Bluetooth_ModelNumber, + 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 5} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Bluetooth_ProductId, + 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 8} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Bluetooth_ProductVersion, + 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 9} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Bluetooth_ServiceGuid, + 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 2} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Bluetooth_VendorId, + 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 7} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Bluetooth_VendorIdSource, + 0x2BD67D8B, 0x8BEB, 0x48D5, 0x87, 0xE0, 0x6C, 0xDA, 0x34, 0x28, 0x04, 0x0A, 6} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Hid_IsReadOnly, + 0xCBF38310, 0x4A17, 0x4310, 0xA1, 0xEB, 0x24, 0x7F, 0x0B, 0x67, 0x59, 0x3B, 4} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Hid_ProductId, + 0xCBF38310, 0x4A17, 0x4310, 0xA1, 0xEB, 0x24, 0x7F, 0x0B, 0x67, 0x59, 0x3B, 6} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Hid_UsageId, + 0xCBF38310, 0x4A17, 0x4310, 0xA1, 0xEB, 0x24, 0x7F, 0x0B, 0x67, 0x59, 0x3B, 3} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Hid_UsagePage, + 0xCBF38310, 0x4A17, 0x4310, 0xA1, 0xEB, 0x24, 0x7F, 0x0B, 0x67, 0x59, 0x3B, 2} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Hid_VendorId, + 0xCBF38310, 0x4A17, 0x4310, 0xA1, 0xEB, 0x24, 0x7F, 0x0B, 0x67, 0x59, 0x3B, 5} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Hid_VersionNumber, + 0xCBF38310, 0x4A17, 0x4310, 0xA1, 0xEB, 0x24, 0x7F, 0x0B, 0x67, 0x59, 0x3B, 7} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_PrinterDriverDirectory, + 0x847C66DE, 0xB8D6, 0x4AF9, 0xAB, 0xC3, 0x6F, 0x4F, 0x92, 0x6B, 0xC0, 0x39, 14} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_PrinterDriverName, + 0xAFC47170, 0x14F5, 0x498C, 0x8F, 0x30, 0xB0, 0xD1, 0x9B, 0xE4, 0x49, 0xC6, 11} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_PrinterEnumerationFlag, + 0xA00742A1, 0xCD8C, 0x4B37, 0x95, 0xAB, 0x70, 0x75, 0x55, 0x87, 0x76, 0x7A, 3} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_PrinterName, + 0x0A7B84EF, 0x0C27, 0x463F, 0x84, 0xEF, 0x06, 0xC5, 0x07, 0x00, 0x01, 0xBE, 10} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_PrinterPortName, + 0xEEC7B761, 0x6F94, 0x41B1, 0x94, 0x9F, 0xC7, 0x29, 0x72, 0x0D, 0xD1, 0x3C, 12} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Proximity_SupportsNfc, + 0xFB3842CD, 0x9E2A, 0x4F83, 0x8F, 0xCC, 0x4B, 0x07, 0x61, 0x13, 0x9A, 0xE9, 2} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Serial_PortName, + 0x4C6BF15C, 0x4C03, 0x4AAC, 0x91, 0xF5, 0x64, 0xC0, 0xF8, 0x52, 0xBC, 0xF4, 4} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Serial_UsbProductId, + 0x4C6BF15C, 0x4C03, 0x4AAC, 0x91, 0xF5, 0x64, 0xC0, 0xF8, 0x52, 0xBC, 0xF4, 3} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_Serial_UsbVendorId, + 0x4C6BF15C, 0x4C03, 0x4AAC, 0x91, 0xF5, 0x64, 0xC0, 0xF8, 0x52, 0xBC, 0xF4, 2} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_WinUsb_DeviceInterfaceClasses, + 0x95E127B5, 0x79CC, 0x4E83, 0x9C, 0x9E, 0x84, 0x22, 0x18, 0x7B, 0x3E, 0x0E, 7} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_WinUsb_UsbClass, + 0x95E127B5, 0x79CC, 0x4E83, 0x9C, 0x9E, 0x84, 0x22, 0x18, 0x7B, 0x3E, 0x0E, 4} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_WinUsb_UsbProductId, + 0x95E127B5, 0x79CC, 0x4E83, 0x9C, 0x9E, 0x84, 0x22, 0x18, 0x7B, 0x3E, 0x0E, 3} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_WinUsb_UsbProtocol, + 0x95E127B5, 0x79CC, 0x4E83, 0x9C, 0x9E, 0x84, 0x22, 0x18, 0x7B, 0x3E, 0x0E, 6} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_WinUsb_UsbSubClass, + 0x95E127B5, 0x79CC, 0x4E83, 0x9C, 0x9E, 0x84, 0x22, 0x18, 0x7B, 0x3E, 0x0E, 5} +DEFINE_PROPERTYKEY!{PKEY_DeviceInterface_WinUsb_UsbVendorId, + 0x95E127B5, 0x79CC, 0x4E83, 0x9C, 0x9E, 0x84, 0x22, 0x18, 0x7B, 0x3E, 0x0E, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_AepId, + 0x3B2CE006, 0x5E61, 0x4FDE, 0xBA, 0xB8, 0x9B, 0x8A, 0xAC, 0x9B, 0x26, 0xDF, 8} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Major, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Minor, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Services_Audio, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 10} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Services_Capturing, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 8} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Services_Information, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 12} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Services_LimitedDiscovery, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Services_Networking, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Services_ObjectXfer, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 9} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Services_Positioning, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Services_Rendering, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 7} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Cod_Services_Telephony, + 0x5FBD34CD, 0x561A, 0x412E, 0xBA, 0x98, 0x47, 0x8A, 0x6B, 0x0F, 0xEF, 0x1D, 11} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Le_AddressType, + 0x995EF0B0, 0x7EB3, 0x4A8B, 0xB9, 0xCE, 0x06, 0x8B, 0xB3, 0xF4, 0xAF, 0x69, 4} +pub const BLUETOOTH_ADDRESS_TYPE_PUBLIC: LONG = 0; +pub const BLUETOOTH_ADDRESS_TYPE_RANDOM: LONG = 1; +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Le_Appearance, + 0x995EF0B0, 0x7EB3, 0x4A8B, 0xB9, 0xCE, 0x06, 0x8B, 0xB3, 0xF4, 0xAF, 0x69, 1} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Le_Appearance_Category, + 0x995EF0B0, 0x7EB3, 0x4A8B, 0xB9, 0xCE, 0x06, 0x8B, 0xB3, 0xF4, 0xAF, 0x69, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Le_Appearance_Subcategory, + 0x995EF0B0, 0x7EB3, 0x4A8B, 0xB9, 0xCE, 0x06, 0x8B, 0xB3, 0xF4, 0xAF, 0x69, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Bluetooth_Le_IsConnectable, + 0x995EF0B0, 0x7EB3, 0x4A8B, 0xB9, 0xCE, 0x06, 0x8B, 0xB3, 0xF4, 0xAF, 0x69, 8} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_CanPair, + 0xE7C3FB29, 0xCAA7, 0x4F47, 0x8C, 0x8B, 0xBE, 0x59, 0xB3, 0x30, 0xD4, 0xC5, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Category, + 0xA35996AB, 0x11CF, 0x4935, 0x8B, 0x61, 0xA6, 0x76, 0x10, 0x81, 0xEC, 0xDF, 17} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_ContainerId, + 0xE7C3FB29, 0xCAA7, 0x4F47, 0x8C, 0x8B, 0xBE, 0x59, 0xB3, 0x30, 0xD4, 0xC5, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_DeviceAddress, + 0xA35996AB, 0x11CF, 0x4935, 0x8B, 0x61, 0xA6, 0x76, 0x10, 0x81, 0xEC, 0xDF, 12} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_IsConnected, + 0xA35996AB, 0x11CF, 0x4935, 0x8B, 0x61, 0xA6, 0x76, 0x10, 0x81, 0xEC, 0xDF, 7} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_IsPaired, + 0xA35996AB, 0x11CF, 0x4935, 0x8B, 0x61, 0xA6, 0x76, 0x10, 0x81, 0xEC, 0xDF, 16} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_IsPresent, + 0xA35996AB, 0x11CF, 0x4935, 0x8B, 0x61, 0xA6, 0x76, 0x10, 0x81, 0xEC, 0xDF, 9} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_Manufacturer, + 0xA35996AB, 0x11CF, 0x4935, 0x8B, 0x61, 0xA6, 0x76, 0x10, 0x81, 0xEC, 0xDF, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_ModelId, + 0xA35996AB, 0x11CF, 0x4935, 0x8B, 0x61, 0xA6, 0x76, 0x10, 0x81, 0xEC, 0xDF, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_ModelName, + 0xA35996AB, 0x11CF, 0x4935, 0x8B, 0x61, 0xA6, 0x76, 0x10, 0x81, 0xEC, 0xDF, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_PointOfService_ConnectionTypes, + 0xD4BF61B3, 0x442E, 0x4ADA, 0x88, 0x2D, 0xFA, 0x7B, 0x70, 0xC8, 0x32, 0xD9, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_ProtocolId, + 0x3B2CE006, 0x5E61, 0x4FDE, 0xBA, 0xB8, 0x9B, 0x8A, 0xAC, 0x9B, 0x26, 0xDF, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_Aep_SignalStrength, + 0xA35996AB, 0x11CF, 0x4935, 0x8B, 0x61, 0xA6, 0x76, 0x10, 0x81, 0xEC, 0xDF, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_CanPair, + 0x0BBA1EDE, 0x7566, 0x4F47, 0x90, 0xEC, 0x25, 0xFC, 0x56, 0x7C, 0xED, 0x2A, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_Categories, + 0x0BBA1EDE, 0x7566, 0x4F47, 0x90, 0xEC, 0x25, 0xFC, 0x56, 0x7C, 0xED, 0x2A, 9} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_Children, + 0x0BBA1EDE, 0x7566, 0x4F47, 0x90, 0xEC, 0x25, 0xFC, 0x56, 0x7C, 0xED, 0x2A, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_ContainerId, + 0x0BBA1EDE, 0x7566, 0x4F47, 0x90, 0xEC, 0x25, 0xFC, 0x56, 0x7C, 0xED, 0x2A, 12} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_DialProtocol_InstalledApplications, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_IsPaired, + 0x0BBA1EDE, 0x7566, 0x4F47, 0x90, 0xEC, 0x25, 0xFC, 0x56, 0x7C, 0xED, 0x2A, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_IsPresent, + 0x0BBA1EDE, 0x7566, 0x4F47, 0x90, 0xEC, 0x25, 0xFC, 0x56, 0x7C, 0xED, 0x2A, 11} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_Manufacturer, + 0x0BBA1EDE, 0x7566, 0x4F47, 0x90, 0xEC, 0x25, 0xFC, 0x56, 0x7C, 0xED, 0x2A, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_ModelIds, + 0x0BBA1EDE, 0x7566, 0x4F47, 0x90, 0xEC, 0x25, 0xFC, 0x56, 0x7C, 0xED, 0x2A, 8} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_ModelName, + 0x0BBA1EDE, 0x7566, 0x4F47, 0x90, 0xEC, 0x25, 0xFC, 0x56, 0x7C, 0xED, 0x2A, 7} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_ProtocolIds, + 0x0BBA1EDE, 0x7566, 0x4F47, 0x90, 0xEC, 0x25, 0xFC, 0x56, 0x7C, 0xED, 0x2A, 13} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportedUriSchemes, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsAudio, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsCapturing, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 11} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsImages, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsInformation, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 14} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsLimitedDiscovery, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 7} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsNetworking, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 9} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsObjectTransfer, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 12} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsPositioning, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 8} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsRendering, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 10} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsTelephony, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 13} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepContainer_SupportsVideo, + 0x6AF55D45, 0x38DB, 0x4495, 0xAC, 0xB0, 0xD4, 0x72, 0x8A, 0x3B, 0x83, 0x14, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_AepId, + 0xC9C141A9, 0x1B4C, 0x4F17, 0xA9, 0xD1, 0xF2, 0x98, 0x53, 0x8C, 0xAD, 0xB8, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_Bluetooth_CacheMode, + 0x9744311E, 0x7951, 0x4B2E, 0xB6, 0xF0, 0xEC, 0xB2, 0x93, 0xCA, 0xC1, 0x19, 5} +pub const BLUETOOTH_CACHE_MODE_CACHED: LONG = 0; +pub const BLUETOOTH_CACHED_MODE_UNCACHED: LONG = 1; +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_Bluetooth_ServiceGuid, + 0xA399AAC7, 0xC265, 0x474E, 0xB0, 0x73, 0xFF, 0xCE, 0x57, 0x72, 0x17, 0x16, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_Bluetooth_TargetDevice, + 0x9744311E, 0x7951, 0x4B2E, 0xB6, 0xF0, 0xEC, 0xB2, 0x93, 0xCA, 0xC1, 0x19, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_ContainerId, + 0x71724756, 0x3E74, 0x4432, 0x9B, 0x59, 0xE7, 0xB2, 0xF6, 0x68, 0xA5, 0x93, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_FriendlyName, + 0x71724756, 0x3E74, 0x4432, 0x9B, 0x59, 0xE7, 0xB2, 0xF6, 0x68, 0xA5, 0x93, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_IoT_ServiceInterfaces, + 0x79D94E82, 0x4D79, 0x45AA, 0x82, 0x1A, 0x74, 0x85, 0x8B, 0x4E, 0x4C, 0xA6, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_ParentAepIsPaired, + 0xC9C141A9, 0x1B4C, 0x4F17, 0xA9, 0xD1, 0xF2, 0x98, 0x53, 0x8C, 0xAD, 0xB8, 7} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_ProtocolId, + 0xC9C141A9, 0x1B4C, 0x4F17, 0xA9, 0xD1, 0xF2, 0x98, 0x53, 0x8C, 0xAD, 0xB8, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_ServiceClassId, + 0x71724756, 0x3E74, 0x4432, 0x9B, 0x59, 0xE7, 0xB2, 0xF6, 0x68, 0xA5, 0x93, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_AepService_ServiceId, + 0xC9C141A9, 0x1B4C, 0x4F17, 0xA9, 0xD1, 0xF2, 0x98, 0x53, 0x8C, 0xAD, 0xB8, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_AppPackageFamilyName, + 0x51236583, 0x0C4A, 0x4FE8, 0xB8, 0x1F, 0x16, 0x6A, 0xEC, 0x13, 0xF5, 0x10, 100} +DEFINE_PROPERTYKEY!{PKEY_Devices_AudioDevice_Microphone_SensitivityInDbfs, + 0x8943B373, 0x388C, 0x4395, 0xB5, 0x57, 0xBC, 0x6D, 0xBA, 0xFF, 0xAF, 0xDB, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_AudioDevice_Microphone_SignalToNoiseRatioInDb, + 0x8943B373, 0x388C, 0x4395, 0xB5, 0x57, 0xBC, 0x6D, 0xBA, 0xFF, 0xAF, 0xDB, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_AudioDevice_RawProcessingSupported, + 0x8943B373, 0x388C, 0x4395, 0xB5, 0x57, 0xBC, 0x6D, 0xBA, 0xFF, 0xAF, 0xDB, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_AudioDevice_SpeechProcessingSupported, + 0xFB1DE864, 0xE06D, 0x47F4, 0x82, 0xA6, 0x8A, 0x0A, 0xEF, 0x44, 0x49, 0x3C, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_BatteryLife, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 10} +DEFINE_PROPERTYKEY!{PKEY_Devices_BatteryPlusCharging, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 22} +DEFINE_PROPERTYKEY!{PKEY_Devices_BatteryPlusChargingText, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 23} +DEFINE_PROPERTYKEY!{PKEY_Devices_Category, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 91} +DEFINE_PROPERTYKEY!{PKEY_Devices_CategoryGroup, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 94} +DEFINE_PROPERTYKEY!{PKEY_Devices_CategoryIds, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 90} +DEFINE_PROPERTYKEY!{PKEY_Devices_CategoryPlural, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 92} +DEFINE_PROPERTYKEY!{PKEY_Devices_ChargingState, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 11} +DEFINE_PROPERTYKEY!{PKEY_Devices_Children, + 0x4340A6C5, 0x93FA, 0x4706, 0x97, 0x2C, 0x7B, 0x64, 0x80, 0x08, 0xA5, 0xA7, 9} +DEFINE_PROPERTYKEY!{PKEY_Devices_ClassGuid, + 0xA45C254E, 0xDF1C, 0x4EFD, 0x80, 0x20, 0x67, 0xD1, 0x46, 0xA8, 0x50, 0xE0, 10} +DEFINE_PROPERTYKEY!{PKEY_Devices_CompatibleIds, + 0xA45C254E, 0xDF1C, 0x4EFD, 0x80, 0x20, 0x67, 0xD1, 0x46, 0xA8, 0x50, 0xE0, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_Connected, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 55} +DEFINE_PROPERTYKEY!{PKEY_Devices_ContainerId, + 0x8C7ED206, 0x3F8A, 0x4827, 0xB3, 0xAB, 0xAE, 0x9E, 0x1F, 0xAE, 0xFC, 0x6C, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_DefaultTooltip, + 0x880F70A2, 0x6082, 0x47AC, 0x8A, 0xAB, 0xA7, 0x39, 0xD1, 0xA3, 0x00, 0xC3, 153} +DEFINE_PROPERTYKEY!{PKEY_Devices_DeviceCapabilities, + 0xA45C254E, 0xDF1C, 0x4EFD, 0x80, 0x20, 0x67, 0xD1, 0x46, 0xA8, 0x50, 0xE0, 17} +DEFINE_PROPERTYKEY!{PKEY_Devices_DeviceCharacteristics, + 0xA45C254E, 0xDF1C, 0x4EFD, 0x80, 0x20, 0x67, 0xD1, 0x46, 0xA8, 0x50, 0xE0, 29} +DEFINE_PROPERTYKEY!{PKEY_Devices_DeviceDescription1, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 81} +DEFINE_PROPERTYKEY!{PKEY_Devices_DeviceDescription2, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 82} +DEFINE_PROPERTYKEY!{PKEY_Devices_DeviceHasProblem, + 0x540B947E, 0x8B40, 0x45BC, 0xA8, 0xA2, 0x6A, 0x0B, 0x89, 0x4C, 0xBD, 0xA2, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_DeviceInstanceId, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 256} +DEFINE_PROPERTYKEY!{PKEY_Devices_DeviceManufacturer, + 0xA45C254E, 0xDF1C, 0x4EFD, 0x80, 0x20, 0x67, 0xD1, 0x46, 0xA8, 0x50, 0xE0, 13} +DEFINE_PROPERTYKEY!{PKEY_Devices_DevObjectType, + 0x13673F42, 0xA3D6, 0x49F6, 0xB4, 0xDA, 0xAE, 0x46, 0xE0, 0xC5, 0x23, 0x7C, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_DialProtocol_InstalledApplications, + 0x6845CC72, 0x1B71, 0x48C3, 0xAF, 0x86, 0xB0, 0x91, 0x71, 0xA1, 0x9B, 0x14, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_DiscoveryMethod, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 52} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_Domain, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_FullName, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_HostName, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 7} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_InstanceName, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_NetworkAdapterId, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 11} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_PortNumber, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 12} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_Priority, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 9} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_ServiceName, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_TextAttributes, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_Ttl, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 10} +DEFINE_PROPERTYKEY!{PKEY_Devices_Dnssd_Weight, + 0xBF79C0AB, 0xBB74, 0x4CEE, 0xB0, 0x70, 0x47, 0x0B, 0x5A, 0xE2, 0x02, 0xEA, 8} +DEFINE_PROPERTYKEY!{PKEY_Devices_FriendlyName, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 12288} +DEFINE_PROPERTYKEY!{PKEY_Devices_FunctionPaths, + 0xD08DD4C0, 0x3A9E, 0x462E, 0x82, 0x90, 0x7B, 0x63, 0x6B, 0x25, 0x76, 0xB9, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_GlyphIcon, + 0x51236583, 0x0C4A, 0x4FE8, 0xB8, 0x1F, 0x16, 0x6A, 0xEC, 0x13, 0xF5, 0x10, 123} +DEFINE_PROPERTYKEY!{PKEY_Devices_HardwareIds, + 0xA45C254E, 0xDF1C, 0x4EFD, 0x80, 0x20, 0x67, 0xD1, 0x46, 0xA8, 0x50, 0xE0, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_Icon, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 57} +DEFINE_PROPERTYKEY!{PKEY_Devices_InLocalMachineContainer, + 0x8C7ED206, 0x3F8A, 0x4827, 0xB3, 0xAB, 0xAE, 0x9E, 0x1F, 0xAE, 0xFC, 0x6C, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_InterfaceClassGuid, + 0x026E516E, 0xB814, 0x414B, 0x83, 0xCD, 0x85, 0x6D, 0x6F, 0xEF, 0x48, 0x22, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_InterfaceEnabled, + 0x026E516E, 0xB814, 0x414B, 0x83, 0xCD, 0x85, 0x6D, 0x6F, 0xEF, 0x48, 0x22, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_InterfacePaths, + 0xD08DD4C0, 0x3A9E, 0x462E, 0x82, 0x90, 0x7B, 0x63, 0x6B, 0x25, 0x76, 0xB9, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_IpAddress, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 12297} +DEFINE_PROPERTYKEY!{PKEY_Devices_IsDefault, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 86} +DEFINE_PROPERTYKEY!{PKEY_Devices_IsNetworkConnected, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 85} +DEFINE_PROPERTYKEY!{PKEY_Devices_IsShared, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 84} +DEFINE_PROPERTYKEY!{PKEY_Devices_IsSoftwareInstalling, + 0x83DA6326, 0x97A6, 0x4088, 0x94, 0x53, 0xA1, 0x92, 0x3F, 0x57, 0x3B, 0x29, 9} +DEFINE_PROPERTYKEY!{PKEY_Devices_LaunchDeviceStageFromExplorer, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 77} +DEFINE_PROPERTYKEY!{PKEY_Devices_LocalMachine, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 70} +DEFINE_PROPERTYKEY!{PKEY_Devices_LocationPaths, + 0xA45C254E, 0xDF1C, 0x4EFD, 0x80, 0x20, 0x67, 0xD1, 0x46, 0xA8, 0x50, 0xE0, 37} +DEFINE_PROPERTYKEY!{PKEY_Devices_Manufacturer, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8192} +DEFINE_PROPERTYKEY!{PKEY_Devices_MetadataPath, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 71} +DEFINE_PROPERTYKEY!{PKEY_Devices_MicrophoneArray_Geometry, + 0xA1829EA2, 0x27EB, 0x459E, 0x93, 0x5D, 0xB2, 0xFA, 0xD7, 0xB0, 0x77, 0x62, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_MissedCalls, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_ModelId, + 0x80D81EA6, 0x7473, 0x4B0C, 0x82, 0x16, 0xEF, 0xC1, 0x1A, 0x2C, 0x4C, 0x8B, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_ModelName, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8194} +DEFINE_PROPERTYKEY!{PKEY_Devices_ModelNumber, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8195} +DEFINE_PROPERTYKEY!{PKEY_Devices_NetworkedTooltip, + 0x880F70A2, 0x6082, 0x47AC, 0x8A, 0xAB, 0xA7, 0x39, 0xD1, 0xA3, 0x00, 0xC3, 152} +DEFINE_PROPERTYKEY!{PKEY_Devices_NetworkName, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 7} +DEFINE_PROPERTYKEY!{PKEY_Devices_NetworkType, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 8} +DEFINE_PROPERTYKEY!{PKEY_Devices_NewPictures, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_Notification, + 0x06704B0C, 0xE830, 0x4C81, 0x91, 0x78, 0x91, 0xE4, 0xE9, 0x5A, 0x80, 0xA0, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_Notifications_LowBattery, + 0xC4C07F2B, 0x8524, 0x4E66, 0xAE, 0x3A, 0xA6, 0x23, 0x5F, 0x10, 0x3B, 0xEB, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Notifications_MissedCall, + 0x6614EF48, 0x4EFE, 0x4424, 0x9E, 0xDA, 0xC7, 0x9F, 0x40, 0x4E, 0xDF, 0x3E, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Notifications_NewMessage, + 0x2BE9260A, 0x2012, 0x4742, 0xA5, 0x55, 0xF4, 0x1B, 0x63, 0x8B, 0x7D, 0xCB, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Notifications_NewVoicemail, + 0x59569556, 0x0A08, 0x4212, 0x95, 0xB9, 0xFA, 0xE2, 0xAD, 0x64, 0x13, 0xDB, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Notifications_StorageFull, + 0xA0E00EE1, 0xF0C7, 0x4D41, 0xB8, 0xE7, 0x26, 0xA7, 0xBD, 0x8D, 0x38, 0xB0, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Notifications_StorageFullLinkText, + 0xA0E00EE1, 0xF0C7, 0x4D41, 0xB8, 0xE7, 0x26, 0xA7, 0xBD, 0x8D, 0x38, 0xB0, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_NotificationStore, + 0x06704B0C, 0xE830, 0x4C81, 0x91, 0x78, 0x91, 0xE4, 0xE9, 0x5A, 0x80, 0xA0, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_NotWorkingProperly, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 83} +DEFINE_PROPERTYKEY!{PKEY_Devices_Paired, + 0x78C34FC8, 0x104A, 0x4ACA, 0x9E, 0xA4, 0x52, 0x4D, 0x52, 0x99, 0x6E, 0x57, 56} +DEFINE_PROPERTYKEY!{PKEY_Devices_Parent, + 0x4340A6C5, 0x93FA, 0x4706, 0x97, 0x2C, 0x7B, 0x64, 0x80, 0x08, 0xA5, 0xA7, 8} +DEFINE_PROPERTYKEY!{PKEY_Devices_PhysicalDeviceLocation, + 0x540B947E, 0x8B40, 0x45BC, 0xA8, 0xA2, 0x6A, 0x0B, 0x89, 0x4C, 0xBD, 0xA2, 9} +DEFINE_PROPERTYKEY!{PKEY_Devices_PlaybackPositionPercent, + 0x3633DE59, 0x6825, 0x4381, 0xA4, 0x9B, 0x9F, 0x6B, 0xA1, 0x3A, 0x14, 0x71, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_PlaybackState, + 0x3633DE59, 0x6825, 0x4381, 0xA4, 0x9B, 0x9F, 0x6B, 0xA1, 0x3A, 0x14, 0x71, 2} +pub const PLAYBACKSTATE_UNKNOWN: LONG = 0; +pub const PLAYBACKSTATE_STOPPED: LONG = 1; +pub const PLAYBACKSTATE_PLAYING: LONG = 2; +pub const PLAYBACKSTATE_TRANSITIONING: LONG = 3; +pub const PLAYBACKSTATE_PAUSED: LONG = 4; +pub const PLAYBACKSTATE_RECORDINGPAUSED: LONG = 5; +pub const PLAYBACKSTATE_RECORDING: LONG = 6; +pub const PLAYBACKSTATE_NOMEDIA: LONG = 7; +DEFINE_PROPERTYKEY!{PKEY_Devices_PlaybackTitle, + 0x3633DE59, 0x6825, 0x4381, 0xA4, 0x9B, 0x9F, 0x6B, 0xA1, 0x3A, 0x14, 0x71, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_Present, + 0x540B947E, 0x8B40, 0x45BC, 0xA8, 0xA2, 0x6A, 0x0B, 0x89, 0x4C, 0xBD, 0xA2, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_PresentationUrl, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8198} +DEFINE_PROPERTYKEY!{PKEY_Devices_PrimaryCategory, + 0xD08DD4C0, 0x3A9E, 0x462E, 0x82, 0x90, 0x7B, 0x63, 0x6B, 0x25, 0x76, 0xB9, 10} +DEFINE_PROPERTYKEY!{PKEY_Devices_RemainingDuration, + 0x3633DE59, 0x6825, 0x4381, 0xA4, 0x9B, 0x9F, 0x6B, 0xA1, 0x3A, 0x14, 0x71, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_RestrictedInterface, + 0x026E516E, 0xB814, 0x414B, 0x83, 0xCD, 0x85, 0x6D, 0x6F, 0xEF, 0x48, 0x22, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_Roaming, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 9} +DEFINE_PROPERTYKEY!{PKEY_Devices_SafeRemovalRequired, + 0xAFD97640, 0x86A3, 0x4210, 0xB6, 0x7C, 0x28, 0x9C, 0x41, 0xAA, 0xBE, 0x55, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_ServiceAddress, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 16384} +DEFINE_PROPERTYKEY!{PKEY_Devices_ServiceId, + 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 16385} +DEFINE_PROPERTYKEY!{PKEY_Devices_SharedTooltip, + 0x880F70A2, 0x6082, 0x47AC, 0x8A, 0xAB, 0xA7, 0x39, 0xD1, 0xA3, 0x00, 0xC3, 151} +DEFINE_PROPERTYKEY!{PKEY_Devices_SignalStrength, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_SmartCards_ReaderKind, + 0xD6B5B883, 0x18BD, 0x4B4D, 0xB2, 0xEC, 0x9E, 0x38, 0xAF, 0xFE, 0xDA, 0x82, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Status, + 0xD08DD4C0, 0x3A9E, 0x462E, 0x82, 0x90, 0x7B, 0x63, 0x6B, 0x25, 0x76, 0xB9, 259} +DEFINE_PROPERTYKEY!{PKEY_Devices_Status1, + 0xD08DD4C0, 0x3A9E, 0x462E, 0x82, 0x90, 0x7B, 0x63, 0x6B, 0x25, 0x76, 0xB9, 257} +DEFINE_PROPERTYKEY!{PKEY_Devices_Status2, + 0xD08DD4C0, 0x3A9E, 0x462E, 0x82, 0x90, 0x7B, 0x63, 0x6B, 0x25, 0x76, 0xB9, 258} +DEFINE_PROPERTYKEY!{PKEY_Devices_StorageCapacity, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 12} +DEFINE_PROPERTYKEY!{PKEY_Devices_StorageFreeSpace, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 13} +DEFINE_PROPERTYKEY!{PKEY_Devices_StorageFreeSpacePercent, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 14} +DEFINE_PROPERTYKEY!{PKEY_Devices_TextMessages, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_Voicemail, + 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiaDeviceType, + 0x6BDD1FC6, 0x810F, 0x11D0, 0xBE, 0xC7, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFi_InterfaceGuid, + 0xEF1167EB, 0xCBFC, 0x4341, 0xA5, 0x68, 0xA7, 0xC9, 0x1A, 0x68, 0x98, 0x2C, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_DeviceAddress, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 13} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_GroupId, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_InformationElements, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 12} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_InterfaceAddress, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_InterfaceGuid, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_IsConnected, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_IsLegacyDevice, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 7} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_IsMiracastLcpSupported, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 9} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_IsVisible, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_MiracastVersion, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 8} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_Services, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 10} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_SupportedChannelList, + 0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 11} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirectServices_AdvertisementId, + 0x31B37743, 0x7C5E, 0x4005, 0x93, 0xE6, 0xE9, 0x53, 0xF9, 0x2B, 0x82, 0xE9, 5} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirectServices_RequestServiceInformation, + 0x31B37743, 0x7C5E, 0x4005, 0x93, 0xE6, 0xE9, 0x53, 0xF9, 0x2B, 0x82, 0xE9, 7} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirectServices_ServiceAddress, + 0x31B37743, 0x7C5E, 0x4005, 0x93, 0xE6, 0xE9, 0x53, 0xF9, 0x2B, 0x82, 0xE9, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirectServices_ServiceConfigMethods, + 0x31B37743, 0x7C5E, 0x4005, 0x93, 0xE6, 0xE9, 0x53, 0xF9, 0x2B, 0x82, 0xE9, 6} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirectServices_ServiceInformation, + 0x31B37743, 0x7C5E, 0x4005, 0x93, 0xE6, 0xE9, 0x53, 0xF9, 0x2B, 0x82, 0xE9, 4} +DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirectServices_ServiceName, + 0x31B37743, 0x7C5E, 0x4005, 0x93, 0xE6, 0xE9, 0x53, 0xF9, 0x2B, 0x82, 0xE9, 3} +DEFINE_PROPERTYKEY!{PKEY_Devices_WinPhone8CameraFlags, + 0xB7B4D61C, 0x5A64, 0x4187, 0xA5, 0x2E, 0xB1, 0x53, 0x9F, 0x35, 0x90, 0x99, 2} +DEFINE_PROPERTYKEY!{PKEY_Devices_Wwan_InterfaceGuid, + 0xFF1167EB, 0xCBFC, 0x4341, 0xA5, 0x68, 0xA7, 0xC9, 0x1A, 0x68, 0x98, 0x2C, 2} +DEFINE_PROPERTYKEY!{PKEY_Storage_Portable, + 0x4D1EBEE8, 0x0803, 0x4774, 0x98, 0x42, 0xB7, 0x7D, 0xB5, 0x02, 0x65, 0xE9, 2} +DEFINE_PROPERTYKEY!{PKEY_Storage_RemovableMedia, + 0x4D1EBEE8, 0x0803, 0x4774, 0x98, 0x42, 0xB7, 0x7D, 0xB5, 0x02, 0x65, 0xE9, 3} +DEFINE_PROPERTYKEY!{PKEY_Storage_SystemCritical, + 0x4D1EBEE8, 0x0803, 0x4774, 0x98, 0x42, 0xB7, 0x7D, 0xB5, 0x02, 0x65, 0xE9, 4} +DEFINE_PROPERTYKEY!{PKEY_Document_ByteCount, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 4} +DEFINE_PROPERTYKEY!{PKEY_Document_CharacterCount, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 16} +DEFINE_PROPERTYKEY!{PKEY_Document_ClientID, + 0x276D7BB0, 0x5B34, 0x4FB0, 0xAA, 0x4B, 0x15, 0x8E, 0xD1, 0x2A, 0x18, 0x09, 100} +DEFINE_PROPERTYKEY!{PKEY_Document_Contributor, + 0xF334115E, 0xDA1B, 0x4509, 0x9B, 0x3D, 0x11, 0x95, 0x04, 0xDC, 0x7A, 0xBB, 100} +DEFINE_PROPERTYKEY!{PKEY_Document_DateCreated, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 12} +DEFINE_PROPERTYKEY!{PKEY_Document_DatePrinted, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 11} +DEFINE_PROPERTYKEY!{PKEY_Document_DateSaved, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 13} +DEFINE_PROPERTYKEY!{PKEY_Document_Division, + 0x1E005EE6, 0xBF27, 0x428B, 0xB0, 0x1C, 0x79, 0x67, 0x6A, 0xCD, 0x28, 0x70, 100} +DEFINE_PROPERTYKEY!{PKEY_Document_DocumentID, + 0xE08805C8, 0xE395, 0x40DF, 0x80, 0xD2, 0x54, 0xF0, 0xD6, 0xC4, 0x31, 0x54, 100} +DEFINE_PROPERTYKEY!{PKEY_Document_HiddenSlideCount, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 9} +DEFINE_PROPERTYKEY!{PKEY_Document_LastAuthor, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 8} +DEFINE_PROPERTYKEY!{PKEY_Document_LineCount, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 5} +DEFINE_PROPERTYKEY!{PKEY_Document_Manager, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 14} +DEFINE_PROPERTYKEY!{PKEY_Document_MultimediaClipCount, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 10} +DEFINE_PROPERTYKEY!{PKEY_Document_NoteCount, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 8} +DEFINE_PROPERTYKEY!{PKEY_Document_PageCount, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 14} +DEFINE_PROPERTYKEY!{PKEY_Document_ParagraphCount, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 6} +DEFINE_PROPERTYKEY!{PKEY_Document_PresentationFormat, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 3} +DEFINE_PROPERTYKEY!{PKEY_Document_RevisionNumber, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 9} +DEFINE_PROPERTYKEY!{PKEY_Document_Security, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 19} +DEFINE_PROPERTYKEY!{PKEY_Document_SlideCount, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 7} +DEFINE_PROPERTYKEY!{PKEY_Document_Template, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 7} +DEFINE_PROPERTYKEY!{PKEY_Document_TotalEditingTime, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 10} +DEFINE_PROPERTYKEY!{PKEY_Document_Version, + 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE, 29} +DEFINE_PROPERTYKEY!{PKEY_Document_WordCount, + 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 15} +DEFINE_PROPERTYKEY!{PKEY_DRM_DatePlayExpires, + 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 6} +DEFINE_PROPERTYKEY!{PKEY_DRM_DatePlayStarts, + 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 5} +DEFINE_PROPERTYKEY!{PKEY_DRM_Description, + 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 3} +DEFINE_PROPERTYKEY!{PKEY_DRM_IsDisabled, + 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 7} +DEFINE_PROPERTYKEY!{PKEY_DRM_IsProtected, + 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 2} +DEFINE_PROPERTYKEY!{PKEY_DRM_PlayCount, + 0xAEAC19E4, 0x89AE, 0x4508, 0xB9, 0xB7, 0xBB, 0x86, 0x7A, 0xBE, 0xE2, 0xED, 4} +DEFINE_PROPERTYKEY!{PKEY_GPS_Altitude, + 0x827EDB4F, 0x5B73, 0x44A7, 0x89, 0x1D, 0xFD, 0xFF, 0xAB, 0xEA, 0x35, 0xCA, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_AltitudeDenominator, + 0x78342DCB, 0xE358, 0x4145, 0xAE, 0x9A, 0x6B, 0xFE, 0x4E, 0x0F, 0x9F, 0x51, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_AltitudeNumerator, + 0x2DAD1EB7, 0x816D, 0x40D3, 0x9E, 0xC3, 0xC9, 0x77, 0x3B, 0xE2, 0xAA, 0xDE, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_AltitudeRef, + 0x46AC629D, 0x75EA, 0x4515, 0x86, 0x7F, 0x6D, 0xC4, 0x32, 0x1C, 0x58, 0x44, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_AreaInformation, + 0x972E333E, 0xAC7E, 0x49F1, 0x8A, 0xDF, 0xA7, 0x0D, 0x07, 0xA9, 0xBC, 0xAB, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_Date, + 0x3602C812, 0x0F3B, 0x45F0, 0x85, 0xAD, 0x60, 0x34, 0x68, 0xD6, 0x94, 0x23, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestBearing, + 0xC66D4B3C, 0xE888, 0x47CC, 0xB9, 0x9F, 0x9D, 0xCA, 0x3E, 0xE3, 0x4D, 0xEA, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestBearingDenominator, + 0x7ABCF4F8, 0x7C3F, 0x4988, 0xAC, 0x91, 0x8D, 0x2C, 0x2E, 0x97, 0xEC, 0xA5, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestBearingNumerator, + 0xBA3B1DA9, 0x86EE, 0x4B5D, 0xA2, 0xA4, 0xA2, 0x71, 0xA4, 0x29, 0xF0, 0xCF, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestBearingRef, + 0x9AB84393, 0x2A0F, 0x4B75, 0xBB, 0x22, 0x72, 0x79, 0x78, 0x69, 0x77, 0xCB, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestDistance, + 0xA93EAE04, 0x6804, 0x4F24, 0xAC, 0x81, 0x09, 0xB2, 0x66, 0x45, 0x21, 0x18, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestDistanceDenominator, + 0x9BC2C99B, 0xAC71, 0x4127, 0x9D, 0x1C, 0x25, 0x96, 0xD0, 0xD7, 0xDC, 0xB7, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestDistanceNumerator, + 0x2BDA47DA, 0x08C6, 0x4FE1, 0x80, 0xBC, 0xA7, 0x2F, 0xC5, 0x17, 0xC5, 0xD0, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestDistanceRef, + 0xED4DF2D3, 0x8695, 0x450B, 0x85, 0x6F, 0xF5, 0xC1, 0xC5, 0x3A, 0xCB, 0x66, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestLatitude, + 0x9D1D7CC5, 0x5C39, 0x451C, 0x86, 0xB3, 0x92, 0x8E, 0x2D, 0x18, 0xCC, 0x47, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestLatitudeDenominator, + 0x3A372292, 0x7FCA, 0x49A7, 0x99, 0xD5, 0xE4, 0x7B, 0xB2, 0xD4, 0xE7, 0xAB, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestLatitudeNumerator, + 0xECF4B6F6, 0xD5A6, 0x433C, 0xBB, 0x92, 0x40, 0x76, 0x65, 0x0F, 0xC8, 0x90, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestLatitudeRef, + 0xCEA820B9, 0xCE61, 0x4885, 0xA1, 0x28, 0x00, 0x5D, 0x90, 0x87, 0xC1, 0x92, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestLongitude, + 0x47A96261, 0xCB4C, 0x4807, 0x8A, 0xD3, 0x40, 0xB9, 0xD9, 0xDB, 0xC6, 0xBC, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestLongitudeDenominator, + 0x425D69E5, 0x48AD, 0x4900, 0x8D, 0x80, 0x6E, 0xB6, 0xB8, 0xD0, 0xAC, 0x86, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestLongitudeNumerator, + 0xA3250282, 0xFB6D, 0x48D5, 0x9A, 0x89, 0xDB, 0xCA, 0xCE, 0x75, 0xCC, 0xCF, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DestLongitudeRef, + 0x182C1EA6, 0x7C1C, 0x4083, 0xAB, 0x4B, 0xAC, 0x6C, 0x9F, 0x4E, 0xD1, 0x28, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_Differential, + 0xAAF4EE25, 0xBD3B, 0x4DD7, 0xBF, 0xC4, 0x47, 0xF7, 0x7B, 0xB0, 0x0F, 0x6D, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DOP, + 0x0CF8FB02, 0x1837, 0x42F1, 0xA6, 0x97, 0xA7, 0x01, 0x7A, 0xA2, 0x89, 0xB9, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DOPDenominator, + 0xA0BE94C5, 0x50BA, 0x487B, 0xBD, 0x35, 0x06, 0x54, 0xBE, 0x88, 0x81, 0xED, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_DOPNumerator, + 0x47166B16, 0x364F, 0x4AA0, 0x9F, 0x31, 0xE2, 0xAB, 0x3D, 0xF4, 0x49, 0xC3, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_ImgDirection, + 0x16473C91, 0xD017, 0x4ED9, 0xBA, 0x4D, 0xB6, 0xBA, 0xA5, 0x5D, 0xBC, 0xF8, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_ImgDirectionDenominator, + 0x10B24595, 0x41A2, 0x4E20, 0x93, 0xC2, 0x57, 0x61, 0xC1, 0x39, 0x5F, 0x32, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_ImgDirectionNumerator, + 0xDC5877C7, 0x225F, 0x45F7, 0xBA, 0xC7, 0xE8, 0x13, 0x34, 0xB6, 0x13, 0x0A, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_ImgDirectionRef, + 0xA4AAA5B7, 0x1AD0, 0x445F, 0x81, 0x1A, 0x0F, 0x8F, 0x6E, 0x67, 0xF6, 0xB5, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_Latitude, + 0x8727CFFF, 0x4868, 0x4EC6, 0xAD, 0x5B, 0x81, 0xB9, 0x85, 0x21, 0xD1, 0xAB, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_LatitudeDecimal, + 0x0F55CDE2, 0x4F49, 0x450D, 0x92, 0xC1, 0xDC, 0xD1, 0x63, 0x01, 0xB1, 0xB7, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_LatitudeDenominator, + 0x16E634EE, 0x2BFF, 0x497B, 0xBD, 0x8A, 0x43, 0x41, 0xAD, 0x39, 0xEE, 0xB9, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_LatitudeNumerator, + 0x7DDAAAD1, 0xCCC8, 0x41AE, 0xB7, 0x50, 0xB2, 0xCB, 0x80, 0x31, 0xAE, 0xA2, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_LatitudeRef, + 0x029C0252, 0x5B86, 0x46C7, 0xAC, 0xA0, 0x27, 0x69, 0xFF, 0xC8, 0xE3, 0xD4, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_Longitude, + 0xC4C4DBB2, 0xB593, 0x466B, 0xBB, 0xDA, 0xD0, 0x3D, 0x27, 0xD5, 0xE4, 0x3A, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_LongitudeDecimal, + 0x4679C1B5, 0x844D, 0x4590, 0xBA, 0xF5, 0xF3, 0x22, 0x23, 0x1F, 0x1B, 0x81, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_LongitudeDenominator, + 0xBE6E176C, 0x4534, 0x4D2C, 0xAC, 0xE5, 0x31, 0xDE, 0xDA, 0xC1, 0x60, 0x6B, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_LongitudeNumerator, + 0x02B0F689, 0xA914, 0x4E45, 0x82, 0x1D, 0x1D, 0xDA, 0x45, 0x2E, 0xD2, 0xC4, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_LongitudeRef, + 0x33DCF22B, 0x28D5, 0x464C, 0x80, 0x35, 0x1E, 0xE9, 0xEF, 0xD2, 0x52, 0x78, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_MapDatum, + 0x2CA2DAE6, 0xEDDC, 0x407D, 0xBE, 0xF1, 0x77, 0x39, 0x42, 0xAB, 0xFA, 0x95, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_MeasureMode, + 0xA015ED5D, 0xAAEA, 0x4D58, 0x8A, 0x86, 0x3C, 0x58, 0x69, 0x20, 0xEA, 0x0B, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_ProcessingMethod, + 0x59D49E61, 0x840F, 0x4AA9, 0xA9, 0x39, 0xE2, 0x09, 0x9B, 0x7F, 0x63, 0x99, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_Satellites, + 0x467EE575, 0x1F25, 0x4557, 0xAD, 0x4E, 0xB8, 0xB5, 0x8B, 0x0D, 0x9C, 0x15, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_Speed, + 0xDA5D0862, 0x6E76, 0x4E1B, 0xBA, 0xBD, 0x70, 0x02, 0x1B, 0xD2, 0x54, 0x94, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_SpeedDenominator, + 0x7D122D5A, 0xAE5E, 0x4335, 0x88, 0x41, 0xD7, 0x1E, 0x7C, 0xE7, 0x2F, 0x53, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_SpeedNumerator, + 0xACC9CE3D, 0xC213, 0x4942, 0x8B, 0x48, 0x6D, 0x08, 0x20, 0xF2, 0x1C, 0x6D, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_SpeedRef, + 0xECF7F4C9, 0x544F, 0x4D6D, 0x9D, 0x98, 0x8A, 0xD7, 0x9A, 0xDA, 0xF4, 0x53, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_Status, + 0x125491F4, 0x818F, 0x46B2, 0x91, 0xB5, 0xD5, 0x37, 0x75, 0x36, 0x17, 0xB2, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_Track, + 0x76C09943, 0x7C33, 0x49E3, 0x9E, 0x7E, 0xCD, 0xBA, 0x87, 0x2C, 0xFA, 0xDA, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_TrackDenominator, + 0xC8D1920C, 0x01F6, 0x40C0, 0xAC, 0x86, 0x2F, 0x3A, 0x4A, 0xD0, 0x07, 0x70, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_TrackNumerator, + 0x702926F4, 0x44A6, 0x43E1, 0xAE, 0x71, 0x45, 0x62, 0x71, 0x16, 0x89, 0x3B, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_TrackRef, + 0x35DBE6FE, 0x44C3, 0x4400, 0xAA, 0xAE, 0xD2, 0xC7, 0x99, 0xC4, 0x07, 0xE8, 100} +DEFINE_PROPERTYKEY!{PKEY_GPS_VersionID, + 0x22704DA4, 0xC6B2, 0x4A99, 0x8E, 0x56, 0xF1, 0x6D, 0xF8, 0xC9, 0x25, 0x99, 100} +DEFINE_PROPERTYKEY!{PKEY_History_VisitCount, + 0x5CBF2787, 0x48CF, 0x4208, 0xB9, 0x0E, 0xEE, 0x5E, 0x5D, 0x42, 0x02, 0x94, 7} +DEFINE_PROPERTYKEY!{PKEY_Image_BitDepth, + 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 7} +DEFINE_PROPERTYKEY!{PKEY_Image_ColorSpace, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 40961} +pub const IMAGE_COLORSPACE_SRGB: DWORD = 1; +pub const IMAGE_COLORSPACE_UNCALIBRATED: DWORD = 0xFFFF; +DEFINE_PROPERTYKEY!{PKEY_Image_CompressedBitsPerPixel, + 0x364B6FA9, 0x37AB, 0x482A, 0xBE, 0x2B, 0xAE, 0x02, 0xF6, 0x0D, 0x43, 0x18, 100} +DEFINE_PROPERTYKEY!{PKEY_Image_CompressedBitsPerPixelDenominator, + 0x1F8844E1, 0x24AD, 0x4508, 0x9D, 0xFD, 0x53, 0x26, 0xA4, 0x15, 0xCE, 0x02, 100} +DEFINE_PROPERTYKEY!{PKEY_Image_CompressedBitsPerPixelNumerator, + 0xD21A7148, 0xD32C, 0x4624, 0x89, 0x00, 0x27, 0x72, 0x10, 0xF7, 0x9C, 0x0F, 100} +DEFINE_PROPERTYKEY!{PKEY_Image_Compression, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 259} +pub const IMAGE_COMPRESSION_UNCOMPRESSED: DWORD = 1; +pub const IMAGE_COMPRESSION_CCITT_T3: DWORD = 2; +pub const IMAGE_COMPRESSION_CCITT_T4: DWORD = 3; +pub const IMAGE_COMPRESSION_CCITT_T6: DWORD = 4; +pub const IMAGE_COMPRESSION_LZW: DWORD = 5; +pub const IMAGE_COMPRESSION_JPEG: DWORD = 6; +pub const IMAGE_COMPRESSION_PACKBITS: DWORD = 32773; +DEFINE_PROPERTYKEY!{PKEY_Image_CompressionText, + 0x3F08E66F, 0x2F44, 0x4BB9, 0xA6, 0x82, 0xAC, 0x35, 0xD2, 0x56, 0x23, 0x22, 100} +DEFINE_PROPERTYKEY!{PKEY_Image_Dimensions, + 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 13} +DEFINE_PROPERTYKEY!{PKEY_Image_HorizontalResolution, + 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 5} +DEFINE_PROPERTYKEY!{PKEY_Image_HorizontalSize, + 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 3} +DEFINE_PROPERTYKEY!{PKEY_Image_ImageID, + 0x10DABE05, 0x32AA, 0x4C29, 0xBF, 0x1A, 0x63, 0xE2, 0xD2, 0x20, 0x58, 0x7F, 100} +DEFINE_PROPERTYKEY!{PKEY_Image_ResolutionUnit, + 0x19B51FA6, 0x1F92, 0x4A5C, 0xAB, 0x48, 0x7D, 0xF0, 0xAB, 0xD6, 0x74, 0x44, 100} +DEFINE_PROPERTYKEY!{PKEY_Image_VerticalResolution, + 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 6} +DEFINE_PROPERTYKEY!{PKEY_Image_VerticalSize, + 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 4} +DEFINE_PROPERTYKEY!{PKEY_Journal_Contacts, + 0xDEA7C82C, 0x1D89, 0x4A66, 0x94, 0x27, 0xA4, 0xE3, 0xDE, 0xBA, 0xBC, 0xB1, 100} +DEFINE_PROPERTYKEY!{PKEY_Journal_EntryType, + 0x95BEB1FC, 0x326D, 0x4644, 0xB3, 0x96, 0xCD, 0x3E, 0xD9, 0x0E, 0x6D, 0xDF, 100} +DEFINE_PROPERTYKEY!{PKEY_LayoutPattern_ContentViewModeForBrowse, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 500} +pub const LAYOUTPATTERN_CVMFB_ALPHA: &'static str = "alpha"; +pub const LAYOUTPATTERN_CVMFB_BETA: &'static str = "beta"; +pub const LAYOUTPATTERN_CVMFB_GAMMA: &'static str = "gamma"; +pub const LAYOUTPATTERN_CVMFB_DELTA: &'static str = "delta"; +DEFINE_PROPERTYKEY!{PKEY_LayoutPattern_ContentViewModeForSearch, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 501} +pub const LAYOUTPATTERN_CVMFS_ALPHA: &'static str = "alpha"; +pub const LAYOUTPATTERN_CVMFS_BETA: &'static str = "beta"; +pub const LAYOUTPATTERN_CVMFS_GAMMA: &'static str = "gamma"; +pub const LAYOUTPATTERN_CVMFS_DELTA: &'static str = "delta"; +DEFINE_PROPERTYKEY!{PKEY_History_SelectionCount, + 0x1CE0D6BC, 0x536C, 0x4600, 0xB0, 0xDD, 0x7E, 0x0C, 0x66, 0xB3, 0x50, 0xD5, 8} +DEFINE_PROPERTYKEY!{PKEY_History_TargetUrlHostName, + 0x1CE0D6BC, 0x536C, 0x4600, 0xB0, 0xDD, 0x7E, 0x0C, 0x66, 0xB3, 0x50, 0xD5, 9} +DEFINE_PROPERTYKEY!{PKEY_Link_Arguments, + 0x436F2667, 0x14E2, 0x4FEB, 0xB3, 0x0A, 0x14, 0x6C, 0x53, 0xB5, 0xB6, 0x74, 100} +DEFINE_PROPERTYKEY!{PKEY_Link_Comment, + 0xB9B4B3FC, 0x2B51, 0x4A42, 0xB5, 0xD8, 0x32, 0x41, 0x46, 0xAF, 0xCF, 0x25, 5} +DEFINE_PROPERTYKEY!{PKEY_Link_DateVisited, + 0x5CBF2787, 0x48CF, 0x4208, 0xB9, 0x0E, 0xEE, 0x5E, 0x5D, 0x42, 0x02, 0x94, 23} +DEFINE_PROPERTYKEY!{PKEY_Link_Description, + 0x5CBF2787, 0x48CF, 0x4208, 0xB9, 0x0E, 0xEE, 0x5E, 0x5D, 0x42, 0x02, 0x94, 21} +DEFINE_PROPERTYKEY!{PKEY_Link_FeedItemLocalId, + 0x8A2F99F9, 0x3C37, 0x465D, 0xA8, 0xD7, 0x69, 0x77, 0x7A, 0x24, 0x6D, 0x0C, 2} +DEFINE_PROPERTYKEY!{PKEY_Link_Status, + 0xB9B4B3FC, 0x2B51, 0x4A42, 0xB5, 0xD8, 0x32, 0x41, 0x46, 0xAF, 0xCF, 0x25, 3} +pub const LINK_STATUS_RESOLVED: LONG = 1; +pub const LINK_STATUS_BROKEN: LONG = 2; +DEFINE_PROPERTYKEY!{PKEY_Link_TargetExtension, + 0x7A7D76F4, 0xB630, 0x4BD7, 0x95, 0xFF, 0x37, 0xCC, 0x51, 0xA9, 0x75, 0xC9, 2} +DEFINE_PROPERTYKEY!{PKEY_Link_TargetParsingPath, + 0xB9B4B3FC, 0x2B51, 0x4A42, 0xB5, 0xD8, 0x32, 0x41, 0x46, 0xAF, 0xCF, 0x25, 2} +DEFINE_PROPERTYKEY!{PKEY_Link_TargetSFGAOFlags, + 0xB9B4B3FC, 0x2B51, 0x4A42, 0xB5, 0xD8, 0x32, 0x41, 0x46, 0xAF, 0xCF, 0x25, 8} +DEFINE_PROPERTYKEY!{PKEY_Link_TargetUrlHostName, + 0x8A2F99F9, 0x3C37, 0x465D, 0xA8, 0xD7, 0x69, 0x77, 0x7A, 0x24, 0x6D, 0x0C, 5} +DEFINE_PROPERTYKEY!{PKEY_Link_TargetUrlPath, + 0x8A2F99F9, 0x3C37, 0x465D, 0xA8, 0xD7, 0x69, 0x77, 0x7A, 0x24, 0x6D, 0x0C, 6} +DEFINE_PROPERTYKEY!{PKEY_Media_AuthorUrl, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 32} +DEFINE_PROPERTYKEY!{PKEY_Media_AverageLevel, + 0x09EDD5B6, 0xB301, 0x43C5, 0x99, 0x90, 0xD0, 0x03, 0x02, 0xEF, 0xFD, 0x46, 100} +DEFINE_PROPERTYKEY!{PKEY_Media_ClassPrimaryID, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 13} +DEFINE_PROPERTYKEY!{PKEY_Media_ClassSecondaryID, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 14} +DEFINE_PROPERTYKEY!{PKEY_Media_CollectionGroupID, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 24} +DEFINE_PROPERTYKEY!{PKEY_Media_CollectionID, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 25} +DEFINE_PROPERTYKEY!{PKEY_Media_ContentDistributor, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 18} +DEFINE_PROPERTYKEY!{PKEY_Media_ContentID, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 26} +DEFINE_PROPERTYKEY!{PKEY_Media_CreatorApplication, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 27} +DEFINE_PROPERTYKEY!{PKEY_Media_CreatorApplicationVersion, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 28} +DEFINE_PROPERTYKEY!{PKEY_Media_DateEncoded, + 0x2E4B640D, 0x5019, 0x46D8, 0x88, 0x81, 0x55, 0x41, 0x4C, 0xC5, 0xCA, 0xA0, 100} +DEFINE_PROPERTYKEY!{PKEY_Media_DateReleased, + 0xDE41CC29, 0x6971, 0x4290, 0xB4, 0x72, 0xF5, 0x9F, 0x2E, 0x2F, 0x31, 0xE2, 100} +DEFINE_PROPERTYKEY!{PKEY_Media_DlnaProfileID, + 0xCFA31B45, 0x525D, 0x4998, 0xBB, 0x44, 0x3F, 0x7D, 0x81, 0x54, 0x2F, 0xA4, 100} +DEFINE_PROPERTYKEY!{PKEY_Media_Duration, + 0x64440490, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 3} +DEFINE_PROPERTYKEY!{PKEY_Media_DVDID, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 15} +DEFINE_PROPERTYKEY!{PKEY_Media_EncodedBy, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 36} +DEFINE_PROPERTYKEY!{PKEY_Media_EncodingSettings, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 37} +DEFINE_PROPERTYKEY!{PKEY_Media_EpisodeNumber, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 100} +DEFINE_PROPERTYKEY!{PKEY_Media_FrameCount, + 0x6444048F, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 12} +DEFINE_PROPERTYKEY!{PKEY_Media_MCDI, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 16} +DEFINE_PROPERTYKEY!{PKEY_Media_MetadataContentProvider, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 17} +DEFINE_PROPERTYKEY!{PKEY_Media_Producer, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 22} +DEFINE_PROPERTYKEY!{PKEY_Media_PromotionUrl, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 33} +DEFINE_PROPERTYKEY!{PKEY_Media_ProtectionType, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 38} +DEFINE_PROPERTYKEY!{PKEY_Media_ProviderRating, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 39} +DEFINE_PROPERTYKEY!{PKEY_Media_ProviderStyle, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 40} +DEFINE_PROPERTYKEY!{PKEY_Media_Publisher, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 30} +DEFINE_PROPERTYKEY!{PKEY_Media_SeasonNumber, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 101} +DEFINE_PROPERTYKEY!{PKEY_Media_SeriesName, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 42} +DEFINE_PROPERTYKEY!{PKEY_Media_SubscriptionContentId, + 0x9AEBAE7A, 0x9644, 0x487D, 0xA9, 0x2C, 0x65, 0x75, 0x85, 0xED, 0x75, 0x1A, 100} +DEFINE_PROPERTYKEY!{PKEY_Media_SubTitle, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 38} +DEFINE_PROPERTYKEY!{PKEY_Media_ThumbnailLargePath, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 47} +DEFINE_PROPERTYKEY!{PKEY_Media_ThumbnailLargeUri, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 48} +DEFINE_PROPERTYKEY!{PKEY_Media_ThumbnailSmallPath, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 49} +DEFINE_PROPERTYKEY!{PKEY_Media_ThumbnailSmallUri, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 50} +DEFINE_PROPERTYKEY!{PKEY_Media_UniqueFileIdentifier, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 35} +DEFINE_PROPERTYKEY!{PKEY_Media_UserNoAutoInfo, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 41} +DEFINE_PROPERTYKEY!{PKEY_Media_UserWebUrl, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 34} +DEFINE_PROPERTYKEY!{PKEY_Media_Writer, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 23} +DEFINE_PROPERTYKEY!{PKEY_Media_Year, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 5} +DEFINE_PROPERTYKEY!{PKEY_Message_AttachmentContents, + 0x3143BF7C, 0x80A8, 0x4854, 0x88, 0x80, 0xE2, 0xE4, 0x01, 0x89, 0xBD, 0xD0, 100} +DEFINE_PROPERTYKEY!{PKEY_Message_AttachmentNames, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 21} +DEFINE_PROPERTYKEY!{PKEY_Message_BccAddress, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 2} +DEFINE_PROPERTYKEY!{PKEY_Message_BccName, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 3} +DEFINE_PROPERTYKEY!{PKEY_Message_CcAddress, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 4} +DEFINE_PROPERTYKEY!{PKEY_Message_CcName, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 5} +DEFINE_PROPERTYKEY!{PKEY_Message_ConversationID, + 0xDC8F80BD, 0xAF1E, 0x4289, 0x85, 0xB6, 0x3D, 0xFC, 0x1B, 0x49, 0x39, 0x92, 100} +DEFINE_PROPERTYKEY!{PKEY_Message_ConversationIndex, + 0xDC8F80BD, 0xAF1E, 0x4289, 0x85, 0xB6, 0x3D, 0xFC, 0x1B, 0x49, 0x39, 0x92, 101} +DEFINE_PROPERTYKEY!{PKEY_Message_DateReceived, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 20} +DEFINE_PROPERTYKEY!{PKEY_Message_DateSent, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 19} +DEFINE_PROPERTYKEY!{PKEY_Message_Flags, + 0xA82D9EE7, 0xCA67, 0x4312, 0x96, 0x5E, 0x22, 0x6B, 0xCE, 0xA8, 0x50, 0x23, 100} +DEFINE_PROPERTYKEY!{PKEY_Message_FromAddress, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 13} +DEFINE_PROPERTYKEY!{PKEY_Message_FromName, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 14} +DEFINE_PROPERTYKEY!{PKEY_Message_HasAttachments, + 0x9C1FCF74, 0x2D97, 0x41BA, 0xB4, 0xAE, 0xCB, 0x2E, 0x36, 0x61, 0xA6, 0xE4, 8} +DEFINE_PROPERTYKEY!{PKEY_Message_IsFwdOrReply, + 0x9A9BC088, 0x4F6D, 0x469E, 0x99, 0x19, 0xE7, 0x05, 0x41, 0x20, 0x40, 0xF9, 100} +DEFINE_PROPERTYKEY!{PKEY_Message_MessageClass, + 0xCD9ED458, 0x08CE, 0x418F, 0xA7, 0x0E, 0xF9, 0x12, 0xC7, 0xBB, 0x9C, 0x5C, 103} +DEFINE_PROPERTYKEY!{PKEY_Message_Participants, + 0x1A9BA605, 0x8E7C, 0x4D11, 0xAD, 0x7D, 0xA5, 0x0A, 0xDA, 0x18, 0xBA, 0x1B, 2} +DEFINE_PROPERTYKEY!{PKEY_Message_ProofInProgress, + 0x9098F33C, 0x9A7D, 0x48A8, 0x8D, 0xE5, 0x2E, 0x12, 0x27, 0xA6, 0x4E, 0x91, 100} +DEFINE_PROPERTYKEY!{PKEY_Message_SenderAddress, + 0x0BE1C8E7, 0x1981, 0x4676, 0xAE, 0x14, 0xFD, 0xD7, 0x8F, 0x05, 0xA6, 0xE7, 100} +DEFINE_PROPERTYKEY!{PKEY_Message_SenderName, + 0x0DA41CFA, 0xD224, 0x4A18, 0xAE, 0x2F, 0x59, 0x61, 0x58, 0xDB, 0x4B, 0x3A, 100} +DEFINE_PROPERTYKEY!{PKEY_Message_Store, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 15} +DEFINE_PROPERTYKEY!{PKEY_Message_ToAddress, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 16} +DEFINE_PROPERTYKEY!{PKEY_Message_ToDoFlags, + 0x1F856A9F, 0x6900, 0x4ABA, 0x95, 0x05, 0x2D, 0x5F, 0x1B, 0x4D, 0x66, 0xCB, 100} +DEFINE_PROPERTYKEY!{PKEY_Message_ToDoTitle, + 0xBCCC8A3C, 0x8CEF, 0x42E5, 0x9B, 0x1C, 0xC6, 0x90, 0x79, 0x39, 0x8B, 0xC7, 100} +DEFINE_PROPERTYKEY!{PKEY_Message_ToName, + 0xE3E0584C, 0xB788, 0x4A5A, 0xBB, 0x20, 0x7F, 0x5A, 0x44, 0xC9, 0xAC, 0xDD, 17} +DEFINE_PROPERTYKEY!{PKEY_Music_AlbumArtist, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 13} +DEFINE_PROPERTYKEY!{PKEY_Music_AlbumArtistSortOverride, + 0xF1FDB4AF, 0xF78C, 0x466C, 0xBB, 0x05, 0x56, 0xE9, 0x2D, 0xB0, 0xB8, 0xEC, 103} +DEFINE_PROPERTYKEY!{PKEY_Music_AlbumID, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 100} +DEFINE_PROPERTYKEY!{PKEY_Music_AlbumTitle, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 4} +DEFINE_PROPERTYKEY!{PKEY_Music_AlbumTitleSortOverride, + 0x13EB7FFC, 0xEC89, 0x4346, 0xB1, 0x9D, 0xCC, 0xC6, 0xF1, 0x78, 0x42, 0x23, 101} +DEFINE_PROPERTYKEY!{PKEY_Music_Artist, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 2} +DEFINE_PROPERTYKEY!{PKEY_Music_ArtistSortOverride, + 0xDEEB2DB5, 0x0696, 0x4CE0, 0x94, 0xFE, 0xA0, 0x1F, 0x77, 0xA4, 0x5F, 0xB5, 102} +DEFINE_PROPERTYKEY!{PKEY_Music_BeatsPerMinute, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 35} +DEFINE_PROPERTYKEY!{PKEY_Music_Composer, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 19} +DEFINE_PROPERTYKEY!{PKEY_Music_ComposerSortOverride, + 0x00BC20A3, 0xBD48, 0x4085, 0x87, 0x2C, 0xA8, 0x8D, 0x77, 0xF5, 0x09, 0x7E, 105} +DEFINE_PROPERTYKEY!{PKEY_Music_Conductor, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 36} +DEFINE_PROPERTYKEY!{PKEY_Music_ContentGroupDescription, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 33} +DEFINE_PROPERTYKEY!{PKEY_Music_DiscNumber, + 0x6AFE7437, 0x9BCD, 0x49C7, 0x80, 0xFE, 0x4A, 0x5C, 0x65, 0xFA, 0x58, 0x74, 104} +DEFINE_PROPERTYKEY!{PKEY_Music_DisplayArtist, + 0xFD122953, 0xFA93, 0x4EF7, 0x92, 0xC3, 0x04, 0xC9, 0x46, 0xB2, 0xF7, 0xC8, 100} +DEFINE_PROPERTYKEY!{PKEY_Music_Genre, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 11} +DEFINE_PROPERTYKEY!{PKEY_Music_InitialKey, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 34} +DEFINE_PROPERTYKEY!{PKEY_Music_IsCompilation, + 0xC449D5CB, 0x9EA4, 0x4809, 0x82, 0xE8, 0xAF, 0x9D, 0x59, 0xDE, 0xD6, 0xD1, 100} +DEFINE_PROPERTYKEY!{PKEY_Music_Lyrics, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 12} +DEFINE_PROPERTYKEY!{PKEY_Music_Mood, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 39} +DEFINE_PROPERTYKEY!{PKEY_Music_PartOfSet, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 37} +DEFINE_PROPERTYKEY!{PKEY_Music_Period, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 31} +DEFINE_PROPERTYKEY!{PKEY_Music_SynchronizedLyrics, + 0x6B223B6A, 0x162E, 0x4AA9, 0xB3, 0x9F, 0x05, 0xD6, 0x78, 0xFC, 0x6D, 0x77, 100} +DEFINE_PROPERTYKEY!{PKEY_Music_TrackNumber, + 0x56A3372E, 0xCE9C, 0x11D2, 0x9F, 0x0E, 0x00, 0x60, 0x97, 0xC6, 0x86, 0xF6, 7} +DEFINE_PROPERTYKEY!{PKEY_Note_Color, + 0x4776CAFA, 0xBCE4, 0x4CB1, 0xA2, 0x3E, 0x26, 0x5E, 0x76, 0xD8, 0xEB, 0x11, 100} +pub const NOTE_COLOR_BLUE: DWORD = 0; +pub const NOTE_COLOR_GREEN: DWORD = 1; +pub const NOTE_COLOR_PINK: DWORD = 2; +pub const NOTE_COLOR_YELLOW: DWORD = 3; +pub const NOTE_COLOR_WHITE: DWORD = 4; +pub const NOTE_COLOR_LIGHTGREEN: DWORD = 5; +DEFINE_PROPERTYKEY!{PKEY_Note_ColorText, + 0x46B4E8DE, 0xCDB2, 0x440D, 0x88, 0x5C, 0x16, 0x58, 0xEB, 0x65, 0xB9, 0x14, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_Aperture, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37378} +DEFINE_PROPERTYKEY!{PKEY_Photo_ApertureDenominator, + 0xE1A9A38B, 0x6685, 0x46BD, 0x87, 0x5E, 0x57, 0x0D, 0xC7, 0xAD, 0x73, 0x20, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ApertureNumerator, + 0x0337ECEC, 0x39FB, 0x4581, 0xA0, 0xBD, 0x4C, 0x4C, 0xC5, 0x1E, 0x99, 0x14, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_Brightness, + 0x1A701BF6, 0x478C, 0x4361, 0x83, 0xAB, 0x37, 0x01, 0xBB, 0x05, 0x3C, 0x58, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_BrightnessDenominator, + 0x6EBE6946, 0x2321, 0x440A, 0x90, 0xF0, 0xC0, 0x43, 0xEF, 0xD3, 0x24, 0x76, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_BrightnessNumerator, + 0x9E7D118F, 0xB314, 0x45A0, 0x8C, 0xFB, 0xD6, 0x54, 0xB9, 0x17, 0xC9, 0xE9, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_CameraManufacturer, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 271} +DEFINE_PROPERTYKEY!{PKEY_Photo_CameraModel, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 272} +DEFINE_PROPERTYKEY!{PKEY_Photo_CameraSerialNumber, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 273} +DEFINE_PROPERTYKEY!{PKEY_Photo_Contrast, + 0x2A785BA9, 0x8D23, 0x4DED, 0x82, 0xE6, 0x60, 0xA3, 0x50, 0xC8, 0x6A, 0x10, 100} +pub const PHOTO_CONTRAST_NORMAL: DWORD = 0; +pub const PHOTO_CONTRAST_SOFT: DWORD = 1; +pub const PHOTO_CONTRAST_HARD: DWORD = 2; +DEFINE_PROPERTYKEY!{PKEY_Photo_ContrastText, + 0x59DDE9F2, 0x5253, 0x40EA, 0x9A, 0x8B, 0x47, 0x9E, 0x96, 0xC6, 0x24, 0x9A, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_DateTaken, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 36867} +DEFINE_PROPERTYKEY!{PKEY_Photo_DigitalZoom, + 0xF85BF840, 0xA925, 0x4BC2, 0xB0, 0xC4, 0x8E, 0x36, 0xB5, 0x98, 0x67, 0x9E, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_DigitalZoomDenominator, + 0x745BAF0E, 0xE5C1, 0x4CFB, 0x8A, 0x1B, 0xD0, 0x31, 0xA0, 0xA5, 0x23, 0x93, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_DigitalZoomNumerator, + 0x16CBB924, 0x6500, 0x473B, 0xA5, 0xBE, 0xF1, 0x59, 0x9B, 0xCB, 0xE4, 0x13, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_Event, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 18248} +DEFINE_PROPERTYKEY!{PKEY_Photo_EXIFVersion, + 0xD35F743A, 0xEB2E, 0x47F2, 0xA2, 0x86, 0x84, 0x41, 0x32, 0xCB, 0x14, 0x27, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureBias, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37380} +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureBiasDenominator, + 0xAB205E50, 0x04B7, 0x461C, 0xA1, 0x8C, 0x2F, 0x23, 0x38, 0x36, 0xE6, 0x27, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureBiasNumerator, + 0x738BF284, 0x1D87, 0x420B, 0x92, 0xCF, 0x58, 0x34, 0xBF, 0x6E, 0xF9, 0xED, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureIndex, + 0x967B5AF8, 0x995A, 0x46ED, 0x9E, 0x11, 0x35, 0xB3, 0xC5, 0xB9, 0x78, 0x2D, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureIndexDenominator, + 0x93112F89, 0xC28B, 0x492F, 0x8A, 0x9D, 0x4B, 0xE2, 0x06, 0x2C, 0xEE, 0x8A, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureIndexNumerator, + 0xCDEDCF30, 0x8919, 0x44DF, 0x8F, 0x4C, 0x4E, 0xB2, 0xFF, 0xDB, 0x8D, 0x89, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureProgram, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 34850} +pub const PHOTO_EXPOSUREPROGRAM_UNKNOWN: DWORD = 0; +pub const PHOTO_EXPOSUREPROGRAM_MANUAL: DWORD = 1; +pub const PHOTO_EXPOSUREPROGRAM_NORMAL: DWORD = 2; +pub const PHOTO_EXPOSUREPROGRAM_APERTURE: DWORD = 3; +pub const PHOTO_EXPOSUREPROGRAM_SHUTTER: DWORD = 4; +pub const PHOTO_EXPOSUREPROGRAM_CREATIVE: DWORD = 5; +pub const PHOTO_EXPOSUREPROGRAM_ACTION: DWORD = 6; +pub const PHOTO_EXPOSUREPROGRAM_PORTRAIT: DWORD = 7; +pub const PHOTO_EXPOSUREPROGRAM_LANDSCAPE: DWORD = 8; +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureProgramText, + 0xFEC690B7, 0x5F30, 0x4646, 0xAE, 0x47, 0x4C, 0xAA, 0xFB, 0xA8, 0x84, 0xA3, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureTime, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 33434} +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureTimeDenominator, + 0x55E98597, 0xAD16, 0x42E0, 0xB6, 0x24, 0x21, 0x59, 0x9A, 0x19, 0x98, 0x38, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ExposureTimeNumerator, + 0x257E44E2, 0x9031, 0x4323, 0xAC, 0x38, 0x85, 0xC5, 0x52, 0x87, 0x1B, 0x2E, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_Flash, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37385} +pub const PHOTO_FLASH_NONE: LONG = 0; +pub const PHOTO_FLASH_FLASH: LONG = 1; +pub const PHOTO_FLASH_WITHOUTSTROBE: LONG = 5; +pub const PHOTO_FLASH_WITHSTROBE: LONG = 7; +pub const PHOTO_FLASH_FLASH_COMPULSORY: LONG = 9; +pub const PHOTO_FLASH_FLASH_COMPULSORY_NORETURNLIGHT: LONG = 13; +pub const PHOTO_FLASH_FLASH_COMPULSORY_RETURNLIGHT: LONG = 15; +pub const PHOTO_FLASH_NONE_COMPULSORY: LONG = 16; +pub const PHOTO_FLASH_NONE_AUTO: LONG = 24; +pub const PHOTO_FLASH_FLASH_AUTO: LONG = 25; +pub const PHOTO_FLASH_FLASH_AUTO_NORETURNLIGHT: LONG = 29; +pub const PHOTO_FLASH_FLASH_AUTO_RETURNLIGHT: LONG = 31; +pub const PHOTO_FLASH_NOFUNCTION: LONG = 32; +pub const PHOTO_FLASH_FLASH_REDEYE: LONG = 65; +pub const PHOTO_FLASH_FLASH_REDEYE_NORETURNLIGHT: LONG = 69; +pub const PHOTO_FLASH_FLASH_REDEYE_RETURNLIGHT: LONG = 71; +pub const PHOTO_FLASH_FLASH_COMPULSORY_REDEYE: LONG = 73; +pub const PHOTO_FLASH_FLASH_COMPULSORY_REDEYE_NORETURNLIGHT: LONG = 77; +pub const PHOTO_FLASH_FLASH_COMPULSORY_REDEYE_RETURNLIGHT: LONG = 79; +pub const PHOTO_FLASH_FLASH_AUTO_REDEYE: LONG = 89; +pub const PHOTO_FLASH_FLASH_AUTO_REDEYE_NORETURNLIGHT: LONG = 93; +pub const PHOTO_FLASH_FLASH_AUTO_REDEYE_RETURNLIGHT: LONG = 95; +DEFINE_PROPERTYKEY!{PKEY_Photo_FlashEnergy, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 41483} +DEFINE_PROPERTYKEY!{PKEY_Photo_FlashEnergyDenominator, + 0xD7B61C70, 0x6323, 0x49CD, 0xA5, 0xFC, 0xC8, 0x42, 0x77, 0x16, 0x2C, 0x97, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FlashEnergyNumerator, + 0xFCAD3D3D, 0x0858, 0x400F, 0xAA, 0xA3, 0x2F, 0x66, 0xCC, 0xE2, 0xA6, 0xBC, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FlashManufacturer, + 0xAABAF6C9, 0xE0C5, 0x4719, 0x85, 0x85, 0x57, 0xB1, 0x03, 0xE5, 0x84, 0xFE, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FlashModel, + 0xFE83BB35, 0x4D1A, 0x42E2, 0x91, 0x6B, 0x06, 0xF3, 0xE1, 0xAF, 0x71, 0x9E, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FlashText, + 0x6B8B68F6, 0x200B, 0x47EA, 0x8D, 0x25, 0xD8, 0x05, 0x0F, 0x57, 0x33, 0x9F, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FNumber, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 33437} +DEFINE_PROPERTYKEY!{PKEY_Photo_FNumberDenominator, + 0xE92A2496, 0x223B, 0x4463, 0xA4, 0xE3, 0x30, 0xEA, 0xBB, 0xA7, 0x9D, 0x80, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FNumberNumerator, + 0x1B97738A, 0xFDFC, 0x462F, 0x9D, 0x93, 0x19, 0x57, 0xE0, 0x8B, 0xE9, 0x0C, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FocalLength, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37386} +DEFINE_PROPERTYKEY!{PKEY_Photo_FocalLengthDenominator, + 0x305BC615, 0xDCA1, 0x44A5, 0x9F, 0xD4, 0x10, 0xC0, 0xBA, 0x79, 0x41, 0x2E, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FocalLengthInFilm, + 0xA0E74609, 0xB84D, 0x4F49, 0xB8, 0x60, 0x46, 0x2B, 0xD9, 0x97, 0x1F, 0x98, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FocalLengthNumerator, + 0x776B6B3B, 0x1E3D, 0x4B0C, 0x9A, 0x0E, 0x8F, 0xBA, 0xF2, 0xA8, 0x49, 0x2A, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FocalPlaneXResolution, + 0xCFC08D97, 0xC6F7, 0x4484, 0x89, 0xDD, 0xEB, 0xEF, 0x43, 0x56, 0xFE, 0x76, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FocalPlaneXResolutionDenominator, + 0x0933F3F5, 0x4786, 0x4F46, 0xA8, 0xE8, 0xD6, 0x4D, 0xD3, 0x7F, 0xA5, 0x21, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FocalPlaneXResolutionNumerator, + 0xDCCB10AF, 0xB4E2, 0x4B88, 0x95, 0xF9, 0x03, 0x1B, 0x4D, 0x5A, 0xB4, 0x90, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FocalPlaneYResolution, + 0x4FFFE4D0, 0x914F, 0x4AC4, 0x8D, 0x6F, 0xC9, 0xC6, 0x1D, 0xE1, 0x69, 0xB1, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FocalPlaneYResolutionDenominator, + 0x1D6179A6, 0xA876, 0x4031, 0xB0, 0x13, 0x33, 0x47, 0xB2, 0xB6, 0x4D, 0xC8, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_FocalPlaneYResolutionNumerator, + 0xA2E541C5, 0x4440, 0x4BA8, 0x86, 0x7E, 0x75, 0xCF, 0xC0, 0x68, 0x28, 0xCD, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_GainControl, + 0xFA304789, 0x00C7, 0x4D80, 0x90, 0x4A, 0x1E, 0x4D, 0xCC, 0x72, 0x65, 0xAA, 100} +pub const PHOTO_GAINCONTROL_NONE: DOUBLE = 0.0; +pub const PHOTO_GAINCONTROL_LOWGAINUP: DOUBLE = 1.0; +pub const PHOTO_GAINCONTROL_HIGHGAINUP: DOUBLE = 2.0; +pub const PHOTO_GAINCONTROL_LOWGAINDOWN: DOUBLE = 3.0; +pub const PHOTO_GAINCONTROL_HIGHGAINDOWN: DOUBLE = 4.0; +DEFINE_PROPERTYKEY!{PKEY_Photo_GainControlDenominator, + 0x42864DFD, 0x9DA4, 0x4F77, 0xBD, 0xED, 0x4A, 0xAD, 0x7B, 0x25, 0x67, 0x35, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_GainControlNumerator, + 0x8E8ECF7C, 0xB7B8, 0x4EB8, 0xA6, 0x3F, 0x0E, 0xE7, 0x15, 0xC9, 0x6F, 0x9E, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_GainControlText, + 0xC06238B2, 0x0BF9, 0x4279, 0xA7, 0x23, 0x25, 0x85, 0x67, 0x15, 0xCB, 0x9D, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ISOSpeed, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 34855} +DEFINE_PROPERTYKEY!{PKEY_Photo_LensManufacturer, + 0xE6DDCAF7, 0x29C5, 0x4F0A, 0x9A, 0x68, 0xD1, 0x94, 0x12, 0xEC, 0x70, 0x90, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_LensModel, + 0xE1277516, 0x2B5F, 0x4869, 0x89, 0xB1, 0x2E, 0x58, 0x5B, 0xD3, 0x8B, 0x7A, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_LightSource, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37384} +pub const PHOTO_LIGHTSOURCE_UNKNOWN: DWORD = 0; +pub const PHOTO_LIGHTSOURCE_DAYLIGHT: DWORD = 1; +pub const PHOTO_LIGHTSOURCE_FLUORESCENT: DWORD = 2; +pub const PHOTO_LIGHTSOURCE_TUNGSTEN: DWORD = 3; +pub const PHOTO_LIGHTSOURCE_STANDARD_A: DWORD = 17; +pub const PHOTO_LIGHTSOURCE_STANDARD_B: DWORD = 18; +pub const PHOTO_LIGHTSOURCE_STANDARD_C: DWORD = 19; +pub const PHOTO_LIGHTSOURCE_D55: DWORD = 20; +pub const PHOTO_LIGHTSOURCE_D65: DWORD = 21; +pub const PHOTO_LIGHTSOURCE_D75: DWORD = 22; +DEFINE_PROPERTYKEY!{PKEY_Photo_MakerNote, + 0xFA303353, 0xB659, 0x4052, 0x85, 0xE9, 0xBC, 0xAC, 0x79, 0x54, 0x9B, 0x84, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_MakerNoteOffset, + 0x813F4124, 0x34E6, 0x4D17, 0xAB, 0x3E, 0x6B, 0x1F, 0x3C, 0x22, 0x47, 0xA1, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_MaxAperture, + 0x08F6D7C2, 0xE3F2, 0x44FC, 0xAF, 0x1E, 0x5A, 0xA5, 0xC8, 0x1A, 0x2D, 0x3E, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_MaxApertureDenominator, + 0xC77724D4, 0x601F, 0x46C5, 0x9B, 0x89, 0xC5, 0x3F, 0x93, 0xBC, 0xEB, 0x77, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_MaxApertureNumerator, + 0xC107E191, 0xA459, 0x44C5, 0x9A, 0xE6, 0xB9, 0x52, 0xAD, 0x4B, 0x90, 0x6D, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_MeteringMode, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37383} +pub const PHOTO_METERINGMODE_UNKNOWN: DWORD = 0; +pub const PHOTO_METERINGMODE_AVERAGE: DWORD = 1; +pub const PHOTO_METERINGMODE_CENTER: DWORD = 2; +pub const PHOTO_METERINGMODE_SPOT: DWORD = 3; +pub const PHOTO_METERINGMODE_MULTISPOT: DWORD = 4; +pub const PHOTO_METERINGMODE_PATTERN: DWORD = 5; +pub const PHOTO_METERINGMODE_PARTIAL: DWORD = 6; +DEFINE_PROPERTYKEY!{PKEY_Photo_MeteringModeText, + 0xF628FD8C, 0x7BA8, 0x465A, 0xA6, 0x5B, 0xC5, 0xAA, 0x79, 0x26, 0x3A, 0x9E, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_Orientation, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 274} +pub const PHOTO_ORIENTATION_NORMAL: DWORD = 1; +pub const PHOTO_ORIENTATION_FLIPHORIZONTAL: DWORD = 2; +pub const PHOTO_ORIENTATION_ROTATE180: DWORD = 3; +pub const PHOTO_ORIENTATION_FLIPVERTICAL: DWORD = 4; +pub const PHOTO_ORIENTATION_TRANSPOSE: DWORD = 5; +pub const PHOTO_ORIENTATION_ROTATE270: DWORD = 6; +pub const PHOTO_ORIENTATION_TRANSVERSE: DWORD = 7; +pub const PHOTO_ORIENTATION_ROTATE90: DWORD = 8; +DEFINE_PROPERTYKEY!{PKEY_Photo_OrientationText, + 0xA9EA193C, 0xC511, 0x498A, 0xA0, 0x6B, 0x58, 0xE2, 0x77, 0x6D, 0xCC, 0x28, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_PeopleNames, + 0xE8309B6E, 0x084C, 0x49B4, 0xB1, 0xFC, 0x90, 0xA8, 0x03, 0x31, 0xB6, 0x38, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_PhotometricInterpretation, + 0x341796F1, 0x1DF9, 0x4B1C, 0xA5, 0x64, 0x91, 0xBD, 0xEF, 0xA4, 0x38, 0x77, 100} +pub const PHOTO_PHOTOMETRIC_RGB: DWORD = 2; +pub const PHOTO_PHOTOMETRIC_YCBCR: DWORD = 6; +DEFINE_PROPERTYKEY!{PKEY_Photo_PhotometricInterpretationText, + 0x821437D6, 0x9EAB, 0x4765, 0xA5, 0x89, 0x3B, 0x1C, 0xBB, 0xD2, 0x2A, 0x61, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ProgramMode, + 0x6D217F6D, 0x3F6A, 0x4825, 0xB4, 0x70, 0x5F, 0x03, 0xCA, 0x2F, 0xBE, 0x9B, 100} +pub const PHOTO_PROGRAMMODE_NOTDEFINED: DWORD = 0; +pub const PHOTO_PROGRAMMODE_MANUAL: DWORD = 1; +pub const PHOTO_PROGRAMMODE_NORMAL: DWORD = 2; +pub const PHOTO_PROGRAMMODE_APERTURE: DWORD = 3; +pub const PHOTO_PROGRAMMODE_SHUTTER: DWORD = 4; +pub const PHOTO_PROGRAMMODE_CREATIVE: DWORD = 5; +pub const PHOTO_PROGRAMMODE_ACTION: DWORD = 6; +pub const PHOTO_PROGRAMMODE_PORTRAIT: DWORD = 7; +pub const PHOTO_PROGRAMMODE_LANDSCAPE: DWORD = 8; +DEFINE_PROPERTYKEY!{PKEY_Photo_ProgramModeText, + 0x7FE3AA27, 0x2648, 0x42F3, 0x89, 0xB0, 0x45, 0x4E, 0x5C, 0xB1, 0x50, 0xC3, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_RelatedSoundFile, + 0x318A6B45, 0x087F, 0x4DC2, 0xB8, 0xCC, 0x05, 0x35, 0x95, 0x51, 0xFC, 0x9E, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_Saturation, + 0x49237325, 0xA95A, 0x4F67, 0xB2, 0x11, 0x81, 0x6B, 0x2D, 0x45, 0xD2, 0xE0, 100} +pub const PHOTO_SATURATION_NORMAL: DWORD = 0; +pub const PHOTO_SATURATION_LOW: DWORD = 1; +pub const PHOTO_SATURATION_HIGH: DWORD = 2; +DEFINE_PROPERTYKEY!{PKEY_Photo_SaturationText, + 0x61478C08, 0xB600, 0x4A84, 0xBB, 0xE4, 0xE9, 0x9C, 0x45, 0xF0, 0xA0, 0x72, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_Sharpness, + 0xFC6976DB, 0x8349, 0x4970, 0xAE, 0x97, 0xB3, 0xC5, 0x31, 0x6A, 0x08, 0xF0, 100} +pub const PHOTO_SHARPNESS_NORMAL: DWORD = 0; +pub const PHOTO_SHARPNESS_SOFT: DWORD = 1; +pub const PHOTO_SHARPNESS_HARD: DWORD = 2; +DEFINE_PROPERTYKEY!{PKEY_Photo_SharpnessText, + 0x51EC3F47, 0xDD50, 0x421D, 0x87, 0x69, 0x33, 0x4F, 0x50, 0x42, 0x4B, 0x1E, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ShutterSpeed, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37377} +DEFINE_PROPERTYKEY!{PKEY_Photo_ShutterSpeedDenominator, + 0xE13D8975, 0x81C7, 0x4948, 0xAE, 0x3F, 0x37, 0xCA, 0xE1, 0x1E, 0x8F, 0xF7, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_ShutterSpeedNumerator, + 0x16EA4042, 0xD6F4, 0x4BCA, 0x83, 0x49, 0x7C, 0x78, 0xD3, 0x0F, 0xB3, 0x33, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_SubjectDistance, + 0x14B81DA1, 0x0135, 0x4D31, 0x96, 0xD9, 0x6C, 0xBF, 0xC9, 0x67, 0x1A, 0x99, 37382} +DEFINE_PROPERTYKEY!{PKEY_Photo_SubjectDistanceDenominator, + 0x0C840A88, 0xB043, 0x466D, 0x97, 0x66, 0xD4, 0xB2, 0x6D, 0xA3, 0xFA, 0x77, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_SubjectDistanceNumerator, + 0x8AF4961C, 0xF526, 0x43E5, 0xAA, 0x81, 0xDB, 0x76, 0x82, 0x19, 0x17, 0x8D, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_TagViewAggregate, + 0xB812F15D, 0xC2D8, 0x4BBF, 0xBA, 0xCD, 0x79, 0x74, 0x43, 0x46, 0x11, 0x3F, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_TranscodedForSync, + 0x9A8EBB75, 0x6458, 0x4E82, 0xBA, 0xCB, 0x35, 0xC0, 0x09, 0x5B, 0x03, 0xBB, 100} +DEFINE_PROPERTYKEY!{PKEY_Photo_WhiteBalance, + 0xEE3D3D8A, 0x5381, 0x4CFA, 0xB1, 0x3B, 0xAA, 0xF6, 0x6B, 0x5F, 0x4E, 0xC9, 100} +pub const PHOTO_WHITEBALANCE_AUTO: DWORD = 0; +pub const PHOTO_WHITEBALANCE_MANUAL: DWORD = 1; +DEFINE_PROPERTYKEY!{PKEY_Photo_WhiteBalanceText, + 0x6336B95E, 0xC7A7, 0x426D, 0x86, 0xFD, 0x7A, 0xE3, 0xD3, 0x9C, 0x84, 0xB4, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Advanced, + 0x900A403B, 0x097B, 0x4B95, 0x8A, 0xE2, 0x07, 0x1F, 0xDA, 0xEE, 0xB1, 0x18, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Audio, + 0x2804D469, 0x788F, 0x48AA, 0x85, 0x70, 0x71, 0xB9, 0xC1, 0x87, 0xE1, 0x38, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Calendar, + 0x9973D2B5, 0xBFD8, 0x438A, 0xBA, 0x94, 0x53, 0x49, 0xB2, 0x93, 0x18, 0x1A, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Camera, + 0xDE00DE32, 0x547E, 0x4981, 0xAD, 0x4B, 0x54, 0x2F, 0x2E, 0x90, 0x07, 0xD8, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Contact, + 0xDF975FD3, 0x250A, 0x4004, 0x85, 0x8F, 0x34, 0xE2, 0x9A, 0x3E, 0x37, 0xAA, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Content, + 0xD0DAB0BA, 0x368A, 0x4050, 0xA8, 0x82, 0x6C, 0x01, 0x0F, 0xD1, 0x9A, 0x4F, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Description, + 0x8969B275, 0x9475, 0x4E00, 0xA8, 0x87, 0xFF, 0x93, 0xB8, 0xB4, 0x1E, 0x44, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_FileSystem, + 0xE3A7D2C1, 0x80FC, 0x4B40, 0x8F, 0x34, 0x30, 0xEA, 0x11, 0x1B, 0xDC, 0x2E, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_General, + 0xCC301630, 0xB192, 0x4C22, 0xB3, 0x72, 0x9F, 0x4C, 0x6D, 0x33, 0x8E, 0x07, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_GPS, + 0xF3713ADA, 0x90E3, 0x4E11, 0xAA, 0xE5, 0xFD, 0xC1, 0x76, 0x85, 0xB9, 0xBE, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Image, + 0xE3690A87, 0x0FA8, 0x4A2A, 0x9A, 0x9F, 0xFC, 0xE8, 0x82, 0x70, 0x55, 0xAC, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Media, + 0x61872CF7, 0x6B5E, 0x4B4B, 0xAC, 0x2D, 0x59, 0xDA, 0x84, 0x45, 0x92, 0x48, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_MediaAdvanced, + 0x8859A284, 0xDE7E, 0x4642, 0x99, 0xBA, 0xD4, 0x31, 0xD0, 0x44, 0xB1, 0xEC, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Message, + 0x7FD7259D, 0x16B4, 0x4135, 0x9F, 0x97, 0x7C, 0x96, 0xEC, 0xD2, 0xFA, 0x9E, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Music, + 0x68DD6094, 0x7216, 0x40F1, 0xA0, 0x29, 0x43, 0xFE, 0x71, 0x27, 0x04, 0x3F, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Origin, + 0x2598D2FB, 0x5569, 0x4367, 0x95, 0xDF, 0x5C, 0xD3, 0xA1, 0x77, 0xE1, 0xA5, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_PhotoAdvanced, + 0x0CB2BF5A, 0x9EE7, 0x4A86, 0x82, 0x22, 0xF0, 0x1E, 0x07, 0xFD, 0xAD, 0xAF, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_RecordedTV, + 0xE7B33238, 0x6584, 0x4170, 0xA5, 0xC0, 0xAC, 0x25, 0xEF, 0xD9, 0xDA, 0x56, 100} +DEFINE_PROPERTYKEY!{PKEY_PropGroup_Video, + 0xBEBE0920, 0x7671, 0x4C54, 0xA3, 0xEB, 0x49, 0xFD, 0xDF, 0xC1, 0x91, 0xEE, 100} +DEFINE_PROPERTYKEY!{PKEY_InfoTipText, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 17} +DEFINE_PROPERTYKEY!{PKEY_PropList_ConflictPrompt, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 11} +DEFINE_PROPERTYKEY!{PKEY_PropList_ContentViewModeForBrowse, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 13} +DEFINE_PROPERTYKEY!{PKEY_PropList_ContentViewModeForSearch, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 14} +DEFINE_PROPERTYKEY!{PKEY_PropList_ExtendedTileInfo, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 9} +DEFINE_PROPERTYKEY!{PKEY_PropList_FileOperationPrompt, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 10} +DEFINE_PROPERTYKEY!{PKEY_PropList_FullDetails, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 2} +DEFINE_PROPERTYKEY!{PKEY_PropList_InfoTip, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 4} +DEFINE_PROPERTYKEY!{PKEY_PropList_NonPersonal, + 0x49D1091F, 0x082E, 0x493F, 0xB2, 0x3F, 0xD2, 0x30, 0x8A, 0xA9, 0x66, 0x8C, 100} +DEFINE_PROPERTYKEY!{PKEY_PropList_PreviewDetails, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 8} +DEFINE_PROPERTYKEY!{PKEY_PropList_PreviewTitle, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 6} +DEFINE_PROPERTYKEY!{PKEY_PropList_QuickTip, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 5} +DEFINE_PROPERTYKEY!{PKEY_PropList_TileInfo, + 0xC9944A21, 0xA406, 0x48FE, 0x82, 0x25, 0xAE, 0xC7, 0xE2, 0x4C, 0x21, 0x1B, 3} +DEFINE_PROPERTYKEY!{PKEY_PropList_XPDetailsPanel, + 0xF2275480, 0xF782, 0x4291, 0xBD, 0x94, 0xF1, 0x36, 0x93, 0x51, 0x3A, 0xEC, 0} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_ChannelNumber, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 7} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_Credits, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 4} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_DateContentExpires, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 15} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_EpisodeName, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 2} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_IsATSCContent, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 16} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_IsClosedCaptioningAvailable, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 12} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_IsDTVContent, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 17} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_IsHDContent, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 18} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_IsRepeatBroadcast, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 13} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_IsSAP, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 14} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_NetworkAffiliation, + 0x2C53C813, 0xFB63, 0x4E22, 0xA1, 0xAB, 0x0B, 0x33, 0x1C, 0xA1, 0xE2, 0x73, 100} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_OriginalBroadcastDate, + 0x4684FE97, 0x8765, 0x4842, 0x9C, 0x13, 0xF0, 0x06, 0x44, 0x7B, 0x17, 0x8C, 100} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_ProgramDescription, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 3} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_RecordingTime, + 0xA5477F61, 0x7A82, 0x4ECA, 0x9D, 0xDE, 0x98, 0xB6, 0x9B, 0x24, 0x79, 0xB3, 100} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_StationCallSign, + 0x6D748DE2, 0x8D38, 0x4CC3, 0xAC, 0x60, 0xF0, 0x09, 0xB0, 0x57, 0xC5, 0x57, 5} +DEFINE_PROPERTYKEY!{PKEY_RecordedTV_StationName, + 0x1B5439E7, 0xEBA1, 0x4AF8, 0xBD, 0xD7, 0x7A, 0xF1, 0xD4, 0x54, 0x94, 0x93, 100} +DEFINE_PROPERTYKEY!{PKEY_Search_AutoSummary, + 0x560C36C0, 0x503A, 0x11CF, 0xBA, 0xA1, 0x00, 0x00, 0x4C, 0x75, 0x2A, 0x9A, 2} +DEFINE_PROPERTYKEY!{PKEY_Search_ContainerHash, + 0xBCEEE283, 0x35DF, 0x4D53, 0x82, 0x6A, 0xF3, 0x6A, 0x3E, 0xEF, 0xC6, 0xBE, 100} +DEFINE_PROPERTYKEY!{PKEY_Search_Contents, + 0xB725F130, 0x47EF, 0x101A, 0xA5, 0xF1, 0x02, 0x60, 0x8C, 0x9E, 0xEB, 0xAC, 19} +DEFINE_PROPERTYKEY!{PKEY_Search_EntryID, + 0x49691C90, 0x7E17, 0x101A, 0xA9, 0x1C, 0x08, 0x00, 0x2B, 0x2E, 0xCD, 0xA9, 5} +DEFINE_PROPERTYKEY!{PKEY_Search_ExtendedProperties, + 0x7B03B546, 0xFA4F, 0x4A52, 0xA2, 0xFE, 0x03, 0xD5, 0x31, 0x1E, 0x58, 0x65, 100} +DEFINE_PROPERTYKEY!{PKEY_Search_GatherTime, + 0x0B63E350, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 8} +DEFINE_PROPERTYKEY!{PKEY_Search_HitCount, + 0x49691C90, 0x7E17, 0x101A, 0xA9, 0x1C, 0x08, 0x00, 0x2B, 0x2E, 0xCD, 0xA9, 4} +DEFINE_PROPERTYKEY!{PKEY_Search_IsClosedDirectory, + 0x0B63E343, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 23} +DEFINE_PROPERTYKEY!{PKEY_Search_IsFullyContained, + 0x0B63E343, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 24} +DEFINE_PROPERTYKEY!{PKEY_Search_QueryFocusedSummary, + 0x560C36C0, 0x503A, 0x11CF, 0xBA, 0xA1, 0x00, 0x00, 0x4C, 0x75, 0x2A, 0x9A, 3} +DEFINE_PROPERTYKEY!{PKEY_Search_QueryFocusedSummaryWithFallback, + 0x560C36C0, 0x503A, 0x11CF, 0xBA, 0xA1, 0x00, 0x00, 0x4C, 0x75, 0x2A, 0x9A, 4} +DEFINE_PROPERTYKEY!{PKEY_Search_QueryPropertyHits, + 0x49691C90, 0x7E17, 0x101A, 0xA9, 0x1C, 0x08, 0x00, 0x2B, 0x2E, 0xCD, 0xA9, 21} +DEFINE_PROPERTYKEY!{PKEY_Search_Rank, + 0x49691C90, 0x7E17, 0x101A, 0xA9, 0x1C, 0x08, 0x00, 0x2B, 0x2E, 0xCD, 0xA9, 3} +DEFINE_PROPERTYKEY!{PKEY_Search_Store, + 0xA06992B3, 0x8CAF, 0x4ED7, 0xA5, 0x47, 0xB2, 0x59, 0xE3, 0x2A, 0xC9, 0xFC, 100} +DEFINE_PROPERTYKEY!{PKEY_Search_UrlToIndex, + 0x0B63E343, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 2} +DEFINE_PROPERTYKEY!{PKEY_Search_UrlToIndexWithModificationTime, + 0x0B63E343, 0x9CCC, 0x11D0, 0xBC, 0xDB, 0x00, 0x80, 0x5F, 0xCC, 0xCE, 0x04, 12} +DEFINE_PROPERTYKEY!{PKEY_Supplemental_AlbumID, + 0x0C73B141, 0x39D6, 0x4653, 0xA6, 0x83, 0xCA, 0xB2, 0x91, 0xEA, 0xF9, 0x5B, 2} +DEFINE_PROPERTYKEY!{PKEY_Supplemental_ResourceId, + 0x0C73B141, 0x39D6, 0x4653, 0xA6, 0x83, 0xCA, 0xB2, 0x91, 0xEA, 0xF9, 0x5B, 3} +DEFINE_PROPERTYKEY!{PKEY_DescriptionID, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 2} +DEFINE_PROPERTYKEY!{PKEY_InternalName, + 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 5} +DEFINE_PROPERTYKEY!{PKEY_LibraryLocationsCount, + 0x908696C7, 0x8F87, 0x44F2, 0x80, 0xED, 0xA8, 0xC1, 0xC6, 0x89, 0x45, 0x75, 2} +DEFINE_PROPERTYKEY!{PKEY_Link_TargetSFGAOFlagsStrings, + 0xD6942081, 0xD53B, 0x443D, 0xAD, 0x47, 0x5E, 0x05, 0x9D, 0x9C, 0xD2, 0x7A, 3} +DEFINE_PROPERTYKEY!{PKEY_Link_TargetUrl, + 0x5CBF2787, 0x48CF, 0x4208, 0xB9, 0x0E, 0xEE, 0x5E, 0x5D, 0x42, 0x02, 0x94, 2} +DEFINE_PROPERTYKEY!{PKEY_NamespaceCLSID, + 0x28636AA6, 0x953D, 0x11D2, 0xB5, 0xD6, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0, 6} +DEFINE_PROPERTYKEY!{PKEY_Shell_SFGAOFlagsStrings, + 0xD6942081, 0xD53B, 0x443D, 0xAD, 0x47, 0x5E, 0x05, 0x9D, 0x9C, 0xD2, 0x7A, 2} +pub const SFGAOSTR_FILESYS: &'static str = "filesys"; +pub const SFGAOSTR_FILEANC: &'static str = "fileanc"; +pub const SFGAOSTR_STORAGEANC: &'static str = "storageanc"; +pub const SFGAOSTR_STREAM: &'static str = "stream"; +pub const SFGAOSTR_LINK: &'static str = "link"; +pub const SFGAOSTR_HIDDEN: &'static str = "hidden"; +pub const SFGAOSTR_SUPERHIDDEN: &'static str = "superhidden"; +pub const SFGAOSTR_FOLDER: &'static str = "folder"; +pub const SFGAOSTR_NONENUM: &'static str = "nonenum"; +pub const SFGAOSTR_BROWSABLE: &'static str = "browsable"; +pub const SFGAOSTR_SYSTEM: &'static str = "system"; +DEFINE_PROPERTYKEY!{PKEY_StatusBarSelectedItemCount, + 0x26DC287C, 0x6E3D, 0x4BD3, 0xB2, 0xB0, 0x6A, 0x26, 0xBA, 0x2E, 0x34, 0x6D, 3} +DEFINE_PROPERTYKEY!{PKEY_StatusBarViewItemCount, + 0x26DC287C, 0x6E3D, 0x4BD3, 0xB2, 0xB0, 0x6A, 0x26, 0xBA, 0x2E, 0x34, 0x6D, 2} +DEFINE_PROPERTYKEY!{PKEY_AppUserModel_ExcludeFromShowInNewInstall, + 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 8} +DEFINE_PROPERTYKEY!{PKEY_AppUserModel_ID, + 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 5} +DEFINE_PROPERTYKEY!{PKEY_AppUserModel_IsDestListSeparator, + 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 6} +DEFINE_PROPERTYKEY!{PKEY_AppUserModel_IsDualMode, + 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 11} +DEFINE_PROPERTYKEY!{PKEY_AppUserModel_PreventPinning, + 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 9} +DEFINE_PROPERTYKEY!{PKEY_AppUserModel_RelaunchCommand, + 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 2} +DEFINE_PROPERTYKEY!{PKEY_AppUserModel_RelaunchDisplayNameResource, + 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 4} +DEFINE_PROPERTYKEY!{PKEY_AppUserModel_RelaunchIconResource, + 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 3} +DEFINE_PROPERTYKEY!{PKEY_AppUserModel_StartPinOption, + 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 12} +pub const APPUSERMODEL_STARTPINOPTION_DEFAULT: DWORD = 0; +pub const APPUSERMODEL_STARTPINOPTION_NOPINONINSTALL: DWORD = 1; +pub const APPUSERMODEL_STARTPINOPTION_USERPINNED: DWORD = 2; +DEFINE_PROPERTYKEY!{PKEY_AppUserModel_ToastActivatorCLSID, + 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 26} +DEFINE_PROPERTYKEY!{PKEY_EdgeGesture_DisableTouchWhenFullscreen, + 0x32CE38B2, 0x2C9A, 0x41B1, 0x9B, 0xC5, 0xB3, 0x78, 0x43, 0x94, 0xAA, 0x44, 2} +DEFINE_PROPERTYKEY!{PKEY_Software_DateLastUsed, + 0x841E4F90, 0xFF59, 0x4D16, 0x89, 0x47, 0xE8, 0x1B, 0xBF, 0xFA, 0xB3, 0x6D, 16} +DEFINE_PROPERTYKEY!{PKEY_Software_ProductName, + 0x0CEF7D53, 0xFA64, 0x11D1, 0xA2, 0x03, 0x00, 0x00, 0xF8, 0x1F, 0xED, 0xEE, 7} +DEFINE_PROPERTYKEY!{PKEY_Sync_Comments, + 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 13} +DEFINE_PROPERTYKEY!{PKEY_Sync_ConflictDescription, + 0xCE50C159, 0x2FB8, 0x41FD, 0xBE, 0x68, 0xD3, 0xE0, 0x42, 0xE2, 0x74, 0xBC, 4} +DEFINE_PROPERTYKEY!{PKEY_Sync_ConflictFirstLocation, + 0xCE50C159, 0x2FB8, 0x41FD, 0xBE, 0x68, 0xD3, 0xE0, 0x42, 0xE2, 0x74, 0xBC, 6} +DEFINE_PROPERTYKEY!{PKEY_Sync_ConflictSecondLocation, + 0xCE50C159, 0x2FB8, 0x41FD, 0xBE, 0x68, 0xD3, 0xE0, 0x42, 0xE2, 0x74, 0xBC, 7} +DEFINE_PROPERTYKEY!{PKEY_Sync_HandlerCollectionID, + 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 2} +DEFINE_PROPERTYKEY!{PKEY_Sync_HandlerID, + 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 3} +DEFINE_PROPERTYKEY!{PKEY_Sync_HandlerName, + 0xCE50C159, 0x2FB8, 0x41FD, 0xBE, 0x68, 0xD3, 0xE0, 0x42, 0xE2, 0x74, 0xBC, 2} +DEFINE_PROPERTYKEY!{PKEY_Sync_HandlerType, + 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 8} +pub const SYNC_HANDLERTYPE_OTHER: DWORD = 0; +pub const SYNC_HANDLERTYPE_PROGRAMS: DWORD = 1; +pub const SYNC_HANDLERTYPE_DEVICES: DWORD = 2; +pub const SYNC_HANDLERTYPE_FOLDERS: DWORD = 3; +pub const SYNC_HANDLERTYPE_WEBSERVICES: DWORD = 4; +pub const SYNC_HANDLERTYPE_COMPUTERS: DWORD = 5; +DEFINE_PROPERTYKEY!{PKEY_Sync_HandlerTypeLabel, + 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 9} +DEFINE_PROPERTYKEY!{PKEY_Sync_ItemID, + 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 6} +DEFINE_PROPERTYKEY!{PKEY_Sync_ItemName, + 0xCE50C159, 0x2FB8, 0x41FD, 0xBE, 0x68, 0xD3, 0xE0, 0x42, 0xE2, 0x74, 0xBC, 3} +DEFINE_PROPERTYKEY!{PKEY_Sync_ProgressPercentage, + 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 23} +DEFINE_PROPERTYKEY!{PKEY_Sync_State, + 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 24} +pub const SYNC_STATE_NOTSETUP: DWORD = 0; +pub const SYNC_STATE_SYNCNOTRUN: DWORD = 1; +pub const SYNC_STATE_IDLE: DWORD = 2; +pub const SYNC_STATE_ERROR: DWORD = 3; +pub const SYNC_STATE_PENDING: DWORD = 4; +pub const SYNC_STATE_SYNCING: DWORD = 5; +DEFINE_PROPERTYKEY!{PKEY_Sync_Status, + 0x7BD5533E, 0xAF15, 0x44DB, 0xB8, 0xC8, 0xBD, 0x66, 0x24, 0xE1, 0xD0, 0x32, 10} +DEFINE_PROPERTYKEY!{PKEY_Task_BillingInformation, + 0xD37D52C6, 0x261C, 0x4303, 0x82, 0xB3, 0x08, 0xB9, 0x26, 0xAC, 0x6F, 0x12, 100} +DEFINE_PROPERTYKEY!{PKEY_Task_CompletionStatus, + 0x084D8A0A, 0xE6D5, 0x40DE, 0xBF, 0x1F, 0xC8, 0x82, 0x0E, 0x7C, 0x87, 0x7C, 100} +DEFINE_PROPERTYKEY!{PKEY_Task_Owner, + 0x08C7CC5F, 0x60F2, 0x4494, 0xAD, 0x75, 0x55, 0xE3, 0xE0, 0xB5, 0xAD, 0xD0, 100} +DEFINE_PROPERTYKEY!{PKEY_Video_Compression, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 10} +DEFINE_PROPERTYKEY!{PKEY_Video_Director, + 0x64440492, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 20} +DEFINE_PROPERTYKEY!{PKEY_Video_EncodingBitrate, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 8} +DEFINE_PROPERTYKEY!{PKEY_Video_FourCC, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 44} +DEFINE_PROPERTYKEY!{PKEY_Video_FrameHeight, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 4} +DEFINE_PROPERTYKEY!{PKEY_Video_FrameRate, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 6} +DEFINE_PROPERTYKEY!{PKEY_Video_FrameWidth, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 3} +DEFINE_PROPERTYKEY!{PKEY_Video_HorizontalAspectRatio, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 42} +DEFINE_PROPERTYKEY!{PKEY_Video_IsSpherical, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 100} +DEFINE_PROPERTYKEY!{PKEY_Video_IsStereo, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 98} +DEFINE_PROPERTYKEY!{PKEY_Video_Orientation, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 99} +DEFINE_PROPERTYKEY!{PKEY_Video_SampleSize, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 9} +DEFINE_PROPERTYKEY!{PKEY_Video_StreamName, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 2} +DEFINE_PROPERTYKEY!{PKEY_Video_StreamNumber, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 11} +DEFINE_PROPERTYKEY!{PKEY_Video_TotalBitrate, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 43} +DEFINE_PROPERTYKEY!{PKEY_Video_TranscodedForSync, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 46} +DEFINE_PROPERTYKEY!{PKEY_Video_VerticalAspectRatio, + 0x64440491, 0x4C8B, 0x11D1, 0x8B, 0x70, 0x08, 0x00, 0x36, 0xB1, 0x1A, 0x03, 45} +DEFINE_PROPERTYKEY!{PKEY_Volume_FileSystem, + 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 4} +DEFINE_PROPERTYKEY!{PKEY_Volume_IsMappedDrive, + 0x149C0B69, 0x2C2D, 0x48FC, 0x80, 0x8F, 0xD3, 0x18, 0xD7, 0x8C, 0x46, 0x36, 2} +DEFINE_PROPERTYKEY!{PKEY_Volume_IsRoot, + 0x9B174B35, 0x40FF, 0x11D2, 0xA2, 0x7E, 0x00, 0xC0, 0x4F, 0xC3, 0x08, 0x71, 10} diff --git a/bash-5.1/vendor/winapi/src/um/propkeydef.rs b/bash-5.1/vendor/winapi/src/um/propkeydef.rs new file mode 100644 index 0000000000000000000000000000000000000000..bc0924c76b9ba49c125f892501bcc19489edac76 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/propkeydef.rs @@ -0,0 +1,13 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +use shared::guiddef::IsEqualIID; +use shared::wtypes::{PROPERTYKEY, PROPID}; +pub const PID_FIRST_USABLE: PROPID = 2; +pub type REFPROPERTYKEY = *const PROPERTYKEY; +#[inline] +pub fn IsEqualPropertyKey(a: &PROPERTYKEY, b: &PROPERTYKEY) -> bool { + (a.pid == b.pid) && IsEqualIID(&a.fmtid, &b.fmtid) +} diff --git a/bash-5.1/vendor/winapi/src/um/propsys.rs b/bash-5.1/vendor/winapi/src/um/propsys.rs new file mode 100644 index 0000000000000000000000000000000000000000..9a4f6a0ffcc95d119ca035ab600796db4f32c9fa --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/propsys.rs @@ -0,0 +1,46 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::DWORD; +use shared::wtypes::PROPERTYKEY; +use um::propidl::{PROPVARIANT, REFPROPVARIANT}; +use um::propkeydef::REFPROPERTYKEY; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::HRESULT; +pub type IPropertyDescriptionList = IUnknown; // TODO +RIDL!{#[uuid(0x886d8eeb, 0x8cf2, 0x4446, 0x8d, 0x02, 0xcd, 0xba, 0x1d, 0xbd, 0xcf, 0x99)] +interface IPropertyStore(IPropertyStoreVtbl): IUnknown(IUnknownVtbl) { + fn GetCount( + cProps: *mut DWORD, + ) -> HRESULT, + fn GetAt( + iProp: DWORD, + pkey: *mut PROPERTYKEY, + ) -> HRESULT, + fn GetValue( + key: REFPROPERTYKEY, + pv: *mut PROPVARIANT, + ) -> HRESULT, + fn SetValue( + key: REFPROPERTYKEY, + propvar: REFPROPVARIANT, + ) -> HRESULT, + fn Commit() -> HRESULT, +}} +ENUM!{enum GETPROPERTYSTOREFLAGS { + GPS_DEFAULT = 0, + GPS_HANDLERPROPERTIESONLY = 0x1, + GPS_READWRITE = 0x2, + GPS_TEMPORARY = 0x4, + GPS_FASTPROPERTIESONLY = 0x8, + GPS_OPENSLOWITEM = 0x10, + GPS_DELAYCREATION = 0x20, + GPS_BESTEFFORT = 0x40, + GPS_NO_OPLOCK = 0x80, + GPS_PREFERQUERYPROPERTIES = 0x100, + GPS_EXTRINSICPROPERTIES = 0x200, + GPS_EXTRINSICPROPERTIESONLY = 0x400, + GPS_MASK_VALID = 0x7ff, +}} diff --git a/bash-5.1/vendor/winapi/src/um/prsht.rs b/bash-5.1/vendor/winapi/src/um/prsht.rs new file mode 100644 index 0000000000000000000000000000000000000000..25cb9262df119058996043c3944dbd8b5c556e07 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/prsht.rs @@ -0,0 +1,361 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Interface for the Windows Property Sheet Pages +use ctypes::{c_int, c_short}; +use shared::basetsd::INT_PTR; +use shared::minwindef::{BOOL, DWORD, HINSTANCE, LPARAM, LPVOID, LRESULT, UINT, WPARAM}; +use shared::windef::{HBITMAP, HICON, HPALETTE, HWND}; +use um::winnt::{HANDLE, LPCSTR, LPCWSTR}; +use um::winuser::{DLGPROC, LPCDLGTEMPLATEA, NMHDR, WM_USER}; +pub enum PSP {} +pub type HPROPSHEETPAGE = *mut PSP; +FN!{stdcall LPFNPSPCALLBACKA( + hwnd: HWND, + uMsg: UINT, + ppsp: *mut PROPSHEETPAGEA, +) -> UINT} +FN!{stdcall LPFNPSPCALLBACKW( + hwnd: HWND, + uMsg: UINT, + ppsp: *mut PROPSHEETPAGEW, +) -> UINT} +pub const PSP_DEFAULT: DWORD = 0x00000000; +pub const PSP_DLGINDIRECT: DWORD = 0x00000001; +pub const PSP_USEHICON: DWORD = 0x00000002; +pub const PSP_USEICONID: DWORD = 0x00000004; +pub const PSP_USETITLE: DWORD = 0x00000008; +pub const PSP_RTLREADING: DWORD = 0x00000010; +pub const PSP_HASHELP: DWORD = 0x00000020; +pub const PSP_USEREFPARENT: DWORD = 0x00000040; +pub const PSP_USECALLBACK: DWORD = 0x00000080; +pub const PSP_PREMATURE: DWORD = 0x00000400; +pub const PSP_HIDEHEADER: DWORD = 0x00000800; +pub const PSP_USEHEADERTITLE: DWORD = 0x00001000; +pub const PSP_USEHEADERSUBTITLE: DWORD = 0x00002000; +pub const PSP_USEFUSIONCONTEXT: DWORD = 0x00004000; +pub const PSPCB_ADDREF: UINT = 0; +pub const PSPCB_RELEASE: UINT = 1; +pub const PSPCB_CREATE: UINT = 2; +pub type PROPSHEETPAGE_RESOURCE = LPCDLGTEMPLATEA; +UNION!{union PROPSHEETPAGEA_V1_u1 { + [usize; 1], + pszTemplate pszTemplate_mut: LPCSTR, + pResource pResource_mut: PROPSHEETPAGE_RESOURCE, +}} +UNION!{union PROPSHEETPAGEA_V1_u2 { + [usize; 1], + hIcon hIcon_mut: HICON, + pszIcon pszIcon_mut: LPCSTR, +}} +UNION!{union PROPSHEETPAGEA_V4_u3 { + [usize; 1], + hbmHeader hbmHeader_mut: HBITMAP, + pszbmHeader pszbmHeader_mut: LPCSTR, +}} +STRUCT!{struct PROPSHEETPAGEA_V4 { + dwSize: DWORD, + dwFlags: DWORD, + hInstance: HINSTANCE, + u1: PROPSHEETPAGEA_V1_u1, + u2: PROPSHEETPAGEA_V1_u2, + pszTitle: LPCSTR, + pfnDlgProc: DLGPROC, + lParam: LPARAM, + pfnCallback: LPFNPSPCALLBACKA, + pcRefParent: *mut UINT, + pszHeaderTitle: LPCSTR, + pszHeaderSubTitle: LPCSTR, + hActCtx: HANDLE, + u3: PROPSHEETPAGEA_V4_u3, +}} +pub type LPPROPSHEETPAGEA_V4 = *mut PROPSHEETPAGEA_V4; +pub type LPCPROPSHEETPAGEA_V4 = *const PROPSHEETPAGEA_V4; +UNION!{union PROPSHEETPAGEW_V1_u1 { + [usize; 1], + pszTemplate pszTemplate_mut: LPCWSTR, + pResource pResource_mut: PROPSHEETPAGE_RESOURCE, +}} +UNION!{union PROPSHEETPAGEW_V1_u2 { + [usize; 1], + hIcon hIcon_mut: HICON, + pszIcon pszIcon_mut: LPCWSTR, +}} +UNION!{union PROPSHEETPAGEW_V4_u3 { + [usize; 1], + hbmHeader hbmHeader_mut: HBITMAP, + pszbmHeader pszbmHeader_mut: LPCWSTR, +}} +STRUCT!{struct PROPSHEETPAGEW_V4 { + dwSize: DWORD, + dwFlags: DWORD, + hInstance: HINSTANCE, + u1: PROPSHEETPAGEW_V1_u1, + u2: PROPSHEETPAGEW_V1_u2, + pszTitle: LPCWSTR, + pfnDlgProc: DLGPROC, + lParam: LPARAM, + pfnCallback: LPFNPSPCALLBACKW, + pcRefParent: *mut UINT, + pszHeaderTitle: LPCWSTR, + pszHeaderSubTitle: LPCWSTR, + hActCtx: HANDLE, + u3: PROPSHEETPAGEW_V4_u3, +}} +pub type LPPROPSHEETPAGEW_V4 = *mut PROPSHEETPAGEW_V4; +pub type LPCPROPSHEETPAGEW_V4 = *const PROPSHEETPAGEW_V4; +pub type PROPSHEETPAGEA_LATEST = PROPSHEETPAGEA_V4; +pub type PROPSHEETPAGEW_LATEST = PROPSHEETPAGEW_V4; +pub type LPPROPSHEETPAGEA_LATEST = LPPROPSHEETPAGEA_V4; +pub type LPPROPSHEETPAGEW_LATEST = LPPROPSHEETPAGEW_V4; +pub type LPCPROPSHEETPAGEA_LATEST = LPCPROPSHEETPAGEA_V4; +pub type LPCPROPSHEETPAGEW_LATEST = LPCPROPSHEETPAGEW_V4; +pub type PROPSHEETPAGEA = PROPSHEETPAGEA_V4; +pub type PROPSHEETPAGEW = PROPSHEETPAGEW_V4; +pub type LPPROPSHEETPAGEA = LPPROPSHEETPAGEA_V4; +pub type LPPROPSHEETPAGEW = LPPROPSHEETPAGEW_V4; +pub type LPCPROPSHEETPAGEA = LPCPROPSHEETPAGEA_V4; +pub type LPCPROPSHEETPAGEW = LPCPROPSHEETPAGEW_V4; +pub const PSH_DEFAULT: DWORD = 0x00000000; +pub const PSH_PROPTITLE: DWORD = 0x00000001; +pub const PSH_USEHICON: DWORD = 0x00000002; +pub const PSH_USEICONID: DWORD = 0x00000004; +pub const PSH_PROPSHEETPAGE: DWORD = 0x00000008; +pub const PSH_WIZARDHASFINISH: DWORD = 0x00000010; +pub const PSH_WIZARD: DWORD = 0x00000020; +pub const PSH_USEPSTARTPAGE: DWORD = 0x00000040; +pub const PSH_NOAPPLYNOW: DWORD = 0x00000080; +pub const PSH_USECALLBACK: DWORD = 0x00000100; +pub const PSH_HASHELP: DWORD = 0x00000200; +pub const PSH_MODELESS: DWORD = 0x00000400; +pub const PSH_RTLREADING: DWORD = 0x00000800; +pub const PSH_WIZARDCONTEXTHELP: DWORD = 0x00001000; +pub const PSH_WIZARD97: DWORD = 0x01000000; +pub const PSH_WATERMARK: DWORD = 0x00008000; +pub const PSH_USEHBMWATERMARK: DWORD = 0x00010000; +pub const PSH_USEHPLWATERMARK: DWORD = 0x00020000; +pub const PSH_STRETCHWATERMARK: DWORD = 0x00040000; +pub const PSH_HEADER: DWORD = 0x00080000; +pub const PSH_USEHBMHEADER: DWORD = 0x00100000; +pub const PSH_USEPAGELANG: DWORD = 0x00200000; +pub const PSH_WIZARD_LITE: DWORD = 0x00400000; +pub const PSH_NOCONTEXTHELP: DWORD = 0x02000000; +pub const PSH_AEROWIZARD: DWORD = 0x00004000; +pub const PSH_RESIZABLE: DWORD = 0x04000000; +pub const PSH_HEADERBITMAP: DWORD = 0x08000000; +pub const PSH_NOMARGIN: DWORD = 0x10000000; +FN!{stdcall PFNPROPSHEETCALLBACK( + HWND, + UINT, + LPARAM, +) -> c_int} +UNION!{union PROPSHEETHEADERA_V1_u1 { + [usize; 1], + hIcon hIcon_mut: HICON, + pszIcon pszIcon_mut: LPCSTR, +}} +UNION!{union PROPSHEETHEADERA_V1_u2 { + [usize; 1], + nStartPage nStartPage_mut: UINT, + pStartPage pStartPage_mut: LPCSTR, +}} +UNION!{union PROPSHEETHEADERA_V1_u3 { + [usize; 1], + ppsp ppsp_mut: LPCPROPSHEETPAGEA, + phpage phpage_mut: *mut HPROPSHEETPAGE, +}} +UNION!{union PROPSHEETHEADERA_V2_u4 { + [usize; 1], + hbmWatermark hbmWatermark_mut: HBITMAP, + pszbmWatermark pszbmWatermark_mut: LPCSTR, +}} +UNION!{union PROPSHEETHEADERA_V2_u5 { + [usize; 1], + hbmHeader hbmHeader_mut: HBITMAP, + pszbmHeader pszbmHeader_mut: LPCSTR, +}} +STRUCT!{struct PROPSHEETHEADERA_V2 { + dwSize: DWORD, + dwFlags: DWORD, + hwndParent: HWND, + hInstance: HINSTANCE, + u1: PROPSHEETHEADERA_V1_u1, + pszCaption: LPCSTR, + nPages: UINT, + u2: PROPSHEETHEADERA_V1_u2, + u3: PROPSHEETHEADERA_V1_u3, + pfnCallback: PFNPROPSHEETCALLBACK, + u4: PROPSHEETHEADERA_V2_u4, + hplWatermark: HPALETTE, + u5: PROPSHEETHEADERA_V2_u5, +}} +pub type LPPROPSHEETHEADERA_V2 = *mut PROPSHEETHEADERA_V2; +pub type LPCPROPSHEETHEADERA_V2 = *const PROPSHEETHEADERA_V2; +UNION!{union PROPSHEETHEADERW_V1_u1 { + [usize; 1], + hIcon hIcon_mut: HICON, + pszIcon pszIcon_mut: LPCWSTR, +}} +UNION!{union PROPSHEETHEADERW_V1_u2 { + [usize; 1], + nStartPage nStartPage_mut: UINT, + pStartPage pStartPage_mut: LPCWSTR, +}} +UNION!{union PROPSHEETHEADERW_V1_u3 { + [usize; 1], + ppsp ppsp_mut: LPCPROPSHEETPAGEW, + phpage phpage_mut: *mut HPROPSHEETPAGE, +}} +UNION!{union PROPSHEETHEADERW_V2_u4 { + [usize; 1], + hbmWatermark hbmWatermark_mut: HBITMAP, + pszbmWatermark pszbmWatermark_mut: LPCWSTR, +}} +UNION!{union PROPSHEETHEADERW_V2_u5 { + [usize; 1], + hbmHeader hbmHeader_mut: HBITMAP, + pszbmHeader pszbmHeader_mut: LPCWSTR, +}} +STRUCT!{struct PROPSHEETHEADERW_V2 { + dwSize: DWORD, + dwFlags: DWORD, + hwndParent: HWND, + hInstance: HINSTANCE, + u1: PROPSHEETHEADERW_V1_u1, + pszCaption: LPCWSTR, + nPages: UINT, + u2: PROPSHEETHEADERW_V1_u2, + u3: PROPSHEETHEADERW_V1_u3, + pfnCallback: PFNPROPSHEETCALLBACK, + u4: PROPSHEETHEADERW_V2_u4, + hplWatermark: HPALETTE, + u5: PROPSHEETHEADERW_V2_u5, +}} +pub type LPPROPSHEETHEADERW_V2 = *mut PROPSHEETHEADERW_V2; +pub type LPCPROPSHEETHEADERW_V2 = *const PROPSHEETHEADERW_V2; +pub type PROPSHEETHEADERA = PROPSHEETHEADERA_V2; +pub type PROPSHEETHEADERW = PROPSHEETHEADERW_V2; +pub type LPPROPSHEETHEADERA = LPPROPSHEETHEADERA_V2; +pub type LPPROPSHEETHEADERW = LPPROPSHEETHEADERW_V2; +pub type LPCPROPSHEETHEADERA = LPCPROPSHEETHEADERA_V2; +pub type LPCPROPSHEETHEADERW = LPCPROPSHEETHEADERW_V2; +pub const PSCB_INITIALIZED: UINT = 1; +pub const PSCB_PRECREATE: UINT = 2; +pub const PSCB_BUTTONPRESSED: UINT = 3; +extern "system" { + pub fn CreatePropertySheetPageA( + constPropSheetPagePointer: LPCPROPSHEETPAGEA, + ) -> HPROPSHEETPAGE; + pub fn CreatePropertySheetPageW( + constPropSheetPagePointer: LPCPROPSHEETPAGEW, + ) -> HPROPSHEETPAGE; + pub fn DestroyPropertySheetPage( + hPSPage: HPROPSHEETPAGE, + ) -> BOOL; + pub fn PropertySheetA( + lppsph: LPCPROPSHEETHEADERA, + ) -> INT_PTR; + pub fn PropertySheetW( + lppsph: LPCPROPSHEETHEADERW, + ) -> INT_PTR; +} +FN!{stdcall LPFNADDPROPSHEETPAGE( + HPROPSHEETPAGE, + LPARAM, +) -> BOOL} +FN!{stdcall LPFNADDPROPSHEETPAGES( + LPVOID, + LPFNADDPROPSHEETPAGE, + LPARAM, +) -> BOOL} +STRUCT!{struct PSHNOTIFY { + hdr: NMHDR, + lParam: LPARAM, +}} +pub type LPPSHNOTIFY = *mut PSHNOTIFY; +pub const PSN_FIRST: UINT = -200i32 as u32; +pub const PSN_LAST: UINT = -299i32 as u32; +pub const PSN_SETACTIVE: UINT = PSN_FIRST - 0; +pub const PSN_KILLACTIVE: UINT = PSN_FIRST - 1; +pub const PSN_APPLY: UINT = PSN_FIRST - 2; +pub const PSN_RESET: UINT = PSN_FIRST - 3; +pub const PSN_HELP: UINT = PSN_FIRST - 5; +pub const PSN_WIZBACK: UINT = PSN_FIRST - 6; +pub const PSN_WIZNEXT: UINT = PSN_FIRST - 7; +pub const PSN_WIZFINISH: UINT = PSN_FIRST - 8; +pub const PSN_QUERYCANCEL: UINT = PSN_FIRST - 9; +pub const PSN_GETOBJECT: UINT = PSN_FIRST - 10; +pub const PSN_TRANSLATEACCELERATOR: UINT = PSN_FIRST - 12; +pub const PSN_QUERYINITIALFOCUS: UINT = PSN_FIRST - 13; +pub const PSNRET_NOERROR: LRESULT = 0; +pub const PSNRET_INVALID: LRESULT = 1; +pub const PSNRET_INVALID_NOCHANGEPAGE: LRESULT = 2; +pub const PSNRET_MESSAGEHANDLED: LRESULT = 3; +pub const PSM_SETCURSEL: UINT = WM_USER + 101; +pub const PSM_REMOVEPAGE: UINT = WM_USER + 102; +pub const PSM_ADDPAGE: UINT = WM_USER + 103; +pub const PSM_CHANGED: UINT = WM_USER + 104; +pub const PSM_RESTARTWINDOWS: UINT = WM_USER + 105; +pub const PSM_REBOOTSYSTEM: UINT = WM_USER + 106; +pub const PSM_CANCELTOCLOSE: UINT = WM_USER + 107; +pub const PSM_QUERYSIBLINGS: UINT = WM_USER + 108; +pub const PSM_UNCHANGED: UINT = WM_USER + 109; +pub const PSM_APPLY: UINT = WM_USER + 110; +pub const PSM_SETTITLEA: UINT = WM_USER + 111; +pub const PSM_SETTITLEW: UINT = WM_USER + 120; +pub const PSM_SETWIZBUTTONS: UINT = WM_USER + 112; +pub const PSWIZB_BACK: DWORD = 0x00000001; +pub const PSWIZB_NEXT: DWORD = 0x00000002; +pub const PSWIZB_FINISH: DWORD = 0x00000004; +pub const PSWIZB_DISABLEDFINISH: DWORD = 0x00000008; +pub const PSWIZBF_ELEVATIONREQUIRED: WPARAM = 0x00000001; +pub const PSWIZB_CANCEL: DWORD = 0x00000010; +pub const PSM_PRESSBUTTON: UINT = WM_USER + 113; +pub const PSBTN_BACK: c_int = 0; +pub const PSBTN_NEXT: c_int = 1; +pub const PSBTN_FINISH: c_int = 2; +pub const PSBTN_OK: c_int = 3; +pub const PSBTN_APPLYNOW: c_int = 4; +pub const PSBTN_CANCEL: c_int = 5; +pub const PSBTN_HELP: c_int = 6; +pub const PSBTN_MAX: c_int = 6; +pub const PSM_SETCURSELID: UINT = WM_USER + 114; +pub const PSM_SETFINISHTEXTA: UINT = WM_USER + 115; +pub const PSM_SETFINISHTEXTW: UINT = WM_USER + 121; +pub const PSM_GETTABCONTROL: UINT = WM_USER + 116; +pub const PSM_ISDIALOGMESSAGE: UINT = WM_USER + 117; +pub const PSM_GETCURRENTPAGEHWND: UINT = WM_USER + 118; +pub const PSM_INSERTPAGE: UINT = WM_USER + 119; +pub const PSM_SETHEADERTITLEA: UINT = WM_USER + 125; +pub const PSM_SETHEADERTITLEW: UINT = WM_USER + 126; +pub const PSWIZF_SETCOLOR: UINT = -1i32 as u32; +pub const PSM_SETHEADERSUBTITLEA: UINT = WM_USER + 127; +pub const PSM_SETHEADERSUBTITLEW: UINT = WM_USER + 128; +pub const PSM_HWNDTOINDEX: UINT = WM_USER + 129; +pub const PSM_INDEXTOHWND: UINT = WM_USER + 130; +pub const PSM_PAGETOINDEX: UINT = WM_USER + 131; +pub const PSM_INDEXTOPAGE: UINT = WM_USER + 132; +pub const PSM_IDTOINDEX: UINT = WM_USER + 133; +pub const PSM_INDEXTOID: UINT = WM_USER + 134; +pub const PSM_GETRESULT: UINT = WM_USER + 135; +pub const PSM_RECALCPAGESIZES: UINT = WM_USER + 136; +pub const PSM_SETNEXTTEXTW: UINT = WM_USER + 137; +pub const PSM_SHOWWIZBUTTONS: UINT = WM_USER + 138; +pub const PSM_ENABLEWIZBUTTONS: UINT = WM_USER + 139; +pub const PSM_SETBUTTONTEXTW: UINT = WM_USER + 140; +pub const PSM_SETBUTTONTEXT: UINT = PSM_SETBUTTONTEXTW; +pub const ID_PSRESTARTWINDOWS: INT_PTR = 0x2; +pub const ID_PSREBOOTSYSTEM: INT_PTR = ID_PSRESTARTWINDOWS | 0x1; +pub const WIZ_CXDLG: DWORD = 276; +pub const WIZ_CYDLG: DWORD = 140; +pub const WIZ_CXBMP: DWORD = 80; +pub const WIZ_BODYX: DWORD = 92; +pub const WIZ_BODYCX: DWORD = 184; +pub const PROP_SM_CXDLG: c_short = 212; +pub const PROP_SM_CYDLG: c_short = 188; +pub const PROP_MED_CXDLG: c_short = 227; +pub const PROP_MED_CYDLG: c_short = 215; +pub const PROP_LG_CXDLG: c_short = 252; +pub const PROP_LG_CYDLG: c_short = 218; diff --git a/bash-5.1/vendor/winapi/src/um/psapi.rs b/bash-5.1/vendor/winapi/src/um/psapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..eb1adb803dac716236bca397d40271a94a616db1 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/psapi.rs @@ -0,0 +1,422 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! FFI bindings to psapi. +use shared::basetsd::{SIZE_T, ULONG_PTR}; +use shared::minwindef::{BOOL, DWORD, HMODULE, LPDWORD, LPVOID, PDWORD}; +use um::winnt::{HANDLE, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PVOID}; +pub const LIST_MODULES_DEFAULT: DWORD = 0x0; +pub const LIST_MODULES_32BIT: DWORD = 0x01; +pub const LIST_MODULES_64BIT: DWORD = 0x02; +pub const LIST_MODULES_ALL: DWORD = LIST_MODULES_32BIT | LIST_MODULES_64BIT; +extern "system" { + pub fn K32EnumProcesses( + lpidProcess: *mut DWORD, + cb: DWORD, + lpcbNeeded: LPDWORD, + ) -> BOOL; + pub fn K32EnumProcessModules( + hProcess: HANDLE, + lphModule: *mut HMODULE, + cb: DWORD, + lpcbNeeded: LPDWORD, + ) -> BOOL; + pub fn K32EnumProcessModulesEx( + hProcess: HANDLE, + lphModule: *mut HMODULE, + cb: DWORD, + lpcbNeeded: LPDWORD, + dwFilterFlag: DWORD, + ) -> BOOL; + pub fn K32GetModuleBaseNameA( + hProcess: HANDLE, + hModule: HMODULE, + lpBaseName: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32GetModuleBaseNameW( + hProcess: HANDLE, + hModule: HMODULE, + lpBaseName: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32GetModuleFileNameExA( + hProcess: HANDLE, + hModule: HMODULE, + lpFilename: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32GetModuleFileNameExW( + hProcess: HANDLE, + hModule: HMODULE, + lpFilename: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32EmptyWorkingSet( + hProcess: HANDLE, + ) -> BOOL; + pub fn K32QueryWorkingSet( + hProcess: HANDLE, + pv: PVOID, + cb: DWORD, + ) -> BOOL; + pub fn K32QueryWorkingSetEx( + hProcess: HANDLE, + pv: PVOID, + cb: DWORD, + ) -> BOOL; + pub fn K32InitializeProcessForWsWatch( + hProcess: HANDLE, + ) -> BOOL; + pub fn K32GetWsChanges( + hProcess: HANDLE, + lpWatchInfo: PPSAPI_WS_WATCH_INFORMATION, + cb: DWORD, + ) -> BOOL; + pub fn K32GetWsChangesEx( + hProcess: HANDLE, + lpWatchInfoEx: PPSAPI_WS_WATCH_INFORMATION_EX, + cb: PDWORD, + ) -> BOOL; + pub fn K32GetMappedFileNameW( + hProcess: HANDLE, + lpv: LPVOID, + lpFilename: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32GetMappedFileNameA( + hProcess: HANDLE, + lpv: LPVOID, + lpFilename: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32EnumDeviceDrivers( + lpImageBase: *mut LPVOID, + cb: DWORD, + lpcbNeeded: LPDWORD, + ) -> BOOL; + pub fn K32GetDeviceDriverBaseNameA( + ImageBase: LPVOID, + lpFilename: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32GetDeviceDriverBaseNameW( + ImageBase: LPVOID, + lpFilename: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32GetDeviceDriverFileNameA( + ImageBase: LPVOID, + lpFilename: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32GetDeviceDriverFileNameW( + ImageBase: LPVOID, + lpFilename: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32GetPerformanceInfo( + pPerformanceInformation: PPERFORMANCE_INFORMATION, + cb: DWORD, + ) -> BOOL; + pub fn K32EnumPageFilesW( + pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, + pContext: LPVOID, + ) -> BOOL; + pub fn K32EnumPageFilesA( + pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, + pContext: LPVOID, + ) -> BOOL; + pub fn K32GetProcessImageFileNameA( + hProcess: HANDLE, + lpImageFileName: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn K32GetProcessImageFileNameW( + hProcess: HANDLE, + lpImageFileName: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn EnumProcesses( + lpidProcess: *mut DWORD, + cb: DWORD, + lpcbNeeded: LPDWORD, + ) -> BOOL; + pub fn K32GetProcessMemoryInfo( + Process: HANDLE, + ppsmemCounters: PPROCESS_MEMORY_COUNTERS, + cb: DWORD, + ) -> BOOL; + pub fn K32GetModuleInformation( + hProcess: HANDLE, + hModule: HMODULE, + lpmodinfo: LPMODULEINFO, + cb: DWORD, + ) -> BOOL; +} +pub type LPMODULEINFO = *mut MODULEINFO; +pub type PPSAPI_WORKING_SET_INFORMATION = *mut PSAPI_WORKING_SET_INFORMATION; +pub type PPSAPI_WORKING_SET_EX_INFORMATION = *mut PSAPI_WORKING_SET_EX_INFORMATION; +pub type PPSAPI_WS_WATCH_INFORMATION = *mut PSAPI_WS_WATCH_INFORMATION; +pub type PPSAPI_WS_WATCH_INFORMATION_EX = *mut PSAPI_WS_WATCH_INFORMATION_EX; +pub type PENUM_PAGE_FILE_INFORMATION = *mut ENUM_PAGE_FILE_INFORMATION; +pub type PPERFORMANCE_INFORMATION = *mut PERFORMANCE_INFORMATION; +pub type PPROCESS_MEMORY_COUNTERS = *mut PROCESS_MEMORY_COUNTERS; +pub type PPROCESS_MEMORY_COUNTERS_EX = *mut PROCESS_MEMORY_COUNTERS_EX; +FN!{stdcall PENUM_PAGE_FILE_CALLBACKA( + pContext: LPVOID, + pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, + lpFilename: LPCSTR, +) -> BOOL} +FN!{stdcall PENUM_PAGE_FILE_CALLBACKW( + pContext: LPVOID, + pPageFileInfo: PENUM_PAGE_FILE_INFORMATION, + lpFilename: LPCWSTR, +) -> BOOL} +STRUCT!{struct MODULEINFO { + lpBaseOfDll: LPVOID, + SizeOfImage: DWORD, + EntryPoint: LPVOID, +}} +STRUCT!{struct ENUM_PAGE_FILE_INFORMATION { + cb: DWORD, + Reserved: DWORD, + TotalSize: SIZE_T, + TotalInUse: SIZE_T, + PeakUsage: SIZE_T, +}} +STRUCT!{struct PERFORMANCE_INFORMATION { + cb: DWORD, + CommitTotal: SIZE_T, + CommitLimit: SIZE_T, + CommitPeak: SIZE_T, + PhysicalTotal: SIZE_T, + PhysicalAvailable: SIZE_T, + SystemCache: SIZE_T, + KernelTotal: SIZE_T, + KernelPaged: SIZE_T, + KernelNonpaged: SIZE_T, + PageSize: SIZE_T, + HandleCount: DWORD, + ProcessCount: DWORD, + ThreadCount: DWORD, +}} +STRUCT!{struct PROCESS_MEMORY_COUNTERS { + cb: DWORD, + PageFaultCount: DWORD, + PeakWorkingSetSize: SIZE_T, + WorkingSetSize: SIZE_T, + QuotaPeakPagedPoolUsage: SIZE_T, + QuotaPagedPoolUsage: SIZE_T, + QuotaPeakNonPagedPoolUsage: SIZE_T, + QuotaNonPagedPoolUsage: SIZE_T, + PagefileUsage: SIZE_T, + PeakPagefileUsage: SIZE_T, +}} +STRUCT!{struct PROCESS_MEMORY_COUNTERS_EX { + cb: DWORD, + PageFaultCount: DWORD, + PeakWorkingSetSize: SIZE_T, + WorkingSetSize: SIZE_T, + QuotaPeakPagedPoolUsage: SIZE_T, + QuotaPagedPoolUsage: SIZE_T, + QuotaPeakNonPagedPoolUsage: SIZE_T, + QuotaNonPagedPoolUsage: SIZE_T, + PagefileUsage: SIZE_T, + PeakPagefileUsage: SIZE_T, + PrivateUsage: SIZE_T, +}} +STRUCT!{struct PSAPI_WORKING_SET_BLOCK { + Flags: ULONG_PTR, +}} +BITFIELD!{PSAPI_WORKING_SET_BLOCK Flags: ULONG_PTR [ + Protection set_Protection[0..5], + ShareCount set_ShareCount[5..8], + Shared set_Shared[8..9], + Reserved set_Reserved[9..12], + VirtualPage set_VirtualPage[12..32], +]} +pub type PPSAPI_WORKING_SET_BLOCK = *mut PSAPI_WORKING_SET_BLOCK; +STRUCT!{struct PSAPI_WORKING_SET_EX_BLOCK { + Flags: ULONG_PTR, +}} +#[cfg(not(target_arch="x86_64"))] +BITFIELD!{PSAPI_WORKING_SET_EX_BLOCK Flags: ULONG_PTR [ + Valid set_Valid[0..1], + ShareCount set_ShareCount[1..4], + Win32Protection set_Win32Protection[4..15], + Shared set_Shared[15..16], + Node set_Node[16..22], + Locked set_Locked[22..23], + LargePage set_LargePage[23..24], + Reserved set_Reserved[24..31], + Bad set_Bad[31..32], +]} +#[cfg(target_arch="x86_64")] +BITFIELD!{PSAPI_WORKING_SET_EX_BLOCK Flags: ULONG_PTR [ + Valid set_Valid[0..1], + ShareCount set_ShareCount[1..4], + Win32Protection set_Win32Protection[4..15], + Shared set_Shared[15..16], + Node set_Node[16..22], + Locked set_Locked[22..23], + LargePage set_LargePage[23..24], + Reserved set_Reserved[24..31], + Bad set_Bad[31..32], + ReservedUlong set_ReservedULong[32..64], +]} +pub type PPSAPI_WORKING_SET_EX_BLOCK = *mut PSAPI_WORKING_SET_EX_BLOCK; +STRUCT!{struct PSAPI_WORKING_SET_INFORMATION { + NumberOfEntries: ULONG_PTR, + WorkingSetInfo: [PSAPI_WORKING_SET_BLOCK; 1], +}} +STRUCT!{struct PSAPI_WORKING_SET_EX_INFORMATION { + VirtualAddress: PVOID, + VirtualAttributes: PSAPI_WORKING_SET_EX_BLOCK, +}} +STRUCT!{struct PSAPI_WS_WATCH_INFORMATION { + FaultingPc: LPVOID, + FaultingVa: LPVOID, +}} +STRUCT!{struct PSAPI_WS_WATCH_INFORMATION_EX { + BasicInfo: PSAPI_WS_WATCH_INFORMATION, + FaultingThreadId: ULONG_PTR, + Flags: ULONG_PTR, +}} +extern "system" { + pub fn EmptyWorkingSet( + hProcess: HANDLE, + ) -> BOOL; + pub fn EnumDeviceDrivers( + lpImageBase: *mut LPVOID, + cb: DWORD, + lpcbNeeded: LPDWORD, + ) -> BOOL; + pub fn EnumPageFilesA( + pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKA, + pContext: LPVOID, + ) -> BOOL; + pub fn EnumPageFilesW( + pCallBackRoutine: PENUM_PAGE_FILE_CALLBACKW, + pContext: LPVOID, + ) -> BOOL; + pub fn EnumProcessModules( + hProcess: HANDLE, + lphModule: *mut HMODULE, + cb: DWORD, + lpcbNeeded: LPDWORD, + ) -> BOOL; + pub fn EnumProcessModulesEx( + hProcess: HANDLE, + lphModule: *mut HMODULE, + cb: DWORD, + lpcbNeeded: LPDWORD, + dwFilterFlag: DWORD, + ) -> BOOL; + pub fn GetDeviceDriverBaseNameA( + ImageBase: LPVOID, + lpFilename: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetDeviceDriverBaseNameW( + ImageBase: LPVOID, + lpFilename: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetDeviceDriverFileNameA( + ImageBase: LPVOID, + lpFilename: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetDeviceDriverFileNameW( + ImageBase: LPVOID, + lpFilename: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetMappedFileNameA( + hProcess: HANDLE, + lpv: LPVOID, + lpFilename: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetMappedFileNameW( + hProcess: HANDLE, + lpv: LPVOID, + lpFilename: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetModuleBaseNameA( + hProcess: HANDLE, + hModule: HMODULE, + lpBaseName: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetModuleBaseNameW( + hProcess: HANDLE, + hModule: HMODULE, + lpBaseName: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetModuleFileNameExA( + hProcess: HANDLE, + hModule: HMODULE, + lpFilename: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetModuleFileNameExW( + hProcess: HANDLE, + hModule: HMODULE, + lpFilename: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetModuleInformation( + hProcess: HANDLE, + hModule: HMODULE, + lpmodinfo: LPMODULEINFO, + cb: DWORD, + ) -> BOOL; + pub fn GetPerformanceInfo( + pPerformanceInformation: PPERFORMANCE_INFORMATION, + cb: DWORD, + ) -> BOOL; + pub fn GetProcessImageFileNameA( + hProcess: HANDLE, + lpImageFileName: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetProcessImageFileNameW( + hProcess: HANDLE, + lpImageFileName: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetProcessMemoryInfo( + hProcess: HANDLE, + ppsmemCounters: PPROCESS_MEMORY_COUNTERS, + cb: DWORD, + ) -> BOOL; + pub fn GetWsChanges( + hProcess: HANDLE, + lpWatchInfo: PPSAPI_WS_WATCH_INFORMATION, + cb: DWORD, + ) -> BOOL; + pub fn GetWsChangesEx( + hProcess: HANDLE, + lpWatchInfoEx: PPSAPI_WS_WATCH_INFORMATION_EX, + cb: PDWORD, + ) -> BOOL; + pub fn InitializeProcessForWsWatch( + hProcess: HANDLE, + ) -> BOOL; + pub fn QueryWorkingSet( + hProcess: HANDLE, + pv: PVOID, + cb: DWORD, + ) -> BOOL; + pub fn QueryWorkingSetEx( + hProcess: HANDLE, + pv: PVOID, + cb: DWORD, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/realtimeapiset.rs b/bash-5.1/vendor/winapi/src/um/realtimeapiset.rs new file mode 100644 index 0000000000000000000000000000000000000000..5f63dbe19928dc5d081401cdccb5d622d7d135e6 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/realtimeapiset.rs @@ -0,0 +1,30 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::PULONG64; +use shared::minwindef::{BOOL, PULONG, USHORT}; +use um::winnt::{HANDLE, PULONGLONG}; +extern "system" { + pub fn QueryThreadCycleTime( + ThreadHandle: HANDLE, + CycleTime: PULONG64, + ) -> BOOL; + pub fn QueryProcessCycleTime( + ProcessHandle: HANDLE, + CycleTime: PULONG64, + ) -> BOOL; + pub fn QueryIdleProcessorCycleTime( + BufferLength: PULONG, + ProcessorIdleCycleTime: PULONG64, + ) -> BOOL; + pub fn QueryIdleProcessorCycleTimeEx( + Group: USHORT, + BufferLength: PULONG, + ProcessorIdleCycleTime: PULONG64, + ) -> BOOL; + pub fn QueryUnbiasedInterruptTime( + UnbiasedTime: PULONGLONG, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/reason.rs b/bash-5.1/vendor/winapi/src/um/reason.rs new file mode 100644 index 0000000000000000000000000000000000000000..609c295a54126a467e4293b4e9268ef5e151598c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/reason.rs @@ -0,0 +1,60 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::DWORD; +pub const SHTDN_REASON_FLAG_COMMENT_REQUIRED: DWORD = 0x01000000; +pub const SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED: DWORD = 0x02000000; +pub const SHTDN_REASON_FLAG_CLEAN_UI: DWORD = 0x04000000; +pub const SHTDN_REASON_FLAG_DIRTY_UI: DWORD = 0x08000000; +pub const SHTDN_REASON_FLAG_USER_DEFINED: DWORD = 0x40000000; +pub const SHTDN_REASON_FLAG_PLANNED: DWORD = 0x80000000; +pub const SHTDN_REASON_MAJOR_OTHER: DWORD = 0x00000000; +pub const SHTDN_REASON_MAJOR_NONE: DWORD = 0x00000000; +pub const SHTDN_REASON_MAJOR_HARDWARE: DWORD = 0x00010000; +pub const SHTDN_REASON_MAJOR_OPERATINGSYSTEM: DWORD = 0x00020000; +pub const SHTDN_REASON_MAJOR_SOFTWARE: DWORD = 0x00030000; +pub const SHTDN_REASON_MAJOR_APPLICATION: DWORD = 0x00040000; +pub const SHTDN_REASON_MAJOR_SYSTEM: DWORD = 0x00050000; +pub const SHTDN_REASON_MAJOR_POWER: DWORD = 0x00060000; +pub const SHTDN_REASON_MAJOR_LEGACY_API: DWORD = 0x00070000; +pub const SHTDN_REASON_MINOR_OTHER: DWORD = 0x00000000; +pub const SHTDN_REASON_MINOR_NONE: DWORD = 0x000000ff; +pub const SHTDN_REASON_MINOR_MAINTENANCE: DWORD = 0x00000001; +pub const SHTDN_REASON_MINOR_INSTALLATION: DWORD = 0x00000002; +pub const SHTDN_REASON_MINOR_UPGRADE: DWORD = 0x00000003; +pub const SHTDN_REASON_MINOR_RECONFIG: DWORD = 0x00000004; +pub const SHTDN_REASON_MINOR_HUNG: DWORD = 0x00000005; +pub const SHTDN_REASON_MINOR_UNSTABLE: DWORD = 0x00000006; +pub const SHTDN_REASON_MINOR_DISK: DWORD = 0x00000007; +pub const SHTDN_REASON_MINOR_PROCESSOR: DWORD = 0x00000008; +pub const SHTDN_REASON_MINOR_NETWORKCARD: DWORD = 0x00000009; +pub const SHTDN_REASON_MINOR_POWER_SUPPLY: DWORD = 0x0000000a; +pub const SHTDN_REASON_MINOR_CORDUNPLUGGED: DWORD = 0x0000000b; +pub const SHTDN_REASON_MINOR_ENVIRONMENT: DWORD = 0x0000000c; +pub const SHTDN_REASON_MINOR_HARDWARE_DRIVER: DWORD = 0x0000000d; +pub const SHTDN_REASON_MINOR_OTHERDRIVER: DWORD = 0x0000000e; +pub const SHTDN_REASON_MINOR_BLUESCREEN: DWORD = 0x0000000F; +pub const SHTDN_REASON_MINOR_SERVICEPACK: DWORD = 0x00000010; +pub const SHTDN_REASON_MINOR_HOTFIX: DWORD = 0x00000011; +pub const SHTDN_REASON_MINOR_SECURITYFIX: DWORD = 0x00000012; +pub const SHTDN_REASON_MINOR_SECURITY: DWORD = 0x00000013; +pub const SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY: DWORD = 0x00000014; +pub const SHTDN_REASON_MINOR_WMI: DWORD = 0x00000015; +pub const SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL: DWORD = 0x00000016; +pub const SHTDN_REASON_MINOR_HOTFIX_UNINSTALL: DWORD = 0x00000017; +pub const SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL: DWORD = 0x00000018; +pub const SHTDN_REASON_MINOR_MMC: DWORD = 0x00000019; +pub const SHTDN_REASON_MINOR_SYSTEMRESTORE: DWORD = 0x0000001a; +pub const SHTDN_REASON_MINOR_TERMSRV: DWORD = 0x00000020; +pub const SHTDN_REASON_MINOR_DC_PROMOTION: DWORD = 0x00000021; +pub const SHTDN_REASON_MINOR_DC_DEMOTION: DWORD = 0x00000022; +pub const SHTDN_REASON_UNKNOWN: DWORD = SHTDN_REASON_MINOR_NONE; +pub const SHTDN_REASON_LEGACY_API: DWORD = SHTDN_REASON_MAJOR_LEGACY_API + | SHTDN_REASON_FLAG_PLANNED; +pub const SHTDN_REASON_VALID_BIT_MASK: DWORD = 0xc0ffffff; +pub const PCLEANUI: DWORD = SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_CLEAN_UI; +pub const UCLEANUI: DWORD = SHTDN_REASON_FLAG_CLEAN_UI; +pub const PDIRTYUI: DWORD = SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_DIRTY_UI; +pub const UDIRTYUI: DWORD = SHTDN_REASON_FLAG_DIRTY_UI; diff --git a/bash-5.1/vendor/winapi/src/um/restartmanager.rs b/bash-5.1/vendor/winapi/src/um/restartmanager.rs new file mode 100644 index 0000000000000000000000000000000000000000..3f4af64f51fd51f54399123666e7851aa84cc6e3 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/restartmanager.rs @@ -0,0 +1,150 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! RestartManager include file +use shared::minwindef::{BOOL, DWORD, FILETIME, LPDWORD, PBYTE, UINT, ULONG}; +use um::winnt::{LPCWSTR, LPWSTR, WCHAR}; +pub const RM_SESSION_KEY_LEN: usize = 16; // mem::size_of::() +pub const CCH_RM_SESSION_KEY: usize = RM_SESSION_KEY_LEN * 2; +pub const CCH_RM_MAX_APP_NAME: usize = 255; +pub const CCH_RM_MAX_SVC_NAME: usize = 63; +pub const RM_INVALID_TS_SESSION: DWORD = -1i32 as u32; +pub const RM_INVALID_PROCESS: DWORD = -1i32 as u32; +ENUM!{enum RM_APP_TYPE { + RmUnknownApp = 0, + RmMainWindow = 1, + RmOtherWindow = 2, + RmService = 3, + RmExplorer = 4, + RmConsole = 5, + RmCritical = 1000, +}} +ENUM!{enum RM_SHUTDOWN_TYPE { + RmForceShutdown = 0x1, + RmShutdownOnlyRegistered = 0x10, +}} +ENUM!{enum RM_APP_STATUS { + RmStatusUnknown = 0x0, + RmStatusRunning = 0x1, + RmStatusStopped = 0x2, + RmStatusStoppedOther = 0x4, + RmStatusRestarted = 0x8, + RmStatusErrorOnStop = 0x10, + RmStatusErrorOnRestart = 0x20, + RmStatusShutdownMasked = 0x40, + RmStatusRestartMasked = 0x80, +}} +ENUM!{enum RM_REBOOT_REASON { + RmRebootReasonNone = 0x0, + RmRebootReasonPermissionDenied = 0x1, + RmRebootReasonSessionMismatch = 0x2, + RmRebootReasonCriticalProcess = 0x4, + RmRebootReasonCriticalService = 0x8, + RmRebootReasonDetectedSelf = 0x10, +}} +STRUCT!{struct RM_UNIQUE_PROCESS { + dwProcessId: DWORD, + ProcessStartTime: FILETIME, +}} +pub type PRM_UNIQUE_PROCESS = *mut RM_UNIQUE_PROCESS; +STRUCT!{struct RM_PROCESS_INFO { + Process: RM_UNIQUE_PROCESS, + strAppName: [WCHAR; CCH_RM_MAX_APP_NAME + 1], + strServiceShortName: [WCHAR; CCH_RM_MAX_SVC_NAME + 1], + ApplicationType: RM_APP_TYPE, + AppStatus: ULONG, + TSSessionId: DWORD, + bRestartable: BOOL, +}} +pub type PRM_PROCESS_INFO = *mut RM_PROCESS_INFO; +ENUM!{enum RM_FILTER_TRIGGER { + RmFilterTriggerInvalid = 0, + RmFilterTriggerFile, + RmFilterTriggerProcess, + RmFilterTriggerService, +}} +ENUM!{enum RM_FILTER_ACTION { + RmInvalidFilterAction = 0, + RmNoRestart = 1, + RmNoShutdown = 2, +}} +UNION!{union RM_FILTER_INFO_u { + [u32; 3] [u64; 2], + strFilename strFilename_mut: LPWSTR, + Process Process_mut: RM_UNIQUE_PROCESS, + strServiceShortName strServiceShortName_mut: LPWSTR, +}} +STRUCT!{struct RM_FILTER_INFO { + FilterAction: RM_FILTER_ACTION, + FilterTrigger: RM_FILTER_TRIGGER, + cbNextOffset: DWORD, + u: RM_FILTER_INFO_u, +}} +pub type PRM_FILTER_INFO = *mut RM_FILTER_INFO; +FN!{cdecl RM_WRITE_STATUS_CALLBACK( + nPercentComplete: u32, +) -> ()} +extern "system" { + pub fn RmStartSession( + pSessionHandle: *mut DWORD, + dwSessionFlags: DWORD, + strSessionKey: *mut WCHAR, + ) -> DWORD; + pub fn RmJoinSession( + pSessionHandle: *mut DWORD, + strSessionKey: *const WCHAR, + ) -> DWORD; + pub fn RmEndSession( + dwSessionHandle: DWORD, + ) -> DWORD; + pub fn RmRegisterResources( + dwSessionHandle: DWORD, + nFiles: UINT, + rgsFileNames: *mut LPCWSTR, + nApplications: UINT, + rgApplications: *mut RM_UNIQUE_PROCESS, + nServices: UINT, + rgsServiceNames: *mut LPCWSTR, + ) -> DWORD; + pub fn RmGetList( + dwSessionHandle: DWORD, + pnProcInfoNeeded: *mut UINT, + pnProcInfo: *mut UINT, + rgAffectedApps: *mut RM_PROCESS_INFO, + lpdwRebootReasons: LPDWORD, + ) -> DWORD; + pub fn RmShutdown( + dwSessionHandle: DWORD, + lActionFlags: ULONG, + fnStatus: RM_WRITE_STATUS_CALLBACK, + ) -> DWORD; + pub fn RmRestart( + dwSessionHandle: DWORD, + dwRestartFlags: DWORD, + fnStatus: RM_WRITE_STATUS_CALLBACK, + ) -> DWORD; + pub fn RmCancelCurrentTask( + dwSessionHandle: DWORD, + ) -> DWORD; + pub fn RmAddFilter( + dwSessionHandle: DWORD, + strModuleName: LPCWSTR, + pProcess: *mut RM_UNIQUE_PROCESS, + strServiceShortName: LPCWSTR, + FilterAction: RM_FILTER_ACTION, + ) -> DWORD; + pub fn RmRemoveFilter( + dwSessionHandle: DWORD, + strModuleName: LPCWSTR, + pProcess: *mut RM_UNIQUE_PROCESS, + strServiceShortName: LPCWSTR, + ) -> DWORD; + pub fn RmGetFilterList( + dwSessionHandle: DWORD, + pbFilterBuf: PBYTE, + cbFilterBuf: DWORD, + cbFilterBufNeeded: LPDWORD, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/restrictederrorinfo.rs b/bash-5.1/vendor/winapi/src/um/restrictederrorinfo.rs new file mode 100644 index 0000000000000000000000000000000000000000..9c5db989b1846bae4bfdbcf4eb05bf25a1967303 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/restrictederrorinfo.rs @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::wtypes::BSTR; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::HRESULT; +RIDL!{#[uuid(0x82ba7092, 0x4c88, 0x427d, 0xa7, 0xbc, 0x16, 0xdd, 0x93, 0xfe, 0xb6, 0x7e)] +interface IRestrictedErrorInfo(IRestrictedErrorInfoVtbl): IUnknown(IUnknownVtbl) { + fn GetErrorDetails( + description: *mut BSTR, + error: *mut HRESULT, + restrictedDescription: *mut BSTR, + capabilitySid: *mut BSTR, + ) -> HRESULT, + fn GetReference( + reference: *mut BSTR, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/rmxfguid.rs b/bash-5.1/vendor/winapi/src/um/rmxfguid.rs new file mode 100644 index 0000000000000000000000000000000000000000..97c3814c109b9443f7532848fe75472f4f2d29b2 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/rmxfguid.rs @@ -0,0 +1,67 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{TID_D3DRMInfo, + 0x2b957100, 0x9e9a, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{TID_D3DRMMesh, + 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{TID_D3DRMVector, + 0x3d82ab5e, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{TID_D3DRMMeshFace, + 0x3d82ab5f, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{TID_D3DRMMaterial, + 0x3d82ab4d, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{TID_D3DRMMaterialArray, + 0x35ff44e1, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMFrame, + 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{TID_D3DRMFrameTransformMatrix, + 0xf6f23f41, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMeshMaterialList, + 0xf6f23f42, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMeshTextureCoords, + 0xf6f23f40, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMeshNormals, + 0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMCoords2d, + 0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMatrix4x4, + 0xf6f23f45, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMAnimation, + 0x3d82ab4f, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{TID_D3DRMAnimationSet, + 0x3d82ab50, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} +DEFINE_GUID!{TID_D3DRMAnimationKey, + 0x10dd46a8, 0x775b, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMFloatKeys, + 0x10dd46a9, 0x775b, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMaterialAmbientColor, + 0x01411840, 0x7786, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMaterialDiffuseColor, + 0x01411841, 0x7786, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMaterialSpecularColor, + 0x01411842, 0x7786, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMaterialEmissiveColor, + 0xd3e16e80, 0x7835, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMaterialPower, + 0x01411843, 0x7786, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMColorRGBA, + 0x35ff44e0, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMColorRGB, + 0xd3e16e81, 0x7835, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMGuid, + 0xa42790e0, 0x7810, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMTextureFilename, + 0xa42790e1, 0x7810, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMTextureReference, + 0xa42790e2, 0x7810, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMIndexedColor, + 0x1630b820, 0x7842, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMeshVertexColors, + 0x1630b821, 0x7842, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMMaterialWrap, + 0x4885ae60, 0x78e8, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} +DEFINE_GUID!{TID_D3DRMBoolean, + 0x537da6a0, 0xca37, 0x11d0, 0x94, 0x1c, 0x00, 0x80, 0xc8, 0x0c, 0xfa, 0x7b} diff --git a/bash-5.1/vendor/winapi/src/um/rtinfo.rs b/bash-5.1/vendor/winapi/src/um/rtinfo.rs new file mode 100644 index 0000000000000000000000000000000000000000..7dd6aeb4b1a43f75fd828f7362545a662cda86ef --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/rtinfo.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::DWORD_PTR; +pub const ALIGN_SIZE: DWORD_PTR = 0x00000008; diff --git a/bash-5.1/vendor/winapi/src/um/sapi.rs b/bash-5.1/vendor/winapi/src/um/sapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..2a2cf375ab0b77a092c7b409a8262caf79af6857 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sapi.rs @@ -0,0 +1,1388 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! SAPI 5.4 definitions +use shared::guiddef::GUID; +use shared::minwindef::{BYTE, ULONG, WORD}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPWSTR, ULONGLONG}; +pub use um::sapi53::{ + SPDATAKEYLOCATION, + SPDKL_DefaultLocation, + SPDKL_CurrentUser, + SPDKL_LocalMachine, + SPDKL_CurrentConfig, + SPDUI_EngineProperties, + SPDUI_AddRemoveWord, + SPDUI_UserTraining, + SPDUI_MicTraining, + SPDUI_RecoProfileProperties, + SPDUI_AudioProperties, + SPDUI_AudioVolume, + SPDUI_UserEnrollment, + SPDUI_ShareData, + SPDUI_Tutorial, + SPSTREAMFORMAT, + SPSF_Default, + SPSF_NoAssignedFormat, + SPSF_Text, + SPSF_NonStandardFormat, + SPSF_ExtendedAudioFormat, + SPSF_8kHz8BitMono, + SPSF_8kHz8BitStereo, + SPSF_8kHz16BitMono, + SPSF_8kHz16BitStereo, + SPSF_11kHz8BitMono, + SPSF_11kHz8BitStereo, + SPSF_11kHz16BitMono, + SPSF_11kHz16BitStereo, + SPSF_12kHz8BitMono, + SPSF_12kHz8BitStereo, + SPSF_12kHz16BitMono, + SPSF_12kHz16BitStereo, + SPSF_16kHz8BitMono, + SPSF_16kHz8BitStereo, + SPSF_16kHz16BitMono, + SPSF_16kHz16BitStereo, + SPSF_22kHz8BitMono, + SPSF_22kHz8BitStereo, + SPSF_22kHz16BitMono, + SPSF_22kHz16BitStereo, + SPSF_24kHz8BitMono, + SPSF_24kHz8BitStereo, + SPSF_24kHz16BitMono, + SPSF_24kHz16BitStereo, + SPSF_32kHz8BitMono, + SPSF_32kHz8BitStereo, + SPSF_32kHz16BitMono, + SPSF_32kHz16BitStereo, + SPSF_44kHz8BitMono, + SPSF_44kHz8BitStereo, + SPSF_44kHz16BitMono, + SPSF_44kHz16BitStereo, + SPSF_48kHz8BitMono, + SPSF_48kHz8BitStereo, + SPSF_48kHz16BitMono, + SPSF_48kHz16BitStereo, + SPSF_TrueSpeech_8kHz1BitMono, + SPSF_CCITT_ALaw_8kHzMono, + SPSF_CCITT_ALaw_8kHzStereo, + SPSF_CCITT_ALaw_11kHzMono, + SPSF_CCITT_ALaw_11kHzStereo, + SPSF_CCITT_ALaw_22kHzMono, + SPSF_CCITT_ALaw_22kHzStereo, + SPSF_CCITT_ALaw_44kHzMono, + SPSF_CCITT_ALaw_44kHzStereo, + SPSF_CCITT_uLaw_8kHzMono, + SPSF_CCITT_uLaw_8kHzStereo, + SPSF_CCITT_uLaw_11kHzMono, + SPSF_CCITT_uLaw_11kHzStereo, + SPSF_CCITT_uLaw_22kHzMono, + SPSF_CCITT_uLaw_22kHzStereo, + SPSF_CCITT_uLaw_44kHzMono, + SPSF_CCITT_uLaw_44kHzStereo, + SPSF_ADPCM_8kHzMono, + SPSF_ADPCM_8kHzStereo, + SPSF_ADPCM_11kHzMono, + SPSF_ADPCM_11kHzStereo, + SPSF_ADPCM_22kHzMono, + SPSF_ADPCM_22kHzStereo, + SPSF_ADPCM_44kHzMono, + SPSF_ADPCM_44kHzStereo, + SPSF_GSM610_8kHzMono, + SPSF_GSM610_11kHzMono, + SPSF_GSM610_22kHzMono, + SPSF_GSM610_44kHzMono, + SPSF_NUM_FORMATS, + SPDFID_Text, + SPDFID_WaveFormatEx, + SPREG_USER_ROOT, + SPREG_LOCAL_MACHINE_ROOT, + SPCAT_AUDIOOUT, + SPCAT_AUDIOIN, + SPCAT_VOICES, + SPCAT_RECOGNIZERS, + SPCAT_APPLEXICONS, + SPCAT_PHONECONVERTERS, + SPCAT_TEXTNORMALIZERS, + SPCAT_RECOPROFILES, + SPMMSYS_AUDIO_IN_TOKEN_ID, + SPMMSYS_AUDIO_OUT_TOKEN_ID, + SPCURRENT_USER_LEXICON_TOKEN_ID, + SPTOKENVALUE_CLSID, + SPTOKENKEY_FILES, + SPTOKENKEY_UI, + SPTOKENKEY_ATTRIBUTES, + SPTOKENKEY_RETAINEDAUDIO, + SPTOKENKEY_AUDIO_LATENCY_WARNING, + SPTOKENKEY_AUDIO_LATENCY_TRUNCATE, + SPTOKENKEY_AUDIO_LATENCY_UPDATE_INTERVAL, + SPVOICECATEGORY_TTSRATE, + SPPROP_RESOURCE_USAGE, + SPPROP_HIGH_CONFIDENCE_THRESHOLD, + SPPROP_NORMAL_CONFIDENCE_THRESHOLD, + SPPROP_LOW_CONFIDENCE_THRESHOLD, + SPPROP_RESPONSE_SPEED, + SPPROP_COMPLEX_RESPONSE_SPEED, + SPPROP_ADAPTATION_ON, + SPPROP_PERSISTED_BACKGROUND_ADAPTATION, + SPPROP_PERSISTED_LANGUAGE_MODEL_ADAPTATION, + SPPROP_UX_IS_LISTENING, + SPTOPIC_SPELLING, + SPWILDCARD, + SPDICTATION, + SPREG_SAFE_USER_TOKENS, + SPINFDICTATION, + SP_LOW_CONFIDENCE, + SP_NORMAL_CONFIDENCE, + SP_HIGH_CONFIDENCE, + DEFAULT_WEIGHT, + SP_MAX_WORD_LENGTH, + SP_MAX_PRON_LENGTH, + SP_EMULATE_RESULT, + ISpNotifyCallback, + SPNOTIFYCALLBACK, + ISpNotifySource, ISpNotifySourceVtbl, + ISpNotifySink, ISpNotifySinkVtbl, + ISpNotifyTranslator, ISpNotifyTranslatorVtbl, + ISpDataKey, ISpDataKeyVtbl, + ISpRegDataKey, ISpRegDataKeyVtbl, + ISpObjectTokenCategory, ISpObjectTokenCategoryVtbl, + ISpObjectToken, ISpObjectTokenVtbl, + ISpObjectTokenInit, ISpObjectTokenInitVtbl, + IEnumSpObjectTokens, IEnumSpObjectTokensVtbl, + ISpObjectWithToken, ISpObjectWithTokenVtbl, + ISpResourceManager, ISpResourceManagerVtbl, + SPEVENTLPARAMTYPE, + SPET_LPARAM_IS_UNDEFINED, + SPET_LPARAM_IS_TOKEN, + SPET_LPARAM_IS_OBJECT, + SPET_LPARAM_IS_POINTER, + SPET_LPARAM_IS_STRING, + SPEVENTENUM, + SPEI_UNDEFINED, + SPEI_START_INPUT_STREAM, + SPEI_END_INPUT_STREAM, + SPEI_VOICE_CHANGE, + SPEI_TTS_BOOKMARK, + SPEI_WORD_BOUNDARY, + SPEI_PHONEME, + SPEI_SENTENCE_BOUNDARY, + SPEI_VISEME, + SPEI_TTS_AUDIO_LEVEL, + SPEI_TTS_PRIVATE, + SPEI_MIN_TTS, + SPEI_MAX_TTS, + SPEI_END_SR_STREAM, + SPEI_SOUND_START, + SPEI_SOUND_END, + SPEI_PHRASE_START, + SPEI_RECOGNITION, + SPEI_HYPOTHESIS, + SPEI_SR_BOOKMARK, + SPEI_PROPERTY_NUM_CHANGE, + SPEI_PROPERTY_STRING_CHANGE, + SPEI_FALSE_RECOGNITION, + SPEI_INTERFERENCE, + SPEI_REQUEST_UI, + SPEI_RECO_STATE_CHANGE, + SPEI_ADAPTATION, + SPEI_START_SR_STREAM, + SPEI_RECO_OTHER_CONTEXT, + SPEI_SR_AUDIO_LEVEL, + SPEI_SR_RETAINEDAUDIO, + SPEI_SR_PRIVATE, +}; +pub const ACTIVE_CATEGORY_CHANGED: SPEVENTENUM = 53; +pub use um::sapi53::{ + SPEI_RESERVED5, + SPEI_RESERVED6, + SPEI_MIN_SR, + SPEI_MAX_SR, + SPEI_RESERVED1, + SPEI_RESERVED2, + SPEI_RESERVED3, + SPFEI_FLAGCHECK, + SPFEI_ALL_TTS_EVENTS, + SPFEI_ALL_SR_EVENTS, + SPFEI_ALL_EVENTS, + SPFEI, + SPEVENT, + SPSERIALIZEDEVENT, + SPSERIALIZEDEVENT64, + SPEVENTEX, + SPINTERFERENCE, + SPINTERFERENCE_NONE, + SPINTERFERENCE_NOISE, + SPINTERFERENCE_NOSIGNAL, + SPINTERFERENCE_TOOLOUD, + SPINTERFERENCE_TOOQUIET, + SPINTERFERENCE_TOOFAST, + SPINTERFERENCE_TOOSLOW, + SPINTERFERENCE_LATENCY_WARNING, + SPINTERFERENCE_LATENCY_TRUNCATE_BEGIN, + SPINTERFERENCE_LATENCY_TRUNCATE_END, + SPENDSRSTREAMFLAGS, + SPESF_NONE, + SPESF_STREAM_RELEASED, + SPESF_EMULATED, + SPVFEATURE, + SPVFEATURE_STRESSED, + SPVFEATURE_EMPHASIS, + SPVISEMES, + SP_VISEME_0, + SP_VISEME_1, + SP_VISEME_2, + SP_VISEME_3, + SP_VISEME_4, + SP_VISEME_5, + SP_VISEME_6, + SP_VISEME_7, + SP_VISEME_8, + SP_VISEME_9, + SP_VISEME_10, + SP_VISEME_11, + SP_VISEME_12, + SP_VISEME_13, + SP_VISEME_14, + SP_VISEME_15, + SP_VISEME_16, + SP_VISEME_17, + SP_VISEME_18, + SP_VISEME_19, + SP_VISEME_20, + SP_VISEME_21, + SPEVENTSOURCEINFO, + ISpEventSource, ISpEventSourceVtbl, + ISpEventSource2, ISpEventSource2Vtbl, + ISpEventSink, ISpEventSinkVtbl, + ISpStreamFormat, ISpStreamFormatVtbl, + SPFILEMODE, + SPFM_OPEN_READONLY, + SPFM_OPEN_READWRITE, + SPFM_CREATE, + SPFM_CREATE_ALWAYS, + SPFM_NUM_MODES, + ISpStream, ISpStreamVtbl, + ISpStreamFormatConverter, ISpStreamFormatConverterVtbl, + SPAUDIOSTATE, + SPAS_CLOSED, + SPAS_STOP, + SPAS_PAUSE, + SPAS_RUN, + SPAUDIOSTATUS, + SPAUDIOBUFFERINFO, + ISpAudio, ISpAudioVtbl, + ISpMMSysAudio, ISpMMSysAudioVtbl, + ISpTranscript, ISpTranscriptVtbl, + SPDISPLAYATTRIBUTES, + SPAF_ONE_TRAILING_SPACE, + SPAF_TWO_TRAILING_SPACES, + SPAF_CONSUME_LEADING_SPACES, + SPAF_BUFFER_POSITION, + SPAF_ALL, + SPAF_USER_SPECIFIED, + SPPHONEID, + PSPPHONEID, + PCSPPHONEID, + SPPHRASEELEMENT, + SPPHRASERULE, + SPPHRASEPROPERTYUNIONTYPE, + SPPPUT_UNUSED, + SPPPUT_ARRAY_INDEX, + SPPHRASEPROPERTY, + SPPHRASEREPLACEMENT, + SPSEMANTICERRORINFO, + SPSEMANTICFORMAT, + SPPHRASE_50, +// SPPHRASESIZE_500, +}; +pub use um::sapi53::SPPHRASE as SPPHRASE_53; +STRUCT!{struct SPPHRASE { + cbSize: ULONG, + LangID: WORD, + wHomophoneGroupId: WORD, + ullGrammarID: ULONGLONG, + ftStartTime: ULONGLONG, + ullAudioStreamPosition: ULONGLONG, + ulAudioSizeBytes: ULONG, + ulRetainedSizeBytes: ULONG, + ulAudioSizeTime: ULONG, + Rule: SPPHRASERULE, + pProperties: *const SPPHRASEPROPERTY, + pElements: *const SPPHRASEELEMENT, + cReplacements: ULONG, + pReplacements: *const SPPHRASEREPLACEMENT, + SREngineID: GUID, + ulSREnginePrivateDataSize: ULONG, + pSREnginePrivateData: *const BYTE, + pSML: LPWSTR, + pSemanticErrorInfo: *mut SPSEMANTICERRORINFO, + SemanticTagFormat: SPSEMANTICFORMAT, +}} +pub use um::sapi53::{ + SPSERIALIZEDPHRASE, + SPRULE, + SPVALUETYPE, + SPDF_PROPERTY, + SPDF_REPLACEMENT, + SPDF_RULE, + SPDF_DISPLAYTEXT, + SPDF_LEXICALFORM , + SPDF_PRONUNCIATION, + SPDF_AUDIO, + SPDF_ALTERNATES, + SPDF_ALL, + SPBINARYGRAMMAR, + SPPHRASERNG, + SPPR_ALL_ELEMENTS, + SP_GETWHOLEPHRASE, + SPRR_ALL_ELEMENTS, + SPSTATEHANDLE, + SPRECOEVENTFLAGS, + SPREF_AutoPause, + SPREF_Emulated, + SPREF_SMLTimeout, + SPREF_ExtendableParse, + SPREF_ReSent, + SPREF_Hypothesis, + SPREF_FalseRecognition, + SPPARTOFSPEECH, + SPPS_NotOverriden, + SPPS_Unknown, + SPPS_Noun, + SPPS_Verb, + SPPS_Modifier, + SPPS_Function, + SPPS_Interjection, + SPPS_Noncontent, + SPPS_LMA, + SPPS_SuppressWord, + SPLEXICONTYPE, + eLEXTYPE_USER, + eLEXTYPE_APP, + eLEXTYPE_VENDORLEXICON, + eLEXTYPE_LETTERTOSOUND, + eLEXTYPE_MORPHOLOGY, + eLEXTYPE_RESERVED4, + eLEXTYPE_USER_SHORTCUT, + eLEXTYPE_RESERVED6, + eLEXTYPE_RESERVED7, + eLEXTYPE_RESERVED8, + eLEXTYPE_RESERVED9, + eLEXTYPE_RESERVED10, + eLEXTYPE_PRIVATE1, + eLEXTYPE_PRIVATE2, + eLEXTYPE_PRIVATE3, + eLEXTYPE_PRIVATE4, + eLEXTYPE_PRIVATE5, + eLEXTYPE_PRIVATE6, + eLEXTYPE_PRIVATE7, + eLEXTYPE_PRIVATE8, + eLEXTYPE_PRIVATE9, + eLEXTYPE_PRIVATE10, + eLEXTYPE_PRIVATE11, + eLEXTYPE_PRIVATE12, + eLEXTYPE_PRIVATE13, + eLEXTYPE_PRIVATE14, + eLEXTYPE_PRIVATE15, + eLEXTYPE_PRIVATE16, + eLEXTYPE_PRIVATE17, + eLEXTYPE_PRIVATE18, + eLEXTYPE_PRIVATE19, + eLEXTYPE_PRIVATE20, + SPWORDTYPE, + eWORDTYPE_ADDED, + eWORDTYPE_DELETED, + SPPRONUNCIATIONFLAGS, + ePRONFLAG_USED, + SPWORDPRONUNCIATION, + SPWORDPRONUNCIATIONLIST, + SPWORD, + SPWORDLIST, + ISpLexicon, ISpLexiconVtbl, + ISpContainerLexicon, ISpContainerLexiconVtbl, + SPSHORTCUTTYPE, + SPSHT_NotOverriden, + SPSHT_Unknown, + SPSHT_EMAIL, + SPSHT_OTHER, + SPPS_RESERVED1, + SPPS_RESERVED2, + SPPS_RESERVED3, + SPPS_RESERVED4, + SPSHORTCUTPAIR, + SPSHORTCUTPAIRLIST, + ISpShortcut, ISpShortcutVtbl, + ISpPhoneConverter, ISpPhoneConverterVtbl, + ISpPhoneticAlphabetConverter, ISpPhoneticAlphabetConverterVtbl, + ISpPhoneticAlphabetSelection, ISpPhoneticAlphabetSelectionVtbl, + SPVPITCH, + SPVACTIONS, + SPVA_Speak, + SPVA_Silence, + SPVA_Pronounce, + SPVA_Bookmark, + SPVA_SpellOut, + SPVA_Section, + SPVA_ParseUnknownTag, + SPVCONTEXT, + SPVSTATE, + SPRUNSTATE, + SPRS_DONE, + SPRS_IS_SPEAKING, + SPVLIMITS, + SPMIN_VOLUME, + SPMAX_VOLUME, + SPMIN_RATE, + SPMAX_RATE, + SPVPRIORITY, + SPVPRI_NORMAL, + SPVPRI_ALERT, + SPVPRI_OVER, + SPVOICESTATUS, + SPEAKFLAGS, + SPF_DEFAULT, + SPF_ASYNC, + SPF_PURGEBEFORESPEAK, + SPF_IS_FILENAME, + SPF_IS_XML, + SPF_IS_NOT_XML, + SPF_PERSIST_XML, + SPF_NLP_SPEAK_PUNC, + SPF_PARSE_SAPI, + SPF_PARSE_SSML, + SPF_PARSE_AUTODETECT, + SPF_NLP_MASK, + SPF_PARSE_MASK, + SPF_VOICE_MASK, + SPF_UNUSED_FLAGS, + ISpVoice, ISpVoiceVtbl, + ISpPhrase, ISpPhraseVtbl, + ISpPhraseAlt, ISpPhraseAltVtbl, + SPXMLRESULTOPTIONS, + SPXRO_SML, + SPXRO_Alternates_SML, + ISpPhrase2, ISpPhrase2Vtbl, + SPRECORESULTTIMES, + SPSERIALIZEDRESULT, + ISpRecoResult, ISpRecoResultVtbl, + SPCOMMITFLAGS, + SPCF_NONE, + SPCF_ADD_TO_USER_LEXICON, + SPCF_DEFINITE_CORRECTION, + ISpRecoResult2, ISpRecoResult2Vtbl, + ISpXMLRecoResult, ISpXMLRecoResultVtbl, + SPTEXTSELECTIONINFO, + SPWORDPRONOUNCEABLE, + SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE, + SPWP_UNKNOWN_WORD_PRONOUNCEABLE, + SPWP_KNOWN_WORD_PRONOUNCEABLE, + SPGRAMMARSTATE, + SPGS_DISABLED, + SPGS_ENABLED, + SPGS_EXCLUSIVE, + SPCONTEXTSTATE, + SPCS_DISABLED, + SPCS_ENABLED, + SPRULESTATE, + SPRS_INACTIVE, + SPRS_ACTIVE, + SPRS_ACTIVE_WITH_AUTO_PAUSE, + SPWT_LEXICAL_NO_SPECIAL_CHARS, + SPPROPERTYINFO, + SPCFGRULEATTRIBUTES, + SPRAF_TopLevel, + SPRAF_Active, + SPRAF_Export, + SPRAF_Import, + SPRAF_Interpreter, + SPRAF_Dynamic, + SPRAF_Root, + SPRAF_AutoPause, + SPRAF_UserDelimited, + ISpGrammarBuilder, ISpGrammarBuilderVtbl, + SPLOADOPTIONS, + SPLO_STATIC, + SPLO_DYNAMIC, + ISpRecoGrammar, ISpRecoGrammarVtbl, + SPMATCHINGMODE, + AllWords, + Subsequence, + OrderedSubset, + SubsequenceContentRequired, + OrderedSubsetContentRequired, + PHONETICALPHABET, + PA_Ipa, + PA_Ups, + PA_Sapi, + ISpGrammarBuilder2, ISpGrammarBuilder2Vtbl, + SPRP_NORMAL, + ISpRecoGrammar2, ISpRecoGrammar2Vtbl, + ISpeechResourceLoader, ISpeechResourceLoaderVtbl, + SPRECOCONTEXTSTATUS, + SPBOOKMARKOPTIONS, + SPBO_NONE, + SPBO_PAUSE, + SPBO_AHEAD, + SPBO_TIME_UNITS, + SPAUDIOOPTIONS, + SPAO_NONE, + SPAO_RETAIN_AUDIO, + ISpRecoContext, ISpRecoContextVtbl, + SPGRAMMAROPTIONS, + SPGO_SAPI, + SPGO_SRGS, + SPGO_UPS, + SPGO_SRGS_MS_SCRIPT, + SPGO_SRGS_W3C_SCRIPT, + SPGO_SRGS_STG_SCRIPT, + SPGO_SRGS_SCRIPT, + SPGO_FILE, + SPGO_HTTP, + SPGO_RES, + SPGO_OBJECT, + SPGO_DEFAULT, + SPGO_ALL, + SPADAPTATIONSETTINGS, + SPADS_Default, + SPADS_CurrentRecognizer, + SPADS_RecoProfile, + SPADS_Immediate, + SPADS_Reset, + SPADS_HighVolumeDataSource, + SPADAPTATIONRELEVANCE, + SPAR_Unknown, + SPAR_Low, + SPAR_Medium, + SPAR_High, + ISpRecoContext2, ISpRecoContext2Vtbl, + ISpProperties, ISpPropertiesVtbl, + SP_MAX_LANGIDS, + SPRECOGNIZERSTATUS, + SPWAVEFORMATTYPE, + SPWF_INPUT, + SPWF_SRENGINE, + SPSTREAMFORMATTYPE, + SPRECOSTATE, + SPRST_INACTIVE, + SPRST_ACTIVE, + SPRST_ACTIVE_ALWAYS, + SPRST_INACTIVE_WITH_PURGE, + SPRST_NUM_STATES, + ISpRecognizer, ISpRecognizerVtbl, + ISpSerializeState, ISpSerializeStateVtbl, + ISpRecognizer2, ISpRecognizer2Vtbl, +}; +ENUM!{enum SPCATEGORYTYPE { + SPCT_COMMAND, + SPCT_DICTATION, + SPCT_SLEEP, + SPCT_SUB_COMMAND, + SPCT_SUB_DICTATION, +}} +RIDL!{#[uuid(0xda0cd0f9, 0x14a2, 0x4f09, 0x8c, 0x2a, 0x85, 0xcc, 0x48, 0x97, 0x93, 0x45)] +interface ISpRecoCategory(ISpRecoCategoryVtbl): IUnknown(IUnknownVtbl) { + fn GetType( + peCategoryType: *mut SPCATEGORYTYPE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdf1b943c, 0x5838, 0x4aa2, 0x87, 0x06, 0xd7, 0xcd, 0x5b, 0x33, 0x34, 0x99)] +interface ISpRecognizer3(ISpRecognizer3Vtbl): IUnknown(IUnknownVtbl) { + fn GetCategory( + categoryType: SPCATEGORYTYPE, + ppCategory: *mut *mut ISpRecoCategory, + ) -> HRESULT, + fn SetActiveCategory( + pCategory: *mut ISpRecoCategory, + ) -> HRESULT, + fn GetActiveCategory( + ppCategory: *mut *mut ISpRecoCategory, + ) -> HRESULT, +}} +pub use um::sapi53::{ + SPNORMALIZATIONLIST, + ISpEnginePronunciation, ISpEnginePronunciationVtbl, + SPDISPLAYTOKEN, + SPDISPLAYPHRASE, + ISpDisplayAlternates, ISpDisplayAlternatesVtbl, + SpeechLanguageId, + DISPID_SpeechDataKey, + DISPID_SDKSetBinaryValue, + DISPID_SDKGetBinaryValue, + DISPID_SDKSetStringValue, + DISPID_SDKGetStringValue, + DISPID_SDKSetLongValue, + DISPID_SDKGetlongValue, + DISPID_SDKOpenKey, + DISPID_SDKCreateKey, + DISPID_SDKDeleteKey, + DISPID_SDKDeleteValue, + DISPID_SDKEnumKeys, + DISPID_SDKEnumValues, + DISPID_SpeechObjectToken, + DISPID_SOTId, + DISPID_SOTDataKey, + DISPID_SOTCategory, + DISPID_SOTGetDescription, + DISPID_SOTSetId, + DISPID_SOTGetAttribute, + DISPID_SOTCreateInstance, + DISPID_SOTRemove, + DISPID_SOTGetStorageFileName, + DISPID_SOTRemoveStorageFileName, + DISPID_SOTIsUISupported, + DISPID_SOTDisplayUI, + DISPID_SOTMatchesAttributes, + SpeechDataKeyLocation, + SDKLDefaultLocation, + SDKLCurrentUser, + SDKLLocalMachine, + SDKLCurrentConfig, + SpeechTokenContext, + STCInprocServer, + STCInprocHandler , + STCLocalServer, + STCRemoteServer, + STCAll, + SpeechTokenShellFolder, + STSF_AppData, + STSF_LocalAppData, + STSF_CommonAppData, + STSF_FlagCreate, + DISPID_SpeechObjectTokens, + DISPID_SOTsCount, + DISPID_SOTsItem, + DISPID_SOTs_NewEnum, + DISPID_SpeechObjectTokenCategory, + DISPID_SOTCId, + DISPID_SOTCDefault, + DISPID_SOTCSetId, + DISPID_SOTCGetDataKey, + DISPID_SOTCEnumerateTokens, + SpeechAudioFormatType, + SAFTDefault, + SAFTNoAssignedFormat, + SAFTText, + SAFTNonStandardFormat, + SAFTExtendedAudioFormat, + SAFT8kHz8BitMono, + SAFT8kHz8BitStereo, + SAFT8kHz16BitMono, + SAFT8kHz16BitStereo, + SAFT11kHz8BitMono, + SAFT11kHz8BitStereo, + SAFT11kHz16BitMono, + SAFT11kHz16BitStereo, + SAFT12kHz8BitMono, + SAFT12kHz8BitStereo, + SAFT12kHz16BitMono, + SAFT12kHz16BitStereo, + SAFT16kHz8BitMono, + SAFT16kHz8BitStereo, + SAFT16kHz16BitMono, + SAFT16kHz16BitStereo, + SAFT22kHz8BitMono, + SAFT22kHz8BitStereo, + SAFT22kHz16BitMono, + SAFT22kHz16BitStereo, + SAFT24kHz8BitMono, + SAFT24kHz8BitStereo, + SAFT24kHz16BitMono, + SAFT24kHz16BitStereo, + SAFT32kHz8BitMono, + SAFT32kHz8BitStereo, + SAFT32kHz16BitMono, + SAFT32kHz16BitStereo, + SAFT44kHz8BitMono, + SAFT44kHz8BitStereo, + SAFT44kHz16BitMono, + SAFT44kHz16BitStereo, + SAFT48kHz8BitMono, + SAFT48kHz8BitStereo, + SAFT48kHz16BitMono, + SAFT48kHz16BitStereo, + SAFTTrueSpeech_8kHz1BitMono, + SAFTCCITT_ALaw_8kHzMono, + SAFTCCITT_ALaw_8kHzStereo, + SAFTCCITT_ALaw_11kHzMono, + SAFTCCITT_ALaw_11kHzStereo, + SAFTCCITT_ALaw_22kHzMono, + SAFTCCITT_ALaw_22kHzStereo, + SAFTCCITT_ALaw_44kHzMono, + SAFTCCITT_ALaw_44kHzStereo, + SAFTCCITT_uLaw_8kHzMono, + SAFTCCITT_uLaw_8kHzStereo, + SAFTCCITT_uLaw_11kHzMono, + SAFTCCITT_uLaw_11kHzStereo, + SAFTCCITT_uLaw_22kHzMono, + SAFTCCITT_uLaw_22kHzStereo, + SAFTCCITT_uLaw_44kHzMono, + SAFTCCITT_uLaw_44kHzStereo, + SAFTADPCM_8kHzMono, + SAFTADPCM_8kHzStereo, + SAFTADPCM_11kHzMono, + SAFTADPCM_11kHzStereo, + SAFTADPCM_22kHzMono, + SAFTADPCM_22kHzStereo, + SAFTADPCM_44kHzMono, + SAFTADPCM_44kHzStereo, + SAFTGSM610_8kHzMono, + SAFTGSM610_11kHzMono, + SAFTGSM610_22kHzMono, + SAFTGSM610_44kHzMono, + DISPID_SpeechAudioFormat, + DISPID_SAFType, + DISPID_SAFGuid, + DISPID_SAFGetWaveFormatEx, + DISPID_SAFSetWaveFormatEx, + DISPID_SpeechBaseStream, + DISPID_SBSFormat, + DISPID_SBSRead, + DISPID_SBSWrite, + DISPID_SBSSeek, + SpeechStreamSeekPositionType, + SSSPTRelativeToStart, + SSSPTRelativeToCurrentPosition, + SSSPTRelativeToEnd, + DISPID_SpeechAudio, + DISPID_SAStatus, + DISPID_SABufferInfo, + DISPID_SADefaultFormat, + DISPID_SAVolume, + DISPID_SABufferNotifySize, + DISPID_SAEventHandle, + DISPID_SASetState, + SpeechAudioState, + SASClosed, + SASStop, + SASPause, + SASRun, + DISPID_SpeechMMSysAudio, + DISPID_SMSADeviceId, + DISPID_SMSALineId, + DISPID_SMSAMMHandle, + DISPID_SpeechFileStream, + DISPID_SFSOpen, + DISPID_SFSClose, + SpeechStreamFileMode, + SSFMOpenForRead, + SSFMOpenReadWrite, + SSFMCreate, + SSFMCreateForWrite, + DISPID_SpeechCustomStream, + DISPID_SCSBaseStream, + DISPID_SpeechMemoryStream, + DISPID_SMSSetData, + DISPID_SMSGetData, + DISPID_SpeechAudioStatus, + DISPID_SASFreeBufferSpace, + DISPID_SASNonBlockingIO, + DISPID_SASState, + DISPID_SASCurrentSeekPosition, + DISPID_SASCurrentDevicePosition, + DISPID_SpeechAudioBufferInfo, + DISPID_SABIMinNotification, + DISPID_SABIBufferSize, + DISPID_SABIEventBias, + DISPID_SpeechWaveFormatEx, + DISPID_SWFEFormatTag, + DISPID_SWFEChannels, + DISPID_SWFESamplesPerSec, + DISPID_SWFEAvgBytesPerSec, + DISPID_SWFEBlockAlign, + DISPID_SWFEBitsPerSample, + DISPID_SWFEExtraData, + DISPID_SpeechVoice, + DISPID_SVStatus, + DISPID_SVVoice, + DISPID_SVAudioOutput, + DISPID_SVAudioOutputStream, + DISPID_SVRate, + DISPID_SVVolume, + DISPID_SVAllowAudioOuputFormatChangesOnNextSet, + DISPID_SVEventInterests, + DISPID_SVPriority, + DISPID_SVAlertBoundary, + DISPID_SVSyncronousSpeakTimeout, + DISPID_SVSpeak, + DISPID_SVSpeakStream, + DISPID_SVPause, + DISPID_SVResume, + DISPID_SVSkip, + DISPID_SVGetVoices, + DISPID_SVGetAudioOutputs, + DISPID_SVWaitUntilDone, + DISPID_SVSpeakCompleteEvent, + DISPID_SVIsUISupported, + DISPID_SVDisplayUI, + SpeechVoicePriority, + SVPNormal, + SVPAlert, + SVPOver, + SpeechVoiceSpeakFlags, + SVSFDefault, + SVSFlagsAsync, + SVSFPurgeBeforeSpeak, + SVSFIsFilename, + SVSFIsXML, + SVSFIsNotXML, + SVSFPersistXML, + SVSFNLPSpeakPunc, + SVSFParseSapi, + SVSFParseSsml, + SVSFParseAutodetect, + SVSFNLPMask, + SVSFParseMask, + SVSFVoiceMask, + SVSFUnusedFlags, + SpeechVoiceEvents, + SVEStartInputStream, + SVEEndInputStream, + SVEVoiceChange, + SVEBookmark, + SVEWordBoundary, + SVEPhoneme, + SVESentenceBoundary, + SVEViseme, + SVEAudioLevel, + SVEPrivate, + SVEAllEvents, + DISPID_SpeechVoiceStatus, + DISPID_SVSCurrentStreamNumber, + DISPID_SVSLastStreamNumberQueued, + DISPID_SVSLastResult, + DISPID_SVSRunningState, + DISPID_SVSInputWordPosition, + DISPID_SVSInputWordLength, + DISPID_SVSInputSentencePosition, + DISPID_SVSInputSentenceLength, + DISPID_SVSLastBookmark, + DISPID_SVSLastBookmarkId, + DISPID_SVSPhonemeId, + DISPID_SVSVisemeId, + SpeechRunState, + SRSEDone, + SRSEIsSpeaking, + SpeechVisemeType, + SVP_0, + SVP_1, + SVP_2, + SVP_3, + SVP_4, + SVP_5, + SVP_6, + SVP_7, + SVP_8, + SVP_9, + SVP_10, + SVP_11, + SVP_12, + SVP_13, + SVP_14, + SVP_15, + SVP_16, + SVP_17, + SVP_18, + SVP_19, + SVP_20, + SVP_21, + SpeechVisemeFeature, + SVF_None, + SVF_Stressed, + SVF_Emphasis, + DISPID_SpeechVoiceEvent, + DISPID_SVEStreamStart, + DISPID_SVEStreamEnd, + DISPID_SVEVoiceChange, + DISPID_SVEBookmark, + DISPID_SVEWord, + DISPID_SVEPhoneme, + DISPID_SVESentenceBoundary, + DISPID_SVEViseme, + DISPID_SVEAudioLevel, + DISPID_SVEEnginePrivate, + DISPID_SpeechRecognizer, + DISPID_SRRecognizer, + DISPID_SRAllowAudioInputFormatChangesOnNextSet, + DISPID_SRAudioInput, + DISPID_SRAudioInputStream, + DISPID_SRIsShared, + DISPID_SRState, + DISPID_SRStatus, + DISPID_SRProfile, + DISPID_SREmulateRecognition, + DISPID_SRCreateRecoContext, + DISPID_SRGetFormat, + DISPID_SRSetPropertyNumber, + DISPID_SRGetPropertyNumber, + DISPID_SRSetPropertyString, + DISPID_SRGetPropertyString, + DISPID_SRIsUISupported, + DISPID_SRDisplayUI, + DISPID_SRGetRecognizers, + DISPID_SVGetAudioInputs, + DISPID_SVGetProfiles, + SpeechRecognizerState, + SRSInactive, + SRSActive, + SRSActiveAlways, + SRSInactiveWithPurge, + SpeechDisplayAttributes, + SDA_No_Trailing_Space, + SDA_One_Trailing_Space, + SDA_Two_Trailing_Spaces, + SDA_Consume_Leading_Spaces, + SpeechFormatType, + SFTInput, + SFTSREngine, + SpeechEmulationCompareFlags, + SECFIgnoreCase, + SECFIgnoreKanaType, + SECFIgnoreWidth, + SECFNoSpecialChars, + SECFEmulateResult, + SECFDefault, + DISPID_SpeechRecognizerStatus, + DISPID_SRSAudioStatus, + DISPID_SRSCurrentStreamPosition, + DISPID_SRSCurrentStreamNumber, + DISPID_SRSNumberOfActiveRules, + DISPID_SRSClsidEngine, + DISPID_SRSSupportedLanguages, + DISPID_SpeechRecoContext, + DISPID_SRCRecognizer, + DISPID_SRCAudioInInterferenceStatus, + DISPID_SRCRequestedUIType, + DISPID_SRCVoice, + DISPID_SRAllowVoiceFormatMatchingOnNextSet, + DISPID_SRCVoicePurgeEvent, + DISPID_SRCEventInterests, + DISPID_SRCCmdMaxAlternates, + DISPID_SRCState, + DISPID_SRCRetainedAudio, + DISPID_SRCRetainedAudioFormat, + DISPID_SRCPause, + DISPID_SRCResume, + DISPID_SRCCreateGrammar, + DISPID_SRCCreateResultFromMemory, + DISPID_SRCBookmark, + DISPID_SRCSetAdaptationData, + SpeechRetainedAudioOptions, + SRAONone, + SRAORetainAudio, + SpeechBookmarkOptions, + SBONone, + SBOPause, + SpeechInterference, + SINone, + SINoise, + SINoSignal, + SITooLoud, + SITooQuiet, + SITooFast, + SITooSlow, + SpeechRecoEvents, + SREStreamEnd, + SRESoundStart, + SRESoundEnd, + SREPhraseStart, + SRERecognition, + SREHypothesis, + SREBookmark, + SREPropertyNumChange, + SREPropertyStringChange, + SREFalseRecognition, + SREInterference, + SRERequestUI, + SREStateChange, + SREAdaptation, + SREStreamStart, + SRERecoOtherContext, + SREAudioLevel, + SREPrivate, + SREAllEvents, + SpeechRecoContextState, + SRCS_Disabled, + SRCS_Enabled, + DISPIDSPRG, + DISPID_SRGId, + DISPID_SRGRecoContext, + DISPID_SRGState, + DISPID_SRGRules, + DISPID_SRGReset, + DISPID_SRGCommit, + DISPID_SRGCmdLoadFromFile, + DISPID_SRGCmdLoadFromObject, + DISPID_SRGCmdLoadFromResource, + DISPID_SRGCmdLoadFromMemory, + DISPID_SRGCmdLoadFromProprietaryGrammar, + DISPID_SRGCmdSetRuleState, + DISPID_SRGCmdSetRuleIdState, + DISPID_SRGDictationLoad, + DISPID_SRGDictationUnload, + DISPID_SRGDictationSetState, + DISPID_SRGSetWordSequenceData, + DISPID_SRGSetTextSelection, + DISPID_SRGIsPronounceable, + SpeechLoadOption, + SLOStatic, + SLODynamic, + SpeechWordPronounceable, + SWPUnknownWordUnpronounceable, + SWPUnknownWordPronounceable, + SWPKnownWordPronounceable, + SpeechGrammarState, + SGSEnabled, + SGSDisabled, + SGSExclusive, + SpeechRuleState, + SGDSInactive, + SGDSActive, + SGDSActiveWithAutoPause, + SGDSActiveUserDelimited, + SpeechRuleAttributes, + SRATopLevel, + SRADefaultToActive, + SRAExport, + SRAImport, + SRAInterpreter, + SRADynamic, + SRARoot, + SpeechGrammarWordType, + SGDisplay, + SGLexical, + SGPronounciation, + SGLexicalNoSpecialChars, + DISPID_SpeechRecoContextEvents, + DISPID_SRCEStartStream, + DISPID_SRCEEndStream, + DISPID_SRCEBookmark, + DISPID_SRCESoundStart, + DISPID_SRCESoundEnd, + DISPID_SRCEPhraseStart, + DISPID_SRCERecognition, + DISPID_SRCEHypothesis, + DISPID_SRCEPropertyNumberChange, + DISPID_SRCEPropertyStringChange, + DISPID_SRCEFalseRecognition, + DISPID_SRCEInterference, + DISPID_SRCERequestUI, + DISPID_SRCERecognizerStateChange, + DISPID_SRCEAdaptation, + DISPID_SRCERecognitionForOtherContext, + DISPID_SRCEAudioLevel, + DISPID_SRCEEnginePrivate, + SpeechRecognitionType, + SRTStandard, + SRTAutopause, + SRTEmulated, + SRTSMLTimeout, + SRTExtendableParse, + SRTReSent, + DISPID_SpeechGrammarRule, + DISPID_SGRAttributes, + DISPID_SGRInitialState, + DISPID_SGRName, + DISPID_SGRId, + DISPID_SGRClear, + DISPID_SGRAddResource, + DISPID_SGRAddState, + DISPID_SpeechGrammarRules, + DISPID_SGRsCount, + DISPID_SGRsDynamic, + DISPID_SGRsAdd, + DISPID_SGRsCommit, + DISPID_SGRsCommitAndSave, + DISPID_SGRsFindRule, + DISPID_SGRsItem, + DISPID_SGRs_NewEnum, + DISPID_SpeechGrammarRuleState, + DISPID_SGRSRule, + DISPID_SGRSTransitions, + DISPID_SGRSAddWordTransition, + DISPID_SGRSAddRuleTransition, + DISPID_SGRSAddSpecialTransition, + SpeechSpecialTransitionType, + SSTTWildcard, + SSTTDictation, + SSTTTextBuffer, + DISPID_SpeechGrammarRuleStateTransitions, + DISPID_SGRSTsCount, + DISPID_SGRSTsItem, + DISPID_SGRSTs_NewEnum, + DISPID_SpeechGrammarRuleStateTransition, + DISPID_SGRSTType, + DISPID_SGRSTText, + DISPID_SGRSTRule, + DISPID_SGRSTWeight, + DISPID_SGRSTPropertyName, + DISPID_SGRSTPropertyId, + DISPID_SGRSTPropertyValue, + DISPID_SGRSTNextState, + SpeechGrammarRuleStateTransitionType, + SGRSTTEpsilon, + SGRSTTWord, + SGRSTTRule, + SGRSTTDictation, + SGRSTTWildcard, + SGRSTTTextBuffer, + DISPIDSPTSI, + DISPIDSPTSI_ActiveOffset, + DISPIDSPTSI_ActiveLength, + DISPIDSPTSI_SelectionOffset, + DISPIDSPTSI_SelectionLength, + DISPID_SpeechRecoResult, + DISPID_SRRRecoContext, + DISPID_SRRTimes, + DISPID_SRRAudioFormat, + DISPID_SRRPhraseInfo, + DISPID_SRRAlternates, + DISPID_SRRAudio, + DISPID_SRRSpeakAudio, + DISPID_SRRSaveToMemory, + DISPID_SRRDiscardResultInfo, + SpeechDiscardType, + SDTProperty, + SDTReplacement, + SDTRule, + SDTDisplayText, + SDTLexicalForm, + SDTPronunciation, + SDTAudio, + SDTAlternates, + SDTAll, + DISPID_SpeechXMLRecoResult, + DISPID_SRRGetXMLResult, + DISPID_SRRGetXMLErrorInfo, + DISPID_SpeechRecoResult2, + DISPID_SRRSetTextFeedback, + DISPID_SpeechPhraseBuilder, + DISPID_SPPBRestorePhraseFromMemory, + DISPID_SpeechRecoResultTimes, + DISPID_SRRTStreamTime, + DISPID_SRRTLength, + DISPID_SRRTTickCount, + DISPID_SRRTOffsetFromStart, + DISPID_SpeechPhraseAlternate, + DISPID_SPARecoResult, + DISPID_SPAStartElementInResult, + DISPID_SPANumberOfElementsInResult, + DISPID_SPAPhraseInfo, + DISPID_SPACommit, + DISPID_SpeechPhraseAlternates, + DISPID_SPAsCount, + DISPID_SPAsItem, + DISPID_SPAs_NewEnum, + DISPID_SpeechPhraseInfo, + DISPID_SPILanguageId, + DISPID_SPIGrammarId, + DISPID_SPIStartTime, + DISPID_SPIAudioStreamPosition, + DISPID_SPIAudioSizeBytes, + DISPID_SPIRetainedSizeBytes, + DISPID_SPIAudioSizeTime, + DISPID_SPIRule, + DISPID_SPIProperties, + DISPID_SPIElements, + DISPID_SPIReplacements, + DISPID_SPIEngineId, + DISPID_SPIEnginePrivateData, + DISPID_SPISaveToMemory, + DISPID_SPIGetText, + DISPID_SPIGetDisplayAttributes, + DISPID_SpeechPhraseElement, + DISPID_SPEAudioTimeOffset, + DISPID_SPEAudioSizeTime, + DISPID_SPEAudioStreamOffset, + DISPID_SPEAudioSizeBytes, + DISPID_SPERetainedStreamOffset, + DISPID_SPERetainedSizeBytes, + DISPID_SPEDisplayText, + DISPID_SPELexicalForm, + DISPID_SPEPronunciation, + DISPID_SPEDisplayAttributes, + DISPID_SPERequiredConfidence, + DISPID_SPEActualConfidence, + DISPID_SPEEngineConfidence, + SpeechEngineConfidence, + SECLowConfidence, + SECNormalConfidence, + SECHighConfidence, + DISPID_SpeechPhraseElements, + DISPID_SPEsCount, + DISPID_SPEsItem, + DISPID_SPEs_NewEnum, + DISPID_SpeechPhraseReplacement, + DISPID_SPRDisplayAttributes, + DISPID_SPRText, + DISPID_SPRFirstElement, + DISPID_SPRNumberOfElements, + DISPID_SpeechPhraseReplacements, + DISPID_SPRsCount, + DISPID_SPRsItem, + DISPID_SPRs_NewEnum, + DISPID_SpeechPhraseProperty, + DISPID_SPPName, + DISPID_SPPId, + DISPID_SPPValue, + DISPID_SPPFirstElement, + DISPID_SPPNumberOfElements, + DISPID_SPPEngineConfidence, + DISPID_SPPConfidence, + DISPID_SPPParent, + DISPID_SPPChildren, + DISPID_SpeechPhraseProperties, + DISPID_SPPsCount, + DISPID_SPPsItem, + DISPID_SPPs_NewEnum, + DISPID_SpeechPhraseRule, + DISPID_SPRuleName, + DISPID_SPRuleId, + DISPID_SPRuleFirstElement, + DISPID_SPRuleNumberOfElements, + DISPID_SPRuleParent, + DISPID_SPRuleChildren, + DISPID_SPRuleConfidence, + DISPID_SPRuleEngineConfidence, + DISPID_SpeechPhraseRules, + DISPID_SPRulesCount, + DISPID_SPRulesItem, + DISPID_SPRules_NewEnum, + DISPID_SpeechLexicon, + DISPID_SLGenerationId, + DISPID_SLGetWords, + DISPID_SLAddPronunciation, + DISPID_SLAddPronunciationByPhoneIds, + DISPID_SLRemovePronunciation, + DISPID_SLRemovePronunciationByPhoneIds, + DISPID_SLGetPronunciations, + DISPID_SLGetGenerationChange, + SpeechLexiconType, + SLTUser, + SLTApp, + SpeechPartOfSpeech, + SPSNotOverriden, + SPSUnknown, + SPSNoun, + SPSVerb, + SPSModifier, + SPSFunction, + SPSInterjection, + SPSLMA, + SPSSuppressWord, + DISPID_SpeechLexiconWords, + DISPID_SLWsCount, + DISPID_SLWsItem, + DISPID_SLWs_NewEnum, + SpeechWordType, + SWTAdded, + SWTDeleted, + DISPID_SpeechLexiconWord, + DISPID_SLWLangId, + DISPID_SLWType, + DISPID_SLWWord, + DISPID_SLWPronunciations, + DISPID_SpeechLexiconProns, + DISPID_SLPsCount, + DISPID_SLPsItem, + DISPID_SLPs_NewEnum, + DISPID_SpeechLexiconPronunciation, + DISPID_SLPType, + DISPID_SLPLangId, + DISPID_SLPPartOfSpeech, + DISPID_SLPPhoneIds, + DISPID_SLPSymbolic, + DISPID_SpeechPhoneConverter, + DISPID_SPCLangId, + DISPID_SPCPhoneToId, + DISPID_SPCIdToPhone, + LIBID_SpeechLib, + ISpeechDataKey, ISpeechDataKeyVtbl, + ISpeechObjectToken, ISpeechObjectTokenVtbl, + ISpeechObjectTokens, ISpeechObjectTokensVtbl, + ISpeechObjectTokenCategory, ISpeechObjectTokenCategoryVtbl, + ISpeechAudioBufferInfo, ISpeechAudioBufferInfoVtbl, + ISpeechAudioStatus, ISpeechAudioStatusVtbl, + ISpeechAudioFormat, ISpeechAudioFormatVtbl, + ISpeechWaveFormatEx, ISpeechWaveFormatExVtbl, + ISpeechBaseStream, ISpeechBaseStreamVtbl, + ISpeechFileStream, ISpeechFileStreamVtbl, + ISpeechMemoryStream, ISpeechMemoryStreamVtbl, + ISpeechCustomStream, ISpeechCustomStreamVtbl, + ISpeechAudio, ISpeechAudioVtbl, + ISpeechMMSysAudio, ISpeechMMSysAudioVtbl, + ISpeechVoice, ISpeechVoiceVtbl, + ISpeechVoiceStatus, ISpeechVoiceStatusVtbl, + _ISpeechVoiceEvents, _ISpeechVoiceEventsVtbl, + ISpeechRecognizer, ISpeechRecognizerVtbl, + ISpeechRecognizerStatus, ISpeechRecognizerStatusVtbl, + ISpeechRecoContext, ISpeechRecoContextVtbl, + ISpeechRecoGrammar, ISpeechRecoGrammarVtbl, + _ISpeechRecoContextEvents, _ISpeechRecoContextEventsVtbl, + ISpeechGrammarRule, ISpeechGrammarRuleVtbl, + ISpeechGrammarRules, ISpeechGrammarRulesVtbl, + ISpeechGrammarRuleState, ISpeechGrammarRuleStateVtbl, + ISpeechGrammarRuleStateTransition, ISpeechGrammarRuleStateTransitionVtbl, + ISpeechGrammarRuleStateTransitions, ISpeechGrammarRuleStateTransitionsVtbl, + ISpeechTextSelectionInformation, ISpeechTextSelectionInformationVtbl, + ISpeechRecoResult, ISpeechRecoResultVtbl, + ISpeechRecoResult2, ISpeechRecoResult2Vtbl, + ISpeechRecoResultTimes, ISpeechRecoResultTimesVtbl, + ISpeechPhraseAlternate, ISpeechPhraseAlternateVtbl, + ISpeechPhraseAlternates, ISpeechPhraseAlternatesVtbl, + ISpeechPhraseInfo, ISpeechPhraseInfoVtbl, + ISpeechPhraseElement, ISpeechPhraseElementVtbl, + ISpeechPhraseElements, ISpeechPhraseElementsVtbl, + ISpeechPhraseReplacement, ISpeechPhraseReplacementVtbl, + ISpeechPhraseReplacements, ISpeechPhraseReplacementsVtbl, + ISpeechPhraseProperty, ISpeechPhrasePropertyVtbl, + ISpeechPhraseProperties, ISpeechPhrasePropertiesVtbl, + ISpeechPhraseRule, ISpeechPhraseRuleVtbl, + ISpeechPhraseRules, ISpeechPhraseRulesVtbl, + ISpeechLexicon, ISpeechLexiconVtbl, + ISpeechLexiconWords, ISpeechLexiconWordsVtbl, + ISpeechLexiconWord, ISpeechLexiconWordVtbl, + ISpeechLexiconPronunciations, ISpeechLexiconPronunciationsVtbl, + ISpeechLexiconPronunciation, ISpeechLexiconPronunciationVtbl, + Speech_Default_Weight, + Speech_Max_Word_Length, + Speech_Max_Pron_Length, + Speech_StreamPos_Asap, + Speech_StreamPos_RealTime, + SpeechAllElements, + ISpeechXMLRecoResult, ISpeechXMLRecoResultVtbl, + ISpeechRecoResultDispatch, ISpeechRecoResultDispatchVtbl, + ISpeechPhraseInfoBuilder, ISpeechPhraseInfoBuilderVtbl, + ISpeechPhoneConverter, ISpeechPhoneConverterVtbl, + CLSID_SpNotifyTranslator, + CLSID_SpObjectTokenCategory, + CLSID_SpObjectToken, + CLSID_SpResourceManager, + CLSID_SpStreamFormatConverter, + CLSID_SpMMAudioEnum, + CLSID_SpMMAudioIn, + CLSID_SpMMAudioOut, + CLSID_SpStream, + CLSID_SpVoice, + CLSID_SpSharedRecoContext, + CLSID_SpInprocRecognizer, + CLSID_SpSharedRecognizer, + CLSID_SpLexicon, + CLSID_SpUnCompressedLexicon, + CLSID_SpCompressedLexicon, + CLSID_SpShortcut, + CLSID_SpPhoneConverter, + CLSID_SpPhoneticAlphabetConverter, + CLSID_SpNullPhoneConverter, + CLSID_SpTextSelectionInformation, + CLSID_SpPhraseInfoBuilder, + CLSID_SpAudioFormat, + CLSID_SpWaveFormatEx, + CLSID_SpInProcRecoContext, + CLSID_SpCustomStream, + CLSID_SpFileStream, + CLSID_SpMemoryStream, +}; diff --git a/bash-5.1/vendor/winapi/src/um/sapi51.rs b/bash-5.1/vendor/winapi/src/um/sapi51.rs new file mode 100644 index 0000000000000000000000000000000000000000..db1d46438e0a3cb836ea1ef440551b87aa40a0d2 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sapi51.rs @@ -0,0 +1,3726 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! SAPI 5.1 definitions +use ctypes::{c_char, c_float, c_long, c_short, c_ushort, c_void}; +use shared::guiddef::{CLSID, GUID, IID, REFCLSID, REFGUID, REFIID}; +use shared::minwindef::{ + BOOL, BYTE, DWORD, FILETIME, HKEY, HMODULE, LPARAM, UINT, ULONG, USHORT, WORD, WPARAM +}; +use shared::mmreg::WAVEFORMATEX; +use shared::rpcndr::byte; +use shared::windef::HWND; +use shared::wtypes::{BSTR, VARIANT_BOOL}; +use shared::wtypesbase::{ + CLSCTX_INPROC_HANDLER, CLSCTX_INPROC_SERVER, CLSCTX_LOCAL_SERVER, CLSCTX_REMOTE_SERVER +}; +use um::oaidl::{DISPID_NEWENUM, DISPID_VALUE, IDispatch, IDispatchVtbl, VARIANT}; +use um::objidlbase::{IStream, IStreamVtbl, STREAM_SEEK_CUR, STREAM_SEEK_END, STREAM_SEEK_SET}; +use um::servprov::{IServiceProvider, IServiceProviderVtbl}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, LONG, LONGLONG, LPCWSTR, LPWSTR, ULONGLONG, WCHAR}; +ENUM!{enum SPDATAKEYLOCATION { + SPDKL_DefaultLocation = 0, + SPDKL_CurrentUser = 1, + SPDKL_LocalMachine = 2, + SPDKL_CurrentConfig = 5, +}} +pub const SPDUI_EngineProperties: &'static str = "EngineProperties"; +pub const SPDUI_AddRemoveWord: &'static str = "AddRemoveWord"; +pub const SPDUI_UserTraining: &'static str = "UserTraining"; +pub const SPDUI_MicTraining: &'static str = "MicTraining"; +pub const SPDUI_RecoProfileProperties: &'static str = "RecoProfileProperties"; +pub const SPDUI_AudioProperties: &'static str = "AudioProperties"; +pub const SPDUI_AudioVolume: &'static str = "AudioVolume"; +pub const SPDUI_UserEnrollment: &'static str = "UserEnrollment"; +pub const SPDUI_ShareData: &'static str = "ShareData"; +pub const SPDUI_Tutorial: &'static str = "Tutorial"; +ENUM!{enum SPSTREAMFORMAT { + SPSF_Default = -1i32 as u32, + SPSF_NoAssignedFormat = 0, + SPSF_Text = 1, + SPSF_NonStandardFormat = 2, + SPSF_ExtendedAudioFormat = 3, + SPSF_8kHz8BitMono = 4, + SPSF_8kHz8BitStereo = 5, + SPSF_8kHz16BitMono = 6, + SPSF_8kHz16BitStereo = 7, + SPSF_11kHz8BitMono = 8, + SPSF_11kHz8BitStereo = 9, + SPSF_11kHz16BitMono = 10, + SPSF_11kHz16BitStereo = 11, + SPSF_12kHz8BitMono = 12, + SPSF_12kHz8BitStereo = 13, + SPSF_12kHz16BitMono = 14, + SPSF_12kHz16BitStereo = 15, + SPSF_16kHz8BitMono = 16, + SPSF_16kHz8BitStereo = 17, + SPSF_16kHz16BitMono = 18, + SPSF_16kHz16BitStereo = 19, + SPSF_22kHz8BitMono = 20, + SPSF_22kHz8BitStereo = 21, + SPSF_22kHz16BitMono = 22, + SPSF_22kHz16BitStereo = 23, + SPSF_24kHz8BitMono = 24, + SPSF_24kHz8BitStereo = 25, + SPSF_24kHz16BitMono = 26, + SPSF_24kHz16BitStereo = 27, + SPSF_32kHz8BitMono = 28, + SPSF_32kHz8BitStereo = 29, + SPSF_32kHz16BitMono = 30, + SPSF_32kHz16BitStereo = 31, + SPSF_44kHz8BitMono = 32, + SPSF_44kHz8BitStereo = 33, + SPSF_44kHz16BitMono = 34, + SPSF_44kHz16BitStereo = 35, + SPSF_48kHz8BitMono = 36, + SPSF_48kHz8BitStereo = 37, + SPSF_48kHz16BitMono = 38, + SPSF_48kHz16BitStereo = 39, + SPSF_TrueSpeech_8kHz1BitMono = 40, + SPSF_CCITT_ALaw_8kHzMono = 41, + SPSF_CCITT_ALaw_8kHzStereo = 42, + SPSF_CCITT_ALaw_11kHzMono = 43, + SPSF_CCITT_ALaw_11kHzStereo = 44, + SPSF_CCITT_ALaw_22kHzMono = 45, + SPSF_CCITT_ALaw_22kHzStereo = 46, + SPSF_CCITT_ALaw_44kHzMono = 47, + SPSF_CCITT_ALaw_44kHzStereo = 48, + SPSF_CCITT_uLaw_8kHzMono = 49, + SPSF_CCITT_uLaw_8kHzStereo = 50, + SPSF_CCITT_uLaw_11kHzMono = 51, + SPSF_CCITT_uLaw_11kHzStereo = 52, + SPSF_CCITT_uLaw_22kHzMono = 53, + SPSF_CCITT_uLaw_22kHzStereo = 54, + SPSF_CCITT_uLaw_44kHzMono = 55, + SPSF_CCITT_uLaw_44kHzStereo = 56, + SPSF_ADPCM_8kHzMono = 57, + SPSF_ADPCM_8kHzStereo = 58, + SPSF_ADPCM_11kHzMono = 59, + SPSF_ADPCM_11kHzStereo = 60, + SPSF_ADPCM_22kHzMono = 61, + SPSF_ADPCM_22kHzStereo = 62, + SPSF_ADPCM_44kHzMono = 63, + SPSF_ADPCM_44kHzStereo = 64, + SPSF_GSM610_8kHzMono = 65, + SPSF_GSM610_11kHzMono = 66, + SPSF_GSM610_22kHzMono = 67, + SPSF_GSM610_44kHzMono = 68, + SPSF_NUM_FORMATS = 69, +}} +extern { + pub static SPDFID_Text: GUID; + pub static SPDFID_WaveFormatEx: GUID; +} +pub const SPREG_USER_ROOT: &'static str = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech"; +pub const SPREG_LOCAL_MACHINE_ROOT: &'static str + = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech"; +pub const SPCAT_AUDIOOUT: &'static str + = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioOutput"; +pub const SPCAT_AUDIOIN: &'static str + = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioInput"; +pub const SPCAT_VOICES: &'static str = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices"; +pub const SPCAT_RECOGNIZERS: &'static str + = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Recognizers"; +pub const SPCAT_APPLEXICONS: &'static str + = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AppLexicons"; +pub const SPCAT_PHONECONVERTERS: &'static str + = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\PhoneConverters"; +pub const SPCAT_TEXTNORMALIZERS: &'static str + = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\TextNormalizers"; +pub const SPCAT_RECOPROFILES: &'static str + = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech\\RecoProfiles"; +pub const SPMMSYS_AUDIO_IN_TOKEN_ID: &'static str + = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioInput\\TokenEnums\\MMAudioIn\\"; +pub const SPMMSYS_AUDIO_OUT_TOKEN_ID: &'static str + = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\AudioOutput\\TokenEnums\\MMAudioOut\\"; +pub const SPCURRENT_USER_LEXICON_TOKEN_ID: &'static str + = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech\\CurrentUserLexicon"; +pub const SPCURRENT_USER_SHORTCUT_TOKEN_ID: &'static str + = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Speech\\CurrentUserShortcut"; +pub const SPTOKENVALUE_CLSID: &'static str = "CLSID"; +pub const SPTOKENKEY_FILES: &'static str = "Files"; +pub const SPTOKENKEY_UI: &'static str = "UI"; +pub const SPTOKENKEY_ATTRIBUTES: &'static str = "Attributes"; +pub const SPVOICECATEGORY_TTSRATE: &'static str = "DefaultTTSRate"; +pub const SPPROP_RESOURCE_USAGE: &'static str = "ResourceUsage"; +pub const SPPROP_HIGH_CONFIDENCE_THRESHOLD: &'static str = "HighConfidenceThreshold"; +pub const SPPROP_NORMAL_CONFIDENCE_THRESHOLD: &'static str = "NormalConfidenceThreshold"; +pub const SPPROP_LOW_CONFIDENCE_THRESHOLD: &'static str = "LowConfidenceThreshold"; +pub const SPPROP_RESPONSE_SPEED: &'static str = "ResponseSpeed"; +pub const SPPROP_COMPLEX_RESPONSE_SPEED: &'static str = "ComplexResponseSpeed"; +pub const SPPROP_ADAPTATION_ON: &'static str = "AdaptationOn"; +pub const SPPROP_PERSISTED_BACKGROUND_ADAPTATION: &'static str = "PersistedBackgroundAdaptation"; +pub const SPPROP_PERSISTED_LANGUAGE_MODEL_ADAPTATION: &'static str + = "PersistedLanguageModelAdaptation"; +pub const SPPROP_UX_IS_LISTENING: &'static str = "UXIsListening"; +pub const SPTOPIC_SPELLING: &'static str = "Spelling"; +pub const SPWILDCARD: &'static str = "..."; +pub const SPDICTATION: &'static str = "*"; +pub const SPINFDICTATION: &'static str = "*+"; +pub const SP_LOW_CONFIDENCE: c_char = -1; +pub const SP_NORMAL_CONFIDENCE: c_char = 0; +pub const SP_HIGH_CONFIDENCE: c_char = 1; +pub const DEFAULT_WEIGHT: c_float = 1.0; +pub const SP_MAX_WORD_LENGTH: ULONG = 128; +pub const SP_MAX_PRON_LENGTH: ULONG = 384; +RIDL!{#[uuid(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)] +interface ISpNotifyCallback(ISpNotifyCallbackVtbl) { + fn NotifyCallback( + wParam: WPARAM, + lParam: LPARAM, + ) -> HRESULT, +}} +FN!{stdcall SPNOTIFYCALLBACK( + wParam: WPARAM, + lParam: LPARAM, +) -> ()} +RIDL!{#[uuid(0x5eff4aef, 0x8487, 0x11d2, 0x96, 0x1c, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0x28)] +interface ISpNotifySource(ISpNotifySourceVtbl): IUnknown(IUnknownVtbl) { + fn SetNotifySink( + pNotifySink: *mut ISpNotifySink, + ) -> HRESULT, + fn SetNotifyWindowMessage( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> HRESULT, + fn SetNotifyCallbackFunction( + pfnCallback: SPNOTIFYCALLBACK, + wParam: WPARAM, + lParam: LPARAM, + ) -> HRESULT, + fn SetNotifyCallbackInterface( + pSpCallback: *mut ISpNotifyCallback, + wParam: WPARAM, + lParam: LPARAM, + ) -> HRESULT, + fn SetNotifyWin32Event() -> HRESULT, + fn WaitForNotifyEvent( + dwMilliseconds: DWORD, + ) -> HRESULT, + fn GetNotifyEventHandle() -> HANDLE, +}} +RIDL!{#[uuid(0x259684dc, 0x37c3, 0x11d2, 0x96, 0x03, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0x28)] +interface ISpNotifySink(ISpNotifySinkVtbl): IUnknown(IUnknownVtbl) { + fn Notify() -> HRESULT, +}} +RIDL!{#[uuid(0xaca16614, 0x5d3d, 0x11d2, 0x96, 0x0e, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0x28)] +interface ISpNotifyTranslator(ISpNotifyTranslatorVtbl): ISpNotifySink(ISpNotifySinkVtbl) { + fn InitWindowMessage( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> HRESULT, + fn InitCallback( + pfnCallback: SPNOTIFYCALLBACK, + wParam: WPARAM, + lParam: LPARAM, + ) -> HRESULT, + fn InitSpNotifyCallback( + pSpCallback: *mut ISpNotifyCallback, + wParam: WPARAM, + lParam: LPARAM, + ) -> HRESULT, + fn InitWin32Event( + hEvent: HANDLE, + fCloseHandleOnRelease: BOOL, + ) -> HRESULT, + fn Wait( + dwMilliseconds: DWORD, + ) -> HRESULT, + fn GetEventHandle() -> HANDLE, +}} +RIDL!{#[uuid(0x14056581, 0xe16c, 0x11d2, 0xbb, 0x90, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0xc0)] +interface ISpDataKey(ISpDataKeyVtbl): IUnknown(IUnknownVtbl) { + fn SetData( + pszValueName: LPCWSTR, + cbData: ULONG, + pData: *const BYTE, + ) -> HRESULT, + fn GetData( + pszValueName: LPCWSTR, + pcbData: *mut ULONG, + pData: *mut BYTE, + ) -> HRESULT, + fn SetStringValue( + pszValueName: LPCWSTR, + pszValue: LPCWSTR, + ) -> HRESULT, + fn GetStringValue( + pszValueName: LPCWSTR, + ppszValue: *mut LPWSTR, + ) -> HRESULT, + fn SetDWORD( + pszValueName: LPCWSTR, + dwValue: DWORD, + ) -> HRESULT, + fn GetDWORD( + pszValueName: LPCWSTR, + pdwValue: *mut DWORD, + ) -> HRESULT, + fn OpenKey( + pszSubKeyName: LPCWSTR, + ppSubKey: *mut *mut ISpDataKey, + ) -> HRESULT, + fn CreateKey( + pszSubKey: LPCWSTR, + ppSubKey: *mut *mut ISpDataKey, + ) -> HRESULT, + fn DeleteKey( + pszSubKey: LPCWSTR, + ) -> HRESULT, + fn DeleteValue( + pszValueName: LPCWSTR, + ) -> HRESULT, + fn EnumKeys( + Index: ULONG, + ppszSubKeyName: *mut LPWSTR, + ) -> HRESULT, + fn EnumValues( + Index: ULONG, + ppszValueName: *mut LPWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x92a66e2b, 0xc830, 0x4149, 0x83, 0xdf, 0x6f, 0xc2, 0xba, 0x1e, 0x7a, 0x5b)] +interface ISpRegDataKey(ISpRegDataKeyVtbl): ISpDataKey(ISpDataKeyVtbl) { + fn SetKey( + hkey: HKEY, + fReadOnly: BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2d3d3845, 0x39af, 0x4850, 0xbb, 0xf9, 0x40, 0xb4, 0x97, 0x80, 0x01, 0x1d)] +interface ISpObjectTokenCategory(ISpObjectTokenCategoryVtbl): ISpDataKey(ISpDataKeyVtbl) { + fn SetId( + pszCategoryId: LPCWSTR, + fCreateIfNotExist: BOOL, + ) -> HRESULT, + fn GetId( + ppszCoMemCategoryId: *mut LPWSTR, + ) -> HRESULT, + fn GetDataKey( + spdkl: SPDATAKEYLOCATION, + pppDataKey: *mut *mut ISpDataKey, + ) -> HRESULT, + fn EnumTokens( + pzsReqAttribs: LPCWSTR, + pszOptAttribs: LPCWSTR, + ppEnum: *mut *mut IEnumSpObjectTokens, + ) -> HRESULT, + fn SetDefaultTokenId( + pszTokenId: LPCWSTR, + ) -> HRESULT, + fn GetDefaultTokenId( + ppszCoMemTokenId: *mut LPWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x14056589, 0xe16c, 0x11d2, 0xbb, 0x90, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0xc0)] +interface ISpObjectToken(ISpObjectTokenVtbl): ISpDataKey(ISpDataKeyVtbl) { + fn SetId( + pszCategoryId: LPCWSTR, + pszTokenId: LPCWSTR, + fCreateIfNotExist: BOOL, + ) -> HRESULT, + fn GetId( + ppszCoMemTokenId: *mut LPWSTR, + ) -> HRESULT, + fn GetCategory( + ppTokenCategory: *mut *mut ISpObjectTokenCategory, + ) -> HRESULT, + fn CreateInstance( + pUnkOuter: *mut IUnknown, + dwClsContext: DWORD, + riid: REFIID, + ppvObject: *mut *mut c_void, + ) -> HRESULT, + fn GetStorageFileName( + clsidCaller: REFCLSID, + pszValueName: LPCWSTR, + pszFileNameSpecifier: LPCWSTR, + nFolder: ULONG, + ppszFilePath: *mut LPWSTR, + ) -> HRESULT, + fn RemoveStorageFileName( + pszKeyName: LPCWSTR, + fDeleteFile: BOOL, + ) -> HRESULT, + fn Remove( + pclsidCaller: *const CLSID, + ) -> HRESULT, + fn IsUISupported( + pszTypeOfUI: LPCWSTR, + pvExtraData: *mut c_void, + cbExtraData: ULONG, + punkObject: *mut IUnknown, + pfSupported: *mut BOOL, + ) -> HRESULT, + fn DisplayUI( + hwndParent: HWND, + pszTitle: LPCWSTR, + pszTypeOfUI: LPCWSTR, + pvExtraData: *mut c_void, + cbExtraData: ULONG, + punkObject: *mut IUnknown, + ) -> HRESULT, + fn MatchesAttributes( + pszAttributes: LPCWSTR, + pfMatches: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb8aab0cf, 0x346f, 0x49d8, 0x94, 0x99, 0xc8, 0xb0, 0x3f, 0x16, 0x1d, 0x51)] +interface ISpObjectTokenInit(ISpObjectTokenInitVtbl): ISpObjectToken(ISpObjectTokenVtbl) { + fn InitFromDataKey( + pszCategoryId: LPCWSTR, + pszTokenId: LPCWSTR, + pDataKey: *mut ISpDataKey, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x06b64f9e, 0x7fda, 0x11d2, 0xb4, 0xf2, 0x00, 0xc0, 0x4f, 0x79, 0x73, 0x96)] +interface IEnumSpObjectTokens(IEnumSpObjectTokensVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + pelt: *mut *mut ISpObjectToken, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppEnum: *mut *mut IEnumSpObjectTokens, + ) -> HRESULT, + fn Item( + Index: ULONG, + ppToken: *mut *mut ISpObjectToken, + ) -> HRESULT, + fn GetCount( + pCount: *mut ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5b559f40, 0xe952, 0x11d2, 0xbb, 0x91, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0xc0)] +interface ISpObjectWithToken(ISpObjectWithTokenVtbl): IUnknown(IUnknownVtbl) { + fn SetObjectToken( + pToken: *mut ISpObjectToken, + ) -> HRESULT, + fn GetObjectToken( + ppToken: *mut *mut ISpObjectToken, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x93384e18, 0x5014, 0x43d5, 0xad, 0xbb, 0xa7, 0x8e, 0x05, 0x59, 0x26, 0xbd)] +interface ISpResourceManager(ISpResourceManagerVtbl): IServiceProvider(IServiceProviderVtbl) { + fn SetObject( + guidServiceId: REFGUID, + pUnkObject: *mut IUnknown, + ) -> HRESULT, + fn GetObject( + guidServiceId: REFGUID, + ObjectCLSID: REFCLSID, + ObjectIID: REFIID, + fReleaseWhenLastExternalRefReleased: BOOL, + ppObject: *mut *mut c_void, + ) -> HRESULT, +}} +ENUM!{enum SPEVENTLPARAMTYPE { + SPET_LPARAM_IS_UNDEFINED = 0, + SPET_LPARAM_IS_TOKEN, + SPET_LPARAM_IS_OBJECT, + SPET_LPARAM_IS_POINTER, + SPET_LPARAM_IS_STRING, +}} +ENUM!{enum SPEVENTENUM { + SPEI_UNDEFINED = 0, + SPEI_START_INPUT_STREAM = 1, + SPEI_END_INPUT_STREAM = 2, + SPEI_VOICE_CHANGE = 3, + SPEI_TTS_BOOKMARK = 4, + SPEI_WORD_BOUNDARY = 5, + SPEI_PHONEME = 6, + SPEI_SENTENCE_BOUNDARY = 7, + SPEI_VISEME = 8, + SPEI_TTS_AUDIO_LEVEL = 9, + SPEI_TTS_PRIVATE = 15, + SPEI_MIN_TTS = 1, + SPEI_MAX_TTS = 15, + SPEI_END_SR_STREAM = 34, + SPEI_SOUND_START = 35, + SPEI_SOUND_END = 36, + SPEI_PHRASE_START = 37, + SPEI_RECOGNITION = 38, + SPEI_HYPOTHESIS = 39, + SPEI_SR_BOOKMARK = 40, + SPEI_PROPERTY_NUM_CHANGE = 41, + SPEI_PROPERTY_STRING_CHANGE = 42, + SPEI_FALSE_RECOGNITION = 43, + SPEI_INTERFERENCE = 44, + SPEI_REQUEST_UI = 45, + SPEI_RECO_STATE_CHANGE = 46, + SPEI_ADAPTATION = 47, + SPEI_START_SR_STREAM = 48, + SPEI_RECO_OTHER_CONTEXT = 49, + SPEI_SR_AUDIO_LEVEL = 50, + SPEI_SR_PRIVATE = 52, + SPEI_MIN_SR = 34, + SPEI_MAX_SR = 52, + SPEI_RESERVED1 = 30, + SPEI_RESERVED2 = 33, + SPEI_RESERVED3 = 63, +}} +pub const SPFEI_FLAGCHECK: ULONGLONG = (1 << SPEI_RESERVED1) | (1 << SPEI_RESERVED2); +pub const SPFEI_ALL_TTS_EVENTS: ULONGLONG = 0x000000000000FFFE | SPFEI_FLAGCHECK; +pub const SPFEI_ALL_SR_EVENTS: ULONGLONG = 0x003FFFFC00000000 | SPFEI_FLAGCHECK; +pub const SPFEI_ALL_EVENTS: ULONGLONG = 0xEFFFFFFFFFFFFFFF; +#[inline] +pub fn SPFEI( + SPEI_ord: SPEVENTENUM, + ) -> ULONGLONG { + (1 << SPEI_ord) | SPFEI_FLAGCHECK +} +STRUCT!{struct SPEVENT { + bitfields: DWORD, + ulStreamNum: ULONG, + ullAudioStreamOffset: ULONGLONG, + wParam: WPARAM, + lParam: LPARAM, +}} +BITFIELD!{SPEVENT bitfields: SPEVENTENUM [ eEventId set_eEventId[0..16], ]} +BITFIELD!{SPEVENT bitfields: SPEVENTLPARAMTYPE [ elParamType set_elParamType[16..32], ]} +STRUCT!{struct SPSERIALIZEDEVENT { + bitfields: DWORD, + ulStreamNum: ULONG, + ullAudioStreamOffset: ULONGLONG, + SerializedwParam: ULONG, + SerializedlParam: LONG, +}} +BITFIELD!{SPSERIALIZEDEVENT bitfields: SPEVENTENUM [ eEventId set_eEventId[0..16], ]} +BITFIELD!{SPSERIALIZEDEVENT bitfields: SPEVENTLPARAMTYPE [ elParamType set_elParamType[16..32], ]} +STRUCT!{struct SPSERIALIZEDEVENT64 { + bitfields: DWORD, + ulStreamNum: ULONG, + ullAudioStreamOffset: ULONGLONG, + SerializedwParam: ULONGLONG, + SerializedlParam: LONGLONG, +}} +BITFIELD!{SPSERIALIZEDEVENT64 bitfields: SPEVENTENUM [ + eEventId set_eEventId[0..16], +]} +BITFIELD!{SPSERIALIZEDEVENT64 bitfields: SPEVENTLPARAMTYPE [ + elParamType set_elParamType[16..32], +]} +ENUM!{enum SPINTERFERENCE { + SPINTERFERENCE_NONE = 0, + SPINTERFERENCE_NOISE, + SPINTERFERENCE_NOSIGNAL, + SPINTERFERENCE_TOOLOUD, + SPINTERFERENCE_TOOQUIET, + SPINTERFERENCE_TOOFAST, + SPINTERFERENCE_TOOSLOW, + SPINTERFERENCE_LATENCY_WARNING, + SPINTERFERENCE_LATENCY_TRUNCATE_BEGIN , + SPINTERFERENCE_LATENCY_TRUNCATE_END, +}} +ENUM!{enum SPENDSRSTREAMFLAGS { + SPESF_NONE = 0, + SPESF_STREAM_RELEASED = 1 << 0, + SPESF_EMULATED = 1 << 1, +}} +ENUM!{enum SPVFEATURE { + SPVFEATURE_STRESSED = 1 << 0, + SPVFEATURE_EMPHASIS = 1 << 1, +}} +ENUM!{enum SPVISEMES { + SP_VISEME_0 = 0, + SP_VISEME_1, + SP_VISEME_2, + SP_VISEME_3, + SP_VISEME_4, + SP_VISEME_5, + SP_VISEME_6, + SP_VISEME_7, + SP_VISEME_8, + SP_VISEME_9, + SP_VISEME_10, + SP_VISEME_11, + SP_VISEME_12, + SP_VISEME_13, + SP_VISEME_14, + SP_VISEME_15, + SP_VISEME_16, + SP_VISEME_17, + SP_VISEME_18, + SP_VISEME_19, + SP_VISEME_20, + SP_VISEME_21, +}} +STRUCT!{struct SPEVENTSOURCEINFO { + ullEventInterest: ULONGLONG, + ullQueuedInterest: ULONGLONG, + ulCount: ULONG, +}} +RIDL!{#[uuid(0xbe7a9cce, 0x5f9e, 0x11d2, 0x96, 0x0f, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0x28)] +interface ISpEventSource(ISpEventSourceVtbl): ISpNotifySource(ISpNotifySourceVtbl) { + fn SetInterest( + ullEventInterest: ULONGLONG, + ullQueuedInterest: ULONGLONG, + ) -> HRESULT, + fn GetEvents( + ulCount: ULONG, + pEventArray: *mut SPEVENT, + pulFetched: *mut ULONG, + ) -> HRESULT, + fn GetInfo( + pInfo: *mut SPEVENTSOURCEINFO, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xbe7a9cc9, 0x5f9e, 0x11d2, 0x96, 0x0f, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0x28)] +interface ISpEventSink(ISpEventSinkVtbl): IUnknown(IUnknownVtbl) { + fn AddEvents( + pEventArray: *const SPEVENT, + ulCount: ULONG, + ) -> HRESULT, + fn GetEventInterest( + pullEventInterest: *mut ULONGLONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xbed530be, 0x2606, 0x4f4d, 0xa1, 0xc0, 0x54, 0xc5, 0xcd, 0xa5, 0x56, 0x6f)] +interface ISpStreamFormat(ISpStreamFormatVtbl): IStream(IStreamVtbl) { + fn GetFormat( + pguidFormatId: *mut GUID, + ppCoMemWaveFormatEx: *mut *mut WAVEFORMATEX, + ) -> HRESULT, +}} +ENUM!{enum SPFILEMODE { + SPFM_OPEN_READONLY, + SPFM_OPEN_READWRITE, + SPFM_CREATE, + SPFM_CREATE_ALWAYS, + SPFM_NUM_MODES, +}} +RIDL!{#[uuid(0x12e3cca9, 0x7518, 0x44c5, 0xa5, 0xe7, 0xba, 0x5a, 0x79, 0xcb, 0x92, 0x9e)] +interface ISpStream(ISpStreamVtbl): ISpStreamFormat(ISpStreamFormatVtbl) { + fn SetBaseStream( + pStream: *mut IStream, + rguidFormat: REFGUID, + pWaveFormatEx: *const WAVEFORMATEX, + ) -> HRESULT, + fn GetBaseStream( + ppStream: *mut *mut IStream, + ) -> HRESULT, + fn BindToFile( + pszFileName: LPCWSTR, + eMode: SPFILEMODE, + pFormatId: *const GUID, + pWaveFormatEx: *const WAVEFORMATEX, + ullEventInterest: ULONGLONG, + ) -> HRESULT, + fn Close() -> HRESULT, +}} +RIDL!{#[uuid(0x678a932c, 0xea71, 0x4446, 0x9b, 0x41, 0x78, 0xfd, 0xa6, 0x28, 0x0a, 0x29)] +interface ISpStreamFormatConverter(ISpStreamFormatConverterVtbl): + ISpStreamFormat(ISpStreamFormatVtbl) { + fn SetBaseStream( + pStream: *mut ISpStreamFormat, + fSetFormatToBaseStreamFormat: BOOL, + fWriteToBaseStream: BOOL, + ) -> HRESULT, + fn GetBaseStream( + ppStream: *mut *mut ISpStreamFormat, + ) -> HRESULT, + fn SetFormat( + rguidFormatIdOfConvertedStream: REFGUID, + pWaveFormatExOfConvertedStream: *const WAVEFORMATEX, + ) -> HRESULT, + fn ResetSeekPosition() -> HRESULT, + fn ScaleConvertedToBaseOffset( + ullOffsetConvertedStream: ULONGLONG, + pullOffsetBaseStream: *mut ULONGLONG, + ) -> HRESULT, + fn ScaleBaseToConvertedOffset( + ullOffsetBaseStream: ULONGLONG, + pullOffsetConvertedStream: *mut ULONGLONG, + ) -> HRESULT, +}} +ENUM!{enum SPAUDIOSTATE { + SPAS_CLOSED, + SPAS_STOP, + SPAS_PAUSE, + SPAS_RUN, +}} +STRUCT!{struct SPAUDIOSTATUS { + cbFreeBuffSpace: c_long, + cbNonBlockingIO: ULONG, + State: SPAUDIOSTATE, + CurSeekPos: ULONGLONG, + CurDevicePos: ULONGLONG, + dwAudioLevel: DWORD, + dwReserved2: DWORD, +}} +STRUCT!{struct SPAUDIOBUFFERINFO { + ulMsMinNotification: ULONG, + ulMsBufferSize: ULONG, + ulMsEventBias: ULONG, +}} +RIDL!{#[uuid(0xc05c768f, 0xfae8, 0x4ec2, 0x8e, 0x07, 0x33, 0x83, 0x21, 0xc1, 0x24, 0x52)] +interface ISpAudio(ISpAudioVtbl): ISpStreamFormat(ISpStreamFormatVtbl) { + fn SetState( + NewState: SPAUDIOSTATE, + ullReserved: ULONGLONG, + ) -> HRESULT, + fn SetFormat( + rguidFmtId: REFGUID, + pWaveFormatEx: *const WAVEFORMATEX, + ) -> HRESULT, + fn GetStatus( + pStatus: *mut SPAUDIOSTATUS, + ) -> HRESULT, + fn SetBufferInfo( + pBuffInfo: *const SPAUDIOBUFFERINFO, + ) -> HRESULT, + fn GetBufferInfo( + pBuffInfo: *mut SPAUDIOBUFFERINFO, + ) -> HRESULT, + fn GetDefaultFormat( + pFormatId: *mut GUID, + ppCoMemWaveFormatEx: *mut *mut WAVEFORMATEX, + ) -> HRESULT, + fn EventHandle() -> HANDLE, + fn GetVolumeLevel( + pLevel: *mut ULONG, + ) -> HRESULT, + fn SetVolumeLevel( + Level: ULONG, + ) -> HRESULT, + fn GetBufferNotifySize( + pcbSize: *mut ULONG, + ) -> HRESULT, + fn SetBufferNotifySize( + cbSize: ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x15806f6e, 0x1d70, 0x4b48, 0x98, 0xe6, 0x3b, 0x1a, 0x00, 0x75, 0x09, 0xab)] +interface ISpMMSysAudio(ISpMMSysAudioVtbl): ISpAudio(ISpAudioVtbl) { + fn GetDeviceId( + puDeviceId: *mut UINT, + ) -> HRESULT, + fn SetDeviceId( + uDeviceId: UINT, + ) -> HRESULT, + fn GetMMHandle( + pHandle: *mut *mut c_void, + ) -> HRESULT, + fn GetLineId( + puLineId: *mut UINT, + ) -> HRESULT, + fn SetLineId( + uLineId: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x10f63bce, 0x201a, 0x11d3, 0xac, 0x70, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0xc0)] +interface ISpTranscript(ISpTranscriptVtbl): IUnknown(IUnknownVtbl) { + fn GetTranscript( + ppszTranscript: *mut LPWSTR, + ) -> HRESULT, + fn AppendTranscript( + pszTranscript: LPCWSTR, + ) -> HRESULT, +}} +ENUM!{enum SPDISPLAYATTRIBUTES { + SPAF_ONE_TRAILING_SPACE = 0x2, + SPAF_TWO_TRAILING_SPACES = 0x4, + SPAF_CONSUME_LEADING_SPACES = 0x8, + SPAF_ALL = 0xf, +}} +pub type SPPHONEID = WCHAR; +pub type PSPPHONEID = LPWSTR; +pub type PCSPPHONEID = LPCWSTR; +STRUCT!{struct SPPHRASEELEMENT { + ulAudioTimeOffset: ULONG, + ulAudioSizeTime: ULONG, + ulAudioStreamOffset: ULONG, + ulAudioSizeBytes: ULONG, + ulRetainedStreamOffset: ULONG, + ulRetainedSizeBytes: ULONG, + pszDisplayText: LPCWSTR, + pszLexicalForm: LPCWSTR, + pszPronunciation: *const SPPHONEID, + bDisplayAttributes: BYTE, + RequiredConfidence: c_char, + ActualConfidence: c_char, + Reserved: BYTE, + SREngineConfidence: c_float, +}} +STRUCT!{struct SPPHRASERULE { + pszName: LPCWSTR, + ulId: ULONG, + ulFirstElement: ULONG, + ulCountOfElements: ULONG, + pNextSibling: *const SPPHRASERULE, + pFirstChild: *const SPPHRASERULE, + SREngineConfidence: c_float, + Confidence: c_char, +}} +ENUM!{enum SPPHRASEPROPERTYUNIONTYPE { + SPPPUT_UNUSED = 0, + SPPPUT_ARRAY_INDEX, +}} +STRUCT!{struct SPPHRASEPROPERTY_u_s { + bType: byte, + bReserved: byte, + usArrayIndex: c_ushort, +}} +UNION!{union SPPHRASEPROPERTY_u { + [u32; 1], + ulId ulId_mut: ULONG, + s s_mut: SPPHRASEPROPERTY_u_s, +}} +STRUCT!{struct SPPHRASEPROPERTY { + pszName: LPCWSTR, + u: SPPHRASEPROPERTY_u_s, + pszValue: LPCWSTR, + vValue: VARIANT, + ulFirstElement: ULONG, + ulCountOfElements: ULONG, + pNextSibling: *const SPPHRASEPROPERTY, + pFirstChild: *const SPPHRASEPROPERTY, + SREngineConfidence: c_float, + Confidence: c_char, +}} +STRUCT!{struct SPPHRASEREPLACEMENT { + bDisplayAttributes: BYTE, + pszReplacementText: LPCWSTR, + ulFirstElement: ULONG, + ulCountOfElements: ULONG, +}} +STRUCT!{struct SPPHRASE { + cbSize: ULONG, + LangID: WORD, + wHomophoneGroupId: WORD, + ullGrammarID: ULONGLONG, + ftStartTime: ULONGLONG, + ullAudioStreamPosition: ULONGLONG, + ulAudioSizeBytes: ULONG, + ulRetainedSizeBytes: ULONG, + ulAudioSizeTime: ULONG, + Rule: SPPHRASERULE, + pProperties: *const SPPHRASEPROPERTY, + pElements: *const SPPHRASEELEMENT, + cReplacements: ULONG, + pReplacements: *const SPPHRASEREPLACEMENT, + SREngineID: GUID, + ulSREnginePrivateDataSize: ULONG, + pSREnginePrivateData: *const BYTE, +}} +STRUCT!{struct SPSERIALIZEDPHRASE { + ulSerializedSize: ULONG, +}} +ENUM!{enum SPVALUETYPE { + SPDF_PROPERTY = 0x1, + SPDF_REPLACEMENT = 0x2, + SPDF_RULE = 0x4, + SPDF_DISPLAYTEXT = 0x8, + SPDF_LEXICALFORM = 0x10, + SPDF_PRONUNCIATION = 0x20, + SPDF_AUDIO = 0x40, + SPDF_ALTERNATES = 0x80, + SPDF_ALL = 0xff, +}} +STRUCT!{struct SPBINARYGRAMMAR { + ulTotalSerializedSize: ULONG, +}} +ENUM!{enum SPPHRASERNG { + SPPR_ALL_ELEMENTS = -1i32 as u32, +}} +pub const SP_GETWHOLEPHRASE: SPPHRASERNG = SPPR_ALL_ELEMENTS; +pub const SPRR_ALL_ELEMENTS: SPPHRASERNG = SPPR_ALL_ELEMENTS; +DECLARE_HANDLE!{SPSTATEHANDLE, SPSTATEHANDLE__} +ENUM!{enum SPRECOEVENTFLAGS { + SPREF_AutoPause = 1 << 0, + SPREF_Emulated = 1 << 1, +}} +ENUM!{enum SPPARTOFSPEECH { + SPPS_NotOverriden = -1i32 as u32, + SPPS_Unknown = 0, + SPPS_Noun = 0x1000, + SPPS_Verb = 0x2000, + SPPS_Modifier = 0x3000, + SPPS_Function = 0x4000, + SPPS_Interjection = 0x5000, +}} +ENUM!{enum SPLEXICONTYPE { + eLEXTYPE_USER = 1 << 0, + eLEXTYPE_APP = 1 << 1, + eLEXTYPE_VENDORLEXICON = 1 << 2, + eLEXTYPE_LETTERTOSOUND = 1 << 3, + eLEXTYPE_MORPHOLOGY = 1 << 4, + eLEXTYPE_RESERVED4 = 1 << 5, + eLEXTYPE_USER_SHORTCUT = 1 << 6, + eLEXTYPE_RESERVED6 = 1 << 7, + eLEXTYPE_RESERVED7 = 1 << 8, + eLEXTYPE_RESERVED8 = 1 << 9, + eLEXTYPE_RESERVED9 = 1 << 10, + eLEXTYPE_RESERVED10 = 1 << 11, + eLEXTYPE_PRIVATE1 = 1 << 12, + eLEXTYPE_PRIVATE2 = 1 << 13, + eLEXTYPE_PRIVATE3 = 1 << 14, + eLEXTYPE_PRIVATE4 = 1 << 15, + eLEXTYPE_PRIVATE5 = 1 << 16, + eLEXTYPE_PRIVATE6 = 1 << 17, + eLEXTYPE_PRIVATE7 = 1 << 18, + eLEXTYPE_PRIVATE8 = 1 << 19, + eLEXTYPE_PRIVATE9 = 1 << 20, + eLEXTYPE_PRIVATE10 = 1 << 21, + eLEXTYPE_PRIVATE11 = 1 << 22, + eLEXTYPE_PRIVATE12 = 1 << 23, + eLEXTYPE_PRIVATE13 = 1 << 24, + eLEXTYPE_PRIVATE14 = 1 << 25, + eLEXTYPE_PRIVATE15 = 1 << 26, + eLEXTYPE_PRIVATE16 = 1 << 27, + eLEXTYPE_PRIVATE17 = 1 << 28, + eLEXTYPE_PRIVATE18 = 1 << 29, + eLEXTYPE_PRIVATE19 = 1 << 30, + eLEXTYPE_PRIVATE20 = 1 << 31, +}} +ENUM!{enum SPWORDTYPE { + eWORDTYPE_ADDED = 1 << 0, + eWORDTYPE_DELETED = 1 << 1, +}} +STRUCT!{struct SPWORDPRONUNCIATION { + pNextWordPronunciation: *mut SPWORDPRONUNCIATION, + eLexiconType: SPLEXICONTYPE, + LangID: WORD, + wPronunciationFlags: WORD, + ePartOfSpeech: SPPARTOFSPEECH, + szPronunciation: [SPPHONEID; 1], +}} +STRUCT!{struct SPWORDPRONUNCIATIONLIST { + ulSize: ULONG, + pvBuffer: *mut BYTE, + pFirstWordPronunciation: *mut SPWORDPRONUNCIATION, +}} +STRUCT!{struct SPWORD { + pNextWord: *mut SPWORD, + LangID: WORD, + wReserved: WORD, + eWordType: SPWORDTYPE, + pszWord: LPWSTR, + pFirstWordPronunciation: *mut SPWORDPRONUNCIATION, +}} +STRUCT!{struct SPWORDLIST { + ulSize: ULONG, + pvBuffer: *mut BYTE, + pFirstWord: *mut SPWORD, +}} +RIDL!{#[uuid(0xda41a7c2, 0x5383, 0x4db2, 0x91, 0x6b, 0x6c, 0x17, 0x19, 0xe3, 0xdb, 0x58)] +interface ISpLexicon(ISpLexiconVtbl): IUnknown(IUnknownVtbl) { + fn GetPronunciations( + pszWord: LPCWSTR, + LangID: WORD, + dwFlags: DWORD, + pWordPronunciationList: *mut SPWORDPRONUNCIATIONLIST, + ) -> HRESULT, + fn AddPronunciation( + pszWord: LPCWSTR, + LangID: WORD, + ePartOfSpeech: SPPARTOFSPEECH, + pszPronunciation: PCSPPHONEID, + ) -> HRESULT, + fn RemovePronunciation( + pszWord: LPCWSTR, + LangID: WORD, + ePartOfSpeech: SPPARTOFSPEECH, + pszPronunciation: PCSPPHONEID, + ) -> HRESULT, + fn GetGeneration( + pdwGeneration: *mut DWORD, + ) -> HRESULT, + fn GetGenerationChange( + dwFlags: DWORD, + pdwGeneration: *mut DWORD, + pWordList: *mut SPWORDLIST, + ) -> HRESULT, + fn GetWords( + dwFlags: DWORD, + pdwGeneration: *mut DWORD, + pdwCookie: *mut DWORD, + pWordList: *mut SPWORDLIST, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8565572f, 0xc094, 0x41cc, 0xb5, 0x6e, 0x10, 0xbd, 0x9c, 0x3f, 0xf0, 0x44)] +interface ISpContainerLexicon(ISpContainerLexiconVtbl): ISpLexicon(ISpLexiconVtbl) { + fn AddLexicon( + pAddLexicon: *mut ISpLexicon, + dwFlags: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8445c581, 0x0cac, 0x4a38, 0xab, 0xfe, 0x9b, 0x2c, 0xe2, 0x82, 0x64, 0x55)] +interface ISpPhoneConverter(ISpPhoneConverterVtbl): ISpObjectWithToken(ISpObjectWithTokenVtbl) { + fn PhoneToId( + pszPhone: LPCWSTR, + pId: *mut SPPHONEID, + ) -> HRESULT, + fn IdToPhone( + pId: PCSPPHONEID, + pszPhone: *mut WCHAR, + ) -> HRESULT, +}} +STRUCT!{struct SPVPITCH { + MiddleAdj: c_long, + RangeAdj: c_long, +}} +ENUM!{enum SPVACTIONS { + SPVA_Speak = 0, + SPVA_Silence, + SPVA_Pronounce, + SPVA_Bookmark, + SPVA_SpellOut, + SPVA_Section, + SPVA_ParseUnknownTag, +}} +STRUCT!{struct SPVCONTEXT { + pCategory: LPCWSTR, + pBefore: LPCWSTR, + pAfter: LPCWSTR, +}} +STRUCT!{struct SPVSTATE { + eAction: SPVACTIONS, + LangID: WORD, + wReserved: WORD, + EmphAdj: c_long, + RateAdj: c_long, + Volume: ULONG, + PitchAdj: SPVPITCH, + SilenceMSecs: ULONG, + pPhoneIds: *mut SPPHONEID, + ePartOfSpeech: SPPARTOFSPEECH, + Context: SPVCONTEXT, +}} +ENUM!{enum SPRUNSTATE { + SPRS_DONE = 1 << 0, + SPRS_IS_SPEAKING = 1 << 1, +}} +ENUM!{enum SPVLIMITS { + SPMIN_VOLUME = 0, + SPMAX_VOLUME = 100, + SPMIN_RATE = -10i32 as u32, + SPMAX_RATE = 10, +}} +ENUM!{enum SPVPRIORITY { + SPVPRI_NORMAL = 0, + SPVPRI_ALERT = 1 << 0, + SPVPRI_OVER = 1 << 1, +}} +STRUCT!{struct SPVOICESTATUS { + ulCurrentStream: ULONG, + ulLastStreamQueued: ULONG, + hrLastResult: HRESULT, + dwRunningState: DWORD, + ulInputWordPos: ULONG, + ulInputWordLen: ULONG, + ulInputSentPos: ULONG, + ulInputSentLen: ULONG, + lBookmarkId: LONG, + PhonemeId: SPPHONEID, + VisemeId: SPVISEMES, + dwReserved1: DWORD, + dwReserved2: DWORD, +}} +ENUM!{enum SPEAKFLAGS { + SPF_DEFAULT = 0, + SPF_ASYNC = 1 << 0, + SPF_PURGEBEFORESPEAK = 1 << 1, + SPF_IS_FILENAME = 1 << 2, + SPF_IS_XML = 1 << 3, + SPF_IS_NOT_XML = 1 << 4, + SPF_PERSIST_XML = 1 << 5, + SPF_NLP_SPEAK_PUNC = 1 << 6, + SPF_NLP_MASK = SPF_NLP_SPEAK_PUNC, + SPF_VOICE_MASK = SPF_ASYNC | SPF_PURGEBEFORESPEAK + | SPF_IS_FILENAME | SPF_IS_XML | SPF_IS_NOT_XML + | SPF_NLP_MASK | SPF_PERSIST_XML, + SPF_UNUSED_FLAGS = !SPF_VOICE_MASK, +}} +RIDL!{#[uuid(0x6c44df74, 0x72b9, 0x4992, 0xa1, 0xec, 0xef, 0x99, 0x6e, 0x04, 0x22, 0xd4)] +interface ISpVoice(ISpVoiceVtbl): ISpEventSource(ISpEventSourceVtbl) { + fn SetOutput( + pUnkOutput: *mut IUnknown, + fAllowFormatChanges: BOOL, + ) -> HRESULT, + fn GetOutputObjectToken( + ppObjectToken: *mut *mut ISpObjectToken, + ) -> HRESULT, + fn GetOutputStream( + ppStream: *mut *mut ISpStreamFormat, + ) -> HRESULT, + fn Pause() -> HRESULT, + fn Resume() -> HRESULT, + fn SetVoice( + pToken: *mut ISpObjectToken, + ) -> HRESULT, + fn GetVoice( + ppToken: *mut *mut ISpObjectToken, + ) -> HRESULT, + fn Speak( + pwcs: LPCWSTR, + dwFlags: DWORD, + pulStreamNumber: *mut ULONG, + ) -> HRESULT, + fn SpeakStream( + pStream: *mut IStream, + dwFlags: DWORD, + pulStreamNumber: *mut ULONG, + ) -> HRESULT, + fn GetStatus( + pStatus: *mut SPVOICESTATUS, + ppszLastBookmark: *mut LPWSTR, + ) -> HRESULT, + fn Skip( + pItemType: LPCWSTR, + lNumItems: c_long, + pulNumSkipped: *mut ULONG, + ) -> HRESULT, + fn SetPriority( + ePriority: SPVPRIORITY, + ) -> HRESULT, + fn GetPriority( + pePriority: *mut SPVPRIORITY, + ) -> HRESULT, + fn SetAlertBoundary( + eBoundary: SPEVENTENUM, + ) -> HRESULT, + fn GetAlertBoundary( + peBoundary: *mut SPEVENTENUM, + ) -> HRESULT, + fn SetRate( + RateAdjust: c_long, + ) -> HRESULT, + fn GetRate( + pRateAdjust: *mut c_long, + ) -> HRESULT, + fn SetVolume( + usVolume: USHORT, + ) -> HRESULT, + fn GetVolume( + pusVolume: *mut USHORT, + ) -> HRESULT, + fn WaitUntilDone( + msTimeout: ULONG, + ) -> HRESULT, + fn SetSyncSpeakTimeout( + msTimeout: ULONG, + ) -> HRESULT, + fn GetSyncSpeakTimeout( + pmsTimeout: *mut ULONG, + ) -> HRESULT, + fn SpeakCompleteEvent() -> HANDLE, + fn IsUISupported( + pszTypeOfUI: LPCWSTR, + pvExtraData: *mut c_void, + cbExtraData: ULONG, + pfSupported: *mut BOOL, + ) -> HRESULT, + fn DisplayUI( + hwndParent: HWND, + pszTitle: LPCWSTR, + pszTypeOfUI: LPCWSTR, + pvExtraData: *mut c_void, + cbExtraData: ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1a5c0354, 0xb621, 0x4b5a, 0x87, 0x91, 0xd3, 0x06, 0xed, 0x37, 0x9e, 0x53)] +interface ISpPhrase(ISpPhraseVtbl): IUnknown(IUnknownVtbl) { + fn GetPhrase( + ppCoMemPhrase: *mut *mut SPPHRASE, + ) -> HRESULT, + fn GetSerializedPhrase( + ppCoMemPhrase: *mut *mut SPSERIALIZEDPHRASE, + ) -> HRESULT, + fn GetText( + ulStart: ULONG, + ulCount: ULONG, + fUseTextReplacements: BOOL, + ppszCoMemText: *mut LPWSTR, + pbDisplayAttributes: *mut BYTE, + ) -> HRESULT, + fn Discard( + dwValueTypes: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8fcebc98, 0x4e49, 0x4067, 0x9c, 0x6c, 0xd8, 0x6a, 0x0e, 0x09, 0x2e, 0x3d)] +interface ISpPhraseAlt(ISpPhraseAltVtbl): ISpPhrase(ISpPhraseVtbl) { + fn GetAltInfo( + pParent: *mut *mut ISpPhrase, + pulStartElementInParent: *mut ULONG, + pcElementsInParent: *mut ULONG, + pcElementsInAlt: *mut ULONG, + ) -> HRESULT, + fn Commit() -> HRESULT, +}} +STRUCT!{struct SPRECORESULTTIMES { + ftStreamTime: FILETIME, + ullLength: ULONGLONG, + dwTickCount: DWORD, + ullStart: ULONGLONG, +}} +STRUCT!{struct SPSERIALIZEDRESULT { + ulSerializedSize: ULONG, +}} +RIDL!{#[uuid(0x20b053be, 0xe235, 0x43cd, 0x9a, 0x2a, 0x8d, 0x17, 0xa4, 0x8b, 0x78, 0x42)] +interface ISpRecoResult(ISpRecoResultVtbl): ISpPhrase(ISpPhraseVtbl) { + fn GetResultTimes( + pTimes: *mut SPRECORESULTTIMES, + ) -> HRESULT, + fn GetAlternates( + ulStartElement: ULONG, + cElements: ULONG, + ulRequestCount: ULONG, + ppPhrases: *mut *mut ISpPhraseAlt, + pcPhrasesReturned: *mut ULONG, + ) -> HRESULT, + fn GetAudio( + ulStartElement: ULONG, + cElements: ULONG, + ppStream: *mut *mut ISpStreamFormat, + ) -> HRESULT, + fn SpeakAudio( + ulStartElement: ULONG, + cElements: ULONG, + dwFlags: DWORD, + pulStreamNumber: *mut ULONG, + ) -> HRESULT, + fn Serialize( + ppCoMemSerializedResult: *mut *mut SPSERIALIZEDRESULT, + ) -> HRESULT, + fn ScaleAudio( + pAudioFormatId: *const GUID, + pWaveFormatEx: *const WAVEFORMATEX, + ) -> HRESULT, + fn GetRecoContext( + ppRecoContext: *mut *mut ISpRecoContext, + ) -> HRESULT, +}} +STRUCT!{struct SPTEXTSELECTIONINFO { + ulStartActiveOffset: ULONG, + cchActiveChars: ULONG, + ulStartSelection: ULONG, + cchSelection: ULONG, +}} +ENUM!{enum SPWORDPRONOUNCEABLE { + SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE = 0, + SPWP_UNKNOWN_WORD_PRONOUNCEABLE = 1, + SPWP_KNOWN_WORD_PRONOUNCEABLE = 2, +}} +ENUM!{enum SPGRAMMARSTATE { + SPGS_DISABLED = 0, + SPGS_ENABLED = 1, + SPGS_EXCLUSIVE = 3, +}} +ENUM!{enum SPCONTEXTSTATE { + SPCS_DISABLED = 0, + SPCS_ENABLED = 1, +}} +ENUM!{enum SPRULESTATE { + SPRS_INACTIVE = 0, + SPRS_ACTIVE = 1, + SPRS_ACTIVE_WITH_AUTO_PAUSE = 3, +}} +pub const SP_STREAMPOS_ASAP: ULONGLONG = 0; +pub const SP_STREAMPOS_REALTIME: ULONGLONG = -1i64 as u64; +pub const SPRULETRANS_TEXTBUFFER: SPSTATEHANDLE = -1isize as SPSTATEHANDLE; +pub const SPRULETRANS_WILDCARD: SPSTATEHANDLE = -2isize as SPSTATEHANDLE; +pub const SPRULETRANS_DICTATION: SPSTATEHANDLE = -3isize as SPSTATEHANDLE; +ENUM!{enum SPGRAMMARWORDTYPE { + SPWT_DISPLAY, + SPWT_LEXICAL, + SPWT_PRONUNCIATION, + SPWT_LEXICAL_NO_SPECIAL_CHARS, +}} +STRUCT!{struct SPPROPERTYINFO { + pszName: LPCWSTR, + ulId: ULONG, + pszValue: LPCWSTR, + vValue: VARIANT, +}} +ENUM!{enum SPCFGRULEATTRIBUTES { + SPRAF_TopLevel = 1 << 0, + SPRAF_Active = 1 << 1, + SPRAF_Export = 1 << 2, + SPRAF_Import = 1 << 3, + SPRAF_Interpreter = 1 << 4, + SPRAF_Dynamic = 1 << 5, + SPRAF_AutoPause = 1 << 16, +}} +RIDL!{#[uuid(0x8137828f, 0x591a, 0x4a42, 0xbe, 0x58, 0x49, 0xea, 0x7e, 0xba, 0xac, 0x68)] +interface ISpGrammarBuilder(ISpGrammarBuilderVtbl): IUnknown(IUnknownVtbl) { + fn ResetGrammar( + NewLanguage: WORD, + ) -> HRESULT, + fn GetRule( + pszRuleName: LPCWSTR, + dwRuleId: DWORD, + dwAttributes: DWORD, + fCreateIfNotExist: BOOL, + phInitialState: *mut SPSTATEHANDLE, + ) -> HRESULT, + fn ClearRule( + hState: SPSTATEHANDLE, + ) -> HRESULT, + fn CreateNewState( + hState: SPSTATEHANDLE, + phState: *mut SPSTATEHANDLE, + ) -> HRESULT, + fn AddWordTransition( + hFromState: SPSTATEHANDLE, + hToState: SPSTATEHANDLE, + psz: LPCWSTR, + pszSeparators: LPCWSTR, + eWordType: SPGRAMMARWORDTYPE, + Weight: c_float, + pPropInfo: *const SPPROPERTYINFO, + ) -> HRESULT, + fn AddRuleTransition( + hFromState: SPSTATEHANDLE, + hToState: SPSTATEHANDLE, + hRule: SPSTATEHANDLE, + Weight: c_float, + pPropInfo: *const SPPROPERTYINFO, + ) -> HRESULT, + fn AddResource( + hRuleState: SPSTATEHANDLE, + pszResourceName: LPCWSTR, + pszResourceValue: LPCWSTR, + ) -> HRESULT, + fn Commit( + dwReserved: DWORD, + ) -> HRESULT, +}} +ENUM!{enum SPLOADOPTIONS { + SPLO_STATIC = 0, + SPLO_DYNAMIC = 1, +}} +RIDL!{#[uuid(0x2177db29, 0x7f45, 0x47d0, 0x85, 0x54, 0x06, 0x7e, 0x91, 0xc8, 0x05, 0x02)] +interface ISpRecoGrammar(ISpRecoGrammarVtbl): ISpGrammarBuilder(ISpGrammarBuilderVtbl) { + fn GetGrammarId( + pullGrammarId: *mut ULONGLONG, + ) -> HRESULT, + fn GetRecoContext( + ppRecoCtxt: *mut *mut ISpRecoContext, + ) -> HRESULT, + fn LoadCmdFromFile( + pszFileName: LPCWSTR, + Options: SPLOADOPTIONS, + ) -> HRESULT, + fn LoadCmdFromObject( + rcid: REFCLSID, + pszGrammarName: LPCWSTR, + Options: SPLOADOPTIONS, + ) -> HRESULT, + fn LoadCmdFromResource( + hModule: HMODULE, + pszResourceName: LPCWSTR, + pszResourceType: LPCWSTR, + wLanguage: WORD, + Options: SPLOADOPTIONS, + ) -> HRESULT, + fn LoadCmdFromMemory( + pGrammar: *const SPBINARYGRAMMAR, + Options: SPLOADOPTIONS, + ) -> HRESULT, + fn LoadCmdFromProprietaryGrammar( + rguidParam: REFGUID, + pszStringParam: LPCWSTR, + pvDataPrarm: *const c_void, + cbDataSize: ULONG, + Options: SPLOADOPTIONS, + ) -> HRESULT, + fn SetRuleState( + pszName: LPCWSTR, + pReserved: *mut c_void, + NewState: SPRULESTATE, + ) -> HRESULT, + fn SetRuleIdState( + ulRuleId: ULONG, + NewState: SPRULESTATE, + ) -> HRESULT, + fn LoadDictation( + pszTopicName: LPCWSTR, + Options: SPLOADOPTIONS, + ) -> HRESULT, + fn UnloadDictation() -> HRESULT, + fn SetDictationState( + NewState: SPRULESTATE, + ) -> HRESULT, + fn SetWordSequenceData( + pText: *const WCHAR, + cchText: ULONG, + pInfo: *const SPTEXTSELECTIONINFO, + ) -> HRESULT, + fn SetTextSelection( + pInfo: *const SPTEXTSELECTIONINFO, + ) -> HRESULT, + fn IsPronounceable( + pszWord: LPCWSTR, + pWordPronounceable: *mut SPWORDPRONOUNCEABLE, + ) -> HRESULT, + fn SetGrammarState( + eGrammarState: SPGRAMMARSTATE, + ) -> HRESULT, + fn SaveCmd( + pStream: *mut IStream, + ppszCoMemErrorText: *mut LPWSTR, + ) -> HRESULT, + fn GetGrammarState( + peGrammarState: *mut SPGRAMMARSTATE, + ) -> HRESULT, +}} +STRUCT!{struct SPRECOCONTEXTSTATUS { + eInterference: SPINTERFERENCE, + szRequestTypeOfUI: [WCHAR; 255], + dwReserved1: DWORD, + dwReserved2: DWORD, +}} +ENUM!{enum SPBOOKMARKOPTIONS { + SPBO_NONE = 0, + SPBO_PAUSE = 1 << 0, +}} +ENUM!{enum SPAUDIOOPTIONS { + SPAO_NONE = 0, + SPAO_RETAIN_AUDIO = 1 << 0, +}} +RIDL!{#[uuid(0xf740a62f, 0x7c15, 0x489e, 0x82, 0x34, 0x94, 0x0a, 0x33, 0xd9, 0x27, 0x2d)] +interface ISpRecoContext(ISpRecoContextVtbl): ISpEventSource(ISpEventSourceVtbl) { + fn GetRecognizer( + ppRecognizer: *mut *mut ISpRecognizer, + ) -> HRESULT, + fn CreateGrammer( + ullGrammarId: ULONGLONG, + ppGrammar: *mut *mut ISpRecoGrammar, + ) -> HRESULT, + fn GetStatus( + pState: *mut SPRECOCONTEXTSTATUS, + ) -> HRESULT, + fn GetMaxAlternates( + pcAlternates: *mut ULONG, + ) -> HRESULT, + fn SetMaxAlternates( + cAlternates: ULONG, + ) -> HRESULT, + fn SetAudioOptions( + Options: SPAUDIOOPTIONS, + pAudioFormatId: *const GUID, + pWaveFormatEx: *const WAVEFORMATEX, + ) -> HRESULT, + fn GetAudioOptions( + pOptions: *mut SPAUDIOOPTIONS, + pAudioFormatId: *mut GUID, + ppCoMemWFEX: *mut *mut WAVEFORMATEX, + ) -> HRESULT, + fn DeserializeResult( + pSerializedResult: *const SPSERIALIZEDRESULT, + ppResult: *mut *mut ISpRecoResult, + ) -> HRESULT, + fn Bookmark( + Options: SPBOOKMARKOPTIONS, + ullStreamPosition: ULONGLONG, + lparamEvent: LPARAM, + ) -> HRESULT, + fn SetAdaptionData( + pAdaptionData: LPCWSTR, + cch: ULONG, + ) -> HRESULT, + fn Pause( + dwReserved: DWORD, + ) -> HRESULT, + fn Resume( + dwReserved: DWORD, + ) -> HRESULT, + fn SetVoice( + pVoice: *mut ISpVoice, + fAllowFormatChanges: BOOL, + ) -> HRESULT, + fn GetVoice( + ppVoice: *mut *mut ISpVoice, + ) -> HRESULT, + fn SetVoicePurgeEvent( + ullEventIntereset: ULONGLONG, + ) -> HRESULT, + fn GetVoicePurgeEvent( + pullEventIntereset: *mut ULONGLONG, + ) -> HRESULT, + fn SetContextState( + eContextState: SPCONTEXTSTATE, + ) -> HRESULT, + fn GetContextState( + peContextState: *mut SPCONTEXTSTATE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5b4fb971, 0xb115, 0x4de1, 0xad, 0x97, 0xe4, 0x82, 0xe3, 0xbf, 0x6e, 0xe4)] +interface ISpProperties(ISpPropertiesVtbl): IUnknown(IUnknownVtbl) { + fn SetPropertyNum( + pName: LPCWSTR, + lValue: LONG, + ) -> HRESULT, + fn GetPropertyNum( + pName: LPCWSTR, + plValue: *mut LONG, + ) -> HRESULT, + fn SetPropertyString( + pName: LPCWSTR, + pValue: LPCWSTR, + ) -> HRESULT, + fn GetPropertyString( + pName: LPCWSTR, + ppCoMemValue: *mut LPWSTR, + ) -> HRESULT, +}} +pub const SP_MAX_LANGIDS: usize = 20; +STRUCT!{struct SPRECOGNIZERSTATUS { + AudioStatus: SPAUDIOSTATUS, + ullRecognitionStreamPos: ULONGLONG, + ulStreamNumber: ULONG, + ulNumActive: ULONG, + clsidEngine: CLSID, + cLangIDs: ULONG, + aLangID: [WORD; SP_MAX_LANGIDS], + ullRecognitionStreamTime: ULONGLONG, +}} +ENUM!{enum SPWAVEFORMATTYPE { + SPWF_INPUT, + SPWF_SRENGINE, +}} +pub type SPSTREAMFORMATTYPE = SPWAVEFORMATTYPE; +ENUM!{enum SPRECOSTATE { + SPRST_INACTIVE, + SPRST_ACTIVE, + SPRST_ACTIVE_ALWAYS, + SPRST_INACTIVE_WITH_PURGE, + SPRST_NUM_STATES, +}} +RIDL!{#[uuid(0xc2b5f241, 0xdaa0, 0x4507, 0x9e, 0x16, 0x5a, 0x1e, 0xaa, 0x2b, 0x7a, 0x5c)] +interface ISpRecognizer(ISpRecognizerVtbl): ISpProperties(ISpPropertiesVtbl) { + fn SetRecognizer( + pRecognizer: *mut ISpObjectToken, + ) -> HRESULT, + fn GetRecognizer( + ppRecognizer: *mut *mut ISpObjectToken, + ) -> HRESULT, + fn SetInput( + pUnkInput: *mut IUnknown, + fAllowFormatChanges: BOOL, + ) -> HRESULT, + fn GetInputObjectToken( + ppToken: *mut *mut ISpObjectToken, + ) -> HRESULT, + fn GetInputStream( + ppStream: *mut *mut ISpStreamFormat, + ) -> HRESULT, + fn CreateRecoContext( + ppNewCtxt: *mut *mut ISpRecoContext, + ) -> HRESULT, + fn GetRecoProfile( + ppToken: *mut *mut ISpObjectToken, + ) -> HRESULT, + fn SetRecoProfile( + pToken: *mut ISpObjectToken, + ) -> HRESULT, + fn IsSharedInstance() -> HRESULT, + fn GetRecoState( + pState: *mut SPRECOSTATE, + ) -> HRESULT, + fn SetRecoState( + NewState: SPRECOSTATE, + ) -> HRESULT, + fn GetStatus( + pStatus: *mut SPRECOGNIZERSTATUS, + ) -> HRESULT, + fn GetFormat( + WaveFormatType: SPSTREAMFORMATTYPE, + pFormatId: *mut GUID, + ppCoMemWFEX: *mut WAVEFORMATEX, + ) -> HRESULT, + fn IsUISupported( + pszTypeOfUI: LPCWSTR, + pvExtraData: *mut c_void, + cbExtraData: ULONG, + pfSupported: *mut BOOL, + ) -> HRESULT, + fn DisplayUI( + hwndParent: HWND, + pszTitle: LPCWSTR, + pszTypeOfUI: LPCWSTR, + pvExtraData: *mut c_void, + cbExtraData: ULONG, + ) -> HRESULT, + fn EmulateRecognition( + pPhrase: *mut ISpPhrase, + ) -> HRESULT, +}} +pub type SpeechLanguageId = c_long; +ENUM!{enum DISPID_SpeechDataKey { + DISPID_SDKSetBinaryValue = 1, + DISPID_SDKGetBinaryValue, + DISPID_SDKSetStringValue, + DISPID_SDKGetStringValue, + DISPID_SDKSetLongValue, + DISPID_SDKGetlongValue, + DISPID_SDKOpenKey, + DISPID_SDKCreateKey, + DISPID_SDKDeleteKey, + DISPID_SDKDeleteValue, + DISPID_SDKEnumKeys, + DISPID_SDKEnumValues, +}} +ENUM!{enum DISPID_SpeechObjectToken { + DISPID_SOTId = 1, + DISPID_SOTDataKey, + DISPID_SOTCategory, + DISPID_SOTGetDescription, + DISPID_SOTSetId, + DISPID_SOTGetAttribute, + DISPID_SOTCreateInstance, + DISPID_SOTRemove, + DISPID_SOTGetStorageFileName, + DISPID_SOTRemoveStorageFileName, + DISPID_SOTIsUISupported, + DISPID_SOTDisplayUI, + DISPID_SOTMatchesAttributes, +}} +ENUM!{enum SpeechDataKeyLocation { + SDKLDefaultLocation = SPDKL_DefaultLocation, + SDKLCurrentUser = SPDKL_CurrentUser, + SDKLLocalMachine = SPDKL_LocalMachine, + SDKLCurrentConfig = SPDKL_CurrentConfig, +}} +ENUM!{enum SpeechTokenContext { + STCInprocServer = CLSCTX_INPROC_SERVER, + STCInprocHandler = CLSCTX_INPROC_HANDLER, + STCLocalServer = CLSCTX_LOCAL_SERVER, + STCRemoteServer = CLSCTX_REMOTE_SERVER, + STCAll = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER + | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER, +}} +ENUM!{enum SpeechTokenShellFolder { + STSF_AppData = 0x1a, + STSF_LocalAppData = 0x1c, + STSF_CommonAppData = 0x23, + STSF_FlagCreate = 0x8000, +}} +ENUM!{enum DISPID_SpeechObjectTokens { + DISPID_SOTsCount = 1, + DISPID_SOTsItem = DISPID_VALUE as u32, + DISPID_SOTs_NewEnum = DISPID_NEWENUM as u32, +}} +ENUM!{enum DISPID_SpeechObjectTokenCategory { + DISPID_SOTCId = 1, + DISPID_SOTCDefault, + DISPID_SOTCSetId, + DISPID_SOTCGetDataKey, + DISPID_SOTCEnumerateTokens, +}} +ENUM!{enum SpeechAudioFormatType { + SAFTDefault = -1i32 as u32, + SAFTNoAssignedFormat = 0, + SAFTText = 1, + SAFTNonStandardFormat = 2, + SAFTExtendedAudioFormat = 3, + SAFT8kHz8BitMono = 4, + SAFT8kHz8BitStereo = 5, + SAFT8kHz16BitMono = 6, + SAFT8kHz16BitStereo = 7, + SAFT11kHz8BitMono = 8, + SAFT11kHz8BitStereo = 9, + SAFT11kHz16BitMono = 10, + SAFT11kHz16BitStereo = 11, + SAFT12kHz8BitMono = 12, + SAFT12kHz8BitStereo = 13, + SAFT12kHz16BitMono = 14, + SAFT12kHz16BitStereo = 15, + SAFT16kHz8BitMono = 16, + SAFT16kHz8BitStereo = 17, + SAFT16kHz16BitMono = 18, + SAFT16kHz16BitStereo = 19, + SAFT22kHz8BitMono = 20, + SAFT22kHz8BitStereo = 21, + SAFT22kHz16BitMono = 22, + SAFT22kHz16BitStereo = 23, + SAFT24kHz8BitMono = 24, + SAFT24kHz8BitStereo = 25, + SAFT24kHz16BitMono = 26, + SAFT24kHz16BitStereo = 27, + SAFT32kHz8BitMono = 28, + SAFT32kHz8BitStereo = 29, + SAFT32kHz16BitMono = 30, + SAFT32kHz16BitStereo = 31, + SAFT44kHz8BitMono = 32, + SAFT44kHz8BitStereo = 33, + SAFT44kHz16BitMono = 34, + SAFT44kHz16BitStereo = 35, + SAFT48kHz8BitMono = 36, + SAFT48kHz8BitStereo = 37, + SAFT48kHz16BitMono = 38, + SAFT48kHz16BitStereo = 39, + SAFTTrueSpeech_8kHz1BitMono = 40, + SAFTCCITT_ALaw_8kHzMono = 41, + SAFTCCITT_ALaw_8kHzStereo = 42, + SAFTCCITT_ALaw_11kHzMono = 43, + SAFTCCITT_ALaw_11kHzStereo = 44, + SAFTCCITT_ALaw_22kHzMono = 45, + SAFTCCITT_ALaw_22kHzStereo = 46, + SAFTCCITT_ALaw_44kHzMono = 47, + SAFTCCITT_ALaw_44kHzStereo = 48, + SAFTCCITT_uLaw_8kHzMono = 49, + SAFTCCITT_uLaw_8kHzStereo = 50, + SAFTCCITT_uLaw_11kHzMono = 51, + SAFTCCITT_uLaw_11kHzStereo = 52, + SAFTCCITT_uLaw_22kHzMono = 53, + SAFTCCITT_uLaw_22kHzStereo = 54, + SAFTCCITT_uLaw_44kHzMono = 55, + SAFTCCITT_uLaw_44kHzStereo = 56, + SAFTADPCM_8kHzMono = 57, + SAFTADPCM_8kHzStereo = 58, + SAFTADPCM_11kHzMono = 59, + SAFTADPCM_11kHzStereo = 60, + SAFTADPCM_22kHzMono = 61, + SAFTADPCM_22kHzStereo = 62, + SAFTADPCM_44kHzMono = 63, + SAFTADPCM_44kHzStereo = 64, + SAFTGSM610_8kHzMono = 65, + SAFTGSM610_11kHzMono = 66, + SAFTGSM610_22kHzMono = 67, + SAFTGSM610_44kHzMono = 68, +}} +ENUM!{enum DISPID_SpeechAudioFormat { + DISPID_SAFType = 1, + DISPID_SAFGuid, + DISPID_SAFGetWaveFormatEx, + DISPID_SAFSetWaveFormatEx, +}} +ENUM!{enum DISPID_SpeechBaseStream { + DISPID_SBSFormat = 1, + DISPID_SBSRead, + DISPID_SBSWrite, + DISPID_SBSSeek, +}} +ENUM!{enum SpeechStreamSeekPositionType { + SSSPTRelativeToStart = STREAM_SEEK_SET, + SSSPTRelativeToCurrentPosition = STREAM_SEEK_CUR, + SSSPTRelativeToEnd = STREAM_SEEK_END, +}} +ENUM!{enum DISPID_SpeechAudio { + DISPID_SAStatus = 200, + DISPID_SABufferInfo, + DISPID_SADefaultFormat, + DISPID_SAVolume, + DISPID_SABufferNotifySize, + DISPID_SAEventHandle, + DISPID_SASetState, +}} +ENUM!{enum SpeechAudioState { + SASClosed = SPAS_CLOSED, + SASStop = SPAS_STOP, + SASPause = SPAS_PAUSE, + SASRun = SPAS_RUN, +}} +ENUM!{enum DISPID_SpeechMMSysAudio { + DISPID_SMSADeviceId = 300, + DISPID_SMSALineId, + DISPID_SMSAMMHandle, +}} +ENUM!{enum DISPID_SpeechFileStream { + DISPID_SFSOpen = 100, + DISPID_SFSClose, +}} +ENUM!{enum SpeechStreamFileMode { + SSFMOpenForRead = SPFM_OPEN_READONLY, + SSFMOpenReadWrite = SPFM_OPEN_READWRITE, + SSFMCreate = SPFM_CREATE, + SSFMCreateForWrite = SPFM_CREATE_ALWAYS, +}} +ENUM!{enum DISPID_SpeechCustomStream { + DISPID_SCSBaseStream = 100, +}} +ENUM!{enum DISPID_SpeechMemoryStream { + DISPID_SMSSetData = 100, + DISPID_SMSGetData, +}} +ENUM!{enum DISPID_SpeechAudioStatus { + DISPID_SASFreeBufferSpace = 1, + DISPID_SASNonBlockingIO, + DISPID_SASState, + DISPID_SASCurrentSeekPosition, + DISPID_SASCurrentDevicePosition, +}} +ENUM!{enum DISPID_SpeechAudioBufferInfo { + DISPID_SABIMinNotification = 1, + DISPID_SABIBufferSize, + DISPID_SABIEventBias, +}} +ENUM!{enum DISPID_SpeechWaveFormatEx { + DISPID_SWFEFormatTag = 1, + DISPID_SWFEChannels, + DISPID_SWFESamplesPerSec, + DISPID_SWFEAvgBytesPerSec, + DISPID_SWFEBlockAlign, + DISPID_SWFEBitsPerSample, + DISPID_SWFEExtraData, +}} +ENUM!{enum DISPID_SpeechVoice { + DISPID_SVStatus = 1, + DISPID_SVVoice, + DISPID_SVAudioOutput, + DISPID_SVAudioOutputStream, + DISPID_SVRate, + DISPID_SVVolume, + DISPID_SVAllowAudioOuputFormatChangesOnNextSet, + DISPID_SVEventInterests, + DISPID_SVPriority, + DISPID_SVAlertBoundary, + DISPID_SVSyncronousSpeakTimeout, + DISPID_SVSpeak, + DISPID_SVSpeakStream, + DISPID_SVPause, + DISPID_SVResume, + DISPID_SVSkip, + DISPID_SVGetVoices, + DISPID_SVGetAudioOutputs, + DISPID_SVWaitUntilDone, + DISPID_SVSpeakCompleteEvent, + DISPID_SVIsUISupported, + DISPID_SVDisplayUI, +}} +ENUM!{enum SpeechVoicePriority { + SVPNormal = SPVPRI_NORMAL, + SVPAlert = SPVPRI_ALERT, + SVPOver = SPVPRI_OVER, +}} +ENUM!{enum SpeechVoiceSpeakFlags { + SVSFDefault = SPF_DEFAULT, + SVSFlagsAsync = SPF_ASYNC, + SVSFPurgeBeforeSpeak = SPF_PURGEBEFORESPEAK, + SVSFIsFilename = SPF_IS_FILENAME, + SVSFIsXML = SPF_IS_XML, + SVSFIsNotXML = SPF_IS_NOT_XML, + SVSFPersistXML = SPF_PERSIST_XML, + SVSFNLPSpeakPunc = SPF_NLP_SPEAK_PUNC, + SVSFNLPMask = SPF_NLP_MASK, + SVSFVoiceMask = SPF_VOICE_MASK as u32, + SVSFUnusedFlags = SPF_UNUSED_FLAGS as u32, +}} +ENUM!{enum SpeechVoiceEvents { + SVEStartInputStream = 1 << 1, + SVEEndInputStream = 1 << 2, + SVEVoiceChange = 1 << 3, + SVEBookmark = 1 << 4, + SVEWordBoundary = 1 << 5, + SVEPhoneme = 1 << 6, + SVESentenceBoundary = 1 << 7, + SVEViseme = 1 << 8, + SVEAudioLevel = 1 << 9, + SVEPrivate = 1 << 15, + SVEAllEvents = 0x83fe, +}} +ENUM!{enum DISPID_SpeechVoiceStatus { + DISPID_SVSCurrentStreamNumber = 1, + DISPID_SVSLastStreamNumberQueued, + DISPID_SVSLastResult, + DISPID_SVSRunningState, + DISPID_SVSInputWordPosition, + DISPID_SVSInputWordLength, + DISPID_SVSInputSentencePosition, + DISPID_SVSInputSentenceLength, + DISPID_SVSLastBookmark, + DISPID_SVSLastBookmarkId, + DISPID_SVSPhonemeId, + DISPID_SVSVisemeId, +}} +ENUM!{enum SpeechRunState { + SRSEDone = SPRS_DONE, + SRSEIsSpeaking = SPRS_IS_SPEAKING, +}} +ENUM!{enum SpeechVisemeType { + SVP_0 = 0, + SVP_1, + SVP_2, + SVP_3, + SVP_4, + SVP_5, + SVP_6, + SVP_7, + SVP_8, + SVP_9, + SVP_10, + SVP_11, + SVP_12, + SVP_13, + SVP_14, + SVP_15, + SVP_16, + SVP_17, + SVP_18, + SVP_19, + SVP_20, + SVP_21, +}} +ENUM!{enum SpeechVisemeFeature { + SVF_None = 0, + SVF_Stressed = SPVFEATURE_STRESSED, + SVF_Emphasis = SPVFEATURE_EMPHASIS, +}} +ENUM!{enum DISPID_SpeechVoiceEvent { + DISPID_SVEStreamStart = 1, + DISPID_SVEStreamEnd, + DISPID_SVEVoiceChange, + DISPID_SVEBookmark, + DISPID_SVEWord, + DISPID_SVEPhoneme, + DISPID_SVESentenceBoundary, + DISPID_SVEViseme, + DISPID_SVEAudioLevel, + DISPID_SVEEnginePrivate, +}} +ENUM!{enum DISPID_SpeechRecognizer { + DISPID_SRRecognizer = 1, + DISPID_SRAllowAudioInputFormatChangesOnNextSet, + DISPID_SRAudioInput, + DISPID_SRAudioInputStream, + DISPID_SRIsShared, + DISPID_SRState, + DISPID_SRStatus, + DISPID_SRProfile, + DISPID_SREmulateRecognition, + DISPID_SRCreateRecoContext, + DISPID_SRGetFormat, + DISPID_SRSetPropertyNumber, + DISPID_SRGetPropertyNumber, + DISPID_SRSetPropertyString, + DISPID_SRGetPropertyString, + DISPID_SRIsUISupported, + DISPID_SRDisplayUI, + DISPID_SRGetRecognizers, + DISPID_SVGetAudioInputs, + DISPID_SVGetProfiles, +}} +ENUM!{enum SpeechRecognizerState { + SRSInactive = SPRST_INACTIVE, + SRSActive = SPRST_ACTIVE, + SRSActiveAlways = SPRST_ACTIVE_ALWAYS, + SRSInactiveWithPurge = SPRST_INACTIVE_WITH_PURGE, +}} +ENUM!{enum SpeechDisplayAttributes { + SDA_No_Trailing_Space = 0, + SDA_One_Trailing_Space = SPAF_ONE_TRAILING_SPACE, + SDA_Two_Trailing_Spaces = SPAF_TWO_TRAILING_SPACES, + SDA_Consume_Leading_Spaces = SPAF_CONSUME_LEADING_SPACES, +}} +ENUM!{enum SpeechFormatType { + SFTInput = SPWF_INPUT, + SFTSREngine = SPWF_SRENGINE, +}} +ENUM!{enum DISPID_SpeechRecognizerStatus { + DISPID_SRSAudioStatus = 1, + DISPID_SRSCurrentStreamPosition, + DISPID_SRSCurrentStreamNumber, + DISPID_SRSNumberOfActiveRules, + DISPID_SRSClsidEngine, + DISPID_SRSSupportedLanguages, +}} +ENUM!{enum DISPID_SpeechRecoContext { + DISPID_SRCRecognizer = 1, + DISPID_SRCAudioInInterferenceStatus, + DISPID_SRCRequestedUIType, + DISPID_SRCVoice, + DISPID_SRAllowVoiceFormatMatchingOnNextSet, + DISPID_SRCVoicePurgeEvent, + DISPID_SRCEventInterests, + DISPID_SRCCmdMaxAlternates, + DISPID_SRCState, + DISPID_SRCRetainedAudio, + DISPID_SRCRetainedAudioFormat, + DISPID_SRCPause, + DISPID_SRCResume, + DISPID_SRCCreateGrammar, + DISPID_SRCCreateResultFromMemory, + DISPID_SRCBookmark, + DISPID_SRCSetAdaptationData, +}} +ENUM!{enum SpeechRetainedAudioOptions { + SRAONone = SPAO_NONE, + SRAORetainAudio = SPAO_RETAIN_AUDIO, +}} +ENUM!{enum SpeechBookmarkOptions { + SBONone = SPBO_NONE, + SBOPause = SPBO_PAUSE, +}} +ENUM!{enum SpeechInterference { + SINone = SPINTERFERENCE_NONE, + SINoise = SPINTERFERENCE_NOISE, + SINoSignal = SPINTERFERENCE_NOSIGNAL, + SITooLoud = SPINTERFERENCE_TOOLOUD, + SITooQuiet = SPINTERFERENCE_TOOQUIET, + SITooFast = SPINTERFERENCE_TOOFAST, + SITooSlow = SPINTERFERENCE_TOOSLOW, +}} +ENUM!{enum SpeechRecoEvents { + SREStreamEnd = 1 << 0, + SRESoundStart = 1 << 1, + SRESoundEnd = 1 << 2, + SREPhraseStart = 1 << 3, + SRERecognition = 1 << 4, + SREHypothesis = 1 << 5, + SREBookmark = 1 << 6, + SREPropertyNumChange = 1 << 7, + SREPropertyStringChange = 1 << 8, + SREFalseRecognition = 1 << 9, + SREInterference = 1 << 10, + SRERequestUI = 1 << 11, + SREStateChange = 1 << 12, + SREAdaptation = 1 << 13, + SREStreamStart = 1 << 14, + SRERecoOtherContext = 1 << 15, + SREAudioLevel = 1 << 16, + SREPrivate = 1 << 18, + SREAllEvents = 0x5ffff, +}} +ENUM!{enum SpeechRecoContextState { + SRCS_Disabled = SPCS_DISABLED, + SRCS_Enabled = SPCS_ENABLED, +}} +ENUM!{enum DISPIDSPRG { + DISPID_SRGId = 1, + DISPID_SRGRecoContext, + DISPID_SRGState, + DISPID_SRGRules, + DISPID_SRGReset, + DISPID_SRGCommit, + DISPID_SRGCmdLoadFromFile, + DISPID_SRGCmdLoadFromObject, + DISPID_SRGCmdLoadFromResource, + DISPID_SRGCmdLoadFromMemory, + DISPID_SRGCmdLoadFromProprietaryGrammar, + DISPID_SRGCmdSetRuleState, + DISPID_SRGCmdSetRuleIdState, + DISPID_SRGDictationLoad, + DISPID_SRGDictationUnload, + DISPID_SRGDictationSetState, + DISPID_SRGSetWordSequenceData, + DISPID_SRGSetTextSelection, + DISPID_SRGIsPronounceable, +}} +ENUM!{enum SpeechLoadOption { + SLOStatic = SPLO_STATIC, + SLODynamic = SPLO_DYNAMIC, +}} +ENUM!{enum SpeechWordPronounceable { + SWPUnknownWordUnpronounceable = SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE, + SWPUnknownWordPronounceable = SPWP_UNKNOWN_WORD_PRONOUNCEABLE, + SWPKnownWordPronounceable = SPWP_KNOWN_WORD_PRONOUNCEABLE, +}} +ENUM!{enum SpeechGrammarState { + SGSEnabled = SPGS_ENABLED, + SGSDisabled = SPGS_DISABLED, + SGSExclusive = SPGS_EXCLUSIVE, +}} +ENUM!{enum SpeechRuleState { + SGDSInactive = SPRS_INACTIVE, + SGDSActive = SPRS_ACTIVE, + SGDSActiveWithAutoPause = SPRS_ACTIVE_WITH_AUTO_PAUSE, +}} +ENUM!{enum SpeechRuleAttributes { + SRATopLevel = SPRAF_TopLevel, + SRADefaultToActive = SPRAF_Active, + SRAExport = SPRAF_Export, + SRAImport = SPRAF_Import, + SRAInterpreter = SPRAF_Interpreter, + SRADynamic = SPRAF_Dynamic, +}} +ENUM!{enum SpeechGrammarWordType { + SGDisplay = SPWT_DISPLAY, + SGLexical = SPWT_LEXICAL, + SGPronounciation = SPWT_PRONUNCIATION, +}} +ENUM!{enum DISPID_SpeechRecoContextEvents { + DISPID_SRCEStartStream = 1, + DISPID_SRCEEndStream, + DISPID_SRCEBookmark, + DISPID_SRCESoundStart, + DISPID_SRCESoundEnd, + DISPID_SRCEPhraseStart, + DISPID_SRCERecognition, + DISPID_SRCEHypothesis, + DISPID_SRCEPropertyNumberChange, + DISPID_SRCEPropertyStringChange, + DISPID_SRCEFalseRecognition, + DISPID_SRCEInterference, + DISPID_SRCERequestUI, + DISPID_SRCERecognizerStateChange, + DISPID_SRCEAdaptation, + DISPID_SRCERecognitionForOtherContext, + DISPID_SRCEAudioLevel, + DISPID_SRCEEnginePrivate, +}} +ENUM!{enum SpeechRecognitionType { + SRTStandard = 0, + SRTAutopause = SPREF_AutoPause, + SRTEmulated = SPREF_Emulated, +}} +ENUM!{enum DISPID_SpeechGrammarRule { + DISPID_SGRAttributes = 1, + DISPID_SGRInitialState, + DISPID_SGRName, + DISPID_SGRId, + DISPID_SGRClear, + DISPID_SGRAddResource, + DISPID_SGRAddState, +}} +ENUM!{enum DISPID_SpeechGrammarRules { + DISPID_SGRsCount = 1, + DISPID_SGRsDynamic, + DISPID_SGRsAdd, + DISPID_SGRsCommit, + DISPID_SGRsCommitAndSave, + DISPID_SGRsFindRule, + DISPID_SGRsItem = DISPID_VALUE as u32, + DISPID_SGRs_NewEnum = DISPID_NEWENUM as u32, +}} +ENUM!{enum DISPID_SpeechGrammarRuleState { + DISPID_SGRSRule = 1, + DISPID_SGRSTransitions, + DISPID_SGRSAddWordTransition, + DISPID_SGRSAddRuleTransition, + DISPID_SGRSAddSpecialTransition, +}} +ENUM!{enum SpeechSpecialTransitionType { + SSTTWildcard = 1, + SSTTDictation, + SSTTTextBuffer, +}} +ENUM!{enum DISPID_SpeechGrammarRuleStateTransitions { + DISPID_SGRSTsCount = 1, + DISPID_SGRSTsItem = DISPID_VALUE as u32, + DISPID_SGRSTs_NewEnum = DISPID_NEWENUM as u32, +}} +ENUM!{enum DISPID_SpeechGrammarRuleStateTransition { + DISPID_SGRSTType = 1, + DISPID_SGRSTText, + DISPID_SGRSTRule, + DISPID_SGRSTWeight, + DISPID_SGRSTPropertyName, + DISPID_SGRSTPropertyId, + DISPID_SGRSTPropertyValue, + DISPID_SGRSTNextState, +}} +ENUM!{enum SpeechGrammarRuleStateTransitionType { + SGRSTTEpsilon = 0, + SGRSTTWord, + SGRSTTRule, + SGRSTTDictation, + SGRSTTWildcard, + SGRSTTTextBuffer, +}} +ENUM!{enum DISPIDSPTSI { + DISPIDSPTSI_ActiveOffset = 1, + DISPIDSPTSI_ActiveLength, + DISPIDSPTSI_SelectionOffset, + DISPIDSPTSI_SelectionLength, +}} +ENUM!{enum DISPID_SpeechRecoResult { + DISPID_SRRRecoContext = 1, + DISPID_SRRTimes, + DISPID_SRRAudioFormat, + DISPID_SRRPhraseInfo, + DISPID_SRRAlternates, + DISPID_SRRAudio, + DISPID_SRRSpeakAudio, + DISPID_SRRSaveToMemory, + DISPID_SRRDiscardResultInfo, +}} +ENUM!{enum SpeechDiscardType { + SDTProperty = SPDF_PROPERTY, + SDTReplacement = SPDF_REPLACEMENT, + SDTRule = SPDF_RULE, + SDTDisplayText = SPDF_DISPLAYTEXT, + SDTLexicalForm = SPDF_LEXICALFORM, + SDTPronunciation = SPDF_PRONUNCIATION, + SDTAudio = SPDF_AUDIO, + SDTAlternates = SPDF_ALTERNATES, + SDTAll = SPDF_ALL, +}} +ENUM!{enum DISPID_SpeechPhraseBuilder { + DISPID_SPPBRestorePhraseFromMemory = 1, +}} +ENUM!{enum DISPID_SpeechRecoResultTimes { + DISPID_SRRTStreamTime = 1, + DISPID_SRRTLength, + DISPID_SRRTTickCount, + DISPID_SRRTOffsetFromStart, +}} +ENUM!{enum DISPID_SpeechPhraseAlternate { + DISPID_SPARecoResult = 1, + DISPID_SPAStartElementInResult, + DISPID_SPANumberOfElementsInResult, + DISPID_SPAPhraseInfo, + DISPID_SPACommit, +}} +ENUM!{enum DISPID_SpeechPhraseAlternates { + DISPID_SPAsCount = 1, + DISPID_SPAsItem = DISPID_VALUE as u32, + DISPID_SPAs_NewEnum = DISPID_NEWENUM as u32, +}} +ENUM!{enum DISPID_SpeechPhraseInfo { + DISPID_SPILanguageId = 1, + DISPID_SPIGrammarId, + DISPID_SPIStartTime, + DISPID_SPIAudioStreamPosition, + DISPID_SPIAudioSizeBytes, + DISPID_SPIRetainedSizeBytes, + DISPID_SPIAudioSizeTime, + DISPID_SPIRule, + DISPID_SPIProperties, + DISPID_SPIElements, + DISPID_SPIReplacements, + DISPID_SPIEngineId, + DISPID_SPIEnginePrivateData, + DISPID_SPISaveToMemory, + DISPID_SPIGetText, + DISPID_SPIGetDisplayAttributes, +}} +ENUM!{enum DISPID_SpeechPhraseElement { + DISPID_SPEAudioTimeOffset = 1, + DISPID_SPEAudioSizeTime, + DISPID_SPEAudioStreamOffset, + DISPID_SPEAudioSizeBytes, + DISPID_SPERetainedStreamOffset, + DISPID_SPERetainedSizeBytes, + DISPID_SPEDisplayText, + DISPID_SPELexicalForm, + DISPID_SPEPronunciation, + DISPID_SPEDisplayAttributes, + DISPID_SPERequiredConfidence, + DISPID_SPEActualConfidence, + DISPID_SPEEngineConfidence, +}} +ENUM!{enum SpeechEngineConfidence { + SECLowConfidence = -1i32 as u32, + SECNormalConfidence = 0, + SECHighConfidence = 1, +}} +ENUM!{enum DISPID_SpeechPhraseElements { + DISPID_SPEsCount = 1, + DISPID_SPEsItem = DISPID_VALUE as u32, + DISPID_SPEs_NewEnum = DISPID_NEWENUM as u32, +}} +ENUM!{enum DISPID_SpeechPhraseReplacement { + DISPID_SPRDisplayAttributes = 1, + DISPID_SPRText, + DISPID_SPRFirstElement, + DISPID_SPRNumberOfElements, +}} +ENUM!{enum DISPID_SpeechPhraseReplacements { + DISPID_SPRsCount = 1, + DISPID_SPRsItem = DISPID_VALUE as u32, + DISPID_SPRs_NewEnum = DISPID_NEWENUM as u32, +}} +ENUM!{enum DISPID_SpeechPhraseProperty { + DISPID_SPPName = 1, + DISPID_SPPId, + DISPID_SPPValue, + DISPID_SPPFirstElement, + DISPID_SPPNumberOfElements, + DISPID_SPPEngineConfidence, + DISPID_SPPConfidence, + DISPID_SPPParent, + DISPID_SPPChildren, +}} +ENUM!{enum DISPID_SpeechPhraseProperties { + DISPID_SPPsCount = 1, + DISPID_SPPsItem = DISPID_VALUE as u32, + DISPID_SPPs_NewEnum = DISPID_NEWENUM as u32, +}} +ENUM!{enum DISPID_SpeechPhraseRule { + DISPID_SPRuleName = 1, + DISPID_SPRuleId, + DISPID_SPRuleFirstElement, + DISPID_SPRuleNumberOfElements, + DISPID_SPRuleParent, + DISPID_SPRuleChildren, + DISPID_SPRuleConfidence, + DISPID_SPRuleEngineConfidence, +}} +ENUM!{enum DISPID_SpeechPhraseRules { + DISPID_SPRulesCount = 1, + DISPID_SPRulesItem = DISPID_VALUE as u32, + DISPID_SPRules_NewEnum = DISPID_NEWENUM as u32, +}} +ENUM!{enum DISPID_SpeechLexicon { + DISPID_SLGenerationId = 1, + DISPID_SLGetWords, + DISPID_SLAddPronunciation, + DISPID_SLAddPronunciationByPhoneIds, + DISPID_SLRemovePronunciation, + DISPID_SLRemovePronunciationByPhoneIds, + DISPID_SLGetPronunciations, + DISPID_SLGetGenerationChange, +}} +ENUM!{enum SpeechLexiconType { + SLTUser = eLEXTYPE_USER, + SLTApp = eLEXTYPE_APP, +}} +ENUM!{enum SpeechPartOfSpeech { + SPSNotOverriden = SPPS_NotOverriden, + SPSUnknown = SPPS_Unknown, + SPSNoun = SPPS_Noun, + SPSVerb = SPPS_Verb, + SPSModifier = SPPS_Modifier, + SPSFunction = SPPS_Function, + SPSInterjection = SPPS_Interjection, +}} +ENUM!{enum DISPID_SpeechLexiconWords { + DISPID_SLWsCount = 1, + DISPID_SLWsItem = DISPID_VALUE as u32, + DISPID_SLWs_NewEnum = DISPID_NEWENUM as u32, +}} +ENUM!{enum SpeechWordType { + SWTAdded = eWORDTYPE_ADDED, + SWTDeleted = eWORDTYPE_DELETED, +}} +ENUM!{enum DISPID_SpeechLexiconWord { + DISPID_SLWLangId = 1, + DISPID_SLWType, + DISPID_SLWWord, + DISPID_SLWPronunciations, +}} +ENUM!{enum DISPID_SpeechLexiconProns { + DISPID_SLPsCount = 1, + DISPID_SLPsItem = DISPID_VALUE as u32, + DISPID_SLPs_NewEnum = DISPID_NEWENUM as u32, +}} +ENUM!{enum DISPID_SpeechLexiconPronunciation { + DISPID_SLPType = 1, + DISPID_SLPLangId, + DISPID_SLPPartOfSpeech, + DISPID_SLPPhoneIds, + DISPID_SLPSymbolic, +}} +ENUM!{enum DISPID_SpeechPhoneConverter { + DISPID_SPCLangId = 1, + DISPID_SPCPhoneToId, + DISPID_SPCIdToPhone, +}} +extern { + pub static LIBID_SpeechLib: IID; +} +RIDL!{#[uuid(0xce17c09b, 0x4efa, 0x44d5, 0xa4, 0xc9, 0x59, 0xd9, 0x58, 0x5a, 0xb0, 0xcd)] +interface ISpeechDataKey(ISpeechDataKeyVtbl): IDispatch(IDispatchVtbl) { + fn SetBinaryValue( + ValueName: BSTR, + Value: VARIANT, + ) -> HRESULT, + fn GetBinaryValue( + ValueName: BSTR, + Value: *mut VARIANT, + ) -> HRESULT, + fn SetStringValue( + ValueName: BSTR, + Value: BSTR, + ) -> HRESULT, + fn GetStringValue( + ValueName: BSTR, + Value: *mut BSTR, + ) -> HRESULT, + fn SetLongValue( + ValueName: BSTR, + Value: c_long, + ) -> HRESULT, + fn GetLongValue( + ValueName: BSTR, + Value: *mut c_long, + ) -> HRESULT, + fn OpenKey( + SubKeyName: BSTR, + SubKey: *mut *mut ISpeechDataKey, + ) -> HRESULT, + fn CreateKey( + SubKeyName: BSTR, + SubKey: *mut *mut ISpeechDataKey, + ) -> HRESULT, + fn DeleteKey( + SubKeyName: BSTR, + ) -> HRESULT, + fn DeleteValue( + ValueName: BSTR, + ) -> HRESULT, + fn EnumKeys( + Index: c_long, + SubKeyName: *mut BSTR, + ) -> HRESULT, + fn EnumValues( + Index: c_long, + ValueName: *mut BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc74a3adc, 0xb727, 0x4500, 0xa8, 0x4a, 0xb5, 0x26, 0x72, 0x1c, 0x8b, 0x8c)] +interface ISpeechObjectToken(ISpeechObjectTokenVtbl): IDispatch(IDispatchVtbl) { + fn get_Id( + ObjectId: *mut BSTR, + ) -> HRESULT, + fn get_DataKey( + DataKey: *mut *mut ISpeechDataKey, + ) -> HRESULT, + fn get_Category( + Category: *mut *mut ISpeechObjectTokenCategory, + ) -> HRESULT, + fn GetDescription( + Locale: c_long, + Description: *mut BSTR, + ) -> HRESULT, + fn SetId( + Id: BSTR, + CategoryId: BSTR, + CreateIfNotExist: VARIANT_BOOL, + ) -> HRESULT, + fn GetAttribute( + AttributeName: BSTR, + AttributeValue: *mut BSTR, + ) -> HRESULT, + fn CreateInstance( + pUnkOuter: *mut IUnknown, + ClsContext: SpeechTokenContext, + Object: *mut *mut IUnknown, + ) -> HRESULT, + fn Remove( + ObjectStorageCLSID: BSTR, + ) -> HRESULT, + fn GetStorageFileName( + ObjectStorageCLSID: BSTR, + KeyName: BSTR, + FileName: BSTR, + Folder: BSTR, + FilePath: *mut BSTR, + ) -> HRESULT, + fn RemoveStorageFileName( + ObjectStorageCLSID: BSTR, + KeyName: BSTR, + DeleteFile: VARIANT_BOOL, + ) -> HRESULT, + fn IsUISupported( + TypeOfUI: BSTR, + ExtraData: *const VARIANT, + Object: *mut IUnknown, + Supported: *mut VARIANT_BOOL, + ) -> HRESULT, + fn DisplayUI( + hWnd: c_long, + Title: BSTR, + TypeOfUI: BSTR, + ExtraData: *const VARIANT, + Object: *mut IUnknown, + ) -> HRESULT, + fn MatchesAttributes( + Attributes: BSTR, + Matches: *mut VARIANT_BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9285b776, 0x2e7b, 0x4bc0, 0xb5, 0x3e, 0x58, 0x0e, 0xb6, 0xfa, 0x96, 0x7f)] +interface ISpeechObjectTokens(ISpeechObjectTokensVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + Count: *mut c_long, + ) -> HRESULT, + fn Item( + Index: c_long, + Token: *mut *mut ISpeechObjectToken, + ) -> HRESULT, + fn get__NewEnum( + ppEnumVARIANT: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xca7eac50, 0x2d01, 0x4145, 0x86, 0xd4, 0x5a, 0xe7, 0xd7, 0x0f, 0x44, 0x69)] +interface ISpeechObjectTokenCategory(ISpeechObjectTokenCategoryVtbl): IDispatch(IDispatchVtbl) { + fn get_Id( + Id: *mut BSTR, + ) -> HRESULT, + fn put_Default( + TokenId: BSTR, + ) -> HRESULT, + fn get_Default( + TokenId: *mut BSTR, + ) -> HRESULT, + fn SetId( + Id: BSTR, + CreateIfNotExist: VARIANT_BOOL, + ) -> HRESULT, + fn GetDataKey( + Location: SpeechDataKeyLocation, + DataKey: *mut *mut ISpeechDataKey, + ) -> HRESULT, + fn EnumerateTokens( + RequiredAttributes: BSTR, + OptionalAttributes: BSTR, + Tokens: *mut *mut ISpeechObjectTokens, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x11b103d8, 0x1142, 0x4edf, 0xa0, 0x93, 0x82, 0xfb, 0x39, 0x15, 0xf8, 0xcc)] +interface ISpeechAudioBufferInfo(ISpeechAudioBufferInfoVtbl): IDispatch(IDispatchVtbl) { + fn get_MinNotification( + MinNotification: *mut c_long, + ) -> HRESULT, + fn put_MinNotification( + MinNotification: c_long, + ) -> HRESULT, + fn get_BufferSize( + BufferSize: *mut c_long, + ) -> HRESULT, + fn put_BufferSize( + BufferSize: c_long, + ) -> HRESULT, + fn get_EventBias( + EventBias: *mut c_long, + ) -> HRESULT, + fn put_EventBias( + EventBias: c_long, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc62d9c91, 0x7458, 0x47f6, 0x86, 0x2d, 0x1e, 0xf8, 0x6f, 0xb0, 0xb2, 0x78)] +interface ISpeechAudioStatus(ISpeechAudioStatusVtbl): IDispatch(IDispatchVtbl) { + fn get_FreeBufferSpace( + FreeBufferSpace: *mut c_long, + ) -> HRESULT, + fn get_NonBlockingIO( + NonBlockingIO: *mut c_long, + ) -> HRESULT, + fn get_State( + State: *mut SpeechAudioState, + ) -> HRESULT, + fn get_CurrentSeekPosition( + CurrentSeekPosition: *mut VARIANT, + ) -> HRESULT, + fn get_CurrentDevicePosition( + CurrentDevicePosition: *mut VARIANT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xe6e9c590, 0x3e18, 0x40e3, 0x82, 0x99, 0x06, 0x1f, 0x98, 0xbd, 0xe7, 0xc7)] +interface ISpeechAudioFormat(ISpeechAudioFormatVtbl): IDispatch(IDispatchVtbl) { + fn get_Type( + AudioFormat: *mut SpeechAudioFormatType, + ) -> HRESULT, + fn put_Type( + AudioFormat: SpeechAudioFormatType, + ) -> HRESULT, + fn get_Guid( + Guid: *mut BSTR, + ) -> HRESULT, + fn put_Guid( + Guid: BSTR, + ) -> HRESULT, + fn GetWaveFormatEx( + SpeechWaveFormatEx: *mut *mut ISpeechWaveFormatEx, + ) -> HRESULT, + fn SetWaveFormatEx( + SpeechWaveFormatEx: *mut ISpeechWaveFormatEx, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7a1ef0d5, 0x1581, 0x4741, 0x88, 0xe4, 0x20, 0x9a, 0x49, 0xf1, 0x1a, 0x10)] +interface ISpeechWaveFormatEx(ISpeechWaveFormatExVtbl): IDispatch(IDispatchVtbl) { + fn get_FormatTag( + FormatTag: *mut c_short, + ) -> HRESULT, + fn put_FormatTag( + FormatTag: c_short, + ) -> HRESULT, + fn get_Channels( + Channels: *mut c_short, + ) -> HRESULT, + fn put_Channels( + Channels: c_short, + ) -> HRESULT, + fn get_SamplesPerSec( + SamplesPerSec: *mut c_long, + ) -> HRESULT, + fn put_SamplesPerSec( + SamplesPerSec: c_long, + ) -> HRESULT, + fn get_AvgBytesPerSec( + AvgBytesPerSec: *mut c_long, + ) -> HRESULT, + fn put_AvgBytesPerSec( + AvgBytesPerSec: c_long, + ) -> HRESULT, + fn get_BlockAlign( + BlockAlign: *mut c_short, + ) -> HRESULT, + fn put_BlockAlign( + BlockAlign: c_short, + ) -> HRESULT, + fn get_BitsPerSample( + BitsPerSample: *mut c_short, + ) -> HRESULT, + fn put_BitsPerSample( + BitsPerSample: c_short, + ) -> HRESULT, + fn get_ExtraData( + ExtraData: *mut VARIANT, + ) -> HRESULT, + fn put_ExtraData( + ExtraData: VARIANT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6450336f, 0x7d49, 0x4ced, 0x80, 0x97, 0x49, 0xd6, 0xde, 0xe3, 0x72, 0x94)] +interface ISpeechBaseStream(ISpeechBaseStreamVtbl): IDispatch(IDispatchVtbl) { + fn get_Format( + AudioFormat: *mut *mut ISpeechAudioFormat, + ) -> HRESULT, + fn putref_Format( + AudioFormat: *mut ISpeechAudioFormat, + ) -> HRESULT, + fn Read( + Buffer: *mut VARIANT, + NumberOfBytes: c_long, + BytesRead: *mut c_long, + ) -> HRESULT, + fn Write( + Buffer: VARIANT, + BytesWritten: *mut c_long, + ) -> HRESULT, + fn Seek( + Position: VARIANT, + Origin: SpeechStreamSeekPositionType, + NewPosition: *mut VARIANT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xaf67f125, 0xab39, 0x4e93, 0xb4, 0xa2, 0xcc, 0x2e, 0x66, 0xe1, 0x82, 0xa7)] +interface ISpeechFileStream(ISpeechFileStreamVtbl): ISpeechBaseStream(ISpeechBaseStreamVtbl) { + fn Open( + FileName: BSTR, + FileMode: SpeechStreamFileMode, + DoEvents: VARIANT_BOOL, + ) -> HRESULT, + fn Close() -> HRESULT, +}} +RIDL!{#[uuid(0xeeb14b68, 0x808b, 0x4abe, 0xa5, 0xea, 0xb5, 0x1d, 0xa7, 0x58, 0x80, 0x08)] +interface ISpeechMemoryStream(ISpeechMemoryStreamVtbl): ISpeechBaseStream(ISpeechBaseStreamVtbl) { + fn SetData( + Data: VARIANT, + ) -> HRESULT, + fn GetData( + pData: *mut VARIANT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x1a9e9f4f, 0x104f, 0x4db8, 0xa1, 0x15, 0xef, 0xd7, 0xfd, 0x0c, 0x97, 0xae)] +interface ISpeechCustomStream(ISpeechCustomStreamVtbl): ISpeechBaseStream(ISpeechBaseStreamVtbl) { + fn get_BaseStream( + ppUnkStream: *mut *mut IUnknown, + ) -> HRESULT, + fn putref_BaseStream( + pUnkStream: *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xcff8e175, 0x019e, 0x11d3, 0xa0, 0x8e, 0x00, 0xc0, 0x4f, 0x8e, 0xf9, 0xb5)] +interface ISpeechAudio(ISpeechAudioVtbl): ISpeechBaseStream(ISpeechBaseStreamVtbl) { + fn get_Status( + Status: *mut *mut ISpeechAudioStatus, + ) -> HRESULT, + fn get_BufferInfo( + BufferInfo: *mut *mut ISpeechAudioBufferInfo, + ) -> HRESULT, + fn get_DefaultFormat( + StreamFormat: *mut *mut ISpeechAudioFormat, + ) -> HRESULT, + fn get_Volume( + Volume: *mut c_long, + ) -> HRESULT, + fn put_Volume( + Volume: c_long, + ) -> HRESULT, + fn get_BufferNotifySize( + BufferNotifySize: *mut c_long, + ) -> HRESULT, + fn put_BufferNotifySize( + BufferNotifySize: c_long, + ) -> HRESULT, + fn get_EventHandle( + EventHandle: *mut c_long, + ) -> HRESULT, + fn SetState( + State: SpeechAudioState, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3c76af6d, 0x1fd7, 0x4831, 0x81, 0xd1, 0x3b, 0x71, 0xd5, 0xa1, 0x3c, 0x44)] +interface ISpeechMMSysAudio(ISpeechMMSysAudioVtbl): ISpeechAudio(ISpeechAudioVtbl) { + fn get_DeviceId( + DeviceId: *mut c_long, + ) -> HRESULT, + fn put_DeviceId( + DeviceId: c_long, + ) -> HRESULT, + fn get_LineId( + LineId: *mut c_long, + ) -> HRESULT, + fn put_LineId( + LineId: c_long, + ) -> HRESULT, + fn get_MMHandle( + Handle: *mut c_long, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x269316d8, 0x57bd, 0x11d2, 0x9e, 0xee, 0x00, 0xc0, 0x4f, 0x79, 0x73, 0x96)] +interface ISpeechVoice(ISpeechVoiceVtbl): IDispatch(IDispatchVtbl) { + fn get_Status( + Status: *mut *mut ISpeechVoiceStatus, + ) -> HRESULT, + fn get_Voice( + Voice: *mut *mut ISpeechObjectToken, + ) -> HRESULT, + fn putref_Voice( + Voice: *mut ISpeechObjectToken, + ) -> HRESULT, + fn get_AudioOutput( + AudioOutput: *mut *mut ISpeechObjectToken, + ) -> HRESULT, + fn putref_AudioOutput( + AudioOutput: *mut ISpeechObjectToken, + ) -> HRESULT, + fn get_AudioOutputStream( + AudioOutputStream: *mut *mut ISpeechBaseStream, + ) -> HRESULT, + fn putref_AudioOutputStream( + AudioOutputStream: *mut ISpeechBaseStream, + ) -> HRESULT, + fn get_Rate( + Rate: *mut c_long, + ) -> HRESULT, + fn put_Rate( + Rate: c_long, + ) -> HRESULT, + fn get_Volume( + Volume: *mut c_long, + ) -> HRESULT, + fn put_Volume( + Volume: c_long, + ) -> HRESULT, + fn put_AllowAudioOutputFormatChangesOnNextSet( + Allow: VARIANT_BOOL, + ) -> HRESULT, + fn get_AllowAudioOutputFormatChangesOnNextSet( + Allow: *mut VARIANT_BOOL, + ) -> HRESULT, + fn get_EventInterests( + EventInterestFlags: *mut SpeechVoiceEvents, + ) -> HRESULT, + fn put_EventInterests( + EventInterestFlags: SpeechVoiceEvents, + ) -> HRESULT, + fn put_Priority( + Priority: SpeechVoicePriority, + ) -> HRESULT, + fn get_Priority( + Priority: *mut SpeechVoicePriority, + ) -> HRESULT, + fn put_AlertBoundary( + Boundary: SpeechVoiceEvents, + ) -> HRESULT, + fn get_AlertBoundary( + Boundary: *mut SpeechVoiceEvents, + ) -> HRESULT, + fn put_SynchronousSpeakTimeout( + msTimeout: c_long, + ) -> HRESULT, + fn get_SynchronousSpeakTimeout( + msTimeOut: *mut c_long, + ) -> HRESULT, + fn Speak( + Text: BSTR, + Flags: SpeechVoiceSpeakFlags, + StreamNumber: *mut c_long, + ) -> HRESULT, + fn SpeakStream( + Stream: *mut ISpeechBaseStream, + Flags: SpeechVoiceSpeakFlags, + StreamNumber: *mut c_long, + ) -> HRESULT, + fn Pause() -> HRESULT, + fn Resume() -> HRESULT, + fn Skip( + Type: BSTR, + NumItems: c_long, + NumSkipped: c_long, + ) -> HRESULT, + fn GetVoices( + RequiredAttributes: BSTR, + OptionalAttributes: BSTR, + ObjectTokens: *mut *mut ISpeechObjectTokens, + ) -> HRESULT, + fn GetAudioOutputs( + RequiredAttributes: BSTR, + OptionalAttributes: BSTR, + ObjectTokens: *mut *mut ISpeechObjectTokens, + ) -> HRESULT, + fn WaitUntilDone( + msTimeout: c_long, + Done: *mut VARIANT_BOOL, + ) -> HRESULT, + fn SpeakCompleteEvent( + Handle: *mut c_long, + ) -> HRESULT, + fn IsUISupported( + TypeOfUI: BSTR, + ExtraData: *const VARIANT, + Supported: *mut VARIANT_BOOL, + ) -> HRESULT, + fn DisplayUI( + hWndParent: c_long, + Title: BSTR, + TypeOfUI: BSTR, + ExtraData: *const VARIANT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8be47b07, 0x57f6, 0x11d2, 0x9e, 0xee, 0x00, 0xc0, 0x4f, 0x79, 0x73, 0x96)] +interface ISpeechVoiceStatus(ISpeechVoiceStatusVtbl): IDispatch(IDispatchVtbl) { + fn get_CurrentStreamNumber( + StreamNumber: *mut c_long, + ) -> HRESULT, + fn get_LastStreamNumberQueued( + StreamNumber: *mut c_long, + ) -> HRESULT, + fn get_LastHResult( + HResult: *mut c_long, + ) -> HRESULT, + fn get_RunningState( + State: *mut SpeechRunState, + ) -> HRESULT, + fn get_InputWordPosition( + Position: *mut c_long, + ) -> HRESULT, + fn get_InputWordLength( + Length: *mut c_long, + ) -> HRESULT, + fn get_InputSentencePosition( + Position: *mut c_long, + ) -> HRESULT, + fn get_InputSentenceLength( + Length: *mut c_long, + ) -> HRESULT, + fn get_LastBookmark( + Bookmark: *mut BSTR, + ) -> HRESULT, + fn get_LastBookmarkId( + BookmarkId: *mut c_long, + ) -> HRESULT, + fn get_PhonemeId( + PhoneId: *mut c_short, + ) -> HRESULT, + fn get_VisemeId( + VisemeId: *mut c_short, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa372acd1, 0x3bef, 0x4bbd, 0x8f, 0xfb, 0xcb, 0x3e, 0x2b, 0x41, 0x6a, 0xf8)] +interface _ISpeechVoiceEvents(_ISpeechVoiceEventsVtbl): IDispatch(IDispatchVtbl) {}} +RIDL!{#[uuid(0x2d5f1c0c, 0xbd75, 0x4b08, 0x94, 0x78, 0x3b, 0x11, 0xfe, 0xa2, 0x58, 0x6c)] +interface ISpeechRecognizer(ISpeechRecognizerVtbl): IDispatch(IDispatchVtbl) { + fn putref_Recognizer( + Recognizer: *mut ISpeechObjectToken, + ) -> HRESULT, + fn get_Recognizer( + Recognizer: *mut *mut ISpeechObjectToken, + ) -> HRESULT, + fn put_AllowAudioInputFormatChangesOnNextSet( + Allow: VARIANT_BOOL, + ) -> HRESULT, + fn get_AllowAudioInputFormatChangesOnNextSet( + Allow: *mut VARIANT_BOOL, + ) -> HRESULT, + fn putref_AudioInput( + AudioInput: *mut ISpeechObjectToken, + ) -> HRESULT, + fn get_AudioInput( + AudioInput: *mut *mut ISpeechObjectToken, + ) -> HRESULT, + fn putref_AudioInputStream( + AudioInputStream: *mut ISpeechBaseStream, + ) -> HRESULT, + fn get_AudioInputStream( + AudioInputStream: *mut *mut ISpeechBaseStream, + ) -> HRESULT, + fn get_IsShared( + Shared: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_State( + State: SpeechRecognizerState, + ) -> HRESULT, + fn get_State( + State: *mut SpeechRecognizerState, + ) -> HRESULT, + fn get_Status( + Status: *mut *mut ISpeechRecognizerStatus, + ) -> HRESULT, + fn putref_Profile( + Profile: *mut ISpeechObjectToken, + ) -> HRESULT, + fn get_Profile( + Profile: *mut *mut ISpeechObjectToken, + ) -> HRESULT, + fn EmulateRecognition( + TextElements: VARIANT, + ElementDisplayAttributes: *mut VARIANT, + LanguageId: c_long, + ) -> HRESULT, + fn CreateRecoContext( + NewContext: *mut *mut ISpeechRecoContext, + ) -> HRESULT, + fn GetFormat( + Type: SpeechFormatType, + Format: *mut *mut ISpeechAudioFormat, + ) -> HRESULT, + fn SetPropertyNumber( + Name: BSTR, + Value: c_long, + Supported: *mut VARIANT_BOOL, + ) -> HRESULT, + fn GetPropertyNumber( + Name: BSTR, + Value: *mut c_long, + Supported: *mut VARIANT_BOOL, + ) -> HRESULT, + fn SetPropertyString( + Name: BSTR, + Value: BSTR, + Supported: *mut VARIANT_BOOL, + ) -> HRESULT, + fn GetPropertyString( + Name: BSTR, + Value: *mut BSTR, + Supported: *mut VARIANT_BOOL, + ) -> HRESULT, + fn IsUISupported( + TypeOfUI: BSTR, + ExtraData: *const VARIANT, + Supported: *mut VARIANT_BOOL, + ) -> HRESULT, + fn DisplayUI( + hWndParent: c_long, + Title: BSTR, + TypeOfUI: BSTR, + ExtraData: *const VARIANT, + ) -> HRESULT, + fn GetRecognizers( + RequiredAttributes: BSTR, + OptionalAttributes: BSTR, + ObjectTokens: *mut *mut ISpeechObjectTokens, + ) -> HRESULT, + fn GetAudioInputs( + RequiredAttributes: BSTR, + OptionalAttributes: BSTR, + ObjectTokens: *mut *mut ISpeechObjectTokens, + ) -> HRESULT, + fn GetProfiles( + RequiredAttributes: BSTR, + OptionalAttributes: BSTR, + ObjectTokens: *mut *mut ISpeechObjectTokens, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xbff9e781, 0x53ec, 0x484e, 0xbb, 0x8a, 0x0e, 0x1b, 0x55, 0x51, 0xe3, 0x5c)] +interface ISpeechRecognizerStatus(ISpeechRecognizerStatusVtbl): IDispatch(IDispatchVtbl) { + fn get_AudioStatus( + AudioStatus: *mut *mut ISpeechAudioStatus, + ) -> HRESULT, + fn get_CurrentStreamPosition( + pCurrentStreamPos: *mut VARIANT, + ) -> HRESULT, + fn get_CurrentStreamNumber( + StreamNumber: *mut c_long, + ) -> HRESULT, + fn get_NumberOfActiveRules( + NumberOfActiveRules: *mut c_long, + ) -> HRESULT, + fn get_ClsidEngine( + ClsidEngine: *mut BSTR, + ) -> HRESULT, + fn get_SupportedLanguages( + SupportedLanguages: *mut VARIANT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x580aa49d, 0x7e1e, 0x4809, 0xb8, 0xe2, 0x57, 0xda, 0x80, 0x61, 0x04, 0xb8)] +interface ISpeechRecoContext(ISpeechRecoContextVtbl): IDispatch(IDispatchVtbl) { + fn get_Recognizer( + Recognizer: *mut *mut ISpeechRecognizer, + ) -> HRESULT, + fn get_AudioInputInterferenceStatus( + Interference: *mut SpeechInterference, + ) -> HRESULT, + fn get_RequestedUIType( + UIType: *mut BSTR, + ) -> HRESULT, + fn putref_Voice( + Voice: *mut ISpeechVoice, + ) -> HRESULT, + fn get_Voice( + Voice: *mut *mut ISpeechVoice, + ) -> HRESULT, + fn put_AllowVoiceFormatMatchingOnNextSet( + Allow: VARIANT_BOOL, + ) -> HRESULT, + fn get_AllowVoiceFormatMatchingOnNextSet( + Allow: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_VoicePurgeEvent( + EventInterest: SpeechRecoEvents, + ) -> HRESULT, + fn get_VoicePurgeEvent( + EventInterest: *mut SpeechRecoEvents, + ) -> HRESULT, + fn put_EventInterests( + EventInterest: SpeechRecoEvents, + ) -> HRESULT, + fn get_EventInterests( + EventInterest: *mut SpeechRecoEvents, + ) -> HRESULT, + fn put_CmdMaxAlternates( + MaxAlternates: c_long, + ) -> HRESULT, + fn get_CmdMaxAlternates( + MaxAlternates: *mut c_long, + ) -> HRESULT, + fn put_State( + State: SpeechRecoContextState, + ) -> HRESULT, + fn get_State( + State: *mut SpeechRecoContextState, + ) -> HRESULT, + fn put_RetainedAudio( + Option: SpeechRetainedAudioOptions, + ) -> HRESULT, + fn get_RetainedAudio( + Option: *mut SpeechRetainedAudioOptions, + ) -> HRESULT, + fn putref_RetainedAudioFormat( + Format: *mut ISpeechAudioFormat, + ) -> HRESULT, + fn get_RetainedAudioFormat( + Format: *mut *mut ISpeechAudioFormat, + ) -> HRESULT, + fn Pause() -> HRESULT, + fn Resume() -> HRESULT, + fn CreateGrammar( + GrammarId: VARIANT, + Grammar: *mut *mut ISpeechRecoGrammar, + ) -> HRESULT, + fn CreateResultFromMemory( + ResultBlock: *mut VARIANT, + Result: *mut *mut ISpeechRecoResult, + ) -> HRESULT, + fn Bookmark( + Options: SpeechBookmarkOptions, + StreamPos: VARIANT, + BookmarkId: VARIANT, + ) -> HRESULT, + fn SetAdaptationData( + AdaptationString: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb6d6f79f, 0x2158, 0x4e50, 0xb5, 0xbc, 0x9a, 0x9c, 0xcd, 0x85, 0x2a, 0x09)] +interface ISpeechRecoGrammar(ISpeechRecoGrammarVtbl): IDispatch(IDispatchVtbl) { + fn get_Id( + Id: *mut VARIANT, + ) -> HRESULT, + fn get_RecoContext( + RecoContext: *mut *mut ISpeechRecoContext, + ) -> HRESULT, + fn put_State( + State: SpeechGrammarState, + ) -> HRESULT, + fn get_State( + State: *mut SpeechGrammarState, + ) -> HRESULT, + fn get_Rules( + Rules: *mut *mut ISpeechGrammarRules, + ) -> HRESULT, + fn Reset( + NewLanguage: SpeechLanguageId, + ) -> HRESULT, + fn CmdLoadFromFile( + FileName: BSTR, + LoadOption: SpeechLoadOption, + ) -> HRESULT, + fn CmdLoadFromObject( + ClassId: BSTR, + GrammarName: BSTR, + LoadOption: SpeechLoadOption, + ) -> HRESULT, + fn CmdLoadFromResource( + hModule: c_long, + ResourceName: VARIANT, + ResourceType: VARIANT, + LanguageId: SpeechLanguageId, + LoadOption: SpeechLoadOption, + ) -> HRESULT, + fn CmdLoadFromMemory( + GrammarData: VARIANT, + LoadOption: SpeechLoadOption, + ) -> HRESULT, + fn CmdLoadFromProprietaryGrammar( + ProprietaryGuid: BSTR, + PriorietaryString: BSTR, + ProprietaryData: VARIANT, + LoadOption: SpeechLoadOption, + ) -> HRESULT, + fn CmdSetRuleState( + Name: BSTR, + State: SpeechRuleState, + ) -> HRESULT, + fn CmdSetRuleIdState( + RuleId: c_long, + State: SpeechRuleState, + ) -> HRESULT, + fn DictationLoad( + TopicName: BSTR, + LoadOption: SpeechLoadOption, + ) -> HRESULT, + fn DictationUnload() -> HRESULT, + fn DictationSetState( + State: SpeechRuleState, + ) -> HRESULT, + fn SetWordSequenceData( + Text: BSTR, + TextLength: c_long, + Info: *mut ISpeechTextSelectionInformation, + ) -> HRESULT, + fn SetTextSelection( + Info: *mut ISpeechTextSelectionInformation, + ) -> HRESULT, + fn IsPronounceable( + Word: BSTR, + WordPronounceable: *mut SpeechWordPronounceable, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7b8fcb42, 0x0e9d, 0x4f00, 0xa0, 0x48, 0x7b, 0x04, 0xd6, 0x17, 0x9d, 0x3d)] +interface _ISpeechRecoContextEvents(_ISpeechRecoContextEventsVtbl): IDispatch(IDispatchVtbl) {}} +RIDL!{#[uuid(0xafe719cf, 0x5dd1, 0x44f2, 0x99, 0x9c, 0x7a, 0x39, 0x9f, 0x1c, 0xfc, 0xcc)] +interface ISpeechGrammarRule(ISpeechGrammarRuleVtbl): IDispatch(IDispatchVtbl) { + fn get_Attributes( + Attributes: *mut SpeechRuleAttributes, + ) -> HRESULT, + fn get_InitialState( + State: *mut *mut ISpeechGrammarRuleState, + ) -> HRESULT, + fn get_Name( + Name: *mut BSTR, + ) -> HRESULT, + fn get_Id( + Id: *mut c_long, + ) -> HRESULT, + fn Clear() -> HRESULT, + fn AddResource( + ResourceName: BSTR, + ResourceValue: BSTR, + ) -> HRESULT, + fn AddState( + State: *mut *mut ISpeechGrammarRuleState, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6ffa3b44, 0xfc2d, 0x40d1, 0x8a, 0xfc, 0x32, 0x91, 0x1c, 0x7f, 0x1a, 0xd1)] +interface ISpeechGrammarRules(ISpeechGrammarRulesVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + Count: *mut c_long, + ) -> HRESULT, + fn FindRule( + RuleNameOrId: VARIANT, + Rule: *mut *mut ISpeechGrammarRule, + ) -> HRESULT, + fn Item( + Index: c_long, + Rule: *mut *mut ISpeechGrammarRule, + ) -> HRESULT, + fn get__NewEnum( + EnumVARIANT: *mut *mut IUnknown, + ) -> HRESULT, + fn get_Dynamic( + Dynamic: *mut VARIANT_BOOL, + ) -> HRESULT, + fn Add( + RuleName: BSTR, + Attributes: SpeechRuleAttributes, + RuleId: c_long, + Rule: *mut *mut ISpeechGrammarRule, + ) -> HRESULT, + fn Commit() -> HRESULT, + fn CommitAndSave( + ErrorText: *mut BSTR, + SaveStream: *mut VARIANT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd4286f2c, 0xee67, 0x45ae, 0xb9, 0x28, 0x28, 0xd6, 0x95, 0x36, 0x2e, 0xda)] +interface ISpeechGrammarRuleState(ISpeechGrammarRuleStateVtbl): IDispatch(IDispatchVtbl) { + fn get_Rule( + Rule: *mut *mut ISpeechGrammarRule, + ) -> HRESULT, + fn get_Transitions( + Transitions: *mut *mut ISpeechGrammarRuleStateTransitions, + ) -> HRESULT, + fn AddWordTransition( + DestState: *mut ISpeechGrammarRuleState, + Words: BSTR, + Separators: BSTR, + Type: SpeechGrammarWordType, + PropertyName: BSTR, + PropertyId: c_long, + PropertyValue: *mut VARIANT, + Weight: c_float, + ) -> HRESULT, + fn AddRuleTransition( + DestinationState: *mut ISpeechGrammarRuleState, + Rule: *mut ISpeechGrammarRule, + PropertyName: BSTR, + PropertyId: c_long, + PropertyValue: *mut VARIANT, + Weight: c_float, + ) -> HRESULT, + fn AddSpecialTransition( + DestinationState: *mut ISpeechGrammarRuleState, + Type: SpeechSpecialTransitionType, + PropertyName: BSTR, + PropertyId: c_long, + PropertyValue: *mut VARIANT, + Weight: c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xcafd1db1, 0x41d1, 0x4a06, 0x98, 0x63, 0xe2, 0xe8, 0x1d, 0xa1, 0x7a, 0x9a)] +interface ISpeechGrammarRuleStateTransition(ISpeechGrammarRuleStateTransitionVtbl): + IDispatch(IDispatchVtbl) { + fn get_Type( + Type: *mut SpeechGrammarRuleStateTransitionType, + ) -> HRESULT, + fn get_Text( + Text: *mut BSTR, + ) -> HRESULT, + fn get_Rule( + Rule: *mut *mut ISpeechGrammarRule, + ) -> HRESULT, + fn get_Weight( + Weight: *mut VARIANT, + ) -> HRESULT, + fn get_PropertyName( + PropertyName: *mut BSTR, + ) -> HRESULT, + fn get_PropertyId( + PropertyId: *mut c_long, + ) -> HRESULT, + fn get_PropertyValue( + PropertyValue: *mut VARIANT, + ) -> HRESULT, + fn get_NextState( + NextState: *mut *mut ISpeechGrammarRuleState, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xeabce657, 0x75bc, 0x44a2, 0xaa, 0x7f, 0xc5, 0x64, 0x76, 0x74, 0x29, 0x63)] +interface ISpeechGrammarRuleStateTransitions(ISpeechGrammarRuleStateTransitionsVtbl): + IDispatch(IDispatchVtbl) { + fn get_Count( + Count: *mut c_long, + ) -> HRESULT, + fn Item( + Index: c_long, + Transition: *mut *mut ISpeechGrammarRuleStateTransition, + ) -> HRESULT, + fn get__NewEnum( + EnumVARIANT: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3b9c7e7a, 0x6eee, 0x4ded, 0x90, 0x92, 0x11, 0x65, 0x72, 0x79, 0xad, 0xbe)] +interface ISpeechTextSelectionInformation(ISpeechTextSelectionInformationVtbl): + IDispatch(IDispatchVtbl) { + fn put_ActiveOffset( + ActiveOffset: c_long, + ) -> HRESULT, + fn get_ActiveOffset( + ActiveOffset: *mut c_long, + ) -> HRESULT, + fn put_ActiveLength( + ActiveLength: c_long, + ) -> HRESULT, + fn get_ActiveLength( + ActiveLength: *mut c_long, + ) -> HRESULT, + fn put_SelectionOffset( + SelectionOffset: c_long, + ) -> HRESULT, + fn get_SelectionOffset( + SelectionOffset: *mut c_long, + ) -> HRESULT, + fn put_SelectionLength( + SelectionLength: c_long, + ) -> HRESULT, + fn get_SelectionLength( + SelectionLength: *mut c_long, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xed2879cf, 0xced9, 0x4ee6, 0xa5, 0x34, 0xde, 0x01, 0x91, 0xd5, 0x46, 0x8d)] +interface ISpeechRecoResult(ISpeechRecoResultVtbl): IDispatch(IDispatchVtbl) { + fn get_RecoContext( + RecoContext: *mut *mut ISpeechRecoContext, + ) -> HRESULT, + fn get_Times( + Times: *mut *mut ISpeechRecoResultTimes, + ) -> HRESULT, + fn putref_AudioFormat( + Format: *mut ISpeechAudioFormat, + ) -> HRESULT, + fn get_AudioFormat( + Format: *mut *mut ISpeechAudioFormat, + ) -> HRESULT, + fn get_PhraseInfo( + PhraseInfo: *mut *mut ISpeechPhraseInfo, + ) -> HRESULT, + fn Alternates( + RequestCount: c_long, + StartElement: c_long, + Elements: c_long, + Alternates: *mut *mut ISpeechPhraseAlternates, + ) -> HRESULT, + fn Audio( + StartElement: c_long, + Elements: c_long, + Stream: *mut *mut ISpeechMemoryStream, + ) -> HRESULT, + fn SpeakAudio( + StartElement: c_long, + Elements: c_long, + Flags: SpeechVoiceSpeakFlags, + StreamNumber: *mut c_long, + ) -> HRESULT, + fn SaveToMemory( + ResultBlock: *mut VARIANT, + ) -> HRESULT, + fn DiscardResultInfo( + ValueTypes: SpeechDiscardType, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x62b3b8fb, 0xf6e7, 0x41be, 0xbd, 0xcb, 0x05, 0x6b, 0x1c, 0x29, 0xef, 0xc0)] +interface ISpeechRecoResultTimes(ISpeechRecoResultTimesVtbl): IDispatch(IDispatchVtbl) { + fn get_StreamTime( + Time: *mut VARIANT, + ) -> HRESULT, + fn get_Length( + Length: *mut VARIANT, + ) -> HRESULT, + fn get_TickCount( + TickCount: *mut c_long, + ) -> HRESULT, + fn get_OffsetFromStart( + OffsetFromStart: *mut VARIANT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x27864a2a, 0x2b9f, 0x4cb8, 0x92, 0xd3, 0x0d, 0x27, 0x22, 0xfd, 0x1e, 0x73)] +interface ISpeechPhraseAlternate(ISpeechPhraseAlternateVtbl): IDispatch(IDispatchVtbl) { + fn get_RecoResult( + RecoResult: *mut *mut ISpeechRecoResult, + ) -> HRESULT, + fn get_StartElementInResult( + StartElement: *mut c_long, + ) -> HRESULT, + fn get_NumberOfElementsInResult( + NumberOfElements: *mut c_long, + ) -> HRESULT, + fn get_PhraseInfo( + PhraseInfo: *mut *mut ISpeechPhraseInfo, + ) -> HRESULT, + fn Commit() -> HRESULT, +}} +RIDL!{#[uuid(0xb238b6d5, 0xf276, 0x4c3d, 0xa6, 0xc1, 0x29, 0x74, 0x80, 0x1c, 0x3c, 0xc2)] +interface ISpeechPhraseAlternates(ISpeechPhraseAlternatesVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + Count: *mut c_long, + ) -> HRESULT, + fn Item( + Index: c_long, + PhraseAlternate: *mut *mut ISpeechPhraseAlternate, + ) -> HRESULT, + fn get__NewEnum( + EnumVARIANT: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x961559cf, 0x4e67, 0x4662, 0x8b, 0xf0, 0xd9, 0x3f, 0x1f, 0xcd, 0x61, 0xb3)] +interface ISpeechPhraseInfo(ISpeechPhraseInfoVtbl): IDispatch(IDispatchVtbl) { + fn get_LanguageId( + LanguageId: *mut c_long, + ) -> HRESULT, + fn get_GrammarId( + GrammarId: *mut VARIANT, + ) -> HRESULT, + fn get_StartTime( + StartTime: *mut VARIANT, + ) -> HRESULT, + fn get_AudioStreamPosition( + AudioStreamPosition: *mut VARIANT, + ) -> HRESULT, + fn get_AudioSizeBytes( + pAudioSizeBytes: *mut c_long, + ) -> HRESULT, + fn get_RetainedSizeBytes( + RetainedSizeBytes: *mut c_long, + ) -> HRESULT, + fn get_AudioSizeTime( + AudioSizeTime: *mut c_long, + ) -> HRESULT, + fn get_Rule( + Rule: *mut *mut ISpeechPhraseRule, + ) -> HRESULT, + fn get_Properties( + Properties: *mut *mut ISpeechPhraseProperties, + ) -> HRESULT, + fn get_Elements( + Elements: *mut *mut ISpeechPhraseElements, + ) -> HRESULT, + fn get_Replacements( + Replacements: *mut *mut ISpeechPhraseReplacements, + ) -> HRESULT, + fn get_EngineId( + EngineIdGuid: *mut BSTR, + ) -> HRESULT, + fn get_EnginePrivateData( + PrivateData: *mut VARIANT, + ) -> HRESULT, + fn SaveToMemory( + PhraseBlock: *mut VARIANT, + ) -> HRESULT, + fn GetText( + StartElement: c_long, + Elements: c_long, + UseReplacements: VARIANT_BOOL, + Text: *mut BSTR, + ) -> HRESULT, + fn GetDisplayAttributes( + StartElement: c_long, + Elements: c_long, + UseReplacements: VARIANT_BOOL, + DisplayAttributes: *mut SpeechDisplayAttributes, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xe6176f96, 0xe373, 0x4801, 0xb2, 0x23, 0x3b, 0x62, 0xc0, 0x68, 0xc0, 0xb4)] +interface ISpeechPhraseElement(ISpeechPhraseElementVtbl): IDispatch(IDispatchVtbl) { + fn get_AudioTimeOffset( + AudioTimeOffset: *mut c_long, + ) -> HRESULT, + fn get_AudioSizeTime( + AudioSizeTime: *mut c_long, + ) -> HRESULT, + fn get_AudioStreamOffset( + AudioStreamOffset: *mut c_long, + ) -> HRESULT, + fn get_AudioSizeBytes( + AudioSizeBytes: *mut c_long, + ) -> HRESULT, + fn get_RetainedStreamOffset( + RetainedStreamOffset: *mut c_long, + ) -> HRESULT, + fn get_RetainedSizeBytes( + RetainedSizeBytes: *mut c_long, + ) -> HRESULT, + fn get_DisplayText( + DisplayText: *mut BSTR, + ) -> HRESULT, + fn get_LexicalForm( + LexicalForm: *mut BSTR, + ) -> HRESULT, + fn get_Pronunciation( + Pronunciation: *mut VARIANT, + ) -> HRESULT, + fn get_DisplayAttributes( + DisplayAttributes: *mut SpeechDisplayAttributes, + ) -> HRESULT, + fn get_RequiredConfidence( + RequiredConfidence: *mut SpeechEngineConfidence, + ) -> HRESULT, + fn get_ActualConfidence( + ActualConfidence: *mut SpeechEngineConfidence, + ) -> HRESULT, + fn get_EngineConfidence( + EngineConfident: *mut c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0626b328, 0x3478, 0x467d, 0xa0, 0xb3, 0xd0, 0x85, 0x3b, 0x93, 0xdd, 0xa3)] +interface ISpeechPhraseElements(ISpeechPhraseElementsVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + Count: *mut c_long, + ) -> HRESULT, + fn Item( + Index: c_long, + Element: *mut *mut ISpeechPhraseElement, + ) -> HRESULT, + fn get__NewEnum( + EnumVARIANT: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2890a410, 0x53a7, 0x4fb5, 0x94, 0xec, 0x06, 0xd4, 0x99, 0x8e, 0x3d, 0x02)] +interface ISpeechPhraseReplacement(ISpeechPhraseReplacementVtbl): IDispatch(IDispatchVtbl) { + fn get_DisplayAttributes( + DisplayAttributes: *mut SpeechDisplayAttributes, + ) -> HRESULT, + fn get_Text( + Text: *mut BSTR, + ) -> HRESULT, + fn get_FirstElement( + FirstElement: *mut c_long, + ) -> HRESULT, + fn get_NumberOfElements( + NumberOfElements: *mut c_long, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x38bc662f, 0x2257, 0x4525, 0x95, 0x9e, 0x20, 0x69, 0xd2, 0x59, 0x6c, 0x05)] +interface ISpeechPhraseReplacements(ISpeechPhraseReplacementsVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + Count: *mut c_long, + ) -> HRESULT, + fn Item( + Index: c_long, + Reps: *mut *mut ISpeechPhraseReplacement, + ) -> HRESULT, + fn get__NewEnum( + EnumVARIANT: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xce563d48, 0x961e, 0x4732, 0xa2, 0xe1, 0x37, 0x8a, 0x42, 0xb4, 0x30, 0xbe)] +interface ISpeechPhraseProperty(ISpeechPhrasePropertyVtbl): IDispatch(IDispatchVtbl) { + fn get_Name( + Name: *mut BSTR, + ) -> HRESULT, + fn get_Id( + Id: *mut c_long, + ) -> HRESULT, + fn get_Value( + Value: *mut VARIANT, + ) -> HRESULT, + fn get_FirstElement( + FirstElement: *mut c_long, + ) -> HRESULT, + fn get_NumberOfElements( + NumberOfElements: *mut c_long, + ) -> HRESULT, + fn get_EngineConfidence( + Confidence: *mut c_float, + ) -> HRESULT, + fn get_Confidence( + Confidence: *mut SpeechEngineConfidence, + ) -> HRESULT, + fn get_Parent( + ParentProperty: *mut *mut ISpeechPhraseProperty, + ) -> HRESULT, + fn get_Children( + Children: *mut *mut ISpeechPhraseProperties, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x08166b47, 0x102e, 0x4b23, 0xa5, 0x99, 0xbd, 0xb9, 0x8d, 0xbf, 0xd1, 0xf4)] +interface ISpeechPhraseProperties(ISpeechPhrasePropertiesVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + Count: *mut c_long, + ) -> HRESULT, + fn Item( + Index: c_long, + Property: *mut *mut ISpeechPhraseProperty, + ) -> HRESULT, + fn get__NewEnum( + EnumVARIANT: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa7bfe112, 0xa4a0, 0x48d9, 0xb6, 0x02, 0xc3, 0x13, 0x84, 0x3f, 0x69, 0x64)] +interface ISpeechPhraseRule(ISpeechPhraseRuleVtbl): IDispatch(IDispatchVtbl) { + fn get_Name( + Name: *mut BSTR, + ) -> HRESULT, + fn get_Id( + Id: *mut c_long, + ) -> HRESULT, + fn get_FirstElement( + FirstElement: *mut c_long, + ) -> HRESULT, + fn get_NumberOfElements( + NumberOfElements: *mut c_long, + ) -> HRESULT, + fn get_Parent( + Parent: *mut *mut ISpeechPhraseRule, + ) -> HRESULT, + fn get_Children( + Children: *mut *mut ISpeechPhraseRules, + ) -> HRESULT, + fn get_Confidence( + ActualConfidence: *mut SpeechEngineConfidence, + ) -> HRESULT, + fn get_EngineConfidence( + Confidence: *mut c_float, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9047d593, 0x01dd, 0x4b72, 0x81, 0xa3, 0xe4, 0xa0, 0xca, 0x69, 0xf4, 0x07)] +interface ISpeechPhraseRules(ISpeechPhraseRulesVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + Count: *mut c_long, + ) -> HRESULT, + fn Item( + Index: c_long, + Rule: *mut *mut ISpeechPhraseRule, + ) -> HRESULT, + fn get__NewEnum( + EnumVARIANT: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3da7627a, 0xc7ae, 0x4b23, 0x87, 0x08, 0x63, 0x8c, 0x50, 0x36, 0x2c, 0x25)] +interface ISpeechLexicon(ISpeechLexiconVtbl): IDispatch(IDispatchVtbl) { + fn get_GenerationId( + GenerationId: *mut c_long, + ) -> HRESULT, + fn GetWords( + Flags: SpeechLexiconType, + GenerationID: *mut c_long, + Words: *mut *mut ISpeechLexiconWords, + ) -> HRESULT, + fn AddPronunciation( + bstrWord: BSTR, + LangId: SpeechLanguageId, + PartOfSpeech: SpeechPartOfSpeech, + bstrPronunciation: BSTR, + ) -> HRESULT, + fn AddPronunciationByPhoneIds( + bstrWord: BSTR, + LangId: SpeechLanguageId, + PartOfSpeech: SpeechPartOfSpeech, + PhoneIds: *mut VARIANT, + ) -> HRESULT, + fn RemovePronunciation( + bstrWord: BSTR, + LangId: SpeechLanguageId, + PartOfSpeech: SpeechPartOfSpeech, + bstrPronunciation: BSTR, + ) -> HRESULT, + fn RemovePronunciationByPhoneIds( + bstrWord: BSTR, + LangId: SpeechLanguageId, + PartOfSpeech: SpeechPartOfSpeech, + PhoneIds: *mut VARIANT, + ) -> HRESULT, + fn GetPronunciations( + bstrWord: BSTR, + LangId: SpeechLanguageId, + TypeFlags: SpeechLexiconType, + ppPronunciations: *mut *mut ISpeechLexiconPronunciations, + ) -> HRESULT, + fn GetGenerationChange( + GenerationID: *mut c_long, + ppWords: *mut *mut ISpeechLexiconWords, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8d199862, 0x415e, 0x47d5, 0xac, 0x4f, 0xfa, 0xa6, 0x08, 0xb4, 0x24, 0xe6)] +interface ISpeechLexiconWords(ISpeechLexiconWordsVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + Count: *mut c_long, + ) -> HRESULT, + fn Item( + Index: c_long, + Word: *mut *mut ISpeechLexiconWord, + ) -> HRESULT, + fn get__NewEnum( + EnumVARIANT: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4e5b933c, 0xc9be, 0x48ed, 0x88, 0x42, 0x1e, 0xe5, 0x1b, 0xb1, 0xd4, 0xff)] +interface ISpeechLexiconWord(ISpeechLexiconWordVtbl): IDispatch(IDispatchVtbl) { + fn get_LangId( + LangId: *mut SpeechLanguageId, + ) -> HRESULT, + fn get_Type( + WordType: *mut SpeechWordType, + ) -> HRESULT, + fn get_Word( + Word: *mut BSTR, + ) -> HRESULT, + fn get_Pronunciations( + Pronunciations: *mut *mut ISpeechLexiconPronunciations, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x72829128, 0x5682, 0x4704, 0xa0, 0xd4, 0x3e, 0x2b, 0xb6, 0xf2, 0xea, 0xd3)] +interface ISpeechLexiconPronunciations(ISpeechLexiconPronunciationsVtbl): + IDispatch(IDispatchVtbl) { + fn get_Count( + Count: *mut c_long, + ) -> HRESULT, + fn Item( + Index: c_long, + Pronunciation: *mut *mut ISpeechLexiconPronunciation, + ) -> HRESULT, + fn get__NewEnum( + EnumVARIANT: *mut *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x95252c5d, 0x9e43, 0x4f4a, 0x98, 0x99, 0x48, 0xee, 0x73, 0x35, 0x2f, 0x9f)] +interface ISpeechLexiconPronunciation(ISpeechLexiconPronunciationVtbl): IDispatch(IDispatchVtbl) { + fn get_Type( + LexiconType: *mut SpeechLexiconType, + ) -> HRESULT, + fn get_LangId( + LangId: *mut SpeechLanguageId, + ) -> HRESULT, + fn get_PartOfSpeech( + PartOfSpeech: *mut SpeechPartOfSpeech, + ) -> HRESULT, + fn get_PhoneIds( + PhoneIds: *mut VARIANT, + ) -> HRESULT, + fn get_Symbolic( + Symbolic: *mut BSTR, + ) -> HRESULT, +}} +pub const Speech_Default_Weight: c_float = DEFAULT_WEIGHT; +pub const Speech_Max_Word_Length: LONG = SP_MAX_WORD_LENGTH as i32; +pub const Speech_Max_Pron_Length: LONG = SP_MAX_PRON_LENGTH as i32; +pub const Speech_StreamPos_Asap: LONG = SP_STREAMPOS_ASAP as i32; +pub const Speech_StreamPos_RealTime: LONG = SP_STREAMPOS_REALTIME as i32; +pub const SpeechAllElements: LONG = SPPR_ALL_ELEMENTS as i32; +RIDL!{#[uuid(0x3b151836, 0xdf3a, 0x4e0a, 0x84, 0x6c, 0xd2, 0xad, 0xc9, 0x33, 0x43, 0x33)] +interface ISpeechPhraseInfoBuilder(ISpeechPhraseInfoBuilderVtbl): IDispatch(IDispatchVtbl) { + fn RestorePhraseFromMemory( + PhraseInMemory: *mut VARIANT, + PhraseInfo: *mut *mut ISpeechPhraseInfo, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc3e4f353, 0x433f, 0x43d6, 0x89, 0xa1, 0x6a, 0x62, 0xa7, 0x05, 0x4c, 0x3d)] +interface ISpeechPhoneConverter(ISpeechPhoneConverterVtbl): IDispatch(IDispatchVtbl) { + fn get_LanguageId( + LanguageId: *mut SpeechLanguageId, + ) -> HRESULT, + fn put_LanguageId( + LanguageId: SpeechLanguageId, + ) -> HRESULT, + fn PhoneToId( + Phonemes: BSTR, + IdArray: *mut VARIANT, + ) -> HRESULT, + fn IdToPhone( + IdArray: VARIANT, + Phonemes: *mut BSTR, + ) -> HRESULT, +}} +extern { + pub static CLSID_SpNotifyTranslator: CLSID; + pub static CLSID_SpObjectTokenCategory: CLSID; + pub static CLSID_SpObjectToken: CLSID; + pub static CLSID_SpResourceManager: CLSID; + pub static CLSID_SpStreamFormatConverter: CLSID; + pub static CLSID_SpMMAudioEnum: CLSID; + pub static CLSID_SpMMAudioIn: CLSID; + pub static CLSID_SpMMAudioOut: CLSID; + pub static CLSID_SpStream: CLSID; + pub static CLSID_SpVoice: CLSID; + pub static CLSID_SpSharedRecoContext: CLSID; + pub static CLSID_SpInprocRecognizer: CLSID; + pub static CLSID_SpSharedRecognizer: CLSID; + pub static CLSID_SpLexicon: CLSID; + pub static CLSID_SpUnCompressedLexicon: CLSID; + pub static CLSID_SpCompressedLexicon: CLSID; + pub static CLSID_SpPhoneConverter: CLSID; + pub static CLSID_SpNullPhoneConverter: CLSID; + pub static CLSID_SpTextSelectionInformation: CLSID; + pub static CLSID_SpPhraseInfoBuilder: CLSID; + pub static CLSID_SpAudioFormat: CLSID; + pub static CLSID_SpWaveFormatEx: CLSID; + pub static CLSID_SpInProcRecoContext: CLSID; + pub static CLSID_SpCustomStream: CLSID; + pub static CLSID_SpFileStream: CLSID; + pub static CLSID_SpMemoryStream: CLSID; +} diff --git a/bash-5.1/vendor/winapi/src/um/sapi53.rs b/bash-5.1/vendor/winapi/src/um/sapi53.rs new file mode 100644 index 0000000000000000000000000000000000000000..7121191d87462aefa173fc733c868ff6456fb5aa --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sapi53.rs @@ -0,0 +1,1823 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! SAPI 5.3 definitions +use ctypes::{c_float, c_int, c_long}; +use shared::guiddef::{CLSID, GUID}; +use shared::minwindef::{BOOL, BYTE, DWORD, LPARAM, UINT, ULONG, WORD, WPARAM}; +use shared::wtypes::{BSTR, VARIANT_BOOL}; +use um::oaidl::{IDispatch, IDispatchVtbl, VARIANT}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::urlmon::IInternetSecurityManager; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR, ULONGLONG, WCHAR}; +pub use um::sapi51::{ + SPDATAKEYLOCATION, + SPDKL_DefaultLocation, + SPDKL_CurrentUser, + SPDKL_LocalMachine, + SPDKL_CurrentConfig, + SPDUI_EngineProperties, + SPDUI_AddRemoveWord, + SPDUI_UserTraining, + SPDUI_MicTraining, + SPDUI_RecoProfileProperties, + SPDUI_AudioProperties, + SPDUI_AudioVolume, + SPDUI_UserEnrollment, + SPDUI_ShareData, + SPDUI_Tutorial, + SPSTREAMFORMAT, + SPSF_Default, + SPSF_NoAssignedFormat, + SPSF_Text, + SPSF_NonStandardFormat, + SPSF_ExtendedAudioFormat, + SPSF_8kHz8BitMono, + SPSF_8kHz8BitStereo, + SPSF_8kHz16BitMono, + SPSF_8kHz16BitStereo, + SPSF_11kHz8BitMono, + SPSF_11kHz8BitStereo, + SPSF_11kHz16BitMono, + SPSF_11kHz16BitStereo, + SPSF_12kHz8BitMono, + SPSF_12kHz8BitStereo, + SPSF_12kHz16BitMono, + SPSF_12kHz16BitStereo, + SPSF_16kHz8BitMono, + SPSF_16kHz8BitStereo, + SPSF_16kHz16BitMono, + SPSF_16kHz16BitStereo, + SPSF_22kHz8BitMono, + SPSF_22kHz8BitStereo, + SPSF_22kHz16BitMono, + SPSF_22kHz16BitStereo, + SPSF_24kHz8BitMono, + SPSF_24kHz8BitStereo, + SPSF_24kHz16BitMono, + SPSF_24kHz16BitStereo, + SPSF_32kHz8BitMono, + SPSF_32kHz8BitStereo, + SPSF_32kHz16BitMono, + SPSF_32kHz16BitStereo, + SPSF_44kHz8BitMono, + SPSF_44kHz8BitStereo, + SPSF_44kHz16BitMono, + SPSF_44kHz16BitStereo, + SPSF_48kHz8BitMono, + SPSF_48kHz8BitStereo, + SPSF_48kHz16BitMono, + SPSF_48kHz16BitStereo, + SPSF_TrueSpeech_8kHz1BitMono, + SPSF_CCITT_ALaw_8kHzMono, + SPSF_CCITT_ALaw_8kHzStereo, + SPSF_CCITT_ALaw_11kHzMono, + SPSF_CCITT_ALaw_11kHzStereo, + SPSF_CCITT_ALaw_22kHzMono, + SPSF_CCITT_ALaw_22kHzStereo, + SPSF_CCITT_ALaw_44kHzMono, + SPSF_CCITT_ALaw_44kHzStereo, + SPSF_CCITT_uLaw_8kHzMono, + SPSF_CCITT_uLaw_8kHzStereo, + SPSF_CCITT_uLaw_11kHzMono, + SPSF_CCITT_uLaw_11kHzStereo, + SPSF_CCITT_uLaw_22kHzMono, + SPSF_CCITT_uLaw_22kHzStereo, + SPSF_CCITT_uLaw_44kHzMono, + SPSF_CCITT_uLaw_44kHzStereo, + SPSF_ADPCM_8kHzMono, + SPSF_ADPCM_8kHzStereo, + SPSF_ADPCM_11kHzMono, + SPSF_ADPCM_11kHzStereo, + SPSF_ADPCM_22kHzMono, + SPSF_ADPCM_22kHzStereo, + SPSF_ADPCM_44kHzMono, + SPSF_ADPCM_44kHzStereo, + SPSF_GSM610_8kHzMono, + SPSF_GSM610_11kHzMono, + SPSF_GSM610_22kHzMono, + SPSF_GSM610_44kHzMono, + SPSF_NUM_FORMATS, + SPDFID_Text, + SPDFID_WaveFormatEx, + SPREG_USER_ROOT, + SPREG_LOCAL_MACHINE_ROOT, + SPCAT_AUDIOOUT, + SPCAT_AUDIOIN, + SPCAT_VOICES, + SPCAT_RECOGNIZERS, + SPCAT_APPLEXICONS, + SPCAT_PHONECONVERTERS, + SPCAT_TEXTNORMALIZERS, + SPCAT_RECOPROFILES, + SPMMSYS_AUDIO_IN_TOKEN_ID, + SPMMSYS_AUDIO_OUT_TOKEN_ID, + SPCURRENT_USER_LEXICON_TOKEN_ID, + SPTOKENVALUE_CLSID, + SPTOKENKEY_FILES, + SPTOKENKEY_UI, + SPTOKENKEY_ATTRIBUTES +}; +pub const SPTOKENKEY_RETAINEDAUDIO: &'static str = "SecondsPerRetainedAudioEvent"; +pub const SPTOKENKEY_AUDIO_LATENCY_WARNING: &'static str = "LatencyWarningThreshold"; +pub const SPTOKENKEY_AUDIO_LATENCY_TRUNCATE: &'static str = "LatencyTruncateThreshold"; +pub const SPTOKENKEY_AUDIO_LATENCY_UPDATE_INTERVAL: &'static str = "LatencyUpdateInterval"; +pub use um::sapi51::{ + SPVOICECATEGORY_TTSRATE, + SPPROP_RESOURCE_USAGE, + SPPROP_HIGH_CONFIDENCE_THRESHOLD, + SPPROP_NORMAL_CONFIDENCE_THRESHOLD, + SPPROP_LOW_CONFIDENCE_THRESHOLD, + SPPROP_RESPONSE_SPEED, + SPPROP_COMPLEX_RESPONSE_SPEED, + SPPROP_ADAPTATION_ON, + SPPROP_PERSISTED_BACKGROUND_ADAPTATION, + SPPROP_PERSISTED_LANGUAGE_MODEL_ADAPTATION, + SPPROP_UX_IS_LISTENING, + SPTOPIC_SPELLING, + SPWILDCARD, + SPDICTATION +}; +pub const SPREG_SAFE_USER_TOKENS: &'static str + = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\UserTokens"; +pub use um::sapi51::{ + SPINFDICTATION, + SP_LOW_CONFIDENCE, + SP_NORMAL_CONFIDENCE, + SP_HIGH_CONFIDENCE, + DEFAULT_WEIGHT, + SP_MAX_WORD_LENGTH, + SP_MAX_PRON_LENGTH +}; +pub const SP_EMULATE_RESULT: ULONG = 0x40000000; +pub use um::sapi51::{ + ISpNotifyCallback, + SPNOTIFYCALLBACK, + ISpNotifySource, ISpNotifySourceVtbl, + ISpNotifySink, ISpNotifySinkVtbl, + ISpNotifyTranslator, ISpNotifyTranslatorVtbl, + ISpDataKey, ISpDataKeyVtbl, + ISpRegDataKey, ISpRegDataKeyVtbl, + ISpObjectTokenCategory, ISpObjectTokenCategoryVtbl, + ISpObjectToken, ISpObjectTokenVtbl, + ISpObjectTokenInit, ISpObjectTokenInitVtbl, + IEnumSpObjectTokens, IEnumSpObjectTokensVtbl, + ISpObjectWithToken, ISpObjectWithTokenVtbl, + ISpResourceManager, ISpResourceManagerVtbl, + SPEVENTLPARAMTYPE, + SPET_LPARAM_IS_UNDEFINED, + SPET_LPARAM_IS_TOKEN, + SPET_LPARAM_IS_OBJECT, + SPET_LPARAM_IS_POINTER, + SPET_LPARAM_IS_STRING, + SPEVENTENUM, + SPEI_UNDEFINED, + SPEI_START_INPUT_STREAM, + SPEI_END_INPUT_STREAM, + SPEI_VOICE_CHANGE, + SPEI_TTS_BOOKMARK, + SPEI_WORD_BOUNDARY, + SPEI_PHONEME, + SPEI_SENTENCE_BOUNDARY, + SPEI_VISEME, + SPEI_TTS_AUDIO_LEVEL, + SPEI_TTS_PRIVATE, + SPEI_MIN_TTS, + SPEI_MAX_TTS, + SPEI_END_SR_STREAM, + SPEI_SOUND_START, + SPEI_SOUND_END, + SPEI_PHRASE_START, + SPEI_RECOGNITION, + SPEI_HYPOTHESIS, + SPEI_SR_BOOKMARK, + SPEI_PROPERTY_NUM_CHANGE, + SPEI_PROPERTY_STRING_CHANGE, + SPEI_FALSE_RECOGNITION, + SPEI_INTERFERENCE, + SPEI_REQUEST_UI, + SPEI_RECO_STATE_CHANGE, + SPEI_ADAPTATION, + SPEI_START_SR_STREAM, + SPEI_RECO_OTHER_CONTEXT, + SPEI_SR_AUDIO_LEVEL +}; +pub const SPEI_SR_RETAINEDAUDIO: SPEVENTENUM = 51; +pub use um::sapi51::SPEI_SR_PRIVATE; +pub const SPEI_RESERVED4: SPEVENTENUM = 53; +pub const SPEI_RESERVED5: SPEVENTENUM = 54; +pub const SPEI_RESERVED6: SPEVENTENUM = 55; +pub use um::sapi51::SPEI_MIN_SR; +pub const SPEI_MAX_SR: SPEVENTENUM = 55; +pub use um::sapi51::{ + SPEI_RESERVED1, + SPEI_RESERVED2, + SPEI_RESERVED3, + SPFEI_FLAGCHECK, + SPFEI_ALL_TTS_EVENTS, + SPFEI_ALL_SR_EVENTS, + SPFEI_ALL_EVENTS, + SPFEI, + SPEVENT, + SPSERIALIZEDEVENT, + SPSERIALIZEDEVENT64 +}; +STRUCT!{struct SPEVENTEX { + eEventId: WORD, + elParamType: WORD, + ulStreamNum: ULONG, + ullAudioStreamOffset: ULONGLONG, + wParam: WPARAM, + lParam: LPARAM, + ullAudioTimeOffset: ULONGLONG, +}} +pub use um::sapi51::{ + SPINTERFERENCE, + SPINTERFERENCE_NONE, + SPINTERFERENCE_NOISE, + SPINTERFERENCE_NOSIGNAL, + SPINTERFERENCE_TOOLOUD, + SPINTERFERENCE_TOOQUIET, + SPINTERFERENCE_TOOFAST, + SPINTERFERENCE_TOOSLOW, + SPINTERFERENCE_LATENCY_WARNING, + SPINTERFERENCE_LATENCY_TRUNCATE_BEGIN, + SPINTERFERENCE_LATENCY_TRUNCATE_END, + SPENDSRSTREAMFLAGS, + SPESF_NONE, + SPESF_STREAM_RELEASED +}; +pub const SPESF_EMULATED: SPENDSRSTREAMFLAGS = 1 << 1; +pub use um::sapi51::{ + SPVFEATURE, + SPVFEATURE_STRESSED, + SPVFEATURE_EMPHASIS, + SPVISEMES, + SP_VISEME_0, + SP_VISEME_1, + SP_VISEME_2, + SP_VISEME_3, + SP_VISEME_4, + SP_VISEME_5, + SP_VISEME_6, + SP_VISEME_7, + SP_VISEME_8, + SP_VISEME_9, + SP_VISEME_10, + SP_VISEME_11, + SP_VISEME_12, + SP_VISEME_13, + SP_VISEME_14, + SP_VISEME_15, + SP_VISEME_16, + SP_VISEME_17, + SP_VISEME_18, + SP_VISEME_19, + SP_VISEME_20, + SP_VISEME_21, + SPEVENTSOURCEINFO, + ISpEventSource, ISpEventSourceVtbl, +}; +RIDL!{#[uuid(0x2373a435, 0x6a4b, 0x429e, 0xa6, 0xac, 0xd4, 0x23, 0x1a, 0x61, 0x97, 0x5b)] +interface ISpEventSource2(ISpEventSource2Vtbl): ISpEventSource(ISpEventSourceVtbl) { + fn GetEventsEx( + ulCount: ULONG, + pEventArray: *mut SPEVENTEX, + pulFetched: *mut ULONG, + ) -> HRESULT, +}} +pub use um::sapi51::{ + ISpEventSink, ISpEventSinkVtbl, + ISpStreamFormat, ISpStreamFormatVtbl, + SPFILEMODE, + SPFM_OPEN_READONLY, + SPFM_OPEN_READWRITE, + SPFM_CREATE, + SPFM_CREATE_ALWAYS, + SPFM_NUM_MODES, + ISpStream, ISpStreamVtbl, + ISpStreamFormatConverter, ISpStreamFormatConverterVtbl, + SPAUDIOSTATE, + SPAS_CLOSED, + SPAS_STOP, + SPAS_PAUSE, + SPAS_RUN, + SPAUDIOSTATUS, + SPAUDIOBUFFERINFO, + ISpAudio, ISpAudioVtbl, + ISpMMSysAudio, ISpMMSysAudioVtbl, + ISpTranscript, ISpTranscriptVtbl, + SPDISPLAYATTRIBUTES, + SPAF_ONE_TRAILING_SPACE, + SPAF_TWO_TRAILING_SPACES, + SPAF_CONSUME_LEADING_SPACES +}; +pub const SPAF_BUFFER_POSITION: SPDISPLAYATTRIBUTES = 0x10; +pub const SPAF_ALL: SPDISPLAYATTRIBUTES = 0x1f; +pub const SPAF_USER_SPECIFIED: SPDISPLAYATTRIBUTES = 0x80; +pub use um::sapi51::{ + SPPHONEID, + PSPPHONEID, + PCSPPHONEID, + SPPHRASEELEMENT, + SPPHRASERULE, + SPPHRASEPROPERTYUNIONTYPE, + SPPPUT_UNUSED, + SPPPUT_ARRAY_INDEX, + SPPHRASEPROPERTY, + SPPHRASEREPLACEMENT +}; +STRUCT!{struct SPSEMANTICERRORINFO { + ulLineNumber: ULONG, + pszScriptLine: LPWSTR, + pszSource: LPWSTR, + pszDescription: LPWSTR, + hrResultCode: HRESULT, +}} +ENUM!{enum SPSEMANTICFORMAT { + SPSMF_SAPI_PROPERTIES = 0, + SPSMF_SRGS_SEMANTICINTERPRETATION_MS = 1, + SPSMF_SRGS_SAPIPROPERTIES = 2, + SPSMF_UPS = 4, + SPSMF_SRGS_SEMANTICINTERPRETATION_W3C = 8, +}} +pub use um::sapi51::SPPHRASE as SPPHRASE_50; +// TODO: pub const SP_SPPHRASESIZE_500: usize = mem::size_of::(); +STRUCT!{struct SPPHRASE { + cbSize: ULONG, + LangID: WORD, + wHomophoneGroupId: WORD, + ullGrammarID: ULONGLONG, + ftStartTime: ULONGLONG, + ullAudioStreamPosition: ULONGLONG, + ulAudioSizeBytes: ULONG, + ulRetainedSizeBytes: ULONG, + ulAudioSizeTime: ULONG, + Rule: SPPHRASERULE, + pProperties: *const SPPHRASEPROPERTY, + pElements: *const SPPHRASEELEMENT, + cReplacements: ULONG, + pReplacements: *const SPPHRASEREPLACEMENT, + SREngineID: GUID, + ulSREnginePrivateDataSize: ULONG, + pSREnginePrivateData: *const BYTE, + pSML: LPWSTR, + pSemanticErrorInfo: *mut SPSEMANTICERRORINFO, +}} +pub use um::sapi51::SPSERIALIZEDPHRASE; +STRUCT!{struct SPRULE { + pszRuleName: LPCWSTR, + ulRuleId: ULONG, + dwAttributes: DWORD, +}} +pub use um::sapi51::{ + SPVALUETYPE, + SPDF_PROPERTY, + SPDF_REPLACEMENT, + SPDF_RULE, + SPDF_DISPLAYTEXT, + SPDF_LEXICALFORM , + SPDF_PRONUNCIATION, + SPDF_AUDIO, + SPDF_ALTERNATES, + SPDF_ALL, + SPBINARYGRAMMAR, + SPPHRASERNG, + SPPR_ALL_ELEMENTS, + SP_GETWHOLEPHRASE, + SPRR_ALL_ELEMENTS, + SPSTATEHANDLE, + SPRECOEVENTFLAGS, + SPREF_AutoPause, + SPREF_Emulated +}; +pub const SPREF_SMLTimeout: SPRECOEVENTFLAGS = 1 << 2; +pub const SPREF_ExtendableParse: SPRECOEVENTFLAGS = 1 << 3; +pub const SPREF_ReSent: SPRECOEVENTFLAGS = 1 << 4; +pub const SPREF_Hypothesis: SPRECOEVENTFLAGS = 1 << 5; +pub const SPREF_FalseRecognition: SPRECOEVENTFLAGS = 1 << 6; +pub use um::sapi51::{ + SPPARTOFSPEECH, + SPPS_NotOverriden, + SPPS_Unknown, + SPPS_Noun, + SPPS_Verb, + SPPS_Modifier, + SPPS_Function, + SPPS_Interjection +}; +pub const SPPS_Noncontent: SPPARTOFSPEECH = 0x6000; +pub const SPPS_LMA: SPPARTOFSPEECH = 0x7000; +pub const SPPS_SuppressWord: SPPARTOFSPEECH = 0xf000; +pub use um::sapi51::{ + SPLEXICONTYPE, + eLEXTYPE_USER, + eLEXTYPE_APP, + eLEXTYPE_VENDORLEXICON, + eLEXTYPE_LETTERTOSOUND, + eLEXTYPE_MORPHOLOGY, + eLEXTYPE_RESERVED4, + eLEXTYPE_USER_SHORTCUT, + eLEXTYPE_RESERVED6, + eLEXTYPE_RESERVED7, + eLEXTYPE_RESERVED8, + eLEXTYPE_RESERVED9, + eLEXTYPE_RESERVED10, + eLEXTYPE_PRIVATE1, + eLEXTYPE_PRIVATE2, + eLEXTYPE_PRIVATE3, + eLEXTYPE_PRIVATE4, + eLEXTYPE_PRIVATE5, + eLEXTYPE_PRIVATE6, + eLEXTYPE_PRIVATE7, + eLEXTYPE_PRIVATE8, + eLEXTYPE_PRIVATE9, + eLEXTYPE_PRIVATE10, + eLEXTYPE_PRIVATE11, + eLEXTYPE_PRIVATE12, + eLEXTYPE_PRIVATE13, + eLEXTYPE_PRIVATE14, + eLEXTYPE_PRIVATE15, + eLEXTYPE_PRIVATE16, + eLEXTYPE_PRIVATE17, + eLEXTYPE_PRIVATE18, + eLEXTYPE_PRIVATE19, + eLEXTYPE_PRIVATE20, + SPWORDTYPE, + eWORDTYPE_ADDED, + eWORDTYPE_DELETED +}; +ENUM!{enum SPPRONUNCIATIONFLAGS { + ePRONFLAG_USED = 1 << 0, +}} +pub use um::sapi51::{ + SPWORDPRONUNCIATION, + SPWORDPRONUNCIATIONLIST, + SPWORD, + SPWORDLIST, + ISpLexicon, ISpLexiconVtbl, + ISpContainerLexicon, ISpContainerLexiconVtbl, +}; +ENUM!{enum SPSHORTCUTTYPE { + SPSHT_NotOverriden = -1i32 as u32, + SPSHT_Unknown = 0, + SPSHT_EMAIL = 0x1000, + SPSHT_OTHER = 0x2000, + SPPS_RESERVED1 = 0x3000, + SPPS_RESERVED2 = 0x4000, + SPPS_RESERVED3 = 0x5000, + SPPS_RESERVED4 = 0xf000, +}} +STRUCT!{struct SPSHORTCUTPAIR { + pNextSHORTCUTPAIR: *mut SPSHORTCUTPAIR, + LangID: WORD, + shType: SPSHORTCUTTYPE, + pszDisplay: LPWSTR, + pszSpoken: LPWSTR, +}} +STRUCT!{struct SPSHORTCUTPAIRLIST { + ulSize: ULONG, + pvBuffer: *mut BYTE, + pFirstShortcutPair: *mut SPSHORTCUTPAIR, +}} +RIDL!{#[uuid(0x3df681e2, 0xea56, 0x11d9, 0x8b, 0xde, 0xf6, 0x6b, 0xad, 0x1e, 0x3f, 0x3a)] +interface ISpShortcut(ISpShortcutVtbl): IUnknown(IUnknownVtbl) { + fn AddShortcut( + pszDisplay: LPCWSTR, + LangID: WORD, + pszSpoken: LPCWSTR, + shType: SPSHORTCUTTYPE, + ) -> HRESULT, + fn RemoveShortcut( + pszDisplay: LPCWSTR, + LangID: WORD, + pszSpoken: LPCWSTR, + shType: SPSHORTCUTTYPE, + ) -> HRESULT, + fn GetShortcuts( + LangId: WORD, + pShortcutpairList: *mut SPSHORTCUTPAIRLIST, + ) -> HRESULT, + fn GetGeneration( + pdwGeneration: *mut DWORD, + ) -> HRESULT, + fn GetWordsFromGenerationChange( + pdwGeneration: *mut DWORD, + pWordList: *mut SPWORDLIST, + ) -> HRESULT, + fn GetWords( + pdwGeneration: *mut DWORD, + pdwCookie: *mut DWORD, + pWordList: *mut SPWORDLIST, + ) -> HRESULT, + fn GetShortcutsForGeneration( + pdwGeneration: *mut DWORD, + pdwCookie: *mut DWORD, + pShortcutpairList: *mut SPSHORTCUTPAIRLIST, + ) -> HRESULT, + fn GetGenerationChange( + pdwGeneration: *mut DWORD, + pShortcutpairList: *mut SPSHORTCUTPAIRLIST, + ) -> HRESULT, +}} +pub use um::sapi51::{ISpPhoneConverter, ISpPhoneConverterVtbl}; +RIDL!{#[uuid(0x133adcd4, 0x19b4, 0x4020, 0x9f, 0xdc, 0x84, 0x2e, 0x78, 0x25, 0x3b, 0x17)] +interface ISpPhoneticAlphabetConverter(ISpPhoneticAlphabetConverterVtbl): IUnknown(IUnknownVtbl) { + fn GetLangId( + pLangID: *mut WORD, + ) -> HRESULT, + fn SetLangId( + LangID: WORD, + ) -> HRESULT, + fn SAPI2UPS( + pszSAPIId: *const SPPHONEID, + pszUPSId: *mut SPPHONEID, + cMaxLength: DWORD, + ) -> HRESULT, + fn UPS2SAPI( + pszUPSId: *const SPPHONEID, + pszSAPIId: *mut SPPHONEID, + cMaxLength: DWORD, + ) -> HRESULT, + fn GetMaxConvertLength( + cSrcLength: DWORD, + bSAPI2UPS: BOOL, + pcMaxDestLength: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb2745efd, 0x42ce, 0x48ca, 0x81, 0xf1, 0xa9, 0x6e, 0x02, 0x53, 0x8a, 0x90)] +interface ISpPhoneticAlphabetSelection(ISpPhoneticAlphabetSelectionVtbl): IUnknown(IUnknownVtbl) { + fn IsAlphabetUPS( + pfIsUPS: *mut BOOL, + ) -> HRESULT, + fn SetAlphabetToUPS( + fForceUPS: BOOL, + ) -> HRESULT, +}} +pub use um::sapi51::{ + SPVPITCH, + SPVACTIONS, + SPVA_Speak, + SPVA_Silence, + SPVA_Pronounce, + SPVA_Bookmark, + SPVA_SpellOut, + SPVA_Section, + SPVA_ParseUnknownTag, + SPVCONTEXT, + SPVSTATE, + SPRUNSTATE, + SPRS_DONE, + SPRS_IS_SPEAKING, + SPVLIMITS, + SPMIN_VOLUME, + SPMAX_VOLUME, + SPMIN_RATE, + SPMAX_RATE, + SPVPRIORITY, + SPVPRI_NORMAL, + SPVPRI_ALERT, + SPVPRI_OVER, + SPVOICESTATUS, + SPEAKFLAGS, + SPF_DEFAULT, + SPF_ASYNC, + SPF_PURGEBEFORESPEAK, + SPF_IS_FILENAME, + SPF_IS_XML, + SPF_IS_NOT_XML, + SPF_PERSIST_XML, + SPF_NLP_SPEAK_PUNC, +}; +pub const SPF_PARSE_SAPI: SPEAKFLAGS = 1 << 7; +pub const SPF_PARSE_SSML: SPEAKFLAGS = 1 << 8; +pub const SPF_PARSE_AUTODETECT: SPEAKFLAGS = 0; +pub use um::sapi51::SPF_NLP_MASK; +pub const SPF_PARSE_MASK: SPEAKFLAGS = SPF_PARSE_SAPI | SPF_PARSE_SSML; +pub const SPF_VOICE_MASK: SPEAKFLAGS = ::um::sapi51::SPF_VOICE_MASK | SPF_PARSE_MASK; +pub const SPF_UNUSED_FLAGS: SPEAKFLAGS = !SPF_VOICE_MASK; +pub use um::sapi51::{ + ISpVoice, ISpVoiceVtbl, + ISpPhrase, ISpPhraseVtbl, + ISpPhraseAlt, ISpPhraseAltVtbl, +}; +ENUM!{enum SPXMLRESULTOPTIONS { + SPXRO_SML = 0, + SPXRO_Alternates_SML = 1, +}} +RIDL!{#[uuid(0xf264da52, 0xe457, 0x4696, 0xb8, 0x56, 0xa7, 0x37, 0xb7, 0x17, 0xaf, 0x79)] +interface ISpPhrase2(ISpPhrase2Vtbl): ISpPhrase(ISpPhraseVtbl) { + fn GetXMLResult( + ppszCoMemXMLResult: *mut LPWSTR, + Options: SPXMLRESULTOPTIONS, + ) -> HRESULT, + fn GetXMLErrorInfo( + pSemanticErrorInfo: *mut SPSEMANTICERRORINFO, + ) -> HRESULT, + fn GetAudio( + ulStartElement: ULONG, + cElements: ULONG, + ppStream: *mut *mut ISpStreamFormat, + ) -> HRESULT, +}} +pub use um::sapi51::{ + SPRECORESULTTIMES, + SPSERIALIZEDRESULT, + ISpRecoResult, ISpRecoResultVtbl, +}; +ENUM!{enum SPCOMMITFLAGS { + SPCF_NONE = 0, + SPCF_ADD_TO_USER_LEXICON = 1 << 0, + SPCF_DEFINITE_CORRECTION = 1 << 1, +}} +RIDL!{#[uuid(0x27cac6c4, 0x88f2, 0x41f2, 0x88, 0x17, 0x0c, 0x95, 0xe5, 0x9f, 0x1e, 0x6e)] +interface ISpRecoResult2(ISpRecoResult2Vtbl): ISpRecoResult(ISpRecoResultVtbl) { + fn CommitAlternate( + pPhraseAlt: *mut ISpPhraseAlt, + ppNewResult: *mut *mut ISpRecoResult, + ) -> HRESULT, + fn CommitText( + ulStartElement: ULONG, + cElements: ULONG, + pszCorrectedData: LPCWSTR, + eCommitFlags: DWORD, + ) -> HRESULT, + fn SetTextFeedback( + pszFeedback: LPCWSTR, + fSuccessful: BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xae39362b, 0x45a8, 0x4074, 0x9b, 0x9e, 0xcc, 0xf4, 0x9a, 0xa2, 0xd0, 0xb6)] +interface ISpXMLRecoResult(ISpXMLRecoResultVtbl): ISpRecoResult(ISpRecoResultVtbl) { + fn GetXMLResult( + ppszCoMemXMLResult: *mut LPWSTR, + Options: SPXMLRESULTOPTIONS, + ) -> HRESULT, + fn GetXMLErrorInfo( + pSemanticErrorInfo: *mut SPSEMANTICERRORINFO, + ) -> HRESULT, +}} +pub use um::sapi51::{ + SPTEXTSELECTIONINFO, + SPWORDPRONOUNCEABLE, + SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE, + SPWP_UNKNOWN_WORD_PRONOUNCEABLE, + SPWP_KNOWN_WORD_PRONOUNCEABLE, + SPGRAMMARSTATE, + SPGS_DISABLED, + SPGS_ENABLED, + SPGS_EXCLUSIVE, + SPCONTEXTSTATE, + SPCS_DISABLED, + SPCS_ENABLED, + SPRULESTATE, + SPRS_INACTIVE, + SPRS_ACTIVE, + SPRS_ACTIVE_WITH_AUTO_PAUSE, +}; +pub const SPRS_ACTIVE_USER_DELIMITED: SPRULESTATE = 4; +pub use um::sapi51::{ + SP_STREAMPOS_ASAP, + SP_STREAMPOS_REALTIME, + SPRULETRANS_TEXTBUFFER, + SPRULETRANS_WILDCARD, + SPRULETRANS_DICTATION, + SPGRAMMARWORDTYPE, + SPWT_DISPLAY, + SPWT_LEXICAL, + SPWT_PRONUNCIATION, +}; +pub const SPWT_LEXICAL_NO_SPECIAL_CHARS: SPGRAMMARWORDTYPE = SPWT_PRONUNCIATION + 1; +pub use um::sapi51::{ + SPPROPERTYINFO, + SPCFGRULEATTRIBUTES, + SPRAF_TopLevel, + SPRAF_Active, + SPRAF_Export, + SPRAF_Import, + SPRAF_Interpreter, + SPRAF_Dynamic, +}; +pub const SPRAF_Root: SPCFGRULEATTRIBUTES = 1 << 6; +pub use um::sapi51::SPRAF_AutoPause; +pub const SPRAF_UserDelimited: SPCFGRULEATTRIBUTES = 1 << 17; +pub use um::sapi51::{ + ISpGrammarBuilder, ISpGrammarBuilderVtbl, + SPLOADOPTIONS, + SPLO_STATIC, + SPLO_DYNAMIC, + ISpRecoGrammar, ISpRecoGrammarVtbl, +}; +ENUM!{enum SPMATCHINGMODE { + AllWords = 0, + Subsequence = 1, + OrderedSubset = 3, + SubsequenceContentRequired = 5, + OrderedSubsetContentRequired = 7, +}} +ENUM!{enum PHONETICALPHABET { + PA_Ipa = 0, + PA_Ups = 1, + PA_Sapi = 2, +}} +RIDL!{#[uuid(0x8ab10026, 0x20cc, 0x4b20, 0x8c, 0x22, 0xa4, 0x9c, 0x9b, 0xa7, 0x8f, 0x60)] +interface ISpGrammarBuilder2(ISpGrammarBuilder2Vtbl): IUnknown(IUnknownVtbl) { + fn AddTextSubset( + hFromState: SPSTATEHANDLE, + hToState: SPSTATEHANDLE, + psz: LPCWSTR, + eMatchMode: SPMATCHINGMODE, + ) -> HRESULT, + fn SetPhoneticAlphabet( + phoneticALphabet: PHONETICALPHABET, + ) -> HRESULT, +}} +pub const SPRP_NORMAL: i32 = 0; // TODO: Unknown purpose and type +RIDL!{#[uuid(0x4b37bc9e, 0x9ed6, 0x44a3, 0x93, 0xd3, 0x18, 0xf0, 0x22, 0xb7, 0x9e, 0xc3)] +interface ISpRecoGrammar2(ISpRecoGrammar2Vtbl): IUnknown(IUnknownVtbl) { + fn GetRules( + ppCoMemRules: *mut *mut SPRULE, + puNumRules: *mut UINT, + ) -> HRESULT, + fn LoadCmdFromFile2( + pszFileName: LPCWSTR, + Options: SPLOADOPTIONS, + pszSharingUri: LPCWSTR, + pszBaseUri: LPCWSTR, + ) -> HRESULT, + fn LoadCmdFromMemory2( + pGrammar: *const SPBINARYGRAMMAR, + Options: SPLOADOPTIONS, + pszSharingUri: LPCWSTR, + pszBaseUri: LPCWSTR, + ) -> HRESULT, + fn SetRulePriority( + pszRuleName: LPCWSTR, + ulRuleId: ULONG, + nRulePriority: c_int, + ) -> HRESULT, + fn SetRuleWeight( + pszRuleName: LPCWSTR, + ulRuleId: ULONG, + flWeight: c_float, + ) -> HRESULT, + fn SetDictationWeight( + flWeight: c_float, + ) -> HRESULT, + fn SetGrammarLoader( + pLoader: *mut ISpeechResourceLoader, + ) -> HRESULT, + fn SetSMLSecurityManager( + pSMLSecurityManager: *mut IInternetSecurityManager, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb9ac5783, 0xfcd0, 0x4b21, 0xb1, 0x19, 0xb4, 0xf8, 0xda, 0x8f, 0xd2, 0xc3)] +interface ISpeechResourceLoader(ISpeechResourceLoaderVtbl): IDispatch(IDispatchVtbl) { + fn LoadResource( + bstrResourceUri: BSTR, + fAlwaysReload: VARIANT_BOOL, + pStream: *mut *mut IUnknown, + pbstrMIMEType: *mut BSTR, + pfModified: *mut VARIANT_BOOL, + pbstrRedirectUrl: *mut BSTR, + ) -> HRESULT, + fn GetLocalCopy( + bstrResourceUri: BSTR, + pbstrLocalPath: *mut BSTR, + pbstrMIMEType: *mut BSTR, + pbstrRedirectUrl: *mut BSTR, + ) -> HRESULT, + fn ReleaseLocalCopy( + pbstrLocalPath: BSTR, + ) -> HRESULT, +}} +pub use um::sapi51::{ + SPRECOCONTEXTSTATUS, + SPBOOKMARKOPTIONS, + SPBO_NONE, + SPBO_PAUSE, +}; +pub const SPBO_AHEAD: SPBOOKMARKOPTIONS = 1 << 1; +pub const SPBO_TIME_UNITS: SPBOOKMARKOPTIONS = 1 << 2; +pub use um::sapi51::{ + SPAUDIOOPTIONS, + SPAO_NONE, + SPAO_RETAIN_AUDIO, + ISpRecoContext, ISpRecoContextVtbl, +}; +ENUM!{enum SPGRAMMAROPTIONS { + SPGO_SAPI = 0x1, + SPGO_SRGS = 0x2, + SPGO_UPS = 0x4, + SPGO_SRGS_MS_SCRIPT = 0x8, + SPGO_SRGS_W3C_SCRIPT = 0x100, + SPGO_SRGS_STG_SCRIPT = 0x200, + SPGO_SRGS_SCRIPT = SPGO_SRGS | SPGO_SRGS_MS_SCRIPT + | SPGO_SRGS_W3C_SCRIPT | SPGO_SRGS_STG_SCRIPT, + SPGO_FILE = 0x10, + SPGO_HTTP = 0x20, + SPGO_RES = 0x40, + SPGO_OBJECT = 0x80, + SPGO_DEFAULT = 0x3fb, + SPGO_ALL = 0x3ff, +}} +ENUM!{enum SPADAPTATIONSETTINGS { + SPADS_Default = 0, + SPADS_CurrentRecognizer = 0x1, + SPADS_RecoProfile = 0x2, + SPADS_Immediate = 0x4, + SPADS_Reset = 0x8, + SPADS_HighVolumeDataSource = 0x10, +}} +ENUM!{enum SPADAPTATIONRELEVANCE { + SPAR_Unknown = 0, + SPAR_Low = 1, + SPAR_Medium = 2, + SPAR_High = 3, +}} +RIDL!{#[uuid(0xbead311c, 0x52ff, 0x437f, 0x94, 0x64, 0x6b, 0x21, 0x05, 0x4c, 0xa7, 0x3d)] +interface ISpRecoContext2(ISpRecoContext2Vtbl): IUnknown(IUnknownVtbl) { + fn SetGrammarOptions( + eGrammarOptions: DWORD, + ) -> HRESULT, + fn GetGrammarOptions( + peGrammarOptions: *mut DWORD, + ) -> HRESULT, + fn SetAdaptationData2( + pAdaptationData: LPCWSTR, + cch: ULONG, + pTopicName: LPCWSTR, + eAdaptationSettings: DWORD, + eRelevance: SPADAPTATIONRELEVANCE, + ) -> HRESULT, +}} +pub use um::sapi51::{ + ISpProperties, ISpPropertiesVtbl, + SP_MAX_LANGIDS, + SPRECOGNIZERSTATUS, + SPWAVEFORMATTYPE, + SPWF_INPUT, + SPWF_SRENGINE, + SPSTREAMFORMATTYPE, + SPRECOSTATE, + SPRST_INACTIVE, + SPRST_ACTIVE, + SPRST_ACTIVE_ALWAYS, + SPRST_INACTIVE_WITH_PURGE, + SPRST_NUM_STATES, + ISpRecognizer, ISpRecognizerVtbl, +}; +RIDL!{#[uuid(0x21b501a0, 0x0ec7, 0x46c9, 0x92, 0xc3, 0xa2, 0xbc, 0x78, 0x4c, 0x54, 0xb9)] +interface ISpSerializeState(ISpSerializeStateVtbl): IUnknown(IUnknownVtbl) { + fn GetSerializedState( + ppbData: *mut *mut BYTE, + pulSize: *mut ULONG, + dwReserved: DWORD, + ) -> HRESULT, + fn SetSerializedState( + pbData: *mut BYTE, + ulSize: ULONG, + dwReserved: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8fc6d974, 0xc81e, 0x4098, 0x93, 0xc5, 0x01, 0x47, 0xf6, 0x1e, 0xd4, 0xd3)] +interface ISpRecognizer2(ISpRecognizer2Vtbl): IUnknown(IUnknownVtbl) { + fn EmulateRecognitionEx( + pPhrase: *mut ISpPhrase, + dwCompareFlags: DWORD, + ) -> HRESULT, + fn SetTrainingState( + fDoingTraining: BOOL, + fAdaptFromTrainingData: BOOL, + ) -> HRESULT, + fn ResetAcousticModelAdaptation() -> HRESULT, +}} +STRUCT!{struct SPNORMALIZATIONLIST { + ulSize: ULONG, + ppszzNormalizedList: *mut *mut WCHAR, +}} +RIDL!{#[uuid(0xc360ce4b, 0x76d1, 0x4214, 0xad, 0x68, 0x52, 0x65, 0x7d, 0x50, 0x83, 0xda)] +interface ISpEnginePronunciation(ISpEnginePronunciationVtbl): IUnknown(IUnknownVtbl) { + fn Normalize( + pszWord: LPCWSTR, + pszLeftContext: LPCWSTR, + pszRightContext: LPCWSTR, + LangID: WORD, + pNormalizationList: *mut SPNORMALIZATIONLIST, + ) -> HRESULT, + fn GetPronunciations( + pszWord: LPCWSTR, + pszLeftContext: LPCWSTR, + pszRightContext: LPCWSTR, + LangID: WORD, + pEnginePronunciationList: *mut SPWORDPRONUNCIATIONLIST, + ) -> HRESULT, +}} +STRUCT!{struct SPDISPLAYTOKEN { + pszLexical: *const WCHAR, + pszDisplay: *const WCHAR, + bDisplayAttributes: BYTE, +}} +STRUCT!{struct SPDISPLAYPHRASE { + ulNumTokens: ULONG, + pTokens: *mut SPDISPLAYTOKEN, +}} +RIDL!{#[uuid(0xc8d7c7e2, 0x0dde, 0x44b7, 0xaf, 0xe3, 0xb0, 0xc9, 0x91, 0xfb, 0xeb, 0x5e)] +interface ISpDisplayAlternates(ISpDisplayAlternatesVtbl): IUnknown(IUnknownVtbl) { + fn GetDisplayAlternates( + pPhrase: *const SPDISPLAYPHRASE, + cRequestCount: ULONG, + ppCoMemPhrases: *mut *mut SPDISPLAYPHRASE, + pcPhrasesReturned: *mut ULONG, + ) -> HRESULT, + fn SetFullStopTrailSpace( + ulTrailSpace: ULONG, + ) -> HRESULT, +}} +pub use um::sapi51::{ + SpeechLanguageId, + DISPID_SpeechDataKey, + DISPID_SDKSetBinaryValue, + DISPID_SDKGetBinaryValue, + DISPID_SDKSetStringValue, + DISPID_SDKGetStringValue, + DISPID_SDKSetLongValue, + DISPID_SDKGetlongValue, + DISPID_SDKOpenKey, + DISPID_SDKCreateKey, + DISPID_SDKDeleteKey, + DISPID_SDKDeleteValue, + DISPID_SDKEnumKeys, + DISPID_SDKEnumValues, + DISPID_SpeechObjectToken, + DISPID_SOTId, + DISPID_SOTDataKey, + DISPID_SOTCategory, + DISPID_SOTGetDescription, + DISPID_SOTSetId, + DISPID_SOTGetAttribute, + DISPID_SOTCreateInstance, + DISPID_SOTRemove, + DISPID_SOTGetStorageFileName, + DISPID_SOTRemoveStorageFileName, + DISPID_SOTIsUISupported, + DISPID_SOTDisplayUI, + DISPID_SOTMatchesAttributes, + SpeechDataKeyLocation, + SDKLDefaultLocation, + SDKLCurrentUser, + SDKLLocalMachine, + SDKLCurrentConfig, + SpeechTokenContext, + STCInprocServer, + STCInprocHandler , + STCLocalServer, + STCRemoteServer, + STCAll, + SpeechTokenShellFolder, + STSF_AppData, + STSF_LocalAppData, + STSF_CommonAppData, + STSF_FlagCreate, + DISPID_SpeechObjectTokens, + DISPID_SOTsCount, + DISPID_SOTsItem, + DISPID_SOTs_NewEnum, + DISPID_SpeechObjectTokenCategory, + DISPID_SOTCId, + DISPID_SOTCDefault, + DISPID_SOTCSetId, + DISPID_SOTCGetDataKey, + DISPID_SOTCEnumerateTokens, + SpeechAudioFormatType, + SAFTDefault, + SAFTNoAssignedFormat, + SAFTText, + SAFTNonStandardFormat, + SAFTExtendedAudioFormat, + SAFT8kHz8BitMono, + SAFT8kHz8BitStereo, + SAFT8kHz16BitMono, + SAFT8kHz16BitStereo, + SAFT11kHz8BitMono, + SAFT11kHz8BitStereo, + SAFT11kHz16BitMono, + SAFT11kHz16BitStereo, + SAFT12kHz8BitMono, + SAFT12kHz8BitStereo, + SAFT12kHz16BitMono, + SAFT12kHz16BitStereo, + SAFT16kHz8BitMono, + SAFT16kHz8BitStereo, + SAFT16kHz16BitMono, + SAFT16kHz16BitStereo, + SAFT22kHz8BitMono, + SAFT22kHz8BitStereo, + SAFT22kHz16BitMono, + SAFT22kHz16BitStereo, + SAFT24kHz8BitMono, + SAFT24kHz8BitStereo, + SAFT24kHz16BitMono, + SAFT24kHz16BitStereo, + SAFT32kHz8BitMono, + SAFT32kHz8BitStereo, + SAFT32kHz16BitMono, + SAFT32kHz16BitStereo, + SAFT44kHz8BitMono, + SAFT44kHz8BitStereo, + SAFT44kHz16BitMono, + SAFT44kHz16BitStereo, + SAFT48kHz8BitMono, + SAFT48kHz8BitStereo, + SAFT48kHz16BitMono, + SAFT48kHz16BitStereo, + SAFTTrueSpeech_8kHz1BitMono, + SAFTCCITT_ALaw_8kHzMono, + SAFTCCITT_ALaw_8kHzStereo, + SAFTCCITT_ALaw_11kHzMono, + SAFTCCITT_ALaw_11kHzStereo, + SAFTCCITT_ALaw_22kHzMono, + SAFTCCITT_ALaw_22kHzStereo, + SAFTCCITT_ALaw_44kHzMono, + SAFTCCITT_ALaw_44kHzStereo, + SAFTCCITT_uLaw_8kHzMono, + SAFTCCITT_uLaw_8kHzStereo, + SAFTCCITT_uLaw_11kHzMono, + SAFTCCITT_uLaw_11kHzStereo, + SAFTCCITT_uLaw_22kHzMono, + SAFTCCITT_uLaw_22kHzStereo, + SAFTCCITT_uLaw_44kHzMono, + SAFTCCITT_uLaw_44kHzStereo, + SAFTADPCM_8kHzMono, + SAFTADPCM_8kHzStereo, + SAFTADPCM_11kHzMono, + SAFTADPCM_11kHzStereo, + SAFTADPCM_22kHzMono, + SAFTADPCM_22kHzStereo, + SAFTADPCM_44kHzMono, + SAFTADPCM_44kHzStereo, + SAFTGSM610_8kHzMono, + SAFTGSM610_11kHzMono, + SAFTGSM610_22kHzMono, + SAFTGSM610_44kHzMono, + DISPID_SpeechAudioFormat, + DISPID_SAFType, + DISPID_SAFGuid, + DISPID_SAFGetWaveFormatEx, + DISPID_SAFSetWaveFormatEx, + DISPID_SpeechBaseStream, + DISPID_SBSFormat, + DISPID_SBSRead, + DISPID_SBSWrite, + DISPID_SBSSeek, + SpeechStreamSeekPositionType, + SSSPTRelativeToStart, + SSSPTRelativeToCurrentPosition, + SSSPTRelativeToEnd, + DISPID_SpeechAudio, + DISPID_SAStatus, + DISPID_SABufferInfo, + DISPID_SADefaultFormat, + DISPID_SAVolume, + DISPID_SABufferNotifySize, + DISPID_SAEventHandle, + DISPID_SASetState, + SpeechAudioState, + SASClosed, + SASStop, + SASPause, + SASRun, + DISPID_SpeechMMSysAudio, + DISPID_SMSADeviceId, + DISPID_SMSALineId, + DISPID_SMSAMMHandle, + DISPID_SpeechFileStream, + DISPID_SFSOpen, + DISPID_SFSClose, + SpeechStreamFileMode, + SSFMOpenForRead, + SSFMOpenReadWrite, + SSFMCreate, + SSFMCreateForWrite, + DISPID_SpeechCustomStream, + DISPID_SCSBaseStream, + DISPID_SpeechMemoryStream, + DISPID_SMSSetData, + DISPID_SMSGetData, + DISPID_SpeechAudioStatus, + DISPID_SASFreeBufferSpace, + DISPID_SASNonBlockingIO, + DISPID_SASState, + DISPID_SASCurrentSeekPosition, + DISPID_SASCurrentDevicePosition, + DISPID_SpeechAudioBufferInfo, + DISPID_SABIMinNotification, + DISPID_SABIBufferSize, + DISPID_SABIEventBias, + DISPID_SpeechWaveFormatEx, + DISPID_SWFEFormatTag, + DISPID_SWFEChannels, + DISPID_SWFESamplesPerSec, + DISPID_SWFEAvgBytesPerSec, + DISPID_SWFEBlockAlign, + DISPID_SWFEBitsPerSample, + DISPID_SWFEExtraData, + DISPID_SpeechVoice, + DISPID_SVStatus, + DISPID_SVVoice, + DISPID_SVAudioOutput, + DISPID_SVAudioOutputStream, + DISPID_SVRate, + DISPID_SVVolume, + DISPID_SVAllowAudioOuputFormatChangesOnNextSet, + DISPID_SVEventInterests, + DISPID_SVPriority, + DISPID_SVAlertBoundary, + DISPID_SVSyncronousSpeakTimeout, + DISPID_SVSpeak, + DISPID_SVSpeakStream, + DISPID_SVPause, + DISPID_SVResume, + DISPID_SVSkip, + DISPID_SVGetVoices, + DISPID_SVGetAudioOutputs, + DISPID_SVWaitUntilDone, + DISPID_SVSpeakCompleteEvent, + DISPID_SVIsUISupported, + DISPID_SVDisplayUI, + SpeechVoicePriority, + SVPNormal, + SVPAlert, + SVPOver, + SpeechVoiceSpeakFlags, + SVSFDefault, + SVSFlagsAsync, + SVSFPurgeBeforeSpeak, + SVSFIsFilename, + SVSFIsXML, + SVSFIsNotXML, + SVSFPersistXML, + SVSFNLPSpeakPunc, +}; +pub const SVSFParseSapi: SpeechVoiceSpeakFlags = SPF_PARSE_SAPI; +pub const SVSFParseSsml: SpeechVoiceSpeakFlags = SPF_PARSE_SSML; +pub const SVSFParseAutodetect: SpeechVoiceSpeakFlags = SPF_PARSE_AUTODETECT; +pub use um::sapi51::SVSFNLPMask; +pub const SVSFParseMask: SpeechVoiceSpeakFlags = SPF_PARSE_MASK as u32; +pub use um::sapi51::{ + SVSFVoiceMask, + SVSFUnusedFlags, + SpeechVoiceEvents, + SVEStartInputStream, + SVEEndInputStream, + SVEVoiceChange, + SVEBookmark, + SVEWordBoundary, + SVEPhoneme, + SVESentenceBoundary, + SVEViseme, + SVEAudioLevel, + SVEPrivate, + SVEAllEvents, + DISPID_SpeechVoiceStatus, + DISPID_SVSCurrentStreamNumber, + DISPID_SVSLastStreamNumberQueued, + DISPID_SVSLastResult, + DISPID_SVSRunningState, + DISPID_SVSInputWordPosition, + DISPID_SVSInputWordLength, + DISPID_SVSInputSentencePosition, + DISPID_SVSInputSentenceLength, + DISPID_SVSLastBookmark, + DISPID_SVSLastBookmarkId, + DISPID_SVSPhonemeId, + DISPID_SVSVisemeId, + SpeechRunState, + SRSEDone, + SRSEIsSpeaking, + SpeechVisemeType, + SVP_0, + SVP_1, + SVP_2, + SVP_3, + SVP_4, + SVP_5, + SVP_6, + SVP_7, + SVP_8, + SVP_9, + SVP_10, + SVP_11, + SVP_12, + SVP_13, + SVP_14, + SVP_15, + SVP_16, + SVP_17, + SVP_18, + SVP_19, + SVP_20, + SVP_21, + SpeechVisemeFeature, + SVF_None, + SVF_Stressed, + SVF_Emphasis, + DISPID_SpeechVoiceEvent, + DISPID_SVEStreamStart, + DISPID_SVEStreamEnd, + DISPID_SVEVoiceChange, + DISPID_SVEBookmark, + DISPID_SVEWord, + DISPID_SVEPhoneme, + DISPID_SVESentenceBoundary, + DISPID_SVEViseme, + DISPID_SVEAudioLevel, + DISPID_SVEEnginePrivate, + DISPID_SpeechRecognizer, + DISPID_SRRecognizer, + DISPID_SRAllowAudioInputFormatChangesOnNextSet, + DISPID_SRAudioInput, + DISPID_SRAudioInputStream, + DISPID_SRIsShared, + DISPID_SRState, + DISPID_SRStatus, + DISPID_SRProfile, + DISPID_SREmulateRecognition, + DISPID_SRCreateRecoContext, + DISPID_SRGetFormat, + DISPID_SRSetPropertyNumber, + DISPID_SRGetPropertyNumber, + DISPID_SRSetPropertyString, + DISPID_SRGetPropertyString, + DISPID_SRIsUISupported, + DISPID_SRDisplayUI, + DISPID_SRGetRecognizers, + DISPID_SVGetAudioInputs, + DISPID_SVGetProfiles, + SpeechRecognizerState, + SRSInactive, + SRSActive, + SRSActiveAlways, + SRSInactiveWithPurge, + SpeechDisplayAttributes, + SDA_No_Trailing_Space, + SDA_One_Trailing_Space, + SDA_Two_Trailing_Spaces, + SDA_Consume_Leading_Spaces, + SpeechFormatType, + SFTInput, + SFTSREngine, +}; +ENUM!{enum SpeechEmulationCompareFlags { + SECFIgnoreCase = 0x1, + SECFIgnoreKanaType = 0x10000, + SECFIgnoreWidth = 0x20000, + SECFNoSpecialChars = 0x20000000, + SECFEmulateResult = 0x40000000, + SECFDefault = SECFIgnoreCase | SECFIgnoreKanaType | SECFIgnoreWidth, +}} +pub use um::sapi51::{ + DISPID_SpeechRecognizerStatus, + DISPID_SRSAudioStatus, + DISPID_SRSCurrentStreamPosition, + DISPID_SRSCurrentStreamNumber, + DISPID_SRSNumberOfActiveRules, + DISPID_SRSClsidEngine, + DISPID_SRSSupportedLanguages, + DISPID_SpeechRecoContext, + DISPID_SRCRecognizer, + DISPID_SRCAudioInInterferenceStatus, + DISPID_SRCRequestedUIType, + DISPID_SRCVoice, + DISPID_SRAllowVoiceFormatMatchingOnNextSet, + DISPID_SRCVoicePurgeEvent, + DISPID_SRCEventInterests, + DISPID_SRCCmdMaxAlternates, + DISPID_SRCState, + DISPID_SRCRetainedAudio, + DISPID_SRCRetainedAudioFormat, + DISPID_SRCPause, + DISPID_SRCResume, + DISPID_SRCCreateGrammar, + DISPID_SRCCreateResultFromMemory, + DISPID_SRCBookmark, + DISPID_SRCSetAdaptationData, + SpeechRetainedAudioOptions, + SRAONone, + SRAORetainAudio, + SpeechBookmarkOptions, + SBONone, + SBOPause, + SpeechInterference, + SINone, + SINoise, + SINoSignal, + SITooLoud, + SITooQuiet, + SITooFast, + SITooSlow, + SpeechRecoEvents, + SREStreamEnd, + SRESoundStart, + SRESoundEnd, + SREPhraseStart, + SRERecognition, + SREHypothesis, + SREBookmark, + SREPropertyNumChange, + SREPropertyStringChange, + SREFalseRecognition, + SREInterference, + SRERequestUI, + SREStateChange, + SREAdaptation, + SREStreamStart, + SRERecoOtherContext, + SREAudioLevel, + SREPrivate, + SREAllEvents, + SpeechRecoContextState, + SRCS_Disabled, + SRCS_Enabled, + DISPIDSPRG, + DISPID_SRGId, + DISPID_SRGRecoContext, + DISPID_SRGState, + DISPID_SRGRules, + DISPID_SRGReset, + DISPID_SRGCommit, + DISPID_SRGCmdLoadFromFile, + DISPID_SRGCmdLoadFromObject, + DISPID_SRGCmdLoadFromResource, + DISPID_SRGCmdLoadFromMemory, + DISPID_SRGCmdLoadFromProprietaryGrammar, + DISPID_SRGCmdSetRuleState, + DISPID_SRGCmdSetRuleIdState, + DISPID_SRGDictationLoad, + DISPID_SRGDictationUnload, + DISPID_SRGDictationSetState, + DISPID_SRGSetWordSequenceData, + DISPID_SRGSetTextSelection, + DISPID_SRGIsPronounceable, + SpeechLoadOption, + SLOStatic, + SLODynamic, + SpeechWordPronounceable, + SWPUnknownWordUnpronounceable, + SWPUnknownWordPronounceable, + SWPKnownWordPronounceable, + SpeechGrammarState, + SGSEnabled, + SGSDisabled, + SGSExclusive, + SpeechRuleState, + SGDSInactive, + SGDSActive, + SGDSActiveWithAutoPause, +}; +pub const SGDSActiveUserDelimited: SpeechRuleState = SPRS_ACTIVE_USER_DELIMITED; +pub use um::sapi51::{ + SpeechRuleAttributes, + SRATopLevel, + SRADefaultToActive, + SRAExport, + SRAImport, + SRAInterpreter, + SRADynamic, +}; +pub const SRARoot: SpeechRuleAttributes = SPRAF_Root; +pub use um::sapi51::{ + SpeechGrammarWordType, + SGDisplay, + SGLexical, + SGPronounciation, +}; +pub const SGLexicalNoSpecialChars: SpeechGrammarWordType = SPWT_LEXICAL_NO_SPECIAL_CHARS; +pub use um::sapi51::{ + DISPID_SpeechRecoContextEvents, + DISPID_SRCEStartStream, + DISPID_SRCEEndStream, + DISPID_SRCEBookmark, + DISPID_SRCESoundStart, + DISPID_SRCESoundEnd, + DISPID_SRCEPhraseStart, + DISPID_SRCERecognition, + DISPID_SRCEHypothesis, + DISPID_SRCEPropertyNumberChange, + DISPID_SRCEPropertyStringChange, + DISPID_SRCEFalseRecognition, + DISPID_SRCEInterference, + DISPID_SRCERequestUI, + DISPID_SRCERecognizerStateChange, + DISPID_SRCEAdaptation, + DISPID_SRCERecognitionForOtherContext, + DISPID_SRCEAudioLevel, + DISPID_SRCEEnginePrivate, + SpeechRecognitionType, + SRTStandard, + SRTAutopause, + SRTEmulated, +}; +pub const SRTSMLTimeout: SpeechRecognitionType = SPREF_SMLTimeout; +pub const SRTExtendableParse: SpeechRecognitionType = SPREF_ExtendableParse; +pub const SRTReSent: SpeechRecognitionType = SPREF_ReSent; +pub use um::sapi51::{ + DISPID_SpeechGrammarRule, + DISPID_SGRAttributes, + DISPID_SGRInitialState, + DISPID_SGRName, + DISPID_SGRId, + DISPID_SGRClear, + DISPID_SGRAddResource, + DISPID_SGRAddState, + DISPID_SpeechGrammarRules, + DISPID_SGRsCount, + DISPID_SGRsDynamic, + DISPID_SGRsAdd, + DISPID_SGRsCommit, + DISPID_SGRsCommitAndSave, + DISPID_SGRsFindRule, + DISPID_SGRsItem, + DISPID_SGRs_NewEnum, + DISPID_SpeechGrammarRuleState, + DISPID_SGRSRule, + DISPID_SGRSTransitions, + DISPID_SGRSAddWordTransition, + DISPID_SGRSAddRuleTransition, + DISPID_SGRSAddSpecialTransition, + SpeechSpecialTransitionType, + SSTTWildcard, + SSTTDictation, + SSTTTextBuffer, + DISPID_SpeechGrammarRuleStateTransitions, + DISPID_SGRSTsCount, + DISPID_SGRSTsItem, + DISPID_SGRSTs_NewEnum, + DISPID_SpeechGrammarRuleStateTransition, + DISPID_SGRSTType, + DISPID_SGRSTText, + DISPID_SGRSTRule, + DISPID_SGRSTWeight, + DISPID_SGRSTPropertyName, + DISPID_SGRSTPropertyId, + DISPID_SGRSTPropertyValue, + DISPID_SGRSTNextState, + SpeechGrammarRuleStateTransitionType, + SGRSTTEpsilon, + SGRSTTWord, + SGRSTTRule, + SGRSTTDictation, + SGRSTTWildcard, + SGRSTTTextBuffer, + DISPIDSPTSI, + DISPIDSPTSI_ActiveOffset, + DISPIDSPTSI_ActiveLength, + DISPIDSPTSI_SelectionOffset, + DISPIDSPTSI_SelectionLength, + DISPID_SpeechRecoResult, + DISPID_SRRRecoContext, + DISPID_SRRTimes, + DISPID_SRRAudioFormat, + DISPID_SRRPhraseInfo, + DISPID_SRRAlternates, + DISPID_SRRAudio, + DISPID_SRRSpeakAudio, + DISPID_SRRSaveToMemory, + DISPID_SRRDiscardResultInfo, + SpeechDiscardType, + SDTProperty, + SDTReplacement, + SDTRule, + SDTDisplayText, + SDTLexicalForm, + SDTPronunciation, + SDTAudio, + SDTAlternates, + SDTAll, +}; +ENUM!{enum DISPID_SpeechXMLRecoResult { + DISPID_SRRGetXMLResult, + DISPID_SRRGetXMLErrorInfo, +}} +ENUM!{enum DISPID_SpeechRecoResult2 { + DISPID_SRRSetTextFeedback, +}} +pub use um::sapi51::{ + DISPID_SpeechPhraseBuilder, + DISPID_SPPBRestorePhraseFromMemory, + DISPID_SpeechRecoResultTimes, + DISPID_SRRTStreamTime, + DISPID_SRRTLength, + DISPID_SRRTTickCount, + DISPID_SRRTOffsetFromStart, + DISPID_SpeechPhraseAlternate, + DISPID_SPARecoResult, + DISPID_SPAStartElementInResult, + DISPID_SPANumberOfElementsInResult, + DISPID_SPAPhraseInfo, + DISPID_SPACommit, + DISPID_SpeechPhraseAlternates, + DISPID_SPAsCount, + DISPID_SPAsItem, + DISPID_SPAs_NewEnum, + DISPID_SpeechPhraseInfo, + DISPID_SPILanguageId, + DISPID_SPIGrammarId, + DISPID_SPIStartTime, + DISPID_SPIAudioStreamPosition, + DISPID_SPIAudioSizeBytes, + DISPID_SPIRetainedSizeBytes, + DISPID_SPIAudioSizeTime, + DISPID_SPIRule, + DISPID_SPIProperties, + DISPID_SPIElements, + DISPID_SPIReplacements, + DISPID_SPIEngineId, + DISPID_SPIEnginePrivateData, + DISPID_SPISaveToMemory, + DISPID_SPIGetText, + DISPID_SPIGetDisplayAttributes, + DISPID_SpeechPhraseElement, + DISPID_SPEAudioTimeOffset, + DISPID_SPEAudioSizeTime, + DISPID_SPEAudioStreamOffset, + DISPID_SPEAudioSizeBytes, + DISPID_SPERetainedStreamOffset, + DISPID_SPERetainedSizeBytes, + DISPID_SPEDisplayText, + DISPID_SPELexicalForm, + DISPID_SPEPronunciation, + DISPID_SPEDisplayAttributes, + DISPID_SPERequiredConfidence, + DISPID_SPEActualConfidence, + DISPID_SPEEngineConfidence, + SpeechEngineConfidence, + SECLowConfidence, + SECNormalConfidence, + SECHighConfidence, + DISPID_SpeechPhraseElements, + DISPID_SPEsCount, + DISPID_SPEsItem, + DISPID_SPEs_NewEnum, + DISPID_SpeechPhraseReplacement, + DISPID_SPRDisplayAttributes, + DISPID_SPRText, + DISPID_SPRFirstElement, + DISPID_SPRNumberOfElements, + DISPID_SpeechPhraseReplacements, + DISPID_SPRsCount, + DISPID_SPRsItem, + DISPID_SPRs_NewEnum, + DISPID_SpeechPhraseProperty, + DISPID_SPPName, + DISPID_SPPId, + DISPID_SPPValue, + DISPID_SPPFirstElement, + DISPID_SPPNumberOfElements, + DISPID_SPPEngineConfidence, + DISPID_SPPConfidence, + DISPID_SPPParent, + DISPID_SPPChildren, + DISPID_SpeechPhraseProperties, + DISPID_SPPsCount, + DISPID_SPPsItem, + DISPID_SPPs_NewEnum, + DISPID_SpeechPhraseRule, + DISPID_SPRuleName, + DISPID_SPRuleId, + DISPID_SPRuleFirstElement, + DISPID_SPRuleNumberOfElements, + DISPID_SPRuleParent, + DISPID_SPRuleChildren, + DISPID_SPRuleConfidence, + DISPID_SPRuleEngineConfidence, + DISPID_SpeechPhraseRules, + DISPID_SPRulesCount, + DISPID_SPRulesItem, + DISPID_SPRules_NewEnum, + DISPID_SpeechLexicon, + DISPID_SLGenerationId, + DISPID_SLGetWords, + DISPID_SLAddPronunciation, + DISPID_SLAddPronunciationByPhoneIds, + DISPID_SLRemovePronunciation, + DISPID_SLRemovePronunciationByPhoneIds, + DISPID_SLGetPronunciations, + DISPID_SLGetGenerationChange, + SpeechLexiconType, + SLTUser, + SLTApp, + SpeechPartOfSpeech, + SPSNotOverriden, + SPSUnknown, + SPSNoun, + SPSVerb, + SPSModifier, + SPSFunction, + SPSInterjection, +}; +pub const SPSLMA: SpeechPartOfSpeech = SPPS_LMA; +pub const SPSSuppressWord: SpeechPartOfSpeech = SPPS_SuppressWord; +pub use um::sapi51::{ + DISPID_SpeechLexiconWords, + DISPID_SLWsCount, + DISPID_SLWsItem, + DISPID_SLWs_NewEnum, + SpeechWordType, + SWTAdded, + SWTDeleted, + DISPID_SpeechLexiconWord, + DISPID_SLWLangId, + DISPID_SLWType, + DISPID_SLWWord, + DISPID_SLWPronunciations, + DISPID_SpeechLexiconProns, + DISPID_SLPsCount, + DISPID_SLPsItem, + DISPID_SLPs_NewEnum, + DISPID_SpeechLexiconPronunciation, + DISPID_SLPType, + DISPID_SLPLangId, + DISPID_SLPPartOfSpeech, + DISPID_SLPPhoneIds, + DISPID_SLPSymbolic, + DISPID_SpeechPhoneConverter, + DISPID_SPCLangId, + DISPID_SPCPhoneToId, + DISPID_SPCIdToPhone, + LIBID_SpeechLib, + ISpeechDataKey, ISpeechDataKeyVtbl, + ISpeechObjectToken, ISpeechObjectTokenVtbl, + ISpeechObjectTokens, ISpeechObjectTokensVtbl, + ISpeechObjectTokenCategory, ISpeechObjectTokenCategoryVtbl, + ISpeechAudioBufferInfo, ISpeechAudioBufferInfoVtbl, + ISpeechAudioStatus, ISpeechAudioStatusVtbl, + ISpeechAudioFormat, ISpeechAudioFormatVtbl, + ISpeechWaveFormatEx, ISpeechWaveFormatExVtbl, + ISpeechBaseStream, ISpeechBaseStreamVtbl, + ISpeechFileStream, ISpeechFileStreamVtbl, + ISpeechMemoryStream, ISpeechMemoryStreamVtbl, + ISpeechCustomStream, ISpeechCustomStreamVtbl, + ISpeechAudio, ISpeechAudioVtbl, + ISpeechMMSysAudio, ISpeechMMSysAudioVtbl, + ISpeechVoice, ISpeechVoiceVtbl, + ISpeechVoiceStatus, ISpeechVoiceStatusVtbl, + _ISpeechVoiceEvents, _ISpeechVoiceEventsVtbl, + ISpeechRecognizer, ISpeechRecognizerVtbl, + ISpeechRecognizerStatus, ISpeechRecognizerStatusVtbl, + ISpeechRecoContext, ISpeechRecoContextVtbl, + ISpeechRecoGrammar, ISpeechRecoGrammarVtbl, + _ISpeechRecoContextEvents, _ISpeechRecoContextEventsVtbl, + ISpeechGrammarRule, ISpeechGrammarRuleVtbl, + ISpeechGrammarRules, ISpeechGrammarRulesVtbl, + ISpeechGrammarRuleState, ISpeechGrammarRuleStateVtbl, + ISpeechGrammarRuleStateTransition, ISpeechGrammarRuleStateTransitionVtbl, + ISpeechGrammarRuleStateTransitions, ISpeechGrammarRuleStateTransitionsVtbl, + ISpeechTextSelectionInformation, ISpeechTextSelectionInformationVtbl, + ISpeechRecoResult, ISpeechRecoResultVtbl, +}; +RIDL!{#[uuid(0x8e0a246d, 0xd3c8, 0x45de, 0x86, 0x57, 0x04, 0x29, 0x0c, 0x45, 0x8c, 0x3c)] +interface ISpeechRecoResult2(ISpeechRecoResult2Vtbl): ISpeechRecoResult(ISpeechRecoResultVtbl) { + fn SetTextFeedback( + Feedback: BSTR, + WasSuccessful: VARIANT_BOOL, + ) -> HRESULT, +}} +pub use um::sapi51::{ + ISpeechRecoResultTimes, ISpeechRecoResultTimesVtbl, + ISpeechPhraseAlternate, ISpeechPhraseAlternateVtbl, + ISpeechPhraseAlternates, ISpeechPhraseAlternatesVtbl, + ISpeechPhraseInfo, ISpeechPhraseInfoVtbl, + ISpeechPhraseElement, ISpeechPhraseElementVtbl, + ISpeechPhraseElements, ISpeechPhraseElementsVtbl, + ISpeechPhraseReplacement, ISpeechPhraseReplacementVtbl, + ISpeechPhraseReplacements, ISpeechPhraseReplacementsVtbl, + ISpeechPhraseProperty, ISpeechPhrasePropertyVtbl, + ISpeechPhraseProperties, ISpeechPhrasePropertiesVtbl, + ISpeechPhraseRule, ISpeechPhraseRuleVtbl, + ISpeechPhraseRules, ISpeechPhraseRulesVtbl, + ISpeechLexicon, ISpeechLexiconVtbl, + ISpeechLexiconWords, ISpeechLexiconWordsVtbl, + ISpeechLexiconWord, ISpeechLexiconWordVtbl, + ISpeechLexiconPronunciations, ISpeechLexiconPronunciationsVtbl, + ISpeechLexiconPronunciation, ISpeechLexiconPronunciationVtbl, + Speech_Default_Weight, + Speech_Max_Word_Length, + Speech_Max_Pron_Length, + Speech_StreamPos_Asap, + Speech_StreamPos_RealTime, + SpeechAllElements, +}; +RIDL!{#[uuid(0xaaec54af, 0x8f85, 0x4924, 0x94, 0x4d, 0xb7, 0x9d, 0x39, 0xd7, 0x2e, 0x19)] +interface ISpeechXMLRecoResult(ISpeechXMLRecoResultVtbl): + ISpeechRecoResult(ISpeechRecoResultVtbl) { + fn GetXMLResult( + Options: SPXMLRESULTOPTIONS, + pResult: *mut BSTR, + ) -> HRESULT, + fn GetXMLErrorInfo( + LineNumber: *mut c_long, + ScriptLine: *mut BSTR, + Source: *mut BSTR, + Description: *mut BSTR, + ResultCode: *mut c_long, + IsError: *mut VARIANT_BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6d60eb64, 0xaced, 0x40a6, 0xbb, 0xf3, 0x4e, 0x55, 0x7f, 0x71, 0xde, 0xe2)] +interface ISpeechRecoResultDispatch(ISpeechRecoResultDispatchVtbl): IDispatch(IDispatchVtbl) { + fn get_RecoContext( + RecoContext: *mut ISpeechRecoContext, + ) -> HRESULT, + fn get_Times( + Times: *mut ISpeechRecoResultTimes, + ) -> HRESULT, + fn putref_AudioFormat( + Format: *mut ISpeechAudioFormat, + ) -> HRESULT, + fn get_AudioFormat( + Format: *mut *mut ISpeechAudioFormat, + ) -> HRESULT, + fn get_PhraseInfo( + PhraseInfo: *mut *mut ISpeechPhraseInfo, + ) -> HRESULT, + fn Alternates( + RequestCount: c_long, + StartElement: c_long, + Elements: c_long, + Alternates: *mut *mut ISpeechPhraseAlternates, + ) -> HRESULT, + fn Audio( + StartElement: c_long, + Elements: c_long, + Stream: *mut *mut ISpeechMemoryStream, + ) -> HRESULT, + fn SpeakAudio( + StartElement: c_long, + Elements: c_long, + Flags: SpeechVoiceSpeakFlags, + StreamNumber: *mut c_long, + ) -> HRESULT, + fn SaveToMemory( + ResultBlock: *mut VARIANT, + ) -> HRESULT, + fn DiscardResultInfo( + ValueTypes: SpeechDiscardType, + ) -> HRESULT, + fn GetXMLResult( + Options: SPXMLRESULTOPTIONS, + pResult: *mut BSTR, + ) -> HRESULT, + fn GetXMLErrorInfo( + LineNumber: *mut c_long, + ScriptLine: *mut BSTR, + Source: *mut BSTR, + Description: *mut BSTR, + ResultCode: *mut HRESULT, + IsError: *mut VARIANT_BOOL, + ) -> HRESULT, + fn SetTextFeedback( + Feedback: BSTR, + WasSuccessful: VARIANT_BOOL, + ) -> HRESULT, +}} +pub use um::sapi51::{ + ISpeechPhraseInfoBuilder, ISpeechPhraseInfoBuilderVtbl, + ISpeechPhoneConverter, ISpeechPhoneConverterVtbl, + CLSID_SpNotifyTranslator, + CLSID_SpObjectTokenCategory, + CLSID_SpObjectToken, + CLSID_SpResourceManager, + CLSID_SpStreamFormatConverter, + CLSID_SpMMAudioEnum, + CLSID_SpMMAudioIn, + CLSID_SpMMAudioOut, + CLSID_SpStream, + CLSID_SpVoice, + CLSID_SpSharedRecoContext, + CLSID_SpInprocRecognizer, + CLSID_SpSharedRecognizer, + CLSID_SpLexicon, + CLSID_SpUnCompressedLexicon, + CLSID_SpCompressedLexicon, +}; +extern { + pub static CLSID_SpShortcut: CLSID; +} +pub use um::sapi51::CLSID_SpPhoneConverter; +extern { + pub static CLSID_SpPhoneticAlphabetConverter: CLSID; +} +pub use um::sapi51::{ + CLSID_SpNullPhoneConverter, + CLSID_SpTextSelectionInformation, + CLSID_SpPhraseInfoBuilder, + CLSID_SpAudioFormat, + CLSID_SpWaveFormatEx, + CLSID_SpInProcRecoContext, + CLSID_SpCustomStream, + CLSID_SpFileStream, + CLSID_SpMemoryStream, +}; diff --git a/bash-5.1/vendor/winapi/src/um/sapiddk.rs b/bash-5.1/vendor/winapi/src/um/sapiddk.rs new file mode 100644 index 0000000000000000000000000000000000000000..8ff59b523f607d9027c90bcdd46cff44aa2fd92a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sapiddk.rs @@ -0,0 +1,238 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_float, c_int, c_void}; +use shared::guiddef::CLSID; +use shared::minwindef::{BOOL, DWORD, ULONG}; +use um::sapi::*; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCWSTR, ULONGLONG, WCHAR}; +pub use um::sapiddk51::{ + SPRECOEXTENSION, + SPALTERNATESCLSID, +}; +pub const SR_LOCALIZED_DESCRIPTION: &'static str = "Description"; +pub use um::sapiddk51::{ + ISpTokenUI, ISpTokenUIVtbl, + ISpObjectTokenEnumBuilder, ISpObjectTokenEnumBuilderVtbl, + SPWORDHANDLE, + SPRULEHANDLE, + SPGRAMMARHANDLE, + SPRECOCONTEXTHANDLE, + SPPHRASERULEHANDLE, + SPPHRASEPROPERTYHANDLE, + SPTRANSITIONID, + ISpErrorLog, ISpErrorLogVtbl, + ISpGrammarCompiler, ISpGrammarCompilerVtbl, + ISpGramCompBackend, ISpGramCompBackendVtbl, + ISpITNProcessor, ISpITNProcessorVtbl, + ISpPhraseBuilder, ISpPhraseBuilderVtbl, + ISpTask, + ISpThreadTask, + ISpThreadControl, ISpThreadControlVtbl, + SPTMTHREADINFO, + ISpTaskManager, ISpTaskManagerVtbl, + SPVSKIPTYPE, + SPVST_SENTENCE, + SPVESACTIONS, + SPVES_CONTINUE, + SPVES_ABORT, + SPVES_SKIP, + SPVES_RATE, + SPVES_VOLUME, + ISpTTSEngineSite, ISpTTSEngineSiteVtbl, + SPVTEXTFRAG, + ISpTTSEngine, ISpTTSEngineVtbl, + SPWORDENTRY, + SPRULEENTRY, + SPTRANSITIONTYPE, + SPTRANSEPSILON, + SPTRANSWORD, + SPTRANSRULE, + SPTRANSTEXTBUF, + SPTRANSWILDCARD, + SPTRANSDICTATION, + SPTRANSITIONENTRY, + SPTRANSITIONPROPERTY, + SPSTATEINFO, + SPPATHENTRY, + ISpCFGInterpreterSite, ISpCFGInterpreterSiteVtbl, + ISpCFGInterpreter, ISpCFGInterpreterVtbl, + SPCFGNOTIFY, + SPCFGN_ADD, + SPCFGN_REMOVE, + SPCFGN_INVALIDATE, + SPCFGN_ACTIVATE, + SPCFGN_DEACTIVATE, + SPRESULTTYPE, + SPRT_CFG, + SPRT_SLM, + SPRT_PROPRIETARY, + SPRT_FALSE_RECOGNITION, +}; +pub const SPRT_TYPE_MASK: SPRESULTTYPE = 3; +pub const SPRT_EMULATED: SPRESULTTYPE = 1 << 3; +pub const SPRT_EXTENDABLE_PARSE: SPRESULTTYPE = 1 << 4; +pub use um::sapiddk51::{ + SPPHRASEALT, + SPRECORESULTINFO, +}; +STRUCT!{struct SPRECORESULTINFOEX { + cbSize: ULONG, + eResultType: SPRESULTTYPE, + fHypothesis: BOOL, + fProprietaryAutoPause: BOOL, + ullStreamPosStart: ULONGLONG, + ullStreamPosEnd: ULONGLONG, + hGrammar: SPGRAMMARHANDLE, + ulSizeEngineData: ULONG, + pvEngineData: *mut c_void, + pPhrase: *mut ISpPhraseBuilder, + aPhraseAlts: *mut SPPHRASEALT, + ulNumAlts: ULONG, + ullStreamTimeStart: ULONGLONG, + ullStreamTimeEnd: ULONGLONG, +}} +pub use um::sapiddk51::{ + SPWORDINFOOPT, + SPWIO_NONE, + SPWIO_WANT_TEXT, + SPRULEINFOOPT, + SPRIO_NONE, + SPPARSEINFO, + ISpSREngineSite, ISpSREngineSiteVtbl, +}; +RIDL!{#[uuid(0x7bc6e012, 0x684a, 0x493e, 0xbd, 0xd4, 0x2b, 0xf5, 0xfb, 0xf4, 0x8c, 0xfe)] +interface ISpSREngineSite2(ISpSREngineSite2Vtbl): ISpSREngineSite(ISpSREngineSiteVtbl) { + fn AddEventEx( + pEvent: *const SPEVENTEX, + hSAPIRecoContext: SPRECOCONTEXTHANDLE, + ) -> HRESULT, + fn UpdateRecoPosEx( + ullCurrentRecoPos: ULONGLONG, + ullCurrentRecoTime: ULONGLONG, + ) -> HRESULT, + fn GetRuleTransition( + ulGrammarID: ULONG, + RuleIndex: ULONG, + pTrans: *mut SPTRANSITIONENTRY, + ) -> HRESULT, + fn RecognitionEx( + pResultInfo: *const SPRECORESULTINFOEX, + ) -> HRESULT, +}} +pub use um::sapiddk51::{ + SPPROPSRC, + SPPROPSRC_RECO_INST, + SPPROPSRC_RECO_CTX, + SPPROPSRC_RECO_GRAMMAR, + ISpSREngine, ISpSREngineVtbl, +}; +RIDL!{#[uuid(0x7ba627d8, 0x33f9, 0x4375, 0x90, 0xc5, 0x99, 0x85, 0xae, 0xe5, 0xed, 0xe5)] +interface ISpSREngine2(ISpSREngine2Vtbl): ISpSREngine(ISpSREngineVtbl) { + fn PrivateCallImmediate( + pvEngineContext: *mut c_void, + pInCallFrame: *const c_void, + ulInCallFrameSize: ULONG, + ppvCoMemResponse: *mut *mut c_void, + pulResponseSize: *mut ULONG, + ) -> HRESULT, + fn SetAdaptationData2( + pvEngineContext: *mut c_void, + pAdaptationData: *const WCHAR, + cch: ULONG, + pTopicName: LPCWSTR, + eSettings: SPADAPTATIONSETTINGS, + eRelevance: SPADAPTATIONRELEVANCE, + ) -> HRESULT, + fn SetGrammarPrefix( + pvEngineGrammar: *mut c_void, + pszPrefix: LPCWSTR, + fIsPrefixRequired: BOOL, + ) -> HRESULT, + fn SetRulePriority( + hRule: SPRULEHANDLE, + pvClientRuleContext: *mut c_void, + nRulePriority: c_int, + ) -> HRESULT, + fn EmulateRecognition( + pPhrase: *mut ISpPhrase, + dwCompareFlags: DWORD, + ) -> HRESULT, + fn SetSLMWeight( + pvEngineGrammar: *mut c_void, + flWeight: c_float, + ) -> HRESULT, + fn SetRuleWeight( + hRule: SPRULEHANDLE, + pvClientRuleContext: *mut c_void, + flWeight: c_float, + ) -> HRESULT, + fn SetTrainingState( + fDoingTraining: BOOL, + fAdaptFromTrainingData: BOOL, + ) -> HRESULT, + fn ResetAcousticModelAdaptation() -> HRESULT, + fn OnLoadCFG( + pvEngineGrammar: *mut c_void, + pvGrammarData: *const SPBINARYGRAMMAR, + ulGrammarID: ULONG, + ) -> HRESULT, + fn OnUnloadCFG( + pvEngineGrammar: *mut c_void, + ulGrammarID: ULONG, + ) -> HRESULT, +}} +pub use um::sapiddk51::SPPHRASEALTREQUEST; +RIDL!{#[uuid(0xfece8294, 0x2be1, 0x408f, 0x8e, 0x68, 0x2d, 0xe3, 0x77, 0x09, 0x2f, 0x0e)] +interface ISpSRAlternates(ISpSRAlternatesVtbl): IUnknown(IUnknownVtbl) { + fn GetAlternates( + pAltRequest: *mut SPPHRASEALTREQUEST, + ppAlts: *mut *mut SPPHRASEALT, + pcAlts: *mut ULONG, + ) -> HRESULT, + fn Commit( + pAltRequest: *mut SPPHRASEALTREQUEST, + pAlt: *mut SPPHRASEALT, + ppvResultExtra: *mut c_void, + pcbResultExtra: *mut ULONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf338f437, 0xcb33, 0x4020, 0x9c, 0xab, 0xc7, 0x1f, 0xf9, 0xce, 0x12, 0xd3)] +interface ISpSRAlternates2(ISpSRAlternates2Vtbl): ISpSRAlternates(ISpSRAlternatesVtbl) { + fn CommitText( + pAltRequest: *mut SPPHRASEALTREQUEST, + pcszNewText: LPCWSTR, + commitFlags: SPCOMMITFLAGS, + ) -> HRESULT, +}} +pub use um::sapiddk51::{_ISpPrivateEngineCall, _ISpPrivateEngineCallVtbl}; +RIDL!{#[uuid(0xdefd682a, 0xfe0a, 0x42b9, 0xbf, 0xa1, 0x56, 0xd3, 0xd6, 0xce, 0xcf, 0xaf)] +interface ISpPrivateEngineCallEx(ISpPrivateEngineCallExVtbl): IUnknown(IUnknownVtbl) { + fn CallEngineSynchronize( + pInFrame: *const c_void, + ulInFrameSize: ULONG, + ppCoMemOutFrame: *mut *mut c_void, + pulOutFrameSize: *mut ULONG, + ) -> HRESULT, + fn CallEngineImmediate( + pInFrame: *const c_void, + ulInFrameSize: ULONG, + ppCoMemOutFrame: *mut *mut c_void, + pulOutFrameSize: *mut ULONG, + ) -> HRESULT, +}} +pub use um::sapiddk51::{ + LIBID_SpeechDDKLib, + CLSID_SpDataKey, + CLSID_SpObjectTokenEnum, + CLSID_SpPhraseBuilder, + CLSID_SpITNProcessor, + CLSID_SpGrammarCompiler, +}; +extern { + pub static CLSID_SpW3CGrammarCompiler: CLSID; +} +pub use um::sapiddk51::CLSID_SpGramCompBackend; diff --git a/bash-5.1/vendor/winapi/src/um/sapiddk51.rs b/bash-5.1/vendor/winapi/src/um/sapiddk51.rs new file mode 100644 index 0000000000000000000000000000000000000000..0607cebfb4221e89a11d2c943639c1aeff0441bd --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sapiddk51.rs @@ -0,0 +1,651 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_char, c_float, c_long, c_void}; +use shared::guiddef::{CLSID, GUID, IID, REFGUID}; +use shared::minwindef::{BOOL, BYTE, DWORD, ULONG, USHORT, WORD}; +use shared::mmreg::WAVEFORMATEX; +use shared::windef::HWND; +use um::oaidl::VARIANT; +use um::objidlbase::IStream; +use um::sapi::*; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, HRESULT, LONG, LPCWSTR, LPWSTR, PVOID, ULONGLONG, WCHAR}; +pub const SPRECOEXTENSION: &'static str = "RecoExtension"; +pub const SPALTERNATESCLSID: &'static str = "AlternatesCLSID"; +RIDL!{#[uuid(0xf8e690f0, 0x39cb, 0x4843, 0xb8, 0xd7, 0xc8, 0x46, 0x96, 0xe1, 0x11, 0x9d)] +interface ISpTokenUI(ISpTokenUIVtbl): IUnknown(IUnknownVtbl) { + fn IsUISupported( + pszTypeOfUI: LPCWSTR, + pvExtraData: *mut c_void, + cbExtraData: ULONG, + punkObject: *mut IUnknown, + pfSupported: *mut BOOL, + ) -> HRESULT, + fn DisplayUI( + hwndParent: HWND, + pszTitle: LPCWSTR, + pszTypeOfUI: LPCWSTR, + pvExtraData: *mut c_void, + cbExtraData: ULONG, + pToken: *mut ISpObjectToken, + punkObject: *mut IUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x06b64f9f, 0x7fda, 0x11d2, 0xb4, 0xf2, 0x00, 0xc0, 0x4f, 0x79, 0x73, 0x96)] +interface ISpObjectTokenEnumBuilder(ISpObjectTokenEnumBuilderVtbl): + IEnumSpObjectTokens(IEnumSpObjectTokensVtbl) { + fn SetAttribs( + pszReqAttribs: LPCWSTR, + pszOptAttribs: LPCWSTR, + ) -> HRESULT, + fn AddTokens( + cTokens: ULONG, + pToken: *mut *mut ISpObjectToken, + ) -> HRESULT, + fn AddTokensFromDataKey( + pDataKey: *mut ISpDataKey, + pszSubKey: LPCWSTR, + pszCategoryId: LPCWSTR, + ) -> HRESULT, + fn AddTokensFromTokenEnum( + pTokenEnum: *mut IEnumSpObjectTokens, + ) -> HRESULT, + fn Sort( + pszTokenIdToListFirst: LPCWSTR, + ) -> HRESULT, +}} +DECLARE_HANDLE!{SPWORDHANDLE, SPWORDHANDLE__} +DECLARE_HANDLE!{SPRULEHANDLE, SPRULEHANDLE__} +DECLARE_HANDLE!{SPGRAMMARHANDLE, SPGRAMMARHANDLE__} +DECLARE_HANDLE!{SPRECOCONTEXTHANDLE, SPRECOCONTEXTHANDLE__} +DECLARE_HANDLE!{SPPHRASERULEHANDLE, SPPHRASERULEHANDLE__} +DECLARE_HANDLE!{SPPHRASEPROPERTYHANDLE, SPPHRASEPROPERTYHANDLE__} +DECLARE_HANDLE!{SPTRANSITIONID, SPTRANSITIONID__} +RIDL!{#[uuid(0xf4711347, 0xe608, 0x11d2, 0xa0, 0x86, 0x00, 0xc0, 0x4f, 0x8e, 0xf9, 0xb5)] +interface ISpErrorLog(ISpErrorLogVtbl): IUnknown(IUnknownVtbl) { + fn AddError( + lLineNumber: c_long, + hr: HRESULT, + pszDescription: LPCWSTR, + pszHelpFile: LPCWSTR, + dwHelpContext: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb1e29d58, 0xa675, 0x11d2, 0x83, 0x02, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0xc0)] +interface ISpGrammarCompiler(ISpGrammarCompilerVtbl): IUnknown(IUnknownVtbl) { + fn CompileStream( + pSource: *mut IStream, + pDest: *mut IStream, + pHeader: *mut IStream, + pReserved: *mut IUnknown, + pErrorLog: *mut ISpErrorLog, + dwFlags: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3ddca27c, 0x665c, 0x4786, 0x9f, 0x97, 0x8c, 0x90, 0xc3, 0x48, 0x8b, 0x61)] +interface ISpGramCompBackend(ISpGramCompBackendVtbl): ISpGrammarBuilder(ISpGrammarBuilderVtbl) { + fn SetSaveObjects( + pStream: *mut IStream, + pErrorLog: *mut ISpErrorLog, + ) -> HRESULT, + fn InitFromBinaryGrammar( + pBinaryData: *const SPBINARYGRAMMAR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x12d7360f, 0xa1c9, 0x11d3, 0xbc, 0x90, 0x00, 0xc0, 0x4f, 0x72, 0xdf, 0x9f)] +interface ISpITNProcessor(ISpITNProcessorVtbl): IUnknown(IUnknownVtbl) { + fn LoadITNGrammar( + pszCLSID: LPWSTR, + ) -> HRESULT, + fn ITNPhrase( + pPhrase: *mut ISpPhraseBuilder, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x88a3342a, 0x0bed, 0x4834, 0x92, 0x2b, 0x88, 0xd4, 0x31, 0x73, 0x16, 0x2f)] +interface ISpPhraseBuilder(ISpPhraseBuilderVtbl): ISpPhrase(ISpPhraseVtbl) { + fn InitFromPhrase( + pPhrase: *const SPPHRASE, + ) -> HRESULT, + fn InitFromSerializedPhrase( + pPhrase: *const SPSERIALIZEDPHRASE, + ) -> HRESULT, + fn AddElements( + cElements: ULONG, + pElement: *const SPPHRASEELEMENT, + ) -> HRESULT, + fn AddRules( + hParent: SPPHRASERULEHANDLE, + pRule: *const SPPHRASERULE, + phNewRule: *mut SPPHRASERULEHANDLE, + ) -> HRESULT, + fn AddProperties( + hParent: SPPHRASEPROPERTYHANDLE, + pProperty: *const SPPHRASEPROPERTY, + phNewProperty: *mut SPPHRASEPROPERTYHANDLE, + ) -> HRESULT, + fn AddReplacements( + cReplacements: ULONG, + pReplacements: *const SPPHRASEREPLACEMENT, + ) -> HRESULT, +}} +pub type ISpTask = *mut c_void; +pub type ISpThreadTask = *mut c_void; +RIDL!{#[uuid(0xa6be4d73, 0x4403, 0x4358, 0xb2, 0x2d, 0x03, 0x46, 0xe2, 0x3b, 0x17, 0x64)] +interface ISpThreadControl(ISpThreadControlVtbl): ISpNotifySink(ISpNotifySinkVtbl) { + fn StartThread( + dwFlags: DWORD, + phwnd: *mut HWND, + ) -> HRESULT, + fn WaitForThreadDone( + fForceStop: BOOL, + phrThreadResult: *mut HRESULT, + msTimeOut: ULONG, + ) -> HRESULT, + fn TerminateThread() -> HRESULT, + fn ThreadHandle() -> HANDLE, + fn ThreadId() -> DWORD, + fn NotifyEvent() -> HANDLE, + fn WindowHandle() -> HWND, + fn ThreadCompleteEvent() -> HANDLE, + fn ExitThreadEvent() -> HANDLE, +}} +STRUCT!{struct SPTMTHREADINFO { + lPoolSize: c_long, + lPriority: c_long, + ulConcurrencyLimit: ULONG, + ulMaxQuickAllocThreads: ULONG, +}} +RIDL!{#[uuid(0x2baeef81, 0x2ca3, 0x4331, 0x98, 0xf3, 0x26, 0xec, 0x5a, 0xbe, 0xfb, 0x03)] +interface ISpTaskManager(ISpTaskManagerVtbl): IUnknown(IUnknownVtbl) { + fn SetThreadPoolInfo( + pPoolInfo: *const SPTMTHREADINFO, + ) -> HRESULT, + fn GetThreadPoolInfo( + pPoolInfo: *mut SPTMTHREADINFO, + ) -> HRESULT, + fn QueueTask( + pTask: *mut ISpTask, + pvTaskData: *mut c_void, + hCompEvent: HANDLE, + pdwGroupId: *mut DWORD, + pTaskID: *mut DWORD, + ) -> HRESULT, + fn CreateReoccurringTask( + pTask: *mut ISpTask, + pvTaskData: *mut c_void, + hCompEvent: HANDLE, + ppTaskCtrl: *mut *mut ISpNotifySink, + ) -> HRESULT, + fn CreateThreadControl( + pTask: *mut ISpThreadTask, + pvTaskData: *mut c_void, + nPriority: c_long, + ppTaskCtrl: *mut *mut ISpThreadControl, + ) -> HRESULT, + fn TerminateTask( + dwGroupId: DWORD, + ulWaitPeriod: ULONG, + ) -> HRESULT, +}} +ENUM!{enum SPVSKIPTYPE { + SPVST_SENTENCE = 1 << 0, +}} +ENUM!{enum SPVESACTIONS { + SPVES_CONTINUE = 0, + SPVES_ABORT = 1 << 0, + SPVES_SKIP = 1 << 1, + SPVES_RATE = 1 << 2, + SPVES_VOLUME = 1 << 3, +}} +RIDL!{#[uuid(0x9880499b, 0xcce9, 0x11d2, 0xb5, 0x03, 0x00, 0xc0, 0x4f, 0x79, 0x73, 0x96)] +interface ISpTTSEngineSite(ISpTTSEngineSiteVtbl): ISpEventSink(ISpEventSinkVtbl) { + fn GetActions() -> DWORD, + fn Write( + pBuff: *const c_void, + cb: ULONG, + pcbWritten: *mut ULONG, + ) -> HRESULT, + fn GetRate( + pRateAdjust: *mut c_long, + ) -> HRESULT, + fn GetVolume(pusVolume: *mut USHORT, + ) -> HRESULT, + fn GetSkipInfo( + peType: *mut SPVSKIPTYPE, + plNumItems: *mut c_long, + ) -> HRESULT, + fn CompleteSkip( + ulNumSkipped: c_long, + ) -> HRESULT, +}} +STRUCT!{struct SPVTEXTFRAG { + pNext: *mut SPVTEXTFRAG, + State: SPVSTATE, + pTextStart: LPCWSTR, + ulTextLen: ULONG, + ulTextSrcOffset: ULONG, +}} +RIDL!{#[uuid(0xa74d7c8e, 0x4cc5, 0x4f2f, 0xa6, 0xeb, 0x80, 0x4d, 0xee, 0x18, 0x50, 0x0e)] +interface ISpTTSEngine(ISpTTSEngineVtbl): IUnknown(IUnknownVtbl) { + fn Speak( + dwSpeakFlags: DWORD, + rguidFormatId: REFGUID, + pWaveFormatEx: *const WAVEFORMATEX, + pTextFragList: *const SPVTEXTFRAG, + pOutputSite: *mut ISpTTSEngineSite, + ) -> HRESULT, + fn GetOutputFormat( + pTargetFmtId: *const GUID, + pTargetWaveFormatEx: *const WAVEFORMATEX, + pOutputFormatId: *mut GUID, + ppCoMemOutputWaveFormatEx: *mut WAVEFORMATEX, + ) -> HRESULT, +}} +STRUCT!{struct SPWORDENTRY { + hWord: SPWORDHANDLE, + LangID: WORD, + pszDisplayText: *mut WCHAR, + pszLexicalForm: *mut WCHAR, + aPhoneId: *mut SPPHONEID, + pvClientContext: *mut c_void, +}} +STRUCT!{struct SPRULEENTRY { + hRule: SPRULEHANDLE, + hInitialState: SPSTATEHANDLE, + Attributes: DWORD, + pvClientRuleContext: *mut c_void, + pvClientGrammarContext: *mut c_void, +}} +ENUM!{enum SPTRANSITIONTYPE { + SPTRANSEPSILON = 0, + SPTRANSWORD, + SPTRANSRULE, + SPTRANSTEXTBUF, + SPTRANSWILDCARD, + SPTRANSDICTATION, +}} +STRUCT!{struct SPTRANSITIONENTRY_u_s1 { + hRuleInitialState: SPSTATEHANDLE, + hRule: SPRULEHANDLE, + pvClientRuleContext: *mut c_void, +}} +STRUCT!{struct SPTRANSITIONENTRY_u_s2 { + hWord: SPWORDHANDLE, + pvClientWordContext: *mut c_void, +}} +UNION!{union SPTRANSITIONENTRY_u { + [usize; 3], + s1 s1_mut: SPTRANSITIONENTRY_u_s1, + s2 s2_mut: SPTRANSITIONENTRY_u_s2, + pvGrammarCookie pvGrammarCookie_mut: *mut c_void, +}} +STRUCT!{struct SPTRANSITIONENTRY { + ID: SPTRANSITIONID, + hNextState: SPSTATEHANDLE, + Type: BYTE, + RequiredConfidence: c_char, + fHasProperty: DWORD, + Weight: c_float, + u: SPTRANSITIONENTRY_u, +}} +STRUCT!{struct SPTRANSITIONPROPERTY { + pszName: LPCWSTR, + ulId: ULONG, + pszValue: LPCWSTR, + vValue: VARIANT, +}} +STRUCT!{struct SPSTATEINFO { + cAllocatedEntries: ULONG, + pTransitions: *mut SPTRANSITIONENTRY, + cEpsilons: ULONG, + cRules: ULONG, + cWords: ULONG, + cSpecialTransitions: ULONG, +}} +STRUCT!{struct SPPATHENTRY { + hTransition: SPTRANSITIONID, + elem: SPPHRASEELEMENT, +}} +RIDL!{#[uuid(0x6a6ffad8, 0x78b6, 0x473d, 0xb8, 0x44, 0x98, 0x15, 0x2e, 0x4f, 0xb1, 0x6b)] +interface ISpCFGInterpreterSite(ISpCFGInterpreterSiteVtbl): IUnknown(IUnknownVtbl) { + fn AddTextReplacement( + pReplace: *mut SPPHRASEREPLACEMENT, + ) -> HRESULT, + fn AddProperty( + pProperty: *const SPPHRASEPROPERTY, + ) -> HRESULT, + fn GetResourceValue( + pszResourceName: LPCWSTR, + ppCoMemResource: *mut LPWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf3d3f926, 0x11fc, 0x11d3, 0xbb, 0x97, 0x00, 0xc0, 0x4f, 0x8e, 0xe6, 0xc0)] +interface ISpCFGInterpreter(ISpCFGInterpreterVtbl): IUnknown(IUnknownVtbl) { + fn InitGrammar( + pszGrammarName: LPCWSTR, + pvGrammarData: *mut *const c_void, + ) -> HRESULT, + fn Interpret( + pPhrase: *mut ISpPhraseBuilder, + ulFirstElement: *const ULONG, + ulCountOfElements: *const ULONG, + pSite: *mut ISpCFGInterpreterSite, + ) -> HRESULT, +}} +ENUM!{enum SPCFGNOTIFY { + SPCFGN_ADD, + SPCFGN_REMOVE, + SPCFGN_INVALIDATE, + SPCFGN_ACTIVATE, + SPCFGN_DEACTIVATE, +}} +ENUM!{enum SPRESULTTYPE { + SPRT_CFG = 0, + SPRT_SLM = 1, + SPRT_PROPRIETARY = 2, + SPRT_FALSE_RECOGNITION = 1 << 2, +}} +STRUCT!{struct SPPHRASEALT { + pPhrase: *mut ISpPhraseBuilder, + ulStartElementInParent: ULONG, + cElementsInParent: ULONG, + cElementsInAlternate: ULONG, + pvAltExtra: *mut c_void, + cbAltExtra: ULONG, +}} +STRUCT!{struct SPRECORESULTINFO { + cbSize: ULONG, + eResultType: SPRESULTTYPE, + fHypothesis: BOOL, + fProprietaryAutoPause: BOOL, + ullStreamPosStart: ULONGLONG, + ullStreamPosEnd: ULONGLONG, + hGrammar: SPGRAMMARHANDLE, + ulSizeEngineData: ULONG, + pvEngineData: *mut c_void, + pPhrase: *mut ISpPhraseBuilder, + aPhraseAlts: *mut SPPHRASEALT, + ulNumAlts: ULONG, +}} +ENUM!{enum SPWORDINFOOPT { + SPWIO_NONE = 0, + SPWIO_WANT_TEXT = 1, +}} +ENUM!{enum SPRULEINFOOPT { + SPRIO_NONE = 0, +}} +STRUCT!{struct SPPARSEINFO { + cbSize: ULONG, + hRule: SPRULEHANDLE, + ullAudioStreamPosition: ULONGLONG, + ulAudioSize: ULONG, + cTransitions: ULONG, + pPath: *mut SPPATHENTRY, + SREngineID: GUID, + ulSREnginePrivateDataSize: ULONG, + pSREnginePrivateData: *const BYTE, + fHypothesis: BOOL, +}} +RIDL!{#[uuid(0x3b414aec, 0x720c, 0x4883, 0xb9, 0xef, 0x17, 0x8c, 0xd3, 0x94, 0xfb, 0x3a)] +interface ISpSREngineSite(ISpSREngineSiteVtbl): IUnknown(IUnknownVtbl) { + fn Read( + pv: *mut c_void, + cb: ULONG, + pcbRead: *mut ULONG, + ) -> HRESULT, + fn DataAvailable( + pcb: *mut ULONG, + ) -> HRESULT, + fn SetBufferNotifySize( + cbSize: ULONG, + ) -> HRESULT, + fn ParseFromTransitions( + pParseInfo: *const SPPARSEINFO, + ppNewPhrase: *mut *mut ISpPhraseBuilder, + ) -> HRESULT, + fn Recognition( + pResultInfo: *const SPRECORESULTINFO, + ) -> HRESULT, + fn AddEvent( + pEvent: *const SPEVENT, + hSAPIRecoContext: SPRECOCONTEXTHANDLE, + ) -> HRESULT, + fn Synchronize( + ullProcessedThruPos: ULONGLONG, + ) -> HRESULT, + fn GetWordInfo( + pWordEntry: *mut SPWORDENTRY, + Options: SPWORDINFOOPT, + ) -> HRESULT, + fn SetWordClientContext( + hWord: SPWORDHANDLE, + pvClientContext: *mut c_void, + ) -> HRESULT, + fn GetRuleInfo( + pRuleEntry: *mut SPRULEENTRY, + Options: SPRULEINFOOPT, + ) -> HRESULT, + fn SetRuleClientContext( + hRule: SPRULEHANDLE, + pvClientContext: *mut c_void, + ) -> HRESULT, + fn GetStateInfo( + hState: SPSTATEHANDLE, + pStateInfo: *mut SPSTATEINFO, + ) -> HRESULT, + fn GetResource( + hRule: SPRULEHANDLE, + pszResourceName: LPCWSTR, + ppCoMemResource: *mut LPWSTR, + ) -> HRESULT, + fn GetTransitionProperty( + ID: SPTRANSITIONID, + ppCoMemProperty: *mut *mut SPTRANSITIONPROPERTY, + ) -> HRESULT, + fn IsAlternate( + hRule: SPRULEHANDLE, + hAltRule: SPRULEHANDLE, + ) -> HRESULT, + fn GetMaxAlternates( + hRule: SPRULEHANDLE, + pulNumAlts: *mut ULONG, + ) -> HRESULT, + fn GetContextMaxAlternates( + hContext: SPRECOCONTEXTHANDLE, + pulNumAlts: *mut ULONG, + ) -> HRESULT, + fn UpdateRecoPos( + ullCurrentRecoPos: ULONGLONG, + ) -> HRESULT, +}} +ENUM!{enum SPPROPSRC { + SPPROPSRC_RECO_INST, + SPPROPSRC_RECO_CTX, + SPPROPSRC_RECO_GRAMMAR, +}} +RIDL!{#[uuid(0x2f472991, 0x854b, 0x4465, 0xb6, 0x13, 0xfb, 0xaf, 0xb3, 0xad, 0x8e, 0xd8)] +interface ISpSREngine(ISpSREngineVtbl): IUnknown(IUnknownVtbl) { + fn SetSite( + pSite: *mut ISpSREngineSite, + ) -> HRESULT, + fn GetInputAudioFormat( + pguidSourceFormatId: *const GUID, + pSourceWaveFormatEx: *const WAVEFORMATEX, + pguidDesiredFormatId: *mut GUID, + ppCoMemDesiredWaveFormatEx: *mut WAVEFORMATEX, + ) -> HRESULT, + fn RecognizeStream( + rguidFmtId: REFGUID, + pWaveFormatEx: *const WAVEFORMATEX, + hRequestSync: HANDLE, + hDataAvailable: HANDLE, + hExit: HANDLE, + fNewAudioStream: BOOL, + fRealTimeAudio: BOOL, + pAudioObjectToken: *mut ISpObjectToken, + ) -> HRESULT, + fn SetRecoProfile( + pProfile: *mut ISpObjectToken, + ) -> HRESULT, + fn OnCreateGrammar( + pvEngineRecoContext: *mut c_void, + hSAPIGrammar: SPGRAMMARHANDLE, + ppvEngineGrammarContext: *mut *mut c_void, + ) -> HRESULT, + fn OnDeleteGrammar( + pvEngineGrammar: *mut c_void, + ) -> HRESULT, + fn LoadProprietaryGrammar( + pvEngineGrammar: *mut c_void, + rguidParam: REFGUID, + pszStringParam: LPCWSTR, + pvDataParam: *const c_void, + ulDataSize: ULONG, + Options: SPLOADOPTIONS, + ) -> HRESULT, + fn UnloadProprietaryGrammar( + pvEngineGrammar: *mut c_void, + ) -> HRESULT, + fn SetProprietaryRuleState( + pvEngineGrammar: *mut c_void, + pszName: LPCWSTR, + pReserved: *mut c_void, + NewState: SPRULESTATE, + pcRulesChanged: *mut ULONG, + ) -> HRESULT, + fn SetProprietaryRuleIdState( + pvEngineGrammar: *mut c_void, + dwRuleId: DWORD, + NewState: SPRULESTATE, + ) -> HRESULT, + fn LoadSLM( + pvEngineGrammar: *mut c_void, + pszTopicName: LPCWSTR, + ) -> HRESULT, + fn UnloadSLM( + pvEngineGrammar: *mut c_void, + ) -> HRESULT, + fn SetSLMState( + pvEngineGrammar: *mut c_void, + NewState: SPRULESTATE, + ) -> HRESULT, + fn SetWordSequenceData( + pvEngineGrammar: *mut c_void, + pText: *const WCHAR, + cchText: ULONG, + pInfo: *const SPTEXTSELECTIONINFO, + ) -> HRESULT, + fn SetTextSelection( + pvEngineGrammar: *mut c_void, + pInfo: *const SPTEXTSELECTIONINFO, + ) -> HRESULT, + fn IsPronounceable( + pvEngineGrammar: *mut c_void, + pszWord: LPCWSTR, + pWordPronounceable: *mut SPWORDPRONOUNCEABLE, + ) -> HRESULT, + fn OnCreateRecoContext( + hSAPIRecoContext: SPRECOCONTEXTHANDLE, + ppvEngineContext: *mut *mut c_void, + ) -> HRESULT, + fn OnDeleteRecoContext( + pvEngineContext: *mut c_void, + ) -> HRESULT, + fn OnPrivateCall( + pvEngineContext: *mut c_void, + pCallFrame: PVOID, + ulCallFrameSize: ULONG, + ) -> HRESULT, + fn SetAdaptationData( + pvEngineContext: *mut c_void, + pAdaptationData: *const WCHAR, + cch: ULONG, + ) -> HRESULT, + fn SetPropertyNum( + eSrc: SPPROPSRC, + pvSrcObj: *mut c_void, + pName: *const WCHAR, + lValue: LONG, + ) -> HRESULT, + fn GetPropertyNum( + eSrc: SPPROPSRC, + pvSrcObj: *mut c_void, + pName: *const WCHAR, + lValue: *mut LONG, + ) -> HRESULT, + fn SetPropertyString( + eSrc: SPPROPSRC, + pvSrcObj: *mut c_void, + pName: LPCWSTR, + pValue: LPCWSTR, + ) -> HRESULT, + fn GetPropertyString( + eSrc: SPPROPSRC, + pvSrcObj: *mut c_void, + pName: LPCWSTR, + ppCoMemValue: *mut LPWSTR, + ) -> HRESULT, + fn SetGrammarState( + pvEngineGrammar: *mut c_void, + eGrammarState: SPGRAMMARSTATE, + ) -> HRESULT, + fn WordNotify( + Action: SPCFGNOTIFY, + cWords: ULONG, + pWords: *const SPWORDENTRY, + ) -> HRESULT, + fn RuleNotify( + Action: SPCFGNOTIFY, + cRules: ULONG, + pRules: *const SPRULEENTRY, + ) -> HRESULT, + fn PrivateCallEx( + pvEngineContext: *mut c_void, + pInCallFrame: *const c_void, + ulInCallFrameSize: ULONG, + ppvCoMemResponse: *mut *mut c_void, + pulResponseSize: *mut ULONG, + ) -> HRESULT, + fn SetContextState( + pvEngineContext: *mut c_void, + eContextState: SPCONTEXTSTATE, + ) -> HRESULT, +}} +STRUCT!{struct SPPHRASEALTREQUEST { + ulStartElement: ULONG, + cElements: ULONG, + ulRequestAltCount: ULONG, + pvResultExtra: *mut c_void, + cbResultExtra: ULONG, + pPhrase: *mut ISpPhrase, + pRecoContext: *mut ISpRecoContext, +}} +RIDL!{#[uuid(0x8e7c791e, 0x4467, 0x11d3, 0x97, 0x23, 0x00, 0xc0, 0x4f, 0x72, 0xdb, 0x08)] +interface _ISpPrivateEngineCall(_ISpPrivateEngineCallVtbl): IUnknown(IUnknownVtbl) { + fn CallEngine( + pCallFrame: *mut c_void, + ulCallFrameSize: ULONG, + ) -> HRESULT, + fn CallEngineEx( + pInFrame: *const c_void, + ulInFrameSize: ULONG, + ppCoMemOutFrame: *mut *mut c_void, + pulOutFrameSize: *mut ULONG, + ) -> HRESULT, +}} +extern { + pub static LIBID_SpeechDDKLib: IID; + pub static CLSID_SpDataKey: CLSID; +} +RIDL!{#[uuid(0xd9f6ee60, 0x58c9, 0x458b, 0x88, 0xe1, 0x2f, 0x90, 0x8f, 0xd7, 0xf8, 0x7c)] +class SpDataKey;} +extern { + pub static CLSID_SpObjectTokenEnum: CLSID; + pub static CLSID_SpPhraseBuilder: CLSID; + pub static CLSID_SpITNProcessor: CLSID; + pub static CLSID_SpGrammarCompiler: CLSID; + pub static CLSID_SpGramCompBackend: CLSID; +} diff --git a/bash-5.1/vendor/winapi/src/um/schannel.rs b/bash-5.1/vendor/winapi/src/um/schannel.rs new file mode 100644 index 0000000000000000000000000000000000000000..5ec1ac008e318bc09c34575dcc32ed5f32950657 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/schannel.rs @@ -0,0 +1,339 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Public Definitions for SCHANNEL Security Provider +use shared::guiddef::GUID; +use shared::minwindef::{BYTE, DWORD, PBYTE, WORD}; +use shared::windef::HWND; +use um::wincrypt::{ALG_ID, HCERTSTORE, HCRYPTPROV, PCCERT_CONTEXT, PCERT_NAME_BLOB}; +use um::winnt::{HRESULT, LPWSTR, PVOID, WCHAR}; +pub const UNISP_NAME: &'static str = "Microsoft Unified Security Protocol Provider"; +pub const SSL2SP_NAME: &'static str = "Microsoft SSL 2.0"; +pub const SSL3SP_NAME: &'static str = "Microsoft SSL 3.0"; +pub const TLS1SP_NAME: &'static str = "Microsoft TLS 1.0"; +pub const PCT1SP_NAME: &'static str = "Microsoft PCT 1.0"; +pub const SCHANNEL_NAME: &'static str = "Schannel"; +ENUM!{enum eTlsSignatureAlgorithm { + TlsSignatureAlgorithm_Anonymous = 0, + TlsSignatureAlgorithm_Rsa = 1, + TlsSignatureAlgorithm_Dsa = 2, + TlsSignatureAlgorithm_Ecdsa = 3, +}} +ENUM!{enum eTlsHashAlgorithm { + TlsHashAlgorithm_None = 0, + TlsHashAlgorithm_Md5 = 1, + TlsHashAlgorithm_Sha1 = 2, + TlsHashAlgorithm_Sha224 = 3, + TlsHashAlgorithm_Sha256 = 4, + TlsHashAlgorithm_Sha384 = 5, + TlsHashAlgorithm_Sha512 = 6, +}} +pub const UNISP_RPC_ID: DWORD = 14; +STRUCT!{struct SecPkgContext_RemoteCredentialInfo { + cbCertificateChain: DWORD, + pbCertificateChain: PBYTE, + cCertificates: DWORD, + fFlags: DWORD, + dwBits: DWORD, +}} +pub type PSecPkgContext_RemoteCredentialInfo = *mut SecPkgContext_RemoteCredentialInfo; +pub type SecPkgContext_RemoteCredenitalInfo = SecPkgContext_RemoteCredentialInfo; +pub type PSecPkgContext_RemoteCredenitalInfo = *mut SecPkgContext_RemoteCredentialInfo; +pub const RCRED_STATUS_NOCRED: DWORD = 0x00000000; +pub const RCRED_CRED_EXISTS: DWORD = 0x00000001; +pub const RCRED_STATUS_UNKNOWN_ISSUER: DWORD = 0x00000002; +STRUCT!{struct SecPkgContext_LocalCredentialInfo { + cbCertificateChain: DWORD, + pbCertificateChain: PBYTE, + cCertificates: DWORD, + fFlags: DWORD, + dwBits: DWORD, +}} +pub type PSecPkgContext_LocalCredentialInfo = *mut SecPkgContext_LocalCredentialInfo; +pub type SecPkgContext_LocalCredenitalInfo = SecPkgContext_LocalCredentialInfo; +pub type PSecPkgContext_LocalCredenitalInfo = *mut SecPkgContext_LocalCredentialInfo; +pub const LCRED_STATUS_NOCRED: DWORD = 0x00000000; +pub const LCRED_CRED_EXISTS: DWORD = 0x00000001; +pub const LCRED_STATUS_UNKNOWN_ISSUER: DWORD = 0x00000002; +STRUCT!{struct SecPkgContext_ClientCertPolicyResult { + dwPolicyResult: HRESULT, + guidPolicyId: GUID, +}} +pub type PSecPkgContext_ClientCertPolicyResult = *mut SecPkgContext_ClientCertPolicyResult; +STRUCT!{struct SecPkgContext_IssuerListInfoEx { + aIssuers: PCERT_NAME_BLOB, + cIssuers: DWORD, +}} +pub type PSecPkgContext_IssuerListInfoEx = *mut SecPkgContext_IssuerListInfoEx; +STRUCT!{struct SecPkgContext_ConnectionInfo { + dwProtocol: DWORD, + aiCipher: ALG_ID, + dwCipherStrength: DWORD, + aiHash: ALG_ID, + dwHashStrength: DWORD, + aiExch: ALG_ID, + dwExchStrength: DWORD, +}} +pub type PSecPkgContext_ConnectionInfo = *mut SecPkgContext_ConnectionInfo; +pub const SZ_ALG_MAX_SIZE: usize = 64; +pub const SECPKGCONTEXT_CIPHERINFO_V1: DWORD = 1; +STRUCT!{struct SecPkgContext_CipherInfo { + dwVersion: DWORD, + dwProtocol: DWORD, + dwCipherSuite: DWORD, + dwBaseCipherSuite: DWORD, + szCipherSuite: [WCHAR; SZ_ALG_MAX_SIZE], + szCipher: [WCHAR; SZ_ALG_MAX_SIZE], + dwCipherLen: DWORD, + dwCipherBlockLen: DWORD, + szHash: [WCHAR; SZ_ALG_MAX_SIZE], + dwHashLen: DWORD, + szExchange: [WCHAR; SZ_ALG_MAX_SIZE], + dwMinExchangeLen: DWORD, + dwMaxExchangeLen: DWORD, + szCertificate: [WCHAR; SZ_ALG_MAX_SIZE], + dwKeyType: DWORD, +}} +pub type PSecPkgContext_CipherInfo = *mut SecPkgContext_CipherInfo; +STRUCT!{struct SecPkgContext_EapKeyBlock { + rgbKeys: [BYTE; 128], + rgbIVs: [BYTE; 64], +}} +pub type PSecPkgContext_EapKeyBlock = *mut SecPkgContext_EapKeyBlock; +STRUCT!{struct SecPkgContext_MappedCredAttr { + dwAttribute: DWORD, + pvBuffer: PVOID, +}} +pub type PSecPkgContext_MappedCredAttr = *mut SecPkgContext_MappedCredAttr; +pub const SSL_SESSION_RECONNECT: DWORD = 1; +STRUCT!{struct SecPkgContext_SessionInfo { + dwFlags: DWORD, + cbSessionId: DWORD, + rgbSessionId: [BYTE; 32], +}} +pub type PSecPkgContext_SessionInfo = *mut SecPkgContext_SessionInfo; +STRUCT!{struct SecPkgContext_SessionAppData { + dwFlags: DWORD, + cbAppData: DWORD, + pbAppData: PBYTE, +}} +pub type PSecPkgContext_SessionAppData = *mut SecPkgContext_SessionAppData; +STRUCT!{struct SecPkgContext_EapPrfInfo { + dwVersion: DWORD, + cbPrfData: DWORD, + pbPrfData: PBYTE, +}} +pub type PSecPkgContext_EapPrfInfo = *mut SecPkgContext_EapPrfInfo; +STRUCT!{struct SecPkgContext_SupportedSignatures { + cSignatureAndHashAlgorithms: WORD, + pSignatureAndHashAlgorithms: *mut WORD, +}} +pub type PSecPkgContext_SupportedSignatures = *mut SecPkgContext_SupportedSignatures; +STRUCT!{struct SecPkgContext_Certificates { + cCertificates: DWORD, + cbCertificateChain: DWORD, + pbCertificateChain: PBYTE, +}} +pub type PSecPkgContext_Certificates = *mut SecPkgContext_Certificates; +STRUCT!{struct SecPkgContext_CertInfo { + dwVersion: DWORD, + cbSubjectName: DWORD, + pwszSubjectName: LPWSTR, + cbIssuerName: DWORD, + pwszIssuerName: LPWSTR, + dwKeySize: DWORD, +}} +pub type PSecPkgContext_CertInfo = *mut SecPkgContext_CertInfo; +pub const KERN_CONTEXT_CERT_INFO_V1: DWORD = 0x00000000; +STRUCT!{struct SecPkgContext_UiInfo { + hParentWindow: HWND, +}} +pub type PSecPkgContext_UiInfo = *mut SecPkgContext_UiInfo; +STRUCT!{struct SecPkgContext_EarlyStart { + dwEarlyStartFlags: DWORD, +}} +pub type PSecPkgContext_EarlyStart = *mut SecPkgContext_EarlyStart; +pub const ENABLE_TLS_CLIENT_EARLY_START: DWORD = 0x00000001; +pub const SCH_CRED_V1: DWORD = 0x00000001; +pub const SCH_CRED_V2: DWORD = 0x00000002; +pub const SCH_CRED_VERSION: DWORD = 0x00000002; +pub const SCH_CRED_V3: DWORD = 0x00000003; +pub const SCHANNEL_CRED_VERSION: DWORD = 0x00000004; +pub const SCHANNEL_SECRET_TYPE_CAPI: DWORD = 0x00000001; +pub const SCHANNEL_SECRET_PRIVKEY: DWORD = 0x00000002; +pub const SCH_CRED_X509_CERTCHAIN: DWORD = 0x00000001; +pub const SCH_CRED_X509_CAPI: DWORD = 0x00000002; +pub const SCH_CRED_CERT_CONTEXT: DWORD = 0x00000003; +pub enum _HMAPPER {} +STRUCT!{struct SCHANNEL_CRED { + dwVersion: DWORD, + cCreds: DWORD, + paCred: *mut PCCERT_CONTEXT, + hRootStore: HCERTSTORE, + cMappers: DWORD, + aphMappers: *mut *mut _HMAPPER, + cSupportedAlgs: DWORD, + palgSupportedAlgs: *mut ALG_ID, + grbitEnabledProtocols: DWORD, + dwMinimumCipherStrength: DWORD, + dwMaximumCipherStrength: DWORD, + dwSessionLifespan: DWORD, + dwFlags: DWORD, + dwCredFormat: DWORD, +}} +pub type PSCHANNEL_CRED = *mut SCHANNEL_CRED; +pub const SCH_CRED_FORMAT_CERT_CONTEXT: DWORD = 0x00000000; +pub const SCH_CRED_FORMAT_CERT_HASH: DWORD = 0x00000001; +pub const SCH_CRED_FORMAT_CERT_HASH_STORE: DWORD = 0x00000002; +pub const SCH_CRED_MAX_STORE_NAME_SIZE: usize = 128; +pub const SCH_CRED_MAX_SUPPORTED_ALGS: DWORD = 256; +pub const SCH_CRED_MAX_SUPPORTED_CERTS: DWORD = 100; +STRUCT!{struct SCHANNEL_CERT_HASH { + dwLength: DWORD, + dwFlags: DWORD, + hProv: HCRYPTPROV, + ShaHash: [BYTE; 20], +}} +pub type PSCHANNEL_CERT_HASH = *mut SCHANNEL_CERT_HASH; +STRUCT!{struct SCHANNEL_CERT_HASH_STORE { + dwLength: DWORD, + dwFlags: DWORD, + hProv: HCRYPTPROV, + ShaHash: [BYTE; 20], + pwszStoreName: [WCHAR; SCH_CRED_MAX_STORE_NAME_SIZE], +}} +pub type PSCHANNEL_CERT_HASH_STORE = *mut SCHANNEL_CERT_HASH_STORE; +pub const SCH_MACHINE_CERT_HASH: DWORD = 0x00000001; +pub const SCH_CRED_NO_SYSTEM_MAPPER: DWORD = 0x00000002; +pub const SCH_CRED_NO_SERVERNAME_CHECK: DWORD = 0x00000004; +pub const SCH_CRED_MANUAL_CRED_VALIDATION: DWORD = 0x00000008; +pub const SCH_CRED_NO_DEFAULT_CREDS: DWORD = 0x00000010; +pub const SCH_CRED_AUTO_CRED_VALIDATION: DWORD = 0x00000020; +pub const SCH_CRED_USE_DEFAULT_CREDS: DWORD = 0x00000040; +pub const SCH_CRED_DISABLE_RECONNECTS: DWORD = 0x00000080; +pub const SCH_CRED_REVOCATION_CHECK_END_CERT: DWORD = 0x00000100; +pub const SCH_CRED_REVOCATION_CHECK_CHAIN: DWORD = 0x00000200; +pub const SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT: DWORD = 0x00000400; +pub const SCH_CRED_IGNORE_NO_REVOCATION_CHECK: DWORD = 0x00000800; +pub const SCH_CRED_IGNORE_REVOCATION_OFFLINE: DWORD = 0x00001000; +pub const SCH_CRED_RESTRICTED_ROOTS: DWORD = 0x00002000; +pub const SCH_CRED_REVOCATION_CHECK_CACHE_ONLY: DWORD = 0x00004000; +pub const SCH_CRED_CACHE_ONLY_URL_RETRIEVAL: DWORD = 0x00008000; +pub const SCH_CRED_MEMORY_STORE_CERT: DWORD = 0x00010000; +pub const SCH_CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE: DWORD = 0x00020000; +pub const SCH_SEND_ROOT_CERT: DWORD = 0x00040000; +pub const SCH_CRED_SNI_CREDENTIAL: DWORD = 0x00080000; +pub const SCH_CRED_SNI_ENABLE_OCSP: DWORD = 0x00100000; +pub const SCH_SEND_AUX_RECORD: DWORD = 0x00200000; +pub const SCH_USE_STRONG_CRYPTO: DWORD = 0x00400000; +pub const SCHANNEL_RENEGOTIATE: DWORD = 0; +pub const SCHANNEL_SHUTDOWN: DWORD = 1; +pub const SCHANNEL_ALERT: DWORD = 2; +pub const SCHANNEL_SESSION: DWORD = 3; +STRUCT!{struct SCHANNEL_ALERT_TOKEN { + dwTokenType: DWORD, + dwAlertType: DWORD, + dwAlertNumber: DWORD, +}} +pub const TLS1_ALERT_WARNING: DWORD = 1; +pub const TLS1_ALERT_FATAL: DWORD = 2; +pub const TLS1_ALERT_CLOSE_NOTIFY: DWORD = 0; +pub const TLS1_ALERT_UNEXPECTED_MESSAGE: DWORD = 10; +pub const TLS1_ALERT_BAD_RECORD_MAC: DWORD = 20; +pub const TLS1_ALERT_DECRYPTION_FAILED: DWORD = 21; +pub const TLS1_ALERT_RECORD_OVERFLOW: DWORD = 22; +pub const TLS1_ALERT_DECOMPRESSION_FAIL: DWORD = 30; +pub const TLS1_ALERT_HANDSHAKE_FAILURE: DWORD = 40; +pub const TLS1_ALERT_BAD_CERTIFICATE: DWORD = 42; +pub const TLS1_ALERT_UNSUPPORTED_CERT: DWORD = 43; +pub const TLS1_ALERT_CERTIFICATE_REVOKED: DWORD = 44; +pub const TLS1_ALERT_CERTIFICATE_EXPIRED: DWORD = 45; +pub const TLS1_ALERT_CERTIFICATE_UNKNOWN: DWORD = 46; +pub const TLS1_ALERT_ILLEGAL_PARAMETER: DWORD = 47; +pub const TLS1_ALERT_UNKNOWN_CA: DWORD = 48; +pub const TLS1_ALERT_ACCESS_DENIED: DWORD = 49; +pub const TLS1_ALERT_DECODE_ERROR: DWORD = 50; +pub const TLS1_ALERT_DECRYPT_ERROR: DWORD = 51; +pub const TLS1_ALERT_EXPORT_RESTRICTION: DWORD = 60; +pub const TLS1_ALERT_PROTOCOL_VERSION: DWORD = 70; +pub const TLS1_ALERT_INSUFFIENT_SECURITY: DWORD = 71; +pub const TLS1_ALERT_INTERNAL_ERROR: DWORD = 80; +pub const TLS1_ALERT_USER_CANCELED: DWORD = 90; +pub const TLS1_ALERT_NO_RENEGOTIATION: DWORD = 100; +pub const TLS1_ALERT_UNSUPPORTED_EXT: DWORD = 110; +pub const TLS1_ALERT_NO_APP_PROTOCOL: DWORD = 120; +pub const SSL_SESSION_ENABLE_RECONNECTS: DWORD = 1; +pub const SSL_SESSION_DISABLE_RECONNECTS: DWORD = 2; +STRUCT!{struct SCHANNEL_SESSION_TOKEN { + dwTokenType: DWORD, + dwFlags: DWORD, +}} +STRUCT!{struct SCHANNEL_CLIENT_SIGNATURE { + cbLength: DWORD, + aiHash: ALG_ID, + cbHash: DWORD, + HashValue: [BYTE; 36], + CertThumbprint: [BYTE; 20], +}} +pub type PSCHANNEL_CLIENT_SIGNATURE = *mut SCHANNEL_CLIENT_SIGNATURE; +pub const SP_PROT_PCT1_SERVER: DWORD = 0x00000001; +pub const SP_PROT_PCT1_CLIENT: DWORD = 0x00000002; +pub const SP_PROT_PCT1: DWORD = SP_PROT_PCT1_SERVER | SP_PROT_PCT1_CLIENT; +pub const SP_PROT_SSL2_SERVER: DWORD = 0x00000004; +pub const SP_PROT_SSL2_CLIENT: DWORD = 0x00000008; +pub const SP_PROT_SSL2: DWORD = SP_PROT_SSL2_SERVER | SP_PROT_SSL2_CLIENT; +pub const SP_PROT_SSL3_SERVER: DWORD = 0x00000010; +pub const SP_PROT_SSL3_CLIENT: DWORD = 0x00000020; +pub const SP_PROT_SSL3: DWORD = SP_PROT_SSL3_SERVER | SP_PROT_SSL3_CLIENT; +pub const SP_PROT_TLS1_SERVER: DWORD = 0x00000040; +pub const SP_PROT_TLS1_CLIENT: DWORD = 0x00000080; +pub const SP_PROT_TLS1: DWORD = SP_PROT_TLS1_SERVER | SP_PROT_TLS1_CLIENT; +pub const SP_PROT_SSL3TLS1_CLIENTS: DWORD = SP_PROT_TLS1_CLIENT | SP_PROT_SSL3_CLIENT; +pub const SP_PROT_SSL3TLS1_SERVERS: DWORD = SP_PROT_TLS1_SERVER | SP_PROT_SSL3_SERVER; +pub const SP_PROT_SSL3TLS1: DWORD = SP_PROT_SSL3 | SP_PROT_TLS1; +pub const SP_PROT_UNI_SERVER: DWORD = 0x40000000; +pub const SP_PROT_UNI_CLIENT: DWORD = 0x80000000; +pub const SP_PROT_UNI: DWORD = SP_PROT_UNI_SERVER | SP_PROT_UNI_CLIENT; +pub const SP_PROT_ALL: DWORD = 0xffffffff; +pub const SP_PROT_NONE: DWORD = 0; +pub const SP_PROT_CLIENTS: DWORD = SP_PROT_PCT1_CLIENT | SP_PROT_SSL2_CLIENT + | SP_PROT_SSL3_CLIENT | SP_PROT_UNI_CLIENT | SP_PROT_TLS1_CLIENT; +pub const SP_PROT_SERVERS: DWORD = SP_PROT_PCT1_SERVER | SP_PROT_SSL2_SERVER + | SP_PROT_SSL3_SERVER | SP_PROT_UNI_SERVER | SP_PROT_TLS1_SERVER; +pub const SP_PROT_TLS1_0_SERVER: DWORD = SP_PROT_TLS1_SERVER; +pub const SP_PROT_TLS1_0_CLIENT: DWORD = SP_PROT_TLS1_CLIENT; +pub const SP_PROT_TLS1_0: DWORD = SP_PROT_TLS1_0_SERVER | SP_PROT_TLS1_0_CLIENT; +pub const SP_PROT_TLS1_1_SERVER: DWORD = 0x00000100; +pub const SP_PROT_TLS1_1_CLIENT: DWORD = 0x00000200; +pub const SP_PROT_TLS1_1: DWORD = SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_1_CLIENT; +pub const SP_PROT_TLS1_2_SERVER: DWORD = 0x00000400; +pub const SP_PROT_TLS1_2_CLIENT: DWORD = 0x00000800; +pub const SP_PROT_TLS1_2: DWORD = SP_PROT_TLS1_2_SERVER | SP_PROT_TLS1_2_CLIENT; +pub const SP_PROT_DTLS_SERVER: DWORD = 0x00010000; +pub const SP_PROT_DTLS_CLIENT: DWORD = 0x00020000; +pub const SP_PROT_DTLS: DWORD = SP_PROT_DTLS_SERVER | SP_PROT_DTLS_CLIENT; +pub const SP_PROT_DTLS1_0_SERVER: DWORD = SP_PROT_DTLS_SERVER; +pub const SP_PROT_DTLS1_0_CLIENT: DWORD = SP_PROT_DTLS_CLIENT; +pub const SP_PROT_DTLS1_0: DWORD = SP_PROT_DTLS1_0_SERVER | SP_PROT_DTLS1_0_CLIENT; +pub const SP_PROT_DTLS1_X_SERVER: DWORD = SP_PROT_DTLS1_0_SERVER; +pub const SP_PROT_DTLS1_X_CLIENT: DWORD = SP_PROT_DTLS1_0_CLIENT; +pub const SP_PROT_DTLS1_X: DWORD = SP_PROT_DTLS1_X_SERVER | SP_PROT_DTLS1_X_CLIENT; +pub const SP_PROT_TLS1_1PLUS_SERVER: DWORD = SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_2_SERVER; +pub const SP_PROT_TLS1_1PLUS_CLIENT: DWORD = SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_2_CLIENT; +pub const SP_PROT_TLS1_1PLUS: DWORD = SP_PROT_TLS1_1PLUS_SERVER | SP_PROT_TLS1_1PLUS_CLIENT; +pub const SP_PROT_TLS1_X_SERVER: DWORD = SP_PROT_TLS1_0_SERVER | SP_PROT_TLS1_1_SERVER + | SP_PROT_TLS1_2_SERVER; +pub const SP_PROT_TLS1_X_CLIENT: DWORD = SP_PROT_TLS1_0_CLIENT | SP_PROT_TLS1_1_CLIENT + | SP_PROT_TLS1_2_CLIENT; +pub const SP_PROT_TLS1_X: DWORD = SP_PROT_TLS1_X_SERVER | SP_PROT_TLS1_X_CLIENT; +pub const SP_PROT_SSL3TLS1_X_CLIENTS: DWORD = SP_PROT_TLS1_X_CLIENT | SP_PROT_SSL3_CLIENT; +pub const SP_PROT_SSL3TLS1_X_SERVERS: DWORD = SP_PROT_TLS1_X_SERVER | SP_PROT_SSL3_SERVER; +pub const SP_PROT_SSL3TLS1_X: DWORD = SP_PROT_SSL3 | SP_PROT_TLS1_X; +pub const SP_PROT_X_CLIENTS: DWORD = SP_PROT_CLIENTS | SP_PROT_TLS1_X_CLIENT + | SP_PROT_DTLS1_X_CLIENT; +pub const SP_PROT_X_SERVERS: DWORD = SP_PROT_SERVERS | SP_PROT_TLS1_X_SERVER + | SP_PROT_DTLS1_X_SERVER; +pub const SSL_CRACK_CERTIFICATE_NAME: &'static str = "SslCrackCertificate"; +pub const SSL_FREE_CERTIFICATE_NAME: &'static str = "SslFreeCertificate"; diff --git a/bash-5.1/vendor/winapi/src/um/securityappcontainer.rs b/bash-5.1/vendor/winapi/src/um/securityappcontainer.rs new file mode 100644 index 0000000000000000000000000000000000000000..02d862938e512c57a6b610116a007fd1bde3a12f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/securityappcontainer.rs @@ -0,0 +1,16 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, PULONG, ULONG}; +use um::winnt::{HANDLE, LPWSTR, PSID}; +extern "system" { + pub fn GetAppContainerNamedObjectPath( + Token: HANDLE, + AppContainerSid: PSID, + ObjectPathLength: ULONG, + ObjectPath: LPWSTR, + ReturnLength: PULONG, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/securitybaseapi.rs b/bash-5.1/vendor/winapi/src/um/securitybaseapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..81bfd18fff60225022d1e996ecf24547f620d30c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/securitybaseapi.rs @@ -0,0 +1,690 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! FFI bindings to psapi. +use shared::guiddef::GUID; +use shared::minwindef::{ + BOOL, BYTE, DWORD, LPBOOL, LPDWORD, LPVOID, PBOOL, PDWORD, PUCHAR, PULONG, UCHAR, ULONG +}; +use um::minwinbase::LPSECURITY_ATTRIBUTES; +use um::winnt::{ + ACL_INFORMATION_CLASS, AUDIT_EVENT_TYPE, BOOLEAN, HANDLE, LONG, LPCWSTR, LPWSTR, PACL, + PCLAIM_SECURITY_ATTRIBUTES_INFORMATION, PCWSTR, PGENERIC_MAPPING, PHANDLE, PLUID, + PLUID_AND_ATTRIBUTES, POBJECT_TYPE_LIST, PPRIVILEGE_SET, PSECURITY_DESCRIPTOR, + PSECURITY_DESCRIPTOR_CONTROL, PSID, PSID_AND_ATTRIBUTES, PSID_IDENTIFIER_AUTHORITY, + PTOKEN_GROUPS, PTOKEN_PRIVILEGES, PVOID, SECURITY_DESCRIPTOR_CONTROL, + SECURITY_IMPERSONATION_LEVEL, SECURITY_INFORMATION, TOKEN_INFORMATION_CLASS, TOKEN_TYPE, + WELL_KNOWN_SID_TYPE +}; +extern "system" { + pub fn AccessCheck( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ClientToken: HANDLE, + DesiredAccess: DWORD, + GenericMapping: PGENERIC_MAPPING, + PrivilegeSet: PPRIVILEGE_SET, + PrivilegeSetLength: LPDWORD, + GrantedAccess: LPDWORD, + AccessStatus: LPBOOL, + ) -> BOOL; + pub fn AccessCheckAndAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ObjectTypeName: LPWSTR, + ObjectName: LPWSTR, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + DesiredAccess: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: BOOL, + GrantedAccess: LPDWORD, + AccessStatus: LPBOOL, + pfGenerateOnClose: LPBOOL, + ) -> BOOL; + pub fn AccessCheckByType( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + ClientToken: HANDLE, + DesiredAccess: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + PrivilegeSet: PPRIVILEGE_SET, + PrivilegeSetLength: LPDWORD, + GrantedAccess: LPDWORD, + AccessStatus: LPBOOL, + ) -> BOOL; + pub fn AccessCheckByTypeResultList( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + ClientToken: HANDLE, + DesiredAccess: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + PrivilegeSet: PPRIVILEGE_SET, + PrivilegeSetLength: LPDWORD, + GrantedAccessList: LPDWORD, + AccessStatusList: LPDWORD, + ) -> BOOL; + pub fn AccessCheckByTypeAndAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ObjectTypeName: LPWSTR, + ObjectName: LPCWSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + DesiredAccess: DWORD, + AuditType: AUDIT_EVENT_TYPE, + Flags: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: BOOL, + GrantedAccess: LPDWORD, + AccessStatus: LPBOOL, + pfGenerateOnClose: LPBOOL, + ) -> BOOL; + pub fn AccessCheckByTypeResultListAndAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ObjectTypeName: LPCWSTR, + ObjectName: LPCWSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + DesiredAccess: DWORD, + AuditType: AUDIT_EVENT_TYPE, + Flags: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: BOOL, + GrantedAccess: LPDWORD, + AccessStatusList: LPDWORD, + pfGenerateOnClose: LPBOOL, + ) -> BOOL; + pub fn AccessCheckByTypeResultListAndAuditAlarmByHandleW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ClientToken: HANDLE, + ObjectTypeName: LPCWSTR, + ObjectName: LPCWSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + DesiredAccess: DWORD, + AuditType: AUDIT_EVENT_TYPE, + Flags: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: BOOL, + GrantedAccess: LPDWORD, + AccessStatusList: LPDWORD, + pfGenerateOnClose: LPBOOL, + ) -> BOOL; + pub fn AddAccessAllowedAce( + pAcl: PACL, + dwAceRevision: DWORD, + AccessMask: DWORD, + pSid: PSID, + ) -> BOOL; + pub fn AddAccessAllowedAceEx( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + pSid: PSID, + ) -> BOOL; + pub fn AddAccessAllowedObjectAce( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + ObjectTypeGuid: *mut GUID, + InheritedObjectTypeGuid: *mut GUID, + pSid: PSID, + ) -> BOOL; + pub fn AddAccessDeniedAce( + pAcl: PACL, + dwAceRevision: DWORD, + AccessMask: DWORD, + pSid: PSID, + ) -> BOOL; + pub fn AddAccessDeniedAceEx( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + pSid: PSID, + ) -> BOOL; + pub fn AddAccessDeniedObjectAce( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + ObjectTypeGuid: *mut GUID, + InheritedObjectTypeGuid: *mut GUID, + pSid: PSID, + ) -> BOOL; + pub fn AddAce( + pAcl: PACL, + dwAceRevision: DWORD, + dwStartingAceIndex: DWORD, + pAceList: LPVOID, + nAceListLength: DWORD, + ) -> BOOL; + pub fn AddAuditAccessAce( + pAcl: PACL, + dwAceRevision: DWORD, + dwAccessMask: DWORD, + pSid: PSID, + bAuditSuccess: BOOL, + bAuditFailure: BOOL, + ) -> BOOL; + pub fn AddAuditAccessAceEx( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + dwAccessMask: DWORD, + pSid: PSID, + bAuditSuccess: BOOL, + bAuditFailure: BOOL, + ) -> BOOL; + pub fn AddAuditAccessObjectAce( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + ObjectTypeGuid: *mut GUID, + InheritedObjectTypeGuid: *mut GUID, + pSid: PSID, + bAuditSuccess: BOOL, + bAuditFailure: BOOL, + ) -> BOOL; + pub fn AddMandatoryAce( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + MandatoryPolicy: DWORD, + pLabelSid: PSID, + ) -> BOOL; + pub fn AddResourceAttributeAce( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + pSid: PSID, + pAttributeInfo: PCLAIM_SECURITY_ATTRIBUTES_INFORMATION, + pReturnLength: PDWORD, + ) -> BOOL; + pub fn AddScopedPolicyIDAce( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + pSid: PSID, + ) -> BOOL; + pub fn AdjustTokenGroups( + TokenHandle: HANDLE, + ResetToDefault: BOOL, + NewState: PTOKEN_GROUPS, + BufferLength: DWORD, + PreviousState: PTOKEN_GROUPS, + ReturnLength: PDWORD, + ) -> BOOL; + pub fn AdjustTokenPrivileges( + TokenHandle: HANDLE, + DisableAllPrivileges: BOOL, + NewState: PTOKEN_PRIVILEGES, + BufferLength: DWORD, + PreviousState: PTOKEN_PRIVILEGES, + ReturnLength: PDWORD, + ) -> BOOL; + pub fn AllocateAndInitializeSid( + pIdentifierAuthoirity: PSID_IDENTIFIER_AUTHORITY, + nSubAuthorityCount: BYTE, + dwSubAuthority0: DWORD, + dwSubAuthority1: DWORD, + dwSubAuthority2: DWORD, + dwSubAuthority3: DWORD, + dwSubAuthority4: DWORD, + dwSubAuthority5: DWORD, + dwSubAuthority6: DWORD, + dwSubAuthority7: DWORD, + pSid: *mut PSID, + ) -> BOOL; + pub fn AllocateLocallyUniqueId( + Luid: PLUID, + ) -> BOOL; + pub fn AreAllAccessesGranted( + GrantedAccess: DWORD, + DesiredAccess: DWORD, + ) -> BOOL; + pub fn AreAnyAccessesGranted( + GrantedAccess: DWORD, + DesiredAccess: DWORD, + ) -> BOOL; + pub fn CheckTokenMembership( + TokenHandle: HANDLE, + SidToCheck: PSID, + IsMember: PBOOL, + ) -> BOOL; + pub fn CheckTokenCapability( + TokenHandle: HANDLE, + CapabilitySidToCheck: PSID, + HasCapability: PBOOL, + ) -> BOOL; + pub fn GetAppContainerAce( + Acl: PACL, + StartingAceIndex: DWORD, + AppContainerAce: *mut PVOID, + AppContainerAceIndex: *mut DWORD, + ) -> BOOL; + pub fn CheckTokenMembershipEx( + TokenHandle: HANDLE, + SidToCheck: PSID, + Flags: DWORD, + IsMember: PBOOL, + ) -> BOOL; + pub fn ConvertToAutoInheritPrivateObjectSecurity( + ParentDescriptor: PSECURITY_DESCRIPTOR, + CurrentSecurityDescriptor: PSECURITY_DESCRIPTOR, + NewSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + ObjectType: *mut GUID, + IsDirectoryObject: BOOLEAN, + GenericMapping: PGENERIC_MAPPING, + ) -> BOOL; + pub fn CopySid( + nDestinationSidLength: DWORD, + pDestinationSid: PSID, + pSourceSid: PSID, + ) -> BOOL; + pub fn CreatePrivateObjectSecurity( + ParentDescriptor: PSECURITY_DESCRIPTOR, + CreatorDescriptor: PSECURITY_DESCRIPTOR, + NewDescriptor: *mut PSECURITY_DESCRIPTOR, + IsDirectoryObject: BOOL, + Token: HANDLE, + GenericMapping: PGENERIC_MAPPING, + ) -> BOOL; + pub fn CreatePrivateObjectSecurityEx( + ParentDescriptor: PSECURITY_DESCRIPTOR, + CreatorDescriptor: PSECURITY_DESCRIPTOR, + NewSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + ObjectType: *mut GUID, + IsContainerObject: BOOL, + AutoInheritFlags: ULONG, + Token: HANDLE, + GenericMapping: PGENERIC_MAPPING, + ) -> BOOL; + pub fn CreatePrivateObjectSecurityWithMultipleInheritance( + ParentDescriptor: PSECURITY_DESCRIPTOR, + CreatorDescriptor: PSECURITY_DESCRIPTOR, + NewSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + ObjectTypes: *mut *mut GUID, + GuidCount: ULONG, + IsContainerObject: BOOL, + AutoInheritFlags: ULONG, + Token: HANDLE, + GenericMapping: PGENERIC_MAPPING, + ) -> BOOL; + pub fn CreateRestrictedToken( + ExistingTokenHandle: HANDLE, + Flags: DWORD, + DisableSidCount: DWORD, + SidsToDisable: PSID_AND_ATTRIBUTES, + DeletePrivilegeCount: DWORD, + PrivilegesToDelete: PLUID_AND_ATTRIBUTES, + RestrictedSidCount: DWORD, + SidsToRestrict: PSID_AND_ATTRIBUTES, + NewTokenHandle: PHANDLE, + ) -> BOOL; + pub fn CreateWellKnownSid( + WellKnownSidType: WELL_KNOWN_SID_TYPE, + DomainSid: PSID, + pSid: PSID, + cbSid: *mut DWORD, + ) -> BOOL; + pub fn EqualDomainSid( + pSid1: PSID, + pSid2: PSID, + pfEqual: *mut BOOL, + ) -> BOOL; + pub fn DeleteAce( + pAcl: PACL, + dwAceIndex: DWORD, + ) -> BOOL; + pub fn DestroyPrivateObjectSecurity( + ObjectDescriptor: *mut PSECURITY_DESCRIPTOR, + ) -> BOOL; + pub fn DuplicateToken( + ExistingTokenHandle: HANDLE, + ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + DuplicateTokenHandle: PHANDLE, + ) -> BOOL; + pub fn DuplicateTokenEx( + hExistingToken: HANDLE, + dwDesiredAccess: DWORD, + lpTokenAttributes: LPSECURITY_ATTRIBUTES, + ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + TokenType: TOKEN_TYPE, + phNewToken: PHANDLE, + ) -> BOOL; + pub fn EqualPrefixSid( + pSid1: PSID, + pSid2: PSID, + ) -> BOOL; + pub fn EqualSid( + pSid1: PSID, + pSid2: PSID, + ) -> BOOL; + pub fn FindFirstFreeAce( + pAcl: PACL, + pAce: *mut LPVOID, + ) -> BOOL; + pub fn FreeSid( + pSid: PSID, + ) -> PVOID; + pub fn GetAce( + pAcl: PACL, + dwAceIndex: DWORD, + pAce: *mut LPVOID, + ) -> BOOL; + pub fn GetAclInformation( + pAcl: PACL, + pAclInformtion: LPVOID, + nAclInformationLength: DWORD, + dwAclInformationClass: ACL_INFORMATION_CLASS, + ) -> BOOL; + pub fn GetFileSecurityW( + lpFileName: LPCWSTR, + RequestedInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> BOOL; + pub fn GetKernelObjectSecurity( + Handle: HANDLE, + RequestedInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> BOOL; + pub fn GetLengthSid( + pSid: PSID, + ) -> DWORD; + pub fn GetPrivateObjectSecurity( + ObjectDescriptor: PSECURITY_DESCRIPTOR, + SecurityInformation: SECURITY_INFORMATION, + ResultantDescriptor: PSECURITY_DESCRIPTOR, + DescriptorLength: DWORD, + ReturnLength: PDWORD, + ) -> BOOL; + pub fn GetSecurityDescriptorControl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pControl: PSECURITY_DESCRIPTOR_CONTROL, + lpdwRevision: LPDWORD, + ) -> BOOL; + pub fn GetSecurityDescriptorDacl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpbDaclPresent: LPBOOL, + pDacl: *mut PACL, + lpbDaclDefaulted: LPBOOL, + ) -> BOOL; + pub fn GetSecurityDescriptorGroup( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pGroup: *mut PSID, + lpbGroupDefaulted: LPBOOL, + ) -> BOOL; + pub fn GetSecurityDescriptorLength( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> DWORD; + pub fn GetSecurityDescriptorOwner( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pOwner: *mut PSID, + lpbOwnerDefaulted: LPBOOL, + ) -> BOOL; + pub fn GetSecurityDescriptorRMControl( + SecurityDescriptor: PSECURITY_DESCRIPTOR, + RMControl: PUCHAR, + ) -> DWORD; + pub fn GetSecurityDescriptorSacl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpbSaclPresent: LPBOOL, + pSacl: *mut PACL, + lpbSaclDefaulted: LPBOOL, + ) -> BOOL; + pub fn GetSidIdentifierAuthority( + pSid: PSID, + ) -> PSID_IDENTIFIER_AUTHORITY; + pub fn GetSidLengthRequired( + nSubAuthorityCount: UCHAR, + ) -> DWORD; + pub fn GetSidSubAuthority( + pSid: PSID, + nSubAuthority: DWORD, + ) -> PDWORD; + pub fn GetSidSubAuthorityCount( + pSid: PSID, + ) -> PUCHAR; + pub fn GetTokenInformation( + TokenHandle: HANDLE, + TokenInformationClass: TOKEN_INFORMATION_CLASS, + TokenInformation: LPVOID, + TokenInformationLength: DWORD, + ReturnLength: PDWORD, + ) -> BOOL; + pub fn GetWindowsAccountDomainSid( + pSid: PSID, + pDomainSid: PSID, + cbDomainSid: *mut DWORD, + ) -> BOOL; + pub fn ImpersonateAnonymousToken( + ThreadHandle: HANDLE, + ) -> BOOL; + pub fn ImpersonateLoggedOnUser( + hToken: HANDLE, + ) -> BOOL; + pub fn ImpersonateSelf( + ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + ) -> BOOL; + pub fn InitializeAcl( + pAcl: PACL, + nAclLength: DWORD, + dwAclRevision: DWORD, + ) -> BOOL; + pub fn InitializeSecurityDescriptor( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + dwRevision: DWORD, + ) -> BOOL; + pub fn InitializeSid( + Sid: PSID, + pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY, + nSubAuthorityCount: BYTE, + ) -> BOOL; + pub fn IsTokenRestricted( + TokenHandle: HANDLE, + ) -> BOOL; + pub fn IsValidAcl( + pAcl: PACL, + ) -> BOOL; + pub fn IsValidSecurityDescriptor( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> BOOL; + pub fn IsValidSid( + pSid: PSID, + ) -> BOOL; + pub fn IsWellKnownSid( + pSid: PSID, + WellKnownSidType: WELL_KNOWN_SID_TYPE, + ) -> BOOL; + pub fn MakeAbsoluteSD( + pSelfRelativeSD: PSECURITY_DESCRIPTOR, + pAbsoluteSD: PSECURITY_DESCRIPTOR, + lpdwAbsoluteSDSize: LPDWORD, + pDacl: PACL, + lpdwDaclSize: LPDWORD, + pSacl: PACL, + lpdwSaclSize: LPDWORD, + pOwner: PSID, + lpdwOwnerSize: LPDWORD, + pPrimaryGroup: PSID, + lpdwPrimaryGroupSize: LPDWORD, + ) -> BOOL; + pub fn MakeSelfRelativeSD( + pAbsoluteSD: PSECURITY_DESCRIPTOR, + pSelfRelativeSD: PSECURITY_DESCRIPTOR, + lpdwBufferLength: LPDWORD, + ) -> BOOL; + pub fn MapGenericMask( + AccessMask: PDWORD, + GenericMapping: PGENERIC_MAPPING, + ); + pub fn ObjectCloseAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + GenerateOnClose: BOOL, + ) -> BOOL; + pub fn ObjectDeleteAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + GenerateOnClose: BOOL, + ) -> BOOL; + pub fn ObjectOpenAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ObjectTypeName: LPWSTR, + ObjectName: LPWSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ClientToken: HANDLE, + DesiredAccess: DWORD, + GrantedAccess: DWORD, + Privileges: PPRIVILEGE_SET, + ObjectCreation: BOOL, + AccessGranted: BOOL, + GenerateOnClose: LPBOOL, + ) -> BOOL; + pub fn ObjectPrivilegeAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ClientToken: HANDLE, + DesiredAccess: DWORD, + Privileges: PPRIVILEGE_SET, + AccessGranted: BOOL, + ) -> BOOL; + pub fn PrivilegeCheck( + ClientToken: HANDLE, + RequiredPrivileges: PPRIVILEGE_SET, + pfResult: LPBOOL, + ) -> BOOL; + pub fn PrivilegedServiceAuditAlarmW( + SubsystemName: LPCWSTR, + ServiceName: LPCWSTR, + ClientToken: HANDLE, + Privileges: PPRIVILEGE_SET, + AccessGranted: BOOL, + ) -> BOOL; + pub fn QuerySecurityAccessMask( + SecurityInformation: SECURITY_INFORMATION, + DesiredAccess: LPDWORD, + ); + pub fn RevertToSelf() -> BOOL; + pub fn SetAclInformation( + pAcl: PACL, + pAclInformation: LPVOID, + nAclInformationLength: DWORD, + dwAclInfomrationClass: ACL_INFORMATION_CLASS, + ) -> BOOL; + pub fn SetFileSecurityW( + lpFileName: LPCWSTR, + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> BOOL; + pub fn SetKernelObjectSecurity( + Handle: HANDLE, + SecurityInformation: SECURITY_INFORMATION, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> BOOL; + pub fn SetPrivateObjectSecurity( + SecurityInformation: SECURITY_INFORMATION, + ModificationDescriptor: PSECURITY_DESCRIPTOR, + ObjectsSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + GenericMapping: PGENERIC_MAPPING, + Token: HANDLE, + ) -> BOOL; + pub fn SetPrivateObjectSecurityEx( + SecurityInformation: SECURITY_INFORMATION, + ModificationDescriptor: PSECURITY_DESCRIPTOR, + ObjectsSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + AutoInheritFlags: ULONG, + GenericMapping: PGENERIC_MAPPING, + Token: HANDLE, + ) -> BOOL; + pub fn SetSecurityAccessMask( + SecurityInformation: SECURITY_INFORMATION, + DesiredAccess: LPDWORD, + ); + pub fn SetSecurityDescriptorControl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ControlBitsOfInterest: SECURITY_DESCRIPTOR_CONTROL, + ControlBitsToSet: SECURITY_DESCRIPTOR_CONTROL, + ) -> BOOL; + pub fn SetSecurityDescriptorDacl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + bDaclPresent: BOOL, + pDacl: PACL, + bDaclDefaulted: BOOL, + ) -> BOOL; + pub fn SetSecurityDescriptorGroup( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pGroup: PSID, + bGroupDefaulted: BOOL, + ) -> BOOL; + pub fn SetSecurityDescriptorOwner( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pOwner: PSID, + bOwnerDefaulted: BOOL, + ) -> BOOL; + pub fn SetSecurityDescriptorRMControl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + RMControl: PUCHAR, + ) -> DWORD; + pub fn SetSecurityDescriptorSacl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + bSaclPresent: BOOL, + pSacl: PACL, + bSaclDefaulted: BOOL, + ) -> BOOL; + pub fn SetTokenInformation( + TokenHandle: HANDLE, + TokenInformationClass: TOKEN_INFORMATION_CLASS, + TokenInformation: LPVOID, + TokenInformationLength: DWORD, + ) -> BOOL; + pub fn SetCachedSigningLevel( + SourceFiles: PHANDLE, + SourceFileCount: ULONG, + Flags: ULONG, + TargetFile: HANDLE, + ) -> BOOL; + pub fn GetCachedSigningLevel( + File: HANDLE, + Flags: PULONG, + SigningLevel: PULONG, + Thumbprint: PUCHAR, + ThumbprintSize: PULONG, + ThumbprintAlgorithm: PULONG, + ) -> BOOL; + pub fn CveEventWrite( + CveId: PCWSTR, + AdditionalDetails: PCWSTR, + ) -> LONG; + pub fn DeriveCapabilitySidsFromName( + CapName: LPCWSTR, + CapabilityGroupSids: *mut *mut PSID, + CapabilityGroupSidCount: *mut DWORD, + CapabilitySids: *mut *mut PSID, + CapabilitySidCount: *mut DWORD, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/servprov.rs b/bash-5.1/vendor/winapi/src/um/servprov.rs new file mode 100644 index 0000000000000000000000000000000000000000..aeb382dbccd26e1238b17cd4f42eab986aec4422 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/servprov.rs @@ -0,0 +1,23 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_void; +use shared::guiddef::{REFGUID, REFIID}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::HRESULT; +pub type LPSERVICEPROVIDER = *mut IServiceProvider; +RIDL!{#[uuid(0x6d5140c1, 0x7436, 0x11ce, 0x80, 0x34, 0x00, 0xaa, 0x00, 0x60, 0x09, 0xfa)] +interface IServiceProvider(IServiceProviderVtbl): IUnknown(IUnknownVtbl) { + fn QueryService( + guidService: REFGUID, + riid: REFIID, + ppvObject: *mut *mut c_void, + ) -> HRESULT, + fn RemoteQueryService( + guidService: REFGUID, + riid: REFIID, + ppvObject: *mut *mut IUnknown, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/setupapi.rs b/bash-5.1/vendor/winapi/src/um/setupapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..d716fc56c8e71f1bc8e0c557ab461d9a209991f4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/setupapi.rs @@ -0,0 +1,3571 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Public header file for Windows NT Setup and Device Installer services Dll. +use ctypes::c_int; +use shared::basetsd::{DWORD_PTR, UINT_PTR, ULONG_PTR}; +use shared::devpropdef::{DEVPROPKEY, DEVPROPTYPE}; +use shared::guiddef::{GUID, LPGUID}; +use shared::minwindef::{ + BOOL, BYTE, DWORD, FILETIME, HINSTANCE, HKEY, INT, LPARAM, LPCVOID, LPDWORD, MAX_PATH, PBOOL, + PBYTE, PDWORD, PINT, PUINT, UINT, USHORT, WORD, +}; +use shared::windef::{HDC, HICON, HWND, RECT}; +use um::commctrl::HIMAGELIST; +use um::prsht::{HPROPSHEETPAGE, LPPROPSHEETHEADERA, LPPROPSHEETHEADERW}; +use um::spapidef::SP_LOG_TOKEN; +use um::winnt::{ + ANYSIZE_ARRAY, APPLICATION_ERROR_MASK, CHAR, DWORDLONG, ERROR_SEVERITY_ERROR, HANDLE, LONG, + LONGLONG, LPCSTR, LPCWSTR, PCSTR, PCWSTR, PSTR, PVOID, PWSTR, WCHAR, +}; +use um::winreg::REGSAM; +pub const LINE_LEN: usize = 256; +pub const MAX_INF_STRING_LENGTH: usize = 4096; +pub const MAX_INF_SECTION_NAME_LENGTH: usize = 255; +pub const MAX_TITLE_LEN: usize = 60; +pub const MAX_INSTRUCTION_LEN: usize = 256; +pub const MAX_LABEL_LEN: usize = 30; +pub const MAX_SERVICE_NAME_LEN: usize = 256; +pub const MAX_SUBTITLE_LEN: usize = 256; +pub const SP_MAX_MACHINENAME_LENGTH: usize = MAX_PATH + 3; +pub type HINF = PVOID; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct INFCONTEXT { + Inf: PVOID, + CurrentInf: PVOID, + Section: UINT, + Line: UINT, +}} +pub type PINFCONTEXT = *mut INFCONTEXT; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INF_INFORMATION { + InfStyle: DWORD, + InfCount: DWORD, + VersionData: [BYTE; ANYSIZE_ARRAY], +}} +pub type PSP_INF_INFORMATION = *mut SP_INF_INFORMATION; +UNION!{#[cfg_attr(target_arch = "x86", repr(packed))] union SP_ALTPLATFORM_INFO_V3_u { + [u16; 1], + Reserved Reserved_mut: WORD, + Flags Flags_mut: WORD, +}} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ALTPLATFORM_INFO_V3 { + cbSize: DWORD, + Platform: DWORD, + MajorVersion: DWORD, + MinorVersion: DWORD, + ProcessorArchitecture: WORD, + u: SP_ALTPLATFORM_INFO_V3_u, + FirstValidatedMajorVersion: DWORD, + FirstValidatedMinorVersion: DWORD, + ProductType: BYTE, + SuiteMask: WORD, + BuildNumber: DWORD, +}} +pub type PSP_ALTPLATFORM_INFO_V3 = *mut SP_ALTPLATFORM_INFO_V3; +UNION!{#[cfg_attr(target_arch = "x86", repr(packed))] union SP_ALTPLATFORM_INFO_V2_u { + [u16; 1], + Reserved Reserved_mut: WORD, + Flags Flags_mut: WORD, +}} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ALTPLATFORM_INFO_V2 { + cbSize: DWORD, + Platform: DWORD, + MajorVersion: DWORD, + MinorVersion: DWORD, + ProcessorArchitecture: WORD, + u: SP_ALTPLATFORM_INFO_V2_u, + FirstValidatedMajorVersion: DWORD, + FirstValidatedMinorVersion: DWORD, +}} +pub type PSP_ALTPLATFORM_INFO_V2 = *mut SP_ALTPLATFORM_INFO_V2; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ALTPLATFORM_INFO_V1 { + cbSize: DWORD, + Platform: DWORD, + MajorVersion: DWORD, + MinorVersion: DWORD, + ProcessorArchitecture: WORD, + Reserved: WORD, +}} +pub type PSP_ALTPLATFORM_INFO_V1 = *mut SP_ALTPLATFORM_INFO_V1; +pub type SP_ALTPLATFORM_INFO = SP_ALTPLATFORM_INFO_V2; +pub type PSP_ALTPLATFORM_INFO = PSP_ALTPLATFORM_INFO_V2; +pub const SP_ALTPLATFORM_FLAGS_VERSION_RANGE: WORD = 0x0001; +pub const SP_ALTPLATFORM_FLAGS_SUITE_MASK: WORD = 0x0002; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ORIGINAL_FILE_INFO_A { + cbSize: DWORD, + OriginalInfName: [CHAR; MAX_PATH], + OriginalCatalogName: [CHAR; MAX_PATH], +}} +pub type PSP_ORIGINAL_FILE_INFO_A = *mut SP_ORIGINAL_FILE_INFO_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ORIGINAL_FILE_INFO_W { + cbSize: DWORD, + OriginalInfName: [WCHAR; MAX_PATH], + OriginalCatalogName: [WCHAR; MAX_PATH], +}} +pub type PSP_ORIGINAL_FILE_INFO_W = *mut SP_ORIGINAL_FILE_INFO_W; +pub const INF_STYLE_NONE: DWORD = 0x00000000; +pub const INF_STYLE_OLDNT: DWORD = 0x00000001; +pub const INF_STYLE_WIN4: DWORD = 0x00000002; +pub const INF_STYLE_CACHE_ENABLE: DWORD = 0x00000010; +pub const INF_STYLE_CACHE_DISABLE: DWORD = 0x00000020; +pub const INF_STYLE_CACHE_IGNORE: DWORD = 0x00000040; +pub const DIRID_ABSOLUTE: DWORD = -1i32 as u32; +pub const DIRID_ABSOLUTE_16BIT: DWORD = 0xffff; +pub const DIRID_NULL: DWORD = 0; +pub const DIRID_SRCPATH: DWORD = 1; +pub const DIRID_WINDOWS: DWORD = 10; +pub const DIRID_SYSTEM: DWORD = 11; +pub const DIRID_DRIVERS: DWORD = 12; +pub const DIRID_IOSUBSYS: DWORD = DIRID_DRIVERS; +pub const DIRID_DRIVER_STORE: DWORD = 13; +pub const DIRID_INF: DWORD = 17; +pub const DIRID_HELP: DWORD = 18; +pub const DIRID_FONTS: DWORD = 20; +pub const DIRID_VIEWERS: DWORD = 21; +pub const DIRID_COLOR: DWORD = 23; +pub const DIRID_APPS: DWORD = 24; +pub const DIRID_SHARED: DWORD = 25; +pub const DIRID_BOOT: DWORD = 30; +pub const DIRID_SYSTEM16: DWORD = 50; +pub const DIRID_SPOOL: DWORD = 51; +pub const DIRID_SPOOLDRIVERS: DWORD = 52; +pub const DIRID_USERPROFILE: DWORD = 53; +pub const DIRID_LOADER: DWORD = 54; +pub const DIRID_PRINTPROCESSOR: DWORD = 55; +pub const DIRID_DEFAULT: DWORD = DIRID_SYSTEM; +pub const DIRID_COMMON_STARTMENU: DWORD = 16406; +pub const DIRID_COMMON_PROGRAMS: DWORD = 16407; +pub const DIRID_COMMON_STARTUP: DWORD = 16408; +pub const DIRID_COMMON_DESKTOPDIRECTORY: DWORD = 16409; +pub const DIRID_COMMON_FAVORITES: DWORD = 16415; +pub const DIRID_COMMON_APPDATA: DWORD = 16419; +pub const DIRID_PROGRAM_FILES: DWORD = 16422; +pub const DIRID_SYSTEM_X86: DWORD = 16425; +pub const DIRID_PROGRAM_FILES_X86: DWORD = 16426; +pub const DIRID_PROGRAM_FILES_COMMON: DWORD = 16427; +pub const DIRID_PROGRAM_FILES_COMMONX86: DWORD = 16428; +pub const DIRID_COMMON_TEMPLATES: DWORD = 16429; +pub const DIRID_COMMON_DOCUMENTS: DWORD = 16430; +pub const DIRID_USER: DWORD = 0x8000; +FN!{stdcall PSP_FILE_CALLBACK_A( + Context: PVOID, + Notification: UINT, + Param1: UINT_PTR, + Param2: UINT_PTR, +) -> UINT} +FN!{stdcall PSP_FILE_CALLBACK_W( + Context: PVOID, + Notification: UINT, + Param1: UINT_PTR, + Param2: UINT_PTR, +) -> UINT} +pub const SPFILENOTIFY_STARTQUEUE: UINT = 0x00000001; +pub const SPFILENOTIFY_ENDQUEUE: UINT = 0x00000002; +pub const SPFILENOTIFY_STARTSUBQUEUE: UINT = 0x00000003; +pub const SPFILENOTIFY_ENDSUBQUEUE: UINT = 0x00000004; +pub const SPFILENOTIFY_STARTDELETE: UINT = 0x00000005; +pub const SPFILENOTIFY_ENDDELETE: UINT = 0x00000006; +pub const SPFILENOTIFY_DELETEERROR: UINT = 0x00000007; +pub const SPFILENOTIFY_STARTRENAME: UINT = 0x00000008; +pub const SPFILENOTIFY_ENDRENAME: UINT = 0x00000009; +pub const SPFILENOTIFY_RENAMEERROR: UINT = 0x0000000a; +pub const SPFILENOTIFY_STARTCOPY: UINT = 0x0000000b; +pub const SPFILENOTIFY_ENDCOPY: UINT = 0x0000000c; +pub const SPFILENOTIFY_COPYERROR: UINT = 0x0000000d; +pub const SPFILENOTIFY_NEEDMEDIA: UINT = 0x0000000e; +pub const SPFILENOTIFY_QUEUESCAN: UINT = 0x0000000f; +pub const SPFILENOTIFY_CABINETINFO: UINT = 0x00000010; +pub const SPFILENOTIFY_FILEINCABINET: UINT = 0x00000011; +pub const SPFILENOTIFY_NEEDNEWCABINET: UINT = 0x00000012; +pub const SPFILENOTIFY_FILEEXTRACTED: UINT = 0x00000013; +pub const SPFILENOTIFY_FILEOPDELAYED: UINT = 0x00000014; +pub const SPFILENOTIFY_STARTBACKUP: UINT = 0x00000015; +pub const SPFILENOTIFY_BACKUPERROR: UINT = 0x00000016; +pub const SPFILENOTIFY_ENDBACKUP: UINT = 0x00000017; +pub const SPFILENOTIFY_QUEUESCAN_EX: UINT = 0x00000018; +pub const SPFILENOTIFY_STARTREGISTRATION: UINT = 0x00000019; +pub const SPFILENOTIFY_ENDREGISTRATION: UINT = 0x00000020; +pub const SPFILENOTIFY_QUEUESCAN_SIGNERINFO: UINT = 0x00000040; +pub const SPFILENOTIFY_LANGMISMATCH: UINT = 0x00010000; +pub const SPFILENOTIFY_TARGETEXISTS: UINT = 0x00020000; +pub const SPFILENOTIFY_TARGETNEWER: UINT = 0x00040000; +pub const FILEOP_COPY: UINT = 0; +pub const FILEOP_RENAME: UINT = 1; +pub const FILEOP_DELETE: UINT = 2; +pub const FILEOP_BACKUP: UINT = 3; +pub const FILEOP_ABORT: UINT = 0; +pub const FILEOP_DOIT: UINT = 1; +pub const FILEOP_SKIP: UINT = 2; +pub const FILEOP_RETRY: UINT = FILEOP_DOIT; +pub const FILEOP_NEWPATH: UINT = 4; +pub const COPYFLG_WARN_IF_SKIP: UINT = 0x00000001; +pub const COPYFLG_NOSKIP: UINT = 0x00000002; +pub const COPYFLG_NOVERSIONCHECK: UINT = 0x00000004; +pub const COPYFLG_FORCE_FILE_IN_USE: UINT = 0x00000008; +pub const COPYFLG_NO_OVERWRITE: UINT = 0x00000010; +pub const COPYFLG_NO_VERSION_DIALOG: UINT = 0x00000020; +pub const COPYFLG_OVERWRITE_OLDER_ONLY: UINT = 0x00000040; +pub const COPYFLG_PROTECTED_WINDOWS_DRIVER_FILE: UINT = 0x00000100; +pub const COPYFLG_REPLACEONLY: UINT = 0x00000400; +pub const COPYFLG_NODECOMP: UINT = 0x00000800; +pub const COPYFLG_REPLACE_BOOT_FILE: UINT = 0x00001000; +pub const COPYFLG_NOPRUNE: UINT = 0x00002000; +pub const COPYFLG_IN_USE_TRY_RENAME: UINT = 0x00004000; +pub const DELFLG_IN_USE: UINT = 0x00000001; +pub const DELFLG_IN_USE1: UINT = 0x00010000; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILEPATHS_A { + Target: PCSTR, + Source: PCSTR, + Win32Error: UINT, + Flags: DWORD, +}} +pub type PFILEPATHS_A = *mut FILEPATHS_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILEPATHS_W { + Target: PCWSTR, + Source: PCWSTR, + Win32Error: UINT, + Flags: DWORD, +}} +pub type PFILEPATHS_W = *mut FILEPATHS_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILEPATHS_SIGNERINFO_A { + Target: PCSTR, + Source: PCSTR, + Win32Error: UINT, + Flags: DWORD, + DigitalSigner: PCSTR, + Version: PCSTR, + CatalogFile: PCSTR, +}} +pub type PFILEPATHS_SIGNERINFO_A = *mut FILEPATHS_SIGNERINFO_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILEPATHS_SIGNERINFO_W { + Target: PCWSTR, + Source: PCWSTR, + Win32Error: UINT, + Flags: DWORD, + DigitalSigner: PCWSTR, + Version: PCWSTR, + CatalogFile: PCWSTR, +}} +pub type PFILEPATHS_SIGNERINFO_W = *mut FILEPATHS_SIGNERINFO_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SOURCE_MEDIA_A { + Reserved: PCSTR, + Tagfile: PCSTR, + Description: PCSTR, + SourcePath: PCSTR, + SourceFile: PCSTR, + Flags: DWORD, +}} +pub type PSOURCE_MEDIA_A = *mut SOURCE_MEDIA_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SOURCE_MEDIA_W { + Reserved: PCWSTR, + Tagfile: PCWSTR, + Description: PCWSTR, + SourcePath: PCWSTR, + SourceFile: PCWSTR, + Flags: DWORD, +}} +pub type PSOURCE_MEDIA_W = *mut SOURCE_MEDIA_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct CABINET_INFO_A { + CabinetPath: PCSTR, + CabinetFile: PCSTR, + DiskName: PCSTR, + SetId: USHORT, + CabinetNumber: USHORT, +}} +pub type PCABINET_INFO_A = *mut CABINET_INFO_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct CABINET_INFO_W { + CabinetPath: PCWSTR, + CabinetFile: PCWSTR, + DiskName: PCWSTR, + SetId: USHORT, + CabinetNumber: USHORT, +}} +pub type PCABINET_INFO_W = *mut CABINET_INFO_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILE_IN_CABINET_INFO_A { + NameInCabinet: PCSTR, + FileSize: DWORD, + Win32Error: DWORD, + DosDate: WORD, + DosTime: WORD, + DosAttribs: WORD, + FullTargetName: [CHAR; MAX_PATH], +}} +pub type PFILE_IN_CABINET_INFO_A = *mut FILE_IN_CABINET_INFO_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct FILE_IN_CABINET_INFO_W { + NameInCabinet: PCWSTR, + FileSize: DWORD, + Win32Error: DWORD, + DosDate: WORD, + DosTime: WORD, + DosAttribs: WORD, + FullTargetName: [WCHAR; MAX_PATH], +}} +pub type PFILE_IN_CABINET_INFO_W = *mut FILE_IN_CABINET_INFO_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_REGISTER_CONTROL_STATUSA { + cbSize: DWORD, + FileName: PCSTR, + Win32Error: DWORD, + FailureCode: DWORD, +}} +pub type PSP_REGISTER_CONTROL_STATUSA = *mut SP_REGISTER_CONTROL_STATUSA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_REGISTER_CONTROL_STATUSW { + cbSize: DWORD, + FileName: PCWSTR, + Win32Error: DWORD, + FailureCode: DWORD, +}} +pub type PSP_REGISTER_CONTROL_STATUSW = *mut SP_REGISTER_CONTROL_STATUSW; +pub const SPREG_SUCCESS: DWORD = 0x00000000; +pub const SPREG_LOADLIBRARY: DWORD = 0x00000001; +pub const SPREG_GETPROCADDR: DWORD = 0x00000002; +pub const SPREG_REGSVR: DWORD = 0x00000003; +pub const SPREG_DLLINSTALL: DWORD = 0x00000004; +pub const SPREG_TIMEOUT: DWORD = 0x00000005; +pub const SPREG_UNKNOWN: DWORD = 0xFFFFFFFF; +pub type HSPFILEQ = PVOID; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_FILE_COPY_PARAMS_A { + cbSize: DWORD, + QueueHandle: HSPFILEQ, + SourceRootPath: PCSTR, + SourcePath: PCSTR, + SourceFilename: PCSTR, + SourceDescription: PCSTR, + SourceTagfile: PCSTR, + TargetDirectory: PCSTR, + TargetFilename: PCSTR, + CopyStyle: DWORD, + LayoutInf: HINF, + SecurityDescriptor: PCSTR, +}} +pub type PSP_FILE_COPY_PARAMS_A = *mut SP_FILE_COPY_PARAMS_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_FILE_COPY_PARAMS_W { + cbSize: DWORD, + QueueHandle: HSPFILEQ, + SourceRootPath: PCWSTR, + SourcePath: PCWSTR, + SourceFilename: PCWSTR, + SourceDescription: PCWSTR, + SourceTagfile: PCWSTR, + TargetDirectory: PCWSTR, + TargetFilename: PCWSTR, + CopyStyle: DWORD, + LayoutInf: HINF, + SecurityDescriptor: PCWSTR, +}} +pub type PSP_FILE_COPY_PARAMS_W = *mut SP_FILE_COPY_PARAMS_W; +pub type HDSKSPC = PVOID; +pub type HDEVINFO = PVOID; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVINFO_DATA { + cbSize: DWORD, + ClassGuid: GUID, + DevInst: DWORD, + Reserved: ULONG_PTR, +}} +pub type PSP_DEVINFO_DATA = *mut SP_DEVINFO_DATA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVICE_INTERFACE_DATA { + cbSize: DWORD, + InterfaceClassGuid: GUID, + Flags: DWORD, + Reserved: ULONG_PTR, +}} +pub type PSP_DEVICE_INTERFACE_DATA = *mut SP_DEVICE_INTERFACE_DATA; +pub const SPINT_ACTIVE: DWORD = 0x00000001; +pub const SPINT_DEFAULT: DWORD = 0x00000002; +pub const SPINT_REMOVED: DWORD = 0x00000004; +pub type SP_INTERFACE_DEVICE_DATA = SP_DEVICE_INTERFACE_DATA; +pub type PSP_INTERFACE_DEVICE_DATA = PSP_DEVICE_INTERFACE_DATA; +pub const SPID_ACTIVE: DWORD = SPINT_ACTIVE; +pub const SPID_DEFAULT: DWORD = SPINT_DEFAULT; +pub const SPID_REMOVED: DWORD = SPINT_REMOVED; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVICE_INTERFACE_DETAIL_DATA_A { + cbSize: DWORD, + DevicePath: [CHAR; ANYSIZE_ARRAY], +}} +pub type PSP_DEVICE_INTERFACE_DETAIL_DATA_A = *mut SP_DEVICE_INTERFACE_DETAIL_DATA_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVICE_INTERFACE_DETAIL_DATA_W { + cbSize: DWORD, + DevicePath: [WCHAR; ANYSIZE_ARRAY], +}} +pub type PSP_DEVICE_INTERFACE_DETAIL_DATA_W = *mut SP_DEVICE_INTERFACE_DETAIL_DATA_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVINFO_LIST_DETAIL_DATA_A { + cbSize: DWORD, + ClassGuid: GUID, + RemoteMachineHandle: HANDLE, + RemoteMachineName: [CHAR; SP_MAX_MACHINENAME_LENGTH], +}} +pub type PSP_DEVINFO_LIST_DETAIL_DATA_A = *mut SP_DEVINFO_LIST_DETAIL_DATA_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVINFO_LIST_DETAIL_DATA_W { + cbSize: DWORD, + ClassGuid: GUID, + RemoteMachineHandle: HANDLE, + RemoteMachineName: [WCHAR; SP_MAX_MACHINENAME_LENGTH], +}} +pub type PSP_DEVINFO_LIST_DETAIL_DATA_W = *mut SP_DEVINFO_LIST_DETAIL_DATA_W; +pub const DIF_SELECTDEVICE: DI_FUNCTION = 0x00000001; +pub const DIF_INSTALLDEVICE: DI_FUNCTION = 0x00000002; +pub const DIF_ASSIGNRESOURCES: DI_FUNCTION = 0x00000003; +pub const DIF_PROPERTIES: DI_FUNCTION = 0x00000004; +pub const DIF_REMOVE: DI_FUNCTION = 0x00000005; +pub const DIF_FIRSTTIMESETUP: DI_FUNCTION = 0x00000006; +pub const DIF_FOUNDDEVICE: DI_FUNCTION = 0x00000007; +pub const DIF_SELECTCLASSDRIVERS: DI_FUNCTION = 0x00000008; +pub const DIF_VALIDATECLASSDRIVERS: DI_FUNCTION = 0x00000009; +pub const DIF_INSTALLCLASSDRIVERS: DI_FUNCTION = 0x0000000A; +pub const DIF_CALCDISKSPACE: DI_FUNCTION = 0x0000000B; +pub const DIF_DESTROYPRIVATEDATA: DI_FUNCTION = 0x0000000C; +pub const DIF_VALIDATEDRIVER: DI_FUNCTION = 0x0000000D; +pub const DIF_DETECT: DI_FUNCTION = 0x0000000F; +pub const DIF_INSTALLWIZARD: DI_FUNCTION = 0x00000010; +pub const DIF_DESTROYWIZARDDATA: DI_FUNCTION = 0x00000011; +pub const DIF_PROPERTYCHANGE: DI_FUNCTION = 0x00000012; +pub const DIF_ENABLECLASS: DI_FUNCTION = 0x00000013; +pub const DIF_DETECTVERIFY: DI_FUNCTION = 0x00000014; +pub const DIF_INSTALLDEVICEFILES: DI_FUNCTION = 0x00000015; +pub const DIF_UNREMOVE: DI_FUNCTION = 0x00000016; +pub const DIF_SELECTBESTCOMPATDRV: DI_FUNCTION = 0x00000017; +pub const DIF_ALLOW_INSTALL: DI_FUNCTION = 0x00000018; +pub const DIF_REGISTERDEVICE: DI_FUNCTION = 0x00000019; +pub const DIF_NEWDEVICEWIZARD_PRESELECT: DI_FUNCTION = 0x0000001A; +pub const DIF_NEWDEVICEWIZARD_SELECT: DI_FUNCTION = 0x0000001B; +pub const DIF_NEWDEVICEWIZARD_PREANALYZE: DI_FUNCTION = 0x0000001C; +pub const DIF_NEWDEVICEWIZARD_POSTANALYZE: DI_FUNCTION = 0x0000001D; +pub const DIF_NEWDEVICEWIZARD_FINISHINSTALL: DI_FUNCTION = 0x0000001E; +pub const DIF_UNUSED1: DI_FUNCTION = 0x0000001F; +pub const DIF_INSTALLINTERFACES: DI_FUNCTION = 0x00000020; +pub const DIF_DETECTCANCEL: DI_FUNCTION = 0x00000021; +pub const DIF_REGISTER_COINSTALLERS: DI_FUNCTION = 0x00000022; +pub const DIF_ADDPROPERTYPAGE_ADVANCED: DI_FUNCTION = 0x00000023; +pub const DIF_ADDPROPERTYPAGE_BASIC: DI_FUNCTION = 0x00000024; +pub const DIF_RESERVED1: DI_FUNCTION = 0x00000025; +pub const DIF_TROUBLESHOOTER: DI_FUNCTION = 0x00000026; +pub const DIF_POWERMESSAGEWAKE: DI_FUNCTION = 0x00000027; +pub const DIF_ADDREMOTEPROPERTYPAGE_ADVANCED: DI_FUNCTION = 0x00000028; +pub const DIF_UPDATEDRIVER_UI: DI_FUNCTION = 0x00000029; +pub const DIF_FINISHINSTALL_ACTION: DI_FUNCTION = 0x0000002A; +pub const DIF_RESERVED2: DI_FUNCTION = 0x00000030; +pub const DIF_MOVEDEVICE: DI_FUNCTION = 0x0000000E; +pub type DI_FUNCTION = UINT; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVINSTALL_PARAMS_A { + cbSize: DWORD, + Flags: DWORD, + FlagsEx: DWORD, + hwndParent: HWND, + InstallMsgHandler: PSP_FILE_CALLBACK_A, + InstallMsgHandlerContext: PVOID, + FileQueue: HSPFILEQ, + ClassInstallReserved: ULONG_PTR, + Reserved: DWORD, + DriverPath: [CHAR; MAX_PATH], +}} +pub type PSP_DEVINSTALL_PARAMS_A = *mut SP_DEVINSTALL_PARAMS_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DEVINSTALL_PARAMS_W { + cbSize: DWORD, + Flags: DWORD, + FlagsEx: DWORD, + hwndParent: HWND, + InstallMsgHandler: PSP_FILE_CALLBACK_W, + InstallMsgHandlerContext: PVOID, + FileQueue: HSPFILEQ, + ClassInstallReserved: ULONG_PTR, + Reserved: DWORD, + DriverPath: [WCHAR; MAX_PATH], +}} +pub type PSP_DEVINSTALL_PARAMS_W = *mut SP_DEVINSTALL_PARAMS_W; +pub const DI_SHOWOEM: DWORD = 0x00000001; +pub const DI_SHOWCOMPAT: DWORD = 0x00000002; +pub const DI_SHOWCLASS: DWORD = 0x00000004; +pub const DI_SHOWALL: DWORD = 0x00000007; +pub const DI_NOVCP: DWORD = 0x00000008; +pub const DI_DIDCOMPAT: DWORD = 0x00000010; +pub const DI_DIDCLASS: DWORD = 0x00000020; +pub const DI_AUTOASSIGNRES: DWORD = 0x00000040; +pub const DI_NEEDRESTART: DWORD = 0x00000080; +pub const DI_NEEDREBOOT: DWORD = 0x00000100; +pub const DI_NOBROWSE: DWORD = 0x00000200; +pub const DI_MULTMFGS: DWORD = 0x00000400; +pub const DI_DISABLED: DWORD = 0x00000800; +pub const DI_GENERALPAGE_ADDED: DWORD = 0x00001000; +pub const DI_RESOURCEPAGE_ADDED: DWORD = 0x00002000; +pub const DI_PROPERTIES_CHANGE: DWORD = 0x00004000; +pub const DI_INF_IS_SORTED: DWORD = 0x00008000; +pub const DI_ENUMSINGLEINF: DWORD = 0x00010000; +pub const DI_DONOTCALLCONFIGMG: DWORD = 0x00020000; +pub const DI_INSTALLDISABLED: DWORD = 0x00040000; +pub const DI_COMPAT_FROM_CLASS: DWORD = 0x00080000; +pub const DI_CLASSINSTALLPARAMS: DWORD = 0x00100000; +pub const DI_NODI_DEFAULTACTION: DWORD = 0x00200000; +pub const DI_QUIETINSTALL: DWORD = 0x00800000; +pub const DI_NOFILECOPY: DWORD = 0x01000000; +pub const DI_FORCECOPY: DWORD = 0x02000000; +pub const DI_DRIVERPAGE_ADDED: DWORD = 0x04000000; +pub const DI_USECI_SELECTSTRINGS: DWORD = 0x08000000; +pub const DI_OVERRIDE_INFFLAGS: DWORD = 0x10000000; +pub const DI_PROPS_NOCHANGEUSAGE: DWORD = 0x20000000; +pub const DI_NOSELECTICONS: DWORD = 0x40000000; +pub const DI_NOWRITE_IDS: DWORD = 0x80000000; +pub const DI_FLAGSEX_RESERVED2: DWORD = 0x00000001; +pub const DI_FLAGSEX_RESERVED3: DWORD = 0x00000002; +pub const DI_FLAGSEX_CI_FAILED: DWORD = 0x00000004; +pub const DI_FLAGSEX_FINISHINSTALL_ACTION: DWORD = 0x00000008; +pub const DI_FLAGSEX_DIDINFOLIST: DWORD = 0x00000010; +pub const DI_FLAGSEX_DIDCOMPATINFO: DWORD = 0x00000020; +pub const DI_FLAGSEX_FILTERCLASSES: DWORD = 0x00000040; +pub const DI_FLAGSEX_SETFAILEDINSTALL: DWORD = 0x00000080; +pub const DI_FLAGSEX_DEVICECHANGE: DWORD = 0x00000100; +pub const DI_FLAGSEX_ALWAYSWRITEIDS: DWORD = 0x00000200; +pub const DI_FLAGSEX_PROPCHANGE_PENDING: DWORD = 0x00000400; +pub const DI_FLAGSEX_ALLOWEXCLUDEDDRVS: DWORD = 0x00000800; +pub const DI_FLAGSEX_NOUIONQUERYREMOVE: DWORD = 0x00001000; +pub const DI_FLAGSEX_USECLASSFORCOMPAT: DWORD = 0x00002000; +pub const DI_FLAGSEX_RESERVED4: DWORD = 0x00004000; +pub const DI_FLAGSEX_NO_DRVREG_MODIFY: DWORD = 0x00008000; +pub const DI_FLAGSEX_IN_SYSTEM_SETUP: DWORD = 0x00010000; +pub const DI_FLAGSEX_INET_DRIVER: DWORD = 0x00020000; +pub const DI_FLAGSEX_APPENDDRIVERLIST: DWORD = 0x00040000; +pub const DI_FLAGSEX_PREINSTALLBACKUP: DWORD = 0x00080000; +pub const DI_FLAGSEX_BACKUPONREPLACE: DWORD = 0x00100000; +pub const DI_FLAGSEX_DRIVERLIST_FROM_URL: DWORD = 0x00200000; +pub const DI_FLAGSEX_RESERVED1: DWORD = 0x00400000; +pub const DI_FLAGSEX_EXCLUDE_OLD_INET_DRIVERS: DWORD = 0x00800000; +pub const DI_FLAGSEX_POWERPAGE_ADDED: DWORD = 0x01000000; +pub const DI_FLAGSEX_FILTERSIMILARDRIVERS: DWORD = 0x02000000; +pub const DI_FLAGSEX_INSTALLEDDRIVER: DWORD = 0x04000000; +pub const DI_FLAGSEX_NO_CLASSLIST_NODE_MERGE: DWORD = 0x08000000; +pub const DI_FLAGSEX_ALTPLATFORM_DRVSEARCH: DWORD = 0x10000000; +pub const DI_FLAGSEX_RESTART_DEVICE_ONLY: DWORD = 0x20000000; +pub const DI_FLAGSEX_RECURSIVESEARCH: DWORD = 0x40000000; +pub const DI_FLAGSEX_SEARCH_PUBLISHED_INFS: DWORD = 0x80000000; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_CLASSINSTALL_HEADER { + cbSize: DWORD, + InstallFunction: DI_FUNCTION, +}} +pub type PSP_CLASSINSTALL_HEADER = *mut SP_CLASSINSTALL_HEADER; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_ENABLECLASS_PARAMS { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + ClassGuid: GUID, + EnableMessage: DWORD, +}} +pub type PSP_ENABLECLASS_PARAMS = *mut SP_ENABLECLASS_PARAMS; +pub const ENABLECLASS_QUERY: DWORD = 0; +pub const ENABLECLASS_SUCCESS: DWORD = 1; +pub const ENABLECLASS_FAILURE: DWORD = 2; +pub const DICS_ENABLE: DWORD = 0x00000001; +pub const DICS_DISABLE: DWORD = 0x00000002; +pub const DICS_PROPCHANGE: DWORD = 0x00000003; +pub const DICS_START: DWORD = 0x00000004; +pub const DICS_STOP: DWORD = 0x00000005; +pub const DICS_FLAG_GLOBAL: DWORD = 0x00000001; +pub const DICS_FLAG_CONFIGSPECIFIC: DWORD = 0x00000002; +pub const DICS_FLAG_CONFIGGENERAL: DWORD = 0x00000004; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_PROPCHANGE_PARAMS { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + StateChange: DWORD, + Scope: DWORD, + HwProfile: DWORD, +}} +pub type PSP_PROPCHANGE_PARAMS = *mut SP_PROPCHANGE_PARAMS; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_REMOVEDEVICE_PARAMS { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + Scope: DWORD, + HwProfile: DWORD, +}} +pub type PSP_REMOVEDEVICE_PARAMS = *mut SP_REMOVEDEVICE_PARAMS; +pub const DI_REMOVEDEVICE_GLOBAL: DWORD = 0x00000001; +pub const DI_REMOVEDEVICE_CONFIGSPECIFIC: DWORD = 0x00000002; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_UNREMOVEDEVICE_PARAMS { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + Scope: DWORD, + HwProfile: DWORD, +}} +pub type PSP_UNREMOVEDEVICE_PARAMS = *mut SP_UNREMOVEDEVICE_PARAMS; +pub const DI_UNREMOVEDEVICE_CONFIGSPECIFIC: DWORD = 0x00000002; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_SELECTDEVICE_PARAMS_A { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + Title: [CHAR; MAX_TITLE_LEN], + Instructions: [CHAR; MAX_INSTRUCTION_LEN], + ListLabel: [CHAR; MAX_LABEL_LEN], + SubTitle: [CHAR; MAX_SUBTITLE_LEN], + Reserved: [BYTE; 2], +}} +pub type PSP_SELECTDEVICE_PARAMS_A = *mut SP_SELECTDEVICE_PARAMS_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_SELECTDEVICE_PARAMS_W { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + Title: [WCHAR; MAX_TITLE_LEN], + Instructions: [WCHAR; MAX_INSTRUCTION_LEN], + ListLabel: [WCHAR; MAX_LABEL_LEN], + SubTitle: [WCHAR; MAX_SUBTITLE_LEN], +}} +pub type PSP_SELECTDEVICE_PARAMS_W = *mut SP_SELECTDEVICE_PARAMS_W; +FN!{stdcall PDETECT_PROGRESS_NOTIFY( + ProgressNotifyParam: PVOID, + DetectComplete: DWORD, +) -> BOOL} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DETECTDEVICE_PARAMS { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + DetectProgressNotify: PDETECT_PROGRESS_NOTIFY, + ProgressNotifyParam: PVOID, +}} +pub type PSP_DETECTDEVICE_PARAMS = *mut SP_DETECTDEVICE_PARAMS; +pub const MAX_INSTALLWIZARD_DYNAPAGES: usize = 20; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INSTALLWIZARD_DATA { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + Flags: DWORD, + DynamicPages: [HPROPSHEETPAGE; MAX_INSTALLWIZARD_DYNAPAGES], + NumDynamicPages: DWORD, + DynamicPageFlags: DWORD, + PrivateFlags: DWORD, + PrivateData: LPARAM, + hwndWizardDlg: HWND, +}} +pub type PSP_INSTALLWIZARD_DATA = *mut SP_INSTALLWIZARD_DATA; +pub const NDW_INSTALLFLAG_DIDFACTDEFS: DWORD = 0x00000001; +pub const NDW_INSTALLFLAG_HARDWAREALLREADYIN: DWORD = 0x00000002; +pub const NDW_INSTALLFLAG_NEEDRESTART: DWORD = DI_NEEDRESTART; +pub const NDW_INSTALLFLAG_NEEDREBOOT: DWORD = DI_NEEDREBOOT; +pub const NDW_INSTALLFLAG_NEEDSHUTDOWN: DWORD = 0x00000200; +pub const NDW_INSTALLFLAG_EXPRESSINTRO: DWORD = 0x00000400; +pub const NDW_INSTALLFLAG_SKIPISDEVINSTALLED: DWORD = 0x00000800; +pub const NDW_INSTALLFLAG_NODETECTEDDEVS: DWORD = 0x00001000; +pub const NDW_INSTALLFLAG_INSTALLSPECIFIC: DWORD = 0x00002000; +pub const NDW_INSTALLFLAG_SKIPCLASSLIST: DWORD = 0x00004000; +pub const NDW_INSTALLFLAG_CI_PICKED_OEM: DWORD = 0x00008000; +pub const NDW_INSTALLFLAG_PCMCIAMODE: DWORD = 0x00010000; +pub const NDW_INSTALLFLAG_PCMCIADEVICE: DWORD = 0x00020000; +pub const NDW_INSTALLFLAG_USERCANCEL: DWORD = 0x00040000; +pub const NDW_INSTALLFLAG_KNOWNCLASS: DWORD = 0x00080000; +pub const DYNAWIZ_FLAG_PAGESADDED: DWORD = 0x00000001; +pub const DYNAWIZ_FLAG_ANALYZE_HANDLECONFLICT: DWORD = 0x00000008; +pub const DYNAWIZ_FLAG_INSTALLDET_NEXT: DWORD = 0x00000002; +pub const DYNAWIZ_FLAG_INSTALLDET_PREV: DWORD = 0x00000004; +pub const MIN_IDD_DYNAWIZ_RESOURCE_ID: c_int = 10000; +pub const MAX_IDD_DYNAWIZ_RESOURCE_ID: c_int = 11000; +pub const IDD_DYNAWIZ_FIRSTPAGE: c_int = 10000; +pub const IDD_DYNAWIZ_SELECT_PREVPAGE: c_int = 10001; +pub const IDD_DYNAWIZ_SELECT_NEXTPAGE: c_int = 10002; +pub const IDD_DYNAWIZ_ANALYZE_PREVPAGE: c_int = 10003; +pub const IDD_DYNAWIZ_ANALYZE_NEXTPAGE: c_int = 10004; +pub const IDD_DYNAWIZ_SELECTDEV_PAGE: c_int = 10009; +pub const IDD_DYNAWIZ_ANALYZEDEV_PAGE: c_int = 10010; +pub const IDD_DYNAWIZ_INSTALLDETECTEDDEVS_PAGE: c_int = 10011; +pub const IDD_DYNAWIZ_SELECTCLASS_PAGE: c_int = 10012; +pub const IDD_DYNAWIZ_INSTALLDETECTED_PREVPAGE: c_int = 10006; +pub const IDD_DYNAWIZ_INSTALLDETECTED_NEXTPAGE: c_int = 10007; +pub const IDD_DYNAWIZ_INSTALLDETECTED_NODEVS: c_int = 10008; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_NEWDEVICEWIZARD_DATA { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + Flags: DWORD, + DynamicPages: [HPROPSHEETPAGE; MAX_INSTALLWIZARD_DYNAPAGES], + NumDynamicPages: DWORD, + hwndWizardDlg: HWND, +}} +pub type PSP_NEWDEVICEWIZARD_DATA = *mut SP_NEWDEVICEWIZARD_DATA; +pub type SP_ADDPROPERTYPAGE_DATA = SP_NEWDEVICEWIZARD_DATA; +pub type PSP_ADDPROPERTYPAGE_DATA = PSP_NEWDEVICEWIZARD_DATA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_TROUBLESHOOTER_PARAMS_A { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + ChmFile: [CHAR; MAX_PATH], + HtmlTroubleShooter: [CHAR; MAX_PATH], +}} +pub type PSP_TROUBLESHOOTER_PARAMS_A = *mut SP_TROUBLESHOOTER_PARAMS_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_TROUBLESHOOTER_PARAMS_W { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + ChmFile: [WCHAR; MAX_PATH], + HtmlTroubleShooter: [WCHAR; MAX_PATH], +}} +pub type PSP_TROUBLESHOOTER_PARAMS_W = *mut SP_TROUBLESHOOTER_PARAMS_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_POWERMESSAGEWAKE_PARAMS_A { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + PowerMessageWake: [CHAR; LINE_LEN * 2], +}} +pub type PSP_POWERMESSAGEWAKE_PARAMS_A = *mut SP_POWERMESSAGEWAKE_PARAMS_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_POWERMESSAGEWAKE_PARAMS_W { + ClassInstallHeader: SP_CLASSINSTALL_HEADER, + PowerMessageWake: [WCHAR; LINE_LEN * 2], +}} +pub type PSP_POWERMESSAGEWAKE_PARAMS_W = *mut SP_POWERMESSAGEWAKE_PARAMS_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DATA_V2_A { + cbSize: DWORD, + DriverType: DWORD, + Reserved: ULONG_PTR, + Description: [CHAR; LINE_LEN], + MfgName: [CHAR; LINE_LEN], + ProviderName: [CHAR; LINE_LEN], + DriverDate: FILETIME, + DriverVersion: DWORDLONG, +}} +pub type PSP_DRVINFO_DATA_V2_A = *mut SP_DRVINFO_DATA_V2_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DATA_V2_W { + cbSize: DWORD, + DriverType: DWORD, + Reserved: ULONG_PTR, + Description: [WCHAR; LINE_LEN], + MfgName: [WCHAR; LINE_LEN], + ProviderName: [WCHAR; LINE_LEN], + DriverDate: FILETIME, + DriverVersion: DWORDLONG, +}} +pub type PSP_DRVINFO_DATA_V2_W = *mut SP_DRVINFO_DATA_V2_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DATA_V1_A { + cbSize: DWORD, + DriverType: DWORD, + Reserved: ULONG_PTR, + Description: [CHAR; LINE_LEN], + MfgName: [CHAR; LINE_LEN], + ProviderName: [CHAR; LINE_LEN], +}} +pub type PSP_DRVINFO_DATA_V1_A = *mut SP_DRVINFO_DATA_V1_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DATA_V1_W { + cbSize: DWORD, + DriverType: DWORD, + Reserved: ULONG_PTR, + Description: [WCHAR; LINE_LEN], + MfgName: [WCHAR; LINE_LEN], + ProviderName: [WCHAR; LINE_LEN], +}} +pub type PSP_DRVINFO_DATA_V1_W = *mut SP_DRVINFO_DATA_V1_W; +pub type SP_DRVINFO_DATA_A = SP_DRVINFO_DATA_V2_A; +pub type PSP_DRVINFO_DATA_A = PSP_DRVINFO_DATA_V2_A; +pub type SP_DRVINFO_DATA_W = SP_DRVINFO_DATA_V2_W; +pub type PSP_DRVINFO_DATA_W = PSP_DRVINFO_DATA_V2_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DETAIL_DATA_A { + cbSize: DWORD, + InfDate: FILETIME, + CompatIDsOffset: DWORD, + CompatIDsLength: DWORD, + Reserved: ULONG_PTR, + SectionName: [CHAR; LINE_LEN], + InfFileName: [CHAR; MAX_PATH], + DrvDescription: [CHAR; LINE_LEN], + HardwareID: [CHAR; ANYSIZE_ARRAY], +}} +pub type PSP_DRVINFO_DETAIL_DATA_A = *mut SP_DRVINFO_DETAIL_DATA_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINFO_DETAIL_DATA_W { + cbSize: DWORD, + InfDate: FILETIME, + CompatIDsOffset: DWORD, + CompatIDsLength: DWORD, + Reserved: ULONG_PTR, + SectionName: [WCHAR; LINE_LEN], + InfFileName: [WCHAR; MAX_PATH], + DrvDescription: [WCHAR; LINE_LEN], + HardwareID: [WCHAR; ANYSIZE_ARRAY], +}} +pub type PSP_DRVINFO_DETAIL_DATA_W = *mut SP_DRVINFO_DETAIL_DATA_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_DRVINSTALL_PARAMS { + cbSize: DWORD, + Rank: DWORD, + Flags: DWORD, + PrivateData: DWORD_PTR, + Reserved: DWORD, +}} +pub type PSP_DRVINSTALL_PARAMS = *mut SP_DRVINSTALL_PARAMS; +pub const DNF_DUPDESC: DWORD = 0x00000001; +pub const DNF_OLDDRIVER: DWORD = 0x00000002; +pub const DNF_EXCLUDEFROMLIST: DWORD = 0x00000004; +pub const DNF_NODRIVER: DWORD = 0x00000008; +pub const DNF_LEGACYINF: DWORD = 0x00000010; +pub const DNF_CLASS_DRIVER: DWORD = 0x00000020; +pub const DNF_COMPATIBLE_DRIVER: DWORD = 0x00000040; +pub const DNF_INET_DRIVER: DWORD = 0x00000080; +pub const DNF_UNUSED1: DWORD = 0x00000100; +pub const DNF_UNUSED2: DWORD = 0x00000200; +pub const DNF_OLD_INET_DRIVER: DWORD = 0x00000400; +pub const DNF_BAD_DRIVER: DWORD = 0x00000800; +pub const DNF_DUPPROVIDER: DWORD = 0x00001000; +pub const DNF_INF_IS_SIGNED: DWORD = 0x00002000; +pub const DNF_OEM_F6_INF: DWORD = 0x00004000; +pub const DNF_DUPDRIVERVER: DWORD = 0x00008000; +pub const DNF_BASIC_DRIVER: DWORD = 0x00010000; +pub const DNF_AUTHENTICODE_SIGNED: DWORD = 0x00020000; +pub const DNF_INSTALLEDDRIVER: DWORD = 0x00040000; +pub const DNF_ALWAYSEXCLUDEFROMLIST: DWORD = 0x00080000; +pub const DNF_INBOX_DRIVER: DWORD = 0x00100000; +pub const DNF_REQUESTADDITIONALSOFTWARE: DWORD = 0x00200000; +pub const DNF_UNUSED_22: DWORD = 0x00400000; +pub const DNF_UNUSED_23: DWORD = 0x00800000; +pub const DNF_UNUSED_24: DWORD = 0x01000000; +pub const DNF_UNUSED_25: DWORD = 0x02000000; +pub const DNF_UNUSED_26: DWORD = 0x04000000; +pub const DNF_UNUSED_27: DWORD = 0x08000000; +pub const DNF_UNUSED_28: DWORD = 0x10000000; +pub const DNF_UNUSED_29: DWORD = 0x20000000; +pub const DNF_UNUSED_30: DWORD = 0x40000000; +pub const DNF_UNUSED_31: DWORD = 0x80000000; +pub const DRIVER_HARDWAREID_RANK: DWORD = 0x00000FFF; +pub const DRIVER_HARDWAREID_MASK: DWORD = 0x80000FFF; +pub const DRIVER_UNTRUSTED_RANK: DWORD = 0x80000000; +pub const DRIVER_W9X_SUSPECT_RANK: DWORD = 0xC0000000; +FN!{stdcall PSP_DETSIG_CMPPROC( + DeviceInfoSet: HDEVINFO, + NewDeviceData: PSP_DEVINFO_DATA, + ExistingDeviceData: PSP_DEVINFO_DATA, + CompareContext: PVOID, +) -> DWORD} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct COINSTALLER_CONTEXT_DATA { + PostProcessing: BOOL, + InstallResult: DWORD, + PrivateData: PVOID, +}} +pub type PCOINSTALLER_CONTEXT_DATA = *mut COINSTALLER_CONTEXT_DATA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_CLASSIMAGELIST_DATA { + cbSize: DWORD, + ImageList: HIMAGELIST, + Reserved: ULONG_PTR, +}} +pub type PSP_CLASSIMAGELIST_DATA = *mut SP_CLASSIMAGELIST_DATA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_PROPSHEETPAGE_REQUEST { + cbSize: DWORD, + PageRequested: DWORD, + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, +}} +pub type PSP_PROPSHEETPAGE_REQUEST = *mut SP_PROPSHEETPAGE_REQUEST; +pub const SPPSR_SELECT_DEVICE_RESOURCES: DWORD = 1; +pub const SPPSR_ENUM_BASIC_DEVICE_PROPERTIES: DWORD = 2; +pub const SPPSR_ENUM_ADV_DEVICE_PROPERTIES: DWORD = 3; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_BACKUP_QUEUE_PARAMS_V2_A { + cbSize: DWORD, + FullInfPath: [CHAR; MAX_PATH], + FilenameOffset: INT, + ReinstallInstance: [CHAR; MAX_PATH], +}} +pub type PSP_BACKUP_QUEUE_PARAMS_V2_A = *mut SP_BACKUP_QUEUE_PARAMS_V2_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_BACKUP_QUEUE_PARAMS_V2_W { + cbSize: DWORD, + FullInfPath: [WCHAR; MAX_PATH], + FilenameOffset: INT, + ReinstallInstance: [WCHAR; MAX_PATH], +}} +pub type PSP_BACKUP_QUEUE_PARAMS_V2_W = *mut SP_BACKUP_QUEUE_PARAMS_V2_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_BACKUP_QUEUE_PARAMS_V1_A { + cbSize: DWORD, + FullInfPath: [CHAR; MAX_PATH], + FilenameOffset: INT, +}} +pub type PSP_BACKUP_QUEUE_PARAMS_V1_A = *mut SP_BACKUP_QUEUE_PARAMS_V1_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_BACKUP_QUEUE_PARAMS_V1_W { + cbSize: DWORD, + FullInfPath: [WCHAR; MAX_PATH], + FilenameOffset: INT, +}} +pub type PSP_BACKUP_QUEUE_PARAMS_V1_W = *mut SP_BACKUP_QUEUE_PARAMS_V1_W; +pub type SP_BACKUP_QUEUE_PARAMS_A = SP_BACKUP_QUEUE_PARAMS_V2_A; +pub type PSP_BACKUP_QUEUE_PARAMS_A = PSP_BACKUP_QUEUE_PARAMS_V2_A; +pub type SP_BACKUP_QUEUE_PARAMS_W = SP_BACKUP_QUEUE_PARAMS_V2_W; +pub type PSP_BACKUP_QUEUE_PARAMS_W = PSP_BACKUP_QUEUE_PARAMS_V2_W; +pub const ERROR_EXPECTED_SECTION_NAME: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0; +pub const ERROR_BAD_SECTION_NAME_LINE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 1; +pub const ERROR_SECTION_NAME_TOO_LONG: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 2; +pub const ERROR_GENERAL_SYNTAX: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 3; +pub const ERROR_WRONG_INF_STYLE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x100; +pub const ERROR_SECTION_NOT_FOUND: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x101; +pub const ERROR_LINE_NOT_FOUND: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x102; +pub const ERROR_NO_BACKUP: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x103; +pub const ERROR_NO_ASSOCIATED_CLASS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x200; +pub const ERROR_CLASS_MISMATCH: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x201; +pub const ERROR_DUPLICATE_FOUND: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x202; +pub const ERROR_NO_DRIVER_SELECTED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x203; +pub const ERROR_KEY_DOES_NOT_EXIST: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x204; +pub const ERROR_INVALID_DEVINST_NAME: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x205; +pub const ERROR_INVALID_CLASS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x206; +pub const ERROR_DEVINST_ALREADY_EXISTS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x207; +pub const ERROR_DEVINFO_NOT_REGISTERED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x208; +pub const ERROR_INVALID_REG_PROPERTY: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x209; +pub const ERROR_NO_INF: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x20A; +pub const ERROR_NO_SUCH_DEVINST: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x20B; +pub const ERROR_CANT_LOAD_CLASS_ICON: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x20C; +pub const ERROR_INVALID_CLASS_INSTALLER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x20D; +pub const ERROR_DI_DO_DEFAULT: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x20E; +pub const ERROR_DI_NOFILECOPY: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x20F; +pub const ERROR_INVALID_HWPROFILE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x210; +pub const ERROR_NO_DEVICE_SELECTED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x211; +pub const ERROR_DEVINFO_LIST_LOCKED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x212; +pub const ERROR_DEVINFO_DATA_LOCKED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x213; +pub const ERROR_DI_BAD_PATH: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x214; +pub const ERROR_NO_CLASSINSTALL_PARAMS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x215; +pub const ERROR_FILEQUEUE_LOCKED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x216; +pub const ERROR_BAD_SERVICE_INSTALLSECT: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x217; +pub const ERROR_NO_CLASS_DRIVER_LIST: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x218; +pub const ERROR_NO_ASSOCIATED_SERVICE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x219; +pub const ERROR_NO_DEFAULT_DEVICE_INTERFACE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x21A; +pub const ERROR_DEVICE_INTERFACE_ACTIVE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x21B; +pub const ERROR_DEVICE_INTERFACE_REMOVED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x21C; +pub const ERROR_BAD_INTERFACE_INSTALLSECT: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x21D; +pub const ERROR_NO_SUCH_INTERFACE_CLASS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x21E; +pub const ERROR_INVALID_REFERENCE_STRING: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x21F; +pub const ERROR_INVALID_MACHINENAME: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x220; +pub const ERROR_REMOTE_COMM_FAILURE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x221; +pub const ERROR_MACHINE_UNAVAILABLE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x222; +pub const ERROR_NO_CONFIGMGR_SERVICES: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x223; +pub const ERROR_INVALID_PROPPAGE_PROVIDER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x224; +pub const ERROR_NO_SUCH_DEVICE_INTERFACE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x225; +pub const ERROR_DI_POSTPROCESSING_REQUIRED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x226; +pub const ERROR_INVALID_COINSTALLER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x227; +pub const ERROR_NO_COMPAT_DRIVERS: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x228; +pub const ERROR_NO_DEVICE_ICON: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x229; +pub const ERROR_INVALID_INF_LOGCONFIG: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x22A; +pub const ERROR_DI_DONT_INSTALL: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x22B; +pub const ERROR_INVALID_FILTER_DRIVER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x22C; +pub const ERROR_NON_WINDOWS_NT_DRIVER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x22D; +pub const ERROR_NON_WINDOWS_DRIVER: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x22E; +pub const ERROR_NO_CATALOG_FOR_OEM_INF: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x22F; +pub const ERROR_DEVINSTALL_QUEUE_NONNATIVE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x230; +pub const ERROR_NOT_DISABLEABLE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x231; +pub const ERROR_CANT_REMOVE_DEVINST: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x232; +pub const ERROR_INVALID_TARGET: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x233; +pub const ERROR_DRIVER_NONNATIVE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x234; +pub const ERROR_IN_WOW64: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x235; +pub const ERROR_SET_SYSTEM_RESTORE_POINT: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x236; +pub const ERROR_SCE_DISABLED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x238; +pub const ERROR_UNKNOWN_EXCEPTION: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x239; +pub const ERROR_PNP_REGISTRY_ERROR: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x23A; +pub const ERROR_REMOTE_REQUEST_UNSUPPORTED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x23B; +pub const ERROR_NOT_AN_INSTALLED_OEM_INF: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x23C; +pub const ERROR_INF_IN_USE_BY_DEVICES: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x23D; +pub const ERROR_DI_FUNCTION_OBSOLETE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x23E; +pub const ERROR_NO_AUTHENTICODE_CATALOG: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x23F; +pub const ERROR_AUTHENTICODE_DISALLOWED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x240; +pub const ERROR_AUTHENTICODE_TRUSTED_PUBLISHER: DWORD = APPLICATION_ERROR_MASK + | ERROR_SEVERITY_ERROR | 0x241; +pub const ERROR_AUTHENTICODE_TRUST_NOT_ESTABLISHED: DWORD = APPLICATION_ERROR_MASK + | ERROR_SEVERITY_ERROR | 0x242; +pub const ERROR_AUTHENTICODE_PUBLISHER_NOT_TRUSTED: DWORD = APPLICATION_ERROR_MASK + | ERROR_SEVERITY_ERROR | 0x243; +pub const ERROR_SIGNATURE_OSATTRIBUTE_MISMATCH: DWORD = APPLICATION_ERROR_MASK + | ERROR_SEVERITY_ERROR | 0x244; +pub const ERROR_ONLY_VALIDATE_VIA_AUTHENTICODE: DWORD = APPLICATION_ERROR_MASK + | ERROR_SEVERITY_ERROR | 0x245; +pub const ERROR_DEVICE_INSTALLER_NOT_READY: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x246; +pub const ERROR_DRIVER_STORE_ADD_FAILED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x247; +pub const ERROR_DEVICE_INSTALL_BLOCKED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x248; +pub const ERROR_DRIVER_INSTALL_BLOCKED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x249; +pub const ERROR_WRONG_INF_TYPE: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR | 0x24A; +pub const ERROR_FILE_HASH_NOT_IN_CATALOG: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x24B; +pub const ERROR_DRIVER_STORE_DELETE_FAILED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x24C; +pub const ERROR_UNRECOVERABLE_STACK_OVERFLOW: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x300; +pub const EXCEPTION_SPAPI_UNRECOVERABLE_STACK_OVERFLOW: DWORD = ERROR_UNRECOVERABLE_STACK_OVERFLOW; +pub const ERROR_NO_DEFAULT_INTERFACE_DEVICE: DWORD = ERROR_NO_DEFAULT_DEVICE_INTERFACE; +pub const ERROR_INTERFACE_DEVICE_ACTIVE: DWORD = ERROR_DEVICE_INTERFACE_ACTIVE; +pub const ERROR_INTERFACE_DEVICE_REMOVED: DWORD = ERROR_DEVICE_INTERFACE_REMOVED; +pub const ERROR_NO_SUCH_INTERFACE_DEVICE: DWORD = ERROR_NO_SUCH_DEVICE_INTERFACE; +pub const ERROR_NOT_INSTALLED: DWORD = APPLICATION_ERROR_MASK | ERROR_SEVERITY_ERROR + | 0x1000; +extern "system" { + pub fn SetupGetInfInformationA( + InfSpec: LPCVOID, + SearchControl: DWORD, + ReturnBuffer: PSP_INF_INFORMATION, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetInfInformationW( + InfSpec: LPCVOID, + SearchControl: DWORD, + ReturnBuffer: PSP_INF_INFORMATION, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; +} +pub const INFINFO_INF_SPEC_IS_HINF: DWORD = 1; +pub const INFINFO_INF_NAME_IS_ABSOLUTE: DWORD = 2; +pub const INFINFO_DEFAULT_SEARCH: DWORD = 3; +pub const INFINFO_REVERSE_DEFAULT_SEARCH: DWORD = 4; +pub const INFINFO_INF_PATH_LIST_SEARCH: DWORD = 5; +extern "system" { + pub fn SetupQueryInfFileInformationA( + InfInformation: PSP_INF_INFORMATION, + InfIndex: UINT, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupQueryInfFileInformationW( + InfInformation: PSP_INF_INFORMATION, + InfIndex: UINT, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupQueryInfOriginalFileInformationA( + InfInformation: PSP_INF_INFORMATION, + InfIndex: UINT, + AlternatePlatformInfo: PSP_ALTPLATFORM_INFO, + OriginalFileInfo: PSP_ORIGINAL_FILE_INFO_A, + ) -> BOOL; + pub fn SetupQueryInfOriginalFileInformationW( + InfInformation: PSP_INF_INFORMATION, + InfIndex: UINT, + AlternatePlatformInfo: PSP_ALTPLATFORM_INFO, + OriginalFileInfo: PSP_ORIGINAL_FILE_INFO_W, + ) -> BOOL; + pub fn SetupQueryInfVersionInformationA( + InfInformation: PSP_INF_INFORMATION, + InfIndex: UINT, + Key: PCSTR, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupQueryInfVersionInformationW( + InfInformation: PSP_INF_INFORMATION, + InfIndex: UINT, + Key: PCWSTR, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetInfDriverStoreLocationA( + FileName: PCSTR, + AlternatePlatformInfo: PSP_ALTPLATFORM_INFO, + LocaleName: PCSTR, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetInfDriverStoreLocationW( + FileName: PCWSTR, + AlternatePlatformInfo: PSP_ALTPLATFORM_INFO, + LocaleName: PCWSTR, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetInfPublishedNameA( + DriverStoreLocation: PCSTR, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetInfPublishedNameW( + DriverStoreLocation: PCWSTR, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetInfFileListA( + DirectoryPath: PCSTR, + InfStyle: DWORD, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetInfFileListW( + DirectoryPath: PCWSTR, + InfStyle: DWORD, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupOpenInfFileW( + FileName: PCWSTR, + InfClass: PCWSTR, + InfStyle: DWORD, + ErrorLine: PUINT, + ) -> HINF; + pub fn SetupOpenInfFileA( + FileName: PCSTR, + InfClass: PCSTR, + InfStyle: DWORD, + ErrorLine: PUINT, + ) -> HINF; + pub fn SetupOpenMasterInf() -> HINF; + pub fn SetupOpenAppendInfFileW( + FileName: PCWSTR, + InfHandle: HINF, + ErrorLine: PUINT, + ) -> BOOL; + pub fn SetupOpenAppendInfFileA( + FileName: PCSTR, + InfHandle: HINF, + ErrorLine: PUINT, + ) -> BOOL; + pub fn SetupCloseInfFile( + InfHandle: HINF, + ) -> (); + pub fn SetupFindFirstLineA( + InfHandle: HINF, + Section: PCSTR, + Key: PCSTR, + Context: PINFCONTEXT, + ) -> BOOL; + pub fn SetupFindFirstLineW( + InfHandle: HINF, + Section: PCWSTR, + Key: PCWSTR, + Context: PINFCONTEXT, + ) -> BOOL; + pub fn SetupFindNextLine( + ContextIn: PINFCONTEXT, + ContextOut: PINFCONTEXT, + ) -> BOOL; + pub fn SetupFindNextMatchLineA( + ContextIn: PINFCONTEXT, + Key: PCSTR, + ContextOut: PINFCONTEXT, + ) -> BOOL; + pub fn SetupFindNextMatchLineW( + ContextIn: PINFCONTEXT, + Key: PCWSTR, + ContextOut: PINFCONTEXT, + ) -> BOOL; + pub fn SetupGetLineByIndexA( + InfHandle: HINF, + Section: PCSTR, + Index: DWORD, + Context: PINFCONTEXT, + ) -> BOOL; + pub fn SetupGetLineByIndexW( + InfHandle: HINF, + Section: PCWSTR, + Index: DWORD, + Context: PINFCONTEXT, + ) -> BOOL; + pub fn SetupGetLineCountA( + InfHandle: HINF, + Section: PCSTR, + ) -> LONG; + pub fn SetupGetLineCountW( + InfHandle: HINF, + Section: PCWSTR, + ) -> LONG; + pub fn SetupGetLineTextA( + Context: PINFCONTEXT, + InfHandle: HINF, + Section: PCSTR, + Key: PCSTR, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + ReturnBufferSize: PDWORD, + ) -> BOOL; + pub fn SetupGetLineTextW( + Context: PINFCONTEXT, + InfHandle: HINF, + Section: PCWSTR, + Key: PCWSTR, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + ReturnBufferSize: PDWORD, + ) -> BOOL; + pub fn SetupGetFieldCount( + Context: PINFCONTEXT, + ) -> DWORD; + pub fn SetupGetStringFieldA( + Context: PINFCONTEXT, + FieldIndex: DWORD, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetStringFieldW( + Context: PINFCONTEXT, + FieldIndex: DWORD, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetIntField( + Context: PINFCONTEXT, + FieldIndex: DWORD, + IntegerValue: PINT, + ) -> BOOL; + pub fn SetupGetMultiSzFieldA( + Context: PINFCONTEXT, + FieldIndex: DWORD, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: LPDWORD, + ) -> BOOL; + pub fn SetupGetMultiSzFieldW( + Context: PINFCONTEXT, + FieldIndex: DWORD, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: LPDWORD, + ) -> BOOL; + pub fn SetupGetBinaryField( + Context: PINFCONTEXT, + FieldIndex: DWORD, + ReturnBuffer: PBYTE, + ReturnBufferSize: DWORD, + RequiredSize: LPDWORD, + ) -> BOOL; + pub fn SetupGetFileCompressionInfoA( + SourceFileName: PCSTR, + ActualSourceFileName: *mut PSTR, + SourceFileSize: PDWORD, + TargetFileSize: PDWORD, + CompressionType: PUINT, + ) -> DWORD; + pub fn SetupGetFileCompressionInfoW( + SourceFileName: PCWSTR, + ActualSourceFileName: *mut PWSTR, + SourceFileSize: PDWORD, + TargetFileSize: PDWORD, + CompressionType: PUINT, + ) -> DWORD; + pub fn SetupGetFileCompressionInfoExA( + SourceFileName: PCSTR, + ActualSourceFileNameBuffer: PSTR, + ActualSourceFileNameBufferLen: DWORD, + RequiredBufferLen: PDWORD, + SourceFileSize: PDWORD, + TargetFileSize: PDWORD, + CompressionType: PUINT, + ) -> BOOL; + pub fn SetupGetFileCompressionInfoExW( + SourceFileName: PCWSTR, + ActualSourceFileNameBuffer: PWSTR, + ActualSourceFileNameBufferLen: DWORD, + RequiredBufferLen: PDWORD, + SourceFileSize: PDWORD, + TargetFileSize: PDWORD, + CompressionType: PUINT, + ) -> BOOL; +} +pub const FILE_COMPRESSION_NONE: UINT = 0; +pub const FILE_COMPRESSION_WINLZA: UINT = 1; +pub const FILE_COMPRESSION_MSZIP: UINT = 2; +pub const FILE_COMPRESSION_NTCAB: UINT = 3; +extern "system" { + pub fn SetupDecompressOrCopyFileA( + SourceFileName: PCSTR, + TargetFileName: PCSTR, + CompressionType: PUINT, + ) -> DWORD; + pub fn SetupDecompressOrCopyFileW( + SourceFileName: PCWSTR, + TargetFileName: PCWSTR, + CompressionType: PUINT, + ) -> DWORD; + pub fn SetupGetSourceFileLocationA( + InfHandle: HINF, + InfContext: PINFCONTEXT, + FileName: PCSTR, + SourceId: PUINT, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetSourceFileLocationW( + InfHandle: HINF, + InfContext: PINFCONTEXT, + FileName: PCWSTR, + SourceId: PUINT, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetSourceFileSizeA( + InfHandle: HINF, + InfContext: PINFCONTEXT, + FileName: PCSTR, + Section: PCSTR, + FileSize: PDWORD, + RoundingFactor: UINT, + ) -> BOOL; + pub fn SetupGetSourceFileSizeW( + InfHandle: HINF, + InfContext: PINFCONTEXT, + FileName: PCWSTR, + Section: PCWSTR, + FileSize: PDWORD, + RoundingFactor: UINT, + ) -> BOOL; + pub fn SetupGetTargetPathA( + InfHandle: HINF, + InfContext: PINFCONTEXT, + Section: PCSTR, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetTargetPathW( + InfHandle: HINF, + InfContext: PINFCONTEXT, + Section: PCWSTR, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; +} +pub const SRCLIST_TEMPORARY: DWORD = 0x00000001; +pub const SRCLIST_NOBROWSE: DWORD = 0x00000002; +pub const SRCLIST_SYSTEM: DWORD = 0x00000010; +pub const SRCLIST_USER: DWORD = 0x00000020; +pub const SRCLIST_SYSIFADMIN: DWORD = 0x00000040; +pub const SRCLIST_SUBDIRS: DWORD = 0x00000100; +pub const SRCLIST_APPEND: DWORD = 0x00000200; +pub const SRCLIST_NOSTRIPPLATFORM: DWORD = 0x00000400; +extern "system" { + pub fn SetupSetSourceListA( + Flags: DWORD, + SourceList: *mut PCSTR, + SourceCount: UINT, + ) -> BOOL; + pub fn SetupSetSourceListW( + Flags: DWORD, + SourceList: *mut PCWSTR, + SourceCount: UINT, + ) -> BOOL; + pub fn SetupCancelTemporarySourceList() -> BOOL; + pub fn SetupAddToSourceListA( + Flags: DWORD, + Source: PCSTR, + ) -> BOOL; + pub fn SetupAddToSourceListW( + Flags: DWORD, + Source: PCWSTR, + ) -> BOOL; + pub fn SetupRemoveFromSourceListA( + Flags: DWORD, + Source: PCSTR, + ) -> BOOL; + pub fn SetupRemoveFromSourceListW( + Flags: DWORD, + Source: PCWSTR, + ) -> BOOL; + pub fn SetupQuerySourceListA( + Flags: DWORD, + List: *mut *mut PCSTR, + Count: PUINT, + ) -> BOOL; + pub fn SetupQuerySourceListW( + Flags: DWORD, + List: *mut *mut PCWSTR, + Count: PUINT, + ) -> BOOL; + pub fn SetupFreeSourceListA( + List: *mut *mut PCSTR, + Count: UINT, + ) -> BOOL; + pub fn SetupFreeSourceListW( + List: *mut *mut PCWSTR, + Count: UINT, + ) -> BOOL; + pub fn SetupPromptForDiskA( + hwndParent: HWND, + DialogTitle: PCSTR, + DiskName: PCSTR, + PathToSource: PCSTR, + FileSought: PCSTR, + TagFile: PCSTR, + DiskPromptStyle: DWORD, + PathBuffer: PSTR, + PathBufferSize: DWORD, + PathRequiredSize: PDWORD, + ) -> UINT; + pub fn SetupPromptForDiskW( + hwndParent: HWND, + DialogTitle: PCWSTR, + DiskName: PCWSTR, + PathToSource: PCWSTR, + FileSought: PCWSTR, + TagFile: PCWSTR, + DiskPromptStyle: DWORD, + PathBuffer: PWSTR, + PathBufferSize: DWORD, + PathRequiredSize: PDWORD, + ) -> UINT; + pub fn SetupCopyErrorA( + hwndParent: HWND, + DialogTitle: PCSTR, + DiskName: PCSTR, + PathToSource: PCSTR, + SourceFile: PCSTR, + TargetPathFile: PCSTR, + Win32ErrorCode: UINT, + Style: DWORD, + PathBuffer: PSTR, + PathBufferSize: DWORD, + PathRequiredSize: PDWORD, + ) -> UINT; + pub fn SetupCopyErrorW( + hwndParent: HWND, + DialogTitle: PCWSTR, + DiskName: PCWSTR, + PathToSource: PCWSTR, + SourceFile: PCWSTR, + TargetPathFile: PCWSTR, + Win32ErrorCode: UINT, + Style: DWORD, + PathBuffer: PWSTR, + PathBufferSize: DWORD, + PathRequiredSize: PDWORD, + ) -> UINT; + pub fn SetupRenameErrorA( + hwndParent: HWND, + DialogTitle: PCSTR, + SourceFile: PCSTR, + TargetFile: PCSTR, + Win32ErrorCode: UINT, + Style: DWORD, + ) -> UINT; + pub fn SetupRenameErrorW( + hwndParent: HWND, + DialogTitle: PCWSTR, + SourceFile: PCWSTR, + TargetFile: PCWSTR, + Win32ErrorCode: UINT, + Style: DWORD, + ) -> UINT; + pub fn SetupDeleteErrorA( + hwndParent: HWND, + DialogTitle: PCSTR, + File: PCSTR, + Win32ErrorCode: UINT, + Style: DWORD, + ) -> UINT; + pub fn SetupDeleteErrorW( + hwndParent: HWND, + DialogTitle: PCWSTR, + File: PCWSTR, + Win32ErrorCode: UINT, + Style: DWORD, + ) -> UINT; + pub fn SetupBackupErrorA( + hwndParent: HWND, + DialogTitle: PCSTR, + SourceFile: PCSTR, + TargetFile: PCSTR, + Win32ErrorCode: UINT, + Style: DWORD, + ) -> UINT; + pub fn SetupBackupErrorW( + hwndParent: HWND, + DialogTitle: PCWSTR, + SourceFile: PCWSTR, + TargetFile: PCWSTR, + Win32ErrorCode: UINT, + Style: DWORD, + ) -> UINT; +} +pub const IDF_NOBROWSE: DWORD = 0x00000001; +pub const IDF_NOSKIP: DWORD = 0x00000002; +pub const IDF_NODETAILS: DWORD = 0x00000004; +pub const IDF_NOCOMPRESSED: DWORD = 0x00000008; +pub const IDF_CHECKFIRST: DWORD = 0x00000100; +pub const IDF_NOBEEP: DWORD = 0x00000200; +pub const IDF_NOFOREGROUND: DWORD = 0x00000400; +pub const IDF_WARNIFSKIP: DWORD = 0x00000800; +pub const IDF_NOREMOVABLEMEDIAPROMPT: DWORD = 0x00001000; +pub const IDF_USEDISKNAMEASPROMPT: DWORD = 0x00002000; +pub const IDF_OEMDISK: DWORD = 0x80000000; +pub const DPROMPT_SUCCESS: UINT = 0; +pub const DPROMPT_CANCEL: UINT = 1; +pub const DPROMPT_SKIPFILE: UINT = 2; +pub const DPROMPT_BUFFERTOOSMALL: UINT = 3; +pub const DPROMPT_OUTOFMEMORY: UINT = 4; +extern "system" { + pub fn SetupSetDirectoryIdA( + InfHandle: HINF, + Id: DWORD, + Directory: PCSTR, + ) -> BOOL; + pub fn SetupSetDirectoryIdW( + InfHandle: HINF, + Id: DWORD, + Directory: PCWSTR, + ) -> BOOL; + pub fn SetupSetDirectoryIdExA( + InfHandle: HINF, + Id: DWORD, + Directory: PCSTR, + Flags: DWORD, + Reserved1: DWORD, + Reserved2: PVOID, + ) -> BOOL; + pub fn SetupSetDirectoryIdExW( + InfHandle: HINF, + Id: DWORD, + Directory: PCWSTR, + Flags: DWORD, + Reserved1: DWORD, + Reserved2: PVOID, + ) -> BOOL; +} +pub const SETDIRID_NOT_FULL_PATH: DWORD = 0x00000001; +extern "system" { + pub fn SetupGetSourceInfoA( + InfHandle: HINF, + SourceId: UINT, + InfoDesired: UINT, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupGetSourceInfoW( + InfHandle: HINF, + SourceId: UINT, + InfoDesired: UINT, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; +} +pub const SRCINFO_PATH: UINT = 1; +pub const SRCINFO_TAGFILE: UINT = 2; +pub const SRCINFO_DESCRIPTION: UINT = 3; +pub const SRCINFO_FLAGS: UINT = 4; +pub const SRCINFO_TAGFILE2: UINT = 4; +pub const SRC_FLAGS_CABFILE: UINT = 0x0010; +extern "system" { + pub fn SetupInstallFileA( + InfHandle: HINF, + InfContext: PINFCONTEXT, + SourceFile: PCSTR, + SourcePathRoot: PCSTR, + DestinationName: PCSTR, + CopyStyle: DWORD, + CopyMsgHandler: PSP_FILE_CALLBACK_A, + Context: PVOID, + ) -> BOOL; + pub fn SetupInstallFileW( + InfHandle: HINF, + InfContext: PINFCONTEXT, + SourceFile: PCWSTR, + SourcePathRoot: PCWSTR, + DestinationName: PCWSTR, + CopyStyle: DWORD, + CopyMsgHandler: PSP_FILE_CALLBACK_W, + Context: PVOID, + ) -> BOOL; + pub fn SetupInstallFileExA( + InfHandle: HINF, + InfContext: PINFCONTEXT, + SourceFile: PCSTR, + SourcePathRoot: PCSTR, + DestinationName: PCSTR, + CopyStyle: DWORD, + CopyMsgHandler: PSP_FILE_CALLBACK_A, + Context: PVOID, + FileWasInUse: PBOOL, + ) -> BOOL; + pub fn SetupInstallFileExW( + InfHandle: HINF, + InfContext: PINFCONTEXT, + SourceFile: PCWSTR, + SourcePathRoot: PCWSTR, + DestinationName: PCWSTR, + CopyStyle: DWORD, + CopyMsgHandler: PSP_FILE_CALLBACK_W, + Context: PVOID, + FileWasInUse: PBOOL, + ) -> BOOL; +} +pub const SP_COPY_DELETESOURCE: DWORD = 0x0000001; +pub const SP_COPY_REPLACEONLY: DWORD = 0x0000002; +pub const SP_COPY_NEWER: DWORD = 0x0000004; +pub const SP_COPY_NEWER_OR_SAME: DWORD = SP_COPY_NEWER; +pub const SP_COPY_NOOVERWRITE: DWORD = 0x0000008; +pub const SP_COPY_NODECOMP: DWORD = 0x0000010; +pub const SP_COPY_LANGUAGEAWARE: DWORD = 0x0000020; +pub const SP_COPY_SOURCE_ABSOLUTE: DWORD = 0x0000040; +pub const SP_COPY_SOURCEPATH_ABSOLUTE: DWORD = 0x0000080; +pub const SP_COPY_IN_USE_NEEDS_REBOOT: DWORD = 0x0000100; +pub const SP_COPY_FORCE_IN_USE: DWORD = 0x0000200; +pub const SP_COPY_NOSKIP: DWORD = 0x0000400; +pub const SP_FLAG_CABINETCONTINUATION: DWORD = 0x0000800; +pub const SP_COPY_FORCE_NOOVERWRITE: DWORD = 0x0001000; +pub const SP_COPY_FORCE_NEWER: DWORD = 0x0002000; +pub const SP_COPY_WARNIFSKIP: DWORD = 0x0004000; +pub const SP_COPY_NOBROWSE: DWORD = 0x0008000; +pub const SP_COPY_NEWER_ONLY: DWORD = 0x0010000; +pub const SP_COPY_RESERVED: DWORD = 0x0020000; +pub const SP_COPY_OEMINF_CATALOG_ONLY: DWORD = 0x0040000; +pub const SP_COPY_REPLACE_BOOT_FILE: DWORD = 0x0080000; +pub const SP_COPY_NOPRUNE: DWORD = 0x0100000; +pub const SP_COPY_OEM_F6_INF: DWORD = 0x0200000; +pub const SP_COPY_ALREADYDECOMP: DWORD = 0x0400000; +pub const SP_COPY_WINDOWS_SIGNED: DWORD = 0x1000000; +pub const SP_COPY_PNPLOCKED: DWORD = 0x2000000; +pub const SP_COPY_IN_USE_TRY_RENAME: DWORD = 0x4000000; +pub const SP_COPY_INBOX_INF: DWORD = 0x8000000; +pub const SP_COPY_HARDLINK: DWORD = 0x10000000; +pub const SP_BACKUP_BACKUPPASS: DWORD = 0x00000001; +pub const SP_BACKUP_DEMANDPASS: DWORD = 0x00000002; +pub const SP_BACKUP_SPECIAL: DWORD = 0x00000004; +pub const SP_BACKUP_BOOTFILE: DWORD = 0x00000008; +extern "system" { + pub fn SetupOpenFileQueue() -> HSPFILEQ; + pub fn SetupCloseFileQueue( + QueueHandle: HSPFILEQ, + ) -> BOOL; + pub fn SetupSetFileQueueAlternatePlatformA( + QueueHandle: HSPFILEQ, + AlternatePlatformInfo: PSP_ALTPLATFORM_INFO, + AlternateDefaultCatalogFile: PCSTR, + ) -> BOOL; + pub fn SetupSetFileQueueAlternatePlatformW( + QueueHandle: HSPFILEQ, + AlternatePlatformInfo: PSP_ALTPLATFORM_INFO, + AlternateDefaultCatalogFile: PCWSTR, + ) -> BOOL; + pub fn SetupSetPlatformPathOverrideA( + Override: PCSTR, + ) -> BOOL; + pub fn SetupSetPlatformPathOverrideW( + Override: PCWSTR, + ) -> BOOL; + pub fn SetupQueueCopyA( + QueueHandle: HSPFILEQ, + SourceRootPath: PCSTR, + SourcePath: PCSTR, + SourceFilename: PCSTR, + SourceDescription: PCSTR, + SourceTagfile: PCSTR, + TargetDirectory: PCSTR, + TargetFilename: PCSTR, + CopyStyle: DWORD, + ) -> BOOL; + pub fn SetupQueueCopyW( + QueueHandle: HSPFILEQ, + SourceRootPath: PCWSTR, + SourcePath: PCWSTR, + SourceFilename: PCWSTR, + SourceDescription: PCWSTR, + SourceTagfile: PCWSTR, + TargetDirectory: PCWSTR, + TargetFilename: PCWSTR, + CopyStyle: DWORD, + ) -> BOOL; + pub fn SetupQueueCopyIndirectA( + CopyParams: PSP_FILE_COPY_PARAMS_A, + ) -> BOOL; + pub fn SetupQueueCopyIndirectW( + CopyParams: PSP_FILE_COPY_PARAMS_W, + ) -> BOOL; + pub fn SetupQueueDefaultCopyA( + QueueHandle: HSPFILEQ, + InfHandle: HINF, + SourceRootPath: PCSTR, + SourceFilename: PCSTR, + TargetFilename: PCSTR, + CopyStyle: DWORD, + ) -> BOOL; + pub fn SetupQueueDefaultCopyW( + QueueHandle: HSPFILEQ, + InfHandle: HINF, + SourceRootPath: PCWSTR, + SourceFilename: PCWSTR, + TargetFilename: PCWSTR, + CopyStyle: DWORD, + ) -> BOOL; + pub fn SetupQueueCopySectionA( + QueueHandle: HSPFILEQ, + SourceRootPath: PCSTR, + InfHandle: HINF, + ListInfHandle: HINF, + Section: PCSTR, + CopyStyle: DWORD, + ) -> BOOL; + pub fn SetupQueueCopySectionW( + QueueHandle: HSPFILEQ, + SourceRootPath: PCWSTR, + InfHandle: HINF, + ListInfHandle: HINF, + Section: PCWSTR, + CopyStyle: DWORD, + ) -> BOOL; + pub fn SetupQueueDeleteA( + QueueHandle: HSPFILEQ, + PathPart1: PCSTR, + PathPart2: PCSTR, + ) -> BOOL; + pub fn SetupQueueDeleteW( + QueueHandle: HSPFILEQ, + PathPart1: PCWSTR, + PathPart2: PCWSTR, + ) -> BOOL; + pub fn SetupQueueDeleteSectionA( + QueueHandle: HSPFILEQ, + InfHandle: HINF, + ListInfHandle: HINF, + Section: PCSTR, + ) -> BOOL; + pub fn SetupQueueDeleteSectionW( + QueueHandle: HSPFILEQ, + InfHandle: HINF, + ListInfHandle: HINF, + Section: PCWSTR, + ) -> BOOL; + pub fn SetupQueueRenameA( + QueueHandle: HSPFILEQ, + SourcePath: PCSTR, + SourceFilename: PCSTR, + TargetPath: PCSTR, + TargetFilename: PCSTR, + ) -> BOOL; + pub fn SetupQueueRenameW( + QueueHandle: HSPFILEQ, + SourcePath: PCWSTR, + SourceFilename: PCWSTR, + TargetPath: PCWSTR, + TargetFilename: PCWSTR, + ) -> BOOL; + pub fn SetupQueueRenameSectionA( + QueueHandle: HSPFILEQ, + InfHandle: HINF, + ListInfHandle: HINF, + Section: PCSTR, + ) -> BOOL; + pub fn SetupQueueRenameSectionW( + QueueHandle: HSPFILEQ, + InfHandle: HINF, + ListInfHandle: HINF, + Section: PCWSTR, + ) -> BOOL; + pub fn SetupCommitFileQueueA( + Owner: HWND, + QueueHandle: HSPFILEQ, + MsgHandler: PSP_FILE_CALLBACK_A, + Context: PVOID, + ) -> BOOL; + pub fn SetupCommitFileQueueW( + Owner: HWND, + QueueHandle: HSPFILEQ, + MsgHandler: PSP_FILE_CALLBACK_W, + Context: PVOID, + ) -> BOOL; + pub fn SetupScanFileQueueA( + FileQueue: HSPFILEQ, + Flags: DWORD, + Window: HWND, + CallbackRoutine: PSP_FILE_CALLBACK_A, + CallbackContext: PVOID, + Result: PDWORD, + ) -> BOOL; + pub fn SetupScanFileQueueW( + FileQueue: HSPFILEQ, + Flags: DWORD, + Window: HWND, + CallbackRoutine: PSP_FILE_CALLBACK_W, + CallbackContext: PVOID, + Result: PDWORD, + ) -> BOOL; +} +pub const SPQ_SCAN_FILE_PRESENCE: DWORD = 0x00000001; +pub const SPQ_SCAN_FILE_VALIDITY: DWORD = 0x00000002; +pub const SPQ_SCAN_USE_CALLBACK: DWORD = 0x00000004; +pub const SPQ_SCAN_USE_CALLBACKEX: DWORD = 0x00000008; +pub const SPQ_SCAN_INFORM_USER: DWORD = 0x00000010; +pub const SPQ_SCAN_PRUNE_COPY_QUEUE: DWORD = 0x00000020; +pub const SPQ_SCAN_USE_CALLBACK_SIGNERINFO: DWORD = 0x00000040; +pub const SPQ_SCAN_PRUNE_DELREN: DWORD = 0x00000080; +pub const SPQ_SCAN_FILE_PRESENCE_WITHOUT_SOURCE: DWORD = 0x00000100; +pub const SPQ_SCAN_FILE_COMPARISON: DWORD = 0x00000200; +pub const SPQ_SCAN_ACTIVATE_DRP: DWORD = 0x00000400; +pub const SPQ_DELAYED_COPY: DWORD = 0x00000001; +extern "system" { + pub fn SetupGetFileQueueCount( + FileQueue: HSPFILEQ, + SubQueueFileOp: UINT, + NumOperations: PUINT, + ) -> BOOL; + pub fn SetupGetFileQueueFlags( + FileQueue: HSPFILEQ, + Flags: PDWORD, + ) -> BOOL; + pub fn SetupSetFileQueueFlags( + FileQueue: HSPFILEQ, + FlagMask: DWORD, + Flags: DWORD, + ) -> BOOL; +} +pub const SPQ_FLAG_BACKUP_AWARE: DWORD = 0x00000001; +pub const SPQ_FLAG_ABORT_IF_UNSIGNED: DWORD = 0x00000002; +pub const SPQ_FLAG_FILES_MODIFIED: DWORD = 0x00000004; +pub const SPQ_FLAG_DO_SHUFFLEMOVE: DWORD = 0x00000008; +pub const SPQ_FLAG_VALID: DWORD = 0x0000000F; +pub const SPOST_NONE: DWORD = 0; +pub const SPOST_PATH: DWORD = 1; +pub const SPOST_URL: DWORD = 2; +pub const SPOST_MAX: DWORD = 3; +extern "system" { + pub fn SetupCopyOEMInfA( + SourceInfFileName: PCSTR, + OEMSourceMediaLocation: PCSTR, + OEMSourceMediaType: DWORD, + CopyStyle: DWORD, + DestinationInfFileName: PSTR, + DestinationInfFileNameSize: DWORD, + RequiredSize: PDWORD, + DestinationInfFileNameComponent: *mut PSTR, + ) -> BOOL; + pub fn SetupCopyOEMInfW( + SourceInfFileName: PCWSTR, + OEMSourceMediaLocation: PCWSTR, + OEMSourceMediaType: DWORD, + CopyStyle: DWORD, + DestinationInfFileName: PWSTR, + DestinationInfFileNameSize: DWORD, + RequiredSize: PDWORD, + DestinationInfFileNameComponent: *mut PWSTR, + ) -> BOOL; +} +pub const SUOI_FORCEDELETE: DWORD = 0x00000001; +pub const SUOI_INTERNAL1: DWORD = 0x00000002; +extern "system" { + pub fn SetupUninstallOEMInfA( + InfFileName: PCSTR, + Flags: DWORD, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupUninstallOEMInfW( + InfFileName: PCWSTR, + Flags: DWORD, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupUninstallNewlyCopiedInfs( + FileQueue: HSPFILEQ, + Flags: DWORD, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupCreateDiskSpaceListA( + Reserved1: PVOID, + Reserved2: DWORD, + Flags: UINT, + ) -> HDSKSPC; + pub fn SetupCreateDiskSpaceListW( + Reserved1: PVOID, + Reserved2: DWORD, + Flags: UINT, + ) -> HDSKSPC; +} +pub const SPDSL_IGNORE_DISK: UINT = 0x00000001; +pub const SPDSL_DISALLOW_NEGATIVE_ADJUST: UINT = 0x00000002; +extern "system" { + pub fn SetupDuplicateDiskSpaceListA( + DiskSpace: HDSKSPC, + Reserved1: PVOID, + Reserved2: DWORD, + Flags: UINT, + ) -> HDSKSPC; + pub fn SetupDuplicateDiskSpaceListW( + DiskSpace: HDSKSPC, + Reserved1: PVOID, + Reserved2: DWORD, + Flags: UINT, + ) -> HDSKSPC; + pub fn SetupDestroyDiskSpaceList( + DiskSpace: HDSKSPC, + ) -> BOOL; + pub fn SetupQueryDrivesInDiskSpaceListA( + DiskSpace: HDSKSPC, + ReturnBuffer: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupQueryDrivesInDiskSpaceListW( + DiskSpace: HDSKSPC, + ReturnBuffer: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupQuerySpaceRequiredOnDriveA( + DiskSpace: HDSKSPC, + DriveSpec: PCSTR, + SpaceRequired: *mut LONGLONG, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupQuerySpaceRequiredOnDriveW( + DiskSpace: HDSKSPC, + DriveSpec: PCWSTR, + SpaceRequired: *mut LONGLONG, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupAdjustDiskSpaceListA( + DiskSpace: HDSKSPC, + DriveRoot: LPCSTR, + Amount: LONGLONG, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupAdjustDiskSpaceListW( + DiskSpace: HDSKSPC, + DriveRoot: LPCWSTR, + Amount: LONGLONG, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupAddToDiskSpaceListA( + DiskSpace: HDSKSPC, + TargetFilespec: PCSTR, + FileSize: LONGLONG, + Operation: UINT, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupAddToDiskSpaceListW( + DiskSpace: HDSKSPC, + TargetFilespec: PCWSTR, + FileSize: LONGLONG, + Operation: UINT, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupAddSectionToDiskSpaceListA( + DiskSpace: HDSKSPC, + InfHandle: HINF, + ListInfHandle: HINF, + SectionName: PCSTR, + Operation: UINT, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupAddSectionToDiskSpaceListW( + DiskSpace: HDSKSPC, + InfHandle: HINF, + ListInfHandle: HINF, + SectionName: PCWSTR, + Operation: UINT, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupAddInstallSectionToDiskSpaceListA( + DiskSpace: HDSKSPC, + InfHandle: HINF, + LayoutInfHandle: HINF, + SectionName: PCSTR, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupAddInstallSectionToDiskSpaceListW( + DiskSpace: HDSKSPC, + InfHandle: HINF, + LayoutInfHandle: HINF, + SectionName: PCWSTR, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupRemoveFromDiskSpaceListA( + DiskSpace: HDSKSPC, + TargetFilespec: PCSTR, + Operation: UINT, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupRemoveFromDiskSpaceListW( + DiskSpace: HDSKSPC, + TargetFilespec: PCWSTR, + Operation: UINT, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupRemoveSectionFromDiskSpaceListA( + DiskSpace: HDSKSPC, + InfHandle: HINF, + ListInfHandle: HINF, + SectionName: PCSTR, + Operation: UINT, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupRemoveSectionFromDiskSpaceListW( + DiskSpace: HDSKSPC, + InfHandle: HINF, + ListInfHandle: HINF, + SectionName: PCWSTR, + Operation: UINT, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupRemoveInstallSectionFromDiskSpaceListA( + DiskSpace: HDSKSPC, + InfHandle: HINF, + LayoutInfHandle: HINF, + SectionName: PCSTR, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupRemoveInstallSectionFromDiskSpaceListW( + DiskSpace: HDSKSPC, + InfHandle: HINF, + LayoutInfHandle: HINF, + SectionName: PCWSTR, + Reserved1: PVOID, + Reserved2: UINT, + ) -> BOOL; + pub fn SetupIterateCabinetA( + CabinetFile: PCSTR, + Reserved: DWORD, + MsgHandler: PSP_FILE_CALLBACK_A, + Context: PVOID, + ) -> BOOL; + pub fn SetupIterateCabinetW( + CabinetFile: PCWSTR, + Reserved: DWORD, + MsgHandler: PSP_FILE_CALLBACK_W, + Context: PVOID, + ) -> BOOL; + pub fn SetupPromptReboot( + FileQueue: HSPFILEQ, + Owner: HWND, + ScanOnly: BOOL, + ) -> INT; +} +pub const SPFILEQ_FILE_IN_USE: INT = 0x00000001; +pub const SPFILEQ_REBOOT_RECOMMENDED: INT = 0x00000002; +pub const SPFILEQ_REBOOT_IN_PROGRESS: INT = 0x00000004; +extern "system" { + pub fn SetupInitDefaultQueueCallback( + OwnerWindow: HWND, + ) -> PVOID; + pub fn SetupInitDefaultQueueCallbackEx( + OwnerWindow: HWND, + AlternateProgressWindow: HWND, + ProgressMessage: UINT, + Reserved1: DWORD, + Reserved2: PVOID, + ) -> PVOID; + pub fn SetupTermDefaultQueueCallback( + Context: PVOID, + ) -> (); + pub fn SetupDefaultQueueCallbackA( + Context: PVOID, + Notification: UINT, + Param1: UINT_PTR, + Param2: UINT_PTR, + ) -> UINT; + pub fn SetupDefaultQueueCallbackW( + Context: PVOID, + Notification: UINT, + Param1: UINT_PTR, + Param2: UINT_PTR, + ) -> UINT; +} +pub const FLG_ADDREG_DELREG_BIT: DWORD = 0x00008000; +pub const FLG_ADDREG_BINVALUETYPE: DWORD = 0x00000001; +pub const FLG_ADDREG_NOCLOBBER: DWORD = 0x00000002; +pub const FLG_ADDREG_DELVAL: DWORD = 0x00000004; +pub const FLG_ADDREG_APPEND: DWORD = 0x00000008; +pub const FLG_ADDREG_KEYONLY: DWORD = 0x00000010; +pub const FLG_ADDREG_OVERWRITEONLY: DWORD = 0x00000020; +pub const FLG_ADDREG_64BITKEY: DWORD = 0x00001000; +pub const FLG_ADDREG_KEYONLY_COMMON: DWORD = 0x00002000; +pub const FLG_ADDREG_32BITKEY: DWORD = 0x00004000; +pub const FLG_ADDREG_TYPE_MASK: DWORD = 0xFFFF0000 | FLG_ADDREG_BINVALUETYPE; +pub const FLG_ADDREG_TYPE_SZ: DWORD = 0x00000000; +pub const FLG_ADDREG_TYPE_MULTI_SZ: DWORD = 0x00010000; +pub const FLG_ADDREG_TYPE_EXPAND_SZ: DWORD = 0x00020000; +pub const FLG_ADDREG_TYPE_BINARY: DWORD = 0x00000000 | FLG_ADDREG_BINVALUETYPE; +pub const FLG_ADDREG_TYPE_DWORD: DWORD = 0x00010000 | FLG_ADDREG_BINVALUETYPE; +pub const FLG_ADDREG_TYPE_NONE: DWORD = 0x00020000 | FLG_ADDREG_BINVALUETYPE; +pub const FLG_DELREG_VALUE: DWORD = 0x00000000; +pub const FLG_DELREG_TYPE_MASK: DWORD = FLG_ADDREG_TYPE_MASK; +pub const FLG_DELREG_TYPE_SZ: DWORD = FLG_ADDREG_TYPE_SZ; +pub const FLG_DELREG_TYPE_MULTI_SZ: DWORD = FLG_ADDREG_TYPE_MULTI_SZ; +pub const FLG_DELREG_TYPE_EXPAND_SZ: DWORD = FLG_ADDREG_TYPE_EXPAND_SZ; +pub const FLG_DELREG_TYPE_BINARY: DWORD = FLG_ADDREG_TYPE_BINARY; +pub const FLG_DELREG_TYPE_DWORD: DWORD = FLG_ADDREG_TYPE_DWORD; +pub const FLG_DELREG_TYPE_NONE: DWORD = FLG_ADDREG_TYPE_NONE; +pub const FLG_DELREG_64BITKEY: DWORD = FLG_ADDREG_64BITKEY; +pub const FLG_DELREG_KEYONLY_COMMON: DWORD = FLG_ADDREG_KEYONLY_COMMON; +pub const FLG_DELREG_32BITKEY: DWORD = FLG_ADDREG_32BITKEY; +pub const FLG_DELREG_OPERATION_MASK: DWORD = 0x000000FE; +pub const FLG_DELREG_MULTI_SZ_DELSTRING: DWORD = FLG_DELREG_TYPE_MULTI_SZ | FLG_ADDREG_DELREG_BIT + | 0x00000002; +pub const FLG_BITREG_CLEARBITS: DWORD = 0x00000000; +pub const FLG_BITREG_SETBITS: DWORD = 0x00000001; +pub const FLG_BITREG_64BITKEY: DWORD = 0x00001000; +pub const FLG_BITREG_32BITKEY: DWORD = 0x00004000; +pub const FLG_INI2REG_64BITKEY: DWORD = 0x00001000; +pub const FLG_INI2REG_32BITKEY: DWORD = 0x00004000; +pub const FLG_REGSVR_DLLREGISTER: DWORD = 0x00000001; +pub const FLG_REGSVR_DLLINSTALL: DWORD = 0x00000002; +pub const FLG_PROFITEM_CURRENTUSER: DWORD = 0x00000001; +pub const FLG_PROFITEM_DELETE: DWORD = 0x00000002; +pub const FLG_PROFITEM_GROUP: DWORD = 0x00000004; +pub const FLG_PROFITEM_CSIDL: DWORD = 0x00000008; +pub const FLG_ADDPROPERTY_NOCLOBBER: DWORD = 0x00000001; +pub const FLG_ADDPROPERTY_OVERWRITEONLY: DWORD = 0x00000002; +pub const FLG_ADDPROPERTY_APPEND: DWORD = 0x00000004; +pub const FLG_ADDPROPERTY_OR: DWORD = 0x00000008; +pub const FLG_ADDPROPERTY_AND: DWORD = 0x00000010; +pub const FLG_DELPROPERTY_MULTI_SZ_DELSTRING: DWORD = 0x00000001; +extern "system" { + pub fn SetupInstallFromInfSectionA( + Owner: HWND, + InfHandle: HINF, + SectionName: PCSTR, + Flags: UINT, + RelativeKeyRoot: HKEY, + SourceRootPath: PCSTR, + CopyFlags: UINT, + MsgHandler: PSP_FILE_CALLBACK_A, + Context: PVOID, + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupInstallFromInfSectionW( + Owner: HWND, + InfHandle: HINF, + SectionName: PCWSTR, + Flags: UINT, + RelativeKeyRoot: HKEY, + SourceRootPath: PCWSTR, + CopyFlags: UINT, + MsgHandler: PSP_FILE_CALLBACK_W, + Context: PVOID, + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; +} +pub const SPINST_LOGCONFIG: UINT = 0x00000001; +pub const SPINST_INIFILES: UINT = 0x00000002; +pub const SPINST_REGISTRY: UINT = 0x00000004; +pub const SPINST_INI2REG: UINT = 0x00000008; +pub const SPINST_FILES: UINT = 0x00000010; +pub const SPINST_BITREG: UINT = 0x00000020; +pub const SPINST_REGSVR: UINT = 0x00000040; +pub const SPINST_UNREGSVR: UINT = 0x00000080; +pub const SPINST_PROFILEITEMS: UINT = 0x00000100; +pub const SPINST_COPYINF: UINT = 0x00000200; +pub const SPINST_PROPERTIES: UINT = 0x00000400; +pub const SPINST_ALL: UINT = 0x000007ff; +pub const SPINST_SINGLESECTION: UINT = 0x00010000; +pub const SPINST_LOGCONFIG_IS_FORCED: UINT = 0x00020000; +pub const SPINST_LOGCONFIGS_ARE_OVERRIDES: UINT = 0x00040000; +pub const SPINST_REGISTERCALLBACKAWARE: UINT = 0x00080000; +pub const SPINST_DEVICEINSTALL: UINT = 0x00100000; +extern "system" { + pub fn SetupInstallFilesFromInfSectionA( + InfHandle: HINF, + LayoutInfHandle: HINF, + FileQueue: HSPFILEQ, + SectionName: PCSTR, + SourceRootPath: PCSTR, + CopyFlags: UINT, + ) -> BOOL; + pub fn SetupInstallFilesFromInfSectionW( + InfHandle: HINF, + LayoutInfHandle: HINF, + FileQueue: HSPFILEQ, + SectionName: PCWSTR, + SourceRootPath: PCWSTR, + CopyFlags: UINT, + ) -> BOOL; +} +pub const SPSVCINST_TAGTOFRONT: DWORD = 0x00000001; +pub const SPSVCINST_ASSOCSERVICE: DWORD = 0x00000002; +pub const SPSVCINST_DELETEEVENTLOGENTRY: DWORD = 0x00000004; +pub const SPSVCINST_NOCLOBBER_DISPLAYNAME: DWORD = 0x00000008; +pub const SPSVCINST_NOCLOBBER_STARTTYPE: DWORD = 0x00000010; +pub const SPSVCINST_NOCLOBBER_ERRORCONTROL: DWORD = 0x00000020; +pub const SPSVCINST_NOCLOBBER_LOADORDERGROUP: DWORD = 0x00000040; +pub const SPSVCINST_NOCLOBBER_DEPENDENCIES: DWORD = 0x00000080; +pub const SPSVCINST_NOCLOBBER_DESCRIPTION: DWORD = 0x00000100; +pub const SPSVCINST_STOPSERVICE: DWORD = 0x00000200; +pub const SPSVCINST_CLOBBER_SECURITY: DWORD = 0x00000400; +pub const SPSVCINST_STARTSERVICE: DWORD = 0x00000800; +pub const SPSVCINST_NOCLOBBER_REQUIREDPRIVILEGES: DWORD = 0x00001000; +extern "system" { + pub fn SetupInstallServicesFromInfSectionA( + InfHandle: HINF, + SectionName: PCSTR, + Flags: DWORD, + ) -> BOOL; + pub fn SetupInstallServicesFromInfSectionW( + InfHandle: HINF, + SectionName: PCWSTR, + Flags: DWORD, + ) -> BOOL; + pub fn SetupInstallServicesFromInfSectionExA( + InfHandle: HINF, + SectionName: PCSTR, + Flags: DWORD, + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Reserved1: PVOID, + Reserved2: PVOID, + ) -> BOOL; + pub fn SetupInstallServicesFromInfSectionExW( + InfHandle: HINF, + SectionName: PCWSTR, + Flags: DWORD, + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Reserved1: PVOID, + Reserved2: PVOID, + ) -> BOOL; + pub fn InstallHinfSectionA( + Window: HWND, + ModuleHandle: HINSTANCE, + CommandLine: PCSTR, + ShowCommand: INT, + ) -> (); + pub fn InstallHinfSectionW( + Window: HWND, + ModuleHandle: HINSTANCE, + CommandLine: PCWSTR, + ShowCommand: INT, + ) -> (); +} +pub type HSPFILELOG = PVOID; +extern "system" { + pub fn SetupInitializeFileLogA( + LogFileName: PCSTR, + Flags: DWORD, + ) -> HSPFILELOG; + pub fn SetupInitializeFileLogW( + LogFileName: PCWSTR, + Flags: DWORD, + ) -> HSPFILELOG; +} +pub const SPFILELOG_SYSTEMLOG: DWORD = 0x00000001; +pub const SPFILELOG_FORCENEW: DWORD = 0x00000002; +pub const SPFILELOG_QUERYONLY: DWORD = 0x00000004; +extern "system" { + pub fn SetupTerminateFileLog( + FileLogHandle: HSPFILELOG, + ) -> BOOL; + pub fn SetupLogFileA( + FileLogHandle: HSPFILELOG, + LogSectionName: PCSTR, + SourceFilename: PCSTR, + TargetFilename: PCSTR, + Checksum: DWORD, + DiskTagfile: PCSTR, + DiskDescription: PCSTR, + OtherInfo: PCSTR, + Flags: DWORD, + ) -> BOOL; + pub fn SetupLogFileW( + FileLogHandle: HSPFILELOG, + LogSectionName: PCWSTR, + SourceFilename: PCWSTR, + TargetFilename: PCWSTR, + Checksum: DWORD, + DiskTagfile: PCWSTR, + DiskDescription: PCWSTR, + OtherInfo: PCWSTR, + Flags: DWORD, + ) -> BOOL; +} +pub const SPFILELOG_OEMFILE: DWORD = 0x00000001; +extern "system" { + pub fn SetupRemoveFileLogEntryA( + FileLogHandle: HSPFILELOG, + LogSectionName: PCSTR, + TargetFilename: PCSTR, + ) -> BOOL; + pub fn SetupRemoveFileLogEntryW( + FileLogHandle: HSPFILELOG, + LogSectionName: PCWSTR, + TargetFilename: PCWSTR, + ) -> BOOL; +} +ENUM!{enum SetupFileLogInfo { + SetupFileLogSourceFilename, + SetupFileLogChecksum, + SetupFileLogDiskTagfile, + SetupFileLogDiskDescription, + SetupFileLogOtherInfo, + SetupFileLogMax, +}} +extern "system" { + pub fn SetupQueryFileLogA( + FileLogHandle: HSPFILELOG, + LogSectionName: PCSTR, + TargetFilename: PCSTR, + DesiredInfo: SetupFileLogInfo, + DataOut: PSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupQueryFileLogW( + FileLogHandle: HSPFILELOG, + LogSectionName: PCWSTR, + TargetFilename: PCWSTR, + DesiredInfo: SetupFileLogInfo, + DataOut: PWSTR, + ReturnBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; +} +pub type LogSeverity = DWORD; +pub const LogSevInformation: LogSeverity = 0x00000000; +pub const LogSevWarning: LogSeverity = 0x00000001; +pub const LogSevError: LogSeverity = 0x00000002; +pub const LogSevFatalError: LogSeverity = 0x00000003; +pub const LogSevMaximum: LogSeverity = 0x00000004; +extern "system" { + pub fn SetupOpenLog( + Erase: BOOL, + ) -> BOOL; + pub fn SetupLogErrorA( + MessageString: LPCSTR, + Severity: LogSeverity, + ) -> BOOL; + pub fn SetupLogErrorW( + MessageString: LPCWSTR, + Severity: LogSeverity, + ) -> BOOL; + pub fn SetupCloseLog() -> (); + pub fn SetupGetThreadLogToken() -> SP_LOG_TOKEN; + pub fn SetupSetThreadLogToken( + LogToken: SP_LOG_TOKEN, + ) -> (); +} +//pub fn SetupWriteTextLog() -> (); +//pub fn SetupWriteTextLogError() -> (); +extern "system" { + pub fn SetupWriteTextLogInfLine( + LogToken: SP_LOG_TOKEN, + Flags: DWORD, + InfHandle: HINF, + Context: PINFCONTEXT, + ) -> (); + pub fn SetupGetBackupInformationA( + QueueHandle: HSPFILEQ, + BackupParams: PSP_BACKUP_QUEUE_PARAMS_A, + ) -> BOOL; + pub fn SetupGetBackupInformationW( + QueueHandle: HSPFILEQ, + BackupParams: PSP_BACKUP_QUEUE_PARAMS_W, + ) -> BOOL; + pub fn SetupPrepareQueueForRestoreA( + QueueHandle: HSPFILEQ, + BackupPath: PCSTR, + RestoreFlags: DWORD, + ) -> BOOL; + pub fn SetupPrepareQueueForRestoreW( + QueueHandle: HSPFILEQ, + BackupPath: PCWSTR, + RestoreFlags: DWORD, + ) -> BOOL; + pub fn SetupSetNonInteractiveMode( + NonInteractiveFlag: BOOL, + ) -> BOOL; + pub fn SetupGetNonInteractiveMode() -> BOOL; + pub fn SetupDiCreateDeviceInfoList( + ClassGuid: *const GUID, + hwndParent: HWND, + ) -> HDEVINFO; + pub fn SetupDiCreateDeviceInfoListExA( + ClassGuid: *const GUID, + hwndParent: HWND, + MachineName: PCSTR, + Reserved: PVOID, + ) -> HDEVINFO; + pub fn SetupDiCreateDeviceInfoListExW( + ClassGuid: *const GUID, + hwndParent: HWND, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> HDEVINFO; + pub fn SetupDiGetDeviceInfoListClass( + DeviceInfoSet: HDEVINFO, + ClassGuid: LPGUID, + ) -> BOOL; + pub fn SetupDiGetDeviceInfoListDetailA( + DeviceInfoSet: HDEVINFO, + DeviceInfoSetDetailData: PSP_DEVINFO_LIST_DETAIL_DATA_A, + ) -> BOOL; + pub fn SetupDiGetDeviceInfoListDetailW( + DeviceInfoSet: HDEVINFO, + DeviceInfoSetDetailData: PSP_DEVINFO_LIST_DETAIL_DATA_W, + ) -> BOOL; +} +pub const DICD_GENERATE_ID: DWORD = 0x00000001; +pub const DICD_INHERIT_CLASSDRVS: DWORD = 0x00000002; +extern "system" { + pub fn SetupDiCreateDeviceInfoA( + DeviceInfoSet: HDEVINFO, + DeviceName: PCSTR, + ClassGuid: *const GUID, + DeviceDescription: PCSTR, + hwndParent: HWND, + CreationFlags: DWORD, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiCreateDeviceInfoW( + DeviceInfoSet: HDEVINFO, + DeviceName: PCWSTR, + ClassGuid: *const GUID, + DeviceDescription: PCWSTR, + hwndParent: HWND, + CreationFlags: DWORD, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; +} +pub const DIOD_INHERIT_CLASSDRVS: DWORD = 0x00000002; +pub const DIOD_CANCEL_REMOVE: DWORD = 0x00000004; +extern "system" { + pub fn SetupDiOpenDeviceInfoA( + DeviceInfoSet: HDEVINFO, + DeviceInstanceId: PCSTR, + hwndParent: HWND, + OpenFlags: DWORD, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiOpenDeviceInfoW( + DeviceInfoSet: HDEVINFO, + DeviceInstanceId: PCWSTR, + hwndParent: HWND, + OpenFlags: DWORD, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiGetDeviceInstanceIdA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DeviceInstanceId: PSTR, + DeviceInstanceIdSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetDeviceInstanceIdW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DeviceInstanceId: PWSTR, + DeviceInstanceIdSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiDeleteDeviceInfo( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiEnumDeviceInfo( + DeviceInfoSet: HDEVINFO, + MemberIndex: DWORD, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiDestroyDeviceInfoList( + DeviceInfoSet: HDEVINFO, + ) -> BOOL; + pub fn SetupDiEnumDeviceInterfaces( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + InterfaceClassGuid: *const GUID, + MemberIndex: DWORD, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + ) -> BOOL; + pub fn SetupDiCreateDeviceInterfaceA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + InterfaceClassGuid: *const GUID, + ReferenceString: PCSTR, + CreationFlags: DWORD, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + ) -> BOOL; + pub fn SetupDiCreateDeviceInterfaceW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + InterfaceClassGuid: *const GUID, + ReferenceString: PCWSTR, + CreationFlags: DWORD, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + ) -> BOOL; +} +pub const DIODI_NO_ADD: DWORD = 0x00000001; +extern "system" { + pub fn SetupDiOpenDeviceInterfaceA( + DeviceInfoSet: HDEVINFO, + DevicePath: PCSTR, + OpenFlags: DWORD, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + ) -> BOOL; + pub fn SetupDiOpenDeviceInterfaceW( + DeviceInfoSet: HDEVINFO, + DevicePath: PCWSTR, + OpenFlags: DWORD, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + ) -> BOOL; + pub fn SetupDiGetDeviceInterfaceAlias( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + AliasInterfaceClassGuid: *const GUID, + AliasDeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + ) -> BOOL; + pub fn SetupDiDeleteDeviceInterfaceData( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + ) -> BOOL; + pub fn SetupDiRemoveDeviceInterface( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + ) -> BOOL; + pub fn SetupDiGetDeviceInterfaceDetailA( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + DeviceInterfaceDetailData: PSP_DEVICE_INTERFACE_DETAIL_DATA_A, + DeviceInterfaceDetailDataSize: DWORD, + RequiredSize: PDWORD, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiGetDeviceInterfaceDetailW( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + DeviceInterfaceDetailData: PSP_DEVICE_INTERFACE_DETAIL_DATA_W, + DeviceInterfaceDetailDataSize: DWORD, + RequiredSize: PDWORD, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiInstallDeviceInterfaces( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiSetDeviceInterfaceDefault( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Flags: DWORD, + Reserved: PVOID, + ) -> BOOL; +} +pub const SPRDI_FIND_DUPS: DWORD = 0x00000001; +extern "system" { + pub fn SetupDiRegisterDeviceInfo( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Flags: DWORD, + CompareProc: PSP_DETSIG_CMPPROC, + CompareContext: PVOID, + DupDeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; +} +pub const SPDIT_NODRIVER: DWORD = 0x00000000; +pub const SPDIT_CLASSDRIVER: DWORD = 0x00000001; +pub const SPDIT_COMPATDRIVER: DWORD = 0x00000002; +extern "system" { + pub fn SetupDiBuildDriverInfoList( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverType: DWORD, + ) -> BOOL; + pub fn SetupDiCancelDriverInfoSearch( + DeviceInfoSet: HDEVINFO, + ) -> BOOL; + pub fn SetupDiEnumDriverInfoA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverType: DWORD, + MemberIndex: DWORD, + DriverInfoData: PSP_DRVINFO_DATA_A, + ) -> BOOL; + pub fn SetupDiEnumDriverInfoW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverType: DWORD, + MemberIndex: DWORD, + DriverInfoData: PSP_DRVINFO_DATA_W, + ) -> BOOL; + pub fn SetupDiGetSelectedDriverA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverInfoData: PSP_DRVINFO_DATA_A, + ) -> BOOL; + pub fn SetupDiGetSelectedDriverW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverInfoData: PSP_DRVINFO_DATA_W, + ) -> BOOL; + pub fn SetupDiSetSelectedDriverA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverInfoData: PSP_DRVINFO_DATA_A, + ) -> BOOL; + pub fn SetupDiSetSelectedDriverW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverInfoData: PSP_DRVINFO_DATA_W, + ) -> BOOL; + pub fn SetupDiGetDriverInfoDetailA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverInfoData: PSP_DRVINFO_DATA_A, + DriverInfoDetailData: PSP_DRVINFO_DETAIL_DATA_A, + DriverInfoDetailDataSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetDriverInfoDetailW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverInfoData: PSP_DRVINFO_DATA_W, + DriverInfoDetailData: PSP_DRVINFO_DETAIL_DATA_W, + DriverInfoDetailDataSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiDestroyDriverInfoList( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverType: DWORD, + ) -> BOOL; +} +pub const DIGCF_DEFAULT: DWORD = 0x00000001; +pub const DIGCF_PRESENT: DWORD = 0x00000002; +pub const DIGCF_ALLCLASSES: DWORD = 0x00000004; +pub const DIGCF_PROFILE: DWORD = 0x00000008; +pub const DIGCF_DEVICEINTERFACE: DWORD = 0x00000010; +extern "system" { + pub fn SetupDiGetClassDevsA( + ClassGuid: *const GUID, + Enumerator: PCSTR, + hwndParent: HWND, + Flags: DWORD, + ) -> HDEVINFO; + pub fn SetupDiGetClassDevsW( + ClassGuid: *const GUID, + Enumerator: PCWSTR, + hwndParent: HWND, + Flags: DWORD, + ) -> HDEVINFO; + pub fn SetupDiGetClassDevsExA( + ClassGuid: *const GUID, + Enumerator: PCSTR, + hwndParent: HWND, + Flags: DWORD, + DeviceInfoSet: HDEVINFO, + MachineName: PCSTR, + Reserved: PVOID, + ) -> HDEVINFO; + pub fn SetupDiGetClassDevsExW( + ClassGuid: *const GUID, + Enumerator: PCWSTR, + hwndParent: HWND, + Flags: DWORD, + DeviceInfoSet: HDEVINFO, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> HDEVINFO; + pub fn SetupDiGetINFClassA( + InfName: PCSTR, + ClassGuid: LPGUID, + ClassName: PSTR, + ClassNameSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetINFClassW( + InfName: PCWSTR, + ClassGuid: LPGUID, + ClassName: PWSTR, + ClassNameSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; +} +pub const DIBCI_NOINSTALLCLASS: DWORD = 0x00000001; +pub const DIBCI_NODISPLAYCLASS: DWORD = 0x00000002; +extern "system" { + pub fn SetupDiBuildClassInfoList( + Flags: DWORD, + ClassGuidList: LPGUID, + ClassGuidListSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiBuildClassInfoListExA( + Flags: DWORD, + ClassGuidList: LPGUID, + ClassGuidListSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiBuildClassInfoListExW( + Flags: DWORD, + ClassGuidList: LPGUID, + ClassGuidListSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetClassDescriptionA( + ClassGuid: *const GUID, + ClassDescription: PSTR, + ClassDescriptionSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetClassDescriptionW( + ClassGuid: *const GUID, + ClassDescription: PWSTR, + ClassDescriptionSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetClassDescriptionExA( + ClassGuid: *const GUID, + ClassDescription: PSTR, + ClassDescriptionSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetClassDescriptionExW( + ClassGuid: *const GUID, + ClassDescription: PWSTR, + ClassDescriptionSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiCallClassInstaller( + InstallFunction: DI_FUNCTION, + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiSelectDevice( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiSelectBestCompatDrv( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiInstallDevice( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiInstallDriverFiles( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiRegisterCoDeviceInstallers( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiRemoveDevice( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiUnremoveDevice( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiRestartDevices( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiChangeState( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiInstallClassA( + hwndParent: HWND, + InfFileName: PCSTR, + Flags: DWORD, + FileQueue: HSPFILEQ, + ) -> BOOL; + pub fn SetupDiInstallClassW( + hwndParent: HWND, + InfFileName: PCWSTR, + Flags: DWORD, + FileQueue: HSPFILEQ, + ) -> BOOL; + pub fn SetupDiInstallClassExA( + hwndParent: HWND, + InfFileName: PCSTR, + Flags: DWORD, + FileQueue: HSPFILEQ, + InterfaceClassGuid: *const GUID, + Reserved1: PVOID, + Reserved2: PVOID, + ) -> BOOL; + pub fn SetupDiInstallClassExW( + hwndParent: HWND, + InfFileName: PCWSTR, + Flags: DWORD, + FileQueue: HSPFILEQ, + InterfaceClassGuid: *const GUID, + Reserved1: PVOID, + Reserved2: PVOID, + ) -> BOOL; + pub fn SetupDiOpenClassRegKey( + ClassGuid: *const GUID, + samDesired: REGSAM, + ) -> HKEY; +} +pub const DIOCR_INSTALLER: DWORD = 0x00000001; +pub const DIOCR_INTERFACE: DWORD = 0x00000002; +extern "system" { + pub fn SetupDiOpenClassRegKeyExA( + ClassGuid: *const GUID, + samDesired: REGSAM, + Flags: DWORD, + MachineName: PCSTR, + Reserved: PVOID, + ) -> HKEY; + pub fn SetupDiOpenClassRegKeyExW( + ClassGuid: *const GUID, + samDesired: REGSAM, + Flags: DWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> HKEY; + pub fn SetupDiCreateDeviceInterfaceRegKeyA( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + Reserved: DWORD, + samDesired: REGSAM, + InfHandle: HINF, + InfSectionName: PCSTR, + ) -> HKEY; + pub fn SetupDiCreateDeviceInterfaceRegKeyW( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + Reserved: DWORD, + samDesired: REGSAM, + InfHandle: HINF, + InfSectionName: PCWSTR, + ) -> HKEY; + pub fn SetupDiOpenDeviceInterfaceRegKey( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + Reserved: DWORD, + samDesired: REGSAM, + ) -> HKEY; + pub fn SetupDiDeleteDeviceInterfaceRegKey( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + Reserved: DWORD, + ) -> BOOL; +} +pub const DIREG_DEV: DWORD = 0x00000001; +pub const DIREG_DRV: DWORD = 0x00000002; +pub const DIREG_BOTH: DWORD = 0x00000004; +extern "system" { + pub fn SetupDiCreateDevRegKeyA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Scope: DWORD, + HwProfile: DWORD, + KeyType: DWORD, + InfHandle: HINF, + InfSectionName: PCSTR, + ) -> HKEY; + pub fn SetupDiCreateDevRegKeyW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Scope: DWORD, + HwProfile: DWORD, + KeyType: DWORD, + InfHandle: HINF, + InfSectionName: PCWSTR, + ) -> HKEY; + pub fn SetupDiOpenDevRegKey( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Scope: DWORD, + HwProfile: DWORD, + KeyType: DWORD, + samDesired: REGSAM, + ) -> HKEY; + pub fn SetupDiDeleteDevRegKey( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Scope: DWORD, + HwProfile: DWORD, + KeyType: DWORD, + ) -> BOOL; + pub fn SetupDiGetHwProfileList( + HwProfileList: PDWORD, + HwProfileListSize: DWORD, + RequiredSize: PDWORD, + CurrentlyActiveIndex: PDWORD, + ) -> BOOL; + pub fn SetupDiGetHwProfileListExA( + HwProfileList: PDWORD, + HwProfileListSize: DWORD, + RequiredSize: PDWORD, + CurrentlyActiveIndex: PDWORD, + MachineName: PCSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetHwProfileListExW( + HwProfileList: PDWORD, + HwProfileListSize: DWORD, + RequiredSize: PDWORD, + CurrentlyActiveIndex: PDWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetDevicePropertyKeys( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + PropertyKeyArray: *mut DEVPROPKEY, + PropertyKeyCount: DWORD, + RequiredPropertyKeyCount: PDWORD, + Flags: DWORD, + ) -> BOOL; + pub fn SetupDiGetDevicePropertyW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + PropertyKey: *const DEVPROPKEY, + PropertyType: *mut DEVPROPTYPE, + PropertyBuffer: PBYTE, + PropertyBufferSize: DWORD, + RequiredSize: PDWORD, + Flags: DWORD, + ) -> BOOL; + pub fn SetupDiSetDevicePropertyW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + PropertyKey: *const DEVPROPKEY, + PropertyType: DEVPROPTYPE, + PropertyBuffer: *const BYTE, + PropertyBufferSize: DWORD, + Flags: DWORD, + ) -> BOOL; + pub fn SetupDiGetDeviceInterfacePropertyKeys( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + PropertyKeyArray: *mut DEVPROPKEY, + PropertyKeyCount: DWORD, + RequiredPropertyKeyCount: PDWORD, + Flags: DWORD, + ) -> BOOL; + pub fn SetupDiGetDeviceInterfacePropertyW( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + PropertyKey: *const DEVPROPKEY, + PropertyType: *mut DEVPROPTYPE, + PropertyBuffer: PBYTE, + PropertyBufferSize: DWORD, + RequiredSize: PDWORD, + Flags: DWORD, + ) -> BOOL; + pub fn SetupDiSetDeviceInterfacePropertyW( + DeviceInfoSet: HDEVINFO, + DeviceInterfaceData: PSP_DEVICE_INTERFACE_DATA, + PropertyKey: *const DEVPROPKEY, + PropertyType: DEVPROPTYPE, + PropertyBuffer: *const BYTE, + PropertyBufferSize: DWORD, + Flags: DWORD, + ) -> BOOL; +} +pub const DICLASSPROP_INSTALLER: DWORD = 0x00000001; +pub const DICLASSPROP_INTERFACE: DWORD = 0x00000002; +extern "system" { + pub fn SetupDiGetClassPropertyKeys( + ClassGuid: *const GUID, + PropertyKeyArray: *mut DEVPROPKEY, + PropertyKeyCount: DWORD, + RequiredPropertyKeyCount: PDWORD, + Flags: DWORD, + ) -> BOOL; + pub fn SetupDiGetClassPropertyKeysExW( + ClassGuid: *const GUID, + PropertyKeyArray: *mut DEVPROPKEY, + PropertyKeyCount: DWORD, + RequiredPropertyKeyCount: PDWORD, + Flags: DWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetClassPropertyW( + ClassGuid: *const GUID, + PropertyKey: *const DEVPROPKEY, + PropertyType: *mut DEVPROPTYPE, + PropertyBuffer: PBYTE, + PropertyBufferSize: DWORD, + RequiredSize: PDWORD, + Flags: DWORD, + ) -> BOOL; + pub fn SetupDiGetClassPropertyExW( + ClassGuid: *const GUID, + PropertyKey: *const DEVPROPKEY, + PropertyType: *mut DEVPROPTYPE, + PropertyBuffer: PBYTE, + PropertyBufferSize: DWORD, + RequiredSize: PDWORD, + Flags: DWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiSetClassPropertyW( + ClassGuid: *const GUID, + PropertyKey: *const DEVPROPKEY, + PropertyType: DEVPROPTYPE, + PropertyBuffer: *const BYTE, + PropertyBufferSize: DWORD, + Flags: DWORD, + ) -> BOOL; + pub fn SetupDiSetClassPropertyExW( + ClassGuid: *const GUID, + PropertyKey: *const DEVPROPKEY, + PropertyType: DEVPROPTYPE, + PropertyBuffer: *const BYTE, + PropertyBufferSize: DWORD, + Flags: DWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; +} +pub const SPDRP_DEVICEDESC: DWORD = 0x00000000; +pub const SPDRP_HARDWAREID: DWORD = 0x00000001; +pub const SPDRP_COMPATIBLEIDS: DWORD = 0x00000002; +pub const SPDRP_UNUSED0: DWORD = 0x00000003; +pub const SPDRP_SERVICE: DWORD = 0x00000004; +pub const SPDRP_UNUSED1: DWORD = 0x00000005; +pub const SPDRP_UNUSED2: DWORD = 0x00000006; +pub const SPDRP_CLASS: DWORD = 0x00000007; +pub const SPDRP_CLASSGUID: DWORD = 0x00000008; +pub const SPDRP_DRIVER: DWORD = 0x00000009; +pub const SPDRP_CONFIGFLAGS: DWORD = 0x0000000A; +pub const SPDRP_MFG: DWORD = 0x0000000B; +pub const SPDRP_FRIENDLYNAME: DWORD = 0x0000000C; +pub const SPDRP_LOCATION_INFORMATION: DWORD = 0x0000000D; +pub const SPDRP_PHYSICAL_DEVICE_OBJECT_NAME: DWORD = 0x0000000E; +pub const SPDRP_CAPABILITIES: DWORD = 0x0000000F; +pub const SPDRP_UI_NUMBER: DWORD = 0x00000010; +pub const SPDRP_UPPERFILTERS: DWORD = 0x00000011; +pub const SPDRP_LOWERFILTERS: DWORD = 0x00000012; +pub const SPDRP_BUSTYPEGUID: DWORD = 0x00000013; +pub const SPDRP_LEGACYBUSTYPE: DWORD = 0x00000014; +pub const SPDRP_BUSNUMBER: DWORD = 0x00000015; +pub const SPDRP_ENUMERATOR_NAME: DWORD = 0x00000016; +pub const SPDRP_SECURITY: DWORD = 0x00000017; +pub const SPDRP_SECURITY_SDS: DWORD = 0x00000018; +pub const SPDRP_DEVTYPE: DWORD = 0x00000019; +pub const SPDRP_EXCLUSIVE: DWORD = 0x0000001A; +pub const SPDRP_CHARACTERISTICS: DWORD = 0x0000001B; +pub const SPDRP_ADDRESS: DWORD = 0x0000001C; +pub const SPDRP_UI_NUMBER_DESC_FORMAT: DWORD = 0x0000001D; +pub const SPDRP_DEVICE_POWER_DATA: DWORD = 0x0000001E; +pub const SPDRP_REMOVAL_POLICY: DWORD = 0x0000001F; +pub const SPDRP_REMOVAL_POLICY_HW_DEFAULT: DWORD = 0x00000020; +pub const SPDRP_REMOVAL_POLICY_OVERRIDE: DWORD = 0x00000021; +pub const SPDRP_INSTALL_STATE: DWORD = 0x00000022; +pub const SPDRP_LOCATION_PATHS: DWORD = 0x00000023; +pub const SPDRP_BASE_CONTAINERID: DWORD = 0x00000024; +pub const SPDRP_MAXIMUM_PROPERTY: DWORD = 0x00000025; +pub const SPCRP_UPPERFILTERS: DWORD = 0x00000011; +pub const SPCRP_LOWERFILTERS: DWORD = 0x00000012; +pub const SPCRP_SECURITY: DWORD = 0x00000017; +pub const SPCRP_SECURITY_SDS: DWORD = 0x00000018; +pub const SPCRP_DEVTYPE: DWORD = 0x00000019; +pub const SPCRP_EXCLUSIVE: DWORD = 0x0000001A; +pub const SPCRP_CHARACTERISTICS: DWORD = 0x0000001B; +pub const SPCRP_MAXIMUM_PROPERTY: DWORD = 0x0000001C; +extern "system" { + pub fn SetupDiGetDeviceRegistryPropertyA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Property: DWORD, + PropertyRegDataType: PDWORD, + PropertyBuffer: PBYTE, + PropertyBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetDeviceRegistryPropertyW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Property: DWORD, + PropertyRegDataType: PDWORD, + PropertyBuffer: PBYTE, + PropertyBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetClassRegistryPropertyA( + ClassGuid: *const GUID, + Property: DWORD, + PropertyRegDataType: PDWORD, + PropertyBuffer: PBYTE, + PropertyBufferSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetClassRegistryPropertyW( + ClassGuid: *const GUID, + Property: DWORD, + PropertyRegDataType: PDWORD, + PropertyBuffer: PBYTE, + PropertyBufferSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiSetDeviceRegistryPropertyA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Property: DWORD, + PropertyBuffer: *const BYTE, + PropertyBufferSize: DWORD, + ) -> BOOL; + pub fn SetupDiSetDeviceRegistryPropertyW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + Property: DWORD, + PropertyBuffer: *const BYTE, + PropertyBufferSize: DWORD, + ) -> BOOL; + pub fn SetupDiSetClassRegistryPropertyA( + ClassGuid: *const GUID, + Property: DWORD, + PropertyBuffer: *const BYTE, + PropertyBufferSize: DWORD, + MachineName: PCSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiSetClassRegistryPropertyW( + ClassGuid: *const GUID, + Property: DWORD, + PropertyBuffer: *const BYTE, + PropertyBufferSize: DWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetDeviceInstallParamsA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DeviceInstallParams: PSP_DEVINSTALL_PARAMS_A, + ) -> BOOL; + pub fn SetupDiGetDeviceInstallParamsW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DeviceInstallParams: PSP_DEVINSTALL_PARAMS_W, + ) -> BOOL; + pub fn SetupDiGetClassInstallParamsA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ClassInstallParams: PSP_CLASSINSTALL_HEADER, + ClassInstallParamsSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetClassInstallParamsW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ClassInstallParams: PSP_CLASSINSTALL_HEADER, + ClassInstallParamsSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiSetDeviceInstallParamsA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DeviceInstallParams: PSP_DEVINSTALL_PARAMS_A, + ) -> BOOL; + pub fn SetupDiSetDeviceInstallParamsW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DeviceInstallParams: PSP_DEVINSTALL_PARAMS_W, + ) -> BOOL; + pub fn SetupDiSetClassInstallParamsA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ClassInstallParams: PSP_CLASSINSTALL_HEADER, + ClassInstallParamsSize: DWORD, + ) -> BOOL; + pub fn SetupDiSetClassInstallParamsW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ClassInstallParams: PSP_CLASSINSTALL_HEADER, + ClassInstallParamsSize: DWORD, + ) -> BOOL; + pub fn SetupDiGetDriverInstallParamsA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverInfoData: PSP_DRVINFO_DATA_A, + DriverInstallParams: PSP_DRVINSTALL_PARAMS, + ) -> BOOL; + pub fn SetupDiGetDriverInstallParamsW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverInfoData: PSP_DRVINFO_DATA_W, + DriverInstallParams: PSP_DRVINSTALL_PARAMS, + ) -> BOOL; + pub fn SetupDiSetDriverInstallParamsA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverInfoData: PSP_DRVINFO_DATA_A, + DriverInstallParams: PSP_DRVINSTALL_PARAMS, + ) -> BOOL; + pub fn SetupDiSetDriverInstallParamsW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + DriverInfoData: PSP_DRVINFO_DATA_W, + DriverInstallParams: PSP_DRVINSTALL_PARAMS, + ) -> BOOL; + pub fn SetupDiLoadClassIcon( + ClassGuid: *const GUID, + LargeIcon: *mut HICON, + MiniIconIndex: PINT, + ) -> BOOL; + pub fn SetupDiLoadDeviceIcon( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + cxIcon: UINT, + cyIcon: UINT, + Flags: DWORD, + hIcon: *mut HICON, + ) -> BOOL; +} +pub const DMI_MASK: DWORD = 0x00000001; +pub const DMI_BKCOLOR: DWORD = 0x00000002; +pub const DMI_USERECT: DWORD = 0x00000004; +extern "system" { + pub fn SetupDiDrawMiniIcon( + hdc: HDC, + rc: RECT, + MiniIconIndex: INT, + Flags: DWORD, + ) -> INT; + pub fn SetupDiGetClassBitmapIndex( + ClassGuid: *const GUID, + MiniIconIndex: PINT, + ) -> BOOL; + pub fn SetupDiGetClassImageList( + ClassImageListData: PSP_CLASSIMAGELIST_DATA, + ) -> BOOL; + pub fn SetupDiGetClassImageListExA( + ClassImageListData: PSP_CLASSIMAGELIST_DATA, + MachineName: PCSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetClassImageListExW( + ClassImageListData: PSP_CLASSIMAGELIST_DATA, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetClassImageIndex( + ClassImageListData: PSP_CLASSIMAGELIST_DATA, + ClassGuid: *const GUID, + ImageIndex: PINT, + ) -> BOOL; + pub fn SetupDiDestroyClassImageList( + ClassImageListData: PSP_CLASSIMAGELIST_DATA, + ) -> BOOL; +} +pub const DIGCDP_FLAG_BASIC: DWORD = 0x00000001; +pub const DIGCDP_FLAG_ADVANCED: DWORD = 0x00000002; +pub const DIGCDP_FLAG_REMOTE_BASIC: DWORD = 0x00000003; +pub const DIGCDP_FLAG_REMOTE_ADVANCED: DWORD = 0x00000004; +extern "system" { + pub fn SetupDiGetClassDevPropertySheetsA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + PropertySheetHeader: LPPROPSHEETHEADERA, + PropertySheetHeaderPageListSize: DWORD, + RequiredSize: PDWORD, + PropertySheetType: DWORD, + ) -> BOOL; + pub fn SetupDiGetClassDevPropertySheetsW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + PropertySheetHeader: LPPROPSHEETHEADERW, + PropertySheetHeaderPageListSize: DWORD, + RequiredSize: PDWORD, + PropertySheetType: DWORD, + ) -> BOOL; +} +pub const IDI_RESOURCEFIRST: c_int = 159; +pub const IDI_RESOURCE: c_int = 159; +pub const IDI_RESOURCELAST: c_int = 161; +pub const IDI_RESOURCEOVERLAYFIRST: c_int = 161; +pub const IDI_RESOURCEOVERLAYLAST: c_int = 161; +pub const IDI_CONFLICT: c_int = 161; +pub const IDI_CLASSICON_OVERLAYFIRST: c_int = 500; +pub const IDI_CLASSICON_OVERLAYLAST: c_int = 502; +pub const IDI_PROBLEM_OVL: c_int = 500; +pub const IDI_DISABLED_OVL: c_int = 501; +pub const IDI_FORCED_OVL: c_int = 502; +extern "system" { + pub fn SetupDiAskForOEMDisk( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiSelectOEMDrv( + hwndParent: HWND, + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiClassNameFromGuidA( + ClassGuid: *const GUID, + ClassName: PSTR, + ClassNameSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiClassNameFromGuidW( + ClassGuid: *const GUID, + ClassName: PWSTR, + ClassNameSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiClassNameFromGuidExA( + ClassGuid: *const GUID, + ClassName: PSTR, + ClassNameSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiClassNameFromGuidExW( + ClassGuid: *const GUID, + ClassName: PWSTR, + ClassNameSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiClassGuidsFromNameA( + ClassName: PCSTR, + ClassGuidList: LPGUID, + ClassGuidListSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiClassGuidsFromNameW( + ClassName: PCWSTR, + ClassGuidList: LPGUID, + ClassGuidListSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiClassGuidsFromNameExA( + ClassName: PCSTR, + ClassGuidList: LPGUID, + ClassGuidListSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiClassGuidsFromNameExW( + ClassName: PCWSTR, + ClassGuidList: LPGUID, + ClassGuidListSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetHwProfileFriendlyNameA( + HwProfile: DWORD, + FriendlyName: PSTR, + FriendlyNameSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetHwProfileFriendlyNameW( + HwProfile: DWORD, + FriendlyName: PWSTR, + FriendlyNameSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetHwProfileFriendlyNameExA( + HwProfile: DWORD, + FriendlyName: PSTR, + FriendlyNameSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetHwProfileFriendlyNameExW( + HwProfile: DWORD, + FriendlyName: PWSTR, + FriendlyNameSize: DWORD, + RequiredSize: PDWORD, + MachineName: PCWSTR, + Reserved: PVOID, + ) -> BOOL; +} +pub const SPWPT_SELECTDEVICE: DWORD = 0x00000001; +pub const SPWP_USE_DEVINFO_DATA: DWORD = 0x00000001; +extern "system" { + pub fn SetupDiGetWizardPage( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + InstallWizardData: PSP_INSTALLWIZARD_DATA, + PageType: DWORD, + Flags: DWORD, + ) -> HPROPSHEETPAGE; + pub fn SetupDiGetSelectedDevice( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiSetSelectedDevice( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + ) -> BOOL; + pub fn SetupDiGetActualModelsSectionA( + Context: PINFCONTEXT, + AlternatePlatformInfo: PSP_ALTPLATFORM_INFO, + InfSectionWithExt: PSTR, + InfSectionWithExtSize: DWORD, + RequiredSize: PDWORD, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetActualModelsSectionW( + Context: PINFCONTEXT, + AlternatePlatformInfo: PSP_ALTPLATFORM_INFO, + InfSectionWithExt: PWSTR, + InfSectionWithExtSize: DWORD, + RequiredSize: PDWORD, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetActualSectionToInstallA( + InfHandle: HINF, + InfSectionName: PCSTR, + InfSectionWithExt: PSTR, + InfSectionWithExtSize: DWORD, + RequiredSize: PDWORD, + Extension: *mut PSTR, + ) -> BOOL; + pub fn SetupDiGetActualSectionToInstallW( + InfHandle: HINF, + InfSectionName: PCWSTR, + InfSectionWithExt: PWSTR, + InfSectionWithExtSize: DWORD, + RequiredSize: PDWORD, + Extension: *mut PWSTR, + ) -> BOOL; + pub fn SetupDiGetActualSectionToInstallExA( + InfHandle: HINF, + InfSectionName: PCSTR, + AlternatePlatformInfo: PSP_ALTPLATFORM_INFO, + InfSectionWithExt: PSTR, + InfSectionWithExtSize: DWORD, + RequiredSize: PDWORD, + Extension: *mut PSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupDiGetActualSectionToInstallExW( + InfHandle: HINF, + InfSectionName: PCWSTR, + AlternatePlatformInfo: PSP_ALTPLATFORM_INFO, + InfSectionWithExt: PWSTR, + InfSectionWithExtSize: DWORD, + RequiredSize: PDWORD, + Extension: *mut PWSTR, + Reserved: PVOID, + ) -> BOOL; + pub fn SetupEnumInfSectionsA( + InfHandle: HINF, + Index: UINT, + Buffer: PSTR, + Size: UINT, + SizeNeeded: *mut UINT, + ) -> BOOL; + pub fn SetupEnumInfSectionsW( + InfHandle: HINF, + Index: UINT, + Buffer: PWSTR, + Size: UINT, + SizeNeeded: *mut UINT, + ) -> BOOL; +} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INF_SIGNER_INFO_V1_A { + cbSize: DWORD, + CatalogFile: [CHAR; MAX_PATH], + DigitalSigner: [CHAR; MAX_PATH], + DigitalSignerVersion: [CHAR; MAX_PATH], +}} +pub type PSP_INF_SIGNER_INFO_V1_A = *mut SP_INF_SIGNER_INFO_V1_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INF_SIGNER_INFO_V1_W { + cbSize: DWORD, + CatalogFile: [WCHAR; MAX_PATH], + DigitalSigner: [WCHAR; MAX_PATH], + DigitalSignerVersion: [WCHAR; MAX_PATH], +}} +pub type PSP_INF_SIGNER_INFO_V1_W = *mut SP_INF_SIGNER_INFO_V1_W; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INF_SIGNER_INFO_V2_A { + cbSize: DWORD, + CatalogFile: [CHAR; MAX_PATH], + DigitalSigner: [CHAR; MAX_PATH], + DigitalSignerVersion: [CHAR; MAX_PATH], + SignerScore: DWORD, +}} +pub type PSP_INF_SIGNER_INFO_V2_A = *mut SP_INF_SIGNER_INFO_V2_A; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SP_INF_SIGNER_INFO_V2_W { + cbSize: DWORD, + CatalogFile: [WCHAR; MAX_PATH], + DigitalSigner: [WCHAR; MAX_PATH], + DigitalSignerVersion: [WCHAR; MAX_PATH], + SignerScore: DWORD, +}} +pub type PSP_INF_SIGNER_INFO_V2_W = *mut SP_INF_SIGNER_INFO_V2_W; +pub const SIGNERSCORE_UNKNOWN: DWORD = 0xFF000000; +pub const SIGNERSCORE_W9X_SUSPECT: DWORD = 0xC0000000; +pub const SIGNERSCORE_UNSIGNED: DWORD = 0x80000000; +pub const SIGNERSCORE_AUTHENTICODE: DWORD = 0x0F000000; +pub const SIGNERSCORE_WHQL: DWORD = 0x0D000005; +pub const SIGNERSCORE_UNCLASSIFIED: DWORD = 0x0D000004; +pub const SIGNERSCORE_INBOX: DWORD = 0x0D000003; +pub const SIGNERSCORE_LOGO_STANDARD: DWORD = 0x0D000002; +pub const SIGNERSCORE_LOGO_PREMIUM: DWORD = 0x0D000001; +pub const SIGNERSCORE_MASK: DWORD = 0xFF000000; +pub const SIGNERSCORE_SIGNED_MASK: DWORD = 0xF0000000; +pub type SP_INF_SIGNER_INFO_A = SP_INF_SIGNER_INFO_V2_A; +pub type PSP_INF_SIGNER_INFO_A = PSP_INF_SIGNER_INFO_V2_A; +pub type SP_INF_SIGNER_INFO_W = SP_INF_SIGNER_INFO_V2_W; +pub type PSP_INF_SIGNER_INFO_W = PSP_INF_SIGNER_INFO_V2_W; +extern "system" { + pub fn SetupVerifyInfFileA( + InfName: PCSTR, + AltPlatformInfo: PSP_ALTPLATFORM_INFO, + InfSignerInfo: PSP_INF_SIGNER_INFO_A, + ) -> BOOL; + pub fn SetupVerifyInfFileW( + InfName: PCWSTR, + AltPlatformInfo: PSP_ALTPLATFORM_INFO, + InfSignerInfo: PSP_INF_SIGNER_INFO_W, + ) -> BOOL; +} +pub const DICUSTOMDEVPROP_MERGE_MULTISZ: DWORD = 0x00000001; +extern "system" { + pub fn SetupDiGetCustomDevicePropertyA( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + CustomPropertyName: PCSTR, + Flags: DWORD, + PropertyRegDataType: PDWORD, + PropertyBuffer: PBYTE, + PropertyBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; + pub fn SetupDiGetCustomDevicePropertyW( + DeviceInfoSet: HDEVINFO, + DeviceInfoData: PSP_DEVINFO_DATA, + CustomPropertyName: PCWSTR, + Flags: DWORD, + PropertyRegDataType: PDWORD, + PropertyBuffer: PBYTE, + PropertyBufferSize: DWORD, + RequiredSize: PDWORD, + ) -> BOOL; +} +pub const SCWMI_CLOBBER_SECURITY: DWORD = 0x00000001; +extern "system" { + pub fn SetupConfigureWmiFromInfSectionA( + InfHandle: HINF, + SectionName: PCSTR, + Flags: DWORD, + ) -> BOOL; + pub fn SetupConfigureWmiFromInfSectionW( + InfHandle: HINF, + SectionName: PCWSTR, + Flags: DWORD, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/shellapi.rs b/bash-5.1/vendor/winapi/src/um/shellapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..2c961c4c5ece38b8a494ed8ebb3dfed0244f2d24 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/shellapi.rs @@ -0,0 +1,923 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! SHELL.DLL functions, types, and definitions +use ctypes::{__int64, c_int, c_void}; +use shared::basetsd::{DWORD_PTR, UINT_PTR}; +use shared::guiddef::{GUID, REFIID}; +use shared::minwindef::{ + BOOL, DWORD, FILETIME, HINSTANCE, HKEY, INT, LPARAM, LPVOID, MAX_PATH, UINT, ULONG, WORD, +}; +use shared::windef::{HICON, HWND, POINT, RECT}; +use um::minwinbase::LPSECURITY_ATTRIBUTES; +use um::processthreadsapi::{LPPROCESS_INFORMATION, LPSTARTUPINFOW}; +use um::winnt::{ + CHAR, HANDLE, HRESULT, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PCSTR, PCWSTR, PCZZSTR, PCZZWSTR, PWSTR, + PZZSTR, PZZWSTR, ULARGE_INTEGER, WCHAR, +}; +use um::winuser::WM_USER; +DECLARE_HANDLE!{HDROP, HDROP__} +extern "system" { + pub fn DragQueryFileA( + hDrop: HDROP, + iFile: UINT, + lpszFile: LPSTR, + cch: UINT, + ) -> UINT; + pub fn DragQueryFileW( + hDrop: HDROP, + iFile: UINT, + lpszFile: LPWSTR, + cch: UINT, + ) -> UINT; + pub fn DragQueryPoint( + hDrop: HDROP, + lppt: *mut POINT, + ) -> BOOL; + pub fn DragFinish( + hDrop: HDROP, + ); + pub fn DragAcceptFiles( + hWnd: HWND, + fAccept: BOOL, + ); + pub fn ShellExecuteA( + hwnd: HWND, + lpOperation: LPCSTR, + lpFile: LPCSTR, + lpParameters: LPCSTR, + lpDirectory: LPCSTR, + nShowCmd: c_int, + ) -> HINSTANCE; + pub fn ShellExecuteW( + hwnd: HWND, + lpOperation: LPCWSTR, + lpFile: LPCWSTR, + lpParameters: LPCWSTR, + lpDirectory: LPCWSTR, + nShowCmd: c_int, + ) -> HINSTANCE; + pub fn FindExecutableA( + lpFile: LPCSTR, + lpDirectory: LPCSTR, + lpResult: LPSTR, + ) -> HINSTANCE; + pub fn FindExecutableW( + lpFile: LPCWSTR, + lpDirectory: LPCWSTR, + lpResult: LPWSTR, + ) -> HINSTANCE; + pub fn CommandLineToArgvW( + lpCmdLine: LPCWSTR, + pNumArgs: *mut c_int, + ) -> *mut LPWSTR; + pub fn ShellAboutA( + hWnd: HWND, + szApp: LPCSTR, + szOtherStuff: LPCSTR, + hIcon: HICON, + ) -> INT; + pub fn ShellAboutW( + hWnd: HWND, + szApp: LPCWSTR, + szOtherStuff: LPCWSTR, + hIcon: HICON, + ) -> INT; + pub fn DuplicateIcon( + hInst: HINSTANCE, + hIcon: HICON, + ) -> HICON; + pub fn ExtractAssociatedIconA( + hInst: HINSTANCE, + pszIconPath: LPSTR, + piIcon: *mut WORD, + ) -> HICON; + pub fn ExtractAssociatedIconW( + hInst: HINSTANCE, + pszIconPath: LPWSTR, + piIcon: *mut WORD, + ) -> HICON; + pub fn ExtractAssociatedIconExA( + hInst: HINSTANCE, + pszIconPath: LPSTR, + piIconIndex: *mut WORD, + piIconId: *mut WORD, + ) -> HICON; + pub fn ExtractAssociatedIconExW( + hInst: HINSTANCE, + pszIconPath: LPWSTR, + piIconIndex: *mut WORD, + piIconId: *mut WORD, + ) -> HICON; + pub fn ExtractIconA( + hInst: HINSTANCE, + pszExeFileName: LPCSTR, + nIconIndex: UINT, + ) -> HICON; + pub fn ExtractIconW( + hInst: HINSTANCE, + pszExeFileName: LPCWSTR, + nIconIndex: UINT, + ) -> HICON; +} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct DRAGINFOA { + uSize: UINT, + pt: POINT, + fNC: BOOL, + lpFileList: PZZSTR, + grfKeyState: DWORD, +}} +pub type LPDRAGINFOA = *mut DRAGINFOA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct DRAGINFOW { + uSize: UINT, + pt: POINT, + fNC: BOOL, + lpFileList: PZZWSTR, + grfKeyState: DWORD, +}} +pub type LPDRAGINFOW = *mut DRAGINFOW; +pub const ABM_NEW: DWORD = 0x00000000; +pub const ABM_REMOVE: DWORD = 0x00000001; +pub const ABM_QUERYPOS: DWORD = 0x00000002; +pub const ABM_SETPOS: DWORD = 0x00000003; +pub const ABM_GETSTATE: DWORD = 0x00000004; +pub const ABM_GETTASKBARPOS: DWORD = 0x00000005; +pub const ABM_ACTIVATE: DWORD = 0x00000006; +pub const ABM_GETAUTOHIDEBAR: DWORD = 0x00000007; +pub const ABM_SETAUTOHIDEBAR: DWORD = 0x00000008; +pub const ABM_WINDOWPOSCHANGED: DWORD = 0x0000009; +pub const ABM_SETSTATE: DWORD = 0x0000000a; +pub const ABM_GETAUTOHIDEBAREX: DWORD = 0x0000000b; +pub const ABM_SETAUTOHIDEBAREX: DWORD = 0x0000000c; +pub const ABN_STATECHANGE: DWORD = 0x0000000; +pub const ABN_POSCHANGED: DWORD = 0x0000001; +pub const ABN_FULLSCREENAPP: DWORD = 0x0000002; +pub const ABN_WINDOWARRANGE: DWORD = 0x0000003; +pub const ABS_AUTOHIDE: UINT = 0x0000001; +pub const ABS_ALWAYSONTOP: UINT = 0x0000002; +pub const ABE_LEFT: UINT = 0; +pub const ABE_TOP: UINT = 1; +pub const ABE_RIGHT: UINT = 2; +pub const ABE_BOTTOM: UINT = 3; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct APPBARDATA { + cbSize: DWORD, + hWnd: HWND, + uCallbackMessage: UINT, + uEdge: UINT, + rc: RECT, + lParam: LPARAM, +}} +pub type PAPPBARDATA = *mut APPBARDATA; +extern "system" { + pub fn SHAppBarMessage( + dwMessage: DWORD, + pData: PAPPBARDATA, + ) -> UINT_PTR; + pub fn DoEnvironmentSubstA( + pszSrc: LPSTR, + cchSrc: UINT, + ) -> DWORD; + pub fn DoEnvironmentSubstW( + pszSrc: LPWSTR, + cchSrc: UINT, + ) -> DWORD; + pub fn ExtractIconExA( + lpszFile: LPCSTR, + nIconIndex: c_int, + phiconLarge: *mut HICON, + phiconSmall: *mut HICON, + nIcons: UINT, + ) -> UINT; + pub fn ExtractIconExW( + lpszFile: LPCWSTR, + nIconIndex: c_int, + phiconLarge: *mut HICON, + phiconSmall: *mut HICON, + nIcons: UINT, + ) -> UINT; +} +pub const FO_MOVE: WORD = 0x0001; +pub const FO_COPY: WORD = 0x0002; +pub const FO_DELETE: WORD = 0x0003; +pub const FO_RENAME: WORD = 0x0004; +pub const FOF_MULTIDESTFILES: WORD = 0x0001; +pub const FOF_CONFIRMMOUSE: WORD = 0x0002; +pub const FOF_SILENT: WORD = 0x0004; +pub const FOF_RENAMEONCOLLISION: WORD = 0x0008; +pub const FOF_NOCONFIRMATION: WORD = 0x0010; +pub const FOF_WANTMAPPINGHANDLE: WORD = 0x0020; +pub const FOF_ALLOWUNDO: WORD = 0x0040; +pub const FOF_FILESONLY: WORD = 0x0080; +pub const FOF_SIMPLEPROGRESS: WORD = 0x0100; +pub const FOF_NOCONFIRMMKDIR: WORD = 0x0200; +pub const FOF_NOERRORUI: WORD = 0x0400; +pub const FOF_NOCOPYSECURITYATTRIBS: WORD = 0x0800; +pub const FOF_NORECURSION: WORD = 0x1000; +pub const FOF_NO_CONNECTED_ELEMENTS: WORD = 0x2000; +pub const FOF_WANTNUKEWARNING: WORD = 0x4000; +pub const FOF_NORECURSEREPARSE: WORD = 0x8000; +pub const FOF_NO_UI: WORD = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR; +pub type FILEOP_FLAGS = WORD; +pub const PO_DELETE: WORD = 0x0013; +pub const PO_RENAME: WORD = 0x0014; +pub const PO_PORTCHANGE: WORD = 0x0020; +pub const PO_REN_PORT: WORD = 0x0034; +pub type PRINTEROP_FLAGS = WORD; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHFILEOPSTRUCTA { + hwnd: HWND, + wFunc: UINT, + pFrom: PCZZSTR, + pTo: PCZZSTR, + fFlags: FILEOP_FLAGS, + fAnyOperationsAborted: BOOL, + hNameMappings: LPVOID, + lpszProgressTitle: PCSTR, +}} +pub type LPSHFILEOPSTRUCTA = *mut SHFILEOPSTRUCTA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHFILEOPSTRUCTW { + hwnd: HWND, + wFunc: UINT, + pFrom: PCZZWSTR, + pTo: PCZZWSTR, + fFlags: FILEOP_FLAGS, + fAnyOperationsAborted: BOOL, + hNameMappings: LPVOID, + lpszProgressTitle: PCWSTR, +}} +pub type LPSHFILEOPSTRUCTW = *mut SHFILEOPSTRUCTW; +extern "system" { + pub fn SHFileOperationA( + lpFileOp: LPSHFILEOPSTRUCTA, + ) -> c_int; + pub fn SHFileOperationW( + lpFileOp: LPSHFILEOPSTRUCTW, + ) -> c_int; + pub fn SHFreeNameMappings( + hNameMappings: HANDLE, + ); +} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHNAMEMAPPINGA { + pszOldPath: LPSTR, + pszNewPath: LPSTR, + cchOldPath: c_int, + cchNewPath: c_int, +}} +pub type LPSHNAMEMAPPINGA = *mut SHNAMEMAPPINGA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHNAMEMAPPINGW { + pszOldPath: LPWSTR, + pszNewPath: LPWSTR, + cchOldPath: c_int, + cchNewPath: c_int, +}} +pub type LPSHNAMEMAPPINGW = *mut SHNAMEMAPPINGW; +pub const SE_ERR_FNF: DWORD = 2; +pub const SE_ERR_PNF: DWORD = 3; +pub const SE_ERR_ACCESSDENIED: DWORD = 5; +pub const SE_ERR_OOM: DWORD = 8; +pub const SE_ERR_DLLNOTFOUND: DWORD = 32; +pub const SE_ERR_SHARE: DWORD = 26; +pub const SE_ERR_ASSOCINCOMPLETE: DWORD = 27; +pub const SE_ERR_DDETIMEOUT: DWORD = 28; +pub const SE_ERR_DDEFAIL: DWORD = 29; +pub const SE_ERR_DDEBUSY: DWORD = 30; +pub const SE_ERR_NOASSOC: DWORD = 31; +pub const SEE_MASK_DEFAULT: DWORD = 0x00000000; +pub const SEE_MASK_CLASSNAME: DWORD = 0x00000001; +pub const SEE_MASK_CLASSKEY: DWORD = 0x00000003; +pub const SEE_MASK_IDLIST: DWORD = 0x00000004; +pub const SEE_MASK_INVOKEIDLIST: DWORD = 0x0000000c; +pub const SEE_MASK_ICON: DWORD = 0x00000010; +pub const SEE_MASK_HOTKEY: DWORD = 0x00000020; +pub const SEE_MASK_NOCLOSEPROCESS: DWORD = 0x00000040; +pub const SEE_MASK_CONNECTNETDRV: DWORD = 0x00000080; +pub const SEE_MASK_NOASYNC: DWORD = 0x00000100; +pub const SEE_MASK_FLAG_DDEWAIT: DWORD = SEE_MASK_NOASYNC; +pub const SEE_MASK_DOENVSUBST: DWORD = 0x00000200; +pub const SEE_MASK_FLAG_NO_UI: DWORD = 0x00000400; +pub const SEE_MASK_UNICODE: DWORD = 0x00004000; +pub const SEE_MASK_NO_CONSOLE: DWORD = 0x00008000; +pub const SEE_MASK_ASYNCOK: DWORD = 0x00100000; +pub const SEE_MASK_HMONITOR: DWORD = 0x00200000; +pub const SEE_MASK_NOZONECHECKS: DWORD = 0x00800000; +pub const SEE_MASK_NOQUERYCLASSSTORE: DWORD = 0x01000000; +pub const SEE_MASK_WAITFORINPUTIDLE: DWORD = 0x02000000; +pub const SEE_MASK_FLAG_LOG_USAGE: DWORD = 0x04000000; +pub const SEE_MASK_FLAG_HINST_IS_SITE: DWORD = 0x08000000; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHELLEXECUTEINFOA { + cbSize: DWORD, + fMask: ULONG, + hwnd: HWND, + lpVerb: LPCSTR, + lpFile: LPCSTR, + lpParameters: LPCSTR, + lpDirectory: LPCSTR, + nShow: c_int, + hInstApp: HINSTANCE, + lpIDList: *mut c_void, + lpClass: LPCSTR, + hkeyClass: HKEY, + dwHotKey: DWORD, + hMonitor: HANDLE, + hProcess: HANDLE, +}} +pub type LPSHELLEXECUTEINFOA = *mut SHELLEXECUTEINFOA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHELLEXECUTEINFOW { + cbSize: DWORD, + fMask: ULONG, + hwnd: HWND, + lpVerb: LPCWSTR, + lpFile: LPCWSTR, + lpParameters: LPCWSTR, + lpDirectory: LPCWSTR, + nShow: c_int, + hInstApp: HINSTANCE, + lpIDList: *mut c_void, + lpClass: LPCWSTR, + hkeyClass: HKEY, + dwHotKey: DWORD, + hMonitor: HANDLE, + hProcess: HANDLE, +}} +pub type LPSHELLEXECUTEINFOW = *mut SHELLEXECUTEINFOW; +extern "system" { + pub fn ShellExecuteExA( + pExecInfo: *mut SHELLEXECUTEINFOA, + ) -> BOOL; + pub fn ShellExecuteExW( + pExecInfo: *mut SHELLEXECUTEINFOW, + ) -> BOOL; +} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHCREATEPROCESSINFOW { + cbSize: DWORD, + fMask: ULONG, + hwnd: HWND, + pszFile: LPCWSTR, + pszParameters: LPCWSTR, + pszCurrentDirectory: LPCWSTR, + hUserToken: HANDLE, + lpProcessAttributes: LPSECURITY_ATTRIBUTES, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + bInheritHandles: BOOL, + dwCreationFlags: DWORD, + lpStartupInfo: LPSTARTUPINFOW, + lpProcessInformation: LPPROCESS_INFORMATION, +}} +pub type PSHCREATEPROCESSINFOW = *mut SHCREATEPROCESSINFOW; +extern "system" { + pub fn SHCreateProcessAsUserW( + pscpi: PSHCREATEPROCESSINFOW, + ) -> BOOL; + pub fn SHEvaluateSystemCommandTemplate( + pszCmdTemplate: PCWSTR, + ppszApplication: *mut PWSTR, + ppszCommandLine: *mut PWSTR, + ppszParameters: *mut PWSTR, + ) -> HRESULT; +} +ENUM!{enum ASSOCCLASS { + ASSOCCLASS_SHELL_KEY = 0, + ASSOCCLASS_PROGID_KEY, + ASSOCCLASS_PROGID_STR, + ASSOCCLASS_CLSID_KEY, + ASSOCCLASS_CLSID_STR, + ASSOCCLASS_APP_KEY, + ASSOCCLASS_APP_STR, + ASSOCCLASS_SYSTEM_STR, + ASSOCCLASS_FOLDER, + ASSOCCLASS_STAR, + ASSOCCLASS_FIXED_PROGID_STR, + ASSOCCLASS_PROTOCOL_STR, +}} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct ASSOCIATIONELEMENT { + ac: ASSOCCLASS, + hkClass: HKEY, + pszClass: PCWSTR, +}} +extern "system" { + pub fn AssocCreateForClasses( + rgClasses: *const ASSOCIATIONELEMENT, + cClasses: ULONG, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT; +} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHQUERYRBINFO { + cbSize: DWORD, + i64Size: __int64, + i64NumItems: __int64, +}} +pub type LPSHQUERYRBINFO = *mut SHQUERYRBINFO; +pub const SHERB_NOCONFIRMATION: DWORD = 0x00000001; +pub const SHERB_NOPROGRESSUI: DWORD = 0x00000002; +pub const SHERB_NOSOUND: DWORD = 0x00000004; +extern "system" { + pub fn SHQueryRecycleBinA( + pszRootPath: LPCSTR, + pSHQueryRBInfo: LPSHQUERYRBINFO, + ) -> HRESULT; + pub fn SHQueryRecycleBinW( + pszRootPath: LPCWSTR, + pSHQueryRBInfo: LPSHQUERYRBINFO, + ) -> HRESULT; + pub fn SHEmptyRecycleBinA( + hwnd: HWND, + pszRootPath: LPCSTR, + dwFlags: DWORD, + ) -> HRESULT; + pub fn SHEmptyRecycleBinW( + hwnd: HWND, + pszRootPath: LPCWSTR, + dwFlags: DWORD, + ) -> HRESULT; +} +ENUM!{enum QUERY_USER_NOTIFICATION_STATE { + QUNS_NOT_PRESENT = 1, + QUNS_BUSY = 2, + QUNS_RUNNING_D3D_FULL_SCREEN = 3, + QUNS_PRESENTATION_MODE = 4, + QUNS_ACCEPTS_NOTIFICATIONS = 5, + QUNS_QUIET_TIME = 6, + QUNS_APP = 7, +}} +extern "system" { + pub fn SHQueryUserNotificationState( + pquns: *mut QUERY_USER_NOTIFICATION_STATE, + ) -> HRESULT; + pub fn SHGetPropertyStoreForWindow( + hwnd: HWND, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT; +} +UNION!{#[cfg_attr(target_arch = "x86", repr(packed))] union NOTIFYICONDATAA_u { + [u32; 1], + uTimeout uTimeout_mut: UINT, + uVersion uVersion_mut: UINT, +}} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct NOTIFYICONDATAA { + cbSize: DWORD, + hWnd: HWND, + uID: UINT, + uFlags: UINT, + uCallbackMessage: UINT, + hIcon: HICON, + szTip: [CHAR; 128], + dwState: DWORD, + dwStateMask: DWORD, + szInfo: [CHAR; 256], + u: NOTIFYICONDATAA_u, + szInfoTitle: [CHAR; 64], + dwInfoFlags: DWORD, + guidItem: GUID, + hBalloonIcon: HICON, +}} +pub type PNOTIFYICONDATAA = *mut NOTIFYICONDATAA; +UNION!{#[cfg_attr(target_arch = "x86", repr(packed))] union NOTIFYICONDATAW_u { + [u32; 1], + uTimeout uTimeout_mut: UINT, + uVersion uVersion_mut: UINT, +}} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct NOTIFYICONDATAW { + cbSize: DWORD, + hWnd: HWND, + uID: UINT, + uFlags: UINT, + uCallbackMessage: UINT, + hIcon: HICON, + szTip: [WCHAR; 128], + dwState: DWORD, + dwStateMask: DWORD, + szInfo: [WCHAR; 256], + u: NOTIFYICONDATAW_u, + szInfoTitle: [WCHAR; 64], + dwInfoFlags: DWORD, + guidItem: GUID, + hBalloonIcon: HICON, +}} +pub type PNOTIFYICONDATAW = *mut NOTIFYICONDATAW; +pub const NIN_SELECT: DWORD = WM_USER + 0; +pub const NINF_KEY: DWORD = 0x1; +pub const NIN_KEYSELECT: DWORD = NIN_SELECT | NINF_KEY; +pub const NIN_BALLOONSHOW: DWORD = WM_USER + 2; +pub const NIN_BALLOONHIDE: DWORD = WM_USER + 3; +pub const NIN_BALLOONTIMEOUT: DWORD = WM_USER + 4; +pub const NIN_BALLOONUSERCLICK: DWORD = WM_USER + 5; +pub const NIN_POPUPOPEN: DWORD = WM_USER + 6; +pub const NIN_POPUPCLOSE: DWORD = WM_USER + 7; +pub const NIM_ADD: DWORD = 0x00000000; +pub const NIM_MODIFY: DWORD = 0x00000001; +pub const NIM_DELETE: DWORD = 0x00000002; +pub const NIM_SETFOCUS: DWORD = 0x00000003; +pub const NIM_SETVERSION: DWORD = 0x00000004; +pub const NOTIFYICON_VERSION: DWORD = 3; +pub const NOTIFYICON_VERSION_4: DWORD = 4; +pub const NIF_MESSAGE: DWORD = 0x00000001; +pub const NIF_ICON: DWORD = 0x00000002; +pub const NIF_TIP: DWORD = 0x00000004; +pub const NIF_STATE: DWORD = 0x00000008; +pub const NIF_INFO: DWORD = 0x00000010; +pub const NIF_GUID: DWORD = 0x00000020; +pub const NIF_REALTIME: DWORD = 0x00000040; +pub const NIF_SHOWTIP: DWORD = 0x00000080; +pub const NIS_HIDDEN: DWORD = 0x00000001; +pub const NIS_SHAREDICON: DWORD = 0x00000002; +pub const NIIF_NONE: DWORD = 0x00000000; +pub const NIIF_INFO: DWORD = 0x00000001; +pub const NIIF_WARNING: DWORD = 0x00000002; +pub const NIIF_ERROR: DWORD = 0x00000003; +pub const NIIF_USER: DWORD = 0x00000004; +pub const NIIF_ICON_MASK: DWORD = 0x0000000F; +pub const NIIF_NOSOUND: DWORD = 0x00000010; +pub const NIIF_LARGE_ICON: DWORD = 0x00000020; +pub const NIIF_RESPECT_QUIET_TIME: DWORD = 0x00000080; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct NOTIFYICONIDENTIFIER { + cbSize: DWORD, + hWnd: HWND, + uID: UINT, + guidItem: GUID, +}} +pub type PNOTIFYICONIDENTIFIER = *mut NOTIFYICONIDENTIFIER; +extern "system" { + pub fn Shell_NotifyIconA( + dwMessage: DWORD, + lpData: PNOTIFYICONDATAA, + ) -> BOOL; + pub fn Shell_NotifyIconW( + dwMessage: DWORD, + lpData: PNOTIFYICONDATAW, + ) -> BOOL; + pub fn Shell_NotifyIconGetRect( + identifier: *const NOTIFYICONIDENTIFIER, + iconLocation: *mut RECT, + ) -> HRESULT; +} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHFILEINFOA { + hIcon: HICON, + iIcon: c_int, + dwAttributes: DWORD, + szDisplayName: [CHAR; MAX_PATH], + szTypeName: [CHAR; 80], +}} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHFILEINFOW { + hIcon: HICON, + iIcon: c_int, + dwAttributes: DWORD, + szDisplayName: [WCHAR; MAX_PATH], + szTypeName: [WCHAR; 80], +}} +pub const SHGFI_ICON: DWORD = 0x000000100; +pub const SHGFI_DISPLAYNAME: DWORD = 0x000000200; +pub const SHGFI_TYPENAME: DWORD = 0x000000400; +pub const SHGFI_ATTRIBUTES: DWORD = 0x000000800; +pub const SHGFI_ICONLOCATION: DWORD = 0x000001000; +pub const SHGFI_EXETYPE: DWORD = 0x000002000; +pub const SHGFI_SYSICONINDEX: DWORD = 0x000004000; +pub const SHGFI_LINKOVERLAY: DWORD = 0x000008000; +pub const SHGFI_SELECTED: DWORD = 0x000010000; +pub const SHGFI_ATTR_SPECIFIED: DWORD = 0x000020000; +pub const SHGFI_LARGEICON: DWORD = 0x000000000; +pub const SHGFI_SMALLICON: DWORD = 0x000000001; +pub const SHGFI_OPENICON: DWORD = 0x000000002; +pub const SHGFI_SHELLICONSIZE: DWORD = 0x000000004; +pub const SHGFI_PIDL: DWORD = 0x000000008; +pub const SHGFI_USEFILEATTRIBUTES: DWORD = 0x000000010; +pub const SHGFI_ADDOVERLAYS: DWORD = 0x000000020; +pub const SHGFI_OVERLAYINDEX: DWORD = 0x000000040; +extern "system" { + pub fn SHGetFileInfoA( + pszPath: LPCSTR, + dwFileAttributes: DWORD, + psfi: *mut SHFILEINFOA, + cbFileInfo: UINT, + uFlags: UINT, + ) -> DWORD_PTR; + pub fn SHGetFileInfoW( + pszPath: LPCWSTR, + dwFileAttributes: DWORD, + psfi: *mut SHFILEINFOW, + cbFileInfo: UINT, + uFlags: UINT, + ) -> DWORD_PTR; +} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct SHSTOCKICONINFO { + cbSize: DWORD, + hIcon: HICON, + iSysImageIndex: c_int, + iIcon: c_int, + szPath: [WCHAR; MAX_PATH], +}} +pub const SHGSI_ICONLOCATION: DWORD = 0; +pub const SHGSI_ICON: DWORD = SHGFI_ICON; +pub const SHGSI_SYSICONINDEX: DWORD = SHGFI_SYSICONINDEX; +pub const SHGSI_LINKOVERLAY: DWORD = SHGFI_LINKOVERLAY; +pub const SHGSI_SELECTED: DWORD = SHGFI_SELECTED; +pub const SHGSI_LARGEICON: DWORD = SHGFI_LARGEICON; +pub const SHGSI_SMALLICON: DWORD = SHGFI_SMALLICON; +pub const SHGSI_SHELLICONSIZE: DWORD = SHGFI_SHELLICONSIZE; +ENUM!{enum SHSTOCKICONID { + SIID_DOCNOASSOC = 0, + SIID_DOCASSOC = 1, + SIID_APPLICATION = 2, + SIID_FOLDER = 3, + SIID_FOLDEROPEN = 4, + SIID_DRIVE525 = 5, + SIID_DRIVE35 = 6, + SIID_DRIVEREMOVE = 7, + SIID_DRIVEFIXED = 8, + SIID_DRIVENET = 9, + SIID_DRIVENETDISABLED = 10, + SIID_DRIVECD = 11, + SIID_DRIVERAM = 12, + SIID_WORLD = 13, + SIID_SERVER = 15, + SIID_PRINTER = 16, + SIID_MYNETWORK = 17, + SIID_FIND = 22, + SIID_HELP = 23, + SIID_SHARE = 28, + SIID_LINK = 29, + SIID_SLOWFILE = 30, + SIID_RECYCLER = 31, + SIID_RECYCLERFULL = 32, + SIID_MEDIACDAUDIO = 40, + SIID_LOCK = 47, + SIID_AUTOLIST = 49, + SIID_PRINTERNET = 50, + SIID_SERVERSHARE = 51, + SIID_PRINTERFAX = 52, + SIID_PRINTERFAXNET = 53, + SIID_PRINTERFILE = 54, + SIID_STACK = 55, + SIID_MEDIASVCD = 56, + SIID_STUFFEDFOLDER = 57, + SIID_DRIVEUNKNOWN = 58, + SIID_DRIVEDVD = 59, + SIID_MEDIADVD = 60, + SIID_MEDIADVDRAM = 61, + SIID_MEDIADVDRW = 62, + SIID_MEDIADVDR = 63, + SIID_MEDIADVDROM = 64, + SIID_MEDIACDAUDIOPLUS = 65, + SIID_MEDIACDRW = 66, + SIID_MEDIACDR = 67, + SIID_MEDIACDBURN = 68, + SIID_MEDIABLANKCD = 69, + SIID_MEDIACDROM = 70, + SIID_AUDIOFILES = 71, + SIID_IMAGEFILES = 72, + SIID_VIDEOFILES = 73, + SIID_MIXEDFILES = 74, + SIID_FOLDERBACK = 75, + SIID_FOLDERFRONT = 76, + SIID_SHIELD = 77, + SIID_WARNING = 78, + SIID_INFO = 79, + SIID_ERROR = 80, + SIID_KEY = 81, + SIID_SOFTWARE = 82, + SIID_RENAME = 83, + SIID_DELETE = 84, + SIID_MEDIAAUDIODVD = 85, + SIID_MEDIAMOVIEDVD = 86, + SIID_MEDIAENHANCEDCD = 87, + SIID_MEDIAENHANCEDDVD = 88, + SIID_MEDIAHDDVD = 89, + SIID_MEDIABLURAY = 90, + SIID_MEDIAVCD = 91, + SIID_MEDIADVDPLUSR = 92, + SIID_MEDIADVDPLUSRW = 93, + SIID_DESKTOPPC = 94, + SIID_MOBILEPC = 95, + SIID_USERS = 96, + SIID_MEDIASMARTMEDIA = 97, + SIID_MEDIACOMPACTFLASH = 98, + SIID_DEVICECELLPHONE = 99, + SIID_DEVICECAMERA = 100, + SIID_DEVICEVIDEOCAMERA = 101, + SIID_DEVICEAUDIOPLAYER = 102, + SIID_NETWORKCONNECT = 103, + SIID_INTERNET = 104, + SIID_ZIPFILE = 105, + SIID_SETTINGS = 106, + SIID_DRIVEHDDVD = 132, + SIID_DRIVEBD = 133, + SIID_MEDIAHDDVDROM = 134, + SIID_MEDIAHDDVDR = 135, + SIID_MEDIAHDDVDRAM = 136, + SIID_MEDIABDROM = 137, + SIID_MEDIABDR = 138, + SIID_MEDIABDRE = 139, + SIID_CLUSTEREDDRIVE = 140, + SIID_MAX_ICONS = 181, +}} +pub const SIID_INVALID: SHSTOCKICONID = -1i32 as u32; +extern "system" { + pub fn SHGetStockIconInfo( + siid: SHSTOCKICONID, + uFlags: UINT, + psii: *mut SHSTOCKICONINFO, + ) -> HRESULT; + pub fn SHGetDiskFreeSpaceExA( + pszDirectoryName: LPCSTR, + pulFreeBytesAvailableToCaller: *mut ULARGE_INTEGER, + pulTotalNumberOfBytes: *mut ULARGE_INTEGER, + pulTotalNumberOfFreeBytes: *mut ULARGE_INTEGER, + ) -> BOOL; + pub fn SHGetDiskFreeSpaceExW( + pszDirectoryName: LPCWSTR, + pulFreeBytesAvailableToCaller: *mut ULARGE_INTEGER, + pulTotalNumberOfBytes: *mut ULARGE_INTEGER, + pulTotalNumberOfFreeBytes: *mut ULARGE_INTEGER, + ) -> BOOL; + pub fn SHGetNewLinkInfoA( + pszLinkTo: LPCSTR, + pszDir: LPCSTR, + pszName: LPSTR, + pfMustCopy: *mut BOOL, + uFlags: UINT, + ) -> BOOL; + pub fn SHGetNewLinkInfoW( + pszLinkTo: LPCWSTR, + pszDir: LPCWSTR, + pszName: LPWSTR, + pfMustCopy: *mut BOOL, + uFlags: UINT, + ) -> BOOL; +} +pub const SHGNLI_PIDL: DWORD = 0x000000001; +pub const SHGNLI_PREFIXNAME: DWORD = 0x000000002; +pub const SHGNLI_NOUNIQUE: DWORD = 0x000000004; +pub const SHGNLI_NOLNK: DWORD = 0x000000008; +pub const SHGNLI_NOLOCNAME: DWORD = 0x000000010; +pub const SHGNLI_USEURLEXT: DWORD = 0x000000020; +pub const PRINTACTION_OPEN: DWORD = 0; +pub const PRINTACTION_PROPERTIES: DWORD = 1; +pub const PRINTACTION_NETINSTALL: DWORD = 2; +pub const PRINTACTION_NETINSTALLLINK: DWORD = 3; +pub const PRINTACTION_TESTPAGE: DWORD = 4; +pub const PRINTACTION_OPENNETPRN: DWORD = 5; +pub const PRINTACTION_DOCUMENTDEFAULTS: DWORD = 6; +pub const PRINTACTION_SERVERPROPERTIES: DWORD = 7; +extern "system" { + pub fn SHInvokePrinterCommandA( + hwnd: HWND, + uAction: UINT, + lpBuf1: LPCSTR, + lpBuf2: LPCSTR, + fModal: BOOL, + ) -> BOOL; + pub fn SHInvokePrinterCommandW( + hwnd: HWND, + uAction: UINT, + lpBuf1: LPCWSTR, + lpBuf2: LPCWSTR, + fModal: BOOL, + ) -> BOOL; +} +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct OPEN_PRINTER_PROPS_INFOA { + dwSize: DWORD, + pszSheetName: LPSTR, + uSheetIndex: UINT, + dwFlags: DWORD, + bModal: BOOL, +}} +pub type POPEN_PRINTER_PROPS_INFOA = *mut OPEN_PRINTER_PROPS_INFOA; +STRUCT!{#[cfg_attr(target_arch = "x86", repr(packed))] struct OPEN_PRINTER_PROPS_INFOW { + dwSize: DWORD, + pszSheetName: LPWSTR, + uSheetIndex: UINT, + dwFlags: DWORD, + bModal: BOOL, +}} +pub type POPEN_PRINTER_PROPS_INFOW = *mut OPEN_PRINTER_PROPS_INFOW; +pub const PRINT_PROP_FORCE_NAME: DWORD = 0x01; +extern "system" { + pub fn SHLoadNonloadedIconOverlayIdentifiers() -> HRESULT; + pub fn SHIsFileAvailableOffline( + pwszPath: PCWSTR, + pdwStatus: *mut DWORD, + ) -> HRESULT; +} +pub const OFFLINE_STATUS_LOCAL: DWORD = 0x0001; +pub const OFFLINE_STATUS_REMOTE: DWORD = 0x0002; +pub const OFFLINE_STATUS_INCOMPLETE: DWORD = 0x0004; +extern "system" { + pub fn SHSetLocalizedName( + pszPath: PCWSTR, + pszResModule: PCWSTR, + idsRes: c_int, + ) -> HRESULT; + pub fn SHRemoveLocalizedName( + pszPath: PCWSTR, + ) -> HRESULT; + pub fn SHGetLocalizedName( + pszPath: PCWSTR, + pszResModule: PWSTR, + cch: UINT, + pidsRes: *mut c_int, + ) -> HRESULT; +} +extern "C" { + pub fn ShellMessageBoxA( + hAppInst: HINSTANCE, + hWnd: HWND, + lpcText: LPCSTR, + lpcTitle: LPCSTR, + fuStyle: UINT, + ... + ) -> c_int; + pub fn ShellMessageBoxW( + hAppInst: HINSTANCE, + hWnd: HWND, + lpcText: LPCWSTR, + lpcTitle: LPCWSTR, + fuStyle: UINT, + ... + ) -> c_int; +} +extern "system" { + pub fn IsLFNDriveA( + pszPath: LPCSTR, + ) -> BOOL; + pub fn IsLFNDriveW( + pszPath: LPCWSTR, + ) -> BOOL; + pub fn SHEnumerateUnreadMailAccountsA( + hKeyUser: HKEY, + dwIndex: DWORD, + pszMailAddress: LPSTR, + cchMailAddress: c_int, + ) -> HRESULT; + pub fn SHEnumerateUnreadMailAccountsW( + hKeyUser: HKEY, + dwIndex: DWORD, + pszMailAddress: LPWSTR, + cchMailAddress: c_int, + ) -> HRESULT; + pub fn SHGetUnreadMailCountA( + hKeyUser: HKEY, + pszMailAddress: LPCSTR, + pdwCount: *mut DWORD, + pFileTime: *mut FILETIME, + pszShellExecuteCommand: LPSTR, + cchShellExecuteCommand: c_int, + ) -> HRESULT; + pub fn SHGetUnreadMailCountW( + hKeyUser: HKEY, + pszMailAddress: LPCWSTR, + pdwCount: *mut DWORD, + pFileTime: *mut FILETIME, + pszShellExecuteCommand: LPWSTR, + cchShellExecuteCommand: c_int, + ) -> HRESULT; + pub fn SHSetUnreadMailCountA( + pszMailAddress: LPCSTR, + dwCount: DWORD, + pszShellExecuteCommand: LPCSTR, + ) -> HRESULT; + pub fn SHSetUnreadMailCountW( + pszMailAddress: LPCWSTR, + dwCount: DWORD, + pszShellExecuteCommand: LPCWSTR, + ) -> HRESULT; + pub fn SHTestTokenMembership( + hToken: HANDLE, + ulRID: ULONG, + ) -> BOOL; + pub fn SHGetImageList( + iImageList: c_int, + riid: REFIID, + ppvObj: *mut *mut c_void, + ) -> HRESULT; +} +pub const SHIL_LARGE: DWORD = 0; +pub const SHIL_SMALL: DWORD = 1; +pub const SHIL_EXTRALARGE: DWORD = 2; +pub const SHIL_SYSSMALL: DWORD = 3; +pub const SHIL_JUMBO: DWORD = 4; +pub const SHIL_LAST: DWORD = SHIL_JUMBO; +FN!{stdcall PFNCANSHAREFOLDERW( + pszPath: PCWSTR, +) -> HRESULT} +FN!{stdcall PFNSHOWSHAREFOLDERUIW( + hwndParent: HWND, + pszPath: PCWSTR, +) -> HRESULT} +pub const WC_NETADDRESS: &'static str = "msctls_netaddress"; +extern "system" { + pub fn InitNetworkAddressControl() -> BOOL; +} +// STRUCT!{struct NC_ADDRESS { +// pAddrInfo: *mut NET_ADDRESS_INFO, +// PortNumber: USHORT, +// PrefixLength: BYTE, +// }} +// pub type PNC_ADDRESS = *mut NC_ADDRESS; +extern "system" { + pub fn SHGetDriveMedia( + pszDrive: PCWSTR, + pdwMediaContent: *mut DWORD, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/shellscalingapi.rs b/bash-5.1/vendor/winapi/src/um/shellscalingapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..4db4ff6fe6614a8fe0a1bd7ce2611248056c31a2 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/shellscalingapi.rs @@ -0,0 +1,44 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::UINT; +use shared::windef::HMONITOR; +use um::winnt::{HANDLE, HRESULT}; +ENUM!{enum PROCESS_DPI_AWARENESS { + PROCESS_DPI_UNAWARE = 0, + PROCESS_SYSTEM_DPI_AWARE = 1, + PROCESS_PER_MONITOR_DPI_AWARE = 2, +}} +ENUM!{enum MONITOR_DPI_TYPE { + MDT_EFFECTIVE_DPI = 0, + MDT_ANGULAR_DPI = 1, + MDT_RAW_DPI = 2, + MDT_DEFAULT = MDT_EFFECTIVE_DPI, +}} +extern "system" { + pub fn SetProcessDpiAwareness( + value: PROCESS_DPI_AWARENESS, + ) -> HRESULT; + pub fn GetProcessDpiAwareness( + hProcess: HANDLE, + value: *mut PROCESS_DPI_AWARENESS, + ) -> HRESULT; + pub fn GetDpiForMonitor( + hmonitor: HMONITOR, + dpiType: MONITOR_DPI_TYPE, + dpiX: *mut UINT, + dpiY: *mut UINT, + ) -> HRESULT; +} +ENUM!{enum SHELL_UI_COMPONENT { + SHELL_UI_COMPONENT_TASKBARS = 0, + SHELL_UI_COMPONENT_NOTIFICATIONAREA = 1, + SHELL_UI_COMPONENT_DESKBAND = 2, +}} +extern "system" { + pub fn GetDpiForShellUIComponent( + component: SHELL_UI_COMPONENT, + ) -> UINT; +} diff --git a/bash-5.1/vendor/winapi/src/um/shlobj.rs b/bash-5.1/vendor/winapi/src/um/shlobj.rs new file mode 100644 index 0000000000000000000000000000000000000000..f652c6c2dd719d0e0daa37b0cf408c8c8ac29e41 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/shlobj.rs @@ -0,0 +1,260 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_int, c_void}; +use shared::guiddef::REFIID; +use shared::minwindef::{BOOL, DWORD, UINT}; +use shared::windef::HWND; +use um::minwinbase::SECURITY_ATTRIBUTES; +use um::shtypes::{PCIDLIST_ABSOLUTE, PCUITEMID_CHILD_ARRAY, PIDLIST_ABSOLUTE, REFKNOWNFOLDERID}; +use um::winnt::{HANDLE, HRESULT, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PCWSTR, PWSTR}; +pub const IDO_SHGIOI_SHARE: c_int = 0x0FFFFFFF; +pub const IDO_SHGIOI_LINK: c_int = 0x0FFFFFFE; +// Yes, these values are supposed to be 9 digits +pub const IDO_SHGIOI_SLOWFILE: c_int = 0x0FFFFFFFD; +pub const IDO_SHGIOI_DEFAULT: c_int = 0x0FFFFFFFC; +extern "system" { + pub fn SHGetIconOverlayIndexA( + pszIconPath: LPCSTR, + iIconIndex: c_int, + ) -> c_int; + pub fn SHGetIconOverlayIndexW( + pszIconPath: LPCWSTR, + iIconIndex: c_int, + ) -> c_int; +} +pub const GPFIDL_DEFAULT: GPFIDL_FLAGS = 0x0000; +pub const GPFIDL_ALTNAME: GPFIDL_FLAGS = 0x0001; +pub const GPFIDL_UNCPRINTER: GPFIDL_FLAGS = 0x0002; +pub type GPFIDL_FLAGS = c_int; +extern "system" { + pub fn SHGetPathFromIDListEx( + pidl: PCIDLIST_ABSOLUTE, + pszPath: PWSTR, + cchPath: DWORD, + uOpts: GPFIDL_FLAGS, + ) -> BOOL; + pub fn SHGetPathFromIDListA( + pidl: PCIDLIST_ABSOLUTE, + pszPath: LPSTR, + ) -> BOOL; + pub fn SHGetPathFromIDListW( + pidl: PCIDLIST_ABSOLUTE, + pszPath: LPWSTR, + ) -> BOOL; + pub fn SHCreateDirectory( + hwnd: HWND, + pszPath: PCWSTR, + ) -> c_int; + pub fn SHCreateDirectoryExA( + hwnd: HWND, + pszPath: LPCSTR, + psa: *const SECURITY_ATTRIBUTES, + ) -> c_int; + pub fn SHCreateDirectoryExW( + hwnd: HWND, + pszPath: LPCWSTR, + psa: *const SECURITY_ATTRIBUTES, + ) -> c_int; +} +pub const OFASI_EDIT: DWORD = 0x0001; +pub const OFASI_OPENDESKTOP: DWORD = 0x0002; +extern "system" { + pub fn SHOpenFolderAndSelectItems( + pidlFolder: PCIDLIST_ABSOLUTE, + cidl: UINT, + apidl: PCUITEMID_CHILD_ARRAY, + dwFlags: DWORD, + ) -> HRESULT; + //pub fn SHCreateShellItem( + // pidlParent: PCIDLIST_ABSOLUTE, + // psfParent: *mut IShellFolder, + // pidl: PCUITEMID_CHILD, + // ppsi: *mut *mut IShellItem, + //) -> HRESULT; +} +pub const CSIDL_DESKTOP: c_int = 0x0000; +pub const CSIDL_INTERNET: c_int = 0x0001; +pub const CSIDL_PROGRAMS: c_int = 0x0002; +pub const CSIDL_CONTROLS: c_int = 0x0003; +pub const CSIDL_PRINTERS: c_int = 0x0004; +pub const CSIDL_PERSONAL: c_int = 0x0005; +pub const CSIDL_FAVORITES: c_int = 0x0006; +pub const CSIDL_STARTUP: c_int = 0x0007; +pub const CSIDL_RECENT: c_int = 0x0008; +pub const CSIDL_SENDTO: c_int = 0x0009; +pub const CSIDL_BITBUCKET: c_int = 0x000a; +pub const CSIDL_STARTMENU: c_int = 0x000b; +pub const CSIDL_MYDOCUMENTS: c_int = CSIDL_PERSONAL; +pub const CSIDL_MYMUSIC: c_int = 0x000d; +pub const CSIDL_MYVIDEO: c_int = 0x000e; +pub const CSIDL_DESKTOPDIRECTORY: c_int = 0x0010; +pub const CSIDL_DRIVES: c_int = 0x0011; +pub const CSIDL_NETWORK: c_int = 0x0012; +pub const CSIDL_NETHOOD: c_int = 0x0013; +pub const CSIDL_FONTS: c_int = 0x0014; +pub const CSIDL_TEMPLATES: c_int = 0x0015; +pub const CSIDL_COMMON_STARTMENU: c_int = 0x0016; +pub const CSIDL_COMMON_PROGRAMS: c_int = 0x0017; +pub const CSIDL_COMMON_STARTUP: c_int = 0x0018; +pub const CSIDL_COMMON_DESKTOPDIRECTORY: c_int = 0x0019; +pub const CSIDL_APPDATA: c_int = 0x001a; +pub const CSIDL_PRINTHOOD: c_int = 0x001b; +pub const CSIDL_LOCAL_APPDATA: c_int = 0x001c; +pub const CSIDL_ALTSTARTUP: c_int = 0x001d; +pub const CSIDL_COMMON_ALTSTARTUP: c_int = 0x001e; +pub const CSIDL_COMMON_FAVORITES: c_int = 0x001f; +pub const CSIDL_INTERNET_CACHE: c_int = 0x0020; +pub const CSIDL_COOKIES: c_int = 0x0021; +pub const CSIDL_HISTORY: c_int = 0x0022; +pub const CSIDL_COMMON_APPDATA: c_int = 0x0023; +pub const CSIDL_WINDOWS: c_int = 0x0024; +pub const CSIDL_SYSTEM: c_int = 0x0025; +pub const CSIDL_PROGRAM_FILES: c_int = 0x0026; +pub const CSIDL_MYPICTURES: c_int = 0x0027; +pub const CSIDL_PROFILE: c_int = 0x0028; +pub const CSIDL_SYSTEMX86: c_int = 0x0029; +pub const CSIDL_PROGRAM_FILESX86: c_int = 0x002a; +pub const CSIDL_PROGRAM_FILES_COMMON: c_int = 0x002b; +pub const CSIDL_PROGRAM_FILES_COMMONX86: c_int = 0x002c; +pub const CSIDL_COMMON_TEMPLATES: c_int = 0x002d; +pub const CSIDL_COMMON_DOCUMENTS: c_int = 0x002e; +pub const CSIDL_COMMON_ADMINTOOLS: c_int = 0x002f; +pub const CSIDL_ADMINTOOLS: c_int = 0x0030; +pub const CSIDL_CONNECTIONS: c_int = 0x0031; +pub const CSIDL_COMMON_MUSIC: c_int = 0x0035; +pub const CSIDL_COMMON_PICTURES: c_int = 0x0036; +pub const CSIDL_COMMON_VIDEO: c_int = 0x0037; +pub const CSIDL_RESOURCES: c_int = 0x0038; +pub const CSIDL_RESOURCES_LOCALIZED: c_int = 0x0039; +pub const CSIDL_COMMON_OEM_LINKS: c_int = 0x003a; +pub const CSIDL_CDBURN_AREA: c_int = 0x003b; +pub const CSIDL_COMPUTERSNEARME: c_int = 0x003d; +pub const CSIDL_FLAG_CREATE: c_int = 0x8000; +pub const CSIDL_FLAG_DONT_VERIFY: c_int = 0x4000; +pub const CSIDL_FLAG_DONT_UNEXPAND: c_int = 0x2000; +pub const CSIDL_FLAG_NO_ALIAS: c_int = 0x1000; +pub const CSIDL_FLAG_PER_USER_INIT: c_int = 0x0800; +pub const CSIDL_FLAG_MASK: c_int = 0xff00; +extern "system" { + pub fn SHGetSpecialFolderLocation( + hwnd: HWND, + csidl: c_int, + ppidl: *mut PIDLIST_ABSOLUTE, + ) -> HRESULT; + pub fn SHCloneSpecialIDList( + hwnd: HWND, + csidl: c_int, + fCreate: BOOL, + ) -> PIDLIST_ABSOLUTE; + pub fn SHGetSpecialFolderPathA( + hwnd: HWND, + pszPath: LPSTR, + csidl: c_int, + fCreate: BOOL, + ) -> BOOL; + pub fn SHGetSpecialFolderPathW( + hwnd: HWND, + pszPath: LPWSTR, + csidl: c_int, + fCreate: BOOL, + ) -> BOOL; + pub fn SHFlushSFCache(); +} +ENUM!{enum SHGFP_TYPE { + SHGFP_TYPE_CURRENT = 0, + SHGFP_TYPE_DEFAULT = 1, +}} +extern "system" { + pub fn SHGetFolderPathA( + hwnd: HWND, + csidl: c_int, + hToken: HANDLE, + dwFlags: DWORD, + pszPath: LPSTR, + ) -> HRESULT; + pub fn SHGetFolderPathW( + hwnd: HWND, + csidl: c_int, + hToken: HANDLE, + dwFlags: DWORD, + pszPath: LPWSTR, + ) -> HRESULT; + pub fn SHGetFolderLocation( + hwnd: HWND, + csidl: c_int, + hToken: HANDLE, + dwFlags: DWORD, + ppidl: *mut PIDLIST_ABSOLUTE, + ) -> HRESULT; + pub fn SHSetFolderPathA( + csidl: c_int, + hToken: HANDLE, + dwFlags: DWORD, + pszPath: LPCSTR, + ) -> HRESULT; + pub fn SHSetFolderPathW( + csidl: c_int, + hToken: HANDLE, + dwFlags: DWORD, + pszPath: LPCWSTR, + ) -> HRESULT; + pub fn SHGetFolderPathAndSubDirA( + hwnd: HWND, + csidl: c_int, + hToken: HANDLE, + dwFlags: DWORD, + pszSubDir: LPCSTR, + pszPath: LPSTR, + ) -> HRESULT; + pub fn SHGetFolderPathAndSubDirW( + hwnd: HWND, + csidl: c_int, + hToken: HANDLE, + dwFlags: DWORD, + pszSubDir: LPCWSTR, + pszPath: LPWSTR, + ) -> HRESULT; +} +ENUM!{enum KNOWN_FOLDER_FLAG { + KF_FLAG_DEFAULT = 0x00000000, + KF_FLAG_NO_APPCONTAINER_REDIRECTION = 0x00010000, + KF_FLAG_CREATE = 0x00008000, + KF_FLAG_DONT_VERIFY = 0x00004000, + KF_FLAG_DONT_UNEXPAND = 0x00002000, + KF_FLAG_NO_ALIAS = 0x00001000, + KF_FLAG_INIT = 0x00000800, + KF_FLAG_DEFAULT_PATH = 0x00000400, + KF_FLAG_NOT_PARENT_RELATIVE = 0x00000200, + KF_FLAG_SIMPLE_IDLIST = 0x00000100, + KF_FLAG_ALIAS_ONLY = 0x80000000, +}} +extern "system" { + pub fn SHGetKnownFolderIDList( + rfid: REFKNOWNFOLDERID, + dwFlags: DWORD, + hToken: HANDLE, + ppidl: *mut PIDLIST_ABSOLUTE, + ) -> HRESULT; + pub fn SHSetKnownFolderPath( + rfid: REFKNOWNFOLDERID, + dwFlags: DWORD, + hToken: HANDLE, + pszPath: PCWSTR, + ) -> HRESULT; + pub fn SHGetKnownFolderPath( + rfid: REFKNOWNFOLDERID, + dwFlags: DWORD, + hToken: HANDLE, + pszPath: *mut PWSTR, + ) -> HRESULT; + pub fn SHGetKnownFolderItem( + rfid: REFKNOWNFOLDERID, + flags: KNOWN_FOLDER_FLAG, + hToken: HANDLE, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/shobjidl.rs b/bash-5.1/vendor/winapi/src/um/shobjidl.rs new file mode 100644 index 0000000000000000000000000000000000000000..ad351cc57a872040e62ee1fb5ab9e616a8966087 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/shobjidl.rs @@ -0,0 +1,329 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::REFGUID; +use shared::minwindef::{BOOL, DWORD, UINT}; +use shared::windef::HWND; +use um::propsys::{IPropertyDescriptionList, IPropertyStore}; +use um::shobjidl_core::{IModalWindow, IModalWindowVtbl, IShellItem, IShellItemFilter}; +use um::shtypes::COMDLG_FILTERSPEC; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR, WCHAR}; +pub type IFileOperationProgressSink = IUnknown; // TODO +pub use um::shobjidl_core::{IShellItemArray, SIATTRIBFLAGS}; // FIXME: Remove these in the next major release +ENUM!{enum FDE_OVERWRITE_RESPONSE { + FDEOR_DEFAULT = 0, + FDEOR_ACCEPT = 1, + FDEOR_REFUSE = 2, +}} +ENUM!{enum FDE_SHAREVIOLATION_RESPONSE { + FDESVR_DEFAULT = 0, + FDESVR_ACCEPT = 1, + FDESVR_REFUSE = 2, +}} +ENUM!{enum FDAP { + FDAP_BOTTOM = 0, + FDAP_TOP = 1, +}} +RIDL!{#[uuid(0x973510db, 0x7d7f, 0x452b, 0x89, 0x75, 0x74, 0xa8, 0x58, 0x28, 0xd3, 0x54)] +interface IFileDialogEvents(IFileDialogEventsVtbl): IUnknown(IUnknownVtbl) { + fn OnFileOk( + pfd: *mut IFileDialog, + ) -> HRESULT, + fn OnFolderChanging( + pfd: *mut IFileDialog, + psiFolder: *mut IShellItem, + ) -> HRESULT, + fn OnFolderChange( + pfd: *mut IFileDialog, + ) -> HRESULT, + fn OnSelectionChange( + pfd: *mut IFileDialog, + ) -> HRESULT, + fn OnShareViolation( + pfd: *mut IFileDialog, + psi: *mut IShellItem, + pResponse: *mut FDE_SHAREVIOLATION_RESPONSE, + ) -> HRESULT, + fn OnTypeChange( + pfd: *mut IFileDialog, + ) -> HRESULT, + fn OnOverwrite( + pfd: *mut IFileDialog, + psi: *mut IShellItem, + pResponse: *mut FDE_OVERWRITE_RESPONSE, + ) -> HRESULT, +}} +ENUM!{enum FILEOPENDIALOGOPTIONS { + FOS_OVERWRITEPROMPT = 0x2, + FOS_STRICTFILETYPES = 0x4, + FOS_NOCHANGEDIR = 0x8, + FOS_PICKFOLDERS = 0x20, + FOS_FORCEFILESYSTEM = 0x40, + FOS_ALLNONSTORAGEITEMS = 0x80, + FOS_NOVALIDATE = 0x100, + FOS_ALLOWMULTISELECT = 0x200, + FOS_PATHMUSTEXIST = 0x800, + FOS_FILEMUSTEXIST = 0x1000, + FOS_CREATEPROMPT = 0x2000, + FOS_SHAREAWARE = 0x4000, + FOS_NOREADONLYRETURN = 0x8000, + FOS_NOTESTFILECREATE = 0x10000, + FOS_HIDEMRUPLACES = 0x20000, + FOS_HIDEPINNEDPLACES = 0x40000, + FOS_NODEREFERENCELINKS = 0x100000, + FOS_DONTADDTORECENT = 0x2000000, + FOS_FORCESHOWHIDDEN = 0x10000000, + FOS_DEFAULTNOMINIMODE = 0x20000000, + FOS_FORCEPREVIEWPANEON = 0x40000000, + FOS_SUPPORTSTREAMABLEITEMS = 0x80000000, +}} +RIDL!{#[uuid(0x42f85136, 0xdb7e, 0x439c, 0x85, 0xf1, 0xe4, 0x07, 0x5d, 0x13, 0x5f, 0xc8)] +interface IFileDialog(IFileDialogVtbl): IModalWindow(IModalWindowVtbl) { + fn SetFileTypes( + cFileTypes: UINT, + rgFilterSpec: *const COMDLG_FILTERSPEC, + ) -> HRESULT, + fn SetFileTypeIndex( + iFileType: UINT, + ) -> HRESULT, + fn GetFileTypeIndex( + piFileType: *mut UINT, + ) -> HRESULT, + fn Advise( + pfde: *mut IFileDialogEvents, + pdwCookie: *mut DWORD, + ) -> HRESULT, + fn Unadvise( + dwCookie: DWORD, + ) -> HRESULT, + fn SetOptions( + fos: FILEOPENDIALOGOPTIONS, + ) -> HRESULT, + fn GetOptions( + pfos: *mut FILEOPENDIALOGOPTIONS, + ) -> HRESULT, + fn SetDefaultFolder( + psi: *mut IShellItem, + ) -> HRESULT, + fn SetFolder( + psi: *mut IShellItem, + ) -> HRESULT, + fn GetFolder( + ppsi: *mut *mut IShellItem, + ) -> HRESULT, + fn GetCurrentSelection( + ppsi: *mut *mut IShellItem, + ) -> HRESULT, + fn SetFileName( + pszName: LPCWSTR, + ) -> HRESULT, + fn GetFileName( + pszName: *mut LPWSTR, + ) -> HRESULT, + fn SetTitle( + pszTitle: LPCWSTR, + ) -> HRESULT, + fn SetOkButtonLabel( + pszText: LPCWSTR, + ) -> HRESULT, + fn SetFileNameLabel( + pszLabel: LPCWSTR, + ) -> HRESULT, + fn GetResult( + ppsi: *mut *mut IShellItem, + ) -> HRESULT, + fn AddPlace( + psi: *mut IShellItem, + fdap: FDAP, + ) -> HRESULT, + fn SetDefaultExtension( + pszDefaultExtension: LPCWSTR, + ) -> HRESULT, + fn Close( + hr: HRESULT, + ) -> HRESULT, + fn SetClientGuid( + guid: REFGUID, + ) -> HRESULT, + fn ClearClientData() -> HRESULT, + fn SetFilter( + pFilter: *mut IShellItemFilter, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x84bccd23, 0x5fde, 0x4cdb, 0xae, 0xa4, 0xaf, 0x64, 0xb8, 0x3d, 0x78, 0xab)] +interface IFileSaveDialog(IFileSaveDialogVtbl): IFileDialog(IFileDialogVtbl) { + fn SetSaveAsItem( + psi: *mut IShellItem, + ) -> HRESULT, + fn SetProperties( + pStore: *mut IPropertyStore, + ) -> HRESULT, + fn SetCollectedProperties( + pList: *mut IPropertyDescriptionList, + fAppendDefault: BOOL, + ) -> HRESULT, + fn GetProperties( + ppStore: *mut *mut IPropertyStore, + ) -> HRESULT, + fn ApplyProperties( + psi: *mut IShellItem, + pStore: *mut IPropertyStore, + hwnd: HWND, + pSink: *mut IFileOperationProgressSink, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd57c7288, 0xd4ad, 0x4768, 0xbe, 0x02, 0x9d, 0x96, 0x95, 0x32, 0xd9, 0x60)] +interface IFileOpenDialog(IFileOpenDialogVtbl): IFileDialog(IFileDialogVtbl) { + fn GetResults( + ppenum: *mut *mut IShellItemArray, + ) -> HRESULT, + fn GetSelectedItems( + ppsai: *mut *mut IShellItemArray, + ) -> HRESULT, +}} +ENUM!{enum CDCONTROLSTATEF { + CDCS_INACTIVE = 0, + CDCS_ENABLED = 0x1, + CDCS_VISIBLE = 0x2, + CDCS_ENABLEDVISIBLE = 0x3, +}} +RIDL!{#[uuid(0xe6fdd21a, 0x163f, 0x4975, 0x9c, 0x8c, 0xa6, 0x9f, 0x1b, 0xa3, 0x70, 0x34)] +interface IFileDialogCustomize(IFileDialogCustomizeVtbl): IUnknown(IUnknownVtbl) { + fn EnableOpenDropDown( + dwIDCtl: DWORD, + ) -> HRESULT, + fn AddMenu( + dwIDCtl: DWORD, + pszLabel: LPCWSTR, + ) -> HRESULT, + fn AddPushButton( + dwIDCtl: DWORD, + pszLabel: LPCWSTR, + ) -> HRESULT, + fn AddComboBox( + dwIDCtl: DWORD, + ) -> HRESULT, + fn AddRadioButtonList( + dwIDCtl: DWORD, + ) -> HRESULT, + fn AddCheckButton( + dwIDCtl: DWORD, + pszLabel: LPCWSTR, + bChecked: BOOL, + ) -> HRESULT, + fn AddEditBox( + dwIDCtl: DWORD, + pszText: LPCWSTR, + ) -> HRESULT, + fn AddSeparator( + dwIDCtl: DWORD, + ) -> HRESULT, + fn AddText( + dwIDCtl: DWORD, + pszText: LPCWSTR, + ) -> HRESULT, + fn SetControlLabel( + dwIDCtl: DWORD, + pszLabel: LPCWSTR, + ) -> HRESULT, + fn GetControlState( + dwIDCtl: DWORD, + pdwState: *mut CDCONTROLSTATEF, + ) -> HRESULT, + fn SetControlState( + dwIDCtl: DWORD, + dwState: CDCONTROLSTATEF, + ) -> HRESULT, + fn GetEditBoxText( + dwIDCtl: DWORD, + ppszText: *mut *mut WCHAR, + ) -> HRESULT, + fn SetEditBoxText( + dwIDCtl: DWORD, + pszText: LPCWSTR, + ) -> HRESULT, + fn GetCheckButtonState( + dwIDCtl: DWORD, + pbChecked: *mut BOOL, + ) -> HRESULT, + fn SetCheckButtonState( + dwIDCtl: DWORD, + bChecked: BOOL, + ) -> HRESULT, + fn AddControlItem( + dwIDCtl: DWORD, + dwIDItem: DWORD, + pszLabel: LPCWSTR, + ) -> HRESULT, + fn RemoveControlItem( + dwIDCtl: DWORD, + dwIDItem: DWORD, + ) -> HRESULT, + fn RemoveAllControlItems( + dwIDCtl: DWORD, + ) -> HRESULT, + fn GetControlItemState( + dwIDCtl: DWORD, + dwIDItem: DWORD, + pdwState: *mut CDCONTROLSTATEF, + ) -> HRESULT, + fn SetControlItemState( + dwIDCtl: DWORD, + dwIDItem: DWORD, + dwState: CDCONTROLSTATEF, + ) -> HRESULT, + fn GetSelectedControlItem( + dwIDCtl: DWORD, + pdwIDItem: *mut DWORD, + ) -> HRESULT, + fn SetSelectedControlItem( + dwIDCtl: DWORD, + dwIDItem: DWORD, + ) -> HRESULT, + fn StartVisualGroup( + dwIDCtl: DWORD, + pszLabel: LPCWSTR, + ) -> HRESULT, + fn EndVisualGroup() -> HRESULT, + fn MakeProminent( + dwIDCtl: DWORD, + ) -> HRESULT, + fn SetControlItemText( + dwIDCtl: DWORD, + dwIDItem: DWORD, + pszLabel: LPCWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x36116642, 0xd713, 0x4b97, 0x9b, 0x83, 0x74, 0x84, 0xa9, 0xd0, 0x04, 0x33)] +interface IFileDialogControlEvents(IFileDialogControlEventsVtbl): IUnknown(IUnknownVtbl) { + fn OnItemSelected( + pfdc: *mut IFileDialogCustomize, + dwIDCtl: DWORD, + dwIDItem: DWORD, + ) -> HRESULT, + fn OnButtonClicked( + pfdc: *mut IFileDialogCustomize, + dwIDCtl: DWORD, + ) -> HRESULT, + fn OnCheckButtonToggled( + pfdc: *mut IFileDialogCustomize, + dwIDCtl: DWORD, + bChecked: BOOL, + ) -> HRESULT, + fn OnControlActivating( + pfdc: *mut IFileDialogCustomize, + dwIDCtl: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x61744fc7, 0x85b5, 0x4791, 0xa9, 0xb0, 0x27, 0x22, 0x76, 0x30, 0x9b, 0x13)] +interface IFileDialog2(IFileDialog2Vtbl): IFileDialog(IFileDialogVtbl) { + fn SetCancelButtonLabel( + pszLabel: LPCWSTR, + ) -> HRESULT, + fn SetNavigationRoot( + psi: IShellItem, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/shobjidl_core.rs b/bash-5.1/vendor/winapi/src/um/shobjidl_core.rs new file mode 100644 index 0000000000000000000000000000000000000000..a4a4a33b9076591f6ecbe2e646712e737e39847c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/shobjidl_core.rs @@ -0,0 +1,576 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_int, c_void}; +use shared::guiddef::{REFGUID, REFIID}; +use shared::minwindef::{BOOL, DWORD, UINT, ULONG, WORD}; +use shared::windef::{COLORREF, HICON, HWND, RECT}; +use um::commctrl::HIMAGELIST; +use um::minwinbase::{WIN32_FIND_DATAA, WIN32_FIND_DATAW}; +use um::objidl::IBindCtx; +use um::propkeydef::REFPROPERTYKEY; +use um::propsys::GETPROPERTYSTOREFLAGS; +use um::shtypes::{PCIDLIST_ABSOLUTE, PIDLIST_ABSOLUTE}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PCWSTR, ULONGLONG, WCHAR}; +DEFINE_GUID!{CLSID_DesktopWallpaper, + 0xc2cf3110, 0x460e, 0x4fc1, 0xb9, 0xd0, 0x8a, 0x1c, 0x0c, 0x9c, 0xc4, 0xbd} +DEFINE_GUID!{CLSID_TaskbarList, + 0x56fdf344, 0xfd6d, 0x11d0, 0x95, 0x8a, 0x00, 0x60, 0x97, 0xc9, 0xa0, 0x90} +DEFINE_GUID!{CLSID_FileOpenDialog, + 0xdc1c5a9c, 0xe88a, 0x4dde, 0xa5, 0xa1, 0x60, 0xf8, 0x2a, 0x20, 0xae, 0xf7} +DEFINE_GUID!{CLSID_FileSaveDialog, + 0xc0b4e2f3, 0xba21, 0x4773, 0x8d, 0xba, 0x33, 0x5e, 0xc9, 0x46, 0xeb, 0x8b} +//4498 +ENUM!{enum SHCONTF { + SHCONTF_CHECKING_FOR_CHILDREN = 0x10, + SHCONTF_FOLDERS = 0x20, + SHCONTF_NONFOLDERS = 0x40, + SHCONTF_INCLUDEHIDDEN = 0x80, + SHCONTF_INIT_ON_FIRST_NEXT = 0x100, + SHCONTF_NETPRINTERSRCH = 0x200, + SHCONTF_SHAREABLE = 0x400, + SHCONTF_STORAGE = 0x800, + SHCONTF_NAVIGATION_ENUM = 0x1000, + SHCONTF_FASTITEMS = 0x2000, + SHCONTF_FLATLIST = 0x4000, + SHCONTF_ENABLE_ASYNC = 0x8000, + SHCONTF_INCLUDESUPERHIDDEN = 0x10000, +}} +pub type SFGAOF = ULONG; +//9466 +ENUM!{enum SIGDN { + SIGDN_NORMALDISPLAY = 0, + SIGDN_PARENTRELATIVEPARSING = 0x80018001, + SIGDN_DESKTOPABSOLUTEPARSING = 0x80028000, + SIGDN_PARENTRELATIVEEDITING = 0x80031001, + SIGDN_DESKTOPABSOLUTEEDITING = 0x8004c000, + SIGDN_FILESYSPATH = 0x80058000, + SIGDN_URL = 0x80068000, + SIGDN_PARENTRELATIVEFORADDRESSBAR = 0x8007c001, + SIGDN_PARENTRELATIVE = 0x80080001, + SIGDN_PARENTRELATIVEFORUI = 0x80094001, +}} +ENUM!{enum SICHINTF { + SICHINT_DISPLAY = 0, + SICHINT_ALLFIELDS = 0x80000000, + SICHINT_CANONICAL = 0x10000000, + SICHINT_TEST_FILESYSPATH_IF_NOT_EQUAL = 0x20000000, +}} +RIDL!{#[uuid(0x43826d1e, 0xe718, 0x42ee, 0xbc, 0x55, 0xa1, 0xe2, 0x61, 0xc3, 0x7b, 0xfe)] +interface IShellItem(IShellItemVtbl): IUnknown(IUnknownVtbl) { + fn BindToHandler( + pbc: *mut IBindCtx, + bhid: REFGUID, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, + fn GetParent( + ppsi: *mut *mut IShellItem, + ) -> HRESULT, + fn GetDisplayName( + sigdnName: SIGDN, + ppszName: *mut LPWSTR, + ) -> HRESULT, + fn GetAttributes( + sfgaoMask: SFGAOF, + psfgaoAttribs: *mut SFGAOF, + ) -> HRESULT, + fn Compare( + psi: *mut IShellItem, + hint: SICHINTF, + piOrder: *mut c_int, + ) -> HRESULT, +}} +ENUM!{enum SIATTRIBFLAGS { + SIATTRIBFLAGS_AND = 0x1, + SIATTRIBFLAGS_OR = 0x2, + SIATTRIBFLAGS_APPCOMPAT = 0x3, + SIATTRIBFLAGS_MASK = 0x3, + SIATTRIBFLAGS_ALLITEMS = 0x4000, +}} +RIDL!{#[uuid(0xb63ea76d, 0x1f85, 0x456f, 0xa1, 0x9c, 0x48, 0x15, 0x9e, 0xfa, 0x85, 0x8b)] +interface IShellItemArray(IShellItemArrayVtbl): IUnknown(IUnknownVtbl) { + fn BindToHandler( + pbc: *mut IBindCtx, + bhid: REFGUID, + riid: REFIID, + ppvOut: *mut *mut c_void, + ) -> HRESULT, + fn GetPropertyStore( + flags: GETPROPERTYSTOREFLAGS, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, + fn GetPropertyDescriptionList( + keyType: REFPROPERTYKEY, + riid: REFIID, + ppv: *mut *mut c_void, + ) -> HRESULT, + fn GetAttributes( + AttribFlags: SIATTRIBFLAGS, + sfgaoMask: SFGAOF, + psfgaoAttribs: *mut SFGAOF, + ) -> HRESULT, + fn GetCount( + pdwNumItems: *mut DWORD, + ) -> HRESULT, + fn GetItemAt( + dwIndex: DWORD, + ppsi: *mut *mut IShellItem, + ) -> HRESULT, + // TODO: Add IEnumShellItems + //fn EnumItems( + // ppenumShellItems: *mut *mut IEnumShellItems, + //) -> HRESULT, +}} +//20869 +RIDL!{#[uuid(0xb4db1657, 0x70d7, 0x485e, 0x8e, 0x3e, 0x6f, 0xcb, 0x5a, 0x5c, 0x18, 0x02)] +interface IModalWindow(IModalWindowVtbl): IUnknown(IUnknownVtbl) { + fn Show( + hwndOwner: HWND, + ) -> HRESULT, +}} +//22307 +//27457 +RIDL!{#[uuid(0x2659b475, 0xeeb8, 0x48b7, 0x8f, 0x07, 0xb3, 0x78, 0x81, 0x0f, 0x48, 0xcf)] +interface IShellItemFilter(IShellItemFilterVtbl): IUnknown(IUnknownVtbl) { + fn IncludeItem( + psi: *mut IShellItem, + ) -> HRESULT, + fn GetEnumFlagsForItem( + psi: *mut IShellItem, + pgrfFlags: *mut SHCONTF, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x56fdf342, 0xfd6d, 0x11d0, 0x95, 0x8a, 0x00, 0x60, 0x97, 0xc9, 0xa0, 0x90)] +interface ITaskbarList(ITaskbarListVtbl): IUnknown(IUnknownVtbl) { + fn HrInit() -> HRESULT, + fn AddTab( + hwnd: HWND, + ) -> HRESULT, + fn DeleteTab( + hwnd: HWND, + ) -> HRESULT, + fn ActivateTab( + hwnd: HWND, + ) -> HRESULT, + fn SetActiveAlt( + hwnd: HWND, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x602d4995, 0xb13a, 0x429b, 0xa6, 0x6e, 0x19, 0x35, 0xe4, 0x4f, 0x43, 0x17)] +interface ITaskbarList2(ITaskbarList2Vtbl): ITaskbarList(ITaskbarListVtbl) { + fn MarkFullscreenWindow( + hwnd: HWND, + fFullscreen: BOOL, + ) -> HRESULT, +}} +ENUM!{enum THUMBBUTTONFLAGS { + THBF_ENABLED = 0, + THBF_DISABLED = 0x1, + THBF_DISMISSONCLICK = 0x2, + THBF_NOBACKGROUND = 0x4, + THBF_HIDDEN = 0x8, + THBF_NONINTERACTIVE = 0x10, +}} +ENUM!{enum THUMBBUTTONMASK { + THB_BITMAP = 0x1, + THB_ICON = 0x2, + THB_TOOLTIP = 0x4, + THB_FLAGS = 0x8, +}} +STRUCT!{struct THUMBBUTTON { + dwMask: THUMBBUTTONMASK, + iId: UINT, + iBitmap: UINT, + hIcon: HICON, + szTip: [WCHAR; 260], + dwFlags: THUMBBUTTONFLAGS, +}} +pub type LPTHUMBBUTTON = *mut THUMBBUTTON; +pub const THBN_CLICKED: WORD = 0x1800; +ENUM!{enum TBPFLAG { + TBPF_NOPROGRESS = 0, + TBPF_INDETERMINATE = 0x1, + TBPF_NORMAL = 0x2, + TBPF_ERROR = 0x4, + TBPF_PAUSED = 0x8, +}} +RIDL!{#[uuid(0xea1afb91, 0x9e28, 0x4b86, 0x90, 0xe9, 0x9e, 0x9f, 0x8a, 0x5e, 0xef, 0xaf)] +interface ITaskbarList3(ITaskbarList3Vtbl): ITaskbarList2(ITaskbarList2Vtbl) { + fn SetProgressValue( + hwnd: HWND, + ullCompleted: ULONGLONG, + ullTotal: ULONGLONG, + ) -> HRESULT, + fn SetProgressState( + hwnd: HWND, + tbpFlags: TBPFLAG, + ) -> HRESULT, + fn RegisterTab( + hwndTab: HWND, + hwndMDI: HWND, + ) -> HRESULT, + fn UnregisterTab( + hwndTab: HWND, + ) -> HRESULT, + fn SetTabOrder( + hwndTab: HWND, + hwndInsertBefore: HWND, + ) -> HRESULT, + fn SetTabActive( + hwndTab: HWND, + hwndMDI: HWND, + dwReserved: DWORD, + ) -> HRESULT, + fn ThumbBarAddButtons( + hwnd: HWND, + cButtons: UINT, + pButton: LPTHUMBBUTTON, + ) -> HRESULT, + fn ThumbBarUpdateButtons( + hwnd: HWND, + cButtons: UINT, + pButton: LPTHUMBBUTTON, + ) -> HRESULT, + fn ThumbBarSetImageList( + hwnd: HWND, + himl: HIMAGELIST, + ) -> HRESULT, + fn SetOverlayIcon( + hwnd: HWND, + hIcon: HICON, + pszDescription: LPCWSTR, + ) -> HRESULT, + fn SetThumbnailTooltip( + hwnd: HWND, + pszTip: LPCWSTR, + ) -> HRESULT, + fn SetThumbnailClip( + hwnd: HWND, + prcClip: *mut RECT, + ) -> HRESULT, +}} +ENUM!{enum STPFLAG { + STPF_NONE = 0, + STPF_USEAPPTHUMBNAILALWAYS = 0x1, + STPF_USEAPPTHUMBNAILWHENACTIVE = 0x2, + STPF_USEAPPPEEKALWAYS = 0x4, + STPF_USEAPPPEEKWHENACTIVE = 0x8, +}} +RIDL!{#[uuid(0xc43dc798, 0x95d1, 0x4bea, 0x90, 0x30, 0xbb, 0x99, 0xe2, 0x98, 0x3a, 0x1a)] +interface ITaskbarList4(ITaskbarList4Vtbl): ITaskbarList3(ITaskbarList3Vtbl) { + fn SetTabProperties( + hwndTab: HWND, + stpFlags: STPFLAG, + ) -> HRESULT, +}} +ENUM!{enum DESKTOP_SLIDESHOW_OPTIONS { + DSO_SHUFFLEIMAGES = 0x1, +}} +ENUM!{enum DESKTOP_SLIDESHOW_STATE { + DSS_ENABLED = 0x1, + DSS_SLIDESHOW = 0x2, + DSS_DISABLED_BY_REMOTE_SESSION = 0x4, +}} +ENUM!{enum DESKTOP_SLIDESHOW_DIRECTION { + DSD_FORWARD = 0, + DSD_BACKWARD = 1, +}} +ENUM!{enum DESKTOP_WALLPAPER_POSITION { + DWPOS_CENTER = 0, + DWPOS_TILE = 1, + DWPOS_STRETCH = 2, + DWPOS_FIT = 3, + DWPOS_FILL = 4, + DWPOS_SPAN = 5, +}} +RIDL!{#[uuid(0xb92b56a9, 0x8b55, 0x4e14, 0x9a, 0x89, 0x01, 0x99, 0xbb, 0xb6, 0xf9, 0x3b)] +interface IDesktopWallpaper(IDesktopWallpaperVtbl): IUnknown(IUnknownVtbl) { + fn SetWallpaper( + monitorID: LPCWSTR, + wallpaper: LPCWSTR, + ) -> HRESULT, + fn GetWallpaper( + monitorID: LPCWSTR, + wallpaper: *mut LPWSTR, + ) -> HRESULT, + fn GetMonitorDevicePathAt( + monitorIndex: UINT, + monitorID: *mut LPWSTR, + ) -> HRESULT, + fn GetMonitorDevicePathCount( + count: *mut UINT, + ) -> HRESULT, + fn GetMonitorRECT( + monitorID: LPCWSTR, + displayRect: *mut RECT, + ) -> HRESULT, + fn SetBackgroundColor( + color: COLORREF, + ) -> HRESULT, + fn GetBackgroundColor( + color: *mut COLORREF, + ) -> HRESULT, + fn SetPosition( + position: DESKTOP_WALLPAPER_POSITION, + ) -> HRESULT, + fn GetPosition( + position: *mut DESKTOP_WALLPAPER_POSITION, + ) -> HRESULT, + fn SetSlideshow( + items: *mut IShellItemArray, + ) -> HRESULT, + fn GetSlideshow( + items: *mut *mut IShellItemArray, + ) -> HRESULT, + fn SetSlideshowOptions( + options: DESKTOP_SLIDESHOW_OPTIONS, + slideshowTick: UINT, + ) -> HRESULT, + fn GetSlideshowOptions( + options: *mut DESKTOP_SLIDESHOW_OPTIONS, + slideshowTick: *mut UINT, + ) -> HRESULT, + fn AdvanceSlideshow( + monitorID: LPCWSTR, + direction: DESKTOP_SLIDESHOW_DIRECTION, + ) -> HRESULT, + fn GetStatus( + state: *mut DESKTOP_SLIDESHOW_STATE, + ) -> HRESULT, + fn Enable( + enable: BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x000214ee, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IShellLinkA(IShellLinkAVtbl): IUnknown(IUnknownVtbl) { + fn GetPath( + pszFile: LPSTR, + cch: c_int, + pfd: *mut WIN32_FIND_DATAA, + fFlags: DWORD, + ) -> HRESULT, + fn GetIDList( + ppidl: *mut PIDLIST_ABSOLUTE, + ) -> HRESULT, + fn SetIDList( + pidl: PCIDLIST_ABSOLUTE, + ) -> HRESULT, + fn GetDescription( + pszName: LPSTR, + cch: c_int, + ) -> HRESULT, + fn SetDescription( + pszName: LPCSTR, + ) -> HRESULT, + fn GetWorkingDirectory( + pszDir: LPSTR, + cch: c_int, + ) -> HRESULT, + fn SetWorkingDirectory( + pszDir: LPCSTR, + ) -> HRESULT, + fn GetArguments( + pszArgs: LPSTR, + cch: c_int, + ) -> HRESULT, + fn SetArguments( + pszArgs: LPCSTR, + ) -> HRESULT, + fn GetHotkey( + pwHotkey: *mut WORD, + ) -> HRESULT, + fn SetHotkey( + wHotkey: WORD, + ) -> HRESULT, + fn GetShowCmd( + piShowCmd: *mut c_int, + ) -> HRESULT, + fn SetShowCmd( + iShowCmd: c_int, + ) -> HRESULT, + fn GetIconLocation( + pszIconPath: LPSTR, + cch: c_int, + piIcon: *mut c_int, + ) -> HRESULT, + fn SetIconLocation( + pszIconPath: LPCSTR, + iIcon: c_int, + ) -> HRESULT, + fn SetRelativePath( + pszPathRel: LPCSTR, + dwReserved: DWORD, + ) -> HRESULT, + fn Resolve( + hwnd: HWND, + fFlags: DWORD, + ) -> HRESULT, + fn SetPath( + pszFile: LPCSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x000214f9, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IShellLinkW(IShellLinkWVtbl): IUnknown(IUnknownVtbl) { + fn GetPath( + pszFile: LPWSTR, + cch: c_int, + pfd: *mut WIN32_FIND_DATAW, + fFlags: DWORD, + ) -> HRESULT, + fn GetIDList( + ppidl: *mut PIDLIST_ABSOLUTE, + ) -> HRESULT, + fn SetIDList( + pidl: PCIDLIST_ABSOLUTE, + ) -> HRESULT, + fn GetDescription( + pszName: LPWSTR, + cch: c_int, + ) -> HRESULT, + fn SetDescription( + pszName: LPCWSTR, + ) -> HRESULT, + fn GetWorkingDirectory( + pszDir: LPWSTR, + cch: c_int, + ) -> HRESULT, + fn SetWorkingDirectory( + pszDir: LPCWSTR, + ) -> HRESULT, + fn GetArguments( + pszArgs: LPWSTR, + cch: c_int, + ) -> HRESULT, + fn SetArguments( + pszArgs: LPCWSTR, + ) -> HRESULT, + fn GetHotkey( + pwHotkey: *mut WORD, + ) -> HRESULT, + fn SetHotkey( + wHotkey: WORD, + ) -> HRESULT, + fn GetShowCmd( + piShowCmd: *mut c_int, + ) -> HRESULT, + fn SetShowCmd( + iShowCmd: c_int, + ) -> HRESULT, + fn GetIconLocation( + pszIconPath: LPWSTR, + cch: c_int, + piIcon: *mut c_int, + ) -> HRESULT, + fn SetIconLocation( + pszIconPath: LPCWSTR, + iIcon: c_int, + ) -> HRESULT, + fn SetRelativePath( + pszPathRel: LPCWSTR, + dwReserved: DWORD, + ) -> HRESULT, + fn Resolve( + hwnd: HWND, + fFlags: DWORD, + ) -> HRESULT, + fn SetPath( + pszFile: LPCWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc2cf3110, 0x460e, 0x4fc1, 0xb9, 0xd0, 0x8a, 0x1c, 0x0c, 0x9c, 0xc4, 0xbd)] +class DesktopWallpaper;} +RIDL!{#[uuid(0x00021400, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +class ShellDesktop;} +RIDL!{#[uuid(0xf3364ba0, 0x65b9, 0x11ce, 0xa9, 0xba, 0x00, 0xaa, 0x00, 0x4a, 0xe8, 0x37)] +class ShellFSFolder;} +RIDL!{#[uuid(0x208d2c60, 0x3aea, 0x1069, 0xa2, 0xd7, 0x08, 0x00, 0x2b, 0x30, 0x30, 0x9d)] +class NetworkPlaces;} +RIDL!{#[uuid(0x00021401, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +class ShellLink;} +RIDL!{#[uuid(0x94357b53, 0xca29, 0x4b78, 0x83, 0xae, 0xe8, 0xfe, 0x74, 0x09, 0x13, 0x4f)] +class DriveSizeCategorizer;} +RIDL!{#[uuid(0xb0a8f3cf, 0x4333, 0x4bab, 0x88, 0x73, 0x1c, 0xcb, 0x1c, 0xad, 0xa4, 0x8b)] +class DriveTypeCategorizer;} +RIDL!{#[uuid(0xb5607793, 0x24ac, 0x44c7, 0x82, 0xe2, 0x83, 0x17, 0x26, 0xaa, 0x6c, 0xb7)] +class FreeSpaceCategorizer;} +RIDL!{#[uuid(0x55d7b852, 0xf6d1, 0x42f2, 0xaa, 0x75, 0x87, 0x28, 0xa1, 0xb2, 0xd2, 0x64)] +class SizeCategorizer;} +RIDL!{#[uuid(0xd912f8cf, 0x0396, 0x4915, 0x88, 0x4e, 0xfb, 0x42, 0x5d, 0x32, 0x94, 0x3b)] +class PropertiesUI;} +RIDL!{#[uuid(0x0010890e, 0x8789, 0x413c, 0xad, 0xbc, 0x48, 0xf5, 0xb5, 0x11, 0xb3, 0xaf)] +class UserNotification;} +RIDL!{#[uuid(0x56fdf344, 0xfd6d, 0x11d0, 0x95, 0x8a, 0x00, 0x60, 0x97, 0xc9, 0xa0, 0x90)] +class TaskbarList;} +RIDL!{#[uuid(0x9ac9fbe1, 0xe0a2, 0x4ad6, 0xb4, 0xee, 0xe2, 0x12, 0x01, 0x3e, 0xa9, 0x17)] +class ShellItem;} +RIDL!{#[uuid(0x72eb61e0, 0x8672, 0x4303, 0x91, 0x75, 0xf2, 0xe4, 0xc6, 0x8b, 0x2e, 0x7c)] +class NamespaceWalker;} +RIDL!{#[uuid(0x3ad05575, 0x8857, 0x4850, 0x92, 0x77, 0x11, 0xb8, 0x5b, 0xdb, 0x8e, 0x09)] +class FileOperation;} +RIDL!{#[uuid(0xdc1c5a9c, 0xe88a, 0x4dde, 0xa5, 0xa1, 0x60, 0xf8, 0x2a, 0x20, 0xae, 0xf7)] +class FileOpenDialog;} +RIDL!{#[uuid(0xc0b4e2f3, 0xba21, 0x4773, 0x8d, 0xba, 0x33, 0x5e, 0xc9, 0x46, 0xeb, 0x8b)] +class FileSaveDialog;} +RIDL!{#[uuid(0x4df0c730, 0xdf9d, 0x4ae3, 0x91, 0x53, 0xaa, 0x6b, 0x82, 0xe9, 0x79, 0x5a)] +class KnownFolderManager;} +RIDL!{#[uuid(0x49f371e1, 0x8c5c, 0x4d9c, 0x9a, 0x3b, 0x54, 0xa6, 0x82, 0x7f, 0x51, 0x3c)] +class SharingConfigurationManager;} +RIDL!{#[uuid(0x7007acc7, 0x3202, 0x11d1, 0xaa, 0xd2, 0x00, 0x80, 0x5f, 0xc1, 0x27, 0x0e)] +class NetworkConnections;} +RIDL!{#[uuid(0xd6277990, 0x4c6a, 0x11cf, 0x8d, 0x87, 0x00, 0xaa, 0x00, 0x60, 0xf5, 0xbf)] +class ScheduledTasks;} +RIDL!{#[uuid(0x591209c7, 0x767b, 0x42b2, 0x9f, 0xba, 0x44, 0xee, 0x46, 0x15, 0xf2, 0xc7)] +class ApplicationAssociationRegistration;} +RIDL!{#[uuid(0x14010e02, 0xbbbd, 0x41f0, 0x88, 0xe3, 0xed, 0xa3, 0x71, 0x21, 0x65, 0x84)] +class SearchFolderItemFactory;} +RIDL!{#[uuid(0x06622d85, 0x6856, 0x4460, 0x8d, 0xe1, 0xa8, 0x19, 0x21, 0xb4, 0x1c, 0x4b)] +class OpenControlPanel;} +RIDL!{#[uuid(0x9e56be60, 0xc50f, 0x11cf, 0x9a, 0x2c, 0x00, 0xa0, 0xc9, 0x0a, 0x90, 0xce)] +class MailRecipient;} +RIDL!{#[uuid(0xf02c1a0d, 0xbe21, 0x4350, 0x88, 0xb0, 0x73, 0x67, 0xfc, 0x96, 0xef, 0x3c)] +class NetworkExplorerFolder;} +RIDL!{#[uuid(0x77f10cf0, 0x3db5, 0x4966, 0xb5, 0x20, 0xb7, 0xc5, 0x4f, 0xd3, 0x5e, 0xd6)] +class DestinationList;} +RIDL!{#[uuid(0x86c14003, 0x4d6b, 0x4ef3, 0xa7, 0xb4, 0x05, 0x06, 0x66, 0x3b, 0x2e, 0x68)] +class ApplicationDestinations;} +RIDL!{#[uuid(0x86bec222, 0x30f2, 0x47e0, 0x9f, 0x25, 0x60, 0xd1, 0x1c, 0xd7, 0x5c, 0x28)] +class ApplicationDocumentLists;} +RIDL!{#[uuid(0xde77ba04, 0x3c92, 0x4d11, 0xa1, 0xa5, 0x42, 0x35, 0x2a, 0x53, 0xe0, 0xe3)] +class HomeGroup;} +RIDL!{#[uuid(0xd9b3211d, 0xe57f, 0x4426, 0xaa, 0xef, 0x30, 0xa8, 0x06, 0xad, 0xd3, 0x97)] +class ShellLibrary;} +RIDL!{#[uuid(0x273eb5e7, 0x88b0, 0x4843, 0xbf, 0xef, 0xe2, 0xc8, 0x1d, 0x43, 0xaa, 0xe5)] +class AppStartupLink;} +RIDL!{#[uuid(0x2d3468c1, 0x36a7, 0x43b6, 0xac, 0x24, 0xd3, 0xf0, 0x2f, 0xd9, 0x60, 0x7a)] +class EnumerableObjectCollection;} +RIDL!{#[uuid(0xd5120aa3, 0x46ba, 0x44c5, 0x82, 0x2d, 0xca, 0x80, 0x92, 0xc1, 0xfc, 0x72)] +class FrameworkInputPane;} +RIDL!{#[uuid(0xc63382be, 0x7933, 0x48d0, 0x9a, 0xc8, 0x85, 0xfb, 0x46, 0xbe, 0x2f, 0xdd)] +class DefFolderMenu;} +RIDL!{#[uuid(0x7e5fe3d9, 0x985f, 0x4908, 0x91, 0xf9, 0xee, 0x19, 0xf9, 0xfd, 0x15, 0x14)] +class AppVisibility;} +RIDL!{#[uuid(0x4ed3a719, 0xcea8, 0x4bd9, 0x91, 0x0d, 0xe2, 0x52, 0xf9, 0x97, 0xaf, 0xc2)] +class AppShellVerbHandler;} +RIDL!{#[uuid(0xe44e9428, 0xbdbc, 0x4987, 0xa0, 0x99, 0x40, 0xdc, 0x8f, 0xd2, 0x55, 0xe7)] +class ExecuteUnknown;} +RIDL!{#[uuid(0xb1aec16f, 0x2383, 0x4852, 0xb0, 0xe9, 0x8f, 0x0b, 0x1d, 0xc6, 0x6b, 0x4d)] +class PackageDebugSettings;} +RIDL!{#[uuid(0x6b273fc5, 0x61fd, 0x4918, 0x95, 0xa2, 0xc3, 0xb5, 0xe9, 0xd7, 0xf5, 0x81)] +class SuspensionDependencyManager;} +RIDL!{#[uuid(0x45ba127d, 0x10a8, 0x46ea, 0x8a, 0xb7, 0x56, 0xea, 0x90, 0x78, 0x94, 0x3c)] +class ApplicationActivationManager;} +RIDL!{#[uuid(0x958a6fb5, 0xdcb2, 0x4faf, 0xaa, 0xfd, 0x7f, 0xb0, 0x54, 0xad, 0x1a, 0x3b)] +class ApplicationDesignModeSettings;} +extern "system" { + pub fn SHCreateItemFromParsingName( + pszPath: PCWSTR, + pbc: *mut IBindCtx, + riid: REFIID, + ppv: *mut *mut c_void + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/shtypes.rs b/bash-5.1/vendor/winapi/src/um/shtypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..470d79e2117a0f455b02b47a8e464c198e506779 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/shtypes.rs @@ -0,0 +1,44 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! this ALWAYS GENERATED file contains the definitions for the interfaces +use shared::guiddef::GUID; +use shared::minwindef::{BYTE, USHORT}; +use um::winnt::LPCWSTR; +STRUCT!{#[repr(packed)] struct SHITEMID { + cb: USHORT, + abID: [BYTE; 1], +}} +pub type LPSHITEMID = *mut SHITEMID; +pub type LPCSHITEMID = *const SHITEMID; +STRUCT!{#[repr(packed)] struct ITEMIDLIST { + mkid: SHITEMID, +}} +pub type ITEMIDLIST_RELATIVE = ITEMIDLIST; +pub type ITEMID_CHILD = ITEMIDLIST; +pub type ITEMIDLIST_ABSOLUTE = ITEMIDLIST; +pub type LPITEMIDLIST = *mut ITEMIDLIST; +pub type LPCITEMIDLIST = *const ITEMIDLIST; +pub type PIDLIST_ABSOLUTE = *mut ITEMIDLIST_ABSOLUTE; +pub type PCIDLIST_ABSOLUTE = *const ITEMIDLIST_ABSOLUTE; +pub type PCUIDLIST_ABSOLUTE = *const ITEMIDLIST_ABSOLUTE; +pub type PIDLIST_RELATIVE = *mut ITEMIDLIST_RELATIVE; +pub type PCIDLIST_RELATIVE = *const ITEMIDLIST_RELATIVE; +pub type PUIDLIST_RELATIVE = *mut ITEMIDLIST_RELATIVE; +pub type PCUIDLIST_RELATIVE = *const ITEMIDLIST_RELATIVE; +pub type PITEMID_CHILD = *mut ITEMID_CHILD; +pub type PCITEMID_CHILD = *const ITEMID_CHILD; +pub type PUITEMID_CHILD = *mut ITEMID_CHILD; +pub type PCUITEMID_CHILD = *const ITEMID_CHILD; +pub type PCUITEMID_CHILD_ARRAY = *const PCUITEMID_CHILD; +pub type PCUIDLIST_RELATIVE_ARRAY = *const PCUIDLIST_RELATIVE; +pub type PCIDLIST_ABSOLUTE_ARRAY = *const PCIDLIST_ABSOLUTE; +pub type PCUIDLIST_ABSOLUTE_ARRAY = *const PCUIDLIST_ABSOLUTE; +STRUCT!{struct COMDLG_FILTERSPEC { + pszName: LPCWSTR, + pszSpec: LPCWSTR, +}} +pub type KNOWNFOLDERID = GUID; +pub type REFKNOWNFOLDERID = *const KNOWNFOLDERID; diff --git a/bash-5.1/vendor/winapi/src/um/softpub.rs b/bash-5.1/vendor/winapi/src/um/softpub.rs new file mode 100644 index 0000000000000000000000000000000000000000..d3a1eaad675a0f3121ff39971194c840f7afb8cf --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/softpub.rs @@ -0,0 +1,3 @@ +//50 +DEFINE_GUID!{WINTRUST_ACTION_GENERIC_VERIFY_V2, + 0xaac56b, 0xcd44, 0x11d0, 0x8c, 0xc2, 0x0, 0xc0, 0x4f, 0xc2, 0x95, 0xee} diff --git a/bash-5.1/vendor/winapi/src/um/spapidef.rs b/bash-5.1/vendor/winapi/src/um/spapidef.rs new file mode 100644 index 0000000000000000000000000000000000000000..259f4699f49b0ead04e6cd4e2b4e04da1bcda4db --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/spapidef.rs @@ -0,0 +1,53 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Public header file for Windows NT Setup and Device Installer services Dlls +use shared::minwindef::DWORD; +use um::winnt::DWORDLONG; +pub type SP_LOG_TOKEN = DWORDLONG; +pub type PSP_LOG_TOKEN = *mut DWORDLONG; +pub const LOGTOKEN_TYPE_MASK: SP_LOG_TOKEN = 3; +pub const LOGTOKEN_UNSPECIFIED: SP_LOG_TOKEN = 0; +pub const LOGTOKEN_NO_LOG: SP_LOG_TOKEN = 1; +pub const LOGTOKEN_SETUPAPI_APPLOG: SP_LOG_TOKEN = 2; +pub const LOGTOKEN_SETUPAPI_DEVLOG: SP_LOG_TOKEN = 3; +pub const TXTLOG_SETUPAPI_DEVLOG: DWORD = 0x00000001; +pub const TXTLOG_SETUPAPI_CMDLINE: DWORD = 0x00000002; +pub const TXTLOG_SETUPAPI_BITS: DWORD = 0x00000003; +pub const TXTLOG_ERROR: DWORD = 0x1; +pub const TXTLOG_WARNING: DWORD = 0x2; +pub const TXTLOG_SYSTEM_STATE_CHANGE: DWORD = 0x3; +pub const TXTLOG_SUMMARY: DWORD = 0x4; +pub const TXTLOG_DETAILS: DWORD = 0x5; +pub const TXTLOG_VERBOSE: DWORD = 0x6; +pub const TXTLOG_VERY_VERBOSE: DWORD = 0x7; +pub const TXTLOG_RESERVED_FLAGS: DWORD = 0x0000FFF0; +pub const TXTLOG_TIMESTAMP: DWORD = 0x00010000; +pub const TXTLOG_DEPTH_INCR: DWORD = 0x00020000; +pub const TXTLOG_DEPTH_DECR: DWORD = 0x00040000; +pub const TXTLOG_TAB_1: DWORD = 0x00080000; +pub const TXTLOG_FLUSH_FILE: DWORD = 0x00100000; +#[inline] +pub fn TXTLOG_LEVEL(flags: DWORD) -> DWORD { + flags & 0xf +} +pub const TXTLOG_DEVINST: DWORD = 0x00000001; +pub const TXTLOG_INF: DWORD = 0x00000002; +pub const TXTLOG_FILEQ: DWORD = 0x00000004; +pub const TXTLOG_COPYFILES: DWORD = 0x00000008; +pub const TXTLOG_SIGVERIF: DWORD = 0x00000020; +pub const TXTLOG_BACKUP: DWORD = 0x00000080; +pub const TXTLOG_UI: DWORD = 0x00000100; +pub const TXTLOG_UTIL: DWORD = 0x00000200; +pub const TXTLOG_INFDB: DWORD = 0x00000400; +pub const TXTLOG_POLICY: DWORD = 0x00800000; +pub const TXTLOG_NEWDEV: DWORD = 0x01000000; +pub const TXTLOG_UMPNPMGR: DWORD = 0x02000000; +pub const TXTLOG_DRIVER_STORE: DWORD = 0x04000000; +pub const TXTLOG_SETUP: DWORD = 0x08000000; +pub const TXTLOG_CMI: DWORD = 0x10000000; +pub const TXTLOG_DEVMGR: DWORD = 0x20000000; +pub const TXTLOG_INSTALLER: DWORD = 0x40000000; +pub const TXTLOG_VENDOR: DWORD = 0x80000000; diff --git a/bash-5.1/vendor/winapi/src/um/spellcheck.rs b/bash-5.1/vendor/winapi/src/um/spellcheck.rs new file mode 100644 index 0000000000000000000000000000000000000000..9254ed52d90f26bb140053d93d01fe3baee69948 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/spellcheck.rs @@ -0,0 +1,146 @@ +use shared::minwindef::{BOOL, BYTE, DWORD}; +use shared::ntdef::{LPCWSTR, LPWSTR, ULONG}; +use shared::winerror::HRESULT; +use um::objidlbase::IEnumString; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +ENUM!{enum WORDLIST_TYPE { + WORDLIST_TYPE_IGNORE = 0, + WORDLIST_TYPE_ADD = 1, + WORDLIST_TYPE_EXCLUDE = 2, + WORDLIST_TYPE_AUTOCORRECT = 3, +}} +ENUM!{enum CORRECTIVE_ACTION { + CORRECTIVE_ACTION_NONE = 0, + CORRECTIVE_ACTION_GET_SUGGESTIONS = 1, + CORRECTIVE_ACTION_REPLACE = 2, + CORRECTIVE_ACTION_DELETE = 3, +}} +RIDL!{#[uuid(0xb7c82d61, 0xfbe8, 0x4b47, 0x9b, 0x27, 0x6c, 0x0d, 0x2e, 0x0d, 0xe0, 0xa3)] +interface ISpellingError(ISpellingErrorVtbl): IUnknown(IUnknownVtbl) { + fn get_StartIndex( + value: *mut ULONG, + ) -> HRESULT, + fn get_Length( + value: *mut ULONG, + ) -> HRESULT, + fn get_CorrectiveAction( + value: *mut CORRECTIVE_ACTION, + ) -> HRESULT, + fn get_Replacement( + value: *mut LPWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x803e3bd4, 0x2828, 0x4410, 0x82, 0x90, 0x41, 0x8d, 0x1d, 0x73, 0xc7, 0x62)] +interface IEnumSpellingError(IEnumSpellingErrorVtbl): IUnknown(IUnknownVtbl) { + fn Next( + value: *mut *mut ISpellingError, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x432e5f85, 0x35cf, 0x4606, 0xa8, 0x01, 0x6f, 0x70, 0x27, 0x7e, 0x1d, 0x7a)] +interface IOptionDescription(IOptionDescriptionVtbl): IUnknown(IUnknownVtbl) { + fn Id( + value: *mut LPWSTR, + ) -> HRESULT, + fn Heading( + value: *mut LPWSTR, + ) -> HRESULT, + fn Description( + value: *mut LPWSTR, + ) -> HRESULT, + fn Labels( + value: *mut *mut IEnumString, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0b83a5b0, 0x792f, 0x4eab, 0x97, 0x99, 0xac, 0xf5, 0x2c, 0x5e, 0xd0, 0x8a)] +interface ISpellCheckerChangedEventHandler(ISpellCheckerChangedEventHandlerVtbl): + IUnknown(IUnknownVtbl) { + fn Invoke( + sender: *const ISpellChecker, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb6fd0b71, 0xe2bc, 0x4653, 0x8d, 0x05, 0xf1, 0x97, 0xe4, 0x12, 0x77, 0x0b)] +interface ISpellChecker(ISpellCheckerVtbl): IUnknown(IUnknownVtbl) { + fn get_LanguageTag( + value: *mut LPWSTR, + ) -> HRESULT, + fn Check( + text: LPCWSTR, + value: *mut *mut IEnumSpellingError, + ) -> HRESULT, + fn Suggest( + word: LPCWSTR, + value: *mut *mut IEnumString, + ) -> HRESULT, + fn Add( + word: LPCWSTR, + ) -> HRESULT, + fn Ignore( + word: LPCWSTR, + ) -> HRESULT, + fn AutoCorrect( + from: LPCWSTR, + to: LPCWSTR, + ) -> HRESULT, + fn GetOptionValue( + optionId: LPCWSTR, + value: *mut BYTE, + ) -> HRESULT, + fn Get_OptionIds( + value: *mut *mut IEnumString, + ) -> HRESULT, + fn Get_Id( + value: *mut LPWSTR, + ) -> HRESULT, + fn Get_LocalizedName( + value: *mut LPWSTR, + ) -> HRESULT, + fn add_SpellCheckerChanged( + handler: *const ISpellCheckerChangedEventHandler, + eventCookie: *mut DWORD, + ) -> HRESULT, + fn remove_SpellCheckerChanged( + eventCookie: DWORD, + ) -> HRESULT, + fn GetOptionDescription( + optionId: LPCWSTR, + value: *mut *mut IOptionDescription, + ) -> HRESULT, + fn ComprehensiveCheck( + text: LPCWSTR, + value: *mut *mut IEnumSpellingError, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xe7ed1c71, 0x87f7, 0x4378, 0xa8, 0x40, 0xc9, 0x20, 0x0d, 0xac, 0xee, 0x47)] +interface ISpellChecker2(ISpellChecker2Vtbl): ISpellChecker(ISpellCheckerVtbl) { + fn Remove( + word: LPCWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8e018a9d, 0x2415, 0x4677, 0xbf, 0x08, 0x79, 0x4e, 0xa6, 0x1f, 0x94, 0xbb)] +interface ISpellCheckerFactory(ISpellCheckerFactoryVtbl): IUnknown(IUnknownVtbl) { + fn SupportedLanguages( + value: *mut *mut IEnumString, + ) -> HRESULT, + fn IsSupported( + languageTag: LPCWSTR, + value: *mut BOOL, + ) -> HRESULT, + fn CreateSpellChecker( + languageTag: LPCWSTR, + value: *mut *mut ISpellChecker, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xaa176b85, 0x0e12, 0x4844, 0x8e, 0x1a, 0xee, 0xf1, 0xda, 0x77, 0xf5, 0x86)] +interface IUserDictionariesRegistrar(IUserDictionariesRegistrarVtbl): IUnknown(IUnknownVtbl) { + fn RegisterUserDictionary( + dictionaryPath: LPCWSTR, + languageTag: LPCWSTR, + ) -> HRESULT, + fn UnregisterUserDictionary( + dictionaryPath: LPCWSTR, + languageTag: LPCWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7ab36653, 0x1796, 0x484b, 0xbd, 0xfa, 0xe7, 0x4f, 0x1d, 0xb7, 0xc1, 0xdc)] +class SpellCheckerFactory; +} diff --git a/bash-5.1/vendor/winapi/src/um/sporder.rs b/bash-5.1/vendor/winapi/src/um/sporder.rs new file mode 100644 index 0000000000000000000000000000000000000000..84630e3e0f30a516c9b7ab82321c7574bc1f6872 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sporder.rs @@ -0,0 +1,41 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! Service Provider Order +use ctypes::c_int; +use shared::guiddef::LPGUID; +use shared::minwindef::{DWORD, LPDWORD}; +extern "system" { + pub fn WSCWriteProviderOrder( + lpwdCatalogEntryId: LPDWORD, + dwNumberOfEntries: DWORD, + ) -> c_int; +} +FN!{stdcall LPWSCWRITEPROVIDERORDER( + lpwdCatalogEntryId: LPDWORD, + dwNumberOfEntries: DWORD, +) -> c_int} +#[cfg(target_pointer_width = "64")] +extern "system" { + pub fn WSCWriteProviderOrder32( + lpwdCatalogEntryId: LPDWORD, + dwNumberOfEntries: DWORD, + ) -> c_int; + pub fn WSCWriteNameSpaceOrder( + lpProviderId: LPGUID, + dwNumberOfEntries: DWORD, + ) -> c_int; +} +FN!{stdcall LPWSCWRITENAMESPACEORDER( + lpProviderId: LPGUID, + dwNumberOfEntries: DWORD, +) -> c_int} +#[cfg(target_pointer_width = "64")] +extern "system" { + pub fn WSCWriteNameSpaceOrder32( + lpProviderId: LPGUID, + dwNumberOfEntries: DWORD, + ) -> c_int; +} diff --git a/bash-5.1/vendor/winapi/src/um/sql.rs b/bash-5.1/vendor/winapi/src/um/sql.rs new file mode 100644 index 0000000000000000000000000000000000000000..d42a163ed325d393ee62a49a7878e68b2b20852f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sql.rs @@ -0,0 +1,108 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use um::sqltypes::{ + SQLHANDLE, SQLHDBC, SQLHENV, SQLHSTMT, SQLINTEGER, SQLLEN, SQLPOINTER, SQLRETURN, SQLSMALLINT, + SQLUSMALLINT, +}; +pub const SQL_NULL_DATA: SQLLEN = -1; +pub const SQL_DATA_AT_EXEC: SQLLEN = -2; +pub const SQL_SUCCESS: SQLRETURN = 0; +pub const SQL_SUCCESS_WITH_INFO: SQLRETURN = 1; +pub const SQL_NO_DATA: SQLRETURN = 100; +pub const SQL_PARAM_DATA_AVAILABLE: SQLRETURN = 101; +pub const SQL_ERROR: SQLRETURN = -1; +pub const SQL_INVALID_HANDLE: SQLRETURN = -2; +pub const SQL_STILL_EXECUTING: SQLRETURN = 2; +pub const SQL_NEED_DATA: SQLRETURN = 99; +pub const SQL_NTS: SQLSMALLINT = -3; +pub const SQL_MAX_MESSAGE_LENGTH: usize = 512; +pub const SQL_DATE_LEN: usize = 10; +pub const SQL_TIME_LEN: usize = 8; +pub const SQL_TIMESTAMP_LEN: usize = 19; +pub const SQL_HANDLE_ENV: SQLSMALLINT = 1; +pub const SQL_HANDLE_DBC: SQLSMALLINT = 2; +pub const SQL_HANDLE_STMT: SQLSMALLINT = 3; +pub const SQL_HANDLE_DESC: SQLSMALLINT = 4; +pub const SQL_ATTR_OUTPUT_NTS: SQLINTEGER = 10001; +pub const SQL_ATTR_AUTO_IPD: SQLINTEGER = 10001; +pub const SQL_ATTR_METADATA_ID: SQLINTEGER = 10014; +pub const SQL_ATTR_APP_ROW_DESC: SQLINTEGER = 10010; +pub const SQL_ATTR_APP_PARAM_DESC: SQLINTEGER = 10011; +pub const SQL_ATTR_IMP_ROW_DESC: SQLINTEGER = 10012; +pub const SQL_ATTR_IMP_PARAM_DESC: SQLINTEGER = 10013; +pub const SQL_ATTR_CURSOR_SCROLLABLE: SQLINTEGER = -1; +pub const SQL_ATTR_CURSOR_SENSITIVITY: SQLINTEGER = -2; +pub const SQL_UNKNOWN_TYPE: SQLSMALLINT = 0; +pub const SQL_CHAR: SQLSMALLINT = 1; +pub const SQL_NUMERIC: SQLSMALLINT = 2; +pub const SQL_DECIMAL: SQLSMALLINT = 3; +pub const SQL_INTEGER: SQLSMALLINT = 4; +pub const SQL_SMALLINT: SQLSMALLINT = 5; +pub const SQL_FLOAT: SQLSMALLINT = 6; +pub const SQL_REAL: SQLSMALLINT = 7; +pub const SQL_DOUBLE: SQLSMALLINT = 8; +pub const SQL_DATETIME: SQLSMALLINT = 9; +pub const SQL_VARCHAR: SQLSMALLINT = 12; +pub const SQL_TYPE_DATE: SQLSMALLINT = 91; +pub const SQL_TYPE_TIME: SQLSMALLINT = 92; +pub const SQL_TYPE_TIMESTAMP: SQLSMALLINT = 93; +pub const SQL_NO_NULLS: SQLSMALLINT = 0; +pub const SQL_NULLABLE: SQLSMALLINT = 1; +pub const SQL_NULLABLE_UNKNOWN: SQLSMALLINT = 2; +pub const SQL_CLOSE: SQLUSMALLINT = 0; +pub const SQL_DROP: SQLUSMALLINT = 1; +pub const SQL_UNBIND: SQLUSMALLINT = 2; +pub const SQL_RESET_PARAMS: SQLUSMALLINT = 3; +pub const SQL_NULL_HANDLE: SQLHANDLE = 0 as SQLHANDLE; +extern "system" { + pub fn SQLAllocHandle( + handleType: SQLSMALLINT, + inputHandle: SQLHANDLE, + outputHandle: *mut SQLHANDLE, + ) -> SQLRETURN; + pub fn SQLDisconnect( + connectionHandle: SQLHDBC, + ) -> SQLRETURN; + pub fn SQLFetch( + statementHandle: SQLHSTMT, + ) -> SQLRETURN; + pub fn SQLFreeHandle( + handleType: SQLSMALLINT, + handle: SQLHANDLE, + ) -> SQLRETURN; + pub fn SQLFreeStmt( + statementHandle: SQLHSTMT, + option: SQLUSMALLINT, + ) -> SQLRETURN; + pub fn SQLGetData( + statementHandle: SQLHSTMT, + columnNumber: SQLUSMALLINT, + targetType: SQLSMALLINT, + targetValue: SQLPOINTER, + bufferLength: SQLLEN, + strLen_or_IndPtr: *mut SQLLEN, + ) -> SQLRETURN; + pub fn SQLNumResultCols( + statementHandle: SQLHSTMT, + columnCount: *mut SQLSMALLINT, + ) -> SQLRETURN; + pub fn SQLRowCount( + statementHandle: SQLHSTMT, + rowCount: *mut SQLLEN, + ) -> SQLRETURN; + pub fn SQLSetConnectAttr( + connectionHandle: SQLHDBC, + attribute: SQLINTEGER, + value: SQLPOINTER, + stringLength: SQLINTEGER, + ) -> SQLRETURN; + pub fn SQLSetEnvAttr( + environmentHandle: SQLHENV, + attribute: SQLINTEGER, + value: SQLPOINTER, + stringLength: SQLINTEGER, + ) -> SQLRETURN; +} diff --git a/bash-5.1/vendor/winapi/src/um/sqlext.rs b/bash-5.1/vendor/winapi/src/um/sqlext.rs new file mode 100644 index 0000000000000000000000000000000000000000..8de50f1b8b8fca2f8dc0e5566212bada1726d3b1 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sqlext.rs @@ -0,0 +1,95 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module defines the SQL extension APIs +use um::sql::{ + SQL_CHAR, SQL_DOUBLE, SQL_INTEGER, SQL_NUMERIC, SQL_REAL, SQL_SMALLINT, SQL_TYPE_DATE, + SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP +}; +use um::sqltypes::{SQLINTEGER, SQLSMALLINT, SQLUSMALLINT}; +pub const SQL_ATTR_ODBC_VERSION: SQLINTEGER = 200; +pub const SQL_ATTR_CONNECTION_POOLING: SQLINTEGER = 201; +pub const SQL_ATTR_CP_MATCH: SQLINTEGER = 202; +pub const SQL_OV_ODBC2: SQLINTEGER = 2; +pub const SQL_OV_ODBC3: SQLINTEGER = 3; +pub const SQL_OV_ODBC3_80: SQLINTEGER = 380; +pub const SQL_ACCESS_MODE: SQLINTEGER = 101; +pub const SQL_AUTOCOMMIT: SQLINTEGER = 102; +pub const SQL_LOGIN_TIMEOUT: SQLINTEGER = 103; +pub const SQL_OPT_TRACE: SQLINTEGER = 104; +pub const SQL_OPT_TRACEFILE: SQLINTEGER = 105; +pub const SQL_TRANSLATE_DLL: SQLINTEGER = 106; +pub const SQL_TRANSLATE_OPTION: SQLINTEGER = 107; +pub const SQL_TXN_ISOLATION: SQLINTEGER = 108; +pub const SQL_CURRENT_QUALIFIER: SQLINTEGER = 109; +pub const SQL_ODBC_CURSORS: SQLINTEGER = 110; +pub const SQL_QUIET_MODE: SQLINTEGER = 111; +pub const SQL_PACKET_SIZE: SQLINTEGER = 112; +pub const SQL_ATTR_ACCESS_MODE: SQLINTEGER = SQL_ACCESS_MODE; +pub const SQL_ATTR_AUTOCOMMIT: SQLINTEGER = SQL_AUTOCOMMIT; +pub const SQL_ATTR_CONNECTION_TIMEOUT: SQLINTEGER = 113; +pub const SQL_ATTR_CURRENT_CATALOG: SQLINTEGER = SQL_CURRENT_QUALIFIER; +pub const SQL_ATTR_DISCONNECT_BEHAVIOR: SQLINTEGER = 114; +pub const SQL_ATTR_ENLIST_IN_DTC: SQLINTEGER = 1207; +pub const SQL_ATTR_ENLIST_IN_XA: SQLINTEGER = 1208; +pub const SQL_ATTR_LOGIN_TIMEOUT: SQLINTEGER = SQL_LOGIN_TIMEOUT; +pub const SQL_ATTR_ODBC_CURSORS: SQLINTEGER = SQL_ODBC_CURSORS; +pub const SQL_ATTR_PACKET_SIZE: SQLINTEGER = SQL_PACKET_SIZE; +pub const SQL_ATTR_QUIET_MODE: SQLINTEGER = SQL_QUIET_MODE; +pub const SQL_ATTR_TRACE: SQLINTEGER = SQL_OPT_TRACE; +pub const SQL_ATTR_TRACEFILE: SQLINTEGER = SQL_OPT_TRACEFILE; +pub const SQL_ATTR_TRANSLATE_LIB: SQLINTEGER = SQL_TRANSLATE_DLL; +pub const SQL_ATTR_TRANSLATE_OPTION: SQLINTEGER = SQL_TRANSLATE_OPTION; +pub const SQL_ATTR_TXN_ISOLATION: SQLINTEGER = SQL_TXN_ISOLATION; +pub const SQL_ATTR_CONNECTION_DEAD: SQLINTEGER = 1209; +pub const SQL_IS_POINTER: SQLINTEGER = -4; +pub const SQL_IS_UINTEGER: SQLINTEGER = -5; +pub const SQL_IS_INTEGER: SQLINTEGER = -6; +pub const SQL_IS_USMALLINT: SQLINTEGER = -7; +pub const SQL_IS_SMALLINT: SQLINTEGER = -8; +pub const SQL_DATE: SQLSMALLINT = 9; +pub const SQL_INTERVAL: SQLSMALLINT = 10; +pub const SQL_TIME: SQLSMALLINT = 10; +pub const SQL_TIMESTAMP: SQLSMALLINT = 11; +pub const SQL_LONGVARCHAR: SQLSMALLINT = -1; +pub const SQL_BINARY: SQLSMALLINT = -2; +pub const SQL_VARBINARY: SQLSMALLINT = -3; +pub const SQL_LONGVARBINARY: SQLSMALLINT = -4; +pub const SQL_BIGINT: SQLSMALLINT = -5; +pub const SQL_TINYINT: SQLSMALLINT = -6; +pub const SQL_BIT: SQLSMALLINT = -7; +pub const SQL_GUID: SQLSMALLINT = -11; +pub const SQL_C_CHAR: SQLSMALLINT = SQL_CHAR; +pub const SQL_C_LONG: SQLSMALLINT = SQL_INTEGER; +pub const SQL_C_SHORT: SQLSMALLINT = SQL_SMALLINT; +pub const SQL_C_FLOAT: SQLSMALLINT = SQL_REAL; +pub const SQL_C_DOUBLE: SQLSMALLINT = SQL_DOUBLE; +pub const SQL_C_NUMERIC: SQLSMALLINT = SQL_NUMERIC; +pub const SQL_C_DEFAULT: SQLSMALLINT = 99; +pub const SQL_SIGNED_OFFSET: SQLSMALLINT = -20; +pub const SQL_UNSIGNED_OFFSET: SQLSMALLINT = -22; +pub const SQL_C_DATE: SQLSMALLINT = SQL_DATE; +pub const SQL_C_TIME: SQLSMALLINT = SQL_TIME; +pub const SQL_C_TIMESTAMP: SQLSMALLINT = SQL_TIMESTAMP; +pub const SQL_C_TYPE_DATE: SQLSMALLINT = SQL_TYPE_DATE; +pub const SQL_C_TYPE_TIME: SQLSMALLINT = SQL_TYPE_TIME; +pub const SQL_C_TYPE_TIMESTAMP: SQLSMALLINT = SQL_TYPE_TIMESTAMP; +pub const SQL_C_BINARY: SQLSMALLINT = SQL_BINARY; +pub const SQL_C_BIT: SQLSMALLINT = SQL_BIT; +pub const SQL_C_SBIGINT: SQLSMALLINT = SQL_BIGINT + SQL_SIGNED_OFFSET; +pub const SQL_C_UBIGINT: SQLSMALLINT = SQL_BIGINT + SQL_UNSIGNED_OFFSET; +pub const SQL_C_TINYINT: SQLSMALLINT = SQL_TINYINT; +pub const SQL_C_SLONG: SQLSMALLINT = SQL_C_LONG + SQL_SIGNED_OFFSET; +pub const SQL_C_SSHORT: SQLSMALLINT = SQL_C_SHORT + SQL_SIGNED_OFFSET; +pub const SQL_C_STINYINT: SQLSMALLINT = SQL_TINYINT + SQL_SIGNED_OFFSET; +pub const SQL_C_ULONG: SQLSMALLINT = SQL_C_LONG + SQL_UNSIGNED_OFFSET; +pub const SQL_C_USHORT: SQLSMALLINT = SQL_C_SHORT + SQL_UNSIGNED_OFFSET; +pub const SQL_C_UTINYINT: SQLSMALLINT = SQL_TINYINT + SQL_UNSIGNED_OFFSET; +pub const SQL_C_GUID: SQLSMALLINT = SQL_GUID; +pub const SQL_TYPE_NULL: SQLSMALLINT = 0; +pub const SQL_DRIVER_NOPROMPT: SQLUSMALLINT = 0; +pub const SQL_DRIVER_COMPLETE: SQLUSMALLINT = 1; +pub const SQL_DRIVER_PROMPT: SQLUSMALLINT = 2; +pub const SQL_DRIVER_COMPLETE_REQUIRED: SQLUSMALLINT = 3; diff --git a/bash-5.1/vendor/winapi/src/um/sqltypes.rs b/bash-5.1/vendor/winapi/src/um/sqltypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..401cffbbeb72da4f048b500922e4c74e41948246 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sqltypes.rs @@ -0,0 +1,142 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module defines the types used in ODBC +use ctypes::*; +#[cfg(target_pointer_width = "64")] +use shared::basetsd::{INT64, UINT64}; +use shared::guiddef::GUID; +use shared::windef::HWND; +pub type SQLCHAR = c_uchar; +pub type SQLSCHAR = c_schar; +pub type SQLDATE = c_uchar; +pub type SQLDECIMAL = c_uchar; +pub type SQLDOUBLE = c_double; +pub type SQLFLOAT = c_double; +pub type SQLINTEGER = c_long; +pub type SQLUINTEGER = c_ulong; +#[cfg(target_pointer_width = "64")] +pub type SQLLEN = INT64; +#[cfg(target_pointer_width = "64")] +pub type SQLULEN = UINT64; +#[cfg(target_pointer_width = "64")] +pub type SQLSETPOSIROW = UINT64; +#[cfg(target_pointer_width = "32")] +pub type SQLLEN = SQLINTEGER; +#[cfg(target_pointer_width = "32")] +pub type SQLULEN = SQLUINTEGER; +#[cfg(target_pointer_width = "32")] +pub type SQLSETPOSIROW = SQLUSMALLINT; +pub type SQLROWCOUNT = SQLULEN; +pub type SQLROWSETSIZE = SQLULEN; +pub type SQLTRANSID = SQLULEN; +pub type SQLROWOFFSET = SQLLEN; +pub type SQLNUMERIC = c_uchar; +pub type SQLPOINTER = *mut c_void; +pub type SQLREAL = c_float; +pub type SQLSMALLINT = c_short; +pub type SQLUSMALLINT = c_ushort; +pub type SQLTIME = c_uchar; +pub type SQLTIMESTAMP = c_uchar; +pub type SQLVARCHAR = c_uchar; +pub type SQLRETURN = SQLSMALLINT; +pub type SQLHANDLE = *mut c_void; +pub type SQLHENV = SQLHANDLE; +pub type SQLHDBC = SQLHANDLE; +pub type SQLHSTMT = SQLHANDLE; +pub type SQLHDESC = SQLHANDLE; +//pub type UCHAR = c_uchar; +pub type SCHAR = c_schar; +//pub type SQLSCHAR = SCHAR; +pub type SDWORD = c_long; +pub type SWORD = c_short; +pub type UDWORD = c_ulong; +//pub type UWORD = c_ushort; +//#[cfg(target_pointer_width = "32")] +//pub type SQLUINTEGER = UDWORD; +pub type SLONG = c_long; +pub type SSHORT = c_short; +//pub type ULONG = c_ulong; +//pub type USHORT = c_ushort; +pub type SDOUBLE = c_double; +pub type LDOUBLE = c_double; +pub type SFLOAT = c_float; +pub type PTR = *mut c_void; +pub type HENV = *mut c_void; +pub type HDBC = *mut c_void; +pub type HSTMT = *mut c_void; +pub type RETCODE = c_short; +pub type SQLHWND = HWND; +STRUCT!{struct DATE_STRUCT { + year: SQLSMALLINT, + month: SQLUSMALLINT, + day: SQLUSMALLINT, +}} +pub type SQL_DATE_STRUCT = DATE_STRUCT; +STRUCT!{struct TIME_STRUCT { + hour: SQLUSMALLINT, + minute: SQLUSMALLINT, + second: SQLUSMALLINT, +}} +pub type SQL_TIME_STRUCT = TIME_STRUCT; +STRUCT!{struct TIMESTAMP_STRUCT { + year: SQLSMALLINT, + month: SQLUSMALLINT, + day: SQLUSMALLINT, + hour: SQLUSMALLINT, + minute: SQLUSMALLINT, + second: SQLUSMALLINT, + fraction: SQLUINTEGER, +}} +pub type SQL_TIMESTAMP_STRUCT = TIMESTAMP_STRUCT; +ENUM!{enum SQLINTERVAL { + SQL_IS_YEAR = 1, + SQL_IS_MONTH = 2, + SQL_IS_DAY = 3, + SQL_IS_HOUR = 4, + SQL_IS_MINUTE = 5, + SQL_IS_SECOND = 6, + SQL_IS_YEAR_TO_MONTH = 7, + SQL_IS_DAY_TO_HOUR = 8, + SQL_IS_DAY_TO_MINUTE = 9, + SQL_IS_DAY_TO_SECOND = 10, + SQL_IS_HOUR_TO_MINUTE = 11, + SQL_IS_HOUR_TO_SECOND = 12, + SQL_IS_MINUTE_TO_SECOND = 13, +}} +STRUCT!{struct SQL_YEAR_MONTH_STRUCT { + year: SQLUINTEGER, + month: SQLUINTEGER, +}} +STRUCT!{struct SQL_DAY_SECOND_STRUCT { + day: SQLUINTEGER, + hour: SQLUINTEGER, + minute: SQLUINTEGER, + second: SQLUINTEGER, + fraction: SQLUINTEGER, +}} +UNION!{union SQL_INTERVAL_STRUCT_intval { + [u32; 5], + year_month year_month_mut: SQL_YEAR_MONTH_STRUCT, + day_second day_second_mut: SQL_DAY_SECOND_STRUCT, +}} +STRUCT!{struct SQL_INTERVAL_STRUCT { + interval_type: SQLINTERVAL, + interval_sign: SQLSMALLINT, + intval: SQL_INTERVAL_STRUCT_intval, +}} +pub type ODBCINT64 = __int64; +pub type SQLBIGINT = ODBCINT64; +pub type SQLUBIGINT = __uint64; +pub const SQL_MAX_NUMERIC_LEN: usize = 16; +STRUCT!{struct SQL_NUMERIC_STRUCT { + precision: SQLCHAR, + scale: SQLSCHAR, + sign: SQLCHAR, + val: [SQLCHAR; SQL_MAX_NUMERIC_LEN], +}} +pub type SQLGUID = GUID; +pub type BOOKMARK = SQLULEN; +pub type SQLWCHAR = wchar_t; diff --git a/bash-5.1/vendor/winapi/src/um/sqlucode.rs b/bash-5.1/vendor/winapi/src/um/sqlucode.rs new file mode 100644 index 0000000000000000000000000000000000000000..b5ed4bfabf727588bbef33cc4035a2991b286037 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sqlucode.rs @@ -0,0 +1,106 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module defines the ODBC Core unicode functions +use um::sqltypes::{ + SQLCHAR, SQLHANDLE, SQLHDBC, SQLHSTMT, SQLHWND, SQLINTEGER, SQLRETURN, SQLSMALLINT, SQLULEN, + SQLUSMALLINT, SQLWCHAR +}; +pub const SQL_WCHAR: SQLSMALLINT = -8; +pub const SQL_WVARCHAR: SQLSMALLINT = -9; +pub const SQL_WLONGVARCHAR: SQLSMALLINT = -10; +pub const SQL_C_WCHAR: SQLSMALLINT = SQL_WCHAR; +extern "system" { + pub fn SQLConnectW( + connectionHandle: SQLHDBC, + serverName: *const SQLWCHAR, + nameLength1: SQLSMALLINT, + userName: *const SQLWCHAR, + nameLength2: SQLSMALLINT, + authentication: *const SQLWCHAR, + nameLength3: SQLSMALLINT, + ) -> SQLRETURN; + pub fn SQLDescribeColW( + statementHandle: SQLHSTMT, + columnNumber: SQLUSMALLINT, + columnName: *mut SQLWCHAR, + bufferLength: SQLSMALLINT, + nameLength: *mut SQLSMALLINT, + dataType: *mut SQLSMALLINT, + columnSize: *mut SQLULEN, + decimalDigits: *mut SQLSMALLINT, + nullable: *mut SQLSMALLINT, + ) -> SQLRETURN; + pub fn SQLExecDirectW( + statementHandle: SQLHSTMT, + statementText: *const SQLWCHAR, + textLength: SQLINTEGER, + ) -> SQLRETURN; + pub fn SQLGetDiagRecW( + handleType: SQLSMALLINT, + handle: SQLHANDLE, + recNumber: SQLSMALLINT, + sqlstate: *mut SQLWCHAR, + nativeError: *mut SQLINTEGER, + messageText: *mut SQLWCHAR, + bufferLength: SQLSMALLINT, + textLength: *mut SQLSMALLINT, + ) -> SQLRETURN; + pub fn SQLDriverConnectW( + hdbc: SQLHDBC, + hwnd: SQLHWND, + szConnStrIn: *const SQLWCHAR, + cchConnStrIn: SQLSMALLINT, + szConnStrOut: *mut SQLWCHAR, + cchConnStrOutMax: SQLSMALLINT, + pcchConnStrOut: *mut SQLSMALLINT, + fDriverCompletion: SQLUSMALLINT, + ) -> SQLRETURN; + pub fn SQLConnectA( + connectionHandle: SQLHDBC, + serverName: *const SQLCHAR, + nameLength1: SQLSMALLINT, + userName: *const SQLCHAR, + nameLength2: SQLSMALLINT, + authentication: *const SQLCHAR, + nameLength3: SQLSMALLINT, + ) -> SQLRETURN; + pub fn SQLDescribeColA( + statementHandle: SQLHSTMT, + columnNumber: SQLUSMALLINT, + columnName: *mut SQLCHAR, + bufferLength: SQLSMALLINT, + nameLength: *mut SQLSMALLINT, + dataType: *mut SQLSMALLINT, + columnSize: *mut SQLULEN, + decimalDigits: *mut SQLSMALLINT, + nullable: *mut SQLSMALLINT, + ) -> SQLRETURN; + pub fn SQLExecDirectA( + statementHandle: SQLHSTMT, + statementText: *const SQLCHAR, + textLength: SQLINTEGER, + ) -> SQLRETURN; + pub fn SQLGetDiagRecA( + handleType: SQLSMALLINT, + handle: SQLHANDLE, + recNumber: SQLSMALLINT, + sqlstate: *mut SQLCHAR, + nativeError: *mut SQLINTEGER, + messageText: *mut SQLCHAR, + bufferLength: SQLSMALLINT, + textLength: *mut SQLSMALLINT, + ) -> SQLRETURN; + pub fn SQLDriverConnectA( + hdbc: SQLHDBC, + hwnd: SQLHWND, + szConnStrIn: *const SQLCHAR, + cchConnStrIn: SQLSMALLINT, + szConnStrOut: *mut SQLCHAR, + cchConnStrOutMax: SQLSMALLINT, + pcchConnStrOut: *mut SQLSMALLINT, + fDriverCompletion: SQLUSMALLINT, + ) -> SQLRETURN; +} diff --git a/bash-5.1/vendor/winapi/src/um/sspi.rs b/bash-5.1/vendor/winapi/src/um/sspi.rs new file mode 100644 index 0000000000000000000000000000000000000000..edc0dbc6d4d113b01a0bcab4e312d737c1e61eb3 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sspi.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Security Support Provider Interface Prototypes and structure definitions +pub use shared::sspi::*; diff --git a/bash-5.1/vendor/winapi/src/um/stringapiset.rs b/bash-5.1/vendor/winapi/src/um/stringapiset.rs new file mode 100644 index 0000000000000000000000000000000000000000..61560ed14936cf0d03cf76c1e838598bf1fff88b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/stringapiset.rs @@ -0,0 +1,75 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_int; +use shared::minwindef::{BOOL, DWORD, LPARAM, LPBOOL, LPVOID, LPWORD, UINT}; +use um::winnls::LPNLSVERSIONINFO; +use um::winnt::{LCID, LPCSTR, LPCWCH, LPCWSTR, LPSTR, LPWSTR, PCNZWCH}; +extern "system" { + pub fn CompareStringEx( + lpLocaleName: LPCWSTR, + dwCmpFlags: DWORD, + lpString1: LPCWCH, + cchCount1: c_int, + lpString2: LPCWCH, + cchCount2: c_int, + lpVersionInformation: LPNLSVERSIONINFO, + lpReserved: LPVOID, + lParam: LPARAM, + ) -> c_int; + pub fn CompareStringOrdinal( + lpString1: LPCWCH, + cchCount1: c_int, + lpString2: LPCWCH, + cchCount2: c_int, + bIgnoreCase: BOOL, + ) -> c_int; + pub fn CompareStringW( + Locale: LCID, + dwCmpFlags: DWORD, + lpString1: PCNZWCH, + cchCount1: c_int, + lpString2: PCNZWCH, + cchCount2: c_int, + ) -> c_int; + pub fn FoldStringW( + dwMapFlags: DWORD, + lpSrcStr: LPCWCH, + cchSrc: c_int, + lpDestStr: LPWSTR, + cchDest: c_int, + ) -> c_int; + pub fn GetStringTypeExW( + Locale: LCID, + dwInfoType: DWORD, + lpSrcStr: LPCWCH, + cchSrc: c_int, + lpCharType: LPWORD, + ) -> BOOL; + pub fn GetStringTypeW( + dwInfoType: DWORD, + lpSrcStr: LPCWCH, + cchSrc: c_int, + lpCharType: LPWORD, + ) -> BOOL; + pub fn MultiByteToWideChar( + CodePage: UINT, + dwFlags: DWORD, + lpMultiByteStr: LPCSTR, + cbMultiByte: c_int, + lpWideCharStr: LPWSTR, + cchWideChar: c_int, + ) -> c_int; + pub fn WideCharToMultiByte( + CodePage: UINT, + dwFlags: DWORD, + lpWideCharStr: LPCWSTR, + cchWideChar: c_int, + lpMultiByteStr: LPSTR, + cbMultiByte: c_int, + lpDefaultChar: LPCSTR, + lpUsedDefaultChar: LPBOOL, + ) -> c_int; +} diff --git a/bash-5.1/vendor/winapi/src/um/strmif.rs b/bash-5.1/vendor/winapi/src/um/strmif.rs new file mode 100644 index 0000000000000000000000000000000000000000..db08afd9ac7254b6153d423cc4e5dcc707d0e731 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/strmif.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use um::winnt::LONGLONG; +pub type REFERENCE_TIME = LONGLONG; diff --git a/bash-5.1/vendor/winapi/src/um/subauth.rs b/bash-5.1/vendor/winapi/src/um/subauth.rs new file mode 100644 index 0000000000000000000000000000000000000000..b5d539b25773004f01018d62ca61001be057425e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/subauth.rs @@ -0,0 +1,204 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Types and macros for Subauthentication Packages. +use shared::minwindef::{PUCHAR, ULONG, USHORT}; +use um::winnt::{BOOLEAN, CHAR, LARGE_INTEGER, LONG, PCHAR, PVOID, PWSTR}; +STRUCT!{struct UNICODE_STRING { + Length: USHORT, + MaximumLength: USHORT, + Buffer: PWSTR, +}} +pub type PUNICODE_STRING = *mut UNICODE_STRING; +STRUCT!{struct STRING { + Length: USHORT, + MaximumLength: USHORT, + Buffer: PCHAR, +}} +pub type PSTRING = *mut STRING; +STRUCT!{struct OLD_LARGE_INTEGER { + LowPart: ULONG, + HighPart: LONG, +}} +pub type POLD_LARGE_INTEGER = *mut OLD_LARGE_INTEGER; +pub type SAM_HANDLE = PVOID; +pub type PSAM_HANDLE = *mut PVOID; +pub const USER_ACCOUNT_DISABLED: ULONG = 0x00000001; +pub const USER_HOME_DIRECTORY_REQUIRED: ULONG = 0x00000002; +pub const USER_PASSWORD_NOT_REQUIRED: ULONG = 0x00000004; +pub const USER_TEMP_DUPLICATE_ACCOUNT: ULONG = 0x00000008; +pub const USER_NORMAL_ACCOUNT: ULONG = 0x00000010; +pub const USER_MNS_LOGON_ACCOUNT: ULONG = 0x00000020; +pub const USER_INTERDOMAIN_TRUST_ACCOUNT: ULONG = 0x00000040; +pub const USER_WORKSTATION_TRUST_ACCOUNT: ULONG = 0x00000080; +pub const USER_SERVER_TRUST_ACCOUNT: ULONG = 0x00000100; +pub const USER_DONT_EXPIRE_PASSWORD: ULONG = 0x00000200; +pub const USER_ACCOUNT_AUTO_LOCKED: ULONG = 0x00000400; +pub const USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED: ULONG = 0x00000800; +pub const USER_SMARTCARD_REQUIRED: ULONG = 0x00001000; +pub const USER_TRUSTED_FOR_DELEGATION: ULONG = 0x00002000; +pub const USER_NOT_DELEGATED: ULONG = 0x00004000; +pub const USER_USE_DES_KEY_ONLY: ULONG = 0x00008000; +pub const USER_DONT_REQUIRE_PREAUTH: ULONG = 0x00010000; +pub const USER_PASSWORD_EXPIRED: ULONG = 0x00020000; +pub const USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION: ULONG = 0x00040000; +pub const USER_NO_AUTH_DATA_REQUIRED: ULONG = 0x00080000; +pub const USER_PARTIAL_SECRETS_ACCOUNT: ULONG = 0x00100000; +pub const USER_USE_AES_KEYS: ULONG = 0x00200000; +pub const NEXT_FREE_ACCOUNT_CONTROL_BIT: ULONG = USER_USE_AES_KEYS << 1; +pub const USER_MACHINE_ACCOUNT_MASK: ULONG = USER_INTERDOMAIN_TRUST_ACCOUNT + | USER_WORKSTATION_TRUST_ACCOUNT | USER_SERVER_TRUST_ACCOUNT; +pub const USER_ACCOUNT_TYPE_MASK: ULONG = USER_TEMP_DUPLICATE_ACCOUNT | USER_NORMAL_ACCOUNT + | USER_MACHINE_ACCOUNT_MASK; +pub const USER_COMPUTED_ACCOUNT_CONTROL_BITS: ULONG = USER_ACCOUNT_AUTO_LOCKED + | USER_PASSWORD_EXPIRED; +pub const SAM_DAYS_PER_WEEK: USHORT = 7; +pub const SAM_HOURS_PER_WEEK: USHORT = 24 * SAM_DAYS_PER_WEEK; +pub const SAM_MINUTES_PER_WEEK: USHORT = 60 * SAM_HOURS_PER_WEEK; +STRUCT!{struct LOGON_HOURS { + UnitsPerWeek: USHORT, + LogonHours: PUCHAR, +}} +pub type PLOGON_HOURS = *mut LOGON_HOURS; +STRUCT!{struct SR_SECURITY_DESCRIPTOR { + Length: ULONG, + SecurityDescriptor: PUCHAR, +}} +pub type PSR_SECURITY_DESCRIPTOR = *mut SR_SECURITY_DESCRIPTOR; +STRUCT!{struct USER_ALL_INFORMATION { + LastLogon: LARGE_INTEGER, + LastLogoff: LARGE_INTEGER, + PasswordLastSet: LARGE_INTEGER, + AccountExpires: LARGE_INTEGER, + PasswordCanChange: LARGE_INTEGER, + PasswordMustChange: LARGE_INTEGER, + UserName: UNICODE_STRING, + FullName: UNICODE_STRING, + HomeDirectory: UNICODE_STRING, + HomeDirectoryDrive: UNICODE_STRING, + ScriptPath: UNICODE_STRING, + ProfilePath: UNICODE_STRING, + AdminComment: UNICODE_STRING, + WorkStations: UNICODE_STRING, + UserComment: UNICODE_STRING, + Parameters: UNICODE_STRING, + LmPassword: UNICODE_STRING, + NtPassword: UNICODE_STRING, + PrivateData: UNICODE_STRING, + SecurityDescriptor: SR_SECURITY_DESCRIPTOR, + UserId: ULONG, + PrimaryGroupId: ULONG, + UserAccountControl: ULONG, + WhichFields: ULONG, + LogonHours: LOGON_HOURS, + BadPasswordCount: USHORT, + LogonCount: USHORT, + CountryCode: USHORT, + CodePage: USHORT, + LmPasswordPresent: BOOLEAN, + NtPasswordPresent: BOOLEAN, + PasswordExpired: BOOLEAN, + PrivateDataSensitive: BOOLEAN, +}} +pub type PUSER_ALL_INFORMATION = *mut USER_ALL_INFORMATION; +pub const USER_ALL_PARAMETERS: ULONG = 0x00200000; +pub const CLEAR_BLOCK_LENGTH: usize = 8; +STRUCT!{struct CLEAR_BLOCK { + data: [CHAR; CLEAR_BLOCK_LENGTH], +}} +pub type PCLEAR_BLOCK = *mut CLEAR_BLOCK; +pub const CYPHER_BLOCK_LENGTH: usize = 8; +STRUCT!{struct CYPHER_BLOCK { + data: [CHAR; CYPHER_BLOCK_LENGTH], +}} +pub type PCYPHER_BLOCK = *mut CYPHER_BLOCK; +STRUCT!{struct LM_OWF_PASSWORD { + data: [CYPHER_BLOCK; 2], +}} +pub type PLM_OWF_PASSWORD = *mut LM_OWF_PASSWORD; +pub type LM_CHALLENGE = CLEAR_BLOCK; +pub type PLM_CHALLENGE = *mut LM_CHALLENGE; +pub type NT_OWF_PASSWORD = LM_OWF_PASSWORD; +pub type PNT_OWF_PASSWORD = *mut NT_OWF_PASSWORD; +pub type NT_CHALLENGE = LM_CHALLENGE; +pub type PNT_CHALLENGE = *mut NT_CHALLENGE; +pub const USER_SESSION_KEY_LENGTH: usize = CYPHER_BLOCK_LENGTH * 2; +STRUCT!{struct USER_SESSION_KEY { + data: [CYPHER_BLOCK; 2], +}} +pub type PUSER_SESSION_KEY = *mut USER_SESSION_KEY; +ENUM!{enum NETLOGON_LOGON_INFO_CLASS { + NetlogonInteractiveInformation = 1, + NetlogonNetworkInformation, + NetlogonServiceInformation, + NetlogonGenericInformation, + NetlogonInteractiveTransitiveInformation, + NetlogonNetworkTransitiveInformation, + NetlogonServiceTransitiveInformation, +}} +STRUCT!{struct NETLOGON_LOGON_IDENTITY_INFO { + LogonDomainName: UNICODE_STRING, + ParameterControl: ULONG, + LogonId: OLD_LARGE_INTEGER, + UserName: UNICODE_STRING, + Workstation: UNICODE_STRING, +}} +pub type PNETLOGON_LOGON_IDENTITY_INFO = *mut NETLOGON_LOGON_IDENTITY_INFO; +STRUCT!{struct NETLOGON_INTERACTIVE_INFO { + Identity: NETLOGON_LOGON_IDENTITY_INFO, + LmOwfPassword: LM_OWF_PASSWORD, + NtOwfPassword: NT_OWF_PASSWORD, +}} +pub type PNETLOGON_INTERACTIVE_INFO = *mut NETLOGON_INTERACTIVE_INFO; +STRUCT!{struct NETLOGON_SERVICE_INFO { + Identity: NETLOGON_LOGON_IDENTITY_INFO, + LmOwfPassword: LM_OWF_PASSWORD, + NtOwfPassword: NT_OWF_PASSWORD, +}} +pub type PNETLOGON_SERVICE_INFO = *mut NETLOGON_SERVICE_INFO; +STRUCT!{struct NETLOGON_NETWORK_INFO { + Identity: NETLOGON_LOGON_IDENTITY_INFO, + LmChallenge: LM_CHALLENGE, + NtChallengeResponse: STRING, + LmChallengeResponse: STRING, +}} +pub type PNETLOGON_NETWORK_INFO = *mut NETLOGON_NETWORK_INFO; +STRUCT!{struct NETLOGON_GENERIC_INFO { + Identity: NETLOGON_LOGON_IDENTITY_INFO, + PackageName: UNICODE_STRING, + DataLength: ULONG, + LogonData: PUCHAR, +}} +pub type PNETLOGON_GENERIC_INFO = *mut NETLOGON_GENERIC_INFO; +pub const MSV1_0_PASSTHRU: ULONG = 0x01; +pub const MSV1_0_GUEST_LOGON: ULONG = 0x02; +STRUCT!{struct MSV1_0_VALIDATION_INFO { + LogoffTime: LARGE_INTEGER, + KickoffTime: LARGE_INTEGER, + LogonServer: UNICODE_STRING, + LogonDomainName: UNICODE_STRING, + SessionKey: USER_SESSION_KEY, + Authoritative: BOOLEAN, + UserFlags: ULONG, + WhichFields: ULONG, + UserId: ULONG, +}} +pub type PMSV1_0_VALIDATION_INFO = *mut MSV1_0_VALIDATION_INFO; +pub const MSV1_0_VALIDATION_LOGOFF_TIME: ULONG = 0x00000001; +pub const MSV1_0_VALIDATION_KICKOFF_TIME: ULONG = 0x00000002; +pub const MSV1_0_VALIDATION_LOGON_SERVER: ULONG = 0x00000004; +pub const MSV1_0_VALIDATION_LOGON_DOMAIN: ULONG = 0x00000008; +pub const MSV1_0_VALIDATION_SESSION_KEY: ULONG = 0x00000010; +pub const MSV1_0_VALIDATION_USER_FLAGS: ULONG = 0x00000020; +pub const MSV1_0_VALIDATION_USER_ID: ULONG = 0x00000040; +pub const MSV1_0_SUBAUTH_ACCOUNT_DISABLED: ULONG = 0x00000001; +pub const MSV1_0_SUBAUTH_PASSWORD: ULONG = 0x00000002; +pub const MSV1_0_SUBAUTH_WORKSTATIONS: ULONG = 0x00000004; +pub const MSV1_0_SUBAUTH_LOGON_HOURS: ULONG = 0x00000008; +pub const MSV1_0_SUBAUTH_ACCOUNT_EXPIRY: ULONG = 0x00000010; +pub const MSV1_0_SUBAUTH_PASSWORD_EXPIRY: ULONG = 0x00000020; +pub const MSV1_0_SUBAUTH_ACCOUNT_TYPE: ULONG = 0x00000040; +pub const MSV1_0_SUBAUTH_LOCKOUT: ULONG = 0x00000080; +// STATUS_* diff --git a/bash-5.1/vendor/winapi/src/um/synchapi.rs b/bash-5.1/vendor/winapi/src/um/synchapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..205579e66fb882e66d4d984f8f51b5a320614caa --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/synchapi.rs @@ -0,0 +1,349 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-core-synch-l1 +use shared::basetsd::SIZE_T; +use shared::minwindef::{BOOL, DWORD, LPLONG, LPVOID, PBOOL, ULONG}; +use um::minwinbase::{ + LPCRITICAL_SECTION, LPSECURITY_ATTRIBUTES, PCRITICAL_SECTION, PREASON_CONTEXT, +}; +use um::winnt::{ + BOOLEAN, HANDLE, LARGE_INTEGER, LONG, LPCSTR, LPCWSTR, PRTL_BARRIER, PRTL_RUN_ONCE, + PVOID, RTL_BARRIER, RTL_CONDITION_VARIABLE, RTL_CONDITION_VARIABLE_INIT, + RTL_RUN_ONCE, RTL_SRWLOCK, RTL_SRWLOCK_INIT, VOID +}; +pub const SRWLOCK_INIT: SRWLOCK = RTL_SRWLOCK_INIT; +pub type SRWLOCK = RTL_SRWLOCK; +pub type PSRWLOCK = *mut RTL_SRWLOCK; +extern "system" { + pub fn InitializeSRWLock( + SRWLock: PSRWLOCK, + ); + pub fn ReleaseSRWLockExclusive( + SRWLock: PSRWLOCK, + ); + pub fn ReleaseSRWLockShared( + SRWLock: PSRWLOCK, + ); + pub fn AcquireSRWLockExclusive( + SRWLock: PSRWLOCK, + ); + pub fn AcquireSRWLockShared( + SRWLock: PSRWLOCK, + ); + pub fn TryAcquireSRWLockExclusive( + SRWLock: PSRWLOCK, + ) -> BOOLEAN; + pub fn TryAcquireSRWLockShared( + SRWLock: PSRWLOCK, + ) -> BOOLEAN; + pub fn InitializeCriticalSection( + lpCriticalSection: LPCRITICAL_SECTION, + ); + pub fn EnterCriticalSection( + lpCriticalSection: LPCRITICAL_SECTION, + ); + pub fn LeaveCriticalSection( + lpCriticalSection: LPCRITICAL_SECTION, + ); + pub fn InitializeCriticalSectionAndSpinCount( + lpCriticalSection: LPCRITICAL_SECTION, + dwSpinCount: DWORD, + ) -> BOOL; + pub fn InitializeCriticalSectionEx( + lpCriticalSection: LPCRITICAL_SECTION, + dwSpinCount: DWORD, + Flags: DWORD, + ) -> BOOL; + pub fn SetCriticalSectionSpinCount( + lpCriticalSection: LPCRITICAL_SECTION, + dwSpinCount: DWORD, + ) -> DWORD; + pub fn TryEnterCriticalSection( + lpCriticalSection: LPCRITICAL_SECTION, + ) -> BOOL; + pub fn DeleteCriticalSection( + lpCriticalSection: LPCRITICAL_SECTION, + ); +} +pub type INIT_ONCE = RTL_RUN_ONCE; +pub type PINIT_ONCE = PRTL_RUN_ONCE; +pub type LPINIT_ONCE = PRTL_RUN_ONCE; +//pub const INIT_ONCE_STATIC_INIT: INIT_ONCE = RTL_RUN_ONCE_INIT; +//pub const INIT_ONCE_CHECK_ONLY: ULONG = RTL_RUN_ONCE_CHECK_ONLY; +//pub const INIT_ONCE_ASYNC: ULONG = RTL_RUN_ONCE_ASYNC; +//pub const INIT_ONCE_INIT_FAILED: ULONG = RTL_RUN_ONCE_INIT_FAILED; +//pub const INIT_ONCE_CTX_RESERVED_BITS: usize = RTL_RUN_ONCE_CTX_RESERVED_BITS; +FN!{stdcall PINIT_ONCE_FN( + InitOnce: PINIT_ONCE, + Parameter: PVOID, + Context: *mut PVOID, +) -> BOOL} +extern "system" { + pub fn InitOnceInitialize( + InitOnce: PINIT_ONCE, + ); + pub fn InitOnceExecuteOnce( + InitOnce: PINIT_ONCE, + InitFn: PINIT_ONCE_FN, + Parameter: PVOID, + Context: *mut LPVOID, + ) -> BOOL; + pub fn InitOnceBeginInitialize( + lpInitOnce: LPINIT_ONCE, + dwFlags: DWORD, + fPending: PBOOL, + lpContext: *mut LPVOID, + ) -> BOOL; + pub fn InitOnceComplete( + lpInitOnce: LPINIT_ONCE, + dwFlags: DWORD, + lpContext: LPVOID, + ) -> BOOL; +} +pub type CONDITION_VARIABLE = RTL_CONDITION_VARIABLE; +pub type PCONDITION_VARIABLE = *mut CONDITION_VARIABLE; +pub const CONDITION_VARIABLE_INIT: CONDITION_VARIABLE = RTL_CONDITION_VARIABLE_INIT; +//pub const CONDITION_VARIABLE_LOCKMODE_SHARED: ULONG = RTL_CONDITION_VARIABLE_LOCKMODE_SHARED; +extern "system" { + pub fn InitializeConditionVariable( + ConditionVariable: PCONDITION_VARIABLE, + ); + pub fn WakeConditionVariable( + ConditionVariable: PCONDITION_VARIABLE, + ); + pub fn WakeAllConditionVariable( + ConditionVariable: PCONDITION_VARIABLE, + ); + pub fn SleepConditionVariableCS( + ConditionVariable: PCONDITION_VARIABLE, + CriticalSection: PCRITICAL_SECTION, + dwMilliseconds: DWORD, + ) -> BOOL; + pub fn SleepConditionVariableSRW( + ConditionVariable: PCONDITION_VARIABLE, + SRWLock: PSRWLOCK, + dwMilliseconds: DWORD, + Flags: ULONG, + ) -> BOOL; + pub fn SetEvent( + hEvent: HANDLE, + ) -> BOOL; + pub fn ResetEvent( + hEvent: HANDLE, + ) -> BOOL; + pub fn ReleaseSemaphore( + hSemaphore: HANDLE, + lReleaseCount: LONG, + lpPreviousCount: LPLONG, + ) -> BOOL; + pub fn ReleaseMutex( + hMutex: HANDLE, + ) -> BOOL; + pub fn WaitForSingleObject( + hHandle: HANDLE, + dwMilliseconds: DWORD, + ) -> DWORD; + pub fn SleepEx( + dwMilliseconds: DWORD, + bAlertable: BOOL, + ) -> DWORD; + pub fn WaitForSingleObjectEx( + hHandle: HANDLE, + dwMilliseconds: DWORD, + bAlertable: BOOL, + ) -> DWORD; + pub fn WaitForMultipleObjectsEx( + nCount: DWORD, + lpHandles: *const HANDLE, + bWaitAll: BOOL, + dwMilliseconds: DWORD, + bAlertable: BOOL, + ) -> DWORD; +} +//pub const MUTEX_MODIFY_STATE: DWORD = MUTANT_QUERY_STATE; +//pub const MUTEX_ALL_ACCESS: DWORD = MUTANT_ALL_ACCESS; +extern "system" { + pub fn CreateMutexA( + lpMutexAttributes: LPSECURITY_ATTRIBUTES, + bInitialOwner: BOOL, + lpName: LPCSTR, + ) -> HANDLE; + pub fn CreateMutexW( + lpMutexAttributes: LPSECURITY_ATTRIBUTES, + bInitialOwner: BOOL, + lpName: LPCWSTR, + ) -> HANDLE; + pub fn OpenMutexW( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpName: LPCWSTR, + ) -> HANDLE; + pub fn CreateEventA( + lpEventAttributes: LPSECURITY_ATTRIBUTES, + bManualReset: BOOL, + bInitialState: BOOL, + lpName: LPCSTR, + ) -> HANDLE; + pub fn CreateEventW( + lpEventAttributes: LPSECURITY_ATTRIBUTES, + bManualReset: BOOL, + bInitialState: BOOL, + lpName: LPCWSTR, + ) -> HANDLE; + pub fn OpenEventA( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpName: LPCSTR, + ) -> HANDLE; + pub fn OpenEventW( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpName: LPCWSTR, + ) -> HANDLE; + pub fn OpenSemaphoreW( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpName: LPCWSTR, + ) -> HANDLE; +} +FN!{stdcall PTIMERAPCROUTINE( + lpArgToCompletionRoutine: LPVOID, + dwTimerLowValue: DWORD, + dwTimerHighValue: DWORD, +) -> ()} +extern "system" { + pub fn OpenWaitableTimerW( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpTimerName: LPCWSTR, + ) -> HANDLE; + pub fn SetWaitableTimerEx( + hTimer: HANDLE, + lpDueTime: *const LARGE_INTEGER, + lPeriod: LONG, + pfnCompletionRoutine: PTIMERAPCROUTINE, + lpArgToCompletionRoutine: LPVOID, + WakeContext: PREASON_CONTEXT, + TolerableDelay: ULONG, + ) -> BOOL; + pub fn SetWaitableTimer( + hTimer: HANDLE, + lpDueTime: *const LARGE_INTEGER, + lPeriod: LONG, + pfnCompletionRoutine: PTIMERAPCROUTINE, + lpArgToCompletionRoutine: LPVOID, + fResume: BOOL, + ) -> BOOL; + pub fn CancelWaitableTimer( + hTimer: HANDLE, + ) -> BOOL; +} +pub const CREATE_MUTEX_INITIAL_OWNER: DWORD = 0x00000001; +extern "system" { + pub fn CreateMutexExA( + lpMutexAttributes: LPSECURITY_ATTRIBUTES, + lpName: LPCSTR, + dwFlags: DWORD, + dwDesiredAccess: DWORD, + ) -> HANDLE; + pub fn CreateMutexExW( + lpMutexAttributes: LPSECURITY_ATTRIBUTES, + lpName: LPCWSTR, + dwFlags: DWORD, + dwDesiredAccess: DWORD, + ) -> HANDLE; +} +pub const CREATE_EVENT_MANUAL_RESET: DWORD = 0x00000001; +pub const CREATE_EVENT_INITIAL_SET: DWORD = 0x00000002; +extern "system" { + pub fn CreateEventExA( + lpEventAttributes: LPSECURITY_ATTRIBUTES, + lpName: LPCSTR, + dwFlags: DWORD, + dwDesiredAccess: DWORD, + ) -> HANDLE; + pub fn CreateEventExW( + lpEventAttributes: LPSECURITY_ATTRIBUTES, + lpName: LPCWSTR, + dwFlags: DWORD, + dwDesiredAccess: DWORD, + ) -> HANDLE; + pub fn CreateSemaphoreExW( + lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES, + lInitialCount: LONG, + lMaximumCount: LONG, + lpName: LPCWSTR, + dwFlags: DWORD, + dwDesiredAccess: DWORD, + ) -> HANDLE; +} +pub const CREATE_WAITABLE_TIMER_MANUAL_RESET: DWORD = 0x00000001; +extern "system" { + pub fn CreateWaitableTimerExW( + lpTimerAttributes: LPSECURITY_ATTRIBUTES, + lpTimerName: LPCWSTR, + dwFlags: DWORD, + dwDesiredAccess: DWORD, + ) -> HANDLE; +} +pub type SYNCHRONIZATION_BARRIER = RTL_BARRIER; +pub type PSYNCHRONIZATION_BARRIER = PRTL_BARRIER; +pub type LPSYNCHRONIZATION_BARRIER = PRTL_BARRIER; +pub const SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY: DWORD = 0x01; +pub const SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY: DWORD = 0x02; +pub const SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE: DWORD = 0x04; +extern "system" { + pub fn EnterSynchronizationBarrier( + lpBarrier: LPSYNCHRONIZATION_BARRIER, + dwFlags: DWORD, + ) -> BOOL; + pub fn InitializeSynchronizationBarrier( + lpBarrier: LPSYNCHRONIZATION_BARRIER, + lTotalThreads: LONG, + lSpinCount: LONG, + ) -> BOOL; + pub fn DeleteSynchronizationBarrier( + lpBarrier: LPSYNCHRONIZATION_BARRIER, + ) -> BOOL; + pub fn Sleep( + dwMilliseconds: DWORD, + ); + pub fn WaitOnAddress( + Address: *mut VOID, + CompareAddress: PVOID, + AddressSize: SIZE_T, + dwMilliseconds: DWORD, + ) -> BOOL; + pub fn WakeByAddressSingle( + Address: PVOID, + ); + pub fn WakeByAddressAll( + Address: PVOID, + ); + pub fn SignalObjectAndWait( + hObjectToSignal: HANDLE, + hObjectToWaitOn: HANDLE, + dwMilliseconds: DWORD, + bAlertable: BOOL, + ) -> DWORD; + pub fn WaitForMultipleObjects( + nCount: DWORD, + lpHandles: *const HANDLE, + bWaitAll: BOOL, + dwMilliseconds: DWORD, + ) -> DWORD; + pub fn CreateSemaphoreW( + lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES, + lInitialCount: LONG, + lMaximumCount: LONG, + lpName: LPCWSTR, + ) -> HANDLE; + pub fn CreateWaitableTimerW( + lpTimerAttributes: LPSECURITY_ATTRIBUTES, + bManualReset: BOOL, + lpTimerName: LPCWSTR, + ) -> HANDLE; +} diff --git a/bash-5.1/vendor/winapi/src/um/sysinfoapi.rs b/bash-5.1/vendor/winapi/src/um/sysinfoapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..03bdb47d14dc60cb7080e32482991a097fe983fc --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/sysinfoapi.rs @@ -0,0 +1,217 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-core-sysinfo-l1. +use shared::basetsd::DWORD_PTR; +use shared::minwindef::{ + BOOL, BYTE, DWORD, LPDWORD, LPFILETIME, LPVOID, PBOOL, PDWORD, UINT, USHORT, WORD, +}; +use um::minwinbase::{LPSYSTEMTIME, SYSTEMTIME}; +use um::winnt::{ + DWORDLONG, HANDLE, LOGICAL_PROCESSOR_RELATIONSHIP, LPCSTR, LPCWSTR, LPOSVERSIONINFOA, + LPOSVERSIONINFOW, LPSTR, LPWSTR, PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, + PSYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION, PULONGLONG, PVOID, ULONGLONG, +}; +STRUCT!{struct SYSTEM_INFO_u_s { + wProcessorArchitecture: WORD, + wReserved: WORD, +}} +UNION!{union SYSTEM_INFO_u { + [u32; 1], + dwOemId dwOemId_mut: DWORD, + s s_mut: SYSTEM_INFO_u_s, +}} +STRUCT!{struct SYSTEM_INFO { + u: SYSTEM_INFO_u, + dwPageSize: DWORD, + lpMinimumApplicationAddress: LPVOID, + lpMaximumApplicationAddress: LPVOID, + dwActiveProcessorMask: DWORD_PTR, + dwNumberOfProcessors: DWORD, + dwProcessorType: DWORD, + dwAllocationGranularity: DWORD, + wProcessorLevel: WORD, + wProcessorRevision: WORD, +}} +pub type LPSYSTEM_INFO = *mut SYSTEM_INFO; +STRUCT!{struct MEMORYSTATUSEX { + dwLength: DWORD, + dwMemoryLoad: DWORD, + ullTotalPhys: DWORDLONG, + ullAvailPhys: DWORDLONG, + ullTotalPageFile: DWORDLONG, + ullAvailPageFile: DWORDLONG, + ullTotalVirtual: DWORDLONG, + ullAvailVirtual: DWORDLONG, + ullAvailExtendedVirtual: DWORDLONG, +}} +pub type LPMEMORYSTATUSEX = *mut MEMORYSTATUSEX; +extern "system" { + pub fn GlobalMemoryStatusEx( + lpBuffer: LPMEMORYSTATUSEX, + ) -> BOOL; + pub fn GetSystemInfo( + lpSystemInfo: LPSYSTEM_INFO, + ); + pub fn GetSystemTime( + lpSystemTime: LPSYSTEMTIME, + ); + pub fn GetSystemTimeAsFileTime( + lpSystemTimeAsFileTime: LPFILETIME, + ); + pub fn GetLocalTime( + lpSystemTime: LPSYSTEMTIME, + ); + pub fn GetVersion() -> DWORD; + pub fn SetLocalTime( + lpSystemTime: *const SYSTEMTIME, + ) -> BOOL; + pub fn GetTickCount() -> DWORD; + pub fn GetTickCount64() -> ULONGLONG; + pub fn GetSystemTimeAdjustment( + lpTimeAdjustment: PDWORD, + lpTimeIncrement: PDWORD, + lpTimeAdjustmentDisabled: PBOOL, + ) -> BOOL; + pub fn GetSystemDirectoryA( + lpBuffer: LPSTR, + uSize: UINT, + ) -> UINT; + pub fn GetSystemDirectoryW( + lpBuffer: LPWSTR, + uSize: UINT, + ) -> UINT; + pub fn GetWindowsDirectoryA( + lpBuffer: LPSTR, + uSize: UINT, + ) -> UINT; + pub fn GetWindowsDirectoryW( + lpBuffer: LPWSTR, + uSize: UINT, + ) -> UINT; + pub fn GetSystemWindowsDirectoryA( + lpBuffer: LPSTR, + uSize: UINT, + ) -> UINT; + pub fn GetSystemWindowsDirectoryW( + lpBuffer: LPWSTR, + uSize: UINT, + ) -> UINT; +} +ENUM!{enum COMPUTER_NAME_FORMAT { + ComputerNameNetBIOS, + ComputerNameDnsHostname, + ComputerNameDnsDomain, + ComputerNameDnsFullyQualified, + ComputerNamePhysicalNetBIOS, + ComputerNamePhysicalDnsHostname, + ComputerNamePhysicalDnsDomain, + ComputerNamePhysicalDnsFullyQualified, + ComputerNameMax, +}} +extern "system" { + pub fn GetComputerNameExA( + NameType: COMPUTER_NAME_FORMAT, + lpBuffer: LPSTR, + nSize: LPDWORD, + ) -> BOOL; + pub fn GetComputerNameExW( + NameType: COMPUTER_NAME_FORMAT, + lpBuffer: LPWSTR, + nSize: LPDWORD, + ) -> BOOL; + pub fn SetComputerNameExW( + NameType: COMPUTER_NAME_FORMAT, + lpBuffer: LPCWSTR, + ) -> BOOL; + pub fn SetSystemTime( + lpSystemTime: *const SYSTEMTIME, + ) -> BOOL; + pub fn GetVersionExA( + lpVersionInformation: LPOSVERSIONINFOA, + ) -> BOOL; + pub fn GetVersionExW( + lpVersionInformation: LPOSVERSIONINFOW, + ) -> BOOL; + pub fn GetLogicalProcessorInformation( + Buffer: PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, + ReturnedLength: PDWORD, + ) -> BOOL; + pub fn GetLogicalProcessorInformationEx( + RelationshipType: LOGICAL_PROCESSOR_RELATIONSHIP, + Buffer: PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, + ReturnedLength: PDWORD, + ) -> BOOL; + pub fn GetNativeSystemInfo( + lpSystemInfo: LPSYSTEM_INFO, + ); + pub fn GetSystemTimePreciseAsFileTime( + lpSystemTimeAsFileTime: LPFILETIME, + ); + pub fn GetProductInfo( + dwOSMajorVersion: DWORD, + dwOSMinorVersion: DWORD, + dwSpMajorVersion: DWORD, + dwSpMinorVersion: DWORD, + pdwReturnedProductType: PDWORD, + ) -> BOOL; + pub fn VerSetConditionMask( + ConditionMask: ULONGLONG, + TypeMask: DWORD, + Condition: BYTE, + ) -> ULONGLONG; + // pub fn GetOsSafeBootMode(); + pub fn EnumSystemFirmwareTables( + FirmwareTableProviderSignature: DWORD, + pFirmwareTableEnumBuffer: PVOID, + BufferSize: DWORD, + ) -> UINT; + pub fn GetSystemFirmwareTable( + FirmwareTableProviderSignature: DWORD, + FirmwareTableID: DWORD, + pFirmwareTableBuffer: PVOID, + BufferSize: DWORD, + ) -> UINT; + pub fn DnsHostnameToComputerNameExW( + Hostname: LPCWSTR, + ComputerName: LPWSTR, + nSize: LPDWORD, + ) -> BOOL; + pub fn GetPhysicallyInstalledSystemMemory( + TotalMemoryInKilobytes: PULONGLONG, + ) -> BOOL; +} +pub const SCEX2_ALT_NETBIOS_NAME: DWORD = 0x00000001; +extern "system" { + pub fn SetComputerNameEx2W( + NameType: COMPUTER_NAME_FORMAT, + Flags: DWORD, + lpBuffer: LPCWSTR, + ) -> BOOL; + pub fn SetSystemTimeAdjustment( + dwTimeAdjustment: DWORD, + bTimeAdjustmentDisabled: BOOL, + ) -> BOOL; + pub fn InstallELAMCertificateInfo( + ELAMFile: HANDLE, + ) -> BOOL; + pub fn GetProcessorSystemCycleTime( + Group: USHORT, + Buffer: PSYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION, + ReturnedLength: PDWORD, + ) -> BOOL; + // pub fn GetOsManufacturingMode(); + // pub fn GetIntegratedDisplaySize(); + pub fn SetComputerNameA( + lpComputerName: LPCSTR, + ) -> BOOL; + pub fn SetComputerNameW( + lpComputerName: LPCWSTR, + ) -> BOOL; + pub fn SetComputerNameExA( + NameType: COMPUTER_NAME_FORMAT, + lpBuffer: LPCSTR, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/systemtopologyapi.rs b/bash-5.1/vendor/winapi/src/um/systemtopologyapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..8591fac8d0ca997e602818a4d4ba780b6dbc9892 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/systemtopologyapi.rs @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, PULONG, PUSHORT, ULONG, USHORT}; +use um::winnt::PGROUP_AFFINITY; +extern "system" { + pub fn GetNumaHighestNodeNumber( + HighestNodeNumber: PULONG, + ) -> BOOL; + pub fn GetNumaNodeProcessorMaskEx( + Node: USHORT, + ProcessorMask: PGROUP_AFFINITY, + ) -> BOOL; + pub fn GetNumaProximityNodeEx( + ProximityId: ULONG, + NodeNumber: PUSHORT, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/taskschd.rs b/bash-5.1/vendor/winapi/src/um/taskschd.rs new file mode 100644 index 0000000000000000000000000000000000000000..d73786cd3f9e40c962da8fe43352e2d299c5e68e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/taskschd.rs @@ -0,0 +1,1233 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_long, c_short}; +use shared::minwindef::{DWORD, INT}; +use shared::wtypes::{BSTR, DATE, VARIANT_BOOL}; +use um::minwinbase::SYSTEMTIME; +use um::oaidl::{IDispatch, IDispatchVtbl, SAFEARRAY, VARIANT}; +use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN}; +use um::winnt::{HRESULT, LONG}; +RIDL!{#[uuid(0x0f87369f, 0xa4e5, 0x4cfc, 0xbd, 0x3e, 0x73, 0xe6, 0x15, 0x45, 0x72, 0xdd)] +class TaskScheduler;} +RIDL!{#[uuid(0xf2a69db7, 0xda2c, 0x4352, 0x90, 0x66, 0x86, 0xfe, 0xe6, 0xda, 0xca, 0xc9)] +class TaskHandlerPS;} +RIDL!{#[uuid(0x9f15266d, 0xd7ba, 0x48f0, 0x93, 0xc1, 0xe6, 0x89, 0x5f, 0x6f, 0xe5, 0xac)] +class TaskHandlerStatusPS;} +RIDL!{#[uuid(0x79184a66, 0x8664, 0x423f, 0x97, 0xf1, 0x63, 0x73, 0x56, 0xa5, 0xd8, 0x12)] +interface ITaskFolderCollection(ITaskFolderCollectionVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + pCount: *mut LONG, + ) -> HRESULT, + fn get_Item( + index: VARIANT, + ppFolder: *mut *mut ITaskFolder, + ) -> HRESULT, + fn get__NewEnum( + ppEnum: *mut LPUNKNOWN, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8cfac062, 0xa080, 0x4c15, 0x9a, 0x88, 0xaa, 0x7c, 0x2a, 0xf8, 0x0d, 0xfc)] +interface ITaskFolder(ITaskFolderVtbl): IDispatch(IDispatchVtbl) { + fn get_Name( + pName: *mut BSTR, + ) -> HRESULT, + fn get_Path( + pPath: *mut BSTR, + ) -> HRESULT, + fn GetFolder( + Path: BSTR, + ppFolder: *mut *mut ITaskFolder, + ) -> HRESULT, + fn GetFolders( + flags: LONG, + ppFolders: *mut *mut ITaskFolderCollection, + ) -> HRESULT, + fn CreateFolder( + subFolderName: BSTR, + sddl: VARIANT, + ppFolder: *mut *mut ITaskFolder, + ) -> HRESULT, + fn DeleteFolder( + subFolderName: BSTR, + flags: LONG, + ) -> HRESULT, + fn GetTask( + Path: BSTR, + ppTask: *mut *mut IRegisteredTask, + ) -> HRESULT, + fn GetTasks( + flags: LONG, + ppTasks: *mut *mut IRegisteredTaskCollection, + ) -> HRESULT, + fn DeleteTask( + Name: BSTR, + flags: LONG, + ) -> HRESULT, + fn RegisterTask( + Path: BSTR, + XmlText: BSTR, + flags: LONG, + UserId: VARIANT, + password: VARIANT, + LogonType: TASK_LOGON_TYPE, + sddl: VARIANT, + ppTask: *mut *mut IRegisteredTask, + ) -> HRESULT, + fn RegisterTaskDefinition( + Path: BSTR, + pDefinition: *const ITaskDefinition, + flags: LONG, + UserId: VARIANT, + password: VARIANT, + LogonType: TASK_LOGON_TYPE, + sddl: VARIANT, + ppTask: *mut *mut IRegisteredTask, + ) -> HRESULT, + fn GetSecurityDescriptor( + securityInformation: LONG, + pSddl: *mut BSTR, + ) -> HRESULT, + fn SetSecurityDescriptor( + sddl: BSTR, + flags: LONG, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9c86f320, 0xdee3, 0x4dd1, 0xb9, 0x72, 0xa3, 0x03, 0xf2, 0x6b, 0x06, 0x1e)] +interface IRegisteredTask(IRegisteredTaskVtbl): IDispatch(IDispatchVtbl) { + fn get_Name( + pName: *mut BSTR, + ) -> HRESULT, + fn get_Path( + pPath: *mut BSTR, + ) -> HRESULT, + fn get_State( + pState: *mut TASK_STATE, + ) -> HRESULT, + fn get_Enabled( + pEnabled: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_Enabled( + pEnabled: VARIANT_BOOL, + ) -> HRESULT, + fn Run( + params: VARIANT, + ppRunningTask: *mut *mut IRunningTask, + ) -> HRESULT, + fn RunEx( + params: VARIANT, + flags: LONG, + sessionID: LONG, + user: BSTR, + ppRunningTask: *mut *mut IRunningTask, + ) -> HRESULT, + fn GetInstances( + flags: LONG, + ppRunningTasks: *mut *mut IRunningTaskCollection, + ) -> HRESULT, + fn get_LastRunTime( + pLastRunTime: *mut DATE, + ) -> HRESULT, + fn get_LastTaskResult( + pLastTaskResult: *mut LONG, + ) -> HRESULT, + fn get_NumberOfMissedRuns( + pNumberOfMissedRuns: *mut LONG, + ) -> HRESULT, + fn get_NextRunTime( + pNextRunTime: *mut DATE, + ) -> HRESULT, + fn get_Definition( + ppDefinition: *mut *mut ITaskDefinition, + ) -> HRESULT, + fn get_Xml( + pXml: *mut BSTR, + ) -> HRESULT, + fn GetSecurityDescriptor( + securityInformation: LONG, + pSddl: *mut BSTR, + ) -> HRESULT, + fn SetSecurityDescriptor( + sddl: BSTR, + flags: LONG, + ) -> HRESULT, + fn Stop( + flags: LONG, + ) -> HRESULT, + fn GetRunTimes( + pstStart: *const SYSTEMTIME, + pstEnd: *const SYSTEMTIME, + pCount: *mut DWORD, + pRunTimes: *mut *mut SYSTEMTIME, + ) -> HRESULT, +}} +ENUM!{enum TASK_STATE { + TASK_STATE_UNKNOWN = 0, + TASK_STATE_DISABLED = 1, + TASK_STATE_QUEUED = 2, + TASK_STATE_READY = 3, + TASK_STATE_RUNNING = 4, +}} +RIDL!{#[uuid(0x653758fb, 0x7b9a, 0x4f1e, 0xa4, 0x71, 0xbe, 0xeb, 0x8e, 0x9b, 0x83, 0x4e)] +interface IRunningTask(IRunningTaskVtbl): IDispatch(IDispatchVtbl) { + fn get_Name( + pName: *mut BSTR, + ) -> HRESULT, + fn get_InstanceGuid( + pGuid: *mut BSTR, + ) -> HRESULT, + fn get_Path( + pPath: *mut BSTR, + ) -> HRESULT, + fn get_State( + pState: *mut TASK_STATE, + ) -> HRESULT, + fn get_CurrentAction( + pName: *mut BSTR, + ) -> HRESULT, + fn Stop() -> HRESULT, + fn Refresh() -> HRESULT, + fn get_EnginePID( + pPID: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6a67614b, 0x6828, 0x4fec, 0xaa, 0x54, 0x6d, 0x52, 0xe8, 0xf1, 0xf2, 0xdb)] +interface IRunningTaskCollection(IRunningTaskCollectionVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + pCount: *mut LONG, + ) -> HRESULT, + fn get_Item( + index: VARIANT, + ppRunningTask: *mut *mut IRunningTask, + ) -> HRESULT, + fn get__NewEnum( + ppEnum: *mut LPUNKNOWN, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf5bc8fc5, 0x536d, 0x4f77, 0xb8, 0x52, 0xfb, 0xc1, 0x35, 0x6f, 0xde, 0xb6)] +interface ITaskDefinition(ITaskDefinitionVtbl): IDispatch(IDispatchVtbl) { + fn get_RegistrationInfo( + ppRegistrationInfo: *mut *mut IRegistrationInfo, + ) -> HRESULT, + fn put_RegistrationInfo( + ppRegistrationInfo: *const IRegistrationInfo, + ) -> HRESULT, + fn get_Triggers( + ppTriggers: *mut *mut ITriggerCollection, + ) -> HRESULT, + fn put_Triggers( + ppTriggers: *const ITriggerCollection, + ) -> HRESULT, + fn get_Settings( + ppSettings: *mut *mut ITaskSettings, + ) -> HRESULT, + fn put_Settings( + ppSettings: *const ITaskSettings, + ) -> HRESULT, + fn get_Data( + pData: *mut BSTR, + ) -> HRESULT, + fn put_Data( + pData: BSTR, + ) -> HRESULT, + fn get_Principal( + ppPrincipal: *mut *mut IPrincipal, + ) -> HRESULT, + fn put_Principal( + ppPrincipal: *const IPrincipal, + ) -> HRESULT, + fn get_Actions( + ppActions: *mut *mut IActionCollection, + ) -> HRESULT, + fn put_Actions( + ppActions: *const IActionCollection, + ) -> HRESULT, + fn get_XmlText( + pXml: *mut BSTR, + ) -> HRESULT, + fn put_XmlText( + pXml: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x416d8b73, 0xcb41, 0x4ea1, 0x80, 0x5c, 0x9b, 0xe9, 0xa5, 0xac, 0x4a, 0x74)] +interface IRegistrationInfo(IRegistrationInfoVtbl): IDispatch(IDispatchVtbl) { + fn get_Description( + pDescription: *mut BSTR, + ) -> HRESULT, + fn put_Description( + pDescription: BSTR, + ) -> HRESULT, + fn get_Author( + pAuthor: *mut BSTR, + ) -> HRESULT, + fn put_Author( + pAuthor: BSTR, + ) -> HRESULT, + fn get_Version( + pVersion: *mut BSTR, + ) -> HRESULT, + fn put_Version( + pVersion: BSTR, + ) -> HRESULT, + fn get_Date( + pDate: *mut BSTR, + ) -> HRESULT, + fn put_Date( + pDate: BSTR, + ) -> HRESULT, + fn get_Documentation( + pDocumentation: *mut BSTR, + ) -> HRESULT, + fn put_Documentation( + pDocumentation: BSTR, + ) -> HRESULT, + fn get_XmlText( + pText: *mut BSTR, + ) -> HRESULT, + fn put_XmlText( + pText: BSTR, + ) -> HRESULT, + fn get_URI( + pUri: *mut BSTR, + ) -> HRESULT, + fn put_URI( + pUri: BSTR, + ) -> HRESULT, + fn get_SecurityDescriptor( + pSddl: *mut VARIANT, + ) -> HRESULT, + fn put_SecurityDescriptor( + pSddl: VARIANT, + ) -> HRESULT, + fn get_Source( + pSource: *mut BSTR, + ) -> HRESULT, + fn put_Source( + pSource: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x85df5081, 0x1b24, 0x4f32, 0x87, 0x8a, 0xd9, 0xd1, 0x4d, 0xf4, 0xcb, 0x77)] +interface ITriggerCollection(ITriggerCollectionVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + pCount: *mut c_long, + ) -> HRESULT, + fn get_Item( + index: c_long, + ppTrigger: *mut *mut ITrigger, + ) -> HRESULT, + fn get__NewEnum( + ppEnum: *mut LPUNKNOWN, + ) -> HRESULT, + fn Create( + Type: TASK_TRIGGER_TYPE2, + ppTrigger: *mut *mut ITrigger, + ) -> HRESULT, + fn Remove( + index: VARIANT, + ) -> HRESULT, + fn Clear() -> HRESULT, +}} +RIDL!{#[uuid(0x09941815, 0xea89, 0x4b5b, 0x89, 0xe0, 0x2a, 0x77, 0x38, 0x01, 0xfa, 0xc3)] +interface ITrigger(ITriggerVtbl): IDispatch(IDispatchVtbl) { + fn get_Type( + pType: *mut TASK_TRIGGER_TYPE2, + ) -> HRESULT, + fn get_Id( + pId: *mut BSTR, + ) -> HRESULT, + fn put_Id( + pId: BSTR, + ) -> HRESULT, + fn get_Repetition( + ppRepeat: *mut *mut IRepetitionPattern, + ) -> HRESULT, + fn put_Repetition( + ppRepeat: *const IRepetitionPattern, + ) -> HRESULT, + fn get_ExecutionTimeLimit( + pTimeLimit: *mut BSTR, + ) -> HRESULT, + fn put_ExecutionTimeLimit( + pTimeLimit: BSTR, + ) -> HRESULT, + fn get_StartBoundary( + pStart: *mut BSTR, + ) -> HRESULT, + fn put_StartBoundary( + pStart: BSTR, + ) -> HRESULT, + fn get_EndBoundary( + pEnd: *mut BSTR, + ) -> HRESULT, + fn put_EndBoundary( + pEnd: BSTR, + ) -> HRESULT, + fn get_Enabled( + pEnabled: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_Enabled( + pEnabled: VARIANT_BOOL, + ) -> HRESULT, +}} +ENUM!{enum TASK_TRIGGER_TYPE2 { + TASK_TRIGGER_EVENT = 0, + TASK_TRIGGER_TIME = 1, + TASK_TRIGGER_DAILY = 2, + TASK_TRIGGER_WEEKLY = 3, + TASK_TRIGGER_MONTHLY = 4, + TASK_TRIGGER_MONTHLYDOW = 5, + TASK_TRIGGER_IDLE = 6, + TASK_TRIGGER_REGISTRATION = 7, + TASK_TRIGGER_BOOT = 8, + TASK_TRIGGER_LOGON = 9, + TASK_TRIGGER_SESSION_STATE_CHANGE = 11, + TASK_TRIGGER_CUSTOM_TRIGGER_01 = 12, +}} +RIDL!{#[uuid(0x7fb9acf1, 0x26be, 0x400e, 0x85, 0xb5, 0x29, 0x4b, 0x9c, 0x75, 0xdf, 0xd6)] +interface IRepetitionPattern(IRepetitionPatternVtbl): IDispatch(IDispatchVtbl) { + fn get_Interval( + pInterval: *mut BSTR, + ) -> HRESULT, + fn put_Interval( + pInterval: BSTR, + ) -> HRESULT, + fn get_Duration( + pDuration: *mut BSTR, + ) -> HRESULT, + fn put_Duration( + pDuration: BSTR, + ) -> HRESULT, + fn get_StopAtDurationEnd( + pStop: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_StopAtDurationEnd( + pStop: VARIANT_BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8fd4711d, 0x2d02, 0x4c8c, 0x87, 0xe3, 0xef, 0xf6, 0x99, 0xde, 0x12, 0x7e)] +interface ITaskSettings(ITaskSettingsVtbl): IDispatch(IDispatchVtbl) { + fn get_AllowDemandStart( + pAllowDemandStart: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_AllowDemandStart( + pAllowDemandStart: VARIANT_BOOL, + ) -> HRESULT, + fn get_RestartInterval( + pRestartInterval: *mut BSTR, + ) -> HRESULT, + fn put_RestartInterval( + pRestartInterval: BSTR, + ) -> HRESULT, + fn get_RestartCount( + pRestartCount: *mut INT, + ) -> HRESULT, + fn put_RestartCount( + pRestartCount: INT, + ) -> HRESULT, + fn get_MultipleInstances( + pPolicy: *mut TASK_INSTANCES_POLICY, + ) -> HRESULT, + fn put_MultipleInstances( + pPolicy: TASK_INSTANCES_POLICY, + ) -> HRESULT, + fn get_StopIfGoingOnBatteries( + pStopIfOnBatteries: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_StopIfGoingOnBatteries( + pStopIfOnBatteries: VARIANT_BOOL, + ) -> HRESULT, + fn get_DisallowStartIfOnBatteries( + pDisallowStart: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_DisallowStartIfOnBatteries( + pDisallowStart: VARIANT_BOOL, + ) -> HRESULT, + fn get_AllowHardTerminate( + pAllowHardTerminate: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_AllowHardTerminate( + pAllowHardTerminate: VARIANT_BOOL, + ) -> HRESULT, + fn get_StartWhenAvailable( + pStartWhenAvailable: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_StartWhenAvailable( + pStartWhenAvailable: VARIANT_BOOL, + ) -> HRESULT, + fn get_XmlText( + pText: *mut BSTR, + ) -> HRESULT, + fn put_XmlText( + pText: BSTR, + ) -> HRESULT, + fn get_RunOnlyIfNetworkAvailable( + pRunOnlyIfNetworkAvailable: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_RunOnlyIfNetworkAvailable( + pRunOnlyIfNetworkAvailable: VARIANT_BOOL, + ) -> HRESULT, + fn get_ExecutionTimeLimit( + pExecutionTimeLimit: *mut BSTR, + ) -> HRESULT, + fn put_ExecutionTimeLimit( + pExecutionTimeLimit: BSTR, + ) -> HRESULT, + fn get_Enabled( + pEnabled: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_Enabled( + pEnabled: VARIANT_BOOL, + ) -> HRESULT, + fn get_DeleteExpiredTaskAfter( + pExpirationDelay: *mut BSTR, + ) -> HRESULT, + fn put_DeleteExpiredTaskAfter( + pExpirationDelay: BSTR, + ) -> HRESULT, + fn get_Priority( + pPriority: *mut INT, + ) -> HRESULT, + fn put_Priority( + pPriority: INT, + ) -> HRESULT, + fn get_Compatibility( + pCompatLevel: *mut TASK_COMPATIBILITY, + ) -> HRESULT, + fn put_Compatibility( + pCompatLevel: TASK_COMPATIBILITY, + ) -> HRESULT, + fn get_Hidden( + pHidden: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_Hidden( + pHidden: VARIANT_BOOL, + ) -> HRESULT, + fn get_IdleSettings( + ppIdleSettings: *mut *mut IIdleSettings, + ) -> HRESULT, + fn put_IdleSettings( + ppIdleSettings: *const IIdleSettings, + ) -> HRESULT, + fn get_RunOnlyIfIdle( + pRunOnlyIfIdle: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_RunOnlyIfIdle( + pRunOnlyIfIdle: VARIANT_BOOL, + ) -> HRESULT, + fn get_WakeToRun( + pWake: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_WakeToRun( + pWake: VARIANT_BOOL, + ) -> HRESULT, + fn get_NetworkSettings( + ppNetworkSettings: *mut *mut INetworkSettings, + ) -> HRESULT, + fn put_NetworkSettings( + ppNetworkSettings: *const INetworkSettings, + ) -> HRESULT, +}} +ENUM!{enum TASK_INSTANCES_POLICY { + TASK_INSTANCES_PARALLEL = 0, + TASK_INSTANCES_QUEUE = 1, + TASK_INSTANCES_IGNORE_NEW = 2, + TASK_INSTANCES_STOP_EXISTING = 3, +}} +ENUM!{enum TASK_COMPATIBILITY { + TASK_COMPATIBILITY_AT = 0, + TASK_COMPATIBILITY_V1 = 1, + TASK_COMPATIBILITY_V2 = 2, + TASK_COMPATIBILITY_V2_1 = 3, + TASK_COMPATIBILITY_V2_2 = 4, + TASK_COMPATIBILITY_V2_3 = 5, + TASK_COMPATIBILITY_V2_4 = 6, +}} +RIDL!{#[uuid(0x84594461, 0x0053, 0x4342, 0xa8, 0xfd, 0x08, 0x8f, 0xab, 0xf1, 0x1f, 0x32)] +interface IIdleSettings(IIdleSettingsVtbl): IDispatch(IDispatchVtbl) { + fn get_IdleDuration( + pDelay: *mut BSTR, + ) -> HRESULT, + fn put_IdleDuration( + pDelay: BSTR, + ) -> HRESULT, + fn get_WaitTimeout( + pTimeout: *mut BSTR, + ) -> HRESULT, + fn put_WaitTimeout( + pTimeout: BSTR, + ) -> HRESULT, + fn get_StopOnIdleEnd( + pStop: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_StopOnIdleEnd( + pStop: VARIANT_BOOL, + ) -> HRESULT, + fn get_RestartOnIdle( + pRestart: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_RestartOnIdle( + pRestart: VARIANT_BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9f7dea84, 0xc30b, 0x4245, 0x80, 0xb6, 0x00, 0xe9, 0xf6, 0x46, 0xf1, 0xb4)] +interface INetworkSettings(INetworkSettingsVtbl): IDispatch(IDispatchVtbl) { + fn get_Name( + pName: *mut BSTR, + ) -> HRESULT, + fn put_Name( + pName: BSTR, + ) -> HRESULT, + fn get_Id( + pId: *mut BSTR, + ) -> HRESULT, + fn put_Id( + pId: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd98d51e5, 0xc9b4, 0x496a, 0xa9, 0xc1, 0x18, 0x98, 0x02, 0x61, 0xcf, 0x0f)] +interface IPrincipal(IPrincipalVtbl): IDispatch(IDispatchVtbl) { + fn get_Id( + pId: *mut BSTR, + ) -> HRESULT, + fn put_Id( + pId: BSTR, + ) -> HRESULT, + fn get_DisplayName( + pName: *mut BSTR, + ) -> HRESULT, + fn put_DisplayName( + pName: BSTR, + ) -> HRESULT, + fn get_UserId( + pUser: *mut BSTR, + ) -> HRESULT, + fn put_UserId( + pUser: BSTR, + ) -> HRESULT, + fn get_LogonType( + pLogon: *mut TASK_LOGON_TYPE, + ) -> HRESULT, + fn put_LogonType( + pLogon: TASK_LOGON_TYPE, + ) -> HRESULT, + fn get_GroupId( + pGroup: *mut BSTR, + ) -> HRESULT, + fn put_GroupId( + pGroup: BSTR, + ) -> HRESULT, + fn get_RunLevel( + pRunLevel: *mut TASK_RUNLEVEL, + ) -> HRESULT, + fn put_RunLevel( + pRunLevel: TASK_RUNLEVEL, + ) -> HRESULT, +}} +ENUM!{enum TASK_LOGON_TYPE { + TASK_LOGON_NONE = 0, + TASK_LOGON_PASSWORD = 1, + TASK_LOGON_S4U = 2, + TASK_LOGON_INTERACTIVE_TOKEN = 3, + TASK_LOGON_GROUP = 4, + TASK_LOGON_SERVICE_ACCOUNT = 5, + TASK_LOGON_INTERACTIVE_TOKEN_OR_PASSWORD = 6, +}} +ENUM!{enum TASK_RUNLEVEL { + TASK_RUNLEVEL_LUA = 0, + TASK_RUNLEVEL_HIGHEST = 1, +}} +RIDL!{#[uuid(0x02820e19, 0x7b98, 0x4ed2, 0xb2, 0xe8, 0xfd, 0xcc, 0xce, 0xff, 0x61, 0x9b)] +interface IActionCollection(IActionCollectionVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + pCount: *mut c_long, + ) -> HRESULT, + fn get_Item( + index: c_long, + ppAction: *mut *mut IAction, + ) -> HRESULT, + fn get__NewEnum( + ppEnum: *mut LPUNKNOWN, + ) -> HRESULT, + fn get_XmlText( + pText: *mut BSTR, + ) -> HRESULT, + fn put_XmlText( + pText: BSTR, + ) -> HRESULT, + fn Create( + Type: TASK_ACTION_TYPE, + ppAction: *mut *mut IAction, + ) -> HRESULT, + fn Remove( + index: VARIANT, + ) -> HRESULT, + fn Clear() -> HRESULT, + fn get_Context( + pContext: *mut BSTR, + ) -> HRESULT, + fn put_Context( + pContext: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xbae54997, 0x48b1, 0x4cbe, 0x99, 0x65, 0xd6, 0xbe, 0x26, 0x3e, 0xbe, 0xa4)] +interface IAction(IActionVtbl): IDispatch(IDispatchVtbl) { + fn get_Id( + pId: *mut BSTR, + ) -> HRESULT, + fn put_Id( + pId: BSTR, + ) -> HRESULT, + fn get_Type( + pType: *mut TASK_ACTION_TYPE, + ) -> HRESULT, +}} +ENUM!{enum TASK_ACTION_TYPE { + TASK_ACTION_EXEC = 0, + TASK_ACTION_COM_HANDLER = 5, + TASK_ACTION_SEND_EMAIL = 6, + TASK_ACTION_SHOW_MESSAGE = 7, +}} +RIDL!{#[uuid(0x86627eb4, 0x42a7, 0x41e4, 0xa4, 0xd9, 0xac, 0x33, 0xa7, 0x2f, 0x2d, 0x52)] +interface IRegisteredTaskCollection(IRegisteredTaskCollectionVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + pCount: *mut LONG, + ) -> HRESULT, + fn get_Item( + index: VARIANT, + ppRegisteredTask: *mut *mut IRegisteredTask, + ) -> HRESULT, + fn get__NewEnum( + ppEnum: *mut LPUNKNOWN, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2faba4c7, 0x4da9, 0x4013, 0x96, 0x97, 0x20, 0xcc, 0x3f, 0xd4, 0x0f, 0x85)] +interface ITaskService(ITaskServiceVtbl): IDispatch(IDispatchVtbl) { + fn GetFolder( + Path: BSTR, + ppFolder: *mut *mut ITaskFolder, + ) -> HRESULT, + fn GetRunningTasks( + flags: LONG, + ppRunningTasks: *mut *mut IRunningTaskCollection, + ) -> HRESULT, + fn NewTask( + flags: DWORD, + ppDefinition: *mut *mut ITaskDefinition, + ) -> HRESULT, + fn Connect( + serverName: VARIANT, + user: VARIANT, + domain: VARIANT, + password: VARIANT, + ) -> HRESULT, + fn get_Connected( + pConnected: *mut VARIANT_BOOL, + ) -> HRESULT, + fn get_TargetServer( + pServer: *mut BSTR, + ) -> HRESULT, + fn get_ConnectedUser( + pUser: *mut BSTR, + ) -> HRESULT, + fn get_ConnectedDomain( + pDomain: *mut BSTR, + ) -> HRESULT, + fn get_HighestVersion( + pVersion: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x839d7762, 0x5121, 0x4009, 0x92, 0x34, 0x4f, 0x0d, 0x19, 0x39, 0x4f, 0x04)] +interface ITaskHandler(ITaskHandlerVtbl): IUnknown(IUnknownVtbl) { + fn Start( + pHandlerServices: LPUNKNOWN, + Data: BSTR, + ) -> HRESULT, + fn Stop( + pRetCode: *mut HRESULT, + ) -> HRESULT, + fn Pause() -> HRESULT, + fn Resume() -> HRESULT, +}} +RIDL!{#[uuid(0xeaec7a8f, 0x27a0, 0x4ddc, 0x86, 0x75, 0x14, 0x72, 0x6a, 0x01, 0xa3, 0x8a)] +interface ITaskHandlerStatus(ITaskHandlerStatusVtbl): IUnknown(IUnknownVtbl) { + fn UpdateStatus( + percentComplete: c_short, + statusMessage: BSTR, + ) -> HRESULT, + fn TaskCompleted( + taskErrCode: HRESULT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3e4c9351, 0xd966, 0x4b8b, 0xbb, 0x87, 0xce, 0xba, 0x68, 0xbb, 0x01, 0x07)] +interface ITaskVariables(ITaskVariablesVtbl): IUnknown(IUnknownVtbl) { + fn GetInput( + pInput: *mut BSTR, + ) -> HRESULT, + fn SetOutput( + input: BSTR, + ) -> HRESULT, + fn GetContext( + pContext: *mut BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x39038068, 0x2b46, 0x4afd, 0x86, 0x62, 0x7b, 0xb6, 0xf8, 0x68, 0xd2, 0x21)] +interface ITaskNamedValuePair(ITaskNamedValuePairVtbl): IDispatch(IDispatchVtbl) { + fn get_Name( + pName: *mut BSTR, + ) -> HRESULT, + fn put_Name( + pName: BSTR, + ) -> HRESULT, + fn get_Value( + pValue: *mut BSTR, + ) -> HRESULT, + fn put_Value( + pValue: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb4ef826b, 0x63c3, 0x46e4, 0xa5, 0x04, 0xef, 0x69, 0xe4, 0xf7, 0xea, 0x4d)] +interface ITaskNamedValueCollection(ITaskNamedValueCollectionVtbl): IDispatch(IDispatchVtbl) { + fn get_Count( + pCount: *mut c_long, + ) -> HRESULT, + fn get_Item( + index: LONG, + ppPair: *mut *mut ITaskNamedValuePair, + ) -> HRESULT, + fn get__NewEnum( + ppEnum: *mut LPUNKNOWN, + ) -> HRESULT, + fn Create( + Name: BSTR, + Value: BSTR, + ppPair: *mut *mut ITaskNamedValuePair, + ) -> HRESULT, + fn Remove( + index: LONG, + ) -> HRESULT, + fn Clear() -> HRESULT, +}} +RIDL!{#[uuid(0xd537d2b0, 0x9fb3, 0x4d34, 0x97, 0x39, 0x1f, 0xf5, 0xce, 0x7b, 0x1e, 0xf3)] +interface IIdleTrigger(IIdleTriggerVtbl): ITrigger(ITriggerVtbl) {}} +RIDL!{#[uuid(0x72dade38, 0xfae4, 0x4b3e, 0xba, 0xf4, 0x5d, 0x00, 0x9a, 0xf0, 0x2b, 0x1c)] +interface ILogonTrigger(ILogonTriggerVtbl): ITrigger(ITriggerVtbl) { + fn get_Delay( + pDelay: *mut BSTR, + ) -> HRESULT, + fn put_Delay( + pDelay: BSTR, + ) -> HRESULT, + fn get_UserId( + pUser: *mut BSTR, + ) -> HRESULT, + fn put_UserId( + pUser: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x754da71b, 0x4385, 0x4475, 0x9d, 0xd9, 0x59, 0x82, 0x94, 0xfa, 0x36, 0x41)] +interface ISessionStateChangeTrigger(ISessionStateChangeTriggerVtbl): ITrigger(ITriggerVtbl) { + fn get_Delay( + pDelay: *mut BSTR, + ) -> HRESULT, + fn put_Delay( + pDelay: BSTR, + ) -> HRESULT, + fn get_UserId( + pUser: *mut BSTR, + ) -> HRESULT, + fn put_UserId( + pUser: BSTR, + ) -> HRESULT, + fn get_StateChange( + pType: *mut TASK_SESSION_STATE_CHANGE_TYPE, + ) -> HRESULT, + fn put_StateChange( + pType: TASK_SESSION_STATE_CHANGE_TYPE, + ) -> HRESULT, +}} +ENUM!{enum TASK_SESSION_STATE_CHANGE_TYPE { + TASK_CONSOLE_CONNECT = 1, + TASK_CONSOLE_DISCONNECT = 2, + TASK_REMOTE_CONNECT = 3, + TASK_REMOTE_DISCONNECT = 4, + TASK_SESSION_LOCK = 7, + TASK_SESSION_UNLOCK = 8, +}} +RIDL!{#[uuid(0xd45b0167, 0x9653, 0x4eef, 0xb9, 0x4f, 0x07, 0x32, 0xca, 0x7a, 0xf2, 0x51)] +interface IEventTrigger(IEventTriggerVtbl): ITrigger(ITriggerVtbl) { + fn get_Subscription( + pQuery: *mut BSTR, + ) -> HRESULT, + fn put_Subscription( + pQuery: BSTR, + ) -> HRESULT, + fn get_Delay( + pDelay: *mut BSTR, + ) -> HRESULT, + fn put_Delay( + pDelay: BSTR, + ) -> HRESULT, + fn get_ValueQueries( + ppNamedXPaths: *mut *mut ITaskNamedValueCollection, + ) -> HRESULT, + fn put_ValueQueries( + ppNamedXPaths: *const ITaskNamedValueCollection, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb45747e0, 0xeba7, 0x4276, 0x9f, 0x29, 0x85, 0xc5, 0xbb, 0x30, 0x00, 0x06)] +interface ITimeTrigger(ITimeTriggerVtbl): ITrigger(ITriggerVtbl) { + fn get_RandomDelay( + pRandomDelay: *mut BSTR, + ) -> HRESULT, + fn put_RandomDelay( + pRandomDelay: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x126c5cd8, 0xb288, 0x41d5, 0x8d, 0xbf, 0xe4, 0x91, 0x44, 0x6a, 0xdc, 0x5c)] +interface IDailyTrigger(IDailyTriggerVtbl): ITrigger(ITriggerVtbl) { + fn get_DaysInterval( + pDays: *mut c_short, + ) -> HRESULT, + fn put_DaysInterval( + pDays: c_short, + ) -> HRESULT, + fn get_RandomDelay( + pRandomDelay: *mut BSTR, + ) -> HRESULT, + fn put_RandomDelay( + pRandomDelay: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5038fc98, 0x82ff, 0x436d, 0x87, 0x28, 0xa5, 0x12, 0xa5, 0x7c, 0x9d, 0xc1)] +interface IWeeklyTrigger(IWeeklyTriggerVtbl): ITrigger(ITriggerVtbl) { + fn get_DaysOfWeek( + pDays: *mut c_short, + ) -> HRESULT, + fn put_DaysOfWeek( + pDays: c_short, + ) -> HRESULT, + fn get_WeeksInterval( + pWeeks: *mut c_short, + ) -> HRESULT, + fn put_WeeksInterval( + pWeeks: c_short, + ) -> HRESULT, + fn get_RandomDelay( + pRandomDelay: *mut BSTR, + ) -> HRESULT, + fn put_RandomDelay( + pRandomDelay: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x97c45ef1, 0x6b02, 0x4a1a, 0x9c, 0x0e, 0x1e, 0xbf, 0xba, 0x15, 0x00, 0xac)] +interface IMonthlyTrigger(IMonthlyTriggerVtbl): ITrigger(ITriggerVtbl) { + fn get_DaysOfMonth( + pDays: *mut c_long, + ) -> HRESULT, + fn put_DaysOfMonth( + pDays: c_long, + ) -> HRESULT, + fn get_MonthsOfYear( + pMonths: *mut c_short, + ) -> HRESULT, + fn put_MonthsOfYear( + pMonths: c_short, + ) -> HRESULT, + fn get_RunOnLastDayOfMonth( + pLastDay: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_RunOnLastDayOfMonth( + pLastDay: VARIANT_BOOL, + ) -> HRESULT, + fn get_RandomDelay( + pRandomDelay: *mut BSTR, + ) -> HRESULT, + fn put_RandomDelay( + pRandomDelay: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x77d025a3, 0x90fa, 0x43aa, 0xb5, 0x2e, 0xcd, 0xa5, 0x49, 0x9b, 0x94, 0x6a)] +interface IMonthlyDOWTrigger(IMonthlyDOWTriggerVtbl): ITrigger(ITriggerVtbl) { + fn get_DaysOfWeek( + pDays: *mut c_short, + ) -> HRESULT, + fn put_DaysOfWeek( + pDays: c_short, + ) -> HRESULT, + fn get_WeeksOfMonth( + pWeeks: *mut c_short, + ) -> HRESULT, + fn put_WeeksOfMonth( + pWeeks: c_short, + ) -> HRESULT, + fn get_MonthsOfYear( + pMonths: *mut c_short, + ) -> HRESULT, + fn put_MonthsOfYear( + pMonths: c_short, + ) -> HRESULT, + fn get_RunOnLastWeekOfMonth( + pLastWeek: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_RunOnLastWeekOfMonth( + pLastWeek: VARIANT_BOOL, + ) -> HRESULT, + fn get_RandomDelay( + pRandomDelay: *mut BSTR, + ) -> HRESULT, + fn put_RandomDelay( + pRandomDelay: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2a9c35da, 0xd357, 0x41f4, 0xbb, 0xc1, 0x20, 0x7a, 0xc1, 0xb1, 0xf3, 0xcb)] +interface IBootTrigger(IBootTriggerVtbl): ITrigger(ITriggerVtbl) { + fn get_Delay( + pDelay: *mut BSTR, + ) -> HRESULT, + fn put_Delay( + pDelay: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4c8fec3a, 0xc218, 0x4e0c, 0xb2, 0x3d, 0x62, 0x90, 0x24, 0xdb, 0x91, 0xa2)] +interface IRegistrationTrigger(IRegistrationTriggerVtbl): ITrigger(ITriggerVtbl) { + fn get_Delay( + pDelay: *mut BSTR, + ) -> HRESULT, + fn put_Delay( + pDelay: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4c3d624d, 0xfd6b, 0x49a3, 0xb9, 0xb7, 0x09, 0xcb, 0x3c, 0xd3, 0xf0, 0x47)] +interface IExecAction(IExecActionVtbl): IAction(IActionVtbl) { + fn get_Path( + pPath: *mut BSTR, + ) -> HRESULT, + fn put_Path( + pPath: BSTR, + ) -> HRESULT, + fn get_Arguments( + pArgument: *mut BSTR, + ) -> HRESULT, + fn put_Arguments( + pArgument: BSTR, + ) -> HRESULT, + fn get_WorkingDirectory( + pWorkingDirectory: *mut BSTR, + ) -> HRESULT, + fn put_WorkingDirectory( + pWorkingDirectory: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf2a82542, 0xbda5, 0x4e6b, 0x91, 0x43, 0xe2, 0xbf, 0x4f, 0x89, 0x87, 0xb6)] +interface IExecAction2(IExecAction2Vtbl): IExecAction(IExecActionVtbl) { + fn get_HideAppWindow( + pHideAppWindow: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_HideAppWindow( + pHideAppWindow: VARIANT_BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x505e9e68, 0xaf89, 0x46b8, 0xa3, 0x0f, 0x56, 0x16, 0x2a, 0x83, 0xd5, 0x37)] +interface IShowMessageAction(IShowMessageActionVtbl): IAction(IActionVtbl) { + fn get_Title( + pTitle: *mut BSTR, + ) -> HRESULT, + fn put_Title( + pTitle: BSTR, + ) -> HRESULT, + fn get_MessageBody( + pMessageBody: *mut BSTR, + ) -> HRESULT, + fn put_MessageBody( + pMessageBody: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x6d2fd252, 0x75c5, 0x4f66, 0x90, 0xba, 0x2a, 0x7d, 0x8c, 0xc3, 0x03, 0x9f)] +interface IComHandlerAction(IComHandlerActionVtbl): IAction(IActionVtbl) { + fn get_ClassId( + pClsid: *mut BSTR, + ) -> HRESULT, + fn put_ClassId( + pClsid: BSTR, + ) -> HRESULT, + fn get_Data( + pData: *mut BSTR, + ) -> HRESULT, + fn put_Data( + pData: BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x10f62c64, 0x7e16, 0x4314, 0xa0, 0xc2, 0x0c, 0x36, 0x83, 0xf9, 0x9d, 0x40)] +interface IEmailAction(IEmailActionVtbl): IAction(IActionVtbl) { + fn get_Server( + pServer: *mut BSTR, + ) -> HRESULT, + fn put_Server( + pServer: BSTR, + ) -> HRESULT, + fn get_Subject( + pSubject: *mut BSTR, + ) -> HRESULT, + fn put_Subject( + pSubject: BSTR, + ) -> HRESULT, + fn get_To( + pTo: *mut BSTR, + ) -> HRESULT, + fn put_To( + pTo: BSTR, + ) -> HRESULT, + fn get_Cc( + pCc: *mut BSTR, + ) -> HRESULT, + fn put_Cc( + pCc: BSTR, + ) -> HRESULT, + fn get_Bcc( + pBcc: *mut BSTR, + ) -> HRESULT, + fn put_Bcc( + pBcc: BSTR, + ) -> HRESULT, + fn get_ReplyTo( + pReplyTo: *mut BSTR, + ) -> HRESULT, + fn put_ReplyTo( + pReplyTo: BSTR, + ) -> HRESULT, + fn get_From( + pFrom: *mut BSTR, + ) -> HRESULT, + fn put_From( + pFrom: BSTR, + ) -> HRESULT, + fn get_HeaderFields( + ppHeaderFields: *mut *mut ITaskNamedValueCollection, + ) -> HRESULT, + fn put_HeaderFields( + ppHeaderFields: *const ITaskNamedValueCollection, + ) -> HRESULT, + fn get_Body( + pBody: *mut BSTR, + ) -> HRESULT, + fn put_Body( + pBody: BSTR, + ) -> HRESULT, + fn get_Attachments( + pAttachements: *mut SAFEARRAY, + ) -> HRESULT, + fn put_Attachments( + pAttachements: SAFEARRAY, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x248919ae, 0xe345, 0x4a6d, 0x8a, 0xeb, 0xe0, 0xd3, 0x16, 0x5c, 0x90, 0x4e)] +interface IPrincipal2(IPrincipal2Vtbl): IDispatch(IDispatchVtbl) { + fn get_ProcessTokenSidType( + pProcessTokenSidType: *mut TASK_PROCESSTOKENSID, + ) -> HRESULT, + fn put_ProcessTokenSidType( + pProcessTokenSidType: TASK_PROCESSTOKENSID, + ) -> HRESULT, + fn get_RequiredPrivilegeCount( + pCount: *mut c_long, + ) -> HRESULT, + fn get_RequiredPrivilege( + index: c_long, + pPrivilege: *mut BSTR, + ) -> HRESULT, + fn AddRequiredPrivilege( + privilege: BSTR, + ) -> HRESULT, +}} +ENUM!{enum TASK_PROCESSTOKENSID { + TASK_PROCESSTOKENSID_NONE = 0, + TASK_PROCESSTOKENSID_UNRESTRICTED = 1, + TASK_PROCESSTOKENSID_DEFAULT = 2, +}} +RIDL!{#[uuid(0x2c05c3f0, 0x6eed, 0x4c05, 0xa1, 0x5f, 0xed, 0x7d, 0x7a, 0x98, 0xa3, 0x69)] +interface ITaskSettings2(ITaskSettings2Vtbl): IDispatch(IDispatchVtbl) { + fn get_DisallowStartOnRemoteAppSession( + pDisallowStart: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_DisallowStartOnRemoteAppSession( + pDisallowStart: VARIANT_BOOL, + ) -> HRESULT, + fn get_UseUnifiedSchedulingEngine( + pUseUnifiedEngine: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_UseUnifiedSchedulingEngine( + pUseUnifiedEngine: VARIANT_BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0ad9d0d7, 0x0c7f, 0x4ebb, 0x9a, 0x5f, 0xd1, 0xc6, 0x48, 0xdc, 0xa5, 0x28)] +interface ITaskSettings3(ITaskSettings3Vtbl): ITaskSettings(ITaskSettingsVtbl) { + fn get_DisallowStartOnRemoteAppSession( + pDisallowStart: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_DisallowStartOnRemoteAppSession( + pDisallowStart: VARIANT_BOOL, + ) -> HRESULT, + fn get_UseUnifiedSchedulingEngine( + pUseUnifiedEngine: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_UseUnifiedSchedulingEngine( + pUseUnifiedEngine: VARIANT_BOOL, + ) -> HRESULT, + fn get_MaintenanceSettings( + ppMaintenanceSettings: *mut *mut IMaintenanceSettings, + ) -> HRESULT, + fn put_MaintenanceSettings( + ppMaintenanceSettings: *const IMaintenanceSettings, + ) -> HRESULT, + fn CreateMaintenanceSettings( + ppMaintenanceSettings: *mut *mut IMaintenanceSettings, + ) -> HRESULT, + fn get_Volatile( + pVolatile: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_Volatile( + pVolatile: VARIANT_BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa6024fa8, 0x9652, 0x4adb, 0xa6, 0xbf, 0x5c, 0xfc, 0xd8, 0x77, 0xa7, 0xba)] +interface IMaintenanceSettings(IMaintenanceSettingsVtbl): IDispatch(IDispatchVtbl) { + fn put_Period( + target: BSTR, + ) -> HRESULT, + fn get_Period( + target: *mut BSTR, + ) -> HRESULT, + fn put_Deadline( + target: BSTR, + ) -> HRESULT, + fn get_Deadline( + target: *mut BSTR, + ) -> HRESULT, + fn put_Exclusive( + target: VARIANT_BOOL, + ) -> HRESULT, + fn get_Exclusive( + target: *mut VARIANT_BOOL, + ) -> HRESULT, +}} +ENUM!{enum TASK_RUN_FLAGS { + TASK_RUN_NO_FLAGS = 0, + TASK_RUN_AS_SELF = 1, + TASK_RUN_IGNORE_CONSTRAINTS = 2, + TASK_RUN_USE_SESSION_ID = 4, + TASK_RUN_USER_SID = 8, +}} +ENUM!{enum TASK_ENUM_FLAGS { + TASK_ENUM_HIDDEN = 1, +}} +ENUM!{enum TASK_CREATION { + TASK_VALIDATE_ONLY = 1, + TASK_CREATE = 2, + TASK_UPDATE = 4, + TASK_CREATE_OR_UPDATE = 6, + TASK_DISABLE = 8, + TASK_DONT_ADD_PRINCIPAL_ACE = 16, + TASK_IGNORE_REGISTRATION_TRIGGERS = 32, +}} diff --git a/bash-5.1/vendor/winapi/src/um/textstor.rs b/bash-5.1/vendor/winapi/src/um/textstor.rs new file mode 100644 index 0000000000000000000000000000000000000000..7e2d60218d9f29d139d66cabc9f1dcb46afb1e38 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/textstor.rs @@ -0,0 +1,11 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +DEFINE_GUID!{GUID_TS_SERVICE_DATAOBJECT, + 0x6086fbb5, 0xe225, 0x46ce, 0xa7, 0x70, 0xc1, 0xbb, 0xd3, 0xe0, 0x5d, 0x7b} +DEFINE_GUID!{GUID_TS_SERVICE_ACCESSIBLE, + 0xf9786200, 0xa5bf, 0x4a0f, 0x8c, 0x24, 0xfb, 0x16, 0xf5, 0xd1, 0xaa, 0xbb} +DEFINE_GUID!{GUID_TS_SERVICE_ACTIVEX, + 0xea937a50, 0xc9a6, 0x4b7d, 0x89, 0x4a, 0x49, 0xd9, 0x9b, 0x78, 0x48, 0x34} diff --git a/bash-5.1/vendor/winapi/src/um/threadpoolapiset.rs b/bash-5.1/vendor/winapi/src/um/threadpoolapiset.rs new file mode 100644 index 0000000000000000000000000000000000000000..13a1e7a40e0846350b90f9a34e771599b7e9be45 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/threadpoolapiset.rs @@ -0,0 +1,171 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-core-threadpool-l1. +use shared::basetsd::ULONG_PTR; +use shared::minwindef::{BOOL, DWORD, HMODULE, PFILETIME, ULONG}; +use um::minwinbase::PCRITICAL_SECTION; +use um::winnt::{ + HANDLE, PTP_CALLBACK_ENVIRON, PTP_CALLBACK_INSTANCE, PTP_CLEANUP_GROUP, PTP_IO, PTP_POOL, + PTP_POOL_STACK_INFORMATION, PTP_SIMPLE_CALLBACK, PTP_TIMER, PTP_TIMER_CALLBACK, PTP_WAIT, + PTP_WAIT_CALLBACK, PTP_WORK, PTP_WORK_CALLBACK, PVOID, +}; +FN!{stdcall PTP_WIN32_IO_CALLBACK( + Instance: PTP_CALLBACK_INSTANCE, + Context: PVOID, + Overlapped: PVOID, + IoResult: ULONG, + NumberOfBytesTransferred: ULONG_PTR, + Io: PTP_IO, +) -> ()} +extern "system" { + pub fn CreateThreadpool( + reserved: PVOID, + ) -> PTP_POOL; + pub fn SetThreadpoolThreadMaximum( + ptpp: PTP_POOL, + cthrdMost: DWORD, + ) -> (); + pub fn SetThreadpoolThreadMinimum( + ptpp: PTP_POOL, + cthrdMic: DWORD, + ) -> BOOL; + pub fn SetThreadpoolStackInformation( + ptpp: PTP_POOL, + ptpsi: PTP_POOL_STACK_INFORMATION, + ) -> BOOL; + pub fn QueryThreadpoolStackInformation( + ptpp: PTP_POOL, + ptpsi: PTP_POOL_STACK_INFORMATION, + ) -> BOOL; + pub fn CloseThreadpool( + ptpp: PTP_POOL, + ) -> (); + pub fn CreateThreadpoolCleanupGroup() -> PTP_CLEANUP_GROUP; + pub fn CloseThreadpoolCleanupGroupMembers( + ptpcg: PTP_CLEANUP_GROUP, + fCancelPendingCallbacks: BOOL, + pvCleanupContext: PVOID, + ) -> (); + pub fn CloseThreadpoolCleanupGroup( + ptpcg: PTP_CLEANUP_GROUP, + ) -> (); + pub fn SetEventWhenCallbackReturns( + pci: PTP_CALLBACK_INSTANCE, + evt: HANDLE, + ) -> (); + pub fn ReleaseSemaphoreWhenCallbackReturns( + pci: PTP_CALLBACK_INSTANCE, + sem: HANDLE, + crel: DWORD, + ) -> (); + pub fn ReleaseMutexWhenCallbackReturns( + pci: PTP_CALLBACK_INSTANCE, + mut_: HANDLE, + ) -> (); + pub fn LeaveCriticalSectionWhenCallbackReturns( + pci: PTP_CALLBACK_INSTANCE, + pcs: PCRITICAL_SECTION, + ) -> (); + pub fn FreeLibraryWhenCallbackReturns( + pci: PTP_CALLBACK_INSTANCE, + mod_: HMODULE, + ) -> (); + pub fn CallbackMayRunLong( + pci: PTP_CALLBACK_INSTANCE, + ) -> BOOL; + pub fn DisassociateCurrentThreadFromCallback( + pci: PTP_CALLBACK_INSTANCE, + ) -> (); + pub fn TrySubmitThreadpoolCallback( + pfns: PTP_SIMPLE_CALLBACK, + pv: PVOID, + pcbe: PTP_CALLBACK_ENVIRON, + ) -> BOOL; + pub fn CreateThreadpoolWork( + pfnwk: PTP_WORK_CALLBACK, + pv: PVOID, + pcbe: PTP_CALLBACK_ENVIRON, + ) -> PTP_WORK; + pub fn SubmitThreadpoolWork( + pwk: PTP_WORK, + ) -> (); + pub fn WaitForThreadpoolWorkCallbacks( + pwk: PTP_WORK, + fCancelPendingCallbacks: BOOL, + ) -> (); + pub fn CloseThreadpoolWork( + pwk: PTP_WORK, + ) -> (); + pub fn CreateThreadpoolTimer( + pfnti: PTP_TIMER_CALLBACK, + pv: PVOID, + pcbe: PTP_CALLBACK_ENVIRON, + ) -> PTP_TIMER; + pub fn SetThreadpoolTimer( + pti: PTP_TIMER, + pftDueTime: PFILETIME, + msPeriod: DWORD, + msWindowLength: DWORD, + ) -> (); + pub fn IsThreadpoolTimerSet( + pti: PTP_TIMER, + ) -> BOOL; + pub fn WaitForThreadpoolTimerCallbacks( + pti: PTP_TIMER, + fCancelPendingCallbacks: BOOL, + ) -> (); + pub fn CloseThreadpoolTimer( + pti: PTP_TIMER, + ) -> (); + pub fn CreateThreadpoolWait( + pfnwa: PTP_WAIT_CALLBACK, + pv: PVOID, + pcbe: PTP_CALLBACK_ENVIRON, + ) -> PTP_WAIT; + pub fn SetThreadpoolWait( + pwa: PTP_WAIT, + h: HANDLE, + pftTimeout: PFILETIME, + ) -> (); + pub fn WaitForThreadpoolWaitCallbacks( + pwa: PTP_WAIT, + fCancelPendingCallbacks: BOOL, + ) -> (); + pub fn CloseThreadpoolWait( + pwa: PTP_WAIT, + ) -> (); + pub fn CreateThreadpoolIo( + fl: HANDLE, + pfnio: PTP_WIN32_IO_CALLBACK, + pv: PVOID, + pcbe: PTP_CALLBACK_ENVIRON, + ) -> PTP_IO; + pub fn StartThreadpoolIo( + pio: PTP_IO, + ) -> (); + pub fn CancelThreadpoolIo( + pio: PTP_IO, + ) -> (); + pub fn WaitForThreadpoolIoCallbacks( + pio: PTP_IO, + fCancelPendingCallbacks: BOOL, + ) -> (); + pub fn CloseThreadpoolIo( + pio: PTP_IO, + ) -> (); + pub fn SetThreadpoolTimerEx( + pti: PTP_TIMER, + pftDueTime: PFILETIME, + msPeriod: DWORD, + msWindowLength: DWORD, + ) -> BOOL; + pub fn SetThreadpoolWaitEx( + pwa: PTP_WAIT, + h: HANDLE, + pftTimeout: PFILETIME, + Reserved: PVOID, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/threadpoollegacyapiset.rs b/bash-5.1/vendor/winapi/src/um/threadpoollegacyapiset.rs new file mode 100644 index 0000000000000000000000000000000000000000..dc306c4e403bf565feb1817858cc2893466d38c1 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/threadpoollegacyapiset.rs @@ -0,0 +1,44 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, DWORD, ULONG}; +use um::minwinbase::LPTHREAD_START_ROUTINE; +use um::winnt::{HANDLE, PHANDLE, PVOID, WAITORTIMERCALLBACK}; +extern "system" { + pub fn QueueUserWorkItem( + Function: LPTHREAD_START_ROUTINE, + Context: PVOID, + Flags: ULONG, + ) -> BOOL; + pub fn UnregisterWaitEx( + WaitHandle: HANDLE, + CompletionEvent: HANDLE, + ) -> BOOL; + pub fn CreateTimerQueue() -> HANDLE; + pub fn CreateTimerQueueTimer( + phNewTimer: PHANDLE, + TimerQueue: HANDLE, + Callback: WAITORTIMERCALLBACK, + Parameter: PVOID, + DueTime: DWORD, + Period: DWORD, + Flags: ULONG, + ) -> BOOL; + pub fn ChangeTimerQueueTimer( + TimerQueue: HANDLE, + Timer: HANDLE, + DueTime: ULONG, + Period: ULONG, + ) -> BOOL; + pub fn DeleteTimerQueueTimer( + TimerQueue: HANDLE, + Timer: HANDLE, + CompletionEvent: HANDLE, + ) -> BOOL; + pub fn DeleteTimerQueueEx( + TimerQueue: HANDLE, + CompletionEvent: HANDLE, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/timeapi.rs b/bash-5.1/vendor/winapi/src/um/timeapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..dae647067e33bce85a42a91949c934a8352c0a96 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/timeapi.rs @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{DWORD, UINT}; +use um::mmsystem::{LPTIMECAPS, MMRESULT}; +extern "system" { + pub fn timeGetTime() -> DWORD; + pub fn timeGetDevCaps( + ptc: LPTIMECAPS, + cbtc: UINT, + ) -> MMRESULT; + pub fn timeBeginPeriod( + uPeriod: UINT, + ) -> MMRESULT; + pub fn timeEndPeriod( + uPeriod: UINT, + ) -> MMRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/timezoneapi.rs b/bash-5.1/vendor/winapi/src/um/timezoneapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..b7d99f7788f7c92ff9b53bbd9c809924d332c02b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/timezoneapi.rs @@ -0,0 +1,89 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! ApiSet Contract for api-ms-win-core-timezone-l1 +use shared::minwindef::{BOOL, DWORD, FILETIME, LPDWORD, LPFILETIME, USHORT}; +use um::minwinbase::{LPSYSTEMTIME, SYSTEMTIME}; +use um::winnt::{BOOLEAN, LONG, WCHAR}; +pub const TIME_ZONE_ID_INVALID: DWORD = 0xFFFFFFFF; +STRUCT!{struct TIME_ZONE_INFORMATION { + Bias: LONG, + StandardName: [WCHAR; 32], + StandardDate: SYSTEMTIME, + StandardBias: LONG, + DaylightName: [WCHAR; 32], + DaylightDate: SYSTEMTIME, + DaylightBias: LONG, +}} +pub type PTIME_ZONE_INFORMATION = *mut TIME_ZONE_INFORMATION; +pub type LPTIME_ZONE_INFORMATION = *mut TIME_ZONE_INFORMATION; +STRUCT!{struct DYNAMIC_TIME_ZONE_INFORMATION { + Bias: LONG, + StandardName: [WCHAR; 32], + StandardDate: SYSTEMTIME, + StandardBias: LONG, + DaylightName: [WCHAR; 32], + DaylightDate: SYSTEMTIME, + DaylightBias: LONG, + TimeZoneKeyName: [WCHAR; 128], + DynamicDaylightTimeDisabled: BOOLEAN, +}} +pub type PDYNAMIC_TIME_ZONE_INFORMATION = *mut DYNAMIC_TIME_ZONE_INFORMATION; +extern "system" { + pub fn SystemTimeToTzSpecificLocalTime( + lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, + lpUniversalTime: *const SYSTEMTIME, + lpLocalTime: LPSYSTEMTIME, + ) -> BOOL; + pub fn TzSpecificLocalTimeToSystemTime( + lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, + lpLocalTime: *const SYSTEMTIME, + lpUniversalTime: LPSYSTEMTIME, + ) -> BOOL; + pub fn FileTimeToSystemTime( + lpFileTime: *const FILETIME, + lpSystemTime: LPSYSTEMTIME, + ) -> BOOL; + pub fn SystemTimeToFileTime( + lpSystemTime: *const SYSTEMTIME, + lpFileTime: LPFILETIME, + ) -> BOOL; + pub fn GetTimeZoneInformation( + lpTimeZoneInformation: LPTIME_ZONE_INFORMATION, + ) -> DWORD; + pub fn SetTimeZoneInformation( + lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, + ) -> BOOL; + pub fn SetDynamicTimeZoneInformation( + lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, + ) -> BOOL; + pub fn GetDynamicTimeZoneInformation( + pTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, + ) -> DWORD; + pub fn GetTimeZoneInformationForYear( + wYear: USHORT, + pdtzi: PDYNAMIC_TIME_ZONE_INFORMATION, + ptzi: LPTIME_ZONE_INFORMATION, + ) -> BOOL; + pub fn EnumDynamicTimeZoneInformation( + dwIndex: DWORD, + lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, + ) -> DWORD; + pub fn GetDynamicTimeZoneInformationEffectiveYears( + lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, + FirstYear: LPDWORD, + LastYear: LPDWORD, + ) -> DWORD; + pub fn SystemTimeToTzSpecificLocalTimeEx( + lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, + lpUniversalTime: *const SYSTEMTIME, + lpLocalTime: LPSYSTEMTIME, + ) -> BOOL; + pub fn TzSpecificLocalTimeToSystemTimeEx( + lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, + lpLocalTime: *const SYSTEMTIME, + lpUniversalTime: LPSYSTEMTIME, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/tlhelp32.rs b/bash-5.1/vendor/winapi/src/um/tlhelp32.rs new file mode 100644 index 0000000000000000000000000000000000000000..5900ab6e41042674c98c9f5045935041d637b6be --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/tlhelp32.rs @@ -0,0 +1,194 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! WIN32 tool help functions, types, and definitions +use shared::basetsd::{SIZE_T, ULONG_PTR}; +use shared::minwindef::{BOOL, BYTE, DWORD, HMODULE, LPCVOID, LPVOID, MAX_PATH}; +use um::winnt::{CHAR, HANDLE, LONG, WCHAR}; +pub const MAX_MODULE_NAME32: usize = 255; +extern "system" { + pub fn CreateToolhelp32Snapshot( + dwFlags: DWORD, + th32ProcessID: DWORD, + ) -> HANDLE; +} +pub const TH32CS_SNAPHEAPLIST: DWORD = 0x00000001; +pub const TH32CS_SNAPPROCESS: DWORD = 0x00000002; +pub const TH32CS_SNAPTHREAD: DWORD = 0x00000004; +pub const TH32CS_SNAPMODULE: DWORD = 0x00000008; +pub const TH32CS_SNAPMODULE32: DWORD = 0x00000010; +pub const TH32CS_SNAPALL: DWORD = + TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE; +pub const TH32CS_INHERIT: DWORD = 0x80000000; +STRUCT!{struct HEAPLIST32 { + dwSize: SIZE_T, + th32ProcessID: DWORD, + th32HeapID: ULONG_PTR, + dwFlags: DWORD, +}} +pub type PHEAPLIST32 = *mut HEAPLIST32; +pub type LPHEAPLIST32 = *mut HEAPLIST32; +pub const HF32_DEFAULT: DWORD = 1; +pub const HF32_SHARED: DWORD = 2; +extern "system" { + pub fn Heap32ListFirst( + hSnapshot: HANDLE, + lphl: LPHEAPLIST32, + ) -> BOOL; + pub fn Heap32ListNext( + hSnapshot: HANDLE, + lphl: LPHEAPLIST32, + ) -> BOOL; +} +STRUCT!{struct HEAPENTRY32 { + dwSize: SIZE_T, + hHandle: HANDLE, + dwAddress: ULONG_PTR, + dwBlockSize: SIZE_T, + dwFlags: DWORD, + dwLockCount: DWORD, + dwResvd: DWORD, + th32ProcessID: DWORD, + th32HeapID: ULONG_PTR, +}} +pub type PHEAPENTRY32 = *mut HEAPENTRY32; +pub type LPHEAPENTRY32 = *mut HEAPENTRY32; +pub const LF32_FIXED: DWORD = 0x00000001; +pub const LF32_FREE: DWORD = 0x00000002; +pub const LF32_MOVEABLE: DWORD = 0x00000004; +extern "system" { + pub fn Heap32First( + lphe: LPHEAPENTRY32, + th32ProcessID: DWORD, + th32HeapID: ULONG_PTR, + ) -> BOOL; + pub fn Heap32Next( + lphe: LPHEAPENTRY32, + ) -> BOOL; + pub fn Toolhelp32ReadProcessMemory( + th32ProcessID: DWORD, + lpBaseAddress: LPCVOID, + lpBuffer: LPVOID, + cbRead: SIZE_T, + lpNumberOfBytesRead: *mut SIZE_T, + ) -> BOOL; +} +STRUCT!{struct PROCESSENTRY32W { + dwSize: DWORD, + cntUsage: DWORD, + th32ProcessID: DWORD, + th32DefaultHeapID: ULONG_PTR, + th32ModuleID: DWORD, + cntThreads: DWORD, + th32ParentProcessID: DWORD, + pcPriClassBase: LONG, + dwFlags: DWORD, + szExeFile: [WCHAR; MAX_PATH], +}} +pub type PPROCESSENTRY32W = *mut PROCESSENTRY32W; +pub type LPPROCESSENTRY32W = *mut PROCESSENTRY32W; +extern "system" { + pub fn Process32FirstW( + hSnapshot: HANDLE, + lppe: LPPROCESSENTRY32W, + ) -> BOOL; + pub fn Process32NextW( + hSnapshot: HANDLE, + lppe: LPPROCESSENTRY32W, + ) -> BOOL; +} +STRUCT!{struct PROCESSENTRY32 { + dwSize: DWORD, + cntUsage: DWORD, + th32ProcessID: DWORD, + th32DefaultHeapID: ULONG_PTR, + th32ModuleID: DWORD, + cntThreads: DWORD, + th32ParentProcessID: DWORD, + pcPriClassBase: LONG, + dwFlags: DWORD, + szExeFile: [CHAR; MAX_PATH], +}} +pub type PPROCESSENTRY32 = *mut PROCESSENTRY32; +pub type LPPROCESSENTRY32 = *mut PROCESSENTRY32; +extern "system" { + pub fn Process32First( + hSnapshot: HANDLE, + lppe: LPPROCESSENTRY32, + ) -> BOOL; + pub fn Process32Next( + hSnapshot: HANDLE, + lppe: LPPROCESSENTRY32, + ) -> BOOL; +} +STRUCT!{struct THREADENTRY32 { + dwSize: DWORD, + cntUsage: DWORD, + th32ThreadID: DWORD, + th32OwnerProcessID: DWORD, + tpBasePri: LONG, + tpDeltaPri: LONG, + dwFlags: DWORD, +}} +pub type PTHREADENTRY32 = *mut THREADENTRY32; +pub type LPTHREADENTRY32 = *mut THREADENTRY32; +extern "system" { + pub fn Thread32First( + hSnapshot: HANDLE, + lpte: LPTHREADENTRY32, + ) -> BOOL; + pub fn Thread32Next( + hSnapshot: HANDLE, + lpte: LPTHREADENTRY32, + ) -> BOOL; +} +STRUCT!{struct MODULEENTRY32W { + dwSize: DWORD, + th32ModuleID: DWORD, + th32ProcessID: DWORD, + GlblcntUsage: DWORD, + ProccntUsage: DWORD, + modBaseAddr: *mut BYTE, + modBaseSize: DWORD, + hModule: HMODULE, + szModule: [WCHAR; MAX_MODULE_NAME32 + 1], + szExePath: [WCHAR; MAX_PATH], +}} +pub type PMODULEENTRY32W = *mut MODULEENTRY32W; +pub type LPMODULEENTRY32W = *mut MODULEENTRY32W; +extern "system" { + pub fn Module32FirstW( + hSnapshot: HANDLE, + lpme: LPMODULEENTRY32W, + ) -> BOOL; + pub fn Module32NextW( + hSnapshot: HANDLE, + lpme: LPMODULEENTRY32W, + ) -> BOOL; +} +STRUCT!{struct MODULEENTRY32 { + dwSize: DWORD, + th32ModuleID: DWORD, + th32ProcessID: DWORD, + GlblcntUsage: DWORD, + ProccntUsage: DWORD, + modBaseAddr: *mut BYTE, + modBaseSize: DWORD, + hModule: HMODULE, + szModule: [CHAR; MAX_MODULE_NAME32 + 1], + szExePath: [CHAR; MAX_PATH], +}} +pub type PMODULEENTRY32 = *mut MODULEENTRY32; +pub type LPMODULEENTRY32 = *mut MODULEENTRY32; +extern "system" { + pub fn Module32First( + hSnapshot: HANDLE, + lpme: LPMODULEENTRY32, + ) -> BOOL; + pub fn Module32Next( + hSnapshot: HANDLE, + lpme: LPMODULEENTRY32, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/unknwnbase.rs b/bash-5.1/vendor/winapi/src/um/unknwnbase.rs new file mode 100644 index 0000000000000000000000000000000000000000..4162fc109136c333b0d4f2301fe2b028942e3226 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/unknwnbase.rs @@ -0,0 +1,43 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_void; +use shared::guiddef::REFIID; +use shared::minwindef::{BOOL, ULONG}; +use um::winnt::HRESULT; +RIDL!{#[uuid(0x00000000, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IUnknown(IUnknownVtbl) { + fn QueryInterface( + riid: REFIID, + ppvObject: *mut *mut c_void, + ) -> HRESULT, + fn AddRef() -> ULONG, + fn Release() -> ULONG, +}} +pub type LPUNKNOWN = *mut IUnknown; +RIDL!{#[uuid(0x000e0000, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface AsyncIUnknown(AsyncIUnknownVtbl): IUnknown(IUnknownVtbl) { + fn Begin_QueryInterface( + riid: REFIID, + ) -> HRESULT, + fn Finish_QueryInterface( + ppvObject: *mut *mut c_void, + ) -> HRESULT, + fn Begin_AddRef() -> HRESULT, + fn Finish_AddRef() -> ULONG, + fn Begin_Release() -> HRESULT, + fn Finish_Release() -> ULONG, +}} +RIDL!{#[uuid(0x00000001, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IClassFactory(IClassFactoryVtbl): IUnknown(IUnknownVtbl) { + fn CreateInstance( + pUnkOuter: *mut IUnknown, + riid: REFIID, + ppvObject: *mut *mut c_void, + ) -> HRESULT, + fn LockServer( + fLock: BOOL, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/urlhist.rs b/bash-5.1/vendor/winapi/src/um/urlhist.rs new file mode 100644 index 0000000000000000000000000000000000000000..f35e550297325a1e0db7aa54a0f7fe492fd06c6a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/urlhist.rs @@ -0,0 +1,97 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Url History Interfaces +use ctypes::c_void; +use shared::guiddef::REFIID; +use shared::minwindef::{BOOL, DWORD, FILETIME, ULONG}; +use shared::wtypesbase::LPCOLESTR; +use um::docobj::{IOleCommandTarget, IOleCommandTargetVtbl}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPWSTR}; +pub const STATURL_QUERYFLAG_ISCACHED: DWORD = 0x00010000; +pub const STATURL_QUERYFLAG_NOURL: DWORD = 0x00020000; +pub const STATURL_QUERYFLAG_NOTITLE: DWORD = 0x00040000; +pub const STATURL_QUERYFLAG_TOPLEVEL: DWORD = 0x00080000; +pub const STATURLFLAG_ISCACHED: DWORD = 0x00000001; +pub const STATURLFLAG_ISTOPLEVEL: DWORD = 0x00000002; +ENUM!{enum ADDURL_FLAG { + ADDURL_FIRST = 0, + ADDURL_ADDTOHISTORYANDCACHE = 0, + ADDURL_ADDTOCACHE = 1, + ADDURL_Max = 2147483647, +}} +pub type LPENUMSTATURL = *mut IEnumSTATURL; +STRUCT!{struct STATURL { + cbSize: DWORD, + pwcsUrl: LPWSTR, + pwcsTitle: LPWSTR, + ftLastVisited: FILETIME, + ftLastUpdated: FILETIME, + ftExpires: FILETIME, + dwFlags: DWORD, +}} +pub type LPSTATURL = *mut STATURL; +RIDL!{#[uuid(0x3c374a42, 0xbae4, 0x11cf, 0xbf, 0x7d, 0x00, 0xaa, 0x00, 0x69, 0x46, 0xee)] +interface IEnumSTATURL(IEnumSTATURLVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: LPSTATURL, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IEnumSTATURL, + ) -> HRESULT, + fn SetFilter( + poszFilter: LPCOLESTR, + dwFlags: DWORD, + ) -> HRESULT, +}} +pub type LPURLHISTORYSTG = *mut IUrlHistoryStg; +RIDL!{#[uuid(0x3c374a41, 0xbae4, 0x11cf, 0xbf, 0x7d, 0x00, 0xaa, 0x00, 0x69, 0x46, 0xee)] +interface IUrlHistoryStg(IUrlHistoryStgVtbl): IUnknown(IUnknownVtbl) { + fn AddUrl( + pocsUrl: LPCOLESTR, + ) -> HRESULT, + fn DeleteUrl( + pocsUrl: LPCOLESTR, + dwFlags: DWORD, + ) -> HRESULT, + fn QueryUrl( + pocsUrl: LPCOLESTR, + dwFlags: DWORD, + lpSTATURL: LPSTATURL, + ) -> HRESULT, + fn BindToObject( + pocsUrl: LPCOLESTR, + riid: REFIID, + ppvOut: *mut *mut c_void, + ) -> HRESULT, + fn EnumUrls( + ppEnum: *mut *mut IEnumSTATURL, + ) -> HRESULT, +}} +pub type LPURLHISTORYSTG2 = *mut IUrlHistoryStg2; +RIDL!{#[uuid(0xafa0dc11, 0xc313, 0x11d0, 0x83, 0x1a, 0x00, 0xc0, 0x4f, 0xd5, 0xae, 0x38)] +interface IUrlHistoryStg2(IUrlHistoryStg2Vtbl): IUrlHistoryStg(IUrlHistoryStgVtbl) { + fn AddUrlAndNotify( + pocsUrl: LPCOLESTR, + pocsTitle: LPCOLESTR, + dwFlags: DWORD, + fWriteHistory: BOOL, + poctNotify: *mut IOleCommandTarget, + punkISFolder: *mut IUnknown, + ) -> HRESULT, + fn ClearHistory() -> HRESULT, +}} +pub type LPURLHISTORYNOTIFY = *mut IUrlHistoryNotify; +RIDL!{#[uuid(0xbc40bec1, 0xc493, 0x11d0, 0x83, 0x1b, 0x00, 0xc0, 0x4f, 0xd5, 0xae, 0x38)] +interface IUrlHistoryNotify(IUrlHistoryNotifyVtbl): + IOleCommandTarget(IOleCommandTargetVtbl) {} +} diff --git a/bash-5.1/vendor/winapi/src/um/urlmon.rs b/bash-5.1/vendor/winapi/src/um/urlmon.rs new file mode 100644 index 0000000000000000000000000000000000000000..bdcbada51d934015fde53434f03895fd6556bd41 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/urlmon.rs @@ -0,0 +1,21 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! URL Moniker interfaces +use shared::minwindef::DWORD; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCWSTR}; +RIDL!{#[uuid(0x79eac9ee, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00, 0xaa, 0x00, 0x4b, 0xa9, 0x0b)] +interface IInternetSecurityManager(IInternetSecurityManagerVtbl): IUnknown(IUnknownVtbl) { + fn SetSecuritySite() -> HRESULT, + fn GetSecuritySite() -> HRESULT, + fn MapUrlToZone( + pwszUrl: LPCWSTR, + pdwZone: *mut DWORD, + dwFlags: DWORD, + ) -> HRESULT, + // TODO: the rest +}} +// TODO: the rest diff --git a/bash-5.1/vendor/winapi/src/um/userenv.rs b/bash-5.1/vendor/winapi/src/um/userenv.rs new file mode 100644 index 0000000000000000000000000000000000000000..ea0af96ffa79b054b45883a2c340dc4120a5addd --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/userenv.rs @@ -0,0 +1,159 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Definitions for the user environment API +use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, PHKEY}; +use um::winnt::{ + HANDLE, HRESULT, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PCWSTR, PSID, PSID_AND_ATTRIBUTES, PWSTR +}; +use um::winreg::REGSAM; +extern "system" { + // pub fn LoadUserProfileA( + // hToken: HANDLE, + // lpProfileInfo: LPPROFILEINFOA, + // ) -> BOOL; + // pub fn LoadUserProfileW( + // hToken: HANDLE, + // lpProfileInfo: LPPROFILEINFOW, + // ) -> BOOL; + pub fn UnloadUserProfile( + hToken: HANDLE, + hProfile: HANDLE, + ) -> BOOL; + pub fn GetProfilesDirectoryA( + lpProfileDir: LPSTR, + lpcchSize: LPDWORD, + ) -> BOOL; + pub fn GetProfilesDirectoryW( + lpProfileDir: LPWSTR, + lpcchSize: LPDWORD, + ) -> BOOL; + pub fn GetProfileType( + dwFlags: *mut DWORD, + ) -> BOOL; + pub fn DeleteProfileA( + lpSidString: LPCSTR, + lpProfilePath: LPCSTR, + lpComputerName: LPCSTR, + ) -> BOOL; + pub fn DeleteProfileW( + lpSidString: LPCWSTR, + lpProfilePath: LPCWSTR, + lpComputerName: LPCWSTR, + ) -> BOOL; + pub fn CreateProfile( + pszUserSid: LPCWSTR, + pszUserName: LPCWSTR, + pszProfilePath: LPWSTR, + cchProfilePath: DWORD, + ) -> HRESULT; + pub fn GetDefaultUserProfileDirectoryA( + lpProfileDir: LPSTR, + lpcchSize: LPDWORD, + ) -> BOOL; + pub fn GetDefaultUserProfileDirectoryW( + lpProfileDir: LPWSTR, + lpcchSize: LPDWORD, + ) -> BOOL; + pub fn GetAllUsersProfileDirectoryA( + lpProfileDir: LPSTR, + lpcchSize: LPDWORD, + ) -> BOOL; + pub fn GetAllUsersProfileDirectoryW( + lpProfileDir: LPWSTR, + lpcchSize: LPDWORD, + ) -> BOOL; + pub fn GetUserProfileDirectoryA( + hToken: HANDLE, + lpProfileDir: LPSTR, + lpcchSize: LPDWORD, + ) -> BOOL; + pub fn GetUserProfileDirectoryW( + hToken: HANDLE, + lpProfileDir: LPWSTR, + lpcchSize: LPDWORD, + ) -> BOOL; + pub fn CreateEnvironmentBlock( + lpEnvironment: *mut LPVOID, + hToken: HANDLE, + bInherit: BOOL, + ) -> BOOL; + pub fn DestroyEnvironmentBlock( + lpEnvironment: LPVOID, + ) -> BOOL; + pub fn ExpandEnvironmentStringsForUserA( + hToken: HANDLE, + lpSrc: LPCSTR, + lpDest: LPSTR, + dwSize: DWORD, + ) -> BOOL; + pub fn ExpandEnvironmentStringsForUserW( + hToken: HANDLE, + lpSrc: LPCWSTR, + lpDest: LPWSTR, + dwSize: DWORD, + ) -> BOOL; + pub fn RefreshPolicy( + bMachine: BOOL, + ) -> BOOL; + pub fn RefreshPolicyEx( + bMachine: BOOL, + dwOptions: DWORD, + ) -> BOOL; + pub fn EnterCriticalPolicySection( + bMachine: BOOL, + ) -> HANDLE; + pub fn LeaveCriticalPolicySection( + hSection: HANDLE, + ) -> BOOL; + pub fn RegisterGPNotification( + hEvent: HANDLE, + bMachine: BOOL, + ) -> BOOL; + pub fn UnregisterGPNotification( + hEvent: HANDLE, + ) -> BOOL; + // pub fn GetGPOListA(); + // pub fn GetGPOListW(); + // pub fn FreeGPOListA(); + // pub fn FreeGPOListW(); + // pub fn GetAppliedGPOListA(); + // pub fn GetAppliedGPOListW(); + // pub fn ProcessGroupPolicyCompleted(); + // pub fn ProcessGroupPolicyCompletedEx(); + // pub fn RsopAccessCheckByType(); + // pub fn RsopFileAccessCheck(); + // pub fn RsopSetPolicySettingStatus(); + // pub fn RsopResetPolicySettingStatus(); + // pub fn GenerateGPNotification(); + pub fn CreateAppContainerProfile( + pszAppContainerName: PCWSTR, + pszDisplayName: PCWSTR, + pszDescription: PCWSTR, + pCapabilities: PSID_AND_ATTRIBUTES, + dwCapabilityCount: DWORD, + ppSidAppContainerSid: *mut PSID, + ) -> HRESULT; + pub fn DeleteAppContainerProfile( + pszAppContainerName: PCWSTR, + ) -> HRESULT; + pub fn GetAppContainerRegistryLocation( + desiredAccess: REGSAM, + phAppContainerKey: PHKEY, + ) -> HRESULT; + pub fn GetAppContainerFolderPath( + pszAppContainerSid: PCWSTR, + ppszPath: *mut PWSTR, + ) -> HRESULT; + pub fn DeriveAppContainerSidFromAppContainerName( + pszAppContainerName: PCWSTR, + ppsidAppContainerSid: *mut PSID, + ) -> HRESULT; + pub fn DeriveRestrictedAppContainerSidFromAppContainerSidAndRestrictedName( + psidAppContainerSid: PSID, + pszRestrictedAppContainerName: PCWSTR, + ppsidRestrictedAppContainerSid: *mut PSID, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/usp10.rs b/bash-5.1/vendor/winapi/src/um/usp10.rs new file mode 100644 index 0000000000000000000000000000000000000000..b2f24be06eac34650c936b8e43b0f3df70e98dc6 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/usp10.rs @@ -0,0 +1,560 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Unicode Complex Script processor API declarations +use ctypes::{c_int, c_long, c_void}; +use shared::minwindef::{BOOL, BYTE, DWORD, UINT, ULONG, WORD}; +use shared::ntdef::LCID; +use shared::windef::{HDC, RECT, SIZE}; +use shared::winerror::{FACILITY_ITF, SEVERITY_ERROR}; +use um::wingdi::ABC; +use um::winnt::{HRESULT, LONG, WCHAR}; +pub const SCRIPT_UNDEFINED: WORD = 0; +pub const USP_E_SCRIPT_NOT_IN_FONT: HRESULT = MAKE_HRESULT!(SEVERITY_ERROR, FACILITY_ITF, 0x200); +DECLARE_HANDLE!{SCRIPT_CACHE, SCRIPT_CACHE__} +extern "system" { + pub fn ScriptFreeCache( + psc: *mut SCRIPT_CACHE, + ) -> HRESULT; +} +STRUCT!{struct SCRIPT_CONTROL { + bit_fields: DWORD, +}} +BITFIELD!{SCRIPT_CONTROL bit_fields: DWORD [ + uDefaultLanguage set_uDefaultLanguage[0..16], + fContextDigits set_fContextDigits[16..17], + fInvertPreBoundDir set_fInvertPreBoundDir[17..18], + fInvertPostBoundDir set_fInvertPostBoundDir[18..19], + fLinkStringBefore set_fLinkStringBefore[19..20], + fLinkStringAfter set_fLinkStringAfter[20..21], + fNeutralOverride set_fNeutralOverride[21..22], + fNumericOverride set_fNumericOverride[22..23], + fLegacyBidiClass set_fLegacyBidiClass[23..24], + fMergeNeutralItems set_fMergeNeutralItems[24..25], + fReserved set_fReserved[25..32], +]} +STRUCT!{struct SCRIPT_STATE { + bit_fields: WORD, +}} +BITFIELD!{SCRIPT_STATE bit_fields: WORD [ + uBidiLevel set_uBidiLevel[0..5], + fOverrideDirection set_fOverrideDirection[5..6], + fInhibitSymSwap set_fInhibitSymSwap[6..7], + fCharShape set_fCharShape[7..8], + fDigitSubstitute set_fDigitSubstitute[8..9], + fInhibitLigate set_fInhibitLigate[9..10], + fDisplayZWG set_fDisplayZWG[10..11], + fArabicNumContext set_fArabicNumContext[11..12], + fGcpClusters set_fGcpClusters[12..13], + fReserved set_fReserved[13..14], + fEngineReserved set_fEngineReserved[14..16], +]} +STRUCT!{struct SCRIPT_ANALYSIS { + bit_fields: WORD, + s: SCRIPT_STATE, +}} +BITFIELD!{SCRIPT_ANALYSIS bit_fields: WORD [ + eScript set_eScript[0..10], + fRTL set_fRTL[10..11], + fLayoutRTL set_fLayoutRTL[11..12], + fLinkBefore set_fLinkBefore[12..13], + fLinkAfter set_fLinkAfter[13..14], + fLogicalOrder set_fLogicalOrder[14..15], + fNoGlyphIndex set_fNoGlyphIndex[15..16], +]} +STRUCT!{struct SCRIPT_ITEM { + iCharPos: c_int, + a: SCRIPT_ANALYSIS, +}} +extern "system" { + pub fn ScriptItemize( + pwcInChars: *const WCHAR, + cInChars: c_int, + cMaxItems: c_int, + psControl: *const SCRIPT_CONTROL, + psState: *const SCRIPT_STATE, + pItems: *mut SCRIPT_ITEM, + pcItems: *mut c_int, + ) -> HRESULT; + pub fn ScriptLayout( + cRuns: c_int, + pbLevel: *const BYTE, + piVisualToLogical: *mut c_int, + piLogicalToVisual: *mut c_int, + ) -> HRESULT; +} +pub const SCRIPT_JUSTIFY_NONE: WORD = 0; +pub const SCRIPT_JUSTIFY_ARABIC_BLANK: WORD = 1; +pub const SCRIPT_JUSTIFY_CHARACTER: WORD = 2; +pub const SCRIPT_JUSTIFY_RESERVED1: WORD = 3; +pub const SCRIPT_JUSTIFY_BLANK: WORD = 4; +pub const SCRIPT_JUSTIFY_RESERVED2: WORD = 5; +pub const SCRIPT_JUSTIFY_RESERVED3: WORD = 6; +pub const SCRIPT_JUSTIFY_ARABIC_NORMAL: WORD = 7; +pub const SCRIPT_JUSTIFY_ARABIC_KASHIDA: WORD = 8; +pub const SCRIPT_JUSTIFY_ARABIC_ALEF: WORD = 9; +pub const SCRIPT_JUSTIFY_ARABIC_HA: WORD = 10; +pub const SCRIPT_JUSTIFY_ARABIC_RA: WORD = 11; +pub const SCRIPT_JUSTIFY_ARABIC_BA: WORD = 12; +pub const SCRIPT_JUSTIFY_ARABIC_BARA: WORD = 13; +pub const SCRIPT_JUSTIFY_ARABIC_SEEN: WORD = 14; +pub const SCRIPT_JUSTIFY_ARABIC_SEEN_M: WORD = 15; +STRUCT!{struct SCRIPT_VISATTR { + bit_fields: WORD, +}} +BITFIELD!{SCRIPT_VISATTR bit_fields: WORD [ + uJustification set_uJustification[0..4], + fClusterStart set_fClusterStart[4..5], + fDiacritic set_fDiacritic[5..6], + fZeroWidth set_fZeroWidth[6..7], + fReserved set_fReserved[7..8], + fShapeReserved set_fShapeReserved[8..16], +]} +extern "system" { + pub fn ScriptShape( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + pwcChars: *const WCHAR, + cChars: c_int, + cMaxGlyphs: c_int, + psa: *mut SCRIPT_ANALYSIS, + pwOutGlyphs: *mut WORD, + pwLogClust: *mut WORD, + psva: *mut SCRIPT_VISATTR, + pcGlyphs: *mut c_int, + ) -> HRESULT; +} +STRUCT!{struct GOFFSET { + du: LONG, + dv: LONG, +}} +extern "system" { + pub fn ScriptPlace( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + pwGlyphs: *const WORD, + cGlyphs: c_int, + psva: *const SCRIPT_VISATTR, + psa: *mut SCRIPT_ANALYSIS, + piAdvance: *mut c_int, + pGoffset: *mut GOFFSET, + pABC: *mut ABC, + ) -> HRESULT; + pub fn ScriptTextOut( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + x: c_int, + y: c_int, + fuOptions: UINT, + lprc: *const RECT, + psa: *const SCRIPT_ANALYSIS, + pwcReserved: *const WCHAR, + iReserved: c_int, + pwGlyphs: *const WORD, + cGlyphs: c_int, + piAdvance: *const c_int, + piJustify: *const c_int, + pGoffset: *const GOFFSET, + ) -> HRESULT; + pub fn ScriptJustify( + psva: *const SCRIPT_VISATTR, + piAdvance: *const c_int, + cGlyphs: c_int, + iDx: c_int, + iMinKashida: c_int, + piJustify: *mut c_int, + ) -> HRESULT; +} +STRUCT!{struct SCRIPT_LOGATTR { + bit_fields: BYTE, +}} +BITFIELD!{SCRIPT_LOGATTR bit_fields: BYTE [ + fSoftBreak set_fSoftBreak[0..1], + fWhiteSpace set_fWhiteSpace[1..2], + fCharStop set_fCharStop[2..3], + fWordStop set_fWordStop[3..4], + fInvalid set_fInvalid[4..5], + fReserved set_fReserved[5..8], +]} +extern "system" { + pub fn ScriptBreak( + pwcChars: *const WCHAR, + cChars: c_int, + psa: *const SCRIPT_ANALYSIS, + psla: *mut SCRIPT_LOGATTR, + ) -> HRESULT; + pub fn ScriptCPtoX( + iCP: c_int, + fTrailing: BOOL, + cChars: c_int, + cGlyphs: c_int, + pwLogClust: *const WORD, + psva: *const SCRIPT_VISATTR, + piAdvance: *const c_int, + psa: *const SCRIPT_ANALYSIS, + piX: *mut c_int, + ) -> HRESULT; + pub fn ScriptXtoCP( + iX: c_int, + cChars: c_int, + cGlyphs: c_int, + pwLogClust: *const WORD, + psva: *const SCRIPT_VISATTR, + piAdvance: *const c_int, + psa: *const SCRIPT_ANALYSIS, + piCP: *mut c_int, + piTrailing: *mut c_int, + ) -> HRESULT; + pub fn ScriptGetLogicalWidths( + psa: *const SCRIPT_ANALYSIS, + cChars: c_int, + cGlyphs: c_int, + piGlyphWidth: *const c_int, + pwLogClust: *const WORD, + psva: *const SCRIPT_VISATTR, + piDx: *mut c_int, + ) -> HRESULT; + pub fn ScriptApplyLogicalWidth( + piDx: *const c_int, + cChars: c_int, + cGlyphs: c_int, + pwLogClust: *const WORD, + psva: *const SCRIPT_VISATTR, + piAdvance: *const c_int, + psa: *const SCRIPT_ANALYSIS, + pABC: *mut ABC, + piJustify: *mut c_int, + ) -> HRESULT; +} +pub const SGCM_RTL: DWORD = 0x00000001; +extern "system" { + pub fn ScriptGetCMap( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + pwcInChars: *const WCHAR, + cChars: c_int, + dwFlags: DWORD, + pwOutGlyphs: *mut WORD, + ) -> HRESULT; + pub fn ScriptGetGlyphABCWidth( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + wGlyph: WORD, + pABC: *mut ABC, + ) -> HRESULT; +} +STRUCT!{struct SCRIPT_PROPERTIES { + bit_fields1: DWORD, + bit_fields2: DWORD, +}} +BITFIELD!{SCRIPT_PROPERTIES bit_fields1: DWORD [ + langid set_langid[0..16], + fNumeric set_fNumeric[16..17], + fComplex set_fComplex[17..18], + fNeedsWordBreaking set_fNeedsWordBreaking[18..19], + fNeedsCaretInfo set_fNeedsCaretInfo[19..20], + bCharSet set_bCharSet[20..28], + fControl set_fControl[28..29], + fPrivateUseArea set_fPrivateUseArea[29..30], + fNeedsCharacterJustify set_fNeedsCharacterJustify[30..31], + fInvalidGlyph set_fInvalidGlyph[31..32], +]} +BITFIELD!{SCRIPT_PROPERTIES bit_fields2: DWORD [ + fInvalidLogAttr set_fInvalidLogAttr[0..1], + fCDM set_fCDM[1..2], + fAmbiguousCharSet set_fAmbiguousCharSet[2..3], + fClusterSizeVaries set_fClusterSizeVaries[3..4], + fRejectInvalid set_fRejectInvalid[4..5], +]} +extern "system" { + pub fn ScriptGetProperties( + ppSp: *mut *mut *const SCRIPT_PROPERTIES, + piNumScripts: *mut c_int, + ) -> HRESULT; +} +STRUCT!{struct SCRIPT_FONTPROPERTIES { + cBytes: c_int, + wgBlank: WORD, + wgDefault: WORD, + wgInvalid: WORD, + wgKashida: WORD, + iKashidaWidth: c_int, +}} +extern "system" { + pub fn ScriptGetFontProperties( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + sfp: *mut SCRIPT_FONTPROPERTIES, + ) -> HRESULT; + pub fn ScriptCacheGetHeight( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + tmHeight: *mut c_long, + ) -> HRESULT; +} +pub const SSA_PASSWORD: DWORD = 0x00000001; +pub const SSA_TAB: DWORD = 0x00000002; +pub const SSA_CLIP: DWORD = 0x00000004; +pub const SSA_FIT: DWORD = 0x00000008; +pub const SSA_DZWG: DWORD = 0x00000010; +pub const SSA_FALLBACK: DWORD = 0x00000020; +pub const SSA_BREAK: DWORD = 0x00000040; +pub const SSA_GLYPHS: DWORD = 0x00000080; +pub const SSA_RTL: DWORD = 0x00000100; +pub const SSA_GCP: DWORD = 0x00000200; +pub const SSA_HOTKEY: DWORD = 0x00000400; +pub const SSA_METAFILE: DWORD = 0x00000800; +pub const SSA_LINK: DWORD = 0x00001000; +pub const SSA_HIDEHOTKEY: DWORD = 0x00002000; +pub const SSA_HOTKEYONLY: DWORD = 0x00002400; +pub const SSA_FULLMEASURE: DWORD = 0x04000000; +pub const SSA_LPKANSIFALLBACK: DWORD = 0x08000000; +pub const SSA_PIDX: DWORD = 0x10000000; +pub const SSA_LAYOUTRTL: DWORD = 0x20000000; +pub const SSA_DONTGLYPH: DWORD = 0x40000000; +pub const SSA_NOKASHIDA: DWORD = 0x80000000; +STRUCT!{struct SCRIPT_TABDEF { + cTabStops: c_int, + iScale: c_int, + pTabStops: *mut c_int, + iTabOrigin: c_int, +}} +DECLARE_HANDLE!{SCRIPT_STRING_ANALYSIS, SCRIPT_STRING_ANALYSIS__} +extern "system" { + pub fn ScriptStringAnalyse( + hdc: HDC, + pString: *const c_void, + cString: c_int, + cGlyphs: c_int, + iCharset: c_int, + dwFlags: DWORD, + iReqWidth: c_int, + psControl: *mut SCRIPT_CONTROL, + psState: *mut SCRIPT_STATE, + piDx: *const c_int, + pTabdef: *mut SCRIPT_TABDEF, + pbInClass: *const BYTE, + pssa: *mut SCRIPT_STRING_ANALYSIS, + ) -> HRESULT; + pub fn ScriptStringFree( + pssa: *mut SCRIPT_STRING_ANALYSIS, + ) -> HRESULT; + pub fn ScriptString_pSize( + ssa: SCRIPT_STRING_ANALYSIS, + ) -> *const SIZE; + pub fn ScriptString_pcOutChars( + ssa: SCRIPT_STRING_ANALYSIS, + ) -> *const c_int; + pub fn ScriptString_pLogAttr( + ssa: SCRIPT_STRING_ANALYSIS, + ) -> *const SCRIPT_LOGATTR; + pub fn ScriptStringGetOrder( + ssa: SCRIPT_STRING_ANALYSIS, + puOrder: *mut UINT, + ) -> HRESULT; + pub fn ScriptStringCPtoX( + ssa: SCRIPT_STRING_ANALYSIS, + icp: c_int, + fTrailing: BOOL, + pX: *mut c_int, + ) -> HRESULT; + pub fn ScriptStringXtoCP( + ssa: SCRIPT_STRING_ANALYSIS, + iX: c_int, + piCh: *mut c_int, + piTrailing: *mut c_int, + ) -> HRESULT; + pub fn ScriptStringGetLogicalWidths( + ssa: SCRIPT_STRING_ANALYSIS, + dpiDx: *mut c_int, + ) -> HRESULT; + pub fn ScriptStringValidate( + ssa: SCRIPT_STRING_ANALYSIS, + ) -> HRESULT; + pub fn ScriptStringOut( + ssa: SCRIPT_STRING_ANALYSIS, + iX: c_int, + iY: c_int, + uOptions: UINT, + prc: *const RECT, + iMinSel: c_int, + iMaxSel: c_int, + fDisabled: BOOL, + ) -> HRESULT; +} +pub const SIC_COMPLEX: DWORD = 1; +pub const SIC_ASCIIDIGIT: DWORD = 2; +pub const SIC_NEUTRAL: DWORD = 4; +extern "system" { + pub fn ScriptIsComplex( + pwcInChars: *const WCHAR, + cInChars: c_int, + dwFlags: DWORD, + ) -> HRESULT; +} +STRUCT!{struct SCRIPT_DIGITSUBSTITUTE { + bit_fields1: DWORD, + bit_fields2: DWORD, + dwReserved: DWORD, +}} +BITFIELD!{SCRIPT_DIGITSUBSTITUTE bit_fields1: DWORD [ + NationalDigitLanguage set_NationalDigitLanguage[0..16], + TraditionalDigitLanguage set_TraditionalDigitLanguage[16..32], +]} +BITFIELD!{SCRIPT_DIGITSUBSTITUTE bit_fields2: DWORD [ + DigitSubstitute set_DigitSubstitute[0..8], +]} +extern "system" { + pub fn ScriptRecordDigitSubstitution( + Locale: LCID, + psds: *mut SCRIPT_DIGITSUBSTITUTE, + ) -> HRESULT; +} +pub const SCRIPT_DIGITSUBSTITUTE_CONTEXT: BYTE = 0; +pub const SCRIPT_DIGITSUBSTITUTE_NONE: BYTE = 1; +pub const SCRIPT_DIGITSUBSTITUTE_NATIONAL: BYTE = 2; +pub const SCRIPT_DIGITSUBSTITUTE_TRADITIONAL: BYTE = 3; +extern "system" { + pub fn ScriptApplyDigitSubstitution( + psds: *const SCRIPT_DIGITSUBSTITUTE, + psc: *mut SCRIPT_CONTROL, + pss: *mut SCRIPT_STATE, + ) -> HRESULT; +} +pub type OPENTYPE_TAG = ULONG; +pub const SCRIPT_TAG_UNKNOWN: OPENTYPE_TAG = 0x00000000; +STRUCT!{struct OPENTYPE_FEATURE_RECORD { + tagFeature: OPENTYPE_TAG, + lParameter: LONG, +}} +STRUCT!{struct TEXTRANGE_PROPERTIES { + potfRecords: *mut OPENTYPE_FEATURE_RECORD, + cotfRecords: c_int, +}} +STRUCT!{struct SCRIPT_CHARPROP { + bit_fields: WORD, +}} +BITFIELD!{SCRIPT_CHARPROP bit_fields: WORD [ + fCanGlyphAlone set_fCanGlyphAlone[0..1], + reserved set_reserved[1..16], +]} +STRUCT!{struct SCRIPT_GLYPHPROP { + sva: SCRIPT_VISATTR, + reserved: WORD, +}} +extern "system" { + pub fn ScriptShapeOpenType( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + psa: *mut SCRIPT_ANALYSIS, + tagScript: OPENTYPE_TAG, + tagLangSys: OPENTYPE_TAG, + rcRangeChars: *mut c_int, + rpRangeProperties: *mut *mut TEXTRANGE_PROPERTIES, + cRanges: c_int, + pwcChars: *const WCHAR, + cChars: c_int, + cMaxGlyphs: c_int, + pwLogClust: *mut WORD, + pCharProps: *mut SCRIPT_CHARPROP, + pwOutGlyphs: *mut WORD, + pOutGlyphProps: *mut SCRIPT_GLYPHPROP, + pcGlyphs: *mut c_int, + ) -> HRESULT; + pub fn ScriptPlaceOpenType( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + psa: *mut SCRIPT_ANALYSIS, + tagScript: OPENTYPE_TAG, + tagLangSys: OPENTYPE_TAG, + rcRangeChars: *mut c_int, + rpRangeProperties: *mut *mut TEXTRANGE_PROPERTIES, + cRanges: c_int, + pwcChars: *const WCHAR, + pwLogClust: *mut WORD, + pCharProps: *mut SCRIPT_CHARPROP, + cChars: c_int, + pwGlyphs: *const WORD, + pGlyphProps: *const SCRIPT_GLYPHPROP, + cGlyphs: c_int, + piAdvance: *mut c_int, + pGoffset: *mut GOFFSET, + pABC: *mut ABC, + ) -> HRESULT; + pub fn ScriptItemizeOpenType( + pwcInChars: *const WCHAR, + cInChars: c_int, + cMaxItems: c_int, + psControl: *const SCRIPT_CONTROL, + psState: *const SCRIPT_STATE, + pItems: *mut SCRIPT_ITEM, + pScriptTags: *mut OPENTYPE_TAG, + pcItems: *mut c_int, + ) -> HRESULT; + pub fn ScriptGetFontScriptTags( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + psa: *mut SCRIPT_ANALYSIS, + cMaxTags: c_int, + pScriptTags: *mut OPENTYPE_TAG, + pcTags: *mut c_int, + ) -> HRESULT; + pub fn ScriptGetFontLanguageTags( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + psa: *mut SCRIPT_ANALYSIS, + tagScript: OPENTYPE_TAG, + cMaxTags: c_int, + pLangsysTags: *mut OPENTYPE_TAG, + pcTags: *mut c_int, + ) -> HRESULT; + pub fn ScriptGetFontFeatureTags( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + psa: *mut SCRIPT_ANALYSIS, + tagScript: OPENTYPE_TAG, + tagLangSys: OPENTYPE_TAG, + cMaxTags: c_int, + pFeatureTags: *mut OPENTYPE_TAG, + pcTags: *mut c_int, + ) -> HRESULT; + pub fn ScriptGetFontAlternateGlyphs( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + psa: *mut SCRIPT_ANALYSIS, + tagScript: OPENTYPE_TAG, + tagLangSys: OPENTYPE_TAG, + tagFeature: OPENTYPE_TAG, + wGlyphId: WORD, + cMaxAlternates: c_int, + pAlternateGlyphs: *mut WORD, + pcAlternates: *mut c_int, + ) -> HRESULT; + pub fn ScriptSubstituteSingleGlyph( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + psa: *mut SCRIPT_ANALYSIS, + tagScript: OPENTYPE_TAG, + tagLangSys: OPENTYPE_TAG, + tagFeature: OPENTYPE_TAG, + lParameter: LONG, + wGlyphId: WORD, + pwOutGlyphId: *mut WORD, + ) -> HRESULT; + pub fn ScriptPositionSingleGlyph( + hdc: HDC, + psc: *mut SCRIPT_CACHE, + psa: *mut SCRIPT_ANALYSIS, + tagScript: OPENTYPE_TAG, + tagLangSys: OPENTYPE_TAG, + tagFeature: OPENTYPE_TAG, + lParameter: LONG, + wGlyphId: WORD, + iAdvance: c_int, + GOffset: GOFFSET, + piOutAdvance: *mut c_int, + pOutGoffset: *mut GOFFSET, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/utilapiset.rs b/bash-5.1/vendor/winapi/src/um/utilapiset.rs new file mode 100644 index 0000000000000000000000000000000000000000..0ef86e359d59afb6c6e6a3bb74e51fbd3154005c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/utilapiset.rs @@ -0,0 +1,25 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, DWORD}; +use shared::ntdef::PVOID; +extern "system" { + pub fn EncodePointer( + Ptr: PVOID, + ) -> PVOID; + pub fn DecodePointer( + Ptr: PVOID, + ) -> PVOID; + pub fn EncodeSystemPointer( + Ptr: PVOID, + ) -> PVOID; + pub fn DecodeSystemPointer( + Ptr: PVOID, + ) -> PVOID; + pub fn Beep( + dwFreq: DWORD, + dwDuration: DWORD, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/uxtheme.rs b/bash-5.1/vendor/winapi/src/um/uxtheme.rs new file mode 100644 index 0000000000000000000000000000000000000000..0e046a3569a22277df3090d28b17b1e884f03ca6 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/uxtheme.rs @@ -0,0 +1,772 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! theming API +use ctypes::{c_float, c_int, c_void}; +use shared::minwindef::{BOOL, BYTE, DWORD, HINSTANCE, HRGN, LPARAM, UINT, ULONG, WORD}; +use shared::windef::{COLORREF, HBITMAP, HBRUSH, HDC, HWND, LPCRECT, LPRECT, POINT, RECT, SIZE}; +use um::commctrl::HIMAGELIST; +use um::wingdi::{BLENDFUNCTION, LOGFONTW, RGBQUAD, TEXTMETRICW}; +use um::winnt::{HANDLE, HRESULT, LONG, LPCWSTR, LPWSTR, PVOID, VOID}; +pub type HTHEME = HANDLE; +//pub const MAX_THEMECOLOR: u32 = 64; +//pub const MAX_THEMESIZE: u32 = 64; +extern "system" { + pub fn BeginPanningFeedback( + hwnd: HWND, + ) -> BOOL; + pub fn UpdatePanningFeedback( + hwnd: HWND, + lTotalOverpanOffsetX: LONG, + lTotalOverpanOffsetY: LONG, + fInInertia: BOOL, + ) -> BOOL; + pub fn EndPanningFeedback( + hwnd: HWND, + fAnimateBack: BOOL, + ) -> BOOL; +} +ENUM!{enum TA_PROPERTY { + TAP_FLAGS = 0, + TAP_TRANSFORMCOUNT = 1, + TAP_STAGGERDELAY = 2, + TAP_STAGGERDELAYCAP = 3, + TAP_STAGGERDELAYFACTOR = 4, + TAP_ZORDER = 5, +}} +ENUM!{enum TA_PROPERTY_FLAG { + TAPF_NONE = 0x0, + TAPF_HASSTAGGER = 0x1, + TAPF_ISRTLAWARE = 0x2, + TAPF_ALLOWCOLLECTION = 0x4, + TAPF_HASBACKGROUND = 0x8, + TAPF_HASPERSPECTIVE = 0x10, +}} +extern "system" { + pub fn GetThemeAnimationProperty( + hTheme: HTHEME, + iStoryboardId: c_int, + iTargetId: c_int, + eProperty: TA_PROPERTY, + pvProperty: *mut VOID, + cbSize: DWORD, + pcbSizeOut: *mut DWORD, + ) -> HRESULT; +} +ENUM!{enum TA_TRANSFORM_TYPE { + TATT_TRANSLATE_2D = 0, + TATT_SCALE_2D = 1, + TATT_OPACITY = 2, + TATT_CLIP = 3, +}} +ENUM!{enum TA_TRANSFORM_FLAG { + TATF_NONE = 0x0, + TATF_TARGETVALUES_USER = 0x1, + TATF_HASINITIALVALUES = 0x2, + TATF_HASORIGINVALUES = 0x4, +}} +STRUCT!{struct TA_TRANSFORM { + eTransformType: TA_TRANSFORM_TYPE, + dwTimingFunctionId: DWORD, + dwStartTime: DWORD, + dwDurationTime: DWORD, + eFlags: TA_TRANSFORM_FLAG, +}} +pub type PTA_TRANSFORM = *mut TA_TRANSFORM; +STRUCT!{struct TA_TRANSFORM_2D { + header: TA_TRANSFORM, + rX: c_float, + rY: c_float, + rInitialX: c_float, + rInitialY: c_float, + rOriginX: c_float, + rOriginY: c_float, +}} +pub type PTA_TRANSFORM_2D = *mut TA_TRANSFORM_2D; +STRUCT!{struct TA_TRANSFORM_OPACITY { + header: TA_TRANSFORM, + rOpacity: c_float, + rInitialOpacity: c_float, +}} +pub type PTA_TRANSFORM_OPACITY = *mut TA_TRANSFORM_OPACITY; +STRUCT!{struct TA_TRANSFORM_CLIP { + header: TA_TRANSFORM, + rLeft: c_float, + rTop: c_float, + rRight: c_float, + rBottom: c_float, + rInitialLeft: c_float, + rInitialTop: c_float, + rInitialRight: c_float, + rInitialBottom: c_float, +}} +pub type PTA_TRANSFORM_CLIP = *mut TA_TRANSFORM_CLIP; +extern "system" { + pub fn GetThemeAnimationTransform( + hTheme: HTHEME, + iStoryboardId: c_int, + iTargetId: c_int, + dwTransformIndex: DWORD, + pTransform: *mut TA_TRANSFORM, + cbSize: DWORD, + pcbSizeOut: *mut DWORD, + ) -> HRESULT; +} +ENUM!{enum TA_TIMINGFUNCTION_TYPE { + TTFT_UNDEFINED = 0, + TTFT_CUBIC_BEZIER = 1, +}} +STRUCT!{struct TA_TIMINGFUNCTION { + eTimingFunctionType: TA_TIMINGFUNCTION_TYPE, +}} +pub type PTA_TIMINGFUNCTION = *mut TA_TIMINGFUNCTION; +STRUCT!{struct TA_CUBIC_BEZIER { + header: TA_TIMINGFUNCTION, + rX0: c_float, + rY0: c_float, + rX1: c_float, + rY1: c_float, +}} +pub type PTA_CUBIC_BEZIER = *mut TA_CUBIC_BEZIER; +extern "system" { + pub fn GetThemeTimingFunction( + hTheme: HTHEME, + iTimingFunctionId: c_int, + pTimingFunction: *mut TA_TIMINGFUNCTION, + cbSize: DWORD, + pcbSizeOut: *mut DWORD, + ) -> HRESULT; + pub fn OpenThemeData( + hwnd: HWND, + pszClassList: LPCWSTR, + ) -> HTHEME; +} +pub const OTD_FORCE_RECT_SIZING: DWORD = 0x00000001; +pub const OTD_NONCLIENT: DWORD = 0x00000002; +pub const OTD_VALIDBITS: DWORD = OTD_FORCE_RECT_SIZING | OTD_NONCLIENT; +extern "system" { + pub fn OpenThemeDataForDpi( + hwnd: HWND, + pszClassList: LPCWSTR, + dpi: UINT, + ) -> HTHEME; + pub fn OpenThemeDataEx( + hwnd: HWND, + pszClassList: LPCWSTR, + dwFlags: DWORD, + ) -> HTHEME; + pub fn CloseThemeData( + hTheme: HTHEME, + ) -> HRESULT; + pub fn DrawThemeBackground( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + pRect: LPCRECT, + pClipRect: LPCRECT, + ) -> HRESULT; +} +pub const DTBG_CLIPRECT: DWORD = 0x00000001; +pub const DTBG_DRAWSOLID: DWORD = 0x00000002; +pub const DTBG_OMITBORDER: DWORD = 0x00000004; +pub const DTBG_OMITCONTENT: DWORD = 0x00000008; +pub const DTBG_COMPUTINGREGION: DWORD = 0x00000010; +pub const DTBG_MIRRORDC: DWORD = 0x00000020; +pub const DTBG_NOMIRROR: DWORD = 0x00000040; +pub const DTBG_VALIDBITS: DWORD = DTBG_CLIPRECT | DTBG_DRAWSOLID | DTBG_OMITBORDER + | DTBG_OMITCONTENT | DTBG_COMPUTINGREGION | DTBG_MIRRORDC | DTBG_NOMIRROR; +STRUCT!{struct DTBGOPTS { + dwSize: DWORD, + dwFlags: DWORD, + rcClip: RECT, +}} +pub type PDTBGOPTS = *mut DTBGOPTS; +extern "system" { + pub fn DrawThemeBackgroundEx( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + pRect: LPCRECT, + pOptions: *const DTBGOPTS, + ) -> HRESULT; +} +//pub const DTT_GRAYED: u32 = 0x00000001; +//pub const DTT_FLAGS2VALIDBITS: u32 = DTT_GRAYED; +extern "system" { + pub fn DrawThemeText( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + pszText: LPCWSTR, + cchText: c_int, + dwTextFlags: DWORD, + dwTextFlags2: DWORD, + pRect: LPCRECT, + ) -> HRESULT; + pub fn GetThemeBackgroundContentRect( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + pBoundingRect: LPCRECT, + pContentRect: LPRECT, + ) -> HRESULT; + pub fn GetThemeBackgroundExtent( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + pContentRect: LPCRECT, + pExtentRect: LPRECT, + ) -> HRESULT; + pub fn GetThemeBackgroundRegion( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + pRect: LPCRECT, + pRegion: *mut HRGN, + ) -> HRESULT; +} +ENUM!{enum THEMESIZE { + TS_MIN = 0, + TS_TRUE = 1, + TS_DRAW = 2, +}} +extern "system" { + pub fn GetThemePartSize( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + prc: LPCRECT, + eSize: THEMESIZE, + psz: *mut SIZE, + ) -> HRESULT; + pub fn GetThemeTextExtent( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + pszText: LPCWSTR, + cchCharCount: c_int, + dwTextFlags: DWORD, + pBoundingRect: LPCRECT, + pExtentRect: LPRECT, + ) -> HRESULT; + pub fn GetThemeTextMetrics( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + ptm: *mut TEXTMETRICW, + ) -> HRESULT; +} +pub const HTTB_BACKGROUNDSEG: DWORD = 0x00000000; +pub const HTTB_FIXEDBORDER: DWORD = 0x00000002; +pub const HTTB_CAPTION: DWORD = 0x00000004; +pub const HTTB_RESIZINGBORDER_LEFT: DWORD = 0x00000010; +pub const HTTB_RESIZINGBORDER_TOP: DWORD = 0x00000020; +pub const HTTB_RESIZINGBORDER_RIGHT: DWORD = 0x00000040; +pub const HTTB_RESIZINGBORDER_BOTTOM: DWORD = 0x00000080; +pub const HTTB_RESIZINGBORDER: DWORD = HTTB_RESIZINGBORDER_LEFT | HTTB_RESIZINGBORDER_TOP + | HTTB_RESIZINGBORDER_RIGHT | HTTB_RESIZINGBORDER_BOTTOM; +pub const HTTB_SIZINGTEMPLATE: DWORD = 0x00000100; +pub const HTTB_SYSTEMSIZINGMARGINS: DWORD = 0x00000200; +extern "system" { + pub fn HitTestThemeBackground( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + dwOptions: DWORD, + pRect: LPCRECT, + hrgn: HRGN, + ptTest: POINT, + pwHitTestCode: *mut WORD, + ) -> HRESULT; + pub fn DrawThemeEdge( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + pDestRect: LPCRECT, + uEdge: UINT, + uFlags: UINT, + pContentRect: LPRECT, + ) -> HRESULT; + pub fn DrawThemeIcon( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + pRect: LPCRECT, + himl: HIMAGELIST, + iImageIndex: c_int, + ) -> HRESULT; + pub fn IsThemePartDefined( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + ) -> BOOL; + pub fn IsThemeBackgroundPartiallyTransparent( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + ) -> BOOL; + pub fn GetThemeColor( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + pColor: *mut COLORREF, + ) -> HRESULT; + pub fn GetThemeMetric( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + piVal: *mut c_int, + ) -> HRESULT; + pub fn GetThemeString( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + pszBuff: LPWSTR, + cchMaxBuffChars: c_int, + ) -> HRESULT; + pub fn GetThemeBool( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + pfVal: *mut BOOL, + ) -> HRESULT; + pub fn GetThemeInt( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + piVal: *mut c_int, + ) -> HRESULT; + pub fn GetThemeEnumValue( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + piVal: *mut c_int, + ) -> HRESULT; + pub fn GetThemePosition( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + pPoint: *mut POINT, + ) -> HRESULT; + pub fn GetThemeFont( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + pFont: *mut LOGFONTW, + ) -> HRESULT; + pub fn GetThemeRect( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + pRect: LPRECT, + ) -> HRESULT; +} +STRUCT!{struct MARGINS { + cxLeftWidth: c_int, + cxRightWidth: c_int, + cyTopHeight: c_int, + cyBottomHeight: c_int, +}} +pub type PMARGINS = *mut MARGINS; +extern "system" { + pub fn GetThemeMargins( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + prc: LPCRECT, + pMargins: *mut MARGINS, + ) -> HRESULT; +} +pub const MAX_INTLIST_COUNT: usize = 402; +STRUCT!{struct INTLIST { + iValueCount: c_int, + iValues: [c_int; MAX_INTLIST_COUNT], +}} +pub type PINTLIST = *mut INTLIST; +extern "system" { + pub fn GetThemeIntList( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + pIntList: *mut INTLIST, + ) -> HRESULT; +} +ENUM!{enum PROPERTYORIGIN { + PO_STATE = 0, + PO_PART = 1, + PO_CLASS = 2, + PO_GLOBAL = 3, + PO_NOTFOUND = 4, +}} +extern "system" { + pub fn GetThemePropertyOrigin( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + pOrigin: *mut PROPERTYORIGIN, + ) -> HRESULT; + pub fn SetWindowTheme( + hwnd: HWND, + pszSubAppName: LPCWSTR, + pszSubIdList: LPCWSTR, + ) -> HRESULT; + pub fn GetThemeFilename( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + pszThemeFileName: LPWSTR, + cchMaxBuffChars: c_int, + ) -> HRESULT; + pub fn GetThemeSysColor( + hTheme: HTHEME, + iColorId: c_int, + ) -> COLORREF; + pub fn GetThemeSysColorBrush( + hTheme: HTHEME, + iColorId: c_int, + ) -> HBRUSH; + pub fn GetThemeSysBool( + hTheme: HTHEME, + iBoolId: c_int, + ) -> BOOL; + pub fn GetThemeSysSize( + hTheme: HTHEME, + iSizeId: c_int, + ) -> c_int; + pub fn GetThemeSysFont( + hTheme: HTHEME, + iFontId: c_int, + plf: *mut LOGFONTW, + ) -> HRESULT; + pub fn GetThemeSysString( + hTheme: HTHEME, + iStringId: c_int, + pszStringBuff: LPWSTR, + cchMaxStringChars: c_int, + ) -> HRESULT; + pub fn GetThemeSysInt( + hTheme: HTHEME, + iIntId: c_int, + piValue: *mut c_int, + ) -> HRESULT; + pub fn IsThemeActive() -> BOOL; + pub fn IsAppThemed() -> BOOL; + pub fn GetWindowTheme( + hwnd: HWND, + ) -> HTHEME; +} +pub const ETDT_DISABLE: DWORD = 0x00000001; +pub const ETDT_ENABLE: DWORD = 0x00000002; +pub const ETDT_USETABTEXTURE: DWORD = 0x00000004; +pub const ETDT_ENABLETAB: DWORD = ETDT_ENABLE | ETDT_USETABTEXTURE; +pub const ETDT_USEAEROWIZARDTABTEXTURE: DWORD = 0x00000008; +pub const ETDT_ENABLEAEROWIZARDTAB: DWORD = ETDT_ENABLE | ETDT_USEAEROWIZARDTABTEXTURE; +pub const ETDT_VALIDBITS: DWORD = ETDT_DISABLE | ETDT_ENABLE | ETDT_USETABTEXTURE + | ETDT_USEAEROWIZARDTABTEXTURE; +extern "system" { + pub fn EnableThemeDialogTexture( + hwnd: HWND, + dwFlags: DWORD, + ) -> HRESULT; + pub fn IsThemeDialogTextureEnabled( + hwnd: HWND, + ) -> BOOL; +} +pub const STAP_ALLOW_NONCLIENT: DWORD = 1 << 0; +pub const STAP_ALLOW_CONTROLS: DWORD = 1 << 1; +pub const STAP_ALLOW_WEBCONTENT: DWORD = 1 << 2; +pub const STAP_VALIDBITS: DWORD = STAP_ALLOW_NONCLIENT | STAP_ALLOW_CONTROLS + | STAP_ALLOW_WEBCONTENT; +extern "system" { + pub fn GetThemeAppProperties() -> DWORD; + pub fn SetThemeAppProperties( + dwFlags: DWORD, + ); + pub fn GetCurrentThemeName( + pszThemeFileName: LPWSTR, + cchMaxNameChars: c_int, + pszColorBuff: LPWSTR, + cchMaxColorChars: c_int, + pszSizeBuff: LPWSTR, + cchMaxSizeChars: c_int, + ) -> HRESULT; +} +pub const SZ_THDOCPROP_DISPLAYNAME: &'static str = "DisplayName"; +pub const SZ_THDOCPROP_CANONICALNAME: &'static str = "ThemeName"; +pub const SZ_THDOCPROP_TOOLTIP: &'static str = "ToolTip"; +pub const SZ_THDOCPROP_AUTHOR: &'static str = "author"; +extern "system" { + pub fn GetThemeDocumentationProperty( + pszThemeName: LPCWSTR, + pszPropertyName: LPCWSTR, + pszValueBuff: LPWSTR, + cchMaxValChars: c_int, + ) -> HRESULT; + pub fn DrawThemeParentBackground( + hwnd: HWND, + hdc: HDC, + prc: *const RECT, + ) -> HRESULT; + pub fn EnableTheming( + fEnable: BOOL, + ) -> HRESULT; +} +pub const GBF_DIRECT: ULONG = 0x00000001; +pub const GBF_COPY: ULONG = 0x00000002; +pub const GBF_VALIDBITS: ULONG = GBF_DIRECT | GBF_COPY; +pub const DTPB_WINDOWDC: DWORD = 0x00000001; +pub const DTPB_USECTLCOLORSTATIC: DWORD = 0x00000002; +pub const DTPB_USEERASEBKGND: DWORD = 0x00000004; +extern "system" { + pub fn DrawThemeParentBackgroundEx( + hwnd: HWND, + hdc: HDC, + dwFlags: DWORD, + prc: *const RECT, + ) -> HRESULT; +} +ENUM!{enum WINDOWTHEMEATTRIBUTETYPE { + WTA_NONCLIENT = 1, +}} +STRUCT!{struct WTA_OPTIONS { + dwFlags: DWORD, + dwMask: DWORD, +}} +pub type PWTA_OPTIONS = *mut WTA_OPTIONS; +pub const WTNCA_NODRAWCAPTION: DWORD = 0x00000001; +pub const WTNCA_NODRAWICON: DWORD = 0x00000002; +pub const WTNCA_NOSYSMENU: DWORD = 0x00000004; +pub const WTNCA_NOMIRRORHELP: DWORD = 0x00000008; +pub const WTNCA_VALIDBITS: DWORD = WTNCA_NODRAWCAPTION | WTNCA_NODRAWICON | WTNCA_NOSYSMENU + | WTNCA_NOMIRRORHELP; +extern "system" { + pub fn SetWindowThemeAttribute( + hwnd: HWND, + eAttribute: WINDOWTHEMEATTRIBUTETYPE, + pvAttribute: PVOID, + cbAttribute: DWORD, + ) -> HRESULT; +} +#[inline] +pub unsafe fn SetWindowThemeNonClientAttributes( + hwnd: HWND, + dwMask: DWORD, + dwAttributes: DWORD, +) -> HRESULT { + use core::mem::{size_of, zeroed}; + let mut wta: WTA_OPTIONS = zeroed(); + wta.dwFlags = dwAttributes; + wta.dwMask = dwMask; + SetWindowThemeAttribute( + hwnd, + WTA_NONCLIENT, + &mut wta as *mut WTA_OPTIONS as *mut c_void, + size_of::() as u32, + ) +} +FN!{stdcall DTT_CALLBACK_PROC( + hdc: HDC, + pszText: LPWSTR, + cchText: c_int, + prc: LPRECT, + dwFlags: UINT, + lParam: LPARAM, +) -> c_int} +pub const DTT_TEXTCOLOR: DWORD = 1 << 0; +pub const DTT_BORDERCOLOR: DWORD = 1 << 1; +pub const DTT_SHADOWCOLOR: DWORD = 1 << 2; +pub const DTT_SHADOWTYPE: DWORD = 1 << 3; +pub const DTT_SHADOWOFFSET: DWORD = 1 << 4; +pub const DTT_BORDERSIZE: DWORD = 1 << 5; +pub const DTT_FONTPROP: DWORD = 1 << 6; +pub const DTT_COLORPROP: DWORD = 1 << 7; +pub const DTT_STATEID: DWORD = 1 << 8; +pub const DTT_CALCRECT: DWORD = 1 << 9; +pub const DTT_APPLYOVERLAY: DWORD = 1 << 10; +pub const DTT_GLOWSIZE: DWORD = 1 << 11; +pub const DTT_CALLBACK: DWORD = 1 << 12; +pub const DTT_COMPOSITED: DWORD = 1 << 13; +pub const DTT_VALIDBITS: DWORD = DTT_TEXTCOLOR | DTT_BORDERCOLOR | DTT_SHADOWCOLOR + | DTT_SHADOWTYPE | DTT_SHADOWOFFSET | DTT_BORDERSIZE | DTT_FONTPROP | DTT_COLORPROP + | DTT_STATEID | DTT_CALCRECT | DTT_APPLYOVERLAY | DTT_GLOWSIZE | DTT_COMPOSITED; +STRUCT!{struct DTTOPTS { + dwSize: DWORD, + dwFlags: DWORD, + crText: COLORREF, + crBorder: COLORREF, + crShadow: COLORREF, + iTextShadowType: c_int, + ptShadowOffset: POINT, + iBorderSize: c_int, + iFontPropId: c_int, + iColorPropId: c_int, + iStateId: c_int, + fApplyOverlay: BOOL, + iGlowSize: c_int, + pfnDrawTextCallback: DTT_CALLBACK_PROC, + lParam: LPARAM, +}} +pub type PDTTOPTS = *mut DTTOPTS; +extern "system" { + pub fn DrawThemeTextEx( + hTheme: HTHEME, + hdc: HDC, + iPartId: c_int, + iStateId: c_int, + pszText: LPCWSTR, + cchText: c_int, + dwTextFlags: DWORD, + pRect: LPRECT, + pOptions: *const DTTOPTS, + ) -> HRESULT; + pub fn GetThemeBitmap( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + dwFlags: ULONG, + phBitmap: *mut HBITMAP, + ) -> HRESULT; + pub fn GetThemeStream( + hTheme: HTHEME, + iPartId: c_int, + iStateId: c_int, + iPropId: c_int, + ppvStream: *mut *mut VOID, + pcbStream: *mut DWORD, + hInst: HINSTANCE, + ) -> HRESULT; + pub fn BufferedPaintInit() -> HRESULT; + pub fn BufferedPaintUnInit() -> HRESULT; +} +pub type HPAINTBUFFER = HANDLE; +ENUM!{enum BP_BUFFERFORMAT { + BPBF_COMPATIBLEBITMAP = 0, + BPBF_DIB = 1, + BPBF_TOPDOWNDIB = 2, + BPBF_TOPDOWNMONODIB = 3, +}} +pub const BPBF_COMPOSITED: BP_BUFFERFORMAT = BPBF_TOPDOWNDIB; +ENUM!{enum BP_ANIMATIONSTYLE { + BPAS_NONE = 0, + BPAS_LINEAR = 1, + BPAS_CUBIC = 2, + BPAS_SINE = 3, +}} +STRUCT!{struct BP_ANIMATIONPARAMS { + cbSize: DWORD, + dwFlags: DWORD, + style: BP_ANIMATIONSTYLE, + dwDuration: DWORD, +}} +pub type PBP_ANIMATIONPARAMS = *mut BP_ANIMATIONPARAMS; +pub const BPPF_ERASE: DWORD = 0x0001; +pub const BPPF_NOCLIP: DWORD = 0x0002; +pub const BPPF_NONCLIENT: DWORD = 0x0004; +STRUCT!{struct BP_PAINTPARAMS { + cbSize: DWORD, + dwFlags: DWORD, + prcExclude: *const RECT, + pBlendFunction: *const BLENDFUNCTION, +}} +pub type PBP_PAINTPARAMS = *mut BP_PAINTPARAMS; +extern "system" { + pub fn BeginBufferedPaint( + hdcTarget: HDC, + prcTarget: *const RECT, + dwFormat: BP_BUFFERFORMAT, + pPaintParams: *mut BP_PAINTPARAMS, + phdc: *mut HDC, + ) -> HPAINTBUFFER; + pub fn EndBufferedPaint( + hBufferedPaint: HPAINTBUFFER, + fUpdateTarget: BOOL, + ) -> HRESULT; + pub fn GetBufferedPaintTargetRect( + hBufferedPaint: HPAINTBUFFER, + prc: *mut RECT, + ) -> HRESULT; + pub fn GetBufferedPaintTargetDC( + hBufferedPaint: HPAINTBUFFER, + ) -> HDC; + pub fn GetBufferedPaintDC( + hBufferedPaint: HPAINTBUFFER, + ) -> HDC; + pub fn GetBufferedPaintBits( + hBufferedPaint: HPAINTBUFFER, + ppbBuffer: *mut *mut RGBQUAD, + pcxRow: *mut c_int, + ) -> HRESULT; + pub fn BufferedPaintClear( + hBufferedPaint: HPAINTBUFFER, + prc: *const RECT, + ) -> HRESULT; + pub fn BufferedPaintSetAlpha( + hBufferedPaint: HPAINTBUFFER, + prc: *const RECT, + alpha: BYTE, + ) -> HRESULT; + pub fn BufferedPaintStopAllAnimations( + hwnd: HWND, + ) -> HRESULT; +} +pub type HANIMATIONBUFFER = HANDLE; +extern "system" { + pub fn BeginBufferedAnimation( + hwnd: HWND, + hdcTarget: HDC, + prcTarget: *const RECT, + dwFormat: BP_BUFFERFORMAT, + pPaintParams: *mut BP_PAINTPARAMS, + pAnimationParams: *mut BP_ANIMATIONPARAMS, + phdcFrom: *mut HDC, + phdcTo: *mut HDC, + ) -> HANIMATIONBUFFER; + pub fn EndBufferedAnimation( + hbpAnimation: HANIMATIONBUFFER, + fUpdateTarget: BOOL, + ) -> HRESULT; + pub fn BufferedPaintRenderAnimation( + hwnd: HWND, + hdcTarget: HDC, + ) -> BOOL; + pub fn IsCompositionActive() -> BOOL; + pub fn GetThemeTransitionDuration( + hTheme: HTHEME, + iPartId: c_int, + iStateIdFrom: c_int, + iStateIdTo: c_int, + iPropId: c_int, + pdwDuration: *mut DWORD, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/vsbackup.rs b/bash-5.1/vendor/winapi/src/um/vsbackup.rs new file mode 100644 index 0000000000000000000000000000000000000000..0a7f2602c2f3c6c4525a6f7364391911d2f945aa --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/vsbackup.rs @@ -0,0 +1,520 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Declaration of backup interfaces. +use ctypes::c_void; +use shared::guiddef::IID; +use shared::minwindef::{BOOL, BYTE, DWORD, UINT}; +use shared::wtypes::BSTR; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::vss::{ + IVssAsync, IVssEnumObject, VSS_BACKUP_TYPE, VSS_ID, VSS_OBJECT_TYPE, VSS_PWSZ, + VSS_RESTORE_TYPE, VSS_ROLLFORWARD_TYPE, VSS_SNAPSHOT_PROP, VSS_WRITER_STATE +}; +use um::vswriter::{ + IVssWMDependency, IVssWMFiledesc, IVssWriterComponentsVtbl, VSS_COMPONENT_TYPE, + VSS_FILE_RESTORE_STATUS, VSS_RESTOREMETHOD_ENUM, VSS_SOURCE_TYPE, VSS_USAGE_TYPE, + VSS_WRITERRESTORE_ENUM +}; +use um::winnt::{HRESULT, LONG, LPCWSTR}; +DEFINE_GUID!{IID_IVssExamineWriterMetadata, + 0x902fcf7f, 0xb7fd, 0x42f8, 0x81, 0xf1, 0xb2, 0xe4, 0x00, 0xb1, 0xe5, 0xbd} +DEFINE_GUID!{IID_IVssExamineWriterMetadataEx, + 0x0c0e5ec0, 0xca44, 0x472b, 0xb7, 0x02, 0xe6, 0x52, 0xdb, 0x1c, 0x04, 0x51} +DEFINE_GUID!{IID_IVssBackupComponents, + 0x665c1d5f, 0xc218, 0x414d, 0xa0, 0x5d, 0x7f, 0xef, 0x5f, 0x9d, 0x5c, 0x86} +DEFINE_GUID!{IID_IVssBackupComponentsEx, + 0x963f03ad, 0x9e4c, 0x4a34, 0xac, 0x15, 0xe4, 0xb6, 0x17, 0x4e, 0x50, 0x36} +STRUCT!{struct VSS_COMPONENTINFO { + type_: VSS_COMPONENT_TYPE, // type is a keyword in rust + bstrLogicalPath: BSTR, + bstrComponentName: BSTR, + bstrCaption: BSTR, + pbIcon: *mut BYTE, + cbIcon: UINT, + bRestoreMetadata: bool, + bNotifyOnBackupComplete: bool, + bSelectable: bool, + bSelectableForRestore: bool, + dwComponentFlags: DWORD, + cFileCount: UINT, + cDatabases: UINT, + cLogFiles: UINT, + cDependencies: UINT, +}} +pub type PVSSCOMPONENTINFO = *const VSS_COMPONENTINFO; +RIDL!{#[uuid(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)] +interface IVssWMComponent(IVssWMComponentVtbl): IUnknown(IUnknownVtbl) { + fn GetComponentInfo( + ppInfo: *mut PVSSCOMPONENTINFO, + ) -> HRESULT, + fn FreeComponentInfo( + pInfo: PVSSCOMPONENTINFO, + ) -> HRESULT, + fn GetFile( + iFile: UINT, + ppFiledesc: *mut *mut IVssWMFiledesc, + ) -> HRESULT, + fn GetDatabaseFile( + iDBFile: UINT, + ppFiledesc: *mut *mut IVssWMFiledesc, + ) -> HRESULT, + fn GetDatabaseLogFile( + iDbLogFile: UINT, + ppFiledesc: *mut *mut IVssWMFiledesc, + ) -> HRESULT, + fn GetDependency( + iDependency: UINT, + ppDependency: *mut *mut IVssWMDependency, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x902fcf7f, 0xb7fd, 0x42f8, 0x81, 0xf1, 0xb2, 0xe4, 0x00, 0xb1, 0xe5, 0xbd)] +interface IVssExamineWriterMetadata(IVssExamineWriterMetadataVtbl): IUnknown(IUnknownVtbl) { + fn GetIdentity( + pidInstance: *mut VSS_ID, + pidWriter: *mut VSS_ID, + pbstrWriterName: *mut BSTR, + pUsage: *mut VSS_USAGE_TYPE, + pSource: *mut VSS_SOURCE_TYPE, + ) -> HRESULT, + fn GetFileCounts( + pcIncludeFiles: *mut UINT, + pcExcludeFiles: *mut UINT, + pcComponents: *mut UINT, + ) -> HRESULT, + fn GetIncludeFile( + iFile: UINT, + ppFiledesc: *mut *mut IVssWMFiledesc, + ) -> HRESULT, + fn GetExcludeFile( + iFile: UINT, + ppFiledesc: *mut *mut IVssWMFiledesc, + ) -> HRESULT, + fn GetComponent( + iComponent: UINT, + ppComponent: *mut *mut IVssWMComponent, + ) -> HRESULT, + fn GetRestoreMethod( + pMethod: *mut VSS_RESTOREMETHOD_ENUM, + pbstrService: *mut BSTR, + pbstrUserProcedure: *mut BSTR, + pwriterRestore: *mut VSS_WRITERRESTORE_ENUM, + pbRebootRequired: *mut bool, + pcMappings: *mut UINT, + ) -> HRESULT, + fn GetAlternateLocationMapping( + iMapping: UINT, + ppFiledesc: *mut *mut IVssWMFiledesc, + ) -> HRESULT, + fn GetBackupSchema( + pdwSchemaMask: *mut DWORD, + ) -> HRESULT, + fn GetDocument( + pDoc: *mut c_void, + ) -> HRESULT, //TODO IXMLDOMDocument, + fn SaveAsXML( + pbstrXML: *mut BSTR, + ) -> HRESULT, + fn LoadFromXML( + pbstrXML: *mut BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x0c0e5ec0, 0xca44, 0x472b, 0xb7, 0x02, 0xe6, 0x52, 0xdb, 0x1c, 0x04, 0x51)] +interface IVssExamineWriterMetadataEx(IVssExamineWriterMetadataExVtbl): + IVssExamineWriterMetadata(IVssExamineWriterMetadataVtbl) { + fn GetIdentityEx( + pidInstance: *mut VSS_ID, + pidWriter: *mut VSS_ID, + pbstrWriterName: *mut BSTR, + pbstrInstanceName: *mut BSTR, + pUsage: *mut VSS_USAGE_TYPE, + pSource: *mut VSS_SOURCE_TYPE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xce115780, 0xa611, 0x431b, 0xb5, 0x7f, 0xc3, 0x83, 0x03, 0xab, 0x6a, 0xee)] +interface IVssExamineWriterMetadataEx2(IVssExamineWriterMetadataEx2Vtbl): + IVssExamineWriterMetadataEx(IVssExamineWriterMetadataExVtbl) { + fn GetVersion( + pdwMajorVersion: *mut DWORD, + pdwMinorVersion: *mut DWORD, + ) -> HRESULT, + fn GetExcludeFromSnapshotCount( + pcExcludedFromSnapshot: *mut UINT, + ) -> HRESULT, + fn GetExcludeFromSnapshotFile( + iFile: UINT, + ppFiledesc: *mut *mut IVssWMFiledesc, + ) -> HRESULT, +}} +#[repr(C)] +pub struct IVssWriterComponentsExt { + pub lpVtbl: *const IVssWriterComponentsExtVtbl, +} +#[repr(C)] +pub struct IVssWriterComponentsExtVtbl { + pub parent1: IVssWriterComponentsVtbl, + pub parent2: IUnknownVtbl, +} +RIDL!{#[uuid(0x665c1d5f, 0xc218, 0x414d, 0xa0, 0x5d, 0x7f, 0xef, 0x5f, 0x9d, 0x5c, 0x86)] +interface IVssBackupComponents(IVssBackupComponentsVtbl): IUnknown(IUnknownVtbl) { + fn GetWriterComponentsCount( + pcComponents: *mut UINT, + ) -> HRESULT, + fn GetWriterComponents( + iWriter: UINT, + ppWriter: *mut *mut IVssWriterComponentsExt, + ) -> HRESULT, + fn InitializeForBackup( + bstrXML: BSTR, + ) -> HRESULT, + fn SetBackupState( + bSelectComponents: bool, + bBackupBootableSystemState: bool, + backupType: VSS_BACKUP_TYPE, + bPartialFileSupport: bool, + ) -> HRESULT, + fn InitializeForRestore( + bstrXML: BSTR, + ) -> HRESULT, + fn SetRestoreState( + restoreType: VSS_RESTORE_TYPE, + ) -> HRESULT, + fn GatherWriterMetadata( + pAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn GetWriterMetadataCount( + pcWriters: *mut UINT, + ) -> HRESULT, + fn GetWriterMetadata( + iWriter: UINT, + pidInstance: *mut VSS_ID, + ppMetadata: *mut *mut IVssExamineWriterMetadata, + ) -> HRESULT, + fn FreeWriterMetadata() -> HRESULT, + fn AddComponent( + instanceId: VSS_ID, + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + ) -> HRESULT, + fn PrepareForBackup( + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn AbortBackup() -> HRESULT, + fn GatherWriterStatus( + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn GetWriterStatusCount( + pcWriters: *mut UINT, + ) -> HRESULT, + fn FreeWriterStatus() -> HRESULT, + fn GetWriterStatus( + iWriter: UINT, + pidInstance: *mut VSS_ID, + pidWriter: *mut VSS_ID, + pbstrWriter: *mut BSTR, + pnStatus: *mut VSS_WRITER_STATE, + phResultFailure: *mut HRESULT, + ) -> HRESULT, + fn SetBackupSucceeded( + instanceId: VSS_ID, + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + bSucceded: bool, + ) -> HRESULT, + fn SetBackupOptions( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + wszBackupOptions: LPCWSTR, + ) -> HRESULT, + fn SetSelectedForRestore( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + bSelectedForRestore: bool, + ) -> HRESULT, + fn SetRestoreOptions( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + wszRestoreOptions: LPCWSTR, + ) -> HRESULT, + fn SetAdditionalRestores( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + bAdditionalRestores: bool, + ) -> HRESULT, + fn SetPreviousBackupStamp( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + wszPreviousBackupStamp: LPCWSTR, + ) -> HRESULT, + fn SaveAsXML( + pbstrXML: *mut BSTR, + ) -> HRESULT, + fn BackupComplete( + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn AddAlternativeLocationMapping( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + wszPath: LPCWSTR, + wszFilespec: LPCWSTR, + bRecursive: bool, + wszDestination: LPCWSTR, + ) -> HRESULT, + fn AddRestoreSubcomponent( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + wszSubComponentLogicalPath: LPCWSTR, + wszSubComponentName: LPCWSTR, + bRepair: bool, + ) -> HRESULT, + fn SetFileRestoreStatus( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + status: VSS_FILE_RESTORE_STATUS, + ) -> HRESULT, + fn AddNewTarget( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + wszPath: LPCWSTR, + wszFileName: LPCWSTR, + bRecursive: bool, + wszAlternatePath: LPCWSTR, + ) -> HRESULT, + fn SetRangesFilePath( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + iPartialFile: UINT, + wszRangesFile: LPCWSTR, + ) -> HRESULT, + fn PreRestore( + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn PostRestore( + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn SetContext( + lContext: LONG, + ) -> HRESULT, + fn StartSnapshotSet( + pSnapshotSetId: *mut VSS_ID, + ) -> HRESULT, + fn AddToSnapshotSet( + pwszVolumeName: VSS_PWSZ, + ProviderId: VSS_ID, + pidSnapshot: *mut VSS_ID, + ) -> HRESULT, + fn DoSnapshotSet( + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn DeleteSnapshots( + SourceObjectId: VSS_ID, + eSourceObjectType: VSS_OBJECT_TYPE, + bForceDelete: BOOL, + plDeletedSnapshots: *mut LONG, + pNondeletedSnapshotID: *mut VSS_ID, + ) -> HRESULT, + fn ImportSnapshots( + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn BreakSnapshotSet( + SnapshotSetId: VSS_ID, + ) -> HRESULT, + fn GetSnapshotProperties( + SnapshotId: VSS_ID, + pProp: *mut VSS_SNAPSHOT_PROP, + ) -> HRESULT, + fn Query( + QueriedObjectId: VSS_ID, + eQueriedObjectType: VSS_OBJECT_TYPE, + eReturnedObjectsType: VSS_OBJECT_TYPE, + ppEnum: *mut *mut IVssEnumObject, + ) -> HRESULT, + fn IsVolumeSupported( + ProviderId: VSS_ID, + pwszVolumeName: VSS_PWSZ, + pbSupportedByThisProvider: *mut BOOL, + ) -> HRESULT, + fn DisableWriterClasses( + rgWriterClassId: *const VSS_ID, + cClassId: UINT, + ) -> HRESULT, + fn EnableWriterClasses( + rgWriterClassId: *const VSS_ID, + cClassId: UINT, + ) -> HRESULT, + fn DisableWriterInstances( + rgWriterInstanceId: *const VSS_ID, + cInstanceId: UINT, + ) -> HRESULT, + fn ExposeSnapshot( + SnapshotId: VSS_ID, + wszPathFromRoot: VSS_PWSZ, + lAttributes: LONG, + wszExpose: VSS_PWSZ, + pwszExposed: VSS_PWSZ, + ) -> HRESULT, + fn RevertToSnapshot( + SnapshotId: VSS_ID, + bForceDismount: BOOL, + ) -> HRESULT, + fn QueryRevertStatus( + pwszVolume: VSS_PWSZ, + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x963f03ad, 0x9e4c, 0x4a34, 0xac, 0x15, 0xe4, 0xb6, 0x17, 0x4e, 0x50, 0x36)] +interface IVssBackupComponentsEx(IVssBackupComponentsExVtbl): + IVssBackupComponents(IVssBackupComponentsVtbl) { + fn GetWriterMetadataEx( + iWriter: UINT, + pidInstance: *mut VSS_ID, + ppMetadata: *mut *mut IVssExamineWriterMetadataEx, + ) -> HRESULT, + fn SetSelectedForRestoreEx( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + bSelectedForRestore: bool, + instanceId: VSS_ID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xacfe2b3a, 0x22c9, 0x4ef8, 0xbd, 0x03, 0x2f, 0x9c, 0xa2, 0x30, 0x08, 0x4e)] +interface IVssBackupComponentsEx2(IVssBackupComponentsEx2Vtbl): + IVssBackupComponentsEx(IVssBackupComponentsExVtbl) { + fn UnexposeSnapshot( + snapshotId: VSS_ID, + ) -> HRESULT, + fn SetAuthoritativeRestore( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + bAuth: bool, + ) -> HRESULT, + fn SetRollForward( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + rollType: VSS_ROLLFORWARD_TYPE, + wszRollForwardPoint: LPCWSTR, + ) -> HRESULT, + fn SetRestoreName( + writerId: VSS_ID, + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + wszRestoreName: LPCWSTR, + ) -> HRESULT, + fn BreakSnapshotSetEx( + SnapshotSetID: VSS_ID, + dwBreakFlags: DWORD, + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn PreFastRecovery( + SnapshotSetID: VSS_ID, + dwPreFastRecoveryFlags: DWORD, + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn FastRecovery( + SnapshotSetID: VSS_ID, + dwFastRecoveryFlags: DWORD, + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xc191bfbc, 0xb602, 0x4675, 0x8b, 0xd1, 0x67, 0xd6, 0x42, 0xf5, 0x29, 0xd5)] +interface IVssBackupComponentsEx3(IVssBackupComponentsEx3Vtbl): + IVssBackupComponentsEx2(IVssBackupComponentsEx2Vtbl) { + fn GetWriterStatusEx( + iWriter: UINT, + pidInstance: *mut VSS_ID, + pidWriter: *mut VSS_ID, + pbstrWriter: *mut BSTR, + pnStatus: *mut VSS_WRITER_STATE, + phrFailureWriter: *mut HRESULT, + phrApplication: *mut HRESULT, + pbstrApplicationMessage: *mut BSTR, + ) -> HRESULT, + fn AddSnapshotToRecoverySet( + snapshotId: VSS_ID, + dwFlags: DWORD, + pwszDestinationVolume: VSS_PWSZ, + ) -> HRESULT, + fn RecoverSet( + dwFlags: DWORD, + ppAsync: *mut *mut IVssAsync, + ) -> HRESULT, + fn GetSessionId( + idSession: *mut VSS_ID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf434c2fd, 0xb553, 0x4961, 0xa9, 0xf9, 0xa8, 0xe9, 0x0b, 0x67, 0x3e, 0x53)] +interface IVssBackupComponentsEx4(IVssBackupComponentsEx4Vtbl): + IVssBackupComponentsEx3(IVssBackupComponentsEx3Vtbl) { + fn GetRootAndLogicalPrefixPaths( + pwszFilePath: VSS_PWSZ, + ppwszRootPath: *mut VSS_PWSZ, + ppwszLogicalPrefix: *mut VSS_PWSZ, + bNormalizeFQDNforRootPath: BOOL, + ) -> HRESULT, +}} +pub const VSS_SW_BOOTABLE_STATE: DWORD = 1; +extern "system" { + #[link_name="CreateVssBackupComponentsInternal"] + pub fn CreateVssBackupComponents( + ppBackup: *mut *mut IVssBackupComponents, + ) -> HRESULT; + #[link_name="CreateVssExamineWriterMetadataInternal"] + pub fn CreateVssExamineWriterMetadata( + bstrXML: BSTR, + ppMetadata: *mut *mut IVssExamineWriterMetadata, + ) -> HRESULT; + #[link_name="IsVolumeSnapshottedInternal"] + pub fn IsVolumeSnapshotted( + pwszVolumeName: VSS_PWSZ, + pbSnapshotsPresent: *mut BOOL, + plSnapshotCapability: *mut LONG, + ) -> HRESULT; + #[link_name="VssFreeSnapshotPropertiesInternal"] + pub fn VssFreeSnapshotProperties( + pProp: *mut VSS_SNAPSHOT_PROP, + ); + #[link_name="GetProviderMgmtInterfaceInternal"] + pub fn GetProviderMgmtInterface( + ProviderId: VSS_ID, + InterfaceId: IID, + ppItf: *mut *mut IUnknown, + ) -> HRESULT; + #[link_name="ShouldBlockRevertInternal"] + pub fn ShouldBlockRevert( + wszVolumeName: LPCWSTR, + pbBlock: *mut bool, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/vss.rs b/bash-5.1/vendor/winapi/src/um/vss.rs new file mode 100644 index 0000000000000000000000000000000000000000..7038f0376ddb27bddf24519313cec258c499df96 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/vss.rs @@ -0,0 +1,284 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! VSS header file +use shared::guiddef::{CLSID, GUID}; +use shared::minwindef::{DWORD, INT, ULONG}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LONG, LONGLONG, WCHAR}; +ENUM!{enum VSS_OBJECT_TYPE { + VSS_OBJECT_UNKNOWN = 0, + VSS_OBJECT_NONE = 1, + VSS_OBJECT_SNAPSHOT_SET = 2, + VSS_OBJECT_SNAPSHOT = 3, + VSS_OBJECT_PROVIDER = 4, + VSS_OBJECT_TYPE_COUNT = 5, +}} +pub type PVSS_OBJECT_TYPE = *mut VSS_OBJECT_TYPE; +ENUM!{enum VSS_SNAPSHOT_STATE { + VSS_SS_UNKNOWN = 0x00, + VSS_SS_PREPARING = 0x01, + VSS_SS_PROCESSING_PREPARE = 0x02, + VSS_SS_PREPARED = 0x03, + VSS_SS_PROCESSING_PRECOMMIT = 0x04, + VSS_SS_PRECOMMITTED = 0x05, + VSS_SS_PROCESSING_COMMIT = 0x06, + VSS_SS_COMMITTED = 0x07, + VSS_SS_PROCESSING_POSTCOMMIT = 0x08, + VSS_SS_PROCESSING_PREFINALCOMMIT = 0x09, + VSS_SS_PREFINALCOMMITTED = 0x0a, + VSS_SS_PROCESSING_POSTFINALCOMMIT = 0x0b, + VSS_SS_CREATED = 0x0c, + VSS_SS_ABORTED = 0x0d, + VSS_SS_DELETED = 0x0e, + VSS_SS_POSTCOMMITTED = 0x0f, + VSS_SS_COUNT = 0x10, +}} +pub type PVSS_SNAPSHOT_STATE = *mut VSS_SNAPSHOT_STATE; +ENUM!{enum VSS_VOLUME_SNAPSHOT_ATTRIBUTES { + VSS_VOLSNAP_ATTR_PERSISTENT = 0x00000001, + VSS_VOLSNAP_ATTR_NO_AUTORECOVERY = 0x00000002, + VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE = 0x00000004, + VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE = 0x00000008, + VSS_VOLSNAP_ATTR_NO_WRITERS = 0x00000010, + VSS_VOLSNAP_ATTR_TRANSPORTABLE = 0x00000020, + VSS_VOLSNAP_ATTR_NOT_SURFACED = 0x00000040, + VSS_VOLSNAP_ATTR_NOT_TRANSACTED = 0x00000080, + VSS_VOLSNAP_ATTR_HARDWARE_ASSISTED = 0x00010000, + VSS_VOLSNAP_ATTR_DIFFERENTIAL = 0x00020000, + VSS_VOLSNAP_ATTR_PLEX = 0x00040000, + VSS_VOLSNAP_ATTR_IMPORTED = 0x00080000, + VSS_VOLSNAP_ATTR_EXPOSED_LOCALLY = 0x00100000, + VSS_VOLSNAP_ATTR_EXPOSED_REMOTELY = 0x00200000, + VSS_VOLSNAP_ATTR_AUTORECOVER = 0x00400000, + VSS_VOLSNAP_ATTR_ROLLBACK_RECOVERY = 0x00800000, + VSS_VOLSNAP_ATTR_DELAYED_POSTSNAPSHOT = 0x01000000, + VSS_VOLSNAP_ATTR_TXF_RECOVERY = 0x02000000, + VSS_VOLSNAP_ATTR_FILE_SHARE = 0x04000000, +}} +pub type PVSS_VOLUME_SNAPSHOT_ATTRIBUTES = *mut VSS_VOLUME_SNAPSHOT_ATTRIBUTES; +ENUM!{enum VSS_SNAPSHOT_CONTEXT { + VSS_CTX_BACKUP = 0, + VSS_CTX_FILE_SHARE_BACKUP = VSS_VOLSNAP_ATTR_NO_WRITERS, + VSS_CTX_NAS_ROLLBACK = VSS_VOLSNAP_ATTR_PERSISTENT + | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE | VSS_VOLSNAP_ATTR_NO_WRITERS, + VSS_CTX_APP_ROLLBACK = VSS_VOLSNAP_ATTR_PERSISTENT + | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE, + VSS_CTX_CLIENT_ACCESSIBLE = VSS_VOLSNAP_ATTR_PERSISTENT + | VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE + | VSS_VOLSNAP_ATTR_NO_WRITERS, + VSS_CTX_CLIENT_ACCESSIBLE_WRITERS = VSS_VOLSNAP_ATTR_PERSISTENT + | VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE, + VSS_CTX_ALL = 0xffffffff, +}} +pub type PVSS_SNAPSHOT_CONTEXT = *mut VSS_SNAPSHOT_CONTEXT; +ENUM!{enum VSS_PROVIDER_CAPABILITIES { + VSS_PRV_CAPABILITY_LEGACY = 0x1, + VSS_PRV_CAPABILITY_COMPLIANT = 0x2, + VSS_PRV_CAPABILITY_LUN_REPOINT = 0x4, + VSS_PRV_CAPABILITY_LUN_RESYNC = 0x8, + VSS_PRV_CAPABILITY_OFFLINE_CREATION = 0x10, + VSS_PRV_CAPABILITY_MULTIPLE_IMPORT = 0x20, + VSS_PRV_CAPABILITY_RECYCLING = 0x40, + VSS_PRV_CAPABILITY_PLEX = 0x80, + VSS_PRV_CAPABILITY_DIFFERENTIAL = 0x100, + VSS_PRV_CAPABILITY_CLUSTERED = 0x200, +}} +pub type PVSS_PROVIDER_CAPABILITIES = *mut VSS_PROVIDER_CAPABILITIES; +ENUM!{enum VSS_HARDWARE_OPTIONS { + VSS_BREAKEX_FLAG_MASK_LUNS = 0x1, + VSS_BREAKEX_FLAG_MAKE_READ_WRITE = 0x2, + VSS_BREAKEX_FLAG_REVERT_IDENTITY_ALL = 0x4, + VSS_BREAKEX_FLAG_REVERT_IDENTITY_NONE = 0x8, + VSS_ONLUNSTATECHANGE_NOTIFY_READ_WRITE = 0x100, + VSS_ONLUNSTATECHANGE_NOTIFY_LUN_PRE_RECOVERY = 0x200, + VSS_ONLUNSTATECHANGE_NOTIFY_LUN_POST_RECOVERY = 0x400, + VSS_ONLUNSTATECHANGE_DO_MASK_LUNS = 0x800, +}} +pub type PVSS_HARDWARE_OPTIONS = *mut VSS_HARDWARE_OPTIONS; +ENUM!{enum VSS_RECOVERY_OPTIONS { + VSS_RECOVERY_REVERT_IDENTITY_ALL = 0x00000100, + VSS_RECOVERY_NO_VOLUME_CHECK = 0x00000200, +}} +pub type PVSS_RECOVERY_OPTIONS = *mut VSS_RECOVERY_OPTIONS; +ENUM!{enum VSS_WRITER_STATE { + VSS_WS_UNKNOWN = 0, + VSS_WS_STABLE = 1, + VSS_WS_WAITING_FOR_FREEZE = 2, + VSS_WS_WAITING_FOR_THAW = 3, + VSS_WS_WAITING_FOR_POST_SNAPSHOT = 4, + VSS_WS_WAITING_FOR_BACKUP_COMPLETE = 5, + VSS_WS_FAILED_AT_IDENTIFY = 6, + VSS_WS_FAILED_AT_PREPARE_BACKUP = 7, + VSS_WS_FAILED_AT_PREPARE_SNAPSHOT = 8, + VSS_WS_FAILED_AT_FREEZE = 9, + VSS_WS_FAILED_AT_THAW = 10, + VSS_WS_FAILED_AT_POST_SNAPSHOT = 11, + VSS_WS_FAILED_AT_BACKUP_COMPLETE = 12, + VSS_WS_FAILED_AT_PRE_RESTORE = 13, + VSS_WS_FAILED_AT_POST_RESTORE = 14, + VSS_WS_FAILED_AT_BACKUPSHUTDOWN = 15, + VSS_WS_COUNT = 16, +}} +pub type PVSS_WRITER_STATE = *mut VSS_WRITER_STATE; +ENUM!{enum VSS_BACKUP_TYPE { + VSS_BT_UNDEFINED = 0, + VSS_BT_FULL = 1, + VSS_BT_INCREMENTAL = 2, + VSS_BT_DIFFERENTIAL = 3, + VSS_BT_LOG = 4, + VSS_BT_COPY = 5, + VSS_BT_OTHER = 6, +}} +pub type PVSS_BACKUP_TYPE = *mut VSS_BACKUP_TYPE; +ENUM!{enum VSS_RESTORE_TYPE { + VSS_RTYPE_UNDEFINED = 0, + VSS_RTYPE_BY_COPY = 1, + VSS_RTYPE_IMPORT = 2, + VSS_RTYPE_OTHER = 3, +}} +pub type PVSS_RESTORE_TYPE = *mut VSS_RESTORE_TYPE; +ENUM!{enum VSS_ROLLFORWARD_TYPE { + VSS_RF_UNDEFINED = 0, + VSS_RF_NONE = 1, + VSS_RF_ALL = 2, + VSS_RF_PARTIAL = 3, +}} +pub type PVSS_ROLLFORWARD_TYPE = *mut VSS_ROLLFORWARD_TYPE; +ENUM!{enum VSS_PROVIDER_TYPE { + VSS_PROV_UNKNOWN = 0, + VSS_PROV_SYSTEM = 1, + VSS_PROV_SOFTWARE = 2, + VSS_PROV_HARDWARE = 3, + VSS_PROV_FILESHARE = 4, +}} +pub type PVSS_PROVIDER_TYPE = *mut VSS_PROVIDER_TYPE; +ENUM!{enum VSS_APPLICATION_LEVEL { + VSS_APP_UNKNOWN = 0, + VSS_APP_SYSTEM = 1, + VSS_APP_BACK_END = 2, + VSS_APP_FRONT_END = 3, + VSS_APP_SYSTEM_RM = 4, + VSS_APP_AUTO = -1i32 as u32, +}} +pub type PVSS_APPLICATION_LEVEL = *mut VSS_APPLICATION_LEVEL; +ENUM!{enum _VSS_SNAPSHOT_COMPATIBILITY { + VSS_SC_DISABLE_DEFRAG = 0x1, + VSS_SC_DISABLE_CONTENTINDEX = 0x2, +}} +ENUM!{enum VSS_SNAPSHOT_PROPERTY_ID { + VSS_SPROPID_UNKNOWN = 0, + VSS_SPROPID_SNAPSHOT_ID = 0x1, + VSS_SPROPID_SNAPSHOT_SET_ID = 0x2, + VSS_SPROPID_SNAPSHOTS_COUNT = 0x3, + VSS_SPROPID_SNAPSHOT_DEVICE = 0x4, + VSS_SPROPID_ORIGINAL_VOLUME = 0x5, + VSS_SPROPID_ORIGINATING_MACHINE = 0x6, + VSS_SPROPID_SERVICE_MACHINE = 0x7, + VSS_SPROPID_EXPOSED_NAME = 0x8, + VSS_SPROPID_EXPOSED_PATH = 0x9, + VSS_SPROPID_PROVIDER_ID = 0xa, + VSS_SPROPID_SNAPSHOT_ATTRIBUTES = 0xb, + VSS_SPROPID_CREATION_TIMESTAMP = 0xc, + VSS_SPROPID_STATUS = 0xd, +}} +pub type PVSS_SNAPSHOT_PROPERTY_ID = *mut VSS_SNAPSHOT_PROPERTY_ID; +ENUM!{enum VSS_FILE_SPEC_BACKUP_TYPE { + VSS_FSBT_FULL_BACKUP_REQUIRED = 0x1, + VSS_FSBT_DIFFERENTIAL_BACKUP_REQUIRED = 0x2, + VSS_FSBT_INCREMENTAL_BACKUP_REQUIRED = 0x4, + VSS_FSBT_LOG_BACKUP_REQUIRED = 0x8, + VSS_FSBT_FULL_SNAPSHOT_REQUIRED = 0x100, + VSS_FSBT_DIFFERENTIAL_SNAPSHOT_REQUIRED = 0x200, + VSS_FSBT_INCREMENTAL_SNAPSHOT_REQUIRED = 0x400, + VSS_FSBT_LOG_SNAPSHOT_REQUIRED = 0x800, + VSS_FSBT_CREATED_DURING_BACKUP = 0x10000, + VSS_FSBT_ALL_BACKUP_REQUIRED = 0xf, + VSS_FSBT_ALL_SNAPSHOT_REQUIRED = 0xf00, +}} +pub type PVSS_FILE_SPEC_BACKUP_TYPE = *mut VSS_FILE_SPEC_BACKUP_TYPE; +ENUM!{enum VSS_BACKUP_SCHEMA { + VSS_BS_UNDEFINED = 0, + VSS_BS_DIFFERENTIAL = 0x1, + VSS_BS_INCREMENTAL = 0x2, + VSS_BS_EXCLUSIVE_INCREMENTAL_DIFFERENTIAL = 0x4, + VSS_BS_LOG = 0x8, + VSS_BS_COPY = 0x10, + VSS_BS_TIMESTAMPED = 0x20, + VSS_BS_LAST_MODIFY = 0x40, + VSS_BS_LSN = 0x80, + VSS_BS_WRITER_SUPPORTS_NEW_TARGET = 0x100, + VSS_BS_WRITER_SUPPORTS_RESTORE_WITH_MOVE = 0x200, + VSS_BS_INDEPENDENT_SYSTEM_STATE = 0x400, + VSS_BS_ROLLFORWARD_RESTORE = 0x1000, + VSS_BS_RESTORE_RENAME = 0x2000, + VSS_BS_AUTHORITATIVE_RESTORE = 0x4000, + VSS_BS_WRITER_SUPPORTS_PARALLEL_RESTORES = 0x8000, +}} +pub type PVSS_BACKUP_SCHEMA = *mut VSS_BACKUP_SCHEMA; +pub type VSS_ID = GUID; +pub type VSS_PWSZ = *mut WCHAR; +pub type VSS_TIMESTAMP = LONGLONG; +STRUCT!{struct VSS_SNAPSHOT_PROP { + m_SnapshotId: VSS_ID, + m_SnapshotSetId: VSS_ID, + m_lSnapshotsCount: LONG, + m_pwszSnapshotDeviceObject: VSS_PWSZ, + m_pwszOriginalVolumeName: VSS_PWSZ, + m_pwszOriginatingMachine: VSS_PWSZ, + m_pwszServiceMachine: VSS_PWSZ, + m_pwszExposedName: VSS_PWSZ, + m_pwszExposedPath: VSS_PWSZ, + m_ProviderId: VSS_ID, + m_lSnapshotAttributes: LONG, + m_tsCreationTimestamp: VSS_TIMESTAMP, + m_eStatus: VSS_SNAPSHOT_STATE, +}} +pub type PVSS_SNAPSHOT_PROP = *mut VSS_SNAPSHOT_PROP; +STRUCT!{struct VSS_PROVIDER_PROP { + m_ProviderId: VSS_ID, + m_pwszProviderName: VSS_PWSZ, + m_eProviderType: VSS_PROVIDER_TYPE, + m_pwszProviderVersion: VSS_PWSZ, + m_ProviderVersionId: VSS_ID, + m_ClassId: CLSID, +}} +pub type PVSS_PROVIDER_PROP = *mut VSS_PROVIDER_PROP; +UNION!{union VSS_OBJECT_UNION { + [u64; 12] [u64; 16], + Snap Snap_mut: VSS_SNAPSHOT_PROP, + Prov Prov_mut: VSS_PROVIDER_PROP, +}} +STRUCT!{struct VSS_OBJECT_PROP { + Type: VSS_OBJECT_TYPE, + Obj: VSS_OBJECT_UNION, +}} +pub type PVSS_OBJECT_PROP = *mut VSS_OBJECT_PROP; +RIDL!{#[uuid(0xae1c7110, 0x2f60, 0x11d3, 0x8a, 0x39, 0x00, 0xc0, 0x4f, 0x72, 0xd8, 0xe3)] +interface IVssEnumObject(IVssEnumObjectVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgelt: *mut VSS_OBJECT_PROP, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppenum: *mut *mut IVssEnumObject, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x507c37b4, 0xcf5b, 0x4e95, 0xb0, 0xaf, 0x14, 0xeb, 0x97, 0x67, 0x46, 0x7e)] +interface IVssAsync(IVssAsyncVtbl): IUnknown(IUnknownVtbl) { + fn Cancel() -> HRESULT, + fn Wait( + dwMilliseconds: DWORD, + ) -> HRESULT, + fn QueryStatus( + pHrResult: *mut HRESULT, + pReserved: *mut INT, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/vsserror.rs b/bash-5.1/vendor/winapi/src/um/vsserror.rs new file mode 100644 index 0000000000000000000000000000000000000000..1a295509d33da5af417751c0ea166db856948c6a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/vsserror.rs @@ -0,0 +1,89 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! VSS Error header file +use um::winnt::HRESULT; +pub const VSS_E_BAD_STATE: HRESULT = 0x80042301; +pub const VSS_E_UNEXPECTED: HRESULT = 0x80042302; +pub const VSS_E_PROVIDER_ALREADY_REGISTERED: HRESULT = 0x80042303; +pub const VSS_E_PROVIDER_NOT_REGISTERED: HRESULT = 0x80042304; +pub const VSS_E_PROVIDER_VETO: HRESULT = 0x80042306; +pub const VSS_E_PROVIDER_IN_USE: HRESULT = 0x80042307; +pub const VSS_E_OBJECT_NOT_FOUND: HRESULT = 0x80042308; +pub const VSS_S_ASYNC_PENDING: HRESULT = 0x00042309; +pub const VSS_S_ASYNC_FINISHED: HRESULT = 0x0004230A; +pub const VSS_S_ASYNC_CANCELLED: HRESULT = 0x0004230B; +pub const VSS_E_VOLUME_NOT_SUPPORTED: HRESULT = 0x8004230C; +pub const VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER: HRESULT = 0x8004230E; +pub const VSS_E_OBJECT_ALREADY_EXISTS: HRESULT = 0x8004230D; +pub const VSS_E_UNEXPECTED_PROVIDER_ERROR: HRESULT = 0x8004230F; +pub const VSS_E_CORRUPT_XML_DOCUMENT: HRESULT = 0x80042310; +pub const VSS_E_INVALID_XML_DOCUMENT: HRESULT = 0x80042311; +pub const VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED: HRESULT = 0x80042312; +pub const VSS_E_FLUSH_WRITES_TIMEOUT: HRESULT = 0x80042313; +pub const VSS_E_HOLD_WRITES_TIMEOUT: HRESULT = 0x80042314; +pub const VSS_E_UNEXPECTED_WRITER_ERROR: HRESULT = 0x80042315; +pub const VSS_E_SNAPSHOT_SET_IN_PROGRESS: HRESULT = 0x80042316; +pub const VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED: HRESULT = 0x80042317; +pub const VSS_E_WRITER_INFRASTRUCTURE: HRESULT = 0x80042318; +pub const VSS_E_WRITER_NOT_RESPONDING: HRESULT = 0x80042319; +pub const VSS_E_WRITER_ALREADY_SUBSCRIBED: HRESULT = 0x8004231A; +pub const VSS_E_UNSUPPORTED_CONTEXT: HRESULT = 0x8004231B; +pub const VSS_E_VOLUME_IN_USE: HRESULT = 0x8004231D; +pub const VSS_E_MAXIMUM_DIFFAREA_ASSOCIATIONS_REACHED: HRESULT = 0x8004231E; +pub const VSS_E_INSUFFICIENT_STORAGE: HRESULT = 0x8004231F; +pub const VSS_E_NO_SNAPSHOTS_IMPORTED: HRESULT = 0x80042320; +pub const VSS_S_SOME_SNAPSHOTS_NOT_IMPORTED: HRESULT = 0x00042321; +pub const VSS_E_SOME_SNAPSHOTS_NOT_IMPORTED: HRESULT = 0x80042321; +pub const VSS_E_MAXIMUM_NUMBER_OF_REMOTE_MACHINES_REACHED: HRESULT = 0x80042322; +pub const VSS_E_REMOTE_SERVER_UNAVAILABLE: HRESULT = 0x80042323; +pub const VSS_E_REMOTE_SERVER_UNSUPPORTED: HRESULT = 0x80042324; +pub const VSS_E_REVERT_IN_PROGRESS: HRESULT = 0x80042325; +pub const VSS_E_REVERT_VOLUME_LOST: HRESULT = 0x80042326; +pub const VSS_E_REBOOT_REQUIRED: HRESULT = 0x80042327; +pub const VSS_E_TRANSACTION_FREEZE_TIMEOUT: HRESULT = 0x80042328; +pub const VSS_E_TRANSACTION_THAW_TIMEOUT: HRESULT = 0x80042329; +pub const VSS_E_VOLUME_NOT_LOCAL: HRESULT = 0x8004232D; +pub const VSS_E_CLUSTER_TIMEOUT: HRESULT = 0x8004232E; +pub const VSS_E_WRITERERROR_INCONSISTENTSNAPSHOT: HRESULT = 0x800423F0; +pub const VSS_E_WRITERERROR_OUTOFRESOURCES: HRESULT = 0x800423F1; +pub const VSS_E_WRITERERROR_TIMEOUT: HRESULT = 0x800423F2; +pub const VSS_E_WRITERERROR_RETRYABLE: HRESULT = 0x800423F3; +pub const VSS_E_WRITERERROR_NONRETRYABLE: HRESULT = 0x800423F4; +pub const VSS_E_WRITERERROR_RECOVERY_FAILED: HRESULT = 0x800423F5; +pub const VSS_E_BREAK_REVERT_ID_FAILED: HRESULT = 0x800423F6; +pub const VSS_E_LEGACY_PROVIDER: HRESULT = 0x800423F7; +pub const VSS_E_MISSING_DISK: HRESULT = 0x800423F8; +pub const VSS_E_MISSING_HIDDEN_VOLUME: HRESULT = 0x800423F9; +pub const VSS_E_MISSING_VOLUME: HRESULT = 0x800423FA; +pub const VSS_E_AUTORECOVERY_FAILED: HRESULT = 0x800423FB; +pub const VSS_E_DYNAMIC_DISK_ERROR: HRESULT = 0x800423FC; +pub const VSS_E_NONTRANSPORTABLE_BCD: HRESULT = 0x800423FD; +pub const VSS_E_CANNOT_REVERT_DISKID: HRESULT = 0x800423FE; +pub const VSS_E_RESYNC_IN_PROGRESS: HRESULT = 0x800423FF; +pub const VSS_E_CLUSTER_ERROR: HRESULT = 0x80042400; +pub const VSS_E_UNSELECTED_VOLUME: HRESULT = 0x8004232A; +pub const VSS_E_SNAPSHOT_NOT_IN_SET: HRESULT = 0x8004232B; +pub const VSS_E_NESTED_VOLUME_LIMIT: HRESULT = 0x8004232C; +pub const VSS_E_NOT_SUPPORTED: HRESULT = 0x8004232F; +pub const VSS_E_WRITERERROR_PARTIAL_FAILURE: HRESULT = 0x80042336; +pub const VSS_E_ASRERROR_DISK_ASSIGNMENT_FAILED: HRESULT = 0x80042401; +pub const VSS_E_ASRERROR_DISK_RECREATION_FAILED: HRESULT = 0x80042402; +pub const VSS_E_ASRERROR_NO_ARCPATH: HRESULT = 0x80042403; +pub const VSS_E_ASRERROR_MISSING_DYNDISK: HRESULT = 0x80042404; +pub const VSS_E_ASRERROR_SHARED_CRIDISK: HRESULT = 0x80042405; +pub const VSS_E_ASRERROR_DATADISK_RDISK0: HRESULT = 0x80042406; +pub const VSS_E_ASRERROR_RDISK0_TOOSMALL: HRESULT = 0x80042407; +pub const VSS_E_ASRERROR_CRITICAL_DISKS_TOO_SMALL: HRESULT = 0x80042408; +pub const VSS_E_WRITER_STATUS_NOT_AVAILABLE: HRESULT = 0x80042409; +pub const VSS_E_ASRERROR_DYNAMIC_VHD_NOT_SUPPORTED: HRESULT = 0x8004240A; +pub const VSS_E_CRITICAL_VOLUME_ON_INVALID_DISK: HRESULT = 0x80042411; +pub const VSS_E_ASRERROR_RDISK_FOR_SYSTEM_DISK_NOT_FOUND: HRESULT = 0x80042412; +pub const VSS_E_ASRERROR_NO_PHYSICAL_DISK_AVAILABLE: HRESULT = 0x80042413; +pub const VSS_E_ASRERROR_FIXED_PHYSICAL_DISK_AVAILABLE_AFTER_DISK_EXCLUSION: HRESULT = + 0x80042414; +pub const VSS_E_ASRERROR_CRITICAL_DISK_CANNOT_BE_EXCLUDED: HRESULT = 0x80042415; +pub const VSS_E_ASRERROR_SYSTEM_PARTITION_HIDDEN: HRESULT = 0x80042416; +pub const VSS_E_FSS_TIMEOUT: HRESULT = 0x80042417; diff --git a/bash-5.1/vendor/winapi/src/um/vswriter.rs b/bash-5.1/vendor/winapi/src/um/vswriter.rs new file mode 100644 index 0000000000000000000000000000000000000000..43d6000ec665c4e286a21e060065177e70ded6fa --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/vswriter.rs @@ -0,0 +1,397 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Declaration of Writer +use shared::minwindef::{BOOL, BYTE, DWORD, FILETIME, UINT}; +use shared::wtypes::BSTR; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::vss::{VSS_ID, VSS_ROLLFORWARD_TYPE}; +use um::winnt::{HRESULT, LPCWSTR, VOID}; +ENUM!{enum VSS_USAGE_TYPE { + VSS_UT_UNDEFINED = 0, + VSS_UT_BOOTABLESYSTEMSTATE = 1, + VSS_UT_SYSTEMSERVICE = 2, + VSS_UT_USERDATA = 3, + VSS_UT_OTHER = 4, +}} +ENUM!{enum VSS_SOURCE_TYPE { + VSS_ST_UNDEFINED = 0, + VSS_ST_TRANSACTEDDB = 1, + VSS_ST_NONTRANSACTEDDB = 2, + VSS_ST_OTHER = 3, +}} +ENUM!{enum VSS_RESTOREMETHOD_ENUM { + VSS_RME_UNDEFINED = 0, + VSS_RME_RESTORE_IF_NOT_THERE = 1, + VSS_RME_RESTORE_IF_CAN_REPLACE = 2, + VSS_RME_STOP_RESTORE_START = 3, + VSS_RME_RESTORE_TO_ALTERNATE_LOCATION = 4, + VSS_RME_RESTORE_AT_REBOOT = 5, + VSS_RME_RESTORE_AT_REBOOT_IF_CANNOT_REPLACE = 6, + VSS_RME_CUSTOM = 7, + VSS_RME_RESTORE_STOP_START = 8, +}} +ENUM!{enum VSS_WRITERRESTORE_ENUM { + VSS_WRE_UNDEFINED = 0, + VSS_WRE_NEVER = 1, + VSS_WRE_IF_REPLACE_FAILS = 2, + VSS_WRE_ALWAYS = 3, +}} +ENUM!{enum VSS_COMPONENT_TYPE { + VSS_CT_UNDEFINED = 0, + VSS_CT_DATABASE = 1, + VSS_CT_FILEGROUP = 2, +}} +ENUM!{enum VSS_ALTERNATE_WRITER_STATE { + VSS_AWS_UNDEFINED = 0, + VSS_AWS_NO_ALTERNATE_WRITER = 1, + VSS_AWS_ALTERNATE_WRITER_EXISTS = 2, + VSS_AWS_THIS_IS_ALTERNATE_WRITER = 3, +}} +ENUM!{enum VSS_SUBSCRIBE_MASK { + VSS_SM_POST_SNAPSHOT_FLAG = 0x00000001, + VSS_SM_BACKUP_EVENTS_FLAG = 0x00000002, + VSS_SM_RESTORE_EVENTS_FLAG = 0x00000004, + VSS_SM_IO_THROTTLING_FLAG = 0x00000008, + VSS_SM_ALL_FLAGS = 0xffffffff, +}} +ENUM!{enum VSS_RESTORE_TARGET { + VSS_RT_UNDEFINED = 0, + VSS_RT_ORIGINAL = 1, + VSS_RT_ALTERNATE = 2, + VSS_RT_DIRECTED = 3, + VSS_RT_ORIGINAL_LOCATION = 4, +}} +ENUM!{enum VSS_FILE_RESTORE_STATUS { + VSS_RS_UNDEFINED = 0, + VSS_RS_NONE = 1, + VSS_RS_ALL = 2, + VSS_RS_FAILED = 3, +}} +ENUM!{enum VSS_COMPONENT_FLAGS { + VSS_CF_BACKUP_RECOVERY = 0x00000001, + VSS_CF_APP_ROLLBACK_RECOVERY = 0x00000002, + VSS_CF_NOT_SYSTEM_STATE = 0x00000004, +}} +RIDL!{#[uuid(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)] +interface IVssWMFiledesc(IVssWMFiledescVtbl): IUnknown(IUnknownVtbl) { + fn GetPath( + pbstrPath: *mut BSTR, + ) -> HRESULT, + fn GetFilespec( + pbstrFilespec: *mut BSTR, + ) -> HRESULT, + fn GetRecursive( + pbRecursive: *mut bool, + ) -> HRESULT, + fn GetAlternateLocation( + pbstrAlternateLocation: *mut BSTR, + ) -> HRESULT, + fn GetBackupTypeMask( + pdwTypeMask: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)] +interface IVssWMDependency(IVssWMDependencyVtbl): IUnknown(IUnknownVtbl) { + fn GetWriterId( + pWriterId: *mut VSS_ID, + ) -> HRESULT, + fn GetLogicalPath( + pbstrLogicalPath: *mut BSTR, + ) -> HRESULT, + fn GetComponentName( + pbstrComponentName: *mut BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd2c72c96, 0xc121, 0x4518, 0xb6, 0x27, 0xe5, 0xa9, 0x3d, 0x01, 0x0e, 0xad)] +interface IVssComponent(IVssComponentVtbl): IUnknown(IUnknownVtbl) { + fn GetLogicalPath( + pbstrPath: *mut BSTR, + ) -> HRESULT, + fn GetComponentType( + pct: *mut VSS_COMPONENT_TYPE, + ) -> HRESULT, + fn GetComponentName( + pbstrName: *mut BSTR, + ) -> HRESULT, + fn GetBackupSucceeded( + pbSucceeded: *mut bool, + ) -> HRESULT, + fn GetAlternateLocationMappingCount( + pcMappings: *mut UINT, + ) -> HRESULT, + fn GetAlternateLocationMapping( + iMapping: UINT, + ppFiledesc: *mut *mut IVssWMFiledesc, + ) -> HRESULT, + fn SetBackupMetadata( + wszData: LPCWSTR, + ) -> HRESULT, + fn GetBackupMetadata( + pbstrData: *mut BSTR, + ) -> HRESULT, + fn AddPartialFile( + wszPath: LPCWSTR, + wszFilename: LPCWSTR, + wszRanges: LPCWSTR, + wszMetadata: LPCWSTR, + ) -> HRESULT, + fn GetPartialFileCount( + pcPartialFiles: *mut UINT, + ) -> HRESULT, + fn GetPartialFile( + iPartialFile: UINT, + pbstrPath: *mut BSTR, + pbstrFilename: *mut BSTR, + pbstrRange: *mut BSTR, + pbstrMetadata: *mut BSTR, + ) -> HRESULT, + fn IsSelectedForRestore( + pbSelectedForRestore: *mut bool, + ) -> HRESULT, + fn GetAdditionalRestores( + pbAdditionalRestores: *mut bool, + ) -> HRESULT, + fn GetNewTargetCount( + pcNewTarget: *mut UINT, + ) -> HRESULT, + fn GetNewTarget( + iNewTarget: UINT, + ppFiledesc: *mut *mut IVssWMFiledesc, + ) -> HRESULT, + fn AddDirectedTarget( + wszSourcePath: LPCWSTR, + wszSourceFilename: LPCWSTR, + wszSourceRangeList: LPCWSTR, + wszDestinationPath: LPCWSTR, + wszDestinationFilename: LPCWSTR, + wszDestinationRangeList: LPCWSTR, + ) -> HRESULT, + fn GetDirectedTargetCount( + pcDirectedTarget: *mut UINT, + ) -> HRESULT, + fn GetDirectedTarget( + iDirectedTarget: UINT, + pbstrSourcePath: *mut BSTR, + pbstrSourceFileName: *mut BSTR, + pbstrSourceRangeList: *mut BSTR, + pbstrDestinationPath: *mut BSTR, + pbstrDestinationFilename: *mut BSTR, + pbstrDestinationRangeList: *mut BSTR, + ) -> HRESULT, + fn SetRestoreMetadata( + wszRestoreMetadata: LPCWSTR, + ) -> HRESULT, + fn GetRestoreMetadata( + pbstrRestoreMetadata: *mut BSTR, + ) -> HRESULT, + fn SetRestoreTarget( + target: VSS_RESTORE_TARGET, + ) -> HRESULT, + fn GetRestoreTarget( + pTarget: *mut VSS_RESTORE_TARGET, + ) -> HRESULT, + fn SetPreRestoreFailureMsg( + wszPreRestoreFailureMsg: LPCWSTR, + ) -> HRESULT, + fn GetPreRestoreFailureMsg( + pbstrPreRestoreFailureMsg: *mut BSTR, + ) -> HRESULT, + fn SetPostRestoreFailureMsg( + wszPostRestoreFailureMsg: LPCWSTR, + ) -> HRESULT, + fn GetPostRestoreFailureMsg( + pbstrPostRestoreFailureMsg: *mut BSTR, + ) -> HRESULT, + fn SetBackupStamp( + wszBackupStamp: LPCWSTR, + ) -> HRESULT, + fn GetBackupStamp( + pbstrBackupStamp: *mut BSTR, + ) -> HRESULT, + fn GetPreviousBackupStamp( + pbstrBackupStamp: *mut BSTR, + ) -> HRESULT, + fn GetBackupOptions( + pbstrBackupOptions: *mut BSTR, + ) -> HRESULT, + fn GetRestoreOptions( + pbstrRestoreOptions: *mut BSTR, + ) -> HRESULT, + fn GetRestoreSubcomponentCount( + pcRestoreSubcomponent: *mut UINT, + ) -> HRESULT, + fn GetRestoreSubcomponent( + iComponent: UINT, + pbstrLogicalPath: *mut BSTR, + pbstrComponentName: *mut BSTR, + pbRepair: *mut bool, + ) -> HRESULT, + fn GetFileRestoreStatus( + pStatus: *mut VSS_FILE_RESTORE_STATUS, + ) -> HRESULT, + fn AddDifferencedFilesByLastModifyTime( + wszPath: LPCWSTR, + wszFilespec: LPCWSTR, + bRecursive: BOOL, + ftLastModifyTime: FILETIME, + ) -> HRESULT, + fn AddDifferencedFilesByLastModifyLSN( + wszPath: LPCWSTR, + wszFilespec: LPCWSTR, + bRecursive: BOOL, + bstrLsnString: BSTR, + ) -> HRESULT, + fn GetDifferencedFilesCount( + pcDifferencedFiles: *mut UINT, + ) -> HRESULT, + fn GetDifferencedFile( + iDifferencedFile: UINT, + pbstrPath: *mut BSTR, + pbstrFilespec: *mut BSTR, + pbRecursive: *mut BOOL, + pbstrLsnString: *mut BSTR, + pftLastModifyTime: *mut FILETIME, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)] +interface IVssWriterComponents(IVssWriterComponentsVtbl) { + fn GetComponentCount( + pcComponents: *mut UINT, + ) -> HRESULT, + fn GetWriterInfo( + pidInstance: *mut VSS_ID, + pidWriter: *mut VSS_ID, + ) -> HRESULT, + fn GetComponent( + iComponent: UINT, + ppComponent: *mut *mut IVssComponent, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x156c8b5e, 0xf131, 0x4bd7, 0x9c, 0x97, 0xd1, 0x92, 0x3b, 0xe7, 0xe1, 0xfa)] +interface IVssComponentEx(IVssComponentExVtbl): IVssComponent(IVssComponentVtbl) { + fn SetPrepareForBackupFailureMsg( + wszFailureMsg: LPCWSTR, + ) -> HRESULT, + fn SetPostSnapshotFailureMsg( + wszFailureMsg: LPCWSTR, + ) -> HRESULT, + fn GetPrepareForBackupFailureMsg( + pbstrFailureMsg: *mut BSTR, + ) -> HRESULT, + fn GetPostSnapshotFailureMsg( + pbstrFailureMsg: *mut BSTR, + ) -> HRESULT, + fn GetAuthoritativeRestore( + pbAuth: *mut bool, + ) -> HRESULT, + fn GetRollForward( + pRollType: *mut VSS_ROLLFORWARD_TYPE, + pbstrPoint: *mut BSTR, + ) -> HRESULT, + fn GetRestoreName( + pbstrName: *mut BSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3b5be0f2, 0x07a9, 0x4e4b, 0xbd, 0xd3, 0xcf, 0xdc, 0x8e, 0x2c, 0x0d, 0x2d)] +interface IVssComponentEx2(IVssComponentEx2Vtbl): IVssComponentEx(IVssComponentExVtbl) { + fn SetFailure( + hr: HRESULT, + hrApplication: HRESULT, + wszApplicationMessage: LPCWSTR, + dwReserved: DWORD, + ) -> HRESULT, + fn GetFailure( + phr: *mut HRESULT, + phrApplication: *mut HRESULT, + pbstrApplicationMessage: *mut BSTR, + pdwReserved: *mut DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)] +interface IVssCreateWriterMetadata(IVssCreateWriterMetadataVtbl) { + fn AddIncludeFiles( + wszPath: LPCWSTR, + wszFilespec: LPCWSTR, + bRecursive: bool, + wszAlternateLocation: LPCWSTR, + ) -> HRESULT, + fn AddExcludeFiles( + wszPath: LPCWSTR, + wszFilespec: LPCWSTR, + bRecursive: bool, + ) -> HRESULT, + fn AddComponent( + ct: VSS_COMPONENT_TYPE, + wszLogicalPath: LPCWSTR, + wszComponentName: LPCWSTR, + wszCaption: LPCWSTR, + pbIcon: *const BYTE, + cbIcon: UINT, + bRestoreMetadata: bool, + bNotifyOnBackupComplete: bool, + bSelectableForRestore: bool, + dwComponentFlags: DWORD, + ) -> HRESULT, + fn AddDatabaseFiles( + wszLogicalPath: LPCWSTR, + wszDatabaseName: LPCWSTR, + wszPath: LPCWSTR, + wszFilespec: LPCWSTR, + dwBackupTypeMask: DWORD, + ) -> HRESULT, + fn AddDatabaseLogFiles( + wszLogicalPath: LPCWSTR, + wszDatabaseName: LPCWSTR, + wszPath: LPCWSTR, + wszFilespec: LPCWSTR, + dwBackupTypeMask: DWORD, + ) -> HRESULT, + fn AddFilesToFileGroup( + wszLogicalPath: LPCWSTR, + wszGroupName: LPCWSTR, + wszPath: LPCWSTR, + wszFilespec: LPCWSTR, + bRecursive: bool, + wszAlternateLocation: LPCWSTR, + dwBackupTypeMask: DWORD, + ) -> HRESULT, + fn SetRestoreMethod( + method: VSS_RESTOREMETHOD_ENUM, + wszService: LPCWSTR, + wszUserProcedure: LPCWSTR, + writerRestore: VSS_WRITERRESTORE_ENUM, + bRebootRequired: bool, + ) -> HRESULT, + fn AddAlternateLocationMapping( + wszSourcePath: LPCWSTR, + wszSourceFilespec: LPCWSTR, + bRecursive: bool, + wszDestination: LPCWSTR, + ) -> HRESULT, + fn AddComponentDependency( + wszForLogicalPath: LPCWSTR, + wszForComponentName: LPCWSTR, + onWriterId: VSS_ID, + wszOnLogicalPath: LPCWSTR, + wszOnComponentName: LPCWSTR, + ) -> HRESULT, + fn SetBackupSchema( + dwSchemaMask: DWORD, + ) -> HRESULT, + fn GetDocument( + pDoc: *mut *mut VOID, + ) -> HRESULT, //TODO IXMLDOMDocument, + fn SaveAsXML( + pbstrXML: *mut BSTR, + ) -> HRESULT, +}} +//IVssCreateWriterMetadataEx +//IVssWriterImpl +//IVssCreateExpressWriterMetadata +//IVssExpressWriter +//CVssWriter +//CVssWriterEx +//CVssWriterEx2 diff --git a/bash-5.1/vendor/winapi/src/um/wbemads.rs b/bash-5.1/vendor/winapi/src/um/wbemads.rs new file mode 100644 index 0000000000000000000000000000000000000000..5ba09e6eb7dd382f0bbc4354846b2967acb799c5 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wbemads.rs @@ -0,0 +1,41 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::winerror::HRESULT; +use shared::wtypes::BSTR; +use um::oaidl::{IDispatch, IDispatchVtbl}; +use um::wbemdisp::{ISWbemObject, ISWbemServices}; +// extern RPC_IF_HANDLE __MIDL_itf_wbemads_0000_0000_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemads_0000_0000_v0_0_s_ifspec; +// EXTERN_C const IID LIBID_WMIEXTENSIONLib; +// EXTERN_C const IID IID_IWMIExtension; +DEFINE_GUID!{IID_IWMIExtension, + 0xadc1f06e, 0x5c7e, 0x11d2, 0x8b, 0x74, 0x00, 0x10, 0x4b, 0x2a, 0xfb, 0x41} +RIDL!{#[uuid(0xadc1f06e, 0x5c7e, 0x11d2, 0x8b, 0x74, 0x00, 0x10, 0x4b, 0x2a, 0xfb, 0x41)] +interface IWMIExtension(IWMIExtensionVtbl): IDispatch(IDispatchVtbl) { + fn get_WMIObjectPath( + strWMIObjectPath: *mut BSTR, + ) -> HRESULT, + fn GetWMIObject( + objWMIObject: *mut *mut ISWbemObject, + ) -> HRESULT, + fn GetWMIServices( + objWMIServices: *mut *mut ISWbemServices, + ) -> HRESULT, +}} +DEFINE_GUID!{CLSID_WMIExtension, + 0xf0975afe, 0x5c7f, 0x11d2, 0x8b, 0x74, 0x00, 0x10, 0x4b, 0x2a, 0xfb, 0x41} +// class DECLSPEC_UUID("f0975afe-5c7f-11d2-8b74-00104b2afb41") +// WMIExtension; +// extern RPC_IF_HANDLE __MIDL_itf_wbemads_0000_0002_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemads_0000_0002_v0_0_s_ifspec; +// unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +// void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); +// unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +// void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); diff --git a/bash-5.1/vendor/winapi/src/um/wbemcli.rs b/bash-5.1/vendor/winapi/src/um/wbemcli.rs new file mode 100644 index 0000000000000000000000000000000000000000..9320a80e4b16c26bbce8d0adc4132d95aff94461 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wbemcli.rs @@ -0,0 +1,1174 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{__uint64, c_long, c_uchar}; +use shared::minwindef::{BYTE, DWORD, ULONG}; +use shared::rpcndr::byte; +use shared::winerror::HRESULT; +use shared::wtypes::BSTR; +use um::oaidl::{SAFEARRAY, VARIANT}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{LCID, LONG, LPCWSTR, LPWSTR}; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0000_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0000_v0_0_s_ifspec; +ENUM!{enum WBEM_GENUS_TYPE { + WBEM_GENUS_CLASS = 1, + WBEM_GENUS_INSTANCE = 2, +}} +ENUM!{enum WBEM_CHANGE_FLAG_TYPE { + WBEM_FLAG_CREATE_OR_UPDATE = 0, + WBEM_FLAG_UPDATE_ONLY = 0x1, + WBEM_FLAG_CREATE_ONLY = 0x2, + WBEM_FLAG_UPDATE_COMPATIBLE = 0, + WBEM_FLAG_UPDATE_SAFE_MODE = 0x20, + WBEM_FLAG_UPDATE_FORCE_MODE = 0x40, + WBEM_MASK_UPDATE_MODE = 0x60, + WBEM_FLAG_ADVISORY = 0x10000, +}} +ENUM!{enum WBEM_GENERIC_FLAG_TYPE { + WBEM_FLAG_RETURN_IMMEDIATELY = 0x10, + WBEM_FLAG_RETURN_WBEM_COMPLETE = 0, + WBEM_FLAG_BIDIRECTIONAL = 0, + WBEM_FLAG_FORWARD_ONLY = 0x20, + WBEM_FLAG_NO_ERROR_OBJECT = 0x40, + WBEM_FLAG_RETURN_ERROR_OBJECT = 0, + WBEM_FLAG_SEND_STATUS = 0x80, + WBEM_FLAG_DONT_SEND_STATUS = 0, + WBEM_FLAG_ENSURE_LOCATABLE = 0x100, + WBEM_FLAG_DIRECT_READ = 0x200, + WBEM_FLAG_SEND_ONLY_SELECTED = 0, + WBEM_RETURN_WHEN_COMPLETE = 0, + WBEM_RETURN_IMMEDIATELY = 0x10, + WBEM_MASK_RESERVED_FLAGS = 0x1f000, + WBEM_FLAG_USE_AMENDED_QUALIFIERS = 0x20000, + WBEM_FLAG_STRONG_VALIDATION = 0x100000, +}} +ENUM!{enum WBEM_STATUS_TYPE { + WBEM_STATUS_COMPLETE = 0, + WBEM_STATUS_REQUIREMENTS = 1, + WBEM_STATUS_PROGRESS = 2, + WBEM_STATUS_LOGGING_INFORMATION = 0x100, + WBEM_STATUS_LOGGING_INFORMATION_PROVIDER = 0x200, + WBEM_STATUS_LOGGING_INFORMATION_HOST = 0x400, + WBEM_STATUS_LOGGING_INFORMATION_REPOSITORY = 0x800, + WBEM_STATUS_LOGGING_INFORMATION_ESS = 0x1000, +}} +ENUM!{enum WBEM_TIMEOUT_TYPE { + WBEM_NO_WAIT = 0, + WBEM_INFINITE = 0xffffffff, +}} +ENUM!{enum WBEM_CONDITION_FLAG_TYPE { + WBEM_FLAG_ALWAYS = 0, + WBEM_FLAG_ONLY_IF_TRUE = 0x1, + WBEM_FLAG_ONLY_IF_FALSE = 0x2, + WBEM_FLAG_ONLY_IF_IDENTICAL = 0x3, + WBEM_MASK_PRIMARY_CONDITION = 0x3, + WBEM_FLAG_KEYS_ONLY = 0x4, + WBEM_FLAG_REFS_ONLY = 0x8, + WBEM_FLAG_LOCAL_ONLY = 0x10, + WBEM_FLAG_PROPAGATED_ONLY = 0x20, + WBEM_FLAG_SYSTEM_ONLY = 0x30, + WBEM_FLAG_NONSYSTEM_ONLY = 0x40, + WBEM_MASK_CONDITION_ORIGIN = 0x70, + WBEM_FLAG_CLASS_OVERRIDES_ONLY = 0x100, + WBEM_FLAG_CLASS_LOCAL_AND_OVERRIDES = 0x200, + WBEM_MASK_CLASS_CONDITION = 0x300, +}} +ENUM!{enum WBEM_FLAVOR_TYPE { + WBEM_FLAVOR_DONT_PROPAGATE = 0, + WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE = 0x1, + WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS = 0x2, + WBEM_FLAVOR_MASK_PROPAGATION = 0xf, + WBEM_FLAVOR_OVERRIDABLE = 0, + WBEM_FLAVOR_NOT_OVERRIDABLE = 0x10, + WBEM_FLAVOR_MASK_PERMISSIONS = 0x10, + WBEM_FLAVOR_ORIGIN_LOCAL = 0, + WBEM_FLAVOR_ORIGIN_PROPAGATED = 0x20, + WBEM_FLAVOR_ORIGIN_SYSTEM = 0x40, + WBEM_FLAVOR_MASK_ORIGIN = 0x60, + WBEM_FLAVOR_NOT_AMENDED = 0, + WBEM_FLAVOR_AMENDED = 0x80, + WBEM_FLAVOR_MASK_AMENDED = 0x80, +}} +ENUM!{enum WBEM_QUERY_FLAG_TYPE { + WBEM_FLAG_DEEP = 0, + WBEM_FLAG_SHALLOW = 1, + WBEM_FLAG_PROTOTYPE = 2, +}} +ENUM!{enum WBEM_SECURITY_FLAGS { + WBEM_ENABLE = 1, + WBEM_METHOD_EXECUTE = 2, + WBEM_FULL_WRITE_REP = 4, + WBEM_PARTIAL_WRITE_REP = 8, + WBEM_WRITE_PROVIDER = 0x10, + WBEM_REMOTE_ACCESS = 0x20, + WBEM_RIGHT_SUBSCRIBE = 0x40, + WBEM_RIGHT_PUBLISH = 0x80, +}} +ENUM!{enum WBEM_LIMITATION_FLAG_TYPE { + WBEM_FLAG_EXCLUDE_OBJECT_QUALIFIERS = 0x10, + WBEM_FLAG_EXCLUDE_PROPERTY_QUALIFIERS = 0x20, +}} +ENUM!{enum WBEM_TEXT_FLAG_TYPE { + WBEM_FLAG_NO_FLAVORS = 0x1, +}} +ENUM!{enum WBEM_COMPARISON_FLAG { + WBEM_COMPARISON_INCLUDE_ALL = 0, + WBEM_FLAG_IGNORE_QUALIFIERS = 0x1, + WBEM_FLAG_IGNORE_OBJECT_SOURCE = 0x2, + WBEM_FLAG_IGNORE_DEFAULT_VALUES = 0x4, + WBEM_FLAG_IGNORE_CLASS = 0x8, + WBEM_FLAG_IGNORE_CASE = 0x10, + WBEM_FLAG_IGNORE_FLAVOR = 0x20, +}} +ENUM!{enum WBEM_LOCKING_FLAG_TYPE { + WBEM_FLAG_ALLOW_READ = 0x1, +}} +ENUM!{enum CIMTYPE_ENUMERATION { + CIM_ILLEGAL = 0xfff, + CIM_EMPTY = 0, + CIM_SINT8 = 16, + CIM_UINT8 = 17, + CIM_SINT16 = 2, + CIM_UINT16 = 18, + CIM_SINT32 = 3, + CIM_UINT32 = 19, + CIM_SINT64 = 20, + CIM_UINT64 = 21, + CIM_REAL32 = 4, + CIM_REAL64 = 5, + CIM_BOOLEAN = 11, + CIM_STRING = 8, + CIM_DATETIME = 101, + CIM_REFERENCE = 102, + CIM_CHAR16 = 103, + CIM_OBJECT = 13, + CIM_FLAG_ARRAY = 0x2000, +}} +ENUM!{enum WBEM_BACKUP_RESTORE_FLAGS { + WBEM_FLAG_BACKUP_RESTORE_DEFAULT = 0, + WBEM_FLAG_BACKUP_RESTORE_FORCE_SHUTDOWN = 1, +}} +ENUM!{enum WBEM_REFRESHER_FLAGS { + WBEM_FLAG_REFRESH_AUTO_RECONNECT = 0, + WBEM_FLAG_REFRESH_NO_AUTO_RECONNECT = 1, +}} +ENUM!{enum WBEM_SHUTDOWN_FLAGS { + WBEM_SHUTDOWN_UNLOAD_COMPONENT = 1, + WBEM_SHUTDOWN_WMI = 2, + WBEM_SHUTDOWN_OS = 3, +}} +pub type CIMTYPE = c_long; +ENUM!{enum WBEMSTATUS_FORMAT { + WBEMSTATUS_FORMAT_NEWLINE = 0, + WBEMSTATUS_FORMAT_NO_NEWLINE = 1, +}} +ENUM!{enum WBEM_LIMITS { + WBEM_MAX_IDENTIFIER = 0x1000, + WBEM_MAX_QUERY = 0x4000, + WBEM_MAX_PATH = 0x2000, + WBEM_MAX_OBJECT_NESTING = 64, + WBEM_MAX_USER_PROPERTIES = 1024, +}} +ENUM!{enum WBEMSTATUS { + WBEM_NO_ERROR = 0, + WBEM_S_NO_ERROR = 0, + WBEM_S_SAME = 0, + WBEM_S_FALSE = 1, + WBEM_S_ALREADY_EXISTS = 0x40001, + WBEM_S_RESET_TO_DEFAULT = 0x40002, + WBEM_S_DIFFERENT = 0x40003, + WBEM_S_TIMEDOUT = 0x40004, + WBEM_S_NO_MORE_DATA = 0x40005, + WBEM_S_OPERATION_CANCELLED = 0x40006, + WBEM_S_PENDING = 0x40007, + WBEM_S_DUPLICATE_OBJECTS = 0x40008, + WBEM_S_ACCESS_DENIED = 0x40009, + WBEM_S_PARTIAL_RESULTS = 0x40010, + WBEM_S_SOURCE_NOT_AVAILABLE = 0x40017, + WBEM_E_FAILED = 0x80041001, + WBEM_E_NOT_FOUND = 0x80041002, + WBEM_E_ACCESS_DENIED = 0x80041003, + WBEM_E_PROVIDER_FAILURE = 0x80041004, + WBEM_E_TYPE_MISMATCH = 0x80041005, + WBEM_E_OUT_OF_MEMORY = 0x80041006, + WBEM_E_INVALID_CONTEXT = 0x80041007, + WBEM_E_INVALID_PARAMETER = 0x80041008, + WBEM_E_NOT_AVAILABLE = 0x80041009, + WBEM_E_CRITICAL_ERROR = 0x8004100a, + WBEM_E_INVALID_STREAM = 0x8004100b, + WBEM_E_NOT_SUPPORTED = 0x8004100c, + WBEM_E_INVALID_SUPERCLASS = 0x8004100d, + WBEM_E_INVALID_NAMESPACE = 0x8004100e, + WBEM_E_INVALID_OBJECT = 0x8004100f, + WBEM_E_INVALID_CLASS = 0x80041010, + WBEM_E_PROVIDER_NOT_FOUND = 0x80041011, + WBEM_E_INVALID_PROVIDER_REGISTRATION = 0x80041012, + WBEM_E_PROVIDER_LOAD_FAILURE = 0x80041013, + WBEM_E_INITIALIZATION_FAILURE = 0x80041014, + WBEM_E_TRANSPORT_FAILURE = 0x80041015, + WBEM_E_INVALID_OPERATION = 0x80041016, + WBEM_E_INVALID_QUERY = 0x80041017, + WBEM_E_INVALID_QUERY_TYPE = 0x80041018, + WBEM_E_ALREADY_EXISTS = 0x80041019, + WBEM_E_OVERRIDE_NOT_ALLOWED = 0x8004101a, + WBEM_E_PROPAGATED_QUALIFIER = 0x8004101b, + WBEM_E_PROPAGATED_PROPERTY = 0x8004101c, + WBEM_E_UNEXPECTED = 0x8004101d, + WBEM_E_ILLEGAL_OPERATION = 0x8004101e, + WBEM_E_CANNOT_BE_KEY = 0x8004101f, + WBEM_E_INCOMPLETE_CLASS = 0x80041020, + WBEM_E_INVALID_SYNTAX = 0x80041021, + WBEM_E_NONDECORATED_OBJECT = 0x80041022, + WBEM_E_READ_ONLY = 0x80041023, + WBEM_E_PROVIDER_NOT_CAPABLE = 0x80041024, + WBEM_E_CLASS_HAS_CHILDREN = 0x80041025, + WBEM_E_CLASS_HAS_INSTANCES = 0x80041026, + WBEM_E_QUERY_NOT_IMPLEMENTED = 0x80041027, + WBEM_E_ILLEGAL_NULL = 0x80041028, + WBEM_E_INVALID_QUALIFIER_TYPE = 0x80041029, + WBEM_E_INVALID_PROPERTY_TYPE = 0x8004102a, + WBEM_E_VALUE_OUT_OF_RANGE = 0x8004102b, + WBEM_E_CANNOT_BE_SINGLETON = 0x8004102c, + WBEM_E_INVALID_CIM_TYPE = 0x8004102d, + WBEM_E_INVALID_METHOD = 0x8004102e, + WBEM_E_INVALID_METHOD_PARAMETERS = 0x8004102f, + WBEM_E_SYSTEM_PROPERTY = 0x80041030, + WBEM_E_INVALID_PROPERTY = 0x80041031, + WBEM_E_CALL_CANCELLED = 0x80041032, + WBEM_E_SHUTTING_DOWN = 0x80041033, + WBEM_E_PROPAGATED_METHOD = 0x80041034, + WBEM_E_UNSUPPORTED_PARAMETER = 0x80041035, + WBEM_E_MISSING_PARAMETER_ID = 0x80041036, + WBEM_E_INVALID_PARAMETER_ID = 0x80041037, + WBEM_E_NONCONSECUTIVE_PARAMETER_IDS = 0x80041038, + WBEM_E_PARAMETER_ID_ON_RETVAL = 0x80041039, + WBEM_E_INVALID_OBJECT_PATH = 0x8004103a, + WBEM_E_OUT_OF_DISK_SPACE = 0x8004103b, + WBEM_E_BUFFER_TOO_SMALL = 0x8004103c, + WBEM_E_UNSUPPORTED_PUT_EXTENSION = 0x8004103d, + WBEM_E_UNKNOWN_OBJECT_TYPE = 0x8004103e, + WBEM_E_UNKNOWN_PACKET_TYPE = 0x8004103f, + WBEM_E_MARSHAL_VERSION_MISMATCH = 0x80041040, + WBEM_E_MARSHAL_INVALID_SIGNATURE = 0x80041041, + WBEM_E_INVALID_QUALIFIER = 0x80041042, + WBEM_E_INVALID_DUPLICATE_PARAMETER = 0x80041043, + WBEM_E_TOO_MUCH_DATA = 0x80041044, + WBEM_E_SERVER_TOO_BUSY = 0x80041045, + WBEM_E_INVALID_FLAVOR = 0x80041046, + WBEM_E_CIRCULAR_REFERENCE = 0x80041047, + WBEM_E_UNSUPPORTED_CLASS_UPDATE = 0x80041048, + WBEM_E_CANNOT_CHANGE_KEY_INHERITANCE = 0x80041049, + WBEM_E_CANNOT_CHANGE_INDEX_INHERITANCE = 0x80041050, + WBEM_E_TOO_MANY_PROPERTIES = 0x80041051, + WBEM_E_UPDATE_TYPE_MISMATCH = 0x80041052, + WBEM_E_UPDATE_OVERRIDE_NOT_ALLOWED = 0x80041053, + WBEM_E_UPDATE_PROPAGATED_METHOD = 0x80041054, + WBEM_E_METHOD_NOT_IMPLEMENTED = 0x80041055, + WBEM_E_METHOD_DISABLED = 0x80041056, + WBEM_E_REFRESHER_BUSY = 0x80041057, + WBEM_E_UNPARSABLE_QUERY = 0x80041058, + WBEM_E_NOT_EVENT_CLASS = 0x80041059, + WBEM_E_MISSING_GROUP_WITHIN = 0x8004105a, + WBEM_E_MISSING_AGGREGATION_LIST = 0x8004105b, + WBEM_E_PROPERTY_NOT_AN_OBJECT = 0x8004105c, + WBEM_E_AGGREGATING_BY_OBJECT = 0x8004105d, + WBEM_E_UNINTERPRETABLE_PROVIDER_QUERY = 0x8004105f, + WBEM_E_BACKUP_RESTORE_WINMGMT_RUNNING = 0x80041060, + WBEM_E_QUEUE_OVERFLOW = 0x80041061, + WBEM_E_PRIVILEGE_NOT_HELD = 0x80041062, + WBEM_E_INVALID_OPERATOR = 0x80041063, + WBEM_E_LOCAL_CREDENTIALS = 0x80041064, + WBEM_E_CANNOT_BE_ABSTRACT = 0x80041065, + WBEM_E_AMENDED_OBJECT = 0x80041066, + WBEM_E_CLIENT_TOO_SLOW = 0x80041067, + WBEM_E_NULL_SECURITY_DESCRIPTOR = 0x80041068, + WBEM_E_TIMED_OUT = 0x80041069, + WBEM_E_INVALID_ASSOCIATION = 0x8004106a, + WBEM_E_AMBIGUOUS_OPERATION = 0x8004106b, + WBEM_E_QUOTA_VIOLATION = 0x8004106c, + WBEM_E_RESERVED_001 = 0x8004106d, + WBEM_E_RESERVED_002 = 0x8004106e, + WBEM_E_UNSUPPORTED_LOCALE = 0x8004106f, + WBEM_E_HANDLE_OUT_OF_DATE = 0x80041070, + WBEM_E_CONNECTION_FAILED = 0x80041071, + WBEM_E_INVALID_HANDLE_REQUEST = 0x80041072, + WBEM_E_PROPERTY_NAME_TOO_WIDE = 0x80041073, + WBEM_E_CLASS_NAME_TOO_WIDE = 0x80041074, + WBEM_E_METHOD_NAME_TOO_WIDE = 0x80041075, + WBEM_E_QUALIFIER_NAME_TOO_WIDE = 0x80041076, + WBEM_E_RERUN_COMMAND = 0x80041077, + WBEM_E_DATABASE_VER_MISMATCH = 0x80041078, + WBEM_E_VETO_DELETE = 0x80041079, + WBEM_E_VETO_PUT = 0x8004107a, + WBEM_E_INVALID_LOCALE = 0x80041080, + WBEM_E_PROVIDER_SUSPENDED = 0x80041081, + WBEM_E_SYNCHRONIZATION_REQUIRED = 0x80041082, + WBEM_E_NO_SCHEMA = 0x80041083, + WBEM_E_PROVIDER_ALREADY_REGISTERED = 0x80041084, + WBEM_E_PROVIDER_NOT_REGISTERED = 0x80041085, + WBEM_E_FATAL_TRANSPORT_ERROR = 0x80041086, + WBEM_E_ENCRYPTED_CONNECTION_REQUIRED = 0x80041087, + WBEM_E_PROVIDER_TIMED_OUT = 0x80041088, + WBEM_E_NO_KEY = 0x80041089, + WBEM_E_PROVIDER_DISABLED = 0x8004108a, + WBEMESS_E_REGISTRATION_TOO_BROAD = 0x80042001, + WBEMESS_E_REGISTRATION_TOO_PRECISE = 0x80042002, + WBEMESS_E_AUTHZ_NOT_PRIVILEGED = 0x80042003, + WBEMMOF_E_EXPECTED_QUALIFIER_NAME = 0x80044001, + WBEMMOF_E_EXPECTED_SEMI = 0x80044002, + WBEMMOF_E_EXPECTED_OPEN_BRACE = 0x80044003, + WBEMMOF_E_EXPECTED_CLOSE_BRACE = 0x80044004, + WBEMMOF_E_EXPECTED_CLOSE_BRACKET = 0x80044005, + WBEMMOF_E_EXPECTED_CLOSE_PAREN = 0x80044006, + WBEMMOF_E_ILLEGAL_CONSTANT_VALUE = 0x80044007, + WBEMMOF_E_EXPECTED_TYPE_IDENTIFIER = 0x80044008, + WBEMMOF_E_EXPECTED_OPEN_PAREN = 0x80044009, + WBEMMOF_E_UNRECOGNIZED_TOKEN = 0x8004400a, + WBEMMOF_E_UNRECOGNIZED_TYPE = 0x8004400b, + WBEMMOF_E_EXPECTED_PROPERTY_NAME = 0x8004400c, + WBEMMOF_E_TYPEDEF_NOT_SUPPORTED = 0x8004400d, + WBEMMOF_E_UNEXPECTED_ALIAS = 0x8004400e, + WBEMMOF_E_UNEXPECTED_ARRAY_INIT = 0x8004400f, + WBEMMOF_E_INVALID_AMENDMENT_SYNTAX = 0x80044010, + WBEMMOF_E_INVALID_DUPLICATE_AMENDMENT = 0x80044011, + WBEMMOF_E_INVALID_PRAGMA = 0x80044012, + WBEMMOF_E_INVALID_NAMESPACE_SYNTAX = 0x80044013, + WBEMMOF_E_EXPECTED_CLASS_NAME = 0x80044014, + WBEMMOF_E_TYPE_MISMATCH = 0x80044015, + WBEMMOF_E_EXPECTED_ALIAS_NAME = 0x80044016, + WBEMMOF_E_INVALID_CLASS_DECLARATION = 0x80044017, + WBEMMOF_E_INVALID_INSTANCE_DECLARATION = 0x80044018, + WBEMMOF_E_EXPECTED_DOLLAR = 0x80044019, + WBEMMOF_E_CIMTYPE_QUALIFIER = 0x8004401a, + WBEMMOF_E_DUPLICATE_PROPERTY = 0x8004401b, + WBEMMOF_E_INVALID_NAMESPACE_SPECIFICATION = 0x8004401c, + WBEMMOF_E_OUT_OF_RANGE = 0x8004401d, + WBEMMOF_E_INVALID_FILE = 0x8004401e, + WBEMMOF_E_ALIASES_IN_EMBEDDED = 0x8004401f, + WBEMMOF_E_NULL_ARRAY_ELEM = 0x80044020, + WBEMMOF_E_DUPLICATE_QUALIFIER = 0x80044021, + WBEMMOF_E_EXPECTED_FLAVOR_TYPE = 0x80044022, + WBEMMOF_E_INCOMPATIBLE_FLAVOR_TYPES = 0x80044023, + WBEMMOF_E_MULTIPLE_ALIASES = 0x80044024, + WBEMMOF_E_INCOMPATIBLE_FLAVOR_TYPES2 = 0x80044025, + WBEMMOF_E_NO_ARRAYS_RETURNED = 0x80044026, + WBEMMOF_E_MUST_BE_IN_OR_OUT = 0x80044027, + WBEMMOF_E_INVALID_FLAGS_SYNTAX = 0x80044028, + WBEMMOF_E_EXPECTED_BRACE_OR_BAD_TYPE = 0x80044029, + WBEMMOF_E_UNSUPPORTED_CIMV22_QUAL_VALUE = 0x8004402a, + WBEMMOF_E_UNSUPPORTED_CIMV22_DATA_TYPE = 0x8004402b, + WBEMMOF_E_INVALID_DELETEINSTANCE_SYNTAX = 0x8004402c, + WBEMMOF_E_INVALID_QUALIFIER_SYNTAX = 0x8004402d, + WBEMMOF_E_QUALIFIER_USED_OUTSIDE_SCOPE = 0x8004402e, + WBEMMOF_E_ERROR_CREATING_TEMP_FILE = 0x8004402f, + WBEMMOF_E_ERROR_INVALID_INCLUDE_FILE = 0x80044030, + WBEMMOF_E_INVALID_DELETECLASS_SYNTAX = 0x80044031, +}} +// EXTERN_C const IID LIBID_WbemClient_v1; +// EXTERN_C const IID IID_IWbemClassObject; +DEFINE_GUID!{IID_IWbemClassObject, + 0xdc12a681, 0x737f, 0x11cf, 0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24} +RIDL!{#[uuid(0xdc12a681, 0x737f, 0x11cf, 0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24)] +interface IWbemClassObject(IWbemClassObjectVtbl): IUnknown(IUnknownVtbl) { + fn GetQualifierSet( + ppQualSet: *mut *mut IWbemQualifierSet, + ) -> HRESULT, + fn Get( + wszName: LPCWSTR, + lFlags: c_long, + pVal: *mut VARIANT, + pType: *mut CIMTYPE, + plFlavor: *mut c_long, + ) -> HRESULT, + fn Put( + wszName: LPCWSTR, + lFlags: c_long, + pVal: *mut VARIANT, + Type: CIMTYPE, + ) -> HRESULT, + fn Delete( + wszName: LPCWSTR, + ) -> HRESULT, + fn GetNames( + wszQualifierName: LPCWSTR, + lFlags: c_long, + pQualifierVal: *mut VARIANT, + pNames: *mut *mut SAFEARRAY, + ) -> HRESULT, + fn BeginEnumeration( + lEnumFlags: c_long, + ) -> HRESULT, + fn Next( + lFlags: c_long, + strName: *mut BSTR, + pVal: *mut VARIANT, + pType: *mut CIMTYPE, + plFlavor: *mut c_long, + ) -> HRESULT, + fn EndEnumeration() -> HRESULT, + fn GetPropertyQualifierSet( + wszProperty: LPCWSTR, + ppQualSet: *mut *mut IWbemQualifierSet, + ) -> HRESULT, + fn Clone( + ppCopy: *mut *mut IWbemClassObject, + ) -> HRESULT, + fn GetObjectText( + lFlags: c_long, + pstrObjectText: *mut BSTR, + ) -> HRESULT, + fn SpawnDerivedClass( + lFlags: c_long, + ppNewClass: *mut *mut IWbemClassObject, + ) -> HRESULT, + fn SpawnInstance( + lFlags: c_long, + ppNewInstance: *mut *mut IWbemClassObject, + ) -> HRESULT, + fn CompareTo( + lFlags: c_long, + pCompareTo: *mut IWbemClassObject, + ) -> HRESULT, + fn GetPropertyOrigin( + wszName: LPCWSTR, + pstrClassName: *mut BSTR, + ) -> HRESULT, + fn InheritsFrom( + strAncestor: LPCWSTR, + ) -> HRESULT, + fn GetMethod( + wszName: LPCWSTR, + lFlags: c_long, + ppInSignature: *mut *mut IWbemClassObject, + ppOutSignature: *mut *mut IWbemClassObject, + ) -> HRESULT, + fn PutMethod( + wszName: LPCWSTR, + lFlags: c_long, + pInSignature: *mut IWbemClassObject, + pOutSignature: *mut IWbemClassObject, + ) -> HRESULT, + fn DeleteMethod( + wszName: LPCWSTR, + ) -> HRESULT, + fn BeginMethodEnumeration( + lEnumFlags: c_long, + ) -> HRESULT, + fn NextMethod( + lFlags: c_long, + pstrName: *mut BSTR, + ppInSignature: *mut *mut IWbemClassObject, + ppOutSignature: *mut *mut IWbemClassObject, + ) -> HRESULT, + fn EndMethodEnumeration() -> HRESULT, + fn GetMethodQualifierSet( + wszMethod: LPCWSTR, + ppQualSet: *mut *mut IWbemQualifierSet, + ) -> HRESULT, + fn GetMethodOrigin( + wszMethodName: LPCWSTR, + pstrClassName: *mut BSTR, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemObjectAccess; +DEFINE_GUID!{IID_IWbemObjectAccess, + 0x49353c9a, 0x516b, 0x11d1, 0xae, 0xa6, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0x49353c9a, 0x516b, 0x11d1, 0xae, 0xa6, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IWbemObjectAccess(IWbemObjectAccessVtbl): IWbemClassObject(IWbemClassObjectVtbl) { + fn GetPropertyHandle( + wszPropertyName: LPCWSTR, + pType: *mut CIMTYPE, + plHandle: *mut c_long, + ) -> HRESULT, + fn WritePropertyValue( + lHandle: c_long, + lNumBytes: c_long, + aData: *const byte, + ) -> HRESULT, + fn ReadPropertyValue( + lHandle: c_long, + lBufferSize: c_long, + plNumBytes: *mut c_long, + aData: *mut byte, + ) -> HRESULT, + fn ReadDWORD( + lHandle: c_long, + pdw: *mut DWORD, + ) -> HRESULT, + fn WriteDWORD( + lHandle: c_long, + dw: DWORD, + ) -> HRESULT, + fn ReadQWORD( + lHandle: c_long, + pqw: *mut __uint64, + ) -> HRESULT, + fn WriteQWORD( + lHandle: c_long, + pw: __uint64, + ) -> HRESULT, + fn GetPropertyInfoByHandle( + lHandle: c_long, + pstrName: *mut BSTR, + pType: *mut CIMTYPE, + ) -> HRESULT, + fn Lock( + lFlags: c_long, + ) -> HRESULT, + fn Unlock( + lFlags: c_long, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemQualifierSet; +DEFINE_GUID!{IID_IWbemQualifierSet, + 0xdc12a680, 0x737f, 0x11cf, 0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24} +RIDL!{#[uuid(0xdc12a680, 0x737f, 0x11cf, 0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24)] +interface IWbemQualifierSet(IWbemQualifierSetVtbl): IUnknown(IUnknownVtbl) { + fn Get( + wszName: LPCWSTR, + lFlags: c_long, + pVal: *mut VARIANT, + plFlavor: *mut c_long, + ) -> HRESULT, + fn Put( + wszName: LPCWSTR, + pVal: *mut VARIANT, + lFlavor: c_long, + ) -> HRESULT, + fn Delete( + wszName: LPCWSTR, + ) -> HRESULT, + fn GetNames( + lFlags: c_long, + pNames: *mut *mut SAFEARRAY, + ) -> HRESULT, + fn BeginEnumeration( + lFlags: c_long, + ) -> HRESULT, + fn Next( + lFlags: c_long, + pstrName: *mut BSTR, + pVal: *mut VARIANT, + plFlavor: *mut c_long, + ) -> HRESULT, + fn EndEnumeration() -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemServices; +DEFINE_GUID!{IID_IWbemServices, + 0x9556dc99, 0x828c, 0x11cf, 0xa3, 0x7e, 0x00, 0xaa, 0x00, 0x32, 0x40, 0xc7} +RIDL!{#[uuid(0x9556dc99, 0x828c, 0x11cf, 0xa3, 0x7e, 0x00, 0xaa, 0x00, 0x32, 0x40, 0xc7)] +interface IWbemServices(IWbemServicesVtbl): IUnknown(IUnknownVtbl) { + fn OpenNamespace( + strNamespace: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppWorkingNamespace: *mut *mut IWbemServices, + ppResult: *mut *mut IWbemCallResult, + ) -> HRESULT, + fn CancelAsyncCall( + pSink: *mut IWbemObjectSink, + ) -> HRESULT, + fn QueryObjectSink( + lFlags: c_long, + ppResponseHandler: *mut *mut IWbemObjectSink, + ) -> HRESULT, + fn GetObject( + strObjectPath: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppObject: *mut *mut IWbemClassObject, + ppCallResult: *mut *mut IWbemCallResult, + ) -> HRESULT, + fn GetObjectAsync( + strObjectPath: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, + fn PutClass( + pObject: *mut IWbemClassObject, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppCallResult: *mut *mut IWbemCallResult, + ) -> HRESULT, + fn PutClassAsync( + pObject: *mut IWbemClassObject, + lFlags: c_long, + pCtx: *mut IWbemContext, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, + fn DeleteClass( + strClass: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppCallResult: *mut *mut IWbemCallResult, + ) -> HRESULT, + fn DeleteClassAsync( + strClass: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, + fn CreateClassEnum( + strSuperclass: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppEnum: *mut *mut IEnumWbemClassObject, + ) -> HRESULT, + fn CreateClassEnumAsync( + strSuperclass: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, + fn PutInstance( + pInst: *mut IWbemClassObject, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppCallResult: *mut *mut IWbemCallResult, + ) -> HRESULT, + fn PutInstanceAsync( + pInst: *mut IWbemClassObject, + lFlags: c_long, + pCtx: *mut IWbemContext, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, + fn DeleteInstance( + strObjectPath: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppCallResult: *mut *mut IWbemCallResult, + ) -> HRESULT, + fn DeleteInstanceAsync( + strObjectPath: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, + fn CreateInstanceEnum( + strFilter: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppEnum: *mut *mut IEnumWbemClassObject, + ) -> HRESULT, + fn CreateInstanceEnumAsync( + strFilter: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, + fn ExecQuery( + strQueryLanguage: BSTR, + strQuery: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppEnum: *mut *mut IEnumWbemClassObject, + ) -> HRESULT, + fn ExecQueryAsync( + strQueryLanguage: BSTR, + strQuery: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, + fn ExecNotificationQuery( + strQueryLanguage: BSTR, + strQuery: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppEnum: *mut *mut IEnumWbemClassObject, + ) -> HRESULT, + fn ExecNotificationQueryAsync( + strQueryLanguage: BSTR, + strQuery: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, + fn ExecMethod( + strObjectPath: BSTR, + strMethodName: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + pInParams: *mut IWbemClassObject, + ppOutParams: *mut *mut IWbemClassObject, + ppCallResult: *mut *mut IWbemCallResult, + ) -> HRESULT, + fn ExecMethodAsync( + strObjectPath: BSTR, + strMethodName: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + pInParams: *mut IWbemClassObject, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemLocator; +DEFINE_GUID!{IID_IWbemLocator, + 0xdc12a687, 0x737f, 0x11cf, 0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24} +RIDL!{#[uuid(0xdc12a687, 0x737f, 0x11cf, 0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24)] +interface IWbemLocator(IWbemLocatorVtbl): IUnknown(IUnknownVtbl) { + fn ConnectServer( + strNetworkResource: BSTR, + strUser: BSTR, + strPassword: BSTR, + strLocale: BSTR, + lSecurityFlags: c_long, + strAuthority: BSTR, + pCtx: *mut IWbemContext, + ppNamespace: *mut *mut IWbemServices, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemObjectSink; +DEFINE_GUID!{IID_IWbemObjectSink, + 0x7c857801, 0x7381, 0x11cf, 0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24} +RIDL!{#[uuid(0x7c857801, 0x7381, 0x11cf, 0x88, 0x4d, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24)] +interface IWbemObjectSink(IWbemObjectSinkVtbl): IUnknown(IUnknownVtbl) { + fn Indicate( + lObjectCount: c_long, + apObjArray: *mut *mut IWbemClassObject, + ) -> HRESULT, + fn SetStatus( + lFlags: c_long, + hResult: HRESULT, + strParam: BSTR, + pObjParam: *mut IWbemClassObject, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IEnumWbemClassObject; +DEFINE_GUID!{IID_IEnumWbemClassObject, + 0x027947e1, 0xd731, 0x11ce, 0xa3, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} +RIDL!{#[uuid(0x027947e1, 0xd731, 0x11ce, 0xa3, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01)] +interface IEnumWbemClassObject(IEnumWbemClassObjectVtbl): IUnknown(IUnknownVtbl) { + fn Reset() -> HRESULT, + fn Next( + lTimeout: c_long, + uCount: ULONG, + apObjects: *mut *mut IWbemClassObject, + puReturned: *mut ULONG, + ) -> HRESULT, + fn NextAsync( + uCount: ULONG, + pSink: *mut IWbemObjectSink, + ) -> HRESULT, + fn Clone( + ppEnum: *mut *mut IEnumWbemClassObject, + ) -> HRESULT, + fn Skip( + lTimeout: c_long, + nCount: ULONG, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemCallResult; +DEFINE_GUID!{IID_IWbemCallResult, + 0x44aca675, 0xe8fc, 0x11d0, 0xa0, 0x7c, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0x44aca675, 0xe8fc, 0x11d0, 0xa0, 0x7c, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IWbemCallResult(IWbemCallResultVtbl): IUnknown(IUnknownVtbl) { + fn GetResultObject( + lTimeout: c_long, + ppResultObject: *mut *mut IWbemClassObject, + ) -> HRESULT, + fn GetResultString( + lTimeout: c_long, + pstrResultString: *mut BSTR, + ) -> HRESULT, + fn GetResultServices( + lTimeout: c_long, + ppServices: *mut *mut IWbemServices, + ) -> HRESULT, + fn GetCallStatus( + lTimeout: c_long, + plStatus: *mut c_long, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemContext; +DEFINE_GUID!{IID_IWbemContext, + 0x44aca674, 0xe8fc, 0x11d0, 0xa0, 0x7c, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0x44aca674, 0xe8fc, 0x11d0, 0xa0, 0x7c, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IWbemContext(IWbemContextVtbl): IUnknown(IUnknownVtbl) { + fn Clone( + ppNewCopy: *mut *mut IWbemContext, + ) -> HRESULT, + fn GetNames( + lFlags: c_long, + pNames: *mut *mut SAFEARRAY, + ) -> HRESULT, + fn BeginEnumeration( + lFlags: c_long, + ) -> HRESULT, + fn Next( + lFlags: c_long, + pstrName: *mut BSTR, + pValue: *mut VARIANT, + ) -> HRESULT, + fn EndEnumeration() -> HRESULT, + fn SetValue( + wszName: LPCWSTR, + lFlags: c_long, + pValue: *mut VARIANT, + ) -> HRESULT, + fn GetValue( + wszName: LPCWSTR, + lFlags: c_long, + pValue: *mut VARIANT, + ) -> HRESULT, + fn DeleteValue( + wszName: LPCWSTR, + lFlags: c_long, + ) -> HRESULT, + fn DeleteAll() -> HRESULT, +}} +// EXTERN_C const IID IID_IUnsecuredApartment; +DEFINE_GUID!{IID_IUnsecuredApartment, + 0x1cfaba8c, 0x1523, 0x11d1, 0xad, 0x79, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +RIDL!{#[uuid(0x1cfaba8c, 0x1523, 0x11d1, 0xad, 0x79, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff)] +interface IUnsecuredApartment(IUnsecuredApartmentVtbl): IUnknown(IUnknownVtbl) { + fn CreateObjectStub( + pObject: *mut IUnknown, + ppStub: *mut *mut IUnknown, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemUnsecuredApartment; +DEFINE_GUID!{IID_IWbemUnsecuredApartment, + 0x31739d04, 0x3471, 0x4cf4, 0x9a, 0x7c, 0x57, 0xa4, 0x4a, 0xe7, 0x19, 0x56} +RIDL!{#[uuid(0x31739d04, 0x3471, 0x4cf4, 0x9a, 0x7c, 0x57, 0xa4, 0x4a, 0xe7, 0x19, 0x56)] +interface IWbemUnsecuredApartment(IWbemUnsecuredApartmentVtbl): +IUnsecuredApartment(IUnsecuredApartmentVtbl) { + fn CreateSinkStub( + pSink: *mut IWbemObjectSink, + dwFlags: DWORD, + wszReserved: LPCWSTR, + ppStub: *mut *mut IWbemObjectSink, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemStatusCodeText; +DEFINE_GUID!{IID_IWbemStatusCodeText, + 0xeb87e1bc, 0x3233, 0x11d2, 0xae, 0xc9, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0xeb87e1bc, 0x3233, 0x11d2, 0xae, 0xc9, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IWbemStatusCodeText(IWbemStatusCodeTextVtbl): IUnknown(IUnknownVtbl) { + fn GetErrorCodeText( + hRes: HRESULT, + LocaleId: LCID, + lFlags: c_long, + MessageText: *mut BSTR, + ) -> HRESULT, + fn GetFacilityCodeText( + hRes: HRESULT, + LocaleId: LCID, + lFlags: c_long, + MessageText: *mut BSTR, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemBackupRestore; +DEFINE_GUID!{IID_IWbemBackupRestore, + 0xc49e32c7, 0xbc8b, 0x11d2, 0x85, 0xd4, 0x00, 0x10, 0x5a, 0x1f, 0x83, 0x04} +RIDL!{#[uuid(0xc49e32c7, 0xbc8b, 0x11d2, 0x85, 0xd4, 0x00, 0x10, 0x5a, 0x1f, 0x83, 0x04)] +interface IWbemBackupRestore(IWbemBackupRestoreVtbl): IUnknown(IUnknownVtbl) { + fn Backup( + strBackupToFile: LPCWSTR, + lFlags: c_long, + ) -> HRESULT, + fn Restore( + strRestoreFromFile: LPCWSTR, + lFlags: c_long, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemBackupRestoreEx; +DEFINE_GUID!{IID_IWbemBackupRestoreEx, + 0xa359dec5, 0xe813, 0x4834, 0x8a, 0x2a, 0xba, 0x7f, 0x1d, 0x77, 0x7d, 0x76} +RIDL!{#[uuid(0xa359dec5, 0xe813, 0x4834, 0x8a, 0x2a, 0xba, 0x7f, 0x1d, 0x77, 0x7d, 0x76)] +interface IWbemBackupRestoreEx(IWbemBackupRestoreExVtbl): +IWbemBackupRestore(IWbemBackupRestoreVtbl) { + fn Pause() -> HRESULT, + fn Resume() -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemRefresher; +DEFINE_GUID!{IID_IWbemRefresher, + 0x49353c99, 0x516b, 0x11d1, 0xae, 0xa6, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0x49353c99, 0x516b, 0x11d1, 0xae, 0xa6, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IWbemRefresher(IWbemRefresherVtbl): IUnknown(IUnknownVtbl) { + fn Refresh( + lFlags: c_long, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemHiPerfEnum; +DEFINE_GUID!{IID_IWbemHiPerfEnum, + 0x2705c288, 0x79ae, 0x11d2, 0xb3, 0x48, 0x00, 0x10, 0x5a, 0x1f, 0x81, 0x77} +RIDL!{#[uuid(0x2705c288, 0x79ae, 0x11d2, 0xb3, 0x48, 0x00, 0x10, 0x5a, 0x1f, 0x81, 0x77)] +interface IWbemHiPerfEnum(IWbemHiPerfEnumVtbl): IUnknown(IUnknownVtbl) { + fn AddObjects( + lFlags: c_long, + uNumObjects: ULONG, + apIds: *mut c_long, + apObj: *mut *mut IWbemObjectAccess, + ) -> HRESULT, + fn RemoveObjects( + lFlags: c_long, + uNumObjects: ULONG, + apIds: *mut c_long, + ) -> HRESULT, + fn GetObjects( + lFlags: c_long, + uNumObjects: ULONG, + apObj: *mut *mut IWbemObjectAccess, + puReturned: *mut ULONG, + ) -> HRESULT, + fn RemoveAll( + lFlags: c_long, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemConfigureRefresher; +DEFINE_GUID!{IID_IWbemConfigureRefresher, + 0x49353c92, 0x516b, 0x11d1, 0xae, 0xa6, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0x49353c92, 0x516b, 0x11d1, 0xae, 0xa6, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IWbemConfigureRefresher(IWbemConfigureRefresherVtbl): IUnknown(IUnknownVtbl) { + fn AddObjectByPath( + pNamespace: *mut IWbemServices, + wszPath: LPCWSTR, + lFlags: c_long, + pContext: *mut IWbemContext, + ppRefreshable: *mut *mut IWbemClassObject, + plId: *mut c_long, + ) -> HRESULT, + fn AddObjectByTemplate( + pNamespace: *mut IWbemServices, + pTemplate: *mut IWbemClassObject, + lFlags: c_long, + pContext: *mut IWbemContext, + ppRefreshable: *mut *mut IWbemClassObject, + plId: *mut c_long, + ) -> HRESULT, + fn AddRefresher( + pRefresher: *mut IWbemRefresher, + lFlags: c_long, + plId: *mut c_long, + ) -> HRESULT, + fn Remove( + lId: c_long, + lFlags: c_long, + ) -> HRESULT, + fn AddEnum( + pNamespace: *mut IWbemServices, + wszClassName: LPCWSTR, + lFlags: c_long, + pContext: *mut IWbemContext, + ppEnum: *mut *mut IWbemHiPerfEnum, + plId: *mut c_long, + ) -> HRESULT, +}} +DEFINE_GUID!{CLSID_WbemLocator, + 0x4590f811, 0x1d3a, 0x11d0, 0x89, 0x1f, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24} +RIDL!{#[uuid(0x4590f811, 0x1d3a, 0x11d0, 0x89, 0x1f, 0x00, 0xaa, 0x00, 0x4b, 0x2e, 0x24)] +class WbemLocator;} +DEFINE_GUID!{CLSID_WbemContext, + 0x674B6698, 0xEE92, 0x11d0, 0xAD, 0x71, 0x00, 0xC0, 0x4F, 0xD8, 0xFD, 0xFF} +// class DECLSPEC_UUID("674B6698-EE92-11d0-AD71-00C04FD8FDFF") +// WbemContext; +DEFINE_GUID!{CLSID_UnsecuredApartment, + 0x49bd2028, 0x1523, 0x11d1, 0xad, 0x79, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +// class DECLSPEC_UUID("49bd2028-1523-11d1-ad79-00c04fd8fdff") +// UnsecuredApartment; +DEFINE_GUID!{CLSID_WbemClassObject, + 0x9A653086, 0x174F, 0x11d2, 0xB5, 0xF9, 0x00, 0x10, 0x4B, 0x70, 0x3E, 0xFD} +// class DECLSPEC_UUID("9A653086-174F-11d2-B5F9-00104B703EFD") +// WbemClassObject; +DEFINE_GUID!{CLSID_MofCompiler, + 0x6daf9757, 0x2e37, 0x11d2, 0xae, 0xc9, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +// class DECLSPEC_UUID("6daf9757-2e37-11d2-aec9-00c04fb68820") +// MofCompiler; +DEFINE_GUID!{CLSID_WbemStatusCodeText, + 0xeb87e1bd, 0x3233, 0x11d2, 0xae, 0xc9, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +// class DECLSPEC_UUID("eb87e1bd-3233-11d2-aec9-00c04fb68820") +// WbemStatusCodeText; +DEFINE_GUID!{CLSID_WbemBackupRestore, + 0xC49E32C6, 0xBC8B, 0x11d2, 0x85, 0xD4, 0x00, 0x10, 0x5A, 0x1F, 0x83, 0x04} +// class DECLSPEC_UUID("C49E32C6-BC8B-11d2-85D4-00105A1F8304") +// WbemBackupRestore; +DEFINE_GUID!{CLSID_WbemRefresher, + 0xc71566f2, 0x561e, 0x11d1, 0xad, 0x87, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +// class DECLSPEC_UUID("c71566f2-561e-11d1-ad87-00c04fd8fdff") +// WbemRefresher; +DEFINE_GUID!{CLSID_WbemObjectTextSrc, + 0x8D1C559D, 0x84F0, 0x4bb3, 0xA7, 0xD5, 0x56, 0xA7, 0x43, 0x5A, 0x9B, 0xA6} +// class DECLSPEC_UUID("8D1C559D-84F0-4bb3-A7D5-56A7435A9BA6") +// WbemObjectTextSrc; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0001_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0001_v0_0_s_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0003_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0003_v0_0_s_ifspec; +// EXTERN_C const IID IID_IWbemObjectSinkEx; +DEFINE_GUID!{IID_IWbemObjectSinkEx, + 0xe7d35cfa, 0x348b, 0x485e, 0xb5, 0x24, 0x25, 0x27, 0x25, 0xd6, 0x97, 0xca} +RIDL!{#[uuid(0xe7d35cfa, 0x348b, 0x485e, 0xb5, 0x24, 0x25, 0x27, 0x25, 0xd6, 0x97, 0xca)] +interface IWbemObjectSinkEx(IWbemObjectSinkExVtbl): IWbemObjectSink(IWbemObjectSinkVtbl) { + fn WriteMessage( + uChannel: ULONG, + strMessage: BSTR, + ) -> HRESULT, + fn WriteError( + pObjError: *mut IWbemClassObject, + puReturned: *mut c_uchar, + ) -> HRESULT, + fn PromptUser( + strMessage: BSTR, + uPromptType: c_uchar, + puReturned: *mut c_uchar, + ) -> HRESULT, + fn WriteProgress( + strActivity: BSTR, + strCurrentOperation: BSTR, + strStatusDescription: BSTR, + uPercentComplete: ULONG, + uSecondsRemaining: ULONG, + ) -> HRESULT, + fn WriteStreamParameter( + strName: BSTR, + vtValue: *mut VARIANT, + ulType: ULONG, + ulFlags: ULONG, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemShutdown; +DEFINE_GUID!{IID_IWbemShutdown, + 0xb7b31df9, 0xd515, 0x11d3, 0xa1, 0x1c, 0x00, 0x10, 0x5a, 0x1f, 0x51, 0x5a} +RIDL!{#[uuid(0xb7b31df9, 0xd515, 0x11d3, 0xa1, 0x1c, 0x00, 0x10, 0x5a, 0x1f, 0x51, 0x5a)] +interface IWbemShutdown(IWbemShutdownVtbl): IUnknown(IUnknownVtbl) { + fn Shutdown( + uReason: LONG, + uMaxMilliseconds: ULONG, + pCtx: *mut IWbemContext, + ) -> HRESULT, +}} +ENUM!{enum WMI_OBJ_TEXT { + WMI_OBJ_TEXT_CIM_DTD_2_0 = 1, + WMI_OBJ_TEXT_WMI_DTD_2_0 = 2, + WMI_OBJ_TEXT_WMI_EXT1 = 3, + WMI_OBJ_TEXT_WMI_EXT2 = 4, + WMI_OBJ_TEXT_WMI_EXT3 = 5, + WMI_OBJ_TEXT_WMI_EXT4 = 6, + WMI_OBJ_TEXT_WMI_EXT5 = 7, + WMI_OBJ_TEXT_WMI_EXT6 = 8, + WMI_OBJ_TEXT_WMI_EXT7 = 9, + WMI_OBJ_TEXT_WMI_EXT8 = 10, + WMI_OBJ_TEXT_WMI_EXT9 = 11, + WMI_OBJ_TEXT_WMI_EXT10 = 12, + WMI_OBJ_TEXT_LAST = 13, +}} +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0011_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0011_v0_0_s_ifspec; +// EXTERN_C const IID IID_IWbemObjectTextSrc; +DEFINE_GUID!{IID_IWbemObjectTextSrc, + 0xbfbf883a, 0xcad7, 0x11d3, 0xa1, 0x1b, 0x00, 0x10, 0x5a, 0x1f, 0x51, 0x5a} +RIDL!{#[uuid(0xbfbf883a, 0xcad7, 0x11d3, 0xa1, 0x1b, 0x00, 0x10, 0x5a, 0x1f, 0x51, 0x5a)] +interface IWbemObjectTextSrc(IWbemObjectTextSrcVtbl): IUnknown(IUnknownVtbl) { + fn GetText( + lFlags: c_long, + pObj: *mut IWbemClassObject, + uObjTextFormat: ULONG, + pCtx: *mut IWbemContext, + strText: *mut BSTR, + ) -> HRESULT, + fn CreateFromText( + lFlags: c_long, + strText: BSTR, + uObjTextFormat: ULONG, + pCtx: *mut IWbemContext, + pNewObj: *mut *mut IWbemClassObject, + ) -> HRESULT, +}} +STRUCT!{struct WBEM_COMPILE_STATUS_INFO { + lPhaseError: c_long, + hRes: HRESULT, + ObjectNum: c_long, + FirstLine: c_long, + LastLine: c_long, + dwOutFlags: DWORD, +}} +ENUM!{enum WBEM_COMPILER_OPTIONS { + WBEM_FLAG_CHECK_ONLY = 0x1, + WBEM_FLAG_AUTORECOVER = 0x2, + WBEM_FLAG_WMI_CHECK = 0x4, + WBEM_FLAG_CONSOLE_PRINT = 0x8, + WBEM_FLAG_DONT_ADD_TO_LIST = 0x10, + WBEM_FLAG_SPLIT_FILES = 0x20, + WBEM_FLAG_STORE_FILE = 0x100, +}} +ENUM!{enum WBEM_CONNECT_OPTIONS { + WBEM_FLAG_CONNECT_REPOSITORY_ONLY = 0x40, + WBEM_FLAG_CONNECT_USE_MAX_WAIT = 0x80, + WBEM_FLAG_CONNECT_PROVIDERS = 0x100, +}} +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0013_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0013_v0_0_s_ifspec; +// EXTERN_C const IID IID_IMofCompiler; +DEFINE_GUID!{IID_IMofCompiler, + 0x6daf974e, 0x2e37, 0x11d2, 0xae, 0xc9, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0x6daf974e, 0x2e37, 0x11d2, 0xae, 0xc9, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IMofCompiler(IMofCompilerVtbl): IUnknown(IUnknownVtbl) { + fn CompileFile( + FileName: LPWSTR, + ServerAndNamespace: LPWSTR, + User: LPWSTR, + Authority: LPWSTR, + Password: LPWSTR, + lOptionFlags: LONG, + lClassFlags: LONG, + lInstanceFlags: LONG, + pInfo: *mut WBEM_COMPILE_STATUS_INFO, + ) -> HRESULT, + fn CompileBuffer( + BuffSize: c_long, + pBuffer: *mut BYTE, + ServerAndNamespace: LPWSTR, + User: LPWSTR, + Authority: LPWSTR, + Password: LPWSTR, + lOptionFlags: LONG, + lClassFlags: LONG, + lInstanceFlags: LONG, + pInfo: *mut WBEM_COMPILE_STATUS_INFO, + ) -> HRESULT, + fn CreateBMOF( + TextFileName: LPWSTR, + BMOFFileName: LPWSTR, + ServerAndNamespace: LPWSTR, + lOptionFlags: LONG, + lClassFlags: LONG, + lInstanceFlags: LONG, + pInfo: *mut WBEM_COMPILE_STATUS_INFO, + ) -> HRESULT, +}} +ENUM!{enum WBEM_UNSECAPP_FLAG_TYPE { + WBEM_FLAG_UNSECAPP_DEFAULT_CHECK_ACCESS = 0, + WBEM_FLAG_UNSECAPP_CHECK_ACCESS = 1, + WBEM_FLAG_UNSECAPP_DONT_CHECK_ACCESS = 2, +}} +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0015_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0015_v0_0_s_ifspec; +ENUM!{enum WBEM_INFORMATION_FLAG_TYPE { + WBEM_FLAG_SHORT_NAME = 0x1, + WBEM_FLAG_LONG_NAME = 0x2, +}} +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0016_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0016_v0_0_s_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0022_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemcli_0000_0022_v0_0_s_ifspec; +// unsigned c_long __RPC_USER BSTR_UserSize( __RPC__in unsigned c_long *, unsigned c_long , __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned c_long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned c_long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +// void __RPC_USER BSTR_UserFree( __RPC__in unsigned c_long *, __RPC__in BSTR * ); +// unsigned c_long __RPC_USER VARIANT_UserSize( __RPC__in unsigned c_long *, unsigned c_long , __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserMarshal( __RPC__in unsigned c_long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserUnmarshal(__RPC__in unsigned c_long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); +// void __RPC_USER VARIANT_UserFree( __RPC__in unsigned c_long *, __RPC__in VARIANT * ); +// unsigned c_long __RPC_USER BSTR_UserSize64( __RPC__in unsigned c_long *, unsigned c_long , __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned c_long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned c_long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +// void __RPC_USER BSTR_UserFree64( __RPC__in unsigned c_long *, __RPC__in BSTR * ); +// unsigned c_long __RPC_USER VARIANT_UserSize64( __RPC__in unsigned c_long *, unsigned c_long , __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserMarshal64( __RPC__in unsigned c_long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserUnmarshal64(__RPC__in unsigned c_long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); +// void __RPC_USER VARIANT_UserFree64( __RPC__in unsigned c_long *, __RPC__in VARIANT * ); diff --git a/bash-5.1/vendor/winapi/src/um/wbemdisp.rs b/bash-5.1/vendor/winapi/src/um/wbemdisp.rs new file mode 100644 index 0000000000000000000000000000000000000000..8e3ec773602cfd546554f0a39d7182d6901b4e4c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wbemdisp.rs @@ -0,0 +1,1344 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_long; +use shared::winerror::HRESULT; +use shared::wtypes::{BSTR, DATE, VARIANT_BOOL}; +use um::oaidl::{DISPID, IDispatch, IDispatchVtbl, VARIANT}; +use um::unknwnbase::IUnknown; +// extern RPC_IF_HANDLE __MIDL_itf_wbemdisp_0000_0000_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemdisp_0000_0000_v0_0_s_ifspec; +ENUM!{enum WbemChangeFlagEnum { + wbemChangeFlagCreateOrUpdate = 0, + wbemChangeFlagUpdateOnly = 0x1, + wbemChangeFlagCreateOnly = 0x2, + wbemChangeFlagUpdateCompatible = 0, + wbemChangeFlagUpdateSafeMode = 0x20, + wbemChangeFlagUpdateForceMode = 0x40, + wbemChangeFlagStrongValidation = 0x80, + wbemChangeFlagAdvisory = 0x10000, +}} +ENUM!{enum WbemFlagEnum { + wbemFlagReturnImmediately = 0x10, + wbemFlagReturnWhenComplete = 0, + wbemFlagBidirectional = 0, + wbemFlagForwardOnly = 0x20, + wbemFlagNoErrorObject = 0x40, + wbemFlagReturnErrorObject = 0, + wbemFlagSendStatus = 0x80, + wbemFlagDontSendStatus = 0, + wbemFlagEnsureLocatable = 0x100, + wbemFlagDirectRead = 0x200, + wbemFlagSendOnlySelected = 0, + wbemFlagUseAmendedQualifiers = 0x20000, + wbemFlagGetDefault = 0, + wbemFlagSpawnInstance = 0x1, + wbemFlagUseCurrentTime = 0x1, +}} +ENUM!{enum WbemQueryFlagEnum { + wbemQueryFlagDeep = 0, + wbemQueryFlagShallow = 1, + wbemQueryFlagPrototype = 2, +}} +ENUM!{enum WbemTextFlagEnum { + wbemTextFlagNoFlavors = 0x1, +}} +ENUM!{enum WbemTimeout { + wbemTimeoutInfinite = 0xffffffff, +}} +ENUM!{enum WbemComparisonFlagEnum { + wbemComparisonFlagIncludeAll = 0, + wbemComparisonFlagIgnoreQualifiers = 0x1, + wbemComparisonFlagIgnoreObjectSource = 0x2, + wbemComparisonFlagIgnoreDefaultValues = 0x4, + wbemComparisonFlagIgnoreClass = 0x8, + wbemComparisonFlagIgnoreCase = 0x10, + wbemComparisonFlagIgnoreFlavor = 0x20, +}} +ENUM!{enum WbemCimtypeEnum { + wbemCimtypeSint8 = 16, + wbemCimtypeUint8 = 17, + wbemCimtypeSint16 = 2, + wbemCimtypeUint16 = 18, + wbemCimtypeSint32 = 3, + wbemCimtypeUint32 = 19, + wbemCimtypeSint64 = 20, + wbemCimtypeUint64 = 21, + wbemCimtypeReal32 = 4, + wbemCimtypeReal64 = 5, + wbemCimtypeBoolean = 11, + wbemCimtypeString = 8, + wbemCimtypeDatetime = 101, + wbemCimtypeReference = 102, + wbemCimtypeChar16 = 103, + wbemCimtypeObject = 13, +}} +ENUM!{enum WbemErrorEnum { + wbemNoErr = 0, + wbemErrFailed = 0x80041001, + wbemErrNotFound = 0x80041002, + wbemErrAccessDenied = 0x80041003, + wbemErrProviderFailure = 0x80041004, + wbemErrTypeMismatch = 0x80041005, + wbemErrOutOfMemory = 0x80041006, + wbemErrInvalidContext = 0x80041007, + wbemErrInvalidParameter = 0x80041008, + wbemErrNotAvailable = 0x80041009, + wbemErrCriticalError = 0x8004100a, + wbemErrInvalidStream = 0x8004100b, + wbemErrNotSupported = 0x8004100c, + wbemErrInvalidSuperclass = 0x8004100d, + wbemErrInvalidNamespace = 0x8004100e, + wbemErrInvalidObject = 0x8004100f, + wbemErrInvalidClass = 0x80041010, + wbemErrProviderNotFound = 0x80041011, + wbemErrInvalidProviderRegistration = 0x80041012, + wbemErrProviderLoadFailure = 0x80041013, + wbemErrInitializationFailure = 0x80041014, + wbemErrTransportFailure = 0x80041015, + wbemErrInvalidOperation = 0x80041016, + wbemErrInvalidQuery = 0x80041017, + wbemErrInvalidQueryType = 0x80041018, + wbemErrAlreadyExists = 0x80041019, + wbemErrOverrideNotAllowed = 0x8004101a, + wbemErrPropagatedQualifier = 0x8004101b, + wbemErrPropagatedProperty = 0x8004101c, + wbemErrUnexpected = 0x8004101d, + wbemErrIllegalOperation = 0x8004101e, + wbemErrCannotBeKey = 0x8004101f, + wbemErrIncompleteClass = 0x80041020, + wbemErrInvalidSyntax = 0x80041021, + wbemErrNondecoratedObject = 0x80041022, + wbemErrReadOnly = 0x80041023, + wbemErrProviderNotCapable = 0x80041024, + wbemErrClassHasChildren = 0x80041025, + wbemErrClassHasInstances = 0x80041026, + wbemErrQueryNotImplemented = 0x80041027, + wbemErrIllegalNull = 0x80041028, + wbemErrInvalidQualifierType = 0x80041029, + wbemErrInvalidPropertyType = 0x8004102a, + wbemErrValueOutOfRange = 0x8004102b, + wbemErrCannotBeSingleton = 0x8004102c, + wbemErrInvalidCimType = 0x8004102d, + wbemErrInvalidMethod = 0x8004102e, + wbemErrInvalidMethodParameters = 0x8004102f, + wbemErrSystemProperty = 0x80041030, + wbemErrInvalidProperty = 0x80041031, + wbemErrCallCancelled = 0x80041032, + wbemErrShuttingDown = 0x80041033, + wbemErrPropagatedMethod = 0x80041034, + wbemErrUnsupportedParameter = 0x80041035, + wbemErrMissingParameter = 0x80041036, + wbemErrInvalidParameterId = 0x80041037, + wbemErrNonConsecutiveParameterIds = 0x80041038, + wbemErrParameterIdOnRetval = 0x80041039, + wbemErrInvalidObjectPath = 0x8004103a, + wbemErrOutOfDiskSpace = 0x8004103b, + wbemErrBufferTooSmall = 0x8004103c, + wbemErrUnsupportedPutExtension = 0x8004103d, + wbemErrUnknownObjectType = 0x8004103e, + wbemErrUnknownPacketType = 0x8004103f, + wbemErrMarshalVersionMismatch = 0x80041040, + wbemErrMarshalInvalidSignature = 0x80041041, + wbemErrInvalidQualifier = 0x80041042, + wbemErrInvalidDuplicateParameter = 0x80041043, + wbemErrTooMuchData = 0x80041044, + wbemErrServerTooBusy = 0x80041045, + wbemErrInvalidFlavor = 0x80041046, + wbemErrCircularReference = 0x80041047, + wbemErrUnsupportedClassUpdate = 0x80041048, + wbemErrCannotChangeKeyInheritance = 0x80041049, + wbemErrCannotChangeIndexInheritance = 0x80041050, + wbemErrTooManyProperties = 0x80041051, + wbemErrUpdateTypeMismatch = 0x80041052, + wbemErrUpdateOverrideNotAllowed = 0x80041053, + wbemErrUpdatePropagatedMethod = 0x80041054, + wbemErrMethodNotImplemented = 0x80041055, + wbemErrMethodDisabled = 0x80041056, + wbemErrRefresherBusy = 0x80041057, + wbemErrUnparsableQuery = 0x80041058, + wbemErrNotEventClass = 0x80041059, + wbemErrMissingGroupWithin = 0x8004105a, + wbemErrMissingAggregationList = 0x8004105b, + wbemErrPropertyNotAnObject = 0x8004105c, + wbemErrAggregatingByObject = 0x8004105d, + wbemErrUninterpretableProviderQuery = 0x8004105f, + wbemErrBackupRestoreWinmgmtRunning = 0x80041060, + wbemErrQueueOverflow = 0x80041061, + wbemErrPrivilegeNotHeld = 0x80041062, + wbemErrInvalidOperator = 0x80041063, + wbemErrLocalCredentials = 0x80041064, + wbemErrCannotBeAbstract = 0x80041065, + wbemErrAmendedObject = 0x80041066, + wbemErrClientTooSlow = 0x80041067, + wbemErrNullSecurityDescriptor = 0x80041068, + wbemErrTimeout = 0x80041069, + wbemErrInvalidAssociation = 0x8004106a, + wbemErrAmbiguousOperation = 0x8004106b, + wbemErrQuotaViolation = 0x8004106c, + wbemErrTransactionConflict = 0x8004106d, + wbemErrForcedRollback = 0x8004106e, + wbemErrUnsupportedLocale = 0x8004106f, + wbemErrHandleOutOfDate = 0x80041070, + wbemErrConnectionFailed = 0x80041071, + wbemErrInvalidHandleRequest = 0x80041072, + wbemErrPropertyNameTooWide = 0x80041073, + wbemErrClassNameTooWide = 0x80041074, + wbemErrMethodNameTooWide = 0x80041075, + wbemErrQualifierNameTooWide = 0x80041076, + wbemErrRerunCommand = 0x80041077, + wbemErrDatabaseVerMismatch = 0x80041078, + wbemErrVetoPut = 0x80041079, + wbemErrVetoDelete = 0x8004107a, + wbemErrInvalidLocale = 0x80041080, + wbemErrProviderSuspended = 0x80041081, + wbemErrSynchronizationRequired = 0x80041082, + wbemErrNoSchema = 0x80041083, + wbemErrProviderAlreadyRegistered = 0x80041084, + wbemErrProviderNotRegistered = 0x80041085, + wbemErrFatalTransportError = 0x80041086, + wbemErrEncryptedConnectionRequired = 0x80041087, + wbemErrRegistrationTooBroad = 0x80042001, + wbemErrRegistrationTooPrecise = 0x80042002, + wbemErrTimedout = 0x80043001, + wbemErrResetToDefault = 0x80043002, +}} +ENUM!{enum WbemAuthenticationLevelEnum { + wbemAuthenticationLevelDefault = 0, + wbemAuthenticationLevelNone = 1, + wbemAuthenticationLevelConnect = 2, + wbemAuthenticationLevelCall = 3, + wbemAuthenticationLevelPkt = 4, + wbemAuthenticationLevelPktIntegrity = 5, + wbemAuthenticationLevelPktPrivacy = 6, +}} +ENUM!{enum WbemImpersonationLevelEnum { + wbemImpersonationLevelAnonymous = 1, + wbemImpersonationLevelIdentify = 2, + wbemImpersonationLevelImpersonate = 3, + wbemImpersonationLevelDelegate = 4, +}} +ENUM!{enum WbemPrivilegeEnum { + wbemPrivilegeCreateToken = 1, + wbemPrivilegePrimaryToken = 2, + wbemPrivilegeLockMemory = 3, + wbemPrivilegeIncreaseQuota = 4, + wbemPrivilegeMachineAccount = 5, + wbemPrivilegeTcb = 6, + wbemPrivilegeSecurity = 7, + wbemPrivilegeTakeOwnership = 8, + wbemPrivilegeLoadDriver = 9, + wbemPrivilegeSystemProfile = 10, + wbemPrivilegeSystemtime = 11, + wbemPrivilegeProfileSingleProcess = 12, + wbemPrivilegeIncreaseBasePriority = 13, + wbemPrivilegeCreatePagefile = 14, + wbemPrivilegeCreatePermanent = 15, + wbemPrivilegeBackup = 16, + wbemPrivilegeRestore = 17, + wbemPrivilegeShutdown = 18, + wbemPrivilegeDebug = 19, + wbemPrivilegeAudit = 20, + wbemPrivilegeSystemEnvironment = 21, + wbemPrivilegeChangeNotify = 22, + wbemPrivilegeRemoteShutdown = 23, + wbemPrivilegeUndock = 24, + wbemPrivilegeSyncAgent = 25, + wbemPrivilegeEnableDelegation = 26, + wbemPrivilegeManageVolume = 27, +}} +ENUM!{enum WbemObjectTextFormatEnum { + wbemObjectTextFormatCIMDTD20 = 1, + wbemObjectTextFormatWMIDTD20 = 2, +}} +ENUM!{enum WbemConnectOptionsEnum { + wbemConnectFlagUseMaxWait = 0x80, +}} +// EXTERN_C const IID LIBID_WbemScripting; +// EXTERN_C const IID IID_ISWbemServices; +DEFINE_GUID!{IID_ISWbemServices, + 0x76a6415c, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x76a6415c, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemServices(ISWbemServicesVtbl): IDispatch(IDispatchVtbl) { + fn Get( + strObjectPath: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObject: *mut *mut ISWbemObject, + ) -> HRESULT, + fn GetAsync( + objWbemSink: *mut IDispatch, + strObjectPath: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn Delete( + strObjectPath: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + ) -> HRESULT, + fn DeleteAsync( + objWbemSink: *mut IDispatch, + strObjectPath: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn InstancesOf( + strClass: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectSet: *mut *mut ISWbemObjectSet, + ) -> HRESULT, + fn InstancesOfAsync( + objWbemSink: *mut IDispatch, + strClass: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn SubclassesOf( + strSuperclass: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectSet: *mut *mut ISWbemObjectSet, + ) -> HRESULT, + fn SubclassesOfAsync( + objWbemSink: *mut IDispatch, + strSuperclass: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn ExecQuery( + strQuery: BSTR, + strQueryLanguage: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectSet: *mut *mut ISWbemObjectSet, + ) -> HRESULT, + fn ExecQueryAsync( + objWbemSink: *mut IDispatch, + strQuery: BSTR, + strQueryLanguage: BSTR, + lFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn AssociatorsOf( + strObjectPath: BSTR, + strAssocClass: BSTR, + strResultClass: BSTR, + strResultRole: BSTR, + strRole: BSTR, + bClassesOnly: VARIANT_BOOL, + bSchemaOnly: VARIANT_BOOL, + strRequiredAssocQualifier: BSTR, + strRequiredQualifier: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectSet: *mut *mut ISWbemObjectSet, + ) -> HRESULT, + fn AssociatorsOfAsync( + objWbemSink: *mut IDispatch, + strObjectPath: BSTR, + strAssocClass: BSTR, + strResultClass: BSTR, + strResultRole: BSTR, + strRole: BSTR, + bClassesOnly: VARIANT_BOOL, + bSchemaOnly: VARIANT_BOOL, + strRequiredAssocQualifier: BSTR, + strRequiredQualifier: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn ReferencesTo( + strObjectPath: BSTR, + strResultClass: BSTR, + strRole: BSTR, + bClassesOnly: VARIANT_BOOL, + bSchemaOnly: VARIANT_BOOL, + strRequiredQualifier: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectSet: *mut *mut ISWbemObjectSet, + ) -> HRESULT, + fn ReferencesToAsync( + objWbemSink: *mut IDispatch, + strObjectPath: BSTR, + strResultClass: BSTR, + strRole: BSTR, + bClassesOnly: VARIANT_BOOL, + bSchemaOnly: VARIANT_BOOL, + strRequiredQualifier: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn ExecNotificationQuery( + strQuery: BSTR, + strQueryLanguage: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemEventSource: *mut *mut ISWbemEventSource, + ) -> HRESULT, + fn ExecNotificationQueryAsync( + objWbemSink: *mut IDispatch, + strQuery: BSTR, + strQueryLanguage: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn ExecMethod( + strObjectPath: BSTR, + strMethodName: BSTR, + objWbemInParameters: *mut IDispatch, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemOutParameters: *mut *mut ISWbemObject, + ) -> HRESULT, + fn ExecMethodAsync( + objWbemSink: *mut IDispatch, + strObjectPath: BSTR, + strMethodName: BSTR, + objWbemInParameters: *mut IDispatch, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn get_Security_( + objWbemSecurity: *mut *mut ISWbemSecurity, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemLocator; +DEFINE_GUID!{IID_ISWbemLocator, + 0x76a6415b, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x76a6415b, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemLocator(ISWbemLocatorVtbl): IDispatch(IDispatchVtbl) { + fn ConnectServer( + strServer: BSTR, + strNamespace: BSTR, + strUser: BSTR, + strPassword: BSTR, + strLocale: BSTR, + strAuthority: BSTR, + iSecurityFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemServices: *mut *mut ISWbemServices, + ) -> HRESULT, + fn get_Security_( + objWbemSecurity: *mut *mut ISWbemSecurity, + ) -> HRESULT, +}} +pub const WBEMS_DISPID_DERIVATION: DISPID = 23; +// EXTERN_C const IID IID_ISWbemObject; +DEFINE_GUID!{IID_ISWbemObject, + 0x76a6415a, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x76a6415a, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemObject(ISWbemObjectVtbl): IDispatch(IDispatchVtbl) { + fn Put_( + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectPath: *mut *mut ISWbemObjectPath, + ) -> HRESULT, + fn PutAsync_( + objWbemSink: *mut IDispatch, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn Delete_( + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + ) -> HRESULT, + fn DeleteAsync_( + objWbemSink: *mut IDispatch, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn Instances_( + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectSet: *mut *mut ISWbemObjectSet, + ) -> HRESULT, + fn InstancesAsync_( + objWbemSink: *mut IDispatch, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn Subclasses_( + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectSet: *mut *mut ISWbemObjectSet, + ) -> HRESULT, + fn SubclassesAsync_( + objWbemSink: *mut IDispatch, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn Associators_( + strAssocClass: BSTR, + strResultClass: BSTR, + strResultRole: BSTR, + strRole: BSTR, + bClassesOnly: VARIANT_BOOL, + bSchemaOnly: VARIANT_BOOL, + strRequiredAssocQualifier: BSTR, + strRequiredQualifier: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectSet: *mut *mut ISWbemObjectSet, + ) -> HRESULT, + fn AssociatorsAsync_( + objWbemSink: *mut IDispatch, + strAssocClass: BSTR, + strResultClass: BSTR, + strResultRole: BSTR, + strRole: BSTR, + bClassesOnly: VARIANT_BOOL, + bSchemaOnly: VARIANT_BOOL, + strRequiredAssocQualifier: BSTR, + strRequiredQualifier: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn References_( + strResultClass: BSTR, + strRole: BSTR, + bClassesOnly: VARIANT_BOOL, + bSchemaOnly: VARIANT_BOOL, + strRequiredQualifier: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectSet: *mut *mut ISWbemObjectSet, + ) -> HRESULT, + fn ReferencesAsync_( + objWbemSink: *mut IDispatch, + strResultClass: BSTR, + strRole: BSTR, + bClassesOnly: VARIANT_BOOL, + bSchemaOnly: VARIANT_BOOL, + strRequiredQualifier: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn ExecMethod_( + strMethodName: BSTR, + objWbemInParameters: *mut IDispatch, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemOutParameters: *mut *mut ISWbemObject, + ) -> HRESULT, + fn ExecMethodAsync_( + objWbemSink: *mut IDispatch, + strMethodName: BSTR, + objWbemInParameters: *mut IDispatch, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, + fn Clone_( + objWbemObject: *mut *mut ISWbemObject, + ) -> HRESULT, + fn GetObjectText_( + iFlags: c_long, + strObjectText: *mut BSTR, + ) -> HRESULT, + fn SpawnDerivedClass_( + iFlags: c_long, + objWbemObject: *mut *mut ISWbemObject, + ) -> HRESULT, + fn SpawnInstance_( + iFlags: c_long, + objWbemObject: *mut *mut ISWbemObject, + ) -> HRESULT, + fn CompareTo_( + objWbemObject: *mut IDispatch, + iFlags: c_long, + bResult: *mut VARIANT_BOOL, + ) -> HRESULT, + fn get_Qualifiers_( + objWbemQualifierSet: *mut *mut ISWbemQualifierSet, + ) -> HRESULT, + fn get_Properties_( + objWbemPropertySet: *mut *mut ISWbemPropertySet, + ) -> HRESULT, + fn get_Methods_( + objWbemMethodSet: *mut *mut ISWbemMethodSet, + ) -> HRESULT, + fn get_Derivation_( + strClassNameArray: *mut VARIANT, + ) -> HRESULT, + fn get_Path_( + objWbemObjectPath: *mut *mut ISWbemObjectPath, + ) -> HRESULT, + fn get_Security_( + objWbemSecurity: *mut *mut ISWbemSecurity, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemObjectSet; +DEFINE_GUID!{IID_ISWbemObjectSet, + 0x76a6415f, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x76a6415f, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemObjectSet(ISWbemObjectSetVtbl): IDispatch(IDispatchVtbl) { + fn get__NewEnum( + pUnk: *mut *mut IUnknown, + ) -> HRESULT, + fn Item( + strObjectPath: BSTR, + iFlags: c_long, + objWbemObject: *mut *mut ISWbemObject, + ) -> HRESULT, + fn get_Count( + iCount: *mut c_long, + ) -> HRESULT, + fn get_Security_( + objWbemSecurity: *mut *mut ISWbemSecurity, + ) -> HRESULT, + fn ItemIndex( + lIndex: c_long, + objWbemObject: *mut *mut ISWbemObject, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemNamedValue; +DEFINE_GUID!{IID_ISWbemNamedValue, + 0x76a64164, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x76a64164, 0xcb41, 0x11d1, 0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemNamedValue(ISWbemNamedValueVtbl): IDispatch(IDispatchVtbl) { + fn get_Value( + varValue: *mut VARIANT, + ) -> HRESULT, + fn put_Value( + varValue: *mut VARIANT, + ) -> HRESULT, + fn get_Name( + strName: *mut BSTR, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemNamedValueSet; +DEFINE_GUID!{IID_ISWbemNamedValueSet, + 0xcf2376ea, 0xce8c, 0x11d1, 0x8b, 0x05, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0xcf2376ea, 0xce8c, 0x11d1, 0x8b, 0x05, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemNamedValueSet(ISWbemNamedValueSetVtbl): IDispatch(IDispatchVtbl) { + fn get__NewEnum( + pUnk: *mut *mut IUnknown, + ) -> HRESULT, + fn Item( + strName: BSTR, + iFlags: c_long, + objWbemNamedValue: *mut *mut ISWbemNamedValue, + ) -> HRESULT, + fn get_Count( + iCount: *mut c_long, + ) -> HRESULT, + fn Add( + strName: BSTR, + varValue: *mut VARIANT, + iFlags: c_long, + objWbemNamedValue: *mut *mut ISWbemNamedValue, + ) -> HRESULT, + fn Remove( + strName: BSTR, + iFlags: c_long, + ) -> HRESULT, + fn Clone( + objWbemNamedValueSet: *mut *mut ISWbemNamedValueSet, + ) -> HRESULT, + fn DeleteAll() -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemQualifier; +DEFINE_GUID!{IID_ISWbemQualifier, + 0x79b05932, 0xd3b7, 0x11d1, 0x8b, 0x06, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x79b05932, 0xd3b7, 0x11d1, 0x8b, 0x06, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemQualifier(ISWbemQualifierVtbl): IDispatch(IDispatchVtbl) { + fn get_Value( + varValue: *mut VARIANT, + ) -> HRESULT, + fn put_Value( + varValue: *mut VARIANT, + ) -> HRESULT, + fn get_Name( + strName: *mut BSTR, + ) -> HRESULT, + fn get_IsLocal( + bIsLocal: *mut VARIANT_BOOL, + ) -> HRESULT, + fn get_PropagatesToSubclass( + bPropagatesToSubclass: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_PropagatesToSubclass( + bPropagatesToSubclass: VARIANT_BOOL, + ) -> HRESULT, + fn get_PropagatesToInstance( + bPropagatesToInstance: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_PropagatesToInstance( + bPropagatesToInstance: VARIANT_BOOL, + ) -> HRESULT, + fn get_IsOverridable( + bIsOverridable: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_IsOverridable( + bIsOverridable: VARIANT_BOOL, + ) -> HRESULT, + fn get_IsAmended( + bIsAmended: *mut VARIANT_BOOL, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemQualifierSet; +DEFINE_GUID!{IID_ISWbemQualifierSet, + 0x9b16ed16, 0xd3df, 0x11d1, 0x8b, 0x08, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x9b16ed16, 0xd3df, 0x11d1, 0x8b, 0x08, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemQualifierSet(ISWbemQualifierSetVtbl): IDispatch(IDispatchVtbl) { + fn get__NewEnum( + pUnk: *mut *mut IUnknown, + ) -> HRESULT, + fn Item( + name: BSTR, + iFlags: c_long, + objWbemQualifier: *mut *mut ISWbemQualifier, + ) -> HRESULT, + fn get_Count( + iCount: *mut c_long, + ) -> HRESULT, + fn Add( + strName: BSTR, + varVal: *mut VARIANT, + bPropagatesToSubclass: VARIANT_BOOL, + bPropagatesToInstance: VARIANT_BOOL, + bIsOverridable: VARIANT_BOOL, + iFlags: c_long, + objWbemQualifier: *mut *mut ISWbemQualifier, + ) -> HRESULT, + fn Remove( + strName: BSTR, + iFlags: c_long, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemProperty; +DEFINE_GUID!{IID_ISWbemProperty, + 0x1a388f98, 0xd4ba, 0x11d1, 0x8b, 0x09, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x1a388f98, 0xd4ba, 0x11d1, 0x8b, 0x09, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemProperty(ISWbemPropertyVtbl): IDispatch(IDispatchVtbl) { + fn get_Value( + varValue: *mut VARIANT, + ) -> HRESULT, + fn put_Value( + varValue: *mut VARIANT, + ) -> HRESULT, + fn get_Name( + strName: *mut BSTR, + ) -> HRESULT, + fn get_IsLocal( + bIsLocal: *mut VARIANT_BOOL, + ) -> HRESULT, + fn get_Origin( + strOrigin: *mut BSTR, + ) -> HRESULT, + fn get_CIMType( + iCimType: *mut WbemCimtypeEnum, + ) -> HRESULT, + fn get_Qualifiers_( + objWbemQualifierSet: *mut *mut ISWbemQualifierSet, + ) -> HRESULT, + fn get_IsArray( + bIsArray: *mut VARIANT_BOOL, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemPropertySet; +DEFINE_GUID!{IID_ISWbemPropertySet, + 0xdea0a7b2, 0xd4ba, 0x11d1, 0x8b, 0x09, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0xdea0a7b2, 0xd4ba, 0x11d1, 0x8b, 0x09, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemPropertySet(ISWbemPropertySetVtbl): IDispatch(IDispatchVtbl) { + fn get__NewEnum( + pUnk: *mut *mut IUnknown, + ) -> HRESULT, + fn Item( + strName: BSTR, + iFlags: c_long, + objWbemProperty: *mut *mut ISWbemProperty, + ) -> HRESULT, + fn get_Count( + iCount: *mut c_long, + ) -> HRESULT, + fn Add( + strName: BSTR, + iCIMType: WbemCimtypeEnum, + bIsArray: VARIANT_BOOL, + iFlags: c_long, + objWbemProperty: *mut *mut ISWbemProperty, + ) -> HRESULT, + fn Remove( + strName: BSTR, + iFlags: c_long, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemMethod; +DEFINE_GUID!{IID_ISWbemMethod, + 0x422e8e90, 0xd955, 0x11d1, 0x8b, 0x09, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x422e8e90, 0xd955, 0x11d1, 0x8b, 0x09, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemMethod(ISWbemMethodVtbl): IDispatch(IDispatchVtbl) { + fn get_Name( + strName: *mut BSTR, + ) -> HRESULT, + fn get_Origin( + strOrigin: *mut BSTR, + ) -> HRESULT, + fn get_InParameters( + objWbemInParameters: *mut *mut ISWbemObject, + ) -> HRESULT, + fn get_OutParameters( + objWbemOutParameters: *mut *mut ISWbemObject, + ) -> HRESULT, + fn get_Qualifiers_( + objWbemQualifierSet: *mut *mut ISWbemQualifierSet, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemMethodSet; +DEFINE_GUID!{IID_ISWbemMethodSet, + 0xc93ba292, 0xd955, 0x11d1, 0x8b, 0x09, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0xc93ba292, 0xd955, 0x11d1, 0x8b, 0x09, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemMethodSet(ISWbemMethodSetVtbl): IDispatch(IDispatchVtbl) { + fn get__NewEnum( + pUnk: *mut *mut IUnknown, + ) -> HRESULT, + fn Item( + strName: BSTR, + iFlags: c_long, + objWbemMethod: *mut *mut ISWbemMethod, + ) -> HRESULT, + fn get_Count( + iCount: *mut c_long, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemEventSource; +DEFINE_GUID!{IID_ISWbemEventSource, + 0x27d54d92, 0x0ebe, 0x11d2, 0x8b, 0x22, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x27d54d92, 0x0ebe, 0x11d2, 0x8b, 0x22, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemEventSource(ISWbemEventSourceVtbl): IDispatch(IDispatchVtbl) { + fn NextEvent( + iTimeoutMs: c_long, + objWbemObject: *mut *mut ISWbemObject, + ) -> HRESULT, + fn get_Security_( + objWbemSecurity: *mut *mut ISWbemSecurity, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemObjectPath; +DEFINE_GUID!{IID_ISWbemObjectPath, + 0x5791bc27, 0xce9c, 0x11d1, 0x97, 0xbf, 0x00, 0x00, 0xf8, 0x1e, 0x84, 0x9c} +RIDL!{#[uuid(0x5791bc27, 0xce9c, 0x11d1, 0x97, 0xbf, 0x00, 0x00, 0xf8, 0x1e, 0x84, 0x9c)] +interface ISWbemObjectPath(ISWbemObjectPathVtbl): IDispatch(IDispatchVtbl) { + fn get_Path( + strPath: *mut BSTR, + ) -> HRESULT, + fn put_Path( + strPath: BSTR, + ) -> HRESULT, + fn get_RelPath( + strRelPath: *mut BSTR, + ) -> HRESULT, + fn put_RelPath( + strRelPath: BSTR, + ) -> HRESULT, + fn get_Server( + strServer: *mut BSTR, + ) -> HRESULT, + fn put_Server( + strServer: BSTR, + ) -> HRESULT, + fn get_Namespace( + strNamespace: *mut BSTR, + ) -> HRESULT, + fn put_Namespace( + strNamespace: BSTR, + ) -> HRESULT, + fn get_ParentNamespace( + strParentNamespace: *mut BSTR, + ) -> HRESULT, + fn get_DisplayName( + strDisplayName: *mut BSTR, + ) -> HRESULT, + fn put_DisplayName( + strDisplayName: BSTR, + ) -> HRESULT, + fn get_Class( + strClass: *mut BSTR, + ) -> HRESULT, + fn put_Class( + strClass: BSTR, + ) -> HRESULT, + fn get_IsClass( + bIsClass: *mut VARIANT_BOOL, + ) -> HRESULT, + fn SetAsClass() -> HRESULT, + fn get_IsSingleton( + bIsSingleton: *mut VARIANT_BOOL, + ) -> HRESULT, + fn SetAsSingleton() -> HRESULT, + fn get_Keys( + objWbemNamedValueSet: *mut *mut ISWbemNamedValueSet, + ) -> HRESULT, + fn get_Security_( + objWbemSecurity: *mut *mut ISWbemSecurity, + ) -> HRESULT, + fn get_Locale( + strLocale: *mut BSTR, + ) -> HRESULT, + fn put_Locale( + strLocale: BSTR, + ) -> HRESULT, + fn get_Authority( + strAuthority: *mut BSTR, + ) -> HRESULT, + fn put_Authority( + strAuthority: BSTR, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemLastError; +DEFINE_GUID!{IID_ISWbemLastError, + 0xd962db84, 0xd4bb, 0x11d1, 0x8b, 0x09, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0xd962db84, 0xd4bb, 0x11d1, 0x8b, 0x09, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemLastError(ISWbemLastErrorVtbl): ISWbemObject(ISWbemObjectVtbl) {}} +// EXTERN_C const IID DIID_ISWbemSinkEvents; +DEFINE_GUID!{IID_ISWbemSinkEvents, + 0x75718ca0, 0xf029, 0x11d1, 0xa1, 0xac, 0x00, 0xc0, 0x4f, 0xb6, 0xc2, 0x23} +RIDL!{#[uuid(0x75718ca0, 0xf029, 0x11d1, 0xa1, 0xac, 0x00, 0xc0, 0x4f, 0xb6, 0xc2, 0x23)] +interface ISWbemSinkEvents(ISWbemSinkEventsVtbl): IDispatch(IDispatchVtbl) {}} +// EXTERN_C const IID IID_ISWbemSink; +DEFINE_GUID!{IID_ISWbemSink, + 0x75718c9f, 0xf029, 0x11d1, 0xa1, 0xac, 0x00, 0xc0, 0x4f, 0xb6, 0xc2, 0x23} +RIDL!{#[uuid(0x75718c9f, 0xf029, 0x11d1, 0xa1, 0xac, 0x00, 0xc0, 0x4f, 0xb6, 0xc2, 0x23)] +interface ISWbemSink(ISWbemSinkVtbl): IDispatch(IDispatchVtbl) { + fn Cancel() -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemSecurity; +DEFINE_GUID!{IID_ISWbemSecurity, + 0xb54d66e6, 0x2287, 0x11d2, 0x8b, 0x33, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0xb54d66e6, 0x2287, 0x11d2, 0x8b, 0x33, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemSecurity(ISWbemSecurityVtbl): IDispatch(IDispatchVtbl) { + fn get_ImpersonationLevel( + iImpersonationLevel: *mut WbemImpersonationLevelEnum, + ) -> HRESULT, + fn put_ImpersonationLevel( + iImpersonationLevel: WbemImpersonationLevelEnum, + ) -> HRESULT, + fn get_AuthenticationLevel( + iAuthenticationLevel: *mut WbemAuthenticationLevelEnum, + ) -> HRESULT, + fn put_AuthenticationLevel( + iAuthenticationLevel: WbemAuthenticationLevelEnum, + ) -> HRESULT, + fn get_Privileges( + objWbemPrivilegeSet: *mut *mut ISWbemPrivilegeSet, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemPrivilege; +DEFINE_GUID!{IID_ISWbemPrivilege, + 0x26ee67bd, 0x5804, 0x11d2, 0x8b, 0x4a, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x26ee67bd, 0x5804, 0x11d2, 0x8b, 0x4a, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemPrivilege(ISWbemPrivilegeVtbl): IDispatch(IDispatchVtbl) { + fn get_IsEnabled( + bIsEnabled: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_IsEnabled( + bIsEnabled: VARIANT_BOOL, + ) -> HRESULT, + fn get_Name( + strDisplayName: *mut BSTR, + ) -> HRESULT, + fn get_DisplayName( + strDisplayName: *mut BSTR, + ) -> HRESULT, + fn get_Identifier( + iPrivilege: *mut WbemPrivilegeEnum, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemPrivilegeSet; +DEFINE_GUID!{IID_ISWbemPrivilegeSet, + 0x26ee67bf, 0x5804, 0x11d2, 0x8b, 0x4a, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6} +RIDL!{#[uuid(0x26ee67bf, 0x5804, 0x11d2, 0x8b, 0x4a, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6)] +interface ISWbemPrivilegeSet(ISWbemPrivilegeSetVtbl): IDispatch(IDispatchVtbl) { + fn get__NewEnum( + pUnk: *mut *mut IUnknown, + ) -> HRESULT, + fn Item( + iPrivilege: WbemPrivilegeEnum, + objWbemPrivilege: *mut *mut ISWbemPrivilege, + ) -> HRESULT, + fn get_Count( + iCount: *mut c_long, + ) -> HRESULT, + fn Add( + iPrivilege: WbemPrivilegeEnum, + bIsEnabled: VARIANT_BOOL, + objWbemPrivilege: *mut *mut ISWbemPrivilege, + ) -> HRESULT, + fn Remove( + iPrivilege: WbemPrivilegeEnum, + ) -> HRESULT, + fn DeleteAll() -> HRESULT, + fn AddAsString( + strPrivilege: BSTR, + bIsEnabled: VARIANT_BOOL, + objWbemPrivilege: *mut *mut ISWbemPrivilege, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemServicesEx; +DEFINE_GUID!{IID_ISWbemServicesEx, + 0xd2f68443, 0x85dc, 0x427e, 0x91, 0xd8, 0x36, 0x65, 0x54, 0xcc, 0x75, 0x4c} +RIDL!{#[uuid(0xd2f68443, 0x85dc, 0x427e, 0x91, 0xd8, 0x36, 0x65, 0x54, 0xcc, 0x75, 0x4c)] +interface ISWbemServicesEx(ISWbemServicesExVtbl): ISWbemServices(ISWbemServicesVtbl) { + fn Put( + objWbemObject: *mut ISWbemObjectEx, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemObjectPath: *mut *mut ISWbemObjectPath, + ) -> HRESULT, + fn PutAsync( + objWbemSink: *mut ISWbemSink, + objWbemObject: *mut ISWbemObjectEx, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemAsyncContext: *mut IDispatch, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemObjectEx; +DEFINE_GUID!{IID_ISWbemObjectEx, + 0x269ad56a, 0x8a67, 0x4129, 0xbc, 0x8c, 0x05, 0x06, 0xdc, 0xfe, 0x98, 0x80} +RIDL!{#[uuid(0x269ad56a, 0x8a67, 0x4129, 0xbc, 0x8c, 0x05, 0x06, 0xdc, 0xfe, 0x98, 0x80)] +interface ISWbemObjectEx(ISWbemObjectExVtbl): ISWbemObject(ISWbemObjectVtbl) { + fn Refresh_( + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + ) -> HRESULT, + fn get_SystemProperties_( + objWbemPropertySet: *mut *mut ISWbemPropertySet, + ) -> HRESULT, + fn GetText_( + iObjectTextFormat: WbemObjectTextFormatEnum, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + bsText: *mut BSTR, + ) -> HRESULT, + fn SetFromText_( + bsText: BSTR, + iObjectTextFormat: WbemObjectTextFormatEnum, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemDateTime; +DEFINE_GUID!{IID_ISWbemDateTime, + 0x5e97458a, 0xcf77, 0x11d3, 0xb3, 0x8f, 0x00, 0x10, 0x5a, 0x1f, 0x47, 0x3a} +RIDL!{#[uuid(0x5e97458a, 0xcf77, 0x11d3, 0xb3, 0x8f, 0x00, 0x10, 0x5a, 0x1f, 0x47, 0x3a)] +interface ISWbemDateTime(ISWbemDateTimeVtbl): IDispatch(IDispatchVtbl) { + fn get_Value( + strValue: *mut BSTR, + ) -> HRESULT, + fn put_Value( + strValue: BSTR, + ) -> HRESULT, + fn get_Year( + iYear: *mut c_long, + ) -> HRESULT, + fn put_Year( + iYear: c_long, + ) -> HRESULT, + fn get_YearSpecified( + bYearSpecified: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_YearSpecified( + bYearSpecified: VARIANT_BOOL, + ) -> HRESULT, + fn get_Month( + iMonth: *mut c_long, + ) -> HRESULT, + fn put_Month( + iMonth: c_long, + ) -> HRESULT, + fn get_MonthSpecified( + bMonthSpecified: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_MonthSpecified( + bMonthSpecified: VARIANT_BOOL, + ) -> HRESULT, + fn get_Day( + iDay: *mut c_long, + ) -> HRESULT, + fn put_Day( + iDay: c_long, + ) -> HRESULT, + fn get_DaySpecified( + bDaySpecified: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_DaySpecified( + bDaySpecified: VARIANT_BOOL, + ) -> HRESULT, + fn get_Hours( + iHours: *mut c_long, + ) -> HRESULT, + fn put_Hours( + iHours: c_long, + ) -> HRESULT, + fn get_HoursSpecified( + bHoursSpecified: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_HoursSpecified( + bHoursSpecified: VARIANT_BOOL, + ) -> HRESULT, + fn get_Minutes( + iMinutes: *mut c_long, + ) -> HRESULT, + fn put_Minutes( + iMinutes: c_long, + ) -> HRESULT, + fn get_MinutesSpecified( + bMinutesSpecified: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_MinutesSpecified( + bMinutesSpecified: VARIANT_BOOL, + ) -> HRESULT, + fn get_Seconds( + iSeconds: *mut c_long, + ) -> HRESULT, + fn put_Seconds( + iSeconds: c_long, + ) -> HRESULT, + fn get_SecondsSpecified( + bSecondsSpecified: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_SecondsSpecified( + bSecondsSpecified: VARIANT_BOOL, + ) -> HRESULT, + fn get_Microseconds( + iMicroseconds: *mut c_long, + ) -> HRESULT, + fn put_Microseconds( + iMicroseconds: c_long, + ) -> HRESULT, + fn get_MicrosecondsSpecified( + bMicrosecondsSpecified: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_MicrosecondsSpecified( + bMicrosecondsSpecified: VARIANT_BOOL, + ) -> HRESULT, + fn get_UTC( + iUTC: *mut c_long, + ) -> HRESULT, + fn put_UTC( + iUTC: c_long, + ) -> HRESULT, + fn get_UTCSpecified( + bUTCSpecified: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_UTCSpecified( + bUTCSpecified: VARIANT_BOOL, + ) -> HRESULT, + fn get_IsInterval( + bIsInterval: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_IsInterval( + bIsInterval: VARIANT_BOOL, + ) -> HRESULT, + fn GetVarDate( + bIsLocal: VARIANT_BOOL, + dVarDate: *mut DATE, + ) -> HRESULT, + fn SetVarDate( + dVarDate: DATE, + bIsLocal: VARIANT_BOOL, + ) -> HRESULT, + fn GetFileTime( + bIsLocal: VARIANT_BOOL, + strFileTime: *mut BSTR, + ) -> HRESULT, + fn SetFileTime( + strFileTime: BSTR, + bIsLocal: VARIANT_BOOL, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemRefresher; +DEFINE_GUID!{IID_ISWbemRefresher, + 0x14d8250e, 0xd9c2, 0x11d3, 0xb3, 0x8f, 0x00, 0x10, 0x5a, 0x1f, 0x47, 0x3a} +RIDL!{#[uuid(0x14d8250e, 0xd9c2, 0x11d3, 0xb3, 0x8f, 0x00, 0x10, 0x5a, 0x1f, 0x47, 0x3a)] +interface ISWbemRefresher(ISWbemRefresherVtbl): IDispatch(IDispatchVtbl) { + fn get__NewEnum( + pUnk: *mut *mut IUnknown, + ) -> HRESULT, + fn Item( + iIndex: c_long, + objWbemRefreshableItem: *mut *mut ISWbemRefreshableItem, + ) -> HRESULT, + fn get_Count( + iCount: *mut c_long, + ) -> HRESULT, + fn Add( + objWbemServices: *mut ISWbemServicesEx, + bsInstancePath: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemRefreshableItem: *mut *mut ISWbemRefreshableItem, + ) -> HRESULT, + fn AddEnum( + objWbemServices: *mut ISWbemServicesEx, + bsClassName: BSTR, + iFlags: c_long, + objWbemNamedValueSet: *mut IDispatch, + objWbemRefreshableItem: *mut *mut ISWbemRefreshableItem, + ) -> HRESULT, + fn Remove( + iIndex: c_long, + iFlags: c_long, + ) -> HRESULT, + fn Refresh( + iFlags: c_long, + ) -> HRESULT, + fn get_AutoReconnect( + bCount: *mut VARIANT_BOOL, + ) -> HRESULT, + fn put_AutoReconnect( + bCount: VARIANT_BOOL, + ) -> HRESULT, + fn DeleteAll() -> HRESULT, +}} +// EXTERN_C const IID IID_ISWbemRefreshableItem; +DEFINE_GUID!{IID_ISWbemRefreshableItem, + 0x5ad4bf92, 0xdaab, 0x11d3, 0xb3, 0x8f, 0x00, 0x10, 0x5a, 0x1f, 0x47, 0x3a} +RIDL!{#[uuid(0x5ad4bf92, 0xdaab, 0x11d3, 0xb3, 0x8f, 0x00, 0x10, 0x5a, 0x1f, 0x47, 0x3a)] +interface ISWbemRefreshableItem(ISWbemRefreshableItemVtbl): IDispatch(IDispatchVtbl) { + fn get_Index( + iIndex: *mut c_long, + ) -> HRESULT, + fn get_Refresher( + objWbemRefresher: *mut *mut ISWbemRefresher, + ) -> HRESULT, + fn get_IsSet( + bIsSet: *mut VARIANT_BOOL, + ) -> HRESULT, + fn get_Object( + objWbemObject: *mut *mut ISWbemObjectEx, + ) -> HRESULT, + fn get_ObjectSet( + objWbemObjectSet: *mut *mut ISWbemObjectSet, + ) -> HRESULT, + fn Remove( + iFlags: c_long, + ) -> HRESULT, +}} +DEFINE_GUID!{CLSID_SWbemLocator, + 0x76A64158, 0xCB41, 0x11d1, 0x8B, 0x02, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("76A64158-CB41-11d1-8B02-00600806D9B6") +// SWbemLocator; +DEFINE_GUID!{CLSID_SWbemNamedValueSet, + 0x9AED384E, 0xCE8B, 0x11d1, 0x8B, 0x05, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("9AED384E-CE8B-11d1-8B05-00600806D9B6") +// SWbemNamedValueSet; +DEFINE_GUID!{CLSID_SWbemObjectPath, + 0x5791BC26, 0xCE9C, 0x11d1, 0x97, 0xBF, 0x00, 0x00, 0xF8, 0x1E, 0x84, 0x9C} +// class DECLSPEC_UUID("5791BC26-CE9C-11d1-97BF-0000F81E849C") +// SWbemObjectPath; +DEFINE_GUID!{CLSID_SWbemLastError, + 0xC2FEEEAC, 0xCFCD, 0x11d1, 0x8B, 0x05, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("C2FEEEAC-CFCD-11d1-8B05-00600806D9B6") +// SWbemLastError; +DEFINE_GUID!{CLSID_SWbemSink, + 0x75718C9A, 0xF029, 0x11d1, 0xA1, 0xAC, 0x00, 0xC0, 0x4F, 0xB6, 0xC2, 0x23} +// class DECLSPEC_UUID("75718C9A-F029-11d1-A1AC-00C04FB6C223") +// SWbemSink; +DEFINE_GUID!{CLSID_SWbemDateTime, + 0x47DFBE54, 0xCF76, 0x11d3, 0xB3, 0x8F, 0x00, 0x10, 0x5A, 0x1F, 0x47, 0x3A} +// class DECLSPEC_UUID("47DFBE54-CF76-11d3-B38F-00105A1F473A") +// SWbemDateTime; +DEFINE_GUID!{CLSID_SWbemRefresher, + 0xD269BF5C, 0xD9C1, 0x11d3, 0xB3, 0x8F, 0x00, 0x10, 0x5A, 0x1F, 0x47, 0x3A} +// class DECLSPEC_UUID("D269BF5C-D9C1-11d3-B38F-00105A1F473A") +// SWbemRefresher; +DEFINE_GUID!{CLSID_SWbemServices, + 0x04B83D63, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D63-21AE-11d2-8B33-00600806D9B6") +// SWbemServices; +DEFINE_GUID!{CLSID_SWbemServicesEx, + 0x62E522DC, 0x8CF3, 0x40a8, 0x8B, 0x2E, 0x37, 0xD5, 0x95, 0x65, 0x1E, 0x40} +// class DECLSPEC_UUID("62E522DC-8CF3-40a8-8B2E-37D595651E40") +// SWbemServicesEx; +DEFINE_GUID!{CLSID_SWbemObject, + 0x04B83D62, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D62-21AE-11d2-8B33-00600806D9B6") +// SWbemObject; +DEFINE_GUID!{CLSID_SWbemObjectEx, + 0xD6BDAFB2, 0x9435, 0x491f, 0xBB, 0x87, 0x6A, 0xA0, 0xF0, 0xBC, 0x31, 0xA2} +// class DECLSPEC_UUID("D6BDAFB2-9435-491f-BB87-6AA0F0BC31A2") +// SWbemObjectEx; +DEFINE_GUID!{CLSID_SWbemObjectSet, + 0x04B83D61, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D61-21AE-11d2-8B33-00600806D9B6") +// SWbemObjectSet; +DEFINE_GUID!{CLSID_SWbemNamedValue, + 0x04B83D60, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D60-21AE-11d2-8B33-00600806D9B6") +// SWbemNamedValue; +DEFINE_GUID!{CLSID_SWbemQualifier, + 0x04B83D5F, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D5F-21AE-11d2-8B33-00600806D9B6") +// SWbemQualifier; +DEFINE_GUID!{CLSID_SWbemQualifierSet, + 0x04B83D5E, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D5E-21AE-11d2-8B33-00600806D9B6") +// SWbemQualifierSet; +DEFINE_GUID!{CLSID_SWbemProperty, + 0x04B83D5D, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D5D-21AE-11d2-8B33-00600806D9B6") +// SWbemProperty; +DEFINE_GUID!{CLSID_SWbemPropertySet, + 0x04B83D5C, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D5C-21AE-11d2-8B33-00600806D9B6") +// SWbemPropertySet; +DEFINE_GUID!{CLSID_SWbemMethod, + 0x04B83D5B, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D5B-21AE-11d2-8B33-00600806D9B6") +// SWbemMethod; +DEFINE_GUID!{CLSID_SWbemMethodSet, + 0x04B83D5A, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D5A-21AE-11d2-8B33-00600806D9B6") +// SWbemMethodSet; +DEFINE_GUID!{CLSID_SWbemEventSource, + 0x04B83D58, 0x21AE, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("04B83D58-21AE-11d2-8B33-00600806D9B6") +// SWbemEventSource; +DEFINE_GUID!{CLSID_SWbemSecurity, + 0xB54D66E9, 0x2287, 0x11d2, 0x8B, 0x33, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("B54D66E9-2287-11d2-8B33-00600806D9B6") +// SWbemSecurity; +DEFINE_GUID!{CLSID_SWbemPrivilege, + 0x26EE67BC, 0x5804, 0x11d2, 0x8B, 0x4A, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("26EE67BC-5804-11d2-8B4A-00600806D9B6") +// SWbemPrivilege; +DEFINE_GUID!{CLSID_SWbemPrivilegeSet, + 0x26EE67BE, 0x5804, 0x11d2, 0x8B, 0x4A, 0x00, 0x60, 0x08, 0x06, 0xD9, 0xB6} +// class DECLSPEC_UUID("26EE67BE-5804-11d2-8B4A-00600806D9B6") +// SWbemPrivilegeSet; +DEFINE_GUID!{CLSID_SWbemRefreshableItem, + 0x8C6854BC, 0xDE4B, 0x11d3, 0xB3, 0x90, 0x00, 0x10, 0x5A, 0x1F, 0x47, 0x3A} +// class DECLSPEC_UUID("8C6854BC-DE4B-11d3-B390-00105A1F473A") +// SWbemRefreshableItem; +pub const WBEMS_DISPID_OBJECT_READY: DISPID = 1; +pub const WBEMS_DISPID_COMPLETED: DISPID = 2; +pub const WBEMS_DISPID_PROGRESS: DISPID = 3; +pub const WBEMS_DISPID_OBJECT_PUT: DISPID = 4; +pub const WBEMS_DISPID_CONNECTION_READY: DISPID = 5; +// extern RPC_IF_HANDLE __MIDL_itf_wbemdisp_0000_0018_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemdisp_0000_0018_v0_0_s_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemdisp_0000_0026_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemdisp_0000_0026_v0_0_s_ifspec; diff --git a/bash-5.1/vendor/winapi/src/um/wbemprov.rs b/bash-5.1/vendor/winapi/src/um/wbemprov.rs new file mode 100644 index 0000000000000000000000000000000000000000..4ba60eedc363283f6cadbacb593973839fdecf07 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wbemprov.rs @@ -0,0 +1,302 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_long, c_ulong}; +use shared::minwindef::{BYTE, DWORD}; +use shared::winerror::HRESULT; +use shared::wtypes::BSTR; +use um::oaidl::{VARIANT}; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::wbemcli::{ + IWbemClassObject, IWbemContext, IWbemHiPerfEnum, IWbemObjectAccess, IWbemObjectSink, + IWbemObjectSinkVtbl, IWbemRefresher, IWbemServices +}; +use um::winnt::{LONG, LPCWSTR, LPWSTR, WCHAR}; +pub type WBEM_VARIANT = VARIANT; +pub type WBEM_WSTR = LPWSTR; +pub type WBEM_CWSTR = LPCWSTR; +ENUM!{enum WBEM_PROVIDER_REQUIREMENTS_TYPE { + WBEM_REQUIREMENTS_START_POSTFILTER = 0, + WBEM_REQUIREMENTS_STOP_POSTFILTER = 1, + WBEM_REQUIREMENTS_RECHECK_SUBSCRIPTIONS = 2, +}} +// extern RPC_IF_HANDLE __MIDL_itf_wbemprov_0000_0000_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemprov_0000_0000_v0_0_s_ifspec; +// EXTERN_C const IID LIBID_WbemProviders_v1; +// EXTERN_C const IID IID_IWbemPropertyProvider; +DEFINE_GUID!{IID_IWbemPropertyProvider, + 0xce61e841, 0x65bc, 0x11d0, 0xb6, 0xbd, 0x00, 0xaa, 0x00, 0x32, 0x40, 0xc7} +RIDL!{#[uuid(0xce61e841, 0x65bc, 0x11d0, 0xb6, 0xbd, 0x00, 0xaa, 0x00, 0x32, 0x40, 0xc7)] +interface IWbemPropertyProvider(IWbemPropertyProviderVtbl): IUnknown(IUnknownVtbl) { + fn GetProperty( + lFlags: c_long, + strLocale: BSTR, + strClassMapping: BSTR, + strInstMapping: BSTR, + strPropMapping: BSTR, + pvValue: *mut VARIANT, + ) -> HRESULT, + fn PutProperty( + lFlags: c_long, + strLocale: BSTR, + strClassMapping: BSTR, + strInstMapping: BSTR, + strPropMapping: BSTR, + pvValue: *const VARIANT, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemUnboundObjectSink; +DEFINE_GUID!{IID_IWbemUnboundObjectSink, + 0xe246107b, 0xb06e, 0x11d0, 0xad, 0x61, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +RIDL!{#[uuid(0xe246107b, 0xb06e, 0x11d0, 0xad, 0x61, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff)] +interface IWbemUnboundObjectSink(IWbemUnboundObjectSinkVtbl): IUnknown(IUnknownVtbl) { + fn IndicateToConsumer( + pLogicalConsumer: *mut IWbemClassObject, + lNumObjects: c_long, + apObjects: *mut *mut IWbemClassObject, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemEventProvider; +DEFINE_GUID!{IID_IWbemEventProvider, + 0xe245105b, 0xb06e, 0x11d0, 0xad, 0x61, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +RIDL!{#[uuid(0xe245105b, 0xb06e, 0x11d0, 0xad, 0x61, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff)] +interface IWbemEventProvider(IWbemEventProviderVtbl): IUnknown(IUnknownVtbl) { + fn ProvideEvents( + pSink: *mut IWbemObjectSink, + lFlags: c_long, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemEventProviderQuerySink; +DEFINE_GUID!{IID_IWbemEventProviderQuerySink, + 0x580acaf8, 0xfa1c, 0x11d0, 0xad, 0x72, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +RIDL!{#[uuid(0x580acaf8, 0xfa1c, 0x11d0, 0xad, 0x72, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff)] +interface IWbemEventProviderQuerySink(IWbemEventProviderQuerySinkVtbl): IUnknown(IUnknownVtbl) { + fn NewQuery( + dwId: c_ulong, + wszQueryLanguage: WBEM_WSTR, + wszQuery: WBEM_WSTR, + ) -> HRESULT, + fn CancelQuery( + dwId: c_ulong, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemEventProviderSecurity; +DEFINE_GUID!{IID_IWbemEventProviderSecurity, + 0x631f7d96, 0xd993, 0x11d2, 0xb3, 0x39, 0x00, 0x10, 0x5a, 0x1f, 0x4a, 0xaf} +RIDL!{#[uuid(0x631f7d96, 0xd993, 0x11d2, 0xb3, 0x39, 0x00, 0x10, 0x5a, 0x1f, 0x4a, 0xaf)] +interface IWbemEventProviderSecurity(IWbemEventProviderSecurityVtbl): IUnknown(IUnknownVtbl) { + fn AccessCheck( + wszQueryLanguage: WBEM_CWSTR, + wszQuery: WBEM_CWSTR, + lSidLength: c_long, + pSid: *const BYTE, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemEventConsumerProvider; +DEFINE_GUID!{IID_IWbemEventConsumerProvider, + 0xe246107a, 0xb06e, 0x11d0, 0xad, 0x61, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +RIDL!{#[uuid(0xe246107a, 0xb06e, 0x11d0, 0xad, 0x61, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff)] +interface IWbemEventConsumerProvider(IWbemEventConsumerProviderVtbl): IUnknown(IUnknownVtbl) { + fn FindConsumer( + pLogicalConsumer: *mut IWbemClassObject, + ppConsumer: *mut *mut IWbemUnboundObjectSink, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemProviderInitSink; +DEFINE_GUID!{IID_IWbemProviderInitSink, + 0x1be41571, 0x91dd, 0x11d1, 0xae, 0xb2, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0x1be41571, 0x91dd, 0x11d1, 0xae, 0xb2, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IWbemProviderInitSink(IWbemProviderInitSinkVtbl): IUnknown(IUnknownVtbl) { + fn SetStatus( + lStatus: LONG, + lFlags: LONG, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemProviderInit; +DEFINE_GUID!{IID_IWbemProviderInit, + 0x1be41572, 0x91dd, 0x11d1, 0xae, 0xb2, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0x1be41572, 0x91dd, 0x11d1, 0xae, 0xb2, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IWbemProviderInit(IWbemProviderInitVtbl): IUnknown(IUnknownVtbl) { + fn Initialize( + wszUser: LPWSTR, + lFlags: LONG, + wszNamespace: LPWSTR, + wszLocale: LPWSTR, + pNamespace: *mut IWbemServices, + pCtx: *mut IWbemContext, + pInitSink: *mut IWbemProviderInitSink, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemHiPerfProvider; +DEFINE_GUID!{IID_IWbemHiPerfProvider, + 0x49353c93, 0x516b, 0x11d1, 0xae, 0xa6, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0x49353c93, 0x516b, 0x11d1, 0xae, 0xa6, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IWbemHiPerfProvider(IWbemHiPerfProviderVtbl): IUnknown(IUnknownVtbl) { + fn QueryInstances( + pNamespace: *mut IWbemServices, + wszClass: *mut WCHAR, + lFlags: c_long, + pCtx: *mut IWbemContext, + pSink: *mut IWbemObjectSink, + ) -> HRESULT, + fn CreateRefresher( + pNamespace: *mut IWbemServices, + lFlags: c_long, + ppRefresher: *mut *mut IWbemRefresher, + ) -> HRESULT, + fn CreateRefreshableObject( + pNamespace: *mut IWbemServices, + pTemplate: *mut IWbemObjectAccess, + pRefresher: *mut IWbemRefresher, + lFlags: c_long, + pContext: *mut IWbemContext, + ppRefreshable: *mut *mut IWbemObjectAccess, + plId: *mut c_long, + ) -> HRESULT, + fn StopRefreshing( + pRefresher: *mut IWbemRefresher, + lId: c_long, + lFlags: c_long, + ) -> HRESULT, + fn CreateRefreshableEnum( + pNamespace: *mut IWbemServices, + wszClass: LPCWSTR, + pRefresher: *mut IWbemRefresher, + lFlags: c_long, + pContext: *mut IWbemContext, + pHiPerfEnum: *mut IWbemHiPerfEnum, + plId: *mut c_long, + ) -> HRESULT, + fn GetObjects( + pNamespace: *mut IWbemServices, + lNumObjects: c_long, + apObj: *mut *mut IWbemObjectAccess, + lFlags: c_long, + pContext: *mut IWbemContext, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemDecoupledRegistrar; +DEFINE_GUID!{IID_IWbemDecoupledRegistrar, + 0x1005cbcf, 0xe64f, 0x4646, 0xbc, 0xd3, 0x3a, 0x08, 0x9d, 0x8a, 0x84, 0xb4} +RIDL!{#[uuid(0x1005cbcf, 0xe64f, 0x4646, 0xbc, 0xd3, 0x3a, 0x08, 0x9d, 0x8a, 0x84, 0xb4)] +interface IWbemDecoupledRegistrar(IWbemDecoupledRegistrarVtbl): IUnknown(IUnknownVtbl) { + fn Register( + a_Flags: c_long, + a_Context: *mut IWbemContext, + a_User: LPCWSTR, + a_Locale: LPCWSTR, + a_Scope: LPCWSTR, + a_Registration: LPCWSTR, + pIUnknown: *mut IUnknown, + ) -> HRESULT, + fn UnRegister() -> HRESULT, +}} +DEFINE_GUID!{CLSID_WbemAdministrativeLocator, + 0xcb8555cc, 0x9128, 0x11d1, 0xad, 0x9b, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +// class DECLSPEC_UUID("cb8555cc-9128-11d1-ad9b-00c04fd8fdff") +// WbemAdministrativeLocator; +DEFINE_GUID!{CLSID_WbemAuthenticatedLocator, + 0xcd184336, 0x9128, 0x11d1, 0xad, 0x9b, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +// class DECLSPEC_UUID("cd184336-9128-11d1-ad9b-00c04fd8fdff") +// WbemAuthenticatedLocator; +DEFINE_GUID!{CLSID_WbemUnauthenticatedLocator, + 0x443E7B79, 0xDE31, 0x11d2, 0xB3, 0x40, 0x00, 0x10, 0x4B, 0xCC, 0x4B, 0x4A} +// class DECLSPEC_UUID("443E7B79-DE31-11d2-B340-00104BCC4B4A") +// WbemUnauthenticatedLocator; +DEFINE_GUID!{CLSID_WbemDecoupledRegistrar, + 0x4cfc7932, 0x0f9d, 0x4bef, 0x9c, 0x32, 0x8e, 0xa2, 0xa6, 0xb5, 0x6f, 0xcb} +// class DECLSPEC_UUID("4cfc7932-0f9d-4bef-9c32-8ea2a6b56fcb") +// WbemDecoupledRegistrar; +DEFINE_GUID!{CLSID_WbemDecoupledBasicEventProvider, + 0xf5f75737, 0x2843, 0x4f22, 0x93, 0x3d, 0xc7, 0x6a, 0x97, 0xcd, 0xa6, 0x2f} +// class DECLSPEC_UUID("f5f75737-2843-4f22-933d-c76a97cda62f") +// WbemDecoupledBasicEventProvider; +// EXTERN_C const IID IID_IWbemProviderIdentity; +DEFINE_GUID!{IID_IWbemProviderIdentity, + 0x631f7d97, 0xd993, 0x11d2, 0xb3, 0x39, 0x00, 0x10, 0x5a, 0x1f, 0x4a, 0xaf} +RIDL!{#[uuid(0x631f7d97, 0xd993, 0x11d2, 0xb3, 0x39, 0x00, 0x10, 0x5a, 0x1f, 0x4a, 0xaf)] +interface IWbemProviderIdentity(IWbemProviderIdentityVtbl): IUnknown(IUnknownVtbl) { + fn SetRegistrationObject( + lFlags: c_long, + pProvReg: *mut IWbemClassObject, + ) -> HRESULT, +}} +ENUM!{enum WBEM_EXTRA_RETURN_CODES { + WBEM_S_INITIALIZED = 0, + WBEM_S_LIMITED_SERVICE = 0x43001, + WBEM_S_INDIRECTLY_UPDATED = WBEM_S_LIMITED_SERVICE + 1, + WBEM_S_SUBJECT_TO_SDS = WBEM_S_INDIRECTLY_UPDATED + 1, + WBEM_E_RETRY_LATER = 0x80043001, + WBEM_E_RESOURCE_CONTENTION = WBEM_E_RETRY_LATER + 1, +}} +ENUM!{enum WBEM_PROVIDER_FLAGS { + WBEM_FLAG_OWNER_UPDATE = 0x10000, +}} +// extern RPC_IF_HANDLE __MIDL_itf_wbemprov_0000_0008_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemprov_0000_0008_v0_0_s_ifspec; +// EXTERN_C const IID IID_IWbemDecoupledBasicEventProvider; +DEFINE_GUID!{IID_IWbemDecoupledBasicEventProvider, + 0x86336d20, 0xca11, 0x4786, 0x9e, 0xf1, 0xbc, 0x8a, 0x94, 0x6b, 0x42, 0xfc} +RIDL!{#[uuid(0x86336d20, 0xca11, 0x4786, 0x9e, 0xf1, 0xbc, 0x8a, 0x94, 0x6b, 0x42, 0xfc)] +interface IWbemDecoupledBasicEventProvider(IWbemDecoupledBasicEventProviderVtbl): + IWbemDecoupledRegistrar(IWbemDecoupledRegistrarVtbl) { + fn GetSink( + a_Flags: c_long, + a_Context: *mut IWbemContext, + a_Sink: *mut *mut IWbemObjectSink, + ) -> HRESULT, + fn GetService( + a_Flags: c_long, + a_Context: *mut IWbemContext, + a_Service: *mut *mut IWbemServices, + ) -> HRESULT, +}} +ENUM!{enum WBEM_BATCH_TYPE { + WBEM_FLAG_BATCH_IF_NEEDED = 0, + WBEM_FLAG_MUST_BATCH = 0x1, + WBEM_FLAG_MUST_NOT_BATCH = 0x2, +}} +// extern RPC_IF_HANDLE __MIDL_itf_wbemprov_0000_0013_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemprov_0000_0013_v0_0_s_ifspec; +// EXTERN_C const IID IID_IWbemEventSink; +DEFINE_GUID!{IID_IWbemEventSink, + 0x3ae0080a, 0x7e3a, 0x4366, 0xbf, 0x89, 0x0f, 0xee, 0xdc, 0x93, 0x16, 0x59} +RIDL!{#[uuid(0x3ae0080a, 0x7e3a, 0x4366, 0xbf, 0x89, 0x0f, 0xee, 0xdc, 0x93, 0x16, 0x59)] +interface IWbemEventSink(IWbemEventSinkVtbl): IWbemObjectSink(IWbemObjectSinkVtbl) { + fn SetSinkSecurity( + lSDLength: c_long, + pSD: *mut BYTE, + ) -> HRESULT, + fn IsActive() -> HRESULT, + fn GetRestrictedSink( + lNumQueries: c_long, + awszQueries: *const LPCWSTR, + pCallback: *mut IUnknown, + ppSink: *mut *mut IWbemEventSink, + ) -> HRESULT, + fn SetBatchingParameters( + lFlags: LONG, + dwMaxBufferSize: DWORD, + dwMaxSendLatency: DWORD, + ) -> HRESULT, +}} +// extern RPC_IF_HANDLE __MIDL_itf_wbemprov_0000_0014_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemprov_0000_0014_v0_0_s_ifspec; +// unsigned c_long __RPC_USER BSTR_UserSize( __RPC__in unsigned c_long *, unsigned c_long, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned c_long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned c_long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +// void __RPC_USER BSTR_UserFree( __RPC__in unsigned c_long *, __RPC__in BSTR * ); +// unsigned c_long __RPC_USER VARIANT_UserSize( __RPC__in unsigned c_long *, unsigned c_long, __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserMarshal( __RPC__in unsigned c_long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserUnmarshal(__RPC__in unsigned c_long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); +// void __RPC_USER VARIANT_UserFree( __RPC__in unsigned c_long *, __RPC__in VARIANT * ); +// unsigned c_long __RPC_USER BSTR_UserSize64( __RPC__in unsigned c_long *, unsigned c_long, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned c_long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +// unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned c_long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +// void __RPC_USER BSTR_UserFree64( __RPC__in unsigned c_long *, __RPC__in BSTR * ); +// unsigned c_long __RPC_USER VARIANT_UserSize64( __RPC__in unsigned c_long *, unsigned c_long, __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserMarshal64( __RPC__in unsigned c_long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); +// unsigned char * __RPC_USER VARIANT_UserUnmarshal64(__RPC__in unsigned c_long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); +// void __RPC_USER VARIANT_UserFree64( __RPC__in unsigned c_long *, __RPC__in VARIANT * ); diff --git a/bash-5.1/vendor/winapi/src/um/wbemtran.rs b/bash-5.1/vendor/winapi/src/um/wbemtran.rs new file mode 100644 index 0000000000000000000000000000000000000000..6f9d4a6ed8b07e7a05302cc05b81e098404ca431 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wbemtran.rs @@ -0,0 +1,184 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_long, c_void}; +use shared::guiddef::REFIID; +use shared::minwindef::{BYTE, DWORD}; +use shared::winerror::HRESULT; +use shared::wtypes::BSTR; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::wbemcli::{IWbemCallResult, IWbemContext, IWbemObjectSink, IWbemServices}; +use um::winnt::{LPCWSTR, LPWSTR}; +// extern RPC_IF_HANDLE __MIDL_itf_wbemtran_0000_0000_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemtran_0000_0000_v0_0_s_ifspec; +ENUM!{enum WBEM_LOGIN_TYPE { + WBEM_FLAG_INPROC_LOGIN = 0, + WBEM_FLAG_LOCAL_LOGIN = 1, + WBEM_FLAG_REMOTE_LOGIN = 2, + WBEM_AUTHENTICATION_METHOD_MASK = 0xf, + WBEM_FLAG_USE_MULTIPLE_CHALLENGES = 0x10, +}} +pub type WBEM_128BITS = *mut BYTE; +// EXTERN_C const IID LIBID_WbemTransports_v1; +// EXTERN_C const IID IID_IWbemTransport; +DEFINE_GUID!{IID_IWbemTransport, + 0x553fe584, 0x2156, 0x11d0, 0xb6, 0xae, 0x00, 0xaa, 0x00, 0x32, 0x40, 0xc7} +RIDL!{#[uuid(0x553fe584, 0x2156, 0x11d0, 0xb6, 0xae, 0x00, 0xaa, 0x00, 0x32, 0x40, 0xc7)] +interface IWbemTransport(IWbemTransportVtbl): IUnknown(IUnknownVtbl) { + fn Initialize() -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemLevel1Login; +DEFINE_GUID!{IID_IWbemLevel1Login, + 0xf309ad18, 0xd86a, 0x11d0, 0xa0, 0x75, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20} +RIDL!{#[uuid(0xf309ad18, 0xd86a, 0x11d0, 0xa0, 0x75, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)] +interface IWbemLevel1Login(IWbemLevel1LoginVtbl): IUnknown(IUnknownVtbl) { + fn EstablishPosition( + wszLocaleList: LPWSTR, + dwNumLocales: DWORD, + reserved: *mut DWORD, + ) -> HRESULT, + fn RequestChallenge( + wszNetworkResource: LPWSTR, + wszUser: LPWSTR, + Nonce: WBEM_128BITS, + ) -> HRESULT, + fn WBEMLogin( + wszPreferredLocale: LPWSTR, + AccessToken: WBEM_128BITS, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppNamespace: *mut *mut IWbemServices, + ) -> HRESULT, + fn NTLMLogin( + wszNetworkResource: LPWSTR, + wszPreferredLocale: LPWSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + ppNamespace: *mut *mut IWbemServices, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemConnectorLogin; +DEFINE_GUID!{IID_IWbemConnectorLogin, + 0xd8ec9cb1, 0xb135, 0x4f10, 0x8b, 0x1b, 0xc7, 0x18, 0x8b, 0xb0, 0xd1, 0x86} +RIDL!{#[uuid(0xd8ec9cb1, 0xb135, 0x4f10, 0x8b, 0x1b, 0xc7, 0x18, 0x8b, 0xb0, 0xd1, 0x86)] +interface IWbemConnectorLogin(IWbemConnectorLoginVtbl): IUnknown(IUnknownVtbl) { + fn ConnectorLogin( + wszNetworkResource: LPWSTR, + wszPreferredLocale: LPWSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + riid: REFIID, + pInterface: *mut *mut c_void, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemAddressResolution; +DEFINE_GUID!{IID_IWbemAddressResolution, + 0xf7ce2e12, 0x8c90, 0x11d1, 0x9e, 0x7b, 0x00, 0xc0, 0x4f, 0xc3, 0x24, 0xa8} +RIDL!{#[uuid(0xf7ce2e12, 0x8c90, 0x11d1, 0x9e, 0x7b, 0x00, 0xc0, 0x4f, 0xc3, 0x24, 0xa8)] +interface IWbemAddressResolution(IWbemAddressResolutionVtbl): IUnknown(IUnknownVtbl) { + fn Resolve( + wszNamespacePath: LPWSTR, + wszAddressType: LPWSTR, + pdwAddressLength: *mut DWORD, + pabBinaryAddress: *mut *mut BYTE, + ) -> HRESULT, +}} +DEFINE_GUID!{CLSID_WbemLevel1Login, + 0x8BC3F05E, 0xD86B, 0x11d0, 0xA0, 0x75, 0x00, 0xC0, 0x4F, 0xB6, 0x88, 0x20} +// class DECLSPEC_UUID("8BC3F05E-D86B-11d0-A075-00C04FB68820") +// WbemLevel1Login; +DEFINE_GUID!{CLSID_WbemLocalAddrRes, + 0xA1044801, 0x8F7E, 0x11d1, 0x9E, 0x7C, 0x00, 0xC0, 0x4F, 0xC3, 0x24, 0xA8} +// class DECLSPEC_UUID("A1044801-8F7E-11d1-9E7C-00C04FC324A8") +// WbemLocalAddrRes; +DEFINE_GUID!{CLSID_WbemUninitializedClassObject, + 0x7a0227f6, 0x7108, 0x11d1, 0xad, 0x90, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +// class DECLSPEC_UUID("7a0227f6-7108-11d1-ad90-00c04fd8fdff") +// WbemUninitializedClassObject; +// EXTERN_C const IID IID_IWbemClientTransport; +DEFINE_GUID!{IID_IWbemClientTransport, + 0xf7ce2e11, 0x8c90, 0x11d1, 0x9e, 0x7b, 0x00, 0xc0, 0x4f, 0xc3, 0x24, 0xa8} +RIDL!{#[uuid(0xf7ce2e11, 0x8c90, 0x11d1, 0x9e, 0x7b, 0x00, 0xc0, 0x4f, 0xc3, 0x24, 0xa8)] +interface IWbemClientTransport(IWbemClientTransportVtbl): IUnknown(IUnknownVtbl) { + fn ConnectServer( + strAddressType: BSTR, + dwBinaryAddressLength: DWORD, + abBinaryAddress: *mut BYTE, + strNetworkResource: BSTR, + strUser: BSTR, + strPassword: BSTR, + strLocale: BSTR, + lSecurityFlags: c_long, + strAuthority: BSTR, + pCtx: *mut IWbemContext, + ppNamespace: *mut *mut IWbemServices, + ) -> HRESULT, +}} +// EXTERN_C const IID IID_IWbemClientConnectionTransport; +DEFINE_GUID!{IID_IWbemClientConnectionTransport, + 0xa889c72a, 0xfcc1, 0x4a9e, 0xaf, 0x61, 0xed, 0x07, 0x13, 0x33, 0xfb, 0x5b} +RIDL!{#[uuid(0xa889c72a, 0xfcc1, 0x4a9e, 0xaf, 0x61, 0xed, 0x07, 0x13, 0x33, 0xfb, 0x5b)] +interface IWbemClientConnectionTransport(IWbemClientConnectionTransportVtbl): + IUnknown(IUnknownVtbl) { + fn Open( + strAddressType: BSTR, + dwBinaryAddressLength: DWORD, + abBinaryAddress: *mut BYTE, + strObject: BSTR, + strUser: BSTR, + strPassword: BSTR, + strLocale: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + riid: REFIID, + pInterface: *mut *mut c_void, + pCallRes: *mut *mut IWbemCallResult, + ) -> HRESULT, + fn OpenAsync( + strAddressType: BSTR, + dwBinaryAddressLength: DWORD, + abBinaryAddress: *mut BYTE, + strObject: BSTR, + strUser: BSTR, + strPassword: BSTR, + strLocale: BSTR, + lFlags: c_long, + pCtx: *mut IWbemContext, + riid: REFIID, + pResponseHandler: *mut IWbemObjectSink, + ) -> HRESULT, + fn Cancel( + lFlags: c_long, + pHandler: *mut IWbemObjectSink, + ) -> HRESULT, +}} +DEFINE_GUID!{CLSID_WbemDCOMTransport, + 0xF7CE2E13, 0x8C90, 0x11d1, 0x9E, 0x7B, 0x00, 0xC0, 0x4F, 0xC3, 0x24, 0xA8} +// class DECLSPEC_UUID("F7CE2E13-8C90-11d1-9E7B-00C04FC324A8") +// WbemDCOMTransport; +// EXTERN_C const IID IID_IWbemConstructClassObject; +DEFINE_GUID!{IID_IWbemConstructClassObject, + 0x9ef76194, 0x70d5, 0x11d1, 0xad, 0x90, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff} +RIDL!{#[uuid(0x9ef76194, 0x70d5, 0x11d1, 0xad, 0x90, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff)] +interface IWbemConstructClassObject(IWbemConstructClassObjectVtbl): IUnknown(IUnknownVtbl) { + fn SetInheritanceChain( + lNumAntecedents: c_long, + awszAntecedents: *mut LPWSTR, + ) -> HRESULT, + fn SetPropertyOrigin( + wszPropertyName: LPCWSTR, + lOriginIndex: c_long, + ) -> HRESULT, + fn SetMethodOrigin( + wszMethodName: LPCWSTR, + lOriginIndex: c_long, + ) -> HRESULT, + fn SetServerNamespace( + wszServer: LPCWSTR, + wszNamespace: LPCWSTR, + ) -> HRESULT, +}} +// extern RPC_IF_HANDLE __MIDL_itf_wbemtran_0000_0008_v0_0_c_ifspec; +// extern RPC_IF_HANDLE __MIDL_itf_wbemtran_0000_0008_v0_0_s_ifspec; diff --git a/bash-5.1/vendor/winapi/src/um/wct.rs b/bash-5.1/vendor/winapi/src/um/wct.rs new file mode 100644 index 0000000000000000000000000000000000000000..0c3fae910e387dd79fc90764b6923242c048ebcf --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wct.rs @@ -0,0 +1,114 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_int; +use shared::basetsd::{DWORD_PTR, SIZE_T}; +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, DWORD, LPBOOL, LPDWORD, PULONG}; +use um::winnt::{HRESULT, LARGE_INTEGER, WCHAR}; +ENUM!{enum WCT_OBJECT_TYPE { + WctCriticalSectionType = 1, + WctSendMessageType, + WctMutexType, + WctAlpcType, + WctComType, + WctThreadWaitType, + WctProcessWaitType, + WctThreadType, + WctComActivationType, + WctUnknownType, + WctSocketIoType, + WctSmbIoType, + WctMaxType, +}} +ENUM!{enum WCT_OBJECT_STATUS { + WctStatusNoAccess = 1, + WctStatusRunning, + WctStatusBlocked, + WctStatusPidOnly, + WctStatusPidOnlyRpcss, + WctStatusOwned, + WctStatusNotOwned, + WctStatusAbandoned, + WctStatusUnknown, + WctStatusError, + WctStatusMax, +}} +pub const WCT_MAX_NODE_COUNT: SIZE_T = 16; +pub const WCT_OBJNAME_LENGTH: SIZE_T = 128; +STRUCT!{struct WAITCHAIN_NODE_INFO_LOCK_OBJECT { + ObjectName: [WCHAR; WCT_OBJNAME_LENGTH], + Timeout: LARGE_INTEGER, + Alertable: BOOL, +}} +STRUCT!{struct WAITCHAIN_NODE_INFO_THREAD_OBJECT { + ProcessId: DWORD, + ThreadId: DWORD, + WaitTime: DWORD, + ContextSwitches: DWORD, +}} +UNION!{union WAITCHAIN_NODE_INFO_u { + [u64; 34], + LockObject LockObject_mut: WAITCHAIN_NODE_INFO_LOCK_OBJECT, + ThreadObject ThreadObject_mut: WAITCHAIN_NODE_INFO_THREAD_OBJECT, +}} +STRUCT!{struct WAITCHAIN_NODE_INFO { + ObjectType: WCT_OBJECT_TYPE, + ObjectStatus: WCT_OBJECT_STATUS, + u: WAITCHAIN_NODE_INFO_u, +}} +pub type PWAITCHAIN_NODE_INFO = *mut WAITCHAIN_NODE_INFO; +DECLARE_HANDLE!{HWCT, HWCT__} +FN!{cdecl PWAITCHAINCALLBACK( + WctHandle: HWCT, + Context: DWORD_PTR, + CallbackStatus: DWORD, + NodeCount: LPDWORD, + NodeInfoArray: PWAITCHAIN_NODE_INFO, + IsCycle: LPBOOL, +) -> ()} +pub const WCT_ASYNC_OPEN_FLAG: DWORD = 1; +pub const WCTP_OPEN_ALL_FLAGS: DWORD = WCT_ASYNC_OPEN_FLAG; +extern "system" { + pub fn OpenThreadWaitChainSession( + Flags: DWORD, + callback: PWAITCHAINCALLBACK, + ) -> HWCT; + pub fn CloseThreadWaitChainSession( + WctHandle: HWCT, + ); +} +pub const WCT_OUT_OF_PROC_FLAG: DWORD = 0x1; +pub const WCT_OUT_OF_PROC_COM_FLAG: DWORD = 0x2; +pub const WCT_OUT_OF_PROC_CS_FLAG: DWORD = 0x4; +pub const WCT_NETWORK_IO_FLAG: DWORD = 0x8; +pub const WCTP_GETINFO_ALL_FLAGS: DWORD = WCT_OUT_OF_PROC_FLAG | WCT_OUT_OF_PROC_COM_FLAG + | WCT_OUT_OF_PROC_CS_FLAG; +extern "system" { + pub fn GetThreadWaitChain( + WctHandle: HWCT, + Context: DWORD_PTR, + Flags: DWORD, + ThreadId: DWORD, + NodeCount: LPDWORD, + NodeInfoArray: PWAITCHAIN_NODE_INFO, + IsCycle: LPBOOL, + ) -> BOOL; +} +FN!{cdecl PCOGETCALLSTATE( + c_int, + PULONG, +) -> HRESULT} +FN!{cdecl PCOGETACTIVATIONSTATE( + GUID, + DWORD, + *mut DWORD, +) -> HRESULT} +extern "system" { + pub fn RegisterWaitChainCOMCallback( + CallStateCallback: PCOGETCALLSTATE, + ActivationStateCallback: PCOGETACTIVATIONSTATE, + ); +} diff --git a/bash-5.1/vendor/winapi/src/um/werapi.rs b/bash-5.1/vendor/winapi/src/um/werapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..f6dcf103ef31becc3f44ef6f47d00d3af5d05c6f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/werapi.rs @@ -0,0 +1,64 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Function prototypes for Windows Error Reporting (WER) +use shared::minwindef::{BOOL, DWORD, PDWORD}; +use um::winnt::{HANDLE, HRESULT, PCWSTR, PVOID}; +pub const WER_FAULT_REPORTING_FLAG_NOHEAP: DWORD = 1; +pub const WER_FAULT_REPORTING_FLAG_QUEUE: DWORD = 2; +pub const WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION: DWORD = 4; +pub const WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD: DWORD = 8; +pub const WER_FAULT_REPORTING_ALWAYS_SHOW_UI: DWORD = 16; +pub const WER_FAULT_REPORTING_NO_UI: DWORD = 32; +pub const WER_FAULT_REPORTING_FLAG_NO_HEAP_ON_QUEUE: DWORD = 64; +pub const WER_FAULT_REPORTING_DISABLE_SNAPSHOT_CRASH: DWORD = 128; +pub const WER_FAULT_REPORTING_DISABLE_SNAPSHOT_HANG: DWORD = 256; +pub const WER_FAULT_REPORTING_CRITICAL: DWORD = 512; +pub const WER_FAULT_REPORTING_DURABLE: DWORD = 1024; +ENUM!{enum WER_REGISTER_FILE_TYPE { + WerRegFileTypeUserDocument = 1, + WerRegFileTypeOther = 2, + WerRegFileTypeMax, +}} +extern "system" { + pub fn WerRegisterFile( + pwzFile: PCWSTR, + regFileType: WER_REGISTER_FILE_TYPE, + dwFlags: DWORD, + ) -> HRESULT; + pub fn WerUnregisterFile( + pwzFilePath: PCWSTR, + ) -> HRESULT; + pub fn WerRegisterMemoryBlock( + pvAddress: PVOID, + dwSize: DWORD, + ) -> HRESULT; + pub fn WerUnregisterMemoryBlock( + pvAddress: PVOID, + ) -> HRESULT; + pub fn WerSetFlags( + dwFlags: DWORD, + ) -> HRESULT; + pub fn WerGetFlags( + hProcess: HANDLE, + pdwFlags: PDWORD, + ) -> HRESULT; + pub fn WerAddExcludedApplication( + pwzExeName: PCWSTR, + bAllUsers: BOOL, + ) -> HRESULT; + pub fn WerRemoveExcludedApplication( + pwzExeName: PCWSTR, + bAllUsers: BOOL, + ) -> HRESULT; + pub fn WerRegisterRuntimeExceptionModule( + pwszOutOfProcessCallbackDll: PCWSTR, + pContext: PVOID, + ) -> HRESULT; + pub fn WerUnregisterRuntimeExceptionModule( + pwszOutOfProcessCallbackDll: PCWSTR, + pContext: PVOID, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/um/winbase.rs b/bash-5.1/vendor/winapi/src/um/winbase.rs new file mode 100644 index 0000000000000000000000000000000000000000..1891738e2f235481339e2cc5e3a35dd4f87b917d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winbase.rs @@ -0,0 +1,2854 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module defines the 32-Bit Windows Base APIs +use ctypes::{c_char, c_int, c_long, c_void}; +use shared::basetsd::{ + DWORD64, DWORD_PTR, LONG_PTR, PDWORD64, PDWORD_PTR, PSIZE_T, PULONG_PTR, SIZE_T, UINT_PTR, + ULONG_PTR, +}; +use shared::guiddef::GUID; +use shared::minwindef::{ + ATOM, BOOL, BYTE, DWORD, FARPROC, FILETIME, HFILE, HGLOBAL, HLOCAL, HMODULE, HRSRC, LPBOOL, + LPBYTE, LPCVOID, LPDWORD, LPFILETIME, LPVOID, LPWORD, PBOOL, PDWORD, PUCHAR, PULONG, PUSHORT, + UCHAR, UINT, ULONG, USHORT, WORD, +}; +use shared::windef::HWND; +use um::cfgmgr32::MAX_PROFILE_LEN; +use um::fileapi::STREAM_INFO_LEVELS; +use um::libloaderapi::{ + ENUMRESLANGPROCA, ENUMRESLANGPROCW, ENUMRESNAMEPROCA, ENUMRESTYPEPROCA, ENUMRESTYPEPROCW, +}; +use um::minwinbase::{ + FILE_INFO_BY_HANDLE_CLASS, FINDEX_INFO_LEVELS, FINDEX_SEARCH_OPS, GET_FILEEX_INFO_LEVELS, + LPOVERLAPPED, LPOVERLAPPED_COMPLETION_ROUTINE, LPSECURITY_ATTRIBUTES, PREASON_CONTEXT, +}; +use um::processthreadsapi::{ + LPPROCESS_INFORMATION, LPPROC_THREAD_ATTRIBUTE_LIST, LPSTARTUPINFOA, LPSTARTUPINFOW, + STARTUPINFOA, STARTUPINFOW, +}; +use um::winnt::{ + BOOLEAN, CHAR, DWORDLONG, EXECUTION_STATE, FILE_ID_128, HANDLE, HRESULT, INT, LANGID, + LARGE_INTEGER, LATENCY_TIME, LONG, LPCCH, LPCH, LPCSTR, LPCWSTR, LPOSVERSIONINFOEXA, + LPOSVERSIONINFOEXW, LPSTR, LPWSTR, MAXLONG, PBOOLEAN, PCONTEXT, PCWSTR, PFIRMWARE_TYPE, + PHANDLE, PIO_COUNTERS, PJOB_SET_ARRAY, PLUID, POWER_REQUEST_TYPE, PPERFORMANCE_DATA, + PPROCESSOR_NUMBER, PQUOTA_LIMITS, PRTL_UMS_SCHEDULER_ENTRY_POINT, + PSECURE_MEMORY_CACHE_CALLBACK, PSID, PSID_NAME_USE, PULONGLONG, PVOID, PWOW64_CONTEXT, + PWOW64_LDT_ENTRY, PWSTR, RTL_UMS_THREAD_INFO_CLASS, STATUS_ABANDONED_WAIT_0, STATUS_USER_APC, + STATUS_WAIT_0, SecurityAnonymous, SecurityDelegation, SecurityIdentification, + SecurityImpersonation, THREAD_BASE_PRIORITY_IDLE, THREAD_BASE_PRIORITY_LOWRT, + THREAD_BASE_PRIORITY_MAX, THREAD_BASE_PRIORITY_MIN, ULARGE_INTEGER, VOID, WAITORTIMERCALLBACK, + WCHAR, WOW64_CONTEXT, +}; +#[cfg(target_arch = "x86")] +use um::winnt::PLDT_ENTRY; +use vc::vadefs::va_list; +pub const FILE_BEGIN: DWORD = 0; +pub const FILE_CURRENT: DWORD = 1; +pub const FILE_END: DWORD = 2; +pub const WAIT_FAILED: DWORD = 0xFFFFFFFF; +pub const WAIT_OBJECT_0: DWORD = STATUS_WAIT_0 as u32; +pub const WAIT_ABANDONED: DWORD = STATUS_ABANDONED_WAIT_0 as u32; +pub const WAIT_ABANDONED_0: DWORD = STATUS_ABANDONED_WAIT_0 as u32; +pub const WAIT_IO_COMPLETION: DWORD = STATUS_USER_APC as u32; +pub const FILE_FLAG_WRITE_THROUGH: DWORD = 0x80000000; +pub const FILE_FLAG_OVERLAPPED: DWORD = 0x40000000; +pub const FILE_FLAG_NO_BUFFERING: DWORD = 0x20000000; +pub const FILE_FLAG_RANDOM_ACCESS: DWORD = 0x10000000; +pub const FILE_FLAG_SEQUENTIAL_SCAN: DWORD = 0x08000000; +pub const FILE_FLAG_DELETE_ON_CLOSE: DWORD = 0x04000000; +pub const FILE_FLAG_BACKUP_SEMANTICS: DWORD = 0x02000000; +pub const FILE_FLAG_POSIX_SEMANTICS: DWORD = 0x01000000; +pub const FILE_FLAG_SESSION_AWARE: DWORD = 0x00800000; +pub const FILE_FLAG_OPEN_REPARSE_POINT: DWORD = 0x00200000; +pub const FILE_FLAG_OPEN_NO_RECALL: DWORD = 0x00100000; +pub const FILE_FLAG_FIRST_PIPE_INSTANCE: DWORD = 0x00080000; +pub const FILE_FLAG_OPEN_REQUIRING_OPLOCK: DWORD = 0x00040000; +pub const PROGRESS_CONTINUE: DWORD = 0; +pub const PROGRESS_CANCEL: DWORD = 1; +pub const PROGRESS_STOP: DWORD = 2; +pub const PROGRESS_QUIET: DWORD = 3; +pub const CALLBACK_CHUNK_FINISHED: DWORD = 0x00000000; +pub const CALLBACK_STREAM_SWITCH: DWORD = 0x00000001; +pub const COPY_FILE_FAIL_IF_EXISTS: DWORD = 0x00000001; +pub const COPY_FILE_RESTARTABLE: DWORD = 0x00000002; +pub const COPY_FILE_OPEN_SOURCE_FOR_WRITE: DWORD = 0x00000004; +pub const COPY_FILE_ALLOW_DECRYPTED_DESTINATION: DWORD = 0x00000008; +pub const COPY_FILE_COPY_SYMLINK: DWORD = 0x00000800; +pub const COPY_FILE_NO_BUFFERING: DWORD = 0x00001000; +pub const COPY_FILE_REQUEST_SECURITY_PRIVILEGES: DWORD = 0x00002000; +pub const COPY_FILE_RESUME_FROM_PAUSE: DWORD = 0x00004000; +pub const COPY_FILE_NO_OFFLOAD: DWORD = 0x00040000; +pub const COPY_FILE_IGNORE_EDP_BLOCK: DWORD = 0x00400000; +pub const COPY_FILE_IGNORE_SOURCE_ENCRYPTION: DWORD = 0x00800000; +pub const REPLACEFILE_WRITE_THROUGH: DWORD = 0x00000001; +pub const REPLACEFILE_IGNORE_MERGE_ERRORS: DWORD = 0x00000002; +pub const REPLACEFILE_IGNORE_ACL_ERRORS: DWORD = 0x00000004; +pub const PIPE_ACCESS_INBOUND: DWORD = 0x00000001; +pub const PIPE_ACCESS_OUTBOUND: DWORD = 0x00000002; +pub const PIPE_ACCESS_DUPLEX: DWORD = 0x00000003; +pub const PIPE_CLIENT_END: DWORD = 0x00000000; +pub const PIPE_SERVER_END: DWORD = 0x00000001; +pub const PIPE_WAIT: DWORD = 0x00000000; +pub const PIPE_NOWAIT: DWORD = 0x00000001; +pub const PIPE_READMODE_BYTE: DWORD = 0x00000000; +pub const PIPE_READMODE_MESSAGE: DWORD = 0x00000002; +pub const PIPE_TYPE_BYTE: DWORD = 0x00000000; +pub const PIPE_TYPE_MESSAGE: DWORD = 0x00000004; +pub const PIPE_ACCEPT_REMOTE_CLIENTS: DWORD = 0x00000000; +pub const PIPE_REJECT_REMOTE_CLIENTS: DWORD = 0x00000008; +pub const PIPE_UNLIMITED_INSTANCES: DWORD = 255; +pub const SECURITY_ANONYMOUS: DWORD = SecurityAnonymous << 16; +pub const SECURITY_IDENTIFICATION: DWORD = SecurityIdentification << 16; +pub const SECURITY_IMPERSONATION: DWORD = SecurityImpersonation << 16; +pub const SECURITY_DELEGATION: DWORD = SecurityDelegation << 16; +pub const SECURITY_CONTEXT_TRACKING: DWORD = 0x00040000; +pub const SECURITY_EFFECTIVE_ONLY: DWORD = 0x00080000; +pub const SECURITY_SQOS_PRESENT: DWORD = 0x00100000; +pub const SECURITY_VALID_SQOS_FLAGS: DWORD = 0x001F0000; +FN!{stdcall PFIBER_START_ROUTINE( + lpFiberParameter: LPVOID, +) -> ()} +pub type LPFIBER_START_ROUTINE = PFIBER_START_ROUTINE; +FN!{stdcall PFIBER_CALLOUT_ROUTINE( + lpParameter: LPVOID, +) -> LPVOID} +// FAIL_FAST_* +#[cfg(target_arch = "x86")] +pub type LPLDT_ENTRY = PLDT_ENTRY; +#[cfg(not(target_arch = "x86"))] +pub type LPLDT_ENTRY = LPVOID; // TODO - fix this for 32-bit +//SP_SERIALCOMM +//PST_* +// PCF_* +// SP_* +// BAUD_* +// DATABITS_* +// STOPBITS_* +// PARITY_* +STRUCT!{struct COMMPROP { + wPacketLength: WORD, + wPacketVersion: WORD, + dwServiceMask: DWORD, + dwReserved1: DWORD, + dwMaxTxQueue: DWORD, + dwMaxRxQueue: DWORD, + dwMaxBaud: DWORD, + dwProvSubType: DWORD, + dwProvCapabilities: DWORD, + dwSettableParams: DWORD, + dwSettableBaud: DWORD, + wSettableData: WORD, + wSettableStopParity: WORD, + dwCurrentTxQueue: DWORD, + dwCurrentRxQueue: DWORD, + dwProvSpec1: DWORD, + dwProvSpec2: DWORD, + wcProvChar: [WCHAR; 1], +}} +pub type LPCOMMPROP = *mut COMMPROP; +STRUCT!{struct COMSTAT { + BitFields: DWORD, + cbInQue: DWORD, + cbOutQue: DWORD, +}} +BITFIELD!{COMSTAT BitFields: DWORD [ + fCtsHold set_fCtsHold[0..1], + fDsrHold set_fDsrHold[1..2], + fRlsdHold set_fRlsdHold[2..3], + fXoffHold set_fXoffHold[3..4], + fXoffSent set_fXoffSent[4..5], + fEof set_fEof[5..6], + fTxim set_fTxim[6..7], + fReserved set_fReserved[7..32], +]} +pub type LPCOMSTAT = *mut COMSTAT; +pub const DTR_CONTROL_DISABLE: DWORD = 0x00; +pub const DTR_CONTROL_ENABLE: DWORD = 0x01; +pub const DTR_CONTROL_HANDSHAKE: DWORD = 0x02; +pub const RTS_CONTROL_DISABLE: DWORD = 0x00; +pub const RTS_CONTROL_ENABLE: DWORD = 0x01; +pub const RTS_CONTROL_HANDSHAKE: DWORD = 0x02; +pub const RTS_CONTROL_TOGGLE: DWORD = 0x03; +STRUCT!{struct DCB { + DCBlength: DWORD, + BaudRate: DWORD, + BitFields: DWORD, + wReserved: WORD, + XonLim: WORD, + XoffLim: WORD, + ByteSize: BYTE, + Parity: BYTE, + StopBits: BYTE, + XonChar: c_char, + XoffChar: c_char, + ErrorChar: c_char, + EofChar: c_char, + EvtChar: c_char, + wReserved1: WORD, +}} +BITFIELD!{DCB BitFields: DWORD [ + fBinary set_fBinary[0..1], + fParity set_fParity[1..2], + fOutxCtsFlow set_fOutxCtsFlow[2..3], + fOutxDsrFlow set_fOutxDsrFlow[3..4], + fDtrControl set_fDtrControl[4..6], + fDsrSensitivity set_fDsrSensitivity[6..7], + fTXContinueOnXoff set_fTXContinueOnXoff[7..8], + fOutX set_fOutX[8..9], + fInX set_fInX[9..10], + fErrorChar set_fErrorChar[10..11], + fNull set_fNull[11..12], + fRtsControl set_fRtsControl[12..14], + fAbortOnError set_fAbortOnError[14..15], + fDummy2 set_fDummy2[15..32], +]} +pub type LPDCB = *mut DCB; +STRUCT!{struct COMMTIMEOUTS { + ReadIntervalTimeout: DWORD, + ReadTotalTimeoutMultiplier: DWORD, + ReadTotalTimeoutConstant: DWORD, + WriteTotalTimeoutMultiplier: DWORD, + WriteTotalTimeoutConstant: DWORD, +}} +pub type LPCOMMTIMEOUTS = *mut COMMTIMEOUTS; +STRUCT!{struct COMMCONFIG { + dwSize: DWORD, + wVersion: WORD, + wReserved: WORD, + dcb: DCB, + dwProviderSubType: DWORD, + dwProviderOffset: DWORD, + dwProviderSize: DWORD, + wcProviderData: [WCHAR; 1], +}} +pub type LPCOMMCONFIG = *mut COMMCONFIG; +pub const GMEM_FIXED: UINT = 0x0000; +pub const GMEM_MOVEABLE: UINT = 0x0002; +pub const GMEM_NOCOMPACT: UINT = 0x0010; +pub const GMEM_NODISCARD: UINT = 0x0020; +pub const GMEM_ZEROINIT: UINT = 0x0040; +pub const GMEM_MODIFY: UINT = 0x0080; +pub const GMEM_DISCARDABLE: UINT = 0x0100; +pub const GMEM_NOT_BANKED: UINT = 0x1000; +pub const GMEM_SHARE: UINT = 0x2000; +pub const GMEM_DDESHARE: UINT = 0x2000; +pub const GMEM_NOTIFY: UINT = 0x4000; +pub const GMEM_LOWER: UINT = GMEM_NOT_BANKED; +pub const GMEM_VALID_FLAGS: UINT = 0x7F72; +pub const GMEM_INVALID_HANDLE: UINT = 0x8000; +pub const GHND: UINT = GMEM_MOVEABLE | GMEM_ZEROINIT; +pub const GPTR: UINT = GMEM_FIXED | GMEM_ZEROINIT; +pub const GMEM_DISCARDED: UINT = 0x4000; +pub const GMEM_LOCKCOUNT: UINT = 0x00FF; +STRUCT!{struct MEMORYSTATUS { + dwLength: DWORD, + dwMemoryLoad: DWORD, + dwTotalPhys: SIZE_T, + dwAvailPhys: SIZE_T, + dwTotalPageFile: SIZE_T, + dwAvailPageFile: SIZE_T, + dwTotalVirtual: SIZE_T, + dwAvailVirtual: SIZE_T, +}} +pub type LPMEMORYSTATUS = *mut MEMORYSTATUS; +// NUMA_NO_PREFERRED_NODE +pub const DEBUG_PROCESS: DWORD = 0x00000001; +pub const DEBUG_ONLY_THIS_PROCESS: DWORD = 0x00000002; +pub const CREATE_SUSPENDED: DWORD = 0x00000004; +pub const DETACHED_PROCESS: DWORD = 0x00000008; +pub const CREATE_NEW_CONSOLE: DWORD = 0x00000010; +pub const NORMAL_PRIORITY_CLASS: DWORD = 0x00000020; +pub const IDLE_PRIORITY_CLASS: DWORD = 0x00000040; +pub const HIGH_PRIORITY_CLASS: DWORD = 0x00000080; +pub const REALTIME_PRIORITY_CLASS: DWORD = 0x00000100; +pub const CREATE_NEW_PROCESS_GROUP: DWORD = 0x00000200; +pub const CREATE_UNICODE_ENVIRONMENT: DWORD = 0x00000400; +pub const CREATE_SEPARATE_WOW_VDM: DWORD = 0x00000800; +pub const CREATE_SHARED_WOW_VDM: DWORD = 0x00001000; +pub const CREATE_FORCEDOS: DWORD = 0x00002000; +pub const BELOW_NORMAL_PRIORITY_CLASS: DWORD = 0x00004000; +pub const ABOVE_NORMAL_PRIORITY_CLASS: DWORD = 0x00008000; +pub const INHERIT_PARENT_AFFINITY: DWORD = 0x00010000; +pub const INHERIT_CALLER_PRIORITY: DWORD = 0x00020000; +pub const CREATE_PROTECTED_PROCESS: DWORD = 0x00040000; +pub const EXTENDED_STARTUPINFO_PRESENT: DWORD = 0x00080000; +pub const PROCESS_MODE_BACKGROUND_BEGIN: DWORD = 0x00100000; +pub const PROCESS_MODE_BACKGROUND_END: DWORD = 0x00200000; +pub const CREATE_BREAKAWAY_FROM_JOB: DWORD = 0x01000000; +pub const CREATE_PRESERVE_CODE_AUTHZ_LEVEL: DWORD = 0x02000000; +pub const CREATE_DEFAULT_ERROR_MODE: DWORD = 0x04000000; +pub const CREATE_NO_WINDOW: DWORD = 0x08000000; +pub const PROFILE_USER: DWORD = 0x10000000; +pub const PROFILE_KERNEL: DWORD = 0x20000000; +pub const PROFILE_SERVER: DWORD = 0x40000000; +pub const CREATE_IGNORE_SYSTEM_DEFAULT: DWORD = 0x80000000; +// STACK_SIZE_PARAM_IS_A_RESERVATION +pub const THREAD_PRIORITY_LOWEST: DWORD = THREAD_BASE_PRIORITY_MIN; +pub const THREAD_PRIORITY_BELOW_NORMAL: DWORD = THREAD_PRIORITY_LOWEST + 1; +pub const THREAD_PRIORITY_NORMAL: DWORD = 0; +pub const THREAD_PRIORITY_HIGHEST: DWORD = THREAD_BASE_PRIORITY_MAX; +pub const THREAD_PRIORITY_ABOVE_NORMAL: DWORD = THREAD_PRIORITY_HIGHEST - 1; +pub const THREAD_PRIORITY_ERROR_RETURN: DWORD = MAXLONG as u32; +pub const THREAD_PRIORITY_TIME_CRITICAL: DWORD = THREAD_BASE_PRIORITY_LOWRT; +pub const THREAD_PRIORITY_IDLE: DWORD = THREAD_BASE_PRIORITY_IDLE; +pub const THREAD_MODE_BACKGROUND_BEGIN: DWORD = 0x00010000; +pub const THREAD_MODE_BACKGROUND_END: DWORD = 0x00020000; +pub const VOLUME_NAME_DOS: DWORD = 0x0; +// VOLUME_NAME_* +// FILE_NAME_* +// JIT_DEBUG_* +pub const DRIVE_UNKNOWN: DWORD = 0; +pub const DRIVE_NO_ROOT_DIR: DWORD = 1; +pub const DRIVE_REMOVABLE: DWORD = 2; +pub const DRIVE_FIXED: DWORD = 3; +pub const DRIVE_REMOTE: DWORD = 4; +pub const DRIVE_CDROM: DWORD = 5; +pub const DRIVE_RAMDISK: DWORD = 6; +// pub fn GetFreeSpace(); +pub const FILE_TYPE_UNKNOWN: DWORD = 0x0000; +pub const FILE_TYPE_DISK: DWORD = 0x0001; +pub const FILE_TYPE_CHAR: DWORD = 0x0002; +pub const FILE_TYPE_PIPE: DWORD = 0x0003; +pub const FILE_TYPE_REMOTE: DWORD = 0x8000; +pub const STD_INPUT_HANDLE: DWORD = -10i32 as u32; +pub const STD_OUTPUT_HANDLE: DWORD = -11i32 as u32; +pub const STD_ERROR_HANDLE: DWORD = -12i32 as u32; +pub const NOPARITY: BYTE = 0; +pub const ODDPARITY: BYTE = 1; +pub const EVENPARITY: BYTE = 2; +pub const MARKPARITY: BYTE = 3; +pub const SPACEPARITY: BYTE = 4; +pub const ONESTOPBIT: BYTE = 0; +pub const ONE5STOPBITS: BYTE = 1; +pub const TWOSTOPBITS: BYTE = 2; +pub const IGNORE: DWORD = 0; +pub const INFINITE: DWORD = 0xFFFFFFFF; +pub const CBR_110: DWORD = 110; +pub const CBR_300: DWORD = 300; +pub const CBR_600: DWORD = 600; +pub const CBR_1200: DWORD = 1200; +pub const CBR_2400: DWORD = 2400; +pub const CBR_4800: DWORD = 4800; +pub const CBR_9600: DWORD = 9600; +pub const CBR_14400: DWORD = 14400; +pub const CBR_19200: DWORD = 19200; +pub const CBR_38400: DWORD = 38400; +pub const CBR_56000: DWORD = 56000; +pub const CBR_57600: DWORD = 57600; +pub const CBR_115200: DWORD = 115200; +pub const CBR_128000: DWORD = 128000; +pub const CBR_256000: DWORD = 256000; +// CE_* +// IE_* +// EV_* +pub const SETXOFF: DWORD = 1; +pub const SETXON: DWORD = 2; +pub const SETRTS: DWORD = 3; +pub const CLRRTS: DWORD = 4; +pub const SETDTR: DWORD = 5; +pub const CLRDTR: DWORD = 6; +pub const RESETDEV: DWORD = 7; +pub const SETBREAK: DWORD = 8; +pub const CLRBREAK: DWORD = 9; +pub const PURGE_TXABORT: DWORD = 0x0001; +pub const PURGE_RXABORT: DWORD = 0x0002; +pub const PURGE_TXCLEAR: DWORD = 0x0004; +pub const PURGE_RXCLEAR: DWORD = 0x0008; +pub const MS_CTS_ON: DWORD = 0x0010; +pub const MS_DSR_ON: DWORD = 0x0020; +pub const MS_RING_ON: DWORD = 0x0040; +pub const MS_RLSD_ON: DWORD = 0x0080; +// S_* +// NMPWAIT_* +// FS_* +// OF_* +pub const OFS_MAXPATHNAME: usize = 128; +STRUCT!{struct OFSTRUCT { + cBytes: BYTE, + fFixedDisk: BYTE, + nErrCode: WORD, + Reserved1: WORD, + Reserved2: WORD, + szPathName: [CHAR; OFS_MAXPATHNAME], +}} +pub type POFSTRUCT = *mut OFSTRUCT; +pub type LPOFSTRUCT = *mut OFSTRUCT; +extern "system" { + pub fn GlobalAlloc( + uFlags: UINT, + dwBytes: SIZE_T, + ) -> HGLOBAL; + pub fn GlobalReAlloc( + hMem: HGLOBAL, + dwBytes: SIZE_T, + uFlags: UINT, + ) -> HGLOBAL; + pub fn GlobalSize( + hMem: HGLOBAL, + ) -> SIZE_T; + pub fn GlobalFlags( + hMem: HGLOBAL, + ) -> UINT; + pub fn GlobalLock( + hMem: HGLOBAL, + ) -> LPVOID; + pub fn GlobalHandle( + pMem: LPCVOID, + ) -> HGLOBAL; + pub fn GlobalUnlock( + hMem: HGLOBAL, + ) -> BOOL; + pub fn GlobalFree( + hMem: HGLOBAL, + ) -> HGLOBAL; + pub fn GlobalCompact( + dwMinFree: DWORD, + ) -> SIZE_T; + pub fn GlobalFix( + hMem: HGLOBAL, + ); + pub fn GlobalUnfix( + hMem: HGLOBAL, + ); + pub fn GlobalWire( + hMem: HGLOBAL, + ) -> LPVOID; + pub fn GlobalUnWire( + hMem: HGLOBAL, + ) -> BOOL; + pub fn GlobalMemoryStatus( + lpBuffer: LPMEMORYSTATUS, + ); + pub fn LocalAlloc( + uFlags: UINT, + uBytes: SIZE_T, + ) -> HLOCAL; + pub fn LocalReAlloc( + hMem: HLOCAL, + uBytes: SIZE_T, + uFlags: UINT, + ) -> HLOCAL; + pub fn LocalLock( + hMem: HLOCAL, + ) -> LPVOID; + pub fn LocalHandle( + pMem: LPCVOID, + ) -> HLOCAL; + pub fn LocalUnlock( + hMem: HLOCAL, + ) -> BOOL; + pub fn LocalSize( + hMem: HLOCAL, + ) -> SIZE_T; + pub fn LocalFlags( + hMem: HLOCAL, + ) -> UINT; + pub fn LocalFree( + hMem: HLOCAL, + ) -> HLOCAL; + pub fn LocalShrink( + hMem: HLOCAL, + cbNewSize: UINT, + ) -> SIZE_T; + pub fn LocalCompact( + uMinFree: UINT, + ) -> SIZE_T; +} +// SCS_* +extern "system" { + pub fn GetBinaryTypeA( + lpApplicationName: LPCSTR, + lpBinaryType: LPDWORD, + ) -> BOOL; + pub fn GetBinaryTypeW( + lpApplicationName: LPCWSTR, + lpBinaryType: LPDWORD, + ) -> BOOL; + pub fn GetShortPathNameA( + lpszLongPath: LPCSTR, + lpszShortPath: LPSTR, + cchBuffer: DWORD, + ) -> DWORD; + pub fn GetLongPathNameTransactedA( + lpszShortPath: LPCSTR, + lpszLongPath: LPSTR, + cchBuffer: DWORD, + hTransaction: HANDLE, + ) -> DWORD; + pub fn GetLongPathNameTransactedW( + lpszShortPath: LPCWSTR, + lpszLongPath: LPWSTR, + cchBuffer: DWORD, + hTransaction: HANDLE, + ) -> DWORD; + pub fn GetProcessAffinityMask( + hProcess: HANDLE, + lpProcessAffinityMask: PDWORD_PTR, + lpSystemAffinityMask: PDWORD_PTR, + ) -> BOOL; + pub fn SetProcessAffinityMask( + hProcess: HANDLE, + dwProcessAffinityMask: DWORD, + ) -> BOOL; + pub fn GetProcessIoCounters( + hProcess: HANDLE, + lpIoCounters: PIO_COUNTERS, + ) -> BOOL; + pub fn GetProcessWorkingSetSize( + hProcess: HANDLE, + lpMinimumWorkingSetSize: PSIZE_T, + lpMaximumWorkingSetSize: PSIZE_T, + ) -> BOOL; + pub fn SetProcessWorkingSetSize( + hProcess: HANDLE, + dwMinimumWorkingSetSize: SIZE_T, + dwMaximumWorkingSetSize: SIZE_T, + ) -> BOOL; + pub fn FatalExit( + ExitCode: c_int, + ); + pub fn SetEnvironmentStringsA( + NewEnvironment: LPCH, + ) -> BOOL; + pub fn SwitchToFiber( + lpFiber: LPVOID, + ); + pub fn DeleteFiber( + lpFiber: LPVOID, + ); + pub fn ConvertFiberToThread() -> BOOL; + pub fn CreateFiberEx( + dwStackCommitSize: SIZE_T, + dwStackReserveSize: SIZE_T, + dwFlags: DWORD, + lpStartAddress: LPFIBER_START_ROUTINE, + lpParameter: LPVOID, + ) -> LPVOID; + pub fn ConvertThreadToFiberEx( + lpParameter: LPVOID, + dwFlags: DWORD, + ) -> LPVOID; + pub fn CreateFiber( + dwStackSize: SIZE_T, + lpStartAddress: LPFIBER_START_ROUTINE, + lpParameter: LPVOID, + ) -> LPVOID; + pub fn ConvertThreadToFiber( + lpParameter: LPVOID, + ) -> LPVOID; +} +pub type PUMS_CONTEXT = *mut c_void; +pub type PUMS_COMPLETION_LIST = *mut c_void; +pub type UMS_THREAD_INFO_CLASS = RTL_UMS_THREAD_INFO_CLASS; +pub type PUMS_THREAD_INFO_CLASS = *mut UMS_THREAD_INFO_CLASS; +pub type PUMS_SCHEDULER_ENTRY_POINT = PRTL_UMS_SCHEDULER_ENTRY_POINT; +STRUCT!{struct UMS_SCHEDULER_STARTUP_INFO { + UmsVersion: ULONG, + CompletionList: PUMS_COMPLETION_LIST, + SchedulerProc: PUMS_SCHEDULER_ENTRY_POINT, + SchedulerParam: PVOID, +}} +pub type PUMS_SCHEDULER_STARTUP_INFO = *mut UMS_SCHEDULER_STARTUP_INFO; +STRUCT!{struct UMS_SYSTEM_THREAD_INFORMATION { + UmsVersion: ULONG, + ThreadUmsFlags: ULONG, +}} +BITFIELD!{UMS_SYSTEM_THREAD_INFORMATION ThreadUmsFlags: ULONG [ + IsUmsSchedulerThread set_IsUmsSchedulerThread[0..1], + IsUmsWorkerThread set_IsUmsWorkerThread[1..2], +]} +pub type PUMS_SYSTEM_THREAD_INFORMATION = *mut UMS_SYSTEM_THREAD_INFORMATION; +extern "system" { + #[cfg(target_pointer_width = "64")] + pub fn CreateUmsCompletionList( + UmsCompletionList: *mut PUMS_COMPLETION_LIST, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn DequeueUmsCompletionListItems( + UmsCompletionList: PUMS_COMPLETION_LIST, + WaitTimeOut: DWORD, + UmsThreadList: *mut PUMS_CONTEXT, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn GetUmsCompletionListEvent( + UmsCompletionList: PUMS_COMPLETION_LIST, + UmsCompletionEvent: PHANDLE, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn ExecuteUmsThread( + UmsThread: PUMS_CONTEXT, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn UmsThreadYield( + SchedulerParam: PVOID, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn DeleteUmsCompletionList( + UmsCompletionList: PUMS_COMPLETION_LIST, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn GetCurrentUmsThread() -> PUMS_CONTEXT; + #[cfg(target_pointer_width = "64")] + pub fn GetNextUmsListItem( + UmsContext: PUMS_CONTEXT, + ) -> PUMS_CONTEXT; + #[cfg(target_pointer_width = "64")] + pub fn QueryUmsThreadInformation( + UmsThread: PUMS_CONTEXT, + UmsThreadInfoClass: UMS_THREAD_INFO_CLASS, + UmsThreadInformation: PVOID, + UmsThreadInformationLength: ULONG, + ReturnLength: PULONG, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn SetUmsThreadInformation( + UmsThread: PUMS_CONTEXT, + UmsThreadInfoClass: UMS_THREAD_INFO_CLASS, + UmsThreadInformation: PVOID, + UmsThreadInformationLength: ULONG, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn DeleteUmsThreadContext( + UmsThread: PUMS_CONTEXT, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn CreateUmsThreadContext( + lpUmsThread: *mut PUMS_CONTEXT, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn EnterUmsSchedulingMode( + SchedulerStartupInfo: PUMS_SCHEDULER_STARTUP_INFO, + ) -> BOOL; + #[cfg(target_pointer_width = "64")] + pub fn GetUmsSystemThreadInformation( + ThreadHandle: HANDLE, + SystemThreadInfo: PUMS_SYSTEM_THREAD_INFORMATION, + ) -> BOOL; + pub fn SetThreadAffinityMask( + hThread: HANDLE, + dwThreadAffinityMask: DWORD_PTR, + ) -> DWORD_PTR; + pub fn SetProcessDEPPolicy( + dwFlags: DWORD, + ) -> BOOL; + pub fn GetProcessDEPPolicy( + hProcess: HANDLE, + lpFlags: LPDWORD, + lpPermanent: PBOOL, + ) -> BOOL; + pub fn RequestWakeupLatency( + latency: LATENCY_TIME, + ) -> BOOL; + pub fn IsSystemResumeAutomatic() -> BOOL; + pub fn GetThreadSelectorEntry( + hThread: HANDLE, + dwSelector: DWORD, + lpSelectorEntry: LPLDT_ENTRY, + ) -> BOOL; + pub fn SetThreadExecutionState( + esFlags: EXECUTION_STATE, + ) -> EXECUTION_STATE; + pub fn PowerCreateRequest( + Context: PREASON_CONTEXT, + ) -> HANDLE; + pub fn PowerSetRequest( + PowerRequest: HANDLE, + RequestType: POWER_REQUEST_TYPE, + ) -> BOOL; + pub fn PowerClearRequest( + PowerRequest: HANDLE, + RequestType: POWER_REQUEST_TYPE, + ) -> BOOL; + pub fn RestoreLastError( + dwErrCode: DWORD, + ); +} +pub const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS: UCHAR = 0x1; +pub const FILE_SKIP_SET_EVENT_ON_HANDLE: UCHAR = 0x2; +extern "system" { + pub fn SetFileCompletionNotificationModes( + FileHandle: HANDLE, + Flags: UCHAR, + ) -> BOOL; +} +pub const SEM_FAILCRITICALERRORS: UINT = 0x0001; +pub const SEM_NOGPFAULTERRORBOX: UINT = 0x0002; +pub const SEM_NOALIGNMENTFAULTEXCEPT: UINT = 0x0004; +pub const SEM_NOOPENFILEERRORBOX: UINT = 0x8000; +extern "system" { + pub fn Wow64GetThreadContext( + hThread: HANDLE, + lpContext: PWOW64_CONTEXT, + ) -> BOOL; + pub fn Wow64SetThreadContext( + hThread: HANDLE, + lpContext: *const WOW64_CONTEXT, + ) -> BOOL; + pub fn Wow64GetThreadSelectorEntry( + hThread: HANDLE, + dwSelector: DWORD, + lpSelectorEntry: PWOW64_LDT_ENTRY, + ) -> BOOL; + pub fn Wow64SuspendThread( + hThread: HANDLE, + ) -> DWORD; + pub fn DebugSetProcessKillOnExit( + KillOnExit: BOOL, + ) -> BOOL; + pub fn DebugBreakProcess( + Process: HANDLE, + ) -> BOOL; + pub fn PulseEvent( + hEvent: HANDLE, + ) -> BOOL; + pub fn GlobalDeleteAtom( + nAtom: ATOM, + ) -> ATOM; + pub fn InitAtomTable( + nSize: DWORD, + ) -> BOOL; + pub fn DeleteAtom( + nAtom: ATOM, + ) -> ATOM; + pub fn SetHandleCount( + uNumber: UINT, + ) -> UINT; + pub fn RequestDeviceWakeup( + hDevice: HANDLE, + ) -> BOOL; + pub fn CancelDeviceWakeupRequest( + hDevice: HANDLE, + ) -> BOOL; + pub fn GetDevicePowerState( + hDevice: HANDLE, + pfOn: *mut BOOL, + ) -> BOOL; + pub fn SetMessageWaitingIndicator( + hMsgIndicator: HANDLE, + ulMsgCount: ULONG, + ) -> BOOL; + pub fn SetFileShortNameA( + hFile: HANDLE, + lpShortName: LPCSTR, + ) -> BOOL; + pub fn SetFileShortNameW( + hFile: HANDLE, + lpShortName: LPCWSTR, + ) -> BOOL; +} +pub const HANDLE_FLAG_INHERIT: DWORD = 0x00000001; +pub const HANDLE_FLAG_PROTECT_FROM_CLOSE: DWORD = 0x00000002; +extern "system" { + pub fn LoadModule( + lpModuleName: LPCSTR, + lpParameterBlock: LPVOID, + ) -> DWORD; + pub fn WinExec( + lpCmdLine: LPCSTR, + uCmdShow: UINT, + ) -> UINT; + // ClearCommBreak + // ClearCommError + // SetupComm + // EscapeCommFunction + // GetCommConfig + // GetCommMask + // GetCommProperties + // GetCommModemStatus + // GetCommState + // GetCommTimeouts + // PurgeComm + // SetCommBreak + // SetCommConfig + // SetCommMask + // SetCommState + // SetCommTimeouts + // TransmitCommChar + // WaitCommEvent + pub fn SetTapePosition( + hDevice: HANDLE, + dwPositionMethod: DWORD, + dwPartition: DWORD, + dwOffsetLow: DWORD, + dwOffsetHigh: DWORD, + bImmediate: BOOL, + ) -> DWORD; + pub fn GetTapePosition( + hDevice: HANDLE, + dwPositionType: DWORD, + lpdwPartition: LPDWORD, + lpdwOffsetLow: LPDWORD, + lpdwOffsetHigh: LPDWORD, + ) -> DWORD; + pub fn PrepareTape( + hDevice: HANDLE, + dwOperation: DWORD, + bImmediate: BOOL, + ) -> DWORD; + pub fn EraseTape( + hDevice: HANDLE, + dwEraseType: DWORD, + bImmediate: BOOL, + ) -> DWORD; + pub fn CreateTapePartition( + hDevice: HANDLE, + dwPartitionMethod: DWORD, + dwCount: DWORD, + dwSize: DWORD, + ) -> DWORD; + pub fn WriteTapemark( + hDevice: HANDLE, + dwTapemarkType: DWORD, + dwTapemarkCount: DWORD, + bImmediate: BOOL, + ) -> DWORD; + pub fn GetTapeStatus( + hDevice: HANDLE, + ) -> DWORD; + pub fn GetTapeParameters( + hDevice: HANDLE, + dwOperation: DWORD, + lpdwSize: LPDWORD, + lpTapeInformation: LPVOID, + ) -> DWORD; + pub fn SetTapeParameters( + hDevice: HANDLE, + dwOperation: DWORD, + lpTapeInformation: LPVOID, + ) -> DWORD; + pub fn MulDiv( + nNumber: c_int, + nNumerator: c_int, + nDenominator: c_int, + ) -> c_int; +} +ENUM!{enum DEP_SYSTEM_POLICY_TYPE { + DEPPolicyAlwaysOff = 0, + DEPPolicyAlwaysOn, + DEPPolicyOptIn, + DEPPolicyOptOut, + DEPTotalPolicyCount, +}} +extern "system" { + pub fn GetSystemDEPPolicy() -> DEP_SYSTEM_POLICY_TYPE; + pub fn GetSystemRegistryQuota( + pdwQuotaAllowed: PDWORD, + pdwQuotaUsed: PDWORD, + ) -> BOOL; + pub fn FileTimeToDosDateTime( + lpFileTime: *const FILETIME, + lpFatDate: LPWORD, + lpFatTime: LPWORD, + ) -> BOOL; + pub fn DosDateTimeToFileTime( + wFatDate: WORD, + wFatTime: WORD, + lpFileTime: LPFILETIME, + ) -> BOOL; + pub fn FormatMessageA( + dwFlags: DWORD, + lpSource: LPCVOID, + dwMessageId: DWORD, + dwLanguageId: DWORD, + lpBuffer: LPSTR, + nSize: DWORD, + Arguments: *mut va_list, + ) -> DWORD; + pub fn FormatMessageW( + dwFlags: DWORD, + lpSource: LPCVOID, + dwMessageId: DWORD, + dwLanguageId: DWORD, + lpBuffer: LPWSTR, + nSize: DWORD, + Arguments: *mut va_list, + ) -> DWORD; +} +pub const FORMAT_MESSAGE_IGNORE_INSERTS: DWORD = 0x00000200; +pub const FORMAT_MESSAGE_FROM_STRING: DWORD = 0x00000400; +pub const FORMAT_MESSAGE_FROM_HMODULE: DWORD = 0x00000800; +pub const FORMAT_MESSAGE_FROM_SYSTEM: DWORD = 0x00001000; +pub const FORMAT_MESSAGE_ARGUMENT_ARRAY: DWORD = 0x00002000; +pub const FORMAT_MESSAGE_MAX_WIDTH_MASK: DWORD = 0x000000FF; +pub const FORMAT_MESSAGE_ALLOCATE_BUFFER: DWORD = 0x00000100; +extern "system" { + pub fn CreateMailslotA( + lpName: LPCSTR, + nMaxMessageSize: DWORD, + lReadTimeout: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> HANDLE; + pub fn CreateMailslotW( + lpName: LPCWSTR, + nMaxMessageSize: DWORD, + lReadTimeout: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> HANDLE; + pub fn GetMailslotInfo( + hMailslot: HANDLE, + lpMaxMessageSize: LPDWORD, + lpNextSize: LPDWORD, + lpMessageCount: LPDWORD, + lpReadTimeout: LPDWORD, + ) -> BOOL; + pub fn SetMailslotInfo( + hMailslot: HANDLE, + lReadTimeout: DWORD, + ) -> BOOL; + // pub fn EncryptFileA(); + // pub fn EncryptFileW(); + // pub fn DecryptFileA(); + // pub fn DecryptFileW(); + // pub fn FileEncryptionStatusA(); + // pub fn FileEncryptionStatusW(); + // pub fn OpenEncryptedFileRawA(); + // pub fn OpenEncryptedFileRawW(); + // pub fn ReadEncryptedFileRaw(); + // pub fn WriteEncryptedFileRaw(); + // pub fn CloseEncryptedFileRaw(); + pub fn lstrcmpA( + lpString1: LPCSTR, + lpString2: LPCSTR, + ) -> c_int; + pub fn lstrcmpW( + lpString1: LPCWSTR, + lpString2: LPCWSTR, + ) -> c_int; + pub fn lstrcmpiA( + lpString1: LPCSTR, + lpString2: LPCSTR, + ) -> c_int; + pub fn lstrcmpiW( + lpString1: LPCWSTR, + lpString2: LPCWSTR, + ) -> c_int; + pub fn lstrcpynA( + lpString1: LPSTR, + lpString2: LPCSTR, + iMaxLength: c_int, + ) -> LPSTR; + pub fn lstrcpynW( + lpString1: LPWSTR, + lpString2: LPCWSTR, + iMaxLength: c_int, + ) -> LPWSTR; + pub fn lstrcpyA( + lpString1: LPSTR, + lpString2: LPCSTR, + ) -> LPSTR; + pub fn lstrcpyW( + lpString1: LPWSTR, + lpString2: LPCWSTR, + ) -> LPWSTR; + pub fn lstrcatA( + lpString1: LPSTR, + lpString2: LPCSTR, + ) -> LPSTR; + pub fn lstrcatW( + lpString1: LPWSTR, + lpString2: LPCWSTR, + ) -> LPWSTR; + pub fn lstrlenA( + lpString: LPCSTR, + ) -> c_int; + pub fn lstrlenW( + lpString: LPCWSTR, + ) -> c_int; + pub fn OpenFile( + lpFileName: LPCSTR, + lpReOpenBuff: LPOFSTRUCT, + uStyle: UINT, + ) -> HFILE; + pub fn _lopen( + lpPathName: LPCSTR, + iReadWrite: c_int, + ) -> HFILE; + pub fn _lcreat( + lpPathName: LPCSTR, + iAttrubute: c_int, + ) -> HFILE; + pub fn _lread( + hFile: HFILE, + lpBuffer: LPVOID, + uBytes: UINT, + ) -> UINT; + pub fn _lwrite( + hFile: HFILE, + lpBuffer: LPCCH, + uBytes: UINT, + ) -> UINT; + pub fn _hread( + hFile: HFILE, + lpBuffer: LPVOID, + lBytes: c_long, + ) -> c_long; + pub fn _hwrite( + hFile: HFILE, + lpBuffer: LPCCH, + lBytes: c_long, + ) -> c_long; + pub fn _lclose( + hFile: HFILE, + ) -> HFILE; + pub fn _llseek( + hFile: HFILE, + lOffset: LONG, + iOrigin: c_int, + ) -> LONG; + // pub fn IsTextUnicode(); + // pub fn SignalObjectAndWait(); + pub fn BackupRead( + hFile: HANDLE, + lpBuffer: LPBYTE, + nNumberOfBytesToRead: DWORD, + lpNumberOfBytesRead: LPDWORD, + bAbort: BOOL, + bProcessSecurity: BOOL, + lpContext: *mut LPVOID, + ) -> BOOL; + pub fn BackupSeek( + hFile: HANDLE, + dwLowBytesToSeek: DWORD, + dwHighBytesToSeek: DWORD, + lpdwLowByteSeeked: LPDWORD, + lpdwHighByteSeeked: LPDWORD, + lpContext: *mut LPVOID, + ) -> BOOL; + pub fn BackupWrite( + hFile: HANDLE, + lpBuffer: LPBYTE, + nNumberOfBytesToWrite: DWORD, + lpNumberOfBytesWritten: LPDWORD, + bAbort: BOOL, + bProcessSecurity: BOOL, + lpContext: *mut LPVOID, + ) -> BOOL; +} +//2886 +pub const STARTF_USESHOWWINDOW: DWORD = 0x00000001; +pub const STARTF_USESIZE: DWORD = 0x00000002; +pub const STARTF_USEPOSITION: DWORD = 0x00000004; +pub const STARTF_USECOUNTCHARS: DWORD = 0x00000008; +pub const STARTF_USEFILLATTRIBUTE: DWORD = 0x00000010; +pub const STARTF_RUNFULLSCREEN: DWORD = 0x00000020; +pub const STARTF_FORCEONFEEDBACK: DWORD = 0x00000040; +pub const STARTF_FORCEOFFFEEDBACK: DWORD = 0x00000080; +pub const STARTF_USESTDHANDLES: DWORD = 0x00000100; +pub const STARTF_USEHOTKEY: DWORD = 0x00000200; +pub const STARTF_TITLEISLINKNAME: DWORD = 0x00000800; +pub const STARTF_TITLEISAPPID: DWORD = 0x00001000; +pub const STARTF_PREVENTPINNING: DWORD = 0x00002000; +pub const STARTF_UNTRUSTEDSOURCE: DWORD = 0x00008000; +STRUCT!{struct STARTUPINFOEXA { + StartupInfo: STARTUPINFOA, + lpAttributeList: LPPROC_THREAD_ATTRIBUTE_LIST, +}} +pub type LPSTARTUPINFOEXA = *mut STARTUPINFOEXA; +STRUCT!{struct STARTUPINFOEXW { + StartupInfo: STARTUPINFOW, + lpAttributeList: LPPROC_THREAD_ATTRIBUTE_LIST, +}} +pub type LPSTARTUPINFOEXW = *mut STARTUPINFOEXW; +extern "system" { + pub fn OpenMutexA( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpName: LPCSTR, + ) -> HANDLE; + pub fn CreateSemaphoreA( + lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES, + lInitialCount: LONG, + lMaximumCount: LONG, + lpName: LPCSTR, + ) -> HANDLE; + pub fn OpenSemaphoreA( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpName: LPCSTR, + ) -> HANDLE; + pub fn CreateWaitableTimerA( + lpTimerAttributes: LPSECURITY_ATTRIBUTES, + bManualReset: BOOL, + lpTimerName: LPCSTR, + ) -> HANDLE; + pub fn OpenWaitableTimerA( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpTimerName: LPCSTR, + ) -> HANDLE; + pub fn CreateSemaphoreExA( + lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES, + lInitialCount: LONG, + lMaximumCount: LONG, + lpName: LPCSTR, + dwFlags: DWORD, + dwDesiredAccess: DWORD, + ) -> HANDLE; + pub fn CreateWaitableTimerExA( + lpTimerAttributes: LPSECURITY_ATTRIBUTES, + lpTimerName: LPCSTR, + dwFlags: DWORD, + dwDesiredAccess: DWORD, + ) -> HANDLE; + pub fn CreateFileMappingA( + hFile: HANDLE, + lpAttributes: LPSECURITY_ATTRIBUTES, + flProtect: DWORD, + dwMaximumSizeHigh: DWORD, + dwMaximumSizeLow: DWORD, + lpName: LPCSTR, + ) -> HANDLE; + pub fn CreateFileMappingNumaA( + hFile: HANDLE, + lpFileMappingAttributes: LPSECURITY_ATTRIBUTES, + flProtect: DWORD, + dwMaximumSizeHigh: DWORD, + dwMaximumSizeLow: DWORD, + lpName: LPCSTR, + nndPreferred: DWORD, + ) -> HANDLE; + pub fn OpenFileMappingA( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpName: LPCSTR, + ) -> HANDLE; + pub fn GetLogicalDriveStringsA( + nBufferLength: DWORD, + lpBuffer: LPSTR, + ) -> DWORD; + pub fn LoadPackagedLibrary( + lpwLibFileName: LPCWSTR, + Reserved: DWORD, + ) -> HMODULE; + pub fn QueryFullProcessImageNameA( + hProcess: HANDLE, + dwFlags: DWORD, + lpExeName: LPSTR, + lpdwSize: PDWORD, + ) -> BOOL; + pub fn QueryFullProcessImageNameW( + hProcess: HANDLE, + dwFlags: DWORD, + lpExeName: LPWSTR, + lpdwSize: PDWORD, + ) -> BOOL; +} +//3233 +extern "system" { + pub fn GetStartupInfoA( + lpStartupInfo: LPSTARTUPINFOA, + ); + pub fn GetFirmwareEnvironmentVariableA( + lpName: LPCSTR, + lpGuid: LPCSTR, + pBuffer: PVOID, + nSize: DWORD, + ) -> DWORD; + pub fn GetFirmwareEnvironmentVariableW( + lpName: LPCWSTR, + lpGuid: LPCWSTR, + pBuffer: PVOID, + nSize: DWORD, + ) -> DWORD; + pub fn GetFirmwareEnvironmentVariableExA( + lpName: LPCSTR, + lpGuid: LPCSTR, + pBuffer: PVOID, + nSize: DWORD, + pdwAttribubutes: PDWORD, + ) -> DWORD; + pub fn GetFirmwareEnvironmentVariableExW( + lpName: LPCWSTR, + lpGuid: LPCWSTR, + pBuffer: PVOID, + nSize: DWORD, + pdwAttribubutes: PDWORD, + ) -> DWORD; + pub fn SetFirmwareEnvironmentVariableA( + lpName: LPCSTR, + lpGuid: LPCSTR, + pValue: PVOID, + nSize: DWORD, + ) -> BOOL; + pub fn SetFirmwareEnvironmentVariableW( + lpName: LPCWSTR, + lpGuid: LPCWSTR, + pValue: PVOID, + nSize: DWORD, + ) -> BOOL; + pub fn SetFirmwareEnvironmentVariableExA( + lpName: LPCSTR, + lpGuid: LPCSTR, + pValue: PVOID, + nSize: DWORD, + dwAttributes: DWORD, + ) -> BOOL; + pub fn SetFirmwareEnvironmentVariableExW( + lpName: LPCWSTR, + lpGuid: LPCWSTR, + pValue: PVOID, + nSize: DWORD, + dwAttributes: DWORD, + ) -> BOOL; + pub fn GetFirmwareType( + FirmwareType: PFIRMWARE_TYPE, + ) -> BOOL; + pub fn IsNativeVhdBoot( + NativeVhdBoot: PBOOL, + ) -> BOOL; + pub fn FindResourceA( + hModule: HMODULE, + lpName: LPCSTR, + lpType: LPCSTR, + ) -> HRSRC; + pub fn FindResourceExA( + hModule: HMODULE, + lpName: LPCSTR, + lpType: LPCSTR, + wLanguage: WORD, + ) -> HRSRC; + pub fn EnumResourceTypesA( + hModule: HMODULE, + lpEnumFunc: ENUMRESTYPEPROCA, + lParam: LONG_PTR, + ) -> BOOL; + pub fn EnumResourceTypesW( + hModule: HMODULE, + lpEnumFunc: ENUMRESTYPEPROCW, + lParam: LONG_PTR, + ) -> BOOL; + pub fn EnumResourceNamesA( + hModule: HMODULE, + lpType: LPCSTR, + lpEnumFunc: ENUMRESNAMEPROCA, + lParam: LONG_PTR, + ) -> BOOL; + pub fn EnumResourceLanguagesA( + hModule: HMODULE, + lpType: LPCSTR, + lpName: LPCSTR, + lpEnumFunc: ENUMRESLANGPROCA, + lParam: LONG_PTR, + ) -> BOOL; + pub fn EnumResourceLanguagesW( + hModule: HMODULE, + lpType: LPCWSTR, + lpName: LPCWSTR, + lpEnumFunc: ENUMRESLANGPROCW, + lParam: LONG_PTR, + ) -> BOOL; + pub fn BeginUpdateResourceA( + pFileName: LPCSTR, + bDeleteExistingResources: BOOL, + ) -> HANDLE; + pub fn BeginUpdateResourceW( + pFileName: LPCWSTR, + bDeleteExistingResources: BOOL, + ) -> HANDLE; + pub fn UpdateResourceA( + hUpdate: HANDLE, + lpType: LPCSTR, + lpName: LPCSTR, + wLanguage: WORD, + lpData: LPVOID, + cb: DWORD, + ) -> BOOL; + pub fn UpdateResourceW( + hUpdate: HANDLE, + lpType: LPCWSTR, + lpName: LPCWSTR, + wLanguage: WORD, + lpData: LPVOID, + cb: DWORD, + ) -> BOOL; + pub fn EndUpdateResourceA( + hUpdate: HANDLE, + fDiscard: BOOL, + ) -> BOOL; + pub fn EndUpdateResourceW( + hUpdate: HANDLE, + fDiscard: BOOL, + ) -> BOOL; + pub fn GlobalAddAtomA( + lpString: LPCSTR, + ) -> ATOM; + pub fn GlobalAddAtomW( + lpString: LPCWSTR, + ) -> ATOM; + pub fn GlobalAddAtomExA( + lpString: LPCSTR, + Flags: DWORD, + ) -> ATOM; + pub fn GlobalAddAtomExW( + lpString: LPCWSTR, + Flags: DWORD, + ) -> ATOM; + pub fn GlobalFindAtomA( + lpString: LPCSTR, + ) -> ATOM; + pub fn GlobalFindAtomW( + lpString: LPCWSTR, + ) -> ATOM; + pub fn GlobalGetAtomNameA( + nAtom: ATOM, + lpBuffer: LPSTR, + nSize: c_int, + ) -> UINT; + pub fn GlobalGetAtomNameW( + nAtom: ATOM, + lpBuffer: LPWSTR, + nSize: c_int, + ) -> UINT; + pub fn AddAtomA( + lpString: LPCSTR, + ) -> ATOM; + pub fn AddAtomW( + lpString: LPCWSTR, + ) -> ATOM; + pub fn FindAtomA( + lpString: LPCSTR, + ) -> ATOM; + pub fn FindAtomW( + lpString: LPCWSTR, + ) -> ATOM; + pub fn GetAtomNameA( + nAtom: ATOM, + lpBuffer: LPSTR, + nSize: c_int, + ) -> UINT; + pub fn GetAtomNameW( + nAtom: ATOM, + lpBuffer: LPWSTR, + nSize: c_int, + ) -> UINT; + pub fn GetProfileIntA( + lpAppName: LPCSTR, + lpKeyName: LPCSTR, + nDefault: INT, + ) -> UINT; + pub fn GetProfileIntW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + nDefault: INT, + ) -> UINT; + pub fn GetProfileStringA( + lpAppName: LPCSTR, + lpKeyName: LPCSTR, + lpDefault: LPCSTR, + lpReturnedString: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetProfileStringW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + lpDefault: LPCWSTR, + lpReturnedString: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn WriteProfileStringA( + lpAppName: LPCSTR, + lpKeyName: LPCSTR, + lpString: LPCSTR, + ) -> BOOL; + pub fn WriteProfileStringW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + lpString: LPCWSTR, + ) -> BOOL; + pub fn GetProfileSectionA( + lpAppName: LPCSTR, + lpReturnedString: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetProfileSectionW( + lpAppName: LPCWSTR, + lpReturnedString: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn WriteProfileSectionA( + lpAppName: LPCSTR, + lpString: LPCSTR, + ) -> BOOL; + pub fn WriteProfileSectionW( + lpAppName: LPCWSTR, + lpString: LPCWSTR, + ) -> BOOL; + pub fn GetPrivateProfileIntA( + lpAppName: LPCSTR, + lpKeyName: LPCSTR, + nDefault: INT, + lpFileName: LPCSTR, + ) -> UINT; + pub fn GetPrivateProfileIntW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + nDefault: INT, + lpFileName: LPCWSTR, + ) -> UINT; + pub fn GetPrivateProfileStringA( + lpAppName: LPCSTR, + lpKeyName: LPCSTR, + lpDefault: LPCSTR, + lpReturnedString: LPSTR, + nSize: DWORD, + lpFileName: LPCSTR, + ) -> DWORD; + pub fn GetPrivateProfileStringW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + lpDefault: LPCWSTR, + lpReturnedString: LPWSTR, + nSize: DWORD, + lpFileName: LPCWSTR, + ) -> DWORD; + pub fn WritePrivateProfileStringA( + lpAppName: LPCSTR, + lpKeyName: LPCSTR, + lpString: LPCSTR, + lpFileName: LPCSTR, + ) -> BOOL; + pub fn WritePrivateProfileStringW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + lpString: LPCWSTR, + lpFileName: LPCWSTR, + ) -> BOOL; + pub fn GetPrivateProfileSectionA( + lpAppName: LPCSTR, + lpReturnedString: LPSTR, + nSize: DWORD, + lpFileName: LPCSTR, + ) -> DWORD; + pub fn GetPrivateProfileSectionW( + lpAppName: LPCWSTR, + lpReturnedString: LPWSTR, + nSize: DWORD, + lpFileName: LPCWSTR, + ) -> DWORD; + pub fn WritePrivateProfileSectionA( + lpAppName: LPCSTR, + lpString: LPCSTR, + lpFileName: LPCSTR, + ) -> BOOL; + pub fn WritePrivateProfileSectionW( + lpAppName: LPCWSTR, + lpString: LPCWSTR, + lpFileName: LPCWSTR, + ) -> BOOL; + pub fn GetPrivateProfileSectionNamesA( + lpszReturnBuffer: LPSTR, + nSize: DWORD, + lpFileName: LPCSTR, + ) -> DWORD; + pub fn GetPrivateProfileSectionNamesW( + lpszReturnBuffer: LPWSTR, + nSize: DWORD, + lpFileName: LPCWSTR, + ) -> DWORD; + pub fn GetPrivateProfileStructA( + lpszSection: LPCSTR, + lpszKey: LPCSTR, + lpStruct: LPVOID, + uSizeStruct: UINT, + szFile: LPCSTR, + ) -> BOOL; + pub fn GetPrivateProfileStructW( + lpszSection: LPCWSTR, + lpszKey: LPCWSTR, + lpStruct: LPVOID, + uSizeStruct: UINT, + szFile: LPCWSTR, + ) -> BOOL; + pub fn WritePrivateProfileStructA( + lpszSection: LPCSTR, + lpszKey: LPCSTR, + lpStruct: LPVOID, + uSizeStruct: UINT, + szFile: LPCSTR, + ) -> BOOL; + pub fn WritePrivateProfileStructW( + lpszSection: LPCWSTR, + lpszKey: LPCWSTR, + lpStruct: LPVOID, + uSizeStruct: UINT, + szFile: LPCWSTR, + ) -> BOOL; + pub fn Wow64EnableWow64FsRedirection( + Wow64FsEnableRedirection: BOOLEAN, + ) -> BOOLEAN; + pub fn SetDllDirectoryA( + lpPathName: LPCSTR, + ) -> BOOL; + pub fn SetDllDirectoryW( + lpPathName: LPCWSTR, + ) -> BOOL; + pub fn GetDllDirectoryA( + nBufferLength: DWORD, + lpBuffer: LPSTR, + ) -> DWORD; + pub fn GetDllDirectoryW( + nBufferLength: DWORD, + lpBuffer: LPWSTR, + ) -> DWORD; + pub fn SetSearchPathMode( + Flags: DWORD, + ) -> BOOL; + pub fn CreateDirectoryExA( + lpTemplateDirectory: LPCSTR, + lpNewDirectory: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> BOOL; + pub fn CreateDirectoryExW( + lpTemplateDirectory: LPCWSTR, + lpNewDirectory: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> BOOL; + pub fn CreateDirectoryTransactedA( + lpTemplateDirectory: LPCSTR, + lpNewDirectory: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + hTransaction: HANDLE, + ) -> BOOL; + pub fn CreateDirectoryTransactedW( + lpTemplateDirectory: LPCWSTR, + lpNewDirectory: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + hTransaction: HANDLE, + ) -> BOOL; + pub fn RemoveDirectoryTransactedA( + lpPathName: LPCSTR, + hTransaction: HANDLE, + ) -> BOOL; + pub fn RemoveDirectoryTransactedW( + lpPathName: LPCWSTR, + hTransaction: HANDLE, + ) -> BOOL; + pub fn GetFullPathNameTransactedA( + lpFileName: LPCSTR, + nBufferLength: DWORD, + lpBuffer: LPSTR, + lpFilePart: *mut LPSTR, + hTransaction: HANDLE, + ) -> DWORD; + pub fn GetFullPathNameTransactedW( + lpFileName: LPCWSTR, + nBufferLength: DWORD, + lpBuffer: LPWSTR, + lpFilePart: *mut LPWSTR, + hTransaction: HANDLE, + ); + pub fn DefineDosDeviceA( + dwFlags: DWORD, + lpDeviceName: LPCSTR, + lpTargetPath: LPCSTR, + ) -> BOOL; + pub fn QueryDosDeviceA( + lpDeviceName: LPCSTR, + lpTargetPath: LPSTR, + ucchMax: DWORD, + ) -> DWORD; + pub fn CreateFileTransactedA( + lpFileName: LPCSTR, + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + dwCreationDisposition: DWORD, + dwFlagsAndAttributes: DWORD, + hTemplateFile: HANDLE, + hTransaction: HANDLE, + pusMiniVersion: PUSHORT, + lpExtendedParameter: PVOID, + ) -> HANDLE; + pub fn CreateFileTransactedW( + lpFileName: LPCWSTR, + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + dwCreationDisposition: DWORD, + dwFlagsAndAttributes: DWORD, + hTemplateFile: HANDLE, + hTransaction: HANDLE, + pusMiniVersion: PUSHORT, + lpExtendedParameter: PVOID, + ) -> HANDLE; + pub fn ReOpenFile( + hOriginalFile: HANDLE, + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + dwFlags: DWORD, + ) -> HANDLE; + pub fn SetFileAttributesTransactedA( + lpFileName: LPCSTR, + dwFileAttributes: DWORD, + hTransaction: HANDLE, + ) -> BOOL; + pub fn SetFileAttributesTransactedW( + lpFileName: LPCWSTR, + dwFileAttributes: DWORD, + hTransaction: HANDLE, + ) -> BOOL; + pub fn GetFileAttributesTransactedA( + lpFileName: LPCSTR, + fInfoLevelId: GET_FILEEX_INFO_LEVELS, + lpFileInformation: LPVOID, + hTransaction: HANDLE, + ) -> BOOL; + pub fn GetFileAttributesTransactedW( + lpFileName: LPCWSTR, + fInfoLevelId: GET_FILEEX_INFO_LEVELS, + lpFileInformation: LPVOID, + hTransaction: HANDLE, + ) -> BOOL; + pub fn GetCompressedFileSizeTransactedA( + lpFileName: LPCSTR, + lpFileSizeHigh: LPDWORD, + hTransaction: HANDLE, + ) -> DWORD; + pub fn GetCompressedFileSizeTransactedW( + lpFileName: LPCWSTR, + lpFileSizeHigh: LPDWORD, + hTransaction: HANDLE, + ); + pub fn DeleteFileTransactedA( + lpFileName: LPCSTR, + hTransaction: HANDLE, + ) -> BOOL; + pub fn DeleteFileTransactedW( + lpFileName: LPCWSTR, + hTransaction: HANDLE, + ) -> BOOL; + pub fn CheckNameLegalDOS8Dot3A( + lpName: LPCSTR, + lpOemName: LPSTR, + OemNameSize: DWORD, + pbNameContainsSpaces: PBOOL, + pbNameLegal: PBOOL, + ) -> BOOL; + pub fn CheckNameLegalDOS8Dot3W( + lpName: LPCWSTR, + lpOemName: LPSTR, + OemNameSize: DWORD, + pbNameContainsSpaces: PBOOL, + pbNameLegal: PBOOL, + ) -> BOOL; + pub fn FindFirstFileTransactedA( + lpFileName: LPCSTR, + fInfoLevelId: FINDEX_INFO_LEVELS, + lpFindFileData: LPVOID, + fSearchOp: FINDEX_SEARCH_OPS, + lpSearchFilter: LPVOID, + dwAdditionalFlags: DWORD, + hTransaction: HANDLE, + ) -> HANDLE; + pub fn FindFirstFileTransactedW( + lpFileName: LPCWSTR, + fInfoLevelId: FINDEX_INFO_LEVELS, + lpFindFileData: LPVOID, + fSearchOp: FINDEX_SEARCH_OPS, + lpSearchFilter: LPVOID, + dwAdditionalFlags: DWORD, + hTransaction: HANDLE, + ) -> HANDLE; + pub fn CopyFileA( + lpExistingFileName: LPCSTR, + lpNewFileName: LPCSTR, + bFailIfExists: BOOL, + ) -> BOOL; + pub fn CopyFileW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + bFailIfExists: BOOL, + ) -> BOOL; +} +FN!{stdcall LPPROGRESS_ROUTINE( + TotalFileSize: LARGE_INTEGER, + TotalBytesTransferred: LARGE_INTEGER, + StreamSize: LARGE_INTEGER, + StreamBytesTransferred: LARGE_INTEGER, + dwStreamNumber: DWORD, + dwCallbackReason: DWORD, + hSourceFile: HANDLE, + hDestinationFile: HANDLE, + lpData: LPVOID, +) -> DWORD} +extern "system" { + pub fn CopyFileExA( + lpExistingFileName: LPCSTR, + lpNewFileName: LPCSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + pbCancel: LPBOOL, + dwCopyFlags: DWORD, + ) -> BOOL; + pub fn CopyFileExW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + pbCancel: LPBOOL, + dwCopyFlags: DWORD, + ) -> BOOL; + pub fn CopyFileTransactedA( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + pbCancel: LPBOOL, + dwCopyFlags: DWORD, + hTransaction: HANDLE, + ) -> BOOL; + pub fn CopyFileTransactedW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + pbCancel: LPBOOL, + dwCopyFlags: DWORD, + hTransaction: HANDLE, + ) -> BOOL; +} +ENUM!{enum COPYFILE2_MESSAGE_TYPE { + COPYFILE2_CALLBACK_NONE = 0, + COPYFILE2_CALLBACK_CHUNK_STARTED, + COPYFILE2_CALLBACK_CHUNK_FINISHED, + COPYFILE2_CALLBACK_STREAM_STARTED, + COPYFILE2_CALLBACK_STREAM_FINISHED, + COPYFILE2_CALLBACK_POLL_CONTINUE, + COPYFILE2_CALLBACK_ERROR, + COPYFILE2_CALLBACK_MAX, +}} +ENUM!{enum COPYFILE2_MESSAGE_ACTION { + COPYFILE2_PROGRESS_CONTINUE = 0, + COPYFILE2_PROGRESS_CANCEL, + COPYFILE2_PROGRESS_STOP, + COPYFILE2_PROGRESS_QUIET, + COPYFILE2_PROGRESS_PAUSE, +}} +ENUM!{enum COPYFILE2_COPY_PHASE { + COPYFILE2_PHASE_NONE = 0, + COPYFILE2_PHASE_PREPARE_SOURCE, + COPYFILE2_PHASE_PREPARE_DEST, + COPYFILE2_PHASE_READ_SOURCE, + COPYFILE2_PHASE_WRITE_DESTINATION, + COPYFILE2_PHASE_SERVER_COPY, + COPYFILE2_PHASE_NAMEGRAFT_COPY, + COPYFILE2_PHASE_MAX, +}} +STRUCT!{struct COPYFILE2_MESSAGE_ChunkStarted { + dwStreamNumber: DWORD, + dwReserved: DWORD, + hSourceFile: HANDLE, + hDestinationFile: HANDLE, + uliChunkNumber: ULARGE_INTEGER, + uliChunkSize: ULARGE_INTEGER, + uliStreamSize: ULARGE_INTEGER, + uliTotalFileSize: ULARGE_INTEGER, +}} +STRUCT!{struct COPYFILE2_MESSAGE_ChunkFinished { + dwStreamNumber: DWORD, + dwFlags: DWORD, + hSourceFile: HANDLE, + hDestinationFile: HANDLE, + uliChunkNumber: ULARGE_INTEGER, + uliChunkSize: ULARGE_INTEGER, + uliStreamSize: ULARGE_INTEGER, + uliStreamBytesTransferred: ULARGE_INTEGER, + uliTotalFileSize: ULARGE_INTEGER, + uliTotalBytesTransferred: ULARGE_INTEGER, +}} +STRUCT!{struct COPYFILE2_MESSAGE_StreamStarted { + dwStreamNumber: DWORD, + dwReserved: DWORD, + hSourceFile: HANDLE, + hDestinationFile: HANDLE, + uliStreamSize: ULARGE_INTEGER, + uliTotalFileSize: ULARGE_INTEGER, +}} +STRUCT!{struct COPYFILE2_MESSAGE_StreamFinished { + dwStreamNumber: DWORD, + dwReserved: DWORD, + hSourceFile: HANDLE, + hDestinationFile: HANDLE, + uliStreamSize: ULARGE_INTEGER, + uliStreamBytesTransferred: ULARGE_INTEGER, + uliTotalFileSize: ULARGE_INTEGER, + uliTotalBytesTransferred: ULARGE_INTEGER, +}} +STRUCT!{struct COPYFILE2_MESSAGE_PollContinue { + dwReserved: DWORD, +}} +STRUCT!{struct COPYFILE2_MESSAGE_Error { + CopyPhase: COPYFILE2_COPY_PHASE, + dwStreamNumber: DWORD, + hrFailure: HRESULT, + dwReserved: DWORD, + uliChunkNumber: ULARGE_INTEGER, + uliStreamSize: ULARGE_INTEGER, + uliStreamBytesTransferred: ULARGE_INTEGER, + uliTotalFileSize: ULARGE_INTEGER, + uliTotalBytesTransferred: ULARGE_INTEGER, +}} +UNION!{union COPYFILE2_MESSAGE_Info { + [u64; 8] [u64; 9], + ChunkStarted ChunkStarted_mut: COPYFILE2_MESSAGE_ChunkStarted, + ChunkFinished ChunkFinished_mut: COPYFILE2_MESSAGE_ChunkFinished, + StreamStarted StreamStarted_mut: COPYFILE2_MESSAGE_StreamStarted, + StreamFinished StreamFinished_mut: COPYFILE2_MESSAGE_StreamFinished, + PollContinue PollContinue_mut: COPYFILE2_MESSAGE_PollContinue, + Error Error_mut: COPYFILE2_MESSAGE_Error, +}} +STRUCT!{struct COPYFILE2_MESSAGE { + Type: COPYFILE2_MESSAGE_TYPE, + dwPadding: DWORD, + Info: COPYFILE2_MESSAGE_Info, +}} +FN!{stdcall PCOPYFILE2_PROGRESS_ROUTINE( + pMessage: *const COPYFILE2_MESSAGE, + pvCallbackContext: PVOID, +) -> COPYFILE2_MESSAGE_ACTION} +STRUCT!{struct COPYFILE2_EXTENDED_PARAMETERS { + dwSize: DWORD, + dwCopyFlags: DWORD, + pfCancel: *mut BOOL, + pProgressRoutine: PCOPYFILE2_PROGRESS_ROUTINE, + pvCallbackContext: PVOID, +}} +extern "system" { + pub fn CopyFile2( + pwszExistingFileName: PCWSTR, + pwszNewFileName: PCWSTR, + pExtendedParameters: *mut COPYFILE2_EXTENDED_PARAMETERS, + ) -> HRESULT; + pub fn MoveFileA( + lpExistingFileName: LPCSTR, + lpNewFileName: LPCSTR, + ) -> BOOL; + pub fn MoveFileW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + ) -> BOOL; + pub fn MoveFileExA( + lpExistingFileName: LPCSTR, + lpNewFileName: LPCSTR, + dwFlags: DWORD, + ) -> BOOL; + pub fn MoveFileExW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + dwFlags: DWORD, + ) -> BOOL; + pub fn MoveFileWithProgressA( + lpExistingFileName: LPCSTR, + lpNewFileName: LPCSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + dwFlags: DWORD, + ) -> BOOL; + pub fn MoveFileWithProgressW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + dwFlags: DWORD, + ) -> BOOL; + pub fn MoveFileTransactedA( + lpExistingFileName: LPCSTR, + lpNewFileName: LPCSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + dwFlags: DWORD, + hTransaction: HANDLE, + ) -> BOOL; + pub fn MoveFileTransactedW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + dwFlags: DWORD, + hTransaction: HANDLE, + ) -> BOOL; +} +pub const MOVEFILE_REPLACE_EXISTING: DWORD = 0x00000001; +pub const MOVEFILE_COPY_ALLOWED: DWORD = 0x00000002; +pub const MOVEFILE_DELAY_UNTIL_REBOOT: DWORD = 0x00000004; +pub const MOVEFILE_WRITE_THROUGH: DWORD = 0x00000008; +pub const MOVEFILE_CREATE_HARDLINK: DWORD = 0x00000010; +pub const MOVEFILE_FAIL_IF_NOT_TRACKABLE: DWORD = 0x00000020; +extern "system" { + pub fn ReplaceFileA( + lpReplacedFileName: LPCSTR, + lpReplacementFileName: LPCSTR, + lpBackupFileName: LPCSTR, + dwReplaceFlags: DWORD, + lpExclude: LPVOID, + lpReserved: LPVOID, + ); + pub fn ReplaceFileW( + lpReplacedFileName: LPCWSTR, + lpReplacementFileName: LPCWSTR, + lpBackupFileName: LPCWSTR, + dwReplaceFlags: DWORD, + lpExclude: LPVOID, + lpReserved: LPVOID, + ); + pub fn CreateHardLinkA( + lpFileName: LPCSTR, + lpExistingFileName: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> BOOL; + pub fn CreateHardLinkW( + lpFileName: LPCWSTR, + lpExistingFileName: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> BOOL; + pub fn CreateHardLinkTransactedA( + lpFileName: LPCSTR, + lpExistingFileName: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + hTransaction: HANDLE, + ) -> BOOL; + pub fn CreateHardLinkTransactedW( + lpFileName: LPCWSTR, + lpExistingFileName: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + hTransaction: HANDLE, + ); + pub fn FindFirstStreamTransactedW( + lpFileName: LPCWSTR, + InfoLevel: STREAM_INFO_LEVELS, + lpFindStreamData: LPVOID, + dwFlags: DWORD, + hTransaction: HANDLE, + ) -> HANDLE; + pub fn FindFirstFileNameTransactedW( + lpFileName: LPCWSTR, + dwFlags: DWORD, + StringLength: LPDWORD, + LinkName: PWSTR, + hTransaction: HANDLE, + ) -> HANDLE; + pub fn CreateNamedPipeA( + lpName: LPCSTR, + dwOpenMode: DWORD, + dwPipeMode: DWORD, + nMaxInstances: DWORD, + nOutBufferSize: DWORD, + nInBufferSize: DWORD, + nDefaultTimeOut: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> HANDLE; + pub fn GetNamedPipeHandleStateA( + hNamedPipe: HANDLE, + lpState: LPDWORD, + lpCurInstances: LPDWORD, + lpMaxCollectionCount: LPDWORD, + lpCollectDataTimeout: LPDWORD, + lpUserName: LPSTR, + nMaxUserNameSize: DWORD, + ) -> BOOL; + pub fn CallNamedPipeA( + lpNamedPipeName: LPCSTR, + lpInBuffer: LPVOID, + nInBufferSize: DWORD, + lpOutBuffer: LPVOID, + nOutBufferSize: DWORD, + lpBytesRead: LPDWORD, + nTimeOut: DWORD, + ) -> BOOL; + pub fn WaitNamedPipeA( + lpNamedPipeName: LPCSTR, + nTimeOut: DWORD, + ) -> BOOL; + pub fn GetNamedPipeClientComputerNameA( + Pipe: HANDLE, + ClientComputerName: LPSTR, + ClientComputerNameLength: ULONG, + ) -> BOOL; + pub fn GetNamedPipeClientProcessId( + Pipe: HANDLE, + ClientProcessId: PULONG, + ) -> BOOL; + pub fn GetNamedPipeClientSessionId( + Pipe: HANDLE, + ClientSessionId: PULONG, + ) -> BOOL; + pub fn GetNamedPipeServerProcessId( + Pipe: HANDLE, + ServerProcessId: PULONG, + ) -> BOOL; + pub fn GetNamedPipeServerSessionId( + Pipe: HANDLE, + ServerSessionId: PULONG, + ) -> BOOL; + pub fn SetVolumeLabelA( + lpRootPathName: LPCSTR, + lpVolumeName: LPCSTR, + ) -> BOOL; + pub fn SetVolumeLabelW( + lpRootPathName: LPCWSTR, + lpVolumeName: LPCWSTR, + ) -> BOOL; + pub fn SetFileBandwidthReservation( + hFile: HANDLE, + nPeriodMilliseconds: DWORD, + nBytesPerPeriod: DWORD, + bDiscardable: BOOL, + lpTransferSize: LPDWORD, + lpNumOutstandingRequests: LPDWORD, + ) -> BOOL; + pub fn GetFileBandwidthReservation( + hFile: HANDLE, + lpPeriodMilliseconds: LPDWORD, + lpBytesPerPeriod: LPDWORD, + pDiscardable: LPBOOL, + lpTransferSize: LPDWORD, + lpNumOutstandingRequests: LPDWORD, + ) -> BOOL; + // pub fn ClearEventLogA(); + // pub fn ClearEventLogW(); + // pub fn BackupEventLogA(); + // pub fn BackupEventLogW(); + // pub fn CloseEventLog(); + pub fn DeregisterEventSource( + hEventLog: HANDLE, + ) -> BOOL; + // pub fn NotifyChangeEventLog(); + // pub fn GetNumberOfEventLogRecords(); + // pub fn GetOldestEventLogRecord(); + // pub fn OpenEventLogA(); + // pub fn OpenEventLogW(); + pub fn RegisterEventSourceA( + lpUNCServerName: LPCSTR, + lpSourceName: LPCSTR, + ) -> HANDLE; + pub fn RegisterEventSourceW( + lpUNCServerName: LPCWSTR, + lpSourceName: LPCWSTR, + ) -> HANDLE; + // pub fn OpenBackupEventLogA(); + // pub fn OpenBackupEventLogW(); + // pub fn ReadEventLogA(); + // pub fn ReadEventLogW(); + pub fn ReportEventA( + hEventLog: HANDLE, + wType: WORD, + wCategory: WORD, + dwEventID: DWORD, + lpUserSid: PSID, + wNumStrings: WORD, + dwDataSize: DWORD, + lpStrings: *mut LPCSTR, + lpRawData: LPVOID, + ) -> BOOL; + pub fn ReportEventW( + hEventLog: HANDLE, + wType: WORD, + wCategory: WORD, + dwEventID: DWORD, + lpUserSid: PSID, + wNumStrings: WORD, + dwDataSize: DWORD, + lpStrings: *mut LPCWSTR, + lpRawData: LPVOID, + ) -> BOOL; + // pub fn GetEventLogInformation(); + // pub fn OperationStart(); + // pub fn OperationEnd(); + // pub fn AccessCheckAndAuditAlarmA(); + // pub fn AccessCheckByTypeAndAuditAlarmA(); + // pub fn AccessCheckByTypeResultListAndAuditAlarmA(); + // pub fn AccessCheckByTypeResultListAndAuditAlarmByHandleA(); + // pub fn ObjectOpenAuditAlarmA(); + // pub fn ObjectPrivilegeAuditAlarmA(); + // pub fn ObjectCloseAuditAlarmA(); + // pub fn ObjectDeleteAuditAlarmA(); + // pub fn PrivilegedServiceAuditAlarmA(); + // pub fn AddConditionalAce(); + // pub fn SetFileSecurityA(); + // pub fn GetFileSecurityA(); + pub fn ReadDirectoryChangesW( + hDirectory: HANDLE, + lpBuffer: LPVOID, + nBufferLength: DWORD, + bWatchSubtree: BOOL, + dwNotifyFilter: DWORD, + lpBytesReturned: LPDWORD, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE, + ) -> BOOL; + pub fn MapViewOfFileExNuma( + hFileMappingObject: HANDLE, + dwDesiredAccess: DWORD, + dwFileOffsetHigh: DWORD, + dwFileOffsetLow: DWORD, + dwNumberOfBytesToMap: SIZE_T, + lpBaseAddress: LPVOID, + nndPreferred: DWORD, + ) -> LPVOID; + pub fn IsBadReadPtr( + lp: *const VOID, + ucb: UINT_PTR, + ) -> BOOL; + pub fn IsBadWritePtr( + lp: LPVOID, + ucb: UINT_PTR, + ) -> BOOL; + pub fn IsBadHugeReadPtr( + lp: *const VOID, + ucb: UINT_PTR, + ) -> BOOL; + pub fn IsBadHugeWritePtr( + lp: LPVOID, + ucb: UINT_PTR, + ) -> BOOL; + pub fn IsBadCodePtr( + lpfn: FARPROC, + ) -> BOOL; + pub fn IsBadStringPtrA( + lpsz: LPCSTR, + ucchMax: UINT_PTR, + ) -> BOOL; + pub fn IsBadStringPtrW( + lpsz: LPCWSTR, + ucchMax: UINT_PTR, + ) -> BOOL; + pub fn LookupAccountSidA( + lpSystemName: LPCSTR, + Sid: PSID, + Name: LPSTR, + cchName: LPDWORD, + ReferencedDomainName: LPSTR, + cchReferencedDomainName: LPDWORD, + peUse: PSID_NAME_USE, + ) -> BOOL; + pub fn LookupAccountSidW( + lpSystemName: LPCWSTR, + Sid: PSID, + Name: LPWSTR, + cchName: LPDWORD, + ReferencedDomainName: LPWSTR, + cchReferencedDomainName: LPDWORD, + peUse: PSID_NAME_USE, + ) -> BOOL; + pub fn LookupAccountNameA( + lpSystemName: LPCSTR, + lpAccountName: LPCSTR, + Sid: PSID, + cbSid: LPDWORD, + ReferencedDomainName: LPCSTR, + cchReferencedDomainName: LPDWORD, + peUse: PSID_NAME_USE, + ) -> BOOL; + pub fn LookupAccountNameW( + lpSystemName: LPCWSTR, + lpAccountName: LPCWSTR, + Sid: PSID, + cbSid: LPDWORD, + ReferencedDomainName: LPCWSTR, + cchReferencedDomainName: LPDWORD, + peUse: PSID_NAME_USE, + ) -> BOOL; + // pub fn LookupAccountNameLocalA(); + // pub fn LookupAccountNameLocalW(); + // pub fn LookupAccountSidLocalA(); + // pub fn LookupAccountSidLocalW(); + pub fn LookupPrivilegeValueA( + lpSystemName: LPCSTR, + lpName: LPCSTR, + lpLuid: PLUID, + ) -> BOOL; + pub fn LookupPrivilegeValueW( + lpSystemName: LPCWSTR, + lpName: LPCWSTR, + lpLuid: PLUID, + ) -> BOOL; + pub fn LookupPrivilegeNameA( + lpSystemName: LPCSTR, + lpLuid: PLUID, + lpName: LPSTR, + cchName: LPDWORD, + ) -> BOOL; + pub fn LookupPrivilegeNameW( + lpSystemName: LPCWSTR, + lpLuid: PLUID, + lpName: LPWSTR, + cchName: LPDWORD, + ) -> BOOL; + // pub fn LookupPrivilegeDisplayNameA(); + // pub fn LookupPrivilegeDisplayNameW(); + pub fn BuildCommDCBA( + lpDef: LPCSTR, + lpDCB: LPDCB, + ) -> BOOL; + pub fn BuildCommDCBW( + lpDef: LPCWSTR, + lpDCB: LPDCB, + ) -> BOOL; + pub fn BuildCommDCBAndTimeoutsA( + lpDef: LPCSTR, + lpDCB: LPDCB, + lpCommTimeouts: LPCOMMTIMEOUTS, + ) -> BOOL; + pub fn BuildCommDCBAndTimeoutsW( + lpDef: LPCWSTR, + lpDCB: LPDCB, + lpCommTimeouts: LPCOMMTIMEOUTS, + ) -> BOOL; + pub fn CommConfigDialogA( + lpszName: LPCSTR, + hWnd: HWND, + lpCC: LPCOMMCONFIG, + ) -> BOOL; + pub fn CommConfigDialogW( + lpszName: LPCWSTR, + hWnd: HWND, + lpCC: LPCOMMCONFIG, + ) -> BOOL; + pub fn GetDefaultCommConfigA( + lpszName: LPCSTR, + lpCC: LPCOMMCONFIG, + lpdwSize: LPDWORD, + ) -> BOOL; + pub fn GetDefaultCommConfigW( + lpszName: LPCWSTR, + lpCC: LPCOMMCONFIG, + lpdwSize: LPDWORD, + ) -> BOOL; + pub fn SetDefaultCommConfigA( + lpszName: LPCSTR, + lpCC: LPCOMMCONFIG, + dwSize: DWORD, + ) -> BOOL; + pub fn SetDefaultCommConfigW( + lpszName: LPCWSTR, + lpCC: LPCOMMCONFIG, + dwSize: DWORD, + ) -> BOOL; + pub fn GetComputerNameA( + lpBuffer: LPSTR, + nSize: LPDWORD, + ) -> BOOL; + pub fn GetComputerNameW( + lpBuffer: LPWSTR, + nSize: LPDWORD, + ) -> BOOL; + pub fn DnsHostnameToComputerNameA( + Hostname: LPCSTR, + ComputerName: LPCSTR, + nSize: LPDWORD, + ) -> BOOL; + pub fn DnsHostnameToComputerNameW( + Hostname: LPCWSTR, + ComputerName: LPWSTR, + nSize: LPDWORD, + ) -> BOOL; + pub fn GetUserNameA( + lpBuffer: LPSTR, + pcbBuffer: LPDWORD, + ) -> BOOL; + pub fn GetUserNameW( + lpBuffer: LPWSTR, + pcbBuffer: LPDWORD, + ) -> BOOL; +} +pub const LOGON32_LOGON_INTERACTIVE: DWORD = 2; +pub const LOGON32_LOGON_NETWORK: DWORD = 3; +pub const LOGON32_LOGON_BATCH: DWORD = 4; +pub const LOGON32_LOGON_SERVICE: DWORD = 5; +pub const LOGON32_LOGON_UNLOCK: DWORD = 7; +pub const LOGON32_LOGON_NETWORK_CLEARTEXT: DWORD = 8; +pub const LOGON32_LOGON_NEW_CREDENTIALS: DWORD = 9; +pub const LOGON32_PROVIDER_DEFAULT: DWORD = 0; +pub const LOGON32_PROVIDER_WINNT35: DWORD = 1; +pub const LOGON32_PROVIDER_WINNT40: DWORD = 2; +pub const LOGON32_PROVIDER_WINNT50: DWORD = 3; +pub const LOGON32_PROVIDER_VIRTUAL: DWORD = 4; +extern "system" { + pub fn LogonUserA( + lpUsername: LPCSTR, + lpDomain: LPCSTR, + lpPassword: LPCSTR, + dwLogonType: DWORD, + dwLogonProvider: DWORD, + phToken: PHANDLE, + ) -> BOOL; + pub fn LogonUserW( + lpUsername: LPCWSTR, + lpDomain: LPCWSTR, + lpPassword: LPCWSTR, + dwLogonType: DWORD, + dwLogonProvider: DWORD, + phToken: PHANDLE, + ) -> BOOL; + pub fn LogonUserExA( + lpUsername: LPCSTR, + lpDomain: LPCSTR, + lpPassword: LPCSTR, + dwLogonType: DWORD, + dwLogonProvider: DWORD, + phToken: PHANDLE, + ppLogonSid: *mut PSID, + ppProfileBuffer: *mut PVOID, + pdwProfileLength: LPDWORD, + pQuotaLimits: PQUOTA_LIMITS, + ) -> BOOL; + pub fn LogonUserExW( + lpUsername: LPCWSTR, + lpDomain: LPCWSTR, + lpPassword: LPCWSTR, + dwLogonType: DWORD, + dwLogonProvider: DWORD, + phToken: PHANDLE, + ppLogonSid: *mut PSID, + ppProfileBuffer: *mut PVOID, + pdwProfileLength: LPDWORD, + pQuotaLimits: PQUOTA_LIMITS, + ) -> BOOL; +} +pub const LOGON_WITH_PROFILE: DWORD = 0x00000001; +pub const LOGON_NETCREDENTIALS_ONLY: DWORD = 0x00000002; +extern "system" { + pub fn CreateProcessWithLogonW( + lpUsername: LPCWSTR, + lpDomain: LPCWSTR, + lpPassword: LPCWSTR, + dwLogonFlags: DWORD, + lpApplicationName: LPCWSTR, + lpCommandLine: LPWSTR, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCWSTR, + lpStartupInfo: LPSTARTUPINFOW, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> BOOL; + pub fn CreateProcessWithTokenW( + hToken: HANDLE, + dwLogonFlags: DWORD, + lpApplicationName: LPCWSTR, + lpCommandLine: LPWSTR, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCWSTR, + lpStartupInfo: LPSTARTUPINFOW, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> BOOL; + pub fn IsTokenUntrusted( + TokenHandle: HANDLE, + ) -> BOOL; + pub fn RegisterWaitForSingleObject( + phNewWaitObject: PHANDLE, + hObject: HANDLE, + Callback: WAITORTIMERCALLBACK, + Context: PVOID, + dwMilliseconds: ULONG, + dwFlags: ULONG, + ) -> BOOL; + pub fn UnregisterWait( + WaitHandle: HANDLE, + ) -> BOOL; + pub fn BindIoCompletionCallback( + FileHandle: HANDLE, + Function: LPOVERLAPPED_COMPLETION_ROUTINE, + Flags: ULONG, + ) -> BOOL; + pub fn SetTimerQueueTimer( + TimerQueue: HANDLE, + Callback: WAITORTIMERCALLBACK, + Parameter: PVOID, + DueTime: DWORD, + Period: DWORD, + PreferIo: BOOL, + ) -> HANDLE; + pub fn CancelTimerQueueTimer( + TimerQueue: HANDLE, + Timer: HANDLE, + ) -> BOOL; + pub fn DeleteTimerQueue( + TimerQueue: HANDLE, + ) -> BOOL; + // pub fn InitializeThreadpoolEnvironment(); + // pub fn SetThreadpoolCallbackPool(); + // pub fn SetThreadpoolCallbackCleanupGroup(); + // pub fn SetThreadpoolCallbackRunsLong(); + // pub fn SetThreadpoolCallbackLibrary(); + // pub fn SetThreadpoolCallbackPriority(); + // pub fn DestroyThreadpoolEnvironment(); + // pub fn SetThreadpoolCallbackPersistent(); + pub fn CreatePrivateNamespaceA( + lpPrivateNamespaceAttributes: LPSECURITY_ATTRIBUTES, + lpBoundaryDescriptor: LPVOID, + lpAliasPrefix: LPCSTR, + ) -> HANDLE; + pub fn OpenPrivateNamespaceA( + lpBoundaryDescriptor: LPVOID, + lpAliasPrefix: LPCSTR, + ) -> HANDLE; + pub fn CreateBoundaryDescriptorA( + Name: LPCSTR, + Flags: ULONG, + ) -> HANDLE; + pub fn AddIntegrityLabelToBoundaryDescriptor( + BoundaryDescriptor: *mut HANDLE, + IntegrityLabel: PSID, + ) -> BOOL; +} +pub const HW_PROFILE_GUIDLEN: usize = 39; +// MAX_PROFILE_LEN +pub const DOCKINFO_UNDOCKED: DWORD = 0x1; +pub const DOCKINFO_DOCKED: DWORD = 0x2; +pub const DOCKINFO_USER_SUPPLIED: DWORD = 0x4; +pub const DOCKINFO_USER_UNDOCKED: DWORD = DOCKINFO_USER_SUPPLIED | DOCKINFO_UNDOCKED; +pub const DOCKINFO_USER_DOCKED: DWORD = DOCKINFO_USER_SUPPLIED | DOCKINFO_DOCKED; +STRUCT!{struct HW_PROFILE_INFOA { + dwDockInfo: DWORD, + szHwProfileGuid: [CHAR; HW_PROFILE_GUIDLEN], + szHwProfileName: [CHAR; MAX_PROFILE_LEN], +}} +pub type LPHW_PROFILE_INFOA = *mut HW_PROFILE_INFOA; +STRUCT!{struct HW_PROFILE_INFOW { + dwDockInfo: DWORD, + szHwProfileGuid: [WCHAR; HW_PROFILE_GUIDLEN], + szHwProfileName: [WCHAR; MAX_PROFILE_LEN], +}} +pub type LPHW_PROFILE_INFOW = *mut HW_PROFILE_INFOW; +extern "system" { + pub fn GetCurrentHwProfileA( + lpHwProfileInfo: LPHW_PROFILE_INFOA, + ) -> BOOL; + pub fn GetCurrentHwProfileW( + lpHwProfileInfo: LPHW_PROFILE_INFOW, + ) -> BOOL; + pub fn VerifyVersionInfoA( + lpVersionInformation: LPOSVERSIONINFOEXA, + dwTypeMask: DWORD, + dwlConditionMask: DWORDLONG, + ) -> BOOL; + pub fn VerifyVersionInfoW( + lpVersionInformation: LPOSVERSIONINFOEXW, + dwTypeMask: DWORD, + dwlConditionMask: DWORDLONG, + ) -> BOOL; +} +STRUCT!{struct SYSTEM_POWER_STATUS { + ACLineStatus: BYTE, + BatteryFlag: BYTE, + BatteryLifePercent: BYTE, + Reserved1: BYTE, + BatteryLifeTime: DWORD, + BatteryFullLifeTime: DWORD, +}} +pub type LPSYSTEM_POWER_STATUS = *mut SYSTEM_POWER_STATUS; +extern "system" { + pub fn GetSystemPowerStatus( + lpSystemPowerStatus: LPSYSTEM_POWER_STATUS, + ) -> BOOL; + pub fn SetSystemPowerState( + fSuspend: BOOL, + fForce: BOOL, + ) -> BOOL; + pub fn MapUserPhysicalPagesScatter( + VirtualAddresses: *mut PVOID, + NumberOfPages: ULONG_PTR, + PageArray: PULONG_PTR, + ) -> BOOL; + pub fn CreateJobObjectA( + lpJobAttributes: LPSECURITY_ATTRIBUTES, + lpName: LPCSTR, + ) -> HANDLE; + pub fn OpenJobObjectA( + dwDesiredAccess: DWORD, + bInheritHandle: BOOL, + lpName: LPCSTR, + ) -> HANDLE; + pub fn CreateJobSet( + NumJob: ULONG, + UserJobSet: PJOB_SET_ARRAY, + Flags: ULONG, + ) -> BOOL; + pub fn FindFirstVolumeA( + lpszVolumeName: LPSTR, + cchBufferLength: DWORD, + ) -> HANDLE; + pub fn FindNextVolumeA( + hFindVolume: HANDLE, + lpszVolumeName: LPSTR, + cchBufferLength: DWORD, + ) -> BOOL; + pub fn FindFirstVolumeMountPointA( + lpszRootPathName: LPCSTR, + lpszVolumeMountPoint: LPSTR, + cchBufferLength: DWORD, + ) -> HANDLE; + pub fn FindFirstVolumeMountPointW( + lpszRootPathName: LPCWSTR, + lpszVolumeMountPoint: LPWSTR, + cchBufferLength: DWORD, + ) -> HANDLE; + pub fn FindNextVolumeMountPointA( + hFindVolumeMountPoint: HANDLE, + lpszVolumeMountPoint: LPSTR, + cchBufferLength: DWORD, + ) -> BOOL; + pub fn FindNextVolumeMountPointW( + hFindVolumeMountPoint: HANDLE, + lpszVolumeMountPoint: LPWSTR, + cchBufferLength: DWORD, + ) -> BOOL; + pub fn FindVolumeMountPointClose( + hFindVolumeMountPoint: HANDLE, + ) -> BOOL; + pub fn SetVolumeMountPointA( + lpszVolumeMountPoint: LPCSTR, + lpszVolumeName: LPCSTR, + ) -> BOOL; + pub fn SetVolumeMountPointW( + lpszVolumeMountPoint: LPCWSTR, + lpszVolumeName: LPCWSTR, + ) -> BOOL; + pub fn DeleteVolumeMountPointA( + lpszVolumeMountPoint: LPCSTR, + ) -> BOOL; + pub fn GetVolumeNameForVolumeMountPointA( + lpszVolumeMountPoint: LPCSTR, + lpszVolumeName: LPSTR, + cchBufferLength: DWORD, + ) -> BOOL; + pub fn GetVolumePathNameA( + lpszFileName: LPCSTR, + lpszVolumePathName: LPSTR, + cchBufferLength: DWORD, + ) -> BOOL; + pub fn GetVolumePathNamesForVolumeNameA( + lpszVolumeName: LPCSTR, + lpszVolumePathNames: LPCH, + cchBufferLength: DWORD, + lpcchReturnLength: PDWORD, + ) -> BOOL; +} +// ACTCTX_FLAG_* +STRUCT!{struct ACTCTXA { + cbSize: ULONG, + dwFlags: DWORD, + lpSource: LPCSTR, + wProcessorArchitecture: USHORT, + wLangId: LANGID, + lpAssemblyDirectory: LPCSTR, + lpResourceName: LPCSTR, + lpApplicationName: LPCSTR, + hModule: HMODULE, +}} +pub type PACTCTXA = *mut ACTCTXA; +STRUCT!{struct ACTCTXW { + cbSize: ULONG, + dwFlags: DWORD, + lpSource: LPCWSTR, + wProcessorArchitecture: USHORT, + wLangId: LANGID, + lpAssemblyDirectory: LPCWSTR, + lpResourceName: LPCWSTR, + lpApplicationName: LPCWSTR, + hModule: HMODULE, +}} +pub type PACTCTXW = *mut ACTCTXW; +pub type PCACTCTXA = *const ACTCTXA; +pub type PCACTCTXW = *const ACTCTXW; +extern "system" { + pub fn CreateActCtxA( + pActCtx: PCACTCTXA, + ) -> HANDLE; + pub fn CreateActCtxW( + pActCtx: PCACTCTXW, + ) -> HANDLE; + pub fn AddRefActCtx( + hActCtx: HANDLE, + ); + pub fn ReleaseActCtx( + hActCtx: HANDLE, + ); + pub fn ZombifyActCtx( + hActCtx: HANDLE, + ) -> BOOL; + pub fn ActivateActCtx( + hActCtx: HANDLE, + lpCookie: *mut ULONG_PTR, + ) -> BOOL; + pub fn DeactivateActCtx( + dwFlags: DWORD, + ulCookie: ULONG_PTR, + ) -> BOOL; + pub fn GetCurrentActCtx( + lphActCtx: *mut HANDLE, + ) -> BOOL; +} +STRUCT!{struct ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA { + lpInformation: PVOID, + lpSectionBase: PVOID, + ulSectionLength: ULONG, + lpSectionGlobalDataBase: PVOID, + ulSectionGlobalDataLength: ULONG, +}} +pub type PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = + *mut ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA; +pub type PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = + *const ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA; +STRUCT!{struct ACTCTX_SECTION_KEYED_DATA { + cbSize: ULONG, + ulDataFormatVersion: ULONG, + lpData: PVOID, + ulLength: ULONG, + lpSectionGlobalData: PVOID, + ulSectionGlobalDataLength: ULONG, + lpSectionBase: PVOID, + ulSectionTotalLength: ULONG, + hActCtx: HANDLE, + ulAssemblyRosterIndex: ULONG, + ulFlags: ULONG, + AssemblyMetadata: ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, +}} +pub type PACTCTX_SECTION_KEYED_DATA = *mut ACTCTX_SECTION_KEYED_DATA; +pub type PCACTCTX_SECTION_KEYED_DATA = *const ACTCTX_SECTION_KEYED_DATA; +extern "system" { + pub fn FindActCtxSectionStringA( + dwFlags: DWORD, + lpExtensionGuid: *const GUID, + ulSectionId: ULONG, + lpStringToFind: LPCSTR, + ReturnedData: PACTCTX_SECTION_KEYED_DATA, + ) -> BOOL; + pub fn FindActCtxSectionStringW( + dwFlags: DWORD, + lpExtensionGuid: *const GUID, + ulSectionId: ULONG, + lpStringToFind: LPCWSTR, + ReturnedData: PACTCTX_SECTION_KEYED_DATA, + ) -> BOOL; + pub fn FindActCtxSectionGuid( + dwFlags: DWORD, + lpExtensionGuid: *const GUID, + ulSectionId: ULONG, + lpGuidToFind: *const GUID, + ReturnedData: PACTCTX_SECTION_KEYED_DATA, + ) -> BOOL; + pub fn QueryActCtxW( + dwFlags: DWORD, + hActCtx: HANDLE, + pvSubInstance: PVOID, + ulInfoClass: ULONG, + pvBuffer: PVOID, + cbBuffer: SIZE_T, + pcbWrittenOrRequired: *mut SIZE_T, + ) -> BOOL; + pub fn WTSGetActiveConsoleSessionId() -> DWORD; + // pub fn WTSGetServiceSessionId(); + // pub fn WTSIsServerContainer(); + pub fn GetActiveProcessorGroupCount() -> WORD; + pub fn GetMaximumProcessorGroupCount() -> WORD; + pub fn GetActiveProcessorCount( + GroupNumber: WORD, + ) -> DWORD; + pub fn GetMaximumProcessorCount( + GroupNumber: WORD, + ) -> DWORD; + pub fn GetNumaProcessorNode( + Processor: UCHAR, + NodeNumber: PUCHAR, + ) -> BOOL; + pub fn GetNumaNodeNumberFromHandle( + hFile: HANDLE, + NodeNumber: PUSHORT, + ) -> BOOL; + pub fn GetNumaProcessorNodeEx( + Processor: PPROCESSOR_NUMBER, + NodeNumber: PUSHORT, + ) -> BOOL; + pub fn GetNumaNodeProcessorMask( + Node: UCHAR, + ProcessorMask: PULONGLONG, + ) -> BOOL; + pub fn GetNumaAvailableMemoryNode( + Node: UCHAR, + AvailableBytes: PULONGLONG, + ) -> BOOL; + pub fn GetNumaAvailableMemoryNodeEx( + Node: USHORT, + AvailableBytes: PULONGLONG, + ) -> BOOL; + pub fn GetNumaProximityNode( + ProximityId: ULONG, + NodeNumber: PUCHAR, + ) -> BOOL; +} +FN!{stdcall APPLICATION_RECOVERY_CALLBACK( + pvParameter: PVOID, +) -> DWORD} +// RESTART_* +// RECOVERY_* +extern "system" { + pub fn RegisterApplicationRecoveryCallback( + pRecoveyCallback: APPLICATION_RECOVERY_CALLBACK, + pvParameter: PVOID, + dwPingInterval: DWORD, + dwFlags: DWORD, + ) -> HRESULT; + pub fn UnregisterApplicationRecoveryCallback() -> HRESULT; + pub fn RegisterApplicationRestart( + pwzCommandline: PCWSTR, + dwFlags: DWORD, + ) -> HRESULT; + pub fn UnregisterApplicationRestart() -> HRESULT; + pub fn GetApplicationRecoveryCallback( + hProcess: HANDLE, + pRecoveryCallback: *mut APPLICATION_RECOVERY_CALLBACK, + ppvParameter: *mut PVOID, + pdwPingInterval: PDWORD, + pdwFlags: PDWORD, + ) -> HRESULT; + pub fn GetApplicationRestartSettings( + hProcess: HANDLE, + pwzCommandline: PWSTR, + pcchSize: PDWORD, + pdwFlags: PDWORD, + ) -> HRESULT; + pub fn ApplicationRecoveryInProgress( + pbCancelled: PBOOL, + ) -> HRESULT; + pub fn ApplicationRecoveryFinished( + bSuccess: BOOL, + ); +} +// FILE_BASIC_INFO, etc. +extern "system" { + pub fn GetFileInformationByHandleEx( + hFile: HANDLE, + FileInformationClass: FILE_INFO_BY_HANDLE_CLASS, + lpFileInformation: LPVOID, + dwBufferSize: DWORD, + ) -> BOOL; +} +ENUM!{enum FILE_ID_TYPE { + FileIdType, + ObjectIdType, + ExtendedFileIdType, + MaximumFileIdType, +}} +UNION!{union FILE_ID_DESCRIPTOR_u { + [u64; 2], + FileId FileId_mut: LARGE_INTEGER, + ObjectId ObjectId_mut: GUID, + ExtendedFileId ExtendedFileId_mut: FILE_ID_128, +}} +STRUCT!{struct FILE_ID_DESCRIPTOR { + dwSize: DWORD, + Type: FILE_ID_TYPE, + u: FILE_ID_DESCRIPTOR_u, +}} +pub type LPFILE_ID_DESCRIPTOR = *mut FILE_ID_DESCRIPTOR; +extern "system" { + pub fn OpenFileById( + hVolumeHint: HANDLE, + lpFileId: LPFILE_ID_DESCRIPTOR, + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + dwFlagsAndAttributes: DWORD, + ) -> HANDLE; + pub fn CreateSymbolicLinkA( + lpSymlinkFileName: LPCSTR, + lpTargetFileName: LPCSTR, + dwFlags: DWORD, + ) -> BOOLEAN; + pub fn CreateSymbolicLinkW( + lpSymlinkFileName: LPCWSTR, + lpTargetFileName: LPCWSTR, + dwFlags: DWORD, + ) -> BOOLEAN; + pub fn QueryActCtxSettingsW( + dwFlags: DWORD, + hActCtx: HANDLE, + settingsNameSpace: PCWSTR, + settingName: PCWSTR, + pvBuffer: PWSTR, + dwBuffer: SIZE_T, + pdwWrittenOrRequired: *mut SIZE_T, + ) -> BOOL; + pub fn CreateSymbolicLinkTransactedA( + lpSymlinkFileName: LPCSTR, + lpTargetFileName: LPCSTR, + dwFlags: DWORD, + hTransaction: HANDLE, + ) -> BOOLEAN; + pub fn CreateSymbolicLinkTransactedW( + lpSymlinkFileName: LPCWSTR, + lpTargetFileName: LPCWSTR, + dwFlags: DWORD, + hTransaction: HANDLE, + ) -> BOOLEAN; + pub fn ReplacePartitionUnit( + TargetPartition: PWSTR, + SparePartition: PWSTR, + Flags: ULONG, + ) -> BOOL; + pub fn AddSecureMemoryCacheCallback( + pfnCallBack: PSECURE_MEMORY_CACHE_CALLBACK, + ) -> BOOL; + pub fn RemoveSecureMemoryCacheCallback( + pfnCallBack: PSECURE_MEMORY_CACHE_CALLBACK, + ) -> BOOL; + pub fn CopyContext( + Destination: PCONTEXT, + ContextFlags: DWORD, + Source: PCONTEXT, + ) -> BOOL; + pub fn InitializeContext( + Buffer: PVOID, + ContextFlags: DWORD, + Context: *mut PCONTEXT, + ContextLength: PDWORD, + ) -> BOOL; + pub fn GetEnabledXStateFeatures() -> DWORD64; + pub fn GetXStateFeaturesMask( + Context: PCONTEXT, + FeatureMask: PDWORD64, + ) -> BOOL; + #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] + pub fn LocateXStateFeature( + Context: PCONTEXT, + FeatureId: DWORD, + Length: PDWORD, + ) -> PVOID; + #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] + pub fn SetXStateFeaturesMask( + Context: PCONTEXT, + FeatureMask: DWORD64, + ) -> BOOL; + pub fn EnableThreadProfiling( + ThreadHandle: HANDLE, + Flags: DWORD, + HardwareCounters: DWORD64, + PerformanceDataHandle: *mut HANDLE, + ) -> BOOL; + pub fn DisableThreadProfiling( + PerformanceDataHandle: HANDLE, + ) -> DWORD; + pub fn QueryThreadProfiling( + ThreadHandle: HANDLE, + Enabled: PBOOLEAN, + ) -> DWORD; + pub fn ReadThreadProfilingData( + PerformanceDataHandle: HANDLE, + Flags: DWORD, + PerformanceData: PPERFORMANCE_DATA, + ) -> DWORD; + // intrinsic InterlockedIncrement + // intrinsic InterlockedDecrement + // intrinsic InterlockedExchange + // intrinsic InterlockedExchangeAdd + // intrinsic InterlockedExchangeSubtract + // intrinsic InterlockedCompareExchange + // intrinsic InterlockedAnd + // intrinsic InterlockedOr + // intrinsic InterlockedXor +} diff --git a/bash-5.1/vendor/winapi/src/um/wincodec.rs b/bash-5.1/vendor/winapi/src/um/wincodec.rs new file mode 100644 index 0000000000000000000000000000000000000000..dbe8a44563c8afdf49e8772c5338545fbcb6687b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wincodec.rs @@ -0,0 +1,1861 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Mappings for the contents of wincodec.h +use ctypes::c_double; +use shared::basetsd::{UINT32, ULONG_PTR}; +use shared::dxgiformat::DXGI_FORMAT; +use shared::dxgitype::{ + DXGI_JPEG_AC_HUFFMAN_TABLE, DXGI_JPEG_DC_HUFFMAN_TABLE, + DXGI_JPEG_QUANTIZATION_TABLE +}; +use shared::guiddef::{CLSID, GUID, REFCLSID, REFGUID}; +use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT, INT, LPVOID, UINT, ULONG}; +use shared::ntdef::{LPCWSTR, LPWSTR, PCWSTR, WCHAR}; +use shared::windef::{HBITMAP, HICON, HPALETTE}; +use shared::winerror::{ + E_ABORT, E_ACCESSDENIED, E_FAIL, E_INVALIDARG, E_NOTIMPL, E_OUTOFMEMORY, HRESULT, + SEVERITY_ERROR +}; +use um::d2d1::ID2D1Image; +use um::d2d1_1::ID2D1Device; +use um::dcommon::D2D1_PIXEL_FORMAT; +use um::objidlbase::{IEnumString, IEnumUnknown, IStream, IStreamVtbl}; +use um::ocidl::IPropertyBag2; +use um::propidl::PROPVARIANT; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HANDLE, ULARGE_INTEGER}; +DEFINE_GUID!{CLSID_WICImagingFactory, + 0xcacaf262, 0x9370, 0x4615, 0xa1, 0x3b, 0x9f, 0x55, 0x39, 0xda, 0x4c, 0xa} +DEFINE_GUID!{CLSID_WICImagingFactory1, + 0xcacaf262, 0x9370, 0x4615, 0xa1, 0x3b, 0x9f, 0x55, 0x39, 0xda, 0x4c, 0xa} +DEFINE_GUID!{CLSID_WICImagingFactory2, + 0x317d06e8, 0x5f24, 0x433d, 0xbd, 0xf7, 0x79, 0xce, 0x68, 0xd8, 0xab, 0xc2} +DEFINE_GUID!{GUID_VendorMicrosoft, + 0xf0e749ca, 0xedef, 0x4589, 0xa7, 0x3a, 0xee, 0xe, 0x62, 0x6a, 0x2a, 0x2b} +DEFINE_GUID!{GUID_VendorMicrosoftBuiltIn, + 0x257a30fd, 0x6b6, 0x462b, 0xae, 0xa4, 0x63, 0xf7, 0xb, 0x86, 0xe5, 0x33} +DEFINE_GUID!{CLSID_WICPngDecoder, + 0x389ea17b, 0x5078, 0x4cde, 0xb6, 0xef, 0x25, 0xc1, 0x51, 0x75, 0xc7, 0x51} +DEFINE_GUID!{CLSID_WICPngDecoder1, + 0x389ea17b, 0x5078, 0x4cde, 0xb6, 0xef, 0x25, 0xc1, 0x51, 0x75, 0xc7, 0x51} +DEFINE_GUID!{CLSID_WICPngDecoder2, + 0xe018945b, 0xaa86, 0x4008, 0x9b, 0xd4, 0x67, 0x77, 0xa1, 0xe4, 0x0c, 0x11} +DEFINE_GUID!{CLSID_WICBmpDecoder, + 0x6b462062, 0x7cbf, 0x400d, 0x9f, 0xdb, 0x81, 0x3d, 0xd1, 0x0f, 0x27, 0x78} +DEFINE_GUID!{CLSID_WICIcoDecoder, + 0xc61bfcdf, 0x2e0f, 0x4aad, 0xa8, 0xd7, 0xe0, 0x6b, 0xaf, 0xeb, 0xcd, 0xfe} +DEFINE_GUID!{CLSID_WICJpegDecoder, + 0x9456a480, 0xe88b, 0x43ea, 0x9e, 0x73, 0x0b, 0x2d, 0x9b, 0x71, 0xb1, 0xca} +DEFINE_GUID!{CLSID_WICGifDecoder, + 0x381dda3c, 0x9ce9, 0x4834, 0xa2, 0x3e, 0x1f, 0x98, 0xf8, 0xfc, 0x52, 0xbe} +DEFINE_GUID!{CLSID_WICTiffDecoder, + 0xb54e85d9, 0xfe23, 0x499f, 0x8b, 0x88, 0x6a, 0xce, 0xa7, 0x13, 0x75, 0x2b} +DEFINE_GUID!{CLSID_WICWmpDecoder, + 0xa26cec36, 0x234c, 0x4950, 0xae, 0x16, 0xe3, 0x4a, 0xac, 0xe7, 0x1d, 0x0d} +DEFINE_GUID!{CLSID_WICDdsDecoder, + 0x9053699f, 0xa341, 0x429d, 0x9e, 0x90, 0xee, 0x43, 0x7c, 0xf8, 0x0c, 0x73} +DEFINE_GUID!{CLSID_WICBmpEncoder, + 0x69be8bb4, 0xd66d, 0x47c8, 0x86, 0x5a, 0xed, 0x15, 0x89, 0x43, 0x37, 0x82} +DEFINE_GUID!{CLSID_WICPngEncoder, + 0x27949969, 0x876a, 0x41d7, 0x94, 0x47, 0x56, 0x8f, 0x6a, 0x35, 0xa4, 0xdc} +DEFINE_GUID!{CLSID_WICJpegEncoder, + 0x1a34f5c1, 0x4a5a, 0x46dc, 0xb6, 0x44, 0x1f, 0x45, 0x67, 0xe7, 0xa6, 0x76} +DEFINE_GUID!{CLSID_WICGifEncoder, + 0x114f5598, 0x0b22, 0x40a0, 0x86, 0xa1, 0xc8, 0x3e, 0xa4, 0x95, 0xad, 0xbd} +DEFINE_GUID!{CLSID_WICTiffEncoder, + 0x0131be10, 0x2001, 0x4c5f, 0xa9, 0xb0, 0xcc, 0x88, 0xfa, 0xb6, 0x4c, 0xe8} +DEFINE_GUID!{CLSID_WICWmpEncoder, + 0xac4ce3cb, 0xe1c1, 0x44cd, 0x82, 0x15, 0x5a, 0x16, 0x65, 0x50, 0x9e, 0xc2} +DEFINE_GUID!{CLSID_WICDdsEncoder, + 0xa61dde94, 0x66ce, 0x4ac1, 0x88, 0x1b, 0x71, 0x68, 0x05, 0x88, 0x89, 0x5e} +DEFINE_GUID!{CLSID_WICAdngDecoder, + 0x981d9411, 0x909e, 0x42a7, 0x8f, 0x5d, 0xa7, 0x47, 0xff, 0x05, 0x2e, 0xdb} +DEFINE_GUID!{CLSID_WICJpegQualcommPhoneEncoder, + 0x68ed5c62, 0xf534, 0x4979, 0xb2, 0xb3, 0x68, 0x6a, 0x12, 0xb2, 0xb3, 0x4c} +DEFINE_GUID!{GUID_ContainerFormatBmp, + 0x0af1d87e, 0xfcfe, 0x4188, 0xbd, 0xeb, 0xa7, 0x90, 0x64, 0x71, 0xcb, 0xe3} +DEFINE_GUID!{GUID_ContainerFormatPng, + 0x1b7cfaf4, 0x713f, 0x473c, 0xbb, 0xcd, 0x61, 0x37, 0x42, 0x5f, 0xae, 0xaf} +DEFINE_GUID!{GUID_ContainerFormatIco, + 0xa3a860c4, 0x338f, 0x4c17, 0x91, 0x9a, 0xfb, 0xa4, 0xb5, 0x62, 0x8f, 0x21} +DEFINE_GUID!{GUID_ContainerFormatJpeg, + 0x19e4a5aa, 0x5662, 0x4fc5, 0xa0, 0xc0, 0x17, 0x58, 0x02, 0x8e, 0x10, 0x57} +DEFINE_GUID!{GUID_ContainerFormatTiff, + 0x163bcc30, 0xe2e9, 0x4f0b, 0x96, 0x1d, 0xa3, 0xe9, 0xfd, 0xb7, 0x88, 0xa3} +DEFINE_GUID!{GUID_ContainerFormatGif, + 0x1f8a5601, 0x7d4d, 0x4cbd, 0x9c, 0x82, 0x1b, 0xc8, 0xd4, 0xee, 0xb9, 0xa5} +DEFINE_GUID!{GUID_ContainerFormatWmp, + 0x57a37caa, 0x367a, 0x4540, 0x91, 0x6b, 0xf1, 0x83, 0xc5, 0x09, 0x3a, 0x4b} +DEFINE_GUID!{GUID_ContainerFormatDds, + 0x9967cb95, 0x2e85, 0x4ac8, 0x8c, 0xa2, 0x83, 0xd7, 0xcc, 0xd4, 0x25, 0xc9} +DEFINE_GUID!{GUID_ContainerFormatAdng, + 0xf3ff6d0d, 0x38c0, 0x41c4, 0xb1, 0xfe, 0x1f, 0x38, 0x24, 0xf1, 0x7b, 0x84} +DEFINE_GUID!{CLSID_WICImagingCategories, + 0xfae3d380, 0xfea4, 0x4623, 0x8c, 0x75, 0xc6, 0xb6, 0x11, 0x10, 0xb6, 0x81} +DEFINE_GUID!{CATID_WICBitmapDecoders, + 0x7ed96837, 0x96f0, 0x4812, 0xb2, 0x11, 0xf1, 0x3c, 0x24, 0x11, 0x7e, 0xd3} +DEFINE_GUID!{CATID_WICBitmapEncoders, + 0xac757296, 0x3522, 0x4e11, 0x98, 0x62, 0xc1, 0x7b, 0xe5, 0xa1, 0x76, 0x7e} +DEFINE_GUID!{CATID_WICPixelFormats, + 0x2b46e70f, 0xcda7, 0x473e, 0x89, 0xf6, 0xdc, 0x96, 0x30, 0xa2, 0x39, 0x0b} +DEFINE_GUID!{CATID_WICFormatConverters, + 0x7835eae8, 0xbf14, 0x49d1, 0x93, 0xce, 0x53, 0x3a, 0x40, 0x7b, 0x22, 0x48} +DEFINE_GUID!{CATID_WICMetadataReader, + 0x05af94d8, 0x7174, 0x4cd2, 0xbe, 0x4a, 0x41, 0x24, 0xb8, 0x0e, 0xe4, 0xb8} +DEFINE_GUID!{CATID_WICMetadataWriter, + 0xabe3b9a4, 0x257d, 0x4b97, 0xbd, 0x1a, 0x29, 0x4a, 0xf4, 0x96, 0x22, 0x2e} +DEFINE_GUID!{CLSID_WICDefaultFormatConverter, + 0x1a3f11dc, 0xb514, 0x4b17, 0x8c, 0x5f, 0x21, 0x54, 0x51, 0x38, 0x52, 0xf1} +DEFINE_GUID!{CLSID_WICFormatConverterHighColor, + 0xac75d454, 0x9f37, 0x48f8, 0xb9, 0x72, 0x4e, 0x19, 0xbc, 0x85, 0x60, 0x11} +DEFINE_GUID!{CLSID_WICFormatConverterNChannel, + 0xc17cabb2, 0xd4a3, 0x47d7, 0xa5, 0x57, 0x33, 0x9b, 0x2e, 0xfb, 0xd4, 0xf1} +DEFINE_GUID!{CLSID_WICFormatConverterWMPhoto, + 0x9cb5172b, 0xd600, 0x46ba, 0xab, 0x77, 0x77, 0xbb, 0x7e, 0x3a, 0x00, 0xd9} +DEFINE_GUID!{CLSID_WICPlanarFormatConverter, + 0x184132b8, 0x32f8, 0x4784, 0x91, 0x31, 0xdd, 0x72, 0x24, 0xb2, 0x34, 0x38} +pub type WICColor = UINT32; +STRUCT!{struct WICRect { + X: INT, + Y: INT, + Width: INT, + Height: INT, +}} +pub type WICInProcPointer = *mut BYTE; +ENUM!{enum WICColorContextType { + WICColorContextUninitialized = 0x00000000, + WICColorContextProfile = 0x00000001, + WICColorContextExifColorSpace = 0x00000002, +}} +pub const CODEC_FORCE_DWORD: DWORD = 0x7FFFFFFF; +pub const WIC_JPEG_MAX_COMPONENT_COUNT: UINT = 4; +pub const WIC_JPEG_MAX_TABLE_INDEX: UINT = 3; +pub const WIC_JPEG_SAMPLE_FACTORS_ONE: DWORD = 0x00000011; +pub const WIC_JPEG_SAMPLE_FACTORS_THREE_420: DWORD = 0x00111122; +pub const WIC_JPEG_SAMPLE_FACTORS_THREE_422: DWORD = 0x00111121; +pub const WIC_JPEG_SAMPLE_FACTORS_THREE_440: DWORD = 0x00111112; +pub const WIC_JPEG_SAMPLE_FACTORS_THREE_444: DWORD = 0x00111111; +pub const WIC_JPEG_QUANTIZATION_BASELINE_ONE: DWORD = 0x00000000; +pub const WIC_JPEG_QUANTIZATION_BASELINE_THREE: DWORD = 0x00010100; +pub const WIC_JPEG_HUFFMAN_BASELINE_ONE: DWORD = 0x00000000; +pub const WIC_JPEG_HUFFMAN_BASELINE_THREE: DWORD = 0x00111100; +pub type REFWICPixelFormatGUID = REFGUID; +pub type WICPixelFormatGUID = GUID; +DEFINE_GUID!{GUID_WICPixelFormatDontCare, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x00} +DEFINE_GUID!{GUID_WICPixelFormat1bppIndexed, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x01} +DEFINE_GUID!{GUID_WICPixelFormat2bppIndexed, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x02} +DEFINE_GUID!{GUID_WICPixelFormat4bppIndexed, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x03} +DEFINE_GUID!{GUID_WICPixelFormat8bppIndexed, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x04} +DEFINE_GUID!{GUID_WICPixelFormatBlackWhite, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x05} +DEFINE_GUID!{GUID_WICPixelFormat2bppGray, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x06} +DEFINE_GUID!{GUID_WICPixelFormat4bppGray, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x07} +DEFINE_GUID!{GUID_WICPixelFormat8bppGray, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x08} +DEFINE_GUID!{GUID_WICPixelFormat8bppAlpha, + 0xe6cd0116, 0xeeba, 0x4161, 0xaa, 0x85, 0x27, 0xdd, 0x9f, 0xb3, 0xa8, 0x95} +DEFINE_GUID!{GUID_WICPixelFormat16bppBGR555, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x09} +DEFINE_GUID!{GUID_WICPixelFormat16bppBGR565, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0a} +DEFINE_GUID!{GUID_WICPixelFormat16bppBGRA5551, + 0x05ec7c2b, 0xf1e6, 0x4961, 0xad, 0x46, 0xe1, 0xcc, 0x81, 0x0a, 0x87, 0xd2} +DEFINE_GUID!{GUID_WICPixelFormat16bppGray, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0b} +DEFINE_GUID!{GUID_WICPixelFormat24bppBGR, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0c} +DEFINE_GUID!{GUID_WICPixelFormat24bppRGB, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0d} +DEFINE_GUID!{GUID_WICPixelFormat32bppBGR, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0e} +DEFINE_GUID!{GUID_WICPixelFormat32bppBGRA, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0f} +DEFINE_GUID!{GUID_WICPixelFormat32bppPBGRA, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x10} +DEFINE_GUID!{GUID_WICPixelFormat32bppGrayFloat, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x11} +DEFINE_GUID!{GUID_WICPixelFormat32bppRGB, + 0xd98c6b95, 0x3efe, 0x47d6, 0xbb, 0x25, 0xeb, 0x17, 0x48, 0xab, 0x0c, 0xf1} +DEFINE_GUID!{GUID_WICPixelFormat32bppRGBA, + 0xf5c7ad2d, 0x6a8d, 0x43dd, 0xa7, 0xa8, 0xa2, 0x99, 0x35, 0x26, 0x1a, 0xe9} +DEFINE_GUID!{GUID_WICPixelFormat32bppPRGBA, + 0x3cc4a650, 0xa527, 0x4d37, 0xa9, 0x16, 0x31, 0x42, 0xc7, 0xeb, 0xed, 0xba} +DEFINE_GUID!{GUID_WICPixelFormat48bppRGB, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x15} +DEFINE_GUID!{GUID_WICPixelFormat48bppBGR, + 0xe605a384, 0xb468, 0x46ce, 0xbb, 0x2e, 0x36, 0xf1, 0x80, 0xe6, 0x43, 0x13} +DEFINE_GUID!{GUID_WICPixelFormat64bppRGB, + 0xa1182111, 0x186d, 0x4d42, 0xbc, 0x6a, 0x9c, 0x83, 0x03, 0xa8, 0xdf, 0xf9} +DEFINE_GUID!{GUID_WICPixelFormat64bppRGBA, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x16} +DEFINE_GUID!{GUID_WICPixelFormat64bppBGRA, + 0x1562ff7c, 0xd352, 0x46f9, 0x97, 0x9e, 0x42, 0x97, 0x6b, 0x79, 0x22, 0x46} +DEFINE_GUID!{GUID_WICPixelFormat64bppPRGBA, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x17} +DEFINE_GUID!{GUID_WICPixelFormat64bppPBGRA, + 0x8c518e8e, 0xa4ec, 0x468b, 0xae, 0x70, 0xc9, 0xa3, 0x5a, 0x9c, 0x55, 0x30} +DEFINE_GUID!{GUID_WICPixelFormat16bppGrayFixedPoint, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x13} +DEFINE_GUID!{GUID_WICPixelFormat32bppBGR101010, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x14} +DEFINE_GUID!{GUID_WICPixelFormat48bppRGBFixedPoint, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x12} +DEFINE_GUID!{GUID_WICPixelFormat48bppBGRFixedPoint, + 0x49ca140e, 0xcab6, 0x493b, 0x9d, 0xdf, 0x60, 0x18, 0x7c, 0x37, 0x53, 0x2a} +DEFINE_GUID!{GUID_WICPixelFormat96bppRGBFixedPoint, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x18} +DEFINE_GUID!{GUID_WICPixelFormat96bppRGBFloat, + 0xe3fed78f, 0xe8db, 0x4acf, 0x84, 0xc1, 0xe9, 0x7f, 0x61, 0x36, 0xb3, 0x27} +DEFINE_GUID!{GUID_WICPixelFormat128bppRGBAFloat, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x19} +DEFINE_GUID!{GUID_WICPixelFormat128bppPRGBAFloat, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1a} +DEFINE_GUID!{GUID_WICPixelFormat128bppRGBFloat, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1b} +DEFINE_GUID!{GUID_WICPixelFormat32bppCMYK, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1c} +DEFINE_GUID!{GUID_WICPixelFormat64bppRGBAFixedPoint, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1d} +DEFINE_GUID!{GUID_WICPixelFormat64bppBGRAFixedPoint, + 0x356de33c, 0x54d2, 0x4a23, 0xbb, 0x4, 0x9b, 0x7b, 0xf9, 0xb1, 0xd4, 0x2d} +DEFINE_GUID!{GUID_WICPixelFormat64bppRGBFixedPoint, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x40} +DEFINE_GUID!{GUID_WICPixelFormat128bppRGBAFixedPoint, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1e} +DEFINE_GUID!{GUID_WICPixelFormat128bppRGBFixedPoint, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x41} +DEFINE_GUID!{GUID_WICPixelFormat64bppRGBAHalf, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3a} +DEFINE_GUID!{GUID_WICPixelFormat64bppPRGBAHalf, + 0x58ad26c2, 0xc623, 0x4d9d, 0xb3, 0x20, 0x38, 0x7e, 0x49, 0xf8, 0xc4, 0x42} +DEFINE_GUID!{GUID_WICPixelFormat64bppRGBHalf, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x42} +DEFINE_GUID!{GUID_WICPixelFormat48bppRGBHalf, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3b} +DEFINE_GUID!{GUID_WICPixelFormat32bppRGBE, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3d} +DEFINE_GUID!{GUID_WICPixelFormat16bppGrayHalf, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3e} +DEFINE_GUID!{GUID_WICPixelFormat32bppGrayFixedPoint, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3f} +DEFINE_GUID!{GUID_WICPixelFormat32bppRGBA1010102, + 0x25238D72, 0xFCF9, 0x4522, 0xb5, 0x14, 0x55, 0x78, 0xe5, 0xad, 0x55, 0xe0} +DEFINE_GUID!{GUID_WICPixelFormat32bppRGBA1010102XR, + 0x00DE6B9A, 0xC101, 0x434b, 0xb5, 0x02, 0xd0, 0x16, 0x5e, 0xe1, 0x12, 0x2c} +DEFINE_GUID!{GUID_WICPixelFormat64bppCMYK, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1f} +DEFINE_GUID!{GUID_WICPixelFormat24bpp3Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x20} +DEFINE_GUID!{GUID_WICPixelFormat32bpp4Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x21} +DEFINE_GUID!{GUID_WICPixelFormat40bpp5Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x22} +DEFINE_GUID!{GUID_WICPixelFormat48bpp6Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x23} +DEFINE_GUID!{GUID_WICPixelFormat56bpp7Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x24} +DEFINE_GUID!{GUID_WICPixelFormat64bpp8Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x25} +DEFINE_GUID!{GUID_WICPixelFormat48bpp3Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x26} +DEFINE_GUID!{GUID_WICPixelFormat64bpp4Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x27} +DEFINE_GUID!{GUID_WICPixelFormat80bpp5Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x28} +DEFINE_GUID!{GUID_WICPixelFormat96bpp6Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x29} +DEFINE_GUID!{GUID_WICPixelFormat112bpp7Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2a} +DEFINE_GUID!{GUID_WICPixelFormat128bpp8Channels, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2b} +DEFINE_GUID!{GUID_WICPixelFormat40bppCMYKAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2c} +DEFINE_GUID!{GUID_WICPixelFormat80bppCMYKAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2d} +DEFINE_GUID!{GUID_WICPixelFormat32bpp3ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2e} +DEFINE_GUID!{GUID_WICPixelFormat40bpp4ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2f} +DEFINE_GUID!{GUID_WICPixelFormat48bpp5ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x30} +DEFINE_GUID!{GUID_WICPixelFormat56bpp6ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x31} +DEFINE_GUID!{GUID_WICPixelFormat64bpp7ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x32} +DEFINE_GUID!{GUID_WICPixelFormat72bpp8ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x33} +DEFINE_GUID!{GUID_WICPixelFormat64bpp3ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x34} +DEFINE_GUID!{GUID_WICPixelFormat80bpp4ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x35} +DEFINE_GUID!{GUID_WICPixelFormat96bpp5ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x36} +DEFINE_GUID!{GUID_WICPixelFormat112bpp6ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x37} +DEFINE_GUID!{GUID_WICPixelFormat128bpp7ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x38} +DEFINE_GUID!{GUID_WICPixelFormat144bpp8ChannelsAlpha, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x39} +DEFINE_GUID!{GUID_WICPixelFormat8bppY, + 0x91B4DB54, 0x2DF9, 0x42F0, 0xB4, 0x49, 0x29, 0x09, 0xBB, 0x3D, 0xF8, 0x8E} +DEFINE_GUID!{GUID_WICPixelFormat8bppCb, + 0x1339F224, 0x6BFE, 0x4C3E, 0x93, 0x02, 0xE4, 0xF3, 0xA6, 0xD0, 0xCA, 0x2A} +DEFINE_GUID!{GUID_WICPixelFormat8bppCr, + 0xB8145053, 0x2116, 0x49F0, 0x88, 0x35, 0xED, 0x84, 0x4B, 0x20, 0x5C, 0x51} +DEFINE_GUID!{GUID_WICPixelFormat16bppCbCr, + 0xFF95BA6E, 0x11E0, 0x4263, 0xBB, 0x45, 0x01, 0x72, 0x1F, 0x34, 0x60, 0xA4} +DEFINE_GUID!{GUID_WICPixelFormat16bppYQuantizedDctCoefficients, + 0xA355F433, 0x48E8, 0x4A42, 0x84, 0xD8, 0xE2, 0xAA, 0x26, 0xCA, 0x80, 0xA4} +DEFINE_GUID!{GUID_WICPixelFormat16bppCbQuantizedDctCoefficients, + 0xD2C4FF61, 0x56A5, 0x49C2, 0x8B, 0x5C, 0x4C, 0x19, 0x25, 0x96, 0x48, 0x37} +DEFINE_GUID!{GUID_WICPixelFormat16bppCrQuantizedDctCoefficients, + 0x2FE354F0, 0x1680, 0x42D8, 0x92, 0x31, 0xE7, 0x3C, 0x05, 0x65, 0xBF, 0xC1} +ENUM!{enum WICBitmapCreateCacheOption { + WICBitmapNoCache = 0x00000000, + WICBitmapCacheOnDemand = 0x00000001, + WICBitmapCacheOnLoad = 0x00000002, + WICBITMAPCREATECACHEOPTION_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICDecodeOptions { + WICDecodeMetadataCacheOnDemand = 0x00000000, + WICDecodeMetadataCacheOnLoad = 0x00000001, + WICMETADATACACHEOPTION_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICBitmapEncoderCacheOption { + WICBitmapEncoderCacheInMemory = 0x00000000, + WICBitmapEncoderCacheTempFile = 0x00000001, + WICBitmapEncoderNoCache = 0x00000002, + WICBITMAPENCODERCACHEOPTION_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICComponentType { + WICDecoder = 0x00000001, + WICEncoder = 0x00000002, + WICPixelFormatConverter = 0x00000004, + WICMetadataReader = 0x00000008, + WICMetadataWriter = 0x00000010, + WICPixelFormat = 0x00000020, + WICAllComponents = 0x0000003F, + WICCOMPONENTTYPE_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICComponentEnumerateOptions { + WICComponentEnumerateDefault = 0x00000000, + WICComponentEnumerateRefresh = 0x00000001, + WICComponentEnumerateDisabled = 0x80000000, + WICComponentEnumerateUnsigned = 0x40000000, + WICComponentEnumerateBuiltInOnly = 0x20000000, + WICCOMPONENTENUMERATEOPTIONS_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +STRUCT!{struct WICBitmapPattern { + Position: ULARGE_INTEGER, + Length: ULONG, + Pattern: *mut BYTE, + Mask: *mut BYTE, + EndOfStream: BOOL, +}} +ENUM!{enum WICBitmapInterpolationMode { + WICBitmapInterpolationModeNearestNeighbor = 0x00000000, + WICBitmapInterpolationModeLinear = 0x00000001, + WICBitmapInterpolationModeCubic = 0x00000002, + WICBitmapInterpolationModeFant = 0x00000003, + WICBitmapInterpolationModeHighQualityCubic = 0x00000004, + WICBITMAPINTERPOLATIONMODE_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICBitmapPaletteType { + WICBitmapPaletteTypeCustom = 0x00000000, + WICBitmapPaletteTypeMedianCut = 0x00000001, + WICBitmapPaletteTypeFixedBW = 0x00000002, + WICBitmapPaletteTypeFixedHalftone8 = 0x00000003, + WICBitmapPaletteTypeFixedHalftone27 = 0x00000004, + WICBitmapPaletteTypeFixedHalftone64 = 0x00000005, + WICBitmapPaletteTypeFixedHalftone125 = 0x00000006, + WICBitmapPaletteTypeFixedHalftone216 = 0x00000007, + WICBitmapPaletteTypeFixedWebPalette = WICBitmapPaletteTypeFixedHalftone216, + WICBitmapPaletteTypeFixedHalftone252 = 0x00000008, + WICBitmapPaletteTypeFixedHalftone256 = 0x00000009, + WICBitmapPaletteTypeFixedGray4 = 0x0000000A, + WICBitmapPaletteTypeFixedGray16 = 0x0000000B, + WICBitmapPaletteTypeFixedGray256 = 0x0000000C, + WICBITMAPPALETTETYPE_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICBitmapDitherType { + WICBitmapDitherTypeNone = 0x00000000, + WICBitmapDitherTypeSolid = 0x00000000, + WICBitmapDitherTypeOrdered4x4 = 0x00000001, + WICBitmapDitherTypeOrdered8x8 = 0x00000002, + WICBitmapDitherTypeOrdered16x16 = 0x00000003, + WICBitmapDitherTypeSpiral4x4 = 0x00000004, + WICBitmapDitherTypeSpiral8x8 = 0x00000005, + WICBitmapDitherTypeDualSpiral4x4 = 0x00000006, + WICBitmapDitherTypeDualSpiral8x8 = 0x00000007, + WICBitmapDitherTypeErrorDiffusion = 0x00000008, + WICBITMAPDITHERTYPE_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICBitmapAlphaChannelOption { + WICBitmapUseAlpha = 0x00000000, + WICBitmapUsePremultipliedAlpha = 0x00000001, + WICBitmapIgnoreAlpha = 0x00000002, + WICBITMAPALPHACHANNELOPTIONS_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICBitmapTransformOptions { + WICBitmapTransformRotate0 = 0x00000000, + WICBitmapTransformRotate90 = 0x00000001, + WICBitmapTransformRotate180 = 0x00000002, + WICBitmapTransformRotate270 = 0x00000003, + WICBitmapTransformFlipHorizontal = 0x00000008, + WICBitmapTransformFlipVertical = 0x00000010, + WICBITMAPTRANSFORMOPTIONS_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICBitmapLockFlags { + WICBitmapLockRead = 0x00000001, + WICBitmapLockWrite = 0x00000002, + WICBITMAPLOCKFLAGS_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICBitmapDecoderCapabilities { + WICBitmapDecoderCapabilitySameEncoder = 0x00000001, + WICBitmapDecoderCapabilityCanDecodeAllImages = 0x00000002, + WICBitmapDecoderCapabilityCanDecodeSomeImages = 0x00000004, + WICBitmapDecoderCapabilityCanEnumerateMetadata = 0x00000008, + WICBitmapDecoderCapabilityCanDecodeThumbnail = 0x00000010, + WICBITMAPDECODERCAPABILITIES_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICProgressOperation { + WICProgressOperationCopyPixels = 0x00000001, + WICProgressOperationWritePixels = 0x00000002, + WICProgressOperationAll = 0x0000FFFF, + WICPROGRESSOPERATION_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICProgressNotification { + WICProgressNotificationBegin = 0x00010000, + WICProgressNotificationEnd = 0x00020000, + WICProgressNotificationFrequent = 0x00040000, + WICProgressNotificationAll = 0xFFFF0000, + WICPROGRESSNOTIFICATION_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICComponentSigning { + WICComponentSigned = 0x00000001, + WICComponentUnsigned = 0x00000002, + WICComponentSafe = 0x00000004, + WICComponentDisabled = 0x80000000, + WICCOMPONENTSIGNING_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICGifLogicalScreenDescriptorProperties { + WICGifLogicalScreenSignature = 0x00000001, + WICGifLogicalScreenDescriptorWidth = 0x00000002, + WICGifLogicalScreenDescriptorHeight = 0x00000003, + WICGifLogicalScreenDescriptorGlobalColorTableFlag = 0x00000004, + WICGifLogicalScreenDescriptorColorResolution = 0x00000005, + WICGifLogicalScreenDescriptorSortFlag = 0x00000006, + WICGifLogicalScreenDescriptorGlobalColorTableSize = 0x00000007, + WICGifLogicalScreenDescriptorBackgroundColorIndex = 0x00000008, + WICGifLogicalScreenDescriptorPixelAspectRatio = 0x00000009, + WICGifLogicalScreenDescriptorProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICGifImageDescriptorProperties { + WICGifImageDescriptorLeft = 0x00000001, + WICGifImageDescriptorTop = 0x00000002, + WICGifImageDescriptorWidth = 0x00000003, + WICGifImageDescriptorHeight = 0x00000004, + WICGifImageDescriptorLocalColorTableFlag = 0x00000005, + WICGifImageDescriptorInterlaceFlag = 0x00000006, + WICGifImageDescriptorSortFlag = 0x00000007, + WICGifImageDescriptorLocalColorTableSize = 0x00000008, + WICGifImageDescriptorProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICGifGraphicControlExtensionProperties { + WICGifGraphicControlExtensionDisposal = 0x00000001, + WICGifGraphicControlExtensionUserInputFlag = 0x00000002, + WICGifGraphicControlExtensionTransparencyFlag = 0x00000003, + WICGifGraphicControlExtensionDelay = 0x00000004, + WICGifGraphicControlExtensionTransparentColorIndex = 0x00000005, + WICGifGraphicControlExtensionProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICGifApplicationExtensionProperties { + WICGifApplicationExtensionApplication = 0x00000001, + WICGifApplicationExtensionData = 0x00000002, + WICGifApplicationExtensionProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICGifCommentExtensionProperties { + WICGifCommentExtensionText = 0x00000001, + WICGifCommentExtensionProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICJpegCommentProperties { + WICJpegCommentText = 0x00000001, + WICJpegCommentProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICJpegLuminanceProperties { + WICJpegLuminanceTable = 0x00000001, + WICJpegLuminanceProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICJpegChrominanceProperties { + WICJpegChrominanceTable = 0x00000001, + WICJpegChrominanceProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WIC8BIMIptcProperties { + WIC8BIMIptcPString = 0x00000000, + WIC8BIMIptcEmbeddedIPTC = 0x00000001, + WIC8BIMIptcProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WIC8BIMResolutionInfoProperties { + WIC8BIMResolutionInfoPString = 0x00000001, + WIC8BIMResolutionInfoHResolution = 0x00000002, + WIC8BIMResolutionInfoHResolutionUnit = 0x00000003, + WIC8BIMResolutionInfoWidthUnit = 0x00000004, + WIC8BIMResolutionInfoVResolution = 0x00000005, + WIC8BIMResolutionInfoVResolutionUnit = 0x00000006, + WIC8BIMResolutionInfoHeightUnit = 0x00000007, + WIC8BIMResolutionInfoProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WIC8BIMIptcDigestProperties { + WIC8BIMIptcDigestPString = 0x00000001, + WIC8BIMIptcDigestIptcDigest = 0x00000002, + WIC8BIMIptcDigestProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPngGamaProperties { + WICPngGamaGamma = 0x00000001, + WICPngGamaProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPngBkgdProperties { + WICPngBkgdBackgroundColor = 0x00000001, + WICPngBkgdProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPngItxtProperties { + WICPngItxtKeyword = 0x00000001, + WICPngItxtCompressionFlag = 0x00000002, + WICPngItxtLanguageTag = 0x00000003, + WICPngItxtTranslatedKeyword = 0x00000004, + WICPngItxtText = 0x00000005, + WICPngItxtProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPngChrmProperties { + WICPngChrmWhitePointX = 0x00000001, + WICPngChrmWhitePointY = 0x00000002, + WICPngChrmRedX = 0x00000003, + WICPngChrmRedY = 0x00000004, + WICPngChrmGreenX = 0x00000005, + WICPngChrmGreenY = 0x00000006, + WICPngChrmBlueX = 0x00000007, + WICPngChrmBlueY = 0x0000008, + WICPngChrmProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPngHistProperties { + WICPngHistFrequencies = 0x00000001, + WICPngHistProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPngIccpProperties { + WICPngIccpProfileName = 0x00000001, + WICPngIccpProfileData = 0x00000002, + WICPngIccpProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPngSrgbProperties { + WICPngSrgbRenderingIntent = 0x00000001, + WICPngSrgbProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPngTimeProperties { + WICPngTimeYear = 0x00000001, + WICPngTimeMonth = 0x00000002, + WICPngTimeDay = 0x00000003, + WICPngTimeHour = 0x00000004, + WICPngTimeMinute = 0x00000005, + WICPngTimeSecond = 0x00000006, + WICPngTimeProperties_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICSectionAccessLevel { + WICSectionAccessLevelRead = 0x00000001, + WICSectionAccessLevelReadWrite = 0x00000003, + WICSectionAccessLevel_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPixelFormatNumericRepresentation { + WICPixelFormatNumericRepresentationUnspecified = 0x00000000, + WICPixelFormatNumericRepresentationIndexed = 0x00000001, + WICPixelFormatNumericRepresentationUnsignedInteger = 0x00000002, + WICPixelFormatNumericRepresentationSignedInteger = 0x00000003, + WICPixelFormatNumericRepresentationFixed = 0x00000004, + WICPixelFormatNumericRepresentationFloat = 0x00000005, + WICPixelFormatNumericRepresentation_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPlanarOptions { + WICPlanarOptionsDefault = 0x00000000, + WICPlanarOptionsPreserveSubsampling = 0x00000001, + WICPLANAROPTIONS_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICJpegIndexingOptions { + WICJpegIndexingOptionsGenerateOnDemand = 0x00000000, + WICJpegIndexingOptionsGenerateOnLoad = 0x00000001, + WICJpegIndexingOptions_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICJpegTransferMatrix { + WICJpegTransferMatrixIdentity = 0x00000000, + WICJpegTransferMatrixBT601 = 0x00000001, + WICJpegTransferMatrix_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICJpegScanType { + WICJpegScanTypeInterleaved = 0x00000000, + WICJpegScanTypePlanarComponents = 0x00000001, + WICJpegScanTypeProgressive = 0x00000002, + WICJpegScanType_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +STRUCT!{struct WICImageParameters { + PixelFormat: D2D1_PIXEL_FORMAT, + DpiX: FLOAT, + DpiY: FLOAT, + Top: FLOAT, + Left: FLOAT, + PixelWidth: UINT32, + PixelHeight: UINT32, +}} +STRUCT!{struct WICBitmapPlaneDescription { + Format: WICPixelFormatGUID, + Width: UINT, + Height: UINT, +}} +STRUCT!{struct WICBitmapPlane { + Format: WICPixelFormatGUID, + pbBuffer: *mut BYTE, + cbStride: UINT, + cbBufferSize: UINT, +}} +STRUCT!{struct WICJpegFrameHeader { + Width: UINT, + Height: UINT, + TransferMatrix: WICJpegTransferMatrix, + ScanType: WICJpegScanType, + cComponents: UINT, + ComponentIdentifiers: DWORD, + SampleFactors: DWORD, + QuantizationTableIndices: DWORD, +}} +STRUCT!{struct WICJpegScanHeader { + cComponents: UINT, + RestartInterval: UINT, + ComponentSelectors: DWORD, + HuffmanTableIndices: DWORD, + StartSpectralSelection: BYTE, + EndSpectralSelection: BYTE, + SuccessiveApproximationHigh: BYTE, + SuccessiveApproximationLow: BYTE, +}} +RIDL!{#[uuid(0x00000040, 0xa8f2, 0x4877, 0xba, 0x0a, 0xfd, 0x2b, 0x66, 0x45, 0xfb, 0x94)] +interface IWICPalette(IWICPaletteVtbl): IUnknown(IUnknownVtbl) { + fn InitializePredefined( + ePaletteType: WICBitmapPaletteType, + fAddTransparentColor: BOOL, + ) -> HRESULT, + fn InitializeCustom( + pColors: *const WICColor, + cCount: UINT, + ) -> HRESULT, + fn InitializeFromBitmap( + pISurface: *const IWICBitmapSource, + cCount: UINT, + fAddTransparentColor: BOOL, + ) -> HRESULT, + fn InitializeFromPalette( + pIPalette: *const IWICPalette, + ) -> HRESULT, + fn GetType( + pePaletteType: *mut WICBitmapPaletteType, + ) -> HRESULT, + fn GetColorCount( + pcCount: *mut UINT, + ) -> HRESULT, + fn GetColors( + cCount: UINT, + pColors: *mut WICColor, + pcActualColors: *mut UINT, + ) -> HRESULT, + fn IsBlackWhite( + pfIsBlackWhite: *mut BOOL, + ) -> HRESULT, + fn IsGrayscale( + pfIsGrayscale: *mut BOOL, + ) -> HRESULT, + fn HasAlpha( + pfHasAlpha: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000120, 0xa8f2, 0x4877, 0xba, 0x0a, 0xfd, 0x2b, 0x66, 0x45, 0xfb, 0x94)] +interface IWICBitmapSource(IWICBitmapSourceVtbl): IUnknown(IUnknownVtbl) { + fn GetSize( + puiWidth: *mut UINT, + puiHeight: *mut UINT, + ) -> HRESULT, + fn GetPixelFormat( + pPixelFormat: *mut WICPixelFormatGUID, + ) -> HRESULT, + fn GetResolution( + pDpiX: *mut c_double, + pDpiY: *mut c_double, + ) -> HRESULT, + fn CopyPalette( + pIPalette: *mut IWICPalette, + ) -> HRESULT, + fn CopyPixels( + prc: *const WICRect, + cbStride: UINT, + cbBufferSize: UINT, + pbBuffer: *mut BYTE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000301, 0xa8f2, 0x4877, 0xba, 0x0a, 0xfd, 0x2b, 0x66, 0x45, 0xfb, 0x94)] +interface IWICFormatConverter(IWICFormatConverterVtbl): IWICBitmapSource(IWICBitmapSourceVtbl) { + fn Initialize( + pISource: *const IWICBitmapSource, + dstFormat: REFWICPixelFormatGUID, + dither: WICBitmapDitherType, + pIPalette: *const IWICPalette, + alphaThresholdPercent: c_double, + paletteTranslate: WICBitmapPaletteType, + ) -> HRESULT, + fn CanConvert( + srcPixelFormat: REFWICPixelFormatGUID, + dstPixelFormat: REFWICPixelFormatGUID, + pfCanConvert: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xbebee9cb, 0x83b0, 0x4dcc, 0x81, 0x32, 0xb0, 0xaa, 0xa5, 0x5e, 0xac, 0x96)] +interface IWICPlanarFormatConverter(IWICPlanarFormatConverterVtbl): + IWICBitmapSource(IWICBitmapSourceVtbl) { + fn Initialize( + ppPlanes: *const *const IWICBitmapSource, + cPlanes: UINT, + dstFormat: REFWICPixelFormatGUID, + dither: WICBitmapDitherType, + pIPalette: *const IWICPalette, + alphaThresholdPercent: c_double, + paletteTranslate: WICBitmapPaletteType, + ) -> HRESULT, + fn CanConvert( + pSrcPixelFormats: *const WICPixelFormatGUID, + cSrcPlanes: UINT, + dstPixelFormat: REFWICPixelFormatGUID, + pfCanConvert: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000302, 0xa8f2, 0x4877, 0xba, 0x0a, 0xfd, 0x2b, 0x66, 0x45, 0xfb, 0x94)] +interface IWICBitmapScaler(IWICBitmapScalerVtbl): IWICBitmapSource(IWICBitmapSourceVtbl) { + fn Initialize( + pISource: *const IWICBitmapSource, + uiWidth: UINT, + uiHeight: UINT, + mode: WICBitmapInterpolationMode, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xe4fbcf03, 0x223d, 0x4e81, 0x93, 0x33, 0xd6, 0x35, 0x55, 0x6d, 0xd1, 0xb5)] +interface IWICBitmapClipper(IWICBitmapClipperVtbl): IWICBitmapSource(IWICBitmapSourceVtbl) { + fn Initialize( + pISource: *const IWICBitmapSource, + prc: *const WICRect, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5009834f, 0x2d6a, 0x41ce, 0x9e, 0x1b, 0x17, 0xc5, 0xaf, 0xf7, 0xa7, 0x82)] +interface IWICBitmapFlipRotator(IWICBitmapFlipRotatorVtbl): + IWICBitmapSource(IWICBitmapSourceVtbl) { + fn Initialize( + pISource: *const IWICBitmapSource, + options: WICBitmapTransformOptions, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000123, 0xa8f2, 0x4877, 0xba, 0x0a, 0xfd, 0x2b, 0x66, 0x45, 0xfb, 0x94)] +interface IWICBitmapLock(IWICBitmapLockVtbl): IUnknown(IUnknownVtbl) { + fn GetSize( + puiWidth: *mut UINT, + puiHeight: *mut UINT, + ) -> HRESULT, + fn GetStride( + pcbStride: *mut UINT, + ) -> HRESULT, + fn GetDataPointer( + pcbBufferSize: *mut UINT, + ppbData: *mut WICInProcPointer, + ) -> HRESULT, + fn GetPixelFormat( + pPixelFormat: *mut WICPixelFormatGUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000121, 0xa8f2, 0x4877, 0xba, 0x0a, 0xfd, 0x2b, 0x66, 0x45, 0xfb, 0x94)] +interface IWICBitmap(IWICBitmapVtbl): IWICBitmapSource(IWICBitmapSourceVtbl) { + fn Lock( + prcLock: *const WICRect, + flags: DWORD, + ppILock: *mut *mut IWICBitmapLock, + ) -> HRESULT, + fn SetPalette( + pIPalette: *const IWICPalette, + ) -> HRESULT, + fn SetResolution( + dpiX: c_double, + dpiY: c_double, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3c613a02, 0x34b2, 0x44ea, 0x9a, 0x7c, 0x45, 0xae, 0xa9, 0xc6, 0xfd, 0x6d)] +interface IWICColorContext(IWICColorContextVtbl): IUnknown(IUnknownVtbl) { + fn InitializeFromFilename( + wzFilename: LPCWSTR, + ) -> HRESULT, + fn InitializeFromMemory( + pbBuffer: *const BYTE, + cbBufferSize: UINT, + ) -> HRESULT, + fn InitializeFromExifColorSpace( + value: UINT, + ) -> HRESULT, + fn GetType( + pType: *mut WICColorContextType, + ) -> HRESULT, + fn GetProfileBytes( + cbBuffer: UINT, + pbBuffer: *mut BYTE, + pcbActual: *mut UINT, + ) -> HRESULT, + fn GetExifColorSpace( + pValue: *mut UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb66f034f, 0xd0e2, 0x40ab, 0xb4, 0x36, 0x6d, 0xe3, 0x9e, 0x32, 0x1a, 0x94)] +interface IWICColorTransform(IWICColorTransformVtbl): IWICBitmapSource(IWICBitmapSourceVtbl) { + fn Initialize( + pIBitmapSource: *const IWICBitmapSource, + pIContextSource: *const IWICColorContext, + pIContextDest: *const IWICColorContext, + pixelFmtDest: REFWICPixelFormatGUID, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xb84e2c09, 0x78c9, 0x4ac4, 0x8b, 0xd3, 0x52, 0x4a, 0xe1, 0x66, 0x3a, 0x2f)] +interface IWICFastMetadataEncoder(IWICFastMetadataEncoderVtbl): IUnknown(IUnknownVtbl) { + fn Commit() -> HRESULT, + fn GetMetadataQueryWriter( + ppIMetadataQueryWriter: *mut *mut IWICMetadataQueryWriter, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x135ff860, 0x22b7, 0x4ddf, 0xb0, 0xf6, 0x21, 0x8f, 0x4f, 0x29, 0x9a, 0x43)] +interface IWICStream(IWICStreamVtbl): IStream(IStreamVtbl) { + fn InitializeFromIStream( + pIStream: *const IStream, + ) -> HRESULT, + fn InitializeFromFilename( + wzFileName: LPCWSTR, + dwDesiredAccess: DWORD, + ) -> HRESULT, + fn InitializeFromMemory( + pbBuffer: WICInProcPointer, + cbBufferSize: DWORD, + ) -> HRESULT, + fn InitializeFromIStreamRegion( + pIStream: *const IStream, + ulOffset: ULARGE_INTEGER, + ulMaxSize: ULARGE_INTEGER, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdc2bb46d, 0x3f07, 0x481e, 0x86, 0x25, 0x22, 0x0c, 0x4a, 0xed, 0xbb, 0x33)] +interface IWICEnumMetadataItem(IWICEnumMetadataItemVtbl): IUnknown(IUnknownVtbl) { + fn Next( + celt: ULONG, + rgeltSchema: *mut PROPVARIANT, + rgeltId: *mut PROPVARIANT, + rgeltValue: *mut PROPVARIANT, + pceltFetched: *mut ULONG, + ) -> HRESULT, + fn Skip( + celt: ULONG, + ) -> HRESULT, + fn Reset() -> HRESULT, + fn Clone( + ppIEnumMetadataItem: *mut *mut IWICEnumMetadataItem, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x30989668, 0xe1c9, 0x4597, 0xb3, 0x95, 0x45, 0x8e, 0xed, 0xb8, 0x08, 0xdf)] +interface IWICMetadataQueryReader(IWICMetadataQueryReaderVtbl): IUnknown(IUnknownVtbl) { + fn GetContainerFormat( + pguidContainerFormat: *mut GUID, + ) -> HRESULT, + fn GetLocation( + cchMaxLength: UINT, + wzNamespace: *mut WCHAR, + pcchActualLength: *mut UINT, + ) -> HRESULT, + fn GetMetadataByName( + wzName: LPCWSTR, + pvarValue: *mut PROPVARIANT, + ) -> HRESULT, + fn GetEnumerator( + ppIEnumString: *mut *mut IEnumString, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa721791a, 0x0def, 0x4d06, 0xbd, 0x91, 0x21, 0x18, 0xbf, 0x1d, 0xb1, 0x0b)] +interface IWICMetadataQueryWriter(IWICMetadataQueryWriterVtbl): + IWICMetadataQueryReader(IWICMetadataQueryReaderVtbl) { + fn SetMetadataByName( + wzName: LPCWSTR, + pvarValue: *const PROPVARIANT, + ) -> HRESULT, + fn RemoveMetadataByName( + wzName: LPCWSTR, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000103, 0xa8f2, 0x4877, 0xba, 0x0a, 0xfd, 0x2b, 0x66, 0x45, 0xfb, 0x94)] +interface IWICBitmapEncoder(IWICBitmapEncoderVtbl): IUnknown(IUnknownVtbl) { + fn Initialize( + pIStream: *const IStream, + cacheOption: WICBitmapEncoderCacheOption, + ) -> HRESULT, + fn GetContainerFormat( + pguidContainerFormat: *mut GUID, + ) -> HRESULT, + fn GetEncoderInfo( + ppIEncoderInfo: *mut *mut IWICBitmapEncoderInfo, + ) -> HRESULT, + fn SetColorContexts( + cCount: UINT, + ppIColorContext: *const *const IWICColorContext, + ) -> HRESULT, + fn SetPalette( + pIPalette: *const IWICPalette, + ) -> HRESULT, + fn SetThumbnail( + pIThumbnail: *const IWICBitmapSource, + ) -> HRESULT, + fn SetPreview( + pIPreview: *const IWICBitmapSource, + ) -> HRESULT, + fn CreateNewFrame( + ppIFrameEncode: *mut *mut IWICBitmapFrameEncode, + ppIEncoderOptions: *mut *mut IPropertyBag2, + ) -> HRESULT, + fn Commit() -> HRESULT, + fn GetMetadataQueryWriter( + ppIMetadataQueryWriter: *mut *mut IWICMetadataQueryWriter, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x00000105, 0xa8f2, 0x4877, 0xba, 0x0a, 0xfd, 0x2b, 0x66, 0x45, 0xfb, 0x94)] +interface IWICBitmapFrameEncode(IWICBitmapFrameEncodeVtbl): IUnknown(IUnknownVtbl) { + fn Initialize( + pIEncoderOptions: *const IPropertyBag2, + ) -> HRESULT, + fn SetSize( + uiWidth: UINT, + uiHeight: UINT, + ) -> HRESULT, + fn SetResolution( + dpiX: c_double, + dpiY: c_double, + ) -> HRESULT, + fn SetPixelFormat( + pPixelFormat: *mut WICPixelFormatGUID, + ) -> HRESULT, + fn SetColorContexts( + cCount: UINT, + ppIColorContext: *const *const IWICColorContext, + ) -> HRESULT, + fn SetPalette( + pIPalette: *const IWICPalette, + ) -> HRESULT, + fn SetThumbnail( + pIThumbnail: *const IWICBitmapSource, + ) -> HRESULT, + fn WritePixels( + lineCount: UINT, + cbStride: UINT, + cbBufferSize: UINT, + pbPixels: *const BYTE, + ) -> HRESULT, + fn WriteSource( + pIBitmapSource: *const IWICBitmapSource, + prc: *const WICRect, + ) -> HRESULT, + fn Commit() -> HRESULT, + fn GetMetadataQueryWriter( + ppIMetadataQueryWriter: *mut *mut IWICMetadataQueryWriter, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf928b7b8, 0x2221, 0x40c1, 0xb7, 0x2e, 0x7e, 0x82, 0xf1, 0x97, 0x4d, 0x1a)] +interface IWICPlanarBitmapFrameEncode(IWICPlanarBitmapFrameEncodeVtbl): IUnknown(IUnknownVtbl) { + fn WritePixels( + lineCount: UINT, + pPlanes: *const WICBitmapPlane, + cPlanes: UINT, + ) -> HRESULT, + fn WriteSource( + ppPlanes: *const *const IWICBitmapSource, + cPlanes: UINT, + prcSource: *const WICRect, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x04c75bf8, 0x3ce1, 0x473b, 0xac, 0xc5, 0x3c, 0xc4, 0xf5, 0xe9, 0x49, 0x99)] +interface IWICImageEncoder(IWICImageEncoderVtbl): IUnknown(IUnknownVtbl) { + fn WriteFrame( + pImage: *const ID2D1Image, + pFrameEncode: *const IWICBitmapFrameEncode, + pImageParameters: *const WICImageParameters, + ) -> HRESULT, + fn WriteFrameThumbnail( + pImage: *const ID2D1Image, + pFrameEncode: *const IWICBitmapFrameEncode, + pImageParameters: *const WICImageParameters, + ) -> HRESULT, + fn WriteThumbnail( + pImage: *const ID2D1Image, + pEncoder: *const IWICBitmapEncoder, + pImageParameters: *const WICImageParameters, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9edde9e7, 0x8dee, 0x47ea, 0x99, 0xdf, 0xe6, 0xfa, 0xf2, 0xed, 0x44, 0xbf)] +interface IWICBitmapDecoder(IWICBitmapDecoderVtbl): IUnknown(IUnknownVtbl) { + fn QueryCapability( + pIStream: *const IStream, + pdwCapability: *mut DWORD, + ) -> HRESULT, + fn Initialize( + pIStream: *const IStream, + cacheOptions: WICDecodeOptions, + ) -> HRESULT, + fn GetContainerFormat( + pguidContainerFormat: *mut GUID, + ) -> HRESULT, + fn GetDecoderInfo( + ppIDecoderInfo: *mut *mut IWICBitmapDecoderInfo, + ) -> HRESULT, + fn CopyPalette( + pIPalette: *const IWICPalette, + ) -> HRESULT, + fn GetMetadataQueryReader( + ppIMetadataQueryReader: *mut *mut IWICMetadataQueryReader, + ) -> HRESULT, + fn GetPreview( + ppIBitmapSource: *mut *mut IWICBitmapSource, + ) -> HRESULT, + fn GetColorContexts( + cCount: UINT, + ppIColorContexts: *mut *mut IWICColorContext, + pcActualCount: *mut UINT, + ) -> HRESULT, + fn GetThumbnail( + ppIThumbnail: *mut *mut IWICBitmapSource, + ) -> HRESULT, + fn GetFrameCount( + pCount: *mut UINT, + ) -> HRESULT, + fn GetFrame( + index: UINT, + ppIBitmapFrame: *mut *mut IWICBitmapFrameDecode, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3b16811b, 0x6a43, 0x4ec9, 0xb7, 0x13, 0x3d, 0x5a, 0x0c, 0x13, 0xb9, 0x40)] +interface IWICBitmapSourceTransform(IWICBitmapSourceTransformVtbl): IUnknown(IUnknownVtbl) { + fn CopyPixels( + prc: *const WICRect, + uiWidth: UINT, + uiHeight: UINT, + pguidDstFormat: *const WICPixelFormatGUID, + dstTransform: WICBitmapTransformOptions, + nStride: UINT, + cbBufferSize: UINT, + pbBuffer: *mut BYTE, + ) -> HRESULT, + fn GetClosestSize( + puiWidth: *mut UINT, + puiHeight: *mut UINT, + ) -> HRESULT, + fn GetClosestPixelFormat( + pguidDstFormat: *mut WICPixelFormatGUID, + ) -> HRESULT, + fn DoesSupportTransform( + dstTransform: WICBitmapTransformOptions, + pfIsSupported: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3aff9cce, 0xbe95, 0x4303, 0xb9, 0x27, 0xe7, 0xd1, 0x6f, 0xf4, 0xa6, 0x13)] +interface IWICPlanarBitmapSourceTransform(IWICPlanarBitmapSourceTransformVtbl): + IUnknown(IUnknownVtbl) { + fn DoesSupportTransform( + puiWidth: *mut UINT, + puiHeight: *mut UINT, + dstTransform: WICBitmapTransformOptions, + dstPlanarOptions: WICPlanarOptions, + pguidDstFormats: *const WICPixelFormatGUID, + pPlaneDescriptions: *mut WICBitmapPlaneDescription, + cPlanes: UINT, + pfIsSupported: *mut BOOL, + ) -> HRESULT, + fn CopyPixels( + prcSource: *const WICRect, + uiWidth: UINT, + uiHeight: UINT, + dstTransform: WICBitmapTransformOptions, + dstPlanarOptions: WICPlanarOptions, + pDstPlanes: *const WICBitmapPlane, + cPlanes: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x3b16811b, 0x6a43, 0x4ec9, 0xa8, 0x13, 0x3d, 0x93, 0x0c, 0x13, 0xb9, 0x40)] +interface IWICBitmapFrameDecode(IWICBitmapFrameDecodeVtbl): + IWICBitmapSource(IWICBitmapSourceVtbl) { + fn GetMetadataQueryReader( + ppIMetadataQueryReader: *mut *mut IWICMetadataQueryReader, + ) -> HRESULT, + fn GetColorContexts( + cCount: UINT, + ppIColorContexts: *mut *mut IWICColorContext, + pcActualCount: *mut UINT, + ) -> HRESULT, + fn GetThumbnail( + ppIThumbnail: *mut *mut IWICBitmapSource, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xdaac296f, 0x7aa5, 0x4dbf, 0x8d, 0x15, 0x22, 0x5c, 0x59, 0x76, 0xf8, 0x91)] +interface IWICProgressiveLevelControl(IWICProgressiveLevelControlVtbl): IUnknown(IUnknownVtbl) { + fn GetLevelCount( + pcLevels: *mut UINT, + ) -> HRESULT, + fn GetCurrentLevel( + pnLevel: *mut UINT, + ) -> HRESULT, + fn SetCurrentLevel( + nLevel: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x4776f9cd, 0x9517, 0x45fa, 0xbf, 0x24, 0xe8, 0x9c, 0x5e, 0xc5, 0xc6, 0x0c)] +interface IWICProgressCallback(IWICProgressCallbackVtbl): IUnknown(IUnknownVtbl) { + fn Notify( + uFrameNum: ULONG, + operation: WICProgressOperation, + dblProgress: c_double, + ) -> HRESULT, +}} +FN!{stdcall PFNProgressNotification( + pvData: LPVOID, + uFrameNum: ULONG, + operation: WICProgressOperation, + dblProgress: c_double, +) -> HRESULT} +RIDL!{#[uuid(0x64c1024e, 0xc3cf, 0x4462, 0x80, 0x78, 0x88, 0xc2, 0xb1, 0x1c, 0x46, 0xd9)] +interface IWICBitmapCodecProgressNotification(IWICBitmapCodecProgressNotificationVtbl): + IUnknown(IUnknownVtbl) { + fn RegisterProgressNotification( + pfnProgressNotification: PFNProgressNotification, + pvData: LPVOID, + dwProgressFlags: DWORD, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x23bc3f0a, 0x698b, 0x4357, 0x88, 0x6b, 0xf2, 0x4d, 0x50, 0x67, 0x13, 0x34)] +interface IWICComponentInfo(IWICComponentInfoVtbl): IUnknown(IUnknownVtbl) { + fn GetComponentType( + pType: *mut WICComponentType, + ) -> HRESULT, + fn GetCLSID( + pclsid: *mut CLSID, + ) -> HRESULT, + fn GetSigningStatus( + pStatus: *mut DWORD, + ) -> HRESULT, + fn GetAuthor( + cchAuthor: UINT, + wzAuthor: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, + fn GetVendorGUID( + pguidVendor: *mut GUID, + ) -> HRESULT, + fn GetVersion( + cchVersion: UINT, + wzVersion: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, + fn GetSpecVersion( + cchSpecVersion: UINT, + wzSpecVersion: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, + fn GetFriendlyName( + cchFriendlyName: UINT, + wzFriendlyName: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9f34fb65, 0x13f4, 0x4f15, 0xbc, 0x57, 0x37, 0x26, 0xb5, 0xe5, 0x3d, 0x9f)] +interface IWICFormatConverterInfo(IWICFormatConverterInfoVtbl): + IWICComponentInfo(IWICComponentInfoVtbl) { + fn GetPixelFormats( + cFormats: UINT, + pPixelFormatGUIDs: *mut WICPixelFormatGUID, + pcActual: *mut UINT, + ) -> HRESULT, + fn CreateInstance( + ppIConverter: *mut *mut IWICFormatConverter, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xe87a44c4, 0xb76e, 0x4c47, 0x8b, 0x09, 0x29, 0x8e, 0xb1, 0x2a, 0x27, 0x14)] +interface IWICBitmapCodecInfo(IWICBitmapCodecInfoVtbl): IWICComponentInfo(IWICComponentInfoVtbl) { + fn GetContainerFormat( + pguidContainerFormat: *mut GUID, + ) -> HRESULT, + fn GetPixelFormats( + cFormats: UINT, + pguidPixelFormats: *mut GUID, + pcActual: *mut UINT, + ) -> HRESULT, + fn GetColorManagementVersion( + cchColorManagementVersion: UINT, + wzColorManagementVersion: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, + fn GetDeviceManufacturer( + cchDeviceManufacturer: UINT, + wzDeviceManufacturer: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, + fn GetDeviceModels( + cchDeviceModels: UINT, + wzDeviceModels: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, + fn GetMimeTypes( + cchMimeTypes: UINT, + wzMimeTypes: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, + fn GetFileExtensions( + cchFileExtensions: UINT, + wzFileExtensions: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, + fn DoesSupportAnimation( + pfSupportAnimation: *mut BOOL, + ) -> HRESULT, + fn DoesSupportChromakey( + pfSupportChromakey: *mut BOOL, + ) -> HRESULT, + fn DoesSupportLossless( + pfSupportLossless: *mut BOOL, + ) -> HRESULT, + fn DoesSupportMultiframe( + pfSupportMultiframe: *mut BOOL, + ) -> HRESULT, + fn MatchesMimeType( + wzMimeType: LPCWSTR, + pfMatches: *mut BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x94c9b4ee, 0xa09f, 0x4f92, 0x8a, 0x1e, 0x4a, 0x9b, 0xce, 0x7e, 0x76, 0xfb)] +interface IWICBitmapEncoderInfo(IWICBitmapEncoderInfoVtbl): + IWICBitmapCodecInfo(IWICBitmapCodecInfoVtbl) { + fn CreateInstance( + ppIBitmapEncoder: *mut *mut IWICBitmapEncoder, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xd8cd007f, 0xd08f, 0x4191, 0x9b, 0xfc, 0x23, 0x6e, 0xa7, 0xf0, 0xe4, 0xb5)] +interface IWICBitmapDecoderInfo(IWICBitmapDecoderInfoVtbl): + IWICBitmapCodecInfo(IWICBitmapCodecInfoVtbl) { + fn GetPatterns( + cbSizePatterns: UINT, + pPatterns: *mut WICBitmapPattern, + pcPatterns: *mut UINT, + pcbPatternsActual: *mut UINT, + ) -> HRESULT, + fn MatchesPattern( + pIStream: *const IStream, + pfMatches: *mut BOOL, + ) -> HRESULT, + fn CreateInstance( + ppIBitmapDecoder: *mut *mut IWICBitmapDecoder, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xe8eda601, 0x3d48, 0x431a, 0xab, 0x44, 0x69, 0x05, 0x9b, 0xe8, 0x8b, 0xbe)] +interface IWICPixelFormatInfo(IWICPixelFormatInfoVtbl): IWICComponentInfo(IWICComponentInfoVtbl) { + fn GetFormatGUID( + pFormat: *mut GUID, + ) -> HRESULT, + fn GetColorContext( + ppIColorContext: *mut *mut IWICColorContext, + ) -> HRESULT, + fn GetBitsPerPixel( + puiBitsPerPixel: *mut UINT, + ) -> HRESULT, + fn GetChannelCount( + puiChannelCount: *mut UINT, + ) -> HRESULT, + fn GetChannelMask( + uiChannelIndex: UINT, + cbMaskBuffer: UINT, + pbMaskBuffer: *mut BYTE, + pcbActual: *mut UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xa9db33a2, 0xaf5f, 0x43c7, 0xb6, 0x79, 0x74, 0xf5, 0x98, 0x4b, 0x5a, 0xa4)] +interface IWICPixelFormatInfo2(IWICPixelFormatInfo2Vtbl): + IWICPixelFormatInfo(IWICPixelFormatInfoVtbl) { + fn SupportsTransparency( + pfSupportsTransparency: *mut BOOL, + ) -> HRESULT, + fn GetNumericRepresentation( + pNumericRepresentation: *mut WICPixelFormatNumericRepresentation, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xec5ec8a9, 0xc395, 0x4314, 0x9c, 0x77, 0x54, 0xd7, 0xa9, 0x35, 0xff, 0x70)] +interface IWICImagingFactory(IWICImagingFactoryVtbl): IUnknown(IUnknownVtbl) { + fn CreateDecoderFromFilename( + wzFilename: LPCWSTR, + pguidVendor: *const GUID, + dwDesiredAccess: DWORD, + metadataOptions: WICDecodeOptions, + ppIDecoder: *mut *mut IWICBitmapDecoder, + ) -> HRESULT, + fn CreateDecoderFromStream( + pIStream: *const IStream, + pguidVendor: *const GUID, + metadataOptions: WICDecodeOptions, + ppIDecoder: *mut *mut IWICBitmapDecoder, + ) -> HRESULT, + fn CreateDecoderFromFileHandle( + hFile: ULONG_PTR, + pguidVendor: *const GUID, + metadataOptions: WICDecodeOptions, + ppIDecoder: *mut *mut IWICBitmapDecoder, + ) -> HRESULT, + fn CreateComponentInfo( + clsidComponent: REFCLSID, + ppIInfo: *mut *mut IWICComponentInfo, + ) -> HRESULT, + fn CreateDecoder( + guidContainerFormat: REFGUID, + pguidVendor: *const GUID, + ppIDecoder: *mut *mut IWICBitmapDecoder, + ) -> HRESULT, + fn CreateEncoder( + guidContainerFormat: REFGUID, + pguidVendor: *const GUID, + ppIEncoder: *mut *mut IWICBitmapEncoder, + ) -> HRESULT, + fn CreatePalette( + ppIPalette: *mut *mut IWICPalette, + ) -> HRESULT, + fn CreateFormatConverter( + ppIFormatConverter: *mut *mut IWICFormatConverter, + ) -> HRESULT, + fn CreateBitmapScaler( + ppIBitmapScaler: *mut *mut IWICBitmapScaler, + ) -> HRESULT, + fn CreateBitmapClipper( + ppIBitmapClipper: *mut *mut IWICBitmapClipper, + ) -> HRESULT, + fn CreateBitmapFlipRotator( + ppIBitmapFlipRotator: *mut *mut IWICBitmapFlipRotator, + ) -> HRESULT, + fn CreateStream( + ppIWICStream: *mut *mut IWICStream, + ) -> HRESULT, + fn CreateColorContext( + ppIWICColorContext: *mut *mut IWICColorContext, + ) -> HRESULT, + fn CreateColorTransformer( + ppIWICColorTransform: *mut *mut IWICColorTransform, + ) -> HRESULT, + fn CreateBitmap( + uiWidth: UINT, + uiHeight: UINT, + pixelFormat: REFWICPixelFormatGUID, + option: WICBitmapCreateCacheOption, + ppIBitmap: *mut *mut IWICBitmap, + ) -> HRESULT, + fn CreateBitmapFromSource( + pIBitmapSource: *const IWICBitmapSource, + option: WICBitmapCreateCacheOption, + ppIBitmap: *mut *mut IWICBitmap, + ) -> HRESULT, + fn CreateBitmapFromSourceRect( + pIBitmapSource: *const IWICBitmapSource, + x: UINT, + y: UINT, + width: UINT, + height: UINT, + ppIBitmap: *mut *mut IWICBitmap, + ) -> HRESULT, + fn CreateBitmapFromMemory( + uiWidth: UINT, + uiHeight: UINT, + pixelFormat: REFWICPixelFormatGUID, + cbStride: UINT, + cbBufferSize: UINT, + pbBuffer: *const BYTE, + ppIBitmap: *mut *mut IWICBitmap, + ) -> HRESULT, + fn CreateBitmapFromHBITMAP( + hBitmap: HBITMAP, + hPalette: HPALETTE, + options: WICBitmapAlphaChannelOption, + ppIBitmap: *mut *mut IWICBitmap, + ) -> HRESULT, + fn CreateBitmapFromHICON( + hIcon: HICON, + ppIBitmap: *mut *mut IWICBitmap, + ) -> HRESULT, + fn CreateComponentEnumerator( + componentTypes: DWORD, + options: DWORD, + ppIEnumUnknown: *mut *mut IEnumUnknown, + ) -> HRESULT, + fn CreateFastMetadataEncoderFromDecoder( + pIDecoder: *const IWICBitmapDecoder, + ppIFastEncoder: *mut *mut IWICFastMetadataEncoder, + ) -> HRESULT, + fn CreateFastMetadataEncoderFromFrameDecode( + pIFrameDecoder: *const IWICBitmapFrameDecode, + ppIFastEncoder: *mut *mut IWICFastMetadataEncoder, + ) -> HRESULT, + fn CreateQueryWriter( + guidMetadataFormat: REFGUID, + pguidVendor: *const GUID, + ppIQueryWriter: *mut *mut IWICMetadataQueryWriter, + ) -> HRESULT, + fn CreateQueryWriterFromReader( + pIQueryReader: *const IWICMetadataQueryReader, + pguidVendor: *const GUID, + ppIQueryWriter: *mut *mut IWICMetadataQueryWriter, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x7b816b45, 0x1996, 0x4476, 0xb1, 0x32, 0xde, 0x9e, 0x24, 0x7c, 0x8a, 0xf0)] +interface IWICImagingFactory2(IWICImagingFactory2Vtbl): + IWICImagingFactory(IWICImagingFactoryVtbl) { + fn CreateImageEncoder( + pD2DDevice: *const ID2D1Device, + ppWICImageEncoder: *mut *mut IWICImageEncoder, + ) -> HRESULT, +}} +extern "system" { + pub fn WICConvertBitmapSource( + dstFormat: REFWICPixelFormatGUID, + pISrc: *const IWICBitmapSource, + ppIDst: *mut *mut IWICBitmapSource, + ) -> HRESULT; + pub fn WICCreateBitmapFromSection( + width: UINT, + height: UINT, + pixelFormat: REFWICPixelFormatGUID, + hSection: HANDLE, + stride: UINT, + offset: UINT, + ppIBitmap: *mut *mut IWICBitmap, + ) -> HRESULT; + pub fn WICCreateBitmapFromSectionEx( + width: UINT, + height: UINT, + pixelFormat: REFWICPixelFormatGUID, + hSection: HANDLE, + stride: UINT, + offset: UINT, + desiredAccessLevel: WICSectionAccessLevel, + ppIBitmap: *mut *mut IWICBitmap, + ) -> HRESULT; + pub fn WICMapGuidToShortName( + guid: REFGUID, + cchName: UINT, + wzName: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT; + pub fn WICMapShortNameToGuid( + wzName: PCWSTR, + pguid: *mut GUID, + ) -> HRESULT; + pub fn WICMapSchemaToName( + guidMetadataFormat: REFGUID, + pwzSchema: LPWSTR, + cchName: UINT, + wzName: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT; +} +pub const FACILITY_WINCODEC_ERR: HRESULT = 0x898; +pub const WINCODEC_ERR_BASE: HRESULT = 0x2000; +/// intsafe.h, 0x216 = 534 = ERROR_ARITHMETIC_OVERFLOW +pub const INTSAFE_E_ARITHMETIC_OVERFLOW: HRESULT = 0x80070216; +#[inline] +pub fn MAKE_WINCODECHR(severity: HRESULT, code: HRESULT) -> HRESULT { + MAKE_HRESULT!(severity, FACILITY_WINCODEC_ERR, WINCODEC_ERR_BASE + code) +} +#[inline] +pub fn MAKE_WINCODECHR_ERR(code: HRESULT) -> HRESULT { + MAKE_WINCODECHR(SEVERITY_ERROR, code) +} +pub const WINCODEC_ERR_GENERIC_ERROR: HRESULT = E_FAIL; +pub const WINCODEC_ERR_INVALIDPARAMETER: HRESULT = E_INVALIDARG; +pub const WINCODEC_ERR_OUTOFMEMORY: HRESULT = E_OUTOFMEMORY; +pub const WINCODEC_ERR_NOTIMPLEMENTED: HRESULT = E_NOTIMPL; +pub const WINCODEC_ERR_ABORTED: HRESULT = E_ABORT; +pub const WINCODEC_ERR_ACCESSDENIED: HRESULT = E_ACCESSDENIED; +pub const WINCODEC_ERR_VALUEOVERFLOW: HRESULT = INTSAFE_E_ARITHMETIC_OVERFLOW; +ENUM!{enum WICTiffCompressionOption { + WICTiffCompressionDontCare = 0x00000000, + WICTiffCompressionNone = 0x00000001, + WICTiffCompressionCCITT3 = 0x00000002, + WICTiffCompressionCCITT4 = 0x00000003, + WICTiffCompressionLZW = 0x00000004, + WICTiffCompressionRLE = 0x00000005, + WICTiffCompressionZIP = 0x00000006, + WICTiffCompressionLZWHDifferencing = 0x00000007, + WICTIFFCOMPRESSIONOPTION_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICJpegYCrCbSubsamplingOption { + WICJpegYCrCbSubsamplingDefault = 0x00000000, + WICJpegYCrCbSubsampling420 = 0x00000001, + WICJpegYCrCbSubsampling422 = 0x00000002, + WICJpegYCrCbSubsampling444 = 0x00000003, + WICJpegYCrCbSubsampling440 = 0x00000004, + WICJPEGYCRCBSUBSAMPLING_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICPngFilterOption { + WICPngFilterUnspecified = 0x00000000, + WICPngFilterNone = 0x00000001, + WICPngFilterSub = 0x00000002, + WICPngFilterUp = 0x00000003, + WICPngFilterAverage = 0x00000004, + WICPngFilterPaeth = 0x00000005, + WICPngFilterAdaptive = 0x00000006, + WICPNGFILTEROPTION_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICNamedWhitePoint { + WICWhitePointDefault = 0x00000001, + WICWhitePointDaylight = 0x00000002, + WICWhitePointCloudy = 0x00000004, + WICWhitePointShade = 0x00000008, + WICWhitePointTungsten = 0x00000010, + WICWhitePointFluorescent = 0x00000020, + WICWhitePointFlash = 0x00000040, + WICWhitePointUnderwater = 0x00000080, + WICWhitePointCustom = 0x00000100, + WICWhitePointAutoWhiteBalance = 0x00000200, + WICWhitePointAsShot = WICWhitePointDefault, + WICNAMEDWHITEPOINT_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICRawCapabilities { + WICRawCapabilityNotSupported = 0x00000000, + WICRawCapabilityGetSupported = 0x00000001, + WICRawCapabilityFullySupported = 0x00000002, + WICRAWCAPABILITIES_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICRawRotationCapabilities { + WICRawRotationCapabilityNotSupported = 0x00000000, + WICRawRotationCapabilityGetSupported = 0x00000001, + WICRawRotationCapabilityNinetyDegreesSupported = 0x00000002, + WICRawRotationCapabilityFullySupported = 0x00000003, + WICRAWROTATIONCAPABILITIES_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +STRUCT!{struct WICRawCapabilitiesInfo { + cbSize: UINT, + CodecMajorVersion: UINT, + CodecMinorVersion: UINT, + ExposureCompensationSupport: WICRawCapabilities, + ContrastSupport: WICRawCapabilities, + RGBWhitePointSupport: WICRawCapabilities, + NamedWhitePointSupport: WICRawCapabilities, + NamedWhitePointSupportMask: UINT, + KelvinWhitePointSupport: WICRawCapabilities, + GammaSupport: WICRawCapabilities, + TintSupport: WICRawCapabilities, + SaturationSupport: WICRawCapabilities, + SharpnessSupport: WICRawCapabilities, + NoiseReductionSupport: WICRawCapabilities, + DestinationColorProfileSupport: WICRawCapabilities, + ToneCurveSupport: WICRawCapabilities, + RotationSupport: WICRawRotationCapabilities, + RenderModeSupport: WICRawCapabilities, +}} +ENUM!{enum WICRawParameterSet { + WICAsShotParameterSet = 0x00000001, + WICUserAdjustedParameterSet = 0x00000002, + WICAutoAdjustedParameterSet = 0x00000003, + WICRAWPARAMETERSET_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICRawRenderMode { + WICRawRenderModeDraft = 0x00000001, + WICRawRenderModeNormal = 0x00000002, + WICRawRenderModeBestQuality = 0x00000003, + WICRAWRENDERMODE_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +STRUCT!{struct WICRawToneCurvePoint { + Input: c_double, + Output: c_double, +}} +STRUCT!{struct WICRawToneCurve { + cPoints: UINT, + aPoints: [WICRawToneCurvePoint; 1], +}} +pub const WICRawChangeNotification_ExposureCompensation: UINT = 0x00000001; +pub const WICRawChangeNotification_NamedWhitePoint: UINT = 0x00000002; +pub const WICRawChangeNotification_KelvinWhitePoint: UINT = 0x00000004; +pub const WICRawChangeNotification_RGBWhitePoint: UINT = 0x00000008; +pub const WICRawChangeNotification_Contrast: UINT = 0x00000010; +pub const WICRawChangeNotification_Gamma: UINT = 0x00000020; +pub const WICRawChangeNotification_Sharpness: UINT = 0x00000040; +pub const WICRawChangeNotification_Saturation: UINT = 0x00000080; +pub const WICRawChangeNotification_Tint: UINT = 0x00000100; +pub const WICRawChangeNotification_NoiseReduction: UINT = 0x00000200; +pub const WICRawChangeNotification_DestinationColorContext: UINT = 0x00000400; +pub const WICRawChangeNotification_ToneCurve: UINT = 0x00000800; +pub const WICRawChangeNotification_Rotation: UINT = 0x00001000; +pub const WICRawChangeNotification_RenderMode: UINT = 0x00002000; +RIDL!{#[uuid(0x95c75a6e, 0x3e8c, 0x4ec2, 0x85, 0xa8, 0xae, 0xbc, 0xc5, 0x51, 0xe5, 0x9b)] +interface IWICDevelopRawNotificationCallback(IWICDevelopRawNotificationCallbackVtbl): + IUnknown(IUnknownVtbl) { + fn Notify( + NotificationMask: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xfbec5e44, 0xf7be, 0x4b65, 0xb7, 0xf8, 0xc0, 0xc8, 0x1f, 0xef, 0x02, 0x6d)] +interface IWICDevelopRaw(IWICDevelopRawVtbl): IWICBitmapFrameDecode(IWICBitmapFrameDecodeVtbl) { + fn QueryRawCapabilitiesInfo( + pInfo: *mut WICRawCapabilitiesInfo, + ) -> HRESULT, + fn LoadParameterSet( + ParameterSet: WICRawParameterSet, + ) -> HRESULT, + fn GetCurrentParameterSet( + ppCurrentParameterSet: *mut *mut IPropertyBag2, + ) -> HRESULT, + fn SetExposureCompensation( + ev: c_double, + ) -> HRESULT, + fn GetExposureCompensation( + pEV: *mut c_double, + ) -> HRESULT, + fn SetWhitePointRGB( + Red: UINT, + Green: UINT, + Blue: UINT, + ) -> HRESULT, + fn GetWhitePointRGB( + pRed: *mut UINT, + pGreen: *mut UINT, + pBlue: *mut UINT, + ) -> HRESULT, + fn SetNamedWhitePoint( + WhitePoint: WICNamedWhitePoint, + ) -> HRESULT, + fn GetNamedWhitePoint( + pWhitePoint: *mut WICNamedWhitePoint, + ) -> HRESULT, + fn SetWhitePointKelvin( + WhitePointKelvin: UINT, + ) -> HRESULT, + fn GetWhitePointKelvin( + pWhitePointKelvin: *mut UINT, + ) -> HRESULT, + fn GetKelvinRangeInfo( + pMinKelvinTemp: *mut UINT, + pMaxKelvinTemp: *mut UINT, + pKelvinTempStepValue: *mut UINT, + ) -> HRESULT, + fn SetContrast( + Contrast: c_double, + ) -> HRESULT, + fn GetContrast( + pContrast: *mut c_double, + ) -> HRESULT, + fn SetGamma( + Gamma: c_double, + ) -> HRESULT, + fn GetGamma( + pGamma: *mut c_double, + ) -> HRESULT, + fn SetSharpness( + Sharpness: c_double, + ) -> HRESULT, + fn GetSharpness( + pSharpness: *mut c_double, + ) -> HRESULT, + fn SetSaturation( + Saturation: c_double, + ) -> HRESULT, + fn GetSaturation( + pSaturation: *mut c_double, + ) -> HRESULT, + fn SetTint( + Tint: c_double, + ) -> HRESULT, + fn GetTint( + pTint: *mut c_double, + ) -> HRESULT, + fn SetNoiseReduction( + NoiseReduction: c_double, + ) -> HRESULT, + fn GetNoiseReduction( + pNoiseReduction: *mut c_double, + ) -> HRESULT, + fn SetDestinationColorContext( + pColorContext: *const IWICColorContext, + ) -> HRESULT, + fn SetToneCurve( + cbToneCurveSize: UINT, + pToneCurve: *const WICRawToneCurve, + ) -> HRESULT, + fn GetToneCurve( + cbToneCurveBufferSize: UINT, + pToneCurve: *mut WICRawToneCurve, + pcbActualToneCurveBufferSize: *mut UINT, + ) -> HRESULT, + fn SetRotation( + Rotation: c_double, + ) -> HRESULT, + fn GetRotation( + pRotation: *mut c_double, + ) -> HRESULT, + fn SetRenderMode( + RenderMode: WICRawRenderMode, + ) -> HRESULT, + fn GetRenderMode( + pRenderMode: *mut WICRawRenderMode, + ) -> HRESULT, + fn SetNotificationCallback( + pCallback: *const IWICDevelopRawNotificationCallback, + ) -> HRESULT, +}} +ENUM!{enum WICDdsDimension { + WICDdsTexture1D = 0x00000000, + WICDdsTexture2D = 0x00000001, + WICDdsTexture3D = 0x00000002, + WICDdsTextureCube = 0x00000003, + WICDDSTEXTURE_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +ENUM!{enum WICDdsAlphaMode { + WICDdsAlphaModeUnknown = 0x00000000, + WICDdsAlphaModeStraight = 0x00000001, + WICDdsAlphaModePremultiplied = 0x00000002, + WICDdsAlphaModeOpaque = 0x00000003, + WICDdsAlphaModeCustom = 0x00000004, + WICDDSALPHAMODE_FORCE_DWORD = CODEC_FORCE_DWORD, +}} +STRUCT!{struct WICDdsParameters { + Width: UINT, + Height: UINT, + Depth: UINT, + MipLevels: UINT, + ArraySize: UINT, + DxgiFormat: DXGI_FORMAT, + Dimension: WICDdsDimension, + AlphaMode: WICDdsAlphaMode, +}} +RIDL!{#[uuid(0x409cd537, 0x8532, 0x40cb, 0x97, 0x74, 0xe2, 0xfe, 0xb2, 0xdf, 0x4e, 0x9c)] +interface IWICDdsDecoder(IWICDdsDecoderVtbl): IUnknown(IUnknownVtbl) { + fn GetParameters( + pParameters: *mut WICDdsParameters, + ) -> HRESULT, + fn GetFrame( + arrayIndex: UINT, + mipLevel: UINT, + sliceIndex: UINT, + ppIBitmapFrame: *mut *mut IWICBitmapFrameDecode, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x5cacdb4c, 0x407e, 0x41b3, 0xb9, 0x36, 0xd0, 0xf0, 0x10, 0xcd, 0x67, 0x32)] +interface IWICDdsEncoder(IWICDdsEncoderVtbl): IUnknown(IUnknownVtbl) { + fn SetParameters( + pParameters: *const WICDdsParameters, + ) -> HRESULT, + fn GetParameters( + pParameters: *mut WICDdsParameters, + ) -> HRESULT, + fn CreateNewFrame( + ppIFrameEncode: *mut *mut IWICBitmapFrameEncode, + pArrayIndex: *mut UINT, + pMipLevel: *mut UINT, + pSliceIndex: *mut UINT, + ) -> HRESULT, +}} +STRUCT!{struct WICDdsFormatInfo { + DxgiFormat: DXGI_FORMAT, + BytesPerBlock: UINT, + BlockWidth: UINT, + BlockHeight: UINT, +}} +RIDL!{#[uuid(0x3d4c0c61, 0x18a4, 0x41e4, 0xbd, 0x80, 0x48, 0x1a, 0x4f, 0xc9, 0xf4, 0x64)] +interface IWICDdsFrameDecode(IWICDdsFrameDecodeVtbl): IUnknown(IUnknownVtbl) { + fn GetSizeInBlocks( + pWidthInBlocks: *mut UINT, + pHeightInBlocks: *mut UINT, + ) -> HRESULT, + fn GetFormatInfo( + pFormatInfo: *mut WICDdsFormatInfo, + ) -> HRESULT, + fn CopyBlocks( + prcBoundsInBlocks: *const WICRect, + cbStride: UINT, + cbBufferSize: UINT, + pbBuffer: *mut BYTE, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x8939f66e, 0xc46a, 0x4c21, 0xa9, 0xd1, 0x98, 0xb3, 0x27, 0xce, 0x16, 0x79)] +interface IWICJpegFrameDecode(IWICJpegFrameDecodeVtbl): IUnknown(IUnknownVtbl) { + fn DoesSupportIndexing( + pfIndexingSupported: *mut BOOL, + ) -> HRESULT, + fn SetIndexing( + options: WICJpegIndexingOptions, + horizontalIntervalSize: UINT, + ) -> HRESULT, + fn ClearIndexing() -> HRESULT, + fn GetAcHuffmanTable( + scanIndex: UINT, + tableIndex: UINT, + pAcHuffmanTable: *mut DXGI_JPEG_AC_HUFFMAN_TABLE, + ) -> HRESULT, + fn GetDcHuffmanTable( + scanIndex: UINT, + tableIndex: UINT, + pDcHuffmanTable: *mut DXGI_JPEG_DC_HUFFMAN_TABLE, + ) -> HRESULT, + fn GetQuantizationTable( + scanIndex: UINT, + tableIndex: UINT, + pQuantizationTable: *mut DXGI_JPEG_QUANTIZATION_TABLE, + ) -> HRESULT, + fn GetFrameHeader( + pFrameHeader: *mut WICJpegFrameHeader, + ) -> HRESULT, + fn GetScanHeader( + scanIndex: UINT, + pScanHeader: *mut WICJpegScanHeader, + ) -> HRESULT, + fn CopyScan( + scanIndex: UINT, + scanOffset: UINT, + cbScanData: UINT, + pbScanData: *mut BYTE, + pcbScanDataActual: *mut UINT, + ) -> HRESULT, + fn CopyMinimalStream( + streamOffset: UINT, + cbStreamData: UINT, + pbStreamData: *mut BYTE, + pcbStreamDataActual: *mut UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x2f0c601f, 0xd2c6, 0x468c, 0xab, 0xfa, 0x49, 0x49, 0x5d, 0x98, 0x3e, 0xd1)] +interface IWICJpegFrameEncode(IWICJpegFrameEncodeVtbl): IUnknown(IUnknownVtbl) { + fn GetAcHuffmanTable( + scanIndex: UINT, + tableIndex: UINT, + pAcHuffmanTable: *mut DXGI_JPEG_AC_HUFFMAN_TABLE, + ) -> HRESULT, + fn GetDcHuffmanTable( + scanIndex: UINT, + tableIndex: UINT, + pDcHuffmanTable: *mut DXGI_JPEG_DC_HUFFMAN_TABLE, + ) -> HRESULT, + fn GetQuantizationTable( + scanIndex: UINT, + tableIndex: UINT, + pQuantizationTable: *mut DXGI_JPEG_QUANTIZATION_TABLE, + ) -> HRESULT, + fn WriteScan( + cbScanData: UINT, + pbScanData: *const BYTE, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/um/wincodecsdk.rs b/bash-5.1/vendor/winapi/src/um/wincodecsdk.rs new file mode 100644 index 0000000000000000000000000000000000000000..f71bf72aa2d0768e9bf6c26e54f5f9686f0cf25c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wincodecsdk.rs @@ -0,0 +1,564 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::{c_uchar, c_ulong}; +use shared::guiddef::{GUID, REFGUID}; +use shared::minwindef::{BOOL, BYTE, DWORD, UINT, ULONG}; +use shared::wtypes::{BSTR, CLIPFORMAT}; +use um::oaidl::LPSAFEARRAY; +use um::objidl::{IPersistStream, IPersistStreamVtbl}; +use um::objidlbase::{IEnumUnknown, IStream}; +use um::ocidl::{IPropertyBag2, PROPBAG2}; +use um::propidl::PROPVARIANT; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::wincodec::{ + IWICComponentInfo, IWICComponentInfoVtbl, IWICEnumMetadataItem, IWICImagingFactory, + IWICImagingFactoryVtbl, IWICMetadataQueryReader, IWICMetadataQueryWriter, +}; +use um::winnt::{HRESULT, ULARGE_INTEGER, WCHAR}; +DEFINE_GUID!{GUID_MetadataFormatUnknown, + 0xa45e592f, 0x9078, 0x4a7c, 0xad, 0xb5, 0x4e, 0xdc, 0x4f, 0xd6, 0x1b, 0x1f} +DEFINE_GUID!{GUID_MetadataFormatIfd, + 0x537396c6, 0x2d8a, 0x4bb6, 0x9b, 0xf8, 0x2f, 0x0a, 0x8e, 0x2a, 0x3a, 0xdf} +DEFINE_GUID!{GUID_MetadataFormatSubIfd, + 0x58a2e128, 0x2db9, 0x4e57, 0xbb, 0x14, 0x51, 0x77, 0x89, 0x1e, 0xd3, 0x31} +DEFINE_GUID!{GUID_MetadataFormatExif, + 0x1c3c4f9d, 0xb84a, 0x467d, 0x94, 0x93, 0x36, 0xcf, 0xbd, 0x59, 0xea, 0x57} +DEFINE_GUID!{GUID_MetadataFormatGps, + 0x7134ab8a, 0x9351, 0x44ad, 0xaf, 0x62, 0x44, 0x8d, 0xb6, 0xb5, 0x02, 0xec} +DEFINE_GUID!{GUID_MetadataFormatInterop, + 0xed686f8e, 0x681f, 0x4c8b, 0xbd, 0x41, 0xa8, 0xad, 0xdb, 0xf6, 0xb3, 0xfc} +DEFINE_GUID!{GUID_MetadataFormatApp0, + 0x79007028, 0x268d, 0x45d6, 0xa3, 0xc2, 0x35, 0x4e, 0x6a, 0x50, 0x4b, 0xc9} +DEFINE_GUID!{GUID_MetadataFormatApp1, + 0x8fd3dfc3, 0xf951, 0x492b, 0x81, 0x7f, 0x69, 0xc2, 0xe6, 0xd9, 0xa5, 0xb0} +DEFINE_GUID!{GUID_MetadataFormatApp13, + 0x326556a2, 0xf502, 0x4354, 0x9c, 0xc0, 0x8e, 0x3f, 0x48, 0xea, 0xf6, 0xb5} +DEFINE_GUID!{GUID_MetadataFormatIPTC, + 0x4fab0914, 0xe129, 0x4087, 0xa1, 0xd1, 0xbc, 0x81, 0x2d, 0x45, 0xa7, 0xb5} +DEFINE_GUID!{GUID_MetadataFormatIRB, + 0x16100d66, 0x8570, 0x4bb9, 0xb9, 0x2d, 0xfd, 0xa4, 0xb2, 0x3e, 0xce, 0x67} +DEFINE_GUID!{GUID_MetadataFormat8BIMIPTC, + 0x0010568c, 0x0852, 0x4e6a, 0xb1, 0x91, 0x5c, 0x33, 0xac, 0x5b, 0x04, 0x30} +DEFINE_GUID!{GUID_MetadataFormat8BIMResolutionInfo, + 0x739f305d, 0x81db, 0x43cb, 0xac, 0x5e, 0x55, 0x01, 0x3e, 0xf9, 0xf0, 0x03} +DEFINE_GUID!{GUID_MetadataFormat8BIMIPTCDigest, + 0x1ca32285, 0x9ccd, 0x4786, 0x8b, 0xd8, 0x79, 0x53, 0x9d, 0xb6, 0xa0, 0x06} +DEFINE_GUID!{GUID_MetadataFormatXMP, + 0xbb5acc38, 0xf216, 0x4cec, 0xa6, 0xc5, 0x5f, 0x6e, 0x73, 0x97, 0x63, 0xa9} +DEFINE_GUID!{GUID_MetadataFormatThumbnail, + 0x243dcee9, 0x8703, 0x40ee, 0x8e, 0xf0, 0x22, 0xa6, 0x00, 0xb8, 0x05, 0x8c} +DEFINE_GUID!{GUID_MetadataFormatChunktEXt, + 0x568d8936, 0xc0a9, 0x4923, 0x90, 0x5d, 0xdf, 0x2b, 0x38, 0x23, 0x8f, 0xbc} +DEFINE_GUID!{GUID_MetadataFormatXMPStruct, + 0x22383cf1, 0xed17, 0x4e2e, 0xaf, 0x17, 0xd8, 0x5b, 0x8f, 0x6b, 0x30, 0xd0} +DEFINE_GUID!{GUID_MetadataFormatXMPBag, + 0x833cca5f, 0xdcb7, 0x4516, 0x80, 0x6f, 0x65, 0x96, 0xab, 0x26, 0xdc, 0xe4} +DEFINE_GUID!{GUID_MetadataFormatXMPSeq, + 0x63e8df02, 0xeb6c, 0x456c, 0xa2, 0x24, 0xb2, 0x5e, 0x79, 0x4f, 0xd6, 0x48} +DEFINE_GUID!{GUID_MetadataFormatXMPAlt, + 0x7b08a675, 0x91aa, 0x481b, 0xa7, 0x98, 0x4d, 0xa9, 0x49, 0x08, 0x61, 0x3b} +DEFINE_GUID!{GUID_MetadataFormatLSD, + 0xe256031e, 0x6299, 0x4929, 0xb9, 0x8d, 0x5a, 0xc8, 0x84, 0xaf, 0xba, 0x92} +DEFINE_GUID!{GUID_MetadataFormatIMD, + 0xbd2bb086, 0x4d52, 0x48dd, 0x96, 0x77, 0xdb, 0x48, 0x3e, 0x85, 0xae, 0x8f} +DEFINE_GUID!{GUID_MetadataFormatGCE, + 0x2a25cad8, 0xdeeb, 0x4c69, 0xa7, 0x88, 0x0e, 0xc2, 0x26, 0x6d, 0xca, 0xfd} +DEFINE_GUID!{GUID_MetadataFormatAPE, + 0x2e043dc2, 0xc967, 0x4e05, 0x87, 0x5e, 0x61, 0x8b, 0xf6, 0x7e, 0x85, 0xc3} +DEFINE_GUID!{GUID_MetadataFormatJpegChrominance, + 0xf73d0dcf, 0xcec6, 0x4f85, 0x9b, 0x0e, 0x1c, 0x39, 0x56, 0xb1, 0xbe, 0xf7} +DEFINE_GUID!{GUID_MetadataFormatJpegLuminance, + 0x86908007, 0xedfc, 0x4860, 0x8d, 0x4b, 0x4e, 0xe6, 0xe8, 0x3e, 0x60, 0x58} +DEFINE_GUID!{GUID_MetadataFormatJpegComment, + 0x220e5f33, 0xafd3, 0x474e, 0x9d, 0x31, 0x7d, 0x4f, 0xe7, 0x30, 0xf5, 0x57} +DEFINE_GUID!{GUID_MetadataFormatGifComment, + 0xc4b6e0e0, 0xcfb4, 0x4ad3, 0xab, 0x33, 0x9a, 0xad, 0x23, 0x55, 0xa3, 0x4a} +DEFINE_GUID!{GUID_MetadataFormatChunkgAMA, + 0xf00935a5, 0x1d5d, 0x4cd1, 0x81, 0xb2, 0x93, 0x24, 0xd7, 0xec, 0xa7, 0x81} +DEFINE_GUID!{GUID_MetadataFormatChunkbKGD, + 0xe14d3571, 0x6b47, 0x4dea, 0xb6, 0x0a, 0x87, 0xce, 0x0a, 0x78, 0xdf, 0xb7} +DEFINE_GUID!{GUID_MetadataFormatChunkiTXt, + 0xc2bec729, 0x0b68, 0x4b77, 0xaa, 0x0e, 0x62, 0x95, 0xa6, 0xac, 0x18, 0x14} +DEFINE_GUID!{GUID_MetadataFormatChunkcHRM, + 0x9db3655b, 0x2842, 0x44b3, 0x80, 0x67, 0x12, 0xe9, 0xb3, 0x75, 0x55, 0x6a} +DEFINE_GUID!{GUID_MetadataFormatChunkhIST, + 0xc59a82da, 0xdb74, 0x48a4, 0xbd, 0x6a, 0xb6, 0x9c, 0x49, 0x31, 0xef, 0x95} +DEFINE_GUID!{GUID_MetadataFormatChunkiCCP, + 0xeb4349ab, 0xb685, 0x450f, 0x91, 0xb5, 0xe8, 0x02, 0xe8, 0x92, 0x53, 0x6c} +DEFINE_GUID!{GUID_MetadataFormatChunksRGB, + 0xc115fd36, 0xcc6f, 0x4e3f, 0x83, 0x63, 0x52, 0x4b, 0x87, 0xc6, 0xb0, 0xd9} +DEFINE_GUID!{GUID_MetadataFormatChunktIME, + 0x6b00ae2d, 0xe24b, 0x460a, 0x98, 0xb6, 0x87, 0x8b, 0xd0, 0x30, 0x72, 0xfd} +DEFINE_GUID!{GUID_MetadataFormatDds, + 0x4a064603, 0x8c33, 0x4e60, 0x9c, 0x29, 0x13, 0x62, 0x31, 0x70, 0x2d, 0x08} +DEFINE_GUID!{CLSID_WICUnknownMetadataReader, + 0x699745c2, 0x5066, 0x4b82, 0xa8, 0xe3, 0xd4, 0x04, 0x78, 0xdb, 0xec, 0x8c} +DEFINE_GUID!{CLSID_WICUnknownMetadataWriter, + 0xa09cca86, 0x27ba, 0x4f39, 0x90, 0x53, 0x12, 0x1f, 0xa4, 0xdc, 0x08, 0xfc} +DEFINE_GUID!{CLSID_WICApp0MetadataWriter, + 0xf3c633a2, 0x46c8, 0x498e, 0x8f, 0xbb, 0xcc, 0x6f, 0x72, 0x1b, 0xbc, 0xde} +DEFINE_GUID!{CLSID_WICApp0MetadataReader, + 0x43324b33, 0xa78f, 0x480f, 0x91, 0x11, 0x96, 0x38, 0xaa, 0xcc, 0xc8, 0x32} +DEFINE_GUID!{CLSID_WICApp1MetadataWriter, + 0xee366069, 0x1832, 0x420f, 0xb3, 0x81, 0x04, 0x79, 0xad, 0x06, 0x6f, 0x19} +DEFINE_GUID!{CLSID_WICApp1MetadataReader, + 0xdde33513, 0x774e, 0x4bcd, 0xae, 0x79, 0x02, 0xf4, 0xad, 0xfe, 0x62, 0xfc} +DEFINE_GUID!{CLSID_WICApp13MetadataWriter, + 0x7b19a919, 0xa9d6, 0x49e5, 0xbd, 0x45, 0x02, 0xc3, 0x4e, 0x4e, 0x4c, 0xd5} +DEFINE_GUID!{CLSID_WICApp13MetadataReader, + 0xaa7e3c50, 0x864c, 0x4604, 0xbc, 0x04, 0x8b, 0x0b, 0x76, 0xe6, 0x37, 0xf6} +DEFINE_GUID!{CLSID_WICIfdMetadataReader, + 0x8f914656, 0x9d0a, 0x4eb2, 0x90, 0x19, 0x0b, 0xf9, 0x6d, 0x8a, 0x9e, 0xe6} +DEFINE_GUID!{CLSID_WICIfdMetadataWriter, + 0xb1ebfc28, 0xc9bd, 0x47a2, 0x8d, 0x33, 0xb9, 0x48, 0x76, 0x97, 0x77, 0xa7} +DEFINE_GUID!{CLSID_WICSubIfdMetadataReader, + 0x50d42f09, 0xecd1, 0x4b41, 0xb6, 0x5d, 0xda, 0x1f, 0xda, 0xa7, 0x56, 0x63} +DEFINE_GUID!{CLSID_WICSubIfdMetadataWriter, + 0x8ade5386, 0x8e9b, 0x4f4c, 0xac, 0xf2, 0xf0, 0x00, 0x87, 0x06, 0xb2, 0x38} +DEFINE_GUID!{CLSID_WICExifMetadataReader, + 0xd9403860, 0x297f, 0x4a49, 0xbf, 0x9b, 0x77, 0x89, 0x81, 0x50, 0xa4, 0x42} +DEFINE_GUID!{CLSID_WICExifMetadataWriter, + 0xc9a14cda, 0xc339, 0x460b, 0x90, 0x78, 0xd4, 0xde, 0xbc, 0xfa, 0xbe, 0x91} +DEFINE_GUID!{CLSID_WICGpsMetadataReader, + 0x3697790b, 0x223b, 0x484e, 0x99, 0x25, 0xc4, 0x86, 0x92, 0x18, 0xf1, 0x7a} +DEFINE_GUID!{CLSID_WICGpsMetadataWriter, + 0xcb8c13e4, 0x62b5, 0x4c96, 0xa4, 0x8b, 0x6b, 0xa6, 0xac, 0xe3, 0x9c, 0x76} +DEFINE_GUID!{CLSID_WICInteropMetadataReader, + 0xb5c8b898, 0x0074, 0x459f, 0xb7, 0x00, 0x86, 0x0d, 0x46, 0x51, 0xea, 0x14} +DEFINE_GUID!{CLSID_WICInteropMetadataWriter, + 0x122ec645, 0xcd7e, 0x44d8, 0xb1, 0x86, 0x2c, 0x8c, 0x20, 0xc3, 0xb5, 0x0f} +DEFINE_GUID!{CLSID_WICThumbnailMetadataReader, + 0xfb012959, 0xf4f6, 0x44d7, 0x9d, 0x09, 0xda, 0xa0, 0x87, 0xa9, 0xdb, 0x57} +DEFINE_GUID!{CLSID_WICThumbnailMetadataWriter, + 0xd049b20c, 0x5dd0, 0x44fe, 0xb0, 0xb3, 0x8f, 0x92, 0xc8, 0xe6, 0xd0, 0x80} +DEFINE_GUID!{CLSID_WICIPTCMetadataReader, + 0x03012959, 0xf4f6, 0x44d7, 0x9d, 0x09, 0xda, 0xa0, 0x87, 0xa9, 0xdb, 0x57} +DEFINE_GUID!{CLSID_WICIPTCMetadataWriter, + 0x1249b20c, 0x5dd0, 0x44fe, 0xb0, 0xb3, 0x8f, 0x92, 0xc8, 0xe6, 0xd0, 0x80} +DEFINE_GUID!{CLSID_WICIRBMetadataReader, + 0xd4dcd3d7, 0xb4c2, 0x47d9, 0xa6, 0xbf, 0xb8, 0x9b, 0xa3, 0x96, 0xa4, 0xa3} +DEFINE_GUID!{CLSID_WICIRBMetadataWriter, + 0x5c5c1935, 0x0235, 0x4434, 0x80, 0xbc, 0x25, 0x1b, 0xc1, 0xec, 0x39, 0xc6} +DEFINE_GUID!{CLSID_WIC8BIMIPTCMetadataReader, + 0x0010668c, 0x0801, 0x4da6, 0xa4, 0xa4, 0x82, 0x65, 0x22, 0xb6, 0xd2, 0x8f} +DEFINE_GUID!{CLSID_WIC8BIMIPTCMetadataWriter, + 0x00108226, 0xee41, 0x44a2, 0x9e, 0x9c, 0x4b, 0xe4, 0xd5, 0xb1, 0xd2, 0xcd} +DEFINE_GUID!{CLSID_WIC8BIMResolutionInfoMetadataReader, + 0x5805137a, 0xe348, 0x4f7c, 0xb3, 0xcc, 0x6d, 0xb9, 0x96, 0x5a, 0x05, 0x99} +DEFINE_GUID!{CLSID_WIC8BIMResolutionInfoMetadataWriter, + 0x4ff2fe0e, 0xe74a, 0x4b71, 0x98, 0xc4, 0xab, 0x7d, 0xc1, 0x67, 0x07, 0xba} +DEFINE_GUID!{CLSID_WIC8BIMIPTCDigestMetadataReader, + 0x02805f1e, 0xd5aa, 0x415b, 0x82, 0xc5, 0x61, 0xc0, 0x33, 0xa9, 0x88, 0xa6} +DEFINE_GUID!{CLSID_WIC8BIMIPTCDigestMetadataWriter, + 0x2db5e62b, 0x0d67, 0x495f, 0x8f, 0x9d, 0xc2, 0xf0, 0x18, 0x86, 0x47, 0xac} +DEFINE_GUID!{CLSID_WICPngTextMetadataReader, + 0x4b59afcc, 0xb8c3, 0x408a, 0xb6, 0x70, 0x89, 0xe5, 0xfa, 0xb6, 0xfd, 0xa7} +DEFINE_GUID!{CLSID_WICPngTextMetadataWriter, + 0xb5ebafb9, 0x253e, 0x4a72, 0xa7, 0x44, 0x07, 0x62, 0xd2, 0x68, 0x56, 0x83} +DEFINE_GUID!{CLSID_WICXMPMetadataReader, + 0x72b624df, 0xae11, 0x4948, 0xa6, 0x5c, 0x35, 0x1e, 0xb0, 0x82, 0x94, 0x19} +DEFINE_GUID!{CLSID_WICXMPMetadataWriter, + 0x1765e14e, 0x1bd4, 0x462e, 0xb6, 0xb1, 0x59, 0x0b, 0xf1, 0x26, 0x2a, 0xc6} +DEFINE_GUID!{CLSID_WICXMPStructMetadataReader, + 0x01b90d9a, 0x8209, 0x47f7, 0x9c, 0x52, 0xe1, 0x24, 0x4b, 0xf5, 0x0c, 0xed} +DEFINE_GUID!{CLSID_WICXMPStructMetadataWriter, + 0x22c21f93, 0x7ddb, 0x411c, 0x9b, 0x17, 0xc5, 0xb7, 0xbd, 0x06, 0x4a, 0xbc} +DEFINE_GUID!{CLSID_WICXMPBagMetadataReader, + 0xe7e79a30, 0x4f2c, 0x4fab, 0x8d, 0x00, 0x39, 0x4f, 0x2d, 0x6b, 0xbe, 0xbe} +DEFINE_GUID!{CLSID_WICXMPBagMetadataWriter, + 0xed822c8c, 0xd6be, 0x4301, 0xa6, 0x31, 0x0e, 0x14, 0x16, 0xba, 0xd2, 0x8f} +DEFINE_GUID!{CLSID_WICXMPSeqMetadataReader, + 0x7f12e753, 0xfc71, 0x43d7, 0xa5, 0x1d, 0x92, 0xf3, 0x59, 0x77, 0xab, 0xb5} +DEFINE_GUID!{CLSID_WICXMPSeqMetadataWriter, + 0x6d68d1de, 0xd432, 0x4b0f, 0x92, 0x3a, 0x09, 0x11, 0x83, 0xa9, 0xbd, 0xa7} +DEFINE_GUID!{CLSID_WICXMPAltMetadataReader, + 0xaa94dcc2, 0xb8b0, 0x4898, 0xb8, 0x35, 0x00, 0x0a, 0xab, 0xd7, 0x43, 0x93} +DEFINE_GUID!{CLSID_WICXMPAltMetadataWriter, + 0x076c2a6c, 0xf78f, 0x4c46, 0xa7, 0x23, 0x35, 0x83, 0xe7, 0x08, 0x76, 0xea} +DEFINE_GUID!{CLSID_WICLSDMetadataReader, + 0x41070793, 0x59e4, 0x479a, 0xa1, 0xf7, 0x95, 0x4a, 0xdc, 0x2e, 0xf5, 0xfc} +DEFINE_GUID!{CLSID_WICLSDMetadataWriter, + 0x73c037e7, 0xe5d9, 0x4954, 0x87, 0x6a, 0x6d, 0xa8, 0x1d, 0x6e, 0x57, 0x68} +DEFINE_GUID!{CLSID_WICGCEMetadataReader, + 0xb92e345d, 0xf52d, 0x41f3, 0xb5, 0x62, 0x08, 0x1b, 0xc7, 0x72, 0xe3, 0xb9} +DEFINE_GUID!{CLSID_WICGCEMetadataWriter, + 0xaf95dc76, 0x16b2, 0x47f4, 0xb3, 0xea, 0x3c, 0x31, 0x79, 0x66, 0x93, 0xe7} +DEFINE_GUID!{CLSID_WICIMDMetadataReader, + 0x7447a267, 0x0015, 0x42c8, 0xa8, 0xf1, 0xfb, 0x3b, 0x94, 0xc6, 0x83, 0x61} +DEFINE_GUID!{CLSID_WICIMDMetadataWriter, + 0x8c89071f, 0x452e, 0x4e95, 0x96, 0x82, 0x9d, 0x10, 0x24, 0x62, 0x71, 0x72} +DEFINE_GUID!{CLSID_WICAPEMetadataReader, + 0x1767b93a, 0xb021, 0x44ea, 0x92, 0x0f, 0x86, 0x3c, 0x11, 0xf4, 0xf7, 0x68} +DEFINE_GUID!{CLSID_WICAPEMetadataWriter, + 0xbd6edfca, 0x2890, 0x482f, 0xb2, 0x33, 0x8d, 0x73, 0x39, 0xa1, 0xcf, 0x8d} +DEFINE_GUID!{CLSID_WICJpegChrominanceMetadataReader, + 0x50b1904b, 0xf28f, 0x4574, 0x93, 0xf4, 0x0b, 0xad, 0xe8, 0x2c, 0x69, 0xe9} +DEFINE_GUID!{CLSID_WICJpegChrominanceMetadataWriter, + 0x3ff566f0, 0x6e6b, 0x49d4, 0x96, 0xe6, 0xb7, 0x88, 0x86, 0x69, 0x2c, 0x62} +DEFINE_GUID!{CLSID_WICJpegLuminanceMetadataReader, + 0x356f2f88, 0x05a6, 0x4728, 0xb9, 0xa4, 0x1b, 0xfb, 0xce, 0x04, 0xd8, 0x38} +DEFINE_GUID!{CLSID_WICJpegLuminanceMetadataWriter, + 0x1d583abc, 0x8a0e, 0x4657, 0x99, 0x82, 0xa3, 0x80, 0xca, 0x58, 0xfb, 0x4b} +DEFINE_GUID!{CLSID_WICJpegCommentMetadataReader, + 0x9f66347c, 0x60c4, 0x4c4d, 0xab, 0x58, 0xd2, 0x35, 0x86, 0x85, 0xf6, 0x07} +DEFINE_GUID!{CLSID_WICJpegCommentMetadataWriter, + 0xe573236f, 0x55b1, 0x4eda, 0x81, 0xea, 0x9f, 0x65, 0xdb, 0x02, 0x90, 0xd3} +DEFINE_GUID!{CLSID_WICGifCommentMetadataReader, + 0x32557d3b, 0x69dc, 0x4f95, 0x83, 0x6e, 0xf5, 0x97, 0x2b, 0x2f, 0x61, 0x59} +DEFINE_GUID!{CLSID_WICGifCommentMetadataWriter, + 0xa02797fc, 0xc4ae, 0x418c, 0xaf, 0x95, 0xe6, 0x37, 0xc7, 0xea, 0xd2, 0xa1} +DEFINE_GUID!{CLSID_WICPngGamaMetadataReader, + 0x3692ca39, 0xe082, 0x4350, 0x9e, 0x1f, 0x37, 0x04, 0xcb, 0x08, 0x3c, 0xd5} +DEFINE_GUID!{CLSID_WICPngGamaMetadataWriter, + 0xff036d13, 0x5d4b, 0x46dd, 0xb1, 0x0f, 0x10, 0x66, 0x93, 0xd9, 0xfe, 0x4f} +DEFINE_GUID!{CLSID_WICPngBkgdMetadataReader, + 0x0ce7a4a6, 0x03e8, 0x4a60, 0x9d, 0x15, 0x28, 0x2e, 0xf3, 0x2e, 0xe7, 0xda} +DEFINE_GUID!{CLSID_WICPngBkgdMetadataWriter, + 0x68e3f2fd, 0x31ae, 0x4441, 0xbb, 0x6a, 0xfd, 0x70, 0x47, 0x52, 0x5f, 0x90} +DEFINE_GUID!{CLSID_WICPngItxtMetadataReader, + 0xaabfb2fa, 0x3e1e, 0x4a8f, 0x89, 0x77, 0x55, 0x56, 0xfb, 0x94, 0xea, 0x23} +DEFINE_GUID!{CLSID_WICPngItxtMetadataWriter, + 0x31879719, 0xe751, 0x4df8, 0x98, 0x1d, 0x68, 0xdf, 0xf6, 0x77, 0x04, 0xed} +DEFINE_GUID!{CLSID_WICPngChrmMetadataReader, + 0xf90b5f36, 0x367b, 0x402a, 0x9d, 0xd1, 0xbc, 0x0f, 0xd5, 0x9d, 0x8f, 0x62} +DEFINE_GUID!{CLSID_WICPngChrmMetadataWriter, + 0xe23ce3eb, 0x5608, 0x4e83, 0xbc, 0xef, 0x27, 0xb1, 0x98, 0x7e, 0x51, 0xd7} +DEFINE_GUID!{CLSID_WICPngHistMetadataReader, + 0x877a0bb7, 0xa313, 0x4491, 0x87, 0xb5, 0x2e, 0x6d, 0x05, 0x94, 0xf5, 0x20} +DEFINE_GUID!{CLSID_WICPngHistMetadataWriter, + 0x8a03e749, 0x672e, 0x446e, 0xbf, 0x1f, 0x2c, 0x11, 0xd2, 0x33, 0xb6, 0xff} +DEFINE_GUID!{CLSID_WICPngIccpMetadataReader, + 0xf5d3e63b, 0xcb0f, 0x4628, 0xa4, 0x78, 0x6d, 0x82, 0x44, 0xbe, 0x36, 0xb1} +DEFINE_GUID!{CLSID_WICPngIccpMetadataWriter, + 0x16671e5f, 0x0ce6, 0x4cc4, 0x97, 0x68, 0xe8, 0x9f, 0xe5, 0x01, 0x8a, 0xde} +DEFINE_GUID!{CLSID_WICPngSrgbMetadataReader, + 0xfb40360c, 0x547e, 0x4956, 0xa3, 0xb9, 0xd4, 0x41, 0x88, 0x59, 0xba, 0x66} +DEFINE_GUID!{CLSID_WICPngSrgbMetadataWriter, + 0xa6ee35c6, 0x87ec, 0x47df, 0x9f, 0x22, 0x1d, 0x5a, 0xad, 0x84, 0x0c, 0x82} +DEFINE_GUID!{CLSID_WICPngTimeMetadataReader, + 0xd94edf02, 0xefe5, 0x4f0d, 0x85, 0xc8, 0xf5, 0xa6, 0x8b, 0x30, 0x00, 0xb1} +DEFINE_GUID!{CLSID_WICPngTimeMetadataWriter, + 0x1ab78400, 0xb5a3, 0x4d91, 0x8a, 0xce, 0x33, 0xfc, 0xd1, 0x49, 0x9b, 0xe6} +DEFINE_GUID!{CLSID_WICDdsMetadataReader, + 0x276c88ca, 0x7533, 0x4a86, 0xb6, 0x76, 0x66, 0xb3, 0x60, 0x80, 0xd4, 0x84} +DEFINE_GUID!{CLSID_WICDdsMetadataWriter, + 0xfd688bbd, 0x31ed, 0x4db7, 0xa7, 0x23, 0x93, 0x49, 0x27, 0xd3, 0x83, 0x67} +ENUM!{enum WICMetadataCreationOptions { + WICMetadataCreationDefault = 0, + WICMetadataCreationAllowUnknown = WICMetadataCreationDefault, + WICMetadataCreationFailUnknown = 0x10000, + WICMetadataCreationMask = 0xffff0000, +}} +ENUM!{enum WICPersistOptions { + WICPersistOptionDefault = 0, + WICPersistOptionLittleEndian = 0, + WICPersistOptionBigEndian = 0x1, + WICPersistOptionStrictFormat = 0x2, + WICPersistOptionNoCacheStream = 0x4, + WICPersistOptionPreferUTF8 = 0x8, + WICPersistOptionMask = 0xffff, +}} +RIDL!{#[uuid(0xfeaa2a8d, 0xb3f3, 0x43e4, 0xb2, 0x5c, 0xd1, 0xde, 0x99, 0x0a, 0x1a, 0xe1)] +interface IWICMetadataBlockReader(IWICMetadataBlockReaderVtbl): IUnknown(IUnknownVtbl) { + fn GetContainerFormat( + pguidContainerFormat: *mut GUID, + ) -> HRESULT, + fn GetCount( + pcCount: *mut UINT, + ) -> HRESULT, + fn GetReaderByIndex( + ppIMetadataReader: *mut *mut IWICMetadataReader, + ) -> HRESULT, + fn GetEnumerator( + ppIEnumMetadata: *mut IEnumUnknown, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x08fb9676, 0xb444, 0x41e8, 0x8d, 0xbe, 0x6a, 0x53, 0xa5, 0x42, 0xbf, 0xf1)] +interface IWICMetadataBlockWriter(IWICMetadataBlockWriterVtbl): + IWICMetadataBlockReader(IWICMetadataBlockReaderVtbl) { + fn InitializeFromBlockReader( + pIMDBlockReader: *mut IWICMetadataBlockReader, + ) -> HRESULT, + fn GetWriterByIndex( + ppIMetadataWriter: *mut *mut IWICMetadataWriter, + ) -> HRESULT, + fn AddWriter( + pIMetadataWriter: *mut IWICMetadataWriter, + ) -> HRESULT, + fn SetWriterByIndex( + pIMetadataWriter: *mut IWICMetadataWriter, + ) -> HRESULT, + fn RemoveWriterByIndex( + nIndex: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x9204fe99, 0xd8fc, 0x4fd5, 0xa0, 0x01, 0x95, 0x36, 0xb0, 0x67, 0xa8, 0x99)] +interface IWICMetadataReader(IWICMetadataReaderVtbl): IUnknown(IUnknownVtbl) { + fn GetMetadataFormat( + pguidMetadataFormat: *mut GUID, + ) -> HRESULT, + fn GetMetadataHandlerInfo( + ppIHandler: *mut *mut IWICMetadataHandlerInfo, + ) -> HRESULT, + fn GetCount( + pcCount: *mut UINT, + ) -> HRESULT, + fn GetValueByIndex( + nIndex: UINT, + pvarSchema: *mut PROPVARIANT, + pvarId: *mut PROPVARIANT, + pvarValue: *mut PROPVARIANT, + ) -> HRESULT, + fn GetValue( + pvarSchema: *const PROPVARIANT, + pvarId: *const PROPVARIANT, + pvarValue: *mut PROPVARIANT, + ) -> HRESULT, + fn GetEnumerator( + ppIEnumMetadata: *mut *mut IWICEnumMetadataItem, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xf7836e16, 0x3be0, 0x470b, 0x86, 0xbb, 0x16, 0x0d, 0x0a, 0xec, 0xd7, 0xde)] +interface IWICMetadataWriter(IWICMetadataWriterVtbl): IWICMetadataReader(IWICMetadataReaderVtbl) { + fn SetValue( + pvarSchema: *const PROPVARIANT, + pvarId: *const PROPVARIANT, + pvarValue: *const PROPVARIANT, + ) -> HRESULT, + fn SetValueByIndex( + nIndex: UINT, + pvarSchema: *const PROPVARIANT, + pvarId: *const PROPVARIANT, + pvarValue: *const PROPVARIANT, + ) -> HRESULT, + fn RemoveValue( + pvarSchema: *const PROPVARIANT, + pvarId: *const PROPVARIANT, + ) -> HRESULT, + fn RemoveValueByIndex( + nIndex: UINT, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x449494bc, 0xb468, 0x4927, 0x96, 0xd7, 0xba, 0x90, 0xd3, 0x1a, 0xb5, 0x05)] +interface IWICStreamProvider(IWICStreamProviderVtbl): IUnknown(IUnknownVtbl) { + fn GetStream( + ppIStream: *mut *mut IStream, + ) -> HRESULT, + fn GetPersistOptions( + pdwPersistOptions: *mut DWORD, + ) -> HRESULT, + fn GetPreferredVendorGUID( + pguidPreferredVendor: *mut GUID, + ) -> HRESULT, + fn RefreshStream() -> HRESULT, +}} +RIDL!{#[uuid(0x00675040, 0x6908, 0x45f8, 0x86, 0xa3, 0x49, 0xc7, 0xdf, 0xd6, 0xd9, 0xad)] +interface IWICPersistStream(IWICPersistStreamVtbl): IPersistStream(IPersistStreamVtbl) { + fn LoadEx( + pIStream: *mut IStream, + pguidPreferredVendor: *const GUID, + dwPersistOptions: DWORD, + ) -> HRESULT, + fn SaveEx( + pIStream: *mut IStream, + dwPersistOptions: DWORD, + fClearDirty: BOOL, + ) -> HRESULT, +}} +RIDL!{#[uuid(0xaba958bf, 0xc672, 0x44d1, 0x8d, 0x61, 0xce, 0x6d, 0xf2, 0xe6, 0x82, 0xc2)] +interface IWICMetadataHandlerInfo(IWICMetadataHandlerInfoVtbl): + IWICComponentInfo(IWICComponentInfoVtbl) { + fn GetMetadataFormat( + pguidMetadataFormat: *mut GUID, + ) -> HRESULT, + fn GetContainerFormats( + cContainerFormats: UINT, + pguidContainerFormats: *mut GUID, + pcchActual: *mut UINT, + ) -> HRESULT, + fn GetDeviceManufacturer( + cchDeviceManufacturer: UINT, + wzDeviceManufacturer: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, + fn GetDeviceModels( + cchDeviceModels: UINT, + wzDeviceModels: *mut WCHAR, + pcchActual: *mut UINT, + ) -> HRESULT, + fn DoesRequireFullStream( + pfRequiresFullStream: *mut BOOL, + ) -> HRESULT, + fn DoesSupportPadding( + pfSupportsPadding: *mut BOOL, + ) -> HRESULT, + fn DoesRequireFixedSize( + pfFixedSize: *mut BOOL, + ) -> HRESULT, +}} +STRUCT!{struct WICMetadataPattern { + Position: ULARGE_INTEGER, + Length: ULONG, + Pattern: *mut BYTE, + Mask: *mut BYTE, + DataOffset: ULARGE_INTEGER, +}} +RIDL!{#[uuid(0xeebf1f5b, 0x07c1, 0x4447, 0xa3, 0xab, 0x22, 0xac, 0xaf, 0x78, 0xa8, 0x04)] +interface IWICMetadataReaderInfo(IWICMetadataReaderInfoVtbl): + IWICMetadataHandlerInfo(IWICMetadataHandlerInfoVtbl) { + fn GetPatterns( + guidContainerFormat: REFGUID, + cbSize: UINT, + pPattern: *mut WICMetadataPattern, + pcCount: *mut UINT, + pcbActual: *mut UINT, + ) -> HRESULT, + fn MatchesPattern( + guidContainerFormat: REFGUID, + pIStream: *mut IStream, + pfMatches: *mut BOOL, + ) -> HRESULT, + fn CreateInstance( + ppIReader: *mut *mut IWICMetadataReader, + ) -> HRESULT, +}} +STRUCT!{struct WICMetadataHeader { + Position: ULARGE_INTEGER, + Length: ULONG, + Header: *mut BYTE, + DataOffset: ULARGE_INTEGER, +}} +RIDL!{#[uuid(0xb22e3fba, 0x3925, 0x4323, 0xb5, 0xc1, 0x9e, 0xbf, 0xc4, 0x30, 0xf2, 0x36)] +interface IWICMetadataWriterInfo(IWICMetadataWriterInfoVtbl): + IWICMetadataHandlerInfo(IWICMetadataHandlerInfoVtbl) { + fn GetHeader( + guidContainerFormat: REFGUID, + cbSize: UINT, + pHeader: *mut WICMetadataHeader, + pcbActual: *mut UINT, + ) -> HRESULT, + fn CreateInstance( + ppIWriter: *mut *mut IWICMetadataWriter, + ) -> HRESULT, +}} +RIDL!{#[uuid(0x412d0c3a, 0x9650, 0x44fa, 0xaf, 0x5b, 0xdd, 0x2a, 0x06, 0xc8, 0xe8, 0xfb)] +interface IWICComponentFactory(IWICComponentFactoryVtbl): + IWICImagingFactory(IWICImagingFactoryVtbl) { + fn CreateMetadataReader( + guidMetadataFormat: REFGUID, + pguidVendor: *const GUID, + dwOptions: DWORD, + pIStream: *mut IStream, + ppIReader: *mut *mut IWICMetadataReader, + ) -> HRESULT, + fn CreateMetadataReaderFromContainer( + guidContainerFormat: REFGUID, + pguidVendor: *const GUID, + dwOptions: DWORD, + pIStream: *mut IStream, + ppIReader: *mut *mut IWICMetadataReader, + ) -> HRESULT, + fn CreateMetadataWriter( + guidMetadataFormat: REFGUID, + pguidVendor: *const GUID, + dwMetadataOptions: DWORD, + ppIWriter: *mut *mut IWICMetadataWriter, + ) -> HRESULT, + fn CreateMetadataWriterFromReader( + pIReader: *mut IWICMetadataReader, + pguidVendor: *const GUID, + ppIWriter: *mut *mut IWICMetadataWriter, + ) -> HRESULT, + fn CreateQueryReaderFromBlockReader( + pIBlockReader: *mut IWICMetadataBlockReader, + ppIQueryReader: *mut *mut IWICMetadataQueryReader, + ) -> HRESULT, + fn CreateQueryWriterFromBlockWriter( + pIBlockWriter: *mut IWICMetadataBlockWriter, + ppIQueryWriter: *mut *mut IWICMetadataQueryWriter, + ) -> HRESULT, + fn CreateEncoderPropertyBag( + ppropOptions: *mut PROPBAG2, + cCount: UINT, + ppIPropertyBag: *mut *mut IPropertyBag2, + ) -> HRESULT, +}} +extern "system" { + pub fn WICMatchMetadataContent( + guidContainerFormat: REFGUID, + pguidVendor: *const GUID, + pIStream: *mut IStream, + pguidMetadataFormat: *mut GUID, + ) -> HRESULT; + pub fn WICSerializeMetadataContent( + guidContainerFormat: REFGUID, + pIWriter: *mut IWICMetadataWriter, + dwPersistOptions: DWORD, + pIStream: *mut IStream, + ) -> HRESULT; + pub fn WICGetMetadataContentSize( + guidContainerFormat: REFGUID, + pIWriter: *mut IWICMetadataWriter, + pcbSize: *mut ULARGE_INTEGER, + ) -> HRESULT; + pub fn BSTR_UserSize( + pFlags: *mut c_ulong, + Offset: c_ulong, + pBstr: *mut BSTR, + ) -> c_ulong; + pub fn BSTR_UserMarshal( + pFlags: *mut c_ulong, + pBuffer: *mut c_uchar, + pBstr: *mut BSTR, + ) -> *mut c_uchar; + pub fn BSTR_UserUnmarshal( + pFlags: *mut c_ulong, + pBuffer: *mut c_uchar, + pBstr: *mut BSTR, + ) -> *mut c_uchar; + pub fn BSTR_UserFree( + pFlags: *mut c_ulong, + pBstr: *mut BSTR, + ); + pub fn CLIPFORMAT_UserSize( + pFlags: *mut c_ulong, + Offset: c_ulong, + pCF: *mut CLIPFORMAT, + ) -> c_ulong; + pub fn CLIPFORMAT_UserMarshal( + pFlags: *mut c_ulong, + pBuffer: *mut c_uchar, + pCF: *mut CLIPFORMAT, + ) -> *mut c_uchar; + pub fn CLIPFORMAT_UserUnmarshal( + pFlags: *mut c_ulong, + pBuffer: *mut c_uchar, + pCF: *mut CLIPFORMAT, + ) -> *mut c_uchar; + pub fn CLIPFORMAT_UserFree( + pFlags: *mut c_ulong, + pCF: *mut CLIPFORMAT, + ); + pub fn LPSAFEARRAY_UserSize( + pFlags: *mut c_ulong, + Offset: c_ulong, + phBmp: *mut LPSAFEARRAY, + ) -> c_ulong; + pub fn LPSAFEARRAY_UserMarshal( + pFlags: *mut c_ulong, + pBuffer: *mut c_uchar, + pBstr: *mut LPSAFEARRAY, + ) -> *mut c_uchar; + pub fn LPSAFEARRAY_UserUnmarshal( + pFlags: *mut c_ulong, + pBuffer: *mut c_uchar, + pBstr: *mut LPSAFEARRAY, + ) -> *mut c_uchar; + pub fn LPSAFEARRAY_UserFree( + pFlags: *mut c_ulong, + pBstr: *mut LPSAFEARRAY, + ); +} diff --git a/bash-5.1/vendor/winapi/src/um/wincon.rs b/bash-5.1/vendor/winapi/src/um/wincon.rs new file mode 100644 index 0000000000000000000000000000000000000000..9eb3a229052a29796aec9a93d61a3fcc3050ebe4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wincon.rs @@ -0,0 +1,459 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module contains the public data structures, data types, and procedures exported by the NT +//! console subsystem. +use ctypes::c_void; +use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, LPWORD, UINT, ULONG, WORD}; +use shared::windef::{COLORREF, HWND}; +use um::minwinbase::SECURITY_ATTRIBUTES; +use um::wingdi::LF_FACESIZE; +use um::winnt::{CHAR, HANDLE, LPCSTR, LPCWSTR, LPSTR, LPWSTR, WCHAR}; +// Many definitions in wincontypes used to be defined in this file, so reexport them to avoid +// breakage. For clarity they are imported in the order they are defined in that file rather +// than winapi's usual alphabetical ordering, with some newlines and indentation to match their +// grouping in the file. +pub use um::wincontypes::{ + COORD, PCOORD, + SMALL_RECT, PSMALL_RECT, + KEY_EVENT_RECORD_uChar, KEY_EVENT_RECORD, PKEY_EVENT_RECORD, + RIGHT_ALT_PRESSED, LEFT_ALT_PRESSED, RIGHT_CTRL_PRESSED, LEFT_CTRL_PRESSED, SHIFT_PRESSED, + NUMLOCK_ON, SCROLLLOCK_ON, CAPSLOCK_ON, ENHANCED_KEY, NLS_DBCSCHAR, NLS_ALPHANUMERIC, + NLS_KATAKANA, NLS_HIRAGANA, NLS_ROMAN, NLS_IME_CONVERSION, NLS_IME_DISABLE, + MOUSE_EVENT_RECORD, PMOUSE_EVENT_RECORD, + FROM_LEFT_1ST_BUTTON_PRESSED, RIGHTMOST_BUTTON_PRESSED, FROM_LEFT_2ND_BUTTON_PRESSED, + FROM_LEFT_3RD_BUTTON_PRESSED, FROM_LEFT_4TH_BUTTON_PRESSED, MOUSE_MOVED, DOUBLE_CLICK, + MOUSE_WHEELED, MOUSE_HWHEELED, + WINDOW_BUFFER_SIZE_RECORD, PWINDOW_BUFFER_SIZE_RECORD, + MENU_EVENT_RECORD, PMENU_EVENT_RECORD, + FOCUS_EVENT_RECORD, PFOCUS_EVENT_RECORD, + INPUT_RECORD_Event, INPUT_RECORD, PINPUT_RECORD, + KEY_EVENT, MOUSE_EVENT, WINDOW_BUFFER_SIZE_EVENT, MENU_EVENT, FOCUS_EVENT, + CHAR_INFO_Char, CHAR_INFO, PCHAR_INFO, + CONSOLE_FONT_INFO, PCONSOLE_FONT_INFO +}; +pub const FOREGROUND_BLUE: WORD = 0x0001; +pub const FOREGROUND_GREEN: WORD = 0x0002; +pub const FOREGROUND_RED: WORD = 0x0004; +pub const FOREGROUND_INTENSITY: WORD = 0x0008; +pub const BACKGROUND_BLUE: WORD = 0x0010; +pub const BACKGROUND_GREEN: WORD = 0x0020; +pub const BACKGROUND_RED: WORD = 0x0040; +pub const BACKGROUND_INTENSITY: WORD = 0x0080; +pub const COMMON_LVB_LEADING_BYTE: WORD = 0x0100; +pub const COMMON_LVB_TRAILING_BYTE: WORD = 0x0200; +pub const COMMON_LVB_GRID_HORIZONTAL: WORD = 0x0400; +pub const COMMON_LVB_GRID_LVERTICAL: WORD = 0x0800; +pub const COMMON_LVB_GRID_RVERTICAL: WORD = 0x1000; +pub const COMMON_LVB_REVERSE_VIDEO: WORD = 0x4000; +pub const COMMON_LVB_UNDERSCORE: WORD = 0x8000; +pub const COMMON_LVB_SBCSDBCS: WORD = 0x0300; +STRUCT!{struct CONSOLE_SCREEN_BUFFER_INFO { + dwSize: COORD, + dwCursorPosition: COORD, + wAttributes: WORD, + srWindow: SMALL_RECT, + dwMaximumWindowSize: COORD, +}} +pub type PCONSOLE_SCREEN_BUFFER_INFO = *mut CONSOLE_SCREEN_BUFFER_INFO; +STRUCT!{struct CONSOLE_SCREEN_BUFFER_INFOEX { + cbSize: ULONG, + dwSize: COORD, + dwCursorPosition: COORD, + wAttributes: WORD, + srWindow: SMALL_RECT, + dwMaximumWindowSize: COORD, + wPopupAttributes: WORD, + bFullscreenSupported: BOOL, + ColorTable: [COLORREF; 16], +}} +pub type PCONSOLE_SCREEN_BUFFER_INFOEX = *mut CONSOLE_SCREEN_BUFFER_INFOEX; +STRUCT!{struct CONSOLE_CURSOR_INFO { + dwSize: DWORD, + bVisible: BOOL, +}} +pub type PCONSOLE_CURSOR_INFO = *mut CONSOLE_CURSOR_INFO; +STRUCT!{struct CONSOLE_FONT_INFOEX { + cbSize: ULONG, + nFont: DWORD, + dwFontSize: COORD, + FontFamily: UINT, + FontWeight: UINT, + FaceName: [WCHAR; LF_FACESIZE], +}} +pub type PCONSOLE_FONT_INFOEX = *mut CONSOLE_FONT_INFOEX; +pub const HISTORY_NO_DUP_FLAG: DWORD = 0x1; +STRUCT!{struct CONSOLE_HISTORY_INFO { + cbSize: UINT, + HistoryBufferSize: UINT, + NumberOfHistoryBuffers: UINT, + dwFlags: DWORD, +}} +pub type PCONSOLE_HISTORY_INFO = *mut CONSOLE_HISTORY_INFO; +STRUCT!{struct CONSOLE_SELECTION_INFO { + dwFlags: DWORD, + dwSelectionAnchor: COORD, + srSelection: SMALL_RECT, +}} +pub type PCONSOLE_SELECTION_INFO = *mut CONSOLE_SELECTION_INFO; +pub const CONSOLE_NO_SELECTION: DWORD = 0x0000; +pub const CONSOLE_SELECTION_IN_PROGRESS: DWORD = 0x0001; +pub const CONSOLE_SELECTION_NOT_EMPTY: DWORD = 0x0002; +pub const CONSOLE_MOUSE_SELECTION: DWORD = 0x0004; +pub const CONSOLE_MOUSE_DOWN: DWORD = 0x0008; +FN!{stdcall PHANDLER_ROUTINE( + CtrlType: DWORD, +) -> BOOL} +pub const CTRL_C_EVENT: DWORD = 0; +pub const CTRL_BREAK_EVENT: DWORD = 1; +pub const CTRL_CLOSE_EVENT: DWORD = 2; +pub const CTRL_LOGOFF_EVENT: DWORD = 5; +pub const CTRL_SHUTDOWN_EVENT: DWORD = 6; +pub const ENABLE_PROCESSED_INPUT: DWORD = 0x0001; +pub const ENABLE_LINE_INPUT: DWORD = 0x0002; +pub const ENABLE_ECHO_INPUT: DWORD = 0x0004; +pub const ENABLE_WINDOW_INPUT: DWORD = 0x0008; +pub const ENABLE_MOUSE_INPUT: DWORD = 0x0010; +pub const ENABLE_INSERT_MODE: DWORD = 0x0020; +pub const ENABLE_QUICK_EDIT_MODE: DWORD = 0x0040; +pub const ENABLE_EXTENDED_FLAGS: DWORD = 0x0080; +pub const ENABLE_AUTO_POSITION: DWORD = 0x0100; +pub const ENABLE_VIRTUAL_TERMINAL_INPUT: DWORD = 0x0200; +pub const ENABLE_PROCESSED_OUTPUT: DWORD = 0x0001; +pub const ENABLE_WRAP_AT_EOL_OUTPUT: DWORD = 0x0002; +pub const ENABLE_VIRTUAL_TERMINAL_PROCESSING: DWORD = 0x0004; +pub const DISABLE_NEWLINE_AUTO_RETURN: DWORD = 0x0008; +pub const ENABLE_LVB_GRID_WORLDWIDE: DWORD = 0x0010; +extern "system" { + pub fn PeekConsoleInputW( + hConsoleInput: HANDLE, + lpBuffer: PINPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsRead: LPDWORD, + ) -> BOOL; + pub fn WriteConsoleInputA( + hConsoleInput: HANDLE, + lpBuffer: *const INPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsWritten: LPDWORD, + ) -> BOOL; + pub fn WriteConsoleInputW( + hConsoleInput: HANDLE, + lpBuffer: *const INPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsWritten: LPDWORD, + ) -> BOOL; + pub fn ReadConsoleOutputA( + hConsoleOutput: HANDLE, + lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, + dwBufferCoord: COORD, + lpReadRegion: PSMALL_RECT, + ) -> BOOL; + pub fn ReadConsoleOutputW( + hConsoleOutput: HANDLE, + lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, + dwBufferCoord: COORD, + lpReadRegion: PSMALL_RECT, + ) -> BOOL; + pub fn WriteConsoleOutputA( + hConsoleOutput: HANDLE, + lpBuffer: *const CHAR_INFO, + dwBufferSize: COORD, + dwBufferCoord: COORD, + lpWriteRegion: PSMALL_RECT, + ) -> BOOL; + pub fn WriteConsoleOutputW( + hConsoleOutput: HANDLE, + lpBuffer: *const CHAR_INFO, + dwBufferSize: COORD, + dwBufferCoord: COORD, + lpWriteRegion: PSMALL_RECT, + ) -> BOOL; + pub fn ReadConsoleOutputCharacterA( + hConsoleOutput: HANDLE, + lpCharacter: LPSTR, + nLength: DWORD, + dwReadCoord: COORD, + lpNumberOfCharsRead: LPDWORD, + ) -> BOOL; + pub fn ReadConsoleOutputCharacterW( + hConsoleOutput: HANDLE, + lpCharacter: LPWSTR, + nLength: DWORD, + dwReadCoord: COORD, + lpNumberOfCharsRead: LPDWORD, + ) -> BOOL; + pub fn ReadConsoleOutputAttribute( + hConsoleOutput: HANDLE, + lpAttribute: LPWORD, + nLength: DWORD, + dwReadCoord: COORD, + lpNumberOfAttrsRead: LPDWORD, + ) -> BOOL; + pub fn WriteConsoleOutputCharacterA( + hConsoleOutput: HANDLE, + lpCharacter: LPCSTR, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD, + ) -> BOOL; + pub fn WriteConsoleOutputCharacterW( + hConsoleOutput: HANDLE, + lpCharacter: LPCWSTR, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD, + ) -> BOOL; + pub fn WriteConsoleOutputAttribute( + hConsoleOutput: HANDLE, + lpAttribute: *const WORD, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfAttrsWritten: LPDWORD, + ) -> BOOL; + pub fn FillConsoleOutputCharacterA( + hConsoleOutput: HANDLE, + cCharacter: CHAR, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD, + ) -> BOOL; + pub fn FillConsoleOutputCharacterW( + hConsoleOutput: HANDLE, + cCharacter: WCHAR, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD, + ) -> BOOL; + pub fn FillConsoleOutputAttribute( + hConsoleOutput: HANDLE, + wAttribute: WORD, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfAttrsWritten: LPDWORD, + ) -> BOOL; +} +pub const CONSOLE_REAL_OUTPUT_HANDLE: *mut c_void = -2isize as *mut c_void; +pub const CONSOLE_REAL_INPUT_HANDLE: *mut c_void = -3isize as *mut c_void; +extern "system" { + pub fn GetConsoleScreenBufferInfo( + hConsoleOutput: HANDLE, + lpConsoleScreenBufferInfo: PCONSOLE_SCREEN_BUFFER_INFO, + ) -> BOOL; + pub fn GetConsoleScreenBufferInfoEx( + hConsoleOutput: HANDLE, + lpConsoleScreenBufferInfoEx: PCONSOLE_SCREEN_BUFFER_INFOEX, + ) -> BOOL; + pub fn SetConsoleScreenBufferInfoEx( + hConsoleOutput: HANDLE, + lpConsoleScreenBufferInfoEx: PCONSOLE_SCREEN_BUFFER_INFOEX, + ) -> BOOL; + pub fn GetLargestConsoleWindowSize( + hConsoleOutput: HANDLE, + ) -> COORD; + pub fn GetConsoleCursorInfo( + hConsoleOutput: HANDLE, + lpConsoleCursorInfo: PCONSOLE_CURSOR_INFO, + ) -> BOOL; + pub fn GetCurrentConsoleFont( + hConsoleOutput: HANDLE, + bMaximumWindow: BOOL, + lpConsoleCurrentFont: PCONSOLE_FONT_INFO, + ) -> BOOL; + pub fn GetCurrentConsoleFontEx( + hConsoleOutput: HANDLE, + bMaximumWindow: BOOL, + lpConsoleCurrentFontEx: PCONSOLE_FONT_INFOEX, + ) -> BOOL; + pub fn SetCurrentConsoleFontEx( + hConsoleOutput: HANDLE, + bMaximumWindow: BOOL, + lpConsoleCurrentFontEx: PCONSOLE_FONT_INFOEX, + ) -> BOOL; + pub fn GetConsoleHistoryInfo( + lpConsoleHistoryInfo: PCONSOLE_HISTORY_INFO, + ) -> BOOL; + pub fn SetConsoleHistoryInfo( + lpConsoleHistoryInfo: PCONSOLE_HISTORY_INFO, + ) -> BOOL; + pub fn GetConsoleFontSize( + hConsoleOutput: HANDLE, + nFont: DWORD, + ) -> COORD; + pub fn GetConsoleSelectionInfo( + lpConsoleSelectionInfo: PCONSOLE_SELECTION_INFO, + ) -> BOOL; + pub fn GetNumberOfConsoleMouseButtons( + lpNumberOfMouseButtons: LPDWORD, + ) -> BOOL; + pub fn SetConsoleActiveScreenBuffer( + hConsoleOutput: HANDLE, + ) -> BOOL; + pub fn FlushConsoleInputBuffer( + hConsoleInput: HANDLE, + ) -> BOOL; + pub fn SetConsoleScreenBufferSize( + hConsoleOutput: HANDLE, + dwSize: COORD, + ) -> BOOL; + pub fn SetConsoleCursorPosition( + hConsoleOutput: HANDLE, + dwCursorPosition: COORD, + ) -> BOOL; + pub fn SetConsoleCursorInfo( + hConsoleOutput: HANDLE, + lpConsoleCursorInfo: *const CONSOLE_CURSOR_INFO, + ) -> BOOL; + pub fn ScrollConsoleScreenBufferA( + hConsoleOutput: HANDLE, + lpScrollRectangle: *const SMALL_RECT, + lpClipRectangle: *const SMALL_RECT, + dwDestinationOrigin: COORD, + lpFill: *const CHAR_INFO, + ) -> BOOL; + pub fn ScrollConsoleScreenBufferW( + hConsoleOutput: HANDLE, + lpScrollRectangle: *const SMALL_RECT, + lpClipRectangle: *const SMALL_RECT, + dwDestinationOrigin: COORD, + lpFill: *const CHAR_INFO, + ) -> BOOL; + pub fn SetConsoleWindowInfo( + hConsoleOutput: HANDLE, + bAbsolute: BOOL, + lpConsoleWindow: *const SMALL_RECT, + ) -> BOOL; + pub fn SetConsoleTextAttribute( + hConsoleOutput: HANDLE, + wAttributes: WORD, + ) -> BOOL; + pub fn GenerateConsoleCtrlEvent( + dwCtrlEvent: DWORD, + dwProcessGroupId: DWORD, + ) -> BOOL; + pub fn FreeConsole() -> BOOL; + pub fn AttachConsole( + dwProcessId: DWORD, + ) -> BOOL; +} +pub const ATTACH_PARENT_PROCESS: DWORD = 0xFFFFFFFF; +extern "system" { + pub fn GetConsoleTitleA( + lpConsoleTitle: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetConsoleTitleW( + lpConsoleTitle: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetConsoleOriginalTitleA( + lpConsoleTitle: LPSTR, + nSize: DWORD, + ) -> DWORD; + pub fn GetConsoleOriginalTitleW( + lpConsoleTitle: LPWSTR, + nSize: DWORD, + ) -> DWORD; + pub fn SetConsoleTitleA( + lpConsoleTitle: LPCSTR, + ) -> BOOL; + pub fn SetConsoleTitleW( + lpConsoleTitle: LPCWSTR, + ) -> BOOL; +} +STRUCT!{struct CONSOLE_READCONSOLE_CONTROL { + nLength: ULONG, + nInitialChars: ULONG, + dwCtrlWakeupMask: ULONG, + dwControlKeyState: ULONG, +}} +pub type PCONSOLE_READCONSOLE_CONTROL = *mut CONSOLE_READCONSOLE_CONTROL; +pub const CONSOLE_TEXTMODE_BUFFER: DWORD = 1; +extern "system" { + pub fn CreateConsoleScreenBuffer( + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + lpSecurityAttributes: *const SECURITY_ATTRIBUTES, + dwFlags: DWORD, + lpScreenBufferData: LPVOID, + ) -> HANDLE; + pub fn SetConsoleCP( + wCodePageID: UINT, + ) -> BOOL; + pub fn SetConsoleOutputCP( + wCodePageID: UINT, + ) -> BOOL; +} +pub const CONSOLE_FULLSCREEN: DWORD = 1; +pub const CONSOLE_FULLSCREEN_HARDWARE: DWORD = 2; +extern "system" { + pub fn GetConsoleDisplayMode( + lpModeFlags: LPDWORD, + ) -> BOOL; +} +pub const CONSOLE_FULLSCREEN_MODE: DWORD = 1; +pub const CONSOLE_WINDOWED_MODE: DWORD = 2; +extern "system" { + pub fn SetConsoleDisplayMode( + hConsoleOutput: HANDLE, + dwFlags: DWORD, + lpNewScreenBufferDimensions: PCOORD, + ) -> BOOL; + pub fn GetConsoleWindow() -> HWND; + pub fn GetConsoleProcessList( + lpdwProcessList: LPDWORD, + dwProcessCount: DWORD, + ) -> DWORD; + pub fn AddConsoleAliasA( + Source: LPSTR, + Target: LPSTR, + ExeName: LPSTR, + ) -> BOOL; + pub fn AddConsoleAliasW( + Source: LPWSTR, + Target: LPWSTR, + ExeName: LPWSTR, + ) -> BOOL; + pub fn GetConsoleAliasA( + Source: LPSTR, + TargetBuffer: LPSTR, + TargetBufferLength: DWORD, + ExeName: LPSTR, + ) -> DWORD; + pub fn GetConsoleAliasW( + Source: LPWSTR, + TargetBuffer: LPWSTR, + TargetBufferLength: DWORD, + ExeName: LPWSTR, + ) -> DWORD; + pub fn GetConsoleAliasesLengthA( + ExeName: LPSTR, + ) -> DWORD; + pub fn GetConsoleAliasesLengthW( + ExeName: LPWSTR, + ) -> DWORD; + pub fn GetConsoleAliasExesLengthA() -> DWORD; + pub fn GetConsoleAliasExesLengthW() -> DWORD; + pub fn GetConsoleAliasesA( + AliasBuffer: LPSTR, + AliasBufferLength: DWORD, + ExeName: LPSTR, + ) -> DWORD; + pub fn GetConsoleAliasesW( + AliasBuffer: LPWSTR, + AliasBufferLength: DWORD, + ExeName: LPWSTR, + ) -> DWORD; + pub fn GetConsoleAliasExesA( + ExeNameBuffer: LPSTR, + ExeNameBufferLength: DWORD, + ) -> DWORD; + pub fn GetConsoleAliasExesW( + ExeNameBuffer: LPWSTR, + ExeNameBufferLength: DWORD, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/wincontypes.rs b/bash-5.1/vendor/winapi/src/um/wincontypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..ab37d0201745718cfe4bde40173dbef1b8811a2e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wincontypes.rs @@ -0,0 +1,114 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module contains the public data structures, data types, and procedures exported by the NT +//! console subsystem. +use ctypes::c_void; +use shared::minwindef::{BOOL, DWORD, UINT, WORD}; +use um::winnt::{CHAR, SHORT, WCHAR}; +STRUCT!{struct COORD { + X: SHORT, + Y: SHORT, +}} +pub type PCOORD = *mut COORD; +STRUCT!{struct SMALL_RECT { + Left: SHORT, + Top: SHORT, + Right: SHORT, + Bottom: SHORT, +}} +pub type PSMALL_RECT = *mut SMALL_RECT; +UNION!{union KEY_EVENT_RECORD_uChar { + [u16; 1], + UnicodeChar UnicodeChar_mut: WCHAR, + AsciiChar AsciiChar_mut: CHAR, +}} +STRUCT!{struct KEY_EVENT_RECORD { + bKeyDown: BOOL, + wRepeatCount: WORD, + wVirtualKeyCode: WORD, + wVirtualScanCode: WORD, + uChar: KEY_EVENT_RECORD_uChar, + dwControlKeyState: DWORD, +}} +pub type PKEY_EVENT_RECORD = *mut KEY_EVENT_RECORD; +pub const RIGHT_ALT_PRESSED: DWORD = 0x0001; +pub const LEFT_ALT_PRESSED: DWORD = 0x0002; +pub const RIGHT_CTRL_PRESSED: DWORD = 0x0004; +pub const LEFT_CTRL_PRESSED: DWORD = 0x0008; +pub const SHIFT_PRESSED: DWORD = 0x0010; +pub const NUMLOCK_ON: DWORD = 0x0020; +pub const SCROLLLOCK_ON: DWORD = 0x0040; +pub const CAPSLOCK_ON: DWORD = 0x0080; +pub const ENHANCED_KEY: DWORD = 0x0100; +pub const NLS_DBCSCHAR: DWORD = 0x00010000; +pub const NLS_ALPHANUMERIC: DWORD = 0x00000000; +pub const NLS_KATAKANA: DWORD = 0x00020000; +pub const NLS_HIRAGANA: DWORD = 0x00040000; +pub const NLS_ROMAN: DWORD = 0x00400000; +pub const NLS_IME_CONVERSION: DWORD = 0x00800000; +pub const NLS_IME_DISABLE: DWORD = 0x20000000; +STRUCT!{struct MOUSE_EVENT_RECORD { + dwMousePosition: COORD, + dwButtonState: DWORD, + dwControlKeyState: DWORD, + dwEventFlags: DWORD, +}} +pub type PMOUSE_EVENT_RECORD = *mut MOUSE_EVENT_RECORD; +pub const FROM_LEFT_1ST_BUTTON_PRESSED: DWORD = 0x0001; +pub const RIGHTMOST_BUTTON_PRESSED: DWORD = 0x0002; +pub const FROM_LEFT_2ND_BUTTON_PRESSED: DWORD = 0x0004; +pub const FROM_LEFT_3RD_BUTTON_PRESSED: DWORD = 0x0008; +pub const FROM_LEFT_4TH_BUTTON_PRESSED: DWORD = 0x0010; +pub const MOUSE_MOVED: DWORD = 0x0001; +pub const DOUBLE_CLICK: DWORD = 0x0002; +pub const MOUSE_WHEELED: DWORD = 0x0004; +pub const MOUSE_HWHEELED: DWORD = 0x0008; +STRUCT!{struct WINDOW_BUFFER_SIZE_RECORD { + dwSize: COORD, +}} +pub type PWINDOW_BUFFER_SIZE_RECORD = *mut WINDOW_BUFFER_SIZE_RECORD; +STRUCT!{struct MENU_EVENT_RECORD { + dwCommandId: UINT, +}} +pub type PMENU_EVENT_RECORD = *mut MENU_EVENT_RECORD; +STRUCT!{struct FOCUS_EVENT_RECORD { + bSetFocus: BOOL, +}} +pub type PFOCUS_EVENT_RECORD = *mut FOCUS_EVENT_RECORD; +UNION!{union INPUT_RECORD_Event { + [u32; 4], + KeyEvent KeyEvent_mut: KEY_EVENT_RECORD, + MouseEvent MouseEvent_mut: MOUSE_EVENT_RECORD, + WindowBufferSizeEvent WindowBufferSizeEvent_mut: WINDOW_BUFFER_SIZE_RECORD, + MenuEvent MenuEvent_mut: MENU_EVENT_RECORD, + FocusEvent FocusEvent_mut: FOCUS_EVENT_RECORD, +}} +STRUCT!{struct INPUT_RECORD { + EventType: WORD, + Event: INPUT_RECORD_Event, +}} +pub type PINPUT_RECORD = *mut INPUT_RECORD; +pub const KEY_EVENT: WORD = 0x0001; +pub const MOUSE_EVENT: WORD = 0x0002; +pub const WINDOW_BUFFER_SIZE_EVENT: WORD = 0x0004; +pub const MENU_EVENT: WORD = 0x0008; +pub const FOCUS_EVENT: WORD = 0x0010; +UNION!{union CHAR_INFO_Char { + [u16; 1], + UnicodeChar UnicodeChar_mut: WCHAR, + AsciiChar AsciiChar_mut: CHAR, +}} +STRUCT!{struct CHAR_INFO { + Char: CHAR_INFO_Char, + Attributes: WORD, +}} +pub type PCHAR_INFO = *mut CHAR_INFO; +STRUCT!{struct CONSOLE_FONT_INFO { + nFont: DWORD, + dwFontSize: COORD, +}} +pub type PCONSOLE_FONT_INFO = *mut CONSOLE_FONT_INFO; +pub type HPCON = *mut c_void; diff --git a/bash-5.1/vendor/winapi/src/um/wincred.rs b/bash-5.1/vendor/winapi/src/um/wincred.rs new file mode 100644 index 0000000000000000000000000000000000000000..660837e73cd1f6b8470511e6da9f2ba9578c5e8c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wincred.rs @@ -0,0 +1,532 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Authentication API Prototypes and Definitions +use shared::minwindef::{ + BOOL, DWORD, FILETIME, LPBYTE, LPCVOID, LPDWORD, LPVOID, PBOOL, PBYTE, UCHAR, ULONG +}; +use shared::windef::{HBITMAP, HWND}; +use um::sspi::PCtxtHandle; +use um::winnt::{CHAR, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PCSTR, PCWSTR, PSTR, PVOID, PWSTR, WCHAR}; +// STATUS_* +pub const NERR_BASE: DWORD = 2100; +pub const NERR_PasswordExpired: DWORD = NERR_BASE + 142; +pub const CRED_MAX_STRING_LENGTH: DWORD = 256; +pub const CRED_MAX_USERNAME_LENGTH: DWORD = 256 + 1 + 256; +pub const CRED_MAX_GENERIC_TARGET_NAME_LENGTH: DWORD = 32767; +pub const CRED_MAX_DOMAIN_TARGET_NAME_LENGTH: DWORD = 256 + 1 + 80; +pub const CRED_MAX_TARGETNAME_NAMESPACE_LENGTH: DWORD = 256; +pub const CRED_MAX_TARGETNAME_ATTRIBUTE_LENGTH: DWORD = 256; +pub const CRED_MAX_VALUE_SIZE: DWORD = 256; +pub const CRED_MAX_ATTRIBUTES: DWORD = 64; +STRUCT!{struct CREDENTIAL_ATTRIBUTEA { + Keyword: LPSTR, + Flags: DWORD, + ValueSize: DWORD, + Value: LPBYTE, +}} +pub type PCREDENTIAL_ATTRIBUTEA = *mut CREDENTIAL_ATTRIBUTEA; +STRUCT!{struct CREDENTIAL_ATTRIBUTEW { + Keyword: LPWSTR, + Flags: DWORD, + ValueSize: DWORD, + Value: LPBYTE, +}} +pub type PCREDENTIAL_ATTRIBUTEW = *mut CREDENTIAL_ATTRIBUTEW; +pub const CRED_LOGON_TYPES_MASK: DWORD = 0xF000; +pub const CRED_FLAGS_PASSWORD_FOR_CERT: DWORD = 0x0001; +pub const CRED_FLAGS_PROMPT_NOW: DWORD = 0x0002; +pub const CRED_FLAGS_USERNAME_TARGET: DWORD = 0x0004; +pub const CRED_FLAGS_OWF_CRED_BLOB: DWORD = 0x0008; +pub const CRED_FLAGS_REQUIRE_CONFIRMATION: DWORD = 0x0010; +pub const CRED_FLAGS_WILDCARD_MATCH: DWORD = 0x0020; +pub const CRED_FLAGS_VALID_FLAGS: DWORD = 0xF03F; +pub const CRED_FLAGS_VALID_INPUT_FLAGS: DWORD = 0xF01F; +pub const CRED_TYPE_GENERIC: DWORD = 1; +pub const CRED_TYPE_DOMAIN_PASSWORD: DWORD = 2; +pub const CRED_TYPE_DOMAIN_CERTIFICATE: DWORD = 3; +pub const CRED_TYPE_DOMAIN_VISIBLE_PASSWORD: DWORD = 4; +pub const CRED_TYPE_GENERIC_CERTIFICATE: DWORD = 5; +pub const CRED_TYPE_DOMAIN_EXTENDED: DWORD = 6; +pub const CRED_TYPE_MAXIMUM: DWORD = 7; +pub const CRED_TYPE_MAXIMUM_EX: DWORD = CRED_TYPE_MAXIMUM + 1000; +pub const CRED_MAX_CREDENTIAL_BLOB_SIZE: DWORD = 5 * 512; +pub const CRED_PERSIST_NONE: DWORD = 0; +pub const CRED_PERSIST_SESSION: DWORD = 1; +pub const CRED_PERSIST_LOCAL_MACHINE: DWORD = 2; +pub const CRED_PERSIST_ENTERPRISE: DWORD = 3; +STRUCT!{struct CREDENTIALA { + Flags: DWORD, + Type: DWORD, + TargetName: LPSTR, + Comment: LPSTR, + LastWritten: FILETIME, + CredentialBlobSize: DWORD, + CredentialBlob: LPBYTE, + Persist: DWORD, + AttributeCount: DWORD, + Attributes: PCREDENTIAL_ATTRIBUTEA, + TargetAlias: LPSTR, + UserName: LPSTR, +}} +pub type PCREDENTIALA = *mut CREDENTIALA; +STRUCT!{struct CREDENTIALW { + Flags: DWORD, + Type: DWORD, + TargetName: LPWSTR, + Comment: LPWSTR, + LastWritten: FILETIME, + CredentialBlobSize: DWORD, + CredentialBlob: LPBYTE, + Persist: DWORD, + AttributeCount: DWORD, + Attributes: PCREDENTIAL_ATTRIBUTEW, + TargetAlias: LPWSTR, + UserName: LPWSTR, +}} +pub type PCREDENTIALW = *mut CREDENTIALW; +pub const CRED_TI_SERVER_FORMAT_UNKNOWN: ULONG = 0x0001; +pub const CRED_TI_DOMAIN_FORMAT_UNKNOWN: ULONG = 0x0002; +pub const CRED_TI_ONLY_PASSWORD_REQUIRED: ULONG = 0x0004; +pub const CRED_TI_USERNAME_TARGET: ULONG = 0x0008; +pub const CRED_TI_CREATE_EXPLICIT_CRED: ULONG = 0x0010; +pub const CRED_TI_WORKGROUP_MEMBER: ULONG = 0x0020; +pub const CRED_TI_VALID_FLAGS: ULONG = 0xF07F; +STRUCT!{struct CREDENTIAL_TARGET_INFORMATIONA { + TargetName: LPSTR, + NetbiosServerName: LPSTR, + DnsServerName: LPSTR, + NetbiosDomainName: LPSTR, + DnsDomainName: LPSTR, + DnsTreeName: LPSTR, + PackageName: LPSTR, + Flags: ULONG, + CredTypeCount: DWORD, + CredTypes: LPDWORD, +}} +pub type PCREDENTIAL_TARGET_INFORMATIONA = *mut CREDENTIAL_TARGET_INFORMATIONA; +STRUCT!{struct CREDENTIAL_TARGET_INFORMATIONW { + TargetName: LPWSTR, + NetbiosServerName: LPWSTR, + DnsServerName: LPWSTR, + NetbiosDomainName: LPWSTR, + DnsDomainName: LPWSTR, + DnsTreeName: LPWSTR, + PackageName: LPWSTR, + Flags: ULONG, + CredTypeCount: DWORD, + CredTypes: LPDWORD, +}} +pub type PCREDENTIAL_TARGET_INFORMATIONW = *mut CREDENTIAL_TARGET_INFORMATIONW; +pub const CERT_HASH_LENGTH: usize = 20; +STRUCT!{struct CERT_CREDENTIAL_INFO { + cbSize: ULONG, + rgbHashOfCert: [UCHAR; CERT_HASH_LENGTH], +}} +pub type PCERT_CREDENTIAL_INFO = *mut CERT_CREDENTIAL_INFO; +STRUCT!{struct USERNAME_TARGET_CREDENTIAL_INFO { + UserName: LPWSTR, +}} +pub type PUSERNAME_TARGET_CREDENTIAL_INFO = *mut USERNAME_TARGET_CREDENTIAL_INFO; +STRUCT!{struct BINARY_BLOB_CREDENTIAL_INFO { + cbBlob: ULONG, + pbBlob: LPBYTE, +}} +pub type PBINARY_BLOB_CREDENTIAL_INFO = *mut BINARY_BLOB_CREDENTIAL_INFO; +ENUM!{enum CRED_MARSHAL_TYPE { + CertCredential = 1, + UsernameTargetCredential, + BinaryBlobCredential, + UsernameForPackedCredentials, +}} +pub type PCRED_MARSHAL_TYPE = *mut CRED_MARSHAL_TYPE; +ENUM!{enum CRED_PROTECTION_TYPE { + CredUnprotected, + CredUserProtection, + CredTrustedProtection, +}} +pub type PCRED_PROTECTION_TYPE = *mut CRED_PROTECTION_TYPE; +pub const CRED_PACK_PROTECTED_CREDENTIALS: DWORD = 0x1; +pub const CRED_PACK_WOW_BUFFER: DWORD = 0x2; +pub const CRED_PACK_GENERIC_CREDENTIALS: DWORD = 0x4; +pub const CRED_PACK_ID_PROVIDER_CREDENTIALS: DWORD = 0x8; +STRUCT!{struct CREDUI_INFOA { + cbSize: DWORD, + hwndParent: HWND, + pszMessageText: PCSTR, + pszCaptionText: PCSTR, + hbmBanner: HBITMAP, +}} +pub type PCREDUI_INFOA = *mut CREDUI_INFOA; +STRUCT!{struct CREDUI_INFOW { + cbSize: DWORD, + hwndParent: HWND, + pszMessageText: PCWSTR, + pszCaptionText: PCWSTR, + hbmBanner: HBITMAP, +}} +pub type PCREDUI_INFOW = *mut CREDUI_INFOW; +pub const CREDUI_MAX_MESSAGE_LENGTH: DWORD = 1024; +pub const CREDUI_MAX_CAPTION_LENGTH: DWORD = 128; +pub const CREDUI_MAX_GENERIC_TARGET_LENGTH: DWORD = CRED_MAX_GENERIC_TARGET_NAME_LENGTH; +pub const CREDUI_MAX_DOMAIN_TARGET_LENGTH: DWORD = CRED_MAX_DOMAIN_TARGET_NAME_LENGTH; +pub const CREDUI_MAX_USERNAME_LENGTH: DWORD = CRED_MAX_USERNAME_LENGTH; +pub const CREDUI_MAX_PASSWORD_LENGTH: DWORD = 512 / 2; +pub const CREDUI_FLAGS_INCORRECT_PASSWORD: DWORD = 0x00001; +pub const CREDUI_FLAGS_DO_NOT_PERSIST: DWORD = 0x00002; +pub const CREDUI_FLAGS_REQUEST_ADMINISTRATOR: DWORD = 0x00004; +pub const CREDUI_FLAGS_EXCLUDE_CERTIFICATES: DWORD = 0x00008; +pub const CREDUI_FLAGS_REQUIRE_CERTIFICATE: DWORD = 0x00010; +pub const CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX: DWORD = 0x00040; +pub const CREDUI_FLAGS_ALWAYS_SHOW_UI: DWORD = 0x00080; +pub const CREDUI_FLAGS_REQUIRE_SMARTCARD: DWORD = 0x00100; +pub const CREDUI_FLAGS_PASSWORD_ONLY_OK: DWORD = 0x00200; +pub const CREDUI_FLAGS_VALIDATE_USERNAME: DWORD = 0x00400; +pub const CREDUI_FLAGS_COMPLETE_USERNAME: DWORD = 0x00800; +pub const CREDUI_FLAGS_PERSIST: DWORD = 0x01000; +pub const CREDUI_FLAGS_SERVER_CREDENTIAL: DWORD = 0x04000; +pub const CREDUI_FLAGS_EXPECT_CONFIRMATION: DWORD = 0x20000; +pub const CREDUI_FLAGS_GENERIC_CREDENTIALS: DWORD = 0x40000; +pub const CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS: DWORD = 0x80000; +pub const CREDUI_FLAGS_KEEP_USERNAME: DWORD = 0x100000; +pub const CREDUI_FLAGS_PROMPT_VALID: DWORD = CREDUI_FLAGS_INCORRECT_PASSWORD + | CREDUI_FLAGS_DO_NOT_PERSIST | CREDUI_FLAGS_REQUEST_ADMINISTRATOR + | CREDUI_FLAGS_EXCLUDE_CERTIFICATES | CREDUI_FLAGS_REQUIRE_CERTIFICATE + | CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX | CREDUI_FLAGS_ALWAYS_SHOW_UI + | CREDUI_FLAGS_REQUIRE_SMARTCARD | CREDUI_FLAGS_PASSWORD_ONLY_OK + | CREDUI_FLAGS_VALIDATE_USERNAME | CREDUI_FLAGS_COMPLETE_USERNAME | CREDUI_FLAGS_PERSIST + | CREDUI_FLAGS_SERVER_CREDENTIAL | CREDUI_FLAGS_EXPECT_CONFIRMATION + | CREDUI_FLAGS_GENERIC_CREDENTIALS | CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS + | CREDUI_FLAGS_KEEP_USERNAME; +pub const CREDUIWIN_GENERIC: DWORD = 0x00000001; +pub const CREDUIWIN_CHECKBOX: DWORD = 0x00000002; +pub const CREDUIWIN_AUTHPACKAGE_ONLY: DWORD = 0x00000010; +pub const CREDUIWIN_IN_CRED_ONLY: DWORD = 0x00000020; +pub const CREDUIWIN_ENUMERATE_ADMINS: DWORD = 0x00000100; +pub const CREDUIWIN_ENUMERATE_CURRENT_USER: DWORD = 0x00000200; +pub const CREDUIWIN_SECURE_PROMPT: DWORD = 0x00001000; +pub const CREDUIWIN_PREPROMPTING: DWORD = 0x00002000; +pub const CREDUIWIN_PACK_32_WOW: DWORD = 0x10000000; +pub const CREDUIWIN_VALID_FLAGS: DWORD = CREDUIWIN_GENERIC | CREDUIWIN_CHECKBOX + | CREDUIWIN_AUTHPACKAGE_ONLY | CREDUIWIN_IN_CRED_ONLY | CREDUIWIN_ENUMERATE_ADMINS + | CREDUIWIN_ENUMERATE_CURRENT_USER | CREDUIWIN_SECURE_PROMPT | CREDUIWIN_PREPROMPTING + | CREDUIWIN_PACK_32_WOW; +pub const CRED_PRESERVE_CREDENTIAL_BLOB: DWORD = 0x1; +extern "system" { + pub fn CredWriteW( + Credential: PCREDENTIALW, + Flags: DWORD, + ) -> BOOL; + pub fn CredWriteA( + Credential: PCREDENTIALA, + Flags: DWORD, + ) -> BOOL; + pub fn CredReadW( + TargetName: LPCWSTR, + Type: DWORD, + Flags: DWORD, + Credential: *mut PCREDENTIALW, + ) -> BOOL; + pub fn CredReadA( + TargetName: LPCSTR, + Type: DWORD, + Flags: DWORD, + Credential: *mut PCREDENTIALA, + ) -> BOOL; +} +pub const CRED_ENUMERATE_ALL_CREDENTIALS: DWORD = 0x1; +extern "system" { + pub fn CredEnumerateW( + Filter: LPCWSTR, + Flags: DWORD, + Count: *mut DWORD, + Credential: *mut *mut PCREDENTIALW, + ) -> BOOL; + pub fn CredEnumerateA( + Filter: LPCSTR, + Flags: DWORD, + Count: *mut DWORD, + Credential: *mut *mut PCREDENTIALA, + ) -> BOOL; + pub fn CredWriteDomainCredentialsW( + TargetInfo: PCREDENTIAL_TARGET_INFORMATIONW, + Credential: PCREDENTIALW, + Flags: DWORD, + ) -> BOOL; + pub fn CredWriteDomainCredentialsA( + TargetInfo: PCREDENTIAL_TARGET_INFORMATIONA, + Credential: PCREDENTIALA, + Flags: DWORD, + ) -> BOOL; +} +pub const CRED_CACHE_TARGET_INFORMATION: DWORD = 0x1; +extern "system" { + pub fn CredReadDomainCredentialsW( + TargetInfo: PCREDENTIAL_TARGET_INFORMATIONW, + Flags: DWORD, + Count: *mut DWORD, + Credential: *mut *mut PCREDENTIALW, + ) -> BOOL; + pub fn CredReadDomainCredentialsA( + TargetInfo: PCREDENTIAL_TARGET_INFORMATIONA, + Flags: DWORD, + Count: *mut DWORD, + Credential: *mut *mut PCREDENTIALA, + ) -> BOOL; + pub fn CredDeleteW( + TargetName: LPCWSTR, + Type: DWORD, + Flags: DWORD, + ) -> BOOL; + pub fn CredDeleteA( + TargetName: LPCSTR, + Type: DWORD, + Flags: DWORD, + ) -> BOOL; + pub fn CredRenameW( + OldTargetName: LPCWSTR, + NewTargetName: LPCWSTR, + Type: DWORD, + Flags: DWORD, + ) -> BOOL; + pub fn CredRenameA( + OldTargetName: LPCSTR, + NewTargetName: LPCSTR, + Type: DWORD, + Flags: DWORD, + ) -> BOOL; +} +pub const CRED_ALLOW_NAME_RESOLUTION: DWORD = 0x1; +extern "system" { + pub fn CredGetTargetInfoW( + TargetName: LPCWSTR, + Flags: DWORD, + TargetInfo: *mut PCREDENTIAL_TARGET_INFORMATIONW, + ) -> BOOL; + pub fn CredGetTargetInfoA( + TargetName: LPCSTR, + Flags: DWORD, + TargetInfo: *mut PCREDENTIAL_TARGET_INFORMATIONA, + ) -> BOOL; + pub fn CredMarshalCredentialW( + CredType: CRED_MARSHAL_TYPE, + Credential: PVOID, + MarhaledCredential: *mut LPWSTR, + ) -> BOOL; + pub fn CredMarshalCredentialA( + CredType: CRED_MARSHAL_TYPE, + Credential: PVOID, + MarhaledCredential: *mut LPSTR, + ) -> BOOL; + pub fn CredUnmarshalCredentialW( + MarshaledCredential: LPCWSTR, + CredType: PCRED_MARSHAL_TYPE, + Credential: *mut PVOID, + ) -> BOOL; + pub fn CredUnmarshalCredentialA( + MarshaledCredential: LPCSTR, + CredType: PCRED_MARSHAL_TYPE, + Credential: *mut PVOID, + ) -> BOOL; + pub fn CredIsMarshaledCredentialW( + MarshaledCredential: LPCWSTR, + ) -> BOOL; + pub fn CredIsMarshaledCredentialA( + MarshaledCredential: LPCSTR, + ) -> BOOL; + pub fn CredUnPackAuthenticationBufferW( + dwFlags: DWORD, + pAuthBuffer: PVOID, + cbAuthBuffer: DWORD, + pszUserName: LPWSTR, + pcchlMaxUserName: *mut DWORD, + pszDomainName: LPWSTR, + pcchMaxDomainName: *mut DWORD, + pszPassword: LPWSTR, + pcchMaxPassword: *mut DWORD, + ) -> BOOL; + pub fn CredUnPackAuthenticationBufferA( + dwFlags: DWORD, + pAuthBuffer: PVOID, + cbAuthBuffer: DWORD, + pszUserName: LPSTR, + pcchlMaxUserName: *mut DWORD, + pszDomainName: LPSTR, + pcchMaxDomainName: *mut DWORD, + pszPassword: LPSTR, + pcchMaxPassword: *mut DWORD, + ) -> BOOL; + pub fn CredPackAuthenticationBufferW( + dwFlags: DWORD, + pszUserName: LPWSTR, + pszPassword: LPWSTR, + pPackedCredentials: PBYTE, + pcbPackedCredentials: *mut DWORD, + ) -> BOOL; + pub fn CredPackAuthenticationBufferA( + dwFlags: DWORD, + pszUserName: LPSTR, + pszPassword: LPSTR, + pPackedCredentials: PBYTE, + pcbPackedCredentials: *mut DWORD, + ) -> BOOL; + pub fn CredProtectW( + fAsSelf: BOOL, + pszCredentials: LPWSTR, + cchCredentials: DWORD, + pszProtectedCredentials: LPWSTR, + pcchMaxChars: *mut DWORD, + ProtectionType: *mut CRED_PROTECTION_TYPE, + ) -> BOOL; + pub fn CredProtectA( + fAsSelf: BOOL, + pszCredentials: LPSTR, + cchCredentials: DWORD, + pszProtectedCredentials: LPSTR, + pcchMaxChars: *mut DWORD, + ProtectionType: *mut CRED_PROTECTION_TYPE, + ) -> BOOL; + pub fn CredUnprotectW( + fAsSelf: BOOL, + pszProtectedCredentials: LPWSTR, + cchCredentials: DWORD, + pszCredentials: LPWSTR, + pcchMaxChars: *mut DWORD, + ) -> BOOL; + pub fn CredUnprotectA( + fAsSelf: BOOL, + pszProtectedCredentials: LPSTR, + cchCredentials: DWORD, + pszCredentials: LPSTR, + pcchMaxChars: *mut DWORD, + ) -> BOOL; + pub fn CredIsProtectedW( + pszProtectedCredentials: LPWSTR, + pProtectionType: *mut CRED_PROTECTION_TYPE, + ) -> BOOL; + pub fn CredIsProtectedA( + pszProtectedCredentials: LPSTR, + pProtectionType: *mut CRED_PROTECTION_TYPE, + ) -> BOOL; + pub fn CredFindBestCredentialW( + TargetName: LPCWSTR, + Type: DWORD, + Flags: DWORD, + Credential: *mut PCREDENTIALW, + ) -> BOOL; + pub fn CredFindBestCredentialA( + TargetName: LPCSTR, + Type: DWORD, + Flags: DWORD, + Credential: *mut PCREDENTIALA, + ) -> BOOL; + pub fn CredGetSessionTypes( + MaximumPersistCount: DWORD, + MaximumPersist: LPDWORD, + ) -> BOOL; + pub fn CredFree( + Buffer: PVOID, + ); + pub fn CredUIPromptForCredentialsW( + pUiInfo: PCREDUI_INFOW, + pszTargetName: PCWSTR, + pContext: PCtxtHandle, + dwAuthError: DWORD, + pszUserName: PWSTR, + ulUserNameBufferSize: ULONG, + pszPassword: PWSTR, + ulPasswordBufferSize: ULONG, + save: *mut BOOL, + dwFlags: DWORD, + ) -> DWORD; + pub fn CredUIPromptForCredentialsA( + pUiInfo: PCREDUI_INFOA, + pszTargetName: PCSTR, + pContext: PCtxtHandle, + dwAuthError: DWORD, + pszUserName: PSTR, + ulUserNameBufferSize: ULONG, + pszPassword: PSTR, + ulPasswordBufferSize: ULONG, + save: *mut BOOL, + dwFlags: DWORD, + ) -> DWORD; + pub fn CredUIPromptForWindowsCredentialsW( + pUiInfo: PCREDUI_INFOW, + dwAuthError: DWORD, + pulAuthPackage: *mut ULONG, + pvInAuthBuffer: LPCVOID, + ulInAuthBufferSize: ULONG, + ppvOutAuthBuffer: *mut LPVOID, + pulOutAuthBufferSize: *mut ULONG, + pfSave: *mut BOOL, + dwFlags: DWORD, + ) -> DWORD; + pub fn CredUIPromptForWindowsCredentialsA( + pUiInfo: PCREDUI_INFOA, + dwAuthError: DWORD, + pulAuthPackage: *mut ULONG, + pvInAuthBuffer: LPCVOID, + ulInAuthBufferSize: ULONG, + ppvOutAuthBuffer: *mut LPVOID, + pulOutAuthBufferSize: *mut ULONG, + pfSave: *mut BOOL, + dwFlags: DWORD, + ) -> DWORD; + pub fn CredUIParseUserNameW( + userName: PCWSTR, + user: *mut WCHAR, + userBufferSize: ULONG, + domain: *mut WCHAR, + domainBufferSize: ULONG, + ) -> DWORD; + pub fn CredUIParseUserNameA( + userName: PCSTR, + user: *mut CHAR, + userBufferSize: ULONG, + domain: *mut CHAR, + domainBufferSize: ULONG, + ) -> DWORD; + pub fn CredUICmdLinePromptForCredentialsW( + pszTargetName: PCWSTR, + pContext: PCtxtHandle, + dwAuthError: DWORD, + UserName: PWSTR, + ulUserBufferSize: ULONG, + pszPassword: PWSTR, + ulPasswordBufferSize: ULONG, + pfSave: PBOOL, + dwFlags: DWORD, + ) -> DWORD; + pub fn CredUICmdLinePromptForCredentialsA( + pszTargetName: PCSTR, + pContext: PCtxtHandle, + dwAuthError: DWORD, + UserName: PSTR, + ulUserBufferSize: ULONG, + pszPassword: PSTR, + ulPasswordBufferSize: ULONG, + pfSave: PBOOL, + dwFlags: DWORD, + ) -> DWORD; + pub fn CredUIConfirmCredentialsW( + pszTargetName: PCWSTR, + bConfirm: BOOL, + ) -> DWORD; + pub fn CredUIConfirmCredentialsA( + pszTargetName: PCSTR, + bConfirm: BOOL, + ) -> DWORD; + pub fn CredUIStoreSSOCredW( + pszRealm: PCWSTR, + pszUsername: PCWSTR, + pszPassword: PCWSTR, + bPersist: BOOL, + ) -> DWORD; + pub fn CredUIReadSSOCredW( + pszRealm: PCWSTR, + ppszUsername: *mut PWSTR, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/wincrypt.rs b/bash-5.1/vendor/winapi/src/um/wincrypt.rs new file mode 100644 index 0000000000000000000000000000000000000000..abc2a9923bee1e7ea4c03ce10e4246028e1a4ac9 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wincrypt.rs @@ -0,0 +1,7365 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Cryptographic API Prototypes and Definitions +use ctypes::{c_int, c_uchar, c_uint, c_void}; +use shared::basetsd::ULONG_PTR; +use shared::bcrypt::BCRYPT_KEY_HANDLE; +use shared::guiddef::{GUID, LPCGUID}; +use shared::minwindef::{ + BOOL, BYTE, DWORD, FALSE, FILETIME, HKEY, HMODULE, LPFILETIME, LPVOID, PBYTE, PDWORD, + PFILETIME, TRUE, ULONG, WORD, +}; +use um::minwinbase::PSYSTEMTIME; +use um::ncrypt::NCRYPT_KEY_HANDLE; +use um::winnt::{ + CHAR, HANDLE, HRESULT, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PCWSTR, PVOID, PWSTR, WCHAR, +}; +use vc::vcruntime::size_t; +//108 +#[inline] +pub fn GET_ALG_CLASS(x: ALG_ID) -> ALG_ID { + x & (7 << 13) +} +#[inline] +pub fn GET_ALG_TYPE(x: ALG_ID) -> ALG_ID { + x & (15 << 9) +} +#[inline] +pub fn GET_ALG_SID(x: ALG_ID) -> ALG_ID { + x & 511 +} +pub const ALG_CLASS_ANY: ALG_ID = 0; +pub const ALG_CLASS_SIGNATURE: ALG_ID = 1 << 13; +pub const ALG_CLASS_MSG_ENCRYPT: ALG_ID = 2 << 13; +pub const ALG_CLASS_DATA_ENCRYPT: ALG_ID = 3 << 13; +pub const ALG_CLASS_HASH: ALG_ID = 4 << 13; +pub const ALG_CLASS_KEY_EXCHANGE: ALG_ID = 5 << 13; +pub const ALG_CLASS_ALL: ALG_ID = 7 << 13; +pub const ALG_TYPE_ANY: ALG_ID = 0; +pub const ALG_TYPE_DSS: ALG_ID = 1 << 9; +pub const ALG_TYPE_RSA: ALG_ID = 2 << 9; +pub const ALG_TYPE_BLOCK: ALG_ID = 3 << 9; +pub const ALG_TYPE_STREAM: ALG_ID = 4 << 9; +pub const ALG_TYPE_DH: ALG_ID = 5 << 9; +pub const ALG_TYPE_SECURECHANNEL: ALG_ID = 6 << 9; +pub const ALG_TYPE_ECDH: ALG_ID = 7 << 9; +pub const ALG_TYPE_THIRDPARTY: ALG_ID = 8 << 9; +pub const ALG_SID_ANY: ALG_ID = 0; +pub const ALG_SID_THIRDPARTY_ANY: ALG_ID = 0; +pub const ALG_SID_RSA_ANY: ALG_ID = 0; +pub const ALG_SID_RSA_PKCS: ALG_ID = 1; +pub const ALG_SID_RSA_MSATWORK: ALG_ID = 2; +pub const ALG_SID_RSA_ENTRUST: ALG_ID = 3; +pub const ALG_SID_RSA_PGP: ALG_ID = 4; +pub const ALG_SID_DSS_ANY: ALG_ID = 0; +pub const ALG_SID_DSS_PKCS: ALG_ID = 1; +pub const ALG_SID_DSS_DMS: ALG_ID = 2; +pub const ALG_SID_ECDSA: ALG_ID = 3; +pub const ALG_SID_DES: ALG_ID = 1; +pub const ALG_SID_3DES: ALG_ID = 3; +pub const ALG_SID_DESX: ALG_ID = 4; +pub const ALG_SID_IDEA: ALG_ID = 5; +pub const ALG_SID_CAST: ALG_ID = 6; +pub const ALG_SID_SAFERSK64: ALG_ID = 7; +pub const ALG_SID_SAFERSK128: ALG_ID = 8; +pub const ALG_SID_3DES_112: ALG_ID = 9; +pub const ALG_SID_CYLINK_MEK: ALG_ID = 12; +pub const ALG_SID_RC5: ALG_ID = 13; +pub const ALG_SID_AES_128: ALG_ID = 14; +pub const ALG_SID_AES_192: ALG_ID = 15; +pub const ALG_SID_AES_256: ALG_ID = 16; +pub const ALG_SID_AES: ALG_ID = 17; +pub const ALG_SID_SKIPJACK: ALG_ID = 10; +pub const ALG_SID_TEK: ALG_ID = 11; +pub const CRYPT_MODE_CBCI: ALG_ID = 6; +pub const CRYPT_MODE_CFBP: ALG_ID = 7; +pub const CRYPT_MODE_OFBP: ALG_ID = 8; +pub const CRYPT_MODE_CBCOFM: ALG_ID = 9; +pub const CRYPT_MODE_CBCOFMI: ALG_ID = 10; +pub const ALG_SID_RC2: ALG_ID = 2; +pub const ALG_SID_RC4: ALG_ID = 1; +pub const ALG_SID_SEAL: ALG_ID = 2; +pub const ALG_SID_DH_SANDF: ALG_ID = 1; +pub const ALG_SID_DH_EPHEM: ALG_ID = 2; +pub const ALG_SID_AGREED_KEY_ANY: ALG_ID = 3; +pub const ALG_SID_KEA: ALG_ID = 4; +pub const ALG_SID_ECDH: ALG_ID = 5; +pub const ALG_SID_ECDH_EPHEM: ALG_ID = 6; +pub const ALG_SID_MD2: ALG_ID = 1; +pub const ALG_SID_MD4: ALG_ID = 2; +pub const ALG_SID_MD5: ALG_ID = 3; +pub const ALG_SID_SHA: ALG_ID = 4; +pub const ALG_SID_SHA1: ALG_ID = 4; +pub const ALG_SID_MAC: ALG_ID = 5; +pub const ALG_SID_RIPEMD: ALG_ID = 6; +pub const ALG_SID_RIPEMD160: ALG_ID = 7; +pub const ALG_SID_SSL3SHAMD5: ALG_ID = 8; +pub const ALG_SID_HMAC: ALG_ID = 9; +pub const ALG_SID_TLS1PRF: ALG_ID = 10; +pub const ALG_SID_HASH_REPLACE_OWF: ALG_ID = 11; +pub const ALG_SID_SHA_256: ALG_ID = 12; +pub const ALG_SID_SHA_384: ALG_ID = 13; +pub const ALG_SID_SHA_512: ALG_ID = 14; +pub const ALG_SID_SSL3_MASTER: ALG_ID = 1; +pub const ALG_SID_SCHANNEL_MASTER_HASH: ALG_ID = 2; +pub const ALG_SID_SCHANNEL_MAC_KEY: ALG_ID = 3; +pub const ALG_SID_PCT1_MASTER: ALG_ID = 4; +pub const ALG_SID_SSL2_MASTER: ALG_ID = 5; +pub const ALG_SID_TLS1_MASTER: ALG_ID = 6; +pub const ALG_SID_SCHANNEL_ENC_KEY: ALG_ID = 7; +pub const ALG_SID_ECMQV: ALG_ID = 1; +pub const ALG_SID_EXAMPLE: ALG_ID = 80; +pub type ALG_ID = c_uint; +pub const CALG_MD2: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2; +pub const CALG_MD4: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4; +pub const CALG_MD5: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5; +pub const CALG_SHA: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA; +pub const CALG_SHA1: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA1; +pub const CALG_MAC: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC; +pub const CALG_RSA_SIGN: ALG_ID = ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY; +pub const CALG_DSS_SIGN: ALG_ID = ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY; +pub const CALG_NO_SIGN: ALG_ID = ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY; +pub const CALG_RSA_KEYX: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY; +pub const CALG_DES: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES; +pub const CALG_3DES_112: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES_112; +pub const CALG_3DES: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES; +pub const CALG_DESX: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DESX; +pub const CALG_RC2: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2; +pub const CALG_RC4: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4; +pub const CALG_SEAL: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL; +pub const CALG_DH_SF: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_SANDF; +pub const CALG_DH_EPHEM: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_EPHEM; +pub const CALG_AGREEDKEY_ANY: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH + | ALG_SID_AGREED_KEY_ANY; +pub const CALG_KEA_KEYX: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_KEA; +pub const CALG_HUGHES_MD5: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_MD5; +pub const CALG_SKIPJACK: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_SKIPJACK; +pub const CALG_TEK: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_TEK; +pub const CALG_CYLINK_MEK: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_CYLINK_MEK; +pub const CALG_SSL3_SHAMD5: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5; +pub const CALG_SSL3_MASTER: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL + | ALG_SID_SSL3_MASTER; +pub const CALG_SCHANNEL_MASTER_HASH: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL + | ALG_SID_SCHANNEL_MASTER_HASH; +pub const CALG_SCHANNEL_MAC_KEY: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL + | ALG_SID_SCHANNEL_MAC_KEY; +pub const CALG_SCHANNEL_ENC_KEY: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL + | ALG_SID_SCHANNEL_ENC_KEY; +pub const CALG_PCT1_MASTER: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL + | ALG_SID_PCT1_MASTER; +pub const CALG_SSL2_MASTER: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL + | ALG_SID_SSL2_MASTER; +pub const CALG_TLS1_MASTER: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL + | ALG_SID_TLS1_MASTER; +pub const CALG_RC5: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC5; +pub const CALG_HMAC: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC; +pub const CALG_TLS1PRF: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF; +pub const CALG_HASH_REPLACE_OWF: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_REPLACE_OWF; +pub const CALG_AES_128: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_128; +pub const CALG_AES_192: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_192; +pub const CALG_AES_256: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_256; +pub const CALG_AES: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES; +pub const CALG_SHA_256: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256; +pub const CALG_SHA_384: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384; +pub const CALG_SHA_512: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512; +pub const CALG_ECDH: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_ECDH; +pub const CALG_ECDH_EPHEM: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ECDH | ALG_SID_ECDH_EPHEM; +pub const CALG_ECMQV: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_ECMQV; +pub const CALG_ECDSA: ALG_ID = ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_ECDSA; +pub const CALG_NULLCIPHER: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_ANY | 0; +pub const CALG_THIRDPARTY_KEY_EXCHANGE: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_THIRDPARTY + | ALG_SID_THIRDPARTY_ANY; +pub const CALG_THIRDPARTY_SIGNATURE: ALG_ID = ALG_CLASS_SIGNATURE | ALG_TYPE_THIRDPARTY + | ALG_SID_THIRDPARTY_ANY; +pub const CALG_THIRDPARTY_CIPHER: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_THIRDPARTY + | ALG_SID_THIRDPARTY_ANY; +pub const CALG_THIRDPARTY_HASH: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_THIRDPARTY + | ALG_SID_THIRDPARTY_ANY; +pub type HCRYPTPROV = ULONG_PTR; +pub type HCRYPTKEY = ULONG_PTR; +pub type HCRYPTHASH = ULONG_PTR; +pub const CRYPT_VERIFYCONTEXT: DWORD = 0xF0000000; +pub const CRYPT_NEWKEYSET: DWORD = 0x00000008; +pub const CRYPT_DELETEKEYSET: DWORD = 0x00000010; +pub const CRYPT_MACHINE_KEYSET: DWORD = 0x00000020; +pub const CRYPT_SILENT: DWORD = 0x00000040; +pub const CRYPT_DEFAULT_CONTAINER_OPTIONAL: DWORD = 0x00000080; +pub const CRYPT_EXPORTABLE: DWORD = 0x00000001; +pub const CRYPT_USER_PROTECTED: DWORD = 0x00000002; +pub const CRYPT_CREATE_SALT: DWORD = 0x00000004; +pub const CRYPT_UPDATE_KEY: DWORD = 0x00000008; +pub const CRYPT_NO_SALT: DWORD = 0x00000010; +pub const CRYPT_PREGEN: DWORD = 0x00000040; +pub const CRYPT_RECIPIENT: DWORD = 0x00000010; +pub const CRYPT_INITIATOR: DWORD = 0x00000040; +pub const CRYPT_ONLINE: DWORD = 0x00000080; +pub const CRYPT_SF: DWORD = 0x00000100; +pub const CRYPT_CREATE_IV: DWORD = 0x00000200; +pub const CRYPT_KEK: DWORD = 0x00000400; +pub const CRYPT_DATA_KEY: DWORD = 0x00000800; +pub const CRYPT_VOLATILE: DWORD = 0x00001000; +pub const CRYPT_SGCKEY: DWORD = 0x00002000; +pub const CRYPT_USER_PROTECTED_STRONG: DWORD = 0x00100000; +pub const CRYPT_ARCHIVABLE: DWORD = 0x00004000; +pub const CRYPT_FORCE_KEY_PROTECTION_HIGH: DWORD = 0x00008000; +pub const RSA1024BIT_KEY: DWORD = 0x04000000; +pub const CRYPT_SERVER: DWORD = 0x00000400; +pub const KEY_LENGTH_MASK: DWORD = 0xFFFF0000; +pub const CRYPT_Y_ONLY: DWORD = 0x00000001; +pub const CRYPT_SSL2_FALLBACK: DWORD = 0x00000002; +pub const CRYPT_DESTROYKEY: DWORD = 0x00000004; +pub const CRYPT_OAEP: DWORD = 0x00000040; +pub const CRYPT_BLOB_VER3: DWORD = 0x00000080; +pub const CRYPT_IPSEC_HMAC_KEY: DWORD = 0x00000100; +pub const CRYPT_DECRYPT_RSA_NO_PADDING_CHECK: DWORD = 0x00000020; +pub const CRYPT_SECRETDIGEST: DWORD = 0x00000001; +pub const CRYPT_OWF_REPL_LM_HASH: DWORD = 0x00000001; +pub const CRYPT_LITTLE_ENDIAN: DWORD = 0x00000001; +pub const CRYPT_NOHASHOID: DWORD = 0x00000001; +pub const CRYPT_TYPE2_FORMAT: DWORD = 0x00000002; +pub const CRYPT_X931_FORMAT: DWORD = 0x00000004; +pub const CRYPT_MACHINE_DEFAULT: DWORD = 0x00000001; +pub const CRYPT_USER_DEFAULT: DWORD = 0x00000002; +pub const CRYPT_DELETE_DEFAULT: DWORD = 0x00000004; +pub const SIMPLEBLOB: DWORD = 0x1; +pub const PUBLICKEYBLOB: DWORD = 0x6; +pub const PRIVATEKEYBLOB: DWORD = 0x7; +pub const PLAINTEXTKEYBLOB: DWORD = 0x8; +pub const OPAQUEKEYBLOB: DWORD = 0x9; +pub const PUBLICKEYBLOBEX: DWORD = 0xA; +pub const SYMMETRICWRAPKEYBLOB: DWORD = 0xB; +pub const KEYSTATEBLOB: DWORD = 0xC; +pub const AT_KEYEXCHANGE: DWORD = 1; +pub const AT_SIGNATURE: DWORD = 2; +pub const CRYPT_USERDATA: DWORD = 1; +pub const KP_IV: DWORD = 1; +pub const KP_SALT: DWORD = 2; +pub const KP_PADDING: DWORD = 3; +pub const KP_MODE: DWORD = 4; +pub const KP_MODE_BITS: DWORD = 5; +pub const KP_PERMISSIONS: DWORD = 6; +pub const KP_ALGID: DWORD = 7; +pub const KP_BLOCKLEN: DWORD = 8; +pub const KP_KEYLEN: DWORD = 9; +pub const KP_SALT_EX: DWORD = 10; +pub const KP_P: DWORD = 11; +pub const KP_G: DWORD = 12; +pub const KP_Q: DWORD = 13; +pub const KP_X: DWORD = 14; +pub const KP_Y: DWORD = 15; +pub const KP_RA: DWORD = 16; +pub const KP_RB: DWORD = 17; +pub const KP_INFO: DWORD = 18; +pub const KP_EFFECTIVE_KEYLEN: DWORD = 19; +pub const KP_SCHANNEL_ALG: DWORD = 20; +pub const KP_CLIENT_RANDOM: DWORD = 21; +pub const KP_SERVER_RANDOM: DWORD = 22; +pub const KP_RP: DWORD = 23; +pub const KP_PRECOMP_MD5: DWORD = 24; +pub const KP_PRECOMP_SHA: DWORD = 25; +pub const KP_CERTIFICATE: DWORD = 26; +pub const KP_CLEAR_KEY: DWORD = 27; +pub const KP_PUB_EX_LEN: DWORD = 28; +pub const KP_PUB_EX_VAL: DWORD = 29; +pub const KP_KEYVAL: DWORD = 30; +pub const KP_ADMIN_PIN: DWORD = 31; +pub const KP_KEYEXCHANGE_PIN: DWORD = 32; +pub const KP_SIGNATURE_PIN: DWORD = 33; +pub const KP_PREHASH: DWORD = 34; +pub const KP_ROUNDS: DWORD = 35; +pub const KP_OAEP_PARAMS: DWORD = 36; +pub const KP_CMS_KEY_INFO: DWORD = 37; +pub const KP_CMS_DH_KEY_INFO: DWORD = 38; +pub const KP_PUB_PARAMS: DWORD = 39; +pub const KP_VERIFY_PARAMS: DWORD = 40; +pub const KP_HIGHEST_VERSION: DWORD = 41; +pub const KP_GET_USE_COUNT: DWORD = 42; +pub const KP_PIN_ID: DWORD = 43; +pub const KP_PIN_INFO: DWORD = 44; +pub const PKCS5_PADDING: DWORD = 1; +pub const RANDOM_PADDING: DWORD = 2; +pub const ZERO_PADDING: DWORD = 3; +pub const CRYPT_MODE_CBC: DWORD = 1; +pub const CRYPT_MODE_ECB: DWORD = 2; +pub const CRYPT_MODE_OFB: DWORD = 3; +pub const CRYPT_MODE_CFB: DWORD = 4; +pub const CRYPT_MODE_CTS: DWORD = 5; +pub const CRYPT_ENCRYPT: DWORD = 0x0001; +pub const CRYPT_DECRYPT: DWORD = 0x0002; +pub const CRYPT_EXPORT: DWORD = 0x0004; +pub const CRYPT_READ: DWORD = 0x0008; +pub const CRYPT_WRITE: DWORD = 0x0010; +pub const CRYPT_MAC: DWORD = 0x0020; +pub const CRYPT_EXPORT_KEY: DWORD = 0x0040; +pub const CRYPT_IMPORT_KEY: DWORD = 0x0080; +pub const CRYPT_ARCHIVE: DWORD = 0x0100; +pub const HP_ALGID: DWORD = 0x0001; +pub const HP_HASHVAL: DWORD = 0x0002; +pub const HP_HASHSIZE: DWORD = 0x0004; +pub const HP_HMAC_INFO: DWORD = 0x0005; +pub const HP_TLS1PRF_LABEL: DWORD = 0x0006; +pub const HP_TLS1PRF_SEED: DWORD = 0x0007; +pub const CRYPT_FAILED: BOOL = FALSE; +pub const CRYPT_SUCCEED: BOOL = TRUE; +#[inline] +pub fn RCRYPT_SUCCEEDED(rt: BOOL) -> bool { + rt == CRYPT_SUCCEED +} +#[inline] +pub fn RCRYPT_FAILED(rt: BOOL) -> bool { + rt == CRYPT_FAILED +} +pub const PP_ENUMALGS: DWORD = 1; +pub const PP_ENUMCONTAINERS: DWORD = 2; +pub const PP_IMPTYPE: DWORD = 3; +pub const PP_NAME: DWORD = 4; +pub const PP_VERSION: DWORD = 5; +pub const PP_CONTAINER: DWORD = 6; +pub const PP_CHANGE_PASSWORD: DWORD = 7; +pub const PP_KEYSET_SEC_DESCR: DWORD = 8; +pub const PP_CERTCHAIN: DWORD = 9; +pub const PP_KEY_TYPE_SUBTYPE: DWORD = 10; +pub const PP_PROVTYPE: DWORD = 16; +pub const PP_KEYSTORAGE: DWORD = 17; +pub const PP_APPLI_CERT: DWORD = 18; +pub const PP_SYM_KEYSIZE: DWORD = 19; +pub const PP_SESSION_KEYSIZE: DWORD = 20; +pub const PP_UI_PROMPT: DWORD = 21; +pub const PP_ENUMALGS_EX: DWORD = 22; +pub const PP_ENUMMANDROOTS: DWORD = 25; +pub const PP_ENUMELECTROOTS: DWORD = 26; +pub const PP_KEYSET_TYPE: DWORD = 27; +pub const PP_ADMIN_PIN: DWORD = 31; +pub const PP_KEYEXCHANGE_PIN: DWORD = 32; +pub const PP_SIGNATURE_PIN: DWORD = 33; +pub const PP_SIG_KEYSIZE_INC: DWORD = 34; +pub const PP_KEYX_KEYSIZE_INC: DWORD = 35; +pub const PP_UNIQUE_CONTAINER: DWORD = 36; +pub const PP_SGC_INFO: DWORD = 37; +pub const PP_USE_HARDWARE_RNG: DWORD = 38; +pub const PP_KEYSPEC: DWORD = 39; +pub const PP_ENUMEX_SIGNING_PROT: DWORD = 40; +pub const PP_CRYPT_COUNT_KEY_USE: DWORD = 41; +pub const PP_USER_CERTSTORE: DWORD = 42; +pub const PP_SMARTCARD_READER: DWORD = 43; +pub const PP_SMARTCARD_GUID: DWORD = 45; +pub const PP_ROOT_CERTSTORE: DWORD = 46; +pub const PP_SMARTCARD_READER_ICON: DWORD = 47; +pub const CRYPT_FIRST: DWORD = 1; +pub const CRYPT_NEXT: DWORD = 2; +pub const CRYPT_SGC_ENUM: DWORD = 4; +pub const CRYPT_IMPL_HARDWARE: DWORD = 1; +pub const CRYPT_IMPL_SOFTWARE: DWORD = 2; +pub const CRYPT_IMPL_MIXED: DWORD = 3; +pub const CRYPT_IMPL_UNKNOWN: DWORD = 4; +pub const CRYPT_IMPL_REMOVABLE: DWORD = 8; +pub const CRYPT_SEC_DESCR: DWORD = 0x00000001; +pub const CRYPT_PSTORE: DWORD = 0x00000002; +pub const CRYPT_UI_PROMPT: DWORD = 0x00000004; +pub const CRYPT_FLAG_PCT1: DWORD = 0x0001; +pub const CRYPT_FLAG_SSL2: DWORD = 0x0002; +pub const CRYPT_FLAG_SSL3: DWORD = 0x0004; +pub const CRYPT_FLAG_TLS1: DWORD = 0x0008; +pub const CRYPT_FLAG_IPSEC: DWORD = 0x0010; +pub const CRYPT_FLAG_SIGNING: DWORD = 0x0020; +pub const CRYPT_SGC: DWORD = 0x0001; +pub const CRYPT_FASTSGC: DWORD = 0x0002; +pub const PP_CLIENT_HWND: DWORD = 1; +pub const PP_CONTEXT_INFO: DWORD = 11; +pub const PP_KEYEXCHANGE_KEYSIZE: DWORD = 12; +pub const PP_SIGNATURE_KEYSIZE: DWORD = 13; +pub const PP_KEYEXCHANGE_ALG: DWORD = 14; +pub const PP_SIGNATURE_ALG: DWORD = 15; +pub const PP_DELETEKEY: DWORD = 24; +pub const PP_PIN_PROMPT_STRING: DWORD = 44; +pub const PP_SECURE_KEYEXCHANGE_PIN: DWORD = 47; +pub const PP_SECURE_SIGNATURE_PIN: DWORD = 48; +pub const PROV_RSA_FULL: DWORD = 1; +pub const PROV_RSA_SIG: DWORD = 2; +pub const PROV_DSS: DWORD = 3; +pub const PROV_FORTEZZA: DWORD = 4; +pub const PROV_MS_EXCHANGE: DWORD = 5; +pub const PROV_SSL: DWORD = 6; +pub const PROV_RSA_SCHANNEL: DWORD = 12; +pub const PROV_DSS_DH: DWORD = 13; +pub const PROV_EC_ECDSA_SIG: DWORD = 14; +pub const PROV_EC_ECNRA_SIG: DWORD = 15; +pub const PROV_EC_ECDSA_FULL: DWORD = 16; +pub const PROV_EC_ECNRA_FULL: DWORD = 17; +pub const PROV_DH_SCHANNEL: DWORD = 18; +pub const PROV_SPYRUS_LYNKS: DWORD = 20; +pub const PROV_RNG: DWORD = 21; +pub const PROV_INTEL_SEC: DWORD = 22; +pub const PROV_REPLACE_OWF: DWORD = 23; +pub const PROV_RSA_AES: DWORD = 24; +pub const MS_DEF_PROV: &'static str = "Microsoft Base Cryptographic Provider v1.0"; +pub const MS_ENHANCED_PROV: &'static str = "Microsoft Enhanced Cryptographic Provider v1.0"; +pub const MS_STRONG_PROV: &'static str = "Microsoft Strong Cryptographic Provider"; +pub const MS_DEF_RSA_SIG_PROV: &'static str = "Microsoft RSA Signature Cryptographic Provider"; +pub const MS_DEF_RSA_SCHANNEL_PROV: &'static str = "Microsoft RSA SChannel Cryptographic Provider"; +pub const MS_DEF_DSS_PROV: &'static str = "Microsoft Base DSS Cryptographic Provider"; +pub const MS_DEF_DSS_DH_PROV: &'static str + = "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"; +pub const MS_ENH_DSS_DH_PROV: &'static str + = "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"; +pub const MS_DEF_DH_SCHANNEL_PROV: &'static str = "Microsoft DH SChannel Cryptographic Provider"; +pub const MS_SCARD_PROV: &'static str = "Microsoft Base Smart Card Crypto Provider"; +pub const MS_ENH_RSA_AES_PROV: &'static str + = "Microsoft Enhanced RSA and AES Cryptographic Provider"; +pub const MS_ENH_RSA_AES_PROV_XP: &'static str + = "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)"; +pub const MAXUIDLEN: usize = 64; +pub const EXPO_OFFLOAD_REG_VALUE: &'static str = "ExpoOffload"; +pub const EXPO_OFFLOAD_FUNC_NAME: &'static str = "OffloadModExpo"; +pub const szKEY_CRYPTOAPI_PRIVATE_KEY_OPTIONS: &'static str + = "Software\\Policies\\Microsoft\\Cryptography"; +pub const szKEY_CACHE_ENABLED: &'static str = "CachePrivateKeys"; +pub const szKEY_CACHE_SECONDS: &'static str = "PrivateKeyLifetimeSeconds"; +pub const szPRIV_KEY_CACHE_MAX_ITEMS: &'static str = "PrivKeyCacheMaxItems"; +pub const cPRIV_KEY_CACHE_MAX_ITEMS_DEFAULT: DWORD = 20; +pub const szPRIV_KEY_CACHE_PURGE_INTERVAL_SECONDS: &'static str + = "PrivKeyCachePurgeIntervalSeconds"; +pub const cPRIV_KEY_CACHE_PURGE_INTERVAL_SECONDS_DEFAULT: DWORD = 86400; +pub const CUR_BLOB_VERSION: DWORD = 2; +STRUCT!{struct CMS_KEY_INFO { + dwVersion: DWORD, + Algid: ALG_ID, + pbOID: *mut BYTE, + cbOID: DWORD, +}} +pub type PCMS_KEY_INFO = *mut CMS_KEY_INFO; +STRUCT!{struct HMAC_INFO { + HashAlgid: ALG_ID, + pbInnerString: *mut BYTE, + cbInnerString: DWORD, + pbOuterString: *mut BYTE, + cbOuterString: DWORD, +}} +pub type PHMAC_INFO = *mut HMAC_INFO; +STRUCT!{struct SCHANNEL_ALG { + dwUse: DWORD, + Algid: ALG_ID, + cBits: DWORD, + dwFlags: DWORD, + dwReserved: DWORD, +}} +pub type PSCHANNEL_ALG = *mut SCHANNEL_ALG; +pub const SCHANNEL_MAC_KEY: DWORD = 0x00000000; +pub const SCHANNEL_ENC_KEY: DWORD = 0x00000001; +pub const INTERNATIONAL_USAGE: DWORD = 0x00000001; +STRUCT!{struct PROV_ENUMALGS { + aiAlgid: ALG_ID, + dwBitLen: DWORD, + dwNameLen: DWORD, + szName: [CHAR; 20], +}} +STRUCT!{struct PROV_ENUMALGS_EX { + aiAlgid: ALG_ID, + dwDefaultLen: DWORD, + dwMinLen: DWORD, + dwMaxLen: DWORD, + dwProtocols: DWORD, + dwNameLen: DWORD, + szName: [CHAR; 20], + dwLongNameLen: DWORD, + szLongName: [CHAR; 40], +}} +STRUCT!{struct BLOBHEADER { + bType: BYTE, + bVersion: BYTE, + reserved: WORD, + aiKeyAlg: ALG_ID, +}} +pub type PUBLICKEYSTRUC = BLOBHEADER; +STRUCT!{struct RSAPUBKEY { + magic: DWORD, + bitlen: DWORD, + pubexp: DWORD, +}} +STRUCT!{struct DHPUBKEY { + magic: DWORD, + bitlen: DWORD, +}} +pub type DSSPUBKEY = DHPUBKEY; +pub type KEAPUBKEY = DHPUBKEY; +pub type TEKPUBKEY = DHPUBKEY; +STRUCT!{struct DSSSEED { + counter: DWORD, + seed: [BYTE; 20], +}} +STRUCT!{struct DHPUBKEY_VER3 { + magic: DWORD, + bitlenP: DWORD, + bitlenQ: DWORD, + bitlenJ: DWORD, + DSSSeed: DSSSEED, +}} +pub type DSSPUBKEY_VER3 = DHPUBKEY_VER3; +STRUCT!{struct DHPRIVKEY_VER3 { + magic: DWORD, + bitlenP: DWORD, + bitlenQ: DWORD, + bitlenJ: DWORD, + bitlenX: DWORD, + DSSSeed: DSSSEED, +}} +pub type DSSPRIVKEY_VER3 = DHPRIVKEY_VER3; +STRUCT!{struct KEY_TYPE_SUBTYPE { + dwKeySpec: DWORD, + Type: GUID, + Subtype: GUID, +}} +pub type PKEY_TYPE_SUBTYPE = *mut KEY_TYPE_SUBTYPE; +STRUCT!{struct CERT_FORTEZZA_DATA_PROP { + SerialNumber: [c_uchar; 8], + CertIndex: c_int, + CertLabel: [c_uchar; 36], +}} +STRUCT!{struct CRYPT_RC4_KEY_STATE { + Key: [c_uchar; 16], + SBox: [c_uchar; 256], + i: c_uchar, + j: c_uchar, +}} +pub type PCRYPT_RC4_KEY_STATE = *mut CRYPT_RC4_KEY_STATE; +STRUCT!{struct CRYPT_DES_KEY_STATE { + Key: [c_uchar; 8], + IV: [c_uchar; 8], + Feedback: [c_uchar; 8], +}} +pub type PCRYPT_DES_KEY_STATE = *mut CRYPT_DES_KEY_STATE; +STRUCT!{struct CRYPT_3DES_KEY_STATE { + Key: [c_uchar; 24], + IV: [c_uchar; 8], + Feedback: [c_uchar; 8], +}} +pub type PCRYPT_3DES_KEY_STATE = *mut CRYPT_3DES_KEY_STATE; +STRUCT!{struct CRYPT_AES_128_KEY_STATE { + Key: [c_uchar; 16], + IV: [c_uchar; 16], + EncryptionState: [[c_uchar; 16]; 11], + DecryptionState: [[c_uchar; 16]; 11], + Feedback: [c_uchar; 16], +}} +pub type PCRYPT_AES_128_KEY_STATE = *mut CRYPT_AES_128_KEY_STATE; +STRUCT!{struct CRYPT_AES_256_KEY_STATE { + Key: [c_uchar; 32], + IV: [c_uchar; 16], + EncryptionState: [[c_uchar; 16]; 15], + DecryptionState: [[c_uchar; 16]; 15], + Feedback: [c_uchar; 16], +}} +pub type PCRYPT_AES_256_KEY_STATE = *mut CRYPT_AES_256_KEY_STATE; +STRUCT!{struct CRYPTOAPI_BLOB { + cbData: DWORD, + pbData: *mut BYTE, +}} +pub type CRYPT_INTEGER_BLOB = CRYPTOAPI_BLOB; +pub type PCRYPT_INTEGER_BLOB = *mut CRYPTOAPI_BLOB; +pub type CRYPT_UINT_BLOB = CRYPTOAPI_BLOB; +pub type PCRYPT_UINT_BLOB = *mut CRYPTOAPI_BLOB; +pub type CRYPT_OBJID_BLOB = CRYPTOAPI_BLOB; +pub type PCRYPT_OBJID_BLOB = *mut CRYPTOAPI_BLOB; +pub type CERT_NAME_BLOB = CRYPTOAPI_BLOB; +pub type PCERT_NAME_BLOB = *mut CRYPTOAPI_BLOB; +pub type CERT_RDN_VALUE_BLOB = CRYPTOAPI_BLOB; +pub type PCERT_RDN_VALUE_BLOB = *mut CRYPTOAPI_BLOB; +pub type CERT_BLOB = CRYPTOAPI_BLOB; +pub type PCERT_BLOB = *mut CRYPTOAPI_BLOB; +pub type CRL_BLOB = CRYPTOAPI_BLOB; +pub type PCRL_BLOB = *mut CRYPTOAPI_BLOB; +pub type DATA_BLOB = CRYPTOAPI_BLOB; +pub type PDATA_BLOB = *mut CRYPTOAPI_BLOB; +pub type CRYPT_DATA_BLOB = CRYPTOAPI_BLOB; +pub type PCRYPT_DATA_BLOB = *mut CRYPTOAPI_BLOB; +pub type CRYPT_HASH_BLOB = CRYPTOAPI_BLOB; +pub type PCRYPT_HASH_BLOB = *mut CRYPTOAPI_BLOB; +pub type CRYPT_DIGEST_BLOB = CRYPTOAPI_BLOB; +pub type PCRYPT_DIGEST_BLOB = *mut CRYPTOAPI_BLOB; +pub type CRYPT_DER_BLOB = CRYPTOAPI_BLOB; +pub type PCRYPT_DER_BLOB = *mut CRYPTOAPI_BLOB; +pub type CRYPT_ATTR_BLOB = CRYPTOAPI_BLOB; +pub type PCRYPT_ATTR_BLOB = *mut CRYPTOAPI_BLOB; +STRUCT!{struct CMS_DH_KEY_INFO { + dwVersion: DWORD, + Algid: ALG_ID, + pszContentEncObjId: LPSTR, + PubInfo: CRYPT_DATA_BLOB, + pReserved: *mut c_void, +}} +pub type PCMS_DH_KEY_INFO = *mut CMS_DH_KEY_INFO; +extern "system" { + pub fn CryptAcquireContextA( + phProv: *mut HCRYPTPROV, + szContainer: LPCSTR, + szProvider: LPCSTR, + dwProvType: DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptAcquireContextW( + phProv: *mut HCRYPTPROV, + szContainer: LPCWSTR, + szProvider: LPCWSTR, + dwProvType: DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptReleaseContext( + hProv: HCRYPTPROV, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptGenKey( + hProv: HCRYPTPROV, + Algid: ALG_ID, + dwFlags: DWORD, + phKey: *mut HCRYPTKEY, + ) -> BOOL; + pub fn CryptDeriveKey( + hProv: HCRYPTPROV, + Algid: ALG_ID, + hBaseData: HCRYPTHASH, + dwFlags: DWORD, + phKey: *mut HCRYPTKEY, + ) -> BOOL; + pub fn CryptDestroyKey( + hKey: HCRYPTKEY, + ) -> BOOL; + pub fn CryptSetKeyParam( + hKey: HCRYPTKEY, + dwParam: DWORD, + pbData: *const BYTE, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptGetKeyParam( + hKey: HCRYPTKEY, + dwParam: DWORD, + pbData: *mut BYTE, + pdwDataLen: *mut DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptSetHashParam( + hHash: HCRYPTHASH, + dwParam: DWORD, + pbData: *const BYTE, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptGetHashParam( + hHash: HCRYPTHASH, + dwParam: DWORD, + pbData: *mut BYTE, + pdwDataLen: *mut DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptSetProvParam( + hProv: HCRYPTPROV, + dwParam: DWORD, + pbData: *const BYTE, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptGetProvParam( + hProv: HCRYPTPROV, + dwParam: DWORD, + pbData: *mut BYTE, + pdwDataLen: *mut DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptGenRandom( + hProv: HCRYPTPROV, + dwLen: DWORD, + pbBuffer: *mut BYTE, + ) -> BOOL; + pub fn CryptGetUserKey( + hProv: HCRYPTPROV, + dwKeySpec: DWORD, + phUserKey: *mut HCRYPTKEY, + ) -> BOOL; + pub fn CryptExportKey( + hKey: HCRYPTKEY, + hExpKey: HCRYPTKEY, + dwBlobType: DWORD, + dwFlags: DWORD, + pbData: *mut BYTE, + pdwDataLen: *mut DWORD, + ) -> BOOL; + pub fn CryptImportKey( + hProv: HCRYPTPROV, + pbData: *const BYTE, + dwDataLen: DWORD, + hPubKey: HCRYPTKEY, + dwFlags: DWORD, + phKey: *mut HCRYPTKEY, + ) -> BOOL; + pub fn CryptEncrypt( + hKey: HCRYPTKEY, + hHash: HCRYPTHASH, + Final: BOOL, + dwFlags: DWORD, + pbData: *mut BYTE, + pdwDataLen: *mut DWORD, + dwBufLen: DWORD, + ) -> BOOL; + pub fn CryptDecrypt( + hKey: HCRYPTKEY, + hHash: HCRYPTHASH, + Final: BOOL, + dwFlags: DWORD, + pbData: *mut BYTE, + pdwDataLen: *mut DWORD, + ) -> BOOL; + pub fn CryptCreateHash( + hProv: HCRYPTPROV, + Algid: ALG_ID, + hKey: HCRYPTKEY, + dwFlags: DWORD, + phHash: *mut HCRYPTHASH, + ) -> BOOL; + pub fn CryptHashData( + hHash: HCRYPTHASH, + pbData: *const BYTE, + dwDataLen: DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptHashSessionKey( + hHash: HCRYPTHASH, + hKey: HCRYPTKEY, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptDestroyHash( + hHash: HCRYPTHASH, + ) -> BOOL; + pub fn CryptSignHashA( + hHash: HCRYPTHASH, + dwKeySpec: DWORD, + szDescription: LPCSTR, + dwFlags: DWORD, + pbSignature: *mut BYTE, + pdwSigLen: *mut DWORD, + ) -> BOOL; + pub fn CryptSignHashW( + hHash: HCRYPTHASH, + dwKeySpec: DWORD, + szDescription: LPCWSTR, + dwFlags: DWORD, + pbSignature: *mut BYTE, + pdwSigLen: *mut DWORD, + ) -> BOOL; + pub fn CryptVerifySignatureA( + hHash: HCRYPTHASH, + pbSignature: *const BYTE, + dwSigLen: DWORD, + hPubKey: HCRYPTKEY, + szDescription: LPCSTR, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptVerifySignatureW( + hHash: HCRYPTHASH, + pbSignature: *const BYTE, + dwSigLen: DWORD, + hPubKey: HCRYPTKEY, + szDescription: LPCWSTR, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptSetProviderA( + pszProvName: LPCSTR, + dwProvType: DWORD, + ) -> BOOL; + pub fn CryptSetProviderW( + pszProvName: LPCWSTR, + dwProvType: DWORD, + ) -> BOOL; + pub fn CryptSetProviderExA( + pszProvName: LPCSTR, + dwProvType: DWORD, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptSetProviderExW( + pszProvName: LPCWSTR, + dwProvType: DWORD, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptGetDefaultProviderA( + dwProvType: DWORD, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + pszProvName: LPSTR, + pcbProvName: *mut DWORD, + ) -> BOOL; + pub fn CryptGetDefaultProviderW( + dwProvType: DWORD, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + pszProvName: LPWSTR, + pcbProvName: *mut DWORD, + ) -> BOOL; + pub fn CryptEnumProviderTypesA( + dwIndex: DWORD, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + pdwProvType: *mut DWORD, + szTypeName: LPSTR, + pcbTypeName: *mut DWORD, + ) -> BOOL; + pub fn CryptEnumProviderTypesW( + dwIndex: DWORD, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + pdwProvType: *mut DWORD, + szTypeName: LPWSTR, + pcbTypeName: *mut DWORD, + ) -> BOOL; + pub fn CryptEnumProvidersA( + dwIndex: DWORD, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + pdwProvType: *mut DWORD, + szProvName: LPSTR, + pcbProvName: *mut DWORD, + ) -> BOOL; + pub fn CryptEnumProvidersW( + dwIndex: DWORD, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + pdwProvType: *mut DWORD, + szProvName: LPWSTR, + pcbProvName: *mut DWORD, + ) -> BOOL; + pub fn CryptContextAddRef( + hProv: HCRYPTPROV, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptDuplicateKey( + hKey: HCRYPTKEY, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + phKey: *mut HCRYPTKEY, + ) -> BOOL; + pub fn CryptDuplicateHash( + hHash: HCRYPTHASH, + pdwReserved: *mut DWORD, + dwFlags: DWORD, + phHash: *mut HCRYPTHASH, + ) -> BOOL; +} +extern "C" { + pub fn GetEncSChannel( + pData: *mut *mut BYTE, + dwDecSize: *mut DWORD, + ) -> BOOL; +} +pub type HCRYPTPROV_OR_NCRYPT_KEY_HANDLE = ULONG_PTR; +pub type HCRYPTPROV_LEGACY = ULONG_PTR; +STRUCT!{struct CRYPT_BIT_BLOB { + cbData: DWORD, + pbData: *mut BYTE, + cUnusedBits: DWORD, +}} +pub type PCRYPT_BIT_BLOB = *mut CRYPT_BIT_BLOB; +STRUCT!{struct CRYPT_ALGORITHM_IDENTIFIER { + pszObjId: LPSTR, + Parameters: CRYPT_OBJID_BLOB, +}} +pub type PCRYPT_ALGORITHM_IDENTIFIER = *mut CRYPT_ALGORITHM_IDENTIFIER; +pub const szOID_RSA: &'static str = "1.2.840.113549"; +pub const szOID_PKCS: &'static str = "1.2.840.113549.1"; +pub const szOID_RSA_HASH: &'static str = "1.2.840.113549.2"; +pub const szOID_RSA_ENCRYPT: &'static str = "1.2.840.113549.3"; +pub const szOID_PKCS_1: &'static str = "1.2.840.113549.1.1"; +pub const szOID_PKCS_2: &'static str = "1.2.840.113549.1.2"; +pub const szOID_PKCS_3: &'static str = "1.2.840.113549.1.3"; +pub const szOID_PKCS_4: &'static str = "1.2.840.113549.1.4"; +pub const szOID_PKCS_5: &'static str = "1.2.840.113549.1.5"; +pub const szOID_PKCS_6: &'static str = "1.2.840.113549.1.6"; +pub const szOID_PKCS_7: &'static str = "1.2.840.113549.1.7"; +pub const szOID_PKCS_8: &'static str = "1.2.840.113549.1.8"; +pub const szOID_PKCS_9: &'static str = "1.2.840.113549.1.9"; +pub const szOID_PKCS_10: &'static str = "1.2.840.113549.1.10"; +pub const szOID_PKCS_12: &'static str = "1.2.840.113549.1.12"; +pub const szOID_RSA_RSA: &'static str = "1.2.840.113549.1.1.1"; +pub const szOID_RSA_MD2RSA: &'static str = "1.2.840.113549.1.1.2"; +pub const szOID_RSA_MD4RSA: &'static str = "1.2.840.113549.1.1.3"; +pub const szOID_RSA_MD5RSA: &'static str = "1.2.840.113549.1.1.4"; +pub const szOID_RSA_SHA1RSA: &'static str = "1.2.840.113549.1.1.5"; +pub const szOID_RSA_SETOAEP_RSA: &'static str = "1.2.840.113549.1.1.6"; +pub const szOID_RSAES_OAEP: &'static str = "1.2.840.113549.1.1.7"; +pub const szOID_RSA_MGF1: &'static str = "1.2.840.113549.1.1.8"; +pub const szOID_RSA_PSPECIFIED: &'static str = "1.2.840.113549.1.1.9"; +pub const szOID_RSA_SSA_PSS: &'static str = "1.2.840.113549.1.1.10"; +pub const szOID_RSA_SHA256RSA: &'static str = "1.2.840.113549.1.1.11"; +pub const szOID_RSA_SHA384RSA: &'static str = "1.2.840.113549.1.1.12"; +pub const szOID_RSA_SHA512RSA: &'static str = "1.2.840.113549.1.1.13"; +pub const szOID_RSA_DH: &'static str = "1.2.840.113549.1.3.1"; +pub const szOID_RSA_data: &'static str = "1.2.840.113549.1.7.1"; +pub const szOID_RSA_signedData: &'static str = "1.2.840.113549.1.7.2"; +pub const szOID_RSA_envelopedData: &'static str = "1.2.840.113549.1.7.3"; +pub const szOID_RSA_signEnvData: &'static str = "1.2.840.113549.1.7.4"; +pub const szOID_RSA_digestedData: &'static str = "1.2.840.113549.1.7.5"; +pub const szOID_RSA_hashedData: &'static str = "1.2.840.113549.1.7.5"; +pub const szOID_RSA_encryptedData: &'static str = "1.2.840.113549.1.7.6"; +pub const szOID_RSA_emailAddr: &'static str = "1.2.840.113549.1.9.1"; +pub const szOID_RSA_unstructName: &'static str = "1.2.840.113549.1.9.2"; +pub const szOID_RSA_contentType: &'static str = "1.2.840.113549.1.9.3"; +pub const szOID_RSA_messageDigest: &'static str = "1.2.840.113549.1.9.4"; +pub const szOID_RSA_signingTime: &'static str = "1.2.840.113549.1.9.5"; +pub const szOID_RSA_counterSign: &'static str = "1.2.840.113549.1.9.6"; +pub const szOID_RSA_challengePwd: &'static str = "1.2.840.113549.1.9.7"; +pub const szOID_RSA_unstructAddr: &'static str = "1.2.840.113549.1.9.8"; +pub const szOID_RSA_extCertAttrs: &'static str = "1.2.840.113549.1.9.9"; +pub const szOID_RSA_certExtensions: &'static str = "1.2.840.113549.1.9.14"; +pub const szOID_RSA_SMIMECapabilities: &'static str = "1.2.840.113549.1.9.15"; +pub const szOID_RSA_preferSignedData: &'static str = "1.2.840.113549.1.9.15.1"; +pub const szOID_TIMESTAMP_TOKEN: &'static str = "1.2.840.113549.1.9.16.1.4"; +pub const szOID_RFC3161_counterSign: &'static str = "1.3.6.1.4.1.311.3.3.1"; +pub const szOID_RSA_SMIMEalg: &'static str = "1.2.840.113549.1.9.16.3"; +pub const szOID_RSA_SMIMEalgESDH: &'static str = "1.2.840.113549.1.9.16.3.5"; +pub const szOID_RSA_SMIMEalgCMS3DESwrap: &'static str = "1.2.840.113549.1.9.16.3.6"; +pub const szOID_RSA_SMIMEalgCMSRC2wrap: &'static str = "1.2.840.113549.1.9.16.3.7"; +pub const szOID_RSA_MD2: &'static str = "1.2.840.113549.2.2"; +pub const szOID_RSA_MD4: &'static str = "1.2.840.113549.2.4"; +pub const szOID_RSA_MD5: &'static str = "1.2.840.113549.2.5"; +pub const szOID_RSA_RC2CBC: &'static str = "1.2.840.113549.3.2"; +pub const szOID_RSA_RC4: &'static str = "1.2.840.113549.3.4"; +pub const szOID_RSA_DES_EDE3_CBC: &'static str = "1.2.840.113549.3.7"; +pub const szOID_RSA_RC5_CBCPad: &'static str = "1.2.840.113549.3.9"; +pub const szOID_ANSI_X942: &'static str = "1.2.840.10046"; +pub const szOID_ANSI_X942_DH: &'static str = "1.2.840.10046.2.1"; +pub const szOID_X957: &'static str = "1.2.840.10040"; +pub const szOID_X957_DSA: &'static str = "1.2.840.10040.4.1"; +pub const szOID_X957_SHA1DSA: &'static str = "1.2.840.10040.4.3"; +pub const szOID_ECC_PUBLIC_KEY: &'static str = "1.2.840.10045.2.1"; +pub const szOID_ECC_CURVE_P256: &'static str = "1.2.840.10045.3.1.7"; +pub const szOID_ECC_CURVE_P384: &'static str = "1.3.132.0.34"; +pub const szOID_ECC_CURVE_P521: &'static str = "1.3.132.0.35"; +pub const szOID_ECC_CURVE_BRAINPOOLP160R1: &'static str = "1.3.36.3.3.2.8.1.1.1"; +pub const szOID_ECC_CURVE_BRAINPOOLP160T1: &'static str = "1.3.36.3.3.2.8.1.1.2"; +pub const szOID_ECC_CURVE_BRAINPOOLP192R1: &'static str = "1.3.36.3.3.2.8.1.1.3"; +pub const szOID_ECC_CURVE_BRAINPOOLP192T1: &'static str = "1.3.36.3.3.2.8.1.1.4"; +pub const szOID_ECC_CURVE_BRAINPOOLP224R1: &'static str = "1.3.36.3.3.2.8.1.1.5"; +pub const szOID_ECC_CURVE_BRAINPOOLP224T1: &'static str = "1.3.36.3.3.2.8.1.1.6"; +pub const szOID_ECC_CURVE_BRAINPOOLP256R1: &'static str = "1.3.36.3.3.2.8.1.1.7"; +pub const szOID_ECC_CURVE_BRAINPOOLP256T1: &'static str = "1.3.36.3.3.2.8.1.1.8"; +pub const szOID_ECC_CURVE_BRAINPOOLP320R1: &'static str = "1.3.36.3.3.2.8.1.1.9"; +pub const szOID_ECC_CURVE_BRAINPOOLP320T1: &'static str = "1.3.36.3.3.2.8.1.1.10"; +pub const szOID_ECC_CURVE_BRAINPOOLP384R1: &'static str = "1.3.36.3.3.2.8.1.1.11"; +pub const szOID_ECC_CURVE_BRAINPOOLP384T1: &'static str = "1.3.36.3.3.2.8.1.1.12"; +pub const szOID_ECC_CURVE_BRAINPOOLP512R1: &'static str = "1.3.36.3.3.2.8.1.1.13"; +pub const szOID_ECC_CURVE_BRAINPOOLP512T1: &'static str = "1.3.36.3.3.2.8.1.1.14"; +pub const szOID_ECC_CURVE_EC192WAPI: &'static str = "1.2.156.11235.1.1.2.1"; +pub const szOID_CN_ECDSA_SHA256: &'static str = "1.2.156.11235.1.1.1"; +pub const szOID_ECC_CURVE_NISTP192: &'static str = "1.2.840.10045.3.1.1"; +pub const szOID_ECC_CURVE_NISTP224: &'static str = "1.3.132.0.33"; +pub const szOID_ECC_CURVE_NISTP256: &'static str = szOID_ECC_CURVE_P256; +pub const szOID_ECC_CURVE_NISTP384: &'static str = szOID_ECC_CURVE_P384; +pub const szOID_ECC_CURVE_NISTP521: &'static str = szOID_ECC_CURVE_P521; +pub const szOID_ECC_CURVE_SECP160K1: &'static str = "1.3.132.0.9"; +pub const szOID_ECC_CURVE_SECP160R1: &'static str = "1.3.132.0.8"; +pub const szOID_ECC_CURVE_SECP160R2: &'static str = "1.3.132.0.30"; +pub const szOID_ECC_CURVE_SECP192K1: &'static str = "1.3.132.0.31"; +pub const szOID_ECC_CURVE_SECP192R1: &'static str = szOID_ECC_CURVE_NISTP192; +pub const szOID_ECC_CURVE_SECP224K1: &'static str = "1.3.132.0.32"; +pub const szOID_ECC_CURVE_SECP224R1: &'static str = szOID_ECC_CURVE_NISTP224; +pub const szOID_ECC_CURVE_SECP256K1: &'static str = "1.3.132.0.10"; +pub const szOID_ECC_CURVE_SECP256R1: &'static str = szOID_ECC_CURVE_P256; +pub const szOID_ECC_CURVE_SECP384R1: &'static str = szOID_ECC_CURVE_P384; +pub const szOID_ECC_CURVE_SECP521R1: &'static str = szOID_ECC_CURVE_P521; +pub const szOID_ECC_CURVE_WTLS7: &'static str = szOID_ECC_CURVE_SECP160R2; +pub const szOID_ECC_CURVE_WTLS9: &'static str = "2.23.43.1.4.9"; +pub const szOID_ECC_CURVE_WTLS12: &'static str = szOID_ECC_CURVE_NISTP224; +pub const szOID_ECC_CURVE_X962P192V1: &'static str = "1.2.840.10045.3.1.1"; +pub const szOID_ECC_CURVE_X962P192V2: &'static str = "1.2.840.10045.3.1.2"; +pub const szOID_ECC_CURVE_X962P192V3: &'static str = "1.2.840.10045.3.1.3"; +pub const szOID_ECC_CURVE_X962P239V1: &'static str = "1.2.840.10045.3.1.4"; +pub const szOID_ECC_CURVE_X962P239V2: &'static str = "1.2.840.10045.3.1.5"; +pub const szOID_ECC_CURVE_X962P239V3: &'static str = "1.2.840.10045.3.1.6"; +pub const szOID_ECC_CURVE_X962P256V1: &'static str = szOID_ECC_CURVE_P256; +pub const szOID_ECDSA_SHA1: &'static str = "1.2.840.10045.4.1"; +pub const szOID_ECDSA_SPECIFIED: &'static str = "1.2.840.10045.4.3"; +pub const szOID_ECDSA_SHA256: &'static str = "1.2.840.10045.4.3.2"; +pub const szOID_ECDSA_SHA384: &'static str = "1.2.840.10045.4.3.3"; +pub const szOID_ECDSA_SHA512: &'static str = "1.2.840.10045.4.3.4"; +pub const szOID_NIST_AES128_CBC: &'static str = "2.16.840.1.101.3.4.1.2"; +pub const szOID_NIST_AES192_CBC: &'static str = "2.16.840.1.101.3.4.1.22"; +pub const szOID_NIST_AES256_CBC: &'static str = "2.16.840.1.101.3.4.1.42"; +pub const szOID_NIST_AES128_WRAP: &'static str = "2.16.840.1.101.3.4.1.5"; +pub const szOID_NIST_AES192_WRAP: &'static str = "2.16.840.1.101.3.4.1.25"; +pub const szOID_NIST_AES256_WRAP: &'static str = "2.16.840.1.101.3.4.1.45"; +pub const szOID_DH_SINGLE_PASS_STDDH_SHA1_KDF: &'static str = "1.3.133.16.840.63.0.2"; +pub const szOID_DH_SINGLE_PASS_STDDH_SHA256_KDF: &'static str = "1.3.132.1.11.1"; +pub const szOID_DH_SINGLE_PASS_STDDH_SHA384_KDF: &'static str = "1.3.132.1.11.2"; +pub const szOID_DS: &'static str = "2.5"; +pub const szOID_DSALG: &'static str = "2.5.8"; +pub const szOID_DSALG_CRPT: &'static str = "2.5.8.1"; +pub const szOID_DSALG_HASH: &'static str = "2.5.8.2"; +pub const szOID_DSALG_SIGN: &'static str = "2.5.8.3"; +pub const szOID_DSALG_RSA: &'static str = "2.5.8.1.1"; +pub const szOID_OIW: &'static str = "1.3.14"; +pub const szOID_OIWSEC: &'static str = "1.3.14.3.2"; +pub const szOID_OIWSEC_md4RSA: &'static str = "1.3.14.3.2.2"; +pub const szOID_OIWSEC_md5RSA: &'static str = "1.3.14.3.2.3"; +pub const szOID_OIWSEC_md4RSA2: &'static str = "1.3.14.3.2.4"; +pub const szOID_OIWSEC_desECB: &'static str = "1.3.14.3.2.6"; +pub const szOID_OIWSEC_desCBC: &'static str = "1.3.14.3.2.7"; +pub const szOID_OIWSEC_desOFB: &'static str = "1.3.14.3.2.8"; +pub const szOID_OIWSEC_desCFB: &'static str = "1.3.14.3.2.9"; +pub const szOID_OIWSEC_desMAC: &'static str = "1.3.14.3.2.10"; +pub const szOID_OIWSEC_rsaSign: &'static str = "1.3.14.3.2.11"; +pub const szOID_OIWSEC_dsa: &'static str = "1.3.14.3.2.12"; +pub const szOID_OIWSEC_shaDSA: &'static str = "1.3.14.3.2.13"; +pub const szOID_OIWSEC_mdc2RSA: &'static str = "1.3.14.3.2.14"; +pub const szOID_OIWSEC_shaRSA: &'static str = "1.3.14.3.2.15"; +pub const szOID_OIWSEC_dhCommMod: &'static str = "1.3.14.3.2.16"; +pub const szOID_OIWSEC_desEDE: &'static str = "1.3.14.3.2.17"; +pub const szOID_OIWSEC_sha: &'static str = "1.3.14.3.2.18"; +pub const szOID_OIWSEC_mdc2: &'static str = "1.3.14.3.2.19"; +pub const szOID_OIWSEC_dsaComm: &'static str = "1.3.14.3.2.20"; +pub const szOID_OIWSEC_dsaCommSHA: &'static str = "1.3.14.3.2.21"; +pub const szOID_OIWSEC_rsaXchg: &'static str = "1.3.14.3.2.22"; +pub const szOID_OIWSEC_keyHashSeal: &'static str = "1.3.14.3.2.23"; +pub const szOID_OIWSEC_md2RSASign: &'static str = "1.3.14.3.2.24"; +pub const szOID_OIWSEC_md5RSASign: &'static str = "1.3.14.3.2.25"; +pub const szOID_OIWSEC_sha1: &'static str = "1.3.14.3.2.26"; +pub const szOID_OIWSEC_dsaSHA1: &'static str = "1.3.14.3.2.27"; +pub const szOID_OIWSEC_dsaCommSHA1: &'static str = "1.3.14.3.2.28"; +pub const szOID_OIWSEC_sha1RSASign: &'static str = "1.3.14.3.2.29"; +pub const szOID_OIWDIR: &'static str = "1.3.14.7.2"; +pub const szOID_OIWDIR_CRPT: &'static str = "1.3.14.7.2.1"; +pub const szOID_OIWDIR_HASH: &'static str = "1.3.14.7.2.2"; +pub const szOID_OIWDIR_SIGN: &'static str = "1.3.14.7.2.3"; +pub const szOID_OIWDIR_md2: &'static str = "1.3.14.7.2.2.1"; +pub const szOID_OIWDIR_md2RSA: &'static str = "1.3.14.7.2.3.1"; +pub const szOID_INFOSEC: &'static str = "2.16.840.1.101.2.1"; +pub const szOID_INFOSEC_sdnsSignature: &'static str = "2.16.840.1.101.2.1.1.1"; +pub const szOID_INFOSEC_mosaicSignature: &'static str = "2.16.840.1.101.2.1.1.2"; +pub const szOID_INFOSEC_sdnsConfidentiality: &'static str = "2.16.840.1.101.2.1.1.3"; +pub const szOID_INFOSEC_mosaicConfidentiality: &'static str = "2.16.840.1.101.2.1.1.4"; +pub const szOID_INFOSEC_sdnsIntegrity: &'static str = "2.16.840.1.101.2.1.1.5"; +pub const szOID_INFOSEC_mosaicIntegrity: &'static str = "2.16.840.1.101.2.1.1.6"; +pub const szOID_INFOSEC_sdnsTokenProtection: &'static str = "2.16.840.1.101.2.1.1.7"; +pub const szOID_INFOSEC_mosaicTokenProtection: &'static str = "2.16.840.1.101.2.1.1.8"; +pub const szOID_INFOSEC_sdnsKeyManagement: &'static str = "2.16.840.1.101.2.1.1.9"; +pub const szOID_INFOSEC_mosaicKeyManagement: &'static str = "2.16.840.1.101.2.1.1.10"; +pub const szOID_INFOSEC_sdnsKMandSig: &'static str = "2.16.840.1.101.2.1.1.11"; +pub const szOID_INFOSEC_mosaicKMandSig: &'static str = "2.16.840.1.101.2.1.1.12"; +pub const szOID_INFOSEC_SuiteASignature: &'static str = "2.16.840.1.101.2.1.1.13"; +pub const szOID_INFOSEC_SuiteAConfidentiality: &'static str = "2.16.840.1.101.2.1.1.14"; +pub const szOID_INFOSEC_SuiteAIntegrity: &'static str = "2.16.840.1.101.2.1.1.15"; +pub const szOID_INFOSEC_SuiteATokenProtection: &'static str = "2.16.840.1.101.2.1.1.16"; +pub const szOID_INFOSEC_SuiteAKeyManagement: &'static str = "2.16.840.1.101.2.1.1.17"; +pub const szOID_INFOSEC_SuiteAKMandSig: &'static str = "2.16.840.1.101.2.1.1.18"; +pub const szOID_INFOSEC_mosaicUpdatedSig: &'static str = "2.16.840.1.101.2.1.1.19"; +pub const szOID_INFOSEC_mosaicKMandUpdSig: &'static str = "2.16.840.1.101.2.1.1.20"; +pub const szOID_INFOSEC_mosaicUpdatedInteg: &'static str = "2.16.840.1.101.2.1.1.21"; +pub const szOID_NIST_sha256: &'static str = "2.16.840.1.101.3.4.2.1"; +pub const szOID_NIST_sha384: &'static str = "2.16.840.1.101.3.4.2.2"; +pub const szOID_NIST_sha512: &'static str = "2.16.840.1.101.3.4.2.3"; +STRUCT!{struct CRYPT_OBJID_TABLE { + dwAlgId: DWORD, + pszObjId: LPCSTR, +}} +pub type PCRYPT_OBJID_TABLE = *mut CRYPT_OBJID_TABLE; +STRUCT!{struct CRYPT_HASH_INFO { + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + Hash: CRYPT_HASH_BLOB, +}} +pub type PCRYPT_HASH_INFO = *mut CRYPT_HASH_INFO; +STRUCT!{struct CERT_EXTENSION { + pszObjId: LPSTR, + fCritical: BOOL, + Value: CRYPT_OBJID_BLOB, +}} +pub type PCERT_EXTENSION = *mut CERT_EXTENSION; +pub type PCCERT_EXTENSION = *const CERT_EXTENSION; +STRUCT!{struct CRYPT_ATTRIBUTE_TYPE_VALUE { + pszObjId: LPSTR, + Value: CRYPT_OBJID_BLOB, +}} +pub type PCRYPT_ATTRIBUTE_TYPE_VALUE = *mut CRYPT_ATTRIBUTE_TYPE_VALUE; +STRUCT!{struct CRYPT_ATTRIBUTE { + pszObjId: LPSTR, + cValue: DWORD, + rgValue: PCRYPT_ATTR_BLOB, +}} +pub type PCRYPT_ATTRIBUTE = *mut CRYPT_ATTRIBUTE; +STRUCT!{struct CRYPT_ATTRIBUTES { + cAttr: DWORD, + rgAttr: PCRYPT_ATTRIBUTE, +}} +pub type PCRYPT_ATTRIBUTES = *mut CRYPT_ATTRIBUTES; +STRUCT!{struct CERT_RDN_ATTR { + pszObjId: LPSTR, + dwValueType: DWORD, + Value: CERT_RDN_VALUE_BLOB, +}} +pub type PCERT_RDN_ATTR = *mut CERT_RDN_ATTR; +pub const szOID_COMMON_NAME: &'static str = "2.5.4.3"; +pub const szOID_SUR_NAME: &'static str = "2.5.4.4"; +pub const szOID_DEVICE_SERIAL_NUMBER: &'static str = "2.5.4.5"; +pub const szOID_COUNTRY_NAME: &'static str = "2.5.4.6"; +pub const szOID_LOCALITY_NAME: &'static str = "2.5.4.7"; +pub const szOID_STATE_OR_PROVINCE_NAME: &'static str = "2.5.4.8"; +pub const szOID_STREET_ADDRESS: &'static str = "2.5.4.9"; +pub const szOID_ORGANIZATION_NAME: &'static str = "2.5.4.10"; +pub const szOID_ORGANIZATIONAL_UNIT_NAME: &'static str = "2.5.4.11"; +pub const szOID_TITLE: &'static str = "2.5.4.12"; +pub const szOID_DESCRIPTION: &'static str = "2.5.4.13"; +pub const szOID_SEARCH_GUIDE: &'static str = "2.5.4.14"; +pub const szOID_BUSINESS_CATEGORY: &'static str = "2.5.4.15"; +pub const szOID_POSTAL_ADDRESS: &'static str = "2.5.4.16"; +pub const szOID_POSTAL_CODE: &'static str = "2.5.4.17"; +pub const szOID_POST_OFFICE_BOX: &'static str = "2.5.4.18"; +pub const szOID_PHYSICAL_DELIVERY_OFFICE_NAME: &'static str = "2.5.4.19"; +pub const szOID_TELEPHONE_NUMBER: &'static str = "2.5.4.20"; +pub const szOID_TELEX_NUMBER: &'static str = "2.5.4.21"; +pub const szOID_TELETEXT_TERMINAL_IDENTIFIER: &'static str = "2.5.4.22"; +pub const szOID_FACSIMILE_TELEPHONE_NUMBER: &'static str = "2.5.4.23"; +pub const szOID_X21_ADDRESS: &'static str = "2.5.4.24"; +pub const szOID_INTERNATIONAL_ISDN_NUMBER: &'static str = "2.5.4.25"; +pub const szOID_REGISTERED_ADDRESS: &'static str = "2.5.4.26"; +pub const szOID_DESTINATION_INDICATOR: &'static str = "2.5.4.27"; +pub const szOID_PREFERRED_DELIVERY_METHOD: &'static str = "2.5.4.28"; +pub const szOID_PRESENTATION_ADDRESS: &'static str = "2.5.4.29"; +pub const szOID_SUPPORTED_APPLICATION_CONTEXT: &'static str = "2.5.4.30"; +pub const szOID_MEMBER: &'static str = "2.5.4.31"; +pub const szOID_OWNER: &'static str = "2.5.4.32"; +pub const szOID_ROLE_OCCUPANT: &'static str = "2.5.4.33"; +pub const szOID_SEE_ALSO: &'static str = "2.5.4.34"; +pub const szOID_USER_PASSWORD: &'static str = "2.5.4.35"; +pub const szOID_USER_CERTIFICATE: &'static str = "2.5.4.36"; +pub const szOID_CA_CERTIFICATE: &'static str = "2.5.4.37"; +pub const szOID_AUTHORITY_REVOCATION_LIST: &'static str = "2.5.4.38"; +pub const szOID_CERTIFICATE_REVOCATION_LIST: &'static str = "2.5.4.39"; +pub const szOID_CROSS_CERTIFICATE_PAIR: &'static str = "2.5.4.40"; +pub const szOID_GIVEN_NAME: &'static str = "2.5.4.42"; +pub const szOID_INITIALS: &'static str = "2.5.4.43"; +pub const szOID_DN_QUALIFIER: &'static str = "2.5.4.46"; +pub const szOID_DOMAIN_COMPONENT: &'static str = "0.9.2342.19200300.100.1.25"; +pub const szOID_PKCS_12_FRIENDLY_NAME_ATTR: &'static str = "1.2.840.113549.1.9.20"; +pub const szOID_PKCS_12_LOCAL_KEY_ID: &'static str = "1.2.840.113549.1.9.21"; +pub const szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR: &'static str = "1.3.6.1.4.1.311.17.1"; +pub const szOID_LOCAL_MACHINE_KEYSET: &'static str = "1.3.6.1.4.1.311.17.2"; +pub const szOID_PKCS_12_EXTENDED_ATTRIBUTES: &'static str = "1.3.6.1.4.1.311.17.3"; +pub const szOID_PKCS_12_PROTECTED_PASSWORD_SECRET_BAG_TYPE_ID: &'static str + = "1.3.6.1.4.1.311.17.4"; +pub const szOID_KEYID_RDN: &'static str = "1.3.6.1.4.1.311.10.7.1"; +pub const szOID_EV_RDN_LOCALE: &'static str = "1.3.6.1.4.1.311.60.2.1.1"; +pub const szOID_EV_RDN_STATE_OR_PROVINCE: &'static str = "1.3.6.1.4.1.311.60.2.1.2"; +pub const szOID_EV_RDN_COUNTRY: &'static str = "1.3.6.1.4.1.311.60.2.1.3"; +pub const CERT_RDN_ANY_TYPE: DWORD = 0; +pub const CERT_RDN_ENCODED_BLOB: DWORD = 1; +pub const CERT_RDN_OCTET_STRING: DWORD = 2; +pub const CERT_RDN_NUMERIC_STRING: DWORD = 3; +pub const CERT_RDN_PRINTABLE_STRING: DWORD = 4; +pub const CERT_RDN_TELETEX_STRING: DWORD = 5; +pub const CERT_RDN_T61_STRING: DWORD = 5; +pub const CERT_RDN_VIDEOTEX_STRING: DWORD = 6; +pub const CERT_RDN_IA5_STRING: DWORD = 7; +pub const CERT_RDN_GRAPHIC_STRING: DWORD = 8; +pub const CERT_RDN_VISIBLE_STRING: DWORD = 9; +pub const CERT_RDN_ISO646_STRING: DWORD = 9; +pub const CERT_RDN_GENERAL_STRING: DWORD = 10; +pub const CERT_RDN_UNIVERSAL_STRING: DWORD = 11; +pub const CERT_RDN_INT4_STRING: DWORD = 11; +pub const CERT_RDN_BMP_STRING: DWORD = 12; +pub const CERT_RDN_UNICODE_STRING: DWORD = 12; +pub const CERT_RDN_UTF8_STRING: DWORD = 13; +pub const CERT_RDN_TYPE_MASK: DWORD = 0x000000FF; +pub const CERT_RDN_FLAGS_MASK: DWORD = 0xFF000000; +pub const CERT_RDN_ENABLE_T61_UNICODE_FLAG: DWORD = 0x80000000; +pub const CERT_RDN_ENABLE_UTF8_UNICODE_FLAG: DWORD = 0x20000000; +pub const CERT_RDN_FORCE_UTF8_UNICODE_FLAG: DWORD = 0x10000000; +pub const CERT_RDN_DISABLE_CHECK_TYPE_FLAG: DWORD = 0x40000000; +pub const CERT_RDN_DISABLE_IE4_UTF8_FLAG: DWORD = 0x01000000; +pub const CERT_RDN_ENABLE_PUNYCODE_FLAG: DWORD = 0x02000000; +#[inline] +pub fn IS_CERT_RDN_CHAR_STRING(X: DWORD) -> bool { + (X & CERT_RDN_TYPE_MASK) >= CERT_RDN_NUMERIC_STRING +} +STRUCT!{struct CERT_RDN { + cRDNAttr: DWORD, + rgRDNAttr: PCERT_RDN_ATTR, +}} +pub type PCERT_RDN = *mut CERT_RDN; +STRUCT!{struct CERT_NAME_INFO { + cRDN: DWORD, + rgRDN: PCERT_RDN, +}} +pub type PCERT_NAME_INFO = *mut CERT_NAME_INFO; +STRUCT!{struct CERT_NAME_VALUE { + dwValueType: DWORD, + Value: CERT_RDN_VALUE_BLOB, +}} +pub type PCERT_NAME_VALUE = *mut CERT_NAME_VALUE; +STRUCT!{struct CERT_PUBLIC_KEY_INFO { + Algorithm: CRYPT_ALGORITHM_IDENTIFIER, + PublicKey: CRYPT_BIT_BLOB, +}} +pub type PCERT_PUBLIC_KEY_INFO = *mut CERT_PUBLIC_KEY_INFO; +pub const CERT_RSA_PUBLIC_KEY_OBJID: &'static str = szOID_RSA_RSA; +pub const CERT_DEFAULT_OID_PUBLIC_KEY_SIGN: &'static str = szOID_RSA_RSA; +pub const CERT_DEFAULT_OID_PUBLIC_KEY_XCHG: &'static str = szOID_RSA_RSA; +STRUCT!{struct CRYPT_ECC_PRIVATE_KEY_INFO { + dwVersion: DWORD, + PrivateKey: CRYPT_DER_BLOB, + szCurveOid: LPSTR, + PublicKey: CRYPT_BIT_BLOB, +}} +pub type PCRYPT_ECC_PRIVATE_KEY_INFO = *mut CRYPT_ECC_PRIVATE_KEY_INFO; +pub const CRYPT_ECC_PRIVATE_KEY_INFO_v1: DWORD = 1; +STRUCT!{struct CRYPT_PRIVATE_KEY_INFO { + Version: DWORD, + Algorithm: CRYPT_ALGORITHM_IDENTIFIER, + PrivateKey: CRYPT_DER_BLOB, + pAttributes: PCRYPT_ATTRIBUTES, +}} +pub type PCRYPT_PRIVATE_KEY_INFO = *mut CRYPT_PRIVATE_KEY_INFO; +STRUCT!{struct CRYPT_ENCRYPTED_PRIVATE_KEY_INFO { + EncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + EncryptedPrivateKey: CRYPT_DATA_BLOB, +}} +pub type PCRYPT_ENCRYPTED_PRIVATE_KEY_INFO = *mut CRYPT_ENCRYPTED_PRIVATE_KEY_INFO; +FN!{stdcall PCRYPT_DECRYPT_PRIVATE_KEY_FUNC( + Algorithm: CRYPT_ALGORITHM_IDENTIFIER, + EncryptedPrivateKey: CRYPT_DATA_BLOB, + pbClearTextKey: *mut BYTE, + pcbClearTextKey: *mut DWORD, + pVoidDecryptFunc: LPVOID, +) -> BOOL} +FN!{stdcall PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC( + Algorithm: *mut CRYPT_ALGORITHM_IDENTIFIER, + pClearTextPrivateKey: *mut CRYPT_DATA_BLOB, + pbEncryptedKey: *mut BYTE, + pcbEncryptedKey: *mut DWORD, + pVoidEncryptFunc: LPVOID, +) -> BOOL} +FN!{stdcall PCRYPT_RESOLVE_HCRYPTPROV_FUNC( + pPrivateKeyInfo: *mut CRYPT_PRIVATE_KEY_INFO, + phCryptProv: *mut HCRYPTPROV, + pVoidResolveFunc: LPVOID, +) -> BOOL} +STRUCT!{struct CRYPT_PKCS8_IMPORT_PARAMS { + PrivateKey: CRYPT_DIGEST_BLOB, + pResolvehCryptProvFunc: PCRYPT_RESOLVE_HCRYPTPROV_FUNC, + pVoidResolveFunc: LPVOID, + pDecryptPrivateKeyFunc: PCRYPT_DECRYPT_PRIVATE_KEY_FUNC, + pVoidDecryptFunc: LPVOID, +}} +pub type PCRYPT_PKCS8_IMPORT_PARAMS = *mut CRYPT_PKCS8_IMPORT_PARAMS; +pub type CRYPT_PRIVATE_KEY_BLOB_AND_PARAMS = CRYPT_PKCS8_IMPORT_PARAMS; +pub type PPCRYPT_PRIVATE_KEY_BLOB_AND_PARAMS = *mut CRYPT_PKCS8_IMPORT_PARAMS; +STRUCT!{struct CRYPT_PKCS8_EXPORT_PARAMS { + hCryptProv: HCRYPTPROV, + dwKeySpec: DWORD, + pszPrivateKeyObjId: LPSTR, + pEncryptPrivateKeyFunc: PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC, + pVoidEncryptFunc: LPVOID, +}} +pub type PCRYPT_PKCS8_EXPORT_PARAMS = *mut CRYPT_PKCS8_EXPORT_PARAMS; +STRUCT!{struct CERT_INFO { + dwVersion: DWORD, + SerialNumber: CRYPT_INTEGER_BLOB, + SignatureAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + Issuer: CERT_NAME_BLOB, + NotBefore: FILETIME, + NotAfter: FILETIME, + Subject: CERT_NAME_BLOB, + SubjectPublicKeyInfo: CERT_PUBLIC_KEY_INFO, + IssuerUniqueId: CRYPT_BIT_BLOB, + SubjectUniqueId: CRYPT_BIT_BLOB, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type PCERT_INFO = *mut CERT_INFO; +pub const CERT_V1: DWORD = 0; +pub const CERT_V2: DWORD = 1; +pub const CERT_V3: DWORD = 2; +pub const CERT_INFO_VERSION_FLAG: DWORD = 1; +pub const CERT_INFO_SERIAL_NUMBER_FLAG: DWORD = 2; +pub const CERT_INFO_SIGNATURE_ALGORITHM_FLAG: DWORD = 3; +pub const CERT_INFO_ISSUER_FLAG: DWORD = 4; +pub const CERT_INFO_NOT_BEFORE_FLAG: DWORD = 5; +pub const CERT_INFO_NOT_AFTER_FLAG: DWORD = 6; +pub const CERT_INFO_SUBJECT_FLAG: DWORD = 7; +pub const CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG: DWORD = 8; +pub const CERT_INFO_ISSUER_UNIQUE_ID_FLAG: DWORD = 9; +pub const CERT_INFO_SUBJECT_UNIQUE_ID_FLAG: DWORD = 10; +pub const CERT_INFO_EXTENSION_FLAG: DWORD = 11; +STRUCT!{struct CRL_ENTRY { + SerialNumber: CRYPT_INTEGER_BLOB, + RevocationDate: FILETIME, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type PCRL_ENTRY = *mut CRL_ENTRY; +STRUCT!{struct CRL_INFO { + dwVersion: DWORD, + SignatureAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + Issuer: CERT_NAME_BLOB, + ThisUpdate: FILETIME, + NextUpdate: FILETIME, + cCRLEntry: DWORD, + rgCRLEntry: PCRL_ENTRY, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type PCRL_INFO = *mut CRL_INFO; +pub const CRL_V1: DWORD = 0; +pub const CRL_V2: DWORD = 1; +pub const CERT_BUNDLE_CERTIFICATE: DWORD = 0; +pub const CERT_BUNDLE_CRL: DWORD = 1; +STRUCT!{struct CERT_OR_CRL_BLOB { + dwChoice: DWORD, + cbEncoded: DWORD, + pbEncoded: *mut BYTE, +}} +pub type PCERT_OR_CRL_BLOB = *mut CERT_OR_CRL_BLOB; +STRUCT!{struct CERT_OR_CRL_BUNDLE { + cItem: DWORD, + rgItem: PCERT_OR_CRL_BLOB, +}} +pub type PCERT_OR_CRL_BUNDLE = *mut CERT_OR_CRL_BUNDLE; +STRUCT!{struct CERT_REQUEST_INFO { + dwVersion: DWORD, + Subject: CERT_NAME_BLOB, + SubjectPublicKeyInfo: CERT_PUBLIC_KEY_INFO, + cAttribute: DWORD, + rgAttribute: PCRYPT_ATTRIBUTE, +}} +pub type PCERT_REQUEST_INFO = *mut CERT_REQUEST_INFO; +pub const CERT_REQUEST_V1: DWORD = 0; +STRUCT!{struct CERT_KEYGEN_REQUEST_INFO { + dwVersion: DWORD, + SubjectPublicKeyInfo: CERT_PUBLIC_KEY_INFO, + pwszChallengeString: LPWSTR, +}} +pub type PCERT_KEYGEN_REQUEST_INFO = *mut CERT_KEYGEN_REQUEST_INFO; +pub const CERT_KEYGEN_REQUEST_V1: DWORD = 0; +STRUCT!{struct CERT_SIGNED_CONTENT_INFO { + ToBeSigned: CRYPT_DER_BLOB, + SignatureAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + Signature: CRYPT_BIT_BLOB, +}} +pub type PCERT_SIGNED_CONTENT_INFO = *mut CERT_SIGNED_CONTENT_INFO; +STRUCT!{struct CTL_USAGE { + cUsageIdentifier: DWORD, + rgpszUsageIdentifier: *mut LPSTR, +}} +pub type PCTL_USAGE = *mut CTL_USAGE; +pub type CERT_ENHKEY_USAGE = CTL_USAGE; +pub type PCERT_ENHKEY_USAGE = *mut CERT_ENHKEY_USAGE; +pub type PCCTL_USAGE = *const CTL_USAGE; +pub type PCCERT_ENHKEY_USAGE = *const CERT_ENHKEY_USAGE; +STRUCT!{struct CTL_ENTRY { + SubjectIdentifier: CRYPT_DATA_BLOB, + cAttribute: DWORD, + rgAttribute: PCRYPT_ATTRIBUTE, +}} +pub type PCTL_ENTRY = *mut CTL_ENTRY; +STRUCT!{struct CTL_INFO { + dwVersion: DWORD, + SubjectUsage: CTL_USAGE, + ListIdentifier: CRYPT_DATA_BLOB, + SequenceNumber: CRYPT_INTEGER_BLOB, + ThisUpdate: FILETIME, + NextUpdate: FILETIME, + SubjectAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + cCTLEntry: DWORD, + rgCTLEntry: PCTL_ENTRY, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type PCTL_INFO = *mut CTL_INFO; +pub const CTL_V1: DWORD = 0; +STRUCT!{struct CRYPT_TIME_STAMP_REQUEST_INFO { + pszTimeStampAlgorithm: LPSTR, + pszContentType: LPSTR, + Content: CRYPT_OBJID_BLOB, + cAttribute: DWORD, + rgAttribute: PCRYPT_ATTRIBUTE, +}} +pub type PCRYPT_TIME_STAMP_REQUEST_INFO = *mut CRYPT_TIME_STAMP_REQUEST_INFO; +STRUCT!{struct CRYPT_ENROLLMENT_NAME_VALUE_PAIR { + pwszName: LPWSTR, + pwszValue: LPWSTR, +}} +pub type PCRYPT_ENROLLMENT_NAME_VALUE_PAIR = *mut CRYPT_ENROLLMENT_NAME_VALUE_PAIR; +STRUCT!{struct CRYPT_CSP_PROVIDER { + dwKeySpec: DWORD, + pwszProviderName: LPWSTR, + Signature: CRYPT_BIT_BLOB, +}} +pub type PCRYPT_CSP_PROVIDER = *mut CRYPT_CSP_PROVIDER; +pub const CERT_ENCODING_TYPE_MASK: DWORD = 0x0000FFFF; +pub const CMSG_ENCODING_TYPE_MASK: DWORD = 0xFFFF0000; +#[inline] +pub fn GET_CERT_ENCODING_TYPE(X: DWORD) -> DWORD { + X & CERT_ENCODING_TYPE_MASK +} +#[inline] +pub fn GET_CMSG_ENCODING_TYPE(X: DWORD) -> DWORD { + X & CMSG_ENCODING_TYPE_MASK +} +pub const CRYPT_ASN_ENCODING: DWORD = 0x00000001; +pub const CRYPT_NDR_ENCODING: DWORD = 0x00000002; +pub const X509_ASN_ENCODING: DWORD = 0x00000001; +pub const X509_NDR_ENCODING: DWORD = 0x00000002; +pub const PKCS_7_ASN_ENCODING: DWORD = 0x00010000; +pub const PKCS_7_NDR_ENCODING: DWORD = 0x00020000; +extern "system" { + pub fn CryptFormatObject( + dwCertEncodingType: DWORD, + dwFormatType: DWORD, + dwFormatStrType: DWORD, + pFormatStruct: *mut c_void, + lpszStructType: LPCSTR, + pbEncoded: *const BYTE, + cbEncoded: DWORD, + pbFormat: *mut c_void, + pcbFormat: *mut DWORD, + ) -> BOOL; +} +pub const CRYPT_FORMAT_STR_MULTI_LINE: DWORD = 0x0001; +pub const CRYPT_FORMAT_STR_NO_HEX: DWORD = 0x0010; +pub const CRYPT_FORMAT_SIMPLE: DWORD = 0x0001; +pub const CRYPT_FORMAT_X509: DWORD = 0x0002; +pub const CRYPT_FORMAT_OID: DWORD = 0x0004; +pub const CRYPT_FORMAT_RDN_SEMICOLON: DWORD = 0x0100; +pub const CRYPT_FORMAT_RDN_CRLF: DWORD = 0x0200; +pub const CRYPT_FORMAT_RDN_UNQUOTE: DWORD = 0x0400; +pub const CRYPT_FORMAT_RDN_REVERSE: DWORD = 0x0800; +pub const CRYPT_FORMAT_COMMA: DWORD = 0x1000; +pub const CRYPT_FORMAT_SEMICOLON: DWORD = CRYPT_FORMAT_RDN_SEMICOLON; +pub const CRYPT_FORMAT_CRLF: DWORD = CRYPT_FORMAT_RDN_CRLF; +FN!{stdcall PFN_CRYPT_ALLOC( + cbSize: size_t, +) -> LPVOID} +FN!{stdcall PFN_CRYPT_FREE( + pv: LPVOID, +) -> ()} +STRUCT!{struct CRYPT_ENCODE_PARA { + cbSize: DWORD, + pfnAlloc: PFN_CRYPT_ALLOC, + pfnFree: PFN_CRYPT_FREE, +}} +pub type PCRYPT_ENCODE_PARA = *mut CRYPT_ENCODE_PARA; +extern "system" { + pub fn CryptEncodeObjectEx( + dwCertEncodingType: DWORD, + lpszStructType: LPCSTR, + pvStructInfo: *const c_void, + dwFlags: DWORD, + pEncodePara: PCRYPT_ENCODE_PARA, + pvEncoded: *mut c_void, + pcbEncoded: *mut DWORD, + ) -> BOOL; + pub fn CryptEncodeObject( + dwCertEncodingType: DWORD, + lpszStructType: LPCSTR, + pvStructInfo: *const c_void, + pbEncoded: *mut BYTE, + pcbEncoded: *mut DWORD, + ) -> BOOL; +} +pub const CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG: DWORD = 0x8; +pub const CRYPT_ENCODE_ALLOC_FLAG: DWORD = 0x8000; +pub const CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG: DWORD + = CERT_RDN_ENABLE_T61_UNICODE_FLAG; +pub const CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG: DWORD + = CERT_RDN_ENABLE_UTF8_UNICODE_FLAG; +pub const CRYPT_UNICODE_NAME_ENCODE_FORCE_UTF8_UNICODE_FLAG: DWORD + = CERT_RDN_FORCE_UTF8_UNICODE_FLAG; +pub const CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG: DWORD + = CERT_RDN_DISABLE_CHECK_TYPE_FLAG; +pub const CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG: DWORD = 0x10000; +pub const CRYPT_ENCODE_ENABLE_PUNYCODE_FLAG: DWORD = 0x20000; +pub const CRYPT_ENCODE_ENABLE_UTF8PERCENT_FLAG: DWORD = 0x40000; +pub const CRYPT_ENCODE_ENABLE_IA5CONVERSION_FLAG: DWORD = CRYPT_ENCODE_ENABLE_PUNYCODE_FLAG + | CRYPT_ENCODE_ENABLE_UTF8PERCENT_FLAG; +STRUCT!{struct CRYPT_DECODE_PARA { + cbSize: DWORD, + pfnAlloc: PFN_CRYPT_ALLOC, + pfnFree: PFN_CRYPT_FREE, +}} +pub type PCRYPT_DECODE_PARA = *mut CRYPT_DECODE_PARA; +extern "system" { + pub fn CryptDecodeObjectEx( + dwCertEncodingType: DWORD, + lpszStructType: LPCSTR, + pbEncoded: *const BYTE, + cbEncoded: DWORD, + dwFlags: DWORD, + pDecodePara: PCRYPT_DECODE_PARA, + pvStructInfo: *mut c_void, + pcbStructInfo: *mut DWORD, + ) -> BOOL; + pub fn CryptDecodeObject( + dwCertEncodingType: DWORD, + lpszStructType: LPCSTR, + pbEncoded: *const BYTE, + cbEncoded: DWORD, + dwFlags: DWORD, + pvStructInfo: *mut c_void, + pcbStructInfo: *mut DWORD, + ) -> BOOL; +} +pub const CRYPT_DECODE_NOCOPY_FLAG: DWORD = 0x1; +pub const CRYPT_DECODE_TO_BE_SIGNED_FLAG: DWORD = 0x2; +pub const CRYPT_DECODE_SHARE_OID_STRING_FLAG: DWORD = 0x4; +pub const CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG: DWORD = 0x8; +pub const CRYPT_DECODE_ALLOC_FLAG: DWORD = 0x8000; +pub const CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG: DWORD + = CERT_RDN_DISABLE_IE4_UTF8_FLAG; +pub const CRYPT_DECODE_ENABLE_PUNYCODE_FLAG: DWORD = 0x02000000; +pub const CRYPT_DECODE_ENABLE_UTF8PERCENT_FLAG: DWORD = 0x04000000; +pub const CRYPT_DECODE_ENABLE_IA5CONVERSION_FLAG: DWORD = CRYPT_DECODE_ENABLE_PUNYCODE_FLAG + | CRYPT_DECODE_ENABLE_UTF8PERCENT_FLAG; +pub const CRYPT_ENCODE_DECODE_NONE: LPCSTR = 0 as LPCSTR; +pub const X509_CERT: LPCSTR = 1 as LPCSTR; +pub const X509_CERT_TO_BE_SIGNED: LPCSTR = 2 as LPCSTR; +pub const X509_CERT_CRL_TO_BE_SIGNED: LPCSTR = 3 as LPCSTR; +pub const X509_CERT_REQUEST_TO_BE_SIGNED: LPCSTR = 4 as LPCSTR; +pub const X509_EXTENSIONS: LPCSTR = 5 as LPCSTR; +pub const X509_NAME_VALUE: LPCSTR = 6 as LPCSTR; +pub const X509_NAME: LPCSTR = 7 as LPCSTR; +pub const X509_PUBLIC_KEY_INFO: LPCSTR = 8 as LPCSTR; +pub const X509_AUTHORITY_KEY_ID: LPCSTR = 9 as LPCSTR; +pub const X509_KEY_ATTRIBUTES: LPCSTR = 10 as LPCSTR; +pub const X509_KEY_USAGE_RESTRICTION: LPCSTR = 11 as LPCSTR; +pub const X509_ALTERNATE_NAME: LPCSTR = 12 as LPCSTR; +pub const X509_BASIC_CONSTRAINTS: LPCSTR = 13 as LPCSTR; +pub const X509_KEY_USAGE: LPCSTR = 14 as LPCSTR; +pub const X509_BASIC_CONSTRAINTS2: LPCSTR = 15 as LPCSTR; +pub const X509_CERT_POLICIES: LPCSTR = 16 as LPCSTR; +pub const PKCS_UTC_TIME: LPCSTR = 17 as LPCSTR; +pub const PKCS_TIME_REQUEST: LPCSTR = 18 as LPCSTR; +pub const RSA_CSP_PUBLICKEYBLOB: LPCSTR = 19 as LPCSTR; +pub const X509_UNICODE_NAME: LPCSTR = 20 as LPCSTR; +pub const X509_KEYGEN_REQUEST_TO_BE_SIGNED: LPCSTR = 21 as LPCSTR; +pub const PKCS_ATTRIBUTE: LPCSTR = 22 as LPCSTR; +pub const PKCS_CONTENT_INFO_SEQUENCE_OF_ANY: LPCSTR = 23 as LPCSTR; +pub const X509_UNICODE_NAME_VALUE: LPCSTR = 24 as LPCSTR; +pub const X509_ANY_STRING: LPCSTR = X509_NAME_VALUE; +pub const X509_UNICODE_ANY_STRING: LPCSTR = X509_UNICODE_NAME_VALUE; +pub const X509_OCTET_STRING: LPCSTR = 25 as LPCSTR; +pub const X509_BITS: LPCSTR = 26 as LPCSTR; +pub const X509_INTEGER: LPCSTR = 27 as LPCSTR; +pub const X509_MULTI_BYTE_INTEGER: LPCSTR = 28 as LPCSTR; +pub const X509_ENUMERATED: LPCSTR = 29 as LPCSTR; +pub const X509_CHOICE_OF_TIME: LPCSTR = 30 as LPCSTR; +pub const X509_AUTHORITY_KEY_ID2: LPCSTR = 31 as LPCSTR; +pub const X509_AUTHORITY_INFO_ACCESS: LPCSTR = 32 as LPCSTR; +pub const X509_SUBJECT_INFO_ACCESS: LPCSTR = X509_AUTHORITY_INFO_ACCESS; +pub const X509_CRL_REASON_CODE: LPCSTR = X509_ENUMERATED; +pub const PKCS_CONTENT_INFO: LPCSTR = 33 as LPCSTR; +pub const X509_SEQUENCE_OF_ANY: LPCSTR = 34 as LPCSTR; +pub const X509_CRL_DIST_POINTS: LPCSTR = 35 as LPCSTR; +pub const X509_ENHANCED_KEY_USAGE: LPCSTR = 36 as LPCSTR; +pub const PKCS_CTL: LPCSTR = 37 as LPCSTR; +pub const X509_MULTI_BYTE_UINT: LPCSTR = 38 as LPCSTR; +pub const X509_DSS_PUBLICKEY: LPCSTR = X509_MULTI_BYTE_UINT; +pub const X509_DSS_PARAMETERS: LPCSTR = 39 as LPCSTR; +pub const X509_DSS_SIGNATURE: LPCSTR = 40 as LPCSTR; +pub const PKCS_RC2_CBC_PARAMETERS: LPCSTR = 41 as LPCSTR; +pub const PKCS_SMIME_CAPABILITIES: LPCSTR = 42 as LPCSTR; +pub const X509_QC_STATEMENTS_EXT: LPCSTR = 42 as LPCSTR; +pub const PKCS_RSA_PRIVATE_KEY: LPCSTR = 43 as LPCSTR; +pub const PKCS_PRIVATE_KEY_INFO: LPCSTR = 44 as LPCSTR; +pub const PKCS_ENCRYPTED_PRIVATE_KEY_INFO: LPCSTR = 45 as LPCSTR; +pub const X509_PKIX_POLICY_QUALIFIER_USERNOTICE: LPCSTR = 46 as LPCSTR; +pub const X509_DH_PUBLICKEY: LPCSTR = X509_MULTI_BYTE_UINT; +pub const X509_DH_PARAMETERS: LPCSTR = 47 as LPCSTR; +pub const PKCS_ATTRIBUTES: LPCSTR = 48 as LPCSTR; +pub const PKCS_SORTED_CTL: LPCSTR = 49 as LPCSTR; +pub const X509_ECC_SIGNATURE: LPCSTR = 47 as LPCSTR; +pub const X942_DH_PARAMETERS: LPCSTR = 50 as LPCSTR; +pub const X509_BITS_WITHOUT_TRAILING_ZEROES: LPCSTR = 51 as LPCSTR; +pub const X942_OTHER_INFO: LPCSTR = 52 as LPCSTR; +pub const X509_CERT_PAIR: LPCSTR = 53 as LPCSTR; +pub const X509_ISSUING_DIST_POINT: LPCSTR = 54 as LPCSTR; +pub const X509_NAME_CONSTRAINTS: LPCSTR = 55 as LPCSTR; +pub const X509_POLICY_MAPPINGS: LPCSTR = 56 as LPCSTR; +pub const X509_POLICY_CONSTRAINTS: LPCSTR = 57 as LPCSTR; +pub const X509_CROSS_CERT_DIST_POINTS: LPCSTR = 58 as LPCSTR; +pub const CMC_DATA: LPCSTR = 59 as LPCSTR; +pub const CMC_RESPONSE: LPCSTR = 60 as LPCSTR; +pub const CMC_STATUS: LPCSTR = 61 as LPCSTR; +pub const CMC_ADD_EXTENSIONS: LPCSTR = 62 as LPCSTR; +pub const CMC_ADD_ATTRIBUTES: LPCSTR = 63 as LPCSTR; +pub const X509_CERTIFICATE_TEMPLATE: LPCSTR = 64 as LPCSTR; +pub const OCSP_SIGNED_REQUEST: LPCSTR = 65 as LPCSTR; +pub const OCSP_REQUEST: LPCSTR = 66 as LPCSTR; +pub const OCSP_RESPONSE: LPCSTR = 67 as LPCSTR; +pub const OCSP_BASIC_SIGNED_RESPONSE: LPCSTR = 68 as LPCSTR; +pub const OCSP_BASIC_RESPONSE: LPCSTR = 69 as LPCSTR; +pub const X509_LOGOTYPE_EXT: LPCSTR = 70 as LPCSTR; +pub const X509_BIOMETRIC_EXT: LPCSTR = 71 as LPCSTR; +pub const CNG_RSA_PUBLIC_KEY_BLOB: LPCSTR = 72 as LPCSTR; +pub const X509_OBJECT_IDENTIFIER: LPCSTR = 73 as LPCSTR; +pub const X509_ALGORITHM_IDENTIFIER: LPCSTR = 74 as LPCSTR; +pub const PKCS_RSA_SSA_PSS_PARAMETERS: LPCSTR = 75 as LPCSTR; +pub const PKCS_RSAES_OAEP_PARAMETERS: LPCSTR = 76 as LPCSTR; +pub const ECC_CMS_SHARED_INFO: LPCSTR = 77 as LPCSTR; +pub const TIMESTAMP_REQUEST: LPCSTR = 78 as LPCSTR; +pub const TIMESTAMP_RESPONSE: LPCSTR = 79 as LPCSTR; +pub const TIMESTAMP_INFO: LPCSTR = 80 as LPCSTR; +pub const X509_CERT_BUNDLE: LPCSTR = 81 as LPCSTR; +pub const X509_ECC_PRIVATE_KEY: LPCSTR = 82 as LPCSTR; +pub const CNG_RSA_PRIVATE_KEY_BLOB: LPCSTR = 83 as LPCSTR; +pub const X509_SUBJECT_DIR_ATTRS: LPCSTR = 84 as LPCSTR; +pub const X509_ECC_PARAMETERS: LPCSTR = 85 as LPCSTR; +pub const PKCS7_SIGNER_INFO: LPCSTR = 500 as LPCSTR; +pub const CMS_SIGNER_INFO: LPCSTR = 501 as LPCSTR; +pub const szOID_AUTHORITY_KEY_IDENTIFIER: &'static str = "2.5.29.1"; +pub const szOID_KEY_ATTRIBUTES: &'static str = "2.5.29.2"; +pub const szOID_CERT_POLICIES_95: &'static str = "2.5.29.3"; +pub const szOID_KEY_USAGE_RESTRICTION: &'static str = "2.5.29.4"; +pub const szOID_SUBJECT_ALT_NAME: &'static str = "2.5.29.7"; +pub const szOID_ISSUER_ALT_NAME: &'static str = "2.5.29.8"; +pub const szOID_BASIC_CONSTRAINTS: &'static str = "2.5.29.10"; +pub const szOID_KEY_USAGE: &'static str = "2.5.29.15"; +pub const szOID_PRIVATEKEY_USAGE_PERIOD: &'static str = "2.5.29.16"; +pub const szOID_BASIC_CONSTRAINTS2: &'static str = "2.5.29.19"; +pub const szOID_CERT_POLICIES: &'static str = "2.5.29.32"; +pub const szOID_ANY_CERT_POLICY: &'static str = "2.5.29.32.0"; +pub const szOID_INHIBIT_ANY_POLICY: &'static str = "2.5.29.54"; +pub const szOID_AUTHORITY_KEY_IDENTIFIER2: &'static str = "2.5.29.35"; +pub const szOID_SUBJECT_KEY_IDENTIFIER: &'static str = "2.5.29.14"; +pub const szOID_SUBJECT_ALT_NAME2: &'static str = "2.5.29.17"; +pub const szOID_ISSUER_ALT_NAME2: &'static str = "2.5.29.18"; +pub const szOID_CRL_REASON_CODE: &'static str = "2.5.29.21"; +pub const szOID_REASON_CODE_HOLD: &'static str = "2.5.29.23"; +pub const szOID_CRL_DIST_POINTS: &'static str = "2.5.29.31"; +pub const szOID_ENHANCED_KEY_USAGE: &'static str = "2.5.29.37"; +pub const szOID_ANY_ENHANCED_KEY_USAGE: &'static str = "2.5.29.37.0"; +pub const szOID_CRL_NUMBER: &'static str = "2.5.29.20"; +pub const szOID_DELTA_CRL_INDICATOR: &'static str = "2.5.29.27"; +pub const szOID_ISSUING_DIST_POINT: &'static str = "2.5.29.28"; +pub const szOID_FRESHEST_CRL: &'static str = "2.5.29.46"; +pub const szOID_NAME_CONSTRAINTS: &'static str = "2.5.29.30"; +pub const szOID_POLICY_MAPPINGS: &'static str = "2.5.29.33"; +pub const szOID_LEGACY_POLICY_MAPPINGS: &'static str = "2.5.29.5"; +pub const szOID_POLICY_CONSTRAINTS: &'static str = "2.5.29.36"; +pub const szOID_RENEWAL_CERTIFICATE: &'static str = "1.3.6.1.4.1.311.13.1"; +pub const szOID_ENROLLMENT_NAME_VALUE_PAIR: &'static str = "1.3.6.1.4.1.311.13.2.1"; +pub const szOID_ENROLLMENT_CSP_PROVIDER: &'static str = "1.3.6.1.4.1.311.13.2.2"; +pub const szOID_OS_VERSION: &'static str = "1.3.6.1.4.1.311.13.2.3"; +pub const szOID_ENROLLMENT_AGENT: &'static str = "1.3.6.1.4.1.311.20.2.1"; +pub const szOID_PKIX: &'static str = "1.3.6.1.5.5.7"; +pub const szOID_PKIX_PE: &'static str = "1.3.6.1.5.5.7.1"; +pub const szOID_AUTHORITY_INFO_ACCESS: &'static str = "1.3.6.1.5.5.7.1.1"; +pub const szOID_SUBJECT_INFO_ACCESS: &'static str = "1.3.6.1.5.5.7.1.11"; +pub const szOID_BIOMETRIC_EXT: &'static str = "1.3.6.1.5.5.7.1.2"; +pub const szOID_QC_STATEMENTS_EXT: &'static str = "1.3.6.1.5.5.7.1.3"; +pub const szOID_LOGOTYPE_EXT: &'static str = "1.3.6.1.5.5.7.1.12"; +pub const szOID_TLS_FEATURES_EXT: &'static str = "1.3.6.1.5.5.7.1.24"; +pub const szOID_CERT_EXTENSIONS: &'static str = "1.3.6.1.4.1.311.2.1.14"; +pub const szOID_NEXT_UPDATE_LOCATION: &'static str = "1.3.6.1.4.1.311.10.2"; +pub const szOID_REMOVE_CERTIFICATE: &'static str = "1.3.6.1.4.1.311.10.8.1"; +pub const szOID_CROSS_CERT_DIST_POINTS: &'static str = "1.3.6.1.4.1.311.10.9.1"; +pub const szOID_CTL: &'static str = "1.3.6.1.4.1.311.10.1"; +pub const szOID_SORTED_CTL: &'static str = "1.3.6.1.4.1.311.10.1.1"; +pub const szOID_SERIALIZED: &'static str = "1.3.6.1.4.1.311.10.3.3.1"; +pub const szOID_NT_PRINCIPAL_NAME: &'static str = "1.3.6.1.4.1.311.20.2.3"; +pub const szOID_INTERNATIONALIZED_EMAIL_ADDRESS: &'static str = "1.3.6.1.4.1.311.20.2.4"; +pub const szOID_PRODUCT_UPDATE: &'static str = "1.3.6.1.4.1.311.31.1"; +pub const szOID_ANY_APPLICATION_POLICY: &'static str = "1.3.6.1.4.1.311.10.12.1"; +pub const szOID_AUTO_ENROLL_CTL_USAGE: &'static str = "1.3.6.1.4.1.311.20.1"; +pub const szOID_ENROLL_CERTTYPE_EXTENSION: &'static str = "1.3.6.1.4.1.311.20.2"; +pub const szOID_CERT_MANIFOLD: &'static str = "1.3.6.1.4.1.311.20.3"; +pub const szOID_CERTSRV_CA_VERSION: &'static str = "1.3.6.1.4.1.311.21.1"; +pub const szOID_CERTSRV_PREVIOUS_CERT_HASH: &'static str = "1.3.6.1.4.1.311.21.2"; +pub const szOID_CRL_VIRTUAL_BASE: &'static str = "1.3.6.1.4.1.311.21.3"; +pub const szOID_CRL_NEXT_PUBLISH: &'static str = "1.3.6.1.4.1.311.21.4"; +pub const szOID_KP_CA_EXCHANGE: &'static str = "1.3.6.1.4.1.311.21.5"; +pub const szOID_KP_PRIVACY_CA: &'static str = "1.3.6.1.4.1.311.21.36"; +pub const szOID_KP_KEY_RECOVERY_AGENT: &'static str = "1.3.6.1.4.1.311.21.6"; +pub const szOID_CERTIFICATE_TEMPLATE: &'static str = "1.3.6.1.4.1.311.21.7"; +pub const szOID_ENTERPRISE_OID_ROOT: &'static str = "1.3.6.1.4.1.311.21.8"; +pub const szOID_RDN_DUMMY_SIGNER: &'static str = "1.3.6.1.4.1.311.21.9"; +pub const szOID_APPLICATION_CERT_POLICIES: &'static str = "1.3.6.1.4.1.311.21.10"; +pub const szOID_APPLICATION_POLICY_MAPPINGS: &'static str = "1.3.6.1.4.1.311.21.11"; +pub const szOID_APPLICATION_POLICY_CONSTRAINTS: &'static str = "1.3.6.1.4.1.311.21.12"; +pub const szOID_ARCHIVED_KEY_ATTR: &'static str = "1.3.6.1.4.1.311.21.13"; +pub const szOID_CRL_SELF_CDP: &'static str = "1.3.6.1.4.1.311.21.14"; +pub const szOID_REQUIRE_CERT_CHAIN_POLICY: &'static str = "1.3.6.1.4.1.311.21.15"; +pub const szOID_ARCHIVED_KEY_CERT_HASH: &'static str = "1.3.6.1.4.1.311.21.16"; +pub const szOID_ISSUED_CERT_HASH: &'static str = "1.3.6.1.4.1.311.21.17"; +pub const szOID_DS_EMAIL_REPLICATION: &'static str = "1.3.6.1.4.1.311.21.19"; +pub const szOID_REQUEST_CLIENT_INFO: &'static str = "1.3.6.1.4.1.311.21.20"; +pub const szOID_ENCRYPTED_KEY_HASH: &'static str = "1.3.6.1.4.1.311.21.21"; +pub const szOID_CERTSRV_CROSSCA_VERSION: &'static str = "1.3.6.1.4.1.311.21.22"; +pub const szOID_NTDS_REPLICATION: &'static str = "1.3.6.1.4.1.311.25.1"; +pub const szOID_SUBJECT_DIR_ATTRS: &'static str = "2.5.29.9"; +pub const szOID_PKIX_KP: &'static str = "1.3.6.1.5.5.7.3"; +pub const szOID_PKIX_KP_SERVER_AUTH: &'static str = "1.3.6.1.5.5.7.3.1"; +pub const szOID_PKIX_KP_CLIENT_AUTH: &'static str = "1.3.6.1.5.5.7.3.2"; +pub const szOID_PKIX_KP_CODE_SIGNING: &'static str = "1.3.6.1.5.5.7.3.3"; +pub const szOID_PKIX_KP_EMAIL_PROTECTION: &'static str = "1.3.6.1.5.5.7.3.4"; +pub const szOID_PKIX_KP_IPSEC_END_SYSTEM: &'static str = "1.3.6.1.5.5.7.3.5"; +pub const szOID_PKIX_KP_IPSEC_TUNNEL: &'static str = "1.3.6.1.5.5.7.3.6"; +pub const szOID_PKIX_KP_IPSEC_USER: &'static str = "1.3.6.1.5.5.7.3.7"; +pub const szOID_PKIX_KP_TIMESTAMP_SIGNING: &'static str = "1.3.6.1.5.5.7.3.8"; +pub const szOID_PKIX_KP_OCSP_SIGNING: &'static str = "1.3.6.1.5.5.7.3.9"; +pub const szOID_PKIX_OCSP_NOCHECK: &'static str = "1.3.6.1.5.5.7.48.1.5"; +pub const szOID_PKIX_OCSP_NONCE: &'static str = "1.3.6.1.5.5.7.48.1.2"; +pub const szOID_IPSEC_KP_IKE_INTERMEDIATE: &'static str = "1.3.6.1.5.5.8.2.2"; +pub const szOID_PKINIT_KP_KDC: &'static str = "1.3.6.1.5.2.3.5"; +pub const szOID_KP_CTL_USAGE_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.1"; +pub const szOID_KP_TIME_STAMP_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.2"; +pub const szOID_SERVER_GATED_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.3"; +pub const szOID_SGC_NETSCAPE: &'static str = "2.16.840.1.113730.4.1"; +pub const szOID_KP_EFS: &'static str = "1.3.6.1.4.1.311.10.3.4"; +pub const szOID_EFS_RECOVERY: &'static str = "1.3.6.1.4.1.311.10.3.4.1"; +pub const szOID_WHQL_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.5"; +pub const szOID_ATTEST_WHQL_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.5.1"; +pub const szOID_NT5_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.6"; +pub const szOID_OEM_WHQL_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.7"; +pub const szOID_EMBEDDED_NT_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.8"; +pub const szOID_ROOT_LIST_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.9"; +pub const szOID_KP_QUALIFIED_SUBORDINATION: &'static str = "1.3.6.1.4.1.311.10.3.10"; +pub const szOID_KP_KEY_RECOVERY: &'static str = "1.3.6.1.4.1.311.10.3.11"; +pub const szOID_KP_DOCUMENT_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.12"; +pub const szOID_KP_LIFETIME_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.13"; +pub const szOID_KP_MOBILE_DEVICE_SOFTWARE: &'static str = "1.3.6.1.4.1.311.10.3.14"; +pub const szOID_KP_SMART_DISPLAY: &'static str = "1.3.6.1.4.1.311.10.3.15"; +pub const szOID_KP_CSP_SIGNATURE: &'static str = "1.3.6.1.4.1.311.10.3.16"; +pub const szOID_KP_FLIGHT_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.27"; +pub const szOID_PLATFORM_MANIFEST_BINARY_ID: &'static str = "1.3.6.1.4.1.311.10.3.28"; +pub const szOID_DRM: &'static str = "1.3.6.1.4.1.311.10.5.1"; +pub const szOID_DRM_INDIVIDUALIZATION: &'static str = "1.3.6.1.4.1.311.10.5.2"; +pub const szOID_LICENSES: &'static str = "1.3.6.1.4.1.311.10.6.1"; +pub const szOID_LICENSE_SERVER: &'static str = "1.3.6.1.4.1.311.10.6.2"; +pub const szOID_KP_SMARTCARD_LOGON: &'static str = "1.3.6.1.4.1.311.20.2.2"; +pub const szOID_KP_KERNEL_MODE_CODE_SIGNING: &'static str = "1.3.6.1.4.1.311.61.1.1"; +pub const szOID_KP_KERNEL_MODE_TRUSTED_BOOT_SIGNING: &'static str = "1.3.6.1.4.1.311.61.4.1"; +pub const szOID_REVOKED_LIST_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.19"; +pub const szOID_WINDOWS_KITS_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.20"; +pub const szOID_WINDOWS_RT_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.21"; +pub const szOID_PROTECTED_PROCESS_LIGHT_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.22"; +pub const szOID_WINDOWS_TCB_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.23"; +pub const szOID_PROTECTED_PROCESS_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.24"; +pub const szOID_WINDOWS_THIRD_PARTY_COMPONENT_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.25"; +pub const szOID_WINDOWS_SOFTWARE_EXTENSION_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.26"; +pub const szOID_DISALLOWED_LIST: &'static str = "1.3.6.1.4.1.311.10.3.30"; +pub const szOID_PIN_RULES_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.31"; +pub const szOID_PIN_RULES_CTL: &'static str = "1.3.6.1.4.1.311.10.3.32"; +pub const szOID_PIN_RULES_EXT: &'static str = "1.3.6.1.4.1.311.10.3.33"; +pub const szOID_PIN_RULES_DOMAIN_NAME: &'static str = "1.3.6.1.4.1.311.10.3.34"; +pub const szOID_PIN_RULES_LOG_END_DATE_EXT: &'static str = "1.3.6.1.4.1.311.10.3.35"; +pub const szOID_IUM_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.37"; +pub const szOID_EV_WHQL_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.39"; +pub const szOID_SYNC_ROOT_CTL_EXT: &'static str = "1.3.6.1.4.1.311.10.3.50"; +pub const szOID_HPKP_DOMAIN_NAME_CTL: &'static str = "1.3.6.1.4.1.311.10.3.60"; +pub const szOID_HPKP_HEADER_VALUE_CTL: &'static str = "1.3.6.1.4.1.311.10.3.61"; +pub const szOID_KP_KERNEL_MODE_HAL_EXTENSION_SIGNING: &'static str = "1.3.6.1.4.1.311.61.5.1"; +pub const szOID_WINDOWS_STORE_SIGNER: &'static str = "1.3.6.1.4.1.311.76.3.1"; +pub const szOID_DYNAMIC_CODE_GEN_SIGNER: &'static str = "1.3.6.1.4.1.311.76.5.1"; +pub const szOID_MICROSOFT_PUBLISHER_SIGNER: &'static str = "1.3.6.1.4.1.311.76.8.1"; +pub const szOID_YESNO_TRUST_ATTR: &'static str = "1.3.6.1.4.1.311.10.4.1"; +pub const szOID_SITE_PIN_RULES_INDEX_ATTR: &'static str = "1.3.6.1.4.1.311.10.4.2"; +pub const szOID_SITE_PIN_RULES_FLAGS_ATTR: &'static str = "1.3.6.1.4.1.311.10.4.3"; +pub const szOID_PKIX_POLICY_QUALIFIER_CPS: &'static str = "1.3.6.1.5.5.7.2.1"; +pub const szOID_PKIX_POLICY_QUALIFIER_USERNOTICE: &'static str = "1.3.6.1.5.5.7.2.2"; +pub const szOID_ROOT_PROGRAM_FLAGS: &'static str = "1.3.6.1.4.1.311.60.1.1"; +pub const CERT_ROOT_PROGRAM_FLAG_ORG: DWORD = 0x80; +pub const CERT_ROOT_PROGRAM_FLAG_LSC: DWORD = 0x40; +pub const CERT_ROOT_PROGRAM_FLAG_SUBJECT_LOGO: DWORD = 0x20; +pub const CERT_ROOT_PROGRAM_FLAG_OU: DWORD = 0x10; +pub const CERT_ROOT_PROGRAM_FLAG_ADDRESS: DWORD = 0x08; +pub const szOID_CERT_POLICIES_95_QUALIFIER1: &'static str = "2.16.840.1.113733.1.7.1.1"; +pub const szOID_RDN_TPM_MANUFACTURER: &'static str = "2.23.133.2.1"; +pub const szOID_RDN_TPM_MODEL: &'static str = "2.23.133.2.2"; +pub const szOID_RDN_TPM_VERSION: &'static str = "2.23.133.2.3"; +pub const szOID_RDN_TCG_PLATFORM_MANUFACTURER: &'static str = "2.23.133.2.4"; +pub const szOID_RDN_TCG_PLATFORM_MODEL: &'static str = "2.23.133.2.5"; +pub const szOID_RDN_TCG_PLATFORM_VERSION: &'static str = "2.23.133.2.6"; +pub const szOID_ENROLL_EK_INFO: &'static str = "1.3.6.1.4.1.311.21.23"; +pub const szOID_ENROLL_AIK_INFO: &'static str = "1.3.6.1.4.1.311.21.39"; +pub const szOID_ENROLL_ATTESTATION_STATEMENT: &'static str = "1.3.6.1.4.1.311.21.24"; +pub const szOID_ENROLL_KSP_NAME: &'static str = "1.3.6.1.4.1.311.21.25"; +pub const szOID_ENROLL_EKPUB_CHALLENGE: &'static str = "1.3.6.1.4.1.311.21.26"; +pub const szOID_ENROLL_CAXCHGCERT_HASH: &'static str = "1.3.6.1.4.1.311.21.27"; +pub const szOID_ENROLL_ATTESTATION_CHALLENGE: &'static str = "1.3.6.1.4.1.311.21.28"; +pub const szOID_ENROLL_ENCRYPTION_ALGORITHM: &'static str = "1.3.6.1.4.1.311.21.29"; +pub const szOID_KP_TPM_EK_CERTIFICATE: &'static str = "2.23.133.8.1"; +pub const szOID_KP_TPM_PLATFORM_CERTIFICATE: &'static str = "2.23.133.8.2"; +pub const szOID_KP_TPM_AIK_CERTIFICATE: &'static str = "2.23.133.8.3"; +pub const szOID_ENROLL_EKVERIFYKEY: &'static str = "1.3.6.1.4.1.311.21.30"; +pub const szOID_ENROLL_EKVERIFYCERT: &'static str = "1.3.6.1.4.1.311.21.31"; +pub const szOID_ENROLL_EKVERIFYCREDS: &'static str = "1.3.6.1.4.1.311.21.32"; +pub const szOID_ENROLL_SCEP_ERROR: &'static str = "1.3.6.1.4.1.311.21.33"; +pub const szOID_ENROLL_SCEP_SERVER_STATE: &'static str = "1.3.6.1.4.1.311.21.34"; +pub const szOID_ENROLL_SCEP_CHALLENGE_ANSWER: &'static str = "1.3.6.1.4.1.311.21.35"; +pub const szOID_ENROLL_SCEP_CLIENT_REQUEST: &'static str = "1.3.6.1.4.1.311.21.37"; +pub const szOID_ENROLL_SCEP_SERVER_MESSAGE: &'static str = "1.3.6.1.4.1.311.21.38"; +pub const szOID_ENROLL_SCEP_SERVER_SECRET: &'static str = "1.3.6.1.4.1.311.21.40"; +pub const szOID_ENROLL_KEY_AFFINITY: &'static str = "1.3.6.1.4.1.311.21.41"; +pub const szOID_ENROLL_SCEP_SIGNER_HASH: &'static str = "1.3.6.1.4.1.311.21.42"; +pub const szOID_ENROLL_EK_CA_KEYID: &'static str = "1.3.6.1.4.1.311.21.43"; +pub const szOID_ATTR_SUPPORTED_ALGORITHMS: &'static str = "2.5.4.52"; +pub const szOID_ATTR_TPM_SPECIFICATION: &'static str = "2.23.133.2.16"; +pub const szOID_ATTR_PLATFORM_SPECIFICATION: &'static str = "2.23.133.2.17"; +pub const szOID_ATTR_TPM_SECURITY_ASSERTIONS: &'static str = "2.23.133.2.18"; +STRUCT!{struct CERT_EXTENSIONS { + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type PCERT_EXTENSIONS = *mut CERT_EXTENSIONS; +pub const CERT_UNICODE_RDN_ERR_INDEX_MASK: DWORD = 0x3FF; +pub const CERT_UNICODE_RDN_ERR_INDEX_SHIFT: DWORD = 22; +pub const CERT_UNICODE_ATTR_ERR_INDEX_MASK: DWORD = 0x003F; +pub const CERT_UNICODE_ATTR_ERR_INDEX_SHIFT: DWORD = 16; +pub const CERT_UNICODE_VALUE_ERR_INDEX_MASK: DWORD = 0x0000FFFF; +pub const CERT_UNICODE_VALUE_ERR_INDEX_SHIFT: DWORD = 0; +#[inline] +pub fn GET_CERT_UNICODE_RDN_ERR_INDEX(X: DWORD) -> DWORD { + (X >> CERT_UNICODE_RDN_ERR_INDEX_SHIFT) & CERT_UNICODE_RDN_ERR_INDEX_MASK +} +#[inline] +pub fn GET_CERT_UNICODE_ATTR_ERR_INDEX(X: DWORD) -> DWORD { + (X >> CERT_UNICODE_ATTR_ERR_INDEX_SHIFT) & CERT_UNICODE_ATTR_ERR_INDEX_MASK +} +#[inline] +pub fn GET_CERT_UNICODE_VALUE_ERR_INDEX(X: DWORD) -> DWORD { + X & CERT_UNICODE_VALUE_ERR_INDEX_MASK +} +STRUCT!{struct CERT_AUTHORITY_KEY_ID_INFO { + KeyId: CRYPT_DATA_BLOB, + CertIssuer: CERT_NAME_BLOB, + CertSerialNumber: CRYPT_INTEGER_BLOB, +}} +pub type PCERT_AUTHORITY_KEY_ID_INFO = *mut CERT_AUTHORITY_KEY_ID_INFO; +STRUCT!{struct CERT_PRIVATE_KEY_VALIDITY { + NotBefore: FILETIME, + NotAfter: FILETIME, +}} +pub type PCERT_PRIVATE_KEY_VALIDITY = *mut CERT_PRIVATE_KEY_VALIDITY; +STRUCT!{struct CERT_KEY_ATTRIBUTES_INFO { + KeyId: CRYPT_DATA_BLOB, + IntendedKeyUsage: CRYPT_BIT_BLOB, + pPrivateKeyUsagePeriod: PCERT_PRIVATE_KEY_VALIDITY, +}} +pub type PCERT_KEY_ATTRIBUTES_INFO = *mut CERT_KEY_ATTRIBUTES_INFO; +pub const CERT_DIGITAL_SIGNATURE_KEY_USAGE: DWORD = 0x80; +pub const CERT_NON_REPUDIATION_KEY_USAGE: DWORD = 0x40; +pub const CERT_KEY_ENCIPHERMENT_KEY_USAGE: DWORD = 0x20; +pub const CERT_DATA_ENCIPHERMENT_KEY_USAGE: DWORD = 0x10; +pub const CERT_KEY_AGREEMENT_KEY_USAGE: DWORD = 0x08; +pub const CERT_KEY_CERT_SIGN_KEY_USAGE: DWORD = 0x04; +pub const CERT_OFFLINE_CRL_SIGN_KEY_USAGE: DWORD = 0x02; +pub const CERT_CRL_SIGN_KEY_USAGE: DWORD = 0x02; +pub const CERT_ENCIPHER_ONLY_KEY_USAGE: DWORD = 0x01; +pub const CERT_DECIPHER_ONLY_KEY_USAGE: DWORD = 0x80; +STRUCT!{struct CERT_POLICY_ID { + cCertPolicyElementId: DWORD, + rgpszCertPolicyElementId: *mut LPSTR, +}} +pub type PCERT_POLICY_ID = *mut CERT_POLICY_ID; +STRUCT!{struct CERT_KEY_USAGE_RESTRICTION_INFO { + cCertPolicyId: DWORD, + rgCertPolicyId: PCERT_POLICY_ID, + RestrictedKeyUsage: CRYPT_BIT_BLOB, +}} +pub type PCERT_KEY_USAGE_RESTRICTION_INFO = *mut CERT_KEY_USAGE_RESTRICTION_INFO; +STRUCT!{struct CERT_OTHER_NAME { + pszObjId: LPSTR, + Value: CRYPT_OBJID_BLOB, +}} +pub type PCERT_OTHER_NAME = *mut CERT_OTHER_NAME; +UNION!{union CERT_ALT_NAME_ENTRY_u { + [usize; 2], + pOtherName pOtherName_mut: PCERT_OTHER_NAME, + pwszRfc822Name pwszRfc822Name_mut: LPWSTR, + pwszDNSName pwszDNSName_mut: LPWSTR, + DirectoryName DirectoryName_mut: CERT_NAME_BLOB, + pwszURL pwszURL_mut: LPWSTR, + IPAddress IPAddress_mut: CRYPT_DATA_BLOB, + pszRegisteredID pszRegisteredID_mut: LPSTR, +}} +STRUCT!{struct CERT_ALT_NAME_ENTRY { + dwAltNameChoice: DWORD, + u: CERT_ALT_NAME_ENTRY_u, +}} +pub type PCERT_ALT_NAME_ENTRY = *mut CERT_ALT_NAME_ENTRY; +pub const CERT_ALT_NAME_OTHER_NAME: DWORD = 1; +pub const CERT_ALT_NAME_RFC822_NAME: DWORD = 2; +pub const CERT_ALT_NAME_DNS_NAME: DWORD = 3; +pub const CERT_ALT_NAME_X400_ADDRESS: DWORD = 4; +pub const CERT_ALT_NAME_DIRECTORY_NAME: DWORD = 5; +pub const CERT_ALT_NAME_EDI_PARTY_NAME: DWORD = 6; +pub const CERT_ALT_NAME_URL: DWORD = 7; +pub const CERT_ALT_NAME_IP_ADDRESS: DWORD = 8; +pub const CERT_ALT_NAME_REGISTERED_ID: DWORD = 9; +STRUCT!{struct CERT_ALT_NAME_INFO { + cAltEntry: DWORD, + rgAltEntry: PCERT_ALT_NAME_ENTRY, +}} +pub type PCERT_ALT_NAME_INFO = *mut CERT_ALT_NAME_INFO; +pub const CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK: DWORD = 0xFF; +pub const CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT: DWORD = 16; +pub const CERT_ALT_NAME_VALUE_ERR_INDEX_MASK: DWORD = 0x0000FFFF; +pub const CERT_ALT_NAME_VALUE_ERR_INDEX_SHIFT: DWORD = 0; +#[inline] +pub fn GET_CERT_ALT_NAME_ENTRY_ERR_INDEX(X: DWORD) -> DWORD { + (X >> CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT) & CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK +} +#[inline] +pub fn GET_CERT_ALT_NAME_VALUE_ERR_INDEX(X: DWORD) -> DWORD { + X & CERT_ALT_NAME_VALUE_ERR_INDEX_MASK +} +STRUCT!{struct CERT_BASIC_CONSTRAINTS_INFO { + SubjectType: CRYPT_BIT_BLOB, + fPathLenConstraint: BOOL, + dwPathLenConstraint: DWORD, + cSubtreesConstraint: DWORD, + rgSubtreesConstraint: *mut CERT_NAME_BLOB, +}} +pub type PCERT_BASIC_CONSTRAINTS_INFO = *mut CERT_BASIC_CONSTRAINTS_INFO; +pub const CERT_CA_SUBJECT_FLAG: DWORD = 0x80; +pub const CERT_END_ENTITY_SUBJECT_FLAG: DWORD = 0x40; +STRUCT!{struct CERT_BASIC_CONSTRAINTS2_INFO { + fCA: BOOL, + fPathLenConstraint: BOOL, + dwPathLenConstraint: DWORD, +}} +pub type PCERT_BASIC_CONSTRAINTS2_INFO = *mut CERT_BASIC_CONSTRAINTS2_INFO; +STRUCT!{struct CERT_POLICY_QUALIFIER_INFO { + pszPolicyQualifierId: LPSTR, + Qualifier: CRYPT_OBJID_BLOB, +}} +pub type PCERT_POLICY_QUALIFIER_INFO = *mut CERT_POLICY_QUALIFIER_INFO; +STRUCT!{struct CERT_POLICY_INFO { + pszPolicyIdentifier: LPSTR, + cPolicyQualifier: DWORD, + rgPolicyQualifier: *mut CERT_POLICY_QUALIFIER_INFO, +}} +pub type PCERT_POLICY_INFO = *mut CERT_POLICY_INFO; +STRUCT!{struct CERT_POLICIES_INFO { + cPolicyInfo: DWORD, + rgPolicyInfo: *mut CERT_POLICY_INFO, +}} +pub type PCERT_POLICIES_INFO = *mut CERT_POLICIES_INFO; +STRUCT!{struct CERT_POLICY_QUALIFIER_NOTICE_REFERENCE { + pszOrganization: LPSTR, + cNoticeNumbers: DWORD, + rgNoticeNumbers: *mut c_int, +}} +pub type PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE = *mut CERT_POLICY_QUALIFIER_NOTICE_REFERENCE; +STRUCT!{struct CERT_POLICY_QUALIFIER_USER_NOTICE { + pNoticeReference: *mut CERT_POLICY_QUALIFIER_NOTICE_REFERENCE, + pszDisplayText: LPWSTR, +}} +pub type PCERT_POLICY_QUALIFIER_USER_NOTICE = *mut CERT_POLICY_QUALIFIER_USER_NOTICE; +STRUCT!{struct CPS_URLS { + pszURL: LPWSTR, + pAlgorithm: *mut CRYPT_ALGORITHM_IDENTIFIER, + pDigest: *mut CRYPT_DATA_BLOB, +}} +pub type PCPS_URLS = *mut CPS_URLS; +STRUCT!{struct CERT_POLICY95_QUALIFIER1 { + pszPracticesReference: LPWSTR, + pszNoticeIdentifier: LPSTR, + pszNSINoticeIdentifier: LPSTR, + cCPSURLs: DWORD, + rgCPSURLs: *mut CPS_URLS, +}} +pub type PCERT_POLICY95_QUALIFIER1 = *mut CERT_POLICY95_QUALIFIER1; +STRUCT!{struct CERT_POLICY_MAPPING { + pszIssuerDomainPolicy: LPSTR, + pszSubjectDomainPolicy: LPSTR, +}} +pub type PCERT_POLICY_MAPPING = *mut CERT_POLICY_MAPPING; +STRUCT!{struct CERT_POLICY_MAPPINGS_INFO { + cPolicyMapping: DWORD, + rgPolicyMapping: PCERT_POLICY_MAPPING, +}} +pub type PCERT_POLICY_MAPPINGS_INFO = *mut CERT_POLICY_MAPPINGS_INFO; +STRUCT!{struct CERT_POLICY_CONSTRAINTS_INFO { + fRequireExplicitPolicy: BOOL, + dwRequireExplicitPolicySkipCerts: DWORD, + fInhibitPolicyMapping: BOOL, + dwInhibitPolicyMappingSkipCerts: DWORD, +}} +pub type PCERT_POLICY_CONSTRAINTS_INFO = *mut CERT_POLICY_CONSTRAINTS_INFO; +STRUCT!{struct CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY { + pszObjId: LPSTR, + cValue: DWORD, + rgValue: PCRYPT_DER_BLOB, +}} +pub type PCRYPT_CONTENT_INFO_SEQUENCE_OF_ANY = *mut CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY; +STRUCT!{struct CRYPT_CONTENT_INFO { + pszObjId: LPSTR, + Content: CRYPT_DER_BLOB, +}} +pub type PCRYPT_CONTENT_INFO = *mut CRYPT_CONTENT_INFO; +STRUCT!{struct CRYPT_SEQUENCE_OF_ANY { + cValue: DWORD, + rgValue: PCRYPT_DER_BLOB, +}} +pub type PCRYPT_SEQUENCE_OF_ANY = *mut CRYPT_SEQUENCE_OF_ANY; +STRUCT!{struct CERT_AUTHORITY_KEY_ID2_INFO { + KeyId: CRYPT_DATA_BLOB, + AuthorityCertIssuer: CERT_ALT_NAME_INFO, + AuthorityCertSerialNumber: CRYPT_INTEGER_BLOB, +}} +pub type PCERT_AUTHORITY_KEY_ID2_INFO = *mut CERT_AUTHORITY_KEY_ID2_INFO; +STRUCT!{struct CERT_ACCESS_DESCRIPTION { + pszAccessMethod: LPSTR, + AccessLocation: CERT_ALT_NAME_ENTRY, +}} +pub type PCERT_ACCESS_DESCRIPTION = *mut CERT_ACCESS_DESCRIPTION; +STRUCT!{struct CERT_AUTHORITY_INFO_ACCESS { + cAccDescr: DWORD, + rgAccDescr: PCERT_ACCESS_DESCRIPTION, +}} +pub type PCERT_AUTHORITY_INFO_ACCESS = *mut CERT_AUTHORITY_INFO_ACCESS; +pub type CERT_SUBJECT_INFO_ACCESS = CERT_AUTHORITY_INFO_ACCESS; +pub type PCERT_SUBJECT_INFO_ACCESS = *mut CERT_AUTHORITY_INFO_ACCESS; +pub const szOID_PKIX_ACC_DESCR: &'static str = "1.3.6.1.5.5.7.48"; +pub const szOID_PKIX_OCSP: &'static str = "1.3.6.1.5.5.7.48.1"; +pub const szOID_PKIX_CA_ISSUERS: &'static str = "1.3.6.1.5.5.7.48.2"; +pub const szOID_PKIX_TIME_STAMPING: &'static str = "1.3.6.1.5.5.7.48.3"; +pub const szOID_PKIX_CA_REPOSITORY: &'static str = "1.3.6.1.5.5.7.48.5"; +pub const CRL_REASON_UNSPECIFIED: DWORD = 0; +pub const CRL_REASON_KEY_COMPROMISE: DWORD = 1; +pub const CRL_REASON_CA_COMPROMISE: DWORD = 2; +pub const CRL_REASON_AFFILIATION_CHANGED: DWORD = 3; +pub const CRL_REASON_SUPERSEDED: DWORD = 4; +pub const CRL_REASON_CESSATION_OF_OPERATION: DWORD = 5; +pub const CRL_REASON_CERTIFICATE_HOLD: DWORD = 6; +pub const CRL_REASON_REMOVE_FROM_CRL: DWORD = 8; +pub const CRL_REASON_PRIVILEGE_WITHDRAWN: DWORD = 9; +pub const CRL_REASON_AA_COMPROMISE: DWORD = 10; +UNION!{union CRL_DIST_POINT_NAME_u { + [usize; 2], + FullName FullName_mut: CERT_ALT_NAME_INFO, +}} +STRUCT!{struct CRL_DIST_POINT_NAME { + dwDistPointNameChoice: DWORD, + u: CRL_DIST_POINT_NAME_u, +}} +pub type PCRL_DIST_POINT_NAME = *mut CRL_DIST_POINT_NAME; +pub const CRL_DIST_POINT_NO_NAME: DWORD = 0; +pub const CRL_DIST_POINT_FULL_NAME: DWORD = 1; +pub const CRL_DIST_POINT_ISSUER_RDN_NAME: DWORD = 2; +STRUCT!{struct CRL_DIST_POINT { + DistPointName: CRL_DIST_POINT_NAME, + ReasonFlags: CRYPT_BIT_BLOB, + CRLIssuer: CERT_ALT_NAME_INFO, +}} +pub type PCRL_DIST_POINT = *mut CRL_DIST_POINT; +pub const CRL_REASON_UNUSED_FLAG: DWORD = 0x80; +pub const CRL_REASON_KEY_COMPROMISE_FLAG: DWORD = 0x40; +pub const CRL_REASON_CA_COMPROMISE_FLAG: DWORD = 0x20; +pub const CRL_REASON_AFFILIATION_CHANGED_FLAG: DWORD = 0x10; +pub const CRL_REASON_SUPERSEDED_FLAG: DWORD = 0x08; +pub const CRL_REASON_CESSATION_OF_OPERATION_FLAG: DWORD = 0x04; +pub const CRL_REASON_CERTIFICATE_HOLD_FLAG: DWORD = 0x02; +pub const CRL_REASON_PRIVILEGE_WITHDRAWN_FLAG: DWORD = 0x01; +pub const CRL_REASON_AA_COMPROMISE_FLAG: DWORD = 0x80; +STRUCT!{struct CRL_DIST_POINTS_INFO { + cDistPoint: DWORD, + rgDistPoint: PCRL_DIST_POINT, +}} +pub type PCRL_DIST_POINTS_INFO = *mut CRL_DIST_POINTS_INFO; +pub const CRL_DIST_POINT_ERR_INDEX_MASK: DWORD = 0x7F; +pub const CRL_DIST_POINT_ERR_INDEX_SHIFT: DWORD = 24; +#[inline] +pub fn GET_CRL_DIST_POINT_ERR_INDEX(X: DWORD) -> DWORD { + (X >> CRL_DIST_POINT_ERR_INDEX_SHIFT) & CRL_DIST_POINT_ERR_INDEX_MASK +} +pub const CRL_DIST_POINT_ERR_CRL_ISSUER_BIT: DWORD = 0x80000000; +#[inline] +pub fn IS_CRL_DIST_POINT_ERR_CRL_ISSUER(X: DWORD) -> bool { + 0 != (X & CRL_DIST_POINT_ERR_CRL_ISSUER_BIT) +} +STRUCT!{struct CROSS_CERT_DIST_POINTS_INFO { + dwSyncDeltaTime: DWORD, + cDistPoint: DWORD, + rgDistPoint: PCERT_ALT_NAME_INFO, +}} +pub type PCROSS_CERT_DIST_POINTS_INFO = *mut CROSS_CERT_DIST_POINTS_INFO; +pub const CROSS_CERT_DIST_POINT_ERR_INDEX_MASK: DWORD = 0xFF; +pub const CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT: DWORD = 24; +#[inline] +pub fn GET_CROSS_CERT_DIST_POINT_ERR_INDEX(X: DWORD) -> DWORD { + (X >> CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT) & CROSS_CERT_DIST_POINT_ERR_INDEX_MASK +} +STRUCT!{struct CERT_PAIR { + Forward: CERT_BLOB, + Reverse: CERT_BLOB, +}} +pub type PCERT_PAIR = *mut CERT_PAIR; +STRUCT!{struct CRL_ISSUING_DIST_POINT { + DistPointName: CRL_DIST_POINT_NAME, + fOnlyContainsUserCerts: BOOL, + fOnlyContainsCACerts: BOOL, + OnlySomeReasonFlags: CRYPT_BIT_BLOB, + fIndirectCRL: BOOL, +}} +pub type PCRL_ISSUING_DIST_POINT = *mut CRL_ISSUING_DIST_POINT; +STRUCT!{struct CERT_GENERAL_SUBTREE { + Base: CERT_ALT_NAME_ENTRY, + dwMinimum: DWORD, + fMaximum: BOOL, + dwMaximum: DWORD, +}} +pub type PCERT_GENERAL_SUBTREE = *mut CERT_GENERAL_SUBTREE; +STRUCT!{struct CERT_NAME_CONSTRAINTS_INFO { + cPermittedSubtree: DWORD, + rgPermittedSubtree: PCERT_GENERAL_SUBTREE, + cExcludedSubtree: DWORD, + rgExcludedSubtree: PCERT_GENERAL_SUBTREE, +}} +pub type PCERT_NAME_CONSTRAINTS_INFO = *mut CERT_NAME_CONSTRAINTS_INFO; +pub const CERT_EXCLUDED_SUBTREE_BIT: DWORD = 0x80000000; +#[inline] +pub fn IS_CERT_EXCLUDED_SUBTREE(X: DWORD) -> bool { + 0 != (X & CERT_EXCLUDED_SUBTREE_BIT) +} +pub const SORTED_CTL_EXT_FLAGS_OFFSET: c_int = 0 * 4; +pub const SORTED_CTL_EXT_COUNT_OFFSET: c_int = 1 * 4; +pub const SORTED_CTL_EXT_MAX_COLLISION_OFFSET: c_int = 2 * 4; +pub const SORTED_CTL_EXT_HASH_BUCKET_OFFSET: c_int = 3 * 4; +pub const SORTED_CTL_EXT_HASHED_SUBJECT_IDENTIFIER_FLAG: DWORD = 0x1; +STRUCT!{struct CERT_DSS_PARAMETERS { + p: CRYPT_UINT_BLOB, + q: CRYPT_UINT_BLOB, + g: CRYPT_UINT_BLOB, +}} +pub type PCERT_DSS_PARAMETERS = *mut CERT_DSS_PARAMETERS; +pub const CERT_DSS_R_LEN: usize = 20; +pub const CERT_DSS_S_LEN: usize = 20; +pub const CERT_DSS_SIGNATURE_LEN: usize = CERT_DSS_R_LEN + CERT_DSS_S_LEN; +pub const CERT_MAX_ASN_ENCODED_DSS_SIGNATURE_LEN: usize = 2 + 2 * (2 + 20 + 1); +STRUCT!{struct CERT_DH_PARAMETERS { + p: CRYPT_UINT_BLOB, + g: CRYPT_UINT_BLOB, +}} +pub type PCERT_DH_PARAMETERS = *mut CERT_DH_PARAMETERS; +STRUCT!{struct CERT_ECC_SIGNATURE { + r: CRYPT_UINT_BLOB, + s: CRYPT_UINT_BLOB, +}} +pub type PCERT_ECC_SIGNATURE = *mut CERT_ECC_SIGNATURE; +STRUCT!{struct CERT_X942_DH_VALIDATION_PARAMS { + seed: CRYPT_BIT_BLOB, + pgenCounter: DWORD, +}} +pub type PCERT_X942_DH_VALIDATION_PARAMS = *mut CERT_X942_DH_VALIDATION_PARAMS; +STRUCT!{struct CERT_X942_DH_PARAMETERS { + p: CRYPT_UINT_BLOB, + g: CRYPT_UINT_BLOB, + q: CRYPT_UINT_BLOB, + j: CRYPT_UINT_BLOB, + pValidationParams: PCERT_X942_DH_VALIDATION_PARAMS, +}} +pub type PCERT_X942_DH_PARAMETERS = *mut CERT_X942_DH_PARAMETERS; +pub const CRYPT_X942_COUNTER_BYTE_LENGTH: usize = 4; +pub const CRYPT_X942_KEY_LENGTH_BYTE_LENGTH: usize = 4; +pub const CRYPT_X942_PUB_INFO_BYTE_LENGTH: usize = 512 / 8; +STRUCT!{struct CRYPT_X942_OTHER_INFO { + pszContentEncryptionObjId: LPSTR, + rgbCounter: [BYTE; CRYPT_X942_COUNTER_BYTE_LENGTH], + rgbKeyLength: [BYTE; CRYPT_X942_KEY_LENGTH_BYTE_LENGTH], + PubInfo: CRYPT_DATA_BLOB, +}} +pub type PCRYPT_X942_OTHER_INFO = *mut CRYPT_X942_OTHER_INFO; +pub const CRYPT_ECC_CMS_SHARED_INFO_SUPPPUBINFO_BYTE_LENGTH: usize = 4; +STRUCT!{struct CRYPT_ECC_CMS_SHARED_INFO { + Algorithm: CRYPT_ALGORITHM_IDENTIFIER, + EntityUInfo: CRYPT_DATA_BLOB, + rgbSuppPubInfo: [BYTE; CRYPT_ECC_CMS_SHARED_INFO_SUPPPUBINFO_BYTE_LENGTH], +}} +pub type PCRYPT_ECC_CMS_SHARED_INFO = *mut CRYPT_ECC_CMS_SHARED_INFO; +STRUCT!{struct CRYPT_RC2_CBC_PARAMETERS { + dwVersion: DWORD, + fIV: BOOL, + rgbIV: [BYTE; 8], +}} +pub type PCRYPT_RC2_CBC_PARAMETERS = *mut CRYPT_RC2_CBC_PARAMETERS; +pub const CRYPT_RC2_40BIT_VERSION: DWORD = 160; +pub const CRYPT_RC2_56BIT_VERSION: DWORD = 52; +pub const CRYPT_RC2_64BIT_VERSION: DWORD = 120; +pub const CRYPT_RC2_128BIT_VERSION: DWORD = 58; +STRUCT!{struct CRYPT_SMIME_CAPABILITY { + pszObjId: LPSTR, + Parameters: CRYPT_OBJID_BLOB, +}} +pub type PCRYPT_SMIME_CAPABILITY = *mut CRYPT_SMIME_CAPABILITY; +STRUCT!{struct CRYPT_SMIME_CAPABILITIES { + cCapability: DWORD, + rgCapability: PCRYPT_SMIME_CAPABILITY, +}} +pub type PCRYPT_SMIME_CAPABILITIES = *mut CRYPT_SMIME_CAPABILITIES; +STRUCT!{struct CERT_QC_STATEMENT { + pszStatementId: LPSTR, + StatementInfo: CRYPT_OBJID_BLOB, +}} +pub type PCERT_QC_STATEMENT = *mut CERT_QC_STATEMENT; +STRUCT!{struct CERT_QC_STATEMENTS_EXT_INFO { + cStatement: DWORD, + rgStatement: PCERT_QC_STATEMENT, +}} +pub type PCERT_QC_STATEMENTS_EXT_INFO = *mut CERT_QC_STATEMENTS_EXT_INFO; +pub const szOID_QC_EU_COMPLIANCE: &'static str = "0.4.0.1862.1.1"; +pub const szOID_QC_SSCD: &'static str = "0.4.0.1862.1.4"; +STRUCT!{struct CRYPT_MASK_GEN_ALGORITHM { + pszObjId: LPSTR, + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, +}} +pub type PCRYPT_MASK_GEN_ALGORITHM = *mut CRYPT_MASK_GEN_ALGORITHM; +STRUCT!{struct CRYPT_RSA_SSA_PSS_PARAMETERS { + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + MaskGenAlgorithm: CRYPT_MASK_GEN_ALGORITHM, + dwSaltLength: DWORD, + dwTrailerField: DWORD, +}} +pub type PCRYPT_RSA_SSA_PSS_PARAMETERS = *mut CRYPT_RSA_SSA_PSS_PARAMETERS; +pub const PKCS_RSA_SSA_PSS_TRAILER_FIELD_BC: DWORD = 1; +STRUCT!{struct CRYPT_PSOURCE_ALGORITHM { + pszObjId: LPSTR, + EncodingParameters: CRYPT_DATA_BLOB, +}} +pub type PCRYPT_PSOURCE_ALGORITHM = *mut CRYPT_PSOURCE_ALGORITHM; +STRUCT!{struct CRYPT_RSAES_OAEP_PARAMETERS { + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + MaskGenAlgorithm: CRYPT_MASK_GEN_ALGORITHM, + PSourceAlgorithm: CRYPT_PSOURCE_ALGORITHM, +}} +pub type PCRYPT_RSAES_OAEP_PARAMETERS = *mut CRYPT_RSAES_OAEP_PARAMETERS; +pub const szOID_VERISIGN_PRIVATE_6_9: &'static str = "2.16.840.1.113733.1.6.9"; +pub const szOID_VERISIGN_ONSITE_JURISDICTION_HASH: &'static str = "2.16.840.1.113733.1.6.11"; +pub const szOID_VERISIGN_BITSTRING_6_13: &'static str = "2.16.840.1.113733.1.6.13"; +pub const szOID_VERISIGN_ISS_STRONG_CRYPTO: &'static str = "2.16.840.1.113733.1.8.1"; +pub const szOIDVerisign_MessageType: &'static str = "2.16.840.1.113733.1.9.2"; +pub const szOIDVerisign_PkiStatus: &'static str = "2.16.840.1.113733.1.9.3"; +pub const szOIDVerisign_FailInfo: &'static str = "2.16.840.1.113733.1.9.4"; +pub const szOIDVerisign_SenderNonce: &'static str = "2.16.840.1.113733.1.9.5"; +pub const szOIDVerisign_RecipientNonce: &'static str = "2.16.840.1.113733.1.9.6"; +pub const szOIDVerisign_TransactionID: &'static str = "2.16.840.1.113733.1.9.7"; +pub const szOID_NETSCAPE: &'static str = "2.16.840.1.113730"; +pub const szOID_NETSCAPE_CERT_EXTENSION: &'static str = "2.16.840.1.113730.1"; +pub const szOID_NETSCAPE_CERT_TYPE: &'static str = "2.16.840.1.113730.1.1"; +pub const szOID_NETSCAPE_BASE_URL: &'static str = "2.16.840.1.113730.1.2"; +pub const szOID_NETSCAPE_REVOCATION_URL: &'static str = "2.16.840.1.113730.1.3"; +pub const szOID_NETSCAPE_CA_REVOCATION_URL: &'static str = "2.16.840.1.113730.1.4"; +pub const szOID_NETSCAPE_CERT_RENEWAL_URL: &'static str = "2.16.840.1.113730.1.7"; +pub const szOID_NETSCAPE_CA_POLICY_URL: &'static str = "2.16.840.1.113730.1.8"; +pub const szOID_NETSCAPE_SSL_SERVER_NAME: &'static str = "2.16.840.1.113730.1.12"; +pub const szOID_NETSCAPE_COMMENT: &'static str = "2.16.840.1.113730.1.13"; +pub const szOID_NETSCAPE_DATA_TYPE: &'static str = "2.16.840.1.113730.2"; +pub const szOID_NETSCAPE_CERT_SEQUENCE: &'static str = "2.16.840.1.113730.2.5"; +pub const NETSCAPE_SSL_CLIENT_AUTH_CERT_TYPE: DWORD = 0x80; +pub const NETSCAPE_SSL_SERVER_AUTH_CERT_TYPE: DWORD = 0x40; +pub const NETSCAPE_SMIME_CERT_TYPE: DWORD = 0x20; +pub const NETSCAPE_SIGN_CERT_TYPE: DWORD = 0x10; +pub const NETSCAPE_SSL_CA_CERT_TYPE: DWORD = 0x04; +pub const NETSCAPE_SMIME_CA_CERT_TYPE: DWORD = 0x02; +pub const NETSCAPE_SIGN_CA_CERT_TYPE: DWORD = 0x01; +pub const szOID_CT_PKI_DATA: &'static str = "1.3.6.1.5.5.7.12.2"; +pub const szOID_CT_PKI_RESPONSE: &'static str = "1.3.6.1.5.5.7.12.3"; +pub const szOID_PKIX_NO_SIGNATURE: &'static str = "1.3.6.1.5.5.7.6.2"; +pub const szOID_CMC: &'static str = "1.3.6.1.5.5.7.7"; +pub const szOID_CMC_STATUS_INFO: &'static str = "1.3.6.1.5.5.7.7.1"; +pub const szOID_CMC_IDENTIFICATION: &'static str = "1.3.6.1.5.5.7.7.2"; +pub const szOID_CMC_IDENTITY_PROOF: &'static str = "1.3.6.1.5.5.7.7.3"; +pub const szOID_CMC_DATA_RETURN: &'static str = "1.3.6.1.5.5.7.7.4"; +pub const szOID_CMC_TRANSACTION_ID: &'static str = "1.3.6.1.5.5.7.7.5"; +pub const szOID_CMC_SENDER_NONCE: &'static str = "1.3.6.1.5.5.7.7.6"; +pub const szOID_CMC_RECIPIENT_NONCE: &'static str = "1.3.6.1.5.5.7.7.7"; +pub const szOID_CMC_ADD_EXTENSIONS: &'static str = "1.3.6.1.5.5.7.7.8"; +pub const szOID_CMC_ENCRYPTED_POP: &'static str = "1.3.6.1.5.5.7.7.9"; +pub const szOID_CMC_DECRYPTED_POP: &'static str = "1.3.6.1.5.5.7.7.10"; +pub const szOID_CMC_LRA_POP_WITNESS: &'static str = "1.3.6.1.5.5.7.7.11"; +pub const szOID_CMC_GET_CERT: &'static str = "1.3.6.1.5.5.7.7.15"; +pub const szOID_CMC_GET_CRL: &'static str = "1.3.6.1.5.5.7.7.16"; +pub const szOID_CMC_REVOKE_REQUEST: &'static str = "1.3.6.1.5.5.7.7.17"; +pub const szOID_CMC_REG_INFO: &'static str = "1.3.6.1.5.5.7.7.18"; +pub const szOID_CMC_RESPONSE_INFO: &'static str = "1.3.6.1.5.5.7.7.19"; +pub const szOID_CMC_QUERY_PENDING: &'static str = "1.3.6.1.5.5.7.7.21"; +pub const szOID_CMC_ID_POP_LINK_RANDOM: &'static str = "1.3.6.1.5.5.7.7.22"; +pub const szOID_CMC_ID_POP_LINK_WITNESS: &'static str = "1.3.6.1.5.5.7.7.23"; +pub const szOID_CMC_ID_CONFIRM_CERT_ACCEPTANCE: &'static str = "1.3.6.1.5.5.7.7.24"; +pub const szOID_CMC_ADD_ATTRIBUTES: &'static str = "1.3.6.1.4.1.311.10.10.1"; +STRUCT!{struct CMC_TAGGED_ATTRIBUTE { + dwBodyPartID: DWORD, + Attribute: CRYPT_ATTRIBUTE, +}} +pub type PCMC_TAGGED_ATTRIBUTE = *mut CMC_TAGGED_ATTRIBUTE; +STRUCT!{struct CMC_TAGGED_CERT_REQUEST { + dwBodyPartID: DWORD, + SignedCertRequest: CRYPT_DER_BLOB, +}} +pub type PCMC_TAGGED_CERT_REQUEST = *mut CMC_TAGGED_CERT_REQUEST; +UNION!{union CMC_TAGGED_REQUEST_u { + [usize; 1], + pTaggedCertRequest pTaggedCertRequest_mut: PCMC_TAGGED_CERT_REQUEST, +}} +STRUCT!{struct CMC_TAGGED_REQUEST { + dwTaggedRequestChoice: DWORD, + u: CMC_TAGGED_REQUEST_u, +}} +pub type PCMC_TAGGED_REQUEST = *mut CMC_TAGGED_REQUEST; +STRUCT!{struct CMC_TAGGED_CONTENT_INFO { + dwBodyPartID: DWORD, + EncodedContentInfo: CRYPT_DER_BLOB, +}} +pub type PCMC_TAGGED_CONTENT_INFO = *mut CMC_TAGGED_CONTENT_INFO; +STRUCT!{struct CMC_TAGGED_OTHER_MSG { + dwBodyPartID: DWORD, + pszObjId: LPSTR, + Value: CRYPT_OBJID_BLOB, +}} +pub type PCMC_TAGGED_OTHER_MSG = *mut CMC_TAGGED_OTHER_MSG; +STRUCT!{struct CMC_DATA_INFO { + cTaggedAttribute: DWORD, + rgTaggedAttribute: PCMC_TAGGED_ATTRIBUTE, + cTaggedRequest: DWORD, + rgTaggedRequest: PCMC_TAGGED_REQUEST, + cTaggedContentInfo: DWORD, + rgTaggedContentInfo: PCMC_TAGGED_CONTENT_INFO, + cTaggedOtherMsg: DWORD, + rgTaggedOtherMsg: PCMC_TAGGED_OTHER_MSG, +}} +pub type PCMC_DATA_INFO = *mut CMC_DATA_INFO; +STRUCT!{struct CMC_RESPONSE_INFO { + cTaggedAttribute: DWORD, + rgTaggedAttribute: PCMC_TAGGED_ATTRIBUTE, + cTaggedContentInfo: DWORD, + rgTaggedContentInfo: PCMC_TAGGED_CONTENT_INFO, + cTaggedOtherMsg: DWORD, + rgTaggedOtherMsg: PCMC_TAGGED_OTHER_MSG, +}} +pub type PCMC_RESPONSE_INFO = *mut CMC_RESPONSE_INFO; +STRUCT!{struct CMC_PEND_INFO { + PendToken: CRYPT_DATA_BLOB, + PendTime: FILETIME, +}} +pub type PCMC_PEND_INFO = *mut CMC_PEND_INFO; +UNION!{union CMC_STATUS_INFO_u { + [usize; 1], + dwFailInfo dwFailInfo_mut: DWORD, + pPendInfo pPendInfo_mut: PCMC_PEND_INFO, +}} +STRUCT!{struct CMC_STATUS_INFO { + dwStatus: DWORD, + cBodyList: DWORD, + rgdwBodyList: *mut DWORD, + pwszStatusString: LPWSTR, + dwOtherInfoChoice: DWORD, + u: CMC_STATUS_INFO_u, +}} +pub type PCMC_STATUS_INFO = *mut CMC_STATUS_INFO; +pub const CMC_OTHER_INFO_NO_CHOICE: DWORD = 0; +pub const CMC_OTHER_INFO_FAIL_CHOICE: DWORD = 1; +pub const CMC_OTHER_INFO_PEND_CHOICE: DWORD = 2; +pub const CMC_STATUS_SUCCESS: DWORD = 0; +pub const CMC_STATUS_FAILED: DWORD = 2; +pub const CMC_STATUS_PENDING: DWORD = 3; +pub const CMC_STATUS_NO_SUPPORT: DWORD = 4; +pub const CMC_STATUS_CONFIRM_REQUIRED: DWORD = 5; +pub const CMC_FAIL_BAD_ALG: DWORD = 0; +pub const CMC_FAIL_BAD_MESSAGE_CHECK: DWORD = 1; +pub const CMC_FAIL_BAD_REQUEST: DWORD = 2; +pub const CMC_FAIL_BAD_TIME: DWORD = 3; +pub const CMC_FAIL_BAD_CERT_ID: DWORD = 4; +pub const CMC_FAIL_UNSUPORTED_EXT: DWORD = 5; +pub const CMC_FAIL_MUST_ARCHIVE_KEYS: DWORD = 6; +pub const CMC_FAIL_BAD_IDENTITY: DWORD = 7; +pub const CMC_FAIL_POP_REQUIRED: DWORD = 8; +pub const CMC_FAIL_POP_FAILED: DWORD = 9; +pub const CMC_FAIL_NO_KEY_REUSE: DWORD = 10; +pub const CMC_FAIL_INTERNAL_CA_ERROR: DWORD = 11; +pub const CMC_FAIL_TRY_LATER: DWORD = 12; +STRUCT!{struct CMC_ADD_EXTENSIONS_INFO { + dwCmcDataReference: DWORD, + cCertReference: DWORD, + rgdwCertReference: *mut DWORD, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type PCMC_ADD_EXTENSIONS_INFO = *mut CMC_ADD_EXTENSIONS_INFO; +STRUCT!{struct CMC_ADD_ATTRIBUTES_INFO { + dwCmcDataReference: DWORD, + cCertReference: DWORD, + rgdwCertReference: *mut DWORD, + cAttribute: DWORD, + rgAttribute: PCRYPT_ATTRIBUTE, +}} +pub type PCMC_ADD_ATTRIBUTES_INFO = *mut CMC_ADD_ATTRIBUTES_INFO; +STRUCT!{struct CERT_TEMPLATE_EXT { + pszObjId: LPSTR, + dwMajorVersion: DWORD, + fMinorVersion: BOOL, + dwMinorVersion: DWORD, +}} +pub type PCERT_TEMPLATE_EXT = *mut CERT_TEMPLATE_EXT; +STRUCT!{struct CERT_HASHED_URL { + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + Hash: CRYPT_HASH_BLOB, + pwszUrl: LPWSTR, +}} +pub type PCERT_HASHED_URL = *mut CERT_HASHED_URL; +STRUCT!{struct CERT_LOGOTYPE_DETAILS { + pwszMimeType: LPWSTR, + cHashedUrl: DWORD, + rgHashedUrl: PCERT_HASHED_URL, +}} +pub type PCERT_LOGOTYPE_DETAILS = *mut CERT_LOGOTYPE_DETAILS; +STRUCT!{struct CERT_LOGOTYPE_REFERENCE { + cHashedUrl: DWORD, + rgHashedUrl: PCERT_HASHED_URL, +}} +pub type PCERT_LOGOTYPE_REFERENCE = *mut CERT_LOGOTYPE_REFERENCE; +UNION!{union CERT_LOGOTYPE_IMAGE_INFO_u { + [u32; 1], + dwNumBits dwNumBits_mut: DWORD, + dwTableSize dwTableSize_mut: DWORD, +}} +STRUCT!{struct CERT_LOGOTYPE_IMAGE_INFO { + dwLogotypeImageInfoChoice: DWORD, + dwFileSize: DWORD, + dwXSize: DWORD, + dwYSize: DWORD, + dwLogotypeImageResolutionChoice: DWORD, + u: CERT_LOGOTYPE_IMAGE_INFO_u, + pwszLanguage: LPWSTR, +}} +pub type PCERT_LOGOTYPE_IMAGE_INFO = *mut CERT_LOGOTYPE_IMAGE_INFO; +pub const CERT_LOGOTYPE_GRAY_SCALE_IMAGE_INFO_CHOICE: DWORD = 1; +pub const CERT_LOGOTYPE_COLOR_IMAGE_INFO_CHOICE: DWORD = 2; +pub const CERT_LOGOTYPE_NO_IMAGE_RESOLUTION_CHOICE: DWORD = 0; +pub const CERT_LOGOTYPE_BITS_IMAGE_RESOLUTION_CHOICE: DWORD = 1; +pub const CERT_LOGOTYPE_TABLE_SIZE_IMAGE_RESOLUTION_CHOICE: DWORD = 2; +STRUCT!{struct CERT_LOGOTYPE_IMAGE { + LogotypeDetails: CERT_LOGOTYPE_DETAILS, + pLogotypeImageInfo: PCERT_LOGOTYPE_IMAGE_INFO, +}} +pub type PCERT_LOGOTYPE_IMAGE = *mut CERT_LOGOTYPE_IMAGE; +STRUCT!{struct CERT_LOGOTYPE_AUDIO_INFO { + dwFileSize: DWORD, + dwPlayTime: DWORD, + dwChannels: DWORD, + dwSampleRate: DWORD, + pwszLanguage: LPWSTR, +}} +pub type PCERT_LOGOTYPE_AUDIO_INFO = *mut CERT_LOGOTYPE_AUDIO_INFO; +STRUCT!{struct CERT_LOGOTYPE_AUDIO { + LogotypeDetails: CERT_LOGOTYPE_DETAILS, + pLogotypeAudioInfo: PCERT_LOGOTYPE_AUDIO_INFO, +}} +pub type PCERT_LOGOTYPE_AUDIO = *mut CERT_LOGOTYPE_AUDIO; +STRUCT!{struct CERT_LOGOTYPE_DATA { + cLogotypeImage: DWORD, + rgLogotypeImage: PCERT_LOGOTYPE_IMAGE, + cLogotypeAudio: DWORD, + rgLogotypeAudio: PCERT_LOGOTYPE_AUDIO, +}} +pub type PCERT_LOGOTYPE_DATA = *mut CERT_LOGOTYPE_DATA; +UNION!{union CERT_LOGOTYPE_INFO_u { + [usize; 1], + pLogotypeDirectInfo pLogotypeDirectInfo_mut: PCERT_LOGOTYPE_DATA, + pLogotypeIndirectInfo pLogotypeIndirectInfo__mut: PCERT_LOGOTYPE_REFERENCE, +}} +STRUCT!{struct CERT_LOGOTYPE_INFO { + dwLogotypeInfoChoice: DWORD, + u: CERT_LOGOTYPE_INFO_u, +}} +pub type PCERT_LOGOTYPE_INFO = *mut CERT_LOGOTYPE_INFO; +pub const CERT_LOGOTYPE_DIRECT_INFO_CHOICE: DWORD = 1; +pub const CERT_LOGOTYPE_INDIRECT_INFO_CHOICE: DWORD = 2; +STRUCT!{struct CERT_OTHER_LOGOTYPE_INFO { + pszObjId: LPSTR, + LogotypeInfo: CERT_LOGOTYPE_INFO, +}} +pub type PCERT_OTHER_LOGOTYPE_INFO = *mut CERT_OTHER_LOGOTYPE_INFO; +pub const szOID_LOYALTY_OTHER_LOGOTYPE: &'static str = "1.3.6.1.5.5.7.20.1"; +pub const szOID_BACKGROUND_OTHER_LOGOTYPE: &'static str = "1.3.6.1.5.5.7.20.2"; +STRUCT!{struct CERT_LOGOTYPE_EXT_INFO { + cCommunityLogo: DWORD, + rgCommunityLogo: PCERT_LOGOTYPE_INFO, + pIssuerLogo: PCERT_LOGOTYPE_INFO, + pSubjectLogo: PCERT_LOGOTYPE_INFO, + cOtherLogo: DWORD, + rgOtherLogo: PCERT_OTHER_LOGOTYPE_INFO, +}} +pub type PCERT_LOGOTYPE_EXT_INFO = *mut CERT_LOGOTYPE_EXT_INFO; +UNION!{union CERT_BIOMETRIC_DATA_u { + [usize; 1], + dwPredefined dwPredefined_mut: DWORD, + pszObjId pszObjId_mut: LPSTR, +}} +STRUCT!{struct CERT_BIOMETRIC_DATA { + dwTypeOfBiometricDataChoice: DWORD, + u: CERT_BIOMETRIC_DATA_u, + HashedUrl: CERT_HASHED_URL, +}} +pub type PCERT_BIOMETRIC_DATA = *mut CERT_BIOMETRIC_DATA; +pub const CERT_BIOMETRIC_PREDEFINED_DATA_CHOICE: DWORD = 1; +pub const CERT_BIOMETRIC_OID_DATA_CHOICE: DWORD = 2; +pub const CERT_BIOMETRIC_PICTURE_TYPE: DWORD = 0; +pub const CERT_BIOMETRIC_SIGNATURE_TYPE: DWORD = 1; +STRUCT!{struct CERT_BIOMETRIC_EXT_INFO { + cBiometricData: DWORD, + rgBiometricData: PCERT_BIOMETRIC_DATA, +}} +pub type PCERT_BIOMETRIC_EXT_INFO = *mut CERT_BIOMETRIC_EXT_INFO; +STRUCT!{struct OCSP_SIGNATURE_INFO { + SignatureAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + Signature: CRYPT_BIT_BLOB, + cCertEncoded: DWORD, + rgCertEncoded: PCERT_BLOB, +}} +pub type POCSP_SIGNATURE_INFO = *mut OCSP_SIGNATURE_INFO; +STRUCT!{struct OCSP_SIGNED_REQUEST_INFO { + ToBeSigned: CRYPT_DER_BLOB, + pOptionalSignatureInfo: POCSP_SIGNATURE_INFO, +}} +pub type POCSP_SIGNED_REQUEST_INFO = *mut OCSP_SIGNED_REQUEST_INFO; +STRUCT!{struct OCSP_CERT_ID { + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + IssuerNameHash: CRYPT_HASH_BLOB, + IssuerKeyHash: CRYPT_HASH_BLOB, + SerialNumber: CRYPT_INTEGER_BLOB, +}} +pub type POCSP_CERT_ID = *mut OCSP_CERT_ID; +STRUCT!{struct OCSP_REQUEST_ENTRY { + CertId: OCSP_CERT_ID, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type POCSP_REQUEST_ENTRY = *mut OCSP_REQUEST_ENTRY; +STRUCT!{struct OCSP_REQUEST_INFO { + dwVersion: DWORD, + pRequestorName: PCERT_ALT_NAME_ENTRY, + cRequestEntry: DWORD, + rgRequestEntry: POCSP_REQUEST_ENTRY, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type POCSP_REQUEST_INFO = *mut OCSP_REQUEST_INFO; +pub const OCSP_REQUEST_V1: DWORD = 0; +STRUCT!{struct OCSP_RESPONSE_INFO { + dwStatus: DWORD, + pszObjId: LPSTR, + Value: CRYPT_OBJID_BLOB, +}} +pub type POCSP_RESPONSE_INFO = *mut OCSP_RESPONSE_INFO; +pub const OCSP_SUCCESSFUL_RESPONSE: DWORD = 0; +pub const OCSP_MALFORMED_REQUEST_RESPONSE: DWORD = 1; +pub const OCSP_INTERNAL_ERROR_RESPONSE: DWORD = 2; +pub const OCSP_TRY_LATER_RESPONSE: DWORD = 3; +pub const OCSP_SIG_REQUIRED_RESPONSE: DWORD = 5; +pub const OCSP_UNAUTHORIZED_RESPONSE: DWORD = 6; +pub const szOID_PKIX_OCSP_BASIC_SIGNED_RESPONSE: &'static str = "1.3.6.1.5.5.7.48.1.1"; +STRUCT!{struct OCSP_BASIC_SIGNED_RESPONSE_INFO { + ToBeSigned: CRYPT_DER_BLOB, + SignatureInfo: OCSP_SIGNATURE_INFO, +}} +pub type POCSP_BASIC_SIGNED_RESPONSE_INFO = *mut OCSP_BASIC_SIGNED_RESPONSE_INFO; +STRUCT!{struct OCSP_BASIC_REVOKED_INFO { + RevocationDate: FILETIME, + dwCrlReasonCode: DWORD, +}} +pub type POCSP_BASIC_REVOKED_INFO = *mut OCSP_BASIC_REVOKED_INFO; +UNION!{union OCSP_BASIC_RESPONSE_ENTRY_u { + [usize; 1], + pRevokedInfo pRevokedInfo_mut: POCSP_BASIC_REVOKED_INFO, +}} +STRUCT!{struct OCSP_BASIC_RESPONSE_ENTRY { + CertId: OCSP_CERT_ID, + dwCertStatus: DWORD, + u: OCSP_BASIC_RESPONSE_ENTRY_u, + ThisUpdate: FILETIME, + NextUpdate: FILETIME, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type POCSP_BASIC_RESPONSE_ENTRY = *mut OCSP_BASIC_RESPONSE_ENTRY; +pub const OCSP_BASIC_GOOD_CERT_STATUS: DWORD = 0; +pub const OCSP_BASIC_REVOKED_CERT_STATUS: DWORD = 1; +pub const OCSP_BASIC_UNKNOWN_CERT_STATUS: DWORD = 2; +UNION!{union OCSP_BASIC_RESPONSE_INFO_u { + [usize; 2], + ByNameResponderId ByNameResponderId_mut: CERT_NAME_BLOB, + ByKeyResponderId ByKeyResponderId_mut: CRYPT_HASH_BLOB, +}} +STRUCT!{struct OCSP_BASIC_RESPONSE_INFO { + dwVersion: DWORD, + dwResponderIdChoice: DWORD, + u: OCSP_BASIC_RESPONSE_INFO_u, + ProducedAt: FILETIME, + cResponseEntry: DWORD, + rgResponseEntry: POCSP_BASIC_RESPONSE_ENTRY, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type POCSP_BASIC_RESPONSE_INFO = *mut OCSP_BASIC_RESPONSE_INFO; +pub const OCSP_BASIC_RESPONSE_V1: DWORD = 0; +pub const OCSP_BASIC_BY_NAME_RESPONDER_ID: DWORD = 1; +pub const OCSP_BASIC_BY_KEY_RESPONDER_ID: DWORD = 2; +STRUCT!{struct CERT_SUPPORTED_ALGORITHM_INFO { + Algorithm: CRYPT_ALGORITHM_IDENTIFIER, + IntendedKeyUsage: CRYPT_BIT_BLOB, + IntendedCertPolicies: CERT_POLICIES_INFO, +}} +pub type PCERT_SUPPORTED_ALGORITHM_INFO = *mut CERT_SUPPORTED_ALGORITHM_INFO; +STRUCT!{struct CERT_TPM_SPECIFICATION_INFO { + pwszFamily: LPWSTR, + dwLevel: DWORD, + dwRevision: DWORD, +}} +pub type PCERT_TPM_SPECIFICATION_INFO = *mut CERT_TPM_SPECIFICATION_INFO; +pub type HCRYPTOIDFUNCSET = *mut c_void; +pub type HCRYPTOIDFUNCADDR = *mut c_void; +pub const CRYPT_OID_ENCODE_OBJECT_FUNC: &'static str = "CryptDllEncodeObject"; +pub const CRYPT_OID_DECODE_OBJECT_FUNC: &'static str = "CryptDllDecodeObject"; +pub const CRYPT_OID_ENCODE_OBJECT_EX_FUNC: &'static str = "CryptDllEncodeObjectEx"; +pub const CRYPT_OID_DECODE_OBJECT_EX_FUNC: &'static str = "CryptDllDecodeObjectEx"; +pub const CRYPT_OID_CREATE_COM_OBJECT_FUNC: &'static str = "CryptDllCreateCOMObject"; +pub const CRYPT_OID_VERIFY_REVOCATION_FUNC: &'static str = "CertDllVerifyRevocation"; +pub const CRYPT_OID_VERIFY_CTL_USAGE_FUNC: &'static str = "CertDllVerifyCTLUsage"; +pub const CRYPT_OID_FORMAT_OBJECT_FUNC: &'static str = "CryptDllFormatObject"; +pub const CRYPT_OID_FIND_OID_INFO_FUNC: &'static str = "CryptDllFindOIDInfo"; +pub const CRYPT_OID_FIND_LOCALIZED_NAME_FUNC: &'static str = "CryptDllFindLocalizedName"; +pub const CRYPT_OID_REGPATH: &'static str = "Software\\Microsoft\\Cryptography\\OID"; +pub const CRYPT_OID_REG_ENCODING_TYPE_PREFIX: &'static str = "EncodingType "; +pub const CRYPT_OID_REG_DLL_VALUE_NAME: &'static str = "Dll"; +pub const CRYPT_OID_REG_FUNC_NAME_VALUE_NAME: &'static str = "FuncName"; +pub const CRYPT_OID_REG_FLAGS_VALUE_NAME: &'static str = "CryptFlags"; +pub const CRYPT_DEFAULT_OID: &'static str = "DEFAULT"; +STRUCT!{struct CRYPT_OID_FUNC_ENTRY { + pszOID: LPCSTR, + pvFuncAddr: *mut c_void, +}} +pub type PCRYPT_OID_FUNC_ENTRY = *mut CRYPT_OID_FUNC_ENTRY; +pub const CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG: DWORD = 1; +extern "system" { + pub fn CryptInstallOIDFunctionAddress( + hModule: HMODULE, + dwEncodingType: DWORD, + pszFuncName: LPCSTR, + cFuncEntry: DWORD, + rgFuncEntry: *const CRYPT_OID_FUNC_ENTRY, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptInitOIDFunctionSet( + pszFuncName: LPCSTR, + dwFlags: DWORD, + ) -> HCRYPTOIDFUNCSET; + pub fn CryptGetOIDFunctionAddress( + hFuncSet: HCRYPTOIDFUNCSET, + dwEncodingType: DWORD, + pszOID: LPCSTR, + dwFlags: DWORD, + ppvFuncAddr: *mut *mut c_void, + phFuncAddr: *mut HCRYPTOIDFUNCADDR, + ) -> BOOL; +} +pub const CRYPT_GET_INSTALLED_OID_FUNC_FLAG: DWORD = 0x1; +extern "system" { + pub fn CryptGetDefaultOIDDllList( + hFuncSet: HCRYPTOIDFUNCSET, + dwEncodingType: DWORD, + pwszDllList: *mut WCHAR, + pcchDllList: *mut DWORD, + ) -> BOOL; + pub fn CryptGetDefaultOIDFunctionAddress( + hFuncSet: HCRYPTOIDFUNCSET, + dwEncodingType: DWORD, + pwszDll: LPCWSTR, + dwFlags: DWORD, + ppvFuncAddr: *mut *mut c_void, + phFuncAddr: *mut HCRYPTOIDFUNCADDR, + ) -> BOOL; + pub fn CryptFreeOIDFunctionAddress( + hFuncAddr: HCRYPTOIDFUNCADDR, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptRegisterOIDFunction( + dwEncodingType: DWORD, + pszFuncName: LPCSTR, + pszOID: LPCSTR, + pwszDll: LPCWSTR, + pszOverrideFuncName: LPCSTR, + ) -> BOOL; + pub fn CryptUnregisterOIDFunction( + dwEncodingType: DWORD, + pszFuncName: LPCSTR, + pszOID: LPCSTR, + ) -> BOOL; + pub fn CryptRegisterDefaultOIDFunction( + dwEncodingType: DWORD, + pszFuncName: LPCSTR, + dwIndex: DWORD, + pwszDll: LPCWSTR, + ) -> BOOL; +} +pub const CRYPT_REGISTER_FIRST_INDEX: DWORD = 0; +pub const CRYPT_REGISTER_LAST_INDEX: DWORD = 0xFFFFFFFF; +extern "system" { + pub fn CryptUnregisterDefaultOIDFunction( + dwEncodingType: DWORD, + pszFuncName: LPCSTR, + pwszDll: LPCWSTR, + ) -> BOOL; + pub fn CryptSetOIDFunctionValue( + dwEncodingType: DWORD, + pszFuncName: LPCSTR, + pszOID: LPCSTR, + pwszValueName: LPCWSTR, + dwValueType: DWORD, + pbValueData: *const BYTE, + cbValueData: DWORD, + ) -> BOOL; + pub fn CryptGetOIDFunctionValue( + dwEncodingType: DWORD, + pszFuncName: LPCSTR, + pszOID: LPCSTR, + pwszValueName: LPCWSTR, + pdwValueType: *mut DWORD, + pbValueData: *mut BYTE, + pcbValueData: *mut DWORD, + ) -> BOOL; +} +FN!{stdcall PFN_CRYPT_ENUM_OID_FUNC( + dwEncodingType: DWORD, + pszFuncName: LPCSTR, + pszOID: LPCSTR, + cValue: DWORD, + rgdwValueType: *const DWORD, + rgpwszValueName: *const LPCWSTR, + rgpbValueData: *const *const BYTE, + rgcbValueData: *const DWORD, + pvArg: *mut c_void, +) -> BOOL} +extern "system" { + pub fn CryptEnumOIDFunction( + dwEncodingType: DWORD, + pszFuncName: LPCSTR, + pszOID: LPCSTR, + dwFlags: DWORD, + pvArg: *mut c_void, + pfnEnumOIDFunc: PFN_CRYPT_ENUM_OID_FUNC, + ) -> BOOL; +} +pub const CRYPT_MATCH_ANY_ENCODING_TYPE: DWORD = 0xFFFFFFFF; +pub const CALG_OID_INFO_CNG_ONLY: ALG_ID = 0xFFFFFFFF; +pub const CALG_OID_INFO_PARAMETERS: ALG_ID = 0xFFFFFFFE; +#[inline] +pub fn IS_SPECIAL_OID_INFO_ALGID(Algid: ALG_ID) -> bool { + Algid >= CALG_OID_INFO_PARAMETERS +} +pub const CRYPT_OID_INFO_HASH_PARAMETERS_ALGORITHM: &'static str = "CryptOIDInfoHashParameters"; +pub const CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM: &'static str = "CryptOIDInfoECCParameters"; +pub const CRYPT_OID_INFO_MGF1_PARAMETERS_ALGORITHM: &'static str = "CryptOIDInfoMgf1Parameters"; +pub const CRYPT_OID_INFO_NO_SIGN_ALGORITHM: &'static str = "CryptOIDInfoNoSign"; +pub const CRYPT_OID_INFO_OAEP_PARAMETERS_ALGORITHM: &'static str = "CryptOIDInfoOAEPParameters"; +pub const CRYPT_OID_INFO_ECC_WRAP_PARAMETERS_ALGORITHM: &'static str + = "CryptOIDInfoECCWrapParameters"; +pub const CRYPT_OID_INFO_NO_PARAMETERS_ALGORITHM: &'static str = "CryptOIDInfoNoParameters"; +UNION!{union CRYPT_OID_INFO_u { + [u32; 1], + dwValue dwValue_mut: DWORD, + Algid Algid_mut: ALG_ID, + dwLength dwLength_mut: DWORD, +}} +STRUCT!{struct CRYPT_OID_INFO { + cbSize: DWORD, + oszOID: LPCSTR, + pwszName: LPCWSTR, + dwGroupId: DWORD, + u: CRYPT_OID_INFO_u, + ExtraInfo: CRYPT_DATA_BLOB, + pwszCNGAlgid: LPCWSTR, + pwszCNGExtraAlgid: LPCWSTR, +}} +pub type PCRYPT_OID_INFO = *mut CRYPT_OID_INFO; +pub type PCCRYPT_OID_INFO = *const CRYPT_OID_INFO; +pub const CRYPT_HASH_ALG_OID_GROUP_ID: DWORD = 1; +pub const CRYPT_ENCRYPT_ALG_OID_GROUP_ID: DWORD = 2; +pub const CRYPT_PUBKEY_ALG_OID_GROUP_ID: DWORD = 3; +pub const CRYPT_SIGN_ALG_OID_GROUP_ID: DWORD = 4; +pub const CRYPT_RDN_ATTR_OID_GROUP_ID: DWORD = 5; +pub const CRYPT_EXT_OR_ATTR_OID_GROUP_ID: DWORD = 6; +pub const CRYPT_ENHKEY_USAGE_OID_GROUP_ID: DWORD = 7; +pub const CRYPT_POLICY_OID_GROUP_ID: DWORD = 8; +pub const CRYPT_TEMPLATE_OID_GROUP_ID: DWORD = 9; +pub const CRYPT_KDF_OID_GROUP_ID: DWORD = 10; +pub const CRYPT_LAST_OID_GROUP_ID: DWORD = 10; +pub const CRYPT_FIRST_ALG_OID_GROUP_ID: DWORD = CRYPT_HASH_ALG_OID_GROUP_ID; +pub const CRYPT_LAST_ALG_OID_GROUP_ID: DWORD = CRYPT_SIGN_ALG_OID_GROUP_ID; +pub const CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG: DWORD = 0x00000001; +pub const CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG: DWORD = 0x00000002; +pub const CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG: DWORD = 0x00000004; +pub const CRYPT_OID_PUBKEY_SIGN_ONLY_FLAG: DWORD = 0x80000000; +pub const CRYPT_OID_PUBKEY_ENCRYPT_ONLY_FLAG: DWORD = 0x40000000; +pub const CRYPT_OID_USE_CURVE_NAME_FOR_ENCODE_FLAG: DWORD = 0x20000000; +pub const CRYPT_OID_USE_CURVE_PARAMETERS_FOR_ENCODE_FLAG: DWORD = 0x10000000; +extern "system" { + pub fn CryptFindOIDInfo( + dwKeyType: DWORD, + pvKey: *mut c_void, + dwGroupId: DWORD, + ) -> PCCRYPT_OID_INFO; +} +pub const CRYPT_OID_INFO_OID_KEY: DWORD = 1; +pub const CRYPT_OID_INFO_NAME_KEY: DWORD = 2; +pub const CRYPT_OID_INFO_ALGID_KEY: DWORD = 3; +pub const CRYPT_OID_INFO_SIGN_KEY: DWORD = 4; +pub const CRYPT_OID_INFO_CNG_ALGID_KEY: DWORD = 5; +pub const CRYPT_OID_INFO_CNG_SIGN_KEY: DWORD = 6; +pub const CRYPT_OID_INFO_OID_KEY_FLAGS_MASK: DWORD = 0xFFFF0000; +pub const CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG: DWORD = 0x80000000; +pub const CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG: DWORD = 0x40000000; +pub const CRYPT_OID_DISABLE_SEARCH_DS_FLAG: DWORD = 0x80000000; +pub const CRYPT_OID_PREFER_CNG_ALGID_FLAG: DWORD = 0x40000000; +pub const CRYPT_OID_INFO_OID_GROUP_BIT_LEN_MASK: DWORD = 0x0FFF0000; +pub const CRYPT_OID_INFO_OID_GROUP_BIT_LEN_SHIFT: DWORD = 16; +extern "system" { + pub fn CryptRegisterOIDInfo( + pInfo: PCCRYPT_OID_INFO, + dwFlags: DWORD, + ) -> BOOL; + pub fn CryptUnregisterOIDInfo( + pInfo: PCCRYPT_OID_INFO, + ) -> BOOL; +} +FN!{stdcall PFN_CRYPT_ENUM_OID_INFO( + pInfo: PCCRYPT_OID_INFO, + pvArg: *mut c_void, +) -> BOOL} +extern "system" { + pub fn CryptEnumOIDInfo( + dwGroupId: DWORD, + dwFlags: DWORD, + pvArg: *mut c_void, + pfnEnumOIDInfo: PFN_CRYPT_ENUM_OID_INFO, + ) -> BOOL; + pub fn CryptFindLocalizedName( + pwszCryptName: LPCWSTR, + ) -> LPCWSTR; +} +pub const CRYPT_LOCALIZED_NAME_ENCODING_TYPE: DWORD = 0; +pub const CRYPT_LOCALIZED_NAME_OID: &'static str = "LocalizedNames"; +STRUCT!{struct CERT_STRONG_SIGN_SERIALIZED_INFO { + dwFlags: DWORD, + pwszCNGSignHashAlgids: LPWSTR, + pwszCNGPubKeyMinBitLengths: LPWSTR, +}} +pub type PCERT_STRONG_SIGN_SERIALIZED_INFO = *mut CERT_STRONG_SIGN_SERIALIZED_INFO; +pub const CERT_STRONG_SIGN_ECDSA_ALGORITHM: &'static str = "ECDSA"; +UNION!{union CERT_STRONG_SIGN_PARA_u { + [usize; 1], + pvInfo pvInfo_mut: *mut c_void, + pSerializedInfo pSerializedInfo_mut: PCERT_STRONG_SIGN_SERIALIZED_INFO, + pszOID pszOID_mut: LPSTR, +}} +STRUCT!{struct CERT_STRONG_SIGN_PARA { + cbSize: DWORD, + dwInfoChoice: DWORD, + u: CERT_STRONG_SIGN_PARA_u, +}} +pub type PCERT_STRONG_SIGN_PARA = *mut CERT_STRONG_SIGN_PARA; +pub type PCCERT_STRONG_SIGN_PARA = *const CERT_STRONG_SIGN_PARA; +pub const CERT_STRONG_SIGN_SERIALIZED_INFO_CHOICE: DWORD = 1; +pub const CERT_STRONG_SIGN_OID_INFO_CHOICE: DWORD = 2; +pub const CERT_STRONG_SIGN_ENABLE_CRL_CHECK: DWORD = 0x1; +pub const CERT_STRONG_SIGN_ENABLE_OCSP_CHECK: DWORD = 0x2; +pub const szOID_CERT_STRONG_SIGN_OS_PREFIX: &'static str = "1.3.6.1.4.1.311.72.1."; +pub const szOID_CERT_STRONG_SIGN_OS_1: &'static str = "1.3.6.1.4.1.311.72.1.1"; +pub const szOID_CERT_STRONG_SIGN_OS_CURRENT: &'static str = szOID_CERT_STRONG_SIGN_OS_1; +pub const szOID_CERT_STRONG_KEY_OS_PREFIX: &'static str = "1.3.6.1.4.1.311.72.2."; +pub const szOID_CERT_STRONG_KEY_OS_1: &'static str = "1.3.6.1.4.1.311.72.2.1"; +pub const szOID_CERT_STRONG_KEY_OS_CURRENT: &'static str = szOID_CERT_STRONG_KEY_OS_1; +pub type HCRYPTMSG = *mut c_void; +pub const szOID_PKCS_7_DATA: &'static str = "1.2.840.113549.1.7.1"; +pub const szOID_PKCS_7_SIGNED: &'static str = "1.2.840.113549.1.7.2"; +pub const szOID_PKCS_7_ENVELOPED: &'static str = "1.2.840.113549.1.7.3"; +pub const szOID_PKCS_7_SIGNEDANDENVELOPED: &'static str = "1.2.840.113549.1.7.4"; +pub const szOID_PKCS_7_DIGESTED: &'static str = "1.2.840.113549.1.7.5"; +pub const szOID_PKCS_7_ENCRYPTED: &'static str = "1.2.840.113549.1.7.6"; +pub const szOID_PKCS_9_CONTENT_TYPE: &'static str = "1.2.840.113549.1.9.3"; +pub const szOID_PKCS_9_MESSAGE_DIGEST: &'static str = "1.2.840.113549.1.9.4"; +pub const CMSG_DATA: DWORD = 1; +pub const CMSG_SIGNED: DWORD = 2; +pub const CMSG_ENVELOPED: DWORD = 3; +pub const CMSG_SIGNED_AND_ENVELOPED: DWORD = 4; +pub const CMSG_HASHED: DWORD = 5; +pub const CMSG_ENCRYPTED: DWORD = 6; +pub const CMSG_ALL_FLAGS: DWORD = !0; +pub const CMSG_DATA_FLAG: DWORD = 1 << CMSG_DATA; +pub const CMSG_SIGNED_FLAG: DWORD = 1 << CMSG_SIGNED; +pub const CMSG_ENVELOPED_FLAG: DWORD = 1 << CMSG_ENVELOPED; +pub const CMSG_SIGNED_AND_ENVELOPED_FLAG: DWORD = 1 << CMSG_SIGNED_AND_ENVELOPED; +pub const CMSG_HASHED_FLAG: DWORD = 1 << CMSG_HASHED; +pub const CMSG_ENCRYPTED_FLAG: DWORD = 1 << CMSG_ENCRYPTED; +STRUCT!{struct CERT_ISSUER_SERIAL_NUMBER { + Issuer: CERT_NAME_BLOB, + SerialNumber: CRYPT_INTEGER_BLOB, +}} +pub type PCERT_ISSUER_SERIAL_NUMBER = *mut CERT_ISSUER_SERIAL_NUMBER; +UNION!{union CERT_ID_u { + [usize; 4], + IssuerSerialNumber IssuerSerialNumber_mut: CERT_ISSUER_SERIAL_NUMBER, + KeyId KeyId_mut: CRYPT_HASH_BLOB, + HashId HashId_mut: CRYPT_HASH_BLOB, +}} +STRUCT!{struct CERT_ID { + dwIdChoice: DWORD, + u: CERT_ID_u, +}} +pub type PCERT_ID = *mut CERT_ID; +pub const CERT_ID_ISSUER_SERIAL_NUMBER: DWORD = 1; +pub const CERT_ID_KEY_IDENTIFIER: DWORD = 2; +pub const CERT_ID_SHA1_HASH: DWORD = 3; +UNION!{union CMSG_SIGNER_ENCODE_INFO_u { + [usize; 1], + hCryptProv hCryptProv_mut: HCRYPTPROV, + hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, + hBCryptKey hBCryptKey_mut: BCRYPT_KEY_HANDLE, +}} +STRUCT!{struct CMSG_SIGNER_ENCODE_INFO { + cbSize: DWORD, + pCertInfo: PCERT_INFO, + u: CMSG_SIGNER_ENCODE_INFO_u, + dwKeySpec: DWORD, + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvHashAuxInfo: *mut c_void, + cAuthAttr: DWORD, + rgAuthAttr: PCRYPT_ATTRIBUTE, + cUnauthAttr: DWORD, + rgUnauthAttr: PCRYPT_ATTRIBUTE, + SignerId: CERT_ID, + HashEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvHashEncryptionAuxInfo: *mut c_void, +}} +pub type PCMSG_SIGNER_ENCODE_INFO = *mut CMSG_SIGNER_ENCODE_INFO; +STRUCT!{struct CMSG_SIGNED_ENCODE_INFO { + cbSize: DWORD, + cSigners: DWORD, + rgSigners: PCMSG_SIGNER_ENCODE_INFO, + cCertEncoded: DWORD, + rgCertEncoded: PCERT_BLOB, + cCrlEncoded: DWORD, + rgCrlEncoded: PCRL_BLOB, + cAttrCertEncoded: DWORD, + rgAttrCertEncoded: PCERT_BLOB, +}} +pub type PCMSG_SIGNED_ENCODE_INFO = *mut CMSG_SIGNED_ENCODE_INFO; +pub type PCMSG_RECIPIENT_ENCODE_INFO = *mut CMSG_RECIPIENT_ENCODE_INFO; +STRUCT!{struct CMSG_ENVELOPED_ENCODE_INFO { + cbSize: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + ContentEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvEncryptionAuxInfo: *mut c_void, + cRecipients: DWORD, + rgpRecipients: *mut PCERT_INFO, + rgCmsRecipients: PCMSG_RECIPIENT_ENCODE_INFO, + cCertEncoded: DWORD, + rgCertEncoded: PCERT_BLOB, + cCrlEncoded: DWORD, + rgCrlEncoded: PCRL_BLOB, + cAttrCertEncoded: DWORD, + rgAttrCertEncoded: PCERT_BLOB, + cUnprotectedAttr: DWORD, + rgUnprotectedAttr: PCRYPT_ATTRIBUTE, +}} +pub type PCMSG_ENVELOPED_ENCODE_INFO = *mut CMSG_ENVELOPED_ENCODE_INFO; +STRUCT!{struct CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO { + cbSize: DWORD, + KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvKeyEncryptionAuxInfo: *mut c_void, + hCryptProv: HCRYPTPROV_LEGACY, + RecipientPublicKey: CRYPT_BIT_BLOB, + RecipientId: CERT_ID, +}} +pub type PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO = *mut CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO; +STRUCT!{struct CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO { + cbSize: DWORD, + RecipientPublicKey: CRYPT_BIT_BLOB, + RecipientId: CERT_ID, + Date: FILETIME, + pOtherAttr: PCRYPT_ATTRIBUTE_TYPE_VALUE, +}} +pub type PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO = *mut CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO; +UNION!{union CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO_u { + [usize; 1], + pEphemeralAlgorithm pEphemeralAlgorithm_mut: PCRYPT_ALGORITHM_IDENTIFIER, + pSenderId pSenderId_mut: PCERT_ID, +}} +STRUCT!{struct CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO { + cbSize: DWORD, + KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvKeyEncryptionAuxInfo: *mut c_void, + KeyWrapAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvKeyWrapAuxInfo: *mut c_void, + hCryptProv: HCRYPTPROV_LEGACY, + dwKeySpec: DWORD, + dwKeyChoice: DWORD, + u: CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO_u, + UserKeyingMaterial: CRYPT_DATA_BLOB, + cRecipientEncryptedKeys: DWORD, + rgpRecipientEncryptedKeys: *mut PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO, +}} +pub type PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO = *mut CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO; +pub const CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE: DWORD = 1; +pub const CMSG_KEY_AGREE_STATIC_KEY_CHOICE: DWORD = 2; +UNION!{union CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO_u { + [usize; 1], + hKeyEncryptionKey hKeyEncryptionKey_mut: HCRYPTKEY, + pvKeyEncryptionKey pvKeyEncryptionKey_mut: *mut c_void, +}} +STRUCT!{struct CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO { + cbSize: DWORD, + KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvKeyEncryptionAuxInfo: *mut c_void, + hCryptProv: HCRYPTPROV, + dwKeyChoice: DWORD, + u: CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO_u, + KeyId: CRYPT_DATA_BLOB, + Date: FILETIME, + pOtherAttr: PCRYPT_ATTRIBUTE_TYPE_VALUE, +}} +pub type PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO = *mut CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO; +pub const CMSG_MAIL_LIST_HANDLE_KEY_CHOICE: DWORD = 1; +UNION!{union CMSG_RECIPIENT_ENCODE_INFO_u { + [usize; 1], + pKeyTrans pKeyTrans_mut: PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO, + pKeyAgree pKeyAgree_mut: PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO, + pMailList pMailList_mut: PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO, +}} +STRUCT!{struct CMSG_RECIPIENT_ENCODE_INFO { + dwRecipientChoice: DWORD, + u: CMSG_RECIPIENT_ENCODE_INFO_u, +}} +pub const CMSG_KEY_TRANS_RECIPIENT: DWORD = 1; +pub const CMSG_KEY_AGREE_RECIPIENT: DWORD = 2; +pub const CMSG_MAIL_LIST_RECIPIENT: DWORD = 3; +STRUCT!{struct CMSG_RC2_AUX_INFO { + cbSize: DWORD, + dwBitLen: DWORD, +}} +pub type PCMSG_RC2_AUX_INFO = *mut CMSG_RC2_AUX_INFO; +STRUCT!{struct CMSG_SP3_COMPATIBLE_AUX_INFO { + cbSize: DWORD, + dwFlags: DWORD, +}} +pub type PCMSG_SP3_COMPATIBLE_AUX_INFO = *mut CMSG_SP3_COMPATIBLE_AUX_INFO; +pub const CMSG_SP3_COMPATIBLE_ENCRYPT_FLAG: DWORD = 0x80000000; +STRUCT!{struct CMSG_RC4_AUX_INFO { + cbSize: DWORD, + dwBitLen: DWORD, +}} +pub type PCMSG_RC4_AUX_INFO = *mut CMSG_RC4_AUX_INFO; +pub const CMSG_RC4_NO_SALT_FLAG: DWORD = 0x40000000; +STRUCT!{struct CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO { + cbSize: DWORD, + SignedInfo: CMSG_SIGNED_ENCODE_INFO, + EnvelopedInfo: CMSG_ENVELOPED_ENCODE_INFO, +}} +pub type PCMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO = *mut CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO; +STRUCT!{struct CMSG_HASHED_ENCODE_INFO { + cbSize: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvHashAuxInfo: *mut c_void, +}} +pub type PCMSG_HASHED_ENCODE_INFO = *mut CMSG_HASHED_ENCODE_INFO; +STRUCT!{struct CMSG_ENCRYPTED_ENCODE_INFO { + cbSize: DWORD, + ContentEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvEncryptionAuxInfo: *mut c_void, +}} +pub type PCMSG_ENCRYPTED_ENCODE_INFO = *mut CMSG_ENCRYPTED_ENCODE_INFO; +FN!{stdcall PFN_CMSG_STREAM_OUTPUT( + pvArg: *const c_void, + pbData: *mut BYTE, + cbData: DWORD, + fFinal: BOOL, +) -> BOOL} +pub const CMSG_INDEFINITE_LENGTH: DWORD = 0xFFFFFFFF; +STRUCT!{struct CMSG_STREAM_INFO { + cbContent: DWORD, + pfnStreamOutput: PFN_CMSG_STREAM_OUTPUT, + pvArg: *mut c_void, +}} +pub type PCMSG_STREAM_INFO = *mut CMSG_STREAM_INFO; +pub const CMSG_BARE_CONTENT_FLAG: DWORD = 0x00000001; +pub const CMSG_LENGTH_ONLY_FLAG: DWORD = 0x00000002; +pub const CMSG_DETACHED_FLAG: DWORD = 0x00000004; +pub const CMSG_AUTHENTICATED_ATTRIBUTES_FLAG: DWORD = 0x00000008; +pub const CMSG_CONTENTS_OCTETS_FLAG: DWORD = 0x00000010; +pub const CMSG_MAX_LENGTH_FLAG: DWORD = 0x00000020; +pub const CMSG_CMS_ENCAPSULATED_CONTENT_FLAG: DWORD = 0x00000040; +pub const CMSG_SIGNED_DATA_NO_SIGN_FLAG: DWORD = 0x00000080; +pub const CMSG_CRYPT_RELEASE_CONTEXT_FLAG: DWORD = 0x00008000; +extern "system" { + pub fn CryptMsgOpenToEncode( + dwMsgEncodingType: DWORD, + dwFlags: DWORD, + dwMsgType: DWORD, + pvMsgEncodeInfo: *mut c_void, + pszInnerContentObjID: LPSTR, + pStreamInfo: PCMSG_STREAM_INFO, + ) -> HCRYPTMSG; + pub fn CryptMsgCalculateEncodedLength( + dwMsgEncodingType: DWORD, + dwFlags: DWORD, + dwMsgType: DWORD, + pvMsgEncodeInfo: *const c_void, + pszInnerContentObjID: LPSTR, + cbData: DWORD, + ) -> DWORD; + pub fn CryptMsgOpenToDecode( + dwMsgEncodingType: DWORD, + dwFlags: DWORD, + dwMsgType: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + pRecipientInfo: PCERT_INFO, + pStreamInfo: PCMSG_STREAM_INFO, + ) -> HCRYPTMSG; + pub fn CryptMsgDuplicate( + hCryptMsg: HCRYPTMSG, + ) -> HCRYPTMSG; + pub fn CryptMsgClose( + hCryptMsg: HCRYPTMSG, + ) -> BOOL; + pub fn CryptMsgUpdate( + hCryptMsg: HCRYPTMSG, + pbData: *const BYTE, + cbData: DWORD, + fFinal: BOOL, + ) -> BOOL; + pub fn CryptMsgGetParam( + hCryptMsg: HCRYPTMSG, + dwParamType: DWORD, + dwIndex: DWORD, + pvData: *mut c_void, + pcbData: *mut DWORD, + ) -> BOOL; +} +pub const CMSG_TYPE_PARAM: DWORD = 1; +pub const CMSG_CONTENT_PARAM: DWORD = 2; +pub const CMSG_BARE_CONTENT_PARAM: DWORD = 3; +pub const CMSG_INNER_CONTENT_TYPE_PARAM: DWORD = 4; +pub const CMSG_SIGNER_COUNT_PARAM: DWORD = 5; +pub const CMSG_SIGNER_INFO_PARAM: DWORD = 6; +pub const CMSG_SIGNER_CERT_INFO_PARAM: DWORD = 7; +pub const CMSG_SIGNER_HASH_ALGORITHM_PARAM: DWORD = 8; +pub const CMSG_SIGNER_AUTH_ATTR_PARAM: DWORD = 9; +pub const CMSG_SIGNER_UNAUTH_ATTR_PARAM: DWORD = 10; +pub const CMSG_CERT_COUNT_PARAM: DWORD = 11; +pub const CMSG_CERT_PARAM: DWORD = 12; +pub const CMSG_CRL_COUNT_PARAM: DWORD = 13; +pub const CMSG_CRL_PARAM: DWORD = 14; +pub const CMSG_ENVELOPE_ALGORITHM_PARAM: DWORD = 15; +pub const CMSG_RECIPIENT_COUNT_PARAM: DWORD = 17; +pub const CMSG_RECIPIENT_INDEX_PARAM: DWORD = 18; +pub const CMSG_RECIPIENT_INFO_PARAM: DWORD = 19; +pub const CMSG_HASH_ALGORITHM_PARAM: DWORD = 20; +pub const CMSG_HASH_DATA_PARAM: DWORD = 21; +pub const CMSG_COMPUTED_HASH_PARAM: DWORD = 22; +pub const CMSG_ENCRYPT_PARAM: DWORD = 26; +pub const CMSG_ENCRYPTED_DIGEST: DWORD = 27; +pub const CMSG_ENCODED_SIGNER: DWORD = 28; +pub const CMSG_ENCODED_MESSAGE: DWORD = 29; +pub const CMSG_VERSION_PARAM: DWORD = 30; +pub const CMSG_ATTR_CERT_COUNT_PARAM: DWORD = 31; +pub const CMSG_ATTR_CERT_PARAM: DWORD = 32; +pub const CMSG_CMS_RECIPIENT_COUNT_PARAM: DWORD = 33; +pub const CMSG_CMS_RECIPIENT_INDEX_PARAM: DWORD = 34; +pub const CMSG_CMS_RECIPIENT_ENCRYPTED_KEY_INDEX_PARAM: DWORD = 35; +pub const CMSG_CMS_RECIPIENT_INFO_PARAM: DWORD = 36; +pub const CMSG_UNPROTECTED_ATTR_PARAM: DWORD = 37; +pub const CMSG_SIGNER_CERT_ID_PARAM: DWORD = 38; +pub const CMSG_CMS_SIGNER_INFO_PARAM: DWORD = 39; +STRUCT!{struct CMSG_SIGNER_INFO { + dwVersion: DWORD, + Issuer: CERT_NAME_BLOB, + SerialNumber: CRYPT_INTEGER_BLOB, + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + HashEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + EncryptedHash: CRYPT_DATA_BLOB, + AuthAttrs: CRYPT_ATTRIBUTES, + UnauthAttrs: CRYPT_ATTRIBUTES, +}} +pub type PCMSG_SIGNER_INFO = *mut CMSG_SIGNER_INFO; +STRUCT!{struct CMSG_CMS_SIGNER_INFO { + dwVersion: DWORD, + SignerId: CERT_ID, + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + HashEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + EncryptedHash: CRYPT_DATA_BLOB, + AuthAttrs: CRYPT_ATTRIBUTES, + UnauthAttrs: CRYPT_ATTRIBUTES, +}} +pub type PCMSG_CMS_SIGNER_INFO = *mut CMSG_CMS_SIGNER_INFO; +pub type CMSG_ATTR = CRYPT_ATTRIBUTES; +pub type PCMSG_ATTR = *mut CRYPT_ATTRIBUTES; +pub const CMSG_SIGNED_DATA_V1: DWORD = 1; +pub const CMSG_SIGNED_DATA_V3: DWORD = 3; +pub const CMSG_SIGNED_DATA_PKCS_1_5_VERSION: DWORD = CMSG_SIGNED_DATA_V1; +pub const CMSG_SIGNED_DATA_CMS_VERSION: DWORD = CMSG_SIGNED_DATA_V3; +pub const CMSG_SIGNER_INFO_V1: DWORD = 1; +pub const CMSG_SIGNER_INFO_V3: DWORD = 3; +pub const CMSG_SIGNER_INFO_PKCS_1_5_VERSION: DWORD = CMSG_SIGNER_INFO_V1; +pub const CMSG_SIGNER_INFO_CMS_VERSION: DWORD = CMSG_SIGNER_INFO_V3; +pub const CMSG_HASHED_DATA_V0: DWORD = 0; +pub const CMSG_HASHED_DATA_V2: DWORD = 2; +pub const CMSG_HASHED_DATA_PKCS_1_5_VERSION: DWORD = CMSG_HASHED_DATA_V0; +pub const CMSG_HASHED_DATA_CMS_VERSION: DWORD = CMSG_HASHED_DATA_V2; +pub const CMSG_ENVELOPED_DATA_V0: DWORD = 0; +pub const CMSG_ENVELOPED_DATA_V2: DWORD = 2; +pub const CMSG_ENVELOPED_DATA_PKCS_1_5_VERSION: DWORD = CMSG_ENVELOPED_DATA_V0; +pub const CMSG_ENVELOPED_DATA_CMS_VERSION: DWORD = CMSG_ENVELOPED_DATA_V2; +STRUCT!{struct CMSG_KEY_TRANS_RECIPIENT_INFO { + dwVersion: DWORD, + RecipientId: CERT_ID, + KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + EncryptedKey: CRYPT_DATA_BLOB, +}} +pub type PCMSG_KEY_TRANS_RECIPIENT_INFO = *mut CMSG_KEY_TRANS_RECIPIENT_INFO; +STRUCT!{struct CMSG_RECIPIENT_ENCRYPTED_KEY_INFO { + RecipientId: CERT_ID, + EncryptedKey: CRYPT_DATA_BLOB, + Date: FILETIME, + pOtherAttr: PCRYPT_ATTRIBUTE_TYPE_VALUE, +}} +pub type PCMSG_RECIPIENT_ENCRYPTED_KEY_INFO = *mut CMSG_RECIPIENT_ENCRYPTED_KEY_INFO; +UNION!{union CMSG_KEY_AGREE_RECIPIENT_INFO_u { + [usize; 6], + OriginatorCertId OriginatorCertId_mut: CERT_ID, + OriginatorPublicKeyInfo OriginatorPublicKeyInfo_mut: CERT_PUBLIC_KEY_INFO, +}} +STRUCT!{struct CMSG_KEY_AGREE_RECIPIENT_INFO { + dwVersion: DWORD, + dwOriginatorChoice: DWORD, + u: CMSG_KEY_AGREE_RECIPIENT_INFO_u, + UserKeyingMaterial: CRYPT_DATA_BLOB, + KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + cRecipientEncryptedKeys: DWORD, + rgpRecipientEncryptedKeys: *mut PCMSG_RECIPIENT_ENCRYPTED_KEY_INFO, +}} +pub type PCMSG_KEY_AGREE_RECIPIENT_INFO = *mut CMSG_KEY_AGREE_RECIPIENT_INFO; +pub const CMSG_KEY_AGREE_ORIGINATOR_CERT: DWORD = 1; +pub const CMSG_KEY_AGREE_ORIGINATOR_PUBLIC_KEY: DWORD = 2; +STRUCT!{struct CMSG_MAIL_LIST_RECIPIENT_INFO { + dwVersion: DWORD, + KeyId: CRYPT_DATA_BLOB, + KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + EncryptedKey: CRYPT_DATA_BLOB, + Date: FILETIME, + pOtherAttr: PCRYPT_ATTRIBUTE_TYPE_VALUE, +}} +pub type PCMSG_MAIL_LIST_RECIPIENT_INFO = *mut CMSG_MAIL_LIST_RECIPIENT_INFO; +UNION!{union CMSG_CMS_RECIPIENT_INFO_u { + [usize; 1], + pKeyTrans pKeyTrans_mut: PCMSG_KEY_TRANS_RECIPIENT_INFO, + pKeyAgree pKeyAgree_mut: PCMSG_KEY_AGREE_RECIPIENT_INFO, + pMailList pMailList_mut: PCMSG_MAIL_LIST_RECIPIENT_INFO, +}} +STRUCT!{struct CMSG_CMS_RECIPIENT_INFO { + dwRecipientChoice: DWORD, + u: CMSG_CMS_RECIPIENT_INFO_u, +}} +pub type PCMSG_CMS_RECIPIENT_INFO = *mut CMSG_CMS_RECIPIENT_INFO; +pub const CMSG_ENVELOPED_RECIPIENT_V0: DWORD = 0; +pub const CMSG_ENVELOPED_RECIPIENT_V2: DWORD = 2; +pub const CMSG_ENVELOPED_RECIPIENT_V3: DWORD = 3; +pub const CMSG_ENVELOPED_RECIPIENT_V4: DWORD = 4; +pub const CMSG_KEY_TRANS_PKCS_1_5_VERSION: DWORD = CMSG_ENVELOPED_RECIPIENT_V0; +pub const CMSG_KEY_TRANS_CMS_VERSION: DWORD = CMSG_ENVELOPED_RECIPIENT_V2; +pub const CMSG_KEY_AGREE_VERSION: DWORD = CMSG_ENVELOPED_RECIPIENT_V3; +pub const CMSG_MAIL_LIST_VERSION: DWORD = CMSG_ENVELOPED_RECIPIENT_V4; +extern "system" { + pub fn CryptMsgControl( + hCryptMsg: HCRYPTMSG, + dwFlags: DWORD, + dwCtrlType: DWORD, + pvCtrlPara: *const c_void, + ) -> BOOL; +} +pub const CMSG_CTRL_VERIFY_SIGNATURE: DWORD = 1; +pub const CMSG_CTRL_DECRYPT: DWORD = 2; +pub const CMSG_CTRL_VERIFY_HASH: DWORD = 5; +pub const CMSG_CTRL_ADD_SIGNER: DWORD = 6; +pub const CMSG_CTRL_DEL_SIGNER: DWORD = 7; +pub const CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR: DWORD = 8; +pub const CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR: DWORD = 9; +pub const CMSG_CTRL_ADD_CERT: DWORD = 10; +pub const CMSG_CTRL_DEL_CERT: DWORD = 11; +pub const CMSG_CTRL_ADD_CRL: DWORD = 12; +pub const CMSG_CTRL_DEL_CRL: DWORD = 13; +pub const CMSG_CTRL_ADD_ATTR_CERT: DWORD = 14; +pub const CMSG_CTRL_DEL_ATTR_CERT: DWORD = 15; +pub const CMSG_CTRL_KEY_TRANS_DECRYPT: DWORD = 16; +pub const CMSG_CTRL_KEY_AGREE_DECRYPT: DWORD = 17; +pub const CMSG_CTRL_MAIL_LIST_DECRYPT: DWORD = 18; +pub const CMSG_CTRL_VERIFY_SIGNATURE_EX: DWORD = 19; +pub const CMSG_CTRL_ADD_CMS_SIGNER_INFO: DWORD = 20; +pub const CMSG_CTRL_ENABLE_STRONG_SIGNATURE: DWORD = 21; +STRUCT!{struct CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA { + cbSize: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + dwSignerIndex: DWORD, + dwSignerType: DWORD, + pvSigner: *mut c_void, +}} +pub type PCMSG_CTRL_VERIFY_SIGNATURE_EX_PARA = *mut CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA; +pub const CMSG_VERIFY_SIGNER_PUBKEY: DWORD = 1; +pub const CMSG_VERIFY_SIGNER_CERT: DWORD = 2; +pub const CMSG_VERIFY_SIGNER_CHAIN: DWORD = 3; +pub const CMSG_VERIFY_SIGNER_NULL: DWORD = 4; +UNION!{union CMSG_CTRL_DECRYPT_PARA_u { + [usize; 1], + hCryptProv hCryptProv_mut: HCRYPTPROV, + hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, +}} +STRUCT!{struct CMSG_CTRL_DECRYPT_PARA { + cbSize: DWORD, + u: CMSG_CTRL_DECRYPT_PARA_u, + dwKeySpec: DWORD, + dwRecipientIndex: DWORD, +}} +pub type PCMSG_CTRL_DECRYPT_PARA = *mut CMSG_CTRL_DECRYPT_PARA; +UNION!{union CMSG_CTRL_KEY_TRANS_DECRYPT_PARA_u { + [usize; 1], + hCryptProv hCryptProv_mut: HCRYPTPROV, + hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, +}} +STRUCT!{struct CMSG_CTRL_KEY_TRANS_DECRYPT_PARA { + cbSize: DWORD, + u: CMSG_CTRL_KEY_TRANS_DECRYPT_PARA_u, + dwKeySpec: DWORD, + pKeyTrans: PCMSG_KEY_TRANS_RECIPIENT_INFO, + dwRecipientIndex: DWORD, +}} +pub type PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA = *mut CMSG_CTRL_KEY_TRANS_DECRYPT_PARA; +UNION!{union CMSG_CTRL_KEY_AGREE_DECRYPT_PARA_u { + [usize; 1], + hCryptProv hCryptProv_mut: HCRYPTPROV, + hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, +}} +STRUCT!{struct CMSG_CTRL_KEY_AGREE_DECRYPT_PARA { + cbSize: DWORD, + u: CMSG_CTRL_KEY_AGREE_DECRYPT_PARA_u, + dwKeySpec: DWORD, + pKeyAgree: PCMSG_KEY_AGREE_RECIPIENT_INFO, + dwRecipientIndex: DWORD, + dwRecipientEncryptedKeyIndex: DWORD, + OriginatorPublicKey: CRYPT_BIT_BLOB, +}} +pub type PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA = *mut CMSG_CTRL_KEY_AGREE_DECRYPT_PARA; +UNION!{union CMSG_CTRL_MAIL_LIST_DECRYPT_PARA_u { + [usize; 1], + hKeyEncryptionKey hKeyEncryptionKey_mut: HCRYPTKEY, + pvKeyEncryptionKey pvKeyEncryptionKey_mut: *mut c_void, +}} +STRUCT!{struct CMSG_CTRL_MAIL_LIST_DECRYPT_PARA { + cbSize: DWORD, + hCryptProv: HCRYPTPROV, + pMailList: PCMSG_MAIL_LIST_RECIPIENT_INFO, + dwRecipientIndex: DWORD, + dwKeyChoice: DWORD, + u: CMSG_CTRL_MAIL_LIST_DECRYPT_PARA_u, +}} +pub type PCMSG_CTRL_MAIL_LIST_DECRYPT_PARA = *mut CMSG_CTRL_MAIL_LIST_DECRYPT_PARA; +STRUCT!{struct CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA { + cbSize: DWORD, + dwSignerIndex: DWORD, + blob: CRYPT_DATA_BLOB, +}} +pub type PCMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA = *mut CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA; +STRUCT!{struct CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA { + cbSize: DWORD, + dwSignerIndex: DWORD, + dwUnauthAttrIndex: DWORD, +}} +pub type PCMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA = *mut CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA; +extern "system" { + pub fn CryptMsgVerifyCountersignatureEncoded( + hCryptProv: HCRYPTPROV_LEGACY, + dwEncodingType: DWORD, + pbSignerInfo: PBYTE, + cbSignerInfo: DWORD, + pbSignerInfoCountersignature: PBYTE, + cbSignerInfoCountersignature: DWORD, + pciCountersigner: PCERT_INFO, + ) -> BOOL; + pub fn CryptMsgVerifyCountersignatureEncodedEx( + hCryptProv: HCRYPTPROV_LEGACY, + dwEncodingType: DWORD, + pbSignerInfo: PBYTE, + cbSignerInfo: DWORD, + pbSignerInfoCountersignature: PBYTE, + cbSignerInfoCountersignature: DWORD, + dwSignerType: DWORD, + pvSigner: *mut c_void, + dwFlags: DWORD, + pvExtra: *mut c_void, + ) -> BOOL; +} +pub const CMSG_VERIFY_COUNTER_SIGN_ENABLE_STRONG_FLAG: DWORD = 0x00000001; +extern "system" { + pub fn CryptMsgCountersign( + hCryptMsg: HCRYPTMSG, + dwIndex: DWORD, + cCountersigners: DWORD, + rgCountersigners: PCMSG_SIGNER_ENCODE_INFO, + ) -> BOOL; + pub fn CryptMsgCountersignEncoded( + dwEncodingType: DWORD, + pbSignerInfo: PBYTE, + cbSignerInfo: DWORD, + cCountersigners: DWORD, + rgCountersigners: PCMSG_SIGNER_ENCODE_INFO, + pbCountersignature: PBYTE, + pcbCountersignature: PDWORD, + ) -> BOOL; +} +FN!{stdcall PFN_CMSG_ALLOC( + cb: size_t, +) -> ()} +FN!{stdcall PFN_CMSG_FREE( + pv: *mut c_void, +) -> ()} +pub const CMSG_OID_GEN_ENCRYPT_KEY_FUNC: &'static str = "CryptMsgDllGenEncryptKey"; +FN!{stdcall PFN_CMSG_GEN_ENCRYPT_KEY( + phCryptProv: *mut HCRYPTPROV, + paiEncrypt: PCRYPT_ALGORITHM_IDENTIFIER, + pvEncryptAuxInfo: PVOID, + pPublicKeyInfo: PCERT_PUBLIC_KEY_INFO, + pfnAlloc: PFN_CMSG_ALLOC, + phEncryptKey: *mut HCRYPTKEY, + ppbEncryptParameters: *mut PBYTE, + pcbEncryptParameters: PDWORD, +) -> BOOL} +pub const CMSG_OID_EXPORT_ENCRYPT_KEY_FUNC: &'static str = "CryptMsgDllExportEncryptKey"; +FN!{stdcall PFN_CMSG_EXPORT_ENCRYPT_KEY( + hCryptProv: HCRYPTPROV, + hEncryptKey: HCRYPTKEY, + pPublicKeyInfo: PCERT_PUBLIC_KEY_INFO, + pbData: PBYTE, + pcbData: PDWORD, +) -> BOOL} +pub const CMSG_OID_IMPORT_ENCRYPT_KEY_FUNC: &'static str = "CryptMsgDllImportEncryptKey"; +FN!{stdcall PFN_CMSG_IMPORT_ENCRYPT_KEY( + hCryptProv: HCRYPTPROV, + dwKeySpec: DWORD, + paiEncrypt: PCRYPT_ALGORITHM_IDENTIFIER, + paiPubKey: PCRYPT_ALGORITHM_IDENTIFIER, + pbEncodedKey: PBYTE, + cbEncodedKey: DWORD, + phEncryptKey: *mut HCRYPTKEY, +) -> BOOL} +pub const CMSG_DEFAULT_INSTALLABLE_FUNC_OID: LPCSTR = 1 as LPCSTR; +UNION!{union CMSG_CONTENT_ENCRYPT_INFO_u { + [usize; 1], + hContentEncryptKey hContentEncryptKey_mut: HCRYPTKEY, + hCNGContentEncryptKey hCNGContentEncryptKey_mut: BCRYPT_KEY_HANDLE, +}} +STRUCT!{struct CMSG_CONTENT_ENCRYPT_INFO { + cbSize: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + ContentEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvEncryptionAuxInfo: *mut c_void, + cRecipients: DWORD, + rgCmsRecipients: PCMSG_RECIPIENT_ENCODE_INFO, + pfnAlloc: PFN_CMSG_ALLOC, + pfnFree: PFN_CMSG_FREE, + dwEncryptFlags: DWORD, + u: CMSG_CONTENT_ENCRYPT_INFO_u, + dwFlags: DWORD, + fCNG: BOOL, + pbCNGContentEncryptKeyObject: *mut BYTE, + pbContentEncryptKey: *mut BYTE, + cbContentEncryptKey: DWORD, +}} +pub type PCMSG_CONTENT_ENCRYPT_INFO = *mut CMSG_CONTENT_ENCRYPT_INFO; +pub const CMSG_CONTENT_ENCRYPT_PAD_ENCODED_LEN_FLAG: DWORD = 0x00000001; +pub const CMSG_CONTENT_ENCRYPT_FREE_PARA_FLAG: DWORD = 0x00000001; +pub const CMSG_CONTENT_ENCRYPT_FREE_OBJID_FLAG: DWORD = 0x00000002; +pub const CMSG_CONTENT_ENCRYPT_RELEASE_CONTEXT_FLAG: DWORD = 0x00008000; +pub const CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC: &'static str = "CryptMsgDllGenContentEncryptKey"; +pub const CMSG_OID_CAPI1_GEN_CONTENT_ENCRYPT_KEY_FUNC: &'static str + = CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC; +FN!{stdcall PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY( + pContentEncryptInfo: PCMSG_CONTENT_ENCRYPT_INFO, + dwFlags: DWORD, + pvReserved: *mut c_void, +) -> BOOL} +pub const CMSG_OID_CNG_GEN_CONTENT_ENCRYPT_KEY_FUNC: &'static str + = "CryptMsgDllCNGGenContentEncryptKey"; +STRUCT!{struct CMSG_KEY_TRANS_ENCRYPT_INFO { + cbSize: DWORD, + dwRecipientIndex: DWORD, + KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + EncryptedKey: CRYPT_DATA_BLOB, + dwFlags: DWORD, +}} +pub type PCMSG_KEY_TRANS_ENCRYPT_INFO = *mut CMSG_KEY_TRANS_ENCRYPT_INFO; +pub const CMSG_KEY_TRANS_ENCRYPT_FREE_PARA_FLAG: DWORD = 0x00000001; +pub const CMSG_KEY_TRANS_ENCRYPT_FREE_OBJID_FLAG: DWORD = 0x00000002; +pub const CMSG_OID_EXPORT_KEY_TRANS_FUNC: &'static str = "CryptMsgDllExportKeyTrans"; +pub const CMSG_OID_CAPI1_EXPORT_KEY_TRANS_FUNC: &'static str = CMSG_OID_EXPORT_KEY_TRANS_FUNC; +FN!{stdcall PFN_CMSG_EXPORT_KEY_TRANS( + pContentEncryptInfo: PCMSG_CONTENT_ENCRYPT_INFO, + pKeyTransEncodeInfo: PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO, + pKeyTransEncryptInfo: PCMSG_KEY_TRANS_ENCRYPT_INFO, + dwFlags: DWORD, + pvReserved: *mut c_void, +) -> BOOL} +pub const CMSG_OID_CNG_EXPORT_KEY_TRANS_FUNC: &'static str = "CryptMsgDllCNGExportKeyTrans"; +STRUCT!{struct CMSG_KEY_AGREE_KEY_ENCRYPT_INFO { + cbSize: DWORD, + EncryptedKey: CRYPT_DATA_BLOB, +}} +pub type PCMSG_KEY_AGREE_KEY_ENCRYPT_INFO = *mut CMSG_KEY_AGREE_KEY_ENCRYPT_INFO; +UNION!{union CMSG_KEY_AGREE_ENCRYPT_INFO_u { + [usize; 6], + OriginatorCertId OriginatorCertId_mut: CERT_ID, + OriginatorPublicKeyInfo OriginatorPublicKeyInfo_mut: CERT_PUBLIC_KEY_INFO, +}} +STRUCT!{struct CMSG_KEY_AGREE_ENCRYPT_INFO { + cbSize: DWORD, + dwRecipientIndex: DWORD, + KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + UserKeyingMaterial: CRYPT_DATA_BLOB, + dwOriginatorChoice: DWORD, + u: CMSG_KEY_AGREE_ENCRYPT_INFO_u, + cKeyAgreeKeyEncryptInfo: DWORD, + rgpKeyAgreeKeyEncryptInfo: *mut PCMSG_KEY_AGREE_KEY_ENCRYPT_INFO, + dwFlags: DWORD, +}} +pub type PCMSG_KEY_AGREE_ENCRYPT_INFO = *mut CMSG_KEY_AGREE_ENCRYPT_INFO; +pub const CMSG_KEY_AGREE_ENCRYPT_FREE_PARA_FLAG: DWORD = 0x00000001; +pub const CMSG_KEY_AGREE_ENCRYPT_FREE_MATERIAL_FLAG: DWORD = 0x00000002; +pub const CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_ALG_FLAG: DWORD = 0x00000004; +pub const CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_PARA_FLAG: DWORD = 0x00000008; +pub const CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_BITS_FLAG: DWORD = 0x00000010; +pub const CMSG_KEY_AGREE_ENCRYPT_FREE_OBJID_FLAG: DWORD = 0x00000020; +pub const CMSG_OID_EXPORT_KEY_AGREE_FUNC: &'static str = "CryptMsgDllExportKeyAgree"; +pub const CMSG_OID_CAPI1_EXPORT_KEY_AGREE_FUNC: &'static str = CMSG_OID_EXPORT_KEY_AGREE_FUNC; +FN!{stdcall PFN_CMSG_EXPORT_KEY_AGREE( + pContentEncryptInfo: PCMSG_CONTENT_ENCRYPT_INFO, + pKeyAgreeEncodeInfo: PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO, + pKeyAgreeEncryptInfo: PCMSG_KEY_AGREE_ENCRYPT_INFO, + dwFlags: DWORD, + pvReserved: *mut c_void, +) -> BOOL} +pub const CMSG_OID_CNG_EXPORT_KEY_AGREE_FUNC: &'static str = "CryptMsgDllCNGExportKeyAgree"; +STRUCT!{struct CMSG_MAIL_LIST_ENCRYPT_INFO { + cbSize: DWORD, + dwRecipientIndex: DWORD, + KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + EncryptedKey: CRYPT_DATA_BLOB, + dwFlags: DWORD, +}} +pub type PCMSG_MAIL_LIST_ENCRYPT_INFO = *mut CMSG_MAIL_LIST_ENCRYPT_INFO; +pub const CMSG_MAIL_LIST_ENCRYPT_FREE_PARA_FLAG: DWORD = 0x00000001; +pub const CMSG_MAIL_LIST_ENCRYPT_FREE_OBJID_FLAG: DWORD = 0x00000002; +pub const CMSG_OID_EXPORT_MAIL_LIST_FUNC: &'static str = "CryptMsgDllExportMailList"; +pub const CMSG_OID_CAPI1_EXPORT_MAIL_LIST_FUNC: &'static str = CMSG_OID_EXPORT_MAIL_LIST_FUNC; +FN!{stdcall PFN_CMSG_EXPORT_MAIL_LIST( + pContentEncryptInfo: PCMSG_CONTENT_ENCRYPT_INFO, + pMailListEncodeInfo: PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO, + pMailListEncryptInfo: PCMSG_MAIL_LIST_ENCRYPT_INFO, + dwFlags: DWORD, + pvReserved: *mut c_void, +) -> BOOL} +pub const CMSG_OID_IMPORT_KEY_TRANS_FUNC: &'static str = "CryptMsgDllImportKeyTrans"; +pub const CMSG_OID_CAPI1_IMPORT_KEY_TRANS_FUNC: &'static str = CMSG_OID_IMPORT_KEY_TRANS_FUNC; +FN!{stdcall PFN_CMSG_IMPORT_KEY_TRANS( + pContentEncryptionAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, + pKeyTransDecryptPara: PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA, + dwFlags: DWORD, + pvReserved: *mut c_void, + phContentEncryptKey: *mut HCRYPTKEY, +) -> BOOL} +pub const CMSG_OID_IMPORT_KEY_AGREE_FUNC: &'static str = "CryptMsgDllImportKeyAgree"; +pub const CMSG_OID_CAPI1_IMPORT_KEY_AGREE_FUNC: &'static str = CMSG_OID_IMPORT_KEY_AGREE_FUNC; +FN!{stdcall PFN_CMSG_IMPORT_KEY_AGREE( + pContentEncryptionAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, + pKeyAgreeDecryptPara: PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA, + dwFlags: DWORD, + pvReserved: *mut c_void, + phContentEncryptKey: *mut HCRYPTKEY, +) -> BOOL} +pub const CMSG_OID_IMPORT_MAIL_LIST_FUNC: &'static str = "CryptMsgDllImportMailList"; +pub const CMSG_OID_CAPI1_IMPORT_MAIL_LIST_FUNC: &'static str = CMSG_OID_IMPORT_MAIL_LIST_FUNC; +FN!{stdcall PFN_CMSG_IMPORT_MAIL_LIST( + pContentEncryptionAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, + pMailListDecryptPara: PCMSG_CTRL_MAIL_LIST_DECRYPT_PARA, + dwFlags: DWORD, + pvReserved: *mut c_void, + phContentEncryptKey: *mut HCRYPTKEY, +) -> BOOL} +STRUCT!{struct CMSG_CNG_CONTENT_DECRYPT_INFO { + cbSize: DWORD, + ContentEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pfnAlloc: PFN_CMSG_ALLOC, + pfnFree: PFN_CMSG_FREE, + hNCryptKey: NCRYPT_KEY_HANDLE, + pbContentEncryptKey: *mut BYTE, + cbContentEncryptKey: DWORD, + hCNGContentEncryptKey: BCRYPT_KEY_HANDLE, + pbCNGContentEncryptKeyObject: *mut BYTE, +}} +pub type PCMSG_CNG_CONTENT_DECRYPT_INFO = *mut CMSG_CNG_CONTENT_DECRYPT_INFO; +pub const CMSG_OID_CNG_IMPORT_KEY_TRANS_FUNC: &'static str = "CryptMsgDllCNGImportKeyTrans"; +FN!{stdcall PFN_CMSG_CNG_IMPORT_KEY_TRANS( + pCNGContentDecryptInfo: PCMSG_CNG_CONTENT_DECRYPT_INFO, + pKeyTransDecryptPara: PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA, + dwFlags: DWORD, + pvReserved: *mut c_void, +) -> BOOL} +pub const CMSG_OID_CNG_IMPORT_KEY_AGREE_FUNC: &'static str = "CryptMsgDllCNGImportKeyAgree"; +FN!{stdcall PFN_CMSG_CNG_IMPORT_KEY_AGREE( + pCNGContentDecryptInfo: PCMSG_CNG_CONTENT_DECRYPT_INFO, + pKeyAgreeDecryptPara: PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA, + dwFlags: DWORD, + pvReserved: *mut c_void, +) -> BOOL} +pub const CMSG_OID_CNG_IMPORT_CONTENT_ENCRYPT_KEY_FUNC: &'static str + = "CryptMsgDllCNGImportContentEncryptKey"; +FN!{stdcall PFN_CMSG_CNG_IMPORT_CONTENT_ENCRYPT_KEY( + pCNGContentDecryptInfo: PCMSG_CNG_CONTENT_DECRYPT_INFO, + dwFlags: DWORD, + pvReserved: *mut c_void, +) -> BOOL} +pub type HCERTSTORE = *mut c_void; +STRUCT!{struct CERT_CONTEXT { + dwCertEncodingType: DWORD, + pbCertEncoded: *mut BYTE, + cbCertEncoded: DWORD, + pCertInfo: PCERT_INFO, + hCertStore: HCERTSTORE, +}} +pub type PCERT_CONTEXT = *mut CERT_CONTEXT; +pub type PCCERT_CONTEXT = *const CERT_CONTEXT; +STRUCT!{struct CRL_CONTEXT { + dwCertEncodingType: DWORD, + pbCrlEncoded: *mut BYTE, + cbCrlEncoded: DWORD, + pCrlInfo: PCRL_INFO, + hCertStore: HCERTSTORE, +}} +pub type PCRL_CONTEXT = *mut CRL_CONTEXT; +pub type PCCRL_CONTEXT = *const CRL_CONTEXT; +STRUCT!{struct CTL_CONTEXT { + dwMsgAndCertEncodingType: DWORD, + pbCtlEncoded: *mut BYTE, + cbCtlEncoded: DWORD, + pCtlInfo: PCTL_INFO, + hCertStore: HCERTSTORE, + hCryptMsg: HCRYPTMSG, + pbCtlContent: *mut BYTE, + cbCtlContent: DWORD, +}} +pub type PCTL_CONTEXT = *mut CTL_CONTEXT; +pub type PCCTL_CONTEXT = *const CTL_CONTEXT; +pub const CERT_KEY_PROV_HANDLE_PROP_ID: DWORD = 1; +pub const CERT_KEY_PROV_INFO_PROP_ID: DWORD = 2; +pub const CERT_SHA1_HASH_PROP_ID: DWORD = 3; +pub const CERT_MD5_HASH_PROP_ID: DWORD = 4; +pub const CERT_HASH_PROP_ID: DWORD = CERT_SHA1_HASH_PROP_ID; +pub const CERT_KEY_CONTEXT_PROP_ID: DWORD = 5; +pub const CERT_KEY_SPEC_PROP_ID: DWORD = 6; +pub const CERT_IE30_RESERVED_PROP_ID: DWORD = 7; +pub const CERT_PUBKEY_HASH_RESERVED_PROP_ID: DWORD = 8; +pub const CERT_ENHKEY_USAGE_PROP_ID: DWORD = 9; +pub const CERT_CTL_USAGE_PROP_ID: DWORD = CERT_ENHKEY_USAGE_PROP_ID; +pub const CERT_NEXT_UPDATE_LOCATION_PROP_ID: DWORD = 10; +pub const CERT_FRIENDLY_NAME_PROP_ID: DWORD = 11; +pub const CERT_PVK_FILE_PROP_ID: DWORD = 12; +pub const CERT_DESCRIPTION_PROP_ID: DWORD = 13; +pub const CERT_ACCESS_STATE_PROP_ID: DWORD = 14; +pub const CERT_SIGNATURE_HASH_PROP_ID: DWORD = 15; +pub const CERT_SMART_CARD_DATA_PROP_ID: DWORD = 16; +pub const CERT_EFS_PROP_ID: DWORD = 17; +pub const CERT_FORTEZZA_DATA_PROP_ID: DWORD = 18; +pub const CERT_ARCHIVED_PROP_ID: DWORD = 19; +pub const CERT_KEY_IDENTIFIER_PROP_ID: DWORD = 20; +pub const CERT_AUTO_ENROLL_PROP_ID: DWORD = 21; +pub const CERT_PUBKEY_ALG_PARA_PROP_ID: DWORD = 22; +pub const CERT_CROSS_CERT_DIST_POINTS_PROP_ID: DWORD = 23; +pub const CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID: DWORD = 24; +pub const CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID: DWORD = 25; +pub const CERT_ENROLLMENT_PROP_ID: DWORD = 26; +pub const CERT_DATE_STAMP_PROP_ID: DWORD = 27; +pub const CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID: DWORD = 28; +pub const CERT_SUBJECT_NAME_MD5_HASH_PROP_ID: DWORD = 29; +pub const CERT_EXTENDED_ERROR_INFO_PROP_ID: DWORD = 30; +pub const CERT_RENEWAL_PROP_ID: DWORD = 64; +pub const CERT_ARCHIVED_KEY_HASH_PROP_ID: DWORD = 65; +pub const CERT_AUTO_ENROLL_RETRY_PROP_ID: DWORD = 66; +pub const CERT_AIA_URL_RETRIEVED_PROP_ID: DWORD = 67; +pub const CERT_AUTHORITY_INFO_ACCESS_PROP_ID: DWORD = 68; +pub const CERT_BACKED_UP_PROP_ID: DWORD = 69; +pub const CERT_OCSP_RESPONSE_PROP_ID: DWORD = 70; +pub const CERT_REQUEST_ORIGINATOR_PROP_ID: DWORD = 71; +pub const CERT_SOURCE_LOCATION_PROP_ID: DWORD = 72; +pub const CERT_SOURCE_URL_PROP_ID: DWORD = 73; +pub const CERT_NEW_KEY_PROP_ID: DWORD = 74; +pub const CERT_OCSP_CACHE_PREFIX_PROP_ID: DWORD = 75; +pub const CERT_SMART_CARD_ROOT_INFO_PROP_ID: DWORD = 76; +pub const CERT_NO_AUTO_EXPIRE_CHECK_PROP_ID: DWORD = 77; +pub const CERT_NCRYPT_KEY_HANDLE_PROP_ID: DWORD = 78; +pub const CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID: DWORD = 79; +pub const CERT_SUBJECT_INFO_ACCESS_PROP_ID: DWORD = 80; +pub const CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID: DWORD = 81; +pub const CERT_CA_DISABLE_CRL_PROP_ID: DWORD = 82; +pub const CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID: DWORD = 83; +pub const CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID: DWORD = 84; +pub const CERT_SUBJECT_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID: DWORD = 85; +pub const CERT_SUBJECT_DISABLE_CRL_PROP_ID: DWORD = 86; +pub const CERT_CEP_PROP_ID: DWORD = 87; +pub const CERT_SIGN_HASH_CNG_ALG_PROP_ID: DWORD = 89; +pub const CERT_SCARD_PIN_ID_PROP_ID: DWORD = 90; +pub const CERT_SCARD_PIN_INFO_PROP_ID: DWORD = 91; +pub const CERT_SUBJECT_PUB_KEY_BIT_LENGTH_PROP_ID: DWORD = 92; +pub const CERT_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID: DWORD = 93; +pub const CERT_ISSUER_PUB_KEY_BIT_LENGTH_PROP_ID: DWORD = 94; +pub const CERT_ISSUER_CHAIN_SIGN_HASH_CNG_ALG_PROP_ID: DWORD = 95; +pub const CERT_ISSUER_CHAIN_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID: DWORD = 96; +pub const CERT_NO_EXPIRE_NOTIFICATION_PROP_ID: DWORD = 97; +pub const CERT_AUTH_ROOT_SHA256_HASH_PROP_ID: DWORD = 98; +pub const CERT_NCRYPT_KEY_HANDLE_TRANSFER_PROP_ID: DWORD = 99; +pub const CERT_HCRYPTPROV_TRANSFER_PROP_ID: DWORD = 100; +pub const CERT_SMART_CARD_READER_PROP_ID: DWORD = 101; +pub const CERT_SEND_AS_TRUSTED_ISSUER_PROP_ID: DWORD = 102; +pub const CERT_KEY_REPAIR_ATTEMPTED_PROP_ID: DWORD = 103; +pub const CERT_DISALLOWED_FILETIME_PROP_ID: DWORD = 104; +pub const CERT_ROOT_PROGRAM_CHAIN_POLICIES_PROP_ID: DWORD = 105; +pub const CERT_SMART_CARD_READER_NON_REMOVABLE_PROP_ID: DWORD = 106; +pub const CERT_SHA256_HASH_PROP_ID: DWORD = 107; +pub const CERT_SCEP_SERVER_CERTS_PROP_ID: DWORD = 108; +pub const CERT_SCEP_RA_SIGNATURE_CERT_PROP_ID: DWORD = 109; +pub const CERT_SCEP_RA_ENCRYPTION_CERT_PROP_ID: DWORD = 110; +pub const CERT_SCEP_CA_CERT_PROP_ID: DWORD = 111; +pub const CERT_SCEP_SIGNER_CERT_PROP_ID: DWORD = 112; +pub const CERT_SCEP_NONCE_PROP_ID: DWORD = 113; +pub const CERT_SCEP_ENCRYPT_HASH_CNG_ALG_PROP_ID: DWORD = 114; +pub const CERT_SCEP_FLAGS_PROP_ID: DWORD = 115; +pub const CERT_SCEP_GUID_PROP_ID: DWORD = 116; +pub const CERT_SERIALIZABLE_KEY_CONTEXT_PROP_ID: DWORD = 117; +pub const CERT_ISOLATED_KEY_PROP_ID: DWORD = 118; +pub const CERT_SERIAL_CHAIN_PROP_ID: DWORD = 119; +pub const CERT_KEY_CLASSIFICATION_PROP_ID: DWORD = 120; +pub const CERT_OCSP_MUST_STAPLE_PROP_ID: DWORD = 121; +pub const CERT_DISALLOWED_ENHKEY_USAGE_PROP_ID: DWORD = 122; +pub const CERT_NONCOMPLIANT_ROOT_URL_PROP_ID: DWORD = 123; +pub const CERT_PIN_SHA256_HASH_PROP_ID: DWORD = 124; +pub const CERT_CLR_DELETE_KEY_PROP_ID: DWORD = 125; +pub const CERT_NOT_BEFORE_FILETIME_PROP_ID: DWORD = 126; +pub const CERT_NOT_BEFORE_ENHKEY_USAGE_PROP_ID: DWORD = 127; +pub const CERT_FIRST_RESERVED_PROP_ID: DWORD = 128; +pub const CERT_LAST_RESERVED_PROP_ID: DWORD = 0x00007FFF; +pub const CERT_FIRST_USER_PROP_ID: DWORD = 0x00008000; +pub const CERT_LAST_USER_PROP_ID: DWORD = 0x0000FFFF; +ENUM!{enum CertKeyType { + KeyTypeOther = 0, + KeyTypeVirtualSmartCard = 1, + KeyTypePhysicalSmartCard = 2, + KeyTypePassport = 3, + KeyTypePassportRemote = 4, + KeyTypePassportSmartCard = 5, + KeyTypeHardware = 6, + KeyTypeSoftware = 7, + KeyTypeSelfSigned = 8, +}} +#[inline] +pub fn IS_CERT_HASH_PROP_ID(X: DWORD) -> bool { + CERT_SHA1_HASH_PROP_ID == X || CERT_MD5_HASH_PROP_ID == X || CERT_SHA256_HASH_PROP_ID == X + || CERT_SIGNATURE_HASH_PROP_ID == X +} +#[inline] +pub fn IS_PUBKEY_HASH_PROP_ID(X: DWORD) -> bool { + CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID == X || CERT_PIN_SHA256_HASH_PROP_ID == X + || CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID == X +} +#[inline] +pub fn IS_CHAIN_HASH_PROP_ID(X: DWORD) -> bool { + CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID == X || CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID == X + || CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID == X || CERT_SUBJECT_NAME_MD5_HASH_PROP_ID == X +} +#[inline] +pub fn IS_STRONG_SIGN_PROP_ID(X: DWORD) -> bool { + CERT_SIGN_HASH_CNG_ALG_PROP_ID == X || CERT_SUBJECT_PUB_KEY_BIT_LENGTH_PROP_ID == X + || CERT_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID == X +} +pub const szOID_CERT_PROP_ID_PREFIX: &'static str = "1.3.6.1.4.1.311.10.11."; +pub const szOID_CERT_KEY_IDENTIFIER_PROP_ID: &'static str = "1.3.6.1.4.1.311.10.11.20"; +pub const szOID_CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID: &'static str + = "1.3.6.1.4.1.311.10.11.28"; +pub const szOID_CERT_SUBJECT_NAME_MD5_HASH_PROP_ID: &'static str = "1.3.6.1.4.1.311.10.11.29"; +pub const szOID_CERT_MD5_HASH_PROP_ID: &'static str = "1.3.6.1.4.1.311.10.11.4"; +pub const szOID_CERT_SIGNATURE_HASH_PROP_ID: &'static str = "1.3.6.1.4.1.311.10.11.15"; +pub const szOID_DISALLOWED_HASH: &'static str = szOID_CERT_SIGNATURE_HASH_PROP_ID; +pub const szOID_CERT_DISALLOWED_FILETIME_PROP_ID: &'static str = "1.3.6.1.4.1.311.10.11.104"; +pub const CERT_ACCESS_STATE_WRITE_PERSIST_FLAG: DWORD = 0x1; +pub const CERT_ACCESS_STATE_SYSTEM_STORE_FLAG: DWORD = 0x2; +pub const CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG: DWORD = 0x4; +pub const CERT_ACCESS_STATE_GP_SYSTEM_STORE_FLAG: DWORD = 0x8; +pub const CERT_ACCESS_STATE_SHARED_USER_FLAG: DWORD = 0x10; +pub const szOID_ROOT_PROGRAM_AUTO_UPDATE_CA_REVOCATION: &'static str = "1.3.6.1.4.1.311.60.3.1"; +pub const szOID_ROOT_PROGRAM_AUTO_UPDATE_END_REVOCATION: &'static str = "1.3.6.1.4.1.311.60.3.2"; +pub const szOID_ROOT_PROGRAM_NO_OCSP_FAILOVER_TO_CRL: &'static str = "1.3.6.1.4.1.311.60.3.3"; +STRUCT!{struct CRYPT_KEY_PROV_PARAM { + dwParam: DWORD, + pbData: *mut BYTE, + cbData: DWORD, + dwFlags: DWORD, +}} +pub type PCRYPT_KEY_PROV_PARAM = *mut CRYPT_KEY_PROV_PARAM; +STRUCT!{struct CRYPT_KEY_PROV_INFO { + pwszContainerName: LPWSTR, + pwszProvName: LPWSTR, + dwProvType: DWORD, + dwFlags: DWORD, + cProvParam: DWORD, + rgProvParam: PCRYPT_KEY_PROV_PARAM, + dwKeySpec: DWORD, +}} +pub type PCRYPT_KEY_PROV_INFO = *mut CRYPT_KEY_PROV_INFO; +pub const CERT_SET_KEY_PROV_HANDLE_PROP_ID: DWORD = 0x00000001; +pub const CERT_SET_KEY_CONTEXT_PROP_ID: DWORD = 0x00000001; +pub const CERT_NCRYPT_KEY_SPEC: DWORD = 0xFFFFFFFF; +UNION!{union CERT_KEY_CONTEXT_u { + [usize; 1], + hCryptProv hCryptProv_mut: HCRYPTPROV, + hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, +}} +STRUCT!{struct CERT_KEY_CONTEXT { + cbSize: DWORD, + u: CERT_KEY_CONTEXT_u, + dwKeySpec: DWORD, +}} +pub type PCERT_KEY_CONTEXT = *mut CERT_KEY_CONTEXT; +STRUCT!{struct ROOT_INFO_LUID { + LowPart: DWORD, + HighPart: LONG, +}} +pub type PROOT_INFO_LUID = *mut ROOT_INFO_LUID; +STRUCT!{struct CRYPT_SMART_CARD_ROOT_INFO { + rgbCardID: [BYTE; 16], + luid: ROOT_INFO_LUID, +}} +pub type PCRYPT_SMART_CARD_ROOT_INFO = *mut CRYPT_SMART_CARD_ROOT_INFO; +pub const CERT_STORE_PROV_MSG: LPCSTR = 1 as LPCSTR; +pub const CERT_STORE_PROV_MEMORY: LPCSTR = 2 as LPCSTR; +pub const CERT_STORE_PROV_FILE: LPCSTR = 3 as LPCSTR; +pub const CERT_STORE_PROV_REG: LPCSTR = 4 as LPCSTR; +pub const CERT_STORE_PROV_PKCS7: LPCSTR = 5 as LPCSTR; +pub const CERT_STORE_PROV_SERIALIZED: LPCSTR = 6 as LPCSTR; +pub const CERT_STORE_PROV_FILENAME_A: LPCSTR = 7 as LPCSTR; +pub const CERT_STORE_PROV_FILENAME_W: LPCSTR = 8 as LPCSTR; +pub const CERT_STORE_PROV_FILENAME: LPCSTR = CERT_STORE_PROV_FILENAME_W; +pub const CERT_STORE_PROV_SYSTEM_A: LPCSTR = 9 as LPCSTR; +pub const CERT_STORE_PROV_SYSTEM_W: LPCSTR = 10 as LPCSTR; +pub const CERT_STORE_PROV_SYSTEM: LPCSTR = CERT_STORE_PROV_SYSTEM_W; +pub const CERT_STORE_PROV_COLLECTION: LPCSTR = 11 as LPCSTR; +pub const CERT_STORE_PROV_SYSTEM_REGISTRY_A: LPCSTR = 12 as LPCSTR; +pub const CERT_STORE_PROV_SYSTEM_REGISTRY_W: LPCSTR = 13 as LPCSTR; +pub const CERT_STORE_PROV_SYSTEM_REGISTRY: LPCSTR = CERT_STORE_PROV_SYSTEM_REGISTRY_W; +pub const CERT_STORE_PROV_PHYSICAL_W: LPCSTR = 14 as LPCSTR; +pub const CERT_STORE_PROV_PHYSICAL: LPCSTR = CERT_STORE_PROV_PHYSICAL_W; +pub const CERT_STORE_PROV_SMART_CARD_W: LPCSTR = 15 as LPCSTR; +pub const CERT_STORE_PROV_SMART_CARD: LPCSTR = CERT_STORE_PROV_SMART_CARD_W; +pub const CERT_STORE_PROV_LDAP_W: LPCSTR = 16 as LPCSTR; +pub const CERT_STORE_PROV_LDAP: LPCSTR = CERT_STORE_PROV_LDAP_W; +pub const CERT_STORE_PROV_PKCS12: LPCSTR = 17 as LPCSTR; +pub const sz_CERT_STORE_PROV_MEMORY: &'static str = "Memory"; +pub const sz_CERT_STORE_PROV_FILENAME_W: &'static str = "File"; +pub const sz_CERT_STORE_PROV_FILENAME: &'static str = sz_CERT_STORE_PROV_FILENAME_W; +pub const sz_CERT_STORE_PROV_SYSTEM_W: &'static str = "System"; +pub const sz_CERT_STORE_PROV_SYSTEM: &'static str = sz_CERT_STORE_PROV_SYSTEM_W; +pub const sz_CERT_STORE_PROV_PKCS7: &'static str = "PKCS7"; +pub const sz_CERT_STORE_PROV_PKCS12: &'static str = "PKCS12"; +pub const sz_CERT_STORE_PROV_SERIALIZED: &'static str = "Serialized"; +pub const sz_CERT_STORE_PROV_COLLECTION: &'static str = "Collection"; +pub const sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W: &'static str = "SystemRegistry"; +pub const sz_CERT_STORE_PROV_SYSTEM_REGISTRY: &'static str = sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W; +pub const sz_CERT_STORE_PROV_PHYSICAL_W: &'static str = "Physical"; +pub const sz_CERT_STORE_PROV_PHYSICAL: &'static str = sz_CERT_STORE_PROV_PHYSICAL_W; +pub const sz_CERT_STORE_PROV_SMART_CARD_W: &'static str = "SmartCard"; +pub const sz_CERT_STORE_PROV_SMART_CARD: &'static str = sz_CERT_STORE_PROV_SMART_CARD_W; +pub const sz_CERT_STORE_PROV_LDAP_W: &'static str = "Ldap"; +pub const sz_CERT_STORE_PROV_LDAP: &'static str = sz_CERT_STORE_PROV_LDAP_W; +pub const CERT_STORE_SIGNATURE_FLAG: DWORD = 0x00000001; +pub const CERT_STORE_TIME_VALIDITY_FLAG: DWORD = 0x00000002; +pub const CERT_STORE_REVOCATION_FLAG: DWORD = 0x00000004; +pub const CERT_STORE_NO_CRL_FLAG: DWORD = 0x00010000; +pub const CERT_STORE_NO_ISSUER_FLAG: DWORD = 0x00020000; +pub const CERT_STORE_BASE_CRL_FLAG: DWORD = 0x00000100; +pub const CERT_STORE_DELTA_CRL_FLAG: DWORD = 0x00000200; +pub const CERT_STORE_NO_CRYPT_RELEASE_FLAG: DWORD = 0x00000001; +pub const CERT_STORE_SET_LOCALIZED_NAME_FLAG: DWORD = 0x00000002; +pub const CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG: DWORD = 0x00000004; +pub const CERT_STORE_DELETE_FLAG: DWORD = 0x00000010; +pub const CERT_STORE_SHARE_STORE_FLAG: DWORD = 0x00000040; +pub const CERT_STORE_SHARE_CONTEXT_FLAG: DWORD = 0x00000080; +pub const CERT_STORE_MANIFOLD_FLAG: DWORD = 0x00000100; +pub const CERT_STORE_ENUM_ARCHIVED_FLAG: DWORD = 0x00000200; +pub const CERT_STORE_UPDATE_KEYID_FLAG: DWORD = 0x00000400; +pub const CERT_STORE_BACKUP_RESTORE_FLAG: DWORD = 0x00000800; +pub const CERT_STORE_READONLY_FLAG: DWORD = 0x00008000; +pub const CERT_STORE_OPEN_EXISTING_FLAG: DWORD = 0x00004000; +pub const CERT_STORE_CREATE_NEW_FLAG: DWORD = 0x00002000; +pub const CERT_STORE_MAXIMUM_ALLOWED_FLAG: DWORD = 0x00001000; +pub const CERT_SYSTEM_STORE_MASK: DWORD = 0xFFFF0000; +pub const CERT_SYSTEM_STORE_RELOCATE_FLAG: DWORD = 0x80000000; +UNION!{union CERT_SYSTEM_STORE_RELOCATE_PARA_u1 { + [usize; 1], + hKeyBase hKeyBase_mut: HKEY, + pvBase pvBase_mut: *mut c_void, +}} +UNION!{union CERT_SYSTEM_STORE_RELOCATE_PARA_u2 { + [usize; 1], + pvSystemStore pvSystemStore__mut: *mut c_void, + pszSystemStore pszSystemStore_mut: LPCSTR, + pwszSystemStore pwszSystemStore_mut: LPCWSTR, +}} +STRUCT!{struct CERT_SYSTEM_STORE_RELOCATE_PARA { + u1: CERT_SYSTEM_STORE_RELOCATE_PARA_u1, + u2: CERT_SYSTEM_STORE_RELOCATE_PARA_u2, +}} +pub type PCERT_SYSTEM_STORE_RELOCATE_PARA = *mut CERT_SYSTEM_STORE_RELOCATE_PARA; +pub const CERT_SYSTEM_STORE_UNPROTECTED_FLAG: DWORD = 0x40000000; +pub const CERT_SYSTEM_STORE_LOCATION_MASK: DWORD = 0x00FF0000; +pub const CERT_SYSTEM_STORE_LOCATION_SHIFT: DWORD = 16; +pub const CERT_SYSTEM_STORE_CURRENT_USER_ID: DWORD = 1; +pub const CERT_SYSTEM_STORE_LOCAL_MACHINE_ID: DWORD = 2; +pub const CERT_SYSTEM_STORE_CURRENT_SERVICE_ID: DWORD = 4; +pub const CERT_SYSTEM_STORE_SERVICES_ID: DWORD = 5; +pub const CERT_SYSTEM_STORE_USERS_ID: DWORD = 6; +pub const CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID: DWORD = 7; +pub const CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID: DWORD = 8; +pub const CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID: DWORD = 9; +pub const CERT_SYSTEM_STORE_CURRENT_USER: DWORD = CERT_SYSTEM_STORE_CURRENT_USER_ID + << CERT_SYSTEM_STORE_LOCATION_SHIFT; +pub const CERT_SYSTEM_STORE_LOCAL_MACHINE: DWORD = CERT_SYSTEM_STORE_LOCAL_MACHINE_ID + << CERT_SYSTEM_STORE_LOCATION_SHIFT; +pub const CERT_SYSTEM_STORE_CURRENT_SERVICE: DWORD = CERT_SYSTEM_STORE_CURRENT_SERVICE_ID + << CERT_SYSTEM_STORE_LOCATION_SHIFT; +pub const CERT_SYSTEM_STORE_SERVICES: DWORD = CERT_SYSTEM_STORE_SERVICES_ID + << CERT_SYSTEM_STORE_LOCATION_SHIFT; +pub const CERT_SYSTEM_STORE_USERS: DWORD = CERT_SYSTEM_STORE_USERS_ID + << CERT_SYSTEM_STORE_LOCATION_SHIFT; +pub const CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY: DWORD + = CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT; +pub const CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY: DWORD + = CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT; +pub const CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE: DWORD + = CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT; +pub const CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH: &'static str + = "Software\\Policies\\Microsoft\\SystemCertificates"; +pub const CERT_EFSBLOB_REGPATH: &'static str + = "Software\\Policies\\Microsoft\\SystemCertificates\\EFS"; +pub const CERT_EFSBLOB_VALUE_NAME: &'static str = "EFSBlob"; +pub const CERT_PROT_ROOT_FLAGS_REGPATH: &'static str + = "Software\\Policies\\Microsoft\\SystemCertificates\\Root\\ProtectedRoots"; +pub const CERT_PROT_ROOT_FLAGS_VALUE_NAME: &'static str = "Flags"; +pub const CERT_PROT_ROOT_DISABLE_CURRENT_USER_FLAG: DWORD = 0x1; +pub const CERT_PROT_ROOT_INHIBIT_ADD_AT_INIT_FLAG: DWORD = 0x2; +pub const CERT_PROT_ROOT_INHIBIT_PURGE_LM_FLAG: DWORD = 0x4; +pub const CERT_PROT_ROOT_DISABLE_LM_AUTH_FLAG: DWORD = 0x8; +pub const CERT_PROT_ROOT_ONLY_LM_GPT_FLAG: DWORD = 0x8; +pub const CERT_PROT_ROOT_DISABLE_NT_AUTH_REQUIRED_FLAG: DWORD = 0x10; +pub const CERT_PROT_ROOT_DISABLE_NOT_DEFINED_NAME_CONSTRAINT_FLAG: DWORD = 0x20; +pub const CERT_PROT_ROOT_DISABLE_PEER_TRUST: DWORD = 0x10000; +pub const CERT_PROT_ROOT_PEER_USAGES_VALUE_NAME: &'static str = "PeerUsages"; +pub const CERT_PROT_ROOT_PEER_USAGES_VALUE_NAME_A: &'static str = "PeerUsages"; +pub const CERT_PROT_ROOT_PEER_USAGES_DEFAULT_A: &'static str + = "1.3.6.1.5.5.7.3.2\01.3.6.1.5.5.7.3.4\01.3.6.1.4.1.311.10.3.4\0"; +pub const CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH: &'static str + = "Software\\Policies\\Microsoft\\SystemCertificates\\TrustedPublisher\\Safer"; +pub const CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH: &'static str + = "Software\\Microsoft\\SystemCertificates"; +pub const CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH: &'static str + = "Software\\Microsoft\\SystemCertificates\\TrustedPublisher\\Safer"; +pub const CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME: &'static str = "AuthenticodeFlags"; +pub const CERT_TRUST_PUB_ALLOW_TRUST_MASK: DWORD = 0x00000003; +pub const CERT_TRUST_PUB_ALLOW_END_USER_TRUST: DWORD = 0x00000000; +pub const CERT_TRUST_PUB_ALLOW_MACHINE_ADMIN_TRUST: DWORD = 0x00000001; +pub const CERT_TRUST_PUB_ALLOW_ENTERPRISE_ADMIN_TRUST: DWORD = 0x00000002; +pub const CERT_TRUST_PUB_CHECK_PUBLISHER_REV_FLAG: DWORD = 0x00000100; +pub const CERT_TRUST_PUB_CHECK_TIMESTAMP_REV_FLAG: DWORD = 0x00000200; +pub const CERT_OCM_SUBCOMPONENTS_LOCAL_MACHINE_REGPATH: &'static str + = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OC Manager\\Subcomponents"; +pub const CERT_OCM_SUBCOMPONENTS_ROOT_AUTO_UPDATE_VALUE_NAME: &'static str = "RootAutoUpdate"; +pub const CERT_DISABLE_ROOT_AUTO_UPDATE_REGPATH: &'static str + = "Software\\Policies\\Microsoft\\SystemCertificates\\AuthRoot"; +pub const CERT_DISABLE_ROOT_AUTO_UPDATE_VALUE_NAME: &'static str = "DisableRootAutoUpdate"; +pub const CERT_ENABLE_DISALLOWED_CERT_AUTO_UPDATE_VALUE_NAME: &'static str + = "EnableDisallowedCertAutoUpdate"; +pub const CERT_DISABLE_PIN_RULES_AUTO_UPDATE_VALUE_NAME: &'static str + = "DisablePinRulesAutoUpdate"; +pub const CERT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH: &'static str + = "Software\\Microsoft\\SystemCertificates\\AuthRoot\\AutoUpdate"; +pub const CERT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME: &'static str = "RootDirUrl"; +pub const CERT_AUTO_UPDATE_SYNC_FROM_DIR_URL_VALUE_NAME: &'static str = "SyncFromDirUrl"; +pub const CERT_AUTH_ROOT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH: &'static str + = CERT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH; +pub const CERT_AUTH_ROOT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME: &'static str + = CERT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME; +pub const CERT_AUTH_ROOT_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME: &'static str = "SyncDeltaTime"; +pub const CERT_AUTH_ROOT_AUTO_UPDATE_FLAGS_VALUE_NAME: &'static str = "Flags"; +pub const CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_UNTRUSTED_ROOT_LOGGING_FLAG: DWORD = 0x1; +pub const CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_PARTIAL_CHAIN_LOGGING_FLAG: DWORD = 0x2; +pub const CERT_AUTO_UPDATE_DISABLE_RANDOM_QUERY_STRING_FLAG: DWORD = 0x4; +pub const CERT_AUTH_ROOT_AUTO_UPDATE_LAST_SYNC_TIME_VALUE_NAME: &'static str = "LastSyncTime"; +pub const CERT_AUTH_ROOT_AUTO_UPDATE_ENCODED_CTL_VALUE_NAME: &'static str = "EncodedCt"; +pub const CERT_AUTH_ROOT_CTL_FILENAME: &'static str = "authroot.st"; +pub const CERT_AUTH_ROOT_CTL_FILENAME_A: &'static str = "authroot.st"; +pub const CERT_AUTH_ROOT_CAB_FILENAME: &'static str = "authrootstl.cab"; +pub const CERT_AUTH_ROOT_SEQ_FILENAME: &'static str = "authrootseq.txt"; +pub const CERT_AUTH_ROOT_CERT_EXT: &'static str = ".crt"; +pub const CERT_DISALLOWED_CERT_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME: &'static str + = "DisallowedCertSyncDeltaTime"; +pub const CERT_DISALLOWED_CERT_AUTO_UPDATE_LAST_SYNC_TIME_VALUE_NAME: &'static str + = "DisallowedCertLastSyncTime"; +pub const CERT_DISALLOWED_CERT_AUTO_UPDATE_ENCODED_CTL_VALUE_NAME: &'static str + = "DisallowedCertEncodedCt"; +pub const CERT_DISALLOWED_CERT_CTL_FILENAME: &'static str = "disallowedcert.st"; +pub const CERT_DISALLOWED_CERT_CTL_FILENAME_A: &'static str = "disallowedcert.st"; +pub const CERT_DISALLOWED_CERT_CAB_FILENAME: &'static str = "disallowedcertstl.cab"; +pub const CERT_DISALLOWED_CERT_AUTO_UPDATE_LIST_IDENTIFIER: &'static str + = "DisallowedCert_AutoUpdate_1"; +pub const CERT_PIN_RULES_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME: &'static str + = "PinRulesSyncDeltaTime"; +pub const CERT_PIN_RULES_AUTO_UPDATE_LAST_SYNC_TIME_VALUE_NAME: &'static str + = "PinRulesLastSyncTime"; +pub const CERT_PIN_RULES_AUTO_UPDATE_ENCODED_CTL_VALUE_NAME: &'static str = "PinRulesEncodedCt"; +pub const CERT_PIN_RULES_CTL_FILENAME: &'static str = "pinrules.st"; +pub const CERT_PIN_RULES_CTL_FILENAME_A: &'static str = "pinrules.st"; +pub const CERT_PIN_RULES_CAB_FILENAME: &'static str = "pinrulesstl.cab"; +pub const CERT_PIN_RULES_AUTO_UPDATE_LIST_IDENTIFIER: &'static str = "PinRules_AutoUpdate_1"; +pub const CERT_REGISTRY_STORE_REMOTE_FLAG: DWORD = 0x10000; +pub const CERT_REGISTRY_STORE_SERIALIZED_FLAG: DWORD = 0x20000; +pub const CERT_REGISTRY_STORE_CLIENT_GPT_FLAG: DWORD = 0x80000000; +pub const CERT_REGISTRY_STORE_LM_GPT_FLAG: DWORD = 0x01000000; +STRUCT!{struct CERT_REGISTRY_STORE_CLIENT_GPT_PARA { + hKeyBase: HKEY, + pwszRegPath: LPWSTR, +}} +pub type PCERT_REGISTRY_STORE_CLIENT_GPT_PARA = *mut CERT_REGISTRY_STORE_CLIENT_GPT_PARA; +pub const CERT_REGISTRY_STORE_ROAMING_FLAG: DWORD = 0x40000; +STRUCT!{struct CERT_REGISTRY_STORE_ROAMING_PARA { + hKeyBase: HKEY, + pwszStoreDirectory: LPWSTR, +}} +pub type PCERT_REGISTRY_STORE_ROAMING_PARA = *mut CERT_REGISTRY_STORE_ROAMING_PARA; +pub const CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG: DWORD = 0x80000; +pub const CERT_REGISTRY_STORE_EXTERNAL_FLAG: DWORD = 0x100000; +pub const CERT_IE_DIRTY_FLAGS_REGPATH: &'static str + = "Software\\Microsoft\\Cryptography\\IEDirtyFlags"; +pub const CERT_FILE_STORE_COMMIT_ENABLE_FLAG: DWORD = 0x10000; +pub const CERT_LDAP_STORE_SIGN_FLAG: DWORD = 0x10000; +pub const CERT_LDAP_STORE_AREC_EXCLUSIVE_FLAG: DWORD = 0x20000; +pub const CERT_LDAP_STORE_OPENED_FLAG: DWORD = 0x40000; +STRUCT!{struct CERT_LDAP_STORE_OPENED_PARA { + pvLdapSessionHandle: *mut c_void, + pwszLdapUrl: LPCWSTR, +}} +pub type PCERT_LDAP_STORE_OPENED_PARA = *mut CERT_LDAP_STORE_OPENED_PARA; +pub const CERT_LDAP_STORE_UNBIND_FLAG: DWORD = 0x80000; +extern "system" { + pub fn CertOpenStore( + lpszStoreProvider: LPCSTR, + dwEncodingType: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + dwFlags: DWORD, + pvPara: *const c_void, + ) -> HCERTSTORE; +} +pub type HCERTSTOREPROV = *mut c_void; +pub const CRYPT_OID_OPEN_STORE_PROV_FUNC: &'static str = "CertDllOpenStoreProv"; +STRUCT!{struct CERT_STORE_PROV_INFO { + cbSize: DWORD, + cStoreProvFunc: DWORD, + rgpvStoreProvFunc: *mut *mut c_void, + hStoreProv: HCERTSTOREPROV, + dwStoreProvFlags: DWORD, + hStoreProvFuncAddr2: HCRYPTOIDFUNCADDR, +}} +pub type PCERT_STORE_PROV_INFO = *mut CERT_STORE_PROV_INFO; +FN!{stdcall PFN_CERT_DLL_OPEN_STORE_PROV_FUNC( + lpszStoreProvider: LPCSTR, + dwEncodingType: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + dwFlags: DWORD, + pvPara: *const c_void, + hCertStore: HCERTSTORE, + pStoreProvInfo: PCERT_STORE_PROV_INFO, +) -> BOOL} +pub const CERT_STORE_PROV_EXTERNAL_FLAG: DWORD = 0x1; +pub const CERT_STORE_PROV_DELETED_FLAG: DWORD = 0x2; +pub const CERT_STORE_PROV_NO_PERSIST_FLAG: DWORD = 0x4; +pub const CERT_STORE_PROV_SYSTEM_STORE_FLAG: DWORD = 0x8; +pub const CERT_STORE_PROV_LM_SYSTEM_STORE_FLAG: DWORD = 0x10; +pub const CERT_STORE_PROV_GP_SYSTEM_STORE_FLAG: DWORD = 0x20; +pub const CERT_STORE_PROV_SHARED_USER_FLAG: DWORD = 0x40; +pub const CERT_STORE_PROV_CLOSE_FUNC: DWORD = 0; +pub const CERT_STORE_PROV_READ_CERT_FUNC: DWORD = 1; +pub const CERT_STORE_PROV_WRITE_CERT_FUNC: DWORD = 2; +pub const CERT_STORE_PROV_DELETE_CERT_FUNC: DWORD = 3; +pub const CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC: DWORD = 4; +pub const CERT_STORE_PROV_READ_CRL_FUNC: DWORD = 5; +pub const CERT_STORE_PROV_WRITE_CRL_FUNC: DWORD = 6; +pub const CERT_STORE_PROV_DELETE_CRL_FUNC: DWORD = 7; +pub const CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC: DWORD = 8; +pub const CERT_STORE_PROV_READ_CTL_FUNC: DWORD = 9; +pub const CERT_STORE_PROV_WRITE_CTL_FUNC: DWORD = 10; +pub const CERT_STORE_PROV_DELETE_CTL_FUNC: DWORD = 11; +pub const CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC: DWORD = 12; +pub const CERT_STORE_PROV_CONTROL_FUNC: DWORD = 13; +pub const CERT_STORE_PROV_FIND_CERT_FUNC: DWORD = 14; +pub const CERT_STORE_PROV_FREE_FIND_CERT_FUNC: DWORD = 15; +pub const CERT_STORE_PROV_GET_CERT_PROPERTY_FUNC: DWORD = 16; +pub const CERT_STORE_PROV_FIND_CRL_FUNC: DWORD = 17; +pub const CERT_STORE_PROV_FREE_FIND_CRL_FUNC: DWORD = 18; +pub const CERT_STORE_PROV_GET_CRL_PROPERTY_FUNC: DWORD = 19; +pub const CERT_STORE_PROV_FIND_CTL_FUNC: DWORD = 20; +pub const CERT_STORE_PROV_FREE_FIND_CTL_FUNC: DWORD = 21; +pub const CERT_STORE_PROV_GET_CTL_PROPERTY_FUNC: DWORD = 22; +FN!{stdcall PFN_CERT_STORE_PROV_CLOSE( + hStoreProv: HCERTSTOREPROV, + dwFlags: DWORD, +) -> ()} +FN!{stdcall PFN_CERT_STORE_PROV_READ_CERT( + hStoreProv: HCERTSTOREPROV, + pStoreCertContext: PCCERT_CONTEXT, + dwFlags: DWORD, + ppProvCertContext: *mut PCCERT_CONTEXT, +) -> BOOL} +pub const CERT_STORE_PROV_WRITE_ADD_FLAG: DWORD = 0x1; +FN!{stdcall PFN_CERT_STORE_PROV_WRITE_CERT( + hStoreProv: HCERTSTOREPROV, + pCertContext: PCCERT_CONTEXT, + dwFlags: DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_DELETE_CERT( + hStoreProv: HCERTSTOREPROV, + pCertContext: PCCERT_CONTEXT, + dwFlags: DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_SET_CERT_PROPERTY( + hStoreProv: HCERTSTOREPROV, + pCertContext: PCCERT_CONTEXT, + dwPropId: DWORD, + dwFlags: DWORD, + pvData: *const c_void, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_READ_CRL( + hStoreProv: HCERTSTOREPROV, + pStoreCrlContext: PCCRL_CONTEXT, + dwFlags: DWORD, + ppProvCrlContext: *mut PCCRL_CONTEXT, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_WRITE_CRL( + hStoreProv: HCERTSTOREPROV, + pCrlContext: PCCRL_CONTEXT, + dwFlags: DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_DELETE_CRL( + hStoreProv: HCERTSTOREPROV, + pCrlContext: PCCRL_CONTEXT, + dwFlags: DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_SET_CRL_PROPERTY( + hStoreProv: HCERTSTOREPROV, + pCrlContext: PCCRL_CONTEXT, + dwPropId: DWORD, + dwFlags: DWORD, + pvData: *const c_void, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_READ_CTL( + hStoreProv: HCERTSTOREPROV, + pStoreCtlContext: PCCTL_CONTEXT, + dwFlags: DWORD, + ppProvCtlContext: *mut PCCTL_CONTEXT, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_WRITE_CTL( + hStoreProv: HCERTSTOREPROV, + pCtlContext: PCCTL_CONTEXT, + dwFlags: DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_DELETE_CTL( + hStoreProv: HCERTSTOREPROV, + pCtlContext: PCCTL_CONTEXT, + dwFlags: DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_SET_CTL_PROPERTY( + hStoreProv: HCERTSTOREPROV, + pCtlContext: PCCTL_CONTEXT, + dwPropId: DWORD, + dwFlags: DWORD, + pvData: *const c_void, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_CONTROL( + hStoreProv: HCERTSTOREPROV, + dwFlags: DWORD, + dwCtrlType: DWORD, + pvCtrlPara: *const c_void, +) -> BOOL} +STRUCT!{struct CERT_STORE_PROV_FIND_INFO { + cbSize: DWORD, + dwMsgAndCertEncodingType: DWORD, + dwFindFlags: DWORD, + dwFindType: DWORD, + pvFindPara: *const c_void, +}} +pub type PCERT_STORE_PROV_FIND_INFO = *mut CERT_STORE_PROV_FIND_INFO; +pub type CCERT_STORE_PROV_FIND_INFO = CERT_STORE_PROV_FIND_INFO; +pub type PCCERT_STORE_PROV_FIND_INFO = *const CERT_STORE_PROV_FIND_INFO; +FN!{stdcall PFN_CERT_STORE_PROV_FIND_CERT( + hStoreProv: HCERTSTOREPROV, + pFindInfo: PCCERT_STORE_PROV_FIND_INFO, + pPrevCertContext: PCCERT_CONTEXT, + dwFlags: DWORD, + ppvStoreProvFindInfo: *mut *mut c_void, + ppProvCertContext: *mut PCCERT_CONTEXT, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_FREE_FIND_CERT( + hStoreProv: HCERTSTOREPROV, + pCertContext: PCCERT_CONTEXT, + pvStoreProvFindInfo: *mut c_void, + dwFlags: DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_GET_CERT_PROPERTY( + hStoreProv: HCERTSTOREPROV, + pCertContext: PCCERT_CONTEXT, + dwPropId: DWORD, + dwFlags: DWORD, + pvData: *mut c_void, + pcbData: *mut DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_FIND_CRL( + hStoreProv: HCERTSTOREPROV, + pFindInfo: PCCERT_STORE_PROV_FIND_INFO, + pPrevCrlContext: PCCRL_CONTEXT, + dwFlags: DWORD, + ppvStoreProvFindInfo: *mut *mut c_void, + ppProvCrlContext: *mut PCCRL_CONTEXT, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_FREE_FIND_CRL( + hStoreProv: HCERTSTOREPROV, + pCrlContext: PCCRL_CONTEXT, + pvStoreProvFindInfo: *mut c_void, + dwFlags: DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_GET_CRL_PROPERTY( + hStoreProv: HCERTSTOREPROV, + pCrlContext: PCCRL_CONTEXT, + dwPropId: DWORD, + dwFlags: DWORD, + pvData: *mut c_void, + pcbData: *mut DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_FIND_CTL( + hStoreProv: HCERTSTOREPROV, + pFindInfo: PCCERT_STORE_PROV_FIND_INFO, + pPrevCtlContext: PCCTL_CONTEXT, + dwFlags: DWORD, + ppvStoreProvFindInfo: *mut *mut c_void, + ppProvCtlContext: *mut PCCTL_CONTEXT, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_FREE_FIND_CTL( + hStoreProv: HCERTSTOREPROV, + pCtlContext: PCCTL_CONTEXT, + pvStoreProvFindInfo: *mut c_void, + dwFlags: DWORD, +) -> BOOL} +FN!{stdcall PFN_CERT_STORE_PROV_GET_CTL_PROPERTY( + hStoreProv: HCERTSTOREPROV, + pCtlContext: PCCTL_CONTEXT, + dwPropId: DWORD, + dwFlags: DWORD, + pvData: *mut c_void, + pcbData: *mut DWORD, +) -> BOOL} +extern "system" { + pub fn CertDuplicateStore( + hCertStore: HCERTSTORE, + ) -> HCERTSTORE; +} +pub const CERT_STORE_SAVE_AS_STORE: DWORD = 1; +pub const CERT_STORE_SAVE_AS_PKCS7: DWORD = 2; +pub const CERT_STORE_SAVE_AS_PKCS12: DWORD = 3; +pub const CERT_STORE_SAVE_TO_FILE: DWORD = 1; +pub const CERT_STORE_SAVE_TO_MEMORY: DWORD = 2; +pub const CERT_STORE_SAVE_TO_FILENAME_A: DWORD = 3; +pub const CERT_STORE_SAVE_TO_FILENAME_W: DWORD = 4; +pub const CERT_STORE_SAVE_TO_FILENAME: DWORD = CERT_STORE_SAVE_TO_FILENAME_W; +extern "system" { + pub fn CertSaveStore( + hCertStore: HCERTSTORE, + dwEncodingType: DWORD, + dwSaveAs: DWORD, + dwSaveTo: DWORD, + pvSaveToPara: *mut c_void, + dwFlags: DWORD, + ) -> BOOL; +} +pub const CERT_CLOSE_STORE_FORCE_FLAG: DWORD = 0x00000001; +pub const CERT_CLOSE_STORE_CHECK_FLAG: DWORD = 0x00000002; +extern "system" { + pub fn CertCloseStore( + hCertStore: HCERTSTORE, + dwFlags: DWORD, + ) -> BOOL; + pub fn CertGetSubjectCertificateFromStore( + hCertStore: HCERTSTORE, + dwCertEncodingType: DWORD, + pCertId: PCERT_INFO, + ) -> PCCERT_CONTEXT; + pub fn CertEnumCertificatesInStore( + hCertStore: HCERTSTORE, + pPrevCertContext: PCCERT_CONTEXT, + ) -> PCCERT_CONTEXT; + pub fn CertFindCertificateInStore( + hCertStore: HCERTSTORE, + dwCertEncodingType: DWORD, + dwFindFlags: DWORD, + dwFindType: DWORD, + pvFindPara: *const c_void, + pPrevCertContext: PCCERT_CONTEXT, + ) -> PCCERT_CONTEXT; +} +pub const CERT_COMPARE_MASK: DWORD = 0xFFFF; +pub const CERT_COMPARE_SHIFT: DWORD = 16; +pub const CERT_COMPARE_ANY: DWORD = 0; +pub const CERT_COMPARE_SHA1_HASH: DWORD = 1; +pub const CERT_COMPARE_NAME: DWORD = 2; +pub const CERT_COMPARE_ATTR: DWORD = 3; +pub const CERT_COMPARE_MD5_HASH: DWORD = 4; +pub const CERT_COMPARE_PROPERTY: DWORD = 5; +pub const CERT_COMPARE_PUBLIC_KEY: DWORD = 6; +pub const CERT_COMPARE_HASH: DWORD = CERT_COMPARE_SHA1_HASH; +pub const CERT_COMPARE_NAME_STR_A: DWORD = 7; +pub const CERT_COMPARE_NAME_STR_W: DWORD = 8; +pub const CERT_COMPARE_KEY_SPEC: DWORD = 9; +pub const CERT_COMPARE_ENHKEY_USAGE: DWORD = 10; +pub const CERT_COMPARE_CTL_USAGE: DWORD = CERT_COMPARE_ENHKEY_USAGE; +pub const CERT_COMPARE_SUBJECT_CERT: DWORD = 11; +pub const CERT_COMPARE_ISSUER_OF: DWORD = 12; +pub const CERT_COMPARE_EXISTING: DWORD = 13; +pub const CERT_COMPARE_SIGNATURE_HASH: DWORD = 14; +pub const CERT_COMPARE_KEY_IDENTIFIER: DWORD = 15; +pub const CERT_COMPARE_CERT_ID: DWORD = 16; +pub const CERT_COMPARE_CROSS_CERT_DIST_POINTS: DWORD = 17; +pub const CERT_COMPARE_PUBKEY_MD5_HASH: DWORD = 18; +pub const CERT_COMPARE_SUBJECT_INFO_ACCESS: DWORD = 19; +pub const CERT_COMPARE_HASH_STR: DWORD = 20; +pub const CERT_COMPARE_HAS_PRIVATE_KEY: DWORD = 21; +pub const CERT_FIND_ANY: DWORD = CERT_COMPARE_ANY << CERT_COMPARE_SHIFT; +pub const CERT_FIND_SHA1_HASH: DWORD = CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT; +pub const CERT_FIND_MD5_HASH: DWORD = CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT; +pub const CERT_FIND_SIGNATURE_HASH: DWORD = CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT; +pub const CERT_FIND_KEY_IDENTIFIER: DWORD = CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT; +pub const CERT_FIND_HASH: DWORD = CERT_FIND_SHA1_HASH; +pub const CERT_FIND_PROPERTY: DWORD = CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT; +pub const CERT_FIND_PUBLIC_KEY: DWORD = CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT; +pub const CERT_FIND_SUBJECT_NAME: DWORD = (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT) + | CERT_INFO_SUBJECT_FLAG; +pub const CERT_FIND_SUBJECT_ATTR: DWORD = (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT) + | CERT_INFO_SUBJECT_FLAG; +pub const CERT_FIND_ISSUER_NAME: DWORD = (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT) + | CERT_INFO_ISSUER_FLAG; +pub const CERT_FIND_ISSUER_ATTR: DWORD = (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT) + | CERT_INFO_ISSUER_FLAG; +pub const CERT_FIND_SUBJECT_STR_A: DWORD = (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT) + | CERT_INFO_SUBJECT_FLAG; +pub const CERT_FIND_SUBJECT_STR_W: DWORD = (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT) + | CERT_INFO_SUBJECT_FLAG; +pub const CERT_FIND_SUBJECT_STR: DWORD = CERT_FIND_SUBJECT_STR_W; +pub const CERT_FIND_ISSUER_STR_A: DWORD = (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT) + | CERT_INFO_ISSUER_FLAG; +pub const CERT_FIND_ISSUER_STR_W: DWORD = (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT) + | CERT_INFO_ISSUER_FLAG; +pub const CERT_FIND_ISSUER_STR: DWORD = CERT_FIND_ISSUER_STR_W; +pub const CERT_FIND_KEY_SPEC: DWORD = CERT_COMPARE_KEY_SPEC << CERT_COMPARE_SHIFT; +pub const CERT_FIND_ENHKEY_USAGE: DWORD = CERT_COMPARE_ENHKEY_USAGE << CERT_COMPARE_SHIFT; +pub const CERT_FIND_CTL_USAGE: DWORD = CERT_FIND_ENHKEY_USAGE; +pub const CERT_FIND_SUBJECT_CERT: DWORD = CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT; +pub const CERT_FIND_ISSUER_OF: DWORD = CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT; +pub const CERT_FIND_EXISTING: DWORD = CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT; +pub const CERT_FIND_CERT_ID: DWORD = CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT; +pub const CERT_FIND_CROSS_CERT_DIST_POINTS: DWORD = CERT_COMPARE_CROSS_CERT_DIST_POINTS + << CERT_COMPARE_SHIFT; +pub const CERT_FIND_PUBKEY_MD5_HASH: DWORD = CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT; +pub const CERT_FIND_SUBJECT_INFO_ACCESS: DWORD = CERT_COMPARE_SUBJECT_INFO_ACCESS + << CERT_COMPARE_SHIFT; +pub const CERT_FIND_HASH_STR: DWORD = CERT_COMPARE_HASH_STR << CERT_COMPARE_SHIFT; +pub const CERT_FIND_HAS_PRIVATE_KEY: DWORD = CERT_COMPARE_HAS_PRIVATE_KEY << CERT_COMPARE_SHIFT; +pub const CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG: DWORD = 0x1; +pub const CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG: DWORD = 0x2; +pub const CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG: DWORD = 0x4; +pub const CERT_FIND_NO_ENHKEY_USAGE_FLAG: DWORD = 0x8; +pub const CERT_FIND_OR_ENHKEY_USAGE_FLAG: DWORD = 0x10; +pub const CERT_FIND_VALID_ENHKEY_USAGE_FLAG: DWORD = 0x20; +pub const CERT_FIND_OPTIONAL_CTL_USAGE_FLAG: DWORD = CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG; +pub const CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG: DWORD = CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG; +pub const CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG: DWORD = CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG; +pub const CERT_FIND_NO_CTL_USAGE_FLAG: DWORD = CERT_FIND_NO_ENHKEY_USAGE_FLAG; +pub const CERT_FIND_OR_CTL_USAGE_FLAG: DWORD = CERT_FIND_OR_ENHKEY_USAGE_FLAG; +pub const CERT_FIND_VALID_CTL_USAGE_FLAG: DWORD = CERT_FIND_VALID_ENHKEY_USAGE_FLAG; +extern "system" { + pub fn CertGetIssuerCertificateFromStore( + hCertStore: HCERTSTORE, + pSubjectContext: PCCERT_CONTEXT, + pPrevIssuerContext: PCCERT_CONTEXT, + pdwFlags: *mut DWORD, + ) -> PCCERT_CONTEXT; + pub fn CertVerifySubjectCertificateContext( + pSubject: PCCERT_CONTEXT, + pIssuer: PCCERT_CONTEXT, + pdwFlags: *mut DWORD, + ) -> BOOL; + pub fn CertDuplicateCertificateContext( + pCertContext: PCCERT_CONTEXT, + ) -> PCCERT_CONTEXT; + pub fn CertCreateCertificateContext( + dwCertEncodingType: DWORD, + pbCertEncoded: *const BYTE, + cbCertEncoded: DWORD, + ) -> PCCERT_CONTEXT; + pub fn CertFreeCertificateContext( + pCertContext: PCCERT_CONTEXT, + ) -> BOOL; + pub fn CertSetCertificateContextProperty( + pCertContext: PCCERT_CONTEXT, + dwPropId: DWORD, + dwFlags: DWORD, + pvData: *const c_void, + ) -> BOOL; +} +pub const CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG: DWORD = 0x80000000; +pub const CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG: DWORD = 0x40000000; +extern "system" { + pub fn CertGetCertificateContextProperty( + pCertContext: PCCERT_CONTEXT, + dwPropId: DWORD, + pvData: *mut c_void, + pcbData: *mut DWORD, + ) -> BOOL; + pub fn CertEnumCertificateContextProperties( + pCertContext: PCCERT_CONTEXT, + dwPropId: DWORD, + ) -> DWORD; + pub fn CertCreateCTLEntryFromCertificateContextProperties( + pCertContext: PCCERT_CONTEXT, + cOptAttr: DWORD, + rgOptAttr: PCRYPT_ATTRIBUTE, + dwFlags: DWORD, + pvReserved: *mut c_void, + pCtlEntry: PCTL_ENTRY, + pcbCtlEntry: *mut DWORD, + ) -> BOOL; + pub fn CertSetCertificateContextPropertiesFromCTLEntry( + pCertContext: PCCERT_CONTEXT, + pCtlEntry: PCTL_ENTRY, + dwFlags: DWORD, + ) -> BOOL; + pub fn CertGetCRLFromStore( + hCertStore: HCERTSTORE, + pIssuerContext: PCCERT_CONTEXT, + pPrevCrlContext: PCCRL_CONTEXT, + pdwFlags: *mut DWORD, + ) -> PCCRL_CONTEXT; + pub fn CertEnumCRLsInStore( + hCertStore: HCERTSTORE, + pPrevCrlContext: PCCRL_CONTEXT, + ) -> PCCRL_CONTEXT; + pub fn CertFindCRLInStore( + hCertStore: HCERTSTORE, + dwCertEncodingType: DWORD, + dwFindFlags: DWORD, + dwFindType: DWORD, + pvFindPara: *const c_void, + pPrevCrlContext: PCCRL_CONTEXT, + ) -> PCCRL_CONTEXT; +} +pub const CRL_FIND_ANY: DWORD = 0; +pub const CRL_FIND_ISSUED_BY: DWORD = 1; +pub const CRL_FIND_EXISTING: DWORD = 2; +pub const CRL_FIND_ISSUED_FOR: DWORD = 3; +pub const CRL_FIND_ISSUED_BY_AKI_FLAG: DWORD = 0x1; +pub const CRL_FIND_ISSUED_BY_SIGNATURE_FLAG: DWORD = 0x2; +pub const CRL_FIND_ISSUED_BY_DELTA_FLAG: DWORD = 0x4; +pub const CRL_FIND_ISSUED_BY_BASE_FLAG: DWORD = 0x8; +STRUCT!{struct CRL_FIND_ISSUED_FOR_PARA { + pSubjectCert: PCCERT_CONTEXT, + pIssuerCert: PCCERT_CONTEXT, +}} +pub type PCRL_FIND_ISSUED_FOR_PARA = *mut CRL_FIND_ISSUED_FOR_PARA; +pub const CRL_FIND_ISSUED_FOR_SET_STRONG_PROPERTIES_FLAG: DWORD = 0x10; +extern "system" { + pub fn CertDuplicateCRLContext( + pCrlContext: PCCRL_CONTEXT, + ) -> PCCRL_CONTEXT; + pub fn CertCreateCRLContext( + dwCertEncodingType: DWORD, + pbCrlEncoded: *const BYTE, + cbCrlEncoded: DWORD, + ) -> PCCRL_CONTEXT; + pub fn CertFreeCRLContext( + pCrlContext: PCCRL_CONTEXT, + ) -> BOOL; + pub fn CertSetCRLContextProperty( + pCrlContext: PCCRL_CONTEXT, + dwPropId: DWORD, + dwFlags: DWORD, + pvData: *const c_void, + ) -> BOOL; + pub fn CertGetCRLContextProperty( + pCrlContext: PCCRL_CONTEXT, + dwPropId: DWORD, + pvData: *mut c_void, + pcbData: *mut DWORD, + ) -> BOOL; + pub fn CertEnumCRLContextProperties( + pCrlContext: PCCRL_CONTEXT, + dwPropId: DWORD, + ) -> DWORD; + pub fn CertFindCertificateInCRL( + pCert: PCCERT_CONTEXT, + pCrlContext: PCCRL_CONTEXT, + dwFlags: DWORD, + pvReserved: *mut c_void, + ppCrlEntry: *mut PCRL_ENTRY, + ) -> BOOL; + pub fn CertIsValidCRLForCertificate( + pCert: PCCERT_CONTEXT, + pCrl: PCCRL_CONTEXT, + dwFlags: DWORD, + pvReserved: *mut c_void, + ) -> BOOL; +} +pub const CERT_STORE_ADD_NEW: DWORD = 1; +pub const CERT_STORE_ADD_USE_EXISTING: DWORD = 2; +pub const CERT_STORE_ADD_REPLACE_EXISTING: DWORD = 3; +pub const CERT_STORE_ADD_ALWAYS: DWORD = 4; +pub const CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES: DWORD = 5; +pub const CERT_STORE_ADD_NEWER: DWORD = 6; +pub const CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES: DWORD = 7; +extern "system" { + pub fn CertAddEncodedCertificateToStore( + hCertStore: HCERTSTORE, + dwCertEncodingType: DWORD, + pbCertEncoded: *const BYTE, + cbCertEncoded: DWORD, + dwAddDisposition: DWORD, + ppCertContext: *mut PCCERT_CONTEXT, + ) -> BOOL; + pub fn CertAddCertificateContextToStore( + hCertStore: HCERTSTORE, + pCertContext: PCCERT_CONTEXT, + dwAddDisposition: DWORD, + ppStoreContext: *mut PCCERT_CONTEXT, + ) -> BOOL; +} +pub const CERT_STORE_CERTIFICATE_CONTEXT: DWORD = 1; +pub const CERT_STORE_CRL_CONTEXT: DWORD = 2; +pub const CERT_STORE_CTL_CONTEXT: DWORD = 3; +pub const CERT_STORE_ALL_CONTEXT_FLAG: DWORD = !0; +pub const CERT_STORE_CERTIFICATE_CONTEXT_FLAG: DWORD = 1 << CERT_STORE_CERTIFICATE_CONTEXT; +pub const CERT_STORE_CRL_CONTEXT_FLAG: DWORD = 1 << CERT_STORE_CRL_CONTEXT; +pub const CERT_STORE_CTL_CONTEXT_FLAG: DWORD = 1 << CERT_STORE_CTL_CONTEXT; +extern "system" { + pub fn CertAddSerializedElementToStore( + hCertStore: HCERTSTORE, + pbElement: *const BYTE, + cbElement: DWORD, + dwAddDisposition: DWORD, + dwFlags: DWORD, + dwContextTypeFlags: DWORD, + pdwContextType: *mut DWORD, + ppvContext: *mut *const c_void, + ) -> BOOL; + pub fn CertDeleteCertificateFromStore( + pCertContext: PCCERT_CONTEXT, + ) -> BOOL; + pub fn CertAddEncodedCRLToStore( + hCertStore: HCERTSTORE, + dwCertEncodingType: DWORD, + pbCrlEncoded: *const BYTE, + cbCrlEncoded: DWORD, + dwAddDisposition: DWORD, + ppCrlContext: *mut PCCRL_CONTEXT, + ) -> BOOL; + pub fn CertAddCRLContextToStore( + hCertStore: HCERTSTORE, + pCrlContext: PCCRL_CONTEXT, + dwAddDisposition: DWORD, + ppStoreContext: *mut PCCRL_CONTEXT, + ) -> BOOL; + pub fn CertDeleteCRLFromStore( + pCrlContext: PCCRL_CONTEXT, + ) -> BOOL; + pub fn CertSerializeCertificateStoreElement( + pCertContext: PCCERT_CONTEXT, + dwFlags: DWORD, + pbElement: *mut BYTE, + pcbElement: *mut DWORD, + ) -> BOOL; + pub fn CertSerializeCRLStoreElement( + pCrlContext: PCCRL_CONTEXT, + dwFlags: DWORD, + pbElement: *mut BYTE, + pcbElement: *mut DWORD, + ) -> BOOL; + pub fn CertDuplicateCTLContext( + pCtlContext: PCCTL_CONTEXT, + ) -> PCCTL_CONTEXT; + pub fn CertCreateCTLContext( + dwMsgAndCertEncodingType: DWORD, + pbCtlEncoded: *const BYTE, + cbCtlEncoded: DWORD, + ) -> PCCTL_CONTEXT; + pub fn CertFreeCTLContext( + pCtlContext: PCCTL_CONTEXT, + ) -> BOOL; + pub fn CertSetCTLContextProperty( + pCtlContext: PCCTL_CONTEXT, + dwPropId: DWORD, + dwFlags: DWORD, + pvData: *const c_void, + ) -> BOOL; + pub fn CertGetCTLContextProperty( + pCtlContext: PCCTL_CONTEXT, + dwPropId: DWORD, + pvData: *mut c_void, + pcbData: *mut DWORD, + ) -> BOOL; + pub fn CertEnumCTLContextProperties( + pCtlContext: PCCTL_CONTEXT, + dwPropId: DWORD, + ) -> DWORD; + pub fn CertEnumCTLsInStore( + hCertStore: HCERTSTORE, + pPrevCtlContext: PCCTL_CONTEXT, + ) -> PCCTL_CONTEXT; + pub fn CertFindSubjectInCTL( + dwEncodingType: DWORD, + dwSubjectType: DWORD, + pvSubject: *mut c_void, + pCtlContext: PCCTL_CONTEXT, + dwFlags: DWORD, + ) -> PCTL_ENTRY; +} +pub const CTL_ANY_SUBJECT_TYPE: DWORD = 1; +pub const CTL_CERT_SUBJECT_TYPE: DWORD = 2; +STRUCT!{struct CTL_ANY_SUBJECT_INFO { + SubjectAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + SubjectIdentifier: CRYPT_DATA_BLOB, +}} +pub type PCTL_ANY_SUBJECT_INFO = *mut CTL_ANY_SUBJECT_INFO; +extern "system" { + pub fn CertFindCTLInStore( + hCertStore: HCERTSTORE, + dwMsgAndCertEncodingType: DWORD, + dwFindFlags: DWORD, + dwFindType: DWORD, + pvFindPara: *const c_void, + pPrevCtlContext: PCCTL_CONTEXT, + ) -> PCCTL_CONTEXT; +} +pub const CTL_FIND_ANY: DWORD = 0; +pub const CTL_FIND_SHA1_HASH: DWORD = 1; +pub const CTL_FIND_MD5_HASH: DWORD = 2; +pub const CTL_FIND_USAGE: DWORD = 3; +pub const CTL_FIND_SUBJECT: DWORD = 4; +pub const CTL_FIND_EXISTING: DWORD = 5; +STRUCT!{struct CTL_FIND_USAGE_PARA { + cbSize: DWORD, + SubjectUsage: CTL_USAGE, + ListIdentifier: CRYPT_DATA_BLOB, + pSigner: PCERT_INFO, +}} +pub type PCTL_FIND_USAGE_PARA = *mut CTL_FIND_USAGE_PARA; +pub const CTL_FIND_NO_LIST_ID_CBDATA: DWORD = 0xFFFFFFFF; +pub const CTL_FIND_NO_SIGNER_PTR: PCERT_INFO = -1isize as PCERT_INFO; +pub const CTL_FIND_SAME_USAGE_FLAG: DWORD = 0x1; +STRUCT!{struct CTL_FIND_SUBJECT_PARA { + cbSize: DWORD, + pUsagePara: PCTL_FIND_USAGE_PARA, + dwSubjectType: DWORD, + pvSubject: *mut c_void, +}} +pub type PCTL_FIND_SUBJECT_PARA = *mut CTL_FIND_SUBJECT_PARA; +extern "system" { + pub fn CertAddEncodedCTLToStore( + hCertStore: HCERTSTORE, + dwMsgAndCertEncodingType: DWORD, + pbCtlEncoded: *const BYTE, + cbCtlEncoded: DWORD, + dwAddDisposition: DWORD, + ppCtlContext: *mut PCCTL_CONTEXT, + ) -> BOOL; + pub fn CertAddCTLContextToStore( + hCertStore: HCERTSTORE, + pCtlContext: PCCTL_CONTEXT, + dwAddDisposition: DWORD, + ppStoreContext: *mut PCCTL_CONTEXT, + ) -> BOOL; + pub fn CertSerializeCTLStoreElement( + pCtlContext: PCCTL_CONTEXT, + dwFlags: DWORD, + pbElement: *mut BYTE, + pcbElement: *mut DWORD, + ) -> BOOL; + pub fn CertDeleteCTLFromStore( + pCtlContext: PCCTL_CONTEXT, + ) -> BOOL; + pub fn CertAddCertificateLinkToStore( + hCertStore: HCERTSTORE, + pCertContext: PCCERT_CONTEXT, + dwAddDisposition: DWORD, + ppStoreContext: *mut PCCERT_CONTEXT, + ) -> BOOL; + pub fn CertAddCRLLinkToStore( + hCertStore: HCERTSTORE, + pCrlContext: PCCRL_CONTEXT, + dwAddDisposition: DWORD, + ppStoreContext: *mut PCCRL_CONTEXT, + ) -> BOOL; + pub fn CertAddCTLLinkToStore( + hCertStore: HCERTSTORE, + pCtlContext: PCCTL_CONTEXT, + dwAddDisposition: DWORD, + ppStoreContext: *mut PCCTL_CONTEXT, + ) -> BOOL; + pub fn CertAddStoreToCollection( + hCollectionStore: HCERTSTORE, + hSiblingStore: HCERTSTORE, + dwUpdateFlags: DWORD, + dwPriority: DWORD, + ) -> BOOL; + pub fn CertRemoveStoreFromCollection( + hCollectionStore: HCERTSTORE, + hSiblingStore: HCERTSTORE, + ); + pub fn CertControlStore( + hCertStore: HCERTSTORE, + dwFlags: DWORD, + dwCtrlType: DWORD, + pvCtrlPara: *const c_void, + ) -> BOOL; +} +pub const CERT_STORE_CTRL_RESYNC: DWORD = 1; +pub const CERT_STORE_CTRL_NOTIFY_CHANGE: DWORD = 2; +pub const CERT_STORE_CTRL_COMMIT: DWORD = 3; +pub const CERT_STORE_CTRL_AUTO_RESYNC: DWORD = 4; +pub const CERT_STORE_CTRL_CANCEL_NOTIFY: DWORD = 5; +pub const CERT_STORE_CTRL_INHIBIT_DUPLICATE_HANDLE_FLAG: DWORD = 0x1; +pub const CERT_STORE_CTRL_COMMIT_FORCE_FLAG: DWORD = 0x1; +pub const CERT_STORE_CTRL_COMMIT_CLEAR_FLAG: DWORD = 0x2; +pub const CERT_STORE_LOCALIZED_NAME_PROP_ID: DWORD = 0x1000; +extern "system" { + pub fn CertSetStoreProperty( + hCertStore: HCERTSTORE, + dwPropId: DWORD, + dwFlags: DWORD, + pvData: *const c_void, + ) -> BOOL; + pub fn CertGetStoreProperty( + hCertStore: HCERTSTORE, + dwPropId: DWORD, + pvData: *mut c_void, + pcbData: *mut DWORD, + ) -> BOOL; +} +FN!{stdcall PFN_CERT_CREATE_CONTEXT_SORT_FUNC( + cbTotalEncoded: DWORD, + cbRemainEncoded: DWORD, + cEntry: DWORD, + pvSort: *mut c_void, +) -> BOOL} +STRUCT!{struct CERT_CREATE_CONTEXT_PARA { + cbSize: DWORD, + pfnFree: PFN_CRYPT_FREE, + pvFree: *mut c_void, + pfnSort: PFN_CERT_CREATE_CONTEXT_SORT_FUNC, + pvSort: *mut c_void, +}} +pub type PCERT_CREATE_CONTEXT_PARA = *mut CERT_CREATE_CONTEXT_PARA; +extern "system" { + pub fn CertCreateContext( + dwContextType: DWORD, + dwEncodingType: DWORD, + pbEncoded: *const BYTE, + cbEncoded: DWORD, + dwFlags: DWORD, + pCreatePara: PCERT_CREATE_CONTEXT_PARA, + ) -> *const c_void; +} +pub const CERT_CREATE_CONTEXT_NOCOPY_FLAG: DWORD = 0x1; +pub const CERT_CREATE_CONTEXT_SORTED_FLAG: DWORD = 0x2; +pub const CERT_CREATE_CONTEXT_NO_HCRYPTMSG_FLAG: DWORD = 0x4; +pub const CERT_CREATE_CONTEXT_NO_ENTRY_FLAG: DWORD = 0x8; +STRUCT!{struct CERT_SYSTEM_STORE_INFO { + cbSize: DWORD, +}} +pub type PCERT_SYSTEM_STORE_INFO = *mut CERT_SYSTEM_STORE_INFO; +STRUCT!{struct CERT_PHYSICAL_STORE_INFO { + cbSize: DWORD, + pszOpenStoreProvider: LPSTR, + dwOpenEncodingType: DWORD, + dwOpenFlags: DWORD, + OpenParameters: CRYPT_DATA_BLOB, + dwFlags: DWORD, + dwPriority: DWORD, +}} +pub type PCERT_PHYSICAL_STORE_INFO = *mut CERT_PHYSICAL_STORE_INFO; +pub const CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG: DWORD = 0x1; +pub const CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG: DWORD = 0x2; +pub const CERT_PHYSICAL_STORE_REMOTE_OPEN_DISABLE_FLAG: DWORD = 0x4; +pub const CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG: DWORD = 0x8; +extern "system" { + pub fn CertRegisterSystemStore( + pvSystemStore: *const c_void, + dwFlags: DWORD, + pStoreInfo: PCERT_SYSTEM_STORE_INFO, + pvReserved: *mut c_void, + ) -> BOOL; + pub fn CertRegisterPhysicalStore( + pvSystemStore: *const c_void, + dwFlags: DWORD, + pwszStoreName: LPCWSTR, + pStoreInfo: PCERT_PHYSICAL_STORE_INFO, + pvReserved: *mut c_void, + ) -> BOOL; + pub fn CertUnregisterSystemStore( + pvSystemStore: *const c_void, + dwFlags: DWORD, + ) -> BOOL; + pub fn CertUnregisterPhysicalStore( + pvSystemStore: *const c_void, + dwFlags: DWORD, + pwszStoreName: LPCWSTR, + ) -> BOOL; +} +FN!{stdcall PFN_CERT_ENUM_SYSTEM_STORE_LOCATION( + pwszStoreLocation: LPCWSTR, + dwFlags: DWORD, + pvReserved: *mut c_void, + pvArg: *mut c_void, +) -> BOOL} +FN!{stdcall PFN_CERT_ENUM_SYSTEM_STORE( + pvSystemStore: *const c_void, + dwFlags: DWORD, + pStoreInfo: PCERT_SYSTEM_STORE_INFO, + pvReserved: *mut c_void, + pvArg: *mut c_void, +) -> BOOL} +FN!{stdcall PFN_CERT_ENUM_PHYSICAL_STORE( + pvSystemStore: *const c_void, + dwFlags: DWORD, + pwszStoreName: LPCWSTR, + pStoreInfo: PCERT_PHYSICAL_STORE_INFO, + pvReserved: *mut c_void, + pvArg: *mut c_void, +) -> BOOL} +pub const CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG: DWORD = 0x1; +pub const CERT_PHYSICAL_STORE_DEFAULT_NAME: &'static str = ".Default"; +pub const CERT_PHYSICAL_STORE_GROUP_POLICY_NAME: &'static str = ".GroupPolicy"; +pub const CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME: &'static str = ".LocalMachine"; +pub const CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME: &'static str = ".UserCertificate"; +pub const CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME: &'static str + = ".LocalMachineGroupPolicy"; +pub const CERT_PHYSICAL_STORE_ENTERPRISE_NAME: &'static str = ".Enterprise"; +pub const CERT_PHYSICAL_STORE_AUTH_ROOT_NAME: &'static str = ".AuthRoot"; +pub const CERT_PHYSICAL_STORE_SMART_CARD_NAME: &'static str = ".SmartCard"; +extern "system" { + pub fn CertEnumSystemStoreLocation( + dwFlags: DWORD, + pvArg: *mut c_void, + pfnEnum: PFN_CERT_ENUM_SYSTEM_STORE_LOCATION, + ) -> BOOL; + pub fn CertEnumSystemStore( + dwFlags: DWORD, + pvSystemStoreLocationPara: *mut c_void, + pvArg: *mut c_void, + pfnEnum: PFN_CERT_ENUM_SYSTEM_STORE, + ) -> BOOL; + pub fn CertEnumPhysicalStore( + pvSystemStore: *const c_void, + dwFlags: DWORD, + pvArg: *mut c_void, + pfnEnum: PFN_CERT_ENUM_PHYSICAL_STORE, + ) -> BOOL; +} +pub const CRYPT_OID_OPEN_SYSTEM_STORE_PROV_FUNC: &'static str = "CertDllOpenSystemStoreProv"; +pub const CRYPT_OID_REGISTER_SYSTEM_STORE_FUNC: &'static str = "CertDllRegisterSystemStore"; +pub const CRYPT_OID_UNREGISTER_SYSTEM_STORE_FUNC: &'static str = "CertDllUnregisterSystemStore"; +pub const CRYPT_OID_ENUM_SYSTEM_STORE_FUNC: &'static str = "CertDllEnumSystemStore"; +pub const CRYPT_OID_REGISTER_PHYSICAL_STORE_FUNC: &'static str = "CertDllRegisterPhysicalStore"; +pub const CRYPT_OID_UNREGISTER_PHYSICAL_STORE_FUNC: &'static str + = "CertDllUnregisterPhysicalStore"; +pub const CRYPT_OID_ENUM_PHYSICAL_STORE_FUNC: &'static str = "CertDllEnumPhysicalStore"; +pub const CRYPT_OID_SYSTEM_STORE_LOCATION_VALUE_NAME: &'static str = "SystemStoreLocation"; +extern "system" { + pub fn CertGetEnhancedKeyUsage( + pCertContext: PCCERT_CONTEXT, + dwFlags: DWORD, + pUsage: PCERT_ENHKEY_USAGE, + pcbUsage: *mut DWORD, + ) -> BOOL; + pub fn CertSetEnhancedKeyUsage( + pCertContext: PCCERT_CONTEXT, + pUsage: PCERT_ENHKEY_USAGE, + ) -> BOOL; + pub fn CertAddEnhancedKeyUsageIdentifier( + pCertContext: PCCERT_CONTEXT, + pszUsageIdentifier: LPCSTR, + ) -> BOOL; + pub fn CertRemoveEnhancedKeyUsageIdentifier( + pCertContext: PCCERT_CONTEXT, + pszUsageIdentifier: LPCSTR, + ) -> BOOL; + pub fn CertGetValidUsages( + cCerts: DWORD, + rghCerts: *mut PCCERT_CONTEXT, + cNumOIDs: *mut c_int, + rghOIDs: *mut LPSTR, + pcbOIDs: *mut DWORD, + ) -> BOOL; + pub fn CryptMsgGetAndVerifySigner( + hCryptMsg: HCRYPTMSG, + cSignerStore: DWORD, + rghSignerStore: *mut HCERTSTORE, + dwFlags: DWORD, + ppSigner: *mut PCCERT_CONTEXT, + pdwSignerIndex: *mut DWORD, + ) -> BOOL; +} +pub const CMSG_TRUSTED_SIGNER_FLAG: DWORD = 0x1; +pub const CMSG_SIGNER_ONLY_FLAG: DWORD = 0x2; +pub const CMSG_USE_SIGNER_INDEX_FLAG: DWORD = 0x4; +extern "system" { + pub fn CryptMsgSignCTL( + dwMsgEncodingType: DWORD, + pbCtlContent: *mut BYTE, + cbCtlContent: DWORD, + pSignInfo: PCMSG_SIGNED_ENCODE_INFO, + dwFlags: DWORD, + pbEncoded: *mut BYTE, + pcbEncoded: *mut DWORD, + ) -> BOOL; + pub fn CryptMsgEncodeAndSignCTL( + dwMsgEncodingType: DWORD, + pCtlInfo: PCTL_INFO, + pSignInfo: PCMSG_SIGNED_ENCODE_INFO, + dwFlags: DWORD, + pbEncoded: *mut BYTE, + pcbEncoded: *mut DWORD, + ) -> BOOL; +} +pub const CMSG_ENCODE_SORTED_CTL_FLAG: DWORD = 0x1; +pub const CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG: DWORD = 0x2; +extern "system" { + pub fn CertFindSubjectInSortedCTL( + pSubjectIdentifier: PCRYPT_DATA_BLOB, + pCtlContext: PCCTL_CONTEXT, + dwFlags: DWORD, + pvReserved: *mut c_void, + pEncodedAttributes: PCRYPT_DER_BLOB, + ) -> BOOL; + pub fn CertEnumSubjectInSortedCTL( + pCtlContext: PCCTL_CONTEXT, + ppvNextSubject: *mut *mut c_void, + pSubjectIdentifier: PCRYPT_DER_BLOB, + pEncodedAttributes: PCRYPT_DER_BLOB, + ) -> BOOL; +} +STRUCT!{struct CTL_VERIFY_USAGE_PARA { + cbSize: DWORD, + ListIdentifier: CRYPT_DATA_BLOB, + cCtlStore: DWORD, + rghCtlStore: *mut HCERTSTORE, + cSignerStore: DWORD, + rghSignerStore: *mut HCERTSTORE, +}} +pub type PCTL_VERIFY_USAGE_PARA = *mut CTL_VERIFY_USAGE_PARA; +STRUCT!{struct CTL_VERIFY_USAGE_STATUS { + cbSize: DWORD, + dwError: DWORD, + dwFlags: DWORD, + ppCtl: *mut PCCTL_CONTEXT, + dwCtlEntryIndex: DWORD, + ppSigner: *mut PCCERT_CONTEXT, + dwSignerIndex: DWORD, +}} +pub type PCTL_VERIFY_USAGE_STATUS = *mut CTL_VERIFY_USAGE_STATUS; +pub const CERT_VERIFY_INHIBIT_CTL_UPDATE_FLAG: DWORD = 0x1; +pub const CERT_VERIFY_TRUSTED_SIGNERS_FLAG: DWORD = 0x2; +pub const CERT_VERIFY_NO_TIME_CHECK_FLAG: DWORD = 0x4; +pub const CERT_VERIFY_ALLOW_MORE_USAGE_FLAG: DWORD = 0x8; +pub const CERT_VERIFY_UPDATED_CTL_FLAG: DWORD = 0x1; +extern "system" { + pub fn CertVerifyCTLUsage( + dwEncodingType: DWORD, + dwSubjectType: DWORD, + pvSubject: *mut c_void, + pSubjectUsage: PCTL_USAGE, + dwFlags: DWORD, + pVerifyUsagePara: PCTL_VERIFY_USAGE_PARA, + pVerifyUsageStatus: PCTL_VERIFY_USAGE_STATUS, + ) -> BOOL; +} +STRUCT!{struct CERT_REVOCATION_CRL_INFO { + cbSize: DWORD, + pBaseCrlContext: PCCRL_CONTEXT, + pDeltaCrlContext: PCCRL_CONTEXT, + pCrlEntry: PCRL_ENTRY, + fDeltaCrlEntry: BOOL, +}} +pub type PCERT_REVOCATION_CRL_INFO = *mut CERT_REVOCATION_CRL_INFO; +pub type PCERT_REVOCATION_CHAIN_PARA = *mut CERT_REVOCATION_CHAIN_PARA; +STRUCT!{struct CERT_REVOCATION_PARA { + cbSize: DWORD, + pIssuerCert: PCCERT_CONTEXT, + cCertStore: DWORD, + rgCertStore: *mut HCERTSTORE, + hCrlStore: HCERTSTORE, + pftTimeToUse: LPFILETIME, + dwUrlRetrievalTimeout: DWORD, + fCheckFreshnessTime: BOOL, + dwFreshnessTime: DWORD, + pftCurrentTime: LPFILETIME, + pCrlInfo: PCERT_REVOCATION_CRL_INFO, + pftCacheResync: LPFILETIME, + pChainPara: PCERT_REVOCATION_CHAIN_PARA, +}} +pub type PCERT_REVOCATION_PARA = *mut CERT_REVOCATION_PARA; +STRUCT!{struct CERT_REVOCATION_STATUS { + cbSize: DWORD, + dwIndex: DWORD, + dwError: DWORD, + dwReason: DWORD, + fHasFreshnessTime: BOOL, + dwFreshnessTime: DWORD, +}} +pub type PCERT_REVOCATION_STATUS = *mut CERT_REVOCATION_STATUS; +extern "system" { + pub fn CertVerifyRevocation( + dwEncodingType: DWORD, + dwRevType: DWORD, + cContext: DWORD, + rgpvContext: *mut PVOID, + dwFlags: DWORD, + pRevPara: PCERT_REVOCATION_PARA, + pRevStatus: PCERT_REVOCATION_STATUS, + ) -> BOOL; +} +pub const CERT_CONTEXT_REVOCATION_TYPE: DWORD = 1; +pub const CERT_VERIFY_REV_CHAIN_FLAG: DWORD = 0x00000001; +pub const CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION: DWORD = 0x00000002; +pub const CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG: DWORD = 0x00000004; +pub const CERT_VERIFY_REV_SERVER_OCSP_FLAG: DWORD = 0x00000008; +pub const CERT_VERIFY_REV_NO_OCSP_FAILOVER_TO_CRL_FLAG: DWORD = 0x00000010; +extern "system" { + pub fn CertCompareIntegerBlob( + pInt1: PCRYPT_INTEGER_BLOB, + pInt2: PCRYPT_INTEGER_BLOB, + ) -> BOOL; + pub fn CertCompareCertificate( + dwCertEncodingType: DWORD, + pCertId1: PCERT_INFO, + pCertId2: PCERT_INFO, + ) -> BOOL; + pub fn CertCompareCertificateName( + dwCertEncodingType: DWORD, + pCertName1: PCERT_NAME_BLOB, + pCertName2: PCERT_NAME_BLOB, + ) -> BOOL; + pub fn CertIsRDNAttrsInCertificateName( + dwCertEncodingType: DWORD, + dwFlags: DWORD, + pCertName: PCERT_NAME_BLOB, + pRDN: PCERT_RDN, + ) -> BOOL; + pub fn CertComparePublicKeyInfo( + dwCertEncodingType: DWORD, + pPublicKey1: PCERT_PUBLIC_KEY_INFO, + pPublicKey2: PCERT_PUBLIC_KEY_INFO, + ) -> BOOL; + pub fn CertGetPublicKeyLength( + dwCertEncodingType: DWORD, + pPublicKey: PCERT_PUBLIC_KEY_INFO, + ) -> DWORD; + pub fn CryptVerifyCertificateSignature( + hCryptProv: HCRYPTPROV_LEGACY, + dwCertEncodingType: DWORD, + pbEncoded: *const BYTE, + cbEncoded: DWORD, + pPublicKey: PCERT_PUBLIC_KEY_INFO, + ) -> BOOL; + pub fn CryptVerifyCertificateSignatureEx( + hCryptProv: HCRYPTPROV_LEGACY, + dwCertEncodingType: DWORD, + dwSubjectType: DWORD, + pvSubject: *mut c_void, + dwIssuerType: DWORD, + pvIssuer: *mut c_void, + dwFlags: DWORD, + pvExtra: *mut c_void, + ) -> BOOL; +} +pub const CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB: DWORD = 1; +pub const CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT: DWORD = 2; +pub const CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL: DWORD = 3; +pub const CRYPT_VERIFY_CERT_SIGN_SUBJECT_OCSP_BASIC_SIGNED_RESPONSE: DWORD = 4; +pub const CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY: DWORD = 1; +pub const CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT: DWORD = 2; +pub const CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN: DWORD = 3; +pub const CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL: DWORD = 4; +pub const CRYPT_VERIFY_CERT_SIGN_DISABLE_MD2_MD4_FLAG: DWORD = 0x00000001; +pub const CRYPT_VERIFY_CERT_SIGN_SET_STRONG_PROPERTIES_FLAG: DWORD = 0x00000002; +pub const CRYPT_VERIFY_CERT_SIGN_RETURN_STRONG_PROPERTIES_FLAG: DWORD = 0x00000004; +STRUCT!{struct CRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO { + CertSignHashCNGAlgPropData: CRYPT_DATA_BLOB, + CertIssuerPubKeyBitLengthPropData: CRYPT_DATA_BLOB, +}} +pub type PCRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO + = *mut CRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO; +STRUCT!{struct CRYPT_VERIFY_CERT_SIGN_WEAK_HASH_INFO { + cCNGHashAlgid: DWORD, + rgpwszCNGHashAlgid: *mut PCWSTR, + dwWeakIndex: DWORD, +}} +pub type PCRYPT_VERIFY_CERT_SIGN_WEAK_HASH_INFO = *mut CRYPT_VERIFY_CERT_SIGN_WEAK_HASH_INFO; +extern "system" { + pub fn CertIsStrongHashToSign( + pStrongSignPara: PCCERT_STRONG_SIGN_PARA, + pwszCNGHashAlgid: LPCWSTR, + pSigningCert: PCCERT_CONTEXT, + ) -> BOOL; + pub fn CryptHashToBeSigned( + hCryptProv: HCRYPTPROV_LEGACY, + dwCertEncodingType: DWORD, + pbEncoded: *const BYTE, + cbEncoded: DWORD, + pbComputedHash: *mut BYTE, + pcbComputedHash: *mut DWORD, + ) -> BOOL; + pub fn CryptHashCertificate( + hCryptProv: HCRYPTPROV_LEGACY, + Algid: ALG_ID, + dwFlags: DWORD, + pbEncoded: *const BYTE, + cbEncoded: DWORD, + pbComputedHash: *mut BYTE, + pcbComputedHash: *mut DWORD, + ) -> BOOL; + pub fn CryptHashCertificate2( + pwszCNGHashAlgid: LPCWSTR, + dwFlags: DWORD, + pvReserved: *mut c_void, + pbEncoded: *const BYTE, + cbEncoded: DWORD, + pbComputedHash: *mut BYTE, + pcbComputedHash: *mut DWORD, + ) -> BOOL; + pub fn CryptSignCertificate( + hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, + dwKeySpec: DWORD, + dwCertEncodingType: DWORD, + pbEncodedToBeSigned: *const BYTE, + cbEncodedToBeSigned: DWORD, + pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, + pvHashAuxInfo: *const c_void, + pbSignature: *mut BYTE, + pcbSignature: *mut DWORD, + ) -> BOOL; + pub fn CryptSignAndEncodeCertificate( + hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, + dwKeySpec: DWORD, + dwCertEncodingType: DWORD, + lpszStructType: LPCSTR, + pvStructInfo: *const c_void, + pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, + pvHashAuxInfo: *const c_void, + pbEncoded: *mut BYTE, + pcbEncoded: *mut DWORD, + ) -> BOOL; +} +pub const CRYPT_OID_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC: &'static str + = "CryptDllExtractEncodedSignatureParameters"; +FN!{stdcall PFN_CRYPT_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC( + dwCertEncodingType: DWORD, + pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, + ppvDecodedSignPara: *mut *mut c_void, + ppwszCNGHashAlgid: LPWSTR, +) -> BOOL} +pub const CRYPT_OID_SIGN_AND_ENCODE_HASH_FUNC: &'static str = "CryptDllSignAndEncodeHash"; +FN!{stdcall PFN_CRYPT_SIGN_AND_ENCODE_HASH_FUNC( + hKey: NCRYPT_KEY_HANDLE, + dwCertEncodingType: DWORD, + pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, + pvDecodedSignPara: *mut c_void, + pwszCNGPubKeyAlgid: LPCWSTR, + pwszCNGHashAlgid: LPCWSTR, + pbComputedHash: *mut BYTE, + cbComputedHash: DWORD, + pbSignature: *mut BYTE, + pcbSignature: *mut DWORD, +) -> BOOL} +pub const CRYPT_OID_VERIFY_ENCODED_SIGNATURE_FUNC: &'static str = "CryptDllVerifyEncodedSignature"; +FN!{stdcall PFN_CRYPT_VERIFY_ENCODED_SIGNATURE_FUNC( + dwCertEncodingType: DWORD, + pPubKeyInfo: PCERT_PUBLIC_KEY_INFO, + pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, + pvDecodedSignPara: *mut c_void, + pwszCNGPubKeyAlgid: LPCWSTR, + pwszCNGHashAlgid: LPCWSTR, + pbComputedHash: *mut BYTE, + cbComputedHash: DWORD, + pbSignature: *mut BYTE, + cbSignature: DWORD, +) -> BOOL} +extern "system" { + pub fn CertVerifyTimeValidity( + pTimeToVerify: LPFILETIME, + pCertInfo: PCERT_INFO, + ) -> LONG; + pub fn CertVerifyCRLTimeValidity( + pTimeToVerify: LPFILETIME, + pCrlInfo: PCRL_INFO, + ) -> LONG; + pub fn CertVerifyValidityNesting( + pSubjectInfo: PCERT_INFO, + pIssuerInfo: PCERT_INFO, + ) -> BOOL; + pub fn CertVerifyCRLRevocation( + dwCertEncodingType: DWORD, + pCertId: PCERT_INFO, + cCrlInfo: DWORD, + rgpCrlInfo: *mut PCRL_INFO, + ) -> BOOL; + pub fn CertAlgIdToOID( + dwAlgId: DWORD, + ) -> LPCSTR; + pub fn CertOIDToAlgId( + pszObjId: LPCSTR, + ) -> DWORD; + pub fn CertFindExtension( + pszObjId: LPCSTR, + cExtensions: DWORD, + rgExtensions: *mut CERT_EXTENSION, + ) -> PCERT_EXTENSION; + pub fn CertFindAttribute( + pszObjId: LPCSTR, + cAttr: DWORD, + rgAttr: *mut CRYPT_ATTRIBUTE, + ) -> PCRYPT_ATTRIBUTE; + pub fn CertFindRDNAttr( + pszObjId: LPCSTR, + pName: PCERT_NAME_INFO, + ) -> PCERT_RDN_ATTR; + pub fn CertGetIntendedKeyUsage( + dwCertEncodingType: DWORD, + pCertInfo: PCERT_INFO, + pbKeyUsage: *mut BYTE, + cbKeyUsage: DWORD, + ) -> BOOL; +} +pub type HCRYPTDEFAULTCONTEXT = *mut c_void; +extern "system" { + pub fn CryptInstallDefaultContext( + hCryptProv: HCRYPTPROV, + dwDefaultType: DWORD, + pvDefaultPara: *const c_void, + dwFlags: DWORD, + pvReserved: *mut c_void, + phDefaultContext: *mut HCRYPTDEFAULTCONTEXT, + ) -> BOOL; +} +pub const CRYPT_DEFAULT_CONTEXT_AUTO_RELEASE_FLAG: DWORD = 0x00000001; +pub const CRYPT_DEFAULT_CONTEXT_PROCESS_FLAG: DWORD = 0x00000002; +pub const CRYPT_DEFAULT_CONTEXT_CERT_SIGN_OID: DWORD = 1; +pub const CRYPT_DEFAULT_CONTEXT_MULTI_CERT_SIGN_OID: DWORD = 2; +STRUCT!{struct CRYPT_DEFAULT_CONTEXT_MULTI_OID_PARA { + cOID: DWORD, + rgpszOID: *mut LPSTR, +}} +pub type PCRYPT_DEFAULT_CONTEXT_MULTI_OID_PARA = *mut CRYPT_DEFAULT_CONTEXT_MULTI_OID_PARA; +extern "system" { + pub fn CryptUninstallDefaultContext( + hDefaultContext: HCRYPTDEFAULTCONTEXT, + dwFlags: DWORD, + pvReserved: *mut c_void, + ) -> BOOL; + pub fn CryptExportPublicKeyInfo( + hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, + dwKeySpec: DWORD, + dwCertEncodingType: DWORD, + pInfo: PCERT_PUBLIC_KEY_INFO, + pcbInfo: *mut DWORD, + ) -> BOOL; + pub fn CryptExportPublicKeyInfoEx( + hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, + dwKeySpec: DWORD, + dwCertEncodingType: DWORD, + pszPublicKeyObjId: LPSTR, + dwFlags: DWORD, + pvAuxInfo: *mut c_void, + pInfo: PCERT_PUBLIC_KEY_INFO, + pcbInfo: *mut DWORD, + ) -> BOOL; +} +pub const CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC: &'static str = "CryptDllExportPublicKeyInfoEx"; +pub const CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC: &'static str + = "CryptDllExportPublicKeyInfoEx2"; +FN!{stdcall PFN_CRYPT_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC( + hNCryptKey: NCRYPT_KEY_HANDLE, + dwCertEncodingType: DWORD, + pszPublicKeyObjId: LPSTR, + dwFlags: DWORD, + pvAuxInfo: *mut c_void, + pInfo: PCERT_PUBLIC_KEY_INFO, + pcbInfo: *mut DWORD, +) -> BOOL} +extern "system" { + pub fn CryptExportPublicKeyInfoFromBCryptKeyHandle( + hBCryptKey: BCRYPT_KEY_HANDLE, + dwCertEncodingType: DWORD, + pszPublicKeyObjId: LPSTR, + dwFlags: DWORD, + pvAuxInfo: *mut c_void, + pInfo: PCERT_PUBLIC_KEY_INFO, + pcbInfo: *mut DWORD, + ) -> BOOL; +} +pub const CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FROM_BCRYPT_HANDLE_FUNC: &'static str + = "CryptDllExportPublicKeyInfoFromBCryptKeyHandle"; +FN!{stdcall PFN_CRYPT_EXPORT_PUBLIC_KEY_INFO_FROM_BCRYPT_HANDLE_FUNC( + hBCryptKey: BCRYPT_KEY_HANDLE, + dwCertEncodingType: DWORD, + pszPublicKeyObjId: LPSTR, + dwFlags: DWORD, + pvAuxInfo: *mut c_void, + pInfo: PCERT_PUBLIC_KEY_INFO, + pcbInfo: *mut DWORD, +) -> BOOL} +extern "system" { + pub fn CryptImportPublicKeyInfo( + hCryptProv: HCRYPTPROV, + dwCertEncodingType: DWORD, + pInfo: PCERT_PUBLIC_KEY_INFO, + phKey: *mut HCRYPTKEY, + ) -> BOOL; +} +pub const CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC: &'static str = "CryptDllImportPublicKeyInfoEx"; +extern "system" { + pub fn CryptImportPublicKeyInfoEx( + hCryptProv: HCRYPTPROV, + dwCertEncodingType: DWORD, + pInfo: PCERT_PUBLIC_KEY_INFO, + aiKeyAlg: ALG_ID, + dwFlags: DWORD, + pvAuxInfo: *mut c_void, + phKey: *mut HCRYPTKEY, + ) -> BOOL; + pub fn CryptImportPublicKeyInfoEx2( + dwCertEncodingType: DWORD, + pInfo: PCERT_PUBLIC_KEY_INFO, + dwFlags: DWORD, + pvAuxInfo: *mut c_void, + phKey: *mut BCRYPT_KEY_HANDLE, + ) -> BOOL; +} +pub const CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC: &'static str + = "CryptDllImportPublicKeyInfoEx2"; +FN!{stdcall PFN_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC( + dwCertEncodingType: DWORD, + pInfo: PCERT_PUBLIC_KEY_INFO, + dwFlags: DWORD, + pvAuxInfo: *mut c_void, + phKey: *mut BCRYPT_KEY_HANDLE, +) -> BOOL} +extern "system" { + pub fn CryptAcquireCertificatePrivateKey( + pCert: PCCERT_CONTEXT, + dwFlags: DWORD, + pvParameters: *mut c_void, + phCryptProvOrNCryptKey: *mut HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, + pdwKeySpec: *mut DWORD, + pfCallerFreeProvOrNCryptKey: *mut BOOL, + ) -> BOOL; +} +pub const CRYPT_ACQUIRE_CACHE_FLAG: DWORD = 0x00000001; +pub const CRYPT_ACQUIRE_USE_PROV_INFO_FLAG: DWORD = 0x00000002; +pub const CRYPT_ACQUIRE_COMPARE_KEY_FLAG: DWORD = 0x00000004; +pub const CRYPT_ACQUIRE_NO_HEALING: DWORD = 0x00000008; +pub const CRYPT_ACQUIRE_SILENT_FLAG: DWORD = 0x00000040; +pub const CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG: DWORD = 0x00000080; +pub const CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS_MASK: DWORD = 0x00070000; +pub const CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG: DWORD = 0x00010000; +pub const CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG: DWORD = 0x00020000; +pub const CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG: DWORD = 0x00040000; +extern "system" { + pub fn CryptFindCertificateKeyProvInfo( + pCert: PCCERT_CONTEXT, + dwFlags: DWORD, + pvReserved: *mut c_void, + ) -> BOOL; +} +pub const CRYPT_FIND_USER_KEYSET_FLAG: DWORD = 0x00000001; +pub const CRYPT_FIND_MACHINE_KEYSET_FLAG: DWORD = 0x00000002; +pub const CRYPT_FIND_SILENT_KEYSET_FLAG: DWORD = 0x00000040; +FN!{stdcall PFN_IMPORT_PRIV_KEY_FUNC( + hCryptProv: HCRYPTPROV, + pPrivateKeyInfo: *mut CRYPT_PRIVATE_KEY_INFO, + dwFlags: DWORD, + pvAuxInfo: *mut c_void, +) -> BOOL} +pub const CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC: &'static str = "CryptDllImportPrivateKeyInfoEx"; +extern "system" { + pub fn CryptImportPKCS8( + sPrivateKeyAndParams: CRYPT_PKCS8_IMPORT_PARAMS, + dwFlags: DWORD, + phCryptProv: *mut HCRYPTPROV, + pvAuxInfo: *mut c_void, + ) -> BOOL; +} +FN!{stdcall PFN_EXPORT_PRIV_KEY_FUNC( + hCryptProv: HCRYPTPROV, + dwKeySpec: DWORD, + pszPrivateKeyObjId: LPSTR, + dwFlags: DWORD, + pvAuxInfo: *mut c_void, + pPrivateKeyInfo: *mut CRYPT_PRIVATE_KEY_INFO, + pcbPrivateKeyInfo: *mut DWORD, +) -> BOOL} +pub const CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC: &'static str = "CryptDllExportPrivateKeyInfoEx"; +pub const CRYPT_DELETE_KEYSET: DWORD = CRYPT_DELETEKEYSET; +extern "system" { + pub fn CryptExportPKCS8( + hCryptProv: HCRYPTPROV, + dwKeySpec: DWORD, + pszPrivateKeyObjId: LPSTR, + dwFlags: DWORD, + pvAuxInfo: *mut c_void, + pbPrivateKeyBlob: *mut BYTE, + pcbPrivateKeyBlob: *mut DWORD, + ) -> BOOL; + pub fn CryptExportPKCS8Ex( + psExportParams: CRYPT_PKCS8_EXPORT_PARAMS, + dwKeySpec: DWORD, + pvAuxInfo: *mut c_void, + pbPrivateKeyBlob: *mut BYTE, + pcbPrivateKeyBlob: *mut DWORD, + ) -> BOOL; + pub fn CryptHashPublicKeyInfo( + hCryptProv: HCRYPTPROV_LEGACY, + Algid: ALG_ID, + dwFlags: DWORD, + dwCertEncodingType: DWORD, + pInfo: PCERT_PUBLIC_KEY_INFO, + pbComputedHash: *mut BYTE, + pcbComputedHash: *mut DWORD, + ) -> BOOL; + pub fn CertRDNValueToStrA( + dwValueType: DWORD, + pValue: PCERT_RDN_VALUE_BLOB, + psz: LPSTR, + csz: DWORD, + ) -> DWORD; + pub fn CertRDNValueToStrW( + dwValueType: DWORD, + pValue: PCERT_RDN_VALUE_BLOB, + psz: LPWSTR, + csz: DWORD, + ) -> DWORD; + pub fn CertNameToStrA( + dwCertEncodingType: DWORD, + pName: PCERT_NAME_BLOB, + dwStrType: DWORD, + psz: LPSTR, + csz: DWORD, + ) -> DWORD; + pub fn CertNameToStrW( + dwCertEncodingType: DWORD, + pName: PCERT_NAME_BLOB, + dwStrType: DWORD, + psz: LPWSTR, + csz: DWORD, + ) -> DWORD; +} +pub const CERT_SIMPLE_NAME_STR: DWORD = 1; +pub const CERT_OID_NAME_STR: DWORD = 2; +pub const CERT_X500_NAME_STR: DWORD = 3; +pub const CERT_XML_NAME_STR: DWORD = 4; +pub const CERT_NAME_STR_SEMICOLON_FLAG: DWORD = 0x40000000; +pub const CERT_NAME_STR_NO_PLUS_FLAG: DWORD = 0x20000000; +pub const CERT_NAME_STR_NO_QUOTING_FLAG: DWORD = 0x10000000; +pub const CERT_NAME_STR_CRLF_FLAG: DWORD = 0x08000000; +pub const CERT_NAME_STR_COMMA_FLAG: DWORD = 0x04000000; +pub const CERT_NAME_STR_REVERSE_FLAG: DWORD = 0x02000000; +pub const CERT_NAME_STR_FORWARD_FLAG: DWORD = 0x01000000; +pub const CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG: DWORD = 0x00010000; +pub const CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG: DWORD = 0x00020000; +pub const CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG: DWORD = 0x00040000; +pub const CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG: DWORD = 0x00080000; +pub const CERT_NAME_STR_DISABLE_UTF8_DIR_STR_FLAG: DWORD = 0x00100000; +pub const CERT_NAME_STR_ENABLE_PUNYCODE_FLAG: DWORD = 0x00200000; +extern "system" { + pub fn CertStrToNameA( + dwCertEncodingType: DWORD, + pszX500: LPCSTR, + dwStrType: DWORD, + pvReserved: *mut c_void, + pbEncoded: *mut BYTE, + pcbEncoded: *mut DWORD, + ppszError: *mut LPCSTR, + ) -> BOOL; + pub fn CertStrToNameW( + dwCertEncodingType: DWORD, + pszX500: LPCWSTR, + dwStrType: DWORD, + pvReserved: *mut c_void, + pbEncoded: *mut BYTE, + pcbEncoded: *mut DWORD, + ppszError: *mut LPCWSTR, + ) -> BOOL; + pub fn CertGetNameStringA( + pCertContext: PCCERT_CONTEXT, + dwType: DWORD, + dwFlags: DWORD, + pvTypePara: *mut c_void, + pszNameString: LPSTR, + cchNameString: DWORD, + ) -> DWORD; + pub fn CertGetNameStringW( + pCertContext: PCCERT_CONTEXT, + dwType: DWORD, + dwFlags: DWORD, + pvTypePara: *mut c_void, + pszNameString: LPWSTR, + cchNameString: DWORD, + ) -> DWORD; +} +pub const CERT_NAME_EMAIL_TYPE: DWORD = 1; +pub const CERT_NAME_RDN_TYPE: DWORD = 2; +pub const CERT_NAME_ATTR_TYPE: DWORD = 3; +pub const CERT_NAME_SIMPLE_DISPLAY_TYPE: DWORD = 4; +pub const CERT_NAME_FRIENDLY_DISPLAY_TYPE: DWORD = 5; +pub const CERT_NAME_DNS_TYPE: DWORD = 6; +pub const CERT_NAME_URL_TYPE: DWORD = 7; +pub const CERT_NAME_UPN_TYPE: DWORD = 8; +pub const CERT_NAME_ISSUER_FLAG: DWORD = 0x1; +pub const CERT_NAME_DISABLE_IE4_UTF8_FLAG: DWORD = 0x00010000; +pub const CERT_NAME_SEARCH_ALL_NAMES_FLAG: DWORD = 0x2; +FN!{stdcall PFN_CRYPT_GET_SIGNER_CERTIFICATE( + pvGetArg: *mut c_void, + dwCertEncodingType: DWORD, + pSignerId: PCERT_INFO, + hMsgCertStore: HCERTSTORE, +) -> PCCERT_CONTEXT} +STRUCT!{struct CRYPT_SIGN_MESSAGE_PARA { + cbSize: DWORD, + dwMsgEncodingType: DWORD, + pSigningCert: PCCERT_CONTEXT, + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvHashAuxInfo: *mut c_void, + cMsgCert: DWORD, + rgpMsgCert: *mut PCCERT_CONTEXT, + cMsgCrl: DWORD, + rgpMsgCrl: *mut PCCRL_CONTEXT, + cAuthAttr: DWORD, + rgAuthAttr: PCRYPT_ATTRIBUTE, + cUnauthAttr: DWORD, + rgUnauthAttr: PCRYPT_ATTRIBUTE, + dwFlags: DWORD, + dwInnerContentType: DWORD, + HashEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvHashEncryptionAuxInfo: *mut c_void, +}} +pub type PCRYPT_SIGN_MESSAGE_PARA = *mut CRYPT_SIGN_MESSAGE_PARA; +pub const CRYPT_MESSAGE_BARE_CONTENT_OUT_FLAG: DWORD = 0x00000001; +pub const CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG: DWORD = 0x00000002; +pub const CRYPT_MESSAGE_KEYID_SIGNER_FLAG: DWORD = 0x00000004; +pub const CRYPT_MESSAGE_SILENT_KEYSET_FLAG: DWORD = 0x00000040; +STRUCT!{struct CRYPT_VERIFY_MESSAGE_PARA { + cbSize: DWORD, + dwMsgAndCertEncodingType: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + pfnGetSignerCertificate: PFN_CRYPT_GET_SIGNER_CERTIFICATE, + pvGetArg: *mut c_void, + pStrongSignPara: PCCERT_STRONG_SIGN_PARA, +}} +pub type PCRYPT_VERIFY_MESSAGE_PARA = *mut CRYPT_VERIFY_MESSAGE_PARA; +STRUCT!{struct CRYPT_ENCRYPT_MESSAGE_PARA { + cbSize: DWORD, + dwMsgEncodingType: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + ContentEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvEncryptionAuxInfo: *mut c_void, + dwFlags: DWORD, + dwInnerContentType: DWORD, +}} +pub type PCRYPT_ENCRYPT_MESSAGE_PARA = *mut CRYPT_DECRYPT_MESSAGE_PARA; +pub const CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG: DWORD = 0x4; +STRUCT!{struct CRYPT_DECRYPT_MESSAGE_PARA { + cbSize: DWORD, + dwMsgAndCertEncodingType: DWORD, + cCertStore: DWORD, + rghCertStore: *mut HCERTSTORE, + dwFlags: DWORD, +}} +pub type PCRYPT_DECRYPT_MESSAGE_PARA = *mut CRYPT_DECRYPT_MESSAGE_PARA; +STRUCT!{struct CRYPT_HASH_MESSAGE_PARA { + cbSize: DWORD, + dwMsgEncodingType: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvHashAuxInfo: *mut c_void, +}} +pub type PCRYPT_HASH_MESSAGE_PARA = *mut CRYPT_HASH_MESSAGE_PARA; +UNION!{union CRYPT_KEY_SIGN_MESSAGE_PARA_u { + [usize; 1], + hCryptProv hCryptProv_mut: HCRYPTPROV, + hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, +}} +STRUCT!{struct CRYPT_KEY_SIGN_MESSAGE_PARA { + cbSize: DWORD, + dwMsgAndCertEncodingType: DWORD, + u: CRYPT_KEY_SIGN_MESSAGE_PARA_u, + dwKeySpec: DWORD, + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + pvHashAuxInfo: *mut c_void, + PubKeyAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, +}} +pub type PCRYPT_KEY_SIGN_MESSAGE_PARA = *mut CRYPT_KEY_SIGN_MESSAGE_PARA; +STRUCT!{struct CRYPT_KEY_VERIFY_MESSAGE_PARA { + cbSize: DWORD, + dwMsgEncodingType: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, +}} +pub type PCRYPT_KEY_VERIFY_MESSAGE_PARA = *mut CRYPT_KEY_VERIFY_MESSAGE_PARA; +extern "system" { + pub fn CryptSignMessage( + pSignPara: PCRYPT_SIGN_MESSAGE_PARA, + fDetachedSignature: BOOL, + cToBeSigned: DWORD, + rgpbToBeSigned: *mut *const BYTE, + rgcbToBeSigned: *mut DWORD, + pbSignedBlob: *mut BYTE, + pcbSignedBlob: *mut DWORD, + ) -> BOOL; + pub fn CryptVerifyMessageSignature( + pVerifyPara: PCRYPT_VERIFY_MESSAGE_PARA, + dwSignerIndex: DWORD, + pbSignedBlob: *const BYTE, + cbSignedBlob: DWORD, + pbDecoded: *mut BYTE, + pcbDecoded: *mut DWORD, + ppSignerCert: *mut PCCERT_CONTEXT, + ) -> BOOL; + pub fn CryptGetMessageSignerCount( + dwMsgEncodingType: DWORD, + pbSignedBlob: *const BYTE, + cbSignedBlob: DWORD, + ) -> LONG; + pub fn CryptGetMessageCertificates( + dwMsgAndCertEncodingType: DWORD, + hCryptProv: HCRYPTPROV_LEGACY, + dwFlags: DWORD, + pbSignedBlob: *const BYTE, + cbSignedBlob: DWORD, + ) -> HCERTSTORE; + pub fn CryptVerifyDetachedMessageSignature( + pVerifyPara: PCRYPT_VERIFY_MESSAGE_PARA, + dwSignerIndex: DWORD, + pbDetachedSignBlob: *const BYTE, + cbDetachedSignBlob: DWORD, + cToBeSigned: DWORD, + rgpbToBeSigned: *mut *const BYTE, + rgcbToBeSigned: *mut DWORD, + ppSignerCert: *mut PCCERT_CONTEXT, + ) -> BOOL; + pub fn CryptEncryptMessage( + pEncryptPara: PCRYPT_ENCRYPT_MESSAGE_PARA, + cRecipientCert: DWORD, + rgpRecipientCert: *mut PCCERT_CONTEXT, + pbToBeEncrypted: *const BYTE, + cbToBeEncrypted: DWORD, + pbEncryptedBlob: *mut BYTE, + pcbEncryptedBlob: *mut DWORD, + ) -> BOOL; + pub fn CryptDecryptMessage( + pDecryptPara: PCRYPT_DECRYPT_MESSAGE_PARA, + pbEncryptedBlob: *const BYTE, + cbEncryptedBlob: DWORD, + pbDecrypted: *mut BYTE, + pcbDecrypted: *mut DWORD, + ppXchgCert: *mut PCCERT_CONTEXT, + ) -> BOOL; + pub fn CryptSignAndEncryptMessage( + pSignPara: PCRYPT_SIGN_MESSAGE_PARA, + pEncryptPara: PCRYPT_ENCRYPT_MESSAGE_PARA, + cRecipientCert: DWORD, + rgpRecipientCert: *mut PCCERT_CONTEXT, + pbToBeSignedAndEncrypted: *const BYTE, + cbToBeSignedAndEncrypted: DWORD, + pbSignedAndEncryptedBlob: *mut BYTE, + pcbSignedAndEncryptedBlob: *mut DWORD, + ) -> BOOL; + pub fn CryptDecryptAndVerifyMessageSignature( + pDecryptPara: PCRYPT_DECRYPT_MESSAGE_PARA, + pVerifyPara: PCRYPT_VERIFY_MESSAGE_PARA, + dwSignerIndex: DWORD, + pbEncryptedBlob: *const BYTE, + cbEncryptedBlob: DWORD, + pbDecrypted: *mut BYTE, + pcbDecrypted: *mut DWORD, + ppXchgCert: *mut PCCERT_CONTEXT, + ppSignerCert: *mut PCCERT_CONTEXT, + ) -> BOOL; + pub fn CryptDecodeMessage( + dwMsgTypeFlags: DWORD, + pDecryptPara: PCRYPT_DECRYPT_MESSAGE_PARA, + pVerifyPara: PCRYPT_VERIFY_MESSAGE_PARA, + dwSignerIndex: DWORD, + pbEncodedBlob: *const BYTE, + cbEncodedBlob: DWORD, + dwPrevInnerContentType: DWORD, + pdwMsgType: *mut DWORD, + pdwInnerContentType: *mut DWORD, + pbDecoded: *mut BYTE, + pcbDecoded: *mut DWORD, + ppXchgCert: *mut PCCERT_CONTEXT, + ppSignerCert: *mut PCCERT_CONTEXT, + ) -> BOOL; + pub fn CryptHashMessage( + pHashPara: PCRYPT_HASH_MESSAGE_PARA, + fDetachedHash: BOOL, + cToBeHashed: DWORD, + rgpbToBeHashed: *mut *const BYTE, + rgcbToBeHashed: *mut DWORD, + pbHashedBlob: *mut BYTE, + pcbHashedBlob: *mut DWORD, + pbComputedHash: *mut BYTE, + pcbComputedHash: *mut DWORD, + ) -> BOOL; + pub fn CryptVerifyMessageHash( + pHashPara: PCRYPT_HASH_MESSAGE_PARA, + pbHashedBlob: *mut BYTE, + cbHashedBlob: DWORD, + pbToBeHashed: *mut BYTE, + pcbToBeHashed: *mut DWORD, + pbComputedHash: *mut BYTE, + pcbComputedHash: *mut DWORD, + ) -> BOOL; + pub fn CryptVerifyDetachedMessageHash( + pHashPara: PCRYPT_HASH_MESSAGE_PARA, + pbDetachedHashBlob: *mut BYTE, + cbDetachedHashBlob: DWORD, + cToBeHashed: DWORD, + rgpbToBeHashed: *mut *const BYTE, + rgcbToBeHashed: *mut DWORD, + pbComputedHash: *mut BYTE, + pcbComputedHash: *mut DWORD, + ) -> BOOL; + pub fn CryptSignMessageWithKey( + pSignPara: PCRYPT_KEY_SIGN_MESSAGE_PARA, + pbToBeSigned: *const BYTE, + cbToBeSigned: DWORD, + pbSignedBlob: *mut BYTE, + pcbSignedBlob: *mut DWORD, + ) -> BOOL; + pub fn CryptVerifyMessageSignatureWithKey( + pVerifyPara: PCRYPT_KEY_VERIFY_MESSAGE_PARA, + pPublicKeyInfo: PCERT_PUBLIC_KEY_INFO, + pbSignedBlob: *const BYTE, + cbSignedBlob: DWORD, + pbDecoded: *mut BYTE, + pcbDecoded: *mut DWORD, + ) -> BOOL; + pub fn CertOpenSystemStoreA( + hProv: HCRYPTPROV_LEGACY, + szSubsystemProtocol: LPCSTR, + ) -> HCERTSTORE; + pub fn CertOpenSystemStoreW( + hProv: HCRYPTPROV_LEGACY, + szSubsystemProtocol: LPCWSTR, + ) -> HCERTSTORE; + pub fn CertAddEncodedCertificateToSystemStoreA( + szCertStoreName: LPCSTR, + pbCertEncoded: *const BYTE, + cbCertEncoded: DWORD, + ) -> BOOL; + pub fn CertAddEncodedCertificateToSystemStoreW( + szCertStoreName: LPCWSTR, + pbCertEncoded: *const BYTE, + cbCertEncoded: DWORD, + ) -> BOOL; +} +STRUCT!{struct CERT_CHAIN { + cCerts: DWORD, + certs: PCERT_BLOB, + keyLocatorInfo: CRYPT_KEY_PROV_INFO, +}} +pub type PCERT_CHAIN = *mut CERT_CHAIN; +extern "system" { + pub fn FindCertsByIssuer( + pCertChains: PCERT_CHAIN, + pcbCertChains: *mut DWORD, + pcCertChains: *mut DWORD, + pbEncodedIssuerName: *mut BYTE, + cbEncodedIssuerName: DWORD, + pwszPurpose: LPCWSTR, + dwKeySpec: DWORD, + ) -> HRESULT; + pub fn CryptQueryObject( + dwObjectType: DWORD, + pvObject: *const c_void, + dwExpectedContentTypeFlags: DWORD, + dwExpectedFormatTypeFlags: DWORD, + dwFlags: DWORD, + pdwMsgAndCertEncodingType: *mut DWORD, + pdwContentType: *mut DWORD, + pdwFormatType: *mut DWORD, + phCertStore: *mut HCERTSTORE, + phMsg: *mut HCRYPTMSG, + ppvContext: *mut *const c_void, + ) -> BOOL; +} +pub const CERT_QUERY_OBJECT_FILE: DWORD = 0x00000001; +pub const CERT_QUERY_OBJECT_BLOB: DWORD = 0x00000002; +pub const CERT_QUERY_CONTENT_CERT: DWORD = 1; +pub const CERT_QUERY_CONTENT_CTL: DWORD = 2; +pub const CERT_QUERY_CONTENT_CRL: DWORD = 3; +pub const CERT_QUERY_CONTENT_SERIALIZED_STORE: DWORD = 4; +pub const CERT_QUERY_CONTENT_SERIALIZED_CERT: DWORD = 5; +pub const CERT_QUERY_CONTENT_SERIALIZED_CTL: DWORD = 6; +pub const CERT_QUERY_CONTENT_SERIALIZED_CRL: DWORD = 7; +pub const CERT_QUERY_CONTENT_PKCS7_SIGNED: DWORD = 8; +pub const CERT_QUERY_CONTENT_PKCS7_UNSIGNED: DWORD = 9; +pub const CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED: DWORD = 10; +pub const CERT_QUERY_CONTENT_PKCS10: DWORD = 11; +pub const CERT_QUERY_CONTENT_PFX: DWORD = 12; +pub const CERT_QUERY_CONTENT_CERT_PAIR: DWORD = 13; +pub const CERT_QUERY_CONTENT_PFX_AND_LOAD: DWORD = 14; +pub const CERT_QUERY_CONTENT_FLAG_CERT: DWORD = 1 << CERT_QUERY_CONTENT_CERT; +pub const CERT_QUERY_CONTENT_FLAG_CTL: DWORD = 1 << CERT_QUERY_CONTENT_CTL; +pub const CERT_QUERY_CONTENT_FLAG_CRL: DWORD = 1 << CERT_QUERY_CONTENT_CRL; +pub const CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE: DWORD + = 1<< CERT_QUERY_CONTENT_SERIALIZED_STORE; +pub const CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT: DWORD = 1 << CERT_QUERY_CONTENT_SERIALIZED_CERT; +pub const CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL: DWORD = 1 << CERT_QUERY_CONTENT_SERIALIZED_CTL; +pub const CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL: DWORD = 1 << CERT_QUERY_CONTENT_SERIALIZED_CRL; +pub const CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED: DWORD = 1 << CERT_QUERY_CONTENT_PKCS7_SIGNED; +pub const CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED: DWORD = 1 << CERT_QUERY_CONTENT_PKCS7_UNSIGNED; +pub const CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED: DWORD + = 1 << CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED; +pub const CERT_QUERY_CONTENT_FLAG_PKCS10: DWORD = 1 << CERT_QUERY_CONTENT_PKCS10; +pub const CERT_QUERY_CONTENT_FLAG_PFX: DWORD = 1 << CERT_QUERY_CONTENT_PFX; +pub const CERT_QUERY_CONTENT_FLAG_CERT_PAIR: DWORD = 1 << CERT_QUERY_CONTENT_CERT_PAIR; +pub const CERT_QUERY_CONTENT_FLAG_PFX_AND_LOAD: DWORD = 1 << CERT_QUERY_CONTENT_PFX_AND_LOAD; +pub const CERT_QUERY_CONTENT_FLAG_ALL: DWORD = CERT_QUERY_CONTENT_FLAG_CERT + | CERT_QUERY_CONTENT_FLAG_CTL | CERT_QUERY_CONTENT_FLAG_CRL + | CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT + | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL + | CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED + | CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED | CERT_QUERY_CONTENT_FLAG_PKCS10 + | CERT_QUERY_CONTENT_FLAG_PFX | CERT_QUERY_CONTENT_FLAG_CERT_PAIR; +pub const CERT_QUERY_CONTENT_FLAG_ALL_ISSUER_CERT: DWORD = CERT_QUERY_CONTENT_FLAG_CERT + | CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT + | CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED; +pub const CERT_QUERY_FORMAT_BINARY: DWORD = 1; +pub const CERT_QUERY_FORMAT_BASE64_ENCODED: DWORD = 2; +pub const CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED: DWORD = 3; +pub const CERT_QUERY_FORMAT_FLAG_BINARY: DWORD = 1 << CERT_QUERY_FORMAT_BINARY; +pub const CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED: DWORD = 1 << CERT_QUERY_FORMAT_BASE64_ENCODED; +pub const CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED: DWORD + = 1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED; +pub const CERT_QUERY_FORMAT_FLAG_ALL: DWORD = CERT_QUERY_FORMAT_FLAG_BINARY + | CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED | CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED; +extern "system" { + pub fn CryptMemAlloc( + cbSize: ULONG, + ) -> LPVOID; + pub fn CryptMemRealloc( + pv: LPVOID, + cbSize: ULONG, + ) -> LPVOID; + pub fn CryptMemFree( + pv: LPVOID, + ); +} +pub type HCRYPTASYNC = HANDLE; +pub type PHCRYPTASYNC = *mut HANDLE; +FN!{stdcall PFN_CRYPT_ASYNC_PARAM_FREE_FUNC( + pszParamOid: LPSTR, + pvParam: LPVOID, +) -> ()} +extern "system" { + pub fn CryptCreateAsyncHandle( + dwFlags: DWORD, + phAsync: PHCRYPTASYNC, + ) -> BOOL; + pub fn CryptSetAsyncParam( + hAsync: HCRYPTASYNC, + pszParamOid: LPSTR, + pvParam: LPVOID, + pfnFree: PFN_CRYPT_ASYNC_PARAM_FREE_FUNC, + ) -> BOOL; + pub fn CryptGetAsyncParam( + hAsync: HCRYPTASYNC, + pszParamOid: LPSTR, + ppvParam: *mut LPVOID, + ppfnFree: *mut PFN_CRYPT_ASYNC_PARAM_FREE_FUNC, + ) -> BOOL; + pub fn CryptCloseAsyncHandle( + hAsync: HCRYPTASYNC, + ) -> BOOL; +} +STRUCT!{struct CRYPT_BLOB_ARRAY { + cBlob: DWORD, + rgBlob: PCRYPT_DATA_BLOB, +}} +pub type PCRYPT_BLOB_ARRAY = *mut CRYPT_BLOB_ARRAY; +STRUCT!{struct CRYPT_CREDENTIALS { + cbSize: DWORD, + pszCredentialsOid: LPCSTR, + pvCredentials: LPVOID, +}} +pub type PCRYPT_CREDENTIALS = *mut CRYPT_CREDENTIALS; +pub const CREDENTIAL_OID_PASSWORD_CREDENTIALS_A: LPCSTR = 1 as LPCSTR; +pub const CREDENTIAL_OID_PASSWORD_CREDENTIALS_W: LPCSTR = 2 as LPCSTR; +STRUCT!{struct CRYPT_PASSWORD_CREDENTIALSA { + cbSize: DWORD, + pszUsername: LPSTR, + pszPassword: LPSTR, +}} +pub type PCRYPT_PASSWORD_CREDENTIALSA = *mut CRYPT_PASSWORD_CREDENTIALSA; +STRUCT!{struct CRYPT_PASSWORD_CREDENTIALSW { + cbSize: DWORD, + pszUsername: LPWSTR, + pszPassword: LPWSTR, +}} +pub type PCRYPT_PASSWORD_CREDENTIALSW = *mut CRYPT_PASSWORD_CREDENTIALSW; +pub const SCHEME_OID_RETRIEVE_ENCODED_OBJECT_FUNC: &'static str = "SchemeDllRetrieveEncodedObject"; +pub const SCHEME_OID_RETRIEVE_ENCODED_OBJECTW_FUNC: &'static str + = "SchemeDllRetrieveEncodedObjectW"; +FN!{stdcall PFN_FREE_ENCODED_OBJECT_FUNC( + pszObjectOid: LPCSTR, + pObject: PCRYPT_BLOB_ARRAY, + pvFreeContext: LPVOID, +) -> ()} +pub const CONTEXT_OID_CREATE_OBJECT_CONTEXT_FUNC: &'static str = "ContextDllCreateObjectContext"; +pub const CONTEXT_OID_CERTIFICATE: LPCSTR = 1 as LPCSTR; +pub const CONTEXT_OID_CRL: LPCSTR = 2 as LPCSTR; +pub const CONTEXT_OID_CTL: LPCSTR = 3 as LPCSTR; +pub const CONTEXT_OID_PKCS7: LPCSTR = 4 as LPCSTR; +pub const CONTEXT_OID_CAPI2_ANY: LPCSTR = 5 as LPCSTR; +pub const CONTEXT_OID_OCSP_RESP: LPCSTR = 6 as LPCSTR; +pub const CRYPT_RETRIEVE_MULTIPLE_OBJECTS: DWORD = 0x00000001; +pub const CRYPT_CACHE_ONLY_RETRIEVAL: DWORD = 0x00000002; +pub const CRYPT_WIRE_ONLY_RETRIEVAL: DWORD = 0x00000004; +pub const CRYPT_DONT_CACHE_RESULT: DWORD = 0x00000008; +pub const CRYPT_ASYNC_RETRIEVAL: DWORD = 0x00000010; +pub const CRYPT_STICKY_CACHE_RETRIEVAL: DWORD = 0x00001000; +pub const CRYPT_LDAP_SCOPE_BASE_ONLY_RETRIEVAL: DWORD = 0x00002000; +pub const CRYPT_OFFLINE_CHECK_RETRIEVAL: DWORD = 0x00004000; +pub const CRYPT_LDAP_INSERT_ENTRY_ATTRIBUTE: DWORD = 0x00008000; +pub const CRYPT_LDAP_SIGN_RETRIEVAL: DWORD = 0x00010000; +pub const CRYPT_NO_AUTH_RETRIEVAL: DWORD = 0x00020000; +pub const CRYPT_LDAP_AREC_EXCLUSIVE_RETRIEVAL: DWORD = 0x00040000; +pub const CRYPT_AIA_RETRIEVAL: DWORD = 0x00080000; +pub const CRYPT_HTTP_POST_RETRIEVAL: DWORD = 0x00100000; +pub const CRYPT_PROXY_CACHE_RETRIEVAL: DWORD = 0x00200000; +pub const CRYPT_NOT_MODIFIED_RETRIEVAL: DWORD = 0x00400000; +pub const CRYPT_ENABLE_SSL_REVOCATION_RETRIEVAL: DWORD = 0x00800000; +pub const CRYPT_RANDOM_QUERY_STRING_RETRIEVAL: DWORD = 0x04000000; +pub const CRYPT_ENABLE_FILE_RETRIEVAL: DWORD = 0x08000000; +pub const CRYPT_CREATE_NEW_FLUSH_ENTRY: DWORD = 0x10000000; +pub const CRYPT_VERIFY_CONTEXT_SIGNATURE: DWORD = 0x00000020; +pub const CRYPT_VERIFY_DATA_HASH: DWORD = 0x00000040; +pub const CRYPT_KEEP_TIME_VALID: DWORD = 0x00000080; +pub const CRYPT_DONT_VERIFY_SIGNATURE: DWORD = 0x00000100; +pub const CRYPT_DONT_CHECK_TIME_VALIDITY: DWORD = 0x00000200; +pub const CRYPT_CHECK_FRESHNESS_TIME_VALIDITY: DWORD = 0x00000400; +pub const CRYPT_ACCUMULATIVE_TIMEOUT: DWORD = 0x00000800; +pub const CRYPT_OCSP_ONLY_RETRIEVAL: DWORD = 0x01000000; +pub const CRYPT_NO_OCSP_FAILOVER_TO_CRL_RETRIEVAL: DWORD = 0x02000000; +STRUCT!{struct CRYPTNET_URL_CACHE_PRE_FETCH_INFO { + cbSize: DWORD, + dwObjectType: DWORD, + dwError: DWORD, + dwReserved: DWORD, + ThisUpdateTime: FILETIME, + NextUpdateTime: FILETIME, + PublishTime: FILETIME, +}} +pub type PCRYPTNET_URL_CACHE_PRE_FETCH_INFO = *mut CRYPTNET_URL_CACHE_PRE_FETCH_INFO; +pub const CRYPTNET_URL_CACHE_PRE_FETCH_NONE: DWORD = 0; +pub const CRYPTNET_URL_CACHE_PRE_FETCH_BLOB: DWORD = 1; +pub const CRYPTNET_URL_CACHE_PRE_FETCH_CRL: DWORD = 2; +pub const CRYPTNET_URL_CACHE_PRE_FETCH_OCSP: DWORD = 3; +pub const CRYPTNET_URL_CACHE_PRE_FETCH_AUTOROOT_CAB: DWORD = 5; +pub const CRYPTNET_URL_CACHE_PRE_FETCH_DISALLOWED_CERT_CAB: DWORD = 6; +pub const CRYPTNET_URL_CACHE_PRE_FETCH_PIN_RULES_CAB: DWORD = 7; +STRUCT!{struct CRYPTNET_URL_CACHE_FLUSH_INFO { + cbSize: DWORD, + dwExemptSeconds: DWORD, + ExpireTime: FILETIME, +}} +pub type PCRYPTNET_URL_CACHE_FLUSH_INFO = *mut CRYPTNET_URL_CACHE_FLUSH_INFO; +pub const CRYPTNET_URL_CACHE_DEFAULT_FLUSH: DWORD = 0; +pub const CRYPTNET_URL_CACHE_DISABLE_FLUSH: DWORD = 0xFFFFFFFF; +STRUCT!{struct CRYPTNET_URL_CACHE_RESPONSE_INFO { + cbSize: DWORD, + wResponseType: WORD, + wResponseFlags: WORD, + LastModifiedTime: FILETIME, + dwMaxAge: DWORD, + pwszETag: LPCWSTR, + dwProxyId: DWORD, +}} +pub type PCRYPTNET_URL_CACHE_RESPONSE_INFO = *mut CRYPTNET_URL_CACHE_RESPONSE_INFO; +pub const CRYPTNET_URL_CACHE_RESPONSE_NONE: WORD = 0; +pub const CRYPTNET_URL_CACHE_RESPONSE_HTTP: WORD = 1; +pub const CRYPTNET_URL_CACHE_RESPONSE_VALIDATED: WORD = 0x8000; +STRUCT!{struct CRYPT_RETRIEVE_AUX_INFO { + cbSize: DWORD, + pLastSyncTime: *mut FILETIME, + dwMaxUrlRetrievalByteCount: DWORD, + pPreFetchInfo: PCRYPTNET_URL_CACHE_PRE_FETCH_INFO, + pFlushInfo: PCRYPTNET_URL_CACHE_FLUSH_INFO, + ppResponseInfo: *mut PCRYPTNET_URL_CACHE_RESPONSE_INFO, + pwszCacheFileNamePrefix: LPWSTR, + pftCacheResync: LPFILETIME, + fProxyCacheRetrieval: BOOL, + dwHttpStatusCode: DWORD, + ppwszErrorResponseHeaders: *mut LPWSTR, + ppErrorContentBlob: *mut PCRYPT_DATA_BLOB, +}} +pub type PCRYPT_RETRIEVE_AUX_INFO = *mut CRYPT_RETRIEVE_AUX_INFO; +pub const CRYPT_RETRIEVE_MAX_ERROR_CONTENT_LENGTH: DWORD = 0x1000; +extern "system" { + pub fn CryptRetrieveObjectByUrlA( + pszUrl: LPCSTR, + pszObjectOid: LPCSTR, + dwRetrievalFlags: DWORD, + dwTimeout: DWORD, + ppvObject: *mut LPVOID, + hAsyncRetrieve: HCRYPTASYNC, + pCredentials: PCRYPT_CREDENTIALS, + pvVerify: LPVOID, + pAuxInfo: PCRYPT_RETRIEVE_AUX_INFO, + ) -> BOOL; + pub fn CryptRetrieveObjectByUrlW( + pszUrl: LPCWSTR, + pszObjectOid: LPCSTR, + dwRetrievalFlags: DWORD, + dwTimeout: DWORD, + ppvObject: *mut LPVOID, + hAsyncRetrieve: HCRYPTASYNC, + pCredentials: PCRYPT_CREDENTIALS, + pvVerify: LPVOID, + pAuxInfo: PCRYPT_RETRIEVE_AUX_INFO, + ) -> BOOL; +} +FN!{stdcall PFN_CRYPT_CANCEL_RETRIEVAL( + dwFlags: DWORD, + pvArg: *mut c_void, +) -> BOOL} +extern "system" { + pub fn CryptInstallCancelRetrieval( + pfnCancel: PFN_CRYPT_CANCEL_RETRIEVAL, + pvArg: *const c_void, + dwFlags: DWORD, + pvReserved: *mut c_void, + ) -> BOOL; + pub fn CryptUninstallCancelRetrieval( + dwFlags: DWORD, + pvReserved: *mut c_void, + ) -> BOOL; + pub fn CryptCancelAsyncRetrieval( + hAsyncRetrieval: HCRYPTASYNC, + ) -> BOOL; +} +pub const CRYPT_PARAM_ASYNC_RETRIEVAL_COMPLETION: LPCSTR = 1 as LPCSTR; +FN!{stdcall PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC( + pvCompletion: LPVOID, + dwCompletionCode: DWORD, + pszUrl: LPCSTR, + pszObjectOid: LPSTR, + pvObject: LPVOID, +) -> ()} +STRUCT!{struct CRYPT_ASYNC_RETRIEVAL_COMPLETION { + pfnCompletion: PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC, + pvCompletion: LPVOID, +}} +pub type PCRYPT_ASYNC_RETRIEVAL_COMPLETION = *mut CRYPT_ASYNC_RETRIEVAL_COMPLETION; +pub const CRYPT_PARAM_CANCEL_ASYNC_RETRIEVAL: LPCSTR = 2 as LPCSTR; +FN!{stdcall PFN_CANCEL_ASYNC_RETRIEVAL_FUNC( + hAsyncRetrieve: HCRYPTASYNC, +) -> BOOL} +pub const CRYPT_GET_URL_FROM_PROPERTY: DWORD = 0x00000001; +pub const CRYPT_GET_URL_FROM_EXTENSION: DWORD = 0x00000002; +pub const CRYPT_GET_URL_FROM_UNAUTH_ATTRIBUTE: DWORD = 0x00000004; +pub const CRYPT_GET_URL_FROM_AUTH_ATTRIBUTE: DWORD = 0x00000008; +STRUCT!{struct CRYPT_URL_ARRAY { + cUrl: DWORD, + rgwszUrl: *mut LPWSTR, +}} +pub type PCRYPT_URL_ARRAY = *mut CRYPT_URL_ARRAY; +STRUCT!{struct CRYPT_URL_INFO { + cbSize: DWORD, + dwSyncDeltaTime: DWORD, + cGroup: DWORD, + rgcGroupEntry: *mut DWORD, +}} +pub type PCRYPT_URL_INFO = *mut CRYPT_URL_INFO; +extern "system" { + pub fn CryptGetObjectUrl( + pszUrlOid: LPCSTR, + pvPara: LPVOID, + dwFlags: DWORD, + pUrlArray: PCRYPT_URL_ARRAY, + pcbUrlArray: *mut DWORD, + pUrlInfo: PCRYPT_URL_INFO, + pcbUrlInfo: *mut DWORD, + pvReserved: LPVOID, + ) -> BOOL; +} +pub const URL_OID_GET_OBJECT_URL_FUNC: &'static str = "UrlDllGetObjectUrl"; +pub const URL_OID_CERTIFICATE_ISSUER: LPCSTR = 1 as LPCSTR; +pub const URL_OID_CERTIFICATE_CRL_DIST_POINT: LPCSTR = 2 as LPCSTR; +pub const URL_OID_CTL_ISSUER: LPCSTR = 3 as LPCSTR; +pub const URL_OID_CTL_NEXT_UPDATE: LPCSTR = 4 as LPCSTR; +pub const URL_OID_CRL_ISSUER: LPCSTR = 5 as LPCSTR; +pub const URL_OID_CERTIFICATE_FRESHEST_CRL: LPCSTR = 6 as LPCSTR; +pub const URL_OID_CRL_FRESHEST_CRL: LPCSTR = 7 as LPCSTR; +pub const URL_OID_CROSS_CERT_DIST_POINT: LPCSTR = 8 as LPCSTR; +pub const URL_OID_CERTIFICATE_OCSP: LPCSTR = 9 as LPCSTR; +pub const URL_OID_CERTIFICATE_OCSP_AND_CRL_DIST_POINT: LPCSTR = 10 as LPCSTR; +pub const URL_OID_CERTIFICATE_CRL_DIST_POINT_AND_OCSP: LPCSTR = 11 as LPCSTR; +pub const URL_OID_CROSS_CERT_SUBJECT_INFO_ACCESS: LPCSTR = 12 as LPCSTR; +pub const URL_OID_CERTIFICATE_ONLY_OCSP: LPCSTR = 13 as LPCSTR; +STRUCT!{struct CERT_CRL_CONTEXT_PAIR { + pCertContext: PCCERT_CONTEXT, + pCrlContext: PCCRL_CONTEXT, +}} +pub type PCERT_CRL_CONTEXT_PAIR = *mut CERT_CRL_CONTEXT_PAIR; +pub type PCCERT_CRL_CONTEXT_PAIR = *const CERT_CRL_CONTEXT_PAIR; +STRUCT!{struct CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO { + cbSize: DWORD, + iDeltaCrlIndicator: c_int, + pftCacheResync: LPFILETIME, + pLastSyncTime: LPFILETIME, + pMaxAgeTime: LPFILETIME, + pChainPara: PCERT_REVOCATION_CHAIN_PARA, + pDeltaCrlIndicator: PCRYPT_INTEGER_BLOB, +}} +pub type PCRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO = *mut CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO; +extern "system" { + pub fn CryptGetTimeValidObject( + pszTimeValidOid: LPCSTR, + pvPara: LPVOID, + pIssuer: PCCERT_CONTEXT, + pftValidFor: LPFILETIME, + dwFlags: DWORD, + dwTimeout: DWORD, + ppvObject: *mut LPVOID, + pCredentials: PCRYPT_CREDENTIALS, + pExtraInfo: PCRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO, + ) -> BOOL; +} +pub const TIME_VALID_OID_GET_OBJECT_FUNC: &'static str = "TimeValidDllGetObject"; +pub const TIME_VALID_OID_GET_CTL: LPCSTR = 1 as LPCSTR; +pub const TIME_VALID_OID_GET_CRL: LPCSTR = 2 as LPCSTR; +pub const TIME_VALID_OID_GET_CRL_FROM_CERT: LPCSTR = 3 as LPCSTR; +pub const TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CERT: LPCSTR = 4 as LPCSTR; +pub const TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CRL: LPCSTR = 5 as LPCSTR; +extern "system" { + pub fn CryptFlushTimeValidObject( + pszFlushTimeValidOid: LPCSTR, + pvPara: LPVOID, + pIssuer: PCCERT_CONTEXT, + dwFlags: DWORD, + pvReserved: LPVOID, + ) -> BOOL; +} +pub const TIME_VALID_OID_FLUSH_OBJECT_FUNC: &'static str = "TimeValidDllFlushObject"; +pub const TIME_VALID_OID_FLUSH_CTL: LPCSTR = 1 as LPCSTR; +pub const TIME_VALID_OID_FLUSH_CRL: LPCSTR = 2 as LPCSTR; +pub const TIME_VALID_OID_FLUSH_CRL_FROM_CERT: LPCSTR = 3 as LPCSTR; +pub const TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CERT: LPCSTR = 4 as LPCSTR; +pub const TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CRL: LPCSTR = 5 as LPCSTR; +extern "system" { + pub fn CertCreateSelfSignCertificate( + hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, + pSubjectIssuerBlob: PCERT_NAME_BLOB, + dwFlags: DWORD, + pKeyProvInfo: PCRYPT_KEY_PROV_INFO, + pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, + pStartTime: PSYSTEMTIME, + pEndTime: PSYSTEMTIME, + pExtensions: PCERT_EXTENSIONS, + ) -> PCCERT_CONTEXT; +} +pub const CERT_CREATE_SELFSIGN_NO_SIGN: DWORD = 1; +pub const CERT_CREATE_SELFSIGN_NO_KEY_INFO: DWORD = 2; +extern "system" { + pub fn CryptGetKeyIdentifierProperty( + pKeyIdentifier: *const CRYPT_HASH_BLOB, + dwPropId: DWORD, + dwFlags: DWORD, + pwszComputerName: LPCWSTR, + pvReserved: *mut c_void, + pvData: *mut c_void, + pcbData: *mut DWORD, + ) -> BOOL; +} +pub const CRYPT_KEYID_MACHINE_FLAG: DWORD = 0x00000020; +pub const CRYPT_KEYID_ALLOC_FLAG: DWORD = 0x00008000; +extern "system" { + pub fn CryptSetKeyIdentifierProperty( + pKeyIdentifier: *const CRYPT_HASH_BLOB, + dwPropId: DWORD, + dwFlags: DWORD, + pwszComputerName: LPCWSTR, + pvReserved: *mut c_void, + pvData: *const c_void, + ) -> BOOL; +} +pub const CRYPT_KEYID_DELETE_FLAG: DWORD = 0x00000010; +pub const CRYPT_KEYID_SET_NEW_FLAG: DWORD = 0x00002000; +FN!{stdcall PFN_CRYPT_ENUM_KEYID_PROP( + pKeyIdentifier: *const CRYPT_HASH_BLOB, + dwFlags: DWORD, + pvReserved: *mut c_void, + pvArg: *mut c_void, + cProp: DWORD, + rgdwPropId: *mut DWORD, + rgpvData: *mut *mut c_void, + rgcbData: *mut DWORD, +) -> BOOL} +extern "system" { + pub fn CryptEnumKeyIdentifierProperties( + pKeyIdentifier: *const CRYPT_HASH_BLOB, + dwPropId: DWORD, + dwFlags: DWORD, + pwszComputerName: LPCWSTR, + pvReserved: *mut c_void, + pvArg: *mut c_void, + pfnEnum: PFN_CRYPT_ENUM_KEYID_PROP, + ) -> BOOL; + pub fn CryptCreateKeyIdentifierFromCSP( + dwCertEncodingType: DWORD, + pszPubKeyOID: LPCSTR, + pPubKeyStruc: *const PUBLICKEYSTRUC, + cbPubKeyStruc: DWORD, + dwFlags: DWORD, + pvReserved: *mut c_void, + pbHash: *mut BYTE, + pcbHash: *mut DWORD, + ) -> BOOL; +} +pub const CERT_CHAIN_CONFIG_REGPATH: &'static str + = "Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CertDllCreateCertificateChainEngine\\Config"; +pub const CERT_CHAIN_MAX_URL_RETRIEVAL_BYTE_COUNT_VALUE_NAME: &'static str + = "MaxUrlRetrievalByteCount"; +pub const CERT_CHAIN_MAX_URL_RETRIEVAL_BYTE_COUNT_DEFAULT: DWORD = 100 * 1024 * 1024; +pub const CERT_CHAIN_CACHE_RESYNC_FILETIME_VALUE_NAME: &'static str = "ChainCacheResyncFiletime"; +pub const CERT_CHAIN_DISABLE_MANDATORY_BASIC_CONSTRAINTS_VALUE_NAME: &'static str + = "DisableMandatoryBasicConstraints"; +pub const CERT_CHAIN_DISABLE_CA_NAME_CONSTRAINTS_VALUE_NAME: &'static str + = "DisableCANameConstraints"; +pub const CERT_CHAIN_DISABLE_UNSUPPORTED_CRITICAL_EXTENSIONS_VALUE_NAME: &'static str + = "DisableUnsupportedCriticalExtensions"; +pub const CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_VALUE_NAME: &'static str = "MaxAIAUrlCountInCert"; +pub const CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_DEFAULT: DWORD = 5; +pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_VALUE_NAME: &'static str + = "MaxAIAUrlRetrievalCountPerChain"; +pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_DEFAULT: DWORD = 3; +pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_VALUE_NAME: &'static str + = "MaxAIAUrlRetrievalByteCount"; +pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_DEFAULT: DWORD = 100000; +pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_VALUE_NAME: &'static str + = "MaxAIAUrlRetrievalCertCount"; +pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_DEFAULT: DWORD = 10; +pub const CERT_CHAIN_OCSP_VALIDITY_SECONDS_VALUE_NAME: &'static str + = "OcspValiditySeconds"; +pub const CERT_CHAIN_OCSP_VALIDITY_SECONDS_DEFAULT: DWORD = 12 * 60 * 60; +pub const CERT_CHAIN_DISABLE_SERIAL_CHAIN_VALUE_NAME: &'static str = "DisableSerialChain"; +pub const CERT_CHAIN_SERIAL_CHAIN_LOG_FILE_NAME_VALUE_NAME: &'static str + = "SerialChainLogFileName"; +pub const CERT_CHAIN_DISABLE_SYNC_WITH_SSL_TIME_VALUE_NAME: &'static str + = "DisableSyncWithSslTime"; +pub const CERT_CHAIN_MAX_SSL_TIME_UPDATED_EVENT_COUNT_VALUE_NAME: &'static str + = "MaxSslTimeUpdatedEventCount"; +pub const CERT_CHAIN_MAX_SSL_TIME_UPDATED_EVENT_COUNT_DEFAULT: DWORD = 5; +pub const CERT_CHAIN_MAX_SSL_TIME_UPDATED_EVENT_COUNT_DISABLE: DWORD = 0xFFFFFFFF; +pub const CERT_CHAIN_SSL_HANDSHAKE_LOG_FILE_NAME_VALUE_NAME: &'static str + = "SslHandshakeLogFileName"; +pub const CERT_CHAIN_ENABLE_WEAK_SIGNATURE_FLAGS_VALUE_NAME: &'static str + = "EnableWeakSignatureFlags"; +pub const CERT_CHAIN_ENABLE_MD2_MD4_FLAG: DWORD = 0x00000001; +pub const CERT_CHAIN_ENABLE_WEAK_RSA_ROOT_FLAG: DWORD = 0x00000002; +pub const CERT_CHAIN_ENABLE_WEAK_LOGGING_FLAG: DWORD = 0x00000004; +pub const CERT_CHAIN_ENABLE_ONLY_WEAK_LOGGING_FLAG: DWORD = 0x00000008; +pub const CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_VALUE_NAME: &'static str = "MinRsaPubKeyBitLength"; +pub const CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_DEFAULT: DWORD = 1023; +pub const CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_DISABLE: DWORD = 0xFFFFFFFF; +pub const CERT_CHAIN_WEAK_RSA_PUB_KEY_TIME_VALUE_NAME: &'static str = "WeakRsaPubKeyTime"; +pub const CERT_CHAIN_WEAK_RSA_PUB_KEY_TIME_DEFAULT: u64 = 0x01CA8A755C6E0000; +pub const CERT_CHAIN_WEAK_SIGNATURE_LOG_DIR_VALUE_NAME: &'static str = "WeakSignatureLogDir"; +pub const CERT_CHAIN_DEFAULT_CONFIG_SUBDIR: &'static str = "Default"; +pub const CERT_CHAIN_WEAK_PREFIX_NAME: &'static str = "Weak"; +pub const CERT_CHAIN_WEAK_THIRD_PARTY_CONFIG_NAME: &'static str = "ThirdParty"; +pub const CERT_CHAIN_WEAK_ALL_CONFIG_NAME: &'static str = "Al"; +pub const CERT_CHAIN_WEAK_FLAGS_NAME: &'static str = "Flags"; +pub const CERT_CHAIN_WEAK_HYGIENE_NAME: &'static str = "Hygiene"; +pub const CERT_CHAIN_WEAK_AFTER_TIME_NAME: &'static str = "AfterTime"; +pub const CERT_CHAIN_WEAK_FILE_HASH_AFTER_TIME_NAME: &'static str = "FileHashAfterTime"; +pub const CERT_CHAIN_WEAK_TIMESTAMP_HASH_AFTER_TIME_NAME: &'static str = "TimestampHashAfterTime"; +pub const CERT_CHAIN_WEAK_MIN_BIT_LENGTH_NAME: &'static str = "MinBitLength"; +pub const CERT_CHAIN_WEAK_SHA256_ALLOW_NAME: &'static str = "Sha256Allow"; +pub const CERT_CHAIN_MIN_PUB_KEY_BIT_LENGTH_DISABLE: DWORD = 0xFFFFFFFF; +pub const CERT_CHAIN_ENABLE_WEAK_SETTINGS_FLAG: DWORD = 0x80000000; +pub const CERT_CHAIN_DISABLE_ALL_EKU_WEAK_FLAG: DWORD = 0x00010000; +pub const CERT_CHAIN_ENABLE_ALL_EKU_HYGIENE_FLAG: DWORD = 0x00020000; +pub const CERT_CHAIN_DISABLE_OPT_IN_SERVER_AUTH_WEAK_FLAG: DWORD = 0x00040000; +pub const CERT_CHAIN_DISABLE_SERVER_AUTH_WEAK_FLAG: DWORD = 0x00100000; +pub const CERT_CHAIN_ENABLE_SERVER_AUTH_HYGIENE_FLAG: DWORD = 0x00200000; +pub const CERT_CHAIN_DISABLE_CODE_SIGNING_WEAK_FLAG: DWORD = 0x00400000; +pub const CERT_CHAIN_DISABLE_MOTW_CODE_SIGNING_WEAK_FLAG: DWORD = 0x00800000; +pub const CERT_CHAIN_ENABLE_CODE_SIGNING_HYGIENE_FLAG: DWORD = 0x01000000; +pub const CERT_CHAIN_ENABLE_MOTW_CODE_SIGNING_HYGIENE_FLAG: DWORD = 0x02000000; +pub const CERT_CHAIN_DISABLE_TIMESTAMP_WEAK_FLAG: DWORD = 0x04000000; +pub const CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_WEAK_FLAG: DWORD = 0x08000000; +pub const CERT_CHAIN_ENABLE_TIMESTAMP_HYGIENE_FLAG: DWORD = 0x10000000; +pub const CERT_CHAIN_ENABLE_MOTW_TIMESTAMP_HYGIENE_FLAG: DWORD = 0x20000000; +pub const CERT_CHAIN_MOTW_IGNORE_AFTER_TIME_WEAK_FLAG: DWORD = 0x40000000; +pub const CERT_CHAIN_DISABLE_FILE_HASH_WEAK_FLAG: DWORD = 0x00001000; +pub const CERT_CHAIN_DISABLE_MOTW_FILE_HASH_WEAK_FLAG: DWORD = 0x00002000; +pub const CERT_CHAIN_DISABLE_TIMESTAMP_HASH_WEAK_FLAG: DWORD = 0x00004000; +pub const CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_HASH_WEAK_FLAG: DWORD = 0x00008000; +pub const CERT_CHAIN_DISABLE_WEAK_FLAGS: DWORD = CERT_CHAIN_DISABLE_ALL_EKU_WEAK_FLAG + | CERT_CHAIN_DISABLE_SERVER_AUTH_WEAK_FLAG | CERT_CHAIN_DISABLE_OPT_IN_SERVER_AUTH_WEAK_FLAG + | CERT_CHAIN_DISABLE_CODE_SIGNING_WEAK_FLAG | CERT_CHAIN_DISABLE_MOTW_CODE_SIGNING_WEAK_FLAG + | CERT_CHAIN_DISABLE_TIMESTAMP_WEAK_FLAG | CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_WEAK_FLAG; +pub const CERT_CHAIN_DISABLE_FILE_HASH_WEAK_FLAGS: DWORD = CERT_CHAIN_DISABLE_FILE_HASH_WEAK_FLAG + | CERT_CHAIN_DISABLE_MOTW_FILE_HASH_WEAK_FLAG; +pub const CERT_CHAIN_DISABLE_TIMESTAMP_HASH_WEAK_FLAGS: DWORD + = CERT_CHAIN_DISABLE_TIMESTAMP_HASH_WEAK_FLAG + | CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_HASH_WEAK_FLAG; +pub const CERT_CHAIN_ENABLE_HYGIENE_FLAGS: DWORD = CERT_CHAIN_ENABLE_ALL_EKU_HYGIENE_FLAG + | CERT_CHAIN_ENABLE_SERVER_AUTH_HYGIENE_FLAG | CERT_CHAIN_ENABLE_CODE_SIGNING_HYGIENE_FLAG + | CERT_CHAIN_ENABLE_MOTW_CODE_SIGNING_HYGIENE_FLAG | CERT_CHAIN_ENABLE_TIMESTAMP_HYGIENE_FLAG + | CERT_CHAIN_ENABLE_MOTW_TIMESTAMP_HYGIENE_FLAG; +pub const CERT_CHAIN_MOTW_WEAK_FLAGS: DWORD = CERT_CHAIN_DISABLE_MOTW_CODE_SIGNING_WEAK_FLAG + | CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_WEAK_FLAG + | CERT_CHAIN_ENABLE_MOTW_CODE_SIGNING_HYGIENE_FLAG + | CERT_CHAIN_ENABLE_MOTW_TIMESTAMP_HYGIENE_FLAG | CERT_CHAIN_MOTW_IGNORE_AFTER_TIME_WEAK_FLAG; +pub const CERT_CHAIN_OPT_IN_WEAK_FLAGS: DWORD = CERT_CHAIN_DISABLE_OPT_IN_SERVER_AUTH_WEAK_FLAG; +pub const CERT_CHAIN_AUTO_CURRENT_USER: DWORD = 1; +pub const CERT_CHAIN_AUTO_LOCAL_MACHINE: DWORD = 2; +pub const CERT_CHAIN_AUTO_IMPERSONATED: DWORD = 3; +pub const CERT_CHAIN_AUTO_PROCESS_INFO: DWORD = 4; +pub const CERT_CHAIN_AUTO_PINRULE_INFO: DWORD = 5; +pub const CERT_CHAIN_AUTO_NETWORK_INFO: DWORD = 6; +pub const CERT_CHAIN_AUTO_SERIAL_LOCAL_MACHINE: DWORD = 7; +pub const CERT_CHAIN_AUTO_HPKP_RULE_INFO: DWORD = 8; +pub const CERT_CHAIN_AUTO_FLAGS_VALUE_NAME: &'static str = "AutoFlags"; +pub const CERT_CHAIN_AUTO_FLUSH_DISABLE_FLAG: DWORD = 0x00000001; +pub const CERT_CHAIN_AUTO_LOG_CREATE_FLAG: DWORD = 0x00000002; +pub const CERT_CHAIN_AUTO_LOG_FREE_FLAG: DWORD = 0x00000004; +pub const CERT_CHAIN_AUTO_LOG_FLUSH_FLAG: DWORD = 0x00000008; +pub const CERT_CHAIN_AUTO_LOG_FLAGS: DWORD = CERT_CHAIN_AUTO_LOG_CREATE_FLAG + | CERT_CHAIN_AUTO_LOG_FREE_FLAG | CERT_CHAIN_AUTO_LOG_FLUSH_FLAG; +pub const CERT_CHAIN_AUTO_FLUSH_FIRST_DELTA_SECONDS_VALUE_NAME: &'static str + = "AutoFlushFirstDeltaSeconds"; +pub const CERT_CHAIN_AUTO_FLUSH_FIRST_DELTA_SECONDS_DEFAULT: DWORD = 5 * 60; +pub const CERT_CHAIN_AUTO_FLUSH_NEXT_DELTA_SECONDS_VALUE_NAME: &'static str + = "AutoFlushNextDeltaSeconds"; +pub const CERT_CHAIN_AUTO_FLUSH_NEXT_DELTA_SECONDS_DEFAULT: DWORD = 30 * 60; +pub const CERT_CHAIN_AUTO_LOG_FILE_NAME_VALUE_NAME: &'static str = "AutoLogFileName"; +pub const CERT_CHAIN_DISABLE_AUTO_FLUSH_PROCESS_NAME_LIST_VALUE_NAME: &'static str + = "DisableAutoFlushProcessNameList"; +pub const CERT_SRV_OCSP_RESP_MIN_VALIDITY_SECONDS_VALUE_NAME: &'static str + = "SrvOcspRespMinValiditySeconds"; +pub const CERT_SRV_OCSP_RESP_MIN_VALIDITY_SECONDS_DEFAULT: DWORD = 10 * 60; +pub const CERT_SRV_OCSP_RESP_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_VALUE_NAME: &'static str + = "SrvOcspRespUrlRetrievalTimeoutMilliseconds"; +pub const CERT_SRV_OCSP_RESP_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT: DWORD = 15 * 1000; +pub const CERT_SRV_OCSP_RESP_MAX_BEFORE_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str + = "SrvOcspRespMaxBeforeNextUpdateSeconds"; +pub const CERT_SRV_OCSP_RESP_MAX_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 4 * 60 * 60; +pub const CERT_SRV_OCSP_RESP_MIN_BEFORE_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str + = "SrvOcspRespMinBeforeNextUpdateSeconds"; +pub const CERT_SRV_OCSP_RESP_MIN_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 2 * 60; +pub const CERT_SRV_OCSP_RESP_MIN_AFTER_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str + = "SrvOcspRespMinAfterNextUpdateSeconds"; +pub const CERT_SRV_OCSP_RESP_MIN_AFTER_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 1 * 60; +pub const CERT_SRV_OCSP_RESP_MIN_SYNC_CERT_FILE_SECONDS_VALUE_NAME: &'static str + = "SrvOcspRespMinSyncCertFileSeconds"; +pub const CERT_SRV_OCSP_RESP_MIN_SYNC_CERT_FILE_SECONDS_DEFAULT: DWORD = 5; +pub const CERT_SRV_OCSP_RESP_MAX_SYNC_CERT_FILE_SECONDS_VALUE_NAME: &'static str + = "SrvOcspRespMaxSyncCertFileSeconds"; +pub const CERT_SRV_OCSP_RESP_MAX_SYNC_CERT_FILE_SECONDS_DEFAULT: DWORD = 1 * 60 * 60; +pub const CRYPTNET_MAX_CACHED_OCSP_PER_CRL_COUNT_VALUE_NAME: &'static str + = "CryptnetMaxCachedOcspPerCrlCount"; +pub const CRYPTNET_MAX_CACHED_OCSP_PER_CRL_COUNT_DEFAULT: DWORD = 500; +pub const CRYPTNET_OCSP_AFTER_CRL_DISABLE: DWORD = 0xFFFFFFFF; +pub const CRYPTNET_URL_CACHE_DEFAULT_FLUSH_EXEMPT_SECONDS_VALUE_NAME: &'static str + = "CryptnetDefaultFlushExemptSeconds"; +pub const CRYPTNET_URL_CACHE_DEFAULT_FLUSH_EXEMPT_SECONDS_DEFAULT: DWORD = 28 * 24 * 60 * 60; +pub const CRYPTNET_PRE_FETCH_MIN_MAX_AGE_SECONDS_VALUE_NAME: &'static str + = "CryptnetPreFetchMinMaxAgeSeconds"; +pub const CRYPTNET_PRE_FETCH_MIN_MAX_AGE_SECONDS_DEFAULT: DWORD = 1 * 60 * 60; +pub const CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_VALUE_NAME: &'static str + = "CryptnetPreFetchMaxMaxAgeSeconds"; +pub const CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_DEFAULT: DWORD = 14 * 24 * 60 * 60; +pub const CRYPTNET_PRE_FETCH_MIN_OCSP_VALIDITY_PERIOD_SECONDS_VALUE_NAME: &'static str + = "CryptnetPreFetchMinOcspValidityPeriodSeconds"; +pub const CRYPTNET_PRE_FETCH_MIN_OCSP_VALIDITY_PERIOD_SECONDS_DEFAULT: DWORD = 14 * 24 * 60 * 60; +pub const CRYPTNET_PRE_FETCH_AFTER_PUBLISH_PRE_FETCH_DIVISOR_VALUE_NAME: &'static str + = "CryptnetPreFetchAfterPublishPreFetchDivisor"; +pub const CRYPTNET_PRE_FETCH_AFTER_PUBLISH_PRE_FETCH_DIVISOR_DEFAULT: DWORD = 10; +pub const CRYPTNET_PRE_FETCH_BEFORE_NEXT_UPDATE_PRE_FETCH_DIVISOR_VALUE_NAME: &'static str + = "CryptnetPreFetchBeforeNextUpdatePreFetchDivisor"; +pub const CRYPTNET_PRE_FETCH_BEFORE_NEXT_UPDATE_PRE_FETCH_DIVISOR_DEFAULT: DWORD = 20; +pub const CRYPTNET_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_VALUE_NAME: + &'static str = "CryptnetPreFetchMinBeforeNextUpdatePreFetchSeconds"; +pub const CRYPTNET_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAULT: DWORD + = 1 * 60 * 60; +pub const CRYPTNET_PRE_FETCH_VALIDITY_PERIOD_AFTER_NEXT_UPDATE_PRE_FETCH_DIVISOR_VALUE_NAME: + &'static str = "CryptnetPreFetchValidityPeriodAfterNextUpdatePreFetchDivisor"; +pub const CRYPTNET_PRE_FETCH_VALIDITY_PERIOD_AFTER_NEXT_UPDATE_PRE_FETCH_DIVISOR_DEFAULT: DWORD + = 10; +pub const CRYPTNET_PRE_FETCH_MAX_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_VALUE_NAME: + &'static str = "CryptnetPreFetchMaxAfterNextUpdatePreFetchPeriodSeconds"; +pub const CRYPTNET_PRE_FETCH_MAX_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAULT: DWORD + = 4 * 60 * 60; +pub const CRYPTNET_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_VALUE_NAME: + &'static str = "CryptnetPreFetchMinAfterNextUpdatePreFetchPeriodSeconds"; +pub const CRYPTNET_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAULT: DWORD + = 30 * 60; +pub const CRYPTNET_PRE_FETCH_AFTER_CURRENT_TIME_PRE_FETCH_PERIOD_SECONDS_VALUE_NAME: &'static str + = "CryptnetPreFetchAfterCurrentTimePreFetchPeriodSeconds"; +pub const CRYPTNET_PRE_FETCH_AFTER_CURRENT_TIME_PRE_FETCH_PERIOD_SECONDS_DEFAULT: DWORD + = 30 * 60; +pub const CRYPTNET_PRE_FETCH_TRIGGER_PERIOD_SECONDS_VALUE_NAME: &'static str + = "CryptnetPreFetchTriggerPeriodSeconds"; +pub const CRYPTNET_PRE_FETCH_TRIGGER_PERIOD_SECONDS_DEFAULT: DWORD = 10 * 60; +pub const CRYPTNET_PRE_FETCH_TRIGGER_DISABLE: DWORD = 0xFFFFFFFF; +pub const CRYPTNET_PRE_FETCH_SCAN_AFTER_TRIGGER_DELAY_SECONDS_VALUE_NAME: &'static str + = "CryptnetPreFetchScanAfterTriggerDelaySeconds"; +pub const CRYPTNET_PRE_FETCH_SCAN_AFTER_TRIGGER_DELAY_SECONDS_DEFAULT: DWORD = 60; +pub const CRYPTNET_PRE_FETCH_RETRIEVAL_TIMEOUT_SECONDS_VALUE_NAME: &'static str + = "CryptnetPreFetchRetrievalTimeoutSeconds"; +pub const CRYPTNET_PRE_FETCH_RETRIEVAL_TIMEOUT_SECONDS_DEFAULT: DWORD = 5 * 60; +pub const CRYPTNET_CRL_PRE_FETCH_CONFIG_REGPATH: &'static str + = "Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CertDllCreateCertificateChainEngine\\Config\\CrlPreFetch"; +pub const CRYPTNET_CRL_PRE_FETCH_PROCESS_NAME_LIST_VALUE_NAME: &'static str = "ProcessNameList"; +pub const CRYPTNET_CRL_PRE_FETCH_URL_LIST_VALUE_NAME: &'static str = "PreFetchUrlList"; +pub const CRYPTNET_CRL_PRE_FETCH_DISABLE_INFORMATION_EVENTS_VALUE_NAME: &'static str + = "DisableInformationEvents"; +pub const CRYPTNET_CRL_PRE_FETCH_LOG_FILE_NAME_VALUE_NAME: &'static str = "LogFileName"; +pub const CRYPTNET_CRL_PRE_FETCH_TIMEOUT_SECONDS_VALUE_NAME: &'static str = "TimeoutSeconds"; +pub const CRYPTNET_CRL_PRE_FETCH_TIMEOUT_SECONDS_DEFAULT: DWORD = 5 * 60; +pub const CRYPTNET_CRL_PRE_FETCH_MAX_AGE_SECONDS_VALUE_NAME: &'static str = "MaxAgeSeconds"; +pub const CRYPTNET_CRL_PRE_FETCH_MAX_AGE_SECONDS_DEFAULT: DWORD = 2 * 60 * 60; +pub const CRYPTNET_CRL_PRE_FETCH_MAX_AGE_SECONDS_MIN: DWORD = 5 * 60; +pub const CRYPTNET_CRL_PRE_FETCH_PUBLISH_BEFORE_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str + = "PublishBeforeNextUpdateSeconds"; +pub const CRYPTNET_CRL_PRE_FETCH_PUBLISH_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 1 * 60 * 60; +pub const CRYPTNET_CRL_PRE_FETCH_PUBLISH_RANDOM_INTERVAL_SECONDS_VALUE_NAME: &'static str + = "PublishRandomIntervalSeconds"; +pub const CRYPTNET_CRL_PRE_FETCH_PUBLISH_RANDOM_INTERVAL_SECONDS_DEFAULT: DWORD = 5 * 60; +pub const CRYPTNET_CRL_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str + = "MinBeforeNextUpdateSeconds"; +pub const CRYPTNET_CRL_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 5 * 60; +pub const CRYPTNET_CRL_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str + = "MinAfterNextUpdateSeconds"; +pub const CRYPTNET_CRL_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 5 * 60; +pub const CERT_GROUP_POLICY_CHAIN_CONFIG_REGPATH: &'static str + = "Software\\Policies\\Microsoft\\SystemCertificates\\ChainEngine\\Config"; +pub const CERT_CHAIN_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_VALUE_NAME: &'static str + = "ChainUrlRetrievalTimeoutMilliseconds"; +pub const CERT_CHAIN_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT: DWORD = 15 * 1000; +pub const CERT_CHAIN_REV_ACCUMULATIVE_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_VALUE_NAME: &'static str + = "ChainRevAccumulativeUrlRetrievalTimeoutMilliseconds"; +pub const CERT_CHAIN_REV_ACCUMULATIVE_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT: DWORD + = 20 * 1000; +pub const CERT_RETR_BEHAVIOR_INET_AUTH_VALUE_NAME: &'static str = "EnableInetUnknownAuth"; +pub const CERT_RETR_BEHAVIOR_INET_STATUS_VALUE_NAME: &'static str = "EnableInetLocal"; +pub const CERT_RETR_BEHAVIOR_FILE_VALUE_NAME: &'static str = "AllowFileUrlScheme"; +pub const CERT_RETR_BEHAVIOR_LDAP_VALUE_NAME: &'static str = "DisableLDAPSignAndEncrypt"; +pub const CRYPTNET_CACHED_OCSP_SWITCH_TO_CRL_COUNT_VALUE_NAME: &'static str + = "CryptnetCachedOcspSwitchToCrlCount"; +pub const CRYPTNET_CACHED_OCSP_SWITCH_TO_CRL_COUNT_DEFAULT: DWORD = 50; +pub const CRYPTNET_CRL_BEFORE_OCSP_ENABLE: DWORD = 0xFFFFFFFF; +pub const CERT_CHAIN_DISABLE_AIA_URL_RETRIEVAL_VALUE_NAME: &'static str = "DisableAIAUrlRetrieval"; +pub const CERT_CHAIN_OPTIONS_VALUE_NAME: &'static str = "Options"; +pub const CERT_CHAIN_OPTION_DISABLE_AIA_URL_RETRIEVAL: DWORD = 0x2; +pub const CERT_CHAIN_OPTION_ENABLE_SIA_URL_RETRIEVAL: DWORD = 0x4; +pub const CERT_CHAIN_CROSS_CERT_DOWNLOAD_INTERVAL_HOURS_VALUE_NAME: &'static str + = "CrossCertDownloadIntervalHours"; +pub const CERT_CHAIN_CROSS_CERT_DOWNLOAD_INTERVAL_HOURS_DEFAULT: DWORD = 24 * 7; +pub const CERT_CHAIN_CRL_VALIDITY_EXT_PERIOD_HOURS_VALUE_NAME: &'static str + = "CRLValidityExtensionPeriod"; +pub const CERT_CHAIN_CRL_VALIDITY_EXT_PERIOD_HOURS_DEFAULT: DWORD = 12; +pub type HCERTCHAINENGINE = HANDLE; +pub const HCCE_CURRENT_USER: HCERTCHAINENGINE = 0 as HCERTCHAINENGINE; +pub const HCCE_LOCAL_MACHINE: HCERTCHAINENGINE = 0x1 as HCERTCHAINENGINE; +pub const HCCE_SERIAL_LOCAL_MACHINE: HCERTCHAINENGINE = 0x2 as HCERTCHAINENGINE; +pub const CERT_CHAIN_CACHE_END_CERT: DWORD = 0x00000001; +pub const CERT_CHAIN_THREAD_STORE_SYNC: DWORD = 0x00000002; +pub const CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL: DWORD = 0x00000004; +pub const CERT_CHAIN_USE_LOCAL_MACHINE_STORE: DWORD = 0x00000008; +pub const CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE: DWORD = 0x00000010; +pub const CERT_CHAIN_ENABLE_SHARE_STORE: DWORD = 0x00000020; +STRUCT!{struct CERT_CHAIN_ENGINE_CONFIG { + cbSize: DWORD, + hRestrictedRoot: HCERTSTORE, + hRestrictedTrust: HCERTSTORE, + hRestrictedOther: HCERTSTORE, + cAdditionalStore: DWORD, + rghAdditionalStore: *mut HCERTSTORE, + dwFlags: DWORD, + dwUrlRetrievalTimeout: DWORD, + MaximumCachedCertificates: DWORD, + CycleDetectionModulus: DWORD, + hExclusiveRoot: HCERTSTORE, + hExclusiveTrustedPeople: HCERTSTORE, + dwExclusiveFlags: DWORD, +}} +pub type PCERT_CHAIN_ENGINE_CONFIG = *mut CERT_CHAIN_ENGINE_CONFIG; +extern "system" { + pub fn CertCreateCertificateChainEngine( + pConfig: PCERT_CHAIN_ENGINE_CONFIG, + phChainEngine: *mut HCERTCHAINENGINE, + ) -> BOOL; + pub fn CertFreeCertificateChainEngine( + hChainEngine: HCERTCHAINENGINE, + ); + pub fn CertResyncCertificateChainEngine( + hChainEngine: HCERTCHAINENGINE, + ) -> BOOL; +} +STRUCT!{struct CERT_TRUST_STATUS { + dwErrorStatus: DWORD, + dwInfoStatus: DWORD, +}} +pub type PCERT_TRUST_STATUS = *mut CERT_TRUST_STATUS; +pub const CERT_TRUST_NO_ERROR: DWORD = 0x00000000; +pub const CERT_TRUST_IS_NOT_TIME_VALID: DWORD = 0x00000001; +pub const CERT_TRUST_IS_NOT_TIME_NESTED: DWORD = 0x00000002; +pub const CERT_TRUST_IS_REVOKED: DWORD = 0x00000004; +pub const CERT_TRUST_IS_NOT_SIGNATURE_VALID: DWORD = 0x00000008; +pub const CERT_TRUST_IS_NOT_VALID_FOR_USAGE: DWORD = 0x00000010; +pub const CERT_TRUST_IS_UNTRUSTED_ROOT: DWORD = 0x00000020; +pub const CERT_TRUST_REVOCATION_STATUS_UNKNOWN: DWORD = 0x00000040; +pub const CERT_TRUST_IS_CYCLIC: DWORD = 0x00000080; +pub const CERT_TRUST_INVALID_EXTENSION: DWORD = 0x00000100; +pub const CERT_TRUST_INVALID_POLICY_CONSTRAINTS: DWORD = 0x00000200; +pub const CERT_TRUST_INVALID_BASIC_CONSTRAINTS: DWORD = 0x00000400; +pub const CERT_TRUST_INVALID_NAME_CONSTRAINTS: DWORD = 0x00000800; +pub const CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT: DWORD = 0x00001000; +pub const CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT: DWORD = 0x00002000; +pub const CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT: DWORD = 0x00004000; +pub const CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT: DWORD = 0x00008000; +pub const CERT_TRUST_IS_OFFLINE_REVOCATION: DWORD = 0x01000000; +pub const CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY: DWORD = 0x02000000; +pub const CERT_TRUST_IS_PARTIAL_CHAIN: DWORD = 0x00010000; +pub const CERT_TRUST_CTL_IS_NOT_TIME_VALID: DWORD = 0x00020000; +pub const CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID: DWORD = 0x00040000; +pub const CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE: DWORD = 0x00080000; +pub const CERT_TRUST_HAS_EXACT_MATCH_ISSUER: DWORD = 0x00000001; +pub const CERT_TRUST_HAS_KEY_MATCH_ISSUER: DWORD = 0x00000002; +pub const CERT_TRUST_HAS_NAME_MATCH_ISSUER: DWORD = 0x00000004; +pub const CERT_TRUST_IS_SELF_SIGNED: DWORD = 0x00000008; +pub const CERT_TRUST_AUTO_UPDATE_CA_REVOCATION: DWORD = 0x00000010; +pub const CERT_TRUST_AUTO_UPDATE_END_REVOCATION: DWORD = 0x00000020; +pub const CERT_TRUST_NO_OCSP_FAILOVER_TO_CRL: DWORD = 0x00000040; +pub const CERT_TRUST_IS_KEY_ROLLOVER: DWORD = 0x00000080; +pub const CERT_TRUST_SSL_HANDSHAKE_OCSP: DWORD = 0x00040000; +pub const CERT_TRUST_SSL_TIME_VALID_OCSP: DWORD = 0x00080000; +pub const CERT_TRUST_SSL_RECONNECT_OCSP: DWORD = 0x00100000; +pub const CERT_TRUST_HAS_PREFERRED_ISSUER: DWORD = 0x00000100; +pub const CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY: DWORD = 0x00000200; +pub const CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS: DWORD = 0x00000400; +pub const CERT_TRUST_IS_PEER_TRUSTED: DWORD = 0x00000800; +pub const CERT_TRUST_HAS_CRL_VALIDITY_EXTENDED: DWORD = 0x00001000; +pub const CERT_TRUST_IS_FROM_EXCLUSIVE_TRUST_STORE: DWORD = 0x00002000; +pub const CERT_TRUST_IS_CA_TRUSTED: DWORD = 0x00004000; +pub const CERT_TRUST_HAS_AUTO_UPDATE_WEAK_SIGNATURE: DWORD = 0x00008000; +pub const CERT_TRUST_HAS_ALLOW_WEAK_SIGNATURE: DWORD = 0x00020000; +pub const CERT_TRUST_IS_COMPLEX_CHAIN: DWORD = 0x00010000; +pub const CERT_TRUST_SSL_TIME_VALID: DWORD = 0x01000000; +pub const CERT_TRUST_NO_TIME_CHECK: DWORD = 0x02000000; +STRUCT!{struct CERT_REVOCATION_INFO { + cbSize: DWORD, + dwRevocationResult: DWORD, + pszRevocationOid: LPCSTR, + pvOidSpecificInfo: LPVOID, + fHasFreshnessTime: BOOL, + dwFreshnessTime: DWORD, + pCrlInfo: PCERT_REVOCATION_CRL_INFO, +}} +pub type PCERT_REVOCATION_INFO = *mut CERT_REVOCATION_INFO; +STRUCT!{struct CERT_TRUST_LIST_INFO { + cbSize: DWORD, + pCtlEntry: PCTL_ENTRY, + pCtlContext: PCCTL_CONTEXT, +}} +pub type PCERT_TRUST_LIST_INFO = *mut CERT_TRUST_LIST_INFO; +STRUCT!{struct CERT_CHAIN_ELEMENT { + cbSize: DWORD, + pCertContext: PCCERT_CONTEXT, + TrustStatus: CERT_TRUST_STATUS, + pRevocationInfo: PCERT_REVOCATION_INFO, + pIssuanceUsage: PCERT_ENHKEY_USAGE, + pApplicationUsage: PCERT_ENHKEY_USAGE, + pwszExtendedErrorInfo: LPWSTR, +}} +pub type PCERT_CHAIN_ELEMENT = *mut CERT_CHAIN_ELEMENT; +pub type PCCERT_CHAIN_ELEMENT = *const CERT_CHAIN_ELEMENT; +STRUCT!{struct CERT_SIMPLE_CHAIN { + cbSize: DWORD, + TrustStatus: CERT_TRUST_STATUS, + cElement: DWORD, + rgpElement: *mut PCERT_CHAIN_ELEMENT, + pTrustListInfo: PCERT_TRUST_LIST_INFO, + fHasRevocationFreshnessTime: BOOL, + dwRevocationFreshnessTime: DWORD, +}} +pub type PCERT_SIMPLE_CHAIN = *mut CERT_SIMPLE_CHAIN; +pub type PCCERT_SIMPLE_CHAIN = *const CERT_SIMPLE_CHAIN; +pub type PCERT_CHAIN_CONTEXT = *mut CERT_CHAIN_CONTEXT; +pub type PCCERT_CHAIN_CONTEXT = *const CERT_CHAIN_CONTEXT; +STRUCT!{struct CERT_CHAIN_CONTEXT { + cbSize: DWORD, + TrustStatus: CERT_TRUST_STATUS, + cChain: DWORD, + rgpChain: *mut PCERT_SIMPLE_CHAIN, + cLowerQualityChainContext: DWORD, + rgpLowerQualityChainContext: *mut PCCERT_CHAIN_CONTEXT, + fHasRevocationFreshnessTime: BOOL, + dwRevocationFreshnessTime: DWORD, + dwCreateFlags: DWORD, + ChainId: GUID, +}} +pub const USAGE_MATCH_TYPE_AND: DWORD = 0x00000000; +pub const USAGE_MATCH_TYPE_OR: DWORD = 0x00000001; +STRUCT!{struct CERT_USAGE_MATCH { + dwType: DWORD, + Usage: CERT_ENHKEY_USAGE, +}} +pub type PCERT_USAGE_MATCH = *mut CERT_USAGE_MATCH; +STRUCT!{struct CTL_USAGE_MATCH { + dwType: DWORD, + Usage: CTL_USAGE, +}} +pub type PCTL_USAGE_MATCH = *mut CTL_USAGE_MATCH; +STRUCT!{struct CERT_CHAIN_PARA { + cbSize: DWORD, + RequestedUsage: CERT_USAGE_MATCH, + RequestedIssuancePolicy: CERT_USAGE_MATCH, + dwUrlRetrievalTimeout: DWORD, + fCheckRevocationFreshnessTime: BOOL, + dwRevocationFreshnessTime: DWORD, + pftCacheResync: LPFILETIME, + pStrongSignPara: PCCERT_STRONG_SIGN_PARA, + dwStrongSignFlags: DWORD, +}} +pub type PCERT_CHAIN_PARA = *mut CERT_CHAIN_PARA; +pub const CERT_CHAIN_STRONG_SIGN_DISABLE_END_CHECK_FLAG: DWORD = 0x00000001; +pub const CERT_CHAIN_REVOCATION_CHECK_END_CERT: DWORD = 0x10000000; +pub const CERT_CHAIN_REVOCATION_CHECK_CHAIN: DWORD = 0x20000000; +pub const CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT: DWORD = 0x40000000; +pub const CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY: DWORD = 0x80000000; +pub const CERT_CHAIN_REVOCATION_ACCUMULATIVE_TIMEOUT: DWORD = 0x08000000; +pub const CERT_CHAIN_REVOCATION_CHECK_OCSP_CERT: DWORD = 0x04000000; +pub const CERT_CHAIN_DISABLE_PASS1_QUALITY_FILTERING: DWORD = 0x00000040; +pub const CERT_CHAIN_RETURN_LOWER_QUALITY_CONTEXTS: DWORD = 0x00000080; +pub const CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE: DWORD = 0x00000100; +pub const CERT_CHAIN_TIMESTAMP_TIME: DWORD = 0x00000200; +pub const CERT_CHAIN_ENABLE_PEER_TRUST: DWORD = 0x00000400; +pub const CERT_CHAIN_DISABLE_MY_PEER_TRUST: DWORD = 0x00000800; +pub const CERT_CHAIN_DISABLE_MD2_MD4: DWORD = 0x00001000; +pub const CERT_CHAIN_DISABLE_AIA: DWORD = 0x00002000; +pub const CERT_CHAIN_HAS_MOTW: DWORD = 0x00004000; +pub const CERT_CHAIN_ONLY_ADDITIONAL_AND_AUTH_ROOT: DWORD = 0x00008000; +pub const CERT_CHAIN_OPT_IN_WEAK_SIGNATURE: DWORD = 0x00010000; +extern "system" { + pub fn CertGetCertificateChain( + hChainEngine: HCERTCHAINENGINE, + pCertContext: PCCERT_CONTEXT, + pTime: LPFILETIME, + hAdditionalStore: HCERTSTORE, + pChainPara: PCERT_CHAIN_PARA, + dwFlags: DWORD, + pvReserved: LPVOID, + ppChainContext: *mut PCCERT_CHAIN_CONTEXT, + ) -> BOOL; + pub fn CertFreeCertificateChain( + pChainContext: PCCERT_CHAIN_CONTEXT, + ); + pub fn CertDuplicateCertificateChain( + pChainContext: PCCERT_CHAIN_CONTEXT, + ) -> PCCERT_CHAIN_CONTEXT; +} +STRUCT!{struct CERT_REVOCATION_CHAIN_PARA { + cbSize: DWORD, + hChainEngine: HCERTCHAINENGINE, + hAdditionalStore: HCERTSTORE, + dwChainFlags: DWORD, + dwUrlRetrievalTimeout: DWORD, + pftCurrentTime: LPFILETIME, + pftCacheResync: LPFILETIME, + cbMaxUrlRetrievalByteCount: DWORD, +}} +pub const REVOCATION_OID_CRL_REVOCATION: LPCSTR = 1 as LPCSTR; +STRUCT!{struct CRL_REVOCATION_INFO { + pCrlEntry: PCRL_ENTRY, + pCrlContext: PCCRL_CONTEXT, + pCrlIssuerChain: PCCERT_CHAIN_CONTEXT, +}} +pub type PCRL_REVOCATION_INFO = *mut CRL_REVOCATION_INFO; +extern "system" { + pub fn CertFindChainInStore( + hCertStore: HCERTSTORE, + dwCertEncodingType: DWORD, + dwFindFlags: DWORD, + dwFindType: DWORD, + pvFindPara: *const c_void, + pPrevChainContext: PCCERT_CHAIN_CONTEXT, + ) -> PCCERT_CHAIN_CONTEXT; +} +pub const CERT_CHAIN_FIND_BY_ISSUER: DWORD = 1; +FN!{stdcall PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK( + pCert: PCCERT_CONTEXT, + pvFindArg: *mut c_void, +) -> BOOL} +STRUCT!{struct CERT_CHAIN_FIND_ISSUER_PARA { + cbSize: DWORD, + pszUsageIdentifier: LPCSTR, + dwKeySpec: DWORD, + dwAcquirePrivateKeyFlags: DWORD, + cIssuer: DWORD, + rgIssuer: *mut CERT_NAME_BLOB, + pfnFindCallback: PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK, + pvFindArg: *mut c_void, + pdwIssuerChainIndex: *mut DWORD, + pdwIssuerElementIndex: *mut DWORD, +}} +pub type PCERT_CHAIN_FIND_ISSUER_PARA = *mut CERT_CHAIN_FIND_ISSUER_PARA; +pub type CERT_CHAIN_FIND_BY_ISSUER_PARA = CERT_CHAIN_FIND_ISSUER_PARA; +pub type PCERT_CHAIN_FIND_BY_ISSUER_PARA = *mut CERT_CHAIN_FIND_ISSUER_PARA; +pub const CERT_CHAIN_FIND_BY_ISSUER_COMPARE_KEY_FLAG: DWORD = 0x0001; +pub const CERT_CHAIN_FIND_BY_ISSUER_COMPLEX_CHAIN_FLAG: DWORD = 0x0002; +pub const CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_URL_FLAG: DWORD = 0x0004; +pub const CERT_CHAIN_FIND_BY_ISSUER_LOCAL_MACHINE_FLAG: DWORD = 0x0008; +pub const CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG: DWORD = 0x4000; +pub const CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_FLAG: DWORD = 0x8000; +STRUCT!{struct CERT_CHAIN_POLICY_PARA { + cbSize: DWORD, + dwFlags: DWORD, + pvExtraPolicyPara: *mut c_void, +}} +pub type PCERT_CHAIN_POLICY_PARA = *mut CERT_CHAIN_POLICY_PARA; +STRUCT!{struct CERT_CHAIN_POLICY_STATUS { + cbSize: DWORD, + dwError: DWORD, + lChainIndex: LONG, + lElementIndex: LONG, + pvExtraPolicyStatus: *mut c_void, +}} +pub type PCERT_CHAIN_POLICY_STATUS = *mut CERT_CHAIN_POLICY_STATUS; +pub const CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG: DWORD = 0x00000001; +pub const CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG: DWORD = 0x00000002; +pub const CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG: DWORD = 0x00000004; +pub const CERT_CHAIN_POLICY_IGNORE_INVALID_BASIC_CONSTRAINTS_FLAG: DWORD = 0x00000008; +pub const CERT_CHAIN_POLICY_IGNORE_ALL_NOT_TIME_VALID_FLAGS: DWORD + = CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG + | CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG + | CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG; +pub const CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG: DWORD = 0x00000010; +pub const CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG: DWORD = 0x00000020; +pub const CERT_CHAIN_POLICY_IGNORE_INVALID_NAME_FLAG: DWORD = 0x00000040; +pub const CERT_CHAIN_POLICY_IGNORE_INVALID_POLICY_FLAG: DWORD = 0x00000080; +pub const CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG: DWORD = 0x00000100; +pub const CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG: DWORD = 0x00000200; +pub const CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG: DWORD = 0x00000400; +pub const CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG: DWORD = 0x00000800; +pub const CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS: DWORD + = CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG + | CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG + | CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG + | CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG; +pub const CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG: DWORD = 0x00008000; +pub const CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG: DWORD = 0x00004000; +pub const CERT_CHAIN_POLICY_IGNORE_NOT_SUPPORTED_CRITICAL_EXT_FLAG: DWORD = 0x00002000; +pub const CERT_CHAIN_POLICY_IGNORE_PEER_TRUST_FLAG: DWORD = 0x00001000; +pub const CERT_CHAIN_POLICY_IGNORE_WEAK_SIGNATURE_FLAG: DWORD = 0x08000000; +extern "system" { + pub fn CertVerifyCertificateChainPolicy( + pszPolicyOID: LPCSTR, + pChainContext: PCCERT_CHAIN_CONTEXT, + pPolicyPara: PCERT_CHAIN_POLICY_PARA, + pPolicyStatus: PCERT_CHAIN_POLICY_STATUS, + ) -> BOOL; +} +pub const CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC: &'static str + = "CertDllVerifyCertificateChainPolicy"; +pub const CERT_CHAIN_POLICY_BASE: LPCSTR = 1 as LPCSTR; +pub const CERT_CHAIN_POLICY_AUTHENTICODE: LPCSTR = 2 as LPCSTR; +pub const CERT_CHAIN_POLICY_AUTHENTICODE_TS: LPCSTR = 3 as LPCSTR; +pub const CERT_CHAIN_POLICY_SSL: LPCSTR = 4 as LPCSTR; +pub const CERT_CHAIN_POLICY_BASIC_CONSTRAINTS: LPCSTR = 5 as LPCSTR; +pub const CERT_CHAIN_POLICY_NT_AUTH: LPCSTR = 6 as LPCSTR; +pub const CERT_CHAIN_POLICY_MICROSOFT_ROOT: LPCSTR = 7 as LPCSTR; +pub const CERT_CHAIN_POLICY_EV: LPCSTR = 8 as LPCSTR; +pub const CERT_CHAIN_POLICY_SSL_F12: LPCSTR = 9 as LPCSTR; +pub const CERT_CHAIN_POLICY_SSL_HPKP_HEADER: LPCSTR = 10 as LPCSTR; +pub const CERT_CHAIN_POLICY_THIRD_PARTY_ROOT: LPCSTR = 11 as LPCSTR; +pub const CERT_CHAIN_POLICY_SSL_KEY_PIN: LPCSTR = 12 as LPCSTR; +STRUCT!{struct AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA { + cbSize: DWORD, + dwRegPolicySettings: DWORD, + pSignerInfo: PCMSG_SIGNER_INFO, +}} +pub type PAUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA + = *mut AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA; +STRUCT!{struct AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS { + cbSize: DWORD, + fCommercial: BOOL, +}} +pub type PAUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS + = *mut AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS; +STRUCT!{struct AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA { + cbSize: DWORD, + dwRegPolicySettings: DWORD, + fCommercial: BOOL, +}} +pub type PAUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA + = *mut AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA; +UNION!{union HTTPSPolicyCallbackData_u { + [u32; 1], + cbStruct cbStruct_mut: DWORD, + cbSize cbSize_mut: DWORD, +}} +STRUCT!{struct HTTPSPolicyCallbackData { + u: HTTPSPolicyCallbackData_u, + dwAuthType: DWORD, + fdwChecks: DWORD, + pwszServerName: *mut WCHAR, +}} +pub type PHTTPSPolicyCallbackData = *mut HTTPSPolicyCallbackData; +pub type SSL_EXTRA_CERT_CHAIN_POLICY_PARA = HTTPSPolicyCallbackData; +pub type PSSL_EXTRA_CERT_CHAIN_POLICY_PARA = *mut HTTPSPolicyCallbackData; +pub const AUTHTYPE_CLIENT: DWORD = 1; +pub const AUTHTYPE_SERVER: DWORD = 2; +pub const BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_CA_FLAG: DWORD = 0x80000000; +pub const BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_END_ENTITY_FLAG: DWORD = 0x40000000; +pub const MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG: DWORD = 0x00010000; +pub const MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG: DWORD = 0x00020000; +pub const MICROSOFT_ROOT_CERT_CHAIN_POLICY_DISABLE_FLIGHT_ROOT_FLAG: DWORD = 0x00040000; +STRUCT!{struct EV_EXTRA_CERT_CHAIN_POLICY_PARA { + cbSize: DWORD, + dwRootProgramQualifierFlags: DWORD, +}} +pub type PEV_EXTRA_CERT_CHAIN_POLICY_PARA = *mut EV_EXTRA_CERT_CHAIN_POLICY_PARA; +STRUCT!{struct EV_EXTRA_CERT_CHAIN_POLICY_STATUS { + cbSize: DWORD, + dwQualifiers: DWORD, + dwIssuanceUsageIndex: DWORD, +}} +pub type PEV_EXTRA_CERT_CHAIN_POLICY_STATUS = *mut EV_EXTRA_CERT_CHAIN_POLICY_STATUS; +pub const SSL_F12_ERROR_TEXT_LENGTH: usize = 256; +STRUCT!{struct SSL_F12_EXTRA_CERT_CHAIN_POLICY_STATUS { + cbSize: DWORD, + dwErrorLevel: DWORD, + dwErrorCategory: DWORD, + dwReserved: DWORD, + wszErrorText: [WCHAR; SSL_F12_ERROR_TEXT_LENGTH], +}} +pub type PSSL_F12_EXTRA_CERT_CHAIN_POLICY_STATUS = *mut SSL_F12_EXTRA_CERT_CHAIN_POLICY_STATUS; +pub const CERT_CHAIN_POLICY_SSL_F12_SUCCESS_LEVEL: DWORD = 0; +pub const CERT_CHAIN_POLICY_SSL_F12_WARNING_LEVEL: DWORD = 1; +pub const CERT_CHAIN_POLICY_SSL_F12_ERROR_LEVEL: DWORD = 2; +pub const CERT_CHAIN_POLICY_SSL_F12_NONE_CATEGORY: DWORD = 0; +pub const CERT_CHAIN_POLICY_SSL_F12_WEAK_CRYPTO_CATEGORY: DWORD = 1; +pub const CERT_CHAIN_POLICY_SSL_F12_ROOT_PROGRAM_CATEGORY: DWORD = 2; +pub const SSL_HPKP_PKP_HEADER_INDEX: usize = 0; +pub const SSL_HPKP_PKP_RO_HEADER_INDEX: usize = 1; +pub const SSL_HPKP_HEADER_COUNT: usize = 2; +STRUCT!{struct SSL_HPKP_HEADER_EXTRA_CERT_CHAIN_POLICY_PARA { + cbSize: DWORD, + dwReserved: DWORD, + pwszServerName: LPWSTR, + rgpszHpkpValue: [LPSTR; SSL_HPKP_HEADER_COUNT], +}} +pub type PSSL_HPKP_HEADER_EXTRA_CERT_CHAIN_POLICY_PARA + = *mut SSL_HPKP_HEADER_EXTRA_CERT_CHAIN_POLICY_PARA; +STRUCT!{struct SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_PARA { + cbSize: DWORD, + dwReserved: DWORD, + pwszServerName: PCWSTR, +}} +pub type PSSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_PARA = *mut SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_PARA; +pub const SSL_KEY_PIN_ERROR_TEXT_LENGTH: usize = 512; +STRUCT!{struct SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_STATUS { + cbSize: DWORD, + lError: LONG, + wszErrorText: [WCHAR; SSL_KEY_PIN_ERROR_TEXT_LENGTH], +}} +pub type PSSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_STATUS + = *mut SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_STATUS; +pub const CERT_CHAIN_POLICY_SSL_KEY_PIN_MISMATCH_ERROR: LONG = -2; +pub const CERT_CHAIN_POLICY_SSL_KEY_PIN_MITM_ERROR: LONG = -1; +pub const CERT_CHAIN_POLICY_SSL_KEY_PIN_SUCCESS: LONG = 0; +pub const CERT_CHAIN_POLICY_SSL_KEY_PIN_MITM_WARNING: LONG = 1; +pub const CERT_CHAIN_POLICY_SSL_KEY_PIN_MISMATCH_WARNING: LONG = 2; +extern "system" { + pub fn CryptStringToBinaryA( + pszString: LPCSTR, + cchString: DWORD, + dwFlags: DWORD, + pbBinary: *mut BYTE, + pcbBinary: *mut DWORD, + pdwSkip: *mut DWORD, + pdwFlags: *mut DWORD, + ) -> BOOL; + pub fn CryptStringToBinaryW( + pszString: LPCWSTR, + cchString: DWORD, + dwFlags: DWORD, + pbBinary: *mut BYTE, + pcbBinary: *mut DWORD, + pdwSkip: *mut DWORD, + pdwFlags: *mut DWORD, + ) -> BOOL; + pub fn CryptBinaryToStringA( + pbBinary: *const BYTE, + cbBinary: DWORD, + dwFlags: DWORD, + pszString: LPSTR, + pcchString: *mut DWORD, + ) -> BOOL; + pub fn CryptBinaryToStringW( + pbBinary: *const BYTE, + cbBinary: DWORD, + dwFlags: DWORD, + pszString: LPWSTR, + pcchString: *mut DWORD, + ) -> BOOL; +} +pub const CRYPT_STRING_BASE64HEADER: DWORD = 0x00000000; +pub const CRYPT_STRING_BASE64: DWORD = 0x00000001; +pub const CRYPT_STRING_BINARY: DWORD = 0x00000002; +pub const CRYPT_STRING_BASE64REQUESTHEADER: DWORD = 0x00000003; +pub const CRYPT_STRING_HEX: DWORD = 0x00000004; +pub const CRYPT_STRING_HEXASCII: DWORD = 0x00000005; +pub const CRYPT_STRING_BASE64_ANY: DWORD = 0x00000006; +pub const CRYPT_STRING_ANY: DWORD = 0x00000007; +pub const CRYPT_STRING_HEX_ANY: DWORD = 0x00000008; +pub const CRYPT_STRING_BASE64X509CRLHEADER: DWORD = 0x00000009; +pub const CRYPT_STRING_HEXADDR: DWORD = 0x0000000a; +pub const CRYPT_STRING_HEXASCIIADDR: DWORD = 0x0000000b; +pub const CRYPT_STRING_HEXRAW: DWORD = 0x0000000c; +pub const CRYPT_STRING_BASE64URI: DWORD = 0x0000000d; +pub const CRYPT_STRING_ENCODEMASK: DWORD = 0x000000ff; +pub const CRYPT_STRING_RESERVED100: DWORD = 0x00000100; +pub const CRYPT_STRING_RESERVED200: DWORD = 0x00000200; +pub const CRYPT_STRING_PERCENTESCAPE: DWORD = 0x08000000; +pub const CRYPT_STRING_HASHDATA: DWORD = 0x10000000; +pub const CRYPT_STRING_STRICT: DWORD = 0x20000000; +pub const CRYPT_STRING_NOCRLF: DWORD = 0x40000000; +pub const CRYPT_STRING_NOCR: DWORD = 0x80000000; +pub const szOID_PKCS_12_PbeIds: &'static str = "1.2.840.113549.1.12.1"; +pub const szOID_PKCS_12_pbeWithSHA1And128BitRC4: &'static str = "1.2.840.113549.1.12.1.1"; +pub const szOID_PKCS_12_pbeWithSHA1And40BitRC4: &'static str = "1.2.840.113549.1.12.1.2"; +pub const szOID_PKCS_12_pbeWithSHA1And3KeyTripleDES: &'static str = "1.2.840.113549.1.12.1.3"; +pub const szOID_PKCS_12_pbeWithSHA1And2KeyTripleDES: &'static str = "1.2.840.113549.1.12.1.4"; +pub const szOID_PKCS_12_pbeWithSHA1And128BitRC2: &'static str = "1.2.840.113549.1.12.1.5"; +pub const szOID_PKCS_12_pbeWithSHA1And40BitRC2: &'static str = "1.2.840.113549.1.12.1.6"; +STRUCT!{struct CRYPT_PKCS12_PBE_PARAMS { + iIterations: c_int, + cbSalt: ULONG, +}} +extern "system" { + pub fn PFXImportCertStore( + pPFX: *mut CRYPT_DATA_BLOB, + szPassword: LPCWSTR, + dwFlags: DWORD, + ) -> HCERTSTORE; +} +pub const PKCS12_IMPORT_SILENT: DWORD = 0x00000040; +pub const CRYPT_USER_KEYSET: DWORD = 0x00001000; +pub const PKCS12_PREFER_CNG_KSP: DWORD = 0x00000100; +pub const PKCS12_ALWAYS_CNG_KSP: DWORD = 0x00000200; +pub const PKCS12_ONLY_CERTIFICATES: DWORD = 0x00000400; +pub const PKCS12_ONLY_NOT_ENCRYPTED_CERTIFICATES: DWORD = 0x00000800; +pub const PKCS12_ALLOW_OVERWRITE_KEY: DWORD = 0x00004000; +pub const PKCS12_NO_PERSIST_KEY: DWORD = 0x00008000; +pub const PKCS12_IMPORT_RESERVED_MASK: DWORD = 0xffff0000; +pub const PKCS12_OBJECT_LOCATOR_ALL_IMPORT_FLAGS: DWORD = PKCS12_ALWAYS_CNG_KSP + | PKCS12_NO_PERSIST_KEY | PKCS12_IMPORT_SILENT | PKCS12_INCLUDE_EXTENDED_PROPERTIES; +pub const PKCS12_ONLY_CERTIFICATES_PROVIDER_TYPE: DWORD = 0; +pub const PKCS12_ONLY_CERTIFICATES_PROVIDER_NAME: &'static str = "PfxProvider"; +pub const PKCS12_ONLY_CERTIFICATES_CONTAINER_NAME: &'static str = "PfxContainer"; +extern "system" { + pub fn PFXIsPFXBlob( + pPFX: *mut CRYPT_DATA_BLOB, + ) -> BOOL; + pub fn PFXVerifyPassword( + pPFX: *mut CRYPT_DATA_BLOB, + szPassword: LPCWSTR, + dwFlags: DWORD, + ) -> BOOL; + pub fn PFXExportCertStoreEx( + hStore: HCERTSTORE, + pPFX: *mut CRYPT_DATA_BLOB, + szPassword: LPCWSTR, + pvPara: *mut c_void, + dwFlags: DWORD, + ) -> BOOL; +} +pub const REPORT_NO_PRIVATE_KEY: DWORD = 0x0001; +pub const REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY: DWORD = 0x0002; +pub const EXPORT_PRIVATE_KEYS: DWORD = 0x0004; +pub const PKCS12_INCLUDE_EXTENDED_PROPERTIES: DWORD = 0x0010; +pub const PKCS12_PROTECT_TO_DOMAIN_SIDS: DWORD = 0x0020; +pub const PKCS12_EXPORT_SILENT: DWORD = 0x0040; +pub const PKCS12_DISABLE_ENCRYPT_CERTIFICATES: DWORD = 0x0100; +pub const PKCS12_ENCRYPT_CERTIFICATES: DWORD = 0x0200; +pub const PKCS12_EXPORT_ECC_CURVE_PARAMETERS: DWORD = 0x1000; +pub const PKCS12_EXPORT_ECC_CURVE_OID: DWORD = 0x2000; +pub const PKCS12_EXPORT_RESERVED_MASK: DWORD = 0xffff0000; +pub const PKCS12_CONFIG_REGPATH: &'static str + = "Software\\Microsoft\\Windows\\CurrentVersion\\PFX"; +pub const PKCS12_ENCRYPT_CERTIFICATES_VALUE_NAME: &'static str = "EncryptCertificates"; +extern "system" { + pub fn PFXExportCertStore( + hStore: HCERTSTORE, + pPFX: *mut CRYPT_DATA_BLOB, + szPassword: LPCWSTR, + dwFlags: DWORD, + ) -> BOOL; +} +pub type HCERT_SERVER_OCSP_RESPONSE = *mut c_void; +pub type PCERT_SERVER_OCSP_RESPONSE_CONTEXT = *mut CERT_SERVER_OCSP_RESPONSE_CONTEXT; +pub type PCCERT_SERVER_OCSP_RESPONSE_CONTEXT = *const CERT_SERVER_OCSP_RESPONSE_CONTEXT; +STRUCT!{struct CERT_SERVER_OCSP_RESPONSE_CONTEXT { + cbSize: DWORD, + pbEncodedOcspResponse: *mut BYTE, + cbEncodedOcspResponse: DWORD, +}} +FN!{stdcall PFN_CERT_SERVER_OCSP_RESPONSE_UPDATE_CALLBACK( + pChainContext: PCCERT_CHAIN_CONTEXT, + pServerOcspResponseContext: PCCERT_SERVER_OCSP_RESPONSE_CONTEXT, + pNewCrlContext: PCCRL_CONTEXT, + pPrevCrlContext: PCCRL_CONTEXT, + pvArg: PVOID, + dwWriteOcspFileError: DWORD, +) -> ()} +STRUCT!{struct CERT_SERVER_OCSP_RESPONSE_OPEN_PARA { + cbSize: DWORD, + dwFlags: DWORD, + pcbUsedSize: *mut DWORD, + pwszOcspDirectory: PWSTR, + pfnUpdateCallback: PFN_CERT_SERVER_OCSP_RESPONSE_UPDATE_CALLBACK, + pvUpdateCallbackArg: PVOID, +}} +pub type PCERT_SERVER_OCSP_RESPONSE_OPEN_PARA = *mut CERT_SERVER_OCSP_RESPONSE_OPEN_PARA; +pub const CERT_SERVER_OCSP_RESPONSE_OPEN_PARA_READ_FLAG: DWORD = 0x00000001; +pub const CERT_SERVER_OCSP_RESPONSE_OPEN_PARA_WRITE_FLAG: DWORD = 0x00000002; +extern "system" { + pub fn CertOpenServerOcspResponse( + pChainContext: PCCERT_CHAIN_CONTEXT, + dwFlags: DWORD, + pvReserved: LPVOID, + ) -> HCERT_SERVER_OCSP_RESPONSE; +} +pub const CERT_SERVER_OCSP_RESPONSE_ASYNC_FLAG: DWORD = 0x00000001; +extern "system" { + pub fn CertAddRefServerOcspResponse( + hServerOcspResponse: HCERT_SERVER_OCSP_RESPONSE, + ); + pub fn CertCloseServerOcspResponse( + hServerOcspResponse: HCERT_SERVER_OCSP_RESPONSE, + dwFlags: DWORD, + ); + pub fn CertGetServerOcspResponseContext( + hServerOcspResponse: HCERT_SERVER_OCSP_RESPONSE, + dwFlags: DWORD, + pvReserved: LPVOID, + ) -> PCCERT_SERVER_OCSP_RESPONSE_CONTEXT; + pub fn CertAddRefServerOcspResponseContext( + pServerOcspResponseContext: PCCERT_SERVER_OCSP_RESPONSE_CONTEXT, + ); + pub fn CertFreeServerOcspResponseContext( + pServerOcspResponseContext: PCCERT_SERVER_OCSP_RESPONSE_CONTEXT, + ); + pub fn CertRetrieveLogoOrBiometricInfo( + pCertContext: PCCERT_CONTEXT, + lpszLogoOrBiometricType: LPCSTR, + dwRetrievalFlags: DWORD, + dwTimeout: DWORD, + dwFlags: DWORD, + pvReserved: *mut c_void, + ppbData: *mut *mut BYTE, + pcbData: *mut DWORD, + ppwszMimeType: *mut LPWSTR, + ) -> BOOL; +} +pub const CERT_RETRIEVE_ISSUER_LOGO: LPCSTR = 1 as LPCSTR; +pub const CERT_RETRIEVE_SUBJECT_LOGO: LPCSTR = 2 as LPCSTR; +pub const CERT_RETRIEVE_COMMUNITY_LOGO: LPCSTR = 3 as LPCSTR; +pub const CERT_RETRIEVE_BIOMETRIC_PREDEFINED_BASE_TYPE: LPCSTR = 1000 as LPCSTR; +pub const CERT_RETRIEVE_BIOMETRIC_PICTURE_TYPE: LPCSTR + = (1000 + CERT_BIOMETRIC_PICTURE_TYPE) as LPCSTR; +pub const CERT_RETRIEVE_BIOMETRIC_SIGNATURE_TYPE: LPCSTR + = (1000 + CERT_BIOMETRIC_SIGNATURE_TYPE) as LPCSTR; +STRUCT!{struct CERT_SELECT_CHAIN_PARA { + hChainEngine: HCERTCHAINENGINE, + pTime: PFILETIME, + hAdditionalStore: HCERTSTORE, + pChainPara: PCERT_CHAIN_PARA, + dwFlags: DWORD, +}} +pub type PCERT_SELECT_CHAIN_PARA = *mut CERT_SELECT_CHAIN_PARA; +pub type PCCERT_SELECT_CHAIN_PARA = *const CERT_SELECT_CHAIN_PARA; +pub const CERT_SELECT_MAX_PARA: DWORD = 500; +STRUCT!{struct CERT_SELECT_CRITERIA { + dwType: DWORD, + cPara: DWORD, + ppPara: *mut *mut c_void, +}} +pub type PCERT_SELECT_CRITERIA = *mut CERT_SELECT_CRITERIA; +pub type PCCERT_SELECT_CRITERIA = *const CERT_SELECT_CRITERIA; +pub const CERT_SELECT_BY_ENHKEY_USAGE: DWORD = 1; +pub const CERT_SELECT_BY_KEY_USAGE: DWORD = 2; +pub const CERT_SELECT_BY_POLICY_OID: DWORD = 3; +pub const CERT_SELECT_BY_PROV_NAME: DWORD = 4; +pub const CERT_SELECT_BY_EXTENSION: DWORD = 5; +pub const CERT_SELECT_BY_SUBJECT_HOST_NAME: DWORD = 6; +pub const CERT_SELECT_BY_ISSUER_ATTR: DWORD = 7; +pub const CERT_SELECT_BY_SUBJECT_ATTR: DWORD = 8; +pub const CERT_SELECT_BY_ISSUER_NAME: DWORD = 9; +pub const CERT_SELECT_BY_PUBLIC_KEY: DWORD = 10; +pub const CERT_SELECT_BY_TLS_SIGNATURES: DWORD = 11; +pub const CERT_SELECT_BY_ISSUER_DISPLAYNAME: DWORD = 12; +pub const CERT_SELECT_BY_FRIENDLYNAME: DWORD = 13; +pub const CERT_SELECT_BY_THUMBPRINT: DWORD = 14; +pub const CERT_SELECT_LAST: DWORD = CERT_SELECT_BY_TLS_SIGNATURES; +pub const CERT_SELECT_MAX: DWORD = CERT_SELECT_LAST * 3; +pub const CERT_SELECT_ALLOW_EXPIRED: DWORD = 0x00000001; +pub const CERT_SELECT_TRUSTED_ROOT: DWORD = 0x00000002; +pub const CERT_SELECT_DISALLOW_SELFSIGNED: DWORD = 0x00000004; +pub const CERT_SELECT_HAS_PRIVATE_KEY: DWORD = 0x00000008; +pub const CERT_SELECT_HAS_KEY_FOR_SIGNATURE: DWORD = 0x00000010; +pub const CERT_SELECT_HAS_KEY_FOR_KEY_EXCHANGE: DWORD = 0x00000020; +pub const CERT_SELECT_HARDWARE_ONLY: DWORD = 0x00000040; +pub const CERT_SELECT_ALLOW_DUPLICATES: DWORD = 0x00000080; +pub const CERT_SELECT_IGNORE_AUTOSELECT: DWORD = 0x00000100; +extern "system" { + pub fn CertSelectCertificateChains( + pSelectionContext: LPCGUID, + dwFlags: DWORD, + pChainParameters: PCCERT_SELECT_CHAIN_PARA, + cCriteria: DWORD, + rgpCriteria: PCCERT_SELECT_CRITERIA, + hStore: HCERTSTORE, + pcSelection: PDWORD, + pprgpSelection: *mut *mut PCCERT_CHAIN_CONTEXT, + ) -> BOOL; + pub fn CertFreeCertificateChainList( + prgpSelection: *mut PCCERT_CHAIN_CONTEXT, + ); +} +pub const TIMESTAMP_VERSION: DWORD = 1; +STRUCT!{struct CRYPT_TIMESTAMP_REQUEST { + dwVersion: DWORD, + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + HashedMessage: CRYPT_DER_BLOB, + pszTSAPolicyId: LPSTR, + Nonce: CRYPT_INTEGER_BLOB, + fCertReq: BOOL, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type PCRYPT_TIMESTAMP_REQUEST = *mut CRYPT_TIMESTAMP_REQUEST; +STRUCT!{struct CRYPT_TIMESTAMP_RESPONSE { + dwStatus: DWORD, + cFreeText: DWORD, + rgFreeText: *mut LPWSTR, + FailureInfo: CRYPT_BIT_BLOB, + ContentInfo: CRYPT_DER_BLOB, +}} +pub type PCRYPT_TIMESTAMP_RESPONSE = *mut CRYPT_TIMESTAMP_RESPONSE; +pub const TIMESTAMP_STATUS_GRANTED: DWORD = 0; +pub const TIMESTAMP_STATUS_GRANTED_WITH_MODS: DWORD = 1; +pub const TIMESTAMP_STATUS_REJECTED: DWORD = 2; +pub const TIMESTAMP_STATUS_WAITING: DWORD = 3; +pub const TIMESTAMP_STATUS_REVOCATION_WARNING: DWORD = 4; +pub const TIMESTAMP_STATUS_REVOKED: DWORD = 5; +pub const TIMESTAMP_FAILURE_BAD_ALG: DWORD = 0; +pub const TIMESTAMP_FAILURE_BAD_REQUEST: DWORD = 2; +pub const TIMESTAMP_FAILURE_BAD_FORMAT: DWORD = 5; +pub const TIMESTAMP_FAILURE_TIME_NOT_AVAILABLE: DWORD = 14; +pub const TIMESTAMP_FAILURE_POLICY_NOT_SUPPORTED: DWORD = 15; +pub const TIMESTAMP_FAILURE_EXTENSION_NOT_SUPPORTED: DWORD = 16; +pub const TIMESTAMP_FAILURE_INFO_NOT_AVAILABLE: DWORD = 17; +pub const TIMESTAMP_FAILURE_SYSTEM_FAILURE: DWORD = 25; +STRUCT!{struct CRYPT_TIMESTAMP_ACCURACY { + dwSeconds: DWORD, + dwMillis: DWORD, + dwMicros: DWORD, +}} +pub type PCRYPT_TIMESTAMP_ACCURACY = *mut CRYPT_TIMESTAMP_ACCURACY; +STRUCT!{struct CRYPT_TIMESTAMP_INFO { + dwVersion: DWORD, + pszTSAPolicyId: LPSTR, + HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, + HashedMessage: CRYPT_DER_BLOB, + SerialNumber: CRYPT_INTEGER_BLOB, + ftTime: FILETIME, + pvAccuracy: PCRYPT_TIMESTAMP_ACCURACY, + fOrdering: BOOL, + Nonce: CRYPT_DER_BLOB, + Tsa: CRYPT_DER_BLOB, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type PCRYPT_TIMESTAMP_INFO = *mut CRYPT_TIMESTAMP_INFO; +STRUCT!{struct CRYPT_TIMESTAMP_CONTEXT { + cbEncoded: DWORD, + pbEncoded: *mut BYTE, + pTimeStamp: PCRYPT_TIMESTAMP_INFO, +}} +pub type PCRYPT_TIMESTAMP_CONTEXT = *mut CRYPT_TIMESTAMP_CONTEXT; +STRUCT!{struct CRYPT_TIMESTAMP_PARA { + pszTSAPolicyId: LPCSTR, + fRequestCerts: BOOL, + Nonce: CRYPT_INTEGER_BLOB, + cExtension: DWORD, + rgExtension: PCERT_EXTENSION, +}} +pub type PCRYPT_TIMESTAMP_PARA = *mut CRYPT_TIMESTAMP_PARA; +extern "system" { + pub fn CryptRetrieveTimeStamp( + wszUrl: LPCWSTR, + dwRetrievalFlags: DWORD, + dwTimeout: DWORD, + pszHashId: LPCSTR, + pPara: *const CRYPT_TIMESTAMP_PARA, + pbData: *const BYTE, + cbData: DWORD, + ppTsContext: *mut PCRYPT_TIMESTAMP_CONTEXT, + ppTsSigner: *mut PCCERT_CONTEXT, + phStore: *mut HCERTSTORE, + ) -> BOOL; +} +pub const TIMESTAMP_DONT_HASH_DATA: DWORD = 0x00000001; +pub const TIMESTAMP_VERIFY_CONTEXT_SIGNATURE: DWORD = 0x00000020; +pub const TIMESTAMP_NO_AUTH_RETRIEVAL: DWORD = 0x00020000; +extern "system" { + pub fn CryptVerifyTimeStampSignature( + pbTSContentInfo: *const BYTE, + cbTSContentInfo: DWORD, + pbData: *const BYTE, + cbData: DWORD, + hAdditionalStore: HCERTSTORE, + ppTsContext: *mut PCRYPT_TIMESTAMP_CONTEXT, + ppTsSigner: *mut PCCERT_CONTEXT, + phStore: *mut HCERTSTORE, + ) -> BOOL; +} +pub const CRYPT_OBJECT_LOCATOR_SPN_NAME_TYPE: DWORD = 1; +pub const CRYPT_OBJECT_LOCATOR_LAST_RESERVED_NAME_TYPE: DWORD = 32; +pub const CRYPT_OBJECT_LOCATOR_FIRST_RESERVED_USER_NAME_TYPE: DWORD = 33; +pub const CRYPT_OBJECT_LOCATOR_LAST_RESERVED_USER_NAME_TYPE: DWORD = 0x0000FFFF; +pub const SSL_OBJECT_LOCATOR_PFX_FUNC: &'static str = "SslObjectLocatorInitializePfx"; +pub const SSL_OBJECT_LOCATOR_ISSUER_LIST_FUNC: &'static str + = "SslObjectLocatorInitializeIssuerList"; +pub const SSL_OBJECT_LOCATOR_CERT_VALIDATION_CONFIG_FUNC: &'static str + = "SslObjectLocatorInitializeCertValidationConfig"; +pub const CRYPT_OBJECT_LOCATOR_RELEASE_SYSTEM_SHUTDOWN: DWORD = 1; +pub const CRYPT_OBJECT_LOCATOR_RELEASE_SERVICE_STOP: DWORD = 2; +pub const CRYPT_OBJECT_LOCATOR_RELEASE_PROCESS_EXIT: DWORD = 3; +pub const CRYPT_OBJECT_LOCATOR_RELEASE_DLL_UNLOAD: DWORD = 4; +FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FLUSH( + pContext: LPVOID, + rgIdentifierOrNameList: *mut PCERT_NAME_BLOB, + dwIdentifierOrNameListCount: DWORD, +) -> BOOL} +FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_GET( + pPluginContext: LPVOID, + pIdentifier: PCRYPT_DATA_BLOB, + dwNameType: DWORD, + pNameBlob: PCERT_NAME_BLOB, + ppbContent: *mut PBYTE, + pcbContent: *mut DWORD, + ppwszPassword: *mut PCWSTR, + ppIdentifier: *mut PCRYPT_DATA_BLOB, +) -> BOOL} +FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_RELEASE( + dwReason: DWORD, + pPluginContext: LPVOID, +) -> ()} +FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_PASSWORD( + pPluginContext: LPVOID, + pwszPassword: PCWSTR, +) -> ()} +FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE( + pPluginContext: LPVOID, + pbData: PBYTE, +) -> ()} +FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_IDENTIFIER( + pPluginContext: LPVOID, + pIdentifier: PCRYPT_DATA_BLOB, +) -> ()} +STRUCT!{struct CRYPT_OBJECT_LOCATOR_PROVIDER_TABLE { + cbSize: DWORD, + pfnGet: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_GET, + pfnRelease: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_RELEASE, + pfnFreePassword: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_PASSWORD, + pfnFree: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE, + pfnFreeIdentifier: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_IDENTIFIER, +}} +pub type PCRYPT_OBJECT_LOCATOR_PROVIDER_TABLE = *mut CRYPT_OBJECT_LOCATOR_PROVIDER_TABLE; +FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_INITIALIZE( + pfnFlush: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FLUSH, + pContext: LPVOID, + pdwExpectedObjectCount: *mut DWORD, + ppFuncTable: *mut PCRYPT_OBJECT_LOCATOR_PROVIDER_TABLE, + ppPluginContext: *mut *mut c_void, +) -> BOOL} +extern "system" { + pub fn CertIsWeakHash( + dwHashUseType: DWORD, + pwszCNGHashAlgid: LPCWSTR, + dwChainFlags: DWORD, + pSignerChainContext: PCCERT_CHAIN_CONTEXT, + pTimeStamp: LPFILETIME, + pwszFileName: LPCWSTR, + ) -> BOOL; +} +FN!{stdcall PFN_CERT_IS_WEAK_HASH( + dwHashUseType: DWORD, + pwszCNGHashAlgid: LPCWSTR, + dwChainFlags: DWORD, + pSignerChainContext: PCCERT_CHAIN_CONTEXT, + pTimeStamp: LPFILETIME, + pwszFileName: LPCWSTR, +) -> BOOL} +pub const CERT_FILE_HASH_USE_TYPE: DWORD = 1; +pub const CERT_TIMESTAMP_HASH_USE_TYPE: DWORD = 2; diff --git a/bash-5.1/vendor/winapi/src/um/windowsceip.rs b/bash-5.1/vendor/winapi/src/um/windowsceip.rs new file mode 100644 index 0000000000000000000000000000000000000000..87a59d33c8d41937fc88c87dde57b9445aa34952 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/windowsceip.rs @@ -0,0 +1,9 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::BOOL; +extern "system" { + pub fn CeipIsOptedIn() -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/winefs.rs b/bash-5.1/vendor/winapi/src/um/winefs.rs new file mode 100644 index 0000000000000000000000000000000000000000..f4766431bdf3b1de13c50c2e3b86edfa38be3990 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winefs.rs @@ -0,0 +1,178 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::SIZE_T; +use shared::minwindef::{BOOL, DWORD, LPVOID, PBYTE, PDWORD, ULONG}; +use um::minwinbase::SECURITY_ATTRIBUTES; +use um::wincrypt::ALG_ID; +use um::winnt::{LPCWSTR, LPWSTR, SID}; +pub const WINEFS_SETUSERKEY_SET_CAPABILITIES: DWORD = 0x00000001; +STRUCT!{struct EFS_CERTIFICATE_BLOB { + dwCertEncodingType: DWORD, + cbData: DWORD, + pbData: PBYTE, +}} +pub type PEFS_CERTIFICATE_BLOB = *mut EFS_CERTIFICATE_BLOB; +STRUCT!{struct EFS_HASH_BLOB { + cbData: DWORD, + pbData: PBYTE, +}} +pub type PEFS_HASH_BLOB = *mut EFS_HASH_BLOB; +STRUCT!{struct EFS_RPC_BLOB { + cbData: DWORD, + pbData: PBYTE, +}} +pub type PEFS_RPC_BLOB = *mut EFS_RPC_BLOB; +STRUCT!{struct EFS_PIN_BLOB { + cbPadding: DWORD, + cbData: DWORD, + pbData: PBYTE, +}} +pub type PEFS_PIN_BLOB = *mut EFS_PIN_BLOB; +STRUCT!{struct EFS_KEY_INFO { + dwVersion: DWORD, + Entropy: ULONG, + Algorithm: ALG_ID, + KeyLength: ULONG, +}} +pub type PEFS_KEY_INFO = *mut EFS_KEY_INFO; +STRUCT!{struct EFS_COMPATIBILITY_INFO { + EfsVersion: DWORD, +}} +pub type PEFS_COMPATIBILITY_INFO = *mut EFS_COMPATIBILITY_INFO; +pub const EFS_COMPATIBILITY_VERSION_NCRYPT_PROTECTOR: DWORD = 5; +pub const EFS_COMPATIBILITY_VERSION_PFILE_PROTECTOR: DWORD = 6; +#[inline] +pub fn EFS_IS_DESCRIPTOR_VERSION(v: DWORD) -> bool { + v == EFS_COMPATIBILITY_VERSION_NCRYPT_PROTECTOR + || v == EFS_COMPATIBILITY_VERSION_PFILE_PROTECTOR +} +pub const EFS_SUBVER_UNKNOWN: DWORD = 0; +pub const EFS_EFS_SUBVER_EFS_CERT: DWORD = 1; +pub const EFS_PFILE_SUBVER_RMS: DWORD = 2; +pub const EFS_PFILE_SUBVER_APPX: DWORD = 3; +STRUCT!{struct EFS_VERSION_INFO { + EfsVersion: DWORD, + SubVersion: DWORD, +}} +pub type PEFS_VERSION_INFO = *mut EFS_VERSION_INFO; +#[inline] +pub fn EFS_IS_APPX_VERSION(v: DWORD, subV: DWORD) -> bool { + v == EFS_COMPATIBILITY_VERSION_PFILE_PROTECTOR && subV == EFS_PFILE_SUBVER_APPX +} +STRUCT!{struct EFS_DECRYPTION_STATUS_INFO { + dwDecryptionError: DWORD, + dwHashOffset: DWORD, + cbHash: DWORD, +}} +pub type PEFS_DECRYPTION_STATUS_INFO = *mut EFS_DECRYPTION_STATUS_INFO; +STRUCT!{struct EFS_ENCRYPTION_STATUS_INFO { + bHasCurrentKey: BOOL, + dwEncryptionError: DWORD, +}} +pub type PEFS_ENCRYPTION_STATUS_INFO = *mut EFS_ENCRYPTION_STATUS_INFO; +STRUCT!{struct ENCRYPTION_CERTIFICATE { + cbTotalLength: DWORD, + pUserSid: *mut SID, + pCertBlob: PEFS_CERTIFICATE_BLOB, +}} +pub type PENCRYPTION_CERTIFICATE = *mut ENCRYPTION_CERTIFICATE; +pub const MAX_SID_SIZE: SIZE_T = 256; +STRUCT!{struct ENCRYPTION_CERTIFICATE_HASH { + cbTotalLength: DWORD, + pUserSid: *mut SID, + pHash: PEFS_HASH_BLOB, + lpDisplayInformation: LPWSTR, +}} +pub type PENCRYPTION_CERTIFICATE_HASH = *mut ENCRYPTION_CERTIFICATE_HASH; +STRUCT!{struct ENCRYPTION_CERTIFICATE_HASH_LIST { + nCert_Hash: DWORD, + pUsers: *mut PENCRYPTION_CERTIFICATE_HASH, +}} +pub type PENCRYPTION_CERTIFICATE_HASH_LIST = *mut ENCRYPTION_CERTIFICATE_HASH_LIST; +STRUCT!{struct ENCRYPTION_CERTIFICATE_LIST { + nUsers: DWORD, + pUsers: *mut PENCRYPTION_CERTIFICATE, +}} +pub type PENCRYPTION_CERTIFICATE_LIST = *mut ENCRYPTION_CERTIFICATE_LIST; +pub const EFS_METADATA_ADD_USER: DWORD = 0x00000001; +pub const EFS_METADATA_REMOVE_USER: DWORD = 0x00000002; +pub const EFS_METADATA_REPLACE_USER: DWORD = 0x00000004; +pub const EFS_METADATA_GENERAL_OP: DWORD = 0x00000008; +STRUCT!{struct ENCRYPTED_FILE_METADATA_SIGNATURE { + dwEfsAccessType: DWORD, + pCertificatesAdded: PENCRYPTION_CERTIFICATE_HASH_LIST, + pEncryptionCertificate: PENCRYPTION_CERTIFICATE, + pEfsStreamSignature: PEFS_RPC_BLOB, +}} +pub type PENCRYPTED_FILE_METADATA_SIGNATURE = *mut ENCRYPTED_FILE_METADATA_SIGNATURE; +STRUCT!{struct ENCRYPTION_PROTECTOR { + cbTotalLength: DWORD, + pUserSid: *mut SID, + lpProtectorDescriptor: LPWSTR, +}} +pub type PENCRYPTION_PROTECTOR = *mut ENCRYPTION_PROTECTOR; +STRUCT!{struct ENCRYPTION_PROTECTOR_LIST { + nProtectors: DWORD, + pProtectors: *mut PENCRYPTION_PROTECTOR, +}} +pub type PENCRYPTION_PROTECTOR_LIST = *mut ENCRYPTION_PROTECTOR_LIST; +extern "system" { + pub fn QueryUsersOnEncryptedFile( + lpFileName: LPCWSTR, + pUsers: *mut PENCRYPTION_CERTIFICATE_HASH_LIST, + ) -> DWORD; + pub fn QueryRecoveryAgentsOnEncryptedFile( + lpFileName: LPCWSTR, + pRecoveryAgents: *mut PENCRYPTION_CERTIFICATE_HASH_LIST, + ) -> DWORD; + pub fn RemoveUsersFromEncryptedFile( + lpFileName: LPCWSTR, + pHashes: PENCRYPTION_CERTIFICATE_HASH_LIST, + ) -> DWORD; + pub fn AddUsersToEncryptedFile( + lpFileName: LPCWSTR, + pEncryptionCertificate: PENCRYPTION_CERTIFICATE_LIST, + ) -> DWORD; + pub fn SetUserFileEncryptionKey( + pEncryptionCertificate: PENCRYPTION_CERTIFICATE, + ) -> DWORD; + pub fn SetUserFileEncryptionKeyEx( + pEncryptionCertificate: PENCRYPTION_CERTIFICATE, + dwCapabilities: DWORD, + dwFlags: DWORD, + pvReserved: LPVOID, + ) -> DWORD; + pub fn FreeEncryptionCertificateHashList( + pUsers: PENCRYPTION_CERTIFICATE_HASH_LIST, + ); + pub fn EncryptionDisable( + DirPath: LPCWSTR, + Disable: BOOL, + ) -> BOOL; + pub fn DuplicateEncryptionInfoFile( + SrcFileName: LPCWSTR, + DstFileName: LPCWSTR, + dwCreationDistribution: DWORD, + dwAttributes: DWORD, + lpSecurityAttributes: *const SECURITY_ATTRIBUTES, + ) -> DWORD; + pub fn GetEncryptedFileMetadata( + lpFileName: LPCWSTR, + pcbMetadata: PDWORD, + ppbMetadata: *mut PBYTE, + ) -> DWORD; + pub fn SetEncryptedFileMetadata( + lpFileName: LPCWSTR, + pbOldMetadata: PBYTE, + pbNewMetadata: PBYTE, + pOwnerHash: PENCRYPTION_CERTIFICATE_HASH, + dwOperation: DWORD, + pCertificatesAdded: PENCRYPTION_CERTIFICATE_HASH_LIST, + ) -> DWORD; + pub fn FreeEncryptedFileMetadata( + pbMetadata: PBYTE, + ); +} diff --git a/bash-5.1/vendor/winapi/src/um/winevt.rs b/bash-5.1/vendor/winapi/src/um/winevt.rs new file mode 100644 index 0000000000000000000000000000000000000000..dce3d27ecb60deafb1c755827ade719a3b3b252c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winevt.rs @@ -0,0 +1,543 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Windows Events API +use ctypes::{c_double, c_float}; +use shared::basetsd::{INT16, INT32, INT64, INT8, UINT16, UINT32, UINT64, UINT8}; +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, DWORD, FILETIME, PBYTE, PDWORD}; +use um::minwinbase::SYSTEMTIME; +use um::winnt::{HANDLE, LCID, LONGLONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PSID, PVOID, ULONGLONG}; +use vc::vcruntime::size_t; +pub type EVT_HANDLE = HANDLE; +pub type PEVT_HANDLE = *mut HANDLE; +ENUM!{enum EVT_VARIANT_TYPE { + EvtVarTypeNull = 0, + EvtVarTypeString = 1, + EvtVarTypeAnsiString = 2, + EvtVarTypeSByte = 3, + EvtVarTypeByte = 4, + EvtVarTypeInt16 = 5, + EvtVarTypeUInt16 = 6, + EvtVarTypeInt32 = 7, + EvtVarTypeUInt32 = 8, + EvtVarTypeInt64 = 9, + EvtVarTypeUInt64 = 10, + EvtVarTypeSingle = 11, + EvtVarTypeDouble = 12, + EvtVarTypeBoolean = 13, + EvtVarTypeBinary = 14, + EvtVarTypeGuid = 15, + EvtVarTypeSizeT = 16, + EvtVarTypeFileTime = 17, + EvtVarTypeSysTime = 18, + EvtVarTypeSid = 19, + EvtVarTypeHexInt32 = 20, + EvtVarTypeHexInt64 = 21, + EvtVarTypeEvtHandle = 32, + EvtVarTypeEvtXml = 35, +}} +pub const EVT_VARIANT_TYPE_MASK: DWORD = 0x7f; +pub const EVT_VARIANT_TYPE_ARRAY: DWORD = 128; +UNION!{union EVT_VARIANT_u { + [u64; 1], + BooleanVal BooleanVal_mut: BOOL, + SByteVal SByteVal_mut: INT8, + Int16Val Int16Val_mut: INT16, + Int32Val Int32Val_mut: INT32, + Int64Val Int64Val_mut: INT64, + ByteVal ByteVal_mut: UINT8, + UInt16Val UInt16Val_mut: UINT16, + UInt32Val UInt32Val_mut: UINT32, + UInt64Val UInt64Val_mut: UINT64, + SingleVal SingleVal_mut: c_float, + DoubleVal DoubleVal_mut: c_double, + FileTimeVal FileTimeVal_mut: ULONGLONG, + SysTimeVal SysTimeVal_mut: *mut SYSTEMTIME, + GuidVal GuidVal_mut: *mut GUID, + StringVal StringVal_mut: LPCWSTR, + AnsiStringVal AnsiStringVal_mut: LPCSTR, + BinaryVal BinaryVal_mut: PBYTE, + SidVal SidVal_mut: PSID, + SizeTVal SizeTVal_mut: size_t, + BooleanArr BooleanArr_mut: *mut BOOL, + SByteArr SByteArr_mut: *mut INT8, + Int16Arr Int16Arr_mut: *mut INT16, + Int32Arr Int32Arr_mut: *mut INT32, + Int64Arr Int64Arr_mut: *mut INT64, + ByteArr ByteArr_mut: *mut UINT8, + UInt16Arr UInt16Arr_mut: *mut UINT16, + UInt32Arr UInt32Arr_mut: *mut UINT32, + UInt64Arr UInt64Arr_mut: *mut UINT64, + SingleArr SingleArr_mut: *mut c_float, + DoubleArr DoubleArr_mut: *mut c_double, + FileTimeArr FileTimeArr_mut: *mut FILETIME, + SysTimeArr SysTimeArr_mut: *mut SYSTEMTIME, + GuidArr GuidArr_mut: *mut GUID, + StringArr StringArr_mut: *mut LPWSTR, + AnsiStringArr AnsiStringArr_mut: *mut LPSTR, + SidArr SidArr_mut: *mut PSID, + SizeTArr SizeTArr_mut: *mut size_t, + EvtHandleVal EvtHandleVal_mut: EVT_HANDLE, + XmlVal XmlVal_mut: LPCWSTR, + XmlValArr XmlValArr_mut: *mut LPCWSTR, +}} +STRUCT!{struct EVT_VARIANT { + u: EVT_VARIANT_u, + Count: DWORD, + Type: DWORD, +}} +pub type PEVT_VARIANT = *mut EVT_VARIANT; +ENUM!{enum EVT_LOGIN_CLASS { + EvtRpcLogin = 1, +}} +ENUM!{enum EVT_RPC_LOGIN_FLAGS { + EvtRpcLoginAuthDefault = 0, + EvtRpcLoginAuthNegotiate, + EvtRpcLoginAuthKerberos, + EvtRpcLoginAuthNTLM, +}} +STRUCT!{struct EVT_RPC_LOGIN { + Server: LPWSTR, + User: LPWSTR, + Domain: LPWSTR, + Password: LPWSTR, + Flags: DWORD, +}} +extern "system" { + pub fn EvtOpenSession( + LoginClass: EVT_LOGIN_CLASS, + Login: PVOID, + Timeout: DWORD, + Flags: DWORD, + ) -> EVT_HANDLE; + pub fn EvtClose( + Object: EVT_HANDLE, + ) -> BOOL; + pub fn EvtCancel( + Object: EVT_HANDLE, + ) -> BOOL; + pub fn EvtGetExtendedStatus( + BufferSize: DWORD, + Buffer: LPWSTR, + BufferUsed: PDWORD, + ) -> DWORD; +} +ENUM!{enum EVT_QUERY_FLAGS { + EvtQueryChannelPath = 0x1, + EvtQueryFilePath = 0x2, + EvtQueryForwardDirection = 0x100, + EvtQueryReverseDirection = 0x200, + EvtQueryTolerateQueryErrors = 0x1000, +}} +ENUM!{enum EVT_SEEK_FLAGS { + EvtSeekRelativeToFirst = 1, + EvtSeekRelativeToLast = 2, + EvtSeekRelativeToCurrent = 3, + EvtSeekRelativeToBookmark = 4, + EvtSeekOriginMask = 7, + EvtSeekStrict = 0x10000, +}} +extern "system" { + pub fn EvtQuery( + Session: EVT_HANDLE, + Path: LPCWSTR, + Query: LPCWSTR, + Flags: DWORD, + ) -> EVT_HANDLE; + pub fn EvtNext( + ResultSet: EVT_HANDLE, + EventsSize: DWORD, + Events: PEVT_HANDLE, + Timeout: DWORD, + Flags: DWORD, + Returned: PDWORD, + ) -> BOOL; + pub fn EvtSeek( + ResultSet: EVT_HANDLE, + Position: LONGLONG, + Bookmark: EVT_HANDLE, + Timeout: DWORD, + Flags: DWORD, + ) -> BOOL; +} +ENUM!{enum EVT_SUBSCRIBE_FLAGS { + EvtSubscribeToFutureEvents = 1, + EvtSubscribeStartAtOldestRecord = 2, + EvtSubscribeStartAfterBookmark = 3, + EvtSubscribeOriginMask = 3, + EvtSubscribeTolerateQueryErrors = 0x1000, + EvtSubscribeStrict = 0x10000, +}} +ENUM!{enum EVT_SUBSCRIBE_NOTIFY_ACTION { + EvtSubscribeActionError = 0, + EvtSubscribeActionDeliver, +}} +FN!{stdcall EVT_SUBSCRIBE_CALLBACK( + Action: EVT_SUBSCRIBE_NOTIFY_ACTION, + UserContext: PVOID, + Event: EVT_HANDLE, +) -> DWORD} +extern "system" { + pub fn EvtSubscribe( + Session: EVT_HANDLE, + SignalEvent: HANDLE, + ChannelPath: LPCWSTR, + Query: LPCWSTR, + Bookmark: EVT_HANDLE, + Context: PVOID, + Callback: EVT_SUBSCRIBE_CALLBACK, + Flags: DWORD, + ) -> EVT_HANDLE; +} +ENUM!{enum EVT_SYSTEM_PROPERTY_ID { + EvtSystemProviderName = 0, + EvtSystemProviderGuid, + EvtSystemEventID, + EvtSystemQualifiers, + EvtSystemLevel, + EvtSystemTask, + EvtSystemOpcode, + EvtSystemKeywords, + EvtSystemTimeCreated, + EvtSystemEventRecordId, + EvtSystemActivityID, + EvtSystemRelatedActivityID, + EvtSystemProcessID, + EvtSystemThreadID, + EvtSystemChannel, + EvtSystemComputer, + EvtSystemUserID, + EvtSystemVersion, + EvtSystemPropertyIdEND, +}} +ENUM!{enum EVT_RENDER_CONTEXT_FLAGS { + EvtRenderContextValues = 0, + EvtRenderContextSystem, + EvtRenderContextUser, +}} +ENUM!{enum EVT_RENDER_FLAGS { + EvtRenderEventValues = 0, + EvtRenderEventXml, + EvtRenderBookmark, +}} +extern "system" { + pub fn EvtCreateRenderContext( + ValuePathsCount: DWORD, + ValuePaths: *mut LPCWSTR, + Flags: DWORD, + ) -> EVT_HANDLE; + pub fn EvtRender( + Context: EVT_HANDLE, + Fragment: EVT_HANDLE, + Flags: DWORD, + BufferSize: DWORD, + Buffer: PVOID, + BufferUsed: PDWORD, + PropertyCount: PDWORD, + ) -> BOOL; +} +ENUM!{enum EVT_FORMAT_MESSAGE_FLAGS { + EvtFormatMessageEvent = 1, + EvtFormatMessageLevel, + EvtFormatMessageTask, + EvtFormatMessageOpcode, + EvtFormatMessageKeyword, + EvtFormatMessageChannel, + EvtFormatMessageProvider, + EvtFormatMessageId, + EvtFormatMessageXml, +}} +extern "system" { + pub fn EvtFormatMessage( + PublisherMetadata: EVT_HANDLE, + Event: EVT_HANDLE, + MessageId: DWORD, + ValueCount: DWORD, + Values: PEVT_VARIANT, + Flags: DWORD, + BufferSize: DWORD, + Buffer: LPWSTR, + BufferUsed: PDWORD, + ) -> BOOL; +} +ENUM!{enum EVT_OPEN_LOG_FLAGS { + EvtOpenChannelPath = 0x1, + EvtOpenFilePath = 0x2, +}} +ENUM!{enum EVT_LOG_PROPERTY_ID { + EvtLogCreationTime = 0, + EvtLogLastAccessTime, + EvtLogLastWriteTime, + EvtLogFileSize, + EvtLogAttributes, + EvtLogNumberOfLogRecords, + EvtLogOldestRecordNumber, + EvtLogFull, +}} +extern "system" { + pub fn EvtOpenLog( + Session: EVT_HANDLE, + Path: LPCWSTR, + Flags: DWORD, + ) -> EVT_HANDLE; + pub fn EvtGetLogInfo( + Log: EVT_HANDLE, + PropertyId: EVT_LOG_PROPERTY_ID, + PropertyValueBufferSize: DWORD, + PropertyValueBuffer: PEVT_VARIANT, + PropertyValueBufferUsed: PDWORD, + ) -> BOOL; + pub fn EvtClearLog( + Session: EVT_HANDLE, + ChannelPath: LPCWSTR, + TargetFilePath: LPCWSTR, + Flags: DWORD, + ) -> BOOL; +} +ENUM!{enum EVT_EXPORTLOG_FLAGS { + EvtExportLogChannelPath = 0x1, + EvtExportLogFilePath = 0x2, + EvtExportLogTolerateQueryErrors = 0x1000, + EvtExportLogOverwrite = 0x2000, +}} +extern "system" { + pub fn EvtExportLog( + Session: EVT_HANDLE, + Path: LPCWSTR, + Query: LPCWSTR, + TargetFilePath: LPCWSTR, + Flags: DWORD, + ) -> BOOL; + pub fn EvtArchiveExportedLog( + Session: EVT_HANDLE, + LogFilePath: LPCWSTR, + Locale: LCID, + Flags: DWORD, + ) -> BOOL; +} +ENUM!{enum EVT_CHANNEL_CONFIG_PROPERTY_ID { + EvtChannelConfigEnabled = 0, + EvtChannelConfigIsolation, + EvtChannelConfigType, + EvtChannelConfigOwningPublisher, + EvtChannelConfigClassicEventlog, + EvtChannelConfigAccess, + EvtChannelLoggingConfigRetention, + EvtChannelLoggingConfigAutoBackup, + EvtChannelLoggingConfigMaxSize, + EvtChannelLoggingConfigLogFilePath, + EvtChannelPublishingConfigLevel, + EvtChannelPublishingConfigKeywords, + EvtChannelPublishingConfigControlGuid, + EvtChannelPublishingConfigBufferSize, + EvtChannelPublishingConfigMinBuffers, + EvtChannelPublishingConfigMaxBuffers, + EvtChannelPublishingConfigLatency, + EvtChannelPublishingConfigClockType, + EvtChannelPublishingConfigSidType, + EvtChannelPublisherList, + EvtChannelPublishingConfigFileMax, + EvtChannelConfigPropertyIdEND, +}} +ENUM!{enum EVT_CHANNEL_TYPE { + EvtChannelTypeAdmin = 0, + EvtChannelTypeOperational, + EvtChannelTypeAnalytic, + EvtChannelTypeDebug, +}} +ENUM!{enum EVT_CHANNEL_ISOLATION_TYPE { + EvtChannelIsolationTypeApplication = 0, + EvtChannelIsolationTypeSystem, + EvtChannelIsolationTypeCustom, +}} +ENUM!{enum EVT_CHANNEL_CLOCK_TYPE { + EvtChannelClockTypeSystemTime = 0, + EvtChannelClockTypeQPC, +}} +ENUM!{enum EVT_CHANNEL_SID_TYPE { + EvtChannelSidTypeNone = 0, + EvtChannelSidTypePublishing, +}} +extern "system" { + pub fn EvtOpenChannelEnum( + Session: EVT_HANDLE, + Flags: DWORD, + ) -> EVT_HANDLE; + pub fn EvtNextChannelPath( + ChannelEnum: EVT_HANDLE, + ChannelPathBufferSize: DWORD, + ChannelPathBuffer: LPWSTR, + ChannelPathBufferUsed: PDWORD, + ) -> BOOL; + pub fn EvtOpenChannelConfig( + Session: EVT_HANDLE, + ChannelPath: LPCWSTR, + Flags: DWORD, + ) -> EVT_HANDLE; + pub fn EvtSaveChannelConfig( + ChannelConfig: EVT_HANDLE, + Flags: DWORD, + ) -> BOOL; + pub fn EvtSetChannelConfigProperty( + ChannelConfig: EVT_HANDLE, + PropertyId: EVT_CHANNEL_CONFIG_PROPERTY_ID, + Flags: DWORD, + PropertyValue: PEVT_VARIANT, + ) -> BOOL; + pub fn EvtGetChannelConfigProperty( + ChannelConfig: EVT_HANDLE, + PropertyId: EVT_CHANNEL_CONFIG_PROPERTY_ID, + Flags: DWORD, + PropertyValueBufferSize: DWORD, + PropertyValueBuffer: PEVT_VARIANT, + PropertyValueBufferUsed: PDWORD, + ) -> BOOL; +} +ENUM!{enum EVT_CHANNEL_REFERENCE_FLAGS { + EvtChannelReferenceImported = 0x1, +}} +ENUM!{enum EVT_PUBLISHER_METADATA_PROPERTY_ID { + EvtPublisherMetadataPublisherGuid = 0, + EvtPublisherMetadataResourceFilePath, + EvtPublisherMetadataParameterFilePath, + EvtPublisherMetadataMessageFilePath, + EvtPublisherMetadataHelpLink, + EvtPublisherMetadataPublisherMessageID, + EvtPublisherMetadataChannelReferences, + EvtPublisherMetadataChannelReferencePath, + EvtPublisherMetadataChannelReferenceIndex, + EvtPublisherMetadataChannelReferenceID, + EvtPublisherMetadataChannelReferenceFlags, + EvtPublisherMetadataChannelReferenceMessageID, + EvtPublisherMetadataLevels, + EvtPublisherMetadataLevelName, + EvtPublisherMetadataLevelValue, + EvtPublisherMetadataLevelMessageID, + EvtPublisherMetadataTasks, + EvtPublisherMetadataTaskName, + EvtPublisherMetadataTaskEventGuid, + EvtPublisherMetadataTaskValue, + EvtPublisherMetadataTaskMessageID, + EvtPublisherMetadataOpcodes, + EvtPublisherMetadataOpcodeName, + EvtPublisherMetadataOpcodeValue, + EvtPublisherMetadataOpcodeMessageID, + EvtPublisherMetadataKeywords, + EvtPublisherMetadataKeywordName, + EvtPublisherMetadataKeywordValue, + EvtPublisherMetadataKeywordMessageID, + EvtPublisherMetadataPropertyIdEND, +}} +extern "system" { + pub fn EvtOpenPublisherEnum( + Session: EVT_HANDLE, + Flags: DWORD, + ) -> EVT_HANDLE; + pub fn EvtNextPublisherId( + PublisherEnum: EVT_HANDLE, + PublisherIdBufferSize: DWORD, + PublisherIdBuffer: LPWSTR, + PublisherIdBufferUsed: PDWORD, + ) -> BOOL; + pub fn EvtOpenPublisherMetadata( + Session: EVT_HANDLE, + PublisherId: LPCWSTR, + LogFilePath: LPCWSTR, + Locale: LCID, + Flags: DWORD, + ) -> EVT_HANDLE; + pub fn EvtGetPublisherMetadataProperty( + PublisherMetadata: EVT_HANDLE, + PropertyId: EVT_PUBLISHER_METADATA_PROPERTY_ID, + Flags: DWORD, + PublisherMetadataPropertyBufferSize: DWORD, + PublisherMetadataPropertyBuffer: PEVT_VARIANT, + PublisherMetadataPropertyBufferUsed: PDWORD, + ) -> BOOL; +} +ENUM!{enum EVT_EVENT_METADATA_PROPERTY_ID { + EventMetadataEventID, + EventMetadataEventVersion, + EventMetadataEventChannel, + EventMetadataEventLevel, + EventMetadataEventOpcode, + EventMetadataEventTask, + EventMetadataEventKeyword, + EventMetadataEventMessageID, + EventMetadataEventTemplate, + EvtEventMetadataPropertyIdEND, +}} +extern "system" { + pub fn EvtOpenEventMetadataEnum( + PublisherMetadata: EVT_HANDLE, + Flags: DWORD, + ) -> EVT_HANDLE; + pub fn EvtNextEventMetadata( + EventMetadataEnum: EVT_HANDLE, + Flags: DWORD, + ) -> EVT_HANDLE; + pub fn EvtGetEventMetadataProperty( + EventMetadata: EVT_HANDLE, + PropertyId: EVT_EVENT_METADATA_PROPERTY_ID, + Flags: DWORD, + EventMetadataPropertyBufferSize: DWORD, + EventMetadataPropertyBuffer: PEVT_VARIANT, + EventMetadataPropertyBufferUsed: PDWORD, + ) -> BOOL; +} +pub type EVT_OBJECT_ARRAY_PROPERTY_HANDLE = HANDLE; +extern "system" { + pub fn EvtGetObjectArraySize( + ObjectArray: EVT_OBJECT_ARRAY_PROPERTY_HANDLE, + ObjectArraySize: PDWORD, + ) -> BOOL; + pub fn EvtGetObjectArrayProperty( + ObjectArray: EVT_OBJECT_ARRAY_PROPERTY_HANDLE, + PropertyId: DWORD, + ArrayIndex: DWORD, + Flags: DWORD, + PropertyValueBufferSize: DWORD, + PropertyValueBuffer: PEVT_VARIANT, + PropertyValueBufferUsed: PDWORD, + ) -> BOOL; +} +ENUM!{enum EVT_QUERY_PROPERTY_ID { + EvtQueryNames, + EvtQueryStatuses, + EvtQueryPropertyIdEND, +}} +ENUM!{enum EVT_EVENT_PROPERTY_ID { + EvtEventQueryIDs = 0, + EvtEventPath, + EvtEventPropertyIdEND, +}} +extern "system" { + pub fn EvtGetQueryInfo( + QueryOrSubscription: EVT_HANDLE, + PropertyId: EVT_QUERY_PROPERTY_ID, + PropertyValueBufferSize: DWORD, + PropertyValueBuffer: PEVT_VARIANT, + PropertyValueBufferUsed: PDWORD, + ) -> BOOL; + pub fn EvtCreateBookmark( + BookmarkXml: LPCWSTR, + ) -> EVT_HANDLE; + pub fn EvtUpdateBookmark( + Bookmark: EVT_HANDLE, + Event: EVT_HANDLE, + ) -> BOOL; + pub fn EvtGetEventInfo( + Event: EVT_HANDLE, + PropertyId: EVT_EVENT_PROPERTY_ID, + PropertyValueBufferSize: DWORD, + PropertyValueBuffer: PEVT_VARIANT, + PropertyValueBufferUsed: PDWORD, + ) -> BOOL; +} +pub const EVT_READ_ACCESS: DWORD = 0x1; +pub const EVT_WRITE_ACCESS: DWORD = 0x2; +pub const EVT_CLEAR_ACCESS: DWORD = 0x4; +pub const EVT_ALL_ACCESS: DWORD = 0x7; diff --git a/bash-5.1/vendor/winapi/src/um/wingdi.rs b/bash-5.1/vendor/winapi/src/um/wingdi.rs new file mode 100644 index 0000000000000000000000000000000000000000..ccf8697c41bd04df27e0199664deb9bb41237b19 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wingdi.rs @@ -0,0 +1,5591 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! GDI procedure declarations, constant definitions and macros +use ctypes::{c_char, c_int, c_long, c_short, c_ushort, c_void}; +use shared::basetsd::{UINT16, UINT32, UINT64, ULONG_PTR}; +use shared::minwindef::{ + BOOL, BYTE, DWORD, FLOAT, HGLOBAL, HMETAFILE, HMODULE, HRGN, INT, LOBYTE, LPARAM, LPBYTE, + LPDWORD, LPINT, LPVOID, LPWORD, MAX_PATH, PFLOAT, PROC, UINT, ULONG, USHORT, WORD, +}; +use shared::windef::{ + COLORREF, HBITMAP, HBRUSH, HCOLORSPACE, HDC, HENHMETAFILE, HFONT, HGDIOBJ, HGLRC, HPALETTE, + HPEN, HWND, LPPOINT, LPRECT, LPSIZE, POINT, POINTL, POINTS, RECT, RECTL, SIZEL, +}; +use um::winnt::{ + CHAR, HANDLE, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, LUID, PSTR, PVOID, SHORT, VOID, WCHAR, +}; +pub const R2_BLACK: c_int = 1; +pub const R2_NOTMERGEPEN: c_int = 2; +pub const R2_MASKNOTPEN: c_int = 3; +pub const R2_NOTCOPYPEN: c_int = 4; +pub const R2_MASKPENNOT: c_int = 5; +pub const R2_NOT: c_int = 6; +pub const R2_XORPEN: c_int = 7; +pub const R2_NOTMASKPEN: c_int = 8; +pub const R2_MASKPEN: c_int = 9; +pub const R2_NOTXORPEN: c_int = 10; +pub const R2_NOP: c_int = 11; +pub const R2_MERGENOTPEN: c_int = 12; +pub const R2_COPYPEN: c_int = 13; +pub const R2_MERGEPENNOT: c_int = 14; +pub const R2_MERGEPEN: c_int = 15; +pub const R2_WHITE: c_int = 16; +pub const R2_LAST: c_int = 16; +pub const SRCCOPY: DWORD = 0x00CC0020; +pub const SRCPAINT: DWORD = 0x00EE0086; +pub const SRCAND: DWORD = 0x008800C6; +pub const SRCINVERT: DWORD = 0x00660046; +pub const SRCERASE: DWORD = 0x00440328; +pub const NOTSRCCOPY: DWORD = 0x00330008; +pub const NOTSRCERASE: DWORD = 0x001100A6; +pub const MERGECOPY: DWORD = 0x00C000CA; +pub const MERGEPAINT: DWORD = 0x00BB0226; +pub const PATCOPY: DWORD = 0x00F00021; +pub const PATPAINT: DWORD = 0x00FB0A09; +pub const PATINVERT: DWORD = 0x005A0049; +pub const DSTINVERT: DWORD = 0x00550009; +pub const BLACKNESS: DWORD = 0x00000042; +pub const WHITENESS: DWORD = 0x00FF0062; +pub const NOMIRRORBITMAP: DWORD = 0x80000000; +pub const CAPTUREBLT: DWORD = 0x40000000; +#[inline] +pub fn MAKEROP4(fore: DWORD, back: DWORD) -> DWORD { + ((back << 8) & 0xFF000000) | fore +} +pub const GDI_ERROR: ULONG = 0xFFFFFFFF; +pub const HGDI_ERROR: HANDLE = -1isize as HANDLE; +pub const ERROR: c_int = 0; +pub const NULLREGION: c_int = 1; +pub const SIMPLEREGION: c_int = 2; +pub const COMPLEXREGION: c_int = 3; +pub const RGN_ERROR: c_int = ERROR; +pub const RGN_AND: c_int = 1; +pub const RGN_OR: c_int = 2; +pub const RGN_XOR: c_int = 3; +pub const RGN_DIFF: c_int = 4; +pub const RGN_COPY: c_int = 5; +pub const RGN_MIN: c_int = RGN_AND; +pub const RGN_MAX: c_int = RGN_COPY; +pub const BLACKONWHITE: c_int = 1; +pub const WHITEONBLACK: c_int = 2; +pub const COLORONCOLOR: c_int = 3; +pub const HALFTONE: c_int = 4; +pub const MAXSTRETCHBLTMODE: c_int = 4; +pub const STRETCH_ANDSCANS: c_int = BLACKONWHITE; +pub const STRETCH_ORSCANS: c_int = WHITEONBLACK; +pub const STRETCH_DELETESCANS: c_int = COLORONCOLOR; +pub const STRETCH_HALFTONE: c_int = HALFTONE; +pub const ALTERNATE: c_int = 1; +pub const WINDING: c_int = 2; +pub const POLYFILL_LAST: c_int = 2; +pub const LAYOUT_RTL: DWORD = 0x00000001; +pub const LAYOUT_BTT: DWORD = 0x00000002; +pub const LAYOUT_VBH: DWORD = 0x00000004; +pub const LAYOUT_ORIENTATIONMASK: DWORD = LAYOUT_RTL | LAYOUT_BTT | LAYOUT_VBH; +pub const LAYOUT_BITMAPORIENTATIONPRESERVED: DWORD = 0x00000008; +pub const TA_NOUPDATECP: UINT = 0; +pub const TA_UPDATECP: UINT = 1; +pub const TA_LEFT: UINT = 0; +pub const TA_RIGHT: UINT = 2; +pub const TA_CENTER: UINT = 6; +pub const TA_TOP: UINT = 0; +pub const TA_BOTTOM: UINT = 8; +pub const TA_BASELINE: UINT = 24; +pub const TA_RTLREADING: UINT = 256; +pub const TA_MASK: UINT = TA_BASELINE + TA_CENTER + TA_UPDATECP + TA_RTLREADING; +pub const VTA_BASELINE: UINT = TA_BASELINE; +pub const VTA_LEFT: UINT = TA_BOTTOM; +pub const VTA_RIGHT: UINT = TA_TOP; +pub const VTA_CENTER: UINT = TA_CENTER; +pub const VTA_BOTTOM: UINT = TA_RIGHT; +pub const VTA_TOP: UINT = TA_LEFT; +pub const ETO_OPAQUE: UINT = 0x0002; +pub const ETO_CLIPPED: UINT = 0x0004; +pub const ETO_GLYPH_INDEX: UINT = 0x0010; +pub const ETO_RTLREADING: UINT = 0x0080; +pub const ETO_NUMERICSLOCAL: UINT = 0x0400; +pub const ETO_NUMERICSLATIN: UINT = 0x0800; +pub const ETO_IGNORELANGUAGE: UINT = 0x1000; +pub const ETO_PDY: UINT = 0x2000; +pub const ETO_REVERSE_INDEX_MAP: UINT = 0x10000; +pub const ASPECT_FILTERING: UINT = 0x0001; +pub const DCB_RESET: UINT = 0x0001; +pub const DCB_ACCUMULATE: UINT = 0x0002; +pub const DCB_DIRTY: UINT = DCB_ACCUMULATE; +pub const DCB_SET: UINT = DCB_RESET | DCB_ACCUMULATE; +pub const DCB_ENABLE: UINT = 0x0004; +pub const DCB_DISABLE: UINT = 0x0008; +pub const META_SETBKCOLOR: WORD = 0x0201; +pub const META_SETBKMODE: WORD = 0x0102; +pub const META_SETMAPMODE: WORD = 0x0103; +pub const META_SETROP2: WORD = 0x0104; +pub const META_SETRELABS: WORD = 0x0105; +pub const META_SETPOLYFILLMODE: WORD = 0x0106; +pub const META_SETSTRETCHBLTMODE: WORD = 0x0107; +pub const META_SETTEXTCHAREXTRA: WORD = 0x0108; +pub const META_SETTEXTCOLOR: WORD = 0x0209; +pub const META_SETTEXTJUSTIFICATION: WORD = 0x020A; +pub const META_SETWINDOWORG: WORD = 0x020B; +pub const META_SETWINDOWEXT: WORD = 0x020C; +pub const META_SETVIEWPORTORG: WORD = 0x020D; +pub const META_SETVIEWPORTEXT: WORD = 0x020E; +pub const META_OFFSETWINDOWORG: WORD = 0x020F; +pub const META_SCALEWINDOWEXT: WORD = 0x0410; +pub const META_OFFSETVIEWPORTORG: WORD = 0x0211; +pub const META_SCALEVIEWPORTEXT: WORD = 0x0412; +pub const META_LINETO: WORD = 0x0213; +pub const META_MOVETO: WORD = 0x0214; +pub const META_EXCLUDECLIPRECT: WORD = 0x0415; +pub const META_INTERSECTCLIPRECT: WORD = 0x0416; +pub const META_ARC: WORD = 0x0817; +pub const META_ELLIPSE: WORD = 0x0418; +pub const META_FLOODFILL: WORD = 0x0419; +pub const META_PIE: WORD = 0x081A; +pub const META_RECTANGLE: WORD = 0x041B; +pub const META_ROUNDRECT: WORD = 0x061C; +pub const META_PATBLT: WORD = 0x061D; +pub const META_SAVEDC: WORD = 0x001E; +pub const META_SETPIXEL: WORD = 0x041F; +pub const META_OFFSETCLIPRGN: WORD = 0x0220; +pub const META_TEXTOUT: WORD = 0x0521; +pub const META_BITBLT: WORD = 0x0922; +pub const META_STRETCHBLT: WORD = 0x0B23; +pub const META_POLYGON: WORD = 0x0324; +pub const META_POLYLINE: WORD = 0x0325; +pub const META_ESCAPE: WORD = 0x0626; +pub const META_RESTOREDC: WORD = 0x0127; +pub const META_FILLREGION: WORD = 0x0228; +pub const META_FRAMEREGION: WORD = 0x0429; +pub const META_INVERTREGION: WORD = 0x012A; +pub const META_PAINTREGION: WORD = 0x012B; +pub const META_SELECTCLIPREGION: WORD = 0x012C; +pub const META_SELECTOBJECT: WORD = 0x012D; +pub const META_SETTEXTALIGN: WORD = 0x012E; +pub const META_CHORD: WORD = 0x0830; +pub const META_SETMAPPERFLAGS: WORD = 0x0231; +pub const META_EXTTEXTOUT: WORD = 0x0a32; +pub const META_SETDIBTODEV: WORD = 0x0d33; +pub const META_SELECTPALETTE: WORD = 0x0234; +pub const META_REALIZEPALETTE: WORD = 0x0035; +pub const META_ANIMATEPALETTE: WORD = 0x0436; +pub const META_SETPALENTRIES: WORD = 0x0037; +pub const META_POLYPOLYGON: WORD = 0x0538; +pub const META_RESIZEPALETTE: WORD = 0x0139; +pub const META_DIBBITBLT: WORD = 0x0940; +pub const META_DIBSTRETCHBLT: WORD = 0x0b41; +pub const META_DIBCREATEPATTERNBRUSH: WORD = 0x0142; +pub const META_STRETCHDIB: WORD = 0x0f43; +pub const META_EXTFLOODFILL: WORD = 0x0548; +pub const META_SETLAYOUT: WORD = 0x0149; +pub const META_DELETEOBJECT: WORD = 0x01f0; +pub const META_CREATEPALETTE: WORD = 0x00f7; +pub const META_CREATEPATTERNBRUSH: WORD = 0x01F9; +pub const META_CREATEPENINDIRECT: WORD = 0x02FA; +pub const META_CREATEFONTINDIRECT: WORD = 0x02FB; +pub const META_CREATEBRUSHINDIRECT: WORD = 0x02FC; +pub const META_CREATEREGION: WORD = 0x06FF; +STRUCT!{struct DRAWPATRECT { + ptPosition: POINT, + ptSize: POINT, + wStyle: WORD, + wPattern: WORD, +}} +pub type PDRAWPATRECT = *mut DRAWPATRECT; +pub const NEWFRAME: c_int = 1; +pub const ABORTDOC: c_int = 2; +pub const NEXTBAND: c_int = 3; +pub const SETCOLORTABLE: c_int = 4; +pub const GETCOLORTABLE: c_int = 5; +pub const FLUSHOUTPUT: c_int = 6; +pub const DRAFTMODE: c_int = 7; +pub const QUERYESCSUPPORT: c_int = 8; +pub const SETABORTPROC: c_int = 9; +pub const STARTDOC: c_int = 10; +pub const ENDDOC: c_int = 11; +pub const GETPHYSPAGESIZE: c_int = 12; +pub const GETPRINTINGOFFSET: c_int = 13; +pub const GETSCALINGFACTOR: c_int = 14; +pub const MFCOMMENT: c_int = 15; +pub const GETPENWIDTH: c_int = 16; +pub const SETCOPYCOUNT: c_int = 17; +pub const SELECTPAPERSOURCE: c_int = 18; +pub const DEVICEDATA: c_int = 19; +pub const PASSTHROUGH: c_int = 19; +pub const GETTECHNOLGY: c_int = 20; +pub const GETTECHNOLOGY: c_int = 20; +pub const SETLINECAP: c_int = 21; +pub const SETLINEJOIN: c_int = 22; +pub const SETMITERLIMIT: c_int = 23; +pub const BANDINFO: c_int = 24; +pub const DRAWPATTERNRECT: c_int = 25; +pub const GETVECTORPENSIZE: c_int = 26; +pub const GETVECTORBRUSHSIZE: c_int = 27; +pub const ENABLEDUPLEX: c_int = 28; +pub const GETSETPAPERBINS: c_int = 29; +pub const GETSETPRINTORIENT: c_int = 30; +pub const ENUMPAPERBINS: c_int = 31; +pub const SETDIBSCALING: c_int = 32; +pub const EPSPRINTING: c_int = 33; +pub const ENUMPAPERMETRICS: c_int = 34; +pub const GETSETPAPERMETRICS: c_int = 35; +pub const POSTSCRIPT_DATA: c_int = 37; +pub const POSTSCRIPT_IGNORE: c_int = 38; +pub const MOUSETRAILS: c_int = 39; +pub const GETDEVICEUNITS: c_int = 42; +pub const GETEXTENDEDTEXTMETRICS: c_int = 256; +pub const GETEXTENTTABLE: c_int = 257; +pub const GETPAIRKERNTABLE: c_int = 258; +pub const GETTRACKKERNTABLE: c_int = 259; +pub const EXTTEXTOUT: c_int = 512; +pub const GETFACENAME: c_int = 513; +pub const DOWNLOADFACE: c_int = 514; +pub const ENABLERELATIVEWIDTHS: c_int = 768; +pub const ENABLEPAIRKERNING: c_int = 769; +pub const SETKERNTRACK: c_int = 770; +pub const SETALLJUSTVALUES: c_int = 771; +pub const SETCHARSET: c_int = 772; +pub const STRETCHBLT: c_int = 2048; +pub const METAFILE_DRIVER: c_int = 2049; +pub const GETSETSCREENPARAMS: c_int = 3072; +pub const QUERYDIBSUPPORT: c_int = 3073; +pub const BEGIN_PATH: c_int = 4096; +pub const CLIP_TO_PATH: c_int = 4097; +pub const END_PATH: c_int = 4098; +pub const EXT_DEVICE_CAPS: c_int = 4099; +pub const RESTORE_CTM: c_int = 4100; +pub const SAVE_CTM: c_int = 4101; +pub const SET_ARC_DIRECTION: c_int = 4102; +pub const SET_BACKGROUND_COLOR: c_int = 4103; +pub const SET_POLY_MODE: c_int = 4104; +pub const SET_SCREEN_ANGLE: c_int = 4105; +pub const SET_SPREAD: c_int = 4106; +pub const TRANSFORM_CTM: c_int = 4107; +pub const SET_CLIP_BOX: c_int = 4108; +pub const SET_BOUNDS: c_int = 4109; +pub const SET_MIRROR_MODE: c_int = 4110; +pub const OPENCHANNEL: c_int = 4110; +pub const DOWNLOADHEADER: c_int = 4111; +pub const CLOSECHANNEL: c_int = 4112; +pub const POSTSCRIPT_PASSTHROUGH: c_int = 4115; +pub const ENCAPSULATED_POSTSCRIPT: c_int = 4116; +pub const POSTSCRIPT_IDENTIFY: c_int = 4117; +pub const POSTSCRIPT_INJECTION: c_int = 4118; +pub const CHECKJPEGFORMAT: c_int = 4119; +pub const CHECKPNGFORMAT: c_int = 4120; +pub const GET_PS_FEATURESETTING: c_int = 4121; +pub const GDIPLUS_TS_QUERYVER: c_int = 4122; +pub const GDIPLUS_TS_RECORD: c_int = 4123; +pub const MILCORE_TS_QUERYVER_RESULT_FALSE: c_int = 0x0; +pub const MILCORE_TS_QUERYVER_RESULT_TRUE: c_int = 0x7FFFFFFF; +pub const SPCLPASSTHROUGH2: c_int = 4568; +pub const PSIDENT_GDICENTRIC: c_int = 0; +pub const PSIDENT_PSCENTRIC: c_int = 1; +STRUCT!{struct PSINJECTDATA { + DataBytes: DWORD, + InjectionPoint: WORD, + PageNumber: WORD, +}} +pub type PPSINJECTDATA = *mut PSINJECTDATA; +pub const PSINJECT_BEGINSTREAM: WORD = 1; +pub const PSINJECT_PSADOBE: WORD = 2; +pub const PSINJECT_PAGESATEND: WORD = 3; +pub const PSINJECT_PAGES: WORD = 4; +pub const PSINJECT_DOCNEEDEDRES: WORD = 5; +pub const PSINJECT_DOCSUPPLIEDRES: WORD = 6; +pub const PSINJECT_PAGEORDER: WORD = 7; +pub const PSINJECT_ORIENTATION: WORD = 8; +pub const PSINJECT_BOUNDINGBOX: WORD = 9; +pub const PSINJECT_DOCUMENTPROCESSCOLORS: WORD = 10; +pub const PSINJECT_COMMENTS: WORD = 11; +pub const PSINJECT_BEGINDEFAULTS: WORD = 12; +pub const PSINJECT_ENDDEFAULTS: WORD = 13; +pub const PSINJECT_BEGINPROLOG: WORD = 14; +pub const PSINJECT_ENDPROLOG: WORD = 15; +pub const PSINJECT_BEGINSETUP: WORD = 16; +pub const PSINJECT_ENDSETUP: WORD = 17; +pub const PSINJECT_TRAILER: WORD = 18; +pub const PSINJECT_EOF: WORD = 19; +pub const PSINJECT_ENDSTREAM: WORD = 20; +pub const PSINJECT_DOCUMENTPROCESSCOLORSATEND: WORD = 21; +pub const PSINJECT_PAGENUMBER: WORD = 100; +pub const PSINJECT_BEGINPAGESETUP: WORD = 101; +pub const PSINJECT_ENDPAGESETUP: WORD = 102; +pub const PSINJECT_PAGETRAILER: WORD = 103; +pub const PSINJECT_PLATECOLOR: WORD = 104; +pub const PSINJECT_SHOWPAGE: WORD = 105; +pub const PSINJECT_PAGEBBOX: WORD = 106; +pub const PSINJECT_ENDPAGECOMMENTS: WORD = 107; +pub const PSINJECT_VMSAVE: WORD = 200; +pub const PSINJECT_VMRESTORE: WORD = 201; +pub const PSINJECT_DLFONT: DWORD = 0xdddddddd; +pub const FEATURESETTING_NUP: WORD = 0; +pub const FEATURESETTING_OUTPUT: WORD = 1; +pub const FEATURESETTING_PSLEVEL: WORD = 2; +pub const FEATURESETTING_CUSTPAPER: WORD = 3; +pub const FEATURESETTING_MIRROR: WORD = 4; +pub const FEATURESETTING_NEGATIVE: WORD = 5; +pub const FEATURESETTING_PROTOCOL: WORD = 6; +pub const FEATURESETTING_PRIVATE_BEGIN: WORD = 0x1000; +pub const FEATURESETTING_PRIVATE_END: WORD = 0x1FFF; +STRUCT!{struct PSFEATURE_OUTPUT { + bPageIndependent: BOOL, + bSetPageDevice: BOOL, +}} +pub type PPSFEATURE_OUTPUT = *mut PSFEATURE_OUTPUT; +STRUCT!{struct PSFEATURE_CUSTPAPER { + lOrientation: LONG, + lWidth: LONG, + lHeight: LONG, + lWidthOffset: LONG, + lHeightOffset: LONG, +}} +pub type PPSFEATURE_CUSTPAPER = *mut PSFEATURE_CUSTPAPER; +pub const PSPROTOCOL_ASCII: c_int = 0; +pub const PSPROTOCOL_BCP: c_int = 1; +pub const PSPROTOCOL_TBCP: c_int = 2; +pub const PSPROTOCOL_BINARY: c_int = 3; +pub const QDI_SETDIBITS: c_int = 1; +pub const QDI_GETDIBITS: c_int = 2; +pub const QDI_DIBTOSCREEN: c_int = 4; +pub const QDI_STRETCHDIB: c_int = 8; +pub const SP_NOTREPORTED: c_int = 0x4000; +pub const SP_ERROR: c_int = -1; +pub const SP_APPABORT: c_int = -2; +pub const SP_USERABORT: c_int = -3; +pub const SP_OUTOFDISK: c_int = -4; +pub const SP_OUTOFMEMORY: c_int = -5; +pub const PR_JOBSTATUS: c_int = 0x0000; +pub const OBJ_PEN: UINT = 1; +pub const OBJ_BRUSH: UINT = 2; +pub const OBJ_DC: UINT = 3; +pub const OBJ_METADC: UINT = 4; +pub const OBJ_PAL: UINT = 5; +pub const OBJ_FONT: UINT = 6; +pub const OBJ_BITMAP: UINT = 7; +pub const OBJ_REGION: UINT = 8; +pub const OBJ_METAFILE: UINT = 9; +pub const OBJ_MEMDC: UINT = 10; +pub const OBJ_EXTPEN: UINT = 11; +pub const OBJ_ENHMETADC: UINT = 12; +pub const OBJ_ENHMETAFILE: UINT = 13; +pub const OBJ_COLORSPACE: UINT = 14; +pub const GDI_OBJ_LAST: UINT = OBJ_COLORSPACE; +pub const MWT_IDENTITY: c_int = 1; +pub const MWT_LEFTMULTIPLY: c_int = 2; +pub const MWT_RIGHTMULTIPLY: c_int = 3; +pub const MWT_MIN: c_int = MWT_IDENTITY; +pub const MWT_MAX: c_int = MWT_RIGHTMULTIPLY; +STRUCT!{struct XFORM { + eM11: FLOAT, + eM12: FLOAT, + eM21: FLOAT, + eM22: FLOAT, + eDx: FLOAT, + eDy: FLOAT, +}} +pub type PXFORM = *mut XFORM; +pub type LPXFORM = *mut XFORM; +STRUCT!{struct BITMAP { + bmType: LONG, + bmWidth: LONG, + bmHeight: LONG, + bmWidthBytes: LONG, + bmPlanes: WORD, + bmBitsPixel: WORD, + bmBits: LPVOID, +}} +pub type PBITMAP = *mut BITMAP; +pub type NPBITMAP = *mut BITMAP; +pub type LPBITMAP = *mut BITMAP; +STRUCT!{#[debug] struct RGBTRIPLE { + rgbtBlue: BYTE, + rgbtGreen: BYTE, + rgbtRed: BYTE, +}} +pub type PRGBTRIPLE = *mut RGBTRIPLE; +pub type NPRGBTRIPLE = *mut RGBTRIPLE; +pub type LPRGBTRIPLE = *mut RGBTRIPLE; +STRUCT!{#[debug] struct RGBQUAD { + rgbBlue: BYTE, + rgbGreen: BYTE, + rgbRed: BYTE, + rgbReserved: BYTE, +}} +pub type LPRGBQUAD = *mut RGBQUAD; +pub const CS_ENABLE: DWORD = 0x00000001; +pub const CS_DISABLE: DWORD = 0x00000002; +pub const CS_DELETE_TRANSFORM: DWORD = 0x00000003; +pub const LCS_SIGNATURE: DWORD = 0x5053_4F43; // 'PSOC' +pub const LCS_sRGB: LCSCSTYPE = 0x7352_4742; // 'sRGB' +pub const LCS_WINDOWS_COLOR_SPACE: LCSCSTYPE = 0x5769_6E20; // 'Win ' +pub type LCSCSTYPE = LONG; +pub const LCS_CALIBRATED_RGB: LCSCSTYPE = 0x00000000; +pub type LCSGAMUTMATCH = LONG; +pub const LCS_GM_BUSINESS: LCSGAMUTMATCH = 0x00000001; +pub const LCS_GM_GRAPHICS: LCSGAMUTMATCH = 0x00000002; +pub const LCS_GM_IMAGES: LCSGAMUTMATCH = 0x00000004; +pub const LCS_GM_ABS_COLORIMETRIC: LCSGAMUTMATCH = 0x00000008; +pub const CM_OUT_OF_GAMUT: BYTE = 255; +pub const CM_IN_GAMUT: BYTE = 0; +pub const ICM_ADDPROFILE: UINT = 1; +pub const ICM_DELETEPROFILE: UINT = 2; +pub const ICM_QUERYPROFILE: UINT = 3; +pub const ICM_SETDEFAULTPROFILE: UINT = 4; +pub const ICM_REGISTERICMATCHER: UINT = 5; +pub const ICM_UNREGISTERICMATCHER: UINT = 6; +pub const ICM_QUERYMATCH: UINT = 7; +#[inline] +pub fn GetKValue(cmyk: COLORREF) -> BYTE { + cmyk as BYTE +} +#[inline] +pub fn GetYValue(cmyk: COLORREF) -> BYTE { + (cmyk >> 8) as BYTE +} +#[inline] +pub fn GetMValue(cmyk: COLORREF) -> BYTE { + (cmyk >> 16) as BYTE +} +#[inline] +pub fn GetCValue(cmyk: COLORREF) -> BYTE { + (cmyk >> 24) as BYTE +} +#[inline] +pub fn CMYK(c: BYTE, m: BYTE, y: BYTE, k: BYTE) -> COLORREF { + (k as COLORREF) | ((y as COLORREF) << 8) | ((m as COLORREF) << 16) | ((c as COLORREF) << 24) +} +pub type FXPT16DOT16 = c_long; +pub type LPFXPT16DOT16 = *mut c_long; +pub type FXPT2DOT30 = c_long; +pub type LPFXPT2DOT30 = *mut c_long; +STRUCT!{#[debug] struct CIEXYZ { + ciexyzX: FXPT2DOT30, + ciexyzY: FXPT2DOT30, + ciexyzZ: FXPT2DOT30, +}} +pub type LPCIEXYZ = *mut CIEXYZ; +STRUCT!{#[debug] struct CIEXYZTRIPLE { + ciexyzRed: CIEXYZ, + ciexyzGreen: CIEXYZ, + ciexyzBlue: CIEXYZ, +}} +pub type LPCIEXYZTRIPLE = *mut CIEXYZTRIPLE; +STRUCT!{struct LOGCOLORSPACEA { + lcsSignature: DWORD, + lcsVersion: DWORD, + lcsSize: DWORD, + lcsCSType: LCSCSTYPE, + lcsIntent: LCSGAMUTMATCH, + lcsEndpoints: CIEXYZTRIPLE, + lcsGammaRed: DWORD, + lcsGammaGreen: DWORD, + lcsGammaBlue: DWORD, + lcsFilename: [CHAR; MAX_PATH], +}} +pub type LPLOGCOLORSPACEA = *mut LOGCOLORSPACEA; +STRUCT!{struct LOGCOLORSPACEW { + lcsSignature: DWORD, + lcsVersion: DWORD, + lcsSize: DWORD, + lcsCSType: LCSCSTYPE, + lcsIntent: LCSGAMUTMATCH, + lcsEndpoints: CIEXYZTRIPLE, + lcsGammaRed: DWORD, + lcsGammaGreen: DWORD, + lcsGammaBlue: DWORD, + lcsFilename: [WCHAR; MAX_PATH], +}} +pub type LPLOGCOLORSPACEW = *mut LOGCOLORSPACEW; +STRUCT!{#[debug] struct BITMAPCOREHEADER { + bcSize: DWORD, + bcWidth: WORD, + bcHeight: WORD, + bcPlanes: WORD, + bcBitCount: WORD, +}} +pub type LPBITMAPCOREHEADER = *mut BITMAPCOREHEADER; +pub type PBITMAPCOREHEADER = *mut BITMAPCOREHEADER; +STRUCT!{#[debug] struct BITMAPINFOHEADER { + biSize: DWORD, + biWidth: LONG, + biHeight: LONG, + biPlanes: WORD, + biBitCount: WORD, + biCompression: DWORD, + biSizeImage: DWORD, + biXPelsPerMeter: LONG, + biYPelsPerMeter: LONG, + biClrUsed: DWORD, + biClrImportant: DWORD, +}} +pub type LPBITMAPINFOHEADER = *mut BITMAPINFOHEADER; +pub type PBITMAPINFOHEADER = *mut BITMAPINFOHEADER; +STRUCT!{#[debug] struct BITMAPV4HEADER { + bV4Size: DWORD, + bV4Width: LONG, + bV4Height: LONG, + bV4Planes: WORD, + bV4BitCount: WORD, + bV4V4Compression: DWORD, + bV4SizeImage: DWORD, + bV4XPelsPerMeter: LONG, + bV4YPelsPerMeter: LONG, + bV4ClrUsed: DWORD, + bV4ClrImportant: DWORD, + bV4RedMask: DWORD, + bV4GreenMask: DWORD, + bV4BlueMask: DWORD, + bV4AlphaMask: DWORD, + bV4CSType: DWORD, + bV4Endpoints: CIEXYZTRIPLE, + bV4GammaRed: DWORD, + bV4GammaGreen: DWORD, + bV4GammaBlue: DWORD, +}} +pub type LPBITMAPV4HEADER = *mut BITMAPV4HEADER; +pub type PBITMAPV4HEADER = *mut BITMAPV4HEADER; +STRUCT!{#[debug] struct BITMAPV5HEADER { + bV5Size: DWORD, + bV5Width: LONG, + bV5Height: LONG, + bV5Planes: WORD, + bV5BitCount: WORD, + bV5Compression: DWORD, + bV5SizeImage: DWORD, + bV5XPelsPerMeter: LONG, + bV5YPelsPerMeter: LONG, + bV5ClrUsed: DWORD, + bV5ClrImportant: DWORD, + bV5RedMask: DWORD, + bV5GreenMask: DWORD, + bV5BlueMask: DWORD, + bV5AlphaMask: DWORD, + bV5CSType: DWORD, + bV5Endpoints: CIEXYZTRIPLE, + bV5GammaRed: DWORD, + bV5GammaGreen: DWORD, + bV5GammaBlue: DWORD, + bV5Intent: DWORD, + bV5ProfileData: DWORD, + bV5ProfileSize: DWORD, + bV5Reserved: DWORD, +}} +pub type LPBITMAPV5HEADER = *mut BITMAPV5HEADER; +pub type PBITMAPV5HEADER = *mut BITMAPV5HEADER; +pub const PROFILE_LINKED: LONG = 0x4C49_4E4B; // 'LINK' +pub const PROFILE_EMBEDDED: LONG = 0x4D42_4544; // 'MBED' +pub const BI_RGB: DWORD = 0; +pub const BI_RLE8: DWORD = 1; +pub const BI_RLE4: DWORD = 2; +pub const BI_BITFIELDS: DWORD = 3; +pub const BI_JPEG: DWORD = 4; +pub const BI_PNG: DWORD = 5; +STRUCT!{#[debug] struct BITMAPINFO { + bmiHeader: BITMAPINFOHEADER, + bmiColors: [RGBQUAD; 1], +}} +pub type LPBITMAPINFO = *mut BITMAPINFO; +pub type PBITMAPINFO = *mut BITMAPINFO; +STRUCT!{#[debug] struct BITMAPCOREINFO { + bmciHeader: BITMAPCOREHEADER, + bmciColors: [RGBTRIPLE; 1], +}} +pub type LPBITMAPCOREINFO = *mut BITMAPCOREINFO; +pub type PBITMAPCOREINFO = *mut BITMAPCOREINFO; +STRUCT!{#[debug] #[repr(packed)] struct BITMAPFILEHEADER { + bfType: WORD, + bfSize: DWORD, + bfReserved1: WORD, + bfReserved2: WORD, + bfOffBits: DWORD, +}} +pub type LPBITMAPFILEHEADER = *mut BITMAPFILEHEADER; +pub type PBITMAPFILEHEADER = *mut BITMAPFILEHEADER; +#[inline] +pub fn MAKEPOINTS(l: DWORD) -> POINTS { + unsafe { ::core::mem::transmute::(l) } +} +STRUCT!{#[debug] struct FONTSIGNATURE { + fsUsb: [DWORD; 4], + fsCsb: [DWORD; 2], +}} +pub type LPFONTSIGNATURE = *mut FONTSIGNATURE; +pub type PFONTSIGNATURE = *mut FONTSIGNATURE; +STRUCT!{#[debug] struct CHARSETINFO { + ciCharset: UINT, + ciACP: UINT, + fs: FONTSIGNATURE, +}} +pub type PCHARSETINFO = *mut CHARSETINFO; +pub type NPCHARSETINFO = *mut CHARSETINFO; +pub type LPCHARSETINFO = *mut CHARSETINFO; +pub const TCI_SRCCHARSET: c_int = 1; +pub const TCI_SRCCODEPAGE: c_int = 2; +pub const TCI_SRCFONTSIG: c_int = 3; +pub const TCI_SRCLOCALE: c_int = 0x1000; +STRUCT!{#[debug] struct LOCALESIGNATURE { + lsUsb: [DWORD; 4], + lsCsbDefault: [DWORD; 2], + lsCsbSupported: [DWORD; 2], +}} +pub type PLOCALESIGNATURE = *mut LOCALESIGNATURE; +pub type LPLOCALESIGNATURE = *mut LOCALESIGNATURE; +STRUCT!{struct HANDLETABLE { + objectHandle: [HGDIOBJ; 1], +}} +pub type LPHANDLETABLE = *mut HANDLETABLE; +pub type PHANDLETABLE = *mut HANDLETABLE; +STRUCT!{struct METARECORD { + rdSize: DWORD, + rdFunction: WORD, + rdParm: [WORD; 1], +}} +pub type PMETARECORD = *mut METARECORD; +pub type LPMETARECORD = *mut METARECORD; +STRUCT!{struct METAFILEPICT { + mm: LONG, + xExt: LONG, + yExt: LONG, + hMF: HMETAFILE, +}} +pub type LPMETAFILEPICT = *mut METAFILEPICT; +STRUCT!{struct METAHEADER { + mtType: WORD, + mtHeaderSize: WORD, + mtVersion: WORD, + mtSize: DWORD, + mtNoObjects: WORD, + mtMaxRecord: DWORD, + mtNoParameters: WORD, +}} +pub type PMETAHEADER = *mut METAHEADER; +pub type LPMETAHEADER = *mut METAHEADER; +STRUCT!{struct ENHMETARECORD { + iType: DWORD, + nSize: DWORD, + dParm: [DWORD; 1], +}} +pub type PENHMETARECORD = *mut ENHMETARECORD; +pub type LPENHMETARECORD = *mut ENHMETARECORD; +STRUCT!{struct ENHMETAHEADER { + iType: DWORD, + nSize: DWORD, + rclBounds: RECTL, + rclFrame: RECTL, + dSignature: DWORD, + nVersion: DWORD, + nBytes: DWORD, + nRecords: DWORD, + nHandles: WORD, + sReserved: WORD, + nDescription: DWORD, + offDescription: DWORD, + nPalEntries: DWORD, + szlDevice: SIZEL, + szlMillimeters: SIZEL, + cbPixelFormat: DWORD, + offPixelFormat: DWORD, + bOpenGL: DWORD, + szlMicrometers: SIZEL, +}} +pub type PENHMETAHEADER = *mut ENHMETAHEADER; +pub type LPENHMETAHEADER = *mut ENHMETAHEADER; +pub const TMPF_FIXED_PITCH: BYTE = 0x01; +pub const TMPF_VECTOR: BYTE = 0x02; +pub const TMPF_DEVICE: BYTE = 0x08; +pub const TMPF_TRUETYPE: BYTE = 0x04; +// BCHAR +STRUCT!{struct TEXTMETRICA { + tmHeight: LONG, + tmAscent: LONG, + tmDescent: LONG, + tmInternalLeading: LONG, + tmExternalLeading: LONG, + tmAveCharWidth: LONG, + tmMaxCharWidth: LONG, + tmWeight: LONG, + tmOverhang: LONG, + tmDigitizedAspectX: LONG, + tmDigitizedAspectY: LONG, + tmFirstChar: BYTE, + tmLastChar: BYTE, + tmDefaultChar: BYTE, + tmBreakChar: BYTE, + tmItalic: BYTE, + tmUnderlined: BYTE, + tmStruckOut: BYTE, + tmPitchAndFamily: BYTE, + tmCharSet: BYTE, +}} +pub type PTEXTMETRICA = *mut TEXTMETRICA; +pub type NPTEXTMETRICA = *mut TEXTMETRICA; +pub type LPTEXTMETRICA = *mut TEXTMETRICA; +STRUCT!{struct TEXTMETRICW { + tmHeight: LONG, + tmAscent: LONG, + tmDescent: LONG, + tmInternalLeading: LONG, + tmExternalLeading: LONG, + tmAveCharWidth: LONG, + tmMaxCharWidth: LONG, + tmWeight: LONG, + tmOverhang: LONG, + tmDigitizedAspectX: LONG, + tmDigitizedAspectY: LONG, + tmFirstChar: WCHAR, + tmLastChar: WCHAR, + tmDefaultChar: WCHAR, + tmBreakChar: WCHAR, + tmItalic: BYTE, + tmUnderlined: BYTE, + tmStruckOut: BYTE, + tmPitchAndFamily: BYTE, + tmCharSet: BYTE, +}} +pub type PTEXTMETRICW = *mut TEXTMETRICW; +pub type NPTEXTMETRICW = *mut TEXTMETRICW; +pub type LPTEXTMETRICW = *mut TEXTMETRICW; +pub const NTM_REGULAR: DWORD = 0x00000040; +pub const NTM_BOLD: DWORD = 0x00000020; +pub const NTM_ITALIC: DWORD = 0x00000001; +pub const NTM_NONNEGATIVE_AC: DWORD = 0x00010000; +pub const NTM_PS_OPENTYPE: DWORD = 0x00020000; +pub const NTM_TT_OPENTYPE: DWORD = 0x00040000; +pub const NTM_MULTIPLEMASTER: DWORD = 0x00080000; +pub const NTM_TYPE1: DWORD = 0x00100000; +pub const NTM_DSIG: DWORD = 0x00200000; +STRUCT!{struct NEWTEXTMETRICA { + tmHeight: LONG, + tmAscent: LONG, + tmDescent: LONG, + tmInternalLeading: LONG, + tmExternalLeading: LONG, + tmAveCharWidth: LONG, + tmMaxCharWidth: LONG, + tmWeight: LONG, + tmOverhang: LONG, + tmDigitizedAspectX: LONG, + tmDigitizedAspectY: LONG, + tmFirstChar: BYTE, + tmLastChar: BYTE, + tmDefaultChar: BYTE, + tmBreakChar: BYTE, + tmItalic: BYTE, + tmUnderlined: BYTE, + tmStruckOut: BYTE, + tmPitchAndFamily: BYTE, + tmCharSet: BYTE, + ntmFlags: DWORD, + ntmSizeEM: UINT, + ntmCellHeight: UINT, + ntmAvgWidth: UINT, +}} +pub type PNEWTEXTMETRICA = *mut NEWTEXTMETRICA; +pub type NPNEWTEXTMETRICA = *mut NEWTEXTMETRICA; +pub type LPNEWTEXTMETRICA = *mut NEWTEXTMETRICA; +STRUCT!{struct NEWTEXTMETRICW { + tmHeight: LONG, + tmAscent: LONG, + tmDescent: LONG, + tmInternalLeading: LONG, + tmExternalLeading: LONG, + tmAveCharWidth: LONG, + tmMaxCharWidth: LONG, + tmWeight: LONG, + tmOverhang: LONG, + tmDigitizedAspectX: LONG, + tmDigitizedAspectY: LONG, + tmFirstChar: WCHAR, + tmLastChar: WCHAR, + tmDefaultChar: WCHAR, + tmBreakChar: WCHAR, + tmItalic: BYTE, + tmUnderlined: BYTE, + tmStruckOut: BYTE, + tmPitchAndFamily: BYTE, + tmCharSet: BYTE, + ntmFlags: DWORD, + ntmSizeEM: UINT, + ntmCellHeight: UINT, + ntmAvgWidth: UINT, +}} +pub type PNEWTEXTMETRICW = *mut NEWTEXTMETRICW; +pub type NPNEWTEXTMETRICW = *mut NEWTEXTMETRICW; +pub type LPNEWTEXTMETRICW = *mut NEWTEXTMETRICW; +STRUCT!{struct NEWTEXTMETRICEXA { + ntmTm: NEWTEXTMETRICA, + ntmFontSig: FONTSIGNATURE, +}} +STRUCT!{struct NEWTEXTMETRICEXW { + ntmTm: NEWTEXTMETRICW, + ntmFontSig: FONTSIGNATURE, +}} +STRUCT!{struct PELARRAY { + paXCount: LONG, + paYCount: LONG, + paXExt: LONG, + paYExt: LONG, + paRGBs: BYTE, +}} +pub type PPELARRAY = *mut PELARRAY; +pub type NPPELARRAY = *mut PELARRAY; +pub type LPPELARRAY = *mut PELARRAY; +STRUCT!{struct LOGBRUSH { + lbStyle: UINT, + lbColor: COLORREF, + lbHatch: ULONG_PTR, +}} +pub type PLOGBRUSH = *mut LOGBRUSH; +pub type NPLOGBRUSH = *mut LOGBRUSH; +pub type LPLOGBRUSH = *mut LOGBRUSH; +STRUCT!{struct LOGBRUSH32 { + lbStyle: UINT, + lbColor: COLORREF, + lbHatch: ULONG, +}} +pub type PLOGBRUSH32 = *mut LOGBRUSH32; +pub type NPLOGBRUSH32 = *mut LOGBRUSH32; +pub type LPLOGBRUSH32 = *mut LOGBRUSH32; +pub type PATTERN = LOGBRUSH; +pub type PPATTERN = *mut PATTERN; +pub type NPPATTERN = *mut PATTERN; +pub type LPPATTERN = *mut PATTERN; +STRUCT!{struct LOGPEN { + lopnStyle: UINT, + lopnWidth: POINT, + lopnColor: COLORREF, +}} +pub type PLOGPEN = *mut LOGPEN; +pub type NPLOGPEN = *mut LOGPEN; +pub type LPLOGPEN = *mut LOGPEN; +STRUCT!{struct EXTLOGPEN { + elpPenStyle: DWORD, + elpWidth: DWORD, + elpBrushStyle: UINT, + elpColor: COLORREF, + elpHatch: ULONG_PTR, + elpNumEntries: DWORD, + elpStyleEntry: [DWORD; 1], +}} +pub type PEXTLOGPEN = *mut EXTLOGPEN; +pub type NPEXTLOGPEN = *mut EXTLOGPEN; +pub type LPEXTLOGPEN = *mut EXTLOGPEN; +STRUCT!{struct EXTLOGPEN32 { + elpPenStyle: DWORD, + elpWidth: DWORD, + elpBrushStyle: UINT, + elpColor: COLORREF, + elpHatch: ULONG, + elpNumEntries: DWORD, + elpStyleEntry: [DWORD; 1], +}} +pub type PEXTLOGPEN32 = *mut EXTLOGPEN32; +pub type NPEXTLOGPEN32 = *mut EXTLOGPEN32; +pub type LPEXTLOGPEN32 = *mut EXTLOGPEN32; +STRUCT!{struct PALETTEENTRY { + peRed: BYTE, + peGreen: BYTE, + peBlue: BYTE, + peFlags: BYTE, +}} +pub type PPALETTEENTRY = *mut PALETTEENTRY; +pub type LPPALETTEENTRY = *mut PALETTEENTRY; +STRUCT!{struct LOGPALETTE { + palVersion: WORD, + palNumEntries: WORD, + palPalEntry: [PALETTEENTRY; 1], +}} +pub type PLOGPALETTE = *mut LOGPALETTE; +pub type NPLOGPALETTE = *mut LOGPALETTE; +pub type LPLOGPALETTE = *mut LOGPALETTE; +pub const LF_FACESIZE: usize = 32; +STRUCT!{struct LOGFONTA { + lfHeight: LONG, + lfWidth: LONG, + lfEscapement: LONG, + lfOrientation: LONG, + lfWeight: LONG, + lfItalic: BYTE, + lfUnderline: BYTE, + lfStrikeOut: BYTE, + lfCharSet: BYTE, + lfOutPrecision: BYTE, + lfClipPrecision: BYTE, + lfQuality: BYTE, + lfPitchAndFamily: BYTE, + lfFaceName: [CHAR; LF_FACESIZE], +}} +pub type PLOGFONTA = *mut LOGFONTA; +pub type NPLOGFONTA = *mut LOGFONTA; +pub type LPLOGFONTA = *mut LOGFONTA; +STRUCT!{struct LOGFONTW { + lfHeight: LONG, + lfWidth: LONG, + lfEscapement: LONG, + lfOrientation: LONG, + lfWeight: LONG, + lfItalic: BYTE, + lfUnderline: BYTE, + lfStrikeOut: BYTE, + lfCharSet: BYTE, + lfOutPrecision: BYTE, + lfClipPrecision: BYTE, + lfQuality: BYTE, + lfPitchAndFamily: BYTE, + lfFaceName: [WCHAR; LF_FACESIZE], +}} +pub type PLOGFONTW = *mut LOGFONTW; +pub type NPLOGFONTW = *mut LOGFONTW; +pub type LPLOGFONTW = *mut LOGFONTW; +pub const LF_FULLFACESIZE: usize = 64; +STRUCT!{struct ENUMLOGFONTA { + elfLogFont: LOGFONTA, + elfFullName: [BYTE; LF_FULLFACESIZE], + elfStyle: [BYTE; LF_FACESIZE], +}} +pub type LPENUMLOGFONTA = *mut ENUMLOGFONTA; +STRUCT!{struct ENUMLOGFONTW { + elfLogFont: LOGFONTW, + elfFullName: [WCHAR; LF_FULLFACESIZE], + elfStyle: [WCHAR; LF_FACESIZE], +}} +pub type LPENUMLOGFONTW = *mut ENUMLOGFONTW; +STRUCT!{struct ENUMLOGFONTEXA { + elfLogFont: LOGFONTA, + elfFullName: [BYTE; LF_FULLFACESIZE], + elfStyle: [BYTE; LF_FACESIZE], + elfScript: [BYTE; LF_FACESIZE], +}} +pub type LPENUMLOGFONTEXA = *mut ENUMLOGFONTEXA; +STRUCT!{struct ENUMLOGFONTEXW { + elfLogFont: LOGFONTW, + elfFullName: [WCHAR; LF_FULLFACESIZE], + elfStyle: [WCHAR; LF_FACESIZE], + elfScript: [WCHAR; LF_FACESIZE], +}} +pub type LPENUMLOGFONTEXW = *mut ENUMLOGFONTEXW; +pub const OUT_DEFAULT_PRECIS: DWORD = 0; +pub const OUT_STRING_PRECIS: DWORD = 1; +pub const OUT_CHARACTER_PRECIS: DWORD = 2; +pub const OUT_STROKE_PRECIS: DWORD = 3; +pub const OUT_TT_PRECIS: DWORD = 4; +pub const OUT_DEVICE_PRECIS: DWORD = 5; +pub const OUT_RASTER_PRECIS: DWORD = 6; +pub const OUT_TT_ONLY_PRECIS: DWORD = 7; +pub const OUT_OUTLINE_PRECIS: DWORD = 8; +pub const OUT_SCREEN_OUTLINE_PRECIS: DWORD = 9; +pub const OUT_PS_ONLY_PRECIS: DWORD = 10; +pub const CLIP_DEFAULT_PRECIS: DWORD = 0; +pub const CLIP_CHARACTER_PRECIS: DWORD = 1; +pub const CLIP_STROKE_PRECIS: DWORD = 2; +pub const CLIP_MASK: DWORD = 0xf; +pub const CLIP_LH_ANGLES: DWORD = 1 << 4; +pub const CLIP_TT_ALWAYS: DWORD = 2 << 4; +pub const CLIP_DFA_DISABLE: DWORD = 4 << 4; +pub const CLIP_EMBEDDED: DWORD = 8 << 4; +pub const DEFAULT_QUALITY: DWORD = 0; +pub const DRAFT_QUALITY: DWORD = 1; +pub const PROOF_QUALITY: DWORD = 2; +pub const NONANTIALIASED_QUALITY: DWORD = 3; +pub const ANTIALIASED_QUALITY: DWORD = 4; +pub const CLEARTYPE_QUALITY: DWORD = 5; +pub const CLEARTYPE_NATURAL_QUALITY: DWORD = 6; +pub const DEFAULT_PITCH: DWORD = 0; +pub const FIXED_PITCH: DWORD = 1; +pub const VARIABLE_PITCH: DWORD = 2; +pub const MONO_FONT: DWORD = 8; +pub const ANSI_CHARSET: DWORD = 0; +pub const DEFAULT_CHARSET: DWORD = 1; +pub const SYMBOL_CHARSET: DWORD = 2; +pub const SHIFTJIS_CHARSET: DWORD = 128; +pub const HANGEUL_CHARSET: DWORD = 129; +pub const HANGUL_CHARSET: DWORD = 129; +pub const GB2312_CHARSET: DWORD = 134; +pub const CHINESEBIG5_CHARSET: DWORD = 136; +pub const OEM_CHARSET: DWORD = 255; +pub const JOHAB_CHARSET: DWORD = 130; +pub const HEBREW_CHARSET: DWORD = 177; +pub const ARABIC_CHARSET: DWORD = 178; +pub const GREEK_CHARSET: DWORD = 161; +pub const TURKISH_CHARSET: DWORD = 162; +pub const VIETNAMESE_CHARSET: DWORD = 163; +pub const THAI_CHARSET: DWORD = 222; +pub const EASTEUROPE_CHARSET: DWORD = 238; +pub const RUSSIAN_CHARSET: DWORD = 204; +pub const MAC_CHARSET: DWORD = 77; +pub const BALTIC_CHARSET: DWORD = 186; +pub const FS_LATIN1: DWORD = 0x00000001; +pub const FS_LATIN2: DWORD = 0x00000002; +pub const FS_CYRILLIC: DWORD = 0x00000004; +pub const FS_GREEK: DWORD = 0x00000008; +pub const FS_TURKISH: DWORD = 0x00000010; +pub const FS_HEBREW: DWORD = 0x00000020; +pub const FS_ARABIC: DWORD = 0x00000040; +pub const FS_BALTIC: DWORD = 0x00000080; +pub const FS_VIETNAMESE: DWORD = 0x00000100; +pub const FS_THAI: DWORD = 0x00010000; +pub const FS_JISJAPAN: DWORD = 0x00020000; +pub const FS_CHINESESIMP: DWORD = 0x00040000; +pub const FS_WANSUNG: DWORD = 0x00080000; +pub const FS_CHINESETRAD: DWORD = 0x00100000; +pub const FS_JOHAB: DWORD = 0x00200000; +pub const FS_SYMBOL: DWORD = 0x80000000; +pub const FF_DONTCARE: DWORD = 0 << 4; +pub const FF_ROMAN: DWORD = 1 << 4; +pub const FF_SWISS: DWORD = 2 << 4; +pub const FF_MODERN: DWORD = 3 << 4; +pub const FF_SCRIPT: DWORD = 4 << 4; +pub const FF_DECORATIVE: DWORD = 5 << 4; +pub const FW_DONTCARE: c_int = 0; +pub const FW_THIN: c_int = 100; +pub const FW_EXTRALIGHT: c_int = 200; +pub const FW_LIGHT: c_int = 300; +pub const FW_NORMAL: c_int = 400; +pub const FW_MEDIUM: c_int = 500; +pub const FW_SEMIBOLD: c_int = 600; +pub const FW_BOLD: c_int = 700; +pub const FW_EXTRABOLD: c_int = 800; +pub const FW_HEAVY: c_int = 900; +pub const FW_ULTRALIGHT: c_int = FW_EXTRALIGHT; +pub const FW_REGULAR: c_int = FW_NORMAL; +pub const FW_DEMIBOLD: c_int = FW_SEMIBOLD; +pub const FW_ULTRABOLD: c_int = FW_EXTRABOLD; +pub const FW_BLACK: c_int = FW_HEAVY; +pub const PANOSE_COUNT: DWORD = 10; +pub const PAN_FAMILYTYPE_INDEX: DWORD = 0; +pub const PAN_SERIFSTYLE_INDEX: DWORD = 1; +pub const PAN_WEIGHT_INDEX: DWORD = 2; +pub const PAN_PROPORTION_INDEX: DWORD = 3; +pub const PAN_CONTRAST_INDEX: DWORD = 4; +pub const PAN_STROKEVARIATION_INDEX: DWORD = 5; +pub const PAN_ARMSTYLE_INDEX: DWORD = 6; +pub const PAN_LETTERFORM_INDEX: DWORD = 7; +pub const PAN_MIDLINE_INDEX: DWORD = 8; +pub const PAN_XHEIGHT_INDEX: DWORD = 9; +pub const PAN_CULTURE_LATIN: DWORD = 0; +STRUCT!{struct PANOSE { + bFamilyType: BYTE, + bSerifStyle: BYTE, + bWeight: BYTE, + bProportion: BYTE, + bContrast: BYTE, + bStrokeVariation: BYTE, + bArmStyle: BYTE, + bLetterform: BYTE, + bMidline: BYTE, + bXHeight: BYTE, +}} +pub type LPPANOSE = *mut PANOSE; +pub const PAN_ANY: BYTE = 0; +pub const PAN_NO_FIT: BYTE = 1; +pub const PAN_FAMILY_TEXT_DISPLAY: BYTE = 2; +pub const PAN_FAMILY_SCRIPT: BYTE = 3; +pub const PAN_FAMILY_DECORATIVE: BYTE = 4; +pub const PAN_FAMILY_PICTORIAL: BYTE = 5; +pub const PAN_SERIF_COVE: BYTE = 2; +pub const PAN_SERIF_OBTUSE_COVE: BYTE = 3; +pub const PAN_SERIF_SQUARE_COVE: BYTE = 4; +pub const PAN_SERIF_OBTUSE_SQUARE_COVE: BYTE = 5; +pub const PAN_SERIF_SQUARE: BYTE = 6; +pub const PAN_SERIF_THIN: BYTE = 7; +pub const PAN_SERIF_BONE: BYTE = 8; +pub const PAN_SERIF_EXAGGERATED: BYTE = 9; +pub const PAN_SERIF_TRIANGLE: BYTE = 10; +pub const PAN_SERIF_NORMAL_SANS: BYTE = 11; +pub const PAN_SERIF_OBTUSE_SANS: BYTE = 12; +pub const PAN_SERIF_PERP_SANS: BYTE = 13; +pub const PAN_SERIF_FLARED: BYTE = 14; +pub const PAN_SERIF_ROUNDED: BYTE = 15; +pub const PAN_WEIGHT_VERY_LIGHT: BYTE = 2; +pub const PAN_WEIGHT_LIGHT: BYTE = 3; +pub const PAN_WEIGHT_THIN: BYTE = 4; +pub const PAN_WEIGHT_BOOK: BYTE = 5; +pub const PAN_WEIGHT_MEDIUM: BYTE = 6; +pub const PAN_WEIGHT_DEMI: BYTE = 7; +pub const PAN_WEIGHT_BOLD: BYTE = 8; +pub const PAN_WEIGHT_HEAVY: BYTE = 9; +pub const PAN_WEIGHT_BLACK: BYTE = 10; +pub const PAN_WEIGHT_NORD: BYTE = 11; +pub const PAN_PROP_OLD_STYLE: BYTE = 2; +pub const PAN_PROP_MODERN: BYTE = 3; +pub const PAN_PROP_EVEN_WIDTH: BYTE = 4; +pub const PAN_PROP_EXPANDED: BYTE = 5; +pub const PAN_PROP_CONDENSED: BYTE = 6; +pub const PAN_PROP_VERY_EXPANDED: BYTE = 7; +pub const PAN_PROP_VERY_CONDENSED: BYTE = 8; +pub const PAN_PROP_MONOSPACED: BYTE = 9; +pub const PAN_CONTRAST_NONE: BYTE = 2; +pub const PAN_CONTRAST_VERY_LOW: BYTE = 3; +pub const PAN_CONTRAST_LOW: BYTE = 4; +pub const PAN_CONTRAST_MEDIUM_LOW: BYTE = 5; +pub const PAN_CONTRAST_MEDIUM: BYTE = 6; +pub const PAN_CONTRAST_MEDIUM_HIGH: BYTE = 7; +pub const PAN_CONTRAST_HIGH: BYTE = 8; +pub const PAN_CONTRAST_VERY_HIGH: BYTE = 9; +pub const PAN_STROKE_GRADUAL_DIAG: BYTE = 2; +pub const PAN_STROKE_GRADUAL_TRAN: BYTE = 3; +pub const PAN_STROKE_GRADUAL_VERT: BYTE = 4; +pub const PAN_STROKE_GRADUAL_HORZ: BYTE = 5; +pub const PAN_STROKE_RAPID_VERT: BYTE = 6; +pub const PAN_STROKE_RAPID_HORZ: BYTE = 7; +pub const PAN_STROKE_INSTANT_VERT: BYTE = 8; +pub const PAN_STRAIGHT_ARMS_HORZ: BYTE = 2; +pub const PAN_STRAIGHT_ARMS_WEDGE: BYTE = 3; +pub const PAN_STRAIGHT_ARMS_VERT: BYTE = 4; +pub const PAN_STRAIGHT_ARMS_SINGLE_SERIF: BYTE = 5; +pub const PAN_STRAIGHT_ARMS_DOUBLE_SERIF: BYTE = 6; +pub const PAN_BENT_ARMS_HORZ: BYTE = 7; +pub const PAN_BENT_ARMS_WEDGE: BYTE = 8; +pub const PAN_BENT_ARMS_VERT: BYTE = 9; +pub const PAN_BENT_ARMS_SINGLE_SERIF: BYTE = 10; +pub const PAN_BENT_ARMS_DOUBLE_SERIF: BYTE = 11; +pub const PAN_LETT_NORMAL_CONTACT: BYTE = 2; +pub const PAN_LETT_NORMAL_WEIGHTED: BYTE = 3; +pub const PAN_LETT_NORMAL_BOXED: BYTE = 4; +pub const PAN_LETT_NORMAL_FLATTENED: BYTE = 5; +pub const PAN_LETT_NORMAL_ROUNDED: BYTE = 6; +pub const PAN_LETT_NORMAL_OFF_CENTER: BYTE = 7; +pub const PAN_LETT_NORMAL_SQUARE: BYTE = 8; +pub const PAN_LETT_OBLIQUE_CONTACT: BYTE = 9; +pub const PAN_LETT_OBLIQUE_WEIGHTED: BYTE = 10; +pub const PAN_LETT_OBLIQUE_BOXED: BYTE = 11; +pub const PAN_LETT_OBLIQUE_FLATTENED: BYTE = 12; +pub const PAN_LETT_OBLIQUE_ROUNDED: BYTE = 13; +pub const PAN_LETT_OBLIQUE_OFF_CENTER: BYTE = 14; +pub const PAN_LETT_OBLIQUE_SQUARE: BYTE = 15; +pub const PAN_MIDLINE_STANDARD_TRIMMED: BYTE = 2; +pub const PAN_MIDLINE_STANDARD_POINTED: BYTE = 3; +pub const PAN_MIDLINE_STANDARD_SERIFED: BYTE = 4; +pub const PAN_MIDLINE_HIGH_TRIMMED: BYTE = 5; +pub const PAN_MIDLINE_HIGH_POINTED: BYTE = 6; +pub const PAN_MIDLINE_HIGH_SERIFED: BYTE = 7; +pub const PAN_MIDLINE_CONSTANT_TRIMMED: BYTE = 8; +pub const PAN_MIDLINE_CONSTANT_POINTED: BYTE = 9; +pub const PAN_MIDLINE_CONSTANT_SERIFED: BYTE = 10; +pub const PAN_MIDLINE_LOW_TRIMMED: BYTE = 11; +pub const PAN_MIDLINE_LOW_POINTED: BYTE = 12; +pub const PAN_MIDLINE_LOW_SERIFED: BYTE = 13; +pub const PAN_XHEIGHT_CONSTANT_SMALL: BYTE = 2; +pub const PAN_XHEIGHT_CONSTANT_STD: BYTE = 3; +pub const PAN_XHEIGHT_CONSTANT_LARGE: BYTE = 4; +pub const PAN_XHEIGHT_DUCKING_SMALL: BYTE = 5; +pub const PAN_XHEIGHT_DUCKING_STD: BYTE = 6; +pub const PAN_XHEIGHT_DUCKING_LARGE: BYTE = 7; +pub const ELF_VENDOR_SIZE: usize = 4; +STRUCT!{struct EXTLOGFONTA { + elfLogFont: LOGFONTA, + elfFullName: [BYTE; LF_FULLFACESIZE], + elfStyle: [BYTE; LF_FACESIZE], + elfVersion: DWORD, + elfStyleSize: DWORD, + elfMatch: DWORD, + elfReserved: DWORD, + elfVendorId: [BYTE; ELF_VENDOR_SIZE], + elfCulture: DWORD, + elfPanose: PANOSE, +}} +pub type PEXTLOGFONTA = *mut EXTLOGFONTA; +pub type NPEXTLOGFONTA = *mut EXTLOGFONTA; +pub type LPEXTLOGFONTA = *mut EXTLOGFONTA; +STRUCT!{struct EXTLOGFONTW { + elfLogFont: LOGFONTW, + elfFullNam: [WCHAR; LF_FULLFACESIZE], + elfStyle: [WCHAR; LF_FACESIZE], + elfVersion: DWORD, + elfStyleSize: DWORD, + elfMatch: DWORD, + elfReserved: DWORD, + elfVendorId: [BYTE; ELF_VENDOR_SIZE], + elfCulture: DWORD, + elfPanose: PANOSE, +}} +pub type PEXTLOGFONTW = *mut EXTLOGFONTW; +pub type NPEXTLOGFONTW = *mut EXTLOGFONTW; +pub type LPEXTLOGFONTW = *mut EXTLOGFONTW; +pub const ELF_VERSION: DWORD = 0; +pub const ELF_CULTURE_LATIN: DWORD = 0; +pub const RASTER_FONTTYPE: DWORD = 0x0001; +pub const DEVICE_FONTTYPE: DWORD = 0x0002; +pub const TRUETYPE_FONTTYPE: DWORD = 0x0004; +#[inline] +pub fn RGB(r: BYTE, g: BYTE, b: BYTE) -> COLORREF { + r as COLORREF | ((g as COLORREF) << 8) | ((b as COLORREF) << 16) +} +#[inline] +pub fn PALETTERGB(r: BYTE, g: BYTE, b: BYTE) -> COLORREF { + 0x02000000 | RGB(r, g, b) +} +#[inline] +pub fn PALETTEINDEX(i: WORD) -> COLORREF { + 0x01000000 | i as DWORD +} +pub const PC_RESERVED: DWORD = 0x01; +pub const PC_EXPLICIT: DWORD = 0x02; +pub const PC_NOCOLLAPSE: DWORD = 0x04; +#[inline] +pub fn GetRValue(rgb: COLORREF) -> BYTE { + LOBYTE(rgb as WORD) +} +#[inline] +pub fn GetGValue(rgb: COLORREF) -> BYTE { + LOBYTE((rgb as WORD) >> 8) +} +#[inline] +pub fn GetBValue(rgb: COLORREF) -> BYTE { + LOBYTE((rgb >> 16) as WORD) +} +pub const TRANSPARENT: DWORD = 1; +pub const OPAQUE: DWORD = 2; +pub const BKMODE_LAST: DWORD = 2; +pub const GM_COMPATIBLE: DWORD = 1; +pub const GM_ADVANCED: DWORD = 2; +pub const GM_LAST: DWORD = 2; +pub const PT_CLOSEFIGURE: DWORD = 0x01; +pub const PT_LINETO: DWORD = 0x02; +pub const PT_BEZIERTO: DWORD = 0x04; +pub const PT_MOVETO: DWORD = 0x06; +pub const MM_TEXT: DWORD = 1; +pub const MM_LOMETRIC: DWORD = 2; +pub const MM_HIMETRIC: DWORD = 3; +pub const MM_LOENGLISH: DWORD = 4; +pub const MM_HIENGLISH: DWORD = 5; +pub const MM_TWIPS: DWORD = 6; +pub const MM_ISOTROPIC: DWORD = 7; +pub const MM_ANISOTROPIC: DWORD = 8; +pub const MM_MIN: DWORD = MM_TEXT; +pub const MM_MAX: DWORD = MM_ANISOTROPIC; +pub const MM_MAX_FIXEDSCALE: DWORD = MM_TWIPS; +pub const ABSOLUTE: DWORD = 1; +pub const RELATIVE: DWORD = 2; +pub const WHITE_BRUSH: DWORD = 0; +pub const LTGRAY_BRUSH: DWORD = 1; +pub const GRAY_BRUSH: DWORD = 2; +pub const DKGRAY_BRUSH: DWORD = 3; +pub const BLACK_BRUSH: DWORD = 4; +pub const NULL_BRUSH: DWORD = 5; +pub const HOLLOW_BRUSH: DWORD = NULL_BRUSH; +pub const WHITE_PEN: DWORD = 6; +pub const BLACK_PEN: DWORD = 7; +pub const NULL_PEN: DWORD = 8; +pub const OEM_FIXED_FONT: DWORD = 10; +pub const ANSI_FIXED_FONT: DWORD = 11; +pub const ANSI_VAR_FONT: DWORD = 12; +pub const SYSTEM_FONT: DWORD = 13; +pub const DEVICE_DEFAULT_FONT: DWORD = 14; +pub const DEFAULT_PALETTE: DWORD = 15; +pub const SYSTEM_FIXED_FONT: DWORD = 16; +pub const DEFAULT_GUI_FONT: DWORD = 17; +pub const DC_BRUSH: DWORD = 18; +pub const DC_PEN: DWORD = 19; +pub const STOCK_LAST: DWORD = 19; +pub const CLR_INVALID: COLORREF = 0xFFFFFFFF; +pub const BS_SOLID: DWORD = 0; +pub const BS_NULL: DWORD = 1; +pub const BS_HOLLOW: DWORD = BS_NULL; +pub const BS_HATCHED: DWORD = 2; +pub const BS_PATTERN: DWORD = 3; +pub const BS_INDEXED: DWORD = 4; +pub const BS_DIBPATTERN: DWORD = 5; +pub const BS_DIBPATTERNPT: DWORD = 6; +pub const BS_PATTERN8X8: DWORD = 7; +pub const BS_DIBPATTERN8X8: DWORD = 8; +pub const BS_MONOPATTERN: DWORD = 9; +pub const HS_HORIZONTAL: DWORD = 0; +pub const HS_VERTICAL: DWORD = 1; +pub const HS_FDIAGONAL: DWORD = 2; +pub const HS_BDIAGONAL: DWORD = 3; +pub const HS_CROSS: DWORD = 4; +pub const HS_DIAGCROSS: DWORD = 5; +pub const HS_API_MAX: DWORD = 12; +pub const PS_SOLID: DWORD = 0; +pub const PS_DASH: DWORD = 1; +pub const PS_DOT: DWORD = 2; +pub const PS_DASHDOT: DWORD = 3; +pub const PS_DASHDOTDOT: DWORD = 4; +pub const PS_NULL: DWORD = 5; +pub const PS_INSIDEFRAME: DWORD = 6; +pub const PS_USERSTYLE: DWORD = 7; +pub const PS_ALTERNATE: DWORD = 8; +pub const PS_STYLE_MASK: DWORD = 0x0000000F; +pub const PS_ENDCAP_ROUND: DWORD = 0x00000000; +pub const PS_ENDCAP_SQUARE: DWORD = 0x00000100; +pub const PS_ENDCAP_FLAT: DWORD = 0x00000200; +pub const PS_ENDCAP_MASK: DWORD = 0x00000F00; +pub const PS_JOIN_ROUND: DWORD = 0x00000000; +pub const PS_JOIN_BEVEL: DWORD = 0x00001000; +pub const PS_JOIN_MITER: DWORD = 0x00002000; +pub const PS_JOIN_MASK: DWORD = 0x0000F000; +pub const PS_COSMETIC: DWORD = 0x00000000; +pub const PS_GEOMETRIC: DWORD = 0x00010000; +pub const PS_TYPE_MASK: DWORD = 0x000F0000; +pub const AD_COUNTERCLOCKWISE: DWORD = 1; +pub const AD_CLOCKWISE: DWORD = 2; +pub const DRIVERVERSION: c_int = 0; +pub const TECHNOLOGY: c_int = 2; +pub const HORZSIZE: c_int = 4; +pub const VERTSIZE: c_int = 6; +pub const HORZRES: c_int = 8; +pub const VERTRES: c_int = 10; +pub const BITSPIXEL: c_int = 12; +pub const PLANES: c_int = 14; +pub const NUMBRUSHES: c_int = 16; +pub const NUMPENS: c_int = 18; +pub const NUMMARKERS: c_int = 20; +pub const NUMFONTS: c_int = 22; +pub const NUMCOLORS: c_int = 24; +pub const PDEVICESIZE: c_int = 26; +pub const CURVECAPS: c_int = 28; +pub const LINECAPS: c_int = 30; +pub const POLYGONALCAPS: c_int = 32; +pub const TEXTCAPS: c_int = 34; +pub const CLIPCAPS: c_int = 36; +pub const RASTERCAPS: c_int = 38; +pub const ASPECTX: c_int = 40; +pub const ASPECTY: c_int = 42; +pub const ASPECTXY: c_int = 44; +pub const LOGPIXELSX: c_int = 88; +pub const LOGPIXELSY: c_int = 90; +pub const SIZEPALETTE: c_int = 104; +pub const NUMRESERVED: c_int = 106; +pub const COLORRES: c_int = 108; +pub const PHYSICALWIDTH: c_int = 110; +pub const PHYSICALHEIGHT: c_int = 111; +pub const PHYSICALOFFSETX: c_int = 112; +pub const PHYSICALOFFSETY: c_int = 113; +pub const SCALINGFACTORX: c_int = 114; +pub const SCALINGFACTORY: c_int = 115; +pub const VREFRESH: c_int = 116; +pub const DESKTOPVERTRES: c_int = 117; +pub const DESKTOPHORZRES: c_int = 118; +pub const BLTALIGNMENT: c_int = 119; +pub const SHADEBLENDCAPS: c_int = 120; +pub const COLORMGMTCAPS: c_int = 121; +pub const DT_PLOTTER: DWORD = 0; +pub const DT_RASDISPLAY: DWORD = 1; +pub const DT_RASPRINTER: DWORD = 2; +pub const DT_RASCAMERA: DWORD = 3; +pub const DT_CHARSTREAM: DWORD = 4; +pub const DT_METAFILE: DWORD = 5; +pub const DT_DISPFILE: DWORD = 6; +pub const CC_NONE: DWORD = 0; +pub const CC_CIRCLES: DWORD = 1; +pub const CC_PIE: DWORD = 2; +pub const CC_CHORD: DWORD = 4; +pub const CC_ELLIPSES: DWORD = 8; +pub const CC_WIDE: DWORD = 16; +pub const CC_STYLED: DWORD = 32; +pub const CC_WIDESTYLED: DWORD = 64; +pub const CC_INTERIORS: DWORD = 128; +pub const CC_ROUNDRECT: DWORD = 256; +pub const LC_NONE: DWORD = 0; +pub const LC_POLYLINE: DWORD = 2; +pub const LC_MARKER: DWORD = 4; +pub const LC_POLYMARKER: DWORD = 8; +pub const LC_WIDE: DWORD = 16; +pub const LC_STYLED: DWORD = 32; +pub const LC_WIDESTYLED: DWORD = 64; +pub const LC_INTERIORS: DWORD = 128; +pub const PC_NONE: DWORD = 0; +pub const PC_POLYGON: DWORD = 1; +pub const PC_RECTANGLE: DWORD = 2; +pub const PC_WINDPOLYGON: DWORD = 4; +pub const PC_TRAPEZOID: DWORD = 4; +pub const PC_SCANLINE: DWORD = 8; +pub const PC_WIDE: DWORD = 16; +pub const PC_STYLED: DWORD = 32; +pub const PC_WIDESTYLED: DWORD = 64; +pub const PC_INTERIORS: DWORD = 128; +pub const PC_POLYPOLYGON: DWORD = 256; +pub const PC_PATHS: DWORD = 512; +pub const CP_NONE: DWORD = 0; +pub const CP_RECTANGLE: DWORD = 1; +pub const CP_REGION: DWORD = 2; +pub const TC_OP_CHARACTER: DWORD = 0x00000001; +pub const TC_OP_STROKE: DWORD = 0x00000002; +pub const TC_CP_STROKE: DWORD = 0x00000004; +pub const TC_CR_90: DWORD = 0x00000008; +pub const TC_CR_ANY: DWORD = 0x00000010; +pub const TC_SF_X_YINDEP: DWORD = 0x00000020; +pub const TC_SA_DOUBLE: DWORD = 0x00000040; +pub const TC_SA_INTEGER: DWORD = 0x00000080; +pub const TC_SA_CONTIN: DWORD = 0x00000100; +pub const TC_EA_DOUBLE: DWORD = 0x00000200; +pub const TC_IA_ABLE: DWORD = 0x00000400; +pub const TC_UA_ABLE: DWORD = 0x00000800; +pub const TC_SO_ABLE: DWORD = 0x00001000; +pub const TC_RA_ABLE: DWORD = 0x00002000; +pub const TC_VA_ABLE: DWORD = 0x00004000; +pub const TC_RESERVED: DWORD = 0x00008000; +pub const TC_SCROLLBLT: DWORD = 0x00010000; +pub const RC_BITBLT: DWORD = 1; +pub const RC_BANDING: DWORD = 2; +pub const RC_SCALING: DWORD = 4; +pub const RC_BITMAP64: DWORD = 8; +pub const RC_GDI20_OUTPUT: DWORD = 0x0010; +pub const RC_GDI20_STATE: DWORD = 0x0020; +pub const RC_SAVEBITMAP: DWORD = 0x0040; +pub const RC_DI_BITMAP: DWORD = 0x0080; +pub const RC_PALETTE: DWORD = 0x0100; +pub const RC_DIBTODEV: DWORD = 0x0200; +pub const RC_BIGFONT: DWORD = 0x0400; +pub const RC_STRETCHBLT: DWORD = 0x0800; +pub const RC_FLOODFILL: DWORD = 0x1000; +pub const RC_STRETCHDIB: DWORD = 0x2000; +pub const RC_OP_DX_OUTPUT: DWORD = 0x4000; +pub const RC_DEVBITS: DWORD = 0x8000; +pub const SB_NONE: DWORD = 0x00000000; +pub const SB_CONST_ALPHA: DWORD = 0x00000001; +pub const SB_PIXEL_ALPHA: DWORD = 0x00000002; +pub const SB_PREMULT_ALPHA: DWORD = 0x00000004; +pub const SB_GRAD_RECT: DWORD = 0x00000010; +pub const SB_GRAD_TRI: DWORD = 0x00000020; +pub const CM_NONE: DWORD = 0x00000000; +pub const CM_DEVICE_ICM: DWORD = 0x00000001; +pub const CM_GAMMA_RAMP: DWORD = 0x00000002; +pub const CM_CMYK_COLOR: DWORD = 0x00000004; +pub const DIB_RGB_COLORS: DWORD = 0; +pub const DIB_PAL_COLORS: DWORD = 1; +pub const SYSPAL_ERROR: DWORD = 0; +pub const SYSPAL_STATIC: DWORD = 1; +pub const SYSPAL_NOSTATIC: DWORD = 2; +pub const SYSPAL_NOSTATIC256: DWORD = 3; +pub const CBM_INIT: DWORD = 0x04; +pub const FLOODFILLBORDER: DWORD = 0; +pub const FLOODFILLSURFACE: DWORD = 1; +pub const CCHDEVICENAME: usize = 32; +pub const CCHFORMNAME: usize = 32; +STRUCT!{struct DEVMODE_u1_s1 { + dmOrientation: c_short, + dmPaperSize: c_short, + dmPaperLength: c_short, + dmPaperWidth: c_short, + dmScale: c_short, + dmCopies: c_short, + dmDefaultSource: c_short, + dmPrintQuality: c_short, +}} +STRUCT!{struct DEVMODE_u1_s2 { + dmPosition: POINTL, + dmDisplayOrientation: DWORD, + dmDisplayFixedOutput: DWORD, +}} +UNION!{union DEVMODE_u1 { + [u32; 4], + s1 s1_mut: DEVMODE_u1_s1, + s2 s2_mut: DEVMODE_u1_s2, +}} +UNION!{union DEVMODE_u2 { + [u32; 1], + dmDisplayFlags dmDisplayFlags_mut: DWORD, + dmNup dmNup_mut: DWORD, +}} +STRUCT!{struct DEVMODEA { + dmDeviceName: [CHAR; CCHDEVICENAME], + dmSpecVersion: WORD, + dmDriverVersion: WORD, + dmSize: WORD, + dmDriverExtra: WORD, + dmFields: DWORD, + u1: DEVMODE_u1, + dmColor: c_short, + dmDuplex: c_short, + dmYResolution: c_short, + dmTTOption: c_short, + dmCollate: c_short, + dmFormName: [CHAR; CCHFORMNAME], + dmLogPixels: WORD, + dmBitsPerPel: DWORD, + dmPelsWidth: DWORD, + dmPelsHeight: DWORD, + u2: DEVMODE_u2, + dmDisplayFrequency: DWORD, + dmICMMethod: DWORD, + dmICMIntent: DWORD, + dmMediaType: DWORD, + dmDitherType: DWORD, + dmReserved1: DWORD, + dmReserved2: DWORD, + dmPanningWidth: DWORD, + dmPanningHeight: DWORD, +}} +pub type PDEVMODEA = *mut DEVMODEA; +pub type NPDEVMODEA = *mut DEVMODEA; +pub type LPDEVMODEA = *mut DEVMODEA; +STRUCT!{struct DEVMODEW { + dmDeviceName: [WCHAR; CCHDEVICENAME], + dmSpecVersion: WORD, + dmDriverVersion: WORD, + dmSize: WORD, + dmDriverExtra: WORD, + dmFields: DWORD, + u1: DEVMODE_u1, + dmColor: c_short, + dmDuplex: c_short, + dmYResolution: c_short, + dmTTOption: c_short, + dmCollate: c_short, + dmFormName: [WCHAR; CCHFORMNAME], + dmLogPixels: WORD, + dmBitsPerPel: DWORD, + dmPelsWidth: DWORD, + dmPelsHeight: DWORD, + u2: DEVMODE_u2, + dmDisplayFrequency: DWORD, + dmICMMethod: DWORD, + dmICMIntent: DWORD, + dmMediaType: DWORD, + dmDitherType: DWORD, + dmReserved1: DWORD, + dmReserved2: DWORD, + dmPanningWidth: DWORD, + dmPanningHeight: DWORD, +}} +pub type PDEVMODEW = *mut DEVMODEW; +pub type NPDEVMODEW = *mut DEVMODEW; +pub type LPDEVMODEW = *mut DEVMODEW; +pub const DM_SPECVERSION: DWORD = 0x0401; +pub const DM_ORIENTATION: DWORD = 0x00000001; +pub const DM_PAPERSIZE: DWORD = 0x00000002; +pub const DM_PAPERLENGTH: DWORD = 0x00000004; +pub const DM_PAPERWIDTH: DWORD = 0x00000008; +pub const DM_SCALE: DWORD = 0x00000010; +pub const DM_POSITION: DWORD = 0x00000020; +pub const DM_NUP: DWORD = 0x00000040; +pub const DM_DISPLAYORIENTATION: DWORD = 0x00000080; +pub const DM_COPIES: DWORD = 0x00000100; +pub const DM_DEFAULTSOURCE: DWORD = 0x00000200; +pub const DM_PRINTQUALITY: DWORD = 0x00000400; +pub const DM_COLOR: DWORD = 0x00000800; +pub const DM_DUPLEX: DWORD = 0x00001000; +pub const DM_YRESOLUTION: DWORD = 0x00002000; +pub const DM_TTOPTION: DWORD = 0x00004000; +pub const DM_COLLATE: DWORD = 0x00008000; +pub const DM_FORMNAME: DWORD = 0x00010000; +pub const DM_LOGPIXELS: DWORD = 0x00020000; +pub const DM_BITSPERPEL: DWORD = 0x00040000; +pub const DM_PELSWIDTH: DWORD = 0x00080000; +pub const DM_PELSHEIGHT: DWORD = 0x00100000; +pub const DM_DISPLAYFLAGS: DWORD = 0x00200000; +pub const DM_DISPLAYFREQUENCY: DWORD = 0x00400000; +pub const DM_ICMMETHOD: DWORD = 0x00800000; +pub const DM_ICMINTENT: DWORD = 0x01000000; +pub const DM_MEDIATYPE: DWORD = 0x02000000; +pub const DM_DITHERTYPE: DWORD = 0x04000000; +pub const DM_PANNINGWIDTH: DWORD = 0x08000000; +pub const DM_PANNINGHEIGHT: DWORD = 0x10000000; +pub const DM_DISPLAYFIXEDOUTPUT: DWORD = 0x20000000; +pub const DMORIENT_PORTRAIT: DWORD = 1; +pub const DMORIENT_LANDSCAPE: DWORD = 2; +pub const DMPAPER_FIRST: DWORD = DMPAPER_LETTER; +pub const DMPAPER_LETTER: DWORD = 1; +pub const DMPAPER_LETTERSMALL: DWORD = 2; +pub const DMPAPER_TABLOID: DWORD = 3; +pub const DMPAPER_LEDGER: DWORD = 4; +pub const DMPAPER_LEGAL: DWORD = 5; +pub const DMPAPER_STATEMENT: DWORD = 6; +pub const DMPAPER_EXECUTIVE: DWORD = 7; +pub const DMPAPER_A3: DWORD = 8; +pub const DMPAPER_A4: DWORD = 9; +pub const DMPAPER_A4SMALL: DWORD = 10; +pub const DMPAPER_A5: DWORD = 11; +pub const DMPAPER_B4: DWORD = 12; +pub const DMPAPER_B5: DWORD = 13; +pub const DMPAPER_FOLIO: DWORD = 14; +pub const DMPAPER_QUARTO: DWORD = 15; +pub const DMPAPER_10X14: DWORD = 16; +pub const DMPAPER_11X17: DWORD = 17; +pub const DMPAPER_NOTE: DWORD = 18; +pub const DMPAPER_ENV_9: DWORD = 19; +pub const DMPAPER_ENV_10: DWORD = 20; +pub const DMPAPER_ENV_11: DWORD = 21; +pub const DMPAPER_ENV_12: DWORD = 22; +pub const DMPAPER_ENV_14: DWORD = 23; +pub const DMPAPER_CSHEET: DWORD = 24; +pub const DMPAPER_DSHEET: DWORD = 25; +pub const DMPAPER_ESHEET: DWORD = 26; +pub const DMPAPER_ENV_DL: DWORD = 27; +pub const DMPAPER_ENV_C5: DWORD = 28; +pub const DMPAPER_ENV_C3: DWORD = 29; +pub const DMPAPER_ENV_C4: DWORD = 30; +pub const DMPAPER_ENV_C6: DWORD = 31; +pub const DMPAPER_ENV_C65: DWORD = 32; +pub const DMPAPER_ENV_B4: DWORD = 33; +pub const DMPAPER_ENV_B5: DWORD = 34; +pub const DMPAPER_ENV_B6: DWORD = 35; +pub const DMPAPER_ENV_ITALY: DWORD = 36; +pub const DMPAPER_ENV_MONARCH: DWORD = 37; +pub const DMPAPER_ENV_PERSONAL: DWORD = 38; +pub const DMPAPER_FANFOLD_US: DWORD = 39; +pub const DMPAPER_FANFOLD_STD_GERMAN: DWORD = 40; +pub const DMPAPER_FANFOLD_LGL_GERMAN: DWORD = 41; +pub const DMPAPER_ISO_B4: DWORD = 42; +pub const DMPAPER_JAPANESE_POSTCARD: DWORD = 43; +pub const DMPAPER_9X11: DWORD = 44; +pub const DMPAPER_10X11: DWORD = 45; +pub const DMPAPER_15X11: DWORD = 46; +pub const DMPAPER_ENV_INVITE: DWORD = 47; +pub const DMPAPER_RESERVED_48: DWORD = 48; +pub const DMPAPER_RESERVED_49: DWORD = 49; +pub const DMPAPER_LETTER_EXTRA: DWORD = 50; +pub const DMPAPER_LEGAL_EXTRA: DWORD = 51; +pub const DMPAPER_TABLOID_EXTRA: DWORD = 52; +pub const DMPAPER_A4_EXTRA: DWORD = 53; +pub const DMPAPER_LETTER_TRANSVERSE: DWORD = 54; +pub const DMPAPER_A4_TRANSVERSE: DWORD = 55; +pub const DMPAPER_LETTER_EXTRA_TRANSVERSE: DWORD = 56; +pub const DMPAPER_A_PLUS: DWORD = 57; +pub const DMPAPER_B_PLUS: DWORD = 58; +pub const DMPAPER_LETTER_PLUS: DWORD = 59; +pub const DMPAPER_A4_PLUS: DWORD = 60; +pub const DMPAPER_A5_TRANSVERSE: DWORD = 61; +pub const DMPAPER_B5_TRANSVERSE: DWORD = 62; +pub const DMPAPER_A3_EXTRA: DWORD = 63; +pub const DMPAPER_A5_EXTRA: DWORD = 64; +pub const DMPAPER_B5_EXTRA: DWORD = 65; +pub const DMPAPER_A2: DWORD = 66; +pub const DMPAPER_A3_TRANSVERSE: DWORD = 67; +pub const DMPAPER_A3_EXTRA_TRANSVERSE: DWORD = 68; +pub const DMPAPER_DBL_JAPANESE_POSTCARD: DWORD = 69; +pub const DMPAPER_A6: DWORD = 70; +pub const DMPAPER_JENV_KAKU2: DWORD = 71; +pub const DMPAPER_JENV_KAKU3: DWORD = 72; +pub const DMPAPER_JENV_CHOU3: DWORD = 73; +pub const DMPAPER_JENV_CHOU4: DWORD = 74; +pub const DMPAPER_LETTER_ROTATED: DWORD = 75; +pub const DMPAPER_A3_ROTATED: DWORD = 76; +pub const DMPAPER_A4_ROTATED: DWORD = 77; +pub const DMPAPER_A5_ROTATED: DWORD = 78; +pub const DMPAPER_B4_JIS_ROTATED: DWORD = 79; +pub const DMPAPER_B5_JIS_ROTATED: DWORD = 80; +pub const DMPAPER_JAPANESE_POSTCARD_ROTATED: DWORD = 81; +pub const DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED: DWORD = 82; +pub const DMPAPER_A6_ROTATED: DWORD = 83; +pub const DMPAPER_JENV_KAKU2_ROTATED: DWORD = 84; +pub const DMPAPER_JENV_KAKU3_ROTATED: DWORD = 85; +pub const DMPAPER_JENV_CHOU3_ROTATED: DWORD = 86; +pub const DMPAPER_JENV_CHOU4_ROTATED: DWORD = 87; +pub const DMPAPER_B6_JIS: DWORD = 88; +pub const DMPAPER_B6_JIS_ROTATED: DWORD = 89; +pub const DMPAPER_12X11: DWORD = 90; +pub const DMPAPER_JENV_YOU4: DWORD = 91; +pub const DMPAPER_JENV_YOU4_ROTATED: DWORD = 92; +pub const DMPAPER_P16K: DWORD = 93; +pub const DMPAPER_P32K: DWORD = 94; +pub const DMPAPER_P32KBIG: DWORD = 95; +pub const DMPAPER_PENV_1: DWORD = 96; +pub const DMPAPER_PENV_2: DWORD = 97; +pub const DMPAPER_PENV_3: DWORD = 98; +pub const DMPAPER_PENV_4: DWORD = 99; +pub const DMPAPER_PENV_5: DWORD = 100; +pub const DMPAPER_PENV_6: DWORD = 101; +pub const DMPAPER_PENV_7: DWORD = 102; +pub const DMPAPER_PENV_8: DWORD = 103; +pub const DMPAPER_PENV_9: DWORD = 104; +pub const DMPAPER_PENV_10: DWORD = 105; +pub const DMPAPER_P16K_ROTATED: DWORD = 106; +pub const DMPAPER_P32K_ROTATED: DWORD = 107; +pub const DMPAPER_P32KBIG_ROTATED: DWORD = 108; +pub const DMPAPER_PENV_1_ROTATED: DWORD = 109; +pub const DMPAPER_PENV_2_ROTATED: DWORD = 110; +pub const DMPAPER_PENV_3_ROTATED: DWORD = 111; +pub const DMPAPER_PENV_4_ROTATED: DWORD = 112; +pub const DMPAPER_PENV_5_ROTATED: DWORD = 113; +pub const DMPAPER_PENV_6_ROTATED: DWORD = 114; +pub const DMPAPER_PENV_7_ROTATED: DWORD = 115; +pub const DMPAPER_PENV_8_ROTATED: DWORD = 116; +pub const DMPAPER_PENV_9_ROTATED: DWORD = 117; +pub const DMPAPER_PENV_10_ROTATED: DWORD = 118; +pub const DMPAPER_LAST: DWORD = DMPAPER_PENV_10_ROTATED; +pub const DMPAPER_USER: DWORD = 256; +pub const DMBIN_FIRST: DWORD = DMBIN_UPPER; +pub const DMBIN_UPPER: DWORD = 1; +pub const DMBIN_ONLYONE: DWORD = 1; +pub const DMBIN_LOWER: DWORD = 2; +pub const DMBIN_MIDDLE: DWORD = 3; +pub const DMBIN_MANUAL: DWORD = 4; +pub const DMBIN_ENVELOPE: DWORD = 5; +pub const DMBIN_ENVMANUAL: DWORD = 6; +pub const DMBIN_AUTO: DWORD = 7; +pub const DMBIN_TRACTOR: DWORD = 8; +pub const DMBIN_SMALLFMT: DWORD = 9; +pub const DMBIN_LARGEFMT: DWORD = 10; +pub const DMBIN_LARGECAPACITY: DWORD = 11; +pub const DMBIN_CASSETTE: DWORD = 14; +pub const DMBIN_FORMSOURCE: DWORD = 15; +pub const DMBIN_LAST: DWORD = DMBIN_FORMSOURCE; +pub const DMBIN_USER: DWORD = 256; +pub const DMRES_DRAFT: c_int = -1; +pub const DMRES_LOW: c_int = -2; +pub const DMRES_MEDIUM: c_int = -3; +pub const DMRES_HIGH: c_int = -4; +pub const DMCOLOR_MONOCHROME: DWORD = 1; +pub const DMCOLOR_COLOR: DWORD = 2; +pub const DMDUP_SIMPLEX: DWORD = 1; +pub const DMDUP_VERTICAL: DWORD = 2; +pub const DMDUP_HORIZONTAL: DWORD = 3; +pub const DMTT_BITMAP: DWORD = 1; +pub const DMTT_DOWNLOAD: DWORD = 2; +pub const DMTT_SUBDEV: DWORD = 3; +pub const DMTT_DOWNLOAD_OUTLINE: DWORD = 4; +pub const DMCOLLATE_FALSE: DWORD = 0; +pub const DMCOLLATE_TRUE: DWORD = 1; +pub const DMDO_DEFAULT: DWORD = 0; +pub const DMDO_90: DWORD = 1; +pub const DMDO_180: DWORD = 2; +pub const DMDO_270: DWORD = 3; +pub const DMDFO_DEFAULT: DWORD = 0; +pub const DMDFO_STRETCH: DWORD = 1; +pub const DMDFO_CENTER: DWORD = 2; +pub const DM_INTERLACED: DWORD = 0x00000002; +pub const DMDISPLAYFLAGS_TEXTMODE: DWORD = 0x00000004; +pub const DMNUP_SYSTEM: DWORD = 1; +pub const DMNUP_ONEUP: DWORD = 2; +pub const DMICMMETHOD_NONE: DWORD = 1; +pub const DMICMMETHOD_SYSTEM: DWORD = 2; +pub const DMICMMETHOD_DRIVER: DWORD = 3; +pub const DMICMMETHOD_DEVICE: DWORD = 4; +pub const DMICMMETHOD_USER: DWORD = 256; +pub const DMICM_SATURATE: DWORD = 1; +pub const DMICM_CONTRAST: DWORD = 2; +pub const DMICM_COLORIMETRIC: DWORD = 3; +pub const DMICM_ABS_COLORIMETRIC: DWORD = 4; +pub const DMICM_USER: DWORD = 256; +pub const DMMEDIA_STANDARD: DWORD = 1; +pub const DMMEDIA_TRANSPARENCY: DWORD = 2; +pub const DMMEDIA_GLOSSY: DWORD = 3; +pub const DMMEDIA_USER: DWORD = 256; +pub const DMDITHER_NONE: DWORD = 1; +pub const DMDITHER_COARSE: DWORD = 2; +pub const DMDITHER_FINE: DWORD = 3; +pub const DMDITHER_LINEART: DWORD = 4; +pub const DMDITHER_ERRORDIFFUSION: DWORD = 5; +pub const DMDITHER_RESERVED6: DWORD = 6; +pub const DMDITHER_RESERVED7: DWORD = 7; +pub const DMDITHER_RESERVED8: DWORD = 8; +pub const DMDITHER_RESERVED9: DWORD = 9; +pub const DMDITHER_GRAYSCALE: DWORD = 10; +pub const DMDITHER_USER: DWORD = 256; +STRUCT!{struct DISPLAY_DEVICEA { + cb: DWORD, + DeviceName: [CHAR; 32], + DeviceString: [CHAR; 128], + StateFlags: DWORD, + DeviceID: [CHAR; 128], + DeviceKey: [CHAR; 128], +}} +pub type PDISPLAY_DEVICEA = *mut DISPLAY_DEVICEA; +pub type LPDISPLAY_DEVICEA = *mut DISPLAY_DEVICEA; +STRUCT!{struct DISPLAY_DEVICEW { + cb: DWORD, + DeviceName: [WCHAR; 32], + DeviceString: [WCHAR; 128], + StateFlags: DWORD, + DeviceID: [WCHAR; 128], + DeviceKey: [WCHAR; 128], +}} +pub type PDISPLAY_DEVICEW = *mut DISPLAY_DEVICEW; +pub type LPDISPLAY_DEVICEW = *mut DISPLAY_DEVICEW; +pub const DISPLAY_DEVICE_ATTACHED_TO_DESKTOP: DWORD = 0x00000001; +pub const DISPLAY_DEVICE_MULTI_DRIVER: DWORD = 0x00000002; +pub const DISPLAY_DEVICE_PRIMARY_DEVICE: DWORD = 0x00000004; +pub const DISPLAY_DEVICE_MIRRORING_DRIVER: DWORD = 0x00000008; +pub const DISPLAY_DEVICE_VGA_COMPATIBLE: DWORD = 0x00000010; +pub const DISPLAY_DEVICE_REMOVABLE: DWORD = 0x00000020; +pub const DISPLAY_DEVICE_ACC_DRIVER: DWORD = 0x00000040; +pub const DISPLAY_DEVICE_MODESPRUNED: DWORD = 0x08000000; +pub const DISPLAY_DEVICE_RDPUDD: DWORD = 0x01000000; +pub const DISPLAY_DEVICE_REMOTE: DWORD = 0x04000000; +pub const DISPLAY_DEVICE_DISCONNECT: DWORD = 0x02000000; +pub const DISPLAY_DEVICE_TS_COMPATIBLE: DWORD = 0x00200000; +pub const DISPLAY_DEVICE_UNSAFE_MODES_ON: DWORD = 0x00080000; +pub const DISPLAY_DEVICE_ACTIVE: DWORD = 0x00000001; +pub const DISPLAY_DEVICE_ATTACHED: DWORD = 0x00000002; +pub const DISPLAYCONFIG_MAXPATH: usize = 1024; +STRUCT!{struct DISPLAYCONFIG_RATIONAL { + Numerator: UINT32, + Denominator: UINT32, +}} +ENUM!{enum DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY { + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_OTHER = -1i32 as u32, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HD15 = 0, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_SVIDEO = 1, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_COMPOSITE_VIDEO = 2, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_COMPONENT_VIDEO = 3, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DVI = 4, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HDMI = 5, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_LVDS = 6, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_D_JPN = 8, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_SDI = 9, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DISPLAYPORT_EXTERNAL = 10, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DISPLAYPORT_EMBEDDED = 11, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_UDI_EXTERNAL = 12, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_UDI_EMBEDDED = 13, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_SDTVDONGLE = 14, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_MIRACAST = 15, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INDIRECT_WIRED = 16, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL = 0x80000000, + DISPLAYCONFIG_OUTPUT_TECHNOLOGY_FORCE_UINT32 = 0xFFFFFFFF, +}} +ENUM!{enum DISPLAYCONFIG_SCANLINE_ORDERING { + DISPLAYCONFIG_SCANLINE_ORDERING_UNSPECIFIED = 0, + DISPLAYCONFIG_SCANLINE_ORDERING_PROGRESSIVE = 1, + DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED = 2, + DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED_UPPERFIELDFIRST = + DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED, + DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED_LOWERFIELDFIRST = 3, + DISPLAYCONFIG_SCANLINE_ORDERING_FORCE_UINT32 = 0xFFFFFFFF, +}} +STRUCT!{struct DISPLAYCONFIG_2DREGION { + cx: UINT32, + cy: UINT32, +}} +STRUCT!{struct DISPLAYCONFIG_VIDEO_SIGNAL_INFO_AdditionalSignalInfo { + bitfield: UINT32, +}} +BITFIELD!{DISPLAYCONFIG_VIDEO_SIGNAL_INFO_AdditionalSignalInfo bitfield: UINT32 [ + videoStandard set_videoStandard[0..16], + vSyncFreqDivider set_vSyncFreqDivider[16..22], +]} +UNION!{union DISPLAYCONFIG_VIDEO_SIGNAL_INFO_u { + [u32; 1], + AdditionalSignalInfo AdditionalSignalInfo_mut: + DISPLAYCONFIG_VIDEO_SIGNAL_INFO_AdditionalSignalInfo, + videoStandard videoStandard_mut: UINT32, +}} +STRUCT!{struct DISPLAYCONFIG_VIDEO_SIGNAL_INFO { + pixelRate: UINT64, + hSyncFreq: DISPLAYCONFIG_RATIONAL, + vSyncFreq: DISPLAYCONFIG_RATIONAL, + activeSize: DISPLAYCONFIG_2DREGION, + totalSize: DISPLAYCONFIG_2DREGION, + u: DISPLAYCONFIG_VIDEO_SIGNAL_INFO_u, + scanLineOrdering: DISPLAYCONFIG_SCANLINE_ORDERING, +}} +ENUM!{enum DISPLAYCONFIG_SCALING { + DISPLAYCONFIG_SCALING_IDENTITY = 1, + DISPLAYCONFIG_SCALING_CENTERED = 2, + DISPLAYCONFIG_SCALING_STRETCHED = 3, + DISPLAYCONFIG_SCALING_ASPECTRATIOCENTEREDMAX = 4, + DISPLAYCONFIG_SCALING_CUSTOM = 5, + DISPLAYCONFIG_SCALING_PREFERRED = 128, + DISPLAYCONFIG_SCALING_FORCE_UINT32 = 0xFFFFFFFF, +}} +ENUM!{enum DISPLAYCONFIG_ROTATION { + DISPLAYCONFIG_ROTATION_IDENTITY = 1, + DISPLAYCONFIG_ROTATION_ROTATE90 = 2, + DISPLAYCONFIG_ROTATION_ROTATE180 = 3, + DISPLAYCONFIG_ROTATION_ROTATE270 = 4, + DISPLAYCONFIG_ROTATION_FORCE_UINT32 = 0xFFFFFFFF, +}} +ENUM!{enum DISPLAYCONFIG_MODE_INFO_TYPE { + DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE = 1, + DISPLAYCONFIG_MODE_INFO_TYPE_TARGET = 2, + DISPLAYCONFIG_MODE_INFO_TYPE_DESKTOP_IMAGE = 3, + DISPLAYCONFIG_MODE_INFO_TYPE_FORCE_UINT32 = 0xFFFFFFFF, +}} +ENUM!{enum DISPLAYCONFIG_PIXELFORMAT { + DISPLAYCONFIG_PIXELFORMAT_8BPP = 1, + DISPLAYCONFIG_PIXELFORMAT_16BPP = 2, + DISPLAYCONFIG_PIXELFORMAT_24BPP = 3, + DISPLAYCONFIG_PIXELFORMAT_32BPP = 4, + DISPLAYCONFIG_PIXELFORMAT_NONGDI = 5, + DISPLAYCONFIG_PIXELFORMAT_FORCE_UINT32 = 0xffffffff, +}} +STRUCT!{struct DISPLAYCONFIG_SOURCE_MODE { + width: UINT32, + height: UINT32, + pixelFormat: DISPLAYCONFIG_PIXELFORMAT, + position: POINTL, +}} +STRUCT!{struct DISPLAYCONFIG_TARGET_MODE { + targetVideoSignalInfo: DISPLAYCONFIG_VIDEO_SIGNAL_INFO, +}} +STRUCT!{struct DISPLAYCONFIG_DESKTOP_IMAGE_INFO { + PathSourceSize: POINTL, + DesktopImageRegion: RECTL, + DesktopImageClip: RECTL, +}} +UNION!{union DISPLAYCONFIG_MODE_INFO_u { + [u64; 6], + targetMode targetMode_mut: DISPLAYCONFIG_TARGET_MODE, + sourceMode sourceMode_mut: DISPLAYCONFIG_SOURCE_MODE, + desktopImageInfo desktopImageInfo_mut: DISPLAYCONFIG_DESKTOP_IMAGE_INFO, +}} +STRUCT!{struct DISPLAYCONFIG_MODE_INFO { + infoType: DISPLAYCONFIG_MODE_INFO_TYPE, + id: UINT32, + adapterId: LUID, + u: DISPLAYCONFIG_MODE_INFO_u, +}} +pub const DISPLAYCONFIG_PATH_MODE_IDX_INVALID: DWORD = 0xffffffff; +pub const DISPLAYCONFIG_PATH_TARGET_MODE_IDX_INVALID: DWORD = 0xffff; +pub const DISPLAYCONFIG_PATH_DESKTOP_IMAGE_IDX_INVALID: DWORD = 0xffff; +pub const DISPLAYCONFIG_PATH_SOURCE_MODE_IDX_INVALID: DWORD = 0xffff; +pub const DISPLAYCONFIG_PATH_CLONE_GROUP_INVALID: DWORD = 0xffff; +STRUCT!{struct DISPLAYCONFIG_PATH_SOURCE_INFO { + adapterId: LUID, + id: UINT32, + modeInfoIdx: UINT32, + statusFlags: UINT32, +}} +BITFIELD!{DISPLAYCONFIG_PATH_SOURCE_INFO modeInfoIdx: UINT32 [ + cloneGroupId set_cloneGroupId[0..16], + sourceModeInfoIdx set_sourceModeInfoIdx[16..32], +]} +pub const DISPLAYCONFIG_SOURCE_IN_USE: DWORD = 0x00000001; +STRUCT!{struct DISPLAYCONFIG_PATH_TARGET_INFO { + adapterId: LUID, + id: UINT32, + modeInfoIdx: UINT32, + outputTechnology: DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY, + rotation: DISPLAYCONFIG_ROTATION, + scaling: DISPLAYCONFIG_SCALING, + refreshRate: DISPLAYCONFIG_RATIONAL, + scanLineOrdering: DISPLAYCONFIG_SCANLINE_ORDERING, + targetAvailable: BOOL, + statusFlags: UINT32, +}} +BITFIELD!{DISPLAYCONFIG_PATH_TARGET_INFO modeInfoIdx: UINT32 [ + desktopModeInfoIdx set_desktopModeInfoIdx[0..16], + targetModeInfoIdx set_targetModeInfoIdx[16..32], +]} +pub const DISPLAYCONFIG_TARGET_IN_USE: DWORD = 0x00000001; +pub const DISPLAYCONFIG_TARGET_FORCIBLE: DWORD = 0x00000002; +pub const DISPLAYCONFIG_TARGET_FORCED_AVAILABILITY_BOOT: DWORD = 0x00000004; +pub const DISPLAYCONFIG_TARGET_FORCED_AVAILABILITY_PATH: DWORD = 0x00000008; +pub const DISPLAYCONFIG_TARGET_FORCED_AVAILABILITY_SYSTEM: DWORD = 0x00000010; +pub const DISPLAYCONFIG_TARGET_IS_HMD: DWORD = 0x00000020; +STRUCT!{struct DISPLAYCONFIG_PATH_INFO { + sourceInfo: DISPLAYCONFIG_PATH_SOURCE_INFO, + targetInfo: DISPLAYCONFIG_PATH_TARGET_INFO, + flags: UINT32, +}} +pub const DISPLAYCONFIG_PATH_ACTIVE: DWORD = 0x00000001; +pub const DISPLAYCONFIG_PATH_PREFERRED_UNSCALED: DWORD = 0x00000004; +pub const DISPLAYCONFIG_PATH_SUPPORT_VIRTUAL_MODE: DWORD = 0x00000008; +pub const DISPLAYCONFIG_PATH_VALID_FLAGS: DWORD = 0x0000000D; +ENUM!{enum DISPLAYCONFIG_TOPOLOGY_ID { + DISPLAYCONFIG_TOPOLOGY_INTERNAL = 0x00000001, + DISPLAYCONFIG_TOPOLOGY_CLONE = 0x00000002, + DISPLAYCONFIG_TOPOLOGY_EXTEND = 0x00000004, + DISPLAYCONFIG_TOPOLOGY_EXTERNAL = 0x00000008, + DISPLAYCONFIG_TOPOLOGY_FORCE_UINT32 = 0xFFFFFFFF, +}} +ENUM!{enum DISPLAYCONFIG_DEVICE_INFO_TYPE { + DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME = 1, + DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME = 2, + DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE = 3, + DISPLAYCONFIG_DEVICE_INFO_GET_ADAPTER_NAME = 4, + DISPLAYCONFIG_DEVICE_INFO_SET_TARGET_PERSISTENCE = 5, + DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_BASE_TYPE = 6, + DISPLAYCONFIG_DEVICE_INFO_GET_SUPPORT_VIRTUAL_RESOLUTION = 7, + DISPLAYCONFIG_DEVICE_INFO_SET_SUPPORT_VIRTUAL_RESOLUTION = 8, + DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO = 9, + DISPLAYCONFIG_DEVICE_INFO_SET_ADVANCED_COLOR_STATE = 10, + DISPLAYCONFIG_DEVICE_INFO_FORCE_UINT32 = 0xFFFFFFFF, +}} +STRUCT!{struct DISPLAYCONFIG_DEVICE_INFO_HEADER { + _type: DISPLAYCONFIG_DEVICE_INFO_TYPE, + size: UINT32, + adapterId: LUID, + id: UINT32, +}} +STRUCT!{struct DISPLAYCONFIG_SOURCE_DEVICE_NAME { + header: DISPLAYCONFIG_DEVICE_INFO_HEADER, + viewGdiDeviceName: [WCHAR; CCHDEVICENAME], +}} +STRUCT!{struct DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS { + value: UINT32, +}} +BITFIELD!{DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS value: UINT32 [ + friendlyNameFromEdid set_friendlyNameFromEdid[0..1], + friendlyNameForced set_friendlyNameForced[1..2], + edidIdsValid set_edidIdsValid[2..3], +]} +STRUCT!{struct DISPLAYCONFIG_TARGET_DEVICE_NAME { + header: DISPLAYCONFIG_DEVICE_INFO_HEADER, + flags: DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS, + outputTechnology: DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY, + edidManufactureId: UINT16, + edidProductCodeId: UINT16, + connectorInstance: UINT32, + monitorFriendlyDeviceName: [WCHAR; 64], + monitorDevicePath: [WCHAR; 128], +}} +STRUCT!{struct DISPLAYCONFIG_TARGET_PREFERRED_MODE { + header: DISPLAYCONFIG_DEVICE_INFO_HEADER, + width: UINT32, + height: UINT32, + targetMode: DISPLAYCONFIG_TARGET_MODE, +}} +STRUCT!{struct DISPLAYCONFIG_ADAPTER_NAME { + header: DISPLAYCONFIG_DEVICE_INFO_HEADER, + adapterDevicePath: [WCHAR; 128], +}} +STRUCT!{struct DISPLAYCONFIG_TARGET_BASE_TYPE { + header: DISPLAYCONFIG_DEVICE_INFO_HEADER, + baseOutputTechnology: DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY, +}} +STRUCT!{struct DISPLAYCONFIG_SET_TARGET_PERSISTENCE { + header: DISPLAYCONFIG_DEVICE_INFO_HEADER, + value: UINT32, +}} +BITFIELD!{DISPLAYCONFIG_SET_TARGET_PERSISTENCE value: UINT32 [ + bootPersistenceOn set_bootPersistenceOn[0..1], +]} +STRUCT!{struct DISPLAYCONFIG_SUPPORT_VIRTUAL_RESOLUTION { + header: DISPLAYCONFIG_DEVICE_INFO_HEADER, + value: UINT32, +}} +BITFIELD!{DISPLAYCONFIG_SUPPORT_VIRTUAL_RESOLUTION value: UINT32 [ + disableMonitorVirtualResolution set_disableMonitorVirtualResolution[0..1], +]} +ENUM!{enum DISPLAYCONFIG_COLOR_ENCODING { + DISPLAYCONFIG_COLOR_ENCODING_RGB = 0, + DISPLAYCONFIG_COLOR_ENCODING_YCBCR444 = 1, + DISPLAYCONFIG_COLOR_ENCODING_YCBCR422 = 2, + DISPLAYCONFIG_COLOR_ENCODING_YCBCR420 = 3, + DISPLAYCONFIG_COLOR_ENCODING_INTENSITY = 4, + DISPLAYCONFIG_COLOR_ENCODING_FORCE_UINT32 = 0xFFFFFFFF, +}} +STRUCT!{struct DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO { + header: DISPLAYCONFIG_DEVICE_INFO_HEADER, + value: UINT32, + colorEncoding: DISPLAYCONFIG_COLOR_ENCODING, + bitsPerColorChannel: UINT32, +}} +BITFIELD!{DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO value: UINT32 [ + advancedColorSupported set_advancedColorSupported[0..1], + advancedColorEnabled set_advancedColorEnabled[1..2], + reserved set_reserved[2..32], +]} +STRUCT!{struct DISPLAYCONFIG_SET_ADVANCED_COLOR_STATE { + header: DISPLAYCONFIG_DEVICE_INFO_HEADER, + value: UINT32, +}} +BITFIELD!{DISPLAYCONFIG_SET_ADVANCED_COLOR_STATE value: UINT32 [ + enableAdvancedColor set_enableAdvancedColor[0..1], + reserved set_reserved[1..32], +]} +pub const QDC_ALL_PATHS: DWORD = 0x00000001; +pub const QDC_ONLY_ACTIVE_PATHS: DWORD = 0x00000002; +pub const QDC_DATABASE_CURRENT: DWORD = 0x00000004; +pub const QDC_VIRTUAL_MODE_AWARE: DWORD = 0x00000010; +pub const QDC_INCLUDE_HMD: DWORD = 0x00000020; +pub const SDC_TOPOLOGY_INTERNAL: DWORD = 0x00000001; +pub const SDC_TOPOLOGY_CLONE: DWORD = 0x00000002; +pub const SDC_TOPOLOGY_EXTEND: DWORD = 0x00000004; +pub const SDC_TOPOLOGY_EXTERNAL: DWORD = 0x00000008; +pub const SDC_TOPOLOGY_SUPPLIED: DWORD = 0x00000010; +pub const SDC_USE_DATABASE_CURRENT: DWORD = SDC_TOPOLOGY_INTERNAL | SDC_TOPOLOGY_CLONE + | SDC_TOPOLOGY_EXTEND | SDC_TOPOLOGY_EXTERNAL; +pub const SDC_USE_SUPPLIED_DISPLAY_CONFIG: DWORD = 0x00000020; +pub const SDC_VALIDATE: DWORD = 0x00000040; +pub const SDC_APPLY: DWORD = 0x00000080; +pub const SDC_NO_OPTIMIZATION: DWORD = 0x00000100; +pub const SDC_SAVE_TO_DATABASE: DWORD = 0x00000200; +pub const SDC_ALLOW_CHANGES: DWORD = 0x00000400; +pub const SDC_PATH_PERSIST_IF_REQUIRED: DWORD = 0x00000800; +pub const SDC_FORCE_MODE_ENUMERATION: DWORD = 0x00001000; +pub const SDC_ALLOW_PATH_ORDER_CHANGES: DWORD = 0x00002000; +pub const SDC_VIRTUAL_MODE_AWARE: DWORD = 0x00008000; +pub const RDH_RECTANGLES: DWORD = 1; +STRUCT!{struct RGNDATAHEADER { + dwSize: DWORD, + iType: DWORD, + nCount: DWORD, + nRgnSize: DWORD, + rcBound: RECT, +}} +pub type PRGNDATAHEADER = *mut RGNDATAHEADER; +STRUCT!{struct RGNDATA { + rdh: RGNDATAHEADER, + Buffer: [c_char; 1], +}} +pub type PRGNDATA = *mut RGNDATA; +pub type NPRGNDATA = *mut RGNDATA; +pub type LPRGNDATA = *mut RGNDATA; +pub const SYSRGN: INT = 4; +STRUCT!{struct ABC { + abcA: c_int, + abcB: UINT, + abcC: c_int, +}} +pub type PABC = *mut ABC; +pub type NPABC = *mut ABC; +pub type LPABC = *mut ABC; +STRUCT!{struct ABCFLOAT { + abcfA: FLOAT, + abcfB: FLOAT, + abcfC: FLOAT, +}} +pub type PABCFLOAT = *mut ABCFLOAT; +pub type NPABCFLOAT = *mut ABCFLOAT; +pub type LPABCFLOAT = *mut ABCFLOAT; +STRUCT!{struct OUTLINETEXTMETRICA { + otmSize: UINT, + otmTextMetrics: TEXTMETRICA, + otmFiller: BYTE, + otmPanoseNumber: PANOSE, + otmfsSelection: UINT, + otmfsType: UINT, + otmsCharSlopeRise: c_int, + otmsCharSlopeRun: c_int, + otmItalicAngle: c_int, + otmEMSquare: UINT, + otmAscent: c_int, + otmDescent: c_int, + otmLineGap: UINT, + otmsCapEmHeight: UINT, + otmsXHeight: UINT, + otmrcFontBox: RECT, + otmMacAscent: c_int, + otmMacDescent: c_int, + otmMacLineGap: UINT, + otmusMinimumPPEM: UINT, + otmptSubscriptSize: POINT, + otmptSubscriptOffset: POINT, + otmptSuperscriptSize: POINT, + otmptSuperscriptOffset: POINT, + otmsStrikeoutSize: UINT, + otmsStrikeoutPosition: c_int, + otmsUnderscoreSize: c_int, + otmsUnderscorePosition: c_int, + otmpFamilyName: PSTR, + otmpFaceName: PSTR, + otmpStyleName: PSTR, + otmpFullName: PSTR, +}} +pub type POUTLINETEXTMETRICA = *mut OUTLINETEXTMETRICA; +pub type NPOUTLINETEXTMETRICA = *mut OUTLINETEXTMETRICA; +pub type LPOUTLINETEXTMETRICA = *mut OUTLINETEXTMETRICA; +STRUCT!{struct OUTLINETEXTMETRICW { + otmSize: UINT, + otmTextMetrics: TEXTMETRICW, + otmFiller: BYTE, + otmPanoseNumber: PANOSE, + otmfsSelection: UINT, + otmfsType: UINT, + otmsCharSlopeRise: c_int, + otmsCharSlopeRun: c_int, + otmItalicAngle: c_int, + otmEMSquare: UINT, + otmAscent: c_int, + otmDescent: c_int, + otmLineGap: UINT, + otmsCapEmHeight: UINT, + otmsXHeight: UINT, + otmrcFontBox: RECT, + otmMacAscent: c_int, + otmMacDescent: c_int, + otmMacLineGap: UINT, + otmusMinimumPPEM: UINT, + otmptSubscriptSize: POINT, + otmptSubscriptOffset: POINT, + otmptSuperscriptSize: POINT, + otmptSuperscriptOffset: POINT, + otmsStrikeoutSize: UINT, + otmsStrikeoutPosition: c_int, + otmsUnderscoreSize: c_int, + otmsUnderscorePosition: c_int, + otmpFamilyName: PSTR, + otmpFaceName: PSTR, + otmpStyleName: PSTR, + otmpFullName: PSTR, +}} +pub type POUTLINETEXTMETRICW = *mut OUTLINETEXTMETRICW; +pub type NPOUTLINETEXTMETRICW = *mut OUTLINETEXTMETRICW; +pub type LPOUTLINETEXTMETRICW = *mut OUTLINETEXTMETRICW; +STRUCT!{struct POLYTEXTA { + x: c_int, + y: c_int, + n: UINT, + lpstr: LPCSTR, + uiFlags: UINT, + rcl: RECT, + pdx: *mut c_int, +}} +pub type PPOLYTEXTA = *mut POLYTEXTA; +pub type NPPOLYTEXTA = *mut POLYTEXTA; +pub type LPPOLYTEXTA = *mut POLYTEXTA; +STRUCT!{struct POLYTEXTW { + x: c_int, + y: c_int, + n: UINT, + lpstr: LPCWSTR, + uiFlags: UINT, + rcl: RECT, + pdx: *mut c_int, +}} +pub type PPOLYTEXTW = *mut POLYTEXTW; +pub type NPPOLYTEXTW = *mut POLYTEXTW; +pub type LPPOLYTEXTW = *mut POLYTEXTW; +STRUCT!{struct FIXED { + fract: WORD, + value: c_short, +}} +STRUCT!{struct MAT2 { + eM11: FIXED, + eM12: FIXED, + eM21: FIXED, + eM22: FIXED, +}} +pub type LPMAT2 = *mut MAT2; +STRUCT!{struct GLYPHMETRICS { + gmBlackBoxX: UINT, + gmBlackBoxY: UINT, + gmptGlyphOrigin: POINT, + gmCellIncX: c_short, + gmCellIncY: c_short, +}} +pub type LPGLYPHMETRICS = *mut GLYPHMETRICS; +pub const GGO_METRICS: DWORD = 0; +pub const GGO_BITMAP: DWORD = 1; +pub const GGO_NATIVE: DWORD = 2; +pub const GGO_BEZIER: DWORD = 3; +pub const GGO_GRAY2_BITMAP: DWORD = 4; +pub const GGO_GRAY4_BITMAP: DWORD = 5; +pub const GGO_GRAY8_BITMAP: DWORD = 6; +pub const GGO_GLYPH_INDEX: DWORD = 0x0080; +pub const GGO_UNHINTED: DWORD = 0x0100; +pub const TT_POLYGON_TYPE: DWORD = 24; +pub const TT_PRIM_LINE: DWORD = 1; +pub const TT_PRIM_QSPLINE: DWORD = 2; +pub const TT_PRIM_CSPLINE: DWORD = 3; +STRUCT!{struct POINTFX { + x: FIXED, + y: FIXED, +}} +pub type LPPOINTFX = *mut POINTFX; +STRUCT!{struct TTPOLYCURVE { + wType: WORD, + cpfx: WORD, + apfx: [POINTFX; 1], +}} +pub type LPTTPOLYCURVE = *mut TTPOLYCURVE; +STRUCT!{struct TTPOLYGONHEADER { + cb: DWORD, + dwType: DWORD, + pfxStart: POINTFX, +}} +pub type LPTTPOLYGONHEADER = *mut TTPOLYGONHEADER; +pub const GCP_DBCS: DWORD = 0x0001; +pub const GCP_REORDER: DWORD = 0x0002; +pub const GCP_USEKERNING: DWORD = 0x0008; +pub const GCP_GLYPHSHAPE: DWORD = 0x0010; +pub const GCP_LIGATE: DWORD = 0x0020; +pub const GCP_DIACRITIC: DWORD = 0x0100; +pub const GCP_KASHIDA: DWORD = 0x0400; +pub const GCP_ERROR: DWORD = 0x8000; +pub const FLI_MASK: DWORD = 0x103B; +pub const GCP_JUSTIFY: DWORD = 0x00010000; +pub const FLI_GLYPHS: DWORD = 0x00040000; +pub const GCP_CLASSIN: DWORD = 0x00080000; +pub const GCP_MAXEXTENT: DWORD = 0x00100000; +pub const GCP_JUSTIFYIN: DWORD = 0x00200000; +pub const GCP_DISPLAYZWG: DWORD = 0x00400000; +pub const GCP_SYMSWAPOFF: DWORD = 0x00800000; +pub const GCP_NUMERICOVERRIDE: DWORD = 0x01000000; +pub const GCP_NEUTRALOVERRIDE: DWORD = 0x02000000; +pub const GCP_NUMERICSLATIN: DWORD = 0x04000000; +pub const GCP_NUMERICSLOCAL: DWORD = 0x08000000; +pub const GCPCLASS_LATIN: DWORD = 1; +pub const GCPCLASS_HEBREW: DWORD = 2; +pub const GCPCLASS_ARABIC: DWORD = 2; +pub const GCPCLASS_NEUTRAL: DWORD = 3; +pub const GCPCLASS_LOCALNUMBER: DWORD = 4; +pub const GCPCLASS_LATINNUMBER: DWORD = 5; +pub const GCPCLASS_LATINNUMERICTERMINATOR: DWORD = 6; +pub const GCPCLASS_LATINNUMERICSEPARATOR: DWORD = 7; +pub const GCPCLASS_NUMERICSEPARATOR: DWORD = 8; +pub const GCPCLASS_PREBOUNDLTR: DWORD = 0x80; +pub const GCPCLASS_PREBOUNDRTL: DWORD = 0x40; +pub const GCPCLASS_POSTBOUNDLTR: DWORD = 0x20; +pub const GCPCLASS_POSTBOUNDRTL: DWORD = 0x10; +pub const GCPGLYPH_LINKBEFORE: DWORD = 0x8000; +pub const GCPGLYPH_LINKAFTER: DWORD = 0x4000; +STRUCT!{struct GCP_RESULTSA { + lStructSize: DWORD, + lpOutString: LPSTR, + lpOrder: *mut UINT, + lpDx: *mut c_int, + lpCaretPos: *mut c_int, + lpClass: LPSTR, + lpGlyphs: LPWSTR, + nGlyphs: UINT, + nMaxFit: c_int, +}} +pub type LPGCP_RESULTSA = *mut GCP_RESULTSA; +STRUCT!{struct GCP_RESULTSW { + lStructSize: DWORD, + lpOutString: LPWSTR, + lpOrder: *mut UINT, + lpDx: *mut c_int, + lpCaretPos: *mut c_int, + lpClass: LPSTR, + lpGlyphs: LPWSTR, + nGlyphs: UINT, + nMaxFit: c_int, +}} +pub type LPGCP_RESULTSW = *mut GCP_RESULTSW; +STRUCT!{struct RASTERIZER_STATUS { + nSize: c_short, + wFlags: c_short, + nLanguageID: c_short, +}} +pub type LPRASTERIZER_STATUS = *mut RASTERIZER_STATUS; +pub const TT_AVAILABLE: DWORD = 0x0001; +pub const TT_ENABLED: DWORD = 0x0002; +STRUCT!{struct PIXELFORMATDESCRIPTOR { + nSize: WORD, + nVersion: WORD, + dwFlags: DWORD, + iPixelType: BYTE, + cColorBits: BYTE, + cRedBits: BYTE, + cRedShift: BYTE, + cGreenBits: BYTE, + cGreenShift: BYTE, + cBlueBits: BYTE, + cBlueShift: BYTE, + cAlphaBits: BYTE, + cAlphaShift: BYTE, + cAccumBits: BYTE, + cAccumRedBits: BYTE, + cAccumGreenBits: BYTE, + cAccumBlueBits: BYTE, + cAccumAlphaBits: BYTE, + cDepthBits: BYTE, + cStencilBits: BYTE, + cAuxBuffers: BYTE, + iLayerType: BYTE, + bReserved: BYTE, + dwLayerMask: DWORD, + dwVisibleMask: DWORD, + dwDamageMask: DWORD, +}} +pub type PPIXELFORMATDESCRIPTOR = *mut PIXELFORMATDESCRIPTOR; +pub type LPPIXELFORMATDESCRIPTOR = *mut PIXELFORMATDESCRIPTOR; +pub const PFD_TYPE_RGBA: BYTE = 0; +pub const PFD_TYPE_COLORINDEX: BYTE = 1; +pub const PFD_MAIN_PLANE: BYTE = 0; +pub const PFD_OVERLAY_PLANE: BYTE = 1; +pub const PFD_UNDERLAY_PLANE: BYTE = -1i8 as u8; +pub const PFD_DOUBLEBUFFER: DWORD = 0x00000001; +pub const PFD_STEREO: DWORD = 0x00000002; +pub const PFD_DRAW_TO_WINDOW: DWORD = 0x00000004; +pub const PFD_DRAW_TO_BITMAP: DWORD = 0x00000008; +pub const PFD_SUPPORT_GDI: DWORD = 0x00000010; +pub const PFD_SUPPORT_OPENGL: DWORD = 0x00000020; +pub const PFD_GENERIC_FORMAT: DWORD = 0x00000040; +pub const PFD_NEED_PALETTE: DWORD = 0x00000080; +pub const PFD_NEED_SYSTEM_PALETTE: DWORD = 0x00000100; +pub const PFD_SWAP_EXCHANGE: DWORD = 0x00000200; +pub const PFD_SWAP_COPY: DWORD = 0x00000400; +pub const PFD_SWAP_LAYER_BUFFERS: DWORD = 0x00000800; +pub const PFD_GENERIC_ACCELERATED: DWORD = 0x00001000; +pub const PFD_SUPPORT_DIRECTDRAW: DWORD = 0x00002000; +pub const PFD_DIRECT3D_ACCELERATED: DWORD = 0x00004000; +pub const PFD_SUPPORT_COMPOSITION: DWORD = 0x00008000; +pub const PFD_DEPTH_DONTCARE: DWORD = 0x20000000; +pub const PFD_DOUBLEBUFFER_DONTCARE: DWORD = 0x40000000; +pub const PFD_STEREO_DONTCARE: DWORD = 0x80000000; +FN!{stdcall OLDFONTENUMPROCA( + *const LOGFONTA, + *const TEXTMETRICA, + DWORD, + LPARAM, +) -> c_int} +FN!{stdcall OLDFONTENUMPROCW( + *const LOGFONTW, + *const TEXTMETRICW, + DWORD, + LPARAM, +) -> c_int} +pub type FONTENUMPROCA = OLDFONTENUMPROCA; +pub type FONTENUMPROCW = OLDFONTENUMPROCW; +FN!{stdcall GOBJENUMPROC( + LPVOID, + LPARAM, +) -> c_int} +FN!{stdcall LINEDDAPROC( + c_int, + c_int, + LPARAM, +) -> ()} +extern "system" { + pub fn AddFontResourceA( + _: LPCSTR, + ) -> c_int; + pub fn AddFontResourceW( + _: LPCWSTR, + ) -> c_int; + pub fn AnimatePalette( + hPal: HPALETTE, + iStartIndex: UINT, + cEntries: UINT, + ppe: *const PALETTEENTRY, + ) -> BOOL; + pub fn Arc( + hdc: HDC, + x1: c_int, + y1: c_int, + x2: c_int, + y2: c_int, + x3: c_int, + y3: c_int, + x4: c_int, + y4: c_int, + ) -> BOOL; + pub fn BitBlt( + hdc: HDC, + x: c_int, + y: c_int, + cx: c_int, + cy: c_int, + hdcSrc: HDC, + x1: c_int, + y1: c_int, + rop: DWORD, + ) -> BOOL; + pub fn CancelDC( + hdc: HDC, + ) -> BOOL; + pub fn Chord( + hdc: HDC, + x1: c_int, + y1: c_int, + x2: c_int, + y2: c_int, + x3: c_int, + y3: c_int, + x4: c_int, + y4: c_int, + ) -> BOOL; + pub fn ChoosePixelFormat( + hdc: HDC, + ppfd: *const PIXELFORMATDESCRIPTOR, + ) -> c_int; + pub fn CloseMetaFile( + hdc: HDC, + ) -> HMETAFILE; + pub fn CombineRgn( + hrgnDst: HRGN, + hrgnSrc1: HRGN, + hrgnSrc2: HRGN, + iMode: c_int, + ) -> c_int; + pub fn CopyMetaFileA( + _: HMETAFILE, + _: LPCSTR, + ) -> HMETAFILE; + pub fn CopyMetaFileW( + _: HMETAFILE, + _: LPCWSTR, + ) -> HMETAFILE; + pub fn CreateBitmap( + nWidth: c_int, + nHeight: c_int, + nPlanes: UINT, + nBitCount: UINT, + lpBits: *const c_void, + ) -> HBITMAP; + pub fn CreateBitmapIndirect( + pbm: *const BITMAP, + ) -> HBITMAP; + pub fn CreateBrushIndirect( + plbrush: *const LOGBRUSH, + ) -> HBRUSH; + pub fn CreateCompatibleBitmap( + hdc: HDC, + cx: c_int, + cy: c_int, + ) -> HBITMAP; + pub fn CreateDiscardableBitmap( + hdc: HDC, + cx: c_int, + cy: c_int, + ) -> HBITMAP; + pub fn CreateCompatibleDC( + hdc: HDC, + ) -> HDC; + pub fn CreateDCA( + pwszDriver: LPCSTR, + pwszDevice: LPCSTR, + pszPort: LPCSTR, + pdm: *const DEVMODEA, + ) -> HDC; + pub fn CreateDCW( + pwszDriver: LPCWSTR, + pwszDevice: LPCWSTR, + pszPort: LPCWSTR, + pdm: *const DEVMODEW, + ) -> HDC; + pub fn CreateDIBitmap( + hdc: HDC, + pbmih: *const BITMAPINFOHEADER, + flInit: DWORD, + pjBits: *const c_void, + pbmi: *const BITMAPINFO, + iUsage: UINT, + ) -> HBITMAP; + pub fn CreateDIBPatternBrush( + h: HGLOBAL, + iUsage: UINT, + ) -> HBRUSH; + pub fn CreateDIBPatternBrushPt( + lpPackedDIB: *const c_void, + iUsage: UINT, + ) -> HBRUSH; + pub fn CreateEllipticRgn( + x1: c_int, + y1: c_int, + x2: c_int, + y2: c_int, + ) -> HRGN; + pub fn CreateEllipticRgnIndirect( + lprect: *const RECT, + ) -> HRGN; + pub fn CreateFontIndirectA( + lplf: *const LOGFONTA, + ) -> HFONT; + pub fn CreateFontIndirectW( + lplf: *const LOGFONTW, + ) -> HFONT; + pub fn CreateFontA( + cHeight: c_int, + cWidth: c_int, + cEscapement: c_int, + cOrientation: c_int, + cWeight: c_int, + bItalic: DWORD, + bUnderline: DWORD, + bStrikeOut: DWORD, + iCharSet: DWORD, + iOutPrecision: DWORD, + iClipPrecision: DWORD, + iQuality: DWORD, + iPitchAndFamily: DWORD, + pszFaceName: LPCSTR, + ) -> HFONT; + pub fn CreateFontW( + cHeight: c_int, + cWidth: c_int, + cEscapement: c_int, + cOrientation: c_int, + cWeight: c_int, + bItalic: DWORD, + bUnderline: DWORD, + bStrikeOut: DWORD, + iCharSet: DWORD, + iOutPrecision: DWORD, + iClipPrecision: DWORD, + iQuality: DWORD, + iPitchAndFamily: DWORD, + pszFaceName: LPCWSTR, + ) -> HFONT; + pub fn CreateHatchBrush( + iHatch: c_int, + color: COLORREF, + ) -> HBRUSH; + pub fn CreateICA( + pszDriver: LPCSTR, + pszDevice: LPCSTR, + pszPort: LPCSTR, + pdm: *const DEVMODEA, + ) -> HDC; + pub fn CreateICW( + pszDriver: LPCWSTR, + pszDevice: LPCWSTR, + pszPort: LPCWSTR, + pdm: *const DEVMODEW, + ) -> HDC; + pub fn CreateMetaFileA( + pszFile: LPCSTR, + ) -> HDC; + pub fn CreateMetaFileW( + pszFile: LPCWSTR, + ) -> HDC; + pub fn CreatePalette( + plpal: *const LOGPALETTE, + ) -> HPALETTE; + pub fn CreatePen( + iStyle: c_int, + cWidth: c_int, + color: COLORREF, + ) -> HPEN; + pub fn CreatePenIndirect( + plpen: *const LOGPEN, + ) -> HPEN; + pub fn CreatePolyPolygonRgn( + pptl: *const POINT, + pc: *const INT, + cPoly: c_int, + iMode: c_int, + ) -> HRGN; + pub fn CreatePatternBrush( + hbm: HBITMAP, + ) -> HBRUSH; + pub fn CreateRectRgn( + x1: c_int, + y1: c_int, + x2: c_int, + y2: c_int, + ) -> HRGN; + pub fn CreateRectRgnIndirect( + lprect: *const RECT, + ) -> HRGN; + pub fn CreateRoundRectRgn( + x1: c_int, + y1: c_int, + x2: c_int, + y2: c_int, + w: c_int, + h: c_int, + ) -> HRGN; + pub fn CreateScalableFontResourceA( + fdwHidden: DWORD, + lpszFont: LPCSTR, + lpszFile: LPCSTR, + lpszPath: LPCSTR, + ) -> BOOL; + pub fn CreateScalableFontResourceW( + fdwHidden: DWORD, + lpszFont: LPCWSTR, + lpszFile: LPCWSTR, + lpszPath: LPCWSTR, + ) -> BOOL; + pub fn CreateSolidBrush( + color: COLORREF, + ) -> HBRUSH; + pub fn DeleteDC( + hdc: HDC, + ) -> BOOL; + pub fn DeleteMetaFile( + hmf: HMETAFILE, + ) -> BOOL; + pub fn DeleteObject( + ho: HGDIOBJ, + ) -> BOOL; + pub fn DescribePixelFormat( + hdc: HDC, + iPixelFormat: c_int, + nBytes: UINT, + ppfd: LPPIXELFORMATDESCRIPTOR, + ) -> c_int; +} +FN!{stdcall LPFNDEVMODE( + HWND, + HMODULE, + LPDEVMODEA, + LPSTR, + LPSTR, + LPDEVMODEA, + LPSTR, + UINT, +) -> UINT} +FN!{stdcall LPFNDEVCAPS( + LPSTR, + LPSTR, + UINT, + LPSTR, + LPDEVMODEA, +) -> DWORD} +pub const DM_UPDATE: DWORD = 1; +pub const DM_COPY: DWORD = 2; +pub const DM_PROMPT: DWORD = 4; +pub const DM_MODIFY: DWORD = 8; +pub const DM_IN_BUFFER: DWORD = DM_MODIFY; +pub const DM_IN_PROMPT: DWORD = DM_PROMPT; +pub const DM_OUT_BUFFER: DWORD = DM_COPY; +pub const DM_OUT_DEFAULT: DWORD = DM_UPDATE; +pub const DC_FIELDS: WORD = 1; +pub const DC_PAPERS: WORD = 2; +pub const DC_PAPERSIZE: WORD = 3; +pub const DC_MINEXTENT: WORD = 4; +pub const DC_MAXEXTENT: WORD = 5; +pub const DC_BINS: WORD = 6; +pub const DC_DUPLEX: WORD = 7; +pub const DC_SIZE: WORD = 8; +pub const DC_EXTRA: WORD = 9; +pub const DC_VERSION: WORD = 10; +pub const DC_DRIVER: WORD = 11; +pub const DC_BINNAMES: WORD = 12; +pub const DC_ENUMRESOLUTIONS: WORD = 13; +pub const DC_FILEDEPENDENCIES: WORD = 14; +pub const DC_TRUETYPE: WORD = 15; +pub const DC_PAPERNAMES: WORD = 16; +pub const DC_ORIENTATION: WORD = 17; +pub const DC_COPIES: WORD = 18; +pub const DC_BINADJUST: WORD = 19; +pub const DC_EMF_COMPLIANT: WORD = 20; +pub const DC_DATATYPE_PRODUCED: WORD = 21; +pub const DC_COLLATE: WORD = 22; +pub const DC_MANUFACTURER: WORD = 23; +pub const DC_MODEL: WORD = 24; +pub const DC_PERSONALITY: WORD = 25; +pub const DC_PRINTRATE: WORD = 26; +pub const DC_PRINTRATEUNIT: WORD = 27; +pub const PRINTRATEUNIT_PPM: WORD = 1; +pub const PRINTRATEUNIT_CPS: WORD = 2; +pub const PRINTRATEUNIT_LPM: WORD = 3; +pub const PRINTRATEUNIT_IPM: WORD = 4; +pub const DC_PRINTERMEM: WORD = 28; +pub const DC_MEDIAREADY: WORD = 29; +pub const DC_STAPLE: WORD = 30; +pub const DC_PRINTRATEPPM: WORD = 31; +pub const DC_COLORDEVICE: WORD = 32; +pub const DC_NUP: WORD = 33; +pub const DC_MEDIATYPENAMES: WORD = 34; +pub const DC_MEDIATYPES: WORD = 35; +pub const DCTT_BITMAP: DWORD = 0x0000001; +pub const DCTT_DOWNLOAD: DWORD = 0x0000002; +pub const DCTT_SUBDEV: DWORD = 0x0000004; +pub const DCTT_DOWNLOAD_OUTLINE: DWORD = 0x0000008; +pub const DCBA_FACEUPNONE: DWORD = 0x0000; +pub const DCBA_FACEUPCENTER: DWORD = 0x0001; +pub const DCBA_FACEUPLEFT: DWORD = 0x0002; +pub const DCBA_FACEUPRIGHT: DWORD = 0x0003; +pub const DCBA_FACEDOWNNONE: DWORD = 0x0100; +pub const DCBA_FACEDOWNCENTER: DWORD = 0x0101; +pub const DCBA_FACEDOWNLEFT: DWORD = 0x0102; +pub const DCBA_FACEDOWNRIGHT: DWORD = 0x0103; +extern "system" { + pub fn DeviceCapabilitiesA( + pDevice: LPCSTR, + pPort: LPCSTR, + fwCapability: WORD, + pOutput: LPSTR, + pDevMode: *const DEVMODEA, + ) -> c_int; + pub fn DeviceCapabilitiesW( + pDevice: LPCWSTR, + pPort: LPCWSTR, + fwCapability: WORD, + pOutput: LPWSTR, + pDevMode: *const DEVMODEW, + ) -> c_int; + pub fn DrawEscape( + hdc: HDC, + iEscape: c_int, + cjIn: c_int, + lpIn: LPCSTR, + ) -> c_int; + pub fn Ellipse( + hdc: HDC, + left: c_int, + top: c_int, + right: c_int, + bottom: c_int, + ) -> BOOL; + pub fn EnumFontFamiliesExA( + hdc: HDC, + lpLogfont: LPLOGFONTA, + lpProc: FONTENUMPROCA, + lParam: LPARAM, + dwFlags: DWORD, + ) -> c_int; + pub fn EnumFontFamiliesExW( + hdc: HDC, + lpLogfont: LPLOGFONTW, + lpProc: FONTENUMPROCW, + lParam: LPARAM, + dwFlags: DWORD, + ) -> c_int; + pub fn EnumFontFamiliesA( + hdc: HDC, + lpLogfont: LPCSTR, + lpProc: FONTENUMPROCA, + lParam: LPARAM, + ) -> c_int; + pub fn EnumFontFamiliesW( + hdc: HDC, + lpLogfont: LPCWSTR, + lpProc: FONTENUMPROCW, + lParam: LPARAM, + ) -> c_int; + pub fn EnumFontsA( + hdc: HDC, + lpLogfont: LPCSTR, + lpProc: FONTENUMPROCA, + lParam: LPARAM, + ) -> c_int; + pub fn EnumFontsW( + hdc: HDC, + lpLogfont: LPCWSTR, + lpProc: FONTENUMPROCW, + lParam: LPARAM, + ) -> c_int; + pub fn EnumObjects( + hdc: HDC, + nType: c_int, + lpFunc: GOBJENUMPROC, + lParam: LPARAM, + ) -> c_int; + pub fn EqualRgn( + hrgn1: HRGN, + hrgn2: HRGN, + ) -> BOOL; + pub fn Escape( + hdc: HDC, + iEscape: c_int, + cjIn: c_int, + pvIn: LPCSTR, + pvOut: LPVOID, + ) -> c_int; + pub fn ExtEscape( + hdc: HDC, + iEscape: c_int, + cjInput: c_int, + lpInData: LPCSTR, + cjOutput: c_int, + lpOutData: LPSTR, + ) -> c_int; + pub fn ExcludeClipRect( + hdc: HDC, + left: c_int, + top: c_int, + right: c_int, + bottom: c_int, + ) -> c_int; + pub fn ExtCreateRegion( + lpx: *const XFORM, + nCount: DWORD, + lpData: *const RGNDATA, + ) -> HRGN; + pub fn ExtFloodFill( + hdc: HDC, + x: c_int, + y: c_int, + color: COLORREF, + utype: UINT, + ) -> BOOL; + pub fn FillRgn( + hdc: HDC, + hrgn: HRGN, + hbr: HBRUSH, + ) -> BOOL; + pub fn FloodFill( + hdc: HDC, + x: c_int, + y: c_int, + color: COLORREF, + ) -> BOOL; + pub fn FrameRgn( + hdc: HDC, + hrgn: HRGN, + hbr: HBRUSH, + w: c_int, + h: c_int, + ) -> BOOL; + pub fn GetROP2( + hdc: HDC, + ) -> c_int; + pub fn GetAspectRatioFilterEx( + hdc: HDC, + lpsize: LPSIZE, + ) -> BOOL; + pub fn GetBkColor( + hdc: HDC, + ) -> COLORREF; + pub fn GetDCBrushColor( + hdc: HDC, + ) -> COLORREF; + pub fn GetDCPenColor( + hdc: HDC, + ) -> COLORREF; + pub fn GetBkMode( + hdc: HDC, + ) -> c_int; + pub fn GetBitmapBits( + hbit: HBITMAP, + cb: LONG, + lpvBits: LPVOID, + ) -> LONG; + pub fn GetBitmapDimensionEx( + hbit: HBITMAP, + lpsize: LPSIZE, + ) -> BOOL; + pub fn GetBoundsRect( + hdc: HDC, + lprect: LPRECT, + flags: UINT, + ) -> UINT; + pub fn GetBrushOrgEx( + hdc: HDC, + lppt: LPPOINT, + ) -> BOOL; + pub fn GetCharWidthA( + hdc: HDC, + iFirst: UINT, + iLast: UINT, + lpBuffer: LPINT, + ) -> BOOL; + pub fn GetCharWidthW( + hdc: HDC, + iFirst: UINT, + iLast: UINT, + lpBuffer: LPINT, + ) -> BOOL; + pub fn GetCharWidth32A( + hdc: HDC, + iFirst: UINT, + iLast: UINT, + lpBuffer: LPINT, + ) -> BOOL; + pub fn GetCharWidth32W( + hdc: HDC, + iFirst: UINT, + iLast: UINT, + lpBuffer: LPINT, + ) -> BOOL; + pub fn GetCharWidthFloatA( + hdc: HDC, + iFirst: UINT, + iLast: UINT, + lpBuffer: PFLOAT, + ) -> BOOL; + pub fn GetCharWidthFloatW( + hdc: HDC, + iFirst: UINT, + iLast: UINT, + lpBuffer: PFLOAT, + ) -> BOOL; + pub fn GetCharABCWidthsA( + hdc: HDC, + wFirst: UINT, + wLast: UINT, + lpABC: LPABC, + ) -> BOOL; + pub fn GetCharABCWidthsW( + hdc: HDC, + wFirst: UINT, + wLast: UINT, + lpABC: LPABC, + ) -> BOOL; + pub fn GetCharABCWidthsFloatA( + hdc: HDC, + iFirst: UINT, + iLast: UINT, + lpABC: LPABCFLOAT, + ) -> BOOL; + pub fn GetCharABCWidthsFloatW( + hdc: HDC, + iFirst: UINT, + iLast: UINT, + lpABC: LPABCFLOAT, + ) -> BOOL; + pub fn GetClipBox( + hdc: HDC, + lprect: LPRECT, + ) -> c_int; + pub fn GetClipRgn( + hdc: HDC, + hrgn: HRGN, + ) -> c_int; + pub fn GetMetaRgn( + hdc: HDC, + hrgn: HRGN, + ) -> c_int; + pub fn GetCurrentObject( + hdc: HDC, + tp: UINT, + ) -> HGDIOBJ; + pub fn GetCurrentPositionEx( + hdc: HDC, + lppt: LPPOINT, + ) -> BOOL; + pub fn GetDeviceCaps( + hdc: HDC, + nIndex: c_int, + ) -> c_int; + pub fn GetDIBits( + hdc: HDC, + hbm: HBITMAP, + start: UINT, + cLines: UINT, + lpvBits: LPVOID, + lpbmi: LPBITMAPINFO, + usage: UINT, + ) -> c_int; + pub fn GetFontData( + hdc: HDC, + dwTable: DWORD, + dwOffset: DWORD, + pvBuffer: PVOID, + cjBuffer: DWORD, + ) -> DWORD; + pub fn GetGlyphOutlineA( + hdc: HDC, + uChar: UINT, + fuFormat: UINT, + lpgm: LPGLYPHMETRICS, + cjBuffer: DWORD, + pvBuffer: LPVOID, + lpmat2: *const MAT2, + ) -> DWORD; + pub fn GetGlyphOutlineW( + hdc: HDC, + uChar: UINT, + fuFormat: UINT, + lpgm: LPGLYPHMETRICS, + cjBuffer: DWORD, + pvBuffer: LPVOID, + lpmat2: *const MAT2, + ) -> DWORD; + pub fn GetGraphicsMode( + hdc: HDC, + ) -> c_int; + pub fn GetMapMode( + hdc: HDC, + ) -> c_int; + pub fn GetMetaFileBitsEx( + hMF: HMETAFILE, + cbBuffer: UINT, + lpData: LPVOID, + ) -> UINT; + pub fn GetMetaFileA( + lpName: LPCSTR, + ) -> HMETAFILE; + pub fn GetMetaFileW( + lpName: LPCWSTR, + ) -> HMETAFILE; + pub fn GetNearestColor( + hdc: HDC, + color: COLORREF, + ) -> COLORREF; + pub fn GetNearestPaletteIndex( + h: HPALETTE, + color: COLORREF, + ) -> UINT; + pub fn GetObjectType( + h: HGDIOBJ, + ) -> DWORD; + pub fn GetOutlineTextMetricsA( + hdc: HDC, + cjCopy: UINT, + potm: LPOUTLINETEXTMETRICA, + ) -> UINT; + pub fn GetOutlineTextMetricsW( + hdc: HDC, + cjCopy: UINT, + potm: LPOUTLINETEXTMETRICW, + ) -> UINT; + pub fn GetPaletteEntries( + hpal: HPALETTE, + iStart: UINT, + cEntries: UINT, + pPalEntries: LPPALETTEENTRY, + ) -> UINT; + pub fn GetPixel( + hdc: HDC, + x: c_int, + y: c_int, + ) -> COLORREF; + pub fn GetPixelFormat( + hdc: HDC, + ) -> c_int; + pub fn GetPolyFillMode( + hdc: HDC, + ) -> c_int; + pub fn GetRasterizerCaps( + lpraststat: LPRASTERIZER_STATUS, + cjBytes: UINT, + ) -> BOOL; + pub fn GetRandomRgn ( + hdc: HDC, + hrgn: HRGN, + i: INT, + ) -> c_int; + pub fn GetRegionData( + hrgn: HRGN, + nCount: DWORD, + lpRgnData: LPRGNDATA, + ) -> DWORD; + pub fn GetRgnBox( + hrgn: HRGN, + lprc: LPRECT, + ) -> c_int; + pub fn GetStockObject( + i: c_int, + ) -> HGDIOBJ; + pub fn GetStretchBltMode( + hdc: HDC, + ) -> c_int; + pub fn GetSystemPaletteEntries( + hdc: HDC, + iStart: UINT, + cEntries: UINT, + pPalEntries: LPPALETTEENTRY, + ) -> UINT; + pub fn GetSystemPaletteUse( + hdc: HDC, + ) -> UINT; + pub fn GetTextCharacterExtra( + hdc: HDC, + ) -> c_int; + pub fn GetTextAlign( + hdc: HDC, + ) -> UINT; + pub fn GetTextColor( + hdc: HDC, + ) -> COLORREF; + pub fn GetTextExtentPointA( + hdc: HDC, + lpString: LPCSTR, + c: c_int, + lpsz: LPSIZE, + ) -> BOOL; + pub fn GetTextExtentPointW( + hdc: HDC, + lpString: LPCWSTR, + c: c_int, + lpsz: LPSIZE, + ) -> BOOL; + pub fn GetTextExtentPoint32A( + hdc: HDC, + lpString: LPCSTR, + c: c_int, + psizl: LPSIZE, + ) -> BOOL; + pub fn GetTextExtentPoint32W( + hdc: HDC, + lpString: LPCWSTR, + c: c_int, + psizl: LPSIZE, + ) -> BOOL; + pub fn GetTextExtentExPointA( + hdc: HDC, + lpszString: LPCSTR, + cchString: c_int, + nMaxExtent: c_int, + lpnFit: LPINT, + lpnDx: LPINT, + lpSize: LPSIZE, + ) -> BOOL; + pub fn GetTextExtentExPointW( + hdc: HDC, + lpszString: LPCWSTR, + cchString: c_int, + nMaxExtent: c_int, + lpnFit: LPINT, + lpnDx: LPINT, + lpSize: LPSIZE, + ) -> BOOL; + pub fn GetTextCharset( + hdc: HDC, + ) -> c_int; + pub fn GetTextCharsetInfo( + hdc: HDC, + lpSig: LPFONTSIGNATURE, + dwFlags: DWORD, + ) -> c_int; + pub fn TranslateCharsetInfo( + lpSrc: *const DWORD, + lpCs: LPCHARSETINFO, + dwFlags: DWORD, + ) -> BOOL; + pub fn GetFontLanguageInfo( + hdc: HDC, + ) -> DWORD; + pub fn GetCharacterPlacementA( + hdc: HDC, + lpString: LPCSTR, + nCount: c_int, + nMexExtent: c_int, + lpResults: LPGCP_RESULTSA, + dwFlags: DWORD, + ) -> DWORD; + pub fn GetCharacterPlacementW( + hdc: HDC, + lpString: LPCWSTR, + nCount: c_int, + nMexExtent: c_int, + lpResults: LPGCP_RESULTSW, + dwFlags: DWORD, + ) -> DWORD; +} +STRUCT!{struct WCRANGE { + wcLow: WCHAR, + cGlyphs: USHORT, +}} +pub type PWCRANGE = *mut WCRANGE; +pub type LPWCRANGE = *mut WCRANGE; +STRUCT!{struct GLYPHSET { + cbThis: DWORD, + flAccel: DWORD, + cGlyphsSupported: DWORD, + cRanges: DWORD, + ranges: [WCRANGE;1], +}} +pub type PGLYPHSET = *mut GLYPHSET; +pub type LPGLYPHSET = *mut GLYPHSET; +pub const GS_8BIT_INDICES: DWORD = 0x00000001; +pub const GGI_MARK_NONEXISTING_GLYPHS: DWORD = 0x0001; +extern "system" { + pub fn GetFontUnicodeRanges( + hdc: HDC, + lpgs: LPGLYPHSET, + ) -> DWORD; + pub fn GetGlyphIndicesA( + hdc: HDC, + lpstr: LPCSTR, + c: c_int, + pgi: LPWORD, + fl: DWORD, + ) -> DWORD; + pub fn GetGlyphIndicesW( + hdc: HDC, + lpstr: LPCWSTR, + c: c_int, + pgi: LPWORD, + fl: DWORD, + ) -> DWORD; + pub fn GetTextExtentPointI( + hdc: HDC, + pgiIn: LPWORD, + cgi: c_int, + psize: LPSIZE, + ) -> BOOL; + pub fn GetTextExtentExPointI( + hdc: HDC, + lpwszString: LPWORD, + cwchString: c_int, + nMaxExtent: c_int, + lpnFit: LPINT, + lpnDx: LPINT, + lpSize: LPSIZE, + ) -> BOOL; + pub fn GetCharWidthI( + hdc: HDC, + giFirst: UINT, + cgi: UINT, + pgi: LPWORD, + piWidths: LPINT, + ) -> BOOL; + pub fn GetCharABCWidthsI( + hdc: HDC, + giFirst: UINT, + cgi: UINT, + pgi: LPWORD, + pabc: LPABC, + ) -> BOOL; +} +pub const STAMP_DESIGNVECTOR: DWORD = 0x8000000 + 0x64 + (0x76 << 8); +pub const STAMP_AXESLIST: DWORD = 0x8000000 + 0x61 + (0x6c << 8); +pub const STAMP_TRUETYPE_VARIATION: DWORD = 0x8000000 + 0x74 + (0x76 << 8); +pub const MM_MAX_NUMAXES: usize = 16; +STRUCT!{struct DESIGNVECTOR { + dvReserved: DWORD, + dvNumAxes: DWORD, + dvValues: [LONG; MM_MAX_NUMAXES], +}} +pub type PDESIGNVECTOR = *mut DESIGNVECTOR; +pub type LPDESIGNVECTOR = *mut DESIGNVECTOR; +extern "system" { + pub fn AddFontResourceExA( + lpszFilename: LPCSTR, + fl: DWORD, + pdv: PVOID, + ) -> c_int; + pub fn AddFontResourceExW( + lpszFilename: LPCWSTR, + fl: DWORD, + pdv: PVOID, + ) -> c_int; + pub fn RemoveFontResourceExA( + name: LPCSTR, + fl: DWORD, + pdv: PVOID, + ) -> BOOL; + pub fn RemoveFontResourceExW( + name: LPCWSTR, + fl: DWORD, + pdv: PVOID, + ) -> BOOL; + pub fn AddFontMemResourceEx( + pbFont: PVOID, + cbSize: DWORD, + pdv: PVOID, + pcFonts: *mut DWORD, + ) -> HANDLE; + pub fn RemoveFontMemResourceEx( + h: HANDLE, + ) -> BOOL; +} +pub const FR_PRIVATE: DWORD = 0x10; +pub const FR_NOT_ENUM: DWORD = 0x20; +pub const MM_MAX_AXES_NAMELEN: usize = 16; +STRUCT!{struct AXISINFOA { + axMinValue: LONG, + axMaxValue: LONG, + axAxisName: [BYTE; MM_MAX_AXES_NAMELEN], +}} +pub type PAXISINFOA = *mut AXISINFOA; +pub type LPAXISINFOA = *mut AXISINFOA; +STRUCT!{struct AXISINFOW { + axMinValue: LONG, + axMaxValue: LONG, + axAxisName: [WCHAR; MM_MAX_AXES_NAMELEN], +}} +pub type PAXISINFOW = *mut AXISINFOW; +pub type LPAXISINFOW = *mut AXISINFOW; +STRUCT!{struct AXESLISTA { + axlReserved: DWORD, + axlNumAxes: DWORD, + axlAxisInfo: [AXISINFOA; MM_MAX_AXES_NAMELEN], +}} +pub type PAXESLISTA = *mut AXESLISTA; +pub type LPAXESLISTA = *mut AXESLISTA; +STRUCT!{struct AXESLISTW { + axlReserved: DWORD, + axlNumAxes: DWORD, + axlAxisInfo: [AXISINFOW; MM_MAX_AXES_NAMELEN], +}} +pub type PAXESLISTW = *mut AXESLISTW; +pub type LPAXESLISTW = *mut AXESLISTW; +STRUCT!{struct ENUMLOGFONTEXDVA { + elfEnumLogfontEx: ENUMLOGFONTEXA, + elfDesignVector: DESIGNVECTOR, +}} +pub type PENUMLOGFONTEXDVA = *mut ENUMLOGFONTEXDVA; +pub type LPENUMLOGFONTEXDVA = *mut ENUMLOGFONTEXDVA; +STRUCT!{struct ENUMLOGFONTEXDVW { + elfEnumLogfontEx: ENUMLOGFONTEXW, + elfDesignVector: DESIGNVECTOR, +}} +pub type PENUMLOGFONTEXDVW = *mut ENUMLOGFONTEXDVW; +pub type LPENUMLOGFONTEXDVW = *mut ENUMLOGFONTEXDVW; +extern "system" { + pub fn CreateFontIndirectExA( + penumlfex: *const ENUMLOGFONTEXDVA, + ) -> HFONT; + pub fn CreateFontIndirectExW( + penumlfex: *const ENUMLOGFONTEXDVW, + ) -> HFONT; +} +STRUCT!{struct ENUMTEXTMETRICA { + etmNewTextMetricEx: NEWTEXTMETRICEXA, + etmAxesList: AXESLISTA, +}} +pub type PENUMTEXTMETRICA = *mut ENUMTEXTMETRICA; +pub type LPENUMTEXTMETRICA = *mut ENUMTEXTMETRICA; +STRUCT!{struct ENUMTEXTMETRICW { + etmNewTextMetricEx: NEWTEXTMETRICEXW, + etmAxesList: AXESLISTW, +}} +pub type PENUMTEXTMETRICW = *mut ENUMTEXTMETRICW; +pub type LPENUMTEXTMETRICW = *mut ENUMTEXTMETRICW; +extern "system" { + pub fn GetViewportExtEx( + hdc: HDC, + lpsize: LPSIZE, + ) -> BOOL; + pub fn GetViewportOrgEx( + hdc: HDC, + lppoint: LPPOINT, + ) -> BOOL; + pub fn GetWindowExtEx( + hdc: HDC, + lpsize: LPSIZE, + ) -> BOOL; + pub fn GetWindowOrgEx( + hdc: HDC, + lppoint: LPPOINT, + ) -> BOOL; + pub fn IntersectClipRect( + hdc: HDC, + left: c_int, + top: c_int, + right: c_int, + bottom: c_int, + ) -> c_int; + pub fn InvertRgn( + hdc: HDC, + hrgn: HRGN, + ) -> BOOL; + pub fn LineDDA( + nXStart: c_int, + nYStart: c_int, + nXEnd: c_int, + nYEnd: c_int, + lpLineFunc: LINEDDAPROC, + lpData: LPARAM, + ) -> BOOL; + pub fn LineTo( + hdc: HDC, + nXEnd: c_int, + nYEnd: c_int, + ) -> BOOL; + pub fn MaskBlt( + hdcDest: HDC, + xDest: c_int, + yDest: c_int, + width: c_int, + height: c_int, + hdcSrc: HDC, + xSrc: c_int, + ySrc: c_int, + hbmMask: HBITMAP, + xMask: c_int, + yMask: c_int, + rop: DWORD, + ) -> BOOL; + pub fn PlgBlt( + hdcDest: HDC, + lpPoint: *const POINT, + hdcSrc: HDC, + xSrc: c_int, + ySrc: c_int, + width: c_int, + height: c_int, + hbmMask: HBITMAP, + xMask: c_int, + yMask: c_int, + ) -> BOOL; + pub fn OffsetClipRgn( + hdc: HDC, + x: c_int, + y: c_int, + ) -> c_int; + pub fn OffsetRgn( + hrgn: HRGN, + x: c_int, + y: c_int, + ) -> c_int; + pub fn PatBlt( + hdc: HDC, + nXLeft: c_int, + nYLeft: c_int, + nWidth: c_int, + nHeight: c_int, + dwRop: DWORD, + ) -> BOOL; + pub fn Pie( + hdc: HDC, + nLeftRect: c_int, + nTopRect: c_int, + nRightRect: c_int, + nBottomRect: c_int, + nXRadial1: c_int, + nYRadial1: c_int, + nXRadial2: c_int, + nYRadial2: c_int, + ) -> BOOL; + pub fn PlayMetaFile( + hdc: HDC, + hmf: HMETAFILE, + ) -> BOOL; + pub fn PaintRgn( + hdc: HDC, + hrgn: HRGN, + ) -> BOOL; + pub fn PolyPolygon( + hdc: HDC, + lpPoints: *const POINT, + lpPolyCounts: *const INT, + cCount: DWORD, + ) -> BOOL; + pub fn PtInRegion( + hrgn: HRGN, + x: c_int, + y: c_int, + ) -> BOOL; + pub fn PtVisible( + hdc: HDC, + x: c_int, + y: c_int, + ) -> BOOL; + pub fn RectInRegion( + hrgn: HRGN, + lprect: *const RECT, + ) -> BOOL; + pub fn RectVisible( + hdc: HDC, + lprect: *const RECT, + ) -> BOOL; + pub fn Rectangle( + hdc: HDC, + left: c_int, + top: c_int, + right: c_int, + bottom: c_int, + ) -> BOOL; + pub fn RestoreDC( + hdc: HDC, + nSavedDC: c_int, + ) -> BOOL; + pub fn ResetDCA( + hdc: HDC, + lpdm: *const DEVMODEA, + ) -> HDC; + pub fn ResetDCW( + hdc: HDC, + lpdm: *const DEVMODEW, + ) -> HDC; + pub fn RealizePalette( + hdc: HDC, + ) -> UINT; + pub fn RemoveFontResourceA( + lpFileName: LPCSTR, + ) -> BOOL; + pub fn RemoveFontResourceW( + lpFileName: LPCWSTR, + ) -> BOOL; + pub fn RoundRect( + hdc: HDC, + nLeftRect: c_int, + nTopRect: c_int, + nRightRect: c_int, + nBottomRect: c_int, + nWidth: c_int, + nHeight: c_int, + ) -> BOOL; + pub fn ResizePalette( + hpal: HPALETTE, + n: UINT, + ) -> BOOL; + pub fn SaveDC( + hdc: HDC, + ) -> c_int; + pub fn SelectClipRgn( + hdc: HDC, + hrgn: HRGN, + ) -> c_int; + pub fn ExtSelectClipRgn( + hdc: HDC, + hrgn: HRGN, + mode: c_int, + ) -> c_int; + pub fn SetMetaRgn( + hdc: HDC, + ) -> c_int; + pub fn SelectObject( + hdc: HDC, + h: HGDIOBJ, + ) -> HGDIOBJ; + pub fn SelectPalette( + hdc: HDC, + hPal: HPALETTE, + bForceBkgd: BOOL, + ) -> HPALETTE; + pub fn SetBkColor( + hdc: HDC, + color: COLORREF, + ) -> COLORREF; + pub fn SetDCBrushColor( + hdc: HDC, + color: COLORREF, + ) -> COLORREF; + pub fn SetDCPenColor( + hdc: HDC, + color: COLORREF, + ) -> COLORREF; + pub fn SetBkMode( + hdc: HDC, + mode: c_int, + ) -> c_int; + pub fn SetBitmapBits( + hbm: HBITMAP, + cb: DWORD, + pvBits: *const VOID, + ) -> LONG; + pub fn SetBoundsRect( + hdc: HDC, + lprect: *const RECT, + flags: UINT, + ) -> UINT; + pub fn SetDIBits( + hdc: HDC, + hbm: HBITMAP, + start: UINT, + cLines: UINT, + lpBits: *const VOID, + lpbmi: *const BITMAPINFO, + ColorUse: UINT, + ) -> c_int; + pub fn SetDIBitsToDevice( + hdc: HDC, + xDest: c_int, + yDest: c_int, + w: DWORD, + h: DWORD, + xSrc: c_int, + ySrc: c_int, + StartScan: UINT, + cLines: UINT, + lpvBits: *const VOID, + lpbmi: *const BITMAPINFO, + ColorUse: UINT, + ) -> c_int; + pub fn SetMapperFlags( + hdc: HDC, + flags: DWORD, + ) -> DWORD; + pub fn SetGraphicsMode( + hdc: HDC, + iMode: c_int, + ) -> c_int; + pub fn SetMapMode( + hdc: HDC, + mode: c_int, + ) -> c_int; + pub fn SetLayout( + hdc: HDC, + l: DWORD, + ) -> DWORD; + pub fn GetLayout( + hdc: HDC, + ) -> DWORD; + pub fn SetMetaFileBitsEx( + cbBuffer: UINT, + lpData: *const BYTE, + ) -> HMETAFILE; + pub fn SetPaletteEntries( + hpal: HPALETTE, + iStart: UINT, + cEntries: UINT, + pPalEntries: *const PALETTEENTRY, + ) -> UINT; + pub fn SetPixel( + hdc: HDC, + x: c_int, + y: c_int, + color: COLORREF, + ) -> COLORREF; + pub fn SetPixelV( + hdc: HDC, + x: c_int, + y: c_int, + color: COLORREF, + ) -> BOOL; + pub fn SetPixelFormat( + hdc: HDC, + iPixelFormat: c_int, + ppfd: *const PIXELFORMATDESCRIPTOR, + ) -> BOOL; + pub fn SetPolyFillMode( + hdc: HDC, + iPolyFillMode: c_int, + ) -> c_int; + pub fn StretchBlt( + hdcDest: HDC, + xDest: c_int, + yDest: c_int, + wDest: c_int, + hDest: c_int, + hdcSrc: HDC, + xSrc: c_int, + ySrc: c_int, + wSrc: c_int, + hSrc: c_int, + rop: DWORD, + ) -> BOOL; + pub fn SetRectRgn( + hrgn: HRGN, + left: c_int, + top: c_int, + right: c_int, + bottom: c_int, + ) -> BOOL; + pub fn StretchDIBits( + hdc: HDC, + XDest: c_int, + YDest: c_int, + nDestWidth: c_int, + nDestHeight: c_int, + XSrc: c_int, + YSrc: c_int, + nSrcWidth: c_int, + nSrcHeight: c_int, + lpBits: *const VOID, + lpBitsInfo: *const BITMAPINFO, + iUsage: UINT, + dwRop: DWORD, + ) -> c_int; + pub fn SetROP2( + hdc: HDC, + rop2: c_int, + ) -> c_int; + pub fn SetStretchBltMode( + hdc: HDC, + mode: c_int, + ) -> c_int; + pub fn SetSystemPaletteUse( + hdc: HDC, + uuse: UINT, + ) -> UINT; + pub fn SetTextCharacterExtra( + hdc: HDC, + extra: c_int, + ) -> c_int; + pub fn SetTextColor( + hdc: HDC, + color: COLORREF, + ) -> COLORREF; + pub fn SetTextAlign( + hdc: HDC, + align: UINT, + ) -> UINT; + pub fn SetTextJustification( + hdc: HDC, + extra: c_int, + count: c_int, + ) -> BOOL; + pub fn UpdateColors( + hdc: HDC, + ) -> BOOL; +} +pub type COLOR16 = c_ushort; +STRUCT!{struct TRIVERTEX { + x: LONG, + y: LONG, + Red: COLOR16, + Green: COLOR16, + Blue: COLOR16, + Alpha: COLOR16, +}} +pub type PTRIVERTEX = *mut TRIVERTEX; +pub type LPTRIVERTEX = *mut TRIVERTEX; +STRUCT!{struct GRADIENT_RECT { + UpperLeft: ULONG, + LowerRight: ULONG, +}} +pub type PGRADIENT_RECT = *mut GRADIENT_RECT; +pub type LPGRADIENT_RECT = *mut GRADIENT_RECT; +STRUCT!{struct BLENDFUNCTION { + BlendOp: BYTE, + BlendFlags: BYTE, + SourceConstantAlpha: BYTE, + AlphaFormat: BYTE, +}} +pub type PBLENDFUNCTION = *mut BLENDFUNCTION; +pub const AC_SRC_OVER: BYTE = 0x00; +pub const AC_SRC_ALPHA: BYTE = 0x01; +extern "system" { + pub fn AlphaBlend( + hdcDest: HDC, + xoriginDest: c_int, + yoriginDest: c_int, + wDest: c_int, + hDest: c_int, + hdcSrc: HDC, + xoriginSrc: c_int, + yoriginSrc: c_int, + wSrc: c_int, + hSrc: c_int, + ftn: BLENDFUNCTION, + ) -> BOOL; + pub fn TransparentBlt( + hdcDest: HDC, + xoriginDest: c_int, + yoriginDest: c_int, + wDest: c_int, + hDest: c_int, + hdcSrc: HDC, + xoriginSrc: c_int, + yoriginSrc: c_int, + wSrc: c_int, + hSrc: c_int, + crTransparent: UINT, + ) -> BOOL; +} +pub const GRADIENT_FILL_RECT_H: ULONG = 0x00000000; +pub const GRADIENT_FILL_RECT_V: ULONG = 0x00000001; +pub const GRADIENT_FILL_TRIANGLE: ULONG = 0x00000002; +pub const GRADIENT_FILL_OP_FLAG: ULONG = 0x000000ff; +extern "system" { + pub fn GradientFill( + hdc: HDC, + pVertex: PTRIVERTEX, + nVertex: ULONG, + pMesh: PVOID, + nMesh: ULONG, + ulMode: ULONG, + ) -> BOOL; + pub fn GdiAlphaBlend( + hdcDest: HDC, + xoriginDest: c_int, + yoriginDest: c_int, + wDest: c_int, + hDest: c_int, + hdcSrc: HDC, + xoriginSrc: c_int, + yoriginSrc: c_int, + wSrc: c_int, + hSrc: c_int, + ftn: BLENDFUNCTION, + ) -> BOOL; + pub fn GdiTransparentBlt( + hdcDest: HDC, + xoriginDest: c_int, + yoriginDest: c_int, + wDest: c_int, + hDest: c_int, + hdcSrc: HDC, + xoriginSrc: c_int, + yoriginSrc: c_int, + wSrc: c_int, + hSrc: c_int, + crTransparent: UINT, + ) -> BOOL; + pub fn GdiGradientFill( + hdc: HDC, + pVertex: PTRIVERTEX, + nVertex: ULONG, + pMesh: PVOID, + nCount: ULONG, + ulMode: ULONG, + ) -> BOOL; + pub fn PlayMetaFileRecord( + hdc: HDC, + lpHandleTable: LPHANDLETABLE, + lpMR: LPMETARECORD, + noObjs: UINT, + ) -> BOOL; +} +FN!{stdcall MFENUMPROC( + hdc: HDC, + lpht: *mut HANDLETABLE, + lpMR: *mut METARECORD, + nObj: c_int, + param: LPARAM, +) -> c_int} +extern "system" { + pub fn EnumMetaFile( + hdc: HDC, + hmf: HMETAFILE, + mproc: MFENUMPROC, + param: LPARAM, + ) -> BOOL; +} +FN!{stdcall ENHMFENUMPROC( + hdc: HDC, + lpht: *mut HANDLETABLE, + lpmr: *const ENHMETARECORD, + nHandles: c_int, + data: LPARAM, +) -> c_int} +extern "system" { + pub fn CloseEnhMetaFile( + hdc: HDC, + ) -> HENHMETAFILE; + pub fn CopyEnhMetaFileA( + hemfSrc: HENHMETAFILE, + lpszFile: LPCSTR, + ) -> HENHMETAFILE; + pub fn CopyEnhMetaFileW( + hemfSrc: HENHMETAFILE, + lpszFile: LPCWSTR, + ) -> HENHMETAFILE; + pub fn CreateEnhMetaFileA( + hdcRef: HDC, + lpFilename: LPCSTR, + lpRect: *const RECT, + lpDescription: LPCSTR, + ) -> HDC; + pub fn CreateEnhMetaFileW( + hdcRef: HDC, + lpFilename: LPCWSTR, + lpRect: *const RECT, + lpDescription: LPCWSTR, + ) -> HDC; + pub fn DeleteEnhMetaFile( + hmf: HENHMETAFILE, + ) -> BOOL; + pub fn EnumEnhMetaFile( + hdc: HDC, + hmf: HENHMETAFILE, + lpProc: ENHMFENUMPROC, + param: LPVOID, + lpRect: *const RECT, + ) -> BOOL; + pub fn GetEnhMetaFileA( + lpName: LPCSTR, + ) -> HENHMETAFILE; + pub fn GetEnhMetaFileW( + lpName: LPCWSTR, + ) -> HENHMETAFILE; + pub fn GetEnhMetaFileBits( + hEMF: HENHMETAFILE, + nSize: UINT, + lpData: LPBYTE, + ) -> UINT; + pub fn GetEnhMetaFileDescriptionA( + hemf: HENHMETAFILE, + cchBuffer: UINT, + lpDescription: LPSTR, + ) -> UINT; + pub fn GetEnhMetaFileDescriptionW( + hemf: HENHMETAFILE, + cchBuffer: UINT, + lpDescription: LPWSTR, + ) -> UINT; + pub fn GetEnhMetaFileHeader( + hemf: HENHMETAFILE, + nSize: UINT, + lpEnhMetaHeader: LPENHMETAHEADER, + ) -> UINT; + pub fn GetEnhMetaFilePaletteEntries( + hemf: HENHMETAFILE, + nNumEntries: UINT, + lpPaletteEntries: LPPALETTEENTRY, + ) -> UINT; + pub fn GetEnhMetaFilePixelFormat( + hemf: HENHMETAFILE, + cbBuffer: UINT, + ppfd: *mut PIXELFORMATDESCRIPTOR, + ) -> UINT; + pub fn GetWinMetaFileBits( + hemf: HENHMETAFILE, + cbData16: UINT, + pData16: LPBYTE, + iMapMode: INT, + hdcRef: HDC, + ) -> UINT; + pub fn PlayEnhMetaFile( + hdc: HDC, + hmf: HENHMETAFILE, + lprect: *const RECT, + ) -> BOOL; + pub fn PlayEnhMetaFileRecord( + hdc: HDC, + pht: LPHANDLETABLE, + pmr: *const ENHMETARECORD, + cht: UINT, + ) -> BOOL; + pub fn SetEnhMetaFileBits( + nSize: UINT, + pb: *const BYTE, + ) -> HENHMETAFILE; + pub fn SetWinMetaFileBits( + nSize: UINT, + lpMeta16Data: *const BYTE, + hdcRef: HDC, + lpMFP: *const METAFILEPICT, + ) -> HENHMETAFILE; + pub fn GdiComment( + hdc: HDC, + nSize: UINT, + lpData: *const BYTE, + ) -> BOOL; + pub fn GetTextMetricsA( + hdc: HDC, + lptm: LPTEXTMETRICA, + ) -> BOOL; + pub fn GetTextMetricsW( + hdc: HDC, + lptm: *mut TEXTMETRICW, + ) -> BOOL; +} +STRUCT!{struct DIBSECTION { + dsBm: BITMAP, + dsBmih: BITMAPINFOHEADER, + dsBitfields: [DWORD; 3], + dshSection: HANDLE, + dsOffset: DWORD, +}} +pub type PDIBSECTION = *mut DIBSECTION; +pub type LPDIBSECTION = *mut DIBSECTION; +extern "system" { + pub fn AngleArc( + hdc: HDC, + X: c_int, + Y: c_int, + dwRadius: DWORD, + eStartAngle: FLOAT, + eSweepAngle: FLOAT, + ) -> BOOL; + pub fn PolyPolyline( + hdc: HDC, + lppt: *const POINT, + lpdwPolyPoints: *const DWORD, + cCount: DWORD, + ) -> BOOL; + pub fn GetWorldTransform( + hdc: HDC, + lpxf: LPXFORM, + ) -> BOOL; + pub fn SetWorldTransform( + hdc: HDC, + lpxf: *const XFORM, + ) -> BOOL; + pub fn ModifyWorldTransform( + hdc: HDC, + lpxf: *const XFORM, + mode: DWORD, + ) -> BOOL; + pub fn CombineTransform( + lpxformResult: LPXFORM, + lpxform1: *const XFORM, + lpxform2: *const XFORM, + ) -> BOOL; +} +#[inline] +pub fn GDI_WIDTHBYTES(bits: DWORD) -> DWORD { + ((bits + 31) & !31) / 8 +} +#[inline] +pub fn GDI_DIBWIDTHBYTES(bi: &BITMAPINFOHEADER) -> DWORD { + GDI_WIDTHBYTES((bi.biWidth as DWORD) * (bi.biBitCount as DWORD)) +} +#[inline] +pub fn GDI__DIBSIZE(bi: &BITMAPINFOHEADER) -> DWORD { + GDI_DIBWIDTHBYTES(bi) * bi.biHeight as DWORD +} +#[inline] +pub fn GDI_DIBSIZE(bi: &BITMAPINFOHEADER) -> DWORD { + if bi.biHeight < 0 { + GDI__DIBSIZE(bi) * -1i32 as u32 + } else { + GDI__DIBSIZE(bi) + } +} +extern "system" { + pub fn CreateDIBSection( + hdc: HDC, + lpbmi: *const BITMAPINFO, + usage: UINT, + ppvBits: *mut *mut c_void, + hSection: HANDLE, + offset: DWORD, + ) -> HBITMAP; + pub fn GetDIBColorTable( + hdc: HDC, + iStart: UINT, + cEntries: UINT, + prgbq: *mut RGBQUAD, + ) -> UINT; + pub fn SetDIBColorTable( + hdc: HDC, + iStart: UINT, + cEntries: UINT, + prgbq: *const RGBQUAD, + ) -> UINT; +} +pub const CA_NEGATIVE: WORD = 0x0001; +pub const CA_LOG_FILTER: WORD = 0x0002; +pub const ILLUMINANT_DEVICE_DEFAULT: WORD = 0; +pub const ILLUMINANT_A: WORD = 1; +pub const ILLUMINANT_B: WORD = 2; +pub const ILLUMINANT_C: WORD = 3; +pub const ILLUMINANT_D50: WORD = 4; +pub const ILLUMINANT_D55: WORD = 5; +pub const ILLUMINANT_D65: WORD = 6; +pub const ILLUMINANT_D75: WORD = 7; +pub const ILLUMINANT_F2: WORD = 8; +pub const ILLUMINANT_MAX_INDEX: WORD = ILLUMINANT_F2; +pub const ILLUMINANT_TUNGSTEN: WORD = ILLUMINANT_A; +pub const ILLUMINANT_DAYLIGHT: WORD = ILLUMINANT_C; +pub const ILLUMINANT_FLUORESCENT: WORD = ILLUMINANT_F2; +pub const ILLUMINANT_NTSC: WORD = ILLUMINANT_C; +pub const RGB_GAMMA_MIN: WORD = 0o2500; // FIXME It is octal in the headers but are the headers actually right? +pub const RGB_GAMMA_MAX: WORD = 65000; +pub const REFERENCE_WHITE_MIN: WORD = 6000; +pub const REFERENCE_WHITE_MAX: WORD = 10000; +pub const REFERENCE_BLACK_MIN: WORD = 0; +pub const REFERENCE_BLACK_MAX: WORD = 4000; +pub const COLOR_ADJ_MIN: SHORT = -100; +pub const COLOR_ADJ_MAX: SHORT = 100; +STRUCT!{struct COLORADJUSTMENT { + caSize: WORD, + caFlags: WORD, + caIlluminantIndex: WORD, + caRedGamma: WORD, + caGreenGamma: WORD, + caBlueGamma: WORD, + caReferenceBlack: WORD, + caReferenceWhite: WORD, + caContrast: SHORT, + caBrightness: SHORT, + caColorfulness: SHORT, + caRedGreenTint: SHORT, +}} +pub type PCOLORADJUSTMENT = *mut COLORADJUSTMENT; +pub type LPCOLORADJUSTMENT = *mut COLORADJUSTMENT; +extern "system" { + pub fn SetColorAdjustment( + hdc: HDC, + lpca: *const COLORADJUSTMENT, + ) -> BOOL; + pub fn GetColorAdjustment( + hdc: HDC, + lpca: LPCOLORADJUSTMENT, + ) -> BOOL; + pub fn CreateHalftonePalette( + hdc: HDC, + ) -> HPALETTE; +} +FN!{stdcall ABORTPROC( + HDC, + c_int, +) -> BOOL} +STRUCT!{struct DOCINFOA { + cbSize: c_int, + lpszDocName: LPCSTR, + lpszOutput: LPCSTR, + lpszDatatype: LPCSTR, + fwType: DWORD, +}} +pub type LPDOCINFOA = *mut DOCINFOA; +STRUCT!{struct DOCINFOW { + cbSize: c_int, + lpszDocName: LPCWSTR, + lpszOutput: LPCWSTR, + lpszDatatype: LPCWSTR, + fwType: DWORD, +}} +pub type LPDOCINFOW = *mut DOCINFOW; +pub const DI_APPBANDING: DWORD = 0x00000001; +pub const DI_ROPS_READ_DESTINATION: DWORD = 0x00000002; +extern "system" { + pub fn StartDocA( + hdc: HDC, + lpdi: *const DOCINFOA, + ) -> c_int; + pub fn StartDocW( + hdc: HDC, + lpdi: *const DOCINFOW, + ) -> c_int; + pub fn EndDoc( + hdc: HDC, + ) -> c_int; + pub fn StartPage( + hdc: HDC, + ) -> c_int; + pub fn EndPage( + hdc: HDC, + ) -> c_int; + pub fn AbortDoc( + hdc: HDC, + ) -> c_int; + pub fn SetAbortProc( + hdc: HDC, + aproc: ABORTPROC, + ) -> c_int; + pub fn AbortPath( + hdc: HDC, + ) -> BOOL; + pub fn ArcTo( + hdc: HDC, + nLeftRect: c_int, + nTopRect: c_int, + nRightRect: c_int, + nBottomRect: c_int, + nXRadial1: c_int, + nYRadial1: c_int, + nXRadial2: c_int, + nYRadial2: c_int, + ) -> BOOL; + pub fn BeginPath( + hdc: HDC, + ) -> BOOL; + pub fn CloseFigure( + hdc: HDC, + ) -> BOOL; + pub fn EndPath( + hdc: HDC, + ) -> BOOL; + pub fn FillPath( + hdc: HDC, + ) -> BOOL; + pub fn FlattenPath( + hdc: HDC, + ) -> BOOL; + pub fn GetPath( + hdc: HDC, + apt: LPPOINT, + aj: LPBYTE, + cpt: c_int, + ) -> c_int; + pub fn PathToRegion( + hdc: HDC, + ) -> HRGN; + pub fn PolyDraw( + hdc: HDC, + lppt: *const POINT, + lpbTypes: *const BYTE, + cCount: c_int, + ) -> BOOL; + pub fn SelectClipPath( + hdc: HDC, + mode: c_int, + ) -> BOOL; + pub fn SetArcDirection( + hdc: HDC, + ArcDirection: c_int, + ) -> c_int; + pub fn SetMiterLimit( + hdc: HDC, + limit: FLOAT, + old: PFLOAT, + ) -> BOOL; + pub fn StrokeAndFillPath( + hdc: HDC, + ) -> BOOL; + pub fn StrokePath( + hdc: HDC, + ) -> BOOL; + pub fn WidenPath( + hdc: HDC, + ) -> BOOL; + pub fn ExtCreatePen( + iPenStyle: DWORD, + cWidth: DWORD, + plbrush: *const LOGBRUSH, + cStyle: DWORD, + pstyle: *const DWORD, + ) -> HPEN; + pub fn GetMiterLimit( + hdc: HDC, + plimit: PFLOAT, + ) -> BOOL; + pub fn GetArcDirection( + hdc: HDC, + ) -> c_int; + pub fn GetObjectA( + h: HANDLE, + c: c_int, + pv: LPVOID, + ) -> c_int; + pub fn GetObjectW( + h: HANDLE, + c: c_int, + pv: LPVOID, + ) -> c_int; + pub fn MoveToEx( + hdc: HDC, + X: c_int, + Y: c_int, + lpPoint:LPPOINT, + ) -> BOOL; + pub fn TextOutA( + hdc: HDC, + x: c_int, + y: c_int, + lpString: LPCSTR, + c: c_int, + ) -> BOOL; + pub fn TextOutW( + hdc: HDC, + x: c_int, + y: c_int, + lpString: LPCWSTR, + c: c_int, + ) -> BOOL; + pub fn ExtTextOutA( + hdc: HDC, + x: c_int, + y: c_int, + options: UINT, + lprect: *const RECT, + lpString: LPCSTR, + c: UINT, + lpDx: *const INT, + ) -> BOOL; + pub fn ExtTextOutW( + hdc: HDC, + x: c_int, + y: c_int, + options: UINT, + lprect: *const RECT, + lpString: LPCWSTR, + c: UINT, + lpDx: *const INT, + ) -> BOOL; + pub fn PolyTextOutA( + hdc: HDC, + ppt: *const POLYTEXTA, + nstrings: c_int, + ) -> BOOL; + pub fn PolyTextOutW( + hdc: HDC, + ppt: *const POLYTEXTW, + nstrings: c_int, + ) -> BOOL; + pub fn CreatePolygonRgn( + lppt: *const POINT, + cPoints: c_int, + fnPolyFillMode: c_int, + ) -> HRGN; + pub fn DPtoLP( + hdc: HDC, + lppt: *mut POINT, + c: c_int, + ) -> BOOL; + pub fn LPtoDP( + hdc: HDC, + lppt: LPPOINT, + c: c_int, + ) -> BOOL; + pub fn Polygon( + hdc: HDC, + lpPoints: *const POINT, + nCount: c_int, + ) -> BOOL; + pub fn Polyline( + hdc: HDC, + lppt: *const POINT, + cCount: c_int, + ) -> BOOL; + pub fn PolyBezier( + hdc: HDC, + lppt: *const POINT, + cPoints: DWORD, + ) -> BOOL; + pub fn PolyBezierTo( + hdc: HDC, + lppt: *const POINT, + cPoints: DWORD, + ) -> BOOL; + pub fn PolylineTo( + hdc: HDC, + lppt: *const POINT, + cCount: DWORD, + ) -> BOOL; + pub fn SetViewportExtEx( + hdc: HDC, + x: c_int, + y: c_int, + lpsz: LPSIZE, + ) -> BOOL; + pub fn SetViewportOrgEx( + hdc: HDC, + x: c_int, + y: c_int, + lppt: *mut POINT, + ) -> BOOL; + pub fn SetWindowExtEx( + hdc: HDC, + x: c_int, + y: c_int, + lppt: LPSIZE, + ) -> BOOL; + pub fn SetWindowOrgEx( + hdc: HDC, + x: c_int, + y: c_int, + lppt: LPPOINT, + ) -> BOOL; + pub fn OffsetViewportOrgEx( + hdc: HDC, + x: c_int, + y: c_int, + lppt: LPPOINT, + ) -> BOOL; + pub fn OffsetWindowOrgEx( + hdc: HDC, + x: c_int, + y: c_int, + lppt: LPPOINT, + ) -> BOOL; + pub fn ScaleViewportExtEx( + hdc: HDC,xn: c_int, + dx: c_int, + yn: c_int, + yd: c_int, + lpsz: LPSIZE, + ) -> BOOL; + pub fn ScaleWindowExtEx( + hdc: HDC, + xn: c_int, + xd: c_int, + yn: c_int, + yd: c_int, + lpsz: LPSIZE, + ) -> BOOL; + pub fn SetBitmapDimensionEx( + hbm: HBITMAP, + w: c_int, + h: c_int, + lpsz: LPSIZE, + ) -> BOOL; + pub fn SetBrushOrgEx( + hdc: HDC, + x: c_int, + y: c_int, + lppt: LPPOINT, + ) -> BOOL; + pub fn GetTextFaceA( + hdc: HDC, + c: c_int, + lpName: LPSTR, + ) -> c_int; + pub fn GetTextFaceW( + hdc: HDC, + c: c_int, + lpName: LPWSTR, + ) -> c_int; +} +STRUCT!{struct KERNINGPAIR { + wFirst: WORD, + wSecond: WORD, + iKernAmount: c_int, +}} +pub type LPKERNINGPAIR = *mut KERNINGPAIR; +extern "system" { + pub fn GetKerningPairsA( + hdc: HDC, + nPairs: DWORD, + lpKernPair: LPKERNINGPAIR, + ) -> DWORD; + pub fn GetKerningPairsW( + hdc: HDC, + nPairs: DWORD, + lpKernPair: LPKERNINGPAIR, + ) -> DWORD; + pub fn GetDCOrgEx( + hdc: HDC, + lppt: LPPOINT, + ) -> BOOL; + pub fn FixBrushOrgEx( + hdc: HDC, + x: c_int, + y: c_int, + ptl: LPPOINT, + ) -> BOOL; + pub fn UnrealizeObject( + h: HGDIOBJ, + ) -> BOOL; + pub fn GdiFlush() -> BOOL; + pub fn GdiSetBatchLimit( + dw: DWORD, + ) -> DWORD; + pub fn GdiGetBatchLimit() -> DWORD; +} +pub const ICM_OFF: c_int = 1; +pub const ICM_ON: c_int = 2; +pub const ICM_QUERY: c_int = 3; +pub const ICM_DONE_OUTSIDEDC: c_int = 4; +FN!{stdcall ICMENUMPROCA( + LPSTR, + LPARAM, +) -> c_int} +FN!{stdcall ICMENUMPROCW( + LPWSTR, + LPARAM, +) -> c_int} +extern "system" { + pub fn SetICMMode( + hdc: HDC, + mode: c_int, + ) -> c_int; + pub fn CheckColorsInGamut( + hDC: HDC, + lpRGBTriples: LPVOID, + lpBuffer: LPVOID, + nCount: UINT, + ) -> BOOL; + pub fn GetColorSpace( + hdc: HDC, + ) -> HCOLORSPACE; + pub fn GetLogColorSpaceA( + hColorSpace: HCOLORSPACE, + lpBuffer: LPLOGCOLORSPACEA, + nSize: DWORD, + ) -> BOOL; + pub fn GetLogColorSpaceW( + hColorSpace: HCOLORSPACE, + lpBuffer: LPLOGCOLORSPACEW, + nSize: DWORD, + ) -> BOOL; + pub fn CreateColorSpaceA( + lpLogColorSpace: LPLOGCOLORSPACEA, + ) -> HCOLORSPACE; + pub fn CreateColorSpaceW( + lpLogColorSpace: LPLOGCOLORSPACEW, + ) -> HCOLORSPACE; + pub fn SetColorSpace( + hdc: HDC, + hcs: HCOLORSPACE, + ) -> HCOLORSPACE; + pub fn DeleteColorSpace( + hcs: HCOLORSPACE, + ) -> BOOL; + pub fn GetICMProfileA( + hdc: HDC, + pBufSize: LPDWORD, + pszFilename: LPSTR, + ) -> BOOL; + pub fn GetICMProfileW( + hdc: HDC, + pBufSize: LPDWORD, + pszFilename: LPWSTR, + ) -> BOOL; + pub fn SetICMProfileA( + hdc: HDC, + lpFileName: LPSTR, + ) -> BOOL; + pub fn SetICMProfileW( + hdc: HDC, + lpFileName: LPWSTR, + ) -> BOOL; + pub fn GetDeviceGammaRamp( + hdc: HDC, + lpRamp: LPVOID, + ) -> BOOL; + pub fn SetDeviceGammaRamp( + hdc: HDC, + lpRamp: LPVOID, + ) -> BOOL; + pub fn ColorMatchToTarget( + hDC: HDC, + hdcTarget: HDC, + uiAction: UINT, + ) -> BOOL; + pub fn EnumICMProfilesA( + hdc: HDC, + iproc: ICMENUMPROCA, + param: LPARAM, + ) -> c_int; + pub fn EnumICMProfilesW( + hdc: HDC, + iproc: ICMENUMPROCW, + param: LPARAM, + ) -> c_int; + pub fn UpdateICMRegKeyA( + reserved: DWORD, + lpszCMID: LPSTR, + lpszFileName: LPSTR, + command: UINT, + ) -> BOOL; + pub fn UpdateICMRegKeyW( + reserved: DWORD, + lpszCMID: LPWSTR, + lpszFileName: LPWSTR, + command: UINT, + ) -> BOOL; + pub fn ColorCorrectPalette( + hDC: HDC, + hPalette: HPALETTE, + dwFirstEntry: DWORD, + dwNumOfEntries: DWORD, + ) -> BOOL; +} +pub const ENHMETA_SIGNATURE: DWORD = 0x464D4520; +pub const ENHMETA_STOCK_OBJECT: DWORD = 0x80000000; +pub const EMR_HEADER: DWORD = 1; +pub const EMR_POLYBEZIER: DWORD = 2; +pub const EMR_POLYGON: DWORD = 3; +pub const EMR_POLYLINE: DWORD = 4; +pub const EMR_POLYBEZIERTO: DWORD = 5; +pub const EMR_POLYLINETO: DWORD = 6; +pub const EMR_POLYPOLYLINE: DWORD = 7; +pub const EMR_POLYPOLYGON: DWORD = 8; +pub const EMR_SETWINDOWEXTEX: DWORD = 9; +pub const EMR_SETWINDOWORGEX: DWORD = 10; +pub const EMR_SETVIEWPORTEXTEX: DWORD = 11; +pub const EMR_SETVIEWPORTORGEX: DWORD = 12; +pub const EMR_SETBRUSHORGEX: DWORD = 13; +pub const EMR_EOF: DWORD = 14; +pub const EMR_SETPIXELV: DWORD = 15; +pub const EMR_SETMAPPERFLAGS: DWORD = 16; +pub const EMR_SETMAPMODE: DWORD = 17; +pub const EMR_SETBKMODE: DWORD = 18; +pub const EMR_SETPOLYFILLMODE: DWORD = 19; +pub const EMR_SETROP2: DWORD = 20; +pub const EMR_SETSTRETCHBLTMODE: DWORD = 21; +pub const EMR_SETTEXTALIGN: DWORD = 22; +pub const EMR_SETCOLORADJUSTMENT: DWORD = 23; +pub const EMR_SETTEXTCOLOR: DWORD = 24; +pub const EMR_SETBKCOLOR: DWORD = 25; +pub const EMR_OFFSETCLIPRGN: DWORD = 26; +pub const EMR_MOVETOEX: DWORD = 27; +pub const EMR_SETMETARGN: DWORD = 28; +pub const EMR_EXCLUDECLIPRECT: DWORD = 29; +pub const EMR_INTERSECTCLIPRECT: DWORD = 30; +pub const EMR_SCALEVIEWPORTEXTEX: DWORD = 31; +pub const EMR_SCALEWINDOWEXTEX: DWORD = 32; +pub const EMR_SAVEDC: DWORD = 33; +pub const EMR_RESTOREDC: DWORD = 34; +pub const EMR_SETWORLDTRANSFORM: DWORD = 35; +pub const EMR_MODIFYWORLDTRANSFORM: DWORD = 36; +pub const EMR_SELECTOBJECT: DWORD = 37; +pub const EMR_CREATEPEN: DWORD = 38; +pub const EMR_CREATEBRUSHINDIRECT: DWORD = 39; +pub const EMR_DELETEOBJECT: DWORD = 40; +pub const EMR_ANGLEARC: DWORD = 41; +pub const EMR_ELLIPSE: DWORD = 42; +pub const EMR_RECTANGLE: DWORD = 43; +pub const EMR_ROUNDRECT: DWORD = 44; +pub const EMR_ARC: DWORD = 45; +pub const EMR_CHORD: DWORD = 46; +pub const EMR_PIE: DWORD = 47; +pub const EMR_SELECTPALETTE: DWORD = 48; +pub const EMR_CREATEPALETTE: DWORD = 49; +pub const EMR_SETPALETTEENTRIES: DWORD = 50; +pub const EMR_RESIZEPALETTE: DWORD = 51; +pub const EMR_REALIZEPALETTE: DWORD = 52; +pub const EMR_EXTFLOODFILL: DWORD = 53; +pub const EMR_LINETO: DWORD = 54; +pub const EMR_ARCTO: DWORD = 55; +pub const EMR_POLYDRAW: DWORD = 56; +pub const EMR_SETARCDIRECTION: DWORD = 57; +pub const EMR_SETMITERLIMIT: DWORD = 58; +pub const EMR_BEGINPATH: DWORD = 59; +pub const EMR_ENDPATH: DWORD = 60; +pub const EMR_CLOSEFIGURE: DWORD = 61; +pub const EMR_FILLPATH: DWORD = 62; +pub const EMR_STROKEANDFILLPATH: DWORD = 63; +pub const EMR_STROKEPATH: DWORD = 64; +pub const EMR_FLATTENPATH: DWORD = 65; +pub const EMR_WIDENPATH: DWORD = 66; +pub const EMR_SELECTCLIPPATH: DWORD = 67; +pub const EMR_ABORTPATH: DWORD = 68; +pub const EMR_GDICOMMENT: DWORD = 70; +pub const EMR_FILLRGN: DWORD = 71; +pub const EMR_FRAMERGN: DWORD = 72; +pub const EMR_INVERTRGN: DWORD = 73; +pub const EMR_PAINTRGN: DWORD = 74; +pub const EMR_EXTSELECTCLIPRGN: DWORD = 75; +pub const EMR_BITBLT: DWORD = 76; +pub const EMR_STRETCHBLT: DWORD = 77; +pub const EMR_MASKBLT: DWORD = 78; +pub const EMR_PLGBLT: DWORD = 79; +pub const EMR_SETDIBITSTODEVICE: DWORD = 80; +pub const EMR_STRETCHDIBITS: DWORD = 81; +pub const EMR_EXTCREATEFONTINDIRECTW: DWORD = 82; +pub const EMR_EXTTEXTOUTA: DWORD = 83; +pub const EMR_EXTTEXTOUTW: DWORD = 84; +pub const EMR_POLYBEZIER16: DWORD = 85; +pub const EMR_POLYGON16: DWORD = 86; +pub const EMR_POLYLINE16: DWORD = 87; +pub const EMR_POLYBEZIERTO16: DWORD = 88; +pub const EMR_POLYLINETO16: DWORD = 89; +pub const EMR_POLYPOLYLINE16: DWORD = 90; +pub const EMR_POLYPOLYGON16: DWORD = 91; +pub const EMR_POLYDRAW16: DWORD = 92; +pub const EMR_CREATEMONOBRUSH: DWORD = 93; +pub const EMR_CREATEDIBPATTERNBRUSHPT: DWORD = 94; +pub const EMR_EXTCREATEPEN: DWORD = 95; +pub const EMR_POLYTEXTOUTA: DWORD = 96; +pub const EMR_POLYTEXTOUTW: DWORD = 97; +pub const EMR_SETICMMODE: DWORD = 98; +pub const EMR_CREATECOLORSPACE: DWORD = 99; +pub const EMR_SETCOLORSPACE: DWORD = 100; +pub const EMR_DELETECOLORSPACE: DWORD = 101; +pub const EMR_GLSRECORD: DWORD = 102; +pub const EMR_GLSBOUNDEDRECORD: DWORD = 103; +pub const EMR_PIXELFORMAT: DWORD = 104; +pub const EMR_RESERVED_105: DWORD = 105; +pub const EMR_RESERVED_106: DWORD = 106; +pub const EMR_RESERVED_107: DWORD = 107; +pub const EMR_RESERVED_108: DWORD = 108; +pub const EMR_RESERVED_109: DWORD = 109; +pub const EMR_RESERVED_110: DWORD = 110; +pub const EMR_COLORCORRECTPALETTE: DWORD = 111; +pub const EMR_SETICMPROFILEA: DWORD = 112; +pub const EMR_SETICMPROFILEW: DWORD = 113; +pub const EMR_ALPHABLEND: DWORD = 114; +pub const EMR_SETLAYOUT: DWORD = 115; +pub const EMR_TRANSPARENTBLT: DWORD = 116; +pub const EMR_RESERVED_117: DWORD = 117; +pub const EMR_GRADIENTFILL: DWORD = 118; +pub const EMR_RESERVED_119: DWORD = 119; +pub const EMR_RESERVED_120: DWORD = 120; +pub const EMR_COLORMATCHTOTARGETW: DWORD = 121; +pub const EMR_CREATECOLORSPACEW: DWORD = 122; +pub const EMR_MIN: DWORD = 1; +pub const EMR_MAX: DWORD = 122; +STRUCT!{struct EMR { + iType: DWORD, + nSize: DWORD, +}} +pub type PEMR = *mut EMR; +STRUCT!{struct EMRTEXT { + ptlReference: POINTL, + nChars: DWORD, + offString: DWORD, + fOptions: DWORD, + rcl: RECTL, + offDx: DWORD, +}} +pub type PEMRTEXT = *mut EMRTEXT; +STRUCT!{struct EMRABORTPATH { + emr: EMR, +}} +pub type PEMRABORTPATH = *mut EMRABORTPATH; +pub type EMRBEGINPATH = EMRABORTPATH; +pub type PEMRBEGINPATH = *mut EMRABORTPATH; +pub type EMRENDPATH = EMRABORTPATH; +pub type PEMRENDPATH = *mut EMRABORTPATH; +pub type EMRCLOSEFIGURE = EMRABORTPATH; +pub type PEMRCLOSEFIGURE = *mut EMRABORTPATH; +pub type EMRFLATTENPATH = EMRABORTPATH; +pub type PEMRFLATTENPATH = *mut EMRABORTPATH; +pub type EMRWIDENPATH = EMRABORTPATH; +pub type PEMRWIDENPATH = *mut EMRABORTPATH; +pub type EMRSETMETARGN = EMRABORTPATH; +pub type PEMRSETMETARGN = *mut EMRABORTPATH; +pub type EMRSAVEDC = EMRABORTPATH; +pub type PEMRSAVEDC = *mut EMRABORTPATH; +pub type EMRREALIZEPALETTE = EMRABORTPATH; +pub type PEMRREALIZEPALETTE = *mut EMRABORTPATH; +STRUCT!{struct EMRSELECTCLIPPATH { + emr: EMR, + iMode: DWORD, +}} +pub type PEMRSELECTCLIPPATH = *mut EMRSELECTCLIPPATH; +pub type EMRSETBKMODE = EMRSELECTCLIPPATH; +pub type PEMRSETBKMODE = *mut EMRSELECTCLIPPATH; +pub type EMRSETMAPMODE = EMRSELECTCLIPPATH; +pub type PEMRSETMAPMODE = *mut EMRSELECTCLIPPATH; +pub type EMRSETLAYOUT = EMRSELECTCLIPPATH; +pub type PEMRSETLAYOUT = *mut EMRSELECTCLIPPATH; +pub type EMRSETPOLYFILLMODE = EMRSELECTCLIPPATH; +pub type PEMRSETPOLYFILLMODE = *mut EMRSELECTCLIPPATH; +pub type EMRSETROP2 = EMRSELECTCLIPPATH; +pub type PEMRSETROP2 = *mut EMRSELECTCLIPPATH; +pub type EMRSETSTRETCHBLTMODE = EMRSELECTCLIPPATH; +pub type PEMRSETSTRETCHBLTMODE = *mut EMRSELECTCLIPPATH; +pub type EMRSETICMMODE = EMRSELECTCLIPPATH; +pub type PEMRSETICMMODE = *mut EMRSELECTCLIPPATH; +pub type EMRSETTEXTALIGN = EMRSELECTCLIPPATH; +pub type PEMRSETTEXTALIGN = *mut EMRSELECTCLIPPATH; +STRUCT!{struct EMRSETMITERLIMIT { + emr: EMR, + eMiterLimit: FLOAT, +}} +pub type PEMRSETMITERLIMIT = *mut EMRSETMITERLIMIT; +STRUCT!{struct EMRRESTOREDC { + emr: EMR, + iRelative: LONG, +}} +pub type PEMRRESTOREDC = *mut EMRRESTOREDC; +STRUCT!{struct EMRSETARCDIRECTION { + emr: EMR, + iArcDirection: DWORD, +}} +pub type PEMRSETARCDIRECTION = *mut EMRSETARCDIRECTION; +STRUCT!{struct EMRSETMAPPERFLAGS { + emr: EMR, + dwFlags: DWORD, +}} +pub type PEMRSETMAPPERFLAGS = *mut EMRSETMAPPERFLAGS; +STRUCT!{struct EMRSETBKCOLOR { + emr: EMR, + crColor: COLORREF, +}} +pub type PEMRSETBKCOLOR = *mut EMRSETBKCOLOR; +pub type EMRSETTEXTCOLOR = EMRSETBKCOLOR; +pub type PEMRSETTEXTCOLOR = *mut EMRSETBKCOLOR; +STRUCT!{struct EMRSELECTOBJECT { + emr: EMR, + ihObject: DWORD, +}} +pub type PEMRSELECTOBJECT = *mut EMRSELECTOBJECT; +pub type EMRDELETEOBJECT = EMRSELECTOBJECT; +pub type PEMRDELETEOBJECT = *mut EMRSELECTOBJECT; +STRUCT!{struct EMRSELECTPALETTE { + emr: EMR, + ihPal: DWORD, +}} +pub type PEMRSELECTPALETTE = *mut EMRSELECTPALETTE; +STRUCT!{struct EMRRESIZEPALETTE { + emr: EMR, + ihPal: DWORD, + cEntries: DWORD, +}} +pub type PEMRRESIZEPALETTE = *mut EMRRESIZEPALETTE; +STRUCT!{struct EMRSETPALETTEENTRIES { + emr: EMR, + ihPal: DWORD, + iStart: DWORD, + cEntries: DWORD, + aPalEntries: [PALETTEENTRY; 1], +}} +pub type PEMRSETPALETTEENTRIES = *mut EMRSETPALETTEENTRIES; +STRUCT!{struct EMRSETCOLORADJUSTMENT { + emr: EMR, + ColorAdjustment: COLORADJUSTMENT, +}} +pub type PEMRSETCOLORADJUSTMENT = *mut EMRSETCOLORADJUSTMENT; +STRUCT!{struct EMRGDICOMMENT { + emr: EMR, + cbData: DWORD, + Data: [BYTE; 1], +}} +pub type PEMRGDICOMMENT = *mut EMRGDICOMMENT; +STRUCT!{struct EMREOF { + emr: EMR, + nPalEntries: DWORD, + offPalEntries: DWORD, + nSizeLast: DWORD, +}} +pub type PEMREOF = *mut EMREOF; +STRUCT!{struct EMRLINETO { + emr: EMR, + ptl: POINTL, +}} +pub type PEMRLINETO = *mut EMRLINETO; +pub type EMRMOVETOEX = EMRLINETO; +pub type PEMRMOVETOEX = *mut EMRLINETO; +STRUCT!{struct EMROFFSETCLIPRGN { + emr: EMR, + ptlOffset: POINTL, +}} +pub type PEMROFFSETCLIPRGN = *mut EMROFFSETCLIPRGN; +STRUCT!{struct EMRFILLPATH { + emr: EMR, + rclBounds: RECTL, +}} +pub type PEMRFILLPATH = *mut EMRFILLPATH; +pub type EMRSTROKEANDFILLPATH = EMRFILLPATH; +pub type PEMRSTROKEANDFILLPATH = *mut EMRFILLPATH; +pub type EMRSTROKEPATH = EMRFILLPATH; +pub type PEMRSTROKEPATH = *mut EMRFILLPATH; +STRUCT!{struct EMREXCLUDECLIPRECT { + emr: EMR, + rclClip: RECTL, +}} +pub type PEMREXCLUDECLIPRECT = *mut EMREXCLUDECLIPRECT; +pub type EMRINTERSECTCLIPRECT = EMREXCLUDECLIPRECT; +pub type PEMRINTERSECTCLIPRECT = *mut EMREXCLUDECLIPRECT; +STRUCT!{struct EMRSETVIEWPORTORGEX { + emr: EMR, + ptlOrigin: POINTL, +}} +pub type PEMRSETVIEWPORTORGEX = *mut EMRSETVIEWPORTORGEX; +pub type EMRSETWINDOWORGEX = EMRSETVIEWPORTORGEX; +pub type PEMRSETWINDOWORGEX = *mut EMRSETVIEWPORTORGEX; +pub type EMRSETBRUSHORGEX = EMRSETVIEWPORTORGEX; +pub type PEMRSETBRUSHORGEX = *mut EMRSETVIEWPORTORGEX; +STRUCT!{struct EMRSETVIEWPORTEXTEX { + emr: EMR, + szlExtent: SIZEL, +}} +pub type PEMRSETVIEWPORTEXTEX = *mut EMRSETVIEWPORTEXTEX; +pub type EMRSETWINDOWEXTEX = EMRSETVIEWPORTEXTEX; +pub type PEMRSETWINDOWEXTEX = *mut EMRSETVIEWPORTEXTEX; +STRUCT!{struct EMRSCALEVIEWPORTEXTEX { + emr: EMR, + xNum: LONG, + xDenom: LONG, + yNum: LONG, + yDenom: LONG, +}} +pub type PEMRSCALEVIEWPORTEXTEX = *mut EMRSCALEVIEWPORTEXTEX; +pub type EMRSCALEWINDOWEXTEX = EMRSCALEVIEWPORTEXTEX; +pub type PEMRSCALEWINDOWEXTEX = *mut EMRSCALEVIEWPORTEXTEX; +STRUCT!{struct EMRSETWORLDTRANSFORM { + emr: EMR, + xform: XFORM, +}} +pub type PEMRSETWORLDTRANSFORM = *mut EMRSETWORLDTRANSFORM; +STRUCT!{struct EMRMODIFYWORLDTRANSFORM { + emr: EMR, + xform: XFORM, + iMode: DWORD, +}} +pub type PEMRMODIFYWORLDTRANSFORM = *mut EMRMODIFYWORLDTRANSFORM; +STRUCT!{struct EMRSETPIXELV { + emr: EMR, + ptlPixel: POINTL, + crColor: COLORREF, +}} +pub type PEMRSETPIXELV = *mut EMRSETPIXELV; +STRUCT!{struct EMREXTFLOODFILL { + emr: EMR, + ptlStart: POINTL, + crColor: COLORREF, + iMode: DWORD, +}} +pub type PEMREXTFLOODFILL = *mut EMREXTFLOODFILL; +STRUCT!{struct EMRELLIPSE { + emr: EMR, + rclBox: RECTL, +}} +pub type PEMRELLIPSE = *mut EMRELLIPSE; +pub type EMRRECTANGLE = EMRELLIPSE; +pub type PEMRRECTANGLE = *mut EMRELLIPSE; +STRUCT!{struct EMRROUNDRECT { + emr: EMR, + rclBox: RECTL, + szlCorner: SIZEL, +}} +pub type PEMRROUNDRECT = *mut EMRROUNDRECT; +STRUCT!{struct EMRARC { + emr: EMR, + rclBox: RECTL, + ptlStart: POINTL, + ptlEnd: POINTL, +}} +pub type PEMRARC = *mut EMRARC; +pub type EMRARCTO = EMRARC; +pub type PEMRARCTO = *mut EMRARC; +pub type EMRCHORD = EMRARC; +pub type PEMRCHORD = *mut EMRARC; +pub type EMRPIE = EMRARC; +pub type PEMRPIE = *mut EMRARC; +STRUCT!{struct EMRANGLEARC { + emr: EMR, + ptlCenter: POINTL, + nRadius: DWORD, + eStartAngle: FLOAT, + eSweepAngle: FLOAT, +}} +pub type PEMRANGLEARC = *mut EMRANGLEARC; +STRUCT!{struct EMRPOLYLINE { + emr: EMR, + rclBounds: RECTL, + cptl: DWORD, + aptl: [POINTL; 1], +}} +pub type PEMRPOLYLINE = *mut EMRPOLYLINE; +pub type EMRPOLYBEZIER = EMRPOLYLINE; +pub type PEMRPOLYBEZIER = *mut EMRPOLYLINE; +pub type EMRPOLYGON = EMRPOLYLINE; +pub type PEMRPOLYGON = *mut EMRPOLYLINE; +pub type EMRPOLYBEZIERTO = EMRPOLYLINE; +pub type PEMRPOLYBEZIERTO = *mut EMRPOLYLINE; +pub type EMRPOLYLINETO = EMRPOLYLINE; +pub type PEMRPOLYLINETO = *mut EMRPOLYLINE; +STRUCT!{struct EMRPOLYLINE16 { + emr: EMR, + rclBounds: RECTL, + cpts: DWORD, + apts: [POINTS; 1], +}} +pub type PEMRPOLYLINE16 = *mut EMRPOLYLINE16; +pub type EMRPOLYBEZIER16 = EMRPOLYLINE16; +pub type PEMRPOLYBEZIER16 = *mut EMRPOLYLINE16; +pub type EMRPOLYGON16 = EMRPOLYLINE16; +pub type PEMRPOLYGON16 = *mut EMRPOLYLINE16; +pub type EMRPOLYBEZIERTO16 = EMRPOLYLINE16; +pub type PEMRPOLYBEZIERTO16 = *mut EMRPOLYLINE16; +pub type EMRPOLYLINETO16 = EMRPOLYLINE16; +pub type PEMRPOLYLINETO16 = *mut EMRPOLYLINE16; +STRUCT!{struct EMRPOLYDRAW { + emr: EMR, + rclBounds: RECTL, + cptl: DWORD, + aptl: [POINTL; 1], + abTypes: [BYTE; 1], +}} +pub type PEMRPOLYDRAW = *mut EMRPOLYDRAW; +STRUCT!{struct EMRPOLYDRAW16 { + emr: EMR, + rclBounds: RECTL, + cpts: DWORD, + apts: [POINTS; 1], + abTypes: [BYTE; 1], +}} +pub type PEMRPOLYDRAW16 = *mut EMRPOLYDRAW16; +STRUCT!{struct EMRPOLYPOLYLINE { + emr: EMR, + rclBounds: RECTL, + nPolys: DWORD, + cptl: DWORD, + aPolyCounts: [DWORD; 1], + aptl: [POINTL; 1], +}} +pub type PEMRPOLYPOLYLINE = *mut EMRPOLYPOLYLINE; +pub type EMRPOLYPOLYGON = EMRPOLYPOLYLINE; +pub type PEMRPOLYPOLYGON = *mut EMRPOLYPOLYLINE; +STRUCT!{struct EMRPOLYPOLYLINE16 { + emr: EMR, + rclBounds: RECTL, + nPolys: DWORD, + cpts: DWORD, + aPolyCounts: [DWORD; 1], + apts: [POINTS; 1], +}} +pub type PEMRPOLYPOLYLINE16 = *mut EMRPOLYPOLYLINE16; +pub type EMRPOLYPOLYGON16 = EMRPOLYPOLYLINE16; +pub type PEMRPOLYPOLYGON16 = *mut EMRPOLYPOLYLINE16; +STRUCT!{struct EMRINVERTRGN { + emr: EMR, + rclBounds: RECTL, + cbRgnData: DWORD, + RgnData: [BYTE; 1], +}} +pub type PEMRINVERTRGN = *mut EMRINVERTRGN; +pub type EMRPAINTRGN = EMRINVERTRGN; +pub type PEMRPAINTRGN = *mut EMRINVERTRGN; +STRUCT!{struct EMRFILLRGN { + emr: EMR, + rclBounds: RECTL, + cbRgnData: DWORD, + ihBrush: DWORD, + RgnData: [BYTE; 1], +}} +pub type PEMRFILLRGN = *mut EMRFILLRGN; +STRUCT!{struct EMRFRAMERGN { + emr: EMR, + rclBounds: RECTL, + cbRgnData: DWORD, + ihBrush: DWORD, + szlStroke: SIZEL, + RgnData: [BYTE; 1], +}} +pub type PEMRFRAMERGN = *mut EMRFRAMERGN; +STRUCT!{struct EMREXTSELECTCLIPRGN { + emr: EMR, + cbRgnData: DWORD, + iMode: DWORD, + RgnData: [BYTE; 1], +}} +pub type PEMREXTSELECTCLIPRGN = *mut EMREXTSELECTCLIPRGN; +STRUCT!{struct EMREXTTEXTOUTA { + emr: EMR, + rclBounds: RECTL, + iGraphicsMode: DWORD, + exScale: FLOAT, + eyScale: FLOAT, + emrtext: EMRTEXT, +}} +pub type PEMREXTTEXTOUTA = *mut EMREXTTEXTOUTA; +pub type EMREXTTEXTOUTW = EMREXTTEXTOUTA; +pub type PEMREXTTEXTOUTW = *mut EMREXTTEXTOUTA; +STRUCT!{struct EMRPOLYTEXTOUTA { + emr: EMR, + rclBounds: RECTL, + iGraphicsMode: DWORD, + exScale: FLOAT, + eyScale: FLOAT, + cStrings: LONG, + aemrtext: [EMRTEXT; 1], +}} +pub type PEMRPOLYTEXTOUTA = *mut EMRPOLYTEXTOUTA; +pub type EMRPOLYTEXTOUTW = EMRPOLYTEXTOUTA; +pub type PEMRPOLYTEXTOUTW = *mut EMRPOLYTEXTOUTA; +STRUCT!{struct EMRBITBLT { + emr: EMR, + rclBounds: RECTL, + xDest: LONG, + yDest: LONG, + cxDest: LONG, + cyDest: LONG, + dwRop: DWORD, + xSrc: LONG, + ySrc: LONG, + xformSrc: XFORM, + crBkColorSrc: COLORREF, + iUsageSrc: DWORD, + offBmiSrc: DWORD, + cbBmiSrc: DWORD, + offBitsSrc: DWORD, + cbBitsSrc: DWORD, +}} +pub type PEMRBITBLT = *mut EMRBITBLT; +STRUCT!{struct EMRSTRETCHBLT { + emr: EMR, + rclBounds: RECTL, + xDest: LONG, + yDest: LONG, + cxDest: LONG, + cyDest: LONG, + dwRop: DWORD, + xSrc: LONG, + ySrc: LONG, + xformSrc: XFORM, + crBkColorSrc: COLORREF, + iUsageSrc: DWORD, + offBmiSrc: DWORD, + cbBmiSrc: DWORD, + offBitsSrc: DWORD, + cbBitsSrc: DWORD, + cxSrc: LONG, + cySrc: LONG, +}} +pub type PEMRSTRETCHBLT = *mut EMRSTRETCHBLT; +STRUCT!{struct EMRMASKBLT { + emr: EMR, + rclBounds: RECTL, + xDest: LONG, + yDest: LONG, + cxDest: LONG, + cyDest: LONG, + dwRop: DWORD, + xSrc: LONG, + ySrc: LONG, + xformSrc: XFORM, + crBkColorSrc: COLORREF, + iUsageSrc: DWORD, + offBmiSrc: DWORD, + cbBmiSrc: DWORD, + offBitsSrc: DWORD, + cbBitsSrc: DWORD, + xMask: LONG, + yMask: LONG, + iUsageMask: DWORD, + offBmiMask: DWORD, + cbBmiMask: DWORD, + offBitsMask: DWORD, + cbBitsMask: DWORD, +}} +pub type PEMRMASKBLT = *mut EMRMASKBLT; +STRUCT!{struct EMRPLGBLT { + emr: EMR, + rclBounds: RECTL, + aptlDest: [POINTL; 3], + xSrc: LONG, + ySrc: LONG, + cxSrc: LONG, + cySrc: LONG, + xformSrc: XFORM, + crBkColorSrc: COLORREF, + iUsageSrc: DWORD, + offBmiSrc: DWORD, + cbBmiSrc: DWORD, + offBitsSrc: DWORD, + cbBitsSrc: DWORD, + xMask: LONG, + yMask: LONG, + iUsageMask: DWORD, + offBmiMask: DWORD, + cbBmiMask: DWORD, + offBitsMask: DWORD, + cbBitsMask: DWORD, +}} +pub type PEMRPLGBLT = *mut EMRPLGBLT; +STRUCT!{struct EMRSETDIBITSTODEVICE { + emr: EMR, + rclBounds: RECTL, + xDest: LONG, + yDest: LONG, + xSrc: LONG, + ySrc: LONG, + cxSrc: LONG, + cySrc: LONG, + offBmiSrc: DWORD, + cbBmiSrc: DWORD, + offBitsSrc: DWORD, + cbBitsSrc: DWORD, + iUsageSrc: DWORD, + iStartScan: DWORD, + cScans: DWORD, +}} +pub type PEMRSETDIBITSTODEVICE = *mut EMRSETDIBITSTODEVICE; +STRUCT!{struct EMRSTRETCHDIBITS { + emr: EMR, + rclBounds: RECTL, + xDest: LONG, + yDest: LONG, + xSrc: LONG, + ySrc: LONG, + cxSrc: LONG, + cySrc: LONG, + offBmiSrc: DWORD, + cbBmiSrc: DWORD, + offBitsSrc: DWORD, + cbBitsSrc: DWORD, + iUsageSrc: DWORD, + dwRop: DWORD, + cxDest: LONG, + cyDest: LONG, +}} +pub type PEMRSTRETCHDIBITS = *mut EMRSTRETCHDIBITS; +STRUCT!{struct EMREXTCREATEFONTINDIRECTW { + emr: EMR, + ihFont: DWORD, + elfw: EXTLOGFONTW, +}} +pub type PEMREXTCREATEFONTINDIRECTW = *mut EMREXTCREATEFONTINDIRECTW; +STRUCT!{struct EMRCREATEPALETTE { + emr: EMR, + ihPal: DWORD, + lgpl: LOGPALETTE, +}} +pub type PEMRCREATEPALETTE = *mut EMRCREATEPALETTE; +STRUCT!{struct EMRCREATEPEN { + emr: EMR, + ihPen: DWORD, + lopn: LOGPEN, +}} +pub type PEMRCREATEPEN = *mut EMRCREATEPEN; +STRUCT!{struct EMREXTCREATEPEN { + emr: EMR, + ihPen: DWORD, + offBmi: DWORD, + cbBmi: DWORD, + offBits: DWORD, + cbBits: DWORD, + elp: EXTLOGPEN32, +}} +pub type PEMREXTCREATEPEN = *mut EMREXTCREATEPEN; +STRUCT!{struct EMRCREATEBRUSHINDIRECT { + emr: EMR, + ihBrush: DWORD, + lb: LOGBRUSH32, +}} +pub type PEMRCREATEBRUSHINDIRECT = *mut EMRCREATEBRUSHINDIRECT; +STRUCT!{struct EMRCREATEMONOBRUSH { + emr: EMR, + ihBrush: DWORD, + iUsage: DWORD, + offBmi: DWORD, + cbBmi: DWORD, + offBits: DWORD, + cbBits: DWORD, +}} +pub type PEMRCREATEMONOBRUSH = *mut EMRCREATEMONOBRUSH; +STRUCT!{struct EMRCREATEDIBPATTERNBRUSHPT { + emr: EMR, + ihBrush: DWORD, + iUsage: DWORD, + offBmi: DWORD, + cbBmi: DWORD, + offBits: DWORD, + cbBits: DWORD, +}} +pub type PEMRCREATEDIBPATTERNBRUSHPT = *mut EMRCREATEDIBPATTERNBRUSHPT; +STRUCT!{struct EMRFORMAT { + dSignature: DWORD, + nVersion: DWORD, + cbData: DWORD, + offData: DWORD, +}} +pub type PEMRFORMAT = *mut EMRFORMAT; +STRUCT!{struct EMRGLSRECORD { + emr: EMR, + cbData: DWORD, + Data: [BYTE; 1], +}} +pub type PEMRGLSRECORD = *mut EMRGLSRECORD; +STRUCT!{struct EMRGLSBOUNDEDRECORD { + emr: EMR, + rclBounds: RECTL, + cbData: DWORD, + Data: [BYTE; 1], +}} +pub type PEMRGLSBOUNDEDRECORD = *mut EMRGLSBOUNDEDRECORD; +STRUCT!{struct EMRPIXELFORMAT { + emr: EMR, + pfd: PIXELFORMATDESCRIPTOR, +}} +pub type PEMRPIXELFORMAT = *mut EMRPIXELFORMAT; +STRUCT!{struct EMRCREATECOLORSPACE { + emr: EMR, + ihCS: DWORD, + lcs: LOGCOLORSPACEA, +}} +pub type PEMRCREATECOLORSPACE = *mut EMRCREATECOLORSPACE; +STRUCT!{struct EMRSETCOLORSPACE { + emr: EMR, + ihCS: DWORD, +}} +pub type PEMRSETCOLORSPACE = *mut EMRSETCOLORSPACE; +pub type EMRSELECTCOLORSPACE = EMRSETCOLORSPACE; +pub type PEMRSELECTCOLORSPACE = *mut EMRSETCOLORSPACE; +pub type EMRDELETECOLORSPACE = EMRSETCOLORSPACE; +pub type PEMRDELETECOLORSPACE = *mut EMRSETCOLORSPACE; +STRUCT!{struct EMREXTESCAPE { + emr: EMR, + iEscape: INT, + cbEscData: INT, + EscData: [BYTE; 1], +}} +pub type PEMREXTESCAPE = *mut EMREXTESCAPE; +pub type EMRDRAWESCAPE = EMREXTESCAPE; +pub type PEMRDRAWESCAPE = *mut EMREXTESCAPE; +STRUCT!{struct EMRNAMEDESCAPE { + emr: EMR, + iEscape: INT, + cbDriver: INT, + cbEscData: INT, + EscData: [BYTE; 1], +}} +pub type PEMRNAMEDESCAPE = *mut EMRNAMEDESCAPE; +pub const SETICMPROFILE_EMBEDED: DWORD = 0x00000001; +STRUCT!{struct EMRSETICMPROFILE { + emr: EMR, + dwFlags: DWORD, + cbName: DWORD, + cbData: DWORD, + Data: [BYTE; 1], +}} +pub type PEMRSETICMPROFILE = *mut EMRSETICMPROFILE; +pub type EMRSETICMPROFILEA = EMRSETICMPROFILE; +pub type PEMRSETICMPROFILEA = *mut EMRSETICMPROFILE; +pub type EMRSETICMPROFILEW = EMRSETICMPROFILE; +pub type PEMRSETICMPROFILEW = *mut EMRSETICMPROFILE; +pub const CREATECOLORSPACE_EMBEDED: DWORD = 0x00000001; +STRUCT!{struct EMRCREATECOLORSPACEW { + emr: EMR, + ihCS: DWORD, + lcs: LOGCOLORSPACEW, + dwFlags: DWORD, + cbData: DWORD, + Data: [BYTE; 1], +}} +pub type PEMRCREATECOLORSPACEW = *mut EMRCREATECOLORSPACEW; +pub const COLORMATCHTOTARGET_EMBEDED: DWORD = 0x00000001; +STRUCT!{struct EMRCOLORMATCHTOTARGET { + emr: EMR, + dwAction: DWORD, + dwFlags: DWORD, + cbName: DWORD, + cbData: DWORD, + Data: [BYTE; 1], +}} +pub type PEMRCOLORMATCHTOTARGET = *mut EMRCOLORMATCHTOTARGET; +STRUCT!{struct EMRCOLORCORRECTPALETTE { + emr: EMR, + ihPalette: DWORD, + nFirstEntry: DWORD, + nPalEntries: DWORD, + nReserved: DWORD, +}} +pub type PEMRCOLORCORRECTPALETTE = *mut EMRCOLORCORRECTPALETTE; +STRUCT!{struct EMRALPHABLEND { + emr: EMR, + rclBounds: RECTL, + xDest: LONG, + yDest: LONG, + cxDest: LONG, + cyDest: LONG, + dwRop: DWORD, + xSrc: LONG, + ySrc: LONG, + xformSrc: XFORM, + crBkColorSrc: COLORREF, + iUsageSrc: DWORD, + offBmiSrc: DWORD, + cbBmiSrc: DWORD, + offBitsSrc: DWORD, + cbBitsSrc: DWORD, + cxSrc: LONG, + cySrc: LONG, +}} +pub type PEMRALPHABLEND = *mut EMRALPHABLEND; +STRUCT!{struct EMRGRADIENTFILL { + emr: EMR, + rclBounds: RECTL, + nVer: DWORD, + nTri: DWORD, + ulMode: ULONG, + Ver: [TRIVERTEX; 1], +}} +pub type PEMRGRADIENTFILL = *mut EMRGRADIENTFILL; +STRUCT!{struct EMRTRANSPARENTBLT { + emr: EMR, + rclBounds: RECTL, + xDest: LONG, + yDest: LONG, + cxDest: LONG, + cyDest: LONG, + dwRop: DWORD, + xSrc: LONG, + ySrc: LONG, + xformSrc: XFORM, + crBkColorSrc: COLORREF, + iUsageSrc: DWORD, + offBmiSrc: DWORD, + cbBmiSrc: DWORD, + offBitsSrc: DWORD, + cbBitsSrc: DWORD, + cxSrc: LONG, + cySrc: LONG, +}} +pub type PEMRTRANSPARENTBLT = *mut EMRTRANSPARENTBLT; +pub const GDICOMMENT_IDENTIFIER: DWORD = 0x43494447; +pub const GDICOMMENT_WINDOWS_METAFILE: DWORD = 0x80000001; +pub const GDICOMMENT_BEGINGROUP: DWORD = 0x00000002; +pub const GDICOMMENT_ENDGROUP: DWORD = 0x00000003; +pub const GDICOMMENT_MULTIFORMATS: DWORD = 0x40000004; +pub const EPS_SIGNATURE: DWORD = 0x46535045; +pub const GDICOMMENT_UNICODE_STRING: DWORD = 0x00000040; +pub const GDICOMMENT_UNICODE_END: DWORD = 0x00000080; +extern "system" { + pub fn wglCopyContext( + hglrcSrc: HGLRC, + hglrcDst: HGLRC, + mask: UINT, + ) -> BOOL; + pub fn wglCreateContext( + hdc: HDC, + ) -> HGLRC; + pub fn wglCreateLayerContext( + hdc: HDC, + iLayerPlane: c_int, + ) -> HGLRC; + pub fn wglDeleteContext( + hglrc: HGLRC, + ) -> BOOL; + pub fn wglGetCurrentContext() -> HGLRC; + pub fn wglGetCurrentDC() -> HDC; + pub fn wglGetProcAddress( + lpszProc: LPCSTR, + ) -> PROC; + pub fn wglMakeCurrent( + hdc: HDC, + hglrc: HGLRC, + ) -> BOOL; + pub fn wglShareLists( + hglrc1: HGLRC, + hglrc2: HGLRC, + ) -> BOOL; + pub fn wglUseFontBitmapsA( + hdc: HDC, + first: DWORD, + count: DWORD, + listBase: DWORD, + ) -> BOOL; + pub fn wglUseFontBitmapsW( + hdc: HDC, + first: DWORD, + count: DWORD, + listBase: DWORD, + ) -> BOOL; + pub fn SwapBuffers( + hdc: HDC, + ) -> BOOL; +} +STRUCT!{struct POINTFLOAT { + x: FLOAT, + y: FLOAT, +}} +pub type PPOINTFLOAT = *mut POINTFLOAT; +STRUCT!{struct GLYPHMETRICSFLOAT { + gmfBlackBoxX: FLOAT, + gmfBlackBoxY: FLOAT, + gmfptGlyphOrigin: POINTFLOAT, + gmfCellIncX: FLOAT, + gmfCellIncY: FLOAT, +}} +pub type PGLYPHMETRICSFLOAT = *mut GLYPHMETRICSFLOAT; +pub type LPGLYPHMETRICSFLOAT = *mut GLYPHMETRICSFLOAT; +pub const WGL_FONT_LINES: DWORD = 0; +pub const WGL_FONT_POLYGONS: DWORD = 1; +extern "system" { + pub fn wglUseFontOutlinesA( + hdc: HDC, + first: DWORD, + count: DWORD, + listBase: DWORD, + deviation: FLOAT, + extrusion: FLOAT, + format: c_int, + lpgmf: LPGLYPHMETRICSFLOAT, + ) -> BOOL; + pub fn wglUseFontOutlinesW( + hdc: HDC, + first: DWORD, + count: DWORD, + listBase: DWORD, + deviation: FLOAT, + extrusion: FLOAT, + format: c_int, + lpgmf: LPGLYPHMETRICSFLOAT, + ) -> BOOL; +} +STRUCT!{struct LAYERPLANEDESCRIPTOR { + nSize: WORD, + nVersion: WORD, + dwFlags: DWORD, + iPixelType: BYTE, + cColorBits: BYTE, + cRedBits: BYTE, + cRedShift: BYTE, + cGreenBits: BYTE, + cGreenShift: BYTE, + cBlueBits: BYTE, + cBlueShift: BYTE, + cAlphaBits: BYTE, + cAlphaShift: BYTE, + cAccumBits: BYTE, + cAccumRedBits: BYTE, + cAccumGreenBits: BYTE, + cAccumBlueBits: BYTE, + cAccumAlphaBits: BYTE, + cDepthBits: BYTE, + cStencilBits: BYTE, + cAuxBuffers: BYTE, + iLayerPlane: BYTE, + bReserved: BYTE, + crTransparent: COLORREF, +}} +pub type PLAYERPLANEDESCRIPTOR = *mut LAYERPLANEDESCRIPTOR; +pub type LPLAYERPLANEDESCRIPTOR = *mut LAYERPLANEDESCRIPTOR; +pub const LPD_DOUBLEBUFFER: DWORD = 0x00000001; +pub const LPD_STEREO: DWORD = 0x00000002; +pub const LPD_SUPPORT_GDI: DWORD = 0x00000010; +pub const LPD_SUPPORT_OPENGL: DWORD = 0x00000020; +pub const LPD_SHARE_DEPTH: DWORD = 0x00000040; +pub const LPD_SHARE_STENCIL: DWORD = 0x00000080; +pub const LPD_SHARE_ACCUM: DWORD = 0x00000100; +pub const LPD_SWAP_EXCHANGE: DWORD = 0x00000200; +pub const LPD_SWAP_COPY: DWORD = 0x00000400; +pub const LPD_TRANSPARENT: DWORD = 0x00001000; +pub const LPD_TYPE_RGBA: BYTE = 0; +pub const LPD_TYPE_COLORINDEX: BYTE = 1; +pub const WGL_SWAP_MAIN_PLANE: UINT = 0x00000001; +pub const WGL_SWAP_OVERLAY1: UINT = 0x00000002; +pub const WGL_SWAP_OVERLAY2: UINT = 0x00000004; +pub const WGL_SWAP_OVERLAY3: UINT = 0x00000008; +pub const WGL_SWAP_OVERLAY4: UINT = 0x00000010; +pub const WGL_SWAP_OVERLAY5: UINT = 0x00000020; +pub const WGL_SWAP_OVERLAY6: UINT = 0x00000040; +pub const WGL_SWAP_OVERLAY7: UINT = 0x00000080; +pub const WGL_SWAP_OVERLAY8: UINT = 0x00000100; +pub const WGL_SWAP_OVERLAY9: UINT = 0x00000200; +pub const WGL_SWAP_OVERLAY10: UINT = 0x00000400; +pub const WGL_SWAP_OVERLAY11: UINT = 0x00000800; +pub const WGL_SWAP_OVERLAY12: UINT = 0x00001000; +pub const WGL_SWAP_OVERLAY13: UINT = 0x00002000; +pub const WGL_SWAP_OVERLAY14: UINT = 0x00004000; +pub const WGL_SWAP_OVERLAY15: UINT = 0x00008000; +pub const WGL_SWAP_UNDERLAY1: UINT = 0x00010000; +pub const WGL_SWAP_UNDERLAY2: UINT = 0x00020000; +pub const WGL_SWAP_UNDERLAY3: UINT = 0x00040000; +pub const WGL_SWAP_UNDERLAY4: UINT = 0x00080000; +pub const WGL_SWAP_UNDERLAY5: UINT = 0x00100000; +pub const WGL_SWAP_UNDERLAY6: UINT = 0x00200000; +pub const WGL_SWAP_UNDERLAY7: UINT = 0x00400000; +pub const WGL_SWAP_UNDERLAY8: UINT = 0x00800000; +pub const WGL_SWAP_UNDERLAY9: UINT = 0x01000000; +pub const WGL_SWAP_UNDERLAY10: UINT = 0x02000000; +pub const WGL_SWAP_UNDERLAY11: UINT = 0x04000000; +pub const WGL_SWAP_UNDERLAY12: UINT = 0x08000000; +pub const WGL_SWAP_UNDERLAY13: UINT = 0x10000000; +pub const WGL_SWAP_UNDERLAY14: UINT = 0x20000000; +pub const WGL_SWAP_UNDERLAY15: UINT = 0x40000000; +extern "system" { + pub fn wglDescribeLayerPlane( + hdc: HDC, + iPixelFormat: c_int, + iLayerPlane: c_int, + nBytes: UINT, + plpd: LPLAYERPLANEDESCRIPTOR, + ) -> BOOL; + pub fn wglSetLayerPaletteEntries( + hdc: HDC, + iLayerPlane: c_int, + iStart: c_int, + cEntries: c_int, + pcr: *const COLORREF, + ) -> c_int; + pub fn wglGetLayerPaletteEntries( + hdc: HDC, + iLayerPlane: c_int, + iStart: c_int, + cEntries: c_int, + pcr: *const COLORREF, + ) -> c_int; + pub fn wglRealizeLayerPalette( + hdc: HDC, + iLayerPlane: c_int, + bRealize: BOOL, + ) -> BOOL; + pub fn wglSwapLayerBuffers( + hdc: HDC, + fuPlanes: UINT, + ) -> BOOL; +} +STRUCT!{struct WGLSWAP { + hdc: HDC, + uiFlags: UINT, +}} +pub type PWGLSWAP = *mut WGLSWAP; +pub type LPWGLSWAP = *mut WGLSWAP; +pub const WGL_SWAPMULTIPLE_MAX: usize = 16; +extern "system" { + pub fn wglSwapMultipleBuffers( + n: UINT, + ps: *const WGLSWAP, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/winhttp.rs b/bash-5.1/vendor/winapi/src/um/winhttp.rs new file mode 100644 index 0000000000000000000000000000000000000000..f39c78f51aae1dd4c5cfd63b1e16d159ac795980 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winhttp.rs @@ -0,0 +1,658 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Windows HTTP Services API constant definitions and macros +use ctypes::c_int; +use shared::basetsd::DWORD_PTR; +use shared::minwindef::{BOOL, DWORD, LPCVOID, LPDWORD, LPVOID, USHORT, WORD}; +use um::minwinbase::SYSTEMTIME; +use um::winnt::{LPCWSTR, LPWSTR, PCWSTR, PVOID, PWSTR}; +pub type HINTERNET = LPVOID; +pub type LPHINTERNET = *mut HINTERNET; +pub type INTERNET_PORT = WORD; +pub type LPINTERNET_PORT = *mut INTERNET_PORT; +pub const INTERNET_DEFAULT_PORT: INTERNET_PORT = 0; +pub const INTERNET_DEFAULT_HTTP_PORT: INTERNET_PORT = 80; +pub const INTERNET_DEFAULT_HTTPS_PORT: INTERNET_PORT = 443; +pub const WINHTTP_FLAG_ASYNC: DWORD = 0x10000000; +pub const WINHTTP_FLAG_SECURE: DWORD = 0x00800000; +pub const WINHTTP_FLAG_ESCAPE_PERCENT: DWORD = 0x00000004; +pub const WINHTTP_FLAG_NULL_CODEPAGE: DWORD = 0x00000008; +pub const WINHTTP_FLAG_BYPASS_PROXY_CACHE: DWORD = 0x00000100; +pub const WINHTTP_FLAG_REFRESH: DWORD = WINHTTP_FLAG_BYPASS_PROXY_CACHE; +pub const WINHTTP_FLAG_ESCAPE_DISABLE: DWORD = 0x00000040; +pub const WINHTTP_FLAG_ESCAPE_DISABLE_QUERY: DWORD = 0x00000080; +STRUCT!{struct WINHTTP_ASYNC_RESULT { + dwResult: DWORD_PTR, + dwError: DWORD, +}} +pub type LPWINHTTP_ASYNC_RESULT = *mut WINHTTP_ASYNC_RESULT; +pub type INTERNET_SCHEME = c_int; +pub type LPINTERNET_SCHEME = *mut c_int; +pub const INTERNET_SCHEME_HTTP: INTERNET_SCHEME = 1; +pub const INTERNET_SCHEME_HTTPS: INTERNET_SCHEME = 2; +pub const INTERNET_SCHEME_FTP: INTERNET_SCHEME = 3; +pub const INTERNET_SCHEME_SOCKS: INTERNET_SCHEME = 4; +STRUCT!{struct URL_COMPONENTS { + dwStructSize: DWORD, + lpszScheme: LPWSTR, + dwSchemeLength: DWORD, + nScheme: INTERNET_SCHEME, + lpszHostName: LPWSTR, + dwHostNameLength: DWORD, + nPort: INTERNET_PORT, + lpszUserName: LPWSTR, + dwUserNameLength: DWORD, + lpszPassword: LPWSTR, + dwPasswordLength: DWORD, + lpszUrlPath: LPWSTR, + dwUrlPathLength: DWORD, + lpszExtraInfo: LPWSTR, + dwExtraInfoLength: DWORD, +}} +pub type LPURL_COMPONENTS = *mut URL_COMPONENTS; +pub type URL_COMPONENTSW = URL_COMPONENTS; +pub type LPURL_COMPONENTSW = LPURL_COMPONENTS; +STRUCT!{struct WINHTTP_PROXY_INFO { + dwAccessType: DWORD, + lpszProxy: LPWSTR, + lpszProxyBypass: LPWSTR, +}} +pub type LPWINHTTP_PROXY_INFO = *mut WINHTTP_PROXY_INFO; +pub type WINHTTP_PROXY_INFOW = WINHTTP_PROXY_INFO; +pub type LPWINHTTP_PROXY_INFOW = LPWINHTTP_PROXY_INFO; +STRUCT!{struct WINHTTP_AUTOPROXY_OPTIONS { + dwFlags: DWORD, + dwAutoDetectFlags: DWORD, + lpszAutoConfigUrl: LPCWSTR, + lpvReserved: LPVOID, + dwReserved: DWORD, + fAutoLogonIfChallenged: BOOL, +}} +pub const WINHTTP_AUTOPROXY_AUTO_DETECT: DWORD = 0x00000001; +pub const WINHTTP_AUTOPROXY_CONFIG_URL: DWORD = 0x00000002; +pub const WINHTTP_AUTOPROXY_HOST_KEEPCASE: DWORD = 0x00000004; +pub const WINHTTP_AUTOPROXY_HOST_LOWERCASE: DWORD = 0x00000008; +pub const WINHTTP_AUTOPROXY_RUN_INPROCESS: DWORD = 0x00010000; +pub const WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY: DWORD = 0x00020000; +pub const WINHTTP_AUTOPROXY_NO_DIRECTACCESS: DWORD = 0x00040000; +pub const WINHTTP_AUTOPROXY_NO_CACHE_CLIENT: DWORD = 0x00080000; +pub const WINHTTP_AUTOPROXY_NO_CACHE_SVC: DWORD = 0x00100000; +pub const WINHTTP_AUTOPROXY_SORT_RESULTS: DWORD = 0x00400000; +pub const WINHTTP_AUTO_DETECT_TYPE_DHCP: DWORD = 0x00000001; +pub const WINHTTP_AUTO_DETECT_TYPE_DNS_A: DWORD = 0x00000002; +STRUCT!{struct WINHTTP_PROXY_RESULT_ENTRY { + fProxy: BOOL, + fBypass: BOOL, + ProxyScheme: INTERNET_SCHEME, + pwszProxy: PWSTR, + ProxyPort: INTERNET_PORT, +}} +STRUCT!{struct WINHTTP_PROXY_RESULT { + cEntries: DWORD, + pEntries: *mut WINHTTP_PROXY_RESULT_ENTRY, +}} +pub const WINHTTP_FIRST_OPTION: DWORD = WINHTTP_OPTION_CALLBACK; +pub const WINHTTP_OPTION_CALLBACK: DWORD = 1; +pub const WINHTTP_OPTION_RESOLVE_TIMEOUT: DWORD = 2; +pub const WINHTTP_OPTION_CONNECT_TIMEOUT: DWORD = 3; +pub const WINHTTP_OPTION_CONNECT_RETRIES: DWORD = 4; +pub const WINHTTP_OPTION_SEND_TIMEOUT: DWORD = 5; +pub const WINHTTP_OPTION_RECEIVE_TIMEOUT: DWORD = 6; +pub const WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT: DWORD = 7; +pub const WINHTTP_OPTION_HANDLE_TYPE: DWORD = 9; +pub const WINHTTP_OPTION_READ_BUFFER_SIZE: DWORD = 12; +pub const WINHTTP_OPTION_WRITE_BUFFER_SIZE: DWORD = 13; +pub const WINHTTP_OPTION_PARENT_HANDLE: DWORD = 21; +pub const WINHTTP_OPTION_EXTENDED_ERROR: DWORD = 24; +pub const WINHTTP_OPTION_SECURITY_FLAGS: DWORD = 31; +pub const WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT: DWORD = 32; +pub const WINHTTP_OPTION_URL: DWORD = 34; +pub const WINHTTP_OPTION_SECURITY_KEY_BITNESS: DWORD = 36; +pub const WINHTTP_OPTION_PROXY: DWORD = 38; +pub const WINHTTP_OPTION_PROXY_RESULT_ENTRY: DWORD = 39; +pub const WINHTTP_OPTION_USER_AGENT: DWORD = 41; +pub const WINHTTP_OPTION_CONTEXT_VALUE: DWORD = 45; +pub const WINHTTP_OPTION_CLIENT_CERT_CONTEXT: DWORD = 47; +pub const WINHTTP_OPTION_REQUEST_PRIORITY: DWORD = 58; +pub const WINHTTP_OPTION_HTTP_VERSION: DWORD = 59; +pub const WINHTTP_OPTION_DISABLE_FEATURE: DWORD = 63; +pub const WINHTTP_OPTION_CODEPAGE: DWORD = 68; +pub const WINHTTP_OPTION_MAX_CONNS_PER_SERVER: DWORD = 73; +pub const WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER: DWORD = 74; +pub const WINHTTP_OPTION_AUTOLOGON_POLICY: DWORD = 77; +pub const WINHTTP_OPTION_SERVER_CERT_CONTEXT: DWORD = 78; +pub const WINHTTP_OPTION_ENABLE_FEATURE: DWORD = 79; +pub const WINHTTP_OPTION_WORKER_THREAD_COUNT: DWORD = 80; +pub const WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT: DWORD = 81; +pub const WINHTTP_OPTION_PASSPORT_COBRANDING_URL: DWORD = 82; +pub const WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH: DWORD = 83; +pub const WINHTTP_OPTION_SECURE_PROTOCOLS: DWORD = 84; +pub const WINHTTP_OPTION_ENABLETRACING: DWORD = 85; +pub const WINHTTP_OPTION_PASSPORT_SIGN_OUT: DWORD = 86; +pub const WINHTTP_OPTION_PASSPORT_RETURN_URL: DWORD = 87; +pub const WINHTTP_OPTION_REDIRECT_POLICY: DWORD = 88; +pub const WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS: DWORD = 89; +pub const WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE: DWORD = 90; +pub const WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE: DWORD = 91; +pub const WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE: DWORD = 92; +pub const WINHTTP_OPTION_CONNECTION_INFO: DWORD = 93; +pub const WINHTTP_OPTION_CLIENT_CERT_ISSUER_LIST: DWORD = 94; +pub const WINHTTP_OPTION_SPN: DWORD = 96; +pub const WINHTTP_OPTION_GLOBAL_PROXY_CREDS: DWORD = 97; +pub const WINHTTP_OPTION_GLOBAL_SERVER_CREDS: DWORD = 98; +pub const WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT: DWORD = 99; +pub const WINHTTP_OPTION_REJECT_USERPWD_IN_URL: DWORD = 100; +pub const WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS: DWORD = 101; +pub const WINHTTP_OPTION_RECEIVE_PROXY_CONNECT_RESPONSE: DWORD = 103; +pub const WINHTTP_OPTION_IS_PROXY_CONNECT_RESPONSE: DWORD = 104; +pub const WINHTTP_OPTION_SERVER_SPN_USED: DWORD = 106; +pub const WINHTTP_OPTION_PROXY_SPN_USED: DWORD = 107; +pub const WINHTTP_OPTION_SERVER_CBT: DWORD = 108; +pub const WINHTTP_OPTION_UNSAFE_HEADER_PARSING: DWORD = 110; +pub const WINHTTP_OPTION_ASSURED_NON_BLOCKING_CALLBACKS: DWORD = 111; +pub const WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET: DWORD = 114; +pub const WINHTTP_OPTION_WEB_SOCKET_CLOSE_TIMEOUT: DWORD = 115; +pub const WINHTTP_OPTION_WEB_SOCKET_KEEPALIVE_INTERVAL: DWORD = 116; +pub const WINHTTP_OPTION_DECOMPRESSION: DWORD = 118; +pub const WINHTTP_OPTION_WEB_SOCKET_RECEIVE_BUFFER_SIZE: DWORD = 122; +pub const WINHTTP_OPTION_WEB_SOCKET_SEND_BUFFER_SIZE: DWORD = 123; +pub const WINHTTP_LAST_OPTION: DWORD = WINHTTP_OPTION_WEB_SOCKET_SEND_BUFFER_SIZE; +pub const WINHTTP_OPTION_USERNAME: DWORD = 0x1000; +pub const WINHTTP_OPTION_PASSWORD: DWORD = 0x1001; +pub const WINHTTP_OPTION_PROXY_USERNAME: DWORD = 0x1002; +pub const WINHTTP_OPTION_PROXY_PASSWORD: DWORD = 0x1003; +//569 +FN!{stdcall WINHTTP_STATUS_CALLBACK( + hInternet: HINTERNET, + dwContext: DWORD_PTR, + dwInternetStatus: DWORD, + lpvStatusInformation: LPVOID, + dwStatusInformationLength: DWORD, +) -> ()} +pub type LPWINHTTP_STATUS_CALLBACK = *mut WINHTTP_STATUS_CALLBACK; +pub const WINHTTP_CALLBACK_STATUS_RESOLVING_NAME: DWORD = 0x00000001; +pub const WINHTTP_CALLBACK_STATUS_NAME_RESOLVED: DWORD = 0x00000002; +pub const WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER: DWORD = 0x00000004; +pub const WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER: DWORD = 0x00000008; +pub const WINHTTP_CALLBACK_STATUS_SENDING_REQUEST: DWORD = 0x00000010; +pub const WINHTTP_CALLBACK_STATUS_REQUEST_SENT: DWORD = 0x00000020; +pub const WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE: DWORD = 0x00000040; +pub const WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED: DWORD = 0x00000080; +pub const WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION: DWORD = 0x00000100; +pub const WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED: DWORD = 0x00000200; +pub const WINHTTP_CALLBACK_STATUS_HANDLE_CREATED: DWORD = 0x00000400; +pub const WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING: DWORD = 0x00000800; +pub const WINHTTP_CALLBACK_STATUS_DETECTING_PROXY: DWORD = 0x00001000; +pub const WINHTTP_CALLBACK_STATUS_REDIRECT: DWORD = 0x00004000; +pub const WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE: DWORD = 0x00008000; +pub const WINHTTP_CALLBACK_STATUS_SECURE_FAILURE: DWORD = 0x00010000; +pub const WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE: DWORD = 0x00020000; +pub const WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE: DWORD = 0x00040000; +pub const WINHTTP_CALLBACK_STATUS_READ_COMPLETE: DWORD = 0x00080000; +pub const WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE: DWORD = 0x00100000; +pub const WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: DWORD = 0x00200000; +pub const WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE: DWORD = 0x00400000; +pub const WINHTTP_CALLBACK_STATUS_GETPROXYFORURL_COMPLETE: DWORD = 0x01000000; +pub const WINHTTP_CALLBACK_STATUS_CLOSE_COMPLETE: DWORD = 0x02000000; +pub const WINHTTP_CALLBACK_STATUS_SHUTDOWN_COMPLETE: DWORD = 0x04000000; +pub const WINHTTP_CALLBACK_FLAG_RESOLVE_NAME: DWORD = WINHTTP_CALLBACK_STATUS_RESOLVING_NAME + | WINHTTP_CALLBACK_STATUS_NAME_RESOLVED; +pub const WINHTTP_CALLBACK_FLAG_CONNECT_TO_SERVER: DWORD = + WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER | WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER; +pub const WINHTTP_CALLBACK_FLAG_SEND_REQUEST: DWORD = + WINHTTP_CALLBACK_STATUS_SENDING_REQUEST | WINHTTP_CALLBACK_STATUS_REQUEST_SENT; +pub const WINHTTP_CALLBACK_FLAG_RECEIVE_RESPONSE: DWORD = + WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE | WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED; +pub const WINHTTP_CALLBACK_FLAG_CLOSE_CONNECTION: DWORD = + WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION | WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED; +pub const WINHTTP_CALLBACK_FLAG_HANDLES: DWORD = + WINHTTP_CALLBACK_STATUS_HANDLE_CREATED | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING; +pub const WINHTTP_CALLBACK_FLAG_DETECTING_PROXY: DWORD = WINHTTP_CALLBACK_STATUS_DETECTING_PROXY; +pub const WINHTTP_CALLBACK_FLAG_REDIRECT: DWORD = WINHTTP_CALLBACK_STATUS_REDIRECT; +pub const WINHTTP_CALLBACK_FLAG_INTERMEDIATE_RESPONSE: DWORD = + WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE; +pub const WINHTTP_CALLBACK_FLAG_SECURE_FAILURE: DWORD = WINHTTP_CALLBACK_STATUS_SECURE_FAILURE; +pub const WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE: DWORD = + WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE; +pub const WINHTTP_CALLBACK_FLAG_HEADERS_AVAILABLE: DWORD = + WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE; +pub const WINHTTP_CALLBACK_FLAG_DATA_AVAILABLE: DWORD = WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE; +pub const WINHTTP_CALLBACK_FLAG_READ_COMPLETE: DWORD = WINHTTP_CALLBACK_STATUS_READ_COMPLETE; +pub const WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE: DWORD = WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE; +pub const WINHTTP_CALLBACK_FLAG_REQUEST_ERROR: DWORD = WINHTTP_CALLBACK_STATUS_REQUEST_ERROR; +pub const WINHTTP_CALLBACK_FLAG_GETPROXYFORURL_COMPLETE: DWORD = + WINHTTP_CALLBACK_STATUS_GETPROXYFORURL_COMPLETE; +pub const WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS: DWORD = + WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE | WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE + | WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE | WINHTTP_CALLBACK_STATUS_READ_COMPLETE + | WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE | WINHTTP_CALLBACK_STATUS_REQUEST_ERROR + | WINHTTP_CALLBACK_STATUS_GETPROXYFORURL_COMPLETE; +pub const WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS: DWORD = 0xffffffff; +pub const WINHTTP_QUERY_MIME_VERSION: DWORD = 0; +pub const WINHTTP_QUERY_CONTENT_TYPE: DWORD = 1; +pub const WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING: DWORD = 2; +pub const WINHTTP_QUERY_CONTENT_ID: DWORD = 3; +pub const WINHTTP_QUERY_CONTENT_DESCRIPTION: DWORD = 4; +pub const WINHTTP_QUERY_CONTENT_LENGTH: DWORD = 5; +pub const WINHTTP_QUERY_CONTENT_LANGUAGE: DWORD = 6; +pub const WINHTTP_QUERY_ALLOW: DWORD = 7; +pub const WINHTTP_QUERY_PUBLIC: DWORD = 8; +pub const WINHTTP_QUERY_DATE: DWORD = 9; +pub const WINHTTP_QUERY_EXPIRES: DWORD = 10; +pub const WINHTTP_QUERY_LAST_MODIFIED: DWORD = 11; +pub const WINHTTP_QUERY_MESSAGE_ID: DWORD = 12; +pub const WINHTTP_QUERY_URI: DWORD = 13; +pub const WINHTTP_QUERY_DERIVED_FROM: DWORD = 14; +pub const WINHTTP_QUERY_COST: DWORD = 15; +pub const WINHTTP_QUERY_LINK: DWORD = 16; +pub const WINHTTP_QUERY_PRAGMA: DWORD = 17; +pub const WINHTTP_QUERY_VERSION: DWORD = 18; +pub const WINHTTP_QUERY_STATUS_CODE: DWORD = 19; +pub const WINHTTP_QUERY_STATUS_TEXT: DWORD = 20; +pub const WINHTTP_QUERY_RAW_HEADERS: DWORD = 21; +pub const WINHTTP_QUERY_RAW_HEADERS_CRLF: DWORD = 22; +pub const WINHTTP_QUERY_CONNECTION: DWORD = 23; +pub const WINHTTP_QUERY_ACCEPT: DWORD = 24; +pub const WINHTTP_QUERY_ACCEPT_CHARSET: DWORD = 25; +pub const WINHTTP_QUERY_ACCEPT_ENCODING: DWORD = 26; +pub const WINHTTP_QUERY_ACCEPT_LANGUAGE: DWORD = 27; +pub const WINHTTP_QUERY_AUTHORIZATION: DWORD = 28; +pub const WINHTTP_QUERY_CONTENT_ENCODING: DWORD = 29; +pub const WINHTTP_QUERY_FORWARDED: DWORD = 30; +pub const WINHTTP_QUERY_FROM: DWORD = 31; +pub const WINHTTP_QUERY_IF_MODIFIED_SINCE: DWORD = 32; +pub const WINHTTP_QUERY_LOCATION: DWORD = 33; +pub const WINHTTP_QUERY_ORIG_URI: DWORD = 34; +pub const WINHTTP_QUERY_REFERER: DWORD = 35; +pub const WINHTTP_QUERY_RETRY_AFTER: DWORD = 36; +pub const WINHTTP_QUERY_SERVER: DWORD = 37; +pub const WINHTTP_QUERY_TITLE: DWORD = 38; +pub const WINHTTP_QUERY_USER_AGENT: DWORD = 39; +pub const WINHTTP_QUERY_WWW_AUTHENTICATE: DWORD = 40; +pub const WINHTTP_QUERY_PROXY_AUTHENTICATE: DWORD = 41; +pub const WINHTTP_QUERY_ACCEPT_RANGES: DWORD = 42; +pub const WINHTTP_QUERY_SET_COOKIE: DWORD = 43; +pub const WINHTTP_QUERY_COOKIE: DWORD = 44; +pub const WINHTTP_QUERY_REQUEST_METHOD: DWORD = 45; +pub const WINHTTP_QUERY_REFRESH: DWORD = 46; +pub const WINHTTP_QUERY_CONTENT_DISPOSITION: DWORD = 47; +pub const WINHTTP_QUERY_AGE: DWORD = 48; +pub const WINHTTP_QUERY_CACHE_CONTROL: DWORD = 49; +pub const WINHTTP_QUERY_CONTENT_BASE: DWORD = 50; +pub const WINHTTP_QUERY_CONTENT_LOCATION: DWORD = 51; +pub const WINHTTP_QUERY_CONTENT_MD5: DWORD = 52; +pub const WINHTTP_QUERY_CONTENT_RANGE: DWORD = 53; +pub const WINHTTP_QUERY_ETAG: DWORD = 54; +pub const WINHTTP_QUERY_HOST: DWORD = 55; +pub const WINHTTP_QUERY_IF_MATCH: DWORD = 56; +pub const WINHTTP_QUERY_IF_NONE_MATCH: DWORD = 57; +pub const WINHTTP_QUERY_IF_RANGE: DWORD = 58; +pub const WINHTTP_QUERY_IF_UNMODIFIED_SINCE: DWORD = 59; +pub const WINHTTP_QUERY_MAX_FORWARDS: DWORD = 60; +pub const WINHTTP_QUERY_PROXY_AUTHORIZATION: DWORD = 61; +pub const WINHTTP_QUERY_RANGE: DWORD = 62; +pub const WINHTTP_QUERY_TRANSFER_ENCODING: DWORD = 63; +pub const WINHTTP_QUERY_UPGRADE: DWORD = 64; +pub const WINHTTP_QUERY_VARY: DWORD = 65; +pub const WINHTTP_QUERY_VIA: DWORD = 66; +pub const WINHTTP_QUERY_WARNING: DWORD = 67; +pub const WINHTTP_QUERY_EXPECT: DWORD = 68; +pub const WINHTTP_QUERY_PROXY_CONNECTION: DWORD = 69; +pub const WINHTTP_QUERY_UNLESS_MODIFIED_SINCE: DWORD = 70; +pub const WINHTTP_QUERY_PROXY_SUPPORT: DWORD = 75; +pub const WINHTTP_QUERY_AUTHENTICATION_INFO: DWORD = 76; +pub const WINHTTP_QUERY_PASSPORT_URLS: DWORD = 77; +pub const WINHTTP_QUERY_PASSPORT_CONFIG: DWORD = 78; +pub const WINHTTP_QUERY_MAX: DWORD = 78; +pub const WINHTTP_QUERY_CUSTOM: DWORD = 65535; +pub const WINHTTP_QUERY_FLAG_REQUEST_HEADERS: DWORD = 0x80000000; +pub const WINHTTP_QUERY_FLAG_SYSTEMTIME: DWORD = 0x40000000; +pub const WINHTTP_QUERY_FLAG_NUMBER: DWORD = 0x20000000; +pub const HTTP_STATUS_CONTINUE: DWORD = 100; +pub const HTTP_STATUS_SWITCH_PROTOCOLS: DWORD = 101; +pub const HTTP_STATUS_OK: DWORD = 200; +pub const HTTP_STATUS_CREATED: DWORD = 201; +pub const HTTP_STATUS_ACCEPTED: DWORD = 202; +pub const HTTP_STATUS_PARTIAL: DWORD = 203; +pub const HTTP_STATUS_NO_CONTENT: DWORD = 204; +pub const HTTP_STATUS_RESET_CONTENT: DWORD = 205; +pub const HTTP_STATUS_PARTIAL_CONTENT: DWORD = 206; +pub const HTTP_STATUS_WEBDAV_MULTI_STATUS: DWORD = 207; +pub const HTTP_STATUS_AMBIGUOUS: DWORD = 300; +pub const HTTP_STATUS_MOVED: DWORD = 301; +pub const HTTP_STATUS_REDIRECT: DWORD = 302; +pub const HTTP_STATUS_REDIRECT_METHOD: DWORD = 303; +pub const HTTP_STATUS_NOT_MODIFIED: DWORD = 304; +pub const HTTP_STATUS_USE_PROXY: DWORD = 305; +pub const HTTP_STATUS_REDIRECT_KEEP_VERB: DWORD = 307; +pub const HTTP_STATUS_BAD_REQUEST: DWORD = 400; +pub const HTTP_STATUS_DENIED: DWORD = 401; +pub const HTTP_STATUS_PAYMENT_REQ: DWORD = 402; +pub const HTTP_STATUS_FORBIDDEN: DWORD = 403; +pub const HTTP_STATUS_NOT_FOUND: DWORD = 404; +pub const HTTP_STATUS_BAD_METHOD: DWORD = 405; +pub const HTTP_STATUS_NONE_ACCEPTABLE: DWORD = 406; +pub const HTTP_STATUS_PROXY_AUTH_REQ: DWORD = 407; +pub const HTTP_STATUS_REQUEST_TIMEOUT: DWORD = 408; +pub const HTTP_STATUS_CONFLICT: DWORD = 409; +pub const HTTP_STATUS_GONE: DWORD = 410; +pub const HTTP_STATUS_LENGTH_REQUIRED: DWORD = 411; +pub const HTTP_STATUS_PRECOND_FAILED: DWORD = 412; +pub const HTTP_STATUS_REQUEST_TOO_LARGE: DWORD = 413; +pub const HTTP_STATUS_URI_TOO_LONG: DWORD = 414; +pub const HTTP_STATUS_UNSUPPORTED_MEDIA: DWORD = 415; +pub const HTTP_STATUS_RETRY_WITH: DWORD = 449; +pub const HTTP_STATUS_SERVER_ERROR: DWORD = 500; +pub const HTTP_STATUS_NOT_SUPPORTED: DWORD = 501; +pub const HTTP_STATUS_BAD_GATEWAY: DWORD = 502; +pub const HTTP_STATUS_SERVICE_UNAVAIL: DWORD = 503; +pub const HTTP_STATUS_GATEWAY_TIMEOUT: DWORD = 504; +pub const HTTP_STATUS_VERSION_NOT_SUP: DWORD = 505; +pub const HTTP_STATUS_FIRST: DWORD = HTTP_STATUS_CONTINUE; +pub const HTTP_STATUS_LAST: DWORD = HTTP_STATUS_VERSION_NOT_SUP; +pub const WINHTTP_ACCESS_TYPE_DEFAULT_PROXY: DWORD = 0; +pub const WINHTTP_ACCESS_TYPE_NO_PROXY: DWORD = 1; +pub const WINHTTP_ACCESS_TYPE_NAMED_PROXY: DWORD = 3; +pub const WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY: DWORD = 4; +STRUCT!{struct WINHTTP_CURRENT_USER_IE_PROXY_CONFIG { + fAutoDetect: BOOL, + lpszAutoConfigUrl: LPWSTR, + lpszProxy: LPWSTR, + lpszProxyBypass: LPWSTR, +}} +pub const WINHTTP_ERROR_BASE: DWORD = 12000; +pub const ERROR_WINHTTP_OUT_OF_HANDLES: DWORD = WINHTTP_ERROR_BASE + 1; +pub const ERROR_WINHTTP_TIMEOUT: DWORD = WINHTTP_ERROR_BASE + 2; +pub const ERROR_WINHTTP_INTERNAL_ERROR: DWORD = WINHTTP_ERROR_BASE + 4; +pub const ERROR_WINHTTP_INVALID_URL: DWORD = WINHTTP_ERROR_BASE + 5; +pub const ERROR_WINHTTP_UNRECOGNIZED_SCHEME: DWORD = WINHTTP_ERROR_BASE + 6; +pub const ERROR_WINHTTP_NAME_NOT_RESOLVED: DWORD = WINHTTP_ERROR_BASE + 7; +pub const ERROR_WINHTTP_INVALID_OPTION: DWORD = WINHTTP_ERROR_BASE + 9; +pub const ERROR_WINHTTP_OPTION_NOT_SETTABLE: DWORD = WINHTTP_ERROR_BASE + 11; +pub const ERROR_WINHTTP_SHUTDOWN: DWORD = WINHTTP_ERROR_BASE + 12; +pub const ERROR_WINHTTP_LOGIN_FAILURE: DWORD = WINHTTP_ERROR_BASE + 15; +pub const ERROR_WINHTTP_OPERATION_CANCELLED: DWORD = WINHTTP_ERROR_BASE + 17; +pub const ERROR_WINHTTP_INCORRECT_HANDLE_TYPE: DWORD = WINHTTP_ERROR_BASE + 18; +pub const ERROR_WINHTTP_INCORRECT_HANDLE_STATE: DWORD = WINHTTP_ERROR_BASE + 19; +pub const ERROR_WINHTTP_CANNOT_CONNECT: DWORD = WINHTTP_ERROR_BASE + 29; +pub const ERROR_WINHTTP_CONNECTION_ERROR: DWORD = WINHTTP_ERROR_BASE + 30; +pub const ERROR_WINHTTP_RESEND_REQUEST: DWORD = WINHTTP_ERROR_BASE + 32; +pub const ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED: DWORD = WINHTTP_ERROR_BASE + 44; +pub const ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN: DWORD = WINHTTP_ERROR_BASE + 100; +pub const ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND: DWORD = WINHTTP_ERROR_BASE + 101; +pub const ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND: DWORD = WINHTTP_ERROR_BASE + 102; +pub const ERROR_WINHTTP_CANNOT_CALL_AFTER_OPEN: DWORD = WINHTTP_ERROR_BASE + 103; +pub const ERROR_WINHTTP_HEADER_NOT_FOUND: DWORD = WINHTTP_ERROR_BASE + 150; +pub const ERROR_WINHTTP_INVALID_SERVER_RESPONSE: DWORD = WINHTTP_ERROR_BASE + 152; +pub const ERROR_WINHTTP_INVALID_HEADER: DWORD = WINHTTP_ERROR_BASE + 153; +pub const ERROR_WINHTTP_INVALID_QUERY_REQUEST: DWORD = WINHTTP_ERROR_BASE + 154; +pub const ERROR_WINHTTP_HEADER_ALREADY_EXISTS: DWORD = WINHTTP_ERROR_BASE + 155; +pub const ERROR_WINHTTP_REDIRECT_FAILED: DWORD = WINHTTP_ERROR_BASE + 156; +pub const ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR: DWORD = WINHTTP_ERROR_BASE + 178; +pub const ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT: DWORD = WINHTTP_ERROR_BASE + 166; +pub const ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT: DWORD = WINHTTP_ERROR_BASE + 167; +pub const ERROR_WINHTTP_UNHANDLED_SCRIPT_TYPE: DWORD = WINHTTP_ERROR_BASE + 176; +pub const ERROR_WINHTTP_SCRIPT_EXECUTION_ERROR: DWORD = WINHTTP_ERROR_BASE + 177; +pub const ERROR_WINHTTP_NOT_INITIALIZED: DWORD = WINHTTP_ERROR_BASE + 172; +pub const ERROR_WINHTTP_SECURE_FAILURE: DWORD = WINHTTP_ERROR_BASE + 175; +pub const ERROR_WINHTTP_SECURE_CERT_DATE_INVALID: DWORD = WINHTTP_ERROR_BASE + 37; +pub const ERROR_WINHTTP_SECURE_CERT_CN_INVALID: DWORD = WINHTTP_ERROR_BASE + 38; +pub const ERROR_WINHTTP_SECURE_INVALID_CA: DWORD = WINHTTP_ERROR_BASE + 45; +pub const ERROR_WINHTTP_SECURE_CERT_REV_FAILED: DWORD = WINHTTP_ERROR_BASE + 57; +pub const ERROR_WINHTTP_SECURE_CHANNEL_ERROR: DWORD = WINHTTP_ERROR_BASE + 157; +pub const ERROR_WINHTTP_SECURE_INVALID_CERT: DWORD = WINHTTP_ERROR_BASE + 169; +pub const ERROR_WINHTTP_SECURE_CERT_REVOKED: DWORD = WINHTTP_ERROR_BASE + 170; +pub const ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE: DWORD = WINHTTP_ERROR_BASE + 179; +pub const ERROR_WINHTTP_AUTODETECTION_FAILED: DWORD = WINHTTP_ERROR_BASE + 180; +pub const ERROR_WINHTTP_HEADER_COUNT_EXCEEDED: DWORD = WINHTTP_ERROR_BASE + 181; +pub const ERROR_WINHTTP_HEADER_SIZE_OVERFLOW: DWORD = WINHTTP_ERROR_BASE + 182; +pub const ERROR_WINHTTP_CHUNKED_ENCODING_HEADER_SIZE_OVERFLOW: DWORD = WINHTTP_ERROR_BASE + 183; +pub const ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW: DWORD = WINHTTP_ERROR_BASE + 184; +pub const ERROR_WINHTTP_CLIENT_CERT_NO_PRIVATE_KEY: DWORD = WINHTTP_ERROR_BASE + 185; +pub const ERROR_WINHTTP_CLIENT_CERT_NO_ACCESS_PRIVATE_KEY: DWORD = WINHTTP_ERROR_BASE + 186; +pub const WINHTTP_ERROR_LAST: DWORD = WINHTTP_ERROR_BASE + 186; +pub const WINHTTP_RESET_STATE: DWORD = 0x00000001; +pub const WINHTTP_RESET_SWPAD_CURRENT_NETWORK: DWORD = 0x00000002; +pub const WINHTTP_RESET_SWPAD_ALL: DWORD = 0x00000004; +pub const WINHTTP_RESET_SCRIPT_CACHE: DWORD = 0x00000008; +pub const WINHTTP_RESET_ALL: DWORD = 0x0000FFFF; +pub const WINHTTP_RESET_NOTIFY_NETWORK_CHANGED: DWORD = 0x00010000; +pub const WINHTTP_RESET_OUT_OF_PROC: DWORD = 0x00020000; +extern "system" { + pub fn WinHttpSetStatusCallback( + hInternet: HINTERNET, + lpfnInternetCallback: WINHTTP_STATUS_CALLBACK, + dwNotificationFlags: DWORD, + dwReserved: DWORD_PTR, + ) -> WINHTTP_STATUS_CALLBACK; + pub fn WinHttpTimeFromSystemTime( + pst: *const SYSTEMTIME, + pwszTime: LPWSTR, + ) -> BOOL; + pub fn WinHttpTimeToSystemTime( + pwszTime: LPCWSTR, + pst: *mut SYSTEMTIME, + ) -> BOOL; + pub fn WinHttpCrackUrl( + pwszUrl: LPCWSTR, + dwUrlLength: DWORD, + dwFlags: DWORD, + lpUrlComponents: LPURL_COMPONENTS, + ) -> BOOL; + pub fn WinHttpCreateUrl( + lpUrlComponents: LPURL_COMPONENTS, + dwFlags: DWORD, + pwszUrl: LPWSTR, + pdwUrlLength: LPDWORD, + ) -> BOOL; + pub fn WinHttpCheckPlatform() -> BOOL; + pub fn WinHttpGetDefaultProxyConfiguration( + pProxyInfo: *mut WINHTTP_PROXY_INFO, + ) -> BOOL; + pub fn WinHttpSetDefaultProxyConfiguration( + pProxyInfo: *mut WINHTTP_PROXY_INFO, + ) -> BOOL; + pub fn WinHttpOpen( + pszAgentW: LPCWSTR, + dwAccessType: DWORD, + pszProxyW: LPCWSTR, + pszProxyBypassW: LPCWSTR, + dwFlags: DWORD, + ) -> HINTERNET; + pub fn WinHttpCloseHandle( + hInternet: HINTERNET, + ) -> BOOL; + pub fn WinHttpConnect( + hSession: HINTERNET, + pswzServerName: LPCWSTR, + nServerPort: INTERNET_PORT, + dwReserved: DWORD, + ) -> HINTERNET; + pub fn WinHttpReadData( + hRequest: HINTERNET, + lpBuffer: LPVOID, + dwNumberOfBytesToRead: DWORD, + lpdwNumberOfBytesRead: LPDWORD, + ) -> BOOL; + pub fn WinHttpWriteData( + hRequest: HINTERNET, + lpBuffer: LPCVOID, + dwNumberOfBytesToWrite: DWORD, + lpdwNumberOfBytesWritten: LPDWORD, + ) -> BOOL; + pub fn WinHttpQueryDataAvailable( + hRequest: HINTERNET, + lpdwNumberOfBytesAvailable: LPDWORD, + ) -> BOOL; + pub fn WinHttpQueryOption( + hInternet: HINTERNET, + dwOption: DWORD, + lpBuffer: LPVOID, + lpdwBufferLength: LPDWORD, + ) -> BOOL; + pub fn WinHttpSetOption( + hInternet: HINTERNET, + dwOption: DWORD, + lpBuffer: LPVOID, + dwBufferLength: DWORD, + ) -> BOOL; + pub fn WinHttpSetTimeouts( + hInternet: HINTERNET, + nResolveTimeout: c_int, + nConnectTimeout: c_int, + nSendTimeout: c_int, + nReceiveTimeout: c_int, + ) -> BOOL; + pub fn WinHttpOpenRequest( + hConnect: HINTERNET, + pwszVerb: LPCWSTR, + pwszObjectName: LPCWSTR, + pwszVersion: LPCWSTR, + pwszReferrer: LPCWSTR, + ppwszAcceptTypes: *mut LPCWSTR, + dwFlags: DWORD, + ) -> HINTERNET; + pub fn WinHttpAddRequestHeaders( + hRequest: HINTERNET, + lpszHeaders: LPCWSTR, + dwHeadersLength: DWORD, + dwModifiers: DWORD, + ) -> BOOL; + pub fn WinHttpSendRequest( + hRequest: HINTERNET, + lpszHeaders: LPCWSTR, + dwHeadersLength: DWORD, + lpOptional: LPVOID, + dwOptionalLength: DWORD, + dwTotalLength: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn WinHttpSetCredentials( + hRequest: HINTERNET, + AuthTargets: DWORD, + AuthScheme: DWORD, + pwszUserName: LPCWSTR, + pwszPassword: LPCWSTR, + pAuthParams: LPVOID, + ) -> BOOL; + pub fn WinHttpQueryAuthSchemes( + hRequest: HINTERNET, + lpdwSupportedSchemes: LPDWORD, + lpdwFirstScheme: LPDWORD, + pdwAuthTarget: LPDWORD, + ) -> BOOL; + pub fn WinHttpReceiveResponse( + hRequest: HINTERNET, + lpReserved: LPVOID, + ) -> BOOL; + pub fn WinHttpQueryHeaders( + hRequest: HINTERNET, + dwInfoLevel: DWORD, + pwszName: LPCWSTR, + lpBuffer: LPVOID, + lpdwBufferLength: LPDWORD, + lpdwIndex: LPDWORD, + ) -> BOOL; + pub fn WinHttpDetectAutoProxyConfigUrl( + dwAutoDetectFlags: DWORD, + ppwstrAutoConfigUrl: *mut LPWSTR, + ) -> BOOL; + pub fn WinHttpGetProxyForUrl( + hSession: HINTERNET, + lpcwszUrl: LPCWSTR, + pAutoProxyOptions: *mut WINHTTP_AUTOPROXY_OPTIONS, + pProxyInfo: *mut WINHTTP_PROXY_INFO, + ) -> BOOL; + pub fn WinHttpCreateProxyResolver( + hSession: HINTERNET, + phResolver: *mut HINTERNET, + ) -> DWORD; + pub fn WinHttpGetProxyForUrlEx( + hResolver: HINTERNET, + pcwszUrl: PCWSTR, + pAutoProxyOptions: *mut WINHTTP_AUTOPROXY_OPTIONS, + pContext: DWORD_PTR, + ) -> DWORD; + pub fn WinHttpGetProxyResult( + hResolver: HINTERNET, + pProxyResult: *mut WINHTTP_PROXY_RESULT, + ) -> DWORD; + pub fn WinHttpFreeProxyResult( + pProxyResult: *mut WINHTTP_PROXY_RESULT, + ); + pub fn WinHttpResetAutoProxy( + hSession: HINTERNET, + dwFlags: DWORD, + ) -> DWORD; + pub fn WinHttpGetIEProxyConfigForCurrentUser( + pProxyConfig: *mut WINHTTP_CURRENT_USER_IE_PROXY_CONFIG, + ) -> BOOL; +} +ENUM!{enum WINHTTP_WEB_SOCKET_OPERATION { + WINHTTP_WEB_SOCKET_SEND_OPERATION = 0, + WINHTTP_WEB_SOCKET_RECEIVE_OPERATION = 1, + WINHTTP_WEB_SOCKET_CLOSE_OPERATION = 2, + WINHTTP_WEB_SOCKET_SHUTDOWN_OPERATION = 3, +}} +ENUM!{enum WINHTTP_WEB_SOCKET_BUFFER_TYPE { + WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE = 0, + WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE = 1, + WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE = 2, + WINHTTP_WEB_SOCKET_UTF8_FRAGMENT_BUFFER_TYPE = 3, + WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE = 4, +}} +ENUM!{enum WINHTTP_WEB_SOCKET_CLOSE_STATUS { + WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS = 1000, + WINHTTP_WEB_SOCKET_ENDPOINT_TERMINATED_CLOSE_STATUS = 1001, + WINHTTP_WEB_SOCKET_PROTOCOL_ERROR_CLOSE_STATUS = 1002, + WINHTTP_WEB_SOCKET_INVALID_DATA_TYPE_CLOSE_STATUS = 1003, + WINHTTP_WEB_SOCKET_EMPTY_CLOSE_STATUS = 1005, + WINHTTP_WEB_SOCKET_ABORTED_CLOSE_STATUS = 1006, + WINHTTP_WEB_SOCKET_INVALID_PAYLOAD_CLOSE_STATUS = 1007, + WINHTTP_WEB_SOCKET_POLICY_VIOLATION_CLOSE_STATUS = 1008, + WINHTTP_WEB_SOCKET_MESSAGE_TOO_BIG_CLOSE_STATUS = 1009, + WINHTTP_WEB_SOCKET_UNSUPPORTED_EXTENSIONS_CLOSE_STATUS = 1010, + WINHTTP_WEB_SOCKET_SERVER_ERROR_CLOSE_STATUS = 1011, + WINHTTP_WEB_SOCKET_SECURE_HANDSHAKE_ERROR_CLOSE_STATUS = 1015, +}} +extern "system" { + pub fn WinHttpWebSocketCompleteUpgrade( + hRequest: HINTERNET, + pContext: DWORD_PTR, + ) -> HINTERNET; + pub fn WinHttpWebSocketSend( + hWebSocket: HINTERNET, + eBufferType: WINHTTP_WEB_SOCKET_BUFFER_TYPE, + pvBuffer: PVOID, + dwBufferLength: DWORD, + ) -> DWORD; + pub fn WinHttpWebSocketReceive( + hWebSocket: HINTERNET, + pvBuffer: PVOID, + dwBufferLength: DWORD, + pdwBytesRead: *mut DWORD, + peBufferType: *mut WINHTTP_WEB_SOCKET_BUFFER_TYPE, + ) -> DWORD; + pub fn WinHttpWebSocketShutdown( + hWebSocket: HINTERNET, + usStatus: USHORT, + pvReason: PVOID, + dwReasonLength: DWORD, + ) -> DWORD; + pub fn WinHttpWebSocketClose( + hWebSocket: HINTERNET, + usStatus: USHORT, + pvReason: PVOID, + dwReasonLength: DWORD, + ) -> DWORD; + pub fn WinHttpWebSocketQueryCloseStatus( + hWebSocket: HINTERNET, + pusStatus: *mut USHORT, + pvReason: PVOID, + dwReasonLength: DWORD, + pdwReasonLengthConsumed: *mut DWORD, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/wininet.rs b/bash-5.1/vendor/winapi/src/um/wininet.rs new file mode 100644 index 0000000000000000000000000000000000000000..9a83d6a5d7ca4ab015dd07f9c6f98b46981e5ec4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wininet.rs @@ -0,0 +1,2364 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Windows Internet Services API procedure declarations, types and constants. +use ctypes::c_int; +use shared::basetsd::DWORD_PTR; +use shared::minwindef::{ + BOOL, DWORD, FALSE, FILETIME, INT, LPBYTE, + LPCVOID, LPDWORD, LPVOID, PBYTE, PDWORD, TRUE, WORD, +}; +use shared::ntdef::{LONG, LONGLONG, PLONG}; +use shared::windef::HWND; +use um::minwinbase::{LPWIN32_FIND_DATAA, LPWIN32_FIND_DATAW, SYSTEMTIME}; +use um::winineti::INTERNET_FLAG_BGUPDATE; +use um::winnt::{ + CHAR, DWORDLONG, HANDLE, LPCSTR, LPCWSTR, + LPSTR, LPWSTR, PCWSTR, PSTR, PWSTR, WCHAR, +}; +pub type HINTERNET = LPVOID; +pub type LPHINTERNET = *mut HINTERNET; +pub type INTERNET_PORT = WORD; +pub type LPINTERNET_PORT = *mut INTERNET_PORT; +pub const INTERNET_INVALID_PORT_NUMBER: DWORD = 0; +pub const INTERNET_DEFAULT_FTP_PORT: DWORD = 21; +pub const INTERNET_DEFAULT_GOPHER_PORT: DWORD = 70; +pub const INTERNET_DEFAULT_HTTP_PORT: DWORD = 80; +pub const INTERNET_DEFAULT_HTTPS_PORT: DWORD = 443; +pub const INTERNET_DEFAULT_SOCKS_PORT: DWORD = 1080; +pub const INTERNET_MAX_HOST_NAME_LENGTH: usize = 256; +pub const INTERNET_MAX_USER_NAME_LENGTH: usize = 128; +pub const INTERNET_MAX_PASSWORD_LENGTH: usize = 128; +pub const INTERNET_MAX_PORT_NUMBER_LENGTH: usize = 5; +pub const INTERNET_MAX_PORT_NUMBER_VALUE: DWORD = 65535; +pub const INTERNET_MAX_PATH_LENGTH: usize = 2048; +pub const INTERNET_MAX_SCHEME_LENGTH: usize = 32; +pub const INTERNET_MAX_URL_LENGTH: usize = INTERNET_MAX_SCHEME_LENGTH + 3 + + INTERNET_MAX_PATH_LENGTH; +pub const INTERNET_KEEP_ALIVE_UNKNOWN: DWORD = -1i32 as u32; +pub const INTERNET_KEEP_ALIVE_ENABLED: DWORD = 1; +pub const INTERNET_KEEP_ALIVE_DISABLED: DWORD = 0; +pub const INTERNET_REQFLAG_FROM_CACHE: DWORD = 0x00000001; +pub const INTERNET_REQFLAG_ASYNC: DWORD = 0x00000002; +pub const INTERNET_REQFLAG_VIA_PROXY: DWORD = 0x00000004; +pub const INTERNET_REQFLAG_NO_HEADERS: DWORD = 0x00000008; +pub const INTERNET_REQFLAG_PASSIVE: DWORD = 0x00000010; +pub const INTERNET_REQFLAG_CACHE_WRITE_DISABLED: DWORD = 0x00000040; +pub const INTERNET_REQFLAG_NET_TIMEOUT: DWORD = 0x00000080; +pub const INTERNET_FLAG_IDN_DIRECT: DWORD = 0x00000001; +pub const INTERNET_FLAG_IDN_PROXY: DWORD = 0x00000002; +pub const INTERNET_FLAG_RELOAD: DWORD = 0x80000000; +pub const INTERNET_FLAG_RAW_DATA: DWORD = 0x40000000; +pub const INTERNET_FLAG_EXISTING_CONNECT: DWORD = 0x20000000; +pub const INTERNET_FLAG_ASYNC: DWORD = 0x10000000; +pub const INTERNET_FLAG_PASSIVE: DWORD = 0x08000000; +pub const INTERNET_FLAG_NO_CACHE_WRITE: DWORD = 0x04000000; +pub const INTERNET_FLAG_DONT_CACHE: DWORD = INTERNET_FLAG_NO_CACHE_WRITE; +pub const INTERNET_FLAG_MAKE_PERSISTENT: DWORD = 0x02000000; +pub const INTERNET_FLAG_FROM_CACHE: DWORD = 0x01000000; +pub const INTERNET_FLAG_OFFLINE: DWORD = INTERNET_FLAG_FROM_CACHE; +pub const INTERNET_FLAG_SECURE: DWORD = 0x00800000; +pub const INTERNET_FLAG_KEEP_CONNECTION: DWORD = 0x00400000; +pub const INTERNET_FLAG_NO_AUTO_REDIRECT: DWORD = 0x00200000; +pub const INTERNET_FLAG_READ_PREFETCH: DWORD = 0x00100000; +pub const INTERNET_FLAG_NO_COOKIES: DWORD = 0x00080000; +pub const INTERNET_FLAG_NO_AUTH: DWORD = 0x00040000; +pub const INTERNET_FLAG_RESTRICTED_ZONE: DWORD = 0x00020000; +pub const INTERNET_FLAG_CACHE_IF_NET_FAIL: DWORD = 0x00010000; +pub const INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP: DWORD = 0x00008000; +pub const INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS: DWORD = 0x00004000; +pub const INTERNET_FLAG_IGNORE_CERT_DATE_INVALID: DWORD = 0x00002000; +pub const INTERNET_FLAG_IGNORE_CERT_CN_INVALID: DWORD = 0x00001000; +pub const INTERNET_FLAG_RESYNCHRONIZE: DWORD = 0x00000800; +pub const INTERNET_FLAG_HYPERLINK: DWORD = 0x00000400; +pub const INTERNET_FLAG_NO_UI: DWORD = 0x00000200; +pub const INTERNET_FLAG_PRAGMA_NOCACHE: DWORD = 0x00000100; +pub const INTERNET_FLAG_CACHE_ASYNC: DWORD = 0x00000080; +pub const INTERNET_FLAG_FORMS_SUBMIT: DWORD = 0x00000040; +pub const INTERNET_FLAG_FWD_BACK: DWORD = 0x00000020; +pub const INTERNET_FLAG_NEED_FILE: DWORD = 0x00000010; +pub const INTERNET_FLAG_MUST_CACHE_REQUEST: DWORD = INTERNET_FLAG_NEED_FILE; +pub const INTERNET_FLAG_TRANSFER_ASCII: DWORD = FTP_TRANSFER_TYPE_ASCII; +pub const INTERNET_FLAG_TRANSFER_BINARY: DWORD = FTP_TRANSFER_TYPE_BINARY; +pub const SECURITY_INTERNET_MASK: DWORD = INTERNET_FLAG_IGNORE_CERT_CN_INVALID + | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS + | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP; +pub const SECURITY_IGNORE_ERROR_MASK: DWORD = INTERNET_FLAG_IGNORE_CERT_CN_INVALID + | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | SECURITY_FLAG_IGNORE_UNKNOWN_CA + | SECURITY_FLAG_IGNORE_REVOCATION; +pub const INTERNET_FLAGS_MASK: DWORD = INTERNET_FLAG_RELOAD | INTERNET_FLAG_RAW_DATA + | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_ASYNC | INTERNET_FLAG_PASSIVE + | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_MAKE_PERSISTENT | INTERNET_FLAG_FROM_CACHE + | INTERNET_FLAG_SECURE | INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_AUTO_REDIRECT + | INTERNET_FLAG_READ_PREFETCH | INTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_NO_AUTH + | INTERNET_FLAG_CACHE_IF_NET_FAIL | SECURITY_INTERNET_MASK | INTERNET_FLAG_RESYNCHRONIZE + | INTERNET_FLAG_HYPERLINK | INTERNET_FLAG_NO_UI | INTERNET_FLAG_PRAGMA_NOCACHE + | INTERNET_FLAG_CACHE_ASYNC | INTERNET_FLAG_FORMS_SUBMIT | INTERNET_FLAG_NEED_FILE + | INTERNET_FLAG_RESTRICTED_ZONE | INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_TRANSFER_ASCII + | INTERNET_FLAG_FWD_BACK | INTERNET_FLAG_BGUPDATE; +pub const INTERNET_ERROR_MASK_INSERT_CDROM: DWORD = 0x1; +pub const INTERNET_ERROR_MASK_COMBINED_SEC_CERT: DWORD = 0x2; +pub const INTERNET_ERROR_MASK_NEED_MSN_SSPI_PKG: DWORD = 0x4; +pub const INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY: DWORD = 0x8; +pub const INTERNET_OPTIONS_MASK: DWORD = !INTERNET_FLAGS_MASK; +pub const WININET_API_FLAG_ASYNC: DWORD = 0x00000001; +pub const WININET_API_FLAG_SYNC: DWORD = 0x00000004; +pub const WININET_API_FLAG_USE_CONTEXT: DWORD = 0x00000008; +pub const INTERNET_NO_CALLBACK: DWORD = 0; +ENUM!{enum INTERNET_SCHEME { + INTERNET_SCHEME_PARTIAL = -2i32 as u32, + INTERNET_SCHEME_UNKNOWN = -1i32 as u32, + INTERNET_SCHEME_DEFAULT = 0, + INTERNET_SCHEME_FTP, + INTERNET_SCHEME_GOPHER, + INTERNET_SCHEME_HTTP, + INTERNET_SCHEME_HTTPS, + INTERNET_SCHEME_FILE, + INTERNET_SCHEME_NEWS, + INTERNET_SCHEME_MAILTO, + INTERNET_SCHEME_SOCKS, + INTERNET_SCHEME_JAVASCRIPT, + INTERNET_SCHEME_VBSCRIPT, + INTERNET_SCHEME_RES, + INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP, + INTERNET_SCHEME_LAST = INTERNET_SCHEME_RES, +}} +pub type LPINTERNET_SCHEME = *mut INTERNET_SCHEME; +STRUCT!{struct INTERNET_ASYNC_RESULT { + dwResult: DWORD_PTR, + dwError: DWORD, +}} +pub type LPINTERNET_ASYNC_RESULT = *mut INTERNET_ASYNC_RESULT; +STRUCT!{struct INTERNET_DIAGNOSTIC_SOCKET_INFO { + Socket: DWORD_PTR, + SourcePort: DWORD, + DestPort: DWORD, + Flags: DWORD, +}} +pub type LPINTERNET_DIAGNOSTIC_SOCKET_INFO = *mut INTERNET_DIAGNOSTIC_SOCKET_INFO; +pub const IDSI_FLAG_KEEP_ALIVE: DWORD = 0x00000001; +pub const IDSI_FLAG_SECURE: DWORD = 0x00000002; +pub const IDSI_FLAG_PROXY: DWORD = 0x00000004; +pub const IDSI_FLAG_TUNNEL: DWORD = 0x00000008; +STRUCT!{struct INTERNET_PROXY_INFO { + dwAccessType: DWORD, + lpszProxy: LPCWSTR, + lpszProxyBypass: LPCWSTR, +}} +pub type LPINTERNET_PROXY_INFO = *mut INTERNET_PROXY_INFO; +UNION!{union INTERNET_PER_CONN_OPTIONA_Value { + [u32; 2] [u64; 1], + dwValue dwValue_mut: DWORD, + pszValue pszValue_mut: LPSTR, + ftValue ftValue_mut: FILETIME, +}} +STRUCT!{struct INTERNET_PER_CONN_OPTIONA { + dwOption: DWORD, + Value: INTERNET_PER_CONN_OPTIONA_Value, +}} +pub type LPINTERNET_PER_CONN_OPTIONA = *mut INTERNET_PER_CONN_OPTIONA; +UNION!{union INTERNET_PER_CONN_OPTIONW_Value { + [u32; 2] [u64; 1], + dwValue dwValue_mut: DWORD, + pszValue pszValue_mut: LPWSTR, + ftValue ftValue_mut: FILETIME, +}} +STRUCT!{struct INTERNET_PER_CONN_OPTIONW { + dwOption: DWORD, + Value: INTERNET_PER_CONN_OPTIONW_Value, +}} +pub type LPINTERNET_PER_CONN_OPTIONW = *mut INTERNET_PER_CONN_OPTIONW; +STRUCT!{struct INTERNET_PER_CONN_OPTION_LISTA { + dwSize: DWORD, + pszConnection: LPSTR, + dwOptionCount: DWORD, + dwOptionError: DWORD, + pOptions: LPINTERNET_PER_CONN_OPTIONA, +}} +pub type LPINTERNET_PER_CONN_OPTION_LISTA = *mut INTERNET_PER_CONN_OPTION_LISTA; +STRUCT!{struct INTERNET_PER_CONN_OPTION_LISTW { + dwSize: DWORD, + pszConnection: LPWSTR, + dwOptionCount: DWORD, + dwOptionError: DWORD, + pOptions: LPINTERNET_PER_CONN_OPTIONW, +}} +pub type LPINTERNET_PER_CONN_OPTION_LISTW = *mut INTERNET_PER_CONN_OPTION_LISTW; +pub const INTERNET_PER_CONN_FLAGS: DWORD = 1; +pub const INTERNET_PER_CONN_PROXY_SERVER: DWORD = 2; +pub const INTERNET_PER_CONN_PROXY_BYPASS: DWORD = 3; +pub const INTERNET_PER_CONN_AUTOCONFIG_URL: DWORD = 4; +pub const INTERNET_PER_CONN_AUTODISCOVERY_FLAGS: DWORD = 5; +pub const INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL: DWORD = 6; +pub const INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS: DWORD = 7; +pub const INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME: DWORD = 8; +pub const INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL: DWORD = 9; +pub const INTERNET_PER_CONN_FLAGS_UI: DWORD = 10; +pub const PROXY_TYPE_DIRECT: DWORD = 0x00000001; +pub const PROXY_TYPE_PROXY: DWORD = 0x00000002; +pub const PROXY_TYPE_AUTO_PROXY_URL: DWORD = 0x00000004; +pub const PROXY_TYPE_AUTO_DETECT: DWORD = 0x00000008; +pub const AUTO_PROXY_FLAG_USER_SET: DWORD = 0x00000001; +pub const AUTO_PROXY_FLAG_ALWAYS_DETECT: DWORD = 0x00000002; +pub const AUTO_PROXY_FLAG_DETECTION_RUN: DWORD = 0x00000004; +pub const AUTO_PROXY_FLAG_MIGRATED: DWORD = 0x00000008; +pub const AUTO_PROXY_FLAG_DONT_CACHE_PROXY_RESULT: DWORD = 0x00000010; +pub const AUTO_PROXY_FLAG_CACHE_INIT_RUN: DWORD = 0x00000020; +pub const AUTO_PROXY_FLAG_DETECTION_SUSPECT: DWORD = 0x00000040; +STRUCT!{struct INTERNET_VERSION_INFO { + dwMajorVersion: DWORD, + dwMinorVersion: DWORD, +}} +pub type LPINTERNET_VERSION_INFO = *mut INTERNET_VERSION_INFO; +STRUCT!{struct HTTP_VERSION_INFO { + dwMajorVersion: DWORD, + dwMinorVersion: DWORD, +}} +pub type LPHTTP_VERSION_INFO = *mut HTTP_VERSION_INFO; +STRUCT!{struct INTERNET_CONNECTED_INFO { + dwConnectedState: DWORD, + dwFlags: DWORD, +}} +pub type LPINTERNET_CONNECTED_INFO = *mut INTERNET_CONNECTED_INFO; +pub const ISO_FORCE_DISCONNECTED: DWORD = 0x00000001; +STRUCT!{struct URL_COMPONENTSA { + dwStructSize: DWORD, + lpszScheme: LPSTR, + dwSchemeLength: DWORD, + nScheme: INTERNET_SCHEME, + lpszHostName: LPSTR, + dwHostNameLength: DWORD, + nPort: INTERNET_PORT, + lpszUserName: LPSTR, + dwUserNameLength: DWORD, + lpszPassword: LPSTR, + dwPasswordLength: DWORD, + lpszUrlPath: LPSTR, + dwUrlPathLength: DWORD, + lpszExtraInfo: LPSTR, + dwExtraInfoLength: DWORD, +}} +pub type LPURL_COMPONENTSA = *mut URL_COMPONENTSA; +STRUCT!{struct URL_COMPONENTSW { + dwStructSize: DWORD, + lpszScheme: LPWSTR, + dwSchemeLength: DWORD, + nScheme: INTERNET_SCHEME, + lpszHostName: LPWSTR, + dwHostNameLength: DWORD, + nPort: INTERNET_PORT, + lpszUserName: LPWSTR, + dwUserNameLength: DWORD, + lpszPassword: LPWSTR, + dwPasswordLength: DWORD, + lpszUrlPath: LPWSTR, + dwUrlPathLength: DWORD, + lpszExtraInfo: LPWSTR, + dwExtraInfoLength: DWORD, +}} +pub type LPURL_COMPONENTSW = *mut URL_COMPONENTSW; +STRUCT!{struct INTERNET_CERTIFICATE_INFO { + ftExpiry: FILETIME, + ftStart: FILETIME, + lpszSubjectInfo: LPWSTR, + lpszIssuerInfo: LPWSTR, + lpszProtocolName: LPWSTR, + lpszSignatureAlgName: LPWSTR, + lpszEncryptionAlgName: LPWSTR, + dwKeySize: DWORD, +}} +pub type LPINTERNET_CERTIFICATE_INFO = *mut INTERNET_CERTIFICATE_INFO; +STRUCT!{struct INTERNET_BUFFERSA { + dwStructSize: DWORD, + Next: *mut INTERNET_BUFFERSA, + lpcszHeader: LPCSTR, + dwHeadersLength: DWORD, + dwHeadersTotal: DWORD, + lpvBuffer: LPVOID, + dwBufferLength: DWORD, + dwBufferTotal: DWORD, + dwOffsetLow: DWORD, + dwOffsetHigh: DWORD, +}} +pub type LPINTERNET_BUFFERSA = *mut INTERNET_BUFFERSA; +STRUCT!{struct INTERNET_BUFFERSW { + dwStructSize: DWORD, + Next: *mut INTERNET_BUFFERSW, + lpcszHeader: LPCWSTR, + dwHeadersLength: DWORD, + dwHeadersTotal: DWORD, + lpvBuffer: LPVOID, + dwBufferLength: DWORD, + dwBufferTotal: DWORD, + dwOffsetLow: DWORD, + dwOffsetHigh: DWORD, +}} +pub type LPINTERNET_BUFFERSW = *mut INTERNET_BUFFERSW; +pub const INTERNET_RFC1123_FORMAT: DWORD = 0; +pub const INTERNET_RFC1123_BUFSIZE: DWORD = 30; +pub const ICU_ESCAPE: DWORD = 0x80000000; +pub const ICU_USERNAME: DWORD = 0x40000000; +pub const ICU_NO_ENCODE: DWORD = 0x20000000; +pub const ICU_DECODE: DWORD = 0x10000000; +pub const ICU_NO_META: DWORD = 0x08000000; +pub const ICU_ENCODE_SPACES_ONLY: DWORD = 0x04000000; +pub const ICU_BROWSER_MODE: DWORD = 0x02000000; +pub const ICU_ENCODE_PERCENT: DWORD = 0x00001000; +pub const INTERNET_OPEN_TYPE_PRECONFIG: DWORD = 0; +pub const INTERNET_OPEN_TYPE_DIRECT: DWORD = 1; +pub const INTERNET_OPEN_TYPE_PROXY: DWORD = 3; +pub const INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY: DWORD = 4; +pub const PRE_CONFIG_INTERNET_ACCESS: DWORD = INTERNET_OPEN_TYPE_PRECONFIG; +pub const LOCAL_INTERNET_ACCESS: DWORD = INTERNET_OPEN_TYPE_DIRECT; +pub const CERN_PROXY_INTERNET_ACCESS: DWORD = INTERNET_OPEN_TYPE_PROXY; +pub const INTERNET_SERVICE_FTP: DWORD = 1; +pub const INTERNET_SERVICE_GOPHER: DWORD = 2; +pub const INTERNET_SERVICE_HTTP: DWORD = 3; +pub const IRF_ASYNC: DWORD = WININET_API_FLAG_ASYNC; +pub const IRF_SYNC: DWORD = WININET_API_FLAG_SYNC; +pub const IRF_USE_CONTEXT: DWORD = WININET_API_FLAG_USE_CONTEXT; +pub const IRF_NO_WAIT: DWORD = 0x00000008; +pub const ISO_GLOBAL: DWORD = 0x00000001; +pub const ISO_REGISTRY: DWORD = 0x00000002; +pub const ISO_VALID_FLAGS: DWORD = ISO_GLOBAL | ISO_REGISTRY; +pub const INTERNET_OPTION_CALLBACK: DWORD = 1; +pub const INTERNET_OPTION_CONNECT_TIMEOUT: DWORD = 2; +pub const INTERNET_OPTION_CONNECT_RETRIES: DWORD = 3; +pub const INTERNET_OPTION_CONNECT_BACKOFF: DWORD = 4; +pub const INTERNET_OPTION_SEND_TIMEOUT: DWORD = 5; +pub const INTERNET_OPTION_CONTROL_SEND_TIMEOUT: DWORD = INTERNET_OPTION_SEND_TIMEOUT; +pub const INTERNET_OPTION_RECEIVE_TIMEOUT: DWORD = 6; +pub const INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT: DWORD = INTERNET_OPTION_RECEIVE_TIMEOUT; +pub const INTERNET_OPTION_DATA_SEND_TIMEOUT: DWORD = 7; +pub const INTERNET_OPTION_DATA_RECEIVE_TIMEOUT: DWORD = 8; +pub const INTERNET_OPTION_HANDLE_TYPE: DWORD = 9; +pub const INTERNET_OPTION_LISTEN_TIMEOUT: DWORD = 11; +pub const INTERNET_OPTION_READ_BUFFER_SIZE: DWORD = 12; +pub const INTERNET_OPTION_WRITE_BUFFER_SIZE: DWORD = 13; +pub const INTERNET_OPTION_ASYNC_ID: DWORD = 15; +pub const INTERNET_OPTION_ASYNC_PRIORITY: DWORD = 16; +pub const INTERNET_OPTION_PARENT_HANDLE: DWORD = 21; +pub const INTERNET_OPTION_KEEP_CONNECTION: DWORD = 22; +pub const INTERNET_OPTION_REQUEST_FLAGS: DWORD = 23; +pub const INTERNET_OPTION_EXTENDED_ERROR: DWORD = 24; +pub const INTERNET_OPTION_OFFLINE_MODE: DWORD = 26; +pub const INTERNET_OPTION_CACHE_STREAM_HANDLE: DWORD = 27; +pub const INTERNET_OPTION_USERNAME: DWORD = 28; +pub const INTERNET_OPTION_PASSWORD: DWORD = 29; +pub const INTERNET_OPTION_ASYNC: DWORD = 30; +pub const INTERNET_OPTION_SECURITY_FLAGS: DWORD = 31; +pub const INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT: DWORD = 32; +pub const INTERNET_OPTION_DATAFILE_NAME: DWORD = 33; +pub const INTERNET_OPTION_URL: DWORD = 34; +pub const INTERNET_OPTION_SECURITY_CERTIFICATE: DWORD = 35; +pub const INTERNET_OPTION_SECURITY_KEY_BITNESS: DWORD = 36; +pub const INTERNET_OPTION_REFRESH: DWORD = 37; +pub const INTERNET_OPTION_PROXY: DWORD = 38; +pub const INTERNET_OPTION_SETTINGS_CHANGED: DWORD = 39; +pub const INTERNET_OPTION_VERSION: DWORD = 40; +pub const INTERNET_OPTION_USER_AGENT: DWORD = 41; +pub const INTERNET_OPTION_END_BROWSER_SESSION: DWORD = 42; +pub const INTERNET_OPTION_PROXY_USERNAME: DWORD = 43; +pub const INTERNET_OPTION_PROXY_PASSWORD: DWORD = 44; +pub const INTERNET_OPTION_CONTEXT_VALUE: DWORD = 45; +pub const INTERNET_OPTION_CONNECT_LIMIT: DWORD = 46; +pub const INTERNET_OPTION_SECURITY_SELECT_CLIENT_CERT: DWORD = 47; +pub const INTERNET_OPTION_POLICY: DWORD = 48; +pub const INTERNET_OPTION_DISCONNECTED_TIMEOUT: DWORD = 49; +pub const INTERNET_OPTION_CONNECTED_STATE: DWORD = 50; +pub const INTERNET_OPTION_IDLE_STATE: DWORD = 51; +pub const INTERNET_OPTION_OFFLINE_SEMANTICS: DWORD = 52; +pub const INTERNET_OPTION_SECONDARY_CACHE_KEY: DWORD = 53; +pub const INTERNET_OPTION_CALLBACK_FILTER: DWORD = 54; +pub const INTERNET_OPTION_CONNECT_TIME: DWORD = 55; +pub const INTERNET_OPTION_SEND_THROUGHPUT: DWORD = 56; +pub const INTERNET_OPTION_RECEIVE_THROUGHPUT: DWORD = 57; +pub const INTERNET_OPTION_REQUEST_PRIORITY: DWORD = 58; +pub const INTERNET_OPTION_HTTP_VERSION: DWORD = 59; +pub const INTERNET_OPTION_RESET_URLCACHE_SESSION: DWORD = 60; +pub const INTERNET_OPTION_ERROR_MASK: DWORD = 62; +pub const INTERNET_OPTION_FROM_CACHE_TIMEOUT: DWORD = 63; +pub const INTERNET_OPTION_BYPASS_EDITED_ENTRY: DWORD = 64; +pub const INTERNET_OPTION_HTTP_DECODING: DWORD = 65; +pub const INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO: DWORD = 67; +pub const INTERNET_OPTION_CODEPAGE: DWORD = 68; +pub const INTERNET_OPTION_CACHE_TIMESTAMPS: DWORD = 69; +pub const INTERNET_OPTION_DISABLE_AUTODIAL: DWORD = 70; +pub const INTERNET_OPTION_MAX_CONNS_PER_SERVER: DWORD = 73; +pub const INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER: DWORD = 74; +pub const INTERNET_OPTION_PER_CONNECTION_OPTION: DWORD = 75; +pub const INTERNET_OPTION_DIGEST_AUTH_UNLOAD: DWORD = 76; +pub const INTERNET_OPTION_IGNORE_OFFLINE: DWORD = 77; +pub const INTERNET_OPTION_IDENTITY: DWORD = 78; +pub const INTERNET_OPTION_REMOVE_IDENTITY: DWORD = 79; +pub const INTERNET_OPTION_ALTER_IDENTITY: DWORD = 80; +pub const INTERNET_OPTION_SUPPRESS_BEHAVIOR: DWORD = 81; +pub const INTERNET_OPTION_AUTODIAL_MODE: DWORD = 82; +pub const INTERNET_OPTION_AUTODIAL_CONNECTION: DWORD = 83; +pub const INTERNET_OPTION_CLIENT_CERT_CONTEXT: DWORD = 84; +pub const INTERNET_OPTION_AUTH_FLAGS: DWORD = 85; +pub const INTERNET_OPTION_COOKIES_3RD_PARTY: DWORD = 86; +pub const INTERNET_OPTION_DISABLE_PASSPORT_AUTH: DWORD = 87; +pub const INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY: DWORD = 88; +pub const INTERNET_OPTION_EXEMPT_CONNECTION_LIMIT: DWORD = 89; +pub const INTERNET_OPTION_ENABLE_PASSPORT_AUTH: DWORD = 90; +pub const INTERNET_OPTION_HIBERNATE_INACTIVE_WORKER_THREADS: DWORD = 91; +pub const INTERNET_OPTION_ACTIVATE_WORKER_THREADS: DWORD = 92; +pub const INTERNET_OPTION_RESTORE_WORKER_THREAD_DEFAULTS: DWORD = 93; +pub const INTERNET_OPTION_SOCKET_SEND_BUFFER_LENGTH: DWORD = 94; +pub const INTERNET_OPTION_PROXY_SETTINGS_CHANGED: DWORD = 95; +pub const INTERNET_OPTION_DATAFILE_EXT: DWORD = 96; +pub const INTERNET_OPTION_CODEPAGE_PATH: DWORD = 100; +pub const INTERNET_OPTION_CODEPAGE_EXTRA: DWORD = 101; +pub const INTERNET_OPTION_IDN: DWORD = 102; +pub const INTERNET_OPTION_MAX_CONNS_PER_PROXY: DWORD = 103; +pub const INTERNET_OPTION_SUPPRESS_SERVER_AUTH: DWORD = 104; +pub const INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT: DWORD = 105; +pub const INTERNET_OPTION_ENABLE_REDIRECT_CACHE_READ: DWORD = 122; +pub const INTERNET_OPTION_ENCODE_EXTRA: DWORD = 155; +pub const INTERNET_FIRST_OPTION: DWORD = INTERNET_OPTION_CALLBACK; +pub const INTERNET_LAST_OPTION: DWORD = INTERNET_OPTION_ENCODE_EXTRA; +pub const INTERNET_PRIORITY_FOREGROUND: DWORD = 1000; +pub const INTERNET_HANDLE_TYPE_INTERNET: DWORD = 1; +pub const INTERNET_HANDLE_TYPE_CONNECT_FTP: DWORD = 2; +pub const INTERNET_HANDLE_TYPE_CONNECT_GOPHER: DWORD = 3; +pub const INTERNET_HANDLE_TYPE_CONNECT_HTTP: DWORD = 4; +pub const INTERNET_HANDLE_TYPE_FTP_FIND: DWORD = 5; +pub const INTERNET_HANDLE_TYPE_FTP_FIND_HTML: DWORD = 6; +pub const INTERNET_HANDLE_TYPE_FTP_FILE: DWORD = 7; +pub const INTERNET_HANDLE_TYPE_FTP_FILE_HTML: DWORD = 8; +pub const INTERNET_HANDLE_TYPE_GOPHER_FIND: DWORD = 9; +pub const INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML: DWORD = 10; +pub const INTERNET_HANDLE_TYPE_GOPHER_FILE: DWORD = 11; +pub const INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML: DWORD = 12; +pub const INTERNET_HANDLE_TYPE_HTTP_REQUEST: DWORD = 13; +pub const INTERNET_HANDLE_TYPE_FILE_REQUEST: DWORD = 14; +pub const AUTH_FLAG_DISABLE_NEGOTIATE: DWORD = 0x00000001; +pub const AUTH_FLAG_ENABLE_NEGOTIATE: DWORD = 0x00000002; +pub const AUTH_FLAG_DISABLE_BASIC_CLEARCHANNEL: DWORD = 0x00000004; +pub const AUTH_FLAG_DISABLE_SERVER_AUTH: DWORD = 0x00000008; +pub const SECURITY_FLAG_SECURE: DWORD = 0x00000001; +pub const SECURITY_FLAG_STRENGTH_WEAK: DWORD = 0x10000000; +pub const SECURITY_FLAG_STRENGTH_MEDIUM: DWORD = 0x40000000; +pub const SECURITY_FLAG_STRENGTH_STRONG: DWORD = 0x20000000; +pub const SECURITY_FLAG_UNKNOWNBIT: DWORD = 0x80000000; +pub const SECURITY_FLAG_FORTEZZA: DWORD = 0x08000000; +pub const SECURITY_FLAG_NORMALBITNESS: DWORD = SECURITY_FLAG_STRENGTH_WEAK; +pub const SECURITY_FLAG_SSL: DWORD = 0x00000002; +pub const SECURITY_FLAG_SSL3: DWORD = 0x00000004; +pub const SECURITY_FLAG_PCT: DWORD = 0x00000008; +pub const SECURITY_FLAG_PCT4: DWORD = 0x00000010; +pub const SECURITY_FLAG_IETFSSL4: DWORD = 0x00000020; +pub const SECURITY_FLAG_40BIT: DWORD = SECURITY_FLAG_STRENGTH_WEAK; +pub const SECURITY_FLAG_128BIT: DWORD = SECURITY_FLAG_STRENGTH_STRONG; +pub const SECURITY_FLAG_56BIT: DWORD = SECURITY_FLAG_STRENGTH_MEDIUM; +pub const SECURITY_FLAG_IGNORE_REVOCATION: DWORD = 0x00000080; +pub const SECURITY_FLAG_IGNORE_UNKNOWN_CA: DWORD = 0x00000100; +pub const SECURITY_FLAG_IGNORE_WRONG_USAGE: DWORD = 0x00000200; +pub const SECURITY_FLAG_IGNORE_CERT_CN_INVALID: DWORD = INTERNET_FLAG_IGNORE_CERT_CN_INVALID; +pub const SECURITY_FLAG_IGNORE_CERT_DATE_INVALID: DWORD = INTERNET_FLAG_IGNORE_CERT_DATE_INVALID; +pub const SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS: DWORD = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS; +pub const SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP: DWORD = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP; +pub const SECURITY_SET_MASK: DWORD = SECURITY_FLAG_IGNORE_REVOCATION + | SECURITY_FLAG_IGNORE_UNKNOWN_CA | SECURITY_FLAG_IGNORE_CERT_CN_INVALID + | SECURITY_FLAG_IGNORE_CERT_DATE_INVALID | SECURITY_FLAG_IGNORE_WRONG_USAGE; +pub const AUTODIAL_MODE_NEVER: DWORD = 1; +pub const AUTODIAL_MODE_ALWAYS: DWORD = 2; +pub const AUTODIAL_MODE_NO_NETWORK_PRESENT: DWORD = 4; +FN!{stdcall INTERNET_STATUS_CALLBACK( + HINTERNET, + DWORD_PTR, + DWORD, + LPVOID, + DWORD, +) -> ()} +pub type LPINTERNET_STATUS_CALLBACK = *mut INTERNET_STATUS_CALLBACK; +pub const INTERNET_STATUS_RESOLVING_NAME: DWORD = 10; +pub const INTERNET_STATUS_NAME_RESOLVED: DWORD = 11; +pub const INTERNET_STATUS_CONNECTING_TO_SERVER: DWORD = 20; +pub const INTERNET_STATUS_CONNECTED_TO_SERVER: DWORD = 21; +pub const INTERNET_STATUS_SENDING_REQUEST: DWORD = 30; +pub const INTERNET_STATUS_REQUEST_SENT: DWORD = 31; +pub const INTERNET_STATUS_RECEIVING_RESPONSE: DWORD = 40; +pub const INTERNET_STATUS_RESPONSE_RECEIVED: DWORD = 41; +pub const INTERNET_STATUS_CTL_RESPONSE_RECEIVED: DWORD = 42; +pub const INTERNET_STATUS_PREFETCH: DWORD = 43; +pub const INTERNET_STATUS_CLOSING_CONNECTION: DWORD = 50; +pub const INTERNET_STATUS_CONNECTION_CLOSED: DWORD = 51; +pub const INTERNET_STATUS_HANDLE_CREATED: DWORD = 60; +pub const INTERNET_STATUS_HANDLE_CLOSING: DWORD = 70; +pub const INTERNET_STATUS_DETECTING_PROXY: DWORD = 80; +pub const INTERNET_STATUS_REQUEST_COMPLETE: DWORD = 100; +pub const INTERNET_STATUS_REDIRECT: DWORD = 110; +pub const INTERNET_STATUS_INTERMEDIATE_RESPONSE: DWORD = 120; +pub const INTERNET_STATUS_USER_INPUT_REQUIRED: DWORD = 140; +pub const INTERNET_STATUS_STATE_CHANGE: DWORD = 200; +pub const INTERNET_STATUS_COOKIE_SENT: DWORD = 320; +pub const INTERNET_STATUS_COOKIE_RECEIVED: DWORD = 321; +pub const INTERNET_STATUS_PRIVACY_IMPACTED: DWORD = 324; +pub const INTERNET_STATUS_P3P_HEADER: DWORD = 325; +pub const INTERNET_STATUS_P3P_POLICYREF: DWORD = 326; +pub const INTERNET_STATUS_COOKIE_HISTORY: DWORD = 327; +pub const INTERNET_STATE_CONNECTED: DWORD = 0x00000001; +pub const INTERNET_STATE_DISCONNECTED: DWORD = 0x00000002; +pub const INTERNET_STATE_DISCONNECTED_BY_USER: DWORD = 0x00000010; +pub const INTERNET_STATE_IDLE: DWORD = 0x00000100; +pub const INTERNET_STATE_BUSY: DWORD = 0x00000200; +ENUM!{enum InternetCookieState { + COOKIE_STATE_UNKNOWN = 0x0, + COOKIE_STATE_ACCEPT = 0x1, + COOKIE_STATE_PROMPT = 0x2, + COOKIE_STATE_LEASH = 0x3, + COOKIE_STATE_DOWNGRADE = 0x4, + COOKIE_STATE_REJECT = 0x5, + COOKIE_STATE_MAX = COOKIE_STATE_REJECT, +}} +STRUCT!{struct IncomingCookieState { + cSession: c_int, + cPersistent: c_int, + cAccepted: c_int, + cLeashed: c_int, + cDowngraded: c_int, + cBlocked: c_int, + pszLocation: LPCSTR, +}} +STRUCT!{struct OutgoingCookieState { + cSent: c_int, + cSuppressed: c_int, + pszLocation: LPCSTR, +}} +STRUCT!{struct InternetCookieHistory { + fAccepted: BOOL, + fLeashed: BOOL, + fDowngraded: BOOL, + fRejected: BOOL, +}} +STRUCT!{struct CookieDecision { + dwCookieState: DWORD, + fAllowSession: BOOL, +}} +pub const INTERNET_INVALID_STATUS_CALLBACK: usize = -1isize as usize; +pub const FTP_TRANSFER_TYPE_UNKNOWN: DWORD = 0x00000000; +pub const FTP_TRANSFER_TYPE_ASCII: DWORD = 0x00000001; +pub const FTP_TRANSFER_TYPE_BINARY: DWORD = 0x00000002; +pub const FTP_TRANSFER_TYPE_MASK: DWORD = FTP_TRANSFER_TYPE_ASCII | FTP_TRANSFER_TYPE_BINARY; +pub const MAX_GOPHER_DISPLAY_TEXT: usize = 128; +pub const MAX_GOPHER_SELECTOR_TEXT: usize = 256; +pub const MAX_GOPHER_HOST_NAME: usize = INTERNET_MAX_HOST_NAME_LENGTH; +pub const MAX_GOPHER_LOCATOR_LENGTH: usize = 1 + MAX_GOPHER_DISPLAY_TEXT + 1 + + MAX_GOPHER_SELECTOR_TEXT + 1 + MAX_GOPHER_HOST_NAME + 1 + INTERNET_MAX_PORT_NUMBER_LENGTH + + 1 + 1 + 2; +STRUCT!{struct GOPHER_FIND_DATAA { + DisplayString: [CHAR; MAX_GOPHER_DISPLAY_TEXT+ 1], + GopherType: DWORD, + SizeLow: DWORD, + SizeHigh: DWORD, + LastModificationTime: FILETIME, + Locator: [CHAR; MAX_GOPHER_LOCATOR_LENGTH + 1], +}} +pub type LPGOPHER_FIND_DATAA = *mut GOPHER_FIND_DATAA; +STRUCT!{struct GOPHER_FIND_DATAW { + DisplayString: [WCHAR; MAX_GOPHER_DISPLAY_TEXT+ 1], + GopherType: DWORD, + SizeLow: DWORD, + SizeHigh: DWORD, + LastModificationTime: FILETIME, + Locator: [WCHAR; MAX_GOPHER_LOCATOR_LENGTH + 1], +}} +pub type LPGOPHER_FIND_DATAW = *mut GOPHER_FIND_DATAW; +pub const GOPHER_TYPE_TEXT_FILE: DWORD = 0x00000001; +pub const GOPHER_TYPE_DIRECTORY: DWORD = 0x00000002; +pub const GOPHER_TYPE_CSO: DWORD = 0x00000004; +pub const GOPHER_TYPE_ERROR: DWORD = 0x00000008; +pub const GOPHER_TYPE_MAC_BINHEX: DWORD = 0x00000010; +pub const GOPHER_TYPE_DOS_ARCHIVE: DWORD = 0x00000020; +pub const GOPHER_TYPE_UNIX_UUENCODED: DWORD = 0x00000040; +pub const GOPHER_TYPE_INDEX_SERVER: DWORD = 0x00000080; +pub const GOPHER_TYPE_TELNET: DWORD = 0x00000100; +pub const GOPHER_TYPE_BINARY: DWORD = 0x00000200; +pub const GOPHER_TYPE_REDUNDANT: DWORD = 0x00000400; +pub const GOPHER_TYPE_TN3270: DWORD = 0x00000800; +pub const GOPHER_TYPE_GIF: DWORD = 0x00001000; +pub const GOPHER_TYPE_IMAGE: DWORD = 0x00002000; +pub const GOPHER_TYPE_BITMAP: DWORD = 0x00004000; +pub const GOPHER_TYPE_MOVIE: DWORD = 0x00008000; +pub const GOPHER_TYPE_SOUND: DWORD = 0x00010000; +pub const GOPHER_TYPE_HTML: DWORD = 0x00020000; +pub const GOPHER_TYPE_PDF: DWORD = 0x00040000; +pub const GOPHER_TYPE_CALENDAR: DWORD = 0x00080000; +pub const GOPHER_TYPE_INLINE: DWORD = 0x00100000; +pub const GOPHER_TYPE_UNKNOWN: DWORD = 0x20000000; +pub const GOPHER_TYPE_ASK: DWORD = 0x40000000; +pub const GOPHER_TYPE_GOPHER_PLUS: DWORD = 0x80000000; +#[inline] +pub fn IS_GOPHER_FILE(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_FILE_MASK) != 0 { TRUE } else { FALSE } +} +#[inline] +pub fn IS_GOPHER_DIRECTORY(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_DIRECTORY) != 0 { TRUE } else { FALSE } +} +#[inline] +pub fn IS_GOPHER_PHONE_SERVER(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_CSO) != 0 { TRUE } else { FALSE } +} +#[inline] +pub fn IS_GOPHER_ERROR(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_ERROR) != 0 { TRUE } else { FALSE } +} +#[inline] +pub fn IS_GOPHER_INDEX_SERVER(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_INDEX_SERVER) != 0 { TRUE } else { FALSE } +} +#[inline] +pub fn IS_GOPHER_TELNET_SESSION(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_TELNET) != 0 { TRUE } else { FALSE } +} +#[inline] +pub fn IS_GOPHER_BACKUP_SERVER(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_REDUNDANT) != 0 { TRUE } else { FALSE } +} +#[inline] +pub fn IS_GOPHER_TN3270_SESSION(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_TN3270) != 0 { TRUE } else { FALSE } +} +#[inline] +pub fn IS_GOPHER_ASK(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_ASK) != 0 { TRUE } else { FALSE } +} +#[inline] +pub fn IS_GOPHER_PLUS(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_GOPHER_PLUS) != 0 { TRUE } else { FALSE } +} +#[inline] +pub fn IS_GOPHER_TYPE_KNOWN(type_: DWORD) -> BOOL { + if (type_ & GOPHER_TYPE_UNKNOWN) != 0 { FALSE } else { TRUE } +} +pub const GOPHER_TYPE_FILE_MASK: DWORD = GOPHER_TYPE_TEXT_FILE | GOPHER_TYPE_MAC_BINHEX + | GOPHER_TYPE_DOS_ARCHIVE | GOPHER_TYPE_UNIX_UUENCODED | GOPHER_TYPE_BINARY | GOPHER_TYPE_GIF + | GOPHER_TYPE_IMAGE | GOPHER_TYPE_BITMAP | GOPHER_TYPE_MOVIE | GOPHER_TYPE_SOUND + | GOPHER_TYPE_HTML | GOPHER_TYPE_PDF | GOPHER_TYPE_CALENDAR | GOPHER_TYPE_INLINE; +STRUCT!{struct GOPHER_ADMIN_ATTRIBUTE_TYPE { + Comment: LPCWSTR, + EmailAddress: LPCWSTR, +}} +pub type LPGOPHER_ADMIN_ATTRIBUTE_TYPE = *mut GOPHER_ADMIN_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_MOD_DATE_ATTRIBUTE_TYPE { + DateAndTime: FILETIME, +}} +pub type LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE = *mut GOPHER_MOD_DATE_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_TTL_ATTRIBUTE_TYPE { + Ttl: DWORD, +}} +pub type LPGOPHER_TTL_ATTRIBUTE_TYPE = *mut GOPHER_TTL_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_SCORE_ATTRIBUTE_TYPE { + Score: INT, +}} +pub type LPGOPHER_SCORE_ATTRIBUTE_TYPE = *mut GOPHER_SCORE_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE { + LowerBound: INT, + UpperBound: INT, +}} +pub type LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE = *mut GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_SITE_ATTRIBUTE_TYPE { + Site: LPCWSTR, +}} +pub type LPGOPHER_SITE_ATTRIBUTE_TYPE = *mut GOPHER_SITE_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_ORGANIZATION_ATTRIBUTE_TYPE { + Organization: LPCWSTR, +}} +pub type LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPE = *mut GOPHER_ORGANIZATION_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_LOCATION_ATTRIBUTE_TYPE { + Location: LPCWSTR, +}} +pub type LPGOPHER_LOCATION_ATTRIBUTE_TYPE = *mut GOPHER_LOCATION_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE { + DegreesNorth: INT, + MinutesNorth: INT, + SecondsNorth: INT, + DegreesEast: INT, + MinutesEast: INT, + SecondsEast: INT, +}} +pub type LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE = + *mut GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_TIMEZONE_ATTRIBUTE_TYPE { + Zone: INT, +}} +pub type LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE = *mut GOPHER_TIMEZONE_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_PROVIDER_ATTRIBUTE_TYPE { + Provider: LPCWSTR, +}} +pub type LPGOPHER_PROVIDER_ATTRIBUTE_TYPE = *mut GOPHER_PROVIDER_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_VERSION_ATTRIBUTE_TYPE { + Version: LPCWSTR, +}} +pub type LPGOPHER_VERSION_ATTRIBUTE_TYPE = *mut GOPHER_VERSION_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_ABSTRACT_ATTRIBUTE_TYPE { + ShortAbstract: LPCWSTR, + AbstractFile: LPCWSTR, +}} +pub type LPGOPHER_ABSTRACT_ATTRIBUTE_TYPE = *mut GOPHER_ABSTRACT_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_VIEW_ATTRIBUTE_TYPE { + ContentType: LPCWSTR, + Language: LPCWSTR, + Size: DWORD, +}} +pub type LPGOPHER_VIEW_ATTRIBUTE_TYPE = *mut GOPHER_VIEW_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_VERONICA_ATTRIBUTE_TYPE { + TreeWalk: BOOL, +}} +pub type LPGOPHER_VERONICA_ATTRIBUTE_TYPE = *mut GOPHER_VERONICA_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_ASK_ATTRIBUTE_TYPE { + QuestionType: LPCWSTR, + QuestionText: LPCWSTR, +}} +pub type LPGOPHER_ASK_ATTRIBUTE_TYPE = *mut GOPHER_ASK_ATTRIBUTE_TYPE; +STRUCT!{struct GOPHER_UNKNOWN_ATTRIBUTE_TYPE { + Text: LPCWSTR, +}} +pub type LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE = *mut GOPHER_UNKNOWN_ATTRIBUTE_TYPE; +UNION!{union GOPHER_ATTRIBUTE_TYPE_AttributeType { + [u32; 6] [u64; 3], + Admin Admin_mut: GOPHER_ADMIN_ATTRIBUTE_TYPE, + ModDate ModDate_mut: GOPHER_MOD_DATE_ATTRIBUTE_TYPE, + Ttl Ttl_mut: GOPHER_TTL_ATTRIBUTE_TYPE, + Score Score_mut: GOPHER_SCORE_ATTRIBUTE_TYPE, + ScoreRange ScoreRange_mut: GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, + Site Site_mut: GOPHER_SITE_ATTRIBUTE_TYPE, + Organization Organization_mut: GOPHER_ORGANIZATION_ATTRIBUTE_TYPE, + Location Location_mut: GOPHER_LOCATION_ATTRIBUTE_TYPE, + GeographicalLocation GeographicalLocation_mut: GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, + TimeZone TimeZone_mut: GOPHER_TIMEZONE_ATTRIBUTE_TYPE, + Provider Provider_mut: GOPHER_PROVIDER_ATTRIBUTE_TYPE, + Version Version_mut: GOPHER_VERSION_ATTRIBUTE_TYPE, + Abstract Abstract_mut: GOPHER_ABSTRACT_ATTRIBUTE_TYPE, + View View_mut: GOPHER_VIEW_ATTRIBUTE_TYPE, + Veronica Veronica_mut: GOPHER_VERONICA_ATTRIBUTE_TYPE, + Ask Ask_mut: GOPHER_ASK_ATTRIBUTE_TYPE, + Unknown Unknown_mut: GOPHER_UNKNOWN_ATTRIBUTE_TYPE, +}} +STRUCT!{struct GOPHER_ATTRIBUTE_TYPE { + CategoryId: DWORD, + AttributeId: DWORD, + AttributeType: GOPHER_ATTRIBUTE_TYPE_AttributeType, +}} +pub type LPGOPHER_ATTRIBUTE_TYPE = *mut GOPHER_ATTRIBUTE_TYPE; +pub const MAX_GOPHER_CATEGORY_NAME: DWORD = 128; +pub const MAX_GOPHER_ATTRIBUTE_NAME: DWORD = 128; +pub const MIN_GOPHER_ATTRIBUTE_LENGTH: DWORD = 256; +pub const GOPHER_INFO_CATEGORY: &'static str = " + INFO"; +pub const GOPHER_ADMIN_CATEGORY: &'static str = " + ADMIN"; +pub const GOPHER_VIEWS_CATEGORY: &'static str = " + VIEWS"; +pub const GOPHER_ABSTRACT_CATEGORY: &'static str = " + ABSTRACT"; +pub const GOPHER_VERONICA_CATEGORY: &'static str = " + VERONICA"; +pub const GOPHER_ADMIN_ATTRIBUTE: &'static str = "Admin"; +pub const GOPHER_MOD_DATE_ATTRIBUTE: &'static str = "Mod-Date"; +pub const GOPHER_TTL_ATTRIBUTE: &'static str = "TTL"; +pub const GOPHER_SCORE_ATTRIBUTE: &'static str = "Score"; +pub const GOPHER_RANGE_ATTRIBUTE: &'static str = "Score-range"; +pub const GOPHER_SITE_ATTRIBUTE: &'static str = "Site"; +pub const GOPHER_ORG_ATTRIBUTE: &'static str = "Org"; +pub const GOPHER_LOCATION_ATTRIBUTE: &'static str = "Loc"; +pub const GOPHER_GEOG_ATTRIBUTE: &'static str = "Geog"; +pub const GOPHER_TIMEZONE_ATTRIBUTE: &'static str = "TZ"; +pub const GOPHER_PROVIDER_ATTRIBUTE: &'static str = "Provider"; +pub const GOPHER_VERSION_ATTRIBUTE: &'static str = "Version"; +pub const GOPHER_ABSTRACT_ATTRIBUTE: &'static str = "Abstract"; +pub const GOPHER_VIEW_ATTRIBUTE: &'static str = "View"; +pub const GOPHER_TREEWALK_ATTRIBUTE: &'static str = "treewalk"; +pub const GOPHER_ATTRIBUTE_ID_BASE: DWORD = 0xabcccc00; +pub const GOPHER_CATEGORY_ID_ALL: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 1; +pub const GOPHER_CATEGORY_ID_INFO: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 2; +pub const GOPHER_CATEGORY_ID_ADMIN: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 3; +pub const GOPHER_CATEGORY_ID_VIEWS: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 4; +pub const GOPHER_CATEGORY_ID_ABSTRACT: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 5; +pub const GOPHER_CATEGORY_ID_VERONICA: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 6; +pub const GOPHER_CATEGORY_ID_ASK: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 7; +pub const GOPHER_CATEGORY_ID_UNKNOWN: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 8; +pub const GOPHER_ATTRIBUTE_ID_ALL: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 9; +pub const GOPHER_ATTRIBUTE_ID_ADMIN: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 10; +pub const GOPHER_ATTRIBUTE_ID_MOD_DATE: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 11; +pub const GOPHER_ATTRIBUTE_ID_TTL: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 12; +pub const GOPHER_ATTRIBUTE_ID_SCORE: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 13; +pub const GOPHER_ATTRIBUTE_ID_RANGE: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 14; +pub const GOPHER_ATTRIBUTE_ID_SITE: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 15; +pub const GOPHER_ATTRIBUTE_ID_ORG: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 16; +pub const GOPHER_ATTRIBUTE_ID_LOCATION: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 17; +pub const GOPHER_ATTRIBUTE_ID_GEOG: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 18; +pub const GOPHER_ATTRIBUTE_ID_TIMEZONE: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 19; +pub const GOPHER_ATTRIBUTE_ID_PROVIDER: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 20; +pub const GOPHER_ATTRIBUTE_ID_VERSION: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 21; +pub const GOPHER_ATTRIBUTE_ID_ABSTRACT: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 22; +pub const GOPHER_ATTRIBUTE_ID_VIEW: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 23; +pub const GOPHER_ATTRIBUTE_ID_TREEWALK: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 24; +pub const GOPHER_ATTRIBUTE_ID_UNKNOWN: DWORD = GOPHER_ATTRIBUTE_ID_BASE + 25; +FN!{stdcall GOPHER_ATTRIBUTE_ENUMERATOR( + LPGOPHER_ATTRIBUTE_TYPE, + DWORD, +) -> BOOL} +pub const HTTP_MAJOR_VERSION: DWORD = 1; +pub const HTTP_MINOR_VERSION: DWORD = 0; +pub const HTTP_VERSION: &'static str = "HTTP/1.0"; +pub const HTTP_QUERY_MIME_VERSION: DWORD = 0; +pub const HTTP_QUERY_CONTENT_TYPE: DWORD = 1; +pub const HTTP_QUERY_CONTENT_TRANSFER_ENCODING: DWORD = 2; +pub const HTTP_QUERY_CONTENT_ID: DWORD = 3; +pub const HTTP_QUERY_CONTENT_DESCRIPTION: DWORD = 4; +pub const HTTP_QUERY_CONTENT_LENGTH: DWORD = 5; +pub const HTTP_QUERY_CONTENT_LANGUAGE: DWORD = 6; +pub const HTTP_QUERY_ALLOW: DWORD = 7; +pub const HTTP_QUERY_PUBLIC: DWORD = 8; +pub const HTTP_QUERY_DATE: DWORD = 9; +pub const HTTP_QUERY_EXPIRES: DWORD = 10; +pub const HTTP_QUERY_LAST_MODIFIED: DWORD = 11; +pub const HTTP_QUERY_MESSAGE_ID: DWORD = 12; +pub const HTTP_QUERY_URI: DWORD = 13; +pub const HTTP_QUERY_DERIVED_FROM: DWORD = 14; +pub const HTTP_QUERY_COST: DWORD = 15; +pub const HTTP_QUERY_LINK: DWORD = 16; +pub const HTTP_QUERY_PRAGMA: DWORD = 17; +pub const HTTP_QUERY_VERSION: DWORD = 18; +pub const HTTP_QUERY_STATUS_CODE: DWORD = 19; +pub const HTTP_QUERY_STATUS_TEXT: DWORD = 20; +pub const HTTP_QUERY_RAW_HEADERS: DWORD = 21; +pub const HTTP_QUERY_RAW_HEADERS_CRLF: DWORD = 22; +pub const HTTP_QUERY_CONNECTION: DWORD = 23; +pub const HTTP_QUERY_ACCEPT: DWORD = 24; +pub const HTTP_QUERY_ACCEPT_CHARSET: DWORD = 25; +pub const HTTP_QUERY_ACCEPT_ENCODING: DWORD = 26; +pub const HTTP_QUERY_ACCEPT_LANGUAGE: DWORD = 27; +pub const HTTP_QUERY_AUTHORIZATION: DWORD = 28; +pub const HTTP_QUERY_CONTENT_ENCODING: DWORD = 29; +pub const HTTP_QUERY_FORWARDED: DWORD = 30; +pub const HTTP_QUERY_FROM: DWORD = 31; +pub const HTTP_QUERY_IF_MODIFIED_SINCE: DWORD = 32; +pub const HTTP_QUERY_LOCATION: DWORD = 33; +pub const HTTP_QUERY_ORIG_URI: DWORD = 34; +pub const HTTP_QUERY_REFERER: DWORD = 35; +pub const HTTP_QUERY_RETRY_AFTER: DWORD = 36; +pub const HTTP_QUERY_SERVER: DWORD = 37; +pub const HTTP_QUERY_TITLE: DWORD = 38; +pub const HTTP_QUERY_USER_AGENT: DWORD = 39; +pub const HTTP_QUERY_WWW_AUTHENTICATE: DWORD = 40; +pub const HTTP_QUERY_PROXY_AUTHENTICATE: DWORD = 41; +pub const HTTP_QUERY_ACCEPT_RANGES: DWORD = 42; +pub const HTTP_QUERY_SET_COOKIE: DWORD = 43; +pub const HTTP_QUERY_COOKIE: DWORD = 44; +pub const HTTP_QUERY_REQUEST_METHOD: DWORD = 45; +pub const HTTP_QUERY_REFRESH: DWORD = 46; +pub const HTTP_QUERY_CONTENT_DISPOSITION: DWORD = 47; +pub const HTTP_QUERY_AGE: DWORD = 48; +pub const HTTP_QUERY_CACHE_CONTROL: DWORD = 49; +pub const HTTP_QUERY_CONTENT_BASE: DWORD = 50; +pub const HTTP_QUERY_CONTENT_LOCATION: DWORD = 51; +pub const HTTP_QUERY_CONTENT_MD5: DWORD = 52; +pub const HTTP_QUERY_CONTENT_RANGE: DWORD = 53; +pub const HTTP_QUERY_ETAG: DWORD = 54; +pub const HTTP_QUERY_HOST: DWORD = 55; +pub const HTTP_QUERY_IF_MATCH: DWORD = 56; +pub const HTTP_QUERY_IF_NONE_MATCH: DWORD = 57; +pub const HTTP_QUERY_IF_RANGE: DWORD = 58; +pub const HTTP_QUERY_IF_UNMODIFIED_SINCE: DWORD = 59; +pub const HTTP_QUERY_MAX_FORWARDS: DWORD = 60; +pub const HTTP_QUERY_PROXY_AUTHORIZATION: DWORD = 61; +pub const HTTP_QUERY_RANGE: DWORD = 62; +pub const HTTP_QUERY_TRANSFER_ENCODING: DWORD = 63; +pub const HTTP_QUERY_UPGRADE: DWORD = 64; +pub const HTTP_QUERY_VARY: DWORD = 65; +pub const HTTP_QUERY_VIA: DWORD = 66; +pub const HTTP_QUERY_WARNING: DWORD = 67; +pub const HTTP_QUERY_EXPECT: DWORD = 68; +pub const HTTP_QUERY_PROXY_CONNECTION: DWORD = 69; +pub const HTTP_QUERY_UNLESS_MODIFIED_SINCE: DWORD = 70; +pub const HTTP_QUERY_ECHO_REQUEST: DWORD = 71; +pub const HTTP_QUERY_ECHO_REPLY: DWORD = 72; +pub const HTTP_QUERY_ECHO_HEADERS: DWORD = 73; +pub const HTTP_QUERY_ECHO_HEADERS_CRLF: DWORD = 74; +pub const HTTP_QUERY_PROXY_SUPPORT: DWORD = 75; +pub const HTTP_QUERY_AUTHENTICATION_INFO: DWORD = 76; +pub const HTTP_QUERY_PASSPORT_URLS: DWORD = 77; +pub const HTTP_QUERY_PASSPORT_CONFIG: DWORD = 78; +pub const HTTP_QUERY_X_CONTENT_TYPE_OPTIONS: DWORD = 79; +pub const HTTP_QUERY_P3P: DWORD = 80; +pub const HTTP_QUERY_X_P2P_PEERDIST: DWORD = 81; +pub const HTTP_QUERY_TRANSLATE: DWORD = 82; +pub const HTTP_QUERY_X_UA_COMPATIBLE: DWORD = 83; +pub const HTTP_QUERY_DEFAULT_STYLE: DWORD = 84; +pub const HTTP_QUERY_X_FRAME_OPTIONS: DWORD = 85; +pub const HTTP_QUERY_X_XSS_PROTECTION: DWORD = 86; +pub const HTTP_QUERY_SET_COOKIE2: DWORD = 87; +pub const HTTP_QUERY_DO_NOT_TRACK: DWORD = 88; +pub const HTTP_QUERY_KEEP_ALIVE: DWORD = 89; +pub const HTTP_QUERY_MAX: DWORD = 89; +pub const HTTP_QUERY_CUSTOM: DWORD = 65535; +pub const HTTP_QUERY_FLAG_REQUEST_HEADERS: DWORD = 0x80000000; +pub const HTTP_QUERY_FLAG_SYSTEMTIME: DWORD = 0x40000000; +pub const HTTP_QUERY_FLAG_NUMBER: DWORD = 0x20000000; +pub const HTTP_QUERY_FLAG_COALESCE: DWORD = 0x10000000; +pub const HTTP_QUERY_FLAG_NUMBER64: DWORD = 0x08000000; +pub const HTTP_QUERY_MODIFIER_FLAGS_MASK: DWORD = HTTP_QUERY_FLAG_REQUEST_HEADERS + | HTTP_QUERY_FLAG_SYSTEMTIME | HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_FLAG_COALESCE + | HTTP_QUERY_FLAG_NUMBER64; +pub const HTTP_QUERY_HEADER_MASK: DWORD = !HTTP_QUERY_MODIFIER_FLAGS_MASK; +pub const HTTP_STATUS_CONTINUE: DWORD = 100; +pub const HTTP_STATUS_SWITCH_PROTOCOLS: DWORD = 101; +pub const HTTP_STATUS_OK: DWORD = 200; +pub const HTTP_STATUS_CREATED: DWORD = 201; +pub const HTTP_STATUS_ACCEPTED: DWORD = 202; +pub const HTTP_STATUS_PARTIAL: DWORD = 203; +pub const HTTP_STATUS_NO_CONTENT: DWORD = 204; +pub const HTTP_STATUS_RESET_CONTENT: DWORD = 205; +pub const HTTP_STATUS_PARTIAL_CONTENT: DWORD = 206; +pub const HTTP_STATUS_AMBIGUOUS: DWORD = 300; +pub const HTTP_STATUS_MOVED: DWORD = 301; +pub const HTTP_STATUS_REDIRECT: DWORD = 302; +pub const HTTP_STATUS_REDIRECT_METHOD: DWORD = 303; +pub const HTTP_STATUS_NOT_MODIFIED: DWORD = 304; +pub const HTTP_STATUS_USE_PROXY: DWORD = 305; +pub const HTTP_STATUS_REDIRECT_KEEP_VERB: DWORD = 307; +pub const HTTP_STATUS_BAD_REQUEST: DWORD = 400; +pub const HTTP_STATUS_DENIED: DWORD = 401; +pub const HTTP_STATUS_PAYMENT_REQ: DWORD = 402; +pub const HTTP_STATUS_FORBIDDEN: DWORD = 403; +pub const HTTP_STATUS_NOT_FOUND: DWORD = 404; +pub const HTTP_STATUS_BAD_METHOD: DWORD = 405; +pub const HTTP_STATUS_NONE_ACCEPTABLE: DWORD = 406; +pub const HTTP_STATUS_PROXY_AUTH_REQ: DWORD = 407; +pub const HTTP_STATUS_REQUEST_TIMEOUT: DWORD = 408; +pub const HTTP_STATUS_CONFLICT: DWORD = 409; +pub const HTTP_STATUS_GONE: DWORD = 410; +pub const HTTP_STATUS_LENGTH_REQUIRED: DWORD = 411; +pub const HTTP_STATUS_PRECOND_FAILED: DWORD = 412; +pub const HTTP_STATUS_REQUEST_TOO_LARGE: DWORD = 413; +pub const HTTP_STATUS_URI_TOO_LONG: DWORD = 414; +pub const HTTP_STATUS_UNSUPPORTED_MEDIA: DWORD = 415; +pub const HTTP_STATUS_RETRY_WITH: DWORD = 449; +pub const HTTP_STATUS_SERVER_ERROR: DWORD = 500; +pub const HTTP_STATUS_NOT_SUPPORTED: DWORD = 501; +pub const HTTP_STATUS_BAD_GATEWAY: DWORD = 502; +pub const HTTP_STATUS_SERVICE_UNAVAIL: DWORD = 503; +pub const HTTP_STATUS_GATEWAY_TIMEOUT: DWORD = 504; +pub const HTTP_STATUS_VERSION_NOT_SUP: DWORD = 505; +pub const HTTP_STATUS_FIRST: DWORD = HTTP_STATUS_CONTINUE; +pub const HTTP_STATUS_LAST: DWORD = HTTP_STATUS_VERSION_NOT_SUP; +pub const HTTP_ADDREQ_INDEX_MASK: DWORD = 0x0000FFFF; +pub const HTTP_ADDREQ_FLAGS_MASK: DWORD = 0xFFFF0000; +pub const HTTP_ADDREQ_FLAG_ADD_IF_NEW: DWORD = 0x10000000; +pub const HTTP_ADDREQ_FLAG_ADD: DWORD = 0x20000000; +pub const HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA: DWORD = 0x40000000; +pub const HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON: DWORD = 0x01000000; +pub const HTTP_ADDREQ_FLAG_COALESCE: DWORD = HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA; +pub const HTTP_ADDREQ_FLAG_REPLACE: DWORD = 0x80000000; +pub const HSR_ASYNC: DWORD = WININET_API_FLAG_ASYNC; +pub const HSR_SYNC: DWORD = WININET_API_FLAG_SYNC; +pub const HSR_USE_CONTEXT: DWORD = WININET_API_FLAG_USE_CONTEXT; +pub const HSR_INITIATE: DWORD = 0x00000008; +pub const HSR_DOWNLOAD: DWORD = 0x00000010; +pub const HSR_CHUNKED: DWORD = 0x00000020; +STRUCT!{struct INTERNET_COOKIE2 { + pwszName: PWSTR, + pwszValue: PWSTR, + pwszDomain: PWSTR, + pwszPath: PWSTR, + dwFlags: DWORD, + ftExpires: FILETIME, + fExpiresSet: BOOL, +}} +pub const INTERNET_COOKIE_IS_SECURE: DWORD = 0x01; +pub const INTERNET_COOKIE_IS_SESSION: DWORD = 0x02; +pub const INTERNET_COOKIE_THIRD_PARTY: DWORD = 0x10; +pub const INTERNET_COOKIE_PROMPT_REQUIRED: DWORD = 0x20; +pub const INTERNET_COOKIE_EVALUATE_P3P: DWORD = 0x40; +pub const INTERNET_COOKIE_APPLY_P3P: DWORD = 0x80; +pub const INTERNET_COOKIE_P3P_ENABLED: DWORD = 0x100; +pub const INTERNET_COOKIE_IS_RESTRICTED: DWORD = 0x200; +pub const INTERNET_COOKIE_IE6: DWORD = 0x400; +pub const INTERNET_COOKIE_IS_LEGACY: DWORD = 0x800; +pub const INTERNET_COOKIE_NON_SCRIPT: DWORD = 0x00001000; +pub const INTERNET_COOKIE_HTTPONLY: DWORD = 0x00002000; +pub const FLAG_ICC_FORCE_CONNECTION: DWORD = 0x00000001; +pub const FLAGS_ERROR_UI_FILTER_FOR_ERRORS: DWORD = 0x01; +pub const FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS: DWORD = 0x02; +pub const FLAGS_ERROR_UI_FLAGS_GENERATE_DATA: DWORD = 0x04; +pub const FLAGS_ERROR_UI_FLAGS_NO_UI: DWORD = 0x08; +pub const FLAGS_ERROR_UI_SERIALIZE_DIALOGS: DWORD = 0x10; +FN!{stdcall PFN_AUTH_NOTIFY( + DWORD_PTR, + DWORD, + LPVOID, +) -> DWORD} +STRUCT!{struct INTERNET_AUTH_NOTIFY_DATA { + cbStruct: DWORD, + dwOptions: DWORD, + pfnNotify: PFN_AUTH_NOTIFY, + dwContext: DWORD_PTR, +}} +pub const INTERNET_ERROR_BASE: DWORD = 12000; +pub const ERROR_INTERNET_OUT_OF_HANDLES: DWORD = INTERNET_ERROR_BASE + 1; +pub const ERROR_INTERNET_TIMEOUT: DWORD = INTERNET_ERROR_BASE + 2; +pub const ERROR_INTERNET_EXTENDED_ERROR: DWORD = INTERNET_ERROR_BASE + 3; +pub const ERROR_INTERNET_INTERNAL_ERROR: DWORD = INTERNET_ERROR_BASE + 4; +pub const ERROR_INTERNET_INVALID_URL: DWORD = INTERNET_ERROR_BASE + 5; +pub const ERROR_INTERNET_UNRECOGNIZED_SCHEME: DWORD = INTERNET_ERROR_BASE + 6; +pub const ERROR_INTERNET_NAME_NOT_RESOLVED: DWORD = INTERNET_ERROR_BASE + 7; +pub const ERROR_INTERNET_PROTOCOL_NOT_FOUND: DWORD = INTERNET_ERROR_BASE + 8; +pub const ERROR_INTERNET_INVALID_OPTION: DWORD = INTERNET_ERROR_BASE + 9; +pub const ERROR_INTERNET_BAD_OPTION_LENGTH: DWORD = INTERNET_ERROR_BASE + 10; +pub const ERROR_INTERNET_OPTION_NOT_SETTABLE: DWORD = INTERNET_ERROR_BASE + 11; +pub const ERROR_INTERNET_SHUTDOWN: DWORD = INTERNET_ERROR_BASE + 12; +pub const ERROR_INTERNET_INCORRECT_USER_NAME: DWORD = INTERNET_ERROR_BASE + 13; +pub const ERROR_INTERNET_INCORRECT_PASSWORD: DWORD = INTERNET_ERROR_BASE + 14; +pub const ERROR_INTERNET_LOGIN_FAILURE: DWORD = INTERNET_ERROR_BASE + 15; +pub const ERROR_INTERNET_INVALID_OPERATION: DWORD = INTERNET_ERROR_BASE + 16; +pub const ERROR_INTERNET_OPERATION_CANCELLED: DWORD = INTERNET_ERROR_BASE + 17; +pub const ERROR_INTERNET_INCORRECT_HANDLE_TYPE: DWORD = INTERNET_ERROR_BASE + 18; +pub const ERROR_INTERNET_INCORRECT_HANDLE_STATE: DWORD = INTERNET_ERROR_BASE + 19; +pub const ERROR_INTERNET_NOT_PROXY_REQUEST: DWORD = INTERNET_ERROR_BASE + 20; +pub const ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND: DWORD = INTERNET_ERROR_BASE + 21; +pub const ERROR_INTERNET_BAD_REGISTRY_PARAMETER: DWORD = INTERNET_ERROR_BASE + 22; +pub const ERROR_INTERNET_NO_DIRECT_ACCESS: DWORD = INTERNET_ERROR_BASE + 23; +pub const ERROR_INTERNET_NO_CONTEXT: DWORD = INTERNET_ERROR_BASE + 24; +pub const ERROR_INTERNET_NO_CALLBACK: DWORD = INTERNET_ERROR_BASE + 25; +pub const ERROR_INTERNET_REQUEST_PENDING: DWORD = INTERNET_ERROR_BASE + 26; +pub const ERROR_INTERNET_INCORRECT_FORMAT: DWORD = INTERNET_ERROR_BASE + 27; +pub const ERROR_INTERNET_ITEM_NOT_FOUND: DWORD = INTERNET_ERROR_BASE + 28; +pub const ERROR_INTERNET_CANNOT_CONNECT: DWORD = INTERNET_ERROR_BASE + 29; +pub const ERROR_INTERNET_CONNECTION_ABORTED: DWORD = INTERNET_ERROR_BASE + 30; +pub const ERROR_INTERNET_CONNECTION_RESET: DWORD = INTERNET_ERROR_BASE + 31; +pub const ERROR_INTERNET_FORCE_RETRY: DWORD = INTERNET_ERROR_BASE + 32; +pub const ERROR_INTERNET_INVALID_PROXY_REQUEST: DWORD = INTERNET_ERROR_BASE + 33; +pub const ERROR_INTERNET_NEED_UI: DWORD = INTERNET_ERROR_BASE + 34; +pub const ERROR_INTERNET_HANDLE_EXISTS: DWORD = INTERNET_ERROR_BASE + 36; +pub const ERROR_INTERNET_SEC_CERT_DATE_INVALID: DWORD = INTERNET_ERROR_BASE + 37; +pub const ERROR_INTERNET_SEC_CERT_CN_INVALID: DWORD = INTERNET_ERROR_BASE + 38; +pub const ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR: DWORD = INTERNET_ERROR_BASE + 39; +pub const ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR: DWORD = INTERNET_ERROR_BASE + 40; +pub const ERROR_INTERNET_MIXED_SECURITY: DWORD = INTERNET_ERROR_BASE + 41; +pub const ERROR_INTERNET_CHG_POST_IS_NON_SECURE: DWORD = INTERNET_ERROR_BASE + 42; +pub const ERROR_INTERNET_POST_IS_NON_SECURE: DWORD = INTERNET_ERROR_BASE + 43; +pub const ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED: DWORD = INTERNET_ERROR_BASE + 44; +pub const ERROR_INTERNET_INVALID_CA: DWORD = INTERNET_ERROR_BASE + 45; +pub const ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP: DWORD = INTERNET_ERROR_BASE + 46; +pub const ERROR_INTERNET_ASYNC_THREAD_FAILED: DWORD = INTERNET_ERROR_BASE + 47; +pub const ERROR_INTERNET_REDIRECT_SCHEME_CHANGE: DWORD = INTERNET_ERROR_BASE + 48; +pub const ERROR_INTERNET_DIALOG_PENDING: DWORD = INTERNET_ERROR_BASE + 49; +pub const ERROR_INTERNET_RETRY_DIALOG: DWORD = INTERNET_ERROR_BASE + 50; +pub const ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR: DWORD = INTERNET_ERROR_BASE + 52; +pub const ERROR_INTERNET_INSERT_CDROM: DWORD = INTERNET_ERROR_BASE + 53; +pub const ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED: DWORD = INTERNET_ERROR_BASE + 54; +pub const ERROR_INTERNET_SEC_CERT_ERRORS: DWORD = INTERNET_ERROR_BASE + 55; +pub const ERROR_INTERNET_SEC_CERT_NO_REV: DWORD = INTERNET_ERROR_BASE + 56; +pub const ERROR_INTERNET_SEC_CERT_REV_FAILED: DWORD = INTERNET_ERROR_BASE + 57; +pub const ERROR_FTP_TRANSFER_IN_PROGRESS: DWORD = INTERNET_ERROR_BASE + 110; +pub const ERROR_FTP_DROPPED: DWORD = INTERNET_ERROR_BASE + 111; +pub const ERROR_FTP_NO_PASSIVE_MODE: DWORD = INTERNET_ERROR_BASE + 112; +pub const ERROR_GOPHER_PROTOCOL_ERROR: DWORD = INTERNET_ERROR_BASE + 130; +pub const ERROR_GOPHER_NOT_FILE: DWORD = INTERNET_ERROR_BASE + 131; +pub const ERROR_GOPHER_DATA_ERROR: DWORD = INTERNET_ERROR_BASE + 132; +pub const ERROR_GOPHER_END_OF_DATA: DWORD = INTERNET_ERROR_BASE + 133; +pub const ERROR_GOPHER_INVALID_LOCATOR: DWORD = INTERNET_ERROR_BASE + 134; +pub const ERROR_GOPHER_INCORRECT_LOCATOR_TYPE: DWORD = INTERNET_ERROR_BASE + 135; +pub const ERROR_GOPHER_NOT_GOPHER_PLUS: DWORD = INTERNET_ERROR_BASE + 136; +pub const ERROR_GOPHER_ATTRIBUTE_NOT_FOUND: DWORD = INTERNET_ERROR_BASE + 137; +pub const ERROR_GOPHER_UNKNOWN_LOCATOR: DWORD = INTERNET_ERROR_BASE + 138; +pub const ERROR_HTTP_HEADER_NOT_FOUND: DWORD = INTERNET_ERROR_BASE + 150; +pub const ERROR_HTTP_DOWNLEVEL_SERVER: DWORD = INTERNET_ERROR_BASE + 151; +pub const ERROR_HTTP_INVALID_SERVER_RESPONSE: DWORD = INTERNET_ERROR_BASE + 152; +pub const ERROR_HTTP_INVALID_HEADER: DWORD = INTERNET_ERROR_BASE + 153; +pub const ERROR_HTTP_INVALID_QUERY_REQUEST: DWORD = INTERNET_ERROR_BASE + 154; +pub const ERROR_HTTP_HEADER_ALREADY_EXISTS: DWORD = INTERNET_ERROR_BASE + 155; +pub const ERROR_HTTP_REDIRECT_FAILED: DWORD = INTERNET_ERROR_BASE + 156; +pub const ERROR_HTTP_NOT_REDIRECTED: DWORD = INTERNET_ERROR_BASE + 160; +pub const ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION: DWORD = INTERNET_ERROR_BASE + 161; +pub const ERROR_HTTP_COOKIE_DECLINED: DWORD = INTERNET_ERROR_BASE + 162; +pub const ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION: DWORD = INTERNET_ERROR_BASE + 168; +pub const ERROR_INTERNET_SECURITY_CHANNEL_ERROR: DWORD = INTERNET_ERROR_BASE + 157; +pub const ERROR_INTERNET_UNABLE_TO_CACHE_FILE: DWORD = INTERNET_ERROR_BASE + 158; +pub const ERROR_INTERNET_TCPIP_NOT_INSTALLED: DWORD = INTERNET_ERROR_BASE + 159; +pub const ERROR_INTERNET_DISCONNECTED: DWORD = INTERNET_ERROR_BASE + 163; +pub const ERROR_INTERNET_SERVER_UNREACHABLE: DWORD = INTERNET_ERROR_BASE + 164; +pub const ERROR_INTERNET_PROXY_SERVER_UNREACHABLE: DWORD = INTERNET_ERROR_BASE + 165; +pub const ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT: DWORD = INTERNET_ERROR_BASE + 166; +pub const ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT: DWORD = INTERNET_ERROR_BASE + 167; +pub const ERROR_INTERNET_SEC_INVALID_CERT: DWORD = INTERNET_ERROR_BASE + 169; +pub const ERROR_INTERNET_SEC_CERT_REVOKED: DWORD = INTERNET_ERROR_BASE + 170; +pub const ERROR_INTERNET_FAILED_DUETOSECURITYCHECK: DWORD = INTERNET_ERROR_BASE + 171; +pub const ERROR_INTERNET_NOT_INITIALIZED: DWORD = INTERNET_ERROR_BASE + 172; +pub const ERROR_INTERNET_NEED_MSN_SSPI_PKG: DWORD = INTERNET_ERROR_BASE + 173; +pub const ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY: DWORD = INTERNET_ERROR_BASE + 174; +pub const ERROR_INTERNET_DECODING_FAILED: DWORD = INTERNET_ERROR_BASE + 175; +pub const INTERNET_ERROR_LAST: DWORD = ERROR_INTERNET_DECODING_FAILED; +pub const NORMAL_CACHE_ENTRY: DWORD = 0x00000001; +pub const STICKY_CACHE_ENTRY: DWORD = 0x00000004; +pub const EDITED_CACHE_ENTRY: DWORD = 0x00000008; +pub const TRACK_OFFLINE_CACHE_ENTRY: DWORD = 0x00000010; +pub const TRACK_ONLINE_CACHE_ENTRY: DWORD = 0x00000020; +pub const SPARSE_CACHE_ENTRY: DWORD = 0x00010000; +pub const COOKIE_CACHE_ENTRY: DWORD = 0x00100000; +pub const URLHISTORY_CACHE_ENTRY: DWORD = 0x00200000; +pub const URLCACHE_FIND_DEFAULT_FILTER: DWORD = NORMAL_CACHE_ENTRY | COOKIE_CACHE_ENTRY + | URLHISTORY_CACHE_ENTRY | TRACK_OFFLINE_CACHE_ENTRY | TRACK_ONLINE_CACHE_ENTRY + | STICKY_CACHE_ENTRY; +UNION!{union INTERNET_CACHE_ENTRY_INFOA_u { + [u32; 1], + dwReserved dwReserved_mut: DWORD, + dwExemptDelta dwExemptDelta_mut: DWORD, +}} +STRUCT!{struct INTERNET_CACHE_ENTRY_INFOA { + dwStructSize: DWORD, + lpszSourceUrlName: LPSTR, + lpszLocalFileName: LPSTR, + CacheEntryType: DWORD, + dwUseCount: DWORD, + dwHitRate: DWORD, + dwSizeLow: DWORD, + dwSizeHigh: DWORD, + LastModifiedTime: FILETIME, + ExpireTime: FILETIME, + LastAccessTime: FILETIME, + LastSyncTime: FILETIME, + lpHeaderInfo: LPSTR, + dwHeaderInfoSize: DWORD, + lpszFileExtension: LPSTR, + u: INTERNET_CACHE_ENTRY_INFOA_u, +}} +pub type LPINTERNET_CACHE_ENTRY_INFOA = *mut INTERNET_CACHE_ENTRY_INFOA; +UNION!{union INTERNET_CACHE_ENTRY_INFOW_u { + [u32; 1], + dwReserved dwReserved_mut: DWORD, + dwExemptDelta dwExemptDelta_mut: DWORD, +}} +STRUCT!{struct INTERNET_CACHE_ENTRY_INFOW { + dwStructSize: DWORD, + lpszSourceUrlName: LPWSTR, + lpszLocalFileName: LPWSTR, + CacheEntryType: DWORD, + dwUseCount: DWORD, + dwHitRate: DWORD, + dwSizeLow: DWORD, + dwSizeHigh: DWORD, + LastModifiedTime: FILETIME, + ExpireTime: FILETIME, + LastAccessTime: FILETIME, + LastSyncTime: FILETIME, + lpHeaderInfo: LPWSTR, + dwHeaderInfoSize: DWORD, + lpszFileExtension: LPWSTR, + u: INTERNET_CACHE_ENTRY_INFOW_u, +}} +pub type LPINTERNET_CACHE_ENTRY_INFOW = *mut INTERNET_CACHE_ENTRY_INFOW; +STRUCT!{struct INTERNET_CACHE_TIMESTAMPS { + ftExpires: FILETIME, + ftLastModified: FILETIME, +}} +pub type LPINTERNET_CACHE_TIMESTAMPS = *mut INTERNET_CACHE_TIMESTAMPS; +pub type GROUPID = LONGLONG; +pub const CACHEGROUP_ATTRIBUTE_GET_ALL: DWORD = 0xffffffff; +pub const CACHEGROUP_ATTRIBUTE_BASIC: DWORD = 0x00000001; +pub const CACHEGROUP_ATTRIBUTE_FLAG: DWORD = 0x00000002; +pub const CACHEGROUP_ATTRIBUTE_TYPE: DWORD = 0x00000004; +pub const CACHEGROUP_ATTRIBUTE_QUOTA: DWORD = 0x00000008; +pub const CACHEGROUP_ATTRIBUTE_GROUPNAME: DWORD = 0x00000010; +pub const CACHEGROUP_ATTRIBUTE_STORAGE: DWORD = 0x00000020; +pub const CACHEGROUP_FLAG_NONPURGEABLE: DWORD = 0x00000001; +pub const CACHEGROUP_FLAG_GIDONLY: DWORD = 0x00000004; +pub const CACHEGROUP_FLAG_FLUSHURL_ONDELETE: DWORD = 0x00000002; +pub const CACHEGROUP_SEARCH_ALL: DWORD = 0x00000000; +pub const CACHEGROUP_SEARCH_BYURL: DWORD = 0x00000001; +pub const CACHEGROUP_TYPE_INVALID: DWORD = 0x00000001; +pub const CACHEGROUP_READWRITE_MASK: DWORD = CACHEGROUP_ATTRIBUTE_TYPE + | CACHEGROUP_ATTRIBUTE_QUOTA | CACHEGROUP_ATTRIBUTE_GROUPNAME | CACHEGROUP_ATTRIBUTE_STORAGE; +pub const GROUPNAME_MAX_LENGTH: usize = 120; +pub const GROUP_OWNER_STORAGE_SIZE: usize = 4; +STRUCT!{struct INTERNET_CACHE_GROUP_INFOA { + dwGroupSize: DWORD, + dwGroupFlags: DWORD, + dwGroupType: DWORD, + dwDiskUsage: DWORD, + dwDiskQuota: DWORD, + dwOwnerStorage: [DWORD; GROUP_OWNER_STORAGE_SIZE], + szGroupName: [CHAR; GROUPNAME_MAX_LENGTH], +}} +pub type LPINTERNET_CACHE_GROUP_INFOA = *mut INTERNET_CACHE_GROUP_INFOA; +STRUCT!{struct INTERNET_CACHE_GROUP_INFOW { + dwGroupSize: DWORD, + dwGroupFlags: DWORD, + dwGroupType: DWORD, + dwDiskUsage: DWORD, + dwDiskQuota: DWORD, + dwOwnerStorage: [DWORD; GROUP_OWNER_STORAGE_SIZE], + szGroupName: [WCHAR; GROUPNAME_MAX_LENGTH], +}} +pub type LPINTERNET_CACHE_GROUP_INFOW = *mut INTERNET_CACHE_GROUP_INFOW; +pub const CACHE_ENTRY_ATTRIBUTE_FC: DWORD = 0x00000004; +pub const CACHE_ENTRY_HITRATE_FC: DWORD = 0x00000010; +pub const CACHE_ENTRY_MODTIME_FC: DWORD = 0x00000040; +pub const CACHE_ENTRY_EXPTIME_FC: DWORD = 0x00000080; +pub const CACHE_ENTRY_ACCTIME_FC: DWORD = 0x00000100; +pub const CACHE_ENTRY_SYNCTIME_FC: DWORD = 0x00000200; +pub const CACHE_ENTRY_HEADERINFO_FC: DWORD = 0x00000400; +pub const CACHE_ENTRY_EXEMPT_DELTA_FC: DWORD = 0x00000800; +pub const INTERNET_CACHE_GROUP_ADD: DWORD = 0; +pub const INTERNET_CACHE_GROUP_REMOVE: DWORD = 1; +pub const INTERNET_DIAL_FORCE_PROMPT: DWORD = 0x2000; +pub const INTERNET_DIAL_SHOW_OFFLINE: DWORD = 0x4000; +pub const INTERNET_DIAL_UNATTENDED: DWORD = 0x8000; +pub const INTERENT_GOONLINE_REFRESH: DWORD = 0x00000001; +pub const INTERENT_GOONLINE_NOPROMPT: DWORD = 0x00000002; +pub const INTERENT_GOONLINE_MASK: DWORD = 0x00000003; +pub const INTERNET_AUTODIAL_FORCE_ONLINE: DWORD = 1; +pub const INTERNET_AUTODIAL_FORCE_UNATTENDED: DWORD = 2; +pub const INTERNET_AUTODIAL_FAILIFSECURITYCHECK: DWORD = 4; +pub const INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT: DWORD = 8; +pub const INTERNET_AUTODIAL_FLAGS_MASK: DWORD = INTERNET_AUTODIAL_FORCE_ONLINE + | INTERNET_AUTODIAL_FORCE_UNATTENDED | INTERNET_AUTODIAL_FAILIFSECURITYCHECK + | INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT; +pub const PROXY_AUTO_DETECT_TYPE_DHCP: DWORD = 1; +pub const PROXY_AUTO_DETECT_TYPE_DNS_A: DWORD = 2; +STRUCT!{struct AutoProxyHelperVtbl { + IsResolvable: Option BOOL>, + GetIPAddress: Option DWORD>, + ResolveHostName: Option DWORD>, + IsInNet: Option BOOL>, + IsResolvableEx: Option BOOL>, + GetIPAddressEx: Option DWORD>, + ResolveHostNameEx: Option DWORD>, + IsInNetEx: Option BOOL>, + SortIpList: Option DWORD>, +}} +STRUCT!{struct AUTO_PROXY_SCRIPT_BUFFER { + dwStructSize: DWORD, + lpszScriptBuffer: LPSTR, + dwScriptBufferSize: DWORD, +}} +pub type LPAUTO_PROXY_SCRIPT_BUFFER = *mut AUTO_PROXY_SCRIPT_BUFFER; +STRUCT!{struct AutoProxyHelperFunctions { + lpVtbl: *const AutoProxyHelperVtbl, +}} +FN!{stdcall pfnInternetInitializeAutoProxyDll( + DWORD, + LPSTR, + LPSTR, + *mut AutoProxyHelperFunctions, + LPAUTO_PROXY_SCRIPT_BUFFER, +) -> BOOL} +FN!{stdcall pfnInternetDeInitializeAutoProxyDll( + LPSTR, + DWORD, +) -> BOOL} +FN!{stdcall pfnInternetGetProxyInfo( + LPCSTR, + DWORD, + LPSTR, + DWORD, + *mut LPSTR, + LPDWORD, +) -> BOOL} +ENUM!{enum WPAD_CACHE_DELETE { + WPAD_CACHE_DELETE_CURRENT = 0x0, + WPAD_CACHE_DELETE_ALL = 0x1, +}} +pub const INTERNET_CONNECTION_MODEM: DWORD = 0x01; +pub const INTERNET_CONNECTION_LAN: DWORD = 0x02; +pub const INTERNET_CONNECTION_PROXY: DWORD = 0x04; +pub const INTERNET_CONNECTION_MODEM_BUSY: DWORD = 0x08; +pub const INTERNET_RAS_INSTALLED: DWORD = 0x10; +pub const INTERNET_CONNECTION_OFFLINE: DWORD = 0x20; +pub const INTERNET_CONNECTION_CONFIGURED: DWORD = 0x40; +FN!{stdcall PFN_DIAL_HANDLER( + HWND, + LPCSTR, + DWORD, + LPDWORD, +) -> DWORD} +pub const INTERNET_CUSTOMDIAL_CONNECT: DWORD = 0; +pub const INTERNET_CUSTOMDIAL_UNATTENDED: DWORD = 1; +pub const INTERNET_CUSTOMDIAL_DISCONNECT: DWORD = 2; +pub const INTERNET_CUSTOMDIAL_SHOWOFFLINE: DWORD = 4; +pub const INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED: DWORD = 1; +pub const INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE: DWORD = 2; +pub const INTERNET_CUSTOMDIAL_CAN_HANGUP: DWORD = 4; +pub const INTERNET_DIALSTATE_DISCONNECTED: DWORD = 1; +pub const INTERNET_IDENTITY_FLAG_PRIVATE_CACHE: DWORD = 0x01; +pub const INTERNET_IDENTITY_FLAG_SHARED_CACHE: DWORD = 0x02; +pub const INTERNET_IDENTITY_FLAG_CLEAR_DATA: DWORD = 0x04; +pub const INTERNET_IDENTITY_FLAG_CLEAR_COOKIES: DWORD = 0x08; +pub const INTERNET_IDENTITY_FLAG_CLEAR_HISTORY: DWORD = 0x10; +pub const INTERNET_IDENTITY_FLAG_CLEAR_CONTENT: DWORD = 0x20; +pub const INTERNET_SUPPRESS_RESET_ALL: DWORD = 0x00; +pub const INTERNET_SUPPRESS_COOKIE_POLICY: DWORD = 0x01; +pub const INTERNET_SUPPRESS_COOKIE_POLICY_RESET: DWORD = 0x02; +pub const PRIVACY_TEMPLATE_NO_COOKIES: DWORD = 0; +pub const PRIVACY_TEMPLATE_HIGH: DWORD = 1; +pub const PRIVACY_TEMPLATE_MEDIUM_HIGH: DWORD = 2; +pub const PRIVACY_TEMPLATE_MEDIUM: DWORD = 3; +pub const PRIVACY_TEMPLATE_MEDIUM_LOW: DWORD = 4; +pub const PRIVACY_TEMPLATE_LOW: DWORD = 5; +pub const PRIVACY_TEMPLATE_CUSTOM: DWORD = 100; +pub const PRIVACY_TEMPLATE_ADVANCED: DWORD = 101; +pub const PRIVACY_TEMPLATE_MAX: DWORD = PRIVACY_TEMPLATE_LOW; +pub const PRIVACY_TYPE_FIRST_PARTY: DWORD = 0; +pub const PRIVACY_TYPE_THIRD_PARTY: DWORD = 1; +extern "system" { + pub fn CommitUrlCacheEntryA( + lpszUrlName: LPCSTR, + lpszLocalFileName: LPCSTR, + ExpireTime: FILETIME, + LastModifiedTime: FILETIME, + CacheEntryType: DWORD, + lpHeaderInfo: LPBYTE, + cchHeaderInfo: DWORD, + lpszFileExtension: LPCSTR, + lpszOriginalUrl: LPCSTR, + ) -> BOOL; + pub fn CommitUrlCacheEntryW( + lpszUrlName: LPCWSTR, + lpszLocalFileName: LPCWSTR, + ExpireTime: FILETIME, + LastModifiedTime: FILETIME, + CacheEntryType: DWORD, + lpszHeaderInfo: LPWSTR, + cchHeaderInfo: DWORD, + lpszFileExtension: LPCWSTR, + lpszOriginalUrl: LPCWSTR, + ) -> BOOL; + pub fn CreateMD5SSOHash ( + pszChallengeInfo: PWSTR, + pwszRealm: PWSTR, + pwszTarget: PWSTR, + pbHexHash: PBYTE, + ) -> BOOL; + pub fn CreateUrlCacheEntryA( + lpszUrlName: LPCSTR, + dwExpectedFileSize: DWORD, + lpszFileExtension: LPCSTR, + lpszFileName: LPSTR, + dwReserved: DWORD, + ) -> BOOL; + pub fn CreateUrlCacheEntryW( + lpszUrlName: LPCWSTR, + dwExpectedFileSize: DWORD, + lpszFileExtension: LPCWSTR, + lpszFileName: LPWSTR, + dwReserved: DWORD, + ) -> BOOL; + pub fn CreateUrlCacheGroup( + dwFlags: DWORD, + lpReserved: LPVOID, + ) -> GROUPID; + pub fn DeleteUrlCacheEntryA( + lpszUrlName: LPCSTR, + ) -> BOOL; + pub fn DeleteUrlCacheEntryW( + lpszUrlName: LPCWSTR, + ) -> BOOL; + pub fn DeleteUrlCacheGroup( + GroupId: GROUPID, + dwFlags: DWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn DeleteWpadCacheForNetworks( + arg0: WPAD_CACHE_DELETE, + ) -> BOOL; + pub fn DetectAutoProxyUrl( + pszAutoProxyUrl: PSTR, + cchAutoProxyUrl: DWORD, + dwDetectFlags: DWORD, + ) -> BOOL; + pub fn FindCloseUrlCache( + hEnumHandle: HANDLE, + ) -> BOOL; + pub fn FindFirstUrlCacheEntryA( + lpszUrlSearchPattern: LPCSTR, + lpFirstCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOA, + lpcbCacheEntryInfo: LPDWORD, + ) -> HANDLE; + pub fn FindFirstUrlCacheEntryExA( + lpszUrlSearchPattern: LPCSTR, + dwFlags: DWORD, + dwFilter: DWORD, + GroupId: GROUPID, + lpFirstCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOA, + lpcbCacheEntryInfo: LPDWORD, + lpGroupAttributes: LPVOID, + lpcbGroupAttributes: LPDWORD, + lpReserved: LPVOID, + ) -> HANDLE; + pub fn FindFirstUrlCacheEntryExW( + lpszUrlSearchPattern: LPCWSTR, + dwFlags: DWORD, + dwFilter: DWORD, + GroupId: GROUPID, + lpFirstCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOW, + lpcbCacheEntryInfo: LPDWORD, + lpGroupAttributes: LPVOID, + lpcbGroupAttributes: LPDWORD, + lpReserved: LPVOID, + ) -> HANDLE; + pub fn FindFirstUrlCacheEntryW( + lpszUrlSearchPattern: LPCWSTR, + lpFirstCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOW, + lpcbCacheEntryInfo: LPDWORD, + ) -> HANDLE; + pub fn FindFirstUrlCacheGroup( + dwFlags: DWORD, + dwFilter: DWORD, + lpSearchCondition: LPVOID, + dwSearchCondition: DWORD, + lpGroupId: *mut GROUPID, + lpReserved: LPVOID, + ) -> HANDLE; + pub fn FindNextUrlCacheEntryA( + hEnumHandle: HANDLE, + lpNextCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOA, + lpcbCacheEntryInfo: LPDWORD, + ) -> BOOL; + pub fn FindNextUrlCacheEntryExA( + hEnumHandle: HANDLE, + lpNextCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOA, + lpcbCacheEntryInfo: LPDWORD, + lpGroupAttributes: LPVOID, + lpcbGroupAttributes: LPDWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn FindNextUrlCacheEntryExW( + hEnumHandle: HANDLE, + lpNextCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOW, + lpcbCacheEntryInfo: LPDWORD, + lpGroupAttributes: LPVOID, + lpcbGroupAttributes: LPDWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn FindNextUrlCacheEntryW( + hEnumHandle: HANDLE, + lpNextCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOW, + lpcbCacheEntryInfo: LPDWORD, + ) -> BOOL; + pub fn FindNextUrlCacheGroup( + hFind: HANDLE, + lpGroupId: *mut GROUPID, + lpReserved: LPVOID, + ) -> BOOL; + pub fn FtpCommandA( + hConnect: HINTERNET, + fExpectResponse: BOOL, + dwFlags: DWORD, + lpszCommand: LPCSTR, + dwContext: DWORD_PTR, + phFtpCommand: *mut HINTERNET, + ) -> BOOL; + pub fn FtpCommandW( + hConnect: HINTERNET, + fExpectResponse: BOOL, + dwFlags: DWORD, + lpszCommand: LPCWSTR, + dwContext: DWORD_PTR, + phFtpCommand: *mut HINTERNET, + ) -> BOOL; + pub fn FtpCreateDirectoryA( + hConnect: HINTERNET, + lpszDirectory: LPCSTR, + ) -> BOOL; + pub fn FtpCreateDirectoryW( + hConnect: HINTERNET, + lpszDirectory: LPCWSTR, + ) -> BOOL; + pub fn FtpDeleteFileA( + hConnect: HINTERNET, + lpszFileName: LPCSTR, + ) -> BOOL; + pub fn FtpDeleteFileW( + hConnect: HINTERNET, + lpszFileName: LPCWSTR, + ) -> BOOL; + pub fn FtpFindFirstFileA( + hConnect: HINTERNET, + lpszSearchFile: LPCSTR, + lpFindFileData: LPWIN32_FIND_DATAA, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn FtpFindFirstFileW( + hConnect: HINTERNET, + lpszSearchFile: LPCWSTR, + lpFindFileData: LPWIN32_FIND_DATAW, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn FtpGetCurrentDirectoryA( + hConnect: HINTERNET, + lpszCurrentDirectory: LPSTR, + lpdwCurrentDirectory: LPDWORD, + ) -> BOOL; + pub fn FtpGetCurrentDirectoryW( + hConnect: HINTERNET, + lpszCurrentDirectory: LPWSTR, + lpdwCurrentDirectory: LPDWORD, + ) -> BOOL; + pub fn FtpGetFileA( + hConnect: HINTERNET, + lpszRemoteFile: LPCSTR, + lpszNewFile: LPCSTR, + fFailIfExists: BOOL, + dwFlagsAndAttributes: DWORD, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn FtpGetFileEx( + hFtpSession: HINTERNET, + lpszRemoteFile: LPCSTR, + lpszNewFile: LPCWSTR, + fFailIfExists: BOOL, + dwFlagsAndAttributes: DWORD, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn FtpGetFileSize( + hFile: HINTERNET, + lpdwFileSizeHigh: LPDWORD, + ) -> DWORD; + pub fn FtpGetFileW( + hConnect: HINTERNET, + lpszRemoteFile: LPCWSTR, + lpszNewFile: LPCWSTR, + fFailIfExists: BOOL, + dwFlagsAndAttributes: DWORD, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn FtpOpenFileA( + hConnect: HINTERNET, + lpszFileName: LPCSTR, + dwAccess: DWORD, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn FtpOpenFileW( + hConnect: HINTERNET, + lpszFileName: LPCWSTR, + dwAccess: DWORD, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn FtpPutFileA( + hConnect: HINTERNET, + lpszLocalFile: LPCSTR, + lpszNewRemoteFile: LPCSTR, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn FtpPutFileEx( + hFtpSession: HINTERNET, + lpszLocalFile: LPCWSTR, + lpszNewRemoteFile: LPCSTR, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn FtpPutFileW( + hConnect: HINTERNET, + lpszLocalFile: LPCWSTR, + lpszNewRemoteFile: LPCWSTR, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn FtpRemoveDirectoryA( + hConnect: HINTERNET, + lpszDirectory: LPCSTR, + ) -> BOOL; + pub fn FtpRemoveDirectoryW( + hConnect: HINTERNET, + lpszDirectory: LPCWSTR, + ) -> BOOL; + pub fn FtpRenameFileA( + hConnect: HINTERNET, + lpszExisting: LPCSTR, + lpszNew: LPCSTR, + ) -> BOOL; + pub fn FtpRenameFileW( + hConnect: HINTERNET, + lpszExisting: LPCWSTR, + lpszNew: LPCWSTR, + ) -> BOOL; + pub fn FtpSetCurrentDirectoryA( + hConnect: HINTERNET, + lpszDirectory: LPCSTR, + ) -> BOOL; + pub fn FtpSetCurrentDirectoryW( + hConnect: HINTERNET, + lpszDirectory: LPCWSTR, + ) -> BOOL; + pub fn GetUrlCacheEntryInfoA( + lpszUrlName: LPCSTR, + lpCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOA, + lpcbCacheEntryInfo: LPDWORD, + ) -> BOOL; + pub fn GetUrlCacheEntryInfoExA( + lpszUrl: LPCSTR, + lpCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOA, + lpcbCacheEntryInfo: LPDWORD, + lpszRedirectUrl: LPSTR, + lpcbRedirectUrl: LPDWORD, + lpReserved: LPVOID, + dwFlags: DWORD, + ) -> BOOL; + pub fn GetUrlCacheEntryInfoExW( + lpszUrl: LPCWSTR, + lpCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOW, + lpcbCacheEntryInfo: LPDWORD, + lpszRedirectUrl: LPWSTR, + lpcbRedirectUrl: LPDWORD, + lpReserved: LPVOID, + dwFlags: DWORD, + ) -> BOOL; + pub fn GetUrlCacheEntryInfoW( + lpszUrlName: LPCWSTR, + lpCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOW, + lpcbCacheEntryInfo: LPDWORD, + ) -> BOOL; + pub fn GetUrlCacheGroupAttributeA( + gid: GROUPID, + dwFlags: DWORD, + dwAttributes: DWORD, + lpGroupInfo: LPINTERNET_CACHE_GROUP_INFOA, + lpcbGroupInfo: LPDWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn GetUrlCacheGroupAttributeW( + gid: GROUPID, + dwFlags: DWORD, + dwAttributes: DWORD, + lpGroupInfo: LPINTERNET_CACHE_GROUP_INFOW, + lpcbGroupInfo: LPDWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn GopherCreateLocatorA( + lpszHost: LPCSTR, + nServerPort: INTERNET_PORT, + lpszDisplayString: LPCSTR, + lpszSelectorString: LPCSTR, + dwGopherType: DWORD, + lpszLocator: LPSTR, + lpdwBufferLength: LPDWORD, + ) -> BOOL; + pub fn GopherCreateLocatorW( + lpszHost: LPCWSTR, + nServerPort: INTERNET_PORT, + lpszDisplayString: LPCWSTR, + lpszSelectorString: LPCWSTR, + dwGopherType: DWORD, + lpszLocator: LPWSTR, + lpdwBufferLength: LPDWORD, + ) -> BOOL; + pub fn GopherFindFirstFileA( + hConnect: HINTERNET, + lpszLocator: LPCSTR, + lpszSearchString: LPCSTR, + lpFindData: LPGOPHER_FIND_DATAA, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn GopherFindFirstFileW( + hConnect: HINTERNET, + lpszLocator: LPCWSTR, + lpszSearchString: LPCWSTR, + lpFindData: LPGOPHER_FIND_DATAW, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn GopherGetAttributeA( + hConnect: HINTERNET, + lpszLocator: LPCSTR, + lpszAttributeName: LPCSTR, + lpBuffer: LPBYTE, + dwBufferLength: DWORD, + lpdwCharactersReturned: LPDWORD, + lpfnEnumerator: GOPHER_ATTRIBUTE_ENUMERATOR, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn GopherGetAttributeW( + hConnect: HINTERNET, + lpszLocator: LPCWSTR, + lpszAttributeName: LPCWSTR, + lpBuffer: LPBYTE, + dwBufferLength: DWORD, + lpdwCharactersReturned: LPDWORD, + lpfnEnumerator: GOPHER_ATTRIBUTE_ENUMERATOR, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn GopherGetLocatorTypeA( + lpszLocator: LPCSTR, + lpdwGopherType: LPDWORD, + ) -> BOOL; + pub fn GopherGetLocatorTypeW( + lpszLocator: LPCWSTR, + lpdwGopherType: LPDWORD, + ) -> BOOL; + pub fn GopherOpenFileA( + hConnect: HINTERNET, + lpszLocator: LPCSTR, + lpszView: LPCSTR, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn GopherOpenFileW( + hConnect: HINTERNET, + lpszLocator: LPCWSTR, + lpszView: LPCWSTR, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn HttpAddRequestHeadersA( + hRequest: HINTERNET, + lpszHeaders: LPCSTR, + dwHeadersLength: DWORD, + dwModifiers: DWORD, + ) -> BOOL; + pub fn HttpAddRequestHeadersW( + hRequest: HINTERNET, + lpszHeaders: LPCWSTR, + dwHeadersLength: DWORD, + dwModifiers: DWORD, + ) -> BOOL; + pub fn HttpEndRequestA( + hRequest: HINTERNET, + lpBuffersOut: LPINTERNET_BUFFERSA, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn HttpEndRequestW( + hRequest: HINTERNET, + lpBuffersOut: LPINTERNET_BUFFERSW, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn HttpOpenRequestA( + hConnect: HINTERNET, + lpszVerb: LPCSTR, + lpszObjectName: LPCSTR, + lpszVersion: LPCSTR, + lpszReferrer: LPCSTR, + lplpszAcceptTypes: *mut LPCSTR, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn HttpOpenRequestW( + hConnect: HINTERNET, + lpszVerb: LPCWSTR, + lpszObjectName: LPCWSTR, + lpszVersion: LPCWSTR, + lpszReferrer: LPCWSTR, + lplpszAcceptTypes: *mut LPCWSTR, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn HttpQueryInfoA( + hRequest: HINTERNET, + dwInfoLevel: DWORD, + lpBuffer: LPVOID, + lpdwBufferLength: LPDWORD, + lpdwIndex: LPDWORD, + ) -> BOOL; + pub fn HttpQueryInfoW( + hRequest: HINTERNET, + dwInfoLevel: DWORD, + lpBuffer: LPVOID, + lpdwBufferLength: LPDWORD, + lpdwIndex: LPDWORD, + ) -> BOOL; + pub fn HttpSendRequestA( + hRequest: HINTERNET, + lpszHeaders: LPCSTR, + dwHeadersLength: DWORD, + lpOptional: LPVOID, + dwOptionalLength: DWORD, + ) -> BOOL; + pub fn HttpSendRequestExA( + hRequest: HINTERNET, + lpBuffersIn: LPINTERNET_BUFFERSA, + lpBuffersOut: LPINTERNET_BUFFERSA, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn HttpSendRequestExW( + hRequest: HINTERNET, + lpBuffersIn: LPINTERNET_BUFFERSW, + lpBuffersOut: LPINTERNET_BUFFERSW, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn HttpSendRequestW( + hRequest: HINTERNET, + lpszHeaders: LPCWSTR, + dwHeadersLength: DWORD, + lpOptional: LPVOID, + dwOptionalLength: DWORD, + ) -> BOOL; + pub fn InternetAttemptConnect( + dwReserved: DWORD, + ) -> DWORD; + pub fn InternetAutodial( + dwFlags: DWORD, + hwndParent: HWND, + ) -> BOOL; + pub fn InternetAutodialHangup( + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetCanonicalizeUrlA( + lpszUrl: LPCSTR, + lpszBuffer: LPSTR, + lpdwBufferLength: LPDWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn InternetCanonicalizeUrlW( + lpszUrl: LPCWSTR, + lpszBuffer: LPWSTR, + lpdwBufferLength: LPDWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn InternetCheckConnectionA( + lpszUrl: LPCSTR, + dwFlags: DWORD, + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetCheckConnectionW( + lpszUrl: LPCWSTR, + dwFlags: DWORD, + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetClearAllPerSiteCookieDecisions() -> BOOL; + pub fn InternetCloseHandle( + hInternet: HINTERNET, + ) -> BOOL; + pub fn InternetCombineUrlA( + lpszBaseUrl: LPCSTR, + lpszRelativeUrl: LPCSTR, + lpszBuffer: LPSTR, + lpdwBufferLength: LPDWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn InternetCombineUrlW( + lpszBaseUrl: LPCWSTR, + lpszRelativeUrl: LPCWSTR, + lpszBuffer: LPWSTR, + lpdwBufferLength: LPDWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn InternetConfirmZoneCrossingA( + hWnd: HWND, + szUrlPrev: LPSTR, + szUrlNew: LPSTR, + bPost: BOOL, + ) -> DWORD; + pub fn InternetConfirmZoneCrossingW( + hWnd: HWND, + szUrlPrev: LPWSTR, + szUrlNew: LPWSTR, + bPost: BOOL, + ) -> DWORD; + pub fn InternetConnectA( + hInternet: HINTERNET, + lpszServerName: LPCSTR, + nServerPort: INTERNET_PORT, + lpszUserName: LPCSTR, + lpszPassword: LPCSTR, + dwService: DWORD, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn InternetConnectW( + hInternet: HINTERNET, + lpszServerName: LPCWSTR, + nServerPort: INTERNET_PORT, + lpszUserName: LPCWSTR, + lpszPassword: LPCWSTR, + dwService: DWORD, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn InternetCrackUrlA( + lpszUrl: LPCSTR, + dwUrlLength: DWORD, + dwFlags: DWORD, + lpUrlComponents: LPURL_COMPONENTSA, + ) -> BOOL; + pub fn InternetCrackUrlW( + lpszUrl: LPCWSTR, + dwUrlLength: DWORD, + dwFlags: DWORD, + lpUrlComponents: LPURL_COMPONENTSW, + ) -> BOOL; + pub fn InternetCreateUrlA( + lpUrlComponents: LPURL_COMPONENTSA, + dwFlags: DWORD, + lpszUrl: LPSTR, + lpdwUrlLength: LPDWORD, + ) -> BOOL; + pub fn InternetCreateUrlW( + lpUrlComponents: LPURL_COMPONENTSW, + dwFlags: DWORD, + lpszUrl: LPWSTR, + lpdwUrlLength: LPDWORD, + ) -> BOOL; + pub fn InternetDialA( + hwndParent: HWND, + lpszConnectoid: LPSTR, + dwFlags: DWORD, + lpdwConnection: *mut DWORD_PTR, + dwReserved: DWORD, + ) -> DWORD; + pub fn InternetDialW( + hwndParent: HWND, + lpszConnectoid: LPWSTR, + dwFlags: DWORD, + lpdwConnection: *mut DWORD_PTR, + dwReserved: DWORD, + ) -> DWORD; + pub fn InternetEnumPerSiteCookieDecisionA( + pszSiteName: LPSTR, + pcSiteNameSize: *mut u32, + pdwDecision: *mut u32, + dwIndex: u32, + ) -> BOOL; + pub fn InternetEnumPerSiteCookieDecisionW( + pszSiteName: LPWSTR, + pcSiteNameSize: *mut u32, + pdwDecision: *mut u32, + dwIndex: u32, + ) -> BOOL; + pub fn InternetErrorDlg( + hWnd: HWND, + hRequest: HINTERNET, + dwError: DWORD, + dwFlags: DWORD, + lppvData: *mut LPVOID, + ) -> DWORD; + pub fn InternetFindNextFileA( + hFind: HINTERNET, + lpvFindData: LPVOID, + ) -> BOOL; + pub fn InternetFindNextFileW( + hFind: HINTERNET, + lpvFindData: LPVOID, + ) -> BOOL; + pub fn InternetFreeCookies( + pCookies: *mut INTERNET_COOKIE2, + dwCookieCount: DWORD, + ) -> (); + pub fn InternetGetConnectedState( + lpdwFlags: LPDWORD, + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetGetConnectedStateExA( + lpdwFlags: LPDWORD, + lpszConnectionName: LPSTR, + cchNameLen: DWORD, + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetGetConnectedStateExW( + lpdwFlags: LPDWORD, + lpszConnectionName: LPWSTR, + cchNameLen: DWORD, + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetGetCookieA( + lpszUrl: LPCSTR, + lpszCookieName: LPCSTR, + lpszCookieData: LPSTR, + lpdwSize: LPDWORD, + ) -> BOOL; + pub fn InternetGetCookieEx2( + pcwszUrl: PCWSTR, + pcwszCookieName: PCWSTR, + dwFlags: DWORD, + ppCookies: *mut *mut INTERNET_COOKIE2, + pdwCookieCount: PDWORD, + ) -> DWORD; + pub fn InternetGetCookieExA( + lpszUrl: LPCSTR, + lpszCookieName: LPCSTR, + lpszCookieData: LPSTR, + lpdwSize: LPDWORD, + dwFlags: DWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn InternetGetCookieExW( + lpszUrl: LPCWSTR, + lpszCookieName: LPCWSTR, + lpszCookieData: LPWSTR, + lpdwSize: LPDWORD, + dwFlags: DWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn InternetGetCookieW( + lpszUrl: LPCWSTR, + lpszCookieName: LPCWSTR, + lpszCookieData: LPWSTR, + lpdwSize: LPDWORD, + ) -> BOOL; + pub fn InternetGetLastResponseInfoA( + lpdwError: LPDWORD, + lpszBuffer: LPSTR, + lpdwBufferLength: LPDWORD, + ) -> BOOL; + pub fn InternetGetLastResponseInfoW( + lpdwError: LPDWORD, + lpszBuffer: LPWSTR, + lpdwBufferLength: LPDWORD, + ) -> BOOL; + pub fn InternetGetPerSiteCookieDecisionA( + pchHostName: LPCSTR, + pResult: *mut u32, + ) -> BOOL; + pub fn InternetGetPerSiteCookieDecisionW( + pchHostName: LPCWSTR, + pResult: *mut u32, + ) -> BOOL; + pub fn InternetGoOnlineA( + lpszURL: LPCSTR, + hwndParent: HWND, + dwFlags: DWORD, + ) -> BOOL; + pub fn InternetGoOnlineW( + lpszURL: LPCWSTR, + hwndParent: HWND, + dwFlags: DWORD, + ) -> BOOL; + pub fn InternetHangUp( + dwConnection: DWORD_PTR, + dwReserved: DWORD, + ) -> DWORD; + pub fn InternetInitializeAutoProxyDll( + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetLockRequestFile( + hInternet: HINTERNET, + lphLockRequestInfo: *mut HANDLE, + ) -> BOOL; + pub fn InternetOpenA( + lpszAgent: LPCSTR, + dwAccessType: DWORD, + lpszProxy: LPCSTR, + lpszProxyBypass: LPCSTR, + dwFlags: DWORD, + ) -> HINTERNET; + pub fn InternetOpenUrlA( + hInternet: HINTERNET, + lpszUrl: LPCSTR, + lpszHeaders: LPCSTR, + dwHeadersLength: DWORD, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn InternetOpenUrlW( + hInternet: HINTERNET, + lpszUrl: LPCWSTR, + lpszHeaders: LPCWSTR, + dwHeadersLength: DWORD, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> HINTERNET; + pub fn InternetOpenW( + lpszAgent: LPCWSTR, + dwAccessType: DWORD, + lpszProxy: LPCWSTR, + lpszProxyBypass: LPCWSTR, + dwFlags: DWORD, + ) -> HINTERNET; + pub fn InternetQueryDataAvailable( + hFile: HINTERNET, + lpdwNumberOfBytesAvailable: LPDWORD, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn InternetQueryOptionA( + hInternet: HINTERNET, + dwOption: DWORD, + lpBuffer: LPVOID, + lpdwBufferLength: LPDWORD, + ) -> BOOL; + pub fn InternetQueryOptionW( + hInternet: HINTERNET, + dwOption: DWORD, + lpBuffer: LPVOID, + lpdwBufferLength: LPDWORD, + ) -> BOOL; + pub fn InternetReadFile( + hFile: HINTERNET, + lpBuffer: LPVOID, + dwNumberOfBytesToRead: DWORD, + lpdwNumberOfBytesRead: LPDWORD, + ) -> BOOL; + pub fn InternetReadFileExA( + hFile: HINTERNET, + lpBuffersOut: LPINTERNET_BUFFERSA, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn InternetReadFileExW( + hFile: HINTERNET, + lpBuffersOut: LPINTERNET_BUFFERSW, + dwFlags: DWORD, + dwContext: DWORD_PTR, + ) -> BOOL; + pub fn InternetSetCookieA( + lpszUrl: LPCSTR, + lpszCookieName: LPCSTR, + lpszCookieData: LPCSTR, + ) -> BOOL; + pub fn InternetSetCookieEx2( + pcwszUrl: PCWSTR, + pCookie: *const INTERNET_COOKIE2, + pcwszP3PPolicy: PCWSTR, + dwFlags: DWORD, + pdwCookieState: PDWORD, + ) -> DWORD; + pub fn InternetSetCookieExA( + lpszUrl: LPCSTR, + lpszCookieName: LPCSTR, + lpszCookieData: LPCSTR, + dwFlags: DWORD, + dwReserved: DWORD_PTR, + ) -> DWORD; + pub fn InternetSetCookieExW( + lpszUrl: LPCWSTR, + lpszCookieName: LPCWSTR, + lpszCookieData: LPCWSTR, + dwFlags: DWORD, + dwReserved: DWORD_PTR, + ) -> DWORD; + pub fn InternetSetCookieW( + lpszUrl: LPCWSTR, + lpszCookieName: LPCWSTR, + lpszCookieData: LPCWSTR, + ) -> BOOL; + pub fn InternetSetDialStateA( + lpszConnectoid: LPCSTR, + dwState: DWORD, + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetSetDialStateW( + lpszConnectoid: LPCWSTR, + dwState: DWORD, + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetSetFilePointer( + hFile: HINTERNET, + lDistanceToMove: LONG, + lpDistanceToMoveHigh: PLONG, + dwMoveMethod: DWORD, + dwContext: DWORD_PTR, + ) -> DWORD; + pub fn InternetSetOptionA( + hInternet: HINTERNET, + dwOption: DWORD, + lpBuffer: LPVOID, + dwBufferLength: DWORD, + ) -> BOOL; + pub fn InternetSetOptionExA( + hInternet: HINTERNET, + dwOption: DWORD, + lpBuffer: LPVOID, + dwBufferLength: DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn InternetSetOptionExW( + hInternet: HINTERNET, + dwOption: DWORD, + lpBuffer: LPVOID, + dwBufferLength: DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn InternetSetOptionW( + hInternet: HINTERNET, + dwOption: DWORD, + lpBuffer: LPVOID, + dwBufferLength: DWORD, + ) -> BOOL; + pub fn InternetSetPerSiteCookieDecisionA( + pchHostName: LPCSTR, + dwDecision: DWORD, + ) -> BOOL; + pub fn InternetSetPerSiteCookieDecisionW( + pchHostName: LPCWSTR, + dwDecision: DWORD, + ) -> BOOL; + pub fn InternetSetStatusCallbackA( + hInternet: HINTERNET, + lpfnInternetCallback: INTERNET_STATUS_CALLBACK, + ) -> INTERNET_STATUS_CALLBACK; + pub fn InternetSetStatusCallbackW( + hInternet: HINTERNET, + lpfnInternetCallback: INTERNET_STATUS_CALLBACK, + ) -> INTERNET_STATUS_CALLBACK; + pub fn InternetTimeFromSystemTimeA( + pst: *const SYSTEMTIME, + dwRFC: DWORD, + lpszTime: LPSTR, + cbTime: DWORD, + ) -> BOOL; + pub fn InternetTimeFromSystemTimeW( + pst: *const SYSTEMTIME, + dwRFC: DWORD, + lpszTime: LPWSTR, + cbTime: DWORD, + ) -> BOOL; + pub fn InternetTimeToSystemTimeA( + lpszTime: LPCSTR, + pst: *mut SYSTEMTIME, + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetTimeToSystemTimeW( + lpszTime: LPCWSTR, + pst: *mut SYSTEMTIME, + dwReserved: DWORD, + ) -> BOOL; + pub fn InternetUnlockRequestFile( + hLockRequestInfo: HANDLE, + ) -> BOOL; + pub fn InternetWriteFile( + hFile: HINTERNET, + lpBuffer: LPCVOID, + dwNumberOfBytesToWrite: DWORD, + lpdwNumberOfBytesWritten: LPDWORD, + ) -> BOOL; + pub fn PrivacyGetZonePreferenceW( + dwZone: DWORD, + dwType: DWORD, + pdwTemplate: LPDWORD, + pszBuffer: LPWSTR, + pdwBufferLength: LPDWORD, + ) -> DWORD; + pub fn PrivacySetZonePreferenceW( + dwZone: DWORD, + dwType: DWORD, + dwTemplate: DWORD, + pszPreference: LPCWSTR, + ) -> DWORD; + pub fn ReadUrlCacheEntryStream( + hUrlCacheStream: HANDLE, + dwLocation: DWORD, + lpBuffer: LPVOID, + lpdwLen: LPDWORD, + Reserved: DWORD, + ) -> BOOL; + pub fn ReadUrlCacheEntryStreamEx( + hUrlCacheStream: HANDLE, + qwLocation: DWORDLONG, + lpBuffer: LPVOID, + lpdwLen: LPDWORD, + ) -> BOOL; + pub fn ResumeSuspendedDownload( + hRequest: HINTERNET, + dwResultCode: DWORD, + ) -> BOOL; + pub fn RetrieveUrlCacheEntryFileA( + lpszUrlName: LPCSTR, + lpCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOA, + lpcbCacheEntryInfo: LPDWORD, + dwReserved: DWORD, + ) -> BOOL; + pub fn RetrieveUrlCacheEntryFileW( + lpszUrlName: LPCWSTR, + lpCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOW, + lpcbCacheEntryInfo: LPDWORD, + dwReserved: DWORD, + ) -> BOOL; + pub fn RetrieveUrlCacheEntryStreamA( + lpszUrlName: LPCSTR, + lpCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOA, + lpcbCacheEntryInfo: LPDWORD, + fRandomRead: BOOL, + dwReserved: DWORD, + ) -> HANDLE; + pub fn RetrieveUrlCacheEntryStreamW( + lpszUrlName: LPCWSTR, + lpCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOW, + lpcbCacheEntryInfo: LPDWORD, + fRandomRead: BOOL, + dwReserved: DWORD, + ) -> HANDLE; + pub fn SetUrlCacheEntryGroupA( + lpszUrlName: LPCSTR, + dwFlags: DWORD, + GroupId: GROUPID, + pbGroupAttributes: LPBYTE, + cbGroupAttributes: DWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn SetUrlCacheEntryGroupW( + lpszUrlName: LPCWSTR, + dwFlags: DWORD, + GroupId: GROUPID, + pbGroupAttributes: LPBYTE, + cbGroupAttributes: DWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn SetUrlCacheEntryInfoA( + lpszUrlName: LPCSTR, + lpCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOA, + dwFieldControl: DWORD, + ) -> BOOL; + pub fn SetUrlCacheEntryInfoW( + lpszUrlName: LPCWSTR, + lpCacheEntryInfo: LPINTERNET_CACHE_ENTRY_INFOW, + dwFieldControl: DWORD, + ) -> BOOL; + pub fn SetUrlCacheGroupAttributeA( + gid: GROUPID, + dwFlags: DWORD, + dwAttributes: DWORD, + lpGroupInfo: LPINTERNET_CACHE_GROUP_INFOA, + lpReserved: LPVOID, + ) -> BOOL; + pub fn SetUrlCacheGroupAttributeW( + gid: GROUPID, + dwFlags: DWORD, + dwAttributes: DWORD, + lpGroupInfo: LPINTERNET_CACHE_GROUP_INFOW, + lpReserved: LPVOID, + ) -> BOOL; + pub fn UnlockUrlCacheEntryFileA( + lpszUrlName: LPCSTR, + dwReserved: DWORD, + ) -> BOOL; + pub fn UnlockUrlCacheEntryFileW( + lpszUrlName: LPCWSTR, + dwReserved: DWORD, + ) -> BOOL; + pub fn UnlockUrlCacheEntryStream( + hUrlCacheStream: HANDLE, + Reserved: DWORD, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/winineti.rs b/bash-5.1/vendor/winapi/src/um/winineti.rs new file mode 100644 index 0000000000000000000000000000000000000000..c0076c0d07843eb0d4125a759707945c59223949 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winineti.rs @@ -0,0 +1,142 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Windows Internet Services API procedure declarations, types and constants. +// Currently, this only contains `INTERNET_FLAG_BGUPDATE`, which is needed to correctly define +// `wininet::INTERNET_FLAGS_MASK`. +use shared::minwindef::DWORD; +pub const INTERNET_FLAG_BGUPDATE: DWORD = 0x00000008; +// Functions from wininet.dll that *should* be in this header. +// pub fn AppCacheCheckManifest(); +// pub fn AppCacheCloseHandle(); +// pub fn AppCacheCreateAndCommitFile(); +// pub fn AppCacheDeleteGroup(); +// pub fn AppCacheDeleteIEGroup(); +// pub fn AppCacheDuplicateHandle(); +// pub fn AppCacheFinalize(); +// pub fn AppCacheFreeDownloadList(); +// pub fn AppCacheFreeGroupList(); +// pub fn AppCacheFreeIESpace(); +// pub fn AppCacheFreeSpace(); +// pub fn AppCacheGetDownloadList(); +// pub fn AppCacheGetFallbackUrl(); +// pub fn AppCacheGetGroupList(); +// pub fn AppCacheGetIEGroupList(); +// pub fn AppCacheGetInfo(); +// pub fn AppCacheGetManifestUrl(); +// pub fn AppCacheLookup(); +// pub fn CommitUrlCacheEntryBinaryBlob(); +// pub fn CreateCacheServerRpcBinding(); +// pub fn CreateUrlCacheContainerA(); +// pub fn CreateUrlCacheContainerW(); +// pub fn CreateUrlCacheEntryExW(); +// pub fn DeleteIE3Cache(); +// pub fn DeleteUrlCacheContainerA(); +// pub fn DeleteUrlCacheContainerW(); +// pub fn DoConnectoidsExist(); +// pub fn ExportCookieFileA(); +// pub fn ExportCookieFileW(); +// pub fn FindFirstUrlCacheContainerA(); +// pub fn FindFirstUrlCacheContainerW(); +// pub fn FindNextUrlCacheContainerA(); +// pub fn FindNextUrlCacheContainerW(); +// pub fn FindP3PPolicySymbol(); +// pub fn ForceNexusLookupExW(); +// pub fn FreeP3PObject(); +// pub fn FreeUrlCacheSpaceA(); +// pub fn FreeUrlCacheSpaceW(); +// pub fn GetCacheServerConnection(); +// pub fn GetDiskInfoA(); +// pub fn GetP3PPolicy(); +// pub fn GetP3PRequestStatus(); +// pub fn GetUrlCacheConfigInfoA(); +// pub fn GetUrlCacheConfigInfoW(); +// pub fn GetUrlCacheEntryBinaryBlob(); +// pub fn GetUrlCacheHeaderData(); +// pub fn HttpCheckDavComplianceA(); +// pub fn HttpCheckDavComplianceW(); +// pub fn HttpCloseDependencyHandle(); +// pub fn HttpDuplicateDependencyHandle(); +// pub fn HttpGetServerCredentials(); +// pub fn HttpGetTunnelSocket(); +// pub fn HttpIsHostHstsEnabled(); +// pub fn HttpOpenDependencyHandle(); +// pub fn HttpPushClose(); +// pub fn HttpPushEnable(); +// pub fn HttpPushWait(); +// pub fn HttpWebSocketClose(); +// pub fn HttpWebSocketCompleteUpgrade(); +// pub fn HttpWebSocketQueryCloseStatus(); +// pub fn HttpWebSocketReceive(); +// pub fn HttpWebSocketSend(); +// pub fn HttpWebSocketShutdown(); +// pub fn ImportCookieFileA(); +// pub fn ImportCookieFileW(); +// pub fn IncrementUrlCacheHeaderData(); +// pub fn InternalInternetGetCookie(); +// pub fn InternetAlgIdToStringA(); +// pub fn InternetAlgIdToStringW(); +// pub fn InternetAutodialCallback(); +// pub fn InternetAutoProxyGetProxyForUrl(); +// pub fn InternetAutoProxyOnSendRequestComplete(); +// pub fn InternetFortezzaCommand(); +// pub fn InternetFreeProxyInfoList(); +// pub fn InternetGetCertByURLA(); +// pub fn InternetGetProxyForUrl(); +// pub fn InternetGetSecurityInfoByURLA(); +// pub fn InternetGetSecurityInfoByURLW(); +// pub fn InternetQueryFortezzaStatus(); +// pub fn InternetSecurityProtocolToStringA(); +// pub fn InternetSecurityProtocolToStringW(); +// pub fn InternetShowSecurityInfoByURLA(); +// pub fn InternetShowSecurityInfoByURLW(); +// pub fn InternetWriteFileExA(); +// pub fn InternetWriteFileExW(); +// pub fn IsDialUpConnection(); +// pub fn IsDomainLegalCookieDomainA(); +// pub fn IsDomainLegalCookieDomainW(); +// pub fn IsHostInProxyBypassList(); +// pub fn IsLanConnection(); +// pub fn IsProfilesEnabled(); +// pub fn IsUrlCacheEntryExpiredA(); +// pub fn IsUrlCacheEntryExpiredW(); +// pub fn LoadUrlCacheContent(); +// pub fn MapResourceToPolicy(); +// pub fn ParseX509EncodedCertificateForListBoxEntry(); +// pub fn PerformOperationOverUrlCacheA(); +// pub fn ReadGuidsForConnectedNetworks(); +// pub fn RegisterForNetworkChangeNotification(); +// pub fn RegisterUrlCacheNotification(); +// pub fn RunOnceUrlCache(); +// pub fn SetGlobalJetParameters(); +// pub fn SetUrlCacheConfigInfoA(); +// pub fn SetUrlCacheConfigInfoW(); +// pub fn SetUrlCacheHeaderData(); +// pub fn ShowCertificate(); +// pub fn ShowClientAuthCerts(); +// pub fn ShowSecurityInfo(); +// pub fn ShowX509EncodedCertificate(); +// pub fn UnRegisterNetworkChangeNotification(); +// pub fn UpdateUrlCacheContentPath(); +// pub fn UrlCacheCheckEntriesExist(); +// pub fn UrlCacheCloseEntryHandle(); +// pub fn UrlCacheContainerSetEntryMaximumAge(); +// pub fn UrlCacheCreateContainer(); +// pub fn UrlCacheFindFirstEntry(); +// pub fn UrlCacheFindNextEntry(); +// pub fn UrlCacheFreeEntryInfo(); +// pub fn UrlCacheFreeGlobalSpace(); +// pub fn UrlCacheGetContentPaths(); +// pub fn UrlCacheGetEntryInfo(); +// pub fn UrlCacheGetGlobalCacheSize(); +// pub fn UrlCacheGetGlobalLimit(); +// pub fn UrlCacheReadEntryStream(); +// pub fn UrlCacheReloadSettings(); +// pub fn UrlCacheRetrieveEntryFile(); +// pub fn UrlCacheRetrieveEntryStream(); +// pub fn UrlCacheServer(); +// pub fn UrlCacheSetGlobalLimit(); +// pub fn UrlCacheUpdateEntryExtraData(); +// pub fn UrlZonesDetach(); diff --git a/bash-5.1/vendor/winapi/src/um/winioctl.rs b/bash-5.1/vendor/winapi/src/um/winioctl.rs new file mode 100644 index 0000000000000000000000000000000000000000..f01b998edd3a2ec973e6749b9e4651c42757b1cf --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winioctl.rs @@ -0,0 +1,1091 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module defines the 32-Bit Windows Device I/O control codes. +use shared::basetsd::DWORD64; +use shared::devpropdef::DEVPROPKEY; +use shared::guiddef::GUID; +use shared::minwindef::{BYTE, DWORD, WORD}; +use um::winnt::{ + ANYSIZE_ARRAY, BOOLEAN, FILE_READ_DATA, FILE_WRITE_DATA, HANDLE, LARGE_INTEGER, WCHAR, +}; +DEFINE_GUID!{GUID_DEVINTERFACE_DISK, + 0x53f56307, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{GUID_DEVINTERFACE_CDROM, + 0x53f56308, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{GUID_DEVINTERFACE_PARTITION, + 0x53f5630a, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{GUID_DEVINTERFACE_TAPE, + 0x53f5630b, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{GUID_DEVINTERFACE_WRITEONCEDISK, + 0x53f5630c, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{GUID_DEVINTERFACE_VOLUME, + 0x53f5630d, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{GUID_DEVINTERFACE_MEDIUMCHANGER, + 0x53f56310, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{GUID_DEVINTERFACE_FLOPPY, + 0x53f56311, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{GUID_DEVINTERFACE_CDCHANGER, + 0x53f56312, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{GUID_DEVINTERFACE_STORAGEPORT, + 0x2accfe60, 0xc130, 0x11d2, 0xb0, 0x82, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b} +DEFINE_GUID!{GUID_DEVINTERFACE_VMLUN, + 0x6f416619, 0x9f29, 0x42a5, 0xb2, 0x0b, 0x37, 0xe2, 0x19, 0xca, 0x02, 0xb0} +DEFINE_GUID!{GUID_DEVINTERFACE_SES, + 0x1790c9ec, 0x47d5, 0x4df3, 0xb5, 0xaf, 0x9a, 0xdf, 0x3c, 0xf2, 0x3e, 0x48} +DEFINE_GUID!{WDI_STORAGE_PREDICT_FAILURE_DPS_GUID, + 0xe9f2d03a, 0x747c, 0x41c2, 0xbb, 0x9a, 0x02, 0xc6, 0x2b, 0x6d, 0x5f, 0xcb} +DEFINE_GUID!{GUID_DEVINTERFACE_SERVICE_VOLUME, + 0x6ead3d82, 0x25ec, 0x46bc, 0xb7, 0xfd, 0xc1, 0xf0, 0xdf, 0x8f, 0x50, 0x37} +DEFINE_GUID!{GUID_DEVINTERFACE_HIDDEN_VOLUME, + 0x7f108a28, 0x9833, 0x4b3b, 0xb7, 0x80, 0x2c, 0x6b, 0x5f, 0xa5, 0xc0, 0x62} +DEFINE_GUID!{GUID_DEVINTERFACE_UNIFIED_ACCESS_RPMB, + 0x27447c21, 0xbcc3, 0x4d07, 0xa0, 0x5b, 0xa3, 0x39, 0x5b, 0xb4, 0xee, 0xe7} +DEFINE_GUID!{GUID_DEVINTERFACE_SCM_PHYSICAL_DEVICE, + 0x4283609d, 0x4dc2, 0x43be, 0xbb, 0xb4, 0x4f, 0x15, 0xdf, 0xce, 0x2c, 0x61} +DEFINE_GUID!{GUID_SCM_PD_HEALTH_NOTIFICATION, + 0x9da2d386, 0x72f5, 0x4ee3, 0x81, 0x55, 0xec, 0xa0, 0x67, 0x8e, 0x3b, 0x06} +DEFINE_GUID!{GUID_SCM_PD_PASSTHROUGH_INVDIMM, + 0x4309AC30, 0x0D11, 0x11E4, 0x91, 0x91, 0x08, 0x00, 0x20, 0x0C, 0x9A, 0x66} +DEFINE_GUID!{GUID_DEVINTERFACE_COMPORT, + 0x86E0D1E0, 0x8089, 0x11D0, 0x9C, 0xE4, 0x08, 0x00, 0x3E, 0x30, 0x1F, 0x73} +DEFINE_GUID!{GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, + 0x4D36E978, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18} +//146 +DEFINE_DEVPROPKEY!{DEVPKEY_Storage_Portable, + 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 2} +DEFINE_DEVPROPKEY!{DEVPKEY_Storage_Removable_Media, + 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 3} +DEFINE_DEVPROPKEY!{DEVPKEY_Storage_System_Critical, + 0x4d1ebee8, 0x803, 0x4774, 0x98, 0x42, 0xb7, 0x7d, 0xb5, 0x2, 0x65, 0xe9, 4} +//177 +pub type DEVICE_TYPE = DWORD; +pub const FILE_DEVICE_BEEP: DEVICE_TYPE = 0x00000001; +pub const FILE_DEVICE_CD_ROM: DEVICE_TYPE = 0x00000002; +pub const FILE_DEVICE_CD_ROM_FILE_SYSTEM: DEVICE_TYPE = 0x00000003; +pub const FILE_DEVICE_CONTROLLER: DEVICE_TYPE = 0x00000004; +pub const FILE_DEVICE_DATALINK: DEVICE_TYPE = 0x00000005; +pub const FILE_DEVICE_DFS: DEVICE_TYPE = 0x00000006; +pub const FILE_DEVICE_DISK: DEVICE_TYPE = 0x00000007; +pub const FILE_DEVICE_DISK_FILE_SYSTEM: DEVICE_TYPE = 0x00000008; +pub const FILE_DEVICE_FILE_SYSTEM: DEVICE_TYPE = 0x00000009; +pub const FILE_DEVICE_INPORT_PORT: DEVICE_TYPE = 0x0000000a; +pub const FILE_DEVICE_KEYBOARD: DEVICE_TYPE = 0x0000000b; +pub const FILE_DEVICE_MAILSLOT: DEVICE_TYPE = 0x0000000c; +pub const FILE_DEVICE_MIDI_IN: DEVICE_TYPE = 0x0000000d; +pub const FILE_DEVICE_MIDI_OUT: DEVICE_TYPE = 0x0000000e; +pub const FILE_DEVICE_MOUSE: DEVICE_TYPE = 0x0000000f; +pub const FILE_DEVICE_MULTI_UNC_PROVIDER: DEVICE_TYPE = 0x00000010; +pub const FILE_DEVICE_NAMED_PIPE: DEVICE_TYPE = 0x00000011; +pub const FILE_DEVICE_NETWORK: DEVICE_TYPE = 0x00000012; +pub const FILE_DEVICE_NETWORK_BROWSER: DEVICE_TYPE = 0x00000013; +pub const FILE_DEVICE_NETWORK_FILE_SYSTEM: DEVICE_TYPE = 0x00000014; +pub const FILE_DEVICE_NULL: DEVICE_TYPE = 0x00000015; +pub const FILE_DEVICE_PARALLEL_PORT: DEVICE_TYPE = 0x00000016; +pub const FILE_DEVICE_PHYSICAL_NETCARD: DEVICE_TYPE = 0x00000017; +pub const FILE_DEVICE_PRINTER: DEVICE_TYPE = 0x00000018; +pub const FILE_DEVICE_SCANNER: DEVICE_TYPE = 0x00000019; +pub const FILE_DEVICE_SERIAL_MOUSE_PORT: DEVICE_TYPE = 0x0000001a; +pub const FILE_DEVICE_SERIAL_PORT: DEVICE_TYPE = 0x0000001b; +pub const FILE_DEVICE_SCREEN: DEVICE_TYPE = 0x0000001c; +pub const FILE_DEVICE_SOUND: DEVICE_TYPE = 0x0000001d; +pub const FILE_DEVICE_STREAMS: DEVICE_TYPE = 0x0000001e; +pub const FILE_DEVICE_TAPE: DEVICE_TYPE = 0x0000001f; +pub const FILE_DEVICE_TAPE_FILE_SYSTEM: DEVICE_TYPE = 0x00000020; +pub const FILE_DEVICE_TRANSPORT: DEVICE_TYPE = 0x00000021; +pub const FILE_DEVICE_UNKNOWN: DEVICE_TYPE = 0x00000022; +pub const FILE_DEVICE_VIDEO: DEVICE_TYPE = 0x00000023; +pub const FILE_DEVICE_VIRTUAL_DISK: DEVICE_TYPE = 0x00000024; +pub const FILE_DEVICE_WAVE_IN: DEVICE_TYPE = 0x00000025; +pub const FILE_DEVICE_WAVE_OUT: DEVICE_TYPE = 0x00000026; +pub const FILE_DEVICE_8042_PORT: DEVICE_TYPE = 0x00000027; +pub const FILE_DEVICE_NETWORK_REDIRECTOR: DEVICE_TYPE = 0x00000028; +pub const FILE_DEVICE_BATTERY: DEVICE_TYPE = 0x00000029; +pub const FILE_DEVICE_BUS_EXTENDER: DEVICE_TYPE = 0x0000002a; +pub const FILE_DEVICE_MODEM: DEVICE_TYPE = 0x0000002b; +pub const FILE_DEVICE_VDM: DEVICE_TYPE = 0x0000002c; +pub const FILE_DEVICE_MASS_STORAGE: DEVICE_TYPE = 0x0000002d; +pub const FILE_DEVICE_SMB: DEVICE_TYPE = 0x0000002e; +pub const FILE_DEVICE_KS: DEVICE_TYPE = 0x0000002f; +pub const FILE_DEVICE_CHANGER: DEVICE_TYPE = 0x00000030; +pub const FILE_DEVICE_SMARTCARD: DEVICE_TYPE = 0x00000031; +pub const FILE_DEVICE_ACPI: DEVICE_TYPE = 0x00000032; +pub const FILE_DEVICE_DVD: DEVICE_TYPE = 0x00000033; +pub const FILE_DEVICE_FULLSCREEN_VIDEO: DEVICE_TYPE = 0x00000034; +pub const FILE_DEVICE_DFS_FILE_SYSTEM: DEVICE_TYPE = 0x00000035; +pub const FILE_DEVICE_DFS_VOLUME: DEVICE_TYPE = 0x00000036; +pub const FILE_DEVICE_SERENUM: DEVICE_TYPE = 0x00000037; +pub const FILE_DEVICE_TERMSRV: DEVICE_TYPE = 0x00000038; +pub const FILE_DEVICE_KSEC: DEVICE_TYPE = 0x00000039; +pub const FILE_DEVICE_FIPS: DEVICE_TYPE = 0x0000003A; +pub const FILE_DEVICE_INFINIBAND: DEVICE_TYPE = 0x0000003B; +pub const FILE_DEVICE_VMBUS: DEVICE_TYPE = 0x0000003E; +pub const FILE_DEVICE_CRYPT_PROVIDER: DEVICE_TYPE = 0x0000003F; +pub const FILE_DEVICE_WPD: DEVICE_TYPE = 0x00000040; +pub const FILE_DEVICE_BLUETOOTH: DEVICE_TYPE = 0x00000041; +pub const FILE_DEVICE_MT_COMPOSITE: DEVICE_TYPE = 0x00000042; +pub const FILE_DEVICE_MT_TRANSPORT: DEVICE_TYPE = 0x00000043; +pub const FILE_DEVICE_BIOMETRIC: DEVICE_TYPE = 0x00000044; +pub const FILE_DEVICE_PMI: DEVICE_TYPE = 0x00000045; +pub const FILE_DEVICE_EHSTOR: DEVICE_TYPE = 0x00000046; +pub const FILE_DEVICE_DEVAPI: DEVICE_TYPE = 0x00000047; +pub const FILE_DEVICE_GPIO: DEVICE_TYPE = 0x00000048; +pub const FILE_DEVICE_USBEX: DEVICE_TYPE = 0x00000049; +pub const FILE_DEVICE_CONSOLE: DEVICE_TYPE = 0x00000050; +pub const FILE_DEVICE_NFP: DEVICE_TYPE = 0x00000051; +pub const FILE_DEVICE_SYSENV: DEVICE_TYPE = 0x00000052; +pub const FILE_DEVICE_VIRTUAL_BLOCK: DEVICE_TYPE = 0x00000053; +pub const FILE_DEVICE_POINT_OF_SERVICE: DEVICE_TYPE = 0x00000054; +pub const FILE_DEVICE_STORAGE_REPLICATION: DEVICE_TYPE = 0x00000055; +pub const FILE_DEVICE_TRUST_ENV: DEVICE_TYPE = 0x00000056; +pub const FILE_DEVICE_UCM: DEVICE_TYPE = 0x00000057; +pub const FILE_DEVICE_UCMTCPCI: DEVICE_TYPE = 0x00000058; +#[inline] +pub fn CTL_CODE( + DeviceType: DWORD, + Function: DWORD, + Method: DWORD, + Access: DWORD, +) -> DWORD { + (DeviceType << 16) | (Access << 14) | (Function << 2) | Method +} +//288 +pub const METHOD_BUFFERED: DWORD = 0; +pub const METHOD_IN_DIRECT: DWORD = 1; +pub const METHOD_OUT_DIRECT: DWORD = 2; +pub const METHOD_NEITHER: DWORD = 3; +//317 +pub const FILE_ANY_ACCESS: DWORD = 0; +pub const FILE_SPECIAL_ACCESS: DWORD = FILE_ANY_ACCESS; +pub const FILE_READ_ACCESS: DWORD = 0x0001; +pub const FILE_WRITE_ACCESS: DWORD = 0x0002; +//347 +pub const IOCTL_STORAGE_BASE: DWORD = FILE_DEVICE_MASS_STORAGE; +pub const IOCTL_STORAGE_CHECK_VERIFY: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0200, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_CHECK_VERIFY2: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0200, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_MEDIA_REMOVAL: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0201, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_EJECT_MEDIA: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0202, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_LOAD_MEDIA: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0203, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_LOAD_MEDIA2: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0203, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_RESERVE: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const IOCTL_STORAGE_RELEASE: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const IOCTL_STORAGE_FIND_NEW_DEVICES: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0206, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_EJECTION_CONTROL: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0250, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_MCN_CONTROL: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0251, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_GET_MEDIA_TYPES: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0300, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_GET_MEDIA_TYPES_EX: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0301, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0304, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_GET_HOTPLUG_INFO: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0305, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_SET_HOTPLUG_INFO: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0306, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_RESET_BUS: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const IOCTL_STORAGE_RESET_DEVICE: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0401, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_BREAK_RESERVATION: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0405, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_PERSISTENT_RESERVE_IN: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0406, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_PERSISTENT_RESERVE_OUT: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0407, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_GET_DEVICE_NUMBER: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0420, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_PREDICT_FAILURE: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0440, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_FAILURE_PREDICTION_CONFIG: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0441, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_READ_CAPACITY: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0450, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_GET_DEVICE_TELEMETRY: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0470, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_DEVICE_TELEMETRY_NOTIFY: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0471, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_DEVICE_TELEMETRY_QUERY_CAPS: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, + 0x0472, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_GET_DEVICE_TELEMETRY_RAW: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0473, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_QUERY_PROPERTY: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0500, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0501, + METHOD_BUFFERED, FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_GET_LB_PROVISIONING_MAP_RESOURCES: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, + 0x0502, METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_GET_BC_PROPERTIES: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0600, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_STORAGE_ALLOCATE_BC_STREAM: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0601, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_FREE_BC_STREAM: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0602, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_CHECK_PRIORITY_HINT_SUPPORT: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, + 0x0620, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_START_DATA_INTEGRITY_CHECK: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0621, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_STOP_DATA_INTEGRITY_CHECK: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0622, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const OBSOLETE_IOCTL_STORAGE_RESET_BUS: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0400, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const OBSOLETE_IOCTL_STORAGE_RESET_DEVICE: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0401, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_STORAGE_ENABLE_IDLE_POWER: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0720, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_GET_IDLE_POWERUP_REASON: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0721, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_POWER_ACTIVE: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0722, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_POWER_IDLE: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0723, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_STORAGE_EVENT_NOTIFICATION: DWORD = CTL_CODE!(IOCTL_STORAGE_BASE, 0x0724, + METHOD_BUFFERED, FILE_ANY_ACCESS); +//565 +STRUCT!{struct STORAGE_DEVICE_NUMBER { + DeviceType: DEVICE_TYPE, + DeviceNumber: DWORD, + PartitionNumber: DWORD, +}} +pub type PSTORAGE_DEVICE_NUMBER = *mut STORAGE_DEVICE_NUMBER; +STRUCT!{struct STORAGE_DEVICE_NUMBERS { + NumberOfDevices: DWORD, + Devices: [STORAGE_DEVICE_NUMBER; ANYSIZE_ARRAY], +}} +pub type PSTORAGE_DEVICE_NUMBERS = *mut STORAGE_DEVICE_NUMBERS; +//1040 +ENUM!{enum STORAGE_QUERY_TYPE { + PropertyStandardQuery = 0, + PropertyExistsQuery, + PropertyMaskQuery, + PropertyQueryMaxDefined, +}} +pub type PSTORAGE_QUERY_TYPE = *mut STORAGE_QUERY_TYPE; +ENUM!{enum STORAGE_PROPERTY_ID { + StorageDeviceProperty = 0, + StorageAdapterProperty, + StorageDeviceIdProperty, + StorageDeviceUniqueIdProperty, + StorageDeviceWriteCacheProperty, + StorageMiniportProperty, + StorageAccessAlignmentProperty, + StorageDeviceSeekPenaltyProperty, + StorageDeviceTrimProperty, + StorageDeviceWriteAggregationProperty, + StorageDeviceDeviceTelemetryProperty, + StorageDeviceLBProvisioningProperty, + StorageDevicePowerProperty, + StorageDeviceCopyOffloadProperty, + StorageDeviceResiliencyProperty, + StorageDeviceMediumProductType, + StorageAdapterCryptoProperty, + StorageDeviceIoCapabilityProperty = 48, + StorageAdapterProtocolSpecificProperty, + StorageDeviceProtocolSpecificProperty, + StorageAdapterTemperatureProperty, + StorageDeviceTemperatureProperty, + StorageAdapterPhysicalTopologyProperty, + StorageDevicePhysicalTopologyProperty, + StorageDeviceAttributesProperty, + StorageDeviceManagementStatus, + StorageAdapterSerialNumberProperty, + StorageDeviceLocationProperty, + StorageDeviceNumaProperty, + StorageDeviceZonedDeviceProperty, + StorageDeviceUnsafeShutdownCount, +}} +pub type PSTORAGE_PROPERTY_ID = *mut STORAGE_PROPERTY_ID; +STRUCT!{struct STORAGE_PROPERTY_QUERY { + PropertyId: STORAGE_PROPERTY_ID, + QueryType: STORAGE_QUERY_TYPE, + AdditionalParameters: [BYTE; 1], +}} +pub type PSTORAGE_PROPERTY_QUERY = *mut STORAGE_PROPERTY_QUERY; +//1574 +STRUCT!{struct DEVICE_TRIM_DESCRIPTOR { + Version: DWORD, + Size: DWORD, + TrimEnabled: BOOLEAN, +}} +pub type PDEVICE_TRIM_DESCRIPTOR = *mut DEVICE_TRIM_DESCRIPTOR; +//7540 +pub const IOCTL_DISK_BASE: DWORD = FILE_DEVICE_DISK; +pub const IOCTL_DISK_GET_DRIVE_GEOMETRY: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0000, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_DISK_GET_PARTITION_INFO: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0001, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_DISK_SET_PARTITION_INFO: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0002, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_GET_DRIVE_LAYOUT: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0003, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_DISK_SET_DRIVE_LAYOUT: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0004, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_VERIFY: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0005, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_DISK_FORMAT_TRACKS: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0006, METHOD_BUFFERED, + FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_REASSIGN_BLOCKS: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0007, METHOD_BUFFERED, + FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_PERFORMANCE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0008, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_DISK_IS_WRITABLE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0009, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_DISK_LOGGING: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x000a, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_DISK_FORMAT_TRACKS_EX: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x000b, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_HISTOGRAM_STRUCTURE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x000c, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_DISK_HISTOGRAM_DATA: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x000d, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_DISK_HISTOGRAM_RESET: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x000e, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_DISK_REQUEST_STRUCTURE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x000f, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_DISK_REQUEST_DATA: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0010, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_DISK_PERFORMANCE_OFF: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0018, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_DISK_CONTROLLER_NUMBER: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0011, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const SMART_GET_VERSION: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const SMART_SEND_DRIVE_COMMAND: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, + FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const SMART_RCV_DRIVE_DATA: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, + FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_GET_PARTITION_INFO_EX: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0012, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_DISK_SET_PARTITION_INFO_EX: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0013, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_GET_DRIVE_LAYOUT_EX: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0014, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_DISK_SET_DRIVE_LAYOUT_EX: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0015, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_CREATE_DISK: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0016, METHOD_BUFFERED, + FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_GET_LENGTH_INFO: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0017, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const IOCTL_DISK_GET_DRIVE_GEOMETRY_EX: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0028, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_DISK_REASSIGN_BLOCKS_EX: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0029, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_UPDATE_DRIVE_SIZE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0032, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_GROW_PARTITION: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0034, METHOD_BUFFERED, + FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_GET_CACHE_INFORMATION: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0035, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_DISK_SET_CACHE_INFORMATION: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0036, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_GET_WRITE_CACHE_STATE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0037, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const OBSOLETE_DISK_GET_WRITE_CACHE_STATE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0037, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_DISK_DELETE_DRIVE_LAYOUT: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0040, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_UPDATE_PROPERTIES: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0050, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_DISK_FORMAT_DRIVE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x00f3, METHOD_BUFFERED, + FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_SENSE_DEVICE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x00f8, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_DISK_CHECK_VERIFY: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0200, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const IOCTL_DISK_MEDIA_REMOVAL: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0201, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const IOCTL_DISK_EJECT_MEDIA: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0202, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const IOCTL_DISK_LOAD_MEDIA: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0203, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const IOCTL_DISK_RESERVE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0204, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const IOCTL_DISK_RELEASE: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0205, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const IOCTL_DISK_FIND_NEW_DEVICES: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0206, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_DISK_GET_MEDIA_TYPES: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_DISK_GET_DISK_ATTRIBUTES: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x003c, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_DISK_SET_DISK_ATTRIBUTES: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x003d, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_DISK_RESET_SNAPSHOT_INFO: DWORD = CTL_CODE!(IOCTL_DISK_BASE, 0x0084, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +//7810 +ENUM!{enum MEDIA_TYPE { + Unknown, + F5_1Pt2_512, + F3_1Pt44_512, + F3_2Pt88_512, + F3_20Pt8_512, + F3_720_512, + F5_360_512, + F5_320_512, + F5_320_1024, + F5_180_512, + F5_160_512, + RemovableMedia, + FixedMedia, + F3_120M_512, + F3_640_512, + F5_640_512, + F5_720_512, + F3_1Pt2_512, + F3_1Pt23_1024, + F5_1Pt23_1024, + F3_128Mb_512, + F3_230Mb_512, + F8_256_128, + F3_200Mb_512, + F3_240M_512, + F3_32M_512, +}} +pub type PMEDIA_TYPE = *mut MEDIA_TYPE; +//7884 +STRUCT!{struct DISK_GEOMETRY { + Cylinders: LARGE_INTEGER, + MediaType: MEDIA_TYPE, + TracksPerCylinder: DWORD, + SectorsPerTrack: DWORD, + BytesPerSector: DWORD, +}} +pub type PDISK_GEOMETRY = *mut DISK_GEOMETRY; +DEFINE_GUID!{WMI_DISK_GEOMETRY_GUID, + 0x25007f51, 0x57c2, 0x11d1, 0xa5, 0x28, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10} +STRUCT!{struct PARTITION_INFORMATION { + StartingOffset: LARGE_INTEGER, + PartitionLength: LARGE_INTEGER, + HiddenSectors: DWORD, + PartitionNumber: DWORD, + PartitionType: BYTE, + BootIndicator: BOOLEAN, + RecognizedPartition: BOOLEAN, + RewritePartition: BOOLEAN, +}} +pub type PPARTITION_INFORMATION = *mut PARTITION_INFORMATION; +STRUCT!{struct SET_PARTITION_INFORMATION { + PartitionType: BYTE, +}} +pub type PSET_PARTITION_INFORMATION = *mut SET_PARTITION_INFORMATION; +STRUCT!{struct DRIVE_LAYOUT_INFORMATION { + PartitionCount: DWORD, + Signature: DWORD, + PartitionEntry: [PARTITION_INFORMATION; 1], +}} +pub type PDRIVE_LAYOUT_INFORMATION = *mut DRIVE_LAYOUT_INFORMATION; +STRUCT!{struct VERIFY_INFORMATION { + StartingOffset: LARGE_INTEGER, + Length: DWORD, +}} +pub type PVERIFY_INFORMATION = *mut VERIFY_INFORMATION; +STRUCT!{struct REASSIGN_BLOCKS { + Reserved: WORD, + Count: WORD, + BlockNumber: [DWORD; 1], +}} +pub type PREASSIGN_BLOCKS = *mut REASSIGN_BLOCKS; +STRUCT!{#[repr(packed)] struct REASSIGN_BLOCKS_EX { + Reserved: WORD, + Count: WORD, + BlockNumber: [LARGE_INTEGER; 1], +}} +pub type PREASSIGN_BLOCKS_EX = *mut REASSIGN_BLOCKS_EX; +ENUM!{enum PARTITION_STYLE { + PARTITION_STYLE_MBR, + PARTITION_STYLE_GPT, + PARTITION_STYLE_RAW, +}} +STRUCT!{struct PARTITION_INFORMATION_GPT { + PartitionType: GUID, + PartitionId: GUID, + Attributes: DWORD64, + Name: [WCHAR; 36], +}} +pub type PPARTITION_INFORMATION_GPT = *mut PARTITION_INFORMATION_GPT; +//8059 +STRUCT!{struct PARTITION_INFORMATION_MBR { + PartitionType: BYTE, + BootIndicator: BOOLEAN, + RecognizedPartition: BOOLEAN, + HiddenSectors: DWORD, + PartitionId: GUID, +}} +pub type PPARTITION_INFORMATION_MBR = *mut PARTITION_INFORMATION_MBR; +pub type SET_PARTITION_INFORMATION_MBR = SET_PARTITION_INFORMATION; +pub type SET_PARTITION_INFORMATION_GPT = PARTITION_INFORMATION_GPT; +STRUCT!{struct SET_PARTITION_INFORMATION_EX { + PartitionStyle: PARTITION_STYLE, + u: SET_PARTITION_INFORMATION_EX_u, +}} +UNION!{union SET_PARTITION_INFORMATION_EX_u { + [u64; 14], + Mbr Mbr_mut: SET_PARTITION_INFORMATION_MBR, + Gpt Gpt_mut: SET_PARTITION_INFORMATION_GPT, +}} +STRUCT!{struct CREATE_DISK_GPT { + DiskId: GUID, + MaxPartitionCount: DWORD, +}} +pub type PCREATE_DISK_GPT = *mut CREATE_DISK_GPT; +STRUCT!{struct CREATE_DISK_MBR { + Signature: DWORD, +}} +pub type PCREATE_DISK_MBR = *mut CREATE_DISK_MBR; +STRUCT!{struct CREATE_DISK { + PartitionStyle: PARTITION_STYLE, + u: CREATE_DISK_u, +}} +pub type PCREATE_DISK = *mut CREATE_DISK; +UNION!{union CREATE_DISK_u { + [u32; 5], + Mbr Mbr_mut: CREATE_DISK_MBR, + Gpt Gpt_mut: CREATE_DISK_GPT, +}} +STRUCT!{struct GET_LENGTH_INFORMATION { + Length: LARGE_INTEGER, +}} +pub type PGET_LENGTH_INFORMATION = *mut GET_LENGTH_INFORMATION; +STRUCT!{struct PARTITION_INFORMATION_EX { + PartitionStyle: PARTITION_STYLE, + StartingOffset: LARGE_INTEGER, + PartitionLength: LARGE_INTEGER, + PartitionNumber: DWORD, + RewritePartition: BOOLEAN, + u: PARTITION_INFORMATION_EX_u, +}} +pub type PPARTITION_INFORMATION_EX = *mut PARTITION_INFORMATION_EX; +UNION!{union PARTITION_INFORMATION_EX_u { + [u64; 14], + Mbr Mbr_mut: PARTITION_INFORMATION_MBR, + Gpt Gpt_mut: PARTITION_INFORMATION_GPT, +}} +STRUCT!{struct DRIVE_LAYOUT_INFORMATION_GPT { + DiskId: GUID, + StartingUsableOffset: LARGE_INTEGER, + UsableLength: LARGE_INTEGER, + MaxPartitionCount: DWORD, +}} +pub type PDRIVE_LAYOUT_INFORMATION_GPT = *mut DRIVE_LAYOUT_INFORMATION_GPT; +STRUCT!{struct DRIVE_LAYOUT_INFORMATION_MBR { + Signature: DWORD, + CheckSum: DWORD, +}} +pub type PDRIVE_LAYOUT_INFORMATION_MBR = *mut DRIVE_LAYOUT_INFORMATION_MBR; +STRUCT!{struct DRIVE_LAYOUT_INFORMATION_EX { + PartitionStyle: DWORD, + PartitionCount: DWORD, + u: DRIVE_LAYOUT_INFORMATION_EX_u, + PartitionEntry: [PARTITION_INFORMATION_EX; 1], +}} +pub type PDRIVE_LAYOUT_INFORMATION_EX = *mut DRIVE_LAYOUT_INFORMATION_EX; +UNION! {union DRIVE_LAYOUT_INFORMATION_EX_u { + [u64; 5], + Mbr Mbr_mut: DRIVE_LAYOUT_INFORMATION_MBR, + Gpt Gpt_mut: DRIVE_LAYOUT_INFORMATION_GPT, +}} +//8350 +STRUCT!{struct DISK_GEOMETRY_EX { + Geometry: DISK_GEOMETRY, + DiskSize: LARGE_INTEGER, + Data: [BYTE; 1], +}} +//8933 +pub const IOCTL_CHANGER_BASE: DWORD = FILE_DEVICE_CHANGER; +pub const IOCTL_CHANGER_GET_PARAMETERS: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x0000, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_CHANGER_GET_STATUS: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x0001, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_CHANGER_GET_PRODUCT_DATA: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x0002, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_CHANGER_SET_ACCESS: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x0004, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_CHANGER_GET_ELEMENT_STATUS: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x0005, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x0006, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_CHANGER_SET_POSITION: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x0007, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_CHANGER_EXCHANGE_MEDIUM: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x0008, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_CHANGER_MOVE_MEDIUM: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x0009, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_CHANGER_REINITIALIZE_TRANSPORT: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x000A, + METHOD_BUFFERED, FILE_READ_ACCESS); +pub const IOCTL_CHANGER_QUERY_VOLUME_TAGS: DWORD = CTL_CODE!(IOCTL_CHANGER_BASE, 0x000B, + METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_SERIAL_LSRMST_INSERT: DWORD = CTL_CODE!(FILE_DEVICE_SERIAL_PORT, 31, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SERENUM_EXPOSE_HARDWARE: DWORD = CTL_CODE!(FILE_DEVICE_SERENUM, 128, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SERENUM_REMOVE_HARDWARE: DWORD = CTL_CODE!(FILE_DEVICE_SERENUM, 129, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SERENUM_PORT_DESC: DWORD = CTL_CODE!(FILE_DEVICE_SERENUM, 130, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SERENUM_GET_PORT_NAME: DWORD = CTL_CODE!(FILE_DEVICE_SERENUM, 131, + METHOD_BUFFERED, FILE_ANY_ACCESS); +//9717 +pub const FSCTL_REQUEST_OPLOCK_LEVEL_1: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 0, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_REQUEST_OPLOCK_LEVEL_2: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 1, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_REQUEST_BATCH_OPLOCK: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 2, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_OPLOCK_BREAK_ACKNOWLEDGE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 3, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_OPBATCH_ACK_CLOSE_PENDING: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 4, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_OPLOCK_BREAK_NOTIFY: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 5, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_LOCK_VOLUME: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_UNLOCK_VOLUME: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_DISMOUNT_VOLUME: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_IS_VOLUME_MOUNTED: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 10, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_IS_PATHNAME_VALID: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 11, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_MARK_VOLUME_DIRTY: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 12, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_QUERY_RETRIEVAL_POINTERS: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 14, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_GET_COMPRESSION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_SET_COMPRESSION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, + FILE_READ_DATA | FILE_WRITE_DATA); +pub const FSCTL_SET_BOOTLOADER_ACCESSED: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 19, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_MARK_AS_SYSTEM_HIVE: DWORD = FSCTL_SET_BOOTLOADER_ACCESSED; +pub const FSCTL_OPLOCK_BREAK_ACK_NO_2: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 20, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_INVALIDATE_VOLUMES: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 21, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_QUERY_FAT_BPB: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_REQUEST_FILTER_OPLOCK: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 23, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_FILESYSTEM_GET_STATISTICS: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 24, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_GET_NTFS_VOLUME_DATA: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 25, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_GET_NTFS_FILE_RECORD: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 26, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_GET_VOLUME_BITMAP: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, + FILE_ANY_ACCESS); +pub const FSCTL_GET_RETRIEVAL_POINTERS: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 28, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_MOVE_FILE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, + FILE_SPECIAL_ACCESS); +pub const FSCTL_IS_VOLUME_DIRTY: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_ALLOW_EXTENDED_DASD_IO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 32, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_FIND_FILES_BY_SID: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, + FILE_ANY_ACCESS); +pub const FSCTL_SET_OBJECT_ID: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, + FILE_SPECIAL_ACCESS); +pub const FSCTL_GET_OBJECT_ID: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_DELETE_OBJECT_ID: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, + FILE_SPECIAL_ACCESS); +pub const FSCTL_SET_REPARSE_POINT: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 41, + METHOD_BUFFERED, FILE_SPECIAL_ACCESS); +pub const FSCTL_GET_REPARSE_POINT: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 42, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_DELETE_REPARSE_POINT: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 43, + METHOD_BUFFERED, FILE_SPECIAL_ACCESS); +pub const FSCTL_ENUM_USN_DATA: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 44, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_SECURITY_ID_CHECK: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, + FILE_READ_DATA); +pub const FSCTL_READ_USN_JOURNAL: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, + FILE_ANY_ACCESS); +pub const FSCTL_SET_OBJECT_ID_EXTENDED: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 47, + METHOD_BUFFERED, FILE_SPECIAL_ACCESS); +pub const FSCTL_CREATE_OR_GET_OBJECT_ID: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 48, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_SET_SPARSE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, + FILE_SPECIAL_ACCESS); +pub const FSCTL_SET_ZERO_DATA: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, + FILE_WRITE_DATA); +pub const FSCTL_QUERY_ALLOCATED_RANGES: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 51, + METHOD_NEITHER, FILE_READ_DATA); +pub const FSCTL_ENABLE_UPGRADE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, + FILE_WRITE_DATA); +pub const FSCTL_SET_ENCRYPTION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_NEITHER, + FILE_ANY_ACCESS); +pub const FSCTL_ENCRYPTION_FSCTL_IO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 54, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_WRITE_RAW_ENCRYPTED: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 55, + METHOD_NEITHER, FILE_SPECIAL_ACCESS); +pub const FSCTL_READ_RAW_ENCRYPTED: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 56, + METHOD_NEITHER, FILE_SPECIAL_ACCESS); +pub const FSCTL_CREATE_USN_JOURNAL: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 57, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_READ_FILE_USN_DATA: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 58, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_WRITE_USN_CLOSE_RECORD: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 59, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_EXTEND_VOLUME: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_QUERY_USN_JOURNAL: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 61, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_DELETE_USN_JOURNAL: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 62, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_MARK_HANDLE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_SIS_COPYFILE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 64, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_SIS_LINK_FILES: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 65, METHOD_BUFFERED, + FILE_READ_DATA | FILE_WRITE_DATA); +pub const FSCTL_RECALL_FILE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 69, METHOD_NEITHER, + FILE_ANY_ACCESS); +pub const FSCTL_READ_FROM_PLEX: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 71, METHOD_OUT_DIRECT, + FILE_READ_DATA); +pub const FSCTL_FILE_PREFETCH: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 72, METHOD_BUFFERED, + FILE_SPECIAL_ACCESS); +pub const FSCTL_MAKE_MEDIA_COMPATIBLE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 76, + METHOD_BUFFERED, FILE_WRITE_DATA); +pub const FSCTL_SET_DEFECT_MANAGEMENT: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 77, + METHOD_BUFFERED, FILE_WRITE_DATA); +pub const FSCTL_QUERY_SPARING_INFO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 78, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_QUERY_ON_DISK_VOLUME_INFO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 79, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_SET_VOLUME_COMPRESSION_STATE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 80, + METHOD_BUFFERED, FILE_SPECIAL_ACCESS); +pub const FSCTL_TXFS_MODIFY_RM: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 81, METHOD_BUFFERED, + FILE_WRITE_DATA); +pub const FSCTL_TXFS_QUERY_RM_INFORMATION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 82, + METHOD_BUFFERED, FILE_READ_DATA); +pub const FSCTL_TXFS_ROLLFORWARD_REDO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 84, + METHOD_BUFFERED, FILE_WRITE_DATA); +pub const FSCTL_TXFS_ROLLFORWARD_UNDO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 85, + METHOD_BUFFERED, FILE_WRITE_DATA); +pub const FSCTL_TXFS_START_RM: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 86, METHOD_BUFFERED, + FILE_WRITE_DATA); +pub const FSCTL_TXFS_SHUTDOWN_RM: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 87, METHOD_BUFFERED, + FILE_WRITE_DATA); +pub const FSCTL_TXFS_READ_BACKUP_INFORMATION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 88, + METHOD_BUFFERED, FILE_READ_DATA); +pub const FSCTL_TXFS_WRITE_BACKUP_INFORMATION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 89, + METHOD_BUFFERED, FILE_WRITE_DATA); +pub const FSCTL_TXFS_CREATE_SECONDARY_RM: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 90, + METHOD_BUFFERED, FILE_WRITE_DATA); +pub const FSCTL_TXFS_GET_METADATA_INFO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 91, + METHOD_BUFFERED, FILE_READ_DATA); +pub const FSCTL_TXFS_GET_TRANSACTED_VERSION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 92, + METHOD_BUFFERED, FILE_READ_DATA); +pub const FSCTL_TXFS_SAVEPOINT_INFORMATION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 94, + METHOD_BUFFERED, FILE_WRITE_DATA); +pub const FSCTL_TXFS_CREATE_MINIVERSION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 95, + METHOD_BUFFERED, FILE_WRITE_DATA); +pub const FSCTL_TXFS_TRANSACTION_ACTIVE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 99, + METHOD_BUFFERED, FILE_READ_DATA); +pub const FSCTL_SET_ZERO_ON_DEALLOCATION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 101, + METHOD_BUFFERED, FILE_SPECIAL_ACCESS); +pub const FSCTL_SET_REPAIR: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 102, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_GET_REPAIR: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 103, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_WAIT_FOR_REPAIR: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 104, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_INITIATE_REPAIR: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 106, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_CSC_INTERNAL: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 107, METHOD_NEITHER, + FILE_ANY_ACCESS); +pub const FSCTL_SHRINK_VOLUME: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 108, METHOD_BUFFERED, + FILE_SPECIAL_ACCESS); +pub const FSCTL_SET_SHORT_NAME_BEHAVIOR: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 109, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_DFSR_SET_GHOST_HANDLE_STATE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 110, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_TXFS_LIST_TRANSACTION_LOCKED_FILES: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, + 120, METHOD_BUFFERED, FILE_READ_DATA); +pub const FSCTL_TXFS_LIST_TRANSACTIONS: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 121, + METHOD_BUFFERED, FILE_READ_DATA); +pub const FSCTL_QUERY_PAGEFILE_ENCRYPTION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 122, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_RESET_VOLUME_ALLOCATION_HINTS: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 123, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_QUERY_DEPENDENT_VOLUME: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 124, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_SD_GLOBAL_CHANGE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 125, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_TXFS_READ_BACKUP_INFORMATION2: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 126, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_LOOKUP_STREAM_FROM_CLUSTER: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 127, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_TXFS_WRITE_BACKUP_INFORMATION2: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 128, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_FILE_TYPE_NOTIFICATION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 129, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_FILE_LEVEL_TRIM: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 130, METHOD_BUFFERED, + FILE_WRITE_DATA); +pub const FSCTL_GET_BOOT_AREA_INFO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 140, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_GET_RETRIEVAL_POINTER_BASE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 141, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_SET_PERSISTENT_VOLUME_STATE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 142, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_QUERY_PERSISTENT_VOLUME_STATE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 143, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_REQUEST_OPLOCK: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 144, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_CSV_TUNNEL_REQUEST: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 145, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_IS_CSV_FILE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 146, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_QUERY_FILE_SYSTEM_RECOGNITION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 147, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_CSV_GET_VOLUME_PATH_NAME: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 148, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_CSV_GET_VOLUME_NAME_FOR_VOLUME_MOUNT_POINT: DWORD = CTL_CODE!( + FILE_DEVICE_FILE_SYSTEM, 149, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_CSV_GET_VOLUME_PATH_NAMES_FOR_VOLUME_NAME: DWORD = CTL_CODE!( + FILE_DEVICE_FILE_SYSTEM, 150, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_IS_FILE_ON_CSV_VOLUME: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 151, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_CORRUPTION_HANDLING: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 152, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_OFFLOAD_READ: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 153, METHOD_BUFFERED, + FILE_READ_ACCESS); +pub const FSCTL_OFFLOAD_WRITE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 154, METHOD_BUFFERED, + FILE_WRITE_ACCESS); +pub const FSCTL_CSV_INTERNAL: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 155, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_SET_PURGE_FAILURE_MODE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 156, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_QUERY_FILE_LAYOUT: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 157, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_IS_VOLUME_OWNED_BYCSVFS: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 158, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_GET_INTEGRITY_INFORMATION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 159, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_SET_INTEGRITY_INFORMATION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 160, + METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA); +pub const FSCTL_QUERY_FILE_REGIONS: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 161, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_DEDUP_FILE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 165, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_DEDUP_QUERY_FILE_HASHES: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 166, + METHOD_NEITHER, FILE_READ_DATA); +pub const FSCTL_DEDUP_QUERY_RANGE_STATE: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 167, + METHOD_NEITHER, FILE_READ_DATA); +pub const FSCTL_DEDUP_QUERY_REPARSE_INFO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 168, + METHOD_NEITHER, FILE_ANY_ACCESS); +pub const FSCTL_RKF_INTERNAL: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 171, METHOD_NEITHER, + FILE_ANY_ACCESS); +pub const FSCTL_SCRUB_DATA: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 172, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_REPAIR_COPIES: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 173, METHOD_BUFFERED, + FILE_READ_DATA | FILE_WRITE_DATA); +pub const FSCTL_DISABLE_LOCAL_BUFFERING: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 174, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_CSV_MGMT_LOCK: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 175, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_CSV_QUERY_DOWN_LEVEL_FILE_SYSTEM_CHARACTERISTICS: DWORD = CTL_CODE!( + FILE_DEVICE_FILE_SYSTEM, 176, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_ADVANCE_FILE_ID: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 177, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_CSV_SYNC_TUNNEL_REQUEST: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 178, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_CSV_QUERY_VETO_FILE_DIRECT_IO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 179, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_WRITE_USN_REASON: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 180, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_CSV_CONTROL: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 181, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const FSCTL_GET_REFS_VOLUME_DATA: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 182, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_CSV_H_BREAKING_SYNC_TUNNEL_REQUEST: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, + 185, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_QUERY_STORAGE_CLASSES: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 187, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_QUERY_REGION_INFO: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 188, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_USN_TRACK_MODIFIED_RANGES: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 189, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_QUERY_SHARED_VIRTUAL_DISK_SUPPORT: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, + 192, METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_SVHDX_SYNC_TUNNEL_REQUEST: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 193, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_SVHDX_SET_INITIATOR_INFORMATION: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 194, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_SET_EXTERNAL_BACKING: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 195, + METHOD_BUFFERED, FILE_SPECIAL_ACCESS); +pub const FSCTL_GET_EXTERNAL_BACKING: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 196, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_DELETE_EXTERNAL_BACKING: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 197, + METHOD_BUFFERED, FILE_SPECIAL_ACCESS); +pub const FSCTL_ENUM_EXTERNAL_BACKING: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 198, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const FSCTL_ENUM_OVERLAY: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 199, METHOD_NEITHER, + FILE_ANY_ACCESS); +pub const FSCTL_ADD_OVERLAY: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 204, METHOD_BUFFERED, + FILE_WRITE_DATA); +pub const FSCTL_REMOVE_OVERLAY: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 205, METHOD_BUFFERED, + FILE_WRITE_DATA); +pub const FSCTL_UPDATE_OVERLAY: DWORD = CTL_CODE!(FILE_DEVICE_FILE_SYSTEM, 206, METHOD_BUFFERED, + FILE_WRITE_DATA); +// FILE_DEVICE_AVIO is defined nowhere +//pub const IOCTL_AVIO_ALLOCATE_STREAM: DWORD = CTL_CODE!(FILE_DEVICE_AVIO, 1, METHOD_BUFFERED, +// FILE_SPECIAL_ACCESS); +//pub const IOCTL_AVIO_FREE_STREAM: DWORD = CTL_CODE!(FILE_DEVICE_AVIO, 2, METHOD_BUFFERED, +// FILE_SPECIAL_ACCESS); +//pub const IOCTL_AVIO_MODIFY_STREAM: DWORD = CTL_CODE!(FILE_DEVICE_AVIO, 3, METHOD_BUFFERED, +// FILE_SPECIAL_ACCESS); +STRUCT!{struct PATHNAME_BUFFER { + PathNameLength: DWORD, + Name: [WCHAR; 1], +}} +pub type PPATHNAME_BUFFER = *mut PATHNAME_BUFFER; +STRUCT!{struct FSCTL_QUERY_FAT_BPB_BUFFER { + First0x24BytesOfBootSector: [BYTE; 0x24], +}} +pub type PFSCTL_QUERY_FAT_BPB_BUFFER = *mut FSCTL_QUERY_FAT_BPB_BUFFER; +STRUCT!{struct NTFS_VOLUME_DATA_BUFFER { + VolumeSerialNumber: LARGE_INTEGER, + NumberSectors: LARGE_INTEGER, + TotalClusters: LARGE_INTEGER, + FreeClusters: LARGE_INTEGER, + TotalReserved: LARGE_INTEGER, + BytesPerSector: DWORD, + BytesPerCluster: DWORD, + BytesPerFileRecordSegment: DWORD, + ClustersPerFileRecordSegment: DWORD, + MftValidDataLength: LARGE_INTEGER, + MftStartLcn: LARGE_INTEGER, + Mft2StartLcn: LARGE_INTEGER, + MftZoneStart: LARGE_INTEGER, + MftZoneEnd: LARGE_INTEGER, +}} +pub type PNTFS_VOLUME_DATA_BUFFER = *mut NTFS_VOLUME_DATA_BUFFER; +STRUCT!{struct NTFS_EXTENDED_VOLUME_DATA { + ByteCount: DWORD, + MajorVersion: WORD, + MinorVersion: WORD, + BytesPerPhysicalSector: DWORD, + LfsMajorVersion: WORD, + LfsMinorVersion: WORD, + MaxDeviceTrimExtentCount: DWORD, + MaxDeviceTrimByteCount: DWORD, + MaxVolumeTrimExtentCount: DWORD, + MaxVolumeTrimByteCount: DWORD, +}} +pub type PNTFS_EXTENDED_VOLUME_DATA = *mut NTFS_EXTENDED_VOLUME_DATA; +STRUCT!{struct REFS_VOLUME_DATA_BUFFER { + ByteCount: DWORD, + MajorVersion: DWORD, + MinorVersion: DWORD, + BytesPerPhysicalSector: DWORD, + VolumeSerialNumber: LARGE_INTEGER, + NumberSectors: LARGE_INTEGER, + TotalClusters: LARGE_INTEGER, + FreeClusters: LARGE_INTEGER, + TotalReserved: LARGE_INTEGER, + BytesPerSector: DWORD, + BytesPerCluster: DWORD, + MaximumSizeOfResidentFile: LARGE_INTEGER, + Reserved: [LARGE_INTEGER; 10], +}} +pub type PREFS_VOLUME_DATA_BUFFER = *mut REFS_VOLUME_DATA_BUFFER; +STRUCT!{struct STARTING_LCN_INPUT_BUFFER { + StartingLcn: LARGE_INTEGER, +}} +pub type PSTARTING_LCN_INPUT_BUFFER = *mut STARTING_LCN_INPUT_BUFFER; +STRUCT!{struct VOLUME_BITMAP_BUFFER { + StartingLcn: LARGE_INTEGER, + BitmapSize: LARGE_INTEGER, + Buffer: [BYTE; 1], +}} +pub type PVOLUME_BITMAP_BUFFER = *mut VOLUME_BITMAP_BUFFER; +STRUCT!{struct STARTING_VCN_INPUT_BUFFER { + StartingVcn: LARGE_INTEGER, +}} +pub type PSTARTING_VCN_INPUT_BUFFER = *mut STARTING_VCN_INPUT_BUFFER; +STRUCT!{struct RETRIEVAL_POINTERS_BUFFER_INTERNAL { + NextVcn: LARGE_INTEGER, + Lcn: LARGE_INTEGER, +}} +STRUCT!{struct RETRIEVAL_POINTERS_BUFFER { + ExtentCount: DWORD, + StartingVcn: LARGE_INTEGER, + Extents: [RETRIEVAL_POINTERS_BUFFER_INTERNAL; 1], +}} +pub type PRETRIEVAL_POINTERS_BUFFER = *mut RETRIEVAL_POINTERS_BUFFER; +STRUCT!{struct NTFS_FILE_RECORD_INPUT_BUFFER { + FileReferenceNumber: LARGE_INTEGER, +}} +pub type PNTFS_FILE_RECORD_INPUT_BUFFER = *mut NTFS_FILE_RECORD_INPUT_BUFFER; +STRUCT!{struct NTFS_FILE_RECORD_OUTPUT_BUFFER { + FileReferenceNumber: LARGE_INTEGER, + FileRecordLength: DWORD, + FileRecordBuffer: [BYTE; 1], +}} +pub type PNTFS_FILE_RECORD_OUTPUT_BUFFER = *mut NTFS_FILE_RECORD_OUTPUT_BUFFER; +STRUCT!{struct MOVE_FILE_DATA { + FileHandle: HANDLE, + StartingVcn: LARGE_INTEGER, + StartingLcn: LARGE_INTEGER, + ClusterCount: DWORD, +}} +pub type PMOVE_FILE_DATA = *mut MOVE_FILE_DATA; +STRUCT!{struct MOVE_FILE_RECORD_DATA { + FileHandle: HANDLE, + SourceFileRecord: LARGE_INTEGER, + TargetFileRecord: LARGE_INTEGER, +}} +pub type PMOVE_FILE_RECORD_DATA = *mut MOVE_FILE_RECORD_DATA; +//15468 +pub const IOCTL_VOLUME_BASE: DWORD = 0x00000056; +pub const IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS: DWORD = CTL_CODE!(IOCTL_VOLUME_BASE, 0, + METHOD_BUFFERED, FILE_ANY_ACCESS); +STRUCT!{struct DISK_EXTENT { + DiskNumber: DWORD, + StartingOffset: LARGE_INTEGER, + ExtentLength: LARGE_INTEGER, +}} +pub type PDISK_EXTENT = *mut DISK_EXTENT; +STRUCT!{struct VOLUME_DISK_EXTENTS { + NumberOfDiskExtents: DWORD, + Extents: [DISK_EXTENT; ANYSIZE_ARRAY], +}} +pub type PVOLUME_DISK_EXTENTS = *mut VOLUME_DISK_EXTENTS; +pub const IOCTL_VOLUME_ONLINE: DWORD = CTL_CODE!(IOCTL_VOLUME_BASE, 2, METHOD_BUFFERED, + FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_VOLUME_OFFLINE: DWORD = CTL_CODE!(IOCTL_VOLUME_BASE, 3, METHOD_BUFFERED, + FILE_READ_ACCESS | FILE_WRITE_ACCESS); +pub const IOCTL_VOLUME_IS_CLUSTERED: DWORD = CTL_CODE!(IOCTL_VOLUME_BASE, 12, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_VOLUME_GET_GPT_ATTRIBUTES: DWORD = CTL_CODE!(IOCTL_VOLUME_BASE, 14, + METHOD_BUFFERED, FILE_ANY_ACCESS); +STRUCT!{struct DISK_PERFORMANCE { + BytesRead: LARGE_INTEGER, + BytesWritten: LARGE_INTEGER, + ReadTime: LARGE_INTEGER, + WriteTime: LARGE_INTEGER, + IdleTime: LARGE_INTEGER, + ReadCount: DWORD, + WriteCount: DWORD, + QueueDepth: DWORD, + SplitCount: DWORD, + QueryTime: LARGE_INTEGER, + StorageDeviceNumber: DWORD, + StorageManagerName: [WCHAR; 8], +}} +pub type PDISK_PERFORMANCE = *mut DISK_PERFORMANCE; diff --git a/bash-5.1/vendor/winapi/src/um/winnetwk.rs b/bash-5.1/vendor/winapi/src/um/winnetwk.rs new file mode 100644 index 0000000000000000000000000000000000000000..5680da12492467feb41f7adf078f641a50d325d1 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winnetwk.rs @@ -0,0 +1,446 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Standard WINNET Header File for WIN32 +use shared::basetsd::ULONG_PTR; +use shared::minwindef::{BOOL, DWORD, LPDWORD, LPHANDLE, LPVOID, WORD}; +use shared::windef::HWND; +use shared::winerror::{ + ERROR_ACCESS_DENIED, ERROR_ALREADY_ASSIGNED, ERROR_ALREADY_INITIALIZED, ERROR_BAD_DEVICE, + ERROR_BAD_DEV_TYPE, ERROR_BAD_NET_NAME, ERROR_BAD_PROFILE, ERROR_BAD_PROVIDER, + ERROR_BAD_USERNAME, ERROR_BUSY, ERROR_CANCELLED, ERROR_CANNOT_OPEN_PROFILE, + ERROR_CONNECTED_OTHER_PASSWORD, ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT, + ERROR_CONNECTION_UNAVAIL, ERROR_DEVICE_ALREADY_REMEMBERED, ERROR_DEVICE_IN_USE, + ERROR_EXTENDED_ERROR, ERROR_GEN_FAILURE, ERROR_INVALID_ADDRESS, ERROR_INVALID_HANDLE, + ERROR_INVALID_LEVEL, ERROR_INVALID_PARAMETER, ERROR_INVALID_PASSWORD, ERROR_MORE_DATA, + ERROR_NOT_AUTHENTICATED, ERROR_NOT_CONNECTED, ERROR_NOT_CONTAINER, ERROR_NOT_ENOUGH_MEMORY, + ERROR_NOT_LOGGED_ON, ERROR_NOT_SUPPORTED, ERROR_NO_LOGON_SERVERS, ERROR_NO_MORE_DEVICES, + ERROR_NO_MORE_ITEMS, ERROR_NO_NETWORK, ERROR_NO_NET_OR_BAD_PATH, ERROR_OPEN_FILES, ERROR_RETRY, + ERROR_UNEXP_NET_ERR, NO_ERROR +}; +use um::winnt::{HANDLE, LPCSTR, LPCWSTR, LPSTR, LPWSTR}; +pub const RESOURCE_CONNECTED: DWORD = 0x00000001; +pub const RESOURCE_GLOBALNET: DWORD = 0x00000002; +pub const RESOURCE_REMEMBERED: DWORD = 0x00000003; +pub const RESOURCE_RECENT: DWORD = 0x00000004; +pub const RESOURCE_CONTEXT: DWORD = 0x00000005; +pub const RESOURCETYPE_ANY: DWORD = 0x00000000; +pub const RESOURCETYPE_DISK: DWORD = 0x00000001; +pub const RESOURCETYPE_PRINT: DWORD = 0x00000002; +pub const RESOURCETYPE_RESERVED: DWORD = 0x00000008; +pub const RESOURCETYPE_UNKNOWN: DWORD = 0xFFFFFFFF; +pub const RESOURCEUSAGE_CONNECTABLE: DWORD = 0x00000001; +pub const RESOURCEUSAGE_CONTAINER: DWORD = 0x00000002; +pub const RESOURCEUSAGE_NOLOCALDEVICE: DWORD = 0x00000004; +pub const RESOURCEUSAGE_SIBLING: DWORD = 0x00000008; +pub const RESOURCEUSAGE_ATTACHED: DWORD = 0x00000010; +pub const RESOURCEUSAGE_ALL: DWORD = RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER + | RESOURCEUSAGE_ATTACHED; +pub const RESOURCEUSAGE_RESERVED: DWORD = 0x80000000; +pub const RESOURCEDISPLAYTYPE_GENERIC: DWORD = 0x00000000; +pub const RESOURCEDISPLAYTYPE_DOMAIN: DWORD = 0x00000001; +pub const RESOURCEDISPLAYTYPE_SERVER: DWORD = 0x00000002; +pub const RESOURCEDISPLAYTYPE_SHARE: DWORD = 0x00000003; +pub const RESOURCEDISPLAYTYPE_FILE: DWORD = 0x00000004; +pub const RESOURCEDISPLAYTYPE_GROUP: DWORD = 0x00000005; +pub const RESOURCEDISPLAYTYPE_NETWORK: DWORD = 0x00000006; +pub const RESOURCEDISPLAYTYPE_ROOT: DWORD = 0x00000007; +pub const RESOURCEDISPLAYTYPE_SHAREADMIN: DWORD = 0x00000008; +pub const RESOURCEDISPLAYTYPE_DIRECTORY: DWORD = 0x00000009; +pub const RESOURCEDISPLAYTYPE_TREE: DWORD = 0x0000000A; +pub const RESOURCEDISPLAYTYPE_NDSCONTAINER: DWORD = 0x0000000B; +STRUCT!{struct NETRESOURCEA { + dwScope: DWORD, + dwType: DWORD, + dwDisplayType: DWORD, + dwUsage: DWORD, + lpLocalName: LPSTR, + lpRemoteName: LPSTR, + lpComment: LPSTR, + lpProvider: LPSTR, +}} +pub type LPNETRESOURCEA = *mut NETRESOURCEA; +STRUCT!{struct NETRESOURCEW { + dwScope: DWORD, + dwType: DWORD, + dwDisplayType: DWORD, + dwUsage: DWORD, + lpLocalName: LPWSTR, + lpRemoteName: LPWSTR, + lpComment: LPWSTR, + lpProvider: LPWSTR, +}} +pub type LPNETRESOURCEW = *mut NETRESOURCEW; +pub const NETPROPERTY_PERSISTENT: DWORD = 1; +pub const CONNECT_UPDATE_PROFILE: DWORD = 0x00000001; +pub const CONNECT_UPDATE_RECENT: DWORD = 0x00000002; +pub const CONNECT_TEMPORARY: DWORD = 0x00000004; +pub const CONNECT_INTERACTIVE: DWORD = 0x00000008; +pub const CONNECT_PROMPT: DWORD = 0x00000010; +pub const CONNECT_NEED_DRIVE: DWORD = 0x00000020; +pub const CONNECT_REFCOUNT: DWORD = 0x00000040; +pub const CONNECT_REDIRECT: DWORD = 0x00000080; +pub const CONNECT_LOCALDRIVE: DWORD = 0x00000100; +pub const CONNECT_CURRENT_MEDIA: DWORD = 0x00000200; +pub const CONNECT_DEFERRED: DWORD = 0x00000400; +pub const CONNECT_RESERVED: DWORD = 0xFF000000; +pub const CONNECT_COMMANDLINE: DWORD = 0x00000800; +pub const CONNECT_CMD_SAVECRED: DWORD = 0x00001000; +pub const CONNECT_CRED_RESET: DWORD = 0x00002000; +extern "system" { + pub fn WNetAddConnection2A( + lpNetResource: LPNETRESOURCEA, + lpPassword: LPCSTR, + lpUsername: LPCSTR, + dwFlags: DWORD, + ) -> DWORD; + pub fn WNetAddConnection2W( + lpNetResource: LPNETRESOURCEW, + lpPassword: LPCWSTR, + lpUsername: LPCWSTR, + dwFlags: DWORD, + ) -> DWORD; + pub fn WNetAddConnection3A( + hwndOwner: HWND, + lpNetResource: LPNETRESOURCEA, + lpPassword: LPCSTR, + lpUsername: LPCSTR, + dwFlags: DWORD, + ) -> DWORD; + pub fn WNetAddConnection3W( + hwndOwner: HWND, + lpNetResource: LPNETRESOURCEW, + lpPassword: LPCWSTR, + lpUsername: LPCWSTR, + dwFlags: DWORD, + ) -> DWORD; + pub fn WNetCancelConnectionA( + lpName: LPCSTR, + fForce: BOOL, + ) -> DWORD; + pub fn WNetCancelConnectionW( + lpName: LPCWSTR, + fForce: BOOL, + ) -> DWORD; + pub fn WNetCancelConnection2A( + lpName: LPCSTR, + dwFlags: DWORD, + fForce: BOOL, + ) -> DWORD; + pub fn WNetCancelConnection2W( + lpName: LPCWSTR, + dwFlags: DWORD, + fForce: BOOL, + ) -> DWORD; + pub fn WNetGetConnectionA( + lpLocalName: LPCSTR, + lpRemoteName: LPSTR, + lpnLength: LPDWORD, + ) -> DWORD; + pub fn WNetGetConnectionW( + lpLocalName: LPCWSTR, + lpRemoteName: LPWSTR, + lpnLength: LPDWORD, + ) -> DWORD; + pub fn WNetUseConnectionA( + hwndOwner: HWND, + lpNetResource: LPNETRESOURCEA, + lpPassword: LPCSTR, + lpUserId: LPCSTR, + dwFlags: DWORD, + lpAccessName: LPSTR, + lpBufferSize: LPDWORD, + lpResult: LPDWORD, + ) -> DWORD; + pub fn WNetUseConnectionW( + hwndOwner: HWND, + lpNetResource: LPNETRESOURCEW, + lpPassword: LPCWSTR, + lpUserId: LPCWSTR, + dwFlags: DWORD, + lpAccessName: LPWSTR, + lpBufferSize: LPDWORD, + lpResult: LPDWORD, + ) -> DWORD; + pub fn WNetConnectionDialog( + hwnd: HWND, + dwType: DWORD, + ) -> DWORD; + pub fn WNetDisconnectDialog( + hwnd: HWND, + dwType: DWORD, + ) -> DWORD; +} +STRUCT!{struct CONNECTDLGSTRUCTA { + cbStructure: DWORD, + hwndOwner: HWND, + lpConnRes: LPNETRESOURCEA, + dwFlags: DWORD, + dwDevNum: DWORD, +}} +pub type LPCONNECTDLGSTRUCTA = *mut CONNECTDLGSTRUCTA; +STRUCT!{struct CONNECTDLGSTRUCTW { + cbStructure: DWORD, + hwndOwner: HWND, + lpConnRes: LPNETRESOURCEW, + dwFlags: DWORD, + dwDevNum: DWORD, +}} +pub type LPCONNECTDLGSTRUCTW = *mut CONNECTDLGSTRUCTW; +pub const CONNDLG_RO_PATH: DWORD = 0x00000001; +pub const CONNDLG_CONN_POINT: DWORD = 0x00000002; +pub const CONNDLG_USE_MRU: DWORD = 0x00000004; +pub const CONNDLG_HIDE_BOX: DWORD = 0x00000008; +pub const CONNDLG_PERSIST: DWORD = 0x00000010; +pub const CONNDLG_NOT_PERSIST: DWORD = 0x00000020; +extern "system" { + pub fn WNetConnectionDialog1A( + lpConnDlgStruct: LPCONNECTDLGSTRUCTA, + ) -> DWORD; + pub fn WNetConnectionDialog1W( + lpConnDlgStruct: LPCONNECTDLGSTRUCTW, + ) -> DWORD; +} +STRUCT!{struct DISCDLGSTRUCTA { + cbStructure: DWORD, + hwndOwner: HWND, + lpLocalName: LPSTR, + lpRemoteName: LPSTR, + dwFlags: DWORD, +}} +pub type LPDISCDLGSTRUCTA = *mut DISCDLGSTRUCTA; +STRUCT!{struct DISCDLGSTRUCTW { + cbStructure: DWORD, + hwndOwner: HWND, + lpLocalName: LPWSTR, + lpRemoteName: LPWSTR, + dwFlags: DWORD, +}} +pub type LPDISCDLGSTRUCTW = *mut DISCDLGSTRUCTW; +pub const DISC_UPDATE_PROFILE: DWORD = 0x00000001; +pub const DISC_NO_FORCE: DWORD = 0x00000040; +extern "system" { + pub fn WNetDisconnectDialog1A( + lpConnDlgStruct: LPDISCDLGSTRUCTA, + ) -> DWORD; + pub fn WNetDisconnectDialog1W( + lpConnDlgStruct: LPDISCDLGSTRUCTW, + ) -> DWORD; + pub fn WNetOpenEnumA( + dwScope: DWORD, + dwType: DWORD, + dwUsage: DWORD, + lpNetResource: LPNETRESOURCEA, + lphEnum: LPHANDLE, + ) -> DWORD; + pub fn WNetOpenEnumW( + dwScope: DWORD, + dwType: DWORD, + dwUsage: DWORD, + lpNetResource: LPNETRESOURCEW, + lphEnum: LPHANDLE, + ) -> DWORD; + pub fn WNetEnumResourceA( + hEnum: HANDLE, + lpcCount: LPDWORD, + lpBuffer: LPVOID, + lpBufferSize: LPDWORD, + ) -> DWORD; + pub fn WNetEnumResourceW( + hEnum: HANDLE, + lpcCount: LPDWORD, + lpBuffer: LPVOID, + lpBufferSize: LPDWORD, + ) -> DWORD; + pub fn WNetCloseEnum( + hEnum: HANDLE, + ) -> DWORD; + pub fn WNetGetResourceParentA( + lpNetResource: LPNETRESOURCEA, + lpBuffer: LPVOID, + lpcbBuffer: LPDWORD, + ) -> DWORD; + pub fn WNetGetResourceParentW( + lpNetResource: LPNETRESOURCEW, + lpBuffer: LPVOID, + lpcbBuffer: LPDWORD, + ) -> DWORD; + pub fn WNetGetResourceInformationA( + lpNetResource: LPNETRESOURCEA, + lpBuffer: LPVOID, + lpcbBuffer: LPDWORD, + lplpSystem: *mut LPSTR, + ) -> DWORD; + pub fn WNetGetResourceInformationW( + lpNetResource: LPNETRESOURCEW, + lpBuffer: LPVOID, + lpcbBuffer: LPDWORD, + lplpSystem: *mut LPWSTR, + ) -> DWORD; +} +pub const UNIVERSAL_NAME_INFO_LEVEL: DWORD = 0x00000001; +pub const REMOTE_NAME_INFO_LEVEL: DWORD = 0x00000002; +STRUCT!{struct UNIVERSAL_NAME_INFOA { + lpUniversalName: LPSTR, +}} +pub type LPUNIVERSAL_NAME_INFOA = *mut UNIVERSAL_NAME_INFOA; +STRUCT!{struct UNIVERSAL_NAME_INFOW { + lpUniversalName: LPWSTR, +}} +pub type LPUNIVERSAL_NAME_INFOW = *mut UNIVERSAL_NAME_INFOW; +STRUCT!{struct REMOTE_NAME_INFOA { + lpUniversalName: LPSTR, + lpConnectionName: LPSTR, + lpRemainingPath: LPSTR, +}} +pub type LPREMOTE_NAME_INFOA = *mut REMOTE_NAME_INFOA; +STRUCT!{struct REMOTE_NAME_INFOW { + lpUniversalName: LPWSTR, + lpConnectionName: LPWSTR, + lpRemainingPath: LPWSTR, +}} +pub type LPREMOTE_NAME_INFOW = *mut REMOTE_NAME_INFOW; +extern "system" { + pub fn WNetGetUniversalNameA( + lpLocalPath: LPCSTR, + dwInfoLevel: DWORD, + lpBuffer: LPVOID, + lpBufferSize: LPDWORD, + ) -> DWORD; + pub fn WNetGetUniversalNameW( + lpLocalPath: LPCWSTR, + dwInfoLevel: DWORD, + lpBuffer: LPVOID, + lpBufferSize: LPDWORD, + ) -> DWORD; + pub fn WNetGetUserA( + lpName: LPCSTR, + lpUserName: LPSTR, + lpnLength: LPDWORD, + ) -> DWORD; + pub fn WNetGetUserW( + lpName: LPCWSTR, + lpUserName: LPWSTR, + lpnLength: LPDWORD, + ) -> DWORD; +} +pub const WNFMT_MULTILINE: DWORD = 0x01; +pub const WNFMT_ABBREVIATED: DWORD = 0x02; +pub const WNFMT_INENUM: DWORD = 0x10; +pub const WNFMT_CONNECTION: DWORD = 0x20; +extern "system" { + pub fn WNetGetProviderNameA( + dwNetType: DWORD, + lpProviderName: LPSTR, + lpBufferSize: LPDWORD, + ) -> DWORD; + pub fn WNetGetProviderNameW( + dwNetType: DWORD, + lpProviderName: LPWSTR, + lpBufferSize: LPDWORD, + ) -> DWORD; +} +STRUCT!{struct NETINFOSTRUCT { + cbStructure: DWORD, + dwProviderVersion: DWORD, + dwStatus: DWORD, + dwCharacteristics: DWORD, + dwHandle: ULONG_PTR, + wNetType: WORD, + dwPrinters: DWORD, + dwDrives: DWORD, +}} +pub type LPNETINFOSTRUCT = *mut NETINFOSTRUCT; +pub const NETINFO_DLL16: DWORD = 0x00000001; +pub const NETINFO_DISKRED: DWORD = 0x00000004; +pub const NETINFO_PRINTERRED: DWORD = 0x00000008; +extern "system" { + pub fn WNetGetNetworkInformationA( + lpProvider: LPCSTR, + lpNetInfoStruct: LPNETINFOSTRUCT, + ) -> DWORD; + pub fn WNetGetNetworkInformationW( + lpProvider: LPCWSTR, + lpNetInfoStruct: LPNETINFOSTRUCT, + ) -> DWORD; + pub fn WNetGetLastErrorA( + lpError: LPDWORD, + lpErrorBuf: LPSTR, + nErrorBufSize: DWORD, + lpNameBuf: LPSTR, + nNameBufSize: DWORD, + ) -> DWORD; + pub fn WNetGetLastErrorW( + lpError: LPDWORD, + lpErrorBuf: LPWSTR, + nErrorBufSize: DWORD, + lpNameBuf: LPWSTR, + nNameBufSize: DWORD, + ) -> DWORD; +} +pub const WN_SUCCESS: DWORD = NO_ERROR; +pub const WN_NO_ERROR: DWORD = NO_ERROR; +pub const WN_NOT_SUPPORTED: DWORD = ERROR_NOT_SUPPORTED; +pub const WN_CANCEL: DWORD = ERROR_CANCELLED; +pub const WN_RETRY: DWORD = ERROR_RETRY; +pub const WN_NET_ERROR: DWORD = ERROR_UNEXP_NET_ERR; +pub const WN_MORE_DATA: DWORD = ERROR_MORE_DATA; +pub const WN_BAD_POINTER: DWORD = ERROR_INVALID_ADDRESS; +pub const WN_BAD_VALUE: DWORD = ERROR_INVALID_PARAMETER; +pub const WN_BAD_USER: DWORD = ERROR_BAD_USERNAME; +pub const WN_BAD_PASSWORD: DWORD = ERROR_INVALID_PASSWORD; +pub const WN_ACCESS_DENIED: DWORD = ERROR_ACCESS_DENIED; +pub const WN_FUNCTION_BUSY: DWORD = ERROR_BUSY; +pub const WN_WINDOWS_ERROR: DWORD = ERROR_UNEXP_NET_ERR; +pub const WN_OUT_OF_MEMORY: DWORD = ERROR_NOT_ENOUGH_MEMORY; +pub const WN_NO_NETWORK: DWORD = ERROR_NO_NETWORK; +pub const WN_EXTENDED_ERROR: DWORD = ERROR_EXTENDED_ERROR; +pub const WN_BAD_LEVEL: DWORD = ERROR_INVALID_LEVEL; +pub const WN_BAD_HANDLE: DWORD = ERROR_INVALID_HANDLE; +pub const WN_NOT_INITIALIZING: DWORD = ERROR_ALREADY_INITIALIZED; +pub const WN_NO_MORE_DEVICES: DWORD = ERROR_NO_MORE_DEVICES; +pub const WN_NOT_CONNECTED: DWORD = ERROR_NOT_CONNECTED; +pub const WN_OPEN_FILES: DWORD = ERROR_OPEN_FILES; +pub const WN_DEVICE_IN_USE: DWORD = ERROR_DEVICE_IN_USE; +pub const WN_BAD_NETNAME: DWORD = ERROR_BAD_NET_NAME; +pub const WN_BAD_LOCALNAME: DWORD = ERROR_BAD_DEVICE; +pub const WN_ALREADY_CONNECTED: DWORD = ERROR_ALREADY_ASSIGNED; +pub const WN_DEVICE_ERROR: DWORD = ERROR_GEN_FAILURE; +pub const WN_CONNECTION_CLOSED: DWORD = ERROR_CONNECTION_UNAVAIL; +pub const WN_NO_NET_OR_BAD_PATH: DWORD = ERROR_NO_NET_OR_BAD_PATH; +pub const WN_BAD_PROVIDER: DWORD = ERROR_BAD_PROVIDER; +pub const WN_CANNOT_OPEN_PROFILE: DWORD = ERROR_CANNOT_OPEN_PROFILE; +pub const WN_BAD_PROFILE: DWORD = ERROR_BAD_PROFILE; +pub const WN_BAD_DEV_TYPE: DWORD = ERROR_BAD_DEV_TYPE; +pub const WN_DEVICE_ALREADY_REMEMBERED: DWORD = ERROR_DEVICE_ALREADY_REMEMBERED; +pub const WN_CONNECTED_OTHER_PASSWORD: DWORD = ERROR_CONNECTED_OTHER_PASSWORD; +pub const WN_CONNECTED_OTHER_PASSWORD_DEFAULT: DWORD = ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT; +pub const WN_NO_MORE_ENTRIES: DWORD = ERROR_NO_MORE_ITEMS; +pub const WN_NOT_CONTAINER: DWORD = ERROR_NOT_CONTAINER; +pub const WN_NOT_AUTHENTICATED: DWORD = ERROR_NOT_AUTHENTICATED; +pub const WN_NOT_LOGGED_ON: DWORD = ERROR_NOT_LOGGED_ON; +pub const WN_NOT_VALIDATED: DWORD = ERROR_NO_LOGON_SERVERS; +STRUCT!{struct NETCONNECTINFOSTRUCT { + cbStructure: DWORD, + dwFlags: DWORD, + dwSpeed: DWORD, + dwDelay: DWORD, + dwOptDataSize: DWORD, +}} +pub type LPNETCONNECTINFOSTRUCT = *mut NETCONNECTINFOSTRUCT; +pub const WNCON_FORNETCARD: DWORD = 0x00000001; +pub const WNCON_NOTROUTED: DWORD = 0x00000002; +pub const WNCON_SLOWLINK: DWORD = 0x00000004; +pub const WNCON_DYNAMIC: DWORD = 0x00000008; +extern "system" { + pub fn MultinetGetConnectionPerformanceA( + lpNetResource: LPNETRESOURCEA, + lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT, + ) -> DWORD; + pub fn MultinetGetConnectionPerformanceW( + lpNetResource: LPNETRESOURCEW, + lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/winnls.rs b/bash-5.1/vendor/winapi/src/um/winnls.rs new file mode 100644 index 0000000000000000000000000000000000000000..fd68a2354e3dfe382b97208fbf6f150e15badd79 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winnls.rs @@ -0,0 +1,817 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Procedure declarations, constant definitions, and macros for the NLS component. +use ctypes::c_int; +use shared::basetsd::LONG_PTR; +use shared::guiddef::GUID; +use shared::minwindef::{ + BOOL, BYTE, DWORD, INT, LPARAM, LPDWORD, LPINT, LPVOID, LPWORD, MAX_PATH, PDWORD, PULONG, + UINT, +}; +use um::minwinbase::SYSTEMTIME; +use um::winnt::{ + CHAR, LANGID, LCID, LONG, LPCSTR, LPCWCH, LPCWSTR, LPSTR, LPWSTR, PCNZCH, PCNZWCH, PCWSTR, + PCZZWSTR, PULONGLONG, PWSTR, PZZWSTR, ULONGLONG, WCHAR, +}; +pub const MAX_LEADBYTES: usize = 12; +pub const MAX_DEFAULTCHAR: usize = 2; +pub const MB_PRECOMPOSED: DWORD = 0x00000001; +pub const MB_COMPOSITE: DWORD = 0x00000002; +pub const MB_USEGLYPHCHARS: DWORD = 0x00000004; +pub const MB_ERR_INVALID_CHARS: DWORD = 0x00000008; +pub const WC_COMPOSITECHECK: DWORD = 0x00000200; +pub const WC_DISCARDNS: DWORD = 0x00000010; +pub const WC_SEPCHARS: DWORD = 0x00000020; +pub const WC_DEFAULTCHAR: DWORD = 0x00000040; +pub const WC_ERR_INVALID_CHARS: DWORD = 0x00000080; +pub const WC_NO_BEST_FIT_CHARS: DWORD = 0x00000400; +pub const CP_ACP: DWORD = 0; +pub const CP_OEMCP: DWORD = 1; +pub const CP_MACCP: DWORD = 2; +pub const CP_THREAD_ACP: DWORD = 3; +pub const CP_SYMBOL: DWORD = 42; +pub const CP_UTF7: DWORD = 65000; +pub const CP_UTF8: DWORD = 65001; +pub type LGRPID = DWORD; +pub type LCTYPE = DWORD; +pub type CALTYPE = DWORD; +pub type CALID = DWORD; +STRUCT!{struct CPINFO { + MaxCharSize: UINT, + DefaultChar: [BYTE; MAX_DEFAULTCHAR], + LeadByte: [BYTE; MAX_LEADBYTES], +}} +pub type LPCPINFO = *mut CPINFO; +STRUCT!{struct CPINFOEXA { + MaxCharSize: UINT, + DefaultChar: [BYTE; MAX_DEFAULTCHAR], + LeadByte: [BYTE; MAX_LEADBYTES], + UnicodeDefaultChar: WCHAR, + CodePage: UINT, + CodePageName: [CHAR; MAX_PATH], +}} +pub type LPCPINFOEXA = *mut CPINFOEXA; +STRUCT!{struct CPINFOEXW { + MaxCharSize: UINT, + DefaultChar: [BYTE; MAX_DEFAULTCHAR], + LeadByte: [BYTE; MAX_LEADBYTES], + UnicodeDefaultChar: WCHAR, + CodePage: UINT, + CodePageName: [WCHAR; MAX_PATH], +}} +pub type LPCPINFOEXW = *mut CPINFOEXW; +STRUCT!{struct NUMBERFMTA { + NumDigits: UINT, + LeadingZero: UINT, + Grouping: UINT, + lpDecimalSep: LPSTR, + lpThousandSep: LPSTR, + NegativeOrder: UINT, +}} +pub type LPNUMBERFMTA = *mut NUMBERFMTA; +STRUCT!{struct NUMBERFMTW { + NumDigits: UINT, + LeadingZero: UINT, + Grouping: UINT, + lpDecimalSep: LPWSTR, + lpThousandSep: LPWSTR, + NegativeOrder: UINT, +}} +pub type LPNUMBERFMTW = *mut NUMBERFMTW; +STRUCT!{struct CURRENCYFMTA { + NumDigits: UINT, + LeadingZero: UINT, + Grouping: UINT, + lpDecimalSep: LPSTR, + lpThousandSep: LPSTR, + NegativeOrder: UINT, + PositiveOrder: UINT, + lpCurrencySymbol: LPSTR, +}} +pub type LPCURRENCYFMTA = *mut CURRENCYFMTA; +STRUCT!{struct CURRENCYFMTW { + NumDigits: UINT, + LeadingZero: UINT, + Grouping: UINT, + lpDecimalSep: LPWSTR, + lpThousandSep: LPWSTR, + NegativeOrder: UINT, + PositiveOrder: UINT, + lpCurrencySymbol: LPWSTR, +}} +pub type LPCURRENCYFMTW = *mut CURRENCYFMTW; +pub type NLS_FUNCTION = DWORD; +STRUCT!{struct NLSVERSIONINFO { + dwNLSVersionInfoSize: DWORD, + dwNLSVersion: DWORD, + dwDefinedVersion: DWORD, + dwEffectiveId: DWORD, + guidCustomVersion: GUID, +}} +pub type LPNLSVERSIONINFO = *mut NLSVERSIONINFO; +STRUCT!{struct NLSVERSIONINFOEX { + dwNLSVersionInfoSize: DWORD, + dwNLSVersion: DWORD, + dwDefinedVersion: DWORD, + dwEffectiveId: DWORD, + guidCustomVersion: GUID, +}} +pub type LPNLSVERSIONINFOEX = *mut NLSVERSIONINFOEX; +pub type GEOID = LONG; +pub type GEOTYPE = DWORD; +pub type GEOCLASS = DWORD; +ENUM!{enum NORM_FORM { + NormalizationOther = 0, + NormalizationC = 0x1, + NormalizationD = 0x2, + NormalizationKC = 0x5, + NormalizationKD = 0x6, +}} +FN!{stdcall LANGUAGEGROUP_ENUMPROCA( + LGRPID, + LPSTR, + LPSTR, + DWORD, + LONG_PTR, +) -> BOOL} +FN!{stdcall LANGGROUPLOCALE_ENUMPROCA( + LGRPID, + LCID, + LPSTR, + LONG_PTR, +) -> BOOL} +FN!{stdcall UILANGUAGE_ENUMPROCA( + LPSTR, + LONG_PTR, +) -> BOOL} +FN!{stdcall CODEPAGE_ENUMPROCA( + LPSTR, +) -> BOOL} +FN!{stdcall DATEFMT_ENUMPROCA( + LPSTR, +) -> BOOL} +FN!{stdcall DATEFMT_ENUMPROCEXA( + LPSTR, + CALID, +) -> BOOL} +FN!{stdcall TIMEFMT_ENUMPROCA( + LPSTR, +) -> BOOL} +FN!{stdcall CALINFO_ENUMPROCA( + LPSTR, +) -> BOOL} +FN!{stdcall CALINFO_ENUMPROCEXA( + LPSTR, + CALID, +) -> BOOL} +FN!{stdcall LOCALE_ENUMPROCA( + LPSTR, +) -> BOOL} +FN!{stdcall LOCALE_ENUMPROCW( + LPWSTR, +) -> BOOL} +FN!{stdcall LANGUAGEGROUP_ENUMPROCW( + LGRPID, + LPWSTR, + LPWSTR, + DWORD, + LONG_PTR, +) -> BOOL} +FN!{stdcall LANGGROUPLOCALE_ENUMPROCW( + LGRPID, + LCID, + LPWSTR, + LONG_PTR, +) -> BOOL} +FN!{stdcall UILANGUAGE_ENUMPROCW( + LPWSTR, + LONG_PTR, +) -> BOOL} +FN!{stdcall CODEPAGE_ENUMPROCW( + LPWSTR, +) -> BOOL} +FN!{stdcall DATEFMT_ENUMPROCW( + LPWSTR, +) -> BOOL} +FN!{stdcall DATEFMT_ENUMPROCEXW( + LPWSTR, + CALID, +) -> BOOL} +FN!{stdcall TIMEFMT_ENUMPROCW( + LPWSTR, +) -> BOOL} +FN!{stdcall CALINFO_ENUMPROCW( + LPWSTR, +) -> BOOL} +FN!{stdcall CALINFO_ENUMPROCEXW( + LPWSTR, + CALID, +) -> BOOL} +FN!{stdcall GEO_ENUMPROC( + GEOID, +) -> BOOL} +STRUCT!{struct FILEMUIINFO { + dwSize: DWORD, + dwVersion: DWORD, + dwFileType: DWORD, + pChecksum: [BYTE; 16], + pServiceChecksum: [BYTE; 16], + dwLanguageNameOffset: DWORD, + dwTypeIDMainSize: DWORD, + dwTypeIDMainOffset: DWORD, + dwTypeNameMainOffset: DWORD, + dwTypeIDMUISize: DWORD, + dwTypeIDMUIOffset: DWORD, + dwTypeNameMUIOffset: DWORD, + abBuffer: [BYTE; 8], +}} +pub type PFILEMUIINFO = *mut FILEMUIINFO; +FN!{stdcall CALINFO_ENUMPROCEXEX( + LPWSTR, + CALID, + LPWSTR, + LPARAM, +) -> BOOL} +FN!{stdcall DATEFMT_ENUMPROCEXEX( + LPWSTR, + CALID, + LPARAM, +) -> BOOL} +FN!{stdcall TIMEFMT_ENUMPROCEX( + LPWSTR, + LPARAM, +) -> BOOL} +FN!{stdcall LOCALE_ENUMPROCEX( + LPWSTR, + DWORD, + LPARAM, +) -> BOOL} +extern "system" { + pub fn CompareStringA( + Locale: LCID, + dwCmpFlags: DWORD, + lpString1: PCNZCH, + cchCount1: c_int, + lpString2: PCNZCH, + cchCount2: c_int, + ) -> c_int; + pub fn CompareStringEx( + lpLocaleName: LPCWSTR, + dwCmpFlags: DWORD, + lpString1: LPCWCH, + cchCount1: c_int, + lpString2: LPCWCH, + cchCount2: c_int, + lpVersionInformation: LPNLSVERSIONINFO, + lpReserved: LPVOID, + lParam: LPARAM, + ) -> c_int; + pub fn CompareStringW( + Locale: LCID, + dwCmpFlags: DWORD, + lpString1: PCNZWCH, + cchCount1: c_int, + lpString2: PCNZWCH, + cchCount2: c_int, + ) -> c_int; + pub fn ConvertDefaultLocale(Locale: LCID) -> LCID; + pub fn EnumCalendarInfoA( + lpCalInfoEnumProc: CALINFO_ENUMPROCA, + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + ) -> BOOL; + pub fn EnumCalendarInfoExA( + lpCalInfoEnumProcEx: CALINFO_ENUMPROCEXA, + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + ) -> BOOL; + pub fn EnumCalendarInfoExEx( + pCalInfoEnumProcExEx: CALINFO_ENUMPROCEXEX, + lpLocaleName: LPCWSTR, + Calendar: CALID, + lpReserved: LPCWSTR, + CalType: CALTYPE, + lParam: LPARAM, + ) -> BOOL; + pub fn EnumCalendarInfoExW( + lpCalInfoEnumProcEx: CALINFO_ENUMPROCEXW, + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + ) -> BOOL; + pub fn EnumCalendarInfoW( + lpCalInfoEnumProc: CALINFO_ENUMPROCW, + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + ) -> BOOL; + pub fn EnumDateFormatsA( + lpDateFmtEnumProc: DATEFMT_ENUMPROCA, + Locale: LCID, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumDateFormatsExA( + lpDateFmtEnumProcEx: DATEFMT_ENUMPROCEXA, + Locale: LCID, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumDateFormatsExEx( + lpDateFmtEnumProcExEx: DATEFMT_ENUMPROCEXEX, + lpLocaleName: LPCWSTR, + dwFlags: DWORD, + lParam: LPARAM, + ) -> BOOL; + pub fn EnumDateFormatsExW( + lpDateFmtEnumProcEx: DATEFMT_ENUMPROCEXW, + Locale: LCID, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumDateFormatsW( + lpDateFmtEnumProc: DATEFMT_ENUMPROCW, + Locale: LCID, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumLanguageGroupLocalesA( + lpLangGroupLocaleEnumProc: LANGGROUPLOCALE_ENUMPROCA, + LanguageGroup: LGRPID, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> BOOL; + pub fn EnumLanguageGroupLocalesW( + lpLangGroupLocaleEnumProc: LANGGROUPLOCALE_ENUMPROCW, + LanguageGroup: LGRPID, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> BOOL; + pub fn EnumSystemCodePagesA( + lpCodePageEnumProc: CODEPAGE_ENUMPROCA, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumSystemCodePagesW( + lpCodePageEnumProc: CODEPAGE_ENUMPROCW, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumSystemGeoID( + GeoClass: GEOCLASS, + ParentGeoId: GEOID, + lpGeoEnumProc: GEO_ENUMPROC, + ) -> BOOL; + pub fn EnumSystemLanguageGroupsA( + lpLanguageGroupEnumProc: LANGUAGEGROUP_ENUMPROCA, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> BOOL; + pub fn EnumSystemLanguageGroupsW( + lpLanguageGroupEnumProc: LANGUAGEGROUP_ENUMPROCW, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> BOOL; + pub fn EnumSystemLocalesA( + lpLocaleEnumProc: LOCALE_ENUMPROCA, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumSystemLocalesEx( + lpLocaleEnumProcEx: LOCALE_ENUMPROCEX, + dwFlags: DWORD, + lParam: LPARAM, + lpReserved: LPVOID, + ) -> BOOL; + pub fn EnumSystemLocalesW( + lpLocaleEnumProc: LOCALE_ENUMPROCW, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumTimeFormatsA( + lpTimeFmtEnumProc: TIMEFMT_ENUMPROCA, + Locale: LCID, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumTimeFormatsEx( + lpTimeFmtEnumProcEx: TIMEFMT_ENUMPROCEX, + lpLocaleName: LPCWSTR, + dwFlags: DWORD, + lParam: LPARAM, + ) -> BOOL; + pub fn EnumTimeFormatsW( + lpTimeFmtEnumProc: TIMEFMT_ENUMPROCW, + Locale: LCID, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumUILanguagesA( + lpUILanguageEnumProc: UILANGUAGE_ENUMPROCA, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> BOOL; + pub fn EnumUILanguagesW( + lpUILanguageEnumProc: UILANGUAGE_ENUMPROCW, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> BOOL; + pub fn FindNLSString( + Locale: LCID, + dwFindNLSStringFlags: DWORD, + lpStringSource: LPCWSTR, + cchSource: c_int, + lpStringValue: LPCWSTR, + cchValue: c_int, + pcchFound: LPINT, + ) -> c_int; + pub fn FindNLSStringEx( + lpLocaleName: LPCWSTR, + dwFindNLSStringFlags: DWORD, + lpStringSource: LPCWSTR, + cchSource: c_int, + lpStringValue: LPCWSTR, + cchValue: c_int, + pcchFound: LPINT, + lpVersionInformation: LPNLSVERSIONINFO, + lpReserved: LPVOID, + sortHandle: LPARAM, + ) -> c_int; + pub fn FoldStringA( + dwMapFlags: DWORD, + lpSrcStr: LPCSTR, + cchSrc: c_int, + lpDestStr: LPSTR, + cchDest: c_int, + ) -> c_int; + pub fn GetACP() -> UINT; + pub fn GetCPInfo( + CodePage: UINT, + lpCPInfo: LPCPINFO, + ) -> BOOL; + pub fn GetCPInfoExA( + CodePage: UINT, + dwFlags: DWORD, + lpCPInfoEx: LPCPINFOEXA, + ) -> BOOL; + pub fn GetCPInfoExW( + CodePage: UINT, + dwFlags: DWORD, + lpCPInfoEx: LPCPINFOEXW, + ) -> BOOL; + pub fn GetCalendarInfoA( + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + lpCalData: LPSTR, + cchData: c_int, + lpValue: LPDWORD, + ) -> c_int; + pub fn GetCalendarInfoEx( + lpLocaleName: LPCWSTR, + Calendar: CALID, + lpReserved: LPCWSTR, + CalType: CALTYPE, + lpCalData: LPWSTR, + cchData: c_int, + lpValue: LPDWORD, + ) -> c_int; + pub fn GetCalendarInfoW( + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + lpCalData: LPWSTR, + cchData: c_int, + lpValue: LPDWORD, + ) -> c_int; + pub fn GetCurrencyFormatA( + Locale: LCID, + dwFlags: DWORD, + lpValue: LPCSTR, + lpFormat: *const CURRENCYFMTA, + lpCurrencyStr: LPSTR, + cchCurrency: c_int, + ) -> c_int; + pub fn GetCurrencyFormatEx( + lpLocaleName: LPCWSTR, + dwFlags: DWORD, + lpValue: LPCWSTR, + lpFormat: *const CURRENCYFMTW, + lpCurrencyStr: LPWSTR, + cchCurrency: c_int, + ) -> c_int; + pub fn GetCurrencyFormatW( + Locale: LCID, + dwFlags: DWORD, + lpValue: LPCWSTR, + lpFormat: *const CURRENCYFMTW, + lpCurrencyStr: LPWSTR, + cchCurrency: c_int, + ) -> c_int; + pub fn GetDurationFormat( + Locale: LCID, + dwFlags: DWORD, + lpDuration: *const SYSTEMTIME, + ullDuration: ULONGLONG, + lpFormat: LPCWSTR, + lpDurationStr: LPWSTR, + cchDuration: c_int, + ) -> c_int; + pub fn GetDurationFormatEx( + lpLocaleName: LPCWSTR, + dwFlags: DWORD, + lpDuration: *const SYSTEMTIME, + ullDuration: ULONGLONG, + lpFormat: LPCWSTR, + lpDurationStr: LPWSTR, + cchDuration: c_int, + ) -> c_int; + pub fn GetFileMUIInfo( + dwFlags: DWORD, + pcwszFilePath: PCWSTR, + pFileMUIInfo: PFILEMUIINFO, + pcbFileMUIInfo: *mut DWORD, + ) -> BOOL; + pub fn GetFileMUIPath( + dwFlags: DWORD, + pcwszFilePath: PCWSTR, + pwszLanguage: PWSTR, + pcchLanguage: PULONG, + pwszFileMUIPath: PWSTR, + pcchFileMUIPath: PULONG, + pululEnumerator: PULONGLONG, + ) -> BOOL; + pub fn GetGeoInfoA( + Location: GEOID, + GeoType: GEOTYPE, + lpGeoData: LPSTR, + cchData: c_int, + LangId: LANGID, + ) -> c_int; + pub fn GetGeoInfoW( + Location: GEOID, + GeoType: GEOTYPE, + lpGeoData: LPWSTR, + cchData: c_int, + LangId: LANGID, + ) -> c_int; + pub fn GetLocaleInfoA( + Locale: LCID, + LCType: LCTYPE, + lpLCData: LPSTR, + cchData: c_int, + ) -> c_int; + pub fn GetLocaleInfoEx( + lpLocaleName: LPCWSTR, + LCType: LCTYPE, + lpLCData: LPWSTR, + cchData: c_int, + ) -> c_int; + pub fn GetLocaleInfoW( + Locale: LCID, + LCType: LCTYPE, + lpLCData: LPWSTR, + cchData: c_int, + ) -> c_int; + pub fn GetNLSVersion( + Function: NLS_FUNCTION, + Locale: LCID, + lpVersionInformation: LPNLSVERSIONINFO, + ) -> BOOL; + pub fn GetNLSVersionEx( + function: NLS_FUNCTION, + lpLocaleName: LPCWSTR, + lpVersionInformation: LPNLSVERSIONINFOEX, + ) -> BOOL; + pub fn GetNumberFormatA( + Locale: LCID, + dwFlags: DWORD, + lpValue: LPCSTR, + lpFormat: *const NUMBERFMTA, + lpNumberStr: LPSTR, + cchNumber: c_int, + ) -> c_int; + pub fn GetNumberFormatEx( + lpLocaleName: LPCWSTR, + dwFlags: DWORD, + lpValue: LPCWSTR, + lpFormat: *const NUMBERFMTW, + lpNumberStr: LPWSTR, + cchNumber: c_int, + ) -> c_int; + pub fn GetNumberFormatW( + Locale: LCID, + dwFlags: DWORD, + lpValue: LPCWSTR, + lpFormat: *const NUMBERFMTW, + lpNumberStr: LPWSTR, + cchNumber: c_int, + ) -> c_int; + pub fn GetOEMCP() -> UINT; + pub fn GetProcessPreferredUILanguages( + dwFlags: DWORD, + pulNumLanguages: PULONG, + pwszLanguagesBuffer: PZZWSTR, + pcchLanguagesBuffer: PULONG, + ) -> BOOL; + pub fn GetStringScripts( + dwFlags: DWORD, + lpString: LPCWSTR, + cchString: c_int, + lpScripts: LPWSTR, + cchScripts: c_int, + ) -> c_int; + pub fn GetStringTypeA( + Locale: LCID, + dwInfoType: DWORD, + lpSrcStr: LPCSTR, + cchSrc: c_int, + lpCharType: LPWORD, + ) -> BOOL; + pub fn GetStringTypeExA( + Locale: LCID, + dwInfoType: DWORD, + lpSrcStr: LPCSTR, + cchSrc: c_int, + lpCharType: LPWORD, + ) -> BOOL; + pub fn GetStringTypeW( + dwInfoType: DWORD, + lpSrcStr: LPCWCH, + cchSrc: c_int, + lpCharType: LPWORD, + ) -> BOOL; + pub fn GetSystemDefaultLCID() -> LCID; + pub fn GetSystemDefaultLangID() -> LANGID; + pub fn GetSystemDefaultLocaleName( + lpLocaleName: LPWSTR, + cchLocaleName: c_int, + ) -> c_int; + pub fn GetSystemDefaultUILanguage() -> LANGID; + pub fn GetSystemPreferredUILanguages( + dwFlags: DWORD, + pulNumLanguages: PULONG, + pwszLanguagesBuffer: PZZWSTR, + pcchLanguagesBuffer: PULONG, + ) -> BOOL; + pub fn GetThreadLocale() -> LCID; + pub fn GetThreadPreferredUILanguages( + dwFlags: DWORD, + pulNumLanguages: PULONG, + pwszLanguagesBuffer: PZZWSTR, + pcchLanguagesBuffer: PULONG, + ) -> BOOL; + pub fn GetThreadUILanguage() -> LANGID; + pub fn GetUILanguageInfo( + dwFlags: DWORD, + pwmszLanguage: PCZZWSTR, + pwszFallbackLanguages: PZZWSTR, + pcchFallbackLanguages: PDWORD, + pAttributes: PDWORD, + ) -> BOOL; + pub fn GetUserDefaultLCID() -> LCID; + pub fn GetUserDefaultLangID() -> LANGID; + pub fn GetUserDefaultLocaleName( + lpLocaleName: LPWSTR, + cchLocaleName: c_int, + ) -> c_int; + pub fn GetUserDefaultUILanguage() -> LANGID; + pub fn GetUserGeoID(GeoClass: GEOCLASS) -> GEOID; + pub fn GetUserPreferredUILanguages( + dwFlags: DWORD, + pulNumLanguages: PULONG, + pwszLanguagesBuffer: PZZWSTR, + pcchLanguagesBuffer: PULONG, + ) -> BOOL; + pub fn IsDBCSLeadByte( + TestChar: BYTE, + ) -> BOOL; + pub fn IsDBCSLeadByteEx( + CodePage: UINT, + TestChar: BYTE, + ) -> BOOL; + pub fn IsNLSDefinedString( + Function: NLS_FUNCTION, + dwFlags: DWORD, + lpVersionInformation: LPNLSVERSIONINFO, + lpString: LPCWSTR, + cchStr: INT, + ) -> BOOL; + pub fn IsNormalizedString( + NormForm: NORM_FORM, + lpString: LPCWSTR, + cwLength: c_int, + ) -> BOOL; + pub fn IsValidCodePage( + CodePage: UINT, + ) -> BOOL; + pub fn IsValidLanguageGroup( + LanguageGroup: LGRPID, + dwFlags: DWORD, + ) -> BOOL; + pub fn IsValidLocale( + Locale: LCID, + dwFlags: DWORD, + ) -> BOOL; + pub fn IsValidLocaleName( + lpLocaleName: LPCWSTR, + ) -> BOOL; + pub fn IsValidNLSVersion( + function: NLS_FUNCTION, + lpLocaleName: LPCWSTR, + lpVersionInformation: LPNLSVERSIONINFOEX, + ) -> BOOL; + pub fn LCIDToLocaleName( + Locale: LCID, + lpName: LPWSTR, + cchName: c_int, + dwFlags: DWORD, + ) -> c_int; + pub fn LCMapStringA( + Locale: LCID, + dwMapFlags: DWORD, + lpSrcStr: LPCSTR, + cchSrc: c_int, + lpDestStr: LPSTR, + cchDest: c_int, + ) -> c_int; + pub fn LCMapStringEx( + lpLocaleName: LPCWSTR, + dwMapFlags: DWORD, + lpSrcStr: LPCWSTR, + cchSrc: c_int, + lpDestStr: LPWSTR, + cchDest: c_int, + lpVersionInformation: LPNLSVERSIONINFO, + lpReserved: LPVOID, + sortHandle: LPARAM, + ) -> c_int; + pub fn LCMapStringW( + Locale: LCID, + dwMapFlags: DWORD, + lpSrcStr: LPCWSTR, + cchSrc: c_int, + lpDestStr: LPWSTR, + cchDest: c_int, + ) -> c_int; + pub fn LocaleNameToLCID( + lpName: LPCWSTR, + dwFlags: DWORD, + ) -> LCID; + pub fn NormalizeString( + NormForm: NORM_FORM, + lpSrcString: LPCWSTR, + cwSrcLength: c_int, + lpDstString: LPWSTR, + cwDstLength: c_int, + ) -> c_int; + pub fn NotifyUILanguageChange( + dwFlags: DWORD, + pcwstrNewLanguage: PCWSTR, + pcwstrPreviousLanguage: PCWSTR, + dwReserved: DWORD, + pdwStatusRtrn: PDWORD, + ) -> BOOL; + pub fn ResolveLocaleName( + lpNameToResolve: LPCWSTR, + lpLocaleName: LPWSTR, + cchLocaleName: c_int, + ) -> c_int; + pub fn SetCalendarInfoA( + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + lpCalData: LPCSTR, + ) -> BOOL; + pub fn SetCalendarInfoW( + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + lpCalData: LPCWSTR, + ) -> BOOL; + pub fn SetLocaleInfoA( + Locale: LCID, + LCType: LCTYPE, + lpLCData: LPCSTR, + ) -> BOOL; + pub fn SetLocaleInfoW( + Locale: LCID, + LCType: LCTYPE, + lpLCData: LPCWSTR, + ) -> BOOL; + pub fn SetProcessPreferredUILanguages( + dwFlags: DWORD, + pwszLanguagesBuffer: PCZZWSTR, + pulNumLanguages: PULONG, + ) -> BOOL; + pub fn SetThreadLocale(Locale: LCID) -> BOOL; + pub fn SetThreadPreferredUILanguages( + dwFlags: DWORD, + pwszLanguagesBuffer: PCZZWSTR, + pulNumLanguages: PULONG, + ) -> BOOL; + pub fn SetThreadUILanguage(LangId: LANGID) -> LANGID; + pub fn SetUserGeoID(GeoId: GEOID) -> BOOL; + pub fn VerifyScripts( + dwFlags: DWORD, + lpLocaleScripts: LPCWSTR, + cchLocaleScripts: c_int, + lpTestScripts: LPCWSTR, + cchTestScripts: c_int, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/winnt.rs b/bash-5.1/vendor/winapi/src/um/winnt.rs new file mode 100644 index 0000000000000000000000000000000000000000..f687489bd565a00793f2df2c775417042ab8c3e4 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winnt.rs @@ -0,0 +1,8648 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This module defines the 32-Bit Windows types and constants that are defined by NT, but exposed +//! through the Win32 API. +use ctypes::{__int64, __uint64, c_char, c_int, c_long, c_short, c_uint, c_ulong, c_void, wchar_t}; +use shared::basetsd::{ + DWORD64, KAFFINITY, LONG64, LONG_PTR, PDWORD64, PLONG64, SIZE_T, ULONG64, ULONG_PTR, +}; +use shared::guiddef::{CLSID, GUID}; +use shared::ktmtypes::UOW; +use shared::minwindef::{BYTE, DWORD, FALSE, PDWORD, TRUE, ULONG, USHORT, WORD}; +#[cfg(target_arch = "aarch64")] +use shared::minwindef::PBYTE; +use vc::excpt::EXCEPTION_DISPOSITION; +use vc::vcruntime::size_t; +pub const ANYSIZE_ARRAY: usize = 1; +#[cfg(target_pointer_width = "32")] +IFDEF!{ +pub const MAX_NATURAL_ALIGNMENT: usize = 4; +pub const MEMORY_ALLOCATION_ALIGNMENT: usize = 8; +} +#[cfg(target_pointer_width = "64")] +IFDEF!{ +pub const MAX_NATURAL_ALIGNMENT: usize = 8; +pub const MEMORY_ALLOCATION_ALIGNMENT: usize = 16; +} +pub const SYSTEM_CACHE_ALIGNMENT_SIZE: usize = 64; +pub type PVOID = *mut c_void; +pub type PVOID64 = u64; // This is a 64-bit pointer, even when in 32-bit +pub type VOID = c_void; +pub type CHAR = c_char; +pub type SHORT = c_short; +pub type LONG = c_long; +pub type INT = c_int; +pub type WCHAR = wchar_t; +pub type PWCHAR = *mut WCHAR; +pub type LPWCH = *mut WCHAR; +pub type PWCH = *mut WCHAR; +pub type LPCWCH = *const WCHAR; +pub type PCWCH = *const WCHAR; +pub type NWPSTR = *mut WCHAR; +pub type LPWSTR = *mut WCHAR; +pub type PWSTR = *mut WCHAR; +pub type PZPWSTR = *mut PWSTR; +pub type PCZPWSTR = *const PWSTR; +pub type LPUWSTR = *mut WCHAR; // Unaligned pointer +pub type PUWSTR = *mut WCHAR; // Unaligned pointer +pub type LPCWSTR = *const WCHAR; +pub type PCWSTR = *const WCHAR; +pub type PZPCWSTR = *mut PCWSTR; +pub type PCZPCWSTR = *const PCWSTR; +pub type LPCUWSTR = *const WCHAR; // Unaligned pointer +pub type PCUWSTR = *const WCHAR; // Unaligned pointer +pub type PZZWSTR = *mut WCHAR; +pub type PCZZWSTR = *const WCHAR; +pub type PUZZWSTR = *mut WCHAR; // Unaligned pointer +pub type PCUZZWSTR = *const WCHAR; // Unaligned pointer +pub type PNZWCH = *mut WCHAR; +pub type PCNZWCH = *const WCHAR; +pub type PUNZWCH = *mut WCHAR; // Unaligned pointer +pub type PCUNZWCH = *const WCHAR; // Unaligned pointer +pub type LPCWCHAR = *const WCHAR; +pub type PCWCHAR = *const WCHAR; +pub type LPCUWCHAR = *const WCHAR; // Unaligned pointer +pub type PCUWCHAR = *const WCHAR; // Unaligned pointer +pub type UCSCHAR = c_ulong; +pub const UCSCHAR_INVALID_CHARACTER: UCSCHAR = 0xffffffff; +pub const MIN_UCSCHAR: UCSCHAR = 0; +pub const MAX_UCSCHAR: UCSCHAR = 0x0010FFFF; +pub type PUCSCHAR = *mut UCSCHAR; +pub type PCUCSCHAR = *const UCSCHAR; +pub type PUCSSTR = *mut UCSCHAR; +pub type PUUCSSTR = *mut UCSCHAR; // Unaligned pointer +pub type PCUCSSTR = *const UCSCHAR; +pub type PCUUCSSTR = *const UCSCHAR; // Unaligned pointer +pub type PUUCSCHAR = *mut UCSCHAR; // Unaligned pointer +pub type PCUUCSCHAR = *const UCSCHAR; // Unaligned pointer +pub type PCHAR = *mut CHAR; +pub type LPCH = *mut CHAR; +pub type PCH = *mut CHAR; +pub type LPCCH = *const CHAR; +pub type PCCH = *const CHAR; +pub type NPSTR = *mut CHAR; +pub type LPSTR = *mut CHAR; +pub type PSTR = *mut CHAR; +pub type PZPSTR = *mut PSTR; +pub type PCZPSTR = *const PSTR; +pub type LPCSTR = *const CHAR; +pub type PCSTR = *const CHAR; +pub type PZPCSTR = *mut PCSTR; +pub type PCZPCSTR = *const PCSTR; +pub type PZZSTR = *mut CHAR; +pub type PCZZSTR = *const CHAR; +pub type PNZCH = *mut CHAR; +pub type PCNZCH = *const CHAR; +// Skipping TCHAR things +pub type PSHORT = *mut SHORT; +pub type PLONG = *mut LONG; +pub const ALL_PROCESSOR_GROUPS: WORD = 0xffff; +STRUCT!{struct PROCESSOR_NUMBER { + Group: WORD, + Number: BYTE, + Reserved: BYTE, +}} +pub type PPROCESSOR_NUMBER = *mut PROCESSOR_NUMBER; +STRUCT!{struct GROUP_AFFINITY { + Mask: KAFFINITY, + Group: WORD, + Reserved: [WORD; 3], +}} +pub type PGROUP_AFFINITY = *mut GROUP_AFFINITY; +#[cfg(target_pointer_width = "32")] +pub const MAXIMUM_PROC_PER_GROUP: BYTE = 32; +#[cfg(target_pointer_width = "64")] +pub const MAXIMUM_PROC_PER_GROUP: BYTE = 64; +pub const MAXIMUM_PROCESSORS: BYTE = MAXIMUM_PROC_PER_GROUP; +pub type HANDLE = *mut c_void; +pub type PHANDLE = *mut HANDLE; +pub type FCHAR = BYTE; +pub type FSHORT = WORD; +pub type FLONG = DWORD; +pub type HRESULT = c_long; +pub type CCHAR = c_char; +pub type LCID = DWORD; +pub type PLCID = PDWORD; +pub type LANGID = WORD; +ENUM!{enum COMPARTMENT_ID { + UNSPECIFIED_COMPARTMENT_ID = 0, + DEFAULT_COMPARTMENT_ID, +}} +pub type PCOMPARTMENT_ID = *mut COMPARTMENT_ID; +pub const APPLICATION_ERROR_MASK: DWORD = 0x20000000; +pub const ERROR_SEVERITY_SUCCESS: DWORD = 0x00000000; +pub const ERROR_SEVERITY_INFORMATIONAL: DWORD = 0x40000000; +pub const ERROR_SEVERITY_WARNING: DWORD = 0x80000000; +pub const ERROR_SEVERITY_ERROR: DWORD = 0xC0000000; +STRUCT!{struct FLOAT128 { + LowPart: __int64, + HighPart: __int64, +}} +pub type PFLOAT128 = *mut FLOAT128; +pub type LONGLONG = __int64; +pub type ULONGLONG = __uint64; +pub const MAXLONGLONG: LONGLONG = 0x7fffffffffffffff; +pub type PLONGLONG = *mut LONGLONG; +pub type PULONGLONG = *mut ULONGLONG; +pub type USN = LONGLONG; +pub use shared::ntdef::LARGE_INTEGER; +pub type PLARGE_INTEGER = *mut LARGE_INTEGER; +pub use shared::ntdef::ULARGE_INTEGER; +pub type PULARGE_INTEGER = *mut ULARGE_INTEGER; +pub type RTL_REFERENCE_COUNT = LONG_PTR; +pub type PRTL_REFERENCE_COUNT = *mut LONG_PTR; +pub type RTL_REFERENCE_COUNT32 = LONG; +pub type PRTL_REFERENCE_COUNT32 = *mut LONG; +pub use shared::ntdef::LUID; +pub type PLUID = *mut LUID; +pub type DWORDLONG = ULONGLONG; +pub type PDWORDLONG = *mut DWORDLONG; +pub const ANSI_NULL: CHAR = 0; +pub const UNICODE_NULL: WCHAR = 0; +pub const UNICODE_STRING_MAX_BYTES: WORD = 65534; +pub const UNICODE_STRING_MAX_CHARS: WORD = 32767; +pub type BOOLEAN = BYTE; +pub type PBOOLEAN = *mut BOOLEAN; +STRUCT!{struct LIST_ENTRY { + Flink: *mut LIST_ENTRY, + Blink: *mut LIST_ENTRY, +}} +pub type PLIST_ENTRY = *mut LIST_ENTRY; +pub type PRLIST_ENTRY = *mut LIST_ENTRY; // Restricted pointer +STRUCT!{struct SINGLE_LIST_ENTRY { + Next: *mut SINGLE_LIST_ENTRY, +}} +pub type PSINGLE_LIST_ENTRY = *mut SINGLE_LIST_ENTRY; +STRUCT!{struct LIST_ENTRY32 { + Flink: DWORD, + Blink: DWORD, +}} +pub type PLIST_ENTRY32 = *mut LIST_ENTRY32; +STRUCT!{struct LIST_ENTRY64 { + Flink: ULONGLONG, + Blink: ULONGLONG, +}} +pub type PLIST_ENTRY64 = *mut LIST_ENTRY64; +STRUCT!{struct OBJECTID { + Lineage: GUID, + Uniquifier: DWORD, +}} +pub const MINCHAR: CHAR = 0x80; +pub const MAXCHAR: CHAR = 0x7f; +pub const MINSHORT: SHORT = 0x8000; +pub const MAXSHORT: SHORT = 0x7fff; +pub const MINLONG: LONG = 0x80000000; +pub const MAXLONG: LONG = 0x7fffffff; +pub const MAXBYTE: BYTE = 0xff; +pub const MAXWORD: WORD = 0xffff; +pub const MAXDWORD: DWORD = 0xffffffff; +FN!{stdcall PEXCEPTION_ROUTINE( + ExceptionRecord: *mut EXCEPTION_RECORD, + EstablisherFrame: PVOID, + ContextRecord: *mut CONTEXT, + DispatcherContext: PVOID, +) -> EXCEPTION_DISPOSITION} +pub const VER_SERVER_NT: DWORD = 0x80000000; +pub const VER_WORKSTATION_NT: DWORD = 0x40000000; +pub const VER_SUITE_SMALLBUSINESS: DWORD = 0x00000001; +pub const VER_SUITE_ENTERPRISE: DWORD = 0x00000002; +pub const VER_SUITE_BACKOFFICE: DWORD = 0x00000004; +pub const VER_SUITE_COMMUNICATIONS: DWORD = 0x00000008; +pub const VER_SUITE_TERMINAL: DWORD = 0x00000010; +pub const VER_SUITE_SMALLBUSINESS_RESTRICTED: DWORD = 0x00000020; +pub const VER_SUITE_EMBEDDEDNT: DWORD = 0x00000040; +pub const VER_SUITE_DATACENTER: DWORD = 0x00000080; +pub const VER_SUITE_SINGLEUSERTS: DWORD = 0x00000100; +pub const VER_SUITE_PERSONAL: DWORD = 0x00000200; +pub const VER_SUITE_BLADE: DWORD = 0x00000400; +pub const VER_SUITE_EMBEDDED_RESTRICTED: DWORD = 0x00000800; +pub const VER_SUITE_SECURITY_APPLIANCE: DWORD = 0x00001000; +pub const VER_SUITE_STORAGE_SERVER: DWORD = 0x00002000; +pub const VER_SUITE_COMPUTE_SERVER: DWORD = 0x00004000; +pub const VER_SUITE_WH_SERVER: DWORD = 0x00008000; +pub const PRODUCT_UNDEFINED: DWORD = 0x00000000; +pub const PRODUCT_ULTIMATE: DWORD = 0x00000001; +pub const PRODUCT_HOME_BASIC: DWORD = 0x00000002; +pub const PRODUCT_HOME_PREMIUM: DWORD = 0x00000003; +pub const PRODUCT_ENTERPRISE: DWORD = 0x00000004; +pub const PRODUCT_HOME_BASIC_N: DWORD = 0x00000005; +pub const PRODUCT_BUSINESS: DWORD = 0x00000006; +pub const PRODUCT_STANDARD_SERVER: DWORD = 0x00000007; +pub const PRODUCT_DATACENTER_SERVER: DWORD = 0x00000008; +pub const PRODUCT_SMALLBUSINESS_SERVER: DWORD = 0x00000009; +pub const PRODUCT_ENTERPRISE_SERVER: DWORD = 0x0000000A; +pub const PRODUCT_STARTER: DWORD = 0x0000000B; +pub const PRODUCT_DATACENTER_SERVER_CORE: DWORD = 0x0000000C; +pub const PRODUCT_STANDARD_SERVER_CORE: DWORD = 0x0000000D; +pub const PRODUCT_ENTERPRISE_SERVER_CORE: DWORD = 0x0000000E; +pub const PRODUCT_ENTERPRISE_SERVER_IA64: DWORD = 0x0000000F; +pub const PRODUCT_BUSINESS_N: DWORD = 0x00000010; +pub const PRODUCT_WEB_SERVER: DWORD = 0x00000011; +pub const PRODUCT_CLUSTER_SERVER: DWORD = 0x00000012; +pub const PRODUCT_HOME_SERVER: DWORD = 0x00000013; +pub const PRODUCT_STORAGE_EXPRESS_SERVER: DWORD = 0x00000014; +pub const PRODUCT_STORAGE_STANDARD_SERVER: DWORD = 0x00000015; +pub const PRODUCT_STORAGE_WORKGROUP_SERVER: DWORD = 0x00000016; +pub const PRODUCT_STORAGE_ENTERPRISE_SERVER: DWORD = 0x00000017; +pub const PRODUCT_SERVER_FOR_SMALLBUSINESS: DWORD = 0x00000018; +pub const PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: DWORD = 0x00000019; +pub const PRODUCT_HOME_PREMIUM_N: DWORD = 0x0000001A; +pub const PRODUCT_ENTERPRISE_N: DWORD = 0x0000001B; +pub const PRODUCT_ULTIMATE_N: DWORD = 0x0000001C; +pub const PRODUCT_WEB_SERVER_CORE: DWORD = 0x0000001D; +pub const PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT: DWORD = 0x0000001E; +pub const PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY: DWORD = 0x0000001F; +pub const PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING: DWORD = 0x00000020; +pub const PRODUCT_SERVER_FOUNDATION: DWORD = 0x00000021; +pub const PRODUCT_HOME_PREMIUM_SERVER: DWORD = 0x00000022; +pub const PRODUCT_SERVER_FOR_SMALLBUSINESS_V: DWORD = 0x00000023; +pub const PRODUCT_STANDARD_SERVER_V: DWORD = 0x00000024; +pub const PRODUCT_DATACENTER_SERVER_V: DWORD = 0x00000025; +pub const PRODUCT_ENTERPRISE_SERVER_V: DWORD = 0x00000026; +pub const PRODUCT_DATACENTER_SERVER_CORE_V: DWORD = 0x00000027; +pub const PRODUCT_STANDARD_SERVER_CORE_V: DWORD = 0x00000028; +pub const PRODUCT_ENTERPRISE_SERVER_CORE_V: DWORD = 0x00000029; +pub const PRODUCT_HYPERV: DWORD = 0x0000002A; +pub const PRODUCT_STORAGE_EXPRESS_SERVER_CORE: DWORD = 0x0000002B; +pub const PRODUCT_STORAGE_STANDARD_SERVER_CORE: DWORD = 0x0000002C; +pub const PRODUCT_STORAGE_WORKGROUP_SERVER_CORE: DWORD = 0x0000002D; +pub const PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE: DWORD = 0x0000002E; +pub const PRODUCT_STARTER_N: DWORD = 0x0000002F; +pub const PRODUCT_PROFESSIONAL: DWORD = 0x00000030; +pub const PRODUCT_PROFESSIONAL_N: DWORD = 0x00000031; +pub const PRODUCT_SB_SOLUTION_SERVER: DWORD = 0x00000032; +pub const PRODUCT_SERVER_FOR_SB_SOLUTIONS: DWORD = 0x00000033; +pub const PRODUCT_STANDARD_SERVER_SOLUTIONS: DWORD = 0x00000034; +pub const PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE: DWORD = 0x00000035; +pub const PRODUCT_SB_SOLUTION_SERVER_EM: DWORD = 0x00000036; +pub const PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM: DWORD = 0x00000037; +pub const PRODUCT_SOLUTION_EMBEDDEDSERVER: DWORD = 0x00000038; +pub const PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE: DWORD = 0x00000039; +pub const PRODUCT_PROFESSIONAL_EMBEDDED: DWORD = 0x0000003A; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT: DWORD = 0x0000003B; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL: DWORD = 0x0000003C; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC: DWORD = 0x0000003D; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC: DWORD = 0x0000003E; +pub const PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE: DWORD = 0x0000003F; +pub const PRODUCT_CLUSTER_SERVER_V: DWORD = 0x00000040; +pub const PRODUCT_EMBEDDED: DWORD = 0x00000041; +pub const PRODUCT_STARTER_E: DWORD = 0x00000042; +pub const PRODUCT_HOME_BASIC_E: DWORD = 0x00000043; +pub const PRODUCT_HOME_PREMIUM_E: DWORD = 0x00000044; +pub const PRODUCT_PROFESSIONAL_E: DWORD = 0x00000045; +pub const PRODUCT_ENTERPRISE_E: DWORD = 0x00000046; +pub const PRODUCT_ULTIMATE_E: DWORD = 0x00000047; +pub const PRODUCT_ENTERPRISE_EVALUATION: DWORD = 0x00000048; +pub const PRODUCT_MULTIPOINT_STANDARD_SERVER: DWORD = 0x0000004C; +pub const PRODUCT_MULTIPOINT_PREMIUM_SERVER: DWORD = 0x0000004D; +pub const PRODUCT_STANDARD_EVALUATION_SERVER: DWORD = 0x0000004F; +pub const PRODUCT_DATACENTER_EVALUATION_SERVER: DWORD = 0x00000050; +pub const PRODUCT_ENTERPRISE_N_EVALUATION: DWORD = 0x00000054; +pub const PRODUCT_EMBEDDED_AUTOMOTIVE: DWORD = 0x00000055; +pub const PRODUCT_EMBEDDED_INDUSTRY_A: DWORD = 0x00000056; +pub const PRODUCT_THINPC: DWORD = 0x00000057; +pub const PRODUCT_EMBEDDED_A: DWORD = 0x00000058; +pub const PRODUCT_EMBEDDED_INDUSTRY: DWORD = 0x00000059; +pub const PRODUCT_EMBEDDED_E: DWORD = 0x0000005A; +pub const PRODUCT_EMBEDDED_INDUSTRY_E: DWORD = 0x0000005B; +pub const PRODUCT_EMBEDDED_INDUSTRY_A_E: DWORD = 0x0000005C; +pub const PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER: DWORD = 0x0000005F; +pub const PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER: DWORD = 0x00000060; +pub const PRODUCT_CORE_ARM: DWORD = 0x00000061; +pub const PRODUCT_CORE_N: DWORD = 0x00000062; +pub const PRODUCT_CORE_COUNTRYSPECIFIC: DWORD = 0x00000063; +pub const PRODUCT_CORE_SINGLELANGUAGE: DWORD = 0x00000064; +pub const PRODUCT_CORE: DWORD = 0x00000065; +pub const PRODUCT_PROFESSIONAL_WMC: DWORD = 0x00000067; +pub const PRODUCT_MOBILE_CORE: DWORD = 0x00000068; +pub const PRODUCT_EMBEDDED_INDUSTRY_EVAL: DWORD = 0x00000069; +pub const PRODUCT_EMBEDDED_INDUSTRY_E_EVAL: DWORD = 0x0000006A; +pub const PRODUCT_EMBEDDED_EVAL: DWORD = 0x0000006B; +pub const PRODUCT_EMBEDDED_E_EVAL: DWORD = 0x0000006C; +pub const PRODUCT_NANO_SERVER: DWORD = 0x0000006D; +pub const PRODUCT_CLOUD_STORAGE_SERVER: DWORD = 0x0000006E; +pub const PRODUCT_CORE_CONNECTED: DWORD = 0x0000006F; +pub const PRODUCT_PROFESSIONAL_STUDENT: DWORD = 0x00000070; +pub const PRODUCT_CORE_CONNECTED_N: DWORD = 0x00000071; +pub const PRODUCT_PROFESSIONAL_STUDENT_N: DWORD = 0x00000072; +pub const PRODUCT_CORE_CONNECTED_SINGLELANGUAGE: DWORD = 0x00000073; +pub const PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC: DWORD = 0x00000074; +pub const PRODUCT_CONNECTED_CAR: DWORD = 0x00000075; +pub const PRODUCT_INDUSTRY_HANDHELD: DWORD = 0x00000076; +pub const PRODUCT_PPI_PRO: DWORD = 0x00000077; +pub const PRODUCT_ARM64_SERVER: DWORD = 0x00000078; +pub const PRODUCT_EDUCATION: DWORD = 0x00000079; +pub const PRODUCT_EDUCATION_N: DWORD = 0x0000007A; +pub const PRODUCT_IOTUAP: DWORD = 0x0000007B; +pub const PRODUCT_CLOUD_HOST_INFRASTRUCTURE_SERVER: DWORD = 0x0000007C; +pub const PRODUCT_ENTERPRISE_S: DWORD = 0x0000007D; +pub const PRODUCT_ENTERPRISE_S_N: DWORD = 0x0000007E; +pub const PRODUCT_PROFESSIONAL_S: DWORD = 0x0000007F; +pub const PRODUCT_PROFESSIONAL_S_N: DWORD = 0x00000080; +pub const PRODUCT_ENTERPRISE_S_EVALUATION: DWORD = 0x00000081; +pub const PRODUCT_ENTERPRISE_S_N_EVALUATION: DWORD = 0x00000082; +pub const PRODUCT_HOLOGRAPHIC: DWORD = 0x00000087; +pub const PRODUCT_PRO_SINGLE_LANGUAGE: DWORD = 0x0000008A; +pub const PRODUCT_PRO_CHINA: DWORD = 0x0000008B; +pub const PRODUCT_ENTERPRISE_SUBSCRIPTION: DWORD = 0x0000008C; +pub const PRODUCT_ENTERPRISE_SUBSCRIPTION_N: DWORD = 0x0000008D; +pub const PRODUCT_DATACENTER_NANO_SERVER: DWORD = 0x0000008F; +pub const PRODUCT_STANDARD_NANO_SERVER: DWORD = 0x00000090; +pub const PRODUCT_DATACENTER_A_SERVER_CORE: DWORD = 0x00000091; +pub const PRODUCT_STANDARD_A_SERVER_CORE: DWORD = 0x00000092; +pub const PRODUCT_DATACENTER_WS_SERVER_CORE: DWORD = 0x00000093; +pub const PRODUCT_STANDARD_WS_SERVER_CORE: DWORD = 0x00000094; +pub const PRODUCT_UTILITY_VM: DWORD = 0x00000095; +pub const PRODUCT_DATACENTER_EVALUATION_SERVER_CORE: DWORD = 0x0000009F; +pub const PRODUCT_STANDARD_EVALUATION_SERVER_CORE: DWORD = 0x000000A0; +pub const PRODUCT_PRO_WORKSTATION: DWORD = 0x000000A1; +pub const PRODUCT_PRO_WORKSTATION_N: DWORD = 0x000000A2; +pub const PRODUCT_PRO_FOR_EDUCATION: DWORD = 0x000000A4; +pub const PRODUCT_PRO_FOR_EDUCATION_N: DWORD = 0x000000A5; +pub const PRODUCT_AZURE_SERVER_CORE: DWORD = 0x000000A8; +pub const PRODUCT_AZURE_NANO_SERVER: DWORD = 0x000000A9; +pub const PRODUCT_ENTERPRISEG: DWORD = 0x000000AB; +pub const PRODUCT_ENTERPRISEGN: DWORD = 0x000000AC; +pub const PRODUCT_CLOUD: DWORD = 0x000000B2; +pub const PRODUCT_CLOUDN: DWORD = 0x000000B3; +pub const PRODUCT_UNLICENSED: DWORD = 0xABCDABCD; +pub const LANG_NEUTRAL: WORD = 0x00; +pub const LANG_INVARIANT: WORD = 0x7f; +pub const LANG_AFRIKAANS: WORD = 0x36; +pub const LANG_ALBANIAN: WORD = 0x1c; +pub const LANG_ALSATIAN: WORD = 0x84; +pub const LANG_AMHARIC: WORD = 0x5e; +pub const LANG_ARABIC: WORD = 0x01; +pub const LANG_ARMENIAN: WORD = 0x2b; +pub const LANG_ASSAMESE: WORD = 0x4d; +pub const LANG_AZERI: WORD = 0x2c; +pub const LANG_AZERBAIJANI: WORD = 0x2c; +pub const LANG_BANGLA: WORD = 0x45; +pub const LANG_BASHKIR: WORD = 0x6d; +pub const LANG_BASQUE: WORD = 0x2d; +pub const LANG_BELARUSIAN: WORD = 0x23; +pub const LANG_BENGALI: WORD = 0x45; +pub const LANG_BRETON: WORD = 0x7e; +pub const LANG_BOSNIAN: WORD = 0x1a; +pub const LANG_BOSNIAN_NEUTRAL: WORD = 0x781a; +pub const LANG_BULGARIAN: WORD = 0x02; +pub const LANG_CATALAN: WORD = 0x03; +pub const LANG_CENTRAL_KURDISH: WORD = 0x92; +pub const LANG_CHEROKEE: WORD = 0x5c; +pub const LANG_CHINESE: WORD = 0x04; +pub const LANG_CHINESE_SIMPLIFIED: WORD = 0x04; +pub const LANG_CHINESE_TRADITIONAL: WORD = 0x7c04; +pub const LANG_CORSICAN: WORD = 0x83; +pub const LANG_CROATIAN: WORD = 0x1a; +pub const LANG_CZECH: WORD = 0x05; +pub const LANG_DANISH: WORD = 0x06; +pub const LANG_DARI: WORD = 0x8c; +pub const LANG_DIVEHI: WORD = 0x65; +pub const LANG_DUTCH: WORD = 0x13; +pub const LANG_ENGLISH: WORD = 0x09; +pub const LANG_ESTONIAN: WORD = 0x25; +pub const LANG_FAEROESE: WORD = 0x38; +pub const LANG_FARSI: WORD = 0x29; +pub const LANG_FILIPINO: WORD = 0x64; +pub const LANG_FINNISH: WORD = 0x0b; +pub const LANG_FRENCH: WORD = 0x0c; +pub const LANG_FRISIAN: WORD = 0x62; +pub const LANG_FULAH: WORD = 0x67; +pub const LANG_GALICIAN: WORD = 0x56; +pub const LANG_GEORGIAN: WORD = 0x37; +pub const LANG_GERMAN: WORD = 0x07; +pub const LANG_GREEK: WORD = 0x08; +pub const LANG_GREENLANDIC: WORD = 0x6f; +pub const LANG_GUJARATI: WORD = 0x47; +pub const LANG_HAUSA: WORD = 0x68; +pub const LANG_HAWAIIAN: WORD = 0x75; +pub const LANG_HEBREW: WORD = 0x0d; +pub const LANG_HINDI: WORD = 0x39; +pub const LANG_HUNGARIAN: WORD = 0x0e; +pub const LANG_ICELANDIC: WORD = 0x0f; +pub const LANG_IGBO: WORD = 0x70; +pub const LANG_INDONESIAN: WORD = 0x21; +pub const LANG_INUKTITUT: WORD = 0x5d; +pub const LANG_IRISH: WORD = 0x3c; +pub const LANG_ITALIAN: WORD = 0x10; +pub const LANG_JAPANESE: WORD = 0x11; +pub const LANG_KANNADA: WORD = 0x4b; +pub const LANG_KASHMIRI: WORD = 0x60; +pub const LANG_KAZAK: WORD = 0x3f; +pub const LANG_KHMER: WORD = 0x53; +pub const LANG_KICHE: WORD = 0x86; +pub const LANG_KINYARWANDA: WORD = 0x87; +pub const LANG_KONKANI: WORD = 0x57; +pub const LANG_KOREAN: WORD = 0x12; +pub const LANG_KYRGYZ: WORD = 0x40; +pub const LANG_LAO: WORD = 0x54; +pub const LANG_LATVIAN: WORD = 0x26; +pub const LANG_LITHUANIAN: WORD = 0x27; +pub const LANG_LOWER_SORBIAN: WORD = 0x2e; +pub const LANG_LUXEMBOURGISH: WORD = 0x6e; +pub const LANG_MACEDONIAN: WORD = 0x2f; +pub const LANG_MALAY: WORD = 0x3e; +pub const LANG_MALAYALAM: WORD = 0x4c; +pub const LANG_MALTESE: WORD = 0x3a; +pub const LANG_MANIPURI: WORD = 0x58; +pub const LANG_MAORI: WORD = 0x81; +pub const LANG_MAPUDUNGUN: WORD = 0x7a; +pub const LANG_MARATHI: WORD = 0x4e; +pub const LANG_MOHAWK: WORD = 0x7c; +pub const LANG_MONGOLIAN: WORD = 0x50; +pub const LANG_NEPALI: WORD = 0x61; +pub const LANG_NORWEGIAN: WORD = 0x14; +pub const LANG_OCCITAN: WORD = 0x82; +pub const LANG_ODIA: WORD = 0x48; +pub const LANG_ORIYA: WORD = 0x48; +pub const LANG_PASHTO: WORD = 0x63; +pub const LANG_PERSIAN: WORD = 0x29; +pub const LANG_POLISH: WORD = 0x15; +pub const LANG_PORTUGUESE: WORD = 0x16; +pub const LANG_PULAR: WORD = 0x67; +pub const LANG_PUNJABI: WORD = 0x46; +pub const LANG_QUECHUA: WORD = 0x6b; +pub const LANG_ROMANIAN: WORD = 0x18; +pub const LANG_ROMANSH: WORD = 0x17; +pub const LANG_RUSSIAN: WORD = 0x19; +pub const LANG_SAKHA: WORD = 0x85; +pub const LANG_SAMI: WORD = 0x3b; +pub const LANG_SANSKRIT: WORD = 0x4f; +pub const LANG_SCOTTISH_GAELIC: WORD = 0x91; +pub const LANG_SERBIAN: WORD = 0x1a; +pub const LANG_SERBIAN_NEUTRAL: WORD = 0x7c1a; +pub const LANG_SINDHI: WORD = 0x59; +pub const LANG_SINHALESE: WORD = 0x5b; +pub const LANG_SLOVAK: WORD = 0x1b; +pub const LANG_SLOVENIAN: WORD = 0x24; +pub const LANG_SOTHO: WORD = 0x6c; +pub const LANG_SPANISH: WORD = 0x0a; +pub const LANG_SWAHILI: WORD = 0x41; +pub const LANG_SWEDISH: WORD = 0x1d; +pub const LANG_SYRIAC: WORD = 0x5a; +pub const LANG_TAJIK: WORD = 0x28; +pub const LANG_TAMAZIGHT: WORD = 0x5f; +pub const LANG_TAMIL: WORD = 0x49; +pub const LANG_TATAR: WORD = 0x44; +pub const LANG_TELUGU: WORD = 0x4a; +pub const LANG_THAI: WORD = 0x1e; +pub const LANG_TIBETAN: WORD = 0x51; +pub const LANG_TIGRIGNA: WORD = 0x73; +pub const LANG_TIGRINYA: WORD = 0x73; +pub const LANG_TSWANA: WORD = 0x32; +pub const LANG_TURKISH: WORD = 0x1f; +pub const LANG_TURKMEN: WORD = 0x42; +pub const LANG_UIGHUR: WORD = 0x80; +pub const LANG_UKRAINIAN: WORD = 0x22; +pub const LANG_UPPER_SORBIAN: WORD = 0x2e; +pub const LANG_URDU: WORD = 0x20; +pub const LANG_UZBEK: WORD = 0x43; +pub const LANG_VALENCIAN: WORD = 0x03; +pub const LANG_VIETNAMESE: WORD = 0x2a; +pub const LANG_WELSH: WORD = 0x52; +pub const LANG_WOLOF: WORD = 0x88; +pub const LANG_XHOSA: WORD = 0x34; +pub const LANG_YAKUT: WORD = 0x85; +pub const LANG_YI: WORD = 0x78; +pub const LANG_YORUBA: WORD = 0x6a; +pub const LANG_ZULU: WORD = 0x35; +pub const SUBLANG_NEUTRAL: WORD = 0x00; +pub const SUBLANG_DEFAULT: WORD = 0x01; +pub const SUBLANG_SYS_DEFAULT: WORD = 0x02; +pub const SUBLANG_CUSTOM_DEFAULT: WORD = 0x03; +pub const SUBLANG_CUSTOM_UNSPECIFIED: WORD = 0x04; +pub const SUBLANG_UI_CUSTOM_DEFAULT: WORD = 0x05; +pub const SUBLANG_AFRIKAANS_SOUTH_AFRICA: WORD = 0x01; +pub const SUBLANG_ALBANIAN_ALBANIA: WORD = 0x01; +pub const SUBLANG_ALSATIAN_FRANCE: WORD = 0x01; +pub const SUBLANG_AMHARIC_ETHIOPIA: WORD = 0x01; +pub const SUBLANG_ARABIC_SAUDI_ARABIA: WORD = 0x01; +pub const SUBLANG_ARABIC_IRAQ: WORD = 0x02; +pub const SUBLANG_ARABIC_EGYPT: WORD = 0x03; +pub const SUBLANG_ARABIC_LIBYA: WORD = 0x04; +pub const SUBLANG_ARABIC_ALGERIA: WORD = 0x05; +pub const SUBLANG_ARABIC_MOROCCO: WORD = 0x06; +pub const SUBLANG_ARABIC_TUNISIA: WORD = 0x07; +pub const SUBLANG_ARABIC_OMAN: WORD = 0x08; +pub const SUBLANG_ARABIC_YEMEN: WORD = 0x09; +pub const SUBLANG_ARABIC_SYRIA: WORD = 0x0a; +pub const SUBLANG_ARABIC_JORDAN: WORD = 0x0b; +pub const SUBLANG_ARABIC_LEBANON: WORD = 0x0c; +pub const SUBLANG_ARABIC_KUWAIT: WORD = 0x0d; +pub const SUBLANG_ARABIC_UAE: WORD = 0x0e; +pub const SUBLANG_ARABIC_BAHRAIN: WORD = 0x0f; +pub const SUBLANG_ARABIC_QATAR: WORD = 0x10; +pub const SUBLANG_ARMENIAN_ARMENIA: WORD = 0x01; +pub const SUBLANG_ASSAMESE_INDIA: WORD = 0x01; +pub const SUBLANG_AZERI_LATIN: WORD = 0x01; +pub const SUBLANG_AZERI_CYRILLIC: WORD = 0x02; +pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN: WORD = 0x01; +pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC: WORD = 0x02; +pub const SUBLANG_BANGLA_INDIA: WORD = 0x01; +pub const SUBLANG_BANGLA_BANGLADESH: WORD = 0x02; +pub const SUBLANG_BASHKIR_RUSSIA: WORD = 0x01; +pub const SUBLANG_BASQUE_BASQUE: WORD = 0x01; +pub const SUBLANG_BELARUSIAN_BELARUS: WORD = 0x01; +pub const SUBLANG_BENGALI_INDIA: WORD = 0x01; +pub const SUBLANG_BENGALI_BANGLADESH: WORD = 0x02; +pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN: WORD = 0x05; +pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC: WORD = 0x08; +pub const SUBLANG_BRETON_FRANCE: WORD = 0x01; +pub const SUBLANG_BULGARIAN_BULGARIA: WORD = 0x01; +pub const SUBLANG_CATALAN_CATALAN: WORD = 0x01; +pub const SUBLANG_CENTRAL_KURDISH_IRAQ: WORD = 0x01; +pub const SUBLANG_CHEROKEE_CHEROKEE: WORD = 0x01; +pub const SUBLANG_CHINESE_TRADITIONAL: WORD = 0x01; +pub const SUBLANG_CHINESE_SIMPLIFIED: WORD = 0x02; +pub const SUBLANG_CHINESE_HONGKONG: WORD = 0x03; +pub const SUBLANG_CHINESE_SINGAPORE: WORD = 0x04; +pub const SUBLANG_CHINESE_MACAU: WORD = 0x05; +pub const SUBLANG_CORSICAN_FRANCE: WORD = 0x01; +pub const SUBLANG_CZECH_CZECH_REPUBLIC: WORD = 0x01; +pub const SUBLANG_CROATIAN_CROATIA: WORD = 0x01; +pub const SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN: WORD = 0x04; +pub const SUBLANG_DANISH_DENMARK: WORD = 0x01; +pub const SUBLANG_DARI_AFGHANISTAN: WORD = 0x01; +pub const SUBLANG_DIVEHI_MALDIVES: WORD = 0x01; +pub const SUBLANG_DUTCH: WORD = 0x01; +pub const SUBLANG_DUTCH_BELGIAN: WORD = 0x02; +pub const SUBLANG_ENGLISH_US: WORD = 0x01; +pub const SUBLANG_ENGLISH_UK: WORD = 0x02; +pub const SUBLANG_ENGLISH_AUS: WORD = 0x03; +pub const SUBLANG_ENGLISH_CAN: WORD = 0x04; +pub const SUBLANG_ENGLISH_NZ: WORD = 0x05; +pub const SUBLANG_ENGLISH_EIRE: WORD = 0x06; +pub const SUBLANG_ENGLISH_SOUTH_AFRICA: WORD = 0x07; +pub const SUBLANG_ENGLISH_JAMAICA: WORD = 0x08; +pub const SUBLANG_ENGLISH_CARIBBEAN: WORD = 0x09; +pub const SUBLANG_ENGLISH_BELIZE: WORD = 0x0a; +pub const SUBLANG_ENGLISH_TRINIDAD: WORD = 0x0b; +pub const SUBLANG_ENGLISH_ZIMBABWE: WORD = 0x0c; +pub const SUBLANG_ENGLISH_PHILIPPINES: WORD = 0x0d; +pub const SUBLANG_ENGLISH_INDIA: WORD = 0x10; +pub const SUBLANG_ENGLISH_MALAYSIA: WORD = 0x11; +pub const SUBLANG_ENGLISH_SINGAPORE: WORD = 0x12; +pub const SUBLANG_ESTONIAN_ESTONIA: WORD = 0x01; +pub const SUBLANG_FAEROESE_FAROE_ISLANDS: WORD = 0x01; +pub const SUBLANG_FILIPINO_PHILIPPINES: WORD = 0x01; +pub const SUBLANG_FINNISH_FINLAND: WORD = 0x01; +pub const SUBLANG_FRENCH: WORD = 0x01; +pub const SUBLANG_FRENCH_BELGIAN: WORD = 0x02; +pub const SUBLANG_FRENCH_CANADIAN: WORD = 0x03; +pub const SUBLANG_FRENCH_SWISS: WORD = 0x04; +pub const SUBLANG_FRENCH_LUXEMBOURG: WORD = 0x05; +pub const SUBLANG_FRENCH_MONACO: WORD = 0x06; +pub const SUBLANG_FRISIAN_NETHERLANDS: WORD = 0x01; +pub const SUBLANG_FULAH_SENEGAL: WORD = 0x02; +pub const SUBLANG_GALICIAN_GALICIAN: WORD = 0x01; +pub const SUBLANG_GEORGIAN_GEORGIA: WORD = 0x01; +pub const SUBLANG_GERMAN: WORD = 0x01; +pub const SUBLANG_GERMAN_SWISS: WORD = 0x02; +pub const SUBLANG_GERMAN_AUSTRIAN: WORD = 0x03; +pub const SUBLANG_GERMAN_LUXEMBOURG: WORD = 0x04; +pub const SUBLANG_GERMAN_LIECHTENSTEIN: WORD = 0x05; +pub const SUBLANG_GREEK_GREECE: WORD = 0x01; +pub const SUBLANG_GREENLANDIC_GREENLAND: WORD = 0x01; +pub const SUBLANG_GUJARATI_INDIA: WORD = 0x01; +pub const SUBLANG_HAUSA_NIGERIA_LATIN: WORD = 0x01; +pub const SUBLANG_HAWAIIAN_US: WORD = 0x01; +pub const SUBLANG_HEBREW_ISRAEL: WORD = 0x01; +pub const SUBLANG_HINDI_INDIA: WORD = 0x01; +pub const SUBLANG_HUNGARIAN_HUNGARY: WORD = 0x01; +pub const SUBLANG_ICELANDIC_ICELAND: WORD = 0x01; +pub const SUBLANG_IGBO_NIGERIA: WORD = 0x01; +pub const SUBLANG_INDONESIAN_INDONESIA: WORD = 0x01; +pub const SUBLANG_INUKTITUT_CANADA: WORD = 0x01; +pub const SUBLANG_INUKTITUT_CANADA_LATIN: WORD = 0x02; +pub const SUBLANG_IRISH_IRELAND: WORD = 0x02; +pub const SUBLANG_ITALIAN: WORD = 0x01; +pub const SUBLANG_ITALIAN_SWISS: WORD = 0x02; +pub const SUBLANG_JAPANESE_JAPAN: WORD = 0x01; +pub const SUBLANG_KANNADA_INDIA: WORD = 0x01; +pub const SUBLANG_KASHMIRI_SASIA: WORD = 0x02; +pub const SUBLANG_KASHMIRI_INDIA: WORD = 0x02; +pub const SUBLANG_KAZAK_KAZAKHSTAN: WORD = 0x01; +pub const SUBLANG_KHMER_CAMBODIA: WORD = 0x01; +pub const SUBLANG_KICHE_GUATEMALA: WORD = 0x01; +pub const SUBLANG_KINYARWANDA_RWANDA: WORD = 0x01; +pub const SUBLANG_KONKANI_INDIA: WORD = 0x01; +pub const SUBLANG_KOREAN: WORD = 0x01; +pub const SUBLANG_KYRGYZ_KYRGYZSTAN: WORD = 0x01; +pub const SUBLANG_LAO_LAO: WORD = 0x01; +pub const SUBLANG_LATVIAN_LATVIA: WORD = 0x01; +pub const SUBLANG_LITHUANIAN: WORD = 0x01; +pub const SUBLANG_LOWER_SORBIAN_GERMANY: WORD = 0x02; +pub const SUBLANG_LUXEMBOURGISH_LUXEMBOURG: WORD = 0x01; +pub const SUBLANG_MACEDONIAN_MACEDONIA: WORD = 0x01; +pub const SUBLANG_MALAY_MALAYSIA: WORD = 0x01; +pub const SUBLANG_MALAY_BRUNEI_DARUSSALAM: WORD = 0x02; +pub const SUBLANG_MALAYALAM_INDIA: WORD = 0x01; +pub const SUBLANG_MALTESE_MALTA: WORD = 0x01; +pub const SUBLANG_MAORI_NEW_ZEALAND: WORD = 0x01; +pub const SUBLANG_MAPUDUNGUN_CHILE: WORD = 0x01; +pub const SUBLANG_MARATHI_INDIA: WORD = 0x01; +pub const SUBLANG_MOHAWK_MOHAWK: WORD = 0x01; +pub const SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA: WORD = 0x01; +pub const SUBLANG_MONGOLIAN_PRC: WORD = 0x02; +pub const SUBLANG_NEPALI_INDIA: WORD = 0x02; +pub const SUBLANG_NEPALI_NEPAL: WORD = 0x01; +pub const SUBLANG_NORWEGIAN_BOKMAL: WORD = 0x01; +pub const SUBLANG_NORWEGIAN_NYNORSK: WORD = 0x02; +pub const SUBLANG_OCCITAN_FRANCE: WORD = 0x01; +pub const SUBLANG_ODIA_INDIA: WORD = 0x01; +pub const SUBLANG_ORIYA_INDIA: WORD = 0x01; +pub const SUBLANG_PASHTO_AFGHANISTAN: WORD = 0x01; +pub const SUBLANG_PERSIAN_IRAN: WORD = 0x01; +pub const SUBLANG_POLISH_POLAND: WORD = 0x01; +pub const SUBLANG_PORTUGUESE: WORD = 0x02; +pub const SUBLANG_PORTUGUESE_BRAZILIAN: WORD = 0x01; +pub const SUBLANG_PULAR_SENEGAL: WORD = 0x02; +pub const SUBLANG_PUNJABI_INDIA: WORD = 0x01; +pub const SUBLANG_PUNJABI_PAKISTAN: WORD = 0x02; +pub const SUBLANG_QUECHUA_BOLIVIA: WORD = 0x01; +pub const SUBLANG_QUECHUA_ECUADOR: WORD = 0x02; +pub const SUBLANG_QUECHUA_PERU: WORD = 0x03; +pub const SUBLANG_ROMANIAN_ROMANIA: WORD = 0x01; +pub const SUBLANG_ROMANSH_SWITZERLAND: WORD = 0x01; +pub const SUBLANG_RUSSIAN_RUSSIA: WORD = 0x01; +pub const SUBLANG_SAKHA_RUSSIA: WORD = 0x01; +pub const SUBLANG_SAMI_NORTHERN_NORWAY: WORD = 0x01; +pub const SUBLANG_SAMI_NORTHERN_SWEDEN: WORD = 0x02; +pub const SUBLANG_SAMI_NORTHERN_FINLAND: WORD = 0x03; +pub const SUBLANG_SAMI_LULE_NORWAY: WORD = 0x04; +pub const SUBLANG_SAMI_LULE_SWEDEN: WORD = 0x05; +pub const SUBLANG_SAMI_SOUTHERN_NORWAY: WORD = 0x06; +pub const SUBLANG_SAMI_SOUTHERN_SWEDEN: WORD = 0x07; +pub const SUBLANG_SAMI_SKOLT_FINLAND: WORD = 0x08; +pub const SUBLANG_SAMI_INARI_FINLAND: WORD = 0x09; +pub const SUBLANG_SANSKRIT_INDIA: WORD = 0x01; +pub const SUBLANG_SCOTTISH_GAELIC: WORD = 0x01; +pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN: WORD = 0x06; +pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC: WORD = 0x07; +pub const SUBLANG_SERBIAN_MONTENEGRO_LATIN: WORD = 0x0b; +pub const SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC: WORD = 0x0c; +pub const SUBLANG_SERBIAN_SERBIA_LATIN: WORD = 0x09; +pub const SUBLANG_SERBIAN_SERBIA_CYRILLIC: WORD = 0x0a; +pub const SUBLANG_SERBIAN_CROATIA: WORD = 0x01; +pub const SUBLANG_SERBIAN_LATIN: WORD = 0x02; +pub const SUBLANG_SERBIAN_CYRILLIC: WORD = 0x03; +pub const SUBLANG_SINDHI_INDIA: WORD = 0x01; +pub const SUBLANG_SINDHI_PAKISTAN: WORD = 0x02; +pub const SUBLANG_SINDHI_AFGHANISTAN: WORD = 0x02; +pub const SUBLANG_SINHALESE_SRI_LANKA: WORD = 0x01; +pub const SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA: WORD = 0x01; +pub const SUBLANG_SLOVAK_SLOVAKIA: WORD = 0x01; +pub const SUBLANG_SLOVENIAN_SLOVENIA: WORD = 0x01; +pub const SUBLANG_SPANISH: WORD = 0x01; +pub const SUBLANG_SPANISH_MEXICAN: WORD = 0x02; +pub const SUBLANG_SPANISH_MODERN: WORD = 0x03; +pub const SUBLANG_SPANISH_GUATEMALA: WORD = 0x04; +pub const SUBLANG_SPANISH_COSTA_RICA: WORD = 0x05; +pub const SUBLANG_SPANISH_PANAMA: WORD = 0x06; +pub const SUBLANG_SPANISH_DOMINICAN_REPUBLIC: WORD = 0x07; +pub const SUBLANG_SPANISH_VENEZUELA: WORD = 0x08; +pub const SUBLANG_SPANISH_COLOMBIA: WORD = 0x09; +pub const SUBLANG_SPANISH_PERU: WORD = 0x0a; +pub const SUBLANG_SPANISH_ARGENTINA: WORD = 0x0b; +pub const SUBLANG_SPANISH_ECUADOR: WORD = 0x0c; +pub const SUBLANG_SPANISH_CHILE: WORD = 0x0d; +pub const SUBLANG_SPANISH_URUGUAY: WORD = 0x0e; +pub const SUBLANG_SPANISH_PARAGUAY: WORD = 0x0f; +pub const SUBLANG_SPANISH_BOLIVIA: WORD = 0x10; +pub const SUBLANG_SPANISH_EL_SALVADOR: WORD = 0x11; +pub const SUBLANG_SPANISH_HONDURAS: WORD = 0x12; +pub const SUBLANG_SPANISH_NICARAGUA: WORD = 0x13; +pub const SUBLANG_SPANISH_PUERTO_RICO: WORD = 0x14; +pub const SUBLANG_SPANISH_US: WORD = 0x15; +pub const SUBLANG_SWAHILI_KENYA: WORD = 0x01; +pub const SUBLANG_SWEDISH: WORD = 0x01; +pub const SUBLANG_SWEDISH_FINLAND: WORD = 0x02; +pub const SUBLANG_SYRIAC_SYRIA: WORD = 0x01; +pub const SUBLANG_TAJIK_TAJIKISTAN: WORD = 0x01; +pub const SUBLANG_TAMAZIGHT_ALGERIA_LATIN: WORD = 0x02; +pub const SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH: WORD = 0x04; +pub const SUBLANG_TAMIL_INDIA: WORD = 0x01; +pub const SUBLANG_TAMIL_SRI_LANKA: WORD = 0x02; +pub const SUBLANG_TATAR_RUSSIA: WORD = 0x01; +pub const SUBLANG_TELUGU_INDIA: WORD = 0x01; +pub const SUBLANG_THAI_THAILAND: WORD = 0x01; +pub const SUBLANG_TIBETAN_PRC: WORD = 0x01; +pub const SUBLANG_TIGRIGNA_ERITREA: WORD = 0x02; +pub const SUBLANG_TIGRINYA_ERITREA: WORD = 0x02; +pub const SUBLANG_TIGRINYA_ETHIOPIA: WORD = 0x01; +pub const SUBLANG_TSWANA_BOTSWANA: WORD = 0x02; +pub const SUBLANG_TSWANA_SOUTH_AFRICA: WORD = 0x01; +pub const SUBLANG_TURKISH_TURKEY: WORD = 0x01; +pub const SUBLANG_TURKMEN_TURKMENISTAN: WORD = 0x01; +pub const SUBLANG_UIGHUR_PRC: WORD = 0x01; +pub const SUBLANG_UKRAINIAN_UKRAINE: WORD = 0x01; +pub const SUBLANG_UPPER_SORBIAN_GERMANY: WORD = 0x01; +pub const SUBLANG_URDU_PAKISTAN: WORD = 0x01; +pub const SUBLANG_URDU_INDIA: WORD = 0x02; +pub const SUBLANG_UZBEK_LATIN: WORD = 0x01; +pub const SUBLANG_UZBEK_CYRILLIC: WORD = 0x02; +pub const SUBLANG_VALENCIAN_VALENCIA: WORD = 0x02; +pub const SUBLANG_VIETNAMESE_VIETNAM: WORD = 0x01; +pub const SUBLANG_WELSH_UNITED_KINGDOM: WORD = 0x01; +pub const SUBLANG_WOLOF_SENEGAL: WORD = 0x01; +pub const SUBLANG_XHOSA_SOUTH_AFRICA: WORD = 0x01; +pub const SUBLANG_YAKUT_RUSSIA: WORD = 0x01; +pub const SUBLANG_YI_PRC: WORD = 0x01; +pub const SUBLANG_YORUBA_NIGERIA: WORD = 0x01; +pub const SUBLANG_ZULU_SOUTH_AFRICA: WORD = 0x01; +pub const SORT_DEFAULT: WORD = 0x0; +pub const SORT_INVARIANT_MATH: WORD = 0x1; +pub const SORT_JAPANESE_XJIS: WORD = 0x0; +pub const SORT_JAPANESE_UNICODE: WORD = 0x1; +pub const SORT_JAPANESE_RADICALSTROKE: WORD = 0x4; +pub const SORT_CHINESE_BIG5: WORD = 0x0; +pub const SORT_CHINESE_PRCP: WORD = 0x0; +pub const SORT_CHINESE_UNICODE: WORD = 0x1; +pub const SORT_CHINESE_PRC: WORD = 0x2; +pub const SORT_CHINESE_BOPOMOFO: WORD = 0x3; +pub const SORT_CHINESE_RADICALSTROKE: WORD = 0x4; +pub const SORT_KOREAN_KSC: WORD = 0x0; +pub const SORT_KOREAN_UNICODE: WORD = 0x1; +pub const SORT_GERMAN_PHONE_BOOK: WORD = 0x1; +pub const SORT_HUNGARIAN_DEFAULT: WORD = 0x0; +pub const SORT_HUNGARIAN_TECHNICAL: WORD = 0x1; +pub const SORT_GEORGIAN_TRADITIONAL: WORD = 0x0; +pub const SORT_GEORGIAN_MODERN: WORD = 0x1; +macro_rules! MAKELANGID { ($p:expr, $s:expr) => (($s << 10) | $p) } +#[inline] +pub fn MAKELANGID(p: WORD, s: WORD) -> LANGID { + (s << 10) | p +} +#[inline] +pub fn PRIMARYLANGID(lgid: LANGID) -> WORD { + lgid & 0x3ff +} +#[inline] +pub fn SUBLANGID(lgid: LANGID) -> WORD { + lgid >> 10 +} +pub const NLS_VALID_LOCALE_MASK: DWORD = 0x000fffff; +macro_rules! MAKELCID { + ($lgid:expr, $srtid:expr) => ((($srtid as DWORD) << 16) | ($lgid as DWORD)) +} +#[inline] +pub fn MAKELCID(lgid: LANGID, srtid: WORD) -> LCID { + ((srtid as DWORD) << 16) | (lgid as DWORD) +} +#[inline] +pub fn MAKESORTLCID(lgid: LANGID, srtid: WORD, ver: WORD) -> LCID { + MAKELCID(lgid, srtid) | ((ver as DWORD) << 20) +} +#[inline] +pub fn LANGIDFROMLCID(lcid: LCID) -> LANGID { + lcid as LANGID +} +#[inline] +pub fn SORTIDFROMLCID(lcid: LCID) -> WORD { + ((lcid >> 16) & 0xf) as WORD +} +#[inline] +pub fn SORTVERSIONFROMLCID(lcid: LCID) -> WORD { + ((lcid >> 16) & 0xf) as WORD +} +pub const LOCALE_NAME_MAX_LENGTH: usize = 85; +pub const LANG_SYSTEM_DEFAULT: LANGID = MAKELANGID!(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT); +pub const LANG_USER_DEFAULT: LANGID = MAKELANGID!(LANG_NEUTRAL, SUBLANG_DEFAULT); +pub const LOCALE_SYSTEM_DEFAULT: LCID = MAKELCID!(LANG_SYSTEM_DEFAULT, SORT_DEFAULT); +pub const LOCALE_USER_DEFAULT: LCID = MAKELCID!(LANG_USER_DEFAULT, SORT_DEFAULT); +pub const LOCALE_CUSTOM_DEFAULT: LCID + = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT); +pub const LOCALE_CUSTOM_UNSPECIFIED: LCID + = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT); +pub const LOCALE_CUSTOM_UI_DEFAULT: LCID + = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_UI_CUSTOM_DEFAULT), SORT_DEFAULT); +pub const LOCALE_NEUTRAL: LCID + = MAKELCID!(MAKELANGID!(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT); +pub const LOCALE_INVARIANT: LCID + = MAKELCID!(MAKELANGID!(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT); +pub const LOCALE_TRANSIENT_KEYBOARD1: LCID = 0x2000; +pub const LOCALE_TRANSIENT_KEYBOARD2: LCID = 0x2400; +pub const LOCALE_TRANSIENT_KEYBOARD3: LCID = 0x2800; +pub const LOCALE_TRANSIENT_KEYBOARD4: LCID = 0x2c00; +pub const LOCALE_UNASSIGNED_LCID: LCID = LOCALE_CUSTOM_UNSPECIFIED; +pub const STATUS_WAIT_0: DWORD = 0x00000000; +pub const STATUS_ABANDONED_WAIT_0: DWORD = 0x00000080; +pub const STATUS_USER_APC: DWORD = 0x000000C0; +pub const STATUS_TIMEOUT: DWORD = 0x00000102; +pub const STATUS_PENDING: DWORD = 0x00000103; +pub const DBG_EXCEPTION_HANDLED: DWORD = 0x00010001; +pub const DBG_CONTINUE: DWORD = 0x00010002; +pub const STATUS_SEGMENT_NOTIFICATION: DWORD = 0x40000005; +pub const STATUS_FATAL_APP_EXIT: DWORD = 0x40000015; +pub const DBG_REPLY_LATER: DWORD = 0x40010001; +pub const DBG_TERMINATE_THREAD: DWORD = 0x40010003; +pub const DBG_TERMINATE_PROCESS: DWORD = 0x40010004; +pub const DBG_CONTROL_C: DWORD = 0x40010005; +pub const DBG_PRINTEXCEPTION_C: DWORD = 0x40010006; +pub const DBG_RIPEXCEPTION: DWORD = 0x40010007; +pub const DBG_CONTROL_BREAK: DWORD = 0x40010008; +pub const DBG_COMMAND_EXCEPTION: DWORD = 0x40010009; +pub const DBG_PRINTEXCEPTION_WIDE_C: DWORD = 0x4001000A; +pub const STATUS_GUARD_PAGE_VIOLATION: DWORD = 0x80000001; +pub const STATUS_DATATYPE_MISALIGNMENT: DWORD = 0x80000002; +pub const STATUS_BREAKPOINT: DWORD = 0x80000003; +pub const STATUS_SINGLE_STEP: DWORD = 0x80000004; +pub const STATUS_LONGJUMP: DWORD = 0x80000026; +pub const STATUS_UNWIND_CONSOLIDATE: DWORD = 0x80000029; +pub const DBG_EXCEPTION_NOT_HANDLED: DWORD = 0x80010001; +pub const STATUS_ACCESS_VIOLATION: DWORD = 0xC0000005; +pub const STATUS_IN_PAGE_ERROR: DWORD = 0xC0000006; +pub const STATUS_INVALID_HANDLE: DWORD = 0xC0000008; +pub const STATUS_INVALID_PARAMETER: DWORD = 0xC000000D; +pub const STATUS_NO_MEMORY: DWORD = 0xC0000017; +pub const STATUS_ILLEGAL_INSTRUCTION: DWORD = 0xC000001D; +pub const STATUS_NONCONTINUABLE_EXCEPTION: DWORD = 0xC0000025; +pub const STATUS_INVALID_DISPOSITION: DWORD = 0xC0000026; +pub const STATUS_ARRAY_BOUNDS_EXCEEDED: DWORD = 0xC000008C; +pub const STATUS_FLOAT_DENORMAL_OPERAND: DWORD = 0xC000008D; +pub const STATUS_FLOAT_DIVIDE_BY_ZERO: DWORD = 0xC000008E; +pub const STATUS_FLOAT_INEXACT_RESULT: DWORD = 0xC000008F; +pub const STATUS_FLOAT_INVALID_OPERATION: DWORD = 0xC0000090; +pub const STATUS_FLOAT_OVERFLOW: DWORD = 0xC0000091; +pub const STATUS_FLOAT_STACK_CHECK: DWORD = 0xC0000092; +pub const STATUS_FLOAT_UNDERFLOW: DWORD = 0xC0000093; +pub const STATUS_INTEGER_DIVIDE_BY_ZERO: DWORD = 0xC0000094; +pub const STATUS_INTEGER_OVERFLOW: DWORD = 0xC0000095; +pub const STATUS_PRIVILEGED_INSTRUCTION: DWORD = 0xC0000096; +pub const STATUS_STACK_OVERFLOW: DWORD = 0xC00000FD; +pub const STATUS_DLL_NOT_FOUND: DWORD = 0xC0000135; +pub const STATUS_ORDINAL_NOT_FOUND: DWORD = 0xC0000138; +pub const STATUS_ENTRYPOINT_NOT_FOUND: DWORD = 0xC0000139; +pub const STATUS_CONTROL_C_EXIT: DWORD = 0xC000013A; +pub const STATUS_DLL_INIT_FAILED: DWORD = 0xC0000142; +pub const STATUS_FLOAT_MULTIPLE_FAULTS: DWORD = 0xC00002B4; +pub const STATUS_FLOAT_MULTIPLE_TRAPS: DWORD = 0xC00002B5; +pub const STATUS_REG_NAT_CONSUMPTION: DWORD = 0xC00002C9; +pub const STATUS_HEAP_CORRUPTION: DWORD = 0xC0000374; +pub const STATUS_STACK_BUFFER_OVERRUN: DWORD = 0xC0000409; +pub const STATUS_INVALID_CRUNTIME_PARAMETER: DWORD = 0xC0000417; +pub const STATUS_ASSERTION_FAILURE: DWORD = 0xC0000420; +pub const STATUS_SXS_EARLY_DEACTIVATION: DWORD = 0xC015000F; +pub const STATUS_SXS_INVALID_DEACTIVATION: DWORD = 0xC0150010; +pub const MAXIMUM_WAIT_OBJECTS: DWORD = 64; +pub const MAXIMUM_SUSPEND_COUNT: CHAR = MAXCHAR; +pub type KSPIN_LOCK = ULONG_PTR; +pub type PKSPIN_LOCK = *mut KSPIN_LOCK; +STRUCT!{struct M128A { // FIXME align 16 + Low: ULONGLONG, + High: LONGLONG, +}} +pub type PM128A = *mut M128A; +#[cfg(target_pointer_width = "32")] +STRUCT!{struct XSAVE_FORMAT { // FIXME align 16 + ControlWord: WORD, + StatusWord: WORD, + TagWord: BYTE, + Reserved1: BYTE, + ErrorOpcode: WORD, + ErrorOffset: DWORD, + ErrorSelector: WORD, + Reserved2: WORD, + DataOffset: DWORD, + DataSelector: WORD, + Reserved3: WORD, + MxCsr: DWORD, + MxCsr_Mask: DWORD, + FloatRegisters: [M128A; 8], + XmmRegisters: [M128A; 8], + Reserved4: [BYTE; 224], +}} +#[cfg(target_pointer_width = "64")] +STRUCT!{struct XSAVE_FORMAT { // FIXME align 16 + ControlWord: WORD, + StatusWord: WORD, + TagWord: BYTE, + Reserved1: BYTE, + ErrorOpcode: WORD, + ErrorOffset: DWORD, + ErrorSelector: WORD, + Reserved2: WORD, + DataOffset: DWORD, + DataSelector: WORD, + Reserved3: WORD, + MxCsr: DWORD, + MxCsr_Mask: DWORD, + FloatRegisters: [M128A; 8], + XmmRegisters: [M128A; 16], + Reserved4: [BYTE; 96], +}} +#[cfg(target_arch = "x86")] +STRUCT!{struct XSTATE_CONTEXT { + Mask: DWORD64, + Length: DWORD, + Reserved1: DWORD, + Area: PXSAVE_AREA, + Reserved2: DWORD, + Buffer: PVOID, + Reserved3: DWORD, +}} +#[cfg(not(target_arch = "x86"))] +STRUCT!{struct XSTATE_CONTEXT { + Mask: DWORD64, + Length: DWORD, + Reserved1: DWORD, + Area: PXSAVE_AREA, + Buffer: PVOID, +}} +pub type PXSAVE_FORMAT = *mut XSAVE_FORMAT; +STRUCT!{struct XSAVE_AREA_HEADER { // FIXME align 8 + Mask: DWORD64, + CompactionMask: DWORD64, + Reserved2: [DWORD64; 6], +}} +pub type PXSAVE_AREA_HEADER = *mut XSAVE_AREA_HEADER; +STRUCT!{struct XSAVE_AREA { // FIXME align 16 + LegacyState: XSAVE_FORMAT, + Header: XSAVE_AREA_HEADER, +}} +pub type PXSAVE_AREA = *mut XSAVE_AREA; +pub type PXSTATE_CONTEXT = *mut XSTATE_CONTEXT; +STRUCT!{struct SCOPE_TABLE_AMD64 { + Count: DWORD, + ScopeRecord: [SCOPE_TABLE_AMD64_ScopeRecord; 1], +}} +STRUCT!{struct SCOPE_TABLE_AMD64_ScopeRecord { + BeginAddress: DWORD, + EndAddress: DWORD, + HandlerAddress: DWORD, + JumpTarget: DWORD, +}} +pub type PSCOPE_TABLE_AMD64 = *mut SCOPE_TABLE_AMD64; +STRUCT!{struct SCOPE_TABLE_ARM64 { + Count: DWORD, + ScopeRecord: [SCOPE_TABLE_ARM64_ScopeRecord; 1], +}} +STRUCT!{struct SCOPE_TABLE_ARM64_ScopeRecord { + BeginAddress: DWORD, + EndAddress: DWORD, + HandlerAddress: DWORD, + JumpTarget: DWORD, +}} +pub type PSCOPE_TABLE_ARM64 = *mut SCOPE_TABLE_ARM64; +// Skip interlocked and bit manipulation stuff because it is all intrinsics +// Use the native Rust equivalents instead +#[cfg(target_arch = "x86_64")] +IFDEF!{ +pub const EXCEPTION_READ_FAULT: DWORD = 0; +pub const EXCEPTION_WRITE_FAULT: DWORD = 1; +pub const EXCEPTION_EXECUTE_FAULT: DWORD = 8; +pub const CONTEXT_AMD64: DWORD = 0x00100000; +pub const CONTEXT_CONTROL: DWORD = CONTEXT_AMD64 | 0x00000001; +pub const CONTEXT_INTEGER: DWORD = CONTEXT_AMD64 | 0x00000002; +pub const CONTEXT_SEGMENTS: DWORD = CONTEXT_AMD64 | 0x00000004; +pub const CONTEXT_FLOATING_POINT: DWORD = CONTEXT_AMD64 | 0x00000008; +pub const CONTEXT_DEBUG_REGISTERS: DWORD = CONTEXT_AMD64 | 0x00000010; +pub const CONTEXT_FULL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT; +pub const CONTEXT_ALL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS + | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS; +pub const CONTEXT_XSTATE: DWORD = CONTEXT_AMD64 | 0x00000040; +pub const CONTEXT_EXCEPTION_ACTIVE: DWORD = 0x08000000; +pub const CONTEXT_SERVICE_ACTIVE: DWORD = 0x10000000; +pub const CONTEXT_EXCEPTION_REQUEST: DWORD = 0x40000000; +pub const CONTEXT_EXCEPTION_REPORTING: DWORD = 0x80000000; +pub const INITIAL_MXCSR: DWORD = 0x1f80; +pub const INITIAL_FPCSR: DWORD = 0x027f; +pub type XMM_SAVE_AREA32 = XSAVE_FORMAT; +pub type PXMM_SAVE_AREA32 = *mut XSAVE_FORMAT; +STRUCT!{struct CONTEXT_u_s { + Header: [M128A; 2], + Legacy: [M128A; 8], + Xmm0: M128A, + Xmm1: M128A, + Xmm2: M128A, + Xmm3: M128A, + Xmm4: M128A, + Xmm5: M128A, + Xmm6: M128A, + Xmm7: M128A, + Xmm8: M128A, + Xmm9: M128A, + Xmm10: M128A, + Xmm11: M128A, + Xmm12: M128A, + Xmm13: M128A, + Xmm14: M128A, + Xmm15: M128A, +}} +UNION!{union CONTEXT_u { + [u64; 64], + FltSave FltSave_mut: XMM_SAVE_AREA32, + s s_mut: CONTEXT_u_s, +}} +STRUCT!{struct CONTEXT { // FIXME align 16 + P1Home: DWORD64, + P2Home: DWORD64, + P3Home: DWORD64, + P4Home: DWORD64, + P5Home: DWORD64, + P6Home: DWORD64, + ContextFlags: DWORD, + MxCsr: DWORD, + SegCs: WORD, + SegDs: WORD, + SegEs: WORD, + SegFs: WORD, + SegGs: WORD, + SegSs: WORD, + EFlags: DWORD, + Dr0: DWORD64, + Dr1: DWORD64, + Dr2: DWORD64, + Dr3: DWORD64, + Dr6: DWORD64, + Dr7: DWORD64, + Rax: DWORD64, + Rcx: DWORD64, + Rdx: DWORD64, + Rbx: DWORD64, + Rsp: DWORD64, + Rbp: DWORD64, + Rsi: DWORD64, + Rdi: DWORD64, + R8: DWORD64, + R9: DWORD64, + R10: DWORD64, + R11: DWORD64, + R12: DWORD64, + R13: DWORD64, + R14: DWORD64, + R15: DWORD64, + Rip: DWORD64, + u: CONTEXT_u, + VectorRegister: [M128A; 26], + VectorControl: DWORD64, + DebugControl: DWORD64, + LastBranchToRip: DWORD64, + LastBranchFromRip: DWORD64, + LastExceptionToRip: DWORD64, + LastExceptionFromRip: DWORD64, +}} +pub type PCONTEXT = *mut CONTEXT; +pub type RUNTIME_FUNCTION = IMAGE_RUNTIME_FUNCTION_ENTRY; +pub type PRUNTIME_FUNCTION = *mut IMAGE_RUNTIME_FUNCTION_ENTRY; +pub type SCOPE_TABLE = SCOPE_TABLE_AMD64; +pub type PSCOPE_TABLE = *mut SCOPE_TABLE_AMD64; +pub const RUNTIME_FUNCTION_INDIRECT: DWORD = 0x1; +pub const UNW_FLAG_NHANDLER: DWORD = 0x0; +pub const UNW_FLAG_EHANDLER: DWORD = 0x1; +pub const UNW_FLAG_UHANDLER: DWORD = 0x2; +pub const UNW_FLAG_CHAININFO: DWORD = 0x4; +pub const UNW_FLAG_NO_EPILOGUE: DWORD = 0x80000000; +pub const UNWIND_HISTORY_TABLE_SIZE: usize = 12; +STRUCT!{struct UNWIND_HISTORY_TABLE_ENTRY { + ImageBase: DWORD64, + FunctionEntry: PRUNTIME_FUNCTION, +}} +pub type PUNWIND_HISTORY_TABLE_ENTRY = *mut UNWIND_HISTORY_TABLE_ENTRY; +STRUCT!{struct UNWIND_HISTORY_TABLE { + Count: DWORD, + LocalHint: BYTE, + GlobalHint: BYTE, + Search: BYTE, + Once: BYTE, + LowAddress: DWORD64, + HighAddress: DWORD64, + Entry: [UNWIND_HISTORY_TABLE_ENTRY; UNWIND_HISTORY_TABLE_SIZE], +}} +pub type PUNWIND_HISTORY_TABLE = *mut UNWIND_HISTORY_TABLE; +FN!{cdecl PGET_RUNTIME_FUNCTION_CALLBACK( + ControlPc: DWORD64, + Context: PVOID, +) -> PRUNTIME_FUNCTION} +FN!{cdecl POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK( + Process: HANDLE, + TableAddress: PVOID, + Entries: PDWORD, + Functions: *mut PRUNTIME_FUNCTION, +) -> DWORD} +pub const OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME: &'static str + = "OutOfProcessFunctionTableCallback"; +STRUCT!{struct DISPATCHER_CONTEXT { + ControlPc: DWORD64, + ImageBase: DWORD64, + FunctionEntry: PRUNTIME_FUNCTION, + EstablisherFrame: DWORD64, + TargetIp: DWORD64, + ContextRecord: PCONTEXT, + LanguageHandler: PEXCEPTION_ROUTINE, + HandlerData: PVOID, + HistoryTable: PUNWIND_HISTORY_TABLE, + ScopeIndex: DWORD, + Fill0: DWORD, +}} +pub type PDISPATCHER_CONTEXT = *mut DISPATCHER_CONTEXT; +FN!{cdecl PEXCEPTION_FILTER( + ExceptionPointers: *mut EXCEPTION_POINTERS, + EstablisherFrame: PVOID, +) -> LONG} +FN!{cdecl PTERMINATION_HANDLER( + AbnormalTermination: BOOLEAN, + EstablisherFrame: PVOID, +) -> ()} +STRUCT!{struct KNONVOLATILE_CONTEXT_POINTERS_u1_s { + Xmm0: PM128A, + Xmm1: PM128A, + Xmm2: PM128A, + Xmm3: PM128A, + Xmm4: PM128A, + Xmm5: PM128A, + Xmm6: PM128A, + Xmm7: PM128A, + Xmm8: PM128A, + Xmm9: PM128A, + Xmm10: PM128A, + Xmm11: PM128A, + Xmm12: PM128A, + Xmm13: PM128A, + Xmm14: PM128A, + Xmm15: PM128A, +}} +UNION!{union KNONVOLATILE_CONTEXT_POINTERS_u1 { + [u64; 16], + FloatingContext FloatingContext_mut: [PM128A; 16], + s s_mut: KNONVOLATILE_CONTEXT_POINTERS_u1_s, +}} +STRUCT!{struct KNONVOLATILE_CONTEXT_POINTERS_u2_s { + Rax: PDWORD64, + Rcx: PDWORD64, + Rdx: PDWORD64, + Rbx: PDWORD64, + Rsp: PDWORD64, + Rbp: PDWORD64, + Rsi: PDWORD64, + Rdi: PDWORD64, + R8: PDWORD64, + R9: PDWORD64, + R10: PDWORD64, + R11: PDWORD64, + R12: PDWORD64, + R13: PDWORD64, + R14: PDWORD64, + R15: PDWORD64, +}} +UNION!{union KNONVOLATILE_CONTEXT_POINTERS_u2 { + [u64; 16], + IntegerContext IntegerContext_mut: [PDWORD64; 16], + s s_mut: KNONVOLATILE_CONTEXT_POINTERS_u2_s, +}} +STRUCT!{struct KNONVOLATILE_CONTEXT_POINTERS { + u1: KNONVOLATILE_CONTEXT_POINTERS_u1, + u2: KNONVOLATILE_CONTEXT_POINTERS_u2, +}} +pub type PKNONVOLATILE_CONTEXT_POINTERS = *mut KNONVOLATILE_CONTEXT_POINTERS; +} // IFDEF(x86_64) +#[cfg(target_arch = "x86")] +IFDEF!{ +pub const EXCEPTION_READ_FAULT: DWORD = 0; +pub const EXCEPTION_WRITE_FAULT: DWORD = 1; +pub const EXCEPTION_EXECUTE_FAULT: DWORD = 8; +pub const SIZE_OF_80387_REGISTERS: usize = 80; +pub const CONTEXT_i386: DWORD = 0x00010000; +pub const CONTEXT_i486: DWORD = 0x00010000; +pub const CONTEXT_CONTROL: DWORD = CONTEXT_i386 | 0x00000001; +pub const CONTEXT_INTEGER: DWORD = CONTEXT_i386 | 0x00000002; +pub const CONTEXT_SEGMENTS: DWORD = CONTEXT_i386 | 0x00000004; +pub const CONTEXT_FLOATING_POINT: DWORD = CONTEXT_i386 | 0x00000008; +pub const CONTEXT_DEBUG_REGISTERS: DWORD = CONTEXT_i386 | 0x00000010; +pub const CONTEXT_EXTENDED_REGISTERS: DWORD = CONTEXT_i386 | 0x00000020; +pub const CONTEXT_FULL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS; +pub const CONTEXT_ALL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS + | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | CONTEXT_EXTENDED_REGISTERS; +pub const CONTEXT_XSTATE: DWORD = CONTEXT_i386 | 0x00000040; +pub const CONTEXT_EXCEPTION_ACTIVE: DWORD = 0x08000000; +pub const CONTEXT_SERVICE_ACTIVE: DWORD = 0x10000000; +pub const CONTEXT_EXCEPTION_REQUEST: DWORD = 0x40000000; +pub const CONTEXT_EXCEPTION_REPORTING: DWORD = 0x80000000; +STRUCT!{struct FLOATING_SAVE_AREA { + ControlWord: DWORD, + StatusWord: DWORD, + TagWord: DWORD, + ErrorOffset: DWORD, + ErrorSelector: DWORD, + DataOffset: DWORD, + DataSelector: DWORD, + RegisterArea: [BYTE; SIZE_OF_80387_REGISTERS], + Spare0: DWORD, +}} +pub type PFLOATING_SAVE_AREA = *mut FLOATING_SAVE_AREA; +pub const MAXIMUM_SUPPORTED_EXTENSION: usize = 512; +STRUCT!{struct CONTEXT { + ContextFlags: DWORD, + Dr0: DWORD, + Dr1: DWORD, + Dr2: DWORD, + Dr3: DWORD, + Dr6: DWORD, + Dr7: DWORD, + FloatSave: FLOATING_SAVE_AREA, + SegGs: DWORD, + SegFs: DWORD, + SegEs: DWORD, + SegDs: DWORD, + Edi: DWORD, + Esi: DWORD, + Ebx: DWORD, + Edx: DWORD, + Ecx: DWORD, + Eax: DWORD, + Ebp: DWORD, + Eip: DWORD, + SegCs: DWORD, + EFlags: DWORD, + Esp: DWORD, + SegSs: DWORD, + ExtendedRegisters: [BYTE; MAXIMUM_SUPPORTED_EXTENSION], +}} +pub type PCONTEXT = *mut CONTEXT; +} // IFDEF(x86) +STRUCT!{struct LDT_ENTRY_Bytes { + BaseMid: BYTE, + Flags1: BYTE, + Flags2: BYTE, + BaseHi: BYTE, +}} +STRUCT!{struct LDT_ENTRY_Bits { + Bitfield: DWORD, +}} +BITFIELD!{LDT_ENTRY_Bits Bitfield: DWORD [ + BaseMid set_BaseMid[0..8], + Type set_Type[8..13], + Dpl set_Dpl[13..15], + Pres set_Pres[15..16], + LimitHi set_LimitHi[16..20], + Sys set_Sys[20..21], + Reserved_0 set_Reserved_0[21..22], + Default_Big set_Default_Big[22..23], + Granularity set_Granularity[23..24], + BaseHi set_BaseHi[24..32], +]} +UNION!{union LDT_ENTRY_HighWord { + [u32; 1], + Bytes Bytes_mut: LDT_ENTRY_Bytes, + Bits Bits_mut: LDT_ENTRY_Bits, +}} +STRUCT!{struct LDT_ENTRY { + LimitLow: WORD, + BaseLow: WORD, + HighWord: LDT_ENTRY_HighWord, +}} +pub type PLDT_ENTRY = *mut LDT_ENTRY; +#[cfg(target_arch = "aarch64")] +IFDEF!{ +pub const ARM64_MAX_BREAKPOINTS: usize = 8; +pub const ARM64_MAX_WATCHPOINTS: usize = 2; +pub const EXCEPTION_READ_FAULT: DWORD = 0; +pub const EXCEPTION_WRITE_FAULT: DWORD = 1; +pub const EXCEPTION_EXECUTE_FAULT: DWORD = 8; +pub const CONTEXT_ARM64: DWORD = 0x00400000; +pub const CONTEXT_CONTROL: DWORD = CONTEXT_ARM64 | 0x00000001; +pub const CONTEXT_INTEGER: DWORD = CONTEXT_ARM64 | 0x00000002; +pub const CONTEXT_FLOATING_POINT: DWORD = CONTEXT_ARM64 | 0x00000004; +pub const CONTEXT_DEBUG_REGISTERS: DWORD = CONTEXT_ARM64 | 0x00000008; +pub const CONTEXT_X18: DWORD = CONTEXT_ARM64 | 0x00000010; +pub const CONTEXT_FULL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT; +pub const CONTEXT_ALL: DWORD = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT + | CONTEXT_DEBUG_REGISTERS | CONTEXT_X18; +pub const CONTEXT_EXCEPTION_ACTIVE: DWORD = 0x08000000; +pub const CONTEXT_SERVICE_ACTIVE: DWORD = 0x10000000; +pub const CONTEXT_EXCEPTION_REQUEST: DWORD = 0x40000000; +pub const CONTEXT_EXCEPTION_REPORTING: DWORD = 0x80000000; +STRUCT!{struct CONTEXT_u_s { + X0: DWORD64, + X1: DWORD64, + X2: DWORD64, + X3: DWORD64, + X4: DWORD64, + X5: DWORD64, + X6: DWORD64, + X7: DWORD64, + X8: DWORD64, + X9: DWORD64, + X10: DWORD64, + X11: DWORD64, + X12: DWORD64, + X13: DWORD64, + X14: DWORD64, + X15: DWORD64, + X16: DWORD64, + X17: DWORD64, + X18: DWORD64, + X19: DWORD64, + X20: DWORD64, + X21: DWORD64, + X22: DWORD64, + X23: DWORD64, + X24: DWORD64, + X25: DWORD64, + X26: DWORD64, + X27: DWORD64, + X28: DWORD64, + Fp: DWORD64, + Lr: DWORD64, +}} +UNION!{union CONTEXT_u { + [u64; 31], + s s_mut: CONTEXT_u_s, +}} +STRUCT!{struct ARM64_NT_NEON128_s { + Low: ULONGLONG, + High: LONGLONG, +}} +UNION!{union ARM64_NT_NEON128 { + [u64; 2], + s s_mut: ARM64_NT_NEON128_s, + D D_mut: [f64; 2], + S S_mut: [f32; 4], + H H_mut: [WORD; 8], + B B_mut: [BYTE; 16], +}} +STRUCT!{struct CONTEXT { // FIXME align 16 + ContextFlags: DWORD, + Cpsr: DWORD, + u: CONTEXT_u, + Sp: DWORD64, + Pc: DWORD64, + V: [ARM64_NT_NEON128; 32], + Fpcr: DWORD, + Fpsr: DWORD, + Bcr: [DWORD; ARM64_MAX_BREAKPOINTS], + Bvr: [DWORD64; ARM64_MAX_BREAKPOINTS], + Wcr: [DWORD; ARM64_MAX_WATCHPOINTS], + Wvr: [DWORD64; ARM64_MAX_WATCHPOINTS], +}} +pub type PCONTEXT = *mut CONTEXT; +pub type RUNTIME_FUNCTION = IMAGE_RUNTIME_FUNCTION_ENTRY; +pub type PRUNTIME_FUNCTION = *mut IMAGE_RUNTIME_FUNCTION_ENTRY; +pub type SCOPE_TABLE = SCOPE_TABLE_ARM64; +pub type PSCOPE_TABLE = *mut SCOPE_TABLE_ARM64; +pub const RUNTIME_FUNCTION_INDIRECT: DWORD = 0x1; +pub const UNW_FLAG_NHANDLER: DWORD = 0x0; +pub const UNW_FLAG_EHANDLER: DWORD = 0x1; +pub const UNW_FLAG_UHANDLER: DWORD = 0x2; +pub const UNWIND_HISTORY_TABLE_SIZE: usize = 12; +STRUCT!{struct UNWIND_HISTORY_TABLE_ENTRY { + ImageBase: DWORD64, + FunctionEntry: PRUNTIME_FUNCTION, +}} +pub type PUNWIND_HISTORY_TABLE_ENTRY = *mut UNWIND_HISTORY_TABLE_ENTRY; +STRUCT!{struct UNWIND_HISTORY_TABLE { + Count: DWORD, + LocalHint: BYTE, + GlobalHint: BYTE, + Search: BYTE, + Once: BYTE, + LowAddress: DWORD64, + HighAddress: DWORD64, + Entry: [UNWIND_HISTORY_TABLE_ENTRY; UNWIND_HISTORY_TABLE_SIZE], +}} +pub type PUNWIND_HISTORY_TABLE = *mut UNWIND_HISTORY_TABLE; +FN!{cdecl PGET_RUNTIME_FUNCTION_CALLBACK( + ControlPc: DWORD64, + Context: PVOID, +) -> PRUNTIME_FUNCTION} +FN!{cdecl POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK( + Process: HANDLE, + TableAddress: PVOID, + Entries: PDWORD, + Functions: *mut PRUNTIME_FUNCTION, +) -> DWORD} +pub const OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME: &'static str + = "OutOfProcessFunctionTableCallback"; +STRUCT!{struct DISPATCHER_CONTEXT { + ControlPc: ULONG_PTR, + ImageBase: ULONG_PTR, + FunctionEntry: PRUNTIME_FUNCTION, + EstablisherFrame: ULONG_PTR, + TargetPc: ULONG_PTR, + ContextRecord: PCONTEXT, + LanguageHandler: PEXCEPTION_ROUTINE, + HandlerData: PVOID, + HistoryTable: PUNWIND_HISTORY_TABLE, + ScopeIndex: DWORD, + ControlPcIsUnwound: BOOLEAN, + NonVolatileRegisters: PBYTE, +}} +pub type PDISPATCHER_CONTEXT = *mut DISPATCHER_CONTEXT; +FN!{cdecl PEXCEPTION_FILTER( + ExceptionPointers: *mut EXCEPTION_POINTERS, + EstablisherFrame: DWORD64, +) -> LONG} +FN!{cdecl PTERMINATION_HANDLER( + AbnormalTermination: BOOLEAN, + EstablisherFrame: DWORD64, +) -> ()} +STRUCT!{struct KNONVOLATILE_CONTEXT_POINTERS { + X19: PDWORD64, + X20: PDWORD64, + X21: PDWORD64, + X22: PDWORD64, + X23: PDWORD64, + X24: PDWORD64, + X25: PDWORD64, + X26: PDWORD64, + X27: PDWORD64, + X28: PDWORD64, + Fp: PDWORD64, + Lr: PDWORD64, + D8: PDWORD64, + D9: PDWORD64, + D10: PDWORD64, + D11: PDWORD64, + D12: PDWORD64, + D13: PDWORD64, + D14: PDWORD64, + D15: PDWORD64, +}} +pub type PKNONVOLATILE_CONTEXT_POINTERS = *mut KNONVOLATILE_CONTEXT_POINTERS; +} // IFDEF(aarch64) +#[cfg(target_arch = "arm")] +IFDEF!{ +pub const ARM_MAX_BREAKPOINTS: usize = 8; +pub const ARM_MAX_WATCHPOINTS: usize = 1; +STRUCT!{struct NEON128 { + Low: ULONGLONG, + High: LONGLONG, +}} +pub type PNEON128 = *mut NEON128; +UNION!{union CONTEXT_u { + [u64; 32], + Q Q_mut: [NEON128; 16], + D D_mut: [ULONGLONG; 32], + S S_mut: [DWORD; 32], +}} +STRUCT!{struct CONTEXT { + ContextFlags: DWORD, + R0: DWORD, + R1: DWORD, + R2: DWORD, + R3: DWORD, + R4: DWORD, + R5: DWORD, + R6: DWORD, + R7: DWORD, + R8: DWORD, + R9: DWORD, + R10: DWORD, + R11: DWORD, + R12: DWORD, + Sp: DWORD, + Lr: DWORD, + Pc: DWORD, + Cpsr: DWORD, + Fpsrc: DWORD, + Padding: DWORD, + u: CONTEXT_u, + Bvr: [DWORD; ARM_MAX_BREAKPOINTS], + Bcr: [DWORD; ARM_MAX_BREAKPOINTS], + Wvr: [DWORD; ARM_MAX_WATCHPOINTS], + Wcr: [DWORD; ARM_MAX_WATCHPOINTS], + Padding2: [DWORD; 2], +}} +pub type PCONTEXT = *mut CONTEXT; +} // IFDEF(arm) +pub const WOW64_CONTEXT_i386: DWORD = 0x00010000; +pub const WOW64_CONTEXT_i486: DWORD = 0x00010000; +pub const WOW64_CONTEXT_CONTROL: DWORD = WOW64_CONTEXT_i386 | 0x00000001; +pub const WOW64_CONTEXT_INTEGER: DWORD = WOW64_CONTEXT_i386 | 0x00000002; +pub const WOW64_CONTEXT_SEGMENTS: DWORD = WOW64_CONTEXT_i386 | 0x00000004; +pub const WOW64_CONTEXT_FLOATING_POINT: DWORD = WOW64_CONTEXT_i386 | 0x00000008; +pub const WOW64_CONTEXT_DEBUG_REGISTERS: DWORD = WOW64_CONTEXT_i386 | 0x00000010; +pub const WOW64_CONTEXT_EXTENDED_REGISTERS: DWORD = WOW64_CONTEXT_i386 | 0x00000020; +pub const WOW64_CONTEXT_FULL: DWORD = WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER + | WOW64_CONTEXT_SEGMENTS; +pub const WOW64_CONTEXT_ALL: DWORD = WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER + | WOW64_CONTEXT_SEGMENTS | WOW64_CONTEXT_FLOATING_POINT | WOW64_CONTEXT_DEBUG_REGISTERS + | WOW64_CONTEXT_EXTENDED_REGISTERS; +pub const WOW64_CONTEXT_XSTATE: DWORD = WOW64_CONTEXT_i386 | 0x00000040; +pub const WOW64_CONTEXT_EXCEPTION_ACTIVE: DWORD = 0x08000000; +pub const WOW64_CONTEXT_SERVICE_ACTIVE: DWORD = 0x10000000; +pub const WOW64_CONTEXT_EXCEPTION_REQUEST: DWORD = 0x40000000; +pub const WOW64_CONTEXT_EXCEPTION_REPORTING: DWORD = 0x80000000; +pub const WOW64_SIZE_OF_80387_REGISTERS: usize = 80; +pub const WOW64_MAXIMUM_SUPPORTED_EXTENSION: usize = 512; +STRUCT!{struct WOW64_FLOATING_SAVE_AREA { + ControlWord: DWORD, + StatusWord: DWORD, + TagWord: DWORD, + ErrorOffset: DWORD, + ErrorSelector: DWORD, + DataOffset: DWORD, + DataSelector: DWORD, + RegisterArea: [BYTE; WOW64_SIZE_OF_80387_REGISTERS], + Cr0NpxState: DWORD, +}} +pub type PWOW64_FLOATING_SAVE_AREA = *mut WOW64_FLOATING_SAVE_AREA; +STRUCT!{struct WOW64_CONTEXT { + ContextFlags: DWORD, + Dr0: DWORD, + Dr1: DWORD, + Dr2: DWORD, + Dr3: DWORD, + Dr6: DWORD, + Dr7: DWORD, + FloatSave: WOW64_FLOATING_SAVE_AREA, + SegGs: DWORD, + SegFs: DWORD, + SegEs: DWORD, + SegDs: DWORD, + Edi: DWORD, + Esi: DWORD, + Ebx: DWORD, + Edx: DWORD, + Ecx: DWORD, + Eax: DWORD, + Ebp: DWORD, + Eip: DWORD, + SegCs: DWORD, + EFlags: DWORD, + Esp: DWORD, + SegSs: DWORD, + ExtendedRegisters: [BYTE; WOW64_MAXIMUM_SUPPORTED_EXTENSION], +}} +pub type PWOW64_CONTEXT = *mut WOW64_CONTEXT; +STRUCT!{struct WOW64_LDT_ENTRY_Bytes { + BaseMid: BYTE, + Flags1: BYTE, + Flags2: BYTE, + BaseHi: BYTE, +}} +STRUCT!{struct WOW64_LDT_ENTRY_Bits { + BitFields: DWORD, +}} +BITFIELD!{WOW64_LDT_ENTRY_Bits BitFields: DWORD [ + BaseMid set_BaseMid[0..8], + Type set_Type[8..13], + Dpl set_Dpl[13..15], + Pres set_Pres[15..16], + LimitHi set_LimitHi[16..20], + Sys set_Sys[20..21], + Reserved_0 set_Reserved_0[21..22], + Default_Big set_Default_Big[22..23], + Granularity set_Granularity[23..24], + BaseHi set_BaseHi[24..32], +]} +UNION!{union WOW64_LDT_ENTRY_HighWord { + [u32; 1], + Bytes Bytes_mut: WOW64_LDT_ENTRY_Bytes, + Bits Bits_mut: WOW64_LDT_ENTRY_Bits, +}} +STRUCT!{struct WOW64_LDT_ENTRY { + LimitLow: WORD, + BaseLow: WORD, + HighWord: WOW64_LDT_ENTRY_HighWord, +}} +pub type PWOW64_LDT_ENTRY = *mut WOW64_LDT_ENTRY; +STRUCT!{struct WOW64_DESCRIPTOR_TABLE_ENTRY { + Selector: DWORD, + Descriptor: WOW64_LDT_ENTRY, +}} +pub type PWOW64_DESCRIPTOR_TABLE_ENTRY = *mut WOW64_DESCRIPTOR_TABLE_ENTRY; +pub const EXCEPTION_NONCONTINUABLE: DWORD = 0x1; +pub const EXCEPTION_UNWINDING: DWORD = 0x2; +pub const EXCEPTION_EXIT_UNWIND: DWORD = 0x4; +pub const EXCEPTION_STACK_INVALID: DWORD = 0x8; +pub const EXCEPTION_NESTED_CALL: DWORD = 0x10; +pub const EXCEPTION_TARGET_UNWIND: DWORD = 0x20; +pub const EXCEPTION_COLLIDED_UNWIND: DWORD = 0x40; +pub const EXCEPTION_UNWIND: DWORD = EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND + | EXCEPTION_TARGET_UNWIND | EXCEPTION_COLLIDED_UNWIND; +#[inline] +pub fn IS_UNWINDING(Flag: DWORD) -> bool { + (Flag & EXCEPTION_UNWIND) != 0 +} +#[inline] +pub fn IS_DISPATCHING(Flag: DWORD) -> bool { + (Flag & EXCEPTION_UNWIND) == 0 +} +#[inline] +pub fn IS_TARGET_UNWIND(Flag: DWORD) -> bool { + (Flag & EXCEPTION_TARGET_UNWIND) != 0 +} +pub const EXCEPTION_MAXIMUM_PARAMETERS: usize = 15; +STRUCT!{struct EXCEPTION_RECORD { + ExceptionCode: DWORD, + ExceptionFlags: DWORD, + ExceptionRecord: *mut EXCEPTION_RECORD, + ExceptionAddress: PVOID, + NumberParameters: DWORD, + ExceptionInformation: [ULONG_PTR; EXCEPTION_MAXIMUM_PARAMETERS], +}} +pub type PEXCEPTION_RECORD = *mut EXCEPTION_RECORD; +STRUCT!{struct EXCEPTION_RECORD32 { + ExceptionCode: DWORD, + ExceptionFlags: DWORD, + ExceptionRecord: DWORD, + ExceptionAddress: DWORD, + NumberParameters: DWORD, + ExceptionInformation: [DWORD; EXCEPTION_MAXIMUM_PARAMETERS], +}} +pub type PEXCEPTION_RECORD32 = *mut EXCEPTION_RECORD32; +STRUCT!{struct EXCEPTION_RECORD64 { + ExceptionCode: DWORD, + ExceptionFlags: DWORD, + ExceptionRecord: DWORD64, + ExceptionAddress: DWORD64, + NumberParameters: DWORD, + __unusedAlignment: DWORD, + ExceptionInformation: [DWORD64; EXCEPTION_MAXIMUM_PARAMETERS], +}} +pub type PEXCEPTION_RECORD64 = *mut EXCEPTION_RECORD64; +STRUCT!{struct EXCEPTION_POINTERS { + ExceptionRecord: PEXCEPTION_RECORD, + ContextRecord: PCONTEXT, +}} +pub type PEXCEPTION_POINTERS = *mut EXCEPTION_POINTERS; +pub type PACCESS_TOKEN = PVOID; +pub type PSECURITY_DESCRIPTOR = PVOID; +pub type PSID = PVOID; +pub type PCLAIMS_BLOB = PVOID; +pub type ACCESS_MASK = DWORD; +pub type PACCESS_MASK = *mut ACCESS_MASK; +pub const DELETE: DWORD = 0x00010000; +pub const READ_CONTROL: DWORD = 0x00020000; +pub const WRITE_DAC: DWORD = 0x00040000; +pub const WRITE_OWNER: DWORD = 0x00080000; +pub const SYNCHRONIZE: DWORD = 0x00100000; +pub const STANDARD_RIGHTS_REQUIRED: DWORD = 0x000F0000; +pub const STANDARD_RIGHTS_READ: DWORD = READ_CONTROL; +pub const STANDARD_RIGHTS_WRITE: DWORD = READ_CONTROL; +pub const STANDARD_RIGHTS_EXECUTE: DWORD = READ_CONTROL; +pub const STANDARD_RIGHTS_ALL: DWORD = 0x001F0000; +pub const SPECIFIC_RIGHTS_ALL: DWORD = 0x0000FFFF; +pub const ACCESS_SYSTEM_SECURITY: DWORD = 0x01000000; +pub const MAXIMUM_ALLOWED: DWORD = 0x02000000; +pub const GENERIC_READ: DWORD = 0x80000000; +pub const GENERIC_WRITE: DWORD = 0x40000000; +pub const GENERIC_EXECUTE: DWORD = 0x20000000; +pub const GENERIC_ALL: DWORD = 0x10000000; +STRUCT!{struct GENERIC_MAPPING { + GenericRead: ACCESS_MASK, + GenericWrite: ACCESS_MASK, + GenericExecute: ACCESS_MASK, + GenericAll: ACCESS_MASK, +}} +pub type PGENERIC_MAPPING = *mut GENERIC_MAPPING; +STRUCT!{struct LUID_AND_ATTRIBUTES { + Luid: LUID, + Attributes: DWORD, +}} +pub type PLUID_AND_ATTRIBUTES = *mut LUID_AND_ATTRIBUTES; +pub type LUID_AND_ATTRIBUTES_ARRAY = LUID_AND_ATTRIBUTES; +pub type PLUID_AND_ATTRIBUTES_ARRAY = *mut LUID_AND_ATTRIBUTES; +STRUCT!{struct SID_IDENTIFIER_AUTHORITY { + Value: [BYTE; 6], +}} +pub type PSID_IDENTIFIER_AUTHORITY = *mut SID_IDENTIFIER_AUTHORITY; +STRUCT!{struct SID { + Revision: BYTE, + SubAuthorityCount: BYTE, + IdentifierAuthority: SID_IDENTIFIER_AUTHORITY, + SubAuthority: [DWORD; 1], +}} +pub type PISID = *mut SID; +pub const SID_REVISION: BYTE = 1; +pub const SID_MAX_SUB_AUTHORITIES: BYTE = 15; +pub const SID_RECOMMENDED_SUB_AUTHORITIES: BYTE = 1; +pub const SECURITY_MAX_SID_SIZE: usize = 12 - 4 + (SID_MAX_SUB_AUTHORITIES as usize * 4); +pub const SECURITY_MAX_SID_STRING_CHARACTERS: BYTE = 2 + 4 + 15 + (11 * SID_MAX_SUB_AUTHORITIES) + + 1; +UNION!{union SE_SID { + [u32; 17], + Sid Sid_mut: SID, + Buffer Buffer_mut: [BYTE; SECURITY_MAX_SID_SIZE], +}} +pub type PSE_SID = *mut SE_SID; +ENUM!{enum SID_NAME_USE { + SidTypeUser = 1, + SidTypeGroup, + SidTypeDomain, + SidTypeAlias, + SidTypeWellKnownGroup, + SidTypeDeletedAccount, + SidTypeInvalid, + SidTypeUnknown, + SidTypeComputer, + SidTypeLabel, + SidTypeLogonSession, +}} +pub type PSID_NAME_USE = *mut SID_NAME_USE; +STRUCT!{struct SID_AND_ATTRIBUTES { + Sid: PSID, + Attributes: DWORD, +}} +pub type PSID_AND_ATTRIBUTES = *mut SID_AND_ATTRIBUTES; +pub type SID_AND_ATTRIBUTES_ARRAY = SID_AND_ATTRIBUTES; +pub type PSID_AND_ATTRIBUTES_ARRAY = *mut SID_AND_ATTRIBUTES; +pub const SID_HASH_SIZE: usize = 32; +pub type SID_HASH_ENTRY = ULONG_PTR; +pub type PSID_HASH_ENTRY = *mut ULONG_PTR; +STRUCT!{struct SID_AND_ATTRIBUTES_HASH { + SidCount: DWORD, + SidAttr: PSID_AND_ATTRIBUTES, + Hash: [SID_HASH_ENTRY; SID_HASH_SIZE], +}} +pub type PSID_AND_ATTRIBUTES_HASH = *mut SID_AND_ATTRIBUTES_HASH; +pub const SECURITY_NULL_SID_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 0]; +pub const SECURITY_WORLD_SID_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 1]; +pub const SECURITY_LOCAL_SID_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 2]; +pub const SECURITY_CREATOR_SID_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 3]; +pub const SECURITY_NON_UNIQUE_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 4]; +pub const SECURITY_RESOURCE_MANAGER_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 9]; +pub const SECURITY_NULL_RID: DWORD = 0x00000000; +pub const SECURITY_WORLD_RID: DWORD = 0x00000000; +pub const SECURITY_LOCAL_RID: DWORD = 0x00000000; +pub const SECURITY_LOCAL_LOGON_RID: DWORD = 0x00000001; +pub const SECURITY_CREATOR_OWNER_RID: DWORD = 0x00000000; +pub const SECURITY_CREATOR_GROUP_RID: DWORD = 0x00000001; +pub const SECURITY_CREATOR_OWNER_SERVER_RID: DWORD = 0x00000002; +pub const SECURITY_CREATOR_GROUP_SERVER_RID: DWORD = 0x00000003; +pub const SECURITY_CREATOR_OWNER_RIGHTS_RID: DWORD = 0x00000004; +pub const SECURITY_NT_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 5]; +pub const SECURITY_DIALUP_RID: DWORD = 0x00000001; +pub const SECURITY_NETWORK_RID: DWORD = 0x00000002; +pub const SECURITY_BATCH_RID: DWORD = 0x00000003; +pub const SECURITY_INTERACTIVE_RID: DWORD = 0x00000004; +pub const SECURITY_LOGON_IDS_RID: DWORD = 0x00000005; +pub const SECURITY_LOGON_IDS_RID_COUNT: DWORD = 3; +pub const SECURITY_SERVICE_RID: DWORD = 0x00000006; +pub const SECURITY_ANONYMOUS_LOGON_RID: DWORD = 0x00000007; +pub const SECURITY_PROXY_RID: DWORD = 0x00000008; +pub const SECURITY_ENTERPRISE_CONTROLLERS_RID: DWORD = 0x00000009; +pub const SECURITY_SERVER_LOGON_RID: DWORD = SECURITY_ENTERPRISE_CONTROLLERS_RID; +pub const SECURITY_PRINCIPAL_SELF_RID: DWORD = 0x0000000A; +pub const SECURITY_AUTHENTICATED_USER_RID: DWORD = 0x0000000B; +pub const SECURITY_RESTRICTED_CODE_RID: DWORD = 0x0000000C; +pub const SECURITY_TERMINAL_SERVER_RID: DWORD = 0x0000000D; +pub const SECURITY_REMOTE_LOGON_RID: DWORD = 0x0000000E; +pub const SECURITY_THIS_ORGANIZATION_RID: DWORD = 0x0000000F; +pub const SECURITY_IUSER_RID: DWORD = 0x00000011; +pub const SECURITY_LOCAL_SYSTEM_RID: DWORD = 0x00000012; +pub const SECURITY_LOCAL_SERVICE_RID: DWORD = 0x00000013; +pub const SECURITY_NETWORK_SERVICE_RID: DWORD = 0x00000014; +pub const SECURITY_NT_NON_UNIQUE: DWORD = 0x00000015; +pub const SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT: DWORD = 3; +pub const SECURITY_ENTERPRISE_READONLY_CONTROLLERS_RID: DWORD = 0x00000016; +pub const SECURITY_BUILTIN_DOMAIN_RID: DWORD = 0x00000020; +pub const SECURITY_WRITE_RESTRICTED_CODE_RID: DWORD = 0x00000021; +pub const SECURITY_PACKAGE_BASE_RID: DWORD = 0x00000040; +pub const SECURITY_PACKAGE_RID_COUNT: DWORD = 2; +pub const SECURITY_PACKAGE_NTLM_RID: DWORD = 0x0000000A; +pub const SECURITY_PACKAGE_SCHANNEL_RID: DWORD = 0x0000000E; +pub const SECURITY_PACKAGE_DIGEST_RID: DWORD = 0x00000015; +pub const SECURITY_CRED_TYPE_BASE_RID: DWORD = 0x00000041; +pub const SECURITY_CRED_TYPE_RID_COUNT: DWORD = 2; +pub const SECURITY_CRED_TYPE_THIS_ORG_CERT_RID: DWORD = 0x00000001; +pub const SECURITY_MIN_BASE_RID: DWORD = 0x00000050; +pub const SECURITY_SERVICE_ID_BASE_RID: DWORD = 0x00000050; +pub const SECURITY_SERVICE_ID_RID_COUNT: DWORD = 6; +pub const SECURITY_RESERVED_ID_BASE_RID: DWORD = 0x00000051; +pub const SECURITY_APPPOOL_ID_BASE_RID: DWORD = 0x00000052; +pub const SECURITY_APPPOOL_ID_RID_COUNT: DWORD = 6; +pub const SECURITY_VIRTUALSERVER_ID_BASE_RID: DWORD = 0x00000053; +pub const SECURITY_VIRTUALSERVER_ID_RID_COUNT: DWORD = 6; +pub const SECURITY_USERMODEDRIVERHOST_ID_BASE_RID: DWORD = 0x00000054; +pub const SECURITY_USERMODEDRIVERHOST_ID_RID_COUNT: DWORD = 6; +pub const SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_BASE_RID: DWORD = 0x00000055; +pub const SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_RID_COUNT: DWORD = 6; +pub const SECURITY_WMIHOST_ID_BASE_RID: DWORD = 0x00000056; +pub const SECURITY_WMIHOST_ID_RID_COUNT: DWORD = 6; +pub const SECURITY_TASK_ID_BASE_RID: DWORD = 0x00000057; +pub const SECURITY_NFS_ID_BASE_RID: DWORD = 0x00000058; +pub const SECURITY_COM_ID_BASE_RID: DWORD = 0x00000059; +pub const SECURITY_WINDOW_MANAGER_BASE_RID: DWORD = 0x0000005A; +pub const SECURITY_RDV_GFX_BASE_RID: DWORD = 0x0000005B; +pub const SECURITY_DASHOST_ID_BASE_RID: DWORD = 0x0000005C; +pub const SECURITY_DASHOST_ID_RID_COUNT: DWORD = 6; +pub const SECURITY_USERMANAGER_ID_BASE_RID: DWORD = 0x0000005D; +pub const SECURITY_USERMANAGER_ID_RID_COUNT: DWORD = 6; +pub const SECURITY_WINRM_ID_BASE_RID: DWORD = 0x0000005E; +pub const SECURITY_WINRM_ID_RID_COUNT: DWORD = 6; +pub const SECURITY_CCG_ID_BASE_RID: DWORD = 0x0000005F; +pub const SECURITY_UMFD_BASE_RID: DWORD = 0x00000060; +pub const SECURITY_VIRTUALACCOUNT_ID_RID_COUNT: DWORD = 6; +pub const SECURITY_MAX_BASE_RID: DWORD = 0x0000006F; +pub const SECURITY_MAX_ALWAYS_FILTERED: DWORD = 0x000003E7; +pub const SECURITY_MIN_NEVER_FILTERED: DWORD = 0x000003E8; +pub const SECURITY_OTHER_ORGANIZATION_RID: DWORD = 0x000003E8; +pub const SECURITY_WINDOWSMOBILE_ID_BASE_RID: DWORD = 0x00000070; +pub const SECURITY_INSTALLER_GROUP_CAPABILITY_BASE: DWORD = 0x20; +pub const SECURITY_INSTALLER_GROUP_CAPABILITY_RID_COUNT: DWORD = 9; +pub const SECURITY_INSTALLER_CAPABILITY_RID_COUNT: DWORD = 10; +pub const SECURITY_LOCAL_ACCOUNT_RID: DWORD = 0x00000071; +pub const SECURITY_LOCAL_ACCOUNT_AND_ADMIN_RID: DWORD = 0x00000072; +pub const DOMAIN_GROUP_RID_AUTHORIZATION_DATA_IS_COMPOUNDED: DWORD = 0x000001F0; +pub const DOMAIN_GROUP_RID_AUTHORIZATION_DATA_CONTAINS_CLAIMS: DWORD = 0x000001F1; +pub const DOMAIN_GROUP_RID_ENTERPRISE_READONLY_DOMAIN_CONTROLLERS: DWORD = 0x000001F2; +pub const FOREST_USER_RID_MAX: DWORD = 0x000001F3; +pub const DOMAIN_USER_RID_ADMIN: DWORD = 0x000001F4; +pub const DOMAIN_USER_RID_GUEST: DWORD = 0x000001F5; +pub const DOMAIN_USER_RID_KRBTGT: DWORD = 0x000001F6; +pub const DOMAIN_USER_RID_DEFAULT_ACCOUNT: DWORD = 0x000001F7; +pub const DOMAIN_USER_RID_MAX: DWORD = 0x000003E7; +pub const DOMAIN_GROUP_RID_ADMINS: DWORD = 0x00000200; +pub const DOMAIN_GROUP_RID_USERS: DWORD = 0x00000201; +pub const DOMAIN_GROUP_RID_GUESTS: DWORD = 0x00000202; +pub const DOMAIN_GROUP_RID_COMPUTERS: DWORD = 0x00000203; +pub const DOMAIN_GROUP_RID_CONTROLLERS: DWORD = 0x00000204; +pub const DOMAIN_GROUP_RID_CERT_ADMINS: DWORD = 0x00000205; +pub const DOMAIN_GROUP_RID_SCHEMA_ADMINS: DWORD = 0x00000206; +pub const DOMAIN_GROUP_RID_ENTERPRISE_ADMINS: DWORD = 0x00000207; +pub const DOMAIN_GROUP_RID_POLICY_ADMINS: DWORD = 0x00000208; +pub const DOMAIN_GROUP_RID_READONLY_CONTROLLERS: DWORD = 0x00000209; +pub const DOMAIN_GROUP_RID_CLONEABLE_CONTROLLERS: DWORD = 0x0000020A; +pub const DOMAIN_GROUP_RID_CDC_RESERVED: DWORD = 0x0000020C; +pub const DOMAIN_GROUP_RID_PROTECTED_USERS: DWORD = 0x0000020D; +pub const DOMAIN_GROUP_RID_KEY_ADMINS: DWORD = 0x0000020E; +pub const DOMAIN_GROUP_RID_ENTERPRISE_KEY_ADMINS: DWORD = 0x0000020F; +pub const DOMAIN_ALIAS_RID_ADMINS: DWORD = 0x00000220; +pub const DOMAIN_ALIAS_RID_USERS: DWORD = 0x00000221; +pub const DOMAIN_ALIAS_RID_GUESTS: DWORD = 0x00000222; +pub const DOMAIN_ALIAS_RID_POWER_USERS: DWORD = 0x00000223; +pub const DOMAIN_ALIAS_RID_ACCOUNT_OPS: DWORD = 0x00000224; +pub const DOMAIN_ALIAS_RID_SYSTEM_OPS: DWORD = 0x00000225; +pub const DOMAIN_ALIAS_RID_PRINT_OPS: DWORD = 0x00000226; +pub const DOMAIN_ALIAS_RID_BACKUP_OPS: DWORD = 0x00000227; +pub const DOMAIN_ALIAS_RID_REPLICATOR: DWORD = 0x00000228; +pub const DOMAIN_ALIAS_RID_RAS_SERVERS: DWORD = 0x00000229; +pub const DOMAIN_ALIAS_RID_PREW2KCOMPACCESS: DWORD = 0x0000022A; +pub const DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS: DWORD = 0x0000022B; +pub const DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS: DWORD = 0x0000022C; +pub const DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS: DWORD = 0x0000022D; +pub const DOMAIN_ALIAS_RID_MONITORING_USERS: DWORD = 0x0000022E; +pub const DOMAIN_ALIAS_RID_LOGGING_USERS: DWORD = 0x0000022F; +pub const DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS: DWORD = 0x00000230; +pub const DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS: DWORD = 0x00000231; +pub const DOMAIN_ALIAS_RID_DCOM_USERS: DWORD = 0x00000232; +pub const DOMAIN_ALIAS_RID_IUSERS: DWORD = 0x00000238; +pub const DOMAIN_ALIAS_RID_CRYPTO_OPERATORS: DWORD = 0x00000239; +pub const DOMAIN_ALIAS_RID_CACHEABLE_PRINCIPALS_GROUP: DWORD = 0x0000023B; +pub const DOMAIN_ALIAS_RID_NON_CACHEABLE_PRINCIPALS_GROUP: DWORD = 0x0000023C; +pub const DOMAIN_ALIAS_RID_EVENT_LOG_READERS_GROUP: DWORD = 0x0000023D; +pub const DOMAIN_ALIAS_RID_CERTSVC_DCOM_ACCESS_GROUP: DWORD = 0x0000023E; +pub const DOMAIN_ALIAS_RID_RDS_REMOTE_ACCESS_SERVERS: DWORD = 0x0000023F; +pub const DOMAIN_ALIAS_RID_RDS_ENDPOINT_SERVERS: DWORD = 0x00000240; +pub const DOMAIN_ALIAS_RID_RDS_MANAGEMENT_SERVERS: DWORD = 0x00000241; +pub const DOMAIN_ALIAS_RID_HYPER_V_ADMINS: DWORD = 0x00000242; +pub const DOMAIN_ALIAS_RID_ACCESS_CONTROL_ASSISTANCE_OPS: DWORD = 0x00000243; +pub const DOMAIN_ALIAS_RID_REMOTE_MANAGEMENT_USERS: DWORD = 0x00000244; +pub const DOMAIN_ALIAS_RID_DEFAULT_ACCOUNT: DWORD = 0x00000245; +pub const DOMAIN_ALIAS_RID_STORAGE_REPLICA_ADMINS: DWORD = 0x00000246; +pub const SECURITY_APP_PACKAGE_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 15]; +pub const SECURITY_APP_PACKAGE_BASE_RID: DWORD = 0x00000002; +pub const SECURITY_BUILTIN_APP_PACKAGE_RID_COUNT: DWORD = 2; +pub const SECURITY_APP_PACKAGE_RID_COUNT: DWORD = 8; +pub const SECURITY_CAPABILITY_BASE_RID: DWORD = 0x00000003; +pub const SECURITY_CAPABILITY_APP_RID: DWORD = 0x00000040; +pub const SECURITY_BUILTIN_CAPABILITY_RID_COUNT: DWORD = 2; +pub const SECURITY_CAPABILITY_RID_COUNT: DWORD = 5; +pub const SECURITY_PARENT_PACKAGE_RID_COUNT: DWORD = SECURITY_APP_PACKAGE_RID_COUNT; +pub const SECURITY_CHILD_PACKAGE_RID_COUNT: DWORD = 12; +pub const SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE: DWORD = 0x00000001; +pub const SECURITY_BUILTIN_PACKAGE_ANY_RESTRICTED_PACKAGE: DWORD = 0x00000002; +pub const SECURITY_CAPABILITY_INTERNET_CLIENT: DWORD = 0x00000001; +pub const SECURITY_CAPABILITY_INTERNET_CLIENT_SERVER: DWORD = 0x00000002; +pub const SECURITY_CAPABILITY_PRIVATE_NETWORK_CLIENT_SERVER: DWORD = 0x00000003; +pub const SECURITY_CAPABILITY_PICTURES_LIBRARY: DWORD = 0x00000004; +pub const SECURITY_CAPABILITY_VIDEOS_LIBRARY: DWORD = 0x00000005; +pub const SECURITY_CAPABILITY_MUSIC_LIBRARY: DWORD = 0x00000006; +pub const SECURITY_CAPABILITY_DOCUMENTS_LIBRARY: DWORD = 0x00000007; +pub const SECURITY_CAPABILITY_ENTERPRISE_AUTHENTICATION: DWORD = 0x00000008; +pub const SECURITY_CAPABILITY_SHARED_USER_CERTIFICATES: DWORD = 0x00000009; +pub const SECURITY_CAPABILITY_REMOVABLE_STORAGE: DWORD = 0x0000000A; +pub const SECURITY_CAPABILITY_APPOINTMENTS: DWORD = 0x0000000B; +pub const SECURITY_CAPABILITY_CONTACTS: DWORD = 0x0000000C; +pub const SECURITY_CAPABILITY_INTERNET_EXPLORER: DWORD = 0x00001000; +pub const SECURITY_MANDATORY_LABEL_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 16]; +pub const SECURITY_MANDATORY_UNTRUSTED_RID: DWORD = 0x00000000; +pub const SECURITY_MANDATORY_LOW_RID: DWORD = 0x00001000; +pub const SECURITY_MANDATORY_MEDIUM_RID: DWORD = 0x00002000; +pub const SECURITY_MANDATORY_MEDIUM_PLUS_RID: DWORD = SECURITY_MANDATORY_MEDIUM_RID + 0x10; +pub const SECURITY_MANDATORY_HIGH_RID: DWORD = 0x00003000; +pub const SECURITY_MANDATORY_SYSTEM_RID: DWORD = 0x00004000; +pub const SECURITY_MANDATORY_MAXIMUM_USER_RID: DWORD = SECURITY_MANDATORY_SYSTEM_RID; +#[inline] +pub fn MANDATORY_LEVEL_TO_MANDATORY_RID(IL: DWORD) -> DWORD { + IL * 0x1000 +} +pub const SECURITY_SCOPED_POLICY_ID_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 17]; +pub const SECURITY_AUTHENTICATION_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 18]; +pub const SECURITY_AUTHENTICATION_AUTHORITY_RID_COUNT: DWORD = 1; +pub const SECURITY_AUTHENTICATION_AUTHORITY_ASSERTED_RID: DWORD = 0x00000001; +pub const SECURITY_AUTHENTICATION_SERVICE_ASSERTED_RID: DWORD = 0x00000002; +pub const SECURITY_AUTHENTICATION_FRESH_KEY_AUTH_RID: DWORD = 0x00000003; +pub const SECURITY_AUTHENTICATION_KEY_TRUST_RID: DWORD = 0x00000004; +pub const SECURITY_AUTHENTICATION_KEY_PROPERTY_MFA_RID: DWORD = 0x00000005; +pub const SECURITY_AUTHENTICATION_KEY_PROPERTY_ATTESTATION_RID: DWORD = 0x00000006; +pub const SECURITY_PROCESS_TRUST_AUTHORITY: [BYTE; 6] = [0, 0, 0, 0, 0, 19]; +pub const SECURITY_PROCESS_TRUST_AUTHORITY_RID_COUNT: DWORD = 2; +pub const SECURITY_PROCESS_PROTECTION_TYPE_FULL_RID: DWORD = 0x00000400; +pub const SECURITY_PROCESS_PROTECTION_TYPE_LITE_RID: DWORD = 0x00000200; +pub const SECURITY_PROCESS_PROTECTION_TYPE_NONE_RID: DWORD = 0x00000000; +pub const SECURITY_PROCESS_PROTECTION_LEVEL_WINTCB_RID: DWORD = 0x00002000; +pub const SECURITY_PROCESS_PROTECTION_LEVEL_WINDOWS_RID: DWORD = 0x00001000; +pub const SECURITY_PROCESS_PROTECTION_LEVEL_APP_RID: DWORD = 0x00000800; +pub const SECURITY_PROCESS_PROTECTION_LEVEL_NONE_RID: DWORD = 0x00000000; +pub const SECURITY_TRUSTED_INSTALLER_RID1: DWORD = 95600888; +pub const SECURITY_TRUSTED_INSTALLER_RID2: DWORD = 341852264; +pub const SECURITY_TRUSTED_INSTALLER_RID3: DWORD = 183103804; +pub const SECURITY_TRUSTED_INSTALLER_RID4: DWORD = 185329263; +pub const SECURITY_TRUSTED_INSTALLER_RID5: DWORD = 227147846; +ENUM!{enum WELL_KNOWN_SID_TYPE { + WinNullSid = 0, + WinWorldSid = 1, + WinLocalSid = 2, + WinCreatorOwnerSid = 3, + WinCreatorGroupSid = 4, + WinCreatorOwnerServerSid = 5, + WinCreatorGroupServerSid = 6, + WinNtAuthoritySid = 7, + WinDialupSid = 8, + WinNetworkSid = 9, + WinBatchSid = 10, + WinInteractiveSid = 11, + WinServiceSid = 12, + WinAnonymousSid = 13, + WinProxySid = 14, + WinEnterpriseControllersSid = 15, + WinSelfSid = 16, + WinAuthenticatedUserSid = 17, + WinRestrictedCodeSid = 18, + WinTerminalServerSid = 19, + WinRemoteLogonIdSid = 20, + WinLogonIdsSid = 21, + WinLocalSystemSid = 22, + WinLocalServiceSid = 23, + WinNetworkServiceSid = 24, + WinBuiltinDomainSid = 25, + WinBuiltinAdministratorsSid = 26, + WinBuiltinUsersSid = 27, + WinBuiltinGuestsSid = 28, + WinBuiltinPowerUsersSid = 29, + WinBuiltinAccountOperatorsSid = 30, + WinBuiltinSystemOperatorsSid = 31, + WinBuiltinPrintOperatorsSid = 32, + WinBuiltinBackupOperatorsSid = 33, + WinBuiltinReplicatorSid = 34, + WinBuiltinPreWindows2000CompatibleAccessSid = 35, + WinBuiltinRemoteDesktopUsersSid = 36, + WinBuiltinNetworkConfigurationOperatorsSid = 37, + WinAccountAdministratorSid = 38, + WinAccountGuestSid = 39, + WinAccountKrbtgtSid = 40, + WinAccountDomainAdminsSid = 41, + WinAccountDomainUsersSid = 42, + WinAccountDomainGuestsSid = 43, + WinAccountComputersSid = 44, + WinAccountControllersSid = 45, + WinAccountCertAdminsSid = 46, + WinAccountSchemaAdminsSid = 47, + WinAccountEnterpriseAdminsSid = 48, + WinAccountPolicyAdminsSid = 49, + WinAccountRasAndIasServersSid = 50, + WinNTLMAuthenticationSid = 51, + WinDigestAuthenticationSid = 52, + WinSChannelAuthenticationSid = 53, + WinThisOrganizationSid = 54, + WinOtherOrganizationSid = 55, + WinBuiltinIncomingForestTrustBuildersSid = 56, + WinBuiltinPerfMonitoringUsersSid = 57, + WinBuiltinPerfLoggingUsersSid = 58, + WinBuiltinAuthorizationAccessSid = 59, + WinBuiltinTerminalServerLicenseServersSid = 60, + WinBuiltinDCOMUsersSid = 61, + WinBuiltinIUsersSid = 62, + WinIUserSid = 63, + WinBuiltinCryptoOperatorsSid = 64, + WinUntrustedLabelSid = 65, + WinLowLabelSid = 66, + WinMediumLabelSid = 67, + WinHighLabelSid = 68, + WinSystemLabelSid = 69, + WinWriteRestrictedCodeSid = 70, + WinCreatorOwnerRightsSid = 71, + WinCacheablePrincipalsGroupSid = 72, + WinNonCacheablePrincipalsGroupSid = 73, + WinEnterpriseReadonlyControllersSid = 74, + WinAccountReadonlyControllersSid = 75, + WinBuiltinEventLogReadersGroup = 76, + WinNewEnterpriseReadonlyControllersSid = 77, + WinBuiltinCertSvcDComAccessGroup = 78, + WinMediumPlusLabelSid = 79, + WinLocalLogonSid = 80, + WinConsoleLogonSid = 81, + WinThisOrganizationCertificateSid = 82, + WinApplicationPackageAuthoritySid = 83, + WinBuiltinAnyPackageSid = 84, + WinCapabilityInternetClientSid = 85, + WinCapabilityInternetClientServerSid = 86, + WinCapabilityPrivateNetworkClientServerSid = 87, + WinCapabilityPicturesLibrarySid = 88, + WinCapabilityVideosLibrarySid = 89, + WinCapabilityMusicLibrarySid = 90, + WinCapabilityDocumentsLibrarySid = 91, + WinCapabilitySharedUserCertificatesSid = 92, + WinCapabilityEnterpriseAuthenticationSid = 93, + WinCapabilityRemovableStorageSid = 94, + WinBuiltinRDSRemoteAccessServersSid = 95, + WinBuiltinRDSEndpointServersSid = 96, + WinBuiltinRDSManagementServersSid = 97, + WinUserModeDriversSid = 98, + WinBuiltinHyperVAdminsSid = 99, + WinAccountCloneableControllersSid = 100, + WinBuiltinAccessControlAssistanceOperatorsSid = 101, + WinBuiltinRemoteManagementUsersSid = 102, + WinAuthenticationAuthorityAssertedSid = 103, + WinAuthenticationServiceAssertedSid = 104, + WinLocalAccountSid = 105, + WinLocalAccountAndAdministratorSid = 106, + WinAccountProtectedUsersSid = 107, + WinCapabilityAppointmentsSid = 108, + WinCapabilityContactsSid = 109, + WinAccountDefaultSystemManagedSid = 110, + WinBuiltinDefaultSystemManagedGroupSid = 111, + WinBuiltinStorageReplicaAdminsSid = 112, + WinAccountKeyAdminsSid = 113, + WinAccountEnterpriseKeyAdminsSid = 114, + WinAuthenticationKeyTrustSid = 115, + WinAuthenticationKeyPropertyMFASid = 116, + WinAuthenticationKeyPropertyAttestationSid = 117, + WinAuthenticationFreshKeyAuthSid = 118, +}} +pub const SYSTEM_LUID: LUID = LUID { LowPart: 0x3e7, HighPart: 0x0 }; +pub const ANONYMOUS_LOGON_LUID: LUID = LUID { LowPart: 0x3e6, HighPart: 0x0 }; +pub const LOCALSERVICE_LUID: LUID = LUID { LowPart: 0x3e5, HighPart: 0x0 }; +pub const NETWORKSERVICE_LUID: LUID = LUID { LowPart: 0x3e4, HighPart: 0x0 }; +pub const IUSER_LUID: LUID = LUID { LowPart: 0x3e3, HighPart: 0x0 }; +pub const SE_GROUP_MANDATORY: DWORD = 0x00000001; +pub const SE_GROUP_ENABLED_BY_DEFAULT: DWORD = 0x00000002; +pub const SE_GROUP_ENABLED: DWORD = 0x00000004; +pub const SE_GROUP_OWNER: DWORD = 0x00000008; +pub const SE_GROUP_USE_FOR_DENY_ONLY: DWORD = 0x00000010; +pub const SE_GROUP_INTEGRITY: DWORD = 0x00000020; +pub const SE_GROUP_INTEGRITY_ENABLED: DWORD = 0x00000040; +pub const SE_GROUP_LOGON_ID: DWORD = 0xC0000000; +pub const SE_GROUP_RESOURCE: DWORD = 0x20000000; +pub const SE_GROUP_VALID_ATTRIBUTES: DWORD = SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT + | SE_GROUP_ENABLED | SE_GROUP_OWNER | SE_GROUP_USE_FOR_DENY_ONLY | SE_GROUP_LOGON_ID + | SE_GROUP_RESOURCE | SE_GROUP_INTEGRITY | SE_GROUP_INTEGRITY_ENABLED; +pub const ACL_REVISION: BYTE = 2; +pub const ACL_REVISION_DS: BYTE = 4; +pub const ACL_REVISION1: BYTE = 1; +pub const MIN_ACL_REVISION: BYTE = ACL_REVISION2; +pub const ACL_REVISION2: BYTE = 2; +pub const ACL_REVISION3: BYTE = 3; +pub const ACL_REVISION4: BYTE = 4; +pub const MAX_ACL_REVISION: BYTE = ACL_REVISION4; +STRUCT!{struct ACL { + AclRevision: BYTE, + Sbz1: BYTE, + AclSize: WORD, + AceCount: WORD, + Sbz2: WORD, +}} +pub type PACL = *mut ACL; +STRUCT!{struct ACE_HEADER { + AceType: BYTE, + AceFlags: BYTE, + AceSize: WORD, +}} +pub type PACE_HEADER = *mut ACE_HEADER; +pub const ACCESS_MIN_MS_ACE_TYPE: BYTE = 0x0; +pub const ACCESS_ALLOWED_ACE_TYPE: BYTE = 0x0; +pub const ACCESS_DENIED_ACE_TYPE: BYTE = 0x1; +pub const SYSTEM_AUDIT_ACE_TYPE: BYTE = 0x2; +pub const SYSTEM_ALARM_ACE_TYPE: BYTE = 0x3; +pub const ACCESS_MAX_MS_V2_ACE_TYPE: BYTE = 0x3; +pub const ACCESS_ALLOWED_COMPOUND_ACE_TYPE: BYTE = 0x4; +pub const ACCESS_MAX_MS_V3_ACE_TYPE: BYTE = 0x4; +pub const ACCESS_MIN_MS_OBJECT_ACE_TYPE: BYTE = 0x5; +pub const ACCESS_ALLOWED_OBJECT_ACE_TYPE: BYTE = 0x5; +pub const ACCESS_DENIED_OBJECT_ACE_TYPE: BYTE = 0x6; +pub const SYSTEM_AUDIT_OBJECT_ACE_TYPE: BYTE = 0x7; +pub const SYSTEM_ALARM_OBJECT_ACE_TYPE: BYTE = 0x8; +pub const ACCESS_MAX_MS_OBJECT_ACE_TYPE: BYTE = 0x8; +pub const ACCESS_MAX_MS_V4_ACE_TYPE: BYTE = 0x8; +pub const ACCESS_MAX_MS_ACE_TYPE: BYTE = 0x8; +pub const ACCESS_ALLOWED_CALLBACK_ACE_TYPE: BYTE = 0x9; +pub const ACCESS_DENIED_CALLBACK_ACE_TYPE: BYTE = 0xA; +pub const ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE: BYTE = 0xB; +pub const ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE: BYTE = 0xC; +pub const SYSTEM_AUDIT_CALLBACK_ACE_TYPE: BYTE = 0xD; +pub const SYSTEM_ALARM_CALLBACK_ACE_TYPE: BYTE = 0xE; +pub const SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE: BYTE = 0xF; +pub const SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE: BYTE = 0x10; +pub const SYSTEM_MANDATORY_LABEL_ACE_TYPE: BYTE = 0x11; +pub const SYSTEM_RESOURCE_ATTRIBUTE_ACE_TYPE: BYTE = 0x12; +pub const SYSTEM_SCOPED_POLICY_ID_ACE_TYPE: BYTE = 0x13; +pub const SYSTEM_PROCESS_TRUST_LABEL_ACE_TYPE: BYTE = 0x14; +pub const SYSTEM_ACCESS_FILTER_ACE_TYPE: BYTE = 0x15; +pub const ACCESS_MAX_MS_V5_ACE_TYPE: BYTE = 0x15; +pub const OBJECT_INHERIT_ACE: BYTE = 0x1; +pub const CONTAINER_INHERIT_ACE: BYTE = 0x2; +pub const NO_PROPAGATE_INHERIT_ACE: BYTE = 0x4; +pub const INHERIT_ONLY_ACE: BYTE = 0x8; +pub const INHERITED_ACE: BYTE = 0x10; +pub const VALID_INHERIT_FLAGS: BYTE = 0x1F; +pub const SUCCESSFUL_ACCESS_ACE_FLAG: BYTE = 0x40; +pub const FAILED_ACCESS_ACE_FLAG: BYTE = 0x80; +pub const TRUST_PROTECTED_FILTER_ACE_FLAG: BYTE = 0x40; +STRUCT!{struct ACCESS_ALLOWED_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PACCESS_ALLOWED_ACE = *mut ACCESS_ALLOWED_ACE; +STRUCT!{struct ACCESS_DENIED_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PACCESS_DENIED_ACE = *mut ACCESS_DENIED_ACE; +STRUCT!{struct SYSTEM_AUDIT_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PSYSTEM_AUDIT_ACE = *mut SYSTEM_AUDIT_ACE; +STRUCT!{struct SYSTEM_ALARM_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PSYSTEM_ALARM_ACE = *mut SYSTEM_ALARM_ACE; +STRUCT!{struct SYSTEM_RESOURCE_ATTRIBUTE_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PSYSTEM_RESOURCE_ATTRIBUTE_ACE = *mut SYSTEM_RESOURCE_ATTRIBUTE_ACE; +STRUCT!{struct SYSTEM_SCOPED_POLICY_ID_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PSYSTEM_SCOPED_POLICY_ID_ACE = *mut SYSTEM_SCOPED_POLICY_ID_ACE; +STRUCT!{struct SYSTEM_MANDATORY_LABEL_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PSYSTEM_MANDATORY_LABEL_ACE = *mut SYSTEM_MANDATORY_LABEL_ACE; +STRUCT!{struct SYSTEM_PROCESS_TRUST_LABEL_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PSYSTEM_PROCESS_TRUST_LABEL_ACE = *mut SYSTEM_PROCESS_TRUST_LABEL_ACE; +STRUCT!{struct SYSTEM_ACCESS_FILTER_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PSYSTEM_ACCESS_FILTER_ACE = *mut SYSTEM_ACCESS_FILTER_ACE; +pub const SYSTEM_MANDATORY_LABEL_NO_WRITE_UP: ACCESS_MASK = 0x1; +pub const SYSTEM_MANDATORY_LABEL_NO_READ_UP: ACCESS_MASK = 0x2; +pub const SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP: ACCESS_MASK = 0x4; +pub const SYSTEM_MANDATORY_LABEL_VALID_MASK: ACCESS_MASK = SYSTEM_MANDATORY_LABEL_NO_WRITE_UP + | SYSTEM_MANDATORY_LABEL_NO_READ_UP | SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP; +pub const SYSTEM_PROCESS_TRUST_LABEL_VALID_MASK: ACCESS_MASK = 0x00ffffff; +pub const SYSTEM_PROCESS_TRUST_NOCONSTRAINT_MASK: ACCESS_MASK = 0xffffffff; +pub const SYSTEM_ACCESS_FILTER_VALID_MASK: ACCESS_MASK = 0x00ffffff; +pub const SYSTEM_ACCESS_FILTER_NOCONSTRAINT_MASK: ACCESS_MASK = 0xffffffff; +STRUCT!{struct ACCESS_ALLOWED_OBJECT_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + Flags: DWORD, + ObjectType: GUID, + InheritedObjectType: GUID, + SidStart: DWORD, +}} +pub type PACCESS_ALLOWED_OBJECT_ACE = *mut ACCESS_ALLOWED_OBJECT_ACE; +STRUCT!{struct ACCESS_DENIED_OBJECT_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + Flags: DWORD, + ObjectType: GUID, + InheritedObjectType: GUID, + SidStart: DWORD, +}} +pub type PACCESS_DENIED_OBJECT_ACE = *mut ACCESS_DENIED_OBJECT_ACE; +STRUCT!{struct SYSTEM_AUDIT_OBJECT_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + Flags: DWORD, + ObjectType: GUID, + InheritedObjectType: GUID, + SidStart: DWORD, +}} +pub type PSYSTEM_AUDIT_OBJECT_ACE = *mut SYSTEM_AUDIT_OBJECT_ACE; +STRUCT!{struct SYSTEM_ALARM_OBJECT_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + Flags: DWORD, + ObjectType: GUID, + InheritedObjectType: GUID, + SidStart: DWORD, +}} +pub type PSYSTEM_ALARM_OBJECT_ACE = *mut SYSTEM_ALARM_OBJECT_ACE; +STRUCT!{struct ACCESS_ALLOWED_CALLBACK_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PACCESS_ALLOWED_CALLBACK_ACE = *mut ACCESS_ALLOWED_CALLBACK_ACE; +STRUCT!{struct ACCESS_DENIED_CALLBACK_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PACCESS_DENIED_CALLBACK_ACE = *mut ACCESS_DENIED_CALLBACK_ACE; +STRUCT!{struct SYSTEM_AUDIT_CALLBACK_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PSYSTEM_AUDIT_CALLBACK_ACE = *mut SYSTEM_AUDIT_CALLBACK_ACE; +STRUCT!{struct SYSTEM_ALARM_CALLBACK_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + SidStart: DWORD, +}} +pub type PSYSTEM_ALARM_CALLBACK_ACE = *mut SYSTEM_ALARM_CALLBACK_ACE; +STRUCT!{struct ACCESS_ALLOWED_CALLBACK_OBJECT_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + Flags: DWORD, + ObjectType: GUID, + InheritedObjectType: GUID, + SidStart: DWORD, +}} +pub type PACCESS_ALLOWED_CALLBACK_OBJECT_ACE = *mut ACCESS_ALLOWED_CALLBACK_OBJECT_ACE; +STRUCT!{struct ACCESS_DENIED_CALLBACK_OBJECT_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + Flags: DWORD, + ObjectType: GUID, + InheritedObjectType: GUID, + SidStart: DWORD, +}} +pub type PACCESS_DENIED_CALLBACK_OBJECT_ACE = *mut ACCESS_DENIED_CALLBACK_OBJECT_ACE; +STRUCT!{struct SYSTEM_AUDIT_CALLBACK_OBJECT_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + Flags: DWORD, + ObjectType: GUID, + InheritedObjectType: GUID, + SidStart: DWORD, +}} +pub type PSYSTEM_AUDIT_CALLBACK_OBJECT_ACE = *mut SYSTEM_AUDIT_CALLBACK_OBJECT_ACE; +STRUCT!{struct SYSTEM_ALARM_CALLBACK_OBJECT_ACE { + Header: ACE_HEADER, + Mask: ACCESS_MASK, + Flags: DWORD, + ObjectType: GUID, + InheritedObjectType: GUID, + SidStart: DWORD, +}} +pub type PSYSTEM_ALARM_CALLBACK_OBJECT_ACE = *mut SYSTEM_ALARM_CALLBACK_OBJECT_ACE; +pub const ACE_OBJECT_TYPE_PRESENT: DWORD = 0x1; +pub const ACE_INHERITED_OBJECT_TYPE_PRESENT: DWORD = 0x2; +ENUM!{enum ACL_INFORMATION_CLASS { + AclRevisionInformation = 1, + AclSizeInformation, +}} +STRUCT!{struct ACL_REVISION_INFORMATION { + AclRevision: DWORD, +}} +pub type PACL_REVISION_INFORMATION = *mut ACL_REVISION_INFORMATION; +STRUCT!{struct ACL_SIZE_INFORMATION { + AceCount: DWORD, + AclBytesInUse: DWORD, + AclBytesFree: DWORD, +}} +pub type PACL_SIZE_INFORMATION = *mut ACL_SIZE_INFORMATION; +pub const SECURITY_DESCRIPTOR_REVISION: DWORD = 1; +pub const SECURITY_DESCRIPTOR_REVISION1: DWORD = 1; +#[cfg(target_pointer_width = "64")] +pub const SECURITY_DESCRIPTOR_MIN_LENGTH: usize = 40; +#[cfg(target_pointer_width = "32")] +pub const SECURITY_DESCRIPTOR_MIN_LENGTH: usize = 20; +pub type SECURITY_DESCRIPTOR_CONTROL = WORD; +pub type PSECURITY_DESCRIPTOR_CONTROL = *mut WORD; +pub const SE_OWNER_DEFAULTED: SECURITY_DESCRIPTOR_CONTROL = 0x0001; +pub const SE_GROUP_DEFAULTED: SECURITY_DESCRIPTOR_CONTROL = 0x0002; +pub const SE_DACL_PRESENT: SECURITY_DESCRIPTOR_CONTROL = 0x0004; +pub const SE_DACL_DEFAULTED: SECURITY_DESCRIPTOR_CONTROL = 0x0008; +pub const SE_SACL_PRESENT: SECURITY_DESCRIPTOR_CONTROL = 0x0010; +pub const SE_SACL_DEFAULTED: SECURITY_DESCRIPTOR_CONTROL = 0x0020; +pub const SE_DACL_AUTO_INHERIT_REQ: SECURITY_DESCRIPTOR_CONTROL = 0x0100; +pub const SE_SACL_AUTO_INHERIT_REQ: SECURITY_DESCRIPTOR_CONTROL = 0x0200; +pub const SE_DACL_AUTO_INHERITED: SECURITY_DESCRIPTOR_CONTROL = 0x0400; +pub const SE_SACL_AUTO_INHERITED: SECURITY_DESCRIPTOR_CONTROL = 0x0800; +pub const SE_DACL_PROTECTED: SECURITY_DESCRIPTOR_CONTROL = 0x1000; +pub const SE_SACL_PROTECTED: SECURITY_DESCRIPTOR_CONTROL = 0x2000; +pub const SE_RM_CONTROL_VALID: SECURITY_DESCRIPTOR_CONTROL = 0x4000; +pub const SE_SELF_RELATIVE: SECURITY_DESCRIPTOR_CONTROL = 0x8000; +STRUCT!{struct SECURITY_DESCRIPTOR_RELATIVE { + Revision: BYTE, + Sbz1: BYTE, + Control: SECURITY_DESCRIPTOR_CONTROL, + Owner: DWORD, + Group: DWORD, + Sacl: DWORD, + Dacl: DWORD, +}} +pub type PISECURITY_DESCRIPTOR_RELATIVE = *mut SECURITY_DESCRIPTOR_RELATIVE; +STRUCT!{struct SECURITY_DESCRIPTOR { + Revision: BYTE, + Sbz1: BYTE, + Control: SECURITY_DESCRIPTOR_CONTROL, + Owner: PSID, + Group: PSID, + Sacl: PACL, + Dacl: PACL, +}} +pub type PISECURITY_DESCRIPTOR = *mut SECURITY_DESCRIPTOR; +STRUCT!{struct SECURITY_OBJECT_AI_PARAMS { + Size: DWORD, + ConstraintMask: DWORD, +}} +pub type PSECURITY_OBJECT_AI_PARAMS = *mut SECURITY_OBJECT_AI_PARAMS; +STRUCT!{struct OBJECT_TYPE_LIST { + Level: WORD, + Sbz: WORD, + ObjectType: *mut GUID, +}} +pub type POBJECT_TYPE_LIST = *mut OBJECT_TYPE_LIST; +pub const ACCESS_OBJECT_GUID: WORD = 0; +pub const ACCESS_PROPERTY_SET_GUID: WORD = 1; +pub const ACCESS_PROPERTY_GUID: WORD = 2; +pub const ACCESS_MAX_LEVEL: WORD = 4; +ENUM!{enum AUDIT_EVENT_TYPE { + AuditEventObjectAccess, + AuditEventDirectoryServiceAccess, +}} +pub const AUDIT_ALLOW_NO_PRIVILEGE: DWORD = 0x1; +pub const ACCESS_DS_SOURCE: &'static str = "DS"; +pub const ACCESS_DS_OBJECT_TYPE_NAME: &'static str = "Directory Service Object"; +pub const SE_PRIVILEGE_ENABLED_BY_DEFAULT: DWORD = 0x00000001; +pub const SE_PRIVILEGE_ENABLED: DWORD = 0x00000002; +pub const SE_PRIVILEGE_REMOVED: DWORD = 0x00000004; +pub const SE_PRIVILEGE_USED_FOR_ACCESS: DWORD = 0x80000000; +pub const SE_PRIVILEGE_VALID_ATTRIBUTES: DWORD = SE_PRIVILEGE_ENABLED_BY_DEFAULT + | SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_REMOVED | SE_PRIVILEGE_USED_FOR_ACCESS; +pub const PRIVILEGE_SET_ALL_NECESSARY: DWORD = 1; +STRUCT!{struct PRIVILEGE_SET { + PrivilegeCount: DWORD, + Control: DWORD, + Privilege: [LUID_AND_ATTRIBUTES; ANYSIZE_ARRAY], +}} +pub type PPRIVILEGE_SET = *mut PRIVILEGE_SET; +pub const ACCESS_REASON_TYPE_MASK: ACCESS_REASON = 0x00ff0000; +pub const ACCESS_REASON_DATA_MASK: ACCESS_REASON = 0x0000ffff; +pub const ACCESS_REASON_STAGING_MASK: ACCESS_REASON = 0x80000000; +pub const ACCESS_REASON_EXDATA_MASK: ACCESS_REASON = 0x7f000000; +ENUM!{enum ACCESS_REASON_TYPE { + AccessReasonNone = 0x00000000, + AccessReasonAllowedAce = 0x00010000, + AccessReasonDeniedAce = 0x00020000, + AccessReasonAllowedParentAce = 0x00030000, + AccessReasonDeniedParentAce = 0x00040000, + AccessReasonNotGrantedByCape = 0x00050000, + AccessReasonNotGrantedByParentCape = 0x00060000, + AccessReasonNotGrantedToAppContainer = 0x00070000, + AccessReasonMissingPrivilege = 0x00100000, + AccessReasonFromPrivilege = 0x00200000, + AccessReasonIntegrityLevel = 0x00300000, + AccessReasonOwnership = 0x00400000, + AccessReasonNullDacl = 0x00500000, + AccessReasonEmptyDacl = 0x00600000, + AccessReasonNoSD = 0x00700000, + AccessReasonNoGrant = 0x00800000, + AccessReasonTrustLabel = 0x00900000, + AccessReasonFilterAce = 0x00a00000, +}} +pub type ACCESS_REASON = DWORD; +STRUCT!{struct ACCESS_REASONS { + Data: [ACCESS_REASON; 32], +}} +pub type PACCESS_REASONS = *mut ACCESS_REASONS; +pub const SE_SECURITY_DESCRIPTOR_FLAG_NO_OWNER_ACE: DWORD = 0x00000001; +pub const SE_SECURITY_DESCRIPTOR_FLAG_NO_LABEL_ACE: DWORD = 0x00000002; +pub const SE_SECURITY_DESCRIPTOR_FLAG_NO_ACCESS_FILTER_ACE: DWORD = 0x00000004; +pub const SE_SECURITY_DESCRIPTOR_VALID_FLAGS: DWORD = 0x00000007; +STRUCT!{struct SE_SECURITY_DESCRIPTOR { + Size: DWORD, + Flags: DWORD, + SecurityDescriptor: PSECURITY_DESCRIPTOR, +}} +pub type PSE_SECURITY_DESCRIPTOR = *mut SE_SECURITY_DESCRIPTOR; +STRUCT!{struct SE_ACCESS_REQUEST { + Size: DWORD, + SeSecurityDescriptor: PSE_SECURITY_DESCRIPTOR, + DesiredAccess: ACCESS_MASK, + PreviouslyGrantedAccess: ACCESS_MASK, + PrincipalSelfSid: PSID, + GenericMapping: PGENERIC_MAPPING, + ObjectTypeListCount: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, +}} +pub type PSE_ACCESS_REQUEST = *mut SE_ACCESS_REQUEST; +STRUCT!{struct SE_ACCESS_REPLY { + Size: DWORD, + ResultListCount: DWORD, + GrantedAccess: PACCESS_MASK, + AccessStatus: PDWORD, + AccessReason: PACCESS_REASONS, + Privileges: *mut PPRIVILEGE_SET, +}} +pub type PSE_ACCESS_REPLY = *mut SE_ACCESS_REPLY; +pub const SE_CREATE_TOKEN_NAME: &'static str = "SeCreateTokenPrivilege"; +pub const SE_ASSIGNPRIMARYTOKEN_NAME: &'static str = "SeAssignPrimaryTokenPrivilege"; +pub const SE_LOCK_MEMORY_NAME: &'static str = "SeLockMemoryPrivilege"; +pub const SE_INCREASE_QUOTA_NAME: &'static str = "SeIncreaseQuotaPrivilege"; +pub const SE_UNSOLICITED_INPUT_NAME: &'static str = "SeUnsolicitedInputPrivilege"; +pub const SE_MACHINE_ACCOUNT_NAME: &'static str = "SeMachineAccountPrivilege"; +pub const SE_TCB_NAME: &'static str = "SeTcbPrivilege"; +pub const SE_SECURITY_NAME: &'static str = "SeSecurityPrivilege"; +pub const SE_TAKE_OWNERSHIP_NAME: &'static str = "SeTakeOwnershipPrivilege"; +pub const SE_LOAD_DRIVER_NAME: &'static str = "SeLoadDriverPrivilege"; +pub const SE_SYSTEM_PROFILE_NAME: &'static str = "SeSystemProfilePrivilege"; +pub const SE_SYSTEMTIME_NAME: &'static str = "SeSystemtimePrivilege"; +pub const SE_PROF_SINGLE_PROCESS_NAME: &'static str = "SeProfileSingleProcessPrivilege"; +pub const SE_INC_BASE_PRIORITY_NAME: &'static str = "SeIncreaseBasePriorityPrivilege"; +pub const SE_CREATE_PAGEFILE_NAME: &'static str = "SeCreatePagefilePrivilege"; +pub const SE_CREATE_PERMANENT_NAME: &'static str = "SeCreatePermanentPrivilege"; +pub const SE_BACKUP_NAME: &'static str = "SeBackupPrivilege"; +pub const SE_RESTORE_NAME: &'static str = "SeRestorePrivilege"; +pub const SE_SHUTDOWN_NAME: &'static str = "SeShutdownPrivilege"; +pub const SE_DEBUG_NAME: &'static str = "SeDebugPrivilege"; +pub const SE_AUDIT_NAME: &'static str = "SeAuditPrivilege"; +pub const SE_SYSTEM_ENVIRONMENT_NAME: &'static str = "SeSystemEnvironmentPrivilege"; +pub const SE_CHANGE_NOTIFY_NAME: &'static str = "SeChangeNotifyPrivilege"; +pub const SE_REMOTE_SHUTDOWN_NAME: &'static str = "SeRemoteShutdownPrivilege"; +pub const SE_UNDOCK_NAME: &'static str = "SeUndockPrivilege"; +pub const SE_SYNC_AGENT_NAME: &'static str = "SeSyncAgentPrivilege"; +pub const SE_ENABLE_DELEGATION_NAME: &'static str = "SeEnableDelegationPrivilege"; +pub const SE_MANAGE_VOLUME_NAME: &'static str = "SeManageVolumePrivilege"; +pub const SE_IMPERSONATE_NAME: &'static str = "SeImpersonatePrivilege"; +pub const SE_CREATE_GLOBAL_NAME: &'static str = "SeCreateGlobalPrivilege"; +pub const SE_TRUSTED_CREDMAN_ACCESS_NAME: &'static str = "SeTrustedCredManAccessPrivilege"; +pub const SE_RELABEL_NAME: &'static str = "SeRelabelPrivilege"; +pub const SE_INC_WORKING_SET_NAME: &'static str = "SeIncreaseWorkingSetPrivilege"; +pub const SE_TIME_ZONE_NAME: &'static str = "SeTimeZonePrivilege"; +pub const SE_CREATE_SYMBOLIC_LINK_NAME: &'static str = "SeCreateSymbolicLinkPrivilege"; +pub const SE_DELEGATE_SESSION_USER_IMPERSONATE_NAME: &'static str + = "SeDelegateSessionUserImpersonatePrivilege"; +pub const SE_ACTIVATE_AS_USER_CAPABILITY: &'static str = "activateAsUser"; +pub const SE_CONSTRAINED_IMPERSONATION_CAPABILITY: &'static str = "constrainedImpersonation"; +pub const SE_SESSION_IMPERSONATION_CAPABILITY: &'static str = "sessionImpersonation"; +pub const SE_MUMA_CAPABILITY: &'static str = "muma"; +pub const SE_DEVELOPMENT_MODE_NETWORK_CAPABILITY: &'static str = "developmentModeNetwork"; +ENUM!{enum SECURITY_IMPERSONATION_LEVEL { + SecurityAnonymous, + SecurityIdentification, + SecurityImpersonation, + SecurityDelegation, +}} +pub type PSECURITY_IMPERSONATION_LEVEL = *mut SECURITY_IMPERSONATION_LEVEL; +pub const SECURITY_MAX_IMPERSONATION_LEVEL: SECURITY_IMPERSONATION_LEVEL = SecurityDelegation; +pub const SECURITY_MIN_IMPERSONATION_LEVEL: SECURITY_IMPERSONATION_LEVEL = SecurityAnonymous; +pub const DEFAULT_IMPERSONATION_LEVEL: SECURITY_IMPERSONATION_LEVEL = SecurityImpersonation; +#[inline] +pub fn VALID_IMPERSONATION_LEVEL(L: SECURITY_IMPERSONATION_LEVEL) -> bool { + (L >= SECURITY_MIN_IMPERSONATION_LEVEL) && (L <= SECURITY_MAX_IMPERSONATION_LEVEL) +} +pub const TOKEN_ASSIGN_PRIMARY: DWORD = 0x0001; +pub const TOKEN_DUPLICATE: DWORD = 0x0002; +pub const TOKEN_IMPERSONATE: DWORD = 0x0004; +pub const TOKEN_QUERY: DWORD = 0x0008; +pub const TOKEN_QUERY_SOURCE: DWORD = 0x0010; +pub const TOKEN_ADJUST_PRIVILEGES: DWORD = 0x0020; +pub const TOKEN_ADJUST_GROUPS: DWORD = 0x0040; +pub const TOKEN_ADJUST_DEFAULT: DWORD = 0x0080; +pub const TOKEN_ADJUST_SESSIONID: DWORD = 0x0100; +pub const TOKEN_ALL_ACCESS_P: DWORD = STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY + | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE + | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT; +pub const TOKEN_ALL_ACCESS: DWORD = TOKEN_ALL_ACCESS_P | TOKEN_ADJUST_SESSIONID; +pub const TOKEN_READ: DWORD = STANDARD_RIGHTS_READ | TOKEN_QUERY; +pub const TOKEN_WRITE: DWORD = STANDARD_RIGHTS_WRITE | TOKEN_ADJUST_PRIVILEGES + | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT; +pub const TOKEN_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE; +pub const TOKEN_TRUST_CONSTRAINT_MASK: DWORD = STANDARD_RIGHTS_READ | TOKEN_QUERY + | TOKEN_QUERY_SOURCE; +pub const TOKEN_ACCESS_PSEUDO_HANDLE_WIN8: DWORD = TOKEN_QUERY | TOKEN_QUERY_SOURCE; +pub const TOKEN_ACCESS_PSEUDO_HANDLE: DWORD = TOKEN_ACCESS_PSEUDO_HANDLE_WIN8; +ENUM!{enum TOKEN_TYPE { + TokenPrimary = 1, + TokenImpersonation, +}} +pub type PTOKEN_TYPE = *mut TOKEN_TYPE; +ENUM!{enum TOKEN_ELEVATION_TYPE { + TokenElevationTypeDefault = 1, + TokenElevationTypeFull, + TokenElevationTypeLimited, +}} +pub type PTOKEN_ELEVATION_TYPE = *mut TOKEN_ELEVATION_TYPE; +ENUM!{enum TOKEN_INFORMATION_CLASS { + TokenUser = 1, + TokenGroups, + TokenPrivileges, + TokenOwner, + TokenPrimaryGroup, + TokenDefaultDacl, + TokenSource, + TokenType, + TokenImpersonationLevel, + TokenStatistics, + TokenRestrictedSids, + TokenSessionId, + TokenGroupsAndPrivileges, + TokenSessionReference, + TokenSandBoxInert, + TokenAuditPolicy, + TokenOrigin, + TokenElevationType, + TokenLinkedToken, + TokenElevation, + TokenHasRestrictions, + TokenAccessInformation, + TokenVirtualizationAllowed, + TokenVirtualizationEnabled, + TokenIntegrityLevel, + TokenUIAccess, + TokenMandatoryPolicy, + TokenLogonSid, + TokenIsAppContainer, + TokenCapabilities, + TokenAppContainerSid, + TokenAppContainerNumber, + TokenUserClaimAttributes, + TokenDeviceClaimAttributes, + TokenRestrictedUserClaimAttributes, + TokenRestrictedDeviceClaimAttributes, + TokenDeviceGroups, + TokenRestrictedDeviceGroups, + TokenSecurityAttributes, + TokenIsRestricted, + TokenProcessTrustLevel, + TokenPrivateNameSpace, + TokenSingletonAttributes, + TokenBnoIsolation, + MaxTokenInfoClass, +}} +pub type PTOKEN_INFORMATION_CLASS = *mut TOKEN_INFORMATION_CLASS; +STRUCT!{struct TOKEN_USER { + User: SID_AND_ATTRIBUTES, +}} +pub type PTOKEN_USER = *mut TOKEN_USER; +UNION!{union SE_TOKEN_USER_u1 { + [usize; 2], + TokenUser TokenUser_mut: TOKEN_USER, + User User_mut: SID_AND_ATTRIBUTES, +}} +UNION!{union SE_TOKEN_USER_u2 { + [u32; 17], + Sid Sid_mut: SID, + Buffer Buffer_mut: [BYTE; SECURITY_MAX_SID_SIZE], +}} +STRUCT!{struct SE_TOKEN_USER { + u1: SE_TOKEN_USER_u1, + u2: SE_TOKEN_USER_u2, +}} +pub type PSE_TOKEN_USER = *mut SE_TOKEN_USER; +STRUCT!{struct TOKEN_GROUPS { + GroupCount: DWORD, + Groups: [SID_AND_ATTRIBUTES; ANYSIZE_ARRAY], +}} +pub type PTOKEN_GROUPS = *mut TOKEN_GROUPS; +STRUCT!{struct TOKEN_PRIVILEGES { + PrivilegeCount: DWORD, + Privileges: [LUID_AND_ATTRIBUTES; ANYSIZE_ARRAY], +}} +pub type PTOKEN_PRIVILEGES = *mut TOKEN_PRIVILEGES; +STRUCT!{struct TOKEN_OWNER { + Owner: PSID, +}} +pub type PTOKEN_OWNER = *mut TOKEN_OWNER; +STRUCT!{struct TOKEN_PRIMARY_GROUP { + PrimaryGroup: PSID, +}} +pub type PTOKEN_PRIMARY_GROUP = *mut TOKEN_PRIMARY_GROUP; +STRUCT!{struct TOKEN_DEFAULT_DACL { + DefaultDacl: PACL, +}} +pub type PTOKEN_DEFAULT_DACL = *mut TOKEN_DEFAULT_DACL; +STRUCT!{struct TOKEN_USER_CLAIMS { + UserClaims: PCLAIMS_BLOB, +}} +pub type PTOKEN_USER_CLAIMS = *mut TOKEN_USER_CLAIMS; +STRUCT!{struct TOKEN_DEVICE_CLAIMS { + DeviceClaims: PCLAIMS_BLOB, +}} +pub type PTOKEN_DEVICE_CLAIMS = *mut TOKEN_DEVICE_CLAIMS; +STRUCT!{struct TOKEN_GROUPS_AND_PRIVILEGES { + SidCount: DWORD, + SidLength: DWORD, + Sids: PSID_AND_ATTRIBUTES, + RestrictedSidCount: DWORD, + RestrictedSidLength: DWORD, + RestrictedSids: PSID_AND_ATTRIBUTES, + PrivilegeCount: DWORD, + PrivilegeLength: DWORD, + Privileges: PLUID_AND_ATTRIBUTES, + AuthenticationId: LUID, +}} +pub type PTOKEN_GROUPS_AND_PRIVILEGES = *mut TOKEN_GROUPS_AND_PRIVILEGES; +STRUCT!{struct TOKEN_LINKED_TOKEN { + LinkedToken: HANDLE, +}} +pub type PTOKEN_LINKED_TOKEN = *mut TOKEN_LINKED_TOKEN; +STRUCT!{struct TOKEN_ELEVATION { + TokenIsElevated: DWORD, +}} +pub type PTOKEN_ELEVATION = *mut TOKEN_ELEVATION; +STRUCT!{struct TOKEN_MANDATORY_LABEL { + Label: SID_AND_ATTRIBUTES, +}} +pub type PTOKEN_MANDATORY_LABEL = *mut TOKEN_MANDATORY_LABEL; +pub const TOKEN_MANDATORY_POLICY_OFF: DWORD = 0x0; +pub const TOKEN_MANDATORY_POLICY_NO_WRITE_UP: DWORD = 0x1; +pub const TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN: DWORD = 0x2; +pub const TOKEN_MANDATORY_POLICY_VALID_MASK: DWORD = TOKEN_MANDATORY_POLICY_NO_WRITE_UP + | TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN; +STRUCT!{struct TOKEN_MANDATORY_POLICY { + Policy: DWORD, +}} +pub type PTOKEN_MANDATORY_POLICY = *mut TOKEN_MANDATORY_POLICY; +pub type PSECURITY_ATTRIBUTES_OPAQUE = PVOID; +STRUCT!{struct TOKEN_ACCESS_INFORMATION { + SidHash: PSID_AND_ATTRIBUTES_HASH, + RestrictedSidHash: PSID_AND_ATTRIBUTES_HASH, + Privileges: PTOKEN_PRIVILEGES, + AuthenticationId: LUID, + TokenType: TOKEN_TYPE, + ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + MandatoryPolicy: TOKEN_MANDATORY_POLICY, + Flags: DWORD, + AppContainerNumber: DWORD, + PackageSid: PSID, + CapabilitiesHash: PSID_AND_ATTRIBUTES_HASH, + TrustLevelSid: PSID, + SecurityAttributes: PSECURITY_ATTRIBUTES_OPAQUE, +}} +pub type PTOKEN_ACCESS_INFORMATION = *mut TOKEN_ACCESS_INFORMATION; +pub const POLICY_AUDIT_SUBCATEGORY_COUNT: usize = 59; +STRUCT!{struct TOKEN_AUDIT_POLICY { + PerUserPolicy: [BYTE; (POLICY_AUDIT_SUBCATEGORY_COUNT >> 1) + 1], +}} +pub type PTOKEN_AUDIT_POLICY = *mut TOKEN_AUDIT_POLICY; +pub const TOKEN_SOURCE_LENGTH: usize = 8; +STRUCT!{struct TOKEN_SOURCE { + SourceName: [CHAR; TOKEN_SOURCE_LENGTH], + SourceIdentifier: LUID, +}} +pub type PTOKEN_SOURCE = *mut TOKEN_SOURCE; +STRUCT!{struct TOKEN_STATISTICS { + TokenId: LUID, + AuthenticationId: LUID, + ExpirationTime: LARGE_INTEGER, + TokenType: TOKEN_TYPE, + ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + DynamicCharged: DWORD, + DynamicAvailable: DWORD, + GroupCount: DWORD, + PrivilegeCount: DWORD, + ModifiedId: LUID, +}} +pub type PTOKEN_STATISTICS = *mut TOKEN_STATISTICS; +STRUCT!{struct TOKEN_CONTROL { + TokenId: LUID, + AuthenticationId: LUID, + ModifiedId: LUID, + TokenSource: TOKEN_SOURCE, +}} +pub type PTOKEN_CONTROL = *mut TOKEN_CONTROL; +STRUCT!{struct TOKEN_ORIGIN { + OriginatingLogonSession: LUID, +}} +pub type PTOKEN_ORIGIN = *mut TOKEN_ORIGIN; +ENUM!{enum MANDATORY_LEVEL { + MandatoryLevelUntrusted = 0, + MandatoryLevelLow, + MandatoryLevelMedium, + MandatoryLevelHigh, + MandatoryLevelSystem, + MandatoryLevelSecureProcess, + MandatoryLevelCount, +}} +pub type PMANDATORY_LEVEL = *mut MANDATORY_LEVEL; +STRUCT!{struct TOKEN_APPCONTAINER_INFORMATION { + TokenAppContainer: PSID, +}} +pub type PTOKEN_APPCONTAINER_INFORMATION = *mut TOKEN_APPCONTAINER_INFORMATION; +STRUCT!{struct TOKEN_SID_INFORMATION { + Sid: PSID, +}} +pub type PTOKEN_SID_INFORMATION = *mut TOKEN_SID_INFORMATION; +STRUCT!{struct TOKEN_BNO_ISOLATION_INFORMATION { + IsolationPrefix: PWSTR, + IsolationEnabled: BOOLEAN, +}} +pub type PTOKEN_BNO_ISOLATION_INFORMATION = *mut TOKEN_BNO_ISOLATION_INFORMATION; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_INVALID: WORD = 0x00; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64: WORD = 0x01; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64: WORD = 0x02; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING: WORD = 0x03; +STRUCT!{struct CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE { + Version: DWORD64, + Name: PWSTR, +}} +pub type PCLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE = *mut CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_FQBN: WORD = 0x04; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_SID: WORD = 0x05; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN: WORD = 0x06; +STRUCT!{struct CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE { + pValue: PVOID, + ValueLength: DWORD, +}} +pub type PCLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE = + *mut CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING: WORD = 0x10; +pub const CLAIM_SECURITY_ATTRIBUTE_NON_INHERITABLE: DWORD = 0x0001; +pub const CLAIM_SECURITY_ATTRIBUTE_VALUE_CASE_SENSITIVE: DWORD = 0x0002; +pub const CLAIM_SECURITY_ATTRIBUTE_USE_FOR_DENY_ONLY: DWORD = 0x0004; +pub const CLAIM_SECURITY_ATTRIBUTE_DISABLED_BY_DEFAULT: DWORD = 0x0008; +pub const CLAIM_SECURITY_ATTRIBUTE_DISABLED: DWORD = 0x0010; +pub const CLAIM_SECURITY_ATTRIBUTE_MANDATORY: DWORD = 0x0020; +pub const CLAIM_SECURITY_ATTRIBUTE_VALID_FLAGS: DWORD = CLAIM_SECURITY_ATTRIBUTE_NON_INHERITABLE + | CLAIM_SECURITY_ATTRIBUTE_VALUE_CASE_SENSITIVE | CLAIM_SECURITY_ATTRIBUTE_USE_FOR_DENY_ONLY + | CLAIM_SECURITY_ATTRIBUTE_DISABLED_BY_DEFAULT | CLAIM_SECURITY_ATTRIBUTE_DISABLED + | CLAIM_SECURITY_ATTRIBUTE_MANDATORY; +pub const CLAIM_SECURITY_ATTRIBUTE_CUSTOM_FLAGS: DWORD = 0xFFFF0000; +UNION!{union CLAIM_SECURITY_ATTRIBUTE_V1_Values { + [usize; 1], + pInt64 pInt64_mut: PLONG64, + pUint64 pUint64_mut: PDWORD64, + ppString ppString_mut: PWSTR, + pFqbn pFqbn_mut: PCLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE, + pOctetString pOctetString_mut: PCLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE, +}} +STRUCT!{struct CLAIM_SECURITY_ATTRIBUTE_V1 { + Name: PWSTR, + ValueType: WORD, + Reserved: WORD, + Flags: DWORD, + ValueCount: DWORD, + Values: CLAIM_SECURITY_ATTRIBUTE_V1_Values, +}} +pub type PCLAIM_SECURITY_ATTRIBUTE_V1 = *mut CLAIM_SECURITY_ATTRIBUTE_V1; +UNION!{union CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Values { + [u32; 1], + pInt64 pInt64_mut: [DWORD; ANYSIZE_ARRAY], + pUint64 pUint64_mut: [DWORD; ANYSIZE_ARRAY], + ppString ppString_mut: [DWORD; ANYSIZE_ARRAY], + pFqbn pFqbn_mut: [DWORD; ANYSIZE_ARRAY], + pOctetString pOctetString_mut: [DWORD; ANYSIZE_ARRAY], +}} +STRUCT!{struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 { + Name: DWORD, + ValueType: WORD, + Reserved: WORD, + Flags: DWORD, + ValueCount: DWORD, + Values: CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1_Values, +}} +pub type PCLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 = *mut CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1; +pub const CLAIM_SECURITY_ATTRIBUTES_INFORMATION_VERSION_V1: WORD = 1; +pub const CLAIM_SECURITY_ATTRIBUTES_INFORMATION_VERSION: WORD = + CLAIM_SECURITY_ATTRIBUTES_INFORMATION_VERSION_V1; +UNION!{union CLAIM_SECURITY_ATTRIBUTES_INFORMATION_Attribute { + [usize; 1], + pAttributeV1 pAttributeV1_mut: PCLAIM_SECURITY_ATTRIBUTE_V1, +}} +STRUCT!{struct CLAIM_SECURITY_ATTRIBUTES_INFORMATION { + Version: WORD, + Reserved: WORD, + AttributeCount: DWORD, + Attribute: CLAIM_SECURITY_ATTRIBUTES_INFORMATION_Attribute, +}} +pub type PCLAIM_SECURITY_ATTRIBUTES_INFORMATION = *mut CLAIM_SECURITY_ATTRIBUTES_INFORMATION; +pub const SECURITY_DYNAMIC_TRACKING: BOOLEAN = TRUE as u8; +pub const SECURITY_STATIC_TRACKING: BOOLEAN = FALSE as u8; +pub type SECURITY_CONTEXT_TRACKING_MODE = BOOLEAN; +pub type PSECURITY_CONTEXT_TRACKING_MODE = *mut BOOLEAN; +STRUCT!{struct SECURITY_QUALITY_OF_SERVICE { + Length: DWORD, + ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + ContextTrackingMode: SECURITY_CONTEXT_TRACKING_MODE, + EffectiveOnly: BOOLEAN, +}} +pub type PSECURITY_QUALITY_OF_SERVICE = *mut SECURITY_QUALITY_OF_SERVICE; +STRUCT!{struct SE_IMPERSONATION_STATE { + Token: PACCESS_TOKEN, + CopyOnOpen: BOOLEAN, + EffectiveOnly: BOOLEAN, + Level: SECURITY_IMPERSONATION_LEVEL, +}} +pub type PSE_IMPERSONATION_STATE = *mut SE_IMPERSONATION_STATE; +pub const DISABLE_MAX_PRIVILEGE: DWORD = 0x1; +pub const SANDBOX_INERT: DWORD = 0x2; +pub const LUA_TOKEN: DWORD = 0x4; +pub const WRITE_RESTRICTED: DWORD = 0x8; +pub type SECURITY_INFORMATION = DWORD; +pub type PSECURITY_INFORMATION = *mut DWORD; +pub const OWNER_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000001; +pub const GROUP_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000002; +pub const DACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000004; +pub const SACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000008; +pub const LABEL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000010; +pub const ATTRIBUTE_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000020; +pub const SCOPE_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000040; +pub const PROCESS_TRUST_LABEL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000080; +pub const ACCESS_FILTER_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00000100; +pub const BACKUP_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x00010000; +pub const PROTECTED_DACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x80000000; +pub const PROTECTED_SACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x40000000; +pub const UNPROTECTED_DACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x20000000; +pub const UNPROTECTED_SACL_SECURITY_INFORMATION: SECURITY_INFORMATION = 0x10000000; +pub type SE_SIGNING_LEVEL = BYTE; +pub type PSE_SIGNING_LEVEL = *mut BYTE; +pub const SE_SIGNING_LEVEL_UNCHECKED: BYTE = 0x00000000; +pub const SE_SIGNING_LEVEL_UNSIGNED: BYTE = 0x00000001; +pub const SE_SIGNING_LEVEL_ENTERPRISE: BYTE = 0x00000002; +pub const SE_SIGNING_LEVEL_CUSTOM_1: BYTE = 0x00000003; +pub const SE_SIGNING_LEVEL_AUTHENTICODE: BYTE = 0x00000004; +pub const SE_SIGNING_LEVEL_CUSTOM_2: BYTE = 0x00000005; +pub const SE_SIGNING_LEVEL_STORE: BYTE = 0x00000006; +pub const SE_SIGNING_LEVEL_CUSTOM_3: BYTE = 0x00000007; +pub const SE_SIGNING_LEVEL_ANTIMALWARE: BYTE = SE_SIGNING_LEVEL_CUSTOM_3; +pub const SE_SIGNING_LEVEL_MICROSOFT: BYTE = 0x00000008; +pub const SE_SIGNING_LEVEL_CUSTOM_4: BYTE = 0x00000009; +pub const SE_SIGNING_LEVEL_CUSTOM_5: BYTE = 0x0000000A; +pub const SE_SIGNING_LEVEL_DYNAMIC_CODEGEN: BYTE = 0x0000000B; +pub const SE_SIGNING_LEVEL_WINDOWS: BYTE = 0x0000000C; +pub const SE_SIGNING_LEVEL_CUSTOM_7: BYTE = 0x0000000D; +pub const SE_SIGNING_LEVEL_WINDOWS_TCB: BYTE = 0x0000000E; +pub const SE_SIGNING_LEVEL_CUSTOM_6: BYTE = 0x0000000F; +ENUM!{enum SE_IMAGE_SIGNATURE_TYPE { + SeImageSignatureNone = 0, + SeImageSignatureEmbedded, + SeImageSignatureCache, + SeImageSignatureCatalogCached, + SeImageSignatureCatalogNotCached, + SeImageSignatureCatalogHint, + SeImageSignaturePackageCatalog, +}} +pub type PSE_IMAGE_SIGNATURE_TYPE = *mut SE_IMAGE_SIGNATURE_TYPE; +ENUM!{enum SE_LEARNING_MODE_DATA_TYPE { + SeLearningModeInvalidType = 0, + SeLearningModeSettings, + SeLearningModeMax, +}} +STRUCT!{struct SECURITY_CAPABILITIES { + AppContainerSid: PSID, + Capabilities: PSID_AND_ATTRIBUTES, + CapabilityCount: DWORD, + Reserved: DWORD, +}} +pub type PSECURITY_CAPABILITIES = *mut SECURITY_CAPABILITIES; +pub type LPSECURITY_CAPABILITIES = *mut SECURITY_CAPABILITIES; +pub const PROCESS_TERMINATE: DWORD = 0x0001; +pub const PROCESS_CREATE_THREAD: DWORD = 0x0002; +pub const PROCESS_SET_SESSIONID: DWORD = 0x0004; +pub const PROCESS_VM_OPERATION: DWORD = 0x0008; +pub const PROCESS_VM_READ: DWORD = 0x0010; +pub const PROCESS_VM_WRITE: DWORD = 0x0020; +pub const PROCESS_DUP_HANDLE: DWORD = 0x0040; +pub const PROCESS_CREATE_PROCESS: DWORD = 0x0080; +pub const PROCESS_SET_QUOTA: DWORD = 0x0100; +pub const PROCESS_SET_INFORMATION: DWORD = 0x0200; +pub const PROCESS_QUERY_INFORMATION: DWORD = 0x0400; +pub const PROCESS_SUSPEND_RESUME: DWORD = 0x0800; +pub const PROCESS_QUERY_LIMITED_INFORMATION: DWORD = 0x1000; +pub const PROCESS_SET_LIMITED_INFORMATION: DWORD = 0x2000; +pub const PROCESS_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF; +pub const THREAD_TERMINATE: DWORD = 0x0001; +pub const THREAD_SUSPEND_RESUME: DWORD = 0x0002; +pub const THREAD_GET_CONTEXT: DWORD = 0x0008; +pub const THREAD_SET_CONTEXT: DWORD = 0x0010; +pub const THREAD_QUERY_INFORMATION: DWORD = 0x0040; +pub const THREAD_SET_INFORMATION: DWORD = 0x0020; +pub const THREAD_SET_THREAD_TOKEN: DWORD = 0x0080; +pub const THREAD_IMPERSONATE: DWORD = 0x0100; +pub const THREAD_DIRECT_IMPERSONATION: DWORD = 0x0200; +pub const THREAD_SET_LIMITED_INFORMATION: DWORD = 0x0400; +pub const THREAD_QUERY_LIMITED_INFORMATION: DWORD = 0x0800; +pub const THREAD_RESUME: DWORD = 0x1000; +pub const THREAD_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF; +pub const JOB_OBJECT_ASSIGN_PROCESS: DWORD = 0x0001; +pub const JOB_OBJECT_SET_ATTRIBUTES: DWORD = 0x0002; +pub const JOB_OBJECT_QUERY: DWORD = 0x0004; +pub const JOB_OBJECT_TERMINATE: DWORD = 0x0008; +pub const JOB_OBJECT_SET_SECURITY_ATTRIBUTES: DWORD = 0x0010; +pub const JOB_OBJECT_IMPERSONATE: DWORD = 0x0020; +pub const JOB_OBJECT_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3F; +STRUCT!{struct JOB_SET_ARRAY { + JobHandle: HANDLE, + MemberLevel: DWORD, + Flags: DWORD, +}} +pub type PJOB_SET_ARRAY = *mut JOB_SET_ARRAY; +pub const FLS_MAXIMUM_AVAILABLE: DWORD = 128; +pub const TLS_MINIMUM_AVAILABLE: DWORD = 64; +STRUCT!{struct EXCEPTION_REGISTRATION_RECORD { + Next: *mut EXCEPTION_REGISTRATION_RECORD, + Handler: PEXCEPTION_ROUTINE, +}} +pub type PEXCEPTION_REGISTRATION_RECORD = *mut EXCEPTION_REGISTRATION_RECORD; +UNION!{union NT_TIB_u { + [usize; 1], + FiberData FiberData_mut: PVOID, + Version Version_mut: DWORD, +}} +STRUCT!{struct NT_TIB { + ExceptionList: *mut EXCEPTION_REGISTRATION_RECORD, + StackBase: PVOID, + StackLimit: PVOID, + SubSystemTib: PVOID, + u: NT_TIB_u, + ArbitraryUserPointer: PVOID, + _Self: *mut NT_TIB, +}} +pub type PNT_TIB = *mut NT_TIB; +UNION!{union NT_TIB32_u { + [u32; 1], + FiberData FiberData_mut: DWORD, + Version Version_mut: DWORD, +}} +STRUCT!{struct NT_TIB32 { + ExceptionList: DWORD, + StackBase: DWORD, + StackLimit: DWORD, + SubSystemTib: DWORD, + u: NT_TIB32_u, + ArbitraryUserPointer: DWORD, + Self_: DWORD, +}} +pub type PNT_TIB32 = *mut NT_TIB32; +UNION!{union NT_TIB64_u { + [u64; 1], + FiberData FiberData_mut: DWORD64, + Version Version_mut: DWORD, +}} +STRUCT!{struct NT_TIB64 { + ExceptionList: DWORD64, + StackBase: DWORD64, + StackLimit: DWORD64, + SubSystemTib: DWORD64, + u: NT_TIB64_u, + ArbitraryUserPointer: DWORD64, + _Self: DWORD64, +}} +pub type PNT_TIB64 = *mut NT_TIB64; +pub const THREAD_DYNAMIC_CODE_ALLOW: DWORD = 1; +pub const THREAD_BASE_PRIORITY_LOWRT: DWORD = 15; +pub const THREAD_BASE_PRIORITY_MAX: DWORD = 2; +pub const THREAD_BASE_PRIORITY_MIN: DWORD = -2i32 as u32; +pub const THREAD_BASE_PRIORITY_IDLE: DWORD = -15i32 as u32; +STRUCT!{struct UMS_CREATE_THREAD_ATTRIBUTES { + UmsVersion: DWORD, + UmsContext: PVOID, + UmsCompletionList: PVOID, +}} +pub type PUMS_CREATE_THREAD_ATTRIBUTES = *mut UMS_CREATE_THREAD_ATTRIBUTES; +STRUCT!{struct WOW64_ARCHITECTURE_INFORMATION { + BitFields: DWORD, +}} +pub type PWOW64_ARCHITECTURE_INFORMATION = *mut WOW64_ARCHITECTURE_INFORMATION; +BITFIELD!{WOW64_ARCHITECTURE_INFORMATION BitFields: DWORD [ + Machine set_Machine[0..16], + KernelMode set_KernelMode[16..17], + UserMode set_UserMode[17..18], + Native set_Native[18..19], + Process set_Process[19..20], + ReservedZero0 set_ReservedZero0[20..32], +]} +pub const MEMORY_PRIORITY_LOWEST: ULONG = 0; +pub const MEMORY_PRIORITY_VERY_LOW: ULONG = 1; +pub const MEMORY_PRIORITY_LOW: ULONG = 2; +pub const MEMORY_PRIORITY_MEDIUM: ULONG = 3; +pub const MEMORY_PRIORITY_BELOW_NORMAL: ULONG = 4; +pub const MEMORY_PRIORITY_NORMAL: ULONG = 5; +STRUCT!{struct QUOTA_LIMITS { + PagedPoolLimit: SIZE_T, + NonPagedPoolLimit: SIZE_T, + MinimumWorkingSetSize: SIZE_T, + MaximumWorkingSetSize: SIZE_T, + PagefileLimit: SIZE_T, + TimeLimit: LARGE_INTEGER, +}} +pub type PQUOTA_LIMITS = *mut QUOTA_LIMITS; +pub const QUOTA_LIMITS_HARDWS_MIN_ENABLE: DWORD = 0x00000001; +pub const QUOTA_LIMITS_HARDWS_MIN_DISABLE: DWORD = 0x00000002; +pub const QUOTA_LIMITS_HARDWS_MAX_ENABLE: DWORD = 0x00000004; +pub const QUOTA_LIMITS_HARDWS_MAX_DISABLE: DWORD = 0x00000008; +pub const QUOTA_LIMITS_USE_DEFAULT_LIMITS: DWORD = 0x00000010; +STRUCT!{struct RATE_QUOTA_LIMIT { + RateData: DWORD, +}} +BITFIELD!{RATE_QUOTA_LIMIT RateData: DWORD [ + RatePercent set_RatePercent[0..7], + Reserved0 set_Reserved0[7..32], +]} +pub type PRATE_QUOTA_LIMIT = *mut RATE_QUOTA_LIMIT; +STRUCT!{struct QUOTA_LIMITS_EX { + PagedPoolLimit: SIZE_T, + NonPagedPoolLimit: SIZE_T, + MinimumWorkingSetSize: SIZE_T, + MaximumWorkingSetSize: SIZE_T, + PagefileLimit: SIZE_T, + TimeLimit: LARGE_INTEGER, + WorkingSetLimit: SIZE_T, + Reserved2: SIZE_T, + Reserved3: SIZE_T, + Reserved4: SIZE_T, + Flags: DWORD, + CpuRateLimit: RATE_QUOTA_LIMIT, +}} +pub type PQUOTA_LIMITS_EX = *mut QUOTA_LIMITS_EX; +STRUCT!{struct IO_COUNTERS { + ReadOperationCount: ULONGLONG, + WriteOperationCount: ULONGLONG, + OtherOperationCount: ULONGLONG, + ReadTransferCount: ULONGLONG, + WriteTransferCount: ULONGLONG, + OtherTransferCount: ULONGLONG, +}} +pub type PIO_COUNTERS = *mut IO_COUNTERS; +pub const MAX_HW_COUNTERS: usize = 16; +pub const THREAD_PROFILING_FLAG_DISPATCH: DWORD = 0x00000001; +ENUM!{enum HARDWARE_COUNTER_TYPE { + PMCCounter, + MaxHardwareCounterType, +}} +pub type PHARDWARE_COUNTER_TYPE = *mut HARDWARE_COUNTER_TYPE; +ENUM!{enum PROCESS_MITIGATION_POLICY { + ProcessDEPPolicy, + ProcessASLRPolicy, + ProcessDynamicCodePolicy, + ProcessStrictHandleCheckPolicy, + ProcessSystemCallDisablePolicy, + ProcessMitigationOptionsMask, + ProcessExtensionPointDisablePolicy, + ProcessControlFlowGuardPolicy, + ProcessSignaturePolicy, + ProcessFontDisablePolicy, + ProcessImageLoadPolicy, + MaxProcessMitigationPolicy, +}} +pub type PPROCESS_MITIGATION_POLICY = *mut PROCESS_MITIGATION_POLICY; +STRUCT!{struct PROCESS_MITIGATION_ASLR_POLICY { + Flags: DWORD, +}} +BITFIELD!{PROCESS_MITIGATION_ASLR_POLICY Flags: DWORD [ + EnableBottomUpRandomization set_EnableBottomUpRandomization[0..1], + EnableForceRelocateImages set_EnableForceRelocateImages[1..2], + EnableHighEntropy set_EnableHighEntropy[2..3], + DisallowStrippedImages set_DisallowStrippedImages[3..4], + ReservedFlags set_ReservedFlags[4..32], +]} +pub type PPROCESS_MITIGATION_ASLR_POLICY = *mut PROCESS_MITIGATION_ASLR_POLICY; +STRUCT!{struct PROCESS_MITIGATION_DEP_POLICY { + Flags: DWORD, + Permanent: BOOLEAN, +}} +BITFIELD!{PROCESS_MITIGATION_DEP_POLICY Flags: DWORD [ + Enable set_Enable[0..1], + DisableAtlThunkEmulation set_DisableAtlThunkEmulation[1..2], + ReservedFlags set_ReservedFlags[2..32], +]} +pub type PPROCESS_MITIGATION_DEP_POLICY = *mut PROCESS_MITIGATION_DEP_POLICY; +STRUCT!{struct PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY { + Flags: DWORD, +}} +BITFIELD!{PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY Flags: DWORD [ + RaiseExceptionOnInvalidHandleReference set_RaiseExceptionOnInvalidHandleReference[0..1], + HandleExceptionsPermanentlyEnabled set_HandleExceptionsPermanentlyEnabled[1..2], + ReservedFlags set_ReservedFlags[2..32], +]} +pub type PPROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY + = *mut PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY; +STRUCT!{struct PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY { + Flags: DWORD, +}} +BITFIELD!{PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY Flags: DWORD [ + DisallowWin32kSystemCalls set_DisallowWin32kSystemCalls[0..1], + ReservedFlags set_ReservedFlags[1..32], +]} +pub type PPROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY + = *mut PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY; +STRUCT!{struct PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY { + Flags: DWORD, +}} +BITFIELD!{PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY Flags: DWORD [ + DisableExtensionPoints set_DisableExtensionPoints[0..1], + ReservedFlags set_ReservedFlags[1..32], +]} +pub type PPROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY + = *mut PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY; +STRUCT!{struct PROCESS_MITIGATION_DYNAMIC_CODE_POLICY { + Flags: DWORD, +}} +BITFIELD!{PROCESS_MITIGATION_DYNAMIC_CODE_POLICY Flags: DWORD [ + ProhibitDynamicCode set_ProhibitDynamicCode[0..1], + AllowThreadOptOut set_AllowThreadOptOut[1..2], + AllowRemoteDowngrade set_AllowRemoteDowngrade[2..3], + ReservedFlags set_ReservedFlags[3..32], +]} +pub type PPROCESS_MITIGATION_DYNAMIC_CODE_POLICY = *mut PROCESS_MITIGATION_DYNAMIC_CODE_POLICY; +STRUCT!{struct PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY { + Flags: DWORD, +}} +BITFIELD!{PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY Flags: DWORD [ + EnableControlFlowGuard set_EnableControlFlowGuard[0..1], + EnableExportSuppression set_EnableExportSuppression[1..2], + StrictMode set_StrictMode[2..3], + ReservedFlags set_ReservedFlags[3..32], +]} +pub type PPROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY + = *mut PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY; +STRUCT!{struct PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY { + Flags: DWORD, +}} +BITFIELD!{PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY Flags: DWORD [ + MicrosoftSignedOnly set_MicrosoftSignedOnly[0..1], + StoreSignedOnly set_StoreSignedOnly[1..2], + MitigationOptIn set_MitigationOptIn[2..3], + ReservedFlags set_ReservedFlags[3..32], +]} +pub type PPROCESS_MITIGATION_BINARY_SIGNATURE_POLICY + = *mut PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY; +STRUCT!{struct PROCESS_MITIGATION_FONT_DISABLE_POLICY { + Flags: DWORD, +}} +BITFIELD!{PROCESS_MITIGATION_FONT_DISABLE_POLICY Flags: DWORD [ + DisableNonSystemFonts set_DisableNonSystemFonts[0..1], + AuditNonSystemFontLoading set_AuditNonSystemFontLoading[1..2], + ReservedFlags set_ReservedFlags[2..32], +]} +pub type PPROCESS_MITIGATION_FONT_DISABLE_POLICY = *mut PROCESS_MITIGATION_FONT_DISABLE_POLICY; +STRUCT!{struct PROCESS_MITIGATION_IMAGE_LOAD_POLICY { + Flags: DWORD, +}} +BITFIELD!{PROCESS_MITIGATION_IMAGE_LOAD_POLICY Flags: DWORD [ + NoRemoteImages set_NoRemoteImages[0..1], + NoLowMandatoryLabelImages set_NoLowMandatoryLabelImages[1..2], + PreferSystem32Images set_PreferSystem32Images[2..3], + ReservedFlags set_ReservedFlags[3..32], +]} +pub type PPROCESS_MITIGATION_IMAGE_LOAD_POLICY = *mut PROCESS_MITIGATION_IMAGE_LOAD_POLICY; +STRUCT!{struct PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY { + Flags: DWORD, +}} +pub type PPPROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY = + *mut PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY; +BITFIELD!{PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY Flags: DWORD [ + FilterId set_FilterId[0..4], + ReservedFlags set_ReservedFlags[4..32], +]} +STRUCT!{struct PROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY { + Flags: DWORD, +}} +pub type PPROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY = + *mut PROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY; +BITFIELD!{PROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY Flags: DWORD [ + EnableExportAddressFilter set_EnableExportAddressFilter[0..1], + AuditExportAddressFilter set_AuditExportAddressFilter[1..2], + EnableExportAddressFilterPlus set_EnableExportAddressFilterPlus[2..3], + AuditExportAddressFilterPlus set_AuditExportAddressFilterPlus[3..4], + EnableImportAddressFilter set_EnableImportAddressFilter[4..5], + AuditImportAddressFilter set_AuditImportAddressFilter[5..6], + EnableRopStackPivot set_EnableRopStackPivot[6..7], + AuditRopStackPivot set_AuditRopStackPivot[7..8], + EnableRopCallerCheck set_EnableRopCallerCheck[8..9], + AuditRopCallerCheck set_AuditRopCallerCheck[9..10], + EnableRopSimExec set_EnableRopSimExec[10..11], + AuditRopSimExec set_AuditRopSimExec[11..12], + ReservedFlags set_ReservedFlags[12..32], +]} +STRUCT!{struct PROCESS_MITIGATION_CHILD_PROCESS_POLICY { + Flags: DWORD, +}} +pub type PPROCESS_MITIGATION_CHILD_PROCESS_POLICY = *mut PROCESS_MITIGATION_CHILD_PROCESS_POLICY; +BITFIELD!{PROCESS_MITIGATION_CHILD_PROCESS_POLICY Flags: DWORD [ + NoChildProcessCreation set_NoChildProcessCreation[0..1], + AuditNoChildProcessCreation set_AuditNoChildProcessCreation[1..2], + AllowSecureProcessCreation set_AllowSecureProcessCreation[2..3], + ReservedFlags set_ReservedFlags[3..32], +]} +STRUCT!{struct JOBOBJECT_BASIC_ACCOUNTING_INFORMATION { + TotalUserTime: LARGE_INTEGER, + TotalKernelTime: LARGE_INTEGER, + ThisPeriodTotalUserTime: LARGE_INTEGER, + ThisPeriodTotalKernelTime: LARGE_INTEGER, + TotalPageFaultCount: DWORD, + TotalProcesses: DWORD, + ActiveProcesses: DWORD, + TotalTerminatedProcesses: DWORD, +}} +pub type PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION = *mut JOBOBJECT_BASIC_ACCOUNTING_INFORMATION; +STRUCT!{struct JOBOBJECT_BASIC_LIMIT_INFORMATION { + PerProcessUserTimeLimit: LARGE_INTEGER, + PerJobUserTimeLimit: LARGE_INTEGER, + LimitFlags: DWORD, + MinimumWorkingSetSize: SIZE_T, + MaximumWorkingSetSize: SIZE_T, + ActiveProcessLimit: DWORD, + Affinity: ULONG_PTR, + PriorityClass: DWORD, + SchedulingClass: DWORD, +}} +pub type PJOBOBJECT_BASIC_LIMIT_INFORMATION = *mut JOBOBJECT_BASIC_LIMIT_INFORMATION; +STRUCT!{struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION { + BasicLimitInformation: JOBOBJECT_BASIC_LIMIT_INFORMATION, + IoInfo: IO_COUNTERS, + ProcessMemoryLimit: SIZE_T, + JobMemoryLimit: SIZE_T, + PeakProcessMemoryUsed: SIZE_T, + PeakJobMemoryUsed: SIZE_T, +}} +pub type PJOBOBJECT_EXTENDED_LIMIT_INFORMATION = *mut JOBOBJECT_EXTENDED_LIMIT_INFORMATION; +STRUCT!{struct JOBOBJECT_BASIC_PROCESS_ID_LIST { + NumberOfAssignedProcesses: DWORD, + NumberOfProcessIdsInList: DWORD, + ProcessIdList: [ULONG_PTR; 1], +}} +pub type PJOBOBJECT_BASIC_PROCESS_ID_LIST = *mut JOBOBJECT_BASIC_PROCESS_ID_LIST; +STRUCT!{struct JOBOBJECT_BASIC_UI_RESTRICTIONS { + UIRestrictionsClass: DWORD, +}} +pub type PJOBOBJECT_BASIC_UI_RESTRICTIONS = *mut JOBOBJECT_BASIC_UI_RESTRICTIONS; +STRUCT!{struct JOBOBJECT_SECURITY_LIMIT_INFORMATION { + SecurityLimitFlags: DWORD, + JobToken: HANDLE, + SidsToDisable: PTOKEN_GROUPS, + PrivilegesToDelete: PTOKEN_PRIVILEGES, + RestrictedSids: PTOKEN_GROUPS, +}} +pub type PJOBOBJECT_SECURITY_LIMIT_INFORMATION = *mut JOBOBJECT_SECURITY_LIMIT_INFORMATION; +STRUCT!{struct JOBOBJECT_END_OF_JOB_TIME_INFORMATION { + EndOfJobTimeAction: DWORD, +}} +pub type PJOBOBJECT_END_OF_JOB_TIME_INFORMATION = *mut JOBOBJECT_END_OF_JOB_TIME_INFORMATION; +STRUCT!{struct JOBOBJECT_ASSOCIATE_COMPLETION_PORT { + CompletionKey: PVOID, + CompletionPort: HANDLE, +}} +pub type PJOBOBJECT_ASSOCIATE_COMPLETION_PORT = *mut JOBOBJECT_ASSOCIATE_COMPLETION_PORT; +STRUCT!{struct JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION { + BasicInfo: JOBOBJECT_BASIC_ACCOUNTING_INFORMATION, + IoInfo: IO_COUNTERS, +}} +pub type PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION + = *mut JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION; +STRUCT!{struct JOBOBJECT_JOBSET_INFORMATION { + MemberLevel: DWORD, +}} +pub type PJOBOBJECT_JOBSET_INFORMATION = *mut JOBOBJECT_JOBSET_INFORMATION; +ENUM!{enum JOBOBJECT_RATE_CONTROL_TOLERANCE { + ToleranceLow = 1, + ToleranceMedium, + ToleranceHigh, +}} +pub type PJOBOBJECT_RATE_CONTROL_TOLERANCE = *mut JOBOBJECT_RATE_CONTROL_TOLERANCE; +ENUM!{enum JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL { + ToleranceIntervalShort = 1, + ToleranceIntervalMedium, + ToleranceIntervalLong, +}} +pub type PJOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL + = *mut JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL; +STRUCT!{struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION { + IoReadBytesLimit: DWORD64, + IoWriteBytesLimit: DWORD64, + PerJobUserTimeLimit: LARGE_INTEGER, + JobMemoryLimit: DWORD64, + RateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE, + RateControlToleranceInterval: JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL, + LimitFlags: DWORD, +}} +pub type PJOBOBJECT_NOTIFICATION_LIMIT_INFORMATION = *mut JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION; +UNION!{union JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u1 { + [u64; 1], + JobHighMemoryLimit JobHighMemoryLimit_mut: DWORD64, + JobMemoryLimit JobMemoryLimit_mut: DWORD64, +}} +UNION!{union JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u2 { + [u32; 1], + RateControlTolerance RateControlTolerance_mut: JOBOBJECT_RATE_CONTROL_TOLERANCE, + CpuRateControlTolerance CpuRateControlTolerance_mut: JOBOBJECT_RATE_CONTROL_TOLERANCE, +}} +UNION!{union JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u3 { + [u32; 1], + RateControlToleranceInterval RateControlToleranceInterval_mut: + JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL, + CpuRateControlToleranceInterval CpuRateControlToleranceInterval_mut: + JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL, +}} +STRUCT!{struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2 { + IoReadBytesLimit: DWORD64, + IoWriteBytesLimit: DWORD64, + PerJobUserTimeLimit: LARGE_INTEGER, + u1: JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u1, + u2: JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u2, + u3: JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2_u3, + LimitFlags: DWORD, + IoRateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE, + JobLowMemoryLimit: DWORD64, + IoRateControlToleranceInterval: JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL, + NetRateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE, + NetRateControlToleranceInterval: JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL, +}} +STRUCT!{struct JOBOBJECT_LIMIT_VIOLATION_INFORMATION { + LimitFlags: DWORD, + ViolationLimitFlags: DWORD, + IoReadBytes: DWORD64, + IoReadBytesLimit: DWORD64, + IoWriteBytes: DWORD64, + IoWriteBytesLimit: DWORD64, + PerJobUserTime: LARGE_INTEGER, + PerJobUserTimeLimit: LARGE_INTEGER, + JobMemory: DWORD64, + JobMemoryLimit: DWORD64, + RateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE, + RateControlToleranceLimit: JOBOBJECT_RATE_CONTROL_TOLERANCE, +}} +pub type PJOBOBJECT_LIMIT_VIOLATION_INFORMATION = *mut JOBOBJECT_LIMIT_VIOLATION_INFORMATION; +UNION!{union JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u1 { + [u64; 1], + JobHighMemoryLimit JobHighMemoryLimit_mut: DWORD64, + JobMemoryLimit JobMemoryLimit_mut: DWORD64, +}} +UNION!{union JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u2 { + [u32; 1], + RateControlTolerance RateControlTolerance_mut: JOBOBJECT_RATE_CONTROL_TOLERANCE, + CpuRateControlTolerance CpuRateControlTolerance_mut: JOBOBJECT_RATE_CONTROL_TOLERANCE, +}} +UNION!{union JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u3 { + [u32; 1], + RateControlToleranceLimit RateControlToleranceLimit_mut: JOBOBJECT_RATE_CONTROL_TOLERANCE, + CpuRateControlToleranceLimit CpuRateControlToleranceLimit_mut: + JOBOBJECT_RATE_CONTROL_TOLERANCE, +}} +STRUCT!{struct JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2 { + LimitFlags: DWORD, + ViolationLimitFlags: DWORD, + IoReadBytes: DWORD64, + IoReadBytesLimit: DWORD64, + IoWriteBytes: DWORD64, + IoWriteBytesLimit: DWORD64, + PerJobUserTime: LARGE_INTEGER, + PerJobUserTimeLimit: LARGE_INTEGER, + JobMemory: DWORD64, + u1: JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u1, + u2: JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u2, + u3: JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2_u3, + JobLowMemoryLimit: DWORD64, + IoRateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE, + IoRateControlToleranceLimit: JOBOBJECT_RATE_CONTROL_TOLERANCE, + NetRateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE, + NetRateControlToleranceLimit: JOBOBJECT_RATE_CONTROL_TOLERANCE, +}} +STRUCT!{struct JOBOBJECT_CPU_RATE_CONTROL_INFORMATION_u_s { + MinRate: WORD, + MaxRate: WORD, +}} +UNION!{union JOBOBJECT_CPU_RATE_CONTROL_INFORMATION_u { + [u32; 1], + CpuRate CpuRate_mut: DWORD, + Weight Weight_mut: DWORD, + s s_mut: JOBOBJECT_CPU_RATE_CONTROL_INFORMATION_u_s, +}} +STRUCT!{struct JOBOBJECT_CPU_RATE_CONTROL_INFORMATION { + ControlFlags: DWORD, + u: JOBOBJECT_CPU_RATE_CONTROL_INFORMATION_u, +}} +pub type PJOBOBJECT_CPU_RATE_CONTROL_INFORMATION = *mut JOBOBJECT_CPU_RATE_CONTROL_INFORMATION; +ENUM!{enum JOB_OBJECT_NET_RATE_CONTROL_FLAGS { + JOB_OBJECT_NET_RATE_CONTROL_ENABLE = 0x1, + JOB_OBJECT_NET_RATE_CONTROL_MAX_BANDWIDTH = 0x2, + JOB_OBJECT_NET_RATE_CONTROL_DSCP_TAG = 0x4, + JOB_OBJECT_NET_RATE_CONTROL_VALID_FLAGS = 0x7, +}} +pub const JOB_OBJECT_NET_RATE_CONTROL_MAX_DSCP_TAG: DWORD = 64; +STRUCT!{struct JOBOBJECT_NET_RATE_CONTROL_INFORMATION { + MaxBandwidth: DWORD64, + ControlFlags: JOB_OBJECT_NET_RATE_CONTROL_FLAGS, + DscpTag: BYTE, +}} +ENUM!{enum JOB_OBJECT_IO_RATE_CONTROL_FLAGS { + JOB_OBJECT_IO_RATE_CONTROL_ENABLE = 0x1, + JOB_OBJECT_IO_RATE_CONTROL_STANDALONE_VOLUME = 0x2, + JOB_OBJECT_IO_RATE_CONTROL_VALID_FLAGS = JOB_OBJECT_IO_RATE_CONTROL_ENABLE + | JOB_OBJECT_IO_RATE_CONTROL_STANDALONE_VOLUME, +}} +STRUCT!{struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE { + MaxIops: LONG64, + MaxBandwidth: LONG64, + ReservationIops: LONG64, + VolumeName: PWSTR, + BaseIoSize: DWORD, + ControlFlags: JOB_OBJECT_IO_RATE_CONTROL_FLAGS, + VolumeNameLength: WORD, +}} +pub type JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V1 + = JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE; +STRUCT!{struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2 { + MaxIops: LONG64, + MaxBandwidth: LONG64, + ReservationIops: LONG64, + VolumeName: PWSTR, + BaseIoSize: DWORD, + ControlFlags: JOB_OBJECT_IO_RATE_CONTROL_FLAGS, + VolumeNameLength: WORD, + CriticalReservationIops: LONG64, + ReservationBandwidth: LONG64, + CriticalReservationBandwidth: LONG64, + MaxTimePercent: LONG64, + ReservationTimePercent: LONG64, + CriticalReservationTimePercent: LONG64, +}} +STRUCT!{struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V3 { + MaxIops: LONG64, + MaxBandwidth: LONG64, + ReservationIops: LONG64, + VolumeName: PWSTR, + BaseIoSize: DWORD, + ControlFlags: JOB_OBJECT_IO_RATE_CONTROL_FLAGS, + VolumeNameLength: WORD, + CriticalReservationIops: LONG64, + ReservationBandwidth: LONG64, + CriticalReservationBandwidth: LONG64, + MaxTimePercent: LONG64, + ReservationTimePercent: LONG64, + CriticalReservationTimePercent: LONG64, + SoftMaxIops: LONG64, + SoftMaxBandwidth: LONG64, + SoftMaxTimePercent: LONG64, + LimitExcessNotifyIops: LONG64, + LimitExcessNotifyBandwidth: LONG64, + LimitExcessNotifyTimePercent: LONG64, +}} +ENUM!{enum JOBOBJECT_IO_ATTRIBUTION_CONTROL_FLAGS { + JOBOBJECT_IO_ATTRIBUTION_CONTROL_ENABLE = 0x1, + JOBOBJECT_IO_ATTRIBUTION_CONTROL_DISABLE = 0x2, + JOBOBJECT_IO_ATTRIBUTION_CONTROL_VALID_FLAGS = 0x3, +}} +STRUCT!{struct JOBOBJECT_IO_ATTRIBUTION_STATS { + IoCount: ULONG_PTR, + TotalNonOverlappedQueueTime: ULONGLONG, + TotalNonOverlappedServiceTime: ULONGLONG, + TotalSize: ULONGLONG, +}} +pub type PJOBOBJECT_IO_ATTRIBUTION_STATS = *mut JOBOBJECT_IO_ATTRIBUTION_STATS; +STRUCT!{struct JOBOBJECT_IO_ATTRIBUTION_INFORMATION { + ControlFlags: DWORD, + ReadStats: JOBOBJECT_IO_ATTRIBUTION_STATS, + WriteStats: JOBOBJECT_IO_ATTRIBUTION_STATS, +}} +pub type PJOBOBJECT_IO_ATTRIBUTION_INFORMATION = *mut JOBOBJECT_IO_ATTRIBUTION_INFORMATION; +pub const JOB_OBJECT_TERMINATE_AT_END_OF_JOB: DWORD = 0; +pub const JOB_OBJECT_POST_AT_END_OF_JOB: DWORD = 1; +pub const JOB_OBJECT_MSG_END_OF_JOB_TIME: DWORD = 1; +pub const JOB_OBJECT_MSG_END_OF_PROCESS_TIME: DWORD = 2; +pub const JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT: DWORD = 3; +pub const JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO: DWORD = 4; +pub const JOB_OBJECT_MSG_NEW_PROCESS: DWORD = 6; +pub const JOB_OBJECT_MSG_EXIT_PROCESS: DWORD = 7; +pub const JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS: DWORD = 8; +pub const JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT: DWORD = 9; +pub const JOB_OBJECT_MSG_JOB_MEMORY_LIMIT: DWORD = 10; +pub const JOB_OBJECT_MSG_NOTIFICATION_LIMIT: DWORD = 11; +pub const JOB_OBJECT_MSG_JOB_CYCLE_TIME_LIMIT: DWORD = 12; +pub const JOB_OBJECT_MSG_SILO_TERMINATED: DWORD = 13; +pub const JOB_OBJECT_MSG_MINIMUM: DWORD = 1; +pub const JOB_OBJECT_MSG_MAXIMUM: DWORD = 13; +pub const JOB_OBJECT_VALID_COMPLETION_FILTER: DWORD = ((1 << (JOB_OBJECT_MSG_MAXIMUM + 1)) - 1) + - ((1 << JOB_OBJECT_MSG_MINIMUM) - 1); +pub const JOB_OBJECT_LIMIT_WORKINGSET: DWORD = 0x00000001; +pub const JOB_OBJECT_LIMIT_PROCESS_TIME: DWORD = 0x00000002; +pub const JOB_OBJECT_LIMIT_JOB_TIME: DWORD = 0x00000004; +pub const JOB_OBJECT_LIMIT_ACTIVE_PROCESS: DWORD = 0x00000008; +pub const JOB_OBJECT_LIMIT_AFFINITY: DWORD = 0x00000010; +pub const JOB_OBJECT_LIMIT_PRIORITY_CLASS: DWORD = 0x00000020; +pub const JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME: DWORD = 0x00000040; +pub const JOB_OBJECT_LIMIT_SCHEDULING_CLASS: DWORD = 0x00000080; +pub const JOB_OBJECT_LIMIT_PROCESS_MEMORY: DWORD = 0x00000100; +pub const JOB_OBJECT_LIMIT_JOB_MEMORY: DWORD = 0x00000200; +pub const JOB_OBJECT_LIMIT_JOB_MEMORY_HIGH: DWORD = JOB_OBJECT_LIMIT_JOB_MEMORY; +pub const JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION: DWORD = 0x00000400; +pub const JOB_OBJECT_LIMIT_BREAKAWAY_OK: DWORD = 0x00000800; +pub const JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK: DWORD = 0x00001000; +pub const JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE: DWORD = 0x00002000; +pub const JOB_OBJECT_LIMIT_SUBSET_AFFINITY: DWORD = 0x00004000; +pub const JOB_OBJECT_LIMIT_JOB_MEMORY_LOW: DWORD = 0x00008000; +pub const JOB_OBJECT_LIMIT_JOB_READ_BYTES: DWORD = 0x00010000; +pub const JOB_OBJECT_LIMIT_JOB_WRITE_BYTES: DWORD = 0x00020000; +pub const JOB_OBJECT_LIMIT_RATE_CONTROL: DWORD = 0x00040000; +pub const JOB_OBJECT_LIMIT_CPU_RATE_CONTROL: DWORD = JOB_OBJECT_LIMIT_RATE_CONTROL; +pub const JOB_OBJECT_LIMIT_IO_RATE_CONTROL: DWORD = 0x00008000; +pub const JOB_OBJECT_LIMIT_NET_RATE_CONTROL: DWORD = 0x00010000; +pub const JOB_OBJECT_LIMIT_VALID_FLAGS: DWORD = 0x0007ffff; +pub const JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS: DWORD = 0x000000ff; +pub const JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS: DWORD = 0x00007fff; +pub const JOB_OBJECT_NOTIFICATION_LIMIT_VALID_FLAGS: DWORD = JOB_OBJECT_LIMIT_JOB_READ_BYTES + | JOB_OBJECT_LIMIT_JOB_WRITE_BYTES | JOB_OBJECT_LIMIT_JOB_TIME + | JOB_OBJECT_LIMIT_JOB_MEMORY_LOW | JOB_OBJECT_LIMIT_JOB_MEMORY_HIGH + | JOB_OBJECT_LIMIT_CPU_RATE_CONTROL | JOB_OBJECT_LIMIT_IO_RATE_CONTROL + | JOB_OBJECT_LIMIT_NET_RATE_CONTROL; +pub const JOB_OBJECT_UILIMIT_NONE: DWORD = 0x00000000; +pub const JOB_OBJECT_UILIMIT_HANDLES: DWORD = 0x00000001; +pub const JOB_OBJECT_UILIMIT_READCLIPBOARD: DWORD = 0x00000002; +pub const JOB_OBJECT_UILIMIT_WRITECLIPBOARD: DWORD = 0x00000004; +pub const JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS: DWORD = 0x00000008; +pub const JOB_OBJECT_UILIMIT_DISPLAYSETTINGS: DWORD = 0x00000010; +pub const JOB_OBJECT_UILIMIT_GLOBALATOMS: DWORD = 0x00000020; +pub const JOB_OBJECT_UILIMIT_DESKTOP: DWORD = 0x00000040; +pub const JOB_OBJECT_UILIMIT_EXITWINDOWS: DWORD = 0x00000080; +pub const JOB_OBJECT_UILIMIT_ALL: DWORD = 0x000000FF; +pub const JOB_OBJECT_UI_VALID_FLAGS: DWORD = 0x000000FF; +pub const JOB_OBJECT_SECURITY_NO_ADMIN: DWORD = 0x00000001; +pub const JOB_OBJECT_SECURITY_RESTRICTED_TOKEN: DWORD = 0x00000002; +pub const JOB_OBJECT_SECURITY_ONLY_TOKEN: DWORD = 0x00000004; +pub const JOB_OBJECT_SECURITY_FILTER_TOKENS: DWORD = 0x00000008; +pub const JOB_OBJECT_SECURITY_VALID_FLAGS: DWORD = 0x0000000f; +pub const JOB_OBJECT_CPU_RATE_CONTROL_ENABLE: DWORD = 0x1; +pub const JOB_OBJECT_CPU_RATE_CONTROL_WEIGHT_BASED: DWORD = 0x2; +pub const JOB_OBJECT_CPU_RATE_CONTROL_HARD_CAP: DWORD = 0x4; +pub const JOB_OBJECT_CPU_RATE_CONTROL_NOTIFY: DWORD = 0x8; +pub const JOB_OBJECT_CPU_RATE_CONTROL_MIN_MAX_RATE: DWORD = 0x10; +pub const JOB_OBJECT_CPU_RATE_CONTROL_VALID_FLAGS: DWORD = 0x1f; +ENUM!{enum JOBOBJECTINFOCLASS { + JobObjectBasicAccountingInformation = 1, + JobObjectBasicLimitInformation, + JobObjectBasicProcessIdList, + JobObjectBasicUIRestrictions, + JobObjectSecurityLimitInformation, + JobObjectEndOfJobTimeInformation, + JobObjectAssociateCompletionPortInformation, + JobObjectBasicAndIoAccountingInformation, + JobObjectExtendedLimitInformation, + JobObjectJobSetInformation, + JobObjectGroupInformation, + JobObjectNotificationLimitInformation, + JobObjectLimitViolationInformation, + JobObjectGroupInformationEx, + JobObjectCpuRateControlInformation, + JobObjectCompletionFilter, + JobObjectCompletionCounter, + JobObjectReserved1Information = 18, + JobObjectReserved2Information, + JobObjectReserved3Information, + JobObjectReserved4Information, + JobObjectReserved5Information, + JobObjectReserved6Information, + JobObjectReserved7Information, + JobObjectReserved8Information, + JobObjectReserved9Information, + JobObjectReserved10Information, + JobObjectReserved11Information, + JobObjectReserved12Information, + JobObjectReserved13Information, + JobObjectReserved14Information = 31, + JobObjectNetRateControlInformation, + JobObjectNotificationLimitInformation2, + JobObjectLimitViolationInformation2, + JobObjectCreateSilo, + JobObjectSiloBasicInformation, + JobObjectReserved15Information = 37, + JobObjectReserved16Information = 38, + JobObjectReserved17Information = 39, + JobObjectReserved18Information = 40, + JobObjectReserved19Information = 41, + JobObjectReserved20Information = 42, + JobObjectReserved21Information = 43, + JobObjectReserved22Information = 44, + JobObjectReserved23Information = 45, + JobObjectReserved24Information = 46, + JobObjectReserved25Information = 47, + MaxJobObjectInfoClass, +}} +STRUCT!{struct SILOOBJECT_BASIC_INFORMATION { + SiloId: DWORD, + SiloParentId: DWORD, + NumberOfProcesses: DWORD, + IsInServerSilo: BOOLEAN, + Reserved: [BYTE; 3], +}} +pub type PSILOOBJECT_BASIC_INFORMATION = *mut SILOOBJECT_BASIC_INFORMATION; +ENUM!{enum SERVERSILO_STATE { + SERVERSILO_INITING = 0, + SERVERSILO_STARTED, + SERVERSILO_SHUTTING_DOWN, + SERVERSILO_TERMINATING, + SERVERSILO_TERMINATED, +}} +pub type PSERVERSILO_STATE = *mut SERVERSILO_STATE; +STRUCT!{struct SERVERSILO_BASIC_INFORMATION { + ServiceSessionId: DWORD, + State: SERVERSILO_STATE, + ExitStatus: DWORD, +}} +pub type PSERVERSILO_BASIC_INFORMATION = *mut SERVERSILO_BASIC_INFORMATION; +ENUM!{enum FIRMWARE_TYPE { + FirmwareTypeUnknown, + FirmwareTypeBios, + FirmwareTypeUefi, + FirmwareTypeMax, +}} +pub type PFIRMWARE_TYPE = *mut FIRMWARE_TYPE; +pub const EVENT_MODIFY_STATE: DWORD = 0x0002; +pub const EVENT_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3; +pub const MUTANT_QUERY_STATE: DWORD = 0x0001; +pub const MUTANT_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | MUTANT_QUERY_STATE; +pub const SEMAPHORE_MODIFY_STATE: DWORD = 0x0002; +pub const SEMAPHORE_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3; +pub const TIMER_QUERY_STATE: DWORD = 0x0001; +pub const TIMER_MODIFY_STATE: DWORD = 0x0002; +pub const TIMER_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | TIMER_QUERY_STATE + | TIMER_MODIFY_STATE; +pub const TIME_ZONE_ID_UNKNOWN: DWORD = 0; +pub const TIME_ZONE_ID_STANDARD: DWORD = 1; +pub const TIME_ZONE_ID_DAYLIGHT: DWORD = 2; +ENUM!{enum LOGICAL_PROCESSOR_RELATIONSHIP { + RelationProcessorCore, + RelationNumaNode, + RelationCache, + RelationProcessorPackage, + RelationGroup, + RelationAll = 0xffff, +}} +pub const LTP_PC_SMT: BYTE = 0x1; +ENUM!{enum PROCESSOR_CACHE_TYPE { + CacheUnified, + CacheInstruction, + CacheData, + CacheTrace, +}} +pub const CACHE_FULLY_ASSOCIATIVE: BYTE = 0xFF; +STRUCT!{struct CACHE_DESCRIPTOR { + Level: BYTE, + Associativity: BYTE, + LineSize: WORD, + Size: DWORD, + Type: PROCESSOR_CACHE_TYPE, +}} +pub type PCACHE_DESCRIPTOR = *mut CACHE_DESCRIPTOR; +STRUCT!{struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION_ProcessorCore { + Flags: BYTE, +}} +STRUCT!{struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION_NumaNode { + NodeNumber: DWORD, +}} +UNION!{union SYSTEM_LOGICAL_PROCESSOR_INFORMATION_u { + [u64; 2], + ProcessorCore ProcessorCore_mut: SYSTEM_LOGICAL_PROCESSOR_INFORMATION_ProcessorCore, + NumaNode NumaNode_mut: SYSTEM_LOGICAL_PROCESSOR_INFORMATION_NumaNode, + Cache Cache_mut: CACHE_DESCRIPTOR, + Reserved Reserved_mut: [ULONGLONG; 2], +}} +STRUCT!{struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION { + ProcessorMask: ULONG_PTR, + Relationship: LOGICAL_PROCESSOR_RELATIONSHIP, + u: SYSTEM_LOGICAL_PROCESSOR_INFORMATION_u, +}} +pub type PSYSTEM_LOGICAL_PROCESSOR_INFORMATION = *mut SYSTEM_LOGICAL_PROCESSOR_INFORMATION; +STRUCT!{struct PROCESSOR_RELATIONSHIP { + Flags: BYTE, + EfficiencyClass: BYTE, + Reserved: [BYTE; 20], + GroupCount: WORD, + GroupMask: [GROUP_AFFINITY; ANYSIZE_ARRAY], +}} +pub type PPROCESSOR_RELATIONSHIP = *mut PROCESSOR_RELATIONSHIP; +STRUCT!{struct NUMA_NODE_RELATIONSHIP { + NodeNumber: DWORD, + Reserved: [BYTE; 20], + GroupMask: GROUP_AFFINITY, +}} +pub type PNUMA_NODE_RELATIONSHIP = *mut NUMA_NODE_RELATIONSHIP; +STRUCT!{struct CACHE_RELATIONSHIP { + Level: BYTE, + Associativity: BYTE, + LineSize: WORD, + CacheSize: DWORD, + Type: PROCESSOR_CACHE_TYPE, + Reserved: [BYTE; 20], + GroupMask: GROUP_AFFINITY, +}} +pub type PCACHE_RELATIONSHIP = *mut CACHE_RELATIONSHIP; +STRUCT!{struct PROCESSOR_GROUP_INFO { + MaximumProcessorCount: BYTE, + ActiveProcessorCount: BYTE, + Reserved: [BYTE; 38], + ActiveProcessorMask: KAFFINITY, +}} +pub type PPROCESSOR_GROUP_INFO = *mut PROCESSOR_GROUP_INFO; +STRUCT!{struct GROUP_RELATIONSHIP { + MaximumGroupCount: WORD, + ActiveGroupCount: WORD, + Reserved: [BYTE; 20], + GroupInfo: [PROCESSOR_GROUP_INFO; ANYSIZE_ARRAY], +}} +pub type PGROUP_RELATIONSHIP = *mut GROUP_RELATIONSHIP; +UNION!{union SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX_u { + [u32; 17] [u64; 9], + Processor Processor_mut: PROCESSOR_RELATIONSHIP, + NumaNode NumaNode_mut: NUMA_NODE_RELATIONSHIP, + Cache Cache_mut: CACHE_RELATIONSHIP, + Group Group_mut: GROUP_RELATIONSHIP, +}} +STRUCT!{struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX { + Relationship: LOGICAL_PROCESSOR_RELATIONSHIP, + Size: DWORD, + u: SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX_u, +}} +pub type PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX = *mut SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX; +ENUM!{enum CPU_SET_INFORMATION_TYPE { + CpuSetInformation, +}} +pub type PCPU_SET_INFORMATION_TYPE = *mut CPU_SET_INFORMATION_TYPE; +pub const SYSTEM_CPU_SET_INFORMATION_PARKED: BYTE = 0x1; +pub const SYSTEM_CPU_SET_INFORMATION_ALLOCATED: BYTE = 0x2; +pub const SYSTEM_CPU_SET_INFORMATION_ALLOCATED_TO_TARGET_PROCESS: BYTE = 0x4; +pub const SYSTEM_CPU_SET_INFORMATION_REALTIME: BYTE = 0x8; +STRUCT!{struct SYSTEM_CPU_SET_INFORMATION_CpuSet { + Id: DWORD, + Group: WORD, + LogicalProcessorIndex: BYTE, + CoreIndex: BYTE, + LastLevelCacheIndex: BYTE, + NumaNodeIndex: BYTE, + EfficiencyClass: BYTE, + AllFlags: BYTE, + Reserved: DWORD, + AllocationTag: DWORD64, +}} +BITFIELD!{SYSTEM_CPU_SET_INFORMATION_CpuSet AllFlags: BYTE [ + Parked set_Parked[0..1], + Allocated set_Allocated[1..2], + AllocatedToTargetProcess set_AllocatedToTargetProcess[2..3], + RealTime set_RealTime[3..4], + ReservedFlags set_ReservedFlags[4..8], +]} +STRUCT!{struct SYSTEM_CPU_SET_INFORMATION { + Size: DWORD, + Type: CPU_SET_INFORMATION_TYPE, + CpuSet: SYSTEM_CPU_SET_INFORMATION_CpuSet, +}} +pub type PSYSTEM_CPU_SET_INFORMATION = *mut SYSTEM_CPU_SET_INFORMATION; +STRUCT!{struct SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION { + CycleTime: DWORD64, +}} +pub type PSYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION = *mut SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION; +pub const PROCESSOR_INTEL_386: DWORD = 386; +pub const PROCESSOR_INTEL_486: DWORD = 486; +pub const PROCESSOR_INTEL_PENTIUM: DWORD = 586; +pub const PROCESSOR_INTEL_IA64: DWORD = 2200; +pub const PROCESSOR_AMD_X8664: DWORD = 8664; +pub const PROCESSOR_MIPS_R4000: DWORD = 4000; +pub const PROCESSOR_ALPHA_21064: DWORD = 21064; +pub const PROCESSOR_PPC_601: DWORD = 601; +pub const PROCESSOR_PPC_603: DWORD = 603; +pub const PROCESSOR_PPC_604: DWORD = 604; +pub const PROCESSOR_PPC_620: DWORD = 620; +pub const PROCESSOR_HITACHI_SH3: DWORD = 10003; +pub const PROCESSOR_HITACHI_SH3E: DWORD = 10004; +pub const PROCESSOR_HITACHI_SH4: DWORD = 10005; +pub const PROCESSOR_MOTOROLA_821: DWORD = 821; +pub const PROCESSOR_SHx_SH3: DWORD = 103; +pub const PROCESSOR_SHx_SH4: DWORD = 104; +pub const PROCESSOR_STRONGARM: DWORD = 2577; +pub const PROCESSOR_ARM720: DWORD = 1824; +pub const PROCESSOR_ARM820: DWORD = 2080; +pub const PROCESSOR_ARM920: DWORD = 2336; +pub const PROCESSOR_ARM_7TDMI: DWORD = 70001; +pub const PROCESSOR_OPTIL: DWORD = 0x494f; +pub const PROCESSOR_ARCHITECTURE_INTEL: WORD = 0; +pub const PROCESSOR_ARCHITECTURE_MIPS: WORD = 1; +pub const PROCESSOR_ARCHITECTURE_ALPHA: WORD = 2; +pub const PROCESSOR_ARCHITECTURE_PPC: WORD = 3; +pub const PROCESSOR_ARCHITECTURE_SHX: WORD = 4; +pub const PROCESSOR_ARCHITECTURE_ARM: WORD = 5; +pub const PROCESSOR_ARCHITECTURE_IA64: WORD = 6; +pub const PROCESSOR_ARCHITECTURE_ALPHA64: WORD = 7; +pub const PROCESSOR_ARCHITECTURE_MSIL: WORD = 8; +pub const PROCESSOR_ARCHITECTURE_AMD64: WORD = 9; +pub const PROCESSOR_ARCHITECTURE_IA32_ON_WIN64: WORD = 10; +pub const PROCESSOR_ARCHITECTURE_NEUTRAL: WORD = 11; +pub const PROCESSOR_ARCHITECTURE_ARM64: WORD = 12; +pub const PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64: WORD = 13; +pub const PROCESSOR_ARCHITECTURE_IA32_ON_ARM64: WORD = 14; +pub const PROCESSOR_ARCHITECTURE_UNKNOWN: WORD = 0xFFFF; +pub const PF_FLOATING_POINT_PRECISION_ERRATA: DWORD = 0; +pub const PF_FLOATING_POINT_EMULATED: DWORD = 1; +pub const PF_COMPARE_EXCHANGE_DOUBLE: DWORD = 2; +pub const PF_MMX_INSTRUCTIONS_AVAILABLE: DWORD = 3; +pub const PF_PPC_MOVEMEM_64BIT_OK: DWORD = 4; +pub const PF_ALPHA_BYTE_INSTRUCTIONS: DWORD = 5; +pub const PF_XMMI_INSTRUCTIONS_AVAILABLE: DWORD = 6; +pub const PF_3DNOW_INSTRUCTIONS_AVAILABLE: DWORD = 7; +pub const PF_RDTSC_INSTRUCTION_AVAILABLE: DWORD = 8; +pub const PF_PAE_ENABLED: DWORD = 9; +pub const PF_XMMI64_INSTRUCTIONS_AVAILABLE: DWORD = 10; +pub const PF_SSE_DAZ_MODE_AVAILABLE: DWORD = 11; +pub const PF_NX_ENABLED: DWORD = 12; +pub const PF_SSE3_INSTRUCTIONS_AVAILABLE: DWORD = 13; +pub const PF_COMPARE_EXCHANGE128: DWORD = 14; +pub const PF_COMPARE64_EXCHANGE128: DWORD = 15; +pub const PF_CHANNELS_ENABLED: DWORD = 16; +pub const PF_XSAVE_ENABLED: DWORD = 17; +pub const PF_ARM_VFP_32_REGISTERS_AVAILABLE: DWORD = 18; +pub const PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: DWORD = 19; +pub const PF_SECOND_LEVEL_ADDRESS_TRANSLATION: DWORD = 20; +pub const PF_VIRT_FIRMWARE_ENABLED: DWORD = 21; +pub const PF_RDWRFSGSBASE_AVAILABLE: DWORD = 22; +pub const PF_FASTFAIL_AVAILABLE: DWORD = 23; +pub const PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE: DWORD = 24; +pub const PF_ARM_64BIT_LOADSTORE_ATOMIC: DWORD = 25; +pub const PF_ARM_EXTERNAL_CACHE_AVAILABLE: DWORD = 26; +pub const PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE: DWORD = 27; +pub const PF_RDRAND_INSTRUCTION_AVAILABLE: DWORD = 28; +pub const PF_ARM_V8_INSTRUCTIONS_AVAILABLE: DWORD = 29; +pub const PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE: DWORD = 30; +pub const PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE: DWORD = 31; +pub const PF_RDTSCP_INSTRUCTION_AVAILABLE: DWORD = 32; +pub const XSTATE_LEGACY_FLOATING_POINT: ULONG64 = 0; +pub const XSTATE_LEGACY_SSE: ULONG64 = 1; +pub const XSTATE_GSSE: ULONG64 = 2; +pub const XSTATE_AVX: ULONG64 = XSTATE_GSSE; +pub const XSTATE_MPX_BNDREGS: ULONG64 = 3; +pub const XSTATE_MPX_BNDCSR: ULONG64 = 4; +pub const XSTATE_AVX512_KMASK: ULONG64 = 5; +pub const XSTATE_AVX512_ZMM_H: ULONG64 = 6; +pub const XSTATE_AVX512_ZMM: ULONG64 = 7; +pub const XSTATE_IPT: ULONG64 = 8; +pub const XSTATE_LWP: ULONG64 = 62; +pub const MAXIMUM_XSTATE_FEATURES: usize = 64; +pub const XSTATE_MASK_LEGACY_FLOATING_POINT: ULONG64 = 1 << XSTATE_LEGACY_FLOATING_POINT; +pub const XSTATE_MASK_LEGACY_SSE: ULONG64 = 1 << XSTATE_LEGACY_SSE; +pub const XSTATE_MASK_LEGACY: ULONG64 = XSTATE_MASK_LEGACY_FLOATING_POINT | XSTATE_MASK_LEGACY_SSE; +pub const XSTATE_MASK_GSSE: ULONG64 = 1 << XSTATE_GSSE; +pub const XSTATE_MASK_AVX: ULONG64 = XSTATE_MASK_GSSE; +pub const XSTATE_MASK_MPX: ULONG64 = (1 << XSTATE_MPX_BNDREGS) | (1 << XSTATE_MPX_BNDCSR); +pub const XSTATE_MASK_AVX512: ULONG64 = (1 << XSTATE_AVX512_KMASK) | (1 << XSTATE_AVX512_ZMM_H) + | (1 << XSTATE_AVX512_ZMM); +pub const XSTATE_MASK_IPT: ULONG64 = 1 << XSTATE_IPT; +pub const XSTATE_MASK_LWP: ULONG64 = 1 << XSTATE_LWP; +pub const XSTATE_MASK_ALLOWED: ULONG64 = XSTATE_MASK_LEGACY | XSTATE_MASK_AVX | XSTATE_MASK_MPX + | XSTATE_MASK_AVX512 | XSTATE_MASK_IPT | XSTATE_MASK_LWP; +pub const XSTATE_MASK_PERSISTENT: ULONG64 = (1 << XSTATE_MPX_BNDCSR) | XSTATE_MASK_LWP; +pub const XSTATE_COMPACTION_ENABLE: ULONG64 = 63; +pub const XSTATE_COMPACTION_ENABLE_MASK: ULONG64 = 1 << XSTATE_COMPACTION_ENABLE; +pub const XSTATE_ALIGN_BIT: ULONG64 = 1; +pub const XSTATE_ALIGN_MASK: ULONG64 = 1 << XSTATE_ALIGN_BIT; +pub const XSTATE_CONTROLFLAG_XSAVEOPT_MASK: ULONG64 = 1; +pub const XSTATE_CONTROLFLAG_XSAVEC_MASK: ULONG64 = 2; +pub const XSTATE_CONTROLFLAG_VALID_MASK: ULONG64 = XSTATE_CONTROLFLAG_XSAVEOPT_MASK + | XSTATE_CONTROLFLAG_XSAVEC_MASK; +STRUCT!{struct XSTATE_FEATURE { + Offset: DWORD, + Size: DWORD, +}} +pub type PXSTATE_FEATURE = *mut XSTATE_FEATURE; +STRUCT!{struct XSTATE_CONFIGURATION { + EnabledFeatures: DWORD64, + EnabledVolatileFeatures: DWORD64, + Size: DWORD, + ControlFlags: DWORD, + Features: [XSTATE_FEATURE; MAXIMUM_XSTATE_FEATURES], + EnabledSupervisorFeatures: DWORD64, + AlignedFeatures: DWORD64, + AllFeatureSize: DWORD, + AllFeatures: [DWORD; MAXIMUM_XSTATE_FEATURES], +}} +BITFIELD!{XSTATE_CONFIGURATION ControlFlags: DWORD [ + OptimizedSave set_OptimizedSave[0..1], + CompactionEnabled set_CompactionEnabled[1..2], +]} +pub type PXSTATE_CONFIGURATION = *mut XSTATE_CONFIGURATION; +STRUCT!{struct MEMORY_BASIC_INFORMATION { + BaseAddress: PVOID, + AllocationBase: PVOID, + AllocationProtect: DWORD, + RegionSize: SIZE_T, + State: DWORD, + Protect: DWORD, + Type: DWORD, +}} +pub type PMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION; +STRUCT!{struct MEMORY_BASIC_INFORMATION32 { + BaseAddress: DWORD, + AllocationBase: DWORD, + AllocationProtect: DWORD, + RegionSize: DWORD, + State: DWORD, + Protect: DWORD, + Type: DWORD, +}} +pub type PMEMORY_BASIC_INFORMATION32 = *mut MEMORY_BASIC_INFORMATION32; +STRUCT!{struct MEMORY_BASIC_INFORMATION64 { // FIXME: align 16 + BaseAddress: ULONGLONG, + AllocationBase: ULONGLONG, + AllocationProtect: DWORD, + __alignment1: DWORD, + RegionSize: ULONGLONG, + State: DWORD, + Protect: DWORD, + Type: DWORD, + __alignment2: DWORD, +}} +pub type PMEMORY_BASIC_INFORMATION64 = *mut MEMORY_BASIC_INFORMATION64; +pub const CFG_CALL_TARGET_VALID: ULONG_PTR = 0x00000001; +pub const CFG_CALL_TARGET_PROCESSED: ULONG_PTR = 0x00000002; +pub const CFG_CALL_TARGET_CONVERT_EXPORT_SUPPRESSED_TO_VALID: ULONG_PTR = 0x00000004; +STRUCT!{struct CFG_CALL_TARGET_INFO { + Offset: ULONG_PTR, + Flags: ULONG_PTR, +}} +pub type PCFG_CALL_TARGET_INFO = *mut CFG_CALL_TARGET_INFO; +pub const SECTION_QUERY: DWORD = 0x0001; +pub const SECTION_MAP_WRITE: DWORD = 0x0002; +pub const SECTION_MAP_READ: DWORD = 0x0004; +pub const SECTION_MAP_EXECUTE: DWORD = 0x0008; +pub const SECTION_EXTEND_SIZE: DWORD = 0x0010; +pub const SECTION_MAP_EXECUTE_EXPLICIT: DWORD = 0x0020; +pub const SECTION_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY + | SECTION_MAP_WRITE | SECTION_MAP_READ | SECTION_MAP_EXECUTE | SECTION_EXTEND_SIZE; +pub const SESSION_QUERY_ACCESS: DWORD = 0x0001; +pub const SESSION_MODIFY_ACCESS: DWORD = 0x0002; +pub const SESSION_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SESSION_QUERY_ACCESS + | SESSION_MODIFY_ACCESS; +pub const MEMORY_PARTITION_QUERY_ACCESS: DWORD = 0x0001; +pub const MEMORY_PARTITION_MODIFY_ACCESS: DWORD = 0x0002; +pub const MEMORY_PARTITION_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE + | MEMORY_PARTITION_QUERY_ACCESS | MEMORY_PARTITION_MODIFY_ACCESS; +pub const PAGE_NOACCESS: DWORD = 0x01; +pub const PAGE_READONLY: DWORD = 0x02; +pub const PAGE_READWRITE: DWORD = 0x04; +pub const PAGE_WRITECOPY: DWORD = 0x08; +pub const PAGE_EXECUTE: DWORD = 0x10; +pub const PAGE_EXECUTE_READ: DWORD = 0x20; +pub const PAGE_EXECUTE_READWRITE: DWORD = 0x40; +pub const PAGE_EXECUTE_WRITECOPY: DWORD = 0x80; +pub const PAGE_GUARD: DWORD = 0x100; +pub const PAGE_NOCACHE: DWORD = 0x200; +pub const PAGE_WRITECOMBINE: DWORD = 0x400; +pub const PAGE_ENCLAVE_THREAD_CONTROL: DWORD = 0x80000000; +pub const PAGE_REVERT_TO_FILE_MAP: DWORD = 0x80000000; +pub const PAGE_TARGETS_NO_UPDATE: DWORD = 0x40000000; +pub const PAGE_TARGETS_INVALID: DWORD = 0x40000000; +pub const PAGE_ENCLAVE_UNVALIDATED: DWORD = 0x20000000; +pub const PAGE_ENCLAVE_DECOMMIT: DWORD = 0x10000000; +pub const MEM_COMMIT: DWORD = 0x1000; +pub const MEM_RESERVE: DWORD = 0x2000; +pub const MEM_DECOMMIT: DWORD = 0x4000; +pub const MEM_RELEASE: DWORD = 0x8000; +pub const MEM_FREE: DWORD = 0x10000; +pub const MEM_PRIVATE: DWORD = 0x20000; +pub const MEM_MAPPED: DWORD = 0x40000; +pub const MEM_RESET: DWORD = 0x80000; +pub const MEM_TOP_DOWN: DWORD = 0x100000; +pub const MEM_WRITE_WATCH: DWORD = 0x200000; +pub const MEM_PHYSICAL: DWORD = 0x400000; +pub const MEM_ROTATE: DWORD = 0x800000; +pub const MEM_DIFFERENT_IMAGE_BASE_OK: DWORD = 0x800000; +pub const MEM_RESET_UNDO: DWORD = 0x1000000; +pub const MEM_LARGE_PAGES: DWORD = 0x20000000; +pub const MEM_4MB_PAGES: DWORD = 0x80000000; +pub const MEM_64K_PAGES: DWORD = MEM_LARGE_PAGES | MEM_PHYSICAL; +pub const SEC_64K_PAGES: DWORD = 0x00080000; +pub const SEC_FILE: DWORD = 0x800000; +pub const SEC_IMAGE: DWORD = 0x1000000; +pub const SEC_PROTECTED_IMAGE: DWORD = 0x2000000; +pub const SEC_RESERVE: DWORD = 0x4000000; +pub const SEC_COMMIT: DWORD = 0x8000000; +pub const SEC_NOCACHE: DWORD = 0x10000000; +pub const SEC_WRITECOMBINE: DWORD = 0x40000000; +pub const SEC_LARGE_PAGES: DWORD = 0x80000000; +pub const SEC_IMAGE_NO_EXECUTE: DWORD = SEC_IMAGE | SEC_NOCACHE; +pub const MEM_IMAGE: DWORD = SEC_IMAGE; +pub const WRITE_WATCH_FLAG_RESET: DWORD = 0x01; +pub const MEM_UNMAP_WITH_TRANSIENT_BOOST: DWORD = 0x01; +pub const ENCLAVE_TYPE_SGX: DWORD = 0x00000001; +pub const ENCLAVE_TYPE_SGX2: DWORD = 0x00000002; +STRUCT!{struct ENCLAVE_CREATE_INFO_SGX { + Secs: [BYTE; 4096], +}} +pub type PENCLAVE_CREATE_INFO_SGX = *mut ENCLAVE_CREATE_INFO_SGX; +STRUCT!{struct ENCLAVE_INIT_INFO_SGX { + SigStruct: [BYTE; 1808], + Reserved1: [BYTE; 240], + EInitToken: [BYTE; 304], + Reserved2: [BYTE; 1744], +}} +pub type PENCLAVE_INIT_INFO_SGX = *mut ENCLAVE_INIT_INFO_SGX; +pub const FILE_READ_DATA: DWORD = 0x0001; +pub const FILE_LIST_DIRECTORY: DWORD = 0x0001; +pub const FILE_WRITE_DATA: DWORD = 0x0002; +pub const FILE_ADD_FILE: DWORD = 0x0002; +pub const FILE_APPEND_DATA: DWORD = 0x0004; +pub const FILE_ADD_SUBDIRECTORY: DWORD = 0x0004; +pub const FILE_CREATE_PIPE_INSTANCE: DWORD = 0x0004; +pub const FILE_READ_EA: DWORD = 0x0008; +pub const FILE_WRITE_EA: DWORD = 0x0010; +pub const FILE_EXECUTE: DWORD = 0x0020; +pub const FILE_TRAVERSE: DWORD = 0x0020; +pub const FILE_DELETE_CHILD: DWORD = 0x0040; +pub const FILE_READ_ATTRIBUTES: DWORD = 0x0080; +pub const FILE_WRITE_ATTRIBUTES: DWORD = 0x0100; +pub const FILE_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF; +pub const FILE_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ | FILE_READ_DATA + | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE; +pub const FILE_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA + | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE; +pub const FILE_GENERIC_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES + | FILE_EXECUTE | SYNCHRONIZE; +pub const FILE_SHARE_READ: DWORD = 0x00000001; +pub const FILE_SHARE_WRITE: DWORD = 0x00000002; +pub const FILE_SHARE_DELETE: DWORD = 0x00000004; +pub const FILE_ATTRIBUTE_READONLY: DWORD = 0x00000001; +pub const FILE_ATTRIBUTE_HIDDEN: DWORD = 0x00000002; +pub const FILE_ATTRIBUTE_SYSTEM: DWORD = 0x00000004; +pub const FILE_ATTRIBUTE_DIRECTORY: DWORD = 0x00000010; +pub const FILE_ATTRIBUTE_ARCHIVE: DWORD = 0x00000020; +pub const FILE_ATTRIBUTE_DEVICE: DWORD = 0x00000040; +pub const FILE_ATTRIBUTE_NORMAL: DWORD = 0x00000080; +pub const FILE_ATTRIBUTE_TEMPORARY: DWORD = 0x00000100; +pub const FILE_ATTRIBUTE_SPARSE_FILE: DWORD = 0x00000200; +pub const FILE_ATTRIBUTE_REPARSE_POINT: DWORD = 0x00000400; +pub const FILE_ATTRIBUTE_COMPRESSED: DWORD = 0x00000800; +pub const FILE_ATTRIBUTE_OFFLINE: DWORD = 0x00001000; +pub const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: DWORD = 0x00002000; +pub const FILE_ATTRIBUTE_ENCRYPTED: DWORD = 0x00004000; +pub const FILE_ATTRIBUTE_INTEGRITY_STREAM: DWORD = 0x00008000; +pub const FILE_ATTRIBUTE_VIRTUAL: DWORD = 0x00010000; +pub const FILE_ATTRIBUTE_NO_SCRUB_DATA: DWORD = 0x00020000; +pub const FILE_ATTRIBUTE_EA: DWORD = 0x00040000; +pub const FILE_ATTRIBUTE_PINNED: DWORD = 0x00080000; +pub const FILE_ATTRIBUTE_UNPINNED: DWORD = 0x00100000; +pub const FILE_ATTRIBUTE_RECALL_ON_OPEN: DWORD = 0x00040000; +pub const FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS: DWORD = 0x00400000; +pub const FILE_NOTIFY_CHANGE_FILE_NAME: DWORD = 0x00000001; +pub const FILE_NOTIFY_CHANGE_DIR_NAME: DWORD = 0x00000002; +pub const FILE_NOTIFY_CHANGE_ATTRIBUTES: DWORD = 0x00000004; +pub const FILE_NOTIFY_CHANGE_SIZE: DWORD = 0x00000008; +pub const FILE_NOTIFY_CHANGE_LAST_WRITE: DWORD = 0x00000010; +pub const FILE_NOTIFY_CHANGE_LAST_ACCESS: DWORD = 0x00000020; +pub const FILE_NOTIFY_CHANGE_CREATION: DWORD = 0x00000040; +pub const FILE_NOTIFY_CHANGE_SECURITY: DWORD = 0x00000100; +pub const FILE_ACTION_ADDED: DWORD = 0x00000001; +pub const FILE_ACTION_REMOVED: DWORD = 0x00000002; +pub const FILE_ACTION_MODIFIED: DWORD = 0x00000003; +pub const FILE_ACTION_RENAMED_OLD_NAME: DWORD = 0x00000004; +pub const FILE_ACTION_RENAMED_NEW_NAME: DWORD = 0x00000005; +pub const MAILSLOT_NO_MESSAGE: DWORD = 0xFFFFFFFF; +pub const MAILSLOT_WAIT_FOREVER: DWORD = 0xFFFFFFFF; +pub const FILE_CASE_SENSITIVE_SEARCH: DWORD = 0x00000001; +pub const FILE_CASE_PRESERVED_NAMES: DWORD = 0x00000002; +pub const FILE_UNICODE_ON_DISK: DWORD = 0x00000004; +pub const FILE_PERSISTENT_ACLS: DWORD = 0x00000008; +pub const FILE_FILE_COMPRESSION: DWORD = 0x00000010; +pub const FILE_VOLUME_QUOTAS: DWORD = 0x00000020; +pub const FILE_SUPPORTS_SPARSE_FILES: DWORD = 0x00000040; +pub const FILE_SUPPORTS_REPARSE_POINTS: DWORD = 0x00000080; +pub const FILE_SUPPORTS_REMOTE_STORAGE: DWORD = 0x00000100; +pub const FILE_RETURNS_CLEANUP_RESULT_INFO: DWORD = 0x00000200; +pub const FILE_VOLUME_IS_COMPRESSED: DWORD = 0x00008000; +pub const FILE_SUPPORTS_OBJECT_IDS: DWORD = 0x00010000; +pub const FILE_SUPPORTS_ENCRYPTION: DWORD = 0x00020000; +pub const FILE_NAMED_STREAMS: DWORD = 0x00040000; +pub const FILE_READ_ONLY_VOLUME: DWORD = 0x00080000; +pub const FILE_SEQUENTIAL_WRITE_ONCE: DWORD = 0x00100000; +pub const FILE_SUPPORTS_TRANSACTIONS: DWORD = 0x00200000; +pub const FILE_SUPPORTS_HARD_LINKS: DWORD = 0x00400000; +pub const FILE_SUPPORTS_EXTENDED_ATTRIBUTES: DWORD = 0x00800000; +pub const FILE_SUPPORTS_OPEN_BY_FILE_ID: DWORD = 0x01000000; +pub const FILE_SUPPORTS_USN_JOURNAL: DWORD = 0x02000000; +pub const FILE_SUPPORTS_INTEGRITY_STREAMS: DWORD = 0x04000000; +pub const FILE_SUPPORTS_BLOCK_REFCOUNTING: DWORD = 0x08000000; +pub const FILE_SUPPORTS_SPARSE_VDL: DWORD = 0x10000000; +pub const FILE_DAX_VOLUME: DWORD = 0x20000000; +pub const FILE_SUPPORTS_GHOSTING: DWORD = 0x40000000; +pub const FILE_INVALID_FILE_ID: LONGLONG = -1; +STRUCT!{struct FILE_ID_128 { + Identifier: [BYTE; 16], +}} +pub type PFILE_ID_128 = *mut FILE_ID_128; +STRUCT!{struct FILE_NOTIFY_INFORMATION { + NextEntryOffset: DWORD, + Action: DWORD, + FileNameLength: DWORD, + FileName: [WCHAR; 1], +}} +UNION!{union FILE_SEGMENT_ELEMENT { + [u64; 1], + Buffer Buffer_mut: PVOID64, + Alignment Alignment_mut: ULONGLONG, +}} +pub type PFILE_SEGMENT_ELEMENT = *mut FILE_SEGMENT_ELEMENT; +pub const FLUSH_FLAGS_FILE_DATA_ONLY: ULONG = 0x00000001; +pub const FLUSH_FLAGS_NO_SYNC: ULONG = 0x00000002; +pub const FLUSH_FLAGS_FILE_DATA_SYNC_ONLY: ULONG = 0x00000004; +STRUCT!{struct REPARSE_GUID_DATA_BUFFER_GenericReparseBuffer { + DataBuffer: [BYTE; 1], +}} +STRUCT!{struct REPARSE_GUID_DATA_BUFFER { + ReparseTag: DWORD, + ReparseDataLength: WORD, + Reserved: WORD, + ReparseGuid: GUID, + GenericReparseBuffer: REPARSE_GUID_DATA_BUFFER_GenericReparseBuffer, +}} +pub type PREPARSE_GUID_DATA_BUFFER = *mut REPARSE_GUID_DATA_BUFFER; +pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: DWORD = 16 * 1024; +pub const IO_REPARSE_TAG_RESERVED_ZERO: DWORD = 0; +pub const IO_REPARSE_TAG_RESERVED_ONE: DWORD = 1; +pub const IO_REPARSE_TAG_RESERVED_TWO: DWORD = 2; +pub const IO_REPARSE_TAG_RESERVED_RANGE: DWORD = IO_REPARSE_TAG_RESERVED_TWO; +#[inline] +pub fn IsReparseTagMicrosoft(_tag: DWORD) -> bool { + (_tag & 0x80000000) != 0 +} +#[inline] +pub fn IsReparseTagNameSurrogate(_tag: DWORD) -> bool { + (_tag & 0x20000000) != 0 +} +#[inline] +pub fn IsReparseTagDirectory(_tag: DWORD) -> bool { + (_tag & 0x10000000) != 0 +} +pub const IO_REPARSE_TAG_MOUNT_POINT: DWORD = 0xA0000003; +pub const IO_REPARSE_TAG_HSM: DWORD = 0xC0000004; +pub const IO_REPARSE_TAG_HSM2: DWORD = 0x80000006; +pub const IO_REPARSE_TAG_SIS: DWORD = 0x80000007; +pub const IO_REPARSE_TAG_WIM: DWORD = 0x80000008; +pub const IO_REPARSE_TAG_CSV: DWORD = 0x80000009; +pub const IO_REPARSE_TAG_DFS: DWORD = 0x8000000A; +pub const IO_REPARSE_TAG_SYMLINK: DWORD = 0xA000000C; +pub const IO_REPARSE_TAG_DFSR: DWORD = 0x80000012; +pub const IO_REPARSE_TAG_DEDUP: DWORD = 0x80000013; +pub const IO_REPARSE_TAG_NFS: DWORD = 0x80000014; +pub const IO_REPARSE_TAG_FILE_PLACEHOLDER: DWORD = 0x80000015; +pub const IO_REPARSE_TAG_WOF: DWORD = 0x80000017; +pub const IO_REPARSE_TAG_WCI: DWORD = 0x80000018; +pub const IO_REPARSE_TAG_GLOBAL_REPARSE: DWORD = 0xA0000019; +pub const IO_REPARSE_TAG_CLOUD: DWORD = 0x9000001A; +pub const IO_REPARSE_TAG_CLOUD_ROOT: DWORD = 0x9000101A; +pub const IO_REPARSE_TAG_CLOUD_ON_DEMAND: DWORD = 0x9000201A; +pub const IO_REPARSE_TAG_CLOUD_ROOT_ON_DEMAND: DWORD = 0x9000301A; +pub const IO_REPARSE_TAG_APPEXECLINK: DWORD = 0x8000001B; +pub const IO_REPARSE_TAG_GVFS: DWORD = 0x9000001C; +pub const IO_REPARSE_TAG_WCI_TOMBSTONE: DWORD = 0xA000001F; +pub const IO_REPARSE_TAG_UNHANDLED: DWORD = 0x80000020; +pub const IO_REPARSE_TAG_ONEDRIVE: DWORD = 0x80000021; +pub const IO_REPARSE_TAG_GVFS_TOMBSTONE: DWORD = 0xA0000022; +pub const SCRUB_DATA_INPUT_FLAG_RESUME: DWORD = 0x00000001; +pub const SCRUB_DATA_INPUT_FLAG_SKIP_IN_SYNC: DWORD = 0x00000002; +pub const SCRUB_DATA_INPUT_FLAG_SKIP_NON_INTEGRITY_DATA: DWORD = 0x00000004; +pub const SCRUB_DATA_OUTPUT_FLAG_INCOMPLETE: DWORD = 0x00000001; +pub const SCRUB_DATA_OUTPUT_FLAG_NON_USER_DATA_RANGE: DWORD = 0x00010000; +pub const SCRUB_DATA_OUTPUT_FLAG_PARITY_EXTENT_DATA_RETURNED: DWORD = 0x00020000; +pub const SCRUB_DATA_OUTPUT_FLAG_RESUME_CONTEXT_LENGTH_SPECIFIED: DWORD = 0x00040000; +STRUCT!{struct SCRUB_DATA_INPUT { + Size: DWORD, + Flags: DWORD, + MaximumIos: DWORD, + Reserved: [DWORD; 17], + ResumeContext: [BYTE; 816], +}} +pub type PSCRUB_DATA_INPUT = *mut SCRUB_DATA_INPUT; +STRUCT!{struct SCRUB_PARITY_EXTENT { + Offset: LONGLONG, + Length: ULONGLONG, +}} +pub type PSCRUB_PARITY_EXTENT = *mut SCRUB_PARITY_EXTENT; +STRUCT!{struct SCRUB_PARITY_EXTENT_DATA { + Size: WORD, + Flags: WORD, + NumberOfParityExtents: WORD, + MaximumNumberOfParityExtents: WORD, + ParityExtents: [SCRUB_PARITY_EXTENT; ANYSIZE_ARRAY], +}} +pub type PSCRUB_PARITY_EXTENT_DATA = *mut SCRUB_PARITY_EXTENT_DATA; +STRUCT!{struct SCRUB_DATA_OUTPUT { + Size: DWORD, + Flags: DWORD, + Status: DWORD, + ErrorFileOffset: ULONGLONG, + ErrorLength: ULONGLONG, + NumberOfBytesRepaired: ULONGLONG, + NumberOfBytesFailed: ULONGLONG, + InternalFileReference: ULONGLONG, + ResumeContextLength: WORD, + ParityExtentDataOffset: WORD, + Reserved: [DWORD; 5], + ResumeContext: [BYTE; 816], +}} +pub type PSCRUB_DATA_OUTPUT = *mut SCRUB_DATA_OUTPUT; +ENUM!{enum SharedVirtualDiskSupportType { + SharedVirtualDisksUnsupported = 0, + SharedVirtualDisksSupported = 1, + SharedVirtualDiskSnapshotsSupported = 3, + SharedVirtualDiskCDPSnapshotsSupported = 7, +}} +ENUM!{enum SharedVirtualDiskHandleState { + SharedVirtualDiskHandleStateNone = 0, + SharedVirtualDiskHandleStateFileShared = 1, + SharedVirtualDiskHandleStateHandleShared = 3, +}} +STRUCT!{struct SHARED_VIRTUAL_DISK_SUPPORT { + SharedVirtualDiskSupport: SharedVirtualDiskSupportType, + HandleState: SharedVirtualDiskHandleState, +}} +pub type PSHARED_VIRTUAL_DISK_SUPPORT = *mut SHARED_VIRTUAL_DISK_SUPPORT; +#[inline] +pub fn IsVirtualDiskFileShared(HandleState: SharedVirtualDiskHandleState) -> bool { + (HandleState & SharedVirtualDiskHandleStateFileShared) != 0 +} +pub const IO_COMPLETION_MODIFY_STATE: DWORD = 0x0002; +pub const IO_COMPLETION_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3; +pub const IO_QOS_MAX_RESERVATION: DWORD64 = 1000000000; +pub const SMB_CCF_APP_INSTANCE_EA_NAME: &'static str = "ClusteredApplicationInstance"; +pub const NETWORK_APP_INSTANCE_CSV_FLAGS_VALID_ONLY_IF_CSV_COORDINATOR: DWORD = 0x00000001; +STRUCT!{struct NETWORK_APP_INSTANCE_EA { + AppInstanceID: GUID, + CsvFlags: DWORD, +}} +pub type PNETWORK_APP_INSTANCE_EA = *mut NETWORK_APP_INSTANCE_EA; +pub const DUPLICATE_CLOSE_SOURCE: DWORD = 0x00000001; +pub const DUPLICATE_SAME_ACCESS: DWORD = 0x00000002; +DEFINE_GUID!{GUID_MAX_POWER_SAVINGS, + 0xa1841308, 0x3541, 0x4fab, 0xbc, 0x81, 0xf7, 0x15, 0x56, 0xf2, 0x0b, 0x4a} +DEFINE_GUID!{GUID_MIN_POWER_SAVINGS, + 0x8c5e7fda, 0xe8bf, 0x4a96, 0x9a, 0x85, 0xa6, 0xe2, 0x3a, 0x8c, 0x63, 0x5c} +DEFINE_GUID!{GUID_TYPICAL_POWER_SAVINGS, + 0x381b4222, 0xf694, 0x41f0, 0x96, 0x85, 0xff, 0x5b, 0xb2, 0x60, 0xdf, 0x2e} +DEFINE_GUID!{NO_SUBGROUP_GUID, + 0xfea3413e, 0x7e05, 0x4911, 0x9a, 0x71, 0x70, 0x03, 0x31, 0xf1, 0xc2, 0x94} +DEFINE_GUID!{ALL_POWERSCHEMES_GUID, + 0x68a1e95e, 0x13ea, 0x41e1, 0x80, 0x11, 0x0c, 0x49, 0x6c, 0xa4, 0x90, 0xb0} +DEFINE_GUID!{GUID_POWERSCHEME_PERSONALITY, + 0x245d8541, 0x3943, 0x4422, 0xb0, 0x25, 0x13, 0xa7, 0x84, 0xf6, 0x79, 0xb7} +DEFINE_GUID!{GUID_ACTIVE_POWERSCHEME, + 0x31f9f286, 0x5084, 0x42fe, 0xb7, 0x20, 0x2b, 0x02, 0x64, 0x99, 0x37, 0x63} +DEFINE_GUID!{GUID_IDLE_RESILIENCY_SUBGROUP, + 0x2e601130, 0x5351, 0x4d9d, 0x8e, 0x4, 0x25, 0x29, 0x66, 0xba, 0xd0, 0x54} +DEFINE_GUID!{GUID_IDLE_RESILIENCY_PERIOD, + 0xc42b79aa, 0xaa3a, 0x484b, 0xa9, 0x8f, 0x2c, 0xf3, 0x2a, 0xa9, 0xa, 0x28} +DEFINE_GUID!{GUID_DEEP_SLEEP_ENABLED, + 0xd502f7ee, 0x1dc7, 0x4efd, 0xa5, 0x5d, 0xf0, 0x4b, 0x6f, 0x5c, 0x5, 0x45} +DEFINE_GUID!{GUID_DEEP_SLEEP_PLATFORM_STATE, + 0xd23f2fb8, 0x9536, 0x4038, 0x9c, 0x94, 0x1c, 0xe0, 0x2e, 0x5c, 0x21, 0x52} +DEFINE_GUID!{GUID_DISK_COALESCING_POWERDOWN_TIMEOUT, + 0xc36f0eb4, 0x2988, 0x4a70, 0x8e, 0xee, 0x8, 0x84, 0xfc, 0x2c, 0x24, 0x33} +DEFINE_GUID!{GUID_EXECUTION_REQUIRED_REQUEST_TIMEOUT, + 0x3166bc41, 0x7e98, 0x4e03, 0xb3, 0x4e, 0xec, 0xf, 0x5f, 0x2b, 0x21, 0x8e} +DEFINE_GUID!{GUID_VIDEO_SUBGROUP, + 0x7516b95f, 0xf776, 0x4464, 0x8c, 0x53, 0x06, 0x16, 0x7f, 0x40, 0xcc, 0x99} +DEFINE_GUID!{GUID_VIDEO_POWERDOWN_TIMEOUT, + 0x3c0bc021, 0xc8a8, 0x4e07, 0xa9, 0x73, 0x6b, 0x14, 0xcb, 0xcb, 0x2b, 0x7e} +DEFINE_GUID!{GUID_VIDEO_ANNOYANCE_TIMEOUT, + 0x82dbcf2d, 0xcd67, 0x40c5, 0xbf, 0xdc, 0x9f, 0x1a, 0x5c, 0xcd, 0x46, 0x63} +DEFINE_GUID!{GUID_VIDEO_ADAPTIVE_PERCENT_INCREASE, + 0xeed904df, 0xb142, 0x4183, 0xb1, 0x0b, 0x5a, 0x11, 0x97, 0xa3, 0x78, 0x64} +DEFINE_GUID!{GUID_VIDEO_DIM_TIMEOUT, + 0x17aaa29b, 0x8b43, 0x4b94, 0xaa, 0xfe, 0x35, 0xf6, 0x4d, 0xaa, 0xf1, 0xee} +DEFINE_GUID!{GUID_VIDEO_ADAPTIVE_POWERDOWN, + 0x90959d22, 0xd6a1, 0x49b9, 0xaf, 0x93, 0xbc, 0xe8, 0x85, 0xad, 0x33, 0x5b} +DEFINE_GUID!{GUID_MONITOR_POWER_ON, + 0x02731015, 0x4510, 0x4526, 0x99, 0xe6, 0xe5, 0xa1, 0x7e, 0xbd, 0x1a, 0xea} +DEFINE_GUID!{GUID_DEVICE_POWER_POLICY_VIDEO_BRIGHTNESS, + 0xaded5e82, 0xb909, 0x4619, 0x99, 0x49, 0xf5, 0xd7, 0x1d, 0xac, 0x0b, 0xcb} +DEFINE_GUID!{GUID_DEVICE_POWER_POLICY_VIDEO_DIM_BRIGHTNESS, + 0xf1fbfde2, 0xa960, 0x4165, 0x9f, 0x88, 0x50, 0x66, 0x79, 0x11, 0xce, 0x96} +DEFINE_GUID!{GUID_VIDEO_CURRENT_MONITOR_BRIGHTNESS, + 0x8ffee2c6, 0x2d01, 0x46be, 0xad, 0xb9, 0x39, 0x8a, 0xdd, 0xc5, 0xb4, 0xff} +DEFINE_GUID!{GUID_VIDEO_ADAPTIVE_DISPLAY_BRIGHTNESS, + 0xfbd9aa66, 0x9553, 0x4097, 0xba, 0x44, 0xed, 0x6e, 0x9d, 0x65, 0xea, 0xb8} +DEFINE_GUID!{GUID_CONSOLE_DISPLAY_STATE, + 0x6fe69556, 0x704a, 0x47a0, 0x8f, 0x24, 0xc2, 0x8d, 0x93, 0x6f, 0xda, 0x47} +DEFINE_GUID!{GUID_ALLOW_DISPLAY_REQUIRED, + 0xa9ceb8da, 0xcd46, 0x44fb, 0xa9, 0x8b, 0x02, 0xaf, 0x69, 0xde, 0x46, 0x23} +DEFINE_GUID!{GUID_VIDEO_CONSOLE_LOCK_TIMEOUT, + 0x8ec4b3a5, 0x6868, 0x48c2, 0xbe, 0x75, 0x4f, 0x30, 0x44, 0xbe, 0x88, 0xa7} +DEFINE_GUID!{GUID_ADAPTIVE_POWER_BEHAVIOR_SUBGROUP, + 0x8619b916, 0xe004, 0x4dd8, 0x9b, 0x66, 0xda, 0xe8, 0x6f, 0x80, 0x66, 0x98} +DEFINE_GUID!{GUID_NON_ADAPTIVE_INPUT_TIMEOUT, + 0x5adbbfbc, 0x74e, 0x4da1, 0xba, 0x38, 0xdb, 0x8b, 0x36, 0xb2, 0xc8, 0xf3} +DEFINE_GUID!{GUID_ADAPTIVE_INPUT_CONTROLLER_STATE, + 0xe98fae9, 0xf45a, 0x4de1, 0xa7, 0x57, 0x60, 0x31, 0xf1, 0x97, 0xf6, 0xea} +DEFINE_GUID!{GUID_DISK_SUBGROUP, + 0x0012ee47, 0x9041, 0x4b5d, 0x9b, 0x77, 0x53, 0x5f, 0xba, 0x8b, 0x14, 0x42} +DEFINE_GUID!{GUID_DISK_MAX_POWER, + 0x51dea550, 0xbb38, 0x4bc4, 0x99, 0x1b, 0xea, 0xcf, 0x37, 0xbe, 0x5e, 0xc8} +DEFINE_GUID!{GUID_DISK_POWERDOWN_TIMEOUT, + 0x6738e2c4, 0xe8a5, 0x4a42, 0xb1, 0x6a, 0xe0, 0x40, 0xe7, 0x69, 0x75, 0x6e} +DEFINE_GUID!{GUID_DISK_IDLE_TIMEOUT, + 0x58e39ba8, 0xb8e6, 0x4ef6, 0x90, 0xd0, 0x89, 0xae, 0x32, 0xb2, 0x58, 0xd6} +DEFINE_GUID!{GUID_DISK_BURST_IGNORE_THRESHOLD, + 0x80e3c60e, 0xbb94, 0x4ad8, 0xbb, 0xe0, 0x0d, 0x31, 0x95, 0xef, 0xc6, 0x63} +DEFINE_GUID!{GUID_DISK_ADAPTIVE_POWERDOWN, + 0x396a32e1, 0x499a, 0x40b2, 0x91, 0x24, 0xa9, 0x6a, 0xfe, 0x70, 0x76, 0x67} +DEFINE_GUID!{GUID_SLEEP_SUBGROUP, + 0x238c9fa8, 0x0aad, 0x41ed, 0x83, 0xf4, 0x97, 0xbe, 0x24, 0x2c, 0x8f, 0x20} +DEFINE_GUID!{GUID_SLEEP_IDLE_THRESHOLD, + 0x81cd32e0, 0x7833, 0x44f3, 0x87, 0x37, 0x70, 0x81, 0xf3, 0x8d, 0x1f, 0x70} +DEFINE_GUID!{GUID_STANDBY_TIMEOUT, + 0x29f6c1db, 0x86da, 0x48c5, 0x9f, 0xdb, 0xf2, 0xb6, 0x7b, 0x1f, 0x44, 0xda} +DEFINE_GUID!{GUID_UNATTEND_SLEEP_TIMEOUT, + 0x7bc4a2f9, 0xd8fc, 0x4469, 0xb0, 0x7b, 0x33, 0xeb, 0x78, 0x5a, 0xac, 0xa0} +DEFINE_GUID!{GUID_HIBERNATE_TIMEOUT, + 0x9d7815a6, 0x7ee4, 0x497e, 0x88, 0x88, 0x51, 0x5a, 0x05, 0xf0, 0x23, 0x64} +DEFINE_GUID!{GUID_HIBERNATE_FASTS4_POLICY, + 0x94ac6d29, 0x73ce, 0x41a6, 0x80, 0x9f, 0x63, 0x63, 0xba, 0x21, 0xb4, 0x7e} +DEFINE_GUID!{GUID_CRITICAL_POWER_TRANSITION, + 0xb7a27025, 0xe569, 0x46c2, 0xa5, 0x04, 0x2b, 0x96, 0xca, 0xd2, 0x25, 0xa1} +DEFINE_GUID!{GUID_SYSTEM_AWAYMODE, + 0x98a7f580, 0x01f7, 0x48aa, 0x9c, 0x0f, 0x44, 0x35, 0x2c, 0x29, 0xe5, 0xc0} +DEFINE_GUID!{GUID_ALLOW_AWAYMODE, + 0x25dfa149, 0x5dd1, 0x4736, 0xb5, 0xab, 0xe8, 0xa3, 0x7b, 0x5b, 0x81, 0x87} +DEFINE_GUID!{GUID_USER_PRESENCE_PREDICTION, + 0x82011705, 0xfb95, 0x4d46, 0x8d, 0x35, 0x40, 0x42, 0xb1, 0xd2, 0xd, 0xef} +DEFINE_GUID!{GUID_STANDBY_BUDGET_GRACE_PERIOD, + 0x60c07fe1, 0x0556, 0x45cf, 0x99, 0x03, 0xd5, 0x6e, 0x32, 0x21, 0x2, 0x42} +DEFINE_GUID!{GUID_STANDBY_BUDGET_PERCENT, + 0x9fe527be, 0x1b70, 0x48da, 0x93, 0x0d, 0x7b, 0xcf, 0x17, 0xb4, 0x49, 0x90} +DEFINE_GUID!{GUID_STANDBY_RESERVE_GRACE_PERIOD, + 0xc763ee92, 0x71e8, 0x4127, 0x84, 0xeb, 0xf6, 0xed, 0x04, 0x3a, 0x3e, 0x3d} +DEFINE_GUID!{GUID_STANDBY_RESERVE_TIME, + 0x468fe7e5, 0x1158, 0x46ec, 0x88, 0xbc, 0x5b, 0x96, 0xc9, 0xe4, 0x4f, 0xd0} +DEFINE_GUID!{GUID_STANDBY_RESET_PERCENT, + 0x49cb11a5, 0x56e2, 0x4afb, 0x9d, 0x38, 0x3d, 0xf4, 0x78, 0x72, 0xe2, 0x1b} +DEFINE_GUID!{GUID_ALLOW_STANDBY_STATES, + 0xabfc2519, 0x3608, 0x4c2a, 0x94, 0xea, 0x17, 0x1b, 0x0e, 0xd5, 0x46, 0xab} +DEFINE_GUID!{GUID_ALLOW_RTC_WAKE, + 0xbd3b718a, 0x0680, 0x4d9d, 0x8a, 0xb2, 0xe1, 0xd2, 0xb4, 0xac, 0x80, 0x6d} +DEFINE_GUID!{GUID_ALLOW_SYSTEM_REQUIRED, + 0xa4b195f5, 0x8225, 0x47d8, 0x80, 0x12, 0x9d, 0x41, 0x36, 0x97, 0x86, 0xe2} +DEFINE_GUID!{GUID_POWER_SAVING_STATUS, + 0xe00958c0, 0xc213, 0x4ace, 0xac, 0x77, 0xfe, 0xcc, 0xed, 0x2e, 0xee, 0xa5} +DEFINE_GUID!{GUID_ENERGY_SAVER_SUBGROUP, + 0xde830923, 0xa562, 0x41af, 0xa0, 0x86, 0xe3, 0xa2, 0xc6, 0xba, 0xd2, 0xda} +DEFINE_GUID!{GUID_ENERGY_SAVER_BATTERY_THRESHOLD, + 0xe69653ca, 0xcf7f, 0x4f05, 0xaa, 0x73, 0xcb, 0x83, 0x3f, 0xa9, 0x0a, 0xd4} +DEFINE_GUID!{GUID_ENERGY_SAVER_BRIGHTNESS, + 0x13d09884, 0xf74e, 0x474a, 0xa8, 0x52, 0xb6, 0xbd, 0xe8, 0xad, 0x03, 0xa8} +DEFINE_GUID!{GUID_ENERGY_SAVER_POLICY, + 0x5c5bb349, 0xad29, 0x4ee2, 0x9d, 0xb, 0x2b, 0x25, 0x27, 0xf, 0x7a, 0x81} +DEFINE_GUID!{GUID_SYSTEM_BUTTON_SUBGROUP, + 0x4f971e89, 0xeebd, 0x4455, 0xa8, 0xde, 0x9e, 0x59, 0x04, 0x0e, 0x73, 0x47} +pub const POWERBUTTON_ACTION_INDEX_NOTHING: DWORD = 0; +pub const POWERBUTTON_ACTION_INDEX_SLEEP: DWORD = 1; +pub const POWERBUTTON_ACTION_INDEX_HIBERNATE: DWORD = 2; +pub const POWERBUTTON_ACTION_INDEX_SHUTDOWN: DWORD = 3; +pub const POWERBUTTON_ACTION_INDEX_TURN_OFF_THE_DISPLAY: DWORD = 4; +pub const POWERBUTTON_ACTION_VALUE_NOTHING: DWORD = 0; +pub const POWERBUTTON_ACTION_VALUE_SLEEP: DWORD = 2; +pub const POWERBUTTON_ACTION_VALUE_HIBERNATE: DWORD = 3; +pub const POWERBUTTON_ACTION_VALUE_SHUTDOWN: DWORD = 6; +pub const POWERBUTTON_ACTION_VALUE_TURN_OFF_THE_DISPLAY: DWORD = 8; +DEFINE_GUID!{GUID_POWERBUTTON_ACTION, + 0x7648efa3, 0xdd9c, 0x4e3e, 0xb5, 0x66, 0x50, 0xf9, 0x29, 0x38, 0x62, 0x80} +DEFINE_GUID!{GUID_SLEEPBUTTON_ACTION, + 0x96996bc0, 0xad50, 0x47ec, 0x92, 0x3b, 0x6f, 0x41, 0x87, 0x4d, 0xd9, 0xeb} +DEFINE_GUID!{GUID_USERINTERFACEBUTTON_ACTION, + 0xa7066653, 0x8d6c, 0x40a8, 0x91, 0x0e, 0xa1, 0xf5, 0x4b, 0x84, 0xc7, 0xe5} +DEFINE_GUID!{GUID_LIDCLOSE_ACTION, + 0x5ca83367, 0x6e45, 0x459f, 0xa2, 0x7b, 0x47, 0x6b, 0x1d, 0x01, 0xc9, 0x36} +DEFINE_GUID!{GUID_LIDOPEN_POWERSTATE, + 0x99ff10e7, 0x23b1, 0x4c07, 0xa9, 0xd1, 0x5c, 0x32, 0x06, 0xd7, 0x41, 0xb4} +DEFINE_GUID!{GUID_BATTERY_SUBGROUP, + 0xe73a048d, 0xbf27, 0x4f12, 0x97, 0x31, 0x8b, 0x20, 0x76, 0xe8, 0x89, 0x1f} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_ACTION_0, + 0x637ea02f, 0xbbcb, 0x4015, 0x8e, 0x2c, 0xa1, 0xc7, 0xb9, 0xc0, 0xb5, 0x46} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_LEVEL_0, + 0x9a66d8d7, 0x4ff7, 0x4ef9, 0xb5, 0xa2, 0x5a, 0x32, 0x6c, 0xa2, 0xa4, 0x69} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_FLAGS_0, + 0x5dbb7c9f, 0x38e9, 0x40d2, 0x97, 0x49, 0x4f, 0x8a, 0x0e, 0x9f, 0x64, 0x0f} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_ACTION_1, + 0xd8742dcb, 0x3e6a, 0x4b3c, 0xb3, 0xfe, 0x37, 0x46, 0x23, 0xcd, 0xcf, 0x06} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_LEVEL_1, + 0x8183ba9a, 0xe910, 0x48da, 0x87, 0x69, 0x14, 0xae, 0x6d, 0xc1, 0x17, 0x0a} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_FLAGS_1, + 0xbcded951, 0x187b, 0x4d05, 0xbc, 0xcc, 0xf7, 0xe5, 0x19, 0x60, 0xc2, 0x58} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_ACTION_2, + 0x421cba38, 0x1a8e, 0x4881, 0xac, 0x89, 0xe3, 0x3a, 0x8b, 0x04, 0xec, 0xe4} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_LEVEL_2, + 0x07a07ca2, 0xadaf, 0x40d7, 0xb0, 0x77, 0x53, 0x3a, 0xad, 0xed, 0x1b, 0xfa} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_FLAGS_2, + 0x7fd2f0c4, 0xfeb7, 0x4da3, 0x81, 0x17, 0xe3, 0xfb, 0xed, 0xc4, 0x65, 0x82} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_ACTION_3, + 0x80472613, 0x9780, 0x455e, 0xb3, 0x08, 0x72, 0xd3, 0x00, 0x3c, 0xf2, 0xf8} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_LEVEL_3, + 0x58afd5a6, 0xc2dd, 0x47d2, 0x9f, 0xbf, 0xef, 0x70, 0xcc, 0x5c, 0x59, 0x65} +DEFINE_GUID!{GUID_BATTERY_DISCHARGE_FLAGS_3, + 0x73613ccf, 0xdbfa, 0x4279, 0x83, 0x56, 0x49, 0x35, 0xf6, 0xbf, 0x62, 0xf3} +DEFINE_GUID!{GUID_PROCESSOR_SETTINGS_SUBGROUP, + 0x54533251, 0x82be, 0x4824, 0x96, 0xc1, 0x47, 0xb6, 0x0b, 0x74, 0x0d, 0x00} +DEFINE_GUID!{GUID_PROCESSOR_THROTTLE_POLICY, + 0x57027304, 0x4af6, 0x4104, 0x92, 0x60, 0xe3, 0xd9, 0x52, 0x48, 0xfc, 0x36} +pub const PERFSTATE_POLICY_CHANGE_IDEAL: DWORD = 0; +pub const PERFSTATE_POLICY_CHANGE_SINGLE: DWORD = 1; +pub const PERFSTATE_POLICY_CHANGE_ROCKET: DWORD = 2; +pub const PERFSTATE_POLICY_CHANGE_IDEAL_AGGRESSIVE: DWORD = 3; +pub const PERFSTATE_POLICY_CHANGE_DECREASE_MAX: DWORD = PERFSTATE_POLICY_CHANGE_ROCKET; +pub const PERFSTATE_POLICY_CHANGE_INCREASE_MAX: DWORD = PERFSTATE_POLICY_CHANGE_IDEAL_AGGRESSIVE; +DEFINE_GUID!{GUID_PROCESSOR_THROTTLE_MAXIMUM, + 0xbc5038f7, 0x23e0, 0x4960, 0x96, 0xda, 0x33, 0xab, 0xaf, 0x59, 0x35, 0xec} +DEFINE_GUID!{GUID_PROCESSOR_THROTTLE_MAXIMUM_1, + 0xbc5038f7, 0x23e0, 0x4960, 0x96, 0xda, 0x33, 0xab, 0xaf, 0x59, 0x35, 0xed} +DEFINE_GUID!{GUID_PROCESSOR_THROTTLE_MINIMUM, + 0x893dee8e, 0x2bef, 0x41e0, 0x89, 0xc6, 0xb5, 0x5d, 0x09, 0x29, 0x96, 0x4c} +DEFINE_GUID!{GUID_PROCESSOR_THROTTLE_MINIMUM_1, + 0x893dee8e, 0x2bef, 0x41e0, 0x89, 0xc6, 0xb5, 0x5d, 0x09, 0x29, 0x96, 0x4d} +DEFINE_GUID!{GUID_PROCESSOR_FREQUENCY_LIMIT, + 0x75b0ae3f, 0xbce0, 0x45a7, 0x8c, 0x89, 0xc9, 0x61, 0x1c, 0x25, 0xe1, 0x00} +DEFINE_GUID!{GUID_PROCESSOR_FREQUENCY_LIMIT_1, + 0x75b0ae3f, 0xbce0, 0x45a7, 0x8c, 0x89, 0xc9, 0x61, 0x1c, 0x25, 0xe1, 0x01} +DEFINE_GUID!{GUID_PROCESSOR_ALLOW_THROTTLING, + 0x3b04d4fd, 0x1cc7, 0x4f23, 0xab, 0x1c, 0xd1, 0x33, 0x78, 0x19, 0xc4, 0xbb} +pub const PROCESSOR_THROTTLE_DISABLED: DWORD = 0; +pub const PROCESSOR_THROTTLE_ENABLED: DWORD = 1; +pub const PROCESSOR_THROTTLE_AUTOMATIC: DWORD = 2; +DEFINE_GUID!{GUID_PROCESSOR_IDLESTATE_POLICY, + 0x68f262a7, 0xf621, 0x4069, 0xb9, 0xa5, 0x48, 0x74, 0x16, 0x9b, 0xe2, 0x3c} +DEFINE_GUID!{GUID_PROCESSOR_PERFSTATE_POLICY, + 0xbbdc3814, 0x18e9, 0x4463, 0x8a, 0x55, 0xd1, 0x97, 0x32, 0x7c, 0x45, 0xc0} +DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_THRESHOLD, + 0x06cadf0e, 0x64ed, 0x448a, 0x89, 0x27, 0xce, 0x7b, 0xf9, 0x0e, 0xb3, 0x5d} +DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_THRESHOLD_1, + 0x06cadf0e, 0x64ed, 0x448a, 0x89, 0x27, 0xce, 0x7b, 0xf9, 0x0e, 0xb3, 0x5e} +DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_THRESHOLD, + 0x12a0ab44, 0xfe28, 0x4fa9, 0xb3, 0xbd, 0x4b, 0x64, 0xf4, 0x49, 0x60, 0xa6} +DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_THRESHOLD_1, + 0x12a0ab44, 0xfe28, 0x4fa9, 0xb3, 0xbd, 0x4b, 0x64, 0xf4, 0x49, 0x60, 0xa7} +DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_POLICY, + 0x465e1f50, 0xb610, 0x473a, 0xab, 0x58, 0x0, 0xd1, 0x7, 0x7d, 0xc4, 0x18} +DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_POLICY_1, + 0x465e1f50, 0xb610, 0x473a, 0xab, 0x58, 0x0, 0xd1, 0x7, 0x7d, 0xc4, 0x19} +DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_POLICY, + 0x40fbefc7, 0x2e9d, 0x4d25, 0xa1, 0x85, 0xc, 0xfd, 0x85, 0x74, 0xba, 0xc6} +DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_POLICY_1, + 0x40fbefc7, 0x2e9d, 0x4d25, 0xa1, 0x85, 0xc, 0xfd, 0x85, 0x74, 0xba, 0xc7} +DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_TIME, + 0x984cf492, 0x3bed, 0x4488, 0xa8, 0xf9, 0x42, 0x86, 0xc9, 0x7b, 0xf5, 0xaa} +DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_TIME_1, + 0x984cf492, 0x3bed, 0x4488, 0xa8, 0xf9, 0x42, 0x86, 0xc9, 0x7b, 0xf5, 0xab} +DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_TIME, + 0xd8edeb9b, 0x95cf, 0x4f95, 0xa7, 0x3c, 0xb0, 0x61, 0x97, 0x36, 0x93, 0xc8} +DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_TIME_1, + 0xd8edeb9b, 0x95cf, 0x4f95, 0xa7, 0x3c, 0xb0, 0x61, 0x97, 0x36, 0x93, 0xc9} +DEFINE_GUID!{GUID_PROCESSOR_PERF_TIME_CHECK, + 0x4d2b0152, 0x7d5c, 0x498b, 0x88, 0xe2, 0x34, 0x34, 0x53, 0x92, 0xa2, 0xc5} +DEFINE_GUID!{GUID_PROCESSOR_PERF_BOOST_POLICY, + 0x45bcc044, 0xd885, 0x43e2, 0x86, 0x5, 0xee, 0xe, 0xc6, 0xe9, 0x6b, 0x59} +pub const PROCESSOR_PERF_BOOST_POLICY_DISABLED: DWORD = 0; +pub const PROCESSOR_PERF_BOOST_POLICY_MAX: DWORD = 100; +DEFINE_GUID!{GUID_PROCESSOR_PERF_BOOST_MODE, + 0xbe337238, 0xd82, 0x4146, 0xa9, 0x60, 0x4f, 0x37, 0x49, 0xd4, 0x70, 0xc7} +pub const PROCESSOR_PERF_BOOST_MODE_DISABLED: DWORD = 0; +pub const PROCESSOR_PERF_BOOST_MODE_ENABLED: DWORD = 1; +pub const PROCESSOR_PERF_BOOST_MODE_AGGRESSIVE: DWORD = 2; +pub const PROCESSOR_PERF_BOOST_MODE_EFFICIENT_ENABLED: DWORD = 3; +pub const PROCESSOR_PERF_BOOST_MODE_EFFICIENT_AGGRESSIVE: DWORD = 4; +pub const PROCESSOR_PERF_BOOST_MODE_AGGRESSIVE_AT_GUARANTEED: DWORD = 5; +pub const PROCESSOR_PERF_BOOST_MODE_EFFICIENT_AGGRESSIVE_AT_GUARANTEED: DWORD = 6; +pub const PROCESSOR_PERF_BOOST_MODE_MAX: DWORD + = PROCESSOR_PERF_BOOST_MODE_EFFICIENT_AGGRESSIVE_AT_GUARANTEED; +DEFINE_GUID!{GUID_PROCESSOR_PERF_AUTONOMOUS_MODE, + 0x8baa4a8a, 0x14c6, 0x4451, 0x8e, 0x8b, 0x14, 0xbd, 0xbd, 0x19, 0x75, 0x37} +pub const PROCESSOR_PERF_AUTONOMOUS_MODE_DISABLED: DWORD = 0; +pub const PROCESSOR_PERF_AUTONOMOUS_MODE_ENABLED: DWORD = 1; +DEFINE_GUID!{GUID_PROCESSOR_PERF_ENERGY_PERFORMANCE_PREFERENCE, + 0x36687f9e, 0xe3a5, 0x4dbf, 0xb1, 0xdc, 0x15, 0xeb, 0x38, 0x1c, 0x68, 0x63} +pub const PROCESSOR_PERF_PERFORMANCE_PREFERENCE: DWORD = 0xff; +pub const PROCESSOR_PERF_ENERGY_PREFERENCE: DWORD = 0; +DEFINE_GUID!{GUID_PROCESSOR_PERF_AUTONOMOUS_ACTIVITY_WINDOW, + 0xcfeda3d0, 0x7697, 0x4566, 0xa9, 0x22, 0xa9, 0x8, 0x6c, 0xd4, 0x9d, 0xfa} +pub const PROCESSOR_PERF_MINIMUM_ACTIVITY_WINDOW: DWORD = 0; +pub const PROCESSOR_PERF_MAXIMUM_ACTIVITY_WINDOW: DWORD = 1270000000; +DEFINE_GUID!{GUID_PROCESSOR_DUTY_CYCLING, + 0x4e4450b3, 0x6179, 0x4e91, 0xb8, 0xf1, 0x5b, 0xb9, 0x93, 0x8f, 0x81, 0xa1} +pub const PROCESSOR_DUTY_CYCLING_DISABLED: DWORD = 0; +pub const PROCESSOR_DUTY_CYCLING_ENABLED: DWORD = 1; +DEFINE_GUID!{GUID_PROCESSOR_IDLE_ALLOW_SCALING, + 0x6c2993b0, 0x8f48, 0x481f, 0xbc, 0xc6, 0x0, 0xdd, 0x27, 0x42, 0xaa, 0x6} +DEFINE_GUID!{GUID_PROCESSOR_IDLE_DISABLE, + 0x5d76a2ca, 0xe8c0, 0x402f, 0xa1, 0x33, 0x21, 0x58, 0x49, 0x2d, 0x58, 0xad} +DEFINE_GUID!{GUID_PROCESSOR_IDLE_STATE_MAXIMUM, + 0x9943e905, 0x9a30, 0x4ec1, 0x9b, 0x99, 0x44, 0xdd, 0x3b, 0x76, 0xf7, 0xa2} +DEFINE_GUID!{GUID_PROCESSOR_IDLE_TIME_CHECK, + 0xc4581c31, 0x89ab, 0x4597, 0x8e, 0x2b, 0x9c, 0x9c, 0xab, 0x44, 0xe, 0x6b} +DEFINE_GUID!{GUID_PROCESSOR_IDLE_DEMOTE_THRESHOLD, + 0x4b92d758, 0x5a24, 0x4851, 0xa4, 0x70, 0x81, 0x5d, 0x78, 0xae, 0xe1, 0x19} +DEFINE_GUID!{GUID_PROCESSOR_IDLE_PROMOTE_THRESHOLD, + 0x7b224883, 0xb3cc, 0x4d79, 0x81, 0x9f, 0x83, 0x74, 0x15, 0x2c, 0xbe, 0x7c} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_INCREASE_THRESHOLD, + 0xdf142941, 0x20f3, 0x4edf, 0x9a, 0x4a, 0x9c, 0x83, 0xd3, 0xd7, 0x17, 0xd1} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_DECREASE_THRESHOLD, + 0x68dd2f27, 0xa4ce, 0x4e11, 0x84, 0x87, 0x37, 0x94, 0xe4, 0x13, 0x5d, 0xfa} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_INCREASE_POLICY, + 0xc7be0679, 0x2817, 0x4d69, 0x9d, 0x02, 0x51, 0x9a, 0x53, 0x7e, 0xd0, 0xc6} +pub const CORE_PARKING_POLICY_CHANGE_IDEAL: DWORD = 0; +pub const CORE_PARKING_POLICY_CHANGE_SINGLE: DWORD = 1; +pub const CORE_PARKING_POLICY_CHANGE_ROCKET: DWORD = 2; +pub const CORE_PARKING_POLICY_CHANGE_MULTISTEP: DWORD = 3; +pub const CORE_PARKING_POLICY_CHANGE_MAX: DWORD = CORE_PARKING_POLICY_CHANGE_MULTISTEP; +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_DECREASE_POLICY, + 0x71021b41, 0xc749, 0x4d21, 0xbe, 0x74, 0xa0, 0x0f, 0x33, 0x5d, 0x58, 0x2b} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_MAX_CORES, + 0xea062031, 0x0e34, 0x4ff1, 0x9b, 0x6d, 0xeb, 0x10, 0x59, 0x33, 0x40, 0x28} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_MAX_CORES_1, + 0xea062031, 0x0e34, 0x4ff1, 0x9b, 0x6d, 0xeb, 0x10, 0x59, 0x33, 0x40, 0x29} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_MIN_CORES, + 0x0cc5b647, 0xc1df, 0x4637, 0x89, 0x1a, 0xde, 0xc3, 0x5c, 0x31, 0x85, 0x83} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_MIN_CORES_1, + 0x0cc5b647, 0xc1df, 0x4637, 0x89, 0x1a, 0xde, 0xc3, 0x5c, 0x31, 0x85, 0x84} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_INCREASE_TIME, + 0x2ddd5a84, 0x5a71, 0x437e, 0x91, 0x2a, 0xdb, 0x0b, 0x8c, 0x78, 0x87, 0x32} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_DECREASE_TIME, + 0xdfd10d17, 0xd5eb, 0x45dd, 0x87, 0x7a, 0x9a, 0x34, 0xdd, 0xd1, 0x5c, 0x82} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_DECREASE_FACTOR, + 0x8f7b45e3, 0xc393, 0x480a, 0x87, 0x8c, 0xf6, 0x7a, 0xc3, 0xd0, 0x70, 0x82} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_THRESHOLD, + 0x5b33697b, 0xe89d, 0x4d38, 0xaa, 0x46, 0x9e, 0x7d, 0xfb, 0x7c, 0xd2, 0xf9} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_AFFINITY_WEIGHTING, + 0xe70867f1, 0xfa2f, 0x4f4e, 0xae, 0xa1, 0x4d, 0x8a, 0x0b, 0xa2, 0x3b, 0x20} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_DECREASE_FACTOR, + 0x1299023c, 0xbc28, 0x4f0a, 0x81, 0xec, 0xd3, 0x29, 0x5a, 0x8d, 0x81, 0x5d} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_THRESHOLD, + 0x9ac18e92, 0xaa3c, 0x4e27, 0xb3, 0x07, 0x01, 0xae, 0x37, 0x30, 0x71, 0x29} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_WEIGHTING, + 0x8809c2d8, 0xb155, 0x42d4, 0xbc, 0xda, 0x0d, 0x34, 0x56, 0x51, 0xb1, 0xdb} +DEFINE_GUID!{GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_THRESHOLD, + 0x943c8cb6, 0x6f93, 0x4227, 0xad, 0x87, 0xe9, 0xa3, 0xfe, 0xec, 0x08, 0xd1} +DEFINE_GUID!{GUID_PROCESSOR_PARKING_CORE_OVERRIDE, + 0xa55612aa, 0xf624, 0x42c6, 0xa4, 0x43, 0x73, 0x97, 0xd0, 0x64, 0xc0, 0x4f} +DEFINE_GUID!{GUID_PROCESSOR_PARKING_PERF_STATE, + 0x447235c7, 0x6a8d, 0x4cc0, 0x8e, 0x24, 0x9e, 0xaf, 0x70, 0xb9, 0x6e, 0x2b} +DEFINE_GUID!{GUID_PROCESSOR_PARKING_PERF_STATE_1, + 0x447235c7, 0x6a8d, 0x4cc0, 0x8e, 0x24, 0x9e, 0xaf, 0x70, 0xb9, 0x6e, 0x2c} +DEFINE_GUID!{GUID_PROCESSOR_PARKING_CONCURRENCY_THRESHOLD, + 0x2430ab6f, 0xa520, 0x44a2, 0x96, 0x01, 0xf7, 0xf2, 0x3b, 0x51, 0x34, 0xb1} +DEFINE_GUID!{GUID_PROCESSOR_PARKING_HEADROOM_THRESHOLD, + 0xf735a673, 0x2066, 0x4f80, 0xa0, 0xc5, 0xdd, 0xee, 0x0c, 0xf1, 0xbf, 0x5d} +DEFINE_GUID!{GUID_PROCESSOR_PARKING_DISTRIBUTION_THRESHOLD, + 0x4bdaf4e9, 0xd103, 0x46d7, 0xa5, 0xf0, 0x62, 0x80, 0x12, 0x16, 0x16, 0xef} +DEFINE_GUID!{GUID_PROCESSOR_PERF_HISTORY, + 0x7d24baa7, 0x0b84, 0x480f, 0x84, 0x0c, 0x1b, 0x07, 0x43, 0xc0, 0x0f, 0x5f} +DEFINE_GUID!{GUID_PROCESSOR_PERF_HISTORY_1, + 0x7d24baa7, 0x0b84, 0x480f, 0x84, 0x0c, 0x1b, 0x07, 0x43, 0xc0, 0x0f, 0x60} +DEFINE_GUID!{GUID_PROCESSOR_PERF_INCREASE_HISTORY, + 0x99b3ef01, 0x752f, 0x46a1, 0x80, 0xfb, 0x77, 0x30, 0x1, 0x1f, 0x23, 0x54} +DEFINE_GUID!{GUID_PROCESSOR_PERF_DECREASE_HISTORY, + 0x300f6f8, 0xabd6, 0x45a9, 0xb7, 0x4f, 0x49, 0x8, 0x69, 0x1a, 0x40, 0xb5} +DEFINE_GUID!{GUID_PROCESSOR_PERF_CORE_PARKING_HISTORY, + 0x77d7f282, 0x8f1a, 0x42cd, 0x85, 0x37, 0x45, 0x45, 0xa, 0x83, 0x9b, 0xe8} +DEFINE_GUID!{GUID_PROCESSOR_PERF_LATENCY_HINT, + 0x0822df31, 0x9c83, 0x441c, 0xa0, 0x79, 0x0d, 0xe4, 0xcf, 0x00, 0x9c, 0x7b} +DEFINE_GUID!{GUID_PROCESSOR_PERF_LATENCY_HINT_PERF, + 0x619b7505, 0x3b, 0x4e82, 0xb7, 0xa6, 0x4d, 0xd2, 0x9c, 0x30, 0x9, 0x71} +DEFINE_GUID!{GUID_PROCESSOR_PERF_LATENCY_HINT_PERF_1, + 0x619b7505, 0x3b, 0x4e82, 0xb7, 0xa6, 0x4d, 0xd2, 0x9c, 0x30, 0x9, 0x72} +DEFINE_GUID!{GUID_PROCESSOR_LATENCY_HINT_MIN_UNPARK, + 0x616cdaa5, 0x695e, 0x4545, 0x97, 0xad, 0x97, 0xdc, 0x2d, 0x1b, 0xdd, 0x88} +DEFINE_GUID!{GUID_PROCESSOR_LATENCY_HINT_MIN_UNPARK_1, + 0x616cdaa5, 0x695e, 0x4545, 0x97, 0xad, 0x97, 0xdc, 0x2d, 0x1b, 0xdd, 0x89} +DEFINE_GUID!{GUID_PROCESSOR_DISTRIBUTE_UTILITY, + 0xe0007330, 0xf589, 0x42ed, 0xa4, 0x01, 0x5d, 0xdb, 0x10, 0xe7, 0x85, 0xd3} +DEFINE_GUID!{GUID_PROCESSOR_HETEROGENEOUS_POLICY, + 0x7f2f5cfa, 0xf10c, 0x4823, 0xb5, 0xe1, 0xe9, 0x3a, 0xe8, 0x5f, 0x46, 0xb5} +DEFINE_GUID!{GUID_PROCESSOR_HETERO_DECREASE_TIME, + 0x7f2492b6, 0x60b1, 0x45e5, 0xae, 0x55, 0x77, 0x3f, 0x8c, 0xd5, 0xca, 0xec} +DEFINE_GUID!{GUID_PROCESSOR_HETERO_INCREASE_TIME, + 0x4009efa7, 0xe72d, 0x4cba, 0x9e, 0xdf, 0x91, 0x08, 0x4e, 0xa8, 0xcb, 0xc3} +DEFINE_GUID!{GUID_PROCESSOR_HETERO_DECREASE_THRESHOLD, + 0xf8861c27, 0x95e7, 0x475c, 0x86, 0x5b, 0x13, 0xc0, 0xcb, 0x3f, 0x9d, 0x6b} +DEFINE_GUID!{GUID_PROCESSOR_HETERO_INCREASE_THRESHOLD, + 0xb000397d, 0x9b0b, 0x483d, 0x98, 0xc9, 0x69, 0x2a, 0x60, 0x60, 0xcf, 0xbf} +DEFINE_GUID!{GUID_PROCESSOR_CLASS0_FLOOR_PERF, + 0xfddc842b, 0x8364, 0x4edc, 0x94, 0xcf, 0xc1, 0x7f, 0x60, 0xde, 0x1c, 0x80} +DEFINE_GUID!{GUID_PROCESSOR_CLASS1_INITIAL_PERF, + 0x1facfc65, 0xa930, 0x4bc5, 0x9f, 0x38, 0x50, 0x4e, 0xc0, 0x97, 0xbb, 0xc0} +DEFINE_GUID!{GUID_SYSTEM_COOLING_POLICY, + 0x94d3a615, 0xa899, 0x4ac5, 0xae, 0x2b, 0xe4, 0xd8, 0xf6, 0x34, 0x36, 0x7f} +DEFINE_GUID!{GUID_LOCK_CONSOLE_ON_WAKE, + 0x0e796bdb, 0x100d, 0x47d6, 0xa2, 0xd5, 0xf7, 0xd2, 0xda, 0xa5, 0x1f, 0x51} +DEFINE_GUID!{GUID_DEVICE_IDLE_POLICY, + 0x4faab71a, 0x92e5, 0x4726, 0xb5, 0x31, 0x22, 0x45, 0x59, 0x67, 0x2d, 0x19} +pub const POWER_DEVICE_IDLE_POLICY_PERFORMANCE: DWORD = 0; +pub const POWER_DEVICE_IDLE_POLICY_CONSERVATIVE: DWORD = 1; +DEFINE_GUID!{GUID_CONNECTIVITY_IN_STANDBY, + 0xf15576e8, 0x98b7, 0x4186, 0xb9, 0x44, 0xea, 0xfa, 0x66, 0x44, 0x02, 0xd9} +pub const POWER_CONNECTIVITY_IN_STANDBY_DISABLED: DWORD = 0; +pub const POWER_CONNECTIVITY_IN_STANDBY_ENABLED: DWORD = 1; +pub const POWER_CONNECTIVITY_IN_STANDBY_DISABLED_LID_CLOSE: DWORD = 2; +DEFINE_GUID!{GUID_DISCONNECTED_STANDBY_MODE, + 0x68afb2d9, 0xee95, 0x47a8, 0x8f, 0x50, 0x41, 0x15, 0x08, 0x80, 0x73, 0xb1} +pub const POWER_DISCONNECTED_STANDBY_MODE_NORMAL: DWORD = 0; +pub const POWER_DISCONNECTED_STANDBY_MODE_AGGRESSIVE: DWORD = 1; +DEFINE_GUID!{GUID_ACDC_POWER_SOURCE, + 0x5d3e9a59, 0xe9d5, 0x4b00, 0xa6, 0xbd, 0xff, 0x34, 0xff, 0x51, 0x65, 0x48} +DEFINE_GUID!{GUID_LIDSWITCH_STATE_CHANGE, + 0xba3e0f4d, 0xb817, 0x4094, 0xa2, 0xd1, 0xd5, 0x63, 0x79, 0xe6, 0xa0, 0xf3} +DEFINE_GUID!{GUID_BATTERY_PERCENTAGE_REMAINING, + 0xa7ad8041, 0xb45a, 0x4cae, 0x87, 0xa3, 0xee, 0xcb, 0xb4, 0x68, 0xa9, 0xe1} +DEFINE_GUID!{GUID_BATTERY_COUNT, + 0x7d263f15, 0xfca4, 0x49e5, 0x85, 0x4b, 0xa9, 0xf2, 0xbf, 0xbd, 0x5c, 0x24} +DEFINE_GUID!{GUID_GLOBAL_USER_PRESENCE, + 0x786e8a1d, 0xb427, 0x4344, 0x92, 0x7, 0x9, 0xe7, 0xb, 0xdc, 0xbe, 0xa9} +DEFINE_GUID!{GUID_SESSION_DISPLAY_STATUS, + 0x2b84c20e, 0xad23, 0x4ddf, 0x93, 0xdb, 0x5, 0xff, 0xbd, 0x7e, 0xfc, 0xa5} +DEFINE_GUID!{GUID_SESSION_USER_PRESENCE, + 0x3c0f4548, 0xc03f, 0x4c4d, 0xb9, 0xf2, 0x23, 0x7e, 0xde, 0x68, 0x63, 0x76} +DEFINE_GUID!{GUID_IDLE_BACKGROUND_TASK, + 0x515c31d8, 0xf734, 0x163d, 0xa0, 0xfd, 0x11, 0xa0, 0x8c, 0x91, 0xe8, 0xf1} +DEFINE_GUID!{GUID_BACKGROUND_TASK_NOTIFICATION, + 0xcf23f240, 0x2a54, 0x48d8, 0xb1, 0x14, 0xde, 0x15, 0x18, 0xff, 0x05, 0x2e} +DEFINE_GUID!{GUID_APPLAUNCH_BUTTON, + 0x1a689231, 0x7399, 0x4e9a, 0x8f, 0x99, 0xb7, 0x1f, 0x99, 0x9d, 0xb3, 0xfa} +DEFINE_GUID!{GUID_PCIEXPRESS_SETTINGS_SUBGROUP, + 0x501a4d13, 0x42af,0x4429, 0x9f, 0xd1, 0xa8, 0x21, 0x8c, 0x26, 0x8e, 0x20} +DEFINE_GUID!{GUID_PCIEXPRESS_ASPM_POLICY, + 0xee12f906, 0xd277, 0x404b, 0xb6, 0xda, 0xe5, 0xfa, 0x1a, 0x57, 0x6d, 0xf5} +DEFINE_GUID!{GUID_ENABLE_SWITCH_FORCED_SHUTDOWN, + 0x833a6b62, 0xdfa4, 0x46d1, 0x82, 0xf8, 0xe0, 0x9e, 0x34, 0xd0, 0x29, 0xd6} +DEFINE_GUID!{GUID_INTSTEER_SUBGROUP, + 0x48672f38, 0x7a9a, 0x4bb2, 0x8b, 0xf8, 0x3d, 0x85, 0xbe, 0x19, 0xde, 0x4e} +DEFINE_GUID!{GUID_INTSTEER_MODE, + 0x2bfc24f9, 0x5ea2, 0x4801, 0x82, 0x13, 0x3d, 0xba, 0xe0, 0x1a, 0xa3, 0x9d} +DEFINE_GUID!{GUID_INTSTEER_LOAD_PER_PROC_TRIGGER, + 0x73cde64d, 0xd720, 0x4bb2, 0xa8, 0x60, 0xc7, 0x55, 0xaf, 0xe7, 0x7e, 0xf2} +DEFINE_GUID!{GUID_INTSTEER_TIME_UNPARK_TRIGGER, + 0xd6ba4903, 0x386f, 0x4c2c, 0x8a, 0xdb, 0x5c, 0x21, 0xb3, 0x32, 0x8d, 0x25} +ENUM!{enum SYSTEM_POWER_STATE { + PowerSystemUnspecified = 0, + PowerSystemWorking = 1, + PowerSystemSleeping1 = 2, + PowerSystemSleeping2 = 3, + PowerSystemSleeping3 = 4, + PowerSystemHibernate = 5, + PowerSystemShutdown = 6, + PowerSystemMaximum = 7, +}} +pub type PSYSTEM_POWER_STATE = *mut SYSTEM_POWER_STATE; +pub const POWER_SYSTEM_MAXIMUM: usize = 7; +ENUM!{enum POWER_ACTION { + PowerActionNone = 0, + PowerActionReserved, + PowerActionSleep, + PowerActionHibernate, + PowerActionShutdown, + PowerActionShutdownReset, + PowerActionShutdownOff, + PowerActionWarmEject, + PowerActionDisplayOff, +}} +pub type PPOWER_ACTION = *mut POWER_ACTION; +ENUM!{enum DEVICE_POWER_STATE { + PowerDeviceUnspecified = 0, + PowerDeviceD0, + PowerDeviceD1, + PowerDeviceD2, + PowerDeviceD3, + PowerDeviceMaximum, +}} +pub type PDEVICE_POWER_STATE = *mut DEVICE_POWER_STATE; +ENUM!{enum MONITOR_DISPLAY_STATE { + PowerMonitorOff = 0, + PowerMonitorOn, + PowerMonitorDim, +}} +pub type PMONITOR_DISPLAY_STATE = *mut MONITOR_DISPLAY_STATE; +ENUM!{enum USER_ACTIVITY_PRESENCE { + PowerUserPresent = 0, + PowerUserNotPresent, + PowerUserInactive, + PowerUserMaximum, + PowerUserInvalid = PowerUserMaximum, +}} +pub type PUSER_ACTIVITY_PRESENCE = *mut USER_ACTIVITY_PRESENCE; +pub const ES_SYSTEM_REQUIRED: DWORD = 0x00000001; +pub const ES_DISPLAY_REQUIRED: DWORD = 0x00000002; +pub const ES_USER_PRESENT: DWORD = 0x00000004; +pub const ES_AWAYMODE_REQUIRED: DWORD = 0x00000040; +pub const ES_CONTINUOUS: DWORD = 0x80000000; +pub type EXECUTION_STATE = DWORD; +pub type PEXECUTION_STATE = *mut DWORD; +ENUM!{enum LATENCY_TIME { + LT_DONT_CARE, + LT_LOWEST_LATENCY, +}} +pub const DIAGNOSTIC_REASON_VERSION: ULONG = 0; +pub const DIAGNOSTIC_REASON_SIMPLE_STRING: ULONG = 0x00000001; +pub const DIAGNOSTIC_REASON_DETAILED_STRING: ULONG = 0x00000002; +pub const DIAGNOSTIC_REASON_NOT_SPECIFIED: ULONG = 0x80000000; +pub const DIAGNOSTIC_REASON_INVALID_FLAGS: ULONG = !0x80000007; +pub const POWER_REQUEST_CONTEXT_VERSION: ULONG = DIAGNOSTIC_REASON_VERSION; +pub const POWER_REQUEST_CONTEXT_SIMPLE_STRING: ULONG = DIAGNOSTIC_REASON_SIMPLE_STRING; +pub const POWER_REQUEST_CONTEXT_DETAILED_STRING: ULONG = DIAGNOSTIC_REASON_DETAILED_STRING; +ENUM!{enum POWER_REQUEST_TYPE { + PowerRequestDisplayRequired, + PowerRequestSystemRequired, + PowerRequestAwayModeRequired, + PowerRequestExecutionRequired, +}} +pub type PPOWER_REQUEST_TYPE = *mut POWER_REQUEST_TYPE; +pub const PDCAP_D0_SUPPORTED: DWORD = 0x00000001; +pub const PDCAP_D1_SUPPORTED: DWORD = 0x00000002; +pub const PDCAP_D2_SUPPORTED: DWORD = 0x00000004; +pub const PDCAP_D3_SUPPORTED: DWORD = 0x00000008; +pub const PDCAP_WAKE_FROM_D0_SUPPORTED: DWORD = 0x00000010; +pub const PDCAP_WAKE_FROM_D1_SUPPORTED: DWORD = 0x00000020; +pub const PDCAP_WAKE_FROM_D2_SUPPORTED: DWORD = 0x00000040; +pub const PDCAP_WAKE_FROM_D3_SUPPORTED: DWORD = 0x00000080; +pub const PDCAP_WARM_EJECT_SUPPORTED: DWORD = 0x00000100; +STRUCT!{struct CM_POWER_DATA { + PD_Size: DWORD, + PD_MostRecentPowerState: DEVICE_POWER_STATE, + PD_Capabilities: DWORD, + PD_D1Latency: DWORD, + PD_D2Latency: DWORD, + PD_D3Latency: DWORD, + PD_PowerStateMapping: [DEVICE_POWER_STATE; POWER_SYSTEM_MAXIMUM], + PD_DeepestSystemWake: SYSTEM_POWER_STATE, +}} +pub type PCM_POWER_DATA = *mut CM_POWER_DATA; +ENUM!{enum POWER_INFORMATION_LEVEL { + SystemPowerPolicyAc, + SystemPowerPolicyDc, + VerifySystemPolicyAc, + VerifySystemPolicyDc, + SystemPowerCapabilities, + SystemBatteryState, + SystemPowerStateHandler, + ProcessorStateHandler, + SystemPowerPolicyCurrent, + AdministratorPowerPolicy, + SystemReserveHiberFile, + ProcessorInformation, + SystemPowerInformation, + ProcessorStateHandler2, + LastWakeTime, + LastSleepTime, + SystemExecutionState, + SystemPowerStateNotifyHandler, + ProcessorPowerPolicyAc, + ProcessorPowerPolicyDc, + VerifyProcessorPowerPolicyAc, + VerifyProcessorPowerPolicyDc, + ProcessorPowerPolicyCurrent, + SystemPowerStateLogging, + SystemPowerLoggingEntry, + SetPowerSettingValue, + NotifyUserPowerSetting, + PowerInformationLevelUnused0, + SystemMonitorHiberBootPowerOff, + SystemVideoState, + TraceApplicationPowerMessage, + TraceApplicationPowerMessageEnd, + ProcessorPerfStates, + ProcessorIdleStates, + ProcessorCap, + SystemWakeSource, + SystemHiberFileInformation, + TraceServicePowerMessage, + ProcessorLoad, + PowerShutdownNotification, + MonitorCapabilities, + SessionPowerInit, + SessionDisplayState, + PowerRequestCreate, + PowerRequestAction, + GetPowerRequestList, + ProcessorInformationEx, + NotifyUserModeLegacyPowerEvent, + GroupPark, + ProcessorIdleDomains, + WakeTimerList, + SystemHiberFileSize, + ProcessorIdleStatesHv, + ProcessorPerfStatesHv, + ProcessorPerfCapHv, + ProcessorSetIdle, + LogicalProcessorIdling, + UserPresence, + PowerSettingNotificationName, + GetPowerSettingValue, + IdleResiliency, + SessionRITState, + SessionConnectNotification, + SessionPowerCleanup, + SessionLockState, + SystemHiberbootState, + PlatformInformation, + PdcInvocation, + MonitorInvocation, + FirmwareTableInformationRegistered, + SetShutdownSelectedTime, + SuspendResumeInvocation, + PlmPowerRequestCreate, + ScreenOff, + CsDeviceNotification, + PlatformRole, + LastResumePerformance, + DisplayBurst, + ExitLatencySamplingPercentage, + RegisterSpmPowerSettings, + PlatformIdleStates, + ProcessorIdleVeto, + PlatformIdleVeto, + SystemBatteryStatePrecise, + ThermalEvent, + PowerRequestActionInternal, + BatteryDeviceState, + PowerInformationInternal, + ThermalStandby, + SystemHiberFileType, + PhysicalPowerButtonPress, + QueryPotentialDripsConstraint, + EnergyTrackerCreate, + EnergyTrackerQuery, + UpdateBlackBoxRecorder, + PowerInformationLevelMaximum, +}} +ENUM!{enum POWER_USER_PRESENCE_TYPE { + UserNotPresent = 0, + UserPresent = 1, + UserUnknown = 0xff, +}} +pub type PPOWER_USER_PRESENCE_TYPE = *mut POWER_USER_PRESENCE_TYPE; +STRUCT!{struct POWER_USER_PRESENCE { + UserPresence: POWER_USER_PRESENCE_TYPE, +}} +pub type PPOWER_USER_PRESENCE = *mut POWER_USER_PRESENCE; +STRUCT!{struct POWER_SESSION_CONNECT { + Connected: BOOLEAN, + Console: BOOLEAN, +}} +pub type PPOWER_SESSION_CONNECT = *mut POWER_SESSION_CONNECT; +STRUCT!{struct POWER_SESSION_TIMEOUTS { + InputTimeout: DWORD, + DisplayTimeout: DWORD, +}} +pub type PPOWER_SESSION_TIMEOUTS = *mut POWER_SESSION_TIMEOUTS; +STRUCT!{struct POWER_SESSION_RIT_STATE { + Active: BOOLEAN, + LastInputTime: DWORD, +}} +pub type PPOWER_SESSION_RIT_STATE = *mut POWER_SESSION_RIT_STATE; +STRUCT!{struct POWER_SESSION_WINLOGON { + SessionId: DWORD, + Console: BOOLEAN, + Locked: BOOLEAN, +}} +pub type PPOWER_SESSION_WINLOGON = *mut POWER_SESSION_WINLOGON; +STRUCT!{struct POWER_IDLE_RESILIENCY { + CoalescingTimeout: DWORD, + IdleResiliencyPeriod: DWORD, +}} +pub type PPOWER_IDLE_RESILIENCY = *mut POWER_IDLE_RESILIENCY; +ENUM!{enum POWER_MONITOR_REQUEST_REASON { + MonitorRequestReasonUnknown, + MonitorRequestReasonPowerButton, + MonitorRequestReasonRemoteConnection, + MonitorRequestReasonScMonitorpower, + MonitorRequestReasonUserInput, + MonitorRequestReasonAcDcDisplayBurst, + MonitorRequestReasonUserDisplayBurst, + MonitorRequestReasonPoSetSystemState, + MonitorRequestReasonSetThreadExecutionState, + MonitorRequestReasonFullWake, + MonitorRequestReasonSessionUnlock, + MonitorRequestReasonScreenOffRequest, + MonitorRequestReasonIdleTimeout, + MonitorRequestReasonPolicyChange, + MonitorRequestReasonSleepButton, + MonitorRequestReasonLid, + MonitorRequestReasonBatteryCountChange, + MonitorRequestReasonGracePeriod, + MonitorRequestReasonPnP, + MonitorRequestReasonDP, + MonitorRequestReasonSxTransition, + MonitorRequestReasonSystemIdle, + MonitorRequestReasonNearProximity, + MonitorRequestReasonThermalStandby, + MonitorRequestReasonResumePdc, + MonitorRequestReasonResumeS4, + MonitorRequestReasonTerminal, + MonitorRequestReasonPdcSignal, + MonitorRequestReasonAcDcDisplayBurstSuppressed, + MonitorRequestReasonSystemStateEntered, + MonitorRequestReasonWinrt, + MonitorRequestReasonMax, +}} +ENUM!{enum POWER_MONITOR_REQUEST_TYPE { + MonitorRequestTypeOff, + MonitorRequestTypeOnAndPresent, + MonitorRequestTypeToggleOn, +}} +STRUCT!{struct POWER_MONITOR_INVOCATION { + Console: BOOLEAN, + RequestReason: POWER_MONITOR_REQUEST_REASON, +}} +pub type PPOWER_MONITOR_INVOCATION = *mut POWER_MONITOR_INVOCATION; +STRUCT!{struct RESUME_PERFORMANCE { + PostTimeMs: DWORD, + TotalResumeTimeMs: ULONGLONG, + ResumeCompleteTimestamp: ULONGLONG, +}} +pub type PRESUME_PERFORMANCE = *mut RESUME_PERFORMANCE; +ENUM!{enum SYSTEM_POWER_CONDITION { + PoAc, + PoDc, + PoHot, + PoConditionMaximum, +}} +STRUCT!{struct SET_POWER_SETTING_VALUE { + Version: DWORD, + Guid: GUID, + PowerCondition: SYSTEM_POWER_CONDITION, + DataLength: DWORD, + Data: [BYTE; ANYSIZE_ARRAY], +}} +pub type PSET_POWER_SETTING_VALUE = *mut SET_POWER_SETTING_VALUE; +STRUCT!{struct NOTIFY_USER_POWER_SETTING { + Guid: GUID, +}} +pub type PNOTIFY_USER_POWER_SETTING = *mut NOTIFY_USER_POWER_SETTING; +STRUCT!{struct APPLICATIONLAUNCH_SETTING_VALUE { + ActivationTime: LARGE_INTEGER, + Flags: DWORD, + ButtonInstanceID: DWORD, +}} +pub type PAPPLICATIONLAUNCH_SETTING_VALUE = *mut APPLICATIONLAUNCH_SETTING_VALUE; +ENUM!{enum POWER_PLATFORM_ROLE { + PlatformRoleUnspecified = 0, + PlatformRoleDesktop, + PlatformRoleMobile, + PlatformRoleWorkstation, + PlatformRoleEnterpriseServer, + PlatformRoleSOHOServer, + PlatformRoleAppliancePC, + PlatformRolePerformanceServer, + PlatformRoleSlate, + PlatformRoleMaximum, +}} +pub type PPOWER_PLATFORM_ROLE = *mut POWER_PLATFORM_ROLE; +pub const POWER_PLATFORM_ROLE_V1: ULONG = 0x00000001; +pub const POWER_PLATFORM_ROLE_V1_MAX: POWER_PLATFORM_ROLE = PlatformRolePerformanceServer + 1; +pub const POWER_PLATFORM_ROLE_V2: ULONG = 0x00000002; +pub const POWER_PLATFORM_ROLE_V2_MAX: POWER_PLATFORM_ROLE = PlatformRoleSlate + 1; +pub const POWER_PLATFORM_ROLE_VERSION: ULONG = POWER_PLATFORM_ROLE_V2; +pub const POWER_PLATFORM_ROLE_VERSION_MAX: POWER_PLATFORM_ROLE = POWER_PLATFORM_ROLE_V2_MAX; +STRUCT!{struct POWER_PLATFORM_INFORMATION { + AoAc: BOOLEAN, +}} +pub type PPOWER_PLATFORM_INFORMATION = *mut POWER_PLATFORM_INFORMATION; +STRUCT!{struct BATTERY_REPORTING_SCALE { + Granularity: DWORD, + Capacity: DWORD, +}} +pub type PBATTERY_REPORTING_SCALE = *mut BATTERY_REPORTING_SCALE; +STRUCT!{struct PPM_WMI_LEGACY_PERFSTATE { + Frequency: DWORD, + Flags: DWORD, + PercentFrequency: DWORD, +}} +pub type PPPM_WMI_LEGACY_PERFSTATE = *mut PPM_WMI_LEGACY_PERFSTATE; +STRUCT!{struct PPM_WMI_IDLE_STATE { + Latency: DWORD, + Power: DWORD, + TimeCheck: DWORD, + PromotePercent: BYTE, + DemotePercent: BYTE, + StateType: BYTE, + Reserved: BYTE, + StateFlags: DWORD, + Context: DWORD, + IdleHandler: DWORD, + Reserved1: DWORD, +}} +pub type PPPM_WMI_IDLE_STATE = *mut PPM_WMI_IDLE_STATE; +STRUCT!{struct PPM_WMI_IDLE_STATES { + Type: DWORD, + Count: DWORD, + TargetState: DWORD, + OldState: DWORD, + TargetProcessors: DWORD64, + State: [PPM_WMI_IDLE_STATE; ANYSIZE_ARRAY], +}} +pub type PPPM_WMI_IDLE_STATES = *mut PPM_WMI_IDLE_STATES; +STRUCT!{struct PPM_WMI_IDLE_STATES_EX { + Type: DWORD, + Count: DWORD, + TargetState: DWORD, + OldState: DWORD, + TargetProcessors: PVOID, + State: [PPM_WMI_IDLE_STATE; ANYSIZE_ARRAY], +}} +pub type PPPM_WMI_IDLE_STATES_EX = *mut PPM_WMI_IDLE_STATES_EX; +STRUCT!{struct PPM_WMI_PERF_STATE { + Frequency: DWORD, + Power: DWORD, + PercentFrequency: BYTE, + IncreaseLevel: BYTE, + DecreaseLevel: BYTE, + Type: BYTE, + IncreaseTime: DWORD, + DecreaseTime: DWORD, + Control: DWORD64, + Status: DWORD64, + HitCount: DWORD, + Reserved1: DWORD, + Reserved2: DWORD64, + Reserved3: DWORD64, +}} +pub type PPPM_WMI_PERF_STATE = *mut PPM_WMI_PERF_STATE; +STRUCT!{struct PPM_WMI_PERF_STATES { + Count: DWORD, + MaxFrequency: DWORD, + CurrentState: DWORD, + MaxPerfState: DWORD, + MinPerfState: DWORD, + LowestPerfState: DWORD, + ThermalConstraint: DWORD, + BusyAdjThreshold: BYTE, + PolicyType: BYTE, + Type: BYTE, + Reserved: BYTE, + TimerInterval: DWORD, + TargetProcessors: DWORD64, + PStateHandler: DWORD, + PStateContext: DWORD, + TStateHandler: DWORD, + TStateContext: DWORD, + FeedbackHandler: DWORD, + Reserved1: DWORD, + Reserved2: DWORD64, + State: [PPM_WMI_PERF_STATE; ANYSIZE_ARRAY], +}} +pub type PPPM_WMI_PERF_STATES = *mut PPM_WMI_PERF_STATES; +STRUCT!{struct PPM_WMI_PERF_STATES_EX { + Count: DWORD, + MaxFrequency: DWORD, + CurrentState: DWORD, + MaxPerfState: DWORD, + MinPerfState: DWORD, + LowestPerfState: DWORD, + ThermalConstraint: DWORD, + BusyAdjThreshold: BYTE, + PolicyType: BYTE, + Type: BYTE, + Reserved: BYTE, + TimerInterval: DWORD, + TargetProcessors: PVOID, + PStateHandler: DWORD, + PStateContext: DWORD, + TStateHandler: DWORD, + TStateContext: DWORD, + FeedbackHandler: DWORD, + Reserved1: DWORD, + Reserved2: DWORD64, + State: [PPM_WMI_PERF_STATE; ANYSIZE_ARRAY], +}} +pub type PPPM_WMI_PERF_STATES_EX = *mut PPM_WMI_PERF_STATES_EX; +pub const PROC_IDLE_BUCKET_COUNT: usize = 6; +STRUCT!{struct PPM_IDLE_STATE_ACCOUNTING { + IdleTransitions: DWORD, + FailedTransitions: DWORD, + InvalidBucketIndex: DWORD, + TotalTime: DWORD64, + IdleTimeBuckets: [DWORD; PROC_IDLE_BUCKET_COUNT], +}} +pub type PPPM_IDLE_STATE_ACCOUNTING = *mut PPM_IDLE_STATE_ACCOUNTING; +STRUCT!{struct PPM_IDLE_ACCOUNTING { + StateCount: DWORD, + TotalTransitions: DWORD, + ResetCount: DWORD, + StartTime: DWORD64, + State: [PPM_IDLE_STATE_ACCOUNTING; ANYSIZE_ARRAY], +}} +pub type PPPM_IDLE_ACCOUNTING = *mut PPM_IDLE_ACCOUNTING; +pub const PROC_IDLE_BUCKET_COUNT_EX: usize = 16; +STRUCT!{struct PPM_IDLE_STATE_BUCKET_EX { + TotalTimeUs: DWORD64, + MinTimeUs: DWORD, + MaxTimeUs: DWORD, + Count: DWORD, +}} +pub type PPPM_IDLE_STATE_BUCKET_EX = *mut PPM_IDLE_STATE_BUCKET_EX; +STRUCT!{struct PPM_IDLE_STATE_ACCOUNTING_EX { + TotalTime: DWORD64, + IdleTransitions: DWORD, + FailedTransitions: DWORD, + InvalidBucketIndex: DWORD, + MinTimeUs: DWORD, + MaxTimeUs: DWORD, + CancelledTransitions: DWORD, + IdleTimeBuckets: [PPM_IDLE_STATE_BUCKET_EX; PROC_IDLE_BUCKET_COUNT_EX], +}} +pub type PPPM_IDLE_STATE_ACCOUNTING_EX = *mut PPM_IDLE_STATE_ACCOUNTING_EX; +STRUCT!{struct PPM_IDLE_ACCOUNTING_EX { + StateCount: DWORD, + TotalTransitions: DWORD, + ResetCount: DWORD, + AbortCount: DWORD, + StartTime: DWORD64, + State: [PPM_IDLE_STATE_ACCOUNTING_EX; ANYSIZE_ARRAY], +}} +pub type PPPM_IDLE_ACCOUNTING_EX = *mut PPM_IDLE_ACCOUNTING_EX; +pub const ACPI_PPM_SOFTWARE_ALL: DWORD = 0xFC; +pub const ACPI_PPM_SOFTWARE_ANY: DWORD = 0xFD; +pub const ACPI_PPM_HARDWARE_ALL: DWORD = 0xFE; +pub const MS_PPM_SOFTWARE_ALL: DWORD = 0x1; +pub const PPM_FIRMWARE_ACPI1C2: DWORD = 0x00000001; +pub const PPM_FIRMWARE_ACPI1C3: DWORD = 0x00000002; +pub const PPM_FIRMWARE_ACPI1TSTATES: DWORD = 0x00000004; +pub const PPM_FIRMWARE_CST: DWORD = 0x00000008; +pub const PPM_FIRMWARE_CSD: DWORD = 0x00000010; +pub const PPM_FIRMWARE_PCT: DWORD = 0x00000020; +pub const PPM_FIRMWARE_PSS: DWORD = 0x00000040; +pub const PPM_FIRMWARE_XPSS: DWORD = 0x00000080; +pub const PPM_FIRMWARE_PPC: DWORD = 0x00000100; +pub const PPM_FIRMWARE_PSD: DWORD = 0x00000200; +pub const PPM_FIRMWARE_PTC: DWORD = 0x00000400; +pub const PPM_FIRMWARE_TSS: DWORD = 0x00000800; +pub const PPM_FIRMWARE_TPC: DWORD = 0x00001000; +pub const PPM_FIRMWARE_TSD: DWORD = 0x00002000; +pub const PPM_FIRMWARE_PCCH: DWORD = 0x00004000; +pub const PPM_FIRMWARE_PCCP: DWORD = 0x00008000; +pub const PPM_FIRMWARE_OSC: DWORD = 0x00010000; +pub const PPM_FIRMWARE_PDC: DWORD = 0x00020000; +pub const PPM_FIRMWARE_CPC: DWORD = 0x00040000; +pub const PPM_FIRMWARE_LPI: DWORD = 0x00080000; +pub const PPM_PERFORMANCE_IMPLEMENTATION_NONE: DWORD = 0x00000000; +pub const PPM_PERFORMANCE_IMPLEMENTATION_PSTATES: DWORD = 0x00000001; +pub const PPM_PERFORMANCE_IMPLEMENTATION_PCCV1: DWORD = 0x00000002; +pub const PPM_PERFORMANCE_IMPLEMENTATION_CPPC: DWORD = 0x00000003; +pub const PPM_PERFORMANCE_IMPLEMENTATION_PEP: DWORD = 0x00000004; +pub const PPM_IDLE_IMPLEMENTATION_NONE: DWORD = 0x00000000; +pub const PPM_IDLE_IMPLEMENTATION_CSTATES: DWORD = 0x00000001; +pub const PPM_IDLE_IMPLEMENTATION_PEP: DWORD = 0x00000002; +pub const PPM_IDLE_IMPLEMENTATION_MICROPEP: DWORD = 0x00000003; +pub const PPM_IDLE_IMPLEMENTATION_LPISTATES: DWORD = 0x00000004; +DEFINE_GUID!{PPM_PERFSTATE_CHANGE_GUID, + 0xa5b32ddd, 0x7f39, 0x4abc, 0xb8, 0x92, 0x90, 0xe, 0x43, 0xb5, 0x9e, 0xbb} +DEFINE_GUID!{PPM_PERFSTATE_DOMAIN_CHANGE_GUID, + 0x995e6b7f, 0xd653, 0x497a, 0xb9, 0x78, 0x36, 0xa3, 0xc, 0x29, 0xbf, 0x1} +DEFINE_GUID!{PPM_IDLESTATE_CHANGE_GUID, + 0x4838fe4f, 0xf71c, 0x4e51, 0x9e, 0xcc, 0x84, 0x30, 0xa7, 0xac, 0x4c, 0x6c} +DEFINE_GUID!{PPM_PERFSTATES_DATA_GUID, + 0x5708cc20, 0x7d40, 0x4bf4, 0xb4, 0xaa, 0x2b, 0x01, 0x33, 0x8d, 0x01, 0x26} +DEFINE_GUID!{PPM_IDLESTATES_DATA_GUID, + 0xba138e10, 0xe250, 0x4ad7, 0x86, 0x16, 0xcf, 0x1a, 0x7a, 0xd4, 0x10, 0xe7} +DEFINE_GUID!{PPM_IDLE_ACCOUNTING_GUID, + 0xe2a26f78, 0xae07, 0x4ee0, 0xa3, 0x0f, 0xce, 0x54, 0xf5, 0x5a, 0x94, 0xcd} +DEFINE_GUID!{PPM_IDLE_ACCOUNTING_EX_GUID, + 0xd67abd39, 0x81f8, 0x4a5e, 0x81, 0x52, 0x72, 0xe3, 0x1e, 0xc9, 0x12, 0xee} +DEFINE_GUID!{PPM_THERMALCONSTRAINT_GUID, + 0xa852c2c8, 0x1a4c, 0x423b, 0x8c, 0x2c, 0xf3, 0x0d, 0x82, 0x93, 0x1a, 0x88} +DEFINE_GUID!{PPM_PERFMON_PERFSTATE_GUID, + 0x7fd18652, 0xcfe, 0x40d2, 0xb0, 0xa1, 0xb, 0x6, 0x6a, 0x87, 0x75, 0x9e} +DEFINE_GUID!{PPM_THERMAL_POLICY_CHANGE_GUID, + 0x48f377b8, 0x6880, 0x4c7b, 0x8b, 0xdc, 0x38, 0x1, 0x76, 0xc6, 0x65, 0x4d} +STRUCT!{struct PPM_PERFSTATE_EVENT { + State: DWORD, + Status: DWORD, + Latency: DWORD, + Speed: DWORD, + Processor: DWORD, +}} +pub type PPPM_PERFSTATE_EVENT = *mut PPM_PERFSTATE_EVENT; +STRUCT!{struct PPM_PERFSTATE_DOMAIN_EVENT { + State: DWORD, + Latency: DWORD, + Speed: DWORD, + Processors: DWORD64, +}} +pub type PPPM_PERFSTATE_DOMAIN_EVENT = *mut PPM_PERFSTATE_DOMAIN_EVENT; +STRUCT!{struct PPM_IDLESTATE_EVENT { + NewState: DWORD, + OldState: DWORD, + Processors: DWORD64, +}} +pub type PPPM_IDLESTATE_EVENT = *mut PPM_IDLESTATE_EVENT; +STRUCT!{struct PPM_THERMALCHANGE_EVENT { + ThermalConstraint: DWORD, + Processors: DWORD64, +}} +pub type PPPM_THERMALCHANGE_EVENT = *mut PPM_THERMALCHANGE_EVENT; +STRUCT!{struct PPM_THERMAL_POLICY_EVENT { + Mode: BYTE, + Processors: DWORD64, +}} +pub type PPPM_THERMAL_POLICY_EVENT = *mut PPM_THERMAL_POLICY_EVENT; +STRUCT!{struct POWER_ACTION_POLICY { + Action: POWER_ACTION, + Flags: DWORD, + EventCode: DWORD, +}} +pub type PPOWER_ACTION_POLICY = *mut POWER_ACTION_POLICY; +pub const POWER_ACTION_QUERY_ALLOWED: DWORD = 0x00000001; +pub const POWER_ACTION_UI_ALLOWED: DWORD = 0x00000002; +pub const POWER_ACTION_OVERRIDE_APPS: DWORD = 0x00000004; +pub const POWER_ACTION_HIBERBOOT: DWORD = 0x00000008; +pub const POWER_ACTION_USER_NOTIFY: DWORD = 0x00000010; +pub const POWER_ACTION_DOZE_TO_HIBERNATE: DWORD = 0x00000020; +pub const POWER_ACTION_PSEUDO_TRANSITION: DWORD = 0x08000000; +pub const POWER_ACTION_LIGHTEST_FIRST: DWORD = 0x10000000; +pub const POWER_ACTION_LOCK_CONSOLE: DWORD = 0x20000000; +pub const POWER_ACTION_DISABLE_WAKES: DWORD = 0x40000000; +pub const POWER_ACTION_CRITICAL: DWORD = 0x80000000; +pub const POWER_LEVEL_USER_NOTIFY_TEXT: DWORD = 0x00000001; +pub const POWER_LEVEL_USER_NOTIFY_SOUND: DWORD = 0x00000002; +pub const POWER_LEVEL_USER_NOTIFY_EXEC: DWORD = 0x00000004; +pub const POWER_USER_NOTIFY_BUTTON: DWORD = 0x00000008; +pub const POWER_USER_NOTIFY_SHUTDOWN: DWORD = 0x00000010; +pub const POWER_USER_NOTIFY_FORCED_SHUTDOWN: DWORD = 0x00000020; +pub const POWER_FORCE_TRIGGER_RESET: DWORD = 0x80000000; +pub const BATTERY_DISCHARGE_FLAGS_EVENTCODE_MASK: DWORD = 0x00000007; +pub const BATTERY_DISCHARGE_FLAGS_ENABLE: DWORD = 0x80000000; +STRUCT!{struct SYSTEM_POWER_LEVEL { + Enable: BOOLEAN, + Spare: [BYTE; 3], + BatteryLevel: DWORD, + PowerPolicy: POWER_ACTION_POLICY, + MinSystemState: SYSTEM_POWER_STATE, +}} +pub type PSYSTEM_POWER_LEVEL = *mut SYSTEM_POWER_LEVEL; +pub const NUM_DISCHARGE_POLICIES: usize = 4; +pub const DISCHARGE_POLICY_CRITICAL: DWORD = 0; +pub const DISCHARGE_POLICY_LOW: DWORD = 1; +STRUCT!{struct SYSTEM_POWER_POLICY { + Revision: DWORD, + PowerButton: POWER_ACTION_POLICY, + SleepButton: POWER_ACTION_POLICY, + LidClose: POWER_ACTION_POLICY, + LidOpenWake: SYSTEM_POWER_STATE, + Reserved: DWORD, + Idle: POWER_ACTION_POLICY, + IdleTimeout: DWORD, + IdleSensitivity: BYTE, + DynamicThrottle: BYTE, + Spare2: [BYTE; 2], + MinSleep: SYSTEM_POWER_STATE, + MaxSleep: SYSTEM_POWER_STATE, + ReducedLatencySleep: SYSTEM_POWER_STATE, + WinLogonFlags: DWORD, + Spare3: DWORD, + DozeS4Timeout: DWORD, + BroadcastCapacityResolution: DWORD, + DischargePolicy: [SYSTEM_POWER_LEVEL; NUM_DISCHARGE_POLICIES], + VideoTimeout: DWORD, + VideoDimDisplay: BOOLEAN, + VideoReserved: [DWORD; 3], + SpindownTimeout: DWORD, + OptimizeForPower: BOOLEAN, + FanThrottleTolerance: BYTE, + ForcedThrottle: BYTE, + MinThrottle: BYTE, + OverThrottled: POWER_ACTION_POLICY, +}} +pub type PSYSTEM_POWER_POLICY = *mut SYSTEM_POWER_POLICY; +pub const PROCESSOR_IDLESTATE_POLICY_COUNT: usize = 0x3; +STRUCT!{struct PROCESSOR_IDLESTATE_INFO { + TimeCheck: DWORD, + DemotePercent: BYTE, + PromotePercent: BYTE, + Spare: [BYTE; 2], +}} +pub type PPROCESSOR_IDLESTATE_INFO = *mut PROCESSOR_IDLESTATE_INFO; +STRUCT!{struct PROCESSOR_IDLESTATE_POLICY_Flags { + AsWORD: WORD, +}} +BITFIELD!{PROCESSOR_IDLESTATE_POLICY_Flags AsWORD: WORD [ + AllowScaling set_AllowScaling[0..1], + Disabled set_Disabled[1..2], + Reserved set_Reserved[2..16], +]} +STRUCT!{struct PROCESSOR_IDLESTATE_POLICY { + Revision: WORD, + Flags: PROCESSOR_IDLESTATE_POLICY_Flags, + PolicyCount: DWORD, + Policy: [PROCESSOR_IDLESTATE_INFO; PROCESSOR_IDLESTATE_POLICY_COUNT], +}} +pub type PPROCESSOR_IDLESTATE_POLICY = *mut PROCESSOR_IDLESTATE_POLICY; +pub const PO_THROTTLE_NONE: DWORD = 0; +pub const PO_THROTTLE_CONSTANT: DWORD = 1; +pub const PO_THROTTLE_DEGRADE: DWORD = 2; +pub const PO_THROTTLE_ADAPTIVE: DWORD = 3; +pub const PO_THROTTLE_MAXIMUM: DWORD = 4; +STRUCT!{struct PROCESSOR_POWER_POLICY_INFO { + TimeCheck: DWORD, + DemoteLimit: DWORD, + PromoteLimit: DWORD, + DemotePercent: BYTE, + PromotePercent: BYTE, + Spare: [BYTE; 2], + Reserved: DWORD, +}} +BITFIELD!{PROCESSOR_POWER_POLICY_INFO Reserved: DWORD [ + AllowDemotion set_AllowDemotion[0..1], + AllowPromotion set_AllowPromotion[1..2], + Reserved set_Reserved[2..32], +]} +pub type PPROCESSOR_POWER_POLICY_INFO = *mut PROCESSOR_POWER_POLICY_INFO; +STRUCT!{struct PROCESSOR_POWER_POLICY { + Revision: DWORD, + DynamicThrottle: BYTE, + Spare: [BYTE; 3], + BitFields: DWORD, + PolicyCount: DWORD, + Policy: [PROCESSOR_POWER_POLICY_INFO; 3], +}} +BITFIELD!{PROCESSOR_POWER_POLICY BitFields: DWORD [ + DisableCStates set_DisableCStates[0..1], + Reserved set_Reserved[1..32], +]} +pub type PPROCESSOR_POWER_POLICY = *mut PROCESSOR_POWER_POLICY; +STRUCT!{struct PROCESSOR_PERFSTATE_POLICY_u_Flags { + AsBYTE: BYTE, +}} +BITFIELD!{PROCESSOR_PERFSTATE_POLICY_u_Flags AsBYTE: BYTE [ + NoDomainAccounting set_NoDomainAccounting[0..1], + IncreasePolicy set_IncreasePolicy[1..3], + DecreasePolicy set_DecreasePolicy[3..5], + Reserved set_Reserved[5..8], +]} +UNION!{union PROCESSOR_PERFSTATE_POLICY_u { + [u8; 1], + Spare Spare_mut: BYTE, + Flags Flags_mut: PROCESSOR_PERFSTATE_POLICY_u_Flags, +}} +STRUCT!{struct PROCESSOR_PERFSTATE_POLICY { + Revision: DWORD, + MaxThrottle: BYTE, + MinThrottle: BYTE, + BusyAdjThreshold: BYTE, + u: PROCESSOR_PERFSTATE_POLICY_u, + TimeCheck: DWORD, + IncreaseTime: DWORD, + DecreaseTime: DWORD, + IncreasePercent: DWORD, + DecreasePercent: DWORD, +}} +pub type PPROCESSOR_PERFSTATE_POLICY = *mut PROCESSOR_PERFSTATE_POLICY; +STRUCT!{struct ADMINISTRATOR_POWER_POLICY { + MinSleep: SYSTEM_POWER_STATE, + MaxSleep: SYSTEM_POWER_STATE, + MinVideoTimeout: DWORD, + MaxVideoTimeout: DWORD, + MinSpindownTimeout: DWORD, + MaxSpindownTimeout: DWORD, +}} +pub type PADMINISTRATOR_POWER_POLICY = *mut ADMINISTRATOR_POWER_POLICY; +ENUM!{enum HIBERFILE_BUCKET_SIZE { + HiberFileBucket1GB = 0, + HiberFileBucket2GB, + HiberFileBucket4GB, + HiberFileBucket8GB, + HiberFileBucket16GB, + HiberFileBucket32GB, + HiberFileBucketUnlimited, + HiberFileBucketMax, +}} +pub const HIBERFILE_TYPE_NONE: BYTE = 0x00; +pub const HIBERFILE_TYPE_REDUCED: BYTE = 0x01; +pub const HIBERFILE_TYPE_FULL: BYTE = 0x02; +pub const HIBERFILE_TYPE_MAX: usize = 0x03; +STRUCT!{struct HIBERFILE_BUCKET { + MaxPhysicalMemory: DWORD64, + PhysicalMemoryPercent: [DWORD; HIBERFILE_TYPE_MAX], +}} +pub type PHIBERFILE_BUCKET = *mut HIBERFILE_BUCKET; +STRUCT!{struct SYSTEM_POWER_CAPABILITIES { + PowerButtonPresent: BOOLEAN, + SleepButtonPresent: BOOLEAN, + LidPresent: BOOLEAN, + SystemS1: BOOLEAN, + SystemS2: BOOLEAN, + SystemS3: BOOLEAN, + SystemS4: BOOLEAN, + SystemS5: BOOLEAN, + HiberFilePresent: BOOLEAN, + FullWake: BOOLEAN, + VideoDimPresent: BOOLEAN, + ApmPresent: BOOLEAN, + UpsPresent: BOOLEAN, + ThermalControl: BOOLEAN, + ProcessorThrottle: BOOLEAN, + ProcessorMinThrottle: BYTE, + ProcessorMaxThrottle: BYTE, + FastSystemS4: BOOLEAN, + Hiberboot: BOOLEAN, + WakeAlarmPresent: BOOLEAN, + AoAc: BOOLEAN, + DiskSpinDown: BOOLEAN, + HiberFileType: BYTE, + AoAcConnectivitySupported: BOOLEAN, + spare3: [BYTE; 6], + SystemBatteriesPresent: BOOLEAN, + BatteriesAreShortTerm: BOOLEAN, + BatteryScale: [BATTERY_REPORTING_SCALE; 3], + AcOnLineWake: SYSTEM_POWER_STATE, + SoftLidWake: SYSTEM_POWER_STATE, + RtcWake: SYSTEM_POWER_STATE, + MinDeviceWakeState: SYSTEM_POWER_STATE, + DefaultLowLatencyWake: SYSTEM_POWER_STATE, +}} +pub type PSYSTEM_POWER_CAPABILITIES = *mut SYSTEM_POWER_CAPABILITIES; +STRUCT!{struct SYSTEM_BATTERY_STATE { + AcOnLine: BOOLEAN, + BatteryPresent: BOOLEAN, + Charging: BOOLEAN, + Discharging: BOOLEAN, + Spare1: [BOOLEAN; 3], + Tag: BYTE, + MaxCapacity: DWORD, + RemainingCapacity: DWORD, + Rate: DWORD, + EstimatedTime: DWORD, + DefaultAlert1: DWORD, + DefaultAlert2: DWORD, +}} +pub type PSYSTEM_BATTERY_STATE = *mut SYSTEM_BATTERY_STATE; +pub const IMAGE_DOS_SIGNATURE: WORD = 0x5A4D; +pub const IMAGE_OS2_SIGNATURE: WORD = 0x454E; +pub const IMAGE_OS2_SIGNATURE_LE: WORD = 0x454C; +pub const IMAGE_VXD_SIGNATURE: WORD = 0x454C; +pub const IMAGE_NT_SIGNATURE: DWORD = 0x00004550; +STRUCT!{struct IMAGE_DOS_HEADER { + e_magic: WORD, + e_cblp: WORD, + e_cp: WORD, + e_crlc: WORD, + e_cparhdr: WORD, + e_minalloc: WORD, + e_maxalloc: WORD, + e_ss: WORD, + e_sp: WORD, + e_csum: WORD, + e_ip: WORD, + e_cs: WORD, + e_lfarlc: WORD, + e_ovno: WORD, + e_res: [WORD; 4], + e_oemid: WORD, + e_oeminfo: WORD, + e_res2: [WORD; 10], + e_lfanew: LONG, +}} +pub type PIMAGE_DOS_HEADER = *mut IMAGE_DOS_HEADER; +STRUCT!{struct IMAGE_OS2_HEADER { + ne_magic: WORD, + ne_ver: CHAR, + ne_rev: CHAR, + ne_enttab: WORD, + ne_cbenttab: WORD, + ne_crc: LONG, + ne_flags: WORD, + ne_autodata: WORD, + ne_heap: WORD, + ne_stack: WORD, + ne_csip: LONG, + ne_sssp: LONG, + ne_cseg: WORD, + ne_cmod: WORD, + ne_cbnrestab: WORD, + ne_segtab: WORD, + ne_rsrctab: WORD, + ne_restab: WORD, + ne_modtab: WORD, + ne_imptab: WORD, + ne_nrestab: LONG, + ne_cmovent: WORD, + ne_align: WORD, + ne_cres: WORD, + ne_exetyp: BYTE, + ne_flagsothers: BYTE, + ne_pretthunks: WORD, + ne_psegrefbytes: WORD, + ne_swaparea: WORD, + ne_expver: WORD, +}} +pub type PIMAGE_OS2_HEADER = *mut IMAGE_OS2_HEADER; +STRUCT!{struct IMAGE_VXD_HEADER { + e32_magic: WORD, + e32_border: BYTE, + e32_worder: BYTE, + e32_level: DWORD, + e32_cpu: WORD, + e32_os: WORD, + e32_ver: DWORD, + e32_mflags: DWORD, + e32_mpages: DWORD, + e32_startobj: DWORD, + e32_eip: DWORD, + e32_stackobj: DWORD, + e32_esp: DWORD, + e32_pagesize: DWORD, + e32_lastpagesize: DWORD, + e32_fixupsize: DWORD, + e32_fixupsum: DWORD, + e32_ldrsize: DWORD, + e32_ldrsum: DWORD, + e32_objtab: DWORD, + e32_objcnt: DWORD, + e32_objmap: DWORD, + e32_itermap: DWORD, + e32_rsrctab: DWORD, + e32_rsrccnt: DWORD, + e32_restab: DWORD, + e32_enttab: DWORD, + e32_dirtab: DWORD, + e32_dircnt: DWORD, + e32_fpagetab: DWORD, + e32_frectab: DWORD, + e32_impmod: DWORD, + e32_impmodcnt: DWORD, + e32_impproc: DWORD, + e32_pagesum: DWORD, + e32_datapage: DWORD, + e32_preload: DWORD, + e32_nrestab: DWORD, + e32_cbnrestab: DWORD, + e32_nressum: DWORD, + e32_autodata: DWORD, + e32_debuginfo: DWORD, + e32_debuglen: DWORD, + e32_instpreload: DWORD, + e32_instdemand: DWORD, + e32_heapsize: DWORD, + e32_res3: [BYTE; 12], + e32_winresoff: DWORD, + e32_winreslen: DWORD, + e32_devid: WORD, + e32_ddkver: WORD, +}} +pub type PIMAGE_VXD_HEADER = *mut IMAGE_VXD_HEADER; +STRUCT!{struct IMAGE_FILE_HEADER { + Machine: WORD, + NumberOfSections: WORD, + TimeDateStamp: DWORD, + PointerToSymbolTable: DWORD, + NumberOfSymbols: DWORD, + SizeOfOptionalHeader: WORD, + Characteristics: WORD, +}} +pub type PIMAGE_FILE_HEADER = *mut IMAGE_FILE_HEADER; +pub const IMAGE_SIZEOF_FILE_HEADER: usize = 20; +pub const IMAGE_FILE_RELOCS_STRIPPED: WORD = 0x0001; +pub const IMAGE_FILE_EXECUTABLE_IMAGE: WORD = 0x0002; +pub const IMAGE_FILE_LINE_NUMS_STRIPPED: WORD = 0x0004; +pub const IMAGE_FILE_LOCAL_SYMS_STRIPPED: WORD = 0x0008; +pub const IMAGE_FILE_AGGRESIVE_WS_TRIM: WORD = 0x0010; +pub const IMAGE_FILE_LARGE_ADDRESS_AWARE: WORD = 0x0020; +pub const IMAGE_FILE_BYTES_REVERSED_LO: WORD = 0x0080; +pub const IMAGE_FILE_32BIT_MACHINE: WORD = 0x0100; +pub const IMAGE_FILE_DEBUG_STRIPPED: WORD = 0x0200; +pub const IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP: WORD = 0x0400; +pub const IMAGE_FILE_NET_RUN_FROM_SWAP: WORD = 0x0800; +pub const IMAGE_FILE_SYSTEM: WORD = 0x1000; +pub const IMAGE_FILE_DLL: WORD = 0x2000; +pub const IMAGE_FILE_UP_SYSTEM_ONLY: WORD = 0x4000; +pub const IMAGE_FILE_BYTES_REVERSED_HI: WORD = 0x8000; +pub const IMAGE_FILE_MACHINE_UNKNOWN: WORD = 0; +pub const IMAGE_FILE_MACHINE_TARGET_HOST: WORD = 0x0001; +pub const IMAGE_FILE_MACHINE_I386: WORD = 0x014c; +pub const IMAGE_FILE_MACHINE_R3000: WORD = 0x0162; +pub const IMAGE_FILE_MACHINE_R4000: WORD = 0x0166; +pub const IMAGE_FILE_MACHINE_R10000: WORD = 0x0168; +pub const IMAGE_FILE_MACHINE_WCEMIPSV2: WORD = 0x0169; +pub const IMAGE_FILE_MACHINE_ALPHA: WORD = 0x0184; +pub const IMAGE_FILE_MACHINE_SH3: WORD = 0x01a2; +pub const IMAGE_FILE_MACHINE_SH3DSP: WORD = 0x01a3; +pub const IMAGE_FILE_MACHINE_SH3E: WORD = 0x01a4; +pub const IMAGE_FILE_MACHINE_SH4: WORD = 0x01a6; +pub const IMAGE_FILE_MACHINE_SH5: WORD = 0x01a8; +pub const IMAGE_FILE_MACHINE_ARM: WORD = 0x01c0; +pub const IMAGE_FILE_MACHINE_THUMB: WORD = 0x01c2; +pub const IMAGE_FILE_MACHINE_ARMNT: WORD = 0x01c4; +pub const IMAGE_FILE_MACHINE_AM33: WORD = 0x01d3; +pub const IMAGE_FILE_MACHINE_POWERPC: WORD = 0x01F0; +pub const IMAGE_FILE_MACHINE_POWERPCFP: WORD = 0x01f1; +pub const IMAGE_FILE_MACHINE_IA64: WORD = 0x0200; +pub const IMAGE_FILE_MACHINE_MIPS16: WORD = 0x0266; +pub const IMAGE_FILE_MACHINE_ALPHA64: WORD = 0x0284; +pub const IMAGE_FILE_MACHINE_MIPSFPU: WORD = 0x0366; +pub const IMAGE_FILE_MACHINE_MIPSFPU16: WORD = 0x0466; +pub const IMAGE_FILE_MACHINE_AXP64: WORD = IMAGE_FILE_MACHINE_ALPHA64; +pub const IMAGE_FILE_MACHINE_TRICORE: WORD = 0x0520; +pub const IMAGE_FILE_MACHINE_CEF: WORD = 0x0CEF; +pub const IMAGE_FILE_MACHINE_EBC: WORD = 0x0EBC; +pub const IMAGE_FILE_MACHINE_AMD64: WORD = 0x8664; +pub const IMAGE_FILE_MACHINE_M32R: WORD = 0x9041; +pub const IMAGE_FILE_MACHINE_ARM64: WORD = 0xAA64; +pub const IMAGE_FILE_MACHINE_CEE: WORD = 0xC0EE; +STRUCT!{struct IMAGE_DATA_DIRECTORY { + VirtualAddress: DWORD, + Size: DWORD, +}} +pub type PIMAGE_DATA_DIRECTORY = *mut IMAGE_DATA_DIRECTORY; +pub const IMAGE_NUMBEROF_DIRECTORY_ENTRIES: usize = 16; +STRUCT!{struct IMAGE_OPTIONAL_HEADER32 { + Magic: WORD, + MajorLinkerVersion: BYTE, + MinorLinkerVersion: BYTE, + SizeOfCode: DWORD, + SizeOfInitializedData: DWORD, + SizeOfUninitializedData: DWORD, + AddressOfEntryPoint: DWORD, + BaseOfCode: DWORD, + BaseOfData: DWORD, + ImageBase: DWORD, + SectionAlignment: DWORD, + FileAlignment: DWORD, + MajorOperatingSystemVersion: WORD, + MinorOperatingSystemVersion: WORD, + MajorImageVersion: WORD, + MinorImageVersion: WORD, + MajorSubsystemVersion: WORD, + MinorSubsystemVersion: WORD, + Win32VersionValue: DWORD, + SizeOfImage: DWORD, + SizeOfHeaders: DWORD, + CheckSum: DWORD, + Subsystem: WORD, + DllCharacteristics: WORD, + SizeOfStackReserve: DWORD, + SizeOfStackCommit: DWORD, + SizeOfHeapReserve: DWORD, + SizeOfHeapCommit: DWORD, + LoaderFlags: DWORD, + NumberOfRvaAndSizes: DWORD, + DataDirectory: [IMAGE_DATA_DIRECTORY; IMAGE_NUMBEROF_DIRECTORY_ENTRIES], +}} +pub type PIMAGE_OPTIONAL_HEADER32 = *mut IMAGE_OPTIONAL_HEADER32; +STRUCT!{struct IMAGE_ROM_OPTIONAL_HEADER { + Magic: WORD, + MajorLinkerVersion: BYTE, + MinorLinkerVersion: BYTE, + SizeOfCode: DWORD, + SizeOfInitializedData: DWORD, + SizeOfUninitializedData: DWORD, + AddressOfEntryPoint: DWORD, + BaseOfCode: DWORD, + BaseOfData: DWORD, + BaseOfBss: DWORD, + GprMask: DWORD, + CprMask: [DWORD; 4], + GpValue: DWORD, +}} +pub type PIMAGE_ROM_OPTIONAL_HEADER = *mut IMAGE_ROM_OPTIONAL_HEADER; +STRUCT!{struct IMAGE_OPTIONAL_HEADER64 { + Magic: WORD, + MajorLinkerVersion: BYTE, + MinorLinkerVersion: BYTE, + SizeOfCode: DWORD, + SizeOfInitializedData: DWORD, + SizeOfUninitializedData: DWORD, + AddressOfEntryPoint: DWORD, + BaseOfCode: DWORD, + ImageBase: ULONGLONG, + SectionAlignment: DWORD, + FileAlignment: DWORD, + MajorOperatingSystemVersion: WORD, + MinorOperatingSystemVersion: WORD, + MajorImageVersion: WORD, + MinorImageVersion: WORD, + MajorSubsystemVersion: WORD, + MinorSubsystemVersion: WORD, + Win32VersionValue: DWORD, + SizeOfImage: DWORD, + SizeOfHeaders: DWORD, + CheckSum: DWORD, + Subsystem: WORD, + DllCharacteristics: WORD, + SizeOfStackReserve: ULONGLONG, + SizeOfStackCommit: ULONGLONG, + SizeOfHeapReserve: ULONGLONG, + SizeOfHeapCommit: ULONGLONG, + LoaderFlags: DWORD, + NumberOfRvaAndSizes: DWORD, + DataDirectory: [IMAGE_DATA_DIRECTORY; IMAGE_NUMBEROF_DIRECTORY_ENTRIES], +}} +pub type PIMAGE_OPTIONAL_HEADER64 = *mut IMAGE_OPTIONAL_HEADER64; +pub const IMAGE_NT_OPTIONAL_HDR32_MAGIC: WORD = 0x10b; +pub const IMAGE_NT_OPTIONAL_HDR64_MAGIC: WORD = 0x20b; +pub const IMAGE_ROM_OPTIONAL_HDR_MAGIC: WORD = 0x107; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +pub type IMAGE_OPTIONAL_HEADER = IMAGE_OPTIONAL_HEADER64; +pub type PIMAGE_OPTIONAL_HEADER = PIMAGE_OPTIONAL_HEADER64; +pub const IMAGE_NT_OPTIONAL_HDR_MAGIC: WORD = IMAGE_NT_OPTIONAL_HDR64_MAGIC; +} +#[cfg(target_pointer_width = "32")] +IFDEF!{ +pub type IMAGE_OPTIONAL_HEADER = IMAGE_OPTIONAL_HEADER32; +pub type PIMAGE_OPTIONAL_HEADER = PIMAGE_OPTIONAL_HEADER32; +pub const IMAGE_NT_OPTIONAL_HDR_MAGIC: WORD = IMAGE_NT_OPTIONAL_HDR32_MAGIC; +} +STRUCT!{struct IMAGE_NT_HEADERS64 { + Signature: DWORD, + FileHeader: IMAGE_FILE_HEADER, + OptionalHeader: IMAGE_OPTIONAL_HEADER64, +}} +pub type PIMAGE_NT_HEADERS64 = *mut IMAGE_NT_HEADERS64; +STRUCT!{struct IMAGE_NT_HEADERS32 { + Signature: DWORD, + FileHeader: IMAGE_FILE_HEADER, + OptionalHeader: IMAGE_OPTIONAL_HEADER32, +}} +pub type PIMAGE_NT_HEADERS32 = *mut IMAGE_NT_HEADERS32; +STRUCT!{struct IMAGE_ROM_HEADERS { + FileHeader: IMAGE_FILE_HEADER, + OptionalHeader: IMAGE_ROM_OPTIONAL_HEADER, +}} +pub type PIMAGE_ROM_HEADERS = *mut IMAGE_ROM_HEADERS; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +pub type IMAGE_NT_HEADERS = IMAGE_NT_HEADERS64; +pub type PIMAGE_NT_HEADERS = PIMAGE_NT_HEADERS64; +} +#[cfg(target_pointer_width = "32")] +IFDEF!{ +pub type IMAGE_NT_HEADERS = IMAGE_NT_HEADERS32; +pub type PIMAGE_NT_HEADERS = PIMAGE_NT_HEADERS32; +} +pub const IMAGE_SUBSYSTEM_UNKNOWN: WORD = 0; +pub const IMAGE_SUBSYSTEM_NATIVE: WORD = 1; +pub const IMAGE_SUBSYSTEM_WINDOWS_GUI: WORD = 2; +pub const IMAGE_SUBSYSTEM_WINDOWS_CUI: WORD = 3; +pub const IMAGE_SUBSYSTEM_OS2_CUI: WORD = 5; +pub const IMAGE_SUBSYSTEM_POSIX_CUI: WORD = 7; +pub const IMAGE_SUBSYSTEM_NATIVE_WINDOWS: WORD = 8; +pub const IMAGE_SUBSYSTEM_WINDOWS_CE_GUI: WORD = 9; +pub const IMAGE_SUBSYSTEM_EFI_APPLICATION: WORD = 10; +pub const IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER: WORD = 11; +pub const IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER: WORD = 12; +pub const IMAGE_SUBSYSTEM_EFI_ROM: WORD = 13; +pub const IMAGE_SUBSYSTEM_XBOX: WORD = 14; +pub const IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION: WORD = 16; +pub const IMAGE_SUBSYSTEM_XBOX_CODE_CATALOG: WORD = 17; +pub const IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA: WORD = 0x0020; +pub const IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE: WORD = 0x0040; +pub const IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY: WORD = 0x0080; +pub const IMAGE_DLLCHARACTERISTICS_NX_COMPAT: WORD = 0x0100; +pub const IMAGE_DLLCHARACTERISTICS_NO_ISOLATION: WORD = 0x0200; +pub const IMAGE_DLLCHARACTERISTICS_NO_SEH: WORD = 0x0400; +pub const IMAGE_DLLCHARACTERISTICS_NO_BIND: WORD = 0x0800; +pub const IMAGE_DLLCHARACTERISTICS_APPCONTAINER: WORD = 0x1000; +pub const IMAGE_DLLCHARACTERISTICS_WDM_DRIVER: WORD = 0x2000; +pub const IMAGE_DLLCHARACTERISTICS_GUARD_CF: WORD = 0x4000; +pub const IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE: WORD = 0x8000; +pub const IMAGE_DIRECTORY_ENTRY_EXPORT: WORD = 0; +pub const IMAGE_DIRECTORY_ENTRY_IMPORT: WORD = 1; +pub const IMAGE_DIRECTORY_ENTRY_RESOURCE: WORD = 2; +pub const IMAGE_DIRECTORY_ENTRY_EXCEPTION: WORD = 3; +pub const IMAGE_DIRECTORY_ENTRY_SECURITY: WORD = 4; +pub const IMAGE_DIRECTORY_ENTRY_BASERELOC: WORD = 5; +pub const IMAGE_DIRECTORY_ENTRY_DEBUG: WORD = 6; +pub const IMAGE_DIRECTORY_ENTRY_ARCHITECTURE: WORD = 7; +pub const IMAGE_DIRECTORY_ENTRY_GLOBALPTR: WORD = 8; +pub const IMAGE_DIRECTORY_ENTRY_TLS: WORD = 9; +pub const IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG: WORD = 10; +pub const IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT: WORD = 11; +pub const IMAGE_DIRECTORY_ENTRY_IAT: WORD = 12; +pub const IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT: WORD = 13; +pub const IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR: WORD = 14; +STRUCT!{struct ANON_OBJECT_HEADER { + Sig1: WORD, + Sig2: WORD, + Version: WORD, + Machine: WORD, + TimeDateStamp: DWORD, + ClassID: CLSID, + SizeOfData: DWORD, +}} +STRUCT!{struct ANON_OBJECT_HEADER_V2 { + Sig1: WORD, + Sig2: WORD, + Version: WORD, + Machine: WORD, + TimeDateStamp: DWORD, + ClassID: CLSID, + SizeOfData: DWORD, + Flags: DWORD, + MetaDataSize: DWORD, + MetaDataOffset: DWORD, +}} +STRUCT!{struct ANON_OBJECT_HEADER_BIGOBJ { + Sig1: WORD, + Sig2: WORD, + Version: WORD, + Machine: WORD, + TimeDateStamp: DWORD, + ClassID: CLSID, + SizeOfData: DWORD, + Flags: DWORD, + MetaDataSize: DWORD, + MetaDataOffset: DWORD, + NumberOfSections: DWORD, + PointerToSymbolTable: DWORD, + NumberOfSymbols: DWORD, +}} +pub const IMAGE_SIZEOF_SHORT_NAME: usize = 8; +UNION!{union IMAGE_SECTION_HEADER_Misc { + [u32; 1], + PhysicalAddress PhysicalAddress_mut: DWORD, + VirtualSize VirtualSize_mut: DWORD, +}} +STRUCT!{struct IMAGE_SECTION_HEADER { + Name: [BYTE; IMAGE_SIZEOF_SHORT_NAME], + Misc: IMAGE_SECTION_HEADER_Misc, + VirtualAddress: DWORD, + SizeOfRawData: DWORD, + PointerToRawData: DWORD, + PointerToRelocations: DWORD, + PointerToLinenumbers: DWORD, + NumberOfRelocations: WORD, + NumberOfLinenumbers: WORD, + Characteristics: DWORD, +}} +pub type PIMAGE_SECTION_HEADER = *mut IMAGE_SECTION_HEADER; +pub const IMAGE_SIZEOF_SECTION_HEADER: usize = 40; +pub const IMAGE_SCN_TYPE_NO_PAD: DWORD = 0x00000008; +pub const IMAGE_SCN_CNT_CODE: DWORD = 0x00000020; +pub const IMAGE_SCN_CNT_INITIALIZED_DATA: DWORD = 0x00000040; +pub const IMAGE_SCN_CNT_UNINITIALIZED_DATA: DWORD = 0x00000080; +pub const IMAGE_SCN_LNK_OTHER: DWORD = 0x00000100; +pub const IMAGE_SCN_LNK_INFO: DWORD = 0x00000200; +pub const IMAGE_SCN_LNK_REMOVE: DWORD = 0x00000800; +pub const IMAGE_SCN_LNK_COMDAT: DWORD = 0x00001000; +pub const IMAGE_SCN_NO_DEFER_SPEC_EXC: DWORD = 0x00004000; +pub const IMAGE_SCN_GPREL: DWORD = 0x00008000; +pub const IMAGE_SCN_MEM_FARDATA: DWORD = 0x00008000; +pub const IMAGE_SCN_MEM_PURGEABLE: DWORD = 0x00020000; +pub const IMAGE_SCN_MEM_16BIT: DWORD = 0x00020000; +pub const IMAGE_SCN_MEM_LOCKED: DWORD = 0x00040000; +pub const IMAGE_SCN_MEM_PRELOAD: DWORD = 0x00080000; +pub const IMAGE_SCN_ALIGN_1BYTES: DWORD = 0x00100000; +pub const IMAGE_SCN_ALIGN_2BYTES: DWORD = 0x00200000; +pub const IMAGE_SCN_ALIGN_4BYTES: DWORD = 0x00300000; +pub const IMAGE_SCN_ALIGN_8BYTES: DWORD = 0x00400000; +pub const IMAGE_SCN_ALIGN_16BYTES: DWORD = 0x00500000; +pub const IMAGE_SCN_ALIGN_32BYTES: DWORD = 0x00600000; +pub const IMAGE_SCN_ALIGN_64BYTES: DWORD = 0x00700000; +pub const IMAGE_SCN_ALIGN_128BYTES: DWORD = 0x00800000; +pub const IMAGE_SCN_ALIGN_256BYTES: DWORD = 0x00900000; +pub const IMAGE_SCN_ALIGN_512BYTES: DWORD = 0x00A00000; +pub const IMAGE_SCN_ALIGN_1024BYTES: DWORD = 0x00B00000; +pub const IMAGE_SCN_ALIGN_2048BYTES: DWORD = 0x00C00000; +pub const IMAGE_SCN_ALIGN_4096BYTES: DWORD = 0x00D00000; +pub const IMAGE_SCN_ALIGN_8192BYTES: DWORD = 0x00E00000; +pub const IMAGE_SCN_ALIGN_MASK: DWORD = 0x00F00000; +pub const IMAGE_SCN_LNK_NRELOC_OVFL: DWORD = 0x01000000; +pub const IMAGE_SCN_MEM_DISCARDABLE: DWORD = 0x02000000; +pub const IMAGE_SCN_MEM_NOT_CACHED: DWORD = 0x04000000; +pub const IMAGE_SCN_MEM_NOT_PAGED: DWORD = 0x08000000; +pub const IMAGE_SCN_MEM_SHARED: DWORD = 0x10000000; +pub const IMAGE_SCN_MEM_EXECUTE: DWORD = 0x20000000; +pub const IMAGE_SCN_MEM_READ: DWORD = 0x40000000; +pub const IMAGE_SCN_MEM_WRITE: DWORD = 0x80000000; +pub const IMAGE_SCN_SCALE_INDEX: DWORD = 0x00000001; +STRUCT!{struct IMAGE_SYMBOL_N_Name { + Short: DWORD, + Long: DWORD, +}} +UNION!{union IMAGE_SYMBOL_N { + [u32; 2], + ShortName ShortName_mut: [BYTE; 8], + Name Name_mut: IMAGE_SYMBOL_N_Name, + LongName LongName_mut: [DWORD; 2], +}} +STRUCT!{struct IMAGE_SYMBOL { + N: IMAGE_SYMBOL_N, + Value: DWORD, + SectionNumber: SHORT, + Type: WORD, + StorageClass: BYTE, + NumberOfAuxSymbols: BYTE, +}} +pub type PIMAGE_SYMBOL = *mut IMAGE_SYMBOL; +pub const IMAGE_SIZEOF_SYMBOL: usize = 18; +STRUCT!{struct IMAGE_SYMBOL_EX_N_Name { + Short: DWORD, + Long: DWORD, +}} +UNION!{union IMAGE_SYMBOL_EX_N { + [u32; 2], + ShortName ShortName_mut: [BYTE; 8], + Name Name_mut: IMAGE_SYMBOL_EX_N_Name, + LongName LongName_mut: [DWORD; 2], +}} +STRUCT!{struct IMAGE_SYMBOL_EX { + N: IMAGE_SYMBOL_EX_N, + Value: DWORD, + SectionNumber: LONG, + Type: WORD, + StorageClass: BYTE, + NumberOfAuxSymbols: BYTE, +}} +pub type PIMAGE_SYMBOL_EX = *mut IMAGE_SYMBOL_EX; +pub const IMAGE_SYM_UNDEFINED: SHORT = 0; +pub const IMAGE_SYM_ABSOLUTE: SHORT = -1; +pub const IMAGE_SYM_DEBUG: SHORT = -2; +pub const IMAGE_SYM_SECTION_MAX: USHORT = 0xFEFF; +pub const IMAGE_SYM_SECTION_MAX_EX: LONG = MAXLONG; +pub const IMAGE_SYM_TYPE_NULL: WORD = 0x0000; +pub const IMAGE_SYM_TYPE_VOID: WORD = 0x0001; +pub const IMAGE_SYM_TYPE_CHAR: WORD = 0x0002; +pub const IMAGE_SYM_TYPE_SHORT: WORD = 0x0003; +pub const IMAGE_SYM_TYPE_INT: WORD = 0x0004; +pub const IMAGE_SYM_TYPE_LONG: WORD = 0x0005; +pub const IMAGE_SYM_TYPE_FLOAT: WORD = 0x0006; +pub const IMAGE_SYM_TYPE_DOUBLE: WORD = 0x0007; +pub const IMAGE_SYM_TYPE_STRUCT: WORD = 0x0008; +pub const IMAGE_SYM_TYPE_UNION: WORD = 0x0009; +pub const IMAGE_SYM_TYPE_ENUM: WORD = 0x000A; +pub const IMAGE_SYM_TYPE_MOE: WORD = 0x000B; +pub const IMAGE_SYM_TYPE_BYTE: WORD = 0x000C; +pub const IMAGE_SYM_TYPE_WORD: WORD = 0x000D; +pub const IMAGE_SYM_TYPE_UINT: WORD = 0x000E; +pub const IMAGE_SYM_TYPE_DWORD: WORD = 0x000F; +pub const IMAGE_SYM_TYPE_PCODE: WORD = 0x8000; +pub const IMAGE_SYM_DTYPE_NULL: WORD = 0; +pub const IMAGE_SYM_DTYPE_POINTER: WORD = 1; +pub const IMAGE_SYM_DTYPE_FUNCTION: WORD = 2; +pub const IMAGE_SYM_DTYPE_ARRAY: WORD = 3; +pub const IMAGE_SYM_CLASS_END_OF_FUNCTION: BYTE = -1i8 as u8; +pub const IMAGE_SYM_CLASS_NULL: BYTE = 0x0000; +pub const IMAGE_SYM_CLASS_AUTOMATIC: BYTE = 0x0001; +pub const IMAGE_SYM_CLASS_EXTERNAL: BYTE = 0x0002; +pub const IMAGE_SYM_CLASS_STATIC: BYTE = 0x0003; +pub const IMAGE_SYM_CLASS_REGISTER: BYTE = 0x0004; +pub const IMAGE_SYM_CLASS_EXTERNAL_DEF: BYTE = 0x0005; +pub const IMAGE_SYM_CLASS_LABEL: BYTE = 0x0006; +pub const IMAGE_SYM_CLASS_UNDEFINED_LABEL: BYTE = 0x0007; +pub const IMAGE_SYM_CLASS_MEMBER_OF_STRUCT: BYTE = 0x0008; +pub const IMAGE_SYM_CLASS_ARGUMENT: BYTE = 0x0009; +pub const IMAGE_SYM_CLASS_STRUCT_TAG: BYTE = 0x000A; +pub const IMAGE_SYM_CLASS_MEMBER_OF_UNION: BYTE = 0x000B; +pub const IMAGE_SYM_CLASS_UNION_TAG: BYTE = 0x000C; +pub const IMAGE_SYM_CLASS_TYPE_DEFINITION: BYTE = 0x000D; +pub const IMAGE_SYM_CLASS_UNDEFINED_STATIC: BYTE = 0x000E; +pub const IMAGE_SYM_CLASS_ENUM_TAG: BYTE = 0x000F; +pub const IMAGE_SYM_CLASS_MEMBER_OF_ENUM: BYTE = 0x0010; +pub const IMAGE_SYM_CLASS_REGISTER_PARAM: BYTE = 0x0011; +pub const IMAGE_SYM_CLASS_BIT_FIELD: BYTE = 0x0012; +pub const IMAGE_SYM_CLASS_FAR_EXTERNAL: BYTE = 0x0044; +pub const IMAGE_SYM_CLASS_BLOCK: BYTE = 0x0064; +pub const IMAGE_SYM_CLASS_FUNCTION: BYTE = 0x0065; +pub const IMAGE_SYM_CLASS_END_OF_STRUCT: BYTE = 0x0066; +pub const IMAGE_SYM_CLASS_FILE: BYTE = 0x0067; +pub const IMAGE_SYM_CLASS_SECTION: BYTE = 0x0068; +pub const IMAGE_SYM_CLASS_WEAK_EXTERNAL: BYTE = 0x0069; +pub const IMAGE_SYM_CLASS_CLR_TOKEN: BYTE = 0x006B; +pub const N_BTMASK: WORD = 0x000F; +pub const N_TMASK: WORD = 0x0030; +pub const N_TMASK1: WORD = 0x00C0; +pub const N_TMASK2: WORD = 0x00F0; +pub const N_BTSHFT: usize = 4; +pub const N_TSHIFT: usize = 2; +#[inline] +pub fn BTYPE(x: WORD) -> bool { + (x & N_BTMASK) != 0 +} +#[inline] +pub fn ISPTR(x: WORD) -> bool { + (x & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT) +} +#[inline] +pub fn ISFCN(x: WORD) -> bool { + (x & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT) +} +#[inline] +pub fn ISARY(x: WORD) -> bool { + (x & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT) +} +#[inline] +pub fn ISTAG(x: BYTE) -> bool { + (x == IMAGE_SYM_CLASS_STRUCT_TAG) || (x == IMAGE_SYM_CLASS_UNION_TAG) + || (x == IMAGE_SYM_CLASS_ENUM_TAG) +} +#[inline] +pub fn INCREF(x: WORD) -> WORD { + ((x & !N_BTMASK) << N_TSHIFT) | (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT) | (x & N_BTMASK) +} +#[inline] +pub fn DECREF(x: WORD) -> WORD { + ((x >> N_TSHIFT) & !N_BTMASK) | (x & N_BTMASK) +} +STRUCT!{struct IMAGE_AUX_SYMBOL_TOKEN_DEF { + bAuxType: BYTE, + bReserved: BYTE, + SymbolTableIndex: DWORD, + rgbReserved: [BYTE; 12], +}} +pub type PIMAGE_AUX_SYMBOL_TOKEN_DEF = *mut IMAGE_AUX_SYMBOL_TOKEN_DEF; +STRUCT!{struct IMAGE_AUX_SYMBOL_Sym_Misc_LnSz { + Linenumber: WORD, + Size: WORD, +}} +UNION!{union IMAGE_AUX_SYMBOL_Sym_Misc { + [u32; 1], + LnSz LnSz_mut: IMAGE_AUX_SYMBOL_Sym_Misc_LnSz, + TotalSize TotalSize_mut: DWORD, +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_Sym_FcnAry_Function { + PointerToLinenumber: DWORD, + PointerToNextFunction: DWORD, +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_Sym_FcnAry_Array { + Dimension: [WORD; 4], +}} +UNION!{union IMAGE_AUX_SYMBOL_Sym_FcnAry { + [u32; 2], + Function Function_mut: IMAGE_AUX_SYMBOL_Sym_FcnAry_Function, + Array Array_mut: IMAGE_AUX_SYMBOL_Sym_FcnAry_Array, +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_Sym { + TagIndex: DWORD, + Misc: IMAGE_AUX_SYMBOL_Sym_Misc, + FcnAry: IMAGE_AUX_SYMBOL_Sym_FcnAry, + TvIndex: WORD, +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_File { + Name: [BYTE; IMAGE_SIZEOF_SYMBOL], +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_Section { + Length: DWORD, + NumberOfRelocations: WORD, + NumberOfLinenumbers: WORD, + CheckSum: DWORD, + Number: SHORT, + Selection: BYTE, + bReserved: BYTE, + HighNumber: SHORT, +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_CRC { + crc: DWORD, + rgbReserved: [BYTE; 14], +}} +STRUCT!{struct IMAGE_AUX_SYMBOL { + Sym: IMAGE_AUX_SYMBOL_Sym, + File: IMAGE_AUX_SYMBOL_File, + Section: IMAGE_AUX_SYMBOL_Section, + TokenDef: IMAGE_AUX_SYMBOL_TOKEN_DEF, + CRC: IMAGE_AUX_SYMBOL_CRC, +}} +pub type PIMAGE_AUX_SYMBOL = *mut IMAGE_AUX_SYMBOL; +STRUCT!{struct IMAGE_AUX_SYMBOL_EX_Sym { + WeakDefaultSymIndex: DWORD, + WeakSearchType: DWORD, + rgbReserved: [BYTE; 12], +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_EX_File { + Name: [BYTE; 20], +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_EX_Section { + Length: DWORD, + NumberOfRelocations: WORD, + NumberOfLinenumbers: WORD, + CheckSum: DWORD, + Number: SHORT, + Selection: BYTE, + bReserved: BYTE, + HighNumber: SHORT, + rgbReserved: [BYTE; 2], +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_EX_s { + TokenDef: IMAGE_AUX_SYMBOL_TOKEN_DEF, + rgbReserved: [BYTE; 2], +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_EX_CRC { + crc: DWORD, + rgbReserved: [BYTE; 16], +}} +STRUCT!{struct IMAGE_AUX_SYMBOL_EX { + Sym: IMAGE_AUX_SYMBOL_EX_Sym, + File: IMAGE_AUX_SYMBOL_EX_File, + Section: IMAGE_AUX_SYMBOL_EX_Section, + s: IMAGE_AUX_SYMBOL_EX_s, + CRC: IMAGE_AUX_SYMBOL_EX_CRC, +}} +pub type PIMAGE_AUX_SYMBOL_EX = *mut IMAGE_AUX_SYMBOL_EX; +ENUM!{enum IMAGE_AUX_SYMBOL_TYPE { + IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF = 1, +}} +pub const IMAGE_COMDAT_SELECT_NODUPLICATES: BYTE = 1; +pub const IMAGE_COMDAT_SELECT_ANY: BYTE = 2; +pub const IMAGE_COMDAT_SELECT_SAME_SIZE: BYTE = 3; +pub const IMAGE_COMDAT_SELECT_EXACT_MATCH: BYTE = 4; +pub const IMAGE_COMDAT_SELECT_ASSOCIATIVE: BYTE = 5; +pub const IMAGE_COMDAT_SELECT_LARGEST: BYTE = 6; +pub const IMAGE_COMDAT_SELECT_NEWEST: BYTE = 7; +pub const IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY: BYTE = 1; +pub const IMAGE_WEAK_EXTERN_SEARCH_LIBRARY: BYTE = 2; +pub const IMAGE_WEAK_EXTERN_SEARCH_ALIAS: BYTE = 3; +UNION!{union IMAGE_RELOCATION_u { + [u32; 1], + VirtualAddress VirtualAddress_mut: DWORD, + RelocCount RelocCount_mut: DWORD, +}} +STRUCT!{struct IMAGE_RELOCATION { + u: IMAGE_RELOCATION_u, + SymbolTableIndex: DWORD, + Type: WORD, +}} +pub type PIMAGE_RELOCATION = *mut IMAGE_RELOCATION; +pub const IMAGE_REL_I386_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_I386_DIR16: WORD = 0x0001; +pub const IMAGE_REL_I386_REL16: WORD = 0x0002; +pub const IMAGE_REL_I386_DIR32: WORD = 0x0006; +pub const IMAGE_REL_I386_DIR32NB: WORD = 0x0007; +pub const IMAGE_REL_I386_SEG12: WORD = 0x0009; +pub const IMAGE_REL_I386_SECTION: WORD = 0x000A; +pub const IMAGE_REL_I386_SECREL: WORD = 0x000B; +pub const IMAGE_REL_I386_TOKEN: WORD = 0x000C; +pub const IMAGE_REL_I386_SECREL7: WORD = 0x000D; +pub const IMAGE_REL_I386_REL32: WORD = 0x0014; +pub const IMAGE_REL_MIPS_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_MIPS_REFHALF: WORD = 0x0001; +pub const IMAGE_REL_MIPS_REFWORD: WORD = 0x0002; +pub const IMAGE_REL_MIPS_JMPADDR: WORD = 0x0003; +pub const IMAGE_REL_MIPS_REFHI: WORD = 0x0004; +pub const IMAGE_REL_MIPS_REFLO: WORD = 0x0005; +pub const IMAGE_REL_MIPS_GPREL: WORD = 0x0006; +pub const IMAGE_REL_MIPS_LITERAL: WORD = 0x0007; +pub const IMAGE_REL_MIPS_SECTION: WORD = 0x000A; +pub const IMAGE_REL_MIPS_SECREL: WORD = 0x000B; +pub const IMAGE_REL_MIPS_SECRELLO: WORD = 0x000C; +pub const IMAGE_REL_MIPS_SECRELHI: WORD = 0x000D; +pub const IMAGE_REL_MIPS_TOKEN: WORD = 0x000E; +pub const IMAGE_REL_MIPS_JMPADDR16: WORD = 0x0010; +pub const IMAGE_REL_MIPS_REFWORDNB: WORD = 0x0022; +pub const IMAGE_REL_MIPS_PAIR: WORD = 0x0025; +pub const IMAGE_REL_ALPHA_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_ALPHA_REFLONG: WORD = 0x0001; +pub const IMAGE_REL_ALPHA_REFQUAD: WORD = 0x0002; +pub const IMAGE_REL_ALPHA_GPREL32: WORD = 0x0003; +pub const IMAGE_REL_ALPHA_LITERAL: WORD = 0x0004; +pub const IMAGE_REL_ALPHA_LITUSE: WORD = 0x0005; +pub const IMAGE_REL_ALPHA_GPDISP: WORD = 0x0006; +pub const IMAGE_REL_ALPHA_BRADDR: WORD = 0x0007; +pub const IMAGE_REL_ALPHA_HINT: WORD = 0x0008; +pub const IMAGE_REL_ALPHA_INLINE_REFLONG: WORD = 0x0009; +pub const IMAGE_REL_ALPHA_REFHI: WORD = 0x000A; +pub const IMAGE_REL_ALPHA_REFLO: WORD = 0x000B; +pub const IMAGE_REL_ALPHA_PAIR: WORD = 0x000C; +pub const IMAGE_REL_ALPHA_MATCH: WORD = 0x000D; +pub const IMAGE_REL_ALPHA_SECTION: WORD = 0x000E; +pub const IMAGE_REL_ALPHA_SECREL: WORD = 0x000F; +pub const IMAGE_REL_ALPHA_REFLONGNB: WORD = 0x0010; +pub const IMAGE_REL_ALPHA_SECRELLO: WORD = 0x0011; +pub const IMAGE_REL_ALPHA_SECRELHI: WORD = 0x0012; +pub const IMAGE_REL_ALPHA_REFQ3: WORD = 0x0013; +pub const IMAGE_REL_ALPHA_REFQ2: WORD = 0x0014; +pub const IMAGE_REL_ALPHA_REFQ1: WORD = 0x0015; +pub const IMAGE_REL_ALPHA_GPRELLO: WORD = 0x0016; +pub const IMAGE_REL_ALPHA_GPRELHI: WORD = 0x0017; +pub const IMAGE_REL_PPC_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_PPC_ADDR64: WORD = 0x0001; +pub const IMAGE_REL_PPC_ADDR32: WORD = 0x0002; +pub const IMAGE_REL_PPC_ADDR24: WORD = 0x0003; +pub const IMAGE_REL_PPC_ADDR16: WORD = 0x0004; +pub const IMAGE_REL_PPC_ADDR14: WORD = 0x0005; +pub const IMAGE_REL_PPC_REL24: WORD = 0x0006; +pub const IMAGE_REL_PPC_REL14: WORD = 0x0007; +pub const IMAGE_REL_PPC_TOCREL16: WORD = 0x0008; +pub const IMAGE_REL_PPC_TOCREL14: WORD = 0x0009; +pub const IMAGE_REL_PPC_ADDR32NB: WORD = 0x000A; +pub const IMAGE_REL_PPC_SECREL: WORD = 0x000B; +pub const IMAGE_REL_PPC_SECTION: WORD = 0x000C; +pub const IMAGE_REL_PPC_IFGLUE: WORD = 0x000D; +pub const IMAGE_REL_PPC_IMGLUE: WORD = 0x000E; +pub const IMAGE_REL_PPC_SECREL16: WORD = 0x000F; +pub const IMAGE_REL_PPC_REFHI: WORD = 0x0010; +pub const IMAGE_REL_PPC_REFLO: WORD = 0x0011; +pub const IMAGE_REL_PPC_PAIR: WORD = 0x0012; +pub const IMAGE_REL_PPC_SECRELLO: WORD = 0x0013; +pub const IMAGE_REL_PPC_SECRELHI: WORD = 0x0014; +pub const IMAGE_REL_PPC_GPREL: WORD = 0x0015; +pub const IMAGE_REL_PPC_TOKEN: WORD = 0x0016; +pub const IMAGE_REL_PPC_TYPEMASK: WORD = 0x00FF; +pub const IMAGE_REL_PPC_NEG: WORD = 0x0100; +pub const IMAGE_REL_PPC_BRTAKEN: WORD = 0x0200; +pub const IMAGE_REL_PPC_BRNTAKEN: WORD = 0x0400; +pub const IMAGE_REL_PPC_TOCDEFN: WORD = 0x0800; +pub const IMAGE_REL_SH3_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_SH3_DIRECT16: WORD = 0x0001; +pub const IMAGE_REL_SH3_DIRECT32: WORD = 0x0002; +pub const IMAGE_REL_SH3_DIRECT8: WORD = 0x0003; +pub const IMAGE_REL_SH3_DIRECT8_WORD: WORD = 0x0004; +pub const IMAGE_REL_SH3_DIRECT8_LONG: WORD = 0x0005; +pub const IMAGE_REL_SH3_DIRECT4: WORD = 0x0006; +pub const IMAGE_REL_SH3_DIRECT4_WORD: WORD = 0x0007; +pub const IMAGE_REL_SH3_DIRECT4_LONG: WORD = 0x0008; +pub const IMAGE_REL_SH3_PCREL8_WORD: WORD = 0x0009; +pub const IMAGE_REL_SH3_PCREL8_LONG: WORD = 0x000A; +pub const IMAGE_REL_SH3_PCREL12_WORD: WORD = 0x000B; +pub const IMAGE_REL_SH3_STARTOF_SECTION: WORD = 0x000C; +pub const IMAGE_REL_SH3_SIZEOF_SECTION: WORD = 0x000D; +pub const IMAGE_REL_SH3_SECTION: WORD = 0x000E; +pub const IMAGE_REL_SH3_SECREL: WORD = 0x000F; +pub const IMAGE_REL_SH3_DIRECT32_NB: WORD = 0x0010; +pub const IMAGE_REL_SH3_GPREL4_LONG: WORD = 0x0011; +pub const IMAGE_REL_SH3_TOKEN: WORD = 0x0012; +pub const IMAGE_REL_SHM_PCRELPT: WORD = 0x0013; +pub const IMAGE_REL_SHM_REFLO: WORD = 0x0014; +pub const IMAGE_REL_SHM_REFHALF: WORD = 0x0015; +pub const IMAGE_REL_SHM_RELLO: WORD = 0x0016; +pub const IMAGE_REL_SHM_RELHALF: WORD = 0x0017; +pub const IMAGE_REL_SHM_PAIR: WORD = 0x0018; +pub const IMAGE_REL_SH_NOMODE: WORD = 0x8000; +pub const IMAGE_REL_ARM_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_ARM_ADDR32: WORD = 0x0001; +pub const IMAGE_REL_ARM_ADDR32NB: WORD = 0x0002; +pub const IMAGE_REL_ARM_BRANCH24: WORD = 0x0003; +pub const IMAGE_REL_ARM_BRANCH11: WORD = 0x0004; +pub const IMAGE_REL_ARM_TOKEN: WORD = 0x0005; +pub const IMAGE_REL_ARM_GPREL12: WORD = 0x0006; +pub const IMAGE_REL_ARM_GPREL7: WORD = 0x0007; +pub const IMAGE_REL_ARM_BLX24: WORD = 0x0008; +pub const IMAGE_REL_ARM_BLX11: WORD = 0x0009; +pub const IMAGE_REL_ARM_SECTION: WORD = 0x000E; +pub const IMAGE_REL_ARM_SECREL: WORD = 0x000F; +pub const IMAGE_REL_ARM_MOV32A: WORD = 0x0010; +pub const IMAGE_REL_ARM_MOV32: WORD = 0x0010; +pub const IMAGE_REL_ARM_MOV32T: WORD = 0x0011; +pub const IMAGE_REL_THUMB_MOV32: WORD = 0x0011; +pub const IMAGE_REL_ARM_BRANCH20T: WORD = 0x0012; +pub const IMAGE_REL_THUMB_BRANCH20: WORD = 0x0012; +pub const IMAGE_REL_ARM_BRANCH24T: WORD = 0x0014; +pub const IMAGE_REL_THUMB_BRANCH24: WORD = 0x0014; +pub const IMAGE_REL_ARM_BLX23T: WORD = 0x0015; +pub const IMAGE_REL_THUMB_BLX23: WORD = 0x0015; +pub const IMAGE_REL_AM_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_AM_ADDR32: WORD = 0x0001; +pub const IMAGE_REL_AM_ADDR32NB: WORD = 0x0002; +pub const IMAGE_REL_AM_CALL32: WORD = 0x0003; +pub const IMAGE_REL_AM_FUNCINFO: WORD = 0x0004; +pub const IMAGE_REL_AM_REL32_1: WORD = 0x0005; +pub const IMAGE_REL_AM_REL32_2: WORD = 0x0006; +pub const IMAGE_REL_AM_SECREL: WORD = 0x0007; +pub const IMAGE_REL_AM_SECTION: WORD = 0x0008; +pub const IMAGE_REL_AM_TOKEN: WORD = 0x0009; +pub const IMAGE_REL_ARM64_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_ARM64_ADDR32: WORD = 0x0001; +pub const IMAGE_REL_ARM64_ADDR32NB: WORD = 0x0002; +pub const IMAGE_REL_ARM64_BRANCH26: WORD = 0x0003; +pub const IMAGE_REL_ARM64_PAGEBASE_REL21: WORD = 0x0004; +pub const IMAGE_REL_ARM64_REL21: WORD = 0x0005; +pub const IMAGE_REL_ARM64_PAGEOFFSET_12A: WORD = 0x0006; +pub const IMAGE_REL_ARM64_PAGEOFFSET_12L: WORD = 0x0007; +pub const IMAGE_REL_ARM64_SECREL: WORD = 0x0008; +pub const IMAGE_REL_ARM64_SECREL_LOW12A: WORD = 0x0009; +pub const IMAGE_REL_ARM64_SECREL_HIGH12A: WORD = 0x000A; +pub const IMAGE_REL_ARM64_SECREL_LOW12L: WORD = 0x000B; +pub const IMAGE_REL_ARM64_TOKEN: WORD = 0x000C; +pub const IMAGE_REL_ARM64_SECTION: WORD = 0x000D; +pub const IMAGE_REL_ARM64_ADDR64: WORD = 0x000E; +pub const IMAGE_REL_ARM64_BRANCH19: WORD = 0x000F; +pub const IMAGE_REL_AMD64_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_AMD64_ADDR64: WORD = 0x0001; +pub const IMAGE_REL_AMD64_ADDR32: WORD = 0x0002; +pub const IMAGE_REL_AMD64_ADDR32NB: WORD = 0x0003; +pub const IMAGE_REL_AMD64_REL32: WORD = 0x0004; +pub const IMAGE_REL_AMD64_REL32_1: WORD = 0x0005; +pub const IMAGE_REL_AMD64_REL32_2: WORD = 0x0006; +pub const IMAGE_REL_AMD64_REL32_3: WORD = 0x0007; +pub const IMAGE_REL_AMD64_REL32_4: WORD = 0x0008; +pub const IMAGE_REL_AMD64_REL32_5: WORD = 0x0009; +pub const IMAGE_REL_AMD64_SECTION: WORD = 0x000A; +pub const IMAGE_REL_AMD64_SECREL: WORD = 0x000B; +pub const IMAGE_REL_AMD64_SECREL7: WORD = 0x000C; +pub const IMAGE_REL_AMD64_TOKEN: WORD = 0x000D; +pub const IMAGE_REL_AMD64_SREL32: WORD = 0x000E; +pub const IMAGE_REL_AMD64_PAIR: WORD = 0x000F; +pub const IMAGE_REL_AMD64_SSPAN32: WORD = 0x0010; +pub const IMAGE_REL_IA64_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_IA64_IMM14: WORD = 0x0001; +pub const IMAGE_REL_IA64_IMM22: WORD = 0x0002; +pub const IMAGE_REL_IA64_IMM64: WORD = 0x0003; +pub const IMAGE_REL_IA64_DIR32: WORD = 0x0004; +pub const IMAGE_REL_IA64_DIR64: WORD = 0x0005; +pub const IMAGE_REL_IA64_PCREL21B: WORD = 0x0006; +pub const IMAGE_REL_IA64_PCREL21M: WORD = 0x0007; +pub const IMAGE_REL_IA64_PCREL21F: WORD = 0x0008; +pub const IMAGE_REL_IA64_GPREL22: WORD = 0x0009; +pub const IMAGE_REL_IA64_LTOFF22: WORD = 0x000A; +pub const IMAGE_REL_IA64_SECTION: WORD = 0x000B; +pub const IMAGE_REL_IA64_SECREL22: WORD = 0x000C; +pub const IMAGE_REL_IA64_SECREL64I: WORD = 0x000D; +pub const IMAGE_REL_IA64_SECREL32: WORD = 0x000E; +pub const IMAGE_REL_IA64_DIR32NB: WORD = 0x0010; +pub const IMAGE_REL_IA64_SREL14: WORD = 0x0011; +pub const IMAGE_REL_IA64_SREL22: WORD = 0x0012; +pub const IMAGE_REL_IA64_SREL32: WORD = 0x0013; +pub const IMAGE_REL_IA64_UREL32: WORD = 0x0014; +pub const IMAGE_REL_IA64_PCREL60X: WORD = 0x0015; +pub const IMAGE_REL_IA64_PCREL60B: WORD = 0x0016; +pub const IMAGE_REL_IA64_PCREL60F: WORD = 0x0017; +pub const IMAGE_REL_IA64_PCREL60I: WORD = 0x0018; +pub const IMAGE_REL_IA64_PCREL60M: WORD = 0x0019; +pub const IMAGE_REL_IA64_IMMGPREL64: WORD = 0x001A; +pub const IMAGE_REL_IA64_TOKEN: WORD = 0x001B; +pub const IMAGE_REL_IA64_GPREL32: WORD = 0x001C; +pub const IMAGE_REL_IA64_ADDEND: WORD = 0x001F; +pub const IMAGE_REL_CEF_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_CEF_ADDR32: WORD = 0x0001; +pub const IMAGE_REL_CEF_ADDR64: WORD = 0x0002; +pub const IMAGE_REL_CEF_ADDR32NB: WORD = 0x0003; +pub const IMAGE_REL_CEF_SECTION: WORD = 0x0004; +pub const IMAGE_REL_CEF_SECREL: WORD = 0x0005; +pub const IMAGE_REL_CEF_TOKEN: WORD = 0x0006; +pub const IMAGE_REL_CEE_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_CEE_ADDR32: WORD = 0x0001; +pub const IMAGE_REL_CEE_ADDR64: WORD = 0x0002; +pub const IMAGE_REL_CEE_ADDR32NB: WORD = 0x0003; +pub const IMAGE_REL_CEE_SECTION: WORD = 0x0004; +pub const IMAGE_REL_CEE_SECREL: WORD = 0x0005; +pub const IMAGE_REL_CEE_TOKEN: WORD = 0x0006; +pub const IMAGE_REL_M32R_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_M32R_ADDR32: WORD = 0x0001; +pub const IMAGE_REL_M32R_ADDR32NB: WORD = 0x0002; +pub const IMAGE_REL_M32R_ADDR24: WORD = 0x0003; +pub const IMAGE_REL_M32R_GPREL16: WORD = 0x0004; +pub const IMAGE_REL_M32R_PCREL24: WORD = 0x0005; +pub const IMAGE_REL_M32R_PCREL16: WORD = 0x0006; +pub const IMAGE_REL_M32R_PCREL8: WORD = 0x0007; +pub const IMAGE_REL_M32R_REFHALF: WORD = 0x0008; +pub const IMAGE_REL_M32R_REFHI: WORD = 0x0009; +pub const IMAGE_REL_M32R_REFLO: WORD = 0x000A; +pub const IMAGE_REL_M32R_PAIR: WORD = 0x000B; +pub const IMAGE_REL_M32R_SECTION: WORD = 0x000C; +pub const IMAGE_REL_M32R_SECREL32: WORD = 0x000D; +pub const IMAGE_REL_M32R_TOKEN: WORD = 0x000E; +pub const IMAGE_REL_EBC_ABSOLUTE: WORD = 0x0000; +pub const IMAGE_REL_EBC_ADDR32NB: WORD = 0x0001; +pub const IMAGE_REL_EBC_REL32: WORD = 0x0002; +pub const IMAGE_REL_EBC_SECTION: WORD = 0x0003; +pub const IMAGE_REL_EBC_SECREL: WORD = 0x0004; +UNION!{union IMAGE_LINENUMBER_Type { + [u32; 1], + SymbolTableIndex SymbolTableIndex_mut: DWORD, + VirtualAddress VirtualAddress_mut: DWORD, +}} +STRUCT!{struct IMAGE_LINENUMBER { + Type: IMAGE_LINENUMBER_Type, + Linenumber: WORD, +}} +pub type PIMAGE_LINENUMBER = *mut IMAGE_LINENUMBER; +STRUCT!{struct IMAGE_BASE_RELOCATION { + VirtualAddress: DWORD, + SizeOfBlock: DWORD, +}} +pub type PIMAGE_BASE_RELOCATION = *mut IMAGE_BASE_RELOCATION; +pub const IMAGE_REL_BASED_ABSOLUTE: WORD = 0; +pub const IMAGE_REL_BASED_HIGH: WORD = 1; +pub const IMAGE_REL_BASED_LOW: WORD = 2; +pub const IMAGE_REL_BASED_HIGHLOW: WORD = 3; +pub const IMAGE_REL_BASED_HIGHADJ: WORD = 4; +pub const IMAGE_REL_BASED_MACHINE_SPECIFIC_5: WORD = 5; +pub const IMAGE_REL_BASED_RESERVED: WORD = 6; +pub const IMAGE_REL_BASED_MACHINE_SPECIFIC_7: WORD = 7; +pub const IMAGE_REL_BASED_MACHINE_SPECIFIC_8: WORD = 8; +pub const IMAGE_REL_BASED_MACHINE_SPECIFIC_9: WORD = 9; +pub const IMAGE_REL_BASED_DIR64: WORD = 10; +pub const IMAGE_REL_BASED_IA64_IMM64: WORD = 9; +pub const IMAGE_REL_BASED_MIPS_JMPADDR: WORD = 5; +pub const IMAGE_REL_BASED_MIPS_JMPADDR16: WORD = 9; +pub const IMAGE_REL_BASED_ARM_MOV32: WORD = 5; +pub const IMAGE_REL_BASED_THUMB_MOV32: WORD = 7; +pub const IMAGE_ARCHIVE_START_SIZE: usize = 8; +pub const IMAGE_ARCHIVE_START: &'static str = "!\n"; +pub const IMAGE_ARCHIVE_END: &'static str = "`\n"; +pub const IMAGE_ARCHIVE_PAD: &'static str = "\n"; +pub const IMAGE_ARCHIVE_LINKER_MEMBER: &'static str = "/ "; +pub const IMAGE_ARCHIVE_LONGNAMES_MEMBER: &'static str = "// "; +pub const IMAGE_ARCHIVE_HYBRIDMAP_MEMBER: &'static str = "// "; +STRUCT!{struct IMAGE_ARCHIVE_MEMBER_HEADER { + Name: [BYTE; 16], + Date: [BYTE; 12], + UserID: [BYTE; 6], + GroupID: [BYTE; 6], + Mode: [BYTE; 8], + Size: [BYTE; 10], + EndHeader: [BYTE; 2], +}} +pub type PIMAGE_ARCHIVE_MEMBER_HEADER = *mut IMAGE_ARCHIVE_MEMBER_HEADER; +pub const IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR: usize = 60; +STRUCT!{struct IMAGE_EXPORT_DIRECTORY { + Characteristics: DWORD, + TimeDateStamp: DWORD, + MajorVersion: WORD, + MinorVersion: WORD, + Name: DWORD, + Base: DWORD, + NumberOfFunctions: DWORD, + NumberOfNames: DWORD, + AddressOfFunctions: DWORD, + AddressOfNames: DWORD, + AddressOfNameOrdinals: DWORD, +}} +pub type PIMAGE_EXPORT_DIRECTORY = *mut IMAGE_EXPORT_DIRECTORY; +STRUCT!{struct IMAGE_IMPORT_BY_NAME { + Hint: WORD, + Name: [CHAR; 1], +}} +pub type PIMAGE_IMPORT_BY_NAME = *mut IMAGE_IMPORT_BY_NAME; +UNION!{union IMAGE_THUNK_DATA64_u1 { + [u64; 1], + ForwarderString ForwarderString_mut: ULONGLONG, + Function Function_mut: ULONGLONG, + Ordinal Ordinal_mut: ULONGLONG, + AddressOfData AddressOfData_mut: ULONGLONG, +}} +STRUCT!{struct IMAGE_THUNK_DATA64 { + u1: IMAGE_THUNK_DATA64_u1, +}} +pub type PIMAGE_THUNK_DATA64 = *mut IMAGE_THUNK_DATA64; +UNION!{union IMAGE_THUNK_DATA32_u1 { + [u32; 1], + ForwarderString ForwarderString_mut: DWORD, + Function Function_mut: DWORD, + Ordinal Ordinal_mut: DWORD, + AddressOfData AddressOfData_mut: DWORD, +}} +STRUCT!{struct IMAGE_THUNK_DATA32 { + u1: IMAGE_THUNK_DATA32_u1, +}} +pub type PIMAGE_THUNK_DATA32 = *mut IMAGE_THUNK_DATA32; +pub const IMAGE_ORDINAL_FLAG64: ULONGLONG = 0x8000000000000000; +pub const IMAGE_ORDINAL_FLAG32: DWORD = 0x80000000; +#[inline] +pub fn IMAGE_ORDINAL64(Ordinal: ULONGLONG) -> ULONGLONG { + Ordinal & 0xffff +} +#[inline] +pub fn IMAGE_ORDINAL32(Ordinal: DWORD) -> DWORD { + Ordinal & 0xffff +} +#[inline] +pub fn IMAGE_SNAP_BY_ORDINAL64(Ordinal: ULONGLONG) -> bool { + (Ordinal & IMAGE_ORDINAL_FLAG64) != 0 +} +#[inline] +pub fn IMAGE_SNAP_BY_ORDINAL32(Ordinal: DWORD) -> bool { + (Ordinal & IMAGE_ORDINAL_FLAG32) != 0 +} +FN!{stdcall PIMAGE_TLS_CALLBACK( + DllHandle: PVOID, + Reason: DWORD, + Reserved: PVOID, +) -> ()} +STRUCT!{struct IMAGE_TLS_DIRECTORY64 { + StartAddressOfRawData: ULONGLONG, + EndAddressOfRawData: ULONGLONG, + AddressOfIndex: ULONGLONG, + AddressOfCallBacks: ULONGLONG, + SizeOfZeroFill: DWORD, + Characteristics: DWORD, +}} +BITFIELD!{IMAGE_TLS_DIRECTORY64 Characteristics: DWORD [ + Reserved0 set_Reserved0[0..20], + Alignment set_Alignment[20..24], + Reserved1 set_Reserved1[24..32], +]} +pub type PIMAGE_TLS_DIRECTORY64 = *mut IMAGE_TLS_DIRECTORY64; +STRUCT!{struct IMAGE_TLS_DIRECTORY32 { + StartAddressOfRawData: DWORD, + EndAddressOfRawData: DWORD, + AddressOfIndex: DWORD, + AddressOfCallBacks: DWORD, + SizeOfZeroFill: DWORD, + Characteristics: DWORD, +}} +BITFIELD!{IMAGE_TLS_DIRECTORY32 Characteristics: DWORD [ + Reserved0 set_Reserved0[0..20], + Alignment set_Alignment[20..24], + Reserved1 set_Reserved1[24..32], +]} +pub type PIMAGE_TLS_DIRECTORY32 = *mut IMAGE_TLS_DIRECTORY32; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +pub const IMAGE_ORDINAL_FLAG: ULONGLONG = IMAGE_ORDINAL_FLAG64; +#[inline] +pub fn IMAGE_ORDINAL(Ordinal: ULONGLONG) -> ULONGLONG { + IMAGE_ORDINAL64(Ordinal) +} +pub type IMAGE_THUNK_DATA = IMAGE_THUNK_DATA64; +pub type PIMAGE_THUNK_DATA = PIMAGE_THUNK_DATA64; +#[inline] +pub fn IMAGE_SNAP_BY_ORDINAL(Ordinal: ULONGLONG) -> bool { + IMAGE_SNAP_BY_ORDINAL64(Ordinal) +} +pub type IMAGE_TLS_DIRECTORY = IMAGE_TLS_DIRECTORY64; +pub type PIMAGE_TLS_DIRECTORY = PIMAGE_TLS_DIRECTORY64; +} +#[cfg(target_pointer_width = "32")] +IFDEF!{ +pub const IMAGE_ORDINAL_FLAG: DWORD = IMAGE_ORDINAL_FLAG32; +#[inline] +pub fn IMAGE_ORDINAL(Ordinal: DWORD) -> DWORD { + IMAGE_ORDINAL32(Ordinal) +} +pub type IMAGE_THUNK_DATA = IMAGE_THUNK_DATA32; +pub type PIMAGE_THUNK_DATA = PIMAGE_THUNK_DATA32; +#[inline] +pub fn IMAGE_SNAP_BY_ORDINAL(Ordinal: DWORD) -> bool { + IMAGE_SNAP_BY_ORDINAL32(Ordinal) +} +pub type IMAGE_TLS_DIRECTORY = IMAGE_TLS_DIRECTORY32; +pub type PIMAGE_TLS_DIRECTORY = PIMAGE_TLS_DIRECTORY32; +} +UNION!{union IMAGE_IMPORT_DESCRIPTOR_u { + [u32; 1], + Characteristics Characteristics_mut: DWORD, + OriginalFirstThunk OriginalFirstThunk_mut: DWORD, +}} +STRUCT!{struct IMAGE_IMPORT_DESCRIPTOR { + u: IMAGE_IMPORT_DESCRIPTOR_u, + TimeDateStamp: DWORD, + ForwarderChain: DWORD, + Name: DWORD, + FirstThunk: DWORD, +}} +pub type PIMAGE_IMPORT_DESCRIPTOR = *mut IMAGE_IMPORT_DESCRIPTOR; +STRUCT!{struct IMAGE_BOUND_IMPORT_DESCRIPTOR { + TimeDateStamp: DWORD, + OffsetModuleName: WORD, + NumberOfModuleForwarderRefs: WORD, +}} +pub type PIMAGE_BOUND_IMPORT_DESCRIPTOR = *mut IMAGE_BOUND_IMPORT_DESCRIPTOR; +STRUCT!{struct IMAGE_BOUND_FORWARDER_REF { + TimeDateStamp: DWORD, + OffsetModuleName: WORD, + Reserved: WORD, +}} +pub type PIMAGE_BOUND_FORWARDER_REF = *mut IMAGE_BOUND_FORWARDER_REF; +STRUCT!{struct IMAGE_DELAYLOAD_DESCRIPTOR_Attributes { + AllAttributes: DWORD, +}} +BITFIELD!{IMAGE_DELAYLOAD_DESCRIPTOR_Attributes AllAttributes: DWORD [ + RvaBased set_RvaBased[0..1], + ReservedAttributes set_ReservedAttributes[1..32], +]} +STRUCT!{struct IMAGE_DELAYLOAD_DESCRIPTOR { + Attributes: IMAGE_DELAYLOAD_DESCRIPTOR_Attributes, + DllNameRVA: DWORD, + ModuleHandleRVA: DWORD, + ImportAddressTableRVA: DWORD, + ImportNameTableRVA: DWORD, + BoundImportAddressTableRVA: DWORD, + UnloadInformationTableRVA: DWORD, + TimeDateStamp: DWORD, +}} +pub type PIMAGE_DELAYLOAD_DESCRIPTOR = *mut IMAGE_DELAYLOAD_DESCRIPTOR; +pub type PCIMAGE_DELAYLOAD_DESCRIPTOR = *const IMAGE_DELAYLOAD_DESCRIPTOR; +STRUCT!{struct IMAGE_RESOURCE_DIRECTORY { + Characteristics: DWORD, + TimeDateStamp: DWORD, + MajorVersion: WORD, + MinorVersion: WORD, + NumberOfNamedEntries: WORD, + NumberOfIdEntries: WORD, +}} +pub type PIMAGE_RESOURCE_DIRECTORY = *mut IMAGE_RESOURCE_DIRECTORY; +pub const IMAGE_RESOURCE_NAME_IS_STRING: DWORD = 0x80000000; +pub const IMAGE_RESOURCE_DATA_IS_DIRECTORY: DWORD = 0x80000000; +STRUCT!{struct IMAGE_RESOURCE_DIRECTORY_ENTRY_u_s { + BitFields: DWORD, +}} +BITFIELD!{IMAGE_RESOURCE_DIRECTORY_ENTRY_u_s BitFields: DWORD [ + NameOffset set_NameOffset[0..31], + NameIsString set_NameIsString[31..32], +]} +UNION!{union IMAGE_RESOURCE_DIRECTORY_ENTRY_u { + [u32; 1], + s s_mut: IMAGE_RESOURCE_DIRECTORY_ENTRY_u_s, + Name Name_mut: DWORD, + Id Id_mut: WORD, +}} +STRUCT!{struct IMAGE_RESOURCE_DIRECTORY_ENTRY { + u: IMAGE_RESOURCE_DIRECTORY_ENTRY_u, + OffsetToData: DWORD, +}} +BITFIELD!{IMAGE_RESOURCE_DIRECTORY_ENTRY OffsetToData: DWORD [ + OffsetToDirectory set_OffsetToDirectory[0..31], + DataIsDirectory set_DataIsDirectory[31..32], +]} +pub type PIMAGE_RESOURCE_DIRECTORY_ENTRY = *mut IMAGE_RESOURCE_DIRECTORY_ENTRY; +STRUCT!{struct IMAGE_RESOURCE_DIRECTORY_STRING { + Length: WORD, + NameString: [CHAR; 1], +}} +pub type PIMAGE_RESOURCE_DIRECTORY_STRING = *mut IMAGE_RESOURCE_DIRECTORY_STRING; +STRUCT!{struct IMAGE_RESOURCE_DIR_STRING_U { + Length: WORD, + NameString: [WCHAR; 1], +}} +pub type PIMAGE_RESOURCE_DIR_STRING_U = *mut IMAGE_RESOURCE_DIR_STRING_U; +STRUCT!{struct IMAGE_RESOURCE_DATA_ENTRY { + OffsetToData: DWORD, + Size: DWORD, + CodePage: DWORD, + Reserved: DWORD, +}} +pub type PIMAGE_RESOURCE_DATA_ENTRY = *mut IMAGE_RESOURCE_DATA_ENTRY; +STRUCT!{struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY { + Flags: WORD, + Catalog: WORD, + CatalogOffset: DWORD, + Reserved: DWORD, +}} +pub type PIMAGE_LOAD_CONFIG_CODE_INTEGRITY = *mut IMAGE_LOAD_CONFIG_CODE_INTEGRITY; +STRUCT!{struct IMAGE_DYNAMIC_RELOCATION_TABLE { + Version: DWORD, + Size: DWORD, +}} +pub type PIMAGE_DYNAMIC_RELOCATION_TABLE = *mut IMAGE_DYNAMIC_RELOCATION_TABLE; +STRUCT!{#[repr(packed)] struct IMAGE_DYNAMIC_RELOCATION32 { + Symbol: DWORD, + BaseRelocSize: DWORD, +}} +pub type PIMAGE_DYNAMIC_RELOCATION32 = *mut IMAGE_DYNAMIC_RELOCATION32; +STRUCT!{#[repr(packed)] struct IMAGE_DYNAMIC_RELOCATION64 { + Symbol: ULONGLONG, + BaseRelocSize: DWORD, +}} +pub type PIMAGE_DYNAMIC_RELOCATION64 = *mut IMAGE_DYNAMIC_RELOCATION64; +STRUCT!{#[repr(packed)] struct IMAGE_DYNAMIC_RELOCATION32_V2 { + HeaderSize: DWORD, + FixupInfoSize: DWORD, + Symbol: DWORD, + SymbolGroup: DWORD, + Flags: DWORD, +}} +pub type PIMAGE_DYNAMIC_RELOCATION32_V2 = *mut IMAGE_DYNAMIC_RELOCATION32_V2; +STRUCT!{#[repr(packed)] struct IMAGE_DYNAMIC_RELOCATION64_V2 { + HeaderSize: DWORD, + FixupInfoSize: DWORD, + Symbol: ULONGLONG, + SymbolGroup: DWORD, + Flags: DWORD, +}} +pub type PIMAGE_DYNAMIC_RELOCATION64_V2 = *mut IMAGE_DYNAMIC_RELOCATION64_V2; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +pub type IMAGE_DYNAMIC_RELOCATION = IMAGE_DYNAMIC_RELOCATION64; +pub type PIMAGE_DYNAMIC_RELOCATION = PIMAGE_DYNAMIC_RELOCATION64; +pub type IMAGE_DYNAMIC_RELOCATION_V2 = IMAGE_DYNAMIC_RELOCATION64_V2; +pub type PIMAGE_DYNAMIC_RELOCATION_V2 = PIMAGE_DYNAMIC_RELOCATION64_V2; +} +#[cfg(target_pointer_width = "32")] +IFDEF!{ +pub type IMAGE_DYNAMIC_RELOCATION = IMAGE_DYNAMIC_RELOCATION32; +pub type PIMAGE_DYNAMIC_RELOCATION = PIMAGE_DYNAMIC_RELOCATION32; +pub type IMAGE_DYNAMIC_RELOCATION_V2 = IMAGE_DYNAMIC_RELOCATION32_V2; +pub type PIMAGE_DYNAMIC_RELOCATION_V2 = PIMAGE_DYNAMIC_RELOCATION32_V2; +} +pub const IMAGE_DYNAMIC_RELOCATION_GUARD_RF_PROLOGUE: DWORD = 0x00000001; +pub const IMAGE_DYNAMIC_RELOCATION_GUARD_RF_EPILOGUE: DWORD = 0x00000002; +STRUCT!{#[repr(packed)] struct IMAGE_PROLOGUE_DYNAMIC_RELOCATION_HEADER { + PrologueByteCount: BYTE, +}} +pub type PIMAGE_PROLOGUE_DYNAMIC_RELOCATION_HEADER = *mut IMAGE_PROLOGUE_DYNAMIC_RELOCATION_HEADER; +STRUCT!{#[repr(packed)] struct IMAGE_EPILOGUE_DYNAMIC_RELOCATION_HEADER { + EpilogueCount: DWORD, + EpilogueByteCount: BYTE, + BranchDescriptorElementSize: BYTE, + BranchDescriptorCount: WORD, +}} +pub type PIMAGE_EPILOGUE_DYNAMIC_RELOCATION_HEADER = *mut IMAGE_EPILOGUE_DYNAMIC_RELOCATION_HEADER; +STRUCT!{struct IMAGE_LOAD_CONFIG_DIRECTORY32 { + Size: DWORD, + TimeDateStamp: DWORD, + MajorVersion: WORD, + MinorVersion: WORD, + GlobalFlagsClear: DWORD, + GlobalFlagsSet: DWORD, + CriticalSectionDefaultTimeout: DWORD, + DeCommitFreeBlockThreshold: DWORD, + DeCommitTotalFreeThreshold: DWORD, + LockPrefixTable: DWORD, + MaximumAllocationSize: DWORD, + VirtualMemoryThreshold: DWORD, + ProcessHeapFlags: DWORD, + ProcessAffinityMask: DWORD, + CSDVersion: WORD, + DependentLoadFlags: WORD, + EditList: DWORD, + SecurityCookie: DWORD, + SEHandlerTable: DWORD, + SEHandlerCount: DWORD, + GuardCFCheckFunctionPointer: DWORD, + GuardCFDispatchFunctionPointer: DWORD, + GuardCFFunctionTable: DWORD, + GuardCFFunctionCount: DWORD, + GuardFlags: DWORD, + CodeIntegrity: IMAGE_LOAD_CONFIG_CODE_INTEGRITY, + GuardAddressTakenIatEntryTable: DWORD, + GuardAddressTakenIatEntryCount: DWORD, + GuardLongJumpTargetTable: DWORD, + GuardLongJumpTargetCount: DWORD, + DynamicValueRelocTable: DWORD, + CHPEMetadataPointer: DWORD, + GuardRFFailureRoutine: DWORD, + GuardRFFailureRoutineFunctionPointer: DWORD, + DynamicValueRelocTableOffset: DWORD, + DynamicValueRelocTableSection: WORD, + Reserved2: WORD, + GuardRFVerifyStackPointerFunctionPointer: DWORD, + HotPatchTableOffset: DWORD, + Reserved3: DWORD, + EnclaveConfigurationPointer: DWORD, +}} +pub type PIMAGE_LOAD_CONFIG_DIRECTORY32 = *mut IMAGE_LOAD_CONFIG_DIRECTORY32; +STRUCT!{struct IMAGE_LOAD_CONFIG_DIRECTORY64 { + Size: DWORD, + TimeDateStamp: DWORD, + MajorVersion: WORD, + MinorVersion: WORD, + GlobalFlagsClear: DWORD, + GlobalFlagsSet: DWORD, + CriticalSectionDefaultTimeout: DWORD, + DeCommitFreeBlockThreshold: ULONGLONG, + DeCommitTotalFreeThreshold: ULONGLONG, + LockPrefixTable: ULONGLONG, + MaximumAllocationSize: ULONGLONG, + VirtualMemoryThreshold: ULONGLONG, + ProcessAffinityMask: ULONGLONG, + ProcessHeapFlags: DWORD, + CSDVersion: WORD, + DependentLoadFlags: WORD, + EditList: ULONGLONG, + SecurityCookie: ULONGLONG, + SEHandlerTable: ULONGLONG, + SEHandlerCount: ULONGLONG, + GuardCFCheckFunctionPointer: ULONGLONG, + GuardCFDispatchFunctionPointer: ULONGLONG, + GuardCFFunctionTable: ULONGLONG, + GuardCFFunctionCount: ULONGLONG, + GuardFlags: DWORD, + CodeIntegrity: IMAGE_LOAD_CONFIG_CODE_INTEGRITY, + GuardAddressTakenIatEntryTable: ULONGLONG, + GuardAddressTakenIatEntryCount: ULONGLONG, + GuardLongJumpTargetTable: ULONGLONG, + GuardLongJumpTargetCount: ULONGLONG, + DynamicValueRelocTable: ULONGLONG, + CHPEMetadataPointer: ULONGLONG, + GuardRFFailureRoutine: ULONGLONG, + GuardRFFailureRoutineFunctionPointer: ULONGLONG, + DynamicValueRelocTableOffset: DWORD, + DynamicValueRelocTableSection: WORD, + Reserved2: WORD, + GuardRFVerifyStackPointerFunctionPointer: ULONGLONG, + HotPatchTableOffset: DWORD, + Reserved3: DWORD, + EnclaveConfigurationPointer: ULONGLONG, +}} +pub type PIMAGE_LOAD_CONFIG_DIRECTORY64 = *mut IMAGE_LOAD_CONFIG_DIRECTORY64; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +pub type IMAGE_LOAD_CONFIG_DIRECTORY = IMAGE_LOAD_CONFIG_DIRECTORY64; +pub type PIMAGE_LOAD_CONFIG_DIRECTORY = PIMAGE_LOAD_CONFIG_DIRECTORY64; +} +#[cfg(target_pointer_width = "32")] +IFDEF!{ +pub type IMAGE_LOAD_CONFIG_DIRECTORY = IMAGE_LOAD_CONFIG_DIRECTORY32; +pub type PIMAGE_LOAD_CONFIG_DIRECTORY = PIMAGE_LOAD_CONFIG_DIRECTORY32; +} +STRUCT!{struct IMAGE_HOT_PATCH_INFO { + Version: DWORD, + Size: DWORD, + SequenceNumber: DWORD, + BaseImageList: DWORD, + BaseImageCount: DWORD, + BufferOffset: DWORD, +}} +pub type PIMAGE_HOT_PATCH_INFO = *mut IMAGE_HOT_PATCH_INFO; +STRUCT!{struct IMAGE_HOT_PATCH_BASE { + SequenceNumber: DWORD, + Flags: DWORD, + OriginalTimeDateStamp: DWORD, + OriginalCheckSum: DWORD, + CodeIntegrityInfo: DWORD, + CodeIntegritySize: DWORD, + PatchTable: DWORD, + BufferOffset: DWORD, +}} +pub type PIMAGE_HOT_PATCH_BASE = *mut IMAGE_HOT_PATCH_BASE; +STRUCT!{struct IMAGE_HOT_PATCH_HASHES { + SHA256: [BYTE; 32], + SHA1: [BYTE; 20], +}} +pub type PIMAGE_HOT_PATCH_HASHES = *mut IMAGE_HOT_PATCH_HASHES; +pub const IMAGE_HOT_PATCH_BASE_OBLIGATORY: DWORD = 0x00000001; +pub const IMAGE_HOT_PATCH_CHUNK_INVERSE: DWORD = 0x80000000; +pub const IMAGE_HOT_PATCH_CHUNK_OBLIGATORY: DWORD = 0x40000000; +pub const IMAGE_HOT_PATCH_CHUNK_RESERVED: DWORD = 0x3FF03000; +pub const IMAGE_HOT_PATCH_CHUNK_TYPE: DWORD = 0x000FC000; +pub const IMAGE_HOT_PATCH_CHUNK_SOURCE_RVA: DWORD = 0x00008000; +pub const IMAGE_HOT_PATCH_CHUNK_TARGET_RVA: DWORD = 0x00004000; +pub const IMAGE_HOT_PATCH_CHUNK_SIZE: DWORD = 0x00000FFF; +pub const IMAGE_HOT_PATCH_NONE: DWORD = 0x00000000; +pub const IMAGE_HOT_PATCH_FUNCTION: DWORD = 0x0001C000; +pub const IMAGE_HOT_PATCH_ABSOLUTE: DWORD = 0x0002C000; +pub const IMAGE_HOT_PATCH_REL32: DWORD = 0x0003C000; +pub const IMAGE_HOT_PATCH_CALL_TARGET: DWORD = 0x00044000; +pub const IMAGE_HOT_PATCH_INDIRECT: DWORD = 0x0005C000; +pub const IMAGE_HOT_PATCH_NO_CALL_TARGET: DWORD = 0x00064000; +pub const IMAGE_HOT_PATCH_DYNAMIC_VALUE: DWORD = 0x00078000; +pub const IMAGE_GUARD_CF_INSTRUMENTED: DWORD = 0x00000100; +pub const IMAGE_GUARD_CFW_INSTRUMENTED: DWORD = 0x00000200; +pub const IMAGE_GUARD_CF_FUNCTION_TABLE_PRESENT: DWORD = 0x00000400; +pub const IMAGE_GUARD_SECURITY_COOKIE_UNUSED: DWORD = 0x00000800; +pub const IMAGE_GUARD_PROTECT_DELAYLOAD_IAT: DWORD = 0x00001000; +pub const IMAGE_GUARD_DELAYLOAD_IAT_IN_ITS_OWN_SECTION: DWORD = 0x00002000; +pub const IMAGE_GUARD_CF_EXPORT_SUPPRESSION_INFO_PRESENT: DWORD = 0x00004000; +pub const IMAGE_GUARD_CF_ENABLE_EXPORT_SUPPRESSION: DWORD = 0x00008000; +pub const IMAGE_GUARD_CF_LONGJUMP_TABLE_PRESENT: DWORD = 0x00010000; +pub const IMAGE_GUARD_RF_INSTRUMENTED: DWORD = 0x00020000; +pub const IMAGE_GUARD_RF_ENABLE: DWORD = 0x00040000; +pub const IMAGE_GUARD_RF_STRICT: DWORD = 0x00080000; +pub const IMAGE_GUARD_CF_FUNCTION_TABLE_SIZE_MASK: DWORD = 0xF0000000; +pub const IMAGE_GUARD_CF_FUNCTION_TABLE_SIZE_SHIFT: usize = 28; +pub const IMAGE_GUARD_FLAG_FID_SUPPRESSED: DWORD = 0x01; +pub const IMAGE_GUARD_FLAG_EXPORT_SUPPRESSED: DWORD = 0x02; +STRUCT!{struct IMAGE_CE_RUNTIME_FUNCTION_ENTRY { + FuncStart: DWORD, + BitFields: DWORD, +}} +BITFIELD!{IMAGE_CE_RUNTIME_FUNCTION_ENTRY BitFields: DWORD [ + PrologLen set_PrologLen[0..8], + FuncLen set_FuncLen[8..30], + ThirtyTwoBit set_ThirtyTwoBit[30..31], + ExceptionFlag set_ExceptionFlag[31..32], +]} +pub type PIMAGE_CE_RUNTIME_FUNCTION_ENTRY = *mut IMAGE_CE_RUNTIME_FUNCTION_ENTRY; +STRUCT!{struct IMAGE_ARM_RUNTIME_FUNCTION_ENTRY { + BeginAddress: DWORD, + UnwindData: DWORD, +}} +BITFIELD!{IMAGE_ARM_RUNTIME_FUNCTION_ENTRY UnwindData: DWORD [ + Flag set_Flag[0..2], + FunctionLength set_FunctionLength[2..13], + Ret set_Ret[13..15], + H set_H[15..16], + Reg set_Reg[16..19], + R set_R[19..20], + L set_L[20..21], + C set_c[21..22], + StackAdjust set_StackAdjust[22..32], +]} +pub type PIMAGE_ARM_RUNTIME_FUNCTION_ENTRY = *mut IMAGE_ARM_RUNTIME_FUNCTION_ENTRY; +STRUCT!{struct IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY { + BeginAddress: DWORD, + UnwindData: DWORD, +}} +BITFIELD!{IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY UnwindData: DWORD [ + Flag set_Flag[0..2], + FunctionLength set_FunctionLength[2..13], + RegF set_RegF[13..16], + RegI set_RegI[16..20], + H set_H[20..21], + CR set_cR[21..23], + FrameSize set_FrameSize[23..32], +]} +pub type PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY = *mut IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY; +STRUCT!{struct IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY { + BeginAddress: ULONGLONG, + EndAddress: ULONGLONG, + ExceptionHandler: ULONGLONG, + HandlerData: ULONGLONG, + PrologEndAddress: ULONGLONG, +}} +pub type PIMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY = *mut IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY; +STRUCT!{struct IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY { + BeginAddress: DWORD, + EndAddress: DWORD, + ExceptionHandler: DWORD, + HandlerData: DWORD, + PrologEndAddress: DWORD, +}} +pub type PIMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY = *mut IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY; +UNION!{union IMAGE_RUNTIME_FUNCTION_ENTRY_u { + [u32; 1], + UnwindInfoAddress UnwindInfoAddress_mut: DWORD, + UnwindData UnwindData_mut: DWORD, +}} +STRUCT!{struct _IMAGE_RUNTIME_FUNCTION_ENTRY { + BeginAddress: DWORD, + EndAddress: DWORD, + u: IMAGE_RUNTIME_FUNCTION_ENTRY_u, +}} +pub type _PIMAGE_RUNTIME_FUNCTION_ENTRY = *mut _IMAGE_RUNTIME_FUNCTION_ENTRY; +pub type IMAGE_IA64_RUNTIME_FUNCTION_ENTRY = _IMAGE_RUNTIME_FUNCTION_ENTRY; +pub type PIMAGE_IA64_RUNTIME_FUNCTION_ENTRY = _PIMAGE_RUNTIME_FUNCTION_ENTRY; +#[cfg(target_arch = "aarch64")] +IFDEF!{ +pub type IMAGE_RUNTIME_FUNCTION_ENTRY = IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY; +pub type PIMAGE_RUNTIME_FUNCTION_ENTRY = PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY; +} +#[cfg(not(target_arch = "aarch64"))] +IFDEF!{ +pub type IMAGE_RUNTIME_FUNCTION_ENTRY = _IMAGE_RUNTIME_FUNCTION_ENTRY; +pub type PIMAGE_RUNTIME_FUNCTION_ENTRY = _PIMAGE_RUNTIME_FUNCTION_ENTRY; +} +STRUCT!{struct IMAGE_DEBUG_DIRECTORY { + Characteristics: DWORD, + TimeDateStamp: DWORD, + MajorVersion: WORD, + MinorVersion: WORD, + Type: DWORD, + SizeOfData: DWORD, + AddressOfRawData: DWORD, + PointerToRawData: DWORD, +}} +pub type PIMAGE_DEBUG_DIRECTORY = *mut IMAGE_DEBUG_DIRECTORY; +pub const IMAGE_DEBUG_TYPE_UNKNOWN: DWORD = 0; +pub const IMAGE_DEBUG_TYPE_COFF: DWORD = 1; +pub const IMAGE_DEBUG_TYPE_CODEVIEW: DWORD = 2; +pub const IMAGE_DEBUG_TYPE_FPO: DWORD = 3; +pub const IMAGE_DEBUG_TYPE_MISC: DWORD = 4; +pub const IMAGE_DEBUG_TYPE_EXCEPTION: DWORD = 5; +pub const IMAGE_DEBUG_TYPE_FIXUP: DWORD = 6; +pub const IMAGE_DEBUG_TYPE_OMAP_TO_SRC: DWORD = 7; +pub const IMAGE_DEBUG_TYPE_OMAP_FROM_SRC: DWORD = 8; +pub const IMAGE_DEBUG_TYPE_BORLAND: DWORD = 9; +pub const IMAGE_DEBUG_TYPE_RESERVED10: DWORD = 10; +pub const IMAGE_DEBUG_TYPE_CLSID: DWORD = 11; +pub const IMAGE_DEBUG_TYPE_VC_FEATURE: DWORD = 12; +pub const IMAGE_DEBUG_TYPE_POGO: DWORD = 13; +pub const IMAGE_DEBUG_TYPE_ILTCG: DWORD = 14; +pub const IMAGE_DEBUG_TYPE_MPX: DWORD = 15; +pub const IMAGE_DEBUG_TYPE_REPRO: DWORD = 16; +STRUCT!{struct IMAGE_COFF_SYMBOLS_HEADER { + NumberOfSymbols: DWORD, + LvaToFirstSymbol: DWORD, + NumberOfLinenumbers: DWORD, + LvaToFirstLinenumber: DWORD, + RvaToFirstByteOfCode: DWORD, + RvaToLastByteOfCode: DWORD, + RvaToFirstByteOfData: DWORD, + RvaToLastByteOfData: DWORD, +}} +pub type PIMAGE_COFF_SYMBOLS_HEADER = *mut IMAGE_COFF_SYMBOLS_HEADER; +pub const FRAME_FPO: WORD = 0; +pub const FRAME_TRAP: WORD = 1; +pub const FRAME_TSS: WORD = 2; +pub const FRAME_NONFPO: WORD = 3; +STRUCT!{struct FPO_DATA { + ulOffStart: DWORD, + cbProcSize: DWORD, + cdwLocals: DWORD, + cdwParams: WORD, + BitFields: WORD, +}} +BITFIELD!{FPO_DATA BitFields: WORD [ + cbProlog set_cbProlog[0..8], + cbRegs set_cbRegs[8..11], + fHasSEH set_fHasSEH[11..12], + fUseBP set_fUseBP[12..13], + reserved set_reserved[13..14], + cbFrame set_cbFrame[14..16], +]} +pub type PFPO_DATA = *mut FPO_DATA; +pub const SIZEOF_RFPO_DATA: usize = 16; +pub const IMAGE_DEBUG_MISC_EXENAME: DWORD = 1; +STRUCT!{struct IMAGE_DEBUG_MISC { + DataType: DWORD, + Length: DWORD, + Unicode: BOOLEAN, + Reserved: [BYTE; 3], + Data: [BYTE; 1], +}} +pub type PIMAGE_DEBUG_MISC = *mut IMAGE_DEBUG_MISC; +STRUCT!{struct IMAGE_FUNCTION_ENTRY { + StartingAddress: DWORD, + EndingAddress: DWORD, + EndOfPrologue: DWORD, +}} +pub type PIMAGE_FUNCTION_ENTRY = *mut IMAGE_FUNCTION_ENTRY; +UNION!{union IMAGE_FUNCTION_ENTRY64_u { + [u64; 1], + EndOfPrologue EndOfPrologue_mut: ULONGLONG, + UnwindInfoAddress UnwindInfoAddress_mut: ULONGLONG, +}} +STRUCT!{struct IMAGE_FUNCTION_ENTRY64 { + StartingAddress: ULONGLONG, + EndingAddress: ULONGLONG, + u: IMAGE_FUNCTION_ENTRY64_u, +}} +pub type PIMAGE_FUNCTION_ENTRY64 = *mut IMAGE_FUNCTION_ENTRY64; +STRUCT!{struct IMAGE_SEPARATE_DEBUG_HEADER { + Signature: WORD, + Flags: WORD, + Machine: WORD, + Characteristics: WORD, + TimeDateStamp: DWORD, + CheckSum: DWORD, + ImageBase: DWORD, + SizeOfImage: DWORD, + NumberOfSections: DWORD, + ExportedNamesSize: DWORD, + DebugDirectorySize: DWORD, + SectionAlignment: DWORD, + Reserved: [DWORD; 2], +}} +pub type PIMAGE_SEPARATE_DEBUG_HEADER = *mut IMAGE_SEPARATE_DEBUG_HEADER; +STRUCT!{struct NON_PAGED_DEBUG_INFO { + Signature: WORD, + Flags: WORD, + Size: DWORD, + Machine: WORD, + Characteristics: WORD, + TimeDateStamp: DWORD, + CheckSum: DWORD, + SizeOfImage: DWORD, + ImageBase: ULONGLONG, +}} +pub type PNON_PAGED_DEBUG_INFO = *mut NON_PAGED_DEBUG_INFO; +pub const IMAGE_SEPARATE_DEBUG_SIGNATURE: WORD = 0x4944; +pub const NON_PAGED_DEBUG_SIGNATURE: WORD = 0x494E; +pub const IMAGE_SEPARATE_DEBUG_FLAGS_MASK: WORD = 0x8000; +pub const IMAGE_SEPARATE_DEBUG_MISMATCH: WORD = 0x8000; +STRUCT!{struct IMAGE_ARCHITECTURE_HEADER { + BitFields: c_uint, + FirstEntryRVA: DWORD, +}} +BITFIELD!{IMAGE_ARCHITECTURE_HEADER BitFields: c_uint [ + AmaskValue set_AmaskValue[0..1], + unused1 set_unused1[1..8], + AmaskShift set_AmaskShift[8..16], + unused2 set_unused2[8..32], +]} +pub type PIMAGE_ARCHITECTURE_HEADER = *mut IMAGE_ARCHITECTURE_HEADER; +STRUCT!{struct IMAGE_ARCHITECTURE_ENTRY { + FixupInstRVA: DWORD, + NewInst: DWORD, +}} +pub type PIMAGE_ARCHITECTURE_ENTRY = *mut IMAGE_ARCHITECTURE_ENTRY; +pub const IMPORT_OBJECT_HDR_SIG2: WORD = 0xffff; +UNION!{union IMPORT_OBJECT_HEADER_u { + [u16; 1], + Ordinal Ordinal_mut: WORD, + Hint Hint_mut: WORD, +}} +STRUCT!{struct IMPORT_OBJECT_HEADER { + Sig1: WORD, + Sig2: WORD, + Version: WORD, + Machine: WORD, + TimeDateStamp: DWORD, + SizeOfData: DWORD, + u: IMPORT_OBJECT_HEADER_u, + BitFields: WORD, +}} +BITFIELD!{IMPORT_OBJECT_HEADER BitFields: WORD [ + Type set_Type[0..2], + NameType set_NameType[2..5], + Reserved set_Reserved[5..16], +]} +ENUM!{enum IMPORT_OBJECT_TYPE { + IMPORT_OBJECT_CODE = 0, + IMPORT_OBJECT_DATA = 1, + IMPORT_OBJECT_CONST = 2, +}} +ENUM!{enum IMPORT_OBJECT_NAME_TYPE { + IMPORT_OBJECT_ORDINAL = 0, + IMPORT_OBJECT_NAME = 1, + IMPORT_OBJECT_NAME_NO_PREFIX = 2, + IMPORT_OBJECT_NAME_UNDECORATE = 3, + IMPORT_OBJECT_NAME_EXPORTAS = 4, +}} +ENUM!{enum ReplacesCorHdrNumericDefines { + COMIMAGE_FLAGS_ILONLY = 0x00000001, + COMIMAGE_FLAGS_32BITREQUIRED = 0x00000002, + COMIMAGE_FLAGS_IL_LIBRARY = 0x00000004, + COMIMAGE_FLAGS_STRONGNAMESIGNED = 0x00000008, + COMIMAGE_FLAGS_NATIVE_ENTRYPOINT = 0x00000010, + COMIMAGE_FLAGS_TRACKDEBUGDATA = 0x00010000, + COMIMAGE_FLAGS_32BITPREFERRED = 0x00020000, + COR_VERSION_MAJOR_V2 = 2, + COR_VERSION_MAJOR = COR_VERSION_MAJOR_V2, + COR_VERSION_MINOR = 5, + COR_DELETED_NAME_LENGTH = 8, + COR_VTABLEGAP_NAME_LENGTH = 8, + NATIVE_TYPE_MAX_CB = 1, + COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE= 0xFF, + IMAGE_COR_MIH_METHODRVA = 0x01, + IMAGE_COR_MIH_EHRVA = 0x02, + IMAGE_COR_MIH_BASICBLOCK = 0x08, + COR_VTABLE_32BIT = 0x01, + COR_VTABLE_64BIT = 0x02, + COR_VTABLE_FROM_UNMANAGED = 0x04, + COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN = 0x08, + COR_VTABLE_CALL_MOST_DERIVED = 0x10, + IMAGE_COR_EATJ_THUNK_SIZE = 32, + MAX_CLASS_NAME = 1024, + MAX_PACKAGE_NAME = 1024, +}} +UNION!{union IMAGE_COR20_HEADER_u { + [u32; 1], + EntryPointToken EntryPointToken_mut: DWORD, + EntryPointRVA EntryPointRVA_mut: DWORD, +}} +STRUCT!{struct IMAGE_COR20_HEADER { + cb: DWORD, + MajorRuntimeVersion: WORD, + MinorRuntimeVersion: WORD, + MetaData: IMAGE_DATA_DIRECTORY, + Flags: DWORD, + u: IMAGE_COR20_HEADER_u, + Resources: IMAGE_DATA_DIRECTORY, + StrongNameSignature: IMAGE_DATA_DIRECTORY, + CodeManagerTable: IMAGE_DATA_DIRECTORY, + VTableFixups: IMAGE_DATA_DIRECTORY, + ExportAddressTableJumps: IMAGE_DATA_DIRECTORY, + ManagedNativeHeader: IMAGE_DATA_DIRECTORY, +}} +pub type PIMAGE_COR20_HEADER = *mut IMAGE_COR20_HEADER; +extern "system" { + pub fn RtlCaptureStackBackTrace( + FramesToSkip: DWORD, + FramesToCapture: DWORD, + BackTrace: *mut PVOID, + BackTraceHash: PDWORD, + ) -> WORD; + pub fn RtlCaptureContext( + ContextRecord: PCONTEXT, + ); + pub fn RtlUnwind( + TargetFrame: PVOID, + TargetIp: PVOID, + ExceptionRecord: PEXCEPTION_RECORD, + ReturnValue: PVOID, + ); +} +#[cfg(target_pointer_width = "64")] +extern "system" { + pub fn RtlAddFunctionTable( + FunctionTable: PRUNTIME_FUNCTION, + EntryCount: DWORD, + BaseAddress: DWORD64, + ) -> BOOLEAN; + pub fn RtlDeleteFunctionTable( + FunctionTable: PRUNTIME_FUNCTION, + ) -> BOOLEAN; + pub fn RtlInstallFunctionTableCallback( + TableIdentifier: DWORD64, + BaseAddress: DWORD64, + Length: DWORD, + Callback: PGET_RUNTIME_FUNCTION_CALLBACK, + Context: PVOID, + OutOfProcessCallbackDll: PCWSTR, + ) -> BOOLEAN; + pub fn RtlAddGrowableFunctionTable( + DynamicTable: *mut PVOID, + FunctionTable: PRUNTIME_FUNCTION, + EntryCount: DWORD, + MaximumEntryCount: DWORD, + RangeBase: ULONG_PTR, + RangeEnd: ULONG_PTR, + ) -> DWORD; + pub fn RtlGrowFunctionTable( + DynamicTable: PVOID, + NewEntryCount: DWORD, + ); + pub fn RtlDeleteGrowableFunctionTable( + DynamicTable: PVOID, + ); + pub fn RtlLookupFunctionEntry( + ControlPc: DWORD64, + ImageBase: PDWORD64, + HistoryTable: PUNWIND_HISTORY_TABLE, + ) -> PRUNTIME_FUNCTION; +} +#[cfg(target_arch = "x86_64")] +IFDEF!{ +extern "C" { + pub fn RtlRestoreContext( + ContextRecord: PCONTEXT, + ExceptionRecord: *mut EXCEPTION_RECORD, + ); +} +extern "system" { + pub fn RtlUnwindEx( + TargetFrame: PVOID, + TargetIp: PVOID, + ExceptionRecord: PEXCEPTION_RECORD, + ReturnValue: PVOID, + ContextRecord: PCONTEXT, + HistoryTable: PUNWIND_HISTORY_TABLE, + ); + pub fn RtlVirtualUnwind( + HandlerType: DWORD, + ImageBase: DWORD64, + ControlPc: DWORD64, + FunctionEntry: PRUNTIME_FUNCTION, + ContextRecord: PCONTEXT, + HandlerData: *mut PVOID, + EstablisherFrame: PDWORD64, + ContextPointers: PKNONVOLATILE_CONTEXT_POINTERS, + ) -> PEXCEPTION_ROUTINE; +} +} +extern "system" { + pub fn RtlPcToFileHeader( + PcValue: PVOID, + BaseOfImage: *mut PVOID, + ) -> PVOID; + pub fn RtlCompareMemory( + Source1: *const VOID, + Source2: *const VOID, + Length: SIZE_T, + ) -> SIZE_T; +} +STRUCT!{struct SLIST_ENTRY { + Next: *mut SLIST_ENTRY, +}} +pub type PSLIST_ENTRY = *mut SLIST_ENTRY; +#[cfg(target_pointer_width = "64")] +IFDEF!{ +STRUCT!{struct SLIST_HEADER_s { + Alignment: ULONGLONG, + Region: ULONGLONG, +}} +STRUCT!{struct SLIST_HEADER_HeaderX64 { + BitFields1: ULONGLONG, + BitFields2: ULONGLONG, +}} +BITFIELD!{SLIST_HEADER_HeaderX64 BitFields1: ULONGLONG [ + Depth set_Depth[0..16], + Sequence set_Sequence[16..64], +]} +BITFIELD!{SLIST_HEADER_HeaderX64 BitFields2: ULONGLONG [ + Reserved set_Reserved[0..4], + NextEntry set_NextEntry[4..64], +]} +UNION!{union SLIST_HEADER { + [u64; 2], + s s_mut: SLIST_HEADER_s, + HeaderX64 HeaderX64_mut: SLIST_HEADER_HeaderX64, +}} +pub type PSLIST_HEADER = *mut SLIST_HEADER; +} +#[cfg(target_pointer_width = "32")] +IFDEF!{ +STRUCT!{struct SLIST_HEADER_s { + Next: SLIST_ENTRY, + Depth: WORD, + Reserved: WORD, +}} +UNION!{union SLIST_HEADER { + [u64; 1], + Alignment Alignment_mut: ULONGLONG, + s s_mut: SLIST_HEADER_s, +}} +pub type PSLIST_HEADER = *mut SLIST_HEADER; +} +extern "system" { + pub fn RtlInitializeSListHead( + ListHead: PSLIST_HEADER, + ); + pub fn RtlFirstEntrySList( + ListHead: *const SLIST_HEADER, + ) -> PSLIST_ENTRY; + pub fn RtlInterlockedPopEntrySList( + ListHead: PSLIST_HEADER, + ) -> PSLIST_ENTRY; + pub fn RtlInterlockedPushEntrySList( + ListHead: PSLIST_HEADER, + ListEntry: PSLIST_ENTRY, + ) -> PSLIST_ENTRY; + pub fn RtlInterlockedPushListSListEx( + ListHead: PSLIST_HEADER, + ListEntry: PSLIST_ENTRY, + ListEnd: PSLIST_ENTRY, + Count: DWORD, + ) -> PSLIST_ENTRY; + pub fn RtlInterlockedFlushSList( + ListHead: PSLIST_HEADER, + ) -> PSLIST_ENTRY; + pub fn RtlQueryDepthSList( + ListHead: PSLIST_HEADER, + ) -> WORD; +} +pub const RTL_RUN_ONCE_INIT: RTL_RUN_ONCE = RTL_RUN_ONCE { Ptr: 0 as PVOID }; +pub const RTL_RUN_ONCE_CHECK_ONLY: ULONG = 0x00000001; +pub const RTL_RUN_ONCE_ASYNC: ULONG = 0x00000002; +pub const RTL_RUN_ONCE_INIT_FAILED: ULONG = 0x00000004; +STRUCT!{struct RTL_RUN_ONCE { + Ptr: PVOID, +}} +pub type PRTL_RUN_ONCE = *mut RTL_RUN_ONCE; +STRUCT!{struct RTL_BARRIER { + Reserved1: DWORD, + Reserved2: DWORD, + Reserved3: [ULONG_PTR; 2], + Reserved4: DWORD, + Reserved5: DWORD, +}} +pub type PRTL_BARRIER = *mut RTL_BARRIER; +pub const FAST_FAIL_LEGACY_GS_VIOLATION: c_uint = 0; +pub const FAST_FAIL_VTGUARD_CHECK_FAILURE: c_uint = 1; +pub const FAST_FAIL_STACK_COOKIE_CHECK_FAILURE: c_uint = 2; +pub const FAST_FAIL_CORRUPT_LIST_ENTRY: c_uint = 3; +pub const FAST_FAIL_INCORRECT_STACK: c_uint = 4; +pub const FAST_FAIL_INVALID_ARG: c_uint = 5; +pub const FAST_FAIL_GS_COOKIE_INIT: c_uint = 6; +pub const FAST_FAIL_FATAL_APP_EXIT: c_uint = 7; +pub const FAST_FAIL_RANGE_CHECK_FAILURE: c_uint = 8; +pub const FAST_FAIL_UNSAFE_REGISTRY_ACCESS: c_uint = 9; +pub const FAST_FAIL_GUARD_ICALL_CHECK_FAILURE: c_uint = 10; +pub const FAST_FAIL_GUARD_WRITE_CHECK_FAILURE: c_uint = 11; +pub const FAST_FAIL_INVALID_FIBER_SWITCH: c_uint = 12; +pub const FAST_FAIL_INVALID_SET_OF_CONTEXT: c_uint = 13; +pub const FAST_FAIL_INVALID_REFERENCE_COUNT: c_uint = 14; +pub const FAST_FAIL_INVALID_JUMP_BUFFER: c_uint = 18; +pub const FAST_FAIL_MRDATA_MODIFIED: c_uint = 19; +pub const FAST_FAIL_CERTIFICATION_FAILURE: c_uint = 20; +pub const FAST_FAIL_INVALID_EXCEPTION_CHAIN: c_uint = 21; +pub const FAST_FAIL_CRYPTO_LIBRARY: c_uint = 22; +pub const FAST_FAIL_INVALID_CALL_IN_DLL_CALLOUT: c_uint = 23; +pub const FAST_FAIL_INVALID_IMAGE_BASE: c_uint = 24; +pub const FAST_FAIL_DLOAD_PROTECTION_FAILURE: c_uint = 25; +pub const FAST_FAIL_UNSAFE_EXTENSION_CALL: c_uint = 26; +pub const FAST_FAIL_DEPRECATED_SERVICE_INVOKED: c_uint = 27; +pub const FAST_FAIL_INVALID_BUFFER_ACCESS: c_uint = 28; +pub const FAST_FAIL_INVALID_BALANCED_TREE: c_uint = 29; +pub const FAST_FAIL_INVALID_NEXT_THREAD: c_uint = 30; +pub const FAST_FAIL_GUARD_ICALL_CHECK_SUPPRESSED: c_uint = 31; +pub const FAST_FAIL_APCS_DISABLED: c_uint = 32; +pub const FAST_FAIL_INVALID_IDLE_STATE: c_uint = 33; +pub const FAST_FAIL_MRDATA_PROTECTION_FAILURE: c_uint = 34; +pub const FAST_FAIL_UNEXPECTED_HEAP_EXCEPTION: c_uint = 35; +pub const FAST_FAIL_INVALID_LOCK_STATE: c_uint = 36; +pub const FAST_FAIL_GUARD_JUMPTABLE: c_uint = 37; +pub const FAST_FAIL_INVALID_LONGJUMP_TARGET: c_uint = 38; +pub const FAST_FAIL_INVALID_DISPATCH_CONTEXT: c_uint = 39; +pub const FAST_FAIL_INVALID_THREAD: c_uint = 40; +pub const FAST_FAIL_INVALID_SYSCALL_NUMBER: c_uint = 41; +pub const FAST_FAIL_INVALID_FILE_OPERATION: c_uint = 42; +pub const FAST_FAIL_LPAC_ACCESS_DENIED: c_uint = 43; +pub const FAST_FAIL_GUARD_SS_FAILURE: c_uint = 44; +pub const FAST_FAIL_LOADER_CONTINUITY_FAILURE: c_uint = 45; +pub const FAST_FAIL_GUARD_EXPORT_SUPPRESSION_FAILURE: c_uint = 46; +pub const FAST_FAIL_INVALID_CONTROL_STACK: c_uint = 47; +pub const FAST_FAIL_SET_CONTEXT_DENIED: c_uint = 48; +pub const FAST_FAIL_INVALID_FAST_FAIL_CODE: c_uint = 0xFFFFFFFF; +pub const HEAP_NO_SERIALIZE: DWORD = 0x00000001; +pub const HEAP_GROWABLE: DWORD = 0x00000002; +pub const HEAP_GENERATE_EXCEPTIONS: DWORD = 0x00000004; +pub const HEAP_ZERO_MEMORY: DWORD = 0x00000008; +pub const HEAP_REALLOC_IN_PLACE_ONLY: DWORD = 0x00000010; +pub const HEAP_TAIL_CHECKING_ENABLED: DWORD = 0x00000020; +pub const HEAP_FREE_CHECKING_ENABLED: DWORD = 0x00000040; +pub const HEAP_DISABLE_COALESCE_ON_FREE: DWORD = 0x00000080; +pub const HEAP_CREATE_ALIGN_16: DWORD = 0x00010000; +pub const HEAP_CREATE_ENABLE_TRACING: DWORD = 0x00020000; +pub const HEAP_CREATE_ENABLE_EXECUTE: DWORD = 0x00040000; +pub const HEAP_MAXIMUM_TAG: DWORD = 0x0FFF; +pub const HEAP_PSEUDO_TAG_FLAG: DWORD = 0x8000; +pub const HEAP_TAG_SHIFT: usize = 18; +pub const HEAP_CREATE_SEGMENT_HEAP: DWORD = 0x00000100; +pub const HEAP_CREATE_HARDENED: DWORD = 0x00000200; +#[inline] +pub fn HEAP_MAKE_TAG_FLAGS(TagBase: DWORD, Tag: DWORD) -> DWORD { + TagBase + (Tag << HEAP_TAG_SHIFT) +} +pub const IS_TEXT_UNICODE_ASCII16: INT = 0x0001; +pub const IS_TEXT_UNICODE_REVERSE_ASCII16: INT = 0x0010; +pub const IS_TEXT_UNICODE_STATISTICS: INT = 0x0002; +pub const IS_TEXT_UNICODE_REVERSE_STATISTICS: INT = 0x0020; +pub const IS_TEXT_UNICODE_CONTROLS: INT = 0x0004; +pub const IS_TEXT_UNICODE_REVERSE_CONTROLS: INT = 0x0040; +pub const IS_TEXT_UNICODE_SIGNATURE: INT = 0x0008; +pub const IS_TEXT_UNICODE_REVERSE_SIGNATURE: INT = 0x0080; +pub const IS_TEXT_UNICODE_ILLEGAL_CHARS: INT = 0x0100; +pub const IS_TEXT_UNICODE_ODD_LENGTH: INT = 0x0200; +pub const IS_TEXT_UNICODE_DBCS_LEADBYTE: INT = 0x0400; +pub const IS_TEXT_UNICODE_NULL_BYTES: INT = 0x1000; +pub const IS_TEXT_UNICODE_UNICODE_MASK: INT = 0x000F; +pub const IS_TEXT_UNICODE_REVERSE_MASK: INT = 0x00F0; +pub const IS_TEXT_UNICODE_NOT_UNICODE_MASK: INT = 0x0F00; +pub const IS_TEXT_UNICODE_NOT_ASCII_MASK: INT = 0xF000; +pub const COMPRESSION_FORMAT_NONE: USHORT = 0x0000; +pub const COMPRESSION_FORMAT_DEFAULT: USHORT = 0x0001; +pub const COMPRESSION_FORMAT_LZNT1: USHORT = 0x0002; +pub const COMPRESSION_FORMAT_XPRESS: USHORT = 0x0003; +pub const COMPRESSION_FORMAT_XPRESS_HUFF: USHORT = 0x0004; +pub const COMPRESSION_ENGINE_STANDARD: USHORT = 0x0000; +pub const COMPRESSION_ENGINE_MAXIMUM: USHORT = 0x0100; +pub const COMPRESSION_ENGINE_HIBER: USHORT = 0x0200; +// RtlEqualMemory +#[inline] +pub unsafe fn RtlMoveMemory(Destination: *mut c_void, Source: *const c_void, Length: usize) { + use core::ptr::copy; + copy(Source as *const u8, Destination as *mut u8, Length); +} +#[inline] +pub unsafe fn RtlCopyMemory(Destination: *mut c_void, Source: *const c_void, Length: usize) { + use core::ptr::copy_nonoverlapping; + copy_nonoverlapping(Source as *const u8, Destination as *mut u8, Length); +} +#[inline] +pub unsafe fn RtlFillMemory(Destination: *mut c_void, Length: usize, Fill: u8) { + use core::ptr::write_bytes; + write_bytes(Destination as *mut u8, Fill, Length); +} +#[inline] +pub unsafe fn RtlZeroMemory(Destination: *mut c_void, Length: usize) { + use core::ptr::write_bytes; + write_bytes(Destination as *mut u8, 0, Length); +} +pub const SEF_DACL_AUTO_INHERIT: ULONG = 0x01; +pub const SEF_SACL_AUTO_INHERIT: ULONG = 0x02; +pub const SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT: ULONG = 0x04; +pub const SEF_AVOID_PRIVILEGE_CHECK: ULONG = 0x08; +pub const SEF_AVOID_OWNER_CHECK: ULONG = 0x10; +pub const SEF_DEFAULT_OWNER_FROM_PARENT: ULONG = 0x20; +pub const SEF_DEFAULT_GROUP_FROM_PARENT: ULONG = 0x40; +pub const SEF_MACL_NO_WRITE_UP: ULONG = 0x100; +pub const SEF_MACL_NO_READ_UP: ULONG = 0x200; +pub const SEF_MACL_NO_EXECUTE_UP: ULONG = 0x400; +pub const SEF_AI_USE_EXTRA_PARAMS: ULONG = 0x800; +pub const SEF_AVOID_OWNER_RESTRICTION: ULONG = 0x1000; +pub const SEF_MACL_VALID_FLAGS: ULONG = SEF_MACL_NO_WRITE_UP | SEF_MACL_NO_READ_UP + | SEF_MACL_NO_EXECUTE_UP; +STRUCT!{struct MESSAGE_RESOURCE_ENTRY { + Length: WORD, + Flags: WORD, + Text: [BYTE; 1], +}} +pub type PMESSAGE_RESOURCE_ENTRY = *mut MESSAGE_RESOURCE_ENTRY; +pub const MESSAGE_RESOURCE_UNICODE: WORD = 0x0001; +STRUCT!{struct MESSAGE_RESOURCE_BLOCK { + LowId: DWORD, + HighId: DWORD, + OffsetToEntries: DWORD, +}} +pub type PMESSAGE_RESOURCE_BLOCK = *mut MESSAGE_RESOURCE_BLOCK; +STRUCT!{struct MESSAGE_RESOURCE_DATA { + NumberOfBlocks: DWORD, + Blocks: [MESSAGE_RESOURCE_BLOCK; 1], +}} +pub type PMESSAGE_RESOURCE_DATA = *mut MESSAGE_RESOURCE_DATA; +STRUCT!{struct OSVERSIONINFOA { + dwOSVersionInfoSize: DWORD, + dwMajorVersion: DWORD, + dwMinorVersion: DWORD, + dwBuildNumber: DWORD, + dwPlatformId: DWORD, + szCSDVersion: [CHAR; 128], +}} +pub type POSVERSIONINFOA = *mut OSVERSIONINFOA; +pub type LPOSVERSIONINFOA = *mut OSVERSIONINFOA; +STRUCT!{struct OSVERSIONINFOW { + dwOSVersionInfoSize: DWORD, + dwMajorVersion: DWORD, + dwMinorVersion: DWORD, + dwBuildNumber: DWORD, + dwPlatformId: DWORD, + szCSDVersion: [WCHAR; 128], +}} +pub type POSVERSIONINFOW = *mut OSVERSIONINFOW; +pub type LPOSVERSIONINFOW = *mut OSVERSIONINFOW; +pub type RTL_OSVERSIONINFOW = OSVERSIONINFOW; +pub type PRTL_OSVERSIONINFOW = *mut OSVERSIONINFOW; +STRUCT!{struct OSVERSIONINFOEXA { + dwOSVersionInfoSize: DWORD, + dwMajorVersion: DWORD, + dwMinorVersion: DWORD, + dwBuildNumber: DWORD, + dwPlatformId: DWORD, + szCSDVersion: [CHAR; 128], + wServicePackMajor: WORD, + wServicePackMinor: WORD, + wSuiteMask: WORD, + wProductType: BYTE, + wReserved: BYTE, +}} +pub type POSVERSIONINFOEXA = *mut OSVERSIONINFOEXA; +pub type LPOSVERSIONINFOEXA = *mut OSVERSIONINFOEXA; +STRUCT!{struct OSVERSIONINFOEXW { + dwOSVersionInfoSize: DWORD, + dwMajorVersion: DWORD, + dwMinorVersion: DWORD, + dwBuildNumber: DWORD, + dwPlatformId: DWORD, + szCSDVersion: [WCHAR; 128], + wServicePackMajor: WORD, + wServicePackMinor: WORD, + wSuiteMask: WORD, + wProductType: BYTE, + wReserved: BYTE, +}} +pub type POSVERSIONINFOEXW = *mut OSVERSIONINFOEXW; +pub type LPOSVERSIONINFOEXW = *mut OSVERSIONINFOEXW; +pub type RTL_OSVERSIONINFOEXW = OSVERSIONINFOEXW; +pub type PRTL_OSVERSIONINFOEXW = *mut OSVERSIONINFOEXW; +pub const VER_EQUAL: BYTE = 1; +pub const VER_GREATER: BYTE = 2; +pub const VER_GREATER_EQUAL: BYTE = 3; +pub const VER_LESS: BYTE = 4; +pub const VER_LESS_EQUAL: BYTE = 5; +pub const VER_AND: BYTE = 6; +pub const VER_OR: BYTE = 7; +pub const VER_CONDITION_MASK: BYTE = 7; +pub const VER_NUM_BITS_PER_CONDITION_MASK: BYTE = 3; +pub const VER_MINORVERSION: DWORD = 0x0000001; +pub const VER_MAJORVERSION: DWORD = 0x0000002; +pub const VER_BUILDNUMBER: DWORD = 0x0000004; +pub const VER_PLATFORMID: DWORD = 0x0000008; +pub const VER_SERVICEPACKMINOR: DWORD = 0x0000010; +pub const VER_SERVICEPACKMAJOR: DWORD = 0x0000020; +pub const VER_SUITENAME: DWORD = 0x0000040; +pub const VER_PRODUCT_TYPE: DWORD = 0x0000080; +pub const VER_NT_WORKSTATION: BYTE = 0x0000001; +pub const VER_NT_DOMAIN_CONTROLLER: BYTE = 0x0000002; +pub const VER_NT_SERVER: BYTE = 0x0000003; +pub const VER_PLATFORM_WIN32s: DWORD = 0; +pub const VER_PLATFORM_WIN32_WINDOWS: DWORD = 1; +pub const VER_PLATFORM_WIN32_NT: DWORD = 2; +extern "system" { + pub fn VerSetConditionMask( + ConditionMask: ULONGLONG, + TypeMask: DWORD, + Condition: BYTE, + ) -> ULONGLONG; + pub fn RtlGetProductInfo( + OSMajorVersion: DWORD, + OSMinorVersion: DWORD, + SpMajorVersion: DWORD, + SpMinorVersion: DWORD, + ReturnedProductType: PDWORD, + ) -> BOOLEAN; +} +pub const RTL_UMS_VERSION: DWORD = 0x100; +ENUM!{enum RTL_UMS_THREAD_INFO_CLASS { + UmsThreadInvalidInfoClass = 0, + UmsThreadUserContext, + UmsThreadPriority, + UmsThreadAffinity, + UmsThreadTeb, + UmsThreadIsSuspended, + UmsThreadIsTerminated, + UmsThreadMaxInfoClass, +}} +ENUM!{enum RTL_UMS_SCHEDULER_REASON { + UmsSchedulerStartup = 0, + UmsSchedulerThreadBlocked, + UmsSchedulerThreadYield, +}} +FN!{stdcall PRTL_UMS_SCHEDULER_ENTRY_POINT( + Reason: RTL_UMS_SCHEDULER_REASON, + ActivationPayload: ULONG_PTR, + SchedulerParam: PVOID, +) -> ()} +#[inline] +pub fn IS_VALIDATION_ENABLED(C: DWORD, L: DWORD) -> bool { + (L & C) != 0 +} +pub const VRL_PREDEFINED_CLASS_BEGIN: DWORD = 1 << 0; +pub const VRL_CUSTOM_CLASS_BEGIN: DWORD = 1 << 8; +pub const VRL_CLASS_CONSISTENCY: DWORD = VRL_CUSTOM_CLASS_BEGIN << 8; +pub const VRL_ENABLE_KERNEL_BREAKS: DWORD = 1 << 31; +pub const CTMF_INCLUDE_APPCONTAINER: ULONG = 0x00000001; +pub const CTMF_INCLUDE_LPAC: ULONG = 0x00000002; +pub const CTMF_VALID_FLAGS: ULONG = CTMF_INCLUDE_APPCONTAINER | CTMF_INCLUDE_LPAC; +extern "system" { + pub fn RtlCrc32( + Buffer: *const c_void, + Size: size_t, + InitialCrc: DWORD, + ) -> DWORD; + pub fn RtlCrc64( + Buffer: *const c_void, + Size: size_t, + InitialCrc: ULONGLONG, + ) -> ULONGLONG; +} +ENUM!{enum OS_DEPLOYEMENT_STATE_VALUES { + OS_DEPLOYMENT_STANDARD = 1, + OS_DEPLOYMENT_COMPACT, +}} +extern "system" { + pub fn RtlOsDeploymentState( + Flags: DWORD, + ) -> OS_DEPLOYEMENT_STATE_VALUES; +} +#[cfg(target_arch = "x86_64")] +IFDEF!{ +STRUCT!{struct NV_MEMORY_RANGE { + BaseAddress: *mut VOID, + Length: SIZE_T, +}} +pub type PNV_MEMORY_RANGE = *mut NV_MEMORY_RANGE; +pub const FLUSH_NV_MEMORY_IN_FLAG_NO_DRAIN: ULONG = 0x00000001; +pub const FLUSH_NV_MEMORY_DEFAULT_TOKEN: ULONG_PTR = -1isize as usize; +} +STRUCT!{struct RTL_CRITICAL_SECTION_DEBUG { + Type: WORD, + CreatorBackTraceIndex: WORD, + CriticalSection: *mut RTL_CRITICAL_SECTION, + ProcessLocksList: LIST_ENTRY, + EntryCount: DWORD, + ContentionCount: DWORD, + Flags: DWORD, + CreatorBackTraceIndexHigh: WORD, + SpareWORD: WORD, +}} +pub type PRTL_CRITICAL_SECTION_DEBUG = *mut RTL_CRITICAL_SECTION_DEBUG; +pub type RTL_RESOURCE_DEBUG = RTL_CRITICAL_SECTION_DEBUG; +pub type PRTL_RESOURCE_DEBUG = *mut RTL_CRITICAL_SECTION_DEBUG; +pub const RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO: ULONG_PTR = 0x01000000; +pub const RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN: ULONG_PTR = 0x02000000; +pub const RTL_CRITICAL_SECTION_FLAG_STATIC_INIT: ULONG_PTR = 0x04000000; +pub const RTL_CRITICAL_SECTION_FLAG_RESOURCE_TYPE: ULONG_PTR = 0x08000000; +pub const RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO: ULONG_PTR = 0x10000000; +pub const RTL_CRITICAL_SECTION_ALL_FLAG_BITS: ULONG_PTR = 0xFF000000; +pub const RTL_CRITICAL_SECTION_FLAG_RESERVED: ULONG_PTR = RTL_CRITICAL_SECTION_ALL_FLAG_BITS + & !(RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO | RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN + | RTL_CRITICAL_SECTION_FLAG_STATIC_INIT | RTL_CRITICAL_SECTION_FLAG_RESOURCE_TYPE + | RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO); +pub const RTL_CRITICAL_SECTION_DEBUG_FLAG_STATIC_INIT: DWORD = 0x00000001; +STRUCT!{struct RTL_CRITICAL_SECTION { + DebugInfo: PRTL_CRITICAL_SECTION_DEBUG, + LockCount: LONG, + RecursionCount: LONG, + OwningThread: HANDLE, + LockSemaphore: HANDLE, + SpinCount: ULONG_PTR, +}} +pub type PRTL_CRITICAL_SECTION = *mut RTL_CRITICAL_SECTION; +STRUCT!{struct RTL_SRWLOCK { + Ptr: PVOID, +}} +pub type PRTL_SRWLOCK = *mut RTL_SRWLOCK; +pub const RTL_SRWLOCK_INIT: RTL_SRWLOCK = RTL_SRWLOCK { Ptr: 0 as PVOID }; +STRUCT!{struct RTL_CONDITION_VARIABLE { + Ptr: PVOID, +}} +pub type PRTL_CONDITION_VARIABLE = *mut RTL_CONDITION_VARIABLE; +pub const RTL_CONDITION_VARIABLE_INIT: RTL_CONDITION_VARIABLE = RTL_CONDITION_VARIABLE { + Ptr: 0 as PVOID, +}; +pub const RTL_CONDITION_VARIABLE_LOCKMODE_SHARED: DWORD = 0x1; +FN!{stdcall PAPCFUNC( + Parameter: ULONG_PTR, +) -> ()} +FN!{stdcall PVECTORED_EXCEPTION_HANDLER( + ExceptionInfo: *mut EXCEPTION_POINTERS, +) -> LONG} +ENUM!{enum HEAP_INFORMATION_CLASS { + HeapCompatibilityInformation = 0, + HeapEnableTerminationOnCorruption = 1, + HeapOptimizeResources = 3, +}} +pub const HEAP_OPTIMIZE_RESOURCES_CURRENT_VERSION: DWORD = 1; +STRUCT!{struct HEAP_OPTIMIZE_RESOURCES_INFORMATION { + Version: DWORD, + Flags: DWORD, +}} +pub type PHEAP_OPTIMIZE_RESOURCES_INFORMATION = *mut HEAP_OPTIMIZE_RESOURCES_INFORMATION; +pub const WT_EXECUTEDEFAULT: ULONG = 0x00000000; +pub const WT_EXECUTEINIOTHREAD: ULONG = 0x00000001; +pub const WT_EXECUTEINUITHREAD: ULONG = 0x00000002; +pub const WT_EXECUTEINWAITTHREAD: ULONG = 0x00000004; +pub const WT_EXECUTEONLYONCE: ULONG = 0x00000008; +pub const WT_EXECUTEINTIMERTHREAD: ULONG = 0x00000020; +pub const WT_EXECUTELONGFUNCTION: ULONG = 0x00000010; +pub const WT_EXECUTEINPERSISTENTIOTHREAD: ULONG = 0x00000040; +pub const WT_EXECUTEINPERSISTENTTHREAD: ULONG = 0x00000080; +pub const WT_TRANSFER_IMPERSONATION: ULONG = 0x00000100; +#[inline] +pub fn WT_SET_MAX_THREADPOOL_THREADS(Flags: ULONG, Limit: ULONG) -> ULONG { + Flags | (Limit << 16) +} +FN!{stdcall WAITORTIMERCALLBACKFUNC( + PVOID, + BOOLEAN, +) -> ()} +FN!{stdcall WORKERCALLBACKFUNC( + PVOID, +) -> ()} +FN!{stdcall APC_CALLBACK_FUNCTION( + DWORD, + PVOID, + PVOID, +) -> ()} +pub type WAITORTIMERCALLBACK = WAITORTIMERCALLBACKFUNC; +FN!{stdcall PFLS_CALLBACK_FUNCTION( + lpFlsData: PVOID, +) -> ()} +FN!{stdcall PSECURE_MEMORY_CACHE_CALLBACK( + Addr: PVOID, + Range: SIZE_T, +) -> BOOLEAN} +pub const WT_EXECUTEINLONGTHREAD: ULONG = 0x00000010; +pub const WT_EXECUTEDELETEWAIT: ULONG = 0x00000008; +ENUM!{enum ACTIVATION_CONTEXT_INFO_CLASS { + ActivationContextBasicInformation = 1, + ActivationContextDetailedInformation = 2, + AssemblyDetailedInformationInActivationContext = 3, + FileInformationInAssemblyOfAssemblyInActivationContext = 4, + RunlevelInformationInActivationContext = 5, + CompatibilityInformationInActivationContext = 6, + ActivationContextManifestResourceName = 7, + MaxActivationContextInfoClass, + AssemblyDetailedInformationInActivationContxt = 3, + FileInformationInAssemblyOfAssemblyInActivationContxt = 4, +}} +pub type ACTIVATIONCONTEXTINFOCLASS = ACTIVATION_CONTEXT_INFO_CLASS; +STRUCT!{struct ACTIVATION_CONTEXT_QUERY_INDEX { + ulAssemblyIndex: DWORD, + ulFileIndexInAssembly: DWORD, +}} +pub type PACTIVATION_CONTEXT_QUERY_INDEX = *mut ACTIVATION_CONTEXT_QUERY_INDEX; +pub type PCACTIVATION_CONTEXT_QUERY_INDEX = *const ACTIVATION_CONTEXT_QUERY_INDEX; +pub const ACTIVATION_CONTEXT_PATH_TYPE_NONE: DWORD = 1; +pub const ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE: DWORD = 2; +pub const ACTIVATION_CONTEXT_PATH_TYPE_URL: DWORD = 3; +pub const ACTIVATION_CONTEXT_PATH_TYPE_ASSEMBLYREF: DWORD = 4; +STRUCT!{struct ASSEMBLY_FILE_DETAILED_INFORMATION { + ulFlags: DWORD, + ulFilenameLength: DWORD, + ulPathLength: DWORD, + lpFileName: PCWSTR, + lpFilePath: PCWSTR, +}} +pub type PASSEMBLY_FILE_DETAILED_INFORMATION = *mut ASSEMBLY_FILE_DETAILED_INFORMATION; +pub type PCASSEMBLY_FILE_DETAILED_INFORMATION = *const ASSEMBLY_FILE_DETAILED_INFORMATION; +pub type ASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = ASSEMBLY_FILE_DETAILED_INFORMATION; +pub type PASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = PASSEMBLY_FILE_DETAILED_INFORMATION; +pub type PCASSEMBLY_DLL_REDIRECTION_DETAILED_INFORMATION = PCASSEMBLY_FILE_DETAILED_INFORMATION; +STRUCT!{struct ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION { + ulFlags: DWORD, + ulEncodedAssemblyIdentityLength: DWORD, + ulManifestPathType: DWORD, + ulManifestPathLength: DWORD, + liManifestLastWriteTime: LARGE_INTEGER, + ulPolicyPathType: DWORD, + ulPolicyPathLength: DWORD, + liPolicyLastWriteTime: LARGE_INTEGER, + ulMetadataSatelliteRosterIndex: DWORD, + ulManifestVersionMajor: DWORD, + ulManifestVersionMinor: DWORD, + ulPolicyVersionMajor: DWORD, + ulPolicyVersionMinor: DWORD, + ulAssemblyDirectoryNameLength: DWORD, + lpAssemblyEncodedAssemblyIdentity: PCWSTR, + lpAssemblyManifestPath: PCWSTR, + lpAssemblyPolicyPath: PCWSTR, + lpAssemblyDirectoryName: PCWSTR, + ulFileCount: DWORD, +}} +pub type PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION + = *mut ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION; +pub type PCACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION + = *const ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION; +ENUM!{enum ACTCTX_REQUESTED_RUN_LEVEL { + ACTCTX_RUN_LEVEL_UNSPECIFIED = 0, + ACTCTX_RUN_LEVEL_AS_INVOKER, + ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE, + ACTCTX_RUN_LEVEL_REQUIRE_ADMIN, + ACTCTX_RUN_LEVEL_NUMBERS, +}} +STRUCT!{struct ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION { + ulFlags: DWORD, + RunLevel: ACTCTX_REQUESTED_RUN_LEVEL, + UiAccess: DWORD, +}} +pub type PACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION = *mut ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION; +pub type PCACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION + = *const ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION; +ENUM!{enum ACTCTX_COMPATIBILITY_ELEMENT_TYPE { + ACTCTX_COMPATIBILITY_ELEMENT_TYPE_UNKNOWN = 0, + ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS, + ACTCTX_COMPATIBILITY_ELEMENT_TYPE_MITIGATION, +}} +STRUCT!{struct COMPATIBILITY_CONTEXT_ELEMENT { + Id: GUID, + Type: ACTCTX_COMPATIBILITY_ELEMENT_TYPE, +}} +pub type PCOMPATIBILITY_CONTEXT_ELEMENT = *mut COMPATIBILITY_CONTEXT_ELEMENT; +pub type PCCOMPATIBILITY_CONTEXT_ELEMENT = *const COMPATIBILITY_CONTEXT_ELEMENT; +STRUCT!{struct ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION { + ElementCount: DWORD, + Elements: [COMPATIBILITY_CONTEXT_ELEMENT; 0], +}} +pub type PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION + = *mut ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION; +pub type PCACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION + = *const ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION; +STRUCT!{struct SUPPORTED_OS_INFO { + MajorVersion: WORD, + MinorVersion: WORD, +}} +pub type PSUPPORTED_OS_INFO = *mut SUPPORTED_OS_INFO; +STRUCT!{struct ACTIVATION_CONTEXT_DETAILED_INFORMATION { + dwFlags: DWORD, + ulFormatVersion: DWORD, + ulAssemblyCount: DWORD, + ulRootManifestPathType: DWORD, + ulRootManifestPathChars: DWORD, + ulRootConfigurationPathType: DWORD, + ulRootConfigurationPathChars: DWORD, + ulAppDirPathType: DWORD, + ulAppDirPathChars: DWORD, + lpRootManifestPath: PCWSTR, + lpRootConfigurationPath: PCWSTR, + lpAppDirPath: PCWSTR, +}} +pub type PACTIVATION_CONTEXT_DETAILED_INFORMATION = *mut ACTIVATION_CONTEXT_DETAILED_INFORMATION; +pub type PCACTIVATION_CONTEXT_DETAILED_INFORMATION + = *const ACTIVATION_CONTEXT_DETAILED_INFORMATION; +pub const CREATE_BOUNDARY_DESCRIPTOR_ADD_APPCONTAINER_SID: DWORD = 0x1; +STRUCT!{struct HARDWARE_COUNTER_DATA { + Type: HARDWARE_COUNTER_TYPE, + Reserved: DWORD, + Value: DWORD64, +}} +pub type PHARDWARE_COUNTER_DATA = *mut HARDWARE_COUNTER_DATA; +pub const PERFORMANCE_DATA_VERSION: BYTE = 1; +STRUCT!{struct PERFORMANCE_DATA { + Size: WORD, + Version: BYTE, + HwCountersCount: BYTE, + ContextSwitchCount: DWORD, + WaitReasonBitMap: DWORD64, + CycleTime: DWORD64, + RetryCount: DWORD, + Reserved: DWORD, + HwCounters: [HARDWARE_COUNTER_DATA; MAX_HW_COUNTERS], +}} +pub type PPERFORMANCE_DATA = *mut PERFORMANCE_DATA; +pub const READ_THREAD_PROFILING_FLAG_DISPATCHING: DWORD = 0x00000001; +pub const READ_THREAD_PROFILING_FLAG_HARDWARE_COUNTERS: DWORD = 0x00000002; +pub const UNIFIEDBUILDREVISION_KEY: &'static str + = "\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion"; +pub const UNIFIEDBUILDREVISION_VALUE: &'static str = "UBR"; +pub const UNIFIEDBUILDREVISION_MIN: DWORD = 0x00000000; +pub const DEVICEFAMILYDEVICEFORM_KEY: &'static str + = "\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\OEM"; +pub const DEVICEFAMILYDEVICEFORM_VALUE: &'static str = "DeviceForm"; +pub const DEVICEFAMILYINFOENUM_UAP: DWORD = 0x00000000; +pub const DEVICEFAMILYINFOENUM_WINDOWS_8X: DWORD = 0x00000001; +pub const DEVICEFAMILYINFOENUM_WINDOWS_PHONE_8X: DWORD = 0x00000002; +pub const DEVICEFAMILYINFOENUM_DESKTOP: DWORD = 0x00000003; +pub const DEVICEFAMILYINFOENUM_MOBILE: DWORD = 0x00000004; +pub const DEVICEFAMILYINFOENUM_XBOX: DWORD = 0x00000005; +pub const DEVICEFAMILYINFOENUM_TEAM: DWORD = 0x00000006; +pub const DEVICEFAMILYINFOENUM_IOT: DWORD = 0x00000007; +pub const DEVICEFAMILYINFOENUM_IOT_HEADLESS: DWORD = 0x00000008; +pub const DEVICEFAMILYINFOENUM_SERVER: DWORD = 0x00000009; +pub const DEVICEFAMILYINFOENUM_HOLOGRAPHIC: DWORD = 0x0000000A; +pub const DEVICEFAMILYINFOENUM_XBOXSRA: DWORD = 0x0000000B; +pub const DEVICEFAMILYINFOENUM_XBOXERA: DWORD = 0x0000000C; +pub const DEVICEFAMILYINFOENUM_SERVER_NANO: DWORD = 0x0000000D; +pub const DEVICEFAMILYINFOENUM_MAX: DWORD = 0x0000000D; +pub const DEVICEFAMILYDEVICEFORM_UNKNOWN: DWORD = 0x00000000; +pub const DEVICEFAMILYDEVICEFORM_PHONE: DWORD = 0x00000001; +pub const DEVICEFAMILYDEVICEFORM_TABLET: DWORD = 0x00000002; +pub const DEVICEFAMILYDEVICEFORM_DESKTOP: DWORD = 0x00000003; +pub const DEVICEFAMILYDEVICEFORM_NOTEBOOK: DWORD = 0x00000004; +pub const DEVICEFAMILYDEVICEFORM_CONVERTIBLE: DWORD = 0x00000005; +pub const DEVICEFAMILYDEVICEFORM_DETACHABLE: DWORD = 0x00000006; +pub const DEVICEFAMILYDEVICEFORM_ALLINONE: DWORD = 0x00000007; +pub const DEVICEFAMILYDEVICEFORM_STICKPC: DWORD = 0x00000008; +pub const DEVICEFAMILYDEVICEFORM_PUCK: DWORD = 0x00000009; +pub const DEVICEFAMILYDEVICEFORM_LARGESCREEN: DWORD = 0x0000000A; +pub const DEVICEFAMILYDEVICEFORM_HMD: DWORD = 0x0000000B; +pub const DEVICEFAMILYDEVICEFORM_INDUSTRY_HANDHELD: DWORD = 0x0000000C; +pub const DEVICEFAMILYDEVICEFORM_INDUSTRY_TABLET: DWORD = 0x0000000D; +pub const DEVICEFAMILYDEVICEFORM_BANKING: DWORD = 0x0000000E; +pub const DEVICEFAMILYDEVICEFORM_BUILDING_AUTOMATION: DWORD = 0x0000000F; +pub const DEVICEFAMILYDEVICEFORM_DIGITAL_SIGNAGE: DWORD = 0x00000010; +pub const DEVICEFAMILYDEVICEFORM_GAMING: DWORD = 0x00000011; +pub const DEVICEFAMILYDEVICEFORM_HOME_AUTOMATION: DWORD = 0x00000012; +pub const DEVICEFAMILYDEVICEFORM_INDUSTRIAL_AUTOMATION: DWORD = 0x00000013; +pub const DEVICEFAMILYDEVICEFORM_KIOSK: DWORD = 0x00000014; +pub const DEVICEFAMILYDEVICEFORM_MAKER_BOARD: DWORD = 0x00000015; +pub const DEVICEFAMILYDEVICEFORM_MEDICAL: DWORD = 0x00000016; +pub const DEVICEFAMILYDEVICEFORM_NETWORKING: DWORD = 0x00000017; +pub const DEVICEFAMILYDEVICEFORM_POINT_OF_SERVICE: DWORD = 0x00000018; +pub const DEVICEFAMILYDEVICEFORM_PRINTING: DWORD = 0x00000019; +pub const DEVICEFAMILYDEVICEFORM_THIN_CLIENT: DWORD = 0x0000001A; +pub const DEVICEFAMILYDEVICEFORM_TOY: DWORD = 0x0000001B; +pub const DEVICEFAMILYDEVICEFORM_VENDING: DWORD = 0x0000001C; +pub const DEVICEFAMILYDEVICEFORM_INDUSTRY_OTHER: DWORD = 0x0000001D; +pub const DEVICEFAMILYDEVICEFORM_MAX: DWORD = 0x0000001D; +extern "system" { + pub fn RtlGetDeviceFamilyInfoEnum( + pullUAPInfo: *mut ULONGLONG, + pulDeviceFamily: *mut DWORD, + pulDeviceForm: *mut DWORD, + ); + pub fn RtlConvertDeviceFamilyInfoToString( + pulDeviceFamilyBufferSize: PDWORD, + pulDeviceFormBufferSize: PDWORD, + DeviceFamily: PWSTR, + DeviceForm: PWSTR, + ) -> DWORD; + pub fn RtlSwitchedVVI( + VersionInfo: PRTL_OSVERSIONINFOEXW, + TypeMask: DWORD, + ConditionMask: ULONGLONG, + ) -> DWORD; +} +pub const DLL_PROCESS_ATTACH: DWORD = 1; +pub const DLL_THREAD_ATTACH: DWORD = 2; +pub const DLL_THREAD_DETACH: DWORD = 3; +pub const DLL_PROCESS_DETACH: DWORD = 0; +pub const EVENTLOG_SEQUENTIAL_READ: DWORD = 0x0001; +pub const EVENTLOG_SEEK_READ: DWORD = 0x0002; +pub const EVENTLOG_FORWARDS_READ: DWORD = 0x0004; +pub const EVENTLOG_BACKWARDS_READ: DWORD = 0x0008; +pub const EVENTLOG_SUCCESS: WORD = 0x0000; +pub const EVENTLOG_ERROR_TYPE: WORD = 0x0001; +pub const EVENTLOG_WARNING_TYPE: WORD = 0x0002; +pub const EVENTLOG_INFORMATION_TYPE: WORD = 0x0004; +pub const EVENTLOG_AUDIT_SUCCESS: WORD = 0x0008; +pub const EVENTLOG_AUDIT_FAILURE: WORD = 0x0010; +pub const EVENTLOG_START_PAIRED_EVENT: WORD = 0x0001; +pub const EVENTLOG_END_PAIRED_EVENT: WORD = 0x0002; +pub const EVENTLOG_END_ALL_PAIRED_EVENTS: WORD = 0x0004; +pub const EVENTLOG_PAIRED_EVENT_ACTIVE: WORD = 0x0008; +pub const EVENTLOG_PAIRED_EVENT_INACTIVE: WORD = 0x0010; +STRUCT!{struct EVENTLOGRECORD { + Length: DWORD, + Reserved: DWORD, + RecordNumber: DWORD, + TimeGenerated: DWORD, + TimeWritten: DWORD, + EventID: DWORD, + EventType: WORD, + NumStrings: WORD, + EventCategory: WORD, + ReservedFlags: WORD, + ClosingRecordNumber: DWORD, + StringOffset: DWORD, + UserSidLength: DWORD, + UserSidOffset: DWORD, + DataLength: DWORD, + DataOffset: DWORD, +}} +pub type PEVENTLOGRECORD = *mut EVENTLOGRECORD; +pub const MAXLOGICALLOGNAMESIZE: usize = 256; +pub type PEVENTSFORLOGFILE = *mut EVENTSFORLOGFILE; +pub type PPACKEDEVENTINFO = *mut PACKEDEVENTINFO; +STRUCT!{struct EVENTSFORLOGFILE { + ulSize: DWORD, + szLogicalLogFile: [WCHAR; MAXLOGICALLOGNAMESIZE], + ulNumRecords: DWORD, + pEventLogRecords: [EVENTLOGRECORD; 0], +}} +STRUCT!{struct PACKEDEVENTINFO { + ulSize: DWORD, + ulNumEventsForLogFile: DWORD, + ulOffsets: [DWORD; 0], +}} +pub const KEY_QUERY_VALUE: u32 = 0x0001; +pub const KEY_SET_VALUE: u32 = 0x0002; +pub const KEY_CREATE_SUB_KEY: u32 = 0x0004; +pub const KEY_ENUMERATE_SUB_KEYS: u32 = 0x0008; +pub const KEY_NOTIFY: u32 = 0x0010; +pub const KEY_CREATE_LINK: u32 = 0x0020; +pub const KEY_WOW64_32KEY: u32 = 0x0200; +pub const KEY_WOW64_64KEY: u32 = 0x0100; +pub const KEY_WOW64_RES: u32 = 0x0300; +pub const KEY_READ: u32 = (STANDARD_RIGHTS_READ | KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS + | KEY_NOTIFY) & !SYNCHRONIZE; +pub const KEY_WRITE: u32 = (STANDARD_RIGHTS_WRITE | KEY_SET_VALUE | KEY_CREATE_SUB_KEY) + & !SYNCHRONIZE; +pub const KEY_EXECUTE: u32 = KEY_READ & !SYNCHRONIZE; +pub const KEY_ALL_ACCESS: u32 = (STANDARD_RIGHTS_ALL | KEY_QUERY_VALUE | KEY_SET_VALUE + | KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY | KEY_CREATE_LINK) & !SYNCHRONIZE; +pub const REG_OPTION_RESERVED: DWORD = 0x00000000; +pub const REG_OPTION_NON_VOLATILE: DWORD = 0x00000000; +pub const REG_OPTION_VOLATILE: DWORD = 0x00000001; +pub const REG_OPTION_CREATE_LINK: DWORD = 0x00000002; +pub const REG_OPTION_BACKUP_RESTORE: DWORD = 0x00000004; +pub const REG_OPTION_OPEN_LINK: DWORD = 0x00000008; +pub const REG_OPTION_DONT_VIRTUALIZE: DWORD = 0x00000010; +pub const REG_LEGAL_OPTION: DWORD = REG_OPTION_RESERVED | REG_OPTION_NON_VOLATILE + | REG_OPTION_VOLATILE | REG_OPTION_CREATE_LINK | REG_OPTION_BACKUP_RESTORE + | REG_OPTION_OPEN_LINK | REG_OPTION_DONT_VIRTUALIZE; +pub const REG_OPEN_LEGAL_OPTION: DWORD = REG_OPTION_RESERVED | REG_OPTION_BACKUP_RESTORE + | REG_OPTION_OPEN_LINK | REG_OPTION_DONT_VIRTUALIZE; +pub const REG_CREATED_NEW_KEY: DWORD = 0x00000001; +pub const REG_OPENED_EXISTING_KEY: DWORD = 0x00000002; +pub const REG_STANDARD_FORMAT: DWORD = 1; +pub const REG_LATEST_FORMAT: DWORD = 2; +pub const REG_NO_COMPRESSION: DWORD = 4; +pub const REG_WHOLE_HIVE_VOLATILE: DWORD = 0x00000001; +pub const REG_REFRESH_HIVE: DWORD = 0x00000002; +pub const REG_NO_LAZY_FLUSH: DWORD = 0x00000004; +pub const REG_FORCE_RESTORE: DWORD = 0x00000008; +pub const REG_APP_HIVE: DWORD = 0x00000010; +pub const REG_PROCESS_PRIVATE: DWORD = 0x00000020; +pub const REG_START_JOURNAL: DWORD = 0x00000040; +pub const REG_HIVE_EXACT_FILE_GROWTH: DWORD = 0x00000080; +pub const REG_HIVE_NO_RM: DWORD = 0x00000100; +pub const REG_HIVE_SINGLE_LOG: DWORD = 0x00000200; +pub const REG_BOOT_HIVE: DWORD = 0x00000400; +pub const REG_LOAD_HIVE_OPEN_HANDLE: DWORD = 0x00000800; +pub const REG_FLUSH_HIVE_FILE_GROWTH: DWORD = 0x00001000; +pub const REG_OPEN_READ_ONLY: DWORD = 0x00002000; +pub const REG_IMMUTABLE: DWORD = 0x00004000; +pub const REG_APP_HIVE_OPEN_READ_ONLY: DWORD = REG_OPEN_READ_ONLY; +pub const REG_FORCE_UNLOAD: DWORD = 1; +pub const REG_UNLOAD_LEGAL_FLAGS: DWORD = REG_FORCE_UNLOAD; +pub const REG_NOTIFY_CHANGE_NAME: DWORD = 0x00000001; +pub const REG_NOTIFY_CHANGE_ATTRIBUTES: DWORD = 0x00000002; +pub const REG_NOTIFY_CHANGE_LAST_SET: DWORD = 0x00000004; +pub const REG_NOTIFY_CHANGE_SECURITY: DWORD = 0x00000008; +pub const REG_NOTIFY_THREAD_AGNOSTIC: DWORD = 0x10000000; +pub const REG_LEGAL_CHANGE_FILTER: DWORD = REG_NOTIFY_CHANGE_NAME | REG_NOTIFY_CHANGE_ATTRIBUTES + | REG_NOTIFY_CHANGE_LAST_SET | REG_NOTIFY_CHANGE_SECURITY | REG_NOTIFY_THREAD_AGNOSTIC; +pub const REG_NONE: DWORD = 0; +pub const REG_SZ: DWORD = 1; +pub const REG_EXPAND_SZ: DWORD = 2; +pub const REG_BINARY: DWORD = 3; +pub const REG_DWORD: DWORD = 4; +pub const REG_DWORD_LITTLE_ENDIAN: DWORD = 4; +pub const REG_DWORD_BIG_ENDIAN: DWORD = 5; +pub const REG_LINK: DWORD = 6; +pub const REG_MULTI_SZ: DWORD = 7; +pub const REG_RESOURCE_LIST: DWORD = 8; +pub const REG_FULL_RESOURCE_DESCRIPTOR: DWORD = 9; +pub const REG_RESOURCE_REQUIREMENTS_LIST: DWORD = 10; +pub const REG_QWORD: DWORD = 11; +pub const REG_QWORD_LITTLE_ENDIAN: DWORD = 11; +pub const SERVICE_KERNEL_DRIVER: DWORD = 0x00000001; +pub const SERVICE_FILE_SYSTEM_DRIVER: DWORD = 0x00000002; +pub const SERVICE_ADAPTER: DWORD = 0x00000004; +pub const SERVICE_RECOGNIZER_DRIVER: DWORD = 0x00000008; +pub const SERVICE_DRIVER: DWORD = SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER + | SERVICE_RECOGNIZER_DRIVER; +pub const SERVICE_WIN32_OWN_PROCESS: DWORD = 0x00000010; +pub const SERVICE_WIN32_SHARE_PROCESS: DWORD = 0x00000020; +pub const SERVICE_WIN32: DWORD = SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS; +pub const SERVICE_USER_SERVICE: DWORD = 0x00000040; +pub const SERVICE_USERSERVICE_INSTANCE: DWORD = 0x00000080; +pub const SERVICE_USER_SHARE_PROCESS: DWORD = SERVICE_USER_SERVICE | SERVICE_WIN32_SHARE_PROCESS; +pub const SERVICE_USER_OWN_PROCESS: DWORD = SERVICE_USER_SERVICE | SERVICE_WIN32_OWN_PROCESS; +pub const SERVICE_INTERACTIVE_PROCESS: DWORD = 0x00000100; +pub const SERVICE_PKG_SERVICE: DWORD = 0x00000200; +pub const SERVICE_TYPE_ALL: DWORD = SERVICE_WIN32 | SERVICE_ADAPTER | SERVICE_DRIVER + | SERVICE_INTERACTIVE_PROCESS | SERVICE_USER_SERVICE | SERVICE_USERSERVICE_INSTANCE + | SERVICE_PKG_SERVICE; +pub const SERVICE_BOOT_START: DWORD = 0x00000000; +pub const SERVICE_SYSTEM_START: DWORD = 0x00000001; +pub const SERVICE_AUTO_START: DWORD = 0x00000002; +pub const SERVICE_DEMAND_START: DWORD = 0x00000003; +pub const SERVICE_DISABLED: DWORD = 0x00000004; +pub const SERVICE_ERROR_IGNORE: DWORD = 0x00000000; +pub const SERVICE_ERROR_NORMAL: DWORD = 0x00000001; +pub const SERVICE_ERROR_SEVERE: DWORD = 0x00000002; +pub const SERVICE_ERROR_CRITICAL: DWORD = 0x00000003; +ENUM!{enum SERVICE_NODE_TYPE { + DriverType = SERVICE_KERNEL_DRIVER, + FileSystemType = SERVICE_FILE_SYSTEM_DRIVER, + Win32ServiceOwnProcess = SERVICE_WIN32_OWN_PROCESS, + Win32ServiceShareProcess = SERVICE_WIN32_SHARE_PROCESS, + AdapterType = SERVICE_ADAPTER, + RecognizerType = SERVICE_RECOGNIZER_DRIVER, +}} +ENUM!{enum SERVICE_LOAD_TYPE { + BootLoad = SERVICE_BOOT_START, + SystemLoad = SERVICE_SYSTEM_START, + AutoLoad = SERVICE_AUTO_START, + DemandLoad = SERVICE_DEMAND_START, + DisableLoad = SERVICE_DISABLED, +}} +ENUM!{enum SERVICE_ERROR_TYPE { + IgnoreError = SERVICE_ERROR_IGNORE, + NormalError = SERVICE_ERROR_NORMAL, + SevereError = SERVICE_ERROR_SEVERE, + CriticalError = SERVICE_ERROR_CRITICAL, +}} +pub const CM_SERVICE_NETWORK_BOOT_LOAD: DWORD = 0x00000001; +pub const CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD: DWORD = 0x00000002; +pub const CM_SERVICE_USB_DISK_BOOT_LOAD: DWORD = 0x00000004; +pub const CM_SERVICE_SD_DISK_BOOT_LOAD: DWORD = 0x00000008; +pub const CM_SERVICE_USB3_DISK_BOOT_LOAD: DWORD = 0x00000010; +pub const CM_SERVICE_MEASURED_BOOT_LOAD: DWORD = 0x00000020; +pub const CM_SERVICE_VERIFIER_BOOT_LOAD: DWORD = 0x00000040; +pub const CM_SERVICE_WINPE_BOOT_LOAD: DWORD = 0x00000080; +pub const CM_SERVICE_VALID_PROMOTION_MASK: DWORD = CM_SERVICE_NETWORK_BOOT_LOAD + | CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD | CM_SERVICE_USB_DISK_BOOT_LOAD + | CM_SERVICE_SD_DISK_BOOT_LOAD | CM_SERVICE_USB3_DISK_BOOT_LOAD + | CM_SERVICE_MEASURED_BOOT_LOAD | CM_SERVICE_VERIFIER_BOOT_LOAD | CM_SERVICE_WINPE_BOOT_LOAD; +pub const TAPE_ERASE_SHORT: DWORD = 0; +pub const TAPE_ERASE_LONG: DWORD = 1; +STRUCT!{struct TAPE_ERASE { + Type: DWORD, + Immediate: BOOLEAN, +}} +pub type PTAPE_ERASE = *mut TAPE_ERASE; +pub const TAPE_LOAD: DWORD = 0; +pub const TAPE_UNLOAD: DWORD = 1; +pub const TAPE_TENSION: DWORD = 2; +pub const TAPE_LOCK: DWORD = 3; +pub const TAPE_UNLOCK: DWORD = 4; +pub const TAPE_FORMAT: DWORD = 5; +STRUCT!{struct TAPE_PREPARE { + Operation: DWORD, + Immediate: BOOLEAN, +}} +pub type PTAPE_PREPARE = *mut TAPE_PREPARE; +pub const TAPE_SETMARKS: DWORD = 0; +pub const TAPE_FILEMARKS: DWORD = 1; +pub const TAPE_SHORT_FILEMARKS: DWORD = 2; +pub const TAPE_LONG_FILEMARKS: DWORD = 3; +STRUCT!{struct TAPE_WRITE_MARKS { + Type: DWORD, + Count: DWORD, + Immediate: BOOLEAN, +}} +pub type PTAPE_WRITE_MARKS = *mut TAPE_WRITE_MARKS; +pub const TAPE_ABSOLUTE_POSITION: DWORD = 0; +pub const TAPE_LOGICAL_POSITION: DWORD = 1; +pub const TAPE_PSEUDO_LOGICAL_POSITION: DWORD = 2; +STRUCT!{struct TAPE_GET_POSITION { + Type: DWORD, + Partition: DWORD, + Offset: LARGE_INTEGER, +}} +pub type PTAPE_GET_POSITION = *mut TAPE_GET_POSITION; +pub const TAPE_REWIND: DWORD = 0; +pub const TAPE_ABSOLUTE_BLOCK: DWORD = 1; +pub const TAPE_LOGICAL_BLOCK: DWORD = 2; +pub const TAPE_PSEUDO_LOGICAL_BLOCK: DWORD = 3; +pub const TAPE_SPACE_END_OF_DATA: DWORD = 4; +pub const TAPE_SPACE_RELATIVE_BLOCKS: DWORD = 5; +pub const TAPE_SPACE_FILEMARKS: DWORD = 6; +pub const TAPE_SPACE_SEQUENTIAL_FMKS: DWORD = 7; +pub const TAPE_SPACE_SETMARKS: DWORD = 8; +pub const TAPE_SPACE_SEQUENTIAL_SMKS: DWORD = 9; +STRUCT!{struct TAPE_SET_POSITION { + Method: DWORD, + Partition: DWORD, + Offset: LARGE_INTEGER, + Immediate: BOOLEAN, +}} +pub type PTAPE_SET_POSITION = *mut TAPE_SET_POSITION; +pub const TAPE_DRIVE_FIXED: DWORD = 0x00000001; +pub const TAPE_DRIVE_SELECT: DWORD = 0x00000002; +pub const TAPE_DRIVE_INITIATOR: DWORD = 0x00000004; +pub const TAPE_DRIVE_ERASE_SHORT: DWORD = 0x00000010; +pub const TAPE_DRIVE_ERASE_LONG: DWORD = 0x00000020; +pub const TAPE_DRIVE_ERASE_BOP_ONLY: DWORD = 0x00000040; +pub const TAPE_DRIVE_ERASE_IMMEDIATE: DWORD = 0x00000080; +pub const TAPE_DRIVE_TAPE_CAPACITY: DWORD = 0x00000100; +pub const TAPE_DRIVE_TAPE_REMAINING: DWORD = 0x00000200; +pub const TAPE_DRIVE_FIXED_BLOCK: DWORD = 0x00000400; +pub const TAPE_DRIVE_VARIABLE_BLOCK: DWORD = 0x00000800; +pub const TAPE_DRIVE_WRITE_PROTECT: DWORD = 0x00001000; +pub const TAPE_DRIVE_EOT_WZ_SIZE: DWORD = 0x00002000; +pub const TAPE_DRIVE_ECC: DWORD = 0x00010000; +pub const TAPE_DRIVE_COMPRESSION: DWORD = 0x00020000; +pub const TAPE_DRIVE_PADDING: DWORD = 0x00040000; +pub const TAPE_DRIVE_REPORT_SMKS: DWORD = 0x00080000; +pub const TAPE_DRIVE_GET_ABSOLUTE_BLK: DWORD = 0x00100000; +pub const TAPE_DRIVE_GET_LOGICAL_BLK: DWORD = 0x00200000; +pub const TAPE_DRIVE_SET_EOT_WZ_SIZE: DWORD = 0x00400000; +pub const TAPE_DRIVE_EJECT_MEDIA: DWORD = 0x01000000; +pub const TAPE_DRIVE_CLEAN_REQUESTS: DWORD = 0x02000000; +pub const TAPE_DRIVE_SET_CMP_BOP_ONLY: DWORD = 0x04000000; +pub const TAPE_DRIVE_RESERVED_BIT: DWORD = 0x80000000; +pub const TAPE_DRIVE_LOAD_UNLOAD: DWORD = 0x80000001; +pub const TAPE_DRIVE_TENSION: DWORD = 0x80000002; +pub const TAPE_DRIVE_LOCK_UNLOCK: DWORD = 0x80000004; +pub const TAPE_DRIVE_REWIND_IMMEDIATE: DWORD = 0x80000008; +pub const TAPE_DRIVE_SET_BLOCK_SIZE: DWORD = 0x80000010; +pub const TAPE_DRIVE_LOAD_UNLD_IMMED: DWORD = 0x80000020; +pub const TAPE_DRIVE_TENSION_IMMED: DWORD = 0x80000040; +pub const TAPE_DRIVE_LOCK_UNLK_IMMED: DWORD = 0x80000080; +pub const TAPE_DRIVE_SET_ECC: DWORD = 0x80000100; +pub const TAPE_DRIVE_SET_COMPRESSION: DWORD = 0x80000200; +pub const TAPE_DRIVE_SET_PADDING: DWORD = 0x80000400; +pub const TAPE_DRIVE_SET_REPORT_SMKS: DWORD = 0x80000800; +pub const TAPE_DRIVE_ABSOLUTE_BLK: DWORD = 0x80001000; +pub const TAPE_DRIVE_ABS_BLK_IMMED: DWORD = 0x80002000; +pub const TAPE_DRIVE_LOGICAL_BLK: DWORD = 0x80004000; +pub const TAPE_DRIVE_LOG_BLK_IMMED: DWORD = 0x80008000; +pub const TAPE_DRIVE_END_OF_DATA: DWORD = 0x80010000; +pub const TAPE_DRIVE_RELATIVE_BLKS: DWORD = 0x80020000; +pub const TAPE_DRIVE_FILEMARKS: DWORD = 0x80040000; +pub const TAPE_DRIVE_SEQUENTIAL_FMKS: DWORD = 0x80080000; +pub const TAPE_DRIVE_SETMARKS: DWORD = 0x80100000; +pub const TAPE_DRIVE_SEQUENTIAL_SMKS: DWORD = 0x80200000; +pub const TAPE_DRIVE_REVERSE_POSITION: DWORD = 0x80400000; +pub const TAPE_DRIVE_SPACE_IMMEDIATE: DWORD = 0x80800000; +pub const TAPE_DRIVE_WRITE_SETMARKS: DWORD = 0x81000000; +pub const TAPE_DRIVE_WRITE_FILEMARKS: DWORD = 0x82000000; +pub const TAPE_DRIVE_WRITE_SHORT_FMKS: DWORD = 0x84000000; +pub const TAPE_DRIVE_WRITE_LONG_FMKS: DWORD = 0x88000000; +pub const TAPE_DRIVE_WRITE_MARK_IMMED: DWORD = 0x90000000; +pub const TAPE_DRIVE_FORMAT: DWORD = 0xA0000000; +pub const TAPE_DRIVE_FORMAT_IMMEDIATE: DWORD = 0xC0000000; +pub const TAPE_DRIVE_HIGH_FEATURES: DWORD = 0x80000000; +STRUCT!{struct TAPE_GET_DRIVE_PARAMETERS { + ECC: BOOLEAN, + Compression: BOOLEAN, + DataPadding: BOOLEAN, + ReportSetmarks: BOOLEAN, + DefaultBlockSize: DWORD, + MaximumBlockSize: DWORD, + MinimumBlockSize: DWORD, + MaximumPartitionCount: DWORD, + FeaturesLow: DWORD, + FeaturesHigh: DWORD, + EOTWarningZoneSize: DWORD, +}} +pub type PTAPE_GET_DRIVE_PARAMETERS = *mut TAPE_GET_DRIVE_PARAMETERS; +STRUCT!{struct TAPE_SET_DRIVE_PARAMETERS { + ECC: BOOLEAN, + Compression: BOOLEAN, + DataPadding: BOOLEAN, + ReportSetmarks: BOOLEAN, + EOTWarningZoneSize: DWORD, +}} +pub type PTAPE_SET_DRIVE_PARAMETERS = *mut TAPE_SET_DRIVE_PARAMETERS; +STRUCT!{struct TAPE_GET_MEDIA_PARAMETERS { + Capacity: LARGE_INTEGER, + Remaining: LARGE_INTEGER, + BlockSize: DWORD, + PartitionCount: DWORD, + WriteProtected: BOOLEAN, +}} +pub type PTAPE_GET_MEDIA_PARAMETERS = *mut TAPE_GET_MEDIA_PARAMETERS; +STRUCT!{struct TAPE_SET_MEDIA_PARAMETERS { + BlockSize: DWORD, +}} +pub type PTAPE_SET_MEDIA_PARAMETERS = *mut TAPE_SET_MEDIA_PARAMETERS; +pub const TAPE_FIXED_PARTITIONS: DWORD = 0; +pub const TAPE_SELECT_PARTITIONS: DWORD = 1; +pub const TAPE_INITIATOR_PARTITIONS: DWORD = 2; +STRUCT!{struct TAPE_CREATE_PARTITION { + Method: DWORD, + Count: DWORD, + Size: DWORD, +}} +pub type PTAPE_CREATE_PARTITION = *mut TAPE_CREATE_PARTITION; +pub const TAPE_QUERY_DRIVE_PARAMETERS: DWORD = 0; +pub const TAPE_QUERY_MEDIA_CAPACITY: DWORD = 1; +pub const TAPE_CHECK_FOR_DRIVE_PROBLEM: DWORD = 2; +pub const TAPE_QUERY_IO_ERROR_DATA: DWORD = 3; +pub const TAPE_QUERY_DEVICE_ERROR_DATA: DWORD = 4; +STRUCT!{struct TAPE_WMI_OPERATIONS { + Method: DWORD, + DataBufferSize: DWORD, + DataBuffer: PVOID, +}} +pub type PTAPE_WMI_OPERATIONS = *mut TAPE_WMI_OPERATIONS; +ENUM!{enum TAPE_DRIVE_PROBLEM_TYPE { + TapeDriveProblemNone, + TapeDriveReadWriteWarning, + TapeDriveReadWriteError, + TapeDriveReadWarning, + TapeDriveWriteWarning, + TapeDriveReadError, + TapeDriveWriteError, + TapeDriveHardwareError, + TapeDriveUnsupportedMedia, + TapeDriveScsiConnectionError, + TapeDriveTimetoClean, + TapeDriveCleanDriveNow, + TapeDriveMediaLifeExpired, + TapeDriveSnappedTape, +}} +pub const TRANSACTIONMANAGER_QUERY_INFORMATION: DWORD = 0x0001; +pub const TRANSACTIONMANAGER_SET_INFORMATION: DWORD = 0x0002; +pub const TRANSACTIONMANAGER_RECOVER: DWORD = 0x0004; +pub const TRANSACTIONMANAGER_RENAME: DWORD = 0x0008; +pub const TRANSACTIONMANAGER_CREATE_RM: DWORD = 0x0010; +pub const TRANSACTIONMANAGER_BIND_TRANSACTION: DWORD = 0x0020; +pub const TRANSACTIONMANAGER_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ + | TRANSACTIONMANAGER_QUERY_INFORMATION; +pub const TRANSACTIONMANAGER_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE + | TRANSACTIONMANAGER_SET_INFORMATION | TRANSACTIONMANAGER_RECOVER | TRANSACTIONMANAGER_RENAME + | TRANSACTIONMANAGER_CREATE_RM; +pub const TRANSACTIONMANAGER_GENERIC_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE; +pub const TRANSACTIONMANAGER_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED + | TRANSACTIONMANAGER_GENERIC_READ | TRANSACTIONMANAGER_GENERIC_WRITE + | TRANSACTIONMANAGER_GENERIC_EXECUTE | TRANSACTIONMANAGER_BIND_TRANSACTION; +pub const TRANSACTION_QUERY_INFORMATION: DWORD = 0x0001; +pub const TRANSACTION_SET_INFORMATION: DWORD = 0x0002; +pub const TRANSACTION_ENLIST: DWORD = 0x0004; +pub const TRANSACTION_COMMIT: DWORD = 0x0008; +pub const TRANSACTION_ROLLBACK: DWORD = 0x0010; +pub const TRANSACTION_PROPAGATE: DWORD = 0x0020; +pub const TRANSACTION_RIGHT_RESERVED1: DWORD = 0x0040; +pub const TRANSACTION_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ | TRANSACTION_QUERY_INFORMATION + | SYNCHRONIZE; +pub const TRANSACTION_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE | TRANSACTION_SET_INFORMATION + | TRANSACTION_COMMIT | TRANSACTION_ENLIST | TRANSACTION_ROLLBACK | TRANSACTION_PROPAGATE + | SYNCHRONIZE; +pub const TRANSACTION_GENERIC_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE | TRANSACTION_COMMIT + | TRANSACTION_ROLLBACK | SYNCHRONIZE; +pub const TRANSACTION_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | TRANSACTION_GENERIC_READ + | TRANSACTION_GENERIC_WRITE | TRANSACTION_GENERIC_EXECUTE; +pub const TRANSACTION_RESOURCE_MANAGER_RIGHTS: DWORD = TRANSACTION_GENERIC_READ + | STANDARD_RIGHTS_WRITE | TRANSACTION_SET_INFORMATION | TRANSACTION_ENLIST + | TRANSACTION_ROLLBACK | TRANSACTION_PROPAGATE | SYNCHRONIZE; +pub const RESOURCEMANAGER_QUERY_INFORMATION: DWORD = 0x0001; +pub const RESOURCEMANAGER_SET_INFORMATION: DWORD = 0x0002; +pub const RESOURCEMANAGER_RECOVER: DWORD = 0x0004; +pub const RESOURCEMANAGER_ENLIST: DWORD = 0x0008; +pub const RESOURCEMANAGER_GET_NOTIFICATION: DWORD = 0x0010; +pub const RESOURCEMANAGER_REGISTER_PROTOCOL: DWORD = 0x0020; +pub const RESOURCEMANAGER_COMPLETE_PROPAGATION: DWORD = 0x0040; +pub const RESOURCEMANAGER_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ + | RESOURCEMANAGER_QUERY_INFORMATION | SYNCHRONIZE; +pub const RESOURCEMANAGER_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE + | RESOURCEMANAGER_SET_INFORMATION | RESOURCEMANAGER_RECOVER | RESOURCEMANAGER_ENLIST + | RESOURCEMANAGER_GET_NOTIFICATION | RESOURCEMANAGER_REGISTER_PROTOCOL + | RESOURCEMANAGER_COMPLETE_PROPAGATION | SYNCHRONIZE; +pub const RESOURCEMANAGER_GENERIC_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE + | RESOURCEMANAGER_RECOVER | RESOURCEMANAGER_ENLIST | RESOURCEMANAGER_GET_NOTIFICATION + | RESOURCEMANAGER_COMPLETE_PROPAGATION | SYNCHRONIZE; +pub const RESOURCEMANAGER_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED + | RESOURCEMANAGER_GENERIC_READ | RESOURCEMANAGER_GENERIC_WRITE + | RESOURCEMANAGER_GENERIC_EXECUTE; +pub const ENLISTMENT_QUERY_INFORMATION: DWORD = 0x0001; +pub const ENLISTMENT_SET_INFORMATION: DWORD = 0x0002; +pub const ENLISTMENT_RECOVER: DWORD = 0x0004; +pub const ENLISTMENT_SUBORDINATE_RIGHTS: DWORD = 0x0008; +pub const ENLISTMENT_SUPERIOR_RIGHTS: DWORD = 0x0010; +pub const ENLISTMENT_GENERIC_READ: DWORD = STANDARD_RIGHTS_READ | ENLISTMENT_QUERY_INFORMATION; +pub const ENLISTMENT_GENERIC_WRITE: DWORD = STANDARD_RIGHTS_WRITE | ENLISTMENT_SET_INFORMATION + | ENLISTMENT_RECOVER | ENLISTMENT_SUBORDINATE_RIGHTS | ENLISTMENT_SUPERIOR_RIGHTS; +pub const ENLISTMENT_GENERIC_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE | ENLISTMENT_RECOVER + | ENLISTMENT_SUBORDINATE_RIGHTS | ENLISTMENT_SUPERIOR_RIGHTS; +pub const ENLISTMENT_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | ENLISTMENT_GENERIC_READ + | ENLISTMENT_GENERIC_WRITE | ENLISTMENT_GENERIC_EXECUTE; +ENUM!{enum TRANSACTION_OUTCOME { + TransactionOutcomeUndetermined = 1, + TransactionOutcomeCommitted, + TransactionOutcomeAborted, +}} +ENUM!{enum TRANSACTION_STATE { + TransactionStateNormal = 1, + TransactionStateIndoubt, + TransactionStateCommittedNotify, +}} +STRUCT!{struct TRANSACTION_BASIC_INFORMATION { + TransactionId: GUID, + State: DWORD, + Outcome: DWORD, +}} +pub type PTRANSACTION_BASIC_INFORMATION = *mut TRANSACTION_BASIC_INFORMATION; +STRUCT!{struct TRANSACTIONMANAGER_BASIC_INFORMATION { + TmIdentity: GUID, + VirtualClock: LARGE_INTEGER, +}} +pub type PTRANSACTIONMANAGER_BASIC_INFORMATION = *mut TRANSACTIONMANAGER_BASIC_INFORMATION; +STRUCT!{struct TRANSACTIONMANAGER_LOG_INFORMATION { + LogIdentity: GUID, +}} +pub type PTRANSACTIONMANAGER_LOG_INFORMATION = *mut TRANSACTIONMANAGER_LOG_INFORMATION; +STRUCT!{struct TRANSACTIONMANAGER_LOGPATH_INFORMATION { + LogPathLength: DWORD, + LogPath: [WCHAR; 1], +}} +pub type PTRANSACTIONMANAGER_LOGPATH_INFORMATION = *mut TRANSACTIONMANAGER_LOGPATH_INFORMATION; +STRUCT!{struct TRANSACTIONMANAGER_RECOVERY_INFORMATION { + LastRecoveredLsn: ULONGLONG, +}} +pub type PTRANSACTIONMANAGER_RECOVERY_INFORMATION = *mut TRANSACTIONMANAGER_RECOVERY_INFORMATION; +STRUCT!{struct TRANSACTIONMANAGER_OLDEST_INFORMATION { + OldestTransactionGuid: GUID, +}} +pub type PTRANSACTIONMANAGER_OLDEST_INFORMATION = *mut TRANSACTIONMANAGER_OLDEST_INFORMATION; +STRUCT!{struct TRANSACTION_PROPERTIES_INFORMATION { + IsolationLevel: DWORD, + IsolationFlags: DWORD, + Timeout: LARGE_INTEGER, + Outcome: DWORD, + DescriptionLength: DWORD, + Description: [WCHAR; 1], +}} +pub type PTRANSACTION_PROPERTIES_INFORMATION = *mut TRANSACTION_PROPERTIES_INFORMATION; +STRUCT!{struct TRANSACTION_BIND_INFORMATION { + TmHandle: HANDLE, +}} +pub type PTRANSACTION_BIND_INFORMATION = *mut TRANSACTION_BIND_INFORMATION; +STRUCT!{struct TRANSACTION_ENLISTMENT_PAIR { + EnlistmentId: GUID, + ResourceManagerId: GUID, +}} +pub type PTRANSACTION_ENLISTMENT_PAIR = *mut TRANSACTION_ENLISTMENT_PAIR; +STRUCT!{struct TRANSACTION_ENLISTMENTS_INFORMATION { + NumberOfEnlistments: DWORD, + EnlistmentPair: [TRANSACTION_ENLISTMENT_PAIR; 1], +}} +pub type PTRANSACTION_ENLISTMENTS_INFORMATION = *mut TRANSACTION_ENLISTMENTS_INFORMATION; +STRUCT!{struct TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION { + SuperiorEnlistmentPair: TRANSACTION_ENLISTMENT_PAIR, +}} +pub type PTRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION + = *mut TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION; +STRUCT!{struct RESOURCEMANAGER_BASIC_INFORMATION { + ResourceManagerId: GUID, + DescriptionLength: DWORD, + Description: [WCHAR; 1], +}} +pub type PRESOURCEMANAGER_BASIC_INFORMATION = *mut RESOURCEMANAGER_BASIC_INFORMATION; +STRUCT!{struct RESOURCEMANAGER_COMPLETION_INFORMATION { + IoCompletionPortHandle: HANDLE, + CompletionKey: ULONG_PTR, +}} +pub type PRESOURCEMANAGER_COMPLETION_INFORMATION = *mut RESOURCEMANAGER_COMPLETION_INFORMATION; +ENUM!{enum TRANSACTION_INFORMATION_CLASS { + TransactionBasicInformation, + TransactionPropertiesInformation, + TransactionEnlistmentInformation, + TransactionSuperiorEnlistmentInformation, + TransactionBindInformation, + TransactionDTCPrivateInformation, +}} +ENUM!{enum TRANSACTIONMANAGER_INFORMATION_CLASS { + TransactionManagerBasicInformation, + TransactionManagerLogInformation, + TransactionManagerLogPathInformation, + TransactionManagerRecoveryInformation = 4, + TransactionManagerOnlineProbeInformation = 3, + TransactionManagerOldestTransactionInformation = 5, +}} +ENUM!{enum RESOURCEMANAGER_INFORMATION_CLASS { + ResourceManagerBasicInformation, + ResourceManagerCompletionInformation, +}} +STRUCT!{struct ENLISTMENT_BASIC_INFORMATION { + EnlistmentId: GUID, + TransactionId: GUID, + ResourceManagerId: GUID, +}} +pub type PENLISTMENT_BASIC_INFORMATION = *mut ENLISTMENT_BASIC_INFORMATION; +STRUCT!{struct ENLISTMENT_CRM_INFORMATION { + CrmTransactionManagerId: GUID, + CrmResourceManagerId: GUID, + CrmEnlistmentId: GUID, +}} +pub type PENLISTMENT_CRM_INFORMATION = *mut ENLISTMENT_CRM_INFORMATION; +ENUM!{enum ENLISTMENT_INFORMATION_CLASS { + EnlistmentBasicInformation, + EnlistmentRecoveryInformation, + EnlistmentCrmInformation, +}} +STRUCT!{struct TRANSACTION_LIST_ENTRY { + UOW: UOW, +}} +pub type PTRANSACTION_LIST_ENTRY = *mut TRANSACTION_LIST_ENTRY; +STRUCT!{struct TRANSACTION_LIST_INFORMATION { + NumberOfTransactions: DWORD, + TransactionInformation: [TRANSACTION_LIST_ENTRY; 1], +}} +pub type PTRANSACTION_LIST_INFORMATION = *mut TRANSACTION_LIST_INFORMATION; +ENUM!{enum KTMOBJECT_TYPE { + KTMOBJECT_TRANSACTION, + KTMOBJECT_TRANSACTION_MANAGER, + KTMOBJECT_RESOURCE_MANAGER, + KTMOBJECT_ENLISTMENT, + KTMOBJECT_INVALID, +}} +pub type PKTMOBJECT_TYPE = *mut KTMOBJECT_TYPE; +STRUCT!{struct KTMOBJECT_CURSOR { + LastQuery: GUID, + ObjectIdCount: DWORD, + ObjectIds: [GUID; 1], +}} +pub type PKTMOBJECT_CURSOR = *mut KTMOBJECT_CURSOR; +pub type TP_VERSION = DWORD; +pub type PTP_VERSION = *mut DWORD; +STRUCT!{struct TP_CALLBACK_INSTANCE { + dummy: *mut c_void, +}} +pub type PTP_CALLBACK_INSTANCE = *mut TP_CALLBACK_INSTANCE; +FN!{stdcall PTP_SIMPLE_CALLBACK( + Instance: PTP_CALLBACK_INSTANCE, + Context: PVOID, +) -> ()} +STRUCT!{struct TP_POOL { + dummy: *mut c_void, +}} +pub type PTP_POOL = *mut TP_POOL; +ENUM!{enum TP_CALLBACK_PRIORITY { + TP_CALLBACK_PRIORITY_HIGH, + TP_CALLBACK_PRIORITY_NORMAL, + TP_CALLBACK_PRIORITY_LOW, + TP_CALLBACK_PRIORITY_INVALID, + TP_CALLBACK_PRIORITY_COUNT = TP_CALLBACK_PRIORITY_INVALID, +}} +STRUCT!{struct TP_POOL_STACK_INFORMATION { + StackReserve: SIZE_T, + StackCommit: SIZE_T, +}} +pub type PTP_POOL_STACK_INFORMATION = *mut TP_POOL_STACK_INFORMATION; +STRUCT!{struct TP_CLEANUP_GROUP { + dummy: *mut c_void, +}} +pub type PTP_CLEANUP_GROUP = *mut TP_CLEANUP_GROUP; +FN!{stdcall PTP_CLEANUP_GROUP_CANCEL_CALLBACK( + ObjectContext: PVOID, + CleanupContext: PVOID, +) -> ()} +STRUCT!{struct TP_CALLBACK_ENVIRON_V3_u_s { + BitFields: DWORD, +}} +BITFIELD!{TP_CALLBACK_ENVIRON_V3_u_s BitFields: DWORD [ + LongFunction set_LongFunction[0..1], + Persistent set_Persistent[1..2], + Private set_Private[2..32], +]} +UNION!{union TP_CALLBACK_ENVIRON_V3_u { + [u32; 1], + Flags Flags_mut: DWORD, + s s_mut: TP_CALLBACK_ENVIRON_V3_u_s, +}} +STRUCT!{struct TP_CALLBACK_ENVIRON_V3 { + Version: TP_VERSION, + Pool: PTP_POOL, + CleanupGroup: PTP_CLEANUP_GROUP, + CleanupGroupCancelCallback: PTP_CLEANUP_GROUP_CANCEL_CALLBACK, + RaceDll: PVOID, + ActivationContext: *mut ACTIVATION_CONTEXT, + FinalizationCallback: PTP_SIMPLE_CALLBACK, + u: TP_CALLBACK_ENVIRON_V3_u, + CallbackPriority: TP_CALLBACK_PRIORITY, + Size: DWORD, +}} +pub type TP_CALLBACK_ENVIRON = TP_CALLBACK_ENVIRON_V3; +pub type PTP_CALLBACK_ENVIRON = *mut TP_CALLBACK_ENVIRON_V3; +STRUCT!{struct TP_WORK { + dummy: *mut c_void, +}} +pub type PTP_WORK = *mut TP_WORK; +FN!{stdcall PTP_WORK_CALLBACK( + Instance: PTP_CALLBACK_INSTANCE, + Context: PVOID, + Work: PTP_WORK, +) -> ()} +STRUCT!{struct TP_TIMER { + dummy: *mut c_void, +}} +pub type PTP_TIMER = *mut TP_TIMER; +FN!{stdcall PTP_TIMER_CALLBACK( + Instance: PTP_CALLBACK_INSTANCE, + Context: PVOID, + Timer: PTP_TIMER, +) -> ()} +pub type TP_WAIT_RESULT = DWORD; +STRUCT!{struct TP_WAIT { + dummy: *mut c_void, +}} +pub type PTP_WAIT = *mut TP_WAIT; +FN!{stdcall PTP_WAIT_CALLBACK( + Instance: PTP_CALLBACK_INSTANCE, + Context: PVOID, + Wait: PTP_WAIT, + WaitResult: TP_WAIT_RESULT, +) -> ()} +STRUCT!{struct TP_IO { + dummy: *mut c_void, +}} +pub type PTP_IO = *mut TP_IO; +pub const ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION: ULONG = 1; +pub const ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION: ULONG = 2; +pub const ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION: ULONG = 3; +pub const ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION: ULONG = 4; +pub const ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION: ULONG = 5; +pub const ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION: ULONG = 6; +pub const ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION: ULONG = 7; +pub const ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE: ULONG = 8; +pub const ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES: ULONG = 9; +pub const ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS: ULONG = 10; +pub const ACTIVATION_CONTEXT_SECTION_COMPATIBILITY_INFO: ULONG = 11; +STRUCT!{struct ACTIVATION_CONTEXT { + dummy: *mut c_void, +}} diff --git a/bash-5.1/vendor/winapi/src/um/winreg.rs b/bash-5.1/vendor/winapi/src/um/winreg.rs new file mode 100644 index 0000000000000000000000000000000000000000..68c2ae2f74a6d87e741bd950c9051e2fa331112f --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winreg.rs @@ -0,0 +1,684 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::DWORD_PTR; +use shared::minwindef::{ + BOOL, BYTE, DWORD, HKEY, LPBYTE, LPCVOID, LPDWORD, PFILETIME, PHKEY, ULONG +}; +use um::minwinbase::LPSECURITY_ATTRIBUTES; +use um::reason::{ + SHTDN_REASON_FLAG_PLANNED, SHTDN_REASON_LEGACY_API, SHTDN_REASON_MAJOR_HARDWARE, + SHTDN_REASON_MAJOR_OTHER, SHTDN_REASON_MAJOR_SOFTWARE, SHTDN_REASON_MAJOR_SYSTEM, + SHTDN_REASON_MINOR_HUNG, SHTDN_REASON_MINOR_INSTALLATION, SHTDN_REASON_MINOR_OTHER, + SHTDN_REASON_MINOR_RECONFIG, SHTDN_REASON_MINOR_UNSTABLE, SHTDN_REASON_UNKNOWN, +}; +use um::winnt::{ + ACCESS_MASK, BOOLEAN, HANDLE, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PBOOLEAN, PLONG, + PSECURITY_DESCRIPTOR, PVOID, SECURITY_INFORMATION, +}; +pub type LSTATUS = LONG; +pub const RRF_RT_REG_NONE: DWORD = 0x00000001; +pub const RRF_RT_REG_SZ: DWORD = 0x00000002; +pub const RRF_RT_REG_EXPAND_SZ: DWORD = 0x00000004; +pub const RRF_RT_REG_BINARY: DWORD = 0x00000008; +pub const RRF_RT_REG_DWORD: DWORD = 0x00000010; +pub const RRF_RT_REG_MULTI_SZ: DWORD = 0x00000020; +pub const RRF_RT_REG_QWORD: DWORD = 0x00000040; +pub const RRF_RT_DWORD: DWORD = RRF_RT_REG_BINARY | RRF_RT_REG_DWORD; +pub const RRF_RT_QWORD: DWORD = RRF_RT_REG_BINARY | RRF_RT_REG_QWORD; +pub const RRF_RT_ANY: DWORD = 0x0000ffff; +pub const RRF_SUBKEY_WOW6464KEY: DWORD = 0x00010000; +pub const RRF_SUBKEY_WOW6432KEY: DWORD = 0x00020000; +pub const RRF_WOW64_MASK: DWORD = 0x00030000; +pub const RRF_NOEXPAND: DWORD = 0x10000000; +pub const RRF_ZEROONFAILURE: DWORD = 0x20000000; +pub const REG_PROCESS_APPKEY: DWORD = 0x00000001; +pub type REGSAM = ACCESS_MASK; +pub const HKEY_CLASSES_ROOT: HKEY = 0x80000000i32 as usize as HKEY; +pub const HKEY_CURRENT_USER: HKEY = 0x80000001i32 as usize as HKEY; +pub const HKEY_LOCAL_MACHINE: HKEY = 0x80000002i32 as usize as HKEY; +pub const HKEY_USERS: HKEY = 0x80000003i32 as usize as HKEY; +pub const HKEY_PERFORMANCE_DATA: HKEY = 0x80000004i32 as usize as HKEY; +pub const HKEY_PERFORMANCE_TEXT: HKEY = 0x80000050i32 as usize as HKEY; +pub const HKEY_PERFORMANCE_NLSTEXT: HKEY = 0x80000060i32 as usize as HKEY; +pub const HKEY_CURRENT_CONFIG: HKEY = 0x80000005i32 as usize as HKEY; +pub const HKEY_DYN_DATA: HKEY = 0x80000006i32 as usize as HKEY; +pub const HKEY_CURRENT_USER_LOCAL_SETTINGS: HKEY = 0x80000007i32 as usize as HKEY; +// PROVIDER_KEEPS_VALUE_LENGTH +// val_context +// PVALUEA +// PVALUEW +// QUERYHANDLER +// REG_PROVIDER +STRUCT!{struct VALENTA { + ve_valuename: LPSTR, + ve_valuelen: DWORD, + ve_valueptr: DWORD_PTR, + ve_type: DWORD, +}} +pub type PVALENTA = *mut VALENTA; +STRUCT!{struct VALENTW { + ve_valuename: LPWSTR, + ve_valuelen: DWORD, + ve_valueptr: DWORD_PTR, + ve_type: DWORD, +}} +pub type PVALENTW = *mut VALENTW; +// WIN31_CLASS +pub const REG_MUI_STRING_TRUNCATE: DWORD = 0x00000001; +pub const REG_SECURE_CONNECTION: DWORD = 1; +extern "system" { + pub fn RegCloseKey( + hKey: HKEY, + ) -> LSTATUS; + pub fn RegOverridePredefKey( + hKey: HKEY, + hNewHKey: HKEY, + ) -> LSTATUS; + pub fn RegOpenUserClassesRoot( + hToken: HANDLE, + dwOptions: DWORD, + samDesired: REGSAM, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegOpenCurrentUser( + samDesired: REGSAM, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegDisablePredefinedCache() -> LSTATUS; + pub fn RegDisablePredefinedCacheEx() -> LSTATUS; + pub fn RegConnectRegistryA( + lpMachineName: LPCSTR, + hKey: HKEY, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegConnectRegistryW( + lpMachineName: LPCWSTR, + hKey: HKEY, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegConnectRegistryExA( + lpMachineName: LPCSTR, + hKey: HKEY, + flags: ULONG, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegConnectRegistryExW( + lpMachineName: LPCWSTR, + hKey: HKEY, + flags: ULONG, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegCreateKeyA( + hKey: HKEY, + lpSubKey: LPCSTR, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegCreateKeyW( + hKey: HKEY, + lpSubKey: LPCWSTR, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegCreateKeyExA( + hKey: HKEY, + lpSubKey: LPCSTR, + Reserved: DWORD, + lpClass: LPSTR, + dwOptions: DWORD, + samDesired: REGSAM, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + phkResult: PHKEY, + lpdwDisposition: LPDWORD, + ) -> LSTATUS; + pub fn RegCreateKeyExW( + hKey: HKEY, + lpSubKey: LPCWSTR, + Reserved: DWORD, + lpClass: LPWSTR, + dwOptions: DWORD, + samDesired: REGSAM, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + phkResult: PHKEY, + lpdwDisposition: LPDWORD, + ) -> LSTATUS; + pub fn RegCreateKeyTransactedA( + hKey: HKEY, + lpSubKey: LPCSTR, + Reserved: DWORD, + lpClass: LPSTR, + dwOptions: DWORD, + samDesired: REGSAM, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + phkResult: PHKEY, + lpdwDisposition: LPDWORD, + hTransaction: HANDLE, + pExtendedParemeter: PVOID, + ) -> LSTATUS; + pub fn RegCreateKeyTransactedW( + hKey: HKEY, + lpSubKey: LPCWSTR, + Reserved: DWORD, + lpClass: LPWSTR, + dwOptions: DWORD, + samDesired: REGSAM, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + phkResult: PHKEY, + lpdwDisposition: LPDWORD, + hTransaction: HANDLE, + pExtendedParemeter: PVOID, + ) -> LSTATUS; + pub fn RegDeleteKeyA( + hKey: HKEY, + lpSubKey: LPCSTR, + ) -> LSTATUS; + pub fn RegDeleteKeyW( + hKey: HKEY, + lpSubKey: LPCWSTR, + ) -> LSTATUS; + pub fn RegDeleteKeyExA( + hKey: HKEY, + lpSubKey: LPCSTR, + samDesired: REGSAM, + Reserved: DWORD, + ) -> LSTATUS; + pub fn RegDeleteKeyExW( + hKey: HKEY, + lpSubKey: LPCWSTR, + samDesired: REGSAM, + Reserved: DWORD, + ) -> LSTATUS; + pub fn RegDeleteKeyTransactedA( + hKey: HKEY, + lpSubKey: LPCSTR, + samDesired: REGSAM, + Reserved: DWORD, + hTransaction: HANDLE, + pExtendedParemeter: PVOID, + ) -> LSTATUS; + pub fn RegDeleteKeyTransactedW( + hKey: HKEY, + lpSubKey: LPCWSTR, + samDesired: REGSAM, + Reserved: DWORD, + hTransaction: HANDLE, + pExtendedParemeter: PVOID, + ) -> LSTATUS; + pub fn RegDisableReflectionKey( + hBase: HKEY, + ) -> LONG; + pub fn RegEnableReflectionKey( + hBase: HKEY, + ) -> LONG; + pub fn RegQueryReflectionKey( + hBase: HKEY, + bIsReflectionDisabled: *mut BOOL, + ) -> LONG; + pub fn RegDeleteValueA( + hKey: HKEY, + lpValueName: LPCSTR, + ) -> LSTATUS; + pub fn RegDeleteValueW( + hKey: HKEY, + lpValueName: LPCWSTR, + ) -> LSTATUS; + pub fn RegEnumKeyA( + hKey: HKEY, + dwIndex: DWORD, + lpName: LPSTR, + cchName: DWORD, + ) -> LSTATUS; + pub fn RegEnumKeyW( + hKey: HKEY, + dwIndex: DWORD, + lpName: LPWSTR, + cchName: DWORD, + ) -> LSTATUS; + pub fn RegEnumKeyExA( + hKey: HKEY, + dwIndex: DWORD, + lpName: LPSTR, + lpcName: LPDWORD, + lpReserved: LPDWORD, + lpClass: LPSTR, + lpcClass: LPDWORD, + lpftLastWriteTime: PFILETIME, + ) -> LSTATUS; + pub fn RegEnumKeyExW( + hKey: HKEY, + dwIndex: DWORD, + lpName: LPWSTR, + lpcName: LPDWORD, + lpReserved: LPDWORD, + lpClass: LPWSTR, + lpcClass: LPDWORD, + lpftLastWriteTime: PFILETIME, + ) -> LSTATUS; + pub fn RegEnumValueA( + hKey: HKEY, + dwIndex: DWORD, + lpValueName: LPSTR, + lpcchValueName: LPDWORD, + lpReserved: LPDWORD, + lpType: LPDWORD, + lpData: LPBYTE, + lpcbData: LPDWORD, + ) -> LSTATUS; + pub fn RegEnumValueW( + hKey: HKEY, + dwIndex: DWORD, + lpValueName: LPWSTR, + lpcchValueName: LPDWORD, + lpReserved: LPDWORD, + lpType: LPDWORD, + lpData: LPBYTE, + lpcbData: LPDWORD, + ) -> LSTATUS; + pub fn RegFlushKey( + hKey: HKEY, + ) -> LSTATUS; + pub fn RegGetKeySecurity( + hKey: HKEY, + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpcbSecurityDescriptor: LPDWORD, + ) -> LSTATUS; + pub fn RegLoadKeyA( + hKey: HKEY, + lpSubKey: LPCSTR, + lpFile: LPCSTR, + ) -> LSTATUS; + pub fn RegLoadKeyW( + hKey: HKEY, + lpSubKey: LPCWSTR, + lpFile: LPCWSTR, + ) -> LSTATUS; + pub fn RegNotifyChangeKeyValue( + hKey: HKEY, + bWatchSubtree: BOOL, + dwNotifyFilter: DWORD, + hEvent: HANDLE, + fAsynchronous: BOOL, + ) -> LSTATUS; + pub fn RegOpenKeyA( + hKey: HKEY, + lpSubKey: LPCSTR, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegOpenKeyW( + hKey: HKEY, + lpSubKey: LPCWSTR, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegOpenKeyExA( + hKey: HKEY, + lpSubKey: LPCSTR, + ulOptions: DWORD, + samDesired: REGSAM, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegOpenKeyExW( + hKey: HKEY, + lpSubKey: LPCWSTR, + ulOptions: DWORD, + samDesired: REGSAM, + phkResult: PHKEY, + ) -> LSTATUS; + pub fn RegOpenKeyTransactedA( + hKey: HKEY, + lpSubKey: LPCSTR, + ulOptions: DWORD, + samDesired: REGSAM, + phkResult: PHKEY, + hTransaction: HANDLE, + pExtendedParemeter: PVOID, + ) -> LSTATUS; + pub fn RegOpenKeyTransactedW( + hKey: HKEY, + lpSubKey: LPCWSTR, + ulOptions: DWORD, + samDesired: REGSAM, + phkResult: PHKEY, + hTransaction: HANDLE, + pExtendedParemeter: PVOID, + ) -> LSTATUS; + pub fn RegQueryInfoKeyA( + hKey: HKEY, + lpClass: LPSTR, + lpcClass: LPDWORD, + lpReserved: LPDWORD, + lpcSubKeys: LPDWORD, + lpcMaxSubKeyLen: LPDWORD, + lpcMaxClassLen: LPDWORD, + lpcValues: LPDWORD, + lpcMaxValueNameLen: LPDWORD, + lpcMaxValueLen: LPDWORD, + lpcbSecurityDescriptor: LPDWORD, + lpftLastWriteTime: PFILETIME, + ) -> LSTATUS; + pub fn RegQueryInfoKeyW( + hKey: HKEY, + lpClass: LPWSTR, + lpcClass: LPDWORD, + lpReserved: LPDWORD, + lpcSubKeys: LPDWORD, + lpcMaxSubKeyLen: LPDWORD, + lpcMaxClassLen: LPDWORD, + lpcValues: LPDWORD, + lpcMaxValueNameLen: LPDWORD, + lpcMaxValueLen: LPDWORD, + lpcbSecurityDescriptor: LPDWORD, + lpftLastWriteTime: PFILETIME, + ) -> LSTATUS; + pub fn RegQueryValueA( + hKey: HKEY, + lpSubKey: LPCSTR, + lpData: LPSTR, + lpcbData: PLONG, + ) -> LSTATUS; + pub fn RegQueryValueW( + hKey: HKEY, + lpSubKey: LPCWSTR, + lpData: LPWSTR, + lpcbData: PLONG, + ) -> LSTATUS; + pub fn RegQueryMultipleValuesA( + hKey: HKEY, + val_list: PVALENTA, + num_vals: DWORD, + lpValueBuf: LPSTR, + ldwTotsize: LPDWORD, + ) -> LSTATUS; + pub fn RegQueryMultipleValuesW( + hKey: HKEY, + val_list: PVALENTW, + num_vals: DWORD, + lpValueBuf: LPWSTR, + ldwTotsize: LPDWORD, + ) -> LSTATUS; + pub fn RegQueryValueExA( + hKey: HKEY, + lpValueName: LPCSTR, + lpReserved: LPDWORD, + lpType: LPDWORD, + lpData: LPBYTE, + lpcbData: LPDWORD, + ) -> LSTATUS; + pub fn RegQueryValueExW( + hKey: HKEY, + lpValueName: LPCWSTR, + lpReserved: LPDWORD, + lpType: LPDWORD, + lpData: LPBYTE, + lpcbData: LPDWORD, + ) -> LSTATUS; + pub fn RegReplaceKeyA( + hKey: HKEY, + lpSubKey: LPCSTR, + lpNewFile: LPCSTR, + lpOldFile: LPCSTR, + ) -> LSTATUS; + pub fn RegReplaceKeyW( + hKey: HKEY, + lpSubKey: LPCWSTR, + lpNewFile: LPCWSTR, + lpOldFile: LPCWSTR, + ) -> LSTATUS; + pub fn RegRestoreKeyA( + hKey: HKEY, + lpFile: LPCSTR, + dwFlags: DWORD, + ) -> LSTATUS; + pub fn RegRestoreKeyW( + hKey: HKEY, + lpFile: LPCWSTR, + dwFlags: DWORD, + ) -> LSTATUS; + pub fn RegRenameKey( + hKey: HKEY, + lpSubKeyName: LPCWSTR, + lpNewKeyName: LPCWSTR, + ) -> LSTATUS; + pub fn RegSaveKeyA( + hKey: HKEY, + lpFile: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> LSTATUS; + pub fn RegSaveKeyW( + hKey: HKEY, + lpFile: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> LSTATUS; + pub fn RegSetKeySecurity( + hKey: HKEY, + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> LSTATUS; + pub fn RegSetValueA( + hKey: HKEY, + lpSubKey: LPCSTR, + dwType: DWORD, + lpData: LPCSTR, + cbData: DWORD, + ) -> LSTATUS; + pub fn RegSetValueW( + hKey: HKEY, + lpSubKey: LPCWSTR, + dwType: DWORD, + lpData: LPCWSTR, + cbData: DWORD, + ) -> LSTATUS; + pub fn RegSetValueExA( + hKey: HKEY, + lpValueName: LPCSTR, + Reserved: DWORD, + dwType: DWORD, + lpData: *const BYTE, + cbData: DWORD, + ) -> LSTATUS; + pub fn RegSetValueExW( + hKey: HKEY, + lpValueName: LPCWSTR, + Reserved: DWORD, + dwType: DWORD, + lpData: *const BYTE, + cbData: DWORD, + ) -> LSTATUS; + pub fn RegUnLoadKeyA( + hKey: HKEY, + lpSubKey: LPCSTR, + ) -> LSTATUS; + pub fn RegUnLoadKeyW( + hKey: HKEY, + lpSubKey: LPCWSTR, + ) -> LSTATUS; + pub fn RegDeleteKeyValueA( + hKey: HKEY, + lpSubKey: LPCSTR, + lpValueName: LPCSTR, + ) -> LSTATUS; + pub fn RegDeleteKeyValueW( + hKey: HKEY, + lpSubKey: LPCWSTR, + lpValueName: LPCWSTR, + ) -> LSTATUS; + pub fn RegSetKeyValueA( + hKey: HKEY, + lpSubKey: LPCSTR, + lpValueName: LPCSTR, + dwType: DWORD, + lpData: LPCVOID, + cbData: DWORD, + ) -> LSTATUS; + pub fn RegSetKeyValueW( + hKey: HKEY, + lpSubKey: LPCWSTR, + lpValueName: LPCWSTR, + dwType: DWORD, + lpData: LPCVOID, + cbData: DWORD, + ) -> LSTATUS; + pub fn RegDeleteTreeA( + hKey: HKEY, + lpSubKey: LPCSTR, + ) -> LSTATUS; + pub fn RegDeleteTreeW( + hKey: HKEY, + lpSubKey: LPCWSTR, + ) -> LSTATUS; + pub fn RegCopyTreeA( + hKeySrc: HKEY, + lpSubKey: LPCSTR, + hKeyDest: HKEY, + ) -> LSTATUS; + pub fn RegGetValueA( + hkey: HKEY, + lpSubKey: LPCSTR, + lpValue: LPCSTR, + dwFlags: DWORD, + pdwType: LPDWORD, + pvData: PVOID, + pcbData: LPDWORD, + ) -> LSTATUS; + pub fn RegGetValueW( + hkey: HKEY, + lpSubKey: LPCWSTR, + lpValue: LPCWSTR, + dwFlags: DWORD, + pdwType: LPDWORD, + pvData: PVOID, + pcbData: LPDWORD, + ) -> LSTATUS; + pub fn RegCopyTreeW( + hKeySrc: HKEY, + lpSubKey: LPCWSTR, + hKeyDest: HKEY, + ) -> LSTATUS; + pub fn RegLoadMUIStringA( + hKey: HKEY, + pszValue: LPCSTR, + pszOutBuf: LPSTR, + cbOutBuf: DWORD, + pcbData: LPDWORD, + Flags: DWORD, + pszDirectory: LPCSTR, + ) -> LSTATUS; + pub fn RegLoadMUIStringW( + hKey: HKEY, + pszValue: LPCWSTR, + pszOutBuf: LPWSTR, + cbOutBuf: DWORD, + pcbData: LPDWORD, + Flags: DWORD, + pszDirectory: LPCWSTR, + ) -> LSTATUS; + pub fn RegLoadAppKeyA( + lpFile: LPCSTR, + phkResult: PHKEY, + samDesired: REGSAM, + dwOptions: DWORD, + Reserved: DWORD, + ) -> LSTATUS; + pub fn RegLoadAppKeyW( + lpFile: LPCWSTR, + phkResult: PHKEY, + samDesired: REGSAM, + dwOptions: DWORD, + Reserved: DWORD, + ) -> LSTATUS; + pub fn InitiateSystemShutdownA( + lpMachineName: LPSTR, + lpMessage: LPSTR, + dwTimeout: DWORD, + bForceAppsClosed: BOOL, + bRebootAfterShutdown: BOOL, + ) -> BOOL; + pub fn InitiateSystemShutdownW( + lpMachineName: LPWSTR, + lpMessage: LPWSTR, + dwTimeout: DWORD, + bForceAppsClosed: BOOL, + bRebootAfterShutdown: BOOL, + ) -> BOOL; + pub fn AbortSystemShutdownA( + lpMachineName: LPSTR, + ) -> BOOL; + pub fn AbortSystemShutdownW( + lpMachineName: LPWSTR, + ) -> BOOL; +} +pub const REASON_SWINSTALL: DWORD = SHTDN_REASON_MAJOR_SOFTWARE | SHTDN_REASON_MINOR_INSTALLATION; +pub const REASON_HWINSTALL: DWORD = SHTDN_REASON_MAJOR_HARDWARE | SHTDN_REASON_MINOR_INSTALLATION; +pub const REASON_SERVICEHANG: DWORD = SHTDN_REASON_MAJOR_SOFTWARE | SHTDN_REASON_MINOR_HUNG; +pub const REASON_UNSTABLE: DWORD = SHTDN_REASON_MAJOR_SYSTEM | SHTDN_REASON_MINOR_UNSTABLE; +pub const REASON_SWHWRECONF: DWORD = SHTDN_REASON_MAJOR_SOFTWARE | SHTDN_REASON_MINOR_RECONFIG; +pub const REASON_OTHER: DWORD = SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER; +pub const REASON_UNKNOWN: DWORD = SHTDN_REASON_UNKNOWN; +pub const REASON_LEGACY_API: DWORD = SHTDN_REASON_LEGACY_API; +pub const REASON_PLANNED_FLAG: DWORD = SHTDN_REASON_FLAG_PLANNED; +pub const MAX_SHUTDOWN_TIMEOUT: DWORD = 10 * 365 * 24 * 60 * 60; +extern "system" { + pub fn InitiateSystemShutdownExA( + lpMachineName: LPSTR, + lpMessage: LPSTR, + dwTimeout: DWORD, + bForceAppsClosed: BOOL, + bRebootAfterShutdown: BOOL, + dwReason: DWORD, + ) -> BOOL; + pub fn InitiateSystemShutdownExW( + lpMachineName: LPWSTR, + lpMessage: LPWSTR, + dwTimeout: DWORD, + bForceAppsClosed: BOOL, + bRebootAfterShutdown: BOOL, + dwReason: DWORD, + ) -> BOOL; +} +pub const SHUTDOWN_FORCE_OTHERS: DWORD = 0x00000001; +pub const SHUTDOWN_FORCE_SELF: DWORD = 0x00000002; +pub const SHUTDOWN_RESTART: DWORD = 0x00000004; +pub const SHUTDOWN_POWEROFF: DWORD = 0x00000008; +pub const SHUTDOWN_NOREBOOT: DWORD = 0x00000010; +pub const SHUTDOWN_GRACE_OVERRIDE: DWORD = 0x00000020; +pub const SHUTDOWN_INSTALL_UPDATES: DWORD = 0x00000040; +pub const SHUTDOWN_RESTARTAPPS: DWORD = 0x00000080; +pub const SHUTDOWN_SKIP_SVC_PRESHUTDOWN: DWORD = 0x00000100; +pub const SHUTDOWN_HYBRID: DWORD = 0x00000200; +pub const SHUTDOWN_RESTART_BOOTOPTIONS: DWORD = 0x00000400; +pub const SHUTDOWN_SOFT_REBOOT: DWORD = 0x00000800; +pub const SHUTDOWN_MOBILE_UI: DWORD = 0x00001000; +pub const SHUTDOWN_ARSO: DWORD = 0x00002000; +extern "system" { + pub fn InitiateShutdownA( + lpMachineName: LPSTR, + lpMessage: LPSTR, + dwGracePeriod: DWORD, + dwShutdownFlags: DWORD, + dwReason: DWORD, + ) -> DWORD; + pub fn InitiateShutdownW( + lpMachineName: LPWSTR, + lpMessage: LPWSTR, + dwGracePeriod: DWORD, + dwShutdownFlags: DWORD, + dwReason: DWORD, + ) -> DWORD; + pub fn CheckForHiberboot( + pHiberboot: PBOOLEAN, + bClearFlag: BOOLEAN, + ) -> DWORD; + pub fn RegSaveKeyExA( + hKey: HKEY, + lpFile: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + Flags: DWORD, + ) -> LSTATUS; + pub fn RegSaveKeyExW( + hKey: HKEY, + lpFile: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + Flags: DWORD, + ) -> LSTATUS; +} diff --git a/bash-5.1/vendor/winapi/src/um/winsafer.rs b/bash-5.1/vendor/winapi/src/um/winsafer.rs new file mode 100644 index 0000000000000000000000000000000000000000..9607b6772c8c0ea92d02e83d2cf8aa6c79d1deb7 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winsafer.rs @@ -0,0 +1,228 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{SIZE_T, ULONG64}; +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, BYTE, DWORD, FILETIME, LPBYTE, LPDWORD, LPVOID, PDWORD}; +use shared::windef::HWND; +use um::wincrypt::ALG_ID; +use um::winnt::{BOOLEAN, HANDLE, LARGE_INTEGER, LPCWSTR, PHANDLE, PVOID, PWCHAR, WCHAR}; +DECLARE_HANDLE!{SAFER_LEVEL_HANDLE, __SAFER_LEVEL_HANDLE} +pub const SAFER_SCOPEID_MACHINE: DWORD = 1; +pub const SAFER_SCOPEID_USER: DWORD = 2; +pub const SAFER_LEVELID_DISALLOWED: DWORD = 0x00000; +pub const SAFER_LEVELID_UNTRUSTED: DWORD = 0x01000; +pub const SAFER_LEVELID_CONSTRAINED: DWORD = 0x10000; +pub const SAFER_LEVELID_NORMALUSER: DWORD = 0x20000; +pub const SAFER_LEVELID_FULLYTRUSTED: DWORD = 0x40000; +pub const SAFER_LEVEL_OPEN: DWORD = 1; +pub const SAFER_MAX_FRIENDLYNAME_SIZE: SIZE_T = 256; +pub const SAFER_MAX_DESCRIPTION_SIZE: SIZE_T = 256; +pub const SAFER_MAX_HASH_SIZE: SIZE_T = 64; +pub const SAFER_TOKEN_NULL_IF_EQUAL: DWORD = 0x00000001; +pub const SAFER_TOKEN_COMPARE_ONLY: DWORD = 0x00000002; +pub const SAFER_TOKEN_MAKE_INERT: DWORD = 0x00000004; +pub const SAFER_TOKEN_WANT_FLAGS: DWORD = 0x00000008; +pub const SAFER_CRITERIA_IMAGEPATH: DWORD = 0x00001; +pub const SAFER_CRITERIA_NOSIGNEDHASH: DWORD = 0x00002; +pub const SAFER_CRITERIA_IMAGEHASH: DWORD = 0x00004; +pub const SAFER_CRITERIA_AUTHENTICODE: DWORD = 0x00008; +pub const SAFER_CRITERIA_URLZONE: DWORD = 0x00010; +pub const SAFER_CRITERIA_APPX_PACKAGE: DWORD = 0x00020; +pub const SAFER_CRITERIA_IMAGEPATH_NT: DWORD = 0x01000; +STRUCT!{struct SAFER_CODE_PROPERTIES_V1 { + cbSize: DWORD, + dwCheckFlags: DWORD, + ImagePath: LPCWSTR, + hImageFileHandle: HANDLE, + UrlZoneId: DWORD, + ImageHash: [BYTE; SAFER_MAX_HASH_SIZE], + dwImageHashSize: DWORD, + ImageSize: LARGE_INTEGER, + HashAlgorithm: ALG_ID, + pByteBlock: LPBYTE, + hWndParent: HWND, + dwWVTUIChoice: DWORD, +}} +pub type PSAFER_CODE_PROPERTIES_V1 = *mut SAFER_CODE_PROPERTIES_V1; +STRUCT!{struct SAFER_CODE_PROPERTIES_V2 { + cbSize: DWORD, + dwCheckFlags: DWORD, + ImagePath: LPCWSTR, + hImageFileHandle: HANDLE, + UrlZoneId: DWORD, + ImageHash: [BYTE; SAFER_MAX_HASH_SIZE], + dwImageHashSize: DWORD, + ImageSize: LARGE_INTEGER, + HashAlgorithm: ALG_ID, + pByteBlock: LPBYTE, + hWndParent: HWND, + dwWVTUIChoice: DWORD, + PackageMoniker: LPCWSTR, + PackagePublisher: LPCWSTR, + PackageName: LPCWSTR, + PackageVersion: ULONG64, + PackageIsFramework: BOOL, +}} +pub type PSAFER_CODE_PROPERTIES_V2 = *mut SAFER_CODE_PROPERTIES_V2; +pub type SAFER_CODE_PROPERTIES = SAFER_CODE_PROPERTIES_V2; +pub type PSAFER_CODE_PROPERTIES = *mut SAFER_CODE_PROPERTIES; +pub const SAFER_POLICY_JOBID_MASK: DWORD = 0xFF000000; +pub const SAFER_POLICY_JOBID_CONSTRAINED: DWORD = 0x04000000; +pub const SAFER_POLICY_JOBID_UNTRUSTED: DWORD = 0x03000000; +pub const SAFER_POLICY_ONLY_EXES: DWORD = 0x00010000; +pub const SAFER_POLICY_SANDBOX_INERT: DWORD = 0x00020000; +pub const SAFER_POLICY_HASH_DUPLICATE: DWORD = 0x00040000; +pub const SAFER_POLICY_ONLY_AUDIT: DWORD = 0x00001000; +pub const SAFER_POLICY_BLOCK_CLIENT_UI: DWORD = 0x00002000; +pub const SAFER_POLICY_UIFLAGS_MASK: DWORD = 0x000000FF; +pub const SAFER_POLICY_UIFLAGS_INFORMATION_PROMPT: DWORD = 0x00000001; +pub const SAFER_POLICY_UIFLAGS_OPTION_PROMPT: DWORD = 0x00000002; +pub const SAFER_POLICY_UIFLAGS_HIDDEN: DWORD = 0x00000004; +ENUM!{enum SAFER_POLICY_INFO_CLASS { + SaferPolicyLevelList = 1, + SaferPolicyEnableTransparentEnforcement, + SaferPolicyDefaultLevel, + SaferPolicyEvaluateUserScope, + SaferPolicyScopeFlags, + SaferPolicyDefaultLevelFlags, + SaferPolicyAuthenticodeEnabled, +}} +ENUM!{enum SAFER_OBJECT_INFO_CLASS { + SaferObjectLevelId = 1, + SaferObjectScopeId, + SaferObjectFriendlyName, + SaferObjectDescription, + SaferObjectBuiltin, + SaferObjectDisallowed, + SaferObjectDisableMaxPrivilege, + SaferObjectInvertDeletedPrivileges, + SaferObjectDeletedPrivileges, + SaferObjectDefaultOwner, + SaferObjectSidsToDisable, + SaferObjectRestrictedSidsInverted, + SaferObjectRestrictedSidsAdded, + SaferObjectAllIdentificationGuids, + SaferObjectSingleIdentification, + SaferObjectExtendedError, +}} +ENUM!{enum SAFER_IDENTIFICATION_TYPES { + SaferIdentityDefault, + SaferIdentityTypeImageName = 1, + SaferIdentityTypeImageHash, + SaferIdentityTypeUrlZone, + SaferIdentityTypeCertificate, +}} +STRUCT!{struct SAFER_IDENTIFICATION_HEADER { + dwIdentificationType: SAFER_IDENTIFICATION_TYPES, + cbStructSize: DWORD, + IdentificationGuid: GUID, + lastModified: FILETIME, +}} +pub type PSAFER_IDENTIFICATION_HEADER = *mut SAFER_IDENTIFICATION_HEADER; +STRUCT!{struct SAFER_PATHNAME_IDENTIFICATION { + header: SAFER_IDENTIFICATION_HEADER, + Description: [WCHAR; SAFER_MAX_DESCRIPTION_SIZE], + ImageName: PWCHAR, + dwSaferFlags: DWORD, +}} +pub type PSAFER_PATHNAME_IDENTIFICATION = *mut SAFER_PATHNAME_IDENTIFICATION; +STRUCT!{struct SAFER_HASH_IDENTIFICATION { + header: SAFER_IDENTIFICATION_HEADER, + Description: [WCHAR; SAFER_MAX_DESCRIPTION_SIZE], + FriendlyName: [WCHAR; SAFER_MAX_DESCRIPTION_SIZE], + HashSize: DWORD, + ImageHash: [BYTE; SAFER_MAX_HASH_SIZE], + HashAlgorithm: ALG_ID, + ImageSize: LARGE_INTEGER, + dwSaferFlags: DWORD, +}} +pub type PSAFER_HASH_IDENTIFICATION = *mut SAFER_HASH_IDENTIFICATION; +STRUCT!{struct SAFER_HASH_IDENTIFICATION2 { + hashIdentification: SAFER_HASH_IDENTIFICATION, + HashSize: DWORD, + ImageHash: [BYTE; SAFER_MAX_HASH_SIZE], + HashAlgorithm: ALG_ID, +}} +pub type PSAFER_HASH_IDENTIFICATION2 = *mut SAFER_HASH_IDENTIFICATION2; +STRUCT!{struct SAFER_URLZONE_IDENTIFICATION { + header: SAFER_IDENTIFICATION_HEADER, + UrlZoneId: DWORD, + dwSaferFlags: DWORD, +}} +pub type PSAFER_URLZONE_IDENTIFICATION = *mut SAFER_URLZONE_IDENTIFICATION; +extern "system" { + pub fn SaferGetPolicyInformation( + dwScopeId: DWORD, + SaferPolicyInfoClass: SAFER_POLICY_INFO_CLASS, + InfoBufferSize: DWORD, + InfoBuffer: PVOID, + InfoBufferRetSize: PDWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn SaferSetPolicyInformation( + dwScopeId: DWORD, + SaferPolicyInfoClass: SAFER_POLICY_INFO_CLASS, + InfoBufferSize: DWORD, + InfoBuffer: PVOID, + lpReserved: LPVOID, + ) -> BOOL; + pub fn SaferCreateLevel( + dwScopeId: DWORD, + dwLevelId: DWORD, + OpenFlags: DWORD, + pLevelHandle: *mut SAFER_LEVEL_HANDLE, + lpReserved: LPVOID, + ) -> BOOL; + pub fn SaferCloseLevel( + hLevelHandle: SAFER_LEVEL_HANDLE, + ) -> BOOL; + pub fn SaferIdentifyLevel( + dwNumProperties: DWORD, + pCodeProperties: PSAFER_CODE_PROPERTIES, + pLevelHandle: *mut SAFER_LEVEL_HANDLE, + lpReserved: LPVOID, + ) -> BOOL; + pub fn SaferComputeTokenFromLevel( + LevelHandle: SAFER_LEVEL_HANDLE, + InAccessToken: HANDLE, + OutAccessToken: PHANDLE, + dwFlags: DWORD, + lpReserved: LPVOID, + ) -> BOOL; + pub fn SaferGetLevelInformation( + LevelHandle: SAFER_LEVEL_HANDLE, + dwInfoType: SAFER_OBJECT_INFO_CLASS, + lpQueryBuffer: LPVOID, + dwInBufferSize: DWORD, + lpdwOutBufferSize: LPDWORD, + ) -> BOOL; + pub fn SaferSetLevelInformation( + LevelHandle: SAFER_LEVEL_HANDLE, + dwInfoType: SAFER_OBJECT_INFO_CLASS, + lpQueryBuffer: LPVOID, + dwInBufferSize: DWORD, + ) -> BOOL; + pub fn SaferRecordEventLogEntry( + hLevel: SAFER_LEVEL_HANDLE, + szTargetPath: LPCWSTR, + lpReserved: LPVOID, + ) -> BOOL; + pub fn SaferiIsExecutableFileType( + szFullPath: LPCWSTR, + bFromShellExecute: BOOLEAN, + ) -> BOOL; +} +pub const SRP_POLICY_EXE: &'static str = "EXE"; +pub const SRP_POLICY_DLL: &'static str = "DLL"; +pub const SRP_POLICY_MSI: &'static str = "MSI"; +pub const SRP_POLICY_SCRIPT: &'static str = "SCRIPT"; +pub const SRP_POLICY_SHELL: &'static str = "SHELL"; +pub const SRP_POLICY_NOV2: &'static str = "IGNORESRPV2"; +pub const SRP_POLICY_APPX: &'static str = "APPX"; +pub const SRP_POLICY_WLDPMSI: &'static str = "WLDPMSI"; +pub const SRP_POLICY_WLDPSCRIPT: &'static str = "WLDPSCRIPT"; +pub const SRP_POLICY_WLDPCONFIGCI: &'static str = "WLDPCONFIGCI"; +pub const SRP_POLICY_MANAGEDINSTALLER: &'static str = "MANAGEDINSTALLER"; diff --git a/bash-5.1/vendor/winapi/src/um/winscard.rs b/bash-5.1/vendor/winapi/src/um/winscard.rs new file mode 100644 index 0000000000000000000000000000000000000000..5adaec7747b58c8f6792fddcaf22246df8fbc3d8 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winscard.rs @@ -0,0 +1,709 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Data Protection API Prototypes and Definitions +// This header file provides the definitions and symbols necessary for an +// Application or Smart Card Service Provider to access the Smartcard Subsystem. +use shared::basetsd::ULONG_PTR; +use shared::guiddef::{LPCGUID, LPGUID}; +use shared::minwindef::{BOOL, BYTE, DWORD, LPBYTE, LPCVOID, LPDWORD, LPVOID, PBYTE}; +use shared::rpcdce::UUID; +use shared::windef::{HICON, HWND}; +use um::winnt::{CHAR, HANDLE, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PVOID, WCHAR}; +use um::winsmcrd::{LPCSCARD_IO_REQUEST, LPSCARD_IO_REQUEST}; +pub type LPCBYTE = *const BYTE; +pub type SCARDCONTEXT = ULONG_PTR; +pub type PSCARDCONTEXT = *mut SCARDCONTEXT; +pub type LPSCARDCONTEXT = *mut SCARDCONTEXT; +pub type SCARDHANDLE = ULONG_PTR; +pub type PSCARDHANDLE = *mut SCARDHANDLE; +pub type LPSCARDHANDLE = *mut SCARDHANDLE; +pub const SCARD_AUTOALLOCATE: DWORD = -1i32 as u32; +pub const SCARD_SCOPE_USER: DWORD = 0; +pub const SCARD_SCOPE_TERMINAL: DWORD = 1; +pub const SCARD_SCOPE_SYSTEM: DWORD = 2; +extern "system" { + pub fn SCardEstablishContext( + dwScope: DWORD, + pvReserved1: LPCVOID, + pvReserved2: LPCVOID, + phContext: LPSCARDCONTEXT, + ) -> LONG; + pub fn SCardReleaseContext( + hContext: SCARDCONTEXT, + ) -> LONG; + pub fn SCardIsValidContext( + hContext: SCARDCONTEXT, + ) -> LONG; +} +pub const SCARD_PROVIDER_PRIMARY: DWORD = 1; +pub const SCARD_PROVIDER_CSP: DWORD = 2; +pub const SCARD_PROVIDER_KSP: DWORD = 3; +extern "system" { + pub fn SCardListReaderGroupsA( + hContext: SCARDCONTEXT, + mszGroups: LPSTR, + pcchGroups: LPDWORD, + ) -> LONG; + pub fn SCardListReaderGroupsW( + hContext: SCARDCONTEXT, + mszGroups: LPWSTR, + pcchGroups: LPDWORD, + ) -> LONG; + pub fn SCardListReadersA( + hContext: SCARDCONTEXT, + mszGroups: LPCSTR, + mszReaders: LPSTR, + pcchReaders: LPDWORD, + ) -> LONG; + pub fn SCardListReadersW( + hContext: SCARDCONTEXT, + mszGroups: LPCWSTR, + mszReaders: LPWSTR, + pcchReaders: LPDWORD, + ) -> LONG; + pub fn SCardListCardsA( + hContext: SCARDCONTEXT, + pbAtr: LPCBYTE, + rgquidInterfaces: LPCGUID, + cguidInterfaceCount: DWORD, + mszCards: *mut CHAR, + pcchCards: LPDWORD, + ) -> LONG; + pub fn SCardListCardsW( + hContext: SCARDCONTEXT, + pbAtr: LPCBYTE, + rgquidInterfaces: LPCGUID, + cguidInterfaceCount: DWORD, + mszCards: *mut WCHAR, + pcchCards: LPDWORD, + ) -> LONG; + pub fn SCardListInterfacesA( + hContext: SCARDCONTEXT, + szCard: LPCSTR, + pguidInterfaces: LPGUID, + pcguidInterfaces: LPDWORD, + ) -> LONG; + pub fn SCardListInterfacesW( + hContext: SCARDCONTEXT, + szCard: LPCWSTR, + pguidInterfaces: LPGUID, + pcguidInterfaces: LPDWORD, + ) -> LONG; + pub fn SCardGetProviderIdA( + hContext: SCARDCONTEXT, + szCard: LPCSTR, + pguidProviderId: LPGUID, + ) -> LONG; + pub fn SCardGetProviderIdW( + hContext: SCARDCONTEXT, + szCard: LPCWSTR, + pguidProviderId: LPGUID, + ) -> LONG; + pub fn SCardGetCardTypeProviderNameA( + hContext: SCARDCONTEXT, + szCardName: LPCSTR, + dwProviderId: DWORD, + szProvider: *mut CHAR, + pcchProvider: LPDWORD, + ) -> LONG; + pub fn SCardGetCardTypeProviderNameW( + hContext: SCARDCONTEXT, + szCardName: LPCWSTR, + dwProviderId: DWORD, + szProvider: *mut WCHAR, + pcchProvider: LPDWORD, + ) -> LONG; + pub fn SCardIntroduceReaderGroupA( + hContext: SCARDCONTEXT, + szGroupName: LPCSTR, + ) -> LONG; + pub fn SCardIntroduceReaderGroupW( + hContext: SCARDCONTEXT, + szGroupName: LPCWSTR, + ) -> LONG; + pub fn SCardForgetReaderGroupA( + hContext: SCARDCONTEXT, + szGroupName: LPCSTR, + ) -> LONG; + pub fn SCardForgetReaderGroupW( + hContext: SCARDCONTEXT, + szGroupName: LPCWSTR, + ) -> LONG; + pub fn SCardIntroduceReaderA( + hContext: SCARDCONTEXT, + szReaderName: LPCSTR, + szDeviceName: LPCSTR, + ) -> LONG; + pub fn SCardIntroduceReaderW( + hContext: SCARDCONTEXT, + szReaderName: LPCWSTR, + szDeviceName: LPCWSTR, + ) -> LONG; + pub fn SCardForgetReaderA( + hContext: SCARDCONTEXT, + szReaderName: LPCSTR, + ) -> LONG; + pub fn SCardForgetReaderW( + hContext: SCARDCONTEXT, + szReaderName: LPCWSTR, + ) -> LONG; + pub fn SCardAddReaderToGroupA( + hContext: SCARDCONTEXT, + szReaderName: LPCSTR, + szGroupName: LPCSTR, + ) -> LONG; + pub fn SCardAddReaderToGroupW( + hContext: SCARDCONTEXT, + szReaderName: LPCWSTR, + szGroupName: LPCWSTR, + ) -> LONG; + pub fn SCardRemoveReaderFromGroupA( + hContext: SCARDCONTEXT, + szReaderName: LPCSTR, + szGroupName: LPCSTR, + ) -> LONG; + pub fn SCardRemoveReaderFromGroupW( + hContext: SCARDCONTEXT, + szReaderName: LPCWSTR, + szGroupName: LPCWSTR, + ) -> LONG; + pub fn SCardIntroduceCardTypeA( + hContext: SCARDCONTEXT, + szCardName: LPCSTR, + pguidPrimaryProvider: LPCGUID, + rgguidInterfaces: LPCGUID, + dwInterfaceCount: DWORD, + pbAtr: LPCBYTE, + pbAtrMask: LPCBYTE, + cbAtrLen: DWORD, + ) -> LONG; + pub fn SCardIntroduceCardTypeW( + hContext: SCARDCONTEXT, + szCardName: LPCWSTR, + pguidPrimaryProvider: LPCGUID, + rgguidInterfaces: LPCGUID, + dwInterfaceCount: DWORD, + pbAtr: LPCBYTE, + pbAtrMask: LPCBYTE, + cbAtrLen: DWORD, + ) -> LONG; + pub fn SCardSetCardTypeProviderNameA( + hContext: SCARDCONTEXT, + szCardName: LPCSTR, + dwProviderId: DWORD, + szProvider: LPCSTR, + ) -> LONG; + pub fn SCardSetCardTypeProviderNameW( + hContext: SCARDCONTEXT, + szCardName: LPCWSTR, + dwProviderId: DWORD, + szProvider: LPCWSTR, + ) -> LONG; + pub fn SCardForgetCardTypeA( + hContext: SCARDCONTEXT, + szCardName: LPCSTR, + ) -> LONG; + pub fn SCardForgetCardTypeW( + hContext: SCARDCONTEXT, + szCardName: LPCWSTR, + ) -> LONG; + pub fn SCardFreeMemory( + hContext: SCARDCONTEXT, + pvMem: LPCVOID, + ) -> LONG; + pub fn SCardAccessStartedEvent() -> HANDLE; + pub fn SCardReleaseStartedEvent(); +} +STRUCT!{struct SCARD_READERSTATEA { + szReader: LPCSTR, + pvUserData: LPVOID, + dwCurrentState: DWORD, + dwEventState: DWORD, + cbAtr: DWORD, + rgbAtr: [BYTE; 36], +}} +pub type PSCARD_READERSTATEA = *mut SCARD_READERSTATEA; +pub type LPSCARD_READERSTATEA = *mut SCARD_READERSTATEA; +STRUCT!{struct SCARD_READERSTATEW { + szReader: LPCWSTR, + pvUserData: LPVOID, + dwCurrentState: DWORD, + dwEventState: DWORD, + cbAtr: DWORD, + rgbAtr: [BYTE; 36], +}} +pub type PSCARD_READERSTATEW = *mut SCARD_READERSTATEW; +pub type LPSCARD_READERSTATEW = *mut SCARD_READERSTATEW; +pub type SCARD_READERSTATE_A = SCARD_READERSTATEA; +pub type SCARD_READERSTATE_W = SCARD_READERSTATEW; +pub type PSCARD_READERSTATE_A = PSCARD_READERSTATEA; +pub type PSCARD_READERSTATE_W = PSCARD_READERSTATEW; +pub type LPSCARD_READERSTATE_A = LPSCARD_READERSTATEA; +pub type LPSCARD_READERSTATE_W = LPSCARD_READERSTATEW; +pub const SCARD_STATE_UNAWARE: DWORD = 0x00000000; +pub const SCARD_STATE_IGNORE: DWORD = 0x00000001; +pub const SCARD_STATE_CHANGED: DWORD = 0x00000002; +pub const SCARD_STATE_UNKNOWN: DWORD = 0x00000004; +pub const SCARD_STATE_UNAVAILABLE: DWORD = 0x00000008; +pub const SCARD_STATE_EMPTY: DWORD = 0x00000010; +pub const SCARD_STATE_PRESENT: DWORD = 0x00000020; +pub const SCARD_STATE_ATRMATCH: DWORD = 0x00000040; +pub const SCARD_STATE_EXCLUSIVE: DWORD = 0x00000080; +pub const SCARD_STATE_INUSE: DWORD = 0x00000100; +pub const SCARD_STATE_MUTE: DWORD = 0x00000200; +pub const SCARD_STATE_UNPOWERED: DWORD = 0x00000400; +extern "system" { + pub fn SCardLocateCardsA( + hContext: SCARDCONTEXT, + mszCards: LPCSTR, + rgReaderStates: LPSCARD_READERSTATEA, + cReaders: DWORD, + ) -> LONG; + pub fn SCardLocateCardsW( + hContext: SCARDCONTEXT, + mszCards: LPCWSTR, + rgReaderStates: LPSCARD_READERSTATEW, + cReaders: DWORD, + ) -> LONG; +} +STRUCT!{struct SCARD_ATRMASK { + cbAtr: DWORD, + rgbAtr: [BYTE; 36], + rgbMask: [BYTE; 36], +}} +pub type PSCARD_ATRMASK = *mut SCARD_ATRMASK; +pub type LPSCARD_ATRMASK = *mut SCARD_ATRMASK; +extern "system" { + pub fn SCardLocateCardsByATRA( + hContext: SCARDCONTEXT, + rgAtrMasks: LPSCARD_ATRMASK, + cAtrs: DWORD, + rgReaderStates: LPSCARD_READERSTATEA, + cReaders: DWORD, + ) -> LONG; + pub fn SCardLocateCardsByATRW( + hContext: SCARDCONTEXT, + rgAtrMasks: LPSCARD_ATRMASK, + cAtrs: DWORD, + rgReaderStates: LPSCARD_READERSTATEW, + cReaders: DWORD, + ) -> LONG; + pub fn SCardGetStatusChangeA( + hContext: SCARDCONTEXT, + dwTimeout: DWORD, + rgReaderStates: LPSCARD_READERSTATEA, + cReaders: DWORD, + ) -> LONG; + pub fn SCardGetStatusChangeW( + hContext: SCARDCONTEXT, + dwTimeout: DWORD, + rgReaderStates: LPSCARD_READERSTATEW, + cReaders: DWORD, + ) -> LONG; + pub fn SCardCancel( + hContext: SCARDCONTEXT, + ) -> LONG; +} +pub const SCARD_SHARE_EXCLUSIVE: DWORD = 1; +pub const SCARD_SHARE_SHARED: DWORD = 2; +pub const SCARD_SHARE_DIRECT: DWORD = 3; +pub const SCARD_LEAVE_CARD: DWORD = 0; +pub const SCARD_RESET_CARD: DWORD = 1; +pub const SCARD_UNPOWER_CARD: DWORD = 2; +pub const SCARD_EJECT_CARD: DWORD = 3; +extern "system" { + pub fn SCardConnectA( + hContext: SCARDCONTEXT, + szReader: LPCSTR, + dwShareMode: DWORD, + dwPreferredProtocols: DWORD, + phCard: LPSCARDHANDLE, + pdwActiveProtocol: LPDWORD, + ) -> LONG; + pub fn SCardConnectW( + hContext: SCARDCONTEXT, + szReader: LPCWSTR, + dwShareMode: DWORD, + dwPreferredProtocols: DWORD, + phCard: LPSCARDHANDLE, + pdwActiveProtocol: LPDWORD, + ) -> LONG; + pub fn SCardReconnect( + hCard: SCARDHANDLE, + dwShareMode: DWORD, + dwPreferredProtocols: DWORD, + dwInitialization: DWORD, + pdwActiveProtocol: LPDWORD, + ) -> LONG; + pub fn SCardDisconnect( + hCard: SCARDHANDLE, + dwDisposition: DWORD, + ) -> LONG; + pub fn SCardBeginTransaction( + hCard: SCARDHANDLE, + ) -> LONG; + pub fn SCardEndTransaction( + hCard: SCARDHANDLE, + dwDisposition: DWORD, + ) -> LONG; + pub fn SCardState( + hCard: SCARDHANDLE, + pdwState: LPDWORD, + pdwProtocol: LPDWORD, + pbAtr: LPBYTE, + pcbAtrLen: LPDWORD, + ) -> LONG; + pub fn SCardStatusA( + hCard: SCARDHANDLE, + mszReaderNames: LPSTR, + pcchReaderLen: LPDWORD, + pdwState: LPDWORD, + pdwProtocol: LPDWORD, + pbAtr: LPBYTE, + pcbAtrLen: LPDWORD, + ) -> LONG; + pub fn SCardStatusW( + hCard: SCARDHANDLE, + mszReaderNames: LPWSTR, + pcchReaderLen: LPDWORD, + pdwState: LPDWORD, + pdwProtocol: LPDWORD, + pbAtr: LPBYTE, + pcbAtrLen: LPDWORD, + ) -> LONG; + pub fn SCardTransmit( + hCard: SCARDHANDLE, + pioSendPci: LPCSCARD_IO_REQUEST, + pbSendBuffer: LPCBYTE, + cbSendLength: DWORD, + pioRecvPci: LPSCARD_IO_REQUEST, + pbRecvBuffer: LPBYTE, + pcbRecvLength: LPDWORD, + ) -> LONG; + pub fn SCardGetTransmitCount( + hCard: SCARDHANDLE, + pcTransmitCount: LPDWORD, + ) -> LONG; + pub fn SCardControl( + hCard: SCARDHANDLE, + dwControlCode: DWORD, + lpInBuffer: LPCVOID, + cbInBufferSize: DWORD, + lpOutBuffer: LPVOID, + cbOutBufferSize: DWORD, + lpBytesReturned: LPDWORD, + ) -> LONG; + pub fn SCardGetAttrib( + hCard: SCARDHANDLE, + dwAttrId: DWORD, + pbAttr: LPBYTE, + pcbAttrLen: LPDWORD, + ) -> LONG; + pub fn SCardSetAttrib( + hCard: SCARDHANDLE, + dwAttrId: DWORD, + pbAttr: LPCBYTE, + cbAttrLen: DWORD, + ) -> LONG; +} +pub const SC_DLG_MINIMAL_UI: DWORD = 0x01; +pub const SC_DLG_NO_UI: DWORD = 0x02; +pub const SC_DLG_FORCE_UI: DWORD = 0x04; +pub const SCERR_NOCARDNAME: DWORD = 0x4000; +pub const SCERR_NOGUIDS: DWORD = 0x8000; +FN!{stdcall LPOCNCONNPROCA( + SCARDCONTEXT, + LPSTR, + LPSTR, + PVOID, +) -> SCARDHANDLE} +FN!{stdcall LPOCNCONNPROCW( + SCARDCONTEXT, + LPWSTR, + LPWSTR, + PVOID, +) -> SCARDHANDLE} +FN!{stdcall LPOCNCHKPROC( + SCARDCONTEXT, + SCARDHANDLE, + PVOID, +) -> BOOL} +FN!{stdcall LPOCNDSCPROC( + SCARDCONTEXT, + SCARDHANDLE, + PVOID, +) -> ()} +STRUCT!{struct OPENCARD_SEARCH_CRITERIAA { + dwStructSize: DWORD, + lpstrGroupNames: LPSTR, + nMaxGroupNames: DWORD, + rgguidInterfaces: LPCGUID, + cguidInterfaces: DWORD, + lpstrCardNames: LPSTR, + nMaxCardNames: DWORD, + lpfnCheck: LPOCNCHKPROC, + lpfnConnect: LPOCNCONNPROCA, + lpfnDisconnect: LPOCNDSCPROC, + pvUserData: LPVOID, + dwShareMode: DWORD, + dwPreferredProtocols: DWORD, +}} +pub type POPENCARD_SEARCH_CRITERIAA = *mut OPENCARD_SEARCH_CRITERIAA; +pub type LPOPENCARD_SEARCH_CRITERIAA = *mut OPENCARD_SEARCH_CRITERIAA; +STRUCT!{struct OPENCARD_SEARCH_CRITERIAW { + dwStructSize: DWORD, + lpstrGroupNames: LPWSTR, + nMaxGroupNames: DWORD, + rgguidInterfaces: LPCGUID, + cguidInterfaces: DWORD, + lpstrCardNames: LPWSTR, + nMaxCardNames: DWORD, + lpfnCheck: LPOCNCHKPROC, + lpfnConnect: LPOCNCONNPROCW, + lpfnDisconnect: LPOCNDSCPROC, + pvUserData: LPVOID, + dwShareMode: DWORD, + dwPreferredProtocols: DWORD, +}} +pub type POPENCARD_SEARCH_CRITERIAW = *mut OPENCARD_SEARCH_CRITERIAW; +pub type LPOPENCARD_SEARCH_CRITERIAW = *mut OPENCARD_SEARCH_CRITERIAW; +STRUCT!{struct OPENCARDNAME_EXA { + dwStructSize: DWORD, + hSCardContext: SCARDCONTEXT, + hwndOwner: HWND, + dwFlags: DWORD, + lpstrTitle: LPCSTR, + lpstrSearchDesc: LPCSTR, + hIcon: HICON, + pOpenCardSearchCriteria: POPENCARD_SEARCH_CRITERIAA, + lpfnConnect: LPOCNCONNPROCA, + pvUserData: LPVOID, + dwShareMode: DWORD, + dwPreferredProtocols: DWORD, + lpstrRdr: LPSTR, + nMaxRdr: DWORD, + lpstrCard: LPSTR, + nMaxCard: DWORD, + dwActiveProtocol: DWORD, + hCardHandle: SCARDHANDLE, +}} +pub type POPENCARDNAME_EXA = *mut OPENCARDNAME_EXA; +pub type LPOPENCARDNAME_EXA = *mut OPENCARDNAME_EXA; +STRUCT!{struct OPENCARDNAME_EXW { + dwStructSize: DWORD, + hSCardContext: SCARDCONTEXT, + hwndOwner: HWND, + dwFlags: DWORD, + lpstrTitle: LPCWSTR, + lpstrSearchDesc: LPCWSTR, + hIcon: HICON, + pOpenCardSearchCriteria: POPENCARD_SEARCH_CRITERIAW, + lpfnConnect: LPOCNCONNPROCW, + pvUserData: LPVOID, + dwShareMode: DWORD, + dwPreferredProtocols: DWORD, + lpstrRdr: LPWSTR, + nMaxRdr: DWORD, + lpstrCard: LPWSTR, + nMaxCard: DWORD, + dwActiveProtocol: DWORD, + hCardHandle: SCARDHANDLE, +}} +pub type POPENCARDNAME_EXW = *mut OPENCARDNAME_EXW; +pub type LPOPENCARDNAME_EXW = *mut OPENCARDNAME_EXW; +pub type OPENCARDNAMEA_EX = OPENCARDNAME_EXA; +pub type OPENCARDNAMEW_EX = OPENCARDNAME_EXW; +pub type POPENCARDNAMEA_EX = POPENCARDNAME_EXA; +pub type POPENCARDNAMEW_EX = POPENCARDNAME_EXW; +pub type LPOPENCARDNAMEA_EX = LPOPENCARDNAME_EXA; +pub type LPOPENCARDNAMEW_EX = LPOPENCARDNAME_EXW; +pub const SCARD_READER_SEL_AUTH_PACKAGE: DWORD = -629i32 as u32; +ENUM!{enum READER_SEL_REQUEST_MATCH_TYPE { + RSR_MATCH_TYPE_READER_AND_CONTAINER = 1, + RSR_MATCH_TYPE_SERIAL_NUMBER, + RSR_MATCH_TYPE_ALL_CARDS, +}} +STRUCT!{struct READER_SEL_REQUEST_ReaderAndContainerParameter { + cbReaderNameOffset: DWORD, + cchReaderNameLength: DWORD, + cbContainerNameOffset: DWORD, + cchContainerNameLength: DWORD, + dwDesiredCardModuleVersion: DWORD, + dwCspFlags: DWORD, +}} +STRUCT!{struct READER_SEL_REQUEST_SerialNumberParameter { + cbSerialNumberOffset: DWORD, + cbSerialNumberLength: DWORD, + dwDesiredCardModuleVersion: DWORD, +}} +UNION!{union READER_SEL_REQUEST_u { + [u32; 6], + ReaderAndContainerParameter ReaderAndContainerParameter_mut: + READER_SEL_REQUEST_ReaderAndContainerParameter, + SerialNumberParameter SerialNumberParameter_mut: READER_SEL_REQUEST_SerialNumberParameter, +}} +STRUCT!{struct READER_SEL_REQUEST { + dwShareMode: DWORD, + dwPreferredProtocols: DWORD, + MatchType: READER_SEL_REQUEST_MATCH_TYPE, + u: READER_SEL_REQUEST_u, +}} +pub type PREADER_SEL_REQUEST = *mut READER_SEL_REQUEST; +STRUCT!{struct READER_SEL_RESPONSE { + cbReaderNameOffset: DWORD, + cchReaderNameLength: DWORD, + cbCardNameOffset: DWORD, + cchCardNameLength: DWORD, +}} +pub type PREADER_SEL_RESPONSE = *mut READER_SEL_RESPONSE; +STRUCT!{struct OPENCARDNAMEA { + dwStructSize: DWORD, + hwndOwner: HWND, + hSCardContext: SCARDCONTEXT, + lpstrGroupNames: LPSTR, + nMaxGroupNames: DWORD, + lpstrCardNames: LPSTR, + nMaxCardNames: DWORD, + rgguidInterfaces: LPCGUID, + cguidInterfaces: DWORD, + lpstrRdr: LPSTR, + nMaxRdr: DWORD, + lpstrCard: LPSTR, + nMaxCard: DWORD, + lpstrTitle: LPCSTR, + dwFlags: DWORD, + pvUserData: LPVOID, + dwShareMode: DWORD, + dwPreferredProtocols: DWORD, + dwActiveProtocol: DWORD, + lpfnConnect: LPOCNCONNPROCA, + lpfnCheck: LPOCNCHKPROC, + lpfnDisconnect: LPOCNDSCPROC, + hCardHandle: SCARDHANDLE, +}} +pub type POPENCARDNAMEA = *mut OPENCARDNAMEA; +pub type LPOPENCARDNAMEA = *mut OPENCARDNAMEA; +STRUCT!{struct OPENCARDNAMEW { + dwStructSize: DWORD, + hwndOwner: HWND, + hSCardContext: SCARDCONTEXT, + lpstrGroupNames: LPWSTR, + nMaxGroupNames: DWORD, + lpstrCardNames: LPWSTR, + nMaxCardNames: DWORD, + rgguidInterfaces: LPCGUID, + cguidInterfaces: DWORD, + lpstrRdr: LPWSTR, + nMaxRdr: DWORD, + lpstrCard: LPWSTR, + nMaxCard: DWORD, + lpstrTitle: LPCWSTR, + dwFlags: DWORD, + pvUserData: LPVOID, + dwShareMode: DWORD, + dwPreferredProtocols: DWORD, + dwActiveProtocol: DWORD, + lpfnConnect: LPOCNCONNPROCW, + lpfnCheck: LPOCNCHKPROC, + lpfnDisconnect: LPOCNDSCPROC, + hCardHandle: SCARDHANDLE, +}} +pub type POPENCARDNAMEW = *mut OPENCARDNAMEW; +pub type LPOPENCARDNAMEW = *mut OPENCARDNAMEW; +pub type OPENCARDNAME_A = OPENCARDNAMEA; +pub type OPENCARDNAME_W = OPENCARDNAMEW; +pub type POPENCARDNAME_A = POPENCARDNAMEA; +pub type POPENCARDNAME_W = POPENCARDNAMEW; +pub type LPOPENCARDNAME_A = LPOPENCARDNAMEA; +pub type LPOPENCARDNAME_W = LPOPENCARDNAMEW; +extern "system" { + pub fn SCardReadCacheA( + hContext: SCARDCONTEXT, + CardIdentifier: *mut UUID, + FreshnessCounter: DWORD, + LookupName: LPSTR, + Data: PBYTE, + DataLen: *mut DWORD, + ) -> LONG; + pub fn SCardReadCacheW( + hContext: SCARDCONTEXT, + CardIdentifier: *mut UUID, + FreshnessCounter: DWORD, + LookupName: LPWSTR, + Data: PBYTE, + DataLen: *mut DWORD, + ) -> LONG; + pub fn SCardWriteCacheA( + hContext: SCARDCONTEXT, + CardIdentifier: *mut UUID, + FreshnessCounter: DWORD, + LookupName: LPSTR, + Data: PBYTE, + DataLen: DWORD, + ) -> LONG; + pub fn SCardWriteCacheW( + hContext: SCARDCONTEXT, + CardIdentifier: *mut UUID, + FreshnessCounter: DWORD, + LookupName: LPWSTR, + Data: PBYTE, + DataLen: DWORD, + ) -> LONG; + pub fn SCardGetReaderIconA( + hContext: SCARDCONTEXT, + szReaderName: LPCSTR, + pbIcon: LPBYTE, + pcbIcon: LPDWORD, + ) -> LONG; + pub fn SCardGetReaderIconW( + hContext: SCARDCONTEXT, + szReaderName: LPCWSTR, + pbIcon: LPBYTE, + pcbIcon: LPDWORD, + ) -> LONG; + pub fn SCardGetDeviceTypeIdA( + hContext: SCARDCONTEXT, + szReaderName: LPCSTR, + pdwDeviceTypeId: LPDWORD, + ) -> LONG; + pub fn SCardGetDeviceTypeIdW( + hContext: SCARDCONTEXT, + szReaderName: LPCWSTR, + pdwDeviceTypeId: LPDWORD, + ) -> LONG; + pub fn SCardGetReaderDeviceInstanceIdA( + hContext: SCARDCONTEXT, + szReaderName: LPCSTR, + szDeviceInstanceId: LPSTR, + pcchDeviceInstanceId: LPDWORD, + ) -> LONG; + pub fn SCardGetReaderDeviceInstanceIdW( + hContext: SCARDCONTEXT, + szReaderName: LPCWSTR, + szDeviceInstanceId: LPWSTR, + pcchDeviceInstanceId: LPDWORD, + ) -> LONG; + pub fn SCardListReadersWithDeviceInstanceIdA( + hContext: SCARDCONTEXT, + szDeviceInstanceId: LPCSTR, + mszReaders: LPSTR, + pcchReaders: LPDWORD, + ) -> LONG; + pub fn SCardListReadersWithDeviceInstanceIdW( + hContext: SCARDCONTEXT, + szDeviceInstanceId: LPCWSTR, + mszReaders: LPWSTR, + pcchReaders: LPDWORD, + ) -> LONG; +} +pub const SCARD_AUDIT_CHV_FAILURE: DWORD = 0x0; +pub const SCARD_AUDIT_CHV_SUCCESS: DWORD = 0x1; +extern "system" { + pub fn SCardAudit( + hContext: SCARDCONTEXT, + dwEvent: DWORD, + ) -> LONG; +} diff --git a/bash-5.1/vendor/winapi/src/um/winsmcrd.rs b/bash-5.1/vendor/winapi/src/um/winsmcrd.rs new file mode 100644 index 0000000000000000000000000000000000000000..227bf7b40587f26b2185ddda5966268f615db9e7 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winsmcrd.rs @@ -0,0 +1,166 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Smart Card class/port IOCTL codes. +use shared::minwindef::{BYTE, DWORD, ULONG, WORD}; +use um::winioctl::{FILE_ANY_ACCESS, FILE_DEVICE_SMARTCARD, METHOD_BUFFERED}; +pub type UWORD = WORD; +DEFINE_GUID!{GUID_DEVINTERFACE_SMARTCARD_READER, + 0x50DD5230, 0xBA8A, 0x11D1, 0xBF, 0x5D, 0x00, 0x00, 0xF8, 0x05, 0xF5, 0x30} +pub const SCARD_ATR_LENGTHL: DWORD = 33; +pub const SCARD_PROTOCOL_UNDEFINED: DWORD = 0x00000000; +pub const SCARD_PROTOCOL_T0: DWORD = 0x00000001; +pub const SCARD_PROTOCOL_T1: DWORD = 0x00000002; +pub const SCARD_PROTOCOL_RAW: DWORD = 0x00010000; +pub const SCARD_PROTOCOL_Tx: DWORD = SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1; +pub const SCARD_PROTOCOL_DEFAULT: DWORD = 0x80000000; +pub const SCARD_PROTOCOL_OPTIMAL: DWORD = 0x00000000; +pub const SCARD_POWER_DOWN: DWORD = 0; +pub const SCARD_COLD_RESET: DWORD = 1; +pub const SCARD_WARM_RESET: DWORD = 2; +pub const IOCTL_SMARTCARD_POWER: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 1, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_GET_ATTRIBUTE: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 2, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_SET_ATTRIBUTE: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 3, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_CONFISCATE: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 4, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_TRANSMIT: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 5, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_EJECT: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 6, METHOD_BUFFERED, + FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_SWALLOW: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 7, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_IS_PRESENT: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 10, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_IS_ABSENT: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 11, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_SET_PROTOCOL: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 12, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_GET_STATE: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 14, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_GET_LAST_ERROR: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 15, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const IOCTL_SMARTCARD_GET_PERF_CNTR: DWORD = CTL_CODE!(FILE_DEVICE_SMARTCARD, 16, + METHOD_BUFFERED, FILE_ANY_ACCESS); +pub const MAXIMUM_ATTR_STRING_LENGTH: DWORD = 32; +pub const MAXIMUM_SMARTCARD_READERS: DWORD = 10; +pub const SCARD_CLASS_VENDOR_INFO: ULONG = 1; +pub const SCARD_CLASS_COMMUNICATIONS: ULONG = 2; +pub const SCARD_CLASS_PROTOCOL: ULONG = 3; +pub const SCARD_CLASS_POWER_MGMT: ULONG = 4; +pub const SCARD_CLASS_SECURITY: ULONG = 5; +pub const SCARD_CLASS_MECHANICAL: ULONG = 6; +pub const SCARD_CLASS_VENDOR_DEFINED: ULONG = 7; +pub const SCARD_CLASS_IFD_PROTOCOL: ULONG = 8; +pub const SCARD_CLASS_ICC_STATE: ULONG = 9; +pub const SCARD_CLASS_PERF: ULONG = 0x7ffe; +pub const SCARD_CLASS_SYSTEM: ULONG = 0x7fff; +pub const SCARD_ATTR_VENDOR_NAME: ULONG = SCARD_CLASS_VENDOR_INFO << 16 | 0x0100; +pub const SCARD_ATTR_VENDOR_IFD_TYPE: ULONG = SCARD_CLASS_VENDOR_INFO << 16 | 0x0101; +pub const SCARD_ATTR_VENDOR_IFD_VERSION: ULONG = SCARD_CLASS_VENDOR_INFO << 16 | 0x0102; +pub const SCARD_ATTR_VENDOR_IFD_SERIAL_NO: ULONG = SCARD_CLASS_VENDOR_INFO << 16 | 0x0103; +pub const SCARD_ATTR_CHANNEL_ID: ULONG = SCARD_CLASS_COMMUNICATIONS << 16 | 0x0110; +pub const SCARD_ATTR_PROTOCOL_TYPES: ULONG = SCARD_CLASS_PROTOCOL << 16 | 0x0120; +pub const SCARD_ATTR_DEFAULT_CLK: ULONG = SCARD_CLASS_PROTOCOL << 16 | 0x0121; +pub const SCARD_ATTR_MAX_CLK: ULONG = SCARD_CLASS_PROTOCOL << 16 | 0x0122; +pub const SCARD_ATTR_DEFAULT_DATA_RATE: ULONG = SCARD_CLASS_PROTOCOL << 16 | 0x0123; +pub const SCARD_ATTR_MAX_DATA_RATE: ULONG = SCARD_CLASS_PROTOCOL << 16 | 0x0124; +pub const SCARD_ATTR_MAX_IFSD: ULONG = SCARD_CLASS_PROTOCOL << 16 | 0x0125; +pub const SCARD_ATTR_POWER_MGMT_SUPPORT: ULONG = SCARD_CLASS_POWER_MGMT << 16 | 0x0131; +pub const SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE: ULONG = SCARD_CLASS_SECURITY << 16 | 0x0140; +pub const SCARD_ATTR_USER_AUTH_INPUT_DEVICE: ULONG = SCARD_CLASS_SECURITY << 16 | 0x0142; +pub const SCARD_ATTR_CHARACTERISTICS: ULONG = SCARD_CLASS_MECHANICAL << 16 | 0x0150; +pub const SCARD_ATTR_CURRENT_PROTOCOL_TYPE: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x0201; +pub const SCARD_ATTR_CURRENT_CLK: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x0202; +pub const SCARD_ATTR_CURRENT_F: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x0203; +pub const SCARD_ATTR_CURRENT_D: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x0204; +pub const SCARD_ATTR_CURRENT_N: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x0205; +pub const SCARD_ATTR_CURRENT_W: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x0206; +pub const SCARD_ATTR_CURRENT_IFSC: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x0207; +pub const SCARD_ATTR_CURRENT_IFSD: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x0208; +pub const SCARD_ATTR_CURRENT_BWT: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x0209; +pub const SCARD_ATTR_CURRENT_CWT: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x020a; +pub const SCARD_ATTR_CURRENT_EBC_ENCODING: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x020b; +pub const SCARD_ATTR_EXTENDED_BWT: ULONG = SCARD_CLASS_IFD_PROTOCOL << 16 | 0x020c; +pub const SCARD_ATTR_ICC_PRESENCE: ULONG = SCARD_CLASS_ICC_STATE << 16 | 0x0300; +pub const SCARD_ATTR_ICC_INTERFACE_STATUS: ULONG = SCARD_CLASS_ICC_STATE << 16 | 0x0301; +pub const SCARD_ATTR_CURRENT_IO_STATE: ULONG = SCARD_CLASS_ICC_STATE << 16 | 0x0302; +pub const SCARD_ATTR_ATR_STRING: ULONG = SCARD_CLASS_ICC_STATE << 16 | 0x0303; +pub const SCARD_ATTR_ICC_TYPE_PER_ATR: ULONG = SCARD_CLASS_ICC_STATE << 16 | 0x0304; +pub const SCARD_ATTR_ESC_RESET: ULONG = SCARD_CLASS_VENDOR_DEFINED << 16 | 0xA000; +pub const SCARD_ATTR_ESC_CANCEL: ULONG = SCARD_CLASS_VENDOR_DEFINED << 16 | 0xA003; +pub const SCARD_ATTR_ESC_AUTHREQUEST: ULONG = SCARD_CLASS_VENDOR_DEFINED << 16 | 0xA005; +pub const SCARD_ATTR_MAXINPUT: ULONG = SCARD_CLASS_VENDOR_DEFINED << 16 | 0xA007; +pub const SCARD_ATTR_DEVICE_UNIT: ULONG = SCARD_CLASS_SYSTEM << 16 | 0x0001; +pub const SCARD_ATTR_DEVICE_IN_USE: ULONG = SCARD_CLASS_SYSTEM << 16 | 0x0002; +pub const SCARD_ATTR_DEVICE_FRIENDLY_NAME_A: ULONG = SCARD_CLASS_SYSTEM << 16 | 0x0003; +pub const SCARD_ATTR_DEVICE_SYSTEM_NAME_A: ULONG = SCARD_CLASS_SYSTEM << 16 | 0x0004; +pub const SCARD_ATTR_DEVICE_FRIENDLY_NAME_W: ULONG = SCARD_CLASS_SYSTEM << 16 | 0x0005; +pub const SCARD_ATTR_DEVICE_SYSTEM_NAME_W: ULONG = SCARD_CLASS_SYSTEM << 16 | 0x0006; +pub const SCARD_ATTR_SUPRESS_T1_IFS_REQUEST: ULONG = SCARD_CLASS_SYSTEM << 16 | 0x0007; +pub const SCARD_PERF_NUM_TRANSMISSIONS: ULONG = SCARD_CLASS_PERF << 16 | 0x0001; +pub const SCARD_PERF_BYTES_TRANSMITTED: ULONG = SCARD_CLASS_PERF << 16 | 0x0002; +pub const SCARD_PERF_TRANSMISSION_TIME: ULONG = SCARD_CLASS_PERF << 16 | 0x0003; +pub const SCARD_T0_HEADER_LENGTH: DWORD = 7; +pub const SCARD_T0_CMD_LENGTH: DWORD = 5; +pub const SCARD_T1_PROLOGUE_LENGTH: DWORD = 3; +pub const SCARD_T1_EPILOGUE_LENGTH: DWORD = 2; +pub const SCARD_T1_MAX_IFS: DWORD = 254; +pub const SCARD_UNKNOWN: ULONG = 0; +pub const SCARD_ABSENT: ULONG = 1; +pub const SCARD_PRESENT: ULONG = 2; +pub const SCARD_SWALLOWED: ULONG = 3; +pub const SCARD_POWERED: ULONG = 4; +pub const SCARD_NEGOTIABLE: ULONG = 5; +pub const SCARD_SPECIFIC: ULONG = 6; +STRUCT!{struct SCARD_IO_REQUEST { + dwProtocol: DWORD, + cbPciLength: DWORD, +}} +pub type PSCARD_IO_REQUEST = *mut SCARD_IO_REQUEST; +pub type LPSCARD_IO_REQUEST = *mut SCARD_IO_REQUEST; +pub type LPCSCARD_IO_REQUEST = *const SCARD_IO_REQUEST; +STRUCT!{struct SCARD_T0_COMMAND { + bCla: BYTE, + bIns: BYTE, + bP1: BYTE, + bP2: BYTE, + bP3: BYTE, +}} +pub type LPSCARD_T0_COMMAND = *mut SCARD_T0_COMMAND; +UNION!{union SCARD_T0_REQUEST_u { + [u8; 5], + CmdBytes CmdBytes_mut: SCARD_T0_COMMAND, + rgbHeader rgbHeader_mut: [BYTE; 5], +}} +STRUCT!{struct SCARD_T0_REQUEST { + ioRequest: SCARD_IO_REQUEST, + bSw1: BYTE, + bSw2: BYTE, + u: SCARD_T0_REQUEST_u, +}} +pub type PSCARD_T0_REQUEST = *mut SCARD_T0_REQUEST; +pub type LPSCARD_T0_REQUEST = *mut SCARD_T0_REQUEST; +STRUCT!{struct SCARD_T1_REQUEST { + ioRequest: SCARD_IO_REQUEST, +}} +pub type PSCARD_T1_REQUEST = *mut SCARD_T1_REQUEST; +pub type LPSCARD_T1_REQUEST = *mut SCARD_T1_REQUEST; +pub const SCARD_READER_SWALLOWS: ULONG = 0x00000001; +pub const SCARD_READER_EJECTS: ULONG = 0x00000002; +pub const SCARD_READER_CONFISCATES: ULONG = 0x00000004; +pub const SCARD_READER_TYPE_SERIAL: ULONG = 0x01; +pub const SCARD_READER_TYPE_PARALELL: ULONG = 0x02; +pub const SCARD_READER_TYPE_KEYBOARD: ULONG = 0x04; +pub const SCARD_READER_TYPE_SCSI: ULONG = 0x08; +pub const SCARD_READER_TYPE_IDE: ULONG = 0x10; +pub const SCARD_READER_TYPE_USB: ULONG = 0x20; +pub const SCARD_READER_TYPE_PCMCIA: ULONG = 0x40; +pub const SCARD_READER_TYPE_TPM: ULONG = 0x80; +pub const SCARD_READER_TYPE_NFC: ULONG = 0x100; +pub const SCARD_READER_TYPE_UICC: ULONG = 0x200; +pub const SCARD_READER_TYPE_VENDOR: ULONG = 0xF0; diff --git a/bash-5.1/vendor/winapi/src/um/winsock2.rs b/bash-5.1/vendor/winapi/src/um/winsock2.rs new file mode 100644 index 0000000000000000000000000000000000000000..36793fb4879ac6b9d0be624c26f182ee9c2fed91 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winsock2.rs @@ -0,0 +1,1450 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Definitions to be used with the WinSock 2 DLL and WinSock 2 applications. +use ctypes::{ + __uint32, __uint64, c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, + c_ulong, c_ushort, +}; +use shared::basetsd::{DWORD_PTR, UINT_PTR, ULONG_PTR}; +use shared::guiddef::{GUID, LPGUID}; +use shared::inaddr::in_addr; +use shared::minwindef::{ + BOOL, DWORD, FARPROC, HIWORD, INT, LOWORD, LPDWORD, LPHANDLE, LPINT, LPVOID, MAKELONG, UINT, + ULONG, WORD, WPARAM, +}; +use shared::qos::FLOWSPEC; +use shared::windef::HWND; +use shared::winerror::{ + ERROR_INVALID_HANDLE, ERROR_INVALID_PARAMETER, ERROR_IO_INCOMPLETE, ERROR_IO_PENDING, + ERROR_NOT_ENOUGH_MEMORY, ERROR_OPERATION_ABORTED, WAIT_TIMEOUT, +}; +use shared::ws2def::{ + AF_APPLETALK, AF_ATM, AF_BAN, AF_BTH, AF_CCITT, AF_CHAOS, AF_DATAKIT, AF_DECnet, AF_DLI, + AF_ECMA, AF_FIREFOX, AF_HYLINK, AF_IMPLINK, AF_INET, AF_INET6, AF_IPX, AF_ISO, AF_LAT, + AF_MAX, AF_NS, AF_OSI, AF_PUP, AF_SNA, AF_UNIX, AF_UNKNOWN1, AF_UNSPEC, AF_VOICEVIEW, + INADDR_ANY, LPCSADDR_INFO, LPSOCKADDR, LPWSABUF, LPWSAMSG, PSOCKET_ADDRESS_LIST, SOCKADDR, + SOCKADDR_IN, WSABUF, +}; +use shared::wtypesbase::{BLOB, LPBLOB}; +use um::minwinbase::OVERLAPPED; +use um::winbase::{INFINITE, WAIT_FAILED, WAIT_IO_COMPLETION, WAIT_OBJECT_0}; +use um::winnt::{ + CHAR, HANDLE, LONG, LPCSTR, LPSTR, LPWSTR, MAXIMUM_WAIT_OBJECTS, PWSTR, SHORT, WCHAR, +}; +pub const WINSOCK_VERSION: WORD = 2 | (2 << 8); +pub type u_char = c_uchar; +pub type u_short = c_ushort; +pub type u_int = c_uint; +pub type u_long = c_ulong; +pub type u_int64 = __uint64; +pub type SOCKET = UINT_PTR; +pub const FD_SETSIZE: usize = 64; +STRUCT!{struct fd_set { + fd_count: u_int, + fd_array: [SOCKET; FD_SETSIZE], +}} +extern "system" { + pub fn __WSAFDIsSet( + fd: SOCKET, + _: *mut fd_set, + ) -> c_int; +} +STRUCT!{struct timeval { + tv_sec: c_long, + tv_usec: c_long, +}} +pub const IOCPARM_MASK: c_long = 0x7f; +pub const IOC_VOID: c_long = 0x20000000; +pub const IOC_OUT: c_long = 0x40000000; +pub const IOC_IN: c_long = 0x80000000; +pub const IOC_INOUT: c_long = IOC_IN | IOC_OUT; +pub const FIONREAD: c_long = IOC_OUT | ((4 & IOCPARM_MASK) << 16) | (0x66 << 8) | 127; +pub const FIONBIO: c_long = IOC_IN | ((4 & IOCPARM_MASK) << 16) | (0x66 << 8) | 126; +pub const FIOASYNC: c_long = IOC_IN | ((4 & IOCPARM_MASK) << 16) | (0x66 << 8) | 125; +pub const SIOCSHIWAT: c_long = IOC_IN | ((4 & IOCPARM_MASK) << 16) | (0x73 << 8) | 0; +pub const SIOCGHIWAT: c_long = IOC_OUT | ((4 & IOCPARM_MASK) << 16) | (0x73 << 8) | 1; +pub const SIOCSLOWAT: c_long = IOC_IN | ((4 & IOCPARM_MASK) << 16) | (0x73 << 8) | 2; +pub const SIOCGLOWAT: c_long = IOC_OUT | ((4 & IOCPARM_MASK) << 16) | (0x73 << 8) | 3; +pub const SIOCATMARK: c_long = IOC_OUT | ((4 & IOCPARM_MASK) << 16) | (0x73 << 8) | 7; +STRUCT!{struct hostent { + h_name: *mut c_char, + h_aliases: *mut *mut c_char, + h_addrtype: c_short, + h_length: c_short, + h_addr_list: *mut *mut c_char, +}} +STRUCT!{struct netent { + n_name: *mut c_char, + n_aliases: *mut *mut c_char, + n_addrtype: c_short, + n_net: u_long, +}} +#[cfg(target_pointer_width = "32")] +STRUCT!{struct servent { + s_name: *mut c_char, + s_aliases: *mut *mut c_char, + s_port: c_short, + s_proto: *mut c_char, +}} +#[cfg(target_pointer_width = "64")] +STRUCT!{struct servent { + s_name: *mut c_char, + s_aliases: *mut *mut c_char, + s_proto: *mut c_char, + s_port: c_short, +}} +STRUCT!{struct protoent { + p_name: *mut c_char, + p_aliases: *mut *mut c_char, + p_proto: c_short, +}} +pub const IPPORT_ECHO: c_short = 7; +pub const IPPORT_DISCARD: c_short = 9; +pub const IPPORT_SYSTAT: c_short = 11; +pub const IPPORT_DAYTIME: c_short = 13; +pub const IPPORT_NETSTAT: c_short = 15; +pub const IPPORT_FTP: c_short = 21; +pub const IPPORT_TELNET: c_short = 23; +pub const IPPORT_SMTP: c_short = 25; +pub const IPPORT_TIMESERVER: c_short = 37; +pub const IPPORT_NAMESERVER: c_short = 42; +pub const IPPORT_WHOIS: c_short = 43; +pub const IPPORT_MTP: c_short = 57; +pub const IPPORT_TFTP: c_short = 69; +pub const IPPORT_RJE: c_short = 77; +pub const IPPORT_FINGER: c_short = 79; +pub const IPPORT_TTYLINK: c_short = 87; +pub const IPPORT_SUPDUP: c_short = 95; +pub const IPPORT_EXECSERVER: c_short = 512; +pub const IPPORT_LOGINSERVER: c_short = 513; +pub const IPPORT_CMDSERVER: c_short = 514; +pub const IPPORT_EFSSERVER: c_short = 520; +pub const IPPORT_BIFFUDP: c_short = 512; +pub const IPPORT_WHOSERVER: c_short = 513; +pub const IPPORT_ROUTESERVER: c_short = 520; +pub const IPPORT_RESERVED: c_short = 1024; +pub const IMPLINK_IP: c_short = 155; +pub const IMPLINK_LOWEXPER: c_short = 156; +pub const IMPLINK_HIGHEXPER: c_short = 158; +pub const ADDR_ANY: ULONG = INADDR_ANY; +pub const WSADESCRIPTION_LEN: usize = 256; +pub const WSASYS_STATUS_LEN: usize = 128; +#[cfg(target_pointer_width = "32")] +STRUCT!{struct WSADATA { + wVersion: WORD, + wHighVersion: WORD, + szDescription: [c_char; WSADESCRIPTION_LEN + 1], + szSystemStatus: [c_char; WSASYS_STATUS_LEN + 1], + iMaxSockets: c_ushort, + iMaxUdpDg: c_ushort, + lpVendorInfo: *mut c_char, +}} +#[cfg(target_pointer_width = "64")] +STRUCT!{struct WSADATA { + wVersion: WORD, + wHighVersion: WORD, + iMaxSockets: c_ushort, + iMaxUdpDg: c_ushort, + lpVendorInfo: *mut c_char, + szDescription: [c_char; WSADESCRIPTION_LEN + 1], + szSystemStatus: [c_char; WSASYS_STATUS_LEN + 1], +}} +pub type LPWSADATA = *mut WSADATA; +pub const INVALID_SOCKET: SOCKET = !0; +pub const SOCKET_ERROR: c_int = -1; +pub const FROM_PROTOCOL_INFO: c_int = -1; +pub const SOCK_STREAM: c_int = 1; +pub const SOCK_DGRAM: c_int = 2; +pub const SOCK_RAW: c_int = 3; +pub const SOCK_RDM: c_int = 4; +pub const SOCK_SEQPACKET: c_int = 5; +pub const SO_DEBUG: c_int = 0x0001; +pub const SO_ACCEPTCONN: c_int = 0x0002; +pub const SO_REUSEADDR: c_int = 0x0004; +pub const SO_KEEPALIVE: c_int = 0x0008; +pub const SO_DONTROUTE: c_int = 0x0010; +pub const SO_BROADCAST: c_int = 0x0020; +pub const SO_USELOOPBACK: c_int = 0x0040; +pub const SO_LINGER: c_int = 0x0080; +pub const SO_OOBINLINE: c_int = 0x0100; +pub const SO_DONTLINGER: c_int = !SO_LINGER; +pub const SO_EXCLUSIVEADDRUSE: c_int = !SO_REUSEADDR; +pub const SO_SNDBUF: c_int = 0x1001; +pub const SO_RCVBUF: c_int = 0x1002; +pub const SO_SNDLOWAT: c_int = 0x1003; +pub const SO_RCVLOWAT: c_int = 0x1004; +pub const SO_SNDTIMEO: c_int = 0x1005; +pub const SO_RCVTIMEO: c_int = 0x1006; +pub const SO_ERROR: c_int = 0x1007; +pub const SO_TYPE: c_int = 0x1008; +pub const SO_GROUP_ID: c_int = 0x2001; +pub const SO_GROUP_PRIORITY: c_int = 0x2002; +pub const SO_MAX_MSG_SIZE: c_int = 0x2003; +pub const SO_PROTOCOL_INFOA: c_int = 0x2004; +pub const SO_PROTOCOL_INFOW: c_int = 0x2005; +pub const PVD_CONFIG: c_int = 0x3001; +pub const SO_CONDITIONAL_ACCEPT: c_int = 0x3002; +STRUCT!{struct sockproto { + sp_family: u_short, + sp_protocol: u_short, +}} +pub const PF_UNSPEC: c_int = AF_UNSPEC; +pub const PF_UNIX: c_int = AF_UNIX; +pub const PF_INET: c_int = AF_INET; +pub const PF_IMPLINK: c_int = AF_IMPLINK; +pub const PF_PUP: c_int = AF_PUP; +pub const PF_CHAOS: c_int = AF_CHAOS; +pub const PF_NS: c_int = AF_NS; +pub const PF_IPX: c_int = AF_IPX; +pub const PF_ISO: c_int = AF_ISO; +pub const PF_OSI: c_int = AF_OSI; +pub const PF_ECMA: c_int = AF_ECMA; +pub const PF_DATAKIT: c_int = AF_DATAKIT; +pub const PF_CCITT: c_int = AF_CCITT; +pub const PF_SNA: c_int = AF_SNA; +pub const PF_DECnet: c_int = AF_DECnet; +pub const PF_DLI: c_int = AF_DLI; +pub const PF_LAT: c_int = AF_LAT; +pub const PF_HYLINK: c_int = AF_HYLINK; +pub const PF_APPLETALK: c_int = AF_APPLETALK; +pub const PF_VOICEVIEW: c_int = AF_VOICEVIEW; +pub const PF_FIREFOX: c_int = AF_FIREFOX; +pub const PF_UNKNOWN1: c_int = AF_UNKNOWN1; +pub const PF_BAN: c_int = AF_BAN; +pub const PF_ATM: c_int = AF_ATM; +pub const PF_INET6: c_int = AF_INET6; +pub const PF_BTH: c_int = AF_BTH; +pub const PF_MAX: c_int = AF_MAX; +STRUCT!{struct linger { + l_onoff: u_short, + l_linger: u_short, +}} +pub const SOL_SOCKET: c_int = 0xffff; +pub const SOMAXCONN: c_int = 0x7fffffff; +#[inline] +pub fn SOMAXCONN_HINT(b: c_int) -> c_int { + -b +} +pub const MSG_OOB: c_int = 0x1; +pub const MSG_PEEK: c_int = 0x2; +pub const MSG_DONTROUTE: c_int = 0x4; +pub const MSG_WAITALL: c_int = 0x8; +pub const MSG_PUSH_IMMEDIATE: c_int = 0x20; +pub const MSG_PARTIAL: c_int = 0x8000; +pub const MSG_INTERRUPT: c_int = 0x10; +pub const MSG_MAXIOVLEN: c_int = 16; +pub const MAXGETHOSTSTRUCT: usize = 1024; +pub const FD_READ_BIT: c_long = 0; +pub const FD_READ: c_long = 1 << FD_READ_BIT; +pub const FD_WRITE_BIT: c_long = 1; +pub const FD_WRITE: c_long = 1 << FD_WRITE_BIT; +pub const FD_OOB_BIT: c_long = 2; +pub const FD_OOB: c_long = 1 << FD_OOB_BIT; +pub const FD_ACCEPT_BIT: c_long = 3; +pub const FD_ACCEPT: c_long = 1 << FD_ACCEPT_BIT; +pub const FD_CONNECT_BIT: c_long = 4; +pub const FD_CONNECT: c_long = 1 << FD_CONNECT_BIT; +pub const FD_CLOSE_BIT: c_long = 5; +pub const FD_CLOSE: c_long = 1 << FD_CLOSE_BIT; +pub const FD_QOS_BIT: c_long = 6; +pub const FD_QOS: c_long = 1 << FD_QOS_BIT; +pub const FD_GROUP_QOS_BIT: c_long = 7; +pub const FD_GROUP_QOS: c_long = 1 << FD_GROUP_QOS_BIT; +pub const FD_ROUTING_INTERFACE_CHANGE_BIT: c_long = 8; +pub const FD_ROUTING_INTERFACE_CHANGE: c_long = 1 << FD_ROUTING_INTERFACE_CHANGE_BIT; +pub const FD_ADDRESS_LIST_CHANGE_BIT: c_long = 9; +pub const FD_ADDRESS_LIST_CHANGE: c_long = 1 << FD_ADDRESS_LIST_CHANGE_BIT; +pub const FD_MAX_EVENTS: usize = 10; +pub const FD_ALL_EVENTS: c_long = (1 << FD_MAX_EVENTS) - 1; +pub const WSABASEERR: c_int = 10000; +pub const WSAEINTR: c_int = WSABASEERR+4; +pub const WSAEBADF: c_int = WSABASEERR+9; +pub const WSAEACCES: c_int = WSABASEERR+13; +pub const WSAEFAULT: c_int = WSABASEERR+14; +pub const WSAEINVAL: c_int = WSABASEERR+22; +pub const WSAEMFILE: c_int = WSABASEERR+24; +pub const WSAEWOULDBLOCK: c_int = WSABASEERR+35; +pub const WSAEINPROGRESS: c_int = WSABASEERR+36; +pub const WSAEALREADY: c_int = WSABASEERR+37; +pub const WSAENOTSOCK: c_int = WSABASEERR+38; +pub const WSAEDESTADDRREQ: c_int = WSABASEERR+39; +pub const WSAEMSGSIZE: c_int = WSABASEERR+40; +pub const WSAEPROTOTYPE: c_int = WSABASEERR+41; +pub const WSAENOPROTOOPT: c_int = WSABASEERR+42; +pub const WSAEPROTONOSUPPORT: c_int = WSABASEERR+43; +pub const WSAESOCKTNOSUPPORT: c_int = WSABASEERR+44; +pub const WSAEOPNOTSUPP: c_int = WSABASEERR+45; +pub const WSAEPFNOSUPPORT: c_int = WSABASEERR+46; +pub const WSAEAFNOSUPPORT: c_int = WSABASEERR+47; +pub const WSAEADDRINUSE: c_int = WSABASEERR+48; +pub const WSAEADDRNOTAVAIL: c_int = WSABASEERR+49; +pub const WSAENETDOWN: c_int = WSABASEERR+50; +pub const WSAENETUNREACH: c_int = WSABASEERR+51; +pub const WSAENETRESET: c_int = WSABASEERR+52; +pub const WSAECONNABORTED: c_int = WSABASEERR+53; +pub const WSAECONNRESET: c_int = WSABASEERR+54; +pub const WSAENOBUFS: c_int = WSABASEERR+55; +pub const WSAEISCONN: c_int = WSABASEERR+56; +pub const WSAENOTCONN: c_int = WSABASEERR+57; +pub const WSAESHUTDOWN: c_int = WSABASEERR+58; +pub const WSAETOOMANYREFS: c_int = WSABASEERR+59; +pub const WSAETIMEDOUT: c_int = WSABASEERR+60; +pub const WSAECONNREFUSED: c_int = WSABASEERR+61; +pub const WSAELOOP: c_int = WSABASEERR+62; +pub const WSAENAMETOOLONG: c_int = WSABASEERR+63; +pub const WSAEHOSTDOWN: c_int = WSABASEERR+64; +pub const WSAEHOSTUNREACH: c_int = WSABASEERR+65; +pub const WSAENOTEMPTY: c_int = WSABASEERR+66; +pub const WSAEPROCLIM: c_int = WSABASEERR+67; +pub const WSAEUSERS: c_int = WSABASEERR+68; +pub const WSAEDQUOT: c_int = WSABASEERR+69; +pub const WSAESTALE: c_int = WSABASEERR+70; +pub const WSAEREMOTE: c_int = WSABASEERR+71; +pub const WSASYSNOTREADY: c_int = WSABASEERR+91; +pub const WSAVERNOTSUPPORTED: c_int = WSABASEERR+92; +pub const WSANOTINITIALISED: c_int = WSABASEERR+93; +pub const WSAEDISCON: c_int = WSABASEERR+101; +pub const WSAENOMORE: c_int = WSABASEERR+102; +pub const WSAECANCELLED: c_int = WSABASEERR+103; +pub const WSAEINVALIDPROCTABLE: c_int = WSABASEERR+104; +pub const WSAEINVALIDPROVIDER: c_int = WSABASEERR+105; +pub const WSAEPROVIDERFAILEDINIT: c_int = WSABASEERR+106; +pub const WSASYSCALLFAILURE: c_int = WSABASEERR+107; +pub const WSASERVICE_NOT_FOUND: c_int = WSABASEERR+108; +pub const WSATYPE_NOT_FOUND: c_int = WSABASEERR+109; +pub const WSA_E_NO_MORE: c_int = WSABASEERR+110; +pub const WSA_E_CANCELLED: c_int = WSABASEERR+111; +pub const WSAEREFUSED: c_int = WSABASEERR+112; +pub const WSAHOST_NOT_FOUND: c_int = WSABASEERR+1001; +pub const WSATRY_AGAIN: c_int = WSABASEERR+1002; +pub const WSANO_RECOVERY: c_int = WSABASEERR+1003; +pub const WSANO_DATA: c_int = WSABASEERR+1004; +pub const WSA_QOS_RECEIVERS: c_int = WSABASEERR + 1005; +pub const WSA_QOS_SENDERS: c_int = WSABASEERR + 1006; +pub const WSA_QOS_NO_SENDERS: c_int = WSABASEERR + 1007; +pub const WSA_QOS_NO_RECEIVERS: c_int = WSABASEERR + 1008; +pub const WSA_QOS_REQUEST_CONFIRMED: c_int = WSABASEERR + 1009; +pub const WSA_QOS_ADMISSION_FAILURE: c_int = WSABASEERR + 1010; +pub const WSA_QOS_POLICY_FAILURE: c_int = WSABASEERR + 1011; +pub const WSA_QOS_BAD_STYLE: c_int = WSABASEERR + 1012; +pub const WSA_QOS_BAD_OBJECT: c_int = WSABASEERR + 1013; +pub const WSA_QOS_TRAFFIC_CTRL_ERROR: c_int = WSABASEERR + 1014; +pub const WSA_QOS_GENERIC_ERROR: c_int = WSABASEERR + 1015; +pub const WSA_QOS_ESERVICETYPE: c_int = WSABASEERR + 1016; +pub const WSA_QOS_EFLOWSPEC: c_int = WSABASEERR + 1017; +pub const WSA_QOS_EPROVSPECBUF: c_int = WSABASEERR + 1018; +pub const WSA_QOS_EFILTERSTYLE: c_int = WSABASEERR + 1019; +pub const WSA_QOS_EFILTERTYPE: c_int = WSABASEERR + 1020; +pub const WSA_QOS_EFILTERCOUNT: c_int = WSABASEERR + 1021; +pub const WSA_QOS_EOBJLENGTH: c_int = WSABASEERR + 1022; +pub const WSA_QOS_EFLOWCOUNT: c_int = WSABASEERR + 1023; +pub const WSA_QOS_EUNKOWNPSOBJ: c_int = WSABASEERR + 1024; +pub const WSA_QOS_EPOLICYOBJ: c_int = WSABASEERR + 1025; +pub const WSA_QOS_EFLOWDESC: c_int = WSABASEERR + 1026; +pub const WSA_QOS_EPSFLOWSPEC: c_int = WSABASEERR + 1027; +pub const WSA_QOS_EPSFILTERSPEC: c_int = WSABASEERR + 1028; +pub const WSA_QOS_ESDMODEOBJ: c_int = WSABASEERR + 1029; +pub const WSA_QOS_ESHAPERATEOBJ: c_int = WSABASEERR + 1030; +pub const WSA_QOS_RESERVED_PETYPE: c_int = WSABASEERR + 1031; +#[inline] +pub unsafe fn h_errno() -> c_int { + WSAGetLastError() +} +pub const HOST_NOT_FOUND: c_int = WSAHOST_NOT_FOUND; +pub const TRY_AGAIN: c_int = WSATRY_AGAIN; +pub const NO_RECOVERY: c_int = WSANO_RECOVERY; +pub const NO_DATA: c_int = WSANO_DATA; +pub const WSANO_ADDRESS: c_int = WSANO_DATA; +pub const NO_ADDRESS: c_int = WSANO_ADDRESS; +pub type WSAEVENT = HANDLE; +pub type LPWSAEVENT = LPHANDLE; +pub type WSAOVERLAPPED = OVERLAPPED; +pub type LPWSAOVERLAPPED = *mut OVERLAPPED; +pub const WSA_IO_PENDING: c_int = ERROR_IO_PENDING as i32; +pub const WSA_IO_INCOMPLETE: c_int = ERROR_IO_INCOMPLETE as i32; +pub const WSA_INVALID_HANDLE: c_int = ERROR_INVALID_HANDLE as i32; +pub const WSA_INVALID_PARAMETER: c_int = ERROR_INVALID_PARAMETER as i32; +pub const WSA_NOT_ENOUGH_MEMORY: c_int = ERROR_NOT_ENOUGH_MEMORY as i32; +pub const WSA_OPERATION_ABORTED: c_int = ERROR_OPERATION_ABORTED as i32; +pub const WSA_INVALID_EVENT: WSAEVENT = 0 as WSAEVENT; +pub const WSA_MAXIMUM_WAIT_EVENTS: DWORD = MAXIMUM_WAIT_OBJECTS; +pub const WSA_WAIT_FAILED: DWORD = WAIT_FAILED; +pub const WSA_WAIT_EVENT_0: DWORD = WAIT_OBJECT_0; +pub const WSA_WAIT_IO_COMPLETION: DWORD = WAIT_IO_COMPLETION; +pub const WSA_WAIT_TIMEOUT: DWORD = WAIT_TIMEOUT; +pub const WSA_INFINITE: DWORD = INFINITE; +STRUCT!{struct QOS { + SendingFlowspec: FLOWSPEC, + FLOWSPEC: FLOWSPEC, + ProviderSpecific: WSABUF, +}} +pub type LPQOS = *mut QOS; +pub const CF_ACCEPT: c_int = 0x0000; +pub const CF_REJECT: c_int = 0x0001; +pub const CF_DEFER: c_int = 0x0002; +pub const SD_RECEIVE: c_int = 0x00; +pub const SD_SEND: c_int = 0x01; +pub const SD_BOTH: c_int = 0x02; +pub type GROUP = c_uint; +pub const SG_UNCONSTRAINED_GROUP: GROUP = 0x01; +pub const SG_CONSTRAINED_GROUP: GROUP = 0x02; +STRUCT!{struct WSANETWORKEVENTS { + lNetworkEvents: c_long, + iErrorCode: [c_int; FD_MAX_EVENTS], +}} +pub type LPWSANETWORKEVENTS = *mut WSANETWORKEVENTS; +pub const MAX_PROTOCOL_CHAIN: usize = 7; +pub const BASE_PROTOCOL: c_int = 1; +pub const LAYERED_PROTOCOL: c_int = 0; +STRUCT!{struct WSAPROTOCOLCHAIN { + ChainLen: c_int, + ChainEntries: [DWORD; MAX_PROTOCOL_CHAIN], +}} +pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN; +pub const WSAPROTOCOL_LEN: usize = 255; +STRUCT!{struct WSAPROTOCOL_INFOA { + dwServiceFlags1: DWORD, + dwServiceFlags2: DWORD, + dwServiceFlags3: DWORD, + dwServiceFlags4: DWORD, + dwServiceFlags5: DWORD, + ProviderId: GUID, + dwCatalogEntryId: DWORD, + ProtocolChain: WSAPROTOCOLCHAIN, + iVersion: c_int, + iAddressFamily: c_int, + iMaxSockAddr: c_int, + iMinSockAddr: c_int, + iSocketType: c_int, + iProtocol: c_int, + iProtocolMaxOffset: c_int, + iNetworkByteOrder: c_int, + iSecurityScheme: c_int, + dwMessageSize: DWORD, + dwProviderReserved: DWORD, + szProtocol: [CHAR; WSAPROTOCOL_LEN + 1], +}} +pub type LPWSAPROTOCOL_INFOA = *mut WSAPROTOCOL_INFOA; +STRUCT!{struct WSAPROTOCOL_INFOW { + dwServiceFlags1: DWORD, + dwServiceFlags2: DWORD, + dwServiceFlags3: DWORD, + dwServiceFlags4: DWORD, + dwServiceFlags5: DWORD, + ProviderId: GUID, + dwCatalogEntryId: DWORD, + ProtocolChain: WSAPROTOCOLCHAIN, + iVersion: c_int, + iAddressFamily: c_int, + iMaxSockAddr: c_int, + iMinSockAddr: c_int, + iSocketType: c_int, + iProtocol: c_int, + iProtocolMaxOffset: c_int, + iNetworkByteOrder: c_int, + iSecurityScheme: c_int, + dwMessageSize: DWORD, + dwProviderReserved: DWORD, + szProtocol: [WCHAR; WSAPROTOCOL_LEN + 1], +}} +pub type LPWSAPROTOCOL_INFOW = *mut WSAPROTOCOL_INFOW; +pub const PFL_MULTIPLE_PROTO_ENTRIES: DWORD = 0x00000001; +pub const PFL_RECOMMENDED_PROTO_ENTRY: DWORD = 0x00000002; +pub const PFL_HIDDEN: DWORD = 0x00000004; +pub const PFL_MATCHES_PROTOCOL_ZERO: DWORD = 0x00000008; +pub const PFL_NETWORKDIRECT_PROVIDER: DWORD = 0x00000010; +pub const XP1_CONNECTIONLESS: DWORD = 0x00000001; +pub const XP1_GUARANTEED_DELIVERY: DWORD = 0x00000002; +pub const XP1_GUARANTEED_ORDER: DWORD = 0x00000004; +pub const XP1_MESSAGE_ORIENTED: DWORD = 0x00000008; +pub const XP1_PSEUDO_STREAM: DWORD = 0x00000010; +pub const XP1_GRACEFUL_CLOSE: DWORD = 0x00000020; +pub const XP1_EXPEDITED_DATA: DWORD = 0x00000040; +pub const XP1_CONNECT_DATA: DWORD = 0x00000080; +pub const XP1_DISCONNECT_DATA: DWORD = 0x00000100; +pub const XP1_SUPPORT_BROADCAST: DWORD = 0x00000200; +pub const XP1_SUPPORT_MULTIPOINT: DWORD = 0x00000400; +pub const XP1_MULTIPOINT_CONTROL_PLANE: DWORD = 0x00000800; +pub const XP1_MULTIPOINT_DATA_PLANE: DWORD = 0x00001000; +pub const XP1_QOS_SUPPORTED: DWORD = 0x00002000; +pub const XP1_INTERRUPT: DWORD = 0x00004000; +pub const XP1_UNI_SEND: DWORD = 0x00008000; +pub const XP1_UNI_RECV: DWORD = 0x00010000; +pub const XP1_IFS_HANDLES: DWORD = 0x00020000; +pub const XP1_PARTIAL_MESSAGE: DWORD = 0x00040000; +pub const XP1_SAN_SUPPORT_SDP: DWORD = 0x00080000; +pub const BIGENDIAN: DWORD = 0x0000; +pub const LITTLEENDIAN: DWORD = 0x0001; +pub const SECURITY_PROTOCOL_NONE: DWORD = 0x0000; +pub const JL_SENDER_ONLY: DWORD = 0x01; +pub const JL_RECEIVER_ONLY: DWORD = 0x02; +pub const JL_BOTH: DWORD = 0x04; +pub const WSA_FLAG_OVERLAPPED: DWORD = 0x01; +pub const WSA_FLAG_MULTIPOINT_C_ROOT: DWORD = 0x02; +pub const WSA_FLAG_MULTIPOINT_C_LEAF: DWORD = 0x04; +pub const WSA_FLAG_MULTIPOINT_D_ROOT: DWORD = 0x08; +pub const WSA_FLAG_MULTIPOINT_D_LEAF: DWORD = 0x10; +pub const WSA_FLAG_ACCESS_SYSTEM_SECURITY: DWORD = 0x40; +pub const WSA_FLAG_NO_HANDLE_INHERIT: DWORD = 0x80; +pub const WSA_FLAG_REGISTERED_IO: DWORD = 0x100; +FN!{stdcall LPCONDITIONPROC( + lpCallerId: LPWSABUF, + lpCallerData: LPWSABUF, + lpSQOS: LPQOS, + lpGQOS: LPQOS, + lpCalleeId: LPWSABUF, + lpCalleeData: LPWSABUF, + g: *mut GROUP, + dwCallbackData: DWORD, +) -> c_int} +FN!{stdcall LPWSAOVERLAPPED_COMPLETION_ROUTINE( + dwError: DWORD, + cbTransferred: DWORD, + lpOverlapped: LPWSAOVERLAPPED, + dwFlags: DWORD, +) -> ()} +ENUM!{enum WSACOMPLETIONTYPE { + NSP_NOTIFY_IMMEDIATELY = 0, + NSP_NOTIFY_HWND, + NSP_NOTIFY_EVENT, + NSP_NOTIFY_PORT, + NSP_NOTIFY_APC, +}} +pub type PWSACOMPLETIONTYPE = *mut WSACOMPLETIONTYPE; +pub type LPWSACOMPLETIONTYPE = *mut WSACOMPLETIONTYPE; +STRUCT!{struct WSACOMPLETION_WindowMessage { + hWnd: HWND, + uMsg: UINT, + context: WPARAM, +}} +STRUCT!{struct WSACOMPLETION_Event { + lpOverlapped: LPWSAOVERLAPPED, +}} +STRUCT!{struct WSACOMPLETION_Apc { + lpOverlapped: LPWSAOVERLAPPED, + lpfnCompletionProc: LPWSAOVERLAPPED_COMPLETION_ROUTINE, +}} +STRUCT!{struct WSACOMPLETION_Port { + lpOverlapped: LPWSAOVERLAPPED, + hPort: HANDLE, + Key: ULONG_PTR, +}} +UNION!{union WSACOMPLETION_Parameter { + [usize; 3], + WindowMessage WindowMessage_mut: WSACOMPLETION_WindowMessage, + Event Event_mut: WSACOMPLETION_Event, + Apc Apc_mut: WSACOMPLETION_Apc, + Port Port_mut: WSACOMPLETION_Port, +}} +STRUCT!{struct WSACOMPLETION { + Type: WSACOMPLETIONTYPE, + Parameters: WSACOMPLETION_Parameter, +}} +pub type PWSACOMPLETION = *mut WSACOMPLETION; +pub type LPWSACOMPLETION = *mut WSACOMPLETION; +pub const TH_NETDEV: DWORD = 0x00000001; +pub const TH_TAPI: DWORD = 0x00000002; +pub const SERVICE_MULTIPLE: DWORD = 0x00000001; +pub const NS_ALL: DWORD = 0; +pub const NS_SAP: DWORD = 1; +pub const NS_NDS: DWORD = 2; +pub const NS_PEER_BROWSE: DWORD = 3; +pub const NS_SLP: DWORD = 5; +pub const NS_DHCP: DWORD = 6; +pub const NS_TCPIP_LOCAL: DWORD = 10; +pub const NS_TCPIP_HOSTS: DWORD = 11; +pub const NS_DNS: DWORD = 12; +pub const NS_NETBT: DWORD = 13; +pub const NS_WINS: DWORD = 14; +pub const NS_NLA: DWORD = 15; +pub const NS_BTH: DWORD = 16; +pub const NS_LOCALNAME: DWORD = 19; +pub const NS_NBP: DWORD = 20; +pub const NS_MS: DWORD = 30; +pub const NS_STDA: DWORD = 31; +pub const NS_NTDS: DWORD = 32; +pub const NS_EMAIL: DWORD = 37; +pub const NS_PNRPNAME: DWORD = 38; +pub const NS_PNRPCLOUD: DWORD = 39; +pub const NS_X500: DWORD = 40; +pub const NS_NIS: DWORD = 41; +pub const NS_NISPLUS: DWORD = 42; +pub const NS_WRQ: DWORD = 50; +pub const NS_NETDES: DWORD = 60; +pub const RES_UNUSED_1: DWORD = 0x00000001; +pub const RES_FLUSH_CACHE: DWORD = 0x00000002; +pub const RES_SERVICE: DWORD = 0x00000004; +pub const SERVICE_TYPE_VALUE_IPXPORT: &'static str = "IpxSocket"; +pub const SERVICE_TYPE_VALUE_SAPID: &'static str = "SapId"; +pub const SERVICE_TYPE_VALUE_TCPPORT: &'static str = "TcpPort"; +pub const SERVICE_TYPE_VALUE_UDPPORT: &'static str = "UdpPort"; +pub const SERVICE_TYPE_VALUE_OBJECTID: &'static str = "ObjectId"; +STRUCT!{struct AFPROTOCOLS { + iAddressFamily: INT, + iProtocol: INT, +}} +pub type PAFPROTOCOLS = *mut AFPROTOCOLS; +pub type LPAFPROTOCOLS = *mut AFPROTOCOLS; +ENUM!{enum WSAECOMPARATOR { + COMP_EQUAL = 0, + COMP_NOTLESS, +}} +pub type PWSAECOMPARATOR = *mut WSAECOMPARATOR; +pub type LPWSAECOMPARATOR = *mut WSAECOMPARATOR; +STRUCT!{struct WSAVERSION { + dwVersion: DWORD, + ecHow: WSAECOMPARATOR, +}} +pub type PWSAVERSION = *mut WSAVERSION; +pub type LPWSAVERSION = *mut WSAVERSION; +STRUCT!{struct WSAQUERYSETA { + dwSize: DWORD, + lpszServiceInstanceName: LPSTR, + lpServiceClassId: LPGUID, + lpVersion: LPWSAVERSION, + lpszComment: LPSTR, + dwNameSpace: DWORD, + lpNSProviderId: LPGUID, + lpszContext: LPSTR, + dwNumberOfProtocols: DWORD, + lpafpProtocols: LPAFPROTOCOLS, + lpszQueryString: LPSTR, + dwNumberOfCsAddrs: DWORD, + lpcsaBuffer: LPCSADDR_INFO, + dwOutputFlags: DWORD, + lpBlob: LPBLOB, +}} +pub type PWSAQUERYSETA = *mut WSAQUERYSETA; +pub type LPWSAQUERYSETA = *mut WSAQUERYSETA; +STRUCT!{struct WSAQUERYSETW { + dwSize: DWORD, + lpszServiceInstanceName: LPWSTR, + lpServiceClassId: LPGUID, + lpVersion: LPWSAVERSION, + lpszComment: LPWSTR, + dwNameSpace: DWORD, + lpNSProviderId: LPGUID, + lpszContext: LPWSTR, + dwNumberOfProtocols: DWORD, + lpafpProtocols: LPAFPROTOCOLS, + lpszQueryString: LPWSTR, + dwNumberOfCsAddrs: DWORD, + lpcsaBuffer: LPCSADDR_INFO, + dwOutputFlags: DWORD, + lpBlob: LPBLOB, +}} +pub type PWSAQUERYSETW = *mut WSAQUERYSETW; +pub type LPWSAQUERYSETW = *mut WSAQUERYSETW; +STRUCT!{struct WSAQUERYSET2A { + dwSize: DWORD, + lpszServiceInstanceName: LPSTR, + lpVersion: LPWSAVERSION, + lpszComment: LPSTR, + dwNameSpace: DWORD, + lpNSProviderId: LPGUID, + lpszContext: LPSTR, + dwNumberOfProtocols: DWORD, + lpafpProtocols: LPAFPROTOCOLS, + lpszQueryString: LPSTR, + dwNumberOfCsAddrs: DWORD, + lpcsaBuffer: LPCSADDR_INFO, + dwOutputFlags: DWORD, + lpBlob: LPBLOB, +}} +pub type PWSAQUERYSET2A = *mut WSAQUERYSET2A; +pub type LPWSAQUERYSET2A = *mut WSAQUERYSET2A; +STRUCT!{struct WSAQUERYSET2W { + dwSize: DWORD, + lpszServiceInstanceName: LPWSTR, + lpVersion: LPWSAVERSION, + lpszComment: LPWSTR, + dwNameSpace: DWORD, + lpNSProviderId: LPGUID, + lpszContext: LPWSTR, + dwNumberOfProtocols: DWORD, + lpafpProtocols: LPAFPROTOCOLS, + lpszQueryString: LPWSTR, + dwNumberOfCsAddrs: DWORD, + lpcsaBuffer: LPCSADDR_INFO, + dwOutputFlags: DWORD, + lpBlob: LPBLOB, +}} +pub type PWSAQUERYSET2W = *mut WSAQUERYSET2W; +pub type LPWSAQUERYSET2W = *mut WSAQUERYSET2W; +pub const LUP_DEEP: DWORD = 0x0001; +pub const LUP_CONTAINERS: DWORD = 0x0002; +pub const LUP_NOCONTAINERS: DWORD = 0x0004; +pub const LUP_NEAREST: DWORD = 0x0008; +pub const LUP_RETURN_NAME: DWORD = 0x0010; +pub const LUP_RETURN_TYPE: DWORD = 0x0020; +pub const LUP_RETURN_VERSION: DWORD = 0x0040; +pub const LUP_RETURN_COMMENT: DWORD = 0x0080; +pub const LUP_RETURN_ADDR: DWORD = 0x0100; +pub const LUP_RETURN_BLOB: DWORD = 0x0200; +pub const LUP_RETURN_ALIASES: DWORD = 0x0400; +pub const LUP_RETURN_QUERY_STRING: DWORD = 0x0800; +pub const LUP_RETURN_ALL: DWORD = 0x0FF0; +pub const LUP_RES_SERVICE: DWORD = 0x8000; +pub const LUP_FLUSHCACHE: DWORD = 0x1000; +pub const LUP_FLUSHPREVIOUS: DWORD = 0x2000; +pub const LUP_NON_AUTHORITATIVE: DWORD = 0x4000; +pub const LUP_SECURE: DWORD = 0x8000; +pub const LUP_RETURN_PREFERRED_NAMES: DWORD = 0x10000; +pub const LUP_DNS_ONLY: DWORD = 0x20000; +pub const LUP_ADDRCONFIG: DWORD = 0x00100000; +pub const LUP_DUAL_ADDR: DWORD = 0x00200000; +pub const LUP_FILESERVER: DWORD = 0x00400000; +pub const LUP_DISABLE_IDN_ENCODING: DWORD = 0x00800000; +pub const LUP_API_ANSI: DWORD = 0x01000000; +pub const LUP_RESOLUTION_HANDLE: DWORD = 0x80000000; +pub const RESULT_IS_ALIAS: DWORD = 0x0001; +pub const RESULT_IS_ADDED: DWORD = 0x0010; +pub const RESULT_IS_CHANGED: DWORD = 0x0020; +pub const RESULT_IS_DELETED: DWORD = 0x0040; +ENUM!{enum WSAESETSERVICEOP { + RNRSERVICE_REGISTER = 0, + RNRSERVICE_DEREGISTER, + RNRSERVICE_DELETE, +}} +pub type PWSAESETSERVICEOP = *mut WSAESETSERVICEOP; +pub type LPWSAESETSERVICEOP = *mut WSAESETSERVICEOP; +STRUCT!{struct WSANSCLASSINFOA { + lpszName: LPSTR, + dwNameSpace: DWORD, + dwValueType: DWORD, + dwValueSize: DWORD, + lpValue: LPVOID, +}} +pub type PWSANSCLASSINFOA = *mut WSANSCLASSINFOA; +pub type LPWSANSCLASSINFOA = *mut WSANSCLASSINFOA; +STRUCT!{struct WSANSCLASSINFOW { + lpszName: LPWSTR, + dwNameSpace: DWORD, + dwValueType: DWORD, + dwValueSize: DWORD, + lpValue: LPVOID, +}} +pub type PWSANSCLASSINFOW = *mut WSANSCLASSINFOW; +pub type LPWSANSCLASSINFOW = *mut WSANSCLASSINFOW; +STRUCT!{struct WSASERVICECLASSINFOA { + lpServiceClassId: LPGUID, + lpszServiceClassName: LPSTR, + dwCount: DWORD, + lpClassInfos: LPWSANSCLASSINFOA, +}} +pub type PWSASERVICECLASSINFOA = *mut WSASERVICECLASSINFOA; +pub type LPWSASERVICECLASSINFOA = *mut WSASERVICECLASSINFOA; +STRUCT!{struct WSASERVICECLASSINFOW { + lpServiceClassId: LPGUID, + lpszServiceClassName: LPWSTR, + dwCount: DWORD, + lpClassInfos: LPWSANSCLASSINFOW, +}} +pub type PWSASERVICECLASSINFOW = *mut WSASERVICECLASSINFOW; +pub type LPWSASERVICECLASSINFOW = *mut WSASERVICECLASSINFOW; +STRUCT!{struct WSANAMESPACE_INFOA { + NSProviderId: GUID, + dwNameSpace: DWORD, + fActive: BOOL, + dwVersion: DWORD, + lpszIdentifier: LPSTR, +}} +pub type PWSANAMESPACE_INFOA = *mut WSANAMESPACE_INFOA; +pub type LPWSANAMESPACE_INFOA = *mut WSANAMESPACE_INFOA; +STRUCT!{struct WSANAMESPACE_INFOW { + NSProviderId: GUID, + dwNameSpace: DWORD, + fActive: BOOL, + dwVersion: DWORD, + lpszIdentifier: LPWSTR, +}} +pub type PWSANAMESPACE_INFOW = *mut WSANAMESPACE_INFOW; +pub type LPWSANAMESPACE_INFOW = *mut WSANAMESPACE_INFOW; +STRUCT!{struct WSANAMESPACE_INFOEXA { + NSProviderId: GUID, + dwNameSpace: DWORD, + fActive: BOOL, + dwVersion: DWORD, + lpszIdentifier: LPSTR, + ProviderSpecific: BLOB, +}} +pub type PWSANAMESPACE_INFOEXA = *mut WSANAMESPACE_INFOEXA; +pub type LPWSANAMESPACE_INFOEXA = *mut WSANAMESPACE_INFOEXA; +STRUCT!{struct WSANAMESPACE_INFOEXW { + NSProviderId: GUID, + dwNameSpace: DWORD, + fActive: BOOL, + dwVersion: DWORD, + lpszIdentifier: LPWSTR, + ProviderSpecific: BLOB, +}} +pub type PWSANAMESPACE_INFOEXW = *mut WSANAMESPACE_INFOEXW; +pub type LPWSANAMESPACE_INFOEXW = *mut WSANAMESPACE_INFOEXW; +pub const POLLRDNORM: SHORT = 0x0100; +pub const POLLRDBAND: SHORT = 0x0200; +pub const POLLIN: SHORT = POLLRDNORM | POLLRDBAND; +pub const POLLPRI: SHORT = 0x0400; +pub const POLLWRNORM: SHORT = 0x0010; +pub const POLLOUT: SHORT = POLLWRNORM; +pub const POLLWRBAND: SHORT = 0x0020; +pub const POLLERR: SHORT = 0x0001; +pub const POLLHUP: SHORT = 0x0002; +pub const POLLNVAL: SHORT = 0x0004; +STRUCT!{struct WSAPOLLFD { + fd: SOCKET, + events: SHORT, + revents: SHORT, +}} +pub type PWSAPOLLFD = *mut WSAPOLLFD; +pub type LPWSAPOLLFD = *mut WSAPOLLFD; +extern "system" { + pub fn accept( + s: SOCKET, + addr: *mut SOCKADDR, + addrlen: *mut c_int, + ) -> SOCKET; + pub fn bind(s: SOCKET, + name: *const SOCKADDR, + namelen: c_int, + ) -> c_int; + pub fn closesocket( + s: SOCKET, + ) -> c_int; + pub fn connect( + s: SOCKET, + name: *const SOCKADDR, + namelen: c_int, + ) -> c_int; + pub fn ioctlsocket( + s: SOCKET, + cmd: c_long, + argp: *mut u_long, + ) -> c_int; + pub fn getpeername( + s: SOCKET, + name: *mut SOCKADDR, + namelen: *mut c_int, + ) -> c_int; + pub fn getsockname( + s: SOCKET, + name: *mut SOCKADDR, + namelen: *mut c_int, + ) -> c_int; + pub fn getsockopt( + s: SOCKET, + level: c_int, + optname: c_int, + optval: *mut c_char, + optlen: *mut c_int, + ) -> c_int; + pub fn htonl( + hostlong: u_long, + ) -> u_long; + pub fn htons( + hostshort: u_short, + ) -> u_short; + pub fn inet_addr( + cp: *const c_char, + ) -> c_ulong; + pub fn inet_ntoa( + _in: in_addr, + ) -> *mut c_char; +} +#[inline] +pub fn _WS2_32_WINSOCK_SWAP_LONG(l: __uint32) -> __uint32 { + ((l >> 24) & 0x000000FF) | ((l >> 8) & 0x0000FF00) | ((l << 8) & 0x00FF0000) + | ((l << 24) & 0xFF000000) +} +#[inline] +pub fn _WS2_32_WINSOCK_SWAP_LONGLONG(l: __uint64) -> __uint64 { + ((l >> 56) & 0x00000000000000FF) | ((l >> 40) & 0x000000000000FF00) + | ((l >> 24) & 0x0000000000FF0000) | ((l >> 8) & 0x00000000FF000000) + | ((l << 8) & 0x000000FF00000000) | ((l << 24) & 0x0000FF0000000000) + | ((l << 40) & 0x00FF000000000000) | ((l << 56) & 0xFF00000000000000) +} +#[inline] +pub fn htonll(Value: __uint64) -> __uint64 { + _WS2_32_WINSOCK_SWAP_LONGLONG(Value) +} +#[inline] +pub fn ntohll(Value: __uint64) -> __uint64 { + _WS2_32_WINSOCK_SWAP_LONGLONG(Value) +} +#[inline] +pub fn htonf(Value: c_float) -> __uint32 { + let Tempval: __uint32 = unsafe { ::core::mem::transmute(Value) }; + _WS2_32_WINSOCK_SWAP_LONG(Tempval) +} +#[inline] +pub fn ntohf(Value: __uint32) -> c_float { + let Tempval = _WS2_32_WINSOCK_SWAP_LONG(Value); + unsafe { ::core::mem::transmute(Tempval) } +} +#[inline] +pub fn htond(Value: c_double) -> __uint64 { + let Tempval: __uint64 = unsafe { ::core::mem::transmute(Value) }; + _WS2_32_WINSOCK_SWAP_LONGLONG(Tempval) +} +#[inline] +pub fn ntohd(Value: __uint64) -> c_double { + let Tempval = _WS2_32_WINSOCK_SWAP_LONGLONG(Value); + unsafe { ::core::mem::transmute(Tempval) } +} +extern "system" { + pub fn listen( + s: SOCKET, + backlog: c_int, + ) -> c_int; + pub fn ntohl( + netlong: u_long, + ) -> u_long; + pub fn ntohs( + netshort: u_short, + ) -> u_short; + pub fn recv( + s: SOCKET, + buf: *mut c_char, + len: c_int, + flags: c_int, + ) -> c_int; + pub fn recvfrom( + s: SOCKET, + buf: *mut c_char, + len: c_int, + flags: c_int, + from: *mut SOCKADDR, + fromlen: *mut c_int, + ) -> c_int; + pub fn select( + nfds: c_int, + readfds: *mut fd_set, + writefds: *mut fd_set, + exceptfds: *mut fd_set, + timeout: *const timeval, + ) -> c_int; + pub fn send( + s: SOCKET, + buf: *const c_char, + len: c_int, + flags: c_int, + ) -> c_int; + pub fn sendto( + s: SOCKET, + buf: *const c_char, + len: c_int, + flags: c_int, + to: *const SOCKADDR, + tolen: c_int, + ) -> c_int; + pub fn setsockopt( + s: SOCKET, + level: c_int, + optname: c_int, + optval: *const c_char, + optlen: c_int, + ) -> c_int; + pub fn shutdown( + s: SOCKET, + how: c_int, + ) -> c_int; + pub fn socket( + af: c_int, + _type: c_int, + protocol: c_int, + ) -> SOCKET; + pub fn gethostbyaddr( + addr: *const c_char, + len: c_int, + _type: c_int, + ) -> *mut hostent; + pub fn gethostbyname( + name: *const c_char, + ) -> *mut hostent; + pub fn gethostname( + name: *mut c_char, + namelen: c_int, + ) -> c_int; + pub fn GetHostNameW( + name: PWSTR, + namelen: c_int, + ) -> c_int; + pub fn getservbyport( + port: c_int, + proto: *const c_char, + ) -> *mut servent; + pub fn getservbyname( + name: *const c_char, + proto: *const c_char, + ) -> *mut servent; + pub fn getprotobynumber( + number: c_int, + ) -> *mut protoent; + pub fn getprotobyname( + name: *const c_char, + ) -> *mut protoent; + pub fn WSAStartup( + wVersionRequested: WORD, + lpWSAData: LPWSADATA, + ) -> c_int; + pub fn WSACleanup() -> c_int; + pub fn WSASetLastError( + iError: c_int, + ); + pub fn WSAGetLastError() -> c_int; + pub fn WSAIsBlocking() -> BOOL; + pub fn WSAUnhookBlockingHook() -> c_int; + pub fn WSASetBlockingHook( + lpBlockFunc: FARPROC, + ) -> FARPROC; + pub fn WSACancelBlockingCall() -> c_int; + pub fn WSAAsyncGetServByName( + hWnd: HWND, + wMsg: u_int, + name: *const c_char, + proto: *const c_char, + buf: *mut c_char, + buflen: c_int, + ) -> HANDLE; + pub fn WSAAsyncGetServByPort( + hWnd: HWND, + wMsg: u_int, + port: c_int, + proto: *const c_char, + buf: *mut c_char, + buflen: c_int, + ) -> HANDLE; + pub fn WSAAsyncGetProtoByName( + hWnd: HWND, + wMsg: u_int, + name: *const c_char, + buf: *mut c_char, + buflen: c_int, + ) -> HANDLE; + pub fn WSAAsyncGetProtoByNumber( + hWnd: HWND, + wMsg: u_int, + number: c_int, + buf: *mut c_char, + buflen: c_int, + ) -> HANDLE; + pub fn WSAAsyncGetHostByName( + hWnd: HWND, + wMsg: u_int, + name: *const c_char, + buf: *mut c_char, + buflen: c_int, + ) -> HANDLE; + pub fn WSAAsyncGetHostByAddr( + hWnd: HWND, + wMsg: u_int, + addr: *const c_char, + len: c_int, + _type: c_int, + buf: *mut c_char, + buflen: c_int, + ) -> HANDLE; + pub fn WSACancelAsyncRequest( + hAsyncTaskHandle: HANDLE, + ) -> c_int; + pub fn WSAAsyncSelect( + s: SOCKET, + hWnd: HWND, + wMsg: u_int, + lEvent: c_long, + ) -> c_int; + pub fn WSAAccept( + s: SOCKET, + addr: *mut SOCKADDR, + addrlen: LPINT, + lpfnCondition: LPCONDITIONPROC, + dwCallbackData: DWORD_PTR, + ) -> SOCKET; + pub fn WSACloseEvent( + hEvent: WSAEVENT, + ) -> BOOL; + pub fn WSAConnect( + s: SOCKET, + name: *const SOCKADDR, + namelen: c_int, + lpCallerData: LPWSABUF, + lpCalleeData: LPWSABUF, + lpSQOS: LPQOS, + lpGQOS: LPQOS, + ) -> c_int; + pub fn WSAConnectByNameW( + s: SOCKET, + nodename: LPWSTR, + servicename: LPWSTR, + LocalAddressLength: LPDWORD, + LocalAddress: LPSOCKADDR, + RemoteAddressLength: LPDWORD, + RemoteAddress: LPSOCKADDR, + timeout: *const timeval, + Reserved: LPWSAOVERLAPPED, + ) -> BOOL; + pub fn WSAConnectByNameA( + s: SOCKET, + nodename: LPCSTR, + servicename: LPCSTR, + LocalAddressLength: LPDWORD, + LocalAddress: LPSOCKADDR, + RemoteAddressLength: LPDWORD, + RemoteAddress: LPSOCKADDR, + timeout: *const timeval, + Reserved: LPWSAOVERLAPPED, + ) -> BOOL; + pub fn WSAConnectByList( + s: SOCKET, + SocketAddress: PSOCKET_ADDRESS_LIST, + LocalAddressLength: LPDWORD, + LocalAddress: LPSOCKADDR, + RemoteAddressLength: LPDWORD, + RemoteAddress: LPSOCKADDR, + timeout: *const timeval, + Reserved: LPWSAOVERLAPPED, + ) -> BOOL; + pub fn WSACreateEvent() -> WSAEVENT; + pub fn WSADuplicateSocketA( + s: SOCKET, + dwProcessId: DWORD, + lpProtocolInfo: LPWSAPROTOCOL_INFOA, + ) -> c_int; + pub fn WSADuplicateSocketW( + s: SOCKET, + dwProcessId: DWORD, + lpProtocolInfo: LPWSAPROTOCOL_INFOW, + ) -> c_int; + pub fn WSAEnumNetworkEvents( + s: SOCKET, + hEventObject: WSAEVENT, + lpNetworkEvents: LPWSANETWORKEVENTS, + ) -> c_int; + pub fn WSAEnumProtocolsA( + lpiProtocols: LPINT, + lpProtocolBuffer: LPWSAPROTOCOL_INFOA, + lpdwBufferLength: LPDWORD, + ) -> c_int; + pub fn WSAEnumProtocolsW( + lpiProtocols: LPINT, + lpProtocolBuffer: LPWSAPROTOCOL_INFOW, + lpdwBufferLength: LPDWORD, + ) -> c_int; + pub fn WSAEventSelect( + s: SOCKET, + hEventObject: WSAEVENT, + lNetworkEvents: c_long, + ) -> c_int; + pub fn WSAGetOverlappedResult( + s: SOCKET, + lpOverlapped: LPWSAOVERLAPPED, + lpcbTransfer: LPDWORD, + fWait: BOOL, + lpdwFlags: LPDWORD, + ) -> BOOL; + pub fn WSAGetQOSByName( + s: SOCKET, + lpQOSName: LPWSABUF, + lpQOS: LPQOS, + ) -> BOOL; + pub fn WSAHtonl( + s: SOCKET, + hostlong: u_long, + lpnetlong: *mut u_long, + ) -> c_int; + pub fn WSAHtons(s: SOCKET, + hostshort: u_short, + lpnetshort: *mut u_short, + ) -> c_int; + pub fn WSAIoctl( + s: SOCKET, + dwIoControlCode: DWORD, + lpvInBuffer: LPVOID, + cbInBuffer: DWORD, + lpvOutBuffer: LPVOID, + cbOutBuffer: DWORD, + lpcbBytesReturned: LPDWORD, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> c_int; + pub fn WSAJoinLeaf( + s: SOCKET, + name: *const SOCKADDR, + namelen: c_int, + lpCallerData: LPWSABUF, + lpCalleeData: LPWSABUF, + lpSQOS: LPQOS, + lpGQOS: LPQOS, + dwFlags: DWORD, + ) -> SOCKET; + pub fn WSANtohl( + s: SOCKET, + netlong: u_long, + lphostlong: *mut c_long, + ) -> c_int; + pub fn WSANtohs( + s: SOCKET, + netshort: u_short, + lphostshort: *mut c_short, + ) -> c_int; + pub fn WSARecv( + s: SOCKET, + lpBuffers: LPWSABUF, + dwBufferCount: DWORD, + lpNumberOfBytesRecvd: LPDWORD, + lpFlags: LPDWORD, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> c_int; + pub fn WSARecvDisconnect( + s: SOCKET, + lpInboundDisconnectData: LPWSABUF, + ) -> c_int; + pub fn WSARecvFrom( + s: SOCKET, + lpBuffers: LPWSABUF, + dwBufferCount: DWORD, + lpNumberOfBytesRecvd: LPDWORD, + lpFlags: LPDWORD, + lpFrom: *mut SOCKADDR, + lpFromlen: LPINT, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> c_int; + pub fn WSAResetEvent( + hEvent: WSAEVENT, + ) -> BOOL; + pub fn WSASend( + s: SOCKET, + lpBuffers: LPWSABUF, + dwBufferCount: DWORD, + lpNumberOfBytesSent: LPDWORD, + dwFlags: DWORD, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> c_int; + pub fn WSASendMsg( + Handle: SOCKET, + lpMsg: LPWSAMSG, + dwFlags: DWORD, + lpNumberOfBytesSent: LPDWORD, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> c_int; + pub fn WSASendDisconnect( + s: SOCKET, + lpOutboundDisconnectData: LPWSABUF, + ) -> c_int; + pub fn WSASendTo( + s: SOCKET, + lpBuffers: LPWSABUF, + dwBufferCount: DWORD, + lpNumberOfBytesSent: LPDWORD, + dwFlags: DWORD, + lpTo: *const SOCKADDR, + iToLen: c_int, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> c_int; + pub fn WSASetEvent( + hEvent: WSAEVENT, + ) -> BOOL; + pub fn WSASocketA( + af: c_int, + _type: c_int, + protocol: c_int, + lpProtocolInfo: LPWSAPROTOCOL_INFOA, + g: GROUP, + dwFlags: DWORD, + ) -> SOCKET; + pub fn WSASocketW( + af: c_int, + _type: c_int, + protocol: c_int, + lpProtocolInfo: LPWSAPROTOCOL_INFOW, + g: GROUP, + dwFlags: DWORD, + ) -> SOCKET; + pub fn WSAWaitForMultipleEvents( + cEvents: DWORD, + lphEvents: *const WSAEVENT, + fWaitAll: BOOL, + dwTimeout: DWORD, + fAlertable: BOOL, + ) -> DWORD; + pub fn WSAAddressToStringA( + lpsaAddress: LPSOCKADDR, + dwAddressLength: DWORD, + lpProtocolInfo: LPWSAPROTOCOL_INFOA, + lpszAddressString: LPSTR, + lpdwAddressStringLength: LPDWORD, + ) -> INT; + pub fn WSAAddressToStringW( + lpsaAddress: LPSOCKADDR, + dwAddressLength: DWORD, + lpProtocolInfo: LPWSAPROTOCOL_INFOW, + lpszAddressString: LPWSTR, + lpdwAddressStringLength: LPDWORD, + ) -> INT; + pub fn WSAStringToAddressA( + AddressString: LPSTR, + AddressFamily: INT, + lpProtocolInfo: LPWSAPROTOCOL_INFOA, + lpAddress: LPSOCKADDR, + lpAddressLength: LPINT, + ) -> INT; + pub fn WSAStringToAddressW( + AddressString: LPWSTR, + AddressFamily: INT, + lpProtocolInfo: LPWSAPROTOCOL_INFOW, + lpAddress: LPSOCKADDR, + lpAddressLength: LPINT, + ) -> INT; + pub fn WSALookupServiceBeginA( + lpqsRestrictions: LPWSAQUERYSETA, + dwControlFlags: DWORD, + lphLookup: LPHANDLE, + ) -> INT; + pub fn WSALookupServiceBeginW( + lpqsRestrictions: LPWSAQUERYSETW, + dwControlFlags: DWORD, + lphLookup: LPHANDLE, + ) -> INT; + pub fn WSALookupServiceNextA( + hLookup: HANDLE, + dwControlFlags: DWORD, + lpdwBufferLength: LPDWORD, + lpqsResults: LPWSAQUERYSETA, + ) -> INT; + pub fn WSALookupServiceNextW( + hLookup: HANDLE, + dwControlFlags: DWORD, + lpdwBufferLength: LPDWORD, + lpqsResults: LPWSAQUERYSETW, + ) -> INT; + pub fn WSANSPIoctl( + hLookup: HANDLE, + dwControlFlags: DWORD, + lpvInBuffer: LPVOID, + cbInBuffer: DWORD, + lpvOutBuffer: LPVOID, + cbOutBuffer: DWORD, + lpcbBytesReturned: LPDWORD, + lpCompletion: LPWSACOMPLETION, + ) -> INT; + pub fn WSALookupServiceEnd( + hLookup: HANDLE, + ) -> INT; + pub fn WSAInstallServiceClassA( + lpServiceClassInfo: LPWSASERVICECLASSINFOA, + ) -> INT; + pub fn WSAInstallServiceClassW( + lpServiceClassInfo: LPWSASERVICECLASSINFOW, + ) -> INT; + pub fn WSARemoveServiceClass( + lpServiceClassId: LPGUID, + ) -> INT; + pub fn WSAGetServiceClassInfoA( + lpProviderId: LPGUID, + lpServiceClassId: LPGUID, + lpdwBufSize: LPDWORD, + lpServiceClassInfo: LPWSASERVICECLASSINFOA, + ) -> INT; + pub fn WSAGetServiceClassInfoW( + lpProviderId: LPGUID, + lpServiceClassId: LPGUID, + lpdwBufSize: LPDWORD, + lpServiceClassInfo: LPWSASERVICECLASSINFOW, + ) -> INT; + pub fn WSAEnumNameSpaceProvidersA( + lpdwBufferLength: LPDWORD, + lpnspBuffer: LPWSANAMESPACE_INFOA, + ) -> INT; + pub fn WSAEnumNameSpaceProvidersW( + lpdwBufferLength: LPDWORD, + lpnspBuffer: LPWSANAMESPACE_INFOW, + ) -> INT; + pub fn WSAEnumNameSpaceProvidersExA( + lpdwBufferLength: LPDWORD, + lpnspBuffer: LPWSANAMESPACE_INFOEXA, + ) -> INT; + pub fn WSAEnumNameSpaceProvidersExW( + lpdwBufferLength: LPDWORD, + lpnspBuffer: LPWSANAMESPACE_INFOEXW, + ) -> INT; + pub fn WSAGetServiceClassNameByClassIdA( + lpServiceClassId: LPGUID, + lpszServiceClassName: LPSTR, + lpdwBufferLength: LPDWORD, + ) -> INT; + pub fn WSAGetServiceClassNameByClassIdW( + lpServiceClassId: LPGUID, + lpszServiceClassName: LPWSTR, + lpdwBufferLength: LPDWORD, + ) -> INT; + pub fn WSASetServiceA( + lpqsRegInfo: LPWSAQUERYSETA, + essoperation: WSAESETSERVICEOP, + dwControlFlags: DWORD, + ) -> INT; + pub fn WSASetServiceW( + lpqsRegInfo: LPWSAQUERYSETW, + essoperation: WSAESETSERVICEOP, + dwControlFlags: DWORD, + ) -> INT; + pub fn WSAProviderConfigChange( + lpNotificationHandle: LPHANDLE, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> INT; + pub fn WSAPoll( + fdArray: LPWSAPOLLFD, + fds: ULONG, + timeout: INT, + ) -> c_int; +} +pub type LPSOCKADDR_IN = *mut SOCKADDR_IN; +pub type LINGER = linger; +pub type PLINGER = *mut linger; +pub type LPLINGER = *mut linger; +pub type FD_SET = fd_set; +pub type PFD_SET = *mut fd_set; +pub type LPFD_SET = *mut fd_set; +pub type HOSTENT = hostent; +pub type PHOSTENT = *mut hostent; +pub type LPHOSTENT = *mut hostent; +pub type SERVENT = servent; +pub type PSERVENT = *mut servent; +pub type LPSERVENT = *mut servent; +pub type PROTOENT = protoent; +pub type PPROTOENT = *mut protoent; +pub type LPPROTOENT = *mut protoent; +pub type TIMEVAL = timeval; +pub type PTIMEVAL = *mut timeval; +pub type LPTIMEVAL = *mut timeval; +#[inline] +pub fn WSAMAKEASYNCREPLY(buflen: WORD, error: WORD) -> LONG { + MAKELONG(buflen, error) +} +#[inline] +pub fn WSAMAKESELECTREPLY(event: WORD, error: WORD) -> LONG { + MAKELONG(event, error) +} +#[inline] +pub fn WSAGETASYNCBUFLEN(lParam: DWORD) -> WORD { + LOWORD(lParam) +} +#[inline] +pub fn WSAGETASYNCERROR(lParam: DWORD) -> WORD { + HIWORD(lParam) +} +#[inline] +pub fn WSAGETSELECTEVENT(lParam: DWORD) -> WORD { + LOWORD(lParam) +} +#[inline] +pub fn WSAGETSELECTERROR(lParam: DWORD) -> WORD { + HIWORD(lParam) +} diff --git a/bash-5.1/vendor/winapi/src/um/winspool.rs b/bash-5.1/vendor/winapi/src/um/winspool.rs new file mode 100644 index 0000000000000000000000000000000000000000..c6796caf3472a59e056d605a2a70db39b67ac137 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winspool.rs @@ -0,0 +1,2433 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Winspool header file +use shared::guiddef::GUID; +use shared::minwindef::{ + BOOL, BYTE, DWORD, FILETIME, FLOAT, LPBYTE, LPDWORD, LPHANDLE, LPVOID, MAX_PATH, PBYTE, PDWORD, + PULONG, PWORD, UINT, ULONG, WORD, +}; +use shared::windef::{HWND, RECTL, SIZEL}; +use shared::winerror::ERROR_NOT_SUPPORTED; +use um::minwinbase::SYSTEMTIME; +use um::wingdi::{LPDEVMODEA, LPDEVMODEW, PDEVMODEA, PDEVMODEW}; +use um::winnt::{ + ACCESS_MASK, CHAR, DWORDLONG, HANDLE, HRESULT, LANGID, LONG, LONGLONG, LPCSTR, LPCWSTR, LPSTR, + LPWSTR, PCWSTR, PSECURITY_DESCRIPTOR, PVOID, PWSTR, STANDARD_RIGHTS_EXECUTE, + STANDARD_RIGHTS_READ, STANDARD_RIGHTS_REQUIRED, STANDARD_RIGHTS_WRITE, WCHAR, +}; +use vc::vcruntime::size_t; +STRUCT!{struct PRINTER_INFO_1A { + Flags: DWORD, + pDescription: LPSTR, + pName: LPSTR, + pComment: LPSTR, +}} +pub type PPRINTER_INFO_1A = *mut PRINTER_INFO_1A; +pub type LPPRINTER_INFO_1A = *mut PRINTER_INFO_1A; +STRUCT!{struct PRINTER_INFO_1W { + Flags: DWORD, + pDescription: LPWSTR, + pName: LPWSTR, + pComment: LPWSTR, +}} +pub type PPRINTER_INFO_1W = *mut PRINTER_INFO_1W; +pub type LPPRINTER_INFO_1W = *mut PRINTER_INFO_1W; +STRUCT!{struct PRINTER_INFO_2A { + pServerName: LPSTR, + pPrinterName: LPSTR, + pShareName: LPSTR, + pPortName: LPSTR, + pDriverName: LPSTR, + pComment: LPSTR, + pLocation: LPSTR, + pDevMode: LPDEVMODEA, + pSepFile: LPSTR, + pPrintProcessor: LPSTR, + pDatatype: LPSTR, + pParameters: LPSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + Attributes: DWORD, + Priority: DWORD, + DefaultPriority: DWORD, + StartTime: DWORD, + UntilTime: DWORD, + Status: DWORD, + cJobs: DWORD, + AveragePPM: DWORD, +}} +pub type PPRINTER_INFO_2A = *mut PRINTER_INFO_2A; +pub type LPPRINTER_INFO_2A = *mut PRINTER_INFO_2A; +STRUCT!{struct PRINTER_INFO_2W { + pServerName: LPWSTR, + pPrinterName: LPWSTR, + pShareName: LPWSTR, + pPortName: LPWSTR, + pDriverName: LPWSTR, + pComment: LPWSTR, + pLocation: LPWSTR, + pDevMode: LPDEVMODEW, + pSepFile: LPWSTR, + pPrintProcessor: LPWSTR, + pDatatype: LPWSTR, + pParameters: LPWSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + Attributes: DWORD, + Priority: DWORD, + DefaultPriority: DWORD, + StartTime: DWORD, + UntilTime: DWORD, + Status: DWORD, + cJobs: DWORD, + AveragePPM: DWORD, +}} +pub type PPRINTER_INFO_2W = *mut PRINTER_INFO_2W; +pub type LPPRINTER_INFO_2W = *mut PRINTER_INFO_2W; +STRUCT!{struct PRINTER_INFO_3 { + pSecurityDescriptor: PSECURITY_DESCRIPTOR, +}} +pub type PPRINTER_INFO_3 = *mut PRINTER_INFO_3; +pub type LPPRINTER_INFO_3 = *mut PRINTER_INFO_3; +STRUCT!{struct PRINTER_INFO_4A { + pPrinterName: LPSTR, + pServerName: LPSTR, + Attributes: DWORD, +}} +pub type PPRINTER_INFO_4A = *mut PRINTER_INFO_4A; +pub type LPPRINTER_INFO_4A = *mut PRINTER_INFO_4A; +STRUCT!{struct PRINTER_INFO_4W { + pPrinterName: LPWSTR, + pServerName: LPWSTR, + Attributes: DWORD, +}} +pub type PPRINTER_INFO_4W = *mut PRINTER_INFO_4W; +pub type LPPRINTER_INFO_4W = *mut PRINTER_INFO_4W; +STRUCT!{struct PRINTER_INFO_5A { + pPrinterName: LPSTR, + pPortName: LPSTR, + Attributes: DWORD, + DeviceNotSelectedTimeout: DWORD, + TransmissionRetryTimeout: DWORD, +}} +pub type PPRINTER_INFO_5A = *mut PRINTER_INFO_5A; +pub type LPPRINTER_INFO_5A = *mut PRINTER_INFO_5A; +STRUCT!{struct PRINTER_INFO_5W { + pPrinterName: LPWSTR, + pPortName: LPWSTR, + Attributes: DWORD, + DeviceNotSelectedTimeout: DWORD, + TransmissionRetryTimeout: DWORD, +}} +pub type PPRINTER_INFO_5W = *mut PRINTER_INFO_5W; +pub type LPPRINTER_INFO_5W = *mut PRINTER_INFO_5W; +STRUCT!{struct PRINTER_INFO_6 { + dwStatus: DWORD, +}} +pub type PPRINTER_INFO_6 = *mut PRINTER_INFO_6; +pub type LPPRINTER_INFO_6 = *mut PRINTER_INFO_6; +STRUCT!{struct PRINTER_INFO_7A { + pszObjectGUID: LPSTR, + dwAction: DWORD, +}} +pub type PPRINTER_INFO_7A = *mut PRINTER_INFO_7A; +pub type LPPRINTER_INFO_7A = *mut PRINTER_INFO_7A; +STRUCT!{struct PRINTER_INFO_7W { + pszObjectGUID: LPWSTR, + dwAction: DWORD, +}} +pub type PPRINTER_INFO_7W = *mut PRINTER_INFO_7W; +pub type LPPRINTER_INFO_7W = *mut PRINTER_INFO_7W; +pub const DSPRINT_PUBLISH: DWORD = 0x00000001; +pub const DSPRINT_UPDATE: DWORD = 0x00000002; +pub const DSPRINT_UNPUBLISH: DWORD = 0x00000004; +pub const DSPRINT_REPUBLISH: DWORD = 0x00000008; +pub const DSPRINT_PENDING: DWORD = 0x80000000; +STRUCT!{struct PRINTER_INFO_8A { + pDevMode: LPDEVMODEA, +}} +pub type PPRINTER_INFO_8A = *mut PRINTER_INFO_8A; +pub type LPPRINTER_INFO_8A = *mut PRINTER_INFO_8A; +STRUCT!{struct PRINTER_INFO_8W { + pDevMode: LPDEVMODEW, +}} +pub type PPRINTER_INFO_8W = *mut PRINTER_INFO_8W; +pub type LPPRINTER_INFO_8W = *mut PRINTER_INFO_8W; +STRUCT!{struct PRINTER_INFO_9A { + pDevMode: LPDEVMODEA, +}} +pub type PPRINTER_INFO_9A = *mut PRINTER_INFO_9A; +pub type LPPRINTER_INFO_9A = *mut PRINTER_INFO_9A; +STRUCT!{struct PRINTER_INFO_9W { + pDevMode: LPDEVMODEW, +}} +pub type PPRINTER_INFO_9W = *mut PRINTER_INFO_9W; +pub type LPPRINTER_INFO_9W = *mut PRINTER_INFO_9W; +pub const PRINTER_CONTROL_PAUSE: DWORD = 1; +pub const PRINTER_CONTROL_RESUME: DWORD = 2; +pub const PRINTER_CONTROL_PURGE: DWORD = 3; +pub const PRINTER_CONTROL_SET_STATUS: DWORD = 4; +pub const PRINTER_STATUS_PAUSED: DWORD = 0x00000001; +pub const PRINTER_STATUS_ERROR: DWORD = 0x00000002; +pub const PRINTER_STATUS_PENDING_DELETION: DWORD = 0x00000004; +pub const PRINTER_STATUS_PAPER_JAM: DWORD = 0x00000008; +pub const PRINTER_STATUS_PAPER_OUT: DWORD = 0x00000010; +pub const PRINTER_STATUS_MANUAL_FEED: DWORD = 0x00000020; +pub const PRINTER_STATUS_PAPER_PROBLEM: DWORD = 0x00000040; +pub const PRINTER_STATUS_OFFLINE: DWORD = 0x00000080; +pub const PRINTER_STATUS_IO_ACTIVE: DWORD = 0x00000100; +pub const PRINTER_STATUS_BUSY: DWORD = 0x00000200; +pub const PRINTER_STATUS_PRINTING: DWORD = 0x00000400; +pub const PRINTER_STATUS_OUTPUT_BIN_FULL: DWORD = 0x00000800; +pub const PRINTER_STATUS_NOT_AVAILABLE: DWORD = 0x00001000; +pub const PRINTER_STATUS_WAITING: DWORD = 0x00002000; +pub const PRINTER_STATUS_PROCESSING: DWORD = 0x00004000; +pub const PRINTER_STATUS_INITIALIZING: DWORD = 0x00008000; +pub const PRINTER_STATUS_WARMING_UP: DWORD = 0x00010000; +pub const PRINTER_STATUS_TONER_LOW: DWORD = 0x00020000; +pub const PRINTER_STATUS_NO_TONER: DWORD = 0x00040000; +pub const PRINTER_STATUS_PAGE_PUNT: DWORD = 0x00080000; +pub const PRINTER_STATUS_USER_INTERVENTION: DWORD = 0x00100000; +pub const PRINTER_STATUS_OUT_OF_MEMORY: DWORD = 0x00200000; +pub const PRINTER_STATUS_DOOR_OPEN: DWORD = 0x00400000; +pub const PRINTER_STATUS_SERVER_UNKNOWN: DWORD = 0x00800000; +pub const PRINTER_STATUS_POWER_SAVE: DWORD = 0x01000000; +pub const PRINTER_STATUS_SERVER_OFFLINE: DWORD = 0x02000000; +pub const PRINTER_STATUS_DRIVER_UPDATE_NEEDED: DWORD = 0x04000000; +pub const PRINTER_ATTRIBUTE_QUEUED: DWORD = 0x00000001; +pub const PRINTER_ATTRIBUTE_DIRECT: DWORD = 0x00000002; +pub const PRINTER_ATTRIBUTE_DEFAULT: DWORD = 0x00000004; +pub const PRINTER_ATTRIBUTE_SHARED: DWORD = 0x00000008; +pub const PRINTER_ATTRIBUTE_NETWORK: DWORD = 0x00000010; +pub const PRINTER_ATTRIBUTE_HIDDEN: DWORD = 0x00000020; +pub const PRINTER_ATTRIBUTE_LOCAL: DWORD = 0x00000040; +pub const PRINTER_ATTRIBUTE_ENABLE_DEVQ: DWORD = 0x00000080; +pub const PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS: DWORD = 0x00000100; +pub const PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST: DWORD = 0x00000200; +pub const PRINTER_ATTRIBUTE_WORK_OFFLINE: DWORD = 0x00000400; +pub const PRINTER_ATTRIBUTE_ENABLE_BIDI: DWORD = 0x00000800; +pub const PRINTER_ATTRIBUTE_RAW_ONLY: DWORD = 0x00001000; +pub const PRINTER_ATTRIBUTE_PUBLISHED: DWORD = 0x00002000; +pub const PRINTER_ATTRIBUTE_FAX: DWORD = 0x00004000; +pub const PRINTER_ATTRIBUTE_TS: DWORD = 0x00008000; +pub const PRINTER_ATTRIBUTE_PUSHED_USER: DWORD = 0x00020000; +pub const PRINTER_ATTRIBUTE_PUSHED_MACHINE: DWORD = 0x00040000; +pub const PRINTER_ATTRIBUTE_MACHINE: DWORD = 0x00080000; +pub const PRINTER_ATTRIBUTE_FRIENDLY_NAME: DWORD = 0x00100000; +pub const PRINTER_ATTRIBUTE_TS_GENERIC_DRIVER: DWORD = 0x00200000; +pub const PRINTER_ATTRIBUTE_PER_USER: DWORD = 0x00400000; +pub const PRINTER_ATTRIBUTE_ENTERPRISE_CLOUD: DWORD = 0x00800000; +pub const NO_PRIORITY: DWORD = 0; +pub const MAX_PRIORITY: DWORD = 99; +pub const MIN_PRIORITY: DWORD = 1; +pub const DEF_PRIORITY: DWORD = 1; +STRUCT!{struct JOB_INFO_1A { + JobId: DWORD, + pPrinterName: LPSTR, + pMachineName: LPSTR, + pUserName: LPSTR, + pDocument: LPSTR, + pDatatype: LPSTR, + pStatus: LPSTR, + Status: DWORD, + Priority: DWORD, + Position: DWORD, + TotalPages: DWORD, + PagesPrinted: DWORD, + Submitted: SYSTEMTIME, +}} +pub type PJOB_INFO_1A = *mut JOB_INFO_1A; +pub type LPJOB_INFO_1A = *mut JOB_INFO_1A; +STRUCT!{struct JOB_INFO_1W { + JobId: DWORD, + pPrinterName: LPWSTR, + pMachineName: LPWSTR, + pUserName: LPWSTR, + pDocument: LPWSTR, + pDatatype: LPWSTR, + pStatus: LPWSTR, + Status: DWORD, + Priority: DWORD, + Position: DWORD, + TotalPages: DWORD, + PagesPrinted: DWORD, + Submitted: SYSTEMTIME, +}} +pub type PJOB_INFO_1W = *mut JOB_INFO_1W; +pub type LPJOB_INFO_1W = *mut JOB_INFO_1W; +STRUCT!{struct JOB_INFO_2A { + JobId: DWORD, + pPrinterName: LPSTR, + pMachineName: LPSTR, + pUserName: LPSTR, + pDocument: LPSTR, + pNotifyName: LPSTR, + pDatatype: LPSTR, + pPrintProcessor: LPSTR, + pParameters: LPSTR, + pDriverName: LPSTR, + pDevMode: LPDEVMODEA, + pStatus: LPSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + Status: DWORD, + Priority: DWORD, + Position: DWORD, + StartTime: DWORD, + UntilTime: DWORD, + TotalPages: DWORD, + Size: DWORD, + Submitted: SYSTEMTIME, + Time: DWORD, + PagesPrinted: DWORD, +}} +pub type PJOB_INFO_2A = *mut JOB_INFO_2A; +pub type LPJOB_INFO_2A = *mut JOB_INFO_2A; +STRUCT!{struct JOB_INFO_2W { + JobId: DWORD, + pPrinterName: LPWSTR, + pMachineName: LPWSTR, + pUserName: LPWSTR, + pDocument: LPWSTR, + pNotifyName: LPWSTR, + pDatatype: LPWSTR, + pPrintProcessor: LPWSTR, + pParameters: LPWSTR, + pDriverName: LPWSTR, + pDevMode: LPDEVMODEW, + pStatus: LPWSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + Status: DWORD, + Priority: DWORD, + Position: DWORD, + StartTime: DWORD, + UntilTime: DWORD, + TotalPages: DWORD, + Size: DWORD, + Submitted: SYSTEMTIME, + Time: DWORD, + PagesPrinted: DWORD, +}} +pub type PJOB_INFO_2W = *mut JOB_INFO_2W; +pub type LPJOB_INFO_2W = *mut JOB_INFO_2W; +STRUCT!{struct JOB_INFO_3 { + JobId: DWORD, + NextJobId: DWORD, + Reserved: DWORD, +}} +pub type PJOB_INFO_3 = *mut JOB_INFO_3; +pub type LPJOB_INFO_3 = *mut JOB_INFO_3; +STRUCT!{struct JOB_INFO_4A { + JobId: DWORD, + pPrinterName: LPSTR, + pMachineName: LPSTR, + pUserName: LPSTR, + pDocument: LPSTR, + pNotifyName: LPSTR, + pDatatype: LPSTR, + pPrintProcessor: LPSTR, + pParameters: LPSTR, + pDriverName: LPSTR, + pDevMode: LPDEVMODEA, + pStatus: LPSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + Status: DWORD, + Priority: DWORD, + Position: DWORD, + StartTime: DWORD, + UntilTime: DWORD, + TotalPages: DWORD, + Size: DWORD, + Submitted: SYSTEMTIME, + Time: DWORD, + PagesPrinted: DWORD, + SizeHigh: LONG, +}} +pub type PJOB_INFO_4A = *mut JOB_INFO_4A; +pub type LPJOB_INFO_4A = *mut JOB_INFO_4A; +STRUCT!{struct JOB_INFO_4W { + JobId: DWORD, + pPrinterName: LPWSTR, + pMachineName: LPWSTR, + pUserName: LPWSTR, + pDocument: LPWSTR, + pNotifyName: LPWSTR, + pDatatype: LPWSTR, + pPrintProcessor: LPWSTR, + pParameters: LPWSTR, + pDriverName: LPWSTR, + pDevMode: LPDEVMODEW, + pStatus: LPWSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + Status: DWORD, + Priority: DWORD, + Position: DWORD, + StartTime: DWORD, + UntilTime: DWORD, + TotalPages: DWORD, + Size: DWORD, + Submitted: SYSTEMTIME, + Time: DWORD, + PagesPrinted: DWORD, + SizeHigh: LONG, +}} +pub type PJOB_INFO_4W = *mut JOB_INFO_4W; +pub type LPJOB_INFO_4W = *mut JOB_INFO_4W; +pub const JOB_CONTROL_PAUSE: DWORD = 1; +pub const JOB_CONTROL_RESUME: DWORD = 2; +pub const JOB_CONTROL_CANCEL: DWORD = 3; +pub const JOB_CONTROL_RESTART: DWORD = 4; +pub const JOB_CONTROL_DELETE: DWORD = 5; +pub const JOB_CONTROL_SENT_TO_PRINTER: DWORD = 6; +pub const JOB_CONTROL_LAST_PAGE_EJECTED: DWORD = 7; +pub const JOB_STATUS_PAUSED: DWORD = 0x00000001; +pub const JOB_STATUS_ERROR: DWORD = 0x00000002; +pub const JOB_STATUS_DELETING: DWORD = 0x00000004; +pub const JOB_STATUS_SPOOLING: DWORD = 0x00000008; +pub const JOB_STATUS_PRINTING: DWORD = 0x00000010; +pub const JOB_STATUS_OFFLINE: DWORD = 0x00000020; +pub const JOB_STATUS_PAPEROUT: DWORD = 0x00000040; +pub const JOB_STATUS_PRINTED: DWORD = 0x00000080; +pub const JOB_STATUS_DELETED: DWORD = 0x00000100; +pub const JOB_STATUS_BLOCKED_DEVQ: DWORD = 0x00000200; +pub const JOB_STATUS_USER_INTERVENTION: DWORD = 0x00000400; +pub const JOB_STATUS_RESTART: DWORD = 0x00000800; +pub const JOB_POSITION_UNSPECIFIED: DWORD = 0; +STRUCT!{struct ADDJOB_INFO_1A { + Path: LPSTR, + JobId: DWORD, +}} +pub type PADDJOB_INFO_1A = *mut ADDJOB_INFO_1A; +pub type LPADDJOB_INFO_1A = *mut ADDJOB_INFO_1A; +STRUCT!{struct ADDJOB_INFO_1W { + Path: LPWSTR, + JobId: DWORD, +}} +pub type PADDJOB_INFO_1W = *mut ADDJOB_INFO_1W; +pub type LPADDJOB_INFO_1W = *mut ADDJOB_INFO_1W; +STRUCT!{struct DRIVER_INFO_1A { + pName: LPSTR, +}} +pub type PDRIVER_INFO_1A = *mut DRIVER_INFO_1A; +pub type LPDRIVER_INFO_1A = *mut DRIVER_INFO_1A; +STRUCT!{struct DRIVER_INFO_1W { + pName: LPWSTR, +}} +pub type PDRIVER_INFO_1W = *mut DRIVER_INFO_1W; +pub type LPDRIVER_INFO_1W = *mut DRIVER_INFO_1W; +STRUCT!{struct DRIVER_INFO_2A { + cVersion: DWORD, + pName: LPSTR, + pEnvironment: LPSTR, + pDriverPath: LPSTR, + pDataFile: LPSTR, + pConfigFile: LPSTR, +}} +pub type PDRIVER_INFO_2A = *mut DRIVER_INFO_2A; +pub type LPDRIVER_INFO_2A = *mut DRIVER_INFO_2A; +STRUCT!{struct DRIVER_INFO_2W { + cVersion: DWORD, + pName: LPWSTR, + pEnvironment: LPWSTR, + pDriverPath: LPWSTR, + pDataFile: LPWSTR, + pConfigFile: LPWSTR, +}} +pub type PDRIVER_INFO_2W = *mut DRIVER_INFO_2W; +pub type LPDRIVER_INFO_2W = *mut DRIVER_INFO_2W; +STRUCT!{struct DRIVER_INFO_3A { + cVersion: DWORD, + pName: LPSTR, + pEnvironment: LPSTR, + pDriverPath: LPSTR, + pDataFile: LPSTR, + pConfigFile: LPSTR, + pHelpFile: LPSTR, + pDependentFiles: LPSTR, + pMonitorName: LPSTR, + pDefaultDataType: LPSTR, +}} +pub type PDRIVER_INFO_3A = *mut DRIVER_INFO_3A; +pub type LPDRIVER_INFO_3A = *mut DRIVER_INFO_3A; +STRUCT!{struct DRIVER_INFO_3W { + cVersion: DWORD, + pName: LPWSTR, + pEnvironment: LPWSTR, + pDriverPath: LPWSTR, + pDataFile: LPWSTR, + pConfigFile: LPWSTR, + pHelpFile: LPWSTR, + pDependentFiles: LPWSTR, + pMonitorName: LPWSTR, + pDefaultDataType: LPWSTR, +}} +pub type PDRIVER_INFO_3W = *mut DRIVER_INFO_3W; +pub type LPDRIVER_INFO_3W = *mut DRIVER_INFO_3W; +STRUCT!{struct DRIVER_INFO_4A { + cVersion: DWORD, + pName: LPSTR, + pEnvironment: LPSTR, + pDriverPath: LPSTR, + pDataFile: LPSTR, + pConfigFile: LPSTR, + pHelpFile: LPSTR, + pDependentFiles: LPSTR, + pMonitorName: LPSTR, + pDefaultDataType: LPSTR, + pszzPreviousNames: LPSTR, +}} +pub type PDRIVER_INFO_4A = *mut DRIVER_INFO_4A; +pub type LPDRIVER_INFO_4A = *mut DRIVER_INFO_4A; +STRUCT!{struct DRIVER_INFO_4W { + cVersion: DWORD, + pName: LPWSTR, + pEnvironment: LPWSTR, + pDriverPath: LPWSTR, + pDataFile: LPWSTR, + pConfigFile: LPWSTR, + pHelpFile: LPWSTR, + pDependentFiles: LPWSTR, + pMonitorName: LPWSTR, + pDefaultDataType: LPWSTR, + pszzPreviousNames: LPWSTR, +}} +pub type PDRIVER_INFO_4W = *mut DRIVER_INFO_4W; +pub type LPDRIVER_INFO_4W = *mut DRIVER_INFO_4W; +STRUCT!{struct DRIVER_INFO_5A { + cVersion: DWORD, + pName: LPSTR, + pEnvironment: LPSTR, + pDriverPath: LPSTR, + pDataFile: LPSTR, + pConfigFile: LPSTR, + dwDriverAttributes: DWORD, + dwConfigVersion: DWORD, + dwDriverVersion: DWORD, +}} +pub type PDRIVER_INFO_5A = *mut DRIVER_INFO_5A; +pub type LPDRIVER_INFO_5A = *mut DRIVER_INFO_5A; +STRUCT!{struct DRIVER_INFO_5W { + cVersion: DWORD, + pName: LPWSTR, + pEnvironment: LPWSTR, + pDriverPath: LPWSTR, + pDataFile: LPWSTR, + pConfigFile: LPWSTR, + dwDriverAttributes: DWORD, + dwConfigVersion: DWORD, + dwDriverVersion: DWORD, +}} +pub type PDRIVER_INFO_5W = *mut DRIVER_INFO_5W; +pub type LPDRIVER_INFO_5W = *mut DRIVER_INFO_5W; +STRUCT!{struct DRIVER_INFO_6A { + cVersion: DWORD, + pName: LPSTR, + pEnvironment: LPSTR, + pDriverPath: LPSTR, + pDataFile: LPSTR, + pConfigFile: LPSTR, + pHelpFile: LPSTR, + pDependentFiles: LPSTR, + pMonitorName: LPSTR, + pDefaultDataType: LPSTR, + pszzPreviousNames: LPSTR, + ftDriverDate: FILETIME, + dwlDriverVersion: DWORDLONG, + pszMfgName: LPSTR, + pszOEMUrl: LPSTR, + pszHardwareID: LPSTR, + pszProvider: LPSTR, +}} +pub type PDRIVER_INFO_6A = *mut DRIVER_INFO_6A; +pub type LPDRIVER_INFO_6A = *mut DRIVER_INFO_6A; +STRUCT!{struct DRIVER_INFO_6W { + cVersion: DWORD, + pName: LPWSTR, + pEnvironment: LPWSTR, + pDriverPath: LPWSTR, + pDataFile: LPWSTR, + pConfigFile: LPWSTR, + pHelpFile: LPWSTR, + pDependentFiles: LPWSTR, + pMonitorName: LPWSTR, + pDefaultDataType: LPWSTR, + pszzPreviousNames: LPWSTR, + ftDriverDate: FILETIME, + dwlDriverVersion: DWORDLONG, + pszMfgName: LPWSTR, + pszOEMUrl: LPWSTR, + pszHardwareID: LPWSTR, + pszProvider: LPWSTR, +}} +pub type PDRIVER_INFO_6W = *mut DRIVER_INFO_6W; +pub type LPDRIVER_INFO_6W = *mut DRIVER_INFO_6W; +pub const PRINTER_DRIVER_PACKAGE_AWARE: DWORD = 0x00000001; +pub const PRINTER_DRIVER_XPS: DWORD = 0x00000002; +pub const PRINTER_DRIVER_SANDBOX_ENABLED: DWORD = 0x00000004; +pub const PRINTER_DRIVER_CLASS: DWORD = 0x00000008; +pub const PRINTER_DRIVER_DERIVED: DWORD = 0x00000010; +pub const PRINTER_DRIVER_NOT_SHAREABLE: DWORD = 0x00000020; +pub const PRINTER_DRIVER_CATEGORY_FAX: DWORD = 0x00000040; +pub const PRINTER_DRIVER_CATEGORY_FILE: DWORD = 0x00000080; +pub const PRINTER_DRIVER_CATEGORY_VIRTUAL: DWORD = 0x00000100; +pub const PRINTER_DRIVER_CATEGORY_SERVICE: DWORD = 0x00000200; +pub const PRINTER_DRIVER_SOFT_RESET_REQUIRED: DWORD = 0x00000400; +pub const PRINTER_DRIVER_SANDBOX_DISABLED: DWORD = 0x00000800; +pub const PRINTER_DRIVER_CATEGORY_3D: DWORD = 0x00001000; +pub const PRINTER_DRIVER_CATEGORY_CLOUD: DWORD = 0x00002000; +STRUCT!{struct DRIVER_INFO_8A { + cVersion: DWORD, + pName: LPSTR, + pEnvironment: LPSTR, + pDriverPath: LPSTR, + pDataFile: LPSTR, + pConfigFile: LPSTR, + pHelpFile: LPSTR, + pDependentFiles: LPSTR, + pMonitorName: LPSTR, + pDefaultDataType: LPSTR, + pszzPreviousNames: LPSTR, + ftDriverDate: FILETIME, + dwlDriverVersion: DWORDLONG, + pszMfgName: LPSTR, + pszOEMUrl: LPSTR, + pszHardwareID: LPSTR, + pszProvider: LPSTR, + pszPrintProcessor: LPSTR, + pszVendorSetup: LPSTR, + pszzColorProfiles: LPSTR, + pszInfPath: LPSTR, + dwPrinterDriverAttributes: DWORD, + pszzCoreDriverDependencies: LPSTR, + ftMinInboxDriverVerDate: FILETIME, + dwlMinInboxDriverVerVersion: DWORDLONG, +}} +pub type PDRIVER_INFO_8A = *mut DRIVER_INFO_8A; +pub type LPDRIVER_INFO_8A = *mut DRIVER_INFO_8A; +STRUCT!{struct DRIVER_INFO_8W { + cVersion: DWORD, + pName: LPWSTR, + pEnvironment: LPWSTR, + pDriverPath: LPWSTR, + pDataFile: LPWSTR, + pConfigFile: LPWSTR, + pHelpFile: LPWSTR, + pDependentFiles: LPWSTR, + pMonitorName: LPWSTR, + pDefaultDataType: LPWSTR, + pszzPreviousNames: LPWSTR, + ftDriverDate: FILETIME, + dwlDriverVersion: DWORDLONG, + pszMfgName: LPWSTR, + pszOEMUrl: LPWSTR, + pszHardwareID: LPWSTR, + pszProvider: LPWSTR, + pszPrintProcessor: LPWSTR, + pszVendorSetup: LPWSTR, + pszzColorProfiles: LPWSTR, + pszInfPath: LPWSTR, + dwPrinterDriverAttributes: DWORD, + pszzCoreDriverDependencies: LPWSTR, + ftMinInboxDriverVerDate: FILETIME, + dwlMinInboxDriverVerVersion: DWORDLONG, +}} +pub type PDRIVER_INFO_8W = *mut DRIVER_INFO_8W; +pub type LPDRIVER_INFO_8W = *mut DRIVER_INFO_8W; +pub const DRIVER_KERNELMODE: DWORD = 0x00000001; +pub const DRIVER_USERMODE: DWORD = 0x00000002; +pub const DPD_DELETE_UNUSED_FILES: DWORD = 0x00000001; +pub const DPD_DELETE_SPECIFIC_VERSION: DWORD = 0x00000002; +pub const DPD_DELETE_ALL_FILES: DWORD = 0x00000004; +pub const APD_STRICT_UPGRADE: DWORD = 0x00000001; +pub const APD_STRICT_DOWNGRADE: DWORD = 0x00000002; +pub const APD_COPY_ALL_FILES: DWORD = 0x00000004; +pub const APD_COPY_NEW_FILES: DWORD = 0x00000008; +pub const APD_COPY_FROM_DIRECTORY: DWORD = 0x00000010; +STRUCT!{struct DOC_INFO_1A { + pDocName: LPSTR, + pOutputFile: LPSTR, + pDatatype: LPSTR, +}} +pub type PDOC_INFO_1A = *mut DOC_INFO_1A; +pub type LPDOC_INFO_1A = *mut DOC_INFO_1A; +STRUCT!{struct DOC_INFO_1W { + pDocName: LPWSTR, + pOutputFile: LPWSTR, + pDatatype: LPWSTR, +}} +pub type PDOC_INFO_1W = *mut DOC_INFO_1W; +pub type LPDOC_INFO_1W = *mut DOC_INFO_1W; +STRUCT!{struct FORM_INFO_1A { + Flags: DWORD, + pName: LPSTR, + Size: SIZEL, + ImageableArea: RECTL, +}} +pub type PFORM_INFO_1A = *mut FORM_INFO_1A; +pub type LPFORM_INFO_1A = *mut FORM_INFO_1A; +STRUCT!{struct FORM_INFO_1W { + Flags: DWORD, + pName: LPWSTR, + Size: SIZEL, + ImageableArea: RECTL, +}} +pub type PFORM_INFO_1W = *mut FORM_INFO_1W; +pub type LPFORM_INFO_1W = *mut FORM_INFO_1W; +pub const STRING_NONE: DWORD = 0x00000001; +pub const STRING_MUIDLL: DWORD = 0x00000002; +pub const STRING_LANGPAIR: DWORD = 0x00000004; +pub const MAX_FORM_KEYWORD_LENGTH: usize = 63 + 1; +STRUCT!{struct FORM_INFO_2A { + Flags: DWORD, + pName: LPCSTR, + Size: SIZEL, + ImageableArea: RECTL, + pKeyword: LPCSTR, + StringType: DWORD, + pMuiDll: LPCSTR, + dwResourceId: DWORD, + pDisplayName: LPCSTR, + wLangId: LANGID, +}} +pub type PFORM_INFO_2A = *mut FORM_INFO_2A; +pub type LPFORM_INFO_2A = *mut FORM_INFO_2A; +STRUCT!{struct FORM_INFO_2W { + Flags: DWORD, + pName: LPCWSTR, + Size: SIZEL, + ImageableArea: RECTL, + pKeyword: LPCSTR, + StringType: DWORD, + pMuiDll: LPCWSTR, + dwResourceId: DWORD, + pDisplayName: LPCWSTR, + wLangId: LANGID, +}} +pub type PFORM_INFO_2W = *mut FORM_INFO_2W; +pub type LPFORM_INFO_2W = *mut FORM_INFO_2W; +STRUCT!{struct DOC_INFO_2A { + pDocName: LPSTR, + pOutputFile: LPSTR, + pDatatype: LPSTR, + dwMode: DWORD, + JobId: DWORD, +}} +pub type PDOC_INFO_2A = *mut DOC_INFO_2A; +pub type LPDOC_INFO_2A = *mut DOC_INFO_2A; +STRUCT!{struct DOC_INFO_2W { + pDocName: LPWSTR, + pOutputFile: LPWSTR, + pDatatype: LPWSTR, + dwMode: DWORD, + JobId: DWORD, +}} +pub type PDOC_INFO_2W = *mut DOC_INFO_2W; +pub type LPDOC_INFO_2W = *mut DOC_INFO_2W; +pub const DI_CHANNEL: DWORD = 1; +pub const DI_READ_SPOOL_JOB: DWORD = 3; +STRUCT!{struct DOC_INFO_3A { + pDocName: LPSTR, + pOutputFile: LPSTR, + pDatatype: LPSTR, + dwFlags: DWORD, +}} +pub type PDOC_INFO_3A = *mut DOC_INFO_3A; +pub type LPDOC_INFO_3A = *mut DOC_INFO_3A; +STRUCT!{struct DOC_INFO_3W { + pDocName: LPWSTR, + pOutputFile: LPWSTR, + pDatatype: LPWSTR, + dwFlags: DWORD, +}} +pub type PDOC_INFO_3W = *mut DOC_INFO_3W; +pub type LPDOC_INFO_3W = *mut DOC_INFO_3W; +pub const DI_MEMORYMAP_WRITE: DWORD = 0x00000001; +pub const FORM_USER: DWORD = 0x00000000; +pub const FORM_BUILTIN: DWORD = 0x00000001; +pub const FORM_PRINTER: DWORD = 0x00000002; +STRUCT!{struct PRINTPROCESSOR_INFO_1A { + pName: LPSTR, +}} +pub type PPRINTPROCESSOR_INFO_1A = *mut PRINTPROCESSOR_INFO_1A; +pub type LPPRINTPROCESSOR_INFO_1A = *mut PRINTPROCESSOR_INFO_1A; +STRUCT!{struct PRINTPROCESSOR_INFO_1W { + pName: LPWSTR, +}} +pub type PPRINTPROCESSOR_INFO_1W = *mut PRINTPROCESSOR_INFO_1W; +pub type LPPRINTPROCESSOR_INFO_1W = *mut PRINTPROCESSOR_INFO_1W; +STRUCT!{struct PRINTPROCESSOR_CAPS_1 { + dwLevel: DWORD, + dwNupOptions: DWORD, + dwPageOrderFlags: DWORD, + dwNumberOfCopies: DWORD, +}} +pub type PPRINTPROCESSOR_CAPS_1 = *mut PRINTPROCESSOR_CAPS_1; +STRUCT!{struct PRINTPROCESSOR_CAPS_2 { + dwLevel: DWORD, + dwNupOptions: DWORD, + dwPageOrderFlags: DWORD, + dwNumberOfCopies: DWORD, + dwDuplexHandlingCaps: DWORD, + dwNupDirectionCaps: DWORD, + dwNupBorderCaps: DWORD, + dwBookletHandlingCaps: DWORD, + dwScalingCaps: DWORD, +}} +pub type PPRINTPROCESSOR_CAPS_2 = *mut PRINTPROCESSOR_CAPS_2; +pub const PPCAPS_RIGHT_THEN_DOWN: DWORD = 0x00000001; +pub const PPCAPS_DOWN_THEN_RIGHT: DWORD = 0x00000001 << 1; +pub const PPCAPS_LEFT_THEN_DOWN: DWORD = 0x00000001 << 2; +pub const PPCAPS_DOWN_THEN_LEFT: DWORD = 0x00000001 << 3; +pub const PPCAPS_BORDER_PRINT: DWORD = 0x00000001; +pub const PPCAPS_BOOKLET_EDGE: DWORD = 0x00000001; +pub const PPCAPS_REVERSE_PAGES_FOR_REVERSE_DUPLEX: DWORD = 0x00000001; +pub const PPCAPS_DONT_SEND_EXTRA_PAGES_FOR_DUPLEX: DWORD = 0x00000001 << 1; +pub const PPCAPS_SQUARE_SCALING: DWORD = 0x00000001; +STRUCT!{struct PORT_INFO_1A { + pName: LPSTR, +}} +pub type PPORT_INFO_1A = *mut PORT_INFO_1A; +pub type LPPORT_INFO_1A = *mut PORT_INFO_1A; +STRUCT!{struct PORT_INFO_1W { + pName: LPWSTR, +}} +pub type PPORT_INFO_1W = *mut PORT_INFO_1W; +pub type LPPORT_INFO_1W = *mut PORT_INFO_1W; +STRUCT!{struct PORT_INFO_2A { + pPortName: LPSTR, + pMonitorName: LPSTR, + pDescription: LPSTR, + fPortType: DWORD, + Reserved: DWORD, +}} +pub type PPORT_INFO_2A = *mut PORT_INFO_2A; +pub type LPPORT_INFO_2A = *mut PORT_INFO_2A; +STRUCT!{struct PORT_INFO_2W { + pPortName: LPWSTR, + pMonitorName: LPWSTR, + pDescription: LPWSTR, + fPortType: DWORD, + Reserved: DWORD, +}} +pub type PPORT_INFO_2W = *mut PORT_INFO_2W; +pub type LPPORT_INFO_2W = *mut PORT_INFO_2W; +pub const PORT_TYPE_WRITE: DWORD = 0x0001; +pub const PORT_TYPE_READ: DWORD = 0x0002; +pub const PORT_TYPE_REDIRECTED: DWORD = 0x0004; +pub const PORT_TYPE_NET_ATTACHED: DWORD = 0x0008; +STRUCT!{struct PORT_INFO_3A { + dwStatus: DWORD, + pszStatus: LPSTR, + dwSeverity: DWORD, +}} +pub type PPORT_INFO_3A = *mut PORT_INFO_3A; +pub type LPPORT_INFO_3A = *mut PORT_INFO_3A; +STRUCT!{struct PORT_INFO_3W { + dwStatus: DWORD, + pszStatus: LPWSTR, + dwSeverity: DWORD, +}} +pub type PPORT_INFO_3W = *mut PORT_INFO_3W; +pub type LPPORT_INFO_3W = *mut PORT_INFO_3W; +pub const PORT_STATUS_TYPE_ERROR: DWORD = 1; +pub const PORT_STATUS_TYPE_WARNING: DWORD = 2; +pub const PORT_STATUS_TYPE_INFO: DWORD = 3; +pub const PORT_STATUS_OFFLINE: DWORD = 1; +pub const PORT_STATUS_PAPER_JAM: DWORD = 2; +pub const PORT_STATUS_PAPER_OUT: DWORD = 3; +pub const PORT_STATUS_OUTPUT_BIN_FULL: DWORD = 4; +pub const PORT_STATUS_PAPER_PROBLEM: DWORD = 5; +pub const PORT_STATUS_NO_TONER: DWORD = 6; +pub const PORT_STATUS_DOOR_OPEN: DWORD = 7; +pub const PORT_STATUS_USER_INTERVENTION: DWORD = 8; +pub const PORT_STATUS_OUT_OF_MEMORY: DWORD = 9; +pub const PORT_STATUS_TONER_LOW: DWORD = 10; +pub const PORT_STATUS_WARMING_UP: DWORD = 11; +pub const PORT_STATUS_POWER_SAVE: DWORD = 12; +STRUCT!{struct MONITOR_INFO_1A { + pName: LPSTR, +}} +pub type PMONITOR_INFO_1A = *mut MONITOR_INFO_1A; +pub type LPMONITOR_INFO_1A = *mut MONITOR_INFO_1A; +STRUCT!{struct MONITOR_INFO_1W { + pName: LPWSTR, +}} +pub type PMONITOR_INFO_1W = *mut MONITOR_INFO_1W; +pub type LPMONITOR_INFO_1W = *mut MONITOR_INFO_1W; +STRUCT!{struct MONITOR_INFO_2A { + pName: LPSTR, + pEnvironment: LPSTR, + pDLLName: LPSTR, +}} +pub type PMONITOR_INFO_2A = *mut MONITOR_INFO_2A; +pub type LPMONITOR_INFO_2A = *mut MONITOR_INFO_2A; +STRUCT!{struct MONITOR_INFO_2W { + pName: LPWSTR, + pEnvironment: LPWSTR, + pDLLName: LPWSTR, +}} +pub type PMONITOR_INFO_2W = *mut MONITOR_INFO_2W; +pub type LPMONITOR_INFO_2W = *mut MONITOR_INFO_2W; +STRUCT!{struct DATATYPES_INFO_1A { + pName: LPSTR, +}} +pub type PDATATYPES_INFO_1A = *mut DATATYPES_INFO_1A; +pub type LPDATATYPES_INFO_1A = *mut DATATYPES_INFO_1A; +STRUCT!{struct DATATYPES_INFO_1W { + pName: LPWSTR, +}} +pub type PDATATYPES_INFO_1W = *mut DATATYPES_INFO_1W; +pub type LPDATATYPES_INFO_1W = *mut DATATYPES_INFO_1W; +STRUCT!{struct PRINTER_DEFAULTSA { + pDataType: LPSTR, + pDevMode: LPDEVMODEA, + DesiredAccess: ACCESS_MASK, +}} +pub type PPRINTER_DEFAULTSA = *mut PRINTER_DEFAULTSA; +pub type LPPRINTER_DEFAULTSA = *mut PRINTER_DEFAULTSA; +STRUCT!{struct PRINTER_DEFAULTSW { + pDataType: LPWSTR, + pDevMode: LPDEVMODEW, + DesiredAccess: ACCESS_MASK, +}} +pub type PPRINTER_DEFAULTSW = *mut PRINTER_DEFAULTSW; +pub type LPPRINTER_DEFAULTSW = *mut PRINTER_DEFAULTSW; +STRUCT!{struct PRINTER_ENUM_VALUESA { + pValueName: LPSTR, + cbValueName: DWORD, + dwType: DWORD, + pData: LPBYTE, + cbData: DWORD, +}} +pub type PPRINTER_ENUM_VALUESA = *mut PRINTER_ENUM_VALUESA; +pub type LPPRINTER_ENUM_VALUESA = *mut PRINTER_ENUM_VALUESA; +STRUCT!{struct PRINTER_ENUM_VALUESW { + pValueName: LPWSTR, + cbValueName: DWORD, + dwType: DWORD, + pData: LPBYTE, + cbData: DWORD, +}} +pub type PPRINTER_ENUM_VALUESW = *mut PRINTER_ENUM_VALUESW; +pub type LPPRINTER_ENUM_VALUESW = *mut PRINTER_ENUM_VALUESW; +extern "system" { + pub fn EnumPrintersA( + Flags: DWORD, + Name: LPSTR, + Level: DWORD, + pPrinterEnum: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn EnumPrintersW( + Flags: DWORD, + Name: LPWSTR, + Level: DWORD, + pPrinterEnum: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; +} +pub const PRINTER_ENUM_DEFAULT: DWORD = 0x00000001; +pub const PRINTER_ENUM_LOCAL: DWORD = 0x00000002; +pub const PRINTER_ENUM_CONNECTIONS: DWORD = 0x00000004; +pub const PRINTER_ENUM_FAVORITE: DWORD = 0x00000004; +pub const PRINTER_ENUM_NAME: DWORD = 0x00000008; +pub const PRINTER_ENUM_REMOTE: DWORD = 0x00000010; +pub const PRINTER_ENUM_SHARED: DWORD = 0x00000020; +pub const PRINTER_ENUM_NETWORK: DWORD = 0x00000040; +pub const PRINTER_ENUM_EXPAND: DWORD = 0x00004000; +pub const PRINTER_ENUM_CONTAINER: DWORD = 0x00008000; +pub const PRINTER_ENUM_ICONMASK: DWORD = 0x00ff0000; +pub const PRINTER_ENUM_ICON1: DWORD = 0x00010000; +pub const PRINTER_ENUM_ICON2: DWORD = 0x00020000; +pub const PRINTER_ENUM_ICON3: DWORD = 0x00040000; +pub const PRINTER_ENUM_ICON4: DWORD = 0x00080000; +pub const PRINTER_ENUM_ICON5: DWORD = 0x00100000; +pub const PRINTER_ENUM_ICON6: DWORD = 0x00200000; +pub const PRINTER_ENUM_ICON7: DWORD = 0x00400000; +pub const PRINTER_ENUM_ICON8: DWORD = 0x00800000; +pub const PRINTER_ENUM_HIDE: DWORD = 0x01000000; +pub const PRINTER_ENUM_CATEGORY_ALL: DWORD = 0x02000000; +pub const PRINTER_ENUM_CATEGORY_3D: DWORD = 0x04000000; +pub const SPOOL_FILE_PERSISTENT: DWORD = 0x00000001; +pub const SPOOL_FILE_TEMPORARY: DWORD = 0x00000002; +extern "system" { + pub fn GetSpoolFileHandle( + hPrinter: HANDLE, + ) -> HANDLE; + pub fn CommitSpoolData( + hPrinter: HANDLE, + hSpoolFile: HANDLE, + cbCommit: DWORD, + ) -> HANDLE; + pub fn CloseSpoolFileHandle( + hPrinter: HANDLE, + hSpoolFile: HANDLE, + ) -> BOOL; + pub fn OpenPrinterA( + pPrinterName: LPSTR, + phPrinter: LPHANDLE, + pDefault: LPPRINTER_DEFAULTSA, + ) -> BOOL; + pub fn OpenPrinterW( + pPrinterName: LPWSTR, + phPrinter: LPHANDLE, + pDefault: LPPRINTER_DEFAULTSW, + ) -> BOOL; + pub fn ResetPrinterA( + hPrinter: HANDLE, + pDefault: LPPRINTER_DEFAULTSA, + ) -> BOOL; + pub fn ResetPrinterW( + hPrinter: HANDLE, + pDefault: LPPRINTER_DEFAULTSW, + ) -> BOOL; + pub fn SetJobA( + hPrinter: HANDLE, + JobId: DWORD, + Level: DWORD, + pJob: LPBYTE, + Command: DWORD, + ) -> BOOL; + pub fn SetJobW( + hPrinter: HANDLE, + JobId: DWORD, + Level: DWORD, + pJob: LPBYTE, + Command: DWORD, + ) -> BOOL; + pub fn GetJobA( + hPrinter: HANDLE, + JobId: DWORD, + Level: DWORD, + pJob: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn GetJobW( + hPrinter: HANDLE, + JobId: DWORD, + Level: DWORD, + pJob: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn EnumJobsA( + hPrinter: HANDLE, + FirstJob: DWORD, + NoJobs: DWORD, + Level: DWORD, + pJob: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn EnumJobsW( + hPrinter: HANDLE, + FirstJob: DWORD, + NoJobs: DWORD, + Level: DWORD, + pJob: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn AddPrinterA( + pName: LPSTR, + Level: DWORD, + pPrinter: LPBYTE, + ) -> HANDLE; + pub fn AddPrinterW( + pName: LPWSTR, + Level: DWORD, + pPrinter: LPBYTE, + ) -> HANDLE; + pub fn DeletePrinter( + hPrinter: HANDLE, + ) -> BOOL; + pub fn SetPrinterA( + hPrinter: HANDLE, + Level: DWORD, + pPrinter: LPBYTE, + Command: DWORD, + ) -> BOOL; + pub fn SetPrinterW( + hPrinter: HANDLE, + Level: DWORD, + pPrinter: LPBYTE, + Command: DWORD, + ) -> BOOL; + pub fn GetPrinterA( + hPrinter: HANDLE, + Level: DWORD, + pPrinter: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn GetPrinterW( + hPrinter: HANDLE, + Level: DWORD, + pPrinter: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn AddPrinterDriverA( + pName: LPSTR, + Level: DWORD, + pDriverInfo: LPBYTE, + ) -> BOOL; + pub fn AddPrinterDriverW( + pName: LPWSTR, + Level: DWORD, + pDriverInfo: LPBYTE, + ) -> BOOL; + pub fn AddPrinterDriverExA( + pName: LPSTR, + Level: DWORD, + pDriverInfo: PBYTE, + dwFileCopyFlags: DWORD, + ) -> BOOL; + pub fn AddPrinterDriverExW( + pName: LPWSTR, + Level: DWORD, + pDriverInfo: PBYTE, + dwFileCopyFlags: DWORD, + ) -> BOOL; + pub fn EnumPrinterDriversA( + pName: LPSTR, + pEnvironment: LPSTR, + Level: DWORD, + pDriverInfo: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn EnumPrinterDriversW( + pName: LPWSTR, + pEnvironment: LPWSTR, + Level: DWORD, + pDriverInfo: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn GetPrinterDriverA( + hPrinter: HANDLE, + pEnvironment: LPSTR, + Level: DWORD, + pDriverInfo: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn GetPrinterDriverW( + hPrinter: HANDLE, + pEnvironment: LPWSTR, + Level: DWORD, + pDriverInfo: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn GetPrinterDriverDirectoryA( + pName: LPSTR, + pEnvironment: LPSTR, + Level: DWORD, + pDriverDirectory: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn GetPrinterDriverDirectoryW( + pName: LPWSTR, + pEnvironment: LPWSTR, + Level: DWORD, + pDriverDirectory: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn DeletePrinterDriverA( + pName: LPSTR, + pEnvironment: LPSTR, + pDriverName: LPSTR, + ) -> BOOL; + pub fn DeletePrinterDriverW( + pName: LPWSTR, + pEnvironment: LPWSTR, + pDriverName: LPWSTR, + ) -> BOOL; + pub fn DeletePrinterDriverExA( + pName: LPSTR, + pEnvironment: LPSTR, + pDriverName: LPSTR, + dwDeleteFlag: DWORD, + dwVersionFlag: DWORD, + ) -> BOOL; + pub fn DeletePrinterDriverExW( + pName: LPWSTR, + pEnvironment: LPWSTR, + pDriverName: LPWSTR, + dwDeleteFlag: DWORD, + dwVersionFlag: DWORD, + ) -> BOOL; + pub fn AddPrintProcessorA( + pName: LPSTR, + pEnvironment: LPSTR, + pPathName: LPSTR, + pPrintProcessorName: LPSTR, + ) -> BOOL; + pub fn AddPrintProcessorW( + pName: LPWSTR, + pEnvironment: LPWSTR, + pPathName: LPWSTR, + pPrintProcessorName: LPWSTR, + ) -> BOOL; + pub fn EnumPrintProcessorsA( + pName: LPSTR, + pEnvironment: LPSTR, + Level: DWORD, + pPrintProcessorInfo: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn EnumPrintProcessorsW( + pName: LPWSTR, + pEnvironment: LPWSTR, + Level: DWORD, + pPrintProcessorInfo: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn GetPrintProcessorDirectoryA( + pName: LPSTR, + pEnvironment: LPSTR, + Level: DWORD, + pPrintProcessorInfo: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn GetPrintProcessorDirectoryW( + pName: LPWSTR, + pEnvironment: LPWSTR, + Level: DWORD, + pPrintProcessorInfo: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn EnumPrintProcessorDatatypesA( + pName: LPSTR, + pPrintProcessorName: LPSTR, + Level: DWORD, + pDatatypes: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn EnumPrintProcessorDatatypesW( + pName: LPWSTR, + pPrintProcessorName: LPWSTR, + Level: DWORD, + pDatatypes: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn DeletePrintProcessorA( + pName: LPSTR, + pEnvironment: LPSTR, + pPrintProcessorName: LPSTR, + ) -> BOOL; + pub fn DeletePrintProcessorW( + pName: LPWSTR, + pEnvironment: LPWSTR, + pPrintProcessorName: LPWSTR, + ) -> BOOL; + pub fn StartDocPrinterA( + hPrinter: HANDLE, + Level: DWORD, + pDocInfo: LPBYTE, + ) -> DWORD; + pub fn StartDocPrinterW( + hPrinter: HANDLE, + Level: DWORD, + pDocInfo: LPBYTE, + ) -> DWORD; + pub fn StartPagePrinter( + hPrinter: HANDLE, + ) -> BOOL; + pub fn WritePrinter( + hPrinter: HANDLE, + pBuf: LPVOID, + cbBuf: DWORD, + pcWritten: LPDWORD, + ) -> BOOL; + pub fn FlushPrinter( + hPrinter: HANDLE, + pBuf: LPVOID, + cbBuf: DWORD, + pcWritten: LPDWORD, + cSleep: DWORD, + ) -> BOOL; + pub fn EndPagePrinter( + hPrinter: HANDLE, + ) -> BOOL; + pub fn AbortPrinter( + hPrinter: HANDLE, + ) -> BOOL; + pub fn ReadPrinter( + hPrinter: HANDLE, + pBuf: LPVOID, + cbBuf: DWORD, + pNoBytesRead: LPDWORD, + ) -> BOOL; + pub fn EndDocPrinter( + hPrinter: HANDLE, + ) -> BOOL; + pub fn AddJobA( + hPrinter: HANDLE, + Level: DWORD, + pData: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn AddJobW( + hPrinter: HANDLE, + Level: DWORD, + pData: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn ScheduleJob( + hPrinter: HANDLE, + JobId: DWORD, + ) -> BOOL; + pub fn PrinterProperties( + hWnd: HWND, + hPrinter: HANDLE, + ) -> BOOL; + pub fn DocumentPropertiesA( + hWnd: HWND, + hPrinter: HANDLE, + pDeviceName: LPSTR, + pDevModeOutput: PDEVMODEA, + pDevModeInput: PDEVMODEA, + fMode: DWORD, + ) -> LONG; + pub fn DocumentPropertiesW( + hWnd: HWND, + hPrinter: HANDLE, + pDeviceName: LPWSTR, + pDevModeOutput: PDEVMODEW, + pDevModeInput: PDEVMODEW, + fMode: DWORD, + ) -> LONG; + pub fn AdvancedDocumentPropertiesA( + hWnd: HWND, + hPrinter: HANDLE, + pDeviceName: LPSTR, + pDevModeOutput: PDEVMODEA, + pDevModeInput: PDEVMODEA, + ) -> LONG; + pub fn AdvancedDocumentPropertiesW( + hWnd: HWND, + hPrinter: HANDLE, + pDeviceName: LPWSTR, + pDevModeOutput: PDEVMODEW, + pDevModeInput: PDEVMODEW, + ) -> LONG; + pub fn ExtDeviceMode( + hWnd: HWND, + hInst: HANDLE, + pDevModeOutput: LPDEVMODEA, + pDeviceName: LPSTR, + pPort: LPSTR, + pDevModeInput: LPDEVMODEA, + pProfile: LPSTR, + fMode: DWORD, + ) -> LONG; + pub fn GetPrinterDataA( + hPrinter: HANDLE, + pValueName: LPSTR, + pType: LPDWORD, + pData: LPBYTE, + nSize: DWORD, + pcbNeeded: LPDWORD, + ) -> DWORD; + pub fn GetPrinterDataW( + hPrinter: HANDLE, + pValueName: LPWSTR, + pType: LPDWORD, + pData: LPBYTE, + nSize: DWORD, + pcbNeeded: LPDWORD, + ) -> DWORD; + pub fn GetPrinterDataExA( + hPrinter: HANDLE, + pKeyName: LPCSTR, + pValueName: LPCSTR, + pType: LPDWORD, + pData: LPBYTE, + nSize: DWORD, + pcbNeeded: LPDWORD, + ) -> DWORD; + pub fn GetPrinterDataExW( + hPrinter: HANDLE, + pKeyName: LPCWSTR, + pValueName: LPCWSTR, + pType: LPDWORD, + pData: LPBYTE, + nSize: DWORD, + pcbNeeded: LPDWORD, + ) -> DWORD; + pub fn EnumPrinterDataA( + hPrinter: HANDLE, + dwIndex: DWORD, + pValueName: LPSTR, + cbValueName: DWORD, + pcbValueName: LPDWORD, + pType: LPDWORD, + pData: LPBYTE, + cbData: DWORD, + pcbData: LPDWORD, + ) -> DWORD; + pub fn EnumPrinterDataW( + hPrinter: HANDLE, + dwIndex: DWORD, + pValueName: LPWSTR, + cbValueName: DWORD, + pcbValueName: LPDWORD, + pType: LPDWORD, + pData: LPBYTE, + cbData: DWORD, + pcbData: LPDWORD, + ) -> DWORD; + pub fn EnumPrinterDataExA( + hPrinter: HANDLE, + pKeyName: LPCSTR, + pEnumValues: LPBYTE, + cbEnumValues: DWORD, + pcbEnumValues: LPDWORD, + pnEnumValues: LPDWORD, + ) -> DWORD; + pub fn EnumPrinterDataExW( + hPrinter: HANDLE, + pKeyName: LPCWSTR, + pEnumValues: LPBYTE, + cbEnumValues: DWORD, + pcbEnumValues: LPDWORD, + pnEnumValues: LPDWORD, + ) -> DWORD; + pub fn EnumPrinterKeyA( + hPrinter: HANDLE, + pKeyName: LPCSTR, + pSubKey: LPSTR, + cbSubkey: DWORD, + pcbSubkey: LPDWORD, + ) -> DWORD; + pub fn EnumPrinterKeyW( + hPrinter: HANDLE, + pKeyName: LPCWSTR, + pSubKey: LPWSTR, + cbSubkey: DWORD, + pcbSubkey: LPDWORD, + ) -> DWORD; + pub fn SetPrinterDataA( + hPrinter: HANDLE, + pValueName: LPSTR, + Type: DWORD, + pData: LPBYTE, + cbData: DWORD, + ) -> DWORD; + pub fn SetPrinterDataW( + hPrinter: HANDLE, + pValueName: LPWSTR, + Type: DWORD, + pData: LPBYTE, + cbData: DWORD, + ) -> DWORD; + pub fn SetPrinterDataExA( + hPrinter: HANDLE, + pKeyName: LPCSTR, + pValueName: LPCSTR, + Type: DWORD, + pData: LPBYTE, + cbData: DWORD, + ) -> DWORD; + pub fn SetPrinterDataExW( + hPrinter: HANDLE, + pKeyName: LPCWSTR, + pValueName: LPCWSTR, + Type: DWORD, + pData: LPBYTE, + cbData: DWORD, + ) -> DWORD; + pub fn DeletePrinterDataA( + hPrinter: HANDLE, + pValueName: LPSTR, + ) -> DWORD; + pub fn DeletePrinterDataW( + hPrinter: HANDLE, + pValueName: LPWSTR, + ) -> DWORD; + pub fn DeletePrinterDataExA( + hPrinter: HANDLE, + pKeyName: LPCSTR, + pValueName: LPCSTR, + ) -> DWORD; + pub fn DeletePrinterDataExW( + hPrinter: HANDLE, + pKeyName: LPCWSTR, + pValueName: LPCWSTR, + ) -> DWORD; + pub fn DeletePrinterKeyA( + hPrinter: HANDLE, + pKeyName: LPCSTR, + ) -> DWORD; + pub fn DeletePrinterKeyW( + hPrinter: HANDLE, + pKeyName: LPCWSTR, + ) -> DWORD; +} +pub const PRINTER_NOTIFY_TYPE: DWORD = 0x00; +pub const JOB_NOTIFY_TYPE: DWORD = 0x01; +pub const SERVER_NOTIFY_TYPE: DWORD = 0x02; +pub const PRINTER_NOTIFY_FIELD_SERVER_NAME: DWORD = 0x00; +pub const PRINTER_NOTIFY_FIELD_PRINTER_NAME: DWORD = 0x01; +pub const PRINTER_NOTIFY_FIELD_SHARE_NAME: DWORD = 0x02; +pub const PRINTER_NOTIFY_FIELD_PORT_NAME: DWORD = 0x03; +pub const PRINTER_NOTIFY_FIELD_DRIVER_NAME: DWORD = 0x04; +pub const PRINTER_NOTIFY_FIELD_COMMENT: DWORD = 0x05; +pub const PRINTER_NOTIFY_FIELD_LOCATION: DWORD = 0x06; +pub const PRINTER_NOTIFY_FIELD_DEVMODE: DWORD = 0x07; +pub const PRINTER_NOTIFY_FIELD_SEPFILE: DWORD = 0x08; +pub const PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR: DWORD = 0x09; +pub const PRINTER_NOTIFY_FIELD_PARAMETERS: DWORD = 0x0A; +pub const PRINTER_NOTIFY_FIELD_DATATYPE: DWORD = 0x0B; +pub const PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR: DWORD = 0x0C; +pub const PRINTER_NOTIFY_FIELD_ATTRIBUTES: DWORD = 0x0D; +pub const PRINTER_NOTIFY_FIELD_PRIORITY: DWORD = 0x0E; +pub const PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY: DWORD = 0x0F; +pub const PRINTER_NOTIFY_FIELD_START_TIME: DWORD = 0x10; +pub const PRINTER_NOTIFY_FIELD_UNTIL_TIME: DWORD = 0x11; +pub const PRINTER_NOTIFY_FIELD_STATUS: DWORD = 0x12; +pub const PRINTER_NOTIFY_FIELD_STATUS_STRING: DWORD = 0x13; +pub const PRINTER_NOTIFY_FIELD_CJOBS: DWORD = 0x14; +pub const PRINTER_NOTIFY_FIELD_AVERAGE_PPM: DWORD = 0x15; +pub const PRINTER_NOTIFY_FIELD_TOTAL_PAGES: DWORD = 0x16; +pub const PRINTER_NOTIFY_FIELD_PAGES_PRINTED: DWORD = 0x17; +pub const PRINTER_NOTIFY_FIELD_TOTAL_BYTES: DWORD = 0x18; +pub const PRINTER_NOTIFY_FIELD_BYTES_PRINTED: DWORD = 0x19; +pub const PRINTER_NOTIFY_FIELD_OBJECT_GUID: DWORD = 0x1A; +pub const PRINTER_NOTIFY_FIELD_FRIENDLY_NAME: DWORD = 0x1B; +pub const PRINTER_NOTIFY_FIELD_BRANCH_OFFICE_PRINTING: DWORD = 0x1C; +pub const JOB_NOTIFY_FIELD_PRINTER_NAME: DWORD = 0x00; +pub const JOB_NOTIFY_FIELD_MACHINE_NAME: DWORD = 0x01; +pub const JOB_NOTIFY_FIELD_PORT_NAME: DWORD = 0x02; +pub const JOB_NOTIFY_FIELD_USER_NAME: DWORD = 0x03; +pub const JOB_NOTIFY_FIELD_NOTIFY_NAME: DWORD = 0x04; +pub const JOB_NOTIFY_FIELD_DATATYPE: DWORD = 0x05; +pub const JOB_NOTIFY_FIELD_PRINT_PROCESSOR: DWORD = 0x06; +pub const JOB_NOTIFY_FIELD_PARAMETERS: DWORD = 0x07; +pub const JOB_NOTIFY_FIELD_DRIVER_NAME: DWORD = 0x08; +pub const JOB_NOTIFY_FIELD_DEVMODE: DWORD = 0x09; +pub const JOB_NOTIFY_FIELD_STATUS: DWORD = 0x0A; +pub const JOB_NOTIFY_FIELD_STATUS_STRING: DWORD = 0x0B; +pub const JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR: DWORD = 0x0C; +pub const JOB_NOTIFY_FIELD_DOCUMENT: DWORD = 0x0D; +pub const JOB_NOTIFY_FIELD_PRIORITY: DWORD = 0x0E; +pub const JOB_NOTIFY_FIELD_POSITION: DWORD = 0x0F; +pub const JOB_NOTIFY_FIELD_SUBMITTED: DWORD = 0x10; +pub const JOB_NOTIFY_FIELD_START_TIME: DWORD = 0x11; +pub const JOB_NOTIFY_FIELD_UNTIL_TIME: DWORD = 0x12; +pub const JOB_NOTIFY_FIELD_TIME: DWORD = 0x13; +pub const JOB_NOTIFY_FIELD_TOTAL_PAGES: DWORD = 0x14; +pub const JOB_NOTIFY_FIELD_PAGES_PRINTED: DWORD = 0x15; +pub const JOB_NOTIFY_FIELD_TOTAL_BYTES: DWORD = 0x16; +pub const JOB_NOTIFY_FIELD_BYTES_PRINTED: DWORD = 0x17; +pub const JOB_NOTIFY_FIELD_REMOTE_JOB_ID: DWORD = 0x18; +pub const SERVER_NOTIFY_FIELD_PRINT_DRIVER_ISOLATION_GROUP: DWORD = 0x00; +pub const PRINTER_NOTIFY_CATEGORY_ALL: DWORD = 0x001000; +pub const PRINTER_NOTIFY_CATEGORY_3D: DWORD = 0x002000; +STRUCT!{struct PRINTER_NOTIFY_OPTIONS_TYPE { + Type: WORD, + Reserved0: WORD, + Reserved1: DWORD, + Reserved2: DWORD, + Count: DWORD, + pFields: PWORD, +}} +pub type PPRINTER_NOTIFY_OPTIONS_TYPE = *mut PRINTER_NOTIFY_OPTIONS_TYPE; +pub type LPPRINTER_NOTIFY_OPTIONS_TYPE = *mut PRINTER_NOTIFY_OPTIONS_TYPE; +pub const PRINTER_NOTIFY_OPTIONS_REFRESH: DWORD = 0x01; +STRUCT!{struct PRINTER_NOTIFY_OPTIONS { + Version: DWORD, + Flags: DWORD, + Count: DWORD, + pTypes: PPRINTER_NOTIFY_OPTIONS_TYPE, +}} +pub type PPRINTER_NOTIFY_OPTIONS = *mut PRINTER_NOTIFY_OPTIONS; +pub type LPPRINTER_NOTIFY_OPTIONS = *mut PRINTER_NOTIFY_OPTIONS; +pub const PRINTER_NOTIFY_INFO_DISCARDED: DWORD = 0x01; +STRUCT!{struct PRINTER_NOTIFY_INFO_DATA_NotifyData_Data { + cbBuf: DWORD, + pBuf: LPVOID, +}} +UNION!{union PRINTER_NOTIFY_INFO_DATA_NotifyData { + [usize; 2], + adwData adwData_mut: [DWORD; 2], + Data Data_mut: PRINTER_NOTIFY_INFO_DATA_NotifyData_Data, +}} +STRUCT!{struct PRINTER_NOTIFY_INFO_DATA { + Type: WORD, + Field: WORD, + Reserved: DWORD, + Id: DWORD, + NotifyData: PRINTER_NOTIFY_INFO_DATA_NotifyData, +}} +pub type PPRINTER_NOTIFY_INFO_DATA = *mut PRINTER_NOTIFY_INFO_DATA; +pub type LPPRINTER_NOTIFY_INFO_DATA = *mut PRINTER_NOTIFY_INFO_DATA; +STRUCT!{struct PRINTER_NOTIFY_INFO { + Version: DWORD, + Flags: DWORD, + Count: DWORD, + aData: [PRINTER_NOTIFY_INFO_DATA; 1], +}} +pub type PPRINTER_NOTIFY_INFO = *mut PRINTER_NOTIFY_INFO; +pub type LPPRINTER_NOTIFY_INFO = *mut PRINTER_NOTIFY_INFO; +STRUCT!{struct BINARY_CONTAINER { + cbBuf: DWORD, + pData: LPBYTE, +}} +pub type PBINARY_CONTAINER = *mut BINARY_CONTAINER; +UNION!{union BIDI_DATA_u { + [usize; 2], + bData bData_mut: BOOL, + iData iData_mut: LONG, + sData sData_mut: LPWSTR, + fData fData_mut: FLOAT, + biData biData_mut: BINARY_CONTAINER, +}} +STRUCT!{struct BIDI_DATA { + dwBidiType: DWORD, + u: BIDI_DATA_u, +}} +pub type PBIDI_DATA = *mut BIDI_DATA; +pub type LPBIDI_DATA = *mut BIDI_DATA; +STRUCT!{struct BIDI_REQUEST_DATA { + dwReqNumber: DWORD, + pSchema: LPWSTR, + data: BIDI_DATA, +}} +pub type PBIDI_REQUEST_DATA = *mut BIDI_REQUEST_DATA; +pub type LPBIDI_REQUEST_DATA = *mut BIDI_REQUEST_DATA; +STRUCT!{struct BIDI_REQUEST_CONTAINER { + Version: DWORD, + Flags: DWORD, + Count: DWORD, + aData: [BIDI_REQUEST_DATA; 1], +}} +pub type PBIDI_REQUEST_CONTAINER = *mut BIDI_REQUEST_CONTAINER; +pub type LPBIDI_REQUEST_CONTAINER = *mut BIDI_REQUEST_CONTAINER; +STRUCT!{struct BIDI_RESPONSE_DATA { + dwResult: DWORD, + dwReqNumber: DWORD, + pSchema: LPWSTR, + data: BIDI_DATA, +}} +pub type PBIDI_RESPONSE_DATA = *mut BIDI_RESPONSE_DATA; +pub type LPBIDI_RESPONSE_DATA = *mut BIDI_RESPONSE_DATA; +STRUCT!{struct BIDI_RESPONSE_CONTAINER { + Version: DWORD, + Flags: DWORD, + Count: DWORD, + aData: [BIDI_RESPONSE_DATA; 1], +}} +pub type PBIDI_RESPONSE_CONTAINER = *mut BIDI_RESPONSE_CONTAINER; +pub type LPBIDI_RESPONSE_CONTAINER = *mut BIDI_RESPONSE_CONTAINER; +pub const BIDI_ACTION_ENUM_SCHEMA: &'static str = "EnumSchema"; +pub const BIDI_ACTION_GET: &'static str = "Get"; +pub const BIDI_ACTION_SET: &'static str = "Set"; +pub const BIDI_ACTION_GET_ALL: &'static str = "GetAll"; +pub const BIDI_ACTION_GET_WITH_ARGUMENT: &'static str = "GetWithArgument"; +ENUM!{enum BIDI_TYPE { + BIDI_NULL = 0, + BIDI_INT = 1, + BIDI_FLOAT = 2, + BIDI_BOOL = 3, + BIDI_STRING = 4, + BIDI_TEXT = 5, + BIDI_ENUM = 6, + BIDI_BLOB = 7, +}} +pub const BIDI_ACCESS_ADMINISTRATOR: DWORD = 0x1; +pub const BIDI_ACCESS_USER: DWORD = 0x2; +pub const ERROR_BIDI_STATUS_OK: DWORD = 0; +pub const ERROR_BIDI_NOT_SUPPORTED: DWORD = ERROR_NOT_SUPPORTED; +pub const ERROR_BIDI_ERROR_BASE: DWORD = 13000; +pub const ERROR_BIDI_STATUS_WARNING: DWORD = ERROR_BIDI_ERROR_BASE + 1; +pub const ERROR_BIDI_SCHEMA_READ_ONLY: DWORD = ERROR_BIDI_ERROR_BASE + 2; +pub const ERROR_BIDI_SERVER_OFFLINE: DWORD = ERROR_BIDI_ERROR_BASE + 3; +pub const ERROR_BIDI_DEVICE_OFFLINE: DWORD = ERROR_BIDI_ERROR_BASE + 4; +pub const ERROR_BIDI_SCHEMA_NOT_SUPPORTED: DWORD = ERROR_BIDI_ERROR_BASE + 5; +pub const ERROR_BIDI_SET_DIFFERENT_TYPE: DWORD = ERROR_BIDI_ERROR_BASE + 6; +pub const ERROR_BIDI_SET_MULTIPLE_SCHEMAPATH: DWORD = ERROR_BIDI_ERROR_BASE + 7; +pub const ERROR_BIDI_SET_INVALID_SCHEMAPATH: DWORD = ERROR_BIDI_ERROR_BASE + 8; +pub const ERROR_BIDI_SET_UNKNOWN_FAILURE: DWORD = ERROR_BIDI_ERROR_BASE + 9; +pub const ERROR_BIDI_SCHEMA_WRITE_ONLY: DWORD = ERROR_BIDI_ERROR_BASE + 10; +pub const ERROR_BIDI_GET_REQUIRES_ARGUMENT: DWORD = ERROR_BIDI_ERROR_BASE + 11; +pub const ERROR_BIDI_GET_ARGUMENT_NOT_SUPPORTED: DWORD = ERROR_BIDI_ERROR_BASE + 12; +pub const ERROR_BIDI_GET_MISSING_ARGUMENT: DWORD = ERROR_BIDI_ERROR_BASE + 13; +pub const ERROR_BIDI_DEVICE_CONFIG_UNCHANGED: DWORD = ERROR_BIDI_ERROR_BASE + 14; +pub const ERROR_BIDI_NO_LOCALIZED_RESOURCES: DWORD = ERROR_BIDI_ERROR_BASE + 15; +pub const ERROR_BIDI_NO_BIDI_SCHEMA_EXTENSIONS: DWORD = ERROR_BIDI_ERROR_BASE + 16; +pub const ERROR_BIDI_UNSUPPORTED_CLIENT_LANGUAGE: DWORD = ERROR_BIDI_ERROR_BASE + 17; +pub const ERROR_BIDI_UNSUPPORTED_RESOURCE_FORMAT: DWORD = ERROR_BIDI_ERROR_BASE + 18; +extern "system" { + pub fn WaitForPrinterChange( + hPrinter: HANDLE, + Flags: DWORD, + ) -> DWORD; + pub fn FindFirstPrinterChangeNotification( + hPrinter: HANDLE, + fdwFilter: DWORD, + fdwOptions: DWORD, + pPrinterNotifyOptions: LPVOID, + ) -> HANDLE; + pub fn FindNextPrinterChangeNotification( + hChange: HANDLE, + pdwChange: PDWORD, + pPrinterNotifyOptions: LPVOID, + ppPrinterNotifyInfo: *mut LPVOID, + ) -> BOOL; + pub fn FreePrinterNotifyInfo( + pPrinterNotifyInfo: PPRINTER_NOTIFY_INFO, + ) -> BOOL; + pub fn FindClosePrinterChangeNotification( + hChange: HANDLE, + ) -> BOOL; +} +pub const PRINTER_CHANGE_ADD_PRINTER: DWORD = 0x00000001; +pub const PRINTER_CHANGE_SET_PRINTER: DWORD = 0x00000002; +pub const PRINTER_CHANGE_DELETE_PRINTER: DWORD = 0x00000004; +pub const PRINTER_CHANGE_FAILED_CONNECTION_PRINTER: DWORD = 0x00000008; +pub const PRINTER_CHANGE_PRINTER: DWORD = 0x000000FF; +pub const PRINTER_CHANGE_ADD_JOB: DWORD = 0x00000100; +pub const PRINTER_CHANGE_SET_JOB: DWORD = 0x00000200; +pub const PRINTER_CHANGE_DELETE_JOB: DWORD = 0x00000400; +pub const PRINTER_CHANGE_WRITE_JOB: DWORD = 0x00000800; +pub const PRINTER_CHANGE_JOB: DWORD = 0x0000FF00; +pub const PRINTER_CHANGE_ADD_FORM: DWORD = 0x00010000; +pub const PRINTER_CHANGE_SET_FORM: DWORD = 0x00020000; +pub const PRINTER_CHANGE_DELETE_FORM: DWORD = 0x00040000; +pub const PRINTER_CHANGE_FORM: DWORD = 0x00070000; +pub const PRINTER_CHANGE_ADD_PORT: DWORD = 0x00100000; +pub const PRINTER_CHANGE_CONFIGURE_PORT: DWORD = 0x00200000; +pub const PRINTER_CHANGE_DELETE_PORT: DWORD = 0x00400000; +pub const PRINTER_CHANGE_PORT: DWORD = 0x00700000; +pub const PRINTER_CHANGE_ADD_PRINT_PROCESSOR: DWORD = 0x01000000; +pub const PRINTER_CHANGE_DELETE_PRINT_PROCESSOR: DWORD = 0x04000000; +pub const PRINTER_CHANGE_PRINT_PROCESSOR: DWORD = 0x07000000; +pub const PRINTER_CHANGE_SERVER: DWORD = 0x08000000; +pub const PRINTER_CHANGE_ADD_PRINTER_DRIVER: DWORD = 0x10000000; +pub const PRINTER_CHANGE_SET_PRINTER_DRIVER: DWORD = 0x20000000; +pub const PRINTER_CHANGE_DELETE_PRINTER_DRIVER: DWORD = 0x40000000; +pub const PRINTER_CHANGE_PRINTER_DRIVER: DWORD = 0x70000000; +pub const PRINTER_CHANGE_TIMEOUT: DWORD = 0x80000000; +pub const PRINTER_CHANGE_ALL: DWORD = 0x7F77FFFF; +extern "system" { + pub fn PrinterMessageBoxA( + hPrinter: HANDLE, + Error: DWORD, + hWnd: HWND, + pText: LPSTR, + pCaption: LPSTR, + dwType: DWORD, + ) -> DWORD; + pub fn PrinterMessageBoxW( + hPrinter: HANDLE, + Error: DWORD, + hWnd: HWND, + pText: LPWSTR, + pCaption: LPWSTR, + dwType: DWORD, + ) -> DWORD; +} +pub const PRINTER_ERROR_INFORMATION: DWORD = 0x80000000; +pub const PRINTER_ERROR_WARNING: DWORD = 0x40000000; +pub const PRINTER_ERROR_SEVERE: DWORD = 0x20000000; +pub const PRINTER_ERROR_OUTOFPAPER: DWORD = 0x00000001; +pub const PRINTER_ERROR_JAM: DWORD = 0x00000002; +pub const PRINTER_ERROR_OUTOFTONER: DWORD = 0x00000004; +extern "system" { + pub fn ClosePrinter( + hPrinter: HANDLE, + ) -> BOOL; + pub fn AddFormA( + hPrinter: HANDLE, + Level: DWORD, + pForm: LPBYTE, + ) -> BOOL; + pub fn AddFormW( + hPrinter: HANDLE, + Level: DWORD, + pForm: LPBYTE, + ) -> BOOL; + pub fn DeleteFormA( + hPrinter: HANDLE, + pFormName: LPSTR, + ) -> BOOL; + pub fn DeleteFormW( + hPrinter: HANDLE, + pFormName: LPWSTR, + ) -> BOOL; + pub fn GetFormA( + hPrinter: HANDLE, + pFormName: LPSTR, + Level: DWORD, + pForm: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn GetFormW( + hPrinter: HANDLE, + pFormName: LPWSTR, + Level: DWORD, + pForm: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn SetFormA( + hPrinter: HANDLE, + pFormName: LPSTR, + Level: DWORD, + pForm: LPBYTE, + ) -> BOOL; + pub fn SetFormW( + hPrinter: HANDLE, + pFormName: LPWSTR, + Level: DWORD, + pForm: LPBYTE, + ) -> BOOL; + pub fn EnumFormsA( + hPrinter: HANDLE, + Level: DWORD, + pForm: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn EnumFormsW( + hPrinter: HANDLE, + Level: DWORD, + pForm: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn EnumMonitorsA( + pName: LPSTR, + Level: DWORD, + pMonitor: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn EnumMonitorsW( + pName: LPWSTR, + Level: DWORD, + pMonitor: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn AddMonitorA( + pName: LPSTR, + Level: DWORD, + pMonitors: LPBYTE, + ) -> BOOL; + pub fn AddMonitorW( + pName: LPWSTR, + Level: DWORD, + pMonitors: LPBYTE, + ) -> BOOL; + pub fn DeleteMonitorA( + pName: LPSTR, + pEnvironment: LPSTR, + pMonitorName: LPSTR, + ) -> BOOL; + pub fn DeleteMonitorW( + pName: LPWSTR, + pEnvironment: LPWSTR, + pMonitorName: LPWSTR, + ) -> BOOL; + pub fn EnumPortsA( + pName: LPSTR, + Level: DWORD, + pPort: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn EnumPortsW( + pName: LPWSTR, + Level: DWORD, + pPort: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + pcReturned: LPDWORD, + ) -> BOOL; + pub fn AddPortA( + pName: LPSTR, + hWnd: HWND, + pMonitorName: LPSTR, + ) -> BOOL; + pub fn AddPortW( + pName: LPWSTR, + hWnd: HWND, + pMonitorName: LPWSTR, + ) -> BOOL; + pub fn ConfigurePortA( + pName: LPSTR, + hWnd: HWND, + pPortName: LPSTR, + ) -> BOOL; + pub fn ConfigurePortW( + pName: LPWSTR, + hWnd: HWND, + pPortName: LPWSTR, + ) -> BOOL; + pub fn DeletePortA( + pName: LPSTR, + hWnd: HWND, + pPortName: LPSTR, + ) -> BOOL; + pub fn DeletePortW( + pName: LPWSTR, + hWnd: HWND, + pPortName: LPWSTR, + ) -> BOOL; + pub fn XcvDataW( + hXcv: HANDLE, + pszDataName: PCWSTR, + pInputData: PBYTE, + cbInputData: DWORD, + pOutputData: PBYTE, + cbOutputData: DWORD, + pcbOutputNeeded: PDWORD, + pdwStatus: PDWORD, + ) -> BOOL; + pub fn GetDefaultPrinterA( + pszBuffer: LPSTR, + pcchBuffer: LPDWORD, + ) -> BOOL; + pub fn GetDefaultPrinterW( + pszBuffer: LPWSTR, + pcchBuffer: LPDWORD, + ) -> BOOL; + pub fn SetDefaultPrinterA( + pszPrinter: LPCSTR, + ) -> BOOL; + pub fn SetDefaultPrinterW( + pszPrinter: LPCWSTR, + ) -> BOOL; + pub fn SetPortA( + pName: LPSTR, + pPortName: LPSTR, + dwLevel: DWORD, + pPortInfo: LPBYTE, + ) -> BOOL; + pub fn SetPortW(pName: LPWSTR, + pPortName: LPWSTR, + dwLevel: DWORD, + pPortInfo: LPBYTE, + ) -> BOOL; + pub fn AddPrinterConnectionA( + pName: LPSTR, + ) -> BOOL; + pub fn AddPrinterConnectionW( + pName: LPWSTR, + ) -> BOOL; + pub fn DeletePrinterConnectionA( + pName: LPSTR, + ) -> BOOL; + pub fn DeletePrinterConnectionW( + pName: LPWSTR, + ) -> BOOL; + pub fn ConnectToPrinterDlg( + hwnd: HWND, + Flags: DWORD, + ) -> HANDLE; +} +STRUCT!{struct PROVIDOR_INFO_1A { + pName: LPSTR, + pEnvironment: LPSTR, + pDLLName: LPSTR, +}} +pub type PPROVIDOR_INFO_1A = *mut PROVIDOR_INFO_1A; +pub type LPPROVIDOR_INFO_1A = *mut PROVIDOR_INFO_1A; +STRUCT!{struct PROVIDOR_INFO_1W { + pName: LPWSTR, + pEnvironment: LPWSTR, + pDLLName: LPWSTR, +}} +pub type PPROVIDOR_INFO_1W = *mut PROVIDOR_INFO_1W; +pub type LPPROVIDOR_INFO_1W = *mut PROVIDOR_INFO_1W; +STRUCT!{struct PROVIDOR_INFO_2A { + pOrder: LPSTR, +}} +pub type PPROVIDOR_INFO_2A = *mut PROVIDOR_INFO_2A; +pub type LPPROVIDOR_INFO_2A = *mut PROVIDOR_INFO_2A; +STRUCT!{struct PROVIDOR_INFO_2W { + pOrder: LPWSTR, +}} +pub type PPROVIDOR_INFO_2W = *mut PROVIDOR_INFO_2W; +pub type LPPROVIDOR_INFO_2W = *mut PROVIDOR_INFO_2W; +extern "system" { + pub fn AddPrintProvidorA( + pName: LPSTR, + Level: DWORD, + pProvidorInfo: LPBYTE, + ) -> BOOL; + pub fn AddPrintProvidorW( + pName: LPWSTR, + Level: DWORD, + pProvidorInfo: LPBYTE, + ) -> BOOL; + pub fn DeletePrintProvidorA( + pName: LPSTR, + pEnvironment: LPSTR, + pPrintProvidorName: LPSTR, + ) -> BOOL; + pub fn DeletePrintProvidorW( + pName: LPWSTR, + pEnvironment: LPWSTR, + pPrintProvidorName: LPWSTR, + ) -> BOOL; + pub fn IsValidDevmodeA( + pDevmode: PDEVMODEA, + DevmodeSize: size_t, + ) -> BOOL; + pub fn IsValidDevmodeW( + pDevmode: PDEVMODEW, + DevmodeSize: size_t, + ) -> BOOL; +} +pub const SPLREG_DEFAULT_SPOOL_DIRECTORY: &'static str = "DefaultSpoolDirectory"; +pub const SPLREG_PORT_THREAD_PRIORITY_DEFAULT: &'static str = "PortThreadPriorityDefault"; +pub const SPLREG_PORT_THREAD_PRIORITY: &'static str = "PortThreadPriority"; +pub const SPLREG_SCHEDULER_THREAD_PRIORITY_DEFAULT: &'static str + = "SchedulerThreadPriorityDefault"; +pub const SPLREG_SCHEDULER_THREAD_PRIORITY: &'static str = "SchedulerThreadPriority"; +pub const SPLREG_BEEP_ENABLED: &'static str = "BeepEnabled"; +pub const SPLREG_NET_POPUP: &'static str = "NetPopup"; +pub const SPLREG_RETRY_POPUP: &'static str = "RetryPopup"; +pub const SPLREG_NET_POPUP_TO_COMPUTER: &'static str = "NetPopupToComputer"; +pub const SPLREG_EVENT_LOG: &'static str = "EventLog"; +pub const SPLREG_MAJOR_VERSION: &'static str = "MajorVersion"; +pub const SPLREG_MINOR_VERSION: &'static str = "MinorVersion"; +pub const SPLREG_ARCHITECTURE: &'static str = "Architecture"; +pub const SPLREG_OS_VERSION: &'static str = "OSVersion"; +pub const SPLREG_OS_VERSIONEX: &'static str = "OSVersionEx"; +pub const SPLREG_DS_PRESENT: &'static str = "DsPresent"; +pub const SPLREG_DS_PRESENT_FOR_USER: &'static str = "DsPresentForUser"; +pub const SPLREG_REMOTE_FAX: &'static str = "RemoteFax"; +pub const SPLREG_RESTART_JOB_ON_POOL_ERROR: &'static str = "RestartJobOnPoolError"; +pub const SPLREG_RESTART_JOB_ON_POOL_ENABLED: &'static str = "RestartJobOnPoolEnabled"; +pub const SPLREG_DNS_MACHINE_NAME: &'static str = "DNSMachineName"; +pub const SPLREG_ALLOW_USER_MANAGEFORMS: &'static str = "AllowUserManageForms"; +pub const SPLREG_WEBSHAREMGMT: &'static str = "WebShareMgmt"; +pub const SPLREG_PRINT_DRIVER_ISOLATION_GROUPS_SEPARATOR: &'static str = "\\"; +pub const SPLREG_PRINT_DRIVER_ISOLATION_GROUPS: &'static str = "PrintDriverIsolationGroups"; +pub const SPLREG_PRINT_DRIVER_ISOLATION_TIME_BEFORE_RECYCLE: &'static str + = "PrintDriverIsolationTimeBeforeRecycle"; +pub const SPLREG_PRINT_DRIVER_ISOLATION_MAX_OBJECTS_BEFORE_RECYCLE: &'static str + = "PrintDriverIsolationMaxobjsBeforeRecycle"; +pub const SPLREG_PRINT_DRIVER_ISOLATION_IDLE_TIMEOUT: &'static str + = "PrintDriverIsolationIdleTimeout"; +pub const SPLREG_PRINT_DRIVER_ISOLATION_EXECUTION_POLICY: &'static str + = "PrintDriverIsolationExecutionPolicy"; +pub const SPLREG_PRINT_DRIVER_ISOLATION_OVERRIDE_POLICY: &'static str + = "PrintDriverIsolationOverrideCompat"; +pub const SPLREG_PRINT_QUEUE_V4_DRIVER_DIRECTORY: &'static str = "PrintQueueV4DriverDirectory"; +pub const SERVER_ACCESS_ADMINISTER: DWORD = 0x00000001; +pub const SERVER_ACCESS_ENUMERATE: DWORD = 0x00000002; +pub const PRINTER_ACCESS_ADMINISTER: DWORD = 0x00000004; +pub const PRINTER_ACCESS_USE: DWORD = 0x00000008; +pub const JOB_ACCESS_ADMINISTER: DWORD = 0x00000010; +pub const JOB_ACCESS_READ: DWORD = 0x00000020; +pub const PRINTER_ACCESS_MANAGE_LIMITED: DWORD = 0x00000040; +pub const SERVER_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SERVER_ACCESS_ADMINISTER + | SERVER_ACCESS_ENUMERATE; +pub const SERVER_READ: DWORD = STANDARD_RIGHTS_READ | SERVER_ACCESS_ENUMERATE; +pub const SERVER_WRITE: DWORD = STANDARD_RIGHTS_WRITE | SERVER_ACCESS_ADMINISTER + | SERVER_ACCESS_ENUMERATE; +pub const SERVER_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE | SERVER_ACCESS_ENUMERATE; +pub const PRINTER_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | PRINTER_ACCESS_ADMINISTER + | PRINTER_ACCESS_USE; +pub const PRINTER_READ: DWORD = STANDARD_RIGHTS_READ | PRINTER_ACCESS_USE; +pub const PRINTER_WRITE: DWORD = STANDARD_RIGHTS_WRITE | PRINTER_ACCESS_USE; +pub const PRINTER_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE | PRINTER_ACCESS_USE; +pub const JOB_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | JOB_ACCESS_ADMINISTER + | JOB_ACCESS_READ; +pub const JOB_READ: DWORD = STANDARD_RIGHTS_READ | JOB_ACCESS_READ; +pub const JOB_WRITE: DWORD = STANDARD_RIGHTS_WRITE | JOB_ACCESS_ADMINISTER; +pub const JOB_EXECUTE: DWORD = STANDARD_RIGHTS_EXECUTE | JOB_ACCESS_ADMINISTER; +pub const SPLDS_SPOOLER_KEY: &'static str = "DsSpooler"; +pub const SPLDS_DRIVER_KEY: &'static str = "DsDriver"; +pub const SPLDS_USER_KEY: &'static str = "DsUser"; +pub const SPLDS_ASSET_NUMBER: &'static str = "assetNumber"; +pub const SPLDS_BYTES_PER_MINUTE: &'static str = "bytesPerMinute"; +pub const SPLDS_DESCRIPTION: &'static str = "description"; +pub const SPLDS_DRIVER_NAME: &'static str = "driverName"; +pub const SPLDS_DRIVER_VERSION: &'static str = "driverVersion"; +pub const SPLDS_LOCATION: &'static str = "location"; +pub const SPLDS_PORT_NAME: &'static str = "portName"; +pub const SPLDS_PRINT_ATTRIBUTES: &'static str = "printAttributes"; +pub const SPLDS_PRINT_BIN_NAMES: &'static str = "printBinNames"; +pub const SPLDS_PRINT_COLLATE: &'static str = "printCollate"; +pub const SPLDS_PRINT_COLOR: &'static str = "printColor"; +pub const SPLDS_PRINT_DUPLEX_SUPPORTED: &'static str = "printDuplexSupported"; +pub const SPLDS_PRINT_END_TIME: &'static str = "printEndTime"; +pub const SPLDS_PRINTER_CLASS: &'static str = "printQueue"; +pub const SPLDS_PRINTER_NAME: &'static str = "printerName"; +pub const SPLDS_PRINT_KEEP_PRINTED_JOBS: &'static str = "printKeepPrintedJobs"; +pub const SPLDS_PRINT_LANGUAGE: &'static str = "printLanguage"; +pub const SPLDS_PRINT_MAC_ADDRESS: &'static str = "printMACAddress"; +pub const SPLDS_PRINT_MAX_X_EXTENT: &'static str = "printMaxXExtent"; +pub const SPLDS_PRINT_MAX_Y_EXTENT: &'static str = "printMaxYExtent"; +pub const SPLDS_PRINT_MAX_RESOLUTION_SUPPORTED: &'static str = "printMaxResolutionSupported"; +pub const SPLDS_PRINT_MEDIA_READY: &'static str = "printMediaReady"; +pub const SPLDS_PRINT_MEDIA_SUPPORTED: &'static str = "printMediaSupported"; +pub const SPLDS_PRINT_MEMORY: &'static str = "printMemory"; +pub const SPLDS_PRINT_MIN_X_EXTENT: &'static str = "printMinXExtent"; +pub const SPLDS_PRINT_MIN_Y_EXTENT: &'static str = "printMinYExtent"; +pub const SPLDS_PRINT_NETWORK_ADDRESS: &'static str = "printNetworkAddress"; +pub const SPLDS_PRINT_NOTIFY: &'static str = "printNotify"; +pub const SPLDS_PRINT_NUMBER_UP: &'static str = "printNumberUp"; +pub const SPLDS_PRINT_ORIENTATIONS_SUPPORTED: &'static str = "printOrientationsSupported"; +pub const SPLDS_PRINT_OWNER: &'static str = "printOwner"; +pub const SPLDS_PRINT_PAGES_PER_MINUTE: &'static str = "printPagesPerMinute"; +pub const SPLDS_PRINT_RATE: &'static str = "printRate"; +pub const SPLDS_PRINT_RATE_UNIT: &'static str = "printRateUnit"; +pub const SPLDS_PRINT_SEPARATOR_FILE: &'static str = "printSeparatorFile"; +pub const SPLDS_PRINT_SHARE_NAME: &'static str = "printShareName"; +pub const SPLDS_PRINT_SPOOLING: &'static str = "printSpooling"; +pub const SPLDS_PRINT_STAPLING_SUPPORTED: &'static str = "printStaplingSupported"; +pub const SPLDS_PRINT_START_TIME: &'static str = "printStartTime"; +pub const SPLDS_PRINT_STATUS: &'static str = "printStatus"; +pub const SPLDS_PRIORITY: &'static str = "priority"; +pub const SPLDS_SERVER_NAME: &'static str = "serverName"; +pub const SPLDS_SHORT_SERVER_NAME: &'static str = "shortServerName"; +pub const SPLDS_UNC_NAME: &'static str = "uNCName"; +pub const SPLDS_URL: &'static str = "url"; +pub const SPLDS_FLAGS: &'static str = "flags"; +pub const SPLDS_VERSION_NUMBER: &'static str = "versionNumber"; +pub const SPLDS_PRINTER_NAME_ALIASES: &'static str = "printerNameAliases"; +pub const SPLDS_PRINTER_LOCATIONS: &'static str = "printerLocations"; +pub const SPLDS_PRINTER_MODEL: &'static str = "printerModel"; +ENUM!{enum PRINTER_OPTION_FLAGS { + PRINTER_OPTION_NO_CACHE = 1 << 0, + PRINTER_OPTION_CACHE = 1 << 1, + PRINTER_OPTION_CLIENT_CHANGE = 1 << 2, + PRINTER_OPTION_NO_CLIENT_DATA = 1 << 3, +}} +STRUCT!{struct PRINTER_OPTIONSA { + cbSize: UINT, + dwFlags: DWORD, +}} +pub type PPRINTER_OPTIONSA = *mut PRINTER_OPTIONSA; +pub type LPPRINTER_OPTIONSA = *mut PRINTER_OPTIONSA; +STRUCT!{struct PRINTER_OPTIONSW { + cbSize: UINT, + dwFlags: DWORD, +}} +pub type PPRINTER_OPTIONSW = *mut PRINTER_OPTIONSW; +pub type LPPRINTER_OPTIONSW = *mut PRINTER_OPTIONSW; +extern "system" { + pub fn OpenPrinter2A( + pPrinterName: LPCSTR, + phPrinter: LPHANDLE, + pDefault: PPRINTER_DEFAULTSA, + pOptions: PPRINTER_OPTIONSA, + ) -> BOOL; + pub fn OpenPrinter2W( + pPrinterName: LPCWSTR, + phPrinter: LPHANDLE, + pDefault: PPRINTER_DEFAULTSW, + pOptions: PPRINTER_OPTIONSW, + ) -> BOOL; +} +pub const PRINTER_CONNECTION_MISMATCH: DWORD = 0x00000020; +pub const PRINTER_CONNECTION_NO_UI: DWORD = 0x00000040; +STRUCT!{struct PRINTER_CONNECTION_INFO_1A { + dwFlags: DWORD, + pszDriverName: LPSTR, +}} +pub type PPRINTER_CONNECTION_INFO_1A = *mut PRINTER_CONNECTION_INFO_1A; +pub type LPPRINTER_CONNECTION_INFO_1A = *mut PRINTER_CONNECTION_INFO_1A; +STRUCT!{struct PRINTER_CONNECTION_INFO_1W { + dwFlags: DWORD, + pszDriverName: LPWSTR, +}} +pub type PPRINTER_CONNECTION_INFO_1W = *mut PRINTER_CONNECTION_INFO_1W; +pub type LPPRINTER_CONNECTION_INFO_1W = *mut PRINTER_CONNECTION_INFO_1W; +extern "system" { + pub fn AddPrinterConnection2A( + hWnd: HWND, + pszName: LPCSTR, + dwLevel: DWORD, + pConnectionInfo: PVOID, + ) -> BOOL; + pub fn AddPrinterConnection2W( + hWnd: HWND, + pszName: LPCWSTR, + dwLevel: DWORD, + pConnectionInfo: PVOID, + ) -> BOOL; +} +pub const IPDFP_COPY_ALL_FILES: DWORD = 0x00000001; +extern "system" { + pub fn InstallPrinterDriverFromPackageA( + pszServer: LPCSTR, + pszInfPath: LPCSTR, + pszDriverName: LPCSTR, + pszEnvironment: LPCSTR, + dwFlags: DWORD, + ) -> HRESULT; + pub fn InstallPrinterDriverFromPackageW( + pszServer: LPCWSTR, + pszInfPath: LPCWSTR, + pszDriverName: LPCWSTR, + pszEnvironment: LPCWSTR, + dwFlags: DWORD, + ) -> HRESULT; +} +pub const UPDP_SILENT_UPLOAD: DWORD = 0x00000001; +pub const UPDP_UPLOAD_ALWAYS: DWORD = 0x00000002; +pub const UPDP_CHECK_DRIVERSTORE: DWORD = 0x00000004; +extern "system" { + pub fn UploadPrinterDriverPackageA( + pszServer: LPCSTR, + pszInfPath: LPCSTR, + pszEnvironment: LPCSTR, + dwFlags: DWORD, + hwnd: HWND, + pszDestInfPath: LPSTR, + pcchDestInfPath: PULONG, + ) -> HRESULT; + pub fn UploadPrinterDriverPackageW( + pszServer: LPCWSTR, + pszInfPath: LPCWSTR, + pszEnvironment: LPCWSTR, + dwFlags: DWORD, + hwnd: HWND, + pszDestInfPath: LPWSTR, + pcchDestInfPath: PULONG, + ) -> HRESULT; +} +STRUCT!{struct CORE_PRINTER_DRIVERA { + CoreDriverGUID: GUID, + ftDriverDate: FILETIME, + dwlDriverVersion: DWORDLONG, + szPackageID: [CHAR; MAX_PATH], +}} +pub type PCORE_PRINTER_DRIVERA = *mut CORE_PRINTER_DRIVERA; +STRUCT!{struct CORE_PRINTER_DRIVERW { + CoreDriverGUID: GUID, + ftDriverDate: FILETIME, + dwlDriverVersion: DWORDLONG, + szPackageID: [WCHAR; MAX_PATH], +}} +pub type PCORE_PRINTER_DRIVERW = *mut CORE_PRINTER_DRIVERW; +extern "system" { + pub fn GetCorePrinterDriversA( + pszServer: LPCSTR, + pszEnvironment: LPCSTR, + pszzCoreDriverDependencies: LPCSTR, + cCorePrinterDrivers: DWORD, + pCorePrinterDrivers: PCORE_PRINTER_DRIVERA, + ) -> HRESULT; + pub fn GetCorePrinterDriversW( + pszServer: LPCWSTR, + pszEnvironment: LPCWSTR, + pszzCoreDriverDependencies: LPCWSTR, + cCorePrinterDrivers: DWORD, + pCorePrinterDrivers: PCORE_PRINTER_DRIVERW, + ) -> HRESULT; + pub fn CorePrinterDriverInstalledA( + pszServer: LPCSTR, + pszEnvironment: LPCSTR, + CoreDriverGUID: GUID, + ftDriverDate: FILETIME, + dwlDriverVersion: DWORDLONG, + pbDriverInstalled: *mut BOOL, + ) -> HRESULT; + pub fn CorePrinterDriverInstalledW( + pszServer: LPCWSTR, + pszEnvironment: LPCWSTR, + CoreDriverGUID: GUID, + ftDriverDate: FILETIME, + dwlDriverVersion: DWORDLONG, + pbDriverInstalled: *mut BOOL, + ) -> HRESULT; + pub fn GetPrinterDriverPackagePathA( + pszServer: LPCSTR, + pszEnvironment: LPCSTR, + pszLanguage: LPCSTR, + pszPackageID: LPCSTR, + pszDriverPackageCab: LPSTR, + cchDriverPackageCab: DWORD, + pcchRequiredSize: LPDWORD, + ) -> HRESULT; + pub fn GetPrinterDriverPackagePathW( + pszServer: LPCWSTR, + pszEnvironment: LPCWSTR, + pszLanguage: LPCWSTR, + pszPackageID: LPCWSTR, + pszDriverPackageCab: LPWSTR, + cchDriverPackageCab: DWORD, + pcchRequiredSize: LPDWORD, + ) -> HRESULT; + pub fn DeletePrinterDriverPackageA( + pszServer: LPCSTR, + pszInfPath: LPCSTR, + pszEnvironment: LPCSTR, + ) -> HRESULT; + pub fn DeletePrinterDriverPackageW( + pszServer: LPCWSTR, + pszInfPath: LPCWSTR, + pszEnvironment: LPCWSTR, + ) -> HRESULT; +} +ENUM!{enum EPrintPropertyType { + kPropertyTypeString = 1, + kPropertyTypeInt32, + kPropertyTypeInt64, + kPropertyTypeByte, + kPropertyTypeTime, + kPropertyTypeDevMode, + kPropertyTypeSD, + kPropertyTypeNotificationReply, + kPropertyTypeNotificationOptions, + kPropertyTypeBuffer, +}} +ENUM!{enum EPrintXPSJobProgress { + kAddingDocumentSequence = 0, + kDocumentSequenceAdded = 1, + kAddingFixedDocument = 2, + kFixedDocumentAdded = 3, + kAddingFixedPage = 4, + kFixedPageAdded = 5, + kResourceAdded = 6, + kFontAdded = 7, + kImageAdded = 8, + kXpsDocumentCommitted = 9, +}} +ENUM!{enum EPrintXPSJobOperation { + kJobProduction = 1, + kJobConsumption, +}} +STRUCT!{struct PrintPropertyValue_value_propertyBlob { + cbBuf: DWORD, + pBuf: LPVOID, +}} +UNION!{union PrintPropertyValue_value { + [u64; 1] [u64; 2], + propertyByte propertyByte_mut: BYTE, + propertyString propertyString_mut: PWSTR, + propertyInt32 propertyInt32_mut: LONG, + propertyInt64 propertyInt64_mut: LONGLONG, + propertyBlob propertyBlob_mut: PrintPropertyValue_value_propertyBlob, +}} +STRUCT!{struct PrintPropertyValue { + ePropertyType: EPrintPropertyType, + value: PrintPropertyValue_value, +}} +STRUCT!{struct PrintNamedProperty { + propertyName: *mut WCHAR, + propertyValue: PrintPropertyValue, +}} +STRUCT!{struct PrintPropertiesCollection { + numberOfProperties: ULONG, + propertiesCollection: *mut PrintNamedProperty, +}} +extern "system" { + pub fn ReportJobProcessingProgress( + printerHandle: HANDLE, + jobId: ULONG, + jobOperation: EPrintXPSJobOperation, + jobProgress: EPrintXPSJobProgress, + ) -> HRESULT; + pub fn GetPrinterDriver2A( + hWnd: HWND, + hPrinter: HANDLE, + pEnvironment: LPSTR, + Level: DWORD, + pDriverInfo: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; + pub fn GetPrinterDriver2W( + hWnd: HWND, + hPrinter: HANDLE, + pEnvironment: LPWSTR, + Level: DWORD, + pDriverInfo: LPBYTE, + cbBuf: DWORD, + pcbNeeded: LPDWORD, + ) -> BOOL; +} +ENUM!{enum PRINT_EXECUTION_CONTEXT { + PRINT_EXECUTION_CONTEXT_APPLICATION = 0, + PRINT_EXECUTION_CONTEXT_SPOOLER_SERVICE = 1, + PRINT_EXECUTION_CONTEXT_SPOOLER_ISOLATION_HOST = 2, + PRINT_EXECUTION_CONTEXT_FILTER_PIPELINE = 3, + PRINT_EXECUTION_CONTEXT_WOW64 = 4, +}} +STRUCT!{struct PRINT_EXECUTION_DATA { + context: PRINT_EXECUTION_CONTEXT, + clientAppPID: DWORD, +}} +extern "system" { + pub fn GetPrintExecutionData( + pData: *mut PRINT_EXECUTION_DATA, + ) -> BOOL; + pub fn GetJobNamedPropertyValue( + hPrinter: HANDLE, + JobId: DWORD, + pszName: PCWSTR, + pValue: *mut PrintPropertyValue, + ) -> DWORD; + pub fn FreePrintPropertyValue( + pValue: *mut PrintPropertyValue, + ); + pub fn FreePrintNamedPropertyArray( + cProperties: DWORD, + ppProperties: *mut *mut PrintNamedProperty, + ); + pub fn SetJobNamedProperty( + hPrinter: HANDLE, + JobId: DWORD, + pProperty: *const PrintNamedProperty, + ) -> DWORD; + pub fn DeleteJobNamedProperty( + hPrinter: HANDLE, + JobId: DWORD, + pszName: PCWSTR, + ) -> DWORD; + pub fn EnumJobNamedProperties( + hPrinter: HANDLE, + JobId: DWORD, + pcProperties: *mut DWORD, + ppProperties: *mut *mut PrintNamedProperty, + ) -> DWORD; + pub fn GetPrintOutputInfo( + hWnd: HWND, + pszPrinter: PCWSTR, + phFile: *mut HANDLE, + ppszOutputFile: *mut PWSTR, + ) -> HRESULT; +} +pub const MS_PRINT_JOB_OUTPUT_FILE: &'static str = "MsPrintJobOutputFile"; diff --git a/bash-5.1/vendor/winapi/src/um/winsvc.rs b/bash-5.1/vendor/winapi/src/um/winsvc.rs new file mode 100644 index 0000000000000000000000000000000000000000..baa2a8b84275861e2413c828796368248ca56f2c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winsvc.rs @@ -0,0 +1,695 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Header file for the Service Control Manager +use shared::minwindef::{BOOL, DWORD, LPBYTE, LPDWORD, LPVOID}; +use um::winnt::{ + HANDLE, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PSECURITY_DESCRIPTOR, PVOID, + SECURITY_INFORMATION, STANDARD_RIGHTS_REQUIRED +}; +pub const SERVICE_NO_CHANGE: DWORD = 0xffffffff; +pub const SERVICE_ACTIVE: DWORD = 0x00000001; +pub const SERVICE_INACTIVE: DWORD = 0x00000002; +pub const SERVICE_STATE_ALL: DWORD = SERVICE_ACTIVE | SERVICE_INACTIVE; +pub const SERVICE_CONTROL_STOP: DWORD = 0x00000001; +pub const SERVICE_CONTROL_PAUSE: DWORD = 0x00000002; +pub const SERVICE_CONTROL_CONTINUE: DWORD = 0x00000003; +pub const SERVICE_CONTROL_INTERROGATE: DWORD = 0x00000004; +pub const SERVICE_CONTROL_SHUTDOWN: DWORD = 0x00000005; +pub const SERVICE_CONTROL_PARAMCHANGE: DWORD = 0x00000006; +pub const SERVICE_CONTROL_NETBINDADD: DWORD = 0x00000007; +pub const SERVICE_CONTROL_NETBINDREMOVE: DWORD = 0x00000008; +pub const SERVICE_CONTROL_NETBINDENABLE: DWORD = 0x00000009; +pub const SERVICE_CONTROL_NETBINDDISABLE: DWORD = 0x0000000A; +pub const SERVICE_CONTROL_DEVICEEVENT: DWORD = 0x0000000B; +pub const SERVICE_CONTROL_HARDWAREPROFILECHANGE: DWORD = 0x0000000C; +pub const SERVICE_CONTROL_POWEREVENT: DWORD = 0x0000000D; +pub const SERVICE_CONTROL_SESSIONCHANGE: DWORD = 0x0000000E; +pub const SERVICE_CONTROL_PRESHUTDOWN: DWORD = 0x0000000F; +pub const SERVICE_CONTROL_TIMECHANGE: DWORD = 0x00000010; +pub const SERVICE_CONTROL_TRIGGEREVENT: DWORD = 0x00000020; +pub const SERVICE_STOPPED: DWORD = 0x00000001; +pub const SERVICE_START_PENDING: DWORD = 0x00000002; +pub const SERVICE_STOP_PENDING: DWORD = 0x00000003; +pub const SERVICE_RUNNING: DWORD = 0x00000004; +pub const SERVICE_CONTINUE_PENDING: DWORD = 0x00000005; +pub const SERVICE_PAUSE_PENDING: DWORD = 0x00000006; +pub const SERVICE_PAUSED: DWORD = 0x00000007; +pub const SERVICE_ACCEPT_STOP: DWORD = 0x00000001; +pub const SERVICE_ACCEPT_PAUSE_CONTINUE: DWORD = 0x00000002; +pub const SERVICE_ACCEPT_SHUTDOWN: DWORD = 0x00000004; +pub const SERVICE_ACCEPT_PARAMCHANGE: DWORD = 0x00000008; +pub const SERVICE_ACCEPT_NETBINDCHANGE: DWORD = 0x00000010; +pub const SERVICE_ACCEPT_HARDWAREPROFILECHANGE: DWORD = 0x00000020; +pub const SERVICE_ACCEPT_POWEREVENT: DWORD = 0x00000040; +pub const SERVICE_ACCEPT_SESSIONCHANGE: DWORD = 0x00000080; +pub const SERVICE_ACCEPT_PRESHUTDOWN: DWORD = 0x00000100; +pub const SERVICE_ACCEPT_TIMECHANGE: DWORD = 0x00000200; +pub const SERVICE_ACCEPT_TRIGGEREVENT: DWORD = 0x00000400; +// SERVICE_ACCEPT_USER_LOGOFF +pub const SC_MANAGER_CONNECT: DWORD = 0x0001; +pub const SC_MANAGER_CREATE_SERVICE: DWORD = 0x0002; +pub const SC_MANAGER_ENUMERATE_SERVICE: DWORD = 0x0004; +pub const SC_MANAGER_LOCK: DWORD = 0x0008; +pub const SC_MANAGER_QUERY_LOCK_STATUS: DWORD = 0x0010; +pub const SC_MANAGER_MODIFY_BOOT_CONFIG: DWORD = 0x0020; +pub const SC_MANAGER_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SC_MANAGER_CONNECT + | SC_MANAGER_CREATE_SERVICE | SC_MANAGER_ENUMERATE_SERVICE | SC_MANAGER_LOCK + | SC_MANAGER_QUERY_LOCK_STATUS | SC_MANAGER_MODIFY_BOOT_CONFIG; +pub const SERVICE_QUERY_CONFIG: DWORD = 0x0001; +pub const SERVICE_CHANGE_CONFIG: DWORD = 0x0002; +pub const SERVICE_QUERY_STATUS: DWORD = 0x0004; +pub const SERVICE_ENUMERATE_DEPENDENTS: DWORD = 0x0008; +pub const SERVICE_START: DWORD = 0x0010; +pub const SERVICE_STOP: DWORD = 0x0020; +pub const SERVICE_PAUSE_CONTINUE: DWORD = 0x0040; +pub const SERVICE_INTERROGATE: DWORD = 0x0080; +pub const SERVICE_USER_DEFINED_CONTROL: DWORD = 0x0100; +pub const SERVICE_ALL_ACCESS: DWORD = STANDARD_RIGHTS_REQUIRED | SERVICE_QUERY_CONFIG + | SERVICE_CHANGE_CONFIG | SERVICE_QUERY_STATUS | SERVICE_ENUMERATE_DEPENDENTS | SERVICE_START + | SERVICE_STOP | SERVICE_PAUSE_CONTINUE | SERVICE_INTERROGATE | SERVICE_USER_DEFINED_CONTROL; +pub const SERVICE_RUNS_IN_SYSTEM_PROCESS: DWORD = 0x00000001; +pub const SERVICE_CONFIG_DESCRIPTION: DWORD = 1; +pub const SERVICE_CONFIG_FAILURE_ACTIONS: DWORD = 2; +pub const SERVICE_CONFIG_DELAYED_AUTO_START_INFO: DWORD = 3; +pub const SERVICE_CONFIG_FAILURE_ACTIONS_FLAG: DWORD = 4; +pub const SERVICE_CONFIG_SERVICE_SID_INFO: DWORD = 5; +pub const SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO: DWORD = 6; +pub const SERVICE_CONFIG_PRESHUTDOWN_INFO: DWORD = 7; +pub const SERVICE_CONFIG_TRIGGER_INFO: DWORD = 8; +pub const SERVICE_CONFIG_PREFERRED_NODE: DWORD = 9; +pub const SERVICE_CONFIG_LAUNCH_PROTECTED: DWORD = 12; +pub const SERVICE_NOTIFY_STATUS_CHANGE_1: DWORD = 1; +pub const SERVICE_NOTIFY_STATUS_CHANGE_2: DWORD = 2; +pub const SERVICE_NOTIFY_STATUS_CHANGE: DWORD = SERVICE_NOTIFY_STATUS_CHANGE_2; +pub const SERVICE_NOTIFY_STOPPED: DWORD = 0x00000001; +pub const SERVICE_NOTIFY_START_PENDING: DWORD = 0x00000002; +pub const SERVICE_NOTIFY_STOP_PENDING: DWORD = 0x00000004; +pub const SERVICE_NOTIFY_RUNNING: DWORD = 0x00000008; +pub const SERVICE_NOTIFY_CONTINUE_PENDING: DWORD = 0x00000010; +pub const SERVICE_NOTIFY_PAUSE_PENDING: DWORD = 0x00000020; +pub const SERVICE_NOTIFY_PAUSED: DWORD = 0x00000040; +pub const SERVICE_NOTIFY_CREATED: DWORD = 0x00000080; +pub const SERVICE_NOTIFY_DELETED: DWORD = 0x00000100; +pub const SERVICE_NOTIFY_DELETE_PENDING: DWORD = 0x00000200; +pub const SERVICE_STOP_REASON_FLAG_MIN: DWORD = 0x00000000; +pub const SERVICE_STOP_REASON_FLAG_UNPLANNED: DWORD = 0x10000000; +pub const SERVICE_STOP_REASON_FLAG_CUSTOM: DWORD = 0x20000000; +pub const SERVICE_STOP_REASON_FLAG_PLANNED: DWORD = 0x40000000; +pub const SERVICE_STOP_REASON_FLAG_MAX: DWORD = 0x80000000; +pub const SERVICE_STOP_REASON_MAJOR_MIN: DWORD = 0x00000000; +pub const SERVICE_STOP_REASON_MAJOR_OTHER: DWORD = 0x00010000; +pub const SERVICE_STOP_REASON_MAJOR_HARDWARE: DWORD = 0x00020000; +pub const SERVICE_STOP_REASON_MAJOR_OPERATINGSYSTEM: DWORD = 0x00030000; +pub const SERVICE_STOP_REASON_MAJOR_SOFTWARE: DWORD = 0x00040000; +pub const SERVICE_STOP_REASON_MAJOR_APPLICATION: DWORD = 0x00050000; +pub const SERVICE_STOP_REASON_MAJOR_NONE: DWORD = 0x00060000; +pub const SERVICE_STOP_REASON_MAJOR_MAX: DWORD = 0x00070000; +pub const SERVICE_STOP_REASON_MAJOR_MIN_CUSTOM: DWORD = 0x00400000; +pub const SERVICE_STOP_REASON_MAJOR_MAX_CUSTOM: DWORD = 0x00ff0000; +pub const SERVICE_STOP_REASON_MINOR_MIN: DWORD = 0x00000000; +pub const SERVICE_STOP_REASON_MINOR_OTHER: DWORD = 0x00000001; +pub const SERVICE_STOP_REASON_MINOR_MAINTENANCE: DWORD = 0x00000002; +pub const SERVICE_STOP_REASON_MINOR_INSTALLATION: DWORD = 0x00000003; +pub const SERVICE_STOP_REASON_MINOR_UPGRADE: DWORD = 0x00000004; +pub const SERVICE_STOP_REASON_MINOR_RECONFIG: DWORD = 0x00000005; +pub const SERVICE_STOP_REASON_MINOR_HUNG: DWORD = 0x00000006; +pub const SERVICE_STOP_REASON_MINOR_UNSTABLE: DWORD = 0x00000007; +pub const SERVICE_STOP_REASON_MINOR_DISK: DWORD = 0x00000008; +pub const SERVICE_STOP_REASON_MINOR_NETWORKCARD: DWORD = 0x00000009; +pub const SERVICE_STOP_REASON_MINOR_ENVIRONMENT: DWORD = 0x0000000a; +pub const SERVICE_STOP_REASON_MINOR_HARDWARE_DRIVER: DWORD = 0x0000000b; +pub const SERVICE_STOP_REASON_MINOR_OTHERDRIVER: DWORD = 0x0000000c; +pub const SERVICE_STOP_REASON_MINOR_SERVICEPACK: DWORD = 0x0000000d; +pub const SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE: DWORD = 0x0000000e; +pub const SERVICE_STOP_REASON_MINOR_SECURITYFIX: DWORD = 0x0000000f; +pub const SERVICE_STOP_REASON_MINOR_SECURITY: DWORD = 0x00000010; +pub const SERVICE_STOP_REASON_MINOR_NETWORK_CONNECTIVITY: DWORD = 0x00000011; +pub const SERVICE_STOP_REASON_MINOR_WMI: DWORD = 0x00000012; +pub const SERVICE_STOP_REASON_MINOR_SERVICEPACK_UNINSTALL: DWORD = 0x00000013; +pub const SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL: DWORD = 0x00000014; +pub const SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL: DWORD = 0x00000015; +pub const SERVICE_STOP_REASON_MINOR_MMC: DWORD = 0x00000016; +pub const SERVICE_STOP_REASON_MINOR_NONE: DWORD = 0x00000017; +pub const SERVICE_STOP_REASON_MINOR_MAX: DWORD = 0x00000018; +pub const SERVICE_STOP_REASON_MINOR_MIN_CUSTOM: DWORD = 0x00000100; +pub const SERVICE_STOP_REASON_MINOR_MAX_CUSTOM: DWORD = 0x0000FFFF; +pub const SERVICE_CONTROL_STATUS_REASON_INFO: DWORD = 1; +pub const SERVICE_SID_TYPE_NONE: DWORD = 0x00000000; +pub const SERVICE_SID_TYPE_UNRESTRICTED: DWORD = 0x00000001; +pub const SERVICE_SID_TYPE_RESTRICTED: DWORD = 0x00000002 | SERVICE_SID_TYPE_UNRESTRICTED; +pub const SERVICE_TRIGGER_TYPE_DEVICE_INTERFACE_ARRIVAL: DWORD = 1; +pub const SERVICE_TRIGGER_TYPE_IP_ADDRESS_AVAILABILITY: DWORD = 2; +pub const SERVICE_TRIGGER_TYPE_DOMAIN_JOIN: DWORD = 3; +pub const SERVICE_TRIGGER_TYPE_FIREWALL_PORT_EVENT: DWORD = 4; +pub const SERVICE_TRIGGER_TYPE_GROUP_POLICY: DWORD = 5; +pub const SERVICE_TRIGGER_TYPE_NETWORK_ENDPOINT: DWORD = 6; +pub const SERVICE_TRIGGER_TYPE_CUSTOM_SYSTEM_STATE_CHANGE: DWORD = 7; +pub const SERVICE_TRIGGER_TYPE_CUSTOM: DWORD = 20; +pub const SERVICE_TRIGGER_DATA_TYPE_BINARY: DWORD = 1; +pub const SERVICE_TRIGGER_DATA_TYPE_STRING: DWORD = 2; +pub const SERVICE_TRIGGER_DATA_TYPE_LEVEL: DWORD = 3; +pub const SERVICE_TRIGGER_DATA_TYPE_KEYWORD_ANY: DWORD = 4; +pub const SERVICE_TRIGGER_DATA_TYPE_KEYWORD_ALL: DWORD = 5; +pub const SERVICE_START_REASON_DEMAND: DWORD = 0x00000001; +pub const SERVICE_START_REASON_AUTO: DWORD = 0x00000002; +pub const SERVICE_START_REASON_TRIGGER: DWORD = 0x00000004; +pub const SERVICE_START_REASON_RESTART_ON_FAILURE: DWORD = 0x00000008; +pub const SERVICE_START_REASON_DELAYEDAUTO: DWORD = 0x00000010; +pub const SERVICE_DYNAMIC_INFORMATION_LEVEL_START_REASON: DWORD = 1; +pub const SERVICE_LAUNCH_PROTECTED_NONE: DWORD = 0; +pub const SERVICE_LAUNCH_PROTECTED_WINDOWS: DWORD = 1; +pub const SERVICE_LAUNCH_PROTECTED_WINDOWS_LIGHT: DWORD = 2; +pub const SERVICE_LAUNCH_PROTECTED_ANTIMALWARE_LIGHT: DWORD = 3; +DEFINE_GUID!{NETWORK_MANAGER_FIRST_IP_ADDRESS_ARRIVAL_GUID, + 0x4f27f2de, 0x14e2, 0x430b, 0xa5, 0x49, 0x7c, 0xd4, 0x8c, 0xbc, 0x82, 0x45} +DEFINE_GUID!{NETWORK_MANAGER_LAST_IP_ADDRESS_REMOVAL_GUID, + 0xcc4ba62a, 0x162e, 0x4648, 0x84, 0x7a, 0xb6, 0xbd, 0xf9, 0x93, 0xe3, 0x35} +DEFINE_GUID!{DOMAIN_JOIN_GUID, + 0x1ce20aba, 0x9851, 0x4421, 0x94, 0x30, 0x1d, 0xde, 0xb7, 0x66, 0xe8, 0x09} +DEFINE_GUID!{DOMAIN_LEAVE_GUID, + 0xddaf516e, 0x58c2, 0x4866, 0x95, 0x74, 0xc3, 0xb6, 0x15, 0xd4, 0x2e, 0xa1} +DEFINE_GUID!{FIREWALL_PORT_OPEN_GUID, + 0xb7569e07, 0x8421, 0x4ee0, 0xad, 0x10, 0x86, 0x91, 0x5a, 0xfd, 0xad, 0x09} +DEFINE_GUID!{FIREWALL_PORT_CLOSE_GUID, + 0xa144ed38, 0x8e12, 0x4de4, 0x9d, 0x96, 0xe6, 0x47, 0x40, 0xb1, 0xa5, 0x24} +DEFINE_GUID!{MACHINE_POLICY_PRESENT_GUID, + 0x659fcae6, 0x5bdb, 0x4da9, 0xb1, 0xff, 0xca, 0x2a, 0x17, 0x8d, 0x46, 0xe0} +DEFINE_GUID!{USER_POLICY_PRESENT_GUID, + 0x54fb46c8, 0xf089, 0x464c, 0xb1, 0xfd, 0x59, 0xd1, 0xb6, 0x2c, 0x3b, 0x50} +DEFINE_GUID!{RPC_INTERFACE_EVENT_GUID, + 0xbc90d167, 0x9470, 0x4139, 0xa9, 0xba, 0xbe, 0x0b, 0xbb, 0xf5, 0xb7, 0x4d} +DEFINE_GUID!{NAMED_PIPE_EVENT_GUID, + 0x1f81d131, 0x3fac, 0x4537, 0x9e, 0x0c, 0x7e, 0x7b, 0x0c, 0x2f, 0x4b, 0x55} +DEFINE_GUID!{CUSTOM_SYSTEM_STATE_CHANGE_EVENT_GUID, + 0x2d7a2816, 0x0c5e, 0x45fc, 0x9c, 0xe7, 0x57, 0x0e, 0x5e, 0xcd, 0xe9, 0xc9} +ENUM!{enum SC_ACTION_TYPE { + SC_ACTION_NONE = 0, + SC_ACTION_RESTART = 1, + SC_ACTION_REBOOT = 2, + SC_ACTION_RUN_COMMAND = 3, +}} +STRUCT!{struct SC_ACTION { + Type: SC_ACTION_TYPE, + Delay: DWORD, +}} +pub type LPSC_ACTION = *mut SC_ACTION; +STRUCT!{struct SERVICE_FAILURE_ACTIONSW { + dwResetPeriod: DWORD, + lpRebootMsg: LPWSTR, + lpCommand: LPWSTR, + cActions: DWORD, + lpsaActions: LPSC_ACTION, +}} +pub type LPSERVICE_FAILURE_ACTIONSW = *mut SERVICE_FAILURE_ACTIONSW; +STRUCT!{struct SERVICE_FAILURE_ACTIONS_FLAG { + fFailureActionsOnNonCrashFailures: BOOL, +}} +DECLARE_HANDLE!{SC_HANDLE, SC_HANDLE__} +pub type LPSC_HANDLE = *mut SC_HANDLE; +DECLARE_HANDLE!{SERVICE_STATUS_HANDLE, SERVICE_STATUS_HANDLE__} +ENUM!{enum SC_STATUS_TYPE { + SC_STATUS_PROCESS_INFO = 0, +}} +ENUM!{enum SC_ENUM_TYPE { + SC_ENUM_PROCESS_INFO = 0, +}} +STRUCT!{struct SERVICE_STATUS { + dwServiceType: DWORD, + dwCurrentState: DWORD, + dwControlsAccepted: DWORD, + dwWin32ExitCode: DWORD, + dwServiceSpecificExitCode: DWORD, + dwCheckPoint: DWORD, + dwWaitHint: DWORD, +}} +pub type LPSERVICE_STATUS = *mut SERVICE_STATUS; +STRUCT!{struct SERVICE_STATUS_PROCESS { + dwServiceType: DWORD, + dwCurrentState: DWORD, + dwControlsAccepted: DWORD, + dwWin32ExitCode: DWORD, + dwServiceSpecificExitCode: DWORD, + dwCheckPoint: DWORD, + dwWaitHint: DWORD, + dwProcessId: DWORD, + dwServiceFlags: DWORD, +}} +pub type LPSERVICE_STATUS_PROCESS = *mut SERVICE_STATUS_PROCESS; +STRUCT!{struct ENUM_SERVICE_STATUSA { + lpServiceName: LPSTR, + lpDisplayName: LPSTR, + ServiceStatus: SERVICE_STATUS, +}} +pub type LPENUM_SERVICE_STATUSA = *mut ENUM_SERVICE_STATUSA; +STRUCT!{struct ENUM_SERVICE_STATUSW { + lpServiceName: LPWSTR, + lpDisplayName: LPWSTR, + ServiceStatus: SERVICE_STATUS, +}} +pub type LPENUM_SERVICE_STATUSW = *mut ENUM_SERVICE_STATUSW; +STRUCT!{struct ENUM_SERVICE_STATUS_PROCESSA { + lpServiceName: LPSTR, + lpDisplayName: LPSTR, + ServiceStatusProcess: SERVICE_STATUS_PROCESS, +}} +pub type LPENUM_SERVICE_STATUS_PROCESSA = *mut ENUM_SERVICE_STATUS_PROCESSA; +STRUCT!{struct ENUM_SERVICE_STATUS_PROCESSW { + lpServiceName: LPWSTR, + lpDisplayName: LPWSTR, + ServiceStatusProcess: SERVICE_STATUS_PROCESS, +}} +pub type LPENUM_SERVICE_STATUS_PROCESSW = *mut ENUM_SERVICE_STATUS_PROCESSW; +pub type SC_LOCK = LPVOID; +STRUCT!{struct QUERY_SERVICE_LOCK_STATUSA { + fIsLocked: DWORD, + lpLockOwner: LPSTR, + dwLockDuration: DWORD, +}} +pub type LPQUERY_SERVICE_LOCK_STATUSA = *mut QUERY_SERVICE_LOCK_STATUSA; +STRUCT!{struct QUERY_SERVICE_LOCK_STATUSW { + fIsLocked: DWORD, + lpLockOwner: LPWSTR, + dwLockDuration: DWORD, +}} +pub type LPQUERY_SERVICE_LOCK_STATUSW = *mut QUERY_SERVICE_LOCK_STATUSW; +STRUCT!{struct QUERY_SERVICE_CONFIGA { + dwServiceType: DWORD, + dwStartType: DWORD, + dwErrorControl: DWORD, + lpBinaryPathName: LPSTR, + lpLoadOrderGroup: LPSTR, + dwTagId: DWORD, + lpDependencies: LPSTR, + lpServiceStartName: LPSTR, + lpDisplayName: LPSTR, +}} +pub type LPQUERY_SERVICE_CONFIGA = *mut QUERY_SERVICE_CONFIGA; +STRUCT!{struct QUERY_SERVICE_CONFIGW { + dwServiceType: DWORD, + dwStartType: DWORD, + dwErrorControl: DWORD, + lpBinaryPathName: LPWSTR, + lpLoadOrderGroup: LPWSTR, + dwTagId: DWORD, + lpDependencies: LPWSTR, + lpServiceStartName: LPWSTR, + lpDisplayName: LPWSTR, +}} +pub type LPQUERY_SERVICE_CONFIGW = *mut QUERY_SERVICE_CONFIGW; +STRUCT!{struct SERVICE_DESCRIPTIONA { + lpDescription: LPSTR, +}} +pub type LPSERVICE_DESCRIPTIONA = *mut SERVICE_DESCRIPTIONA; +STRUCT!{struct SERVICE_DESCRIPTIONW { + lpDescription: LPWSTR, +}} +pub type LPSERVICE_DESCRIPTIONW = *mut SERVICE_DESCRIPTIONW; +FN!{stdcall LPSERVICE_MAIN_FUNCTIONW( + dwNumServicesArgs: DWORD, + lpServiceArgVectors: *mut LPWSTR, +) -> ()} +FN!{stdcall LPSERVICE_MAIN_FUNCTIONA( + dwNumServicesArgs: DWORD, + lpServiceArgVectors: *mut LPSTR, +) -> ()} +STRUCT!{struct SERVICE_TABLE_ENTRYA { + lpServiceName: LPCSTR, + lpServiceProc: LPSERVICE_MAIN_FUNCTIONA, +}} +pub type LPSERVICE_TABLE_ENTRYA = *mut SERVICE_TABLE_ENTRYA; +STRUCT!{struct SERVICE_TABLE_ENTRYW { + lpServiceName: LPCWSTR, + lpServiceProc: LPSERVICE_MAIN_FUNCTIONW, +}} +pub type LPSERVICE_TABLE_ENTRYW = *mut SERVICE_TABLE_ENTRYW; +FN!{stdcall LPHANDLER_FUNCTION( + dwControl: DWORD, +) -> ()} +FN!{stdcall LPHANDLER_FUNCTION_EX( + dwControl: DWORD, + dwEventType: DWORD, + lpEventData: LPVOID, + lpContext: LPVOID, +) -> DWORD} +FN!{stdcall PFN_SC_NOTIFY_CALLBACK( + pParameter: PVOID, +) -> ()} +STRUCT!{struct SERVICE_NOTIFY_1 { + dwVersion: DWORD, + pfnNotifyCallback: PFN_SC_NOTIFY_CALLBACK, + pContext: PVOID, + dwNotificationStatus: DWORD, + ServiceStatus: SERVICE_STATUS_PROCESS, +}} +pub type PSERVICE_NOTIFY_1 = *mut SERVICE_NOTIFY_1; +STRUCT!{struct SERVICE_NOTIFY_2A { + dwVersion: DWORD, + pfnNotifyCallback: PFN_SC_NOTIFY_CALLBACK, + pContext: PVOID, + dwNotificationStatus: DWORD, + ServiceStatus: SERVICE_STATUS_PROCESS, + dwNotificationTriggered: DWORD, + pszServiceNames: LPSTR, +}} +pub type PSERVICE_NOTIFY_2A = *mut SERVICE_NOTIFY_2A; +STRUCT!{struct SERVICE_NOTIFY_2W { + dwVersion: DWORD, + pfnNotifyCallback: PFN_SC_NOTIFY_CALLBACK, + pContext: PVOID, + dwNotificationStatus: DWORD, + ServiceStatus: SERVICE_STATUS_PROCESS, + dwNotificationTriggered: DWORD, + pszServiceNames: LPWSTR, +}} +pub type PSERVICE_NOTIFY_2W = *mut SERVICE_NOTIFY_2W; +pub type SERVICE_NOTIFYA = SERVICE_NOTIFY_2A; +pub type PSERVICE_NOTIFYA = PSERVICE_NOTIFY_2A; +pub type SERVICE_NOTIFYW = SERVICE_NOTIFY_2W; +pub type PSERVICE_NOTIFYW = PSERVICE_NOTIFY_2W; +extern "system" { + pub fn ChangeServiceConfigA( + hService: SC_HANDLE, + dwServiceType: DWORD, + dsStartType: DWORD, + dwErrorControl: DWORD, + lpBinaryPathName: LPCSTR, + lpLoadOrderGroup: LPCSTR, + lpdwTagId: LPDWORD, + lpDependencies: LPCSTR, + lpServiceStartName: LPCSTR, + lpPassword: LPCSTR, + lpDisplayName: LPCSTR, + ) -> BOOL; + pub fn ChangeServiceConfigW( + hService: SC_HANDLE, + dwServiceType: DWORD, + dsStartType: DWORD, + dwErrorControl: DWORD, + lpBinaryPathName: LPCWSTR, + lpLoadOrderGroup: LPCWSTR, + lpdwTagId: LPDWORD, + lpDependencies: LPCWSTR, + lpServiceStartName: LPCWSTR, + lpPassword: LPCWSTR, + lpDisplayName: LPCWSTR, + ) -> BOOL; + pub fn ChangeServiceConfig2A( + hService: SC_HANDLE, + dwInfoLevel: DWORD, + lpInfo: LPVOID, + ) -> BOOL; + pub fn ChangeServiceConfig2W( + hService: SC_HANDLE, + dwInfoLevel: DWORD, + lpInfo: LPVOID, + ) -> BOOL; + pub fn CloseServiceHandle( + hSCObject: SC_HANDLE, + ) -> BOOL; + pub fn ControlService( + hService: SC_HANDLE, + dwControl: DWORD, + lpServiceStatus: LPSERVICE_STATUS, + ) -> BOOL; + pub fn CreateServiceA( + hSCManager: SC_HANDLE, + lpServiceName: LPCSTR, + lpDisplayName: LPCSTR, + dwDesiredAccess: DWORD, + dwServiceType: DWORD, + dwStartType: DWORD, + dwErrorControl: DWORD, + lpBinaryPathName: LPCSTR, + lpLoadOrderGroup: LPCSTR, + lpdwTagId: LPDWORD, + lpDependencies: LPCSTR, + lpServiceStartName: LPCSTR, + lpPassword: LPCSTR, + ) -> SC_HANDLE; + pub fn CreateServiceW( + hSCManager: SC_HANDLE, + lpServiceName: LPCWSTR, + lpDisplayName: LPCWSTR, + dwDesiredAccess: DWORD, + dwServiceType: DWORD, + dwStartType: DWORD, + dwErrorControl: DWORD, + lpBinaryPathName: LPCWSTR, + lpLoadOrderGroup: LPCWSTR, + lpdwTagId: LPDWORD, + lpDependencies: LPCWSTR, + lpServiceStartName: LPCWSTR, + lpPassword: LPCWSTR, + ) -> SC_HANDLE; + pub fn DeleteService( + hService: SC_HANDLE, + ) -> BOOL; + pub fn EnumDependentServicesA( + hService: SC_HANDLE, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUSA, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + ) -> BOOL; + pub fn EnumDependentServicesW( + hService: SC_HANDLE, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUSW, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + ) -> BOOL; + pub fn EnumServicesStatusA( + hSCManager: SC_HANDLE, + dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUSA, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD, + ) -> BOOL; + pub fn EnumServicesStatusW( + hSCManager: SC_HANDLE, + dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUSW, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD, + ) -> BOOL; + pub fn EnumServicesStatusExA( + hSCManager: SC_HANDLE, + InfoLevel: SC_ENUM_TYPE, + dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPBYTE, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD, + pszGroupName: LPCSTR, + ) -> BOOL; + pub fn EnumServicesStatusExW( + hSCManager: SC_HANDLE, + InfoLevel: SC_ENUM_TYPE, + dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPBYTE, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD, + pszGroupName: LPCWSTR, + ) -> BOOL; + pub fn GetServiceKeyNameA( + hSCManager: SC_HANDLE, + lpDisplayName: LPCSTR, + lpServiceName: LPSTR, + lpcchBuffer: LPDWORD, + ) -> BOOL; + pub fn GetServiceKeyNameW( + hSCManager: SC_HANDLE, + lpDisplayName: LPCWSTR, + lpServiceName: LPWSTR, + lpcchBuffer: LPDWORD, + ) -> BOOL; + pub fn GetServiceDisplayNameA( + hSCManager: SC_HANDLE, + lpServiceName: LPCSTR, + lpDisplayName: LPSTR, + lpcchBuffer: LPDWORD, + ) -> BOOL; + pub fn GetServiceDisplayNameW( + hSCManager: SC_HANDLE, + lpServiceName: LPCWSTR, + lpDisplayName: LPWSTR, + lpcchBuffer: LPDWORD, + ) -> BOOL; + pub fn LockServiceDatabase( + hSCManager: SC_HANDLE, + ) -> SC_LOCK; + pub fn NotifyBootConfigStatus( + BootAcceptable: BOOL, + ) -> BOOL; + pub fn OpenSCManagerA( + lpMachineName: LPCSTR, + lpDatabaseName: LPCSTR, + dwDesiredAccess: DWORD, + ) -> SC_HANDLE; + pub fn OpenSCManagerW( + lpMachineName: LPCWSTR, + lpDatabaseName: LPCWSTR, + dwDesiredAccess: DWORD, + ) -> SC_HANDLE; + pub fn OpenServiceA( + hSCManager: SC_HANDLE, + lpServiceName: LPCSTR, + dwDesiredAccess: DWORD, + ) -> SC_HANDLE; + pub fn OpenServiceW( + hSCManager: SC_HANDLE, + lpServiceName: LPCWSTR, + dwDesiredAccess: DWORD, + ) -> SC_HANDLE; + pub fn QueryServiceConfigA( + hService: SC_HANDLE, + lpServiceConfig: LPQUERY_SERVICE_CONFIGA, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> BOOL; + pub fn QueryServiceConfigW( + hService: SC_HANDLE, + lpServiceConfig: LPQUERY_SERVICE_CONFIGW, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> BOOL; + pub fn QueryServiceConfig2A( + hService: SC_HANDLE, + dwInfoLevel: DWORD, + lpBuffer: LPBYTE, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> BOOL; + pub fn QueryServiceConfig2W( + hService: SC_HANDLE, + dwInfoLevel: DWORD, + lpBuffer: LPBYTE, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> BOOL; + pub fn QueryServiceLockStatusA( + hSCManager: SC_HANDLE, + lpLockStatus: LPQUERY_SERVICE_LOCK_STATUSA, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> BOOL; + pub fn QueryServiceLockStatusW( + hSCManager: SC_HANDLE, + lpLockStatus: LPQUERY_SERVICE_LOCK_STATUSW, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> BOOL; + pub fn QueryServiceObjectSecurity( + hService: SC_HANDLE, + dwSecurityInformation: SECURITY_INFORMATION, + lpSecurityDescriptor: PSECURITY_DESCRIPTOR, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> BOOL; + pub fn QueryServiceStatus( + hService: SC_HANDLE, + lpServiceStatus: LPSERVICE_STATUS, + ) -> BOOL; + pub fn QueryServiceStatusEx( + hService: SC_HANDLE, + InfoLevel: SC_STATUS_TYPE, + lpBuffer: LPBYTE, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> BOOL; + pub fn RegisterServiceCtrlHandlerA( + lpServiceName: LPCSTR, + lpHandlerProc: LPHANDLER_FUNCTION, + ) -> SERVICE_STATUS_HANDLE; + pub fn RegisterServiceCtrlHandlerW( + lpServiceName: LPCWSTR, + lpHandlerProc: LPHANDLER_FUNCTION, + ) -> SERVICE_STATUS_HANDLE; + pub fn RegisterServiceCtrlHandlerExA( + lpServiceName: LPCSTR, + lpHandlerProc: LPHANDLER_FUNCTION_EX, + lpContext: LPVOID, + ) -> SERVICE_STATUS_HANDLE; + pub fn RegisterServiceCtrlHandlerExW( + lpServiceName: LPCWSTR, + lpHandlerProc: LPHANDLER_FUNCTION_EX, + lpContext: LPVOID, + ) -> SERVICE_STATUS_HANDLE; + pub fn SetServiceObjectSecurity( + hService: SC_HANDLE, + dwSecurityInformation: SECURITY_INFORMATION, + lpSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> BOOL; + pub fn SetServiceStatus( + hServiceStatus: SERVICE_STATUS_HANDLE, + lpServiceStatus: LPSERVICE_STATUS, + ) -> BOOL; + pub fn StartServiceCtrlDispatcherA( + lpServiceStartTable: *const SERVICE_TABLE_ENTRYA, + ) -> BOOL; + pub fn StartServiceCtrlDispatcherW( + lpServiceStartTable: *const SERVICE_TABLE_ENTRYW, + ) -> BOOL; + pub fn StartServiceA( + hService: SC_HANDLE, + dwNumServiceArgs: DWORD, + lpServiceArgVectors: *mut LPCSTR, + ) -> BOOL; + pub fn StartServiceW( + hService: SC_HANDLE, + dwNumServiceArgs: DWORD, + lpServiceArgVectors: *mut LPCWSTR, + ) -> BOOL; + pub fn UnlockServiceDatabase( + ScLock: SC_LOCK, + ) -> BOOL; + pub fn NotifyServiceStatusChangeA( + hService: SC_HANDLE, + dwNotifyMask: DWORD, + pNotifyBuffer: PSERVICE_NOTIFYA, + ) -> DWORD; + pub fn NotifyServiceStatusChangeW( + hService: SC_HANDLE, + dwNotifyMask: DWORD, + pNotifyBuffer: PSERVICE_NOTIFYW, + ) -> DWORD; + pub fn ControlServiceExA( + hService: SC_HANDLE, + dwControl: DWORD, + dwInfoLevel: DWORD, + pControlParams: PVOID, + ) -> BOOL; + pub fn ControlServiceExW( + hService: SC_HANDLE, + dwControl: DWORD, + dwInfoLevel: DWORD, + pControlParams: PVOID, + ) -> BOOL; + pub fn QueryServiceDynamicInformation( + hServiceStatus: SERVICE_STATUS_HANDLE, + dwInfoLevel: DWORD, + ppDynamicInfo: *mut PVOID, + ) -> BOOL; + pub fn WaitServiceState ( + hService: SC_HANDLE, + dwNotify: DWORD, + dwTimeout: DWORD, + hCancelEvent: HANDLE, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/wintrust.rs b/bash-5.1/vendor/winapi/src/um/wintrust.rs new file mode 100644 index 0000000000000000000000000000000000000000..867e12e46aa92491e98038b7da90b19e6ef92c6a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wintrust.rs @@ -0,0 +1,123 @@ +use shared::guiddef::GUID; +use shared::minwindef::{BYTE, DWORD, LPVOID}; +use shared::ntdef::{HANDLE, LONG, LPCWSTR, LPWSTR, WCHAR}; +use shared::windef::HWND; +use um::wincrypt::{CRYPT_DATA_BLOB, PCERT_STRONG_SIGN_PARA}; +//90 +pub const WTD_UI_ALL: DWORD = 1; +pub const WTD_UI_NONE: DWORD = 2; +pub const WTD_UI_NOBAD: DWORD = 3; +pub const WTD_UI_NOGOOD: DWORD = 4; +pub const WTD_REVOKE_NONE: DWORD = 0x00000000; +pub const WTD_REVOKE_WHOLECHAIN: DWORD = 0x00000001; +pub const WTD_CHOICE_FILE: DWORD = 1; +pub const WTD_CHOICE_CATALOG: DWORD = 2; +pub const WTD_CHOICE_BLOB: DWORD = 3; +pub const WTD_CHOICE_SIGNER: DWORD = 4; +pub const WTD_CHOICE_CERT: DWORD = 5; +pub const WTD_STATEACTION_IGNORE: DWORD = 0x00000000; +pub const WTD_STATEACTION_VERIFY: DWORD = 0x00000001; +pub const WTD_STATEACTION_CLOSE: DWORD = 0x00000002; +pub const WTD_STATEACTION_AUTO_CACHE: DWORD = 0x00000003; +pub const WTD_STATEACTION_AUTO_CACHE_FLUSH: DWORD = 0x00000004; +pub const WTD_PROV_FLAGS_MASK: DWORD = 0x0000FFFF; +pub const WTD_USE_IE4_TRUST_FLAG: DWORD = 0x00000001; +pub const WTD_NO_IE4_CHAIN_FLAG: DWORD = 0x00000002; +pub const WTD_NO_POLICY_USAGE_FLAG: DWORD = 0x00000004; +pub const WTD_REVOCATION_CHECK_NONE: DWORD = 0x00000010; +pub const WTD_REVOCATION_CHECK_END_CERT: DWORD = 0x00000020; +pub const WTD_REVOCATION_CHECK_CHAIN: DWORD = 0x00000040; +pub const WTD_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT: DWORD = 0x00000080; +pub const WTD_SAFER_FLAG: DWORD = 0x00000100; +pub const WTD_HASH_ONLY_FLAG: DWORD = 0x00000200; +pub const WTD_USE_DEFAULT_OSVER_CHECK: DWORD = 0x00000400; +pub const WTD_LIFETIME_SIGNING_FLAG: DWORD = 0x00000800; +pub const WTD_CACHE_ONLY_URL_RETRIEVAL: DWORD = 0x00001000; +pub const WTD_DISABLE_MD2_MD4: DWORD = 0x00002000; +pub const WTD_MOTW: DWORD = 0x00004000; +pub const WTD_CODE_INTEGRITY_DRIVER_MODE: DWORD = 0x00008000; +pub const WTD_UICONTEXT_EXECUTE: DWORD = 0; +pub const WTD_UICONTEXT_INSTALL: DWORD = 1; +STRUCT!{struct WINTRUST_DATA { + cbStruct: DWORD, + pPolicyCallbackData: LPVOID, + pSIPClientData: LPVOID, + dwUIChoice: DWORD, + fdwRevocationChecks: DWORD, + dwUnionChoice: DWORD, + u: WINTRUST_DATA_u, + dwStateAction: DWORD, + hWVTStateData: HANDLE, + pwszURLReference: *mut WCHAR, + dwProvFlags: DWORD, + dwUIContext: DWORD, + pSignatureSettings: *mut WINTRUST_SIGNATURE_SETTINGS, +}} +UNION!{union WINTRUST_DATA_u { + [usize; 1], + pFile pFile_mut: *mut WINTRUST_FILE_INFO, + // pCatalog pCatalog_mut: *mut WINTRUST_CATALOG_INFO, + // pBlob pBlob_mut: *mut WINTRUST_BLOB_INFO, + // pSgnr pSgnr_mut: *mut WINTRUST_SGNR_INFO, + // pCert pCert_mut: *mut WINTRUST_CERT_INFO, +}} +pub type PWINTRUST_DATA = *mut WINTRUST_DATA; +STRUCT!{struct WINTRUST_SIGNATURE_SETTINGS { + cbStruct: DWORD, + dwIndex: DWORD, + dwFlags: DWORD, + cSecondarySigs: DWORD, + dwVerifiedSigIndex: DWORD, + pCryptoPolicy: PCERT_STRONG_SIGN_PARA, +}} +pub type PWINTRUST_SIGNATURE_SETTINGS = *mut WINTRUST_SIGNATURE_SETTINGS; +//217 +STRUCT! {struct WINTRUST_FILE_INFO { + cbStruct: DWORD, + pcwszFilePath: LPCWSTR, + hFile: HANDLE, + pgKnownSubject: *const GUID, +}} +//414 +extern "system" { + pub fn WinVerifyTrust(hwnd: HWND, pgActionID: *mut GUID, pWVTData: LPVOID) -> LONG; +} +//1246 +pub const SPC_UUID_LENGTH: usize = 16; +pub type SPC_UUID = [BYTE; SPC_UUID_LENGTH]; +//SpcSerializedObjectAttributesClassId +STRUCT!{struct SPC_SERIALIZED_OBJECT { + ClassId: SPC_UUID, + SerializedData: CRYPT_DATA_BLOB, +}} +pub type PSPC_SERIALIZED_OBJECT = *mut SPC_SERIALIZED_OBJECT; +STRUCT!{struct SPC_SIGINFO { + dwSipVersion: DWORD, + gSIPGuid: GUID, + dwReserved1: DWORD, + dwReserved2: DWORD, + dwReserved3: DWORD, + dwReserved4: DWORD, + dwReserved5: DWORD, +}} +pub type PSPC_SIGINFO = *mut SPC_SIGINFO; +pub const SPC_URL_LINK_CHOICE: DWORD = 1; +pub const SPC_MONIKER_LINK_CHOICE: DWORD = 2; +pub const SPC_FILE_LINK_CHOICE: DWORD = 3; +STRUCT!{struct SPC_LINK { + dwLinkChoice: DWORD, + u: SPC_LINK_u, +}} +UNION!{union SPC_LINK_u { + [u32; 6] [u64; 4], + pwszUrl pwszUrl_mut: LPWSTR, + Moniker Moniker_mut: SPC_SERIALIZED_OBJECT, + pwszFile pwszFile_mut: LPWSTR, +}} +pub type PSPC_LINK = *mut SPC_LINK; +//1337 +STRUCT!{struct SPC_SP_OPUS_INFO { + pwszProgramName: LPCWSTR, + pMoreInfo: *mut SPC_LINK, + pPublisherInfo: *mut SPC_LINK, +}} diff --git a/bash-5.1/vendor/winapi/src/um/winusb.rs b/bash-5.1/vendor/winapi/src/um/winusb.rs new file mode 100644 index 0000000000000000000000000000000000000000..c72e36833a25dbe2fbe986276629872d7e9a3135 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winusb.rs @@ -0,0 +1,224 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! FFI bindings to winusb. +use shared::minwindef::{BOOL, LPDWORD, PUCHAR, PULONG, UCHAR, ULONG, USHORT}; +use shared::usb::PUSBD_ISO_PACKET_DESCRIPTOR; +use shared::usbspec::PUSB_CONFIGURATION_DESCRIPTOR; +use shared::winusbio::{PWINUSB_PIPE_INFORMATION, PWINUSB_PIPE_INFORMATION_EX}; +use um::minwinbase::LPOVERLAPPED; +use um::winnt::{HANDLE, LARGE_INTEGER, LONG, PVOID}; +pub type WINUSB_INTERFACE_HANDLE = PVOID; +pub type PWINUSB_INTERFACE_HANDLE = *mut PVOID; +pub type WINUSB_ISOCH_BUFFER_HANDLE = PVOID; +pub type PWINUSB_ISOCH_BUFFER_HANDLE = *mut PVOID; +STRUCT!{#[repr(packed)] struct WINUSB_SETUP_PACKET { + RequestType: UCHAR, + Request: UCHAR, + Value: USHORT, + Index: USHORT, + Length: USHORT, +}} +pub type PWINUSB_SETUP_PACKET = *mut WINUSB_SETUP_PACKET; +extern "system" { + pub fn WinUsb_Initialize( + DeviceHandle: HANDLE, + InterfaceHandle: PWINUSB_INTERFACE_HANDLE, + ) -> BOOL; + pub fn WinUsb_Free( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + ) -> BOOL; + pub fn WinUsb_GetAssociatedInterface( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + AssociatedInterfaceIndex: UCHAR, + AssociatedInterfaceHandle: PWINUSB_INTERFACE_HANDLE, + ) -> BOOL; + pub fn WinUsb_GetDescriptor( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + DescriptorType: UCHAR, + Index: UCHAR, + LanguageID: USHORT, + Buffer: PUCHAR, + BufferLength: ULONG, + LengthTransferred: PULONG, + ) -> BOOL; + pub fn WinUsb_QueryInterfaceSettings( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + AlternateInterfaceNumber: UCHAR, + UsbAltInterfaceDescriptor: PUSB_INTERFACE_DESCRIPTOR, + ) -> BOOL; + pub fn WinUsb_QueryDeviceInformation( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + InformationType: ULONG, + BufferLength: PULONG, + Buffer: PVOID, + ) -> BOOL; + pub fn WinUsb_SetCurrentAlternateSetting( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + SettingNumber: UCHAR, + ) -> BOOL; + pub fn WinUsb_GetCurrentAlternateSetting( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + SettingNumber: PUCHAR, + ) -> BOOL; + pub fn WinUsb_QueryPipe( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + AlternateInterfaceNumber: UCHAR, + PipeIndex: UCHAR, + PipeInformationEx: PWINUSB_PIPE_INFORMATION, + ) -> BOOL; + pub fn WinUsb_QueryPipeEx( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + AlternateInterfaceNumber: UCHAR, + PipeIndex: UCHAR, + PipeInformationEx: PWINUSB_PIPE_INFORMATION_EX, + ) -> BOOL; + pub fn WinUsb_SetPipePolicy( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + PipeID: UCHAR, + PolicyType: ULONG, + ValueLength: ULONG, + Value: PVOID, + ) -> BOOL; + pub fn WinUsb_GetPipePolicy( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + PipeID: UCHAR, + PolicyType: ULONG, + ValueLength: PULONG, + Value: PVOID, + ) -> BOOL; + pub fn WinUsb_ReadPipe( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + PipeID: UCHAR, + Buffer: PUCHAR, + BufferLength: ULONG, + LengthTransferred: PULONG, + Overlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn WinUsb_WritePipe( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + PipeID: UCHAR, + Buffer: PUCHAR, + BufferLength: ULONG, + LengthTransferred: PULONG, + Overlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn WinUsb_ControlTransfer( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + SetupPacket: WINUSB_SETUP_PACKET, + Buffer: PUCHAR, + BufferLength: ULONG, + LengthTransferred: PULONG, + Overlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn WinUsb_ResetPipe( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + PipeID: UCHAR, + ) -> BOOL; + pub fn WinUsb_AbortPipe( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + PipeID: UCHAR, + ) -> BOOL; + pub fn WinUsb_FlushPipe( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + PipeID: UCHAR, + ) -> BOOL; + pub fn WinUsb_SetPowerPolicy( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + PolicyType: ULONG, + ValueLength: ULONG, + Value: PVOID, + ) -> BOOL; + pub fn WinUsb_GetPowerPolicy( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + PolicyType: ULONG, + ValueLength: PULONG, + Value: PVOID, + ) -> BOOL; + pub fn WinUsb_GetOverlappedResult( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + lpOverlapped: LPOVERLAPPED, + lpNumberOfBytesTransferred: LPDWORD, + bWait: BOOL, + ) -> BOOL; + pub fn WinUsb_ParseConfigurationDescriptor( + ConfigurationDescriptor: PUSB_CONFIGURATION_DESCRIPTOR, + StartPosition: PVOID, + InterfaceNumber: LONG, + AlternateSetting: LONG, + InterfaceClass: LONG, + InterfaceSubClass: LONG, + InterfaceProtocol: LONG, + ) -> BOOL; + pub fn WinUsb_ParseDescriptors( + DescriptorBuffer: PVOID, + TotalLength: ULONG, + StartPosition: PVOID, + DescriptorType: LONG, + ) -> BOOL; + pub fn WinUsb_GetCurrentFrameNumber( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + CurrentFrameNumber: PULONG, + TimeStamp: *mut LARGE_INTEGER, + ) -> BOOL; + pub fn WinUsb_GetAdjustedFrameNumber( + CurrentFrameNumber: PULONG, + TimeStamp: LARGE_INTEGER, + ) -> BOOL; + pub fn WinUsb_RegisterIsochBuffer( + InterfaceHandle: WINUSB_INTERFACE_HANDLE, + PipeID: UCHAR, + Buffer: PUCHAR, + BufferLength: ULONG, + IsochBufferHandle: PWINUSB_ISOCH_BUFFER_HANDLE, + ) -> BOOL; + pub fn WinUsb_UnregisterIsochBuffer( + IsochBufferHandle: WINUSB_ISOCH_BUFFER_HANDLE, + ) -> BOOL; + pub fn WinUsb_WriteIsochPipe( + BufferHandle: WINUSB_ISOCH_BUFFER_HANDLE, + Offset: ULONG, + Length: ULONG, + FrameNumber: PULONG, + Overlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn WinUsb_ReadIsochPipe( + BufferHandle: WINUSB_ISOCH_BUFFER_HANDLE, + Offset: ULONG, + Length: ULONG, + FrameNumber: PULONG, + NumberOfPackets: ULONG, + IsoPacketDescriptors: PUSBD_ISO_PACKET_DESCRIPTOR, + Overlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn WinUsb_WriteIsochPipeAsap( + BufferHandle: WINUSB_ISOCH_BUFFER_HANDLE, + Offset: ULONG, + Length: ULONG, + ContinueStream: BOOL, + Overlapped: LPOVERLAPPED, + ) -> BOOL; + pub fn WinUsb_ReadIsochPipeAsap( + BufferHandle: WINUSB_ISOCH_BUFFER_HANDLE, + Offset: ULONG, + Length: ULONG, + ContinueStream: BOOL, + NumberOfPackets: ULONG, + IsoPacketDescriptors: PUSBD_ISO_PACKET_DESCRIPTOR, + Overlapped: LPOVERLAPPED, + ) -> BOOL; +} +STRUCT!{struct USB_INTERFACE_DESCRIPTOR { + bLength: UCHAR, + bDescriptorType: UCHAR, + bInterfaceNumber: UCHAR, + bAlternateSetting: UCHAR, + bNumEndpoints: UCHAR, + bInterfaceClass: UCHAR, + bInterfaceSubClass: UCHAR, + bInterfaceProtocol: UCHAR, + iInterface: UCHAR, +}} +pub type PUSB_INTERFACE_DESCRIPTOR = *mut USB_INTERFACE_DESCRIPTOR; diff --git a/bash-5.1/vendor/winapi/src/um/winuser.rs b/bash-5.1/vendor/winapi/src/um/winuser.rs new file mode 100644 index 0000000000000000000000000000000000000000..caeb5d95f9f76dc6dcc91f8e6f855379c72e8e97 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winuser.rs @@ -0,0 +1,7251 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! USER procedure declarations, constant definitions and macros +use ctypes::{c_int, c_long, c_short, c_uint}; +use shared::basetsd::{ + DWORD_PTR, INT32, INT_PTR, PDWORD_PTR, UINT16, UINT32, UINT64, UINT_PTR, ULONG_PTR, +}; +#[cfg(target_pointer_width = "64")] +use shared::basetsd::LONG_PTR; +use shared::guiddef::{GUID, LPCGUID}; +use shared::minwindef::{ + ATOM, BOOL, BYTE, DWORD, HINSTANCE, HIWORD, HKL, HMODULE, HRGN, HWINSTA, INT, LOWORD, LPARAM, + LPBYTE, LPDWORD, LPINT, LPVOID, LPWORD, LRESULT, PBYTE, PUINT, PULONG, TRUE, UCHAR, UINT, + ULONG, USHORT, WORD, WPARAM, +}; +use shared::windef::{ + COLORREF, DPI_AWARENESS, DPI_AWARENESS_CONTEXT, DPI_HOSTING_BEHAVIOR, HACCEL, HBITMAP, HBRUSH, + HCURSOR, HDC, HDESK, HHOOK, HICON, HMENU, HMONITOR, HWINEVENTHOOK, HWND, LPCRECT, LPPOINT, + LPRECT, POINT, RECT, SIZE, +}; +use um::minwinbase::LPSECURITY_ATTRIBUTES; +use um::wingdi::{ + BLENDFUNCTION, DEVMODEA, DEVMODEW, LOGFONTA, LOGFONTW, PDISPLAY_DEVICEA, PDISPLAY_DEVICEW +}; +use um::winnt::{ + ACCESS_MASK, BOOLEAN, CHAR, HANDLE, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, LUID, + PSECURITY_DESCRIPTOR, PSECURITY_INFORMATION, PVOID, SHORT, VOID, WCHAR, +}; +use vc::limits::UINT_MAX; +use vc::vadefs::va_list; +pub type HDWP = HANDLE; +pub type MENUTEMPLATEA = VOID; +pub type MENUTEMPLATEW = VOID; +pub type LPMENUTEMPLATEA = PVOID; +pub type LPMENUTEMPLATEW = PVOID; +FN!{stdcall WNDPROC( + HWND, + UINT, + WPARAM, + LPARAM, +) -> LRESULT} +FN!{stdcall DLGPROC( + HWND, + UINT, + WPARAM, + LPARAM, +) -> INT_PTR} +FN!{stdcall TIMERPROC( + HWND, + UINT, + UINT_PTR, + DWORD, +) -> ()} +FN!{stdcall GRAYSTRINGPROC( + HDC, + LPARAM, + c_int, +) -> BOOL} +FN!{stdcall WNDENUMPROC( + HWND, + LPARAM, +) -> BOOL} +FN!{stdcall HOOKPROC( + code: c_int, + wParam: WPARAM, + lParam: LPARAM, +) -> LRESULT} +FN!{stdcall SENDASYNCPROC( + HWND, + UINT, + ULONG_PTR, + LRESULT, +) -> ()} +FN!{stdcall PROPENUMPROCA( + HWND, + LPCSTR, + HANDLE, +) -> BOOL} +FN!{stdcall PROPENUMPROCW( + HWND, + LPCWSTR, + HANDLE, +) -> BOOL} +FN!{stdcall PROPENUMPROCEXA( + HWND, + LPSTR, + HANDLE, + ULONG_PTR, +) -> BOOL} +FN!{stdcall PROPENUMPROCEXW( + HWND, + LPWSTR, + HANDLE, + ULONG_PTR, +) -> BOOL} +FN!{stdcall EDITWORDBREAKPROCA( + lpch: LPSTR, + ichCurrent: c_int, + cch: c_int, + code: c_int, +) -> c_int} +FN!{stdcall EDITWORDBREAKPROCW( + lpch: LPWSTR, + ichCurrent: c_int, + cch: c_int, + code: c_int, +) -> c_int} +FN!{stdcall DRAWSTATEPROC( + hdc: HDC, + lData: LPARAM, + wData: WPARAM, + cx: c_int, + cy: c_int, +) -> BOOL} +FN!{stdcall NAMEENUMPROCA( + LPSTR, + LPARAM, +) -> BOOL} +FN!{stdcall NAMEENUMPROCW( + LPWSTR, + LPARAM, +) -> BOOL} +pub type WINSTAENUMPROCA = NAMEENUMPROCA; +pub type DESKTOPENUMPROCA = NAMEENUMPROCA; +pub type WINSTAENUMPROCW = NAMEENUMPROCW; +pub type DESKTOPENUMPROCW = NAMEENUMPROCW; +#[inline] +pub fn IS_INTRESOURCE(r: ULONG_PTR) -> bool { + (r >> 16) == 0 +} +#[inline] +pub fn MAKEINTRESOURCEA(i: WORD) -> LPSTR { + i as ULONG_PTR as LPSTR +} +#[inline] +pub fn MAKEINTRESOURCEW(i: WORD) -> LPWSTR { + i as ULONG_PTR as LPWSTR +} +pub const RT_CURSOR: LPWSTR = MAKEINTRESOURCE!(1); +pub const RT_BITMAP: LPWSTR = MAKEINTRESOURCE!(2); +pub const RT_ICON: LPWSTR = MAKEINTRESOURCE!(3); +pub const RT_MENU: LPWSTR = MAKEINTRESOURCE!(4); +pub const RT_DIALOG: LPWSTR = MAKEINTRESOURCE!(5); +pub const RT_STRING: LPWSTR = MAKEINTRESOURCE!(6); +pub const RT_FONTDIR: LPWSTR = MAKEINTRESOURCE!(7); +pub const RT_FONT: LPWSTR = MAKEINTRESOURCE!(8); +pub const RT_ACCELERATOR: LPWSTR = MAKEINTRESOURCE!(9); +pub const RT_RCDATA: LPWSTR = MAKEINTRESOURCE!(10); +pub const RT_MESSAGETABLE: LPWSTR = MAKEINTRESOURCE!(11); +pub const DIFFERENCE: WORD = 11; +pub const RT_GROUP_CURSOR: LPWSTR = MAKEINTRESOURCE!(1 + DIFFERENCE); +pub const RT_GROUP_ICON: LPWSTR = MAKEINTRESOURCE!(3 + DIFFERENCE); +pub const RT_VERSION: LPWSTR = MAKEINTRESOURCE!(16); +pub const RT_DLGINCLUDE: LPWSTR = MAKEINTRESOURCE!(17); +pub const RT_PLUGPLAY: LPWSTR = MAKEINTRESOURCE!(19); +pub const RT_VXD: LPWSTR = MAKEINTRESOURCE!(20); +pub const RT_ANICURSOR: LPWSTR = MAKEINTRESOURCE!(21); +pub const RT_ANIICON: LPWSTR = MAKEINTRESOURCE!(22); +pub const RT_HTML: LPWSTR = MAKEINTRESOURCE!(23); +pub const RT_MANIFEST: LPWSTR = MAKEINTRESOURCE!(24); +pub const CREATEPROCESS_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(1); +pub const ISOLATIONAWARE_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(2); +pub const ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID: LPWSTR + = MAKEINTRESOURCE!(3); +pub const MINIMUM_RESERVED_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(1); +pub const MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID: LPWSTR = MAKEINTRESOURCE!(16); +extern "system" { + pub fn wvsprintfA( + _: LPSTR, + _: LPCSTR, + arglist: va_list, + ) -> c_int; + pub fn wvsprintfW( + _: LPWSTR, + _: LPCWSTR, + arglist: va_list, + ) -> c_int; +} +extern "C" { + pub fn wsprintfA( + _: LPSTR, + _: LPCSTR, + ... + ) -> c_int; + pub fn wsprintfW( + _: LPWSTR, + _: LPCWSTR, + ... + ) -> c_int; +} +pub const SETWALLPAPER_DEFAULT: LPWSTR = -1isize as LPWSTR; +pub const SB_HORZ: UINT = 0; +pub const SB_VERT: UINT = 1; +pub const SB_CTL: UINT = 2; +pub const SB_BOTH: UINT = 3; +pub const SB_LINEUP: LPARAM = 0; +pub const SB_LINELEFT: LPARAM = 0; +pub const SB_LINEDOWN: LPARAM = 1; +pub const SB_LINERIGHT: LPARAM = 1; +pub const SB_PAGEUP: LPARAM = 2; +pub const SB_PAGELEFT: LPARAM = 2; +pub const SB_PAGEDOWN: LPARAM = 3; +pub const SB_PAGERIGHT: LPARAM = 3; +pub const SB_THUMBPOSITION: LPARAM = 4; +pub const SB_THUMBTRACK: LPARAM = 5; +pub const SB_TOP: LPARAM = 6; +pub const SB_LEFT: LPARAM = 6; +pub const SB_BOTTOM: LPARAM = 7; +pub const SB_RIGHT: LPARAM = 7; +pub const SB_ENDSCROLL: LPARAM = 8; +pub const SW_HIDE: c_int = 0; +pub const SW_SHOWNORMAL: c_int = 1; +pub const SW_NORMAL: c_int = 1; +pub const SW_SHOWMINIMIZED: c_int = 2; +pub const SW_SHOWMAXIMIZED: c_int = 3; +pub const SW_MAXIMIZE: c_int = 3; +pub const SW_SHOWNOACTIVATE: c_int = 4; +pub const SW_SHOW: c_int = 5; +pub const SW_MINIMIZE: c_int = 6; +pub const SW_SHOWMINNOACTIVE: c_int = 7; +pub const SW_SHOWNA: c_int = 8; +pub const SW_RESTORE: c_int = 9; +pub const SW_SHOWDEFAULT: c_int = 10; +pub const SW_FORCEMINIMIZE: c_int = 11; +pub const SW_MAX: c_int = 11; +pub const HIDE_WINDOW: c_int = 0; +pub const SHOW_OPENWINDOW: c_int = 1; +pub const SHOW_ICONWINDOW: c_int = 2; +pub const SHOW_FULLSCREEN: c_int = 3; +pub const SHOW_OPENNOACTIVATE: c_int = 4; +pub const SW_PARENTCLOSING: LPARAM = 1; +pub const SW_OTHERZOOM: LPARAM = 2; +pub const SW_PARENTOPENING: LPARAM = 3; +pub const SW_OTHERUNZOOM: LPARAM = 4; +pub const AW_HOR_POSITIVE: DWORD = 0x00000001; +pub const AW_HOR_NEGATIVE: DWORD = 0x00000002; +pub const AW_VER_POSITIVE: DWORD = 0x00000004; +pub const AW_VER_NEGATIVE: DWORD = 0x00000008; +pub const AW_CENTER: DWORD = 0x00000010; +pub const AW_HIDE: DWORD = 0x00010000; +pub const AW_ACTIVATE: DWORD = 0x00020000; +pub const AW_SLIDE: DWORD = 0x00040000; +pub const AW_BLEND: DWORD = 0x00080000; +pub const KF_EXTENDED: WORD = 0x0100; +pub const KF_DLGMODE: WORD = 0x0800; +pub const KF_MENUMODE: WORD = 0x1000; +pub const KF_ALTDOWN: WORD = 0x2000; +pub const KF_REPEAT: WORD = 0x4000; +pub const KF_UP: WORD = 0x8000; +pub const VK_LBUTTON: c_int = 0x01; +pub const VK_RBUTTON: c_int = 0x02; +pub const VK_CANCEL: c_int = 0x03; +pub const VK_MBUTTON: c_int = 0x04; +pub const VK_XBUTTON1: c_int = 0x05; +pub const VK_XBUTTON2: c_int = 0x06; +pub const VK_BACK: c_int = 0x08; +pub const VK_TAB: c_int = 0x09; +pub const VK_CLEAR: c_int = 0x0C; +pub const VK_RETURN: c_int = 0x0D; +pub const VK_SHIFT: c_int = 0x10; +pub const VK_CONTROL: c_int = 0x11; +pub const VK_MENU: c_int = 0x12; +pub const VK_PAUSE: c_int = 0x13; +pub const VK_CAPITAL: c_int = 0x14; +pub const VK_KANA: c_int = 0x15; +pub const VK_HANGEUL: c_int = 0x15; +pub const VK_HANGUL: c_int = 0x15; +pub const VK_JUNJA: c_int = 0x17; +pub const VK_FINAL: c_int = 0x18; +pub const VK_HANJA: c_int = 0x19; +pub const VK_KANJI: c_int = 0x19; +pub const VK_ESCAPE: c_int = 0x1B; +pub const VK_CONVERT: c_int = 0x1C; +pub const VK_NONCONVERT: c_int = 0x1D; +pub const VK_ACCEPT: c_int = 0x1E; +pub const VK_MODECHANGE: c_int = 0x1F; +pub const VK_SPACE: c_int = 0x20; +pub const VK_PRIOR: c_int = 0x21; +pub const VK_NEXT: c_int = 0x22; +pub const VK_END: c_int = 0x23; +pub const VK_HOME: c_int = 0x24; +pub const VK_LEFT: c_int = 0x25; +pub const VK_UP: c_int = 0x26; +pub const VK_RIGHT: c_int = 0x27; +pub const VK_DOWN: c_int = 0x28; +pub const VK_SELECT: c_int = 0x29; +pub const VK_PRINT: c_int = 0x2A; +pub const VK_EXECUTE: c_int = 0x2B; +pub const VK_SNAPSHOT: c_int = 0x2C; +pub const VK_INSERT: c_int = 0x2D; +pub const VK_DELETE: c_int = 0x2E; +pub const VK_HELP: c_int = 0x2F; +pub const VK_LWIN: c_int = 0x5B; +pub const VK_RWIN: c_int = 0x5C; +pub const VK_APPS: c_int = 0x5D; +pub const VK_SLEEP: c_int = 0x5F; +pub const VK_NUMPAD0: c_int = 0x60; +pub const VK_NUMPAD1: c_int = 0x61; +pub const VK_NUMPAD2: c_int = 0x62; +pub const VK_NUMPAD3: c_int = 0x63; +pub const VK_NUMPAD4: c_int = 0x64; +pub const VK_NUMPAD5: c_int = 0x65; +pub const VK_NUMPAD6: c_int = 0x66; +pub const VK_NUMPAD7: c_int = 0x67; +pub const VK_NUMPAD8: c_int = 0x68; +pub const VK_NUMPAD9: c_int = 0x69; +pub const VK_MULTIPLY: c_int = 0x6A; +pub const VK_ADD: c_int = 0x6B; +pub const VK_SEPARATOR: c_int = 0x6C; +pub const VK_SUBTRACT: c_int = 0x6D; +pub const VK_DECIMAL: c_int = 0x6E; +pub const VK_DIVIDE: c_int = 0x6F; +pub const VK_F1: c_int = 0x70; +pub const VK_F2: c_int = 0x71; +pub const VK_F3: c_int = 0x72; +pub const VK_F4: c_int = 0x73; +pub const VK_F5: c_int = 0x74; +pub const VK_F6: c_int = 0x75; +pub const VK_F7: c_int = 0x76; +pub const VK_F8: c_int = 0x77; +pub const VK_F9: c_int = 0x78; +pub const VK_F10: c_int = 0x79; +pub const VK_F11: c_int = 0x7A; +pub const VK_F12: c_int = 0x7B; +pub const VK_F13: c_int = 0x7C; +pub const VK_F14: c_int = 0x7D; +pub const VK_F15: c_int = 0x7E; +pub const VK_F16: c_int = 0x7F; +pub const VK_F17: c_int = 0x80; +pub const VK_F18: c_int = 0x81; +pub const VK_F19: c_int = 0x82; +pub const VK_F20: c_int = 0x83; +pub const VK_F21: c_int = 0x84; +pub const VK_F22: c_int = 0x85; +pub const VK_F23: c_int = 0x86; +pub const VK_F24: c_int = 0x87; +pub const VK_NAVIGATION_VIEW: c_int = 0x88; +pub const VK_NAVIGATION_MENU: c_int = 0x89; +pub const VK_NAVIGATION_UP: c_int = 0x8A; +pub const VK_NAVIGATION_DOWN: c_int = 0x8B; +pub const VK_NAVIGATION_LEFT: c_int = 0x8C; +pub const VK_NAVIGATION_RIGHT: c_int = 0x8D; +pub const VK_NAVIGATION_ACCEPT: c_int = 0x8E; +pub const VK_NAVIGATION_CANCEL: c_int = 0x8F; +pub const VK_NUMLOCK: c_int = 0x90; +pub const VK_SCROLL: c_int = 0x91; +pub const VK_OEM_NEC_EQUAL: c_int = 0x92; +pub const VK_OEM_FJ_JISHO: c_int = 0x92; +pub const VK_OEM_FJ_MASSHOU: c_int = 0x93; +pub const VK_OEM_FJ_TOUROKU: c_int = 0x94; +pub const VK_OEM_FJ_LOYA: c_int = 0x95; +pub const VK_OEM_FJ_ROYA: c_int = 0x96; +pub const VK_LSHIFT: c_int = 0xA0; +pub const VK_RSHIFT: c_int = 0xA1; +pub const VK_LCONTROL: c_int = 0xA2; +pub const VK_RCONTROL: c_int = 0xA3; +pub const VK_LMENU: c_int = 0xA4; +pub const VK_RMENU: c_int = 0xA5; +pub const VK_BROWSER_BACK: c_int = 0xA6; +pub const VK_BROWSER_FORWARD: c_int = 0xA7; +pub const VK_BROWSER_REFRESH: c_int = 0xA8; +pub const VK_BROWSER_STOP: c_int = 0xA9; +pub const VK_BROWSER_SEARCH: c_int = 0xAA; +pub const VK_BROWSER_FAVORITES: c_int = 0xAB; +pub const VK_BROWSER_HOME: c_int = 0xAC; +pub const VK_VOLUME_MUTE: c_int = 0xAD; +pub const VK_VOLUME_DOWN: c_int = 0xAE; +pub const VK_VOLUME_UP: c_int = 0xAF; +pub const VK_MEDIA_NEXT_TRACK: c_int = 0xB0; +pub const VK_MEDIA_PREV_TRACK: c_int = 0xB1; +pub const VK_MEDIA_STOP: c_int = 0xB2; +pub const VK_MEDIA_PLAY_PAUSE: c_int = 0xB3; +pub const VK_LAUNCH_MAIL: c_int = 0xB4; +pub const VK_LAUNCH_MEDIA_SELECT: c_int = 0xB5; +pub const VK_LAUNCH_APP1: c_int = 0xB6; +pub const VK_LAUNCH_APP2: c_int = 0xB7; +pub const VK_OEM_1: c_int = 0xBA; +pub const VK_OEM_PLUS: c_int = 0xBB; +pub const VK_OEM_COMMA: c_int = 0xBC; +pub const VK_OEM_MINUS: c_int = 0xBD; +pub const VK_OEM_PERIOD: c_int = 0xBE; +pub const VK_OEM_2: c_int = 0xBF; +pub const VK_OEM_3: c_int = 0xC0; +pub const VK_GAMEPAD_A: c_int = 0xC3; +pub const VK_GAMEPAD_B: c_int = 0xC4; +pub const VK_GAMEPAD_X: c_int = 0xC5; +pub const VK_GAMEPAD_Y: c_int = 0xC6; +pub const VK_GAMEPAD_RIGHT_SHOULDER: c_int = 0xC7; +pub const VK_GAMEPAD_LEFT_SHOULDER: c_int = 0xC8; +pub const VK_GAMEPAD_LEFT_TRIGGER: c_int = 0xC9; +pub const VK_GAMEPAD_RIGHT_TRIGGER: c_int = 0xCA; +pub const VK_GAMEPAD_DPAD_UP: c_int = 0xCB; +pub const VK_GAMEPAD_DPAD_DOWN: c_int = 0xCC; +pub const VK_GAMEPAD_DPAD_LEFT: c_int = 0xCD; +pub const VK_GAMEPAD_DPAD_RIGHT: c_int = 0xCE; +pub const VK_GAMEPAD_MENU: c_int = 0xCF; +pub const VK_GAMEPAD_VIEW: c_int = 0xD0; +pub const VK_GAMEPAD_LEFT_THUMBSTICK_BUTTON: c_int = 0xD1; +pub const VK_GAMEPAD_RIGHT_THUMBSTICK_BUTTON: c_int = 0xD2; +pub const VK_GAMEPAD_LEFT_THUMBSTICK_UP: c_int = 0xD3; +pub const VK_GAMEPAD_LEFT_THUMBSTICK_DOWN: c_int = 0xD4; +pub const VK_GAMEPAD_LEFT_THUMBSTICK_RIGHT: c_int = 0xD5; +pub const VK_GAMEPAD_LEFT_THUMBSTICK_LEFT: c_int = 0xD6; +pub const VK_GAMEPAD_RIGHT_THUMBSTICK_UP: c_int = 0xD7; +pub const VK_GAMEPAD_RIGHT_THUMBSTICK_DOWN: c_int = 0xD8; +pub const VK_GAMEPAD_RIGHT_THUMBSTICK_RIGHT: c_int = 0xD9; +pub const VK_GAMEPAD_RIGHT_THUMBSTICK_LEFT: c_int = 0xDA; +pub const VK_OEM_4: c_int = 0xDB; +pub const VK_OEM_5: c_int = 0xDC; +pub const VK_OEM_6: c_int = 0xDD; +pub const VK_OEM_7: c_int = 0xDE; +pub const VK_OEM_8: c_int = 0xDF; +pub const VK_OEM_AX: c_int = 0xE1; +pub const VK_OEM_102: c_int = 0xE2; +pub const VK_ICO_HELP: c_int = 0xE3; +pub const VK_ICO_00: c_int = 0xE4; +pub const VK_PROCESSKEY: c_int = 0xE5; +pub const VK_ICO_CLEAR: c_int = 0xE6; +pub const VK_PACKET: c_int = 0xE7; +pub const VK_OEM_RESET: c_int = 0xE9; +pub const VK_OEM_JUMP: c_int = 0xEA; +pub const VK_OEM_PA1: c_int = 0xEB; +pub const VK_OEM_PA2: c_int = 0xEC; +pub const VK_OEM_PA3: c_int = 0xED; +pub const VK_OEM_WSCTRL: c_int = 0xEE; +pub const VK_OEM_CUSEL: c_int = 0xEF; +pub const VK_OEM_ATTN: c_int = 0xF0; +pub const VK_OEM_FINISH: c_int = 0xF1; +pub const VK_OEM_COPY: c_int = 0xF2; +pub const VK_OEM_AUTO: c_int = 0xF3; +pub const VK_OEM_ENLW: c_int = 0xF4; +pub const VK_OEM_BACKTAB: c_int = 0xF5; +pub const VK_ATTN: c_int = 0xF6; +pub const VK_CRSEL: c_int = 0xF7; +pub const VK_EXSEL: c_int = 0xF8; +pub const VK_EREOF: c_int = 0xF9; +pub const VK_PLAY: c_int = 0xFA; +pub const VK_ZOOM: c_int = 0xFB; +pub const VK_NONAME: c_int = 0xFC; +pub const VK_PA1: c_int = 0xFD; +pub const VK_OEM_CLEAR: c_int = 0xFE; +pub const WH_MIN: c_int = -1; +pub const WH_MSGFILTER: c_int = -1; +pub const WH_JOURNALRECORD: c_int = 0; +pub const WH_JOURNALPLAYBACK: c_int = 1; +pub const WH_KEYBOARD: c_int = 2; +pub const WH_GETMESSAGE: c_int = 3; +pub const WH_CALLWNDPROC: c_int = 4; +pub const WH_CBT: c_int = 5; +pub const WH_SYSMSGFILTER: c_int = 6; +pub const WH_MOUSE: c_int = 7; +pub const WH_HARDWARE: c_int = 8; +pub const WH_DEBUG: c_int = 9; +pub const WH_SHELL: c_int = 10; +pub const WH_FOREGROUNDIDLE: c_int = 11; +pub const WH_CALLWNDPROCRET: c_int = 12; +pub const WH_KEYBOARD_LL: c_int = 13; +pub const WH_MOUSE_LL: c_int = 14; +pub const WH_MAX: c_int = 14; +pub const WH_MINHOOK: c_int = WH_MIN; +pub const WH_MAXHOOK: c_int = WH_MAX; +pub const HC_ACTION: c_int = 0; +pub const HC_GETNEXT: c_int = 1; +pub const HC_SKIP: c_int = 2; +pub const HC_NOREMOVE: c_int = 3; +pub const HC_NOREM: c_int = HC_NOREMOVE; +pub const HC_SYSMODALON: c_int = 4; +pub const HC_SYSMODALOFF: c_int = 5; +pub const HCBT_MOVESIZE: c_int = 0; +pub const HCBT_MINMAX: c_int = 1; +pub const HCBT_QS: c_int = 2; +pub const HCBT_CREATEWND: c_int = 3; +pub const HCBT_DESTROYWND: c_int = 4; +pub const HCBT_ACTIVATE: c_int = 5; +pub const HCBT_CLICKSKIPPED: c_int = 6; +pub const HCBT_KEYSKIPPED: c_int = 7; +pub const HCBT_SYSCOMMAND: c_int = 8; +pub const HCBT_SETFOCUS: c_int = 9; +STRUCT!{struct CBT_CREATEWNDA { + lpcs: *mut CREATESTRUCTA, + hwndInsertAfter: HWND, +}} +pub type LPCBT_CREATEWNDA = *mut CBT_CREATEWNDA; +STRUCT!{struct CBT_CREATEWNDW { + lpcs: *mut CREATESTRUCTW, + hwndInsertAfter: HWND, +}} +pub type LPCBT_CREATEWNDW = *mut CBT_CREATEWNDW; +STRUCT!{struct CBTACTIVATESTRUCT { + fMouse: BOOL, + hWndActive: HWND, +}} +pub type LPCBTACTIVATESTRUCT = *mut CBTACTIVATESTRUCT; +STRUCT!{struct WTSSESSION_NOTIFICATION { + cbSize: DWORD, + dwSessionId: DWORD, +}} +pub type PWTSSESSION_NOTIFICATION = *mut WTSSESSION_NOTIFICATION; +pub const WTS_CONSOLE_CONNECT: WPARAM = 0x1; +pub const WTS_CONSOLE_DISCONNECT: WPARAM = 0x2; +pub const WTS_REMOTE_CONNECT: WPARAM = 0x3; +pub const WTS_REMOTE_DISCONNECT: WPARAM = 0x4; +pub const WTS_SESSION_LOGON: WPARAM = 0x5; +pub const WTS_SESSION_LOGOFF: WPARAM = 0x6; +pub const WTS_SESSION_LOCK: WPARAM = 0x7; +pub const WTS_SESSION_UNLOCK: WPARAM = 0x8; +pub const WTS_SESSION_REMOTE_CONTROL: WPARAM = 0x9; +pub const WTS_SESSION_CREATE: WPARAM = 0xa; +pub const WTS_SESSION_TERMINATE: WPARAM = 0xb; +pub const MSGF_DIALOGBOX: c_int = 0; +pub const MSGF_MESSAGEBOX: c_int = 1; +pub const MSGF_MENU: c_int = 2; +pub const MSGF_SCROLLBAR: c_int = 5; +pub const MSGF_NEXTWINDOW: c_int = 6; +pub const MSGF_MAX: c_int = 8; +pub const MSGF_USER: c_int = 4096; +pub const HSHELL_WINDOWCREATED: c_int = 1; +pub const HSHELL_WINDOWDESTROYED: c_int = 2; +pub const HSHELL_ACTIVATESHELLWINDOW: c_int = 3; +pub const HSHELL_WINDOWACTIVATED: c_int = 4; +pub const HSHELL_GETMINRECT: c_int = 5; +pub const HSHELL_REDRAW: c_int = 6; +pub const HSHELL_TASKMAN: c_int = 7; +pub const HSHELL_LANGUAGE: c_int = 8; +pub const HSHELL_SYSMENU: c_int = 9; +pub const HSHELL_ENDTASK: c_int = 10; +pub const HSHELL_ACCESSIBILITYSTATE: c_int = 11; +pub const HSHELL_APPCOMMAND: c_int = 12; +pub const HSHELL_WINDOWREPLACED: c_int = 13; +pub const HSHELL_WINDOWREPLACING: c_int = 14; +pub const HSHELL_MONITORCHANGED: c_int = 16; +pub const HSHELL_HIGHBIT: c_int = 0x8000; +pub const HSHELL_FLASH: c_int = HSHELL_REDRAW | HSHELL_HIGHBIT; +pub const HSHELL_RUDEAPPACTIVATED: c_int = HSHELL_WINDOWACTIVATED | HSHELL_HIGHBIT; +pub const APPCOMMAND_BROWSER_BACKWARD: c_short = 1; +pub const APPCOMMAND_BROWSER_FORWARD: c_short = 2; +pub const APPCOMMAND_BROWSER_REFRESH: c_short = 3; +pub const APPCOMMAND_BROWSER_STOP: c_short = 4; +pub const APPCOMMAND_BROWSER_SEARCH: c_short = 5; +pub const APPCOMMAND_BROWSER_FAVORITES: c_short = 6; +pub const APPCOMMAND_BROWSER_HOME: c_short = 7; +pub const APPCOMMAND_VOLUME_MUTE: c_short = 8; +pub const APPCOMMAND_VOLUME_DOWN: c_short = 9; +pub const APPCOMMAND_VOLUME_UP: c_short = 10; +pub const APPCOMMAND_MEDIA_NEXTTRACK: c_short = 11; +pub const APPCOMMAND_MEDIA_PREVIOUSTRACK: c_short = 12; +pub const APPCOMMAND_MEDIA_STOP: c_short = 13; +pub const APPCOMMAND_MEDIA_PLAY_PAUSE: c_short = 14; +pub const APPCOMMAND_LAUNCH_MAIL: c_short = 15; +pub const APPCOMMAND_LAUNCH_MEDIA_SELECT: c_short = 16; +pub const APPCOMMAND_LAUNCH_APP1: c_short = 17; +pub const APPCOMMAND_LAUNCH_APP2: c_short = 18; +pub const APPCOMMAND_BASS_DOWN: c_short = 19; +pub const APPCOMMAND_BASS_BOOST: c_short = 20; +pub const APPCOMMAND_BASS_UP: c_short = 21; +pub const APPCOMMAND_TREBLE_DOWN: c_short = 22; +pub const APPCOMMAND_TREBLE_UP: c_short = 23; +pub const APPCOMMAND_MICROPHONE_VOLUME_MUTE: c_short = 24; +pub const APPCOMMAND_MICROPHONE_VOLUME_DOWN: c_short = 25; +pub const APPCOMMAND_MICROPHONE_VOLUME_UP: c_short = 26; +pub const APPCOMMAND_HELP: c_short = 27; +pub const APPCOMMAND_FIND: c_short = 28; +pub const APPCOMMAND_NEW: c_short = 29; +pub const APPCOMMAND_OPEN: c_short = 30; +pub const APPCOMMAND_CLOSE: c_short = 31; +pub const APPCOMMAND_SAVE: c_short = 32; +pub const APPCOMMAND_PRINT: c_short = 33; +pub const APPCOMMAND_UNDO: c_short = 34; +pub const APPCOMMAND_REDO: c_short = 35; +pub const APPCOMMAND_COPY: c_short = 36; +pub const APPCOMMAND_CUT: c_short = 37; +pub const APPCOMMAND_PASTE: c_short = 38; +pub const APPCOMMAND_REPLY_TO_MAIL: c_short = 39; +pub const APPCOMMAND_FORWARD_MAIL: c_short = 40; +pub const APPCOMMAND_SEND_MAIL: c_short = 41; +pub const APPCOMMAND_SPELL_CHECK: c_short = 42; +pub const APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE: c_short = 43; +pub const APPCOMMAND_MIC_ON_OFF_TOGGLE: c_short = 44; +pub const APPCOMMAND_CORRECTION_LIST: c_short = 45; +pub const APPCOMMAND_MEDIA_PLAY: c_short = 46; +pub const APPCOMMAND_MEDIA_PAUSE: c_short = 47; +pub const APPCOMMAND_MEDIA_RECORD: c_short = 48; +pub const APPCOMMAND_MEDIA_FAST_FORWARD: c_short = 49; +pub const APPCOMMAND_MEDIA_REWIND: c_short = 50; +pub const APPCOMMAND_MEDIA_CHANNEL_UP: c_short = 51; +pub const APPCOMMAND_MEDIA_CHANNEL_DOWN: c_short = 52; +pub const APPCOMMAND_DELETE: c_short = 53; +pub const APPCOMMAND_DWM_FLIP3D: c_short = 54; +pub const FAPPCOMMAND_MOUSE: WORD = 0x8000; +pub const FAPPCOMMAND_KEY: WORD = 0; +pub const FAPPCOMMAND_OEM: WORD = 0x1000; +pub const FAPPCOMMAND_MASK: WORD = 0xF000; +#[inline] +pub fn GET_APPCOMMAND_LPARAM(lParam: LPARAM) -> c_short { + (HIWORD(lParam as DWORD) & !FAPPCOMMAND_MASK) as c_short +} +#[inline] +pub fn GET_DEVICE_LPARAM(lParam: LPARAM) -> WORD { + HIWORD(lParam as DWORD) & FAPPCOMMAND_MASK +} +pub use self::GET_DEVICE_LPARAM as GET_MOUSEORKEY_LPARAM; +pub use shared::minwindef::LOWORD as GET_FLAGS_LPARAM; +pub use self::GET_FLAGS_LPARAM as GET_KEYSTATE_LPARAM; +STRUCT!{struct SHELLHOOKINFO { + hwnd: HWND, + rc: RECT, +}} +pub type LPSHELLHOOKINFO = *mut SHELLHOOKINFO; +STRUCT!{struct EVENTMSG { + message: UINT, + paramL: UINT, + paramH: UINT, + time: DWORD, + hwnd: HWND, +}} +pub type PEVENTMSGMSG = *mut EVENTMSG; +pub type NPEVENTMSGMSG = *mut EVENTMSG; +pub type LPEVENTMSGMSG = *mut EVENTMSG; +pub type PEVENTMSG = *mut EVENTMSG; +pub type NPEVENTMSG = *mut EVENTMSG; +pub type LPEVENTMSG = *mut EVENTMSG; +STRUCT!{struct CWPSTRUCT { + lParam: LPARAM, + wParam: WPARAM, + message: UINT, + hwnd: HWND, +}} +pub type PCWPSTRUCT = *mut CWPSTRUCT; +pub type NPCWPSTRUCT = *mut CWPSTRUCT; +pub type LPCWPSTRUCT = *mut CWPSTRUCT; +STRUCT!{struct CWPRETSTRUCT { + lResult: LRESULT, + lParam: LPARAM, + wParam: WPARAM, + message: UINT, + hwnd: HWND, +}} +pub type PCWPRETSTRUCT = *mut CWPRETSTRUCT; +pub type NPCWPRETSTRUCT = *mut CWPRETSTRUCT; +pub type LPCWPRETSTRUCT = *mut CWPRETSTRUCT; +pub const LLKHF_EXTENDED: DWORD = (KF_EXTENDED >> 8) as u32; +pub const LLKHF_INJECTED: DWORD = 0x00000010; +pub const LLKHF_ALTDOWN: DWORD = (KF_ALTDOWN >> 8) as u32; +pub const LLKHF_UP: DWORD = (KF_UP >> 8) as u32; +pub const LLKHF_LOWER_IL_INJECTED: DWORD = 0x00000002; +pub const LLMHF_INJECTED: DWORD = 0x00000001; +pub const LLMHF_LOWER_IL_INJECTED: DWORD = 0x00000002; +STRUCT!{struct KBDLLHOOKSTRUCT { + vkCode: DWORD, + scanCode: DWORD, + flags: DWORD, + time: DWORD, + dwExtraInfo: ULONG_PTR, +}} +pub type LPKBDLLHOOKSTRUCT = *mut KBDLLHOOKSTRUCT; +pub type PKBDLLHOOKSTRUCT = *mut KBDLLHOOKSTRUCT; +STRUCT!{struct MSLLHOOKSTRUCT { + pt: POINT, + mouseData: DWORD, + flags: DWORD, + time: DWORD, + dwExtraInfo: ULONG_PTR, +}} +pub type LPMSLLHOOKSTRUCT = *mut MSLLHOOKSTRUCT; +pub type PMSLLHOOKSTRUCT = *mut MSLLHOOKSTRUCT; +STRUCT!{struct DEBUGHOOKINFO { + idThread: DWORD, + idThreadInstaller: DWORD, + lParam: LPARAM, + wParam: WPARAM, + code: c_int, +}} +pub type PDEBUGHOOKINFO = *mut DEBUGHOOKINFO; +pub type NPDEBUGHOOKINFO = *mut DEBUGHOOKINFO; +pub type LPDEBUGHOOKINFO = *mut DEBUGHOOKINFO; +STRUCT!{struct MOUSEHOOKSTRUCT { + pt: POINT, + hwnd: HWND, + wHitTestCode: UINT, + dwExtraInfo: ULONG_PTR, +}} +pub type LPMOUSEHOOKSTRUCT = *mut MOUSEHOOKSTRUCT; +pub type PMOUSEHOOKSTRUCT = *mut MOUSEHOOKSTRUCT; +STRUCT!{struct MOUSEHOOKSTRUCTEX { + parent: MOUSEHOOKSTRUCT, + mouseData: DWORD, +}} +pub type LPMOUSEHOOKSTRUCTEX = *mut MOUSEHOOKSTRUCTEX; +pub type PMOUSEHOOKSTRUCTEX = *mut MOUSEHOOKSTRUCTEX; +STRUCT!{struct HARDWAREHOOKSTRUCT { + hwnd: HWND, + message: UINT, + wParam: WPARAM, + lParam: LPARAM, +}} +pub type LPHARDWAREHOOKSTRUCT = *mut HARDWAREHOOKSTRUCT; +pub type PHARDWAREHOOKSTRUCT = *mut HARDWAREHOOKSTRUCT; +pub const HKL_PREV: HKL = 0 as HKL; +pub const HKL_NEXT: HKL = 1 as HKL; +pub const KLF_ACTIVATE: UINT = 0x00000001; +pub const KLF_SUBSTITUTE_OK: UINT = 0x00000002; +pub const KLF_REORDER: UINT = 0x00000008; +pub const KLF_REPLACELANG: UINT = 0x00000010; +pub const KLF_NOTELLSHELL: UINT = 0x00000080; +pub const KLF_SETFORPROCESS: UINT = 0x00000100; +pub const KLF_SHIFTLOCK: UINT = 0x00010000; +pub const KLF_RESET: UINT = 0x40000000; +pub const INPUTLANGCHANGE_SYSCHARSET: WPARAM = 0x0001; +pub const INPUTLANGCHANGE_FORWARD: WPARAM = 0x0002; +pub const INPUTLANGCHANGE_BACKWARD: WPARAM = 0x0004; +pub const KL_NAMELENGTH: usize = 9; +extern "system" { + pub fn LoadKeyboardLayoutA( + pwszKLID: LPCSTR, + Flags: DWORD, + ) -> HKL; + pub fn LoadKeyboardLayoutW( + pwszKLID: LPCWSTR, + Flags: DWORD, + ) -> HKL; + pub fn ActivateKeyboardLayout( + hkl: HKL, + Flags: UINT, + ) -> HKL; + pub fn ToUnicodeEx( + wVirtKey: UINT, + wScanCode: UINT, + lpKeyState: *const BYTE, + pwszBuff: LPWSTR, + cchBuff: c_int, + wFlags: UINT, + dwhkl: HKL, + ) -> c_int; + pub fn UnloadKeyboardLayout( + hkl: HKL, + ) -> BOOL; + pub fn GetKeyboardLayoutNameA( + pwszKLID: LPSTR, + ) -> BOOL; + pub fn GetKeyboardLayoutNameW( + pwszKLID: LPWSTR, + ) -> BOOL; + pub fn GetKeyboardLayoutList( + nBuff: c_int, + lpList: *mut HKL, + ) -> c_int; + pub fn GetKeyboardLayout( + idThread: DWORD, + ) -> HKL; +} +STRUCT!{struct MOUSEMOVEPOINT { + x: c_int, + y: c_int, + time: DWORD, + dwExtraInfo: ULONG_PTR, +}} +pub type PMOUSEMOVEPOINT = *mut MOUSEMOVEPOINT; +pub type LPMOUSEMOVEPOINT = *mut MOUSEMOVEPOINT; +pub const GMMP_USE_DISPLAY_POINTS: DWORD = 1; +pub const GMMP_USE_HIGH_RESOLUTION_POINTS: DWORD = 2; +extern "system" { + pub fn GetMouseMovePointsEx( + cbSize: UINT, + lppt: LPMOUSEMOVEPOINT, + lpptBuf: LPMOUSEMOVEPOINT, + nBufPoints: c_int, + resolution: DWORD, + ) -> c_int; +} +pub const DESKTOP_READOBJECTS: DWORD = 0x0001; +pub const DESKTOP_CREATEWINDOW: DWORD = 0x0002; +pub const DESKTOP_CREATEMENU: DWORD = 0x0004; +pub const DESKTOP_HOOKCONTROL: DWORD = 0x0008; +pub const DESKTOP_JOURNALRECORD: DWORD = 0x0010; +pub const DESKTOP_JOURNALPLAYBACK: DWORD = 0x0020; +pub const DESKTOP_ENUMERATE: DWORD = 0x0040; +pub const DESKTOP_WRITEOBJECTS: DWORD = 0x0080; +pub const DESKTOP_SWITCHDESKTOP: DWORD = 0x0100; +pub const DF_ALLOWOTHERACCOUNTHOOK: DWORD = 0x0001; +extern "system" { + pub fn CreateDesktopA( + lpszDesktop: LPCSTR, + lpszDevice: LPCSTR, + pDevmode: *mut DEVMODEA, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ) -> HDESK; + pub fn CreateDesktopW( + lpszDesktop: LPCWSTR, + lpszDevice: LPCWSTR, + pDevmode: *mut DEVMODEW, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ) -> HDESK; + pub fn CreateDesktopExA( + lpszDesktop: LPCSTR, + lpszDevice: LPCSTR, + pDevmode: *mut DEVMODEA, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ulHeapSize: ULONG, + pvoid: PVOID, + ) -> HDESK; + pub fn CreateDesktopExW( + lpszDesktop: LPCWSTR, + lpszDevice: LPCWSTR, + pDevmode: *mut DEVMODEW, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ulHeapSize: ULONG, + pvoid: PVOID, + ) -> HDESK; + pub fn OpenDesktopA( + lpszDesktop: LPCSTR, + dwFlags: DWORD, + fInherit: BOOL, + dwDesiredAccess: ACCESS_MASK, + ) -> HDESK; + pub fn OpenDesktopW( + lpszDesktop: LPCWSTR, + dwFlags: DWORD, + fInherit: BOOL, + dwDesiredAccess: ACCESS_MASK, + ) -> HDESK; + pub fn OpenInputDesktop( + dwFlags: DWORD, + fInherit: BOOL, + dwDesiredAccess: ACCESS_MASK, + ) -> HDESK; + pub fn EnumDesktopsA( + hwinsta: HWINSTA, + lpEnumFunc: DESKTOPENUMPROCA, + lParam: LPARAM, + ) -> BOOL; + pub fn EnumDesktopsW( + hwinsta: HWINSTA, + lpEnumFunc: DESKTOPENUMPROCW, + lParam: LPARAM, + ) -> BOOL; + pub fn EnumDesktopWindows( + hDesktop: HDESK, + lpfn: WNDENUMPROC, + lParam: LPARAM, + ) -> BOOL; + pub fn SwitchDesktop( + hDesktop: HDESK, + ) -> BOOL; + pub fn SetThreadDesktop( + hDesktop: HDESK, + ) -> BOOL; + pub fn CloseDesktop( + hDesktop: HDESK, + ) -> BOOL; + pub fn GetThreadDesktop( + dwThreadId: DWORD, + ) -> HDESK; +} +pub const WINSTA_ENUMDESKTOPS: DWORD = 0x0001; +pub const WINSTA_READATTRIBUTES: DWORD = 0x0002; +pub const WINSTA_ACCESSCLIPBOARD: DWORD = 0x0004; +pub const WINSTA_CREATEDESKTOP: DWORD = 0x0008; +pub const WINSTA_WRITEATTRIBUTES: DWORD = 0x0010; +pub const WINSTA_ACCESSGLOBALATOMS: DWORD = 0x0020; +pub const WINSTA_EXITWINDOWS: DWORD = 0x0040; +pub const WINSTA_ENUMERATE: DWORD = 0x0100; +pub const WINSTA_READSCREEN: DWORD = 0x0200; +pub const WINSTA_ALL_ACCESS: DWORD = WINSTA_ENUMDESKTOPS | WINSTA_READATTRIBUTES + | WINSTA_ACCESSCLIPBOARD | WINSTA_CREATEDESKTOP | WINSTA_WRITEATTRIBUTES + | WINSTA_ACCESSGLOBALATOMS | WINSTA_EXITWINDOWS | WINSTA_ENUMERATE | WINSTA_READSCREEN; +pub const CWF_CREATE_ONLY: DWORD = 0x00000001; +pub const WSF_VISIBLE: DWORD = 0x0001; +extern "system" { + pub fn CreateWindowStationA( + lpwinsta: LPCSTR, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ) -> HWINSTA; + pub fn CreateWindowStationW( + lpwinsta: LPCWSTR, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ) -> HWINSTA; + pub fn OpenWindowStationA( + lpszWinSta: LPCSTR, + fInherit: BOOL, + dwDesiredAccess: ACCESS_MASK, + ) -> HWINSTA; + pub fn OpenWindowStationW( + lpszWinSta: LPCWSTR, + fInherit: BOOL, + dwDesiredAccess: ACCESS_MASK, + ) -> HWINSTA; + pub fn EnumWindowStationsA( + lpEnumFunc: WINSTAENUMPROCA, + lParam: LPARAM, + ) -> BOOL; + pub fn EnumWindowStationsW( + lpEnumFunc: WINSTAENUMPROCW, + lParam: LPARAM, + ) -> BOOL; + pub fn CloseWindowStation( + hWinSta: HWINSTA, + ) -> BOOL; + pub fn SetProcessWindowStation( + hWinSta: HWINSTA, + ) -> BOOL; + pub fn GetProcessWindowStation() -> HWINSTA; + pub fn SetUserObjectSecurity( + hObj: HANDLE, + pSIRequested: PSECURITY_INFORMATION, + pSID: PSECURITY_DESCRIPTOR, + ) -> BOOL; + pub fn GetUserObjectSecurity( + hObj: HANDLE, + pSIRequested: PSECURITY_INFORMATION, + pSID: PSECURITY_DESCRIPTOR, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> BOOL; +} +pub const UOI_FLAGS: DWORD = 1; +pub const UOI_NAME: DWORD = 2; +pub const UOI_TYPE: DWORD = 3; +pub const UOI_USER_SID: DWORD = 4; +pub const UOI_HEAPSIZE: DWORD = 5; +pub const UOI_IO: DWORD = 6; +pub const UOI_TIMERPROC_EXCEPTION_SUPPRESSION: DWORD = 7; +STRUCT!{struct USEROBJECTFLAGS { + fInherit: BOOL, + fReserved: BOOL, + dwFlags: DWORD, +}} +pub type PUSEROBJECTFLAGS = *mut USEROBJECTFLAGS; +extern "system" { + pub fn GetUserObjectInformationA( + hObj: HANDLE, + nIndex: c_int, + pvInfo: PVOID, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> BOOL; + pub fn GetUserObjectInformationW( + hObj: HANDLE, + nIndex: c_int, + pvInfo: PVOID, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> BOOL; + pub fn SetUserObjectInformationA( + hObj: HANDLE, + nIndex: c_int, + pvInfo: PVOID, + nLength: DWORD, + ) -> BOOL; + pub fn SetUserObjectInformationW( + hObj: HANDLE, + nIndex: c_int, + pvInfo: PVOID, + nLength: DWORD, + ) -> BOOL; +} +STRUCT!{struct WNDCLASSEXA { + cbSize: UINT, + style: UINT, + lpfnWndProc: WNDPROC, + cbClsExtra: c_int, + cbWndExtra: c_int, + hInstance: HINSTANCE, + hIcon: HICON, + hCursor: HCURSOR, + hbrBackground: HBRUSH, + lpszMenuName: LPCSTR, + lpszClassName: LPCSTR, + hIconSm: HICON, +}} +pub type PWNDCLASSEXA = *mut WNDCLASSEXA; +pub type NPWNDCLASSEXA = *mut WNDCLASSEXA; +pub type LPWNDCLASSEXA = *mut WNDCLASSEXA; +STRUCT!{struct WNDCLASSEXW { + cbSize: UINT, + style: UINT, + lpfnWndProc: WNDPROC, + cbClsExtra: c_int, + cbWndExtra: c_int, + hInstance: HINSTANCE, + hIcon: HICON, + hCursor: HCURSOR, + hbrBackground: HBRUSH, + lpszMenuName: LPCWSTR, + lpszClassName: LPCWSTR, + hIconSm: HICON, +}} +pub type PWNDCLASSEXW = *mut WNDCLASSEXW; +pub type NPWNDCLASSEXW = *mut WNDCLASSEXW; +pub type LPWNDCLASSEXW = *mut WNDCLASSEXW; +STRUCT!{struct WNDCLASSA { + style: UINT, + lpfnWndProc: WNDPROC, + cbClsExtra: c_int, + cbWndExtra: c_int, + hInstance: HINSTANCE, + hIcon: HICON, + hCursor: HCURSOR, + hbrBackground: HBRUSH, + lpszMenuName: LPCSTR, + lpszClassName: LPCSTR, +}} +pub type PWNDCLASSA = *mut WNDCLASSA; +pub type NPWNDCLASSA = *mut WNDCLASSA; +pub type LPWNDCLASSA = *mut WNDCLASSA; +STRUCT!{struct WNDCLASSW { + style: UINT, + lpfnWndProc: WNDPROC, + cbClsExtra: c_int, + cbWndExtra: c_int, + hInstance: HINSTANCE, + hIcon: HICON, + hCursor: HCURSOR, + hbrBackground: HBRUSH, + lpszMenuName: LPCWSTR, + lpszClassName: LPCWSTR, +}} +pub type PWNDCLASSW = *mut WNDCLASSW; +pub type NPWNDCLASSW = *mut WNDCLASSW; +pub type LPWNDCLASSW = *mut WNDCLASSW; +extern "system" { + pub fn IsHungAppWindow( + hwnd: HWND, + ) -> BOOL; + pub fn DisableProcessWindowsGhosting(); +} +STRUCT!{struct MSG { + hwnd: HWND, + message: UINT, + wParam: WPARAM, + lParam: LPARAM, + time: DWORD, + pt: POINT, +}} +pub type PMSG = *mut MSG; +pub type NPMSG = *mut MSG; +pub type LPMSG = *mut MSG; +//POINTSTOPOINT +//POINTTOPOINTS +//MAKEWPARAM +//MAKELPARAM +//MAKELRESULT +pub const GWL_WNDPROC: c_int = -4; +pub const GWL_HINSTANCE: c_int = -6; +pub const GWL_HWNDPARENT: c_int = -8; +pub const GWL_STYLE: c_int = -16; +pub const GWL_EXSTYLE: c_int = -20; +pub const GWL_USERDATA: c_int = -21; +pub const GWL_ID: c_int = -12; +pub const GWLP_WNDPROC: c_int = -4; +pub const GWLP_HINSTANCE: c_int = -6; +pub const GWLP_HWNDPARENT: c_int = -8; +pub const GWLP_USERDATA: c_int = -21; +pub const GWLP_ID: c_int = -12; +pub const GCL_MENUNAME: c_int = -8; +pub const GCL_HBRBACKGROUND: c_int = -10; +pub const GCL_HCURSOR: c_int = -12; +pub const GCL_HICON: c_int = -14; +pub const GCL_HMODULE: c_int = -16; +pub const GCL_CBWNDEXTRA: c_int = -18; +pub const GCL_CBCLSEXTRA: c_int = -20; +pub const GCL_WNDPROC: c_int = -24; +pub const GCL_STYLE: c_int = -26; +pub const GCW_ATOM: c_int = -32; +pub const GCL_HICONSM: c_int = -34; +pub const GCLP_MENUNAME: c_int = -8; +pub const GCLP_HBRBACKGROUND: c_int = -10; +pub const GCLP_HCURSOR: c_int = -12; +pub const GCLP_HICON: c_int = -14; +pub const GCLP_HMODULE: c_int = -16; +pub const GCLP_WNDPROC: c_int = -24; +pub const GCLP_HICONSM: c_int = -34; +pub const WM_NULL: UINT = 0x0000; +pub const WM_CREATE: UINT = 0x0001; +pub const WM_DESTROY: UINT = 0x0002; +pub const WM_MOVE: UINT = 0x0003; +pub const WM_SIZE: UINT = 0x0005; +pub const WM_ACTIVATE: UINT = 0x0006; +pub const WA_INACTIVE: WORD = 0; +pub const WA_ACTIVE: WORD = 1; +pub const WA_CLICKACTIVE: WORD = 2; +pub const WM_SETFOCUS: UINT = 0x0007; +pub const WM_KILLFOCUS: UINT = 0x0008; +pub const WM_ENABLE: UINT = 0x000A; +pub const WM_SETREDRAW: UINT = 0x000B; +pub const WM_SETTEXT: UINT = 0x000C; +pub const WM_GETTEXT: UINT = 0x000D; +pub const WM_GETTEXTLENGTH: UINT = 0x000E; +pub const WM_PAINT: UINT = 0x000F; +pub const WM_CLOSE: UINT = 0x0010; +pub const WM_QUERYENDSESSION: UINT = 0x0011; +pub const WM_QUERYOPEN: UINT = 0x0013; +pub const WM_ENDSESSION: UINT = 0x0016; +pub const WM_QUIT: UINT = 0x0012; +pub const WM_ERASEBKGND: UINT = 0x0014; +pub const WM_SYSCOLORCHANGE: UINT = 0x0015; +pub const WM_SHOWWINDOW: UINT = 0x0018; +pub const WM_WININICHANGE: UINT = 0x001A; +pub const WM_SETTINGCHANGE: UINT = WM_WININICHANGE; +pub const WM_DEVMODECHANGE: UINT = 0x001B; +pub const WM_ACTIVATEAPP: UINT = 0x001C; +pub const WM_FONTCHANGE: UINT = 0x001D; +pub const WM_TIMECHANGE: UINT = 0x001E; +pub const WM_CANCELMODE: UINT = 0x001F; +pub const WM_SETCURSOR: UINT = 0x0020; +pub const WM_MOUSEACTIVATE: UINT = 0x0021; +pub const WM_CHILDACTIVATE: UINT = 0x0022; +pub const WM_QUEUESYNC: UINT = 0x0023; +pub const WM_GETMINMAXINFO: UINT = 0x0024; +STRUCT!{struct MINMAXINFO { + ptReserved: POINT, + ptMaxSize: POINT, + ptMaxPosition: POINT, + ptMinTrackSize: POINT, + ptMaxTrackSize: POINT, +}} +pub type PMINMAXINFO = *mut MINMAXINFO; +pub type LPMINMAXINFO = *mut MINMAXINFO; +pub const WM_PAINTICON: UINT = 0x0026; +pub const WM_ICONERASEBKGND: UINT = 0x0027; +pub const WM_NEXTDLGCTL: UINT = 0x0028; +pub const WM_SPOOLERSTATUS: UINT = 0x002A; +pub const WM_DRAWITEM: UINT = 0x002B; +pub const WM_MEASUREITEM: UINT = 0x002C; +pub const WM_DELETEITEM: UINT = 0x002D; +pub const WM_VKEYTOITEM: UINT = 0x002E; +pub const WM_CHARTOITEM: UINT = 0x002F; +pub const WM_SETFONT: UINT = 0x0030; +pub const WM_GETFONT: UINT = 0x0031; +pub const WM_SETHOTKEY: UINT = 0x0032; +pub const WM_GETHOTKEY: UINT = 0x0033; +pub const WM_QUERYDRAGICON: UINT = 0x0037; +pub const WM_COMPAREITEM: UINT = 0x0039; +pub const WM_GETOBJECT: UINT = 0x003D; +pub const WM_COMPACTING: UINT = 0x0041; +pub const WM_COMMNOTIFY: UINT = 0x0044; +pub const WM_WINDOWPOSCHANGING: UINT = 0x0046; +pub const WM_WINDOWPOSCHANGED: UINT = 0x0047; +pub const WM_POWER: UINT = 0x0048; +pub const PWR_OK: WPARAM = 1; +pub const PWR_FAIL: WPARAM = -1isize as usize; +pub const PWR_SUSPENDREQUEST: WPARAM = 1; +pub const PWR_SUSPENDRESUME: WPARAM = 2; +pub const PWR_CRITICALRESUME: WPARAM = 3; +pub const WM_COPYDATA: UINT = 0x004A; +pub const WM_CANCELJOURNAL: UINT = 0x004B; +STRUCT!{struct COPYDATASTRUCT { + dwData: ULONG_PTR, + cbData: DWORD, + lpData: PVOID, +}} +pub type PCOPYDATASTRUCT = *mut COPYDATASTRUCT; +STRUCT!{struct MDINEXTMENU { + hmenuIn: HMENU, + hmenuNext: HMENU, + hwndNext: HWND, +}} +pub type PMDINEXTMENU = *mut MDINEXTMENU; +pub type LPMDINEXTMENU = *mut MDINEXTMENU; +pub const WM_NOTIFY: UINT = 0x004E; +pub const WM_INPUTLANGCHANGEREQUEST: UINT = 0x0050; +pub const WM_INPUTLANGCHANGE: UINT = 0x0051; +pub const WM_TCARD: UINT = 0x0052; +pub const WM_HELP: UINT = 0x0053; +pub const WM_USERCHANGED: UINT = 0x0054; +pub const WM_NOTIFYFORMAT: UINT = 0x0055; +pub const NFR_ANSI: LRESULT = 1; +pub const NFR_UNICODE: LRESULT = 2; +pub const NF_QUERY: LPARAM = 3; +pub const NF_REQUERY: LPARAM = 4; +pub const WM_CONTEXTMENU: UINT = 0x007B; +pub const WM_STYLECHANGING: UINT = 0x007C; +pub const WM_STYLECHANGED: UINT = 0x007D; +pub const WM_DISPLAYCHANGE: UINT = 0x007E; +pub const WM_GETICON: UINT = 0x007F; +pub const WM_SETICON: UINT = 0x0080; +pub const WM_NCCREATE: UINT = 0x0081; +pub const WM_NCDESTROY: UINT = 0x0082; +pub const WM_NCCALCSIZE: UINT = 0x0083; +pub const WM_NCHITTEST: UINT = 0x0084; +pub const WM_NCPAINT: UINT = 0x0085; +pub const WM_NCACTIVATE: UINT = 0x0086; +pub const WM_GETDLGCODE: UINT = 0x0087; +pub const WM_SYNCPAINT: UINT = 0x0088; +pub const WM_NCMOUSEMOVE: UINT = 0x00A0; +pub const WM_NCLBUTTONDOWN: UINT = 0x00A1; +pub const WM_NCLBUTTONUP: UINT = 0x00A2; +pub const WM_NCLBUTTONDBLCLK: UINT = 0x00A3; +pub const WM_NCRBUTTONDOWN: UINT = 0x00A4; +pub const WM_NCRBUTTONUP: UINT = 0x00A5; +pub const WM_NCRBUTTONDBLCLK: UINT = 0x00A6; +pub const WM_NCMBUTTONDOWN: UINT = 0x00A7; +pub const WM_NCMBUTTONUP: UINT = 0x00A8; +pub const WM_NCMBUTTONDBLCLK: UINT = 0x00A9; +pub const WM_NCXBUTTONDOWN: UINT = 0x00AB; +pub const WM_NCXBUTTONUP: UINT = 0x00AC; +pub const WM_NCXBUTTONDBLCLK: UINT = 0x00AD; +pub const WM_INPUT_DEVICE_CHANGE: UINT = 0x00FE; +pub const WM_INPUT: UINT = 0x00FF; +pub const WM_KEYFIRST: UINT = 0x0100; +pub const WM_KEYDOWN: UINT = 0x0100; +pub const WM_KEYUP: UINT = 0x0101; +pub const WM_CHAR: UINT = 0x0102; +pub const WM_DEADCHAR: UINT = 0x0103; +pub const WM_SYSKEYDOWN: UINT = 0x0104; +pub const WM_SYSKEYUP: UINT = 0x0105; +pub const WM_SYSCHAR: UINT = 0x0106; +pub const WM_SYSDEADCHAR: UINT = 0x0107; +pub const WM_UNICHAR: UINT = 0x0109; +pub const WM_KEYLAST: UINT = 0x0109; +pub const UNICODE_NOCHAR: WPARAM = 0xFFFF; +pub const WM_IME_STARTCOMPOSITION: UINT = 0x010D; +pub const WM_IME_ENDCOMPOSITION: UINT = 0x010E; +pub const WM_IME_COMPOSITION: UINT = 0x010F; +pub const WM_IME_KEYLAST: UINT = 0x010F; +pub const WM_INITDIALOG: UINT = 0x0110; +pub const WM_COMMAND: UINT = 0x0111; +pub const WM_SYSCOMMAND: UINT = 0x0112; +pub const WM_TIMER: UINT = 0x0113; +pub const WM_HSCROLL: UINT = 0x0114; +pub const WM_VSCROLL: UINT = 0x0115; +pub const WM_INITMENU: UINT = 0x0116; +pub const WM_INITMENUPOPUP: UINT = 0x0117; +pub const WM_GESTURE: UINT = 0x0119; +pub const WM_GESTURENOTIFY: UINT = 0x011A; +pub const WM_MENUSELECT: UINT = 0x011F; +pub const WM_MENUCHAR: UINT = 0x0120; +pub const WM_ENTERIDLE: UINT = 0x0121; +pub const WM_MENURBUTTONUP: UINT = 0x0122; +pub const WM_MENUDRAG: UINT = 0x0123; +pub const WM_MENUGETOBJECT: UINT = 0x0124; +pub const WM_UNINITMENUPOPUP: UINT = 0x0125; +pub const WM_MENUCOMMAND: UINT = 0x0126; +pub const WM_CHANGEUISTATE: UINT = 0x0127; +pub const WM_UPDATEUISTATE: UINT = 0x0128; +pub const WM_QUERYUISTATE: UINT = 0x0129; +pub const UIS_SET: WORD = 1; +pub const UIS_CLEAR: WORD = 2; +pub const UIS_INITIALIZE: WORD = 3; +pub const UISF_HIDEFOCUS: WORD = 0x1; +pub const UISF_HIDEACCEL: WORD = 0x2; +pub const UISF_ACTIVE: WORD = 0x4; +pub const WM_CTLCOLORMSGBOX: UINT = 0x0132; +pub const WM_CTLCOLOREDIT: UINT = 0x0133; +pub const WM_CTLCOLORLISTBOX: UINT = 0x0134; +pub const WM_CTLCOLORBTN: UINT = 0x0135; +pub const WM_CTLCOLORDLG: UINT = 0x0136; +pub const WM_CTLCOLORSCROLLBAR: UINT = 0x0137; +pub const WM_CTLCOLORSTATIC: UINT = 0x0138; +pub const MN_GETHMENU: UINT = 0x01E1; +pub const WM_MOUSEFIRST: UINT = 0x0200; +pub const WM_MOUSEMOVE: UINT = 0x0200; +pub const WM_LBUTTONDOWN: UINT = 0x0201; +pub const WM_LBUTTONUP: UINT = 0x0202; +pub const WM_LBUTTONDBLCLK: UINT = 0x0203; +pub const WM_RBUTTONDOWN: UINT = 0x0204; +pub const WM_RBUTTONUP: UINT = 0x0205; +pub const WM_RBUTTONDBLCLK: UINT = 0x0206; +pub const WM_MBUTTONDOWN: UINT = 0x0207; +pub const WM_MBUTTONUP: UINT = 0x0208; +pub const WM_MBUTTONDBLCLK: UINT = 0x0209; +pub const WM_MOUSEWHEEL: UINT = 0x020A; +pub const WM_XBUTTONDOWN: UINT = 0x020B; +pub const WM_XBUTTONUP: UINT = 0x020C; +pub const WM_XBUTTONDBLCLK: UINT = 0x020D; +pub const WM_MOUSEHWHEEL: UINT = 0x020E; +pub const WM_MOUSELAST: UINT = 0x020E; +pub const WHEEL_DELTA: c_short = 120; +#[inline] +pub fn GET_WHEEL_DELTA_WPARAM(wParam: WPARAM) -> c_short { + HIWORD(wParam as DWORD) as c_short +} +pub const WHEEL_PAGESCROLL: UINT = UINT_MAX; +#[inline] +pub fn GET_KEYSTATE_WPARAM(wParam: WPARAM) -> WORD { + LOWORD(wParam as DWORD) +} +#[inline] +pub fn GET_NCHITTEST_WPARAM(wParam: WPARAM) -> c_short { + LOWORD(wParam as DWORD) as c_short +} +#[inline] +pub fn GET_XBUTTON_WPARAM(wParam: WPARAM) -> WORD { + HIWORD(wParam as DWORD) +} +pub const XBUTTON1: WORD = 0x0001; +pub const XBUTTON2: WORD = 0x0002; +pub const WM_PARENTNOTIFY: UINT = 0x0210; +pub const WM_ENTERMENULOOP: UINT = 0x0211; +pub const WM_EXITMENULOOP: UINT = 0x0212; +pub const WM_NEXTMENU: UINT = 0x0213; +pub const WM_SIZING: UINT = 0x0214; +pub const WM_CAPTURECHANGED: UINT = 0x0215; +pub const WM_MOVING: UINT = 0x0216; +pub const WM_POWERBROADCAST: UINT = 0x0218; +pub const PBT_APMQUERYSUSPEND: WPARAM = 0x0000; +pub const PBT_APMQUERYSTANDBY: WPARAM = 0x0001; +pub const PBT_APMQUERYSUSPENDFAILED: WPARAM = 0x0002; +pub const PBT_APMQUERYSTANDBYFAILED: WPARAM = 0x0003; +pub const PBT_APMSUSPEND: WPARAM = 0x0004; +pub const PBT_APMSTANDBY: WPARAM = 0x0005; +pub const PBT_APMRESUMECRITICAL: WPARAM = 0x0006; +pub const PBT_APMRESUMESUSPEND: WPARAM = 0x0007; +pub const PBT_APMRESUMESTANDBY: WPARAM = 0x0008; +pub const PBTF_APMRESUMEFROMFAILURE: LPARAM = 0x00000001; +pub const PBT_APMBATTERYLOW: WPARAM = 0x0009; +pub const PBT_APMPOWERSTATUSCHANGE: WPARAM = 0x000A; +pub const PBT_APMOEMEVENT: WPARAM = 0x000B; +pub const PBT_APMRESUMEAUTOMATIC: WPARAM = 0x0012; +pub const PBT_POWERSETTINGCHANGE: WPARAM = 0x8013; +STRUCT!{struct POWERBROADCAST_SETTING { + PowerSetting: GUID, + DataLength: DWORD, + Data: [UCHAR; 1], +}} +pub type PPOWERBROADCAST_SETTING = *mut POWERBROADCAST_SETTING; +pub const WM_DEVICECHANGE: UINT = 0x0219; +pub const WM_MDICREATE: UINT = 0x0220; +pub const WM_MDIDESTROY: UINT = 0x0221; +pub const WM_MDIACTIVATE: UINT = 0x0222; +pub const WM_MDIRESTORE: UINT = 0x0223; +pub const WM_MDINEXT: UINT = 0x0224; +pub const WM_MDIMAXIMIZE: UINT = 0x0225; +pub const WM_MDITILE: UINT = 0x0226; +pub const WM_MDICASCADE: UINT = 0x0227; +pub const WM_MDIICONARRANGE: UINT = 0x0228; +pub const WM_MDIGETACTIVE: UINT = 0x0229; +pub const WM_MDISETMENU: UINT = 0x0230; +pub const WM_ENTERSIZEMOVE: UINT = 0x0231; +pub const WM_EXITSIZEMOVE: UINT = 0x0232; +pub const WM_DROPFILES: UINT = 0x0233; +pub const WM_MDIREFRESHMENU: UINT = 0x0234; +pub const WM_POINTERDEVICECHANGE: UINT = 0x238; +pub const WM_POINTERDEVICEINRANGE: UINT = 0x239; +pub const WM_POINTERDEVICEOUTOFRANGE: UINT = 0x23A; +pub const WM_TOUCH: UINT = 0x0240; +pub const WM_NCPOINTERUPDATE: UINT = 0x0241; +pub const WM_NCPOINTERDOWN: UINT = 0x0242; +pub const WM_NCPOINTERUP: UINT = 0x0243; +pub const WM_POINTERUPDATE: UINT = 0x0245; +pub const WM_POINTERDOWN: UINT = 0x0246; +pub const WM_POINTERUP: UINT = 0x0247; +pub const WM_POINTERENTER: UINT = 0x0249; +pub const WM_POINTERLEAVE: UINT = 0x024A; +pub const WM_POINTERACTIVATE: UINT = 0x024B; +pub const WM_POINTERCAPTURECHANGED: UINT = 0x024C; +pub const WM_TOUCHHITTESTING: UINT = 0x024D; +pub const WM_POINTERWHEEL: UINT = 0x024E; +pub const WM_POINTERHWHEEL: UINT = 0x024F; +pub const DM_POINTERHITTEST: UINT = 0x0250; +pub const WM_POINTERROUTEDTO: UINT = 0x0251; +pub const WM_POINTERROUTEDAWAY: UINT = 0x0252; +pub const WM_POINTERROUTEDRELEASED: UINT = 0x0253; +pub const WM_IME_SETCONTEXT: UINT = 0x0281; +pub const WM_IME_NOTIFY: UINT = 0x0282; +pub const WM_IME_CONTROL: UINT = 0x0283; +pub const WM_IME_COMPOSITIONFULL: UINT = 0x0284; +pub const WM_IME_SELECT: UINT = 0x0285; +pub const WM_IME_CHAR: UINT = 0x0286; +pub const WM_IME_REQUEST: UINT = 0x0288; +pub const WM_IME_KEYDOWN: UINT = 0x0290; +pub const WM_IME_KEYUP: UINT = 0x0291; +pub const WM_MOUSEHOVER: UINT = 0x02A1; +pub const WM_MOUSELEAVE: UINT = 0x02A3; +pub const WM_NCMOUSEHOVER: UINT = 0x02A0; +pub const WM_NCMOUSELEAVE: UINT = 0x02A2; +pub const WM_WTSSESSION_CHANGE: UINT = 0x02B1; +pub const WM_TABLET_FIRST: UINT = 0x02c0; +pub const WM_TABLET_LAST: UINT = 0x02df; +pub const WM_DPICHANGED: UINT = 0x02E0; +pub const WM_DPICHANGED_BEFOREPARENT: UINT = 0x02E2; +pub const WM_DPICHANGED_AFTERPARENT: UINT = 0x02E3; +pub const WM_GETDPISCALEDSIZE: UINT = 0x02E4; +pub const WM_CUT: UINT = 0x0300; +pub const WM_COPY: UINT = 0x0301; +pub const WM_PASTE: UINT = 0x0302; +pub const WM_CLEAR: UINT = 0x0303; +pub const WM_UNDO: UINT = 0x0304; +pub const WM_RENDERFORMAT: UINT = 0x0305; +pub const WM_RENDERALLFORMATS: UINT = 0x0306; +pub const WM_DESTROYCLIPBOARD: UINT = 0x0307; +pub const WM_DRAWCLIPBOARD: UINT = 0x0308; +pub const WM_PAINTCLIPBOARD: UINT = 0x0309; +pub const WM_VSCROLLCLIPBOARD: UINT = 0x030A; +pub const WM_SIZECLIPBOARD: UINT = 0x030B; +pub const WM_ASKCBFORMATNAME: UINT = 0x030C; +pub const WM_CHANGECBCHAIN: UINT = 0x030D; +pub const WM_HSCROLLCLIPBOARD: UINT = 0x030E; +pub const WM_QUERYNEWPALETTE: UINT = 0x030F; +pub const WM_PALETTEISCHANGING: UINT = 0x0310; +pub const WM_PALETTECHANGED: UINT = 0x0311; +pub const WM_HOTKEY: UINT = 0x0312; +pub const WM_PRINT: UINT = 0x0317; +pub const WM_PRINTCLIENT: UINT = 0x0318; +pub const WM_APPCOMMAND: UINT = 0x0319; +pub const WM_THEMECHANGED: UINT = 0x031A; +pub const WM_CLIPBOARDUPDATE: UINT = 0x031D; +pub const WM_DWMCOMPOSITIONCHANGED: UINT = 0x031E; +pub const WM_DWMNCRENDERINGCHANGED: UINT = 0x031F; +pub const WM_DWMCOLORIZATIONCOLORCHANGED: UINT = 0x0320; +pub const WM_DWMWINDOWMAXIMIZEDCHANGE: UINT = 0x0321; +pub const WM_DWMSENDICONICTHUMBNAIL: UINT = 0x0323; +pub const WM_DWMSENDICONICLIVEPREVIEWBITMAP: UINT = 0x0326; +pub const WM_GETTITLEBARINFOEX: UINT = 0x033F; +pub const WM_HANDHELDFIRST: UINT = 0x0358; +pub const WM_HANDHELDLAST: UINT = 0x035F; +pub const WM_AFXFIRST: UINT = 0x0360; +pub const WM_AFXLAST: UINT = 0x037F; +pub const WM_PENWINFIRST: UINT = 0x0380; +pub const WM_PENWINLAST: UINT = 0x038F; +pub const WM_APP: UINT = 0x8000; +pub const WM_USER: UINT = 0x0400; +pub const WMSZ_LEFT: UINT = 1; +pub const WMSZ_RIGHT: UINT = 2; +pub const WMSZ_TOP: UINT = 3; +pub const WMSZ_TOPLEFT: UINT = 4; +pub const WMSZ_TOPRIGHT: UINT = 5; +pub const WMSZ_BOTTOM: UINT = 6; +pub const WMSZ_BOTTOMLEFT: UINT = 7; +pub const WMSZ_BOTTOMRIGHT: UINT = 8; +pub const HTERROR: LRESULT = -2; +pub const HTTRANSPARENT: LRESULT = -1; +pub const HTNOWHERE: LRESULT = 0; +pub const HTCLIENT: LRESULT = 1; +pub const HTCAPTION: LRESULT = 2; +pub const HTSYSMENU: LRESULT = 3; +pub const HTGROWBOX: LRESULT = 4; +pub const HTSIZE: LRESULT = HTGROWBOX; +pub const HTMENU: LRESULT = 5; +pub const HTHSCROLL: LRESULT = 6; +pub const HTVSCROLL: LRESULT = 7; +pub const HTMINBUTTON: LRESULT = 8; +pub const HTMAXBUTTON: LRESULT = 9; +pub const HTLEFT: LRESULT = 10; +pub const HTRIGHT: LRESULT = 11; +pub const HTTOP: LRESULT = 12; +pub const HTTOPLEFT: LRESULT = 13; +pub const HTTOPRIGHT: LRESULT = 14; +pub const HTBOTTOM: LRESULT = 15; +pub const HTBOTTOMLEFT: LRESULT = 16; +pub const HTBOTTOMRIGHT: LRESULT = 17; +pub const HTBORDER: LRESULT = 18; +pub const HTREDUCE: LRESULT = HTMINBUTTON; +pub const HTZOOM: LRESULT = HTMAXBUTTON; +pub const HTSIZEFIRST: LRESULT = HTLEFT; +pub const HTSIZELAST: LRESULT = HTBOTTOMRIGHT; +pub const HTOBJECT: LRESULT = 19; +pub const HTCLOSE: LRESULT = 20; +pub const HTHELP: LRESULT = 21; +pub const SMTO_NORMAL: UINT = 0x0000; +pub const SMTO_BLOCK: UINT = 0x0001; +pub const SMTO_ABORTIFHUNG: UINT = 0x0002; +pub const SMTO_NOTIMEOUTIFNOTHUNG: UINT = 0x0008; +pub const SMTO_ERRORONEXIT: UINT = 0x0020; +pub const MA_ACTIVATE: UINT = 1; +pub const MA_ACTIVATEANDEAT: UINT = 2; +pub const MA_NOACTIVATE: UINT = 3; +pub const MA_NOACTIVATEANDEAT: UINT = 4; +pub const ICON_SMALL: UINT = 0; +pub const ICON_BIG: UINT = 1; +pub const ICON_SMALL2: UINT = 2; +extern "system" { + pub fn RegisterWindowMessageA( + lpString: LPCSTR, + ) -> UINT; + pub fn RegisterWindowMessageW( + lpString: LPCWSTR, + ) -> UINT; +} +pub const SIZE_RESTORED: WPARAM = 0; +pub const SIZE_MINIMIZED: WPARAM = 1; +pub const SIZE_MAXIMIZED: WPARAM = 2; +pub const SIZE_MAXSHOW: WPARAM = 3; +pub const SIZE_MAXHIDE: WPARAM = 4; +pub const SIZENORMAL: WPARAM = SIZE_RESTORED; +pub const SIZEICONIC: WPARAM = SIZE_MINIMIZED; +pub const SIZEFULLSCREEN: WPARAM = SIZE_MAXIMIZED; +pub const SIZEZOOMSHOW: WPARAM = SIZE_MAXSHOW; +pub const SIZEZOOMHIDE: WPARAM = SIZE_MAXHIDE; +STRUCT!{struct WINDOWPOS { + hwnd: HWND, + hwndInsertAfter: HWND, + x: c_int, + y: c_int, + cx: c_int, + cy: c_int, + flags: UINT, +}} +pub type LPWINDOWPOS = *mut WINDOWPOS; +pub type PWINDOWPOS = *mut WINDOWPOS; +STRUCT!{struct NCCALCSIZE_PARAMS { + rgrc: [RECT; 3], + lppos: PWINDOWPOS, +}} +pub type LPNCCALCSIZE_PARAMS = *mut NCCALCSIZE_PARAMS; +pub const WVR_ALIGNTOP: LRESULT = 0x0010; +pub const WVR_ALIGNLEFT: LRESULT = 0x0020; +pub const WVR_ALIGNBOTTOM: LRESULT = 0x0040; +pub const WVR_ALIGNRIGHT: LRESULT = 0x0080; +pub const WVR_HREDRAW: LRESULT = 0x0100; +pub const WVR_VREDRAW: LRESULT = 0x0200; +pub const WVR_REDRAW: LRESULT = WVR_HREDRAW | WVR_VREDRAW; +pub const WVR_VALIDRECTS: LRESULT = 0x0400; +pub const MK_LBUTTON: WPARAM = 0x0001; +pub const MK_RBUTTON: WPARAM = 0x0002; +pub const MK_SHIFT: WPARAM = 0x0004; +pub const MK_CONTROL: WPARAM = 0x0008; +pub const MK_MBUTTON: WPARAM = 0x0010; +pub const MK_XBUTTON1: WPARAM = 0x0020; +pub const MK_XBUTTON2: WPARAM = 0x0040; +pub const TME_HOVER: DWORD = 0x00000001; +pub const TME_LEAVE: DWORD = 0x00000002; +pub const TME_NONCLIENT: DWORD = 0x00000010; +pub const TME_QUERY: DWORD = 0x40000000; +pub const TME_CANCEL: DWORD = 0x80000000; +pub const HOVER_DEFAULT: DWORD = 0xFFFFFFFF; +STRUCT!{struct TRACKMOUSEEVENT { + cbSize: DWORD, + dwFlags: DWORD, + hwndTrack: HWND, + dwHoverTime: DWORD, +}} +pub type LPTRACKMOUSEEVENT = *mut TRACKMOUSEEVENT; +extern "system" { + pub fn TrackMouseEvent( + lpEventTrack: LPTRACKMOUSEEVENT, + ) -> BOOL; +} +pub const WS_OVERLAPPED: DWORD = 0x00000000; +pub const WS_POPUP: DWORD = 0x80000000; +pub const WS_CHILD: DWORD = 0x40000000; +pub const WS_MINIMIZE: DWORD = 0x20000000; +pub const WS_VISIBLE: DWORD = 0x10000000; +pub const WS_DISABLED: DWORD = 0x08000000; +pub const WS_CLIPSIBLINGS: DWORD = 0x04000000; +pub const WS_CLIPCHILDREN: DWORD = 0x02000000; +pub const WS_MAXIMIZE: DWORD = 0x01000000; +pub const WS_CAPTION: DWORD = 0x00C00000; +pub const WS_BORDER: DWORD = 0x00800000; +pub const WS_DLGFRAME: DWORD = 0x00400000; +pub const WS_VSCROLL: DWORD = 0x00200000; +pub const WS_HSCROLL: DWORD = 0x00100000; +pub const WS_SYSMENU: DWORD = 0x00080000; +pub const WS_THICKFRAME: DWORD = 0x00040000; +pub const WS_GROUP: DWORD = 0x00020000; +pub const WS_TABSTOP: DWORD = 0x00010000; +pub const WS_MINIMIZEBOX: DWORD = 0x00020000; +pub const WS_MAXIMIZEBOX: DWORD = 0x00010000; +pub const WS_TILED: DWORD = WS_OVERLAPPED; +pub const WS_ICONIC: DWORD = WS_MINIMIZE; +pub const WS_SIZEBOX: DWORD = WS_THICKFRAME; +pub const WS_TILEDWINDOW: DWORD = WS_OVERLAPPEDWINDOW; +pub const WS_OVERLAPPEDWINDOW: DWORD = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME + | WS_MINIMIZEBOX | WS_MAXIMIZEBOX; +pub const WS_POPUPWINDOW: DWORD = WS_POPUP | WS_BORDER | WS_SYSMENU; +pub const WS_CHILDWINDOW: DWORD = WS_CHILD; +pub const WS_EX_DLGMODALFRAME: DWORD = 0x00000001; +pub const WS_EX_NOPARENTNOTIFY: DWORD = 0x00000004; +pub const WS_EX_TOPMOST: DWORD = 0x00000008; +pub const WS_EX_ACCEPTFILES: DWORD = 0x00000010; +pub const WS_EX_TRANSPARENT: DWORD = 0x00000020; +pub const WS_EX_MDICHILD: DWORD = 0x00000040; +pub const WS_EX_TOOLWINDOW: DWORD = 0x00000080; +pub const WS_EX_WINDOWEDGE: DWORD = 0x00000100; +pub const WS_EX_CLIENTEDGE: DWORD = 0x00000200; +pub const WS_EX_CONTEXTHELP: DWORD = 0x00000400; +pub const WS_EX_RIGHT: DWORD = 0x00001000; +pub const WS_EX_LEFT: DWORD = 0x00000000; +pub const WS_EX_RTLREADING: DWORD = 0x00002000; +pub const WS_EX_LTRREADING: DWORD = 0x00000000; +pub const WS_EX_LEFTSCROLLBAR: DWORD = 0x00004000; +pub const WS_EX_RIGHTSCROLLBAR: DWORD = 0x00000000; +pub const WS_EX_CONTROLPARENT: DWORD = 0x00010000; +pub const WS_EX_STATICEDGE: DWORD = 0x00020000; +pub const WS_EX_APPWINDOW: DWORD = 0x00040000; +pub const WS_EX_OVERLAPPEDWINDOW: DWORD = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE; +pub const WS_EX_PALETTEWINDOW: DWORD = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST; +pub const WS_EX_LAYERED: DWORD = 0x00080000; +pub const WS_EX_NOINHERITLAYOUT: DWORD = 0x00100000; +pub const WS_EX_NOREDIRECTIONBITMAP: DWORD = 0x00200000; +pub const WS_EX_LAYOUTRTL: DWORD = 0x00400000; +pub const WS_EX_COMPOSITED: DWORD = 0x02000000; +pub const WS_EX_NOACTIVATE: DWORD = 0x08000000; +pub const CS_VREDRAW: UINT = 0x0001; +pub const CS_HREDRAW: UINT = 0x0002; +pub const CS_DBLCLKS: UINT = 0x0008; +pub const CS_OWNDC: UINT = 0x0020; +pub const CS_CLASSDC: UINT = 0x0040; +pub const CS_PARENTDC: UINT = 0x0080; +pub const CS_NOCLOSE: UINT = 0x0200; +pub const CS_SAVEBITS: UINT = 0x0800; +pub const CS_BYTEALIGNCLIENT: UINT = 0x1000; +pub const CS_BYTEALIGNWINDOW: UINT = 0x2000; +pub const CS_GLOBALCLASS: UINT = 0x4000; +pub const CS_IME: UINT = 0x00010000; +pub const CS_DROPSHADOW: UINT = 0x00020000; +pub const PRF_CHECKVISIBLE: UINT = 0x00000001; +pub const PRF_NONCLIENT: UINT = 0x00000002; +pub const PRF_CLIENT: UINT = 0x00000004; +pub const PRF_ERASEBKGND: UINT = 0x00000008; +pub const PRF_CHILDREN: UINT = 0x00000010; +pub const PRF_OWNED: UINT = 0x00000020; +pub const BDR_RAISEDOUTER: UINT = 0x0001; +pub const BDR_SUNKENOUTER: UINT = 0x0002; +pub const BDR_RAISEDINNER: UINT = 0x0004; +pub const BDR_SUNKENINNER: UINT = 0x0008; +pub const BDR_OUTER: UINT = BDR_RAISEDOUTER | BDR_SUNKENOUTER; +pub const BDR_INNER: UINT = BDR_RAISEDINNER | BDR_SUNKENINNER; +pub const BDR_RAISED: UINT = BDR_RAISEDOUTER | BDR_RAISEDINNER; +pub const BDR_SUNKEN: UINT = BDR_SUNKENOUTER | BDR_SUNKENINNER; +pub const EDGE_RAISED: UINT = BDR_RAISEDOUTER | BDR_RAISEDINNER; +pub const EDGE_SUNKEN: UINT = BDR_SUNKENOUTER | BDR_SUNKENINNER; +pub const EDGE_ETCHED: UINT = BDR_SUNKENOUTER | BDR_RAISEDINNER; +pub const EDGE_BUMP: UINT = BDR_RAISEDOUTER | BDR_SUNKENINNER; +pub const BF_LEFT: UINT = 0x0001; +pub const BF_TOP: UINT = 0x0002; +pub const BF_RIGHT: UINT = 0x0004; +pub const BF_BOTTOM: UINT = 0x0008; +pub const BF_TOPLEFT: UINT = BF_TOP | BF_LEFT; +pub const BF_TOPRIGHT: UINT = BF_TOP | BF_RIGHT; +pub const BF_BOTTOMLEFT: UINT = BF_BOTTOM | BF_LEFT; +pub const BF_BOTTOMRIGHT: UINT = BF_BOTTOM | BF_RIGHT; +pub const BF_RECT: UINT = BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM; +pub const BF_DIAGONAL: UINT = 0x0010; +pub const BF_DIAGONAL_ENDTOPRIGHT: UINT = BF_DIAGONAL | BF_TOP | BF_RIGHT; +pub const BF_DIAGONAL_ENDTOPLEFT: UINT = BF_DIAGONAL | BF_TOP | BF_LEFT; +pub const BF_DIAGONAL_ENDBOTTOMLEFT: UINT = BF_DIAGONAL | BF_BOTTOM | BF_LEFT; +pub const BF_DIAGONAL_ENDBOTTOMRIGHT: UINT = BF_DIAGONAL | BF_BOTTOM | BF_RIGHT; +pub const BF_MIDDLE: UINT = 0x0800; +pub const BF_SOFT: UINT = 0x1000; +pub const BF_ADJUST: UINT = 0x2000; +pub const BF_FLAT: UINT = 0x4000; +pub const BF_MONO: UINT = 0x8000; +extern "system" { + pub fn DrawEdge( + hdc: HDC, + qrc: LPRECT, + edge: UINT, + grfFlags: UINT, + ) -> BOOL; +} +pub const DFC_CAPTION: UINT = 1; +pub const DFC_MENU: UINT = 2; +pub const DFC_SCROLL: UINT = 3; +pub const DFC_BUTTON: UINT = 4; +pub const DFC_POPUPMENU: UINT = 5; +pub const DFCS_CAPTIONCLOSE: UINT = 0x0000; +pub const DFCS_CAPTIONMIN: UINT = 0x0001; +pub const DFCS_CAPTIONMAX: UINT = 0x0002; +pub const DFCS_CAPTIONRESTORE: UINT = 0x0003; +pub const DFCS_CAPTIONHELP: UINT = 0x0004; +pub const DFCS_MENUARROW: UINT = 0x0000; +pub const DFCS_MENUCHECK: UINT = 0x0001; +pub const DFCS_MENUBULLET: UINT = 0x0002; +pub const DFCS_MENUARROWRIGHT: UINT = 0x0004; +pub const DFCS_SCROLLUP: UINT = 0x0000; +pub const DFCS_SCROLLDOWN: UINT = 0x0001; +pub const DFCS_SCROLLLEFT: UINT = 0x0002; +pub const DFCS_SCROLLRIGHT: UINT = 0x0003; +pub const DFCS_SCROLLCOMBOBOX: UINT = 0x0005; +pub const DFCS_SCROLLSIZEGRIP: UINT = 0x0008; +pub const DFCS_SCROLLSIZEGRIPRIGHT: UINT = 0x0010; +pub const DFCS_BUTTONCHECK: UINT = 0x0000; +pub const DFCS_BUTTONRADIOIMAGE: UINT = 0x0001; +pub const DFCS_BUTTONRADIOMASK: UINT = 0x0002; +pub const DFCS_BUTTONRADIO: UINT = 0x0004; +pub const DFCS_BUTTON3STATE: UINT = 0x0008; +pub const DFCS_BUTTONPUSH: UINT = 0x0010; +pub const DFCS_INACTIVE: UINT = 0x0100; +pub const DFCS_PUSHED: UINT = 0x0200; +pub const DFCS_CHECKED: UINT = 0x0400; +pub const DFCS_TRANSPARENT: UINT = 0x0800; +pub const DFCS_HOT: UINT = 0x1000; +pub const DFCS_ADJUSTRECT: UINT = 0x2000; +pub const DFCS_FLAT: UINT = 0x4000; +pub const DFCS_MONO: UINT = 0x8000; +extern "system" { + pub fn DrawFrameControl( + hdc: HDC, + lprc: LPRECT, + uType: UINT, + uState: UINT, + ) -> BOOL; +} +pub const DC_ACTIVE: UINT = 0x0001; +pub const DC_SMALLCAP: UINT = 0x0002; +pub const DC_ICON: UINT = 0x0004; +pub const DC_TEXT: UINT = 0x0008; +pub const DC_INBUTTON: UINT = 0x0010; +pub const DC_GRADIENT: UINT = 0x0020; +pub const DC_BUTTONS: UINT = 0x1000; +extern "system" { + pub fn DrawCaption( + hwnd: HWND, + hdc: HDC, + lprect: *const RECT, + flags: UINT, + ) -> BOOL; +} +pub const IDANI_OPEN: c_int = 1; +pub const IDANI_CAPTION: c_int = 3; +extern "system" { + pub fn DrawAnimatedRects( + hwnd: HWND, + idAni: c_int, + lprcFrom: *const RECT, + lprcTo: *const RECT, + ) -> BOOL; +} +pub const CF_TEXT: UINT = 1; +pub const CF_BITMAP: UINT = 2; +pub const CF_METAFILEPICT: UINT = 3; +pub const CF_SYLK: UINT = 4; +pub const CF_DIF: UINT = 5; +pub const CF_TIFF: UINT = 6; +pub const CF_OEMTEXT: UINT = 7; +pub const CF_DIB: UINT = 8; +pub const CF_PALETTE: UINT = 9; +pub const CF_PENDATA: UINT = 10; +pub const CF_RIFF: UINT = 11; +pub const CF_WAVE: UINT = 12; +pub const CF_UNICODETEXT: UINT = 13; +pub const CF_ENHMETAFILE: UINT = 14; +pub const CF_HDROP: UINT = 15; +pub const CF_LOCALE: UINT = 16; +pub const CF_DIBV5: UINT = 17; +pub const CF_MAX: UINT = 18; +pub const CF_OWNERDISPLAY: UINT = 0x0080; +pub const CF_DSPTEXT: UINT = 0x0081; +pub const CF_DSPBITMAP: UINT = 0x0082; +pub const CF_DSPMETAFILEPICT: UINT = 0x0083; +pub const CF_DSPENHMETAFILE: UINT = 0x008E; +pub const CF_PRIVATEFIRST: UINT = 0x0200; +pub const CF_PRIVATELAST: UINT = 0x02FF; +pub const CF_GDIOBJFIRST: UINT = 0x0300; +pub const CF_GDIOBJLAST: UINT = 0x03FF; +pub const FVIRTKEY: BYTE = TRUE as u8; +pub const FNOINVERT: BYTE = 0x02; +pub const FSHIFT: BYTE = 0x04; +pub const FCONTROL: BYTE = 0x08; +pub const FALT: BYTE = 0x10; +STRUCT!{struct ACCEL { + fVirt: BYTE, + key: WORD, + cmd: WORD, +}} +pub type LPACCEL = *mut ACCEL; +STRUCT!{struct PAINTSTRUCT { + hdc: HDC, + fErase: BOOL, + rcPaint: RECT, + fRestore: BOOL, + fIncUpdate: BOOL, + rgbReserved: [BYTE; 32], +}} +pub type PPAINTSTRUCT = *mut PAINTSTRUCT; +pub type NPPAINTSTRUCT = *mut PAINTSTRUCT; +pub type LPPAINTSTRUCT = *mut PAINTSTRUCT; +STRUCT!{struct CREATESTRUCTA { + lpCreateParams: LPVOID, + hInstance: HINSTANCE, + hMenu: HMENU, + hwndParent: HWND, + cy: c_int, + cx: c_int, + y: c_int, + x: c_int, + style: LONG, + lpszName: LPCSTR, + lpszClass: LPCSTR, + dwExStyle: DWORD, +}} +pub type LPCREATESTRUCTA = *mut CREATESTRUCTA; +STRUCT!{struct CREATESTRUCTW { + lpCreateParams: LPVOID, + hInstance: HINSTANCE, + hMenu: HMENU, + hwndParent: HWND, + cy: c_int, + cx: c_int, + y: c_int, + x: c_int, + style: LONG, + lpszName: LPCWSTR, + lpszClass: LPCWSTR, + dwExStyle: DWORD, +}} +pub type LPCREATESTRUCTW = *mut CREATESTRUCTW; +STRUCT!{struct WINDOWPLACEMENT { + length: UINT, + flags: UINT, + showCmd: UINT, + ptMinPosition: POINT, + ptMaxPosition: POINT, + rcNormalPosition: RECT, +}} +pub type PWINDOWPLACEMENT = *mut WINDOWPLACEMENT; +pub type LPWINDOWPLACEMENT = *mut WINDOWPLACEMENT; +pub const WPF_SETMINPOSITION: UINT = 0x0001; +pub const WPF_RESTORETOMAXIMIZED: UINT = 0x0002; +pub const WPF_ASYNCWINDOWPLACEMENT: UINT = 0x0004; +STRUCT!{struct NMHDR { + hwndFrom: HWND, + idFrom: UINT_PTR, + code: UINT, +}} +pub type LPNMHDR = *mut NMHDR; +STRUCT!{struct STYLESTRUCT { + styleOld: DWORD, + styleNew: DWORD, +}} +pub type LPSTYLESTRUCT = *mut STYLESTRUCT; +pub const ODT_MENU: UINT = 1; +pub const ODT_LISTBOX: UINT = 2; +pub const ODT_COMBOBOX: UINT = 3; +pub const ODT_BUTTON: UINT = 4; +pub const ODT_STATIC: UINT = 5; +pub const ODA_DRAWENTIRE: UINT = 0x0001; +pub const ODA_SELECT: UINT = 0x0002; +pub const ODA_FOCUS: UINT = 0x0004; +pub const ODS_SELECTED: UINT = 0x0001; +pub const ODS_GRAYED: UINT = 0x0002; +pub const ODS_DISABLED: UINT = 0x0004; +pub const ODS_CHECKED: UINT = 0x0008; +pub const ODS_FOCUS: UINT = 0x0010; +pub const ODS_DEFAULT: UINT = 0x0020; +pub const ODS_COMBOBOXEDIT: UINT = 0x1000; +pub const ODS_HOTLIGHT: UINT = 0x0040; +pub const ODS_INACTIVE: UINT = 0x0080; +pub const ODS_NOACCEL: UINT = 0x0100; +pub const ODS_NOFOCUSRECT: UINT = 0x0200; +STRUCT!{struct MEASUREITEMSTRUCT { + CtlType: UINT, + CtlID: UINT, + itemID: UINT, + itemWidth: UINT, + itemHeight: UINT, + itemData: ULONG_PTR, +}} +pub type PMEASUREITEMSTRUCT = *mut MEASUREITEMSTRUCT; +pub type LPMEASUREITEMSTRUCT = *mut MEASUREITEMSTRUCT; +STRUCT!{struct DRAWITEMSTRUCT { + CtlType: UINT, + CtlID: UINT, + itemID: UINT, + itemAction: UINT, + itemState: UINT, + hwndItem: HWND, + hDC: HDC, + rcItem: RECT, + itemData: ULONG_PTR, +}} +pub type PDRAWITEMSTRUCT = *mut DRAWITEMSTRUCT; +pub type LPDRAWITEMSTRUCT = *mut DRAWITEMSTRUCT; +STRUCT!{struct DELETEITEMSTRUCT { + CtlType: UINT, + CtlID: UINT, + itemID: UINT, + hwndItem: HWND, + itemData: ULONG_PTR, +}} +pub type PDELETEITEMSTRUCT = *mut DELETEITEMSTRUCT; +pub type LPDELETEITEMSTRUCT = *mut DELETEITEMSTRUCT; +STRUCT!{struct COMPAREITEMSTRUCT { + CtlType: UINT, + CtlID: UINT, + hwndItem: HWND, + itemID1: UINT, + itemData1: ULONG_PTR, + itemID2: UINT, + itemData2: ULONG_PTR, + dwLocaleId: DWORD, +}} +pub type PCOMPAREITEMSTRUCT = *mut COMPAREITEMSTRUCT; +pub type LPCOMPAREITEMSTRUCT = *mut COMPAREITEMSTRUCT; +extern "system" { + pub fn GetMessageA( + lpMsg: LPMSG, + hWnd: HWND, + wMsgFilterMin: UINT, + wMsgFilterMax: UINT, + ) -> BOOL; + pub fn GetMessageW( + lpMsg: LPMSG, + hWnd: HWND, + wMsgFilterMin: UINT, + wMsgFilterMax: UINT, + ) -> BOOL; + pub fn TranslateMessage( + lpmsg: *const MSG, + ) -> BOOL; + pub fn DispatchMessageA( + lpmsg: *const MSG, + ) -> LRESULT; + pub fn DispatchMessageW( + lpmsg: *const MSG, + ) -> LRESULT; + pub fn SetMessageQueue( + cMessagesMax: c_int, + ) -> BOOL; + pub fn PeekMessageA( + lpMsg: LPMSG, + hWnd: HWND, + wMsgFilterMin: UINT, + wMsgFilterMax: UINT, + wRemoveMsg: UINT, + ) -> BOOL; + pub fn PeekMessageW( + lpMsg: LPMSG, + hWnd: HWND, + wMsgFilterMin: UINT, + wMsgFilterMax: UINT, + wRemoveMsg: UINT, + ) -> BOOL; +} +pub const PM_NOREMOVE: UINT = 0x0000; +pub const PM_REMOVE: UINT = 0x0001; +pub const PM_NOYIELD: UINT = 0x0002; +pub const PM_QS_INPUT: UINT = QS_INPUT << 16; +pub const PM_QS_POSTMESSAGE: UINT = (QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER) << 16; +pub const PM_QS_PAINT: UINT = QS_PAINT << 16; +pub const PM_QS_SENDMESSAGE: UINT = QS_SENDMESSAGE << 16; +extern "system" { + pub fn RegisterHotKey( + hwnd: HWND, + id: c_int, + fsModifiers: UINT, + vk: UINT, + ) -> BOOL; + pub fn UnregisterHotKey( + hWnd: HWND, + id: c_int, + ) -> BOOL; +} +pub const MOD_ALT: LPARAM = 0x0001; +pub const MOD_CONTROL: LPARAM = 0x0002; +pub const MOD_SHIFT: LPARAM = 0x0004; +pub const MOD_WIN: LPARAM = 0x0008; +pub const MOD_NOREPEAT: LPARAM = 0x4000; +pub const IDHOT_SNAPWINDOW: WPARAM = -1isize as usize; +pub const IDHOT_SNAPDESKTOP: WPARAM = -2isize as usize; +pub const ENDSESSION_CLOSEAPP: UINT = 0x00000001; +pub const ENDSESSION_CRITICAL: UINT = 0x40000000; +pub const ENDSESSION_LOGOFF: UINT = 0x80000000; +pub const EWX_LOGOFF: UINT = 0x00000000; +pub const EWX_SHUTDOWN: UINT = 0x00000001; +pub const EWX_REBOOT: UINT = 0x00000002; +pub const EWX_FORCE: UINT = 0x00000004; +pub const EWX_POWEROFF: UINT = 0x00000008; +pub const EWX_FORCEIFHUNG: UINT = 0x00000010; +pub const EWX_QUICKRESOLVE: UINT = 0x00000020; +pub const EWX_RESTARTAPPS: UINT = 0x00000040; +pub const EWX_HYBRID_SHUTDOWN: UINT = 0x00400000; +pub const EWX_BOOTOPTIONS: UINT = 0x01000000; +// ExitWindows +extern "system" { + pub fn ExitWindowsEx( + uFlags: UINT, + dwReason: DWORD, + ) -> BOOL; + pub fn SwapMouseButton( + fSwap: BOOL, + ) -> BOOL; + pub fn GetMessagePos() -> DWORD; + pub fn GetMessageTime() -> LONG; + pub fn GetMessageExtraInfo() -> LPARAM; + pub fn GetUnpredictedMessagePos() -> DWORD; + pub fn IsWow64Message() -> BOOL; + pub fn SetMessageExtraInfo( + lParam: LPARAM, + ) -> LPARAM; + pub fn SendMessageA( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn SendMessageW( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn SendMessageTimeoutA( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + fuFlags: UINT, + uTimeout: UINT, + lpdwResult: PDWORD_PTR, + ) -> LRESULT; + pub fn SendMessageTimeoutW( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + fuFlags: UINT, + uTimeout: UINT, + lpdwResult: PDWORD_PTR, + ) -> LRESULT; + pub fn SendNotifyMessageA( + hWnd: HWND, + msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> BOOL; + pub fn SendNotifyMessageW( + hWnd: HWND, + msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> BOOL; + pub fn SendMessageCallbackA( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + lpResultCallBack: SENDASYNCPROC, + dwData: ULONG_PTR, + ) -> BOOL; + pub fn SendMessageCallbackW( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + lpResultCallBack: SENDASYNCPROC, + dwData: ULONG_PTR, + ) -> BOOL; +} +STRUCT!{struct BSMINFO { + cbSize: UINT, + hdesk: HDESK, + hwnd: HWND, + luid: LUID, +}} +pub type PBSMINFO = *mut BSMINFO; +extern "system" { + pub fn BroadcastSystemMessageExA( + flags: DWORD, + lpInfo: LPDWORD, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + pbsmInfo: PBSMINFO, + ) -> c_long; + pub fn BroadcastSystemMessageExW( + flags: DWORD, + lpInfo: LPDWORD, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + pbsmInfo: PBSMINFO, + ) -> c_long; + pub fn BroadcastSystemMessageA( + flags: DWORD, + lpInfo: LPDWORD, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LONG; + pub fn BroadcastSystemMessageW( + flags: DWORD, + lpInfo: LPDWORD, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LONG; +} +pub const BSM_ALLCOMPONENTS: DWORD = 0x00000000; +pub const BSM_VXDS: DWORD = 0x00000001; +pub const BSM_NETDRIVER: DWORD = 0x00000002; +pub const BSM_INSTALLABLEDRIVERS: DWORD = 0x00000004; +pub const BSM_APPLICATIONS: DWORD = 0x00000008; +pub const BSM_ALLDESKTOPS: DWORD = 0x00000010; +pub const BSF_QUERY: DWORD = 0x00000001; +pub const BSF_IGNORECURRENTTASK: DWORD = 0x00000002; +pub const BSF_FLUSHDISK: DWORD = 0x00000004; +pub const BSF_NOHANG: DWORD = 0x00000008; +pub const BSF_POSTMESSAGE: DWORD = 0x00000010; +pub const BSF_FORCEIFHUNG: DWORD = 0x00000020; +pub const BSF_NOTIMEOUTIFNOTHUNG: DWORD = 0x00000040; +pub const BSF_ALLOWSFW: DWORD = 0x00000080; +pub const BSF_SENDNOTIFYMESSAGE: DWORD = 0x00000100; +pub const BSF_RETURNHDESK: DWORD = 0x00000200; +pub const BSF_LUID: DWORD = 0x00000400; +pub const BROADCAST_QUERY_DENY: DWORD = 0x424D5144; +pub type HDEVNOTIFY = PVOID; +pub type PHDEVNOTIFY = *mut HDEVNOTIFY; +pub const DEVICE_NOTIFY_WINDOW_HANDLE: DWORD = 0x00000000; +pub const DEVICE_NOTIFY_SERVICE_HANDLE: DWORD = 0x00000001; +pub const DEVICE_NOTIFY_ALL_INTERFACE_CLASSES: DWORD = 0x00000004; +extern "system" { + pub fn RegisterDeviceNotificationA( + hRecipient: HANDLE, + notificationFilter: LPVOID, + flags: DWORD, + ) -> HDEVNOTIFY; + pub fn RegisterDeviceNotificationW( + hRecipient: HANDLE, + notificationFilter: LPVOID, + flags: DWORD, + ) -> HDEVNOTIFY; + pub fn UnregisterDeviceNotification( + Handle: HDEVNOTIFY, + ) -> BOOL; +} +pub type HPOWERNOTIFY = PVOID; +pub type PHPOWERNOTIFY = *mut HPOWERNOTIFY; +extern "system" { + pub fn RegisterPowerSettingNotification( + hRecipient: HANDLE, + PowerSettingGuid: LPCGUID, + Flags: DWORD, + ) -> HPOWERNOTIFY; + pub fn UnregisterPowerSettingNotification( + Handle: HPOWERNOTIFY, + ) -> BOOL; + pub fn RegisterSuspendResumeNotification( + hRecipient: HANDLE, + Flags: DWORD, + ) -> HPOWERNOTIFY; + pub fn UnregisterSuspendResumeNotification( + Handle: HPOWERNOTIFY, + ) -> BOOL; + pub fn PostMessageA( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> BOOL; + pub fn PostMessageW( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> BOOL; + pub fn PostThreadMessageA( + idThread: DWORD, + msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> BOOL; + pub fn PostThreadMessageW( + idThread: DWORD, + msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> BOOL; +} +// PostAppMessageA +// PostAppMessageW +pub const HWND_BROADCAST: HWND = 0xffff as HWND; +pub const HWND_MESSAGE: HWND = -3isize as HWND; +extern "system" { + pub fn AttachThreadInput( + idAttach: DWORD, + idAttachTo: DWORD, + fAttach: BOOL, + ) -> BOOL; + pub fn ReplyMessage( + lResult: LRESULT, + ) -> BOOL; + pub fn WaitMessage() -> BOOL; + pub fn WaitForInputIdle( + hProcess: HANDLE, + dwMilliseconds: DWORD, + ) -> DWORD; + pub fn DefWindowProcA( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn DefWindowProcW( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn PostQuitMessage( + nExitCode: c_int, + ); + pub fn CallWindowProcA( + lpPrevWndFunc: WNDPROC, + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn CallWindowProcW( + lpPrevWndFunc: WNDPROC, + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn InSendMessage() -> BOOL; + pub fn InSendMessageEx( + lpReserved: LPVOID, + ) -> DWORD; +} +pub const ISMEX_NOSEND: DWORD = 0x00000000; +pub const ISMEX_SEND: DWORD = 0x00000001; +pub const ISMEX_NOTIFY: DWORD = 0x00000002; +pub const ISMEX_CALLBACK: DWORD = 0x00000004; +pub const ISMEX_REPLIED: DWORD = 0x00000008; +extern "system" { + pub fn GetDoubleClickTime() -> UINT; + pub fn SetDoubleClickTime( + uInterval: UINT, + ) -> BOOL; + pub fn RegisterClassA( + lpWndClass: *const WNDCLASSA, + ) -> ATOM; + pub fn RegisterClassW( + lpWndClass: *const WNDCLASSW, + ) -> ATOM; + pub fn UnregisterClassA( + lpClassName: LPCSTR, + hInstance: HINSTANCE, + ) -> BOOL; + pub fn UnregisterClassW( + lpClassName: LPCWSTR, + hInstance: HINSTANCE, + ) -> BOOL; + pub fn GetClassInfoA( + hInstance: HINSTANCE, + lpClassName: LPCSTR, + lpWndClass: LPWNDCLASSA, + ) -> BOOL; + pub fn GetClassInfoW( + hInstance: HINSTANCE, + lpClassName: LPCWSTR, + lpWndClass: LPWNDCLASSW, + ) -> BOOL; + pub fn RegisterClassExA( + lpWndClass: *const WNDCLASSEXA, + ) -> ATOM; + pub fn RegisterClassExW( + lpWndClass: *const WNDCLASSEXW, + ) -> ATOM; + pub fn GetClassInfoExA( + hinst: HINSTANCE, + lpszClass: LPCSTR, + lpwcx: LPWNDCLASSEXA, + ) -> BOOL; + pub fn GetClassInfoExW( + hinst: HINSTANCE, + lpszClass: LPCWSTR, + lpwcx: LPWNDCLASSEXW, + ) -> BOOL; +} +pub const CW_USEDEFAULT: c_int = 0x80000000; +pub const HWND_DESKTOP: HWND = 0 as HWND; +FN!{stdcall PREGISTERCLASSNAMEW( + LPCWSTR, +) -> BOOLEAN} +extern "system" { + pub fn CreateWindowExA( + dwExStyle: DWORD, + lpClassName: LPCSTR, + lpWindowName: LPCSTR, + dwStyle: DWORD, + x: c_int, + y: c_int, + nWidth: c_int, + nHeight: c_int, + hWndParent: HWND, + hMenu: HMENU, + hInstance: HINSTANCE, + lpParam: LPVOID, + ) -> HWND; + pub fn CreateWindowExW( + dwExStyle: DWORD, + lpClassName: LPCWSTR, + lpWindowName: LPCWSTR, + dwStyle: DWORD, + x: c_int, + y: c_int, + nWidth: c_int, + nHeight: c_int, + hWndParent: HWND, + hMenu: HMENU, + hInstance: HINSTANCE, + lpParam: LPVOID, + ) -> HWND; +} +// CreateWindowA +// CreateWindowW +extern "system" { + pub fn IsWindow( + hWnd: HWND, + ) -> BOOL; + pub fn IsMenu( + hMenu: HMENU, + ) -> BOOL; + pub fn IsChild( + hWndParent: HWND, + hWnd: HWND, + ) -> BOOL; + pub fn DestroyWindow( + hWnd: HWND, + ) -> BOOL; + pub fn ShowWindow( + hWnd: HWND, + nCmdShow: c_int, + ) -> BOOL; + pub fn AnimateWindow( + hWnd: HWND, + dwTime: DWORD, + dwFlags: DWORD, + ) -> BOOL; + pub fn UpdateLayeredWindow( + hWnd: HWND, + hdcDst: HDC, + pptDst: *mut POINT, + psize: *mut SIZE, + hdcSrc: HDC, + pptSrc: *mut POINT, + crKey: COLORREF, + pblend: *mut BLENDFUNCTION, + dwFlags: DWORD, + ) -> BOOL; +} +STRUCT!{struct UPDATELAYEREDWINDOWINFO { + cbSize: DWORD, + hdcDst: HDC, + pptDst: *const POINT, + psize: *const SIZE, + hdcSrc: HDC, + pptSrc: *const POINT, + crKey: COLORREF, + pblend: *const BLENDFUNCTION, + dwFlags: DWORD, + prcDirty: *const RECT, +}} +pub type PUPDATELAYEREDWINDOWINFO = *mut UPDATELAYEREDWINDOWINFO; +extern "system" { + pub fn UpdateLayeredWindowIndirect( + hWnd: HWND, + pULWInfo: *mut UPDATELAYEREDWINDOWINFO, + ) -> BOOL; + pub fn GetLayeredWindowAttributes( + hwnd: HWND, + pcrKey: *mut COLORREF, + pbAlpha: *mut BYTE, + pdwFlags: *mut DWORD, + ) -> BOOL; +} +pub const PW_CLIENTONLY: DWORD = 0x00000001; +pub const PW_RENDERFULLCONTENT: DWORD = 0x00000002; +extern "system" { + pub fn PrintWindow( + hwnd: HWND, + hdcBlt: HDC, + nFlags: UINT, + ) -> BOOL; + pub fn SetLayeredWindowAttributes( + hwnd: HWND, + crKey: COLORREF, + bAlpha: BYTE, + dwFlags: DWORD, + ) -> BOOL; +} +pub const LWA_COLORKEY: DWORD = 0x00000001; +pub const LWA_ALPHA: DWORD = 0x00000002; +pub const ULW_COLORKEY: DWORD = 0x00000001; +pub const ULW_ALPHA: DWORD = 0x00000002; +pub const ULW_OPAQUE: DWORD = 0x00000004; +pub const ULW_EX_NORESIZE: DWORD = 0x00000008; +extern "system" { + pub fn ShowWindowAsync( + hWnd: HWND, + nCmdShow: c_int, + ) -> BOOL; + pub fn FlashWindow( + hwnd: HWND, + bInvert: BOOL, + ) -> BOOL; +} +STRUCT!{struct FLASHWINFO { + cbSize: UINT, + hwnd: HWND, + dwFlags: DWORD, + uCount: UINT, + dwTimeout: DWORD, +}} +pub type PFLASHWINFO = *mut FLASHWINFO; +extern "system" { + pub fn FlashWindowEx( + pfwi: PFLASHWINFO, + ) -> BOOL; +} +pub const FLASHW_STOP: DWORD = 0; +pub const FLASHW_CAPTION: DWORD = 0x00000001; +pub const FLASHW_TRAY: DWORD = 0x00000002; +pub const FLASHW_ALL: DWORD = FLASHW_CAPTION | FLASHW_TRAY; +pub const FLASHW_TIMER: DWORD = 0x00000004; +pub const FLASHW_TIMERNOFG: DWORD = 0x0000000C; +extern "system" { + pub fn ShowOwnedPopups( + hWnd: HWND, + fShow: BOOL, + ) -> BOOL; + pub fn OpenIcon( + hWnd: HWND, + ) -> BOOL; + pub fn CloseWindow( + hWnd: HWND, + ) -> BOOL; + pub fn MoveWindow( + hWnd: HWND, + X: c_int, + Y: c_int, + nWidth: c_int, + nHeight: c_int, + bRepaint: BOOL, + ) -> BOOL; + pub fn SetWindowPos( + hWnd: HWND, + hWndInsertAfter: HWND, + X: c_int, + Y: c_int, + cx: c_int, + cy: c_int, + uFlags: UINT, + ) -> BOOL; + pub fn GetWindowPlacement( + hWnd: HWND, + lpwndpl: *mut WINDOWPLACEMENT, + ) -> BOOL; + pub fn SetWindowPlacement( + hWnd: HWND, + lpwndpl: *const WINDOWPLACEMENT, + ) -> BOOL; +} +pub const WDA_NONE: DWORD = 0x00000000; +pub const WDA_MONITOR: DWORD = 0x00000001; +extern "system" { + pub fn GetWindowDisplayAffinity( + hWnd: HWND, + pdwAffinity: *mut DWORD, + ) -> BOOL; + pub fn SetWindowDisplayAffinity( + hWnd: HWND, + dwAffinity: DWORD, + ) -> BOOL; + pub fn BeginDeferWindowPos( + nNumWindows: c_int, + ) -> HDWP; + pub fn DeferWindowPos( + hWinPosInfo: HDWP, + hWnd: HWND, + hWndInserAfter: HWND, + x: c_int, + y: c_int, + cx: c_int, + cy: c_int, + uFlags: UINT, + ) -> HDWP; + pub fn EndDeferWindowPos( + hWinPosInfo: HDWP, + ) -> BOOL; + pub fn IsWindowVisible( + hWnd: HWND, + ) -> BOOL; + pub fn IsIconic( + hWnd: HWND, + ) -> BOOL; + pub fn AnyPopup() -> BOOL; + pub fn BringWindowToTop( + hWnd: HWND, + ) -> BOOL; + pub fn IsZoomed( + hwnd: HWND, + ) -> BOOL; +} +pub const SWP_NOSIZE: UINT = 0x0001; +pub const SWP_NOMOVE: UINT = 0x0002; +pub const SWP_NOZORDER: UINT = 0x0004; +pub const SWP_NOREDRAW: UINT = 0x0008; +pub const SWP_NOACTIVATE: UINT = 0x0010; +pub const SWP_FRAMECHANGED: UINT = 0x0020; +pub const SWP_SHOWWINDOW: UINT = 0x0040; +pub const SWP_HIDEWINDOW: UINT = 0x0080; +pub const SWP_NOCOPYBITS: UINT = 0x0100; +pub const SWP_NOOWNERZORDER: UINT = 0x0200; +pub const SWP_NOSENDCHANGING: UINT = 0x0400; +pub const SWP_DRAWFRAME: UINT = SWP_FRAMECHANGED; +pub const SWP_NOREPOSITION: UINT = SWP_NOOWNERZORDER; +pub const SWP_DEFERERASE: UINT = 0x2000; +pub const SWP_ASYNCWINDOWPOS: UINT = 0x4000; +pub const HWND_TOP: HWND = 0 as HWND; +pub const HWND_BOTTOM: HWND = 1 as HWND; +pub const HWND_TOPMOST: HWND = -1isize as HWND; +pub const HWND_NOTOPMOST: HWND = -2isize as HWND; +// FIXME packed(2) +STRUCT!{#[repr(packed)] struct DLGTEMPLATE { + style: DWORD, + dwExtendedStyle: DWORD, + cdit: WORD, + x: c_short, + y: c_short, + cx: c_short, + cy: c_short, +}} +pub type LPDLGTEMPLATEA = *mut DLGTEMPLATE; +pub type LPDLGTEMPLATEW = *mut DLGTEMPLATE; +pub type LPCDLGTEMPLATEA = *const DLGTEMPLATE; +pub type LPCDLGTEMPLATEW = *const DLGTEMPLATE; +// FIXME packed(2) +STRUCT!{#[repr(packed)] struct DLGITEMTEMPLATE { + style: DWORD, + dwExtendedStyle: DWORD, + x: c_short, + y: c_short, + cx: c_short, + cy: c_short, + id: WORD, +}} +pub type PDLGITEMTEMPLATEA = *mut DLGITEMTEMPLATE; +pub type PDLGITEMTEMPLATEW = *mut DLGITEMTEMPLATE; +pub type LPDLGITEMTEMPLATEA = *mut DLGITEMTEMPLATE; +pub type LPDLGITEMTEMPLATEW = *mut DLGITEMTEMPLATE; +extern "system" { + pub fn CreateDialogParamA( + hInstance: HINSTANCE, + lpTemplateName: LPCSTR, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> HWND; + pub fn CreateDialogParamW( + hInstance: HINSTANCE, + lpTemplateName: LPCWSTR, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> HWND; + pub fn CreateDialogIndirectParamA( + hInstance: HINSTANCE, + lpTemplate: LPCDLGTEMPLATEA, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> HWND; + pub fn CreateDialogIndirectParamW( + hInstance: HINSTANCE, + lpTemplate: LPCDLGTEMPLATEW, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> HWND; +} +// CreateDialogA +// CreateDialogW +// CreateDialogIndirectA +// CreateDialogIndirectW +extern "system" { + pub fn DialogBoxParamA( + hInstance: HINSTANCE, + lpTemplateName: LPCSTR, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> INT_PTR; + pub fn DialogBoxParamW( + hInstance: HINSTANCE, + lpTemplateName: LPCWSTR, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> INT_PTR; + pub fn DialogBoxIndirectParamA( + hInstance: HINSTANCE, + hDialogTemplate: LPCDLGTEMPLATEA, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> INT_PTR; + pub fn DialogBoxIndirectParamW( + hInstance: HINSTANCE, + hDialogTemplate: LPCDLGTEMPLATEW, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> INT_PTR; +} +// DialogBoxA +// DialogBoxW +// DialogBoxIndirectA +// DialogBoxIndirectW +extern "system" { + pub fn EndDialog( + hDlg: HWND, + nResult: INT_PTR, + ) -> BOOL; + pub fn GetDlgItem( + hDlg: HWND, + nIDDlgItem: c_int, + ) -> HWND; + pub fn SetDlgItemInt( + hDlg: HWND, + nIDDlgItem: c_int, + uValue: UINT, + bSigned: BOOL, + ) -> BOOL; + pub fn GetDlgItemInt( + hDlg: HWND, + nIDDlgItem: c_int, + lpTranslated: *mut BOOL, + bSigned: BOOL, + ) -> UINT; + pub fn SetDlgItemTextA( + hDlg: HWND, + nIDDlgItem: c_int, + lpString: LPCSTR, + ) -> BOOL; + pub fn SetDlgItemTextW( + hDlg: HWND, + nIDDlgItem: c_int, + lpString: LPCWSTR, + ) -> BOOL; + pub fn GetDlgItemTextA( + hDlg: HWND, + nIDDlgItem: c_int, + lpString: LPSTR, + nMaxCount: c_int, + ) -> UINT; + pub fn GetDlgItemTextW( + hDlg: HWND, + nIDDlgItem: c_int, + lpString: LPWSTR, + nMaxCount: c_int, + ) -> UINT; + pub fn CheckDlgButton( + hDlg: HWND, + nIDButton: c_int, + uCheck: UINT, + ) -> BOOL; + pub fn CheckRadioButton( + hDlg: HWND, + nIDFirstButton: c_int, + nIDLasatButton: c_int, + nIDCheckButton: c_int, + ) -> BOOL; + pub fn IsDlgButtonChecked( + hDlg: HWND, + nIDButton: c_int, + ) -> UINT; + pub fn SendDlgItemMessageA( + hDlg: HWND, + nIDDlgItem: c_int, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn SendDlgItemMessageW( + hDlg: HWND, + nIDDlgItem: c_int, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn GetNextDlgGroupItem( + hDlg: HWND, + hCtl: HWND, + bPrevious: BOOL, + ) -> HWND; + pub fn GetNextDlgTabItem( + hDlg: HWND, + hCtl: HWND, + bPrevious: BOOL, + ) -> HWND; + pub fn GetDlgCtrlID( + hwnd: HWND, + ) -> c_int; + pub fn GetDialogBaseUnits() -> LONG; + pub fn DefDlgProcA( + hDlg: HWND, + msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn DefDlgProcW( + hDlg: HWND, + msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; +} +ENUM!{enum DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS { + DCDC_DEFAULT = 0x0000, + DCDC_DISABLE_FONT_UPDATE = 0x0001, + DCDC_DISABLE_RELAYOUT = 0x0002, +}} +extern "system" { + pub fn SetDialogControlDpiChangeBehavior( + hwnd: HWND, + mask: DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS, + values: DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS, + ) -> BOOL; + pub fn GetDialogControlDpiChangeBehavior( + hwnd: HWND, + ) -> DIALOG_CONTROL_DPI_CHANGE_BEHAVIORS; +} +ENUM!{enum DIALOG_DPI_CHANGE_BEHAVIORS { + DDC_DEFAULT = 0x0000, + DDC_DISABLE_ALL = 0x0001, + DDC_DISABLE_RESIZE = 0x0002, + DDC_DISABLE_CONTROL_RELAYOUT = 0x0004, +}} +extern "system" { + pub fn SetDialogDpiChangeBehavior( + hDlg: HWND, + mask: DIALOG_DPI_CHANGE_BEHAVIORS, + values: DIALOG_DPI_CHANGE_BEHAVIORS, + ) -> BOOL; + pub fn GetDialogDpiChangeBehavior( + hDlg: HWND, + ) -> DIALOG_DPI_CHANGE_BEHAVIORS; + pub fn CallMsgFilterA( + lpMsg: LPMSG, + nCode: c_int, + ) -> BOOL; + pub fn CallMsgFilterW( + lpMsg: LPMSG, + nCode: c_int, + ) -> BOOL; + pub fn OpenClipboard( + hWnd: HWND, + ) -> BOOL; + pub fn CloseClipboard() -> BOOL; + pub fn GetClipboardSequenceNumber() -> DWORD; + pub fn GetClipboardOwner() -> HWND; + pub fn SetClipboardViewer( + hWndNewViewer: HWND, + ) -> HWND; + pub fn GetClipboardViewer() -> HWND; + pub fn ChangeClipboardChain( + hwndRemove: HWND, + hwndNewNext: HWND, + ) -> BOOL; + pub fn SetClipboardData( + uFormat: UINT, + hMem: HANDLE, + ) -> HANDLE; + pub fn GetClipboardData( + uFormat: UINT, + ) -> HANDLE; + pub fn RegisterClipboardFormatA( + lpszFormat: LPCSTR, + ) -> UINT; + pub fn RegisterClipboardFormatW( + lpszFormat: LPCWSTR, + ) -> UINT; + pub fn CountClipboardFormats() -> c_int; + pub fn EnumClipboardFormats( + format: UINT, + ) -> UINT; + pub fn GetClipboardFormatNameA( + format: UINT, + lpszFormatName: LPSTR, + cchMaxCount: c_int, + ) -> c_int; + pub fn GetClipboardFormatNameW( + format: UINT, + lpszFormatName: LPWSTR, + cchMaxCount: c_int, + ) -> c_int; + pub fn EmptyClipboard() -> BOOL; + pub fn IsClipboardFormatAvailable( + format: UINT, + ) -> BOOL; + pub fn GetPriorityClipboardFormat( + paFormatPriorityList: *mut UINT, + cFormats: c_int, + ) -> c_int; + pub fn GetOpenClipboardWindow() -> HWND; + pub fn AddClipboardFormatListener( + hWnd: HWND, + ) -> BOOL; + pub fn RemoveClipboardFormatListener( + hWnd: HWND, + ) -> BOOL; + pub fn GetUpdatedClipboardFormats( + lpuiFormats: PUINT, + cFormats: UINT, + pcFormatsOUT: PUINT, + ) -> BOOL; + pub fn CharToOemA( + pSrc: LPCSTR, + pDst: LPSTR, + ) -> BOOL; + pub fn CharToOemW( + pSrc: LPCWSTR, + pDst: LPSTR, + ) -> BOOL; + pub fn OemToCharA( + pSrc: LPCSTR, + pDst: LPSTR, + ) -> BOOL; + pub fn OemToCharW( + pSrc: LPCSTR, + pDst: LPWSTR, + ) -> BOOL; + pub fn CharToOemBuffA( + lpszSrc: LPCSTR, + lpszDst: LPSTR, + cchDstLength: DWORD, + ) -> BOOL; + pub fn CharToOemBuffW( + lpszSrc: LPCWSTR, + lpszDst: LPSTR, + cchDstLength: DWORD, + ) -> BOOL; + pub fn OemToCharBuffA( + lpszSrc: LPCSTR, + lpszDst: LPSTR, + cchDstLength: DWORD, + ) -> BOOL; + pub fn OemToCharBuffW( + lpszSrc: LPCSTR, + lpszDst: LPWSTR, + cchDstLength: DWORD, + ) -> BOOL; + pub fn CharUpperA( + lpsz: LPSTR, + ) -> LPSTR; + pub fn CharUpperW( + lpsz: LPWSTR, + ) -> LPWSTR; + pub fn CharUpperBuffA( + lpsz: LPSTR, + cchLength: DWORD, + ) -> DWORD; + pub fn CharUpperBuffW( + lpsz: LPWSTR, + cchLength: DWORD, + ) -> DWORD; + pub fn CharLowerA( + lpsz: LPSTR, + ) -> LPSTR; + pub fn CharLowerW( + lpsz: LPWSTR, + ) -> LPWSTR; + pub fn CharLowerBuffA( + lpsz: LPSTR, + cchLength: DWORD, + ) -> DWORD; + pub fn CharLowerBuffW( + lpsz: LPWSTR, + cchLength: DWORD, + ) -> DWORD; + pub fn CharNextA( + lpsz: LPCSTR, + ) -> LPSTR; + pub fn CharNextW( + lpsz: LPCWSTR, + ) -> LPWSTR; + pub fn CharPrevA( + lpszStart: LPCSTR, + lpszCurrent: LPCSTR, + ) -> LPSTR; + pub fn CharPrevW( + lpszStart: LPCWSTR, + lpszCurrent: LPCWSTR, + ) -> LPWSTR; + pub fn CharNextExA( + codePage: WORD, + lpCurrentChar: LPSTR, + dwFlags: DWORD, + ) -> LPSTR; + pub fn CharPrevExA( + codePage: WORD, + lpStart: LPCSTR, + lpCurrentChar: LPCSTR, + dwFlags: DWORD, + ) -> LPSTR; +} +// AnsiToOem +// OemToAnsi +// AnsiToOemBuff +// OemToAnsiBuff +// AnsiUpper +// AnsiUpperBuff +// AnsiLower +// AnsiLowerBuff +// AnsiNext +// AnsiPrev +extern "system" { + pub fn IsCharAlphaA( + ch: CHAR, + ) -> BOOL; + pub fn IsCharAlphaW( + ch: WCHAR, + ) -> BOOL; + pub fn IsCharAlphaNumericA( + ch: CHAR, + ) -> BOOL; + pub fn IsCharAlphaNumericW( + ch: WCHAR, + ) -> BOOL; + pub fn IsCharUpperA( + ch: CHAR, + ) -> BOOL; + pub fn IsCharUpperW( + ch: WCHAR, + ) -> BOOL; + pub fn IsCharLowerA( + ch: CHAR, + ) -> BOOL; + pub fn IsCharLowerW( + ch: WCHAR, + ) -> BOOL; + pub fn SetFocus( + hWnd: HWND, + ) -> HWND; + pub fn GetActiveWindow() -> HWND; + pub fn GetFocus() -> HWND; + pub fn GetKBCodePage() -> UINT; + pub fn GetKeyState( + nVirtKey: c_int, + ) -> SHORT; + pub fn GetAsyncKeyState( + vKey: c_int, + ) -> SHORT; + pub fn GetKeyboardState( + lpKeyState: PBYTE, + ) -> BOOL; + pub fn SetKeyboardState( + lpKeyState: LPBYTE, + ) -> BOOL; + pub fn GetKeyNameTextA( + lparam: LONG, + lpString: LPSTR, + cchSize: c_int, + ) -> c_int; + pub fn GetKeyNameTextW( + lParam: LONG, + lpString: LPWSTR, + cchSize: c_int, + ) -> c_int; + pub fn GetKeyboardType( + nTypeFlag: c_int, + ) -> c_int; + pub fn ToAscii( + uVirtKey: UINT, + uScanCode: UINT, + lpKeyState: *const BYTE, + lpChar: LPWORD, + uFlags: UINT, + ) -> c_int; + pub fn ToAsciiEx( + uVirtKey: UINT, + uScanCode: UINT, + lpKeyState: *const BYTE, + lpChar: LPWORD, + uFlags: UINT, + dwhkl: HKL, + ) -> c_int; + pub fn ToUnicode( + wVirtKey: UINT, + wScanCode: UINT, + lpKeyState: *const BYTE, + lwszBuff: LPWSTR, + cchBuff: c_int, + wFlags: UINT, + ) -> c_int; + pub fn OemKeyScan( + wOemChar: WORD, + ) -> DWORD; + pub fn VkKeyScanA( + ch: CHAR, + ) -> SHORT; + pub fn VkKeyScanW( + ch: WCHAR, + ) -> SHORT; + pub fn VkKeyScanExA( + ch: CHAR, + dwhkl: HKL, + ) -> SHORT; + pub fn VkKeyScanExW( + ch: WCHAR, + dwhkl: HKL, + ) -> SHORT; +} +pub const KEYEVENTF_EXTENDEDKEY: DWORD = 0x0001; +pub const KEYEVENTF_KEYUP: DWORD = 0x0002; +pub const KEYEVENTF_UNICODE: DWORD = 0x0004; +pub const KEYEVENTF_SCANCODE: DWORD = 0x0008; +extern "system" { + pub fn keybd_event( + bVk: BYTE, + bScan: BYTE, + dwFlags: DWORD, + dwExtraInfo: ULONG_PTR, + ); +} +pub const MOUSEEVENTF_MOVE: DWORD = 0x0001; +pub const MOUSEEVENTF_LEFTDOWN: DWORD = 0x0002; +pub const MOUSEEVENTF_LEFTUP: DWORD = 0x0004; +pub const MOUSEEVENTF_RIGHTDOWN: DWORD = 0x0008; +pub const MOUSEEVENTF_RIGHTUP: DWORD = 0x0010; +pub const MOUSEEVENTF_MIDDLEDOWN: DWORD = 0x0020; +pub const MOUSEEVENTF_MIDDLEUP: DWORD = 0x0040; +pub const MOUSEEVENTF_XDOWN: DWORD = 0x0080; +pub const MOUSEEVENTF_XUP: DWORD = 0x0100; +pub const MOUSEEVENTF_WHEEL: DWORD = 0x0800; +pub const MOUSEEVENTF_HWHEEL: DWORD = 0x01000; +pub const MOUSEEVENTF_MOVE_NOCOALESCE: DWORD = 0x2000; +pub const MOUSEEVENTF_VIRTUALDESK: DWORD = 0x4000; +pub const MOUSEEVENTF_ABSOLUTE: DWORD = 0x8000; +extern "system" { + pub fn mouse_event( + dwFlags: DWORD, + dx: DWORD, + dy: DWORD, + dwData: DWORD, + dwExtraInfo: ULONG_PTR, + ); +} +STRUCT!{struct MOUSEINPUT { + dx: LONG, + dy: LONG, + mouseData: DWORD, + dwFlags: DWORD, + time: DWORD, + dwExtraInfo: ULONG_PTR, +}} +pub type PMOUSEINPUT = *mut MOUSEINPUT; +pub type LPMOUSEINPUT = *mut MOUSEINPUT; +STRUCT!{struct KEYBDINPUT { + wVk: WORD, + wScan: WORD, + dwFlags: DWORD, + time: DWORD, + dwExtraInfo: ULONG_PTR, +}} +pub type PKEYBDINPUT = *mut KEYBDINPUT; +pub type LPKEYBDINPUT = *mut KEYBDINPUT; +STRUCT!{struct HARDWAREINPUT { + uMsg: DWORD, + wParamL: WORD, + wParamH: WORD, +}} +pub type PHARDWAREINPUT = *mut HARDWAREINPUT; +pub type LPHARDWAREINPUT= *mut HARDWAREINPUT; +pub const INPUT_MOUSE: DWORD = 0; +pub const INPUT_KEYBOARD: DWORD = 1; +pub const INPUT_HARDWARE: DWORD = 2; +UNION!{union INPUT_u { + [u32; 6] [u64; 4], + mi mi_mut: MOUSEINPUT, + ki ki_mut: KEYBDINPUT, + hi hi_mut: HARDWAREINPUT, +}} +STRUCT!{struct INPUT { + type_: DWORD, + u: INPUT_u, +}} +pub type PINPUT = *mut INPUT; +pub type LPINPUT = *mut INPUT; +extern "system" { + pub fn SendInput( + cInputs: UINT, + pInputs: LPINPUT, + cbSize: c_int, + ) -> UINT; +} +DECLARE_HANDLE!{HTOUCHINPUT, HTOUCHINPUT__} +STRUCT!{struct TOUCHINPUT { + x: LONG, + y: LONG, + hSource: HANDLE, + dwID: DWORD, + dwFlags: DWORD, + dwMask: DWORD, + dwTime: DWORD, + dwExtraInfo: ULONG_PTR, + cxContact: DWORD, + cyContact: DWORD, +}} +pub type PTOUCHINPUT = *mut TOUCHINPUT; +pub type PCTOUCHINPUT = *const TOUCHINPUT; +// TOUCH_COORD_TO_PIXEL +pub const TOUCHEVENTF_MOVE: DWORD = 0x0001; +pub const TOUCHEVENTF_DOWN: DWORD = 0x0002; +pub const TOUCHEVENTF_UP: DWORD = 0x0004; +pub const TOUCHEVENTF_INRANGE: DWORD = 0x0008; +pub const TOUCHEVENTF_PRIMARY: DWORD = 0x0010; +pub const TOUCHEVENTF_NOCOALESCE: DWORD = 0x0020; +pub const TOUCHEVENTF_PEN: DWORD = 0x0040; +pub const TOUCHEVENTF_PALM: DWORD = 0x0080; +pub const TOUCHINPUTMASKF_TIMEFROMSYSTEM: DWORD = 0x0001; +pub const TOUCHINPUTMASKF_EXTRAINFO: DWORD = 0x0002; +pub const TOUCHINPUTMASKF_CONTACTAREA: DWORD = 0x0004; +extern "system" { + pub fn GetTouchInputInfo( + hTouchInput: HTOUCHINPUT, + cInputs: c_uint, + pInputs: PTOUCHINPUT, + cbSize: c_int, + ) -> BOOL; + pub fn CloseTouchInputHandle( + hTouchInput: HTOUCHINPUT, + ) -> BOOL; +} +pub const TWF_FINETOUCH: DWORD = 0x00000001; +pub const TWF_WANTPALM: DWORD = 0x00000002; +extern "system" { + pub fn RegisterTouchWindow( + hWnd: HWND, + flags: ULONG, + ) -> BOOL; + pub fn UnregisterTouchWindow( + hwnd: HWND, + ) -> BOOL; + pub fn IsTouchWindow( + hwnd: HWND, + pulFlags: PULONG, + ) -> BOOL; +} +ENUM!{enum POINTER_INPUT_TYPE { + PT_POINTER = 0x00000001, + PT_TOUCH = 0x00000002, + PT_PEN = 0x00000003, + PT_MOUSE = 0x00000004, + PT_TOUCHPAD = 0x00000005, +}} +ENUM!{enum POINTER_FLAGS { + POINTER_FLAG_NONE = 0x00000000, + POINTER_FLAG_NEW = 0x00000001, + POINTER_FLAG_INRANGE = 0x00000002, + POINTER_FLAG_INCONTACT = 0x00000004, + POINTER_FLAG_FIRSTBUTTON = 0x00000010, + POINTER_FLAG_SECONDBUTTON = 0x00000020, + POINTER_FLAG_THIRDBUTTON = 0x00000040, + POINTER_FLAG_FOURTHBUTTON = 0x00000080, + POINTER_FLAG_FIFTHBUTTON = 0x00000100, + POINTER_FLAG_PRIMARY = 0x00002000, + POINTER_FLAG_CONFIDENCE = 0x00004000, + POINTER_FLAG_CANCELED = 0x00008000, + POINTER_FLAG_DOWN = 0x00010000, + POINTER_FLAG_UPDATE = 0x00020000, + POINTER_FLAG_UP = 0x00040000, + POINTER_FLAG_WHEEL = 0x00080000, + POINTER_FLAG_HWHEEL = 0x00100000, + POINTER_FLAG_CAPTURECHANGED = 0x00200000, + POINTER_FLAG_HASTRANSFORM = 0x00400000, +}} +pub const POINTER_MOD_SHIFT: DWORD = 0x0004; +pub const POINTER_MOD_CTRL: DWORD = 0x0008; +ENUM!{enum POINTER_BUTTON_CHANGE_TYPE { + POINTER_CHANGE_NONE, + POINTER_CHANGE_FIRSTBUTTON_DOWN, + POINTER_CHANGE_FIRSTBUTTON_UP, + POINTER_CHANGE_SECONDBUTTON_DOWN, + POINTER_CHANGE_SECONDBUTTON_UP, + POINTER_CHANGE_THIRDBUTTON_DOWN, + POINTER_CHANGE_THIRDBUTTON_UP, + POINTER_CHANGE_FOURTHBUTTON_DOWN, + POINTER_CHANGE_FOURTHBUTTON_UP, + POINTER_CHANGE_FIFTHBUTTON_DOWN, + POINTER_CHANGE_FIFTHBUTTON_UP, +}} +STRUCT!{struct POINTER_INFO { + pointerType: POINTER_INPUT_TYPE, + pointerId: UINT32, + frameId: UINT32, + pointerFlags: POINTER_FLAGS, + sourceDevice: HANDLE, + hwndTarget: HWND, + ptPixelLocation: POINT, + ptHimetricLocation: POINT, + ptPixelLocationRaw: POINT, + ptHimetricLocationRaw: POINT, + dwTime: DWORD, + historyCount: UINT32, + InputData: INT32, + dwKeyStates: DWORD, + PerformanceCount: UINT64, + ButtonChangeType: POINTER_BUTTON_CHANGE_TYPE, +}} +ENUM!{enum TOUCH_FLAGS { + TOUCH_FLAG_NONE = 0x00000000, +}} +ENUM!{enum TOUCH_MASK { + TOUCH_MASK_NONE = 0x00000000, + TOUCH_MASK_CONTACTAREA = 0x00000001, + TOUCH_MASK_ORIENTATION = 0x00000002, + TOUCH_MASK_PRESSURE = 0x00000004, +}} +STRUCT!{struct POINTER_TOUCH_INFO { + pointerInfo: POINTER_INFO, + touchFlags: TOUCH_FLAGS, + touchMask: TOUCH_MASK, + rcContact: RECT, + rcContactRaw: RECT, + orientation: UINT32, + pressure: UINT32, +}} +ENUM!{enum PEN_FLAGS { + PEN_FLAG_NONE = 0x00000000, + PEN_FLAG_BARREL = 0x00000001, + PEN_FLAG_INVERTED = 0x00000002, + PEN_FLAG_ERASER = 0x00000004, +}} +ENUM!{enum PEN_MASK { + PEN_MASK_NONE = 0x00000000, + PEN_MASK_PRESSURE = 0x00000001, + PEN_MASK_ROTATION = 0x00000002, + PEN_MASK_TILT_X = 0x00000004, + PEN_MASK_TILT_Y = 0x00000008, +}} +STRUCT!{struct POINTER_PEN_INFO { + pointerInfo: POINTER_INFO, + penFlags: PEN_FLAGS, + penMask: PEN_MASK, + pressure: UINT32, + rotation: UINT32, + tiltX: INT32, + tiltY: INT32, +}} +pub const POINTER_MESSAGE_FLAG_NEW: DWORD = 0x00000001; +pub const POINTER_MESSAGE_FLAG_INRANGE: DWORD = 0x00000002; +pub const POINTER_MESSAGE_FLAG_INCONTACT: DWORD = 0x00000004; +pub const POINTER_MESSAGE_FLAG_FIRSTBUTTON: DWORD = 0x00000010; +pub const POINTER_MESSAGE_FLAG_SECONDBUTTON: DWORD = 0x00000020; +pub const POINTER_MESSAGE_FLAG_THIRDBUTTON: DWORD = 0x00000040; +pub const POINTER_MESSAGE_FLAG_FOURTHBUTTON: DWORD = 0x00000080; +pub const POINTER_MESSAGE_FLAG_FIFTHBUTTON: DWORD = 0x00000100; +pub const POINTER_MESSAGE_FLAG_PRIMARY: DWORD = 0x00002000; +pub const POINTER_MESSAGE_FLAG_CONFIDENCE: DWORD = 0x00004000; +pub const POINTER_MESSAGE_FLAG_CANCELED: DWORD = 0x00008000; +pub const PA_ACTIVATE: UINT = MA_ACTIVATE; +pub const PA_NOACTIVATE: UINT = MA_NOACTIVATE; +pub const MAX_TOUCH_COUNT: UINT32 = 256; +pub const TOUCH_FEEDBACK_DEFAULT: DWORD = 0x1; +pub const TOUCH_FEEDBACK_INDIRECT: DWORD = 0x2; +pub const TOUCH_FEEDBACK_NONE: DWORD = 0x3; +ENUM!{enum POINTER_FEEDBACK_MODE { + POINTER_FEEDBACK_DEFAULT = 1, + POINTER_FEEDBACK_INDIRECT = 2, + POINTER_FEEDBACK_NONE = 3, +}} +extern "system" { + pub fn InitializeTouchInjection( + maxCount: UINT32, + dwMode: DWORD, + ) -> BOOL; + pub fn InjectTouchInput( + count: UINT32, + contacts: *const POINTER_TOUCH_INFO, + ) -> BOOL; +} +STRUCT!{struct USAGE_PROPERTIES { + level: USHORT, + page: USHORT, + usage: USHORT, + logicalMinimum: INT32, + logicalMaximum: INT32, + unit: USHORT, + exponent: USHORT, + count: BYTE, + physicalMinimum: INT32, + physicalMaximum: INT32, +}} +pub type PUSAGE_PROPERTIES = *mut USAGE_PROPERTIES; +UNION!{union POINTER_TYPE_INFO_u { + [u64; 17] [u64; 18], + touchInfo touchInfo_mut: POINTER_TOUCH_INFO, + penInfo penInfo_mut: POINTER_PEN_INFO, +}} +STRUCT!{struct POINTER_TYPE_INFO { + type_: POINTER_INPUT_TYPE, + u: POINTER_TYPE_INFO_u, +}} +pub type PPOINTER_TYPE_INFO = *mut POINTER_TYPE_INFO; +STRUCT!{struct INPUT_INJECTION_VALUE { + page: USHORT, + usage: USHORT, + value: INT32, + index: USHORT, +}} +pub type PINPUT_INJECTION_VALUE = *mut INPUT_INJECTION_VALUE; +extern "system" { + pub fn GetPointerType( + pointerId: UINT32, + pointerType: *mut POINTER_INPUT_TYPE, + ) -> BOOL; + pub fn GetPointerCursorId( + pointerId: UINT32, + cursorId: *mut UINT32, + ) -> BOOL; + pub fn GetPointerInfo( + pointerId: UINT32, + pointerInfo: *mut POINTER_INFO, + ) -> BOOL; + pub fn GetPointerInfoHistory( + pointerId: UINT32, + entriesCount: *mut UINT32, + pointerInfo: *mut POINTER_INFO, + ) -> BOOL; + pub fn GetPointerFrameInfo( + pointerId: UINT32, + pointerCount: *mut UINT32, + pointerInfo: *mut POINTER_INFO, + ) -> BOOL; + pub fn GetPointerFrameInfoHistory( + pointerId: UINT32, + entriesCount: *mut UINT32, + pointerCount: *mut UINT32, + pointerInfo: *mut POINTER_INFO, + ) -> BOOL; + pub fn GetPointerTouchInfo( + pointerId: UINT32, + touchInfo: *mut POINTER_TOUCH_INFO, + ) -> BOOL; + pub fn GetPointerTouchInfoHistory( + pointerId: UINT32, + entriesCount: *mut UINT32, + touchInfo: *mut POINTER_TOUCH_INFO, + ) -> BOOL; + pub fn GetPointerFrameTouchInfo( + pointerId: UINT32, + pointerCount: *mut UINT32, + touchInfo: *mut POINTER_TOUCH_INFO, + ) -> BOOL; + pub fn GetPointerFrameTouchInfoHistory( + pointerId: UINT32, + entriesCount: *mut UINT32, + pointerCount: *mut UINT32, + touchInfo: *mut POINTER_TOUCH_INFO, + ) -> BOOL; + pub fn GetPointerPenInfo( + pointerId: UINT32, + penInfo: *mut POINTER_PEN_INFO, + ) -> BOOL; + pub fn GetPointerPenInfoHistory( + pointerId: UINT32, + entriesCount: *mut UINT32, + penInfo: *mut POINTER_PEN_INFO, + ) -> BOOL; + pub fn GetPointerFramePenInfo( + pointerId: UINT32, + pointerCount: *mut UINT32, + penInfo: *mut POINTER_PEN_INFO, + ) -> BOOL; + pub fn GetPointerFramePenInfoHistory( + pointerId: UINT32, + entriesCount: *mut UINT32, + pointerCount: *mut UINT32, + penInfo: *mut POINTER_PEN_INFO, + ) -> BOOL; + pub fn SkipPointerFrameMessages( + pointerId: UINT32, + ) -> BOOL; + pub fn RegisterPointerInputTarget( + hwnd: HWND, + pointerType: POINTER_INPUT_TYPE, + ) -> BOOL; + pub fn UnregisterPointerInputTarget( + hwnd: HWND, + pointerType: POINTER_INPUT_TYPE, + ) -> BOOL; + pub fn RegisterPointerInputTargetEx( + hwnd: HWND, + pointerType: POINTER_INPUT_TYPE, + fObserve: BOOL, + ) -> BOOL; + pub fn UnregisterPointerInputTargetEx( + hwnd: HWND, + pointerType: POINTER_INPUT_TYPE, + ) -> BOOL; +} +DECLARE_HANDLE!{HSYNTHETICPOINTERDEVICE, HSYNTHETICPOINTERDEVICE__} +extern "system" { + pub fn CreateSyntheticPointerDevice( + pointerType: POINTER_INPUT_TYPE, + maxCount: ULONG, + mode: POINTER_FEEDBACK_MODE, + ) -> HSYNTHETICPOINTERDEVICE; + pub fn InjectSyntheticPointerInput( + device: HSYNTHETICPOINTERDEVICE, + pointerInfo: *const POINTER_TYPE_INFO, + count: UINT32, + ) -> BOOL; + pub fn DestroySyntheticPointerDevice( + device: HSYNTHETICPOINTERDEVICE, + ); +} +extern "system" { + pub fn EnableMouseInPointer( + fEnable: BOOL, + ) -> BOOL; + pub fn IsMouseInPointerEnabled() -> BOOL; +} +pub const TOUCH_HIT_TESTING_DEFAULT: ULONG = 0x0; +pub const TOUCH_HIT_TESTING_CLIENT: ULONG = 0x1; +pub const TOUCH_HIT_TESTING_NONE: ULONG = 0x2; +extern "system" { + pub fn RegisterTouchHitTestingWindow( + hwnd: HWND, + value: ULONG, + ) -> BOOL; +} +STRUCT!{struct TOUCH_HIT_TESTING_PROXIMITY_EVALUATION { + score: UINT16, + adjustedPoint: POINT, +}} +pub type PTOUCH_HIT_TESTING_PROXIMITY_EVALUATION = *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION; +STRUCT!{struct TOUCH_HIT_TESTING_INPUT { + pointerId: UINT32, + point: POINT, + boundingBox: RECT, + nonOccludedBoundingBox: RECT, + orientation: UINT32, +}} +pub type PTOUCH_HIT_TESTING_INPUT = *mut TOUCH_HIT_TESTING_INPUT; +pub const TOUCH_HIT_TESTING_PROXIMITY_CLOSEST: UINT16 = 0x0; +pub const TOUCH_HIT_TESTING_PROXIMITY_FARTHEST: UINT16 = 0xFFF; +extern "system" { + pub fn EvaluateProximityToRect( + controlBoundingBox: *const RECT, + pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT, + pProximityEval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION, + ) -> BOOL; + pub fn EvaluateProximityToPolygon( + numVertices: UINT32, + controlPolygon: *const POINT, + pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT, + pProximityEval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION, + ) -> BOOL; + pub fn PackTouchHitTestingProximityEvaluation( + pHitTestingInput: *const TOUCH_HIT_TESTING_INPUT, + pProximityEval: *const TOUCH_HIT_TESTING_PROXIMITY_EVALUATION, + ) -> LRESULT; +} +ENUM!{enum FEEDBACK_TYPE { + FEEDBACK_TOUCH_CONTACTVISUALIZATION = 1, + FEEDBACK_PEN_BARRELVISUALIZATION = 2, + FEEDBACK_PEN_TAP = 3, + FEEDBACK_PEN_DOUBLETAP = 4, + FEEDBACK_PEN_PRESSANDHOLD = 5, + FEEDBACK_PEN_RIGHTTAP = 6, + FEEDBACK_TOUCH_TAP = 7, + FEEDBACK_TOUCH_DOUBLETAP = 8, + FEEDBACK_TOUCH_PRESSANDHOLD = 9, + FEEDBACK_TOUCH_RIGHTTAP = 10, + FEEDBACK_GESTURE_PRESSANDTAP = 11, + FEEDBACK_MAX = 0xFFFFFFFF, +}} +pub const GWFS_INCLUDE_ANCESTORS: DWORD = 0x00000001; +extern "system" { + pub fn GetWindowFeedbackSetting( + hwnd: HWND, + feedback: FEEDBACK_TYPE, + dwFlags: DWORD, + pSize: *mut UINT32, + config: *mut VOID, + ) -> BOOL; + pub fn SetWindowFeedbackSetting( + hwnd: HWND, + feedback: FEEDBACK_TYPE, + dwFlags: DWORD, + size: UINT32, + configuration: *const VOID, + ) -> BOOL; +} +STRUCT!{struct INPUT_TRANSFORM { + m: [[f32; 4]; 4], +}} +extern "system" { + pub fn GetPointerInputTransform( + pointerId: UINT32, + historyCount: UINT32, + inputTransform: *mut INPUT_TRANSFORM, + ) -> BOOL; +} +STRUCT!{struct LASTINPUTINFO { + cbSize: UINT, + dwTime: DWORD, +}} +pub type PLASTINPUTINFO = *mut LASTINPUTINFO; +extern "system" { + pub fn GetLastInputInfo( + plii: PLASTINPUTINFO, + ) -> BOOL; + pub fn MapVirtualKeyA( + nCode: UINT, + uMapType: UINT, + ) -> UINT; + pub fn MapVirtualKeyW( + nCode: UINT, + uMapType: UINT, + ) -> UINT; + pub fn MapVirtualKeyExA( + nCode: UINT, + uMapType: UINT, + dwhkl: HKL, + ) -> UINT; + pub fn MapVirtualKeyExW( + nCode: UINT, + uMapType: UINT, + dwhkl: HKL, + ) -> UINT; +} +pub const MAPVK_VK_TO_VSC: UINT = 0; +pub const MAPVK_VSC_TO_VK: UINT = 1; +pub const MAPVK_VK_TO_CHAR: UINT = 2; +pub const MAPVK_VSC_TO_VK_EX: UINT = 3; +pub const MAPVK_VK_TO_VSC_EX: UINT = 4; +extern "system" { + pub fn GetInputState() -> BOOL; + pub fn GetQueueStatus( + flags: UINT, + ) -> DWORD; + pub fn GetCapture() -> HWND; + pub fn SetCapture( + hWnd: HWND, + ) -> HWND; + pub fn ReleaseCapture() -> BOOL; + pub fn MsgWaitForMultipleObjects( + nCount: DWORD, + pHandles: *const HANDLE, + fWaitAll: BOOL, + dwMilliseconds: DWORD, + dwWakeMask: DWORD, + ) -> DWORD; + pub fn MsgWaitForMultipleObjectsEx( + nCount: DWORD, + pHandles: *const HANDLE, + dwMilliseconds: DWORD, + dwWakeMask: DWORD, + dwFlags: DWORD, + ) -> DWORD; +} +pub const MWMO_WAITALL: UINT = 0x0001; +pub const MWMO_ALERTABLE: UINT = 0x0002; +pub const MWMO_INPUTAVAILABLE: UINT = 0x0004; +pub const QS_KEY: UINT = 0x0001; +pub const QS_MOUSEMOVE: UINT = 0x0002; +pub const QS_MOUSEBUTTON: UINT = 0x0004; +pub const QS_POSTMESSAGE: UINT = 0x0008; +pub const QS_TIMER: UINT = 0x0010; +pub const QS_PAINT: UINT = 0x0020; +pub const QS_SENDMESSAGE: UINT = 0x0040; +pub const QS_HOTKEY: UINT = 0x0080; +pub const QS_ALLPOSTMESSAGE: UINT = 0x0100; +pub const QS_RAWINPUT: UINT = 0x0400; +pub const QS_TOUCH: UINT = 0x0800; +pub const QS_POINTER: UINT = 0x1000; +pub const QS_MOUSE: UINT = QS_MOUSEMOVE | QS_MOUSEBUTTON; +pub const QS_INPUT: UINT = QS_MOUSE | QS_KEY | QS_RAWINPUT | QS_TOUCH | QS_POINTER; +pub const QS_ALLEVENTS: UINT = QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY; +pub const QS_ALLINPUT: UINT = QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY + | QS_SENDMESSAGE; +pub const USER_TIMER_MAXIMUM: UINT = 0x7FFFFFFF; +pub const USER_TIMER_MINIMUM: UINT = 0x0000000A; +extern "system" { + pub fn SetTimer( + hWnd: HWND, + nIDEvent: UINT_PTR, + uElapse: UINT, + lpTimerFunc: TIMERPROC, + ) -> UINT_PTR; +} +pub const TIMERV_DEFAULT_COALESCING: ULONG = 0; +pub const TIMERV_NO_COALESCING: ULONG = 0xFFFFFFFF; +pub const TIMERV_COALESCING_MIN: ULONG = 1; +pub const TIMERV_COALESCING_MAX: ULONG = 0x7FFFFFF5; +extern "system" { + pub fn SetCoalescableTimer( + hWnd: HWND, + nIDEvent: UINT_PTR, + uElapse: UINT, + lpTimerFunc: TIMERPROC, + uToleranceDelay: ULONG, + ) -> UINT_PTR; + pub fn KillTimer( + hWnd: HWND, + uIDEvent: UINT_PTR, + ) -> BOOL; + pub fn IsWindowUnicode( + hWnd: HWND, + ) -> BOOL; + pub fn EnableWindow( + hWnd: HWND, + bEnable: BOOL, + ) -> BOOL; + pub fn IsWindowEnabled( + hWnd: HWND, + ) -> BOOL; + pub fn LoadAcceleratorsA( + hInstance: HINSTANCE, + lpTableName: LPCSTR, + ) -> HACCEL; + pub fn LoadAcceleratorsW( + hInstance: HINSTANCE, + lpTableName: LPCWSTR, + ) -> HACCEL; + pub fn CreateAcceleratorTableA( + paccel: LPACCEL, + cAccel: c_int, + ) -> HACCEL; + pub fn CreateAcceleratorTableW( + paccel: LPACCEL, + cAccel: c_int, + ) -> HACCEL; + pub fn DestroyAcceleratorTable( + hAccel: HACCEL, + ) -> BOOL; + pub fn CopyAcceleratorTableA( + hAccelSrc: HACCEL, + lpAccelDst: LPACCEL, + cAccelEntries: c_int, + ) -> c_int; + pub fn CopyAcceleratorTableW( + hAccelSrc: HACCEL, + lpAccelDst: LPACCEL, + cAccelEntries: c_int, + ) -> c_int; + pub fn TranslateAcceleratorA( + hWnd: HWND, + hAccTable: HACCEL, + lpMsg: LPMSG, + ) -> c_int; + pub fn TranslateAcceleratorW( + hWnd: HWND, + hAccTable: HACCEL, + lpMsg: LPMSG, + ) -> c_int; +} +pub const SM_CXSCREEN: c_int = 0; +pub const SM_CYSCREEN: c_int = 1; +pub const SM_CXVSCROLL: c_int = 2; +pub const SM_CYHSCROLL: c_int = 3; +pub const SM_CYCAPTION: c_int = 4; +pub const SM_CXBORDER: c_int = 5; +pub const SM_CYBORDER: c_int = 6; +pub const SM_CXDLGFRAME: c_int = 7; +pub const SM_CYDLGFRAME: c_int = 8; +pub const SM_CYVTHUMB: c_int = 9; +pub const SM_CXHTHUMB: c_int = 10; +pub const SM_CXICON: c_int = 11; +pub const SM_CYICON: c_int = 12; +pub const SM_CXCURSOR: c_int = 13; +pub const SM_CYCURSOR: c_int = 14; +pub const SM_CYMENU: c_int = 15; +pub const SM_CXFULLSCREEN: c_int = 16; +pub const SM_CYFULLSCREEN: c_int = 17; +pub const SM_CYKANJIWINDOW: c_int = 18; +pub const SM_MOUSEPRESENT: c_int = 19; +pub const SM_CYVSCROLL: c_int = 20; +pub const SM_CXHSCROLL: c_int = 21; +pub const SM_DEBUG: c_int = 22; +pub const SM_SWAPBUTTON: c_int = 23; +pub const SM_RESERVED1: c_int = 24; +pub const SM_RESERVED2: c_int = 25; +pub const SM_RESERVED3: c_int = 26; +pub const SM_RESERVED4: c_int = 27; +pub const SM_CXMIN: c_int = 28; +pub const SM_CYMIN: c_int = 29; +pub const SM_CXSIZE: c_int = 30; +pub const SM_CYSIZE: c_int = 31; +pub const SM_CXFRAME: c_int = 32; +pub const SM_CYFRAME: c_int = 33; +pub const SM_CXMINTRACK: c_int = 34; +pub const SM_CYMINTRACK: c_int = 35; +pub const SM_CXDOUBLECLK: c_int = 36; +pub const SM_CYDOUBLECLK: c_int = 37; +pub const SM_CXICONSPACING: c_int = 38; +pub const SM_CYICONSPACING: c_int = 39; +pub const SM_MENUDROPALIGNMENT: c_int = 40; +pub const SM_PENWINDOWS: c_int = 41; +pub const SM_DBCSENABLED: c_int = 42; +pub const SM_CMOUSEBUTTONS: c_int = 43; +pub const SM_CXFIXEDFRAME: c_int = SM_CXDLGFRAME; +pub const SM_CYFIXEDFRAME: c_int = SM_CYDLGFRAME; +pub const SM_CXSIZEFRAME: c_int = SM_CXFRAME; +pub const SM_CYSIZEFRAME: c_int = SM_CYFRAME; +pub const SM_SECURE: c_int = 44; +pub const SM_CXEDGE: c_int = 45; +pub const SM_CYEDGE: c_int = 46; +pub const SM_CXMINSPACING: c_int = 47; +pub const SM_CYMINSPACING: c_int = 48; +pub const SM_CXSMICON: c_int = 49; +pub const SM_CYSMICON: c_int = 50; +pub const SM_CYSMCAPTION: c_int = 51; +pub const SM_CXSMSIZE: c_int = 52; +pub const SM_CYSMSIZE: c_int = 53; +pub const SM_CXMENUSIZE: c_int = 54; +pub const SM_CYMENUSIZE: c_int = 55; +pub const SM_ARRANGE: c_int = 56; +pub const SM_CXMINIMIZED: c_int = 57; +pub const SM_CYMINIMIZED: c_int = 58; +pub const SM_CXMAXTRACK: c_int = 59; +pub const SM_CYMAXTRACK: c_int = 60; +pub const SM_CXMAXIMIZED: c_int = 61; +pub const SM_CYMAXIMIZED: c_int = 62; +pub const SM_NETWORK: c_int = 63; +pub const SM_CLEANBOOT: c_int = 67; +pub const SM_CXDRAG: c_int = 68; +pub const SM_CYDRAG: c_int = 69; +pub const SM_SHOWSOUNDS: c_int = 70; +pub const SM_CXMENUCHECK: c_int = 71; +pub const SM_CYMENUCHECK: c_int = 72; +pub const SM_SLOWMACHINE: c_int = 73; +pub const SM_MIDEASTENABLED: c_int = 74; +pub const SM_MOUSEWHEELPRESENT: c_int = 75; +pub const SM_XVIRTUALSCREEN: c_int = 76; +pub const SM_YVIRTUALSCREEN: c_int = 77; +pub const SM_CXVIRTUALSCREEN: c_int = 78; +pub const SM_CYVIRTUALSCREEN: c_int = 79; +pub const SM_CMONITORS: c_int = 80; +pub const SM_SAMEDISPLAYFORMAT: c_int = 81; +pub const SM_IMMENABLED: c_int = 82; +pub const SM_CXFOCUSBORDER: c_int = 83; +pub const SM_CYFOCUSBORDER: c_int = 84; +pub const SM_TABLETPC: c_int = 86; +pub const SM_MEDIACENTER: c_int = 87; +pub const SM_STARTER: c_int = 88; +pub const SM_SERVERR2: c_int = 89; +pub const SM_MOUSEHORIZONTALWHEELPRESENT: c_int = 91; +pub const SM_CXPADDEDBORDER: c_int = 92; +pub const SM_DIGITIZER: c_int = 94; +pub const SM_MAXIMUMTOUCHES: c_int = 95; +pub const SM_CMETRICS: c_int = 97; +pub const SM_REMOTESESSION: c_int = 0x1000; +pub const SM_SHUTTINGDOWN: c_int = 0x2000; +pub const SM_REMOTECONTROL: c_int = 0x2001; +pub const SM_CARETBLINKINGENABLED: c_int = 0x2002; +pub const SM_CONVERTIBLESLATEMODE: c_int = 0x2003; +pub const SM_SYSTEMDOCKED: c_int = 0x2004; +extern "system" { + pub fn GetSystemMetrics( + nIndex: c_int, + ) -> c_int; + pub fn GetSystemMetricsForDpi( + nIndex: c_int, + dpi: UINT, + ) -> c_int; + pub fn LoadMenuA( + hInstance: HINSTANCE, + lpMenuName: LPCSTR, + ) -> HMENU; + pub fn LoadMenuW( + hInstance: HINSTANCE, + lpMenuName: LPCWSTR, + ) -> HMENU; + pub fn LoadMenuIndirectA( + lpMenuTemplate: *const MENUTEMPLATEA, + ) -> HMENU; + pub fn LoadMenuIndirectW( + lpMenuTemplate: *const MENUTEMPLATEW, + ) -> HMENU; + pub fn GetMenu( + hWnd: HWND, + ) -> HMENU; + pub fn SetMenu( + hWnd: HWND, + hMenu: HMENU, + ) -> BOOL; + pub fn ChangeMenuA( + hMenu: HMENU, + cmd: UINT, + lpszNewItem: LPCSTR, + cmdInsert: UINT, + flags: UINT, + ) -> BOOL; + pub fn ChangeMenuW( + hMenu: HMENU, + cmd: UINT, + lpszNewItem: LPCWSTR, + cmdInsert: UINT, + flags: UINT, + ) -> BOOL; + pub fn HiliteMenuItem( + hWnd: HWND, + hMenu: HMENU, + uIDHiliteItem: UINT, + uHilite: UINT, + ) -> BOOL; + pub fn GetMenuStringA( + hMenu: HMENU, + uIDItem: UINT, + lpString: LPSTR, + cchMax: c_int, + flags: UINT, + ) -> c_int; + pub fn GetMenuStringW( + hMenu: HMENU, + uIDItem: UINT, + lpString: LPWSTR, + cchMax: c_int, + flags: UINT, + ) -> c_int; + pub fn GetMenuState( + hMenu: HMENU, + uId: UINT, + uFlags: UINT, + ) -> UINT; + pub fn DrawMenuBar( + hwnd: HWND, + ) -> BOOL; +} +pub const PMB_ACTIVE: DWORD = 0x00000001; +extern "system" { + pub fn GetSystemMenu( + hWnd: HWND, + bRevert: BOOL, + ) -> HMENU; + pub fn CreateMenu() -> HMENU; + pub fn CreatePopupMenu() ->HMENU; + pub fn DestroyMenu( + hMenu: HMENU, + ) -> BOOL; + pub fn CheckMenuItem( + hMenu: HMENU, + uIDCheckItem: UINT, + uCheck: UINT, + ) -> DWORD; + pub fn EnableMenuItem( + hMenu: HMENU, + uIDEnableItem: UINT, + uEnable: UINT, + ) -> BOOL; + pub fn GetSubMenu( + hMenu: HMENU, + nPos: c_int, + ) -> HMENU; + pub fn GetMenuItemID( + hMenu: HMENU, + nPos: c_int, + ) -> UINT; + pub fn GetMenuItemCount( + hMenu: HMENU, + ) -> c_int; + pub fn InsertMenuA( + hMenu: HMENU, + uPosition: UINT, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCSTR, + ) -> BOOL; + pub fn InsertMenuW( + hMenu: HMENU, + uPosition: UINT, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCWSTR, + ) -> BOOL; + pub fn AppendMenuA( + hMenu: HMENU, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCSTR, + ) -> BOOL; + pub fn AppendMenuW( + hMenu: HMENU, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCWSTR, + ) -> BOOL; + pub fn ModifyMenuA( + hMnu: HMENU, + uPosition: UINT, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCSTR, + ) -> BOOL; + pub fn ModifyMenuW( + hMnu: HMENU, + uPosition: UINT, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCWSTR, + ) -> BOOL; + pub fn RemoveMenu( + hMenu: HMENU, + uPosition: UINT, + uFlags: UINT, + ) -> BOOL; + pub fn DeleteMenu( + hMenu: HMENU, + uPosition: UINT, + uFlags: UINT, + ) -> BOOL; + pub fn SetMenuItemBitmaps( + hMenu: HMENU, + uPosition: UINT, + uFlags: UINT, + hBitmapUnchecked: HBITMAP, + hBitmapChecked: HBITMAP, + ) -> BOOL; + pub fn GetMenuCheckMarkDimensions() -> LONG; + pub fn TrackPopupMenu( + hMenu: HMENU, + uFlags: UINT, + x: c_int, + y: c_int, + nReserved: c_int, + hWnd: HWND, + prcRect: *const RECT, + ) -> BOOL; +} +pub const MNC_IGNORE: DWORD = 0; +pub const MNC_CLOSE: DWORD = 1; +pub const MNC_EXECUTE: DWORD = 2; +pub const MNC_SELECT: DWORD = 3; +STRUCT!{struct TPMPARAMS { + cbSize: UINT, + rcExclude: RECT, +}} +pub type LPTPMPARAMS = *mut TPMPARAMS; +extern "system" { + pub fn TrackPopupMenuEx( + hMenu: HMENU, + uFlags: UINT, + x: INT, + y: INT, + hwnd: HWND, + lptpm: LPTPMPARAMS, + ) -> BOOL; + pub fn CalculatePopupWindowPosition( + anchorPoint: *const POINT, + windowSize: *const SIZE, + flags: UINT, + excludeRect: *mut RECT, + popupWindowPosition: *mut RECT, + ) -> BOOL; +} +pub const MNS_NOCHECK: DWORD = 0x80000000; +pub const MNS_MODELESS: DWORD = 0x40000000; +pub const MNS_DRAGDROP: DWORD = 0x20000000; +pub const MNS_AUTODISMISS: DWORD = 0x10000000; +pub const MNS_NOTIFYBYPOS: DWORD = 0x08000000; +pub const MNS_CHECKORBMP: DWORD = 0x04000000; +pub const MIM_MAXHEIGHT: DWORD = 0x00000001; +pub const MIM_BACKGROUND: DWORD = 0x00000002; +pub const MIM_HELPID: DWORD = 0x00000004; +pub const MIM_MENUDATA: DWORD = 0x00000008; +pub const MIM_STYLE: DWORD = 0x00000010; +pub const MIM_APPLYTOSUBMENUS: DWORD = 0x80000000; +STRUCT!{struct MENUINFO { + cbSize: DWORD, + fMask: DWORD, + dwStyle: DWORD, + cyMax: UINT, + hbrBack: HBRUSH, + dwContextHelpID: DWORD, + dwMenuData: ULONG_PTR, +}} +pub type LPMENUINFO = *mut MENUINFO; +pub type LPCMENUINFO = *const MENUINFO; +extern "system" { + pub fn GetMenuInfo( + hMenu: HMENU, + lpcmi: LPMENUINFO, + ) -> BOOL; + pub fn SetMenuInfo( + hMenu: HMENU, + lpcmi: LPCMENUINFO, + ) -> BOOL; + pub fn EndMenu( + hMenu: HMENU, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCSTR, + ) -> BOOL; +} +pub const MND_CONTINUE: DWORD = 0; +pub const MND_ENDMENU: DWORD = 1; +STRUCT!{struct MENUGETOBJECTINFO { + dwFlags: DWORD, + uPos: UINT, + hmenu: HMENU, + riid: PVOID, + pvObj: PVOID, +}} +pub type PMENUGETOBJECTINFO = *mut MENUGETOBJECTINFO; +pub const MNGOF_TOPGAP: DWORD = 0x00000001; +pub const MNGOF_BOTTOMGAP: DWORD = 0x00000002; +pub const MNGO_NOINTERFACE: DWORD = 0x00000000; +pub const MNGO_NOERROR: DWORD = 0x00000001; +pub const MIIM_STATE: DWORD = 0x00000001; +pub const MIIM_ID: DWORD = 0x00000002; +pub const MIIM_SUBMENU: DWORD = 0x00000004; +pub const MIIM_CHECKMARKS: DWORD = 0x00000008; +pub const MIIM_TYPE: DWORD = 0x00000010; +pub const MIIM_DATA: DWORD = 0x00000020; +pub const MIIM_STRING: DWORD = 0x00000040; +pub const MIIM_BITMAP: DWORD = 0x00000080; +pub const MIIM_FTYPE: DWORD = 0x00000100; +pub const HBMMENU_CALLBACK: HBITMAP = -1isize as HBITMAP; +pub const HBMMENU_SYSTEM: HBITMAP = 1 as HBITMAP; +pub const HBMMENU_MBAR_RESTORE: HBITMAP = 2 as HBITMAP; +pub const HBMMENU_MBAR_MINIMIZE: HBITMAP = 3 as HBITMAP; +pub const HBMMENU_MBAR_CLOSE: HBITMAP = 5 as HBITMAP; +pub const HBMMENU_MBAR_CLOSE_D: HBITMAP = 6 as HBITMAP; +pub const HBMMENU_MBAR_MINIMIZE_D: HBITMAP = 7 as HBITMAP; +pub const HBMMENU_POPUP_CLOSE: HBITMAP = 8 as HBITMAP; +pub const HBMMENU_POPUP_RESTORE: HBITMAP = 9 as HBITMAP; +pub const HBMMENU_POPUP_MAXIMIZE: HBITMAP = 10 as HBITMAP; +pub const HBMMENU_POPUP_MINIMIZE: HBITMAP = 11 as HBITMAP; +STRUCT!{struct MENUITEMINFOA { + cbSize: UINT, + fMask: UINT, + fType: UINT, + fState: UINT, + wID: UINT, + hSubMenu: HMENU, + hbmpChecked: HBITMAP, + hbmpUnchecked: HBITMAP, + dwItemData: ULONG_PTR, + dwTypeData: LPSTR, + cch: UINT, + hbmpItem: HBITMAP, +}} +pub type LPMENUITEMINFOA = *mut MENUITEMINFOA; +pub type LPCMENUITEMINFOA = *const MENUITEMINFOA; +STRUCT!{struct MENUITEMINFOW { + cbSize: UINT, + fMask: UINT, + fType: UINT, + fState: UINT, + wID: UINT, + hSubMenu: HMENU, + hbmpChecked: HBITMAP, + hbmpUnchecked: HBITMAP, + dwItemData: ULONG_PTR, + dwTypeData: LPWSTR, + cch: UINT, + hbmpItem: HBITMAP, +}} +pub type LPMENUITEMINFOW = *mut MENUITEMINFOW; +pub type LPCMENUITEMINFOW = *const MENUITEMINFOW; +extern "system" { + pub fn InsertMenuItemA( + hmenu: HMENU, + item: UINT, + fByPosition: BOOL, + lpmi: LPCMENUITEMINFOA, + ) -> BOOL; + pub fn InsertMenuItemW( + hmenu: HMENU, + item: UINT, + fByPosition: BOOL, + lpmi: LPCMENUITEMINFOW, + ) -> BOOL; + pub fn GetMenuItemInfoA( + hMenu: HMENU, + uItem: UINT, + fByPosition: BOOL, + lpmii: LPMENUITEMINFOA, + ) -> BOOL; + pub fn GetMenuItemInfoW( + hMenu: HMENU, + uItem: UINT, + fByPosition: BOOL, + lpmii: LPMENUITEMINFOW, + ) -> BOOL; + pub fn SetMenuItemInfoA( + hmenu: HMENU, + item: UINT, + fByPositon: BOOL, + lpmii: LPCMENUITEMINFOA, + ) -> BOOL; + pub fn SetMenuItemInfoW( + hmenu: HMENU, + item: UINT, + fByPositon: BOOL, + lpmii: LPCMENUITEMINFOW, + ) -> BOOL; +} +pub const GMDI_USEDISABLED: DWORD = 0x0001; +pub const GMDI_GOINTOPOPUPS: DWORD = 0x0002; +extern "system" { + pub fn GetMenuDefaultItem( + hMenu: HMENU, + fByPos: UINT, + gmdiFlags: UINT, + ) -> UINT; + pub fn SetMenuDefaultItem( + hMenu: HMENU, + uItem: UINT, + fByPos: UINT, + ) -> BOOL; + pub fn GetMenuItemRect( + hWnd: HWND, + hMenu: HMENU, + uItem: UINT, + lprcItem: LPRECT, + ) -> BOOL; + pub fn MenuItemFromPoint( + hWnd: HWND, + hMenu: HMENU, + ptScreen: POINT, + ) -> c_int; +} +pub const TPM_LEFTBUTTON: UINT = 0x0000; +pub const TPM_RIGHTBUTTON: UINT = 0x0002; +pub const TPM_LEFTALIGN: UINT = 0x0000; +pub const TPM_CENTERALIGN: UINT = 0x0004; +pub const TPM_RIGHTALIGN: UINT = 0x0008; +pub const TPM_TOPALIGN: UINT = 0x0000; +pub const TPM_VCENTERALIGN: UINT = 0x0010; +pub const TPM_BOTTOMALIGN: UINT = 0x0020; +pub const TPM_HORIZONTAL: UINT = 0x0000; +pub const TPM_VERTICAL: UINT = 0x0040; +pub const TPM_NONOTIFY: UINT = 0x0080; +pub const TPM_RETURNCMD: UINT = 0x0100; +pub const TPM_RECURSE: UINT = 0x0001; +pub const TPM_HORPOSANIMATION: UINT = 0x0400; +pub const TPM_HORNEGANIMATION: UINT = 0x0800; +pub const TPM_VERPOSANIMATION: UINT = 0x1000; +pub const TPM_VERNEGANIMATION: UINT = 0x2000; +pub const TPM_NOANIMATION: UINT = 0x4000; +pub const TPM_LAYOUTRTL: UINT = 0x8000; +pub const TPM_WORKAREA: UINT = 0x10000; +STRUCT!{struct DROPSTRUCT { + hwndSource: HWND, + hwndSink: HWND, + wFmt: DWORD, + dwData: ULONG_PTR, + ptDrop: POINT, + dwControlData: DWORD, +}} +pub type PDROPSTRUCT = *mut DROPSTRUCT; +pub type LPDROPSTRUCT = *mut DROPSTRUCT; +pub const DOF_EXECUTABLE: DWORD = 0x8001; +pub const DOF_DOCUMENT: DWORD = 0x8002; +pub const DOF_DIRECTORY: DWORD = 0x8003; +pub const DOF_MULTIPLE: DWORD = 0x8004; +pub const DOF_PROGMAN: DWORD = 0x0001; +pub const DOF_SHELLDATA: DWORD = 0x0002; +pub const DO_DROPFILE: DWORD = 0x454C4946; +pub const DO_PRINTFILE: DWORD = 0x544E5250; +extern "system" { + pub fn DragObject( + hwndParent: HWND, + hwndFrom: HWND, + fmt: UINT, + data: ULONG_PTR, + hcur: HCURSOR, + ) -> DWORD; + pub fn DragDetect( + hwnd: HWND, + pt: POINT, + ) -> BOOL; + pub fn DrawIcon( + hDC: HDC, + x: c_int, + y: c_int, + hIcon: HICON, + ) -> BOOL; +} +pub const DT_TOP: UINT = 0x00000000; +pub const DT_LEFT: UINT = 0x00000000; +pub const DT_CENTER: UINT = 0x00000001; +pub const DT_RIGHT: UINT = 0x00000002; +pub const DT_VCENTER: UINT = 0x00000004; +pub const DT_BOTTOM: UINT = 0x00000008; +pub const DT_WORDBREAK: UINT = 0x00000010; +pub const DT_SINGLELINE: UINT = 0x00000020; +pub const DT_EXPANDTABS: UINT = 0x00000040; +pub const DT_TABSTOP: UINT = 0x00000080; +pub const DT_NOCLIP: UINT = 0x00000100; +pub const DT_EXTERNALLEADING: UINT = 0x00000200; +pub const DT_CALCRECT: UINT = 0x00000400; +pub const DT_NOPREFIX: UINT = 0x00000800; +pub const DT_INTERNAL: UINT = 0x00001000; +pub const DT_EDITCONTROL: UINT = 0x00002000; +pub const DT_PATH_ELLIPSIS: UINT = 0x00004000; +pub const DT_END_ELLIPSIS: UINT = 0x00008000; +pub const DT_MODIFYSTRING: UINT = 0x00010000; +pub const DT_RTLREADING: UINT = 0x00020000; +pub const DT_WORD_ELLIPSIS: UINT = 0x00040000; +pub const DT_NOFULLWIDTHCHARBREAK: UINT = 0x00080000; +pub const DT_HIDEPREFIX: UINT = 0x00100000; +pub const DT_PREFIXONLY: UINT = 0x00200000; +STRUCT!{struct DRAWTEXTPARAMS { + cbSize: UINT, + iTabLength: c_int, + iLeftMargin: c_int, + iRightMargin: c_int, + uiLengthDrawn: UINT, +}} +pub type LPDRAWTEXTPARAMS = *mut DRAWTEXTPARAMS; +extern "system" { + pub fn DrawTextA( + hdc: HDC, + lpchText: LPCSTR, + cchText: c_int, + lprc: LPRECT, + format: UINT, + ) -> c_int; + pub fn DrawTextW( + hdc: HDC, + lpchText: LPCWSTR, + cchText: c_int, + lprc: LPRECT, + format: UINT, + ) -> c_int; + pub fn DrawTextExA( + hdc: HDC, + lpchText: LPCSTR, + cchText: c_int, + lprc: LPRECT, + format: UINT, + lpdtp: LPDRAWTEXTPARAMS, + ) -> c_int; + pub fn DrawTextExW( + hdc: HDC, + lpchText: LPCWSTR, + cchText: c_int, + lprc: LPRECT, + format: UINT, + lpdtp: LPDRAWTEXTPARAMS, + ) -> c_int; + pub fn GrayStringA( + hDC: HDC, + hBrush: HBRUSH, + lpOutputFunc: GRAYSTRINGPROC, + lpData: LPARAM, + nCount: c_int, + X: c_int, + Y: c_int, + nWidth: c_int, + nHeight: c_int, + ) -> BOOL; + pub fn GrayStringW( + hDC: HDC, + hBrush: HBRUSH, + lpOutputFunc: GRAYSTRINGPROC, + lpData: LPARAM, + nCount: c_int, + X: c_int, + Y: c_int, + nWidth: c_int, + nHeight: c_int, + ) -> BOOL; +} +pub const DST_COMPLEX: UINT = 0x0000; +pub const DST_TEXT: UINT = 0x0001; +pub const DST_PREFIXTEXT: UINT = 0x0002; +pub const DST_ICON: UINT = 0x0003; +pub const DST_BITMAP: UINT = 0x0004; +pub const DSS_NORMAL: UINT = 0x0000; +pub const DSS_UNION: UINT = 0x0010; +pub const DSS_DISABLED: UINT = 0x0020; +pub const DSS_MONO: UINT = 0x0080; +pub const DSS_HIDEPREFIX: UINT = 0x0200; +pub const DSS_PREFIXONLY: UINT = 0x0400; +pub const DSS_RIGHT: UINT = 0x8000; +extern "system" { + pub fn DrawStateA( + hdc: HDC, + hbrFore: HBRUSH, + qfnCallBack: DRAWSTATEPROC, + lData: LPARAM, + wData: WPARAM, + x: c_int, + y: c_int, + cx: c_int, + cy: c_int, + uFlags: UINT, + ) -> BOOL; + pub fn DrawStateW( + hdc: HDC, + hbrFore: HBRUSH, + qfnCallBack: DRAWSTATEPROC, + lData: LPARAM, + wData: WPARAM, + x: c_int, + y: c_int, + cx: c_int, + cy: c_int, + uFlags: UINT, + ) -> BOOL; + pub fn TabbedTextOutA( + hdc: HDC, + x: c_int, + y: c_int, + lpString: LPCSTR, + chCount: c_int, + nTabPositions: c_int, + lpnTabStopPositions: *const INT, + nTabOrigin: c_int, + ) -> LONG; + pub fn TabbedTextOutW( + hdc: HDC, + x: c_int, + y: c_int, + lpString: LPCWSTR, + chCount: c_int, + nTabPositions: c_int, + lpnTabStopPositions: *const INT, + nTabOrigin: c_int, + ) -> LONG; + pub fn GetTabbedTextExtentA( + hdc: HDC, + lpString: LPCSTR, + chCount: c_int, + nTabPositions: c_int, + lpnTabStopPositions: *const INT, + ) -> DWORD; + pub fn GetTabbedTextExtentW( + hdc: HDC, + lpString: LPCWSTR, + chCount: c_int, + nTabPositions: c_int, + lpnTabStopPositions: *const INT, + ) -> DWORD; + pub fn UpdateWindow( + hWnd: HWND, + ) -> BOOL; + pub fn SetActiveWindow( + hWnd: HWND, + ) -> HWND; + pub fn GetForegroundWindow() -> HWND; + pub fn PaintDesktop( + hdc: HDC, + ) -> BOOL; + pub fn SwitchToThisWindow( + hwnd: HWND, + fUnknown: BOOL, + ); + pub fn SetForegroundWindow( + hWnd: HWND, + ) -> BOOL; + pub fn AllowSetForegroundWindow( + dwProcessId: DWORD, + ) -> BOOL; +} +pub const ASFW_ANY: DWORD = -1i32 as u32; +extern "system" { + pub fn LockSetForegroundWindow( + uLockCode: UINT, + ) -> BOOL; +} +pub const LSFW_LOCK: UINT = 1; +pub const LSFW_UNLOCK: UINT = 2; +extern "system" { + pub fn WindowFromDC( + hDC: HDC, + ) -> HWND; + pub fn GetDC( + hWnd: HWND, + ) -> HDC; + pub fn GetDCEx( + hWnd: HWND, + hrgnClip: HRGN, + flags: DWORD, + ) -> HDC; +} +pub const DCX_WINDOW: DWORD = 0x00000001; +pub const DCX_CACHE: DWORD = 0x00000002; +pub const DCX_NORESETATTRS: DWORD = 0x00000004; +pub const DCX_CLIPCHILDREN: DWORD = 0x00000008; +pub const DCX_CLIPSIBLINGS: DWORD = 0x00000010; +pub const DCX_PARENTCLIP: DWORD = 0x00000020; +pub const DCX_EXCLUDERGN: DWORD = 0x00000040; +pub const DCX_INTERSECTRGN: DWORD = 0x00000080; +pub const DCX_EXCLUDEUPDATE: DWORD = 0x00000100; +pub const DCX_INTERSECTUPDATE: DWORD = 0x00000200; +pub const DCX_LOCKWINDOWUPDATE: DWORD = 0x00000400; +pub const DCX_VALIDATE: DWORD = 0x00200000; +extern "system" { + pub fn GetWindowDC( + hWnd: HWND, + ) -> HDC; + pub fn ReleaseDC( + hWnd: HWND, + hDC: HDC, + ) -> c_int; + pub fn BeginPaint( + hwnd: HWND, + lpPaint: LPPAINTSTRUCT, + ) -> HDC; + pub fn EndPaint( + hWnd: HWND, + lpPaint: *const PAINTSTRUCT, + ) -> BOOL; + pub fn GetUpdateRect( + hWnd: HWND, + lpRect: LPRECT, + bErase: BOOL, + ) -> BOOL; + pub fn GetUpdateRgn( + hWnd: HWND, + hRgn: HRGN, + bErase: BOOL, + ) -> c_int; + pub fn SetWindowRgn( + hWnd: HWND, + hRgn: HRGN, + bRedraw: BOOL, + ) -> c_int; + pub fn GetWindowRgn( + hWnd: HWND, + hRgn: HRGN, + ) -> c_int; + pub fn GetWindowRgnBox( + hWnd: HWND, + lprc: LPRECT, + ) -> c_int; + pub fn ExcludeUpdateRgn( + hDC: HDC, + hWnd: HWND, + ) -> c_int; + pub fn InvalidateRect( + hWnd: HWND, + lpRect: *const RECT, + bErase: BOOL, + ) -> BOOL; + pub fn ValidateRect( + hWnd: HWND, + lpRect: *const RECT, + ) -> BOOL; + pub fn InvalidateRgn( + hWnd: HWND, + hRgn: HRGN, + bErase: BOOL, + ) -> BOOL; + pub fn ValidateRgn( + hWnd: HWND, + hRgn: HRGN, + ) -> BOOL; + pub fn RedrawWindow( + hwnd: HWND, + lprcUpdate: *const RECT, + hrgnUpdate: HRGN, + flags: UINT, + ) -> BOOL; +} +pub const RDW_INVALIDATE: UINT = 0x0001; +pub const RDW_INTERNALPAINT: UINT = 0x0002; +pub const RDW_ERASE: UINT = 0x0004; +pub const RDW_VALIDATE: UINT = 0x0008; +pub const RDW_NOINTERNALPAINT: UINT = 0x0010; +pub const RDW_NOERASE: UINT = 0x0020; +pub const RDW_NOCHILDREN: UINT = 0x0040; +pub const RDW_ALLCHILDREN: UINT = 0x0080; +pub const RDW_UPDATENOW: UINT = 0x0100; +pub const RDW_ERASENOW: UINT = 0x0200; +pub const RDW_FRAME: UINT = 0x0400; +pub const RDW_NOFRAME: UINT = 0x0800; +extern "system" { + pub fn LockWindowUpdate( + hWndLock: HWND, + ) -> BOOL; + pub fn ScrollWindow( + hWnd: HWND, + xAmount: c_int, + yAmount: c_int, + lpRect: *const RECT, + lpClipRect: *const RECT, + ) -> BOOL; + pub fn ScrollDC( + hDC: HDC, + dx: c_int, + dy: c_int, + lprcScroll: *const RECT, + lprcClip: *const RECT, + hrgnUpdate: HRGN, + lprcUpdate: LPRECT, + ) -> BOOL; + pub fn ScrollWindowEx( + hWnd: HWND, + dx: c_int, + dy: c_int, + prcScroll: *const RECT, + prcClip: *const RECT, + hrgnUpdate: HRGN, + prcUpdate: LPRECT, + flags: UINT, + ) -> c_int; +} +pub const SW_SCROLLCHILDREN: UINT = 0x0001; +pub const SW_INVALIDATE: UINT = 0x0002; +pub const SW_ERASE: UINT = 0x0004; +pub const SW_SMOOTHSCROLL: UINT = 0x0010; +extern "system" { + pub fn SetScrollPos( + hWnd: HWND, + nBar: c_int, + nPos: c_int, + bRedraw: BOOL, + ) -> c_int; + pub fn GetScrollPos( + hWnd: HWND, + nBar: c_int, + ) -> c_int; + pub fn SetScrollRange( + hWnd: HWND, + nBar: c_int, + nMinPos: c_int, + nMaxPos: c_int, + bRedraw: BOOL, + ) -> BOOL; + pub fn GetScrollRange( + hWnd: HWND, + nBar: c_int, + lpMinPos: LPINT, + lpMaxPos: LPINT, + ) -> BOOL; + pub fn ShowScrollBar( + hWnd: HWND, + wBar: c_int, + bShow: BOOL, + ) -> BOOL; + pub fn EnableScrollBar( + hWnd: HWND, + wSBflags: UINT, + wArrows: UINT, + ) -> BOOL; +} +pub const ESB_ENABLE_BOTH: UINT = 0x0000; +pub const ESB_DISABLE_BOTH: UINT = 0x0003; +pub const ESB_DISABLE_LEFT: UINT = 0x0001; +pub const ESB_DISABLE_RIGHT: UINT = 0x0002; +pub const ESB_DISABLE_UP: UINT = 0x0001; +pub const ESB_DISABLE_DOWN: UINT = 0x0002; +pub const ESB_DISABLE_LTUP: UINT = ESB_DISABLE_LEFT; +pub const ESB_DISABLE_RTDN: UINT = ESB_DISABLE_RIGHT; +extern "system" { + pub fn SetPropA( + hWnd: HWND, + lpString: LPCSTR, + hData: HANDLE, + ) -> BOOL; + pub fn SetPropW( + hWnd: HWND, + lpString: LPCWSTR, + hData: HANDLE, + ) -> BOOL; + pub fn GetPropA( + hwnd: HWND, + lpString: LPCSTR, + ) -> HANDLE; + pub fn GetPropW( + hwnd: HWND, + lpString: LPCWSTR, + ) -> HANDLE; + pub fn RemovePropA( + hWnd: HWND, + lpStr: LPCSTR, + ) -> HANDLE; + pub fn RemovePropW( + hWnd: HWND, + lpStr: LPCWSTR, + ) -> HANDLE; + pub fn EnumPropsExA( + hWnd: HWND, + lpEnumFunc: PROPENUMPROCA, + lParam: LPARAM, + ) -> c_int; + pub fn EnumPropsExW( + hWnd: HWND, + lpEnumFunc: PROPENUMPROCW, + lParam: LPARAM, + ) -> c_int; + pub fn EnumPropsA( + hWnd: HWND, + lpEnumFunc: PROPENUMPROCA, + ) -> c_int; + pub fn EnumPropsW( + hWnd: HWND, + lpEnumFunc: PROPENUMPROCW, + ) -> c_int; + pub fn SetWindowTextA( + hWnd: HWND, + lpString: LPCSTR, + ) -> BOOL; + pub fn SetWindowTextW( + hWnd: HWND, + lpString: LPCWSTR, + ) -> BOOL; + pub fn GetWindowTextA( + hWnd: HWND, + lpString: LPSTR, + nMaxCount: c_int, + ) -> c_int; + pub fn GetWindowTextW( + hWnd: HWND, + lpString: LPWSTR, + nMaxCount: c_int, + ) -> c_int; + pub fn GetWindowTextLengthA( + hWnd: HWND, + ) -> c_int; + pub fn GetWindowTextLengthW( + hWnd: HWND, + ) -> c_int; + pub fn GetClientRect( + hWnd: HWND, + lpRect: LPRECT, + ) -> BOOL; + pub fn GetWindowRect( + hWnd: HWND, + lpRect: LPRECT, + ) -> BOOL; + pub fn AdjustWindowRect( + lpRect: LPRECT, + dwStyle: DWORD, + bMenu: BOOL, + ) -> BOOL; + pub fn AdjustWindowRectEx( + lpRect: LPRECT, + dwStyle: DWORD, + bMenu: BOOL, + dwExStyle: DWORD, + ) -> BOOL; + pub fn AdjustWindowRectExForDpi( + lpRect: LPRECT, + dwStyle: DWORD, + bMenu: BOOL, + dwExStyle: DWORD, + dpi: UINT, + ) -> BOOL; +} +pub const HELPINFO_WINDOW: UINT = 0x0001; +pub const HELPINFO_MENUITEM: UINT = 0x0002; +STRUCT!{struct HELPINFO { + cbSize: UINT, + iContextType: c_int, + iCtrlId: c_int, + hItemHandle: HANDLE, + dwContextId: DWORD, + MousePos: POINT, +}} +pub type LPHELPINFO = *mut HELPINFO; +extern "system" { + pub fn SetWindowContextHelpId( + _: HWND, + _: DWORD, + ) -> BOOL; + pub fn GetWindowContextHelpId( + _: HWND, + ) -> DWORD; + pub fn SetMenuContextHelpId( + _: HMENU, + _: DWORD, + ) -> BOOL; + pub fn GetMenuContextHelpId( + _: HMENU, + ) -> DWORD; +} +pub const MB_OK: UINT = 0x00000000; +pub const MB_OKCANCEL: UINT = 0x00000001; +pub const MB_ABORTRETRYIGNORE: UINT = 0x00000002; +pub const MB_YESNOCANCEL: UINT = 0x00000003; +pub const MB_YESNO: UINT = 0x00000004; +pub const MB_RETRYCANCEL: UINT = 0x00000005; +pub const MB_CANCELTRYCONTINUE: UINT = 0x00000006; +pub const MB_ICONHAND: UINT = 0x00000010; +pub const MB_ICONQUESTION: UINT = 0x00000020; +pub const MB_ICONEXCLAMATION: UINT = 0x00000030; +pub const MB_ICONASTERISK: UINT = 0x00000040; +pub const MB_USERICON: UINT = 0x00000080; +pub const MB_ICONWARNING: UINT = MB_ICONEXCLAMATION; +pub const MB_ICONERROR: UINT = MB_ICONHAND; +pub const MB_ICONINFORMATION: UINT = MB_ICONASTERISK; +pub const MB_ICONSTOP: UINT = MB_ICONHAND; +pub const MB_DEFBUTTON1: UINT = 0x00000000; +pub const MB_DEFBUTTON2: UINT = 0x00000100; +pub const MB_DEFBUTTON3: UINT = 0x00000200; +pub const MB_DEFBUTTON4: UINT = 0x00000300; +pub const MB_APPLMODAL: UINT = 0x00000000; +pub const MB_SYSTEMMODAL: UINT = 0x00001000; +pub const MB_TASKMODAL: UINT = 0x00002000; +pub const MB_HELP: UINT = 0x00004000; +pub const MB_NOFOCUS: UINT = 0x00008000; +pub const MB_SETFOREGROUND: UINT = 0x00010000; +pub const MB_DEFAULT_DESKTOP_ONLY: UINT = 0x00020000; +pub const MB_TOPMOST: UINT = 0x00040000; +pub const MB_RIGHT: UINT = 0x00080000; +pub const MB_RTLREADING: UINT = 0x00100000; +pub const MB_SERVICE_NOTIFICATION: UINT = 0x00200000; +pub const MB_SERVICE_NOTIFICATION_NT3X: UINT = 0x00040000; +pub const MB_TYPEMASK: UINT = 0x0000000F; +pub const MB_ICONMASK: UINT = 0x000000F0; +pub const MB_DEFMASK: UINT = 0x00000F00; +pub const MB_MODEMASK: UINT = 0x00003000; +pub const MB_MISCMASK: UINT = 0x0000C000; +extern "system" { + pub fn MessageBoxA( + hWnd: HWND, + lpText: LPCSTR, + lpCaption: LPCSTR, + uType: UINT, + ) -> c_int; + pub fn MessageBoxW( + hWnd: HWND, + lpText: LPCWSTR, + lpCaption: LPCWSTR, + uType: UINT, + ) -> c_int; + pub fn MessageBoxExA( + hWnd: HWND, + lpText: LPCSTR, + lpCaption: LPCSTR, + uType: UINT, + wLanguageId: WORD, + ) -> c_int; + pub fn MessageBoxExW( + hWnd: HWND, + lpText: LPCWSTR, + lpCaption: LPCWSTR, + uType: UINT, + wLanguageId: WORD, + ) -> c_int; +} +FN!{stdcall MSGBOXCALLBACK( + LPHELPINFO, +) -> ()} +STRUCT!{struct MSGBOXPARAMSA { + cbSize: UINT, + hwndOwner: HWND, + hInstance: HINSTANCE, + lpszText: LPCSTR, + lpszCaption: LPCSTR, + dwStyle: DWORD, + lpszIcon: LPCSTR, + dwContextHelpId: DWORD_PTR, + lpfnMsgBoxCallback: MSGBOXCALLBACK, + dwLanguageId: DWORD, +}} +pub type PMSGBOXPARAMSA = *mut MSGBOXPARAMSA; +pub type LPMSGBOXPARAMSA = *mut MSGBOXPARAMSA; +STRUCT!{struct MSGBOXPARAMSW { + cbSize: UINT, + hwndOwner: HWND, + hInstance: HINSTANCE, + lpszText: LPCWSTR, + lpszCaption: LPCWSTR, + dwStyle: DWORD, + lpszIcon: LPCWSTR, + dwContextHelpId: DWORD_PTR, + lpfnMsgBoxCallback: MSGBOXCALLBACK, + dwLanguageId: DWORD, +}} +pub type PMSGBOXPARAMSW = *mut MSGBOXPARAMSW; +pub type LPMSGBOXPARAMSW = *mut MSGBOXPARAMSW; +extern "system" { + pub fn MessageBoxIndirectA( + lpmbp: *const MSGBOXPARAMSA, + ) -> c_int; + pub fn MessageBoxIndirectW( + lpmbp: *const MSGBOXPARAMSW, + ) -> c_int; + pub fn MessageBeep( + uType: UINT, + ) -> BOOL; + pub fn ShowCursor( + bShow: BOOL, + ) -> c_int; + pub fn SetCursorPos( + X: c_int, + Y: c_int, + ) -> BOOL; + pub fn SetPhysicalCursorPos( + X: c_int, + Y: c_int, + ) -> BOOL; + pub fn SetCursor( + hCursor: HCURSOR, + ) -> HCURSOR; + pub fn GetCursorPos( + lpPoint: LPPOINT, + ) -> BOOL; + pub fn GetPhysicalCursorPos( + lpPoint: LPPOINT, + ) -> BOOL; + pub fn GetClipCursor( + lpRect: LPRECT, + ) -> BOOL; + pub fn GetCursor() -> HCURSOR; + pub fn CreateCaret( + hWnd: HWND, + hBitmap: HBITMAP, + nWidth: c_int, + nHeight: c_int, + ) -> BOOL; + pub fn GetCaretBlinkTime() -> UINT; + pub fn SetCaretBlinkTime( + uMSeconds: UINT, + ) -> BOOL; + pub fn DestroyCaret() -> BOOL; + pub fn HideCaret( + hWnd: HWND, + ) -> BOOL; + pub fn ShowCaret( + hWnd: HWND, + ) -> BOOL; + pub fn SetCaretPos( + X: c_int, + Y: c_int, + ) -> BOOL; + pub fn GetCaretPos( + lpPoint: LPPOINT, + ) -> BOOL; + pub fn ClientToScreen( + hWnd: HWND, + lpPoint: LPPOINT, + ) -> BOOL; + pub fn ScreenToClient( + hWnd: HWND, + lpPoint: LPPOINT, + ) -> BOOL; + pub fn LogicalToPhysicalPoint( + hWnd: HWND, + lpPoint: LPPOINT, + ) -> BOOL; + pub fn PhysicalToLogicalPoint( + hWnd: HWND, + lpPoint: LPPOINT, + ) -> BOOL; + pub fn LogicalToPhysicalPointForPerMonitorDPI( + hWnd: HWND, + lpPoint: LPPOINT, + ) -> BOOL; + pub fn PhysicalToLogicalPointForPerMonitorDPI( + hWnd: HWND, + lpPoint: LPPOINT, + ) -> BOOL; + pub fn MapWindowPoints( + hWndFrom: HWND, + hWndTo: HWND, + lpPoints: LPPOINT, + cPoints: UINT, + ) -> c_int; + pub fn WindowFromPoint( + Point: POINT, + ) -> HWND; + pub fn WindowFromPhysicalPoint( + Point: POINT, + ) -> HWND; + pub fn ChildWindowFromPoint( + hWndParent: HWND, + point: POINT, + ) -> HWND; + pub fn ClipCursor( + lpRect: *const RECT, + ) -> BOOL; +} +pub const CWP_ALL: UINT = 0x0000; +pub const CWP_SKIPINVISIBLE: UINT = 0x0001; +pub const CWP_SKIPDISABLED: UINT = 0x0002; +pub const CWP_SKIPTRANSPARENT: UINT = 0x0004; +extern "system" { + pub fn ChildWindowFromPointEx( + hwnd: HWND, + pt: POINT, + flags: UINT, + ) -> HWND; +} +pub const CTLCOLOR_MSGBOX: c_int = 0; +pub const CTLCOLOR_EDIT: c_int = 1; +pub const CTLCOLOR_LISTBOX: c_int = 2; +pub const CTLCOLOR_BTN: c_int = 3; +pub const CTLCOLOR_DLG: c_int = 4; +pub const CTLCOLOR_SCROLLBAR: c_int = 5; +pub const CTLCOLOR_STATIC: c_int = 6; +pub const CTLCOLOR_MAX: c_int = 7; +pub const COLOR_SCROLLBAR: c_int = 0; +pub const COLOR_BACKGROUND: c_int = 1; +pub const COLOR_ACTIVECAPTION: c_int = 2; +pub const COLOR_INACTIVECAPTION: c_int = 3; +pub const COLOR_MENU: c_int = 4; +pub const COLOR_WINDOW: c_int = 5; +pub const COLOR_WINDOWFRAME: c_int = 6; +pub const COLOR_MENUTEXT: c_int = 7; +pub const COLOR_WINDOWTEXT: c_int = 8; +pub const COLOR_CAPTIONTEXT: c_int = 9; +pub const COLOR_ACTIVEBORDER: c_int = 10; +pub const COLOR_INACTIVEBORDER: c_int = 11; +pub const COLOR_APPWORKSPACE: c_int = 12; +pub const COLOR_HIGHLIGHT: c_int = 13; +pub const COLOR_HIGHLIGHTTEXT: c_int = 14; +pub const COLOR_BTNFACE: c_int = 15; +pub const COLOR_BTNSHADOW: c_int = 16; +pub const COLOR_GRAYTEXT: c_int = 17; +pub const COLOR_BTNTEXT: c_int = 18; +pub const COLOR_INACTIVECAPTIONTEXT: c_int = 19; +pub const COLOR_BTNHIGHLIGHT: c_int = 20; +pub const COLOR_3DDKSHADOW: c_int = 21; +pub const COLOR_3DLIGHT: c_int = 22; +pub const COLOR_INFOTEXT: c_int = 23; +pub const COLOR_INFOBK: c_int = 24; +pub const COLOR_HOTLIGHT: c_int = 26; +pub const COLOR_GRADIENTACTIVECAPTION: c_int = 27; +pub const COLOR_GRADIENTINACTIVECAPTION: c_int = 28; +pub const COLOR_MENUHILIGHT: c_int = 29; +pub const COLOR_MENUBAR: c_int = 30; +pub const COLOR_DESKTOP: c_int = COLOR_BACKGROUND; +pub const COLOR_3DFACE: c_int = COLOR_BTNFACE; +pub const COLOR_3DSHADOW: c_int = COLOR_BTNSHADOW; +pub const COLOR_3DHIGHLIGHT: c_int = COLOR_BTNHIGHLIGHT; +pub const COLOR_3DHILIGHT: c_int = COLOR_BTNHIGHLIGHT; +pub const COLOR_BTNHILIGHT: c_int = COLOR_BTNHIGHLIGHT; +extern "system" { + pub fn GetSysColor( + nIndex: c_int, + ) -> DWORD; + pub fn GetSysColorBrush( + nIndex: c_int, + ) -> HBRUSH; + pub fn SetSysColors( + cElements: c_int, + lpaElements: *const INT, + lpaRgbValues: *const COLORREF, + ) -> BOOL; + pub fn DrawFocusRect( + hDC: HDC, + lprc: *const RECT, + ) -> BOOL; + pub fn FillRect( + hDC: HDC, + lprc: *const RECT, + hbr: HBRUSH, + ) -> c_int; + pub fn FrameRect( + hDC: HDC, + lprc: *const RECT, + hbr: HBRUSH, + ) -> c_int; + pub fn InvertRect( + hDC: HDC, + lprc: *const RECT, + ) -> BOOL; + pub fn SetRect( + lprc: LPRECT, + xLeft: c_int, + yTop: c_int, + xRight: c_int, + yBottom: c_int, + ) -> BOOL; + pub fn SetRectEmpty( + lprc: LPRECT, + ) -> BOOL; + pub fn CopyRect( + lprcDst: LPRECT, + lprcSrc: *const RECT, + ) -> BOOL; + pub fn InflateRect( + lprc: LPRECT, + dx: c_int, + dy: c_int, + ) -> BOOL; + pub fn IntersectRect( + lprcDst: LPRECT, + lprcSrc1: *const RECT, + lprcSrc2: *const RECT, + ) -> BOOL; + pub fn UnionRect( + lprcDst: LPRECT, + lprcSrc1: *const RECT, + lprcSrc2: *const RECT, + ) -> BOOL; + pub fn SubtractRect( + lprcDst: LPRECT, + lprcSrc1: *const RECT, + lprcSrc2: *const RECT, + ) -> BOOL; + pub fn OffsetRect( + lprc: LPRECT, + dx: c_int, + dy: c_int, + ) -> BOOL; + pub fn IsRectEmpty( + lprc: *const RECT, + ) -> BOOL; + pub fn EqualRect( + lprc1: *const RECT, + lprc2: *const RECT, + ) -> BOOL; + pub fn PtInRect( + lprc: *const RECT, + pt: POINT, + ) -> BOOL; + pub fn GetWindowWord( + hWnd: HWND, + nIndex: c_int, + ) -> WORD; + pub fn SetWindowWord( + hwnd: HWND, + nIndex: c_int, + wNewWord: WORD, + ) -> WORD; + pub fn GetWindowLongA( + hWnd: HWND, + nIndex: c_int, + ) -> LONG; + pub fn GetWindowLongW( + hWnd: HWND, + nIndex: c_int, + ) -> LONG; + pub fn SetWindowLongA( + hWnd: HWND, + nIndex: c_int, + dwNewLong: LONG, + ) -> LONG; + pub fn SetWindowLongW( + hWnd: HWND, + nIndex: c_int, + dwNewLong: LONG, + ) -> LONG; + #[cfg(target_pointer_width = "64")] + pub fn GetWindowLongPtrA( + hWnd: HWND, + nIndex: c_int, + ) -> LONG_PTR; + #[cfg(target_pointer_width = "64")] + pub fn GetWindowLongPtrW( + hWnd: HWND, + nIndex: c_int, + ) -> LONG_PTR; + #[cfg(target_pointer_width = "64")] + pub fn SetWindowLongPtrA( + hWnd: HWND, + nIndex: c_int, + dwNewLong: LONG_PTR, + ) -> LONG_PTR; + #[cfg(target_pointer_width = "64")] + pub fn SetWindowLongPtrW( + hWnd: HWND, + nIndex: c_int, + dwNewLong: LONG_PTR, + ) -> LONG_PTR; +} +#[cfg(target_pointer_width = "32")] +pub use self::GetWindowLongA as GetWindowLongPtrA; +#[cfg(target_pointer_width = "32")] +pub use self::GetWindowLongW as GetWindowLongPtrW; +#[cfg(target_pointer_width = "32")] +pub use self::SetWindowLongA as SetWindowLongPtrA; +#[cfg(target_pointer_width = "32")] +pub use self::SetWindowLongW as SetWindowLongPtrW; +extern "system" { + pub fn GetClassWord( + hWnd: HWND, + nIndex: c_int, + ) -> WORD; + pub fn SetClassWord( + hWnd: HWND, + nIndex: c_int, + wNewWord: WORD, + ) -> WORD; + pub fn GetClassLongA( + hWnd: HWND, + nIndex: c_int, + ) -> DWORD; + pub fn GetClassLongW( + hWnd: HWND, + nIndex: c_int, + ) -> DWORD; + pub fn SetClassLongA( + hWnd: HWND, + nIndex: c_int, + dwNewLong: LONG, + ) -> DWORD; + pub fn SetClassLongW( + hWnd: HWND, + nIndex: c_int, + dwNewLong: LONG, + ) -> DWORD; + #[cfg(target_pointer_width = "64")] + pub fn GetClassLongPtrA( + hWnd: HWND, + nIndex: c_int, + ) -> ULONG_PTR; + #[cfg(target_pointer_width = "64")] + pub fn GetClassLongPtrW( + hWnd: HWND, + nIndex: c_int, + ) -> ULONG_PTR; + #[cfg(target_pointer_width = "64")] + pub fn SetClassLongPtrA( + hWnd: HWND, + nIndex: c_int, + dwNewLong: LONG_PTR, + ) -> ULONG_PTR; + #[cfg(target_pointer_width = "64")] + pub fn SetClassLongPtrW( + hWnd: HWND, + nIndex: c_int, + dwNewLong: LONG_PTR, + ) -> ULONG_PTR; +} +#[cfg(target_pointer_width = "32")] +pub use self::GetClassLongA as GetClassLongPtrA; +#[cfg(target_pointer_width = "32")] +pub use self::GetClassLongW as GetClassLongPtrW; +#[cfg(target_pointer_width = "32")] +pub use self::SetClassLongA as SetClassLongPtrA; +#[cfg(target_pointer_width = "32")] +pub use self::SetClassLongW as SetClassLongPtrW; +extern "system" { + pub fn GetProcessDefaultLayout( + pdwDefaultLayout: *mut DWORD, + ) -> BOOL; + pub fn SetProcessDefaultLayout( + dwDefaultLayout: DWORD, + ) -> BOOL; + pub fn GetDesktopWindow() -> HWND; + pub fn GetParent( + hWnd: HWND, + ) -> HWND; + pub fn SetParent( + hWndChild: HWND, + hWndNewParent: HWND, + ) -> HWND; + pub fn EnumChildWindows( + hWndParent: HWND, + lpEnumFunc: WNDENUMPROC, + lParam: LPARAM, + ) -> BOOL; + pub fn FindWindowA( + lpClassName: LPCSTR, + lpWindowName: LPCSTR, + ) -> HWND; + pub fn FindWindowW( + lpClassName: LPCWSTR, + lpWindowName: LPCWSTR, + ) -> HWND; + pub fn FindWindowExA( + hWndParent: HWND, + hWndChildAfter: HWND, + lpszClass: LPCSTR, + lpszWindow: LPCSTR, + ) -> HWND; + pub fn FindWindowExW( + hWndParent: HWND, + hWndChildAfter: HWND, + lpszClass: LPCWSTR, + lpszWindow: LPCWSTR, + ) -> HWND; + pub fn GetShellWindow() -> HWND; + pub fn RegisterShellHookWindow( + hwnd: HWND, + ) -> BOOL; + pub fn DeregisterShellHookWindow( + hwnd: HWND, + ) -> BOOL; + pub fn EnumWindows( + lpEnumFunc: WNDENUMPROC, + lParam: LPARAM, + ) -> BOOL; + pub fn EnumThreadWindows( + dwThreadId: DWORD, + lpfn: WNDENUMPROC, + lParam: LPARAM, + ) -> BOOL; +} +// EnumTaskWindows +extern "system" { + pub fn GetClassNameA( + hWnd: HWND, + lpClassName: LPCSTR, + nMaxCount: c_int, + ) -> c_int; + pub fn GetClassNameW( + hWnd: HWND, + lpClassName: LPCWSTR, + nMaxCount: c_int, + ) -> c_int; + pub fn GetTopWindow( + hWnd: HWND, + ) -> HWND; +} +// GetNextWindow +// GetSysModalWindow +// SetSysModalWindow +extern "system" { + pub fn GetWindowThreadProcessId( + hWnd: HWND, + lpdwProcessId: LPDWORD, + ) -> DWORD; + pub fn IsGUIThread( + bConvert: BOOL, + ) -> BOOL; + pub fn GetLastActivePopup( + hWnd: HWND, + ) -> HWND; +} +pub const GW_HWNDFIRST: UINT = 0; +pub const GW_HWNDLAST: UINT = 1; +pub const GW_HWNDNEXT: UINT = 2; +pub const GW_HWNDPREV: UINT = 3; +pub const GW_OWNER: UINT = 4; +pub const GW_CHILD: UINT = 5; +pub const GW_ENABLEDPOPUP: UINT = 6; +pub const GW_MAX: UINT = 6; +extern "system" { + pub fn GetWindow( + hWnd: HWND, + uCmd: UINT, + ) -> HWND; + pub fn SetWindowsHookA( + nFilterType: c_int, + pfnFilterProc: HOOKPROC, + ) -> HHOOK; + pub fn SetWindowsHookW( + nFilterType: c_int, + pfnFilterProc: HOOKPROC, + ) -> HHOOK; + pub fn UnhookWindowsHook( + nFilterType: c_int, + pfnFilterProc: HOOKPROC, + ) -> BOOL; + pub fn SetWindowsHookExA( + idHook: c_int, + lpfn: HOOKPROC, + hmod: HINSTANCE, + dwThreadId: DWORD, + ) -> HHOOK; + pub fn SetWindowsHookExW( + idHook: c_int, + lpfn: HOOKPROC, + hmod: HINSTANCE, + dwThreadId: DWORD, + ) -> HHOOK; + pub fn UnhookWindowsHookEx( + hhk: HHOOK, + ) -> BOOL; + pub fn CallNextHookEx( + hhk: HHOOK, + nCode: c_int, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; +} +// DefHookProc +pub const MF_INSERT: UINT = 0x00000000; +pub const MF_CHANGE: UINT = 0x00000080; +pub const MF_APPEND: UINT = 0x00000100; +pub const MF_DELETE: UINT = 0x00000200; +pub const MF_REMOVE: UINT = 0x00001000; +pub const MF_BYCOMMAND: UINT = 0x00000000; +pub const MF_BYPOSITION: UINT = 0x00000400; +pub const MF_SEPARATOR: UINT = 0x00000800; +pub const MF_ENABLED: UINT = 0x00000000; +pub const MF_GRAYED: UINT = 0x00000001; +pub const MF_DISABLED: UINT = 0x00000002; +pub const MF_UNCHECKED: UINT = 0x00000000; +pub const MF_CHECKED: UINT = 0x00000008; +pub const MF_USECHECKBITMAPS: UINT = 0x00000200; +pub const MF_STRING: UINT = 0x00000000; +pub const MF_BITMAP: UINT = 0x00000004; +pub const MF_OWNERDRAW: UINT = 0x00000100; +pub const MF_POPUP: UINT = 0x00000010; +pub const MF_MENUBARBREAK: UINT = 0x00000020; +pub const MF_MENUBREAK: UINT = 0x00000040; +pub const MF_UNHILITE: UINT = 0x00000000; +pub const MF_HILITE: UINT = 0x00000080; +pub const MF_DEFAULT: UINT = 0x00001000; +pub const MF_SYSMENU: UINT = 0x00002000; +pub const MF_HELP: UINT = 0x00004000; +pub const MF_RIGHTJUSTIFY: UINT = 0x00004000; +pub const MF_MOUSESELECT: UINT = 0x00008000; +pub const MF_END: UINT = 0x00000080; +pub const MFT_STRING: UINT = MF_STRING; +pub const MFT_BITMAP: UINT = MF_BITMAP; +pub const MFT_MENUBARBREAK: UINT = MF_MENUBARBREAK; +pub const MFT_MENUBREAK: UINT = MF_MENUBREAK; +pub const MFT_OWNERDRAW: UINT = MF_OWNERDRAW; +pub const MFT_RADIOCHECK: UINT = 0x00000200; +pub const MFT_SEPARATOR: UINT = MF_SEPARATOR; +pub const MFT_RIGHTORDER: UINT = 0x00002000; +pub const MFT_RIGHTJUSTIFY: UINT = MF_RIGHTJUSTIFY; +pub const MFS_GRAYED: UINT = 0x00000003; +pub const MFS_DISABLED: UINT = MFS_GRAYED; +pub const MFS_CHECKED: UINT = MF_CHECKED; +pub const MFS_HILITE: UINT = MF_HILITE; +pub const MFS_ENABLED: UINT = MF_ENABLED; +pub const MFS_UNCHECKED: UINT = MF_UNCHECKED; +pub const MFS_UNHILITE: UINT = MF_UNHILITE; +pub const MFS_DEFAULT: UINT = MF_DEFAULT; +extern "system" { + pub fn CheckMenuRadioItem( + hMenu: HMENU, + first: UINT, + last: UINT, + check: UINT, + flags: UINT, + ) -> BOOL; +} +//10225 +pub const SC_SIZE: WPARAM = 0xF000; +pub const SC_MOVE: WPARAM = 0xF010; +pub const SC_MINIMIZE: WPARAM = 0xF020; +pub const SC_MAXIMIZE: WPARAM = 0xF030; +pub const SC_NEXTWINDOW: WPARAM = 0xF040; +pub const SC_PREVWINDOW: WPARAM = 0xF050; +pub const SC_CLOSE: WPARAM = 0xF060; +pub const SC_VSCROLL: WPARAM = 0xF070; +pub const SC_HSCROLL: WPARAM = 0xF080; +pub const SC_MOUSEMENU: WPARAM = 0xF090; +pub const SC_KEYMENU: WPARAM = 0xF100; +pub const SC_ARRANGE: WPARAM = 0xF110; +pub const SC_RESTORE: WPARAM = 0xF120; +pub const SC_TASKLIST: WPARAM = 0xF130; +pub const SC_SCREENSAVE: WPARAM = 0xF140; +pub const SC_HOTKEY: WPARAM = 0xF150; +pub const SC_DEFAULT: WPARAM = 0xF160; +pub const SC_MONITORPOWER: WPARAM = 0xF170; +pub const SC_CONTEXTHELP: WPARAM = 0xF180; +pub const SC_SEPARATOR: WPARAM = 0xF00F; +//10269 +extern "system" { + pub fn LoadBitmapA( + hInstance: HINSTANCE, + lpBitmapName: LPCSTR, + ) -> HBITMAP; + pub fn LoadBitmapW( + hInstance: HINSTANCE, + lpBitmapName: LPCWSTR, + ) -> HBITMAP; + pub fn LoadCursorA( + hInstance: HINSTANCE, + lpCursorName: LPCSTR, + ) -> HCURSOR; + pub fn LoadCursorW( + hInstance: HINSTANCE, + lpCursorName: LPCWSTR, + ) -> HCURSOR; + pub fn LoadCursorFromFileA( + lpFileName: LPCSTR, + ) -> HCURSOR; + pub fn LoadCursorFromFileW( + lpFileName: LPCWSTR, + ) -> HCURSOR; + pub fn CreateCursor( + hInst: HINSTANCE, + xHotSpot: c_int, + yHotSpot: c_int, + nWidth: c_int, + nHeight: c_int, + pvAndPlane: *const VOID, + pvXORPlane: *const VOID, + ) -> HCURSOR; + pub fn DestroyCursor( + hCursor: HCURSOR, + ) -> BOOL; +} +//10355 +pub const IDC_ARROW: LPCWSTR = 32512 as LPCWSTR; +pub const IDC_IBEAM: LPCWSTR = 32513 as LPCWSTR; +pub const IDC_WAIT: LPCWSTR = 32514 as LPCWSTR; +pub const IDC_CROSS: LPCWSTR = 32515 as LPCWSTR; +pub const IDC_UPARROW: LPCWSTR = 32516 as LPCWSTR; +pub const IDC_SIZE: LPCWSTR = 32640 as LPCWSTR; +pub const IDC_ICON: LPCWSTR = 32641 as LPCWSTR; +pub const IDC_SIZENWSE: LPCWSTR = 32642 as LPCWSTR; +pub const IDC_SIZENESW: LPCWSTR = 32643 as LPCWSTR; +pub const IDC_SIZEWE: LPCWSTR = 32644 as LPCWSTR; +pub const IDC_SIZENS: LPCWSTR = 32645 as LPCWSTR; +pub const IDC_SIZEALL: LPCWSTR = 32646 as LPCWSTR; +pub const IDC_NO: LPCWSTR = 32648 as LPCWSTR; +pub const IDC_HAND: LPCWSTR = 32649 as LPCWSTR; +pub const IDC_APPSTARTING: LPCWSTR = 32650 as LPCWSTR; +pub const IDC_HELP: LPCWSTR = 32651 as LPCWSTR; +extern "system" { + pub fn SetSystemCursor( + hcur: HCURSOR, + id: DWORD, + ) -> BOOL; +} +STRUCT!{struct ICONINFO { + fIcon: BOOL, + xHotspot: DWORD, + yHotspot: DWORD, + hbmMask: HBITMAP, + hbmColor: HBITMAP, +}} +pub type PICONINFO = *mut ICONINFO; +extern "system" { + pub fn LoadIconA( + hInstance: HINSTANCE, + lpIconName: LPCSTR, + ) -> HICON; + pub fn LoadIconW( + hInstance: HINSTANCE, + lpIconName: LPCWSTR, + ) -> HICON; +} +//10449 +extern "system" { + pub fn CreateIcon( + hInstance: HINSTANCE, + nWidth: c_int, + nHeight: c_int, + cPlanes: BYTE, + cBitsPixel: BYTE, + lpbANDbits: *const BYTE, + lpbXORbits: *const BYTE, + ) -> HICON; + pub fn DestroyIcon( + hIcon: HICON, + ) -> BOOL; + pub fn LookupIconIdFromDirectory( + presbits: PBYTE, + fIcon: BOOL, + ) -> c_int; + pub fn LookupIconIdFromDirectoryEx( + presbits: PBYTE, + fIcon: BOOL, + cxDesired: c_int, + cyDesired: c_int, + Flags: UINT, + ) -> c_int; + pub fn CreateIconFromResource( + presbits: PBYTE, + dwResSize: DWORD, + fIcon: BOOL, + dwVer: DWORD, + ) -> HICON; + pub fn CreateIconFromResourceEx( + presbits: PBYTE, + dwResSize: DWORD, + fIcon: BOOL, + dwVer: DWORD, + cxDesired: c_int, + cyDesired: c_int, + Flags: UINT, + ) -> HICON; +} +//10524 +pub const IMAGE_BITMAP: UINT = 0; +pub const IMAGE_ICON: UINT = 1; +pub const IMAGE_CURSOR: UINT = 2; +pub const IMAGE_ENHMETAFILE: UINT = 3; +pub const LR_DEFAULTCOLOR: UINT = 0x00000000; +pub const LR_MONOCHROME: UINT = 0x00000001; +pub const LR_COLOR: UINT = 0x00000002; +pub const LR_COPYRETURNORG: UINT = 0x00000004; +pub const LR_COPYDELETEORG: UINT = 0x00000008; +pub const LR_LOADFROMFILE: UINT = 0x00000010; +pub const LR_LOADTRANSPARENT: UINT = 0x00000020; +pub const LR_DEFAULTSIZE: UINT = 0x00000040; +pub const LR_VGACOLOR: UINT = 0x00000080; +pub const LR_LOADMAP3DCOLORS: UINT = 0x00001000; +pub const LR_CREATEDIBSECTION: UINT = 0x00002000; +pub const LR_COPYFROMRESOURCE: UINT = 0x00004000; +pub const LR_SHARED: UINT = 0x00008000; +extern "system" { + pub fn LoadImageA( + hInst: HINSTANCE, + name: LPCSTR, + type_: UINT, + cx: c_int, + cy: c_int, + fuLoad: UINT, + ) -> HANDLE; + pub fn LoadImageW( + hInst: HINSTANCE, + name: LPCWSTR, + type_: UINT, + cx: c_int, + cy: c_int, + fuLoad: UINT, + ) -> HANDLE; + pub fn CopyImage( + h: HANDLE, + type_: UINT, + cx: c_int, + cy: c_int, + flags: UINT, + ) -> HANDLE; +} +//10592 +extern "system" { + pub fn DrawIconEx( + hdc: HDC, + xLeft: c_int, + yTop: c_int, + hIcon: HICON, + cxWidth: c_int, + cyWidth: c_int, + istepIfAniCur: UINT, + hbrFlickerFreeDraw: HBRUSH, + diFlags: UINT, + ) -> BOOL; + pub fn CreateIconIndirect( + piconinfo: PICONINFO, + ) -> HICON; + pub fn CopyIcon( + hIcon: HICON, + ) -> HICON; + pub fn GetIconInfo( + hIcon: HICON, + piconinfo: PICONINFO, + ) -> BOOL; +} +//10781 +pub const IDI_APPLICATION: LPCWSTR = 32512 as LPCWSTR; +pub const IDI_HAND: LPCWSTR = 32513 as LPCWSTR; +pub const IDI_QUESTION: LPCWSTR = 32514 as LPCWSTR; +pub const IDI_EXCLAMATION: LPCWSTR = 32515 as LPCWSTR; +pub const IDI_ASTERISK: LPCWSTR = 32516 as LPCWSTR; +pub const IDI_WINLOGO: LPCWSTR = 32517 as LPCWSTR; +pub const IDI_SHIELD: LPCWSTR = 32518 as LPCWSTR; +pub const IDI_WARNING: LPCWSTR = IDI_EXCLAMATION; +pub const IDI_ERROR: LPCWSTR = IDI_HAND; +pub const IDI_INFORMATION: LPCWSTR = IDI_ASTERISK; +//10853 +pub const IDOK: c_int = 1; +pub const IDCANCEL: c_int = 2; +pub const IDABORT: c_int = 3; +pub const IDRETRY: c_int = 4; +pub const IDIGNORE: c_int = 5; +pub const IDYES: c_int = 6; +pub const IDNO: c_int = 7; +pub const IDCLOSE: c_int = 8; +pub const IDHELP: c_int = 9; +pub const IDTRYAGAIN: c_int = 10; +pub const IDCONTINUE: c_int = 11; +pub const IDTIMEOUT: c_int = 32000; +pub const ES_LEFT: DWORD = 0x0000; +pub const ES_CENTER: DWORD = 0x0001; +pub const ES_RIGHT: DWORD = 0x0002; +pub const ES_MULTILINE: DWORD = 0x0004; +pub const ES_UPPERCASE: DWORD = 0x0008; +pub const ES_LOWERCASE: DWORD = 0x0010; +pub const ES_PASSWORD: DWORD = 0x0020; +pub const ES_AUTOVSCROLL: DWORD = 0x0040; +pub const ES_AUTOHSCROLL: DWORD = 0x0080; +pub const ES_NOHIDESEL: DWORD = 0x0100; +pub const ES_OEMCONVERT: DWORD = 0x0400; +pub const ES_READONLY: DWORD = 0x0800; +pub const ES_WANTRETURN: DWORD = 0x1000; +pub const ES_NUMBER: DWORD = 0x2000; +pub const EN_SETFOCUS: WORD = 0x0100; +pub const EN_KILLFOCUS: WORD = 0x0200; +pub const EN_CHANGE: WORD = 0x0300; +pub const EN_UPDATE: WORD = 0x0400; +pub const EN_ERRSPACE: WORD = 0x0500; +pub const EN_MAXTEXT: WORD = 0x0501; +pub const EN_HSCROLL: WORD = 0x0601; +pub const EN_VSCROLL: WORD = 0x0602; +pub const EN_ALIGN_LTR_EC: WORD = 0x0700; +pub const EN_ALIGN_RTL_EC: WORD = 0x0701; +pub const EC_LEFTMARGIN: WORD = 0x0001; +pub const EC_RIGHTMARGIN: WORD = 0x0002; +pub const EC_USEFONTINFO: WORD = 0xffff; +pub const EMSIS_COMPOSITIONSTRING: WORD = 0x0001; +pub const EIMES_GETCOMPSTRATONCE: WORD = 0x0001; +pub const EIMES_CANCELCOMPSTRINFOCUS: WORD = 0x0002; +pub const EIMES_COMPLETECOMPSTRKILLFOCUS: WORD = 0x0004; +pub const EM_GETSEL: WORD = 0x00B0; +pub const EM_SETSEL: WORD = 0x00B1; +pub const EM_GETRECT: WORD = 0x00B2; +pub const EM_SETRECT: WORD = 0x00B3; +pub const EM_SETRECTNP: WORD = 0x00B4; +pub const EM_SCROLL: WORD = 0x00B5; +pub const EM_LINESCROLL: WORD = 0x00B6; +pub const EM_SCROLLCARET: WORD = 0x00B7; +pub const EM_GETMODIFY: WORD = 0x00B8; +pub const EM_SETMODIFY: WORD = 0x00B9; +pub const EM_GETLINECOUNT: WORD = 0x00BA; +pub const EM_LINEINDEX: WORD = 0x00BB; +pub const EM_SETHANDLE: WORD = 0x00BC; +pub const EM_GETHANDLE: WORD = 0x00BD; +pub const EM_GETTHUMB: WORD = 0x00BE; +pub const EM_LINELENGTH: WORD = 0x00C1; +pub const EM_REPLACESEL: WORD = 0x00C2; +pub const EM_GETLINE: WORD = 0x00C4; +pub const EM_LIMITTEXT: WORD = 0x00C5; +pub const EM_CANUNDO: WORD = 0x00C6; +pub const EM_UNDO: WORD = 0x00C7; +pub const EM_FMTLINES: WORD = 0x00C8; +pub const EM_LINEFROMCHAR: WORD = 0x00C9; +pub const EM_SETTABSTOPS: WORD = 0x00CB; +pub const EM_SETPASSWORDCHAR: WORD = 0x00CC; +pub const EM_EMPTYUNDOBUFFER: WORD = 0x00CD; +pub const EM_GETFIRSTVISIBLELINE: WORD = 0x00CE; +pub const EM_SETREADONLY: WORD = 0x00CF; +pub const EM_SETWORDBREAKPROC: WORD = 0x00D0; +pub const EM_GETWORDBREAKPROC: WORD = 0x00D1; +pub const EM_GETPASSWORDCHAR: WORD = 0x00D2; +pub const EM_SETMARGINS: WORD = 0x00D3; +pub const EM_GETMARGINS: WORD = 0x00D4; +pub const EM_SETLIMITTEXT: WORD = EM_LIMITTEXT; +pub const EM_GETLIMITTEXT: WORD = 0x00D5; +pub const EM_POSFROMCHAR: WORD = 0x00D6; +pub const EM_CHARFROMPOS: WORD = 0x00D7; +pub const EM_SETIMESTATUS: WORD = 0x00D8; +pub const EM_GETIMESTATUS: WORD = 0x00D9; +pub const WB_LEFT: WORD = 0; +pub const WB_RIGHT: WORD = 1; +pub const WB_ISDELIMITER: WORD = 2; +pub const BN_CLICKED: WORD = 0; +pub const BN_PAINT: WORD = 1; +pub const BN_HILITE: WORD = 2; +pub const BN_UNHILITE: WORD = 3; +pub const BN_DISABLE: WORD = 4; +pub const BN_DOUBLECLICKED: WORD = 5; +pub const BN_PUSHED: WORD = BN_HILITE; +pub const BN_UNPUSHED: WORD = BN_UNHILITE; +pub const BN_DBLCLK: WORD = BN_DOUBLECLICKED; +pub const BN_SETFOCUS: WORD = 6; +pub const BN_KILLFOCUS: WORD = 7; +pub const BS_PUSHBUTTON: DWORD = 0x00000000; +pub const BS_DEFPUSHBUTTON: DWORD = 0x00000001; +pub const BS_CHECKBOX: DWORD = 0x00000002; +pub const BS_AUTOCHECKBOX: DWORD = 0x00000003; +pub const BS_RADIOBUTTON: DWORD = 0x00000004; +pub const BS_3STATE: DWORD = 0x00000005; +pub const BS_AUTO3STATE: DWORD = 0x00000006; +pub const BS_GROUPBOX: DWORD = 0x00000007; +pub const BS_USERBUTTON: DWORD = 0x00000008; +pub const BS_AUTORADIOBUTTON: DWORD = 0x00000009; +pub const BS_PUSHBOX: DWORD = 0x0000000A; +pub const BS_OWNERDRAW: DWORD = 0x0000000B; +pub const BS_TYPEMASK: DWORD = 0x0000000F; +pub const BS_LEFTTEXT: DWORD = 0x00000020; +pub const BS_TEXT: DWORD = 0x00000000; +pub const BS_ICON: DWORD = 0x00000040; +pub const BS_BITMAP: DWORD = 0x00000080; +pub const BS_LEFT: DWORD = 0x00000100; +pub const BS_RIGHT: DWORD = 0x00000200; +pub const BS_CENTER: DWORD = 0x00000300; +pub const BS_TOP: DWORD = 0x00000400; +pub const BS_BOTTOM: DWORD = 0x00000800; +pub const BS_VCENTER: DWORD = 0x00000C00; +pub const BS_PUSHLIKE: DWORD = 0x00001000; +pub const BS_MULTILINE: DWORD = 0x00002000; +pub const BS_NOTIFY: DWORD = 0x00004000; +pub const BS_FLAT: DWORD = 0x00008000; +pub const BS_RIGHTBUTTON: DWORD = BS_LEFTTEXT; +pub const BM_GETCHECK: UINT = 0x00F0; +pub const BM_SETCHECK: UINT = 0x00F1; +pub const BM_GETSTATE: UINT = 0x00F2; +pub const BM_SETSTATE: UINT = 0x00F3; +pub const BM_SETSTYLE: UINT = 0x00F4; +pub const BM_CLICK: UINT = 0x00F5; +pub const BM_GETIMAGE: UINT = 0x00F6; +pub const BM_SETIMAGE: UINT = 0x00F7; +pub const BM_SETDONTCLICK: UINT = 0x00F8; +pub const BST_UNCHECKED: WPARAM = 0x0000; +pub const BST_CHECKED: WPARAM = 0x0001; +pub const BST_INDETERMINATE: WPARAM = 0x0002; +pub const BST_PUSHED: LRESULT = 0x0004; +pub const BST_FOCUS: LRESULT = 0x0008; +pub const SS_LEFT: DWORD = 0x00000000; +pub const SS_CENTER: DWORD = 0x00000001; +pub const SS_RIGHT: DWORD = 0x00000002; +pub const SS_ICON: DWORD = 0x00000003; +pub const SS_BLACKRECT: DWORD = 0x00000004; +pub const SS_GRAYRECT: DWORD = 0x00000005; +pub const SS_WHITERECT: DWORD = 0x00000006; +pub const SS_BLACKFRAME: DWORD = 0x00000007; +pub const SS_GRAYFRAME: DWORD = 0x00000008; +pub const SS_WHITEFRAME: DWORD = 0x00000009; +pub const SS_USERITEM: DWORD = 0x0000000A; +pub const SS_SIMPLE: DWORD = 0x0000000B; +pub const SS_LEFTNOWORDWRAP: DWORD = 0x0000000C; +pub const SS_OWNERDRAW: DWORD = 0x0000000D; +pub const SS_BITMAP: DWORD = 0x0000000E; +pub const SS_ENHMETAFILE: DWORD = 0x0000000F; +pub const SS_ETCHEDHORZ: DWORD = 0x00000010; +pub const SS_ETCHEDVERT: DWORD = 0x00000011; +pub const SS_ETCHEDFRAME: DWORD = 0x00000012; +pub const SS_TYPEMASK: DWORD = 0x0000001F; +pub const SS_REALSIZECONTROL: DWORD = 0x00000040; +pub const SS_NOPREFIX: DWORD = 0x00000080; +pub const SS_NOTIFY: DWORD = 0x00000100; +pub const SS_CENTERIMAGE: DWORD = 0x00000200; +pub const SS_RIGHTJUST: DWORD = 0x00000400; +pub const SS_REALSIZEIMAGE: DWORD = 0x00000800; +pub const SS_SUNKEN: DWORD = 0x00001000; +pub const SS_EDITCONTROL: DWORD = 0x00002000; +pub const SS_ENDELLIPSIS: DWORD = 0x00004000; +pub const SS_PATHELLIPSIS: DWORD = 0x00008000; +pub const SS_WORDELLIPSIS: DWORD = 0x0000C000; +pub const SS_ELLIPSISMASK: DWORD = 0x0000C000; +pub const STM_SETICON: UINT = 0x0170; +pub const STM_GETICON: UINT = 0x0171; +pub const STM_SETIMAGE: UINT = 0x0172; +pub const STM_GETIMAGE: UINT = 0x0173; +pub const STN_CLICKED: WORD = 0; +pub const STN_DBLCLK: WORD = 1; +pub const STN_ENABLE: WORD = 2; +pub const STN_DISABLE: WORD = 3; +pub const STM_MSGMAX: WORD = 0x0174; +//11194 +extern "system" { + pub fn IsDialogMessageA( + hDlg: HWND, + lpMsg: LPMSG, + ) -> BOOL; + pub fn IsDialogMessageW( + hDlg: HWND, + lpMsg: LPMSG, + ) -> BOOL; + pub fn MapDialogRect( + hDlg: HWND, + lpRect: LPRECT, + ) -> BOOL; + pub fn DlgDirListA( + hDlg: HWND, + lpPathSpec: LPSTR, + nIDListBox: c_int, + nIDStaticPath: c_int, + uFileType: UINT, + ) -> c_int; + pub fn DlgDirListW( + hDlg: HWND, + lpPathSpec: LPWSTR, + nIDListBox: c_int, + nIDStaticPath: c_int, + uFileType: UINT, + ) -> c_int; +} +//11265 +extern "system" { + pub fn DlgDirSelectExA( + hwndDlg: HWND, + lpString: LPSTR, + chCount: c_int, + idListBox: c_int, + ) -> BOOL; + pub fn DlgDirSelectExW( + hwndDlg: HWND, + lpString: LPWSTR, + chCount: c_int, + idListBox: c_int, + ) -> BOOL; + pub fn DlgDirListComboBoxA( + hDlg: HWND, + lpPathSpec: LPSTR, + nIDComboBox: c_int, + nIDStaticPath: c_int, + uFiletype: UINT, + ) -> c_int; + pub fn DlgDirListComboBoxW( + hDlg: HWND, + lpPathSpec: LPWSTR, + nIDComboBox: c_int, + nIDStaticPath: c_int, + uFiletype: UINT, + ) -> c_int; + pub fn DlgDirSelectComboBoxExA( + hwndDlg: HWND, + lpString: LPSTR, + cchOut: c_int, + idComboBox: c_int, + ) -> BOOL; + pub fn DlgDirSelectComboBoxExW( + hwndDlg: HWND, + lpString: LPWSTR, + cchOut: c_int, + idComboBox: c_int, + ) -> BOOL; +} +pub const DS_ABSALIGN: DWORD = 0x01; +pub const DS_SYSMODAL: DWORD = 0x02; +pub const DS_LOCALEDIT: DWORD = 0x20; +pub const DS_SETFONT: DWORD = 0x40; +pub const DS_MODALFRAME: DWORD = 0x80; +pub const DS_NOIDLEMSG: DWORD = 0x100; +pub const DS_SETFOREGROUND: DWORD = 0x200; +pub const DS_3DLOOK: DWORD = 0x0004; +pub const DS_FIXEDSYS: DWORD = 0x0008; +pub const DS_NOFAILCREATE: DWORD = 0x0010; +pub const DS_CONTROL: DWORD = 0x0400; +pub const DS_CENTER: DWORD = 0x0800; +pub const DS_CENTERMOUSE: DWORD = 0x1000; +pub const DS_CONTEXTHELP: DWORD = 0x2000; +pub const DS_SHELLFONT: DWORD = DS_SETFONT | DS_FIXEDSYS; +pub const DS_USEPIXELS: DWORD = 0x8000; +pub const DM_GETDEFID: UINT = WM_USER + 0; +pub const DM_SETDEFID: UINT = WM_USER + 1; +pub const DM_REPOSITION: UINT = WM_USER + 2; +pub const DC_HASDEFID: WORD = 0x534B; +pub const DLGC_WANTARROWS: LRESULT = 0x0001; +pub const DLGC_WANTTAB: LRESULT = 0x0002; +pub const DLGC_WANTALLKEYS: LRESULT = 0x0004; +pub const DLGC_WANTMESSAGE: LRESULT = 0x0004; +pub const DLGC_HASSETSEL: LRESULT = 0x0008; +pub const DLGC_DEFPUSHBUTTON: LRESULT = 0x0010; +pub const DLGC_UNDEFPUSHBUTTON: LRESULT = 0x0020; +pub const DLGC_RADIOBUTTON: LRESULT = 0x0040; +pub const DLGC_WANTCHARS: LRESULT = 0x0080; +pub const DLGC_STATIC: LRESULT = 0x0100; +pub const DLGC_BUTTON: LRESULT = 0x2000; +pub const LB_OKAY: LRESULT = 0; +pub const LB_ERR: LRESULT = -1; +pub const LB_ERRSPACE: LRESULT = -2; +pub const LBN_ERRSPACE: WORD = -2i16 as u16; +pub const LBN_SELCHANGE: WORD = 1; +pub const LBN_DBLCLK: WORD = 2; +pub const LBN_SELCANCEL: WORD = 3; +pub const LBN_SETFOCUS: WORD = 4; +pub const LBN_KILLFOCUS: WORD = 5; +pub const LB_ADDSTRING: UINT = 0x0180; +pub const LB_INSERTSTRING: UINT = 0x0181; +pub const LB_DELETESTRING: UINT = 0x0182; +pub const LB_SELITEMRANGEEX: UINT = 0x0183; +pub const LB_RESETCONTENT: UINT = 0x0184; +pub const LB_SETSEL: UINT = 0x0185; +pub const LB_SETCURSEL: UINT = 0x0186; +pub const LB_GETSEL: UINT = 0x0187; +pub const LB_GETCURSEL: UINT = 0x0188; +pub const LB_GETTEXT: UINT = 0x0189; +pub const LB_GETTEXTLEN: UINT = 0x018A; +pub const LB_GETCOUNT: UINT = 0x018B; +pub const LB_SELECTSTRING: UINT = 0x018C; +pub const LB_DIR: UINT = 0x018D; +pub const LB_GETTOPINDEX: UINT = 0x018E; +pub const LB_FINDSTRING: UINT = 0x018F; +pub const LB_GETSELCOUNT: UINT = 0x0190; +pub const LB_GETSELITEMS: UINT = 0x0191; +pub const LB_SETTABSTOPS: UINT = 0x0192; +pub const LB_GETHORIZONTALEXTENT: UINT = 0x0193; +pub const LB_SETHORIZONTALEXTENT: UINT = 0x0194; +pub const LB_SETCOLUMNWIDTH: UINT = 0x0195; +pub const LB_ADDFILE: UINT = 0x0196; +pub const LB_SETTOPINDEX: UINT = 0x0197; +pub const LB_GETITEMRECT: UINT = 0x0198; +pub const LB_GETITEMDATA: UINT = 0x0199; +pub const LB_SETITEMDATA: UINT = 0x019A; +pub const LB_SELITEMRANGE: UINT = 0x019B; +pub const LB_SETANCHORINDEX: UINT = 0x019C; +pub const LB_GETANCHORINDEX: UINT = 0x019D; +pub const LB_SETCARETINDEX: UINT = 0x019E; +pub const LB_GETCARETINDEX: UINT = 0x019F; +pub const LB_SETITEMHEIGHT: UINT = 0x01A0; +pub const LB_GETITEMHEIGHT: UINT = 0x01A1; +pub const LB_FINDSTRINGEXACT: UINT = 0x01A2; +pub const LB_SETLOCALE: UINT = 0x01A5; +pub const LB_GETLOCALE: UINT = 0x01A6; +pub const LB_SETCOUNT: UINT = 0x01A7; +pub const LB_INITSTORAGE: UINT = 0x01A8; +pub const LB_ITEMFROMPOINT: UINT = 0x01A9; +pub const LB_MULTIPLEADDSTRING: UINT = 0x01B1; +pub const LB_GETLISTBOXINFO: UINT = 0x01B2; +pub const LB_MSGMAX: UINT = 0x01B3; +pub const LBS_NOTIFY: DWORD = 0x0001; +pub const LBS_SORT: DWORD = 0x0002; +pub const LBS_NOREDRAW: DWORD = 0x0004; +pub const LBS_MULTIPLESEL: DWORD = 0x0008; +pub const LBS_OWNERDRAWFIXED: DWORD = 0x0010; +pub const LBS_OWNERDRAWVARIABLE: DWORD = 0x0020; +pub const LBS_HASSTRINGS: DWORD = 0x0040; +pub const LBS_USETABSTOPS: DWORD = 0x0080; +pub const LBS_NOINTEGRALHEIGHT: DWORD = 0x0100; +pub const LBS_MULTICOLUMN: DWORD = 0x0200; +pub const LBS_WANTKEYBOARDINPUT: DWORD = 0x0400; +pub const LBS_EXTENDEDSEL: DWORD = 0x0800; +pub const LBS_DISABLENOSCROLL: DWORD = 0x1000; +pub const LBS_NODATA: DWORD = 0x2000; +pub const LBS_NOSEL: DWORD = 0x4000; +pub const LBS_COMBOBOX: DWORD = 0x8000; +pub const LBS_STANDARD: DWORD = LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER; +pub const CB_OKAY: LRESULT = 0; +pub const CB_ERR: LRESULT = -1; +pub const CB_ERRSPACE: LRESULT = -2; +pub const CBN_ERRSPACE: WORD = -1i16 as u16; +pub const CBN_SELCHANGE: WORD = 1; +pub const CBN_DBLCLK: WORD = 2; +pub const CBN_SETFOCUS: WORD = 3; +pub const CBN_KILLFOCUS: WORD = 4; +pub const CBN_EDITCHANGE: WORD = 5; +pub const CBN_EDITUPDATE: WORD = 6; +pub const CBN_DROPDOWN: WORD = 7; +pub const CBN_CLOSEUP: WORD = 8; +pub const CBN_SELENDOK: WORD = 9; +pub const CBN_SELENDCANCEL: WORD = 10; +pub const CBS_SIMPLE: DWORD = 0x0001; +pub const CBS_DROPDOWN: DWORD = 0x0002; +pub const CBS_DROPDOWNLIST: DWORD = 0x0003; +pub const CBS_OWNERDRAWFIXED: DWORD = 0x0010; +pub const CBS_OWNERDRAWVARIABLE: DWORD = 0x0020; +pub const CBS_AUTOHSCROLL: DWORD = 0x0040; +pub const CBS_OEMCONVERT: DWORD = 0x0080; +pub const CBS_SORT: DWORD = 0x0100; +pub const CBS_HASSTRINGS: DWORD = 0x0200; +pub const CBS_NOINTEGRALHEIGHT: DWORD = 0x0400; +pub const CBS_DISABLENOSCROLL: DWORD = 0x0800; +pub const CBS_UPPERCASE: DWORD = 0x2000; +pub const CBS_LOWERCASE: DWORD = 0x4000; +//11571 +pub const CB_GETEDITSEL: UINT = 0x0140; +pub const CB_LIMITTEXT: UINT = 0x0141; +pub const CB_SETEDITSEL: UINT = 0x0142; +pub const CB_ADDSTRING: UINT = 0x0143; +pub const CB_DELETESTRING: UINT = 0x0144; +pub const CB_DIR: UINT = 0x0145; +pub const CB_GETCOUNT: UINT = 0x0146; +pub const CB_GETCURSEL: UINT = 0x0147; +pub const CB_GETLBTEXT: UINT = 0x0148; +pub const CB_GETLBTEXTLEN: UINT = 0x0149; +pub const CB_INSERTSTRING: UINT = 0x014A; +pub const CB_RESETCONTENT: UINT = 0x014B; +pub const CB_FINDSTRING: UINT = 0x014C; +pub const CB_SELECTSTRING: UINT = 0x014D; +pub const CB_SETCURSEL: UINT = 0x014E; +pub const CB_SHOWDROPDOWN: UINT = 0x014F; +pub const CB_GETITEMDATA: UINT = 0x0150; +pub const CB_SETITEMDATA: UINT = 0x0151; +pub const CB_GETDROPPEDCONTROLRECT: UINT = 0x0152; +pub const CB_SETITEMHEIGHT: UINT = 0x0153; +pub const CB_GETITEMHEIGHT: UINT = 0x0154; +pub const CB_SETEXTENDEDUI: UINT = 0x0155; +pub const CB_GETEXTENDEDUI: UINT = 0x0156; +pub const CB_GETDROPPEDSTATE: UINT = 0x0157; +pub const CB_FINDSTRINGEXACT: UINT = 0x0158; +pub const CB_SETLOCALE: UINT = 0x0159; +pub const CB_GETLOCALE: UINT = 0x015A; +pub const CB_GETTOPINDEX: UINT = 0x015b; +pub const CB_SETTOPINDEX: UINT = 0x015c; +pub const CB_GETHORIZONTALEXTENT: UINT = 0x015d; +pub const CB_SETHORIZONTALEXTENT: UINT = 0x015e; +pub const CB_GETDROPPEDWIDTH: UINT = 0x015f; +pub const CB_SETDROPPEDWIDTH: UINT = 0x0160; +pub const CB_INITSTORAGE: UINT = 0x0161; +pub const CB_MULTIPLEADDSTRING: UINT = 0x0163; +pub const CB_GETCOMBOBOXINFO: UINT = 0x0164; +pub const CB_MSGMAX: UINT = 0x0165; +pub const SBS_HORZ: DWORD = 0x0000; +pub const SBS_VERT: DWORD = 0x0001; +pub const SBS_TOPALIGN: DWORD = 0x0002; +pub const SBS_LEFTALIGN: DWORD = 0x0002; +pub const SBS_BOTTOMALIGN: DWORD = 0x0004; +pub const SBS_RIGHTALIGN: DWORD = 0x0004; +pub const SBS_SIZEBOXTOPLEFTALIGN: DWORD = 0x0002; +pub const SBS_SIZEBOXBOTTOMRIGHTALIGN: DWORD = 0x0004; +pub const SBS_SIZEBOX: DWORD = 0x0008; +pub const SBS_SIZEGRIP: DWORD = 0x0010; +pub const SBM_SETPOS: UINT = 0x00E0; +pub const SBM_GETPOS: UINT = 0x00E1; +pub const SBM_SETRANGE: UINT = 0x00E2; +pub const SBM_SETRANGEREDRAW: UINT = 0x00E6; +pub const SBM_GETRANGE: UINT = 0x00E3; +pub const SBM_ENABLE_ARROWS: UINT = 0x00E4; +pub const SBM_SETSCROLLINFO: UINT = 0x00E9; +pub const SBM_GETSCROLLINFO: UINT = 0x00EA; +pub const SBM_GETSCROLLBARINFO: UINT = 0x00EB; +pub const SIF_RANGE: UINT = 0x0001; +pub const SIF_PAGE: UINT = 0x0002; +pub const SIF_POS: UINT = 0x0004; +pub const SIF_DISABLENOSCROLL: UINT = 0x0008; +pub const SIF_TRACKPOS: UINT = 0x0010; +pub const SIF_ALL: UINT = SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS; +STRUCT!{struct SCROLLINFO { + cbSize: UINT, + fMask: UINT, + nMin: c_int, + nMax: c_int, + nPage: UINT, + nPos: c_int, + nTrackPos: c_int, +}} +pub type LPSCROLLINFO = *mut SCROLLINFO; +pub type LPCSCROLLINFO = *const SCROLLINFO; +extern "system" { + pub fn SetScrollInfo( + hwnd: HWND, + nBar: c_int, + lpsi: *const SCROLLINFO, + redraw: BOOL, + ) -> c_int; + pub fn GetScrollInfo( + hwnd: HWND, + nBar: c_int, + lpsi: *mut SCROLLINFO, + ) -> BOOL; +} +pub const MDITILE_VERTICAL: UINT = 0x0000; +pub const MDITILE_HORIZONTAL: UINT = 0x0001; +pub const MDITILE_SKIPDISABLED: UINT = 0x0002; +pub const MDITILE_ZORDER: UINT = 0x0004; +//11776 +extern "system" { + pub fn DefFrameProcA( + hwnd: HWND, + hwndMDIClient: HWND, + uMsg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn DefFrameProcW( + hwnd: HWND, + hwndMDIClient: HWND, + uMsg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn DefMDIChildProcA( + hwnd: HWND, + uMsg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn DefMDIChildProcW( + hwnd: HWND, + uMsg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; + pub fn ArrangeIconicWindows( + hWnd: HWND, + ) -> UINT; + pub fn CreateMDIWindowA( + lpClassName: LPCSTR, + lpWindowName: LPCSTR, + dwStyle: DWORD, + X: c_int, + Y: c_int, + nWidth: c_int, + nHeight: c_int, + hWndParent: HWND, + hInstance: HINSTANCE, + lParam: LPARAM, + ) -> HWND; + pub fn CreateMDIWindowW( + lpClassName: LPCWSTR, + lpWindowName: LPCWSTR, + dwStyle: DWORD, + X: c_int, + Y: c_int, + nWidth: c_int, + nHeight: c_int, + hWndParent: HWND, + hInstance: HINSTANCE, + lParam: LPARAM, + ) -> HWND; + pub fn CascadeWindows( + hwndParent: HWND, + wHow: UINT, + lpRect: *const RECT, + cKids: UINT, + lpKids: *const HWND, + ) -> WORD; +} +//12016 +extern "system" { + pub fn WinHelpA( + hWndMain: HWND, + lpszHelp: LPCSTR, + uCommand: UINT, + dwData: ULONG_PTR, + ) -> BOOL; + pub fn WinHelpW( + hWndMain: HWND, + lpszHelp: LPCWSTR, + uCommand: UINT, + dwData: ULONG_PTR, + ) -> BOOL; +} +//12083 +pub const SPI_GETBEEP: UINT = 0x0001; +pub const SPI_SETBEEP: UINT = 0x0002; +pub const SPI_GETMOUSE: UINT = 0x0003; +pub const SPI_SETMOUSE: UINT = 0x0004; +pub const SPI_GETBORDER: UINT = 0x0005; +pub const SPI_SETBORDER: UINT = 0x0006; +pub const SPI_GETKEYBOARDSPEED: UINT = 0x000A; +pub const SPI_SETKEYBOARDSPEED: UINT = 0x000B; +pub const SPI_LANGDRIVER: UINT = 0x000C; +pub const SPI_ICONHORIZONTALSPACING: UINT = 0x000D; +pub const SPI_GETSCREENSAVETIMEOUT: UINT = 0x000E; +pub const SPI_SETSCREENSAVETIMEOUT: UINT = 0x000F; +pub const SPI_GETSCREENSAVEACTIVE: UINT = 0x0010; +pub const SPI_SETSCREENSAVEACTIVE: UINT = 0x0011; +pub const SPI_GETGRIDGRANULARITY: UINT = 0x0012; +pub const SPI_SETGRIDGRANULARITY: UINT = 0x0013; +pub const SPI_SETDESKWALLPAPER: UINT = 0x0014; +pub const SPI_SETDESKPATTERN: UINT = 0x0015; +pub const SPI_GETKEYBOARDDELAY: UINT = 0x0016; +pub const SPI_SETKEYBOARDDELAY: UINT = 0x0017; +pub const SPI_ICONVERTICALSPACING: UINT = 0x0018; +pub const SPI_GETICONTITLEWRAP: UINT = 0x0019; +pub const SPI_SETICONTITLEWRAP: UINT = 0x001A; +pub const SPI_GETMENUDROPALIGNMENT: UINT = 0x001B; +pub const SPI_SETMENUDROPALIGNMENT: UINT = 0x001C; +pub const SPI_SETDOUBLECLKWIDTH: UINT = 0x001D; +pub const SPI_SETDOUBLECLKHEIGHT: UINT = 0x001E; +pub const SPI_GETICONTITLELOGFONT: UINT = 0x001F; +pub const SPI_SETDOUBLECLICKTIME: UINT = 0x0020; +pub const SPI_SETMOUSEBUTTONSWAP: UINT = 0x0021; +pub const SPI_SETICONTITLELOGFONT: UINT = 0x0022; +pub const SPI_GETFASTTASKSWITCH: UINT = 0x0023; +pub const SPI_SETFASTTASKSWITCH: UINT = 0x0024; +pub const SPI_SETDRAGFULLWINDOWS: UINT = 0x0025; +pub const SPI_GETDRAGFULLWINDOWS: UINT = 0x0026; +pub const SPI_GETNONCLIENTMETRICS: UINT = 0x0029; +pub const SPI_SETNONCLIENTMETRICS: UINT = 0x002A; +pub const SPI_GETMINIMIZEDMETRICS: UINT = 0x002B; +pub const SPI_SETMINIMIZEDMETRICS: UINT = 0x002C; +pub const SPI_GETICONMETRICS: UINT = 0x002D; +pub const SPI_SETICONMETRICS: UINT = 0x002E; +pub const SPI_SETWORKAREA: UINT = 0x002F; +pub const SPI_GETWORKAREA: UINT = 0x0030; +pub const SPI_SETPENWINDOWS: UINT = 0x0031; +pub const SPI_GETHIGHCONTRAST: UINT = 0x0042; +pub const SPI_SETHIGHCONTRAST: UINT = 0x0043; +pub const SPI_GETKEYBOARDPREF: UINT = 0x0044; +pub const SPI_SETKEYBOARDPREF: UINT = 0x0045; +pub const SPI_GETSCREENREADER: UINT = 0x0046; +pub const SPI_SETSCREENREADER: UINT = 0x0047; +pub const SPI_GETANIMATION: UINT = 0x0048; +pub const SPI_SETANIMATION: UINT = 0x0049; +pub const SPI_GETFONTSMOOTHING: UINT = 0x004A; +pub const SPI_SETFONTSMOOTHING: UINT = 0x004B; +pub const SPI_SETDRAGWIDTH: UINT = 0x004C; +pub const SPI_SETDRAGHEIGHT: UINT = 0x004D; +pub const SPI_SETHANDHELD: UINT = 0x004E; +pub const SPI_GETLOWPOWERTIMEOUT: UINT = 0x004F; +pub const SPI_GETPOWEROFFTIMEOUT: UINT = 0x0050; +pub const SPI_SETLOWPOWERTIMEOUT: UINT = 0x0051; +pub const SPI_SETPOWEROFFTIMEOUT: UINT = 0x0052; +pub const SPI_GETLOWPOWERACTIVE: UINT = 0x0053; +pub const SPI_GETPOWEROFFACTIVE: UINT = 0x0054; +pub const SPI_SETLOWPOWERACTIVE: UINT = 0x0055; +pub const SPI_SETPOWEROFFACTIVE: UINT = 0x0056; +pub const SPI_SETCURSORS: UINT = 0x0057; +pub const SPI_SETICONS: UINT = 0x0058; +pub const SPI_GETDEFAULTINPUTLANG: UINT = 0x0059; +pub const SPI_SETDEFAULTINPUTLANG: UINT = 0x005A; +pub const SPI_SETLANGTOGGLE: UINT = 0x005B; +pub const SPI_GETWINDOWSEXTENSION: UINT = 0x005C; +pub const SPI_SETMOUSETRAILS: UINT = 0x005D; +pub const SPI_GETMOUSETRAILS: UINT = 0x005E; +pub const SPI_SETSCREENSAVERRUNNING: UINT = 0x0061; +pub const SPI_SCREENSAVERRUNNING: UINT = SPI_SETSCREENSAVERRUNNING; +pub const SPI_GETFILTERKEYS: UINT = 0x0032; +pub const SPI_SETFILTERKEYS: UINT = 0x0033; +pub const SPI_GETTOGGLEKEYS: UINT = 0x0034; +pub const SPI_SETTOGGLEKEYS: UINT = 0x0035; +pub const SPI_GETMOUSEKEYS: UINT = 0x0036; +pub const SPI_SETMOUSEKEYS: UINT = 0x0037; +pub const SPI_GETSHOWSOUNDS: UINT = 0x0038; +pub const SPI_SETSHOWSOUNDS: UINT = 0x0039; +pub const SPI_GETSTICKYKEYS: UINT = 0x003A; +pub const SPI_SETSTICKYKEYS: UINT = 0x003B; +pub const SPI_GETACCESSTIMEOUT: UINT = 0x003C; +pub const SPI_SETACCESSTIMEOUT: UINT = 0x003D; +pub const SPI_GETSERIALKEYS: UINT = 0x003E; +pub const SPI_SETSERIALKEYS: UINT = 0x003F; +pub const SPI_GETSOUNDSENTRY: UINT = 0x0040; +pub const SPI_SETSOUNDSENTRY: UINT = 0x0041; +pub const SPI_GETSNAPTODEFBUTTON: UINT = 0x005F; +pub const SPI_SETSNAPTODEFBUTTON: UINT = 0x0060; +pub const SPI_GETMOUSEHOVERWIDTH: UINT = 0x0062; +pub const SPI_SETMOUSEHOVERWIDTH: UINT = 0x0063; +pub const SPI_GETMOUSEHOVERHEIGHT: UINT = 0x0064; +pub const SPI_SETMOUSEHOVERHEIGHT: UINT = 0x0065; +pub const SPI_GETMOUSEHOVERTIME: UINT = 0x0066; +pub const SPI_SETMOUSEHOVERTIME: UINT = 0x0067; +pub const SPI_GETWHEELSCROLLLINES: UINT = 0x0068; +pub const SPI_SETWHEELSCROLLLINES: UINT = 0x0069; +pub const SPI_GETMENUSHOWDELAY: UINT = 0x006A; +pub const SPI_SETMENUSHOWDELAY: UINT = 0x006B; +pub const SPI_GETWHEELSCROLLCHARS: UINT = 0x006C; +pub const SPI_SETWHEELSCROLLCHARS: UINT = 0x006D; +pub const SPI_GETSHOWIMEUI: UINT = 0x006E; +pub const SPI_SETSHOWIMEUI: UINT = 0x006F; +pub const SPI_GETMOUSESPEED: UINT = 0x0070; +pub const SPI_SETMOUSESPEED: UINT = 0x0071; +pub const SPI_GETSCREENSAVERRUNNING: UINT = 0x0072; +pub const SPI_GETDESKWALLPAPER: UINT = 0x0073; +pub const SPI_GETAUDIODESCRIPTION: UINT = 0x0074; +pub const SPI_SETAUDIODESCRIPTION: UINT = 0x0075; +pub const SPI_GETSCREENSAVESECURE: UINT = 0x0076; +pub const SPI_SETSCREENSAVESECURE: UINT = 0x0077; +pub const SPI_GETHUNGAPPTIMEOUT: UINT = 0x0078; +pub const SPI_SETHUNGAPPTIMEOUT: UINT = 0x0079; +pub const SPI_GETWAITTOKILLTIMEOUT: UINT = 0x007A; +pub const SPI_SETWAITTOKILLTIMEOUT: UINT = 0x007B; +pub const SPI_GETWAITTOKILLSERVICETIMEOUT: UINT = 0x007C; +pub const SPI_SETWAITTOKILLSERVICETIMEOUT: UINT = 0x007D; +pub const SPI_GETMOUSEDOCKTHRESHOLD: UINT = 0x007E; +pub const SPI_SETMOUSEDOCKTHRESHOLD: UINT = 0x007F; +pub const SPI_GETPENDOCKTHRESHOLD: UINT = 0x0080; +pub const SPI_SETPENDOCKTHRESHOLD: UINT = 0x0081; +pub const SPI_GETWINARRANGING: UINT = 0x0082; +pub const SPI_SETWINARRANGING: UINT = 0x0083; +pub const SPI_GETMOUSEDRAGOUTTHRESHOLD: UINT = 0x0084; +pub const SPI_SETMOUSEDRAGOUTTHRESHOLD: UINT = 0x0085; +pub const SPI_GETPENDRAGOUTTHRESHOLD: UINT = 0x0086; +pub const SPI_SETPENDRAGOUTTHRESHOLD: UINT = 0x0087; +pub const SPI_GETMOUSESIDEMOVETHRESHOLD: UINT = 0x0088; +pub const SPI_SETMOUSESIDEMOVETHRESHOLD: UINT = 0x0089; +pub const SPI_GETPENSIDEMOVETHRESHOLD: UINT = 0x008A; +pub const SPI_SETPENSIDEMOVETHRESHOLD: UINT = 0x008B; +pub const SPI_GETDRAGFROMMAXIMIZE: UINT = 0x008C; +pub const SPI_SETDRAGFROMMAXIMIZE: UINT = 0x008D; +pub const SPI_GETSNAPSIZING: UINT = 0x008E; +pub const SPI_SETSNAPSIZING: UINT = 0x008F; +pub const SPI_GETDOCKMOVING: UINT = 0x0090; +pub const SPI_SETDOCKMOVING: UINT = 0x0091; +pub const SPI_GETACTIVEWINDOWTRACKING: UINT = 0x1000; +pub const SPI_SETACTIVEWINDOWTRACKING: UINT = 0x1001; +pub const SPI_GETMENUANIMATION: UINT = 0x1002; +pub const SPI_SETMENUANIMATION: UINT = 0x1003; +pub const SPI_GETCOMBOBOXANIMATION: UINT = 0x1004; +pub const SPI_SETCOMBOBOXANIMATION: UINT = 0x1005; +pub const SPI_GETLISTBOXSMOOTHSCROLLING: UINT = 0x1006; +pub const SPI_SETLISTBOXSMOOTHSCROLLING: UINT = 0x1007; +pub const SPI_GETGRADIENTCAPTIONS: UINT = 0x1008; +pub const SPI_SETGRADIENTCAPTIONS: UINT = 0x1009; +pub const SPI_GETKEYBOARDCUES: UINT = 0x100A; +pub const SPI_SETKEYBOARDCUES: UINT = 0x100B; +pub const SPI_GETMENUUNDERLINES: UINT = SPI_GETKEYBOARDCUES; +pub const SPI_SETMENUUNDERLINES: UINT = SPI_SETKEYBOARDCUES; +pub const SPI_GETACTIVEWNDTRKZORDER: UINT = 0x100C; +pub const SPI_SETACTIVEWNDTRKZORDER: UINT = 0x100D; +pub const SPI_GETHOTTRACKING: UINT = 0x100E; +pub const SPI_SETHOTTRACKING: UINT = 0x100F; +pub const SPI_GETMENUFADE: UINT = 0x1012; +pub const SPI_SETMENUFADE: UINT = 0x1013; +pub const SPI_GETSELECTIONFADE: UINT = 0x1014; +pub const SPI_SETSELECTIONFADE: UINT = 0x1015; +pub const SPI_GETTOOLTIPANIMATION: UINT = 0x1016; +pub const SPI_SETTOOLTIPANIMATION: UINT = 0x1017; +pub const SPI_GETTOOLTIPFADE: UINT = 0x1018; +pub const SPI_SETTOOLTIPFADE: UINT = 0x1019; +pub const SPI_GETCURSORSHADOW: UINT = 0x101A; +pub const SPI_SETCURSORSHADOW: UINT = 0x101B; +pub const SPI_GETMOUSESONAR: UINT = 0x101C; +pub const SPI_SETMOUSESONAR: UINT = 0x101D; +pub const SPI_GETMOUSECLICKLOCK: UINT = 0x101E; +pub const SPI_SETMOUSECLICKLOCK: UINT = 0x101F; +pub const SPI_GETMOUSEVANISH: UINT = 0x1020; +pub const SPI_SETMOUSEVANISH: UINT = 0x1021; +pub const SPI_GETFLATMENU: UINT = 0x1022; +pub const SPI_SETFLATMENU: UINT = 0x1023; +pub const SPI_GETDROPSHADOW: UINT = 0x1024; +pub const SPI_SETDROPSHADOW: UINT = 0x1025; +pub const SPI_GETBLOCKSENDINPUTRESETS: UINT = 0x1026; +pub const SPI_SETBLOCKSENDINPUTRESETS: UINT = 0x1027; +pub const SPI_GETUIEFFECTS: UINT = 0x103E; +pub const SPI_SETUIEFFECTS: UINT = 0x103F; +pub const SPI_GETDISABLEOVERLAPPEDCONTENT: UINT = 0x1040; +pub const SPI_SETDISABLEOVERLAPPEDCONTENT: UINT = 0x1041; +pub const SPI_GETCLIENTAREAANIMATION: UINT = 0x1042; +pub const SPI_SETCLIENTAREAANIMATION: UINT = 0x1043; +pub const SPI_GETCLEARTYPE: UINT = 0x1048; +pub const SPI_SETCLEARTYPE: UINT = 0x1049; +pub const SPI_GETSPEECHRECOGNITION: UINT = 0x104A; +pub const SPI_SETSPEECHRECOGNITION: UINT = 0x104B; +pub const SPI_GETFOREGROUNDLOCKTIMEOUT: UINT = 0x2000; +pub const SPI_SETFOREGROUNDLOCKTIMEOUT: UINT = 0x2001; +pub const SPI_GETACTIVEWNDTRKTIMEOUT: UINT = 0x2002; +pub const SPI_SETACTIVEWNDTRKTIMEOUT: UINT = 0x2003; +pub const SPI_GETFOREGROUNDFLASHCOUNT: UINT = 0x2004; +pub const SPI_SETFOREGROUNDFLASHCOUNT: UINT = 0x2005; +pub const SPI_GETCARETWIDTH: UINT = 0x2006; +pub const SPI_SETCARETWIDTH: UINT = 0x2007; +pub const SPI_GETMOUSECLICKLOCKTIME: UINT = 0x2008; +pub const SPI_SETMOUSECLICKLOCKTIME: UINT = 0x2009; +pub const SPI_GETFONTSMOOTHINGTYPE: UINT = 0x200A; +pub const SPI_SETFONTSMOOTHINGTYPE: UINT = 0x200B; +pub const FE_FONTSMOOTHINGSTANDARD: UINT = 0x0001; +pub const FE_FONTSMOOTHINGCLEARTYPE: UINT = 0x0002; +pub const SPI_GETFONTSMOOTHINGCONTRAST: UINT = 0x200C; +pub const SPI_SETFONTSMOOTHINGCONTRAST: UINT = 0x200D; +pub const SPI_GETFOCUSBORDERWIDTH: UINT = 0x200E; +pub const SPI_SETFOCUSBORDERWIDTH: UINT = 0x200F; +pub const SPI_GETFOCUSBORDERHEIGHT: UINT = 0x2010; +pub const SPI_SETFOCUSBORDERHEIGHT: UINT = 0x2011; +pub const SPI_GETFONTSMOOTHINGORIENTATION: UINT = 0x2012; +pub const SPI_SETFONTSMOOTHINGORIENTATION: UINT = 0x2013; +pub const FE_FONTSMOOTHINGORIENTATIONBGR: UINT = 0x0000; +pub const FE_FONTSMOOTHINGORIENTATIONRGB: UINT = 0x0001; +pub const SPI_GETMINIMUMHITRADIUS: UINT = 0x2014; +pub const SPI_SETMINIMUMHITRADIUS: UINT = 0x2015; +pub const SPI_GETMESSAGEDURATION: UINT = 0x2016; +pub const SPI_SETMESSAGEDURATION: UINT = 0x2017; +//12472 +pub const SPIF_UPDATEINIFILE: UINT = 0x0001; +pub const SPIF_SENDWININICHANGE: UINT = 0x0002; +pub const SPIF_SENDCHANGE: UINT = SPIF_SENDWININICHANGE; +//12484 +STRUCT!{struct NONCLIENTMETRICSA { + cbSize: UINT, + iBorderWidth: c_int, + iScrollWidth: c_int, + iScrollHeight: c_int, + iCaptionWidth: c_int, + iCaptionHeight: c_int, + lfCaptionFont: LOGFONTA, + iSmCaptionWidth: c_int, + iSmCaptionHeight: c_int, + lfSmCaptionFont: LOGFONTA, + iMenuWidth: c_int, + iMenuHeight: c_int, + lfMenuFont: LOGFONTA, + lfStatusFont: LOGFONTA, + lfMessageFont: LOGFONTA, + iPaddedBorderWidth: c_int, +}} +pub type LPNONCLIENTMETRICSA = *mut NONCLIENTMETRICSA; +STRUCT!{struct NONCLIENTMETRICSW { + cbSize: UINT, + iBorderWidth: c_int, + iScrollWidth: c_int, + iScrollHeight: c_int, + iCaptionWidth: c_int, + iCaptionHeight: c_int, + lfCaptionFont: LOGFONTW, + iSmCaptionWidth: c_int, + iSmCaptionHeight: c_int, + lfSmCaptionFont: LOGFONTW, + iMenuWidth: c_int, + iMenuHeight: c_int, + lfMenuFont: LOGFONTW, + lfStatusFont: LOGFONTW, + lfMessageFont: LOGFONTW, + iPaddedBorderWidth: c_int, +}} +pub type LPNONCLIENTMETRICSW = *mut NONCLIENTMETRICSW; +//12598 +STRUCT!{struct ANIMATIONINFO { + cbSize: UINT, + iMinAnimate: c_int, +}} +pub type LPANIMATIONINFO = *mut ANIMATIONINFO; +//12638 +STRUCT!{struct HIGHCONTRASTA { + cbSize: UINT, + dwFlags: DWORD, + lpszDefaultScheme: LPSTR, +}} +pub type LPHIGHCONTRASTA = *mut HIGHCONTRASTA; +STRUCT!{struct HIGHCONTRASTW { + cbSize: UINT, + dwFlags: DWORD, + lpszDefaultScheme: LPWSTR, +}} +pub type LPHIGHCONTRASTW = *mut HIGHCONTRASTW; +pub const HCF_HIGHCONTRASTON: DWORD = 0x00000001; +pub const HCF_AVAILABLE: DWORD = 0x00000002; +pub const HCF_HOTKEYACTIVE: DWORD = 0x00000004; +pub const HCF_CONFIRMHOTKEY: DWORD = 0x00000008; +pub const HCF_HOTKEYSOUND: DWORD = 0x00000010; +pub const HCF_INDICATOR: DWORD = 0x00000020; +pub const HCF_HOTKEYAVAILABLE: DWORD = 0x00000040; +pub const HCF_LOGONDESKTOP: DWORD = 0x00000100; +pub const HCF_DEFAULTDESKTOP: DWORD = 0x00000200; +pub const CDS_UPDATEREGISTRY: DWORD = 0x00000001; +pub const CDS_TEST: DWORD = 0x00000002; +pub const CDS_FULLSCREEN: DWORD = 0x00000004; +pub const CDS_GLOBAL: DWORD = 0x00000008; +pub const CDS_SET_PRIMARY: DWORD = 0x00000010; +pub const CDS_VIDEOPARAMETERS: DWORD = 0x00000020; +pub const CDS_ENABLE_UNSAFE_MODES: DWORD = 0x00000100; +pub const CDS_DISABLE_UNSAFE_MODES: DWORD = 0x00000200; +pub const CDS_RESET: DWORD = 0x40000000; +pub const CDS_RESET_EX: DWORD = 0x20000000; +pub const CDS_NORESET: DWORD = 0x10000000; +pub const DISP_CHANGE_SUCCESSFUL: LONG = 0; +pub const DISP_CHANGE_RESTART: LONG = 1; +pub const DISP_CHANGE_FAILED: LONG = -1; +pub const DISP_CHANGE_BADMODE: LONG = -2; +pub const DISP_CHANGE_NOTUPDATED: LONG = -3; +pub const DISP_CHANGE_BADFLAGS: LONG = -4; +pub const DISP_CHANGE_BADPARAM: LONG = -5; +pub const DISP_CHANGE_BADDUALVIEW: LONG = -6; +extern "system" { + pub fn ChangeDisplaySettingsA( + lpDevMode: *mut DEVMODEA, + dwFlags: DWORD, + ) -> LONG; + pub fn ChangeDisplaySettingsW( + lpDevMode: *mut DEVMODEW, + dwFlags: DWORD, + ) -> LONG; + pub fn ChangeDisplaySettingsExA( + lpszDeviceName: LPCSTR, + lpDevMode: *mut DEVMODEA, + hwnd: HWND, + dwFlags: DWORD, + lParam: LPVOID, + ) -> LONG; + pub fn ChangeDisplaySettingsExW( + lpszDeviceName: LPCWSTR, + lpDevMode: *mut DEVMODEW, + hwnd: HWND, + dwFlags: DWORD, + lParam: LPVOID, + ) -> LONG; +} +pub const ENUM_CURRENT_SETTINGS: DWORD = 0xFFFFFFFF; +pub const ENUM_REGISTRY_SETTINGS: DWORD = 0xFFFFFFFE; +extern "system" { + pub fn EnumDisplaySettingsA( + lpszDeviceName: LPCSTR, + iModeNum: DWORD, + lpDevMode: *mut DEVMODEA, + ) -> BOOL; + pub fn EnumDisplaySettingsW( + lpszDeviceName: LPCWSTR, + iModeNum: DWORD, + lpDevMode: *mut DEVMODEW, + ) -> BOOL; + pub fn EnumDisplaySettingsExA( + lpszDeviceName: LPCSTR, + iModeNum: DWORD, + lpDevMode: *mut DEVMODEA, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumDisplaySettingsExW( + lpszDeviceName: LPCWSTR, + iModeNum: DWORD, + lpDevMode: *mut DEVMODEW, + dwFlags: DWORD, + ) -> BOOL; +} +pub const EDS_RAWMODE: DWORD = 0x00000002; +pub const EDS_ROTATEDMODE: DWORD = 0x00000004; +extern "system" { + pub fn EnumDisplayDevicesA( + lpDevice: LPCSTR, + iDevNum: DWORD, + lpDisplayDevice: PDISPLAY_DEVICEA, + dwFlags: DWORD, + ) -> BOOL; + pub fn EnumDisplayDevicesW( + lpDevice: LPCWSTR, + iDevNum: DWORD, + lpDisplayDevice: PDISPLAY_DEVICEW, + dwFlags: DWORD, + ) -> BOOL; +} +pub const EDD_GET_DEVICE_INTERFACE_NAME: DWORD = 0x00000001; +extern "system" { + pub fn SystemParametersInfoA( + uiAction: UINT, + uiParam: UINT, + pvParam: PVOID, + fWinIni: UINT, + ) -> BOOL; + pub fn SystemParametersInfoW( + uiAction: UINT, + uiParam: UINT, + pvParam: PVOID, + fWinIni: UINT, + ) -> BOOL; + pub fn SystemParametersInfoForDpi( + uiAction: UINT, + uiParam: UINT, + pvParam: PVOID, + fWinIni: UINT, + dpi: UINT, + ) -> BOOL; +} +//13191 +extern "system" { + pub fn SetLastErrorEx( + dwErrCode: DWORD, + dwType: DWORD, + ); + pub fn InternalGetWindowText( + hWnd: HWND, + pString: LPWSTR, + cchMaxCount: c_int, + ) -> c_int; + pub fn EndTask( + hWnd: HWND, + fShutDown: BOOL, + fForce: BOOL, + ) -> BOOL; + pub fn CancelShutdown() -> BOOL; +} +pub const MONITOR_DEFAULTTONULL: DWORD = 0x00000000; +pub const MONITOR_DEFAULTTOPRIMARY: DWORD = 0x00000001; +pub const MONITOR_DEFAULTTONEAREST: DWORD = 0x00000002; +extern "system" { + pub fn MonitorFromPoint( + pt: POINT, + dwFlags: DWORD, + ) -> HMONITOR; + pub fn MonitorFromRect( + lprc: LPCRECT, + dwFlags: DWORD, + ) -> HMONITOR; + pub fn MonitorFromWindow( + hwnd: HWND, + dwFlags: DWORD, + ) -> HMONITOR; +} +pub const MONITORINFOF_PRIMARY: DWORD = 1; +pub const CCHDEVICENAME: usize = 32; +STRUCT!{struct MONITORINFO { + cbSize: DWORD, + rcMonitor: RECT, + rcWork: RECT, + dwFlags: DWORD, +}} +pub type LPMONITORINFO = *mut MONITORINFO; +STRUCT!{struct MONITORINFOEXA { + cbSize: DWORD, + rcMonitor: RECT, + rcWork: RECT, + dwFlags: DWORD, + szDevice: [CHAR; CCHDEVICENAME], +}} +pub type LPMONITORINFOEXA = *mut MONITORINFOEXA; +STRUCT!{struct MONITORINFOEXW { + cbSize: DWORD, + rcMonitor: RECT, + rcWork: RECT, + dwFlags: DWORD, + szDevice: [WCHAR; CCHDEVICENAME], +}} +pub type LPMONITORINFOEXW = *mut MONITORINFOEXW; +extern "system" { + pub fn GetMonitorInfoA( + hMonitor: HMONITOR, + lpmi: LPMONITORINFO, + ) -> BOOL; + pub fn GetMonitorInfoW( + hMonitor: HMONITOR, + lpmi: LPMONITORINFO, + ) -> BOOL; +} +FN!{stdcall MONITORENUMPROC( + HMONITOR, + HDC, + LPRECT, + LPARAM, +) -> BOOL} +extern "system" { + pub fn EnumDisplayMonitors( + hdc: HDC, + lprcClip: LPCRECT, + lpfnEnum: MONITORENUMPROC, + dwData: LPARAM, + ) -> BOOL; + pub fn NotifyWinEvent( + event: DWORD, + hwnd: HWND, + idObject: LONG, + idChild: LONG, + ); +} +FN!{stdcall WINEVENTPROC( + HWINEVENTHOOK, + DWORD, + HWND, + LONG, + LONG, + DWORD, + DWORD, +) -> ()} +extern "system" { + pub fn SetWinEventHook( + eventMin: DWORD, + eventMax: DWORD, + hmodWinEventProc: HMODULE, + pfnWinEventProc: WINEVENTPROC, + idProcess: DWORD, + idThread: DWORD, + dwFlags: DWORD, + ) -> HWINEVENTHOOK; + pub fn IsWinEventHookInstalled( + event: DWORD, + ) -> BOOL; +} +pub const WINEVENT_OUTOFCONTEXT: UINT = 0x0000; +pub const WINEVENT_SKIPOWNTHREAD: UINT = 0x0001; +pub const WINEVENT_SKIPOWNPROCESS: UINT = 0x0002; +pub const WINEVENT_INCONTEXT: UINT = 0x0004; +extern "system" { + pub fn UnhookWinEvent( + hWinEventHook: HWINEVENTHOOK, + ) -> BOOL; +} +pub const CHILDID_SELF: LONG = 0; +pub const INDEXID_OBJECT: LONG = 0; +pub const INDEXID_CONTAINER: LONG = 0; +pub const OBJID_WINDOW: LONG = 0x0000; +pub const OBJID_SYSMENU: LONG = 0xFFFFFFFF; +pub const OBJID_TITLEBAR: LONG = 0xFFFFFFFE; +pub const OBJID_MENU: LONG = 0xFFFFFFFD; +pub const OBJID_CLIENT: LONG = 0xFFFFFFFC; +pub const OBJID_VSCROLL: LONG = 0xFFFFFFFB; +pub const OBJID_HSCROLL: LONG = 0xFFFFFFFA; +pub const OBJID_SIZEGRIP: LONG = 0xFFFFFFF9; +pub const OBJID_CARET: LONG = 0xFFFFFFF8; +pub const OBJID_CURSOR: LONG = 0xFFFFFFF7; +pub const OBJID_ALERT: LONG = 0xFFFFFFF6; +pub const OBJID_SOUND: LONG = 0xFFFFFFF5; +pub const OBJID_QUERYCLASSNAMEIDX: LONG = 0xFFFFFFF4; +pub const OBJID_NATIVEOM: LONG = 0xFFFFFFF0; +pub const EVENT_MIN: UINT = 0x0001; +pub const EVENT_MAX: UINT = 0x7FFFFFFF; +pub const EVENT_SYSTEM_SOUND: UINT = 0x0001; +pub const EVENT_SYSTEM_ALERT: UINT = 0x0002; +pub const EVENT_SYSTEM_FOREGROUND: UINT = 0x0003; +pub const EVENT_SYSTEM_MENUSTART: UINT = 0x0004; +pub const EVENT_SYSTEM_MENUEND: UINT = 0x0005; +pub const EVENT_SYSTEM_MENUPOPUPSTART: UINT = 0x0006; +pub const EVENT_SYSTEM_MENUPOPUPEND: UINT = 0x0007; +pub const EVENT_SYSTEM_CAPTURESTART: UINT = 0x0008; +pub const EVENT_SYSTEM_CAPTUREEND: UINT = 0x0009; +pub const EVENT_SYSTEM_MOVESIZESTART: UINT = 0x000A; +pub const EVENT_SYSTEM_MOVESIZEEND: UINT = 0x000B; +pub const EVENT_SYSTEM_CONTEXTHELPSTART: UINT = 0x000C; +pub const EVENT_SYSTEM_CONTEXTHELPEND: UINT = 0x000D; +pub const EVENT_SYSTEM_DRAGDROPSTART: UINT = 0x000E; +pub const EVENT_SYSTEM_DRAGDROPEND: UINT = 0x000F; +pub const EVENT_SYSTEM_DIALOGSTART: UINT = 0x0010; +pub const EVENT_SYSTEM_DIALOGEND: UINT = 0x0011; +pub const EVENT_SYSTEM_SCROLLINGSTART: UINT = 0x0012; +pub const EVENT_SYSTEM_SCROLLINGEND: UINT = 0x0013; +pub const EVENT_SYSTEM_SWITCHSTART: UINT = 0x0014; +pub const EVENT_SYSTEM_SWITCHEND: UINT = 0x0015; +pub const EVENT_SYSTEM_MINIMIZESTART: UINT = 0x0016; +pub const EVENT_SYSTEM_MINIMIZEEND: UINT = 0x0017; +pub const EVENT_SYSTEM_DESKTOPSWITCH: UINT = 0x0020; +pub const EVENT_SYSTEM_SWITCHER_APPGRABBED: UINT = 0x0024; +pub const EVENT_SYSTEM_SWITCHER_APPOVERTARGET: UINT = 0x0025; +pub const EVENT_SYSTEM_SWITCHER_APPDROPPED: UINT = 0x0026; +pub const EVENT_SYSTEM_SWITCHER_CANCELLED: UINT = 0x0027; +pub const EVENT_SYSTEM_IME_KEY_NOTIFICATION: UINT = 0x0029; +pub const EVENT_SYSTEM_END: UINT = 0x00FF; +pub const EVENT_OEM_DEFINED_START: UINT = 0x0101; +pub const EVENT_OEM_DEFINED_END: UINT = 0x01FF; +pub const EVENT_UIA_EVENTID_START: UINT = 0x4E00; +pub const EVENT_UIA_EVENTID_END: UINT = 0x4EFF; +pub const EVENT_UIA_PROPID_START: UINT = 0x7500; +pub const EVENT_UIA_PROPID_END: UINT = 0x75FF; +pub const EVENT_CONSOLE_CARET: UINT = 0x4001; +pub const EVENT_CONSOLE_UPDATE_REGION: UINT = 0x4002; +pub const EVENT_CONSOLE_UPDATE_SIMPLE: UINT = 0x4003; +pub const EVENT_CONSOLE_UPDATE_SCROLL: UINT = 0x4004; +pub const EVENT_CONSOLE_LAYOUT: UINT = 0x4005; +pub const EVENT_CONSOLE_START_APPLICATION: UINT = 0x4006; +pub const EVENT_CONSOLE_END_APPLICATION: UINT = 0x4007; +#[cfg(target_pointer_width = "64")] +pub const CONSOLE_APPLICATION_16BIT: LONG = 0x0000; +#[cfg(target_pointer_width = "32")] +pub const CONSOLE_APPLICATION_16BIT: LONG = 0x0001; +pub const CONSOLE_CARET_SELECTION: LONG = 0x0001; +pub const CONSOLE_CARET_VISIBLE: LONG = 0x0002; +pub const EVENT_CONSOLE_END: UINT = 0x40FF; +pub const EVENT_OBJECT_CREATE: UINT = 0x8000; +pub const EVENT_OBJECT_DESTROY: UINT = 0x8001; +pub const EVENT_OBJECT_SHOW: UINT = 0x8002; +pub const EVENT_OBJECT_HIDE: UINT = 0x8003; +pub const EVENT_OBJECT_REORDER: UINT = 0x8004; +pub const EVENT_OBJECT_FOCUS: UINT = 0x8005; +pub const EVENT_OBJECT_SELECTION: UINT = 0x8006; +pub const EVENT_OBJECT_SELECTIONADD: UINT = 0x8007; +pub const EVENT_OBJECT_SELECTIONREMOVE: UINT = 0x8008; +pub const EVENT_OBJECT_SELECTIONWITHIN: UINT = 0x8009; +pub const EVENT_OBJECT_STATECHANGE: UINT = 0x800A; +pub const EVENT_OBJECT_LOCATIONCHANGE: UINT = 0x800B; +pub const EVENT_OBJECT_NAMECHANGE: UINT = 0x800C; +pub const EVENT_OBJECT_DESCRIPTIONCHANGE: UINT = 0x800D; +pub const EVENT_OBJECT_VALUECHANGE: UINT = 0x800E; +pub const EVENT_OBJECT_PARENTCHANGE: UINT = 0x800F; +pub const EVENT_OBJECT_HELPCHANGE: UINT = 0x8010; +pub const EVENT_OBJECT_DEFACTIONCHANGE: UINT = 0x8011; +pub const EVENT_OBJECT_ACCELERATORCHANGE: UINT = 0x8012; +pub const EVENT_OBJECT_INVOKED: UINT = 0x8013; +pub const EVENT_OBJECT_TEXTSELECTIONCHANGED: UINT = 0x8014; +pub const EVENT_OBJECT_CONTENTSCROLLED: UINT = 0x8015; +pub const EVENT_SYSTEM_ARRANGMENTPREVIEW: UINT = 0x8016; +pub const EVENT_OBJECT_CLOAKED: UINT = 0x8017; +pub const EVENT_OBJECT_UNCLOAKED: UINT = 0x8018; +pub const EVENT_OBJECT_LIVEREGIONCHANGED: UINT = 0x8019; +pub const EVENT_OBJECT_HOSTEDOBJECTSINVALIDATED: UINT = 0x8020; +pub const EVENT_OBJECT_DRAGSTART: UINT = 0x8021; +pub const EVENT_OBJECT_DRAGCANCEL: UINT = 0x8022; +pub const EVENT_OBJECT_DRAGCOMPLETE: UINT = 0x8023; +pub const EVENT_OBJECT_DRAGENTER: UINT = 0x8024; +pub const EVENT_OBJECT_DRAGLEAVE: UINT = 0x8025; +pub const EVENT_OBJECT_DRAGDROPPED: UINT = 0x8026; +pub const EVENT_OBJECT_IME_SHOW: UINT = 0x8027; +pub const EVENT_OBJECT_IME_HIDE: UINT = 0x8028; +pub const EVENT_OBJECT_IME_CHANGE: UINT = 0x8029; +pub const EVENT_OBJECT_TEXTEDIT_CONVERSIONTARGETCHANGED: UINT = 0x8030; +pub const EVENT_OBJECT_END: UINT = 0x80FF; +pub const EVENT_AIA_START: UINT = 0xA000; +pub const EVENT_AIA_END: UINT = 0xAFFF; +pub const ALERT_SYSTEM_INFORMATIONAL: LONG = 1; +pub const ALERT_SYSTEM_WARNING: LONG = 2; +pub const ALERT_SYSTEM_ERROR: LONG = 3; +pub const ALERT_SYSTEM_QUERY: LONG = 4; +pub const ALERT_SYSTEM_CRITICAL: LONG = 5; +pub const CALERT_SYSTEM: LONG = 6; +STRUCT!{struct GUITHREADINFO { + cbSize: DWORD, + flags: DWORD, + hwndActive: HWND, + hwndFocus: HWND, + hwndCapture: HWND, + hwndMenuOwner: HWND, + hwndMoveSize: HWND, + hwndCaret: HWND, + rcCaret: RECT, +}} +pub type PGUITHREADINFO = *mut GUITHREADINFO; +pub type LPGUITHREADINFO = *mut GUITHREADINFO; +pub const GUI_CARETBLINKING: DWORD = 0x00000001; +pub const GUI_INMOVESIZE: DWORD = 0x00000002; +pub const GUI_INMENUMODE: DWORD = 0x00000004; +pub const GUI_SYSTEMMENUMODE: DWORD = 0x00000008; +pub const GUI_POPUPMENUMODE: DWORD = 0x00000010; +#[cfg(target_arch = "x86_64")] +pub const GUI_16BITTASK: DWORD = 0x00000000; +#[cfg(target_arch = "x86")] +pub const GUI_16BITTASK: DWORD = 0x00000020; +extern "system" { + pub fn GetGUIThreadInfo( + idThread: DWORD, + pgui: PGUITHREADINFO, + ) -> BOOL; + pub fn BlockInput( + fBlockIt: BOOL, + ) -> BOOL; +} +pub const USER_DEFAULT_SCREEN_DPI: LONG = 96; +extern "system" { + pub fn SetProcessDPIAware() -> BOOL; + pub fn IsProcessDPIAware() -> BOOL; + pub fn SetThreadDpiAwarenessContext( + dpiContext: DPI_AWARENESS_CONTEXT, + ) -> DPI_AWARENESS_CONTEXT; + pub fn GetThreadDpiAwarenessContext() -> DPI_AWARENESS_CONTEXT; + pub fn GetWindowDpiAwarenessContext( + hwnd: HWND, + ) -> DPI_AWARENESS_CONTEXT; + pub fn GetAwarenessFromDpiAwarenessContext( + value: DPI_AWARENESS_CONTEXT, + ) -> DPI_AWARENESS; + pub fn GetDpiFromDpiAwarenessContext( + value: DPI_AWARENESS_CONTEXT, + ) -> UINT; + pub fn AreDpiAwarenessContextsEqual( + dpiContextA: DPI_AWARENESS_CONTEXT, + dpiContextB: DPI_AWARENESS_CONTEXT, + ) -> BOOL; + pub fn IsValidDpiAwarenessContext( + value: DPI_AWARENESS_CONTEXT, + ) -> BOOL; + pub fn GetDpiForWindow( + hwnd: HWND, + ) -> UINT; + pub fn GetDpiForSystem() -> UINT; + pub fn GetSystemDpiForProcess( + hProcess: HANDLE, + ) -> UINT; + pub fn EnableNonClientDpiScaling( + hwnd: HWND, + ) -> BOOL; + pub fn SetProcessDpiAwarenessContext( + value: DPI_AWARENESS_CONTEXT, + ) -> BOOL; + pub fn SetThreadDpiHostingBehavior( + value: DPI_HOSTING_BEHAVIOR, + ) -> DPI_HOSTING_BEHAVIOR; + pub fn GetThreadDpiHostingBehavior() -> DPI_HOSTING_BEHAVIOR; + pub fn GetWindowDpiHostingBehavior( + hwnd: HWND, + ) -> DPI_HOSTING_BEHAVIOR; + pub fn GetWindowModuleFileNameA( + hWnd: HWND, + lpszFileName: LPCSTR, + cchFileNameMax: UINT, + ) -> UINT; + pub fn GetWindowModuleFileNameW( + hWnd: HWND, + lpszFileName: LPWSTR, + cchFileNameMax: UINT, + ) -> UINT; +} +pub const STATE_SYSTEM_UNAVAILABLE: DWORD = 0x00000001; +pub const STATE_SYSTEM_SELECTED: DWORD = 0x00000002; +pub const STATE_SYSTEM_FOCUSED: DWORD = 0x00000004; +pub const STATE_SYSTEM_PRESSED: DWORD = 0x00000008; +pub const STATE_SYSTEM_CHECKED: DWORD = 0x00000010; +pub const STATE_SYSTEM_MIXED: DWORD = 0x00000020; +pub const STATE_SYSTEM_INDETERMINATE: DWORD = STATE_SYSTEM_MIXED; +pub const STATE_SYSTEM_READONLY: DWORD = 0x00000040; +pub const STATE_SYSTEM_HOTTRACKED: DWORD = 0x00000080; +pub const STATE_SYSTEM_DEFAULT: DWORD = 0x00000100; +pub const STATE_SYSTEM_EXPANDED: DWORD = 0x00000200; +pub const STATE_SYSTEM_COLLAPSED: DWORD = 0x00000400; +pub const STATE_SYSTEM_BUSY: DWORD = 0x00000800; +pub const STATE_SYSTEM_FLOATING: DWORD = 0x00001000; +pub const STATE_SYSTEM_MARQUEED: DWORD = 0x00002000; +pub const STATE_SYSTEM_ANIMATED: DWORD = 0x00004000; +pub const STATE_SYSTEM_INVISIBLE: DWORD = 0x00008000; +pub const STATE_SYSTEM_OFFSCREEN: DWORD = 0x00010000; +pub const STATE_SYSTEM_SIZEABLE: DWORD = 0x00020000; +pub const STATE_SYSTEM_MOVEABLE: DWORD = 0x00040000; +pub const STATE_SYSTEM_SELFVOICING: DWORD = 0x00080000; +pub const STATE_SYSTEM_FOCUSABLE: DWORD = 0x00100000; +pub const STATE_SYSTEM_SELECTABLE: DWORD = 0x00200000; +pub const STATE_SYSTEM_LINKED: DWORD = 0x00400000; +pub const STATE_SYSTEM_TRAVERSED: DWORD = 0x00800000; +pub const STATE_SYSTEM_MULTISELECTABLE: DWORD = 0x01000000; +pub const STATE_SYSTEM_EXTSELECTABLE: DWORD = 0x02000000; +pub const STATE_SYSTEM_ALERT_LOW: DWORD = 0x04000000; +pub const STATE_SYSTEM_ALERT_MEDIUM: DWORD = 0x08000000; +pub const STATE_SYSTEM_ALERT_HIGH: DWORD = 0x10000000; +pub const STATE_SYSTEM_PROTECTED: DWORD = 0x20000000; +pub const STATE_SYSTEM_VALID: DWORD = 0x3fffffff; +pub const CCHILDREN_TITLEBAR: usize = 5; +pub const CCHILDREN_SCROLLBAR: usize = 5; +STRUCT!{struct CURSORINFO { + cbSize: DWORD, + flags: DWORD, + hCursor: HCURSOR, + ptScreenPos: POINT, +}} +pub type PCURSORINFO = *mut CURSORINFO; +pub type LPCURSORINFO = *mut CURSORINFO; +pub const CURSOR_SHOWING: DWORD = 0x00000001; +pub const CURSOR_SUPPRESSED: DWORD = 0x00000002; +extern "system" { + pub fn GetCursorInfo( + pci: PCURSORINFO, + ) -> BOOL; +} +STRUCT!{struct WINDOWINFO { + cbSize: DWORD, + rcWindow: RECT, + rcClient: RECT, + dwStyle: DWORD, + dwExStyle: DWORD, + dwWindowStatus: DWORD, + cxWindowBorders: UINT, + cyWindowBorders: UINT, + atomWindowType: ATOM, + wCreatorVersion: WORD, +}} +pub type PWINDOWINFO = *mut WINDOWINFO; +pub type LPWINDOWINFO = *mut WINDOWINFO; +pub const WS_ACTIVECAPTION: DWORD = 0x0001; +extern "system" { + pub fn GetWindowInfo( + hwnd: HWND, + pwi: PWINDOWINFO, + ) -> BOOL; +} +STRUCT!{struct TITLEBARINFO { + cbSize: DWORD, + rcTitleBar: RECT, + rgstate: [DWORD; CCHILDREN_TITLEBAR + 1], +}} +pub type PTITLEBARINFO = *mut TITLEBARINFO; +pub type LPTITLEBARINFO = *mut TITLEBARINFO; +extern "system" { + pub fn GetTitleBarInfo( + hwnd: HWND, + pti: PTITLEBARINFO, + ) -> BOOL; +} +STRUCT!{struct TITLEBARINFOEX { + cbSize: DWORD, + rcTitleBar: RECT, + rgstate: [DWORD; CCHILDREN_TITLEBAR + 1], + rgrect: [RECT; CCHILDREN_TITLEBAR + 1], +}} +pub type PTITLEBARINFOEX = *mut TITLEBARINFOEX; +pub type LPTITLEBARINFOEX = *mut TITLEBARINFOEX; +STRUCT!{struct MENUBARINFO { + cbSize: DWORD, + rcBar: RECT, + hMenu: HMENU, + hwndMenu: HWND, + BitFields: BOOL, +}} +BITFIELD!{MENUBARINFO BitFields: BOOL [ + fBarFocused set_fBarFocused[0..1], + fFocused set_fFocused[1..2], +]} +pub type PMENUBARINFO = *mut MENUBARINFO; +pub type LPMENUBARINFO = *mut MENUBARINFO; +extern "system" { + pub fn GetMenuBarInfo( + hwnd: HWND, + idObject: LONG, + idItem: LONG, + pmbi: PMENUBARINFO, + ) -> BOOL; +} +STRUCT!{struct SCROLLBARINFO { + cbSize: DWORD, + rcScrollBar: RECT, + dxyLineButton: c_int, + xyThumbTop: c_int, + xyThumbBottom: c_int, + reserved: c_int, + rgstate: [DWORD; CCHILDREN_SCROLLBAR + 1], +}} +pub type PSCROLLBARINFO = *mut SCROLLBARINFO; +pub type LPSCROLLBARINFO = *mut SCROLLBARINFO; +extern "system" { + pub fn GetScrollBarInfo( + hwnd: HWND, + idObject: LONG, + psbi: PSCROLLBARINFO, + ) -> BOOL; +} +STRUCT!{struct COMBOBOXINFO { + cbSize: DWORD, + rcItem: RECT, + rcButton: RECT, + stateButton: DWORD, + hwndCombo: HWND, + hwndItem: HWND, + hwndList: HWND, +}} +pub type PCOMBOBOXINFO = *mut COMBOBOXINFO; +pub type LPCOMBOBOXINFO = *mut COMBOBOXINFO; +extern "system" { + pub fn GetComboBoxInfo( + hwndCombo: HWND, + pcbi: PCOMBOBOXINFO, + ) -> BOOL; +} +pub const GA_PARENT: UINT = 1; +pub const GA_ROOT: UINT = 2; +pub const GA_ROOTOWNER: UINT = 3; +extern "system" { + pub fn GetAncestor( + hwnd: HWND, + gaFlags: UINT, + ) -> HWND; + pub fn RealChildWindowFromPoint( + hwndParent: HWND, + ptParentClientCoords: POINT, + ) -> HWND; + pub fn RealGetWindowClassA( + hwnd: HWND, + ptszClassName: LPSTR, + cchClassNameMax: UINT, + ) -> UINT; + pub fn RealGetWindowClassW( + hwnd: HWND, + ptszClassName: LPWSTR, + cchClassNameMax: UINT, + ) -> UINT; +} +STRUCT!{struct ALTTABINFO { + cbSize: DWORD, + cItems: c_int, + cColumns: c_int, + cRows: c_int, + iColFocus: c_int, + iRowFocus: c_int, + cxItem: c_int, + cyItem: c_int, + ptStart: POINT, +}} +pub type PALTTABINFO = *mut ALTTABINFO; +pub type LPALTTABINFO = *mut ALTTABINFO; +extern "system" { + pub fn GetAltTabInfoA( + hwnd: HWND, + iItem: c_int, + pati: PALTTABINFO, + pszItemText: LPSTR, + cchItemText: UINT, + ) -> BOOL; + pub fn GetAltTabInfoW( + hwnd: HWND, + iItem: c_int, + pati: PALTTABINFO, + pszItemText: LPWSTR, + cchItemText: UINT, + ) -> BOOL; + pub fn GetListBoxInfo( + hwnd: HWND, + ) -> DWORD; + pub fn LockWorkStation() -> BOOL; + pub fn UserHandleGrantAccess( + hUserHandle: HANDLE, + hJob: HANDLE, + bGrant: BOOL, + ) -> BOOL; +} +DECLARE_HANDLE!{HRAWINPUT, HRAWINPUT__} +#[inline] +pub fn GET_RAWINPUT_CODE_WPARAM(wParam: WPARAM) -> WPARAM { wParam & 0xff } +pub const RIM_INPUT: WPARAM = 0; +pub const RIM_INPUTSINK: WPARAM = 1; +STRUCT!{struct RAWINPUTHEADER { + dwType: DWORD, + dwSize: DWORD, + hDevice: HANDLE, + wParam: WPARAM, +}} +pub type PRAWINPUTHEADER = *mut RAWINPUTHEADER; +pub type LPRAWINPUTHEADER = *mut RAWINPUTHEADER; +pub const RIM_TYPEMOUSE: DWORD = 0; +pub const RIM_TYPEKEYBOARD: DWORD = 1; +pub const RIM_TYPEHID: DWORD = 2; +STRUCT!{struct RAWMOUSE { + usFlags: USHORT, + memory_padding: USHORT, // 16bit Padding for 32bit align in following union + usButtonFlags: USHORT, + usButtonData: USHORT, + ulRawButtons: ULONG, + lLastX: LONG, + lLastY: LONG, + ulExtraInformation: ULONG, +}} +pub type PRAWMOUSE = *mut RAWMOUSE; +pub type LPRAWMOUSE = *mut RAWMOUSE; +pub const RI_MOUSE_LEFT_BUTTON_DOWN: USHORT = 0x0001; +pub const RI_MOUSE_LEFT_BUTTON_UP: USHORT = 0x0002; +pub const RI_MOUSE_RIGHT_BUTTON_DOWN: USHORT = 0x0004; +pub const RI_MOUSE_RIGHT_BUTTON_UP: USHORT = 0x0008; +pub const RI_MOUSE_MIDDLE_BUTTON_DOWN: USHORT = 0x0010; +pub const RI_MOUSE_MIDDLE_BUTTON_UP: USHORT = 0x0020; +pub const RI_MOUSE_BUTTON_1_DOWN: USHORT = RI_MOUSE_LEFT_BUTTON_DOWN; +pub const RI_MOUSE_BUTTON_1_UP: USHORT = RI_MOUSE_LEFT_BUTTON_UP; +pub const RI_MOUSE_BUTTON_2_DOWN: USHORT = RI_MOUSE_RIGHT_BUTTON_DOWN; +pub const RI_MOUSE_BUTTON_2_UP: USHORT = RI_MOUSE_RIGHT_BUTTON_UP; +pub const RI_MOUSE_BUTTON_3_DOWN: USHORT = RI_MOUSE_MIDDLE_BUTTON_DOWN; +pub const RI_MOUSE_BUTTON_3_UP: USHORT = RI_MOUSE_MIDDLE_BUTTON_UP; +pub const RI_MOUSE_BUTTON_4_DOWN: USHORT = 0x0040; +pub const RI_MOUSE_BUTTON_4_UP: USHORT = 0x0080; +pub const RI_MOUSE_BUTTON_5_DOWN: USHORT = 0x0100; +pub const RI_MOUSE_BUTTON_5_UP: USHORT = 0x0200; +pub const RI_MOUSE_WHEEL: USHORT = 0x0400; +pub const MOUSE_MOVE_RELATIVE: USHORT = 0; +pub const MOUSE_MOVE_ABSOLUTE: USHORT = 1; +pub const MOUSE_VIRTUAL_DESKTOP: USHORT = 0x02; +pub const MOUSE_ATTRIBUTES_CHANGED: USHORT = 0x04; +pub const MOUSE_MOVE_NOCOALESCE: USHORT = 0x08; +STRUCT!{struct RAWKEYBOARD { + MakeCode: USHORT, + Flags: USHORT, + Reserved: USHORT, + VKey: USHORT, + Message: UINT, + ExtraInformation: ULONG, +}} +pub type PRAWKEYBOARD = *mut RAWKEYBOARD; +pub type LPRAWKEYBOARD = *mut RAWKEYBOARD; +pub const KEYBOARD_OVERRUN_MAKE_CODE: DWORD = 0xFF; +pub const RI_KEY_MAKE: DWORD = 0; +pub const RI_KEY_BREAK: DWORD = 1; +pub const RI_KEY_E0: DWORD = 2; +pub const RI_KEY_E1: DWORD = 4; +pub const RI_KEY_TERMSRV_SET_LED: DWORD = 8; +pub const RI_KEY_TERMSRV_SHADOW: DWORD = 0x10; +STRUCT!{struct RAWHID { + dwSizeHid: DWORD, + dwCount: DWORD, + bRawData: [BYTE; 1], +}} +pub type PRAWHID = *mut RAWHID; +pub type LPRAWHID = *mut RAWHID; +UNION!{union RAWINPUT_data { + [u32; 6], + mouse mouse_mut: RAWMOUSE, + keyboard keyboard_mut: RAWKEYBOARD, + hid hid_mut: RAWHID, +}} +STRUCT!{struct RAWINPUT { + header: RAWINPUTHEADER, + data: RAWINPUT_data, +}} +pub type PRAWINPUT = *mut RAWINPUT; +pub type LPRAWINPUT = *mut RAWINPUT; +pub const RID_INPUT: DWORD = 0x10000003; +pub const RID_HEADER: DWORD = 0x10000005; +extern "system" { + pub fn GetRawInputData( + hRawInput: HRAWINPUT, + uiCommand: UINT, + pData: LPVOID, + pcbSize: PUINT, + cbSizeHeader: UINT, + ) -> UINT; +} +pub const RIDI_PREPARSEDDATA: DWORD = 0x20000005; +pub const RIDI_DEVICENAME: DWORD = 0x20000007; +pub const RIDI_DEVICEINFO: DWORD = 0x2000000b; +STRUCT!{struct RID_DEVICE_INFO_MOUSE { + dwId: DWORD, + dwNumberOfButtons: DWORD, + dwSampleRate: DWORD, + fHasHorizontalWheel: BOOL, +}} +pub type PRID_DEVICE_INFO_MOUSE = *mut RID_DEVICE_INFO_MOUSE; +STRUCT!{struct RID_DEVICE_INFO_KEYBOARD { + dwType: DWORD, + dwSubType: DWORD, + dwKeyboardMode: DWORD, + dwNumberOfFunctionKeys: DWORD, + dwNumberOfIndicators: DWORD, + dwNumberOfKeysTotal: DWORD, +}} +pub type PRID_DEVICE_INFO_KEYBOARD = *mut RID_DEVICE_INFO_KEYBOARD; +STRUCT!{struct RID_DEVICE_INFO_HID { + dwVendorId: DWORD, + dwProductId: DWORD, + dwVersionNumber: DWORD, + usUsagePage: USHORT, + usUsage: USHORT, +}} +pub type PRID_DEVICE_INFO_HID = *mut RID_DEVICE_INFO_HID; +UNION!{union RID_DEVICE_INFO_u { + [u32; 6], + mouse mouse_mut: RID_DEVICE_INFO_MOUSE, + keyboard keyboard_mut: RID_DEVICE_INFO_KEYBOARD, + hid hid_mut: RID_DEVICE_INFO_HID, +}} +STRUCT!{struct RID_DEVICE_INFO { + cbSize: DWORD, + dwType: DWORD, + u: RID_DEVICE_INFO_u, +}} +pub type PRID_DEVICE_INFO = *mut RID_DEVICE_INFO; +pub type LPRID_DEVICE_INFO = *mut RID_DEVICE_INFO; +extern "system" { + pub fn GetRawInputDeviceInfoA( + hDevice: HANDLE, + uiCommand: UINT, + pData: LPVOID, + pcbSize: PUINT, + ) -> UINT; + pub fn GetRawInputDeviceInfoW( + hDevice: HANDLE, + uiCommand: UINT, + pData: LPVOID, + pcbSize: PUINT, + ) -> UINT; + pub fn GetRawInputBuffer( + pData: PRAWINPUT, + pcbSize: PUINT, + cbSizeHeader: UINT, + ) -> UINT; +} +STRUCT!{struct RAWINPUTDEVICE { + usUsagePage: USHORT, + usUsage: USHORT, + dwFlags: DWORD, + hwndTarget: HWND, +}} +pub type PRAWINPUTDEVICE = *mut RAWINPUTDEVICE; +pub type LPRAWINPUTDEVICE = *mut RAWINPUTDEVICE; +pub type PCRAWINPUTDEVICE = *const RAWINPUTDEVICE; +pub const RIDEV_REMOVE: DWORD = 0x00000001; +pub const RIDEV_EXCLUDE: DWORD = 0x00000010; +pub const RIDEV_PAGEONLY: DWORD = 0x00000020; +pub const RIDEV_NOLEGACY: DWORD = 0x00000030; +pub const RIDEV_INPUTSINK: DWORD = 0x00000100; +pub const RIDEV_CAPTUREMOUSE: DWORD = 0x00000200; +pub const RIDEV_NOHOTKEYS: DWORD = 0x00000200; +pub const RIDEV_APPKEYS: DWORD = 0x00000400; +pub const RIDEV_EXINPUTSINK: DWORD = 0x00001000; +pub const RIDEV_DEVNOTIFY: DWORD = 0x00002000; +pub const RIDEV_EXMODEMASK: DWORD = 0x000000F0; +pub const GIDC_ARRIVAL: DWORD = 1; +pub const GIDC_REMOVAL: DWORD = 2; +extern "system" { + pub fn RegisterRawInputDevices( + pRawInputDevices: PCRAWINPUTDEVICE, + uiNumDevices: UINT, + cbSize: UINT, + ) -> BOOL; + pub fn GetRegisteredRawInputDevices( + pRawInputDevices: PRAWINPUTDEVICE, + puiNumDevices: PUINT, + cbSize: UINT, + ) -> UINT; +} +STRUCT!{struct RAWINPUTDEVICELIST { + hDevice: HANDLE, + dwType: DWORD, +}} +pub type PRAWINPUTDEVICELIST = *mut RAWINPUTDEVICELIST; +extern "system" { + pub fn GetRawInputDeviceList( + pRawInputDeviceList: PRAWINPUTDEVICELIST, + puiNumDevices: PUINT, + cbSize: UINT, + ) -> UINT; + pub fn DefRawInputProc( + paRawInput: *mut PRAWINPUT, + nInput: INT, + cbSizeHeader: UINT, + ) -> LRESULT; + pub fn ChangeWindowMessageFilter( + message: UINT, + dwFlag: DWORD, + ) -> BOOL; +} +//15165 +STRUCT!{struct CHANGEFILTERSTRUCT { + cbSize: DWORD, + ExtStatus: DWORD, +}} +extern "system" { + pub fn ChangeWindowMessageFilterEx( + hwnd: HWND, + message: UINT, + action: DWORD, + pChangeFilterStruct: PCHANGEFILTERSTRUCT, + ) -> BOOL; +} +pub type PCHANGEFILTERSTRUCT = *mut CHANGEFILTERSTRUCT; +//15427 +pub const NID_INTEGRATED_TOUCH: UINT = 0x00000001; +pub const NID_EXTERNAL_TOUCH: UINT = 0x00000002; +pub const NID_INTEGRATED_PEN: UINT = 0x00000004; +pub const NID_EXTERNAL_PEN: UINT = 0x00000008; +pub const NID_MULTI_INPUT: UINT = 0x00000040; +pub const NID_READY: UINT = 0x00000080; +pub const MAX_STR_BLOCKREASON: usize = 256; +extern "system" { + pub fn ShutdownBlockReasonCreate( + hWnd: HWND, + pwszReason: LPCWSTR, + ) -> BOOL; + pub fn ShutdownBlockReasonQuery( + hWnd: HWND, + pwszBuff: LPWSTR, + pcchBuff: *mut DWORD, + ) -> BOOL; + pub fn ShutdownBlockReasonDestroy( + hWnd: HWND, + ) -> BOOL; +} +//15615 +extern "system" { + pub fn IsImmersiveProcess( + hProcess: HANDLE, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/winver.rs b/bash-5.1/vendor/winapi/src/um/winver.rs new file mode 100644 index 0000000000000000000000000000000000000000..5d25c678fbe75e0e386017551ddb4944c5cdfdbf --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/winver.rs @@ -0,0 +1,53 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! Version management functions, types, and definitions +use ctypes::c_void; +use shared::minwindef::{BOOL, DWORD, LPCVOID, LPVOID, PUINT}; +use um::winnt::{LPCSTR, LPCWSTR, LPSTR, LPWSTR}; +extern "system" { + pub fn GetFileVersionInfoSizeA( + lptstrFilename: LPCSTR, + lpdwHandle: *mut DWORD, + ) -> DWORD; + pub fn GetFileVersionInfoSizeW( + lptstrFilename: LPCWSTR, + lpdwHandle: *mut DWORD, + ) -> DWORD; + pub fn GetFileVersionInfoA( + lptstrFilename: LPCSTR, + dwHandle: DWORD, + dwLen: DWORD, + lpData: *mut c_void, + ) -> BOOL; + pub fn GetFileVersionInfoW( + lptstrFilename: LPCWSTR, + dwHandle: DWORD, + dwLen: DWORD, + lpData: *mut c_void, + ) -> BOOL; + pub fn VerQueryValueA( + pBlock: LPCVOID, + lpSubBlock: LPCSTR, + lplpBuffer: &mut LPVOID, + puLen: PUINT, + ) -> BOOL; + pub fn VerQueryValueW( + pBlock: LPCVOID, + lpSubBlock: LPCWSTR, + lplpBuffer: &mut LPVOID, + puLen: PUINT, + ) -> BOOL; + pub fn VerLanguageNameA( + wLang: DWORD, + szLang: LPSTR, + cchLang: DWORD, + ) -> DWORD; + pub fn VerLanguageNameW( + wLang: DWORD, + szLang: LPWSTR, + cchLang: DWORD, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/um/wlanapi.rs b/bash-5.1/vendor/winapi/src/um/wlanapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..9584509da9f4d7deeed05e056b90da66d3166a7c --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wlanapi.rs @@ -0,0 +1,1459 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Definitions and data structures for wlan auto config client side API. +use shared::devpropdef::DEVPROPKEY; +use shared::guiddef::{GUID, LPGUID}; +use shared::minwindef::{BOOL, BYTE, DWORD, LPBYTE, PBOOL, PBYTE, PDWORD, PUCHAR, ULONG, USHORT}; +use shared::windef::HWND; +use shared::windot11::{ + DOT11_COUNTRY_OR_REGION_STRING, DOT11_HESSID, DOT11_MAC_ADDRESS, DOT11_PHY_TYPE, + DOT11_RATE_SET_MAX_LENGTH, PDOT11_BSSID_LIST, PDOT11_HESSID, PDOT11_MAC_ADDRESS, +}; +use shared::wlantypes::{ + DOT11_ACCESSNETWORKOPTIONS, DOT11_AUTH_ALGORITHM, DOT11_AUTH_CIPHER_PAIR, DOT11_BSS_TYPE, + DOT11_CIPHER_ALGORITHM, DOT11_SSID, DOT11_VENUEINFO, PDOT11_ACCESSNETWORKOPTIONS, PDOT11_SSID, +}; +use um::eaptypes::EAP_METHOD_TYPE; +use um::l2cmn::{ + L2_NOTIFICATION_CODE_PUBLIC_BEGIN, L2_NOTIFICATION_CODE_V2_BEGIN, L2_NOTIFICATION_DATA, + L2_NOTIFICATION_SOURCE_ALL, L2_NOTIFICATION_SOURCE_NONE, L2_NOTIFICATION_SOURCE_ONEX, + L2_NOTIFICATION_SOURCE_WLAN_ACM, L2_NOTIFICATION_SOURCE_WLAN_HNWK, + L2_NOTIFICATION_SOURCE_WLAN_IHV, L2_NOTIFICATION_SOURCE_WLAN_MSM, + L2_NOTIFICATION_SOURCE_WLAN_SECURITY, L2_PROFILE_MAX_NAME_LENGTH, + L2_REASON_CODE_DOT11_AC_BASE, L2_REASON_CODE_DOT11_MSM_BASE, + L2_REASON_CODE_DOT11_SECURITY_BASE, L2_REASON_CODE_GROUP_SIZE, L2_REASON_CODE_PROFILE_BASE, + L2_REASON_CODE_SUCCESS, L2_REASON_CODE_UNKNOWN, +}; +use um::winnt::{ + BOOLEAN, DELETE, FILE_EXECUTE, FILE_READ_DATA, FILE_WRITE_DATA, HANDLE, LONG, LPCWSTR, LPWSTR, + PHANDLE, PVOID, PWCHAR, STANDARD_RIGHTS_EXECUTE, STANDARD_RIGHTS_READ, STANDARD_RIGHTS_WRITE, + ULONGLONG, WCHAR, WRITE_DAC, +}; +pub const WLAN_API_VERSION_1_0: DWORD = 0x00000001; +pub const WLAN_API_VERSION_2_0: DWORD = 0x00000002; +#[inline] +pub fn WLAN_API_VERSION_MAJOR(v: u32) -> u32 { + v & 0xffff +} +#[inline] +pub fn WLAN_API_VERSION_MINOR(v: u32) -> u32 { + v >> 16 +} +#[inline] +pub fn WLAN_API_MAKE_VERSION(major: u32, minor: u32) -> u32 { + minor << 16 | major +} +pub const WLAN_API_VERSION: u32 = WLAN_API_VERSION_2_0; +pub const WLAN_MAX_NAME_LENGTH: usize = L2_PROFILE_MAX_NAME_LENGTH; +pub const WLAN_PROFILE_GROUP_POLICY: DWORD = 0x00000001; +pub const WLAN_PROFILE_USER: DWORD = 0x00000002; +pub const WLAN_PROFILE_GET_PLAINTEXT_KEY: DWORD = 0x00000004; +pub const WLAN_PROFILE_CONNECTION_MODE_SET_BY_CLIENT: DWORD = 0x00010000; +pub const WLAN_PROFILE_CONNECTION_MODE_AUTO: DWORD = 0x00020000; +pub const WLAN_SET_EAPHOST_DATA_ALL_USERS: DWORD = 0x00000001; +STRUCT!{struct WLAN_PROFILE_INFO { + strProfileName: [WCHAR; WLAN_MAX_NAME_LENGTH], + dwFlags: DWORD, +}} +pub type PWLAN_PROFILE_INFO = *mut WLAN_PROFILE_INFO; +STRUCT!{struct DOT11_NETWORK { + dot11Ssid: DOT11_SSID, + dot11BssType: DOT11_BSS_TYPE, +}} +pub type PDOT11_NETWORK = *mut DOT11_NETWORK; +pub const DOT11_PSD_IE_MAX_DATA_SIZE: DWORD = 240; +pub const DOT11_PSD_IE_MAX_ENTRY_NUMBER: DWORD = 5; +STRUCT!{struct WLAN_RAW_DATA { + dwDataSize: DWORD, + DataBlob: [BYTE; 1], +}} +pub type PWLAN_RAW_DATA = *mut WLAN_RAW_DATA; +STRUCT!{struct WLAN_RAW_DATA_LIST_DataList { + dwDataOffset: DWORD, + dwDataSize: DWORD, +}} +STRUCT!{struct WLAN_RAW_DATA_LIST { + dwTotalSize: DWORD, + dwNumberOfItems: DWORD, + DataList: [WLAN_RAW_DATA_LIST_DataList; 1], +}} +pub type PWLAN_RAW_DATA_LIST = *mut WLAN_RAW_DATA_LIST; +ENUM!{enum WLAN_CONNECTION_MODE { + wlan_connection_mode_profile = 0, + wlan_connection_mode_temporary_profile = 1, + wlan_connection_mode_discovery_secure = 2, + wlan_connection_mode_discovery_unsecure = 3, + wlan_connection_mode_auto = 4, + wlan_connection_mode_invalid = 5, +}} +pub type PWLAN_CONNECTION_MODE = *mut WLAN_CONNECTION_MODE; +pub type WLAN_REASON_CODE = DWORD; +pub type PWLAN_REASON_CODE = *mut DWORD; +pub const WLAN_REASON_CODE_SUCCESS: WLAN_REASON_CODE = L2_REASON_CODE_SUCCESS; +pub const WLAN_REASON_CODE_UNKNOWN: WLAN_REASON_CODE = L2_REASON_CODE_UNKNOWN; +pub const WLAN_REASON_CODE_RANGE_SIZE: WLAN_REASON_CODE = L2_REASON_CODE_GROUP_SIZE; +pub const WLAN_REASON_CODE_BASE: WLAN_REASON_CODE = L2_REASON_CODE_DOT11_AC_BASE; +pub const WLAN_REASON_CODE_AC_BASE: WLAN_REASON_CODE = L2_REASON_CODE_DOT11_AC_BASE; +pub const WLAN_REASON_CODE_AC_CONNECT_BASE: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_BASE + + WLAN_REASON_CODE_RANGE_SIZE / 2; +pub const WLAN_REASON_CODE_AC_END: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_BASE + + WLAN_REASON_CODE_RANGE_SIZE - 1; +pub const WLAN_REASON_CODE_PROFILE_BASE: WLAN_REASON_CODE = L2_REASON_CODE_PROFILE_BASE; +pub const WLAN_REASON_CODE_PROFILE_CONNECT_BASE: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + + WLAN_REASON_CODE_RANGE_SIZE / 2; +pub const WLAN_REASON_CODE_PROFILE_END: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + + WLAN_REASON_CODE_RANGE_SIZE - 1; +pub const WLAN_REASON_CODE_MSM_BASE: WLAN_REASON_CODE = L2_REASON_CODE_DOT11_MSM_BASE; +pub const WLAN_REASON_CODE_MSM_CONNECT_BASE: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_BASE + + WLAN_REASON_CODE_RANGE_SIZE / 2; +pub const WLAN_REASON_CODE_MSM_END: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_BASE + + WLAN_REASON_CODE_RANGE_SIZE - 1; +pub const WLAN_REASON_CODE_MSMSEC_BASE: WLAN_REASON_CODE = L2_REASON_CODE_DOT11_SECURITY_BASE; +pub const WLAN_REASON_CODE_MSMSEC_CONNECT_BASE: WLAN_REASON_CODE = WLAN_REASON_CODE_MSMSEC_BASE + + WLAN_REASON_CODE_RANGE_SIZE / 2; +pub const WLAN_REASON_CODE_MSMSEC_END: WLAN_REASON_CODE = WLAN_REASON_CODE_MSMSEC_BASE + + WLAN_REASON_CODE_RANGE_SIZE - 1; +pub const WLAN_REASON_CODE_NETWORK_NOT_COMPATIBLE: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_BASE + 1; +pub const WLAN_REASON_CODE_PROFILE_NOT_COMPATIBLE: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_BASE + 2; +pub const WLAN_REASON_CODE_NO_AUTO_CONNECTION: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + + 1; +pub const WLAN_REASON_CODE_NOT_VISIBLE: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + 2; +pub const WLAN_REASON_CODE_GP_DENIED: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + 3; +pub const WLAN_REASON_CODE_USER_DENIED: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + 4; +pub const WLAN_REASON_CODE_BSS_TYPE_NOT_ALLOWED: WLAN_REASON_CODE = + WLAN_REASON_CODE_AC_CONNECT_BASE + 5; +pub const WLAN_REASON_CODE_IN_FAILED_LIST: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + 6; +pub const WLAN_REASON_CODE_IN_BLOCKED_LIST: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + + 7; +pub const WLAN_REASON_CODE_SSID_LIST_TOO_LONG: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + + 8; +pub const WLAN_REASON_CODE_CONNECT_CALL_FAIL: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + + 9; +pub const WLAN_REASON_CODE_SCAN_CALL_FAIL: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + + 10; +pub const WLAN_REASON_CODE_NETWORK_NOT_AVAILABLE: WLAN_REASON_CODE = + WLAN_REASON_CODE_AC_CONNECT_BASE + 11; +pub const WLAN_REASON_CODE_PROFILE_CHANGED_OR_DELETED: WLAN_REASON_CODE = + WLAN_REASON_CODE_AC_CONNECT_BASE + 12; +pub const WLAN_REASON_CODE_KEY_MISMATCH: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + 13; +pub const WLAN_REASON_CODE_USER_NOT_RESPOND: WLAN_REASON_CODE = WLAN_REASON_CODE_AC_CONNECT_BASE + + 14; +pub const WLAN_REASON_CODE_AP_PROFILE_NOT_ALLOWED_FOR_CLIENT: WLAN_REASON_CODE = + WLAN_REASON_CODE_AC_CONNECT_BASE + 15; +pub const WLAN_REASON_CODE_AP_PROFILE_NOT_ALLOWED: WLAN_REASON_CODE = + WLAN_REASON_CODE_AC_CONNECT_BASE + 16; +pub const WLAN_REASON_CODE_HOTSPOT2_PROFILE_DENIED: WLAN_REASON_CODE = + WLAN_REASON_CODE_AC_CONNECT_BASE + 17; +pub const WLAN_REASON_CODE_INVALID_PROFILE_SCHEMA: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + + 1; +pub const WLAN_REASON_CODE_PROFILE_MISSING: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + 2; +pub const WLAN_REASON_CODE_INVALID_PROFILE_NAME: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + + 3; +pub const WLAN_REASON_CODE_INVALID_PROFILE_TYPE: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + + 4; +pub const WLAN_REASON_CODE_INVALID_PHY_TYPE: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + 5; +pub const WLAN_REASON_CODE_MSM_SECURITY_MISSING: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + + 6; +pub const WLAN_REASON_CODE_IHV_SECURITY_NOT_SUPPORTED: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 7; +pub const WLAN_REASON_CODE_IHV_OUI_MISMATCH: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + 8; +pub const WLAN_REASON_CODE_IHV_OUI_MISSING: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + 9; +pub const WLAN_REASON_CODE_IHV_SETTINGS_MISSING: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + + 10; +pub const WLAN_REASON_CODE_CONFLICT_SECURITY: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + + 11; +pub const WLAN_REASON_CODE_SECURITY_MISSING: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + 12; +pub const WLAN_REASON_CODE_INVALID_BSS_TYPE: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + 13; +pub const WLAN_REASON_CODE_INVALID_ADHOC_CONNECTION_MODE: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 14; +pub const WLAN_REASON_CODE_NON_BROADCAST_SET_FOR_ADHOC: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 15; +pub const WLAN_REASON_CODE_AUTO_SWITCH_SET_FOR_ADHOC: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 16; +pub const WLAN_REASON_CODE_AUTO_SWITCH_SET_FOR_MANUAL_CONNECTION: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 17; +pub const WLAN_REASON_CODE_IHV_SECURITY_ONEX_MISSING: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 18; +pub const WLAN_REASON_CODE_PROFILE_SSID_INVALID: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + + 19; +pub const WLAN_REASON_CODE_TOO_MANY_SSID: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + 20; +pub const WLAN_REASON_CODE_IHV_CONNECTIVITY_NOT_SUPPORTED: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 21; +pub const WLAN_REASON_CODE_BAD_MAX_NUMBER_OF_CLIENTS_FOR_AP: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 22; +pub const WLAN_REASON_CODE_INVALID_CHANNEL: WLAN_REASON_CODE = WLAN_REASON_CODE_PROFILE_BASE + 23; +pub const WLAN_REASON_CODE_OPERATION_MODE_NOT_SUPPORTED: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 24; +pub const WLAN_REASON_CODE_AUTO_AP_PROFILE_NOT_ALLOWED: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 25; +pub const WLAN_REASON_CODE_AUTO_CONNECTION_NOT_ALLOWED: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 26; +pub const WLAN_REASON_CODE_HOTSPOT2_PROFILE_NOT_ALLOWED: WLAN_REASON_CODE = + WLAN_REASON_CODE_PROFILE_BASE + 27; +pub const WLAN_REASON_CODE_UNSUPPORTED_SECURITY_SET_BY_OS: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_BASE + 1; +pub const WLAN_REASON_CODE_UNSUPPORTED_SECURITY_SET: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_BASE + + 2; +pub const WLAN_REASON_CODE_BSS_TYPE_UNMATCH: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_BASE + 3; +pub const WLAN_REASON_CODE_PHY_TYPE_UNMATCH: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_BASE + 4; +pub const WLAN_REASON_CODE_DATARATE_UNMATCH: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_BASE + 5; +pub const WLAN_REASON_CODE_USER_CANCELLED: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_CONNECT_BASE + + 1; +pub const WLAN_REASON_CODE_ASSOCIATION_FAILURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_CONNECT_BASE + 2; +pub const WLAN_REASON_CODE_ASSOCIATION_TIMEOUT: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_CONNECT_BASE + 3; +pub const WLAN_REASON_CODE_PRE_SECURITY_FAILURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_CONNECT_BASE + 4; +pub const WLAN_REASON_CODE_START_SECURITY_FAILURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_CONNECT_BASE + 5; +pub const WLAN_REASON_CODE_SECURITY_FAILURE: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_CONNECT_BASE + + 6; +pub const WLAN_REASON_CODE_SECURITY_TIMEOUT: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_CONNECT_BASE + + 7; +pub const WLAN_REASON_CODE_ROAMING_FAILURE: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_CONNECT_BASE + + 8; +pub const WLAN_REASON_CODE_ROAMING_SECURITY_FAILURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_CONNECT_BASE + 9; +pub const WLAN_REASON_CODE_ADHOC_SECURITY_FAILURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_CONNECT_BASE + 10; +pub const WLAN_REASON_CODE_DRIVER_DISCONNECTED: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_CONNECT_BASE + 11; +pub const WLAN_REASON_CODE_DRIVER_OPERATION_FAILURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_CONNECT_BASE + 12; +pub const WLAN_REASON_CODE_IHV_NOT_AVAILABLE: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_CONNECT_BASE + + 13; +pub const WLAN_REASON_CODE_IHV_NOT_RESPONDING: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_CONNECT_BASE + + 14; +pub const WLAN_REASON_CODE_DISCONNECT_TIMEOUT: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_CONNECT_BASE + + 15; +pub const WLAN_REASON_CODE_INTERNAL_FAILURE: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_CONNECT_BASE + + 16; +pub const WLAN_REASON_CODE_UI_REQUEST_TIMEOUT: WLAN_REASON_CODE = WLAN_REASON_CODE_MSM_CONNECT_BASE + + 17; +pub const WLAN_REASON_CODE_TOO_MANY_SECURITY_ATTEMPTS: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_CONNECT_BASE + 18; +pub const WLAN_REASON_CODE_AP_STARTING_FAILURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSM_CONNECT_BASE + 19; +pub const WLAN_REASON_CODE_MSMSEC_MIN: WLAN_REASON_CODE = WLAN_REASON_CODE_MSMSEC_BASE; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_KEY_INDEX: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 1; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_PSK_PRESENT: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 2; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_KEY_LENGTH: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 3; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_PSK_LENGTH: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 4; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_NO_AUTH_CIPHER_SPECIFIED: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 5; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_TOO_MANY_AUTH_CIPHER_SPECIFIED: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 6; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_DUPLICATE_AUTH_CIPHER: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 7; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_RAWDATA_INVALID: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 8; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_AUTH_CIPHER: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 9; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_ONEX_DISABLED: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 10; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_ONEX_ENABLED: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 11; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_PMKCACHE_MODE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 12; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_PMKCACHE_SIZE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 13; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_PMKCACHE_TTL: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 14; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_PREAUTH_MODE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 15; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_PREAUTH_THROTTLE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 16; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_PREAUTH_ONLY_ENABLED: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 17; +pub const WLAN_REASON_CODE_MSMSEC_CAPABILITY_NETWORK: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 18; +pub const WLAN_REASON_CODE_MSMSEC_CAPABILITY_NIC: WLAN_REASON_CODE = WLAN_REASON_CODE_MSMSEC_BASE + + 19; +pub const WLAN_REASON_CODE_MSMSEC_CAPABILITY_PROFILE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 20; +pub const WLAN_REASON_CODE_MSMSEC_CAPABILITY_DISCOVERY: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 21; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_PASSPHRASE_CHAR: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 22; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_KEYMATERIAL_CHAR: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 23; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_WRONG_KEYTYPE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 24; +pub const WLAN_REASON_CODE_MSMSEC_MIXED_CELL: WLAN_REASON_CODE = WLAN_REASON_CODE_MSMSEC_BASE + 25; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_AUTH_TIMERS_INVALID: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 26; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_INVALID_GKEY_INTV: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 27; +pub const WLAN_REASON_CODE_MSMSEC_TRANSITION_NETWORK: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 28; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_KEY_UNMAPPED_CHAR: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 29; +pub const WLAN_REASON_CODE_MSMSEC_CAPABILITY_PROFILE_AUTH: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 30; +pub const WLAN_REASON_CODE_MSMSEC_CAPABILITY_PROFILE_CIPHER: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 31; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_SAFE_MODE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 32; +pub const WLAN_REASON_CODE_MSMSEC_CAPABILITY_PROFILE_SAFE_MODE_NIC: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 33; +pub const WLAN_REASON_CODE_MSMSEC_CAPABILITY_PROFILE_SAFE_MODE_NW: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 34; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_UNSUPPORTED_AUTH: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 35; +pub const WLAN_REASON_CODE_MSMSEC_PROFILE_UNSUPPORTED_CIPHER: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 36; +pub const WLAN_REASON_CODE_MSMSEC_CAPABILITY_MFP_NW_NIC: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_BASE + 37; +pub const WLAN_REASON_CODE_MSMSEC_UI_REQUEST_FAILURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 1; +pub const WLAN_REASON_CODE_MSMSEC_AUTH_START_TIMEOUT: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 2; +pub const WLAN_REASON_CODE_MSMSEC_AUTH_SUCCESS_TIMEOUT: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 3; +pub const WLAN_REASON_CODE_MSMSEC_KEY_START_TIMEOUT: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 4; +pub const WLAN_REASON_CODE_MSMSEC_KEY_SUCCESS_TIMEOUT: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 5; +pub const WLAN_REASON_CODE_MSMSEC_M3_MISSING_KEY_DATA: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 6; +pub const WLAN_REASON_CODE_MSMSEC_M3_MISSING_IE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 7; +pub const WLAN_REASON_CODE_MSMSEC_M3_MISSING_GRP_KEY: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 8; +pub const WLAN_REASON_CODE_MSMSEC_PR_IE_MATCHING: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 9; +pub const WLAN_REASON_CODE_MSMSEC_SEC_IE_MATCHING: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 10; +pub const WLAN_REASON_CODE_MSMSEC_NO_PAIRWISE_KEY: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 11; +pub const WLAN_REASON_CODE_MSMSEC_G1_MISSING_KEY_DATA: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 12; +pub const WLAN_REASON_CODE_MSMSEC_G1_MISSING_GRP_KEY: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 13; +pub const WLAN_REASON_CODE_MSMSEC_PEER_INDICATED_INSECURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 14; +pub const WLAN_REASON_CODE_MSMSEC_NO_AUTHENTICATOR: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 15; +pub const WLAN_REASON_CODE_MSMSEC_NIC_FAILURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 16; +pub const WLAN_REASON_CODE_MSMSEC_CANCELLED: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 17; +pub const WLAN_REASON_CODE_MSMSEC_KEY_FORMAT: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 18; +pub const WLAN_REASON_CODE_MSMSEC_DOWNGRADE_DETECTED: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 19; +pub const WLAN_REASON_CODE_MSMSEC_PSK_MISMATCH_SUSPECTED: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 20; +pub const WLAN_REASON_CODE_MSMSEC_FORCED_FAILURE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 21; +pub const WLAN_REASON_CODE_MSMSEC_M3_TOO_MANY_RSNIE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 22; +pub const WLAN_REASON_CODE_MSMSEC_M2_MISSING_KEY_DATA: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 23; +pub const WLAN_REASON_CODE_MSMSEC_M2_MISSING_IE: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 24; +pub const WLAN_REASON_CODE_MSMSEC_AUTH_WCN_COMPLETED: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 25; +pub const WLAN_REASON_CODE_MSMSEC_M3_MISSING_MGMT_GRP_KEY: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 26; +pub const WLAN_REASON_CODE_MSMSEC_G1_MISSING_MGMT_GRP_KEY: WLAN_REASON_CODE = + WLAN_REASON_CODE_MSMSEC_CONNECT_BASE + 27; +pub const WLAN_REASON_CODE_MSMSEC_MAX: WLAN_REASON_CODE = WLAN_REASON_CODE_MSMSEC_END; +pub type WLAN_SIGNAL_QUALITY = ULONG; +pub type PWLAN_SIGNAL_QUALITY = *mut ULONG; +pub const WLAN_AVAILABLE_NETWORK_CONNECTED: DWORD = 0x00000001; +pub const WLAN_AVAILABLE_NETWORK_HAS_PROFILE: DWORD = 0x00000002; +pub const WLAN_AVAILABLE_NETWORK_CONSOLE_USER_PROFILE: DWORD = 0x00000004; +pub const WLAN_AVAILABLE_NETWORK_INTERWORKING_SUPPORTED: DWORD = 0x00000008; +pub const WLAN_AVAILABLE_NETWORK_HOTSPOT2_ENABLED: DWORD = 0x00000010; +pub const WLAN_AVAILABLE_NETWORK_ANQP_SUPPORTED: DWORD = 0x00000020; +pub const WLAN_AVAILABLE_NETWORK_HOTSPOT2_DOMAIN: DWORD = 0x00000040; +pub const WLAN_AVAILABLE_NETWORK_HOTSPOT2_ROAMING: DWORD = 0x00000080; +pub const WLAN_AVAILABLE_NETWORK_AUTO_CONNECT_FAILED: DWORD = 0x00000100; +pub const WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_ADHOC_PROFILES: DWORD = 0x00000001; +pub const WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES: DWORD = 0x00000002; +STRUCT!{struct WLAN_RATE_SET { + uRateSetLength: ULONG, + usRateSet: [USHORT; DOT11_RATE_SET_MAX_LENGTH], +}} +pub type PWLAN_RATE_SET = *mut WLAN_RATE_SET; +pub const WLAN_MAX_PHY_TYPE_NUMBER: usize = 8; +STRUCT!{struct WLAN_AVAILABLE_NETWORK { + strProfileName: [WCHAR; WLAN_MAX_NAME_LENGTH], + dot11Ssid: DOT11_SSID, + dot11BssType: DOT11_BSS_TYPE, + uNumberOfBssids: ULONG, + bNetworkConnectable: BOOL, + wlanNotConnectableReason: WLAN_REASON_CODE, + uNumberOfPhyTypes: ULONG, + dot11PhyTypes: [DOT11_PHY_TYPE; WLAN_MAX_PHY_TYPE_NUMBER], + bMorePhyTypes: BOOL, + wlanSignalQuality: WLAN_SIGNAL_QUALITY, + bSecurityEnabled: BOOL, + dot11DefaultAuthAlgorithm: DOT11_AUTH_ALGORITHM, + dot11DefaultCipherAlgorithm: DOT11_CIPHER_ALGORITHM, + dwFlags: DWORD, + dwReserved: DWORD, +}} +pub type PWLAN_AVAILABLE_NETWORK = *mut WLAN_AVAILABLE_NETWORK; +STRUCT!{struct WLAN_AVAILABLE_NETWORK_V2 { + strProfileName: [WCHAR; WLAN_MAX_NAME_LENGTH], + dot11Ssid: DOT11_SSID, + dot11BssType: DOT11_BSS_TYPE, + uNumberOfBssids: ULONG, + bNetworkConnectable: BOOL, + wlanNotConnectableReason: WLAN_REASON_CODE, + uNumberOfPhyTypes: ULONG, + dot11PhyTypes: [DOT11_PHY_TYPE; WLAN_MAX_PHY_TYPE_NUMBER], + bMorePhyTypes: BOOL, + wlanSignalQuality: WLAN_SIGNAL_QUALITY, + bSecurityEnabled: BOOL, + dot11DefaultAuthAlgorithm: DOT11_AUTH_ALGORITHM, + dot11DefaultCipherAlgorithm: DOT11_CIPHER_ALGORITHM, + dwFlags: DWORD, + AccessNetworkOptions: DOT11_ACCESSNETWORKOPTIONS, + dot11HESSID: DOT11_HESSID, + VenueInfo: DOT11_VENUEINFO, + dwReserved: DWORD, +}} +pub type PWLAN_AVAILABLE_NETWORK_V2 = *mut WLAN_AVAILABLE_NETWORK_V2; +STRUCT!{struct WLAN_BSS_ENTRY { + dot11Ssid: DOT11_SSID, + uPhyId: ULONG, + dot11Bssid: DOT11_MAC_ADDRESS, + dot11BssType: DOT11_BSS_TYPE, + dot11BssPhyType: DOT11_PHY_TYPE, + lRssi: LONG, + uLinkQuality: ULONG, + bInRegDomain: BOOLEAN, + usBeaconPeriod: USHORT, + ullTimestamp: ULONGLONG, + ullHostTimestamp: ULONGLONG, + usCapabilityInformation: USHORT, + ulChCenterFrequency: ULONG, + wlanRateSet: WLAN_RATE_SET, + ulIeOffset: ULONG, + ulIeSize: ULONG, +}} +pub type PWLAN_BSS_ENTRY = *mut WLAN_BSS_ENTRY; +STRUCT!{struct WLAN_BSS_LIST { + dwTotalSize: DWORD, + dwNumberOfItems: DWORD, + wlanBssEntries: [WLAN_BSS_ENTRY; 1], +}} +pub type PWLAN_BSS_LIST = *mut WLAN_BSS_LIST; +ENUM!{enum WLAN_INTERFACE_STATE { + wlan_interface_state_not_ready = 0, + wlan_interface_state_connected = 1, + wlan_interface_state_ad_hoc_network_formed = 2, + wlan_interface_state_disconnecting = 3, + wlan_interface_state_disconnected = 4, + wlan_interface_state_associating = 5, + wlan_interface_state_discovering = 6, + wlan_interface_state_authenticating = 7, +}} +pub type PWLAN_INTERFACE_STATE = *mut WLAN_INTERFACE_STATE; +ENUM!{enum WLAN_ADHOC_NETWORK_STATE { + wlan_adhoc_network_state_formed = 0, + wlan_adhoc_network_state_connected = 1, +}} +pub type PWLAN_ADHOC_NETWORK_STATE = *mut WLAN_ADHOC_NETWORK_STATE; +STRUCT!{struct WLAN_INTERFACE_INFO { + InterfaceGuid: GUID, + strInterfaceDescription: [WCHAR; WLAN_MAX_NAME_LENGTH], + isState: WLAN_INTERFACE_STATE, +}} +pub type PWLAN_INTERFACE_INFO = *mut WLAN_INTERFACE_INFO; +STRUCT!{struct WLAN_ASSOCIATION_ATTRIBUTES { + dot11Ssid: DOT11_SSID, + dot11BssType: DOT11_BSS_TYPE, + dot11Bssid: DOT11_MAC_ADDRESS, + dot11PhyType: DOT11_PHY_TYPE, + uDot11PhyIndex: ULONG, + wlanSignalQuality: WLAN_SIGNAL_QUALITY, + ulRxRate: ULONG, + ulTxRate: ULONG, +}} +pub type PWLAN_ASSOCIATION_ATTRIBUTES = *mut WLAN_ASSOCIATION_ATTRIBUTES; +STRUCT!{struct WLAN_SECURITY_ATTRIBUTES { + bSecurityEnabled: BOOL, + bOneXEnabled: BOOL, + dot11AuthAlgorithm: DOT11_AUTH_ALGORITHM, + dot11CipherAlgorithm: DOT11_CIPHER_ALGORITHM, +}} +pub type PWLAN_SECURITY_ATTRIBUTES = *mut WLAN_SECURITY_ATTRIBUTES; +STRUCT!{struct WLAN_CONNECTION_ATTRIBUTES { + isState: WLAN_INTERFACE_STATE, + wlanConnectionMode: WLAN_CONNECTION_MODE, + strProfileName: [WCHAR; WLAN_MAX_NAME_LENGTH], + wlanAssociationAttributes: WLAN_ASSOCIATION_ATTRIBUTES, + wlanSecurityAttributes: WLAN_SECURITY_ATTRIBUTES, +}} +pub type PWLAN_CONNECTION_ATTRIBUTES = *mut WLAN_CONNECTION_ATTRIBUTES; +ENUM!{enum DOT11_RADIO_STATE { + dot11_radio_state_unknown = 0, + dot11_radio_state_on = 1, + dot11_radio_state_off = 2, +}} +pub type PDOT11_RADIO_STATE = *mut DOT11_RADIO_STATE; +pub const WLAN_MAX_PHY_INDEX: usize = 64; +STRUCT!{struct WLAN_PHY_RADIO_STATE { + dwPhyIndex: DWORD, + dot11SoftwareRadioState: DOT11_RADIO_STATE, + dot11HardwareRadioState: DOT11_RADIO_STATE, +}} +pub type PWLAN_PHY_RADIO_STATE = *mut WLAN_PHY_RADIO_STATE; +STRUCT!{struct WLAN_RADIO_STATE { + dwNumberOfPhys: DWORD, + PhyRadioState: [WLAN_PHY_RADIO_STATE; WLAN_MAX_PHY_INDEX], +}} +pub type PWLAN_RADIO_STATE = *mut WLAN_RADIO_STATE; +ENUM!{enum WLAN_OPERATIONAL_STATE { + wlan_operational_state_unknown = 0, + wlan_operational_state_off = 1, + wlan_operational_state_on = 2, + wlan_operational_state_going_off = 3, + wlan_operational_state_going_on = 4, +}} +pub type PWLAN_OPERATIONAL_STATE = *mut WLAN_OPERATIONAL_STATE; +ENUM!{enum WLAN_INTERFACE_TYPE { + wlan_interface_type_emulated_802_11 = 0, + wlan_interface_type_native_802_11 = 1, + wlan_interface_type_invalid = 2, +}} +pub type PWLAN_INTERFACE_TYPE = *mut WLAN_INTERFACE_TYPE; +STRUCT!{struct WLAN_INTERFACE_CAPABILITY { + interfaceType: WLAN_INTERFACE_TYPE, + bDot11DSupported: BOOL, + dwMaxDesiredSsidListSize: DWORD, + dwMaxDesiredBssidListSize: DWORD, + dwNumberOfSupportedPhys: DWORD, + dot11PhyTypes: [DOT11_PHY_TYPE; WLAN_MAX_PHY_INDEX], +}} +pub type PWLAN_INTERFACE_CAPABILITY = *mut WLAN_INTERFACE_CAPABILITY; +STRUCT!{struct WLAN_AUTH_CIPHER_PAIR_LIST { + dwNumberOfItems: DWORD, + pAuthCipherPairList: [DOT11_AUTH_CIPHER_PAIR; 1], +}} +pub type PWLAN_AUTH_CIPHER_PAIR_LIST = *mut WLAN_AUTH_CIPHER_PAIR_LIST; +STRUCT!{struct WLAN_COUNTRY_OR_REGION_STRING_LIST { + dwNumberOfItems: DWORD, + pCountryOrRegionStringList: [DOT11_COUNTRY_OR_REGION_STRING; 1], +}} +pub type PWLAN_COUNTRY_OR_REGION_STRING_LIST = *mut WLAN_COUNTRY_OR_REGION_STRING_LIST; +STRUCT!{struct WLAN_PROFILE_INFO_LIST { + dwNumberOfItems: DWORD, + dwIndex: DWORD, + ProfileInfo: [WLAN_PROFILE_INFO; 1], +}} +pub type PWLAN_PROFILE_INFO_LIST = *mut WLAN_PROFILE_INFO_LIST; +STRUCT!{struct WLAN_AVAILABLE_NETWORK_LIST { + dwNumberOfItems: DWORD, + dwIndex: DWORD, + Network: [WLAN_AVAILABLE_NETWORK; 1], +}} +pub type PWLAN_AVAILABLE_NETWORK_LIST = *mut WLAN_AVAILABLE_NETWORK_LIST; +STRUCT!{struct WLAN_AVAILABLE_NETWORK_LIST_V2 { + dwNumberOfItems: DWORD, + dwIndex: DWORD, + Network: [WLAN_AVAILABLE_NETWORK_V2; 1], +}} +pub type PWLAN_AVAILABLE_NETWORK_LIST_V2 = *mut WLAN_AVAILABLE_NETWORK_LIST_V2; +STRUCT!{struct WLAN_INTERFACE_INFO_LIST { + dwNumberOfItems: DWORD, + dwIndex: DWORD, + InterfaceInfo: [WLAN_INTERFACE_INFO; 1], +}} +pub type PWLAN_INTERFACE_INFO_LIST = *mut WLAN_INTERFACE_INFO_LIST; +STRUCT!{struct DOT11_NETWORK_LIST { + dwNumberOfItems: DWORD, + dwIndex: DWORD, + Network: [DOT11_NETWORK; 1], +}} +pub type PDOT11_NETWORK_LIST = *mut DOT11_NETWORK_LIST; +ENUM!{enum WLAN_POWER_SETTING { + wlan_power_setting_no_saving = 0, + wlan_power_setting_low_saving = 1, + wlan_power_setting_medium_saving = 2, + wlan_power_setting_maximum_saving = 3, + wlan_power_setting_invalid = 4, +}} +pub type PWLAN_POWER_SETTING = *mut WLAN_POWER_SETTING; +pub const WLAN_CONNECTION_HIDDEN_NETWORK: DWORD = 0x00000001; +pub const WLAN_CONNECTION_ADHOC_JOIN_ONLY: DWORD = 0x00000002; +pub const WLAN_CONNECTION_IGNORE_PRIVACY_BIT: DWORD = 0x00000004; +pub const WLAN_CONNECTION_EAPOL_PASSTHROUGH: DWORD = 0x00000008; +pub const WLAN_CONNECTION_PERSIST_DISCOVERY_PROFILE: DWORD = 0x00000010; +pub const WLAN_CONNECTION_PERSIST_DISCOVERY_PROFILE_CONNECTION_MODE_AUTO: DWORD = 0x00000020; +pub const WLAN_CONNECTION_PERSIST_DISCOVERY_PROFILE_OVERWRITE_EXISTING: DWORD = 0x00000040; +STRUCT!{struct WLAN_CONNECTION_PARAMETERS { + wlanConnectionMode: WLAN_CONNECTION_MODE, + strProfile: LPCWSTR, + pDot11Ssid: PDOT11_SSID, + pDesiredBssidList: PDOT11_BSSID_LIST, + dot11BssType: DOT11_BSS_TYPE, + dwFlags: DWORD, +}} +pub type PWLAN_CONNECTION_PARAMETERS = *mut WLAN_CONNECTION_PARAMETERS; +STRUCT!{struct WLAN_CONNECTION_PARAMETERS_V2 { + wlanConnectionMode: WLAN_CONNECTION_MODE, + strProfile: LPCWSTR, + pDot11Ssid: PDOT11_SSID, + pDot11Hessid: PDOT11_HESSID, + pDesiredBssidList: PDOT11_BSSID_LIST, + dot11BssType: DOT11_BSS_TYPE, + dwFlags: DWORD, + pDot11AccessNetworkOptions: PDOT11_ACCESSNETWORKOPTIONS, +}} +pub type PWLAN_CONNECTION_PARAMETERS_V2 = *mut WLAN_CONNECTION_PARAMETERS_V2; +STRUCT!{struct WLAN_MSM_NOTIFICATION_DATA { + wlanConnectionMode: WLAN_CONNECTION_MODE, + strProfileName: [WCHAR; WLAN_MAX_NAME_LENGTH], + dot11Ssid: DOT11_SSID, + dot11BssType: DOT11_BSS_TYPE, + dot11MacAddr: DOT11_MAC_ADDRESS, + bSecurityEnabled: BOOL, + bFirstPeer: BOOL, + bLastPeer: BOOL, + wlanReasonCode: WLAN_REASON_CODE, +}} +pub type PWLAN_MSM_NOTIFICATION_DATA = *mut WLAN_MSM_NOTIFICATION_DATA; +pub const WLAN_CONNECTION_NOTIFICATION_ADHOC_NETWORK_FORMED: DWORD = 0x00000001; +pub const WLAN_CONNECTION_NOTIFICATION_CONSOLE_USER_PROFILE: DWORD = 0x00000004; +STRUCT!{struct WLAN_CONNECTION_NOTIFICATION_DATA { + wlanConnectionMode: WLAN_CONNECTION_MODE, + strProfileName: [WCHAR; WLAN_MAX_NAME_LENGTH], + dot11Ssid: DOT11_SSID, + dot11BssType: DOT11_BSS_TYPE, + bSecurityEnabled: BOOL, + wlanReasonCode: WLAN_REASON_CODE, + dwFlags: DWORD, + strProfileXml: [WCHAR; 1], +}} +pub type PWLAN_CONNECTION_NOTIFICATION_DATA = *mut WLAN_CONNECTION_NOTIFICATION_DATA; +pub const WLAN_NOTIFICATION_SOURCE_NONE: DWORD = L2_NOTIFICATION_SOURCE_NONE; +pub const WLAN_NOTIFICATION_SOURCE_ALL: DWORD = L2_NOTIFICATION_SOURCE_ALL; +pub const WLAN_NOTIFICATION_SOURCE_ACM: DWORD = L2_NOTIFICATION_SOURCE_WLAN_ACM; +pub const WLAN_NOTIFICATION_SOURCE_MSM: DWORD = L2_NOTIFICATION_SOURCE_WLAN_MSM; +pub const WLAN_NOTIFICATION_SOURCE_SECURITY: DWORD = L2_NOTIFICATION_SOURCE_WLAN_SECURITY; +pub const WLAN_NOTIFICATION_SOURCE_IHV: DWORD = L2_NOTIFICATION_SOURCE_WLAN_IHV; +pub const WLAN_NOTIFICATION_SOURCE_HNWK: DWORD = L2_NOTIFICATION_SOURCE_WLAN_HNWK; +pub const WLAN_NOTIFICATION_SOURCE_ONEX: DWORD = L2_NOTIFICATION_SOURCE_ONEX; +ENUM!{enum WLAN_NOTIFICATION_ACM { + wlan_notification_acm_start = L2_NOTIFICATION_CODE_PUBLIC_BEGIN, + wlan_notification_acm_autoconf_enabled = 1, + wlan_notification_acm_autoconf_disabled = 2, + wlan_notification_acm_background_scan_enabled = 3, + wlan_notification_acm_background_scan_disabled = 4, + wlan_notification_acm_bss_type_change = 5, + wlan_notification_acm_power_setting_change = 6, + wlan_notification_acm_scan_complete = 7, + wlan_notification_acm_scan_fail = 8, + wlan_notification_acm_connection_start = 9, + wlan_notification_acm_connection_complete = 10, + wlan_notification_acm_connection_attempt_fail = 11, + wlan_notification_acm_filter_list_change = 12, + wlan_notification_acm_interface_arrival = 13, + wlan_notification_acm_interface_removal = 14, + wlan_notification_acm_profile_change = 15, + wlan_notification_acm_profile_name_change = 16, + wlan_notification_acm_profiles_exhausted = 17, + wlan_notification_acm_network_not_available = 18, + wlan_notification_acm_network_available = 19, + wlan_notification_acm_disconnecting = 20, + wlan_notification_acm_disconnected = 21, + wlan_notification_acm_adhoc_network_state_change = 22, + wlan_notification_acm_profile_unblocked = 23, + wlan_notification_acm_screen_power_change = 24, + wlan_notification_acm_profile_blocked = 25, + wlan_notification_acm_scan_list_refresh = 26, + wlan_notification_acm_operational_state_change = 27, + wlan_notification_acm_end = 28, +}} +pub type PWLAN_NOTIFICATION_ACM = *mut WLAN_NOTIFICATION_ACM; +ENUM!{enum WLAN_NOTIFICATION_MSM { + wlan_notification_msm_start = L2_NOTIFICATION_CODE_PUBLIC_BEGIN, + wlan_notification_msm_associating = 1, + wlan_notification_msm_associated = 2, + wlan_notification_msm_authenticating = 3, + wlan_notification_msm_connected = 4, + wlan_notification_msm_roaming_start = 5, + wlan_notification_msm_roaming_end = 6, + wlan_notification_msm_radio_state_change = 7, + wlan_notification_msm_signal_quality_change = 8, + wlan_notification_msm_disassociating = 9, + wlan_notification_msm_disconnected = 10, + wlan_notification_msm_peer_join = 11, + wlan_notification_msm_peer_leave = 12, + wlan_notification_msm_adapter_removal = 13, + wlan_notification_msm_adapter_operation_mode_change = 14, + wlan_notification_msm_link_degraded = 15, + wlan_notification_msm_link_improved = 16, + wlan_notification_msm_end = 17, +}} +pub type PWLAN_NOTIFICATION_MSM = *mut WLAN_NOTIFICATION_MSM; +ENUM!{enum WLAN_NOTIFICATION_SECURITY { + wlan_notification_security_start = L2_NOTIFICATION_CODE_PUBLIC_BEGIN, + wlan_notification_security_end = 1, +}} +pub type PWLAN_NOTIFICATION_SECURITY = *mut WLAN_NOTIFICATION_SECURITY; +pub type WLAN_NOTIFICATION_DATA = L2_NOTIFICATION_DATA; +pub type PWLAN_NOTIFICATION_DATA = *mut L2_NOTIFICATION_DATA; +FN!{stdcall WLAN_NOTIFICATION_CALLBACK( + PWLAN_NOTIFICATION_DATA, + PVOID, +) -> ()} +ENUM!{enum WLAN_OPCODE_VALUE_TYPE { + wlan_opcode_value_type_query_only = 0, + wlan_opcode_value_type_set_by_group_policy = 1, + wlan_opcode_value_type_set_by_user = 2, + wlan_opcode_value_type_invalid = 3, +}} +pub type PWLAN_OPCODE_VALUE_TYPE = *mut WLAN_OPCODE_VALUE_TYPE; +ENUM!{enum WLAN_INTF_OPCODE { + wlan_intf_opcode_autoconf_start = 0x000000000, + wlan_intf_opcode_autoconf_enabled = 1, + wlan_intf_opcode_background_scan_enabled = 2, + wlan_intf_opcode_media_streaming_mode = 3, + wlan_intf_opcode_radio_state = 4, + wlan_intf_opcode_bss_type = 5, + wlan_intf_opcode_interface_state = 6, + wlan_intf_opcode_current_connection = 7, + wlan_intf_opcode_channel_number = 8, + wlan_intf_opcode_supported_infrastructure_auth_cipher_pairs = 9, + wlan_intf_opcode_supported_adhoc_auth_cipher_pairs = 10, + wlan_intf_opcode_supported_country_or_region_string_list = 11, + wlan_intf_opcode_current_operation_mode = 12, + wlan_intf_opcode_supported_safe_mode = 13, + wlan_intf_opcode_certified_safe_mode = 14, + wlan_intf_opcode_hosted_network_capable = 15, + wlan_intf_opcode_management_frame_protection_capable = 16, + wlan_intf_opcode_autoconf_end = 0x0fffffff, + wlan_intf_opcode_msm_start = 0x10000100, + wlan_intf_opcode_statistics = 268435713, + wlan_intf_opcode_rssi = 268435714, + wlan_intf_opcode_msm_end = 0x1fffffff, + wlan_intf_opcode_security_start = 0x20010000, + wlan_intf_opcode_security_end = 0x2fffffff, + wlan_intf_opcode_ihv_start = 0x30000000, + wlan_intf_opcode_ihv_end = 0x3fffffff, +}} +pub type PWLAN_INTF_OPCODE = *mut WLAN_INTF_OPCODE; +ENUM!{enum WLAN_AUTOCONF_OPCODE { + wlan_autoconf_opcode_start = 0, + wlan_autoconf_opcode_show_denied_networks = 1, + wlan_autoconf_opcode_power_setting = 2, + wlan_autoconf_opcode_only_use_gp_profiles_for_allowed_networks = 3, + wlan_autoconf_opcode_allow_explicit_creds = 4, + wlan_autoconf_opcode_block_period = 5, + wlan_autoconf_opcode_allow_virtual_station_extensibility = 6, + wlan_autoconf_opcode_end = 7, +}} +pub type PWLAN_AUTOCONF_OPCODE = *mut WLAN_AUTOCONF_OPCODE; +ENUM!{enum WLAN_IHV_CONTROL_TYPE { + wlan_ihv_control_type_service = 0, + wlan_ihv_control_type_driver = 1, +}} +pub type PWLAN_IHV_CONTROL_TYPE = *mut WLAN_IHV_CONTROL_TYPE; +ENUM!{enum WLAN_FILTER_LIST_TYPE { + wlan_filter_list_type_gp_permit = 0, + wlan_filter_list_type_gp_deny = 1, + wlan_filter_list_type_user_permit = 2, + wlan_filter_list_type_user_deny = 3, +}} +pub type PWLAN_FILTER_LIST_TYPE = *mut WLAN_FILTER_LIST_TYPE; +STRUCT!{struct WLAN_PHY_FRAME_STATISTICS { + ullTransmittedFrameCount: ULONGLONG, + ullMulticastTransmittedFrameCount: ULONGLONG, + ullFailedCount: ULONGLONG, + ullRetryCount: ULONGLONG, + ullMultipleRetryCount: ULONGLONG, + ullMaxTXLifetimeExceededCount: ULONGLONG, + ullTransmittedFragmentCount: ULONGLONG, + ullRTSSuccessCount: ULONGLONG, + ullRTSFailureCount: ULONGLONG, + ullACKFailureCount: ULONGLONG, + ullReceivedFrameCount: ULONGLONG, + ullMulticastReceivedFrameCount: ULONGLONG, + ullPromiscuousReceivedFrameCount: ULONGLONG, + ullMaxRXLifetimeExceededCount: ULONGLONG, + ullFrameDuplicateCount: ULONGLONG, + ullReceivedFragmentCount: ULONGLONG, + ullPromiscuousReceivedFragmentCount: ULONGLONG, + ullFCSErrorCount: ULONGLONG, +}} +pub type PWLAN_PHY_FRAME_STATISTICS = *mut WLAN_PHY_FRAME_STATISTICS; +STRUCT!{struct WLAN_MAC_FRAME_STATISTICS { + ullTransmittedFrameCount: ULONGLONG, + ullReceivedFrameCount: ULONGLONG, + ullWEPExcludedCount: ULONGLONG, + ullTKIPLocalMICFailures: ULONGLONG, + ullTKIPReplays: ULONGLONG, + ullTKIPICVErrorCount: ULONGLONG, + ullCCMPReplays: ULONGLONG, + ullCCMPDecryptErrors: ULONGLONG, + ullWEPUndecryptableCount: ULONGLONG, + ullWEPICVErrorCount: ULONGLONG, + ullDecryptSuccessCount: ULONGLONG, + ullDecryptFailureCount: ULONGLONG, +}} +pub type PWLAN_MAC_FRAME_STATISTICS = *mut WLAN_MAC_FRAME_STATISTICS; +STRUCT!{struct WLAN_STATISTICS { + ullFourWayHandshakeFailures: ULONGLONG, + ullTKIPCounterMeasuresInvoked: ULONGLONG, + ullReserved: ULONGLONG, + MacUcastCounters: WLAN_MAC_FRAME_STATISTICS, + MacMcastCounters: WLAN_MAC_FRAME_STATISTICS, + dwNumberOfPhys: DWORD, + PhyCounters: [WLAN_PHY_FRAME_STATISTICS; 1], +}} +pub type PWLAN_STATISTICS = *mut WLAN_STATISTICS; +pub const WLAN_READ_ACCESS: DWORD = STANDARD_RIGHTS_READ | FILE_READ_DATA; +pub const WLAN_EXECUTE_ACCESS: DWORD = WLAN_READ_ACCESS | STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE; +pub const WLAN_WRITE_ACCESS: DWORD = WLAN_READ_ACCESS | WLAN_EXECUTE_ACCESS | STANDARD_RIGHTS_WRITE + | FILE_WRITE_DATA | DELETE | WRITE_DAC; +ENUM!{enum WLAN_SECURABLE_OBJECT { + wlan_secure_permit_list = 0, + wlan_secure_deny_list = 1, + wlan_secure_ac_enabled = 2, + wlan_secure_bc_scan_enabled = 3, + wlan_secure_bss_type = 4, + wlan_secure_show_denied = 5, + wlan_secure_interface_properties = 6, + wlan_secure_ihv_control = 7, + wlan_secure_all_user_profiles_order = 8, + wlan_secure_add_new_all_user_profiles = 9, + wlan_secure_add_new_per_user_profiles = 10, + wlan_secure_media_streaming_mode_enabled = 11, + wlan_secure_current_operation_mode = 12, + wlan_secure_get_plaintext_key = 13, + wlan_secure_hosted_network_elevated_access = 14, + wlan_secure_virtual_station_extensibility = 15, + wlan_secure_wfd_elevated_access = 16, + WLAN_SECURABLE_OBJECT_COUNT = 17, +}} +pub type PWLAN_SECURABLE_OBJECT = *mut WLAN_SECURABLE_OBJECT; +STRUCT!{struct WLAN_DEVICE_SERVICE_GUID_LIST { + dwNumberOfItems: DWORD, + dwIndex: DWORD, + DeviceService: [GUID; 1], +}} +pub type PWLAN_DEVICE_SERVICE_GUID_LIST = *mut WLAN_DEVICE_SERVICE_GUID_LIST; +pub const WFD_API_VERSION_1_0: DWORD = 0x00000001; +pub const WFD_API_VERSION: DWORD = WFD_API_VERSION_1_0; +ENUM!{enum WFD_ROLE_TYPE { + WFD_ROLE_TYPE_NONE = 0x00, + WFD_ROLE_TYPE_DEVICE = 0x01, + WFD_ROLE_TYPE_GROUP_OWNER = 0x02, + WFD_ROLE_TYPE_CLIENT = 0x04, + WFD_ROLE_TYPE_MAX = 0x05, +}} +pub type PWFD_ROLE_TYPE = *mut WFD_ROLE_TYPE; +STRUCT!{struct WFD_GROUP_ID { + DeviceAddress: DOT11_MAC_ADDRESS, + GroupSSID: DOT11_SSID, +}} +pub type PWFD_GROUP_ID = *mut WFD_GROUP_ID; +extern "system" { + pub fn WlanOpenHandle( + dwClientVersion: DWORD, + pReserved: PVOID, + pdwNegotiatedVersion: PDWORD, + phClientHandle: PHANDLE, + ) -> DWORD; + pub fn WlanCloseHandle( + hClientHandle: HANDLE, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanEnumInterfaces( + hClientHandle: HANDLE, + pReserved: PVOID, + ppInterfaceList: *mut PWLAN_INTERFACE_INFO_LIST, + ) -> DWORD; + pub fn WlanSetAutoConfigParameter( + hClientHandle: HANDLE, + OpCode: WLAN_AUTOCONF_OPCODE, + dwDataSize: DWORD, + pData: PVOID, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanQueryAutoConfigParameter( + hClientHandle: HANDLE, + OpCode: WLAN_AUTOCONF_OPCODE, + pReserved: PVOID, + pdwDataSize: PDWORD, + ppData: *mut PVOID, + pWlanOpcodeValueType: PWLAN_OPCODE_VALUE_TYPE, + ) -> DWORD; + pub fn WlanGetInterfaceCapability( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + pReserved: PVOID, + ppCapability: *mut PWLAN_INTERFACE_CAPABILITY, + ) -> DWORD; + pub fn WlanSetInterface( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + OpCode: WLAN_INTF_OPCODE, + dwDataSize: DWORD, + pData: PVOID, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanQueryInterface( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + OpCode: WLAN_INTF_OPCODE, + pReserved: PVOID, + pdwDataSize: PDWORD, + ppData: *mut PVOID, + pWlanOpcodeValueType: PWLAN_OPCODE_VALUE_TYPE, + ) -> DWORD; + pub fn WlanIhvControl( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + Type: WLAN_IHV_CONTROL_TYPE, + dwInBufferSize: DWORD, + pInBuffer: PVOID, + dwOutBufferSize: DWORD, + pOutBuffer: PVOID, + pdwBytesReturned: PDWORD, + ) -> DWORD; + pub fn WlanScan( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + pDot11Ssid: PDOT11_SSID, + pIeData: PWLAN_RAW_DATA, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanGetAvailableNetworkList( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + dwFlags: DWORD, + pReserved: PVOID, + ppAvailableNetworkList: *mut PWLAN_AVAILABLE_NETWORK_LIST, + ) -> DWORD; + pub fn WlanGetAvailableNetworkList2( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + dwFlags: DWORD, + pReserved: PVOID, + ppAvailableNetworkList: *mut PWLAN_AVAILABLE_NETWORK_LIST_V2, + ) -> DWORD; + pub fn WlanGetNetworkBssList( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + pDot11Ssid: PDOT11_SSID, + dot11BssType: DOT11_BSS_TYPE, + bSecurityEnabled: BOOL, + pReserved: PVOID, + ppWlanBssList: *mut PWLAN_BSS_LIST, + ) -> DWORD; + pub fn WlanConnect( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + pConnectionParameters: PWLAN_CONNECTION_PARAMETERS, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanConnect2( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + pConnectionParameters: PWLAN_CONNECTION_PARAMETERS_V2, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanDisconnect( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanRegisterNotification( + hClientHandle: HANDLE, + dwNotifSource: DWORD, + bIgnoreDuplicate: BOOL, + funcCallback: WLAN_NOTIFICATION_CALLBACK, + pCallbackContext: PVOID, + pReserved: PVOID, + pdwPrevNotifSource: PDWORD, + ) -> DWORD; + pub fn WlanGetProfile( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + strProfileName: LPCWSTR, + pReserved: PVOID, + pstrProfileXml: *mut LPWSTR, + pdwFlags: *mut DWORD, + pdwGrantedAccess: *mut DWORD, + ) -> DWORD; + pub fn WlanSetProfileEapUserData( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + strProfileName: LPCWSTR, + eapType: EAP_METHOD_TYPE, + dwFlags: DWORD, + dwEapUserDataSize: DWORD, + pbEapUserData: LPBYTE, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanSetProfileEapXmlUserData( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + strProfileName: LPCWSTR, + dwFlags: DWORD, + strEapXmlUserData: LPCWSTR, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanSetProfile( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + dwFlags: DWORD, + strProfileXml: LPCWSTR, + strAllUserProfileSecurity: LPCWSTR, + bOverwrite: BOOL, + pReserved: PVOID, + pdwReasonCode: *mut DWORD, + ) -> DWORD; + pub fn WlanDeleteProfile( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + strProfileName: LPCWSTR, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanRenameProfile( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + strOldProfileName: LPCWSTR, + strNewProfileName: LPCWSTR, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanGetProfileList( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + pReserved: PVOID, + ppProfileList: *mut PWLAN_PROFILE_INFO_LIST, + ) -> DWORD; + pub fn WlanSetProfileList( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + dwItems: DWORD, + strProfileNames: *mut LPCWSTR, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanSetProfilePosition( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + strProfileName: LPCWSTR, + dwPosition: DWORD, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanSetProfileCustomUserData( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + strProfileName: LPCWSTR, + dwDataSize: DWORD, + pData: PBYTE, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanGetProfileCustomUserData( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + strProfileName: LPCWSTR, + pReserved: PVOID, + pdwDataSize: *mut DWORD, + ppData: *mut PBYTE, + ) -> DWORD; + pub fn WlanSetFilterList( + hClientHandle: HANDLE, + wlanFilterListType: WLAN_FILTER_LIST_TYPE, + pNetworkList: PDOT11_NETWORK_LIST, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanGetFilterList( + hClientHandle: HANDLE, + wlanFilterListType: WLAN_FILTER_LIST_TYPE, + pReserved: PVOID, + ppNetworkList: *mut PDOT11_NETWORK_LIST, + ) -> DWORD; + pub fn WlanSetPsdIEDataList( + hClientHandle: HANDLE, + strFormat: LPCWSTR, + pPsdIEDataList: PWLAN_RAW_DATA_LIST, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanSaveTemporaryProfile( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + strProfileName: LPCWSTR, + strAllUserProfileSecurity: LPCWSTR, + dwFlags: DWORD, + bOverWrite: BOOL, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanDeviceServiceCommand( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + pDeviceServiceGuid: LPGUID, + dwOpCode: DWORD, + dwInBufferSize: DWORD, + pInBuffer: PVOID, + dwOutBufferSize: DWORD, + pOutBuffer: PVOID, + pdwBytesReturned: PDWORD, + ) -> DWORD; + pub fn WlanGetSupportedDeviceServices( + hClientHandle: HANDLE, + pInterfaceGuid: *const GUID, + ppDevSvcGuidList: *mut PWLAN_DEVICE_SERVICE_GUID_LIST, + ) -> DWORD; + pub fn WlanExtractPsdIEDataList( + hClientHandle: HANDLE, + dwIeDataSize: DWORD, + pRawIeData: PBYTE, + strFormat: LPCWSTR, + pReserved: PVOID, + ppPsdIEDataList: *mut PWLAN_RAW_DATA_LIST, + ) -> DWORD; + pub fn WlanReasonCodeToString( + dwReasonCode: DWORD, + dwBufferSize: DWORD, + pStringBuffer: PWCHAR, + pReserved: PVOID, + ) -> DWORD; + pub fn WlanAllocateMemory( + dwMemorySize: DWORD, + ) -> PVOID; + pub fn WlanFreeMemory( + pMemory: PVOID, + ); + pub fn WlanSetSecuritySettings( + hClientHandle: HANDLE, + SecurableObject: WLAN_SECURABLE_OBJECT, + strModifiedSDDL: LPCWSTR, + ) -> DWORD; + pub fn WlanGetSecuritySettings( + hClientHandle: HANDLE, + SecurableObject: WLAN_SECURABLE_OBJECT, + pValueType: PWLAN_OPCODE_VALUE_TYPE, + pstrCurrentSDDL: *mut LPWSTR, + pdwGrantedAccess: PDWORD, + ) -> DWORD; +} +pub const WLAN_UI_API_VERSION: DWORD = 1; +pub const WLAN_UI_API_INITIAL_VERSION: DWORD = 1; +ENUM!{enum WL_DISPLAY_PAGES { + WLConnectionPage = 0, + WLSecurityPage = 1, + WLAdvPage = 2, +}} +pub type PWL_DISPLAY_PAGES = *mut WL_DISPLAY_PAGES; +extern "system" { + pub fn WlanUIEditProfile( + dwClientVersion: DWORD, + wstrProfileName: LPCWSTR, + pInterfaceGuid: *mut GUID, + hWnd: HWND, + wlStartPage: WL_DISPLAY_PAGES, + pReserved: PVOID, + pWlanReasonCode: PWLAN_REASON_CODE, + ) -> DWORD; +} +ENUM!{enum WLAN_HOSTED_NETWORK_STATE { + wlan_hosted_network_unavailable = 0, + wlan_hosted_network_idle = 1, + wlan_hosted_network_active = 2, +}} +pub type PWLAN_HOSTED_NETWORK_STATE = *mut WLAN_HOSTED_NETWORK_STATE; +ENUM!{enum WLAN_HOSTED_NETWORK_REASON { + wlan_hosted_network_reason_success = 0, + wlan_hosted_network_reason_unspecified = 1, + wlan_hosted_network_reason_bad_parameters = 2, + wlan_hosted_network_reason_service_shutting_down = 3, + wlan_hosted_network_reason_insufficient_resources = 4, + wlan_hosted_network_reason_elevation_required = 5, + wlan_hosted_network_reason_read_only = 6, + wlan_hosted_network_reason_persistence_failed = 7, + wlan_hosted_network_reason_crypt_error = 8, + wlan_hosted_network_reason_impersonation = 9, + wlan_hosted_network_reason_stop_before_start = 10, + wlan_hosted_network_reason_interface_available = 11, + wlan_hosted_network_reason_interface_unavailable = 12, + wlan_hosted_network_reason_miniport_stopped = 13, + wlan_hosted_network_reason_miniport_started = 14, + wlan_hosted_network_reason_incompatible_connection_started = 15, + wlan_hosted_network_reason_incompatible_connection_stopped = 16, + wlan_hosted_network_reason_user_action = 17, + wlan_hosted_network_reason_client_abort = 18, + wlan_hosted_network_reason_ap_start_failed = 19, + wlan_hosted_network_reason_peer_arrived = 20, + wlan_hosted_network_reason_peer_departed = 21, + wlan_hosted_network_reason_peer_timeout = 22, + wlan_hosted_network_reason_gp_denied = 23, + wlan_hosted_network_reason_service_unavailable = 24, + wlan_hosted_network_reason_device_change = 25, + wlan_hosted_network_reason_properties_change = 26, + wlan_hosted_network_reason_virtual_station_blocking_use = 27, + wlan_hosted_network_reason_service_available_on_virtual_station = 28, +}} +pub type PWLAN_HOSTED_NETWORK_REASON = *mut WLAN_HOSTED_NETWORK_REASON; +ENUM!{enum WLAN_HOSTED_NETWORK_PEER_AUTH_STATE { + wlan_hosted_network_peer_state_invalid = 0, + wlan_hosted_network_peer_state_authenticated = 1, +}} +pub type PWLAN_HOSTED_NETWORK_PEER_AUTH_STATE = *mut WLAN_HOSTED_NETWORK_PEER_AUTH_STATE; +extern "system" { + pub fn WlanHostedNetworkStartUsing( + hClientHandle: HANDLE, + pFailReason: PWLAN_HOSTED_NETWORK_REASON, + pvReserved: PVOID, + ) -> DWORD; + pub fn WlanHostedNetworkStopUsing( + hClientHandle: HANDLE, + pFailReason: PWLAN_HOSTED_NETWORK_REASON, + pvReserved: PVOID, + ) -> DWORD; + pub fn WlanHostedNetworkForceStart( + hClientHandle: HANDLE, + pFailReason: PWLAN_HOSTED_NETWORK_REASON, + pvReserved: PVOID, + ) -> DWORD; + pub fn WlanHostedNetworkForceStop( + hClientHandle: HANDLE, + pFailReason: PWLAN_HOSTED_NETWORK_REASON, + pvReserved: PVOID, + ) -> DWORD; +} +STRUCT!{struct WLAN_HOSTED_NETWORK_PEER_STATE { + PeerMacAddress: DOT11_MAC_ADDRESS, + PeerAuthState: WLAN_HOSTED_NETWORK_PEER_AUTH_STATE, +}} +pub type PWLAN_HOSTED_NETWORK_PEER_STATE = *mut WLAN_HOSTED_NETWORK_PEER_STATE; +STRUCT!{struct WLAN_HOSTED_NETWORK_RADIO_STATE { + dot11SoftwareRadioState: DOT11_RADIO_STATE, + dot11HardwareRadioState: DOT11_RADIO_STATE, +}} +pub type PWLAN_HOSTED_NETWORK_RADIO_STATE = *mut WLAN_HOSTED_NETWORK_RADIO_STATE; +ENUM!{enum WLAN_HOSTED_NETWORK_NOTIFICATION_CODE { + wlan_hosted_network_state_change = L2_NOTIFICATION_CODE_V2_BEGIN, + wlan_hosted_network_peer_state_change = 4097, + wlan_hosted_network_radio_state_change = 4098, +}} +pub type PWLAN_HOSTED_NETWORK_NOTIFICATION_CODE = *mut WLAN_HOSTED_NETWORK_NOTIFICATION_CODE; +STRUCT!{struct WLAN_HOSTED_NETWORK_STATE_CHANGE { + OldState: WLAN_HOSTED_NETWORK_STATE, + NewState: WLAN_HOSTED_NETWORK_STATE, + StateChangeReason: WLAN_HOSTED_NETWORK_REASON, +}} +pub type PWLAN_HOSTED_NETWORK_STATE_CHANGE = *mut WLAN_HOSTED_NETWORK_STATE_CHANGE; +STRUCT!{struct WLAN_HOSTED_NETWORK_DATA_PEER_STATE_CHANGE { + OldState: WLAN_HOSTED_NETWORK_PEER_STATE, + NewState: WLAN_HOSTED_NETWORK_PEER_STATE, + PeerStateChangeReason: WLAN_HOSTED_NETWORK_REASON, +}} +pub type PWLAN_HOSTED_NETWORK_DATA_PEER_STATE_CHANGE = + *mut WLAN_HOSTED_NETWORK_DATA_PEER_STATE_CHANGE; +ENUM!{enum WLAN_HOSTED_NETWORK_OPCODE { + wlan_hosted_network_opcode_connection_settings = 0, + wlan_hosted_network_opcode_security_settings = 1, + wlan_hosted_network_opcode_station_profile = 2, + wlan_hosted_network_opcode_enable = 3, +}} +pub type PWLAN_HOSTED_NETWORK_OPCODE = *mut WLAN_HOSTED_NETWORK_OPCODE; +STRUCT!{struct WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS { + hostedNetworkSSID: DOT11_SSID, + dwMaxNumberOfPeers: DWORD, +}} +pub type PWLAN_HOSTED_NETWORK_CONNECTION_SETTINGS = *mut WLAN_HOSTED_NETWORK_CONNECTION_SETTINGS; +STRUCT!{struct WLAN_HOSTED_NETWORK_SECURITY_SETTINGS { + dot11AuthAlgo: DOT11_AUTH_ALGORITHM, + dot11CipherAlgo: DOT11_CIPHER_ALGORITHM, +}} +pub type PWLAN_HOSTED_NETWORK_SECURITY_SETTINGS = *mut WLAN_HOSTED_NETWORK_SECURITY_SETTINGS; +extern "system" { + pub fn WlanHostedNetworkQueryProperty( + hClientHandle: HANDLE, + OpCode: WLAN_HOSTED_NETWORK_OPCODE, + pdwDataSize: PDWORD, + ppvData: *mut PVOID, + pWlanOpcodeValueType: PWLAN_OPCODE_VALUE_TYPE, + pvReserved: PVOID, + ) -> DWORD; + pub fn WlanHostedNetworkSetProperty( + hClientHandle: HANDLE, + OpCode: WLAN_HOSTED_NETWORK_OPCODE, + dwDataSize: DWORD, + pvData: PVOID, + pFailReason: PWLAN_HOSTED_NETWORK_REASON, + pvReserved: PVOID, + ) -> DWORD; + pub fn WlanHostedNetworkInitSettings( + hClientHandle: HANDLE, + pFailReason: PWLAN_HOSTED_NETWORK_REASON, + pvReserved: PVOID, + ) -> DWORD; + pub fn WlanHostedNetworkRefreshSecuritySettings( + hClientHandle: HANDLE, + pFailReason: PWLAN_HOSTED_NETWORK_REASON, + pvReserved: PVOID, + ) -> DWORD; +} +STRUCT!{struct WLAN_HOSTED_NETWORK_STATUS { + HostedNetworkState: WLAN_HOSTED_NETWORK_STATE, + IPDeviceID: GUID, + wlanHostedNetworkBSSID: DOT11_MAC_ADDRESS, + dot11PhyType: DOT11_PHY_TYPE, + ulChannelFrequency: ULONG, + dwNumberOfPeers: DWORD, + PeerList: [WLAN_HOSTED_NETWORK_PEER_STATE; 1], +}} +pub type PWLAN_HOSTED_NETWORK_STATUS = *mut WLAN_HOSTED_NETWORK_STATUS; +extern "system" { + pub fn WlanHostedNetworkQueryStatus( + hClientHandle: HANDLE, + ppWlanHostedNetworkStatus: *mut PWLAN_HOSTED_NETWORK_STATUS, + pvReserved: PVOID, + ) -> DWORD; + pub fn WlanHostedNetworkSetSecondaryKey( + hClientHandle: HANDLE, + dwKeyLength: DWORD, + pucKeyData: PUCHAR, + bIsPassPhrase: BOOL, + bPersistent: BOOL, + pFailReason: PWLAN_HOSTED_NETWORK_REASON, + pvReserved: PVOID, + ) -> DWORD; + pub fn WlanHostedNetworkQuerySecondaryKey( + hClientHandle: HANDLE, + pdwKeyLength: PDWORD, + ppucKeyData: *mut PUCHAR, + pbIsPassPhrase: PBOOL, + pbPersistent: PBOOL, + pFailReason: PWLAN_HOSTED_NETWORK_REASON, + pvReserved: PVOID, + ) -> DWORD; + pub fn WlanRegisterVirtualStationNotification( + hClientHandle: HANDLE, + bRegister: BOOL, + pReserved: PVOID, + ) -> DWORD; +} +DEFINE_GUID!{GUID_DEVINTERFACE_WIFIDIRECT_DEVICE, + 0x439b20af, 0x8955, 0x405b, 0x99, 0xf0, 0xa6, 0x2a, 0xf0, 0xc6, 0x8d, 0x43} +DEFINE_GUID!{GUID_AEPSERVICE_WIFIDIRECT_DEVICE, + 0xcc29827c, 0x9caf, 0x4928, 0x99, 0xa9, 0x18, 0xf7, 0xc2, 0x38, 0x13, 0x89} +DEFINE_GUID!{GUID_DEVINTERFACE_ASP_INFRA_DEVICE, + 0xff823995, 0x7a72, 0x4c80, 0x87, 0x57, 0xc6, 0x7e, 0xe1, 0x3d, 0x1a, 0x49} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_DeviceAddress, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x01} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_InterfaceAddress, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x02} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_InterfaceGuid, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x03} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_GroupId, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x04} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_IsConnected, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x05} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_IsVisible, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x06} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_IsLegacyDevice, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x07} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_MiracastVersion, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x08} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_IsMiracastLCPSupported, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x09} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_Services, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x0a} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_SupportedChannelList, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x0b} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_InformationElements, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x0c} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_DeviceAddressCopy, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x0d} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_IsRecentlyAssociated, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x0e} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_Service_Aeps, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x0f} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_NoMiracastAutoProject, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x10} +DEFINE_DEVPROPKEY!{DEVPKEY_InfraCast_Supported, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x11} +DEFINE_DEVPROPKEY!{DEVPKEY_InfraCast_StreamSecuritySupported, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x12} +DEFINE_DEVPROPKEY!{DEVPKEY_InfraCast_AccessPointBssid, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x13} +DEFINE_DEVPROPKEY!{DEVPKEY_InfraCast_SinkHostName, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x14} +DEFINE_DEVPROPKEY!{DEVPKEY_InfraCast_ChallengeAep, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x15} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_IsDMGCapable, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x16} +DEFINE_DEVPROPKEY!{DEVPKEY_InfraCast_DevnodeAep, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x17} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_FoundWsbService, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x18} +DEFINE_DEVPROPKEY!{DEVPKEY_InfraCast_HostName_ResolutionMode, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x19} +DEFINE_DEVPROPKEY!{DEVPKEY_InfraCast_SinkIpAddress, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x1a} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirect_TransientAssociation, + 0x1506935d, 0xe3e7, 0x450f, 0x86, 0x37, 0x82, 0x23, 0x3e, 0xbe, 0x5f, 0x6e, 0x1b} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirectServices_ServiceAddress, + 0x31b37743, 0x7c5e, 0x4005, 0x93, 0xe6, 0xe9, 0x53, 0xf9, 0x2b, 0x82, 0xe9, 0x02} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirectServices_ServiceName, + 0x31b37743, 0x7c5e, 0x4005, 0x93, 0xe6, 0xe9, 0x53, 0xf9, 0x2b, 0x82, 0xe9, 0x03} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirectServices_ServiceInformation, + 0x31b37743, 0x7c5e, 0x4005, 0x93, 0xe6, 0xe9, 0x53, 0xf9, 0x2b, 0x82, 0xe9, 0x04} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirectServices_AdvertisementId, + 0x31b37743, 0x7c5e, 0x4005, 0x93, 0xe6, 0xe9, 0x53, 0xf9, 0x2b, 0x82, 0xe9, 0x05} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirectServices_ServiceConfigMethods, + 0x31b37743, 0x7c5e, 0x4005, 0x93, 0xe6, 0xe9, 0x53, 0xf9, 0x2b, 0x82, 0xe9, 0x06} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFiDirectServices_RequestServiceInformation, + 0x31b37743, 0x7c5e, 0x4005, 0x93, 0xe6, 0xe9, 0x53, 0xf9, 0x2b, 0x82, 0xe9, 0x07} +extern "system" { + pub fn WFDOpenHandle( + dwClientVersion: DWORD, + pdwNegotiatedVersion: PDWORD, + phClientHandle: PHANDLE, + ) -> DWORD; + pub fn WFDCloseHandle( + hClientHandle: HANDLE, + ) -> DWORD; +} +FN!{stdcall WFD_OPEN_SESSION_COMPLETE_CALLBACK( + hSessionHandle: HANDLE, + pvContext: PVOID, + guidSessionInterface: GUID, + dwError: DWORD, + dwReasonCode: DWORD, +) -> ()} +extern "system" { + pub fn WFDStartOpenSession( + hClientHandle: HANDLE, + pDeviceAddress: PDOT11_MAC_ADDRESS, + pvContext: PVOID, + pfnCallback: WFD_OPEN_SESSION_COMPLETE_CALLBACK, + phSessionHandle: PHANDLE, + ) -> DWORD; + pub fn WFDCancelOpenSession( + hSessionHandle: HANDLE, + ) -> DWORD; + pub fn WFDOpenLegacySession( + hClientHandle: HANDLE, + pLegacyMacAddress: PDOT11_MAC_ADDRESS, + phSessionHandle: *mut HANDLE, + pGuidSessionInterface: *mut GUID, + ) -> DWORD; + pub fn WFDCloseSession( + hSessionHandle: HANDLE, + ) -> DWORD; + pub fn WFDUpdateDeviceVisibility( + pDeviceAddress: PDOT11_MAC_ADDRESS, + ) -> DWORD; +} +DEFINE_DEVPROPKEY!{DEVPKEY_WiFi_InterfaceGuid, + 0xef1167eb, 0xcbfc, 0x4341, 0xa5, 0x68, 0xa7, 0xc9, 0x1a, 0x68, 0x98, 0x2c, 0x02} diff --git a/bash-5.1/vendor/winapi/src/um/wlanihv.rs b/bash-5.1/vendor/winapi/src/um/wlanihv.rs new file mode 100644 index 0000000000000000000000000000000000000000..e2fa8fb173a7c77abcb9463f9766fb26005d01fb --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wlanihv.rs @@ -0,0 +1,410 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Definition of public APIs for WLAN Extensibility Framework. +use shared::basetsd::UINT32; +use shared::guiddef::{CLSID, GUID}; +use shared::minwindef::{BOOL, BYTE, DWORD, LPVOID, PBOOL, PBYTE, PDWORD, UCHAR, ULONG, USHORT}; +use shared::windot11::{ + DOT11_ASSOC_STATUS, DOT11_DIRECTION, PDOT11_ASSOCIATION_COMPLETION_PARAMETERS, + PDOT11_CIPHER_DEFAULT_KEY_VALUE, PDOT11_CIPHER_KEY_MAPPING_KEY_VALUE, PDOT11_MAC_ADDRESS, + PDOT11_PRIVACY_EXEMPTION, +}; +use shared::wlantypes::{DOT11_AUTH_ALGORITHM, DOT11_BSS_TYPE, DOT11_CIPHER_ALGORITHM, DOT11_SSID}; +use um::dot1x::{ONEX_AUTH_STATUS, ONEX_REASON_CODE}; +use um::eaptypes::EAP_ATTRIBUTES; +use um::l2cmn::PL2_NOTIFICATION_DATA; +use um::winnt::{HANDLE, LPWSTR, PHANDLE, WCHAR}; +use um::winuser::PWTSSESSION_NOTIFICATION; +use um::wlanihvtypes::{MS_MAX_PROFILE_NAME_LENGTH, PDOT11EXT_IHV_PROFILE_PARAMS}; +use um::wlclient::{PDOT11_ADAPTER, PDOT11_BSS_LIST, PDOT11_PORT_STATE}; +STRUCT!{struct DOT11EXT_APIS { + Dot11ExtAllocateBuffer: DOT11EXT_ALLOCATE_BUFFER, + Dot11ExtFreeBuffer: DOT11EXT_FREE_BUFFER, + Dot11ExtSetProfileCustomUserData: DOT11EXT_SET_PROFILE_CUSTOM_USER_DATA, + Dot11ExtGetProfileCustomUserData: DOT11EXT_GET_PROFILE_CUSTOM_USER_DATA, + Dot11ExtSetCurrentProfile: DOT11EXT_SET_CURRENT_PROFILE, + Dot11ExtSendUIRequest: DOT11EXT_SEND_UI_REQUEST, + Dot11ExtPreAssociateCompletion: DOT11EXT_PRE_ASSOCIATE_COMPLETION, + Dot11ExtPostAssociateCompletion: DOT11EXT_POST_ASSOCIATE_COMPLETION, + Dot11ExtSendNotification: DOT11EXT_SEND_NOTIFICATION, + Dot11ExtSendPacket: DOT11EXT_SEND_PACKET, + Dot11ExtSetEtherTypeHandling: DOT11EXT_SET_ETHERTYPE_HANDLING, + Dot11ExtSetAuthAlgorithm: DOT11EXT_SET_AUTH_ALGORITHM, + Dot11ExtSetUnicastCipherAlgorithm: DOT11EXT_SET_UNICAST_CIPHER_ALGORITHM, + Dot11ExtSetMulticastCipherAlgorithm: DOT11EXT_SET_MULTICAST_CIPHER_ALGORITHM, + Dot11ExtSetDefaultKey: DOT11EXT_SET_DEFAULT_KEY, + Dot11ExtSetKeyMappingKey: DOT11EXT_SET_KEY_MAPPING_KEY, + Dot11ExtSetDefaultKeyId: DOT11EXT_SET_DEFAULT_KEY_ID, + Dot11ExtNicSpecificExtension: DOT11EXT_NIC_SPECIFIC_EXTENSION, + Dot11ExtSetExcludeUnencrypted: DOT11EXT_SET_EXCLUDE_UNENCRYPTED, + Dot11ExtStartOneX: DOT11EXT_ONEX_START, + Dot11ExtStopOneX: DOT11EXT_ONEX_STOP, + Dot11ExtProcessSecurityPacket: DOT11EXT_PROCESS_ONEX_PACKET, +}} +pub type PDOT11EXT_APIS = *mut DOT11EXT_APIS; +STRUCT!{struct DOT11EXT_IHV_HANDLERS { + Dot11ExtIhvDeinitService: DOT11EXTIHV_DEINIT_SERVICE, + Dot11ExtIhvInitAdapter: DOT11EXTIHV_INIT_ADAPTER, + Dot11ExtIhvDeinitAdapter: DOT11EXTIHV_DEINIT_ADAPTER, + Dot11ExtIhvPerformPreAssociate: DOT11EXTIHV_PERFORM_PRE_ASSOCIATE, + Dot11ExtIhvAdapterReset: DOT11EXTIHV_ADAPTER_RESET, + Dot11ExtIhvPerformPostAssociate: DOT11EXTIHV_PERFORM_POST_ASSOCIATE, + Dot11ExtIhvStopPostAssociate: DOT11EXTIHV_STOP_POST_ASSOCIATE, + Dot11ExtIhvValidateProfile: DOT11EXTIHV_VALIDATE_PROFILE, + Dot11ExtIhvPerformCapabilityMatch: DOT11EXTIHV_PERFORM_CAPABILITY_MATCH, + Dot11ExtIhvCreateDiscoveryProfiles: DOT11EXTIHV_CREATE_DISCOVERY_PROFILES, + Dot11ExtIhvProcessSessionChange: DOT11EXTIHV_PROCESS_SESSION_CHANGE, + Dot11ExtIhvReceiveIndication: DOT11EXTIHV_RECEIVE_INDICATION, + Dot11ExtIhvReceivePacket: DOT11EXTIHV_RECEIVE_PACKET, + Dot11ExtIhvSendPacketCompletion: DOT11EXTIHV_SEND_PACKET_COMPLETION, + Dot11ExtIhvIsUIRequestPending: DOT11EXTIHV_IS_UI_REQUEST_PENDING, + Dot11ExtIhvProcessUIResponse: DOT11EXTIHV_PROCESS_UI_RESPONSE, + Dot11ExtIhvQueryUIRequest: DOT11EXTIHV_QUERY_UI_REQUEST, + Dot11ExtIhvOnexIndicateResult: DOT11EXTIHV_ONEX_INDICATE_RESULT, + Dot11ExtIhvControl: DOT11EXTIHV_CONTROL, +}} +pub type PDOT11EXT_IHV_HANDLERS = *mut DOT11EXT_IHV_HANDLERS; +STRUCT!{struct DOT11EXT_VIRTUAL_STATION_APIS { + Dot11ExtRequestVirtualStation: DOT11EXT_REQUEST_VIRTUAL_STATION, + Dot11ExtReleaseVirtualStation: DOT11EXT_RELEASE_VIRTUAL_STATION, + Dot11ExtQueryVirtualStationProperties: DOT11EXT_QUERY_VIRTUAL_STATION_PROPERTIES, + Dot11ExtSetVirtualStationAPProperties: DOT11EXT_SET_VIRTUAL_STATION_AP_PROPERTIES, +}} +pub type PDOT11EXT_VIRTUAL_STATION_APIS = *mut DOT11EXT_VIRTUAL_STATION_APIS; +STRUCT!{struct DOT11_IHV_VERSION_INFO { + dwVerMin: DWORD, + dwVerMax: DWORD, +}} +pub type PDOT11_IHV_VERSION_INFO = *mut DOT11_IHV_VERSION_INFO; +ENUM!{enum DOT11EXT_IHV_CONNECTION_PHASE { + connection_phase_any = 0, + connection_phase_initial_connection = 1, + connection_phase_post_l3_connection = 2, +}} +pub type PDOT11EXT_IHV_CONNECTION_PHASE = *mut DOT11EXT_IHV_CONNECTION_PHASE; +STRUCT!{struct DOT11EXT_IHV_UI_REQUEST { + dwSessionId: DWORD, + guidUIRequest: GUID, + UIPageClsid: CLSID, + dwByteCount: DWORD, + pvUIRequest: *mut BYTE, +}} +pub type PDOT11EXT_IHV_UI_REQUEST = *mut DOT11EXT_IHV_UI_REQUEST; +ENUM!{enum DOT11_MSONEX_RESULT { + DOT11_MSONEX_SUCCESS = 0, + DOT11_MSONEX_FAILURE = 1, + DOT11_MSONEX_IN_PROGRESS = 2, +}} +pub type PDOT11_MSONEX_RESULT = *mut DOT11_MSONEX_RESULT; +STRUCT!{struct DOT11_EAP_RESULT { + dwFailureReasonCode: UINT32, + pAttribArray: *mut EAP_ATTRIBUTES, +}} +pub type PDOT11_EAP_RESULT = *mut DOT11_EAP_RESULT; +STRUCT!{struct DOT11_MSONEX_RESULT_PARAMS { + Dot11OnexAuthStatus: ONEX_AUTH_STATUS, + Dot11OneXReasonCode: ONEX_REASON_CODE, + pbMPPESendKey: PBYTE, + dwMPPESendKeyLen: DWORD, + pbMPPERecvKey: PBYTE, + dwMPPERecvKeyLen: DWORD, + pDot11EapResult: PDOT11_EAP_RESULT, +}} +pub type PDOT11_MSONEX_RESULT_PARAMS = *mut DOT11_MSONEX_RESULT_PARAMS; +STRUCT!{struct DOT11EXT_IHV_CONNECTIVITY_PROFILE { + pszXmlFragmentIhvConnectivity: LPWSTR, +}} +pub type PDOT11EXT_IHV_CONNECTIVITY_PROFILE = *mut DOT11EXT_IHV_CONNECTIVITY_PROFILE; +STRUCT!{struct DOT11EXT_IHV_SECURITY_PROFILE { + pszXmlFragmentIhvSecurity: LPWSTR, + bUseMSOnex: BOOL, +}} +pub type PDOT11EXT_IHV_SECURITY_PROFILE = *mut DOT11EXT_IHV_SECURITY_PROFILE; +STRUCT!{struct DOT11EXT_IHV_DISCOVERY_PROFILE { + IhvConnectivityProfile: DOT11EXT_IHV_CONNECTIVITY_PROFILE, + IhvSecurityProfile: DOT11EXT_IHV_SECURITY_PROFILE, +}} +pub type PDOT11EXT_IHV_DISCOVERY_PROFILE = *mut DOT11EXT_IHV_DISCOVERY_PROFILE; +STRUCT!{struct DOT11EXT_IHV_DISCOVERY_PROFILE_LIST { + dwCount: DWORD, + pIhvDiscoveryProfiles: PDOT11EXT_IHV_DISCOVERY_PROFILE, +}} +pub type PDOT11EXT_IHV_DISCOVERY_PROFILE_LIST = *mut DOT11EXT_IHV_DISCOVERY_PROFILE_LIST; +ENUM!{enum DOT11EXT_IHV_INDICATION_TYPE { + IndicationTypeNicSpecificNotification = 0, + IndicationTypePmkidCandidateList = 1, + IndicationTypeTkipMicFailure = 2, + IndicationTypePhyStateChange = 3, + IndicationTypeLinkQuality = 4, +}} +pub type PDOT11EXT_IHV_INDICATION_TYPE = *mut DOT11EXT_IHV_INDICATION_TYPE; +pub const DOT11EXT_PSK_MAX_LENGTH: usize = 64; +STRUCT!{struct DOT11EXT_VIRTUAL_STATION_AP_PROPERTY { + dot11SSID: DOT11_SSID, + dot11AuthAlgo: DOT11_AUTH_ALGORITHM, + dot11CipherAlgo: DOT11_CIPHER_ALGORITHM, + bIsPassPhrase: BOOL, + dwKeyLength: DWORD, + ucKeyData: [UCHAR; DOT11EXT_PSK_MAX_LENGTH], +}} +pub type PDOT11EXT_VIRTUAL_STATION_AP_PROPERTY = *mut DOT11EXT_VIRTUAL_STATION_AP_PROPERTY; +pub const WDIAG_IHV_WLAN_ID_FLAG_SECURITY_ENABLED: DWORD = 0x00000001; +STRUCT!{struct WDIAG_IHV_WLAN_ID { + strProfileName: [WCHAR; MS_MAX_PROFILE_NAME_LENGTH], + Ssid: DOT11_SSID, + BssType: DOT11_BSS_TYPE, + dwFlags: DWORD, + dwReasonCode: DWORD, +}} +pub type PWDIAG_IHV_WLAN_ID = *mut WDIAG_IHV_WLAN_ID; +FN!{stdcall DOT11EXT_ALLOCATE_BUFFER( + dwByteCount: DWORD, + ppvBuffer: *mut LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXT_FREE_BUFFER( + pvMemory: LPVOID, +) -> ()} +FN!{stdcall DOT11EXT_SET_PROFILE_CUSTOM_USER_DATA( + hDot11SvcHandle: HANDLE, + hConnectSession: HANDLE, + dwSessionID: DWORD, + dwDataSize: DWORD, + pvData: LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXT_GET_PROFILE_CUSTOM_USER_DATA( + hDot11SvcHandle: HANDLE, + hConnectSession: HANDLE, + dwSessionID: DWORD, + pdwDataSize: *mut DWORD, + ppvData: *mut LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXT_SET_CURRENT_PROFILE( + hDot11SvcHandle: HANDLE, + hConnectSession: HANDLE, + pIhvConnProfile: PDOT11EXT_IHV_CONNECTIVITY_PROFILE, + pIhvSecProfile: PDOT11EXT_IHV_SECURITY_PROFILE, +) -> DWORD} +FN!{stdcall DOT11EXT_SEND_UI_REQUEST( + hDot11SvcHandle: HANDLE, + pIhvUIRequest: PDOT11EXT_IHV_UI_REQUEST, +) -> DWORD} +FN!{stdcall DOT11EXT_PRE_ASSOCIATE_COMPLETION( + hDot11SvcHandle: HANDLE, + hConnectSession: HANDLE, + dwReasonCode: DWORD, + dwWin32Error: DWORD, +) -> DWORD} +FN!{stdcall DOT11EXT_POST_ASSOCIATE_COMPLETION( + hDot11SvcHandle: HANDLE, + hSecuritySessionID: HANDLE, + pPeer: PDOT11_MAC_ADDRESS, + dwReasonCode: DWORD, + dwWin32Error: DWORD, +) -> DWORD} +FN!{stdcall DOT11EXT_SEND_NOTIFICATION( + hDot11SvcHandle: HANDLE, + pNotificationData: PL2_NOTIFICATION_DATA, +) -> DWORD} +FN!{stdcall DOT11EXT_SEND_PACKET( + hDot11SvcHandle: HANDLE, + uPacketLen: ULONG, + pvPacket: LPVOID, + hSendCompletion: HANDLE, +) -> DWORD} +FN!{stdcall DOT11EXT_SET_ETHERTYPE_HANDLING( + hDot11SvcHandle: HANDLE, + uMaxBackLog: ULONG, + uNumOfExemption: ULONG, + pExemption: PDOT11_PRIVACY_EXEMPTION, + uNumOfRegistration: ULONG, + pusRegistration: *mut USHORT, +) -> DWORD} +FN!{stdcall DOT11EXT_SET_AUTH_ALGORITHM( + hDot11SvcHandle: HANDLE, + dwAuthAlgo: DWORD, +) -> DWORD} +FN!{stdcall DOT11EXT_SET_UNICAST_CIPHER_ALGORITHM( + hDot11SvcHandle: HANDLE, + dwUnicastCipherAlgo: DWORD, +) -> DWORD} +FN!{stdcall DOT11EXT_SET_MULTICAST_CIPHER_ALGORITHM( + hDot11SvcHandle: HANDLE, + dwMulticastCipherAlgo: DWORD, +) -> DWORD} +FN!{stdcall DOT11EXT_SET_DEFAULT_KEY( + hDot11SvcHandle: HANDLE, + pKey: PDOT11_CIPHER_DEFAULT_KEY_VALUE, + dot11Direction: DOT11_DIRECTION, +) -> DWORD} +FN!{stdcall DOT11EXT_SET_KEY_MAPPING_KEY( + hDot11SvcHandle: HANDLE, + pKey: PDOT11_CIPHER_KEY_MAPPING_KEY_VALUE, +) -> DWORD} +FN!{stdcall DOT11EXT_SET_DEFAULT_KEY_ID( + hDot11SvcHandle: HANDLE, + uDefaultKeyId: ULONG, +) -> DWORD} +FN!{stdcall DOT11EXT_SET_EXCLUDE_UNENCRYPTED( + hDot11SvcHandle: HANDLE, + bExcludeUnencrypted: BOOL, +) -> DWORD} +FN!{stdcall DOT11EXT_NIC_SPECIFIC_EXTENSION( + hDot11SvcHandle: HANDLE, + dwInBufferSize: DWORD, + pvInBuffer: LPVOID, + pdwOutBufferSize: *mut DWORD, + pvOutBuffer: LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXT_ONEX_START( + hDot11SvcHandle: HANDLE, + pEapAttributes: *mut EAP_ATTRIBUTES, +) -> DWORD} +FN!{stdcall DOT11EXT_ONEX_STOP( + hDot11SvcHandle: HANDLE, +) -> DWORD} +FN!{stdcall DOT11EXT_PROCESS_ONEX_PACKET( + hDot11SvcHandle: HANDLE, + dwInPacketSize: DWORD, + pvInPacket: LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXT_REQUEST_VIRTUAL_STATION( + hDot11PrimaryHandle: HANDLE, + pvReserved: LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXT_RELEASE_VIRTUAL_STATION( + hDot11PrimaryHandle: HANDLE, + pvReserved: LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXT_QUERY_VIRTUAL_STATION_PROPERTIES( + hDot11SvcHandle: HANDLE, + pbIsVirtualStation: *mut BOOL, + pgPrimary: *mut GUID, + pvReserved: LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXT_SET_VIRTUAL_STATION_AP_PROPERTIES( + hDot11SvcHandle: HANDLE, + hConnectSession: HANDLE, + dwNumProperties: DWORD, + pProperties: PDOT11EXT_VIRTUAL_STATION_AP_PROPERTY, + pvReserved: LPVOID, +) -> DWORD} +pub const IHV_VERSION_FUNCTION_NAME: &'static str = "Dot11ExtIhvGetVersionInfo"; +pub const IHV_INIT_FUNCTION_NAME: &'static str = "Dot11ExtIhvInitService"; +pub const IHV_INIT_VS_FUNCTION_NAME: &'static str = "Dot11ExtIhvInitVirtualStation"; +FN!{stdcall DOT11EXTIHV_GET_VERSION_INFO( + pDot11IHVVersionInfo: PDOT11_IHV_VERSION_INFO, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_INIT_SERVICE( + dwVerNumUsed: DWORD, + pDot11ExtAPI: PDOT11EXT_APIS, + pvReserved: LPVOID, + pDot11IHVHandlers: PDOT11EXT_IHV_HANDLERS, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_INIT_VIRTUAL_STATION( + pDot11ExtVSAPI: PDOT11EXT_VIRTUAL_STATION_APIS, + pvReserved: LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_DEINIT_SERVICE() -> ()} +FN!{stdcall DOT11EXTIHV_INIT_ADAPTER( + pDot11Adapter: PDOT11_ADAPTER, + hDot11SvcHandle: HANDLE, + phIhvExtAdapter: PHANDLE, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_DEINIT_ADAPTER( + hIhvExtAdapter: HANDLE, +) -> ()} +FN!{stdcall DOT11EXTIHV_PERFORM_PRE_ASSOCIATE( + hIhvExtAdapter: HANDLE, + hConnectSession: HANDLE, + pIhvProfileParams: PDOT11EXT_IHV_PROFILE_PARAMS, + pIhvConnProfile: PDOT11EXT_IHV_CONNECTIVITY_PROFILE, + pIhvSecProfile: PDOT11EXT_IHV_SECURITY_PROFILE, + pConnectableBssid: PDOT11_BSS_LIST, + pdwReasonCode: PDWORD, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_ADAPTER_RESET( + hIhvExtAdapter: HANDLE, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_PERFORM_POST_ASSOCIATE( + hIhvExtAdapter: HANDLE, + hSecuritySessionID: HANDLE, + pPortState: PDOT11_PORT_STATE, + uDot11AssocParamsBytes: ULONG, + pDot11AssocParams: PDOT11_ASSOCIATION_COMPLETION_PARAMETERS, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_STOP_POST_ASSOCIATE( + hIhvExtAdapter: HANDLE, + pPeer: PDOT11_MAC_ADDRESS, + dot11AssocStatus: DOT11_ASSOC_STATUS, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_VALIDATE_PROFILE( + hIhvExtAdapter: HANDLE, + pIhvProfileParams: PDOT11EXT_IHV_PROFILE_PARAMS, + pIhvConnProfile: PDOT11EXT_IHV_CONNECTIVITY_PROFILE, + pIhvSecProfile: PDOT11EXT_IHV_SECURITY_PROFILE, + pdwReasonCode: PDWORD, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_PERFORM_CAPABILITY_MATCH( + hIhvExtAdapter: HANDLE, + pIhvProfileParams: PDOT11EXT_IHV_PROFILE_PARAMS, + pIhvConnProfile: PDOT11EXT_IHV_CONNECTIVITY_PROFILE, + pIhvSecProfile: PDOT11EXT_IHV_SECURITY_PROFILE, + pConnectableBssid: PDOT11_BSS_LIST, + pdwReasonCode: PDWORD, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_CREATE_DISCOVERY_PROFILES( + hIhvExtAdapter: HANDLE, + bInsecure: BOOL, + pIhvProfileParams: PDOT11EXT_IHV_PROFILE_PARAMS, + pConnectableBssid: PDOT11_BSS_LIST, + pIhvDiscoveryProfileList: PDOT11EXT_IHV_DISCOVERY_PROFILE_LIST, + pdwReasonCode: PDWORD, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_PROCESS_SESSION_CHANGE( + uEventType: ULONG, + pSessionNotification: PWTSSESSION_NOTIFICATION, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_RECEIVE_INDICATION( + hIhvExtAdapter: HANDLE, + indicationType: DOT11EXT_IHV_INDICATION_TYPE, + uBufferLength: ULONG, + pvBuffer: LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_RECEIVE_PACKET( + hIhvExtAdapter: HANDLE, + dwInBufferSize: DWORD, + pvInBuffer: LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_SEND_PACKET_COMPLETION( + hSendCompletion: HANDLE, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_IS_UI_REQUEST_PENDING( + guidUIRequest: GUID, + pbIsRequestPending: PBOOL, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_PROCESS_UI_RESPONSE( + guidUIRequest: GUID, + dwByteCount: DWORD, + pvResponseBuffer: LPVOID, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_QUERY_UI_REQUEST( + hIhvExtAdapter: HANDLE, + connectionPhase: DOT11EXT_IHV_CONNECTION_PHASE, + ppIhvUIRequest: *mut PDOT11EXT_IHV_UI_REQUEST, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_ONEX_INDICATE_RESULT( + hIhvExtAdapter: HANDLE, + msOneXResult: DOT11_MSONEX_RESULT, + pDot11MsOneXResultParams: PDOT11_MSONEX_RESULT_PARAMS, +) -> DWORD} +FN!{stdcall DOT11EXTIHV_CONTROL( + hIhvExtAdapter: HANDLE, + dwInBufferSize: DWORD, + pInBuffer: PBYTE, + dwOutBufferSize: DWORD, + pOutBuffer: PBYTE, + pdwBytesReturned: PDWORD, +) -> DWORD} diff --git a/bash-5.1/vendor/winapi/src/um/wlanihvtypes.rs b/bash-5.1/vendor/winapi/src/um/wlanihvtypes.rs new file mode 100644 index 0000000000000000000000000000000000000000..d87d7b2393026f3bf9304c2194b00045a06d72ba --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wlanihvtypes.rs @@ -0,0 +1,41 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Structures used to hold information for IHV. +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, BYTE, DWORD, ULONG}; +use shared::wlantypes::{DOT11_AUTH_ALGORITHM, DOT11_BSS_TYPE, DOT11_CIPHER_ALGORITHM, DOT11_SSID}; +use um::eaptypes::EAP_METHOD_TYPE; +use um::winnt::WCHAR; +STRUCT!{struct DOT11_MSSECURITY_SETTINGS { + dot11AuthAlgorithm: DOT11_AUTH_ALGORITHM, + dot11CipherAlgorithm: DOT11_CIPHER_ALGORITHM, + fOneXEnabled: BOOL, + eapMethodType: EAP_METHOD_TYPE, + dwEapConnectionDataLen: DWORD, + pEapConnectionData: *mut BYTE, +}} +pub type PDOT11_MSSECURITY_SETTINGS = *mut DOT11_MSSECURITY_SETTINGS; +STRUCT!{struct DOT11EXT_IHV_SSID_LIST { + ulCount: ULONG, + SSIDs: [DOT11_SSID; 1], +}} +pub type PDOT11EXT_IHV_SSID_LIST = *mut DOT11EXT_IHV_SSID_LIST; +STRUCT!{struct DOT11EXT_IHV_PROFILE_PARAMS { + pSsidList: PDOT11EXT_IHV_SSID_LIST, + BssType: DOT11_BSS_TYPE, + pMSSecuritySettings: PDOT11_MSSECURITY_SETTINGS, +}} +pub type PDOT11EXT_IHV_PROFILE_PARAMS = *mut DOT11EXT_IHV_PROFILE_PARAMS; +pub const MS_MAX_PROFILE_NAME_LENGTH: usize = 256; +pub const MS_PROFILE_GROUP_POLICY: DWORD = 0x00000001; +pub const MS_PROFILE_USER: DWORD = 0x00000002; +STRUCT!{struct DOT11EXT_IHV_PARAMS { + dot11ExtIhvProfileParams: DOT11EXT_IHV_PROFILE_PARAMS, + wstrProfileName: [WCHAR; MS_MAX_PROFILE_NAME_LENGTH], + dwProfileTypeFlags: DWORD, + interfaceGuid: GUID, +}} +pub type PDOT11EXT_IHV_PARAMS = *mut DOT11EXT_IHV_PARAMS; diff --git a/bash-5.1/vendor/winapi/src/um/wlclient.rs b/bash-5.1/vendor/winapi/src/um/wlclient.rs new file mode 100644 index 0000000000000000000000000000000000000000..e8af8011985afabbaf5323c1037e5090236772ac --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wlclient.rs @@ -0,0 +1,33 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, PUCHAR, UCHAR, ULONG, USHORT}; +use shared::windot11::{DOT11_CURRENT_OPERATION_MODE, DOT11_MAC_ADDRESS}; +use um::winnt::LPWSTR; +STRUCT!{struct DOT11_ADAPTER { + gAdapterId: GUID, + pszDescription: LPWSTR, + Dot11CurrentOpMode: DOT11_CURRENT_OPERATION_MODE, +}} +pub type PDOT11_ADAPTER = *mut DOT11_ADAPTER; +STRUCT!{struct DOT11_BSS_LIST { + uNumOfBytes: ULONG, + pucBuffer: PUCHAR, +}} +pub type PDOT11_BSS_LIST = *mut DOT11_BSS_LIST; +STRUCT!{struct DOT11_PORT_STATE { + PeerMacAddress: DOT11_MAC_ADDRESS, + uSessionId: ULONG, + bPortControlled: BOOL, + bPortAuthorized: BOOL, +}} +pub type PDOT11_PORT_STATE = *mut DOT11_PORT_STATE; +STRUCT!{#[repr(packed)] struct DOT11_SECURITY_PACKET_HEADER { + PeerMac: DOT11_MAC_ADDRESS, + usEtherType: USHORT, + Data: [UCHAR; 1], +}} +pub type PDOT11_SECURITY_PACKET_HEADER = *mut DOT11_SECURITY_PACKET_HEADER; diff --git a/bash-5.1/vendor/winapi/src/um/wow64apiset.rs b/bash-5.1/vendor/winapi/src/um/wow64apiset.rs new file mode 100644 index 0000000000000000000000000000000000000000..90d4b724b962cf5cc6870af2f487dac5ad6cbce8 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wow64apiset.rs @@ -0,0 +1,32 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::minwindef::{BOOL, PBOOL, PUSHORT, UINT}; +use um::winnt::{HANDLE, LPSTR, LPWSTR, PVOID}; +extern "system" { + pub fn Wow64DisableWow64FsRedirection( + OldValue: *mut PVOID, + ) -> BOOL; + pub fn Wow64RevertWow64FsRedirection( + OlValue: PVOID, + ) -> BOOL; + pub fn IsWow64Process( + hProcess: HANDLE, + Wow64Process: PBOOL, + ) -> BOOL; + pub fn GetSystemWow64DirectoryA( + lpBuffer: LPSTR, + uSize: UINT, + ) -> UINT; + pub fn GetSystemWow64DirectoryW( + lpBuffer: LPWSTR, + uSize: UINT, + ) -> UINT; + pub fn IsWow64Process2( + hProcess: HANDLE, + pProcessMachine: PUSHORT, + pNativeMachine: PUSHORT, + ) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/wpdmtpextensions.rs b/bash-5.1/vendor/winapi/src/um/wpdmtpextensions.rs new file mode 100644 index 0000000000000000000000000000000000000000..7ff0b6dc7f6acd7a3913e4459c839b2757793d8e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wpdmtpextensions.rs @@ -0,0 +1,60 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::wtypes::PROPERTYKEY; +DEFINE_GUID!{WPD_CATEGORY_MTP_EXT_VENDOR_OPERATIONS, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56} +DEFINE_PROPERTYKEY!{WPD_COMMAND_MTP_EXT_GET_SUPPORTED_VENDOR_OPCODES, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 11} +DEFINE_PROPERTYKEY!{WPD_COMMAND_MTP_EXT_EXECUTE_COMMAND_WITHOUT_DATA_PHASE, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 12} +DEFINE_PROPERTYKEY!{WPD_COMMAND_MTP_EXT_EXECUTE_COMMAND_WITH_DATA_TO_READ, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 13} +DEFINE_PROPERTYKEY!{WPD_COMMAND_MTP_EXT_EXECUTE_COMMAND_WITH_DATA_TO_WRITE, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 14} +DEFINE_PROPERTYKEY!{WPD_COMMAND_MTP_EXT_READ_DATA, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 15} +DEFINE_PROPERTYKEY!{WPD_COMMAND_MTP_EXT_WRITE_DATA, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 16} +DEFINE_PROPERTYKEY!{WPD_COMMAND_MTP_EXT_END_DATA_TRANSFER, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 17} +DEFINE_PROPERTYKEY!{WPD_COMMAND_MTP_EXT_GET_VENDOR_EXTENSION_DESCRIPTION, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 18} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_OPERATION_CODE, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1001} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_OPERATION_PARAMS, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1002} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_RESPONSE_CODE, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1003} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_RESPONSE_PARAMS, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1004} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_VENDOR_OPERATION_CODES, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1005} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_TRANSFER_CONTEXT, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1006} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_TRANSFER_TOTAL_DATA_SIZE, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1007} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_TRANSFER_NUM_BYTES_TO_READ, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1008} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_TRANSFER_NUM_BYTES_READ, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1009} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_TRANSFER_NUM_BYTES_TO_WRITE, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1010} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_TRANSFER_NUM_BYTES_WRITTEN, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1011} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_TRANSFER_DATA, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1012} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_OPTIMAL_TRANSFER_BUFFER_SIZE, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1013} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_VENDOR_EXTENSION_DESCRIPTION, + 0x4d545058, 0x1a2e, 0x4106, 0xa3, 0x57, 0x77, 0x1e, 0x08, 0x19, 0xfc, 0x56, 1014} +DEFINE_GUID!{WPD_PROPERTIES_MTP_VENDOR_EXTENDED_OBJECT_PROPS, + 0x4d545058, 0x4fce, 0x4578, 0x95, 0xc8, 0x86, 0x98, 0xa9, 0xbc, 0x0f, 0x49} +DEFINE_GUID!{WPD_PROPERTIES_MTP_VENDOR_EXTENDED_DEVICE_PROPS, + 0x4d545058, 0x8900, 0x40b3, 0x8f, 0x1d, 0xdc, 0x24, 0x6e, 0x1e, 0x83, 0x70} +DEFINE_GUID!{WPD_EVENT_MTP_VENDOR_EXTENDED_EVENTS, + 0x00000000, 0x5738, 0x4ff2, 0x84, 0x45, 0xbe, 0x31, 0x26, 0x69, 0x10, 0x59} +DEFINE_PROPERTYKEY!{WPD_PROPERTY_MTP_EXT_EVENT_PARAMS, + 0x4d545058, 0xef88, 0x4e4d, 0x95, 0xc3, 0x4f, 0x32, 0x7f, 0x72, 0x8a, 0x96, 1011} diff --git a/bash-5.1/vendor/winapi/src/um/ws2bth.rs b/bash-5.1/vendor/winapi/src/um/ws2bth.rs new file mode 100644 index 0000000000000000000000000000000000000000..7494f9261604590e7c1cb9c5d0124c4c9d031f72 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ws2bth.rs @@ -0,0 +1,211 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::bthdef::{ + BTH_ADDR, MAX_L2CAP_INFO_DATA_LENGTH, MAX_L2CAP_PING_DATA_LENGTH, MAX_UUIDS_IN_QUERY, +}; +use shared::bthsdpdef::{SdpAttributeRange, SdpQueryUuid}; +use shared::guiddef::GUID; +use shared::minwindef::{DWORD, PULONG, UCHAR, ULONG, USHORT}; +use shared::ws2def::IOC_VENDOR; +use um::winnt::HANDLE; +pub const BT_PORT_ANY: ULONG = -1i32 as ULONG; +pub const BT_PORT_MIN: ULONG = 0x1; +pub const BT_PORT_MAX: ULONG = 0xffff; +pub const BT_PORT_DYN_FIRST: ULONG = 0x1001; +pub const AF_BTH: USHORT = 32; +pub const PH_BTH: USHORT = AF_BTH; +pub const NS_BTH: USHORT = 16; +STRUCT!{#[repr(packed)] struct SOCKADDR_BTH { + addressFamily: USHORT, + btAddr: BTH_ADDR, + serviceClassId: GUID, + port: ULONG, +}} +pub type PSOCKADDR_BTH = *mut SOCKADDR_BTH; +DEFINE_GUID!{SVCID_BTH_PROVIDER, + 0x6aa63e0, 0x7d60, 0x41ff, 0xaf, 0xb2, 0x3e, 0xe6, 0xd2, 0xd9, 0x39, 0x2d} +pub const BTH_ADDR_STRING_SIZE: DWORD = 12; +pub const BTHPROTO_RFCOMM: USHORT = 0x0003; +pub const BTHPROTO_L2CAP: USHORT = 0x0100; +pub const SOL_RFCOMM: USHORT = BTHPROTO_RFCOMM; +pub const SOL_L2CAP: USHORT = BTHPROTO_L2CAP; +pub const SOL_SDP: USHORT = 0x0101; +pub const SO_BTH_AUTHENTICATE: ULONG = 0x80000001; +pub const SO_BTH_ENCRYPT: ULONG = 0x00000002; +pub const SO_BTH_MTU: ULONG = 0x80000007; +pub const SO_BTH_MTU_MAX: ULONG = 0x80000008; +pub const SO_BTH_MTU_MIN: ULONG = 0x8000000a; +pub const RFCOMM_MAX_MTU: ULONG = 0x000003F3; +pub const RFCOMM_MIN_MTU: ULONG = 0x00000017; +pub const BTH_SDP_VERSION: ULONG = 1; +STRUCT!{#[repr(packed)] struct BTH_SET_SERVICE { + pSdpVersion: PULONG, + pRecordHandle: HANDLE, + fCodService: ULONG, + Reserved: [ULONG; 5], + ulRecordLength: ULONG, + pRecord: [UCHAR; 1], +}} +pub type PBTH_SET_SERVICE = *mut BTH_SET_SERVICE; +pub const SDP_DEFAULT_INQUIRY_SECONDS: UCHAR = 6; +pub const SDP_MAX_INQUIRY_SECONDS: UCHAR = 60; +pub const SDP_DEFAULT_INQUIRY_MAX_RESPONSES: UCHAR = 255; +pub const SDP_SERVICE_SEARCH_REQUEST: ULONG = 1; +pub const SDP_SERVICE_ATTRIBUTE_REQUEST: ULONG = 2; +pub const SDP_SERVICE_SEARCH_ATTRIBUTE_REQUEST: ULONG = 3; +STRUCT!{#[repr(packed)] struct BTH_QUERY_DEVICE { + LAP: ULONG, + length: UCHAR, +}} +pub type PBTH_QUERY_DEVICE = *mut BTH_QUERY_DEVICE; +STRUCT!{#[repr(packed)] struct BTH_QUERY_SERVICE { + type_: ULONG, + serviceHandle: ULONG, + uuids: [SdpQueryUuid; MAX_UUIDS_IN_QUERY], + numRange: ULONG, + pRange: [SdpAttributeRange; 1], +}} +pub type PBTH_QUERY_SERVICE = *mut BTH_QUERY_SERVICE; +pub const BTHNS_RESULT_DEVICE_CONNECTED: DWORD = 0x00010000; +pub const BTHNS_RESULT_DEVICE_REMEMBERED: DWORD = 0x00020000; +pub const BTHNS_RESULT_DEVICE_AUTHENTICATED: DWORD = 0x00040000; +pub const SIO_RFCOMM_SEND_COMMAND: DWORD = _WSAIORW!(IOC_VENDOR, 101); +pub const SIO_RFCOMM_WAIT_COMMAND: DWORD = _WSAIORW!(IOC_VENDOR, 102); +pub const SIO_BTH_PING: DWORD = _WSAIORW!(IOC_VENDOR, 8); +pub const SIO_BTH_INFO: DWORD = _WSAIORW!(IOC_VENDOR, 9); +pub const SIO_RFCOMM_SESSION_FLOW_OFF: DWORD = _WSAIORW!(IOC_VENDOR, 103); +pub const SIO_RFCOMM_TEST: DWORD = _WSAIORW!(IOC_VENDOR, 104); +pub const SIO_RFCOMM_USECFC: DWORD = _WSAIORW!(IOC_VENDOR, 105); +macro_rules! BIT { + ($b:expr) => { + 1 << $b + }; +} +STRUCT!{#[repr(packed)] struct RFCOMM_MSC_DATA { + Signals: UCHAR, + Break: UCHAR, +}} +pub type PRFCOMM_MSC_DATA = *mut RFCOMM_MSC_DATA; +pub const MSC_EA_BIT: UCHAR = BIT!(0); +pub const MSC_FC_BIT: UCHAR = BIT!(1); +pub const MSC_RTC_BIT: UCHAR = BIT!(2); +pub const MSC_RTR_BIT: UCHAR = BIT!(3); +pub const MSC_RESERVED: UCHAR = BIT!(4) | BIT!(5); +pub const MSC_IC_BIT: UCHAR = BIT!(6); +pub const MSC_DV_BIT: UCHAR = BIT!(7); +pub const MSC_BREAK_BIT: UCHAR = BIT!(1); +macro_rules! MSC_SET_BREAK_LENGTH { + ($b: expr, $l: expr) => { + ($b & 0x3) | (($l & 0xf) << 4) + }; +} +STRUCT!{#[repr(packed)] struct RFCOMM_RLS_DATA { + LineStatus: UCHAR, +}} +pub type PRFCOMM_RLS_DATA = *mut RFCOMM_RLS_DATA; +pub const RLS_ERROR: UCHAR = 0x01; +pub const RLS_OVERRUN: UCHAR = 0x02; +pub const RLS_PARITY: UCHAR = 0x04; +pub const RLS_FRAMING: UCHAR = 0x08; +STRUCT!{#[repr(packed)] struct RFCOMM_RPN_DATA { + Baud: UCHAR, + Data: UCHAR, + FlowControl: UCHAR, + XonChar: UCHAR, + XoffChar: UCHAR, + ParameterMask1: UCHAR, + ParameterMask2: UCHAR, +}} +pub type PRFCOMM_RPN_DATA = *mut RFCOMM_RPN_DATA; +pub const RPN_BAUD_2400: UCHAR = 0; +pub const RPN_BAUD_4800: UCHAR = 1; +pub const RPN_BAUD_7200: UCHAR = 2; +pub const RPN_BAUD_9600: UCHAR = 3; +pub const RPN_BAUD_19200: UCHAR = 4; +pub const RPN_BAUD_38400: UCHAR = 5; +pub const RPN_BAUD_57600: UCHAR = 6; +pub const RPN_BAUD_115200: UCHAR = 7; +pub const RPN_BAUD_230400: UCHAR = 8; +pub const RPN_DATA_5: UCHAR = 0x0; +pub const RPN_DATA_6: UCHAR = 0x1; +pub const RPN_DATA_7: UCHAR = 0x2; +pub const RPN_DATA_8: UCHAR = 0x3; +pub const RPN_STOP_1: UCHAR = 0x0; +pub const RPN_STOP_1_5: UCHAR = 0x4; +pub const RPN_PARITY_NONE: UCHAR = 0x00; +pub const RPN_PARITY_ODD: UCHAR = 0x08; +pub const RPN_PARITY_EVEN: UCHAR = 0x18; +pub const RPN_PARITY_MARK: UCHAR = 0x28; +pub const RPN_PARITY_SPACE: UCHAR = 0x38; +pub const RPN_FLOW_X_IN: UCHAR = 0x01; +pub const RPN_FLOW_X_OUT: UCHAR = 0x02; +pub const RPN_FLOW_RTR_IN: UCHAR = 0x04; +pub const RPN_FLOW_RTR_OUT: UCHAR = 0x08; +pub const RPN_FLOW_RTC_IN: UCHAR = 0x10; +pub const RPN_FLOW_RTC_OUT: UCHAR = 0x20; +pub const RPN_PARAM_BAUD: UCHAR = 0x01; +pub const RPN_PARAM_DATA: UCHAR = 0x02; +pub const RPN_PARAM_STOP: UCHAR = 0x04; +pub const RPN_PARAM_PARITY: UCHAR = 0x08; +pub const RPN_PARAM_P_TYPE: UCHAR = 0x10; +pub const RPN_PARAM_XON: UCHAR = 0x20; +pub const RPN_PARAM_XOFF: UCHAR = 0x40; +pub const RPN_PARAM_X_IN: UCHAR = 0x01; +pub const RPN_PARAM_X_OUT: UCHAR = 0x02; +pub const RPN_PARAM_RTR_IN: UCHAR = 0x04; +pub const RPN_PARAM_RTR_OUT: UCHAR = 0x08; +pub const RPN_PARAM_RTC_IN: UCHAR = 0x10; +pub const RPN_PARAM_RTC_OUT: UCHAR = 0x20; +pub const RFCOMM_CMD_NONE: UCHAR = 0; +pub const RFCOMM_CMD_MSC: UCHAR = 1; +pub const RFCOMM_CMD_RLS: UCHAR = 2; +pub const RFCOMM_CMD_RPN: UCHAR = 3; +pub const RFCOMM_CMD_RPN_REQUEST: UCHAR = 4; +pub const RFCOMM_CMD_RPN_RESPONSE: UCHAR = 5; +UNION!{#[repr(packed)] union RFCOMM_COMMAND_Data { + [u8; 7], + MSC MSC_mut: RFCOMM_MSC_DATA, + RLS RLS_mut: RFCOMM_RLS_DATA, + RPN RPN_mut: RFCOMM_RPN_DATA, +}} +STRUCT!{#[repr(packed)] struct RFCOMM_COMMAND { + CmdType: ULONG, + Data: RFCOMM_COMMAND_Data, +}} +pub type PRFCOMM_COMMAND = *mut RFCOMM_COMMAND; +STRUCT!{#[repr(packed)] struct BTH_PING_REQ { + btAddr: BTH_ADDR, + dataLen: UCHAR, + data: [UCHAR; MAX_L2CAP_PING_DATA_LENGTH], +}} +pub type PBTH_PING_REQ = *mut BTH_PING_REQ; +STRUCT!{#[repr(packed)] struct BTH_PING_RSP { + dataLen: UCHAR, + data: [UCHAR; MAX_L2CAP_PING_DATA_LENGTH], +}} +pub type PBTH_PING_RSP = *mut BTH_PING_RSP; +STRUCT!{#[repr(packed)] struct BTH_INFO_REQ { + btAddr: BTH_ADDR, + infoType: USHORT, +}} +pub type PBTH_INFO_REQ = *mut BTH_INFO_REQ; +UNION!{#[repr(packed)] union BTH_INFO_RSP_u { + [u8; MAX_L2CAP_INFO_DATA_LENGTH], + connectionlessMTU connectionlessMTU_mut: USHORT, + data data_mut: [UCHAR; MAX_L2CAP_INFO_DATA_LENGTH], +}} +STRUCT!{#[repr(packed)] struct BTH_INFO_RSP { + result: USHORT, + dataLen: UCHAR, + u: BTH_INFO_RSP_u, +}} +pub type PBTH_INFO_RSP = *mut BTH_INFO_RSP; +pub type BTHNS_SETBLOB = BTH_SET_SERVICE; +pub type PBTHNS_SETBLOB = PBTH_SET_SERVICE; +pub type BTHNS_INQUIRYBLOB = BTH_QUERY_DEVICE; +pub type PBTHNS_INQUIRYBLOB = PBTH_QUERY_DEVICE; +pub type BTHNS_RESTRICTIONBLOB = BTH_QUERY_SERVICE; +pub type PBTHNS_RESTRICTIONBLOB = PBTH_QUERY_SERVICE; diff --git a/bash-5.1/vendor/winapi/src/um/ws2spi.rs b/bash-5.1/vendor/winapi/src/um/ws2spi.rs new file mode 100644 index 0000000000000000000000000000000000000000..d26128949164b21ca377454b4c1fc9ca5f2a8e0b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ws2spi.rs @@ -0,0 +1,909 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Definitions to be used with the WinSock service provider. +use ctypes::{c_char, c_int, c_long, c_uint}; +use shared::basetsd::{DWORD_PTR, PDWORD_PTR, ULONG_PTR}; +use shared::guiddef::{GUID, LPGUID}; +use shared::minwindef::{ + BOOL, DWORD, INT, LPARAM, LPDWORD, LPHANDLE, LPINT, LPVOID, PBYTE, UINT, WORD, WPARAM, +}; +use shared::windef::HWND; +use shared::ws2def::{LPSOCKADDR, LPWSABUF, SOCKADDR}; +use shared::wtypesbase::LPBLOB; +use um::winnt::{HANDLE, LPCWSTR, LPWSTR, PVOID, WCHAR}; +use um::winsock2::{ + GROUP, LPCONDITIONPROC, LPQOS, LPWSACOMPLETION, LPWSANETWORKEVENTS, LPWSAOVERLAPPED, + LPWSAOVERLAPPED_COMPLETION_ROUTINE, LPWSAPROTOCOL_INFOW, LPWSAQUERYSET2W, LPWSAQUERYSETW, + LPWSASERVICECLASSINFOW, SOCKET, WSAESETSERVICEOP, WSAEVENT, fd_set, timeval, +}; +#[cfg(target_pointer_width = "64")] +use um::winsock2::{LPWSANAMESPACE_INFOEXW, LPWSANAMESPACE_INFOW}; +use vc::vcruntime::size_t; +pub const WSPDESCRIPTION_LEN: usize = 255; +pub const WSS_OPERATION_IN_PROGRESS: ULONG_PTR = 0x00000103; +STRUCT!{struct WSPDATA { + wVersion: WORD, + wHighVersion: WORD, + szDescription: [WCHAR; WSPDESCRIPTION_LEN + 1], +}} +pub type LPWSPDATA = *mut WSPDATA; +STRUCT!{struct WSATHREADID { + ThreadHandle: HANDLE, + Reserved: DWORD_PTR, +}} +pub type LPWSATHREADID = *mut WSATHREADID; +FN!{stdcall LPBLOCKINGCALLBACK( + dwContext: DWORD_PTR, +) -> BOOL} +FN!{stdcall LPWSAUSERAPC( + dwContext: DWORD_PTR, +) -> ()} +FN!{stdcall LPWSPACCEPT( + s: SOCKET, + addr: *mut SOCKADDR, + addrlen: LPINT, + lpfnCondition: LPCONDITIONPROC, + dwCallbackData: DWORD_PTR, + lpErrno: LPINT, +) -> SOCKET} +FN!{stdcall LPWSPADDRESSTOSTRING( + lpsaAddress: LPSOCKADDR, + dwAddressLength: DWORD, + lpProtocolInfo: LPWSAPROTOCOL_INFOW, + lpszAddressString: LPWSTR, + lpdwAddressStringLength: LPDWORD, + lpErrno: LPINT, +) -> INT} +FN!{stdcall LPWSPASYNCSELECT( + s: SOCKET, + hWnd: HWND, + wMsg: c_uint, + lEvent: c_long, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPBIND( + s: SOCKET, + name: *mut SOCKADDR, + namelen: c_int, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPCANCELBLOCKINGCALL( + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPCLEANUP( + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPCLOSESOCKET( + s: SOCKET, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPCONNECT( + s: SOCKET, + name: *mut SOCKADDR, + namelen: c_int, + lpCallerData: LPWSABUF, + lpCalleeData: LPWSABUF, + lpSQOS: LPQOS, + lpGQOS: LPQOS, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPDUPLICATESOCKET( + s: SOCKET, + dwProcessId: DWORD, + lpProtocolInfo: LPWSAPROTOCOL_INFOW, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPENUMNETWORKEVENTS( + s: SOCKET, + hEventObject: WSAEVENT, + lpNetworkEvents: LPWSANETWORKEVENTS, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPEVENTSELECT( + s: SOCKET, + hEventObject: WSAEVENT, + lNetworkEvents: c_long, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPGETOVERLAPPEDRESULT( + s: SOCKET, + lpOverlapped: LPWSAOVERLAPPED, + lpcbTransfer: LPDWORD, + fWait: BOOL, + lpdwFlags: LPDWORD, + lpErrno: LPINT, +) -> BOOL} +FN!{stdcall LPWSPGETPEERNAME( + s: SOCKET, + name: *mut SOCKADDR, + namelen: LPINT, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPGETSOCKNAME( + s: SOCKET, + name: *mut SOCKADDR, + namelen: LPINT, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPGETSOCKOPT( + s: SOCKET, + level: c_int, + optname: c_int, + optval: *mut c_char, + optlen: LPINT, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPGETQOSBYNAME( + s: SOCKET, + lpQOSName: LPWSABUF, + lpQOS: LPQOS, + lpErrno: LPINT, +) -> BOOL} +FN!{stdcall LPWSPIOCTL( + s: SOCKET, + dwIoControlCode: DWORD, + lpvInBuffer: LPVOID, + cbInBuffer: DWORD, + lpvOutBuffer: LPVOID, + cbOutBuffer: DWORD, + lpcbBytesReturned: LPDWORD, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + lpThreadId: LPWSATHREADID, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPJOINLEAF( + s: SOCKET, + name: *mut SOCKADDR, + namelen: c_int, + lpCallerData: LPWSABUF, + lpCalleeData: LPWSABUF, + lpSQOS: LPQOS, + lpGQOS: LPQOS, + dwFlags: DWORD, + lpErrno: LPINT, +) -> SOCKET} +FN!{stdcall LPWSPLISTEN( + s: SOCKET, + backlog: c_int, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPRECV( + s: SOCKET, + lpBuffers: LPWSABUF, + dwBufferCount: DWORD, + lpNumberOfBytesRecvd: LPDWORD, + lpFlags: LPDWORD, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + lpThreadId: LPWSATHREADID, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPRECVDISCONNECT( + s: SOCKET, + lpInboundDisconnectData: LPWSABUF, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPRECVFROM( + s: SOCKET, + lpBuffers: LPWSABUF, + dwBufferCount: DWORD, + lpNumberOfBytesRecvd: LPDWORD, + lpFlags: LPDWORD, + lpFrom: *mut SOCKADDR, + lpFromlen: LPINT, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + lpThreadId: LPWSATHREADID, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPSELECT( + nfds: c_int, + readfds: *mut fd_set, + writefds: *mut fd_set, + exceptfds: *mut fd_set, + timeout: *const timeval, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPSEND( + s: SOCKET, + lpBuffers: LPWSABUF, + dwBufferCount: DWORD, + lpNumberOfBytesSent: LPDWORD, + dwFlags: DWORD, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + lpThreadId: LPWSATHREADID, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPSENDDISCONNECT( + s: SOCKET, + lpOutboundDisconnectData: LPWSABUF, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPSENDTO( + s: SOCKET, + lpBuffers: LPWSABUF, + dwBufferCount: DWORD, + lpNumberOfBytesSent: LPDWORD, + dwFlags: DWORD, + lpTo: *const SOCKADDR, + iTolen: c_int, + lpOverlapped: LPWSAOVERLAPPED, + lpCompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + lpThreadId: LPWSATHREADID, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPSETSOCKOPT( + s: SOCKET, + level: c_int, + optname: c_int, + optval: *const c_char, + optlen: c_int, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPSHUTDOWN( + s: SOCKET, + how: c_int, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWSPSOCKET( + af: c_int, + _type: c_int, + protocol: c_int, + lpProtocolInfo: LPWSAPROTOCOL_INFOW, + g: GROUP, + dwFlags: DWORD, + lpErrno: LPINT, +) -> SOCKET} +FN!{stdcall LPWSPSTRINGTOADDRESS( + AddressString: LPWSTR, + AddressFamily: INT, + lpProtocolInfo: LPWSAPROTOCOL_INFOW, + lpAddress: LPSOCKADDR, + lpAddressLength: LPINT, + lpErrno: LPINT, +) -> c_int} +STRUCT!{struct WSPPROC_TABLE { + lpWSPAccept: LPWSPACCEPT, + lpWSPAddressToString: LPWSPADDRESSTOSTRING, + lpWSPAsyncSelect: LPWSPASYNCSELECT, + lpWSPBind: LPWSPBIND, + lpWSPCancelBlockingCall: LPWSPCANCELBLOCKINGCALL, + lpWSPCleanup: LPWSPCLEANUP, + lpWSPCloseSocket: LPWSPCLOSESOCKET, + lpWSPConnect: LPWSPCONNECT, + lpWSPDuplicateSocket: LPWSPDUPLICATESOCKET, + lpWSPEnumNetworkEvents: LPWSPENUMNETWORKEVENTS, + lpWSPEventSelect: LPWSPEVENTSELECT, + lpWSPGetOverlappedResult: LPWSPGETOVERLAPPEDRESULT, + lpWSPGetPeerName: LPWSPGETPEERNAME, + lpWSPGetSockName: LPWSPGETSOCKNAME, + lpWSPGetSockOpt: LPWSPGETSOCKOPT, + lpWSPGetQOSByName: LPWSPGETQOSBYNAME, + lpWSPIoctl: LPWSPIOCTL, + lpWSPJoinLeaf: LPWSPJOINLEAF, + lpWSPListen: LPWSPLISTEN, + lpWSPRecv: LPWSPRECV, + lpWSPRecvDisconnect: LPWSPRECVDISCONNECT, + lpWSPRecvFrom: LPWSPRECVFROM, + lpWSPSelect: LPWSPSELECT, + lpWSPSend: LPWSPSEND, + lpWSPSendDisconnect: LPWSPSENDDISCONNECT, + lpWSPSendTo: LPWSPSENDTO, + lpWSPSetSockOpt: LPWSPSETSOCKOPT, + lpWSPShutdown: LPWSPSHUTDOWN, + lpWSPSocket: LPWSPSOCKET, + lpWSPStringToAddress: LPWSPSTRINGTOADDRESS, +}} +pub type LPWSPPROC_TABLE = *mut WSPPROC_TABLE; +FN!{stdcall LPWPUCLOSEEVENT( + hEvent: WSAEVENT, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWPUCLOSESOCKETHANDLE( + s: SOCKET, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWPUCREATEEVENT( + lpErrno: LPINT, +) -> WSAEVENT} +FN!{stdcall LPWPUCREATESOCKETHANDLE( + dwCatalogEntryId: DWORD, + dwContext: DWORD_PTR, + lpErrno: LPINT, +) -> SOCKET} +FN!{stdcall LPWPUFDISSET( + s: SOCKET, + fdset: *mut fd_set, +) -> c_int} +FN!{stdcall LPWPUGETPROVIDERPATH( + lpProviderId: LPGUID, + lpszProviderDllPath: *mut WCHAR, + lpProviderDllPathLen: LPINT, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWPUMODIFYIFSHANDLE( + dwCatalogEntryId: DWORD, + ProposedHandle: SOCKET, + lpErrno: LPINT, +) -> SOCKET} +FN!{stdcall LPWPUPOSTMESSAGE( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, +) -> BOOL} +FN!{stdcall LPWPUQUERYBLOCKINGCALLBACK( + dwCatalogEntryId: DWORD, + lplpfnCallback: *mut LPBLOCKINGCALLBACK, + lpdwContext: PDWORD_PTR, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWPUQUERYSOCKETHANDLECONTEXT( + s: SOCKET, + lpContext: PDWORD_PTR, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWPUQUEUEAPC( + lpThreadId: LPWSATHREADID, + lpfnUserApc: LPWSAUSERAPC, + dwContext: DWORD_PTR, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWPURESETEVENT( + hEvent: WSAEVENT, + lpErrno: LPINT, +) -> BOOL} +FN!{stdcall LPWPUSETEVENT( + hEvent: WSAEVENT, + lpErrno: LPINT, +) -> BOOL} +FN!{stdcall LPWPUOPENCURRENTTHREAD( + lpThreadId: LPWSATHREADID, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWPUCLOSETHREAD( + lpThreadId: LPWSATHREADID, + lpErrno: LPINT, +) -> c_int} +FN!{stdcall LPWPUCOMPLETEOVERLAPPEDREQUEST( + s: SOCKET, + lpOverlapped: LPWSAOVERLAPPED, + dwError: DWORD, + cbTransferred: DWORD, + lpErrno: LPINT, +) -> c_int} +STRUCT!{struct WSPUPCALLTABLE { + lpWPUCloseEvent: LPWPUCLOSEEVENT, + lpWPUCloseSocketHandle: LPWPUCLOSESOCKETHANDLE, + lpWPUCreateEvent: LPWPUCREATEEVENT, + lpWPUCreateSocketHandle: LPWPUCREATESOCKETHANDLE, + lpWPUFDIsSet: LPWPUFDISSET, + lpWPUGetProviderPath: LPWPUGETPROVIDERPATH, + lpWPUModifyIFSHandle: LPWPUMODIFYIFSHANDLE, + lpWPUPostMessage: LPWPUPOSTMESSAGE, + lpWPUQueryBlockingCallback: LPWPUQUERYBLOCKINGCALLBACK, + lpWPUQuerySocketHandleContext: LPWPUQUERYSOCKETHANDLECONTEXT, + lpWPUQueueApc: LPWPUQUEUEAPC, + lpWPUResetEvent: LPWPURESETEVENT, + lpWPUSetEvent: LPWPUSETEVENT, + lpWPUOpenCurrentThread: LPWPUOPENCURRENTTHREAD, + lpWPUCloseThread: LPWPUCLOSETHREAD, +}} +pub type LPWSPUPCALLTABLE = *mut WSPUPCALLTABLE; +extern "system" { + pub fn WSPStartup( + wVersionRequested: WORD, + lpWSPData: LPWSPDATA, + lpProtocolInfo: LPWSAPROTOCOL_INFOW, + UpcallTable: WSPUPCALLTABLE, + lpProcTable: LPWSPPROC_TABLE, + ) -> c_int; +} +FN!{stdcall LPWSPSTARTUP( + wVersionRequested: WORD, + lpWSPData: LPWSPDATA, + lpProtocolInfo: LPWSAPROTOCOL_INFOW, + UpcallTable: WSPUPCALLTABLE, + lpProcTable: LPWSPPROC_TABLE, +) -> c_int} +extern "system" { + pub fn WSCEnumProtocols( + lpiProtocols: LPINT, + lpProtocolBuffer: LPWSAPROTOCOL_INFOW, + lpdwBufferLength: LPDWORD, + lpErrno: LPINT, + ) -> c_int; +} +FN!{stdcall LPWSCENUMPROTOCOLS( + lpiProtocols: LPINT, + lpProtocolBuffer: LPWSAPROTOCOL_INFOW, + lpdwBufferLength: LPDWORD, + lpErrno: LPINT, +) -> c_int} +extern "system" { + #[cfg(target_pointer_width = "64")] + pub fn WSCEnumProtocols32( + lpiProtocols: LPINT, + lpProtocolBuffer: LPWSAPROTOCOL_INFOW, + lpdwBufferLength: LPDWORD, + lpErrno: LPINT, + ) -> c_int; + pub fn WSCDeinstallProvider( + lpProviderId: LPGUID, + lpErrno: LPINT, + ) -> c_int; +} +FN!{stdcall LPWSCDEINSTALLPROVIDER( + lpProviderId: LPGUID, + lpErrno: LPINT, +) -> c_int} +extern "system" { + #[cfg(target_pointer_width = "64")] + pub fn WSCDeinstallProvider32( + lpProviderId: LPGUID, + lpErrno: LPINT, + ) -> c_int; + pub fn WSCInstallProvider( + lpProviderId: LPGUID, + lpszProviderDllPath: *const WCHAR, + lpProtocolInfoList: LPWSAPROTOCOL_INFOW, + dwNumberOfEntries: DWORD, + lpErrno: LPINT, + ) -> c_int; +} +FN!{stdcall LPWSCINSTALLPROVIDER( + lpProviderId: LPGUID, + lpszProviderDllPath: *const WCHAR, + lpProtocolInfoList: LPWSAPROTOCOL_INFOW, + dwNumberOfEntries: DWORD, + lpErrno: LPINT, +) -> c_int} +extern "system" { + #[cfg(target_pointer_width = "64")] + pub fn WSCInstallProvider64_32( + lpProviderId: LPGUID, + lpszProviderDllPath: *const WCHAR, + lpProtocolInfoList: LPWSAPROTOCOL_INFOW, + dwNumberOfEntries: DWORD, + lpErrno: LPINT, + ) -> c_int; + pub fn WSCGetProviderPath( + lpProviderId: LPGUID, + lpszProviderDllPath: *mut WCHAR, + lpProviderDllPathLen: LPINT, + lpErrno: LPINT, + ) -> c_int; +} +FN!{stdcall LPWSCGETPROVIDERPATH( + lpProviderId: LPGUID, + lpszProviderDllPath: *mut WCHAR, + lpProviderDllPathLen: LPINT, + lpErrno: LPINT, +) -> c_int} +extern "system" { + #[cfg(target_pointer_width = "64")] + pub fn WSCGetProviderPath32( + lpProviderId: LPGUID, + lpszProviderDllPath: *mut WCHAR, + lpProviderDllPathLen: LPINT, + lpErrno: LPINT, + ) -> c_int; + pub fn WSCUpdateProvider( + lpProviderId: LPGUID, + lpszProviderDllPath: *const WCHAR, + lpProtocolInfoList: LPWSAPROTOCOL_INFOW, + dwNumberOfEntries: DWORD, + lpErrno: LPINT, + ) -> c_int; +} +FN!{stdcall LPWSCUPDATEPROVIDER( + lpProviderId: LPGUID, + lpszProviderDllPath: *const WCHAR, + lpProtocolInfoList: LPWSAPROTOCOL_INFOW, + dwNumberOfEntries: DWORD, + lpErrno: LPINT, +) -> c_int} +#[cfg(target_pointer_width = "64")] +extern "system" { + pub fn WSCUpdateProvider32( + lpProviderId: LPGUID, + lpszProviderDllPath: *const WCHAR, + lpProtocolInfoList: LPWSAPROTOCOL_INFOW, + dwNumberOfEntries: DWORD, + lpErrno: LPINT, + ) -> c_int; +} +pub const LSP_SYSTEM: DWORD = 0x80000000; +pub const LSP_INSPECTOR: DWORD = 0x00000001; +pub const LSP_REDIRECTOR: DWORD = 0x00000002; +pub const LSP_PROXY: DWORD = 0x00000004; +pub const LSP_FIREWALL: DWORD = 0x00000008; +pub const LSP_INBOUND_MODIFY: DWORD = 0x00000010; +pub const LSP_OUTBOUND_MODIFY: DWORD = 0x00000020; +pub const LSP_CRYPTO_COMPRESS: DWORD = 0x00000040; +pub const LSP_LOCAL_CACHE: DWORD = 0x00000080; +ENUM!{enum WSC_PROVIDER_INFO_TYPE { + ProviderInfoLspCategories, + ProviderInfoAudit, +}} +STRUCT!{struct WSC_PROVIDER_AUDIT_INFO { + RecordSize: DWORD, + Reserved: PVOID, +}} +extern "system" { + pub fn WSCSetProviderInfo( + lpProviderId: LPGUID, + InfoType: WSC_PROVIDER_INFO_TYPE, + Info: PBYTE, + InfoSize: size_t, + Flags: DWORD, + lpErrno: LPINT, + ) -> c_int; + pub fn WSCGetProviderInfo( + lpProviderId: LPGUID, + InfoType: WSC_PROVIDER_INFO_TYPE, + Info: PBYTE, + InfoSize: *mut size_t, + Flags: DWORD, + lpErrno: LPINT, + ) -> c_int; + #[cfg(target_pointer_width = "64")] + pub fn WSCSetProviderInfo32( + lpProviderId: LPGUID, + InfoType: WSC_PROVIDER_INFO_TYPE, + Info: PBYTE, + InfoSize: size_t, + Flags: DWORD, + lpErrno: LPINT, + ) -> c_int; + #[cfg(target_pointer_width = "64")] + pub fn WSCGetProviderInfo32( + lpProviderId: LPGUID, + InfoType: WSC_PROVIDER_INFO_TYPE, + Info: PBYTE, + InfoSize: *mut size_t, + Flags: DWORD, + lpErrno: LPINT, + ) -> c_int; + pub fn WSCSetApplicationCategory( + Path: LPCWSTR, + PathLength: DWORD, + Extra: LPCWSTR, + ExtraLength: DWORD, + PermittedLspCategories: DWORD, + pPrevPermLspCat: *mut DWORD, + lpErrno: LPINT, + ) -> c_int; + pub fn WSCGetApplicationCategory( + Path: LPCWSTR, + PathLength: DWORD, + Extra: LPCWSTR, + ExtraLength: DWORD, + pPermittedLspCategories: *mut DWORD, + lpErrno: LPINT, + ) -> c_int; + pub fn WPUCloseEvent( + hEvent: WSAEVENT, + lpErrno: LPINT, + ) -> BOOL; + pub fn WPUCloseSocketHandle( + s: SOCKET, + lpErrno: LPINT, + ) -> c_int; + pub fn WPUCreateEvent( + lpErrno: LPINT, + ) -> WSAEVENT; + pub fn WPUCreateSocketHandle( + dwCatalogEntryId: DWORD, + dwContext: DWORD_PTR, + lpErrno: LPINT, + ) -> SOCKET; + pub fn WPUFDIsSet( + s: SOCKET, + fdset: *mut fd_set, + ) -> c_int; + pub fn WPUGetProviderPath( + lpProviderId: LPGUID, + lpszProviderDllPath: *mut WCHAR, + lpProviderDllPathLen: LPINT, + lpErrno: LPINT, + ) -> c_int; + pub fn WPUModifyIFSHandle( + dwCatalogEntryId: DWORD, + ProposedHandle: SOCKET, + lpErrno: LPINT, + ) -> SOCKET; + pub fn WPUPostMessage( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> BOOL; + pub fn WPUQueryBlockingCallback( + dwCatalogEntryId: DWORD, + lplpfnCallback: *mut LPBLOCKINGCALLBACK, + lpdwContext: PDWORD_PTR, + lpErrno: LPINT, + ) -> c_int; + pub fn WPUQuerySocketHandleContext( + s: SOCKET, + lpContext: PDWORD_PTR, + lpErrno: LPINT, + ) -> c_int; + pub fn WPUQueueApc( + lpThreadId: LPWSATHREADID, + lpfnUserApc: LPWSAUSERAPC, + dwContext: DWORD_PTR, + lpErrno: LPINT, + ) -> c_int; + pub fn WPUResetEvent( + hEvent: WSAEVENT, + lpErrno: LPINT, + ) -> BOOL; + pub fn WPUSetEvent( + hEvent: WSAEVENT, + lpErrno: LPINT, + ) -> BOOL; + pub fn WPUCompleteOverlappedRequest( + s: SOCKET, + lpOverlapped: LPWSAOVERLAPPED, + dwError: DWORD, + cbTransferred: DWORD, + lpErrno: LPINT, + ) -> c_int; + pub fn WPUOpenCurrentThread( + lpThreadId: LPWSATHREADID, + lpErrno: LPINT, + ) -> c_int; + pub fn WPUCloseThread( + lpThreadId: LPWSATHREADID, + lpErrno: LPINT, + ) -> c_int; + #[cfg(target_pointer_width = "64")] + pub fn WSCEnumNameSpaceProviders32( + lpdwBufferLength: LPDWORD, + lpnspBuffer: LPWSANAMESPACE_INFOW, + ) -> INT; + #[cfg(target_pointer_width = "64")] + pub fn WSCEnumNameSpaceProvidersEx32( + lpdwBufferLength: LPDWORD, + lpnspBuffer: LPWSANAMESPACE_INFOEXW, + ) -> INT; + pub fn WSCInstallNameSpace( + lpszIdentifier: LPWSTR, + lpszPathName: LPWSTR, + dwNameSpace: DWORD, + dwVersion: DWORD, + lpProviderId: LPGUID, + ) -> INT; +} +FN!{stdcall LPWSCINSTALLNAMESPACE( + lpszIdentifier: LPWSTR, + lpszPathName: LPWSTR, + dwNameSpace: DWORD, + dwVersion: DWORD, + lpProviderId: LPGUID, +) -> INT} +extern "system" { + #[cfg(target_pointer_width = "64")] + pub fn WSCInstallNameSpace32( + lpszIdentifier: LPWSTR, + lpszPathName: LPWSTR, + dwNameSpace: DWORD, + dwVersion: DWORD, + lpProviderId: LPGUID, + ) -> INT; + pub fn WSCUnInstallNameSpace( + lpProviderId: LPGUID, + ) -> INT; +} +FN!{stdcall LPWSCUNINSTALLNAMESPACE( + lpProviderId: LPGUID, +) -> INT} +extern "system" { + pub fn WSCInstallNameSpaceEx( + lpszIdentifier: LPWSTR, + lpszPathName: LPWSTR, + dwNameSpace: DWORD, + dwVersion: DWORD, + lpProviderId: LPGUID, + lpProviderSpecific: LPBLOB, + ) -> INT; + #[cfg(target_pointer_width = "64")] + pub fn WSCInstallNameSpaceEx32( + lpszIdentifier: LPWSTR, + lpszPathName: LPWSTR, + dwNameSpace: DWORD, + dwVersion: DWORD, + lpProviderId: LPGUID, + lpProviderSpecific: LPBLOB, + ) -> INT; + #[cfg(target_pointer_width = "64")] + pub fn WSCUnInstallNameSpace32( + lpProviderId: LPGUID, + ) -> INT; + pub fn WSCEnableNSProvider( + lpProviderId: LPGUID, + fEnable: BOOL, + ) -> INT; +} +FN!{stdcall LPWSCENABLENSPROVIDER( + lpProviderId: LPGUID, + fEnable: BOOL, +) -> INT} +extern "system" { + #[cfg(target_pointer_width = "64")] + pub fn WSCEnableNSProvider32( + lpProviderId: LPGUID, + fEnable: BOOL, + ) -> INT; + #[cfg(target_pointer_width = "64")] + pub fn WSCInstallProviderAndChains64_32( + lpProviderId: LPGUID, + lpszProviderDllPath: LPWSTR, + lpszProviderDllPath32: LPWSTR, + lpszLspName: LPWSTR, + dwServiceFlags: DWORD, + lpProtocolInfoList: LPWSAPROTOCOL_INFOW, + dwNumberOfEntries: DWORD, + lpdwCatalogEntryId: LPDWORD, + lpErrno: LPINT, + ) -> c_int; + #[cfg(target_pointer_width = "32")] + pub fn WSCInstallProviderAndChains( + lpProviderId: LPGUID, + lpszProviderDllPath: LPWSTR, + lpszLspName: LPWSTR, + dwServiceFlags: DWORD, + lpProtocolInfoList: LPWSAPROTOCOL_INFOW, + dwNumberOfEntries: DWORD, + lpdwCatalogEntryId: LPDWORD, + lpErrno: LPINT, + ) -> c_int; +} +FN!{stdcall LPNSPCLEANUP( + lpProviderId: LPGUID, +) -> INT} +FN!{stdcall LPNSPLOOKUPSERVICEBEGIN( + lpProviderId: LPGUID, + lpqsRestrictions: LPWSAQUERYSETW, + lpServiceClassInfo: LPWSASERVICECLASSINFOW, + dwControlFlags: DWORD, + lphLookup: LPHANDLE, +) -> INT} +FN!{stdcall LPNSPLOOKUPSERVICENEXT( + hLookup: HANDLE, + dwControlFlags: DWORD, + lpdwBufferLength: LPDWORD, + lpqsResults: LPWSAQUERYSETW, +) -> INT} +FN!{stdcall LPNSPIOCTL( + hLookup: HANDLE, + dwControlCode: DWORD, + lpvInBuffer: LPVOID, + cbInBuffer: DWORD, + lpvOutBuffer: LPVOID, + cbOutBuffer: DWORD, + lpcbBytesReturned: LPDWORD, + lpCompletion: LPWSACOMPLETION, + lpThreadId: LPWSATHREADID, +) -> INT} +FN!{stdcall LPNSPLOOKUPSERVICEEND( + hLookup: HANDLE, +) -> INT} +FN!{stdcall LPNSPSETSERVICE( + lpProviderId: LPGUID, + lpServiceClassInfo: LPWSASERVICECLASSINFOW, + lpqsRegInfo: LPWSAQUERYSETW, + essOperation: WSAESETSERVICEOP, + dwControlFlags: DWORD, +) -> INT} +FN!{stdcall LPNSPINSTALLSERVICECLASS( + lpProviderId: LPGUID, + lpServiceClassInfo: LPWSASERVICECLASSINFOW, +) -> INT} +FN!{stdcall LPNSPREMOVESERVICECLASS( + lpProviderId: LPGUID, + lpServiceClassId: LPGUID, +) -> INT} +FN!{stdcall LPNSPGETSERVICECLASSINFO( + lpProviderId: LPGUID, + lpdwBufSize: LPDWORD, + lpServiceClassInfo: LPWSASERVICECLASSINFOW, +) -> INT} +STRUCT!{struct NSP_ROUTINE { + cbSize: DWORD, + dwMajorVersion: DWORD, + dwMinorVersion: DWORD, + NSPCleanup: LPNSPCLEANUP, + NSPLookupServiceBegin: LPNSPLOOKUPSERVICEBEGIN, + NSPLookupServiceNext: LPNSPLOOKUPSERVICENEXT, + NSPLookupServiceEnd: LPNSPLOOKUPSERVICEEND, + NSPSetService: LPNSPSETSERVICE, + NSPInstallServiceClass: LPNSPINSTALLSERVICECLASS, + NSPRemoveServiceClass: LPNSPREMOVESERVICECLASS, + NSPGetServiceClassInfo: LPNSPGETSERVICECLASSINFO, + NSPIoctl: LPNSPIOCTL, +}} +pub type LPNSP_ROUTINE = *mut NSP_ROUTINE; +extern "system" { + pub fn NSPStartup( + lpProviderId: LPGUID, + lpnspRoutines: LPNSP_ROUTINE, + ) -> INT; +} +FN!{stdcall LPNSPSTARTUP( + lpProviderId: LPGUID, + lpnspRoutines: LPNSP_ROUTINE, +) -> INT} +FN!{stdcall LPNSPV2STARTUP( + lpProviderId: LPGUID, + ppvClientSessionArg: *mut LPVOID, +) -> INT} +FN!{stdcall LPNSPV2CLEANUP( + lpProviderId: LPGUID, + pvClientSessionArg: LPVOID, +) -> INT} +FN!{stdcall LPNSPV2LOOKUPSERVICEBEGIN( + lpProviderId: LPGUID, + lpqsRestrictions: LPWSAQUERYSET2W, + dwControlFlags: DWORD, + lpvClientSessionArg: LPVOID, + lphLookup: LPHANDLE, +) -> INT} +FN!{stdcall LPNSPV2LOOKUPSERVICENEXTEX( + hAsyncCall: HANDLE, + hLookup: HANDLE, + dwControlFlags: DWORD, + lpdwBufferLength: LPDWORD, + lpqsResults: LPWSAQUERYSET2W, +) -> ()} +FN!{stdcall LPNSPV2LOOKUPSERVICEEND( + hLookup: HANDLE, +) -> INT} +FN!{stdcall LPNSPV2SETSERVICEEX( + hAsyncCall: HANDLE, + lpProviderId: LPGUID, + lpqsRegInfo: LPWSAQUERYSET2W, + essOperation: WSAESETSERVICEOP, + dwControlFlags: DWORD, + lpvClientSessionArg: LPVOID, +) -> ()} +FN!{stdcall LPNSPV2CLIENTSESSIONRUNDOWN( + lpProviderId: LPGUID, + pvClientSessionArg: LPVOID, +) -> ()} +STRUCT!{struct NSPV2_ROUTINE { + cbSize: DWORD, + dwMajorVersion: DWORD, + dwMinorVersion: DWORD, + NSPv2Startup: LPNSPV2STARTUP, + NSPv2Cleanup: LPNSPV2CLEANUP, + NSPv2LookupServiceBegin: LPNSPV2LOOKUPSERVICEBEGIN, + NSPv2LookupServiceNextEx: LPNSPV2LOOKUPSERVICENEXTEX, + NSPv2LookupServiceEnd: LPNSPV2LOOKUPSERVICEEND, + NSPv2SetServiceEx: LPNSPV2SETSERVICEEX, + NSPv2ClientSessionRundown: LPNSPV2CLIENTSESSIONRUNDOWN, +}} +pub type PNSPV2_ROUTINE = *mut NSPV2_ROUTINE; +pub type LPNSPV2_ROUTINE = *mut NSPV2_ROUTINE; +pub type PCNSPV2_ROUTINE = *const NSPV2_ROUTINE; +pub type LPCNSPV2_ROUTINE = *const NSPV2_ROUTINE; +extern "system" { + pub fn WSAAdvertiseProvider( + puuidProviderId: *const GUID, + pNSPv2Routine: *const LPCNSPV2_ROUTINE, + ) -> INT; + pub fn WSAUnadvertiseProvider( + puuidProviderId: *const GUID, + ) -> INT; + pub fn WSAProviderCompleteAsyncCall( + hAsyncCall: HANDLE, + iRetCode: INT, + ) -> INT; +} diff --git a/bash-5.1/vendor/winapi/src/um/ws2tcpip.rs b/bash-5.1/vendor/winapi/src/um/ws2tcpip.rs new file mode 100644 index 0000000000000000000000000000000000000000..4867c74a2f9c79548660f3eb6d56bb189d9d987a --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/ws2tcpip.rs @@ -0,0 +1,346 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms +//! WinSock2 Extension for TCP/IP protocols +use ctypes::c_int; +use shared::guiddef::LPGUID; +use shared::minwindef::{DWORD, INT, LPHANDLE, ULONG}; +use shared::mstcpip::{ + SOCKET_PEER_TARGET_NAME, SOCKET_SECURITY_QUERY_INFO, SOCKET_SECURITY_QUERY_TEMPLATE, + SOCKET_SECURITY_SETTINGS, +}; +use shared::winerror::{ + WSAEAFNOSUPPORT, WSAEINVAL, WSAESOCKTNOSUPPORT, WSAHOST_NOT_FOUND, WSANO_RECOVERY, + WSATRY_AGAIN, WSATYPE_NOT_FOUND, WSA_IPSEC_NAME_POLICY_ERROR, WSA_SECURE_HOST_NOT_FOUND, +}; +use shared::ws2def::{ + ADDRINFOA, ADDRINFOEXA, ADDRINFOEXW, ADDRINFOW, PADDRINFOA, PADDRINFOEXA, PADDRINFOEXW, + PADDRINFOW, SOCKADDR, SOCKET_ADDRESS, +}; +use shared::wtypesbase::LPBLOB; +use um::minwinbase::LPOVERLAPPED; +use um::winnt::{PCHAR, PCSTR, PCWSTR, PSTR, PVOID, PWCHAR, PWSTR, VOID}; +use um::winsock2::{ + LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE, SOCKET, WSA_NOT_ENOUGH_MEMORY, timeval, +}; +use vc::vcruntime::size_t; +pub const UDP_NOCHECKSUM: c_int = 1; +pub const UDP_CHECKSUM_COVERAGE: c_int = 20; +pub const EAI_AGAIN: DWORD = WSATRY_AGAIN; +pub const EAI_BADFLAGS: DWORD = WSAEINVAL; +pub const EAI_FAIL: DWORD = WSANO_RECOVERY; +pub const EAI_FAMILY: DWORD = WSAEAFNOSUPPORT; +pub const EAI_MEMORY: DWORD = WSA_NOT_ENOUGH_MEMORY as u32; +pub const EAI_NOSECURENAME: DWORD = WSA_SECURE_HOST_NOT_FOUND; +pub const EAI_NONAME: DWORD = WSAHOST_NOT_FOUND; +pub const EAI_SERVICE: DWORD = WSATYPE_NOT_FOUND; +pub const EAI_SOCKTYPE: DWORD = WSAESOCKTNOSUPPORT; +pub const EAI_IPSECPOLICY: DWORD = WSA_IPSEC_NAME_POLICY_ERROR; +pub const EAI_NODATA: DWORD = EAI_NONAME; +pub type ADDRINFO = ADDRINFOA; +pub type LPADDRINFO = *mut ADDRINFOA; +extern "system" { + pub fn getaddrinfo( + pNodeName: PCSTR, + pServiceName: PCSTR, + pHints: *const ADDRINFOA, + ppResult: *mut PADDRINFOA, + ) -> INT; + pub fn GetAddrInfoW( + pNodeName: PCWSTR, + pServiceName: PCWSTR, + pHints: *const ADDRINFOW, + ppResult: *mut PADDRINFOW, + ) -> INT; +} +FN!{stdcall LPFN_GETADDRINFO( + pNodeName: PCSTR, + pServiceName: PCSTR, + pHints: *const ADDRINFOA, + ppResult: *mut PADDRINFOA, +) -> INT} +FN!{stdcall LPFN_GETADDRINFOW( + pNodeName: PCWSTR, + pServiceName: PCWSTR, + pHints: *const ADDRINFOW, + ppResult: *mut PADDRINFOW, +) -> INT} +FN!{stdcall LPLOOKUPSERVICE_COMPLETION_ROUTINE( + dwError: DWORD, + dwBytes: DWORD, + lpOverlapped: LPWSAOVERLAPPED, +) -> ()} +extern "system" { + pub fn GetAddrInfoExA( + pName: PCSTR, + pServiceName: PCSTR, + dwNameSpace: DWORD, + lpNspId: LPGUID, + hints: *const ADDRINFOEXA, + ppResult: *mut PADDRINFOEXA, + timeout: *mut timeval, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE, + lpNameHandle: LPHANDLE, + ) -> INT; + pub fn GetAddrInfoExW( + pName: PCWSTR, + pServiceName: PCWSTR, + dwNameSpace: DWORD, + lpNspId: LPGUID, + hints: *const ADDRINFOEXW, + ppResult: *mut PADDRINFOEXW, + timeout: *mut timeval, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE, + lpNameHandle: LPHANDLE, + ) -> INT; + pub fn GetAddrInfoExCancel( + lpHandle: LPHANDLE, + ) -> INT; + pub fn GetAddrInfoExOverlappedResult( + lpOverlapped: LPOVERLAPPED, + ) -> INT; +} +FN!{stdcall LPFN_GETADDRINFOEXA( + pName: PCSTR, + pServiceName: PCSTR, + dwNameSpace: DWORD, + lpNspId: LPGUID, + hints: *const ADDRINFOEXA, + ppResult: *mut PADDRINFOEXA, + timeout: *mut timeval, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE, + lpNameHandle: LPHANDLE, +) -> INT} +FN!{stdcall LPFN_GETADDRINFOEXW( + pName: PCWSTR, + pServiceName: PCWSTR, + dwNameSpace: DWORD, + lpNspId: LPGUID, + hints: *const ADDRINFOEXW, + ppResult: *mut PADDRINFOEXW, + timeout: *mut timeval, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE, + lpNameHandle: LPHANDLE, +) -> INT} +FN!{stdcall LPFN_GETADDRINFOEXCANCEL( + lpHandle: LPHANDLE, +) -> INT} +FN!{stdcall LPFN_GETADDRINFOEXOVERLAPPEDRESULT( + lpOverlapped: LPOVERLAPPED, +) -> INT} +extern "system" { + pub fn SetAddrInfoExA( + pName: PCSTR, + pServiceName: PCSTR, + pAddresses: *mut SOCKET_ADDRESS, + dwAddressCount: DWORD, + lpBlob: LPBLOB, + dwFlags: DWORD, + dwNameSpace: DWORD, + lpNspId: LPGUID, + timeout: *mut timeval, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE, + lpNameHandle: LPHANDLE, + ) -> INT; + pub fn SetAddrInfoExW( + pName: PCWSTR, + pServiceName: PCWSTR, + pAddresses: *mut SOCKET_ADDRESS, + dwAddressCount: DWORD, + lpBlob: LPBLOB, + dwFlags: DWORD, + dwNameSpace: DWORD, + lpNspId: LPGUID, + timeout: *mut timeval, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE, + lpNameHandle: LPHANDLE, + ) -> INT; +} +FN!{stdcall LPFN_SETADDRINFOEXA( + pName: PCSTR, + pServiceName: PCSTR, + pAddresses: *mut SOCKET_ADDRESS, + dwAddressCount: DWORD, + lpBlob: LPBLOB, + dwFlags: DWORD, + dwNameSpace: DWORD, + lpNspId: LPGUID, + timeout: *mut timeval, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE, + lpNameHandle: LPHANDLE, +) -> INT} +FN!{stdcall LPFN_SETADDRINFOEXW( + pName: PCWSTR, + pServiceName: PCWSTR, + pAddresses: *mut SOCKET_ADDRESS, + dwAddressCount: DWORD, + lpBlob: LPBLOB, + dwFlags: DWORD, + dwNameSpace: DWORD, + lpNspId: LPGUID, + timeout: *mut timeval, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPLOOKUPSERVICE_COMPLETION_ROUTINE, + lpNameHandle: LPHANDLE, +) -> INT} +extern "system" { + pub fn freeaddrinfo( + pAddrInfo: PADDRINFOA, + ); + pub fn FreeAddrInfoW( + pAddrInfo: PADDRINFOW, + ); +} +FN!{stdcall LPFN_FREEADDRINFO( + pAddrInfo: PADDRINFOA, +) -> ()} +FN!{stdcall LPFN_FREEADDRINFOW( + pAddrInfo: PADDRINFOW, +) -> ()} +extern "system" { + pub fn FreeAddrInfoEx( + pAddrInfoEx: PADDRINFOEXA, + ); + pub fn FreeAddrInfoExW( + pAddrInfoEx: PADDRINFOEXW, + ); +} +FN!{stdcall LPFN_FREEADDRINFOEXA( + pAddrInfoEx: PADDRINFOEXA, +) -> ()} +FN!{stdcall LPFN_FREEADDRINFOEXW( + pAddrInfoEx: PADDRINFOEXW, +) -> ()} +pub type socklen_t = c_int; +extern "system" { + pub fn getnameinfo( + pSockaddr: *const SOCKADDR, + SockaddrLength: socklen_t, + pNodeBuffer: PCHAR, + NodeBufferSize: DWORD, + pServiceBuffer: PCHAR, + ServiceBufferSize: DWORD, + Flags: INT, + ) -> INT; + pub fn GetNameInfoW( + pSockaddr: *const SOCKADDR, + SockaddrLength: socklen_t, + pNodeBuffer: PWCHAR, + NodeBufferSize: DWORD, + pServiceBuffer: PWCHAR, + ServiceBufferSize: DWORD, + Flags: INT, + ) -> INT; +} +FN!{stdcall LPFN_GETNAMEINFO( + pSockaddr: *const SOCKADDR, + SockaddrLength: socklen_t, + pNodeBuffer: PCHAR, + NodeBufferSize: DWORD, + pServiceBuffer: PCHAR, + ServiceBufferSize: DWORD, + Flags: INT, +) -> c_int} +FN!{stdcall LPFN_GETNAMEINFOW( + pSockaddr: *const SOCKADDR, + SockaddrLength: socklen_t, + pNodeBuffer: PWCHAR, + NodeBufferSize: DWORD, + pServiceBuffer: PWCHAR, + ServiceBufferSize: DWORD, + Flags: INT, +) -> INT} +extern "system" { + pub fn inet_pton( + Family: INT, + pszAddrString: PCSTR, + pAddrBuf: PVOID, + ) -> INT; + pub fn InetPtonW( + Family: INT, + pszAddrString: PCWSTR, + pAddrBuf: PVOID, + ) -> INT; + pub fn inet_ntop( + Family: INT, + pAddr: *const VOID, + pStringBuf: PSTR, + StringBufSize: size_t, + ) -> PCSTR; + pub fn InetNtopW( + Family: INT, + pAddr: *const VOID, + pStringBuf: PWSTR, + StringBufSize: size_t, + ) -> PCWSTR; +} +FN!{stdcall LPFN_INET_PTONA( + Family: INT, + pszAddrString: PCSTR, + pAddrBuf: PVOID, +) -> INT} +FN!{stdcall LPFN_INET_PTONW( + Family: INT, + pszAddrString: PCWSTR, + pAddrBuf: PVOID, +) -> INT} +FN!{stdcall LPFN_INET_NTOPA( + Family: INT, + pAddr: *const VOID, + pStringBuf: PSTR, + StringBufSize: size_t, +) -> PCSTR} +FN!{stdcall LPFN_INET_NTOPW( + Family: INT, + pAddr: *const VOID, + pStringBuf: PWSTR, + StringBufSize: size_t, +) -> PCWSTR} +pub const GAI_STRERROR_BUFFER_SIZE: usize = 1024; +extern "system" { + pub fn WSASetSocketSecurity( + Socket: SOCKET, + SecuritySettings: *const SOCKET_SECURITY_SETTINGS, + SecuritySettingsLen: ULONG, + Overlapped: LPWSAOVERLAPPED, + CompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> INT; + pub fn WSAQuerySocketSecurity( + Socket: SOCKET, + SecurityQueryTemplate: *const SOCKET_SECURITY_QUERY_TEMPLATE, + SecurityQueryTemplateLen: ULONG, + SecurityQueryInfo: *mut SOCKET_SECURITY_QUERY_INFO, + SecurityQueryInfoLen: *mut ULONG, + Overlapped: LPWSAOVERLAPPED, + CompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> INT; + pub fn WSASetSocketPeerTargetName( + Socket: SOCKET, + PeerTargetName: *const SOCKET_PEER_TARGET_NAME, + PeerTargetNameLen: ULONG, + Overlapped: LPWSAOVERLAPPED, + CompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> INT; + pub fn WSADeleteSocketPeerTargetName( + Socket: SOCKET, + PeerAddr: *const SOCKADDR, + PeerAddrLen: ULONG, + Overlapped: LPWSAOVERLAPPED, + CompletionRoutine: LPWSAOVERLAPPED_COMPLETION_ROUTINE, + ) -> INT; + pub fn WSAImpersonateSocketPeer( + Socket: SOCKET, + PeerAddr: *const SOCKADDR, + PeerAddrLen: ULONG, + ) -> INT; + pub fn WSARevertImpersonation(); +} diff --git a/bash-5.1/vendor/winapi/src/um/wtsapi32.rs b/bash-5.1/vendor/winapi/src/um/wtsapi32.rs new file mode 100644 index 0000000000000000000000000000000000000000..ddddf35f2e4970ce1a8b3a0c2457695f224d8e52 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/wtsapi32.rs @@ -0,0 +1,6 @@ +use shared::minwindef::BOOL; +use shared::ntdef::{PHANDLE, ULONG}; +//1286 +extern "system" { + pub fn WTSQueryUserToken(SessionId: ULONG, phToken: PHANDLE) -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/um/xinput.rs b/bash-5.1/vendor/winapi/src/um/xinput.rs new file mode 100644 index 0000000000000000000000000000000000000000..b6f110b7e256f5037c4ecf327f0eb216eaf5d44b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/um/xinput.rs @@ -0,0 +1,173 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! XInput procedure declarations, constant definitions and macros +use shared::guiddef::GUID; +use shared::minwindef::{BOOL, BYTE, DWORD, UINT, WORD}; +use um::winnt::{LPWSTR, SHORT, WCHAR}; +pub const XINPUT_DEVTYPE_GAMEPAD: BYTE = 0x01; +pub const XINPUT_DEVSUBTYPE_GAMEPAD: BYTE = 0x01; +pub const XINPUT_DEVSUBTYPE_UNKNOWN: BYTE = 0x00; +pub const XINPUT_DEVSUBTYPE_WHEEL: BYTE = 0x02; +pub const XINPUT_DEVSUBTYPE_ARCADE_STICK: BYTE = 0x03; +pub const XINPUT_DEVSUBTYPE_FLIGHT_SICK: BYTE = 0x04; +pub const XINPUT_DEVSUBTYPE_DANCE_PAD: BYTE = 0x05; +pub const XINPUT_DEVSUBTYPE_GUITAR: BYTE = 0x06; +pub const XINPUT_DEVSUBTYPE_GUITAR_ALTERNATE: BYTE = 0x07; +pub const XINPUT_DEVSUBTYPE_DRUM_KIT: BYTE = 0x08; +pub const XINPUT_DEVSUBTYPE_GUITAR_BASS: BYTE = 0x0B; +pub const XINPUT_DEVSUBTYPE_ARCADE_PAD: BYTE = 0x13; +pub const XINPUT_CAPS_VOICE_SUPPORTED: WORD = 0x0004; +pub const XINPUT_CAPS_FFB_SUPPORTED: WORD = 0x0001; +pub const XINPUT_CAPS_WIRELESS: WORD = 0x0002; +pub const XINPUT_CAPS_PMD_SUPPORTED: WORD = 0x0008; +pub const XINPUT_CAPS_NO_NAVIGATION: WORD = 0x0010; +pub const XINPUT_GAMEPAD_DPAD_UP: WORD = 0x0001; +pub const XINPUT_GAMEPAD_DPAD_DOWN: WORD = 0x0002; +pub const XINPUT_GAMEPAD_DPAD_LEFT: WORD = 0x0004; +pub const XINPUT_GAMEPAD_DPAD_RIGHT: WORD = 0x0008; +pub const XINPUT_GAMEPAD_START: WORD = 0x0010; +pub const XINPUT_GAMEPAD_BACK: WORD = 0x0020; +pub const XINPUT_GAMEPAD_LEFT_THUMB: WORD = 0x0040; +pub const XINPUT_GAMEPAD_RIGHT_THUMB: WORD = 0x0080; +pub const XINPUT_GAMEPAD_LEFT_SHOULDER: WORD = 0x0100; +pub const XINPUT_GAMEPAD_RIGHT_SHOULDER: WORD = 0x0200; +pub const XINPUT_GAMEPAD_A: WORD = 0x1000; +pub const XINPUT_GAMEPAD_B: WORD = 0x2000; +pub const XINPUT_GAMEPAD_X: WORD = 0x4000; +pub const XINPUT_GAMEPAD_Y: WORD = 0x8000; +pub const XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE: SHORT = 7849; +pub const XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE: SHORT = 8689; +pub const XINPUT_GAMEPAD_TRIGGER_THRESHOLD: BYTE = 30; +pub const XINPUT_FLAG_GAMEPAD: DWORD = 0x00000001; +pub const BATTERY_DEVTYPE_GAMEPAD: BYTE = 0x00; +pub const BATTERY_DEVTYPE_HEADSET: BYTE = 0x01; +pub const BATTERY_TYPE_DISCONNECTED: BYTE = 0x00; +pub const BATTERY_TYPE_WIRED: BYTE = 0x01; +pub const BATTERY_TYPE_ALKALINE: BYTE = 0x02; +pub const BATTERY_TYPE_NIMH: BYTE = 0x03; +pub const BATTERY_TYPE_UNKNOWN: BYTE = 0xFF; +pub const BATTERY_LEVEL_EMPTY: BYTE = 0x00; +pub const BATTERY_LEVEL_LOW: BYTE = 0x01; +pub const BATTERY_LEVEL_MEDIUM: BYTE = 0x02; +pub const BATTERY_LEVEL_FULL: BYTE = 0x03; +pub const XUSER_MAX_COUNT: DWORD = 4; +pub const XUSER_INDEX_ANY: DWORD = 0x000000FF; +pub const VK_PAD_A: WORD = 0x5800; +pub const VK_PAD_B: WORD = 0x5801; +pub const VK_PAD_X: WORD = 0x5802; +pub const VK_PAD_Y: WORD = 0x5803; +pub const VK_PAD_RSHOULDER: WORD = 0x5804; +pub const VK_PAD_LSHOULDER: WORD = 0x5805; +pub const VK_PAD_LTRIGGER: WORD = 0x5806; +pub const VK_PAD_RTRIGGER: WORD = 0x5807; +pub const VK_PAD_DPAD_UP: WORD = 0x5810; +pub const VK_PAD_DPAD_DOWN: WORD = 0x5811; +pub const VK_PAD_DPAD_LEFT: WORD = 0x5812; +pub const VK_PAD_DPAD_RIGHT: WORD = 0x5813; +pub const VK_PAD_START: WORD = 0x5814; +pub const VK_PAD_BACK: WORD = 0x5815; +pub const VK_PAD_LTHUMB_PRESS: WORD = 0x5816; +pub const VK_PAD_RTHUMB_PRESS: WORD = 0x5817; +pub const VK_PAD_LTHUMB_UP: WORD = 0x5820; +pub const VK_PAD_LTHUMB_DOWN: WORD = 0x5821; +pub const VK_PAD_LTHUMB_RIGHT: WORD = 0x5822; +pub const VK_PAD_LTHUMB_LEFT: WORD = 0x5823; +pub const VK_PAD_LTHUMB_UPLEFT: WORD = 0x5824; +pub const VK_PAD_LTHUMB_UPRIGHT: WORD = 0x5825; +pub const VK_PAD_LTHUMB_DOWNRIGHT: WORD = 0x5826; +pub const VK_PAD_LTHUMB_DOWNLEFT: WORD = 0x5827; +pub const VK_PAD_RTHUMB_UP: WORD = 0x5830; +pub const VK_PAD_RTHUMB_DOWN: WORD = 0x5831; +pub const VK_PAD_RTHUMB_RIGHT: WORD = 0x5832; +pub const VK_PAD_RTHUMB_LEFT: WORD = 0x5833; +pub const VK_PAD_RTHUMB_UPLEFT: WORD = 0x5834; +pub const VK_PAD_RTHUMB_UPRIGHT: WORD = 0x5835; +pub const VK_PAD_RTHUMB_DOWNRIGHT: WORD = 0x5836; +pub const VK_PAD_RTHUMB_DOWNLEFT: WORD = 0x5837; +pub const XINPUT_KEYSTROKE_KEYDOWN: WORD = 0x0001; +pub const XINPUT_KEYSTROKE_KEYUP: WORD = 0x0002; +pub const XINPUT_KEYSTROKE_REPEAT: WORD = 0x0004; +STRUCT!{struct XINPUT_GAMEPAD { + wButtons: WORD, + bLeftTrigger: BYTE, + bRightTrigger: BYTE, + sThumbLX: SHORT, + sThumbLY: SHORT, + sThumbRX: SHORT, + sThumbRY: SHORT, +}} +pub type PXINPUT_GAMEPAD = *mut XINPUT_GAMEPAD; +STRUCT!{struct XINPUT_STATE { + dwPacketNumber: DWORD, + Gamepad: XINPUT_GAMEPAD, +}} +pub type PXINPUT_STATE = *mut XINPUT_STATE; +STRUCT!{struct XINPUT_VIBRATION { + wLeftMotorSpeed: WORD, + wRightMotorSpeed: WORD, +}} +pub type PXINPUT_VIBRATION = *mut XINPUT_VIBRATION; +STRUCT!{struct XINPUT_CAPABILITIES { + Type: BYTE, + SubType: BYTE, + Flags: WORD, + Gamepad: XINPUT_GAMEPAD, + Vibration: XINPUT_VIBRATION, +}} +pub type PXINPUT_CAPABILITIES = *mut XINPUT_CAPABILITIES; +STRUCT!{struct XINPUT_BATTERY_INFORMATION { + BatteryType: BYTE, + BatteryLevel: BYTE, +}} +pub type PXINPUT_BATTERY_INFORMATION = *mut XINPUT_BATTERY_INFORMATION; +STRUCT!{struct XINPUT_KEYSTROKE { + VirtualKey: WORD, + Unicode: WCHAR, + Flags: WORD, + UserIndex: BYTE, + HidCode: BYTE, +}} +pub type PXINPUT_KEYSTROKE = *mut XINPUT_KEYSTROKE; +extern "system" { + pub fn XInputGetState( + dwUserIndex: DWORD, + pState: *mut XINPUT_STATE, + ) -> DWORD; + pub fn XInputSetState( + dwUserIndex: DWORD, + pVibration: *mut XINPUT_VIBRATION, + ) -> DWORD; + pub fn XInputGetCapabilities( + dwUserIndex: DWORD, + dwFlags: DWORD, + pCapabilities: *mut XINPUT_CAPABILITIES, + ) -> DWORD; + pub fn XInputEnable( + enable: BOOL, + ); + pub fn XInputGetAudioDeviceIds( + dwUserIndex: DWORD, + pRenderDeviceId: LPWSTR, + pRenderCount: *mut UINT, + pCaptureDeviceId: LPWSTR, + pCaptureCount: *mut UINT, + ) -> DWORD; + pub fn XInputGetBatteryInformation( + dwUserIndex: DWORD, + devType: BYTE, + pBatteryInformation: *mut XINPUT_BATTERY_INFORMATION, + ) -> DWORD; + pub fn XInputGetKeystroke( + dwUserIndex: DWORD, + dwReserved: DWORD, + pKeystroke: PXINPUT_KEYSTROKE, + ) -> DWORD; + pub fn XInputGetDSoundAudioDeviceGuids( + dwUserIndex: DWORD, + pDSoundRenderGuid: *mut GUID, + pDSoundCaptureGuid: *mut GUID, + ) -> DWORD; +} diff --git a/bash-5.1/vendor/winapi/src/vc/excpt.rs b/bash-5.1/vendor/winapi/src/vc/excpt.rs new file mode 100644 index 0000000000000000000000000000000000000000..a4f4d91e4ab59d58943610834fe93725e2dabf49 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/vc/excpt.rs @@ -0,0 +1,18 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! The declarations of the compiler-dependent intrinsics, support functions, and keywords which +//! implement the structured exception handling extensions. +ENUM!{enum EXCEPTION_DISPOSITION { + ExceptionContinueExecution, + ExceptionContinueSearch, + ExceptionNestedException, + ExceptionCollidedUnwind, +}} +// While there are functions defined here in `excpt.h`, they are actually intrinsics which have +// special black magic in the msvc compiler. Thus bindings cannot be provided for them. +pub const EXCEPTION_EXECUTE_HANDLER: i32 = 1; +pub const EXCEPTION_CONTINUE_SEARCH: i32 = 0; +pub const EXCEPTION_CONTINUE_EXECUTION: i32 = -1; diff --git a/bash-5.1/vendor/winapi/src/vc/limits.rs b/bash-5.1/vendor/winapi/src/vc/limits.rs new file mode 100644 index 0000000000000000000000000000000000000000..31509adeed3e5c1ff3bc86e40c1bc210b7d7e201 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/vc/limits.rs @@ -0,0 +1,7 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_uint; +pub const UINT_MAX: c_uint = 0xffffffff; diff --git a/bash-5.1/vendor/winapi/src/vc/mod.rs b/bash-5.1/vendor/winapi/src/vc/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..0c0606bd9e95ce885e2bae68e9044f68db00b998 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/vc/mod.rs @@ -0,0 +1,10 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Headers that come with VC. Notably, these are not part of the Windows SDK. +#[cfg(feature = "excpt")] pub mod excpt; +#[cfg(feature = "limits")] pub mod limits; +#[cfg(feature = "vadefs")] pub mod vadefs; +#[cfg(feature = "vcruntime")] pub mod vcruntime; diff --git a/bash-5.1/vendor/winapi/src/vc/vadefs.rs b/bash-5.1/vendor/winapi/src/vc/vadefs.rs new file mode 100644 index 0000000000000000000000000000000000000000..d44cc04db7358ec94e4ee528b17ae80486c7462d --- /dev/null +++ b/bash-5.1/vendor/winapi/src/vc/vadefs.rs @@ -0,0 +1,8 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use ctypes::c_char; +pub type uintptr_t = usize; +pub type va_list = *mut c_char; diff --git a/bash-5.1/vendor/winapi/src/vc/vcruntime.rs b/bash-5.1/vendor/winapi/src/vc/vcruntime.rs new file mode 100644 index 0000000000000000000000000000000000000000..63c671b36bda6aed2a0275347c3bd163e16d4485 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/vc/vcruntime.rs @@ -0,0 +1,9 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Declarations used throughout the VCRuntime library. +pub type size_t = usize; +pub type ptrdiff_t = isize; +pub type intptr_t = isize; diff --git a/bash-5.1/vendor/winapi/src/winrt/activation.rs b/bash-5.1/vendor/winapi/src/winrt/activation.rs new file mode 100644 index 0000000000000000000000000000000000000000..dca597bd17dcc52c7bf60babe3f780db10a28694 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/winrt/activation.rs @@ -0,0 +1,13 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use um::winnt::HRESULT; +use winrt::inspectable::{IInspectable, IInspectableVtbl}; +RIDL!{#[uuid(0x00000035, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] +interface IActivationFactory(IActivationFactoryVtbl): IInspectable(IInspectableVtbl) { + fn ActivateInstance( + instance: *mut *mut IInspectable, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/winrt/hstring.rs b/bash-5.1/vendor/winapi/src/winrt/hstring.rs new file mode 100644 index 0000000000000000000000000000000000000000..3eae6e0cb73ddee715d08007e70c7892ec8b6dec --- /dev/null +++ b/bash-5.1/vendor/winapi/src/winrt/hstring.rs @@ -0,0 +1,25 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! This interface definition contains typedefs for Windows Runtime data types. +use ctypes::c_char; +use um::winnt::PVOID; +DECLARE_HANDLE!{HSTRING, HSTRING__} +#[cfg(target_pointer_width = "32")] +UNION!{union HSTRING_HEADER_Reserved { + [u32; 5], + Reserved1 Reserved1_mut: PVOID, + Reserved2 Reserved2_mut: [c_char; 20], +}} +#[cfg(target_pointer_width = "64")] +UNION!{union HSTRING_HEADER_Reserved { + [u64; 3], + Reserved1 Reserved1_mut: PVOID, + Reserved2 Reserved2_mut: [c_char; 24], +}} +STRUCT!{struct HSTRING_HEADER { + Reserved: HSTRING_HEADER_Reserved, +}} +DECLARE_HANDLE!{HSTRING_BUFFER, HSTRING_BUFFER__} diff --git a/bash-5.1/vendor/winapi/src/winrt/inspectable.rs b/bash-5.1/vendor/winapi/src/winrt/inspectable.rs new file mode 100644 index 0000000000000000000000000000000000000000..fb1e433151aadb6aa842df260ab681934655613e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/winrt/inspectable.rs @@ -0,0 +1,29 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::guiddef::IID; +use shared::minwindef::ULONG; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::HRESULT; +use winrt::hstring::HSTRING; +pub type LPINSPECTABLE = *mut IInspectable; +ENUM!{enum TrustLevel { + BaseTrust = 0, + PartialTrust, + FullTrust, +}} +RIDL!{#[uuid(0xaf86e2e0, 0xb12d, 0x4c6a, 0x9c, 0x5a, 0xd7, 0xaa, 0x65, 0x10, 0x1e, 0x90)] +interface IInspectable(IInspectableVtbl): IUnknown(IUnknownVtbl) { + fn GetIids( + iidCount: *mut ULONG, + iids: *mut *mut IID, + ) -> HRESULT, + fn GetRuntimeClassName( + className: *mut HSTRING, + ) -> HRESULT, + fn GetTrustLevel( + trustLevel: *mut TrustLevel, + ) -> HRESULT, +}} diff --git a/bash-5.1/vendor/winapi/src/winrt/mod.rs b/bash-5.1/vendor/winapi/src/winrt/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..47e38676f14a8accf4bdbc70c28a92271134e34e --- /dev/null +++ b/bash-5.1/vendor/winapi/src/winrt/mod.rs @@ -0,0 +1,12 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +#[cfg(feature = "activation")] pub mod activation; +#[cfg(feature = "hstring")] pub mod hstring; +#[cfg(feature = "inspectable")] pub mod inspectable; +#[cfg(feature = "roapi")] pub mod roapi; +#[cfg(feature = "robuffer")] pub mod robuffer; +#[cfg(feature = "roerrorapi")] pub mod roerrorapi; +#[cfg(feature = "winstring")] pub mod winstring; diff --git a/bash-5.1/vendor/winapi/src/winrt/roapi.rs b/bash-5.1/vendor/winapi/src/winrt/roapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..47b988062c8ec050a944c659010d9a3122691b04 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/winrt/roapi.rs @@ -0,0 +1,60 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{UINT32, UINT64}; +use shared::guiddef::REFIID; +use um::objidl::IApartmentShutdown; +use um::winnt::{HRESULT, VOID}; +use winrt::activation::IActivationFactory; +use winrt::hstring::HSTRING; +use winrt::inspectable::IInspectable; +ENUM!{enum RO_INIT_TYPE { + RO_INIT_SINGLETHREADED = 0, + RO_INIT_MULTITHREADED = 1, +}} +pub enum RO_REGISTRATION_COOKIE__ {} +pub type RO_REGISTRATION_COOKIE = *mut RO_REGISTRATION_COOKIE__; +FN!{stdcall PFNGETACTIVATIONFACTORY( + HSTRING, + *mut *mut IActivationFactory, +) -> HRESULT} +extern "system" { + pub fn RoInitialize( + initType: RO_INIT_TYPE, + ) -> HRESULT; + pub fn RoUninitialize(); + pub fn RoActivateInstance( + activatableClassId: HSTRING, + instance: *mut *mut IInspectable, + ) -> HRESULT; + pub fn RoRegisterActivationFactories( + activatableClassIds: *const HSTRING, + activationFactoryCallbacks: *const PFNGETACTIVATIONFACTORY, + count: UINT32, + cookie: *mut RO_REGISTRATION_COOKIE, + ) -> HRESULT; + pub fn RoRevokeActivationFactories( + cookie: RO_REGISTRATION_COOKIE, + ); + pub fn RoGetActivationFactory( + activatableClassId: HSTRING, + iid: REFIID, + factory: *mut *mut VOID, + ) -> HRESULT; +} +DECLARE_HANDLE!{APARTMENT_SHUTDOWN_REGISTRATION_COOKIE, APARTMENT_SHUTDOWN_REGISTRATION_COOKIE__} +extern "system" { + pub fn RoRegisterForApartmentShutdown( + callbackObject: *const IApartmentShutdown, + apartmentIdentifier: *mut UINT64, + regCookie: *mut APARTMENT_SHUTDOWN_REGISTRATION_COOKIE, + ) -> HRESULT; + pub fn RoUnregisterForApartmentShutdown( + regCookie: APARTMENT_SHUTDOWN_REGISTRATION_COOKIE, + ) -> HRESULT; + pub fn RoGetApartmentIdentifier( + apartmentIdentifier: *mut UINT64, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/winrt/robuffer.rs b/bash-5.1/vendor/winapi/src/winrt/robuffer.rs new file mode 100644 index 0000000000000000000000000000000000000000..b0192fbe28e2db4eabaabf35bf2ada7669764f5b --- /dev/null +++ b/bash-5.1/vendor/winapi/src/winrt/robuffer.rs @@ -0,0 +1,12 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use um::objidl::IMarshal; +use um::winnt::HRESULT; +extern "system" { + pub fn RoGetBufferMarshaler( + bufferMarshaler: *mut *mut IMarshal, + ) -> HRESULT; +} diff --git a/bash-5.1/vendor/winapi/src/winrt/roerrorapi.rs b/bash-5.1/vendor/winapi/src/winrt/roerrorapi.rs new file mode 100644 index 0000000000000000000000000000000000000000..aa9f683a51cae735d9214699bf654a3670168dff --- /dev/null +++ b/bash-5.1/vendor/winapi/src/winrt/roerrorapi.rs @@ -0,0 +1,103 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{UINT32, UINT_PTR}; +use shared::minwindef::{BOOL, BYTE, UINT, USHORT}; +use um::restrictederrorinfo::IRestrictedErrorInfo; +use um::unknwnbase::IUnknown; +use um::winnt::{HRESULT, PCWSTR, PVOID, VOID}; +use winrt::hstring::HSTRING; +ENUM!{enum RO_ERROR_REPORTING_FLAGS { + RO_ERROR_REPORTING_NONE = 0x00000000, + RO_ERROR_REPORTING_SUPPRESSEXCEPTIONS = 0x00000001, + RO_ERROR_REPORTING_FORCEEXCEPTIONS = 0x00000002, + RO_ERROR_REPORTING_USESETERRORINFO = 0x00000004, + RO_ERROR_REPORTING_SUPPRESSSETERRORINFO = 0x00000008, +}} +extern "system" { + pub fn RoGetErrorReportingFlags( + pflags: *mut UINT32, + ) -> HRESULT; + pub fn RoSetErrorReportingFlags( + flags: UINT32, + ) -> HRESULT; + pub fn RoResolveRestrictedErrorInfoReference( + reference: PCWSTR, + ppRestrictedErrorInfo: *mut *mut IRestrictedErrorInfo , + ) -> HRESULT; + pub fn SetRestrictedErrorInfo( + pRestrictedErrorInfo: *const IRestrictedErrorInfo, + ) -> HRESULT; + pub fn GetRestrictedErrorInfo( + ppRestrictedErrorInfo: *mut *mut IRestrictedErrorInfo, + ) -> HRESULT; + pub fn RoOriginateErrorW( + error: HRESULT, + cchMax: UINT, + message: PCWSTR, + ) -> BOOL; + pub fn RoOriginateError( + error: HRESULT, + message: HSTRING, + ) -> BOOL; + pub fn RoTransformErrorW( + oldError: HRESULT, + newError: HRESULT, + cchMax: UINT, + message: PCWSTR, + ) -> BOOL; + pub fn RoTransformError( + oldError: HRESULT, + newError: HRESULT, + message: HSTRING, + ) -> BOOL; + pub fn RoCaptureErrorContext( + hr: HRESULT, + ) -> HRESULT; + pub fn RoFailFastWithErrorContext( + hrError: HRESULT, + ); + pub fn RoOriginateLanguageException( + error: HRESULT, + message: HSTRING, + languageException: *const IUnknown, + ) -> BOOL; + pub fn RoClearError(); + pub fn RoReportUnhandledError( + pRestrictedErrorInfo: *const IRestrictedErrorInfo, + ) -> HRESULT; +} +FN!{stdcall PINSPECT_MEMORY_CALLBACK( + *const VOID, + UINT_PTR, + UINT32, + *mut BYTE, +) -> HRESULT} +extern "system" { + pub fn RoInspectThreadErrorInfo( + targetTebAddress: UINT_PTR, + machine: USHORT, + readMemoryCallback: PINSPECT_MEMORY_CALLBACK, + context: PVOID, + targetErrorInfoAddress: *mut UINT_PTR, + ) -> HRESULT; + pub fn RoInspectCapturedStackBackTrace( + targetErrorInfoAddress: UINT_PTR, + machine: USHORT, + readMemoryCallback: PINSPECT_MEMORY_CALLBACK, + context: PVOID, + frameCount: *mut UINT32, + targetBackTraceAddress: *mut UINT_PTR, + ) -> HRESULT; + pub fn RoGetMatchingRestrictedErrorInfo( + hrIn: HRESULT, + ppRestrictedErrorInfo: *mut *mut IRestrictedErrorInfo, + ) -> HRESULT; + pub fn RoReportFailedDelegate( + punkDelegate: *const IUnknown, + pRestrictedErrorInfo: *const IRestrictedErrorInfo, + ) -> HRESULT; + pub fn IsErrorPropagationEnabled() -> BOOL; +} diff --git a/bash-5.1/vendor/winapi/src/winrt/winstring.rs b/bash-5.1/vendor/winapi/src/winrt/winstring.rs new file mode 100644 index 0000000000000000000000000000000000000000..ecbfcdf2a621d8dcaada8f45d0278f04e45321a7 --- /dev/null +++ b/bash-5.1/vendor/winapi/src/winrt/winstring.rs @@ -0,0 +1,150 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::{INT32, UINT32, UINT_PTR}; +use shared::minwindef::{BOOL, BYTE, UCHAR, ULONG, USHORT}; +use um::winnt::{HRESULT, PCWSTR, VOID, WCHAR}; +use winrt::hstring::{HSTRING, HSTRING_BUFFER, HSTRING_HEADER}; +extern "system" { + pub fn WindowsCreateString( + sourceString: PCWSTR, + length: UINT32, + string: *mut HSTRING, + ) -> HRESULT; + pub fn WindowsCreateStringReference( + sourceString: PCWSTR, + length: UINT32, + hstringHeader: *mut HSTRING_HEADER, + string: *mut HSTRING, + ) -> HRESULT; + pub fn WindowsDeleteString( + string: HSTRING, + ) -> HRESULT; + pub fn WindowsDuplicateString( + string: HSTRING, + newString: *mut HSTRING, + ) -> HRESULT; + pub fn WindowsGetStringLen( + string: HSTRING, + ) -> UINT32; + pub fn WindowsGetStringRawBuffer( + string: HSTRING, + length: *mut UINT32, + ) -> PCWSTR; + pub fn WindowsIsStringEmpty( + string: HSTRING, + ) -> BOOL; + pub fn WindowsStringHasEmbeddedNull( + string: HSTRING, + hasEmbedNull: *mut BOOL, + ) -> HRESULT; + pub fn WindowsCompareStringOrdinal( + string1: HSTRING, + string2: HSTRING, + result: *mut INT32, + ) -> HRESULT; + pub fn WindowsSubstring( + string: HSTRING, + startIndex: UINT32, + newString: *mut HSTRING, + ) -> HSTRING; + pub fn WindowsSubstringWithSpecifiedLength( + string: HSTRING, + startIndex: UINT32, + length: UINT32, + newString: *mut HSTRING, + ) -> HRESULT; + pub fn WindowsConcatString( + string1: HSTRING, + string2: HSTRING, + newString: *mut HSTRING, + ) -> HRESULT; + pub fn WindowsReplaceString( + string: HSTRING, + stringReplaced: HSTRING, + stringReplaceWith: HSTRING, + newString: *mut HSTRING, + ) -> HRESULT; + pub fn WindowsTrimStringStart( + string: HSTRING, + trimString: HSTRING, + newString: *mut HSTRING, + ) -> HRESULT; + pub fn WindowsTrimStringEnd( + string: HSTRING, + trimString: HSTRING, + newString: *mut HSTRING, + ) -> HRESULT; + pub fn WindowsPreallocateStringBuffer( + length: UINT32, + charBuffer: *mut *mut WCHAR, + bufferHandle: *mut HSTRING_BUFFER, + ) -> HRESULT; + pub fn WindowsPromoteStringBuffer( + bufferHandle: HSTRING_BUFFER, + string: *mut HSTRING, + ) -> HRESULT; + pub fn WindowsDeleteStringBuffer( + bufferHandle: HSTRING_BUFFER, + ) -> HRESULT; +} +FN!{stdcall PINSPECT_HSTRING_CALLBACK( + *const VOID, + UINT_PTR, + UINT32, + *mut BYTE, +) -> HRESULT} +extern "system" { + pub fn WindowsInspectString( + targetHString: UINT_PTR, + machine: USHORT, + callback: PINSPECT_HSTRING_CALLBACK, + context: *const VOID, + length: *mut UINT32, + targetStringAddress: *mut UINT_PTR, + ) -> HRESULT; + pub fn HSTRING_UserSize( + pFlags: *const ULONG, + StartingSize: ULONG, + ppidl: *const HSTRING, + ) -> ULONG; + pub fn HSTRING_UserMarshal( + pFlags: *const ULONG, + pBuffer: *mut UCHAR, + ppidl: *const HSTRING, + ) -> *mut UCHAR; + pub fn HSTRING_UserUnmarshal( + pFlags: *const ULONG, + pBuffer: *const UCHAR, + ppidl: *mut HSTRING, + ) -> *mut UCHAR; + pub fn HSTRING_UserFree( + pFlags: *const ULONG, + ppidl: *const HSTRING, + ); + #[cfg(target_arch = "x86_64")] + pub fn HSTRING_UserSize64( + pFlags: *const ULONG, + StartingSize: ULONG, + ppidl: *const HSTRING, + ) -> ULONG; + #[cfg(target_arch = "x86_64")] + pub fn HSTRING_UserMarshal64( + pFlags: *const ULONG, + pBuffer: *mut UCHAR, + ppidl: *const HSTRING, + ) -> *mut UCHAR; + #[cfg(target_arch = "x86_64")] + pub fn HSTRING_UserUnmarshal64( + pFlags: *const ULONG, + pBuffer: *const UCHAR, + ppidl: *mut HSTRING, + ) -> *mut UCHAR; + #[cfg(target_arch = "x86_64")] + pub fn HSTRING_UserFree64( + pFlags: *const ULONG, + ppidl: *const HSTRING, + ); +} diff --git a/record.txt b/record.txt index 8398886d6faa81c57313c0244140674d4785cb18..6929b166db5841b5ce97066d56a44defe5d3656e 100644 --- a/record.txt +++ b/record.txt @@ -58,3 +58,4 @@ 57 58 59 +60